diff --git a/.clang-format b/.clang-format index 2d88571d..edd3e745 100644 --- a/.clang-format +++ b/.clang-format @@ -20,7 +20,7 @@ IndentCaseLabels: true IndentWidth: 4 IndentWrappedFunctionNames: false MaxEmptyLinesToKeep: 3 -NamespaceIndentation: All +NamespaceIndentation: None PenaltyBreakBeforeFirstCallParameter: 1000000000 PointerAlignment: "Left" PointerBindsToType: true diff --git a/.gitignore b/.gitignore index 4b4772e2..f61198f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +build Windows/build .fuse* +Windows/buildlxcl Windows/buildlx Debug/id1 Debug/Id1 @@ -12,6 +14,7 @@ Build-qu* *.blend10 *.blend11 *.blend12 +map_src/autosave # Linux objects .vs diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..8ceac0c3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,253 @@ +cmake_minimum_required(VERSION 3.8) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +project(quakevr VERSION 0.0.5 LANGUAGES CXX) + +set(source_list + "Quake/bgmusic.cpp" + "Quake/byteorder.cpp" + "Quake/cd_sdl.cpp" + "Quake/cfgfile.cpp" + "Quake/chase.cpp" + "Quake/cl_demo.cpp" + "Quake/cl_input.cpp" + "Quake/cl_main.cpp" + "Quake/cl_parse.cpp" + "Quake/cl_tent.cpp" + "Quake/cmd.cpp" + "Quake/common.cpp" + "Quake/console.cpp" + "Quake/crc.cpp" + "Quake/cvar.cpp" + "Quake/fshandle.cpp" + "Quake/gl_draw.cpp" + "Quake/gl_fog.cpp" + "Quake/gl_mesh.cpp" + "Quake/gl_model.cpp" + "Quake/gl_refrag.cpp" + "Quake/gl_rlight.cpp" + "Quake/gl_rmain.cpp" + "Quake/gl_rmisc.cpp" + "Quake/gl_screen.cpp" + "Quake/gl_sky.cpp" + "Quake/gl_texmgr.cpp" + "Quake/gl_util.cpp" + "Quake/gl_vidsdl.cpp" + "Quake/gl_warp.cpp" + "Quake/host_cmd.cpp" + "Quake/host.cpp" + "Quake/image.cpp" + "Quake/in_sdl.cpp" + "Quake/keys.cpp" + "Quake/main_sdl.cpp" + "Quake/mathlib.cpp" + "Quake/menu_util.cpp" + "Quake/menu.cpp" + "Quake/menu_keyboard.cpp" + "Quake/msg.cpp" + "Quake/net_dgrm.cpp" + "Quake/net_loop.cpp" + "Quake/net_main.cpp" + "Quake/pr_cmds.cpp" + "Quake/pr_edict.cpp" + "Quake/pr_exec.cpp" + "Quake/quakeglm.cpp" + "Quake/r_alias.cpp" + "Quake/r_brush.cpp" + "Quake/r_part.cpp" + "Quake/r_sprite.cpp" + "Quake/r_world.cpp" + "Quake/saveutil.cpp" + "Quake/sbar.cpp" + "Quake/server.cpp" + "Quake/shader.cpp" + "Quake/sizebuf.cpp" + "Quake/snd_codec.cpp" + "Quake/snd_dma.cpp" + "Quake/snd_flac.cpp" + "Quake/snd_mem.cpp" + "Quake/snd_mikmod.cpp" + "Quake/snd_mix.cpp" + "Quake/snd_modplug.cpp" + "Quake/snd_mp3.cpp" + "Quake/snd_mp3tag.cpp" + "Quake/snd_opus.cpp" + "Quake/snd_sdl.cpp" + "Quake/snd_umx.cpp" + "Quake/snd_vorbis.cpp" + "Quake/snd_wave.cpp" + "Quake/snd_xmp.cpp" + "Quake/strlcat.cpp" + "Quake/strlcpy.cpp" + "Quake/sv_main.cpp" + "Quake/sv_move.cpp" + "Quake/sv_phys.cpp" + "Quake/sv_user.cpp" + "Quake/view.cpp" + "Quake/vr_cvars.cpp" + "Quake/vr_showfn.cpp" + "Quake/vr.cpp" + "Quake/wad.cpp" + "Quake/world.cpp" + "Quake/zone.cpp" +) + +if (WIN32) + list(APPEND source_list + "Quake/net_win.cpp" + "Quake/net_wins.cpp" + "Quake/net_wipx.cpp" + "Quake/pl_win.cpp" + "Quake/sys_sdl_win.cpp" + ) +else() + list(APPEND source_list + "Quake/net_bsd.cpp" + "Quake/pl_linux.cpp" + "Quake/sys_sdl_unix.cpp" + "Quake/net_udp.cpp" + "Quake/snd_mpg123.cpp" + ) +endif() + + +set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX ) + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(QUAKEVR_TARGET_NAME "quakevr-debug") +else() + set(QUAKEVR_TARGET_NAME "quakevr") +endif() + +add_executable(${QUAKEVR_TARGET_NAME} "${source_list}") +set_target_properties(${QUAKEVR_TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX) + +target_compile_features(${QUAKEVR_TARGET_NAME} PUBLIC cxx_std_17) +target_compile_options(${QUAKEVR_TARGET_NAME} + PRIVATE -Wall -Wextra -Wno-missing-field-initializers -Wpedantic -Wimplicit-fallthrough + -Wno-language-extension-token -Wno-nested-anon-types -Wno-gnu-anonymous-struct -Wno-deprecated-declarations -Wno-microsoft-enum-value # WIN32 only + -Wno-implicit-fallthrough -Wno-c++98-compat -Wno-c++98-compat-pedantic +) + +# -g -fsanitize=address -fdiagnostics-color=always + +# -Wfallthrough + +target_compile_definitions(${QUAKEVR_TARGET_NAME} PRIVATE + USE_SDL2=1 + _AMD64_=1 + -DPARANOID=1 + WIN32=1 + NDEBUG=1 + _WINDOWS=1 + _USE_WINSOCK2=1 + _CRT_NONSTDC_NO_DEPRECATE=1 + _CRT_SECURE_NO_WARNINGS=1 + _WINSOCK_DEPRECATED_NO_WARNINGS=1 + USE_SDL2=1 + USE_CODEC_MP3=1 + USE_CODEC_VORBIS=1 + USE_CODEC_WAVE=1 + USE_CODEC_FLAC=1 + USE_CODEC_OPUS=1 + USE_CODEC_MIKMOD=1 + USE_CODEC_UMX=1 + __clang__=1 +) + +target_include_directories( + ${QUAKEVR_TARGET_NAME} PUBLIC + $ + $ +) + +target_include_directories( + ${QUAKEVR_TARGET_NAME} SYSTEM PUBLIC + $ + $ + $ + $ +) + + +# target_compile_options(${QUAKEVR_TARGET_NAME} PRIVATE +# "-isystem $" +# "-isystem $" +# "-isystem $" +# "-isystem $" +# ) + +set_property(TARGET ${QUAKEVR_TARGET_NAME} PROPERTY CXX_STANDARD 17) + +include(FindOpenGL) + +if (WIN32) + set(SDL2_LIBRARIES + "C:/OHWorkspace/quakevr/Windows/SDL2/lib64/SDL2main.lib" + "C:/OHWorkspace/quakevr/Windows/SDL2/lib64/SDL2.lib" + ) + + target_link_libraries(${QUAKEVR_TARGET_NAME} + ${OPENGL_gl_LIBRARY} ${SDL2_LIBRARIES} wsock32 winmm ws2_32 + ) + + set(OPENVR_LIBRARIES + "C:/OHWorkspace/quakevr/Windows/OpenVR/lib/win64/openvr_api.lib" + ) + + # find_package(GLEW) + # if (GLEW_FOUND) + # include_directories(${GLEW_INCLUDE_DIRS}) + # endif() + + set(OTHER_LIBS + "openvr_api.lib" + "libvorbisfile.lib" + "libvorbis.lib" + "libopusfile.lib" + "libopus.lib" + "libFLAC.lib" + "libogg.lib" + "libmad.lib" + "libmikmod.lib" + "ws2_32.lib" + "opengl32.lib" + "winmm.lib" + "SDL2.lib" + "SDL2main.lib" + "glew32.lib" + ) + + target_link_directories(${QUAKEVR_TARGET_NAME} PUBLIC + "C:/OHWorkspace/openvr/lib/win64" + "Windows/codecs/x64" + "Windows/SDL2/lib64" + "Windows/glew/lib" + ) + + target_link_libraries(${QUAKEVR_TARGET_NAME} + ${OPENGL_gl_LIBRARY} ${SDL2_LIBRARIES} ${OPENVR_LIBRARIES} ${GLEW_LIBRARIES} ${OTHER_LIBS} + ) +else() + find_package(SDL2 REQUIRED) + include_directories(${SDL2_INCLUDE_DIRS}) + + # FIND_PACKAGE(PkgConfig) + # PKG_SEARCH_MODULE(OPENVR REQUIRED openvr) + + set(OPENVR_LIBRARIES + "/home/vittorioromeo/Repos/openvr/bin/linux64/libopenvr_api.so" + ) + + find_package(GLEW REQUIRED) + if (GLEW_FOUND) + include_directories(${GLEW_INCLUDE_DIRS}) + endif() + + target_link_libraries(${QUAKEVR_TARGET_NAME} + asan ${OPENGL_gl_LIBRARY} SDL2::SDL2 ${OPENVR_LIBRARIES} ${GLEW_LIBRARIES} + ) +endif() + + diff --git a/CUSTOM_MAPS.md b/CUSTOM_MAPS.md new file mode 100644 index 00000000..36d506e6 --- /dev/null +++ b/CUSTOM_MAPS.md @@ -0,0 +1,66 @@ + +

+ +

+
+ +# [quakevr](https://vittorioromeo.info/quakevr) + +## Recommended Custom Maps + +In general, any map that doesn't have a custom `progs.dat` will be compatible. + +A good starting point is to visit , sort by rating, and check if the map you're looking at doesn't have a custom `progs.dat`. There is an icon towards the bottom of each map's page that will tell you. Also, the map should not have any "dependency". + +For maps with `.pak`: extracting any `.pak` to the `Id1` folder is the recommended way to install custom maps, but you can also rename the `XX` in `.pakXX` to some unique number which comes before the Quake VR `.pak` files and after the regular Quake ones. + +If you try any of the maps below, please let me know if they work and we can list them under "confirmed working". + +### Confirmed Working + +- https://www.quaddicted.com/reviews/dopa.html +- https://www.quaddicted.com/reviews/honey.html + +### Should Work + +- https://www.quaddicted.com/reviews/ac.html +- https://www.quaddicted.com/reviews/bindingtower2.html +- https://www.quaddicted.com/reviews/could.html +- https://www.quaddicted.com/reviews/czg03.html +- https://www.quaddicted.com/reviews/czgtoxic.html +- https://www.quaddicted.com/reviews/digs05.html +- https://www.quaddicted.com/reviews/dm6rmx.html +- https://www.quaddicted.com/reviews/drearydisposition.html +- https://www.quaddicted.com/reviews/e1m1rmx.html +- https://www.quaddicted.com/reviews/endofsolace.html +- https://www.quaddicted.com/reviews/explorejam1.html +- https://www.quaddicted.com/reviews/fmb_bdg2.html +- https://www.quaddicted.com/reviews/func_mapjam2.html +- https://www.quaddicted.com/reviews/gmsp3tw.html +- https://www.quaddicted.com/reviews/gotshun-never-released_levels.html (requires Scourge of Armagon) +- https://www.quaddicted.com/reviews/grim_rezipped.html +- https://www.quaddicted.com/reviews/ivory1b.html +- https://www.quaddicted.com/reviews/ksp1.html +- https://www.quaddicted.com/reviews/mapjam6.html +- https://www.quaddicted.com/reviews/megad2lvl3.html +- https://www.quaddicted.com/reviews/menk.html +- https://www.quaddicted.com/reviews/nastrond.html +- https://www.quaddicted.com/reviews/qump.html +- https://www.quaddicted.com/reviews/quoffee.html +- https://www.quaddicted.com/reviews/retrojam2.html +- https://www.quaddicted.com/reviews/retrojam3.html +- https://www.quaddicted.com/reviews/retrojam3dlc.html +- https://www.quaddicted.com/reviews/retrojam4dlc_pulsar.html +- https://www.quaddicted.com/reviews/simplex.html +- https://www.quaddicted.com/reviews/sm185_pack.html +- https://www.quaddicted.com/reviews/sm82.html +- https://www.quaddicted.com/reviews/tofaz.html +- https://www.quaddicted.com/reviews/uwjam.html +- https://www.quaddicted.com/reviews/winbbcoh.html +- https://www.quaddicted.com/reviews/zendar1d.html + +### Likely Not Working (Needs Minor Tweaking) + +- https://www.quaddicted.com/reviews/copper.html +- https://www.quaddicted.com/reviews/udob.html + diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index d159169d..00000000 --- a/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/Linux/CodeBlocks/QuakeSpasm.cbp b/Linux/CodeBlocks/QuakeSpasm.cbp deleted file mode 100644 index a93f9abd..00000000 --- a/Linux/CodeBlocks/QuakeSpasm.cbp +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - diff --git a/Linux/sgml/Makefile.sgml b/Linux/sgml/Makefile.sgml deleted file mode 100644 index b5e21f24..00000000 --- a/Linux/sgml/Makefile.sgml +++ /dev/null @@ -1,6 +0,0 @@ -# sgml tools are from linuxdoc-tools -default: Quakespasm.sgml - sgml2html -s 0 -T 2 Quakespasm.sgml 2>/dev/null -all: default text -text txt: Quakespasm.sgml - ./sgml2rawtxt Quakespasm diff --git a/Linux/sgml/Quakespasm.sgml b/Linux/sgml/Quakespasm.sgml deleted file mode 100644 index 6c305191..00000000 --- a/Linux/sgml/Quakespasm.sgml +++ /dev/null @@ -1,566 +0,0 @@ - -
-QuakeSpasm -<toc> -<verb></verb> - -<em>Page last edited: Sep. 2019</em> - -<sect> About <p> - -<url url="http://quakespasm.sourceforge.net" name="QuakeSpasm"> -is a modern, cross-platform Quake 1 engine based on <url url="http://www.celephais.net/fitzquake" name="FitzQuake">. -</p><p> -It includes support for 64 bit CPUs and custom music playback, a new -sound driver, some graphical niceities, and numerous bug-fixes and other improvements. -</p><p> -Quakespasm utilizes either the SDL or SDL2 frameworks, so choose which one works best for you. -SDL is probably less buggy, but SDL2 has nicer features and smoother mouse input - though no CD support. - -<sect> Downloads <p> - -<itemize> -<item><url url="http://quakespasm.sourceforge.net/download.htm" name="Project Downloads"> -<item><url url="http://quakespasm.ericwa.com/job/quakespasm-sdl2/" name="Automatic Builds"> -</itemize> - - -<sect> Hints <p> - -<em>Visit the <url url="http://www.celephais.net/fitzquake" name="FitzQuake homepage"> for a full run-down of the engine's commands and variables.</em> - -<itemize> -<item>To disable some changes, use "<bf>quakespasm -fitz</bf>" - -<item>Quakespasm's custom data is stored in "quakespasm.pak". Install this file alongside your id1 directory to enable the custom console background and other minor features. - -<item>For different sound backend drivers use "<bf>SDL_AUDIODRIVER=</bf><em>DRIVER</em><bf> ./quakespasm</bf>" -, where DRIVER may be alsa, dsp, pulse, esd ... - -<item><bf>Shift+Escape</bf> draws the Console. -<item>From the console, use <bf>UP</bf> to browse the command line history and -<bf>TAB</bf> to autocomplete command and map names. -<item>There is currently no CD Music volume support and SDL2 doesn't support CD audio. cd_sdl.c needs replacing with cd_linux.c, cd_bsd.c etc.. -<item>In windows, alternative CD drives are accessible by "<bf>quakespasm -cddev F</bf>" (for example) - -<item>Quakespasm allows loading new games (mods) on the fly with "<bf>game</bf> <em>GAMENAME {-quoth/hipnotic/rogue}</em>" - -<item>Use "<bf>quakespasm -condebug</bf>" to save console log to "qconsole.log". SDL2 builds no longer generate stdout.txt/stderr.txt. -</itemize> -</p> - -<sect1>Music Playback<p> -Quakespasm can play various external music formats, including MP3, OGG and FLAC. -<itemize> -<item>Tracks should be named like "track02.ogg", "track03.ogg" ... (there is no track01) and placed into "Quake/id1/music". -<item>Unix users may need some extra libraries installed: "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG. -<item>As of 0.90.0, music is played back at 44100 Hz by default with no need to adjust "-sndspeed". -<item>Use the "-noextmusic" option to disable this feature. -<item>See <url url="Quakespasm-Music.txt"> for more details. -</itemize> - -<sect1>Controller Support<p> -The SDL2 variant of Quakespasm supports Xbox 360 style game controllers. -<p> -The default configuration uses the left analog stick for movement and the right for looking. -<p> -If your controller doesn't work you can try placing <url url="https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt" name="this file"> in your Quake directory, it is a community-maintained database that adds support for more controllers to SDL2. - -<sect2>Cvars<p> -<itemize> -<item>joy_deadzone - Fraction of the stick travel to be deadzone, between 0 and 1. Default 0.175. -<item>joy_deadzone_trigger - Fraction of trigger range required to register a button press on the analog triggers, between 0 and 1. Default 0.2. -<item>joy_sensitivity_yaw/pitch - Max angular speed in degrees/second when looking. Defaults are 300 for yaw (turning left/right) and 150 for pitch (up/down). -<item>joy_exponent - For the look stick, the stick displacement (between 0 and 1) is raised to this power. Default is 3. A value of 1 would give a linear relationship between stick displacement and fraction of the maximum angular speed. -<item>joy_invert - Set to 1 to invert the vertical axis of the look stick. -<item>joy_swapmovelook - Set to 1 to swap the left and right analog stick functions. Default 0, move on the left stick, look on the right stick. -<item>joy_enable - Set to 0 to disable controller support. Default 1. -</itemize> - -<sect2>Buttons<p> -Some of the controller buttons are hardcoded to allow navigating the menu: - -<itemize> -<item>Back - alias for TAB -<item>Start - alias for ESC -<item>DPad, analog sticks - mapped to arrow keys -<item>A Button - alias for ENTER in menus -<item>B Button - alias for ESC in menus -</itemize> - -These buttons can be bound normally: - -<itemize> -<item>LTRIGGER - Left trigger -<item>RTRIGGER - Right trigger -<item>LSHOULDER - Left shoulder button -<item>RSHOULDER - Right shoulder button -<item>LTHUMB - Clicking the left thumbstick -<item>RTHUMB - Clicking the right thumbstick -<item>ABUTTON -<item>BBUTTON -<item>XBUTTON -<item>YBUTTON -</itemize> -quakespasm.pak contains a default.cfg which has been updated to give some default bindings. L/R shoulder buttons are bound to weapon switching, and L/R triggers are jump and attack. -<p> -The controller support started as Jeremiah Sypult's implementation in Quakespasm-Rift and also uses ideas and code from LordHavoc (DarkPlaces). - -<sect> Compiling and Installation<p> -<p>Quakespasm's (optional) custom data is now stored in the file <bf>quakespasm.pak</bf>. This file should be placed alongside your quakespasm binary and <bf>id1</bf> directory.</p> -<p><em>To checkout the latest version of QuakeSpasm, do:</em> -<bf>svn co svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm</bf></p> - -<sect1> Linux/Unix <p> -After extracting the source tarball, browse the Makefile and edit the music streaming options, then -<code> -make -cp quakespasm /usr/local/games/quake (for example) -</code> -<newline> -Compile time options include -<itemize> -<item><bf>make DO_USERDIRS=1</bf> to include user directories support -<item><bf>make DEBUG=1</bf> for debugging -<item><bf>make SDL_CONFIG=</bf><em>/PATH/TO/SDL-CONFIG</em> for unusual SDL installations -<item><bf>make USE_SDL2=1</bf> to compile against SDL2 instead of SDL-1.2 -</itemize> -<p>Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files. -<p>The project can also be built with Codeblocks (project files included).</p> - -<sect1> Windows <p> -The QuakeSpasm developers cross-compile windows binaries using <url url="http://www.mingw.org" name="MinGW"> and <url url="http://mingw-w64.sf.net" name="Mingw-w64">. - -The project can also be built using Visual Studio 2005 (or newer).</p> - -<sect1> Mac OS X <p> -A Quakespasm App (including program launcher and update framework) can be made using the <bf>Xcode</bf> template found in the MacOSX directory. - -Alternatively, have a look at <bf>Makefile.darwin</bf> for more instructions on building from a console. -</p> - -<sect> Known Bugs <p> -Brightness issues should be fixed with GLSL gamma in 0.90.1, if your system supports OpenGL 2. For reference on older systems: -<newline> -Some versions of Xorg and SDL have brightness issues. -<newline> -Try setting "export SDL_VIDEO_X11_NODIRECTCOLOR=1", or if you have Xorg >= 7.5 and broken brightness, -these patched libSDL binaries may help. -<itemize> - <item><url url="http://sf.net/projects/quakespasm/files/Support%20Files/libSDL_gamma_patched.tgz/download" - name="Gamma patched libSDL (i686-linux)"></li> - <item><url url="http://sf.net/projects/quakespasm/files/Support%20Files/libSDL_gamma_patched-AMD64.tgz/download" - name="Gamma patched libSDL (x86_64-linux)"> -</itemize> -<sect> Changes<p> - -<sect1> Changes in 0.93.2<p> -<itemize> -<item> Lightmaps are now dynamically allocated (from QSS), and BLOCK_WIDTH/HEIGHT raised from 128 to 256. -<item> Fixed several uncheked limits that would crash the Slayer's Testaments mod (sf.net bug #33). -<item> Raised MAXALIASTRIS from 2048 to 4096, so that the Slayer's Testaments mod works. -<item> Fixed 'pants' and 'shirt' types so that those textures load correctly on platforms where char is unsigned by default (sf.net bug #28). -<item> Windows audio: WASAPI-enabled SDL2 dlls function properly now. -<item> Update the third-party libraries. Other fixes/cleanups. -</itemize> -</p> - -<sect1> Changes in 0.93.1<p> -<itemize> -<item> Fixed a fog regression which was introduced in 0.93.0. -<item> Fixed a crash (buffer overflow) with invalid vis data. -<item> Fixed buttons crushing players in 64-bit builds. -<item> Change controller movement to use cubic easing by default; added "joy_exponent_move" cvar. -<item> config.cfg is no longer written in case of a Sys_Error. -<item> Fixed Opus encoded cd tracks not being recognized as ripped tracks. -<item> Update the third-party libraries. Other fixes/cleanups. -</itemize> -</p> - -<sect1> Changes in 0.93.0<p> -<itemize> -<item> Raise default "joy_deadzone_trigger" cvar to 0.2. -<item> Raise console buffer size to 1MB. -<item> Raise MAX_STATIC_ENTITIES from 512 to 4096. -<item> Raise MAX_STACK_DEPTH from 32 to 64. -<item> Raise command buffer size from 8K to 256K to support large configs. -<item> Remove MAX_EFRAGS and MAX_MAP_LEAFS limits. -<item> Remove "Loadgame buffer overflow" limit, which could happen when loading DP or QSS saves. -<item> Adjust "exceeds standard limit of" debug warnings to include the actual QS limit. -<item> Change "game" command to now exec quake.rc. -<item> Change "games" / "mods" commands to list all subdirectories. -<item> Restore vid_refreshrate from fitzquake-0.85 for SDL2 builds. -<item> Alpha-masked model support. (MF_HOLEY: 0x4000). -<item> Invalid skin index now draws skin 0 (WinQuake behaviour) instead of blue checkerboard. -<item> Change default screenshot format to png. The 'screenshot' command now supports optional format (tga, png or jpg) and quality (1-100) arguments. -<item> Revert "always run" changes from 0.85.9 and move the QuakeSpasm customizations to a new "cl_alwaysrun" cvar: Set to 1 in order to scale forward/side/up speed by "cl_movespeedkey" (usually 2), and to make "speedkey" act as "slowkey". -<item> Change the "always run" menu option to offer three choices: - <itemize> - <item> off (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200) - <item> vanilla (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400) - <item> quakespasm (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200) - </itemize> -<item> New "r_scale" cvar. Set to 2, 3, or 4 to render the view at 1/2, 1/3, or 1/4 resolution. -<item> New "r_viewmodel_quake" cvar. Set to 1 for WinQuake gun position (from MarkV). -<item> New "find" / "apropos" command, searches for commands/cvar names for the given substring (from Spike). -<item> New "randmap" command for loading a random map. -<item> New "gl_cshiftpercent_contents", "gl_cshiftpercent_damage", "gl_cshiftpercent_bonus", "gl_cshiftpercent_powerup" cvars for tuning the strength of specic view blends. -<item> GL2 renderer: use a GLSL shader for world faces. Fixes reports of integrated+discrete GPU laptops having inconsistent fog rendering. -<item> Fix macOS startup delay (avoid calling gethostbyname() for ".local" hostnames). -<item> Fix memory corruption in PF_lightstyle with out of bounds lightstyles. -<item> Fix crash in BoundPoly with polygons extending beyond +/-9999. -<item> Fix QS window to stay on the current monitor when changing video modes (SDL2 only). -<item> Fix possible freeze in SV_TouchLinks regardless of what QC does in the touch function. -<item> Fix for maps with empty strings for vector keys (e.g. "origin"); don't read uninitialized memory. -<item> Support for Open Watcom compiler. -<item> Update the third-party libraries. -</itemize> -</p> - -<sect1> Changes in 0.92.1<p> -<itemize> -<item> Fixed large menu scale factors (was broken in 0.92.0). -<item> Fixed PAUSE key (was broken in 0.92.0). -<item> Updated some of the third-party libraries. -</itemize> -</p> - -<sect1> Changes in 0.92.0<p> -<itemize> -<item> SDL2 Game Controller support. -<item> Contrast support with new "contrast" cvar, behaving the same as MarkV. It may be a useful alternative to the existing gamma control for laptops in a bright environment, etc. Raising contrast gives less of a gray/washed out look than raising gamma, but at a disadvantage: colors near white get clipped to white. -<item> RMQ protocol (999) support, adapted from RMQEngine. -<item> New "-protocol x" command line option. Accepted values for 'x' are 15 (NetQuake), 666 (FitzQuake, default), and 999 (RMQ). -<item> New "setpos" console command. -<item> New "vid_borderless" cvar for getting a borderless window. -<item> Increased MAX_MAP_LEAFS from 65535 to 70000 and MAX_LIGHTMAPS from 256 to 512 in order to handle the oms3 map pack. -<item> Server edicts are now allocated using malloc instead of allocating on the hunk. -<item> gl_clear now defaults to 1. -<item> Fix items falling out of the world on oms3.bsp on SSE builds. -<item> Worked around an OSX 10.6 driver bug when using FSAA, which was leading to an unplayable HOM effect on the rest of the screen. -<item> Fix wrong trace endpoint from the tracepos console command. -<item> Updated some of the third-party libraries. Other fixes/clean-ups. -</itemize> -</p> - -<sect1> Changes in 0.91.0<p> -<sect2> Bugfixes -<itemize> -<item> Fix unwanted fog mode change upon video restart. -<item> Work around Intel 855 bug in status bar drawing with "r_oldwater 0" and "scr_sbaralpha 0". -<item> Fix an obscure GLSL bug where changing gamma would result in the screen turning to noise. -<item> Fix GLSL gamma causing the tiled screen border to turn white when "sizedown" is used. -<item> Fix an alias model VBO renderer bug where a model not precached during map start wouldn't be drawn. -<item> Fix the order of OpenGL context creation and window creation in SDL2 video. -<item> Fix a calling convention issue in windows DPI awareness function pointers. -<item> Fix a random texture recoloring after video mode change. -<item> Fix a liquid turning to garbage after several video mode changes and "r_oldwater 0". -<item> Fix a wrong alpha-sorting bug introduced in 0.90.1. -<item> Fix "flush" command not reloading mdl's from disk (bug introduced in 0.90.1). -<item> Prevent a possible buffer overflow in Cbuf_Execute (old Q1/Q2 bug). -<item> Prevent a possible vulnerability in MSG_ReadString (old Q1/Q2 bug). -</itemize> - -<sect2> Visual improvements -<itemize> -<item> New cvars r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ/RMQEngine, non-archived, default to 0), and new worldspawn keys _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm, similar to the behaviour of the "fog" worldspawn key). -<item> GLSL gamma is now supported on older hardware without NPOT extension. -</itemize> - -<sect2> Interface improvements -<itemize> -<item> New r_pos command to show player position. -<item> NaN detection in traceline with "developer 1" set now warns instead of errors. -</itemize> - -<sect2> Code cleanup / Other -<itemize> -<item> Update third-party libraries. -</itemize> - -<sect2> Raised limits -<itemize> -<item> Default max_edicts 8192 (was 2048) and no longer saved to config.cfg. -<item> Default heapsize 256 MB (was 64 MB). -<item> Default zone 4 MB (was 384 KB). -<item> Raised MAX_SFX to 1024 (was 512). -</itemize> -</p> - -<sect1> Changes in 0.90.1<p> -<sect2> Bugfixes -<itemize> -<item> Fix dynamic light artifact where changing lightmap are rendered one frame late (bug introduced in 0.90.0). -<item> Fix texture memory leak when changing video modes with SDL2. -<item> Fix rare incorrect mdl lighting on 64-bit builds. <url url="http://forums.insideqc.com/viewtopic.php?f=3&t=5620" name="(details here.)"> -<item> Fix fullbrights turning black after "kill" command (bug introduced in 0.90.0). -<item> Clear all fog values on map change to prevent colored fog carrying over to jam3_tronyn.bsp. -<item> Allow loading saves with } character in quoted strings, fixes issue with retrojam1_skacky.bsp. -<item> Fix viewmodel not lerping on extended-limit maps. -<item> Fix crash on out-of-bounds skin number. -</itemize> - -<sect2> Performance -<itemize> -<item> Use multithreaded OpenGL on OS X for better performance. -<item> New, faster mdl renderer using GLSL. Disable with "-noglslalias". -</itemize> - -<sect2> Visual improvements -<itemize> -<item> New gamma correction implementation using GLSL. Fixes all known gamma issues (affecting the full display, persisting after quitting, or darkening the screen on OS X). Disable with "-noglslgamma". -<item> Use high-quality water by default (r_oldwater 0). -<item> Shadows use stencil buffer to avoid overlapping artifacts (from MarkV.) -<item> r_noshadow_list cvar added (from MarkV.) -</itemize> - -<sect2> Interface improvements -<itemize> -<item> Support pausing demo playback with the "pause" command. -<item> Autocompletion for "game", "record", "playdemo". -<item> Experimental windowed fullscreen mode available with vid_desktopfullscreen 1 (only in SDL2 builds, takes effect upon entering fullscreen mode the next time.) -<item> Silence "exceeded standard limit" messages unless developer cvar is >= 1. -<item> Some spam moved from developer 1 to 2: "can't find tga/lit/ent", "trying to load ent", "bad chunk length", "meshing", "PR_AlocStringSlots: realloc'ing" -</itemize> - -<sect2> Code cleanup -<itemize> -<item> Clean up IDE project files to build on fresh systems. -<item> Update 3rd-party libraries. -</itemize> -</p> - -<sect1> Changes in 0.90.0<p> -<itemize> -<item> Fix issues on Windows systems with DPI scaling.</item> -<item> Unix/Mac user directories support. Disabled by default, 'make DO_USERDIRS=1' to enable it. -<item> SDL2 support. Disabled by default, 'make USE_SDL2=1' to enable it. -<item> Revised keyboard input code. -<item> Revised/improved the 'game' command, i.e. on-the-fly mod changing. It now accepts an optional second argument for mission packs or quoth support i.e. -hipnotic, -rogue, or -quoth. For example, for WarpSpasm: "game warp -quoth" -<item> Command line: "-game {quoth/hipnotic/rogue}" is now treated the same as -quoth, -hipnotic, or -rogue. -<item> Console speed now resolution-independent. -<item> Disabled gl_zfix, which caused glitches and is undesirable for new maps. Replacement .ent files to fix z-fighting for several id1 maps added to quakespasm.pak. -<item> PF_VarString buffer bumped to 1024, avoids truncated centerprints from the 'In The Shadows' mod. -<item> Support for opengl non-power-of-two-textures extension (disable with command line: "-notexturenpot".) -<item> Support for OpenGL vertex buffer objects (VBO, OpenGL 1.5 or newer) for world and brush models (disable with command line: "-novbo".) -<item> Antialiasing (FSAA) support (command line: -fsaa x, where x can be 0, 2, 4, 8). -<item> Fence textures support. -<item> Dynamic light speedup. Speedup loading of tga and pcx external images. -<item> Brush model drawing speedup. -<item> Support for BSP2 and 2PSB map formats. -<item> Support for Opus, FLAC, and tracker music (S3M, IT, UMX, etc.), as compile-time options. -<item> Music and sfx now mixed at 44100 Hz to avoid downsampling music. Low-pass filter applied to the sfx if -sndspeed is 11025 (the default), to preserve the same sound quality as 0.85.9. New -mixspeed option sets the rate for mixing sfx and music, and output to the OS (default 44100), setting it to 11025 reverts to 0.85.9 behaviour. New snd_filterquality cvar, value can be between 1 (emulate OS X resampler) and 5 (emulate Windows resampler), controls the sound of the low-pass filter. -<item> Better Hor+ field of view (FOV) scaling behavior. -<item> Better cross-map demo playback support. -<item> Fix screenshots when screen width isn't a multiple of 4. -<item> Fix a lighting glitch due to floating point precision. -<item> Fix a looping sounds glitch. -<item> Fix a vulnerability in file extension handling. Tighten path handling safety. -<item> Initialize opengl with 24-bit depth buffer at 32 bpp. -<item> Reset all models upon gamedir changes. (Fixes failures with mods using custom content.) -<item> Fix broken behavior upon gamedir changes if -basedir is specified on the command line. -<item> NET_MAXMESSAGE and MAX_MSGLEN limits bumped to 64000. -<item> MAX_EFRAGS bumped to 4096, and MAX_CHANNELS to 1024. -<item> MAX_ENT_LEAFS bumped from 16 to 32 to work around disappearing or flickering brush models in some situations. Also, if an entity is visible from MAX_ENT_LEAFS or more leafs, we now always send it to the client. -<item> Fix cvar cycle command not working sometimes. -<item> Host_Error upon missing models. (Prevents segmentation faults.) -<item> Change sv_aim default value to 1 (i.e. turn off autoaim) -<item> Add 'prev' and 'next' keywords to the 'cd' command. -<item> Work around a linux cdrom issue (playback might not start for a while after a stop). -<item> Quakespasm content customization moved from engine-embedded into a new optional quakespasm.pak file. -<item> Version bumped to 0.90.0 (because Quakespasm has a decent life of it's own) -<item> Other fixes and clean-ups. -</itemize> -</p> - -<sect1> Changes in 0.85.9<p> -<itemize> -<item> Fixes for several undefined behaviors in C code (gcc-4.8 support.) -<item> Implemented Hor+ style field of view (FOV) scaling, useful for widescreen resolutions. Configured by new cvar fov_adapt: set it to 1 and your fov will be scaled automatically according to the resolution. Enabled by default. -<item> Adjusted string buffers for PR_ValueString and friends to fix crashes with excessively long global strings seen in some rude mods. -<item> Toned down warning messages from PF_VarString() a bit. -<item> Fixed Fitzquake's map existence check in changelevel (used to leak file handles which would end up in a Sys_Error() due to consuming all free handles if many maps reside not in pak files.) -<item> Fixes/cleanups in chat mode handling. Client no longer gets stuck in chat mode upon disconnect. -<item> Mouse grab/key_dest fixes and key cleanups. -<item> The "speedkey" now acts as "slowkey" when "always run" is on. -<item> Support for demo recording after connection to server. (thanks to Baker for a patch) -<item> Corner case fixes in COM_Parse() for quoted strings and support for C-style /*..*/ comments. -<item> Changed lightmaps to GL_RGBA instead of GL_RGB. -<item> Better parse for opengl extensions list (from quakeforge.) -<item> Vsync saving/loading fixes. -<item> Fixed pointfile loading. -<item> Multiple cleanups in gl_vidsdl.c. -<item> Opus music decoding support (as an optional patch only.) -<item> Several other minor fixes/cleanups. -</itemize> -</p> - -<sect1> Changes in 0.85.8<p> -<itemize> -<item> Made Quake shareware 1.00 and 1.01 versions to be recognized properly. -<item> Fixed control-character handling in unicode mode. Keyboard input tweaks. -<item> Made the keypad keys to send separate key events in game mode. -<item> Text pasting support from OS clipboard to console. (windows and macosx.) -<item> Support for the Apple (Command) key on macosx. -<item> Fixed increased (more than 32) dynamic lights. -<item> Music playback: Made sure that the file's channels count is supported. -<item> Support for Solaris. -<item> Switched to using libmad instead of libmpg123 for MP3 playback on Mac OS X. -<item> Better support for building the Mac OS X version using a makefile, support for cross-compiling on Linux. -<item> Fixed a minor intermissions glitch. -<item> Increased string buffer size from 256 to 384 for PF_VarString to work around broken mods such as UQC. -<item> Restored original behavior for Quake registered version detection. -<item> Minor demo recording/playback tweaks. -<item> Minor tweaks to the scale menu option. -<item> unbindall before loading stored bindings (configurable by new cvar cfg_unbindall, enabled by default.) -<item> New icon. -<item> Miscellaneous source code cleanups. -</itemize> -</p> - -<sect1> Changes in 0.85.7<p> -<itemize> -<item> Added support for cross-level demo playback -<item> gl_texturemode is reimplemented as a cvar with a callback and the setting is automatically saved to the config -<item> Fixed execution of external files without a newline at the end -<item> Reduced memory usage during reloading of textures -<item> Fixed compilation on GNU/kFreeBSD (Debian bug #657793) -<item> Fixed backspace key on Mac OS X -<item> Disable mouse acceleration in Mac OS X -<item> Worked around recursive calling of the anisotropic filter callback -<item> Console word wrap and long input line fixes -<item> Verified correct compilation by clang (using v3.0) -<item> Several other small changes mostly invisible to the end-user -</itemize> -</p> - -<sect1> Changes in 0.85.6<p> -<itemize> -<item> More work for string buffer safety -<item> Reverted v0.85.5 change of not allowing deathmatch and coop cvars to be set at the same time (was reported for possibility of causing compatibility issues with mods) -<item> Several cleanups/changes in the cvar layer -<item> Minor SDL video fixes. -</itemize> -</p> - -<sect1> Changes in 0.85.5<p> -<itemize> -<item> SDL input driver updated adding native keymap and dead key support to the console -<item> Fixed a crash in net play in maps with extended limits -<item> Verified successful compilation using gcc-4.6.x -<item> Added workaround against GL texture flicker (z fighting), controlled by new cvar 'gl_zfix' -<item> Read video variables early so that a vid_restart isn't necessary after init -<item> mlook and lookspring fixes -<item> Added support for loading external entity files, controlled by new cvar 'external_ents' -<item> Made mp3 playback to allocate system memory instead of zone -<item> Some updates to the progs interpreter code -<item> Fixed r_nolerp_list parsing code of fitzquake -<item> Made sure that deathmatch and coop are not set at the same time -<item> Several code updates from uHexen2 project, several code cleanups. -</itemize> -</p> - -<sect1> Changes in 0.85.4<p> -<itemize> -<item> Implement music (OGG, MP3, WAV) playback -<item> A better fix for the infamous SV_TouchLinks problem, no more hard lockups with maps such as "whiteroom" -<item> Add support for mouse buttons 4 and 5 -<item> Fix the "unalias" console command -<item> Restore the "screen size" menu item -<item> Fixed an erroneous protocol check in the server code -<item> Raised the default zone memory size to 384 kb -<item> Raised the default max_edicts from 1024 to 2048 -<item> Revised lit file loading, the lit file must be from the same game directory as the map itself or from a searchpath with a higher priority -<item> Fixed rest of the compiler warnings -<item> Other minor sound and cdaudio updates -</itemize> -</p> - -<sect1> Changes in 0.85.3<p> -<itemize> -<item> Fix the "-dedicated" option (thanks Oz) and add platform specific networking code (default) rather than SDL_net -<item> Much needed OSX framework stuff from Kristian -<item> Add a persistent history feature (thanks Baker) -<item> Add a slider for scr_sbaralpha, which now defaults to 0.95 (slightly transparent, allowing for a nicer status bar) -<item> Allow player messages longer than 32 characters -<item> Sockaddr fix for FreeBSD/OSX/etc networking -<item> Connect status bar size to the scale slider -<item> Include an ISNAN (is not-a-number) fix to catch the occassional quake C bug giving traceline problems -<item> Enumerate options menus -<item> Add a "prev weapon" menu item (from Sander) -<item> Small fix to Sound Block/Unblock on win32 -<item> Lots of code fixes (some from uhexen2) -<item> Sys_Error calls Host_Shutdown -<item> Added MS Visual Studio support -<item> Add a "-cd" option to let the CD Player work in dedicated mode, and some other CD tweaks. -</itemize> - -<sect1> Changes in 0.85.2<p> -<itemize> -<item> Replace the old "Screen size" slider with a "Scale" slider -<item> Don't constantly open and close condebug log -<item> Heap of C clean-ups -<item> Fix mapname sorting -<item> Alias the "mods" command to "games" -<item> Block/Unblock sound upon focus loss/gain -<item> NAT fix (networking protocol fix) -<item> SDLNet_ResolveHost bug-fix allowing connection to ports other than 26000 -<item> Bumped array size of sv_main.c::localmodels from 5 to 6 fixing an old fitzquake-0.85 bug which used to cause segfaults depending on the compiler. -<item> Accept commandline options like "+connect ip:port" -<item> Add OSX Makefile (tested?) -</itemize> - -<sect1> Changes in 0.85.1<p> -<itemize> -<item>64 bit CPU support -<item>Restructured SDL sound driver -<item>Custom conback -<item>Tweaked the command line completion and added a map/changelevel autocompletion function -<item>Alt+Enter toggles fullscreen -<item>Disable Draw_BeginDisc which causes core dumps when called excessively -<item>Show helpful info on start-up -<item>Include real map name (sv.name) and skill in the status bar -<item>Remove confirm quit dialog -<item>Don't spam the console with PackFile seek requests -<item>Default to window mode -<item>Withdraw console when playing demos -<item>Don't play demos on program init -<item>Default Heapsize is 64meg -<item>Changes to default console alpha, speed -<item>Changes to cvar persistence gl_flashblend (default 0), r_shadow, r_wateralpha, r_dynamic, r_novis -</itemize> - - -<sect> Todo <p> -<itemize> -<item>Add uHexen2's first person camera (and menu item) -<item>Native CD audio support (if desired). cd_sdl.c doesn't have proper volume controls and SDL2 doesn't support CD audio -</itemize> - -<sect> Copyright <p> -<itemize> -<item>Quake and Quakespasm are released under the <url url="http://www.gnu.org/licenses/gpl-2.0.html" name="GNU GENERAL PUBLIC LICENSE Version 2"> -<item>Quakespasm console background image by <bf>AAS</bf>, released under the -<url url="http://creativecommons.org/licenses/by/3.0/legalcode" name="CREATIVE COMMONS PUBLIC LICENSE"> -</itemize> - -<sect> Contact <p> -<itemize> -<item><url url="https://sourceforge.net/projects/quakespasm/" name="QuakeSpasm Project page"> -<item><url url="https://sourceforge.net/p/quakespasm/bugs/" name="Bug reports"> -<item><url url="mailto:gmail - dot - com - username - sezeroz" name="Ozkan">, -<url url="mailto:gmail - dot - com - username - ewasylishen" name="Eric">, -<url url="mailto:gmail - dot - com - username - a.h.vandijk" name="Sander"> -</itemize> - -<sect> Links <p> - -<itemize> -<item><url url="http://quakespasm.sourceforge.net" name="QuakeSpasm Homepage"> -<item><url url="http://quakespasm.sourceforge.net/download.htm" name="Downloads"> -<item><url url="http://www.celephais.net/fitzquake" name="FitzQuake Homepage"> -<item><url url="http://www.celephais.net/board/view_thread.php?id=60452" name="Func Quakespasm forum"> -<item><url url="http://forums.insideqc.com" name="Inside3D forums"> -</itemize> - -</article> diff --git a/Linux/sgml/sgml2rawtxt b/Linux/sgml/sgml2rawtxt deleted file mode 100644 index d87d2d36..00000000 --- a/Linux/sgml/sgml2rawtxt +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -sgml2txt -b 2 "$1" -cat "$1.txt" | sed -e 's/[^m]*m//g' -e 's/.//g' >tmp$$ -mv tmp$$ "$1.txt" diff --git a/MacOSX/AppController.h b/MacOSX/AppController.h deleted file mode 100644 index 8e559d65..00000000 --- a/MacOSX/AppController.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import <Carbon/Carbon.h> -#import <Cocoa/Cocoa.h> -#import "QuakeArguments.h" - -extern NSString *FQPrefCommandLineKey; -extern NSString *FQPrefFullscreenKey; -extern NSString *FQPrefScreenModeKey; - -@interface AppController : NSObject { - IBOutlet NSWindow *launcherWindow; - IBOutlet NSTextField *paramTextField; - IBOutlet NSPopUpButton *screenModePopUp; - IBOutlet NSButton *fullscreenCheckBox; - - NSMutableArray *screenModes; - QuakeArguments *arguments; -} - -- (IBAction)changeScreenMode:(id)sender; -- (IBAction)launchQuake:(id)sender; -- (IBAction)cancel:(id)sender; - -- (NSArray *)screenModes; - -@end diff --git a/MacOSX/AppController.m b/MacOSX/AppController.m deleted file mode 100644 index b39051ef..00000000 --- a/MacOSX/AppController.m +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ -#import "AppController.h" -#import "ScreenInfo.h" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) -#import <SDL2/SDL.h> -#else -#import <SDL/SDL.h> -#endif -#else -#import "SDL.h" -#endif -#import "SDLMain.h" - -NSString *FQPrefCommandLineKey = @"CommandLine"; -NSString *FQPrefFullscreenKey = @"Fullscreen"; -NSString *FQPrefScreenModeKey = @"ScreenMode"; - -@implementation AppController - -+(void) initialize { - NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; - - [defaults setObject:@"" forKey:FQPrefCommandLineKey]; - [defaults setObject:[NSNumber numberWithBool:YES] forKey:FQPrefFullscreenKey]; - [defaults setObject:[NSNumber numberWithInt:0] forKey:FQPrefScreenModeKey]; - - [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; -} - -- (id)init { - int i; -#ifndef USE_SDL2 - int j; - int flags; - int bpps[3] = {32, 24, 16}; - SDL_PixelFormat format; - SDL_Rect **modes; -#endif - ScreenInfo *info; - - self = [super init]; - if (!self) - return nil; - - screenModes = [[NSMutableArray alloc] init]; - [screenModes addObject:@"Default or command line arguments"]; - - if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) - return self; - -#if defined(USE_SDL2) - { - const int sdlmodes = SDL_GetNumDisplayModes(0); - for (i = 0; i < sdlmodes; i++) - { - SDL_DisplayMode mode; - if (SDL_GetDisplayMode(0, i, &mode) == 0) - { - info = [[ScreenInfo alloc] initWithWidth:mode.w height:mode.h bpp:SDL_BITSPERPIXEL(mode.format)]; - [screenModes addObject:info]; - [info release]; - } - } - } -#else - flags = SDL_OPENGL | SDL_FULLSCREEN; - format.palette = NULL; - - for (i = 0; i < 3; i++) { - format.BitsPerPixel = bpps[i]; - modes = SDL_ListModes(&format, flags); - - if (modes == (SDL_Rect **)0 || modes == (SDL_Rect **)-1) - continue; - - for (j = 0; modes[j]; j++) { - info = [[ScreenInfo alloc] initWithWidth:modes[j]->w height:modes[j]->h bpp:bpps[i]]; - [screenModes addObject:info]; - [info release]; - } - } -#endif - - SDL_QuitSubSystem(SDL_INIT_VIDEO); - - arguments = [[QuakeArguments alloc] initWithArguments:gArgv + 1 count:gArgc - 1]; - return self; -} - -- (NSArray *)screenModes { - return screenModes; -} - -- (void)awakeFromNib { - if ([arguments count] > 0) { - [paramTextField setStringValue:[arguments description]]; - if ([arguments argument:@"-window"] != nil) - [fullscreenCheckBox setState:NSOffState]; - } else { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [paramTextField setStringValue:[defaults stringForKey:FQPrefCommandLineKey]]; - - BOOL fullscreen = [defaults boolForKey:FQPrefFullscreenKey]; - [fullscreenCheckBox setState:fullscreen ? NSOnState : NSOffState]; - - int screenModeIndex = [defaults integerForKey:FQPrefScreenModeKey]; - [screenModePopUp selectItemAtIndex:screenModeIndex]; - } -} - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - if ([arguments argument:@"-nolauncher"] != nil) { - [arguments removeArgument:@"-nolauncher"]; - [self launchQuake:self]; - } else { - [launcherWindow center]; - [launcherWindow makeKeyAndOrderFront:self]; - } -} - -- (IBAction)changeScreenMode:(id)sender { - int index = [screenModePopUp indexOfSelectedItem]; - [fullscreenCheckBox setEnabled:index != 0]; -} - -- (IBAction)launchQuake:(id)sender { - [arguments parseArguments:[paramTextField stringValue]]; - - int index = [screenModePopUp indexOfSelectedItem]; - if (index > 0) { - ScreenInfo *info = [screenModes objectAtIndex:index]; - - int width = [info width]; - int height = [info height]; - int bpp = [info bpp]; - - [arguments addArgument:@"-width" withValue:[NSString stringWithFormat:@"%d", width]]; - [arguments addArgument:@"-height" withValue:[NSString stringWithFormat:@"%d", height]]; - [arguments addArgument:@"-bpp" withValue:[NSString stringWithFormat:@"%d", bpp]]; - } - - [arguments removeArgument:@"-fullscreen"]; - [arguments removeArgument:@"-window"]; - BOOL fullscreen = [fullscreenCheckBox state] == NSOnState; - if (fullscreen) - [arguments addArgument:@"-fullscreen"]; - else - [arguments addArgument:@"-window"]; - - NSString *path = [NSString stringWithCString:gArgv[0] encoding:NSASCIIStringEncoding]; - - int i; - for (i = 0; i < 4; i++) - path = [path stringByDeletingLastPathComponent]; - - NSFileManager *fileManager = [NSFileManager defaultManager]; - [fileManager changeCurrentDirectoryPath:path]; - - int argc = [arguments count] + 1; - char *argv[argc]; - - argv[0] = gArgv[0]; - [arguments setArguments:argv + 1]; - - [launcherWindow close]; - - // update the defaults - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults setObject:[paramTextField stringValue] forKey:FQPrefCommandLineKey]; - [defaults setObject:[NSNumber numberWithBool:[fullscreenCheckBox state] == NSOnState] forKey:FQPrefFullscreenKey]; - [defaults setObject:[NSNumber numberWithInt:index] forKey:FQPrefScreenModeKey]; - [defaults synchronize]; - - int status = SDL_main (argc, argv); - exit(status); -} - -- (IBAction)cancel:(id)sender { - exit(0); -} - -- (void) dealloc { - [screenModes release]; - [super dealloc]; -} - - -@end diff --git a/MacOSX/Build_Instructions.md b/MacOSX/Build_Instructions.md deleted file mode 100644 index 556511ab..00000000 --- a/MacOSX/Build_Instructions.md +++ /dev/null @@ -1,68 +0,0 @@ -# Building QuakeSpasm -## Prerequisites -Since Apple has dropped support for Mac OS 10.4 and PowerPC from XCode 4, you need to hack your developer tools a bit. You need XCode 3.2.6 from here: - -http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792 - -Then, you need the XCode 4.2 installer from the Mac App Store. Don't start the installation yet. - -If you already have XCode 4 installed, you must uninstall it using the following command from a terminal: - -sudo /<XCode 4 path>/Library/uninstall-devtools --mode=all - -You must reboot your machine after that. - -Now you need to first install XCode 3.2.6 and then XCode 4.2. Then, you will add support for Mac OS 10.4 and 10.5 as well as PowerPC from XCode 3 to XCode 4. But first things first: - -### Install XCode 3 -If you are on Mac OS 10.7 (Lion), you must launch the XCode 3.2.6 installer from the terminal like so: - -export COMMAND_LINE_INSTALL=1 -open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg" - -Otherwise, the installation will fail. Do not install "System Tools" or "Unix Development". You probably don't want to install the iOS SDKs either. You do want to install "Mac OS X 10.4 SDK" however - this is essential. Set "/XCode3" as the destination folder. - -### Install XCode 4 -Launch the installer from the App Store. Be aware that on some systems, you need to launch the installer manually: Right Click on "Install Xcode" and select Show Package Contents. Then navigate to "Contents/Resources" and double click on "Xcode.mpkg". Select "/XCode4" as the destination folder. - -### Restore 10.4 and 10.5 SDK support -Open a terminal and run the following commands: - -cd /XCode4/SDKs -sudo ln -s /Xcode3/SDKs/MacOSX10.4u.sdk . -sudo ln -s /Xcode3/SDKs/MacOSX10.5.sdk . - -### Restore GCC 4.0 support (which gives you PowerPC support) -In your terminal, run the following commands: - -cd /XCode4/usr/bin -sudo ln -s /Xcode3/usr/bin/*4.0* . - -sudo ln -s "/XCode3/Library/Xcode/Plug-ins/GCC 4.0.xcplugin" "/XCode4/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins" - -sudo mkdir -p /XCode4/usr/libexec/gcc -sudo ln -sf /XCode3/usr/libexec/gcc/powerpc-apple-darwin10 /XCode4/usr/libexec/gcc/powerpc-apple-darwin10 - -sudo mkdir -p /XCode4/usr/lib/gcc -sudo ln -sf /XCode3/usr/lib/gcc/powerpc-apple-darwin10 /XCode4/usr/lib/gcc/powerpc-apple-darwin10 - -This should be it. The guides in the link collection at the end of this documents contain information about changing the "as" command also, but I didn't have to do this on my systems. If you run into problems, let me know: kristian.duske@gmail.com - -## Building QuakeSpasm -Now you can build QuakeSpasm. Simply open the project file using XCode 4.2 and make sure that "QuakeSpasm > My Mac 64-bit" is selected as the scheme in the toolbar. Select "Product > Run" from the menu to run and debug QuakeSpasm. This will not produce a universal binary however. To produce a universal binary for Intel 64bit, Intel 32bit and PowerPC 32bit, you need to select "Product > Archive" from the menu. This will create an application archive that contains the universal binary. - -# Useful Links -- XCode 3.2.6: -http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792 - -- Install XCode 3 on 10.7: -http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux - -- Restore support for 10.4, 10.5 and PPC to XCode 4.0: -http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 - -- Scripts that automate the above: -https://github.com/thinkyhead/Legacy-XCode-Scripts - -# Author -Kristian Duske, kristian.duske@gmail.com diff --git a/MacOSX/English.lproj/InfoPlist.strings b/MacOSX/English.lproj/InfoPlist.strings deleted file mode 100644 index 0e59e44c..00000000 Binary files a/MacOSX/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/MacOSX/English.lproj/Launcher.nib/designable.nib b/MacOSX/English.lproj/Launcher.nib/designable.nib deleted file mode 100644 index ab710836..00000000 --- a/MacOSX/English.lproj/Launcher.nib/designable.nib +++ /dev/null @@ -1,2705 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> - <data> - <int key="IBDocument.SystemTarget">1040</int> - <string key="IBDocument.SystemVersion">11C74</string> - <string key="IBDocument.InterfaceBuilderVersion">1938</string> - <string key="IBDocument.AppKitVersion">1138.23</string> - <string key="IBDocument.HIToolboxVersion">567.00</string> - <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> - <string key="NS.object.0">1938</string> - </object> - <object class="NSArray" key="IBDocument.IntegratedClassDependencies"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NSUserDefaultsController</string> - <string>NSPopUpButton</string> - <string>NSMenuItem</string> - <string>NSMenu</string> - <string>NSButtonCell</string> - <string>NSButton</string> - <string>NSTextFieldCell</string> - <string>NSBox</string> - <string>NSCustomObject</string> - <string>NSView</string> - <string>NSWindowTemplate</string> - <string>NSTextField</string> - <string>NSPopUpButtonCell</string> - </object> - <object class="NSArray" key="IBDocument.PluginDependencies"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - </object> - <object class="NSMutableDictionary" key="IBDocument.Metadata"> - <string key="NS.key.0">PluginDependencyRecalculationVersion</string> - <integer value="1" key="NS.object.0"/> - </object> - <object class="NSMutableArray" key="IBDocument.RootObjects" id="1048"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSCustomObject" id="1021"> - <string key="NSClassName">SDLMain</string> - </object> - <object class="NSCustomObject" id="1014"> - <string key="NSClassName">FirstResponder</string> - </object> - <object class="NSCustomObject" id="1050"> - <string key="NSClassName">NSApplication</string> - </object> - <object class="NSMenu" id="649796088"> - <string key="NSTitle">AMainMenu</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="694149608"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">QuakeSpasm</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <object class="NSCustomResource" key="NSOnImage" id="346376208"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">NSMenuCheckmark</string> - </object> - <object class="NSCustomResource" key="NSMixedImage" id="354112804"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">NSMenuMixedState</string> - </object> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="110575045"> - <string key="NSTitle">QuakeSpasm</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="238522557"> - <reference key="NSMenu" ref="110575045"/> - <bool key="NSIsDisabled">YES</bool> - <string key="NSTitle">About QuakeSpasm</string> - <string key="NSKeyEquiv"/> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="304266470"> - <reference key="NSMenu" ref="110575045"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="609285721"> - <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Preferences…</string> - <string key="NSKeyEquiv">,</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="481834944"> - <reference key="NSMenu" ref="110575045"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1046388886"> - <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Services</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="752062318"> - <string key="NSTitle">Services</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> - <string key="NSName">_NSServicesMenu</string> - </object> - </object> - <object class="NSMenuItem" id="646227648"> - <reference key="NSMenu" ref="110575045"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="755159360"> - <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Hide QuakeSpasm</string> - <string key="NSKeyEquiv">h</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="342932134"> - <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Hide Others</string> - <string key="NSKeyEquiv">h</string> - <int key="NSKeyEquivModMask">1572864</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="908899353"> - <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Show All</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1056857174"> - <reference key="NSMenu" ref="110575045"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="632727374"> - <reference key="NSMenu" ref="110575045"/> - <string key="NSTitle">Quit QuakeSpasm</string> - <string key="NSKeyEquiv">q</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - <string key="NSName">_NSAppleMenu</string> - </object> - </object> - <object class="NSMenuItem" id="379814623"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">File</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="720053764"> - <string key="NSTitle">File</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="705341025"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">New</string> - <string key="NSKeyEquiv">n</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="722745758"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Open…</string> - <string key="NSKeyEquiv">o</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1025936716"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Open Recent</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="1065607017"> - <string key="NSTitle">Open Recent</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="759406840"> - <reference key="NSMenu" ref="1065607017"/> - <string key="NSTitle">Clear Menu</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - <string key="NSName">_NSRecentDocumentsMenu</string> - </object> - </object> - <object class="NSMenuItem" id="425164168"> - <reference key="NSMenu" ref="720053764"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="776162233"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Close</string> - <string key="NSKeyEquiv">w</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1023925487"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Save</string> - <string key="NSKeyEquiv">s</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="117038363"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Save As…</string> - <string key="NSKeyEquiv">S</string> - <int key="NSKeyEquivModMask">1179648</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="579971712"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Revert to Saved</string> - <string key="NSKeyEquiv"/> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1010469920"> - <reference key="NSMenu" ref="720053764"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="294629803"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Page Setup...</string> - <string key="NSKeyEquiv">P</string> - <int key="NSKeyEquivModMask">1179648</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSToolTip"/> - </object> - <object class="NSMenuItem" id="49223823"> - <reference key="NSMenu" ref="720053764"/> - <string key="NSTitle">Print…</string> - <string key="NSKeyEquiv">p</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="952259628"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">Edit</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="789758025"> - <string key="NSTitle">Edit</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="1058277027"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Undo</string> - <string key="NSKeyEquiv">z</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="790794224"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Redo</string> - <string key="NSKeyEquiv">Z</string> - <int key="NSKeyEquivModMask">1179648</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1040322652"> - <reference key="NSMenu" ref="789758025"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="296257095"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Cut</string> - <string key="NSKeyEquiv">x</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="860595796"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Copy</string> - <string key="NSKeyEquiv">c</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="29853731"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Paste</string> - <string key="NSKeyEquiv">v</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="437104165"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Delete</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="583158037"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Select All</string> - <string key="NSKeyEquiv">a</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="212016141"> - <reference key="NSMenu" ref="789758025"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="892235320"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Find</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="963351320"> - <string key="NSTitle">Find</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="447796847"> - <reference key="NSMenu" ref="963351320"/> - <string key="NSTitle">Find…</string> - <string key="NSKeyEquiv">f</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">1</int> - </object> - <object class="NSMenuItem" id="326711663"> - <reference key="NSMenu" ref="963351320"/> - <string key="NSTitle">Find Next</string> - <string key="NSKeyEquiv">g</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">2</int> - </object> - <object class="NSMenuItem" id="270902937"> - <reference key="NSMenu" ref="963351320"/> - <string key="NSTitle">Find Previous</string> - <string key="NSKeyEquiv">G</string> - <int key="NSKeyEquivModMask">1179648</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">3</int> - </object> - <object class="NSMenuItem" id="159080638"> - <reference key="NSMenu" ref="963351320"/> - <string key="NSTitle">Use Selection for Find</string> - <string key="NSKeyEquiv">e</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">7</int> - </object> - <object class="NSMenuItem" id="88285865"> - <reference key="NSMenu" ref="963351320"/> - <string key="NSTitle">Jump to Selection</string> - <string key="NSKeyEquiv">j</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="972420730"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Spelling and Grammar</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="769623530"> - <string key="NSTitle">Spelling and Grammar</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="679648819"> - <reference key="NSMenu" ref="769623530"/> - <string key="NSTitle">Show Spelling…</string> - <string key="NSKeyEquiv">:</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="96193923"> - <reference key="NSMenu" ref="769623530"/> - <string key="NSTitle">Check Spelling</string> - <string key="NSKeyEquiv">;</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="948374510"> - <reference key="NSMenu" ref="769623530"/> - <string key="NSTitle">Check Spelling While Typing</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="967646866"> - <reference key="NSMenu" ref="769623530"/> - <string key="NSTitle">Check Grammar With Spelling</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="507821607"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Substitutions</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="698887838"> - <string key="NSTitle">Substitutions</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="605118523"> - <reference key="NSMenu" ref="698887838"/> - <string key="NSTitle">Smart Copy/Paste</string> - <string key="NSKeyEquiv">f</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">1</int> - </object> - <object class="NSMenuItem" id="197661976"> - <reference key="NSMenu" ref="698887838"/> - <string key="NSTitle">Smart Quotes</string> - <string key="NSKeyEquiv">g</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">2</int> - </object> - <object class="NSMenuItem" id="708854459"> - <reference key="NSMenu" ref="698887838"/> - <string key="NSTitle">Smart Links</string> - <string key="NSKeyEquiv">G</string> - <int key="NSKeyEquivModMask">1179648</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <int key="NSTag">3</int> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="676164635"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Speech</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="785027613"> - <string key="NSTitle">Speech</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="731782645"> - <reference key="NSMenu" ref="785027613"/> - <string key="NSTitle">Start Speaking</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="680220178"> - <reference key="NSMenu" ref="785027613"/> - <string key="NSTitle">Stop Speaking</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="626404410"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">Format</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="502084290"> - <string key="NSTitle">Format</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="519768076"> - <reference key="NSMenu" ref="502084290"/> - <string key="NSTitle">Show Fonts</string> - <string key="NSKeyEquiv">t</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="1028416764"> - <reference key="NSMenu" ref="502084290"/> - <string key="NSTitle">Show Colors</string> - <string key="NSKeyEquiv">C</string> - <int key="NSKeyEquivModMask">1179648</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="586577488"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">View</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="466310130"> - <string key="NSTitle">View</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="102151532"> - <reference key="NSMenu" ref="466310130"/> - <string key="NSTitle">Show Toolbar</string> - <string key="NSKeyEquiv">t</string> - <int key="NSKeyEquivModMask">1572864</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="237841660"> - <reference key="NSMenu" ref="466310130"/> - <string key="NSTitle">Customize Toolbar…</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - <object class="NSMenuItem" id="713487014"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">Window</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="835318025"> - <string key="NSTitle">Window</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="1011231497"> - <reference key="NSMenu" ref="835318025"/> - <string key="NSTitle">Minimize</string> - <string key="NSKeyEquiv">m</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="575023229"> - <reference key="NSMenu" ref="835318025"/> - <string key="NSTitle">Zoom</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="299356726"> - <reference key="NSMenu" ref="835318025"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - <object class="NSMenuItem" id="625202149"> - <reference key="NSMenu" ref="835318025"/> - <string key="NSTitle">Bring All to Front</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - <string key="NSName">_NSWindowsMenu</string> - </object> - </object> - <object class="NSMenuItem" id="391199113"> - <reference key="NSMenu" ref="649796088"/> - <string key="NSTitle">Help</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">submenuAction:</string> - <object class="NSMenu" key="NSSubmenu" id="374024848"> - <string key="NSTitle">Help</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMenuItem" id="238773614"> - <reference key="NSMenu" ref="374024848"/> - <string key="NSTitle">NewApplication Help</string> - <string key="NSKeyEquiv">?</string> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - </object> - </object> - </object> - </object> - </object> - <string key="NSName">_NSMainMenu</string> - </object> - <object class="NSWindowTemplate" id="972006081"> - <int key="NSWindowStyleMask">3</int> - <int key="NSWindowBacking">2</int> - <string key="NSWindowRect">{{772, 577}, {511, 251}}</string> - <int key="NSWTFlags">1954022400</int> - <string key="NSWindowTitle">QuakeSpasm</string> - <string key="NSWindowClass">NSWindow</string> - <nil key="NSViewClass"/> - <nil key="NSUserInterfaceItemIdentifier"/> - <object class="NSView" key="NSWindowView" id="439893737"> - <reference key="NSNextResponder"/> - <int key="NSvFlags">256</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSButton" id="114086328"> - <reference key="NSNextResponder" ref="439893737"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{378, 12}, {124, 32}}</string> - <reference key="NSSuperview" ref="439893737"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSButtonCell" key="NSCell" id="424703913"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">134217728</int> - <string key="NSContents">Start</string> - <object class="NSFont" key="NSSupport" id="291399836"> - <string key="NSName">LucidaGrande</string> - <double key="NSSize">13</double> - <int key="NSfFlags">1044</int> - </object> - <reference key="NSControlView" ref="114086328"/> - <int key="NSButtonFlags">-2038284033</int> - <int key="NSButtonFlags2">1</int> - <string key="NSAlternateContents"/> - <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string> - <int key="NSPeriodicDelay">200</int> - <int key="NSPeriodicInterval">25</int> - </object> - </object> - <object class="NSBox" id="810026123"> - <reference key="NSNextResponder" ref="439893737"/> - <int key="NSvFlags">12</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSView" id="97588186"> - <reference key="NSNextResponder" ref="810026123"/> - <int key="NSvFlags">274</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSTextField" id="855675066"> - <reference key="NSNextResponder" ref="97588186"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{15, 127}, {172, 17}}</string> - <reference key="NSSuperview" ref="97588186"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="115727040"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSTextFieldCell" key="NSCell" id="811869973"> - <int key="NSCellFlags">67239488</int> - <int key="NSCellFlags2">272630784</int> - <string key="NSContents">Command line parameters</string> - <reference key="NSSupport" ref="291399836"/> - <reference key="NSControlView" ref="855675066"/> - <object class="NSColor" key="NSBackgroundColor" id="240731113"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">controlColor</string> - <object class="NSColor" key="NSColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> - </object> - </object> - <object class="NSColor" key="NSTextColor" id="1019739469"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">controlTextColor</string> - <object class="NSColor" key="NSColor" id="761839494"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MAA</bytes> - </object> - </object> - </object> - </object> - <object class="NSTextField" id="115727040"> - <reference key="NSNextResponder" ref="97588186"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{18, 97}, {440, 22}}</string> - <reference key="NSSuperview" ref="97588186"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="711594049"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSTextFieldCell" key="NSCell" id="960828514"> - <int key="NSCellFlags">-1804468671</int> - <int key="NSCellFlags2">272630784</int> - <string key="NSContents"/> - <reference key="NSSupport" ref="291399836"/> - <reference key="NSControlView" ref="115727040"/> - <bool key="NSDrawsBackground">YES</bool> - <object class="NSColor" key="NSBackgroundColor" id="367672930"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">textBackgroundColor</string> - <object class="NSColor" key="NSColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MQA</bytes> - </object> - </object> - <object class="NSColor" key="NSTextColor"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">textColor</string> - <reference key="NSColor" ref="761839494"/> - </object> - </object> - </object> - <object class="NSTextField" id="711594049"> - <reference key="NSNextResponder" ref="97588186"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{15, 54}, {175, 17}}</string> - <reference key="NSSuperview" ref="97588186"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="739545509"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSTextFieldCell" key="NSCell" id="589702307"> - <int key="NSCellFlags">67239488</int> - <int key="NSCellFlags2">272630784</int> - <string key="NSContents">Resolution and color depth</string> - <reference key="NSSupport" ref="291399836"/> - <reference key="NSControlView" ref="711594049"/> - <reference key="NSBackgroundColor" ref="240731113"/> - <reference key="NSTextColor" ref="1019739469"/> - </object> - </object> - <object class="NSPopUpButton" id="745888445"> - <reference key="NSNextResponder" ref="97588186"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{15, 22}, {446, 26}}</string> - <reference key="NSSuperview" ref="97588186"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="765364824"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSPopUpButtonCell" key="NSCell" id="749402784"> - <int key="NSCellFlags">-2076049856</int> - <int key="NSCellFlags2">2048</int> - <reference key="NSSupport" ref="291399836"/> - <reference key="NSControlView" ref="745888445"/> - <int key="NSButtonFlags">109199615</int> - <int key="NSButtonFlags2">1</int> - <string key="NSAlternateContents"/> - <string key="NSKeyEquivalent"/> - <int key="NSPeriodicDelay">400</int> - <int key="NSPeriodicInterval">75</int> - <object class="NSMenuItem" key="NSMenuItem" id="529867463"> - <reference key="NSMenu" ref="764703514"/> - <bool key="NSIsDisabled">YES</bool> - <string key="NSTitle">Item 1</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <int key="NSState">1</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">_popUpItemAction:</string> - <reference key="NSTarget" ref="749402784"/> - </object> - <bool key="NSMenuItemRespectAlignment">YES</bool> - <object class="NSMenu" key="NSMenu" id="764703514"> - <string key="NSTitle">OtherViews</string> - <object class="NSMutableArray" key="NSMenuItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="529867463"/> - <object class="NSMenuItem" id="614627850"> - <reference key="NSMenu" ref="764703514"/> - <string key="NSTitle">Item 2</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">_popUpItemAction:</string> - <reference key="NSTarget" ref="749402784"/> - </object> - <object class="NSMenuItem" id="743472145"> - <reference key="NSMenu" ref="764703514"/> - <string key="NSTitle">Item 3</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="346376208"/> - <reference key="NSMixedImage" ref="354112804"/> - <string key="NSAction">_popUpItemAction:</string> - <reference key="NSTarget" ref="749402784"/> - </object> - </object> - </object> - <int key="NSPreferredEdge">1</int> - <bool key="NSUsesItemFromMenu">YES</bool> - <bool key="NSAltersState">YES</bool> - <int key="NSArrowPosition">2</int> - </object> - </object> - <object class="NSButton" id="739545509"> - <reference key="NSNextResponder" ref="97588186"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{374, 52}, {86, 18}}</string> - <reference key="NSSuperview" ref="97588186"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="745888445"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSButtonCell" key="NSCell" id="721358094"> - <int key="NSCellFlags">-2080244224</int> - <int key="NSCellFlags2">0</int> - <string key="NSContents">Fullscreen</string> - <reference key="NSSupport" ref="291399836"/> - <reference key="NSControlView" ref="739545509"/> - <int key="NSButtonFlags">1211912703</int> - <int key="NSButtonFlags2">2</int> - <object class="NSCustomResource" key="NSNormalImage"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">NSSwitch</string> - </object> - <object class="NSButtonImageSource" key="NSAlternateImage"> - <string key="NSImageName">NSSwitch</string> - </object> - <string key="NSAlternateContents"/> - <string key="NSKeyEquivalent"/> - <int key="NSPeriodicDelay">200</int> - <int key="NSPeriodicInterval">25</int> - </object> - </object> - </object> - <string key="NSFrame">{{1, 1}, {480, 159}}</string> - <reference key="NSSuperview" ref="810026123"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="855675066"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - </object> - </object> - <string key="NSFrame">{{17, 56}, {482, 175}}</string> - <reference key="NSSuperview" ref="439893737"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="97588186"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <string key="NSOffsets">{0, 0}</string> - <object class="NSTextFieldCell" key="NSTitleCell"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">0</int> - <string key="NSContents">Settings</string> - <object class="NSFont" key="NSSupport"> - <string key="NSName">LucidaGrande</string> - <double key="NSSize">11</double> - <int key="NSfFlags">3100</int> - </object> - <reference key="NSBackgroundColor" ref="367672930"/> - <object class="NSColor" key="NSTextColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes> - </object> - </object> - <reference key="NSContentView" ref="97588186"/> - <int key="NSBorderType">1</int> - <int key="NSBoxType">0</int> - <int key="NSTitlePosition">2</int> - <bool key="NSTransparent">NO</bool> - </object> - <object class="NSButton" id="765364824"> - <reference key="NSNextResponder" ref="439893737"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{254, 12}, {124, 32}}</string> - <reference key="NSSuperview" ref="439893737"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="114086328"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - <bool key="NSEnabled">YES</bool> - <object class="NSButtonCell" key="NSCell" id="99746102"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">134217728</int> - <string key="NSContents">Cancel</string> - <reference key="NSSupport" ref="291399836"/> - <reference key="NSControlView" ref="765364824"/> - <int key="NSButtonFlags">-2038284033</int> - <int key="NSButtonFlags2">129</int> - <string key="NSAlternateContents"/> - <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string> - <int key="NSPeriodicDelay">200</int> - <int key="NSPeriodicInterval">25</int> - </object> - </object> - </object> - <string key="NSFrameSize">{511, 251}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="810026123"/> - <int key="NSViewLayerContentsRedrawPolicy">2</int> - </object> - <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> - <string key="NSMaxSize">{10000000000000, 10000000000000}</string> - <bool key="NSWindowIsRestorable">YES</bool> - </object> - <object class="NSCustomObject" id="561825427"> - <string key="NSClassName">AppController</string> - </object> - <object class="NSUserDefaultsController" id="412016019"> - <bool key="NSSharedInstance">YES</bool> - </object> - </object> - <object class="IBObjectContainer" key="IBDocument.Objects"> - <object class="NSMutableArray" key="connectionRecords"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">delegate</string> - <reference key="source" ref="1050"/> - <reference key="destination" ref="561825427"/> - </object> - <int key="connectionID">464</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">performMiniaturize:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="1011231497"/> - </object> - <int key="connectionID">37</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">arrangeInFront:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="625202149"/> - </object> - <int key="connectionID">39</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">print:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="49223823"/> - </object> - <int key="connectionID">86</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">runPageLayout:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="294629803"/> - </object> - <int key="connectionID">87</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">clearRecentDocuments:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="759406840"/> - </object> - <int key="connectionID">127</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">performClose:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="776162233"/> - </object> - <int key="connectionID">193</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">toggleContinuousSpellChecking:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="948374510"/> - </object> - <int key="connectionID">222</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">undo:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="1058277027"/> - </object> - <int key="connectionID">223</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">copy:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="860595796"/> - </object> - <int key="connectionID">224</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">checkSpelling:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="96193923"/> - </object> - <int key="connectionID">225</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">paste:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="29853731"/> - </object> - <int key="connectionID">226</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">stopSpeaking:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="680220178"/> - </object> - <int key="connectionID">227</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">cut:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="296257095"/> - </object> - <int key="connectionID">228</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">showGuessPanel:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="679648819"/> - </object> - <int key="connectionID">230</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">redo:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="790794224"/> - </object> - <int key="connectionID">231</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">selectAll:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="583158037"/> - </object> - <int key="connectionID">232</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">startSpeaking:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="731782645"/> - </object> - <int key="connectionID">233</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">delete:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="437104165"/> - </object> - <int key="connectionID">235</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">performZoom:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="575023229"/> - </object> - <int key="connectionID">240</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">performFindPanelAction:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="447796847"/> - </object> - <int key="connectionID">241</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">centerSelectionInVisibleArea:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="88285865"/> - </object> - <int key="connectionID">245</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">toggleGrammarChecking:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="967646866"/> - </object> - <int key="connectionID">347</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">toggleSmartInsertDelete:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="605118523"/> - </object> - <int key="connectionID">355</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">toggleAutomaticQuoteSubstitution:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="197661976"/> - </object> - <int key="connectionID">356</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">toggleAutomaticLinkDetection:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="708854459"/> - </object> - <int key="connectionID">357</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">showHelp:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="238773614"/> - </object> - <int key="connectionID">360</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">orderFrontColorPanel:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="1028416764"/> - </object> - <int key="connectionID">361</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">saveDocument:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="1023925487"/> - </object> - <int key="connectionID">362</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">saveDocumentAs:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="117038363"/> - </object> - <int key="connectionID">363</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">revertDocumentToSaved:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="579971712"/> - </object> - <int key="connectionID">364</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">runToolbarCustomizationPalette:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="237841660"/> - </object> - <int key="connectionID">365</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">toggleToolbarShown:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="102151532"/> - </object> - <int key="connectionID">366</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">hide:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="755159360"/> - </object> - <int key="connectionID">367</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">hideOtherApplications:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="342932134"/> - </object> - <int key="connectionID">368</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">terminate:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="632727374"/> - </object> - <int key="connectionID">369</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">unhideAllApplications:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="908899353"/> - </object> - <int key="connectionID">370</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">newDocument:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="705341025"/> - </object> - <int key="connectionID">373</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">openDocument:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="722745758"/> - </object> - <int key="connectionID">374</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">delegate</string> - <reference key="source" ref="972006081"/> - <reference key="destination" ref="561825427"/> - </object> - <int key="connectionID">415</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">launchQuake:</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="114086328"/> - </object> - <int key="connectionID">378</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">paramTextField</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="115727040"/> - </object> - <int key="connectionID">412</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">launcherWindow</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="972006081"/> - </object> - <int key="connectionID">414</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">cancel:</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="765364824"/> - </object> - <int key="connectionID">418</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">screenModePopUp</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="745888445"/> - </object> - <int key="connectionID">452</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">fullscreenCheckBox</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="739545509"/> - </object> - <int key="connectionID">453</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">changeScreenMode:</string> - <reference key="source" ref="561825427"/> - <reference key="destination" ref="745888445"/> - </object> - <int key="connectionID">455</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBBindingConnection" key="connection"> - <string key="label">content: screenModes</string> - <reference key="source" ref="745888445"/> - <reference key="destination" ref="561825427"/> - <object class="NSNibBindingConnector" key="connector"> - <reference key="NSSource" ref="745888445"/> - <reference key="NSDestination" ref="561825427"/> - <string key="NSLabel">content: screenModes</string> - <string key="NSBinding">content</string> - <string key="NSKeyPath">screenModes</string> - <int key="NSNibBindingConnectorVersion">2</int> - </object> - </object> - <int key="connectionID">449</int> - </object> - </object> - <object class="IBMutableOrderedSet" key="objectRecords"> - <object class="NSArray" key="orderedObjects"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBObjectRecord"> - <int key="objectID">0</int> - <object class="NSArray" key="object" id="0"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> - <reference key="children" ref="1048"/> - <nil key="parent"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">-2</int> - <reference key="object" ref="1021"/> - <reference key="parent" ref="0"/> - <string key="objectName">File's Owner</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">-1</int> - <reference key="object" ref="1014"/> - <reference key="parent" ref="0"/> - <string key="objectName">First Responder</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">-3</int> - <reference key="object" ref="1050"/> - <reference key="parent" ref="0"/> - <string key="objectName">Application</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">29</int> - <reference key="object" ref="649796088"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="713487014"/> - <reference ref="694149608"/> - <reference ref="391199113"/> - <reference ref="952259628"/> - <reference ref="379814623"/> - <reference ref="586577488"/> - <reference ref="626404410"/> - </object> - <reference key="parent" ref="0"/> - <string key="objectName">MainMenu</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">19</int> - <reference key="object" ref="713487014"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="835318025"/> - </object> - <reference key="parent" ref="649796088"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">56</int> - <reference key="object" ref="694149608"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="110575045"/> - </object> - <reference key="parent" ref="649796088"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">103</int> - <reference key="object" ref="391199113"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="374024848"/> - </object> - <reference key="parent" ref="649796088"/> - <string key="objectName">1</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">217</int> - <reference key="object" ref="952259628"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="789758025"/> - </object> - <reference key="parent" ref="649796088"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">83</int> - <reference key="object" ref="379814623"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="720053764"/> - </object> - <reference key="parent" ref="649796088"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">81</int> - <reference key="object" ref="720053764"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1023925487"/> - <reference ref="117038363"/> - <reference ref="49223823"/> - <reference ref="722745758"/> - <reference ref="705341025"/> - <reference ref="1025936716"/> - <reference ref="294629803"/> - <reference ref="776162233"/> - <reference ref="425164168"/> - <reference ref="579971712"/> - <reference ref="1010469920"/> - </object> - <reference key="parent" ref="379814623"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">75</int> - <reference key="object" ref="1023925487"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">3</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">80</int> - <reference key="object" ref="117038363"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">8</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">78</int> - <reference key="object" ref="49223823"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">6</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">72</int> - <reference key="object" ref="722745758"/> - <reference key="parent" ref="720053764"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">82</int> - <reference key="object" ref="705341025"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">9</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">124</int> - <reference key="object" ref="1025936716"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1065607017"/> - </object> - <reference key="parent" ref="720053764"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">77</int> - <reference key="object" ref="294629803"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">5</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">73</int> - <reference key="object" ref="776162233"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">1</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">79</int> - <reference key="object" ref="425164168"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">7</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">112</int> - <reference key="object" ref="579971712"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">10</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">74</int> - <reference key="object" ref="1010469920"/> - <reference key="parent" ref="720053764"/> - <string key="objectName">2</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">125</int> - <reference key="object" ref="1065607017"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="759406840"/> - </object> - <reference key="parent" ref="1025936716"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">126</int> - <reference key="object" ref="759406840"/> - <reference key="parent" ref="1065607017"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">205</int> - <reference key="object" ref="789758025"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="437104165"/> - <reference ref="583158037"/> - <reference ref="1058277027"/> - <reference ref="212016141"/> - <reference ref="296257095"/> - <reference ref="29853731"/> - <reference ref="860595796"/> - <reference ref="1040322652"/> - <reference ref="790794224"/> - <reference ref="892235320"/> - <reference ref="972420730"/> - <reference ref="676164635"/> - <reference ref="507821607"/> - </object> - <reference key="parent" ref="952259628"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">202</int> - <reference key="object" ref="437104165"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">198</int> - <reference key="object" ref="583158037"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">207</int> - <reference key="object" ref="1058277027"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">214</int> - <reference key="object" ref="212016141"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">199</int> - <reference key="object" ref="296257095"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">203</int> - <reference key="object" ref="29853731"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">197</int> - <reference key="object" ref="860595796"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">206</int> - <reference key="object" ref="1040322652"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">215</int> - <reference key="object" ref="790794224"/> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">218</int> - <reference key="object" ref="892235320"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="963351320"/> - </object> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">216</int> - <reference key="object" ref="972420730"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="769623530"/> - </object> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">200</int> - <reference key="object" ref="769623530"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="948374510"/> - <reference ref="96193923"/> - <reference ref="679648819"/> - <reference ref="967646866"/> - </object> - <reference key="parent" ref="972420730"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">219</int> - <reference key="object" ref="948374510"/> - <reference key="parent" ref="769623530"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">201</int> - <reference key="object" ref="96193923"/> - <reference key="parent" ref="769623530"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">204</int> - <reference key="object" ref="679648819"/> - <reference key="parent" ref="769623530"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">220</int> - <reference key="object" ref="963351320"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="270902937"/> - <reference ref="88285865"/> - <reference ref="159080638"/> - <reference ref="326711663"/> - <reference ref="447796847"/> - </object> - <reference key="parent" ref="892235320"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">213</int> - <reference key="object" ref="270902937"/> - <reference key="parent" ref="963351320"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">210</int> - <reference key="object" ref="88285865"/> - <reference key="parent" ref="963351320"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">221</int> - <reference key="object" ref="159080638"/> - <reference key="parent" ref="963351320"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">208</int> - <reference key="object" ref="326711663"/> - <reference key="parent" ref="963351320"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">209</int> - <reference key="object" ref="447796847"/> - <reference key="parent" ref="963351320"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">106</int> - <reference key="object" ref="374024848"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="238773614"/> - </object> - <reference key="parent" ref="391199113"/> - <string key="objectName">2</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">111</int> - <reference key="object" ref="238773614"/> - <reference key="parent" ref="374024848"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">57</int> - <reference key="object" ref="110575045"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="238522557"/> - <reference ref="755159360"/> - <reference ref="908899353"/> - <reference ref="632727374"/> - <reference ref="646227648"/> - <reference ref="609285721"/> - <reference ref="481834944"/> - <reference ref="304266470"/> - <reference ref="1046388886"/> - <reference ref="1056857174"/> - <reference ref="342932134"/> - </object> - <reference key="parent" ref="694149608"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">58</int> - <reference key="object" ref="238522557"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">134</int> - <reference key="object" ref="755159360"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">150</int> - <reference key="object" ref="908899353"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">136</int> - <reference key="object" ref="632727374"/> - <reference key="parent" ref="110575045"/> - <string key="objectName">1111</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">144</int> - <reference key="object" ref="646227648"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">129</int> - <reference key="object" ref="609285721"/> - <reference key="parent" ref="110575045"/> - <string key="objectName">121</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">143</int> - <reference key="object" ref="481834944"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">236</int> - <reference key="object" ref="304266470"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">131</int> - <reference key="object" ref="1046388886"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="752062318"/> - </object> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">149</int> - <reference key="object" ref="1056857174"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">145</int> - <reference key="object" ref="342932134"/> - <reference key="parent" ref="110575045"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">130</int> - <reference key="object" ref="752062318"/> - <reference key="parent" ref="1046388886"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">24</int> - <reference key="object" ref="835318025"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="299356726"/> - <reference ref="625202149"/> - <reference ref="575023229"/> - <reference ref="1011231497"/> - </object> - <reference key="parent" ref="713487014"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">92</int> - <reference key="object" ref="299356726"/> - <reference key="parent" ref="835318025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">5</int> - <reference key="object" ref="625202149"/> - <reference key="parent" ref="835318025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">239</int> - <reference key="object" ref="575023229"/> - <reference key="parent" ref="835318025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">23</int> - <reference key="object" ref="1011231497"/> - <reference key="parent" ref="835318025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">295</int> - <reference key="object" ref="586577488"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="466310130"/> - </object> - <reference key="parent" ref="649796088"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">296</int> - <reference key="object" ref="466310130"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="102151532"/> - <reference ref="237841660"/> - </object> - <reference key="parent" ref="586577488"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">297</int> - <reference key="object" ref="102151532"/> - <reference key="parent" ref="466310130"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">298</int> - <reference key="object" ref="237841660"/> - <reference key="parent" ref="466310130"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">299</int> - <reference key="object" ref="626404410"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="502084290"/> - </object> - <reference key="parent" ref="649796088"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">300</int> - <reference key="object" ref="502084290"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="519768076"/> - <reference ref="1028416764"/> - </object> - <reference key="parent" ref="626404410"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">344</int> - <reference key="object" ref="519768076"/> - <reference key="parent" ref="502084290"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">345</int> - <reference key="object" ref="1028416764"/> - <reference key="parent" ref="502084290"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">211</int> - <reference key="object" ref="676164635"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="785027613"/> - </object> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">212</int> - <reference key="object" ref="785027613"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="680220178"/> - <reference ref="731782645"/> - </object> - <reference key="parent" ref="676164635"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">195</int> - <reference key="object" ref="680220178"/> - <reference key="parent" ref="785027613"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">196</int> - <reference key="object" ref="731782645"/> - <reference key="parent" ref="785027613"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">346</int> - <reference key="object" ref="967646866"/> - <reference key="parent" ref="769623530"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">348</int> - <reference key="object" ref="507821607"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="698887838"/> - </object> - <reference key="parent" ref="789758025"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">349</int> - <reference key="object" ref="698887838"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="605118523"/> - <reference ref="197661976"/> - <reference ref="708854459"/> - </object> - <reference key="parent" ref="507821607"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">350</int> - <reference key="object" ref="605118523"/> - <reference key="parent" ref="698887838"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">351</int> - <reference key="object" ref="197661976"/> - <reference key="parent" ref="698887838"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">354</int> - <reference key="object" ref="708854459"/> - <reference key="parent" ref="698887838"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">371</int> - <reference key="object" ref="972006081"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="439893737"/> - </object> - <reference key="parent" ref="0"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">372</int> - <reference key="object" ref="439893737"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="114086328"/> - <reference ref="810026123"/> - <reference ref="765364824"/> - </object> - <reference key="parent" ref="972006081"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">375</int> - <reference key="object" ref="561825427"/> - <reference key="parent" ref="0"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">376</int> - <reference key="object" ref="114086328"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="424703913"/> - </object> - <reference key="parent" ref="439893737"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">377</int> - <reference key="object" ref="424703913"/> - <reference key="parent" ref="114086328"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">395</int> - <reference key="object" ref="810026123"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="855675066"/> - <reference ref="115727040"/> - <reference ref="711594049"/> - <reference ref="745888445"/> - <reference ref="739545509"/> - </object> - <reference key="parent" ref="439893737"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">397</int> - <reference key="object" ref="855675066"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="811869973"/> - </object> - <reference key="parent" ref="810026123"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">398</int> - <reference key="object" ref="115727040"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="960828514"/> - </object> - <reference key="parent" ref="810026123"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">399</int> - <reference key="object" ref="711594049"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="589702307"/> - </object> - <reference key="parent" ref="810026123"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">400</int> - <reference key="object" ref="745888445"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="749402784"/> - </object> - <reference key="parent" ref="810026123"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">401</int> - <reference key="object" ref="749402784"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="764703514"/> - </object> - <reference key="parent" ref="745888445"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">402</int> - <reference key="object" ref="764703514"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="743472145"/> - <reference ref="614627850"/> - <reference ref="529867463"/> - </object> - <reference key="parent" ref="749402784"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">403</int> - <reference key="object" ref="743472145"/> - <reference key="parent" ref="764703514"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">404</int> - <reference key="object" ref="614627850"/> - <reference key="parent" ref="764703514"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">405</int> - <reference key="object" ref="529867463"/> - <reference key="parent" ref="764703514"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">406</int> - <reference key="object" ref="589702307"/> - <reference key="parent" ref="711594049"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">407</int> - <reference key="object" ref="960828514"/> - <reference key="parent" ref="115727040"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">408</int> - <reference key="object" ref="811869973"/> - <reference key="parent" ref="855675066"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">410</int> - <reference key="object" ref="765364824"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="99746102"/> - </object> - <reference key="parent" ref="439893737"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">411</int> - <reference key="object" ref="99746102"/> - <reference key="parent" ref="765364824"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">419</int> - <reference key="object" ref="412016019"/> - <reference key="parent" ref="0"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">450</int> - <reference key="object" ref="739545509"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="721358094"/> - </object> - <reference key="parent" ref="810026123"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">451</int> - <reference key="object" ref="721358094"/> - <reference key="parent" ref="739545509"/> - </object> - </object> - </object> - <object class="NSMutableDictionary" key="flattenedProperties"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>-1.IBPluginDependency</string> - <string>-2.IBPluginDependency</string> - <string>-3.IBPluginDependency</string> - <string>103.IBPluginDependency</string> - <string>106.IBPluginDependency</string> - <string>111.IBPluginDependency</string> - <string>112.IBPluginDependency</string> - <string>124.IBPluginDependency</string> - <string>125.IBPluginDependency</string> - <string>126.IBPluginDependency</string> - <string>129.IBPluginDependency</string> - <string>130.IBPluginDependency</string> - <string>131.IBPluginDependency</string> - <string>134.IBPluginDependency</string> - <string>136.IBPluginDependency</string> - <string>143.IBPluginDependency</string> - <string>144.IBPluginDependency</string> - <string>145.IBPluginDependency</string> - <string>149.IBPluginDependency</string> - <string>150.IBPluginDependency</string> - <string>19.IBPluginDependency</string> - <string>195.IBPluginDependency</string> - <string>196.IBPluginDependency</string> - <string>197.IBPluginDependency</string> - <string>198.IBPluginDependency</string> - <string>199.IBPluginDependency</string> - <string>200.IBPluginDependency</string> - <string>201.IBPluginDependency</string> - <string>202.IBPluginDependency</string> - <string>203.IBPluginDependency</string> - <string>204.IBPluginDependency</string> - <string>205.IBPluginDependency</string> - <string>206.IBPluginDependency</string> - <string>207.IBPluginDependency</string> - <string>208.IBPluginDependency</string> - <string>209.IBPluginDependency</string> - <string>210.IBPluginDependency</string> - <string>211.IBPluginDependency</string> - <string>212.IBPluginDependency</string> - <string>213.IBPluginDependency</string> - <string>214.IBPluginDependency</string> - <string>215.IBPluginDependency</string> - <string>216.IBPluginDependency</string> - <string>217.IBPluginDependency</string> - <string>218.IBPluginDependency</string> - <string>219.IBPluginDependency</string> - <string>220.IBPluginDependency</string> - <string>221.IBPluginDependency</string> - <string>23.IBPluginDependency</string> - <string>236.IBPluginDependency</string> - <string>239.IBPluginDependency</string> - <string>24.IBPluginDependency</string> - <string>29.IBPluginDependency</string> - <string>295.IBPluginDependency</string> - <string>296.IBPluginDependency</string> - <string>297.IBPluginDependency</string> - <string>298.IBPluginDependency</string> - <string>299.IBPluginDependency</string> - <string>300.IBPluginDependency</string> - <string>344.IBPluginDependency</string> - <string>345.IBPluginDependency</string> - <string>346.IBPluginDependency</string> - <string>348.IBPluginDependency</string> - <string>349.IBPluginDependency</string> - <string>350.IBPluginDependency</string> - <string>351.IBPluginDependency</string> - <string>354.IBPluginDependency</string> - <string>371.IBPluginDependency</string> - <string>371.IBWindowTemplateEditedContentRect</string> - <string>371.NSWindowTemplate.visibleAtLaunch</string> - <string>372.IBPluginDependency</string> - <string>375.IBPluginDependency</string> - <string>376.IBPluginDependency</string> - <string>377.IBPluginDependency</string> - <string>395.IBPluginDependency</string> - <string>395.IBUserGuides</string> - <string>397.IBPluginDependency</string> - <string>398.IBPluginDependency</string> - <string>399.IBPluginDependency</string> - <string>400.IBPluginDependency</string> - <string>401.IBPluginDependency</string> - <string>402.IBPluginDependency</string> - <string>403.IBPluginDependency</string> - <string>404.IBPluginDependency</string> - <string>405.IBPluginDependency</string> - <string>406.IBPluginDependency</string> - <string>407.IBPluginDependency</string> - <string>408.IBPluginDependency</string> - <string>410.IBPluginDependency</string> - <string>411.IBPluginDependency</string> - <string>419.IBPluginDependency</string> - <string>450.IBPluginDependency</string> - <string>451.IBPluginDependency</string> - <string>5.IBPluginDependency</string> - <string>56.IBPluginDependency</string> - <string>57.IBPluginDependency</string> - <string>58.IBPluginDependency</string> - <string>72.IBPluginDependency</string> - <string>73.IBPluginDependency</string> - <string>74.IBPluginDependency</string> - <string>75.IBPluginDependency</string> - <string>77.IBPluginDependency</string> - <string>78.IBPluginDependency</string> - <string>79.IBPluginDependency</string> - <string>80.IBPluginDependency</string> - <string>81.IBPluginDependency</string> - <string>82.IBPluginDependency</string> - <string>83.IBPluginDependency</string> - <string>92.IBPluginDependency</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{888, 364}, {511, 251}}</string> - <integer value="0"/> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <object class="NSMutableArray"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - </object> - </object> - <object class="NSMutableDictionary" key="unlocalizedProperties"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> - <reference key="dict.values" ref="0"/> - </object> - <nil key="activeLocalization"/> - <object class="NSMutableDictionary" key="localizations"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> - <reference key="dict.values" ref="0"/> - </object> - <nil key="sourceID"/> - <int key="maxID">519</int> - </object> - <object class="IBClassDescriber" key="IBDocument.Classes"> - <object class="NSMutableArray" key="referencedPartialClassDescriptions"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBPartialClassDescription"> - <string key="className">AppController</string> - <string key="superclassName">NSObject</string> - <object class="NSMutableDictionary" key="actions"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>cancel:</string> - <string>changeScreenMode:</string> - <string>launchQuake:</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>id</string> - <string>id</string> - <string>id</string> - </object> - </object> - <object class="NSMutableDictionary" key="actionInfosByName"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>cancel:</string> - <string>changeScreenMode:</string> - <string>launchQuake:</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBActionInfo"> - <string key="name">cancel:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">changeScreenMode:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">launchQuake:</string> - <string key="candidateClassName">id</string> - </object> - </object> - </object> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>fullscreenCheckBox</string> - <string>launcherWindow</string> - <string>paramTextField</string> - <string>screenModePopUp</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NSButton</string> - <string>NSWindow</string> - <string>NSTextField</string> - <string>NSPopUpButton</string> - </object> - </object> - <object class="NSMutableDictionary" key="toOneOutletInfosByName"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>fullscreenCheckBox</string> - <string>launcherWindow</string> - <string>paramTextField</string> - <string>screenModePopUp</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">fullscreenCheckBox</string> - <string key="candidateClassName">NSButton</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">launcherWindow</string> - <string key="candidateClassName">NSWindow</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">paramTextField</string> - <string key="candidateClassName">NSTextField</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">screenModePopUp</string> - <string key="candidateClassName">NSPopUpButton</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/AppController.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSDocument</string> - <object class="NSMutableDictionary" key="actions"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>printDocument:</string> - <string>revertDocumentToSaved:</string> - <string>runPageLayout:</string> - <string>saveDocument:</string> - <string>saveDocumentAs:</string> - <string>saveDocumentTo:</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>id</string> - <string>id</string> - <string>id</string> - <string>id</string> - <string>id</string> - <string>id</string> - </object> - </object> - <object class="NSMutableDictionary" key="actionInfosByName"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>printDocument:</string> - <string>revertDocumentToSaved:</string> - <string>runPageLayout:</string> - <string>saveDocument:</string> - <string>saveDocumentAs:</string> - <string>saveDocumentTo:</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBActionInfo"> - <string key="name">printDocument:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">revertDocumentToSaved:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">runPageLayout:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">saveDocument:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">saveDocumentAs:</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBActionInfo"> - <string key="name">saveDocumentTo:</string> - <string key="candidateClassName">id</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/NSDocument.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">SDLMain</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/SDLMain.h</string> - </object> - </object> - </object> - </object> - <int key="IBDocument.localizationMode">0</int> - <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> - <integer value="1040" key="NS.object.0"/> - </object> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> - <real value="1050" key="NS.object.0"/> - </object> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> - <integer value="3000" key="NS.object.0"/> - </object> - <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> - <int key="IBDocument.defaultPropertyAccessControl">3</int> - <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NSMenuCheckmark</string> - <string>NSMenuMixedState</string> - <string>NSSwitch</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>{9, 8}</string> - <string>{7, 2}</string> - <string>{15, 15}</string> - </object> - </object> - </data> -</archive> diff --git a/MacOSX/English.lproj/Launcher.nib/keyedobjects.nib b/MacOSX/English.lproj/Launcher.nib/keyedobjects.nib deleted file mode 100644 index ab291892..00000000 Binary files a/MacOSX/English.lproj/Launcher.nib/keyedobjects.nib and /dev/null differ diff --git a/MacOSX/Info.plist b/MacOSX/Info.plist deleted file mode 100644 index 7c494e62..00000000 --- a/MacOSX/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleIconFile</key> - <string>QuakeSpasm</string> - <key>CFBundleIdentifier</key> - <string>net.sf.quakespasm.QuakeSpasm</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>0.93.2</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>LSApplicationCategoryType</key> - <string>public.app-category.action-games</string> - <key>LSMinimumSystemVersionByArchitecture</key> - <dict> - <key>i386</key> - <string>10.4.0</string> - <key>ppc</key> - <string>10.4.0</string> - <key>x86_64</key> - <string>10.6.0</string> - </dict> - <key>NSMainNibFile</key> - <string>Launcher</string> - <key>NSPrincipalClass</key> - <string>SDLApplication</string> -</dict> -</plist> diff --git a/MacOSX/Launcher-Info.plist b/MacOSX/Launcher-Info.plist deleted file mode 100644 index 7b944358..00000000 --- a/MacOSX/Launcher-Info.plist +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleIdentifier</key> - <string>com.yourcompany.Launcher</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> -</dict> -</plist> diff --git a/MacOSX/QuakeArgument.h b/MacOSX/QuakeArgument.h deleted file mode 100644 index 604daa26..00000000 --- a/MacOSX/QuakeArgument.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import <Cocoa/Cocoa.h> - - -@interface QuakeArgument : NSObject { - NSString *name; - NSString *value; -} - -- (id)initWithArgument:(NSString *)n; -- (id)initWithArgument:(NSString *)n andValue:(NSString *)v; - -- (NSString *)name; -- (NSString *)value; - -- (BOOL)hasValue; -@end diff --git a/MacOSX/QuakeArgument.m b/MacOSX/QuakeArgument.m deleted file mode 100644 index cdf3d162..00000000 --- a/MacOSX/QuakeArgument.m +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import "QuakeArgument.h" - - -@implementation QuakeArgument - -- (id)initWithArgument:(NSString *)n { - - return [self initWithArgument:n andValue:nil]; -} - -- (id)initWithArgument:(NSString *)n andValue:(NSString *)v { - - self = [super init]; - if (self == nil) - return nil; - - name = [n retain]; - if (v != nil) - value = [v retain]; - - return self; -} - -- (NSString *)name { - - return name; -} - -- (NSString *)value { - - return value; -} - -- (BOOL)hasValue { - - return value != nil; -} - -- (NSString *)description { - - NSMutableString *buffer = [[NSMutableString alloc] init]; - - [buffer appendString:name]; - if ([self hasValue]) { - [buffer appendString:@" "]; - [buffer appendString:value]; - } - - return buffer; -} - -- (void) dealloc -{ - [name release]; - [value release]; - - [super dealloc]; -} - -@end diff --git a/MacOSX/QuakeArguments.h b/MacOSX/QuakeArguments.h deleted file mode 100644 index ffba1f37..00000000 --- a/MacOSX/QuakeArguments.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import <Cocoa/Cocoa.h> -#import "QuakeArgument.h" - - -@interface QuakeArguments : NSObject { - NSMutableArray *quakeArgs; -} - -- (id)initWithArguments:(char **)argv count:(int)argc; -- (void)parseArguments:(NSString *)args; - -- (void)addArgument:(NSString *)arg; -- (void)addArgument:(NSString *)arg withValue:(NSString *)value; - -- (QuakeArgument *)argument:(NSString *)name; -- (void)removeArgument:(NSString *)arg; - -- (int)count; -- (void)setArguments:(char **)args; -@end diff --git a/MacOSX/QuakeArguments.m b/MacOSX/QuakeArguments.m deleted file mode 100644 index d632388b..00000000 --- a/MacOSX/QuakeArguments.m +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import "QuakeArguments.h" -#import "QuakeArgument.h" - -@implementation QuakeArguments - -- (id)init { - self = [super init]; - if (!self) - return nil; - - quakeArgs = [[NSMutableArray alloc] init]; - return self; -} - -- (id)initWithArguments:(char **)argv count:(int)argc { - int i; - NSString *next; - NSString *current; - QuakeArgument *argument; - - self = [self init]; - if (!self) - return nil; - - if (argc > 0) { - for (i = 0; argv[i]; i++) { - current = [NSString stringWithCString:argv[i] encoding:NSASCIIStringEncoding]; - if (i < argc-1) { - next = [NSString stringWithCString:argv[i+1] encoding:NSASCIIStringEncoding]; - } else { - next = nil; - } - - if (next != nil && [next characterAtIndex:0] != '-' && [next characterAtIndex:0] != '+') { - argument = [[QuakeArgument alloc] initWithArgument:current andValue:next]; - i++; - } else { - argument = [[QuakeArgument alloc] initWithArgument:current]; - } - [quakeArgs addObject:argument]; - [argument release]; - } - } - - return self; -} - -- (void)parseArguments:(NSString *)args { - int i; - NSMutableString *word = nil; - NSMutableArray *words = [[NSMutableArray alloc] init]; - BOOL quoted = FALSE; - - [quakeArgs removeAllObjects]; - - for (i = 0; i < [args length]; i++) { - const unichar c = [args characterAtIndex:i]; - - if (c == ' ' && !quoted) { - // complete the current word, if any. - if (word != nil) { - [words addObject:word]; - [word release]; - word = nil; - } - - // ignore the space - continue; - } - - if (c == '"') { - quoted = !quoted; - continue; - } - - // other characters just get inserted. - - // start a word if needed - if (word == nil) { - word = [[NSMutableString alloc] init]; - } - [word appendFormat:@"%C", c]; - } - - // complete the current word, if any - if (word != nil) { - [words addObject:word]; - [word release]; - word = nil; - } - - NSString *current; - NSString *next; - QuakeArgument *argument = nil; - - for (i = 0; i < [words count];) { - current = [words objectAtIndex:i++]; - if (i < [words count]) { - next = [words objectAtIndex:i++]; - unichar c = [next characterAtIndex:0]; - if (c != '-' && c != '+') - argument = [[QuakeArgument alloc] initWithArgument:current andValue:next]; - else - i--; - - } - - if (argument == nil) { - argument = [[QuakeArgument alloc] initWithArgument:current]; - } - - [quakeArgs addObject:argument]; - [argument release]; - argument = nil; - } -} - -- (void)addArgument:(NSString *)name { - QuakeArgument *argument = [[QuakeArgument alloc] initWithArgument:name]; - [quakeArgs addObject:argument]; - - [argument release]; -} - -- (void)addArgument:(NSString *)name withValue:(NSString *)value { - QuakeArgument *argument = [[QuakeArgument alloc] initWithArgument:name andValue:value]; - [quakeArgs addObject:argument]; - - [argument release]; -} - -- (void)removeArgument:(NSString *)arg { - [quakeArgs removeObject:arg]; -} - -- (QuakeArgument *)argument:(NSString *)name { - NSEnumerator *enumerator = [quakeArgs objectEnumerator]; - QuakeArgument *argument; - - while ((argument = [enumerator nextObject])) { - if ([name isEqualToString:[argument name]]) - return argument; - } - - return nil; -} - -- (int)count { - int c = 0; - - NSEnumerator *enumerator = [quakeArgs objectEnumerator]; - QuakeArgument *argument; - - while ((argument = [enumerator nextObject])) { - c++; - if ([argument hasValue]) - c++; - } - - return c; -} - -- (void)setArguments:(char **)args { - int i = 0; - - NSEnumerator *enumerator = [quakeArgs objectEnumerator]; - QuakeArgument *argument; - - while ((argument = [enumerator nextObject])) { - args[i++] = (char *)[[argument name] cStringUsingEncoding:NSASCIIStringEncoding]; - - if ([argument hasValue]) - args[i++] = (char *)[[argument value] cStringUsingEncoding:NSASCIIStringEncoding]; - } -} - -- (NSString *)description { - int i; - NSMutableString *buffer = [[NSMutableString alloc] init]; - - for (i = 0; i < [quakeArgs count]; i++) { - if (i > 0) - [buffer appendString:@" "]; - - QuakeArgument *argument = [quakeArgs objectAtIndex:i]; - [buffer appendString:[argument name]]; - - if ([argument hasValue]) { - [buffer appendString:@" "]; - [buffer appendString:[argument value]]; - } - } - - return buffer; -} - -- (void) dealloc { - [quakeArgs release]; - [super dealloc]; -} - - -@end diff --git a/MacOSX/QuakeSpasm.icns b/MacOSX/QuakeSpasm.icns deleted file mode 100644 index e0f9cc17..00000000 Binary files a/MacOSX/QuakeSpasm.icns and /dev/null differ diff --git a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj deleted file mode 100644 index be73842c..00000000 --- a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1461 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; }; - 32CA4F630368D1EE00C91783 /* snd_umx.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B012D5BA1A006DD66E /* snd_umx.c */; }; - 48134A1812102F400015BF15 /* net_bsd.c in Sources */ = {isa = PBXBuildFile; fileRef = 48134A1412102F400015BF15 /* net_bsd.c */; }; - 48134A1912102F400015BF15 /* net_udp.c in Sources */ = {isa = PBXBuildFile; fileRef = 48134A1612102F400015BF15 /* net_udp.c */; }; - 4818B0A312D5B9AE006DD66E /* bgmusic.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0A112D5B9AE006DD66E /* bgmusic.c */; }; - 4818B0AE12D5B9ED006DD66E /* snd_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0AC12D5B9ED006DD66E /* snd_codec.c */; }; - 4818B0B712D5BA1A006DD66E /* snd_vorbis.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */; }; - 4818B0B812D5BA1A006DD66E /* snd_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B412D5BA1A006DD66E /* snd_wave.c */; }; - 48243B140D33F01A00C29F8F /* main_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 48243B130D33F01A00C29F8F /* main_sdl.c */; }; - 482812FD179C3EF4004E1D61 /* libFLAC.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 482812FC179C3EF4004E1D61 /* libFLAC.dylib */; }; - 482812FE179C3EFF004E1D61 /* libFLAC.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 482812FC179C3EF4004E1D61 /* libFLAC.dylib */; }; - 48281301179C3F13004E1D61 /* snd_flac.c in Sources */ = {isa = PBXBuildFile; fileRef = 482812FF179C3F13004E1D61 /* snd_flac.c */; }; - 483A78230D2EEA5400CB2E4C /* chase.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78100D2EEA5400CB2E4C /* chase.c */; }; - 483A78240D2EEA5400CB2E4C /* cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78110D2EEA5400CB2E4C /* cmd.c */; }; - 483A78250D2EEA5400CB2E4C /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78120D2EEA5400CB2E4C /* common.c */; }; - 483A78260D2EEA5400CB2E4C /* console.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78130D2EEA5400CB2E4C /* console.c */; }; - 483A78270D2EEA5400CB2E4C /* crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78140D2EEA5400CB2E4C /* crc.c */; }; - 483A78280D2EEA5400CB2E4C /* cvar.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78150D2EEA5400CB2E4C /* cvar.c */; }; - 483A78290D2EEA5400CB2E4C /* host_cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78160D2EEA5400CB2E4C /* host_cmd.c */; }; - 483A782A0D2EEA5400CB2E4C /* host.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78170D2EEA5400CB2E4C /* host.c */; }; - 483A782B0D2EEA5400CB2E4C /* mathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78180D2EEA5400CB2E4C /* mathlib.c */; }; - 483A782C0D2EEA5400CB2E4C /* menu.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78190D2EEA5400CB2E4C /* menu.c */; }; - 483A782D0D2EEA5400CB2E4C /* pr_cmds.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */; }; - 483A782E0D2EEA5400CB2E4C /* pr_edict.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781B0D2EEA5400CB2E4C /* pr_edict.c */; }; - 483A782F0D2EEA5400CB2E4C /* pr_exec.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781C0D2EEA5400CB2E4C /* pr_exec.c */; }; - 483A78300D2EEA5400CB2E4C /* sbar.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781D0D2EEA5400CB2E4C /* sbar.c */; }; - 483A78320D2EEA5400CB2E4C /* view.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781F0D2EEA5400CB2E4C /* view.c */; }; - 483A78330D2EEA5400CB2E4C /* wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78200D2EEA5400CB2E4C /* wad.c */; }; - 483A78340D2EEA5400CB2E4C /* world.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78210D2EEA5400CB2E4C /* world.c */; }; - 483A78350D2EEA5400CB2E4C /* zone.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78220D2EEA5400CB2E4C /* zone.c */; }; - 483A78380D2EEA6D00CB2E4C /* in_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78360D2EEA6D00CB2E4C /* in_sdl.c */; }; - 483A78390D2EEA6D00CB2E4C /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78370D2EEA6D00CB2E4C /* keys.c */; }; - 483A78450D2EEAAB00CB2E4C /* cl_demo.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */; }; - 483A78460D2EEAAB00CB2E4C /* cl_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783B0D2EEAAB00CB2E4C /* cl_input.c */; }; - 483A78470D2EEAAB00CB2E4C /* cl_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783C0D2EEAAB00CB2E4C /* cl_main.c */; }; - 483A78480D2EEAAB00CB2E4C /* cl_parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */; }; - 483A78490D2EEAAB00CB2E4C /* cl_tent.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */; }; - 483A784A0D2EEAAB00CB2E4C /* net_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783F0D2EEAAB00CB2E4C /* net_main.c */; }; - 483A784C0D2EEAAB00CB2E4C /* sv_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78410D2EEAAB00CB2E4C /* sv_main.c */; }; - 483A784D0D2EEAAB00CB2E4C /* sv_move.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78420D2EEAAB00CB2E4C /* sv_move.c */; }; - 483A784E0D2EEAAB00CB2E4C /* sv_phys.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78430D2EEAAB00CB2E4C /* sv_phys.c */; }; - 483A784F0D2EEAAB00CB2E4C /* sv_user.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78440D2EEAAB00CB2E4C /* sv_user.c */; }; - 483A78550D2EEAC300CB2E4C /* cd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78500D2EEAC300CB2E4C /* cd_sdl.c */; }; - 483A78590D2EEAC300CB2E4C /* snd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78540D2EEAC300CB2E4C /* snd_sdl.c */; }; - 483A786E0D2EEAF000CB2E4C /* gl_draw.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785A0D2EEAF000CB2E4C /* gl_draw.c */; }; - 483A786F0D2EEAF000CB2E4C /* gl_fog.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785B0D2EEAF000CB2E4C /* gl_fog.c */; }; - 483A78700D2EEAF000CB2E4C /* gl_mesh.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */; }; - 483A78710D2EEAF000CB2E4C /* gl_model.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785D0D2EEAF000CB2E4C /* gl_model.c */; }; - 483A78720D2EEAF000CB2E4C /* gl_refrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */; }; - 483A78730D2EEAF000CB2E4C /* gl_rlight.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */; }; - 483A78740D2EEAF000CB2E4C /* gl_rmain.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78600D2EEAF000CB2E4C /* gl_rmain.c */; }; - 483A78750D2EEAF000CB2E4C /* gl_rmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */; }; - 483A78760D2EEAF000CB2E4C /* gl_screen.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78620D2EEAF000CB2E4C /* gl_screen.c */; }; - 483A78770D2EEAF000CB2E4C /* gl_sky.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78630D2EEAF000CB2E4C /* gl_sky.c */; }; - 483A78780D2EEAF000CB2E4C /* snd_mikmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */; }; - 483A78790D2EEAF000CB2E4C /* gl_texmgr.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */; }; - 483A787A0D2EEAF000CB2E4C /* gl_vidsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */; }; - 483A787B0D2EEAF000CB2E4C /* gl_warp.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78670D2EEAF000CB2E4C /* gl_warp.c */; }; - 483A787C0D2EEAF000CB2E4C /* image.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78680D2EEAF000CB2E4C /* image.c */; }; - 483A787D0D2EEAF000CB2E4C /* r_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78690D2EEAF000CB2E4C /* r_alias.c */; }; - 483A787E0D2EEAF000CB2E4C /* r_brush.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786A0D2EEAF000CB2E4C /* r_brush.c */; }; - 483A787F0D2EEAF000CB2E4C /* r_part.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786B0D2EEAF000CB2E4C /* r_part.c */; }; - 483A78800D2EEAF000CB2E4C /* r_sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786C0D2EEAF000CB2E4C /* r_sprite.c */; }; - 483A78810D2EEAF000CB2E4C /* r_world.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786D0D2EEAF000CB2E4C /* r_world.c */; }; - 4847CD5F12057F94000B560F /* sys_sdl_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 4847CD5E12057F94000B560F /* sys_sdl_unix.c */; }; - 484AA4B40D3FF6C0005D917A /* QuakeSpasm.icns in Resources */ = {isa = PBXBuildFile; fileRef = 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */; }; - 4854B1B11340C646004C9F45 /* snd_mp3.c in Sources */ = {isa = PBXBuildFile; fileRef = 4854B1B01340C646004C9F45 /* snd_mp3.c */; }; - 486577CB0D31A22A00E7920A /* snd_dma.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577C80D31A22A00E7920A /* snd_dma.c */; }; - 486577CC0D31A22A00E7920A /* snd_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577C90D31A22A00E7920A /* snd_mem.c */; }; - 486577CD0D31A22A00E7920A /* snd_mix.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577CA0D31A22A00E7920A /* snd_mix.c */; }; - 48728D2D0D3004A80004D61B /* net_dgrm.c in Sources */ = {isa = PBXBuildFile; fileRef = 48728D280D3004A70004D61B /* net_dgrm.c */; }; - 48728D2E0D3004A80004D61B /* net_loop.c in Sources */ = {isa = PBXBuildFile; fileRef = 48728D2A0D3004A80004D61B /* net_loop.c */; }; - 4885A84C179740A0000EC703 /* snd_opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 4885A84A179740A0000EC703 /* snd_opus.c */; }; - 4885A84F179740CA000EC703 /* libopus.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4885A84D179740CA000EC703 /* libopus.dylib */; }; - 4885A850179740CA000EC703 /* libopusfile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4885A84E179740CA000EC703 /* libopusfile.dylib */; }; - 4885A851179740D7000EC703 /* libopus.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 4885A84D179740CA000EC703 /* libopus.dylib */; }; - 4885A852179740D7000EC703 /* libopusfile.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 4885A84E179740CA000EC703 /* libopusfile.dylib */; }; - 48895DB90D4914A000849ABF /* pl_osx.m in Sources */ = {isa = PBXBuildFile; fileRef = 48895DB80D4914A000849ABF /* pl_osx.m */; }; - 489D8D2F0D3A630D00AA4471 /* ScreenInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */; }; - 48A7C1FC14AA34940011B754 /* strlcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 48A7C1FA14AA34940011B754 /* strlcat.c */; }; - 48A7C1FD14AA34940011B754 /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 48A7C1FB14AA34940011B754 /* strlcpy.c */; }; - 48B9E7880D340B1E0001CACF /* Launcher.nib in Resources */ = {isa = PBXBuildFile; fileRef = 48B9E7860D340B1E0001CACF /* Launcher.nib */; }; - 48B9E7A70D340BEA0001CACF /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 48B9E7A60D340BEA0001CACF /* AppController.m */; }; - 48B9E7C00D340EA80001CACF /* SDLApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 48B9E7BF0D340EA80001CACF /* SDLApplication.m */; }; - 48C85E3B0D3AD10E00797678 /* QuakeArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */; }; - 48E2EC7815FB500400B8D476 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 488EF23614B83A370021DD41 /* IOKit.framework */; }; - 48E2EC7D15FB507A00B8D476 /* libmad.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7915FB507A00B8D476 /* libmad.dylib */; }; - 48E2EC7E15FB507A00B8D476 /* libogg.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7A15FB507A00B8D476 /* libogg.dylib */; }; - 48E2EC7F15FB507A00B8D476 /* libvorbis.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */; }; - 48E2EC8015FB507A00B8D476 /* libvorbisfile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */; }; - 48E2EC8615FB516600B8D476 /* libmad.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7915FB507A00B8D476 /* libmad.dylib */; }; - 48E2EC8715FB516600B8D476 /* libogg.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7A15FB507A00B8D476 /* libogg.dylib */; }; - 48E2EC8815FB516600B8D476 /* libvorbis.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */; }; - 48E2EC8915FB516600B8D476 /* libvorbisfile.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */; }; - 48FE585B0D3A82C8006BB491 /* QuakeArguments.m in Sources */ = {isa = PBXBuildFile; fileRef = 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */; }; - 63D6EB3523A255900047028C /* snd_mp3tag.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D6EB3423A255900047028C /* snd_mp3tag.c */; }; - 63D6EB3623A255900047028C /* snd_mp3tag.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D6EB3423A255900047028C /* snd_mp3tag.c */; }; - 664D988A19CF6B78000D395C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 664D988B19CF6B78000D395C /* Launcher.nib in Resources */ = {isa = PBXBuildFile; fileRef = 48B9E7860D340B1E0001CACF /* Launcher.nib */; }; - 664D988C19CF6B78000D395C /* QuakeSpasm.icns in Resources */ = {isa = PBXBuildFile; fileRef = 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */; }; - 664D988E19CF6B78000D395C /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 664D988F19CF6B78000D395C /* chase.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78100D2EEA5400CB2E4C /* chase.c */; }; - 664D989019CF6B78000D395C /* cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78110D2EEA5400CB2E4C /* cmd.c */; }; - 664D989119CF6B78000D395C /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78120D2EEA5400CB2E4C /* common.c */; }; - 664D989219CF6B78000D395C /* console.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78130D2EEA5400CB2E4C /* console.c */; }; - 664D989319CF6B78000D395C /* crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78140D2EEA5400CB2E4C /* crc.c */; }; - 664D989419CF6B78000D395C /* cvar.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78150D2EEA5400CB2E4C /* cvar.c */; }; - 664D989519CF6B78000D395C /* host_cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78160D2EEA5400CB2E4C /* host_cmd.c */; }; - 664D989619CF6B78000D395C /* host.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78170D2EEA5400CB2E4C /* host.c */; }; - 664D989719CF6B78000D395C /* mathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78180D2EEA5400CB2E4C /* mathlib.c */; }; - 664D989819CF6B78000D395C /* menu.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78190D2EEA5400CB2E4C /* menu.c */; }; - 664D989919CF6B78000D395C /* pr_cmds.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */; }; - 664D989A19CF6B78000D395C /* pr_edict.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781B0D2EEA5400CB2E4C /* pr_edict.c */; }; - 664D989B19CF6B78000D395C /* pr_exec.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781C0D2EEA5400CB2E4C /* pr_exec.c */; }; - 664D989C19CF6B78000D395C /* sbar.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781D0D2EEA5400CB2E4C /* sbar.c */; }; - 664D989D19CF6B78000D395C /* view.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781F0D2EEA5400CB2E4C /* view.c */; }; - 664D989E19CF6B78000D395C /* wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78200D2EEA5400CB2E4C /* wad.c */; }; - 664D989F19CF6B78000D395C /* world.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78210D2EEA5400CB2E4C /* world.c */; }; - 664D98A019CF6B78000D395C /* zone.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78220D2EEA5400CB2E4C /* zone.c */; }; - 664D98A119CF6B78000D395C /* in_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78360D2EEA6D00CB2E4C /* in_sdl.c */; }; - 664D98A219CF6B78000D395C /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78370D2EEA6D00CB2E4C /* keys.c */; }; - 664D98A319CF6B78000D395C /* cl_demo.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */; }; - 664D98A419CF6B78000D395C /* cl_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783B0D2EEAAB00CB2E4C /* cl_input.c */; }; - 664D98A519CF6B78000D395C /* cl_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783C0D2EEAAB00CB2E4C /* cl_main.c */; }; - 664D98A619CF6B78000D395C /* cl_parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */; }; - 664D98A719CF6B78000D395C /* cl_tent.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */; }; - 664D98A819CF6B78000D395C /* net_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783F0D2EEAAB00CB2E4C /* net_main.c */; }; - 664D98A919CF6B78000D395C /* sv_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78410D2EEAAB00CB2E4C /* sv_main.c */; }; - 664D98AA19CF6B78000D395C /* sv_move.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78420D2EEAAB00CB2E4C /* sv_move.c */; }; - 664D98AB19CF6B78000D395C /* sv_phys.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78430D2EEAAB00CB2E4C /* sv_phys.c */; }; - 664D98AC19CF6B78000D395C /* sv_user.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78440D2EEAAB00CB2E4C /* sv_user.c */; }; - 664D98AD19CF6B78000D395C /* cd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78500D2EEAC300CB2E4C /* cd_sdl.c */; }; - 664D98AE19CF6B78000D395C /* snd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78540D2EEAC300CB2E4C /* snd_sdl.c */; }; - 664D98AF19CF6B78000D395C /* gl_draw.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785A0D2EEAF000CB2E4C /* gl_draw.c */; }; - 664D98B019CF6B78000D395C /* gl_fog.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785B0D2EEAF000CB2E4C /* gl_fog.c */; }; - 664D98B119CF6B78000D395C /* gl_mesh.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */; }; - 664D98B219CF6B78000D395C /* gl_model.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785D0D2EEAF000CB2E4C /* gl_model.c */; }; - 664D98B319CF6B78000D395C /* gl_refrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */; }; - 664D98B419CF6B78000D395C /* gl_rlight.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */; }; - 664D98B519CF6B78000D395C /* gl_rmain.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78600D2EEAF000CB2E4C /* gl_rmain.c */; }; - 664D98B619CF6B78000D395C /* gl_rmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */; }; - 664D98B719CF6B78000D395C /* gl_screen.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78620D2EEAF000CB2E4C /* gl_screen.c */; }; - 664D98B819CF6B78000D395C /* gl_sky.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78630D2EEAF000CB2E4C /* gl_sky.c */; }; - 664D98B919CF6B78000D395C /* gl_texmgr.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */; }; - 664D98BA19CF6B78000D395C /* gl_vidsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */; }; - 664D98BB19CF6B78000D395C /* gl_warp.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78670D2EEAF000CB2E4C /* gl_warp.c */; }; - 664D98BC19CF6B78000D395C /* image.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78680D2EEAF000CB2E4C /* image.c */; }; - 664D98BD19CF6B78000D395C /* r_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78690D2EEAF000CB2E4C /* r_alias.c */; }; - 664D98BE19CF6B78000D395C /* r_brush.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786A0D2EEAF000CB2E4C /* r_brush.c */; }; - 664D98BF19CF6B78000D395C /* r_part.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786B0D2EEAF000CB2E4C /* r_part.c */; }; - 664D98C019CF6B78000D395C /* r_sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786C0D2EEAF000CB2E4C /* r_sprite.c */; }; - 664D98C119CF6B78000D395C /* r_world.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786D0D2EEAF000CB2E4C /* r_world.c */; }; - 664D98C219CF6B78000D395C /* net_dgrm.c in Sources */ = {isa = PBXBuildFile; fileRef = 48728D280D3004A70004D61B /* net_dgrm.c */; }; - 664D98C319CF6B78000D395C /* net_loop.c in Sources */ = {isa = PBXBuildFile; fileRef = 48728D2A0D3004A80004D61B /* net_loop.c */; }; - 664D98C419CF6B78000D395C /* snd_dma.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577C80D31A22A00E7920A /* snd_dma.c */; }; - 664D98C519CF6B78000D395C /* snd_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577C90D31A22A00E7920A /* snd_mem.c */; }; - 664D98C619CF6B78000D395C /* snd_mix.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577CA0D31A22A00E7920A /* snd_mix.c */; }; - 664D98C719CF6B78000D395C /* main_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 48243B130D33F01A00C29F8F /* main_sdl.c */; }; - 664D98C819CF6B78000D395C /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 48B9E7A60D340BEA0001CACF /* AppController.m */; }; - 664D98C919CF6B78000D395C /* SDLApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 48B9E7BF0D340EA80001CACF /* SDLApplication.m */; }; - 664D98CA19CF6B78000D395C /* ScreenInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */; }; - 664D98CB19CF6B78000D395C /* QuakeArguments.m in Sources */ = {isa = PBXBuildFile; fileRef = 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */; }; - 664D98CC19CF6B78000D395C /* QuakeArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */; }; - 664D98CD19CF6B78000D395C /* pl_osx.m in Sources */ = {isa = PBXBuildFile; fileRef = 48895DB80D4914A000849ABF /* pl_osx.m */; }; - 664D98CE19CF6B78000D395C /* sys_sdl_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 4847CD5E12057F94000B560F /* sys_sdl_unix.c */; }; - 664D98CF19CF6B78000D395C /* net_bsd.c in Sources */ = {isa = PBXBuildFile; fileRef = 48134A1412102F400015BF15 /* net_bsd.c */; }; - 664D98D019CF6B78000D395C /* net_udp.c in Sources */ = {isa = PBXBuildFile; fileRef = 48134A1612102F400015BF15 /* net_udp.c */; }; - 664D98D119CF6B78000D395C /* bgmusic.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0A112D5B9AE006DD66E /* bgmusic.c */; }; - 664D98D219CF6B78000D395C /* snd_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0AC12D5B9ED006DD66E /* snd_codec.c */; }; - 664D98D319CF6B78000D395C /* snd_vorbis.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */; }; - 664D98D419CF6B78000D395C /* snd_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B412D5BA1A006DD66E /* snd_wave.c */; }; - 664D98D519CF6B78000D395C /* snd_mp3.c in Sources */ = {isa = PBXBuildFile; fileRef = 4854B1B01340C646004C9F45 /* snd_mp3.c */; }; - 664D98D619CF6B78000D395C /* snd_mikmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */; }; - 664D98D719CF6B78000D395C /* snd_umx.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B012D5BA1A006DD66E /* snd_umx.c */; }; - 664D98D819CF6B78000D395C /* cfgfile.c in Sources */ = {isa = PBXBuildFile; fileRef = B021C20714A5FF7E003F18D6 /* cfgfile.c */; }; - 664D98D919CF6B78000D395C /* strlcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 48A7C1FA14AA34940011B754 /* strlcat.c */; }; - 664D98DA19CF6B78000D395C /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 48A7C1FB14AA34940011B754 /* strlcpy.c */; }; - 664D98DB19CF6B78000D395C /* snd_opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 4885A84A179740A0000EC703 /* snd_opus.c */; }; - 664D98DC19CF6B78000D395C /* snd_flac.c in Sources */ = {isa = PBXBuildFile; fileRef = 482812FF179C3F13004E1D61 /* snd_flac.c */; }; - 664D98DE19CF6B78000D395C /* libFLAC.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 482812FC179C3EF4004E1D61 /* libFLAC.dylib */; }; - 664D98DF19CF6B78000D395C /* libopus.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4885A84D179740CA000EC703 /* libopus.dylib */; }; - 664D98E019CF6B78000D395C /* libopusfile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4885A84E179740CA000EC703 /* libopusfile.dylib */; }; - 664D98E119CF6B78000D395C /* libmad.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7915FB507A00B8D476 /* libmad.dylib */; }; - 664D98E219CF6B78000D395C /* libogg.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7A15FB507A00B8D476 /* libogg.dylib */; }; - 664D98E319CF6B78000D395C /* libvorbis.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */; }; - 664D98E419CF6B78000D395C /* libvorbisfile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */; }; - 664D98E519CF6B78000D395C /* libmikmod.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F5F5DE80017CB4370103A810 /* libmikmod.dylib */; }; - 664D98E619CF6B78000D395C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 488EF23614B83A370021DD41 /* IOKit.framework */; }; - 664D98E919CF6B78000D395C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 664D98EA19CF6B78000D395C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; }; - 664D98EE19CF6B78000D395C /* libFLAC.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 482812FC179C3EF4004E1D61 /* libFLAC.dylib */; }; - 664D98EF19CF6B78000D395C /* libopus.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 4885A84D179740CA000EC703 /* libopus.dylib */; }; - 664D98F019CF6B78000D395C /* libopusfile.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 4885A84E179740CA000EC703 /* libopusfile.dylib */; }; - 664D98F119CF6B78000D395C /* libmad.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7915FB507A00B8D476 /* libmad.dylib */; }; - 664D98F219CF6B78000D395C /* libogg.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7A15FB507A00B8D476 /* libogg.dylib */; }; - 664D98F319CF6B78000D395C /* libvorbis.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */; }; - 664D98F419CF6B78000D395C /* libvorbisfile.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */; }; - 664D98F519CF6B78000D395C /* libmikmod.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = F5F5DE80017CB4370103A810 /* libmikmod.dylib */; }; - 664D990619CF6E16000D395C /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 664D990519CF6E16000D395C /* SDL2.framework */; }; - 664D990719CF6E33000D395C /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 664D990519CF6E16000D395C /* SDL2.framework */; }; - 66991C071DBAB4A600C373C0 /* quakespasm.pak in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C061DBAB48000C373C0 /* quakespasm.pak */; }; - 66991C081DBAB4A600C373C0 /* LICENSE.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C021DBAB47000C373C0 /* LICENSE.txt */; }; - 66991C091DBAB4A600C373C0 /* Quakespasm-Music.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */; }; - 66991C0A1DBAB4A600C373C0 /* Quakespasm.html in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C041DBAB47000C373C0 /* Quakespasm.html */; }; - 66991C0B1DBAB4A600C373C0 /* Quakespasm.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C051DBAB47000C373C0 /* Quakespasm.txt */; }; - 66991C0D1DBAB4B300C373C0 /* quakespasm.pak in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C061DBAB48000C373C0 /* quakespasm.pak */; }; - 66991C0E1DBAB4B300C373C0 /* LICENSE.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C021DBAB47000C373C0 /* LICENSE.txt */; }; - 66991C0F1DBAB4B300C373C0 /* Quakespasm-Music.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */; }; - 66991C101DBAB4B300C373C0 /* Quakespasm.html in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C041DBAB47000C373C0 /* Quakespasm.html */; }; - 66991C111DBAB4B300C373C0 /* Quakespasm.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C051DBAB47000C373C0 /* Quakespasm.txt */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - A4E3AF2A05D43FCC000F1B47 /* libmikmod.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = F5F5DE80017CB4370103A810 /* libmikmod.dylib */; }; - A4E3AF6205D43FCC000F1B47 /* libmikmod.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F5F5DE80017CB4370103A810 /* libmikmod.dylib */; }; - B021C20914A5FF7E003F18D6 /* cfgfile.c in Sources */ = {isa = PBXBuildFile; fileRef = B021C20714A5FF7E003F18D6 /* cfgfile.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - 48692C131340A46800A0F098 /* Copy Libraries */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - 482812FE179C3EFF004E1D61 /* libFLAC.dylib in Copy Libraries */, - 4885A851179740D7000EC703 /* libopus.dylib in Copy Libraries */, - 4885A852179740D7000EC703 /* libopusfile.dylib in Copy Libraries */, - 48E2EC8615FB516600B8D476 /* libmad.dylib in Copy Libraries */, - 48E2EC8715FB516600B8D476 /* libogg.dylib in Copy Libraries */, - 48E2EC8815FB516600B8D476 /* libvorbis.dylib in Copy Libraries */, - 48E2EC8915FB516600B8D476 /* libvorbisfile.dylib in Copy Libraries */, - A4E3AF2A05D43FCC000F1B47 /* libmikmod.dylib in Copy Libraries */, - ); - name = "Copy Libraries"; - runOnlyForDeploymentPostprocessing = 0; - }; - 664D98EB19CF6B78000D395C /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 664D990719CF6E33000D395C /* SDL2.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - 664D98ED19CF6B78000D395C /* Copy Libraries */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - 664D98EE19CF6B78000D395C /* libFLAC.dylib in Copy Libraries */, - 664D98EF19CF6B78000D395C /* libopus.dylib in Copy Libraries */, - 664D98F019CF6B78000D395C /* libopusfile.dylib in Copy Libraries */, - 664D98F119CF6B78000D395C /* libmad.dylib in Copy Libraries */, - 664D98F219CF6B78000D395C /* libogg.dylib in Copy Libraries */, - 664D98F319CF6B78000D395C /* libvorbis.dylib in Copy Libraries */, - 664D98F419CF6B78000D395C /* libvorbisfile.dylib in Copy Libraries */, - 664D98F519CF6B78000D395C /* libmikmod.dylib in Copy Libraries */, - ); - name = "Copy Libraries"; - runOnlyForDeploymentPostprocessing = 0; - }; - 66991C001DBAB3F500C373C0 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - 66991C071DBAB4A600C373C0 /* quakespasm.pak in CopyFiles */, - 66991C081DBAB4A600C373C0 /* LICENSE.txt in CopyFiles */, - 66991C091DBAB4A600C373C0 /* Quakespasm-Music.txt in CopyFiles */, - 66991C0A1DBAB4A600C373C0 /* Quakespasm.html in CopyFiles */, - 66991C0B1DBAB4A600C373C0 /* Quakespasm.txt in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 66991C0C1DBAB4AF00C373C0 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - 66991C0D1DBAB4B300C373C0 /* quakespasm.pak in CopyFiles */, - 66991C0E1DBAB4B300C373C0 /* LICENSE.txt in CopyFiles */, - 66991C0F1DBAB4B300C373C0 /* Quakespasm-Music.txt in CopyFiles */, - 66991C101DBAB4B300C373C0 /* Quakespasm.html in CopyFiles */, - 66991C111DBAB4B300C373C0 /* Quakespasm.txt in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SDL.framework; sourceTree = SOURCE_ROOT; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = "<group>"; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = "<group>"; }; - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; - 48134A1412102F400015BF15 /* net_bsd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_bsd.c; path = ../Quake/net_bsd.c; sourceTree = SOURCE_ROOT; }; - 48134A1512102F400015BF15 /* net_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_defs.h; path = ../Quake/net_defs.h; sourceTree = SOURCE_ROOT; }; - 48134A1612102F400015BF15 /* net_udp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_udp.c; path = ../Quake/net_udp.c; sourceTree = SOURCE_ROOT; }; - 48134A1712102F400015BF15 /* net_udp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_udp.h; path = ../Quake/net_udp.h; sourceTree = SOURCE_ROOT; }; - 4818B0A112D5B9AE006DD66E /* bgmusic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bgmusic.c; path = ../Quake/bgmusic.c; sourceTree = SOURCE_ROOT; }; - 4818B0A212D5B9AE006DD66E /* bgmusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bgmusic.h; path = ../Quake/bgmusic.h; sourceTree = SOURCE_ROOT; }; - 4818B0AC12D5B9ED006DD66E /* snd_codec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_codec.c; path = ../Quake/snd_codec.c; sourceTree = SOURCE_ROOT; }; - 4818B0AD12D5B9ED006DD66E /* snd_codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_codec.h; path = ../Quake/snd_codec.h; sourceTree = SOURCE_ROOT; }; - 4818B0AF12D5BA1A006DD66E /* snd_codeci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_codeci.h; path = ../Quake/snd_codeci.h; sourceTree = SOURCE_ROOT; }; - 4818B0B012D5BA1A006DD66E /* snd_umx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_umx.c; path = ../Quake/snd_umx.c; sourceTree = SOURCE_ROOT; }; - 4818B0B112D5BA1A006DD66E /* snd_mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_mp3.h; path = ../Quake/snd_mp3.h; sourceTree = SOURCE_ROOT; }; - 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_vorbis.c; path = ../Quake/snd_vorbis.c; sourceTree = SOURCE_ROOT; }; - 4818B0B312D5BA1A006DD66E /* snd_vorbis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_vorbis.h; path = ../Quake/snd_vorbis.h; sourceTree = SOURCE_ROOT; }; - 4818B0B412D5BA1A006DD66E /* snd_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_wave.c; path = ../Quake/snd_wave.c; sourceTree = SOURCE_ROOT; }; - 4818B0B512D5BA1A006DD66E /* snd_wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_wave.h; path = ../Quake/snd_wave.h; sourceTree = SOURCE_ROOT; }; - 48243B130D33F01A00C29F8F /* main_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main_sdl.c; path = ../Quake/main_sdl.c; sourceTree = SOURCE_ROOT; }; - 482812FC179C3EF4004E1D61 /* libFLAC.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.dylib; path = codecs/lib/libFLAC.dylib; sourceTree = "<group>"; }; - 482812FF179C3F13004E1D61 /* snd_flac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_flac.c; path = ../Quake/snd_flac.c; sourceTree = "<group>"; }; - 48281300179C3F13004E1D61 /* snd_flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_flac.h; path = ../Quake/snd_flac.h; sourceTree = "<group>"; }; - 483A77E60D2EE97700CB2E4C /* cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cmd.h; path = ../Quake/cmd.h; sourceTree = SOURCE_ROOT; }; - 483A77E70D2EE97700CB2E4C /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = ../Quake/common.h; sourceTree = SOURCE_ROOT; }; - 483A77E80D2EE97700CB2E4C /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = console.h; path = ../Quake/console.h; sourceTree = SOURCE_ROOT; }; - 483A77E90D2EE97700CB2E4C /* crc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crc.h; path = ../Quake/crc.h; sourceTree = SOURCE_ROOT; }; - 483A77EA0D2EE97700CB2E4C /* cvar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cvar.h; path = ../Quake/cvar.h; sourceTree = SOURCE_ROOT; }; - 483A77EB0D2EE97700CB2E4C /* mathlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mathlib.h; path = ../Quake/mathlib.h; sourceTree = SOURCE_ROOT; }; - 483A77EC0D2EE97700CB2E4C /* menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = menu.h; path = ../Quake/menu.h; sourceTree = SOURCE_ROOT; }; - 483A77ED0D2EE97700CB2E4C /* pr_comp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pr_comp.h; path = ../Quake/pr_comp.h; sourceTree = SOURCE_ROOT; }; - 483A77EE0D2EE97700CB2E4C /* progdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = progdefs.h; path = ../Quake/progdefs.h; sourceTree = SOURCE_ROOT; }; - 483A77EF0D2EE97700CB2E4C /* progs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = progs.h; path = ../Quake/progs.h; sourceTree = SOURCE_ROOT; }; - 483A77F00D2EE97700CB2E4C /* quakedef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = quakedef.h; path = ../Quake/quakedef.h; sourceTree = SOURCE_ROOT; }; - 483A77F10D2EE97700CB2E4C /* sbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sbar.h; path = ../Quake/sbar.h; sourceTree = SOURCE_ROOT; }; - 483A77F20D2EE97700CB2E4C /* sys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sys.h; path = ../Quake/sys.h; sourceTree = SOURCE_ROOT; }; - 483A77F30D2EE97700CB2E4C /* view.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = view.h; path = ../Quake/view.h; sourceTree = SOURCE_ROOT; }; - 483A77F40D2EE97700CB2E4C /* wad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wad.h; path = ../Quake/wad.h; sourceTree = SOURCE_ROOT; }; - 483A77F50D2EE97700CB2E4C /* world.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = world.h; path = ../Quake/world.h; sourceTree = SOURCE_ROOT; }; - 483A77F60D2EE97700CB2E4C /* zone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zone.h; path = ../Quake/zone.h; sourceTree = SOURCE_ROOT; }; - 483A77F70D2EE98D00CB2E4C /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = input.h; path = ../Quake/input.h; sourceTree = SOURCE_ROOT; }; - 483A77F80D2EE98D00CB2E4C /* keys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = keys.h; path = ../Quake/keys.h; sourceTree = SOURCE_ROOT; }; - 483A77F90D2EE9A900CB2E4C /* client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = client.h; path = ../Quake/client.h; sourceTree = SOURCE_ROOT; }; - 483A77FA0D2EE9A900CB2E4C /* net.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net.h; path = ../Quake/net.h; sourceTree = SOURCE_ROOT; }; - 483A77FB0D2EE9A900CB2E4C /* protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = protocol.h; path = ../Quake/protocol.h; sourceTree = SOURCE_ROOT; }; - 483A77FC0D2EE9A900CB2E4C /* server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = server.h; path = ../Quake/server.h; sourceTree = SOURCE_ROOT; }; - 483A77FD0D2EE9BD00CB2E4C /* cdaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cdaudio.h; path = ../Quake/cdaudio.h; sourceTree = SOURCE_ROOT; }; - 483A77FE0D2EE9BD00CB2E4C /* q_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = q_sound.h; path = ../Quake/q_sound.h; sourceTree = SOURCE_ROOT; }; - 483A77FF0D2EE9F300CB2E4C /* anorm_dots.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = anorm_dots.h; path = ../Quake/anorm_dots.h; sourceTree = SOURCE_ROOT; }; - 483A78000D2EE9F300CB2E4C /* anorms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = anorms.h; path = ../Quake/anorms.h; sourceTree = SOURCE_ROOT; }; - 483A78010D2EE9F300CB2E4C /* bspfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bspfile.h; path = ../Quake/bspfile.h; sourceTree = SOURCE_ROOT; }; - 483A78020D2EE9F300CB2E4C /* d_ifacea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = d_ifacea.h; path = ../Quake/d_ifacea.h; sourceTree = SOURCE_ROOT; }; - 483A78030D2EE9F300CB2E4C /* draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = draw.h; path = ../Quake/draw.h; sourceTree = SOURCE_ROOT; }; - 483A78040D2EE9F300CB2E4C /* gl_model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl_model.h; path = ../Quake/gl_model.h; sourceTree = SOURCE_ROOT; }; - 483A78050D2EE9F300CB2E4C /* gl_texmgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl_texmgr.h; path = ../Quake/gl_texmgr.h; sourceTree = SOURCE_ROOT; }; - 483A78060D2EE9F300CB2E4C /* gl_warp_sin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl_warp_sin.h; path = ../Quake/gl_warp_sin.h; sourceTree = SOURCE_ROOT; }; - 483A78070D2EE9F300CB2E4C /* glquake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glquake.h; path = ../Quake/glquake.h; sourceTree = SOURCE_ROOT; }; - 483A78080D2EE9F300CB2E4C /* image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = image.h; path = ../Quake/image.h; sourceTree = SOURCE_ROOT; }; - 483A78090D2EE9F300CB2E4C /* modelgen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = modelgen.h; path = ../Quake/modelgen.h; sourceTree = SOURCE_ROOT; }; - 483A780A0D2EE9F300CB2E4C /* render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = render.h; path = ../Quake/render.h; sourceTree = SOURCE_ROOT; }; - 483A780B0D2EE9F300CB2E4C /* screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = screen.h; path = ../Quake/screen.h; sourceTree = SOURCE_ROOT; }; - 483A780C0D2EE9F300CB2E4C /* spritegn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spritegn.h; path = ../Quake/spritegn.h; sourceTree = SOURCE_ROOT; }; - 483A780D0D2EE9F300CB2E4C /* vid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vid.h; path = ../Quake/vid.h; sourceTree = SOURCE_ROOT; }; - 483A780E0D2EEA0F00CB2E4C /* progdefs.q1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = progdefs.q1; path = ../Quake/progdefs.q1; sourceTree = SOURCE_ROOT; }; - 483A78100D2EEA5400CB2E4C /* chase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = chase.c; path = ../Quake/chase.c; sourceTree = SOURCE_ROOT; }; - 483A78110D2EEA5400CB2E4C /* cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cmd.c; path = ../Quake/cmd.c; sourceTree = SOURCE_ROOT; }; - 483A78120D2EEA5400CB2E4C /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = common.c; path = ../Quake/common.c; sourceTree = SOURCE_ROOT; }; - 483A78130D2EEA5400CB2E4C /* console.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = console.c; path = ../Quake/console.c; sourceTree = SOURCE_ROOT; }; - 483A78140D2EEA5400CB2E4C /* crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crc.c; path = ../Quake/crc.c; sourceTree = SOURCE_ROOT; }; - 483A78150D2EEA5400CB2E4C /* cvar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cvar.c; path = ../Quake/cvar.c; sourceTree = SOURCE_ROOT; }; - 483A78160D2EEA5400CB2E4C /* host_cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = host_cmd.c; path = ../Quake/host_cmd.c; sourceTree = SOURCE_ROOT; }; - 483A78170D2EEA5400CB2E4C /* host.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = host.c; path = ../Quake/host.c; sourceTree = SOURCE_ROOT; }; - 483A78180D2EEA5400CB2E4C /* mathlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mathlib.c; path = ../Quake/mathlib.c; sourceTree = SOURCE_ROOT; }; - 483A78190D2EEA5400CB2E4C /* menu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menu.c; path = ../Quake/menu.c; sourceTree = SOURCE_ROOT; }; - 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pr_cmds.c; path = ../Quake/pr_cmds.c; sourceTree = SOURCE_ROOT; }; - 483A781B0D2EEA5400CB2E4C /* pr_edict.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pr_edict.c; path = ../Quake/pr_edict.c; sourceTree = SOURCE_ROOT; }; - 483A781C0D2EEA5400CB2E4C /* pr_exec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pr_exec.c; path = ../Quake/pr_exec.c; sourceTree = SOURCE_ROOT; }; - 483A781D0D2EEA5400CB2E4C /* sbar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sbar.c; path = ../Quake/sbar.c; sourceTree = SOURCE_ROOT; }; - 483A781F0D2EEA5400CB2E4C /* view.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = view.c; path = ../Quake/view.c; sourceTree = SOURCE_ROOT; }; - 483A78200D2EEA5400CB2E4C /* wad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wad.c; path = ../Quake/wad.c; sourceTree = SOURCE_ROOT; }; - 483A78210D2EEA5400CB2E4C /* world.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = world.c; path = ../Quake/world.c; sourceTree = SOURCE_ROOT; }; - 483A78220D2EEA5400CB2E4C /* zone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zone.c; path = ../Quake/zone.c; sourceTree = SOURCE_ROOT; }; - 483A78360D2EEA6D00CB2E4C /* in_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = in_sdl.c; path = ../Quake/in_sdl.c; sourceTree = SOURCE_ROOT; }; - 483A78370D2EEA6D00CB2E4C /* keys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = keys.c; path = ../Quake/keys.c; sourceTree = SOURCE_ROOT; }; - 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_demo.c; path = ../Quake/cl_demo.c; sourceTree = SOURCE_ROOT; }; - 483A783B0D2EEAAB00CB2E4C /* cl_input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_input.c; path = ../Quake/cl_input.c; sourceTree = SOURCE_ROOT; }; - 483A783C0D2EEAAB00CB2E4C /* cl_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_main.c; path = ../Quake/cl_main.c; sourceTree = SOURCE_ROOT; }; - 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_parse.c; path = ../Quake/cl_parse.c; sourceTree = SOURCE_ROOT; }; - 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_tent.c; path = ../Quake/cl_tent.c; sourceTree = SOURCE_ROOT; }; - 483A783F0D2EEAAB00CB2E4C /* net_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_main.c; path = ../Quake/net_main.c; sourceTree = SOURCE_ROOT; }; - 483A78410D2EEAAB00CB2E4C /* sv_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_main.c; path = ../Quake/sv_main.c; sourceTree = SOURCE_ROOT; }; - 483A78420D2EEAAB00CB2E4C /* sv_move.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_move.c; path = ../Quake/sv_move.c; sourceTree = SOURCE_ROOT; }; - 483A78430D2EEAAB00CB2E4C /* sv_phys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_phys.c; path = ../Quake/sv_phys.c; sourceTree = SOURCE_ROOT; }; - 483A78440D2EEAAB00CB2E4C /* sv_user.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_user.c; path = ../Quake/sv_user.c; sourceTree = SOURCE_ROOT; }; - 483A78500D2EEAC300CB2E4C /* cd_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cd_sdl.c; path = ../Quake/cd_sdl.c; sourceTree = SOURCE_ROOT; }; - 483A78540D2EEAC300CB2E4C /* snd_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_sdl.c; path = ../Quake/snd_sdl.c; sourceTree = SOURCE_ROOT; }; - 483A785A0D2EEAF000CB2E4C /* gl_draw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_draw.c; path = ../Quake/gl_draw.c; sourceTree = SOURCE_ROOT; }; - 483A785B0D2EEAF000CB2E4C /* gl_fog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_fog.c; path = ../Quake/gl_fog.c; sourceTree = SOURCE_ROOT; }; - 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_mesh.c; path = ../Quake/gl_mesh.c; sourceTree = SOURCE_ROOT; }; - 483A785D0D2EEAF000CB2E4C /* gl_model.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_model.c; path = ../Quake/gl_model.c; sourceTree = SOURCE_ROOT; }; - 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_refrag.c; path = ../Quake/gl_refrag.c; sourceTree = SOURCE_ROOT; }; - 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_rlight.c; path = ../Quake/gl_rlight.c; sourceTree = SOURCE_ROOT; }; - 483A78600D2EEAF000CB2E4C /* gl_rmain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_rmain.c; path = ../Quake/gl_rmain.c; sourceTree = SOURCE_ROOT; }; - 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_rmisc.c; path = ../Quake/gl_rmisc.c; sourceTree = SOURCE_ROOT; }; - 483A78620D2EEAF000CB2E4C /* gl_screen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_screen.c; path = ../Quake/gl_screen.c; sourceTree = SOURCE_ROOT; }; - 483A78630D2EEAF000CB2E4C /* gl_sky.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_sky.c; path = ../Quake/gl_sky.c; sourceTree = SOURCE_ROOT; }; - 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mikmod.c; path = ../Quake/snd_mikmod.c; sourceTree = SOURCE_ROOT; }; - 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_texmgr.c; path = ../Quake/gl_texmgr.c; sourceTree = SOURCE_ROOT; }; - 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_vidsdl.c; path = ../Quake/gl_vidsdl.c; sourceTree = SOURCE_ROOT; }; - 483A78670D2EEAF000CB2E4C /* gl_warp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_warp.c; path = ../Quake/gl_warp.c; sourceTree = SOURCE_ROOT; }; - 483A78680D2EEAF000CB2E4C /* image.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = image.c; path = ../Quake/image.c; sourceTree = SOURCE_ROOT; }; - 483A78690D2EEAF000CB2E4C /* r_alias.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_alias.c; path = ../Quake/r_alias.c; sourceTree = SOURCE_ROOT; }; - 483A786A0D2EEAF000CB2E4C /* r_brush.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_brush.c; path = ../Quake/r_brush.c; sourceTree = SOURCE_ROOT; }; - 483A786B0D2EEAF000CB2E4C /* r_part.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_part.c; path = ../Quake/r_part.c; sourceTree = SOURCE_ROOT; }; - 483A786C0D2EEAF000CB2E4C /* r_sprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_sprite.c; path = ../Quake/r_sprite.c; sourceTree = SOURCE_ROOT; }; - 483A786D0D2EEAF000CB2E4C /* r_world.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_world.c; path = ../Quake/r_world.c; sourceTree = SOURCE_ROOT; }; - 4846EB500D329BEB00A108DE /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = platform.h; path = ../Quake/platform.h; sourceTree = SOURCE_ROOT; }; - 4847CD5E12057F94000B560F /* sys_sdl_unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sys_sdl_unix.c; path = ../Quake/sys_sdl_unix.c; sourceTree = SOURCE_ROOT; }; - 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = QuakeSpasm.icns; sourceTree = "<group>"; }; - 4854B1B01340C646004C9F45 /* snd_mp3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mp3.c; path = ../Quake/snd_mp3.c; sourceTree = SOURCE_ROOT; }; - 486577C80D31A22A00E7920A /* snd_dma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_dma.c; path = ../Quake/snd_dma.c; sourceTree = SOURCE_ROOT; }; - 486577C90D31A22A00E7920A /* snd_mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mem.c; path = ../Quake/snd_mem.c; sourceTree = SOURCE_ROOT; }; - 486577CA0D31A22A00E7920A /* snd_mix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mix.c; path = ../Quake/snd_mix.c; sourceTree = SOURCE_ROOT; }; - 48728D280D3004A70004D61B /* net_dgrm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_dgrm.c; path = ../Quake/net_dgrm.c; sourceTree = SOURCE_ROOT; }; - 48728D290D3004A80004D61B /* net_dgrm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_dgrm.h; path = ../Quake/net_dgrm.h; sourceTree = SOURCE_ROOT; }; - 48728D2A0D3004A80004D61B /* net_loop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_loop.c; path = ../Quake/net_loop.c; sourceTree = SOURCE_ROOT; }; - 48728D2B0D3004A80004D61B /* net_loop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_loop.h; path = ../Quake/net_loop.h; sourceTree = SOURCE_ROOT; }; - 4885A84A179740A0000EC703 /* snd_opus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_opus.c; path = ../Quake/snd_opus.c; sourceTree = "<group>"; }; - 4885A84B179740A0000EC703 /* snd_opus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_opus.h; path = ../Quake/snd_opus.h; sourceTree = "<group>"; }; - 4885A84D179740CA000EC703 /* libopus.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopus.dylib; path = codecs/lib/libopus.dylib; sourceTree = "<group>"; }; - 4885A84E179740CA000EC703 /* libopusfile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopusfile.dylib; path = codecs/lib/libopusfile.dylib; sourceTree = "<group>"; }; - 48895DB80D4914A000849ABF /* pl_osx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = pl_osx.m; path = ../Quake/pl_osx.m; sourceTree = SOURCE_ROOT; }; - 488EF23614B83A370021DD41 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; - 489D8D2D0D3A630D00AA4471 /* ScreenInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScreenInfo.h; sourceTree = "<group>"; }; - 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreenInfo.m; sourceTree = "<group>"; }; - 48A7C1F914AA34940011B754 /* strl_fn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strl_fn.h; path = ../Quake/strl_fn.h; sourceTree = "<group>"; }; - 48A7C1FA14AA34940011B754 /* strlcat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcat.c; path = ../Quake/strlcat.c; sourceTree = "<group>"; }; - 48A7C1FB14AA34940011B754 /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = ../Quake/strlcpy.c; sourceTree = "<group>"; }; - 48B9E7870D340B1E0001CACF /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Launcher.nib; sourceTree = "<group>"; }; - 48B9E7A50D340BEA0001CACF /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; }; - 48B9E7A60D340BEA0001CACF /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = "<group>"; }; - 48B9E7BE0D340EA80001CACF /* SDLApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLApplication.h; sourceTree = "<group>"; }; - 48B9E7BF0D340EA80001CACF /* SDLApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLApplication.m; sourceTree = "<group>"; }; - 48C85E390D3AD10E00797678 /* QuakeArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuakeArgument.h; sourceTree = "<group>"; }; - 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuakeArgument.m; sourceTree = "<group>"; }; - 48E2EC7915FB507A00B8D476 /* libmad.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmad.dylib; path = codecs/lib/libmad.dylib; sourceTree = "<group>"; }; - 48E2EC7A15FB507A00B8D476 /* libogg.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libogg.dylib; path = codecs/lib/libogg.dylib; sourceTree = "<group>"; }; - 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbis.dylib; path = codecs/lib/libvorbis.dylib; sourceTree = "<group>"; }; - 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbisfile.dylib; path = codecs/lib/libvorbisfile.dylib; sourceTree = "<group>"; }; - 48FE58590D3A82C8006BB491 /* QuakeArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuakeArguments.h; sourceTree = "<group>"; }; - 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuakeArguments.m; sourceTree = "<group>"; }; - 63D6EB3423A255900047028C /* snd_mp3tag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mp3tag.c; path = ../Quake/snd_mp3tag.c; sourceTree = SOURCE_ROOT; }; - 664D98F919CF6B78000D395C /* QuakeSpasm-SDL2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "QuakeSpasm-SDL2.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 664D98FB19CF6B78000D395C /* Info copy.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info copy.plist"; sourceTree = "<group>"; }; - 664D990519CF6E16000D395C /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SDL2.framework; sourceTree = SOURCE_ROOT; }; - 66991C021DBAB47000C373C0 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = LICENSE.txt; path = ../LICENSE.txt; sourceTree = "<group>"; }; - 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "Quakespasm-Music.txt"; path = "../Quakespasm-Music.txt"; sourceTree = "<group>"; }; - 66991C041DBAB47000C373C0 /* Quakespasm.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Quakespasm.html; path = ../Quakespasm.html; sourceTree = "<group>"; }; - 66991C051DBAB47000C373C0 /* Quakespasm.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = Quakespasm.txt; path = ../Quakespasm.txt; sourceTree = "<group>"; }; - 66991C061DBAB48000C373C0 /* quakespasm.pak */ = {isa = PBXFileReference; lastKnownFileType = file; name = quakespasm.pak; path = ../Quake/quakespasm.pak; sourceTree = "<group>"; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; - 8D1107320486CEB800E47090 /* QuakeSpasm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuakeSpasm.app; sourceTree = BUILT_PRODUCTS_DIR; }; - B021C20714A5FF7E003F18D6 /* cfgfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cfgfile.c; path = ../Quake/cfgfile.c; sourceTree = SOURCE_ROOT; }; - B021C20814A5FF7E003F18D6 /* cfgfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cfgfile.h; path = ../Quake/cfgfile.h; sourceTree = SOURCE_ROOT; }; - F5F5DE80017CB4370103A810 /* libmikmod.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmikmod.dylib; path = codecs/lib/libmikmod.dylib; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 664D98DD19CF6B78000D395C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 664D98DE19CF6B78000D395C /* libFLAC.dylib in Frameworks */, - 664D98DF19CF6B78000D395C /* libopus.dylib in Frameworks */, - 664D98E019CF6B78000D395C /* libopusfile.dylib in Frameworks */, - 664D98E119CF6B78000D395C /* libmad.dylib in Frameworks */, - 664D98E219CF6B78000D395C /* libogg.dylib in Frameworks */, - 664D98E319CF6B78000D395C /* libvorbis.dylib in Frameworks */, - 664D98E419CF6B78000D395C /* libvorbisfile.dylib in Frameworks */, - 664D98E519CF6B78000D395C /* libmikmod.dylib in Frameworks */, - 664D98E619CF6B78000D395C /* IOKit.framework in Frameworks */, - 664D98E919CF6B78000D395C /* Cocoa.framework in Frameworks */, - 664D98EA19CF6B78000D395C /* OpenGL.framework in Frameworks */, - 664D990619CF6E16000D395C /* SDL2.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 482812FD179C3EF4004E1D61 /* libFLAC.dylib in Frameworks */, - 4885A84F179740CA000EC703 /* libopus.dylib in Frameworks */, - 4885A850179740CA000EC703 /* libopusfile.dylib in Frameworks */, - 48E2EC7D15FB507A00B8D476 /* libmad.dylib in Frameworks */, - 48E2EC7E15FB507A00B8D476 /* libogg.dylib in Frameworks */, - 48E2EC7F15FB507A00B8D476 /* libvorbis.dylib in Frameworks */, - 48E2EC8015FB507A00B8D476 /* libvorbisfile.dylib in Frameworks */, - A4E3AF6205D43FCC000F1B47 /* libmikmod.dylib in Frameworks */, - 48E2EC7815FB500400B8D476 /* IOKit.framework in Frameworks */, - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 488EF23614B83A370021DD41 /* IOKit.framework */, - 664D990519CF6E16000D395C /* SDL2.framework */, - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */, - ); - name = "Linked Frameworks"; - sourceTree = "<group>"; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = "<group>"; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* QuakeSpasm.app */, - 664D98F919CF6B78000D395C /* QuakeSpasm-SDL2.app */, - ); - name = Products; - sourceTree = "<group>"; - }; - 29B97314FDCFA39411CA2CEA /* QuakeSpasm */ = { - isa = PBXGroup; - children = ( - 482812FC179C3EF4004E1D61 /* libFLAC.dylib */, - 4885A84D179740CA000EC703 /* libopus.dylib */, - 4885A84E179740CA000EC703 /* libopusfile.dylib */, - 48E2EC7915FB507A00B8D476 /* libmad.dylib */, - 48E2EC7A15FB507A00B8D476 /* libogg.dylib */, - 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */, - 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */, - F5F5DE80017CB4370103A810 /* libmikmod.dylib */, - 48243B060D33ED0A00C29F8F /* MacOSX */, - 483A77D80D2EE8C500CB2E4C /* Quake */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 66991C011DBAB43000C373C0 /* Release Archive Files */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 8; - name = QuakeSpasm; - sourceTree = "<group>"; - tabWidth = 8; - usesTabs = 1; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */, - 48B9E7860D340B1E0001CACF /* Launcher.nib */, - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 664D98FB19CF6B78000D395C /* Info copy.plist */, - ); - name = Resources; - sourceTree = "<group>"; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 48243B060D33ED0A00C29F8F /* MacOSX */ = { - isa = PBXGroup; - children = ( - 48B9E7A50D340BEA0001CACF /* AppController.h */, - 48B9E7A60D340BEA0001CACF /* AppController.m */, - 48FE58590D3A82C8006BB491 /* QuakeArguments.h */, - 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */, - 489D8D2D0D3A630D00AA4471 /* ScreenInfo.h */, - 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */, - 48B9E7BE0D340EA80001CACF /* SDLApplication.h */, - 48B9E7BF0D340EA80001CACF /* SDLApplication.m */, - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - 48C85E390D3AD10E00797678 /* QuakeArgument.h */, - 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */, - ); - name = MacOSX; - sourceTree = "<group>"; - }; - 483A77D80D2EE8C500CB2E4C /* Quake */ = { - isa = PBXGroup; - children = ( - 483A77D90D2EE8D400CB2E4C /* Generic */, - 483A77DA0D2EE8DA00CB2E4C /* Input */, - 483A77DD0D2EE8F100CB2E4C /* Network */, - 483A77DC0D2EE8ED00CB2E4C /* Sound */, - 483A77DB0D2EE8E600CB2E4C /* Video */, - ); - name = Quake; - sourceTree = "<group>"; - }; - 483A77D90D2EE8D400CB2E4C /* Generic */ = { - isa = PBXGroup; - children = ( - 483A77DE0D2EE8FB00CB2E4C /* Headers */, - B021C20714A5FF7E003F18D6 /* cfgfile.c */, - 483A78100D2EEA5400CB2E4C /* chase.c */, - 483A78110D2EEA5400CB2E4C /* cmd.c */, - 483A78120D2EEA5400CB2E4C /* common.c */, - 483A78130D2EEA5400CB2E4C /* console.c */, - 483A78140D2EEA5400CB2E4C /* crc.c */, - 483A78150D2EEA5400CB2E4C /* cvar.c */, - 483A78170D2EEA5400CB2E4C /* host.c */, - 483A78160D2EEA5400CB2E4C /* host_cmd.c */, - 48243B130D33F01A00C29F8F /* main_sdl.c */, - 483A78180D2EEA5400CB2E4C /* mathlib.c */, - 483A78190D2EEA5400CB2E4C /* menu.c */, - 48895DB80D4914A000849ABF /* pl_osx.m */, - 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */, - 483A781B0D2EEA5400CB2E4C /* pr_edict.c */, - 483A781C0D2EEA5400CB2E4C /* pr_exec.c */, - 483A780E0D2EEA0F00CB2E4C /* progdefs.q1 */, - 483A781D0D2EEA5400CB2E4C /* sbar.c */, - 48A7C1FA14AA34940011B754 /* strlcat.c */, - 48A7C1FB14AA34940011B754 /* strlcpy.c */, - 4847CD5E12057F94000B560F /* sys_sdl_unix.c */, - 483A781F0D2EEA5400CB2E4C /* view.c */, - 483A78200D2EEA5400CB2E4C /* wad.c */, - 483A78210D2EEA5400CB2E4C /* world.c */, - 483A78220D2EEA5400CB2E4C /* zone.c */, - ); - name = Generic; - sourceTree = "<group>"; - }; - 483A77DA0D2EE8DA00CB2E4C /* Input */ = { - isa = PBXGroup; - children = ( - 483A77DF0D2EE90500CB2E4C /* Headers */, - 483A78360D2EEA6D00CB2E4C /* in_sdl.c */, - 483A78370D2EEA6D00CB2E4C /* keys.c */, - ); - name = Input; - sourceTree = "<group>"; - }; - 483A77DB0D2EE8E600CB2E4C /* Video */ = { - isa = PBXGroup; - children = ( - 483A77E20D2EE91500CB2E4C /* Headers */, - 483A785A0D2EEAF000CB2E4C /* gl_draw.c */, - 483A785B0D2EEAF000CB2E4C /* gl_fog.c */, - 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */, - 483A785D0D2EEAF000CB2E4C /* gl_model.c */, - 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */, - 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */, - 483A78600D2EEAF000CB2E4C /* gl_rmain.c */, - 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */, - 483A78620D2EEAF000CB2E4C /* gl_screen.c */, - 483A78630D2EEAF000CB2E4C /* gl_sky.c */, - 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */, - 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */, - 483A78670D2EEAF000CB2E4C /* gl_warp.c */, - 483A78680D2EEAF000CB2E4C /* image.c */, - 483A78690D2EEAF000CB2E4C /* r_alias.c */, - 483A786A0D2EEAF000CB2E4C /* r_brush.c */, - 483A786B0D2EEAF000CB2E4C /* r_part.c */, - 483A786C0D2EEAF000CB2E4C /* r_sprite.c */, - 483A786D0D2EEAF000CB2E4C /* r_world.c */, - ); - name = Video; - sourceTree = "<group>"; - }; - 483A77DC0D2EE8ED00CB2E4C /* Sound */ = { - isa = PBXGroup; - children = ( - 483A77E10D2EE91000CB2E4C /* Headers */, - 4818B0A112D5B9AE006DD66E /* bgmusic.c */, - 483A78500D2EEAC300CB2E4C /* cd_sdl.c */, - 4818B0AC12D5B9ED006DD66E /* snd_codec.c */, - 486577C80D31A22A00E7920A /* snd_dma.c */, - 482812FF179C3F13004E1D61 /* snd_flac.c */, - 486577C90D31A22A00E7920A /* snd_mem.c */, - 486577CA0D31A22A00E7920A /* snd_mix.c */, - 483A78540D2EEAC300CB2E4C /* snd_sdl.c */, - 4854B1B01340C646004C9F45 /* snd_mp3.c */, - 63D6EB3423A255900047028C /* snd_mp3tag.c */, - 4885A84A179740A0000EC703 /* snd_opus.c */, - 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */, - 4818B0B012D5BA1A006DD66E /* snd_umx.c */, - 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */, - 4818B0B412D5BA1A006DD66E /* snd_wave.c */, - ); - name = Sound; - sourceTree = "<group>"; - }; - 483A77DD0D2EE8F100CB2E4C /* Network */ = { - isa = PBXGroup; - children = ( - 483A77E00D2EE90B00CB2E4C /* Headers */, - 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */, - 483A783B0D2EEAAB00CB2E4C /* cl_input.c */, - 483A783C0D2EEAAB00CB2E4C /* cl_main.c */, - 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */, - 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */, - 48134A1412102F400015BF15 /* net_bsd.c */, - 48728D280D3004A70004D61B /* net_dgrm.c */, - 48728D2A0D3004A80004D61B /* net_loop.c */, - 483A783F0D2EEAAB00CB2E4C /* net_main.c */, - 48134A1612102F400015BF15 /* net_udp.c */, - 483A78410D2EEAAB00CB2E4C /* sv_main.c */, - 483A78420D2EEAAB00CB2E4C /* sv_move.c */, - 483A78430D2EEAAB00CB2E4C /* sv_phys.c */, - 483A78440D2EEAAB00CB2E4C /* sv_user.c */, - ); - name = Network; - sourceTree = "<group>"; - }; - 483A77DE0D2EE8FB00CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - B021C20814A5FF7E003F18D6 /* cfgfile.h */, - 483A77E60D2EE97700CB2E4C /* cmd.h */, - 483A77E70D2EE97700CB2E4C /* common.h */, - 483A77E80D2EE97700CB2E4C /* console.h */, - 483A77E90D2EE97700CB2E4C /* crc.h */, - 483A77EA0D2EE97700CB2E4C /* cvar.h */, - 483A77EB0D2EE97700CB2E4C /* mathlib.h */, - 483A77EC0D2EE97700CB2E4C /* menu.h */, - 4846EB500D329BEB00A108DE /* platform.h */, - 483A77ED0D2EE97700CB2E4C /* pr_comp.h */, - 483A77EE0D2EE97700CB2E4C /* progdefs.h */, - 483A77EF0D2EE97700CB2E4C /* progs.h */, - 483A77F00D2EE97700CB2E4C /* quakedef.h */, - 483A77F10D2EE97700CB2E4C /* sbar.h */, - 48A7C1F914AA34940011B754 /* strl_fn.h */, - 483A77F20D2EE97700CB2E4C /* sys.h */, - 483A77F30D2EE97700CB2E4C /* view.h */, - 483A77F40D2EE97700CB2E4C /* wad.h */, - 483A77F50D2EE97700CB2E4C /* world.h */, - 483A77F60D2EE97700CB2E4C /* zone.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77DF0D2EE90500CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 483A77F70D2EE98D00CB2E4C /* input.h */, - 483A77F80D2EE98D00CB2E4C /* keys.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77E00D2EE90B00CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 483A77F90D2EE9A900CB2E4C /* client.h */, - 483A77FA0D2EE9A900CB2E4C /* net.h */, - 48134A1512102F400015BF15 /* net_defs.h */, - 48728D290D3004A80004D61B /* net_dgrm.h */, - 48728D2B0D3004A80004D61B /* net_loop.h */, - 48134A1712102F400015BF15 /* net_udp.h */, - 483A77FB0D2EE9A900CB2E4C /* protocol.h */, - 483A77FC0D2EE9A900CB2E4C /* server.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77E10D2EE91000CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 4818B0A212D5B9AE006DD66E /* bgmusic.h */, - 483A77FD0D2EE9BD00CB2E4C /* cdaudio.h */, - 483A77FE0D2EE9BD00CB2E4C /* q_sound.h */, - 4818B0AD12D5B9ED006DD66E /* snd_codec.h */, - 4818B0AF12D5BA1A006DD66E /* snd_codeci.h */, - 48281300179C3F13004E1D61 /* snd_flac.h */, - 4818B0B112D5BA1A006DD66E /* snd_mp3.h */, - 4885A84B179740A0000EC703 /* snd_opus.h */, - 4818B0B312D5BA1A006DD66E /* snd_vorbis.h */, - 4818B0B512D5BA1A006DD66E /* snd_wave.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77E20D2EE91500CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 483A77FF0D2EE9F300CB2E4C /* anorm_dots.h */, - 483A78000D2EE9F300CB2E4C /* anorms.h */, - 483A78010D2EE9F300CB2E4C /* bspfile.h */, - 483A78020D2EE9F300CB2E4C /* d_ifacea.h */, - 483A78030D2EE9F300CB2E4C /* draw.h */, - 483A78040D2EE9F300CB2E4C /* gl_model.h */, - 483A78050D2EE9F300CB2E4C /* gl_texmgr.h */, - 483A78060D2EE9F300CB2E4C /* gl_warp_sin.h */, - 483A78070D2EE9F300CB2E4C /* glquake.h */, - 483A78080D2EE9F300CB2E4C /* image.h */, - 483A78090D2EE9F300CB2E4C /* modelgen.h */, - 483A780A0D2EE9F300CB2E4C /* render.h */, - 483A780B0D2EE9F300CB2E4C /* screen.h */, - 483A780C0D2EE9F300CB2E4C /* spritegn.h */, - 483A780D0D2EE9F300CB2E4C /* vid.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 66991C011DBAB43000C373C0 /* Release Archive Files */ = { - isa = PBXGroup; - children = ( - 66991C061DBAB48000C373C0 /* quakespasm.pak */, - 66991C021DBAB47000C373C0 /* LICENSE.txt */, - 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */, - 66991C041DBAB47000C373C0 /* Quakespasm.html */, - 66991C051DBAB47000C373C0 /* Quakespasm.txt */, - ); - name = "Release Archive Files"; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 664D988819CF6B78000D395C /* QuakeSpasm-SDL2 */ = { - isa = PBXNativeTarget; - buildConfigurationList = 664D98F619CF6B78000D395C /* Build configuration list for PBXNativeTarget "QuakeSpasm-SDL2" */; - buildPhases = ( - 664D988919CF6B78000D395C /* Resources */, - 664D988D19CF6B78000D395C /* Sources */, - 664D98DD19CF6B78000D395C /* Frameworks */, - 664D98EB19CF6B78000D395C /* Copy Frameworks */, - 664D98ED19CF6B78000D395C /* Copy Libraries */, - 66991C001DBAB3F500C373C0 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "QuakeSpasm-SDL2"; - productInstallPath = "$(HOME)/Applications"; - productName = QuakeSpasm; - productReference = 664D98F919CF6B78000D395C /* QuakeSpasm-SDL2.app */; - productType = "com.apple.product-type.application"; - }; - 8D1107260486CEB800E47090 /* QuakeSpasm */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "QuakeSpasm" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks */, - 48692C131340A46800A0F098 /* Copy Libraries */, - 66991C0C1DBAB4AF00C373C0 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = QuakeSpasm; - productInstallPath = "$(HOME)/Applications"; - productName = QuakeSpasm; - productReference = 8D1107320486CEB800E47090 /* QuakeSpasm.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0420; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "QuakeSpasm" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* QuakeSpasm */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* QuakeSpasm */, - 664D988819CF6B78000D395C /* QuakeSpasm-SDL2 */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 664D988919CF6B78000D395C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 664D988A19CF6B78000D395C /* InfoPlist.strings in Resources */, - 664D988B19CF6B78000D395C /* Launcher.nib in Resources */, - 664D988C19CF6B78000D395C /* QuakeSpasm.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 48B9E7880D340B1E0001CACF /* Launcher.nib in Resources */, - 484AA4B40D3FF6C0005D917A /* QuakeSpasm.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 664D988D19CF6B78000D395C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 664D988E19CF6B78000D395C /* SDLMain.m in Sources */, - 664D988F19CF6B78000D395C /* chase.c in Sources */, - 664D989019CF6B78000D395C /* cmd.c in Sources */, - 664D989119CF6B78000D395C /* common.c in Sources */, - 664D989219CF6B78000D395C /* console.c in Sources */, - 664D989319CF6B78000D395C /* crc.c in Sources */, - 664D989419CF6B78000D395C /* cvar.c in Sources */, - 664D989519CF6B78000D395C /* host_cmd.c in Sources */, - 664D989619CF6B78000D395C /* host.c in Sources */, - 664D989719CF6B78000D395C /* mathlib.c in Sources */, - 664D989819CF6B78000D395C /* menu.c in Sources */, - 664D989919CF6B78000D395C /* pr_cmds.c in Sources */, - 664D989A19CF6B78000D395C /* pr_edict.c in Sources */, - 664D989B19CF6B78000D395C /* pr_exec.c in Sources */, - 664D989C19CF6B78000D395C /* sbar.c in Sources */, - 664D989D19CF6B78000D395C /* view.c in Sources */, - 664D989E19CF6B78000D395C /* wad.c in Sources */, - 664D989F19CF6B78000D395C /* world.c in Sources */, - 664D98A019CF6B78000D395C /* zone.c in Sources */, - 664D98A119CF6B78000D395C /* in_sdl.c in Sources */, - 664D98A219CF6B78000D395C /* keys.c in Sources */, - 664D98A319CF6B78000D395C /* cl_demo.c in Sources */, - 664D98A419CF6B78000D395C /* cl_input.c in Sources */, - 664D98A519CF6B78000D395C /* cl_main.c in Sources */, - 664D98A619CF6B78000D395C /* cl_parse.c in Sources */, - 664D98A719CF6B78000D395C /* cl_tent.c in Sources */, - 664D98A819CF6B78000D395C /* net_main.c in Sources */, - 664D98A919CF6B78000D395C /* sv_main.c in Sources */, - 664D98AA19CF6B78000D395C /* sv_move.c in Sources */, - 664D98AB19CF6B78000D395C /* sv_phys.c in Sources */, - 664D98AC19CF6B78000D395C /* sv_user.c in Sources */, - 664D98AD19CF6B78000D395C /* cd_sdl.c in Sources */, - 664D98AE19CF6B78000D395C /* snd_sdl.c in Sources */, - 664D98AF19CF6B78000D395C /* gl_draw.c in Sources */, - 664D98B019CF6B78000D395C /* gl_fog.c in Sources */, - 664D98B119CF6B78000D395C /* gl_mesh.c in Sources */, - 664D98B219CF6B78000D395C /* gl_model.c in Sources */, - 664D98B319CF6B78000D395C /* gl_refrag.c in Sources */, - 664D98B419CF6B78000D395C /* gl_rlight.c in Sources */, - 664D98B519CF6B78000D395C /* gl_rmain.c in Sources */, - 664D98B619CF6B78000D395C /* gl_rmisc.c in Sources */, - 664D98B719CF6B78000D395C /* gl_screen.c in Sources */, - 664D98B819CF6B78000D395C /* gl_sky.c in Sources */, - 664D98B919CF6B78000D395C /* gl_texmgr.c in Sources */, - 664D98BA19CF6B78000D395C /* gl_vidsdl.c in Sources */, - 664D98BB19CF6B78000D395C /* gl_warp.c in Sources */, - 664D98BC19CF6B78000D395C /* image.c in Sources */, - 664D98BD19CF6B78000D395C /* r_alias.c in Sources */, - 664D98BE19CF6B78000D395C /* r_brush.c in Sources */, - 664D98BF19CF6B78000D395C /* r_part.c in Sources */, - 664D98C019CF6B78000D395C /* r_sprite.c in Sources */, - 664D98C119CF6B78000D395C /* r_world.c in Sources */, - 664D98C219CF6B78000D395C /* net_dgrm.c in Sources */, - 664D98C319CF6B78000D395C /* net_loop.c in Sources */, - 664D98C419CF6B78000D395C /* snd_dma.c in Sources */, - 664D98C519CF6B78000D395C /* snd_mem.c in Sources */, - 664D98C619CF6B78000D395C /* snd_mix.c in Sources */, - 664D98C719CF6B78000D395C /* main_sdl.c in Sources */, - 664D98C819CF6B78000D395C /* AppController.m in Sources */, - 664D98C919CF6B78000D395C /* SDLApplication.m in Sources */, - 664D98CA19CF6B78000D395C /* ScreenInfo.m in Sources */, - 664D98CB19CF6B78000D395C /* QuakeArguments.m in Sources */, - 664D98CC19CF6B78000D395C /* QuakeArgument.m in Sources */, - 664D98CD19CF6B78000D395C /* pl_osx.m in Sources */, - 664D98CE19CF6B78000D395C /* sys_sdl_unix.c in Sources */, - 664D98CF19CF6B78000D395C /* net_bsd.c in Sources */, - 664D98D019CF6B78000D395C /* net_udp.c in Sources */, - 664D98D119CF6B78000D395C /* bgmusic.c in Sources */, - 664D98D219CF6B78000D395C /* snd_codec.c in Sources */, - 664D98D319CF6B78000D395C /* snd_vorbis.c in Sources */, - 664D98D419CF6B78000D395C /* snd_wave.c in Sources */, - 664D98D519CF6B78000D395C /* snd_mp3.c in Sources */, - 664D98D619CF6B78000D395C /* snd_mikmod.c in Sources */, - 664D98D719CF6B78000D395C /* snd_umx.c in Sources */, - 664D98D819CF6B78000D395C /* cfgfile.c in Sources */, - 664D98D919CF6B78000D395C /* strlcat.c in Sources */, - 664D98DA19CF6B78000D395C /* strlcpy.c in Sources */, - 664D98DB19CF6B78000D395C /* snd_opus.c in Sources */, - 664D98DC19CF6B78000D395C /* snd_flac.c in Sources */, - 63D6EB3623A255900047028C /* snd_mp3tag.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 483A78230D2EEA5400CB2E4C /* chase.c in Sources */, - 483A78240D2EEA5400CB2E4C /* cmd.c in Sources */, - 483A78250D2EEA5400CB2E4C /* common.c in Sources */, - 483A78260D2EEA5400CB2E4C /* console.c in Sources */, - 483A78270D2EEA5400CB2E4C /* crc.c in Sources */, - 483A78280D2EEA5400CB2E4C /* cvar.c in Sources */, - 483A78290D2EEA5400CB2E4C /* host_cmd.c in Sources */, - 483A782A0D2EEA5400CB2E4C /* host.c in Sources */, - 483A782B0D2EEA5400CB2E4C /* mathlib.c in Sources */, - 483A782C0D2EEA5400CB2E4C /* menu.c in Sources */, - 483A782D0D2EEA5400CB2E4C /* pr_cmds.c in Sources */, - 483A782E0D2EEA5400CB2E4C /* pr_edict.c in Sources */, - 483A782F0D2EEA5400CB2E4C /* pr_exec.c in Sources */, - 483A78300D2EEA5400CB2E4C /* sbar.c in Sources */, - 483A78320D2EEA5400CB2E4C /* view.c in Sources */, - 483A78330D2EEA5400CB2E4C /* wad.c in Sources */, - 483A78340D2EEA5400CB2E4C /* world.c in Sources */, - 483A78350D2EEA5400CB2E4C /* zone.c in Sources */, - 483A78380D2EEA6D00CB2E4C /* in_sdl.c in Sources */, - 483A78390D2EEA6D00CB2E4C /* keys.c in Sources */, - 483A78450D2EEAAB00CB2E4C /* cl_demo.c in Sources */, - 483A78460D2EEAAB00CB2E4C /* cl_input.c in Sources */, - 483A78470D2EEAAB00CB2E4C /* cl_main.c in Sources */, - 483A78480D2EEAAB00CB2E4C /* cl_parse.c in Sources */, - 483A78490D2EEAAB00CB2E4C /* cl_tent.c in Sources */, - 483A784A0D2EEAAB00CB2E4C /* net_main.c in Sources */, - 483A784C0D2EEAAB00CB2E4C /* sv_main.c in Sources */, - 483A784D0D2EEAAB00CB2E4C /* sv_move.c in Sources */, - 483A784E0D2EEAAB00CB2E4C /* sv_phys.c in Sources */, - 483A784F0D2EEAAB00CB2E4C /* sv_user.c in Sources */, - 483A78550D2EEAC300CB2E4C /* cd_sdl.c in Sources */, - 483A78590D2EEAC300CB2E4C /* snd_sdl.c in Sources */, - 483A786E0D2EEAF000CB2E4C /* gl_draw.c in Sources */, - 483A786F0D2EEAF000CB2E4C /* gl_fog.c in Sources */, - 483A78700D2EEAF000CB2E4C /* gl_mesh.c in Sources */, - 483A78710D2EEAF000CB2E4C /* gl_model.c in Sources */, - 483A78720D2EEAF000CB2E4C /* gl_refrag.c in Sources */, - 483A78730D2EEAF000CB2E4C /* gl_rlight.c in Sources */, - 483A78740D2EEAF000CB2E4C /* gl_rmain.c in Sources */, - 483A78750D2EEAF000CB2E4C /* gl_rmisc.c in Sources */, - 483A78760D2EEAF000CB2E4C /* gl_screen.c in Sources */, - 483A78770D2EEAF000CB2E4C /* gl_sky.c in Sources */, - 483A78790D2EEAF000CB2E4C /* gl_texmgr.c in Sources */, - 483A787A0D2EEAF000CB2E4C /* gl_vidsdl.c in Sources */, - 483A787B0D2EEAF000CB2E4C /* gl_warp.c in Sources */, - 483A787C0D2EEAF000CB2E4C /* image.c in Sources */, - 483A787D0D2EEAF000CB2E4C /* r_alias.c in Sources */, - 483A787E0D2EEAF000CB2E4C /* r_brush.c in Sources */, - 483A787F0D2EEAF000CB2E4C /* r_part.c in Sources */, - 483A78800D2EEAF000CB2E4C /* r_sprite.c in Sources */, - 483A78810D2EEAF000CB2E4C /* r_world.c in Sources */, - 48728D2D0D3004A80004D61B /* net_dgrm.c in Sources */, - 48728D2E0D3004A80004D61B /* net_loop.c in Sources */, - 486577CB0D31A22A00E7920A /* snd_dma.c in Sources */, - 486577CC0D31A22A00E7920A /* snd_mem.c in Sources */, - 486577CD0D31A22A00E7920A /* snd_mix.c in Sources */, - 48243B140D33F01A00C29F8F /* main_sdl.c in Sources */, - 48B9E7A70D340BEA0001CACF /* AppController.m in Sources */, - 48B9E7C00D340EA80001CACF /* SDLApplication.m in Sources */, - 489D8D2F0D3A630D00AA4471 /* ScreenInfo.m in Sources */, - 48FE585B0D3A82C8006BB491 /* QuakeArguments.m in Sources */, - 48C85E3B0D3AD10E00797678 /* QuakeArgument.m in Sources */, - 48895DB90D4914A000849ABF /* pl_osx.m in Sources */, - 4847CD5F12057F94000B560F /* sys_sdl_unix.c in Sources */, - 48134A1812102F400015BF15 /* net_bsd.c in Sources */, - 48134A1912102F400015BF15 /* net_udp.c in Sources */, - 4818B0A312D5B9AE006DD66E /* bgmusic.c in Sources */, - 4818B0AE12D5B9ED006DD66E /* snd_codec.c in Sources */, - 4818B0B712D5BA1A006DD66E /* snd_vorbis.c in Sources */, - 4818B0B812D5BA1A006DD66E /* snd_wave.c in Sources */, - 4854B1B11340C646004C9F45 /* snd_mp3.c in Sources */, - 483A78780D2EEAF000CB2E4C /* snd_mikmod.c in Sources */, - 32CA4F630368D1EE00C91783 /* snd_umx.c in Sources */, - B021C20914A5FF7E003F18D6 /* cfgfile.c in Sources */, - 48A7C1FC14AA34940011B754 /* strlcat.c in Sources */, - 48A7C1FD14AA34940011B754 /* strlcpy.c in Sources */, - 4885A84C179740A0000EC703 /* snd_opus.c in Sources */, - 48281301179C3F13004E1D61 /* snd_flac.c in Sources */, - 63D6EB3523A255900047028C /* snd_mp3tag.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = "<group>"; - }; - 48B9E7860D340B1E0001CACF /* Launcher.nib */ = { - isa = PBXVariantGroup; - children = ( - 48B9E7870D340B1E0001CACF /* English */, - ); - name = Launcher.nib; - sourceTree = "<group>"; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 664D98F719CF6B78000D395C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_SDL2, - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)", - "$(SRCROOT)/codecs/lib", - ); - PRODUCT_NAME = "QuakeSpasm-SDL2"; - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Debug; - }; - 664D98F819CF6B78000D395C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - x86_64, - i386, - ); - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_SDL2, - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)", - "$(SRCROOT)/codecs/lib", - ); - OTHER_CFLAGS = ""; - "OTHER_CFLAGS[arch=i386]" = ( - "-arch", - i386, - ); - OTHER_LDFLAGS = ""; - "OTHER_LDFLAGS[arch=i386]" = ( - "-arch", - i386, - ); - "OTHER_LDFLAGS[arch=ppc]" = ( - "-arch", - ppc, - ); - PRODUCT_NAME = "QuakeSpasm-SDL2"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - "\"$(SRCROOT)/codecs/lib\"", - ); - PRODUCT_NAME = QuakeSpasm; - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - GCC_MODEL_TUNING = G5; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - "\"$(SRCROOT)/codecs/lib\"", - ); - OTHER_CFLAGS = ""; - "OTHER_CFLAGS[arch=i386]" = ( - "-arch", - i386, - ); - "OTHER_CFLAGS[arch=ppc]" = ( - "-arch", - ppc, - ); - OTHER_LDFLAGS = ""; - "OTHER_LDFLAGS[arch=i386]" = ( - "-arch", - i386, - ); - "OTHER_LDFLAGS[arch=ppc]" = ( - "-arch", - ppc, - ); - PRODUCT_NAME = QuakeSpasm; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - x86_64, - i386, - ); - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_MODEL_TUNING = G3; - GCC_PREPROCESSOR_DEFINITIONS = SDL_FRAMEWORK; - GCC_VERSION = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; - LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.6; - ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = ""; - PREBINDING = NO; - SDKROOT = macosx; - "SDKROOT[arch=i386]" = macosx; - "SDKROOT[arch=ppc]" = macosx; - "SDKROOT[arch=x86_64]" = macosx; - STRIP_INSTALLED_PRODUCT = NO; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - COPY_PHASE_STRIP = NO; - DEPLOYMENT_POSTPROCESSING = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_MODEL_TUNING = G3; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - GCC_VERSION = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; - LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.6; - ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - "OTHER_LDFLAGS[arch=i386]" = ( - "-mmacosx-version-min=10.4", - "-arch", - i386, - ); - "OTHER_LDFLAGS[arch=ppc]" = ( - "-mmacosx-version-min=10.4", - "-arch", - ppc, - ); - PREBINDING = NO; - SDKROOT = macosx; - "SDKROOT[arch=i386]" = macosx; - "SDKROOT[arch=ppc]" = macosx; - "SDKROOT[arch=x86_64]" = macosx; - STRIP_INSTALLED_PRODUCT = NO; - VALID_ARCHS = "i386 x86_64 ppc"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 664D98F619CF6B78000D395C /* Build configuration list for PBXNativeTarget "QuakeSpasm-SDL2" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 664D98F719CF6B78000D395C /* Debug */, - 664D98F819CF6B78000D395C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "QuakeSpasm" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "QuakeSpasm" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/MacOSX/QuakeSpasm.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MacOSX/QuakeSpasm.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index e978855a..00000000 --- a/MacOSX/QuakeSpasm.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Workspace - version = "1.0"> - <FileRef - location = "self:QuakeSpasm.xcodeproj"> - </FileRef> -</Workspace> diff --git a/MacOSX/QuakeSpasm.xcodeproj/xcshareddata/xcschemes/QuakeSpasm.xcscheme b/MacOSX/QuakeSpasm.xcodeproj/xcshareddata/xcschemes/QuakeSpasm.xcscheme deleted file mode 100644 index 90de0538..00000000 --- a/MacOSX/QuakeSpasm.xcodeproj/xcshareddata/xcschemes/QuakeSpasm.xcscheme +++ /dev/null @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Scheme - version = "1.8"> - <BuildAction - parallelizeBuildables = "YES" - buildImplicitDependencies = "YES"> - <BuildActionEntries> - <BuildActionEntry - buildForTesting = "YES" - buildForRunning = "YES" - buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8D1107260486CEB800E47090" - BuildableName = "QuakeSpasm.app" - BlueprintName = "QuakeSpasm"> - </BuildableReference> - </BuildActionEntry> - </BuildActionEntries> - </BuildAction> - <TestAction - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" - shouldUseLaunchSchemeArgsEnv = "YES" - buildConfiguration = "Debug"> - <Testables> - </Testables> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8D1107260486CEB800E47090" - BuildableName = "QuakeSpasm.app" - BlueprintName = "QuakeSpasm" - ReferencedContainer = "container:QuakeSpasm.xcodeproj"> - </BuildableReference> - </MacroExpansion> - </TestAction> - <LaunchAction - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" - displayScaleIsEnabled = "NO" - displayScale = "1.00" - launchStyle = "0" - useCustomWorkingDirectory = "NO" - buildConfiguration = "Debug" - ignoresPersistentStateOnLaunch = "NO" - debugDocumentVersioning = "YES" - allowLocationSimulation = "YES"> - <BuildableProductRunnable> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8D1107260486CEB800E47090" - BuildableName = "QuakeSpasm.app" - BlueprintName = "QuakeSpasm" - ReferencedContainer = "container:QuakeSpasm.xcodeproj"> - </BuildableReference> - </BuildableProductRunnable> - <CommandLineArguments> - <CommandLineArgument - argument = "-basedir /Applications/Quake" - isEnabled = "YES"> - </CommandLineArgument> - <CommandLineArgument - argument = "-nolauncher" - isEnabled = "NO"> - </CommandLineArgument> - </CommandLineArguments> - <AdditionalOptions> - </AdditionalOptions> - </LaunchAction> - <ProfileAction - displayScaleIsEnabled = "NO" - displayScale = "1.00" - shouldUseLaunchSchemeArgsEnv = "YES" - savedToolIdentifier = "" - useCustomWorkingDirectory = "NO" - buildConfiguration = "Release" - debugDocumentVersioning = "YES"> - <BuildableProductRunnable> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8D1107260486CEB800E47090" - BuildableName = "QuakeSpasm.app" - BlueprintName = "QuakeSpasm" - ReferencedContainer = "container:QuakeSpasm.xcodeproj"> - </BuildableReference> - </BuildableProductRunnable> - </ProfileAction> - <AnalyzeAction - buildConfiguration = "Debug"> - </AnalyzeAction> - <ArchiveAction - buildConfiguration = "Release" - revealArchiveInOrganizer = "YES"> - </ArchiveAction> -</Scheme> diff --git a/MacOSX/QuakeSpasmPPC.xcodeproj/project.pbxproj b/MacOSX/QuakeSpasmPPC.xcodeproj/project.pbxproj deleted file mode 100644 index 55671d87..00000000 --- a/MacOSX/QuakeSpasmPPC.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1031 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; }; - 32CA4F630368D1EE00C91783 /* snd_umx.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B012D5BA1A006DD66E /* snd_umx.c */; }; - 48134A1812102F400015BF15 /* net_bsd.c in Sources */ = {isa = PBXBuildFile; fileRef = 48134A1412102F400015BF15 /* net_bsd.c */; }; - 48134A1912102F400015BF15 /* net_udp.c in Sources */ = {isa = PBXBuildFile; fileRef = 48134A1612102F400015BF15 /* net_udp.c */; }; - 4818B0A312D5B9AE006DD66E /* bgmusic.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0A112D5B9AE006DD66E /* bgmusic.c */; }; - 4818B0AE12D5B9ED006DD66E /* snd_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0AC12D5B9ED006DD66E /* snd_codec.c */; }; - 4818B0B712D5BA1A006DD66E /* snd_vorbis.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */; }; - 4818B0B812D5BA1A006DD66E /* snd_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 4818B0B412D5BA1A006DD66E /* snd_wave.c */; }; - 48243B140D33F01A00C29F8F /* main_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 48243B130D33F01A00C29F8F /* main_sdl.c */; }; - 482812FD179C3EF4004E1D61 /* libFLAC.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 482812FC179C3EF4004E1D61 /* libFLAC.dylib */; }; - 482812FE179C3EFF004E1D61 /* libFLAC.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 482812FC179C3EF4004E1D61 /* libFLAC.dylib */; }; - 48281301179C3F13004E1D61 /* snd_flac.c in Sources */ = {isa = PBXBuildFile; fileRef = 482812FF179C3F13004E1D61 /* snd_flac.c */; }; - 483A78230D2EEA5400CB2E4C /* chase.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78100D2EEA5400CB2E4C /* chase.c */; }; - 483A78240D2EEA5400CB2E4C /* cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78110D2EEA5400CB2E4C /* cmd.c */; }; - 483A78250D2EEA5400CB2E4C /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78120D2EEA5400CB2E4C /* common.c */; }; - 483A78260D2EEA5400CB2E4C /* console.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78130D2EEA5400CB2E4C /* console.c */; }; - 483A78270D2EEA5400CB2E4C /* crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78140D2EEA5400CB2E4C /* crc.c */; }; - 483A78280D2EEA5400CB2E4C /* cvar.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78150D2EEA5400CB2E4C /* cvar.c */; }; - 483A78290D2EEA5400CB2E4C /* host_cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78160D2EEA5400CB2E4C /* host_cmd.c */; }; - 483A782A0D2EEA5400CB2E4C /* host.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78170D2EEA5400CB2E4C /* host.c */; }; - 483A782B0D2EEA5400CB2E4C /* mathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78180D2EEA5400CB2E4C /* mathlib.c */; }; - 483A782C0D2EEA5400CB2E4C /* menu.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78190D2EEA5400CB2E4C /* menu.c */; }; - 483A782D0D2EEA5400CB2E4C /* pr_cmds.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */; }; - 483A782E0D2EEA5400CB2E4C /* pr_edict.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781B0D2EEA5400CB2E4C /* pr_edict.c */; }; - 483A782F0D2EEA5400CB2E4C /* pr_exec.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781C0D2EEA5400CB2E4C /* pr_exec.c */; }; - 483A78300D2EEA5400CB2E4C /* sbar.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781D0D2EEA5400CB2E4C /* sbar.c */; }; - 483A78320D2EEA5400CB2E4C /* view.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A781F0D2EEA5400CB2E4C /* view.c */; }; - 483A78330D2EEA5400CB2E4C /* wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78200D2EEA5400CB2E4C /* wad.c */; }; - 483A78340D2EEA5400CB2E4C /* world.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78210D2EEA5400CB2E4C /* world.c */; }; - 483A78350D2EEA5400CB2E4C /* zone.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78220D2EEA5400CB2E4C /* zone.c */; }; - 483A78380D2EEA6D00CB2E4C /* in_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78360D2EEA6D00CB2E4C /* in_sdl.c */; }; - 483A78390D2EEA6D00CB2E4C /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78370D2EEA6D00CB2E4C /* keys.c */; }; - 483A78450D2EEAAB00CB2E4C /* cl_demo.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */; }; - 483A78460D2EEAAB00CB2E4C /* cl_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783B0D2EEAAB00CB2E4C /* cl_input.c */; }; - 483A78470D2EEAAB00CB2E4C /* cl_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783C0D2EEAAB00CB2E4C /* cl_main.c */; }; - 483A78480D2EEAAB00CB2E4C /* cl_parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */; }; - 483A78490D2EEAAB00CB2E4C /* cl_tent.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */; }; - 483A784A0D2EEAAB00CB2E4C /* net_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A783F0D2EEAAB00CB2E4C /* net_main.c */; }; - 483A784C0D2EEAAB00CB2E4C /* sv_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78410D2EEAAB00CB2E4C /* sv_main.c */; }; - 483A784D0D2EEAAB00CB2E4C /* sv_move.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78420D2EEAAB00CB2E4C /* sv_move.c */; }; - 483A784E0D2EEAAB00CB2E4C /* sv_phys.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78430D2EEAAB00CB2E4C /* sv_phys.c */; }; - 483A784F0D2EEAAB00CB2E4C /* sv_user.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78440D2EEAAB00CB2E4C /* sv_user.c */; }; - 483A78550D2EEAC300CB2E4C /* cd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78500D2EEAC300CB2E4C /* cd_sdl.c */; }; - 483A78590D2EEAC300CB2E4C /* snd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78540D2EEAC300CB2E4C /* snd_sdl.c */; }; - 483A786E0D2EEAF000CB2E4C /* gl_draw.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785A0D2EEAF000CB2E4C /* gl_draw.c */; }; - 483A786F0D2EEAF000CB2E4C /* gl_fog.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785B0D2EEAF000CB2E4C /* gl_fog.c */; }; - 483A78700D2EEAF000CB2E4C /* gl_mesh.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */; }; - 483A78710D2EEAF000CB2E4C /* gl_model.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785D0D2EEAF000CB2E4C /* gl_model.c */; }; - 483A78720D2EEAF000CB2E4C /* gl_refrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */; }; - 483A78730D2EEAF000CB2E4C /* gl_rlight.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */; }; - 483A78740D2EEAF000CB2E4C /* gl_rmain.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78600D2EEAF000CB2E4C /* gl_rmain.c */; }; - 483A78750D2EEAF000CB2E4C /* gl_rmisc.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */; }; - 483A78760D2EEAF000CB2E4C /* gl_screen.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78620D2EEAF000CB2E4C /* gl_screen.c */; }; - 483A78770D2EEAF000CB2E4C /* gl_sky.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78630D2EEAF000CB2E4C /* gl_sky.c */; }; - 483A78780D2EEAF000CB2E4C /* snd_mikmod.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */; }; - 483A78790D2EEAF000CB2E4C /* gl_texmgr.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */; }; - 483A787A0D2EEAF000CB2E4C /* gl_vidsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */; }; - 483A787B0D2EEAF000CB2E4C /* gl_warp.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78670D2EEAF000CB2E4C /* gl_warp.c */; }; - 483A787C0D2EEAF000CB2E4C /* image.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78680D2EEAF000CB2E4C /* image.c */; }; - 483A787D0D2EEAF000CB2E4C /* r_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A78690D2EEAF000CB2E4C /* r_alias.c */; }; - 483A787E0D2EEAF000CB2E4C /* r_brush.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786A0D2EEAF000CB2E4C /* r_brush.c */; }; - 483A787F0D2EEAF000CB2E4C /* r_part.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786B0D2EEAF000CB2E4C /* r_part.c */; }; - 483A78800D2EEAF000CB2E4C /* r_sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786C0D2EEAF000CB2E4C /* r_sprite.c */; }; - 483A78810D2EEAF000CB2E4C /* r_world.c in Sources */ = {isa = PBXBuildFile; fileRef = 483A786D0D2EEAF000CB2E4C /* r_world.c */; }; - 4847CD5F12057F94000B560F /* sys_sdl_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 4847CD5E12057F94000B560F /* sys_sdl_unix.c */; }; - 484AA4B40D3FF6C0005D917A /* QuakeSpasm.icns in Resources */ = {isa = PBXBuildFile; fileRef = 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */; }; - 4854B1B11340C646004C9F45 /* snd_mp3.c in Sources */ = {isa = PBXBuildFile; fileRef = 4854B1B01340C646004C9F45 /* snd_mp3.c */; }; - 486577CB0D31A22A00E7920A /* snd_dma.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577C80D31A22A00E7920A /* snd_dma.c */; }; - 486577CC0D31A22A00E7920A /* snd_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577C90D31A22A00E7920A /* snd_mem.c */; }; - 486577CD0D31A22A00E7920A /* snd_mix.c in Sources */ = {isa = PBXBuildFile; fileRef = 486577CA0D31A22A00E7920A /* snd_mix.c */; }; - 48728D2D0D3004A80004D61B /* net_dgrm.c in Sources */ = {isa = PBXBuildFile; fileRef = 48728D280D3004A70004D61B /* net_dgrm.c */; }; - 48728D2E0D3004A80004D61B /* net_loop.c in Sources */ = {isa = PBXBuildFile; fileRef = 48728D2A0D3004A80004D61B /* net_loop.c */; }; - 4885A84C179740A0000EC703 /* snd_opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 4885A84A179740A0000EC703 /* snd_opus.c */; }; - 4885A84F179740CA000EC703 /* libopus.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4885A84D179740CA000EC703 /* libopus.dylib */; }; - 4885A850179740CA000EC703 /* libopusfile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4885A84E179740CA000EC703 /* libopusfile.dylib */; }; - 4885A851179740D7000EC703 /* libopus.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 4885A84D179740CA000EC703 /* libopus.dylib */; }; - 4885A852179740D7000EC703 /* libopusfile.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 4885A84E179740CA000EC703 /* libopusfile.dylib */; }; - 48895DB90D4914A000849ABF /* pl_osx.m in Sources */ = {isa = PBXBuildFile; fileRef = 48895DB80D4914A000849ABF /* pl_osx.m */; }; - 489D8D2F0D3A630D00AA4471 /* ScreenInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */; }; - 48A7C1FC14AA34940011B754 /* strlcat.c in Sources */ = {isa = PBXBuildFile; fileRef = 48A7C1FA14AA34940011B754 /* strlcat.c */; }; - 48A7C1FD14AA34940011B754 /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = 48A7C1FB14AA34940011B754 /* strlcpy.c */; }; - 48B9E7880D340B1E0001CACF /* Launcher.nib in Resources */ = {isa = PBXBuildFile; fileRef = 48B9E7860D340B1E0001CACF /* Launcher.nib */; }; - 48B9E7A70D340BEA0001CACF /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 48B9E7A60D340BEA0001CACF /* AppController.m */; }; - 48B9E7C00D340EA80001CACF /* SDLApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 48B9E7BF0D340EA80001CACF /* SDLApplication.m */; }; - 48C85E3B0D3AD10E00797678 /* QuakeArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */; }; - 48E2EC7815FB500400B8D476 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 488EF23614B83A370021DD41 /* IOKit.framework */; }; - 48E2EC7D15FB507A00B8D476 /* libmad.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7915FB507A00B8D476 /* libmad.dylib */; }; - 48E2EC7E15FB507A00B8D476 /* libogg.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7A15FB507A00B8D476 /* libogg.dylib */; }; - 48E2EC7F15FB507A00B8D476 /* libvorbis.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */; }; - 48E2EC8015FB507A00B8D476 /* libvorbisfile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */; }; - 48E2EC8615FB516600B8D476 /* libmad.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7915FB507A00B8D476 /* libmad.dylib */; }; - 48E2EC8715FB516600B8D476 /* libogg.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7A15FB507A00B8D476 /* libogg.dylib */; }; - 48E2EC8815FB516600B8D476 /* libvorbis.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */; }; - 48E2EC8915FB516600B8D476 /* libvorbisfile.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */; }; - 48FE585B0D3A82C8006BB491 /* QuakeArguments.m in Sources */ = {isa = PBXBuildFile; fileRef = 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */; }; - 63D6EB5F23A2563B0047028C /* snd_mp3tag.c in Sources */ = {isa = PBXBuildFile; fileRef = 63D6EB5E23A2563B0047028C /* snd_mp3tag.c */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - A4E3AF2A05D43FCC000F1B47 /* libmikmod.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = F5F5DE80017CB4370103A810 /* libmikmod.dylib */; }; - A4E3AF6205D43FCC000F1B47 /* libmikmod.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F5F5DE80017CB4370103A810 /* libmikmod.dylib */; }; - B021C20914A5FF7E003F18D6 /* cfgfile.c in Sources */ = {isa = PBXBuildFile; fileRef = B021C20714A5FF7E003F18D6 /* cfgfile.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - 48692C131340A46800A0F098 /* Copy Libraries */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - 482812FE179C3EFF004E1D61 /* libFLAC.dylib in Copy Libraries */, - 4885A851179740D7000EC703 /* libopus.dylib in Copy Libraries */, - 4885A852179740D7000EC703 /* libopusfile.dylib in Copy Libraries */, - 48E2EC8615FB516600B8D476 /* libmad.dylib in Copy Libraries */, - 48E2EC8715FB516600B8D476 /* libogg.dylib in Copy Libraries */, - 48E2EC8815FB516600B8D476 /* libvorbis.dylib in Copy Libraries */, - 48E2EC8915FB516600B8D476 /* libvorbisfile.dylib in Copy Libraries */, - A4E3AF2A05D43FCC000F1B47 /* libmikmod.dylib in Copy Libraries */, - ); - name = "Copy Libraries"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SDL.framework; sourceTree = SOURCE_ROOT; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = "<group>"; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = "<group>"; }; - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; - 48134A1412102F400015BF15 /* net_bsd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_bsd.c; path = ../Quake/net_bsd.c; sourceTree = SOURCE_ROOT; }; - 48134A1512102F400015BF15 /* net_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_defs.h; path = ../Quake/net_defs.h; sourceTree = SOURCE_ROOT; }; - 48134A1612102F400015BF15 /* net_udp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_udp.c; path = ../Quake/net_udp.c; sourceTree = SOURCE_ROOT; }; - 48134A1712102F400015BF15 /* net_udp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_udp.h; path = ../Quake/net_udp.h; sourceTree = SOURCE_ROOT; }; - 4818B0A112D5B9AE006DD66E /* bgmusic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bgmusic.c; path = ../Quake/bgmusic.c; sourceTree = SOURCE_ROOT; }; - 4818B0A212D5B9AE006DD66E /* bgmusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bgmusic.h; path = ../Quake/bgmusic.h; sourceTree = SOURCE_ROOT; }; - 4818B0AC12D5B9ED006DD66E /* snd_codec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_codec.c; path = ../Quake/snd_codec.c; sourceTree = SOURCE_ROOT; }; - 4818B0AD12D5B9ED006DD66E /* snd_codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_codec.h; path = ../Quake/snd_codec.h; sourceTree = SOURCE_ROOT; }; - 4818B0AF12D5BA1A006DD66E /* snd_codeci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_codeci.h; path = ../Quake/snd_codeci.h; sourceTree = SOURCE_ROOT; }; - 4818B0B012D5BA1A006DD66E /* snd_umx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_umx.c; path = ../Quake/snd_umx.c; sourceTree = SOURCE_ROOT; }; - 4818B0B112D5BA1A006DD66E /* snd_mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_mp3.h; path = ../Quake/snd_mp3.h; sourceTree = SOURCE_ROOT; }; - 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_vorbis.c; path = ../Quake/snd_vorbis.c; sourceTree = SOURCE_ROOT; }; - 4818B0B312D5BA1A006DD66E /* snd_vorbis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_vorbis.h; path = ../Quake/snd_vorbis.h; sourceTree = SOURCE_ROOT; }; - 4818B0B412D5BA1A006DD66E /* snd_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_wave.c; path = ../Quake/snd_wave.c; sourceTree = SOURCE_ROOT; }; - 4818B0B512D5BA1A006DD66E /* snd_wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_wave.h; path = ../Quake/snd_wave.h; sourceTree = SOURCE_ROOT; }; - 48243B130D33F01A00C29F8F /* main_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main_sdl.c; path = ../Quake/main_sdl.c; sourceTree = SOURCE_ROOT; }; - 482812FC179C3EF4004E1D61 /* libFLAC.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libFLAC.dylib; path = codecs/lib/libFLAC.dylib; sourceTree = "<group>"; }; - 482812FF179C3F13004E1D61 /* snd_flac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_flac.c; path = ../Quake/snd_flac.c; sourceTree = "<group>"; }; - 48281300179C3F13004E1D61 /* snd_flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_flac.h; path = ../Quake/snd_flac.h; sourceTree = "<group>"; }; - 483A77E60D2EE97700CB2E4C /* cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cmd.h; path = ../Quake/cmd.h; sourceTree = SOURCE_ROOT; }; - 483A77E70D2EE97700CB2E4C /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = ../Quake/common.h; sourceTree = SOURCE_ROOT; }; - 483A77E80D2EE97700CB2E4C /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = console.h; path = ../Quake/console.h; sourceTree = SOURCE_ROOT; }; - 483A77E90D2EE97700CB2E4C /* crc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crc.h; path = ../Quake/crc.h; sourceTree = SOURCE_ROOT; }; - 483A77EA0D2EE97700CB2E4C /* cvar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cvar.h; path = ../Quake/cvar.h; sourceTree = SOURCE_ROOT; }; - 483A77EB0D2EE97700CB2E4C /* mathlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mathlib.h; path = ../Quake/mathlib.h; sourceTree = SOURCE_ROOT; }; - 483A77EC0D2EE97700CB2E4C /* menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = menu.h; path = ../Quake/menu.h; sourceTree = SOURCE_ROOT; }; - 483A77ED0D2EE97700CB2E4C /* pr_comp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pr_comp.h; path = ../Quake/pr_comp.h; sourceTree = SOURCE_ROOT; }; - 483A77EE0D2EE97700CB2E4C /* progdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = progdefs.h; path = ../Quake/progdefs.h; sourceTree = SOURCE_ROOT; }; - 483A77EF0D2EE97700CB2E4C /* progs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = progs.h; path = ../Quake/progs.h; sourceTree = SOURCE_ROOT; }; - 483A77F00D2EE97700CB2E4C /* quakedef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = quakedef.h; path = ../Quake/quakedef.h; sourceTree = SOURCE_ROOT; }; - 483A77F10D2EE97700CB2E4C /* sbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sbar.h; path = ../Quake/sbar.h; sourceTree = SOURCE_ROOT; }; - 483A77F20D2EE97700CB2E4C /* sys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sys.h; path = ../Quake/sys.h; sourceTree = SOURCE_ROOT; }; - 483A77F30D2EE97700CB2E4C /* view.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = view.h; path = ../Quake/view.h; sourceTree = SOURCE_ROOT; }; - 483A77F40D2EE97700CB2E4C /* wad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wad.h; path = ../Quake/wad.h; sourceTree = SOURCE_ROOT; }; - 483A77F50D2EE97700CB2E4C /* world.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = world.h; path = ../Quake/world.h; sourceTree = SOURCE_ROOT; }; - 483A77F60D2EE97700CB2E4C /* zone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zone.h; path = ../Quake/zone.h; sourceTree = SOURCE_ROOT; }; - 483A77F70D2EE98D00CB2E4C /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = input.h; path = ../Quake/input.h; sourceTree = SOURCE_ROOT; }; - 483A77F80D2EE98D00CB2E4C /* keys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = keys.h; path = ../Quake/keys.h; sourceTree = SOURCE_ROOT; }; - 483A77F90D2EE9A900CB2E4C /* client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = client.h; path = ../Quake/client.h; sourceTree = SOURCE_ROOT; }; - 483A77FA0D2EE9A900CB2E4C /* net.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net.h; path = ../Quake/net.h; sourceTree = SOURCE_ROOT; }; - 483A77FB0D2EE9A900CB2E4C /* protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = protocol.h; path = ../Quake/protocol.h; sourceTree = SOURCE_ROOT; }; - 483A77FC0D2EE9A900CB2E4C /* server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = server.h; path = ../Quake/server.h; sourceTree = SOURCE_ROOT; }; - 483A77FD0D2EE9BD00CB2E4C /* cdaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cdaudio.h; path = ../Quake/cdaudio.h; sourceTree = SOURCE_ROOT; }; - 483A77FE0D2EE9BD00CB2E4C /* q_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = q_sound.h; path = ../Quake/q_sound.h; sourceTree = SOURCE_ROOT; }; - 483A77FF0D2EE9F300CB2E4C /* anorm_dots.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = anorm_dots.h; path = ../Quake/anorm_dots.h; sourceTree = SOURCE_ROOT; }; - 483A78000D2EE9F300CB2E4C /* anorms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = anorms.h; path = ../Quake/anorms.h; sourceTree = SOURCE_ROOT; }; - 483A78010D2EE9F300CB2E4C /* bspfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bspfile.h; path = ../Quake/bspfile.h; sourceTree = SOURCE_ROOT; }; - 483A78020D2EE9F300CB2E4C /* d_ifacea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = d_ifacea.h; path = ../Quake/d_ifacea.h; sourceTree = SOURCE_ROOT; }; - 483A78030D2EE9F300CB2E4C /* draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = draw.h; path = ../Quake/draw.h; sourceTree = SOURCE_ROOT; }; - 483A78040D2EE9F300CB2E4C /* gl_model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl_model.h; path = ../Quake/gl_model.h; sourceTree = SOURCE_ROOT; }; - 483A78050D2EE9F300CB2E4C /* gl_texmgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl_texmgr.h; path = ../Quake/gl_texmgr.h; sourceTree = SOURCE_ROOT; }; - 483A78060D2EE9F300CB2E4C /* gl_warp_sin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl_warp_sin.h; path = ../Quake/gl_warp_sin.h; sourceTree = SOURCE_ROOT; }; - 483A78070D2EE9F300CB2E4C /* glquake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glquake.h; path = ../Quake/glquake.h; sourceTree = SOURCE_ROOT; }; - 483A78080D2EE9F300CB2E4C /* image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = image.h; path = ../Quake/image.h; sourceTree = SOURCE_ROOT; }; - 483A78090D2EE9F300CB2E4C /* modelgen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = modelgen.h; path = ../Quake/modelgen.h; sourceTree = SOURCE_ROOT; }; - 483A780A0D2EE9F300CB2E4C /* render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = render.h; path = ../Quake/render.h; sourceTree = SOURCE_ROOT; }; - 483A780B0D2EE9F300CB2E4C /* screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = screen.h; path = ../Quake/screen.h; sourceTree = SOURCE_ROOT; }; - 483A780C0D2EE9F300CB2E4C /* spritegn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spritegn.h; path = ../Quake/spritegn.h; sourceTree = SOURCE_ROOT; }; - 483A780D0D2EE9F300CB2E4C /* vid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vid.h; path = ../Quake/vid.h; sourceTree = SOURCE_ROOT; }; - 483A780E0D2EEA0F00CB2E4C /* progdefs.q1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = progdefs.q1; path = ../Quake/progdefs.q1; sourceTree = SOURCE_ROOT; }; - 483A78100D2EEA5400CB2E4C /* chase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = chase.c; path = ../Quake/chase.c; sourceTree = SOURCE_ROOT; }; - 483A78110D2EEA5400CB2E4C /* cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cmd.c; path = ../Quake/cmd.c; sourceTree = SOURCE_ROOT; }; - 483A78120D2EEA5400CB2E4C /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = common.c; path = ../Quake/common.c; sourceTree = SOURCE_ROOT; }; - 483A78130D2EEA5400CB2E4C /* console.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = console.c; path = ../Quake/console.c; sourceTree = SOURCE_ROOT; }; - 483A78140D2EEA5400CB2E4C /* crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crc.c; path = ../Quake/crc.c; sourceTree = SOURCE_ROOT; }; - 483A78150D2EEA5400CB2E4C /* cvar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cvar.c; path = ../Quake/cvar.c; sourceTree = SOURCE_ROOT; }; - 483A78160D2EEA5400CB2E4C /* host_cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = host_cmd.c; path = ../Quake/host_cmd.c; sourceTree = SOURCE_ROOT; }; - 483A78170D2EEA5400CB2E4C /* host.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = host.c; path = ../Quake/host.c; sourceTree = SOURCE_ROOT; }; - 483A78180D2EEA5400CB2E4C /* mathlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mathlib.c; path = ../Quake/mathlib.c; sourceTree = SOURCE_ROOT; }; - 483A78190D2EEA5400CB2E4C /* menu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menu.c; path = ../Quake/menu.c; sourceTree = SOURCE_ROOT; }; - 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pr_cmds.c; path = ../Quake/pr_cmds.c; sourceTree = SOURCE_ROOT; }; - 483A781B0D2EEA5400CB2E4C /* pr_edict.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pr_edict.c; path = ../Quake/pr_edict.c; sourceTree = SOURCE_ROOT; }; - 483A781C0D2EEA5400CB2E4C /* pr_exec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pr_exec.c; path = ../Quake/pr_exec.c; sourceTree = SOURCE_ROOT; }; - 483A781D0D2EEA5400CB2E4C /* sbar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sbar.c; path = ../Quake/sbar.c; sourceTree = SOURCE_ROOT; }; - 483A781F0D2EEA5400CB2E4C /* view.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = view.c; path = ../Quake/view.c; sourceTree = SOURCE_ROOT; }; - 483A78200D2EEA5400CB2E4C /* wad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wad.c; path = ../Quake/wad.c; sourceTree = SOURCE_ROOT; }; - 483A78210D2EEA5400CB2E4C /* world.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = world.c; path = ../Quake/world.c; sourceTree = SOURCE_ROOT; }; - 483A78220D2EEA5400CB2E4C /* zone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zone.c; path = ../Quake/zone.c; sourceTree = SOURCE_ROOT; }; - 483A78360D2EEA6D00CB2E4C /* in_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = in_sdl.c; path = ../Quake/in_sdl.c; sourceTree = SOURCE_ROOT; }; - 483A78370D2EEA6D00CB2E4C /* keys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = keys.c; path = ../Quake/keys.c; sourceTree = SOURCE_ROOT; }; - 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_demo.c; path = ../Quake/cl_demo.c; sourceTree = SOURCE_ROOT; }; - 483A783B0D2EEAAB00CB2E4C /* cl_input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_input.c; path = ../Quake/cl_input.c; sourceTree = SOURCE_ROOT; }; - 483A783C0D2EEAAB00CB2E4C /* cl_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_main.c; path = ../Quake/cl_main.c; sourceTree = SOURCE_ROOT; }; - 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_parse.c; path = ../Quake/cl_parse.c; sourceTree = SOURCE_ROOT; }; - 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cl_tent.c; path = ../Quake/cl_tent.c; sourceTree = SOURCE_ROOT; }; - 483A783F0D2EEAAB00CB2E4C /* net_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_main.c; path = ../Quake/net_main.c; sourceTree = SOURCE_ROOT; }; - 483A78410D2EEAAB00CB2E4C /* sv_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_main.c; path = ../Quake/sv_main.c; sourceTree = SOURCE_ROOT; }; - 483A78420D2EEAAB00CB2E4C /* sv_move.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_move.c; path = ../Quake/sv_move.c; sourceTree = SOURCE_ROOT; }; - 483A78430D2EEAAB00CB2E4C /* sv_phys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_phys.c; path = ../Quake/sv_phys.c; sourceTree = SOURCE_ROOT; }; - 483A78440D2EEAAB00CB2E4C /* sv_user.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sv_user.c; path = ../Quake/sv_user.c; sourceTree = SOURCE_ROOT; }; - 483A78500D2EEAC300CB2E4C /* cd_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cd_sdl.c; path = ../Quake/cd_sdl.c; sourceTree = SOURCE_ROOT; }; - 483A78540D2EEAC300CB2E4C /* snd_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_sdl.c; path = ../Quake/snd_sdl.c; sourceTree = SOURCE_ROOT; }; - 483A785A0D2EEAF000CB2E4C /* gl_draw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_draw.c; path = ../Quake/gl_draw.c; sourceTree = SOURCE_ROOT; }; - 483A785B0D2EEAF000CB2E4C /* gl_fog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_fog.c; path = ../Quake/gl_fog.c; sourceTree = SOURCE_ROOT; }; - 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_mesh.c; path = ../Quake/gl_mesh.c; sourceTree = SOURCE_ROOT; }; - 483A785D0D2EEAF000CB2E4C /* gl_model.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_model.c; path = ../Quake/gl_model.c; sourceTree = SOURCE_ROOT; }; - 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_refrag.c; path = ../Quake/gl_refrag.c; sourceTree = SOURCE_ROOT; }; - 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_rlight.c; path = ../Quake/gl_rlight.c; sourceTree = SOURCE_ROOT; }; - 483A78600D2EEAF000CB2E4C /* gl_rmain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_rmain.c; path = ../Quake/gl_rmain.c; sourceTree = SOURCE_ROOT; }; - 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_rmisc.c; path = ../Quake/gl_rmisc.c; sourceTree = SOURCE_ROOT; }; - 483A78620D2EEAF000CB2E4C /* gl_screen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_screen.c; path = ../Quake/gl_screen.c; sourceTree = SOURCE_ROOT; }; - 483A78630D2EEAF000CB2E4C /* gl_sky.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_sky.c; path = ../Quake/gl_sky.c; sourceTree = SOURCE_ROOT; }; - 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mikmod.c; path = ../Quake/snd_mikmod.c; sourceTree = SOURCE_ROOT; }; - 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_texmgr.c; path = ../Quake/gl_texmgr.c; sourceTree = SOURCE_ROOT; }; - 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_vidsdl.c; path = ../Quake/gl_vidsdl.c; sourceTree = SOURCE_ROOT; }; - 483A78670D2EEAF000CB2E4C /* gl_warp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gl_warp.c; path = ../Quake/gl_warp.c; sourceTree = SOURCE_ROOT; }; - 483A78680D2EEAF000CB2E4C /* image.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = image.c; path = ../Quake/image.c; sourceTree = SOURCE_ROOT; }; - 483A78690D2EEAF000CB2E4C /* r_alias.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_alias.c; path = ../Quake/r_alias.c; sourceTree = SOURCE_ROOT; }; - 483A786A0D2EEAF000CB2E4C /* r_brush.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_brush.c; path = ../Quake/r_brush.c; sourceTree = SOURCE_ROOT; }; - 483A786B0D2EEAF000CB2E4C /* r_part.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_part.c; path = ../Quake/r_part.c; sourceTree = SOURCE_ROOT; }; - 483A786C0D2EEAF000CB2E4C /* r_sprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_sprite.c; path = ../Quake/r_sprite.c; sourceTree = SOURCE_ROOT; }; - 483A786D0D2EEAF000CB2E4C /* r_world.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r_world.c; path = ../Quake/r_world.c; sourceTree = SOURCE_ROOT; }; - 4846EB500D329BEB00A108DE /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = platform.h; path = ../Quake/platform.h; sourceTree = SOURCE_ROOT; }; - 4847CD5E12057F94000B560F /* sys_sdl_unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sys_sdl_unix.c; path = ../Quake/sys_sdl_unix.c; sourceTree = SOURCE_ROOT; }; - 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = QuakeSpasm.icns; sourceTree = "<group>"; }; - 4854B1B01340C646004C9F45 /* snd_mp3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mp3.c; path = ../Quake/snd_mp3.c; sourceTree = SOURCE_ROOT; }; - 486577C80D31A22A00E7920A /* snd_dma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_dma.c; path = ../Quake/snd_dma.c; sourceTree = SOURCE_ROOT; }; - 486577C90D31A22A00E7920A /* snd_mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mem.c; path = ../Quake/snd_mem.c; sourceTree = SOURCE_ROOT; }; - 486577CA0D31A22A00E7920A /* snd_mix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mix.c; path = ../Quake/snd_mix.c; sourceTree = SOURCE_ROOT; }; - 48728D280D3004A70004D61B /* net_dgrm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_dgrm.c; path = ../Quake/net_dgrm.c; sourceTree = SOURCE_ROOT; }; - 48728D290D3004A80004D61B /* net_dgrm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_dgrm.h; path = ../Quake/net_dgrm.h; sourceTree = SOURCE_ROOT; }; - 48728D2A0D3004A80004D61B /* net_loop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net_loop.c; path = ../Quake/net_loop.c; sourceTree = SOURCE_ROOT; }; - 48728D2B0D3004A80004D61B /* net_loop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net_loop.h; path = ../Quake/net_loop.h; sourceTree = SOURCE_ROOT; }; - 4885A84A179740A0000EC703 /* snd_opus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_opus.c; path = ../Quake/snd_opus.c; sourceTree = "<group>"; }; - 4885A84B179740A0000EC703 /* snd_opus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = snd_opus.h; path = ../Quake/snd_opus.h; sourceTree = "<group>"; }; - 4885A84D179740CA000EC703 /* libopus.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopus.dylib; path = codecs/lib/libopus.dylib; sourceTree = "<group>"; }; - 4885A84E179740CA000EC703 /* libopusfile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopusfile.dylib; path = codecs/lib/libopusfile.dylib; sourceTree = "<group>"; }; - 48895DB80D4914A000849ABF /* pl_osx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = pl_osx.m; path = ../Quake/pl_osx.m; sourceTree = SOURCE_ROOT; }; - 488EF23614B83A370021DD41 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; - 489D8D2D0D3A630D00AA4471 /* ScreenInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScreenInfo.h; sourceTree = "<group>"; }; - 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreenInfo.m; sourceTree = "<group>"; }; - 48A7C1F914AA34940011B754 /* strl_fn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strl_fn.h; path = ../Quake/strl_fn.h; sourceTree = "<group>"; }; - 48A7C1FA14AA34940011B754 /* strlcat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcat.c; path = ../Quake/strlcat.c; sourceTree = "<group>"; }; - 48A7C1FB14AA34940011B754 /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = ../Quake/strlcpy.c; sourceTree = "<group>"; }; - 48B9E7870D340B1E0001CACF /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Launcher.nib; sourceTree = "<group>"; }; - 48B9E7A50D340BEA0001CACF /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; }; - 48B9E7A60D340BEA0001CACF /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = "<group>"; }; - 48B9E7BE0D340EA80001CACF /* SDLApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLApplication.h; sourceTree = "<group>"; }; - 48B9E7BF0D340EA80001CACF /* SDLApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLApplication.m; sourceTree = "<group>"; }; - 48C85E390D3AD10E00797678 /* QuakeArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuakeArgument.h; sourceTree = "<group>"; }; - 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuakeArgument.m; sourceTree = "<group>"; }; - 48E2EC7915FB507A00B8D476 /* libmad.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmad.dylib; path = codecs/lib/libmad.dylib; sourceTree = "<group>"; }; - 48E2EC7A15FB507A00B8D476 /* libogg.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libogg.dylib; path = codecs/lib/libogg.dylib; sourceTree = "<group>"; }; - 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbis.dylib; path = codecs/lib/libvorbis.dylib; sourceTree = "<group>"; }; - 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbisfile.dylib; path = codecs/lib/libvorbisfile.dylib; sourceTree = "<group>"; }; - 48FE58590D3A82C8006BB491 /* QuakeArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuakeArguments.h; sourceTree = "<group>"; }; - 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuakeArguments.m; sourceTree = "<group>"; }; - 664D98FB19CF6B78000D395C /* Info copy.plist */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Info copy.plist"; sourceTree = "<group>"; }; - 63D6EB5E23A2563B0047028C /* snd_mp3tag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_mp3tag.c; path = ../Quake/snd_mp3tag.c; sourceTree = SOURCE_ROOT; }; - 664D990519CF6E16000D395C /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SDL2.framework; sourceTree = SOURCE_ROOT; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; - 8D1107320486CEB800E47090 /* QuakeSpasm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuakeSpasm.app; sourceTree = BUILT_PRODUCTS_DIR; }; - B021C20714A5FF7E003F18D6 /* cfgfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cfgfile.c; path = ../Quake/cfgfile.c; sourceTree = SOURCE_ROOT; }; - B021C20814A5FF7E003F18D6 /* cfgfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cfgfile.h; path = ../Quake/cfgfile.h; sourceTree = SOURCE_ROOT; }; - F5F5DE80017CB4370103A810 /* libmikmod.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmikmod.dylib; path = codecs/lib/libmikmod.dylib; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 482812FD179C3EF4004E1D61 /* libFLAC.dylib in Frameworks */, - 4885A84F179740CA000EC703 /* libopus.dylib in Frameworks */, - 4885A850179740CA000EC703 /* libopusfile.dylib in Frameworks */, - 48E2EC7D15FB507A00B8D476 /* libmad.dylib in Frameworks */, - 48E2EC7E15FB507A00B8D476 /* libogg.dylib in Frameworks */, - 48E2EC7F15FB507A00B8D476 /* libvorbis.dylib in Frameworks */, - 48E2EC8015FB507A00B8D476 /* libvorbisfile.dylib in Frameworks */, - A4E3AF6205D43FCC000F1B47 /* libmikmod.dylib in Frameworks */, - 48E2EC7815FB500400B8D476 /* IOKit.framework in Frameworks */, - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 488EF23614B83A370021DD41 /* IOKit.framework */, - 664D990519CF6E16000D395C /* SDL2.framework */, - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */, - ); - name = "Linked Frameworks"; - sourceTree = "<group>"; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = "<group>"; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* QuakeSpasm.app */, - ); - name = Products; - sourceTree = "<group>"; - }; - 29B97314FDCFA39411CA2CEA /* QuakeSpasm */ = { - isa = PBXGroup; - children = ( - 482812FC179C3EF4004E1D61 /* libFLAC.dylib */, - 4885A84D179740CA000EC703 /* libopus.dylib */, - 4885A84E179740CA000EC703 /* libopusfile.dylib */, - 48E2EC7915FB507A00B8D476 /* libmad.dylib */, - 48E2EC7A15FB507A00B8D476 /* libogg.dylib */, - 48E2EC7B15FB507A00B8D476 /* libvorbis.dylib */, - 48E2EC7C15FB507A00B8D476 /* libvorbisfile.dylib */, - F5F5DE80017CB4370103A810 /* libmikmod.dylib */, - 48243B060D33ED0A00C29F8F /* MacOSX */, - 483A77D80D2EE8C500CB2E4C /* Quake */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = QuakeSpasm; - sourceTree = "<group>"; - tabWidth = 4; - usesTabs = 1; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 484AA4B30D3FF6C0005D917A /* QuakeSpasm.icns */, - 48B9E7860D340B1E0001CACF /* Launcher.nib */, - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 664D98FB19CF6B78000D395C /* Info copy.plist */, - ); - name = Resources; - sourceTree = "<group>"; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 48243B060D33ED0A00C29F8F /* MacOSX */ = { - isa = PBXGroup; - children = ( - 48B9E7A50D340BEA0001CACF /* AppController.h */, - 48B9E7A60D340BEA0001CACF /* AppController.m */, - 48FE58590D3A82C8006BB491 /* QuakeArguments.h */, - 48FE585A0D3A82C8006BB491 /* QuakeArguments.m */, - 489D8D2D0D3A630D00AA4471 /* ScreenInfo.h */, - 489D8D2E0D3A630D00AA4471 /* ScreenInfo.m */, - 48B9E7BE0D340EA80001CACF /* SDLApplication.h */, - 48B9E7BF0D340EA80001CACF /* SDLApplication.m */, - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - 48C85E390D3AD10E00797678 /* QuakeArgument.h */, - 48C85E3A0D3AD10E00797678 /* QuakeArgument.m */, - ); - name = MacOSX; - sourceTree = "<group>"; - }; - 483A77D80D2EE8C500CB2E4C /* Quake */ = { - isa = PBXGroup; - children = ( - 483A77D90D2EE8D400CB2E4C /* Generic */, - 483A77DA0D2EE8DA00CB2E4C /* Input */, - 483A77DD0D2EE8F100CB2E4C /* Network */, - 483A77DC0D2EE8ED00CB2E4C /* Sound */, - 483A77DB0D2EE8E600CB2E4C /* Video */, - ); - name = Quake; - sourceTree = "<group>"; - }; - 483A77D90D2EE8D400CB2E4C /* Generic */ = { - isa = PBXGroup; - children = ( - 483A77DE0D2EE8FB00CB2E4C /* Headers */, - B021C20714A5FF7E003F18D6 /* cfgfile.c */, - 483A78100D2EEA5400CB2E4C /* chase.c */, - 483A78110D2EEA5400CB2E4C /* cmd.c */, - 483A78120D2EEA5400CB2E4C /* common.c */, - 483A78130D2EEA5400CB2E4C /* console.c */, - 483A78140D2EEA5400CB2E4C /* crc.c */, - 483A78150D2EEA5400CB2E4C /* cvar.c */, - 483A78170D2EEA5400CB2E4C /* host.c */, - 483A78160D2EEA5400CB2E4C /* host_cmd.c */, - 48243B130D33F01A00C29F8F /* main_sdl.c */, - 483A78180D2EEA5400CB2E4C /* mathlib.c */, - 483A78190D2EEA5400CB2E4C /* menu.c */, - 48895DB80D4914A000849ABF /* pl_osx.m */, - 483A781A0D2EEA5400CB2E4C /* pr_cmds.c */, - 483A781B0D2EEA5400CB2E4C /* pr_edict.c */, - 483A781C0D2EEA5400CB2E4C /* pr_exec.c */, - 483A780E0D2EEA0F00CB2E4C /* progdefs.q1 */, - 483A781D0D2EEA5400CB2E4C /* sbar.c */, - 48A7C1FA14AA34940011B754 /* strlcat.c */, - 48A7C1FB14AA34940011B754 /* strlcpy.c */, - 4847CD5E12057F94000B560F /* sys_sdl_unix.c */, - 483A781F0D2EEA5400CB2E4C /* view.c */, - 483A78200D2EEA5400CB2E4C /* wad.c */, - 483A78210D2EEA5400CB2E4C /* world.c */, - 483A78220D2EEA5400CB2E4C /* zone.c */, - ); - name = Generic; - sourceTree = "<group>"; - }; - 483A77DA0D2EE8DA00CB2E4C /* Input */ = { - isa = PBXGroup; - children = ( - 483A77DF0D2EE90500CB2E4C /* Headers */, - 483A78360D2EEA6D00CB2E4C /* in_sdl.c */, - 483A78370D2EEA6D00CB2E4C /* keys.c */, - ); - name = Input; - sourceTree = "<group>"; - }; - 483A77DB0D2EE8E600CB2E4C /* Video */ = { - isa = PBXGroup; - children = ( - 483A77E20D2EE91500CB2E4C /* Headers */, - 483A785A0D2EEAF000CB2E4C /* gl_draw.c */, - 483A785B0D2EEAF000CB2E4C /* gl_fog.c */, - 483A785C0D2EEAF000CB2E4C /* gl_mesh.c */, - 483A785D0D2EEAF000CB2E4C /* gl_model.c */, - 483A785E0D2EEAF000CB2E4C /* gl_refrag.c */, - 483A785F0D2EEAF000CB2E4C /* gl_rlight.c */, - 483A78600D2EEAF000CB2E4C /* gl_rmain.c */, - 483A78610D2EEAF000CB2E4C /* gl_rmisc.c */, - 483A78620D2EEAF000CB2E4C /* gl_screen.c */, - 483A78630D2EEAF000CB2E4C /* gl_sky.c */, - 483A78650D2EEAF000CB2E4C /* gl_texmgr.c */, - 483A78660D2EEAF000CB2E4C /* gl_vidsdl.c */, - 483A78670D2EEAF000CB2E4C /* gl_warp.c */, - 483A78680D2EEAF000CB2E4C /* image.c */, - 483A78690D2EEAF000CB2E4C /* r_alias.c */, - 483A786A0D2EEAF000CB2E4C /* r_brush.c */, - 483A786B0D2EEAF000CB2E4C /* r_part.c */, - 483A786C0D2EEAF000CB2E4C /* r_sprite.c */, - 483A786D0D2EEAF000CB2E4C /* r_world.c */, - ); - name = Video; - sourceTree = "<group>"; - }; - 483A77DC0D2EE8ED00CB2E4C /* Sound */ = { - isa = PBXGroup; - children = ( - 483A77E10D2EE91000CB2E4C /* Headers */, - 4818B0A112D5B9AE006DD66E /* bgmusic.c */, - 483A78500D2EEAC300CB2E4C /* cd_sdl.c */, - 4818B0AC12D5B9ED006DD66E /* snd_codec.c */, - 486577C80D31A22A00E7920A /* snd_dma.c */, - 482812FF179C3F13004E1D61 /* snd_flac.c */, - 486577C90D31A22A00E7920A /* snd_mem.c */, - 486577CA0D31A22A00E7920A /* snd_mix.c */, - 483A78540D2EEAC300CB2E4C /* snd_sdl.c */, - 4854B1B01340C646004C9F45 /* snd_mp3.c */, - 63D6EB5E23A2563B0047028C /* snd_mp3tag.c */, - 4885A84A179740A0000EC703 /* snd_opus.c */, - 483A78640D2EEAF000CB2E4C /* snd_mikmod.c */, - 4818B0B012D5BA1A006DD66E /* snd_umx.c */, - 4818B0B212D5BA1A006DD66E /* snd_vorbis.c */, - 4818B0B412D5BA1A006DD66E /* snd_wave.c */, - ); - name = Sound; - sourceTree = "<group>"; - }; - 483A77DD0D2EE8F100CB2E4C /* Network */ = { - isa = PBXGroup; - children = ( - 483A77E00D2EE90B00CB2E4C /* Headers */, - 483A783A0D2EEAAB00CB2E4C /* cl_demo.c */, - 483A783B0D2EEAAB00CB2E4C /* cl_input.c */, - 483A783C0D2EEAAB00CB2E4C /* cl_main.c */, - 483A783D0D2EEAAB00CB2E4C /* cl_parse.c */, - 483A783E0D2EEAAB00CB2E4C /* cl_tent.c */, - 48134A1412102F400015BF15 /* net_bsd.c */, - 48728D280D3004A70004D61B /* net_dgrm.c */, - 48728D2A0D3004A80004D61B /* net_loop.c */, - 483A783F0D2EEAAB00CB2E4C /* net_main.c */, - 48134A1612102F400015BF15 /* net_udp.c */, - 483A78410D2EEAAB00CB2E4C /* sv_main.c */, - 483A78420D2EEAAB00CB2E4C /* sv_move.c */, - 483A78430D2EEAAB00CB2E4C /* sv_phys.c */, - 483A78440D2EEAAB00CB2E4C /* sv_user.c */, - ); - name = Network; - sourceTree = "<group>"; - }; - 483A77DE0D2EE8FB00CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - B021C20814A5FF7E003F18D6 /* cfgfile.h */, - 483A77E60D2EE97700CB2E4C /* cmd.h */, - 483A77E70D2EE97700CB2E4C /* common.h */, - 483A77E80D2EE97700CB2E4C /* console.h */, - 483A77E90D2EE97700CB2E4C /* crc.h */, - 483A77EA0D2EE97700CB2E4C /* cvar.h */, - 483A77EB0D2EE97700CB2E4C /* mathlib.h */, - 483A77EC0D2EE97700CB2E4C /* menu.h */, - 4846EB500D329BEB00A108DE /* platform.h */, - 483A77ED0D2EE97700CB2E4C /* pr_comp.h */, - 483A77EE0D2EE97700CB2E4C /* progdefs.h */, - 483A77EF0D2EE97700CB2E4C /* progs.h */, - 483A77F00D2EE97700CB2E4C /* quakedef.h */, - 483A77F10D2EE97700CB2E4C /* sbar.h */, - 48A7C1F914AA34940011B754 /* strl_fn.h */, - 483A77F20D2EE97700CB2E4C /* sys.h */, - 483A77F30D2EE97700CB2E4C /* view.h */, - 483A77F40D2EE97700CB2E4C /* wad.h */, - 483A77F50D2EE97700CB2E4C /* world.h */, - 483A77F60D2EE97700CB2E4C /* zone.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77DF0D2EE90500CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 483A77F70D2EE98D00CB2E4C /* input.h */, - 483A77F80D2EE98D00CB2E4C /* keys.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77E00D2EE90B00CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 483A77F90D2EE9A900CB2E4C /* client.h */, - 483A77FA0D2EE9A900CB2E4C /* net.h */, - 48134A1512102F400015BF15 /* net_defs.h */, - 48728D290D3004A80004D61B /* net_dgrm.h */, - 48728D2B0D3004A80004D61B /* net_loop.h */, - 48134A1712102F400015BF15 /* net_udp.h */, - 483A77FB0D2EE9A900CB2E4C /* protocol.h */, - 483A77FC0D2EE9A900CB2E4C /* server.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77E10D2EE91000CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 4818B0A212D5B9AE006DD66E /* bgmusic.h */, - 483A77FD0D2EE9BD00CB2E4C /* cdaudio.h */, - 483A77FE0D2EE9BD00CB2E4C /* q_sound.h */, - 4818B0AD12D5B9ED006DD66E /* snd_codec.h */, - 4818B0AF12D5BA1A006DD66E /* snd_codeci.h */, - 48281300179C3F13004E1D61 /* snd_flac.h */, - 4818B0B112D5BA1A006DD66E /* snd_mp3.h */, - 4885A84B179740A0000EC703 /* snd_opus.h */, - 4818B0B312D5BA1A006DD66E /* snd_vorbis.h */, - 4818B0B512D5BA1A006DD66E /* snd_wave.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; - 483A77E20D2EE91500CB2E4C /* Headers */ = { - isa = PBXGroup; - children = ( - 483A77FF0D2EE9F300CB2E4C /* anorm_dots.h */, - 483A78000D2EE9F300CB2E4C /* anorms.h */, - 483A78010D2EE9F300CB2E4C /* bspfile.h */, - 483A78020D2EE9F300CB2E4C /* d_ifacea.h */, - 483A78030D2EE9F300CB2E4C /* draw.h */, - 483A78040D2EE9F300CB2E4C /* gl_model.h */, - 483A78050D2EE9F300CB2E4C /* gl_texmgr.h */, - 483A78060D2EE9F300CB2E4C /* gl_warp_sin.h */, - 483A78070D2EE9F300CB2E4C /* glquake.h */, - 483A78080D2EE9F300CB2E4C /* image.h */, - 483A78090D2EE9F300CB2E4C /* modelgen.h */, - 483A780A0D2EE9F300CB2E4C /* render.h */, - 483A780B0D2EE9F300CB2E4C /* screen.h */, - 483A780C0D2EE9F300CB2E4C /* spritegn.h */, - 483A780D0D2EE9F300CB2E4C /* vid.h */, - ); - name = Headers; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* QuakeSpasm */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "QuakeSpasm" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks */, - 48692C131340A46800A0F098 /* Copy Libraries */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = QuakeSpasm; - productInstallPath = "$(HOME)/Applications"; - productName = QuakeSpasm; - productReference = 8D1107320486CEB800E47090 /* QuakeSpasm.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0420; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "QuakeSpasmPPC" */; - compatibilityVersion = "Xcode 3.2"; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* QuakeSpasm */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* QuakeSpasm */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 48B9E7880D340B1E0001CACF /* Launcher.nib in Resources */, - 484AA4B40D3FF6C0005D917A /* QuakeSpasm.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 483A78230D2EEA5400CB2E4C /* chase.c in Sources */, - 483A78240D2EEA5400CB2E4C /* cmd.c in Sources */, - 483A78250D2EEA5400CB2E4C /* common.c in Sources */, - 483A78260D2EEA5400CB2E4C /* console.c in Sources */, - 483A78270D2EEA5400CB2E4C /* crc.c in Sources */, - 483A78280D2EEA5400CB2E4C /* cvar.c in Sources */, - 483A78290D2EEA5400CB2E4C /* host_cmd.c in Sources */, - 483A782A0D2EEA5400CB2E4C /* host.c in Sources */, - 483A782B0D2EEA5400CB2E4C /* mathlib.c in Sources */, - 483A782C0D2EEA5400CB2E4C /* menu.c in Sources */, - 483A782D0D2EEA5400CB2E4C /* pr_cmds.c in Sources */, - 483A782E0D2EEA5400CB2E4C /* pr_edict.c in Sources */, - 483A782F0D2EEA5400CB2E4C /* pr_exec.c in Sources */, - 483A78300D2EEA5400CB2E4C /* sbar.c in Sources */, - 483A78320D2EEA5400CB2E4C /* view.c in Sources */, - 483A78330D2EEA5400CB2E4C /* wad.c in Sources */, - 483A78340D2EEA5400CB2E4C /* world.c in Sources */, - 483A78350D2EEA5400CB2E4C /* zone.c in Sources */, - 483A78380D2EEA6D00CB2E4C /* in_sdl.c in Sources */, - 483A78390D2EEA6D00CB2E4C /* keys.c in Sources */, - 483A78450D2EEAAB00CB2E4C /* cl_demo.c in Sources */, - 483A78460D2EEAAB00CB2E4C /* cl_input.c in Sources */, - 483A78470D2EEAAB00CB2E4C /* cl_main.c in Sources */, - 483A78480D2EEAAB00CB2E4C /* cl_parse.c in Sources */, - 483A78490D2EEAAB00CB2E4C /* cl_tent.c in Sources */, - 483A784A0D2EEAAB00CB2E4C /* net_main.c in Sources */, - 483A784C0D2EEAAB00CB2E4C /* sv_main.c in Sources */, - 483A784D0D2EEAAB00CB2E4C /* sv_move.c in Sources */, - 483A784E0D2EEAAB00CB2E4C /* sv_phys.c in Sources */, - 483A784F0D2EEAAB00CB2E4C /* sv_user.c in Sources */, - 483A78550D2EEAC300CB2E4C /* cd_sdl.c in Sources */, - 483A78590D2EEAC300CB2E4C /* snd_sdl.c in Sources */, - 483A786E0D2EEAF000CB2E4C /* gl_draw.c in Sources */, - 483A786F0D2EEAF000CB2E4C /* gl_fog.c in Sources */, - 483A78700D2EEAF000CB2E4C /* gl_mesh.c in Sources */, - 483A78710D2EEAF000CB2E4C /* gl_model.c in Sources */, - 483A78720D2EEAF000CB2E4C /* gl_refrag.c in Sources */, - 483A78730D2EEAF000CB2E4C /* gl_rlight.c in Sources */, - 483A78740D2EEAF000CB2E4C /* gl_rmain.c in Sources */, - 483A78750D2EEAF000CB2E4C /* gl_rmisc.c in Sources */, - 483A78760D2EEAF000CB2E4C /* gl_screen.c in Sources */, - 483A78770D2EEAF000CB2E4C /* gl_sky.c in Sources */, - 483A78790D2EEAF000CB2E4C /* gl_texmgr.c in Sources */, - 483A787A0D2EEAF000CB2E4C /* gl_vidsdl.c in Sources */, - 483A787B0D2EEAF000CB2E4C /* gl_warp.c in Sources */, - 483A787C0D2EEAF000CB2E4C /* image.c in Sources */, - 483A787D0D2EEAF000CB2E4C /* r_alias.c in Sources */, - 483A787E0D2EEAF000CB2E4C /* r_brush.c in Sources */, - 483A787F0D2EEAF000CB2E4C /* r_part.c in Sources */, - 483A78800D2EEAF000CB2E4C /* r_sprite.c in Sources */, - 483A78810D2EEAF000CB2E4C /* r_world.c in Sources */, - 48728D2D0D3004A80004D61B /* net_dgrm.c in Sources */, - 48728D2E0D3004A80004D61B /* net_loop.c in Sources */, - 486577CB0D31A22A00E7920A /* snd_dma.c in Sources */, - 486577CC0D31A22A00E7920A /* snd_mem.c in Sources */, - 486577CD0D31A22A00E7920A /* snd_mix.c in Sources */, - 48243B140D33F01A00C29F8F /* main_sdl.c in Sources */, - 48B9E7A70D340BEA0001CACF /* AppController.m in Sources */, - 48B9E7C00D340EA80001CACF /* SDLApplication.m in Sources */, - 489D8D2F0D3A630D00AA4471 /* ScreenInfo.m in Sources */, - 48FE585B0D3A82C8006BB491 /* QuakeArguments.m in Sources */, - 48C85E3B0D3AD10E00797678 /* QuakeArgument.m in Sources */, - 48895DB90D4914A000849ABF /* pl_osx.m in Sources */, - 4847CD5F12057F94000B560F /* sys_sdl_unix.c in Sources */, - 48134A1812102F400015BF15 /* net_bsd.c in Sources */, - 48134A1912102F400015BF15 /* net_udp.c in Sources */, - 4818B0A312D5B9AE006DD66E /* bgmusic.c in Sources */, - 4818B0AE12D5B9ED006DD66E /* snd_codec.c in Sources */, - 4818B0B712D5BA1A006DD66E /* snd_vorbis.c in Sources */, - 4818B0B812D5BA1A006DD66E /* snd_wave.c in Sources */, - 4854B1B11340C646004C9F45 /* snd_mp3.c in Sources */, - 483A78780D2EEAF000CB2E4C /* snd_mikmod.c in Sources */, - 32CA4F630368D1EE00C91783 /* snd_umx.c in Sources */, - B021C20914A5FF7E003F18D6 /* cfgfile.c in Sources */, - 48A7C1FC14AA34940011B754 /* strlcat.c in Sources */, - 48A7C1FD14AA34940011B754 /* strlcpy.c in Sources */, - 4885A84C179740A0000EC703 /* snd_opus.c in Sources */, - 48281301179C3F13004E1D61 /* snd_flac.c in Sources */, - 63D6EB5F23A2563B0047028C /* snd_mp3tag.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = "<group>"; - }; - 48B9E7860D340B1E0001CACF /* Launcher.nib */ = { - isa = PBXVariantGroup; - children = ( - 48B9E7870D340B1E0001CACF /* English */, - ); - name = Launcher.nib; - sourceTree = "<group>"; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 667B970C1C390232008775FA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ppc; - COPY_PHASE_STRIP = NO; - DEPLOYMENT_POSTPROCESSING = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)", - "$(SRCROOT)/codecs/lib", - ); - OTHER_CFLAGS = ""; - "OTHER_CFLAGS[arch=i386]" = "-arch i386"; - "OTHER_CFLAGS[arch=ppc]" = "-arch ppc"; - "OTHER_LDFLAGS[arch=i386]" = "-arch i386"; - "OTHER_LDFLAGS[arch=ppc]" = "-arch ppc"; - PRODUCT_NAME = QuakeSpasm; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 667B970D1C390232008775FA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - x86_64, - i386, - ppc, - ); - DEPLOYMENT_POSTPROCESSING = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_MODEL_TUNING = G3; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.6; - ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = ""; - "OTHER_CFLAGS[arch=ppc]" = "-arch ppc"; - OTHER_LDFLAGS = ""; - "OTHER_LDFLAGS[arch=i386]" = "-mmacosx-version-min=10.4 -arch i386"; - "OTHER_LDFLAGS[arch=ppc]" = "-mmacosx-version-min=10.4 -arch ppc"; - PREBINDING = NO; - "SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - VALID_ARCHS = "i386 x86_64 ppc"; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ppc; - COPY_PHASE_STRIP = NO; - DEPLOYMENT_POSTPROCESSING = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)", - "$(SRCROOT)/codecs/lib", - ); - OTHER_CFLAGS = ""; - "OTHER_CFLAGS[arch=i386]" = "-arch i386"; - "OTHER_CFLAGS[arch=ppc]" = "-arch ppc"; - "OTHER_LDFLAGS[arch=i386]" = "-arch i386"; - "OTHER_LDFLAGS[arch=ppc]" = "-arch ppc"; - PRODUCT_NAME = QuakeSpasm; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - x86_64, - i386, - ppc, - ); - DEPLOYMENT_POSTPROCESSING = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_MODEL_TUNING = G3; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_CODEC_MP3, - USE_CODEC_VORBIS, - USE_CODEC_WAVE, - USE_CODEC_FLAC, - USE_CODEC_OPUS, - USE_CODEC_MIKMOD, - USE_CODEC_UMX, - SDL_FRAMEWORK, - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - codecs/include, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.6; - ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = ""; - "OTHER_CFLAGS[arch=ppc]" = "-arch ppc"; - OTHER_LDFLAGS = ""; - "OTHER_LDFLAGS[arch=i386]" = "-mmacosx-version-min=10.4 -arch i386"; - "OTHER_LDFLAGS[arch=ppc]" = "-mmacosx-version-min=10.4 -arch ppc"; - PREBINDING = NO; - "SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - VALID_ARCHS = "i386 x86_64 ppc"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "QuakeSpasm" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4C08A954540054247B /* Release */, - 667B970C1C390232008775FA /* Debug */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "QuakeSpasmPPC" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF5008A954540054247B /* Release */, - 667B970D1C390232008775FA /* Debug */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/MacOSX/SDL.framework/License.rtf b/MacOSX/SDL.framework/License.rtf deleted file mode 100644 index 706980db..00000000 --- a/MacOSX/SDL.framework/License.rtf +++ /dev/null @@ -1,283 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;\red64\green64\blue64;} -\paperw11900\paperh16840\margl1440\margr1440\vieww9080\viewh13160\viewkind0 -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b\fs36 \cf0 GNU LESSER GENERAL PUBLIC LICENSE -\fs24 \ -Version 2.1, February 1999 -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f2\i \cf0 Copyright (C) 1991, 1999 Free Software Foundation, Inc.\ - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\ - Everyone is permitted to copy and distribute verbatim copies\ - of this license document, but changing it is not allowed.\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f1\i0 \cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf2 [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]\cf0 \ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 Preamble -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.\ -\ -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.\ -\ -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.\ -\ -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.\ -\ -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.\ -\ -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.\ -\ -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.\ -\ -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.\ -\ -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We this license for certain libraries in order to permit linking those libraries into non-free programs.\ -\ -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.\ -\ -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.\ -\ -For example, on rare occasions, there may be a special need to encourage widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.\ -\ -Another cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.\ -\ -Although the Lesser General Public License is Less protective of the users' freedom, it does insure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.\ -\ -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.\ -\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 GNU LESSER GENERAL PUBLIC LICENSE\ -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f1\b0 \cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 0. -\f1\b0 This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".\ -\ -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.\ -\ -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)\ -\ -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.\ -\ -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.\ - \ - -\f0\b 1. -\f1\b0 You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.\ -\ -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\ -\ - -\f0\b 2. -\f1\b0 You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural - -\f0\b \cf0 a) -\f1\b0 The modified work must itself be a software library.\ -\ - -\f0\b b) -\f1\b0 You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.\ -\ - -\f0\b c) -\f1\b0 You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.\ -\ - -\f0\b d) -\f1\b0 If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.\ -\ -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\ -\ -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.\ -\ -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 3. -\f1\b0 You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.\ -\ -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.\ -\ -This option is useful when you wish to copy part of the code of the Library into a program that is not a library.\ -\ - -\f0\b 4. -\f1\b0 You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.\ -\ -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.\ -\ - -\f0\b 5. -\f1\b0 A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.\ -\ -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.\ -\ -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.\ -\ -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)\ -\ -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.\ -\ - -\f0\b 6. -\f1\b0 As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.\ -\ -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural - -\f0\b \cf0 a) -\f1\b0 Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)\ -\ - -\f0\b b) -\f1\b0 Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.\ -\ - -\f0\b c) -\f1\b0 Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.\ -\ - -\f0\b d) -\f1\b0 If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.\ -\ - -\f0\b e) -\f1\b0 Verify that the user has already received a copy of these materials or that you have already sent this user a copy.\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\ -\ -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 7. -\f1\b0 You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural - -\f0\b \cf0 a) -\f1\b0 Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.\ -\ - -\f0\b b) -\f1\b0 Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 8. -\f1\b0 You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\ -\ - -\f0\b 9. -\f1\b0 You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.\ -\ - -\f0\b 10. -\f1\b0 Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.\ -\ - -\f0\b 11. -\f1\b0 If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.\ -\ -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.\ -\ -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\ -\ -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\ -\ - -\f0\b 12. -\f1\b0 If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\ -\ - -\f0\b 13. -\f1\b0 The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\ -\ -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.\ -\ - -\f0\b 14. -\f1\b0 If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 NO WARRANTY -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 15. -\f1\b0 BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\ -\ - -\f0\b 16. -\f1\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 END OF TERMS AND CONDITIONS -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\ -How to Apply These Terms to Your New Libraries\ -\ -If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).\ -\ -To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.\ -\ -\pard\tx220\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural -\cf0 <one line to give the library's name and a brief idea of what it does.>\ -Copyright (C) <year> <name of author>\ -\ -This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\ -\ -This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\ -\ -You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -Also add information on how to contact you by electronic and paper mail.\ -\ -You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural -\cf0 Yoyodyne, Inc., hereby disclaims all copyright interest in the library\ -`Frob' (a library for tweaking knobs) written by James Random Hacker.\ -\ -<signature of Ty Coon>, 1 April 1990\ -Ty Coon, President of Vice\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -That's all there is to it!\ -\ -} \ No newline at end of file diff --git a/MacOSX/SDL.framework/ReadMe.txt b/MacOSX/SDL.framework/ReadMe.txt deleted file mode 100644 index 07311503..00000000 --- a/MacOSX/SDL.framework/ReadMe.txt +++ /dev/null @@ -1,171 +0,0 @@ -The Simple DirectMedia Layer (SDL for short) is a cross-platform -library designed to make it easy to write multi-media software, -such as games and emulators. - -The Simple DirectMedia Layer library source code is available from: -http://www.libsdl.org/ - -This library is distributed under the terms of the GNU LGPL license: -http://www.gnu.org/copyleft/lesser.html - - -This packages contains the SDL.framework for OS X. -Conforming with Apple guidelines, this framework -contains both the SDL runtime component and development header files. - - -To Install: -Copy the SDL.framework to /Library/Frameworks - -You may alternatively install it in <Your home directory>/Library/Frameworks -if your access privileges are not high enough. -(Be aware that the Xcode templates we provide in the SDL Developer Extras -package may require some adjustment for your system if you do this.) - - -Known Issues: -??? - - -Additional References: - - - Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are - available at: - http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips - Though these are OpenSceneGraph centric, the same exact concepts apply to - SDL, thus the videos are recommended for everybody getting started with - developing on Mac OS X. (You can skim over the PlugIns stuff since SDL - doesn't have any PlugIns to worry about.) - - - -(Partial) History of PB/Xcode projects: -2009-09-21 - Added 64-bit for Snow Leopard. 10.4 is the new minimum requirement. - Removed 'no X11' targets as - new codebase will assume you have them. Also removed specific #defines - for X11, but needed to add search path to /usr/X11R6/include - -2007-12-31 - Enabled strip -x in the Xcode settings and removed it - from the Build DMG script. - Added a per-arch setting for the Deployment targets for OTHER_LDFLAGS_ppc - to re-enable prebinding. - Need to remember to copy these changes to the SDL satellite projects. - -2007-12-30 - Updated documentation to reflect new installation paths for - Xcode project templates under Leopard (Xcode 2.5/3.0). - -????-??-?? - Added extra targets for building formal releases against the - 10.2 SDK so we don't have to keep modifying the settings. - -????-??-?? - Added fancy DMG (background logo) support with automation. - -2006-05-09 - Added shell script phase to deal with new SDL_config.h - behavior. Encountered what seems to be an Xcode bug with - multiple files of the same name, even when conditional compiling - is controlled by custom #defines (SDL_sysloadso.c). Multiple or - undefined symbols are the result of this. - Recommended that macosx/SDL_sysloadso.c be modified to directly - include the dlopen version of the file via #ifdef's so only - one version needs to exist. Filed a formal bug report with Apple - about this (4542369). - -2006-03-22 - gcc 4 visibility features have been added to the code base so I - enabled the switch in Xcode to take advantage of it. Be aware that only - our x86 builds will be exposed to this feature as we still build ppc - with gcc 3.3. - - Christian Walther has sent me some great feedback on things that are - broken, so I have made some of these fixes. Among the issues are - compatibility and current library versions are not set to 1 (breaks - backwards compatibility), documentation errors, resource copying - location problems for the SDLTest apps, missing HAVE_OPENGL and - OpenGL.framework linking in testgl. - (Eric Wing) - -2006-03-17 - Because the X11 headers are not installed by default with Xcode, - we decided to offer two variants of the same targets (one with X11 stuff - and one without). By default, since the X11 stuff does not necessarily - conflict with the native stuff, we build the libraries with the X11 stuff - so advanced developers can access it by default. However, in the case - that a developer did not install X11 (or just doesn't want the extra bloat), - the user may directly select those targets and build those instead. - - Once again, we are attempting to remove the exported symbols file. If - I recall correctly, the clashing symbol problems we got were related - to the CD-ROM code which was formerly in C++. Now that the C++ code - has been purged, we are speculating that we might be able to remove - the exports file safely. The long term solution is to utilize gcc 4's - visibility features. - - For the developer extras package, I changed the package format - from a .pkg based installer to a .dmg to avoid requiring - administrator/root to access contents, for better - transparency, and to allow users to more easily control which components - they actually want to install. - I also made changes and updates to the PB/Xcode project templates (see Developer ReadMe). - (Eric Wing) - -2006-03-07 - The entire code base has been reorganized and platform specific - defines have been pushed into header files (SDL_config_*.h). This means - that defines that previously had to be defined in the Xcode projects can - be removed (which I have started doing). Furthermore, it appears that the - MMX/SSE code has been rewritten and refactored so it now compiles without - nasm and without making us do strange things to support OS X. However, this - Xcode project still employs architecture specific build options in order to - achieve the mandated 10.2 compatibility. As a result of the code base changes, - there are new public headers. But also as a result of these changes, there are - also new headers that qualify as "PrivateHeaders". Private Headers are headers - that must be exported because a public header includes them, but users shouldn't - directly invoke these. SDL_config_macosx.h and SDL_config_dreamcast.h are - examples of this. We have considered marking these headers as Private, but it - requires that the public headers invoke them via framework conventions, i.e. - #include <FrameworkName/Header.h> - e.g. - #include <SDL/SDL_config_macosx.h> - and not - #include "SDL_config_macosx.h" - However this imposes the restriction that non-framework distributions must - place their headers in a directory called SDL/ (and not SDL11/ like FreeBSD). - Currently, I do not believe this would pose a problem for any of the current - distributions (Fink, DarwinPorts). Or alternatively, users could be - expected/forced to also include the header path: - -I/Library/Frameworks/SDL.framework/PrivateHeaders, - but most people would probably not read the documentation on this. - But currently, we have decided to be conservative and have opted not to - use the PrivateHeaders feature. - (Eric Wing) - -2006-01-31 - Updates to build Universal Binaries while retaining 10.2 compatibility. - We were unable to get MMX/SSE support enabled. It is believed that a rewrite of - the assembly code will be necessary to make it position independent and not - require nasm. Altivec has finally been enabled for PPC. (Eric Wing) - -2005-09-?? - Had to add back the exports file because it was causing build problems - for some cases. (Eric Wing) - -2005-08-21 - First entry in history. Updated for SDL 1.2.9 and Xcode 2.1. Getting - ready for Universal Binaries. Removed the .pkg system for .dmg for due to problems - with broken packages in the past several SDL point releases. Removed usage of SDL - exports file because it has become another point of failure. Introduced new documentation - about SDLMain and how to compile in an devel-lite section of the SDL.dmg. (Eric Wing) - -Before history: -SDL 1.2.6? to 1.2.8 -Started updating Project Builder projects to Xcode for Panther and Tiger. Also removed -the system that split the single framework into separate runtime and headers frameworks. -This is against Apple conventions and causes problems on multiuser systems. -We now distribute a single framework. -The .pkg system has repeatedly been broken with every new release of OS X. -With 1.2.8, started migrating stuff to .dmg based system to simplify distribution process. -Tried updating the exports file and Perl script generation system for changing syntax. (Eric Wing) - -Pre-SDL 1.2.6 -Created Project Builder projects for SDL and .pkg based distribution system. (Darrell Walisser) - - - - - - - - diff --git a/MacOSX/SDL.framework/Resources b/MacOSX/SDL.framework/Resources deleted file mode 100644 index e69de29b..00000000 diff --git a/MacOSX/SDL.framework/SDL b/MacOSX/SDL.framework/SDL deleted file mode 100644 index e69de29b..00000000 diff --git a/MacOSX/SDL.framework/UniversalBinaryNotes.rtf b/MacOSX/SDL.framework/UniversalBinaryNotes.rtf deleted file mode 100644 index 5585ecb5..00000000 --- a/MacOSX/SDL.framework/UniversalBinaryNotes.rtf +++ /dev/null @@ -1,150 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf110 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;\f2\fmodern\fcharset0 Courier-Oblique; -} -{\colortbl;\red255\green255\blue255;} -{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural - -\f0\b\fs24 \cf0 64-bit Universal Binary Notes:\ - -\b0 \ -SDL 1.2.14 is our first release with Snow Leopard on the market. In order to make SDL compile and run in 64-bit, we had to remove code that depended on deprecated Mac APIs and move over to more modern Mac APIs.\ -\ -In addition, Apple has stopped shipping gcc 3.3 and the 10.3 SDK.\ -\ -Because of all these combined factors, we have made the decision to make Mac OS X 10.4 the new minimum requirement for SDL.\ -\ -Our official SDL.framework is compiled as a 3-way Universal Binary (64-bit Intel, 32-bit Intel, 32-bit PowerPC.)\ -\ -Certain APIs that SDL relies on were not made 64-bit ready by Apple until 10.6. This means even though 10.5 had preliminary 64-bit support, SDL will not compile or run correctly in 64-bit mode on 10.5. So there are two fallout items from this.\ -\ -First, you can only compile 64-bit code on Snow Leopard or greater (which removes the possibility of 64-bit PowerPC). \ -\ -Second, this presents a corner-case where if you have a 64-bit Intel executable in your Universal binary and try to run on 10.5 on an 64-bit Intel Mac, it will launch and crash. To force 10.5 to use the 32-bit version instead of the 64-bit, you should set the LaunchServices key, LSMinimumSystemVersionByArchitecture, in your application's Info.plist. Our SDL/Xcode templates for Snow Leopard already set this up for you.\ -\ -\ -One additional fallout item is we had to remove the SDL Custom Cocoa Xcode template project. It depended on NSQuickTimeView which was deprecated and removed from the SDL codebase. It may still be possible to recreate the behavior that this template demonstrated, but we would need a volunteer to investigate this.\ -\ -\ -\ -In addition, the SDL satellite projects were affected by the 64-bit transition.\ -\ -- SDL_mixer depended on legacy Quicktime for midi playback support. We had to disable midi. (Recall that we also disabled MP3 support awhile back because we never got SMPEG working during the Tiger/Intel transition.) To fix this, we would need a native Core Audio backend for SDL_mixer.\ -\ -- Since we have changed the baseline to 10.4, we took this opportunity to switch SDL_image over to a new native ImageIO based backend. This makes the binary about 10x smaller, greatly simplifies our maintenance requirements and build process as we no longer have to maintain build systems for 3rd party dependencies, and gives us access to more image formats.\ -\ -- The static library target for SDL_ttf no longer works because we no longer have access to a libfreetype.a. We have been relying on Apple's supplied libfreetype.a, but they stopped shipping a static version starting in 10.5 which means we have no static 64-bit version. But since 10.4 is our new baseline, all these systems should have libfreetype.dylib installed, so it shouldn't be much of a problem to use SDL_ttf as a dynamic library which dynamically links to libfreetype.\ -\ -\ --Eric Wing 2009-09-23\ - -\b \ -\ -\ -\ -Universal Binary Notes: (historical, somewhat obsolete)\ - -\b0 \ -Below is an overview of what we had to do to build Universal Binaries for SDL (and satellites). The document is provided to help others understand what the heck we had to do to get this to work so they know (and don't break) any settings we have set to accomplish this. It also describes areas of problems for those who might attempt to fix them after us.\ -\ -\ -It turns out that developing a Universal Binary for SDL was a painful process, but not for the typical reasons affecting most other developers. SDL is already platform clean and has an Xcode project which are usually the two biggest obstacles. (The only real code bug we had to fix was in SDL_mixer, but that was due to a Quicktime issue so we can blame the Quicktime authors.)\ -\ -But developing a Universal Binary was painful to us for several reasons:\ -\ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural -\ls1\ilvl0\cf0 {\listtext \'95 }SDL must retain compatibility with 10.2 (Jaguar)\ -\ -{\listtext \'95 }SDL has processor specific optimizations (Altivec, MMX/SSE)\ -\ -{\listtext \'95 }The SDL satellites (SDL_mixer, SDL_image, SDL_ttf) have 3rd party dependencies which we currently statically link against. All of these dependencies needed to be updated/recompiled with the same above constraints.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 \ -For retaining compatibility with 10.2, we have experimentally determined that there is no reliable way to use gcc 4.0.x to compile a binary that works under Jaguar. With the gcc 4.0 that shipped in Xcode 2.1, libgcc_s was automatically linked against. This library does not exist on systems prior to 10.3.9. After filing a bug report, Apple removed this automatic linking in gcc 4.0.1 which shipped with Xcode 2.2, but we discovered that we suffered from undefined symbols to things in the printf family library. (They seem to be new symbols related to printing long doubles, etc.)\ -\ -So to accomplish our compatibility goals, we had to find and exploit some lesser known features of Xcode that allow us to specify architecture specific build flags found here:\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_07_bs_building_product/chapter_33_section_6.html#//apple_ref/doc/uid/TP40002693-SW3"}}{\fldrslt \cf0 http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_07_bs_building_product/chapter_33_section_6.html#//apple_ref/doc/uid/TP40002693-SW3}}\ -\ -The first and most important of these is the -\f1 GCC_VERSION flag which lets us set gcc 3.3 for PowerPC and gcc 4.0 for Intel.\ -\ -But we also needed to verify other options such as the deployment target and SDK. Experimentally, we found that the Deployment target did very little for us except retain prebinding. Setting it to anything less than 10.4 allows for prebinding to remain active.\ -\ -For the SDK's, we found that Apple does link against different versions of system components. But experimentally, we discovered we could still link to the 10.4u SDK and things would still work on Jaguar. Ideally we should probably link to the 10.2.8 SDK for PowerPC. But in reality, most people don't install the 10.2.8 SDK on their system (it is not a default component) so we didn't want to confuse people as setting this would likely cause people's compile to fail the first time they try and they would have to understand the reason for this. We did leave the architecture specific SDKROOT option set explicitly to make it easy to change in case we need to.\ -\ -For the Altivec and MMX/SSE options, we had to use architecture specific build flags. Furthermore, to use SSE, we also had to include the assembly code. This caused us problems because there is no easy way to tell Xcode to use files only for a specific architecture. So the PowerPC side got confused on the .asm files and would fail to compile. \ -\ -Pushing forward, we ignored PPC for the moment to see if we could at least build an optimized x86 build and then use lipo manually to merge the results. We encountered additional problems. First the alignment needed to be changed for reasons outside my knowledge base. We changed all instances of .align 16 to .align 8. This seemed to fix the compile problems. But at the linking stage, we got errors such as:\ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li640\fi-640\ql\qnatural\pardirnatural - -\f2\i\fs22 \cf0 ld: /Users/ewing/DEVELOPMENT/CODETEST/UniversalBinarySDL/SDL12/Xcode/SDL/build/SDL.build/Deployment/Framework.build/Objects-normal/i386/SDL_yuv_mmx.o has local relocation entries in non-writable section (__TEXT,__text)\ -/usr/bin/libtool: internal link edit command failed\ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural - -\f1\i0\fs24 \cf0 \ -Our belief is that the assembly code is not position independent and thus will not work for us. We double checked for any OS X gcc flags that control position independence, but everything seemed to be in order. As such, we cannot compile MMX/SSE optimizations until they are rewritten, preferably without the nasm requirement to accommodate the dual PPC/x86 Xcode limitations.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 \ -So for now, we have unchecked (checkbox) the assembly specific files in the Xcode project and have removed the -DUSE_ASMBLIT flag from OTHER_CFLAGS_i386. To reactivate this stuff, you will need to recheck the boxes and re-add the flag.\ -\ -The files are\ -SDL_mixer_MMX.c/h\ -The files under hermes\ -and SDL_yuv_mmx.c\ -\ -\ -\ -For the SDL satellites, it was more of the same. The painful part was that the 3rd library dependencies needed to be rebuilt. (Some of our libraries were out of date, so this was an opportunity to update them.) But this meant changing those build systems as well. \ -\ -These are the versions I used:\ -libpng-1.2.8\ -libjpeg-6b\ -libogg-1.1.3\ -libvorbis-1.1.2\ -smpeg cvs\ -\ -We found that Apple already had a libfreetype in the 10.4u SDK so we just used that one which seemed to work. (For the record, the question did come up of why we statically link against this when it seems to be a standard component on Panther and Tiger. We double checked, and it did not seem to be in Jaguar. So that's why.)\ -\ -The old libpng turned out to be from the 1.0.x branch so we needed to replace all the headers we had as well. Updating to the 1.2.x branch didn't seem to cause any problems we could detect.\ -\ -libpng and libjpeg lack an Xcode project so we mucked with their build system to produce Universal Binaries. But since we needed PPC to be compiled with 3.3 and Intel to be compiled with 4.0, it ended up that we built multiple times changing the compiler, and then using lipo to strip and combine the binaries.\ -\ -libogg/libvorbis did contain Xcode projects, but didn't build static libraries so we had to add that. We also discovered that not building with gcc 3.3 caused us addition missing symbol runtime problems with float versions of math functions (sinf, sqrtf, etc).\ -\ -It seems that once upon a time, the SDL_mixer framework supported MP3's via SMPEG, but this disappeared at some point. I don't know why or how this happened. But I also don't know how SMPEG was ever used with the framework as there was no preexisting infrastructure as with the other libraries. So I have attempted to correct this oversight, however, the SMPEG framework itself has MMX code which has also turned out to be problematic. I am getting compiler errors of " -\f2\i\fs22 Unknown pseudo-op:" -\f1\i0\fs24 for -\f2\i\fs22 .type -\f1\i0\fs24 and -\f2\i\fs22 .size. -\f1\i0\fs24 \ -So SMPEG is currently compiled without MMX optimizations.\ -\ -\ -\ -\ -Addendum: \ -2006-03-06:\ -The main SDL code base (not the satellites) have undergone an overhaul. The required platform specific defines have been moved out of the build system into platform specific header files (SDL_config_*.h). This allows us to simplify the Xcode projects somewhat, but we still must maintain the architecture specific build options to invoke gcc 3.3 to maintain our mandated 10.2 compatibilty requirement.\ -\ -Also it appears that the MMX/SSE code has been rewritten as well so that the obstacles we faced in compiling in these optimizations are no longer problems. The binaries we produce should now contain the processor specific optimizations. (Remember this note only applies to SDL and not the satellites, such as SMPEG.)\ -\ -\ -\ -Contributers:\ -Eric Wing (Xcode projects, 3rd party dependencies, documentation)\ -Christian Walther (10.2.8 and 10.3.9 testing/verification)\ -Ryan Gordon (converted C++ code in SDL/OSX code base to pure C)\ -Martin Storsj\'f6 (libgcc_s testing/verification)\ -Stephane Marchesin (MMX/SSE code expert)\ -\ -\ -\ -\ -\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural - -\f0 \cf0 \ -} \ No newline at end of file diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL.h deleted file mode 100644 index 6087b7cd..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL.h - * Main include header for the SDL library - */ - -#ifndef _SDL_H -#define _SDL_H - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_audio.h" -#include "SDL_cdrom.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_loadso.h" -#include "SDL_mutex.h" -#include "SDL_rwops.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_video.h" -#include "SDL_version.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @file SDL.h - * @note As of version 0.5, SDL is loaded dynamically into the application - */ - -/** @name SDL_INIT Flags - * These are the flags which may be passed to SDL_Init() -- you should - * specify the subsystems which you will be using in your application. - */ -/*@{*/ -#define SDL_INIT_TIMER 0x00000001 -#define SDL_INIT_AUDIO 0x00000010 -#define SDL_INIT_VIDEO 0x00000020 -#define SDL_INIT_CDROM 0x00000100 -#define SDL_INIT_JOYSTICK 0x00000200 -#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ -#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ -#define SDL_INIT_EVERYTHING 0x0000FFFF -/*@}*/ - -/** This function loads the SDL dynamically linked library and initializes - * the subsystems specified by 'flags' (and those satisfying dependencies) - * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup - * signal handlers for some commonly ignored fatal signals (like SIGSEGV) - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/** This function initializes specific SDL subsystems */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/** This function cleans up specific SDL subsystems */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/** This function returns mask of the specified subsystems which have - * been initialized. - * If 'flags' is 0, it returns a mask of all initialized subsystems. - */ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/** This function cleans up all initialized subsystems and unloads the - * dynamically linked library. You should call it upon all exit conditions. - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_H */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_active.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_active.h deleted file mode 100644 index cd854e89..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_active.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_active.h - * Include file for SDL application focus event handling - */ - -#ifndef _SDL_active_h -#define _SDL_active_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name The available application states */ -/*@{*/ -#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ -#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ -#define SDL_APPACTIVE 0x04 /**< The application is active */ -/*@}*/ - -/* Function prototypes */ -/** - * This function returns the current state of the application, which is a - * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and - * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to - * see your application, otherwise it has been iconified or disabled. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_active_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_audio.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_audio.h deleted file mode 100644 index e879c989..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_audio.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_audio.h - * Access to the raw audio mixing buffer for the SDL library - */ - -#ifndef _SDL_audio_h -#define _SDL_audio_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * When filling in the desired audio spec structure, - * - 'desired->freq' should be the desired audio frequency in samples-per-second. - * - 'desired->format' should be the desired audio format. - * - 'desired->samples' is the desired size of the audio buffer, in samples. - * This number should be a power of two, and may be adjusted by the audio - * driver to a value more suitable for the hardware. Good values seem to - * range between 512 and 8096 inclusive, depending on the application and - * CPU speed. Smaller values yield faster response time, but can lead - * to underflow if the application is doing heavy processing and cannot - * fill the audio buffer in time. A stereo sample consists of both right - * and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: ms = (samples*1000)/freq - * - 'desired->size' is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * - 'desired->silence' is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * - 'desired->callback' should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. - * - 'desired->userdata' is passed as the first parameter to your callback - * function. - * - * @note The calculated values in this structure are calculated by SDL_OpenAudio() - * - */ -typedef struct SDL_AudioSpec { - int freq; /**< DSP frequency -- samples per second */ - Uint16 format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in samples (power of 2) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - /** - * This function is called when the audio device needs more data. - * - * @param[out] stream A pointer to the audio data buffer - * @param[in] len The length of the audio buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - */ - void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); - void *userdata; -} SDL_AudioSpec; - -/** - * @name Audio format flags - * defaults to LSB byte order - */ -/*@{*/ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB - -/** - * @name Native audio byte ordering - */ -/*@{*/ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#endif -/*@}*/ - -/*@}*/ - - -/** A structure to hold a set of audio conversion filters and buffers */ -typedef struct SDL_AudioCVT { - int needed; /**< Set to 1 if conversion possible */ - Uint16 src_format; /**< Source audio format */ - Uint16 dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); - int filter_index; /**< Current audio conversion function */ -} SDL_AudioCVT; - - -/* Function prototypes */ - -/** - * @name Audio Init and Quit - * These functions are used internally, and should not be used unless you - * have a specific need to specify the audio driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/*@{*/ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); -/*@}*/ - -/** - * This function fills the given character buffer with the name of the - * current audio driver, and returns a pointer to it if the audio driver has - * been initialized. It returns NULL if no driver has been initialized. - */ -extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); - -/** - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. - * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. - * - * @sa SDL_AudioSpec - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); - -typedef enum { - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_audiostatus; - -/** Get the current audio state */ -extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); - -/** - * This function pauses and unpauses the audio callback processing. - * It should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); - -/** - * This function loads a WAVE from the data source, automatically freeing - * that source if 'freesrc' is non-zero. For example, to load a WAVE file, - * you could do: - * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode - * - * If this function succeeds, it returns the given SDL_AudioSpec, - * filled with the audio data format of the wave data, and sets - * 'audio_buf' to a malloc()'d buffer containing the audio data, - * and sets 'audio_len' to the length of that audio buffer, in bytes. - * You need to free the audio buffer with SDL_FreeWAV() when you are - * done with it. - * - * This function returns NULL and sets the SDL error message if the - * wave file cannot be opened, uses an unknown data format, or is - * corrupt. Currently raw and MS-ADPCM WAVE files are supported. - */ -extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); - -/** Compatibility convenience function -- loads a WAV from a file */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/** - * This function frees data previously allocated with SDL_LoadWAV_RW() - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); - -/** - * This function takes a source format and rate and a destination format - * and rate, and initializes the 'cvt' structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. - * - * @return This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, - Uint16 src_format, Uint8 src_channels, int src_rate, - Uint16 dst_format, Uint8 dst_channels, int dst_rate); - -/** - * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), - * created an audio buffer cvt->buf, and filled it with cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * The data conversion may expand the size of the audio data, so the buffer - * cvt->buf should be allocated after the cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); - - -#define SDL_MIX_MAXVOLUME 128 -/** - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. - */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); - -/** - * @name Audio Locks - * The lock manipulated by these functions protects the callback function. - * During a LockAudio/UnlockAudio pair, you can be guaranteed that the - * callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -/*@}*/ - -/** - * This function shuts down audio processing and closes the audio device. - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_audio_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_byteorder.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_byteorder.h deleted file mode 100644 index 47332c3d..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_byteorder.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_byteorder.h - * @deprecated Use SDL_endian.h instead - */ - -/* DEPRECATED */ -#include "SDL_endian.h" diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_cdrom.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_cdrom.h deleted file mode 100644 index febb19dc..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_cdrom.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_cdrom.h - * This is the CD-audio control API for Simple DirectMedia Layer - */ - -#ifndef _SDL_cdrom_h -#define _SDL_cdrom_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file SDL_cdrom.h - * In order to use these functions, SDL_Init() must have been called - * with the SDL_INIT_CDROM flag. This causes SDL to scan the system - * for CD-ROM drives, and load appropriate drivers. - */ - -/** The maximum number of CD-ROM tracks on a disk */ -#define SDL_MAX_TRACKS 99 - -/** @name Track Types - * The types of CD-ROM track possible - */ -/*@{*/ -#define SDL_AUDIO_TRACK 0x00 -#define SDL_DATA_TRACK 0x04 -/*@}*/ - -/** The possible states which a CD-ROM drive can be in. */ -typedef enum { - CD_TRAYEMPTY, - CD_STOPPED, - CD_PLAYING, - CD_PAUSED, - CD_ERROR = -1 -} CDstatus; - -/** Given a status, returns true if there's a disk in the drive */ -#define CD_INDRIVE(status) ((int)(status) > 0) - -typedef struct SDL_CDtrack { - Uint8 id; /**< Track number */ - Uint8 type; /**< Data or audio track */ - Uint16 unused; - Uint32 length; /**< Length, in frames, of this track */ - Uint32 offset; /**< Offset, in frames, from start of disk */ -} SDL_CDtrack; - -/** This structure is only current as of the last call to SDL_CDStatus() */ -typedef struct SDL_CD { - int id; /**< Private drive identifier */ - CDstatus status; /**< Current drive status */ - - /** The rest of this structure is only valid if there's a CD in drive */ - /*@{*/ - int numtracks; /**< Number of tracks on disk */ - int cur_track; /**< Current track position */ - int cur_frame; /**< Current frame offset within current track */ - SDL_CDtrack track[SDL_MAX_TRACKS+1]; - /*@}*/ -} SDL_CD; - -/** @name Frames / MSF Conversion Functions - * Conversion functions from frames to Minute/Second/Frames and vice versa - */ -/*@{*/ -#define CD_FPS 75 -#define FRAMES_TO_MSF(f, M,S,F) { \ - int value = f; \ - *(F) = value%CD_FPS; \ - value /= CD_FPS; \ - *(S) = value%60; \ - value /= 60; \ - *(M) = value; \ -} -#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) -/*@}*/ - -/* CD-audio API functions: */ - -/** - * Returns the number of CD-ROM drives on the system, or -1 if - * SDL_Init() has not been called with the SDL_INIT_CDROM flag. - */ -extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); - -/** - * Returns a human-readable, system-dependent identifier for the CD-ROM. - * Example: - * - "/dev/cdrom" - * - "E:" - * - "/dev/disk/ide/1/master" - */ -extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); - -/** - * Opens a CD-ROM drive for access. It returns a drive handle on success, - * or NULL if the drive was invalid or busy. This newly opened CD-ROM - * becomes the default CD used when other CD functions are passed a NULL - * CD-ROM handle. - * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. - */ -extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); - -/** - * This function returns the current status of the given drive. - * If the drive has a CD in it, the table of contents of the CD and current - * play position of the CD will be stored in the SDL_CD structure. - */ -extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); - -/** - * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' - * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play - * until the end of the CD. This function will skip data tracks. - * This function should only be called after calling SDL_CDStatus() to - * get track information about the CD. - * For example: - * @code - * // Play entire CD: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) - * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); - * // Play last track: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { - * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); - * } - * // Play first and second track and 10 seconds of third track: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) - * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); - * @endcode - * - * @return This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, - int start_track, int start_frame, int ntracks, int nframes); - -/** - * Play the given CD starting at 'start' frame for 'length' frames. - * @return It returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); - -/** Pause play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); - -/** Resume play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); - -/** Stop play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); - -/** Eject CD-ROM - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); - -/** Closes the handle for the CD-ROM drive */ -extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config.h deleted file mode 100644 index 09ba38a7..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/* Add any platform that doesn't build using the configure system */ -#if defined(__DREAMCAST__) -#include "SDL_config_dreamcast.h" -#elif defined(__MACOS__) -#include "SDL_config_macos.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__SYMBIAN32__) -#include "SDL_config_symbian.h" /* must be before win32! */ -#elif defined(__WIN32__) -#include "SDL_config_win32.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#endif /* _SDL_config_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h deleted file mode 100644 index fb03098e..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_dreamcast_h -#define _SDL_config_dreamcast_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DC 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_DC 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DC 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DUMMY 1 - -/* Enable various threading systems */ -#define SDL_THREAD_DC 1 - -/* Enable various timer systems */ -#define SDL_TIMER_DC 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DC 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_dreamcast_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_macos.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_macos.h deleted file mode 100644 index 4fe1715a..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_macos.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_macos_h -#define _SDL_config_macos_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#include <MacTypes.h> - -typedef SInt8 int8_t; -typedef UInt8 uint8_t; -typedef SInt16 int16_t; -typedef UInt16 uint16_t; -typedef SInt32 int32_t; -typedef UInt32 uint32_t; -typedef SInt64 int64_t; -typedef UInt64 uint64_t; -typedef unsigned long uintptr_t; - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_SSCANF 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_SNDMGR 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#if TARGET_API_MAC_CARBON -#define SDL_CDROM_DUMMY 1 -#else -#define SDL_CDROM_MACOS 1 -#endif - -/* Enable various input drivers */ -#if TARGET_API_MAC_CARBON -#define SDL_JOYSTICK_DUMMY 1 -#else -#define SDL_JOYSTICK_MACOS 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_MACOS 1 - -/* Enable various threading systems */ -#define SDL_THREADS_DISABLED 1 - -/* Enable various timer systems */ -#define SDL_TIMER_MACOS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 -#define SDL_VIDEO_DRIVER_TOOLBOX 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 - -#endif /* _SDL_config_macos_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_macosx.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_macosx.h deleted file mode 100644 index c05712ee..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_macosx.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_macosx_h -#define _SDL_config_macosx_h - -#include "SDL_platform.h" - -/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ -#include <AvailabilityMacros.h> - -/* This is a set of defines to configure the SDL features */ - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ -#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) -#define HAVE_ALLOCA_H 1 -#endif -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_MACOSX 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 - -/* Enable various shared object loading systems */ -#ifdef __ppc__ -/* For Mac OS X 10.2 compatibility */ -#define SDL_LOADSO_DLCOMPAT 1 -#else -#define SDL_LOADSO_DLOPEN 1 -#endif - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) -#define SDL_VIDEO_DRIVER_TOOLBOX 1 -#else -#define SDL_VIDEO_DRIVER_QUARTZ 1 -#endif -#define SDL_VIDEO_DRIVER_DGA 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" -#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 -#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 -#define SDL_VIDEO_DRIVER_X11_XME 1 -#define SDL_VIDEO_DRIVER_X11_XRANDR 1 -#define SDL_VIDEO_DRIVER_X11_XV 1 -#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_GLX 1 - -/* Disable screensaver */ -#define SDL_VIDEO_DISABLE_SCREENSAVER 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 -#ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 -#endif - -#endif /* _SDL_config_macosx_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_minimal.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_minimal.h deleted file mode 100644 index d10db7c6..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_minimal.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_minimal_h -#define _SDL_config_minimal_h - -#include "SDL_platform.h" - -/* This is the minimal configuration that can be used to build SDL */ - -#include <stdarg.h> - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned int size_t; -typedef unsigned long uintptr_t; - -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 - -/* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_minimal_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_nds.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_nds.h deleted file mode 100644 index cb4d61f6..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_nds.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_nds_h -#define _SDL_config_nds_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -/* C datatypes */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Endianness */ -#define SDL_BYTEORDER 1234 - -/* Useful headers */ -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_NDS 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_NDS 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable various timer systems */ -#define SDL_TIMER_NDS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_NDS 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_nds_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h deleted file mode 100644 index 0342c818..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_os2_h -#define _SDL_config_os2_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#define SDL_HAS_64BIT_TYPE 1 - -/* Use Watcom's LIBC */ -#define HAVE_LIBC 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DART 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_OS2 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_OS2 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_OS2 1 - -/* Enable various threading systems */ -#define SDL_THREAD_OS2 1 - -/* Enable various timer systems */ -#define SDL_TIMER_OS2 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_OS2FS 1 - -/* Enable OpenGL support */ -/* Nothing yet for OS/2. */ - -/* Enable assembly routines where available */ -#define SDL_ASSEMBLY_ROUTINES 1 - -#endif /* _SDL_config_os2_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_symbian.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_symbian.h deleted file mode 100644 index e917ac6e..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_symbian.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* - -Symbian version Markus Mertama - -*/ - - -#ifndef _SDL_CONFIG_SYMBIAN_H -#define _SDL_CONFIG_SYMBIAN_H - -#include "SDL_platform.h" - -/* This is the minimal configuration that can be used to build SDL */ - - -#include <stdarg.h> -#include <stddef.h> - - -#ifdef __GCCE__ -#define SYMBIAN32_GCCE -#endif - -#ifndef _SIZE_T_DEFINED -typedef unsigned int size_t; -#endif - -#ifndef _INTPTR_T_DECLARED -typedef unsigned int uintptr_t; -#endif - -#ifndef _INT8_T_DECLARED -typedef signed char int8_t; -#endif - -#ifndef _UINT8_T_DECLARED -typedef unsigned char uint8_t; -#endif - -#ifndef _INT16_T_DECLARED -typedef signed short int16_t; -#endif - -#ifndef _UINT16_T_DECLARED -typedef unsigned short uint16_t; -#endif - -#ifndef _INT32_T_DECLARED -typedef signed int int32_t; -#endif - -#ifndef _UINT32_T_DECLARED -typedef unsigned int uint32_t; -#endif - -#ifndef _INT64_T_DECLARED -typedef signed long long int64_t; -#endif - -#ifndef _UINT64_T_DECLARED -typedef unsigned long long uint64_t; -#endif - -#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 - - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -#define SDL_THREAD_SYMBIAN 1 - -#define SDL_VIDEO_DRIVER_EPOC 1 - -#define SDL_VIDEO_OPENGL 0 - -#define SDL_HAS_64BIT_TYPE 1 - -#define HAVE_LIBC 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -/*#define HAVE_ALLOCA 1*/ -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRUPR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -/*#define HAVE__STRICMP 1*/ -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 - - - -#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_win32.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_win32.h deleted file mode 100644 index 6d2ae2d6..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_win32.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_win32_h -#define _SDL_config_win32_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Enabled for SDL 1.2 (binary compatibility) */ -#define HAVE_LIBC 1 -#ifdef HAVE_LIBC -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#ifndef _WIN32_WCE -#define HAVE_SIGNAL_H 1 -#endif - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#if defined(__MINGW32__) || defined(__WATCOMC__) -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#endif -#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(_WIN64) -#define HAVE__STRTOI64 1 -#define HAVE__STRTOUI64 1 -#endif -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#ifndef _WIN32_WCE -#define SDL_AUDIO_DRIVER_DSOUND 1 -#endif -#define SDL_AUDIO_DRIVER_WAVEOUT 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#ifdef _WIN32_WCE -#define SDL_CDROM_DISABLED 1 -#else -#define SDL_CDROM_WIN32 1 -#endif - -/* Enable various input drivers */ -#ifdef _WIN32_WCE -#define SDL_JOYSTICK_DISABLED 1 -#else -#define SDL_JOYSTICK_WINMM 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WIN32 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WIN32 1 - -/* Enable various timer systems */ -#ifdef _WIN32_WCE -#define SDL_TIMER_WINCE 1 -#else -#define SDL_TIMER_WIN32 1 -#endif - -/* Enable various video drivers */ -#ifdef _WIN32_WCE -#define SDL_VIDEO_DRIVER_GAPI 1 -#endif -#ifndef _WIN32_WCE -#define SDL_VIDEO_DRIVER_DDRAW 1 -#endif -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDIB 1 - -/* Enable OpenGL support */ -#ifndef _WIN32_WCE -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_WGL 1 -#endif - -/* Disable screensaver */ -#define SDL_VIDEO_DISABLE_SCREENSAVER 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* _SDL_config_win32_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_copying.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_copying.h deleted file mode 100644 index b5b64f29..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_copying.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h deleted file mode 100644 index 1335b982..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_cpuinfo.h - * CPU feature detection for SDL - */ - -#ifndef _SDL_cpuinfo_h -#define _SDL_cpuinfo_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** This function returns true if the CPU has the RDTSC instruction */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/** This function returns true if the CPU has MMX features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/** This function returns true if the CPU has MMX Ext. features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); - -/** This function returns true if the CPU has 3DNow features */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/** This function returns true if the CPU has 3DNow! Ext. features */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); - -/** This function returns true if the CPU has SSE features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/** This function returns true if the CPU has SSE2 features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/** This function returns true if the CPU has AltiVec features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/** This function returns true if the CPU has ARM SIMD (ARMv6) features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); - -/** This function returns true if the CPU has ARM NEON features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMNEON(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_cpuinfo_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h deleted file mode 100644 index 953f2c0f..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_endian.h - * Functions for reading and writing endian-specific values - */ - -#ifndef _SDL_endian_h -#define _SDL_endian_h - -#include "SDL_stdinc.h" - -/** @name SDL_ENDIANs - * The two types of endianness - */ -/*@{*/ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 -/*@}*/ - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#ifdef __linux__ -#include <endian.h> -#define SDL_BYTEORDER __BYTE_ORDER -#elif defined(__OpenBSD__) -#include <endian.h> -#define SDL_BYTEORDER BYTE_ORDER -#else -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MIPSEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* __linux __ */ -#endif /* !SDL_BYTEORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name SDL_Swap Functions - * Use inline functions for compilers that support them, and static - * functions for those that do not. Because these functions become - * static for compilers that do not support inline functions, this - * header should only be included in files that actually use them. - */ -/*@{*/ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - int result; - - __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); - return (Uint16)result; -} -#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint16 SDL_Swap16(Uint16); -#pragma aux SDL_Swap16 = \ - "xchg al, ah" \ - parm [ax] \ - modify [ax]; -#else -static __inline__ Uint16 SDL_Swap16(Uint16 x) { - return SDL_static_cast(Uint16, ((x<<8)|(x>>8))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0" : "=r" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0" : "=r" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); - __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); - __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); - return result; -} -#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint32 SDL_Swap32(Uint32); -#ifndef __SW_3 /* 486+ */ -#pragma aux SDL_Swap32 = \ - "bswap eax" \ - parm [eax] \ - modify [eax]; -#else /* 386-only */ -#pragma aux SDL_Swap32 = \ - "xchg al, ah" \ - "ror eax, 16" \ - "xchg al, ah" \ - parm [eax] \ - modify [eax]; -#endif -#else -static __inline__ Uint32 SDL_Swap32(Uint32 x) { - return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); -} -#endif - -#ifdef SDL_HAS_64BIT_TYPE -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint64 SDL_Swap64(Uint64 x) -{ - union { - struct { Uint32 a,b; } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" - : "=r" (v.s.a), "=r" (v.s.b) - : "0" (v.s.a), "1" (v.s.b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint64 SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0" : "=r" (x) : "0" (x)); - return x; -} -#else -static __inline__ Uint64 SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif -#else -/* This is mainly to keep compilers from complaining in SDL code. - * If there is no real 64-bit datatype, then compilers will complain about - * the fake 64-bit datatype that SDL provides when it compiles user code. - */ -#define SDL_Swap64(X) (X) -#endif /* SDL_HAS_64BIT_TYPE */ -/*@}*/ - -/** - * @name SDL_SwapLE and SDL_SwapBE Functions - * Byteswap item from the specified endianness to the native endianness - */ -/*@{*/ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#endif -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_endian_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_error.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_error.h deleted file mode 100644 index 4e1cce3b..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_error.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_error.h - * Simple error message routines for SDL - */ - -#ifndef _SDL_error_h -#define _SDL_error_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name Public functions - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); -extern DECLSPEC char * SDLCALL SDL_GetError(void); -extern DECLSPEC void SDLCALL SDL_ClearError(void); -/*@}*/ - -/** - * @name Private functions - * @internal Private error message function - used internally - */ -/*@{*/ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -typedef enum { - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_error_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_events.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_events.h deleted file mode 100644 index 94b42025..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_events.h +++ /dev/null @@ -1,356 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_events.h - * Include file for SDL event handling - */ - -#ifndef _SDL_events_h -#define _SDL_events_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_active.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_quit.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name General keyboard/mouse state definitions */ -/*@{*/ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 -/*@}*/ - -/** Event enumerations */ -typedef enum { - SDL_NOEVENT = 0, /**< Unused (do not remove) */ - SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ - SDL_KEYDOWN, /**< Keys pressed */ - SDL_KEYUP, /**< Keys released */ - SDL_MOUSEMOTION, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_JOYAXISMOTION, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_QUIT, /**< User-requested quit */ - SDL_SYSWMEVENT, /**< System specific event */ - SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ - SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ - SDL_VIDEORESIZE, /**< User resized video mode */ - SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ - SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ - /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ - SDL_USEREVENT = 24, - /** This last event is only for bounding internal arrays - * It is the number of bits in the event mask datatype -- Uint32 - */ - SDL_NUMEVENTS = 32 -} SDL_EventType; - -/** @name Predefined event masks */ -/*@{*/ -#define SDL_EVENTMASK(X) (1<<(X)) -typedef enum { - SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), - SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), - SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), - SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| - SDL_EVENTMASK(SDL_KEYUP), - SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), - SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), - SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| - SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| - SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), - SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), - SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), - SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), - SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| - SDL_EVENTMASK(SDL_JOYBALLMOTION)| - SDL_EVENTMASK(SDL_JOYHATMOTION)| - SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| - SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), - SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), - SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), - SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) -} SDL_EventMask ; -#define SDL_ALLEVENTS 0xFFFFFFFF -/*@}*/ - -/** Application visibility event structure */ -typedef struct SDL_ActiveEvent { - Uint8 type; /**< SDL_ACTIVEEVENT */ - Uint8 gain; /**< Whether given states were gained or lost (1/0) */ - Uint8 state; /**< A mask of the focus states */ -} SDL_ActiveEvent; - -/** Keyboard event structure */ -typedef struct SDL_KeyboardEvent { - Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ - Uint8 which; /**< The keyboard device index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - SDL_keysym keysym; -} SDL_KeyboardEvent; - -/** Mouse motion event structure */ -typedef struct SDL_MouseMotionEvent { - Uint8 type; /**< SDL_MOUSEMOTION */ - Uint8 which; /**< The mouse device index */ - Uint8 state; /**< The current button state */ - Uint16 x, y; /**< The X/Y coordinates of the mouse */ - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_MouseMotionEvent; - -/** Mouse button event structure */ -typedef struct SDL_MouseButtonEvent { - Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ - Uint8 which; /**< The mouse device index */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ -} SDL_MouseButtonEvent; - -/** Joystick axis motion event structure */ -typedef struct SDL_JoyAxisEvent { - Uint8 type; /**< SDL_JOYAXISMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 axis; /**< The joystick axis index */ - Sint16 value; /**< The axis value (range: -32768 to 32767) */ -} SDL_JoyAxisEvent; - -/** Joystick trackball motion event structure */ -typedef struct SDL_JoyBallEvent { - Uint8 type; /**< SDL_JOYBALLMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 ball; /**< The joystick trackball index */ - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** Joystick hat position change event structure */ -typedef struct SDL_JoyHatEvent { - Uint8 type; /**< SDL_JOYHATMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value: - * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP - * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT - * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN - * Note that zero means the POV is centered. - */ -} SDL_JoyHatEvent; - -/** Joystick button event structure */ -typedef struct SDL_JoyButtonEvent { - Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ - Uint8 which; /**< The joystick device index */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ -} SDL_JoyButtonEvent; - -/** The "window resized" event - * When you get this event, you are responsible for setting a new video - * mode with the new width and height. - */ -typedef struct SDL_ResizeEvent { - Uint8 type; /**< SDL_VIDEORESIZE */ - int w; /**< New width */ - int h; /**< New height */ -} SDL_ResizeEvent; - -/** The "screen redraw" event */ -typedef struct SDL_ExposeEvent { - Uint8 type; /**< SDL_VIDEOEXPOSE */ -} SDL_ExposeEvent; - -/** The "quit requested" event */ -typedef struct SDL_QuitEvent { - Uint8 type; /**< SDL_QUIT */ -} SDL_QuitEvent; - -/** A user-defined event type */ -typedef struct SDL_UserEvent { - Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ - int code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ -} SDL_UserEvent; - -/** If you want to use this event, you should include SDL_syswm.h */ -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; -typedef struct SDL_SysWMEvent { - Uint8 type; - SDL_SysWMmsg *msg; -} SDL_SysWMEvent; - -/** General event structure */ -typedef union SDL_Event { - Uint8 type; - SDL_ActiveEvent active; - SDL_KeyboardEvent key; - SDL_MouseMotionEvent motion; - SDL_MouseButtonEvent button; - SDL_JoyAxisEvent jaxis; - SDL_JoyBallEvent jball; - SDL_JoyHatEvent jhat; - SDL_JoyButtonEvent jbutton; - SDL_ResizeEvent resize; - SDL_ExposeEvent expose; - SDL_QuitEvent quit; - SDL_UserEvent user; - SDL_SysWMEvent syswm; -} SDL_Event; - - -/* Function prototypes */ - -/** Pumps the event loop, gathering events from the input devices. - * This function updates the event queue and internal input device state. - * This should only be run in the thread that sets the video mode. - */ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -typedef enum { - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; - -/** - * Checks the event queue for messages and optionally returns them. - * - * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to - * the back of the event queue. - * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front - * of the event queue, matching 'mask', will be returned and will not - * be removed from the queue. - * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front - * of the event queue, matching 'mask', will be returned and will be - * removed from the queue. - * - * @return - * This function returns the number of events actually stored, or -1 - * if there was an error. - * - * This function is thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, - SDL_eventaction action, Uint32 mask); - -/** Polls for currently pending events, and returns 1 if there are any pending - * events, or 0 if there are none available. If 'event' is not NULL, the next - * event is removed from the queue and stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); - -/** Waits indefinitely for the next available event, returning 1, or 0 if there - * was an error while waiting for events. If 'event' is not NULL, the next - * event is removed from the queue and stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); - -/** Add an event to the event queue. - * This function returns 0 on success, or -1 if the event queue was full - * or there was some other error. - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); - -/** @name Event Filtering */ -/*@{*/ -typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); -/** - * This function sets up a filter to process all events before they - * change internal state and are posted to the internal event queue. - * - * The filter is protypted as: - * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode - * - * If the filter returns 1, then the event will be added to the internal queue. - * If it returns 0, then the event will be dropped from the queue, but the - * internal state will still be updated. This allows selective filtering of - * dynamically arriving events. - * - * @warning Be very careful of what you do in the event filter function, as - * it may run in a different thread! - * - * There is one caveat when dealing with the SDL_QUITEVENT event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will - * be closed, otherwise the window will remain open if possible. - * If the quit event is generated by an interrupt signal, it will bypass the - * internal queue and be delivered to the application at the next event poll. - */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); - -/** - * Return the current event filter - can be used to "chain" filters. - * If there is no event filter set, this function returns NULL. - */ -extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); -/*@}*/ - -/** @name Event State */ -/*@{*/ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 -/*@}*/ - -/** -* This function allows you to set the state of processing certain events. -* If 'state' is set to SDL_IGNORE, that event will be automatically dropped -* from the event queue and will not event be filtered. -* If 'state' is set to SDL_ENABLE, that event will be processed normally. -* If 'state' is set to SDL_QUERY, SDL_EventState() will return the -* current processing state of the specified event. -*/ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_events_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_getenv.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_getenv.h deleted file mode 100644 index bea63007..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_getenv.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_getenv.h - * @deprecated Use SDL_stdinc.h instead - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_joystick.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_joystick.h deleted file mode 100644 index 708d1a9f..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_joystick.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_joystick.h - * Include file for SDL joystick event handling - */ - -#ifndef _SDL_joystick_h -#define _SDL_joystick_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @file SDL_joystick.h - * @note In order to use these functions, SDL_Init() must have been called - * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. - */ - -/** The joystick structure used to identify an SDL joystick */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - -/* Function prototypes */ -/** - * Count the number of joysticks attached to the system - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/** - * Get the implementation dependent name of a joystick. - * - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); - -/** - * Open a joystick for use. - * - * @param[in] device_index - * The index passed as an argument refers to - * the N'th joystick on the system. This index is the value which will - * identify this joystick in future joystick events. - * - * @return This function returns a joystick identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); - -/** - * Returns 1 if the joystick has been opened, or 0 if it has not. - */ -extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); - -/** - * Get the device index of an opened joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); - -/** - * Get the number of general axis controls on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); - -/** - * Get the number of trackballs on a joystick - * - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); - -/** - * Get the number of POV hats on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); - -/** - * Get the number of buttons on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); - -/** - * Update the current state of the open joysticks. - * - * This is called automatically by the event loop if any joystick - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/** - * Enable/disable joystick event polling. - * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. - * - * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -/** - * Get the current state of an axis control on a joystick - * - * @param[in] axis The axis indices start at index 0. - * - * @return The state is a value ranging from -32768 to 32767. - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); - -/** - * @name Hat Positions - * The return value of SDL_JoystickGetHat() is one of the following positions: - */ -/*@{*/ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/*@}*/ - -/** - * Get the current state of a POV hat on a joystick - * - * @param[in] hat The hat indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); - -/** - * Get the ball axis change since the last poll - * - * @param[in] ball The ball indices start at index 0. - * - * @return This returns 0, or -1 if you passed it invalid parameters. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); - -/** - * Get the current state of a button on a joystick - * - * @param[in] button The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); - -/** - * Close a joystick previously opened with SDL_JoystickOpen() - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_joystick_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_keyboard.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_keyboard.h deleted file mode 100644 index 9d7129c5..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_keyboard.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_keyboard.h - * Include file for SDL keyboard event handling - */ - -#ifndef _SDL_keyboard_h -#define _SDL_keyboard_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keysym.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** Keysym structure - * - * - The scancode is hardware dependent, and should not be used by general - * applications. If no hardware scancode is available, it will be 0. - * - * - The 'unicode' translated character is only available when character - * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, - * this is a UNICODE character corresponding to the keypress. If the - * high 9 bits of the character are 0, then this maps to the equivalent - * ASCII character: - * @code - * char ch; - * if ( (keysym.unicode & 0xFF80) == 0 ) { - * ch = keysym.unicode & 0x7F; - * } else { - * An international character.. - * } - * @endcode - */ -typedef struct SDL_keysym { - Uint8 scancode; /**< hardware specific scancode */ - SDLKey sym; /**< SDL virtual keysym */ - SDLMod mod; /**< current key modifiers */ - Uint16 unicode; /**< translated character */ -} SDL_keysym; - -/** This is the mask which refers to all hotkey bindings */ -#define SDL_ALL_HOTKEYS 0xFFFFFFFF - -/* Function prototypes */ -/** - * Enable/Disable UNICODE translation of keyboard input. - * - * This translation has some overhead, so translation defaults off. - * - * @param[in] enable - * If 'enable' is 1, translation is enabled. - * If 'enable' is 0, translation is disabled. - * If 'enable' is -1, the translation state is not changed. - * - * @return It returns the previous state of keyboard translation. - */ -extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); - -#define SDL_DEFAULT_REPEAT_DELAY 500 -#define SDL_DEFAULT_REPEAT_INTERVAL 30 -/** - * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. - * - * @param[in] delay - * 'delay' is the initial delay in ms between the time when a key is - * pressed, and keyboard repeat begins. - * - * @param[in] interval - * 'interval' is the time in ms between keyboard repeat events. - * - * If 'delay' is set to 0, keyboard repeat is disabled. - */ -extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); -extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); - -/** - * Get a snapshot of the current state of the keyboard. - * Returns an array of keystates, indexed by the SDLK_* syms. - * Usage: - * @code - * Uint8 *keystate = SDL_GetKeyState(NULL); - * if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed. - * @endcode - */ -extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); - -/** - * Get the current key modifier state - */ -extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); - -/** - * Set the current key modifier state. - * This does not change the keyboard state, only the key modifier flags. - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); - -/** - * Get the name of an SDL virtual keysym - */ -extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_keyboard_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_keysym.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_keysym.h deleted file mode 100644 index f2ad12b8..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_keysym.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_keysym_h -#define _SDL_keysym_h - -/** What we really want is a mapping of every raw key on the keyboard. - * To support international keyboards, we use the range 0xA1 - 0xFF - * as international virtual keycodes. We'll follow in the footsteps of X11... - * @brief The names of the keys - */ -typedef enum { - /** @name ASCII mapped keysyms - * The keyboard syms have been cleverly chosen to map to ASCII - */ - /*@{*/ - SDLK_UNKNOWN = 0, - SDLK_FIRST = 0, - SDLK_BACKSPACE = 8, - SDLK_TAB = 9, - SDLK_CLEAR = 12, - SDLK_RETURN = 13, - SDLK_PAUSE = 19, - SDLK_ESCAPE = 27, - SDLK_SPACE = 32, - SDLK_EXCLAIM = 33, - SDLK_QUOTEDBL = 34, - SDLK_HASH = 35, - SDLK_DOLLAR = 36, - SDLK_AMPERSAND = 38, - SDLK_QUOTE = 39, - SDLK_LEFTPAREN = 40, - SDLK_RIGHTPAREN = 41, - SDLK_ASTERISK = 42, - SDLK_PLUS = 43, - SDLK_COMMA = 44, - SDLK_MINUS = 45, - SDLK_PERIOD = 46, - SDLK_SLASH = 47, - SDLK_0 = 48, - SDLK_1 = 49, - SDLK_2 = 50, - SDLK_3 = 51, - SDLK_4 = 52, - SDLK_5 = 53, - SDLK_6 = 54, - SDLK_7 = 55, - SDLK_8 = 56, - SDLK_9 = 57, - SDLK_COLON = 58, - SDLK_SEMICOLON = 59, - SDLK_LESS = 60, - SDLK_EQUALS = 61, - SDLK_GREATER = 62, - SDLK_QUESTION = 63, - SDLK_AT = 64, - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = 91, - SDLK_BACKSLASH = 92, - SDLK_RIGHTBRACKET = 93, - SDLK_CARET = 94, - SDLK_UNDERSCORE = 95, - SDLK_BACKQUOTE = 96, - SDLK_a = 97, - SDLK_b = 98, - SDLK_c = 99, - SDLK_d = 100, - SDLK_e = 101, - SDLK_f = 102, - SDLK_g = 103, - SDLK_h = 104, - SDLK_i = 105, - SDLK_j = 106, - SDLK_k = 107, - SDLK_l = 108, - SDLK_m = 109, - SDLK_n = 110, - SDLK_o = 111, - SDLK_p = 112, - SDLK_q = 113, - SDLK_r = 114, - SDLK_s = 115, - SDLK_t = 116, - SDLK_u = 117, - SDLK_v = 118, - SDLK_w = 119, - SDLK_x = 120, - SDLK_y = 121, - SDLK_z = 122, - SDLK_DELETE = 127, - /* End of ASCII mapped keysyms */ - /*@}*/ - - /** @name International keyboard syms */ - /*@{*/ - SDLK_WORLD_0 = 160, /* 0xA0 */ - SDLK_WORLD_1 = 161, - SDLK_WORLD_2 = 162, - SDLK_WORLD_3 = 163, - SDLK_WORLD_4 = 164, - SDLK_WORLD_5 = 165, - SDLK_WORLD_6 = 166, - SDLK_WORLD_7 = 167, - SDLK_WORLD_8 = 168, - SDLK_WORLD_9 = 169, - SDLK_WORLD_10 = 170, - SDLK_WORLD_11 = 171, - SDLK_WORLD_12 = 172, - SDLK_WORLD_13 = 173, - SDLK_WORLD_14 = 174, - SDLK_WORLD_15 = 175, - SDLK_WORLD_16 = 176, - SDLK_WORLD_17 = 177, - SDLK_WORLD_18 = 178, - SDLK_WORLD_19 = 179, - SDLK_WORLD_20 = 180, - SDLK_WORLD_21 = 181, - SDLK_WORLD_22 = 182, - SDLK_WORLD_23 = 183, - SDLK_WORLD_24 = 184, - SDLK_WORLD_25 = 185, - SDLK_WORLD_26 = 186, - SDLK_WORLD_27 = 187, - SDLK_WORLD_28 = 188, - SDLK_WORLD_29 = 189, - SDLK_WORLD_30 = 190, - SDLK_WORLD_31 = 191, - SDLK_WORLD_32 = 192, - SDLK_WORLD_33 = 193, - SDLK_WORLD_34 = 194, - SDLK_WORLD_35 = 195, - SDLK_WORLD_36 = 196, - SDLK_WORLD_37 = 197, - SDLK_WORLD_38 = 198, - SDLK_WORLD_39 = 199, - SDLK_WORLD_40 = 200, - SDLK_WORLD_41 = 201, - SDLK_WORLD_42 = 202, - SDLK_WORLD_43 = 203, - SDLK_WORLD_44 = 204, - SDLK_WORLD_45 = 205, - SDLK_WORLD_46 = 206, - SDLK_WORLD_47 = 207, - SDLK_WORLD_48 = 208, - SDLK_WORLD_49 = 209, - SDLK_WORLD_50 = 210, - SDLK_WORLD_51 = 211, - SDLK_WORLD_52 = 212, - SDLK_WORLD_53 = 213, - SDLK_WORLD_54 = 214, - SDLK_WORLD_55 = 215, - SDLK_WORLD_56 = 216, - SDLK_WORLD_57 = 217, - SDLK_WORLD_58 = 218, - SDLK_WORLD_59 = 219, - SDLK_WORLD_60 = 220, - SDLK_WORLD_61 = 221, - SDLK_WORLD_62 = 222, - SDLK_WORLD_63 = 223, - SDLK_WORLD_64 = 224, - SDLK_WORLD_65 = 225, - SDLK_WORLD_66 = 226, - SDLK_WORLD_67 = 227, - SDLK_WORLD_68 = 228, - SDLK_WORLD_69 = 229, - SDLK_WORLD_70 = 230, - SDLK_WORLD_71 = 231, - SDLK_WORLD_72 = 232, - SDLK_WORLD_73 = 233, - SDLK_WORLD_74 = 234, - SDLK_WORLD_75 = 235, - SDLK_WORLD_76 = 236, - SDLK_WORLD_77 = 237, - SDLK_WORLD_78 = 238, - SDLK_WORLD_79 = 239, - SDLK_WORLD_80 = 240, - SDLK_WORLD_81 = 241, - SDLK_WORLD_82 = 242, - SDLK_WORLD_83 = 243, - SDLK_WORLD_84 = 244, - SDLK_WORLD_85 = 245, - SDLK_WORLD_86 = 246, - SDLK_WORLD_87 = 247, - SDLK_WORLD_88 = 248, - SDLK_WORLD_89 = 249, - SDLK_WORLD_90 = 250, - SDLK_WORLD_91 = 251, - SDLK_WORLD_92 = 252, - SDLK_WORLD_93 = 253, - SDLK_WORLD_94 = 254, - SDLK_WORLD_95 = 255, /* 0xFF */ - /*@}*/ - - /** @name Numeric keypad */ - /*@{*/ - SDLK_KP0 = 256, - SDLK_KP1 = 257, - SDLK_KP2 = 258, - SDLK_KP3 = 259, - SDLK_KP4 = 260, - SDLK_KP5 = 261, - SDLK_KP6 = 262, - SDLK_KP7 = 263, - SDLK_KP8 = 264, - SDLK_KP9 = 265, - SDLK_KP_PERIOD = 266, - SDLK_KP_DIVIDE = 267, - SDLK_KP_MULTIPLY = 268, - SDLK_KP_MINUS = 269, - SDLK_KP_PLUS = 270, - SDLK_KP_ENTER = 271, - SDLK_KP_EQUALS = 272, - /*@}*/ - - /** @name Arrows + Home/End pad */ - /*@{*/ - SDLK_UP = 273, - SDLK_DOWN = 274, - SDLK_RIGHT = 275, - SDLK_LEFT = 276, - SDLK_INSERT = 277, - SDLK_HOME = 278, - SDLK_END = 279, - SDLK_PAGEUP = 280, - SDLK_PAGEDOWN = 281, - /*@}*/ - - /** @name Function keys */ - /*@{*/ - SDLK_F1 = 282, - SDLK_F2 = 283, - SDLK_F3 = 284, - SDLK_F4 = 285, - SDLK_F5 = 286, - SDLK_F6 = 287, - SDLK_F7 = 288, - SDLK_F8 = 289, - SDLK_F9 = 290, - SDLK_F10 = 291, - SDLK_F11 = 292, - SDLK_F12 = 293, - SDLK_F13 = 294, - SDLK_F14 = 295, - SDLK_F15 = 296, - /*@}*/ - - /** @name Key state modifier keys */ - /*@{*/ - SDLK_NUMLOCK = 300, - SDLK_CAPSLOCK = 301, - SDLK_SCROLLOCK = 302, - SDLK_RSHIFT = 303, - SDLK_LSHIFT = 304, - SDLK_RCTRL = 305, - SDLK_LCTRL = 306, - SDLK_RALT = 307, - SDLK_LALT = 308, - SDLK_RMETA = 309, - SDLK_LMETA = 310, - SDLK_LSUPER = 311, /**< Left "Windows" key */ - SDLK_RSUPER = 312, /**< Right "Windows" key */ - SDLK_MODE = 313, /**< "Alt Gr" key */ - SDLK_COMPOSE = 314, /**< Multi-key compose key */ - /*@}*/ - - /** @name Miscellaneous function keys */ - /*@{*/ - SDLK_HELP = 315, - SDLK_PRINT = 316, - SDLK_SYSREQ = 317, - SDLK_BREAK = 318, - SDLK_MENU = 319, - SDLK_POWER = 320, /**< Power Macintosh power key */ - SDLK_EURO = 321, /**< Some european keyboards */ - SDLK_UNDO = 322, /**< Atari keyboard has Undo */ - /*@}*/ - - /* Add any other keys here */ - - SDLK_LAST -} SDLKey; - -/** Enumeration of valid key mods (possibly OR'd together) */ -typedef enum { - KMOD_NONE = 0x0000, - KMOD_LSHIFT= 0x0001, - KMOD_RSHIFT= 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDLMod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_META (KMOD_LMETA|KMOD_RMETA) - -#endif /* _SDL_keysym_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_loadso.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_loadso.h deleted file mode 100644 index 0c5e5362..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_loadso.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_loadso.h - * System dependent library loading routines - */ - -/** @file SDL_loadso.h - * Some things to keep in mind: - * - These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * - Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * - Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - - -#ifndef _SDL_loadso_h -#define _SDL_loadso_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. - */ -extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); - -/** - * Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). - */ -extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); - -/** Unload a shared object from memory */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_loadso_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_main.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_main.h deleted file mode 100644 index ab50ef1e..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_main.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_main_h -#define _SDL_main_h - -#include "SDL_stdinc.h" - -/** @file SDL_main.h - * Redefine main() on Win32 and MacOS so that it is called by winmain.c - */ - -#if defined(__WIN32__) || \ - (defined(__MWERKS__) && !defined(__BEOS__)) || \ - defined(__MACOS__) || defined(__MACOSX__) || \ - defined(__SYMBIAN32__) || defined(QWS) - -#ifdef __cplusplus -#define C_LINKAGE "C" -#else -#define C_LINKAGE -#endif /* __cplusplus */ - -/** The application's main() function must be called with C linkage, - * and should be declared like this: - * @code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * @endcode - */ -#define main SDL_main - -/** The prototype for the application's main() function */ -extern C_LINKAGE int SDL_main(int argc, char *argv[]); - - -/** @name From the SDL library code -- needed for registering the app on Win32 */ -/*@{*/ -#ifdef __WIN32__ - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** This should be called from your WinMain() function, if any */ -extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); -/** This can also be called, but is no longer necessary */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); -/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); -#ifdef __cplusplus -} -#endif -#include "close_code.h" -#endif -/*@}*/ - -/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ -/*@{*/ -#if defined(__MACOS__) - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** Forward declaration so we don't need to include QuickDraw.h */ -struct QDGlobals; - -/** This should be called from your main() function, if any */ -extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); - -#ifdef __cplusplus -} -#endif -#include "close_code.h" -#endif -/*@}*/ - -#endif /* Need to redefine main()? */ - -#endif /* _SDL_main_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_mouse.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_mouse.h deleted file mode 100644 index 7c563b94..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_mouse.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_mouse.h - * Include file for SDL mouse event handling - */ - -#ifndef _SDL_mouse_h -#define _SDL_mouse_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct WMcursor WMcursor; /**< Implementation dependent */ -typedef struct SDL_Cursor { - SDL_Rect area; /**< The area of the mouse cursor */ - Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ - Uint8 *data; /**< B/W cursor data */ - Uint8 *mask; /**< B/W cursor mask */ - Uint8 *save[2]; /**< Place to save cursor area */ - WMcursor *wm_cursor; /**< Window-manager cursor */ -} SDL_Cursor; - -/* Function prototypes */ -/** - * Retrieve the current state of the mouse. - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * current mouse cursor position. You can pass NULL for either x or y. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); - -/** - * Retrieve the current state of the mouse. - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); - -/** - * Set the position of the mouse cursor (generates a mouse motion event) - */ -extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); - -/** - * Create a cursor using the specified data and mask (in MSB format). - * The cursor width must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * data mask resulting pixel on screen - * 0 1 White - * 1 1 Black - * 0 0 Transparent - * 1 0 Inverted color if possible, black if not. - * - * Cursors created with this function must be freed with SDL_FreeCursor(). - */ -extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor - (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); - -/** - * Set the currently active cursor to the specified one. - * If the cursor is currently visible, the change will be immediately - * represented on the display. - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); - -/** - * Returns the currently active cursor. - */ -extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); - -/** - * Deallocates a cursor created with SDL_CreateCursor(). - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); - -/** - * Toggle whether or not the cursor is shown on the screen. - * The cursor start off displayed, but can be turned off. - * SDL_ShowCursor() returns 1 if the cursor was being displayed - * before the call, or 0 if it was not. You can query the current - * state by passing a 'toggle' value of -1. - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/*@{*/ -/** Used as a mask when testing buttons in buttonstate - * Button 1: Left mouse button - * Button 2: Middle mouse button - * Button 3: Right mouse button - * Button 4: Mouse wheel up (may also be a real button) - * Button 5: Mouse wheel down (may also be a real button) - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_WHEELUP 4 -#define SDL_BUTTON_WHEELDOWN 5 -#define SDL_BUTTON_X1 6 -#define SDL_BUTTON_X2 7 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_mouse_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_mutex.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_mutex.h deleted file mode 100644 index c8da9b1a..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_mutex.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_mutex_h -#define _SDL_mutex_h - -/** @file SDL_mutex.h - * Functions to provide thread synchronization primitives - * - * @note These are independent of the other SDL routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** Synchronization functions which can time out return this value - * if they time out. - */ -#define SDL_MUTEX_TIMEDOUT 1 - -/** This is the timeout value which corresponds to never time out */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Mutex functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** The SDL mutex structure, defined in SDL_mutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/** Create a mutex, initialized unlocked */ -extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); - -#define SDL_LockMutex(m) SDL_mutexP(m) -/** Lock the mutex - * @return 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); - -#define SDL_UnlockMutex(m) SDL_mutexV(m) -/** Unlock the mutex - * @return 0, or -1 on error - * - * It is an error to unlock a mutex that has not been locked by - * the current thread, and doing so results in undefined behavior. - */ -extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); - -/** Destroy a mutex */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Semaphore functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** The SDL semaphore structure, defined in SDL_sem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/** Create a semaphore, initialized with value, returns NULL on failure. */ -extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/** Destroy a semaphore */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); - -/** - * This function suspends the calling thread until the semaphore pointed - * to by sem has a positive count. It then atomically decreases the semaphore - * count. - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); - -/** Non-blocking variant of SDL_SemWait(). - * @return 0 if the wait succeeds, - * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); - -/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if - * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in - * the allotted time, and -1 on error. - * - * On some platforms this function is implemented by looping with a delay - * of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); - -/** Atomically increases the semaphore's count (not blocking). - * @return 0, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); - -/** Returns the current count of the semaphore */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Condition_variable_functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/*@{*/ -/** The SDL condition variable structure, defined in SDL_cond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; -/*@}*/ - -/** Create a condition variable */ -extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); - -/** Destroy a condition variable */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); - -/** Restart one of the threads that are waiting on the condition variable, - * @return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); - -/** Restart all threads that are waiting on the condition variable, - * @return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); - -/** Wait on the condition variable, unlocking the provided mutex. - * The mutex must be locked before entering this function! - * The mutex is re-locked once the condition variable is signaled. - * @return 0 when it is signaled, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); - -/** Waits for at most 'ms' milliseconds, and returns 0 if the condition - * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not - * signaled in the allotted time, and -1 on error. - * On some platforms this function is implemented by looping with a delay - * of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); - -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_mutex_h */ - diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_name.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_name.h deleted file mode 100644 index 511619af..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_name.h +++ /dev/null @@ -1,11 +0,0 @@ - -#ifndef _SDLname_h_ -#define _SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* _SDLname_h_ */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h deleted file mode 100644 index 3d791d69..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h +++ /dev/null @@ -1,6570 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_opengl.h - * This is a simple file to encapsulate the OpenGL API headers - */ - -#include "SDL_config.h" - -#ifdef __WIN32__ -#define WIN32_LEAN_AND_MEAN -#ifndef NOMINMAX -#define NOMINMAX /* Don't defined min() and max() */ -#endif -#include <windows.h> -#endif -#ifndef NO_SDL_GLEXT -#define __glext_h_ /* Don't let gl.h include glext.h */ -#endif -#if defined(__MACOSX__) -#include <OpenGL/gl.h> /* Header File For The OpenGL Library */ -#include <OpenGL/glu.h> /* Header File For The GLU Library */ -#elif defined(__MACOS__) -#include <gl.h> /* Header File For The OpenGL Library */ -#include <glu.h> /* Header File For The GLU Library */ -#else -#include <GL/gl.h> /* Header File For The OpenGL Library */ -#include <GL/glu.h> /* Header File For The GLU Library */ -#endif -#ifndef NO_SDL_GLEXT -#undef __glext_h_ -#endif - -/** @name GLext.h - * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. - * It is included here because glext.h is not available on some systems. - * If you don't want this version included, simply define "NO_SDL_GLEXT" - */ -/*@{*/ -#ifndef NO_SDL_GLEXT -#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#define WIN32_LEAN_AND_MEAN 1 -#include <windows.h> -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/06/20 */ -/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 29 - -#ifndef GL_VERSION_1_2 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#endif - -#ifndef GL_ARB_imaging -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif - -#ifndef GL_VERSION_1_3 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#endif - -#ifndef GL_VERSION_1_4 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#endif - -#ifndef GL_VERSION_1_5 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#endif - -#ifndef GL_VERSION_2_0 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_env_add -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_ARB_point_parameters -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -#ifndef GL_ARB_shadow -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -#ifndef GL_ARB_window_pos -#endif - -#ifndef GL_ARB_vertex_program -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#endif - -#ifndef GL_ARB_fragment_program -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#endif - -#ifndef GL_ARB_shader_objects -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#endif - -#ifndef GL_ARB_point_sprite -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -#ifndef GL_ARB_texture_float -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_EXT_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif - -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif - -#ifndef GL_NV_evaluators -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#endif - -#ifndef GL_NV_texture_compression_vtc -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif - -#ifndef GL_NV_texture_shader -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif - -#ifndef GL_NV_vertex_program -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif - -#ifndef GL_OML_interlace -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif - -#ifndef GL_OML_subsample -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif - -#ifndef GL_OML_resample -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#endif - -#ifndef GL_ATI_element_array -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#endif - -#ifndef GL_SUN_mesh_array -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_DEPTH_CLAMP_NV 0x864F -#endif - -#ifndef GL_NV_occlusion_query -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#endif - -#ifndef GL_NV_point_sprite -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif - -#ifndef GL_NV_vertex_program1_1 -#endif - -#ifndef GL_EXT_shadow_funcs -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -#ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A -#endif - -#ifndef GL_APPLE_fence -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -#ifndef GL_S3_s3tc -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -#ifndef GL_ATI_texture_float -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif - -#ifndef GL_NV_float_buffer -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif - -#ifndef GL_NV_fragment_program -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#endif - -#ifndef GL_NV_half_float -#define GL_HALF_FLOAT_NV 0x140B -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#endif - -#ifndef GL_NV_primitive_restart -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -#ifndef GL_NV_vertex_program2 -#endif - -#ifndef GL_ATI_map_object_buffer -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#endif - -#ifndef GL_OES_read_format -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#endif - -#ifndef GL_MESA_pack_invert -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -#ifndef GL_NV_fragment_program_option -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif - -#ifndef GL_NV_vertex_program2_option -/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ -/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ -#endif - -#ifndef GL_NV_vertex_program3 -/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#endif - -#ifndef GL_GREMEDY_string_marker -#endif - - -/*************************************************************/ - -#include <stddef.h> -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; /* native character */ -#endif - -#ifndef GL_VERSION_1_5 -/* GL types for handling large vertex buffer objects */ -#ifdef __APPLE__ -typedef long GLintptr; -typedef long GLsizeiptr; -#else -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -#endif -#endif - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -#ifdef __APPLE__ -typedef long GLintptrARB; -typedef long GLsizeiptrARB; -#else -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif -#endif - -#ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and program/shader text */ -typedef char GLcharARB; /* native character */ -#if defined(__APPLE__) -typedef void *GLhandleARB; /* shader object handle */ -#else -typedef unsigned int GLhandleARB; /* shader object handle */ -#endif -#endif - -/* GL types for "half" precision (s10e5) float data in host memory */ -#ifndef GL_ARB_half_float_pixel -typedef unsigned short GLhalfARB; -#endif - -#ifndef GL_NV_half_float -typedef unsigned short GLhalfNV; -#endif - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -#endif - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#endif - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#endif - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#endif - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#endif - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#endif - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#endif - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#endif - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#endif - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#endif - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#endif - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#endif - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#endif - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#endif - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#endif - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#endif - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#endif - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -/* This is really a WGL extension, but defines some associated GL enums. - * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. - */ -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#endif - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#endif - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#endif - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#endif - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#endif - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#endif - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#endif - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#endif - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif -#endif /* NO_SDL_GLEXT */ -/*@}*/ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_platform.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_platform.h deleted file mode 100644 index bcbd7b66..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_platform.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_platform.h - * Try to get a standard set of platform defines - */ - -#ifndef _SDL_platform_h -#define _SDL_platform_h - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__BEOS__) -#undef __BEOS__ -#define __BEOS__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if defined(linux) || defined(__linux) || defined(__linux__) -#undef __LINUX__ -#define __LINUX__ 1 -#endif -#if defined(__APPLE__) -#undef __MACOSX__ -#define __MACOSX__ 1 -#elif defined(macintosh) -#undef __MACOS__ -#define __MACOS__ 1 -#endif -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) || defined(__EMX__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif -#if defined(WIN32) || defined(_WIN32) -#undef __WIN32__ -#define __WIN32__ 1 -#endif - -#endif /* _SDL_platform_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_quit.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_quit.h deleted file mode 100644 index abd2ec6c..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_quit.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_quit.h - * Include file for SDL quit event handling - */ - -#ifndef _SDL_quit_h -#define _SDL_quit_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/** @file SDL_quit.h - * An SDL_QUITEVENT is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate SDL_QUITEVENT events as well. There is no way - * to determine the cause of an SDL_QUITEVENT, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - */ - -/** @file SDL_quit.h - * There are no functions directly affecting the quit event - */ - -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) - -#endif /* _SDL_quit_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_rwops.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_rwops.h deleted file mode 100644 index 98361d7e..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_rwops.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_rwops.h - * This file provides a general interface for SDL to read and write - * data sources. It can easily be extended to files, memory, etc. - */ - -#ifndef _SDL_rwops_h -#define _SDL_rwops_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the read/write operation structure -- very basic */ - -typedef struct SDL_RWops { - /** Seek to 'offset' relative to whence, one of stdio's whence values: - * SEEK_SET, SEEK_CUR, SEEK_END - * Returns the final offset in the data source. - */ - int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); - - /** Read up to 'maxnum' objects each of size 'size' from the data - * source to the area pointed at by 'ptr'. - * Returns the number of objects read, or -1 if the read failed. - */ - int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); - - /** Write exactly 'num' objects each of size 'objsize' from the area - * pointed at by 'ptr' to data source. - * Returns 'num', or -1 if the write failed. - */ - int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); - - /** Close and free an allocated SDL_FSops structure */ - int (SDLCALL *close)(struct SDL_RWops *context); - - Uint32 type; - union { -#if defined(__WIN32__) && !defined(__SYMBIAN32__) - struct { - int append; - void *h; - struct { - void *data; - int size; - int left; - } buffer; - } win32io; -#endif -#ifdef HAVE_STDIO_H - struct { - int autoclose; - FILE *fp; - } stdio; -#endif - struct { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct { - void *data1; - } unknown; - } hidden; - -} SDL_RWops; - - -/** @name Functions to create SDL_RWops structures from various data sources */ -/*@{*/ - -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); - -#ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); -#endif - -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); - -extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); - -/*@}*/ - -/** @name Seek Reference Points */ -/*@{*/ -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ -/*@}*/ - -/** @name Macros to easily read and write from an SDL_RWops structure */ -/*@{*/ -#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) -#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) -#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -#define SDL_RWclose(ctx) (ctx)->close(ctx) -/*@}*/ - -/** @name Read an item of the specified endianness and return in native format */ -/*@{*/ -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); -/*@}*/ - -/** @name Write an item of native format to the specified endianness */ -/*@{*/ -extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); -extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_rwops_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h deleted file mode 100644 index 0df46478..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h +++ /dev/null @@ -1,624 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_stdinc.h - * This is a general header that includes C language support - */ - -#ifndef _SDL_stdinc_h -#define _SDL_stdinc_h - -#include "SDL_config.h" - - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_STDIO_H -#include <stdio.h> -#endif -#if defined(STDC_HEADERS) -# include <stdlib.h> -# include <stddef.h> -# include <stdarg.h> -#else -# if defined(HAVE_STDLIB_H) -# include <stdlib.h> -# elif defined(HAVE_MALLOC_H) -# include <malloc.h> -# endif -# if defined(HAVE_STDDEF_H) -# include <stddef.h> -# endif -# if defined(HAVE_STDARG_H) -# include <stdarg.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#if defined(HAVE_INTTYPES_H) -# include <inttypes.h> -#elif defined(HAVE_STDINT_H) -# include <stdint.h> -#endif -#ifdef HAVE_CTYPE_H -# include <ctype.h> -#endif -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -# include <iconv.h> -#endif -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include <alloca.h> -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include <malloc.h> -# define alloca _alloca -# elif defined(__WATCOMC__) -# include <malloc.h> -# elif defined(__BORLANDC__) -# include <malloc.h> -# elif defined(__DMC__) -# include <stdlib.h> -# elif defined(__AIX__) - #pragma alloca -# elif defined(__MRC__) - void *alloca (unsigned); -# else - char *alloca (); -# endif -#endif - -/** The number of elements in an array */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/* Use proper C++ casts when compiled as C++ to be compatible with the option - -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ -#ifdef __cplusplus -#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression) -#define SDL_static_cast(type, expression) static_cast<type>(expression) -#else -#define SDL_reinterpret_cast(type, expression) ((type)(expression)) -#define SDL_static_cast(type, expression) ((type)(expression)) -#endif - -/** @name Basic data types */ -/*@{*/ -typedef enum { - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; - -typedef int8_t Sint8; -typedef uint8_t Uint8; -typedef int16_t Sint16; -typedef uint16_t Uint16; -typedef int32_t Sint32; -typedef uint32_t Uint32; - -#ifdef SDL_HAS_64BIT_TYPE -typedef int64_t Sint64; -#ifndef SYMBIAN32_GCCE -typedef uint64_t Uint64; -#endif -#else -/* This is really just a hack to prevent the compiler from complaining */ -typedef struct { - Uint32 hi; - Uint32 lo; -} Uint64, Sint64; -#endif - -/*@}*/ - -/** @name Make sure the types really have the right sizes */ -/*@{*/ -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_dummy_ ## name[(x) * 2 - 1] - -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -/*@}*/ - -/** @name Enum Size Check - * Check to make sure enums are the size of ints, for structure packing. - * For both Watcom C/C++ and Borland C/C++ the compiler option that makes - * enums having the size of an int must be enabled. - * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). - */ -/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ -#ifdef __MWERKS__ -#pragma enumsalwaysint on -#endif - -typedef enum { - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -#ifndef __NDS__ -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -/*@}*/ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_MALLOC -#define SDL_malloc malloc -#else -extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); -#endif - -#ifdef HAVE_CALLOC -#define SDL_calloc calloc -#else -extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); -#endif - -#ifdef HAVE_REALLOC -#define SDL_realloc realloc -#else -extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); -#endif - -#ifdef HAVE_FREE -#define SDL_free free -#else -extern DECLSPEC void SDLCALL SDL_free(void *mem); -#endif - -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -#ifdef HAVE_GETENV -#define SDL_getenv getenv -#else -extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); -#endif - -#ifdef HAVE_PUTENV -#define SDL_putenv putenv -#else -extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); -#endif - -#ifdef HAVE_QSORT -#define SDL_qsort qsort -#else -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)); -#endif - -#ifdef HAVE_ABS -#define SDL_abs abs -#else -#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) -#endif - -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) - -#ifdef HAVE_CTYPE_H -#define SDL_isdigit(X) isdigit(X) -#define SDL_isspace(X) isspace(X) -#define SDL_toupper(X) toupper(X) -#define SDL_tolower(X) tolower(X) -#else -#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) -#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) -#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) -#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) -#endif - -#ifdef HAVE_MEMSET -#define SDL_memset memset -#else -extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); -#endif - -#if defined(__GNUC__) && defined(i386) -#define SDL_memset4(dst, val, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; stosl\n\t" \ - : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memset4 -#define SDL_memset4(dst, val, len) \ -do { \ - unsigned _count = (len); \ - unsigned _n = (_count + 3) / 4; \ - Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ - Uint32 _val = (val); \ - if (len == 0) break; \ - switch (_count % 4) { \ - case 0: do { *_p++ = _val; \ - case 3: *_p++ = _val; \ - case 2: *_p++ = _val; \ - case 1: *_p++ = _val; \ - } while ( --_n ); \ - } \ -} while(0) -#endif - -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl\n\t" \ - "testb $2,%b4\n\t" \ - "je 1f\n\t" \ - "movsw\n" \ - "1:\ttestb $1,%b4\n\t" \ - "je 2f\n\t" \ - "movsb\n" \ - "2:" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy -#ifdef HAVE_MEMCPY -#define SDL_memcpy memcpy -#elif defined(HAVE_BCOPY) -#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) -#else -extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); -#endif -#endif - -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy4(dst, src, len) \ -do { \ - int ecx, edi, esi; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl" \ - : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ - : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy4 -#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) -#endif - -#if defined(__GNUC__) && defined(i386) -#define SDL_revcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - char *dstp = SDL_static_cast(char *, dst); \ - char *srcp = SDL_static_cast(char *, src); \ - int n = (len); \ - if ( n >= 4 ) { \ - __asm__ __volatile__ ( \ - "std\n\t" \ - "rep ; movsl\n\t" \ - "cld\n\t" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (n >> 2), \ - "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ - : "memory" ); \ - } \ - switch (n & 3) { \ - case 3: dstp[2] = srcp[2]; \ - case 2: dstp[1] = srcp[1]; \ - case 1: dstp[0] = srcp[0]; \ - break; \ - default: \ - break; \ - } \ -} while(0) -#endif -#ifndef SDL_revcpy -extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); -#endif - -#ifdef HAVE_MEMMOVE -#define SDL_memmove memmove -#elif defined(HAVE_BCOPY) -#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) -#else -#define SDL_memmove(dst, src, len) \ -do { \ - if ( dst < src ) { \ - SDL_memcpy(dst, src, len); \ - } else { \ - SDL_revcpy(dst, src, len); \ - } \ -} while(0) -#endif - -#ifdef HAVE_MEMCMP -#define SDL_memcmp memcmp -#else -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); -#endif - -#ifdef HAVE_STRLEN -#define SDL_strlen strlen -#else -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); -#endif - -#ifdef HAVE_STRLCPY -#define SDL_strlcpy strlcpy -#else -extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); -#endif - -#ifdef HAVE_STRLCAT -#define SDL_strlcat strlcat -#else -extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); -#endif - -#ifdef HAVE_STRDUP -#define SDL_strdup strdup -#else -extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); -#endif - -#ifdef HAVE__STRREV -#define SDL_strrev _strrev -#else -extern DECLSPEC char * SDLCALL SDL_strrev(char *string); -#endif - -#ifdef HAVE__STRUPR -#define SDL_strupr _strupr -#else -extern DECLSPEC char * SDLCALL SDL_strupr(char *string); -#endif - -#ifdef HAVE__STRLWR -#define SDL_strlwr _strlwr -#else -extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); -#endif - -#ifdef HAVE_STRCHR -#define SDL_strchr strchr -#elif defined(HAVE_INDEX) -#define SDL_strchr index -#else -extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); -#endif - -#ifdef HAVE_STRRCHR -#define SDL_strrchr strrchr -#elif defined(HAVE_RINDEX) -#define SDL_strrchr rindex -#else -extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); -#endif - -#ifdef HAVE_STRSTR -#define SDL_strstr strstr -#else -extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); -#endif - -#ifdef HAVE_ITOA -#define SDL_itoa itoa -#else -#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) -#endif - -#ifdef HAVE__LTOA -#define SDL_ltoa _ltoa -#else -extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); -#endif - -#ifdef HAVE__UITOA -#define SDL_uitoa _uitoa -#else -#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) -#endif - -#ifdef HAVE__ULTOA -#define SDL_ultoa _ultoa -#else -extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); -#endif - -#ifdef HAVE_STRTOL -#define SDL_strtol strtol -#else -extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); -#endif - -#ifdef HAVE_STRTOUL -#define SDL_strtoul strtoul -#else -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); -#endif - -#ifdef SDL_HAS_64BIT_TYPE - -#ifdef HAVE__I64TOA -#define SDL_lltoa _i64toa -#else -extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); -#endif - -#ifdef HAVE__UI64TOA -#define SDL_ulltoa _ui64toa -#else -extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); -#endif - -#ifdef HAVE__STRTOI64 -#define SDL_strtoll _strtoi64 -#elif defined(HAVE_STRTOLL) -#define SDL_strtoll strtoll -#else -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); -#endif - -#ifdef HAVE__STRTOUI64 -#define SDL_strtoull _strtoui64 -#elif defined(HAVE_STRTOULL) -#define SDL_strtoull strtoull -#else -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); -#endif - -#endif /* SDL_HAS_64BIT_TYPE */ - -#ifdef HAVE_STRTOD -#define SDL_strtod strtod -#else -extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); -#endif - -#ifdef HAVE_ATOI -#define SDL_atoi atoi -#else -#define SDL_atoi(X) SDL_strtol(X, NULL, 0) -#endif - -#ifdef HAVE_ATOF -#define SDL_atof atof -#else -#define SDL_atof(X) SDL_strtod(X, NULL) -#endif - -#ifdef HAVE_STRCMP -#define SDL_strcmp strcmp -#else -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -#endif - -#ifdef HAVE_STRNCMP -#define SDL_strncmp strncmp -#else -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -#endif - -#if defined(HAVE__STRICMP) -#define SDL_strcasecmp _stricmp -#elif defined(HAVE_STRCASECMP) -#define SDL_strcasecmp strcasecmp -#else -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -#endif - -#if defined(HAVE__STRNICMP) -#define SDL_strncasecmp _strnicmp -#elif defined(HAVE_STRNCASECMP) -#define SDL_strncasecmp strncasecmp -#else -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); -#endif - -#ifdef HAVE_SSCANF -#define SDL_sscanf sscanf -#else -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); -#endif - -#if defined(HAVE_SNPRINTF) && !(defined(__WATCOMC__) || defined(_WIN32)) -#define SDL_snprintf snprintf -#else -extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); -#endif - -#if defined(HAVE_VSNPRINTF) && !(defined(__WATCOMC__) || defined(_WIN32)) -#define SDL_vsnprintf vsnprintf -#else -extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); -#endif - -/** @name SDL_ICONV Error Codes - * The SDL implementation of iconv() returns these error codes - */ -/*@{*/ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 -/*@}*/ - -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -#define SDL_iconv_t iconv_t -#define SDL_iconv_open iconv_open -#define SDL_iconv_close iconv_close -#else -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -#endif -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -/** This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. - */ -extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_stdinc_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_syswm.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_syswm.h deleted file mode 100644 index 40845b64..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_syswm.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_syswm.h - * Include file for SDL custom system window manager hooks - */ - -#ifndef _SDL_syswm_h -#define _SDL_syswm_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_version.h" - -#ifndef SDL_PROTOTYPES_ONLY -# if defined(SDL_VIDEO_DRIVER_X11) -# if defined(__APPLE__) && defined(__MACH__) -# define Cursor X11Cursor /* conflicts with Quickdraw.h */ -# endif -# include <X11/Xlib.h> -# include <X11/Xatom.h> -# if defined(__APPLE__) && defined(__MACH__) -# undef Cursor -# endif -# elif defined(SDL_VIDEO_DRIVER_NANOX) -# include <microwin/nano-X.h> -# elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include <windows.h> -# elif defined(SDL_VIDEO_DRIVER_PHOTON) -# include <sys/neutrino.h> -# include <Ph.h> -# endif -#endif - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @file SDL_syswm.h - * Your application has access to a special type of event 'SDL_SYSWMEVENT', - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState() - */ -struct SDL_SysWMinfo; -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - -#ifndef SDL_PROTOTYPES_ONLY - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) - -/** These are the various supported subsystems under UNIX */ -typedef enum { - SDL_SYSWM_X11 -} SDL_SYSWM_TYPE; - -/** The UNIX custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union { - XEvent xevent; - } event; -}; - -/** The UNIX custom window manager information structure. - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo { - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union { - struct { - Display *display; /**< The X11 display */ - Window window; /**< The X11 display window */ - /** These locking functions should be called around - * any X11 functions using the display variable, - * but not the gfxdisplay variable. - * They lock the event thread, so should not be - * called around event functions or from event filters. - */ - /*@{*/ - void (*lock_func)(void); - void (*unlock_func)(void); - /*@}*/ - - /** @name Introduced in SDL 1.0.2 */ - /*@{*/ - Window fswindow; /**< The X11 fullscreen window */ - Window wmwindow; /**< The X11 managed input window */ - /*@}*/ - - /** @name Introduced in SDL 1.2.12 */ - /*@{*/ - Display *gfxdisplay; /**< The X11 display to which rendering is done */ - /*@}*/ - } x11; - } info; -}; - -#elif defined(SDL_VIDEO_DRIVER_NANOX) - -/** The generic custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The windows custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version ; - GR_WINDOW_ID window ; /* The display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) - -/** The windows custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ -}; - -/** The windows custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - HWND window; /**< The Win32 display window */ - HGLRC hglrc; /**< The OpenGL context, if any */ -}; - -#elif defined(SDL_VIDEO_DRIVER_RISCOS) - -/** RISC OS custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int eventCode; /**< The window for the message */ - int pollBlock[64]; -}; - -/** The RISC OS custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - int wimpVersion; /**< Wimp version running under */ - int taskHandle; /**< The RISC OS task handle */ - int window; /**< The RISC OS display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_PHOTON) - -/** The QNX custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The QNX custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - int data; -}; - -#else - -/** The generic custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The generic custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - int data; -}; - -#endif /* video driver type */ - -#endif /* SDL_PROTOTYPES_ONLY */ - -/* Function prototypes */ -/** - * This function gives you custom hooks into the window manager information. - * It fills the structure pointed to by 'info' with custom information and - * returns 0 if the function is not implemented, 1 if the function is - * implemented and no error occurred, and -1 if the version member of - * the 'info' structure is not filled in or not supported. - * - * You typically use this function like this: - * @code - * SDL_SysWMinfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWMInfo(&info) ) { ... } - * @endcode - */ -extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_syswm_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_thread.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_thread.h deleted file mode 100644 index b7d5a917..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_thread.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_thread_h -#define _SDL_thread_h - -/** @file SDL_thread.h - * Header for the SDL thread management routines - * - * @note These are independent of the other SDL routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_mutex.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/** Create a thread */ -#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) -/** - * We compile SDL into a DLL on OS/2. This means, that it's the DLL which - * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL.DLL will - * be initialized for those threads, and not the RTL of the calling application! - * To solve this, we make a little hack here. - * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL.DLL which uses this API, - * then the RTL of SDL.DLL will be used to create the new thread, and if it's - * the application, then the RTL of the application will be used. - * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime library! - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef _WIN32_WCE -#include <process.h> /* This has _beginthread() and _endthread() defined! */ -#endif -#ifdef __EMX__ -#include <stdlib.h> -#endif - -#ifdef __OS2__ -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); -typedef void (*pfnSDL_CurrentEndThread)(void); -#else -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#endif - -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); - -#ifdef __OS2__ -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) -#elif defined(_WIN32_WCE) -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) -#else -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) -#endif -#else -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); -#endif - -/** Get the 32-bit thread identifier for the current thread */ -extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); - -/** Get the 32-bit thread identifier for the specified thread, - * equivalent to SDL_ThreadID() if the specified thread is NULL. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); - -/** Wait for a thread to finish. - * The return code for the thread function is placed in the area - * pointed to by 'status', if 'status' is not NULL. - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); - -/** Forcefully kill a thread without worrying about its state */ -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_thread_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_timer.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_timer.h deleted file mode 100644 index d764d5f3..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_timer.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_timer_h -#define _SDL_timer_h - -/** @file SDL_timer.h - * Header for the SDL time management routines - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the OS scheduler timeslice, in milliseconds */ -#define SDL_TIMESLICE 10 - -/** This is the maximum resolution of the SDL timer on all platforms */ -#define TIMER_RESOLUTION 10 /**< Experimentally determined */ - -/** - * Get the number of milliseconds since the SDL library initialization. - * Note that this value wraps if the program runs for more than ~49 days. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/** Wait a specified number of milliseconds before returning */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** Function prototype for the timer callback function */ -typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); - -/** - * Set a callback to run after the specified number of milliseconds has - * elapsed. The callback function is passed the current timer interval - * and returns the next timer interval. If the returned value is the - * same as the one passed in, the periodic alarm continues, otherwise a - * new alarm is scheduled. If the callback returns 0, the periodic alarm - * is cancelled. - * - * To cancel a currently running timer, call SDL_SetTimer(0, NULL); - * - * The timer callback function may run in a different thread than your - * main code, and so shouldn't call any functions from within itself. - * - * The maximum resolution of this timer is 10 ms, which means that if - * you request a 16 ms timer, your callback will run approximately 20 ms - * later on an unloaded system. If you wanted to set a flag signaling - * a frame update at 30 frames per second (every 33 ms), you might set a - * timer for 30 ms: - * @code SDL_SetTimer((33/10)*10, flag_update); @endcode - * - * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). - * - * Under UNIX, you should not use raise or use SIGALRM and this function - * in the same program, as it is implemented using setitimer(). You also - * should not use this function in multi-threaded applications as signals - * to multi-threaded apps have undefined behavior in some implementations. - * - * This function returns 0 if successful, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); - -/** @name New timer API - * New timer API, supports multiple timers - * Written by Stephane Peter <megastep@lokigames.com> - */ -/*@{*/ - -/** - * Function prototype for the new timer callback function. - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); - -/** Definition of the timer ID type */ -typedef struct _SDL_TimerID *SDL_TimerID; - -/** Add a new timer to the pool of timers already running. - * Returns a timer ID, or NULL when an error occurs. - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); - -/** - * Remove one of the multiple timers knowing its ID. - * Returns a boolean value indicating success. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); - -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_timer_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_types.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_types.h deleted file mode 100644 index 79d8b28d..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_types.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_types.h - * @deprecated Use SDL_stdinc.h instead. - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_version.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_version.h deleted file mode 100644 index 4385ebf0..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_version.h - * This header defines the current SDL version - */ - -#ifndef _SDL_version_h -#define _SDL_version_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name Version Number - * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL - */ -/*@{*/ -#define SDL_MAJOR_VERSION 1 -#define SDL_MINOR_VERSION 2 -#define SDL_PATCHLEVEL 16 -/*@}*/ - -typedef struct SDL_version { - Uint8 major; - Uint8 minor; - Uint8 patch; -} SDL_version; - -/** - * This macro can be used to fill a version structure with the compile-time - * version of the SDL library. - */ -#define SDL_VERSION(X) \ -{ \ - (X)->major = SDL_MAJOR_VERSION; \ - (X)->minor = SDL_MINOR_VERSION; \ - (X)->patch = SDL_PATCHLEVEL; \ -} - -/** This macro turns the version numbers into a numeric value: - * (1,2,3) -> (1203) - * This assumes that there will never be more than 100 patchlevels - */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/** This is the version number macro for the current SDL version */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) - -/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) - -/** This function gets the version of the dynamically linked SDL library. - * it should NOT be used to fill a version structure, instead you should - * use the SDL_Version() macro. - */ -extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_version_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h deleted file mode 100644 index f9c4e070..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h +++ /dev/null @@ -1,951 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_video.h - * Header file for access to the SDL raw framebuffer window - */ - -#ifndef _SDL_video_h -#define _SDL_video_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name Transparency definitions - * These define alpha as the opacity of a surface - */ -/*@{*/ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/*@}*/ - -/** @name Useful data types */ -/*@{*/ -typedef struct SDL_Rect { - Sint16 x, y; - Uint16 w, h; -} SDL_Rect; - -typedef struct SDL_Color { - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 unused; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette { - int ncolors; - SDL_Color *colors; -} SDL_Palette; -/*@}*/ - -/** Everything in the pixel format structure is read-only */ -typedef struct SDL_PixelFormat { - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - - /** RGB color key information */ - Uint32 colorkey; - /** Alpha value information (per-surface alpha) */ - Uint8 alpha; -} SDL_PixelFormat; - -/** This structure should be treated as read-only, except for 'pixels', - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface { - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - Uint16 pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - int offset; /**< Private */ - - /** Hardware-specific surface info */ - struct private_hwdata *hwdata; - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - Uint32 unused1; /**< for binary compatibility */ - - /** Allow recursive locks */ - Uint32 locked; /**< Private */ - - /** info for fast blit mapping to other surfaces */ - struct SDL_BlitMap *map; /**< Private */ - - /** format version, bumped at every change to invalidate blit maps */ - unsigned int format_version; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** @name SDL_Surface Flags - * These are the currently supported flags for the SDL_surface - */ -/*@{*/ - -/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ -/*@{*/ -#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ -#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ -#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ -/*@}*/ - -/** Available for SDL_SetVideoMode() */ -/*@{*/ -#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ -#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ -#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ -#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ -#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ -#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ -#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ -#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ -/*@}*/ - -/** Used internally (read-only) */ -/*@{*/ -#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ -#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ -#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ -#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ -#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ -#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ -/*@}*/ - -/*@}*/ - -/** Evaluates to true if the surface needs to be locked before access */ -#define SDL_MUSTLOCK(surface) \ - (surface->offset || \ - ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) - -/** typedef for private surface blitting functions */ -typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, - struct SDL_Surface *dst, SDL_Rect *dstrect); - - -/** Useful for determining the video hardware capabilities */ -typedef struct SDL_VideoInfo { - Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ - Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ - Uint32 UnusedBits1 :6; - Uint32 UnusedBits2 :1; - Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ - Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ - Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ - Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ - Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ - Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ - Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ - Uint32 UnusedBits3 :16; - Uint32 video_mem; /**< The total amount of video memory (in K) */ - SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ - int current_w; /**< Value: The current video mode width */ - int current_h; /**< Value: The current video mode height */ -} SDL_VideoInfo; - - -/** @name Overlay Formats - * The most common video overlay formats. - * For an explanation of these pixel formats, see: - * http://www.webartz.com/fourcc/indexyuv.htm - * - * For information on the relationship between color spaces, see: - * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html - */ -/*@{*/ -#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ -#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ -#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ -#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ -#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ -/*@}*/ - -/** The YUV hardware video overlay */ -typedef struct SDL_Overlay { - Uint32 format; /**< Read-only */ - int w, h; /**< Read-only */ - int planes; /**< Read-only */ - Uint16 *pitches; /**< Read-only */ - Uint8 **pixels; /**< Read-write */ - - /** @name Hardware-specific surface info */ - /*@{*/ - struct private_yuvhwfuncs *hwfuncs; - struct private_yuvhwdata *hwdata; - /*@{*/ - - /** @name Special flags */ - /*@{*/ - Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ - Uint32 UnusedBits :31; - /*@}*/ -} SDL_Overlay; - - -/** Public enumeration for setting the OpenGL window attributes. */ -typedef enum { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_SWAP_CONTROL -} SDL_GLattr; - -/** @name flags for SDL_SetPalette() */ -/*@{*/ -#define SDL_LOGPAL 0x01 -#define SDL_PHYSPAL 0x02 -/*@}*/ - -/* Function prototypes */ - -/** - * @name Video Init and Quit - * These functions are used internally, and should not be used unless you - * have a specific need to specify the video driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/*@{*/ -/** - * Initializes the video subsystem. Sets up a connection - * to the window manager, etc, and determines the current video mode and - * pixel format, but does not initialize a window or graphics mode. - * Note that event handling is activated by this routine. - * - * If you use both sound and video in your application, you need to call - * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, - * you won't be able to set full-screen display modes. - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); -/*@}*/ - -/** - * This function fills the given character buffer with the name of the - * video driver, and returns a pointer to it if the video driver has - * been initialized. It returns NULL if no driver has been initialized. - */ -extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); - -/** - * This function returns a pointer to the current display surface. - * If SDL is doing format conversion on the display surface, this - * function returns the publicly visible surface, not the real video - * surface. - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); - -/** - * This function returns a read-only pointer to information about the - * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' - * member of the returned structure will contain the pixel format of the - * "best" video mode. - */ -extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); - -/** - * Check to see if a particular video mode is supported. - * It returns 0 if the requested mode is not supported under any bit depth, - * or returns the bits-per-pixel of the closest available mode with the - * given width and height. If this bits-per-pixel is different from the - * one used when setting the video mode, SDL_SetVideoMode() will succeed, - * but will emulate the requested bits-per-pixel with a shadow surface. - * - * The arguments to SDL_VideoModeOK() are the same ones you would pass to - * SDL_SetVideoMode() - */ -extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); - -/** - * Return a pointer to an array of available screen dimensions for the - * given format and video flags, sorted largest to smallest. Returns - * NULL if there are no dimensions available for a particular format, - * or (SDL_Rect **)-1 if any dimension is okay for the given format. - * - * If 'format' is NULL, the mode list will be for the format given - * by SDL_GetVideoInfo()->vfmt - */ -extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); - -/** - * Set up a video mode with the specified width, height and bits-per-pixel. - * - * If 'bpp' is 0, it is treated as the current display bits per pixel. - * - * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the - * requested bits-per-pixel, but will return whatever video pixel format is - * available. The default is to emulate the requested pixel format if it - * is not natively available. - * - * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in - * video memory, if possible, and you may have to call SDL_LockSurface() - * in order to access the raw framebuffer. Otherwise, the video surface - * will be created in system memory. - * - * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle - * updates asynchronously, but you must always lock before accessing pixels. - * SDL will wait for updates to complete before returning from the lock. - * - * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee - * that the colors set by SDL_SetColors() will be the colors you get. - * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all - * of the colors exactly the way they are requested, and you should look - * at the video surface structure to determine the actual palette. - * If SDL cannot guarantee that the colors you request can be set, - * i.e. if the colormap is shared, then the video surface may be created - * under emulation in system memory, overriding the SDL_HWSURFACE flag. - * - * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set - * a fullscreen video mode. The default is to create a windowed mode - * if the current graphics system has a window manager. - * If the SDL library is able to set a fullscreen video mode, this flag - * will be set in the surface that is returned. - * - * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up - * two surfaces in video memory and swap between them when you call - * SDL_Flip(). This is usually slower than the normal single-buffering - * scheme, but prevents "tearing" artifacts caused by modifying video - * memory while the monitor is refreshing. It should only be used by - * applications that redraw the entire screen on every update. - * - * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the - * window manager, if any, to resize the window at runtime. When this - * occurs, SDL will send a SDL_VIDEORESIZE event to you application, - * and you must respond to the event by re-calling SDL_SetVideoMode() - * with the requested size (or another size that suits the application). - * - * If SDL_NOFRAME is set in 'flags', the SDL library will create a window - * without any title bar or frame decoration. Fullscreen video modes have - * this flag set automatically. - * - * This function returns the video framebuffer surface, or NULL if it fails. - * - * If you rely on functionality provided by certain video flags, check the - * flags of the returned surface to make sure that functionality is available. - * SDL will fall back to reduced functionality if the exact flags you wanted - * are not available. - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode - (int width, int height, int bpp, Uint32 flags); - -/** @name SDL_Update Functions - * These functions should not be called while 'screen' is locked. - */ -/*@{*/ -/** - * Makes sure the given list of rectangles is updated on the given screen. - */ -extern DECLSPEC void SDLCALL SDL_UpdateRects - (SDL_Surface *screen, int numrects, SDL_Rect *rects); -/** - * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire - * screen. - */ -extern DECLSPEC void SDLCALL SDL_UpdateRect - (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); -/*@}*/ - -/** - * On hardware that supports double-buffering, this function sets up a flip - * and returns. The hardware will wait for vertical retrace, and then swap - * video buffers before the next video surface blit or lock will return. - * On hardware that doesn not support double-buffering, this is equivalent - * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); - * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when - * setting the video mode for this function to perform hardware flipping. - * This function returns 0 if successful, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); - -/** - * Set the gamma correction for each of the color channels. - * The gamma values range (approximately) between 0.1 and 10.0 - * - * If this function isn't supported directly by the hardware, it will - * be emulated using gamma ramps, if available. If successful, this - * function returns 0, otherwise it returns -1. - */ -extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); - -/** - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * You may pass NULL for any of the channels to leave it unchanged. - * If the call succeeds, it will return 0. If the display driver or - * hardware does not support gamma translation, or otherwise fails, - * this function will return -1. - */ -extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); - -/** - * Retrieve the current values of the gamma translation tables. - * - * You must pass in valid pointers to arrays of 256 16-bit quantities. - * Any of the pointers may be NULL to ignore that channel. - * If the call succeeds, it will return 0. If the display driver or - * hardware does not support gamma translation, or otherwise fails, - * this function will return -1. - */ -extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); - -/** - * Sets a portion of the colormap for the given 8-bit surface. If 'surface' - * is not a palettized surface, this function does nothing, returning 0. - * If all of the colors were set as passed to SDL_SetColors(), it will - * return 1. If not all the color entries were set exactly as given, - * it will return 0, and you should look at the surface palette to - * determine the actual color palette. - * - * When 'surface' is the surface associated with the current display, the - * display colormap will be updated with the requested colors. If - * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() - * will always return 1, and the palette is guaranteed to be set the way - * you desire, even if the window colormap has to be warped or run under - * emulation. - */ -extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, - SDL_Color *colors, int firstcolor, int ncolors); - -/** - * Sets a portion of the colormap for a given 8-bit surface. - * 'flags' is one or both of: - * SDL_LOGPAL -- set logical palette, which controls how blits are mapped - * to/from the surface, - * SDL_PHYSPAL -- set physical palette, which controls how pixels look on - * the screen - * Only screens have physical palettes. Separate change of physical/logical - * palettes is only possible if the screen has SDL_HWPALETTE set. - * - * The return value is 1 if all colours could be set as requested, and 0 - * otherwise. - * - * SDL_SetColors() is equivalent to calling this function with - * flags = (SDL_LOGPAL|SDL_PHYSPAL). - */ -extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, - SDL_Color *colors, int firstcolor, - int ncolors); - -/** - * Maps an RGB triple to an opaque pixel value for a given pixel format - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b); - -/** - * Maps an RGBA quadruple to a pixel value for a given pixel format - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); - -/** - * Maps a pixel value into the RGB components for a given pixel format - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b); - -/** - * Maps a pixel value into the RGBA components for a given pixel format - */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); - -/** @sa SDL_CreateRGBSurface */ -#define SDL_AllocSurface SDL_CreateRGBSurface -/** - * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * If the function runs out of memory, it will return NULL. - * - * The 'flags' tell what kind of surface to create. - * SDL_SWSURFACE means that the surface should be created in system memory. - * SDL_HWSURFACE means that the surface should be created in video memory, - * with the same format as the display surface. This is useful for surfaces - * that will not change much, to take advantage of hardware acceleration - * when being blitted to the display surface. - * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with - * this surface, but you must always lock it before accessing the pixels. - * SDL will wait for current blits to finish before returning from the lock. - * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. - * If the hardware supports acceleration of colorkey blits between - * two surfaces in video memory, SDL will try to place the surface in - * video memory. If this isn't possible or if there is no hardware - * acceleration available, the surface will be placed in system memory. - * SDL_SRCALPHA means that the surface will be used for alpha blits and - * if the hardware supports hardware acceleration of alpha blits between - * two surfaces in video memory, to place the surface in video memory - * if possible, otherwise it will be placed in system memory. - * If the surface is created in video memory, blits will be _much_ faster, - * but the surface format must be identical to the video surface format, - * and the only way to access the pixels member of the surface is to use - * the SDL_LockSurface() and SDL_UnlockSurface() calls. - * If the requested surface actually resides in video memory, SDL_HWSURFACE - * will be set in the flags member of the returned surface. If for some - * reason the surface could not be placed in video memory, it will not have - * the SDL_HWSURFACE flag set, and will be created in system memory instead. - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -/** @sa SDL_CreateRGBSurface */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, int height, int depth, int pitch, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); - -/** - * SDL_LockSurface() sets up a surface for directly accessing the pixels. - * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write - * to and read from 'surface->pixels', using the pixel format stored in - * 'surface->format'. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. In particular, if the - * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you - * will not need to lock the display surface before accessing it. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. - * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. - */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); - -/** - * Load a surface from a seekable SDL data source (memory or file.) - * If 'freesrc' is non-zero, the source will be closed after being read. - * Returns the new surface, or NULL if there was an error. - * The new surface should be freed with SDL_FreeSurface(). - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); - -/** Convenience macro -- load a surface from a file */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Save a surface to a seekable SDL data source (memory or file.) - * If 'freedst' is non-zero, the source will be closed after being written. - * Returns 0 if successful or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface *surface, SDL_RWops *dst, int freedst); - -/** Convenience macro -- save a surface to a file */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * Sets the color key (transparent pixel) in a blittable surface. - * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), - * 'key' will be the transparent pixel in the source image of a blit. - * SDL_RLEACCEL requests RLE acceleration for the surface if present, - * and removes RLE acceleration if absent. - * If 'flag' is 0, this function clears any current color key. - * This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey - (SDL_Surface *surface, Uint32 flag, Uint32 key); - -/** - * This function sets the alpha value for the entire surface, as opposed to - * using the alpha component of each pixel. This value measures the range - * of transparency of the surface, 0 being completely transparent to 255 - * being completely opaque. An 'alpha' value of 255 causes blits to be - * opaque, the source pixels copied to the destination (the default). Note - * that per-surface alpha can be combined with colorkey transparency. - * - * If 'flag' is 0, alpha blending is disabled for the surface. - * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. - * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the - * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. - * - * The 'alpha' parameter is ignored for surfaces that have an alpha channel. - */ -extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); - -/** - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); - -/** - * Gets the clipping rectangle for the destination surface in a blit. - * 'rect' must be a pointer to a valid rectangle which will be filled - * with the correct values. - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); - -/** - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - * - * This function is used internally by SDL_DisplayFormat(). - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface - (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); - -/** - * This performs a fast blit from the source surface to the destination - * surface. It assumes that the source and destination rectangles are - * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire - * surface (src or dst) is copied. The final blit rectangles are saved - * in 'srcrect' and 'dstrect' after all clipping is performed. - * If the blit is successful, it returns 0, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without alpha and colorkey - * are defined as follows: - * - * RGBA->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using alpha-channel). - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy RGB. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value); - * set destination alpha to opaque. - * SDL_SRCALPHA not set: - * copy RGB, set destination alpha to source per-surface alpha value. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * RGBA->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source alpha channel) the RGB values; - * leave destination alpha untouched. [Note: is this correct?] - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy all of RGBA to the destination. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value). - * SDL_SRCALPHA not set: - * copy RGB. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * If either of the surfaces were in video memory, and the blit returns -2, - * the video memory was lost, so it should be reloaded with artwork and - * re-blitted: - * @code - * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { - * while ( SDL_LockSurface(image) < 0 ) - * Sleep(10); - * -- Write image pixels to image->pixels -- - * SDL_UnlockSurface(image); - * } - * @endcode - * - * This happens under DirectX 5.0 when the system switches away from your - * fullscreen application. The lock will also fail until you have access - * to the video memory again. - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. - */ -#define SDL_BlitSurface SDL_UpperBlit - -/** This is the public blit function, SDL_BlitSurface(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlit() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); -/** This is a semi-private blit function and it performs low-level surface - * blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - -/** - * This function performs a fast fill of the given rectangle with 'color' - * The given rectangle is clipped to the destination surface clip area - * and the final fill rectangle is saved in the passed in pointer. - * If 'dstrect' is NULL, the whole surface will be filled with 'color' - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); - -/** - * This function takes a surface and copies it to a new surface of the - * pixel format and colors of the video framebuffer, suitable for fast - * blitting onto the display surface. It calls SDL_ConvertSurface() - * - * If you want to take advantage of hardware colorkey or alpha blit - * acceleration, you should set the colorkey and alpha value before - * calling this function. - * - * If the conversion fails or runs out of memory, it returns NULL - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); - -/** - * This function takes a surface and copies it to a new surface of the - * pixel format and colors of the video framebuffer (if possible), - * suitable for fast alpha blitting onto the display surface. - * The new surface will always have an alpha channel. - * - * If you want to take advantage of hardware colorkey or alpha blit - * acceleration, you should set the colorkey and alpha value before - * calling this function. - * - * If the conversion fails or runs out of memory, it returns NULL - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name YUV video surface overlay functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** This function creates a video output overlay - * Calling the returned surface an overlay is something of a misnomer because - * the contents of the display surface underneath the area where the overlay - * is shown is undefined - it may be overwritten with the converted YUV data. - */ -extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, - Uint32 format, SDL_Surface *display); - -/** Lock an overlay for direct access, and unlock it when you are done */ -extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); -extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); - -/** Blit a video overlay to the display surface. - * The contents of the video surface underneath the blit destination are - * not defined. - * The width and height of the destination rectangle may be different from - * that of the overlay, but currently only 2x scaling is supported. - */ -extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); - -/** Free a video overlay */ -extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name OpenGL support functions. */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** - * Dynamically load an OpenGL library, or the default one if path is NULL - * - * If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * Get the address of a GL function - */ -extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); - -/** - * Set an attribute of the OpenGL subsystem before intialization. - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * Get an attribute of the OpenGL subsystem from the windowing - * interface, such as glX. This is of course different from getting - * the values from SDL's internal OpenGL subsystem, which only - * stores the values you request before initialization. - * - * Developers should track the values they pass into SDL_GL_SetAttribute - * themselves if they want to retrieve these values. - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); - -/** - * Swap the OpenGL buffers, if double-buffering is supported. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); - -/** @name OpenGL Internal Functions - * Internal functions that should not be called unless you have read - * and understood the source code for these functions. - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); -extern DECLSPEC void SDLCALL SDL_GL_Lock(void); -extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); -/*@}*/ - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Window Manager Functions */ -/** These functions allow interaction with the window manager, if any. */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** - * Sets the title and icon text of the display window (UTF-8 encoded) - */ -extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); -/** - * Gets the title and icon text of the display window (UTF-8 encoded) - */ -extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); - -/** - * Sets the icon for the display window. - * This function must be called before the first call to SDL_SetVideoMode(). - * It takes an icon surface, and a mask in MSB format. - * If 'mask' is NULL, the entire icon surface will be used as the icon. - */ -extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); - -/** - * This function iconifies the window, and returns 1 if it succeeded. - * If the function succeeds, it generates an SDL_APPACTIVE loss event. - * This function is a noop and returns 0 in non-windowed environments. - */ -extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); - -/** - * Toggle fullscreen mode without changing the contents of the screen. - * If the display surface does not require locking before accessing - * the pixel information, then the memory pointers will not change. - * - * If this function was able to toggle fullscreen mode (change from - * running in a window to fullscreen, or vice-versa), it will return 1. - * If it is not implemented, or fails, it returns 0. - * - * The next call to SDL_SetVideoMode() will set the mode fullscreen - * attribute based on the flags parameter - if SDL_FULLSCREEN is not - * set, then the display will be windowed by default where supported. - * - * This is currently only implemented in the X11 video driver. - */ -extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); - -typedef enum { - SDL_GRAB_QUERY = -1, - SDL_GRAB_OFF = 0, - SDL_GRAB_ON = 1, - SDL_GRAB_FULLSCREEN /**< Used internally */ -} SDL_GrabMode; -/** - * This function allows you to set and query the input grab state of - * the application. It returns the new input grab state. - * - * Grabbing means that the mouse is confined to the application window, - * and nearly all keyboard input is passed directly to the application, - * and not interpreted by a window manager, if any. - */ -extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); - -/*@}*/ - -/** @internal Not in public API at the moment - do not use! */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/begin_code.h b/MacOSX/SDL.framework/Versions/A/Headers/begin_code.h deleted file mode 100644 index 1c8a2a03..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/begin_code.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file begin_code.h - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) - */ - -/** - * @file begin_code.h - * This shouldn't be nested -- included it around code only. - */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -/** - * @def DECLSPEC - * Some compilers use a special export keyword - */ -#ifndef DECLSPEC -# if defined(__BEOS__) || defined(__HAIKU__) -# if defined(__GNUC__) -# define DECLSPEC -# else -# define DECLSPEC __declspec(export) -# endif -# elif defined(__WIN32__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# elif defined(__OS2__) -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/** - * @def SDLCALL - * By default SDL uses the C calling convention - */ -#ifndef SDLCALL -# if defined(__WIN32__) && !defined(__GNUC__) -# define SDLCALL __cdecl -# elif defined(__OS2__) - /* But on OS/2, we use the _System calling convention */ - /* to be compatible with every compiler */ -# if defined (__GNUC__) && !defined(_System) -# define _System /* For compatibility with old GCC/EMX */ -# endif -# define SDLCALL _System -# else -# define SDLCALL -# endif -#endif /* SDLCALL */ - -#ifdef __SYMBIAN32__ -#ifndef EKA2 -#undef DECLSPEC -#define DECLSPEC -#elif !defined(__WINS__) -#undef DECLSPEC -#define DECLSPEC __declspec(dllexport) -#endif /* !EKA2 */ -#endif /* __SYMBIAN32__ */ - -/** - * @file begin_code.h - * Force structure packing at 4 byte alignment. - * This is necessary if the header is included in code which has structure - * packing set to an alternate value, say for loading structures from disk. - * The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#ifdef _M_X64 -/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ -#pragma pack(push,8) -#else -#pragma pack(push,4) -#endif -#elif (defined(__MWERKS__) && defined(__MACOS__)) -#pragma options align=mac68k4byte -#pragma enumsalwaysint on -#endif /* Compiler needs structure packing set */ - -/** - * @def SDL_INLINE_OKAY - * Set up compiler-specific options for inlining functions - */ -#ifndef SDL_INLINE_OKAY -#ifdef __GNUC__ -#define SDL_INLINE_OKAY -#else -/* Add any special compiler-specific cases here */ -#if defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) || defined(__EABI__) -#ifndef __inline__ -#define __inline__ __inline -#endif -#define SDL_INLINE_OKAY -#else -#if !defined(__MRC__) && !defined(_SGI_SOURCE) -#ifndef __inline__ -#define __inline__ inline -#endif -#define SDL_INLINE_OKAY -#endif /* Not a funky compiler */ -#endif /* Visual C++ */ -#endif /* GNU C */ -#endif /* SDL_INLINE_OKAY */ - -/** - * @def __inline__ - * If inlining isn't supported, remove "__inline__", turning static - * inlined functions into static functions (resulting in code bloat - * in all files which include the offending header files) - */ -#ifndef SDL_INLINE_OKAY -#define __inline__ -#endif - -/** - * @def NULL - * Apparently this is needed by several Windows compilers - */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/close_code.h b/MacOSX/SDL.framework/Versions/A/Headers/close_code.h deleted file mode 100644 index 7a97d88e..00000000 --- a/MacOSX/SDL.framework/Versions/A/Headers/close_code.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file close_code.h - * This file reverses the effects of begin_code.h and should be included - * after you finish any function and structure declarations in your headers - */ - -#ifndef _begin_code_h -#error close_code.h included without matching begin_code.h -#endif -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#if (defined(__MWERKS__) && defined(__MACOS__)) -#pragma options align=reset -#pragma enumsalwaysint reset -#else -#pragma pack(pop) -#endif -#endif /* Compiler needs structure packing set */ diff --git a/MacOSX/SDL.framework/Versions/A/Resources/Info.plist b/MacOSX/SDL.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index 179cf4f0..00000000 --- a/MacOSX/SDL.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>BuildMachineOSBuild</key> - <string>11C74</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>SDL</string> - <key>CFBundleGetInfoString</key> - <string>http://www.libsdl.org</string> - <key>CFBundleIdentifier</key> - <string>SDL</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>Simple DirectMedia Layer</string> - <key>CFBundlePackageType</key> - <string>FMWK</string> - <key>CFBundleShortVersionString</key> - <string>1.2.16</string> - <key>CFBundleSignature</key> - <string>SDLX</string> - <key>CFBundleVersion</key> - <string>1.2.16</string> - <key>DTCompiler</key> - <string></string> - <key>DTPlatformBuild</key> - <string>10M2518</string> - <key>DTPlatformVersion</key> - <string>PG</string> - <key>DTSDKBuild</key> - <string>10M2518</string> - <key>DTSDKName</key> - <string>macosx10.6</string> - <key>DTXcode</key> - <string>0400</string> - <key>DTXcodeBuild</key> - <string>10M2518</string> -</dict> -</plist> diff --git a/MacOSX/SDL.framework/Versions/A/Resources/SDLMain.nib/objects.nib b/MacOSX/SDL.framework/Versions/A/Resources/SDLMain.nib/objects.nib deleted file mode 100644 index 9f697b0e..00000000 Binary files a/MacOSX/SDL.framework/Versions/A/Resources/SDLMain.nib/objects.nib and /dev/null differ diff --git a/MacOSX/SDL.framework/Versions/A/SDL b/MacOSX/SDL.framework/Versions/A/SDL deleted file mode 100644 index d6362e80..00000000 Binary files a/MacOSX/SDL.framework/Versions/A/SDL and /dev/null differ diff --git a/MacOSX/SDL.framework/Versions/A/devel-lite/ReadMeDevLite.txt b/MacOSX/SDL.framework/Versions/A/devel-lite/ReadMeDevLite.txt deleted file mode 100644 index d2cd793c..00000000 --- a/MacOSX/SDL.framework/Versions/A/devel-lite/ReadMeDevLite.txt +++ /dev/null @@ -1,12 +0,0 @@ -This directory is for developers. This directory contains some basic essentials you will need for developing SDL based applications on OS X. The SDL-devel package contains all of this stuff plus more, so you can ignore this if you install the SDL-devel.pkg. The SDL-devel package contains Xcode templates, SDL documentation, and different variations of SDLmain and NIB files for SDL. - -To compile an SDL based application on OS X, SDLMain.m must be compiled into your program. (See the SDL FAQ). The SDL-devel.pkg includes Xcode templates which already do this for you. But for those who may not want to install the dev package, an SDLMain is provided here as a convenience. Be aware that there are different variations of SDLMain.m depending on what class of SDL application you make and they are intended to work with NIB files. Only one SDLMain variant is provided here and without any NIB files. You should look to the SDL-devel package for the others. We currently do not provide a SDLMain.a file, partly to call to attention that there are different variations of SDLmain. - -To build from the command line, your gcc line will look something like this: - -gcc -I/Library/Frameworks/SDL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa - -An SDL/OpenGL based application might look like: - -gcc -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa -framework OpenGL - diff --git a/MacOSX/SDL.framework/Versions/A/devel-lite/SDLMain.h b/MacOSX/SDL.framework/Versions/A/devel-lite/SDLMain.h deleted file mode 100644 index c56d90cb..00000000 --- a/MacOSX/SDL.framework/Versions/A/devel-lite/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser <dwaliss1@purdue.edu> - Non-NIB-Code & other changes: Max Horn <max@quendi.de> - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import <Cocoa/Cocoa.h> - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/MacOSX/SDL.framework/Versions/A/devel-lite/SDLMain.m b/MacOSX/SDL.framework/Versions/A/devel-lite/SDLMain.m deleted file mode 100644 index 07d392ee..00000000 --- a/MacOSX/SDL.framework/Versions/A/devel-lite/SDLMain.m +++ /dev/null @@ -1,402 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser <dwaliss1@purdue.edu> - Non-NIB-Code & other changes: Max Horn <max@quendi.de> - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include <sys/param.h> /* for MAXPATHLEN */ -#include <unistd.h> - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface NSApplication (SDLApplication) -@end - -@implementation NSApplication (SDLApplication) -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [NSApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [NSApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -static int IsRootCwd() -{ - char buf[MAXPATHLEN]; - char *cwd = getcwd(buf, sizeof (buf)); - return (cwd && (strcmp(cwd, "/") == 0)); -} - -static int IsFinderLaunch(const int argc, char **argv) -{ - /* -psn_XXX is passed if we are launched from Finder, SOMETIMES */ - if ( (argc >= 2) && (strncmp(argv[1], "-psn", 4) == 0) ) { - return 1; - } else if ((argc == 1) && IsRootCwd()) { - /* we might still be launched from the Finder; on 10.9+, you might not - get the -psn command line anymore. If there's no - command line, and if our current working directory is "/", it - might as well be a Finder launch. */ - return 1; - } - return 0; /* not a Finder launch. */ -} - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - if (IsFinderLaunch(argc, argv)) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/MacOSX/SDL.framework/Versions/Current b/MacOSX/SDL.framework/Versions/Current deleted file mode 100644 index e69de29b..00000000 diff --git a/MacOSX/SDL2.framework/Headers b/MacOSX/SDL2.framework/Headers deleted file mode 100644 index a177d2a6..00000000 --- a/MacOSX/SDL2.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/MacOSX/SDL2.framework/Resources b/MacOSX/SDL2.framework/Resources deleted file mode 100644 index 953ee36f..00000000 --- a/MacOSX/SDL2.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/MacOSX/SDL2.framework/SDL2 b/MacOSX/SDL2.framework/SDL2 deleted file mode 100644 index 9dd4e4fb..00000000 --- a/MacOSX/SDL2.framework/SDL2 +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/SDL2 \ No newline at end of file diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h deleted file mode 100644 index e4329395..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL.h - * - * Main include header for the SDL library - */ - - -#ifndef SDL_h_ -#define SDL_h_ - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_assert.h" -#include "SDL_atomic.h" -#include "SDL_audio.h" -#include "SDL_clipboard.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_filesystem.h" -#include "SDL_gamecontroller.h" -#include "SDL_haptic.h" -#include "SDL_hints.h" -#include "SDL_joystick.h" -#include "SDL_loadso.h" -#include "SDL_log.h" -#include "SDL_messagebox.h" -#include "SDL_metal.h" -#include "SDL_mutex.h" -#include "SDL_power.h" -#include "SDL_render.h" -#include "SDL_rwops.h" -#include "SDL_sensor.h" -#include "SDL_shape.h" -#include "SDL_system.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_version.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* As of version 0.5, SDL is loaded dynamically into the application */ - -/** - * \name SDL_INIT_* - * - * These are the flags which may be passed to SDL_Init(). You should - * specify the subsystems which you will be using in your application. - */ -/* @{ */ -#define SDL_INIT_TIMER 0x00000001u -#define SDL_INIT_AUDIO 0x00000010u -#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ -#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ -#define SDL_INIT_HAPTIC 0x00001000u -#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ -#define SDL_INIT_EVENTS 0x00004000u -#define SDL_INIT_SENSOR 0x00008000u -#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ -#define SDL_INIT_EVERYTHING ( \ - SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ - SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \ - ) -/* @} */ - -/** - * This function initializes the subsystems specified by \c flags - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/** - * This function initializes specific SDL subsystems - * - * Subsystem initialization is ref-counted, you must call - * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly - * shutdown a subsystem manually (or call SDL_Quit() to force shutdown). - * If a subsystem is already loaded then this call will - * increase the ref-count and return. - */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/** - * This function cleans up specific SDL subsystems - */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/** - * This function returns a mask of the specified subsystems which have - * previously been initialized. - * - * If \c flags is 0, it returns a mask of all initialized subsystems. - */ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/** - * This function cleans up all initialized subsystems. You should - * call it upon all exit conditions. - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h deleted file mode 100644 index 8baecb63..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_assert_h_ -#define SDL_assert_h_ - -#include "SDL_config.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef SDL_ASSERT_LEVEL -#ifdef SDL_DEFAULT_ASSERT_LEVEL -#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL -#elif defined(_DEBUG) || defined(DEBUG) || \ - (defined(__GNUC__) && !defined(__OPTIMIZE__)) -#define SDL_ASSERT_LEVEL 2 -#else -#define SDL_ASSERT_LEVEL 1 -#endif -#endif /* SDL_ASSERT_LEVEL */ - -/* -These are macros and not first class functions so that the debugger breaks -on the assertion line and not in some random guts of SDL, and so each -assert can have unique static variables associated with it. -*/ - -#if defined(_MSC_VER) -/* Don't include intrin.h here because it contains C++ code */ - extern void __cdecl __debugbreak(void); - #define SDL_TriggerBreakpoint() __debugbreak() -#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) - #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) -#elif defined(__386__) && defined(__WATCOMC__) - #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } -#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) - #include <signal.h> - #define SDL_TriggerBreakpoint() raise(SIGTRAP) -#else - /* How do we trigger breakpoints on this platform? */ - #define SDL_TriggerBreakpoint() -#endif - -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ -# define SDL_FUNCTION __func__ -#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__)) -# define SDL_FUNCTION __FUNCTION__ -#else -# define SDL_FUNCTION "???" -#endif -#define SDL_FILE __FILE__ -#define SDL_LINE __LINE__ - -/* -sizeof (x) makes the compiler still parse the expression even without -assertions enabled, so the code is always checked at compile time, but -doesn't actually generate code for it, so there are no side effects or -expensive checks at run time, just the constant size of what x WOULD be, -which presumably gets optimized out as unused. -This also solves the problem of... - - int somevalue = blah(); - SDL_assert(somevalue == 1); - -...which would cause compiles to complain that somevalue is unused if we -disable assertions. -*/ - -/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking - this condition isn't constant. And looks like an owl's face! */ -#ifdef _MSC_VER /* stupid /W4 warnings. */ -#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) -#else -#define SDL_NULL_WHILE_LOOP_CONDITION (0) -#endif - -#define SDL_disabled_assert(condition) \ - do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) - -typedef enum -{ - SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ - SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ - SDL_ASSERTION_ABORT, /**< Terminate the program. */ - SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ - SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ -} SDL_AssertState; - -typedef struct SDL_AssertData -{ - int always_ignore; - unsigned int trigger_count; - const char *condition; - const char *filename; - int linenum; - const char *function; - const struct SDL_AssertData *next; -} SDL_AssertData; - -#if (SDL_ASSERT_LEVEL > 0) - -/* Never call this directly. Use the SDL_assert* macros. */ -extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, - const char *, - const char *, int) -#if defined(__clang__) -#if __has_feature(attribute_analyzer_noreturn) -/* this tells Clang's static analysis that we're a custom assert function, - and that the analyzer should assume the condition was always true past this - SDL_assert test. */ - __attribute__((analyzer_noreturn)) -#endif -#endif -; - -/* the do {} while(0) avoids dangling else problems: - if (x) SDL_assert(y); else blah(); - ... without the do/while, the "else" could attach to this macro's "if". - We try to handle just the minimum we need here in a macro...the loop, - the static vars, and break points. The heavy lifting is handled in - SDL_ReportAssertion(), in SDL_assert.c. -*/ -#define SDL_enabled_assert(condition) \ - do { \ - while ( !(condition) ) { \ - static struct SDL_AssertData sdl_assert_data = { \ - 0, 0, #condition, 0, 0, 0, 0 \ - }; \ - const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ - if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ - continue; /* go again. */ \ - } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ - SDL_TriggerBreakpoint(); \ - } \ - break; /* not retrying. */ \ - } \ - } while (SDL_NULL_WHILE_LOOP_CONDITION) - -#endif /* enabled assertions support code */ - -/* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_disabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) -#else -# error Unknown assertion level. -#endif - -/* this assertion is never disabled at any level. */ -#define SDL_assert_always(condition) SDL_enabled_assert(condition) - - -typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( - const SDL_AssertData* data, void* userdata); - -/** - * \brief Set an application-defined assertion handler. - * - * This allows an app to show its own assertion UI and/or force the - * response to an assertion failure. If the app doesn't provide this, SDL - * will try to do the right thing, popping up a system-specific GUI dialog, - * and probably minimizing any fullscreen windows. - * - * This callback may fire from any thread, but it runs wrapped in a mutex, so - * it will only fire from one thread at a time. - * - * Setting the callback to NULL restores SDL's original internal handler. - * - * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! - * - * Return SDL_AssertState value of how to handle the assertion failure. - * - * \param handler Callback function, called when an assertion fails. - * \param userdata A pointer passed to the callback as-is. - */ -extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( - SDL_AssertionHandler handler, - void *userdata); - -/** - * \brief Get the default assertion handler. - * - * This returns the function pointer that is called by default when an - * assertion is triggered. This is an internal function provided by SDL, - * that is used for assertions when SDL_SetAssertionHandler() hasn't been - * used to provide a different function. - * - * \return The default SDL_AssertionHandler that is called when an assert triggers. - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); - -/** - * \brief Get the current assertion handler. - * - * This returns the function pointer that is called when an assertion is - * triggered. This is either the value last passed to - * SDL_SetAssertionHandler(), or if no application-specified function is - * set, is equivalent to calling SDL_GetDefaultAssertionHandler(). - * - * \param puserdata Pointer to a void*, which will store the "userdata" - * pointer that was passed to SDL_SetAssertionHandler(). - * This value will always be NULL for the default handler. - * If you don't care about this data, it is safe to pass - * a NULL pointer to this function to ignore it. - * \return The SDL_AssertionHandler that is called when an assert triggers. - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); - -/** - * \brief Get a list of all assertion failures. - * - * Get all assertions triggered since last call to SDL_ResetAssertionReport(), - * or the start of the program. - * - * The proper way to examine this data looks something like this: - * - * <code> - * const SDL_AssertData *item = SDL_GetAssertionReport(); - * while (item) { - * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n", - * item->condition, item->function, item->filename, - * item->linenum, item->trigger_count, - * item->always_ignore ? "yes" : "no"); - * item = item->next; - * } - * </code> - * - * \return List of all assertions. - * \sa SDL_ResetAssertionReport - */ -extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); - -/** - * \brief Reset the list of all assertion failures. - * - * Reset list of all assertions triggered. - * - * \sa SDL_GetAssertionReport - */ -extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); - - -/* these had wrong naming conventions until 2.0.4. Please update your app! */ -#define SDL_assert_state SDL_AssertState -#define SDL_assert_data SDL_AssertData - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_assert_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h deleted file mode 100644 index deee35f9..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_atomic.h - * - * Atomic operations. - * - * IMPORTANT: - * If you are not an expert in concurrent lockless programming, you should - * only be using the atomic lock and reference counting functions in this - * file. In all other cases you should be protecting your data structures - * with full mutexes. - * - * The list of "safe" functions to use are: - * SDL_AtomicLock() - * SDL_AtomicUnlock() - * SDL_AtomicIncRef() - * SDL_AtomicDecRef() - * - * Seriously, here be dragons! - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * You can find out a little more about lockless programming and the - * subtle issues that can arise here: - * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx - * - * There's also lots of good information here: - * http://www.1024cores.net/home/lock-free-algorithms - * http://preshing.com/ - * - * These operations may or may not actually be implemented using - * processor specific atomic operations. When possible they are - * implemented as true processor specific atomic operations. When that - * is not possible the are implemented using locks that *do* use the - * available atomic operations. - * - * All of the atomic operations that modify memory are full memory barriers. - */ - -#ifndef SDL_atomic_h_ -#define SDL_atomic_h_ - -#include "SDL_stdinc.h" -#include "SDL_platform.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SDL AtomicLock - * - * The atomic locks are efficient spinlocks using CPU instructions, - * but are vulnerable to starvation and can spin forever if a thread - * holding a lock has been terminated. For this reason you should - * minimize the code executed inside an atomic lock and never do - * expensive things like API or system calls while holding them. - * - * The atomic locks are not safe to lock recursively. - * - * Porting Note: - * The spin lock functions and type are required and can not be - * emulated because they are used in the atomic emulation code. - */ -/* @{ */ - -typedef int SDL_SpinLock; - -/** - * \brief Try to lock a spin lock by setting it to a non-zero value. - * - * \param lock Points to the lock. - * - * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); - -/** - * \brief Lock a spin lock by setting it to a non-zero value. - * - * \param lock Points to the lock. - */ -extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); - -/** - * \brief Unlock a spin lock by setting it to 0. Always returns immediately - * - * \param lock Points to the lock. - */ -extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); - -/* @} *//* SDL AtomicLock */ - - -/** - * The compiler barrier prevents the compiler from reordering - * reads and writes to globally visible variables across the call. - */ -#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__) -void _ReadWriteBarrier(void); -#pragma intrinsic(_ReadWriteBarrier) -#define SDL_CompilerBarrier() _ReadWriteBarrier() -#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ -#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") -#elif defined(__WATCOMC__) -extern _inline void SDL_CompilerBarrier (void); -#pragma aux SDL_CompilerBarrier = "" parm [] modify exact []; -#else -#define SDL_CompilerBarrier() \ -{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } -#endif - -/** - * Memory barriers are designed to prevent reads and writes from being - * reordered by the compiler and being seen out of order on multi-core CPUs. - * - * A typical pattern would be for thread A to write some data and a flag, - * and for thread B to read the flag and get the data. In this case you - * would insert a release barrier between writing the data and the flag, - * guaranteeing that the data write completes no later than the flag is - * written, and you would insert an acquire barrier between reading the - * flag and reading the data, to ensure that all the reads associated - * with the flag have completed. - * - * In this pattern you should always see a release barrier paired with - * an acquire barrier and you should gate the data reads/writes with a - * single flag variable. - * - * For more information on these semantics, take a look at the blog post: - * http://preshing.com/20120913/acquire-and-release-semantics - */ -extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void); -extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void); - -#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") -#elif defined(__GNUC__) && defined(__aarch64__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__GNUC__) && defined(__arm__) -#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */ -/* Information from: - https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19 - - The Linux kernel provides a helper function which provides the right code for a memory barrier, - hard-coded at address 0xffff0fa0 -*/ -typedef void (*SDL_KernelMemoryBarrierFunc)(); -#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() -#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() -#elif 0 /* defined(__QNXNTO__) */ -#include <sys/cpuinline.h> - -#define SDL_MemoryBarrierRelease() __cpu_membarrier() -#define SDL_MemoryBarrierAcquire() __cpu_membarrier() -#else -#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) -#ifdef __thumb__ -/* The mcr instruction isn't available in thumb mode, use real functions */ -#define SDL_MEMORY_BARRIER_USES_FUNCTION -#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction() -#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#endif /* __thumb__ */ -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") -#endif /* __LINUX__ || __ANDROID__ */ -#endif /* __GNUC__ && __arm__ */ -#else -#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ -#include <mbarrier.h> -#define SDL_MemoryBarrierRelease() __machine_rel_barrier() -#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() -#else -/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ -#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() -#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() -#endif -#endif - -/** - * \brief A type representing an atomic integer value. It is a struct - * so people don't accidentally use numeric operations on it. - */ -typedef struct { int value; } SDL_atomic_t; - -/** - * \brief Set an atomic variable to a new value if it is currently an old value. - * - * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. - * - * \note If you don't know what this function is for, you shouldn't use it! -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); - -/** - * \brief Set an atomic variable to a value. - * - * \return The previous value of the atomic variable. - */ -extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); - -/** - * \brief Get the value of an atomic variable - */ -extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); - -/** - * \brief Add to an atomic variable. - * - * \return The previous value of the atomic variable. - * - * \note This same style can be used for any number operation - */ -extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); - -/** - * \brief Increment an atomic variable used as a reference count. - */ -#ifndef SDL_AtomicIncRef -#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) -#endif - -/** - * \brief Decrement an atomic variable used as a reference count. - * - * \return SDL_TRUE if the variable reached zero after decrementing, - * SDL_FALSE otherwise - */ -#ifndef SDL_AtomicDecRef -#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) -#endif - -/** - * \brief Set a pointer to a new value if it is currently an old value. - * - * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. - * - * \note If you don't know what this function is for, you shouldn't use it! -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); - -/** - * \brief Set a pointer to a value atomically. - * - * \return The previous value of the pointer. - */ -extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); - -/** - * \brief Get the value of a pointer atomically. - */ -extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#include "close_code.h" - -#endif /* SDL_atomic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h deleted file mode 100644 index 305c01a9..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h +++ /dev/null @@ -1,859 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_audio.h - * - * Access to the raw audio mixing buffer for the SDL library. - */ - -#ifndef SDL_audio_h_ -#define SDL_audio_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Audio format flags. - * - * These are what the 16 bits in SDL_AudioFormat currently mean... - * (Unspecified bits are always zero). - * - * \verbatim - ++-----------------------sample is signed if set - || - || ++-----------sample is bigendian if set - || || - || || ++---sample is float if set - || || || - || || || +---sample bit size---+ - || || || | | - 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - \endverbatim - * - * There are macros in SDL 2.0 and later to query these bits. - */ -typedef Uint16 SDL_AudioFormat; - -/** - * \name Audio flags - */ -/* @{ */ - -#define SDL_AUDIO_MASK_BITSIZE (0xFF) -#define SDL_AUDIO_MASK_DATATYPE (1<<8) -#define SDL_AUDIO_MASK_ENDIAN (1<<12) -#define SDL_AUDIO_MASK_SIGNED (1<<15) -#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) -#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) -#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) -#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) -#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) -#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) -#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) - -/** - * \name Audio format flags - * - * Defaults to LSB byte order. - */ -/* @{ */ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB -/* @} */ - -/** - * \name int32 support - */ -/* @{ */ -#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ -#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ -#define AUDIO_S32 AUDIO_S32LSB -/* @} */ - -/** - * \name float32 support - */ -/* @{ */ -#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ -#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ -#define AUDIO_F32 AUDIO_F32LSB -/* @} */ - -/** - * \name Native audio byte ordering - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#define AUDIO_S32SYS AUDIO_S32LSB -#define AUDIO_F32SYS AUDIO_F32LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#define AUDIO_S32SYS AUDIO_S32MSB -#define AUDIO_F32SYS AUDIO_F32MSB -#endif -/* @} */ - -/** - * \name Allow change flags - * - * Which audio format changes are allowed when opening a device. - */ -/* @{ */ -#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 -#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 -#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 -#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008 -#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE) -/* @} */ - -/* @} *//* Audio flags */ - -/** - * This function is called when the audio device needs more data. - * - * \param userdata An application-specific parameter saved in - * the SDL_AudioSpec structure - * \param stream A pointer to the audio data buffer. - * \param len The length of that buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - * - * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if - * you like. Just open your audio device with a NULL callback. - */ -typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, - int len); - -/** - * The calculated values in this structure are calculated by SDL_OpenAudio(). - * - * For multi-channel audio, the default SDL channel mapping is: - * 2: FL FR (stereo) - * 3: FL FR LFE (2.1 surround) - * 4: FL FR BL BR (quad) - * 5: FL FR FC BL BR (quad + center) - * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) - * 7: FL FR FC LFE BC SL SR (6.1 surround) - * 8: FL FR FC LFE BL BR SL SR (7.1 surround) - */ -typedef struct SDL_AudioSpec -{ - int freq; /**< DSP frequency -- samples per second */ - SDL_AudioFormat format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ - void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ -} SDL_AudioSpec; - - -struct SDL_AudioCVT; -typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, - SDL_AudioFormat format); - -/** - * \brief Upper limit of filters in SDL_AudioCVT - * - * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is - * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, - * one of which is the terminating NULL pointer. - */ -#define SDL_AUDIOCVT_MAX_FILTERS 9 - -/** - * \struct SDL_AudioCVT - * \brief A structure to hold a set of audio conversion filters and buffers. - * - * Note that various parts of the conversion pipeline can take advantage - * of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require - * you to pass it aligned data, but can possibly run much faster if you - * set both its (buf) field to a pointer that is aligned to 16 bytes, and its - * (len) field to something that's a multiple of 16, if possible. - */ -#ifdef __GNUC__ -/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't - pad it out to 88 bytes to guarantee ABI compatibility between compilers. - vvv - The next time we rev the ABI, make sure to size the ints and add padding. -*/ -#define SDL_AUDIOCVT_PACKED __attribute__((packed)) -#else -#define SDL_AUDIOCVT_PACKED -#endif -/* */ -typedef struct SDL_AudioCVT -{ - int needed; /**< Set to 1 if conversion possible */ - SDL_AudioFormat src_format; /**< Source audio format */ - SDL_AudioFormat dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */ - int filter_index; /**< Current audio conversion function */ -} SDL_AUDIOCVT_PACKED SDL_AudioCVT; - - -/* Function prototypes */ - -/** - * \name Driver discovery functions - * - * These functions return the list of built in audio drivers, in the - * order that they are normally initialized by default. - */ -/* @{ */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); -extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); -/* @} */ - -/** - * \name Initialization and cleanup - * - * \internal These functions are used internally, and should not be used unless - * you have a specific need to specify the audio driver you want to - * use. You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/* @{ */ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); -/* @} */ - -/** - * This function returns the name of the current audio driver, or NULL - * if no driver has been initialized. - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); - -/** - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by \c obtained. If \c obtained is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. - * - * When filling in the desired audio spec structure, - * - \c desired->freq should be the desired audio frequency in samples-per- - * second. - * - \c desired->format should be the desired audio format. - * - \c desired->samples is the desired size of the audio buffer, in - * samples. This number should be a power of two, and may be adjusted by - * the audio driver to a value more suitable for the hardware. Good values - * seem to range between 512 and 8096 inclusive, depending on the - * application and CPU speed. Smaller values yield faster response time, - * but can lead to underflow if the application is doing heavy processing - * and cannot fill the audio buffer in time. A stereo sample consists of - * both right and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: \code ms = (samples*1000)/freq \endcode - * - \c desired->size is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * - \c desired->silence is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * - \c desired->callback should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL - * pointer here, and call SDL_QueueAudio() with some frequency, to queue - * more audio samples to be played (or for capture devices, call - * SDL_DequeueAudio() with some frequency, to obtain audio samples). - * - \c desired->userdata is passed as the first parameter to your callback - * function. If you passed a NULL callback, this value is ignored. - * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, - SDL_AudioSpec * obtained); - -/** - * SDL Audio Device IDs. - * - * A successful call to SDL_OpenAudio() is always device id 1, and legacy - * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls - * always returns devices >= 2 on success. The legacy calls are good both - * for backwards compatibility and when you don't care about multiple, - * specific, or capture devices. - */ -typedef Uint32 SDL_AudioDeviceID; - -/** - * Get the number of available devices exposed by the current driver. - * Only valid after a successfully initializing the audio subsystem. - * Returns -1 if an explicit list of devices can't be determined; this is - * not an error. For example, if SDL is set up to talk to a remote audio - * server, it can't list every one available on the Internet, but it will - * still allow a specific host to be specified to SDL_OpenAudioDevice(). - * - * In many common cases, when this function returns a value <= 0, it can still - * successfully open the default device (NULL for first argument of - * SDL_OpenAudioDevice()). - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); - -/** - * Get the human-readable name of a specific audio device. - * Must be a value between 0 and (number of audio devices-1). - * Only valid after a successfully initializing the audio subsystem. - * The values returned by this function reflect the latest call to - * SDL_GetNumAudioDevices(); recall that function to redetect available - * hardware. - * - * The string returned by this function is UTF-8 encoded, read-only, and - * managed internally. You are not to free it. If you need to keep the - * string for any length of time, you should make your own copy of it, as it - * will be invalid next time any of several other SDL functions is called. - */ -extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, - int iscapture); - - -/** - * Open a specific audio device. Passing in a device name of NULL requests - * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). - * - * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but - * some drivers allow arbitrary and driver-specific strings, such as a - * hostname/IP address for a remote audio server, or a filename in the - * diskaudio driver. - * - * \return 0 on error, a valid device ID that is >= 2 on success. - * - * SDL_OpenAudio(), unlike this function, always acts on device ID 1. - */ -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char - *device, - int iscapture, - const - SDL_AudioSpec * - desired, - SDL_AudioSpec * - obtained, - int - allowed_changes); - - - -/** - * \name Audio state - * - * Get the current audio state. - */ -/* @{ */ -typedef enum -{ - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_AudioStatus; -extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); - -extern DECLSPEC SDL_AudioStatus SDLCALL -SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); -/* @} *//* Audio State */ - -/** - * \name Pause audio functions - * - * These functions pause and unpause the audio callback processing. - * They should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -/* @{ */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); -extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, - int pause_on); -/* @} *//* Pause audio functions */ - -/** - * \brief Load the audio data of a WAVE file into memory - * - * Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len - * to be valid pointers. The entire data portion of the file is then loaded - * into memory and decoded if necessary. - * - * If \c freesrc is non-zero, the data source gets automatically closed and - * freed before the function returns. - * - * Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits), - * IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and - * µ-law (8 bits). Other formats are currently unsupported and cause an error. - * - * If this function succeeds, the pointer returned by it is equal to \c spec - * and the pointer to the audio data allocated by the function is written to - * \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec - * members \c freq, \c channels, and \c format are set to the values of the - * audio data in the buffer. The \c samples member is set to a sane default and - * all others are set to zero. - * - * It's necessary to use SDL_FreeWAV() to free the audio data returned in - * \c audio_buf when it is no longer used. - * - * Because of the underspecification of the Waveform format, there are many - * problematic files in the wild that cause issues with strict decoders. To - * provide compatibility with these files, this decoder is lenient in regards - * to the truncation of the file, the fact chunk, and the size of the RIFF - * chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION, - * and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the - * loading process. - * - * Any file that is invalid (due to truncation, corruption, or wrong values in - * the headers), too big, or unsupported causes an error. Additionally, any - * critical I/O error from the data source will terminate the loading process - * with an error. The function returns NULL on error and in all cases (with the - * exception of \c src being NULL), an appropriate error message will be set. - * - * It is required that the data source supports seeking. - * - * Example: - * \code - * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); - * \endcode - * - * \param src The data source with the WAVE data - * \param freesrc A integer value that makes the function close the data source if non-zero - * \param spec A pointer filled with the audio format of the audio data - * \param audio_buf A pointer filled with the audio data allocated by the function - * \param audio_len A pointer filled with the length of the audio data buffer in bytes - * \return NULL on error, or non-NULL on success. - */ -extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, - int freesrc, - SDL_AudioSpec * spec, - Uint8 ** audio_buf, - Uint32 * audio_len); - -/** - * Loads a WAV from a file. - * Compatibility convenience function. - */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/** - * This function frees data previously allocated with SDL_LoadWAV_RW() - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); - -/** - * This function takes a source format and rate and a destination format - * and rate, and initializes the \c cvt structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. An unsupported format causes an error and -1 will be returned. - * - * \return 0 if no conversion is needed, 1 if the audio filter is set up, - * or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, - SDL_AudioFormat src_format, - Uint8 src_channels, - int src_rate, - SDL_AudioFormat dst_format, - Uint8 dst_channels, - int dst_rate); - -/** - * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), - * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * - * The data conversion may expand the size of the audio data, so the buffer - * \c cvt->buf should be allocated after the \c cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. - * - * \return 0 on success or -1 if \c cvt->buf is NULL. - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); - -/* SDL_AudioStream is a new audio conversion interface. - The benefits vs SDL_AudioCVT: - - it can handle resampling data in chunks without generating - artifacts, when it doesn't have the complete buffer available. - - it can handle incoming data in any variable size. - - You push data as you have it, and pull it when you need it - */ -/* this is opaque to the outside world. */ -struct _SDL_AudioStream; -typedef struct _SDL_AudioStream SDL_AudioStream; - -/** - * Create a new audio stream - * - * \param src_format The format of the source audio - * \param src_channels The number of channels of the source audio - * \param src_rate The sampling rate of the source audio - * \param dst_format The format of the desired audio output - * \param dst_channels The number of channels of the desired audio output - * \param dst_rate The sampling rate of the desired audio output - * \return 0 on success, or -1 on error. - * - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, - const Uint8 src_channels, - const int src_rate, - const SDL_AudioFormat dst_format, - const Uint8 dst_channels, - const int dst_rate); - -/** - * Add data to be converted/resampled to the stream - * - * \param stream The stream the audio data is being added to - * \param buf A pointer to the audio data to add - * \param len The number of bytes to write to the stream - * \return 0 on success, or -1 on error. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); - -/** - * Get converted/resampled data from the stream - * - * \param stream The stream the audio is being requested from - * \param buf A buffer to fill with audio data - * \param len The maximum number of bytes to fill - * \return The number of bytes read from the stream, or -1 on error - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); - -/** - * Get the number of converted/resampled bytes available. The stream may be - * buffering data behind the scenes until it has enough to resample - * correctly, so this number might be lower than what you expect, or even - * be zero. Add more data or flush the stream if you need the data now. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); - -/** - * Tell the stream that you're done sending data, and anything being buffered - * should be converted/resampled and made available immediately. - * - * It is legal to add more data to a stream after flushing, but there will - * be audio gaps in the output. Generally this is intended to signal the - * end of input, so the complete output becomes available. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); - -/** - * Clear any pending data in the stream without converting it - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); - -/** - * Free an audio stream - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - */ -extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); - -#define SDL_MIX_MAXVOLUME 128 -/** - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. - */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, - Uint32 len, int volume); - -/** - * This works like SDL_MixAudio(), but you specify the audio format instead of - * using the format of audio device 1. Thus it can be used when no audio - * device is open at all. - */ -extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, - const Uint8 * src, - SDL_AudioFormat format, - Uint32 len, int volume); - -/** - * Queue more audio on non-callback devices. - * - * (If you are looking to retrieve queued audio from a non-callback capture - * device, you want SDL_DequeueAudio() instead. This will return -1 to - * signify an error if you use it with capture devices.) - * - * SDL offers two ways to feed audio to the device: you can either supply a - * callback that SDL triggers with some frequency to obtain more audio - * (pull method), or you can supply no callback, and then SDL will expect - * you to supply data at regular intervals (push method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Queued data will drain to the device as - * necessary without further intervention from you. If the device needs - * audio but there is not enough queued, it will play silence to make up - * the difference. This means you will have skips in your audio playback - * if you aren't routinely queueing sufficient data. - * - * This function copies the supplied data, so you are safe to free it when - * the function returns. This function is thread-safe, but queueing to the - * same device from two threads at once does not promise which buffer will - * be queued first. - * - * You may not queue audio on a device that is using an application-supplied - * callback; doing so returns an error. You have to use the audio callback - * or queue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before queueing; SDL - * handles locking internally for this function. - * - * \param dev The device ID to which we will queue audio. - * \param data The data to queue to the device for later playback. - * \param len The number of bytes (not samples!) to which (data) points. - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetQueuedAudioSize - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); - -/** - * Dequeue more audio on non-callback devices. - * - * (If you are looking to queue audio for output on a non-callback playback - * device, you want SDL_QueueAudio() instead. This will always return 0 - * if you use it with playback devices.) - * - * SDL offers two ways to retrieve audio from a capture device: you can - * either supply a callback that SDL triggers with some frequency as the - * device records more audio data, (push method), or you can supply no - * callback, and then SDL will expect you to retrieve data at regular - * intervals (pull method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Data from the device will keep queuing as - * necessary without further intervention from you. This means you will - * eventually run out of memory if you aren't routinely dequeueing data. - * - * Capture devices will not queue data when paused; if you are expecting - * to not need captured audio for some length of time, use - * SDL_PauseAudioDevice() to stop the capture device from queueing more - * data. This can be useful during, say, level loading times. When - * unpaused, capture devices will start queueing data from that point, - * having flushed any capturable data available while paused. - * - * This function is thread-safe, but dequeueing from the same device from - * two threads at once does not promise which thread will dequeued data - * first. - * - * You may not dequeue audio from a device that is using an - * application-supplied callback; doing so returns an error. You have to use - * the audio callback, or dequeue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before queueing; SDL - * handles locking internally for this function. - * - * \param dev The device ID from which we will dequeue audio. - * \param data A pointer into where audio data should be copied. - * \param len The number of bytes (not samples!) to which (data) points. - * \return number of bytes dequeued, which could be less than requested. - * - * \sa SDL_GetQueuedAudioSize - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len); - -/** - * Get the number of bytes of still-queued audio. - * - * For playback device: - * - * This is the number of bytes that have been queued for playback with - * SDL_QueueAudio(), but have not yet been sent to the hardware. This - * number may shrink at any time, so this only informs of pending data. - * - * Once we've sent it to the hardware, this function can not decide the - * exact byte boundary of what has been played. It's possible that we just - * gave the hardware several kilobytes right before you called this - * function, but it hasn't played any of it yet, or maybe half of it, etc. - * - * For capture devices: - * - * This is the number of bytes that have been captured by the device and - * are waiting for you to dequeue. This number may grow at any time, so - * this only informs of the lower-bound of available data. - * - * You may not queue audio on a device that is using an application-supplied - * callback; calling this function on such a device always returns 0. - * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use - * the audio callback, but not both. - * - * You should not call SDL_LockAudio() on the device before querying; SDL - * handles locking internally for this function. - * - * \param dev The device ID of which we will query queued audio size. - * \return Number of bytes (not samples!) of queued audio. - * - * \sa SDL_QueueAudio - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); - -/** - * Drop any queued audio data. For playback devices, this is any queued data - * still waiting to be submitted to the hardware. For capture devices, this - * is any data that was queued by the device that hasn't yet been dequeued by - * the application. - * - * Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For - * playback devices, the hardware will start playing silence if more audio - * isn't queued. Unpaused capture devices will start filling the queue again - * as soon as they have more data available (which, depending on the state - * of the hardware and the thread, could be before this function call - * returns!). - * - * This will not prevent playback of queued audio that's already been sent - * to the hardware, as we can not undo that, so expect there to be some - * fraction of a second of audio that might still be heard. This can be - * useful if you want to, say, drop any pending music during a level change - * in your game. - * - * You may not queue audio on a device that is using an application-supplied - * callback; calling this function on such a device is always a no-op. - * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use - * the audio callback, but not both. - * - * You should not call SDL_LockAudio() on the device before clearing the - * queue; SDL handles locking internally for this function. - * - * This function always succeeds and thus returns void. - * - * \param dev The device ID of which to clear the audio queue. - * - * \sa SDL_QueueAudio - * \sa SDL_GetQueuedAudioSize - */ -extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); - - -/** - * \name Audio lock functions - * - * The lock manipulated by these functions protects the callback function. - * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that - * the callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -/* @{ */ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); -extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); -/* @} *//* Audio lock functions */ - -/** - * This function shuts down audio processing and closes the audio device. - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); -extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_audio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h deleted file mode 100644 index b116cc8d..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_bits.h - * - * Functions for fiddling with bits and bitmasks. - */ - -#ifndef SDL_bits_h_ -#define SDL_bits_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_bits.h - */ - -/** - * Get the index of the most significant bit. Result is undefined when called - * with 0. This operation can also be stated as "count leading zeroes" and - * "log base 2". - * - * \return Index of the most significant bit, or -1 if the value is 0. - */ -#if defined(__WATCOMC__) && defined(__386__) -extern _inline int _SDL_clz_watcom (Uint32); -#pragma aux _SDL_clz_watcom = \ - "bsr eax, eax" \ - "xor eax, 31" \ - parm [eax] nomemory \ - value [eax] \ - modify exact [eax] nomemory; -#endif - -SDL_FORCE_INLINE int -SDL_MostSignificantBitIndex32(Uint32 x) -{ -#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) - /* Count Leading Zeroes builtin in GCC. - * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html - */ - if (x == 0) { - return -1; - } - return 31 - __builtin_clz(x); -#elif defined(__WATCOMC__) && defined(__386__) - if (x == 0) { - return -1; - } - return 31 - _SDL_clz_watcom(x); -#else - /* Based off of Bit Twiddling Hacks by Sean Eron Anderson - * <seander@cs.stanford.edu>, released in the public domain. - * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog - */ - const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; - const int S[] = {1, 2, 4, 8, 16}; - - int msbIndex = 0; - int i; - - if (x == 0) { - return -1; - } - - for (i = 4; i >= 0; i--) - { - if (x & b[i]) - { - x >>= S[i]; - msbIndex |= S[i]; - } - } - - return msbIndex; -#endif -} - -SDL_FORCE_INLINE SDL_bool -SDL_HasExactlyOneBitSet32(Uint32 x) -{ - if (x && !(x & (x - 1))) { - return SDL_TRUE; - } - return SDL_FALSE; -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_bits_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h deleted file mode 100644 index 6f0a22b9..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_blendmode.h - * - * Header file declaring the SDL_BlendMode enumeration - */ - -#ifndef SDL_blendmode_h_ -#define SDL_blendmode_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The blend mode used in SDL_RenderCopy() and drawing operations. - */ -typedef enum -{ - SDL_BLENDMODE_NONE = 0x00000000, /**< no blending - dstRGBA = srcRGBA */ - SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) */ - SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending - dstRGB = (srcRGB * srcA) + dstRGB - dstA = dstA */ - SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate - dstRGB = srcRGB * dstRGB - dstA = dstA */ - SDL_BLENDMODE_INVALID = 0x7FFFFFFF - - /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ - -} SDL_BlendMode; - -/** - * \brief The blend operation used when combining source and destination pixel components - */ -typedef enum -{ - SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */ - SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */ - -} SDL_BlendOperation; - -/** - * \brief The normalized factor used to multiply pixel components - */ -typedef enum -{ - SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ - SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ - SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */ - SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */ - SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */ - SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */ - SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */ - SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */ - SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */ - SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */ - -} SDL_BlendFactor; - -/** - * \brief Create a custom blend mode, which may or may not be supported by a given renderer - * - * \param srcColorFactor source color factor - * \param dstColorFactor destination color factor - * \param colorOperation color operation - * \param srcAlphaFactor source alpha factor - * \param dstAlphaFactor destination alpha factor - * \param alphaOperation alpha operation - * - * The result of the blend mode operation will be: - * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor - * and - * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor - */ -extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, - SDL_BlendFactor dstColorFactor, - SDL_BlendOperation colorOperation, - SDL_BlendFactor srcAlphaFactor, - SDL_BlendFactor dstAlphaFactor, - SDL_BlendOperation alphaOperation); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_blendmode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h deleted file mode 100644 index c4f8766c..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_clipboard.h - * - * Include file for SDL clipboard handling - */ - -#ifndef SDL_clipboard_h_ -#define SDL_clipboard_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -/** - * \brief Put UTF-8 text into the clipboard - * - * \sa SDL_GetClipboardText() - */ -extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); - -/** - * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() - * - * \sa SDL_SetClipboardText() - */ -extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); - -/** - * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty - * - * \sa SDL_GetClipboardText() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_clipboard_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h deleted file mode 100644 index 7d62d3e2..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/** - * \file SDL_config.h - */ - -/* Add any platform that doesn't build using the configure system. */ -#if defined(__WIN32__) -#include "SDL_config_windows.h" -#elif defined(__WINRT__) -#include "SDL_config_winrt.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__ANDROID__) -#include "SDL_config_android.h" -#elif defined(__PSP__) -#include "SDL_config_psp.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -/* This is a minimal configuration just to get SDL running on new platforms. */ -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#ifdef USING_GENERATED_CONFIG_H -#error Wrong SDL_config.h, check your include path? -#endif - -#endif /* SDL_config_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h.orig b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h.orig deleted file mode 100644 index 4270c78b..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h.orig +++ /dev/null @@ -1,55 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/** - * \file SDL_config.h - */ - -/* Add any platform that doesn't build using the configure system. */ -#ifdef USING_PREMAKE_CONFIG_H -#include "SDL_config_premake.h" -#elif defined(__WIN32__) -#include "SDL_config_windows.h" -#elif defined(__WINRT__) -#include "SDL_config_winrt.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__ANDROID__) -#include "SDL_config_android.h" -#elif defined(__PSP__) -#include "SDL_config_psp.h" -#else -/* This is a minimal configuration just to get SDL running on new platforms */ -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#ifdef USING_GENERATED_CONFIG_H -#error Wrong SDL_config.h, check your include path? -#endif - -#endif /* _SDL_config_h */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h deleted file mode 100644 index 9cb70bfe..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_android_h_ -#define SDL_config_android_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/** - * \file SDL_config_android.h - * - * This is a configuration that can be used to build SDL for Android - */ - -#include <stdarg.h> - -#define HAVE_GCC_ATOMICS 1 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_CLOCK_GETTIME 1 - -#define SIZEOF_VOIDP 4 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_ANDROID 1 -#define SDL_AUDIO_DRIVER_OPENSLES 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_ANDROID 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_ANDROID 1 - -/* Enable sensor driver */ -#define SDL_SENSOR_ANDROID 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_ANDROID 1 - -/* Enable OpenGL ES */ -#define SDL_VIDEO_OPENGL_ES 1 -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES2 1 - -/* Enable Vulkan support */ -/* Android does not support Vulkan in native code using the "armeabi" ABI. */ -#if defined(__ARM_ARCH) && __ARM_ARCH < 7 -#define SDL_VIDEO_VULKAN 0 -#else -#define SDL_VIDEO_VULKAN 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_ANDROID 1 - -/* Enable the filesystem driver */ -#define SDL_FILESYSTEM_ANDROID 1 - -#endif /* SDL_config_android_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h deleted file mode 100644 index edfc03e2..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_iphoneos_h_ -#define SDL_config_iphoneos_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define HAVE_GCC_ATOMICS 1 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 -/* The libunwind functions are only available on x86 */ -/* #undef HAVE_LIBUNWIND_H */ - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_SYSCTLBYNAME 1 - -/* enable iPhone version of Core Audio driver */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DUMMY 1 - -/* Enable MFi joystick support */ -#define SDL_JOYSTICK_MFI 1 -/*#define SDL_JOYSTICK_HIDAPI 1*/ - -#ifdef __TVOS__ -#define SDL_SENSOR_DUMMY 1 -#else -/* Enable the CoreMotion sensor driver */ -#define SDL_SENSOR_COREMOTION 1 -#endif - -/* Enable Unix style SO loading */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Supported video drivers */ -#define SDL_VIDEO_DRIVER_UIKIT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL ES */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES2 1 - -/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer */ -#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)) -#define SDL_PLATFORM_SUPPORTS_METAL 1 -#else -#define SDL_PLATFORM_SUPPORTS_METAL 0 -#endif - -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_RENDER_METAL 1 -#endif - -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_VULKAN 1 -#endif - -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_METAL 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_UIKIT 1 - -/* enable iPhone keyboard support */ -#define SDL_IPHONE_KEYBOARD 1 - -/* enable iOS extended launch screen */ -#define SDL_IPHONE_LAUNCHSCREEN 1 - -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - -/* enable filesystem support */ -#define SDL_FILESYSTEM_COCOA 1 - -#endif /* SDL_config_iphoneos_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h deleted file mode 100644 index 22287dfc..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_macosx_h_ -#define SDL_config_macosx_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ -#include <AvailabilityMacros.h> - -/* This is a set of defines to configure the SDL features */ - -#ifdef __LP64__ - #define SIZEOF_VOIDP 8 -#else - #define SIZEOF_VOIDP 4 -#endif - -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_LIBUNWIND_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_SYSCTLBYNAME 1 - -#define HAVE_GCC_ATOMICS 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_IOKIT 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_COCOA 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 -#undef SDL_VIDEO_DRIVER_X11 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib" -#define SDL_VIDEO_DRIVER_X11_XDBE 1 -#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 -#define SDL_VIDEO_DRIVER_X11_XRANDR 1 -#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 -#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 -#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 -#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 - -#ifdef MAC_OS_X_VERSION_10_8 -/* - * No matter the versions targeted, this is the 10.8 or later SDK, so you have - * to use the external Xquartz, which is a more modern Xlib. Previous SDKs - * used an older Xlib. - */ -#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 -#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 -#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 -#endif - -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif - -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif - -/* Metal only supported on 64-bit architectures with 10.11+ */ -#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) -#define SDL_PLATFORM_SUPPORTS_METAL 1 -#else -#define SDL_PLATFORM_SUPPORTS_METAL 0 -#endif - -#ifndef SDL_VIDEO_RENDER_METAL -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_RENDER_METAL 1 -#else -#define SDL_VIDEO_RENDER_METAL 0 -#endif -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_CGL -#define SDL_VIDEO_OPENGL_CGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_GLX -#define SDL_VIDEO_OPENGL_GLX 1 -#endif - -/* Enable Vulkan and Metal support */ -#ifndef SDL_VIDEO_VULKAN -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_VULKAN 1 -#else -#define SDL_VIDEO_VULKAN 0 -#endif -#endif - -#ifndef SDL_VIDEO_METAL -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_METAL 1 -#else -#define SDL_VIDEO_METAL 0 -#endif -#endif - -/* Enable system power support */ -#define SDL_POWER_MACOSX 1 - -/* enable filesystem support */ -#define SDL_FILESYSTEM_COCOA 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 -#ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 -#endif - -#endif /* SDL_config_macosx_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h deleted file mode 100644 index 20e45b88..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_minimal_h_ -#define SDL_config_minimal_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/** - * \file SDL_config_minimal.h - * - * This is the minimal configuration that can be used to build SDL. - */ - -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 - -/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ -#if defined(_MSC_VER) && (_MSC_VER < 1600) -/* Here are some reasonable defaults */ -typedef unsigned int size_t; -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -#else -#define HAVE_STDINT_H 1 -#endif /* Visual Studio 2008 */ - -#ifdef __GNUC__ -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 -#endif - -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ -#define SDL_SENSOR_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 - -/* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ -#define SDL_FILESYSTEM_DUMMY 1 - -#endif /* SDL_config_minimal_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h deleted file mode 100644 index f03ca4a5..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_os2_h_ -#define SDL_config_os2_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_DISK 1 - -#define SDL_POWER_DISABLED 1 -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 -/*#undef SDL_JOYSTICK_HIDAPI */ - -#define SDL_SENSOR_DUMMY 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL support */ -/* #undef SDL_VIDEO_OPENGL */ - -/* Enable Vulkan support */ -/* #undef SDL_VIDEO_VULKAN */ - -#define SDL_LOADSO_DISABLED 1 -#define SDL_THREADS_DISABLED 1 -#define SDL_TIMERS_DISABLED 1 -#define SDL_FILESYSTEM_DUMMY 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 - -/* #undef HAVE_LIBSAMPLERATE_H */ - -/* Enable dynamic libsamplerate support */ -/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ - -#define HAVE_LIBC 1 - -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_WCHAR_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_SIGNAL_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#if defined(__WATCOMC__) -#define HAVE__FSEEKI64 1 -#define HAVE__FTELLI64 1 -#endif -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 -#define HAVE_WCSCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 -/* #define HAVE_WCSDUP 1 */ -/* #define wcsdup _wcsdup */ -#define HAVE_WCSSTR 1 -#define HAVE_WCSCMP 1 -#define HAVE_WCSNCMP 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 -#define HAVE_ACOS 1 -/* #undef HAVE_ACOSF */ -#define HAVE_ASIN 1 -/* #undef HAVE_ASINF */ -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -/* #undef HAVE_ATAN2F */ -#define HAVE_CEIL 1 -/* #undef HAVE_CEILF */ -/* #undef HAVE_COPYSIGN */ -/* #undef HAVE_COPYSIGNF */ -#define HAVE_COS 1 -/* #undef HAVE_COSF */ -#define HAVE_EXP 1 -/* #undef HAVE_EXPF */ -#define HAVE_FABS 1 -/* #undef HAVE_FABSF */ -#define HAVE_FLOOR 1 -/* #undef HAVE_FLOORF */ -#define HAVE_FMOD 1 -/* #undef HAVE_FMODF */ -#define HAVE_LOG 1 -/* #undef HAVE_LOGF */ -#define HAVE_LOG10 1 -/* #undef HAVE_LOG10F */ -#define HAVE_POW 1 -/* #undef HAVE_POWF */ -#define HAVE_SIN 1 -/* #undef HAVE_SINF */ -/* #undef HAVE_SCALBN */ -/* #undef HAVE_SCALBNF */ -#define HAVE_SQRT 1 -/* #undef HAVE_SQRTF */ -#define HAVE_TAN 1 -/* #undef HAVE_TANF */ - -#endif /* SDL_config_os2_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h deleted file mode 100644 index 66ccf895..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_pandora_h_ -#define SDL_config_pandora_h_ -#define SDL_config_h_ - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define SDL_BYTEORDER 1234 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_LOG10 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_SENSOR_DUMMY 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 -#define SDL_FILESYSTEM_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* SDL_config_pandora_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h deleted file mode 100644 index dd2d6ecf..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_psp_h_ -#define SDL_config_psp_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - - - -#ifdef __GNUC__ -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 -#endif - -#define HAVE_GCC_ATOMICS 1 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -/* #define HAVE_SYSCONF 1 */ -/* #define HAVE_SIGACTION 1 */ - - -/* PSP isn't that sophisticated */ -#define LACKS_SYS_MMAN_H 1 - -/* Enable the PSP thread support (src/thread/psp/\*.c) */ -#define SDL_THREAD_PSP 1 - -/* Enable the PSP timer support (src/timer/psp/\*.c) */ -#define SDL_TIMERS_PSP 1 - -/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ -#define SDL_JOYSTICK_PSP 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable the PSP audio driver (src/audio/psp/\*.c) */ -#define SDL_AUDIO_DRIVER_PSP 1 - -/* PSP video driver */ -#define SDL_VIDEO_DRIVER_PSP 1 - -/* PSP render driver */ -#define SDL_VIDEO_RENDER_PSP 1 - -#define SDL_POWER_PSP 1 - -/* !!! FIXME: what does PSP do for filesystem stuff? */ -#define SDL_FILESYSTEM_DUMMY 1 - -/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* PSP can't load shared object (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - - -#endif /* SDL_config_psp_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h deleted file mode 100644 index c66d8754..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_windows_h_ -#define SDL_config_windows_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -#define HAVE_DDRAW_H 1 -#define HAVE_DINPUT_H 1 -#define HAVE_DSOUND_H 1 -#define HAVE_DXGI_H 1 -#define HAVE_XINPUT_H 1 -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 - -/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ -#ifdef HAVE_LIBC -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__STRUPR */ -/* #undef HAVE__STRLWR */ -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -#if defined(_MSC_VER) -#define HAVE_STRTOK_S 1 -#endif -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__LTOA */ -/* #undef HAVE__ULTOA */ -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#if defined(_MSC_VER) -/* These functions were added with the VC++ 2013 C runtime library */ -#if _MSC_VER >= 1800 -#define HAVE_STRTOLL 1 -#define HAVE_VSSCANF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#endif -/* This function is available with at least the VC++ 2008 C runtime library */ -#if _MSC_VER >= 1400 -#define HAVE__FSEEKI64 1 -#endif -#endif -#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) -#define HAVE_M_PI 1 -#endif -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -/* #undef SDL_AUDIO_DRIVER_WASAPI */ -#define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_DINPUT 1 -#define SDL_HAPTIC_XINPUT 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WINDOWS 1 - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 - -#ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif -#ifndef SDL_VIDEO_RENDER_D3D11 -#define SDL_VIDEO_RENDER_D3D11 0 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif - -/* Enable Vulkan support */ -#define SDL_VIDEO_VULKAN 1 - -/* Enable system power support */ -#define SDL_POWER_WINDOWS 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* SDL_config_windows_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h deleted file mode 100644 index cb85b234..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_winrt_h_ -#define SDL_config_winrt_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used - by SDL to determine which version of the Windows SDK is being used. -*/ -#include <sdkddkver.h> - -/* Define possibly-undefined NTDDI values (used when compiling SDL against - older versions of the Windows SDK. -*/ -#ifndef NTDDI_WINBLUE -#define NTDDI_WINBLUE 0x06030000 -#endif -#ifndef NTDDI_WIN10 -#define NTDDI_WIN10 0x0A000000 -#endif - -/* This is a set of defines to configure the SDL features */ - -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -/* Useful headers */ -#define HAVE_DXGI_H 1 -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP -#define HAVE_XINPUT_H 1 -#endif - -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 - -#define HAVE_LIBC 1 -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_S 1 -//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead -//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead -//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -//#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_VSNPRINTF 1 -//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE__SCALB 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE__FSEEKI64 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_WASAPI 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 -#else -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_HAPTIC_XINPUT 1 -#endif - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#if (NTDDI_VERSION >= NTDDI_WINBLUE) -#define SDL_THREAD_WINDOWS 1 -#else -/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ -#define SDL_THREAD_STDCPP 1 -#endif - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_WINRT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 - -/* Enable appropriate renderer(s) */ -#define SDL_VIDEO_RENDER_D3D11 1 - -#if SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_WINRT 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* SDL_config_winrt_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h deleted file mode 100644 index 724c55fc..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_wiz_h_ -#define SDL_config_wiz_h_ -#define SDL_config_h_ - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#define SDL_BYTEORDER 1234 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_POW 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_SENSOR_DUMMY 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* SDL_config_wiz_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h deleted file mode 100644 index 1ef18cd1..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h deleted file mode 100644 index 2d094e88..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_cpuinfo.h - * - * CPU feature detection for SDL. - */ - -#ifndef SDL_cpuinfo_h_ -#define SDL_cpuinfo_h_ - -#include "SDL_stdinc.h" - -/* Need to do this here because intrin.h has C++ code in it */ -/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ -#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) -#ifdef __clang__ -/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */ -#undef __MMX__ -#undef __SSE__ -#undef __SSE2__ -#else -#include <intrin.h> -#ifndef _WIN64 -#ifndef __MMX__ -#define __MMX__ -#endif -#ifndef __3dNOW__ -#define __3dNOW__ -#endif -#endif -#ifndef __SSE__ -#define __SSE__ -#endif -#ifndef __SSE2__ -#define __SSE2__ -#endif -#endif /* __clang__ */ -#elif defined(__MINGW64_VERSION_MAJOR) -#include <intrin.h> -#else -/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */ -#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H) -#include <altivec.h> -#endif -#if !defined(SDL_DISABLE_ARM_NEON_H) -# if defined(__ARM_NEON) -# include <arm_neon.h> -# elif defined(__WINDOWS__) || defined(__WINRT__) -/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */ -# if defined(_M_ARM) -# include <armintr.h> -# include <arm_neon.h> -# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ -# endif -# if defined (_M_ARM64) -# include <arm64intr.h> -# include <arm64_neon.h> -# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ -# endif -# endif -#endif -#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H) -#include <mm3dnow.h> -#endif -#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) -#include <immintrin.h> -#else -#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H) -#include <mmintrin.h> -#endif -#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H) -#include <xmmintrin.h> -#endif -#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H) -#include <emmintrin.h> -#endif -#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H) -#include <pmmintrin.h> -#endif -#endif /* HAVE_IMMINTRIN_H */ -#endif /* compiler version */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* This is a guess for the cacheline size used for padding. - * Most x86 processors have a 64 byte cache line. - * The 64-bit PowerPC processors have a 128 byte cache line. - * We'll use the larger value to be generally safe. - */ -#define SDL_CACHELINE_SIZE 128 - -/** - * This function returns the number of CPU cores available. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); - -/** - * This function returns the L1 cache line size of the CPU - * - * This is useful for determining multi-threaded structure padding - * or SIMD prefetch sizes. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); - -/** - * This function returns true if the CPU has the RDTSC instruction. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/** - * This function returns true if the CPU has AltiVec features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/** - * This function returns true if the CPU has MMX features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/** - * This function returns true if the CPU has 3DNow! features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/** - * This function returns true if the CPU has SSE features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/** - * This function returns true if the CPU has SSE2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/** - * This function returns true if the CPU has SSE3 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); - -/** - * This function returns true if the CPU has SSE4.1 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); - -/** - * This function returns true if the CPU has SSE4.2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); - -/** - * This function returns true if the CPU has AVX features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); - -/** - * This function returns true if the CPU has AVX2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); - -/** - * This function returns true if the CPU has AVX-512F (foundation) features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); - -/** - * This function returns true if the CPU has ARM SIMD (ARMv6) features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); - -/** - * This function returns true if the CPU has NEON (ARM SIMD) features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); - -/** - * This function returns the amount of RAM configured in the system, in MB. - */ -extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); - -/** - * \brief Report the alignment this system needs for SIMD allocations. - * - * This will return the minimum number of bytes to which a pointer must be - * aligned to be compatible with SIMD instructions on the current machine. - * For example, if the machine supports SSE only, it will return 16, but if - * it supports AVX-512F, it'll return 64 (etc). This only reports values for - * instruction sets SDL knows about, so if your SDL build doesn't have - * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and - * not 64 for the AVX-512 instructions that exist but SDL doesn't know about. - * Plan accordingly. - */ -extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); - -/** - * \brief Allocate memory in a SIMD-friendly way. - * - * This will allocate a block of memory that is suitable for use with SIMD - * instructions. Specifically, it will be properly aligned and padded for - * the system's supported vector instructions. - * - * The memory returned will be padded such that it is safe to read or write - * an incomplete vector at the end of the memory block. This can be useful - * so you don't have to drop back to a scalar fallback at the end of your - * SIMD processing loop to deal with the final elements without overflowing - * the allocated buffer. - * - * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() - * or delete[], etc. - * - * Note that SDL will only deal with SIMD instruction sets it is aware of; - * for example, SDL 2.0.8 knows that SSE wants 16-byte vectors - * (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't - * know that AVX-512 wants 64. To be clear: if you can't decide to use an - * instruction set with an SDL_Has*() function, don't use that instruction - * set with memory allocated through here. - * - * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't - * out of memory. - * - * \param len The length, in bytes, of the block to allocated. The actual - * allocated block might be larger due to padding, etc. - * \return Pointer to newly-allocated block, NULL if out of memory. - * - * \sa SDL_SIMDAlignment - * \sa SDL_SIMDFree - */ -extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); - -/** - * \brief Deallocate memory obtained from SDL_SIMDAlloc - * - * It is not valid to use this function on a pointer from anything but - * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, - * SDL_malloc, memalign, new[], etc. - * - * However, SDL_SIMDFree(NULL) is a legal no-op. - * - * \sa SDL_SIMDAlloc - */ -extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); - -/* vi: set ts=4 sw=4 expandtab: */ -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_cpuinfo_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h deleted file mode 100644 index f95a9067..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h +++ /dev/null @@ -1,1676 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_egl.h - * - * This is a simple file to encapsulate the EGL API headers. - */ -#if !defined(_MSC_VER) && !defined(__ANDROID__) - -#include <EGL/egl.h> -#include <EGL/eglext.h> - -#else /* _MSC_VER */ - -/* EGL headers for Visual Studio */ - -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. -* -* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ -* -* Adopters may modify this file to suit their platform. Adopters are -* encouraged to submit platform specific modifications to the Khronos -* group so that they can be included in future versions of this file. -* Please submit changes by sending them to the public Khronos Bugzilla -* (http://khronos.org/bugzilla) by filing a bug against product -* "Khronos (general)" component "Registry". -* -* A predefined template which fills in some of the bug fields can be -* reached using http://tinyurl.com/khrplatform-h-bugreport, but you -* must create a Bugzilla login first. -* -* -* See the Implementer's Guidelines for information about where this file -* should be located on your system and for more details of its use: -* http://www.khronos.org/registry/implementers_guide.pdf -* -* This file should be included as -* #include <KHR/khrplatform.h> -* by Khronos client API header files that use its types and defines. -* -* The types in khrplatform.h should only be used to define API-specific types. -* -* Types defined in khrplatform.h: -* khronos_int8_t signed 8 bit -* khronos_uint8_t unsigned 8 bit -* khronos_int16_t signed 16 bit -* khronos_uint16_t unsigned 16 bit -* khronos_int32_t signed 32 bit -* khronos_uint32_t unsigned 32 bit -* khronos_int64_t signed 64 bit -* khronos_uint64_t unsigned 64 bit -* khronos_intptr_t signed same number of bits as a pointer -* khronos_uintptr_t unsigned same number of bits as a pointer -* khronos_ssize_t signed size -* khronos_usize_t unsigned size -* khronos_float_t signed 32 bit floating point -* khronos_time_ns_t unsigned 64 bit time in nanoseconds -* khronos_utime_nanoseconds_t unsigned time interval or absolute time in -* nanoseconds -* khronos_stime_nanoseconds_t signed time interval in nanoseconds -* khronos_boolean_enum_t enumerated boolean type. This should -* only be used as a base type when a client API's boolean type is -* an enum. Client APIs which use an integer or other type for -* booleans cannot use this as the base type for their boolean. -* -* Tokens defined in khrplatform.h: -* -* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. -* -* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. -* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. -* -* Calling convention macros defined in this file: -* KHRONOS_APICALL -* KHRONOS_APIENTRY -* KHRONOS_APIATTRIBUTES -* -* These may be used in function prototypes as: -* -* KHRONOS_APICALL void KHRONOS_APIENTRY funcname( -* int arg1, -* int arg2) KHRONOS_APIATTRIBUTES; -*/ - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APICALL -*------------------------------------------------------------------------- -* This precedes the return type of the function in the function prototype. -*/ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(SDL_VIDEO_STATIC_ANGLE) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APIENTRY -*------------------------------------------------------------------------- -* This follows the return type of the function and precedes the function -* name in the function prototype. -*/ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) -/* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APIATTRIBUTES -*------------------------------------------------------------------------- -* This follows the closing parenthesis of the function prototype arguments. -*/ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- -* basic type definitions -*-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* -* Using <stdint.h> -*/ -#include <stdint.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* -* Using <inttypes.h> -*/ -#include <inttypes.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* -* Win32 -*/ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* -* Sun or Digital -*/ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* -* Hypothetical platform with no float or int64 support -*/ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* -* Generic fallback -*/ -#include <stdint.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* -* Types that are (so far) the same on all platforms -*/ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* -* Types that differ between LLP64 and LP64 architectures - in LLP64, -* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears -* to be the only LLP64 architecture in current use. -*/ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* -* Float type -*/ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types -* -* These types can be used to represent a time interval in nanoseconds or -* an absolute Unadjusted System Time. Unadjusted System Time is the number -* of nanoseconds since some arbitrary system event (e.g. since the last -* time the system booted). The Unadjusted System Time is an unsigned -* 64 bit value that wraps back to 0 every 584 years. Time intervals -* may be either signed or unsigned. -*/ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* -* Dummy value used to pad enum types to 32 bits. -*/ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* -* Enumerated boolean type -* -* Values other than zero should be considered to be true. Therefore -* comparisons should not be made against KHRONOS_TRUE. -*/ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - - -#ifndef __eglplatform_h_ -#define __eglplatform_h_ - -/* -** Copyright (c) 2007-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Platform-specific types and definitions for egl.h -* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ -* -* Adopters may modify khrplatform.h and this file to suit their platform. -* You are encouraged to submit all modifications to the Khronos group so that -* they can be included in future versions of this file. Please submit changes -* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) -* by filing a bug against product "EGL" component "Registry". -*/ - -/*#include <KHR/khrplatform.h>*/ - -/* Macros used in EGL function prototype declarations. -* -* EGL functions should be prototyped as: -* -* EGLAPI return-type EGLAPIENTRY eglFunction(arguments); -* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); -* -* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h -*/ - -#ifndef EGLAPI -#define EGLAPI KHRONOS_APICALL -#endif - -#ifndef EGLAPIENTRY -#define EGLAPIENTRY KHRONOS_APIENTRY -#endif -#define EGLAPIENTRYP EGLAPIENTRY* - -/* The types NativeDisplayType, NativeWindowType, and NativePixmapType -* are aliases of window-system-dependent types, such as X Display * or -* Windows Device Context. They must be defined in platform-specific -* code below. The EGL-prefixed versions of Native*Type are the same -* types, renamed in EGL 1.3 so all types in the API start with "EGL". -* -* Khronos STRONGLY RECOMMENDS that you use the default definitions -* provided below, since these changes affect both binary and source -* portability of applications using EGL running on different EGL -* implementations. -*/ - -#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> - -#if __WINRT__ -#include <Unknwn.h> -typedef IUnknown * EGLNativeWindowType; -typedef IUnknown * EGLNativePixmapType; -typedef IUnknown * EGLNativeDisplayType; -#else -typedef HDC EGLNativeDisplayType; -typedef HBITMAP EGLNativePixmapType; -typedef HWND EGLNativeWindowType; -#endif - -#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ - -typedef int EGLNativeDisplayType; -typedef void *EGLNativeWindowType; -typedef void *EGLNativePixmapType; - -#elif defined(WL_EGL_PLATFORM) - -typedef struct wl_display *EGLNativeDisplayType; -typedef struct wl_egl_pixmap *EGLNativePixmapType; -typedef struct wl_egl_window *EGLNativeWindowType; - -#elif defined(__GBM__) - -typedef struct gbm_device *EGLNativeDisplayType; -typedef struct gbm_bo *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(__ANDROID__) /* Android */ - -struct ANativeWindow; -struct egl_native_pixmap_t; - -typedef struct ANativeWindow *EGLNativeWindowType; -typedef struct egl_native_pixmap_t *EGLNativePixmapType; -typedef void *EGLNativeDisplayType; - -#elif defined(MIR_EGL_PLATFORM) - -#include <mir_toolkit/mir_client_library.h> -typedef MirEGLNativeDisplayType EGLNativeDisplayType; -typedef void *EGLNativePixmapType; -typedef MirEGLNativeWindowType EGLNativeWindowType; - -#elif defined(__unix__) - -#ifdef MESA_EGL_NO_X11_HEADERS - -typedef void *EGLNativeDisplayType; -typedef khronos_uintptr_t EGLNativePixmapType; -typedef khronos_uintptr_t EGLNativeWindowType; - -#else - -/* X11 (tentative) */ -#include <X11/Xlib.h> -#include <X11/Xutil.h> - -typedef Display *EGLNativeDisplayType; -typedef Pixmap EGLNativePixmapType; -typedef Window EGLNativeWindowType; - -#endif /* MESA_EGL_NO_X11_HEADERS */ - -#else -#error "Platform not recognized" -#endif - -/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ -typedef EGLNativeDisplayType NativeDisplayType; -typedef EGLNativePixmapType NativePixmapType; -typedef EGLNativeWindowType NativeWindowType; - - -/* Define EGLint. This must be a signed integral type large enough to contain -* all legal attribute names and values passed into and out of EGL, whether -* their type is boolean, bitmask, enumerant (symbolic constant), integer, -* handle, or other. While in general a 32-bit integer will suffice, if -* handles are 64 bit types, then EGLint should be defined as a signed 64-bit -* integer type. -*/ -typedef khronos_int32_t EGLint; - -#endif /* __eglplatform_h */ - -#ifndef __egl_h_ -#define __egl_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ -*/ - -/*#include <EGL/eglplatform.h>*/ - -/* Generated on date 20150623 */ - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: .* - * Default extensions included: None - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_VERSION_1_0 -#define EGL_VERSION_1_0 1 -typedef unsigned int EGLBoolean; -typedef void *EGLDisplay; -typedef void *EGLConfig; -typedef void *EGLSurface; -typedef void *EGLContext; -typedef void (*__eglMustCastToProperFunctionPointerType)(void); -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300A -#define EGL_BAD_NATIVE_WINDOW 0x300B -#define EGL_BAD_PARAMETER 0x300C -#define EGL_BAD_SURFACE 0x300D -#define EGL_BLUE_SIZE 0x3022 -#define EGL_BUFFER_SIZE 0x3020 -#define EGL_CONFIG_CAVEAT 0x3027 -#define EGL_CONFIG_ID 0x3028 -#define EGL_CORE_NATIVE_ENGINE 0x305B -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_DONT_CARE ((EGLint)-1) -#define EGL_DRAW 0x3059 -#define EGL_EXTENSIONS 0x3055 -#define EGL_FALSE 0 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_HEIGHT 0x3056 -#define EGL_LARGEST_PBUFFER 0x3058 -#define EGL_LEVEL 0x3029 -#define EGL_MAX_PBUFFER_HEIGHT 0x302A -#define EGL_MAX_PBUFFER_PIXELS 0x302B -#define EGL_MAX_PBUFFER_WIDTH 0x302C -#define EGL_NATIVE_RENDERABLE 0x302D -#define EGL_NATIVE_VISUAL_ID 0x302E -#define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_NONE 0x3038 -#define EGL_NON_CONFORMANT_CONFIG 0x3051 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_NO_CONTEXT ((EGLContext)0) -#define EGL_NO_DISPLAY ((EGLDisplay)0) -#define EGL_NO_SURFACE ((EGLSurface)0) -#define EGL_PBUFFER_BIT 0x0001 -#define EGL_PIXMAP_BIT 0x0002 -#define EGL_READ 0x305A -#define EGL_RED_SIZE 0x3024 -#define EGL_SAMPLES 0x3031 -#define EGL_SAMPLE_BUFFERS 0x3032 -#define EGL_SLOW_CONFIG 0x3050 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_SUCCESS 0x3000 -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 -#define EGL_TRANSPARENT_RED_VALUE 0x3037 -#define EGL_TRANSPARENT_RGB 0x3052 -#define EGL_TRANSPARENT_TYPE 0x3034 -#define EGL_TRUE 1 -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_WIDTH 0x3057 -#define EGL_WINDOW_BIT 0x0004 -EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); -EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); -EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); -EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); -EGLAPI EGLint EGLAPIENTRY eglGetError (void); -EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); -EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); -EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); -EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); -#endif /* EGL_VERSION_1_0 */ - -#ifndef EGL_VERSION_1_1 -#define EGL_VERSION_1_1 1 -#define EGL_BACK_BUFFER 0x3084 -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A -#define EGL_CONTEXT_LOST 0x300E -#define EGL_MIN_SWAP_INTERVAL 0x303B -#define EGL_MAX_SWAP_INTERVAL 0x303C -#define EGL_MIPMAP_TEXTURE 0x3082 -#define EGL_MIPMAP_LEVEL 0x3083 -#define EGL_NO_TEXTURE 0x305C -#define EGL_TEXTURE_2D 0x305F -#define EGL_TEXTURE_FORMAT 0x3080 -#define EGL_TEXTURE_RGB 0x305D -#define EGL_TEXTURE_RGBA 0x305E -#define EGL_TEXTURE_TARGET 0x3081 -EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); -#endif /* EGL_VERSION_1_1 */ - -#ifndef EGL_VERSION_1_2 -#define EGL_VERSION_1_2 1 -typedef unsigned int EGLenum; -typedef void *EGLClientBuffer; -#define EGL_ALPHA_FORMAT 0x3088 -#define EGL_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_ALPHA_FORMAT_PRE 0x308C -#define EGL_ALPHA_MASK_SIZE 0x303E -#define EGL_BUFFER_PRESERVED 0x3094 -#define EGL_BUFFER_DESTROYED 0x3095 -#define EGL_CLIENT_APIS 0x308D -#define EGL_COLORSPACE 0x3087 -#define EGL_COLORSPACE_sRGB 0x3089 -#define EGL_COLORSPACE_LINEAR 0x308A -#define EGL_COLOR_BUFFER_TYPE 0x303F -#define EGL_CONTEXT_CLIENT_TYPE 0x3097 -#define EGL_DISPLAY_SCALING 10000 -#define EGL_HORIZONTAL_RESOLUTION 0x3090 -#define EGL_LUMINANCE_BUFFER 0x308F -#define EGL_LUMINANCE_SIZE 0x303D -#define EGL_OPENGL_ES_BIT 0x0001 -#define EGL_OPENVG_BIT 0x0002 -#define EGL_OPENGL_ES_API 0x30A0 -#define EGL_OPENVG_API 0x30A1 -#define EGL_OPENVG_IMAGE 0x3096 -#define EGL_PIXEL_ASPECT_RATIO 0x3092 -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_RGB_BUFFER 0x308E -#define EGL_SINGLE_BUFFER 0x3085 -#define EGL_SWAP_BEHAVIOR 0x3093 -#define EGL_UNKNOWN ((EGLint)-1) -#define EGL_VERTICAL_RESOLUTION 0x3091 -EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); -EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); -#endif /* EGL_VERSION_1_2 */ - -#ifndef EGL_VERSION_1_3 -#define EGL_VERSION_1_3 1 -#define EGL_CONFORMANT 0x3042 -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 -#define EGL_MATCH_NATIVE_PIXMAP 0x3041 -#define EGL_OPENGL_ES2_BIT 0x0004 -#define EGL_VG_ALPHA_FORMAT 0x3088 -#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_VG_ALPHA_FORMAT_PRE 0x308C -#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 -#define EGL_VG_COLORSPACE 0x3087 -#define EGL_VG_COLORSPACE_sRGB 0x3089 -#define EGL_VG_COLORSPACE_LINEAR 0x308A -#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 -#endif /* EGL_VERSION_1_3 */ - -#ifndef EGL_VERSION_1_4 -#define EGL_VERSION_1_4 1 -#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) -#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 -#define EGL_MULTISAMPLE_RESOLVE 0x3099 -#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A -#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B -#define EGL_OPENGL_API 0x30A2 -#define EGL_OPENGL_BIT 0x0008 -#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 -EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); -#endif /* EGL_VERSION_1_4 */ - -#ifndef EGL_VERSION_1_5 -#define EGL_VERSION_1_5 1 -typedef void *EGLSync; -typedef intptr_t EGLAttrib; -typedef khronos_utime_nanoseconds_t EGLTime; -typedef void *EGLImage; -#define EGL_CONTEXT_MAJOR_VERSION 0x3098 -#define EGL_CONTEXT_MINOR_VERSION 0x30FB -#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD -#define EGL_NO_RESET_NOTIFICATION 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 -#define EGL_OPENGL_ES3_BIT 0x00000040 -#define EGL_CL_EVENT_HANDLE 0x309C -#define EGL_SYNC_CL_EVENT 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 -#define EGL_SYNC_TYPE 0x30F7 -#define EGL_SYNC_STATUS 0x30F1 -#define EGL_SYNC_CONDITION 0x30F8 -#define EGL_SIGNALED 0x30F2 -#define EGL_UNSIGNALED 0x30F3 -#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 -#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull -#define EGL_TIMEOUT_EXPIRED 0x30F5 -#define EGL_CONDITION_SATISFIED 0x30F6 -#define EGL_NO_SYNC ((EGLSync)0) -#define EGL_SYNC_FENCE 0x30F9 -#define EGL_GL_COLORSPACE 0x309D -#define EGL_GL_COLORSPACE_SRGB 0x3089 -#define EGL_GL_COLORSPACE_LINEAR 0x308A -#define EGL_GL_RENDERBUFFER 0x30B9 -#define EGL_GL_TEXTURE_2D 0x30B1 -#define EGL_GL_TEXTURE_LEVEL 0x30BC -#define EGL_GL_TEXTURE_3D 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET 0x30BD -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 -#define EGL_IMAGE_PRESERVED 0x30D2 -#define EGL_NO_IMAGE ((EGLImage)0) -EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); -EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); -#endif /* EGL_VERSION_1_5 */ - -#ifdef __cplusplus -} -#endif - -#endif /* __egl_h_ */ - - - -#ifndef __eglext_h_ -#define __eglext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ -*/ - -/*#include <EGL/eglplatform.h>*/ - -#define EGL_EGLEXT_VERSION 20150623 - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: _nomatch_^ - * Default extensions included: egl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_KHR_cl_event -#define EGL_KHR_cl_event 1 -#define EGL_CL_EVENT_HANDLE_KHR 0x309C -#define EGL_SYNC_CL_EVENT_KHR 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF -#endif /* EGL_KHR_cl_event */ - -#ifndef EGL_KHR_cl_event2 -#define EGL_KHR_cl_event2 1 -typedef void *EGLSyncKHR; -typedef intptr_t EGLAttribKHR; -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#endif -#endif /* EGL_KHR_cl_event2 */ - -#ifndef EGL_KHR_client_get_all_proc_addresses -#define EGL_KHR_client_get_all_proc_addresses 1 -#endif /* EGL_KHR_client_get_all_proc_addresses */ - -#ifndef EGL_KHR_config_attribs -#define EGL_KHR_config_attribs 1 -#define EGL_CONFORMANT_KHR 0x3042 -#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 -#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 -#endif /* EGL_KHR_config_attribs */ - -#ifndef EGL_KHR_create_context -#define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 -#endif /* EGL_KHR_create_context */ - -#ifndef EGL_KHR_create_context_no_error -#define EGL_KHR_create_context_no_error 1 -#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 -#endif /* EGL_KHR_create_context_no_error */ - -#ifndef EGL_KHR_fence_sync -#define EGL_KHR_fence_sync 1 -typedef khronos_utime_nanoseconds_t EGLTimeKHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 -#define EGL_SYNC_CONDITION_KHR 0x30F8 -#define EGL_SYNC_FENCE_KHR 0x30F9 -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_fence_sync */ - -#ifndef EGL_KHR_get_all_proc_addresses -#define EGL_KHR_get_all_proc_addresses 1 -#endif /* EGL_KHR_get_all_proc_addresses */ - -#ifndef EGL_KHR_gl_colorspace -#define EGL_KHR_gl_colorspace 1 -#define EGL_GL_COLORSPACE_KHR 0x309D -#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 -#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A -#endif /* EGL_KHR_gl_colorspace */ - -#ifndef EGL_KHR_gl_renderbuffer_image -#define EGL_KHR_gl_renderbuffer_image 1 -#define EGL_GL_RENDERBUFFER_KHR 0x30B9 -#endif /* EGL_KHR_gl_renderbuffer_image */ - -#ifndef EGL_KHR_gl_texture_2D_image -#define EGL_KHR_gl_texture_2D_image 1 -#define EGL_GL_TEXTURE_2D_KHR 0x30B1 -#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC -#endif /* EGL_KHR_gl_texture_2D_image */ - -#ifndef EGL_KHR_gl_texture_3D_image -#define EGL_KHR_gl_texture_3D_image 1 -#define EGL_GL_TEXTURE_3D_KHR 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD -#endif /* EGL_KHR_gl_texture_3D_image */ - -#ifndef EGL_KHR_gl_texture_cubemap_image -#define EGL_KHR_gl_texture_cubemap_image 1 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 -#endif /* EGL_KHR_gl_texture_cubemap_image */ - -#ifndef EGL_KHR_image -#define EGL_KHR_image 1 -typedef void *EGLImageKHR; -#define EGL_NATIVE_PIXMAP_KHR 0x30B0 -#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); -#endif -#endif /* EGL_KHR_image */ - -#ifndef EGL_KHR_image_base -#define EGL_KHR_image_base 1 -#define EGL_IMAGE_PRESERVED_KHR 0x30D2 -#endif /* EGL_KHR_image_base */ - -#ifndef EGL_KHR_image_pixmap -#define EGL_KHR_image_pixmap 1 -#endif /* EGL_KHR_image_pixmap */ - -#ifndef EGL_KHR_lock_surface -#define EGL_KHR_lock_surface 1 -#define EGL_READ_SURFACE_BIT_KHR 0x0001 -#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 -#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 -#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 -#define EGL_MATCH_FORMAT_KHR 0x3043 -#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 -#define EGL_FORMAT_RGB_565_KHR 0x30C1 -#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 -#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 -#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 -#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 -#define EGL_BITMAP_POINTER_KHR 0x30C6 -#define EGL_BITMAP_PITCH_KHR 0x30C7 -#define EGL_BITMAP_ORIGIN_KHR 0x30C8 -#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 -#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA -#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB -#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC -#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD -#define EGL_LOWER_LEFT_KHR 0x30CE -#define EGL_UPPER_LEFT_KHR 0x30CF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); -#endif -#endif /* EGL_KHR_lock_surface */ - -#ifndef EGL_KHR_lock_surface2 -#define EGL_KHR_lock_surface2 1 -#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 -#endif /* EGL_KHR_lock_surface2 */ - -#ifndef EGL_KHR_lock_surface3 -#define EGL_KHR_lock_surface3 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#endif -#endif /* EGL_KHR_lock_surface3 */ - -#ifndef EGL_KHR_partial_update -#define EGL_KHR_partial_update 1 -#define EGL_BUFFER_AGE_KHR 0x313D -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_partial_update */ - -#ifndef EGL_KHR_platform_android -#define EGL_KHR_platform_android 1 -#define EGL_PLATFORM_ANDROID_KHR 0x3141 -#endif /* EGL_KHR_platform_android */ - -#ifndef EGL_KHR_platform_gbm -#define EGL_KHR_platform_gbm 1 -#define EGL_PLATFORM_GBM_KHR 0x31D7 -#endif /* EGL_KHR_platform_gbm */ - -#ifndef EGL_KHR_platform_wayland -#define EGL_KHR_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 -#endif /* EGL_KHR_platform_wayland */ - -#ifndef EGL_KHR_platform_x11 -#define EGL_KHR_platform_x11 1 -#define EGL_PLATFORM_X11_KHR 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 -#endif /* EGL_KHR_platform_x11 */ - -#ifndef EGL_KHR_reusable_sync -#define EGL_KHR_reusable_sync 1 -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_STATUS_KHR 0x30F1 -#define EGL_SIGNALED_KHR 0x30F2 -#define EGL_UNSIGNALED_KHR 0x30F3 -#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 -#define EGL_CONDITION_SATISFIED_KHR 0x30F6 -#define EGL_SYNC_TYPE_KHR 0x30F7 -#define EGL_SYNC_REUSABLE_KHR 0x30FA -#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 -#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull -#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_reusable_sync */ - -#ifndef EGL_KHR_stream -#define EGL_KHR_stream 1 -typedef void *EGLStreamKHR; -typedef khronos_uint64_t EGLuint64KHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) -#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 -#define EGL_PRODUCER_FRAME_KHR 0x3212 -#define EGL_CONSUMER_FRAME_KHR 0x3213 -#define EGL_STREAM_STATE_KHR 0x3214 -#define EGL_STREAM_STATE_CREATED_KHR 0x3215 -#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 -#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 -#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 -#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 -#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A -#define EGL_BAD_STREAM_KHR 0x321B -#define EGL_BAD_STATE_KHR 0x321C -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_stream */ - -#ifndef EGL_KHR_stream_consumer_gltexture -#define EGL_KHR_stream_consumer_gltexture 1 -#ifdef EGL_KHR_stream -#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_consumer_gltexture */ - -#ifndef EGL_KHR_stream_cross_process_fd -#define EGL_KHR_stream_cross_process_fd 1 -typedef int EGLNativeFileDescriptorKHR; -#ifdef EGL_KHR_stream -#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) -typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_cross_process_fd */ - -#ifndef EGL_KHR_stream_fifo -#define EGL_KHR_stream_fifo 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC -#define EGL_STREAM_TIME_NOW_KHR 0x31FD -#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE -#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_fifo */ - -#ifndef EGL_KHR_stream_producer_aldatalocator -#define EGL_KHR_stream_producer_aldatalocator 1 -#ifdef EGL_KHR_stream -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_aldatalocator */ - -#ifndef EGL_KHR_stream_producer_eglsurface -#define EGL_KHR_stream_producer_eglsurface 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_BIT_KHR 0x0800 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_eglsurface */ - -#ifndef EGL_KHR_surfaceless_context -#define EGL_KHR_surfaceless_context 1 -#endif /* EGL_KHR_surfaceless_context */ - -#ifndef EGL_KHR_swap_buffers_with_damage -#define EGL_KHR_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_swap_buffers_with_damage */ - -#ifndef EGL_KHR_vg_parent_image -#define EGL_KHR_vg_parent_image 1 -#define EGL_VG_PARENT_IMAGE_KHR 0x30BA -#endif /* EGL_KHR_vg_parent_image */ - -#ifndef EGL_KHR_wait_sync -#define EGL_KHR_wait_sync 1 -typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif -#endif /* EGL_KHR_wait_sync */ - -#ifndef EGL_ANDROID_blob_cache -#define EGL_ANDROID_blob_cache 1 -typedef khronos_ssize_t EGLsizeiANDROID; -typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); -typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); -typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#endif -#endif /* EGL_ANDROID_blob_cache */ - -#ifndef EGL_ANDROID_framebuffer_target -#define EGL_ANDROID_framebuffer_target 1 -#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 -#endif /* EGL_ANDROID_framebuffer_target */ - -#ifndef EGL_ANDROID_image_native_buffer -#define EGL_ANDROID_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_ANDROID 0x3140 -#endif /* EGL_ANDROID_image_native_buffer */ - -#ifndef EGL_ANDROID_native_fence_sync -#define EGL_ANDROID_native_fence_sync 1 -#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 -#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 -#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 -#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 -typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); -#endif -#endif /* EGL_ANDROID_native_fence_sync */ - -#ifndef EGL_ANDROID_recordable -#define EGL_ANDROID_recordable 1 -#define EGL_RECORDABLE_ANDROID 0x3142 -#endif /* EGL_ANDROID_recordable */ - -#ifndef EGL_ANGLE_d3d_share_handle_client_buffer -#define EGL_ANGLE_d3d_share_handle_client_buffer 1 -#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 -#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ - -#ifndef EGL_ANGLE_device_d3d -#define EGL_ANGLE_device_d3d 1 -#define EGL_D3D9_DEVICE_ANGLE 0x33A0 -#define EGL_D3D11_DEVICE_ANGLE 0x33A1 -#endif /* EGL_ANGLE_device_d3d */ - -#ifndef EGL_ANGLE_query_surface_pointer -#define EGL_ANGLE_query_surface_pointer 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#endif -#endif /* EGL_ANGLE_query_surface_pointer */ - -#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle -#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 -#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ - -#ifndef EGL_ANGLE_window_fixed_size -#define EGL_ANGLE_window_fixed_size 1 -#define EGL_FIXED_SIZE_ANGLE 0x3201 -#endif /* EGL_ANGLE_window_fixed_size */ - -#ifndef EGL_ARM_pixmap_multisample_discard -#define EGL_ARM_pixmap_multisample_discard 1 -#define EGL_DISCARD_SAMPLES_ARM 0x3286 -#endif /* EGL_ARM_pixmap_multisample_discard */ - -#ifndef EGL_EXT_buffer_age -#define EGL_EXT_buffer_age 1 -#define EGL_BUFFER_AGE_EXT 0x313D -#endif /* EGL_EXT_buffer_age */ - -#ifndef EGL_EXT_client_extensions -#define EGL_EXT_client_extensions 1 -#endif /* EGL_EXT_client_extensions */ - -#ifndef EGL_EXT_create_context_robustness -#define EGL_EXT_create_context_robustness 1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 -#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF -#endif /* EGL_EXT_create_context_robustness */ - -#ifndef EGL_EXT_device_base -#define EGL_EXT_device_base 1 -typedef void *EGLDeviceEXT; -#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) -#define EGL_BAD_DEVICE_EXT 0x322B -#define EGL_DEVICE_EXT 0x322C -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#endif -#endif /* EGL_EXT_device_base */ - -#ifndef EGL_EXT_device_drm -#define EGL_EXT_device_drm 1 -#define EGL_DRM_DEVICE_FILE_EXT 0x3233 -#endif /* EGL_EXT_device_drm */ - -#ifndef EGL_EXT_device_enumeration -#define EGL_EXT_device_enumeration 1 -#endif /* EGL_EXT_device_enumeration */ - -#ifndef EGL_EXT_device_openwf -#define EGL_EXT_device_openwf 1 -#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 -#endif /* EGL_EXT_device_openwf */ - -#ifndef EGL_EXT_device_query -#define EGL_EXT_device_query 1 -#endif /* EGL_EXT_device_query */ - -#ifndef EGL_EXT_image_dma_buf_import -#define EGL_EXT_image_dma_buf_import 1 -#define EGL_LINUX_DMA_BUF_EXT 0x3270 -#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 -#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 -#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 -#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 -#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 -#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 -#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 -#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 -#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 -#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A -#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B -#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C -#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D -#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E -#define EGL_ITU_REC601_EXT 0x327F -#define EGL_ITU_REC709_EXT 0x3280 -#define EGL_ITU_REC2020_EXT 0x3281 -#define EGL_YUV_FULL_RANGE_EXT 0x3282 -#define EGL_YUV_NARROW_RANGE_EXT 0x3283 -#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 -#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 -#endif /* EGL_EXT_image_dma_buf_import */ - -#ifndef EGL_EXT_multiview_window -#define EGL_EXT_multiview_window 1 -#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 -#endif /* EGL_EXT_multiview_window */ - -#ifndef EGL_EXT_output_base -#define EGL_EXT_output_base 1 -typedef void *EGLOutputLayerEXT; -typedef void *EGLOutputPortEXT; -#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) -#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) -#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D -#define EGL_BAD_OUTPUT_PORT_EXT 0x322E -#define EGL_SWAP_INTERVAL_EXT 0x322F -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#endif -#endif /* EGL_EXT_output_base */ - -#ifndef EGL_EXT_output_drm -#define EGL_EXT_output_drm 1 -#define EGL_DRM_CRTC_EXT 0x3234 -#define EGL_DRM_PLANE_EXT 0x3235 -#define EGL_DRM_CONNECTOR_EXT 0x3236 -#endif /* EGL_EXT_output_drm */ - -#ifndef EGL_EXT_output_openwf -#define EGL_EXT_output_openwf 1 -#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 -#define EGL_OPENWF_PORT_ID_EXT 0x3239 -#endif /* EGL_EXT_output_openwf */ - -#ifndef EGL_EXT_platform_base -#define EGL_EXT_platform_base 1 -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#endif -#endif /* EGL_EXT_platform_base */ - -#ifndef EGL_EXT_platform_device -#define EGL_EXT_platform_device 1 -#define EGL_PLATFORM_DEVICE_EXT 0x313F -#endif /* EGL_EXT_platform_device */ - -#ifndef EGL_EXT_platform_wayland -#define EGL_EXT_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 -#endif /* EGL_EXT_platform_wayland */ - -#ifndef EGL_EXT_platform_x11 -#define EGL_EXT_platform_x11 1 -#define EGL_PLATFORM_X11_EXT 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 -#endif /* EGL_EXT_platform_x11 */ - -#ifndef EGL_EXT_protected_surface -#define EGL_EXT_protected_surface 1 -#define EGL_PROTECTED_CONTENT_EXT 0x32C0 -#endif /* EGL_EXT_protected_surface */ - -#ifndef EGL_EXT_stream_consumer_egloutput -#define EGL_EXT_stream_consumer_egloutput 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#endif -#endif /* EGL_EXT_stream_consumer_egloutput */ - -#ifndef EGL_EXT_swap_buffers_with_damage -#define EGL_EXT_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_EXT_swap_buffers_with_damage */ - -#ifndef EGL_EXT_yuv_surface -#define EGL_EXT_yuv_surface 1 -#define EGL_YUV_ORDER_EXT 0x3301 -#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 -#define EGL_YUV_SUBSAMPLE_EXT 0x3312 -#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 -#define EGL_YUV_CSC_STANDARD_EXT 0x330A -#define EGL_YUV_PLANE_BPP_EXT 0x331A -#define EGL_YUV_BUFFER_EXT 0x3300 -#define EGL_YUV_ORDER_YUV_EXT 0x3302 -#define EGL_YUV_ORDER_YVU_EXT 0x3303 -#define EGL_YUV_ORDER_YUYV_EXT 0x3304 -#define EGL_YUV_ORDER_UYVY_EXT 0x3305 -#define EGL_YUV_ORDER_YVYU_EXT 0x3306 -#define EGL_YUV_ORDER_VYUY_EXT 0x3307 -#define EGL_YUV_ORDER_AYUV_EXT 0x3308 -#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 -#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 -#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 -#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 -#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 -#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B -#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C -#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D -#define EGL_YUV_PLANE_BPP_0_EXT 0x331B -#define EGL_YUV_PLANE_BPP_8_EXT 0x331C -#define EGL_YUV_PLANE_BPP_10_EXT 0x331D -#endif /* EGL_EXT_yuv_surface */ - -#ifndef EGL_HI_clientpixmap -#define EGL_HI_clientpixmap 1 -struct EGLClientPixmapHI { - void *pData; - EGLint iWidth; - EGLint iHeight; - EGLint iStride; -}; -#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#endif -#endif /* EGL_HI_clientpixmap */ - -#ifndef EGL_HI_colorformats -#define EGL_HI_colorformats 1 -#define EGL_COLOR_FORMAT_HI 0x8F70 -#define EGL_COLOR_RGB_HI 0x8F71 -#define EGL_COLOR_RGBA_HI 0x8F72 -#define EGL_COLOR_ARGB_HI 0x8F73 -#endif /* EGL_HI_colorformats */ - -#ifndef EGL_IMG_context_priority -#define EGL_IMG_context_priority 1 -#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 -#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 -#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 -#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 -#endif /* EGL_IMG_context_priority */ - -#ifndef EGL_MESA_drm_image -#define EGL_MESA_drm_image 1 -#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 -#define EGL_DRM_BUFFER_USE_MESA 0x31D1 -#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 -#define EGL_DRM_BUFFER_MESA 0x31D3 -#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 -#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 -#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#endif -#endif /* EGL_MESA_drm_image */ - -#ifndef EGL_MESA_image_dma_buf_export -#define EGL_MESA_image_dma_buf_export 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#endif -#endif /* EGL_MESA_image_dma_buf_export */ - -#ifndef EGL_MESA_platform_gbm -#define EGL_MESA_platform_gbm 1 -#define EGL_PLATFORM_GBM_MESA 0x31D7 -#endif /* EGL_MESA_platform_gbm */ - -#ifndef EGL_NOK_swap_region -#define EGL_NOK_swap_region 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region */ - -#ifndef EGL_NOK_swap_region2 -#define EGL_NOK_swap_region2 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region2 */ - -#ifndef EGL_NOK_texture_from_pixmap -#define EGL_NOK_texture_from_pixmap 1 -#define EGL_Y_INVERTED_NOK 0x307F -#endif /* EGL_NOK_texture_from_pixmap */ - -#ifndef EGL_NV_3dvision_surface -#define EGL_NV_3dvision_surface 1 -#define EGL_AUTO_STEREO_NV 0x3136 -#endif /* EGL_NV_3dvision_surface */ - -#ifndef EGL_NV_coverage_sample -#define EGL_NV_coverage_sample 1 -#define EGL_COVERAGE_BUFFERS_NV 0x30E0 -#define EGL_COVERAGE_SAMPLES_NV 0x30E1 -#endif /* EGL_NV_coverage_sample */ - -#ifndef EGL_NV_coverage_sample_resolve -#define EGL_NV_coverage_sample_resolve 1 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 -#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 -#endif /* EGL_NV_coverage_sample_resolve */ - -#ifndef EGL_NV_cuda_event -#define EGL_NV_cuda_event 1 -#define EGL_CUDA_EVENT_HANDLE_NV 0x323B -#define EGL_SYNC_CUDA_EVENT_NV 0x323C -#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D -#endif /* EGL_NV_cuda_event */ - -#ifndef EGL_NV_depth_nonlinear -#define EGL_NV_depth_nonlinear 1 -#define EGL_DEPTH_ENCODING_NV 0x30E2 -#define EGL_DEPTH_ENCODING_NONE_NV 0 -#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 -#endif /* EGL_NV_depth_nonlinear */ - -#ifndef EGL_NV_device_cuda -#define EGL_NV_device_cuda 1 -#define EGL_CUDA_DEVICE_NV 0x323A -#endif /* EGL_NV_device_cuda */ - -#ifndef EGL_NV_native_query -#define EGL_NV_native_query 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#endif -#endif /* EGL_NV_native_query */ - -#ifndef EGL_NV_post_convert_rounding -#define EGL_NV_post_convert_rounding 1 -#endif /* EGL_NV_post_convert_rounding */ - -#ifndef EGL_NV_post_sub_buffer -#define EGL_NV_post_sub_buffer 1 -#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE -typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#endif -#endif /* EGL_NV_post_sub_buffer */ - -#ifndef EGL_NV_stream_sync -#define EGL_NV_stream_sync 1 -#define EGL_SYNC_NEW_FRAME_NV 0x321F -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#endif -#endif /* EGL_NV_stream_sync */ - -#ifndef EGL_NV_sync -#define EGL_NV_sync 1 -typedef void *EGLSyncNV; -typedef khronos_utime_nanoseconds_t EGLTimeNV; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 -#define EGL_SYNC_STATUS_NV 0x30E7 -#define EGL_SIGNALED_NV 0x30E8 -#define EGL_UNSIGNALED_NV 0x30E9 -#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 -#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull -#define EGL_ALREADY_SIGNALED_NV 0x30EA -#define EGL_TIMEOUT_EXPIRED_NV 0x30EB -#define EGL_CONDITION_SATISFIED_NV 0x30EC -#define EGL_SYNC_TYPE_NV 0x30ED -#define EGL_SYNC_CONDITION_NV 0x30EE -#define EGL_SYNC_FENCE_NV 0x30EF -#define EGL_NO_SYNC_NV ((EGLSyncNV)0) -typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); -EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_sync */ - -#ifndef EGL_NV_system_time -#define EGL_NV_system_time 1 -typedef khronos_utime_nanoseconds_t EGLuint64NV; -#ifdef KHRONOS_SUPPORT_INT64 -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_system_time */ - -#ifndef EGL_TIZEN_image_native_buffer -#define EGL_TIZEN_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 -#endif /* EGL_TIZEN_image_native_buffer */ - -#ifndef EGL_TIZEN_image_native_surface -#define EGL_TIZEN_image_native_surface 1 -#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 -#endif /* EGL_TIZEN_image_native_surface */ - -#ifdef __cplusplus -} -#endif - -#endif /* __eglext_h_ */ - - -#endif /* _MSC_VER */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h deleted file mode 100644 index 1e6daae1..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_endian.h - * - * Functions for reading and writing endian-specific values - */ - -#ifndef SDL_endian_h_ -#define SDL_endian_h_ - -#include "SDL_stdinc.h" - -/** - * \name The two types of endianness - */ -/* @{ */ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 -/* @} */ - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#ifdef __linux__ -#include <endian.h> -#define SDL_BYTEORDER __BYTE_ORDER -#elif defined(__OpenBSD__) -#include <endian.h> -#define SDL_BYTEORDER BYTE_ORDER -#else -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MIPSEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* __linux__ */ -#endif /* !SDL_BYTEORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_endian.h - */ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - int result; - - __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); - return (Uint16)result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint16 SDL_Swap16(Uint16); -#pragma aux SDL_Swap16 = \ - "xchg al, ah" \ - parm [ax] \ - modify [ax]; -#else -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); - __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); - __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); - return result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint32 SDL_Swap32(Uint32); -#ifndef __SW_3 /* 486+ */ -#pragma aux SDL_Swap32 = \ - "bswap eax" \ - parm [eax] \ - modify [eax]; -#else /* 386-only */ -#pragma aux SDL_Swap32 = \ - "xchg al, ah" \ - "ror eax, 16" \ - "xchg al, ah" \ - parm [eax] \ - modify [eax]; -#endif -#else -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | - ((x >> 8) & 0x0000FF00) | (x >> 24))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - union - { - struct - { - Uint32 a, b; - } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), - "1"(v.s. - b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0": "=r"(x):"0"(x)); - return x; -} -#else -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif - - -SDL_FORCE_INLINE float -SDL_SwapFloat(float x) -{ - union - { - float f; - Uint32 ui32; - } swapper; - swapper.f = x; - swapper.ui32 = SDL_Swap32(swapper.ui32); - return swapper.f; -} - - -/** - * \name Swap to native - * Byteswap item from the specified endianness to the native endianness. - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapFloatLE(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#define SDL_SwapFloatBE(X) (X) -#endif -/* @} *//* Swap to native */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_endian_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h deleted file mode 100644 index 24416e69..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_error.h - * - * Simple error message routines for SDL. - */ - -#ifndef SDL_error_h_ -#define SDL_error_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Public functions */ -/* SDL_SetError() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); -extern DECLSPEC const char *SDLCALL SDL_GetError(void); -extern DECLSPEC void SDLCALL SDL_ClearError(void); - -/** - * \name Internal error functions - * - * \internal - * Private error reporting function - used internally. - */ -/* @{ */ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) -typedef enum -{ - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -/* SDL_Error() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); -/* @} *//* Internal error functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_error_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h deleted file mode 100644 index eaf57434..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h +++ /dev/null @@ -1,792 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_events.h - * - * Include file for SDL event handling. - */ - -#ifndef SDL_events_h_ -#define SDL_events_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_gamecontroller.h" -#include "SDL_quit.h" -#include "SDL_gesture.h" -#include "SDL_touch.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* General keyboard/mouse state definitions */ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 - -/** - * \brief The types of events that can be delivered. - */ -typedef enum -{ - SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ - - /* Application events */ - SDL_QUIT = 0x100, /**< User-requested quit */ - - /* These application events have special meaning on iOS, see README-ios.md for details */ - SDL_APP_TERMINATING, /**< The application is being terminated by the OS - Called on iOS in applicationWillTerminate() - Called on Android in onDestroy() - */ - SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. - Called on iOS in applicationDidReceiveMemoryWarning() - Called on Android in onLowMemory() - */ - SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background - Called on iOS in applicationWillResignActive() - Called on Android in onPause() - */ - SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time - Called on iOS in applicationDidEnterBackground() - Called on Android in onPause() - */ - SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground - Called on iOS in applicationWillEnterForeground() - Called on Android in onResume() - */ - SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive - Called on iOS in applicationDidBecomeActive() - Called on Android in onResume() - */ - - /* Display events */ - SDL_DISPLAYEVENT = 0x150, /**< Display state change */ - - /* Window events */ - SDL_WINDOWEVENT = 0x200, /**< Window state change */ - SDL_SYSWMEVENT, /**< System specific event */ - - /* Keyboard events */ - SDL_KEYDOWN = 0x300, /**< Key pressed */ - SDL_KEYUP, /**< Key released */ - SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ - SDL_TEXTINPUT, /**< Keyboard text input */ - SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an - input language or keyboard layout change. - */ - - /* Mouse events */ - SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_MOUSEWHEEL, /**< Mouse wheel motion */ - - /* Joystick events */ - SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ - SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ - - /* Game controller events */ - SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ - SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ - SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ - SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ - SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ - SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ - - /* Touch events */ - SDL_FINGERDOWN = 0x700, - SDL_FINGERUP, - SDL_FINGERMOTION, - - /* Gesture events */ - SDL_DOLLARGESTURE = 0x800, - SDL_DOLLARRECORD, - SDL_MULTIGESTURE, - - /* Clipboard events */ - SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ - - /* Drag and drop events */ - SDL_DROPFILE = 0x1000, /**< The system requests a file open */ - SDL_DROPTEXT, /**< text/plain drag-and-drop event */ - SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */ - SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ - - /* Audio hotplug events */ - SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ - SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ - - /* Sensor events */ - SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */ - - /* Render events */ - SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ - SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ - - /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, - * and should be allocated with SDL_RegisterEvents() - */ - SDL_USEREVENT = 0x8000, - - /** - * This last event is only for bounding internal arrays - */ - SDL_LASTEVENT = 0xFFFF -} SDL_EventType; - -/** - * \brief Fields shared by every event - */ -typedef struct SDL_CommonEvent -{ - Uint32 type; - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_CommonEvent; - -/** - * \brief Display state change event data (event.display.*) - */ -typedef struct SDL_DisplayEvent -{ - Uint32 type; /**< ::SDL_DISPLAYEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 display; /**< The associated display index */ - Uint8 event; /**< ::SDL_DisplayEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ -} SDL_DisplayEvent; - -/** - * \brief Window state change event data (event.window.*) - */ -typedef struct SDL_WindowEvent -{ - Uint32 type; /**< ::SDL_WINDOWEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The associated window */ - Uint8 event; /**< ::SDL_WindowEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ - Sint32 data2; /**< event dependent data */ -} SDL_WindowEvent; - -/** - * \brief Keyboard button event structure (event.key.*) - */ -typedef struct SDL_KeyboardEvent -{ - Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 repeat; /**< Non-zero if this is a key repeat */ - Uint8 padding2; - Uint8 padding3; - SDL_Keysym keysym; /**< The key that was pressed or released */ -} SDL_KeyboardEvent; - -#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text editing event structure (event.edit.*) - */ -typedef struct SDL_TextEditingEvent -{ - Uint32 type; /**< ::SDL_TEXTEDITING */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ - Sint32 start; /**< The start cursor of selected editing text */ - Sint32 length; /**< The length of selected editing text */ -} SDL_TextEditingEvent; - - -#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text input event structure (event.text.*) - */ -typedef struct SDL_TextInputEvent -{ - Uint32 type; /**< ::SDL_TEXTINPUT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ -} SDL_TextInputEvent; - -/** - * \brief Mouse motion event structure (event.motion.*) - */ -typedef struct SDL_MouseMotionEvent -{ - Uint32 type; /**< ::SDL_MOUSEMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint32 state; /**< The current button state */ - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ - Sint32 xrel; /**< The relative motion in the X direction */ - Sint32 yrel; /**< The relative motion in the Y direction */ -} SDL_MouseMotionEvent; - -/** - * \brief Mouse button event structure (event.button.*) - */ -typedef struct SDL_MouseButtonEvent -{ - Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ - Uint8 padding1; - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ -} SDL_MouseButtonEvent; - -/** - * \brief Mouse wheel event structure (event.wheel.*) - */ -typedef struct SDL_MouseWheelEvent -{ - Uint32 type; /**< ::SDL_MOUSEWHEEL */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ - Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ - Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ -} SDL_MouseWheelEvent; - -/** - * \brief Joystick axis motion event structure (event.jaxis.*) - */ -typedef struct SDL_JoyAxisEvent -{ - Uint32 type; /**< ::SDL_JOYAXISMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The joystick axis index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_JoyAxisEvent; - -/** - * \brief Joystick trackball motion event structure (event.jball.*) - */ -typedef struct SDL_JoyBallEvent -{ - Uint32 type; /**< ::SDL_JOYBALLMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 ball; /**< The joystick trackball index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** - * \brief Joystick hat position change event structure (event.jhat.*) - */ -typedef struct SDL_JoyHatEvent -{ - Uint32 type; /**< ::SDL_JOYHATMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value. - * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP - * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT - * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN - * - * Note that zero means the POV is centered. - */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyHatEvent; - -/** - * \brief Joystick button event structure (event.jbutton.*) - */ -typedef struct SDL_JoyButtonEvent -{ - Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyButtonEvent; - -/** - * \brief Joystick device event structure (event.jdevice.*) - */ -typedef struct SDL_JoyDeviceEvent -{ - Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ -} SDL_JoyDeviceEvent; - - -/** - * \brief Game controller axis motion event structure (event.caxis.*) - */ -typedef struct SDL_ControllerAxisEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_ControllerAxisEvent; - - -/** - * \brief Game controller button event structure (event.cbutton.*) - */ -typedef struct SDL_ControllerButtonEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The controller button (SDL_GameControllerButton) */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_ControllerButtonEvent; - - -/** - * \brief Controller device event structure (event.cdevice.*) - */ -typedef struct SDL_ControllerDeviceEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ -} SDL_ControllerDeviceEvent; - -/** - * \brief Audio device event structure (event.adevice.*) - */ -typedef struct SDL_AudioDeviceEvent -{ - Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ - Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; -} SDL_AudioDeviceEvent; - - -/** - * \brief Touch finger event structure (event.tfinger.*) - */ -typedef struct SDL_TouchFingerEvent -{ - Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - SDL_FingerID fingerId; - float x; /**< Normalized in the range 0...1 */ - float y; /**< Normalized in the range 0...1 */ - float dx; /**< Normalized in the range -1...1 */ - float dy; /**< Normalized in the range -1...1 */ - float pressure; /**< Normalized in the range 0...1 */ - Uint32 windowID; /**< The window underneath the finger, if any */ -} SDL_TouchFingerEvent; - - -/** - * \brief Multiple Finger Gesture Event (event.mgesture.*) - */ -typedef struct SDL_MultiGestureEvent -{ - Uint32 type; /**< ::SDL_MULTIGESTURE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - float dTheta; - float dDist; - float x; - float y; - Uint16 numFingers; - Uint16 padding; -} SDL_MultiGestureEvent; - - -/** - * \brief Dollar Gesture Event (event.dgesture.*) - */ -typedef struct SDL_DollarGestureEvent -{ - Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - SDL_GestureID gestureId; - Uint32 numFingers; - float error; - float x; /**< Normalized center of gesture */ - float y; /**< Normalized center of gesture */ -} SDL_DollarGestureEvent; - - -/** - * \brief An event used to request a file open by the system (event.drop.*) - * This event is enabled by default, you can disable it with SDL_EventState(). - * \note If this event is enabled, you must free the filename in the event. - */ -typedef struct SDL_DropEvent -{ - Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ - Uint32 windowID; /**< The window that was dropped on, if any */ -} SDL_DropEvent; - - -/** - * \brief Sensor event structure (event.sensor.*) - */ -typedef struct SDL_SensorEvent -{ - Uint32 type; /**< ::SDL_SENSORUPDATE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The instance ID of the sensor */ - float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ -} SDL_SensorEvent; - -/** - * \brief The "quit requested" event - */ -typedef struct SDL_QuitEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_QuitEvent; - -/** - * \brief OS Specific event - */ -typedef struct SDL_OSEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_OSEvent; - -/** - * \brief A user-defined event type (event.user.*) - */ -typedef struct SDL_UserEvent -{ - Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The associated window if any */ - Sint32 code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ -} SDL_UserEvent; - - -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; - -/** - * \brief A video driver dependent system event (event.syswm.*) - * This event is disabled by default, you can enable it with SDL_EventState() - * - * \note If you want to use this event, you should include SDL_syswm.h. - */ -typedef struct SDL_SysWMEvent -{ - Uint32 type; /**< ::SDL_SYSWMEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ -} SDL_SysWMEvent; - -/** - * \brief General event structure - */ -typedef union SDL_Event -{ - Uint32 type; /**< Event type, shared with all events */ - SDL_CommonEvent common; /**< Common event data */ - SDL_DisplayEvent display; /**< Display event data */ - SDL_WindowEvent window; /**< Window event data */ - SDL_KeyboardEvent key; /**< Keyboard event data */ - SDL_TextEditingEvent edit; /**< Text editing event data */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ - SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ - SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ - SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ - SDL_AudioDeviceEvent adevice; /**< Audio device event data */ - SDL_SensorEvent sensor; /**< Sensor event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_MultiGestureEvent mgesture; /**< Gesture event data */ - SDL_DollarGestureEvent dgesture; /**< Gesture event data */ - SDL_DropEvent drop; /**< Drag and drop event data */ - - /* This is necessary for ABI compatibility between Visual C++ and GCC - Visual C++ will respect the push pack pragma and use 52 bytes for - this structure, and GCC will use the alignment of the largest datatype - within the union, which is 8 bytes. - - So... we'll add padding to force the size to be 56 bytes for both. - */ - Uint8 padding[56]; -} SDL_Event; - -/* Make sure we haven't broken binary compatibility */ -SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56); - - -/* Function prototypes */ - -/** - * Pumps the event loop, gathering events from the input devices. - * - * This function updates the event queue and internal input device state. - * - * This should only be run in the thread that sets the video mode. - */ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -/* @{ */ -typedef enum -{ - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; - -/** - * Checks the event queue for messages and optionally returns them. - * - * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to - * the back of the event queue. - * - * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front - * of the event queue, within the specified minimum and maximum type, - * will be returned and will not be removed from the queue. - * - * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front - * of the event queue, within the specified minimum and maximum type, - * will be returned and will be removed from the queue. - * - * \return The number of events actually stored, or -1 if there was an error. - * - * This function is thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, - SDL_eventaction action, - Uint32 minType, Uint32 maxType); -/* @} */ - -/** - * Checks to see if certain event types are in the event queue. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); - -/** - * This function clears events from the event queue - * This function only affects currently queued events. If you want to make - * sure that all pending OS events are flushed, you can call SDL_PumpEvents() - * on the main thread immediately before the flush call. - */ -extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); -extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); - -/** - * \brief Polls for currently pending events. - * - * \return 1 if there are any pending events, or 0 if there are none available. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); - -/** - * \brief Waits indefinitely for the next available event. - * - * \return 1, or 0 if there was an error while waiting for events. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); - -/** - * \brief Waits until the specified timeout (in milliseconds) for the next - * available event. - * - * \return 1, or 0 if there was an error while waiting for events. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - * \param timeout The timeout (in milliseconds) to wait for next event. - */ -extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, - int timeout); - -/** - * \brief Add an event to the event queue. - * - * \return 1 on success, 0 if the event was filtered, or -1 if the event queue - * was full or there was some other error. - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); - -typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); - -/** - * Sets up a filter to process all events before they change internal state and - * are posted to the internal event queue. - * - * The filter is prototyped as: - * \code - * int SDL_EventFilter(void *userdata, SDL_Event * event); - * \endcode - * - * If the filter returns 1, then the event will be added to the internal queue. - * If it returns 0, then the event will be dropped from the queue, but the - * internal state will still be updated. This allows selective filtering of - * dynamically arriving events. - * - * \warning Be very careful of what you do in the event filter function, as - * it may run in a different thread! - * - * There is one caveat when dealing with the ::SDL_QuitEvent event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will - * be closed, otherwise the window will remain open if possible. - * - * If the quit event is generated by an interrupt signal, it will bypass the - * internal queue and be delivered to the application at the next event poll. - */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, - void *userdata); - -/** - * Return the current event filter - can be used to "chain" filters. - * If there is no event filter set, this function returns SDL_FALSE. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, - void **userdata); - -/** - * Add a function which is called when an event is added to the queue. - */ -extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Remove an event watch function added with SDL_AddEventWatch() - */ -extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Run the filter function on the current event queue, removing any - * events for which the filter returns 0. - */ -extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, - void *userdata); - -/* @{ */ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 - -/** - * This function allows you to set the state of processing certain events. - * - If \c state is set to ::SDL_IGNORE, that event will be automatically - * dropped from the event queue and will not be filtered. - * - If \c state is set to ::SDL_ENABLE, that event will be processed - * normally. - * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the - * current processing state of the specified event. - */ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); -/* @} */ -#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) - -/** - * This function allocates a set of user-defined events, and returns - * the beginning event number for that set of events. - * - * If there aren't enough user-defined events left, this function - * returns (Uint32)-1 - */ -extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_events_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h deleted file mode 100644 index 6d97e589..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_filesystem.h - * - * \brief Include file for filesystem SDL API functions - */ - -#ifndef SDL_filesystem_h_ -#define SDL_filesystem_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Get the path where the application resides. - * - * Get the "base path". This is the directory where the application was run - * from, which is probably the installation directory, and may or may not - * be the process's current working directory. - * - * This returns an absolute path in UTF-8 encoding, and is guaranteed to - * end with a path separator ('\\' on Windows, '/' most other places). - * - * The pointer returned by this function is owned by you. Please call - * SDL_free() on the pointer when you are done with it, or it will be a - * memory leak. This is not necessarily a fast call, though, so you should - * call this once near startup and save the string if you need it. - * - * Some platforms can't determine the application's path, and on other - * platforms, this might be meaningless. In such cases, this function will - * return NULL. - * - * \return String of base dir in UTF-8 encoding, or NULL on error. - * - * \sa SDL_GetPrefPath - */ -extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); - -/** - * \brief Get the user-and-app-specific path where files can be written. - * - * Get the "pref dir". This is meant to be where users can write personal - * files (preferences and save games, etc) that are specific to your - * application. This directory is unique per user, per application. - * - * This function will decide the appropriate location in the native filesystem, - * create the directory if necessary, and return a string of the absolute - * path to the directory in UTF-8 encoding. - * - * On Windows, the string might look like: - * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" - * - * On Linux, the string might look like: - * "/home/bob/.local/share/My Program Name/" - * - * On Mac OS X, the string might look like: - * "/Users/bob/Library/Application Support/My Program Name/" - * - * (etc.) - * - * You specify the name of your organization (if it's not a real organization, - * your name or an Internet domain you own might do) and the name of your - * application. These should be untranslated proper names. - * - * Both the org and app strings may become part of a directory name, so - * please follow these rules: - * - * - Try to use the same org string (including case-sensitivity) for - * all your applications that use this function. - * - Always use a unique app string for each one, and make sure it never - * changes for an app once you've decided on it. - * - Unicode characters are legal, as long as it's UTF-8 encoded, but... - * - ...only use letters, numbers, and spaces. Avoid punctuation like - * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. - * - * This returns an absolute path in UTF-8 encoding, and is guaranteed to - * end with a path separator ('\\' on Windows, '/' most other places). - * - * The pointer returned by this function is owned by you. Please call - * SDL_free() on the pointer when you are done with it, or it will be a - * memory leak. This is not necessarily a fast call, though, so you should - * call this once near startup and save the string if you need it. - * - * You should assume the path returned by this function is the only safe - * place to write files (and that SDL_GetBasePath(), while it might be - * writable, or even the parent of the returned path, aren't where you - * should be writing things). - * - * Some platforms can't determine the pref path, and on other - * platforms, this might be meaningless. In such cases, this function will - * return NULL. - * - * \param org The name of your organization. - * \param app The name of your application. - * \return UTF-8 string of user dir in platform-dependent notation. NULL - * if there's a problem (creating directory failed, etc). - * - * \sa SDL_GetBasePath - */ -extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_filesystem_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h deleted file mode 100644 index 5ee8e8e9..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_gamecontroller.h - * - * Include file for SDL game controller event handling - */ - -#ifndef SDL_gamecontroller_h_ -#define SDL_gamecontroller_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_gamecontroller.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system - * for game controllers, and load appropriate drivers. - * - * If you would like to receive controller updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/** - * The gamecontroller structure used to identify an SDL game controller - */ -struct _SDL_GameController; -typedef struct _SDL_GameController SDL_GameController; - -typedef enum -{ - SDL_CONTROLLER_TYPE_UNKNOWN = 0, - SDL_CONTROLLER_TYPE_XBOX360, - SDL_CONTROLLER_TYPE_XBOXONE, - SDL_CONTROLLER_TYPE_PS3, - SDL_CONTROLLER_TYPE_PS4, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO -} SDL_GameControllerType; - -typedef enum -{ - SDL_CONTROLLER_BINDTYPE_NONE = 0, - SDL_CONTROLLER_BINDTYPE_BUTTON, - SDL_CONTROLLER_BINDTYPE_AXIS, - SDL_CONTROLLER_BINDTYPE_HAT -} SDL_GameControllerBindType; - -/** - * Get the SDL joystick layer binding for this controller button/axis mapping - */ -typedef struct SDL_GameControllerButtonBind -{ - SDL_GameControllerBindType bindType; - union - { - int button; - int axis; - struct { - int hat; - int hat_mask; - } hat; - } value; - -} SDL_GameControllerButtonBind; - - -/** - * To count the number of game controllers in the system for the following: - * int nJoysticks = SDL_NumJoysticks(); - * int nGameControllers = 0; - * for (int i = 0; i < nJoysticks; i++) { - * if (SDL_IsGameController(i)) { - * nGameControllers++; - * } - * } - * - * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: - * guid,name,mappings - * - * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. - * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. - * The mapping format for joystick is: - * bX - a joystick button, index X - * hX.Y - hat X with value Y - * aX - axis X of the joystick - * Buttons can be used as a controller axis and vice versa. - * - * This string shows an example of a valid mapping for a controller - * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", - * - */ - -/** - * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform() - * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt - * - * If \c freerw is non-zero, the stream will be closed after being read. - * - * \return number of mappings added, -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw); - -/** - * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() - * - * Convenience macro. - */ -#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Add or update an existing mapping configuration - * - * \return 1 if mapping is added, 0 if updated, -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString); - -/** - * Get the number of mappings installed - * - * \return the number of mappings - */ -extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void); - -/** - * Get the mapping at a particular index. - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range. - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index); - -/** - * Get a mapping string for a GUID - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid); - -/** - * Get a mapping string for an open GameController - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); - -/** - * Is the joystick on this index supported by the game controller interface? - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); - -/** - * Get the implementation dependent name of a game controller. - * This can be called before any controllers are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); - -/** - * Get the type of a game controller. - * This can be called before any controllers are opened. - */ -extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); - -/** - * Get the mapping of a game controller. - * This can be called before any controllers are opened. - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available - */ -extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index); - -/** - * Open a game controller for use. - * The index passed as an argument refers to the N'th game controller on the system. - * This index is not the value which will identify this controller in future - * controller events. The joystick's instance id (::SDL_JoystickID) will be - * used there instead. - * - * \return A controller identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); - -/** - * Return the SDL_GameController associated with an instance id. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); - -/** - * Return the SDL_GameController associated with a player index. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); - -/** - * Return the name for this currently opened controller - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); - -/** - * Return the type of this currently opened controller - */ -extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); - -/** - * Get the player index of an opened game controller, or -1 if it's not available - * - * For XInput controllers this returns the XInput user index. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); - -/** - * Set the player index of an opened game controller - */ -extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); - -/** - * Get the USB vendor ID of an opened controller, if available. - * If the vendor ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); - -/** - * Get the USB product ID of an opened controller, if available. - * If the product ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); - -/** - * Get the product version of an opened controller, if available. - * If the product version isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); - -/** - * Returns SDL_TRUE if the controller has been opened and currently connected, - * or SDL_FALSE if it has not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); - -/** - * Get the underlying joystick object used by a controller - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); - -/** - * Enable/disable controller event polling. - * - * If controller events are disabled, you must call SDL_GameControllerUpdate() - * yourself and check the state of the controller when you want controller - * information. - * - * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); - -/** - * Update the current state of the open game controllers. - * - * This is called automatically by the event loop if any game controller - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); - - -/** - * The list of axes available from a controller - * - * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, - * and are centered within ~8000 of zero, though advanced UI will allow users to set - * or autodetect the dead zone, which varies between controllers. - * - * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. - */ -typedef enum -{ - SDL_CONTROLLER_AXIS_INVALID = -1, - SDL_CONTROLLER_AXIS_LEFTX, - SDL_CONTROLLER_AXIS_LEFTY, - SDL_CONTROLLER_AXIS_RIGHTX, - SDL_CONTROLLER_AXIS_RIGHTY, - SDL_CONTROLLER_AXIS_TRIGGERLEFT, - SDL_CONTROLLER_AXIS_TRIGGERRIGHT, - SDL_CONTROLLER_AXIS_MAX -} SDL_GameControllerAxis; - -/** - * turn this string into a axis mapping - */ -extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); - -/** - * turn this axis enum into a string mapping - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); - -/** - * Get the SDL joystick layer binding for this controller button mapping - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * Get the current state of an axis control on a game controller. - * - * The state is a value ranging from -32768 to 32767 (except for the triggers, - * which range from 0 to 32767). - * - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * The list of buttons available from a controller - */ -typedef enum -{ - SDL_CONTROLLER_BUTTON_INVALID = -1, - SDL_CONTROLLER_BUTTON_A, - SDL_CONTROLLER_BUTTON_B, - SDL_CONTROLLER_BUTTON_X, - SDL_CONTROLLER_BUTTON_Y, - SDL_CONTROLLER_BUTTON_BACK, - SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_START, - SDL_CONTROLLER_BUTTON_LEFTSTICK, - SDL_CONTROLLER_BUTTON_RIGHTSTICK, - SDL_CONTROLLER_BUTTON_LEFTSHOULDER, - SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, - SDL_CONTROLLER_BUTTON_DPAD_UP, - SDL_CONTROLLER_BUTTON_DPAD_DOWN, - SDL_CONTROLLER_BUTTON_DPAD_LEFT, - SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - SDL_CONTROLLER_BUTTON_MAX -} SDL_GameControllerButton; - -/** - * turn this string into a button mapping - */ -extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); - -/** - * turn this button enum into a string mapping - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); - -/** - * Get the SDL joystick layer binding for this controller button mapping - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - - -/** - * Get the current state of a button on a game controller. - * - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - -/** - * Trigger a rumble effect - * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. - * - * \param gamecontroller The controller to vibrate - * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF - * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * - * \return 0, or -1 if rumble isn't supported on this joystick - */ -extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); - -/** - * Close a controller previously opened with SDL_GameControllerOpen(). - */ -extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_gamecontroller_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h deleted file mode 100644 index 9d25e9c1..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_gesture.h - * - * Include file for SDL gesture event handling. - */ - -#ifndef SDL_gesture_h_ -#define SDL_gesture_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "SDL_touch.h" - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_GestureID; - -/* Function prototypes */ - -/** - * \brief Begin Recording a gesture on the specified touch, or all touches (-1) - * - * - */ -extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); - - -/** - * \brief Save all currently loaded Dollar Gesture templates - * - * - */ -extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); - -/** - * \brief Save a currently loaded Dollar Gesture template - * - * - */ -extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); - - -/** - * \brief Load Dollar Gesture templates from a file - * - * - */ -extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_gesture_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h deleted file mode 100644 index 07562768..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h +++ /dev/null @@ -1,1238 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_haptic.h - * - * \brief The SDL haptic subsystem allows you to control haptic (force feedback) - * devices. - * - * The basic usage is as follows: - * - Initialize the subsystem (::SDL_INIT_HAPTIC). - * - Open a haptic device. - * - SDL_HapticOpen() to open from index. - * - SDL_HapticOpenFromJoystick() to open from an existing joystick. - * - Create an effect (::SDL_HapticEffect). - * - Upload the effect with SDL_HapticNewEffect(). - * - Run the effect with SDL_HapticRunEffect(). - * - (optional) Free the effect with SDL_HapticDestroyEffect(). - * - Close the haptic device with SDL_HapticClose(). - * - * \par Simple rumble example: - * \code - * SDL_Haptic *haptic; - * - * // Open the device - * haptic = SDL_HapticOpen( 0 ); - * if (haptic == NULL) - * return -1; - * - * // Initialize simple rumble - * if (SDL_HapticRumbleInit( haptic ) != 0) - * return -1; - * - * // Play effect at 50% strength for 2 seconds - * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) - * return -1; - * SDL_Delay( 2000 ); - * - * // Clean up - * SDL_HapticClose( haptic ); - * \endcode - * - * \par Complete example: - * \code - * int test_haptic( SDL_Joystick * joystick ) { - * SDL_Haptic *haptic; - * SDL_HapticEffect effect; - * int effect_id; - * - * // Open the device - * haptic = SDL_HapticOpenFromJoystick( joystick ); - * if (haptic == NULL) return -1; // Most likely joystick isn't haptic - * - * // See if it can do sine waves - * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { - * SDL_HapticClose(haptic); // No sine effect - * return -1; - * } - * - * // Create the effect - * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default - * effect.type = SDL_HAPTIC_SINE; - * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates - * effect.periodic.direction.dir[0] = 18000; // Force comes from south - * effect.periodic.period = 1000; // 1000 ms - * effect.periodic.magnitude = 20000; // 20000/32767 strength - * effect.periodic.length = 5000; // 5 seconds long - * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength - * effect.periodic.fade_length = 1000; // Takes 1 second to fade away - * - * // Upload the effect - * effect_id = SDL_HapticNewEffect( haptic, &effect ); - * - * // Test the effect - * SDL_HapticRunEffect( haptic, effect_id, 1 ); - * SDL_Delay( 5000); // Wait for the effect to finish - * - * // We destroy the effect, although closing the device also does this - * SDL_HapticDestroyEffect( haptic, effect_id ); - * - * // Close the device - * SDL_HapticClose(haptic); - * - * return 0; // Success - * } - * \endcode - */ - -#ifndef SDL_haptic_h_ -#define SDL_haptic_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF). - * - * At the moment the magnitude variables are mixed between signed/unsigned, and - * it is also not made clear that ALL of those variables expect a max of 0x7FFF. - * - * Some platforms may have higher precision than that (Linux FF, Windows XInput) - * so we should fix the inconsistency in favor of higher possible precision, - * adjusting for platforms that use different scales. - * -flibit - */ - -/** - * \typedef SDL_Haptic - * - * \brief The haptic structure used to identify an SDL haptic. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - */ -struct _SDL_Haptic; -typedef struct _SDL_Haptic SDL_Haptic; - - -/** - * \name Haptic features - * - * Different haptic features a device can have. - */ -/* @{ */ - -/** - * \name Haptic effects - */ -/* @{ */ - -/** - * \brief Constant effect supported. - * - * Constant haptic effect. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_CONSTANT (1u<<0) - -/** - * \brief Sine wave effect supported. - * - * Periodic haptic effect that simulates sine waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SINE (1u<<1) - -/** - * \brief Left/Right effect supported. - * - * Haptic effect for direct control over high/low frequency motors. - * - * \sa SDL_HapticLeftRight - * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, - * we ran out of bits, and this is important for XInput devices. - */ -#define SDL_HAPTIC_LEFTRIGHT (1u<<2) - -/* !!! FIXME: put this back when we have more bits in 2.1 */ -/* #define SDL_HAPTIC_SQUARE (1<<2) */ - -/** - * \brief Triangle wave effect supported. - * - * Periodic haptic effect that simulates triangular waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_TRIANGLE (1u<<3) - -/** - * \brief Sawtoothup wave effect supported. - * - * Periodic haptic effect that simulates saw tooth up waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHUP (1u<<4) - -/** - * \brief Sawtoothdown wave effect supported. - * - * Periodic haptic effect that simulates saw tooth down waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5) - -/** - * \brief Ramp effect supported. - * - * Ramp haptic effect. - * - * \sa SDL_HapticRamp - */ -#define SDL_HAPTIC_RAMP (1u<<6) - -/** - * \brief Spring effect supported - uses axes position. - * - * Condition haptic effect that simulates a spring. Effect is based on the - * axes position. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_SPRING (1u<<7) - -/** - * \brief Damper effect supported - uses axes velocity. - * - * Condition haptic effect that simulates dampening. Effect is based on the - * axes velocity. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_DAMPER (1u<<8) - -/** - * \brief Inertia effect supported - uses axes acceleration. - * - * Condition haptic effect that simulates inertia. Effect is based on the axes - * acceleration. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_INERTIA (1u<<9) - -/** - * \brief Friction effect supported - uses axes movement. - * - * Condition haptic effect that simulates friction. Effect is based on the - * axes movement. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_FRICTION (1u<<10) - -/** - * \brief Custom effect is supported. - * - * User defined custom haptic effect. - */ -#define SDL_HAPTIC_CUSTOM (1u<<11) - -/* @} *//* Haptic effects */ - -/* These last few are features the device has, not effects */ - -/** - * \brief Device can set global gain. - * - * Device supports setting the global gain. - * - * \sa SDL_HapticSetGain - */ -#define SDL_HAPTIC_GAIN (1u<<12) - -/** - * \brief Device can set autocenter. - * - * Device supports setting autocenter. - * - * \sa SDL_HapticSetAutocenter - */ -#define SDL_HAPTIC_AUTOCENTER (1u<<13) - -/** - * \brief Device can be queried for effect status. - * - * Device supports querying effect status. - * - * \sa SDL_HapticGetEffectStatus - */ -#define SDL_HAPTIC_STATUS (1u<<14) - -/** - * \brief Device can be paused. - * - * Devices supports being paused. - * - * \sa SDL_HapticPause - * \sa SDL_HapticUnpause - */ -#define SDL_HAPTIC_PAUSE (1u<<15) - - -/** - * \name Direction encodings - */ -/* @{ */ - -/** - * \brief Uses polar coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_POLAR 0 - -/** - * \brief Uses cartesian coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_CARTESIAN 1 - -/** - * \brief Uses spherical coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_SPHERICAL 2 - -/* @} *//* Direction encodings */ - -/* @} *//* Haptic features */ - -/* - * Misc defines. - */ - -/** - * \brief Used to play a device an infinite number of times. - * - * \sa SDL_HapticRunEffect - */ -#define SDL_HAPTIC_INFINITY 4294967295U - - -/** - * \brief Structure that represents a haptic direction. - * - * This is the direction where the force comes from, - * instead of the direction in which the force is exerted. - * - * Directions can be specified by: - * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. - * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. - * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. - * - * Cardinal directions of the haptic device are relative to the positioning - * of the device. North is considered to be away from the user. - * - * The following diagram represents the cardinal directions: - * \verbatim - .--. - |__| .-------. - |=.| |.-----.| - |--| || || - | | |'-----'| - |__|~')_____(' - [ COMPUTER ] - - - North (0,-1) - ^ - | - | - (-1,0) West <----[ HAPTIC ]----> East (1,0) - | - | - v - South (0,1) - - - [ USER ] - \|||/ - (o o) - ---ooO-(_)-Ooo--- - \endverbatim - * - * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a - * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses - * the first \c dir parameter. The cardinal directions would be: - * - North: 0 (0 degrees) - * - East: 9000 (90 degrees) - * - South: 18000 (180 degrees) - * - West: 27000 (270 degrees) - * - * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions - * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses - * the first three \c dir parameters. The cardinal directions would be: - * - North: 0,-1, 0 - * - East: 1, 0, 0 - * - South: 0, 1, 0 - * - West: -1, 0, 0 - * - * The Z axis represents the height of the effect if supported, otherwise - * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you - * can use any multiple you want, only the direction matters. - * - * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. - * The first two \c dir parameters are used. The \c dir parameters are as - * follows (all values are in hundredths of degrees): - * - Degrees from (1, 0) rotated towards (0, 1). - * - Degrees towards (0, 0, 1) (device needs at least 3 axes). - * - * - * Example of force coming from the south with all encodings (force coming - * from the south means the user will have to pull the stick to counteract): - * \code - * SDL_HapticDirection direction; - * - * // Cartesian directions - * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. - * direction.dir[0] = 0; // X position - * direction.dir[1] = 1; // Y position - * // Assuming the device has 2 axes, we don't need to specify third parameter. - * - * // Polar directions - * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. - * direction.dir[0] = 18000; // Polar only uses first parameter - * - * // Spherical coordinates - * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding - * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. - * \endcode - * - * \sa SDL_HAPTIC_POLAR - * \sa SDL_HAPTIC_CARTESIAN - * \sa SDL_HAPTIC_SPHERICAL - * \sa SDL_HapticEffect - * \sa SDL_HapticNumAxes - */ -typedef struct SDL_HapticDirection -{ - Uint8 type; /**< The type of encoding. */ - Sint32 dir[3]; /**< The encoded direction. */ -} SDL_HapticDirection; - - -/** - * \brief A structure containing a template for a Constant effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect. - * - * A constant effect applies a constant force in the specified direction - * to the joystick. - * - * \sa SDL_HAPTIC_CONSTANT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticConstant -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Constant */ - Sint16 level; /**< Strength of the constant effect. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticConstant; - -/** - * \brief A structure containing a template for a Periodic effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SINE - * - ::SDL_HAPTIC_LEFTRIGHT - * - ::SDL_HAPTIC_TRIANGLE - * - ::SDL_HAPTIC_SAWTOOTHUP - * - ::SDL_HAPTIC_SAWTOOTHDOWN - * - * A periodic effect consists in a wave-shaped effect that repeats itself - * over time. The type determines the shape of the wave and the parameters - * determine the dimensions of the wave. - * - * Phase is given by hundredth of a degree meaning that giving the phase a value - * of 9000 will displace it 25% of its period. Here are sample values: - * - 0: No phase displacement. - * - 9000: Displaced 25% of its period. - * - 18000: Displaced 50% of its period. - * - 27000: Displaced 75% of its period. - * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. - * - * Examples: - * \verbatim - SDL_HAPTIC_SINE - __ __ __ __ - / \ / \ / \ / - / \__/ \__/ \__/ - - SDL_HAPTIC_SQUARE - __ __ __ __ __ - | | | | | | | | | | - | |__| |__| |__| |__| | - - SDL_HAPTIC_TRIANGLE - /\ /\ /\ /\ /\ - / \ / \ / \ / \ / - / \/ \/ \/ \/ - - SDL_HAPTIC_SAWTOOTHUP - /| /| /| /| /| /| /| - / | / | / | / | / | / | / | - / |/ |/ |/ |/ |/ |/ | - - SDL_HAPTIC_SAWTOOTHDOWN - \ |\ |\ |\ |\ |\ |\ | - \ | \ | \ | \ | \ | \ | \ | - \| \| \| \| \| \| \| - \endverbatim - * - * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HAPTIC_TRIANGLE - * \sa SDL_HAPTIC_SAWTOOTHUP - * \sa SDL_HAPTIC_SAWTOOTHDOWN - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticPeriodic -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, - ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or - ::SDL_HAPTIC_SAWTOOTHDOWN */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Periodic */ - Uint16 period; /**< Period of the wave. */ - Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ - Sint16 offset; /**< Mean value of the wave. */ - Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticPeriodic; - -/** - * \brief A structure containing a template for a Condition effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SPRING: Effect based on axes position. - * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. - * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. - * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. - * - * Direction is handled by condition internals instead of a direction member. - * The condition effect specific members have three parameters. The first - * refers to the X axis, the second refers to the Y axis and the third - * refers to the Z axis. The right terms refer to the positive side of the - * axis and the left terms refer to the negative side of the axis. Please - * refer to the ::SDL_HapticDirection diagram for which side is positive and - * which is negative. - * - * \sa SDL_HapticDirection - * \sa SDL_HAPTIC_SPRING - * \sa SDL_HAPTIC_DAMPER - * \sa SDL_HAPTIC_INERTIA - * \sa SDL_HAPTIC_FRICTION - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCondition -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, - ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ - SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Condition */ - Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ - Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ - Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ - Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ - Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ - Sint16 center[3]; /**< Position of the dead zone. */ -} SDL_HapticCondition; - -/** - * \brief A structure containing a template for a Ramp effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. - * - * The ramp effect starts at start strength and ends at end strength. - * It augments in linear fashion. If you use attack and fade with a ramp - * the effects get added to the ramp effect making the effect become - * quadratic instead of linear. - * - * \sa SDL_HAPTIC_RAMP - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticRamp -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_RAMP */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Ramp */ - Sint16 start; /**< Beginning strength level. */ - Sint16 end; /**< Ending strength level. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticRamp; - -/** - * \brief A structure containing a template for a Left/Right effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. - * - * The Left/Right effect is used to explicitly control the large and small - * motors, commonly found in modern game controllers. The small (right) motor - * is high frequency, and the large (left) motor is low frequency. - * - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticLeftRight -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ - - /* Replay */ - Uint32 length; /**< Duration of the effect in milliseconds. */ - - /* Rumble */ - Uint16 large_magnitude; /**< Control of the large controller motor. */ - Uint16 small_magnitude; /**< Control of the small controller motor. */ -} SDL_HapticLeftRight; - -/** - * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect. - * - * A custom force feedback effect is much like a periodic effect, where the - * application can define its exact shape. You will have to allocate the - * data yourself. Data should consist of channels * samples Uint16 samples. - * - * If channels is one, the effect is rotated using the defined direction. - * Otherwise it uses the samples in data for the different axes. - * - * \sa SDL_HAPTIC_CUSTOM - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCustom -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Custom */ - Uint8 channels; /**< Axes to use, minimum of one. */ - Uint16 period; /**< Sample periods. */ - Uint16 samples; /**< Amount of samples. */ - Uint16 *data; /**< Should contain channels*samples items. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticCustom; - -/** - * \brief The generic template for any haptic effect. - * - * All values max at 32767 (0x7FFF). Signed values also can be negative. - * Time values unless specified otherwise are in milliseconds. - * - * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 - * value. Neither delay, interval, attack_length nor fade_length support - * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. - * - * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of - * ::SDL_HAPTIC_INFINITY. - * - * Button triggers may not be supported on all devices, it is advised to not - * use them if possible. Buttons start at index 1 instead of index 0 like - * the joystick. - * - * If both attack_length and fade_level are 0, the envelope is not used, - * otherwise both values are used. - * - * Common parts: - * \code - * // Replay - All effects have this - * Uint32 length; // Duration of effect (ms). - * Uint16 delay; // Delay before starting effect. - * - * // Trigger - All effects have this - * Uint16 button; // Button that triggers effect. - * Uint16 interval; // How soon before effect can be triggered again. - * - * // Envelope - All effects except condition effects have this - * Uint16 attack_length; // Duration of the attack (ms). - * Uint16 attack_level; // Level at the start of the attack. - * Uint16 fade_length; // Duration of the fade out (ms). - * Uint16 fade_level; // Level at the end of the fade. - * \endcode - * - * - * Here we have an example of a constant effect evolution in time: - * \verbatim - Strength - ^ - | - | effect level --> _________________ - | / \ - | / \ - | / \ - | / \ - | attack_level --> | \ - | | | <--- fade_level - | - +--------------------------------------------------> Time - [--] [---] - attack_length fade_length - - [------------------][-----------------------] - delay length - \endverbatim - * - * Note either the attack_level or the fade_level may be above the actual - * effect level. - * - * \sa SDL_HapticConstant - * \sa SDL_HapticPeriodic - * \sa SDL_HapticCondition - * \sa SDL_HapticRamp - * \sa SDL_HapticLeftRight - * \sa SDL_HapticCustom - */ -typedef union SDL_HapticEffect -{ - /* Common for all force feedback effects */ - Uint16 type; /**< Effect type. */ - SDL_HapticConstant constant; /**< Constant effect. */ - SDL_HapticPeriodic periodic; /**< Periodic effect. */ - SDL_HapticCondition condition; /**< Condition effect. */ - SDL_HapticRamp ramp; /**< Ramp effect. */ - SDL_HapticLeftRight leftright; /**< Left/Right effect. */ - SDL_HapticCustom custom; /**< Custom effect. */ -} SDL_HapticEffect; - - -/* Function prototypes */ -/** - * \brief Count the number of haptic devices attached to the system. - * - * \return Number of haptic devices detected on the system. - */ -extern DECLSPEC int SDLCALL SDL_NumHaptics(void); - -/** - * \brief Get the implementation dependent name of a haptic device. - * - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - * - * \param device_index Index of the device to get its name. - * \return Name of the device or NULL on error. - * - * \sa SDL_NumHaptics - */ -extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); - -/** - * \brief Opens a haptic device for use. - * - * The index passed as an argument refers to the N'th haptic device on this - * system. - * - * When opening a haptic device, its gain will be set to maximum and - * autocenter will be disabled. To modify these values use - * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). - * - * \param device_index Index of the device to open. - * \return Device identifier or NULL on error. - * - * \sa SDL_HapticIndex - * \sa SDL_HapticOpenFromMouse - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - * \sa SDL_HapticSetGain - * \sa SDL_HapticSetAutocenter - * \sa SDL_HapticPause - * \sa SDL_HapticStopAll - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); - -/** - * \brief Checks if the haptic device at index has been opened. - * - * \param device_index Index to check to see if it has been opened. - * \return 1 if it has been opened or 0 if it hasn't. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticIndex - */ -extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); - -/** - * \brief Gets the index of a haptic device. - * - * \param haptic Haptic device to get the index of. - * \return The index of the haptic device or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpened - */ -extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); - -/** - * \brief Gets whether or not the current mouse has haptic capabilities. - * - * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. - * - * \sa SDL_HapticOpenFromMouse - */ -extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); - -/** - * \brief Tries to open a haptic device from the current mouse. - * - * \return The haptic device identifier or NULL on error. - * - * \sa SDL_MouseIsHaptic - * \sa SDL_HapticOpen - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); - -/** - * \brief Checks to see if a joystick has haptic features. - * - * \param joystick Joystick to test for haptic capabilities. - * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't - * or -1 if an error occurred. - * - * \sa SDL_HapticOpenFromJoystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); - -/** - * \brief Opens a haptic device for use from a joystick device. - * - * You must still close the haptic device separately. It will not be closed - * with the joystick. - * - * When opening from a joystick you should first close the haptic device before - * closing the joystick device. If not, on some implementations the haptic - * device will also get unallocated and you'll be unable to use force feedback - * on that device. - * - * \param joystick Joystick to create a haptic device from. - * \return A valid haptic device identifier on success or NULL on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticClose - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * - joystick); - -/** - * \brief Closes a haptic device previously opened with SDL_HapticOpen(). - * - * \param haptic Haptic device to close. - */ -extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); - -/** - * \brief Returns the number of effects a haptic device can store. - * - * On some platforms this isn't fully supported, and therefore is an - * approximation. Always check to see if your created effect was actually - * created and do not rely solely on SDL_HapticNumEffects(). - * - * \param haptic The haptic device to query effect max. - * \return The number of effects the haptic device can store or - * -1 on error. - * - * \sa SDL_HapticNumEffectsPlaying - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); - -/** - * \brief Returns the number of effects a haptic device can play at the same - * time. - * - * This is not supported on all platforms, but will always return a value. - * Added here for the sake of completeness. - * - * \param haptic The haptic device to query maximum playing effects. - * \return The number of effects the haptic device can play at the same time - * or -1 on error. - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); - -/** - * \brief Gets the haptic device's supported features in bitwise manner. - * - * Example: - * \code - * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { - * printf("We have constant haptic effect!\n"); - * } - * \endcode - * - * \param haptic The haptic device to query. - * \return Haptic features in bitwise manner (OR'd). - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticEffectSupported - */ -extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); - - -/** - * \brief Gets the number of haptic axes the device has. - * - * \sa SDL_HapticDirection - */ -extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); - -/** - * \brief Checks to see if effect is supported by haptic. - * - * \param haptic Haptic device to check on. - * \param effect Effect to check to see if it is supported. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. - * - * \sa SDL_HapticQuery - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, - SDL_HapticEffect * - effect); - -/** - * \brief Creates a new haptic effect on the device. - * - * \param haptic Haptic device to create the effect on. - * \param effect Properties of the effect to create. - * \return The identifier of the effect on success or -1 on error. - * - * \sa SDL_HapticUpdateEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, - SDL_HapticEffect * effect); - -/** - * \brief Updates the properties of an effect. - * - * Can be used dynamically, although behavior when dynamically changing - * direction may be strange. Specifically the effect may reupload itself - * and start playing from the start. You cannot change the type either when - * running SDL_HapticUpdateEffect(). - * - * \param haptic Haptic device that has the effect. - * \param effect Identifier of the effect to update. - * \param data New effect properties to use. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticNewEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, - int effect, - SDL_HapticEffect * data); - -/** - * \brief Runs the haptic effect on its associated haptic device. - * - * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over - * repeating the envelope (attack and fade) every time. If you only want the - * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length - * parameter. - * - * \param haptic Haptic device to run the effect on. - * \param effect Identifier of the haptic effect to run. - * \param iterations Number of iterations to run the effect. Use - * ::SDL_HAPTIC_INFINITY for infinity. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticStopEffect - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticGetEffectStatus - */ -extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, - int effect, - Uint32 iterations); - -/** - * \brief Stops the haptic effect on its associated haptic device. - * - * \param haptic Haptic device to stop the effect on. - * \param effect Identifier of the effect to stop. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, - int effect); - -/** - * \brief Destroys a haptic effect on the device. - * - * This will stop the effect if it's running. Effects are automatically - * destroyed when the device is closed. - * - * \param haptic Device to destroy the effect on. - * \param effect Identifier of the effect to destroy. - * - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, - int effect); - -/** - * \brief Gets the status of the current effect on the haptic device. - * - * Device must support the ::SDL_HAPTIC_STATUS feature. - * - * \param haptic Haptic device to query the effect status on. - * \param effect Identifier of the effect to query its status. - * \return 0 if it isn't playing, 1 if it is playing or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticStopEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, - int effect); - -/** - * \brief Sets the global gain of the device. - * - * Device must support the ::SDL_HAPTIC_GAIN feature. - * - * The user may specify the maximum gain by setting the environment variable - * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to - * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the - * maximum. - * - * \param haptic Haptic device to set the gain on. - * \param gain Value to set the gain to, should be between 0 and 100. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); - -/** - * \brief Sets the global autocenter of the device. - * - * Autocenter should be between 0 and 100. Setting it to 0 will disable - * autocentering. - * - * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. - * - * \param haptic Haptic device to set autocentering on. - * \param autocenter Value to set autocenter to, 0 disables autocentering. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, - int autocenter); - -/** - * \brief Pauses a haptic device. - * - * Device must support the ::SDL_HAPTIC_PAUSE feature. Call - * SDL_HapticUnpause() to resume playback. - * - * Do not modify the effects nor add new ones while the device is paused. - * That can cause all sorts of weird errors. - * - * \param haptic Haptic device to pause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticUnpause - */ -extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); - -/** - * \brief Unpauses a haptic device. - * - * Call to unpause after SDL_HapticPause(). - * - * \param haptic Haptic device to unpause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticPause - */ -extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); - -/** - * \brief Stops all the currently playing effects on a haptic device. - * - * \param haptic Haptic device to stop. - * \return 0 on success or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); - -/** - * \brief Checks to see if rumble is supported on a haptic device. - * - * \param haptic Haptic device to check to see if it supports rumble. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. - * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); - -/** - * \brief Initializes the haptic device for simple rumble playback. - * - * \param haptic Haptic device to initialize for simple rumble playback. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); - -/** - * \brief Runs simple rumble on a haptic device - * - * \param haptic Haptic device to play rumble effect on. - * \param strength Strength of the rumble to play as a 0-1 float value. - * \param length Length of the rumble to play in milliseconds. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); - -/** - * \brief Stops the simple rumble on a haptic device. - * - * \param haptic Haptic to stop the rumble on. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_haptic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h deleted file mode 100644 index d36815b9..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h +++ /dev/null @@ -1,1321 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_hints.h - * - * Official documentation for SDL configuration variables - * - * This file contains functions to set and get configuration hints, - * as well as listing each of them alphabetically. - * - * The convention for naming hints is SDL_HINT_X, where "SDL_X" is - * the environment variable that can be used to override the default. - * - * In general these hints are just that - they may or may not be - * supported or applicable on any given platform, but they provide - * a way for an application or user to give the library a hint as - * to how they would like the library to work. - */ - -#ifndef SDL_hints_h_ -#define SDL_hints_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. - * - * SDL can try to accelerate the SDL screen surface by using streaming - * textures with a 3D rendering engine. This variable controls whether and - * how this is done. - * - * This variable can be set to the following values: - * "0" - Disable 3D acceleration - * "1" - Enable 3D acceleration, using the default renderer. - * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) - * - * By default SDL tries to make a best guess for each platform whether - * to use acceleration or not. - */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" - -/** - * \brief A variable specifying which render driver to use. - * - * If the application doesn't pick a specific renderer to use, this variable - * specifies the name of the preferred renderer. If the preferred renderer - * can't be initialized, the normal default renderer is used. - * - * This variable is case insensitive and can be set to the following values: - * "direct3d" - * "opengl" - * "opengles2" - * "opengles" - * "metal" - * "software" - * - * The default varies by platform, but it's the first one in the list that - * is available on the current platform. - */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" - -/** - * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. - * - * This variable can be set to the following values: - * "0" - Disable shaders - * "1" - Enable shaders - * - * By default shaders are used if OpenGL supports them. - */ -#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" - -/** - * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. - * - * This variable can be set to the following values: - * "0" - Thread-safety is not enabled (faster) - * "1" - Thread-safety is enabled - * - * By default the Direct3D device is created with thread-safety disabled. - */ -#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" - -/** - * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. - * - * This variable does not have any effect on the Direct3D 9 based renderer. - * - * This variable can be set to the following values: - * "0" - Disable Debug Layer use - * "1" - Enable Debug Layer use - * - * By default, SDL does not use Direct3D Debug Layer. - */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" - -/** - * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize. - * - * This variable can be set to the following values: - * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen - * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen - * - * By default letterbox is used - */ -#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE" - -/** - * \brief A variable controlling the scaling quality - * - * This variable can be set to the following values: - * "0" or "nearest" - Nearest pixel sampling - * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) - * "2" or "best" - Currently this is the same as "linear" - * - * By default nearest pixel sampling is used - */ -#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" - -/** - * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. - * - * This variable can be set to the following values: - * "0" - Disable vsync - * "1" - Enable vsync - * - * By default SDL does not sync screen surface updates with vertical refresh. - */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" - -/** - * \brief A variable controlling whether the screensaver is enabled. - * - * This variable can be set to the following values: - * "0" - Disable screensaver - * "1" - Enable screensaver - * - * By default SDL will disable the screensaver. - */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" - -/** - * \brief A variable controlling whether the graphics context is externally managed. - * - * This variable can be set to the following values: - * "0" - SDL will manage graphics contexts that are attached to windows. - * "1" - Disable graphics context management on windows. - * - * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the - * context will be automatically saved and restored when pausing the application. Additionally, some - * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this - * behavior, which is desireable when the application manages the graphics context, such as - * an externally managed OpenGL context or attaching a Vulkan surface to the window. - */ -#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" - -/** - * \brief A variable controlling whether the X11 VidMode extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XVidMode - * "1" - Enable XVidMode - * - * By default SDL will use XVidMode if it is available. - */ -#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" - -/** - * \brief A variable controlling whether the X11 Xinerama extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable Xinerama - * "1" - Enable Xinerama - * - * By default SDL will use Xinerama if it is available. - */ -#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" - -/** - * \brief A variable controlling whether the X11 XRandR extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XRandR - * "1" - Enable XRandR - * - * By default SDL will not use XRandR because of window manager issues. - */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" - -/** - * \brief A variable forcing the visual ID chosen for new X11 windows - * - */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" - -/** - * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_PING - * "1" - Enable _NET_WM_PING - * - * By default SDL will use _NET_WM_PING, but for applications that know they - * will not always be able to respond to ping requests in a timely manner they can - * turn it off to avoid the window manager thinking the app is hung. - * The hint is checked in CreateWindow. - */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" - -/** - * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_BYPASS_COMPOSITOR - * "1" - Enable _NET_WM_BYPASS_COMPOSITOR - * - * By default SDL will use _NET_WM_BYPASS_COMPOSITOR - * - */ -#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" - -/** - * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden - * - * This variable can be set to the following values: - * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) - * "1" - The window frame is interactive when the cursor is hidden - * - * By default SDL will allow interaction with the window frame when the cursor is hidden - */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" - -/** - * \brief A variable to specify custom icon resource id from RC file on Windows platform - */ -#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON" -#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" - -/** - * \brief A variable controlling whether the windows message loop is processed by SDL - * - * This variable can be set to the following values: - * "0" - The window message loop is not run - * "1" - The window message loop is processed in SDL_PumpEvents() - * - * By default SDL will process the windows message loop - */ -#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" - -/** - * \brief A variable controlling whether grabbing input grabs the keyboard - * - * This variable can be set to the following values: - * "0" - Grab will affect only the mouse - * "1" - Grab will affect mouse and keyboard - * - * By default SDL will not grab the keyboard so system shortcuts still work. - */ -#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" - -/** - * \brief A variable setting the double click time, in milliseconds. - */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" - -/** - * \brief A variable setting the double click radius, in pixels. - */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" - -/** - * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode - */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" - -/** - * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode - */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" - -/** - * \brief A variable controlling whether relative mouse mode is implemented using mouse warping - * - * This variable can be set to the following values: - * "0" - Relative mouse mode uses raw input - * "1" - Relative mouse mode uses mouse warping - * - * By default SDL will use raw input for relative mouse mode - */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" - -/** - * \brief Allow mouse click events when clicking to focus an SDL window - * - * This variable can be set to the following values: - * "0" - Ignore mouse clicks that activate a window - * "1" - Generate events for mouse clicks that activate a window - * - * By default SDL will ignore mouse clicks that activate a window - */ -#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH" - -/** - * \brief A variable controlling whether touch events should generate synthetic mouse events - * - * This variable can be set to the following values: - * "0" - Touch events will not generate mouse events - * "1" - Touch events will generate mouse events - * - * By default SDL will generate mouse events for touch events - */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" - -/** - * \brief A variable controlling whether mouse events should generate synthetic touch events - * - * This variable can be set to the following values: - * "0" - Mouse events will not generate touch events (default for desktop platforms) - * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS) - */ - -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" - -/** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. - * - */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" - -/** - * \brief A variable controlling whether the idle timer is disabled on iOS. - * - * When an iOS app does not receive touches for some time, the screen is - * dimmed automatically. For games where the accelerometer is the only input - * this is problematic. This functionality can be disabled by setting this - * hint. - * - * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() - * accomplish the same thing on iOS. They should be preferred over this hint. - * - * This variable can be set to the following values: - * "0" - Enable idle timer - * "1" - Disable idle timer - */ -#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" - -/** - * \brief A variable controlling which orientations are allowed on iOS/Android. - * - * In some circumstances it is necessary to be able to explicitly control - * which UI orientations are allowed. - * - * This variable is a space delimited list of the following values: - * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" - */ -#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" - -/** - * \brief A variable controlling whether controllers used with the Apple TV - * generate UI events. - * - * When UI events are generated by controller input, the app will be - * backgrounded when the Apple TV remote's menu button is pressed, and when the - * pause or B buttons on gamepads are pressed. - * - * More information about properly making use of controllers for the Apple TV - * can be found here: - * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/ - * - * This variable can be set to the following values: - * "0" - Controller input does not generate UI events (the default). - * "1" - Controller input generates UI events. - */ -#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" - -/** - * \brief A variable controlling whether the Apple TV remote's joystick axes - * will automatically match the rotation of the remote. - * - * This variable can be set to the following values: - * "0" - Remote orientation does not affect joystick axes (the default). - * "1" - Joystick axes are based on the orientation of the remote. - */ -#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" - -/** - * \brief A variable controlling whether the home indicator bar on iPhone X - * should be hidden. - * - * This variable can be set to the following values: - * "0" - The indicator bar is not hidden (default for windowed applications) - * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) - * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications) - */ -#define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" - -/** - * \brief A variable controlling whether the Android / iOS built-in - * accelerometer should be listed as a joystick device. - * - * This variable can be set to the following values: - * "0" - The accelerometer is not listed as a joystick - * "1" - The accelerometer is available as a 3 axis joystick (the default). - */ -#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" - -/** - * \brief A variable controlling whether the Android / tvOS remotes - * should be listed as joystick devices, instead of sending keyboard events. - * - * This variable can be set to the following values: - * "0" - Remotes send enter/escape/arrow key events - * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). - */ -#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" - -/** - * \brief A variable that lets you disable the detection and use of Xinput gamepad devices - * - * The variable can be set to the following values: - * "0" - Disable XInput detection (only uses direct input) - * "1" - Enable XInput detection (the default) - */ -#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" - -/** - * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. - * - * This hint is for backwards compatibility only and will be removed in SDL 2.1 - * - * The default value is "0". This hint must be set before SDL_Init() - */ -#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" - -/** - * \brief A variable that lets you manually hint extra gamecontroller db entries. - * - * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" - -/** - * \brief A variable that lets you provide a file with extra gamecontroller db entries. - * - * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE" - -/** - * \brief A variable containing a list of devices to skip when scanning for game controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES" - -/** - * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" - -/** - * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout. - * - * For example, on Nintendo Switch controllers, normally you'd get: - * - * (Y) - * (X) (B) - * (A) - * - * but if this hint is set, you'll get: - * - * (X) - * (Y) (A) - * (B) - * - * The variable can be set to the following values: - * "0" - Report the face buttons by position, as though they were on an Xbox controller. - * "1" - Report the face buttons by label instead of position - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" - -/** - * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. - * - * The variable can be set to the following values: - * "0" - Disable joystick & gamecontroller input events when the - * application is in the background. - * "1" - Enable joystick & gamecontroller input events when the - * application is in the background. - * - * The default value is "0". This hint may be set at any time. - */ -#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" - -/** - * \brief A variable controlling whether the HIDAPI joystick drivers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI drivers are not used - * "1" - HIDAPI drivers are used (the default) - * - * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. - */ -#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" - -/** - * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" - -/** - * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. - * - * This variable can be set to the following values: - * "0" - extended reports are not enabled (the default) - * "1" - extended reports - * - * Extended input reports allow rumble on Bluetooth PS4 controllers, but - * break DirectInput handling for applications that don't use SDL. - * - * Once extended reports are enabled, they can not be disabled without - * power cycling the controller. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" - -/** - * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" - -/** - * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs - * - * The variable can be set to the following values: - * "0" - Do not scan for Steam Controllers - * "1" - Scan for Steam Controllers (the default) - * - * The default value is "1". This hint must be set before initializing the joystick subsystem. - */ -#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" - - -/** - * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. - * This is a debugging aid for developers and not expected to be used by end users. The default is "1" - * - * This variable can be set to the following values: - * "0" - don't allow topmost - * "1" - allow topmost - */ -#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" - -/** - * \brief A variable that controls the timer resolution, in milliseconds. - * - * The higher resolution the timer, the more frequently the CPU services - * timer interrupts, and the more precise delays are, but this takes up - * power and CPU time. This hint is only used on Windows 7 and earlier. - * - * See this blog post for more information: - * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ - * - * If this variable is set to "0", the system timer resolution is not set. - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" - - -/** - * \brief A variable describing the content orientation on QtWayland-based platforms. - * - * On QtWayland platforms, windows are rotated client-side to allow for custom - * transitions. In order to correctly position overlays (e.g. volume bar) and - * gestures (e.g. events view, close/minimize gestures), the system needs to - * know in which orientation the application is currently drawing its contents. - * - * This does not cause the window to be rotated or resized, the application - * needs to take care of drawing the content in the right orientation (the - * framebuffer is always in portrait mode). - * - * This variable can be one of the following values: - * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape" - */ -#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION" - -/** - * \brief Flags to set on QtWayland windows to integrate with the native window manager. - * - * On QtWayland platforms, this hint controls the flags to set on the windows. - * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures. - * - * This variable is a space-separated list of the following values (empty = no flags): - * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager" - */ -#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS" - -/** -* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size -* -* Use this hint in case you need to set SDL's threads stack size to other than the default. -* This is specially useful if you build SDL against a non glibc libc library (such as musl) which -* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). -* Support for this hint is currently available only in the pthread, Windows, and PSP backend. -* -* Instead of this hint, in 2.0.9 and later, you can use -* SDL_CreateThreadWithStackSize(). This hint only works with the classic -* SDL_CreateThread(). -*/ -#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" - -/** - * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) - */ -#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" - -/** - * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac - * - * If present, holding ctrl while left clicking will generate a right click - * event when on Mac. - */ -#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" - -/** -* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries -* -* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It -* can use two different sets of binaries, those compiled by the user from source -* or those provided by the Chrome browser. In the later case, these binaries require -* that SDL loads a DLL providing the shader compiler. -* -* This variable can be set to the following values: -* "d3dcompiler_46.dll" - default, best for Vista or later. -* "d3dcompiler_43.dll" - for XP support. -* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. -* -*/ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" - -/** -* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). -* -* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has -* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly -* created SDL_Window: -* -* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is -* needed for example when sharing an OpenGL context across multiple windows. -* -* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for -* OpenGL rendering. -* -* This variable can be set to the following values: -* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should -* share a pixel format with. -*/ -#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" - -/** - * \brief A URL to a WinRT app's privacy policy - * - * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be - * be available in the Windows Settings charm, as accessed from within the app. - * SDL provides code to add a URL-based link there, which can point to the app's - * privacy policy. - * - * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL - * before calling any SDL_Init() functions. The contents of the hint should - * be a valid URL. For example, "http://www.example.com". - * - * The default value is "", which will prevent SDL from adding a privacy policy - * link to the Settings charm. This hint should only be set during app init. - * - * The label text of an app's "Privacy Policy" link may be customized via another - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that on Windows Phone, Microsoft does not provide standard UI - * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL - * will not get used on that platform. Network-enabled phone apps should display - * their privacy policy through some other, in-app means. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" - -/** \brief Label text for a WinRT app's privacy policy link - * - * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, - * Microsoft mandates that this policy be available via the Windows Settings charm. - * SDL provides code to add a link there, with its label text being set via the - * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that a privacy policy's contents are not set via this hint. A separate - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the - * policy. - * - * The contents of this hint should be encoded as a UTF8 string. - * - * The default value is "Privacy Policy". This hint should only be set during app - * initialization, preferably before any calls to SDL_Init(). - * - * For additional information on linking to a privacy policy, see the documentation for - * SDL_HINT_WINRT_PRIVACY_POLICY_URL. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" - -/** \brief Allows back-button-press events on Windows Phone to be marked as handled - * - * Windows Phone devices typically feature a Back button. When pressed, - * the OS will emit back-button-press events, which apps are expected to - * handle in an appropriate manner. If apps do not explicitly mark these - * events as 'Handled', then the OS will invoke its default behavior for - * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to - * terminate the app (and attempt to switch to the previous app, or to the - * device's home screen). - * - * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL - * to mark back-button-press events as Handled, if and when one is sent to - * the app. - * - * Internally, Windows Phone sends back button events as parameters to - * special back-button-press callback functions. Apps that need to respond - * to back-button-press events are expected to register one or more - * callback functions for such, shortly after being launched (during the - * app's initialization phase). After the back button is pressed, the OS - * will invoke these callbacks. If the app's callback(s) do not explicitly - * mark the event as handled by the time they return, or if the app never - * registers one of these callback, the OS will consider the event - * un-handled, and it will apply its default back button behavior (terminate - * the app). - * - * SDL registers its own back-button-press callback with the Windows Phone - * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN - * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which - * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. - * If the hint's value is set to "1", the back button event's Handled - * property will get set to 'true'. If the hint's value is set to something - * else, or if it is unset, SDL will leave the event's Handled property - * alone. (By default, the OS sets this property to 'false', to note.) - * - * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a - * back button is pressed, or can set it in direct-response to a back button - * being pressed. - * - * In order to get notified when a back button is pressed, SDL apps should - * register a callback function with SDL_AddEventWatch(), and have it listen - * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. - * (Alternatively, SDL_KEYUP events can be listened-for. Listening for - * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON - * set by such a callback, will be applied to the OS' current - * back-button-press event. - * - * More details on back button behavior in Windows Phone apps can be found - * at the following page, on Microsoft's developer site: - * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx - */ -#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" - -/** - * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. - * - * This hint only applies to Mac OS X. - * - * The variable can be set to the following values: - * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and - * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" - * button on their titlebars). - * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and - * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" - * button on their titlebars). - * - * The default value is "1". Spaces are disabled regardless of this hint if - * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before - * any windows are created. - */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" - -/** -* \brief When set don't force the SDL app to become a foreground process -* -* This hint only applies to Mac OS X. -* -*/ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" - -/** - * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" - -/** - * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" - -/** - * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. - * - * The variable can be set to the following values: - * "0" - SDL_TEXTEDITING events are sent, and it is the application's - * responsibility to render the text from these events and - * differentiate it somehow from committed text. (default) - * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, - * and text that is being composed will be rendered in its own UI. - */ -#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" - -/** - * \brief A variable to control whether we trap the Android back button to handle it manually. - * This is necessary for the right mouse button to work on some Android devices, or - * to be able to trap the back button for use in your code reliably. If set to true, - * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of - * SDL_SCANCODE_AC_BACK. - * - * The variable can be set to the following values: - * "0" - Back button will be handled as usual for system. (default) - * "1" - Back button will be trapped, allowing you to handle the key press - * manually. (This will also let right mouse click work on systems - * where the right mouse button functions as back.) - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" - -/** - * \brief A variable to control whether the event loop will block itself when the app is paused. - * - * The variable can be set to the following values: - * "0" - Non blocking. - * "1" - Blocking. (default) - * - * The value should be set before SDL is initialized. - */ -#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" - - /** - * \brief A variable to control whether the return key on the soft keyboard - * should hide the soft keyboard on Android and iOS. - * - * The variable can be set to the following values: - * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) - * "1" - The return key will hide the keyboard. - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" - -/** - * \brief override the binding element for keyboard inputs for Emscripten builds - * - * This hint only applies to the emscripten platform - * - * The variable can be one of - * "#window" - The javascript window object (this is the default) - * "#document" - The javascript document object - * "#screen" - the javascript window.screen object - * "#canvas" - the WebGL canvas element - * any other string without a leading # sign applies to the element on the page with that ID. - */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" - -/** - * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. - * - * This hint only applies to Unix-like platforms. - * - * The variable can be set to the following values: - * "0" - SDL will install a SIGINT and SIGTERM handler, and when it - * catches a signal, convert it into an SDL_QUIT event. - * "1" - SDL will not install a signal handler at all. - */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" - -/** - * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. - * - * The variable can be set to the following values: - * "0" - SDL will generate a window-close event when it sees Alt+F4. - * "1" - SDL will only do normal key handling for Alt+F4. - */ -#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" - -/** - * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. - * - * The bitmap header version 4 is required for proper alpha channel support and - * SDL will use it when required. Should this not be desired, this hint can - * force the use of the 40 byte header version which is supported everywhere. - * - * The variable can be set to the following values: - * "0" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file with an alpha mask. SDL will use the bitmap - * header version 4 and set the alpha mask accordingly. - * "1" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file without an alpha mask. The alpha channel data - * will be in the file, but applications are going to ignore it. - * - * The default value is "0". - */ -#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT" - -/** - * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception. - * The 0x406D1388 Exception is a trick used to inform Visual Studio of a - * thread's name, but it tends to cause problems with other debuggers, - * and the .NET runtime. Note that SDL 2.0.6 and later will still use - * the (safer) SetThreadDescription API, introduced in the Windows 10 - * Creators Update, if available. - * - * The variable can be set to the following values: - * "0" - SDL will raise the 0x406D1388 Exception to name threads. - * This is the default behavior of SDL <= 2.0.4. - * "1" - SDL will not raise this exception, and threads will be unnamed. (default) - * This is necessary with .NET languages or debuggers that aren't Visual Studio. - */ -#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" - -/** - * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI - * - * Also known as Z-order. The variable can take a negative or positive value. - * The default is 10000. - */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" - -/** - * \brief Tell the video driver that we only want a double buffer. - * - * By default, most lowlevel 2D APIs will use a triple buffer scheme that - * wastes no CPU time on waiting for vsync after issuing a flip, but - * introduces a frame of latency. On the other hand, using a double buffer - * scheme instead is recommended for cases where low latency is an important - * factor because we save a whole frame of latency. - * We do so by waiting for vsync immediately after issuing a flip, usually just - * after eglSwapBuffers call in the backend's *_SwapWindow function. - * - * Since it's driver-specific, it's only supported where possible and - * implemented. Currently supported the following drivers: - * - KMSDRM (kmsdrm) - * - Raspberry Pi (raspberrypi) - */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" - -/** - * \brief A variable controlling what driver to use for OpenGL ES contexts. - * - * On some platforms, currently Windows and X11, OpenGL drivers may support - * creating contexts with an OpenGL ES profile. By default SDL uses these - * profiles, when available, otherwise it attempts to load an OpenGL ES - * library, e.g. that provided by the ANGLE project. This variable controls - * whether SDL follows this default behaviour or will always load an - * OpenGL ES library. - * - * Circumstances where this is useful include - * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, - * or emulator, e.g. those from ARM, Imagination or Qualcomm. - * - Resolving OpenGL ES function addresses at link time by linking with - * the OpenGL ES library instead of querying them at run time with - * SDL_GL_GetProcAddress(). - * - * Caution: for an application to work with the default behaviour across - * different OpenGL drivers it must query the OpenGL ES function - * addresses at run time using SDL_GL_GetProcAddress(). - * - * This variable is ignored on most platforms because OpenGL ES is native - * or not supported. - * - * This variable can be set to the following values: - * "0" - Use ES profile of OpenGL, if available. (Default when not set.) - * "1" - Load OpenGL ES library using the default library names. - * - */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" - -/** - * \brief A variable controlling speed/quality tradeoff of audio resampling. - * - * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) - * to handle audio resampling. There are different resampling modes available - * that produce different levels of quality, using more CPU. - * - * If this hint isn't specified to a valid setting, or libsamplerate isn't - * available, SDL will use the default, internal resampling algorithm. - * - * Note that this is currently only applicable to resampling audio that is - * being written to a device for playback or audio being read from a device - * for capture. SDL_AudioCVT always uses the default resampler (although this - * might change for SDL 2.1). - * - * This hint is currently only checked at audio subsystem initialization. - * - * This variable can be set to the following values: - * - * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast) - * "1" or "fast" - Use fast, slightly higher quality resampling, if available - * "2" or "medium" - Use medium quality resampling, if available - * "3" or "best" - Use high quality resampling, if available - */ -#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE" - -/** - * \brief A variable controlling the audio category on iOS and Mac OS X - * - * This variable can be set to the following values: - * - * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default) - * "playback" - Use the AVAudioSessionCategoryPlayback category - * - * For more information, see Apple's documentation: - * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html - */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" - -/** - * \brief A variable controlling whether the 2D render API is compatible or efficient. - * - * This variable can be set to the following values: - * - * "0" - Don't use batching to make rendering more efficient. - * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls. - * - * Up to SDL 2.0.9, the render API would draw immediately when requested. Now - * it batches up draw requests and sends them all to the GPU only when forced - * to (during SDL_RenderPresent, when changing render targets, by updating a - * texture that the batch needs, etc). This is significantly more efficient, - * but it can cause problems for apps that expect to render on top of the - * render API's output. As such, SDL will disable batching if a specific - * render backend is requested (since this might indicate that the app is - * planning to use the underlying graphics API directly). This hint can - * be used to explicitly request batching in this instance. It is a contract - * that you will either never use the underlying graphics API directly, or - * if you do, you will call SDL_RenderFlush() before you do so any current - * batch goes to the GPU before your work begins. Not following this contract - * will result in undefined behavior. - */ -#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" - - -/** - * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. - * - * This variable can be set to the following values: - * - * "0" - Don't log any events (default) - * "1" - Log all events except mouse and finger motion, which are pretty spammy. - * "2" - Log all events. - * - * This is generally meant to be used to debug SDL itself, but can be useful - * for application developers that need better visibility into what is going - * on in the event queue. Logged events are sent through SDL_Log(), which - * means by default they appear on stdout on most platforms or maybe - * OutputDebugString() on Windows, and can be funneled by the app with - * SDL_LogSetOutputFunction(), etc. - * - * This hint can be toggled on and off at runtime, if you only need to log - * events for a small subset of program execution. - */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" - - - -/** - * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file. - * - * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE - * file) is not always reliable. In case the size is wrong, it's possible to - * just ignore it and step through the chunks until a fixed limit is reached. - * - * Note that files that have trailing data unrelated to the WAVE file or - * corrupt files may slow down the loading process without a reliable boundary. - * By default, SDL stops after 10000 chunks to prevent wasting time. Use the - * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. - * - * This variable can be set to the following values: - * - * "force" - Always use the RIFF chunk size as a boundary for the chunk search - * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default) - * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB - * "maximum" - Search for chunks until the end of file (not recommended) - */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" - -/** - * \brief Controls how a truncated WAVE file is handled. - * - * A WAVE file is considered truncated if any of the chunks are incomplete or - * the data chunk size is not a multiple of the block size. By default, SDL - * decodes until the first incomplete block, as most applications seem to do. - * - * This variable can be set to the following values: - * - * "verystrict" - Raise an error if the file is truncated - * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored - * "dropframe" - Decode until the first incomplete sample frame - * "dropblock" - Decode until the first incomplete block (default) - */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" - -/** - * \brief Controls how the fact chunk affects the loading of a WAVE file. - * - * The fact chunk stores information about the number of samples of a WAVE - * file. The Standards Update from Microsoft notes that this value can be used - * to 'determine the length of the data in seconds'. This is especially useful - * for compressed formats (for which this is a mandatory chunk) if they produce - * multiple sample frames per block and truncating the block is not allowed. - * The fact chunk can exactly specify how many sample frames there should be - * in this case. - * - * Unfortunately, most application seem to ignore the fact chunk and so SDL - * ignores it by default as well. - * - * This variable can be set to the following values: - * - * "truncate" - Use the number of samples to truncate the wave data if - * the fact chunk is present and valid - * "strict" - Like "truncate", but raise an error if the fact chunk - * is invalid, not present for non-PCM formats, or if the - * data chunk doesn't have that many samples - * "ignorezero" - Like "truncate", but ignore fact chunk if the number of - * samples is zero - * "ignore" - Ignore fact chunk entirely (default) - */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" - -/** - * \brief An enumeration of hint priorities - */ -typedef enum -{ - SDL_HINT_DEFAULT, - SDL_HINT_NORMAL, - SDL_HINT_OVERRIDE -} SDL_HintPriority; - - -/** - * \brief Set a hint with a specific priority - * - * The priority controls the behavior when setting a hint that already - * has a value. Hints will replace existing hints of their priority and - * lower. Environment variables are considered to have override priority. - * - * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); - -/** - * \brief Set a hint with normal priority - * - * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, - const char *value); - -/** - * \brief Get a hint - * - * \return The string value of a hint variable. - */ -extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); - -/** - * \brief Get a hint - * - * \return The boolean value of a hint variable. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); - -/** - * \brief type definition of the hint callback function. - */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); - -/** - * \brief Add a function to watch a particular hint - * - * \param name The hint to watch - * \param callback The function to call when the hint value changes - * \param userdata A pointer to pass to the callback function - */ -extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * \brief Remove a function watching a particular hint - * - * \param name The hint being watched - * \param callback The function being called when the hint value changes - * \param userdata A pointer being passed to the callback function - */ -extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * \brief Clear all hints - * - * This function is called during SDL_Quit() to free stored hints. - */ -extern DECLSPEC void SDLCALL SDL_ClearHints(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_hints_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h deleted file mode 100644 index 3c099dec..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h +++ /dev/null @@ -1,418 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_joystick.h - * - * Include file for SDL joystick event handling - * - * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick - * behind a device_index changing as joysticks are plugged and unplugged. - * - * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted - * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. - * - * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of - * the device (a X360 wired controller for example). This identifier is platform dependent. - * - * - */ - -#ifndef SDL_joystick_h_ -#define SDL_joystick_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_joystick.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. - * - * If you would like to receive joystick updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/** - * The joystick structure used to identify an SDL joystick - */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - -/* A structure that encodes the stable unique id for a joystick device */ -typedef struct { - Uint8 data[16]; -} SDL_JoystickGUID; - -/** - * This is a unique ID for a joystick for the time it is connected to the system, - * and is never reused for the lifetime of the application. If the joystick is - * disconnected and reconnected, it will get a new ID. - * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. - */ -typedef Sint32 SDL_JoystickID; - -typedef enum -{ - SDL_JOYSTICK_TYPE_UNKNOWN, - SDL_JOYSTICK_TYPE_GAMECONTROLLER, - SDL_JOYSTICK_TYPE_WHEEL, - SDL_JOYSTICK_TYPE_ARCADE_STICK, - SDL_JOYSTICK_TYPE_FLIGHT_STICK, - SDL_JOYSTICK_TYPE_DANCE_PAD, - SDL_JOYSTICK_TYPE_GUITAR, - SDL_JOYSTICK_TYPE_DRUM_KIT, - SDL_JOYSTICK_TYPE_ARCADE_PAD, - SDL_JOYSTICK_TYPE_THROTTLE -} SDL_JoystickType; - -typedef enum -{ - SDL_JOYSTICK_POWER_UNKNOWN = -1, - SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */ - SDL_JOYSTICK_POWER_LOW, /* <= 20% */ - SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */ - SDL_JOYSTICK_POWER_FULL, /* <= 100% */ - SDL_JOYSTICK_POWER_WIRED, - SDL_JOYSTICK_POWER_MAX -} SDL_JoystickPowerLevel; - -/* Function prototypes */ - -/** - * Locking for multi-threaded access to the joystick API - * - * If you are using the joystick API or handling events from multiple threads - * you should use these locking functions to protect access to the joysticks. - * - * In particular, you are guaranteed that the joystick list won't change, so - * the API functions that take a joystick index will be valid, and joystick - * and game controller events will not be delivered. - */ -extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); -extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); - -/** - * Count the number of joysticks attached to the system right now - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/** - * Get the implementation dependent name of a joystick. - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); - -/** - * Get the player index of a joystick, or -1 if it's not available - * This can be called before any joysticks are opened. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); - -/** - * Return the GUID for the joystick at this index - * This can be called before any joysticks are opened. - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); - -/** - * Get the USB vendor ID of a joystick, if available. - * This can be called before any joysticks are opened. - * If the vendor ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); - -/** - * Get the USB product ID of a joystick, if available. - * This can be called before any joysticks are opened. - * If the product ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); - -/** - * Get the product version of a joystick, if available. - * This can be called before any joysticks are opened. - * If the product version isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index); - -/** - * Get the type of a joystick, if available. - * This can be called before any joysticks are opened. - */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index); - -/** - * Get the instance ID of a joystick. - * This can be called before any joysticks are opened. - * If the index is out of range, this function will return -1. - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index); - -/** - * Open a joystick for use. - * The index passed as an argument refers to the N'th joystick on the system. - * This index is not the value which will identify this joystick in future - * joystick events. The joystick's instance id (::SDL_JoystickID) will be used - * there instead. - * - * \return A joystick identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); - -/** - * Return the SDL_Joystick associated with an instance id. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); - -/** - * Return the SDL_Joystick associated with a player index. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); - -/** - * Return the name for this currently opened joystick. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); - -/** - * Get the player index of an opened joystick, or -1 if it's not available - * - * For XInput controllers this returns the XInput user index. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); - -/** - * Set the player index of an opened joystick - */ -extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); - -/** - * Return the GUID for this opened joystick - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); - -/** - * Get the USB vendor ID of an opened joystick, if available. - * If the vendor ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); - -/** - * Get the USB product ID of an opened joystick, if available. - * If the product ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); - -/** - * Get the product version of an opened joystick, if available. - * If the product version isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); - -/** - * Get the type of an opened joystick. - */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); - -/** - * Return a string representation for this guid. pszGUID must point to at least 33 bytes - * (32 for the string plus a NULL terminator). - */ -extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); - -/** - * Convert a string into a joystick guid - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); - -/** - * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); - -/** - * Get the instance ID of an opened joystick or -1 if the joystick is invalid. - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); - -/** - * Get the number of general axis controls on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); - -/** - * Get the number of trackballs on a joystick. - * - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); - -/** - * Get the number of POV hats on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); - -/** - * Get the number of buttons on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); - -/** - * Update the current state of the open joysticks. - * - * This is called automatically by the event loop if any joystick - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/** - * Enable/disable joystick event polling. - * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. - * - * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -#define SDL_JOYSTICK_AXIS_MAX 32767 -#define SDL_JOYSTICK_AXIS_MIN -32768 -/** - * Get the current state of an axis control on a joystick. - * - * The state is a value ranging from -32768 to 32767. - * - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, - int axis); - -/** - * Get the initial state of an axis control on a joystick. - * - * The state is a value ranging from -32768 to 32767. - * - * The axis indices start at index 0. - * - * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, - int axis, Sint16 *state); - -/** - * \name Hat positions - */ -/* @{ */ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/* @} */ - -/** - * Get the current state of a POV hat on a joystick. - * - * The hat indices start at index 0. - * - * \return The return value is one of the following positions: - * - ::SDL_HAT_CENTERED - * - ::SDL_HAT_UP - * - ::SDL_HAT_RIGHT - * - ::SDL_HAT_DOWN - * - ::SDL_HAT_LEFT - * - ::SDL_HAT_RIGHTUP - * - ::SDL_HAT_RIGHTDOWN - * - ::SDL_HAT_LEFTUP - * - ::SDL_HAT_LEFTDOWN - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, - int hat); - -/** - * Get the ball axis change since the last poll. - * - * \return 0, or -1 if you passed it invalid parameters. - * - * The ball indices start at index 0. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, - int ball, int *dx, int *dy); - -/** - * Get the current state of a button on a joystick. - * - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, - int button); - -/** - * Trigger a rumble effect - * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. - * - * \param joystick The joystick to vibrate - * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF - * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * - * \return 0, or -1 if rumble isn't supported on this joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); - -/** - * Close a joystick previously opened with SDL_JoystickOpen(). - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); - -/** - * Return the battery level of this joystick - */ -extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_joystick_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h deleted file mode 100644 index 4b2a055d..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_keyboard.h - * - * Include file for SDL keyboard event handling - */ - -#ifndef SDL_keyboard_h_ -#define SDL_keyboard_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keycode.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The SDL keysym structure, used in key events. - * - * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. - */ -typedef struct SDL_Keysym -{ - SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ - SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ - Uint16 mod; /**< current key modifiers */ - Uint32 unused; -} SDL_Keysym; - -/* Function prototypes */ - -/** - * \brief Get the window which currently has keyboard focus. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); - -/** - * \brief Get a snapshot of the current state of the keyboard. - * - * \param numkeys if non-NULL, receives the length of the returned array. - * - * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. - * - * \b Example: - * \code - * const Uint8 *state = SDL_GetKeyboardState(NULL); - * if ( state[SDL_SCANCODE_RETURN] ) { - * printf("<RETURN> is pressed.\n"); - * } - * \endcode - */ -extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); - -/** - * \brief Get the current key modifier state for the keyboard. - */ -extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); - -/** - * \brief Set the current key modifier state for the keyboard. - * - * \note This does not change the keyboard state, only the key modifier flags. - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); - -/** - * \brief Get the key code corresponding to the given scancode according - * to the current keyboard layout. - * - * See ::SDL_Keycode for details. - * - * \sa SDL_GetKeyName() - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); - -/** - * \brief Get the scancode corresponding to the given key code according to the - * current keyboard layout. - * - * See ::SDL_Scancode for details. - * - * \sa SDL_GetScancodeName() - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); - -/** - * \brief Get a human-readable name for a scancode. - * - * \return A pointer to the name for the scancode. - * If the scancode doesn't have a name, this function returns - * an empty string (""). - * - * \sa SDL_Scancode - */ -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); - -/** - * \brief Get a scancode from a human-readable name - * - * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized - * - * \sa SDL_Scancode - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); - -/** - * \brief Get a human-readable name for a key. - * - * \return A pointer to a UTF-8 string that stays valid at least until the next - * call to this function. If you need it around any longer, you must - * copy it. If the key doesn't have a name, this function returns an - * empty string (""). - * - * \sa SDL_Keycode - */ -extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); - -/** - * \brief Get a key code from a human-readable name - * - * \return key code, or SDLK_UNKNOWN if the name wasn't recognized - * - * \sa SDL_Keycode - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); - -/** - * \brief Start accepting Unicode text input events. - * This function will show the on-screen keyboard if supported. - * - * \sa SDL_StopTextInput() - * \sa SDL_SetTextInputRect() - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC void SDLCALL SDL_StartTextInput(void); - -/** - * \brief Return whether or not Unicode text input events are enabled. - * - * \sa SDL_StartTextInput() - * \sa SDL_StopTextInput() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); - -/** - * \brief Stop receiving any text input events. - * This function will hide the on-screen keyboard if supported. - * - * \sa SDL_StartTextInput() - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC void SDLCALL SDL_StopTextInput(void); - -/** - * \brief Set the rectangle used to type Unicode text inputs. - * This is used as a hint for IME and on-screen keyboard placement. - * - * \sa SDL_StartTextInput() - */ -extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); - -/** - * \brief Returns whether the platform has some screen keyboard support. - * - * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. - * - * \note Not all screen keyboard functions are supported on all platforms. - * - * \sa SDL_IsScreenKeyboardShown() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); - -/** - * \brief Returns whether the screen keyboard is shown for given window. - * - * \param window The window for which screen keyboard should be queried. - * - * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. - * - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_keyboard_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h deleted file mode 100644 index 64b72dd3..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_keycode.h - * - * Defines constants which identify keyboard keys and modifiers. - */ - -#ifndef SDL_keycode_h_ -#define SDL_keycode_h_ - -#include "SDL_stdinc.h" -#include "SDL_scancode.h" - -/** - * \brief The SDL virtual key representation. - * - * Values of this type are used to represent keyboard keys using the current - * layout of the keyboard. These values include Unicode values representing - * the unmodified character that would be generated by pressing the key, or - * an SDLK_* constant for those keys that do not generate characters. - * - * A special exception is the number keys at the top of the keyboard which - * always map to SDLK_0...SDLK_9, regardless of layout. - */ -typedef Sint32 SDL_Keycode; - -#define SDLK_SCANCODE_MASK (1<<30) -#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) - -typedef enum -{ - SDLK_UNKNOWN = 0, - - SDLK_RETURN = '\r', - SDLK_ESCAPE = '\033', - SDLK_BACKSPACE = '\b', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - SDLK_EXCLAIM = '!', - SDLK_QUOTEDBL = '"', - SDLK_HASH = '#', - SDLK_PERCENT = '%', - SDLK_DOLLAR = '$', - SDLK_AMPERSAND = '&', - SDLK_QUOTE = '\'', - SDLK_LEFTPAREN = '(', - SDLK_RIGHTPAREN = ')', - SDLK_ASTERISK = '*', - SDLK_PLUS = '+', - SDLK_COMMA = ',', - SDLK_MINUS = '-', - SDLK_PERIOD = '.', - SDLK_SLASH = '/', - SDLK_0 = '0', - SDLK_1 = '1', - SDLK_2 = '2', - SDLK_3 = '3', - SDLK_4 = '4', - SDLK_5 = '5', - SDLK_6 = '6', - SDLK_7 = '7', - SDLK_8 = '8', - SDLK_9 = '9', - SDLK_COLON = ':', - SDLK_SEMICOLON = ';', - SDLK_LESS = '<', - SDLK_EQUALS = '=', - SDLK_GREATER = '>', - SDLK_QUESTION = '?', - SDLK_AT = '@', - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = '[', - SDLK_BACKSLASH = '\\', - SDLK_RIGHTBRACKET = ']', - SDLK_CARET = '^', - SDLK_UNDERSCORE = '_', - SDLK_BACKQUOTE = '`', - SDLK_a = 'a', - SDLK_b = 'b', - SDLK_c = 'c', - SDLK_d = 'd', - SDLK_e = 'e', - SDLK_f = 'f', - SDLK_g = 'g', - SDLK_h = 'h', - SDLK_i = 'i', - SDLK_j = 'j', - SDLK_k = 'k', - SDLK_l = 'l', - SDLK_m = 'm', - SDLK_n = 'n', - SDLK_o = 'o', - SDLK_p = 'p', - SDLK_q = 'q', - SDLK_r = 'r', - SDLK_s = 's', - SDLK_t = 't', - SDLK_u = 'u', - SDLK_v = 'v', - SDLK_w = 'w', - SDLK_x = 'x', - SDLK_y = 'y', - SDLK_z = 'z', - - SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), - - SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), - SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), - SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), - SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), - SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), - SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), - SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), - SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), - SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), - SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), - SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), - SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), - - SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), - SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), - SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), - SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), - SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), - SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), - SDLK_DELETE = '\177', - SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), - SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), - SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), - SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), - SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), - SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), - - SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), - SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), - SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), - SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), - SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), - SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), - SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), - SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), - SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), - SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), - SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), - SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), - SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), - SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), - SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), - SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), - SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), - - SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), - SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), - SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), - SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), - SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), - SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), - SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), - SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), - SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), - SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), - SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), - SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), - SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), - SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), - SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), - SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), - SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), - SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), - SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), - SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), - SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), - SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), - SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), - SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), - SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), - SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), - SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), - SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), - SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), - SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), - SDLK_KP_EQUALSAS400 = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), - - SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), - SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), - SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), - SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), - SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), - SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), - SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), - SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), - SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), - SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), - SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), - SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), - - SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), - SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), - SDLK_THOUSANDSSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), - SDLK_DECIMALSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), - SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), - SDLK_CURRENCYSUBUNIT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), - SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), - SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), - SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), - SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), - SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), - SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), - SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), - SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), - SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), - SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), - SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), - SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), - SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), - SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), - SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), - SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), - SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), - SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), - SDLK_KP_DBLAMPERSAND = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), - SDLK_KP_VERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), - SDLK_KP_DBLVERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), - SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), - SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), - SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), - SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), - SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), - SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), - SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), - SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), - SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), - SDLK_KP_MEMSUBTRACT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), - SDLK_KP_MEMMULTIPLY = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), - SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), - SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), - SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), - SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), - SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), - SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), - SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), - SDLK_KP_HEXADECIMAL = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), - - SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), - SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), - SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), - SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), - SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), - SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), - SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), - SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), - - SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), - - SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), - SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), - SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), - SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), - SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), - SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), - SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), - SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), - SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), - SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), - SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), - SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), - SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), - SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), - SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), - SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), - SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), - - SDLK_BRIGHTNESSDOWN = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), - SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), - SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), - SDLK_KBDILLUMTOGGLE = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), - SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), - SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), - SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), - SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP), - SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1), - SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2), - - SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND), - SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD) -} SDL_KeyCode; - -/** - * \brief Enumeration of valid key mods (possibly OR'd together). - */ -typedef enum -{ - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDL_Keymod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) - -#endif /* SDL_keycode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h deleted file mode 100644 index 793ba535..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_loadso.h - * - * System dependent library loading routines - * - * Some things to keep in mind: - * \li These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * \li Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * \li Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - -#ifndef SDL_loadso_h_ -#define SDL_loadso_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. - */ -extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); - -/** - * Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). - */ -extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, - const char *name); - -/** - * Unload a shared object from memory. - */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_loadso_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h deleted file mode 100644 index 430e4fd0..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_log.h - * - * Simple log messages with categories and priorities. - * - * By default logs are quiet, but if you're debugging SDL you might want: - * - * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); - * - * Here's where the messages go on different platforms: - * Windows: debug output stream - * Android: log output - * Others: standard error output (stderr) - */ - -#ifndef SDL_log_h_ -#define SDL_log_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief The maximum size of a log message - * - * Messages longer than the maximum size will be truncated - */ -#define SDL_MAX_LOG_MESSAGE 4096 - -/** - * \brief The predefined log categories - * - * By default the application category is enabled at the INFO level, - * the assert category is enabled at the WARN level, test is enabled - * at the VERBOSE level and all other categories are enabled at the - * CRITICAL level. - */ -typedef enum -{ - SDL_LOG_CATEGORY_APPLICATION, - SDL_LOG_CATEGORY_ERROR, - SDL_LOG_CATEGORY_ASSERT, - SDL_LOG_CATEGORY_SYSTEM, - SDL_LOG_CATEGORY_AUDIO, - SDL_LOG_CATEGORY_VIDEO, - SDL_LOG_CATEGORY_RENDER, - SDL_LOG_CATEGORY_INPUT, - SDL_LOG_CATEGORY_TEST, - - /* Reserved for future SDL library use */ - SDL_LOG_CATEGORY_RESERVED1, - SDL_LOG_CATEGORY_RESERVED2, - SDL_LOG_CATEGORY_RESERVED3, - SDL_LOG_CATEGORY_RESERVED4, - SDL_LOG_CATEGORY_RESERVED5, - SDL_LOG_CATEGORY_RESERVED6, - SDL_LOG_CATEGORY_RESERVED7, - SDL_LOG_CATEGORY_RESERVED8, - SDL_LOG_CATEGORY_RESERVED9, - SDL_LOG_CATEGORY_RESERVED10, - - /* Beyond this point is reserved for application use, e.g. - enum { - MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, - MYAPP_CATEGORY_AWESOME2, - MYAPP_CATEGORY_AWESOME3, - ... - }; - */ - SDL_LOG_CATEGORY_CUSTOM -} SDL_LogCategory; - -/** - * \brief The predefined log priorities - */ -typedef enum -{ - SDL_LOG_PRIORITY_VERBOSE = 1, - SDL_LOG_PRIORITY_DEBUG, - SDL_LOG_PRIORITY_INFO, - SDL_LOG_PRIORITY_WARN, - SDL_LOG_PRIORITY_ERROR, - SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES -} SDL_LogPriority; - - -/** - * \brief Set the priority of all log categories - */ -extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); - -/** - * \brief Set the priority of a particular log category - */ -extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, - SDL_LogPriority priority); - -/** - * \brief Get the priority of a particular log category - */ -extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); - -/** - * \brief Reset all priorities to default. - * - * \note This is called in SDL_Quit(). - */ -extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); - -/** - * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO - */ -extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE - */ -extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_DEBUG - */ -extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_INFO - */ -extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_WARN - */ -extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_ERROR - */ -extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL - */ -extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with the specified category and priority. - */ -extern DECLSPEC void SDLCALL SDL_LogMessage(int category, - SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); - -/** - * \brief Log a message with the specified category and priority. - */ -extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, - SDL_LogPriority priority, - const char *fmt, va_list ap); - -/** - * \brief The prototype for the log output function - */ -typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); - -/** - * \brief Get the current log output function. - */ -extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); - -/** - * \brief This function allows you to replace the default log output - * function with one of your own. - */ -extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_log_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h deleted file mode 100644 index 623f2d00..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_main_h_ -#define SDL_main_h_ - -#include "SDL_stdinc.h" - -/** - * \file SDL_main.h - * - * Redefine main() on some platforms so that it is called by SDL. - */ - -#ifndef SDL_MAIN_HANDLED -#if defined(__WIN32__) -/* On Windows SDL provides WinMain(), which parses the command line and passes - the arguments to your main function. - - If you provide your own WinMain(), you may define SDL_MAIN_HANDLED - */ -#define SDL_MAIN_AVAILABLE - -#elif defined(__WINRT__) -/* On WinRT, SDL provides a main function that initializes CoreApplication, - creating an instance of IFrameworkView in the process. - - Please note that #include'ing SDL_main.h is not enough to get a main() - function working. In non-XAML apps, the file, - src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled - into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be - called, with a pointer to the Direct3D-hosted XAML control passed in. -*/ -#define SDL_MAIN_NEEDED - -#elif defined(__IPHONEOS__) -/* On iOS SDL provides a main function that creates an application delegate - and starts the iOS application run loop. - - If you link with SDL dynamically on iOS, the main function can't be in a - shared library, so you need to link with libSDLmain.a, which includes a - stub main function that calls into the shared library to start execution. - - See src/video/uikit/SDL_uikitappdelegate.m for more details. - */ -#define SDL_MAIN_NEEDED - -#elif defined(__ANDROID__) -/* On Android SDL provides a Java class in SDLActivity.java that is the - main activity entry point. - - See docs/README-android.md for more details on extending that class. - */ -#define SDL_MAIN_NEEDED - -/* We need to export SDL_main so it can be launched from Java */ -#define SDLMAIN_DECLSPEC DECLSPEC - -#elif defined(__NACL__) -/* On NACL we use ppapi_simple to set up the application helper code, - then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before - starting the user main function. - All user code is run in a separate thread by ppapi_simple, thus - allowing for blocking io to take place via nacl_io -*/ -#define SDL_MAIN_NEEDED - -#endif -#endif /* SDL_MAIN_HANDLED */ - -#ifndef SDLMAIN_DECLSPEC -#define SDLMAIN_DECLSPEC -#endif - -/** - * \file SDL_main.h - * - * The application's main() function must be called with C linkage, - * and should be declared like this: - * \code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * \endcode - */ - -#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) -#define main SDL_main -#endif - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The prototype for the application's main() function - */ -typedef int (*SDL_main_func)(int argc, char *argv[]); -extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); - - -/** - * This is called by the real SDL main function to let the rest of the - * library know that initialization was done properly. - * - * Calling this yourself without knowing what you're doing can cause - * crashes and hard to diagnose problems with your application. - */ -extern DECLSPEC void SDLCALL SDL_SetMainReady(void); - -#ifdef __WIN32__ - -/** - * This can be called to set the application class at startup - */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); - -#endif /* __WIN32__ */ - - -#ifdef __WINRT__ - -/** - * \brief Initializes and launches an SDL/WinRT application. - * - * \param mainFunction The SDL app's C-style main(). - * \param reserved Reserved for future use; should be NULL - * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more - * information on the failure. - */ -extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); - -#endif /* __WINRT__ */ - -#if defined(__IPHONEOS__) - -/** - * \brief Initializes and launches an SDL application. - * - * \param argc The argc parameter from the application's main() function - * \param argv The argv parameter from the application's main() function - * \param mainFunction The SDL app's C-style main(). - * \return the return value from mainFunction - */ -extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); - -#endif /* __IPHONEOS__ */ - - -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_main_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h deleted file mode 100644 index bf50deb9..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_messagebox_h_ -#define SDL_messagebox_h_ - -#include "SDL_stdinc.h" -#include "SDL_video.h" /* For SDL_Window */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SDL_MessageBox flags. If supported will display warning icon, etc. - */ -typedef enum -{ - SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ - SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ - SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */ - SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */ - SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */ -} SDL_MessageBoxFlags; - -/** - * \brief Flags for SDL_MessageBoxButtonData. - */ -typedef enum -{ - SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ - SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ -} SDL_MessageBoxButtonFlags; - -/** - * \brief Individual button data. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ - int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ - const char * text; /**< The UTF-8 button text */ -} SDL_MessageBoxButtonData; - -/** - * \brief RGB value used in a message box color scheme - */ -typedef struct -{ - Uint8 r, g, b; -} SDL_MessageBoxColor; - -typedef enum -{ - SDL_MESSAGEBOX_COLOR_BACKGROUND, - SDL_MESSAGEBOX_COLOR_TEXT, - SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, - SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, - SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, - SDL_MESSAGEBOX_COLOR_MAX -} SDL_MessageBoxColorType; - -/** - * \brief A set of colors to use for message box dialogs - */ -typedef struct -{ - SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; -} SDL_MessageBoxColorScheme; - -/** - * \brief MessageBox structure containing title, text, window, etc. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxFlags */ - SDL_Window *window; /**< Parent window, can be NULL */ - const char *title; /**< UTF-8 title */ - const char *message; /**< UTF-8 message text */ - - int numbuttons; - const SDL_MessageBoxButtonData *buttons; - - const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ -} SDL_MessageBoxData; - -/** - * \brief Create a modal message box. - * - * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. - * \param buttonid The pointer to which user id of hit button should be copied. - * - * \return -1 on error, otherwise 0 and buttonid contains user id of button - * hit or -1 if dialog was closed. - * - * \note This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or - * closes the messagebox. - */ -extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); - -/** - * \brief Create a simple modal message box - * - * \param flags ::SDL_MessageBoxFlags - * \param title UTF-8 title text - * \param message UTF-8 message text - * \param window The parent window, or NULL for no parent - * - * \return 0 on success, -1 on error - * - * \sa SDL_ShowMessageBox - */ -extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_messagebox_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h deleted file mode 100644 index 0f1e0e94..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_metal.h - * - * Header file for functions to creating Metal layers and views on SDL windows. - */ - -#ifndef SDL_metal_h_ -#define SDL_metal_h_ - -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). - * - * \note This can be cast directly to an NSView or UIView. - */ -typedef void *SDL_MetalView; - -/** - * \name Metal support functions - */ -/* @{ */ - -/** - * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the - * specified window. - * - * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its - * own. It is up to user code to do that. - * - * The returned handle can be casted directly to a NSView or UIView, and the - * CAMetalLayer can be accessed from the view's 'layer' property. - * - * \code - * SDL_MetalView metalview = SDL_Metal_CreateView(window); - * UIView *uiview = (__bridge UIView *)metalview; - * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; - * // [...] - * SDL_Metal_DestroyView(metalview); - * \endcode - * - * \sa SDL_Metal_DestroyView - */ -extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); - -/** - * \brief Destroy an existing SDL_MetalView object. - * - * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was - * called after SDL_CreateWindow. - * - * \sa SDL_Metal_CreateView - */ -extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); - -/* @} *//* Metal support functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_metal_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h deleted file mode 100644 index 277559d2..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_mouse.h - * - * Include file for SDL mouse event handling. - */ - -#ifndef SDL_mouse_h_ -#define SDL_mouse_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ - -/** - * \brief Cursor types for SDL_CreateSystemCursor(). - */ -typedef enum -{ - SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ - SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ - SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ - SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ - SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ - SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ - SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ - SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ - SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ - SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ - SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ - SDL_SYSTEM_CURSOR_HAND, /**< Hand */ - SDL_NUM_SYSTEM_CURSORS -} SDL_SystemCursor; - -/** - * \brief Scroll direction types for the Scroll event - */ -typedef enum -{ - SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ - SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ -} SDL_MouseWheelDirection; - -/* Function prototypes */ - -/** - * \brief Get the window which currently has mouse focus. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); - -/** - * \brief Retrieve the current state of the mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse cursor position relative to the focus window for the currently - * selected mouse. You can pass NULL for either x or y. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); - -/** - * \brief Get the current state of the mouse, in relation to the desktop - * - * This works just like SDL_GetMouseState(), but the coordinates will be - * reported relative to the top-left of the desktop. This can be useful if - * you need to track the mouse outside of a specific window and - * SDL_CaptureMouse() doesn't fit your needs. For example, it could be - * useful if you need to track the mouse while dragging a window, where - * coordinates relative to a window might not be in sync at all times. - * - * \note SDL_GetMouseState() returns the mouse position as SDL understands - * it from the last pump of the event queue. This function, however, - * queries the OS for the current mouse position, and as such, might - * be a slightly less efficient function. Unless you know what you're - * doing and have a good reason to use this function, you probably want - * SDL_GetMouseState() instead. - * - * \param x Returns the current X coord, relative to the desktop. Can be NULL. - * \param y Returns the current Y coord, relative to the desktop. Can be NULL. - * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros. - * - * \sa SDL_GetMouseState - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); - -/** - * \brief Retrieve the relative state of the mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); - -/** - * \brief Moves the mouse to the given position within the window. - * - * \param window The window to move the mouse into, or NULL for the current mouse focus - * \param x The x coordinate within the window - * \param y The y coordinate within the window - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, - int x, int y); - -/** - * \brief Moves the mouse to the given position in global screen space. - * - * \param x The x coordinate - * \param y The y coordinate - * \return 0 on success, -1 on error (usually: unsupported by a platform). - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); - -/** - * \brief Set relative mouse mode. - * - * \param enabled Whether or not to enable relative mode - * - * \return 0 on success, or -1 if relative mode is not supported. - * - * While the mouse is in relative mode, the cursor is hidden, and the - * driver will try to report continuous motion in the current window. - * Only relative motion events will be delivered, the mouse position - * will not change. - * - * \note This function will flush any pending mouse motion. - * - * \sa SDL_GetRelativeMouseMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); - -/** - * \brief Capture the mouse, to track input outside an SDL window. - * - * \param enabled Whether or not to enable capturing - * - * Capturing enables your app to obtain mouse events globally, instead of - * just within your window. Not all video targets support this function. - * When capturing is enabled, the current window will get all mouse events, - * but unlike relative mode, no change is made to the cursor and it is - * not restrained to your window. - * - * This function may also deny mouse input to other windows--both those in - * your application and others on the system--so you should use this - * function sparingly, and in small bursts. For example, you might want to - * track the mouse while the user is dragging something, until the user - * releases a mouse button. It is not recommended that you capture the mouse - * for long periods of time, such as the entire time your app is running. - * - * While captured, mouse events still report coordinates relative to the - * current (foreground) window, but those coordinates may be outside the - * bounds of the window (including negative values). Capturing is only - * allowed for the foreground window. If the window loses focus while - * capturing, the capture will be disabled automatically. - * - * While capturing is enabled, the current window will have the - * SDL_WINDOW_MOUSE_CAPTURE flag set. - * - * \return 0 on success, or -1 if not supported. - */ -extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); - -/** - * \brief Query whether relative mouse mode is enabled. - * - * \sa SDL_SetRelativeMouseMode() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); - -/** - * \brief Create a cursor, using the specified bitmap data and - * mask (in MSB format). - * - * The cursor width must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * <table> - * <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr> - * <tr><td> 0 </td><td> 1 </td><td> White </td></tr> - * <tr><td> 1 </td><td> 1 </td><td> Black </td></tr> - * <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr> - * <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black - * if not. </td></tr> - * </table> - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, - const Uint8 * mask, - int w, int h, int hot_x, - int hot_y); - -/** - * \brief Create a color cursor. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, - int hot_x, - int hot_y); - -/** - * \brief Create a system cursor. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); - -/** - * \brief Set the active cursor. - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); - -/** - * \brief Return the active cursor. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); - -/** - * \brief Return the default cursor. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); - -/** - * \brief Frees a cursor created with SDL_CreateCursor() or similar functions. - * - * \sa SDL_CreateCursor() - * \sa SDL_CreateColorCursor() - * \sa SDL_CreateSystemCursor() - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); - -/** - * \brief Toggle whether or not the cursor is shown. - * - * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current - * state. - * - * \return 1 if the cursor is shown, or 0 if the cursor is hidden. - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/** - * Used as a mask when testing buttons in buttonstate. - * - Button 1: Left mouse button - * - Button 2: Middle mouse button - * - Button 3: Right mouse button - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_X1 4 -#define SDL_BUTTON_X2 5 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_mouse_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h deleted file mode 100644 index 970e7871..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_mutex_h_ -#define SDL_mutex_h_ - -/** - * \file SDL_mutex.h - * - * Functions to provide thread synchronization primitives. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Synchronization functions which can time out return this value - * if they time out. - */ -#define SDL_MUTEX_TIMEDOUT 1 - -/** - * This is the timeout value which corresponds to never time out. - */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/** - * \name Mutex functions - */ -/* @{ */ - -/* The SDL mutex structure, defined in SDL_sysmutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/** - * Create a mutex, initialized unlocked. - */ -extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); - -/** - * Lock the mutex. - * - * \return 0, or -1 on error. - */ -#define SDL_mutexP(m) SDL_LockMutex(m) -extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); - -/** - * Try to lock the mutex - * - * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); - -/** - * Unlock the mutex. - * - * \return 0, or -1 on error. - * - * \warning It is an error to unlock a mutex that has not been locked by - * the current thread, and doing so results in undefined behavior. - */ -#define SDL_mutexV(m) SDL_UnlockMutex(m) -extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); - -/** - * Destroy a mutex. - */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); - -/* @} *//* Mutex functions */ - - -/** - * \name Semaphore functions - */ -/* @{ */ - -/* The SDL semaphore structure, defined in SDL_syssem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/** - * Create a semaphore, initialized with value, returns NULL on failure. - */ -extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/** - * Destroy a semaphore. - */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); - -/** - * This function suspends the calling thread until the semaphore pointed - * to by \c sem has a positive count. It then atomically decreases the - * semaphore count. - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); - -/** - * Non-blocking variant of SDL_SemWait(). - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would - * block, and -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); - -/** - * Variant of SDL_SemWait() with a timeout in milliseconds. - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not - * succeed in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a - * delay of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); - -/** - * Atomically increases the semaphore's count (not blocking). - * - * \return 0, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); - -/** - * Returns the current count of the semaphore. - */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); - -/* @} *//* Semaphore functions */ - - -/** - * \name Condition variable functions - */ -/* @{ */ - -/* The SDL condition variable structure, defined in SDL_syscond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; - -/** - * Create a condition variable. - * - * Typical use of condition variables: - * - * Thread A: - * SDL_LockMutex(lock); - * while ( ! condition ) { - * SDL_CondWait(cond, lock); - * } - * SDL_UnlockMutex(lock); - * - * Thread B: - * SDL_LockMutex(lock); - * ... - * condition = true; - * ... - * SDL_CondSignal(cond); - * SDL_UnlockMutex(lock); - * - * There is some discussion whether to signal the condition variable - * with the mutex locked or not. There is some potential performance - * benefit to unlocking first on some platforms, but there are some - * potential race conditions depending on how your code is structured. - * - * In general it's safer to signal the condition variable while the - * mutex is locked. - */ -extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); - -/** - * Destroy a condition variable. - */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); - -/** - * Restart one of the threads that are waiting on the condition variable. - * - * \return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); - -/** - * Restart all threads that are waiting on the condition variable. - * - * \return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); - -/** - * Wait on the condition variable, unlocking the provided mutex. - * - * \warning The mutex must be locked before entering this function! - * - * The mutex is re-locked once the condition variable is signaled. - * - * \return 0 when it is signaled, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); - -/** - * Waits for at most \c ms milliseconds, and returns 0 if the condition - * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not - * signaled in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a - * delay of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, - SDL_mutex * mutex, Uint32 ms); - -/* @} *//* Condition variable functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_mutex_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h deleted file mode 100644 index 690a8199..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDLname_h_ -#define SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* SDLname_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h deleted file mode 100644 index 6685be73..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h +++ /dev/null @@ -1,2183 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengl.h - * - * This is a simple file to encapsulate the OpenGL API headers. - */ - -/** - * \def NO_SDL_GLEXT - * - * Define this if you have your own version of glext.h and want to disable the - * version included in SDL_opengl.h. - */ - -#ifndef SDL_opengl_h_ -#define SDL_opengl_h_ - -#include "SDL_config.h" - -#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ - -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef __gl_h_ -#define __gl_h_ - -#if defined(USE_MGL_NAMESPACE) -#include "gl_mangle.h" -#endif - - -/********************************************************************** - * Begin system-specific stuff. - */ - -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) -#define __WIN32__ -#endif - -#if defined(__WIN32__) && !defined(__CYGWIN__) -# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# endif /* _STATIC_MESA support */ -# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ -# define GLAPIENTRY -# else -# define GLAPIENTRY __stdcall -# endif -#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ -# define GLAPI extern -# define GLAPIENTRY __stdcall -#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */ -# define GLAPI extern -# define GLAPIENTRY _System -# define APIENTRY _System -# if defined(__GNUC__) && !defined(_System) -# define _System -# endif -#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define GLAPI __attribute__((visibility("default"))) -# define GLAPIENTRY -#endif /* WIN32 && !CYGWIN */ - -/* - * WINDOWS: Include windows.h here to define APIENTRY. - * It is also useful when applications include this file by - * including only glut.h, since glut.h depends on windows.h. - * Applications needing to include windows.h with parms other - * than "WIN32_LEAN_AND_MEAN" may include windows.h before - * glut.h or gl.h. - */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> -#endif - -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef APIENTRY -#define APIENTRY GLAPIENTRY -#endif - -/* "P" suffix to be used for a pointer to a function */ -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifndef GLAPIENTRYP -#define GLAPIENTRYP GLAPIENTRY * -#endif - -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export on -#endif - -/* - * End system-specific stuff. - **********************************************************************/ - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -#define GL_VERSION_1_1 1 -#define GL_VERSION_1_2 1 -#define GL_VERSION_1_3 1 -#define GL_ARB_imaging 1 - - -/* - * Datatypes - */ -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; /* 1-byte signed */ -typedef short GLshort; /* 2-byte signed */ -typedef int GLint; /* 4-byte signed */ -typedef unsigned char GLubyte; /* 1-byte unsigned */ -typedef unsigned short GLushort; /* 2-byte unsigned */ -typedef unsigned int GLuint; /* 4-byte unsigned */ -typedef int GLsizei; /* 4-byte signed */ -typedef float GLfloat; /* single precision float */ -typedef float GLclampf; /* single precision float in [0,1] */ -typedef double GLdouble; /* double precision float */ -typedef double GLclampd; /* double precision float in [0,1] */ - - - -/* - * Constants - */ - -/* Boolean values */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* Data types */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A - -/* Primitives */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON 0x0009 - -/* Vertex Arrays */ -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D - -/* Matrix Mode */ -#define GL_MATRIX_MODE 0x0BA0 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 - -/* Points */ -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_POINT_SIZE_RANGE 0x0B12 - -/* Lines */ -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_WIDTH_RANGE 0x0B22 - -/* Polygons */ -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 - -/* Display Lists */ -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_LIST_MODE 0x0B30 - -/* Depth buffer */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_BITS 0x0D56 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_COMPONENT 0x1902 - -/* Lighting */ -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_SHININESS 0x1601 -#define GL_EMISSION 0x1600 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_SHADE_MODEL 0x0B54 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_NORMALIZE 0x0BA1 - -/* User clipping planes */ -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 - -/* Accumulation buffer */ -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_ACCUM 0x0100 -#define GL_ADD 0x0104 -#define GL_LOAD 0x0101 -#define GL_MULT 0x0103 -#define GL_RETURN 0x0102 - -/* Alpha testing */ -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_ALPHA_TEST_FUNC 0x0BC1 - -/* Blending */ -#define GL_BLEND 0x0BE2 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND_DST 0x0BE0 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 - -/* Render Mode */ -#define GL_FEEDBACK 0x1C01 -#define GL_RENDER 0x1C00 -#define GL_SELECT 0x1C02 - -/* Feedback */ -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 - -/* Selection */ -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 - -/* Fog */ -#define GL_FOG 0x0B60 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_COLOR 0x0B66 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_LINEAR 0x2601 -#define GL_EXP 0x0800 -#define GL_EXP2 0x0801 - -/* Logic Ops */ -#define GL_LOGIC_OP 0x0BF1 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_CLEAR 0x1500 -#define GL_SET 0x150F -#define GL_COPY 0x1503 -#define GL_COPY_INVERTED 0x150C -#define GL_NOOP 0x1505 -#define GL_INVERT 0x150A -#define GL_AND 0x1501 -#define GL_NAND 0x150E -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_XOR 0x1506 -#define GL_EQUIV 0x1509 -#define GL_AND_REVERSE 0x1502 -#define GL_AND_INVERTED 0x1504 -#define GL_OR_REVERSE 0x150B -#define GL_OR_INVERTED 0x150D - -/* Stencil */ -#define GL_STENCIL_BITS 0x0D57 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_INDEX 0x1901 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 - -/* Buffers, Pixel Drawing/Reading */ -#define GL_NONE 0 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -/*GL_FRONT 0x0404 */ -/*GL_BACK 0x0405 */ -/*GL_FRONT_AND_BACK 0x0408 */ -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_COLOR_INDEX 0x1900 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_ALPHA_BITS 0x0D55 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_INDEX_BITS 0x0D51 -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_READ_BUFFER 0x0C02 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_BITMAP 0x1A00 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_DITHER 0x0BD0 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 - -/* Implementation limits */ -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B - -/* Gets */ -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_MODE 0x0C30 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_RENDER_MODE 0x0C40 -#define GL_RGBA_MODE 0x0C31 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_VIEWPORT 0x0BA2 - -/* Evaluators */ -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 - -/* Hints */ -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* Scissor box */ -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 - -/* Pixel Mode / Transfer */ -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 - -/* Texture mapping */ -#define GL_TEXTURE_ENV 0x2300 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_LINEAR 0x2400 -#define GL_EYE_PLANE 0x2502 -#define GL_SPHERE_MAP 0x2402 -#define GL_DECAL 0x2101 -#define GL_MODULATE 0x2100 -#define GL_NEAREST 0x2600 -#define GL_REPEAT 0x2901 -#define GL_CLAMP 0x2900 -#define GL_S 0x2000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 - -/* Utility */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* Errors */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 - -/* glPush/PopAttrib bits */ -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000FFFFF - - -/* OpenGL 1.1 */ -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - - - -/* - * Miscellaneous - */ - -GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); - -GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glClear( GLbitfield mask ); - -GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); - -GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); - -GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); - -GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); - -GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); - -GLAPI void GLAPIENTRY glCullFace( GLenum mode ); - -GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); - -GLAPI void GLAPIENTRY glPointSize( GLfloat size ); - -GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); - -GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); - -GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); - -GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); - -GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); - -GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); - -GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); - -GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); - -GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); - -GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); - -GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); - -GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glEnable( GLenum cap ); - -GLAPI void GLAPIENTRY glDisable( GLenum cap ); - -GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); - - -GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ - -GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ - - -GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); - -GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); - -GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); - -GLAPI void GLAPIENTRY glPopAttrib( void ); - - -GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ - -GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ - - -GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); - -GLAPI GLenum GLAPIENTRY glGetError( void ); - -GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); - -GLAPI void GLAPIENTRY glFinish( void ); - -GLAPI void GLAPIENTRY glFlush( void ); - -GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); - - -/* - * Depth Buffer - */ - -GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); - -GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); - -GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); - -GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); - - -/* - * Accumulation Buffer - */ - -GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); - -GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); - - -/* - * Transformation - */ - -GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); - -GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, - GLsizei width, GLsizei height ); - -GLAPI void GLAPIENTRY glPushMatrix( void ); - -GLAPI void GLAPIENTRY glPopMatrix( void ); - -GLAPI void GLAPIENTRY glLoadIdentity( void ); - -GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glRotated( GLdouble angle, - GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRotatef( GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); - - -/* - * Display Lists - */ - -GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); - -GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); - -GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); - -GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); - -GLAPI void GLAPIENTRY glEndList( void ); - -GLAPI void GLAPIENTRY glCallList( GLuint list ); - -GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, - const GLvoid *lists ); - -GLAPI void GLAPIENTRY glListBase( GLuint base ); - - -/* - * Drawing Functions - */ - -GLAPI void GLAPIENTRY glBegin( GLenum mode ); - -GLAPI void GLAPIENTRY glEnd( void ); - - -GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); -GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); -GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); -GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); -GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); - -GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); -GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glIndexd( GLdouble c ); -GLAPI void GLAPIENTRY glIndexf( GLfloat c ); -GLAPI void GLAPIENTRY glIndexi( GLint c ); -GLAPI void GLAPIENTRY glIndexs( GLshort c ); -GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); -GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); -GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); -GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); -GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); -GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); -GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); -GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); -GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); -GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); -GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); -GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); - -GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, - GLbyte blue, GLbyte alpha ); -GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, - GLdouble blue, GLdouble alpha ); -GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); -GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, - GLint blue, GLint alpha ); -GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, - GLshort blue, GLshort alpha ); -GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha ); -GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, - GLuint blue, GLuint alpha ); -GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, - GLushort blue, GLushort alpha ); - - -GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); - -GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); - - -GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); -GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); -GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); -GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); - -GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); -GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); -GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); -GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); -GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); -GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); -GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); -GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); -GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); -GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); -GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); -GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); -GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); - - -GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); -GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); -GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); -GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); - - -/* - * Vertex Arrays (1.1) - */ - -GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); - -GLAPI void GLAPIENTRY glArrayElement( GLint i ); - -GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); - -GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, - const GLvoid *pointer ); - -/* - * Lighting - */ - -GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); - -GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, - GLfloat *params ); -GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); - - -/* - * Raster functions - */ - -GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); - -GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, - const GLfloat *values ); -GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, - const GLuint *values ); -GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, - const GLushort *values ); - -GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); -GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); -GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); - -GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, - GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); - -GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLvoid *pixels ); - -GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type ); - -/* - * Stenciling - */ - -GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); - -GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); - -GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); - -GLAPI void GLAPIENTRY glClearStencil( GLint s ); - - - -/* - * Texture mapping - */ - -GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); -GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); -GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); -GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, - GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, - GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, - GLvoid *pixels ); - - -/* 1.1 functions */ - -GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, - const GLuint *textures, - const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, - const GLuint *textures, - GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); - - -GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, - GLint xoffset, - GLsizei width, GLenum format, - GLenum type, const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - -/* - * Evaluators - */ - -GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, - GLint stride, - GLint order, const GLdouble *points ); -GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, - GLint stride, - GLint order, const GLfloat *points ); - -GLAPI void GLAPIENTRY glMap2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); -GLAPI void GLAPIENTRY glMap2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); -GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); -GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); - -GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); -GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); - -GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); -GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); - -GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); -GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); - -GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); -GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); - -GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); - -GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); - -GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); - -GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - - -/* - * Fog - */ - -GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); - -GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); - -GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); - - -/* - * Selection and Feedback - */ - -GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); - -GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); - -GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); - -GLAPI void GLAPIENTRY glInitNames( void ); - -GLAPI void GLAPIENTRY glLoadName( GLuint name ); - -GLAPI void GLAPIENTRY glPushName( GLuint name ); - -GLAPI void GLAPIENTRY glPopName( void ); - - - -/* - * OpenGL 1.2 - */ - -#define GL_RESCALE_NORMAL 0x803A -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_TEXTURE_BINDING_3D 0x806A - -GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels); - -GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ); - -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - - -/* - * GL_ARB_imaging - */ - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_BLEND_EQUATION 0x8009 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ); - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ); - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ); - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ); - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ); - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height); - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ); - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ); - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); - - - - -/* - * OpenGL 1.3 - */ - -/* multitexture */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -/* texture_cube_map */ -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -/* texture_compression */ -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -/* multisample */ -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -/* transpose_matrix */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -/* texture_env_combine */ -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -/* texture_env_dot3 */ -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -/* texture_border_clamp */ -#define GL_CLAMP_TO_BORDER 0x812D - -GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); - -GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); - - -GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); - - -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); - - - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#endif /* GL_ARB_multitexture */ - - - -/* - * Define this token if you want "old-style" header file behaviour (extensions - * defined in gl.h). Otherwise, extensions will be included from glext.h. - */ -#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) -#include "SDL_opengl_glext.h" -#endif /* GL_GLEXT_LEGACY */ - - - -/* - * ???. GL_MESA_packed_depth_stencil - * XXX obsolete - */ -#ifndef GL_MESA_packed_depth_stencil -#define GL_MESA_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_MESA 0x8750 -#define GL_UNSIGNED_INT_24_8_MESA 0x8751 -#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 -#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 -#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 - -#endif /* GL_MESA_packed_depth_stencil */ - - -#ifndef GL_ATI_blend_equation_separate -#define GL_ATI_blend_equation_separate 1 - -#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D - -GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); - -#endif /* GL_ATI_blend_equation_separate */ - - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -typedef void* GLeglImageOES; -#endif - -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - - -/** - ** NOTE!!!!! If you add new functions to this file, or update - ** glext.h be sure to regenerate the gl_mangle.h file. See comments - ** in that file for details. - **/ - - - -/********************************************************************** - * Begin system-specific stuff - */ -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export off -#endif - -/* - * End system-specific stuff - **********************************************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif /* __gl_h_ */ - -#endif /* !__IPHONEOS__ */ - -#endif /* SDL_opengl_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h deleted file mode 100644 index 1e0660c3..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengles.h - * - * This is a simple file to encapsulate the OpenGL ES 1.X API headers. - */ -#include "SDL_config.h" - -#ifdef __IPHONEOS__ -#include <OpenGLES/ES1/gl.h> -#include <OpenGLES/ES1/glext.h> -#else -#include <GLES/gl.h> -#include <GLES/glext.h> -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h deleted file mode 100644 index df29d384..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengles2.h - * - * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. - */ -#include "SDL_config.h" - -#ifndef _MSC_VER - -#ifdef __IPHONEOS__ -#include <OpenGLES/ES2/gl.h> -#include <OpenGLES/ES2/glext.h> -#else -#include <GLES2/gl2platform.h> -#include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> -#endif - -#else /* _MSC_VER */ - -/* OpenGL ES2 headers for Visual Studio */ -#include "SDL_opengles2_khrplatform.h" -#include "SDL_opengles2_gl2platform.h" -#include "SDL_opengles2_gl2.h" -#include "SDL_opengles2_gl2ext.h" - -#endif /* _MSC_VER */ - -#ifndef APIENTRY -#define APIENTRY GL_APIENTRY -#endif diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h deleted file mode 100644 index 753f617a..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h +++ /dev/null @@ -1,473 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_pixels.h - * - * Header for the enumerated pixel format definitions. - */ - -#ifndef SDL_pixels_h_ -#define SDL_pixels_h_ - -#include "SDL_stdinc.h" -#include "SDL_endian.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Transparency definitions - * - * These define alpha as the opacity of a surface. - */ -/* @{ */ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/* @} */ - -/** Pixel type. */ -typedef enum -{ - SDL_PIXELTYPE_UNKNOWN, - SDL_PIXELTYPE_INDEX1, - SDL_PIXELTYPE_INDEX4, - SDL_PIXELTYPE_INDEX8, - SDL_PIXELTYPE_PACKED8, - SDL_PIXELTYPE_PACKED16, - SDL_PIXELTYPE_PACKED32, - SDL_PIXELTYPE_ARRAYU8, - SDL_PIXELTYPE_ARRAYU16, - SDL_PIXELTYPE_ARRAYU32, - SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32 -} SDL_PixelType; - -/** Bitmap pixel order, high bit -> low bit. */ -typedef enum -{ - SDL_BITMAPORDER_NONE, - SDL_BITMAPORDER_4321, - SDL_BITMAPORDER_1234 -} SDL_BitmapOrder; - -/** Packed component order, high bit -> low bit. */ -typedef enum -{ - SDL_PACKEDORDER_NONE, - SDL_PACKEDORDER_XRGB, - SDL_PACKEDORDER_RGBX, - SDL_PACKEDORDER_ARGB, - SDL_PACKEDORDER_RGBA, - SDL_PACKEDORDER_XBGR, - SDL_PACKEDORDER_BGRX, - SDL_PACKEDORDER_ABGR, - SDL_PACKEDORDER_BGRA -} SDL_PackedOrder; - -/** Array component order, low byte -> high byte. */ -/* !!! FIXME: in 2.1, make these not overlap differently with - !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ -typedef enum -{ - SDL_ARRAYORDER_NONE, - SDL_ARRAYORDER_RGB, - SDL_ARRAYORDER_RGBA, - SDL_ARRAYORDER_ARGB, - SDL_ARRAYORDER_BGR, - SDL_ARRAYORDER_BGRA, - SDL_ARRAYORDER_ABGR -} SDL_ArrayOrder; - -/** Packed component layout. */ -typedef enum -{ - SDL_PACKEDLAYOUT_NONE, - SDL_PACKEDLAYOUT_332, - SDL_PACKEDLAYOUT_4444, - SDL_PACKEDLAYOUT_1555, - SDL_PACKEDLAYOUT_5551, - SDL_PACKEDLAYOUT_565, - SDL_PACKEDLAYOUT_8888, - SDL_PACKEDLAYOUT_2101010, - SDL_PACKEDLAYOUT_1010102 -} SDL_PackedLayout; - -#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) - -#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ - ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ - ((bits) << 8) | ((bytes) << 0)) - -#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) -#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) -#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) -#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) -#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) -#define SDL_BYTESPERPIXEL(X) \ - (SDL_ISPIXELFORMAT_FOURCC(X) ? \ - ((((X) == SDL_PIXELFORMAT_YUY2) || \ - ((X) == SDL_PIXELFORMAT_UYVY) || \ - ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) - -#define SDL_ISPIXELFORMAT_INDEXED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) - -#define SDL_ISPIXELFORMAT_PACKED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) - -#define SDL_ISPIXELFORMAT_ARRAY(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) - -#define SDL_ISPIXELFORMAT_ALPHA(format) \ - ((SDL_ISPIXELFORMAT_PACKED(format) && \ - ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ - (SDL_ISPIXELFORMAT_ARRAY(format) && \ - ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) - -/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ -#define SDL_ISPIXELFORMAT_FOURCC(format) \ - ((format) && (SDL_PIXELFLAG(format) != 1)) - -/* Note: If you modify this list, update SDL_GetPixelFormatName() */ -typedef enum -{ - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX1MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX4LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX4MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX8 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), - SDL_PIXELFORMAT_RGB332 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_RGB444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_BGR444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_RGB555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_BGR555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_ARGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_RGBA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ABGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_BGRA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ARGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_RGBA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_ABGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_BGRA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_RGB565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_BGR565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_RGB24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, - 24, 3), - SDL_PIXELFORMAT_BGR24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, - 24, 3), - SDL_PIXELFORMAT_RGB888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_RGBX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGR888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGRX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_ARGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_RGBA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ABGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_BGRA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ARGB2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_2101010, 32, 4), - - /* Aliases for RGBA byte arrays of color data, for the current platform */ -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, -#else - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, -#endif - - SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), - SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ - SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), - SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), - SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), - SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), - SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), - SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), - SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ - SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') -} SDL_PixelFormatEnum; - -typedef struct SDL_Color -{ - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette -{ - int ncolors; - SDL_Color *colors; - Uint32 version; - int refcount; -} SDL_Palette; - -/** - * \note Everything in the pixel format structure is read-only. - */ -typedef struct SDL_PixelFormat -{ - Uint32 format; - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 padding[2]; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - int refcount; - struct SDL_PixelFormat *next; -} SDL_PixelFormat; - -/** - * \brief Get the human readable name of a pixel format - */ -extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); - -/** - * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. - * - * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. - * - * \sa SDL_MasksToPixelFormatEnum() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, - int *bpp, - Uint32 * Rmask, - Uint32 * Gmask, - Uint32 * Bmask, - Uint32 * Amask); - -/** - * \brief Convert a bpp and RGBA masks to an enumerated pixel format. - * - * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion - * wasn't possible. - * - * \sa SDL_PixelFormatEnumToMasks() - */ -extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); - -/** - * \brief Create an SDL_PixelFormat structure from a pixel format enum. - */ -extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); - -/** - * \brief Free an SDL_PixelFormat structure. - */ -extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); - -/** - * \brief Create a palette structure with the specified number of color - * entries. - * - * \return A new palette, or NULL if there wasn't enough memory. - * - * \note The palette entries are initialized to white. - * - * \sa SDL_FreePalette() - */ -extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); - -/** - * \brief Set the palette for a pixel format structure. - */ -extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, - SDL_Palette *palette); - -/** - * \brief Set a range of colors in a palette. - * - * \param palette The palette to modify. - * \param colors An array of colors to copy into the palette. - * \param firstcolor The index of the first palette entry to modify. - * \param ncolors The number of entries to modify. - * - * \return 0 on success, or -1 if not all of the colors could be set. - */ -extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, - const SDL_Color * colors, - int firstcolor, int ncolors); - -/** - * \brief Free a palette created with SDL_AllocPalette(). - * - * \sa SDL_AllocPalette() - */ -extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); - -/** - * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. - * - * \sa SDL_MapRGBA - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b); - -/** - * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. - * - * \sa SDL_MapRGB - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \brief Get the RGB components from a pixel of the specified format. - * - * \sa SDL_GetRGBA - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b); - -/** - * \brief Get the RGBA components from a pixel of the specified format. - * - * \sa SDL_GetRGB - */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \brief Calculate a 256 entry gamma ramp for a gamma value. - */ -extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_pixels_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h deleted file mode 100644 index c2cbc6b4..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_platform.h - * - * Try to get a standard set of platform defines. - */ - -#ifndef SDL_platform_h_ -#define SDL_platform_h_ - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if (defined(linux) || defined(__linux) || defined(__linux__)) -#undef __LINUX__ -#define __LINUX__ 1 -#endif -#if defined(ANDROID) || defined(__ANDROID__) -#undef __ANDROID__ -#undef __LINUX__ /* do we need to do this? */ -#define __ANDROID__ 1 -#endif - -#if defined(__APPLE__) -/* lets us know what version of Mac OS X we're compiling on */ -#include "AvailabilityMacros.h" -#include "TargetConditionals.h" -#if TARGET_OS_TV -#undef __TVOS__ -#define __TVOS__ 1 -#endif -#if TARGET_OS_IPHONE -/* if compiling for iOS */ -#undef __IPHONEOS__ -#define __IPHONEOS__ 1 -#undef __MACOSX__ -#else -/* if not compiling for iOS */ -#undef __MACOSX__ -#define __MACOSX__ 1 -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 -# error SDL for Mac OS X only supports deploying on 10.6 and above. -#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */ -#endif /* TARGET_OS_IPHONE */ -#endif /* defined(__APPLE__) */ - -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) || defined(__EMX__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__sun) && defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif - -#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) -/* Try to find out if we're compiling for WinRT or non-WinRT */ -#if defined(_MSC_VER) && defined(__has_include) -#if __has_include(<winapifamily.h>) -#define HAVE_WINAPIFAMILY_H 1 -#else -#define HAVE_WINAPIFAMILY_H 0 -#endif - -/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */ -#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */ -#define HAVE_WINAPIFAMILY_H 1 -#else -#define HAVE_WINAPIFAMILY_H 0 -#endif - -#if HAVE_WINAPIFAMILY_H -#include <winapifamily.h> -#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)) -#else -#define WINAPI_FAMILY_WINRT 0 -#endif /* HAVE_WINAPIFAMILY_H */ - -#if WINAPI_FAMILY_WINRT -#undef __WINRT__ -#define __WINRT__ 1 -#else -#undef __WINDOWS__ -#define __WINDOWS__ 1 -#endif -#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ - -#if defined(__WINDOWS__) -#undef __WIN32__ -#define __WIN32__ 1 -#endif -#if defined(__PSP__) -#undef __PSP__ -#define __PSP__ 1 -#endif - -/* The NACL compiler defines __native_client__ and __pnacl__ - * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi - */ -#if defined(__native_client__) -#undef __LINUX__ -#undef __NACL__ -#define __NACL__ 1 -#endif -#if defined(__pnacl__) -#undef __LINUX__ -#undef __PNACL__ -#define __PNACL__ 1 -/* PNACL with newlib supports static linking only */ -#define __SDL_NOGETPROCADDR__ -#endif - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Gets the name of the platform. - */ -extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_platform_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h deleted file mode 100644 index 4831cb77..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_power_h_ -#define SDL_power_h_ - -/** - * \file SDL_power.h - * - * Header for the SDL power management routines. - */ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The basic state for the system's power supply. - */ -typedef enum -{ - SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ - SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ - SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ - SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ - SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ -} SDL_PowerState; - - -/** - * \brief Get the current power supply details. - * - * \param secs Seconds of battery life left. You can pass a NULL here if - * you don't care. Will return -1 if we can't determine a - * value, or we're not running on a battery. - * - * \param pct Percentage of battery life left, between 0 and 100. You can - * pass a NULL here if you don't care. Will return -1 if we - * can't determine a value, or we're not running on a battery. - * - * \return The state of the battery (if any). - */ -extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_power_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h deleted file mode 100644 index c979983c..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_quit.h - * - * Include file for SDL quit event handling. - */ - -#ifndef SDL_quit_h_ -#define SDL_quit_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/** - * \file SDL_quit.h - * - * An ::SDL_QUIT event is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate ::SDL_QUIT events as well. There is no way - * to determine the cause of an ::SDL_QUIT event, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - * - * \sa SDL_Quit() - */ - -/* There are no functions directly affecting the quit event */ - -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) - -#endif /* SDL_quit_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h deleted file mode 100644 index 71a41151..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_rect.h - * - * Header file for SDL_rect definition and management functions. - */ - -#ifndef SDL_rect_h_ -#define SDL_rect_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_pixels.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a point (integer) - * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect - */ -typedef struct SDL_Point -{ - int x; - int y; -} SDL_Point; - -/** - * \brief The structure that defines a point (floating point) - * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect - */ -typedef struct SDL_FPoint -{ - float x; - float y; -} SDL_FPoint; - - -/** - * \brief A rectangle, with the origin at the upper left (integer). - * - * \sa SDL_RectEmpty - * \sa SDL_RectEquals - * \sa SDL_HasIntersection - * \sa SDL_IntersectRect - * \sa SDL_UnionRect - * \sa SDL_EnclosePoints - */ -typedef struct SDL_Rect -{ - int x, y; - int w, h; -} SDL_Rect; - - -/** - * \brief A rectangle, with the origin at the upper left (floating point). - */ -typedef struct SDL_FRect -{ - float x; - float y; - float w; - float h; -} SDL_FRect; - - -/** - * \brief Returns true if point resides inside a rectangle. - */ -SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) -{ - return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && - (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Returns true if the rectangle has no area. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) -{ - return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Returns true if the two rectangles are equal. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) -{ - return (a && b && (a->x == b->x) && (a->y == b->y) && - (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Determine whether two rectangles intersect. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, - const SDL_Rect * B); - -/** - * \brief Calculate the intersection of two rectangles. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * \brief Calculate the union of two rectangles. - */ -extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * \brief Calculate a minimal rectangle enclosing a set of points - * - * \return SDL_TRUE if any points were within the clipping rect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, - int count, - const SDL_Rect * clip, - SDL_Rect * result); - -/** - * \brief Calculate the intersection of a rectangle and line segment. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * - rect, int *X1, - int *Y1, int *X2, - int *Y2); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_rect_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h deleted file mode 100644 index f98c1843..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h +++ /dev/null @@ -1,1158 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_render.h - * - * Header file for SDL 2D rendering functions. - * - * This API supports the following features: - * * single pixel points - * * single pixel lines - * * filled rectangles - * * texture images - * - * The primitives may be drawn in opaque, blended, or additive modes. - * - * The texture images may be drawn in opaque, blended, or additive modes. - * They can have an additional color tint or alpha modulation applied to - * them, and may also be stretched with linear interpolation. - * - * This API is designed to accelerate simple 2D operations. You may - * want more functionality such as polygons and particle effects and - * in that case you should use SDL's OpenGL/Direct3D support or one - * of the many good 3D engines. - * - * These functions must be called from the main thread. - * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 - */ - -#ifndef SDL_render_h_ -#define SDL_render_h_ - -#include "SDL_stdinc.h" -#include "SDL_rect.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Flags used when creating a rendering context - */ -typedef enum -{ - SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ - SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware - acceleration */ - SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized - with the refresh rate */ - SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports - rendering to texture */ -} SDL_RendererFlags; - -/** - * \brief Information on the capabilities of a render driver or context. - */ -typedef struct SDL_RendererInfo -{ - const char *name; /**< The name of the renderer */ - Uint32 flags; /**< Supported ::SDL_RendererFlags */ - Uint32 num_texture_formats; /**< The number of available texture formats */ - Uint32 texture_formats[16]; /**< The available texture formats */ - int max_texture_width; /**< The maximum texture width */ - int max_texture_height; /**< The maximum texture height */ -} SDL_RendererInfo; - -/** - * \brief The scaling mode for a texture. - */ -typedef enum -{ - SDL_ScaleModeNearest, /**< nearest pixel sampling */ - SDL_ScaleModeLinear, /**< linear filtering */ - SDL_ScaleModeBest /**< anisotropic filtering */ -} SDL_ScaleMode; - -/** - * \brief The access pattern allowed for a texture. - */ -typedef enum -{ - SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ - SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ - SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ -} SDL_TextureAccess; - -/** - * \brief The texture channel modulation used in SDL_RenderCopy(). - */ -typedef enum -{ - SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ - SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ - SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ -} SDL_TextureModulate; - -/** - * \brief Flip constants for SDL_RenderCopyEx - */ -typedef enum -{ - SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ - SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ - SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ -} SDL_RendererFlip; - -/** - * \brief A structure representing rendering state - */ -struct SDL_Renderer; -typedef struct SDL_Renderer SDL_Renderer; - -/** - * \brief An efficient driver-specific representation of pixel data - */ -struct SDL_Texture; -typedef struct SDL_Texture SDL_Texture; - - -/* Function prototypes */ - -/** - * \brief Get the number of 2D rendering drivers available for the current - * display. - * - * A render driver is a set of code that handles rendering and texture - * management on a particular display. Normally there is only one, but - * some drivers may have several available with different capabilities. - * - * \sa SDL_GetRenderDriverInfo() - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); - -/** - * \brief Get information about a specific 2D rendering driver for the current - * display. - * - * \param index The index of the driver to query information about. - * \param info A pointer to an SDL_RendererInfo struct to be filled with - * information on the rendering driver. - * - * \return 0 on success, -1 if the index was out of range. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, - SDL_RendererInfo * info); - -/** - * \brief Create a window and default renderer - * - * \param width The width of the window - * \param height The height of the window - * \param window_flags The flags used to create the window - * \param window A pointer filled with the window, or NULL on error - * \param renderer A pointer filled with the renderer, or NULL on error - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( - int width, int height, Uint32 window_flags, - SDL_Window **window, SDL_Renderer **renderer); - - -/** - * \brief Create a 2D rendering context for a window. - * - * \param window The window where rendering is displayed. - * \param index The index of the rendering driver to initialize, or -1 to - * initialize the first one supporting the requested flags. - * \param flags ::SDL_RendererFlags. - * - * \return A valid rendering context or NULL if there was an error. - * - * \sa SDL_CreateSoftwareRenderer() - * \sa SDL_GetRendererInfo() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, - int index, Uint32 flags); - -/** - * \brief Create a 2D software rendering context for a surface. - * - * \param surface The surface where rendering is done. - * - * \return A valid rendering context or NULL if there was an error. - * - * \sa SDL_CreateRenderer() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); - -/** - * \brief Get the renderer associated with a window. - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); - -/** - * \brief Get information about a rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, - SDL_RendererInfo * info); - -/** - * \brief Get the output size in pixels of a rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, - int *w, int *h); - -/** - * \brief Create a texture for a rendering context. - * - * \param renderer The renderer. - * \param format The format of the texture. - * \param access One of the enumerated values in ::SDL_TextureAccess. - * \param w The width of the texture in pixels. - * \param h The height of the texture in pixels. - * - * \return The created texture is returned, or NULL if no rendering context was - * active, the format was unsupported, or the width or height were out - * of range. - * - * \note The contents of the texture are not defined at creation. - * - * \sa SDL_QueryTexture() - * \sa SDL_UpdateTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, - Uint32 format, - int access, int w, - int h); - -/** - * \brief Create a texture from an existing surface. - * - * \param renderer The renderer. - * \param surface The surface containing pixel data used to fill the texture. - * - * \return The created texture is returned, or NULL on error. - * - * \note The surface is not modified or freed by this function. - * - * \sa SDL_QueryTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); - -/** - * \brief Query the attributes of a texture - * - * \param texture A texture to be queried. - * \param format A pointer filled in with the raw format of the texture. The - * actual format may differ, but pixel transfers will use this - * format. - * \param access A pointer filled in with the actual access to the texture. - * \param w A pointer filled in with the width of the texture in pixels. - * \param h A pointer filled in with the height of the texture in pixels. - * - * \return 0 on success, or -1 if the texture is not valid. - */ -extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, - Uint32 * format, int *access, - int *w, int *h); - -/** - * \brief Set an additional color value used in render copy operations. - * - * \param texture The texture to update. - * \param r The red color value multiplied into copy operations. - * \param g The green color value multiplied into copy operations. - * \param b The blue color value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or color modulation - * is not supported. - * - * \sa SDL_GetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \brief Get the additional color value used in render copy operations. - * - * \param texture The texture to query. - * \param r A pointer filled in with the current red color value. - * \param g A pointer filled in with the current green color value. - * \param b A pointer filled in with the current blue color value. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \brief Set an additional alpha value used in render copy operations. - * - * \param texture The texture to update. - * \param alpha The alpha value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or alpha modulation - * is not supported. - * - * \sa SDL_GetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, - Uint8 alpha); - -/** - * \brief Get the additional alpha value used in render copy operations. - * - * \param texture The texture to query. - * \param alpha A pointer filled in with the current alpha value. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, - Uint8 * alpha); - -/** - * \brief Set the blend mode used for texture copy operations. - * - * \param texture The texture to update. - * \param blendMode ::SDL_BlendMode to use for texture blending. - * - * \return 0 on success, or -1 if the texture is not valid or the blend mode is - * not supported. - * - * \note If the blend mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for texture copy operations. - * - * \param texture The texture to query. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode *blendMode); - -/** - * \brief Set the scale mode used for texture scale operations. - * - * \param texture The texture to update. - * \param scaleMode ::SDL_ScaleMode to use for texture scaling. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note If the scale mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetTextureScaleMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, - SDL_ScaleMode scaleMode); - -/** - * \brief Get the scale mode used for texture scale operations. - * - * \param texture The texture to query. - * \param scaleMode A pointer filled in with the current scale mode. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureScaleMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, - SDL_ScaleMode *scaleMode); - -/** - * \brief Update the given texture rectangle with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param pixels The raw pixel data in the format of the texture. - * \param pitch The number of bytes in a row of pixel data, including padding between lines. - * - * The pixel data must be in the format of the texture. The pixel format can be - * queried with SDL_QueryTexture. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note This is a fairly slow function. - */ -extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const void *pixels, int pitch); - -/** - * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param Yplane The raw pixel data for the Y plane. - * \param Ypitch The number of bytes between rows of pixel data for the Y plane. - * \param Uplane The raw pixel data for the U plane. - * \param Upitch The number of bytes between rows of pixel data for the U plane. - * \param Vplane The raw pixel data for the V plane. - * \param Vpitch The number of bytes between rows of pixel data for the V plane. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note You can use SDL_UpdateTexture() as long as your pixel data is - * a contiguous block of Y and U/V planes in the proper order, but - * this function is available if your pixel data is not contiguous. - */ -extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch); - -/** - * \brief Lock a portion of the texture for write-only pixel access. - * - * \param texture The texture to lock for access, which was created with - * ::SDL_TEXTUREACCESS_STREAMING. - * \param rect A pointer to the rectangle to lock for access. If the rect - * is NULL, the entire texture will be locked. - * \param pixels This is filled in with a pointer to the locked pixels, - * appropriately offset by the locked area. - * \param pitch This is filled in with the pitch of the locked pixels. - * - * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. - * - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, - const SDL_Rect * rect, - void **pixels, int *pitch); - -/** - * \brief Lock a portion of the texture for write-only pixel access. - * Expose it as a SDL surface. - * - * \param texture The texture to lock for access, which was created with - * ::SDL_TEXTUREACCESS_STREAMING. - * \param rect A pointer to the rectangle to lock for access. If the rect - * is NULL, the entire texture will be locked. - * \param surface This is filled in with a SDL surface representing the locked area - * Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture. - * - * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. - * - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); - -/** - * \brief Unlock a texture, uploading the changes to video memory, if needed. - * If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed. - * - * \sa SDL_LockTexture() - * \sa SDL_LockTextureToSurface() - */ -extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); - -/** - * \brief Determines whether a window supports the use of render targets - * - * \param renderer The renderer that will be checked - * - * \return SDL_TRUE if supported, SDL_FALSE if not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); - -/** - * \brief Set a texture as the current rendering target. - * - * \param renderer The renderer. - * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target - * - * \return 0 on success, or -1 on error - * - * \sa SDL_GetRenderTarget() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, - SDL_Texture *texture); - -/** - * \brief Get the current render target or NULL for the default render target. - * - * \return The current render target - * - * \sa SDL_SetRenderTarget() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); - -/** - * \brief Set device independent resolution for rendering - * - * \param renderer The renderer for which resolution should be set. - * \param w The width of the logical resolution - * \param h The height of the logical resolution - * - * This function uses the viewport and scaling functionality to allow a fixed logical - * resolution for rendering, regardless of the actual output resolution. If the actual - * output resolution doesn't have the same aspect ratio the output rendering will be - * centered within the output display. - * - * If the output display is a window, mouse events in the window will be filtered - * and scaled so they seem to arrive within the logical resolution. - * - * \note If this function results in scaling or subpixel drawing by the - * rendering backend, it will be handled using the appropriate - * quality hints. - * - * \sa SDL_RenderGetLogicalSize() - * \sa SDL_RenderSetScale() - * \sa SDL_RenderSetViewport() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); - -/** - * \brief Get device independent resolution for rendering - * - * \param renderer The renderer from which resolution should be queried. - * \param w A pointer filled with the width of the logical resolution - * \param h A pointer filled with the height of the logical resolution - * - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); - -/** - * \brief Set whether to force integer scales for resolution-independent rendering - * - * \param renderer The renderer for which integer scaling should be set. - * \param enable Enable or disable integer scaling - * - * This function restricts the logical viewport to integer values - that is, when - * a resolution is between two multiples of a logical size, the viewport size is - * rounded down to the lower multiple. - * - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer, - SDL_bool enable); - -/** - * \brief Get whether integer scales are forced for resolution-independent rendering - * - * \param renderer The renderer from which integer scaling should be queried. - * - * \sa SDL_RenderSetIntegerScale() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer); - -/** - * \brief Set the drawing area for rendering on the current target. - * - * \param renderer The renderer for which the drawing area should be set. - * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. - * - * The x,y of the viewport rect represents the origin for rendering. - * - * \return 0 on success, or -1 on error - * - * \note If the window associated with the renderer is resized, the viewport is automatically reset. - * - * \sa SDL_RenderGetViewport() - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Get the drawing area for the current target. - * - * \sa SDL_RenderSetViewport() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * \brief Set the clip rectangle for the current target. - * - * \param renderer The renderer for which clip rectangle should be set. - * \param rect A pointer to the rectangle to set as the clip rectangle, or - * NULL to disable clipping. - * - * \return 0 on success, or -1 on error - * - * \sa SDL_RenderGetClipRect() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Get the clip rectangle for the current target. - * - * \param renderer The renderer from which clip rectangle should be queried. - * \param rect A pointer filled in with the current clip rectangle, or - * an empty rectangle if clipping is disabled. - * - * \sa SDL_RenderSetClipRect() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * \brief Get whether clipping is enabled on the given renderer. - * - * \param renderer The renderer from which clip state should be queried. - * - * \sa SDL_RenderGetClipRect() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); - - -/** - * \brief Set the drawing scale for rendering on the current target. - * - * \param renderer The renderer for which the drawing scale should be set. - * \param scaleX The horizontal scaling factor - * \param scaleY The vertical scaling factor - * - * The drawing coordinates are scaled by the x/y scaling factors - * before they are used by the renderer. This allows resolution - * independent drawing with a single coordinate system. - * - * \note If this results in scaling or subpixel drawing by the - * rendering backend, it will be handled using the appropriate - * quality hints. For best results use integer scaling factors. - * - * \sa SDL_RenderGetScale() - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, - float scaleX, float scaleY); - -/** - * \brief Get the drawing scale for the current target. - * - * \param renderer The renderer from which drawing scale should be queried. - * \param scaleX A pointer filled in with the horizontal scaling factor - * \param scaleY A pointer filled in with the vertical scaling factor - * - * \sa SDL_RenderSetScale() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, - float *scaleX, float *scaleY); - -/** - * \brief Set the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer The renderer for which drawing color should be set. - * \param r The red value used to draw on the rendering target. - * \param g The green value used to draw on the rendering target. - * \param b The blue value used to draw on the rendering target. - * \param a The alpha value used to draw on the rendering target, usually - * ::SDL_ALPHA_OPAQUE (255). - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \brief Get the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer The renderer from which drawing color should be queried. - * \param r A pointer to the red value used to draw on the rendering target. - * \param g A pointer to the green value used to draw on the rendering target. - * \param b A pointer to the blue value used to draw on the rendering target. - * \param a A pointer to the alpha value used to draw on the rendering target, - * usually ::SDL_ALPHA_OPAQUE (255). - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \brief Set the blend mode used for drawing operations (Fill and Line). - * - * \param renderer The renderer for which blend mode should be set. - * \param blendMode ::SDL_BlendMode to use for blending. - * - * \return 0 on success, or -1 on error - * - * \note If the blend mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for drawing operations. - * - * \param renderer The renderer from which blend mode should be queried. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 on error - * - * \sa SDL_SetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode *blendMode); - -/** - * \brief Clear the current rendering target with the drawing color - * - * This function clears the entire rendering target, ignoring the viewport and - * the clip rectangle. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); - -/** - * \brief Draw a point on the current rendering target. - * - * \param renderer The renderer which should draw a point. - * \param x The x coordinate of the point. - * \param y The y coordinate of the point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, - int x, int y); - -/** - * \brief Draw multiple points on the current rendering target. - * - * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * \brief Draw a line on the current rendering target. - * - * \param renderer The renderer which should draw a line. - * \param x1 The x coordinate of the start point. - * \param y1 The y coordinate of the start point. - * \param x2 The x coordinate of the end point. - * \param y2 The y coordinate of the end point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, - int x1, int y1, int x2, int y2); - -/** - * \brief Draw a series of connected lines on the current rendering target. - * - * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * \brief Draw a rectangle on the current rendering target. - * - * \param renderer The renderer which should draw a rectangle. - * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Draw some number of rectangles on the current rendering target. - * - * \param renderer The renderer which should draw multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * \brief Fill a rectangle on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill a rectangle. - * \param rect A pointer to the destination rectangle, or NULL for the entire - * rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Fill some number of rectangles on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * \brief Copy a portion of the texture to the current rendering target. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); - -/** - * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction - * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). - * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect, - const double angle, - const SDL_Point *center, - const SDL_RendererFlip flip); - - -/** - * \brief Draw a point on the current rendering target. - * - * \param renderer The renderer which should draw a point. - * \param x The x coordinate of the point. - * \param y The y coordinate of the point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer, - float x, float y); - -/** - * \brief Draw multiple points on the current rendering target. - * - * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer, - const SDL_FPoint * points, - int count); - -/** - * \brief Draw a line on the current rendering target. - * - * \param renderer The renderer which should draw a line. - * \param x1 The x coordinate of the start point. - * \param y1 The y coordinate of the start point. - * \param x2 The x coordinate of the end point. - * \param y2 The y coordinate of the end point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer, - float x1, float y1, float x2, float y2); - -/** - * \brief Draw a series of connected lines on the current rendering target. - * - * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer, - const SDL_FPoint * points, - int count); - -/** - * \brief Draw a rectangle on the current rendering target. - * - * \param renderer The renderer which should draw a rectangle. - * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer, - const SDL_FRect * rect); - -/** - * \brief Draw some number of rectangles on the current rendering target. - * - * \param renderer The renderer which should draw multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, - int count); - -/** - * \brief Fill a rectangle on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill a rectangle. - * \param rect A pointer to the destination rectangle, or NULL for the entire - * rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer, - const SDL_FRect * rect); - -/** - * \brief Fill some number of rectangles on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, - int count); - -/** - * \brief Copy a portion of the texture to the current rendering target. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_FRect * dstrect); - -/** - * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction - * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). - * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_FRect * dstrect, - const double angle, - const SDL_FPoint *center, - const SDL_RendererFlip flip); - -/** - * \brief Read pixels from the current rendering target. - * - * \param renderer The renderer from which pixels should be read. - * \param rect A pointer to the rectangle to read, or NULL for the entire - * render target. - * \param format The desired format of the pixel data, or 0 to use the format - * of the rendering target - * \param pixels A pointer to be filled in with the pixel data - * \param pitch The pitch of the pixels parameter. - * - * \return 0 on success, or -1 if pixel reading is not supported. - * - * \warning This is a very slow operation, and should not be used frequently. - */ -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, - const SDL_Rect * rect, - Uint32 format, - void *pixels, int pitch); - -/** - * \brief Update the screen with rendering performed. - */ -extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); - -/** - * \brief Destroy the specified texture. - * - * \sa SDL_CreateTexture() - * \sa SDL_CreateTextureFromSurface() - */ -extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); - -/** - * \brief Destroy the rendering context for a window and free associated - * textures. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); - -/** - * \brief Force the rendering context to flush any pending commands to the - * underlying rendering API. - * - * You do not need to (and in fact, shouldn't) call this function unless - * you are planning to call into OpenGL/Direct3D/Metal/whatever directly - * in addition to using an SDL_Renderer. - * - * This is for a very-specific case: if you are using SDL's render API, - * you asked for a specific renderer backend (OpenGL, Direct3D, etc), - * you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make - * OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of - * this applies, you should call SDL_RenderFlush() between calls to SDL's - * render API and the low-level API you're using in cooperation. - * - * In all other cases, you can ignore this function. This is only here to - * get maximum performance out of a specific situation. In all other cases, - * SDL will do the right thing, perhaps at a performance loss. - * - * This function is first available in SDL 2.0.10, and is not needed in - * 2.0.9 and earlier, as earlier versions did not queue rendering commands - * at all, instead flushing them to the OS immediately. - */ -extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer); - - -/** - * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with - * OpenGL instructions. - * - * \param texture The SDL texture to bind - * \param texw A pointer to a float that will be filled with the texture width - * \param texh A pointer to a float that will be filled with the texture height - * - * \return 0 on success, or -1 if the operation is not supported - */ -extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); - -/** - * \brief Unbind a texture from the current OpenGL/ES/ES2 context. - * - * \param texture The SDL texture to unbind - * - * \return 0 on success, or -1 if the operation is not supported - */ -extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); - -/** - * \brief Get the CAMetalLayer associated with the given Metal renderer - * - * \param renderer The renderer to query - * - * \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer - * - * \sa SDL_RenderGetMetalCommandEncoder() - */ -extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer); - -/** - * \brief Get the Metal command encoder for the current frame - * - * \param renderer The renderer to query - * - * \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer - * - * \sa SDL_RenderGetMetalLayer() - */ -extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_render_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h deleted file mode 100644 index 6996d603..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h +++ /dev/null @@ -1,2 +0,0 @@ -#define SDL_REVISION "hg-13387:8a12cc1abc9e" -#define SDL_REVISION_NUMBER 13387 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h deleted file mode 100644 index f66119fb..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_rwops.h - * - * This file provides a general interface for SDL to read and write - * data streams. It can easily be extended to files, memory, etc. - */ - -#ifndef SDL_rwops_h_ -#define SDL_rwops_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* RWops Types */ -#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */ -#define SDL_RWOPS_WINFILE 1U /**< Win32 file */ -#define SDL_RWOPS_STDFILE 2U /**< Stdio file */ -#define SDL_RWOPS_JNIFILE 3U /**< Android asset */ -#define SDL_RWOPS_MEMORY 4U /**< Memory stream */ -#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */ - -/** - * This is the read/write operation structure -- very basic. - */ -typedef struct SDL_RWops -{ - /** - * Return the size of the file in this rwops, or -1 if unknown - */ - Sint64 (SDLCALL * size) (struct SDL_RWops * context); - - /** - * Seek to \c offset relative to \c whence, one of stdio's whence values: - * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - * - * \return the final offset in the data stream, or -1 on error. - */ - Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, - int whence); - - /** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. - * - * \return the number of objects read, or 0 at error or end of file. - */ - size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, - size_t size, size_t maxnum); - - /** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. - * - * \return the number of objects written, or 0 at error or end of file. - */ - size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, - size_t size, size_t num); - - /** - * Close and free an allocated SDL_RWops structure. - * - * \return 0 if successful or -1 on write error when flushing data. - */ - int (SDLCALL * close) (struct SDL_RWops * context); - - Uint32 type; - union - { -#if defined(__ANDROID__) - struct - { - void *fileNameRef; - void *inputStreamRef; - void *readableByteChannelRef; - void *readMethod; - void *assetFileDescriptorRef; - long position; - long size; - long offset; - int fd; - } androidio; -#elif defined(__WIN32__) - struct - { - SDL_bool append; - void *h; - struct - { - void *data; - size_t size; - size_t left; - } buffer; - } windowsio; -#endif - -#ifdef HAVE_STDIO_H - struct - { - SDL_bool autoclose; - FILE *fp; - } stdio; -#endif - struct - { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct - { - void *data1; - void *data2; - } unknown; - } hidden; - -} SDL_RWops; - - -/** - * \name RWFrom functions - * - * Functions to create SDL_RWops structures from various data streams. - */ -/* @{ */ - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, - const char *mode); - -#ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, - SDL_bool autoclose); -#else -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, - SDL_bool autoclose); -#endif - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, - int size); - -/* @} *//* RWFrom functions */ - - -extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); - -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ - -/** - * Return the size of the file in this rwops, or -1 if unknown - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context); - -/** - * Seek to \c offset relative to \c whence, one of stdio's whence values: - * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - * - * \return the final offset in the data stream, or -1 on error. - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, - Sint64 offset, int whence); - -/** - * Return the current offset in the data stream, or -1 on error. - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context); - -/** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. - * - * \return the number of objects read, or 0 at error or end of file. - */ -extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, - void *ptr, size_t size, size_t maxnum); - -/** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. - * - * \return the number of objects written, or 0 at error or end of file. - */ -extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, - const void *ptr, size_t size, size_t num); - -/** - * Close and free an allocated SDL_RWops structure. - * - * \return 0 if successful or -1 on write error when flushing data. - */ -extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context); - -/** - * Load all the data from an SDL data stream. - * - * The data is allocated with a zero byte at the end (null terminated) - * - * If \c datasize is not NULL, it is filled with the size of the data read. - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The data should be freed with SDL_free(). - * - * \return the data, or NULL if there was an error. - */ -extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, - int freesrc); - -/** - * Load an entire file. - * - * The data is allocated with a zero byte at the end (null terminated) - * - * If \c datasize is not NULL, it is filled with the size of the data read. - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The data should be freed with SDL_free(). - * - * \return the data, or NULL if there was an error. - */ -extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); - -/** - * \name Read endian functions - * - * Read an item of the specified endianness and return in native format. - */ -/* @{ */ -extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); -/* @} *//* Read endian functions */ - -/** - * \name Write endian functions - * - * Write an item of native format to the specified endianness. - */ -/* @{ */ -extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); -/* @} *//* Write endian functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_rwops_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h deleted file mode 100644 index a50305f5..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h +++ /dev/null @@ -1,413 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_scancode.h - * - * Defines keyboard scancodes. - */ - -#ifndef SDL_scancode_h_ -#define SDL_scancode_h_ - -#include "SDL_stdinc.h" - -/** - * \brief The SDL keyboard scancode representation. - * - * Values of this type are used to represent keyboard keys, among other places - * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the - * SDL_Event structure. - * - * The values in this enumeration are based on the USB usage page standard: - * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf - */ -typedef enum -{ - SDL_SCANCODE_UNKNOWN = 0, - - /** - * \name Usage page 0x07 - * - * These values are from usage page 0x07 (USB keyboard page). - */ - /* @{ */ - - SDL_SCANCODE_A = 4, - SDL_SCANCODE_B = 5, - SDL_SCANCODE_C = 6, - SDL_SCANCODE_D = 7, - SDL_SCANCODE_E = 8, - SDL_SCANCODE_F = 9, - SDL_SCANCODE_G = 10, - SDL_SCANCODE_H = 11, - SDL_SCANCODE_I = 12, - SDL_SCANCODE_J = 13, - SDL_SCANCODE_K = 14, - SDL_SCANCODE_L = 15, - SDL_SCANCODE_M = 16, - SDL_SCANCODE_N = 17, - SDL_SCANCODE_O = 18, - SDL_SCANCODE_P = 19, - SDL_SCANCODE_Q = 20, - SDL_SCANCODE_R = 21, - SDL_SCANCODE_S = 22, - SDL_SCANCODE_T = 23, - SDL_SCANCODE_U = 24, - SDL_SCANCODE_V = 25, - SDL_SCANCODE_W = 26, - SDL_SCANCODE_X = 27, - SDL_SCANCODE_Y = 28, - SDL_SCANCODE_Z = 29, - - SDL_SCANCODE_1 = 30, - SDL_SCANCODE_2 = 31, - SDL_SCANCODE_3 = 32, - SDL_SCANCODE_4 = 33, - SDL_SCANCODE_5 = 34, - SDL_SCANCODE_6 = 35, - SDL_SCANCODE_7 = 36, - SDL_SCANCODE_8 = 37, - SDL_SCANCODE_9 = 38, - SDL_SCANCODE_0 = 39, - - SDL_SCANCODE_RETURN = 40, - SDL_SCANCODE_ESCAPE = 41, - SDL_SCANCODE_BACKSPACE = 42, - SDL_SCANCODE_TAB = 43, - SDL_SCANCODE_SPACE = 44, - - SDL_SCANCODE_MINUS = 45, - SDL_SCANCODE_EQUALS = 46, - SDL_SCANCODE_LEFTBRACKET = 47, - SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return - * key on ISO keyboards and at the right end - * of the QWERTY row on ANSI keyboards. - * Produces REVERSE SOLIDUS (backslash) and - * VERTICAL LINE in a US layout, REVERSE - * SOLIDUS and VERTICAL LINE in a UK Mac - * layout, NUMBER SIGN and TILDE in a UK - * Windows layout, DOLLAR SIGN and POUND SIGN - * in a Swiss German layout, NUMBER SIGN and - * APOSTROPHE in a German layout, GRAVE - * ACCENT and POUND SIGN in a French Mac - * layout, and ASTERISK and MICRO SIGN in a - * French Windows layout. - */ - SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code - * instead of 49 for the same key, but all - * OSes I've seen treat the two codes - * identically. So, as an implementor, unless - * your keyboard generates both of those - * codes and your OS treats them differently, - * you should generate SDL_SCANCODE_BACKSLASH - * instead of this code. As a user, you - * should not rely on this code because SDL - * will never generate it with most (all?) - * keyboards. - */ - SDL_SCANCODE_SEMICOLON = 51, - SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI - * and ISO keyboards). Produces GRAVE ACCENT and - * TILDE in a US Windows layout and in US and UK - * Mac layouts on ANSI keyboards, GRAVE ACCENT - * and NOT SIGN in a UK Windows layout, SECTION - * SIGN and PLUS-MINUS SIGN in US and UK Mac - * layouts on ISO keyboards, SECTION SIGN and - * DEGREE SIGN in a Swiss German layout (Mac: - * only on ISO keyboards), CIRCUMFLEX ACCENT and - * DEGREE SIGN in a German layout (Mac: only on - * ISO keyboards), SUPERSCRIPT TWO and TILDE in a - * French Windows layout, COMMERCIAL AT and - * NUMBER SIGN in a French Mac layout on ISO - * keyboards, and LESS-THAN SIGN and GREATER-THAN - * SIGN in a Swiss German, German, or French Mac - * layout on ANSI keyboards. - */ - SDL_SCANCODE_COMMA = 54, - SDL_SCANCODE_PERIOD = 55, - SDL_SCANCODE_SLASH = 56, - - SDL_SCANCODE_CAPSLOCK = 57, - - SDL_SCANCODE_F1 = 58, - SDL_SCANCODE_F2 = 59, - SDL_SCANCODE_F3 = 60, - SDL_SCANCODE_F4 = 61, - SDL_SCANCODE_F5 = 62, - SDL_SCANCODE_F6 = 63, - SDL_SCANCODE_F7 = 64, - SDL_SCANCODE_F8 = 65, - SDL_SCANCODE_F9 = 66, - SDL_SCANCODE_F10 = 67, - SDL_SCANCODE_F11 = 68, - SDL_SCANCODE_F12 = 69, - - SDL_SCANCODE_PRINTSCREEN = 70, - SDL_SCANCODE_SCROLLLOCK = 71, - SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but - does send code 73, not 117) */ - SDL_SCANCODE_HOME = 74, - SDL_SCANCODE_PAGEUP = 75, - SDL_SCANCODE_DELETE = 76, - SDL_SCANCODE_END = 77, - SDL_SCANCODE_PAGEDOWN = 78, - SDL_SCANCODE_RIGHT = 79, - SDL_SCANCODE_LEFT = 80, - SDL_SCANCODE_DOWN = 81, - SDL_SCANCODE_UP = 82, - - SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards - */ - SDL_SCANCODE_KP_DIVIDE = 84, - SDL_SCANCODE_KP_MULTIPLY = 85, - SDL_SCANCODE_KP_MINUS = 86, - SDL_SCANCODE_KP_PLUS = 87, - SDL_SCANCODE_KP_ENTER = 88, - SDL_SCANCODE_KP_1 = 89, - SDL_SCANCODE_KP_2 = 90, - SDL_SCANCODE_KP_3 = 91, - SDL_SCANCODE_KP_4 = 92, - SDL_SCANCODE_KP_5 = 93, - SDL_SCANCODE_KP_6 = 94, - SDL_SCANCODE_KP_7 = 95, - SDL_SCANCODE_KP_8 = 96, - SDL_SCANCODE_KP_9 = 97, - SDL_SCANCODE_KP_0 = 98, - SDL_SCANCODE_KP_PERIOD = 99, - - SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO - * keyboards have over ANSI ones, - * located between left shift and Y. - * Produces GRAVE ACCENT and TILDE in a - * US or UK Mac layout, REVERSE SOLIDUS - * (backslash) and VERTICAL LINE in a - * US or UK Windows layout, and - * LESS-THAN SIGN and GREATER-THAN SIGN - * in a Swiss German, German, or French - * layout. */ - SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ - SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, - * not a physical key - but some Mac keyboards - * do have a power key. */ - SDL_SCANCODE_KP_EQUALS = 103, - SDL_SCANCODE_F13 = 104, - SDL_SCANCODE_F14 = 105, - SDL_SCANCODE_F15 = 106, - SDL_SCANCODE_F16 = 107, - SDL_SCANCODE_F17 = 108, - SDL_SCANCODE_F18 = 109, - SDL_SCANCODE_F19 = 110, - SDL_SCANCODE_F20 = 111, - SDL_SCANCODE_F21 = 112, - SDL_SCANCODE_F22 = 113, - SDL_SCANCODE_F23 = 114, - SDL_SCANCODE_F24 = 115, - SDL_SCANCODE_EXECUTE = 116, - SDL_SCANCODE_HELP = 117, - SDL_SCANCODE_MENU = 118, - SDL_SCANCODE_SELECT = 119, - SDL_SCANCODE_STOP = 120, - SDL_SCANCODE_AGAIN = 121, /**< redo */ - SDL_SCANCODE_UNDO = 122, - SDL_SCANCODE_CUT = 123, - SDL_SCANCODE_COPY = 124, - SDL_SCANCODE_PASTE = 125, - SDL_SCANCODE_FIND = 126, - SDL_SCANCODE_MUTE = 127, - SDL_SCANCODE_VOLUMEUP = 128, - SDL_SCANCODE_VOLUMEDOWN = 129, -/* not sure whether there's a reason to enable these */ -/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ -/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ -/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ - SDL_SCANCODE_KP_COMMA = 133, - SDL_SCANCODE_KP_EQUALSAS400 = 134, - - SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see - footnotes in USB doc */ - SDL_SCANCODE_INTERNATIONAL2 = 136, - SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ - SDL_SCANCODE_INTERNATIONAL4 = 138, - SDL_SCANCODE_INTERNATIONAL5 = 139, - SDL_SCANCODE_INTERNATIONAL6 = 140, - SDL_SCANCODE_INTERNATIONAL7 = 141, - SDL_SCANCODE_INTERNATIONAL8 = 142, - SDL_SCANCODE_INTERNATIONAL9 = 143, - SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ - SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ - SDL_SCANCODE_LANG3 = 146, /**< Katakana */ - SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ - SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ - SDL_SCANCODE_LANG6 = 149, /**< reserved */ - SDL_SCANCODE_LANG7 = 150, /**< reserved */ - SDL_SCANCODE_LANG8 = 151, /**< reserved */ - SDL_SCANCODE_LANG9 = 152, /**< reserved */ - - SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ - SDL_SCANCODE_SYSREQ = 154, - SDL_SCANCODE_CANCEL = 155, - SDL_SCANCODE_CLEAR = 156, - SDL_SCANCODE_PRIOR = 157, - SDL_SCANCODE_RETURN2 = 158, - SDL_SCANCODE_SEPARATOR = 159, - SDL_SCANCODE_OUT = 160, - SDL_SCANCODE_OPER = 161, - SDL_SCANCODE_CLEARAGAIN = 162, - SDL_SCANCODE_CRSEL = 163, - SDL_SCANCODE_EXSEL = 164, - - SDL_SCANCODE_KP_00 = 176, - SDL_SCANCODE_KP_000 = 177, - SDL_SCANCODE_THOUSANDSSEPARATOR = 178, - SDL_SCANCODE_DECIMALSEPARATOR = 179, - SDL_SCANCODE_CURRENCYUNIT = 180, - SDL_SCANCODE_CURRENCYSUBUNIT = 181, - SDL_SCANCODE_KP_LEFTPAREN = 182, - SDL_SCANCODE_KP_RIGHTPAREN = 183, - SDL_SCANCODE_KP_LEFTBRACE = 184, - SDL_SCANCODE_KP_RIGHTBRACE = 185, - SDL_SCANCODE_KP_TAB = 186, - SDL_SCANCODE_KP_BACKSPACE = 187, - SDL_SCANCODE_KP_A = 188, - SDL_SCANCODE_KP_B = 189, - SDL_SCANCODE_KP_C = 190, - SDL_SCANCODE_KP_D = 191, - SDL_SCANCODE_KP_E = 192, - SDL_SCANCODE_KP_F = 193, - SDL_SCANCODE_KP_XOR = 194, - SDL_SCANCODE_KP_POWER = 195, - SDL_SCANCODE_KP_PERCENT = 196, - SDL_SCANCODE_KP_LESS = 197, - SDL_SCANCODE_KP_GREATER = 198, - SDL_SCANCODE_KP_AMPERSAND = 199, - SDL_SCANCODE_KP_DBLAMPERSAND = 200, - SDL_SCANCODE_KP_VERTICALBAR = 201, - SDL_SCANCODE_KP_DBLVERTICALBAR = 202, - SDL_SCANCODE_KP_COLON = 203, - SDL_SCANCODE_KP_HASH = 204, - SDL_SCANCODE_KP_SPACE = 205, - SDL_SCANCODE_KP_AT = 206, - SDL_SCANCODE_KP_EXCLAM = 207, - SDL_SCANCODE_KP_MEMSTORE = 208, - SDL_SCANCODE_KP_MEMRECALL = 209, - SDL_SCANCODE_KP_MEMCLEAR = 210, - SDL_SCANCODE_KP_MEMADD = 211, - SDL_SCANCODE_KP_MEMSUBTRACT = 212, - SDL_SCANCODE_KP_MEMMULTIPLY = 213, - SDL_SCANCODE_KP_MEMDIVIDE = 214, - SDL_SCANCODE_KP_PLUSMINUS = 215, - SDL_SCANCODE_KP_CLEAR = 216, - SDL_SCANCODE_KP_CLEARENTRY = 217, - SDL_SCANCODE_KP_BINARY = 218, - SDL_SCANCODE_KP_OCTAL = 219, - SDL_SCANCODE_KP_DECIMAL = 220, - SDL_SCANCODE_KP_HEXADECIMAL = 221, - - SDL_SCANCODE_LCTRL = 224, - SDL_SCANCODE_LSHIFT = 225, - SDL_SCANCODE_LALT = 226, /**< alt, option */ - SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ - SDL_SCANCODE_RCTRL = 228, - SDL_SCANCODE_RSHIFT = 229, - SDL_SCANCODE_RALT = 230, /**< alt gr, option */ - SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ - - SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered - * by any of the above, but since there's a - * special KMOD_MODE for it I'm adding it here - */ - - /* @} *//* Usage page 0x07 */ - - /** - * \name Usage page 0x0C - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIONEXT = 258, - SDL_SCANCODE_AUDIOPREV = 259, - SDL_SCANCODE_AUDIOSTOP = 260, - SDL_SCANCODE_AUDIOPLAY = 261, - SDL_SCANCODE_AUDIOMUTE = 262, - SDL_SCANCODE_MEDIASELECT = 263, - SDL_SCANCODE_WWW = 264, - SDL_SCANCODE_MAIL = 265, - SDL_SCANCODE_CALCULATOR = 266, - SDL_SCANCODE_COMPUTER = 267, - SDL_SCANCODE_AC_SEARCH = 268, - SDL_SCANCODE_AC_HOME = 269, - SDL_SCANCODE_AC_BACK = 270, - SDL_SCANCODE_AC_FORWARD = 271, - SDL_SCANCODE_AC_STOP = 272, - SDL_SCANCODE_AC_REFRESH = 273, - SDL_SCANCODE_AC_BOOKMARKS = 274, - - /* @} *//* Usage page 0x0C */ - - /** - * \name Walther keys - * - * These are values that Christian Walther added (for mac keyboard?). - */ - /* @{ */ - - SDL_SCANCODE_BRIGHTNESSDOWN = 275, - SDL_SCANCODE_BRIGHTNESSUP = 276, - SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display - switch, video mode switch */ - SDL_SCANCODE_KBDILLUMTOGGLE = 278, - SDL_SCANCODE_KBDILLUMDOWN = 279, - SDL_SCANCODE_KBDILLUMUP = 280, - SDL_SCANCODE_EJECT = 281, - SDL_SCANCODE_SLEEP = 282, - - SDL_SCANCODE_APP1 = 283, - SDL_SCANCODE_APP2 = 284, - - /* @} *//* Walther keys */ - - /** - * \name Usage page 0x0C (additional media keys) - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIOREWIND = 285, - SDL_SCANCODE_AUDIOFASTFORWARD = 286, - - /* @} *//* Usage page 0x0C (additional media keys) */ - - /* Add any other keys here. */ - - SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes - for array bounds */ -} SDL_Scancode; - -#endif /* SDL_scancode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h deleted file mode 100644 index 966adbf2..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_sensor.h - * - * Include file for SDL sensor event handling - * - */ - -#ifndef SDL_sensor_h_ -#define SDL_sensor_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/** - * \brief SDL_sensor.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system - * for sensors, and load appropriate drivers. - */ - -struct _SDL_Sensor; -typedef struct _SDL_Sensor SDL_Sensor; - -/** - * This is a unique ID for a sensor for the time it is connected to the system, - * and is never reused for the lifetime of the application. - * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. - */ -typedef Sint32 SDL_SensorID; - -/* The different sensors defined by SDL - * - * Additional sensors may be available, using platform dependent semantics. - * - * Hare are the additional Android sensors: - * https://developer.android.com/reference/android/hardware/SensorEvent.html#values - */ -typedef enum -{ - SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */ - SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */ - SDL_SENSOR_ACCEL, /**< Accelerometer */ - SDL_SENSOR_GYRO /**< Gyroscope */ -} SDL_SensorType; - -/** - * Accelerometer sensor - * - * The accelerometer returns the current acceleration in SI meters per - * second squared. This includes gravity, so a device at rest will have - * an acceleration of SDL_STANDARD_GRAVITY straight down. - * - * values[0]: Acceleration on the x axis - * values[1]: Acceleration on the y axis - * values[2]: Acceleration on the z axis - * - * For phones held in portrait mode, the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ -#define SDL_STANDARD_GRAVITY 9.80665f - -/** - * Gyroscope sensor - * - * The gyroscope returns the current rate of rotation in radians per second. - * The rotation is positive in the counter-clockwise direction. That is, - * an observer looking from a positive location on one of the axes would - * see positive rotation on that axis when it appeared to be rotating - * counter-clockwise. - * - * values[0]: Angular speed around the x axis - * values[1]: Angular speed around the y axis - * values[2]: Angular speed around the z axis - * - * For phones held in portrait mode, the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ - -/* Function prototypes */ - -/** - * \brief Count the number of sensors attached to the system right now - */ -extern DECLSPEC int SDLCALL SDL_NumSensors(void); - -/** - * \brief Get the implementation dependent name of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor name, or NULL if device_index is out of range. - */ -extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); - -/** - * \brief Get the type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range. - */ -extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index); - -/** - * \brief Get the platform dependent type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor platform dependent type, or -1 if device_index is out of range. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); - -/** - * \brief Get the instance ID of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor instance ID, or -1 if device_index is out of range. - */ -extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); - -/** - * \brief Open a sensor for use. - * - * The index passed as an argument refers to the N'th sensor on the system. - * - * \return A sensor identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); - -/** - * Return the SDL_Sensor associated with an instance id. - */ -extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id); - -/** - * \brief Get the implementation dependent name of a sensor. - * - * \return The sensor name, or NULL if the sensor is NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); - -/** - * \brief Get the type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL. - */ -extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); - -/** - * \brief Get the platform dependent type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor platform dependent type, or -1 if the sensor is NULL. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); - -/** - * \brief Get the instance ID of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor instance ID, or -1 if the sensor is NULL. - */ -extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); - -/** - * Get the current state of an opened sensor. - * - * The number of values and interpretation of the data is sensor dependent. - * - * \param sensor The sensor to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * - * \return 0 or -1 if an error occurred. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values); - -/** - * Close a sensor previously opened with SDL_SensorOpen() - */ -extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor); - -/** - * Update the current state of the open sensors. - * - * This is called automatically by the event loop if sensor events are enabled. - * - * This needs to be called from the thread that initialized the sensor subsystem. - */ -extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* SDL_sensor_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h deleted file mode 100644 index 2ab43fcd..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_shape_h_ -#define SDL_shape_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** \file SDL_shape.h - * - * Header file for the shaped window API. - */ - -#define SDL_NONSHAPEABLE_WINDOW -1 -#define SDL_INVALID_SHAPE_ARGUMENT -2 -#define SDL_WINDOW_LACKS_SHAPE -3 - -/** - * \brief Create a window that can be shaped with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window. - * \param h The height of the window. - * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: - * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, - * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, - * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. - * - * \return The window created, or NULL if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); - -/** - * \brief Return whether the given window is a shaped window. - * - * \param window The window to query for being shaped. - * - * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. - * - * \sa SDL_CreateShapedWindow - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); - -/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ -typedef enum { - /** \brief The default mode, a binarized alpha cutoff of 1. */ - ShapeModeDefault, - /** \brief A binarized alpha cutoff with a given integer value. */ - ShapeModeBinarizeAlpha, - /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ - ShapeModeReverseBinarizeAlpha, - /** \brief A color key is applied. */ - ShapeModeColorKey -} WindowShapeMode; - -#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) - -/** \brief A union containing parameters for shaped windows. */ -typedef union { - /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */ - Uint8 binarizationCutoff; - SDL_Color colorKey; -} SDL_WindowShapeParams; - -/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ -typedef struct SDL_WindowShapeMode { - /** \brief The mode of these window-shape parameters. */ - WindowShapeMode mode; - /** \brief Window-shape parameters. */ - SDL_WindowShapeParams parameters; -} SDL_WindowShapeMode; - -/** - * \brief Set the shape and parameters of a shaped window. - * - * \param window The shaped window whose parameters should be set. - * \param shape A surface encoding the desired shape for the window. - * \param shape_mode The parameters to set for the shaped window. - * - * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW - * if the SDL_Window given does not reference a valid shaped window. - * - * \sa SDL_WindowShapeMode - * \sa SDL_GetShapedWindowMode. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); - -/** - * \brief Get the shape parameters of a shaped window. - * - * \param window The shaped window whose parameters should be retrieved. - * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. - * - * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode - * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if - * the SDL_Window given is a shapeable window currently lacking a shape. - * - * \sa SDL_WindowShapeMode - * \sa SDL_SetWindowShape - */ -extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_shape_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h deleted file mode 100644 index 014675b7..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h +++ /dev/null @@ -1,615 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_stdinc.h - * - * This is a general header that includes C language support. - */ - -#ifndef SDL_stdinc_h_ -#define SDL_stdinc_h_ - -#include "SDL_config.h" - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_STDIO_H -#include <stdio.h> -#endif -#if defined(STDC_HEADERS) -# include <stdlib.h> -# include <stddef.h> -# include <stdarg.h> -#else -# if defined(HAVE_STDLIB_H) -# include <stdlib.h> -# elif defined(HAVE_MALLOC_H) -# include <malloc.h> -# endif -# if defined(HAVE_STDDEF_H) -# include <stddef.h> -# endif -# if defined(HAVE_STDARG_H) -# include <stdarg.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_WCHAR_H -# include <wchar.h> -#endif -#if defined(HAVE_INTTYPES_H) -# include <inttypes.h> -#elif defined(HAVE_STDINT_H) -# include <stdint.h> -#endif -#ifdef HAVE_CTYPE_H -# include <ctype.h> -#endif -#ifdef HAVE_MATH_H -# if defined(__WINRT__) -/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on - WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx - for more information. -*/ -# define _USE_MATH_DEFINES -# endif -# include <math.h> -#endif -#ifdef HAVE_FLOAT_H -# include <float.h> -#endif -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include <alloca.h> -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include <malloc.h> -# define alloca _alloca -# elif defined(__WATCOMC__) -# include <malloc.h> -# elif defined(__BORLANDC__) -# include <malloc.h> -# elif defined(__DMC__) -# include <stdlib.h> -# elif defined(__AIX__) -#pragma alloca -# elif defined(__MRC__) -void *alloca(unsigned); -# else -char *alloca(); -# endif -#endif - -/** - * The number of elements in an array. - */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/** - * Macro useful for building other macros with strings in them - * - * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") - */ -#define SDL_STRINGIFY_ARG(arg) #arg - -/** - * \name Cast operators - * - * Use proper C++ casts when compiled as C++ to be compatible with the option - * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). - */ -/* @{ */ -#ifdef __cplusplus -#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression) -#define SDL_static_cast(type, expression) static_cast<type>(expression) -#define SDL_const_cast(type, expression) const_cast<type>(expression) -#else -#define SDL_reinterpret_cast(type, expression) ((type)(expression)) -#define SDL_static_cast(type, expression) ((type)(expression)) -#define SDL_const_cast(type, expression) ((type)(expression)) -#endif -/* @} *//* Cast operators */ - -/* Define a four character code as a Uint32 */ -#define SDL_FOURCC(A, B, C, D) \ - ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) - -/** - * \name Basic data types - */ -/* @{ */ - -#ifdef __CC_ARM -/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */ -#define SDL_FALSE 0 -#define SDL_TRUE 1 -typedef int SDL_bool; -#else -typedef enum -{ - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; -#endif - -/** - * \brief A signed 8-bit integer type. - */ -#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ -#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ -typedef int8_t Sint8; -/** - * \brief An unsigned 8-bit integer type. - */ -#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ -#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ -typedef uint8_t Uint8; -/** - * \brief A signed 16-bit integer type. - */ -#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ -#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ -typedef int16_t Sint16; -/** - * \brief An unsigned 16-bit integer type. - */ -#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ -#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ -typedef uint16_t Uint16; -/** - * \brief A signed 32-bit integer type. - */ -#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ -#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ -typedef int32_t Sint32; -/** - * \brief An unsigned 32-bit integer type. - */ -#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ -#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ -typedef uint32_t Uint32; - -/** - * \brief A signed 64-bit integer type. - */ -#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ -#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ -typedef int64_t Sint64; -/** - * \brief An unsigned 64-bit integer type. - */ -#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ -#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ -typedef uint64_t Uint64; - -/* @} *//* Basic data types */ - -/* Make sure we have macros for printing 64 bit values. - * <stdint.h> should define these but this is not true all platforms. - * (for example win32) */ -#ifndef SDL_PRIs64 -#ifdef PRIs64 -#define SDL_PRIs64 PRIs64 -#elif defined(__WIN32__) -#define SDL_PRIs64 "I64d" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIs64 "ld" -#else -#define SDL_PRIs64 "lld" -#endif -#endif -#ifndef SDL_PRIu64 -#ifdef PRIu64 -#define SDL_PRIu64 PRIu64 -#elif defined(__WIN32__) -#define SDL_PRIu64 "I64u" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIu64 "lu" -#else -#define SDL_PRIu64 "llu" -#endif -#endif -#ifndef SDL_PRIx64 -#ifdef PRIx64 -#define SDL_PRIx64 PRIx64 -#elif defined(__WIN32__) -#define SDL_PRIx64 "I64x" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIx64 "lx" -#else -#define SDL_PRIx64 "llx" -#endif -#endif -#ifndef SDL_PRIX64 -#ifdef PRIX64 -#define SDL_PRIX64 PRIX64 -#elif defined(__WIN32__) -#define SDL_PRIX64 "I64X" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIX64 "lX" -#else -#define SDL_PRIX64 "llX" -#endif -#endif - -/* Annotations to help code analysis tools */ -#ifdef SDL_DISABLE_ANALYZE_MACROS -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#else -#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ -#include <sal.h> - -#define SDL_IN_BYTECAP(x) _In_bytecount_(x) -#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) -#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) -#define SDL_OUT_CAP(x) _Out_cap_(x) -#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) -#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) - -#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ -#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ -#else -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#endif -#if defined(__GNUC__) -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#else -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#endif -#endif /* SDL_DISABLE_ANALYZE_MACROS */ - -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1] -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -/* Check to make sure enums are the size of ints, for structure packing. - For both Watcom C/C++ and Borland C/C++ the compiler option that makes - enums having the size of an int must be enabled. - This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). -*/ - -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -#if !defined(__ANDROID__) - /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ -typedef enum -{ - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); -extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); -extern DECLSPEC void SDLCALL SDL_free(void *mem); - -typedef void *(SDLCALL *SDL_malloc_func)(size_t size); -typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); -typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); -typedef void (SDLCALL *SDL_free_func)(void *mem); - -/** - * \brief Get the current set of SDL memory functions - */ -extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, - SDL_calloc_func *calloc_func, - SDL_realloc_func *realloc_func, - SDL_free_func *free_func); - -/** - * \brief Replace SDL's memory allocation functions with a custom set - * - * \note If you are replacing SDL's memory functions, you should call - * SDL_GetNumAllocations() and be very careful if it returns non-zero. - * That means that your free function will be called with memory - * allocated by the previous memory allocation functions. - */ -extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, - SDL_calloc_func calloc_func, - SDL_realloc_func realloc_func, - SDL_free_func free_func); - -/** - * \brief Get the number of outstanding (unfreed) allocations - */ -extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); - -extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); -extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); - -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); - -extern DECLSPEC int SDLCALL SDL_abs(int x); - -/* !!! FIXME: these have side effects. You probably shouldn't use them. */ -/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) - -extern DECLSPEC int SDLCALL SDL_isdigit(int x); -extern DECLSPEC int SDLCALL SDL_isspace(int x); -extern DECLSPEC int SDLCALL SDL_toupper(int x); -extern DECLSPEC int SDLCALL SDL_tolower(int x); - -extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); - -#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) -#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) -#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x))) - -/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ -SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) -{ -#ifdef __APPLE__ - memset_pattern4(dst, &val, dwords * 4); -#elif defined(__GNUC__) && defined(i386) - int u0, u1, u2; - __asm__ __volatile__ ( - "cld \n\t" - "rep ; stosl \n\t" - : "=&D" (u0), "=&a" (u1), "=&c" (u2) - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) - : "memory" - ); -#else - size_t _n = (dwords + 3) / 4; - Uint32 *_p = SDL_static_cast(Uint32 *, dst); - Uint32 _val = (val); - if (dwords == 0) - return; - switch (dwords % 4) - { - case 0: do { *_p++ = _val; /* fallthrough */ - case 3: *_p++ = _val; /* fallthrough */ - case 2: *_p++ = _val; /* fallthrough */ - case 1: *_p++ = _val; /* fallthrough */ - } while ( --_n ); - } -#endif -} - -extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); - -extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); - -extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); -extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); - -extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); -extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); - -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); -extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); -extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); -extern DECLSPEC char *SDLCALL SDL_strrev(char *str); -extern DECLSPEC char *SDLCALL SDL_strupr(char *str); -extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); -extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); -extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); -extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); - -extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); - -extern DECLSPEC int SDLCALL SDL_atoi(const char *str); -extern DECLSPEC double SDLCALL SDL_atof(const char *str); -extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); -extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); - -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); - -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); -extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); - -#ifndef HAVE_M_PI -#ifndef M_PI -#define M_PI 3.14159265358979323846264338327950288 /**< pi */ -#endif -#endif - -extern DECLSPEC double SDLCALL SDL_acos(double x); -extern DECLSPEC float SDLCALL SDL_acosf(float x); -extern DECLSPEC double SDLCALL SDL_asin(double x); -extern DECLSPEC float SDLCALL SDL_asinf(float x); -extern DECLSPEC double SDLCALL SDL_atan(double x); -extern DECLSPEC float SDLCALL SDL_atanf(float x); -extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); -extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y); -extern DECLSPEC double SDLCALL SDL_ceil(double x); -extern DECLSPEC float SDLCALL SDL_ceilf(float x); -extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); -extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y); -extern DECLSPEC double SDLCALL SDL_cos(double x); -extern DECLSPEC float SDLCALL SDL_cosf(float x); -extern DECLSPEC double SDLCALL SDL_exp(double x); -extern DECLSPEC float SDLCALL SDL_expf(float x); -extern DECLSPEC double SDLCALL SDL_fabs(double x); -extern DECLSPEC float SDLCALL SDL_fabsf(float x); -extern DECLSPEC double SDLCALL SDL_floor(double x); -extern DECLSPEC float SDLCALL SDL_floorf(float x); -extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); -extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); -extern DECLSPEC double SDLCALL SDL_log(double x); -extern DECLSPEC float SDLCALL SDL_logf(float x); -extern DECLSPEC double SDLCALL SDL_log10(double x); -extern DECLSPEC float SDLCALL SDL_log10f(float x); -extern DECLSPEC double SDLCALL SDL_pow(double x, double y); -extern DECLSPEC float SDLCALL SDL_powf(float x, float y); -extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); -extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n); -extern DECLSPEC double SDLCALL SDL_sin(double x); -extern DECLSPEC float SDLCALL SDL_sinf(float x); -extern DECLSPEC double SDLCALL SDL_sqrt(double x); -extern DECLSPEC float SDLCALL SDL_sqrtf(float x); -extern DECLSPEC double SDLCALL SDL_tan(double x); -extern DECLSPEC float SDLCALL SDL_tanf(float x); - -/* The SDL implementation of iconv() returns these error codes */ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 - -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, - const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); -/** - * This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. - */ -extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, - const char *fromcode, - const char *inbuf, - size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) - -/* force builds using Clang's static analysis tools to use literal C runtime - here, since there are possibly tests that are ineffective otherwise. */ -#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) -#define SDL_malloc malloc -#define SDL_calloc calloc -#define SDL_realloc realloc -#define SDL_free free -#define SDL_memset memset -#define SDL_memcpy memcpy -#define SDL_memmove memmove -#define SDL_memcmp memcmp -#define SDL_strlen strlen -#define SDL_strlcpy strlcpy -#define SDL_strlcat strlcat -#define SDL_strdup strdup -#define SDL_strchr strchr -#define SDL_strrchr strrchr -#define SDL_strstr strstr -#define SDL_strtokr strtok_r -#define SDL_strcmp strcmp -#define SDL_strncmp strncmp -#define SDL_strcasecmp strcasecmp -#define SDL_strncasecmp strncasecmp -#define SDL_sscanf sscanf -#define SDL_vsscanf vsscanf -#define SDL_snprintf snprintf -#define SDL_vsnprintf vsnprintf -#endif - -SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) -{ - return SDL_memcpy(dst, src, dwords * 4); -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_stdinc_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h deleted file mode 100644 index 51a12830..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h +++ /dev/null @@ -1,554 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_surface.h - * - * Header file for ::SDL_Surface definition and management functions. - */ - -#ifndef SDL_surface_h_ -#define SDL_surface_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_blendmode.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Surface flags - * - * These are the currently supported flags for the ::SDL_Surface. - * - * \internal - * Used internally (read-only). - */ -/* @{ */ -#define SDL_SWSURFACE 0 /**< Just here for compatibility */ -#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ -#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ -#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ -#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */ -/* @} *//* Surface flags */ - -/** - * Evaluates to true if the surface needs to be locked before access. - */ -#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) - -/** - * \brief A collection of pixels used in software blitting. - * - * \note This structure should be treated as read-only, except for \c pixels, - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface -{ - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - int pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - - /** Application data associated with the surface */ - void *userdata; /**< Read-write */ - - /** information needed for surfaces requiring locks */ - int locked; /**< Read-only */ - void *lock_data; /**< Read-only */ - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - - /** info for fast blit mapping to other surfaces */ - struct SDL_BlitMap *map; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** - * \brief The type of function used for surface blitting functions. - */ -typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, - struct SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief The formula used for converting between YUV and RGB - */ -typedef enum -{ - SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ - SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ - SDL_YUV_CONVERSION_BT709, /**< BT.709 */ - SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ -} SDL_YUV_CONVERSION_MODE; - -/** - * Allocate and free an RGB surface. - * - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * - * If the function runs out of memory, it will return NULL. - * - * \param flags The \c flags are obsolete and should be set to 0. - * \param width The width in pixels of the surface to create. - * \param height The height in pixels of the surface to create. - * \param depth The depth in bits of the surface to create. - * \param Rmask The red mask of the surface to create. - * \param Gmask The green mask of the surface to create. - * \param Bmask The blue mask of the surface to create. - * \param Amask The alpha mask of the surface to create. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); - -/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat - (Uint32 flags, int width, int height, int depth, Uint32 format); - -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, - int height, - int depth, - int pitch, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom - (void *pixels, int width, int height, int depth, int pitch, Uint32 format); -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); - -/** - * \brief Set the palette used by a surface. - * - * \return 0, or -1 if the surface format doesn't use a palette. - * - * \note A single palette can be shared with many surfaces. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, - SDL_Palette * palette); - -/** - * \brief Sets up a surface for directly accessing the pixels. - * - * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write - * to and read from \c surface->pixels, using the pixel format stored in - * \c surface->format. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. - * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. - * - * \sa SDL_UnlockSurface() - */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); -/** \sa SDL_LockSurface() */ -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); - -/** - * Load a surface from a seekable SDL data stream (memory or file). - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The new surface should be freed with SDL_FreeSurface(). - * - * \return the new surface, or NULL if there was an error. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, - int freesrc); - -/** - * Load a surface from a file. - * - * Convenience macro. - */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Save a surface to a seekable SDL data stream (memory or file). - * - * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the - * BMP directly. Other RGB formats with 8-bit or higher get converted to a - * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit - * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are - * not supported. - * - * If \c freedst is non-zero, the stream will be closed after being written. - * - * \return 0 if successful or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface * surface, SDL_RWops * dst, int freedst); - -/** - * Save a surface to a file. - * - * Convenience macro. - */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * \brief Sets the RLE acceleration hint for a surface. - * - * \return 0 on success, or -1 if the surface is not valid - * - * \note If RLE is enabled, colorkey and alpha blending blits are much faster, - * but the surface must be locked before directly accessing the pixels. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, - int flag); - -/** - * \brief Sets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param flag Non-zero to enable colorkey and 0 to disable colorkey - * \param key The transparent pixel in the native surface format - * - * \return 0 on success, or -1 if the surface is not valid - * - * You can pass SDL_RLEACCEL to enable RLE accelerated blits. - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, - int flag, Uint32 key); - -/** - * \brief Returns whether the surface has a color key - * - * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); - -/** - * \brief Gets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param key A pointer filled in with the transparent pixel in the native - * surface format - * - * \return 0 on success, or -1 if the surface is not valid or colorkey is not - * enabled. - */ -extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, - Uint32 * key); - -/** - * \brief Set an additional color value used in blit operations. - * - * \param surface The surface to update. - * \param r The red color value multiplied into blit operations. - * \param g The green color value multiplied into blit operations. - * \param b The blue color value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_GetSurfaceColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \brief Get the additional color value used in blit operations. - * - * \param surface The surface to query. - * \param r A pointer filled in with the current red color value. - * \param g A pointer filled in with the current green color value. - * \param b A pointer filled in with the current blue color value. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \brief Set an additional alpha value used in blit operations. - * - * \param surface The surface to update. - * \param alpha The alpha value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_GetSurfaceAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 alpha); - -/** - * \brief Get the additional alpha value used in blit operations. - * - * \param surface The surface to query. - * \param alpha A pointer filled in with the current alpha value. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 * alpha); - -/** - * \brief Set the blend mode used for blit operations. - * - * \param surface The surface to update. - * \param blendMode ::SDL_BlendMode to use for blit blending. - * - * \return 0 on success, or -1 if the parameters are not valid. - * - * \sa SDL_GetSurfaceBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for blit operations. - * - * \param surface The surface to query. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode *blendMode); - -/** - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, - const SDL_Rect * rect); - -/** - * Gets the clipping rectangle for the destination surface in a blit. - * - * \c rect must be a pointer to a valid rectangle which will be filled - * with the correct values. - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, - SDL_Rect * rect); - -/* - * Creates a new surface identical to the existing surface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface); - -/** - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface - (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat - (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); - -/** - * \brief Copy a block of pixels of one format to another format - * - * \return 0 on success, or -1 if there was an error - */ -extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, - Uint32 src_format, - const void * src, int src_pitch, - Uint32 dst_format, - void * dst, int dst_pitch); - -/** - * Performs a fast fill of the given rectangle with \c color. - * - * If \c rect is NULL, the whole surface will be filled with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); -extern DECLSPEC int SDLCALL SDL_FillRects - (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); - -/** - * Performs a fast blit from the source surface to the destination surface. - * - * This assumes that the source and destination rectangles are - * the same size. If either \c srcrect or \c dstrect are NULL, the entire - * surface (\c src or \c dst) is copied. The final blit rectangles are saved - * in \c srcrect and \c dstrect after all clipping is performed. - * - * \return If the blit is successful, it returns 0, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without blending and colorkey - * are defined as follows: - * \verbatim - RGBA->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB, set destination alpha to source per-surface alpha value. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - - RGBA->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy all of RGBA to the destination. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - \endverbatim - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. - */ -#define SDL_BlitSurface SDL_UpperBlit - -/** - * This is the public blit function, SDL_BlitSurface(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlit() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * This is a semi-private blit function and it performs low-level surface - * blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief Perform a fast, low quality, stretch blit between two surfaces of the - * same pixel format. - * - * \note This function uses a static buffer, and is not thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, - const SDL_Rect * dstrect); - -#define SDL_BlitScaled SDL_UpperBlitScaled - -/** - * This is the public scaled blit function, SDL_BlitScaled(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlitScaled - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * This is a semi-private blit function and it performs low-level surface - * scaled blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlitScaled - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief Set the YUV conversion mode - */ -extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); - -/** - * \brief Get the YUV conversion mode - */ -extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); - -/** - * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC - */ -extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_surface_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h deleted file mode 100644 index 3b084076..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_system.h - * - * Include file for platform specific SDL API functions - */ - -#ifndef SDL_system_h_ -#define SDL_system_h_ - -#include "SDL_stdinc.h" -#include "SDL_keyboard.h" -#include "SDL_render.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* Platform specific functions for Windows */ -#ifdef __WIN32__ - -/** - \brief Set a function that is called for every windows message, before TranslateMessage() -*/ -typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); -extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); - -/** - \brief Returns the D3D9 adapter index that matches the specified display index. - - This adapter index can be passed to IDirect3D9::CreateDevice and controls - on which monitor a full screen application will appear. -*/ -extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); - -typedef struct IDirect3DDevice9 IDirect3DDevice9; -/** - \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. - - Once you are done using the device, you should release it to avoid a resource leak. - */ -extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); - -/** - \brief Returns the DXGI Adapter and Output indices for the specified display index. - - These can be passed to EnumAdapters and EnumOutputs respectively to get the objects - required to create a DX10 or DX11 device and swap chain. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); - -#endif /* __WIN32__ */ - - -/* Platform specific functions for Linux */ -#ifdef __LINUX__ - -/** - \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available. - - \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); - -#endif /* __LINUX__ */ - -/* Platform specific functions for iOS */ -#if defined(__IPHONEOS__) && __IPHONEOS__ - -#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); - -#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) -extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); - -#endif /* __IPHONEOS__ */ - - -/* Platform specific functions for Android */ -#if defined(__ANDROID__) && __ANDROID__ - -/** - \brief Get the JNI environment for the current thread - - This returns JNIEnv*, but the prototype is void* so we don't need jni.h - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); - -/** - \brief Get the SDL Activity object for the application - - This returns jobject, but the prototype is void* so we don't need jni.h - The jobject returned by SDL_AndroidGetActivity is a local reference. - It is the caller's responsibility to properly release it - (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); - -/** - \brief Return true if the application is running on Android TV - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); - -/** - \brief Return true if the application is running on a Chromebook - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); - -/** - \brief Return true is the application is running on a Samsung DeX docking station - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); - -/** - \brief Trigger the Android system back button behavior. - */ -extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); - -/** - See the official Android developer guide for more information: - http://developer.android.com/guide/topics/data/data-storage.html -*/ -#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 -#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 - -/** - \brief Get the path used for internal storage for this application. - - This path is unique to your application and cannot be written to - by other applications. - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); - -/** - \brief Get the current state of external storage, a bitmask of these values: - SDL_ANDROID_EXTERNAL_STORAGE_READ - SDL_ANDROID_EXTERNAL_STORAGE_WRITE - - If external storage is currently unavailable, this will return 0. -*/ -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); - -/** - \brief Get the path used for external storage for this application. - - This path is unique to your application, but is public and can be - written to by other applications. - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); - -#endif /* __ANDROID__ */ - -/* Platform specific functions for WinRT */ -#if defined(__WINRT__) && __WINRT__ - -/** - * \brief WinRT / Windows Phone path types - */ -typedef enum -{ - /** \brief The installed app's root directory. - Files here are likely to be read-only. */ - SDL_WINRT_PATH_INSTALLED_LOCATION, - - /** \brief The app's local data store. Files may be written here */ - SDL_WINRT_PATH_LOCAL_FOLDER, - - /** \brief The app's roaming data store. Unsupported on Windows Phone. - Files written here may be copied to other machines via a network - connection. - */ - SDL_WINRT_PATH_ROAMING_FOLDER, - - /** \brief The app's temporary data store. Unsupported on Windows Phone. - Files written here may be deleted at any time. */ - SDL_WINRT_PATH_TEMP_FOLDER -} SDL_WinRT_Path; - - -/** - * \brief WinRT Device Family - */ -typedef enum -{ - /** \brief Unknown family */ - SDL_WINRT_DEVICEFAMILY_UNKNOWN, - - /** \brief Desktop family*/ - SDL_WINRT_DEVICEFAMILY_DESKTOP, - - /** \brief Mobile family (for example smartphone) */ - SDL_WINRT_DEVICEFAMILY_MOBILE, - - /** \brief XBox family */ - SDL_WINRT_DEVICEFAMILY_XBOX, -} SDL_WinRT_DeviceFamily; - - -/** - * \brief Retrieves a WinRT defined path on the local file system - * - * \note Documentation on most app-specific path types on WinRT - * can be found on MSDN, at the URL: - * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType The type of path to retrieve. - * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL - * if the path is not available for any reason. Not all paths are - * available on all versions of Windows. This is especially true on - * Windows Phone. Check the documentation for the given - * SDL_WinRT_Path for more information on which path types are - * supported where. - */ -extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); - -/** - * \brief Retrieves a WinRT defined path on the local file system - * - * \note Documentation on most app-specific path types on WinRT - * can be found on MSDN, at the URL: - * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType The type of path to retrieve. - * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL - * if the path is not available for any reason. Not all paths are - * available on all versions of Windows. This is especially true on - * Windows Phone. Check the documentation for the given - * SDL_WinRT_Path for more information on which path types are - * supported where. - */ -extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); - -/** - * \brief Detects the device family of WinRT plattform on runtime - * - * \return Device family - */ -extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); - -#endif /* __WINRT__ */ - -/** - \brief Return true if the current device is a tablet. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_system_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h deleted file mode 100644 index c8236513..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h +++ /dev/null @@ -1,331 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_syswm.h - * - * Include file for SDL custom system window manager hooks. - */ - -#ifndef SDL_syswm_h_ -#define SDL_syswm_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_version.h" - -/** - * \brief SDL_syswm.h - * - * Your application has access to a special type of event ::SDL_SYSWMEVENT, - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState(). - */ -struct SDL_SysWMinfo; - -#if !defined(SDL_PROTOTYPES_ONLY) - -#if defined(SDL_VIDEO_DRIVER_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> -#endif - -#if defined(SDL_VIDEO_DRIVER_WINRT) -#include <Inspectable.h> -#endif - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) -#if defined(__APPLE__) && defined(__MACH__) -/* conflicts with Quickdraw.h */ -#define Cursor X11Cursor -#endif - -#include <X11/Xlib.h> -#include <X11/Xatom.h> - -#if defined(__APPLE__) && defined(__MACH__) -/* matches the re-define above */ -#undef Cursor -#endif - -#endif /* defined(SDL_VIDEO_DRIVER_X11) */ - -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) -#include <directfb.h> -#endif - -#if defined(SDL_VIDEO_DRIVER_COCOA) -#ifdef __OBJC__ -@class NSWindow; -#else -typedef struct _NSWindow NSWindow; -#endif -#endif - -#if defined(SDL_VIDEO_DRIVER_UIKIT) -#ifdef __OBJC__ -#include <UIKit/UIKit.h> -#else -typedef struct _UIWindow UIWindow; -typedef struct _UIViewController UIViewController; -#endif -typedef Uint32 GLuint; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) -typedef struct ANativeWindow ANativeWindow; -typedef void *EGLSurface; -#endif - -#if defined(SDL_VIDEO_DRIVER_VIVANTE) -#include "SDL_egl.h" -#endif -#endif /* SDL_PROTOTYPES_ONLY */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(SDL_PROTOTYPES_ONLY) -/** - * These are the various supported windowing subsystems - */ -typedef enum -{ - SDL_SYSWM_UNKNOWN, - SDL_SYSWM_WINDOWS, - SDL_SYSWM_X11, - SDL_SYSWM_DIRECTFB, - SDL_SYSWM_COCOA, - SDL_SYSWM_UIKIT, - SDL_SYSWM_WAYLAND, - SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ - SDL_SYSWM_WINRT, - SDL_SYSWM_ANDROID, - SDL_SYSWM_VIVANTE, - SDL_SYSWM_OS2, - SDL_SYSWM_HAIKU -} SDL_SYSWM_TYPE; - -/** - * The custom event structure. - */ -struct SDL_SysWMmsg -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct { - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct { - XEvent event; - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct { - DFBEvent event; - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { - /* Latest version of Xcode clang complains about empty structs in C v. C++: - error: empty struct has size 0 in C, size 1 in C++ - */ - int dummy; - /* No Cocoa window events yet */ - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { - int dummy; - /* No UIKit window events yet */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_VIVANTE) - struct - { - int dummy; - /* No Vivante window events yet */ - } vivante; -#endif - /* Can't have an empty union */ - int dummy; - } msg; -}; - -/** - * The custom window manager information structure. - * - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct - { - HWND window; /**< The window handle */ - HDC hdc; /**< The window device context */ - HINSTANCE hinstance; /**< The instance handle */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_WINRT) - struct - { - IInspectable * window; /**< The WinRT CoreWindow */ - } winrt; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct - { - Display *display; /**< The X11 display */ - Window window; /**< The X11 window */ - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct - { - IDirectFB *dfb; /**< The directfb main interface */ - IDirectFBWindow *window; /**< The directfb window handle */ - IDirectFBSurface *surface; /**< The directfb client surface */ - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { -#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) - NSWindow __unsafe_unretained *window; /**< The Cocoa window */ -#else - NSWindow *window; /**< The Cocoa window */ -#endif - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { -#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) - UIWindow __unsafe_unretained *window; /**< The UIKit window */ -#else - UIWindow *window; /**< The UIKit window */ -#endif - GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ - GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ - GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_WAYLAND) - struct - { - struct wl_display *display; /**< Wayland display */ - struct wl_surface *surface; /**< Wayland surface */ - struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */ - } wl; -#endif -#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ - struct - { - void *connection; /**< Mir display server connection */ - void *surface; /**< Mir surface */ - } mir; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) - struct - { - ANativeWindow *window; - EGLSurface surface; - } android; -#endif - -#if defined(SDL_VIDEO_DRIVER_VIVANTE) - struct - { - EGLNativeDisplayType display; - EGLNativeWindowType window; - } vivante; -#endif - - /* Make sure this union is always 64 bytes (8 64-bit pointers). */ - /* Be careful not to overflow this if you add a new target! */ - Uint8 dummy[64]; - } info; -}; - -#endif /* SDL_PROTOTYPES_ONLY */ - -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - -/* Function prototypes */ -/** - * \brief This function allows access to driver-dependent window information. - * - * \param window The window about which information is being requested - * \param info This structure must be initialized with the SDL version, and is - * then filled in with information about the given window. - * - * \return SDL_TRUE if the function is implemented and the version member of - * the \c info struct is valid, SDL_FALSE otherwise. - * - * You typically use this function like this: - * \code - * SDL_SysWMinfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } - * \endcode - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, - SDL_SysWMinfo * info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_syswm_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h deleted file mode 100644 index f78b1145..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_thread_h_ -#define SDL_thread_h_ - -/** - * \file SDL_thread.h - * - * Header for the SDL thread management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_atomic.h" -#include "SDL_mutex.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/* The SDL thread ID */ -typedef unsigned long SDL_threadID; - -/* Thread local storage ID, 0 is the invalid ID */ -typedef unsigned int SDL_TLSID; - -/** - * The SDL thread priority. - * - * \note On many systems you require special privileges to set high or time critical priority. - */ -typedef enum { - SDL_THREAD_PRIORITY_LOW, - SDL_THREAD_PRIORITY_NORMAL, - SDL_THREAD_PRIORITY_HIGH, - SDL_THREAD_PRIORITY_TIME_CRITICAL -} SDL_ThreadPriority; - -/** - * The function passed to SDL_CreateThread(). - * It is passed a void* user context parameter and returns an int. - */ -typedef int (SDLCALL * SDL_ThreadFunction) (void *data); - -#if defined(__WIN32__) && !defined(HAVE_LIBC) -/** - * \file SDL_thread.h - * - * We compile SDL into a DLL. This means, that it's the DLL which - * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL2.DLL will - * be initialized for those threads, and not the RTL of the calling - * application! - * - * To solve this, we make a little hack here. - * - * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL2.DLL which uses this API, - * then the RTL of SDL2.DLL will be used to create the new thread, and if it's - * the application, then the RTL of the application will be used. - * - * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime - * library! - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#include <process.h> /* _beginthreadex() and _endthreadex() */ - -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) - (void *, unsigned, unsigned (__stdcall *func)(void *), - void * /*arg*/, unsigned, unsigned * /* threadID */); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); - -/** - * Create a thread. - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), - const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - - -/** - * Create a thread. - */ -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#endif - -#elif defined(__OS2__) -/* - * just like the windows case above: We compile SDL2 - * into a dll with Watcom's runtime statically linked. - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef __EMX__ -#include <process.h> -#else -#include <stdlib.h> -#endif -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); -typedef void (*pfnSDL_CurrentEndThread)(void); -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#endif - -#else - -/** - * Create a thread with a default stack size. - * - * This is equivalent to calling: - * SDL_CreateThreadWithStackSize(fn, name, 0, data); - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); - -/** - * Create a thread. - * - * Thread naming is a little complicated: Most systems have very small - * limits for the string length (Haiku has 32 bytes, Linux currently has 16, - * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll - * have to see what happens with your system's debugger. The name should be - * UTF-8 (but using the naming limits of C identifiers is a better bet). - * There are no requirements for thread naming conventions, so long as the - * string is null-terminated UTF-8, but these guidelines are helpful in - * choosing a name: - * - * http://stackoverflow.com/questions/149932/naming-conventions-for-threads - * - * If a system imposes requirements, SDL will try to munge the string for - * it (truncate, etc), but the original string contents will be available - * from SDL_GetThreadName(). - * - * The size (in bytes) of the new stack can be specified. Zero means "use - * the system default" which might be wildly different between platforms - * (x86 Linux generally defaults to eight megabytes, an embedded device - * might be a few kilobytes instead). - * - * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread - * function. - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data); - -#endif - -/** - * Get the thread name, as it was specified in SDL_CreateThread(). - * This function returns a pointer to a UTF-8 string that names the - * specified thread, or NULL if it doesn't have a name. This is internal - * memory, not to be free()'d by the caller, and remains valid until the - * specified thread is cleaned up by SDL_WaitThread(). - */ -extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); - -/** - * Get the thread identifier for the current thread. - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); - -/** - * Get the thread identifier for the specified thread. - * - * Equivalent to SDL_ThreadID() if the specified thread is NULL. - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); - -/** - * Set the priority for the current thread - */ -extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); - -/** - * Wait for a thread to finish. Threads that haven't been detached will - * remain (as a "zombie") until this function cleans them up. Not doing so - * is a resource leak. - * - * Once a thread has been cleaned up through this function, the SDL_Thread - * that references it becomes invalid and should not be referenced again. - * As such, only one thread may call SDL_WaitThread() on another. - * - * The return code for the thread function is placed in the area - * pointed to by \c status, if \c status is not NULL. - * - * You may not wait on a thread that has been used in a call to - * SDL_DetachThread(). Use either that function or this one, but not - * both, or behavior is undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); - -/** - * A thread may be "detached" to signify that it should not remain until - * another thread has called SDL_WaitThread() on it. Detaching a thread - * is useful for long-running threads that nothing needs to synchronize - * with or further manage. When a detached thread is done, it simply - * goes away. - * - * There is no way to recover the return code of a detached thread. If you - * need this, don't detach the thread and instead use SDL_WaitThread(). - * - * Once a thread is detached, you should usually assume the SDL_Thread isn't - * safe to reference again, as it will become invalid immediately upon - * the detached thread's exit, instead of remaining until someone has called - * SDL_WaitThread() to finally clean it up. As such, don't detach the same - * thread more than once. - * - * If a thread has already exited when passed to SDL_DetachThread(), it will - * stop waiting for a call to SDL_WaitThread() and clean up immediately. - * It is not safe to detach a thread that might be used with SDL_WaitThread(). - * - * You may not call SDL_WaitThread() on a thread that has been detached. - * Use either that function or this one, but not both, or behavior is - * undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - */ -extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); - -/** - * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. - * - * \return The newly created thread local storage identifier, or 0 on error - * - * \code - * static SDL_SpinLock tls_lock; - * static SDL_TLSID thread_local_storage; - * - * void SetMyThreadData(void *value) - * { - * if (!thread_local_storage) { - * SDL_AtomicLock(&tls_lock); - * if (!thread_local_storage) { - * thread_local_storage = SDL_TLSCreate(); - * } - * SDL_AtomicUnlock(&tls_lock); - * } - * SDL_TLSSet(thread_local_storage, value, 0); - * } - * - * void *GetMyThreadData(void) - * { - * return SDL_TLSGet(thread_local_storage); - * } - * \endcode - * - * \sa SDL_TLSGet() - * \sa SDL_TLSSet() - */ -extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); - -/** - * \brief Get the value associated with a thread local storage ID for the current thread. - * - * \param id The thread local storage ID - * - * \return The value associated with the ID for the current thread, or NULL if no value has been set. - * - * \sa SDL_TLSCreate() - * \sa SDL_TLSSet() - */ -extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); - -/** - * \brief Set the value associated with a thread local storage ID for the current thread. - * - * \param id The thread local storage ID - * \param value The value to associate with the ID for the current thread - * \param destructor A function called when the thread exits, to free the value. - * - * \return 0 on success, -1 on error - * - * \sa SDL_TLSCreate() - * \sa SDL_TLSGet() - */ -extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*)); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_thread_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h deleted file mode 100644 index 2a47b043..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_timer_h_ -#define SDL_timer_h_ - -/** - * \file SDL_timer.h - * - * Header for the SDL time management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Get the number of milliseconds since the SDL library initialization. - * - * \note This value wraps if the program runs for more than ~49 days. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/** - * \brief Compare SDL ticks values, and return true if A has passed B - * - * e.g. if you want to wait 100 ms, you could do this: - * Uint32 timeout = SDL_GetTicks() + 100; - * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { - * ... do work until timeout has elapsed - * } - */ -#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) - -/** - * \brief Get the current value of the high resolution counter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); - -/** - * \brief Get the count per second of the high resolution counter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); - -/** - * \brief Wait a specified number of milliseconds before returning. - */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** - * Function prototype for the timer callback function. - * - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); - -/** - * Definition of the timer ID type. - */ -typedef int SDL_TimerID; - -/** - * \brief Add a new timer to the pool of timers already running. - * - * \return A timer ID, or 0 when an error occurs. - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, - SDL_TimerCallback callback, - void *param); - -/** - * \brief Remove a timer knowing its ID. - * - * \return A boolean value indicating success or failure. - * - * \warning It is not safe to remove a timer multiple times. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_timer_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h deleted file mode 100644 index 99dbcb8c..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_touch.h - * - * Include file for SDL touch event handling. - */ - -#ifndef SDL_touch_h_ -#define SDL_touch_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_TouchID; -typedef Sint64 SDL_FingerID; - -typedef enum -{ - SDL_TOUCH_DEVICE_INVALID = -1, - SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ - SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ - SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ -} SDL_TouchDeviceType; - -typedef struct SDL_Finger -{ - SDL_FingerID id; - float x; - float y; - float pressure; -} SDL_Finger; - -/* Used as the device ID for mouse events simulated with touch input */ -#define SDL_TOUCH_MOUSEID ((Uint32)-1) - -/* Used as the SDL_TouchID for touch events simulated with mouse input */ -#define SDL_MOUSE_TOUCHID ((Sint64)-1) - - -/* Function prototypes */ - -/** - * \brief Get the number of registered touch devices. - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); - -/** - * \brief Get the touch ID with the given index, or 0 if the index is invalid. - */ -extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); - -/** - * \brief Get the type of the given touch device. - */ -extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); - -/** - * \brief Get the number of active fingers for a given touch device. - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); - -/** - * \brief Get the finger object of the given touch, with the given index. - */ -extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_touch_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h deleted file mode 100644 index 9c3e9896..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_types.h - * - * \deprecated - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h deleted file mode 100644 index 69b02706..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_version.h - * - * This header defines the current SDL version. - */ - -#ifndef SDL_version_h_ -#define SDL_version_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Information the version of SDL in use. - * - * Represents the library's version as three levels: major revision - * (increments with massive changes, additions, and enhancements), - * minor revision (increments with backwards-compatible changes to the - * major revision), and patchlevel (increments with fixes to the minor - * revision). - * - * \sa SDL_VERSION - * \sa SDL_GetVersion - */ -typedef struct SDL_version -{ - Uint8 major; /**< major version */ - Uint8 minor; /**< minor version */ - Uint8 patch; /**< update version */ -} SDL_version; - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -#define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 11 - -/** - * \brief Macro to determine SDL version program was compiled against. - * - * This macro fills in a SDL_version structure with the version of the - * library you compiled against. This is determined by what header the - * compiler uses. Note that if you dynamically linked the library, you might - * have a slightly newer or older version at runtime. That version can be - * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), - * is not a macro. - * - * \param x A pointer to a SDL_version struct to initialize. - * - * \sa SDL_version - * \sa SDL_GetVersion - */ -#define SDL_VERSION(x) \ -{ \ - (x)->major = SDL_MAJOR_VERSION; \ - (x)->minor = SDL_MINOR_VERSION; \ - (x)->patch = SDL_PATCHLEVEL; \ -} - -/** - * This macro turns the version numbers into a numeric value: - * \verbatim - (1,2,3) -> (1203) - \endverbatim - * - * This assumes that there will never be more than 100 patchlevels. - */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/** - * This is the version number macro for the current SDL version. - */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) - -/** - * This macro will evaluate to true if compiled with SDL at least X.Y.Z. - */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) - -/** - * \brief Get the version of SDL that is linked against your program. - * - * If you are linking to SDL dynamically, then it is possible that the - * current version will be different than the version you compiled against. - * This function returns the current version, while SDL_VERSION() is a - * macro that tells you what version you compiled with. - * - * \code - * SDL_version compiled; - * SDL_version linked; - * - * SDL_VERSION(&compiled); - * SDL_GetVersion(&linked); - * printf("We compiled against SDL version %d.%d.%d ...\n", - * compiled.major, compiled.minor, compiled.patch); - * printf("But we linked against SDL version %d.%d.%d.\n", - * linked.major, linked.minor, linked.patch); - * \endcode - * - * This function may be called safely at any time, even before SDL_Init(). - * - * \sa SDL_VERSION - */ -extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); - -/** - * \brief Get the code revision of SDL that is linked against your program. - * - * Returns an arbitrary string (a hash value) uniquely identifying the - * exact revision of the SDL library in use, and is only useful in comparing - * against other revisions. It is NOT an incrementing number. - */ -extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); - -/** - * \brief Get the revision number of SDL that is linked against your program. - * - * Returns a number uniquely identifying the exact revision of the SDL - * library in use. It is an incrementing number based on commits to - * hg.libsdl.org. - */ -extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_version_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h deleted file mode 100644 index c1bb7527..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h +++ /dev/null @@ -1,1275 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_video.h - * - * Header file for SDL video functions. - */ - -#ifndef SDL_video_h_ -#define SDL_video_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a display mode - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - * \sa SDL_GetDesktopDisplayMode() - * \sa SDL_GetCurrentDisplayMode() - * \sa SDL_GetClosestDisplayMode() - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -typedef struct -{ - Uint32 format; /**< pixel format */ - int w; /**< width, in screen coordinates */ - int h; /**< height, in screen coordinates */ - int refresh_rate; /**< refresh rate (or zero for unspecified) */ - void *driverdata; /**< driver-specific data, initialize to 0 */ -} SDL_DisplayMode; - -/** - * \brief The type used to identify a window - * - * \sa SDL_CreateWindow() - * \sa SDL_CreateWindowFrom() - * \sa SDL_DestroyWindow() - * \sa SDL_GetWindowData() - * \sa SDL_GetWindowFlags() - * \sa SDL_GetWindowGrab() - * \sa SDL_GetWindowPosition() - * \sa SDL_GetWindowSize() - * \sa SDL_GetWindowTitle() - * \sa SDL_HideWindow() - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - * \sa SDL_RaiseWindow() - * \sa SDL_RestoreWindow() - * \sa SDL_SetWindowData() - * \sa SDL_SetWindowFullscreen() - * \sa SDL_SetWindowGrab() - * \sa SDL_SetWindowIcon() - * \sa SDL_SetWindowPosition() - * \sa SDL_SetWindowSize() - * \sa SDL_SetWindowBordered() - * \sa SDL_SetWindowResizable() - * \sa SDL_SetWindowTitle() - * \sa SDL_ShowWindow() - */ -typedef struct SDL_Window SDL_Window; - -/** - * \brief The flags on a window - * - * \sa SDL_GetWindowFlags() - */ -typedef enum -{ - SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ - SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ - SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ - SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ - SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ - SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ - SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ - SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ - SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ - SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ - SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ - SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), - SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ - SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported. - On macOS NSHighResolutionCapable must be set true in the - application's Info.plist for this to have any effect. */ - SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to INPUT_GRABBED) */ - SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */ - SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */ - SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ - SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ - SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ - SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ -} SDL_WindowFlags; - -/** - * \brief Used to indicate that you don't care what the window position is. - */ -#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u -#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) -#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) -#define SDL_WINDOWPOS_ISUNDEFINED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) - -/** - * \brief Used to indicate that the window position should be centered. - */ -#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u -#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) -#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) -#define SDL_WINDOWPOS_ISCENTERED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) - -/** - * \brief Event subtype for window events - */ -typedef enum -{ - SDL_WINDOWEVENT_NONE, /**< Never used */ - SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ - SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ - SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be - redrawn */ - SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 - */ - SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ - SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as - a result of an API call or through the - system or user changing the window size. */ - SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ - SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ - SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size - and position */ - SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ - SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ - SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ - SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ - SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */ - SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */ - SDL_WINDOWEVENT_HIT_TEST /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */ -} SDL_WindowEventID; - -/** - * \brief Event subtype for display events - */ -typedef enum -{ - SDL_DISPLAYEVENT_NONE, /**< Never used */ - SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */ -} SDL_DisplayEventID; - -typedef enum -{ - SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */ - SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */ - SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */ - SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */ - SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */ -} SDL_DisplayOrientation; - -/** - * \brief An opaque handle to an OpenGL context. - */ -typedef void *SDL_GLContext; - -/** - * \brief OpenGL configuration attributes - */ -typedef enum -{ - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, - SDL_GL_CONTEXT_NO_ERROR -} SDL_GLattr; - -typedef enum -{ - SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, - SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, - SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ -} SDL_GLprofile; - -typedef enum -{ - SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, - SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, - SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, - SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 -} SDL_GLcontextFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 -} SDL_GLcontextReleaseFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, - SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001 -} SDL_GLContextResetNotification; - -/* Function prototypes */ - -/** - * \brief Get the number of video drivers compiled into SDL - * - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); - -/** - * \brief Get the name of a built in video driver. - * - * \note The video drivers are presented in the order in which they are - * normally checked during initialization. - * - * \sa SDL_GetNumVideoDrivers() - */ -extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); - -/** - * \brief Initialize the video subsystem, optionally specifying a video driver. - * - * \param driver_name Initialize a specific driver by name, or NULL for the - * default video driver. - * - * \return 0 on success, -1 on error - * - * This function initializes the video subsystem; setting up a connection - * to the window manager, etc, and determines the available display modes - * and pixel formats, but does not initialize a window or graphics mode. - * - * \sa SDL_VideoQuit() - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); - -/** - * \brief Shuts down the video subsystem. - * - * This function closes all windows, and restores the original video mode. - * - * \sa SDL_VideoInit() - */ -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); - -/** - * \brief Returns the name of the currently initialized video driver. - * - * \return The name of the current video driver or NULL if no driver - * has been initialized - * - * \sa SDL_GetNumVideoDrivers() - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); - -/** - * \brief Returns the number of available video displays. - * - * \sa SDL_GetDisplayBounds() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); - -/** - * \brief Get the name of a display in UTF-8 encoding - * - * \return The name of a display, or NULL for an invalid display index. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); - -/** - * \brief Get the desktop area represented by a display, with the primary - * display located at 0,0 - * - * \return 0 on success, or -1 if the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); - -/** - * \brief Get the usable desktop area represented by a display, with the - * primary display located at 0,0 - * - * This is the same area as SDL_GetDisplayBounds() reports, but with portions - * reserved by the system removed. For example, on Mac OS X, this subtracts - * the area occupied by the menu bar and dock. - * - * Setting a window to be fullscreen generally bypasses these unusable areas, - * so these are good guidelines for the maximum space available to a - * non-fullscreen window. - * - * \return 0 on success, or -1 if the index is out of range. - * - * \sa SDL_GetDisplayBounds() - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect); - -/** - * \brief Get the dots/pixels-per-inch for a display - * - * \note Diagonal, horizontal and vertical DPI can all be optionally - * returned if the parameter is non-NULL. - * - * \return 0 on success, or -1 if no DPI information is available or the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); - -/** - * \brief Get the orientation of a display - * - * \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex); - -/** - * \brief Returns the number of available display modes. - * - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); - -/** - * \brief Fill in information about a specific display mode. - * - * \note The display modes are sorted in this priority: - * \li bits per pixel -> more colors to fewer colors - * \li width -> largest to smallest - * \li height -> largest to smallest - * \li refresh rate -> highest to lowest - * - * \sa SDL_GetNumDisplayModes() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, - SDL_DisplayMode * mode); - -/** - * \brief Fill in information about the desktop display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); - -/** - * \brief Fill in information about the current display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); - - -/** - * \brief Get the closest match to the requested display mode. - * - * \param displayIndex The index of display from which mode should be queried. - * \param mode The desired display mode - * \param closest A pointer to a display mode to be filled in with the closest - * match of the available display modes. - * - * \return The passed in value \c closest, or NULL if no matching video mode - * was available. - * - * The available display modes are scanned, and \c closest is filled in with the - * closest mode matching the requested mode and returned. The mode format and - * refresh_rate default to the desktop mode if they are 0. The modes are - * scanned with size being first priority, format being second priority, and - * finally checking the refresh_rate. If all the available modes are too - * small, then NULL is returned. - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); - -/** - * \brief Get the display index associated with a window. - * - * \return the display index of the display containing the center of the - * window, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); - -/** - * \brief Set the display mode used when a fullscreen window is visible. - * - * By default the window's dimensions and the desktop format and refresh rate - * are used. - * - * \param window The window for which the display mode should be set. - * \param mode The mode to use, or NULL for the default mode. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_GetWindowDisplayMode() - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, - const SDL_DisplayMode - * mode); - -/** - * \brief Fill in information about the display mode used when a fullscreen - * window is visible. - * - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, - SDL_DisplayMode * mode); - -/** - * \brief Get the pixel format associated with the window. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); - -/** - * \brief Create a window with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window, in screen coordinates. - * \param h The height of the window, in screen coordinates. - * \param flags The flags for the window, a mask of any of the following: - * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, - * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, - * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. - * - * \return The created window, or NULL if window creation failed. - * - * If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size - * in pixels may differ from its size in screen coordinates on platforms with - * high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query - * the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(), - * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the - * drawable size in pixels. - * - * If the window is created with any of the SDL_WINDOW_OPENGL or - * SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function - * (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the - * corresponding UnloadLibrary function is called by SDL_DestroyWindow(). - * - * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, - * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. - * - * \note On non-Apple devices, SDL requires you to either not link to the - * Vulkan loader or link to a dynamic library version. This limitation - * may be removed in a future version of SDL. - * - * \sa SDL_DestroyWindow() - * \sa SDL_GL_LoadLibrary() - * \sa SDL_Vulkan_LoadLibrary() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, - int x, int y, int w, - int h, Uint32 flags); - -/** - * \brief Create an SDL window from an existing native window. - * - * \param data A pointer to driver-dependent window creation data - * - * \return The created window, or NULL if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); - -/** - * \brief Get the numeric ID of a window, for logging purposes. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); - -/** - * \brief Get a window from a stored ID, or NULL if it doesn't exist. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); - -/** - * \brief Get the window flags. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); - -/** - * \brief Set the title of a window, in UTF-8 format. - * - * \sa SDL_GetWindowTitle() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, - const char *title); - -/** - * \brief Get the title of a window, in UTF-8 format. - * - * \sa SDL_SetWindowTitle() - */ -extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); - -/** - * \brief Set the icon for a window. - * - * \param window The window for which the icon should be set. - * \param icon The icon for the window. - */ -extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, - SDL_Surface * icon); - -/** - * \brief Associate an arbitrary named pointer with a window. - * - * \param window The window to associate with the pointer. - * \param name The name of the pointer. - * \param userdata The associated pointer. - * - * \return The previous value associated with 'name' - * - * \note The name is case-sensitive. - * - * \sa SDL_GetWindowData() - */ -extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, - const char *name, - void *userdata); - -/** - * \brief Retrieve the data pointer associated with a window. - * - * \param window The window to query. - * \param name The name of the pointer. - * - * \return The value associated with 'name' - * - * \sa SDL_SetWindowData() - */ -extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, - const char *name); - -/** - * \brief Set the position of a window. - * - * \param window The window to reposition. - * \param x The x coordinate of the window in screen coordinates, or - * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y coordinate of the window in screen coordinates, or - * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. - * - * \note The window coordinate origin is the upper left of the display. - * - * \sa SDL_GetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, - int x, int y); - -/** - * \brief Get the position of a window. - * - * \param window The window to query. - * \param x Pointer to variable for storing the x position, in screen - * coordinates. May be NULL. - * \param y Pointer to variable for storing the y position, in screen - * coordinates. May be NULL. - * - * \sa SDL_SetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, - int *x, int *y); - -/** - * \brief Set the size of a window's client area. - * - * \param window The window to resize. - * \param w The width of the window, in screen coordinates. Must be >0. - * \param h The height of the window, in screen coordinates. Must be >0. - * - * \note Fullscreen windows automatically match the size of the display mode, - * and you should use SDL_SetWindowDisplayMode() to change their size. - * - * The window size in screen coordinates may differ from the size in pixels, if - * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with - * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * \sa SDL_GetWindowSize() - * \sa SDL_SetWindowDisplayMode() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, - int h); - -/** - * \brief Get the size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the width, in screen - * coordinates. May be NULL. - * \param h Pointer to variable for storing the height, in screen - * coordinates. May be NULL. - * - * The window size in screen coordinates may differ from the size in pixels, if - * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with - * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * \sa SDL_SetWindowSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, - int *h); - -/** - * \brief Get the size of a window's borders (decorations) around the client area. - * - * \param window The window to query. - * \param top Pointer to variable for storing the size of the top border. NULL is permitted. - * \param left Pointer to variable for storing the size of the left border. NULL is permitted. - * \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted. - * \param right Pointer to variable for storing the size of the right border. NULL is permitted. - * - * \return 0 on success, or -1 if getting this information is not supported. - * - * \note if this function fails (returns -1), the size values will be - * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as - * if the window in question was borderless. - */ -extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, - int *top, int *left, - int *bottom, int *right); - -/** - * \brief Set the minimum size of a window's client area. - * - * \param window The window to set a new minimum size. - * \param min_w The minimum width of the window, must be >0 - * \param min_h The minimum height of the window, must be >0 - * - * \note You can't change the minimum size of a fullscreen window, it - * automatically matches the size of the display mode. - * - * \sa SDL_GetWindowMinimumSize() - * \sa SDL_SetWindowMaximumSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, - int min_w, int min_h); - -/** - * \brief Get the minimum size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the minimum width, may be NULL - * \param h Pointer to variable for storing the minimum height, may be NULL - * - * \sa SDL_GetWindowMaximumSize() - * \sa SDL_SetWindowMinimumSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, - int *w, int *h); - -/** - * \brief Set the maximum size of a window's client area. - * - * \param window The window to set a new maximum size. - * \param max_w The maximum width of the window, must be >0 - * \param max_h The maximum height of the window, must be >0 - * - * \note You can't change the maximum size of a fullscreen window, it - * automatically matches the size of the display mode. - * - * \sa SDL_GetWindowMaximumSize() - * \sa SDL_SetWindowMinimumSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, - int max_w, int max_h); - -/** - * \brief Get the maximum size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the maximum width, may be NULL - * \param h Pointer to variable for storing the maximum height, may be NULL - * - * \sa SDL_GetWindowMinimumSize() - * \sa SDL_SetWindowMaximumSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, - int *w, int *h); - -/** - * \brief Set the border state of a window. - * - * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and - * add or remove the border from the actual window. This is a no-op if the - * window's border already matches the requested state. - * - * \param window The window of which to change the border state. - * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. - * - * \note You can't change the border state of a fullscreen window. - * - * \sa SDL_GetWindowFlags() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, - SDL_bool bordered); - -/** - * \brief Set the user-resizable state of a window. - * - * This will add or remove the window's SDL_WINDOW_RESIZABLE flag and - * allow/disallow user resizing of the window. This is a no-op if the - * window's resizable state already matches the requested state. - * - * \param window The window of which to change the resizable state. - * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow. - * - * \note You can't change the resizable state of a fullscreen window. - * - * \sa SDL_GetWindowFlags() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window, - SDL_bool resizable); - -/** - * \brief Show a window. - * - * \sa SDL_HideWindow() - */ -extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); - -/** - * \brief Hide a window. - * - * \sa SDL_ShowWindow() - */ -extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); - -/** - * \brief Raise a window above other windows and set the input focus. - */ -extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); - -/** - * \brief Make a window as large as possible. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); - -/** - * \brief Minimize a window to an iconic representation. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); - -/** - * \brief Restore the size and position of a minimized or maximized window. - * - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - */ -extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); - -/** - * \brief Set a window's fullscreen state. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, - Uint32 flags); - -/** - * \brief Get the SDL surface associated with the window. - * - * \return The window's framebuffer surface, or NULL on error. - * - * A new surface will be created with the optimal format for the window, - * if necessary. This surface will be freed when the window is destroyed. - * - * \note You may not combine this with 3D or the rendering API on this window. - * - * \sa SDL_UpdateWindowSurface() - * \sa SDL_UpdateWindowSurfaceRects() - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); - -/** - * \brief Copy the window surface to the screen. - * - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetWindowSurface() - * \sa SDL_UpdateWindowSurfaceRects() - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); - -/** - * \brief Copy a number of rectangles on the window surface to the screen. - * - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetWindowSurface() - * \sa SDL_UpdateWindowSurface() - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, - const SDL_Rect * rects, - int numrects); - -/** - * \brief Set a window's input grab mode. - * - * \param window The window for which the input grab mode should be set. - * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. - * - * If the caller enables a grab while another window is currently grabbed, - * the other window loses its grab in favor of the caller's window. - * - * \sa SDL_GetWindowGrab() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, - SDL_bool grabbed); - -/** - * \brief Get a window's input grab mode. - * - * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); - -/** - * \brief Get the window that currently has an input grab enabled. - * - * \return This returns the window if input is grabbed, and NULL otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); - -/** - * \brief Set the brightness (gamma correction) for a window. - * - * \return 0 on success, or -1 if setting the brightness isn't supported. - * - * \sa SDL_GetWindowBrightness() - * \sa SDL_SetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); - -/** - * \brief Get the brightness (gamma correction) for a window. - * - * \return The last brightness value passed to SDL_SetWindowBrightness() - * - * \sa SDL_SetWindowBrightness() - */ -extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); - -/** - * \brief Set the opacity for a window - * - * \param window The window which will be made transparent or opaque - * \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be - * clamped internally between 0.0f and 1.0f. - * - * \return 0 on success, or -1 if setting the opacity isn't supported. - * - * \sa SDL_GetWindowOpacity() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity); - -/** - * \brief Get the opacity of a window. - * - * If transparency isn't supported on this platform, opacity will be reported - * as 1.0f without error. - * - * \param window The window in question. - * \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque) - * - * \return 0 on success, or -1 on error (invalid window, etc). - * - * \sa SDL_SetWindowOpacity() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity); - -/** - * \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name) - * - * \param modal_window The window that should be modal - * \param parent_window The parent window - * - * \return 0 on success, or -1 otherwise. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window); - -/** - * \brief Explicitly sets input focus to the window. - * - * You almost certainly want SDL_RaiseWindow() instead of this function. Use - * this with caution, as you might give focus to a window that's completely - * obscured by other windows. - * - * \param window The window that should get the input focus - * - * \return 0 on success, or -1 otherwise. - * \sa SDL_RaiseWindow() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window); - -/** - * \brief Set the gamma ramp for a window. - * - * \param window The window for which the gamma ramp should be set. - * \param red The translation table for the red channel, or NULL. - * \param green The translation table for the green channel, or NULL. - * \param blue The translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * \sa SDL_GetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, - const Uint16 * red, - const Uint16 * green, - const Uint16 * blue); - -/** - * \brief Get the gamma ramp for a window. - * - * \param window The window from which the gamma ramp should be queried. - * \param red A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the red channel, or NULL. - * \param green A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the green channel, or NULL. - * \param blue A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * \sa SDL_SetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, - Uint16 * red, - Uint16 * green, - Uint16 * blue); - -/** - * \brief Possible return values from the SDL_HitTest callback. - * - * \sa SDL_HitTest - */ -typedef enum -{ - SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ - SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ - SDL_HITTEST_RESIZE_TOPLEFT, - SDL_HITTEST_RESIZE_TOP, - SDL_HITTEST_RESIZE_TOPRIGHT, - SDL_HITTEST_RESIZE_RIGHT, - SDL_HITTEST_RESIZE_BOTTOMRIGHT, - SDL_HITTEST_RESIZE_BOTTOM, - SDL_HITTEST_RESIZE_BOTTOMLEFT, - SDL_HITTEST_RESIZE_LEFT -} SDL_HitTestResult; - -/** - * \brief Callback used for hit-testing. - * - * \sa SDL_SetWindowHitTest - */ -typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, - const SDL_Point *area, - void *data); - -/** - * \brief Provide a callback that decides if a window region has special properties. - * - * Normally windows are dragged and resized by decorations provided by the - * system window manager (a title bar, borders, etc), but for some apps, it - * makes sense to drag them from somewhere else inside the window itself; for - * example, one might have a borderless window that wants to be draggable - * from any part, or simulate its own title bar, etc. - * - * This function lets the app provide a callback that designates pieces of - * a given window as special. This callback is run during event processing - * if we need to tell the OS to treat a region of the window specially; the - * use of this callback is known as "hit testing." - * - * Mouse input may not be delivered to your application if it is within - * a special area; the OS will often apply that input to moving the window or - * resizing the window and not deliver it to the application. - * - * Specifying NULL for a callback disables hit-testing. Hit-testing is - * disabled by default. - * - * Platforms that don't support this functionality will return -1 - * unconditionally, even if you're attempting to disable hit-testing. - * - * Your callback may fire at any time, and its firing does not indicate any - * specific behavior (for example, on Windows, this certainly might fire - * when the OS is deciding whether to drag your window, but it fires for lots - * of other reasons, too, some unrelated to anything you probably care about - * _and when the mouse isn't actually at the location it is testing_). - * Since this can fire at any time, you should try to keep your callback - * efficient, devoid of allocations, etc. - * - * \param window The window to set hit-testing on. - * \param callback The callback to call when doing a hit-test. - * \param callback_data An app-defined void pointer passed to the callback. - * \return 0 on success, -1 on error (including unsupported). - */ -extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, - SDL_HitTest callback, - void *callback_data); - -/** - * \brief Destroy a window. - */ -extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); - - -/** - * \brief Returns whether the screensaver is currently enabled (default off). - * - * \sa SDL_EnableScreenSaver() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); - -/** - * \brief Allow the screen to be blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); - -/** - * \brief Prevent the screen from being blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_EnableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); - - -/** - * \name OpenGL support functions - */ -/* @{ */ - -/** - * \brief Dynamically load an OpenGL library. - * - * \param path The platform dependent OpenGL library name, or NULL to open the - * default OpenGL library. - * - * \return 0 on success, or -1 if the library couldn't be loaded. - * - * This should be done after initializing the video driver, but before - * creating any OpenGL windows. If no OpenGL library is loaded, the default - * library will be loaded upon creation of the first OpenGL window. - * - * \note If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). - * - * \sa SDL_GL_GetProcAddress() - * \sa SDL_GL_UnloadLibrary() - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * \brief Get the address of an OpenGL function. - */ -extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); - -/** - * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). - * - * \sa SDL_GL_LoadLibrary() - */ -extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); - -/** - * \brief Return true if an OpenGL extension is supported for the current - * context. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char - *extension); - -/** - * \brief Reset all previously set OpenGL context attributes to their default values - */ -extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); - -/** - * \brief Set an OpenGL window attribute before window creation. - * - * \return 0 on success, or -1 if the attribute could not be set. - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * \brief Get the actual value for an attribute from the current context. - * - * \return 0 on success, or -1 if the attribute could not be retrieved. - * The integer at \c value will be modified in either case. - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); - -/** - * \brief Create an OpenGL context for use with an OpenGL window, and make it - * current. - * - * \sa SDL_GL_DeleteContext() - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * - window); - -/** - * \brief Set up an OpenGL context for rendering into an OpenGL window. - * - * \note The context must have been created with a compatible window. - */ -extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, - SDL_GLContext context); - -/** - * \brief Get the currently active OpenGL window. - */ -extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); - -/** - * \brief Get the currently active OpenGL context. - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); - -/** - * \brief Get the size of a window's underlying drawable in pixels (for use - * with glViewport). - * - * \param window Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, may be NULL - * \param h Pointer to variable for storing the height in pixels, may be NULL - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a - * platform with high-DPI support (Apple calls this "Retina"), and not disabled - * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. - * - * \sa SDL_GetWindowSize() - * \sa SDL_CreateWindow() - */ -extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, - int *h); - -/** - * \brief Set the swap interval for the current OpenGL context. - * - * \param interval 0 for immediate updates, 1 for updates synchronized with the - * vertical retrace. If the system supports it, you may - * specify -1 to allow late swaps to happen immediately - * instead of waiting for the next retrace. - * - * \return 0 on success, or -1 if setting the swap interval is not supported. - * - * \sa SDL_GL_GetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); - -/** - * \brief Get the swap interval for the current OpenGL context. - * - * \return 0 if there is no vertical retrace synchronization, 1 if the buffer - * swap is synchronized with the vertical retrace, and -1 if late - * swaps happen immediately instead of waiting for the next retrace. - * If the system can't determine the swap interval, or there isn't a - * valid current context, this will return 0 as a safe default. - * - * \sa SDL_GL_SetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); - -/** - * \brief Swap the OpenGL buffers for a window, if double-buffering is - * supported. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); - -/** - * \brief Delete an OpenGL context. - * - * \sa SDL_GL_CreateContext() - */ -extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); - -/* @} *//* OpenGL support functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_video_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h b/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h deleted file mode 100644 index 22c997c4..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file begin_code.h - * - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) - */ - -/* This shouldn't be nested -- included it around code only. */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -#ifndef SDL_DEPRECATED -# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ -# define SDL_DEPRECATED __attribute__((deprecated)) -# else -# define SDL_DEPRECATED -# endif -#endif - -#ifndef SDL_UNUSED -# ifdef __GNUC__ -# define SDL_UNUSED __attribute__((unused)) -# else -# define SDL_UNUSED -# endif -#endif - -/* Some compilers use a special export keyword */ -#ifndef DECLSPEC -# if defined(__WIN32__) || defined(__WINRT__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# elif defined(__OS2__) -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/* By default SDL uses the C calling convention */ -#ifndef SDLCALL -#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) -#define SDLCALL __cdecl -#elif defined(__OS2__) || defined(__EMX__) -#define SDLCALL _System -# if defined (__GNUC__) && !defined(_System) -# define _System /* for old EMX/GCC compat. */ -# endif -#else -#define SDLCALL -#endif -#endif /* SDLCALL */ - -/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ -#ifdef __SYMBIAN32__ -#undef DECLSPEC -#define DECLSPEC -#endif /* __SYMBIAN32__ */ - -/* Force structure packing at 4 byte alignment. - This is necessary if the header is included in code which has structure - packing set to an alternate value, say for loading structures from disk. - The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpragma-pack" -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#ifdef _M_X64 -/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ -#pragma pack(push,8) -#else -#pragma pack(push,4) -#endif -#endif /* Compiler needs structure packing set */ - -#ifndef SDL_INLINE -#if defined(__GNUC__) -#define SDL_INLINE __inline__ -#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) || defined(__CC_ARM) -#define SDL_INLINE __inline -#ifndef __inline__ -#define __inline__ __inline -#endif -#else -#define SDL_INLINE inline -#ifndef __inline__ -#define __inline__ inline -#endif -#endif -#endif /* SDL_INLINE not defined */ - -#ifndef SDL_FORCE_INLINE -#if defined(_MSC_VER) -#define SDL_FORCE_INLINE __forceinline -#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) -#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ -#else -#define SDL_FORCE_INLINE static SDL_INLINE -#endif -#endif /* SDL_FORCE_INLINE not defined */ - -#ifndef SDL_NORETURN -#if defined(__GNUC__) -#define SDL_NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define SDL_NORETURN __declspec(noreturn) -#else -#define SDL_NORETURN -#endif -#endif /* SDL_NORETURN not defined */ - -/* Apparently this is needed by several Windows compilers */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h b/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h deleted file mode 100644 index 8e4cac3d..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file close_code.h - * - * This file reverses the effects of begin_code.h and should be included - * after you finish any function and structure declarations in your headers - */ - -#ifndef _begin_code_h -#error close_code.h included without matching begin_code.h -#endif -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#pragma pack(pop) -#endif /* Compiler needs structure packing set */ diff --git a/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist b/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index 2b228c9f..00000000 --- a/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>BuildMachineOSBuild</key> - <string>16G29</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>SDL2</string> - <key>CFBundleGetInfoString</key> - <string>http://www.libsdl.org</string> - <key>CFBundleIdentifier</key> - <string>org.libsdl.SDL2</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>Simple DirectMedia Layer</string> - <key>CFBundlePackageType</key> - <string>FMWK</string> - <key>CFBundleShortVersionString</key> - <string>2.0.11</string> - <key>CFBundleSignature</key> - <string>SDLX</string> - <key>CFBundleSupportedPlatforms</key> - <array> - <string>MacOSX</string> - </array> - <key>CFBundleVersion</key> - <string>2.0.11</string> - <key>DTCompiler</key> - <string>com.apple.compilers.llvm.clang.1_0</string> - <key>DTPlatformBuild</key> - <string>9A235</string> - <key>DTPlatformVersion</key> - <string>GM</string> - <key>DTSDKBuild</key> - <string>17A360</string> - <key>DTSDKName</key> - <string>macosx10.8</string> - <key>DTXcode</key> - <string>0900</string> - <key>DTXcodeBuild</key> - <string>9A235</string> -</dict> -</plist> diff --git a/MacOSX/SDL2.framework/Versions/A/SDL2 b/MacOSX/SDL2.framework/Versions/A/SDL2 deleted file mode 100644 index b7080fd6..00000000 Binary files a/MacOSX/SDL2.framework/Versions/A/SDL2 and /dev/null differ diff --git a/MacOSX/SDL2.framework/Versions/Current b/MacOSX/SDL2.framework/Versions/Current deleted file mode 100644 index 8c7e5a66..00000000 --- a/MacOSX/SDL2.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/MacOSX/SDLApplication.h b/MacOSX/SDLApplication.h deleted file mode 100644 index 6dfc6050..00000000 --- a/MacOSX/SDLApplication.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import <Cocoa/Cocoa.h> - -#if !defined(USE_SDL2) -@interface SDLApplication : NSApplication { - -} - -@end -#endif diff --git a/MacOSX/SDLApplication.m b/MacOSX/SDLApplication.m deleted file mode 100644 index c316bda4..00000000 --- a/MacOSX/SDLApplication.m +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import "SDLApplication.h" - -// ericw -- with SDL2, this is unneeded and clashes; it has an SDLApplication class internally which does the same thing -#if !defined(USE_SDL2) - -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#import <SDL/SDL.h> -#else -#import "SDL.h" -#endif - -@implementation SDLApplication -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); - - [super terminate:sender]; -} -@end - -#endif diff --git a/MacOSX/SDLMain.h b/MacOSX/SDLMain.h deleted file mode 100644 index 7493210e..00000000 --- a/MacOSX/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser <dwaliss1@purdue.edu> - Non-NIB-Code & other changes: Max Horn <max@quendi.de> - - Feel free to customize this file to suit your needs -*/ - -#import <Cocoa/Cocoa.h> - -extern int gArgc; -extern char **gArgv; -extern BOOL gFinderLaunch; -extern BOOL gCalledAppMainline; - -@interface SDLMain : NSObject -@end diff --git a/MacOSX/SDLMain.m b/MacOSX/SDLMain.m deleted file mode 100644 index a48066a6..00000000 --- a/MacOSX/SDLMain.m +++ /dev/null @@ -1,113 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser <dwaliss1@purdue.edu> - Non-NIB-Code & other changes: Max Horn <max@quendi.de> - - Feel free to customize this file to suit your needs -*/ - -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) -#import <SDL2/SDL.h> -#else -#import <SDL/SDL.h> -#endif -#else -#import "SDL.h" -#endif -#import "SDLMain.h" -#import <sys/param.h> /* for MAXPATHLEN */ -#import <unistd.h> -#import "SDLApplication.h" - -int gArgc; -char **gArgv; -BOOL gFinderLaunch; -BOOL gCalledAppMainline = FALSE; - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { - assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } - -} - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -#ifdef main -# undef main -#endif - - -static int IsRootCwd() -{ - char buf[MAXPATHLEN]; - char *cwd = getcwd(buf, sizeof (buf)); - return (cwd && (strcmp(cwd, "/") == 0)); -} - -static int IsFinderLaunch(const int argc, char **argv) -{ - /* -psn_XXX is passed if we are launched from Finder, SOMETIMES */ - if ( (argc >= 2) && (strncmp(argv[1], "-psn", 4) == 0) ) { - return 1; - } else if ((argc == 1) && IsRootCwd()) { - /* we might still be launched from the Finder; on 10.9+, you might not - get the -psn command line anymore. If there's no - command line, and if our current working directory is "/", it - might as well be a Finder launch. */ - return 1; - } - return 0; /* not a Finder launch. */ -} - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - if (IsFinderLaunch(argc, argv)) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - - NSApplicationMain (argc, (const char**) argv); - return 0; -} diff --git a/MacOSX/ScreenInfo.h b/MacOSX/ScreenInfo.h deleted file mode 100644 index fdb2abbd..00000000 --- a/MacOSX/ScreenInfo.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import <Cocoa/Cocoa.h> - - -@interface ScreenInfo : NSObject { - int width; - int height; - int bpp; - NSString *description; -} - -- (id)initWithWidth:(int)w height:(int)h bpp:(int)b; - -- (int)width; -- (int)height; -- (int)bpp; -- (NSString *)description; - -@end diff --git a/MacOSX/ScreenInfo.m b/MacOSX/ScreenInfo.m deleted file mode 100644 index 783e8a8f..00000000 --- a/MacOSX/ScreenInfo.m +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (C) 2007-2008 Kristian Duske - -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. - -*/ - -#import "ScreenInfo.h" - - -@implementation ScreenInfo - -- (id)initWithWidth:(int)w height:(int)h bpp:(int)b { - - self = [super init]; - if (!self) - return nil; - - width = w; - height = h; - bpp = b; - - description = [NSString stringWithFormat:@"%d x %d %d Bit", width, height, bpp]; - - return self; -} - -- (int)width { - - return width; -} - -- (int)height { - - return height; -} - -- (int)bpp { - - return bpp; -} - -- (NSString *)description { - - return description; -} - -@end diff --git a/MacOSX/codecs/include/FLAC/callback.h b/MacOSX/codecs/include/FLAC/callback.h deleted file mode 100644 index 71bbaec6..00000000 --- a/MacOSX/codecs/include/FLAC/callback.h +++ /dev/null @@ -1,185 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2013 Xiph.Org Foundation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__CALLBACK_H -#define FLAC__CALLBACK_H - -#include "ordinals.h" -#include <stdlib.h> /* for size_t */ - -/** \file include/FLAC/callback.h - * - * \brief - * This module defines the structures for describing I/O callbacks - * to the other FLAC interfaces. - * - * See the detailed documentation for callbacks in the - * \link flac_callbacks callbacks \endlink module. - */ - -/** \defgroup flac_callbacks FLAC/callback.h: I/O callback structures - * \ingroup flac - * - * \brief - * This module defines the structures for describing I/O callbacks - * to the other FLAC interfaces. - * - * The purpose of the I/O callback functions is to create a common way - * for the metadata interfaces to handle I/O. - * - * Originally the metadata interfaces required filenames as the way of - * specifying FLAC files to operate on. This is problematic in some - * environments so there is an additional option to specify a set of - * callbacks for doing I/O on the FLAC file, instead of the filename. - * - * In addition to the callbacks, a FLAC__IOHandle type is defined as an - * opaque structure for a data source. - * - * The callback function prototypes are similar (but not identical) to the - * stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use - * stdio streams to implement the callbacks, you can pass fread, fwrite, and - * fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or - * FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle - * is required. \warning You generally CANNOT directly use fseek or ftell - * for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems - * these use 32-bit offsets and FLAC requires 64-bit offsets to deal with - * large files. You will have to find an equivalent function (e.g. ftello), - * or write a wrapper. The same is true for feof() since this is usually - * implemented as a macro, not as a function whose address can be taken. - * - * \{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the opaque handle type used by the callbacks. Typically - * this is a \c FILE* or address of a file descriptor. - */ -typedef void* FLAC__IOHandle; - -/** Signature for the read callback. - * The signature and semantics match POSIX fread() implementations - * and can generally be used interchangeably. - * - * \param ptr The address of the read buffer. - * \param size The size of the records to be read. - * \param nmemb The number of records to be read. - * \param handle The handle to the data source. - * \retval size_t - * The number of records read. - */ -typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); - -/** Signature for the write callback. - * The signature and semantics match POSIX fwrite() implementations - * and can generally be used interchangeably. - * - * \param ptr The address of the write buffer. - * \param size The size of the records to be written. - * \param nmemb The number of records to be written. - * \param handle The handle to the data source. - * \retval size_t - * The number of records written. - */ -typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); - -/** Signature for the seek callback. - * The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT - * EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long' - * and 32-bits wide. - * - * \param handle The handle to the data source. - * \param offset The new position, relative to \a whence - * \param whence \c SEEK_SET, \c SEEK_CUR, or \c SEEK_END - * \retval int - * \c 0 on success, \c -1 on error. - */ -typedef int (*FLAC__IOCallback_Seek) (FLAC__IOHandle handle, FLAC__int64 offset, int whence); - -/** Signature for the tell callback. - * The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT - * EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long' - * and 32-bits wide. - * - * \param handle The handle to the data source. - * \retval FLAC__int64 - * The current position on success, \c -1 on error. - */ -typedef FLAC__int64 (*FLAC__IOCallback_Tell) (FLAC__IOHandle handle); - -/** Signature for the EOF callback. - * The signature and semantics mostly match POSIX feof() but WATCHOUT: - * on many systems, feof() is a macro, so in this case a wrapper function - * must be provided instead. - * - * \param handle The handle to the data source. - * \retval int - * \c 0 if not at end of file, nonzero if at end of file. - */ -typedef int (*FLAC__IOCallback_Eof) (FLAC__IOHandle handle); - -/** Signature for the close callback. - * The signature and semantics match POSIX fclose() implementations - * and can generally be used interchangeably. - * - * \param handle The handle to the data source. - * \retval int - * \c 0 on success, \c EOF on error. - */ -typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle); - -/** A structure for holding a set of callbacks. - * Each FLAC interface that requires a FLAC__IOCallbacks structure will - * describe which of the callbacks are required. The ones that are not - * required may be set to NULL. - * - * If the seek requirement for an interface is optional, you can signify that - * a data sorce is not seekable by setting the \a seek field to \c NULL. - */ -typedef struct { - FLAC__IOCallback_Read read; - FLAC__IOCallback_Write write; - FLAC__IOCallback_Seek seek; - FLAC__IOCallback_Tell tell; - FLAC__IOCallback_Eof eof; - FLAC__IOCallback_Close close; -} FLAC__IOCallbacks; - -/* \} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/MacOSX/codecs/include/FLAC/export.h b/MacOSX/codecs/include/FLAC/export.h deleted file mode 100644 index 4b2418f0..00000000 --- a/MacOSX/codecs/include/FLAC/export.h +++ /dev/null @@ -1,97 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2013 Xiph.Org Foundation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__EXPORT_H -#define FLAC__EXPORT_H - -/** \file include/FLAC/export.h - * - * \brief - * This module contains #defines and symbols for exporting function - * calls, and providing version information and compiled-in features. - * - * See the \link flac_export export \endlink module. - */ - -/** \defgroup flac_export FLAC/export.h: export symbols - * \ingroup flac - * - * \brief - * This module contains #defines and symbols for exporting function - * calls, and providing version information and compiled-in features. - * - * If you are compiling with MSVC and will link to the static library - * (libFLAC.lib) you should define FLAC__NO_DLL in your project to - * make sure the symbols are exported properly. - * - * \{ - */ - -#if defined(FLAC__NO_DLL) -#define FLAC_API - -#elif defined(_WIN32) /*defined(_MSC_VER)*/ -#ifdef FLAC_API_EXPORTS -#define FLAC_API __declspec(dllexport) -#else -#define FLAC_API __declspec(dllimport) -#endif - -#elif defined(FLAC__USE_VISIBILITY_ATTR) -#define FLAC_API __attribute__ ((visibility ("default"))) - -#else -#define FLAC_API - -#endif - -/** These #defines will mirror the libtool-based library version number, see - * http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning - */ -#define FLAC_API_VERSION_CURRENT 11 -#define FLAC_API_VERSION_REVISION 0 /**< see above */ -#define FLAC_API_VERSION_AGE 3 /**< see above */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */ -extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC; - -#ifdef __cplusplus -} -#endif - -/* \} */ - -#endif diff --git a/MacOSX/codecs/include/FLAC/format.h b/MacOSX/codecs/include/FLAC/format.h deleted file mode 100644 index e4c1c1a6..00000000 --- a/MacOSX/codecs/include/FLAC/format.h +++ /dev/null @@ -1,1023 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2013 Xiph.Org Foundation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__FORMAT_H -#define FLAC__FORMAT_H - -#include "export.h" -#include "ordinals.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \file include/FLAC/format.h - * - * \brief - * This module contains structure definitions for the representation - * of FLAC format components in memory. These are the basic - * structures used by the rest of the interfaces. - * - * See the detailed documentation in the - * \link flac_format format \endlink module. - */ - -/** \defgroup flac_format FLAC/format.h: format components - * \ingroup flac - * - * \brief - * This module contains structure definitions for the representation - * of FLAC format components in memory. These are the basic - * structures used by the rest of the interfaces. - * - * First, you should be familiar with the - * <A HREF="../format.html">FLAC format</A>. Many of the values here - * follow directly from the specification. As a user of libFLAC, the - * interesting parts really are the structures that describe the frame - * header and metadata blocks. - * - * The format structures here are very primitive, designed to store - * information in an efficient way. Reading information from the - * structures is easy but creating or modifying them directly is - * more complex. For the most part, as a user of a library, editing - * is not necessary; however, for metadata blocks it is, so there are - * convenience functions provided in the \link flac_metadata metadata - * module \endlink to simplify the manipulation of metadata blocks. - * - * \note - * It's not the best convention, but symbols ending in _LEN are in bits - * and _LENGTH are in bytes. _LENGTH symbols are \#defines instead of - * global variables because they are usually used when declaring byte - * arrays and some compilers require compile-time knowledge of array - * sizes when declared on the stack. - * - * \{ - */ - - -/* - Most of the values described in this file are defined by the FLAC - format specification. There is nothing to tune here. -*/ - -/** The largest legal metadata type code. */ -#define FLAC__MAX_METADATA_TYPE_CODE (126u) - -/** The minimum block size, in samples, permitted by the format. */ -#define FLAC__MIN_BLOCK_SIZE (16u) - -/** The maximum block size, in samples, permitted by the format. */ -#define FLAC__MAX_BLOCK_SIZE (65535u) - -/** The maximum block size, in samples, permitted by the FLAC subset for - * sample rates up to 48kHz. */ -#define FLAC__SUBSET_MAX_BLOCK_SIZE_48000HZ (4608u) - -/** The maximum number of channels permitted by the format. */ -#define FLAC__MAX_CHANNELS (8u) - -/** The minimum sample resolution permitted by the format. */ -#define FLAC__MIN_BITS_PER_SAMPLE (4u) - -/** The maximum sample resolution permitted by the format. */ -#define FLAC__MAX_BITS_PER_SAMPLE (32u) - -/** The maximum sample resolution permitted by libFLAC. - * - * \warning - * FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format. However, - * the reference encoder/decoder is currently limited to 24 bits because - * of prevalent 32-bit math, so make sure and use this value when - * appropriate. - */ -#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u) - -/** The maximum sample rate permitted by the format. The value is - * ((2 ^ 16) - 1) * 10; see <A HREF="../format.html">FLAC format</A> - * as to why. - */ -#define FLAC__MAX_SAMPLE_RATE (655350u) - -/** The maximum LPC order permitted by the format. */ -#define FLAC__MAX_LPC_ORDER (32u) - -/** The maximum LPC order permitted by the FLAC subset for sample rates - * up to 48kHz. */ -#define FLAC__SUBSET_MAX_LPC_ORDER_48000HZ (12u) - -/** The minimum quantized linear predictor coefficient precision - * permitted by the format. - */ -#define FLAC__MIN_QLP_COEFF_PRECISION (5u) - -/** The maximum quantized linear predictor coefficient precision - * permitted by the format. - */ -#define FLAC__MAX_QLP_COEFF_PRECISION (15u) - -/** The maximum order of the fixed predictors permitted by the format. */ -#define FLAC__MAX_FIXED_ORDER (4u) - -/** The maximum Rice partition order permitted by the format. */ -#define FLAC__MAX_RICE_PARTITION_ORDER (15u) - -/** The maximum Rice partition order permitted by the FLAC Subset. */ -#define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u) - -/** The version string of the release, stamped onto the libraries and binaries. - * - * \note - * This does not correspond to the shared library version number, which - * is used to determine binary compatibility. - */ -extern FLAC_API const char *FLAC__VERSION_STRING; - -/** The vendor string inserted by the encoder into the VORBIS_COMMENT block. - * This is a NUL-terminated ASCII string; when inserted into the - * VORBIS_COMMENT the trailing null is stripped. - */ -extern FLAC_API const char *FLAC__VENDOR_STRING; - -/** The byte string representation of the beginning of a FLAC stream. */ -extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */ - -/** The 32-bit integer big-endian representation of the beginning of - * a FLAC stream. - */ -extern FLAC_API const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */ - -/** The length of the FLAC signature in bits. */ -extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ - -/** The length of the FLAC signature in bytes. */ -#define FLAC__STREAM_SYNC_LENGTH (4u) - - -/***************************************************************************** - * - * Subframe structures - * - *****************************************************************************/ - -/*****************************************************************************/ - -/** An enumeration of the available entropy coding methods. */ -typedef enum { - FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, - /**< Residual is coded by partitioning into contexts, each with it's own - * 4-bit Rice parameter. */ - - FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 - /**< Residual is coded by partitioning into contexts, each with it's own - * 5-bit Rice parameter. */ -} FLAC__EntropyCodingMethodType; - -/** Maps a FLAC__EntropyCodingMethodType to a C string. - * - * Using a FLAC__EntropyCodingMethodType as the index to this array will - * give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[]; - - -/** Contents of a Rice partitioned residual - */ -typedef struct { - - unsigned *parameters; - /**< The Rice parameters for each context. */ - - unsigned *raw_bits; - /**< Widths for escape-coded partitions. Will be non-zero for escaped - * partitions and zero for unescaped partitions. - */ - - unsigned capacity_by_order; - /**< The capacity of the \a parameters and \a raw_bits arrays - * specified as an order, i.e. the number of array elements - * allocated is 2 ^ \a capacity_by_order. - */ -} FLAC__EntropyCodingMethod_PartitionedRiceContents; - -/** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>) - */ -typedef struct { - - unsigned order; - /**< The partition order, i.e. # of contexts = 2 ^ \a order. */ - - const FLAC__EntropyCodingMethod_PartitionedRiceContents *contents; - /**< The context's Rice parameters and/or raw bits. */ - -} FLAC__EntropyCodingMethod_PartitionedRice; - -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /**< == 4 (bits) */ -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /**< == 4 (bits) */ -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN; /**< == 5 (bits) */ -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /**< == 5 (bits) */ - -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; -/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */ -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER; -/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */ - -/** Header for the entropy coding method. (c.f. <A HREF="../format.html#residual">format specification</A>) - */ -typedef struct { - FLAC__EntropyCodingMethodType type; - union { - FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice; - } data; -} FLAC__EntropyCodingMethod; - -extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /**< == 2 (bits) */ - -/*****************************************************************************/ - -/** An enumeration of the available subframe types. */ -typedef enum { - FLAC__SUBFRAME_TYPE_CONSTANT = 0, /**< constant signal */ - FLAC__SUBFRAME_TYPE_VERBATIM = 1, /**< uncompressed signal */ - FLAC__SUBFRAME_TYPE_FIXED = 2, /**< fixed polynomial prediction */ - FLAC__SUBFRAME_TYPE_LPC = 3 /**< linear prediction */ -} FLAC__SubframeType; - -/** Maps a FLAC__SubframeType to a C string. - * - * Using a FLAC__SubframeType as the index to this array will - * give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__SubframeTypeString[]; - - -/** CONSTANT subframe. (c.f. <A HREF="../format.html#subframe_constant">format specification</A>) - */ -typedef struct { - FLAC__int32 value; /**< The constant signal value. */ -} FLAC__Subframe_Constant; - - -/** VERBATIM subframe. (c.f. <A HREF="../format.html#subframe_verbatim">format specification</A>) - */ -typedef struct { - const FLAC__int32 *data; /**< A pointer to verbatim signal. */ -} FLAC__Subframe_Verbatim; - - -/** FIXED subframe. (c.f. <A HREF="../format.html#subframe_fixed">format specification</A>) - */ -typedef struct { - FLAC__EntropyCodingMethod entropy_coding_method; - /**< The residual coding method. */ - - unsigned order; - /**< The polynomial order. */ - - FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER]; - /**< Warmup samples to prime the predictor, length == order. */ - - const FLAC__int32 *residual; - /**< The residual signal, length == (blocksize minus order) samples. */ -} FLAC__Subframe_Fixed; - - -/** LPC subframe. (c.f. <A HREF="../format.html#subframe_lpc">format specification</A>) - */ -typedef struct { - FLAC__EntropyCodingMethod entropy_coding_method; - /**< The residual coding method. */ - - unsigned order; - /**< The FIR order. */ - - unsigned qlp_coeff_precision; - /**< Quantized FIR filter coefficient precision in bits. */ - - int quantization_level; - /**< The qlp coeff shift needed. */ - - FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER]; - /**< FIR filter coefficients. */ - - FLAC__int32 warmup[FLAC__MAX_LPC_ORDER]; - /**< Warmup samples to prime the predictor, length == order. */ - - const FLAC__int32 *residual; - /**< The residual signal, length == (blocksize minus order) samples. */ -} FLAC__Subframe_LPC; - -extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**< == 4 (bits) */ -extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */ - - -/** FLAC subframe structure. (c.f. <A HREF="../format.html#subframe">format specification</A>) - */ -typedef struct { - FLAC__SubframeType type; - union { - FLAC__Subframe_Constant constant; - FLAC__Subframe_Fixed fixed; - FLAC__Subframe_LPC lpc; - FLAC__Subframe_Verbatim verbatim; - } data; - unsigned wasted_bits; -} FLAC__Subframe; - -/** == 1 (bit) - * - * This used to be a zero-padding bit (hence the name - * FLAC__SUBFRAME_ZERO_PAD_LEN) but is now a reserved bit. It still has a - * mandatory value of \c 0 but in the future may take on the value \c 0 or \c 1 - * to mean something else. - */ -extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; -extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; /**< == 6 (bits) */ -extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /**< == 1 (bit) */ - -extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /**< = 0x00 */ -extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /**< = 0x02 */ -extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /**< = 0x10 */ -extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /**< = 0x40 */ - -/*****************************************************************************/ - - -/***************************************************************************** - * - * Frame structures - * - *****************************************************************************/ - -/** An enumeration of the available channel assignments. */ -typedef enum { - FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, /**< independent channels */ - FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, /**< left+side stereo */ - FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, /**< right+side stereo */ - FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 /**< mid+side stereo */ -} FLAC__ChannelAssignment; - -/** Maps a FLAC__ChannelAssignment to a C string. - * - * Using a FLAC__ChannelAssignment as the index to this array will - * give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__ChannelAssignmentString[]; - -/** An enumeration of the possible frame numbering methods. */ -typedef enum { - FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER, /**< number contains the frame number */ - FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER /**< number contains the sample number of first sample in frame */ -} FLAC__FrameNumberType; - -/** Maps a FLAC__FrameNumberType to a C string. - * - * Using a FLAC__FrameNumberType as the index to this array will - * give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__FrameNumberTypeString[]; - - -/** FLAC frame header structure. (c.f. <A HREF="../format.html#frame_header">format specification</A>) - */ -typedef struct { - unsigned blocksize; - /**< The number of samples per subframe. */ - - unsigned sample_rate; - /**< The sample rate in Hz. */ - - unsigned channels; - /**< The number of channels (== number of subframes). */ - - FLAC__ChannelAssignment channel_assignment; - /**< The channel assignment for the frame. */ - - unsigned bits_per_sample; - /**< The sample resolution. */ - - FLAC__FrameNumberType number_type; - /**< The numbering scheme used for the frame. As a convenience, the - * decoder will always convert a frame number to a sample number because - * the rules are complex. */ - - union { - FLAC__uint32 frame_number; - FLAC__uint64 sample_number; - } number; - /**< The frame number or sample number of first sample in frame; - * use the \a number_type value to determine which to use. */ - - FLAC__uint8 crc; - /**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) - * of the raw frame header bytes, meaning everything before the CRC byte - * including the sync code. - */ -} FLAC__FrameHeader; - -extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /**< == 14 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 1 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN; /**< == 1 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /**< == 4 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /**< == 3 (bits) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit) */ -extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ - - -/** FLAC frame footer structure. (c.f. <A HREF="../format.html#frame_footer">format specification</A>) - */ -typedef struct { - FLAC__uint16 crc; - /**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with - * 0) of the bytes before the crc, back to and including the frame header - * sync code. - */ -} FLAC__FrameFooter; - -extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ - - -/** FLAC frame structure. (c.f. <A HREF="../format.html#frame">format specification</A>) - */ -typedef struct { - FLAC__FrameHeader header; - FLAC__Subframe subframes[FLAC__MAX_CHANNELS]; - FLAC__FrameFooter footer; -} FLAC__Frame; - -/*****************************************************************************/ - - -/***************************************************************************** - * - * Meta-data structures - * - *****************************************************************************/ - -/** An enumeration of the available metadata block types. */ -typedef enum { - - FLAC__METADATA_TYPE_STREAMINFO = 0, - /**< <A HREF="../format.html#metadata_block_streaminfo">STREAMINFO</A> block */ - - FLAC__METADATA_TYPE_PADDING = 1, - /**< <A HREF="../format.html#metadata_block_padding">PADDING</A> block */ - - FLAC__METADATA_TYPE_APPLICATION = 2, - /**< <A HREF="../format.html#metadata_block_application">APPLICATION</A> block */ - - FLAC__METADATA_TYPE_SEEKTABLE = 3, - /**< <A HREF="../format.html#metadata_block_seektable">SEEKTABLE</A> block */ - - FLAC__METADATA_TYPE_VORBIS_COMMENT = 4, - /**< <A HREF="../format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block (a.k.a. FLAC tags) */ - - FLAC__METADATA_TYPE_CUESHEET = 5, - /**< <A HREF="../format.html#metadata_block_cuesheet">CUESHEET</A> block */ - - FLAC__METADATA_TYPE_PICTURE = 6, - /**< <A HREF="../format.html#metadata_block_picture">PICTURE</A> block */ - - FLAC__METADATA_TYPE_UNDEFINED = 7 - /**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */ - -} FLAC__MetadataType; - -/** Maps a FLAC__MetadataType to a C string. - * - * Using a FLAC__MetadataType as the index to this array will - * give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__MetadataTypeString[]; - - -/** FLAC STREAMINFO structure. (c.f. <A HREF="../format.html#metadata_block_streaminfo">format specification</A>) - */ -typedef struct { - unsigned min_blocksize, max_blocksize; - unsigned min_framesize, max_framesize; - unsigned sample_rate; - unsigned channels; - unsigned bits_per_sample; - FLAC__uint64 total_samples; - FLAC__byte md5sum[16]; -} FLAC__StreamMetadata_StreamInfo; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /**< == 16 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /**< == 16 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /**< == 24 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /**< == 24 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /**< == 20 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /**< == 3 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /**< == 5 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /**< == 36 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< == 128 (bits) */ - -/** The total stream length of the STREAMINFO block in bytes. */ -#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u) - -/** FLAC PADDING structure. (c.f. <A HREF="../format.html#metadata_block_padding">format specification</A>) - */ -typedef struct { - int dummy; - /**< Conceptually this is an empty struct since we don't store the - * padding bytes. Empty structs are not allowed by some C compilers, - * hence the dummy. - */ -} FLAC__StreamMetadata_Padding; - - -/** FLAC APPLICATION structure. (c.f. <A HREF="../format.html#metadata_block_application">format specification</A>) - */ -typedef struct { - FLAC__byte id[4]; - FLAC__byte *data; -} FLAC__StreamMetadata_Application; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */ - -/** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="../format.html#seekpoint">format specification</A>) - */ -typedef struct { - FLAC__uint64 sample_number; - /**< The sample number of the target frame. */ - - FLAC__uint64 stream_offset; - /**< The offset, in bytes, of the target frame with respect to - * beginning of the first frame. */ - - unsigned frame_samples; - /**< The number of samples in the target frame. */ -} FLAC__StreamMetadata_SeekPoint; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /**< == 64 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /**< == 64 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /**< == 16 (bits) */ - -/** The total stream length of a seek point in bytes. */ -#define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u) - -/** The value used in the \a sample_number field of - * FLAC__StreamMetadataSeekPoint used to indicate a placeholder - * point (== 0xffffffffffffffff). - */ -extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - - -/** FLAC SEEKTABLE structure. (c.f. <A HREF="../format.html#metadata_block_seektable">format specification</A>) - * - * \note From the format specification: - * - The seek points must be sorted by ascending sample number. - * - Each seek point's sample number must be the first sample of the - * target frame. - * - Each seek point's sample number must be unique within the table. - * - Existence of a SEEKTABLE block implies a correct setting of - * total_samples in the stream_info block. - * - Behavior is undefined when more than one SEEKTABLE block is - * present in a stream. - */ -typedef struct { - unsigned num_points; - FLAC__StreamMetadata_SeekPoint *points; -} FLAC__StreamMetadata_SeekTable; - - -/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>) - * - * For convenience, the APIs maintain a trailing NUL character at the end of - * \a entry which is not counted toward \a length, i.e. - * \code strlen(entry) == length \endcode - */ -typedef struct { - FLAC__uint32 length; - FLAC__byte *entry; -} FLAC__StreamMetadata_VorbisComment_Entry; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */ - - -/** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>) - */ -typedef struct { - FLAC__StreamMetadata_VorbisComment_Entry vendor_string; - FLAC__uint32 num_comments; - FLAC__StreamMetadata_VorbisComment_Entry *comments; -} FLAC__StreamMetadata_VorbisComment; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; /**< == 32 (bits) */ - - -/** FLAC CUESHEET track index structure. (See the - * <A HREF="../format.html#cuesheet_track_index">format specification</A> for - * the full description of each field.) - */ -typedef struct { - FLAC__uint64 offset; - /**< Offset in samples, relative to the track offset, of the index - * point. - */ - - FLAC__byte number; - /**< The index point number. */ -} FLAC__StreamMetadata_CueSheet_Index; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN; /**< == 64 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN; /**< == 8 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN; /**< == 3*8 (bits) */ - - -/** FLAC CUESHEET track structure. (See the - * <A HREF="../format.html#cuesheet_track">format specification</A> for - * the full description of each field.) - */ -typedef struct { - FLAC__uint64 offset; - /**< Track offset in samples, relative to the beginning of the FLAC audio stream. */ - - FLAC__byte number; - /**< The track number. */ - - char isrc[13]; - /**< Track ISRC. This is a 12-digit alphanumeric code plus a trailing \c NUL byte */ - - unsigned type:1; - /**< The track type: 0 for audio, 1 for non-audio. */ - - unsigned pre_emphasis:1; - /**< The pre-emphasis flag: 0 for no pre-emphasis, 1 for pre-emphasis. */ - - FLAC__byte num_indices; - /**< The number of track index points. */ - - FLAC__StreamMetadata_CueSheet_Index *indices; - /**< NULL if num_indices == 0, else pointer to array of index points. */ - -} FLAC__StreamMetadata_CueSheet_Track; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN; /**< == 64 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN; /**< == 8 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN; /**< == 12*8 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN; /**< == 1 (bit) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN; /**< == 1 (bit) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN; /**< == 6+13*8 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN; /**< == 8 (bits) */ - - -/** FLAC CUESHEET structure. (See the - * <A HREF="../format.html#metadata_block_cuesheet">format specification</A> - * for the full description of each field.) - */ -typedef struct { - char media_catalog_number[129]; - /**< Media catalog number, in ASCII printable characters 0x20-0x7e. In - * general, the media catalog number may be 0 to 128 bytes long; any - * unused characters should be right-padded with NUL characters. - */ - - FLAC__uint64 lead_in; - /**< The number of lead-in samples. */ - - FLAC__bool is_cd; - /**< \c true if CUESHEET corresponds to a Compact Disc, else \c false. */ - - unsigned num_tracks; - /**< The number of tracks. */ - - FLAC__StreamMetadata_CueSheet_Track *tracks; - /**< NULL if num_tracks == 0, else pointer to array of tracks. */ - -} FLAC__StreamMetadata_CueSheet; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN; /**< == 128*8 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN; /**< == 64 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN; /**< == 1 (bit) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN; /**< == 7+258*8 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN; /**< == 8 (bits) */ - - -/** An enumeration of the PICTURE types (see FLAC__StreamMetadataPicture and id3 v2.4 APIC tag). */ -typedef enum { - FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER = 0, /**< Other */ - FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD = 1, /**< 32x32 pixels 'file icon' (PNG only) */ - FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON = 2, /**< Other file icon */ - FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER = 3, /**< Cover (front) */ - FLAC__STREAM_METADATA_PICTURE_TYPE_BACK_COVER = 4, /**< Cover (back) */ - FLAC__STREAM_METADATA_PICTURE_TYPE_LEAFLET_PAGE = 5, /**< Leaflet page */ - FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA = 6, /**< Media (e.g. label side of CD) */ - FLAC__STREAM_METADATA_PICTURE_TYPE_LEAD_ARTIST = 7, /**< Lead artist/lead performer/soloist */ - FLAC__STREAM_METADATA_PICTURE_TYPE_ARTIST = 8, /**< Artist/performer */ - FLAC__STREAM_METADATA_PICTURE_TYPE_CONDUCTOR = 9, /**< Conductor */ - FLAC__STREAM_METADATA_PICTURE_TYPE_BAND = 10, /**< Band/Orchestra */ - FLAC__STREAM_METADATA_PICTURE_TYPE_COMPOSER = 11, /**< Composer */ - FLAC__STREAM_METADATA_PICTURE_TYPE_LYRICIST = 12, /**< Lyricist/text writer */ - FLAC__STREAM_METADATA_PICTURE_TYPE_RECORDING_LOCATION = 13, /**< Recording Location */ - FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_RECORDING = 14, /**< During recording */ - FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_PERFORMANCE = 15, /**< During performance */ - FLAC__STREAM_METADATA_PICTURE_TYPE_VIDEO_SCREEN_CAPTURE = 16, /**< Movie/video screen capture */ - FLAC__STREAM_METADATA_PICTURE_TYPE_FISH = 17, /**< A bright coloured fish */ - FLAC__STREAM_METADATA_PICTURE_TYPE_ILLUSTRATION = 18, /**< Illustration */ - FLAC__STREAM_METADATA_PICTURE_TYPE_BAND_LOGOTYPE = 19, /**< Band/artist logotype */ - FLAC__STREAM_METADATA_PICTURE_TYPE_PUBLISHER_LOGOTYPE = 20, /**< Publisher/Studio logotype */ - FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED -} FLAC__StreamMetadata_Picture_Type; - -/** Maps a FLAC__StreamMetadata_Picture_Type to a C string. - * - * Using a FLAC__StreamMetadata_Picture_Type as the index to this array - * will give the string equivalent. The contents should not be - * modified. - */ -extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[]; - -/** FLAC PICTURE structure. (See the - * <A HREF="../format.html#metadata_block_picture">format specification</A> - * for the full description of each field.) - */ -typedef struct { - FLAC__StreamMetadata_Picture_Type type; - /**< The kind of picture stored. */ - - char *mime_type; - /**< Picture data's MIME type, in ASCII printable characters - * 0x20-0x7e, NUL terminated. For best compatibility with players, - * use picture data of MIME type \c image/jpeg or \c image/png. A - * MIME type of '-->' is also allowed, in which case the picture - * data should be a complete URL. In file storage, the MIME type is - * stored as a 32-bit length followed by the ASCII string with no NUL - * terminator, but is converted to a plain C string in this structure - * for convenience. - */ - - FLAC__byte *description; - /**< Picture's description in UTF-8, NUL terminated. In file storage, - * the description is stored as a 32-bit length followed by the UTF-8 - * string with no NUL terminator, but is converted to a plain C string - * in this structure for convenience. - */ - - FLAC__uint32 width; - /**< Picture's width in pixels. */ - - FLAC__uint32 height; - /**< Picture's height in pixels. */ - - FLAC__uint32 depth; - /**< Picture's color depth in bits-per-pixel. */ - - FLAC__uint32 colors; - /**< For indexed palettes (like GIF), picture's number of colors (the - * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). - */ - - FLAC__uint32 data_length; - /**< Length of binary picture data in bytes. */ - - FLAC__byte *data; - /**< Binary picture data. */ - -} FLAC__StreamMetadata_Picture; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_TYPE_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_COLORS_LEN; /**< == 32 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN; /**< == 32 (bits) */ - - -/** Structure that is used when a metadata block of unknown type is loaded. - * The contents are opaque. The structure is used only internally to - * correctly handle unknown metadata. - */ -typedef struct { - FLAC__byte *data; -} FLAC__StreamMetadata_Unknown; - - -/** FLAC metadata block structure. (c.f. <A HREF="../format.html#metadata_block">format specification</A>) - */ -typedef struct { - FLAC__MetadataType type; - /**< The type of the metadata block; used determine which member of the - * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED - * then \a data.unknown must be used. */ - - FLAC__bool is_last; - /**< \c true if this metadata block is the last, else \a false */ - - unsigned length; - /**< Length, in bytes, of the block data as it appears in the stream. */ - - union { - FLAC__StreamMetadata_StreamInfo stream_info; - FLAC__StreamMetadata_Padding padding; - FLAC__StreamMetadata_Application application; - FLAC__StreamMetadata_SeekTable seek_table; - FLAC__StreamMetadata_VorbisComment vorbis_comment; - FLAC__StreamMetadata_CueSheet cue_sheet; - FLAC__StreamMetadata_Picture picture; - FLAC__StreamMetadata_Unknown unknown; - } data; - /**< Polymorphic block data; use the \a type value to determine which - * to use. */ -} FLAC__StreamMetadata; - -extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /**< == 7 (bits) */ -extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /**< == 24 (bits) */ - -/** The total stream length of a metadata block header in bytes. */ -#define FLAC__STREAM_METADATA_HEADER_LENGTH (4u) - -/*****************************************************************************/ - - -/***************************************************************************** - * - * Utility functions - * - *****************************************************************************/ - -/** Tests that a sample rate is valid for FLAC. - * - * \param sample_rate The sample rate to test for compliance. - * \retval FLAC__bool - * \c true if the given sample rate conforms to the specification, else - * \c false. - */ -FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate); - -/** Tests that a blocksize at the given sample rate is valid for the FLAC - * subset. - * - * \param blocksize The blocksize to test for compliance. - * \param sample_rate The sample rate is needed, since the valid subset - * blocksize depends on the sample rate. - * \retval FLAC__bool - * \c true if the given blocksize conforms to the specification for the - * subset at the given sample rate, else \c false. - */ -FLAC_API FLAC__bool FLAC__format_blocksize_is_subset(unsigned blocksize, unsigned sample_rate); - -/** Tests that a sample rate is valid for the FLAC subset. The subset rules - * for valid sample rates are slightly more complex since the rate has to - * be expressible completely in the frame header. - * - * \param sample_rate The sample rate to test for compliance. - * \retval FLAC__bool - * \c true if the given sample rate conforms to the specification for the - * subset, else \c false. - */ -FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate); - -/** Check a Vorbis comment entry name to see if it conforms to the Vorbis - * comment specification. - * - * Vorbis comment names must be composed only of characters from - * [0x20-0x3C,0x3E-0x7D]. - * - * \param name A NUL-terminated string to be checked. - * \assert - * \code name != NULL \endcode - * \retval FLAC__bool - * \c false if entry name is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name); - -/** Check a Vorbis comment entry value to see if it conforms to the Vorbis - * comment specification. - * - * Vorbis comment values must be valid UTF-8 sequences. - * - * \param value A string to be checked. - * \param length A the length of \a value in bytes. May be - * \c (unsigned)(-1) to indicate that \a value is a plain - * UTF-8 NUL-terminated string. - * \assert - * \code value != NULL \endcode - * \retval FLAC__bool - * \c false if entry name is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, unsigned length); - -/** Check a Vorbis comment entry to see if it conforms to the Vorbis - * comment specification. - * - * Vorbis comment entries must be of the form 'name=value', and 'name' and - * 'value' must be legal according to - * FLAC__format_vorbiscomment_entry_name_is_legal() and - * FLAC__format_vorbiscomment_entry_value_is_legal() respectively. - * - * \param entry An entry to be checked. - * \param length The length of \a entry in bytes. - * \assert - * \code value != NULL \endcode - * \retval FLAC__bool - * \c false if entry name is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length); - -/** Check a seek table to see if it conforms to the FLAC specification. - * See the format specification for limits on the contents of the - * seek table. - * - * \param seek_table A pointer to a seek table to be checked. - * \assert - * \code seek_table != NULL \endcode - * \retval FLAC__bool - * \c false if seek table is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table); - -/** Sort a seek table's seek points according to the format specification. - * This includes a "unique-ification" step to remove duplicates, i.e. - * seek points with identical \a sample_number values. Duplicate seek - * points are converted into placeholder points and sorted to the end of - * the table. - * - * \param seek_table A pointer to a seek table to be sorted. - * \assert - * \code seek_table != NULL \endcode - * \retval unsigned - * The number of duplicate seek points converted into placeholders. - */ -FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table); - -/** Check a cue sheet to see if it conforms to the FLAC specification. - * See the format specification for limits on the contents of the - * cue sheet. - * - * \param cue_sheet A pointer to an existing cue sheet to be checked. - * \param check_cd_da_subset If \c true, check CUESHEET against more - * stringent requirements for a CD-DA (audio) disc. - * \param violation Address of a pointer to a string. If there is a - * violation, a pointer to a string explanation of the - * violation will be returned here. \a violation may be - * \c NULL if you don't need the returned string. Do not - * free the returned string; it will always point to static - * data. - * \assert - * \code cue_sheet != NULL \endcode - * \retval FLAC__bool - * \c false if cue sheet is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation); - -/** Check picture data to see if it conforms to the FLAC specification. - * See the format specification for limits on the contents of the - * PICTURE block. - * - * \param picture A pointer to existing picture data to be checked. - * \param violation Address of a pointer to a string. If there is a - * violation, a pointer to a string explanation of the - * violation will be returned here. \a violation may be - * \c NULL if you don't need the returned string. Do not - * free the returned string; it will always point to static - * data. - * \assert - * \code picture != NULL \endcode - * \retval FLAC__bool - * \c false if picture data is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation); - -/* \} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/MacOSX/codecs/include/FLAC/metadata.h b/MacOSX/codecs/include/FLAC/metadata.h deleted file mode 100644 index fcc8ed95..00000000 --- a/MacOSX/codecs/include/FLAC/metadata.h +++ /dev/null @@ -1,2182 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2013 Xiph.Org Foundation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__METADATA_H -#define FLAC__METADATA_H - -#include <sys/types.h> /* for off_t */ -#include "export.h" -#include "callback.h" -#include "format.h" - -/* -------------------------------------------------------------------- - (For an example of how all these routines are used, see the source - code for the unit tests in src/test_libFLAC/metadata_*.c, or - metaflac in src/metaflac/) - ------------------------------------------------------------------*/ - -/** \file include/FLAC/metadata.h - * - * \brief - * This module provides functions for creating and manipulating FLAC - * metadata blocks in memory, and three progressively more powerful - * interfaces for traversing and editing metadata in FLAC files. - * - * See the detailed documentation for each interface in the - * \link flac_metadata metadata \endlink module. - */ - -/** \defgroup flac_metadata FLAC/metadata.h: metadata interfaces - * \ingroup flac - * - * \brief - * This module provides functions for creating and manipulating FLAC - * metadata blocks in memory, and three progressively more powerful - * interfaces for traversing and editing metadata in native FLAC files. - * Note that currently only the Chain interface (level 2) supports Ogg - * FLAC files, and it is read-only i.e. no writing back changed - * metadata to file. - * - * There are three metadata interfaces of increasing complexity: - * - * Level 0: - * Read-only access to the STREAMINFO, VORBIS_COMMENT, CUESHEET, and - * PICTURE blocks. - * - * Level 1: - * Read-write access to all metadata blocks. This level is write- - * efficient in most cases (more on this below), and uses less memory - * than level 2. - * - * Level 2: - * Read-write access to all metadata blocks. This level is write- - * efficient in all cases, but uses more memory since all metadata for - * the whole file is read into memory and manipulated before writing - * out again. - * - * What do we mean by efficient? Since FLAC metadata appears at the - * beginning of the file, when writing metadata back to a FLAC file - * it is possible to grow or shrink the metadata such that the entire - * file must be rewritten. However, if the size remains the same during - * changes or PADDING blocks are utilized, only the metadata needs to be - * overwritten, which is much faster. - * - * Efficient means the whole file is rewritten at most one time, and only - * when necessary. Level 1 is not efficient only in the case that you - * cause more than one metadata block to grow or shrink beyond what can - * be accomodated by padding. In this case you should probably use level - * 2, which allows you to edit all the metadata for a file in memory and - * write it out all at once. - * - * All levels know how to skip over and not disturb an ID3v2 tag at the - * front of the file. - * - * All levels access files via their filenames. In addition, level 2 - * has additional alternative read and write functions that take an I/O - * handle and callbacks, for situations where access by filename is not - * possible. - * - * In addition to the three interfaces, this module defines functions for - * creating and manipulating various metadata objects in memory. As we see - * from the Format module, FLAC metadata blocks in memory are very primitive - * structures for storing information in an efficient way. Reading - * information from the structures is easy but creating or modifying them - * directly is more complex. The metadata object routines here facilitate - * this by taking care of the consistency and memory management drudgery. - * - * Unless you will be using the level 1 or 2 interfaces to modify existing - * metadata however, you will not probably not need these. - * - * From a dependency standpoint, none of the encoders or decoders require - * the metadata module. This is so that embedded users can strip out the - * metadata module from libFLAC to reduce the size and complexity. - */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup flac_metadata_level0 FLAC/metadata.h: metadata level 0 interface - * \ingroup flac_metadata - * - * \brief - * The level 0 interface consists of individual routines to read the - * STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring - * only a filename. - * - * They try to skip any ID3v2 tag at the head of the file. - * - * \{ - */ - -/** Read the STREAMINFO metadata block of the given FLAC file. This function - * will try to skip any ID3v2 tag at the head of the file. - * - * \param filename The path to the FLAC file to read. - * \param streaminfo A pointer to space for the STREAMINFO block. Since - * FLAC__StreamMetadata is a simple structure with no - * memory allocation involved, you pass the address of - * an existing structure. It need not be initialized. - * \assert - * \code filename != NULL \endcode - * \code streaminfo != NULL \endcode - * \retval FLAC__bool - * \c true if a valid STREAMINFO block was read from \a filename. Returns - * \c false if there was a memory allocation error, a file decoder error, - * or the file contained no STREAMINFO block. (A memory allocation error - * is possible because this function must set up a file decoder.) - */ -FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo); - -/** Read the VORBIS_COMMENT metadata block of the given FLAC file. This - * function will try to skip any ID3v2 tag at the head of the file. - * - * \param filename The path to the FLAC file to read. - * \param tags The address where the returned pointer will be - * stored. The \a tags object must be deleted by - * the caller using FLAC__metadata_object_delete(). - * \assert - * \code filename != NULL \endcode - * \code tags != NULL \endcode - * \retval FLAC__bool - * \c true if a valid VORBIS_COMMENT block was read from \a filename, - * and \a *tags will be set to the address of the metadata structure. - * Returns \c false if there was a memory allocation error, a file - * decoder error, or the file contained no VORBIS_COMMENT block, and - * \a *tags will be set to \c NULL. - */ -FLAC_API FLAC__bool FLAC__metadata_get_tags(const char *filename, FLAC__StreamMetadata **tags); - -/** Read the CUESHEET metadata block of the given FLAC file. This - * function will try to skip any ID3v2 tag at the head of the file. - * - * \param filename The path to the FLAC file to read. - * \param cuesheet The address where the returned pointer will be - * stored. The \a cuesheet object must be deleted by - * the caller using FLAC__metadata_object_delete(). - * \assert - * \code filename != NULL \endcode - * \code cuesheet != NULL \endcode - * \retval FLAC__bool - * \c true if a valid CUESHEET block was read from \a filename, - * and \a *cuesheet will be set to the address of the metadata - * structure. Returns \c false if there was a memory allocation - * error, a file decoder error, or the file contained no CUESHEET - * block, and \a *cuesheet will be set to \c NULL. - */ -FLAC_API FLAC__bool FLAC__metadata_get_cuesheet(const char *filename, FLAC__StreamMetadata **cuesheet); - -/** Read a PICTURE metadata block of the given FLAC file. This - * function will try to skip any ID3v2 tag at the head of the file. - * Since there can be more than one PICTURE block in a file, this - * function takes a number of parameters that act as constraints to - * the search. The PICTURE block with the largest area matching all - * the constraints will be returned, or \a *picture will be set to - * \c NULL if there was no such block. - * - * \param filename The path to the FLAC file to read. - * \param picture The address where the returned pointer will be - * stored. The \a picture object must be deleted by - * the caller using FLAC__metadata_object_delete(). - * \param type The desired picture type. Use \c -1 to mean - * "any type". - * \param mime_type The desired MIME type, e.g. "image/jpeg". The - * string will be matched exactly. Use \c NULL to - * mean "any MIME type". - * \param description The desired description. The string will be - * matched exactly. Use \c NULL to mean "any - * description". - * \param max_width The maximum width in pixels desired. Use - * \c (unsigned)(-1) to mean "any width". - * \param max_height The maximum height in pixels desired. Use - * \c (unsigned)(-1) to mean "any height". - * \param max_depth The maximum color depth in bits-per-pixel desired. - * Use \c (unsigned)(-1) to mean "any depth". - * \param max_colors The maximum number of colors desired. Use - * \c (unsigned)(-1) to mean "any number of colors". - * \assert - * \code filename != NULL \endcode - * \code picture != NULL \endcode - * \retval FLAC__bool - * \c true if a valid PICTURE block was read from \a filename, - * and \a *picture will be set to the address of the metadata - * structure. Returns \c false if there was a memory allocation - * error, a file decoder error, or the file contained no PICTURE - * block, and \a *picture will be set to \c NULL. - */ -FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); - -/* \} */ - - -/** \defgroup flac_metadata_level1 FLAC/metadata.h: metadata level 1 interface - * \ingroup flac_metadata - * - * \brief - * The level 1 interface provides read-write access to FLAC file metadata and - * operates directly on the FLAC file. - * - * The general usage of this interface is: - * - * - Create an iterator using FLAC__metadata_simple_iterator_new() - * - Attach it to a file using FLAC__metadata_simple_iterator_init() and check - * the exit code. Call FLAC__metadata_simple_iterator_is_writable() to - * see if the file is writable, or only read access is allowed. - * - Use FLAC__metadata_simple_iterator_next() and - * FLAC__metadata_simple_iterator_prev() to traverse the blocks. - * This is does not read the actual blocks themselves. - * FLAC__metadata_simple_iterator_next() is relatively fast. - * FLAC__metadata_simple_iterator_prev() is slower since it needs to search - * forward from the front of the file. - * - Use FLAC__metadata_simple_iterator_get_block_type() or - * FLAC__metadata_simple_iterator_get_block() to access the actual data at - * the current iterator position. The returned object is yours to modify - * and free. - * - Use FLAC__metadata_simple_iterator_set_block() to write a modified block - * back. You must have write permission to the original file. Make sure to - * read the whole comment to FLAC__metadata_simple_iterator_set_block() - * below. - * - Use FLAC__metadata_simple_iterator_insert_block_after() to add new blocks. - * Use the object creation functions from - * \link flac_metadata_object here \endlink to generate new objects. - * - Use FLAC__metadata_simple_iterator_delete_block() to remove the block - * currently referred to by the iterator, or replace it with padding. - * - Destroy the iterator with FLAC__metadata_simple_iterator_delete() when - * finished. - * - * \note - * The FLAC file remains open the whole time between - * FLAC__metadata_simple_iterator_init() and - * FLAC__metadata_simple_iterator_delete(), so make sure you are not altering - * the file during this time. - * - * \note - * Do not modify the \a is_last, \a length, or \a type fields of returned - * FLAC__StreamMetadata objects. These are managed automatically. - * - * \note - * If any of the modification functions - * (FLAC__metadata_simple_iterator_set_block(), - * FLAC__metadata_simple_iterator_delete_block(), - * FLAC__metadata_simple_iterator_insert_block_after(), etc.) return \c false, - * you should delete the iterator as it may no longer be valid. - * - * \{ - */ - -struct FLAC__Metadata_SimpleIterator; -/** The opaque structure definition for the level 1 iterator type. - * See the - * \link flac_metadata_level1 metadata level 1 module \endlink - * for a detailed description. - */ -typedef struct FLAC__Metadata_SimpleIterator FLAC__Metadata_SimpleIterator; - -/** Status type for FLAC__Metadata_SimpleIterator. - * - * The iterator's current status can be obtained by calling FLAC__metadata_simple_iterator_status(). - */ -typedef enum { - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0, - /**< The iterator is in the normal OK state */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, - /**< The data passed into a function violated the function's usage criteria */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE, - /**< The iterator could not open the target file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE, - /**< The iterator could not find the FLAC signature at the start of the file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE, - /**< The iterator tried to write to a file that was not writable */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA, - /**< The iterator encountered input that does not conform to the FLAC metadata specification */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR, - /**< The iterator encountered an error while reading the FLAC file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, - /**< The iterator encountered an error while seeking in the FLAC file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR, - /**< The iterator encountered an error while writing the FLAC file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR, - /**< The iterator encountered an error renaming the FLAC file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR, - /**< The iterator encountered an error removing the temporary file */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR, - /**< Memory allocation failed */ - - FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR - /**< The caller violated an assertion or an unexpected error occurred */ - -} FLAC__Metadata_SimpleIteratorStatus; - -/** Maps a FLAC__Metadata_SimpleIteratorStatus to a C string. - * - * Using a FLAC__Metadata_SimpleIteratorStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__Metadata_SimpleIteratorStatusString[]; - - -/** Create a new iterator instance. - * - * \retval FLAC__Metadata_SimpleIterator* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new(void); - -/** Free an iterator instance. Deletes the object pointed to by \a iterator. - * - * \param iterator A pointer to an existing iterator. - * \assert - * \code iterator != NULL \endcode - */ -FLAC_API void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator); - -/** Get the current status of the iterator. Call this after a function - * returns \c false to get the reason for the error. Also resets the status - * to FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK. - * - * \param iterator A pointer to an existing iterator. - * \assert - * \code iterator != NULL \endcode - * \retval FLAC__Metadata_SimpleIteratorStatus - * The current status of the iterator. - */ -FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator); - -/** Initialize the iterator to point to the first metadata block in the - * given FLAC file. - * - * \param iterator A pointer to an existing iterator. - * \param filename The path to the FLAC file. - * \param read_only If \c true, the FLAC file will be opened - * in read-only mode; if \c false, the FLAC - * file will be opened for edit even if no - * edits are performed. - * \param preserve_file_stats If \c true, the owner and modification - * time will be preserved even if the FLAC - * file is written to. - * \assert - * \code iterator != NULL \endcode - * \code filename != NULL \endcode - * \retval FLAC__bool - * \c false if a memory allocation error occurs, the file can't be - * opened, or another error occurs, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats); - -/** Returns \c true if the FLAC file is writable. If \c false, calls to - * FLAC__metadata_simple_iterator_set_block() and - * FLAC__metadata_simple_iterator_insert_block_after() will fail. - * - * \param iterator A pointer to an existing iterator. - * \assert - * \code iterator != NULL \endcode - * \retval FLAC__bool - * See above. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator); - -/** Moves the iterator forward one metadata block, returning \c false if - * already at the end. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__bool - * \c false if already at the last metadata block of the chain, else - * \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator); - -/** Moves the iterator backward one metadata block, returning \c false if - * already at the beginning. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__bool - * \c false if already at the first metadata block of the chain, else - * \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator); - -/** Returns a flag telling if the current metadata block is the last. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__bool - * \c true if the current metadata block is the last in the file, - * else \c false. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_last(const FLAC__Metadata_SimpleIterator *iterator); - -/** Get the offset of the metadata block at the current position. This - * avoids reading the actual block data which can save time for large - * blocks. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval off_t - * The offset of the metadata block at the current iterator position. - * This is the byte offset relative to the beginning of the file of - * the current metadata block's header. - */ -FLAC_API off_t FLAC__metadata_simple_iterator_get_block_offset(const FLAC__Metadata_SimpleIterator *iterator); - -/** Get the type of the metadata block at the current position. This - * avoids reading the actual block data which can save time for large - * blocks. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__MetadataType - * The type of the metadata block at the current iterator position. - */ -FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator); - -/** Get the length of the metadata block at the current position. This - * avoids reading the actual block data which can save time for large - * blocks. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval unsigned - * The length of the metadata block at the current iterator position. - * The is same length as that in the - * <a href="http://flac.sourceforge.net/format.html#metadata_block_header">metadata block header</a>, - * i.e. the length of the metadata body that follows the header. - */ -FLAC_API unsigned FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator); - -/** Get the application ID of the \c APPLICATION block at the current - * position. This avoids reading the actual block data which can save - * time for large blocks. - * - * \param iterator A pointer to an existing initialized iterator. - * \param id A pointer to a buffer of at least \c 4 bytes where - * the ID will be stored. - * \assert - * \code iterator != NULL \endcode - * \code id != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__bool - * \c true if the ID was successfully read, else \c false, in which - * case you should check FLAC__metadata_simple_iterator_status() to - * find out why. If the status is - * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, then the - * current metadata block is not an \c APPLICATION block. Otherwise - * if the status is - * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR or - * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, an I/O error - * occurred and the iterator can no longer be used. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_get_application_id(FLAC__Metadata_SimpleIterator *iterator, FLAC__byte *id); - -/** Get the metadata block at the current position. You can modify the - * block but must use FLAC__metadata_simple_iterator_set_block() to - * write it back to the FLAC file. - * - * You must call FLAC__metadata_object_delete() on the returned object - * when you are finished with it. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__StreamMetadata* - * The current metadata block, or \c NULL if there was a memory - * allocation error. - */ -FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator); - -/** Write a block back to the FLAC file. This function tries to be - * as efficient as possible; how the block is actually written is - * shown by the following: - * - * Existing block is a STREAMINFO block and the new block is a - * STREAMINFO block: the new block is written in place. Make sure - * you know what you're doing when changing the values of a - * STREAMINFO block. - * - * Existing block is a STREAMINFO block and the new block is a - * not a STREAMINFO block: this is an error since the first block - * must be a STREAMINFO block. Returns \c false without altering the - * file. - * - * Existing block is not a STREAMINFO block and the new block is a - * STREAMINFO block: this is an error since there may be only one - * STREAMINFO block. Returns \c false without altering the file. - * - * Existing block and new block are the same length: the existing - * block will be replaced by the new block, written in place. - * - * Existing block is longer than new block: if use_padding is \c true, - * the existing block will be overwritten in place with the new - * block followed by a PADDING block, if possible, to make the total - * size the same as the existing block. Remember that a padding - * block requires at least four bytes so if the difference in size - * between the new block and existing block is less than that, the - * entire file will have to be rewritten, using the new block's - * exact size. If use_padding is \c false, the entire file will be - * rewritten, replacing the existing block by the new block. - * - * Existing block is shorter than new block: if use_padding is \c true, - * the function will try and expand the new block into the following - * PADDING block, if it exists and doing so won't shrink the PADDING - * block to less than 4 bytes. If there is no following PADDING - * block, or it will shrink to less than 4 bytes, or use_padding is - * \c false, the entire file is rewritten, replacing the existing block - * with the new block. Note that in this case any following PADDING - * block is preserved as is. - * - * After writing the block, the iterator will remain in the same - * place, i.e. pointing to the new block. - * - * \param iterator A pointer to an existing initialized iterator. - * \param block The block to set. - * \param use_padding See above. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \code block != NULL \endcode - * \retval FLAC__bool - * \c true if successful, else \c false. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); - -/** This is similar to FLAC__metadata_simple_iterator_set_block() - * except that instead of writing over an existing block, it appends - * a block after the existing block. \a use_padding is again used to - * tell the function to try an expand into following padding in an - * attempt to avoid rewriting the entire file. - * - * This function will fail and return \c false if given a STREAMINFO - * block. - * - * After writing the block, the iterator will be pointing to the - * new block. - * - * \param iterator A pointer to an existing initialized iterator. - * \param block The block to set. - * \param use_padding See above. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \code block != NULL \endcode - * \retval FLAC__bool - * \c true if successful, else \c false. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); - -/** Deletes the block at the current position. This will cause the - * entire FLAC file to be rewritten, unless \a use_padding is \c true, - * in which case the block will be replaced by an equal-sized PADDING - * block. The iterator will be left pointing to the block before the - * one just deleted. - * - * You may not delete the STREAMINFO block. - * - * \param iterator A pointer to an existing initialized iterator. - * \param use_padding See above. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_simple_iterator_init() - * \retval FLAC__bool - * \c true if successful, else \c false. - */ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding); - -/* \} */ - - -/** \defgroup flac_metadata_level2 FLAC/metadata.h: metadata level 2 interface - * \ingroup flac_metadata - * - * \brief - * The level 2 interface provides read-write access to FLAC file metadata; - * all metadata is read into memory, operated on in memory, and then written - * to file, which is more efficient than level 1 when editing multiple blocks. - * - * Currently Ogg FLAC is supported for read only, via - * FLAC__metadata_chain_read_ogg() but a subsequent - * FLAC__metadata_chain_write() will fail. - * - * The general usage of this interface is: - * - * - Create a new chain using FLAC__metadata_chain_new(). A chain is a - * linked list of FLAC metadata blocks. - * - Read all metadata into the the chain from a FLAC file using - * FLAC__metadata_chain_read() or FLAC__metadata_chain_read_ogg() and - * check the status. - * - Optionally, consolidate the padding using - * FLAC__metadata_chain_merge_padding() or - * FLAC__metadata_chain_sort_padding(). - * - Create a new iterator using FLAC__metadata_iterator_new() - * - Initialize the iterator to point to the first element in the chain - * using FLAC__metadata_iterator_init() - * - Traverse the chain using FLAC__metadata_iterator_next and - * FLAC__metadata_iterator_prev(). - * - Get a block for reading or modification using - * FLAC__metadata_iterator_get_block(). The pointer to the object - * inside the chain is returned, so the block is yours to modify. - * Changes will be reflected in the FLAC file when you write the - * chain. You can also add and delete blocks (see functions below). - * - When done, write out the chain using FLAC__metadata_chain_write(). - * Make sure to read the whole comment to the function below. - * - Delete the chain using FLAC__metadata_chain_delete(). - * - * \note - * Even though the FLAC file is not open while the chain is being - * manipulated, you must not alter the file externally during - * this time. The chain assumes the FLAC file will not change - * between the time of FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg() - * and FLAC__metadata_chain_write(). - * - * \note - * Do not modify the is_last, length, or type fields of returned - * FLAC__StreamMetadata objects. These are managed automatically. - * - * \note - * The metadata objects returned by FLAC__metadata_iterator_get_block() - * are owned by the chain; do not FLAC__metadata_object_delete() them. - * In the same way, blocks passed to FLAC__metadata_iterator_set_block() - * become owned by the chain and they will be deleted when the chain is - * deleted. - * - * \{ - */ - -struct FLAC__Metadata_Chain; -/** The opaque structure definition for the level 2 chain type. - */ -typedef struct FLAC__Metadata_Chain FLAC__Metadata_Chain; - -struct FLAC__Metadata_Iterator; -/** The opaque structure definition for the level 2 iterator type. - */ -typedef struct FLAC__Metadata_Iterator FLAC__Metadata_Iterator; - -typedef enum { - FLAC__METADATA_CHAIN_STATUS_OK = 0, - /**< The chain is in the normal OK state */ - - FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT, - /**< The data passed into a function violated the function's usage criteria */ - - FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE, - /**< The chain could not open the target file */ - - FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE, - /**< The chain could not find the FLAC signature at the start of the file */ - - FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE, - /**< The chain tried to write to a file that was not writable */ - - FLAC__METADATA_CHAIN_STATUS_BAD_METADATA, - /**< The chain encountered input that does not conform to the FLAC metadata specification */ - - FLAC__METADATA_CHAIN_STATUS_READ_ERROR, - /**< The chain encountered an error while reading the FLAC file */ - - FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR, - /**< The chain encountered an error while seeking in the FLAC file */ - - FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR, - /**< The chain encountered an error while writing the FLAC file */ - - FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR, - /**< The chain encountered an error renaming the FLAC file */ - - FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR, - /**< The chain encountered an error removing the temporary file */ - - FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR, - /**< Memory allocation failed */ - - FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR, - /**< The caller violated an assertion or an unexpected error occurred */ - - FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS, - /**< One or more of the required callbacks was NULL */ - - FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH, - /**< FLAC__metadata_chain_write() was called on a chain read by - * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), - * or - * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() - * was called on a chain read by - * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). - * Matching read/write methods must always be used. */ - - FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL - /**< FLAC__metadata_chain_write_with_callbacks() was called when the - * chain write requires a tempfile; use - * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. - * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was - * called when the chain write does not require a tempfile; use - * FLAC__metadata_chain_write_with_callbacks() instead. - * Always check FLAC__metadata_chain_check_if_tempfile_needed() - * before writing via callbacks. */ - -} FLAC__Metadata_ChainStatus; - -/** Maps a FLAC__Metadata_ChainStatus to a C string. - * - * Using a FLAC__Metadata_ChainStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__Metadata_ChainStatusString[]; - -/*********** FLAC__Metadata_Chain ***********/ - -/** Create a new chain instance. - * - * \retval FLAC__Metadata_Chain* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__Metadata_Chain *FLAC__metadata_chain_new(void); - -/** Free a chain instance. Deletes the object pointed to by \a chain. - * - * \param chain A pointer to an existing chain. - * \assert - * \code chain != NULL \endcode - */ -FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain); - -/** Get the current status of the chain. Call this after a function - * returns \c false to get the reason for the error. Also resets the - * status to FLAC__METADATA_CHAIN_STATUS_OK. - * - * \param chain A pointer to an existing chain. - * \assert - * \code chain != NULL \endcode - * \retval FLAC__Metadata_ChainStatus - * The current status of the chain. - */ -FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain); - -/** Read all metadata from a FLAC file into the chain. - * - * \param chain A pointer to an existing chain. - * \param filename The path to the FLAC file to read. - * \assert - * \code chain != NULL \endcode - * \code filename != NULL \endcode - * \retval FLAC__bool - * \c true if a valid list of metadata blocks was read from - * \a filename, else \c false. On failure, check the status with - * FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename); - -/** Read all metadata from an Ogg FLAC file into the chain. - * - * \note Ogg FLAC metadata data writing is not supported yet and - * FLAC__metadata_chain_write() will fail. - * - * \param chain A pointer to an existing chain. - * \param filename The path to the Ogg FLAC file to read. - * \assert - * \code chain != NULL \endcode - * \code filename != NULL \endcode - * \retval FLAC__bool - * \c true if a valid list of metadata blocks was read from - * \a filename, else \c false. On failure, check the status with - * FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg(FLAC__Metadata_Chain *chain, const char *filename); - -/** Read all metadata from a FLAC stream into the chain via I/O callbacks. - * - * The \a handle need only be open for reading, but must be seekable. - * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" - * for Windows). - * - * \param chain A pointer to an existing chain. - * \param handle The I/O handle of the FLAC stream to read. The - * handle will NOT be closed after the metadata is read; - * that is the duty of the caller. - * \param callbacks - * A set of callbacks to use for I/O. The mandatory - * callbacks are \a read, \a seek, and \a tell. - * \assert - * \code chain != NULL \endcode - * \retval FLAC__bool - * \c true if a valid list of metadata blocks was read from - * \a handle, else \c false. On failure, check the status with - * FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_read_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); - -/** Read all metadata from an Ogg FLAC stream into the chain via I/O callbacks. - * - * The \a handle need only be open for reading, but must be seekable. - * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" - * for Windows). - * - * \note Ogg FLAC metadata data writing is not supported yet and - * FLAC__metadata_chain_write() will fail. - * - * \param chain A pointer to an existing chain. - * \param handle The I/O handle of the Ogg FLAC stream to read. The - * handle will NOT be closed after the metadata is read; - * that is the duty of the caller. - * \param callbacks - * A set of callbacks to use for I/O. The mandatory - * callbacks are \a read, \a seek, and \a tell. - * \assert - * \code chain != NULL \endcode - * \retval FLAC__bool - * \c true if a valid list of metadata blocks was read from - * \a handle, else \c false. On failure, check the status with - * FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); - -/** Checks if writing the given chain would require the use of a - * temporary file, or if it could be written in place. - * - * Under certain conditions, padding can be utilized so that writing - * edited metadata back to the FLAC file does not require rewriting the - * entire file. If rewriting is required, then a temporary workfile is - * required. When writing metadata using callbacks, you must check - * this function to know whether to call - * FLAC__metadata_chain_write_with_callbacks() or - * FLAC__metadata_chain_write_with_callbacks_and_tempfile(). When - * writing with FLAC__metadata_chain_write(), the temporary file is - * handled internally. - * - * \param chain A pointer to an existing chain. - * \param use_padding - * Whether or not padding will be allowed to be used - * during the write. The value of \a use_padding given - * here must match the value later passed to - * FLAC__metadata_chain_write_with_callbacks() or - * FLAC__metadata_chain_write_with_callbacks_with_tempfile(). - * \assert - * \code chain != NULL \endcode - * \retval FLAC__bool - * \c true if writing the current chain would require a tempfile, or - * \c false if metadata can be written in place. - */ -FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding); - -/** Write all metadata out to the FLAC file. This function tries to be as - * efficient as possible; how the metadata is actually written is shown by - * the following: - * - * If the current chain is the same size as the existing metadata, the new - * data is written in place. - * - * If the current chain is longer than the existing metadata, and - * \a use_padding is \c true, and the last block is a PADDING block of - * sufficient length, the function will truncate the final padding block - * so that the overall size of the metadata is the same as the existing - * metadata, and then just rewrite the metadata. Otherwise, if not all of - * the above conditions are met, the entire FLAC file must be rewritten. - * If you want to use padding this way it is a good idea to call - * FLAC__metadata_chain_sort_padding() first so that you have the maximum - * amount of padding to work with, unless you need to preserve ordering - * of the PADDING blocks for some reason. - * - * If the current chain is shorter than the existing metadata, and - * \a use_padding is \c true, and the final block is a PADDING block, the padding - * is extended to make the overall size the same as the existing data. If - * \a use_padding is \c true and the last block is not a PADDING block, a new - * PADDING block is added to the end of the new data to make it the same - * size as the existing data (if possible, see the note to - * FLAC__metadata_simple_iterator_set_block() about the four byte limit) - * and the new data is written in place. If none of the above apply or - * \a use_padding is \c false, the entire FLAC file is rewritten. - * - * If \a preserve_file_stats is \c true, the owner and modification time will - * be preserved even if the FLAC file is written. - * - * For this write function to be used, the chain must have been read with - * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(), not - * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(). - * - * \param chain A pointer to an existing chain. - * \param use_padding See above. - * \param preserve_file_stats See above. - * \assert - * \code chain != NULL \endcode - * \retval FLAC__bool - * \c true if the write succeeded, else \c false. On failure, - * check the status with FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats); - -/** Write all metadata out to a FLAC stream via callbacks. - * - * (See FLAC__metadata_chain_write() for the details on how padding is - * used to write metadata in place if possible.) - * - * The \a handle must be open for updating and be seekable. The - * equivalent minimum stdio fopen() file mode is \c "r+" (or \c "r+b" - * for Windows). - * - * For this write function to be used, the chain must have been read with - * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), - * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). - * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned - * \c false. - * - * \param chain A pointer to an existing chain. - * \param use_padding See FLAC__metadata_chain_write() - * \param handle The I/O handle of the FLAC stream to write. The - * handle will NOT be closed after the metadata is - * written; that is the duty of the caller. - * \param callbacks A set of callbacks to use for I/O. The mandatory - * callbacks are \a write and \a seek. - * \assert - * \code chain != NULL \endcode - * \retval FLAC__bool - * \c true if the write succeeded, else \c false. On failure, - * check the status with FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); - -/** Write all metadata out to a FLAC stream via callbacks. - * - * (See FLAC__metadata_chain_write() for the details on how padding is - * used to write metadata in place if possible.) - * - * This version of the write-with-callbacks function must be used when - * FLAC__metadata_chain_check_if_tempfile_needed() returns true. In - * this function, you must supply an I/O handle corresponding to the - * FLAC file to edit, and a temporary handle to which the new FLAC - * file will be written. It is the caller's job to move this temporary - * FLAC file on top of the original FLAC file to complete the metadata - * edit. - * - * The \a handle must be open for reading and be seekable. The - * equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" - * for Windows). - * - * The \a temp_handle must be open for writing. The - * equivalent minimum stdio fopen() file mode is \c "w" (or \c "wb" - * for Windows). It should be an empty stream, or at least positioned - * at the start-of-file (in which case it is the caller's duty to - * truncate it on return). - * - * For this write function to be used, the chain must have been read with - * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), - * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). - * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned - * \c true. - * - * \param chain A pointer to an existing chain. - * \param use_padding See FLAC__metadata_chain_write() - * \param handle The I/O handle of the original FLAC stream to read. - * The handle will NOT be closed after the metadata is - * written; that is the duty of the caller. - * \param callbacks A set of callbacks to use for I/O on \a handle. - * The mandatory callbacks are \a read, \a seek, and - * \a eof. - * \param temp_handle The I/O handle of the FLAC stream to write. The - * handle will NOT be closed after the metadata is - * written; that is the duty of the caller. - * \param temp_callbacks - * A set of callbacks to use for I/O on temp_handle. - * The only mandatory callback is \a write. - * \assert - * \code chain != NULL \endcode - * \retval FLAC__bool - * \c true if the write succeeded, else \c false. On failure, - * check the status with FLAC__metadata_chain_status(). - */ -FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks_and_tempfile(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, FLAC__IOHandle temp_handle, FLAC__IOCallbacks temp_callbacks); - -/** Merge adjacent PADDING blocks into a single block. - * - * \note This function does not write to the FLAC file, it only - * modifies the chain. - * - * \warning Any iterator on the current chain will become invalid after this - * call. You should delete the iterator and get a new one. - * - * \param chain A pointer to an existing chain. - * \assert - * \code chain != NULL \endcode - */ -FLAC_API void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain); - -/** This function will move all PADDING blocks to the end on the metadata, - * then merge them into a single block. - * - * \note This function does not write to the FLAC file, it only - * modifies the chain. - * - * \warning Any iterator on the current chain will become invalid after this - * call. You should delete the iterator and get a new one. - * - * \param chain A pointer to an existing chain. - * \assert - * \code chain != NULL \endcode - */ -FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain); - - -/*********** FLAC__Metadata_Iterator ***********/ - -/** Create a new iterator instance. - * - * \retval FLAC__Metadata_Iterator* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void); - -/** Free an iterator instance. Deletes the object pointed to by \a iterator. - * - * \param iterator A pointer to an existing iterator. - * \assert - * \code iterator != NULL \endcode - */ -FLAC_API void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator); - -/** Initialize the iterator to point to the first metadata block in the - * given chain. - * - * \param iterator A pointer to an existing iterator. - * \param chain A pointer to an existing and initialized (read) chain. - * \assert - * \code iterator != NULL \endcode - * \code chain != NULL \endcode - */ -FLAC_API void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain); - -/** Moves the iterator forward one metadata block, returning \c false if - * already at the end. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__bool - * \c false if already at the last metadata block of the chain, else - * \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator); - -/** Moves the iterator backward one metadata block, returning \c false if - * already at the beginning. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__bool - * \c false if already at the first metadata block of the chain, else - * \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator); - -/** Get the type of the metadata block at the current position. - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__MetadataType - * The type of the metadata block at the current iterator position. - */ -FLAC_API FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator); - -/** Get the metadata block at the current position. You can modify - * the block in place but must write the chain before the changes - * are reflected to the FLAC file. You do not need to call - * FLAC__metadata_iterator_set_block() to reflect the changes; - * the pointer returned by FLAC__metadata_iterator_get_block() - * points directly into the chain. - * - * \warning - * Do not call FLAC__metadata_object_delete() on the returned object; - * to delete a block use FLAC__metadata_iterator_delete_block(). - * - * \param iterator A pointer to an existing initialized iterator. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__StreamMetadata* - * The current metadata block. - */ -FLAC_API FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator); - -/** Set the metadata block at the current position, replacing the existing - * block. The new block passed in becomes owned by the chain and it will be - * deleted when the chain is deleted. - * - * \param iterator A pointer to an existing initialized iterator. - * \param block A pointer to a metadata block. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \code block != NULL \endcode - * \retval FLAC__bool - * \c false if the conditions in the above description are not met, or - * a memory allocation error occurs, otherwise \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); - -/** Removes the current block from the chain. If \a replace_with_padding is - * \c true, the block will instead be replaced with a padding block of equal - * size. You can not delete the STREAMINFO block. The iterator will be - * left pointing to the block before the one just "deleted", even if - * \a replace_with_padding is \c true. - * - * \param iterator A pointer to an existing initialized iterator. - * \param replace_with_padding See above. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__bool - * \c false if the conditions in the above description are not met, - * otherwise \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding); - -/** Insert a new block before the current block. You cannot insert a block - * before the first STREAMINFO block. You cannot insert a STREAMINFO block - * as there can be only one, the one that already exists at the head when you - * read in a chain. The chain takes ownership of the new block and it will be - * deleted when the chain is deleted. The iterator will be left pointing to - * the new block. - * - * \param iterator A pointer to an existing initialized iterator. - * \param block A pointer to a metadata block to insert. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__bool - * \c false if the conditions in the above description are not met, or - * a memory allocation error occurs, otherwise \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); - -/** Insert a new block after the current block. You cannot insert a STREAMINFO - * block as there can be only one, the one that already exists at the head when - * you read in a chain. The chain takes ownership of the new block and it will - * be deleted when the chain is deleted. The iterator will be left pointing to - * the new block. - * - * \param iterator A pointer to an existing initialized iterator. - * \param block A pointer to a metadata block to insert. - * \assert - * \code iterator != NULL \endcode - * \a iterator has been successfully initialized with - * FLAC__metadata_iterator_init() - * \retval FLAC__bool - * \c false if the conditions in the above description are not met, or - * a memory allocation error occurs, otherwise \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); - -/* \} */ - - -/** \defgroup flac_metadata_object FLAC/metadata.h: metadata object methods - * \ingroup flac_metadata - * - * \brief - * This module contains methods for manipulating FLAC metadata objects. - * - * Since many are variable length we have to be careful about the memory - * management. We decree that all pointers to data in the object are - * owned by the object and memory-managed by the object. - * - * Use the FLAC__metadata_object_new() and FLAC__metadata_object_delete() - * functions to create all instances. When using the - * FLAC__metadata_object_set_*() functions to set pointers to data, set - * \a copy to \c true to have the function make it's own copy of the data, or - * to \c false to give the object ownership of your data. In the latter case - * your pointer must be freeable by free() and will be free()d when the object - * is FLAC__metadata_object_delete()d. It is legal to pass a null pointer as - * the data pointer to a FLAC__metadata_object_set_*() function as long as - * the length argument is 0 and the \a copy argument is \c false. - * - * The FLAC__metadata_object_new() and FLAC__metadata_object_clone() function - * will return \c NULL in the case of a memory allocation error, otherwise a new - * object. The FLAC__metadata_object_set_*() functions return \c false in the - * case of a memory allocation error. - * - * We don't have the convenience of C++ here, so note that the library relies - * on you to keep the types straight. In other words, if you pass, for - * example, a FLAC__StreamMetadata* that represents a STREAMINFO block to - * FLAC__metadata_object_application_set_data(), you will get an assertion - * failure. - * - * For convenience the FLAC__metadata_object_vorbiscomment_*() functions - * maintain a trailing NUL on each Vorbis comment entry. This is not counted - * toward the length or stored in the stream, but it can make working with plain - * comments (those that don't contain embedded-NULs in the value) easier. - * Entries passed into these functions have trailing NULs added if missing, and - * returned entries are guaranteed to have a trailing NUL. - * - * The FLAC__metadata_object_vorbiscomment_*() functions that take a Vorbis - * comment entry/name/value will first validate that it complies with the Vorbis - * comment specification and return false if it does not. - * - * There is no need to recalculate the length field on metadata blocks you - * have modified. They will be calculated automatically before they are - * written back to a file. - * - * \{ - */ - - -/** Create a new metadata object instance of the given type. - * - * The object will be "empty"; i.e. values and data pointers will be \c 0, - * with the exception of FLAC__METADATA_TYPE_VORBIS_COMMENT, which will have - * the vendor string set (but zero comments). - * - * Do not pass in a value greater than or equal to - * \a FLAC__METADATA_TYPE_UNDEFINED unless you really know what you're - * doing. - * - * \param type Type of object to create - * \retval FLAC__StreamMetadata* - * \c NULL if there was an error allocating memory or the type code is - * greater than FLAC__MAX_METADATA_TYPE_CODE, else the new instance. - */ -FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type); - -/** Create a copy of an existing metadata object. - * - * The copy is a "deep" copy, i.e. dynamically allocated data within the - * object is also copied. The caller takes ownership of the new block and - * is responsible for freeing it with FLAC__metadata_object_delete(). - * - * \param object Pointer to object to copy. - * \assert - * \code object != NULL \endcode - * \retval FLAC__StreamMetadata* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object); - -/** Free a metadata object. Deletes the object pointed to by \a object. - * - * The delete is a "deep" delete, i.e. dynamically allocated data within the - * object is also deleted. - * - * \param object A pointer to an existing object. - * \assert - * \code object != NULL \endcode - */ -FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object); - -/** Compares two metadata objects. - * - * The compare is "deep", i.e. dynamically allocated data within the - * object is also compared. - * - * \param block1 A pointer to an existing object. - * \param block2 A pointer to an existing object. - * \assert - * \code block1 != NULL \endcode - * \code block2 != NULL \endcode - * \retval FLAC__bool - * \c true if objects are identical, else \c false. - */ -FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2); - -/** Sets the application data of an APPLICATION block. - * - * If \a copy is \c true, a copy of the data is stored; otherwise, the object - * takes ownership of the pointer. The existing data will be freed if this - * function is successful, otherwise the original data will remain if \a copy - * is \c true and malloc() fails. - * - * \note It is safe to pass a const pointer to \a data if \a copy is \c true. - * - * \param object A pointer to an existing APPLICATION object. - * \param data A pointer to the data to set. - * \param length The length of \a data in bytes. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_APPLICATION \endcode - * \code (data != NULL && length > 0) || - * (data == NULL && length == 0 && copy == false) \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy); - -/** Resize the seekpoint array. - * - * If the size shrinks, elements will truncated; if it grows, new placeholder - * points will be added to the end. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param new_num_points The desired length of the array; may be \c 0. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \code (object->data.seek_table.points == NULL && object->data.seek_table.num_points == 0) || - * (object->data.seek_table.points != NULL && object->data.seek_table.num_points > 0) \endcode - * \retval FLAC__bool - * \c false if memory allocation error, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points); - -/** Set a seekpoint in a seektable. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param point_num Index into seekpoint array to set. - * \param point The point to set. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \code object->data.seek_table.num_points > point_num \endcode - */ -FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); - -/** Insert a seekpoint into a seektable. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param point_num Index into seekpoint array to set. - * \param point The point to set. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \code object->data.seek_table.num_points >= point_num \endcode - * \retval FLAC__bool - * \c false if memory allocation error, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); - -/** Delete a seekpoint from a seektable. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param point_num Index into seekpoint array to set. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \code object->data.seek_table.num_points > point_num \endcode - * \retval FLAC__bool - * \c false if memory allocation error, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num); - -/** Check a seektable to see if it conforms to the FLAC specification. - * See the format specification for limits on the contents of the - * seektable. - * - * \param object A pointer to an existing SEEKTABLE object. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \retval FLAC__bool - * \c false if seek table is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object); - -/** Append a number of placeholder points to the end of a seek table. - * - * \note - * As with the other ..._seektable_template_... functions, you should - * call FLAC__metadata_object_seektable_template_sort() when finished - * to make the seek table legal. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param num The number of placeholder points to append. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \retval FLAC__bool - * \c false if memory allocation fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num); - -/** Append a specific seek point template to the end of a seek table. - * - * \note - * As with the other ..._seektable_template_... functions, you should - * call FLAC__metadata_object_seektable_template_sort() when finished - * to make the seek table legal. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param sample_number The sample number of the seek point template. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \retval FLAC__bool - * \c false if memory allocation fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number); - -/** Append specific seek point templates to the end of a seek table. - * - * \note - * As with the other ..._seektable_template_... functions, you should - * call FLAC__metadata_object_seektable_template_sort() when finished - * to make the seek table legal. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param sample_numbers An array of sample numbers for the seek points. - * \param num The number of seek point templates to append. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \retval FLAC__bool - * \c false if memory allocation fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num); - -/** Append a set of evenly-spaced seek point templates to the end of a - * seek table. - * - * \note - * As with the other ..._seektable_template_... functions, you should - * call FLAC__metadata_object_seektable_template_sort() when finished - * to make the seek table legal. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param num The number of placeholder points to append. - * \param total_samples The total number of samples to be encoded; - * the seekpoints will be spaced approximately - * \a total_samples / \a num samples apart. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \code total_samples > 0 \endcode - * \retval FLAC__bool - * \c false if memory allocation fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples); - -/** Append a set of evenly-spaced seek point templates to the end of a - * seek table. - * - * \note - * As with the other ..._seektable_template_... functions, you should - * call FLAC__metadata_object_seektable_template_sort() when finished - * to make the seek table legal. - * - * \param object A pointer to an existing SEEKTABLE object. - * \param samples The number of samples apart to space the placeholder - * points. The first point will be at sample \c 0, the - * second at sample \a samples, then 2*\a samples, and - * so on. As long as \a samples and \a total_samples - * are greater than \c 0, there will always be at least - * one seekpoint at sample \c 0. - * \param total_samples The total number of samples to be encoded; - * the seekpoints will be spaced - * \a samples samples apart. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \code samples > 0 \endcode - * \code total_samples > 0 \endcode - * \retval FLAC__bool - * \c false if memory allocation fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(FLAC__StreamMetadata *object, unsigned samples, FLAC__uint64 total_samples); - -/** Sort a seek table's seek points according to the format specification, - * removing duplicates. - * - * \param object A pointer to a seek table to be sorted. - * \param compact If \c false, behaves like FLAC__format_seektable_sort(). - * If \c true, duplicates are deleted and the seek table is - * shrunk appropriately; the number of placeholder points - * present in the seek table will be the same after the call - * as before. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode - * \retval FLAC__bool - * \c false if realloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact); - -/** Sets the vendor string in a VORBIS_COMMENT block. - * - * For convenience, a trailing NUL is added to the entry if it doesn't have - * one already. - * - * If \a copy is \c true, a copy of the entry is stored; otherwise, the object - * takes ownership of the \c entry.entry pointer. - * - * \note If this function returns \c false, the caller still owns the - * pointer. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param entry The entry to set the vendor string to. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code (entry.entry != NULL && entry.length > 0) || - * (entry.entry == NULL && entry.length == 0) \endcode - * \retval FLAC__bool - * \c false if memory allocation fails or \a entry does not comply with the - * Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); - -/** Resize the comment array. - * - * If the size shrinks, elements will truncated; if it grows, new empty - * fields will be added to the end. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param new_num_comments The desired length of the array; may be \c 0. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code (object->data.vorbis_comment.comments == NULL && object->data.vorbis_comment.num_comments == 0) || - * (object->data.vorbis_comment.comments != NULL && object->data.vorbis_comment.num_comments > 0) \endcode - * \retval FLAC__bool - * \c false if memory allocation fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments); - -/** Sets a comment in a VORBIS_COMMENT block. - * - * For convenience, a trailing NUL is added to the entry if it doesn't have - * one already. - * - * If \a copy is \c true, a copy of the entry is stored; otherwise, the object - * takes ownership of the \c entry.entry pointer. - * - * \note If this function returns \c false, the caller still owns the - * pointer. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param comment_num Index into comment array to set. - * \param entry The entry to set the comment to. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code comment_num < object->data.vorbis_comment.num_comments \endcode - * \code (entry.entry != NULL && entry.length > 0) || - * (entry.entry == NULL && entry.length == 0) \endcode - * \retval FLAC__bool - * \c false if memory allocation fails or \a entry does not comply with the - * Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); - -/** Insert a comment in a VORBIS_COMMENT block at the given index. - * - * For convenience, a trailing NUL is added to the entry if it doesn't have - * one already. - * - * If \a copy is \c true, a copy of the entry is stored; otherwise, the object - * takes ownership of the \c entry.entry pointer. - * - * \note If this function returns \c false, the caller still owns the - * pointer. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param comment_num The index at which to insert the comment. The comments - * at and after \a comment_num move right one position. - * To append a comment to the end, set \a comment_num to - * \c object->data.vorbis_comment.num_comments . - * \param entry The comment to insert. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code object->data.vorbis_comment.num_comments >= comment_num \endcode - * \code (entry.entry != NULL && entry.length > 0) || - * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode - * \retval FLAC__bool - * \c false if memory allocation fails or \a entry does not comply with the - * Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); - -/** Appends a comment to a VORBIS_COMMENT block. - * - * For convenience, a trailing NUL is added to the entry if it doesn't have - * one already. - * - * If \a copy is \c true, a copy of the entry is stored; otherwise, the object - * takes ownership of the \c entry.entry pointer. - * - * \note If this function returns \c false, the caller still owns the - * pointer. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param entry The comment to insert. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code (entry.entry != NULL && entry.length > 0) || - * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode - * \retval FLAC__bool - * \c false if memory allocation fails or \a entry does not comply with the - * Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_append_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); - -/** Replaces comments in a VORBIS_COMMENT block with a new one. - * - * For convenience, a trailing NUL is added to the entry if it doesn't have - * one already. - * - * Depending on the the value of \a all, either all or just the first comment - * whose field name(s) match the given entry's name will be replaced by the - * given entry. If no comments match, \a entry will simply be appended. - * - * If \a copy is \c true, a copy of the entry is stored; otherwise, the object - * takes ownership of the \c entry.entry pointer. - * - * \note If this function returns \c false, the caller still owns the - * pointer. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param entry The comment to insert. - * \param all If \c true, all comments whose field name matches - * \a entry's field name will be removed, and \a entry will - * be inserted at the position of the first matching - * comment. If \c false, only the first comment whose - * field name matches \a entry's field name will be - * replaced with \a entry. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code (entry.entry != NULL && entry.length > 0) || - * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode - * \retval FLAC__bool - * \c false if memory allocation fails or \a entry does not comply with the - * Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_replace_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool all, FLAC__bool copy); - -/** Delete a comment in a VORBIS_COMMENT block at the given index. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param comment_num The index of the comment to delete. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code object->data.vorbis_comment.num_comments > comment_num \endcode - * \retval FLAC__bool - * \c false if realloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num); - -/** Creates a Vorbis comment entry from NUL-terminated name and value strings. - * - * On return, the filled-in \a entry->entry pointer will point to malloc()ed - * memory and shall be owned by the caller. For convenience the entry will - * have a terminating NUL. - * - * \param entry A pointer to a Vorbis comment entry. The entry's - * \c entry pointer should not point to allocated - * memory as it will be overwritten. - * \param field_name The field name in ASCII, \c NUL terminated. - * \param field_value The field value in UTF-8, \c NUL terminated. - * \assert - * \code entry != NULL \endcode - * \code field_name != NULL \endcode - * \code field_value != NULL \endcode - * \retval FLAC__bool - * \c false if malloc() fails, or if \a field_name or \a field_value does - * not comply with the Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field_name, const char *field_value); - -/** Splits a Vorbis comment entry into NUL-terminated name and value strings. - * - * The returned pointers to name and value will be allocated by malloc() - * and shall be owned by the caller. - * - * \param entry An existing Vorbis comment entry. - * \param field_name The address of where the returned pointer to the - * field name will be stored. - * \param field_value The address of where the returned pointer to the - * field value will be stored. - * \assert - * \code (entry.entry != NULL && entry.length > 0) \endcode - * \code memchr(entry.entry, '=', entry.length) != NULL \endcode - * \code field_name != NULL \endcode - * \code field_value != NULL \endcode - * \retval FLAC__bool - * \c false if memory allocation fails or \a entry does not comply with the - * Vorbis comment specification, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(const FLAC__StreamMetadata_VorbisComment_Entry entry, char **field_name, char **field_value); - -/** Check if the given Vorbis comment entry's field name matches the given - * field name. - * - * \param entry An existing Vorbis comment entry. - * \param field_name The field name to check. - * \param field_name_length The length of \a field_name, not including the - * terminating \c NUL. - * \assert - * \code (entry.entry != NULL && entry.length > 0) \endcode - * \retval FLAC__bool - * \c true if the field names match, else \c false - */ -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC__StreamMetadata_VorbisComment_Entry entry, const char *field_name, unsigned field_name_length); - -/** Find a Vorbis comment with the given field name. - * - * The search begins at entry number \a offset; use an offset of 0 to - * search from the beginning of the comment array. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param offset The offset into the comment array from where to start - * the search. - * \param field_name The field name of the comment to find. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \code field_name != NULL \endcode - * \retval int - * The offset in the comment array of the first comment whose field - * name matches \a field_name, or \c -1 if no match was found. - */ -FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name); - -/** Remove first Vorbis comment matching the given field name. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param field_name The field name of comment to delete. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \retval int - * \c -1 for memory allocation error, \c 0 for no matching entries, - * \c 1 for one matching entry deleted. - */ -FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object, const char *field_name); - -/** Remove all Vorbis comments matching the given field name. - * - * \param object A pointer to an existing VORBIS_COMMENT object. - * \param field_name The field name of comments to delete. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode - * \retval int - * \c -1 for memory allocation error, \c 0 for no matching entries, - * else the number of matching entries deleted. - */ -FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name); - -/** Create a new CUESHEET track instance. - * - * The object will be "empty"; i.e. values and data pointers will be \c 0. - * - * \retval FLAC__StreamMetadata_CueSheet_Track* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new(void); - -/** Create a copy of an existing CUESHEET track object. - * - * The copy is a "deep" copy, i.e. dynamically allocated data within the - * object is also copied. The caller takes ownership of the new object and - * is responsible for freeing it with - * FLAC__metadata_object_cuesheet_track_delete(). - * - * \param object Pointer to object to copy. - * \assert - * \code object != NULL \endcode - * \retval FLAC__StreamMetadata_CueSheet_Track* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object); - -/** Delete a CUESHEET track object - * - * \param object A pointer to an existing CUESHEET track object. - * \assert - * \code object != NULL \endcode - */ -FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object); - -/** Resize a track's index point array. - * - * If the size shrinks, elements will truncated; if it grows, new blank - * indices will be added to the end. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index of the track to modify. NOTE: this is not - * necessarily the same as the track's \a number field. - * \param new_num_indices The desired length of the array; may be \c 0. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks > track_num \endcode - * \code (object->data.cue_sheet.tracks[track_num].indices == NULL && object->data.cue_sheet.tracks[track_num].num_indices == 0) || - * (object->data.cue_sheet.tracks[track_num].indices != NULL && object->data.cue_sheet.tracks[track_num].num_indices > 0) \endcode - * \retval FLAC__bool - * \c false if memory allocation error, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices); - -/** Insert an index point in a CUESHEET track at the given index. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index of the track to modify. NOTE: this is not - * necessarily the same as the track's \a number field. - * \param index_num The index into the track's index array at which to - * insert the index point. NOTE: this is not necessarily - * the same as the index point's \a number field. The - * indices at and after \a index_num move right one - * position. To append an index point to the end, set - * \a index_num to - * \c object->data.cue_sheet.tracks[track_num].num_indices . - * \param index The index point to insert. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks > track_num \endcode - * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode - * \retval FLAC__bool - * \c false if realloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index); - -/** Insert a blank index point in a CUESHEET track at the given index. - * - * A blank index point is one in which all field values are zero. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index of the track to modify. NOTE: this is not - * necessarily the same as the track's \a number field. - * \param index_num The index into the track's index array at which to - * insert the index point. NOTE: this is not necessarily - * the same as the index point's \a number field. The - * indices at and after \a index_num move right one - * position. To append an index point to the end, set - * \a index_num to - * \c object->data.cue_sheet.tracks[track_num].num_indices . - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks > track_num \endcode - * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode - * \retval FLAC__bool - * \c false if realloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); - -/** Delete an index point in a CUESHEET track at the given index. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index into the track array of the track to - * modify. NOTE: this is not necessarily the same - * as the track's \a number field. - * \param index_num The index into the track's index array of the index - * to delete. NOTE: this is not necessarily the same - * as the index's \a number field. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks > track_num \endcode - * \code object->data.cue_sheet.tracks[track_num].num_indices > index_num \endcode - * \retval FLAC__bool - * \c false if realloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); - -/** Resize the track array. - * - * If the size shrinks, elements will truncated; if it grows, new blank - * tracks will be added to the end. - * - * \param object A pointer to an existing CUESHEET object. - * \param new_num_tracks The desired length of the array; may be \c 0. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code (object->data.cue_sheet.tracks == NULL && object->data.cue_sheet.num_tracks == 0) || - * (object->data.cue_sheet.tracks != NULL && object->data.cue_sheet.num_tracks > 0) \endcode - * \retval FLAC__bool - * \c false if memory allocation error, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsigned new_num_tracks); - -/** Sets a track in a CUESHEET block. - * - * If \a copy is \c true, a copy of the track is stored; otherwise, the object - * takes ownership of the \a track pointer. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num Index into track array to set. NOTE: this is not - * necessarily the same as the track's \a number field. - * \param track The track to set the track to. You may safely pass in - * a const pointer if \a copy is \c true. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code track_num < object->data.cue_sheet.num_tracks \endcode - * \code (track->indices != NULL && track->num_indices > 0) || - * (track->indices == NULL && track->num_indices == 0) \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); - -/** Insert a track in a CUESHEET block at the given index. - * - * If \a copy is \c true, a copy of the track is stored; otherwise, the object - * takes ownership of the \a track pointer. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index at which to insert the track. NOTE: this - * is not necessarily the same as the track's \a number - * field. The tracks at and after \a track_num move right - * one position. To append a track to the end, set - * \a track_num to \c object->data.cue_sheet.num_tracks . - * \param track The track to insert. You may safely pass in a const - * pointer if \a copy is \c true. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks >= track_num \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); - -/** Insert a blank track in a CUESHEET block at the given index. - * - * A blank track is one in which all field values are zero. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index at which to insert the track. NOTE: this - * is not necessarily the same as the track's \a number - * field. The tracks at and after \a track_num move right - * one position. To append a track to the end, set - * \a track_num to \c object->data.cue_sheet.num_tracks . - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks >= track_num \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object, unsigned track_num); - -/** Delete a track in a CUESHEET block at the given index. - * - * \param object A pointer to an existing CUESHEET object. - * \param track_num The index into the track array of the track to - * delete. NOTE: this is not necessarily the same - * as the track's \a number field. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \code object->data.cue_sheet.num_tracks > track_num \endcode - * \retval FLAC__bool - * \c false if realloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsigned track_num); - -/** Check a cue sheet to see if it conforms to the FLAC specification. - * See the format specification for limits on the contents of the - * cue sheet. - * - * \param object A pointer to an existing CUESHEET object. - * \param check_cd_da_subset If \c true, check CUESHEET against more - * stringent requirements for a CD-DA (audio) disc. - * \param violation Address of a pointer to a string. If there is a - * violation, a pointer to a string explanation of the - * violation will be returned here. \a violation may be - * \c NULL if you don't need the returned string. Do not - * free the returned string; it will always point to static - * data. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \retval FLAC__bool - * \c false if cue sheet is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation); - -/** Calculate and return the CDDB/freedb ID for a cue sheet. The function - * assumes the cue sheet corresponds to a CD; the result is undefined - * if the cuesheet's is_cd bit is not set. - * - * \param object A pointer to an existing CUESHEET object. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode - * \retval FLAC__uint32 - * The unsigned integer representation of the CDDB/freedb ID - */ -FLAC_API FLAC__uint32 FLAC__metadata_object_cuesheet_calculate_cddb_id(const FLAC__StreamMetadata *object); - -/** Sets the MIME type of a PICTURE block. - * - * If \a copy is \c true, a copy of the string is stored; otherwise, the object - * takes ownership of the pointer. The existing string will be freed if this - * function is successful, otherwise the original string will remain if \a copy - * is \c true and malloc() fails. - * - * \note It is safe to pass a const pointer to \a mime_type if \a copy is \c true. - * - * \param object A pointer to an existing PICTURE object. - * \param mime_type A pointer to the MIME type string. The string must be - * ASCII characters 0x20-0x7e, NUL-terminated. No validation - * is done. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode - * \code (mime_type != NULL) \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_picture_set_mime_type(FLAC__StreamMetadata *object, char *mime_type, FLAC__bool copy); - -/** Sets the description of a PICTURE block. - * - * If \a copy is \c true, a copy of the string is stored; otherwise, the object - * takes ownership of the pointer. The existing string will be freed if this - * function is successful, otherwise the original string will remain if \a copy - * is \c true and malloc() fails. - * - * \note It is safe to pass a const pointer to \a description if \a copy is \c true. - * - * \param object A pointer to an existing PICTURE object. - * \param description A pointer to the description string. The string must be - * valid UTF-8, NUL-terminated. No validation is done. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode - * \code (description != NULL) \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object, FLAC__byte *description, FLAC__bool copy); - -/** Sets the picture data of a PICTURE block. - * - * If \a copy is \c true, a copy of the data is stored; otherwise, the object - * takes ownership of the pointer. Also sets the \a data_length field of the - * metadata object to what is passed in as the \a length parameter. The - * existing data will be freed if this function is successful, otherwise the - * original data and data_length will remain if \a copy is \c true and - * malloc() fails. - * - * \note It is safe to pass a const pointer to \a data if \a copy is \c true. - * - * \param object A pointer to an existing PICTURE object. - * \param data A pointer to the data to set. - * \param length The length of \a data in bytes. - * \param copy See above. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode - * \code (data != NULL && length > 0) || - * (data == NULL && length == 0 && copy == false) \endcode - * \retval FLAC__bool - * \c false if \a copy is \c true and malloc() fails, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, FLAC__uint32 length, FLAC__bool copy); - -/** Check a PICTURE block to see if it conforms to the FLAC specification. - * See the format specification for limits on the contents of the - * PICTURE block. - * - * \param object A pointer to existing PICTURE block to be checked. - * \param violation Address of a pointer to a string. If there is a - * violation, a pointer to a string explanation of the - * violation will be returned here. \a violation may be - * \c NULL if you don't need the returned string. Do not - * free the returned string; it will always point to static - * data. - * \assert - * \code object != NULL \endcode - * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode - * \retval FLAC__bool - * \c false if PICTURE block is illegal, else \c true. - */ -FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation); - -/* \} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/MacOSX/codecs/include/FLAC/ordinals.h b/MacOSX/codecs/include/FLAC/ordinals.h deleted file mode 100644 index a0572997..00000000 --- a/MacOSX/codecs/include/FLAC/ordinals.h +++ /dev/null @@ -1,86 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2013 Xiph.Org Foundation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__ORDINALS_H -#define FLAC__ORDINALS_H - -#if defined(_MSC_VER) && _MSC_VER < 1600 - -/* Microsoft Visual Studio earlier than the 2010 version did not provide - * the 1999 ISO C Standard header file <stdint.h>. - */ - -typedef __int8 FLAC__int8; -typedef unsigned __int8 FLAC__uint8; - -typedef __int16 FLAC__int16; -typedef __int32 FLAC__int32; -typedef __int64 FLAC__int64; -typedef unsigned __int16 FLAC__uint16; -typedef unsigned __int32 FLAC__uint32; -typedef unsigned __int64 FLAC__uint64; - -#else - -/* For MSVC 2010 and everything else which provides <stdint.h>. */ - -#include <stdint.h> - -typedef int8_t FLAC__int8; -typedef uint8_t FLAC__uint8; - -typedef int16_t FLAC__int16; -typedef int32_t FLAC__int32; -typedef int64_t FLAC__int64; -typedef uint16_t FLAC__uint16; -typedef uint32_t FLAC__uint32; -typedef uint64_t FLAC__uint64; - -#endif - -typedef int FLAC__bool; - -typedef FLAC__uint8 FLAC__byte; - - -#ifdef true -#undef true -#endif -#ifdef false -#undef false -#endif -#ifndef __cplusplus -#define true 1 -#define false 0 -#endif - -#endif diff --git a/MacOSX/codecs/include/FLAC/stream_decoder.h b/MacOSX/codecs/include/FLAC/stream_decoder.h deleted file mode 100644 index 99a12a31..00000000 --- a/MacOSX/codecs/include/FLAC/stream_decoder.h +++ /dev/null @@ -1,1559 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2013 Xiph.Org Foundation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__STREAM_DECODER_H -#define FLAC__STREAM_DECODER_H - -#include <stdio.h> /* for FILE */ -#include "export.h" -#include "format.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \file include/FLAC/stream_decoder.h - * - * \brief - * This module contains the functions which implement the stream - * decoder. - * - * See the detailed documentation in the - * \link flac_stream_decoder stream decoder \endlink module. - */ - -/** \defgroup flac_decoder FLAC/ \*_decoder.h: decoder interfaces - * \ingroup flac - * - * \brief - * This module describes the decoder layers provided by libFLAC. - * - * The stream decoder can be used to decode complete streams either from - * the client via callbacks, or directly from a file, depending on how - * it is initialized. When decoding via callbacks, the client provides - * callbacks for reading FLAC data and writing decoded samples, and - * handling metadata and errors. If the client also supplies seek-related - * callback, the decoder function for sample-accurate seeking within the - * FLAC input is also available. When decoding from a file, the client - * needs only supply a filename or open \c FILE* and write/metadata/error - * callbacks; the rest of the callbacks are supplied internally. For more - * info see the \link flac_stream_decoder stream decoder \endlink module. - */ - -/** \defgroup flac_stream_decoder FLAC/stream_decoder.h: stream decoder interface - * \ingroup flac_decoder - * - * \brief - * This module contains the functions which implement the stream - * decoder. - * - * The stream decoder can decode native FLAC, and optionally Ogg FLAC - * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. - * - * The basic usage of this decoder is as follows: - * - The program creates an instance of a decoder using - * FLAC__stream_decoder_new(). - * - The program overrides the default settings using - * FLAC__stream_decoder_set_*() functions. - * - The program initializes the instance to validate the settings and - * prepare for decoding using - * - FLAC__stream_decoder_init_stream() or FLAC__stream_decoder_init_FILE() - * or FLAC__stream_decoder_init_file() for native FLAC, - * - FLAC__stream_decoder_init_ogg_stream() or FLAC__stream_decoder_init_ogg_FILE() - * or FLAC__stream_decoder_init_ogg_file() for Ogg FLAC - * - The program calls the FLAC__stream_decoder_process_*() functions - * to decode data, which subsequently calls the callbacks. - * - The program finishes the decoding with FLAC__stream_decoder_finish(), - * which flushes the input and output and resets the decoder to the - * uninitialized state. - * - The instance may be used again or deleted with - * FLAC__stream_decoder_delete(). - * - * In more detail, the program will create a new instance by calling - * FLAC__stream_decoder_new(), then call FLAC__stream_decoder_set_*() - * functions to override the default decoder options, and call - * one of the FLAC__stream_decoder_init_*() functions. - * - * There are three initialization functions for native FLAC, one for - * setting up the decoder to decode FLAC data from the client via - * callbacks, and two for decoding directly from a FLAC file. - * - * For decoding via callbacks, use FLAC__stream_decoder_init_stream(). - * You must also supply several callbacks for handling I/O. Some (like - * seeking) are optional, depending on the capabilities of the input. - * - * For decoding directly from a file, use FLAC__stream_decoder_init_FILE() - * or FLAC__stream_decoder_init_file(). Then you must only supply an open - * \c FILE* or filename and fewer callbacks; the decoder will handle - * the other callbacks internally. - * - * There are three similarly-named init functions for decoding from Ogg - * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the - * library has been built with Ogg support. - * - * Once the decoder is initialized, your program will call one of several - * functions to start the decoding process: - * - * - FLAC__stream_decoder_process_single() - Tells the decoder to process at - * most one metadata block or audio frame and return, calling either the - * metadata callback or write callback, respectively, once. If the decoder - * loses sync it will return with only the error callback being called. - * - FLAC__stream_decoder_process_until_end_of_metadata() - Tells the decoder - * to process the stream from the current location and stop upon reaching - * the first audio frame. The client will get one metadata, write, or error - * callback per metadata block, audio frame, or sync error, respectively. - * - FLAC__stream_decoder_process_until_end_of_stream() - Tells the decoder - * to process the stream from the current location until the read callback - * returns FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM or - * FLAC__STREAM_DECODER_READ_STATUS_ABORT. The client will get one metadata, - * write, or error callback per metadata block, audio frame, or sync error, - * respectively. - * - * When the decoder has finished decoding (normally or through an abort), - * the instance is finished by calling FLAC__stream_decoder_finish(), which - * ensures the decoder is in the correct state and frees memory. Then the - * instance may be deleted with FLAC__stream_decoder_delete() or initialized - * again to decode another stream. - * - * Seeking is exposed through the FLAC__stream_decoder_seek_absolute() method. - * At any point after the stream decoder has been initialized, the client can - * call this function to seek to an exact sample within the stream. - * Subsequently, the first time the write callback is called it will be - * passed a (possibly partial) block starting at that sample. - * - * If the client cannot seek via the callback interface provided, but still - * has another way of seeking, it can flush the decoder using - * FLAC__stream_decoder_flush() and start feeding data from the new position - * through the read callback. - * - * The stream decoder also provides MD5 signature checking. If this is - * turned on before initialization, FLAC__stream_decoder_finish() will - * report when the decoded MD5 signature does not match the one stored - * in the STREAMINFO block. MD5 checking is automatically turned off - * (until the next FLAC__stream_decoder_reset()) if there is no signature - * in the STREAMINFO block or when a seek is attempted. - * - * The FLAC__stream_decoder_set_metadata_*() functions deserve special - * attention. By default, the decoder only calls the metadata_callback for - * the STREAMINFO block. These functions allow you to tell the decoder - * explicitly which blocks to parse and return via the metadata_callback - * and/or which to skip. Use a FLAC__stream_decoder_set_metadata_respond_all(), - * FLAC__stream_decoder_set_metadata_ignore() ... or FLAC__stream_decoder_set_metadata_ignore_all(), - * FLAC__stream_decoder_set_metadata_respond() ... sequence to exactly specify - * which blocks to return. Remember that metadata blocks can potentially - * be big (for example, cover art) so filtering out the ones you don't - * use can reduce the memory requirements of the decoder. Also note the - * special forms FLAC__stream_decoder_set_metadata_respond_application(id) - * and FLAC__stream_decoder_set_metadata_ignore_application(id) for - * filtering APPLICATION blocks based on the application ID. - * - * STREAMINFO and SEEKTABLE blocks are always parsed and used internally, but - * they still can legally be filtered from the metadata_callback. - * - * \note - * The "set" functions may only be called when the decoder is in the - * state FLAC__STREAM_DECODER_UNINITIALIZED, i.e. after - * FLAC__stream_decoder_new() or FLAC__stream_decoder_finish(), but - * before FLAC__stream_decoder_init_*(). If this is the case they will - * return \c true, otherwise \c false. - * - * \note - * FLAC__stream_decoder_finish() resets all settings to the constructor - * defaults, including the callbacks. - * - * \{ - */ - - -/** State values for a FLAC__StreamDecoder - * - * The decoder's state can be obtained by calling FLAC__stream_decoder_get_state(). - */ -typedef enum { - - FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0, - /**< The decoder is ready to search for metadata. */ - - FLAC__STREAM_DECODER_READ_METADATA, - /**< The decoder is ready to or is in the process of reading metadata. */ - - FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, - /**< The decoder is ready to or is in the process of searching for the - * frame sync code. - */ - - FLAC__STREAM_DECODER_READ_FRAME, - /**< The decoder is ready to or is in the process of reading a frame. */ - - FLAC__STREAM_DECODER_END_OF_STREAM, - /**< The decoder has reached the end of the stream. */ - - FLAC__STREAM_DECODER_OGG_ERROR, - /**< An error occurred in the underlying Ogg layer. */ - - FLAC__STREAM_DECODER_SEEK_ERROR, - /**< An error occurred while seeking. The decoder must be flushed - * with FLAC__stream_decoder_flush() or reset with - * FLAC__stream_decoder_reset() before decoding can continue. - */ - - FLAC__STREAM_DECODER_ABORTED, - /**< The decoder was aborted by the read or write callback. */ - - FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, - /**< An error occurred allocating memory. The decoder is in an invalid - * state and can no longer be used. - */ - - FLAC__STREAM_DECODER_UNINITIALIZED - /**< The decoder is in the uninitialized state; one of the - * FLAC__stream_decoder_init_*() functions must be called before samples - * can be processed. - */ - -} FLAC__StreamDecoderState; - -/** Maps a FLAC__StreamDecoderState to a C string. - * - * Using a FLAC__StreamDecoderState as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderStateString[]; - - -/** Possible return values for the FLAC__stream_decoder_init_*() functions. - */ -typedef enum { - - FLAC__STREAM_DECODER_INIT_STATUS_OK = 0, - /**< Initialization was successful. */ - - FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, - /**< The library was not compiled with support for the given container - * format. - */ - - FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, - /**< A required callback was not supplied. */ - - FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR, - /**< An error occurred allocating memory. */ - - FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, - /**< fopen() failed in FLAC__stream_decoder_init_file() or - * FLAC__stream_decoder_init_ogg_file(). */ - - FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED - /**< FLAC__stream_decoder_init_*() was called when the decoder was - * already initialized, usually because - * FLAC__stream_decoder_finish() was not called. - */ - -} FLAC__StreamDecoderInitStatus; - -/** Maps a FLAC__StreamDecoderInitStatus to a C string. - * - * Using a FLAC__StreamDecoderInitStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderInitStatusString[]; - - -/** Return values for the FLAC__StreamDecoder read callback. - */ -typedef enum { - - FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, - /**< The read was OK and decoding can continue. */ - - FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, - /**< The read was attempted while at the end of the stream. Note that - * the client must only return this value when the read callback was - * called when already at the end of the stream. Otherwise, if the read - * itself moves to the end of the stream, the client should still return - * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on - * the next read callback it should return - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count - * of \c 0. - */ - - FLAC__STREAM_DECODER_READ_STATUS_ABORT - /**< An unrecoverable error occurred. The decoder will return from the process call. */ - -} FLAC__StreamDecoderReadStatus; - -/** Maps a FLAC__StreamDecoderReadStatus to a C string. - * - * Using a FLAC__StreamDecoderReadStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[]; - - -/** Return values for the FLAC__StreamDecoder seek callback. - */ -typedef enum { - - FLAC__STREAM_DECODER_SEEK_STATUS_OK, - /**< The seek was OK and decoding can continue. */ - - FLAC__STREAM_DECODER_SEEK_STATUS_ERROR, - /**< An unrecoverable error occurred. The decoder will return from the process call. */ - - FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED - /**< Client does not support seeking. */ - -} FLAC__StreamDecoderSeekStatus; - -/** Maps a FLAC__StreamDecoderSeekStatus to a C string. - * - * Using a FLAC__StreamDecoderSeekStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderSeekStatusString[]; - - -/** Return values for the FLAC__StreamDecoder tell callback. - */ -typedef enum { - - FLAC__STREAM_DECODER_TELL_STATUS_OK, - /**< The tell was OK and decoding can continue. */ - - FLAC__STREAM_DECODER_TELL_STATUS_ERROR, - /**< An unrecoverable error occurred. The decoder will return from the process call. */ - - FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED - /**< Client does not support telling the position. */ - -} FLAC__StreamDecoderTellStatus; - -/** Maps a FLAC__StreamDecoderTellStatus to a C string. - * - * Using a FLAC__StreamDecoderTellStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderTellStatusString[]; - - -/** Return values for the FLAC__StreamDecoder length callback. - */ -typedef enum { - - FLAC__STREAM_DECODER_LENGTH_STATUS_OK, - /**< The length call was OK and decoding can continue. */ - - FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR, - /**< An unrecoverable error occurred. The decoder will return from the process call. */ - - FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED - /**< Client does not support reporting the length. */ - -} FLAC__StreamDecoderLengthStatus; - -/** Maps a FLAC__StreamDecoderLengthStatus to a C string. - * - * Using a FLAC__StreamDecoderLengthStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderLengthStatusString[]; - - -/** Return values for the FLAC__StreamDecoder write callback. - */ -typedef enum { - - FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE, - /**< The write was OK and decoding can continue. */ - - FLAC__STREAM_DECODER_WRITE_STATUS_ABORT - /**< An unrecoverable error occurred. The decoder will return from the process call. */ - -} FLAC__StreamDecoderWriteStatus; - -/** Maps a FLAC__StreamDecoderWriteStatus to a C string. - * - * Using a FLAC__StreamDecoderWriteStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[]; - - -/** Possible values passed back to the FLAC__StreamDecoder error callback. - * \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC is the generic catch- - * all. The rest could be caused by bad sync (false synchronization on - * data that is not the start of a frame) or corrupted data. The error - * itself is the decoder's best guess at what happened assuming a correct - * sync. For example \c FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER - * could be caused by a correct sync on the start of a frame, but some - * data in the frame header was corrupted. Or it could be the result of - * syncing on a point the stream that looked like the starting of a frame - * but was not. \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM - * could be because the decoder encountered a valid frame made by a future - * version of the encoder which it cannot parse, or because of a false - * sync making it appear as though an encountered frame was generated by - * a future encoder. - */ -typedef enum { - - FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC, - /**< An error in the stream caused the decoder to lose synchronization. */ - - FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER, - /**< The decoder encountered a corrupted frame header. */ - - FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH, - /**< The frame's data did not match the CRC in the footer. */ - - FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM - /**< The decoder encountered reserved fields in use in the stream. */ - -} FLAC__StreamDecoderErrorStatus; - -/** Maps a FLAC__StreamDecoderErrorStatus to a C string. - * - * Using a FLAC__StreamDecoderErrorStatus as the index to this array - * will give the string equivalent. The contents should not be modified. - */ -extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[]; - - -/*********************************************************************** - * - * class FLAC__StreamDecoder - * - ***********************************************************************/ - -struct FLAC__StreamDecoderProtected; -struct FLAC__StreamDecoderPrivate; -/** The opaque structure definition for the stream decoder type. - * See the \link flac_stream_decoder stream decoder module \endlink - * for a detailed description. - */ -typedef struct { - struct FLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */ - struct FLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */ -} FLAC__StreamDecoder; - -/** Signature for the read callback. - * - * A function pointer matching this signature must be passed to - * FLAC__stream_decoder_init*_stream(). The supplied function will be - * called when the decoder needs more input data. The address of the - * buffer to be filled is supplied, along with the number of bytes the - * buffer can hold. The callback may choose to supply less data and - * modify the byte count but must be careful not to overflow the buffer. - * The callback then returns a status code chosen from - * FLAC__StreamDecoderReadStatus. - * - * Here is an example of a read callback for stdio streams: - * \code - * FLAC__StreamDecoderReadStatus read_cb(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) - * { - * FILE *file = ((MyClientData*)client_data)->file; - * if(*bytes > 0) { - * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); - * if(ferror(file)) - * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - * else if(*bytes == 0) - * return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - * else - * return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - * } - * else - * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - * } - * \endcode - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param buffer A pointer to a location for the callee to store - * data to be decoded. - * \param bytes A pointer to the size of the buffer. On entry - * to the callback, it contains the maximum number - * of bytes that may be stored in \a buffer. The - * callee must set it to the actual number of bytes - * stored (0 in case of error or end-of-stream) before - * returning. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - * \retval FLAC__StreamDecoderReadStatus - * The callee's return status. Note that the callback should return - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM if and only if - * zero bytes were read and there is no more data to be read. - */ -typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); - -/** Signature for the seek callback. - * - * A function pointer matching this signature may be passed to - * FLAC__stream_decoder_init*_stream(). The supplied function will be - * called when the decoder needs to seek the input stream. The decoder - * will pass the absolute byte offset to seek to, 0 meaning the - * beginning of the stream. - * - * Here is an example of a seek callback for stdio streams: - * \code - * FLAC__StreamDecoderSeekStatus seek_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) - * { - * FILE *file = ((MyClientData*)client_data)->file; - * if(file == stdin) - * return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; - * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) - * return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - * else - * return FLAC__STREAM_DECODER_SEEK_STATUS_OK; - * } - * \endcode - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param absolute_byte_offset The offset from the beginning of the stream - * to seek to. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - * \retval FLAC__StreamDecoderSeekStatus - * The callee's return status. - */ -typedef FLAC__StreamDecoderSeekStatus (*FLAC__StreamDecoderSeekCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data); - -/** Signature for the tell callback. - * - * A function pointer matching this signature may be passed to - * FLAC__stream_decoder_init*_stream(). The supplied function will be - * called when the decoder wants to know the current position of the - * stream. The callback should return the byte offset from the - * beginning of the stream. - * - * Here is an example of a tell callback for stdio streams: - * \code - * FLAC__StreamDecoderTellStatus tell_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) - * { - * FILE *file = ((MyClientData*)client_data)->file; - * off_t pos; - * if(file == stdin) - * return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; - * else if((pos = ftello(file)) < 0) - * return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - * else { - * *absolute_byte_offset = (FLAC__uint64)pos; - * return FLAC__STREAM_DECODER_TELL_STATUS_OK; - * } - * } - * \endcode - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param absolute_byte_offset A pointer to storage for the current offset - * from the beginning of the stream. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - * \retval FLAC__StreamDecoderTellStatus - * The callee's return status. - */ -typedef FLAC__StreamDecoderTellStatus (*FLAC__StreamDecoderTellCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data); - -/** Signature for the length callback. - * - * A function pointer matching this signature may be passed to - * FLAC__stream_decoder_init*_stream(). The supplied function will be - * called when the decoder wants to know the total length of the stream - * in bytes. - * - * Here is an example of a length callback for stdio streams: - * \code - * FLAC__StreamDecoderLengthStatus length_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) - * { - * FILE *file = ((MyClientData*)client_data)->file; - * struct stat filestats; - * - * if(file == stdin) - * return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; - * else if(fstat(fileno(file), &filestats) != 0) - * return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - * else { - * *stream_length = (FLAC__uint64)filestats.st_size; - * return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; - * } - * } - * \endcode - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param stream_length A pointer to storage for the length of the stream - * in bytes. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - * \retval FLAC__StreamDecoderLengthStatus - * The callee's return status. - */ -typedef FLAC__StreamDecoderLengthStatus (*FLAC__StreamDecoderLengthCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data); - -/** Signature for the EOF callback. - * - * A function pointer matching this signature may be passed to - * FLAC__stream_decoder_init*_stream(). The supplied function will be - * called when the decoder needs to know if the end of the stream has - * been reached. - * - * Here is an example of a EOF callback for stdio streams: - * FLAC__bool eof_cb(const FLAC__StreamDecoder *decoder, void *client_data) - * \code - * { - * FILE *file = ((MyClientData*)client_data)->file; - * return feof(file)? true : false; - * } - * \endcode - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - * \retval FLAC__bool - * \c true if the currently at the end of the stream, else \c false. - */ -typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *decoder, void *client_data); - -/** Signature for the write callback. - * - * A function pointer matching this signature must be passed to one of - * the FLAC__stream_decoder_init_*() functions. - * The supplied function will be called when the decoder has decoded a - * single audio frame. The decoder will pass the frame metadata as well - * as an array of pointers (one for each channel) pointing to the - * decoded audio. - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param frame The description of the decoded frame. See - * FLAC__Frame. - * \param buffer An array of pointers to decoded channels of data. - * Each pointer will point to an array of signed - * samples of length \a frame->header.blocksize. - * Channels will be ordered according to the FLAC - * specification; see the documentation for the - * <A HREF="../format.html#frame_header">frame header</A>. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - * \retval FLAC__StreamDecoderWriteStatus - * The callee's return status. - */ -typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); - -/** Signature for the metadata callback. - * - * A function pointer matching this signature must be passed to one of - * the FLAC__stream_decoder_init_*() functions. - * The supplied function will be called when the decoder has decoded a - * metadata block. In a valid FLAC file there will always be one - * \c STREAMINFO block, followed by zero or more other metadata blocks. - * These will be supplied by the decoder in the same order as they - * appear in the stream and always before the first audio frame (i.e. - * write callback). The metadata block that is passed in must not be - * modified, and it doesn't live beyond the callback, so you should make - * a copy of it with FLAC__metadata_object_clone() if you will need it - * elsewhere. Since metadata blocks can potentially be large, by - * default the decoder only calls the metadata callback for the - * \c STREAMINFO block; you can instruct the decoder to pass or filter - * other blocks with FLAC__stream_decoder_set_metadata_*() calls. - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param metadata The decoded metadata block. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - */ -typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); - -/** Signature for the error callback. - * - * A function pointer matching this signature must be passed to one of - * the FLAC__stream_decoder_init_*() functions. - * The supplied function will be called whenever an error occurs during - * decoding. - * - * \note In general, FLAC__StreamDecoder functions which change the - * state should not be called on the \a decoder while in the callback. - * - * \param decoder The decoder instance calling the callback. - * \param status The error encountered by the decoder. - * \param client_data The callee's client data set through - * FLAC__stream_decoder_init_*(). - */ -typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); - - -/*********************************************************************** - * - * Class constructor/destructor - * - ***********************************************************************/ - -/** Create a new stream decoder instance. The instance is created with - * default settings; see the individual FLAC__stream_decoder_set_*() - * functions for each setting's default. - * - * \retval FLAC__StreamDecoder* - * \c NULL if there was an error allocating memory, else the new instance. - */ -FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new(void); - -/** Free a decoder instance. Deletes the object pointed to by \a decoder. - * - * \param decoder A pointer to an existing decoder. - * \assert - * \code decoder != NULL \endcode - */ -FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder); - - -/*********************************************************************** - * - * Public class method prototypes - * - ***********************************************************************/ - -/** Set the serial number for the FLAC stream within the Ogg container. - * The default behavior is to use the serial number of the first Ogg - * page. Setting a serial number here will explicitly specify which - * stream is to be decoded. - * - * \note - * This does not need to be set for native FLAC decoding. - * - * \default \c use serial number of first page - * \param decoder A decoder instance to set. - * \param serial_number See above. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number); - -/** Set the "MD5 signature checking" flag. If \c true, the decoder will - * compute the MD5 signature of the unencoded audio data while decoding - * and compare it to the signature from the STREAMINFO block, if it - * exists, during FLAC__stream_decoder_finish(). - * - * MD5 signature checking will be turned off (until the next - * FLAC__stream_decoder_reset()) if there is no signature in the - * STREAMINFO block or when a seek is attempted. - * - * Clients that do not use the MD5 check should leave this off to speed - * up decoding. - * - * \default \c false - * \param decoder A decoder instance to set. - * \param value Flag value (see above). - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value); - -/** Direct the decoder to pass on all metadata blocks of type \a type. - * - * \default By default, only the \c STREAMINFO block is returned via the - * metadata callback. - * \param decoder A decoder instance to set. - * \param type See above. - * \assert - * \code decoder != NULL \endcode - * \a type is valid - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); - -/** Direct the decoder to pass on all APPLICATION metadata blocks of the - * given \a id. - * - * \default By default, only the \c STREAMINFO block is returned via the - * metadata callback. - * \param decoder A decoder instance to set. - * \param id See above. - * \assert - * \code decoder != NULL \endcode - * \code id != NULL \endcode - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); - -/** Direct the decoder to pass on all metadata blocks of any type. - * - * \default By default, only the \c STREAMINFO block is returned via the - * metadata callback. - * \param decoder A decoder instance to set. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder); - -/** Direct the decoder to filter out all metadata blocks of type \a type. - * - * \default By default, only the \c STREAMINFO block is returned via the - * metadata callback. - * \param decoder A decoder instance to set. - * \param type See above. - * \assert - * \code decoder != NULL \endcode - * \a type is valid - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); - -/** Direct the decoder to filter out all APPLICATION metadata blocks of - * the given \a id. - * - * \default By default, only the \c STREAMINFO block is returned via the - * metadata callback. - * \param decoder A decoder instance to set. - * \param id See above. - * \assert - * \code decoder != NULL \endcode - * \code id != NULL \endcode - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); - -/** Direct the decoder to filter out all metadata blocks of any type. - * - * \default By default, only the \c STREAMINFO block is returned via the - * metadata callback. - * \param decoder A decoder instance to set. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if the decoder is already initialized, else \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder); - -/** Get the current decoder state. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__StreamDecoderState - * The current decoder state. - */ -FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder); - -/** Get the current decoder state as a C string. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval const char * - * The decoder state as a C string. Do not modify the contents. - */ -FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder); - -/** Get the "MD5 signature checking" flag. - * This is the value of the setting, not whether or not the decoder is - * currently checking the MD5 (remember, it can be turned off automatically - * by a seek). When the decoder is reset the flag will be restored to the - * value returned by this function. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * See above. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder); - -/** Get the total number of samples in the stream being decoded. - * Will only be valid after decoding has started and will contain the - * value from the \c STREAMINFO block. A value of \c 0 means "unknown". - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval unsigned - * See above. - */ -FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder); - -/** Get the current number of channels in the stream being decoded. - * Will only be valid after decoding has started and will contain the - * value from the most recently decoded frame header. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval unsigned - * See above. - */ -FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder); - -/** Get the current channel assignment in the stream being decoded. - * Will only be valid after decoding has started and will contain the - * value from the most recently decoded frame header. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__ChannelAssignment - * See above. - */ -FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder); - -/** Get the current sample resolution in the stream being decoded. - * Will only be valid after decoding has started and will contain the - * value from the most recently decoded frame header. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval unsigned - * See above. - */ -FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder); - -/** Get the current sample rate in Hz of the stream being decoded. - * Will only be valid after decoding has started and will contain the - * value from the most recently decoded frame header. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval unsigned - * See above. - */ -FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder); - -/** Get the current blocksize of the stream being decoded. - * Will only be valid after decoding has started and will contain the - * value from the most recently decoded frame header. - * - * \param decoder A decoder instance to query. - * \assert - * \code decoder != NULL \endcode - * \retval unsigned - * See above. - */ -FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder); - -/** Returns the decoder's current read position within the stream. - * The position is the byte offset from the start of the stream. - * Bytes before this position have been fully decoded. Note that - * there may still be undecoded bytes in the decoder's read FIFO. - * The returned position is correct even after a seek. - * - * \warning This function currently only works for native FLAC, - * not Ogg FLAC streams. - * - * \param decoder A decoder instance to query. - * \param position Address at which to return the desired position. - * \assert - * \code decoder != NULL \endcode - * \code position != NULL \endcode - * \retval FLAC__bool - * \c true if successful, \c false if the stream is not native FLAC, - * or there was an error from the 'tell' callback or it returned - * \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position); - -/** Initialize the decoder instance to decode native FLAC streams. - * - * This flavor of initialization sets up the decoder to decode from a - * native FLAC stream. I/O is performed via callbacks to the client. - * For decoding from a plain file via filename or open FILE*, - * FLAC__stream_decoder_init_file() and FLAC__stream_decoder_init_FILE() - * provide a simpler interface. - * - * This function should be called after FLAC__stream_decoder_new() and - * FLAC__stream_decoder_set_*() but before any of the - * FLAC__stream_decoder_process_*() functions. Will set and return the - * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA - * if initialization succeeded. - * - * \param decoder An uninitialized decoder instance. - * \param read_callback See FLAC__StreamDecoderReadCallback. This - * pointer must not be \c NULL. - * \param seek_callback See FLAC__StreamDecoderSeekCallback. This - * pointer may be \c NULL if seeking is not - * supported. If \a seek_callback is not \c NULL then a - * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. - * Alternatively, a dummy seek callback that just - * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param tell_callback See FLAC__StreamDecoderTellCallback. This - * pointer may be \c NULL if not supported by the client. If - * \a seek_callback is not \c NULL then a - * \a tell_callback must also be supplied. - * Alternatively, a dummy tell callback that just - * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param length_callback See FLAC__StreamDecoderLengthCallback. This - * pointer may be \c NULL if not supported by the client. If - * \a seek_callback is not \c NULL then a - * \a length_callback must also be supplied. - * Alternatively, a dummy length callback that just - * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param eof_callback See FLAC__StreamDecoderEofCallback. This - * pointer may be \c NULL if not supported by the client. If - * \a seek_callback is not \c NULL then a - * \a eof_callback must also be supplied. - * Alternatively, a dummy length callback that just - * returns \c false - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param write_callback See FLAC__StreamDecoderWriteCallback. This - * pointer must not be \c NULL. - * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This - * pointer may be \c NULL if the callback is not - * desired. - * \param error_callback See FLAC__StreamDecoderErrorCallback. This - * pointer must not be \c NULL. - * \param client_data This value will be supplied to callbacks in their - * \a client_data argument. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__StreamDecoderInitStatus - * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; - * see FLAC__StreamDecoderInitStatus for the meanings of other return values. - */ -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream( - FLAC__StreamDecoder *decoder, - FLAC__StreamDecoderReadCallback read_callback, - FLAC__StreamDecoderSeekCallback seek_callback, - FLAC__StreamDecoderTellCallback tell_callback, - FLAC__StreamDecoderLengthCallback length_callback, - FLAC__StreamDecoderEofCallback eof_callback, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -); - -/** Initialize the decoder instance to decode Ogg FLAC streams. - * - * This flavor of initialization sets up the decoder to decode from a - * FLAC stream in an Ogg container. I/O is performed via callbacks to the - * client. For decoding from a plain file via filename or open FILE*, - * FLAC__stream_decoder_init_ogg_file() and FLAC__stream_decoder_init_ogg_FILE() - * provide a simpler interface. - * - * This function should be called after FLAC__stream_decoder_new() and - * FLAC__stream_decoder_set_*() but before any of the - * FLAC__stream_decoder_process_*() functions. Will set and return the - * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA - * if initialization succeeded. - * - * \note Support for Ogg FLAC in the library is optional. If this - * library has been built without support for Ogg FLAC, this function - * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. - * - * \param decoder An uninitialized decoder instance. - * \param read_callback See FLAC__StreamDecoderReadCallback. This - * pointer must not be \c NULL. - * \param seek_callback See FLAC__StreamDecoderSeekCallback. This - * pointer may be \c NULL if seeking is not - * supported. If \a seek_callback is not \c NULL then a - * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. - * Alternatively, a dummy seek callback that just - * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param tell_callback See FLAC__StreamDecoderTellCallback. This - * pointer may be \c NULL if not supported by the client. If - * \a seek_callback is not \c NULL then a - * \a tell_callback must also be supplied. - * Alternatively, a dummy tell callback that just - * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param length_callback See FLAC__StreamDecoderLengthCallback. This - * pointer may be \c NULL if not supported by the client. If - * \a seek_callback is not \c NULL then a - * \a length_callback must also be supplied. - * Alternatively, a dummy length callback that just - * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param eof_callback See FLAC__StreamDecoderEofCallback. This - * pointer may be \c NULL if not supported by the client. If - * \a seek_callback is not \c NULL then a - * \a eof_callback must also be supplied. - * Alternatively, a dummy length callback that just - * returns \c false - * may also be supplied, all though this is slightly - * less efficient for the decoder. - * \param write_callback See FLAC__StreamDecoderWriteCallback. This - * pointer must not be \c NULL. - * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This - * pointer may be \c NULL if the callback is not - * desired. - * \param error_callback See FLAC__StreamDecoderErrorCallback. This - * pointer must not be \c NULL. - * \param client_data This value will be supplied to callbacks in their - * \a client_data argument. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__StreamDecoderInitStatus - * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; - * see FLAC__StreamDecoderInitStatus for the meanings of other return values. - */ -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_stream( - FLAC__StreamDecoder *decoder, - FLAC__StreamDecoderReadCallback read_callback, - FLAC__StreamDecoderSeekCallback seek_callback, - FLAC__StreamDecoderTellCallback tell_callback, - FLAC__StreamDecoderLengthCallback length_callback, - FLAC__StreamDecoderEofCallback eof_callback, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -); - -/** Initialize the decoder instance to decode native FLAC files. - * - * This flavor of initialization sets up the decoder to decode from a - * plain native FLAC file. For non-stdio streams, you must use - * FLAC__stream_decoder_init_stream() and provide callbacks for the I/O. - * - * This function should be called after FLAC__stream_decoder_new() and - * FLAC__stream_decoder_set_*() but before any of the - * FLAC__stream_decoder_process_*() functions. Will set and return the - * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA - * if initialization succeeded. - * - * \param decoder An uninitialized decoder instance. - * \param file An open FLAC file. The file should have been - * opened with mode \c "rb" and rewound. The file - * becomes owned by the decoder and should not be - * manipulated by the client while decoding. - * Unless \a file is \c stdin, it will be closed - * when FLAC__stream_decoder_finish() is called. - * Note however that seeking will not work when - * decoding from \c stdin since it is not seekable. - * \param write_callback See FLAC__StreamDecoderWriteCallback. This - * pointer must not be \c NULL. - * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This - * pointer may be \c NULL if the callback is not - * desired. - * \param error_callback See FLAC__StreamDecoderErrorCallback. This - * pointer must not be \c NULL. - * \param client_data This value will be supplied to callbacks in their - * \a client_data argument. - * \assert - * \code decoder != NULL \endcode - * \code file != NULL \endcode - * \retval FLAC__StreamDecoderInitStatus - * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; - * see FLAC__StreamDecoderInitStatus for the meanings of other return values. - */ -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE( - FLAC__StreamDecoder *decoder, - FILE *file, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -); - -/** Initialize the decoder instance to decode Ogg FLAC files. - * - * This flavor of initialization sets up the decoder to decode from a - * plain Ogg FLAC file. For non-stdio streams, you must use - * FLAC__stream_decoder_init_ogg_stream() and provide callbacks for the I/O. - * - * This function should be called after FLAC__stream_decoder_new() and - * FLAC__stream_decoder_set_*() but before any of the - * FLAC__stream_decoder_process_*() functions. Will set and return the - * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA - * if initialization succeeded. - * - * \note Support for Ogg FLAC in the library is optional. If this - * library has been built without support for Ogg FLAC, this function - * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. - * - * \param decoder An uninitialized decoder instance. - * \param file An open FLAC file. The file should have been - * opened with mode \c "rb" and rewound. The file - * becomes owned by the decoder and should not be - * manipulated by the client while decoding. - * Unless \a file is \c stdin, it will be closed - * when FLAC__stream_decoder_finish() is called. - * Note however that seeking will not work when - * decoding from \c stdin since it is not seekable. - * \param write_callback See FLAC__StreamDecoderWriteCallback. This - * pointer must not be \c NULL. - * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This - * pointer may be \c NULL if the callback is not - * desired. - * \param error_callback See FLAC__StreamDecoderErrorCallback. This - * pointer must not be \c NULL. - * \param client_data This value will be supplied to callbacks in their - * \a client_data argument. - * \assert - * \code decoder != NULL \endcode - * \code file != NULL \endcode - * \retval FLAC__StreamDecoderInitStatus - * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; - * see FLAC__StreamDecoderInitStatus for the meanings of other return values. - */ -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE( - FLAC__StreamDecoder *decoder, - FILE *file, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -); - -/** Initialize the decoder instance to decode native FLAC files. - * - * This flavor of initialization sets up the decoder to decode from a plain - * native FLAC file. If POSIX fopen() semantics are not sufficient, (for - * example, with Unicode filenames on Windows), you must use - * FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream() - * and provide callbacks for the I/O. - * - * This function should be called after FLAC__stream_decoder_new() and - * FLAC__stream_decoder_set_*() but before any of the - * FLAC__stream_decoder_process_*() functions. Will set and return the - * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA - * if initialization succeeded. - * - * \param decoder An uninitialized decoder instance. - * \param filename The name of the file to decode from. The file will - * be opened with fopen(). Use \c NULL to decode from - * \c stdin. Note that \c stdin is not seekable. - * \param write_callback See FLAC__StreamDecoderWriteCallback. This - * pointer must not be \c NULL. - * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This - * pointer may be \c NULL if the callback is not - * desired. - * \param error_callback See FLAC__StreamDecoderErrorCallback. This - * pointer must not be \c NULL. - * \param client_data This value will be supplied to callbacks in their - * \a client_data argument. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__StreamDecoderInitStatus - * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; - * see FLAC__StreamDecoderInitStatus for the meanings of other return values. - */ -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file( - FLAC__StreamDecoder *decoder, - const char *filename, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -); - -/** Initialize the decoder instance to decode Ogg FLAC files. - * - * This flavor of initialization sets up the decoder to decode from a plain - * Ogg FLAC file. If POSIX fopen() semantics are not sufficient, (for - * example, with Unicode filenames on Windows), you must use - * FLAC__stream_decoder_init_ogg_FILE(), or FLAC__stream_decoder_init_ogg_stream() - * and provide callbacks for the I/O. - * - * This function should be called after FLAC__stream_decoder_new() and - * FLAC__stream_decoder_set_*() but before any of the - * FLAC__stream_decoder_process_*() functions. Will set and return the - * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA - * if initialization succeeded. - * - * \note Support for Ogg FLAC in the library is optional. If this - * library has been built without support for Ogg FLAC, this function - * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. - * - * \param decoder An uninitialized decoder instance. - * \param filename The name of the file to decode from. The file will - * be opened with fopen(). Use \c NULL to decode from - * \c stdin. Note that \c stdin is not seekable. - * \param write_callback See FLAC__StreamDecoderWriteCallback. This - * pointer must not be \c NULL. - * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This - * pointer may be \c NULL if the callback is not - * desired. - * \param error_callback See FLAC__StreamDecoderErrorCallback. This - * pointer must not be \c NULL. - * \param client_data This value will be supplied to callbacks in their - * \a client_data argument. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__StreamDecoderInitStatus - * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; - * see FLAC__StreamDecoderInitStatus for the meanings of other return values. - */ -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_file( - FLAC__StreamDecoder *decoder, - const char *filename, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -); - -/** Finish the decoding process. - * Flushes the decoding buffer, releases resources, resets the decoder - * settings to their defaults, and returns the decoder state to - * FLAC__STREAM_DECODER_UNINITIALIZED. - * - * In the event of a prematurely-terminated decode, it is not strictly - * necessary to call this immediately before FLAC__stream_decoder_delete() - * but it is good practice to match every FLAC__stream_decoder_init_*() - * with a FLAC__stream_decoder_finish(). - * - * \param decoder An uninitialized decoder instance. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if MD5 checking is on AND a STREAMINFO block was available - * AND the MD5 signature in the STREAMINFO block was non-zero AND the - * signature does not match the one computed by the decoder; else - * \c true. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder); - -/** Flush the stream input. - * The decoder's input buffer will be cleared and the state set to - * \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC. This will also turn - * off MD5 checking. - * - * \param decoder A decoder instance. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c true if successful, else \c false if a memory allocation - * error occurs (in which case the state will be set to - * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR). - */ -FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder); - -/** Reset the decoding process. - * The decoder's input buffer will be cleared and the state set to - * \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA. This is similar to - * FLAC__stream_decoder_finish() except that the settings are - * preserved; there is no need to call FLAC__stream_decoder_init_*() - * before decoding again. MD5 checking will be restored to its original - * setting. - * - * If the decoder is seekable, or was initialized with - * FLAC__stream_decoder_init*_FILE() or FLAC__stream_decoder_init*_file(), - * the decoder will also attempt to seek to the beginning of the file. - * If this rewind fails, this function will return \c false. It follows - * that FLAC__stream_decoder_reset() cannot be used when decoding from - * \c stdin. - * - * If the decoder was initialized with FLAC__stream_encoder_init*_stream() - * and is not seekable (i.e. no seek callback was provided or the seek - * callback returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED), it - * is the duty of the client to start feeding data from the beginning of - * the stream on the next FLAC__stream_decoder_process_*() call. - * - * \param decoder A decoder instance. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c true if successful, else \c false if a memory allocation occurs - * (in which case the state will be set to - * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR) or a seek error - * occurs (the state will be unchanged). - */ -FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder); - -/** Decode one metadata block or audio frame. - * This version instructs the decoder to decode a either a single metadata - * block or a single frame and stop, unless the callbacks return a fatal - * error or the read callback returns - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. - * - * As the decoder needs more input it will call the read callback. - * Depending on what was decoded, the metadata or write callback will be - * called with the decoded metadata block or audio frame. - * - * Unless there is a fatal read error or end of stream, this function - * will return once one whole frame is decoded. In other words, if the - * stream is not synchronized or points to a corrupt frame header, the - * decoder will continue to try and resync until it gets to a valid - * frame, then decode one frame, then return. If the decoder points to - * a frame whose frame CRC in the frame footer does not match the - * computed frame CRC, this function will issue a - * FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH error to the - * error callback, and return, having decoded one complete, although - * corrupt, frame. (Such corrupted frames are sent as silence of the - * correct length to the write callback.) - * - * \param decoder An initialized decoder instance. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if any fatal read, write, or memory allocation error - * occurred (meaning decoding must stop), else \c true; for more - * information about the decoder, check the decoder state with - * FLAC__stream_decoder_get_state(). - */ -FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder); - -/** Decode until the end of the metadata. - * This version instructs the decoder to decode from the current position - * and continue until all the metadata has been read, or until the - * callbacks return a fatal error or the read callback returns - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. - * - * As the decoder needs more input it will call the read callback. - * As each metadata block is decoded, the metadata callback will be called - * with the decoded metadata. - * - * \param decoder An initialized decoder instance. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if any fatal read, write, or memory allocation error - * occurred (meaning decoding must stop), else \c true; for more - * information about the decoder, check the decoder state with - * FLAC__stream_decoder_get_state(). - */ -FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder); - -/** Decode until the end of the stream. - * This version instructs the decoder to decode from the current position - * and continue until the end of stream (the read callback returns - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM), or until the - * callbacks return a fatal error. - * - * As the decoder needs more input it will call the read callback. - * As each metadata block and frame is decoded, the metadata or write - * callback will be called with the decoded metadata or frame. - * - * \param decoder An initialized decoder instance. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if any fatal read, write, or memory allocation error - * occurred (meaning decoding must stop), else \c true; for more - * information about the decoder, check the decoder state with - * FLAC__stream_decoder_get_state(). - */ -FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder); - -/** Skip one audio frame. - * This version instructs the decoder to 'skip' a single frame and stop, - * unless the callbacks return a fatal error or the read callback returns - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. - * - * The decoding flow is the same as what occurs when - * FLAC__stream_decoder_process_single() is called to process an audio - * frame, except that this function does not decode the parsed data into - * PCM or call the write callback. The integrity of the frame is still - * checked the same way as in the other process functions. - * - * This function will return once one whole frame is skipped, in the - * same way that FLAC__stream_decoder_process_single() will return once - * one whole frame is decoded. - * - * This function can be used in more quickly determining FLAC frame - * boundaries when decoding of the actual data is not needed, for - * example when an application is separating a FLAC stream into frames - * for editing or storing in a container. To do this, the application - * can use FLAC__stream_decoder_skip_single_frame() to quickly advance - * to the next frame, then use - * FLAC__stream_decoder_get_decode_position() to find the new frame - * boundary. - * - * This function should only be called when the stream has advanced - * past all the metadata, otherwise it will return \c false. - * - * \param decoder An initialized decoder instance not in a metadata - * state. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c false if any fatal read, write, or memory allocation error - * occurred (meaning decoding must stop), or if the decoder - * is in the FLAC__STREAM_DECODER_SEARCH_FOR_METADATA or - * FLAC__STREAM_DECODER_READ_METADATA state, else \c true; for more - * information about the decoder, check the decoder state with - * FLAC__stream_decoder_get_state(). - */ -FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder); - -/** Flush the input and seek to an absolute sample. - * Decoding will resume at the given sample. Note that because of - * this, the next write callback may contain a partial block. The - * client must support seeking the input or this function will fail - * and return \c false. Furthermore, if the decoder state is - * \c FLAC__STREAM_DECODER_SEEK_ERROR, then the decoder must be flushed - * with FLAC__stream_decoder_flush() or reset with - * FLAC__stream_decoder_reset() before decoding can continue. - * - * \param decoder A decoder instance. - * \param sample The target sample number to seek to. - * \assert - * \code decoder != NULL \endcode - * \retval FLAC__bool - * \c true if successful, else \c false. - */ -FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample); - -/* \} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/MacOSX/codecs/include/flac_config.txt b/MacOSX/codecs/include/flac_config.txt deleted file mode 100644 index 7fd42c36..00000000 --- a/MacOSX/codecs/include/flac_config.txt +++ /dev/null @@ -1,3 +0,0 @@ -FLAC v1.3.0 release + several fixes from the flac git repo at xiph.org. -Decoder-only functionality, which is what we need: the encoder stuff is -left out of the build. diff --git a/MacOSX/codecs/include/libmodplug/modplug.h b/MacOSX/codecs/include/libmodplug/modplug.h deleted file mode 100644 index 3ffbf9d9..00000000 --- a/MacOSX/codecs/include/libmodplug/modplug.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * This source code is public domain. - * - * Authors: Kenton Varda <temporal@gauge3d.org> (C interface wrapper) - */ - -#ifndef MODPLUG_H__INCLUDED -#define MODPLUG_H__INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_WIN32) || defined(__CYGWIN__) -# if defined(MODPLUG_BUILD) && defined(DLL_EXPORT) /* building libmodplug as a dll for windows */ -# define MODPLUG_EXPORT __declspec(dllexport) -# elif defined(MODPLUG_BUILD) || defined(MODPLUG_STATIC) /* building or using static libmodplug for windows */ -# define MODPLUG_EXPORT -# else -# define MODPLUG_EXPORT __declspec(dllimport) /* using libmodplug dll for windows */ -# endif -#elif defined(MODPLUG_BUILD) && defined(SYM_VISIBILITY) -# define MODPLUG_EXPORT __attribute__((visibility("default"))) -#else -#define MODPLUG_EXPORT -#endif - -struct _ModPlugFile; -typedef struct _ModPlugFile ModPlugFile; - -struct _ModPlugNote { - unsigned char Note; - unsigned char Instrument; - unsigned char VolumeEffect; - unsigned char Effect; - unsigned char Volume; - unsigned char Parameter; -}; -typedef struct _ModPlugNote ModPlugNote; - -typedef void (*ModPlugMixerProc)(int*, unsigned long, unsigned long); - -/* Load a mod file. [data] should point to a block of memory containing the complete - * file, and [size] should be the size of that block. - * Return the loaded mod file on success, or NULL on failure. */ -MODPLUG_EXPORT ModPlugFile* ModPlug_Load(const void* data, int size); -/* Unload a mod file. */ -MODPLUG_EXPORT void ModPlug_Unload(ModPlugFile* file); - -/* Read sample data into the buffer. Returns the number of bytes read. If the end - * of the mod has been reached, zero is returned. */ -MODPLUG_EXPORT int ModPlug_Read(ModPlugFile* file, void* buffer, int size); - -/* Get the name of the mod. The returned buffer is stored within the ModPlugFile - * structure and will remain valid until you unload the file. */ -MODPLUG_EXPORT const char* ModPlug_GetName(ModPlugFile* file); - -/* Get the length of the mod, in milliseconds. Note that this result is not always - * accurate, especially in the case of mods with loops. */ -MODPLUG_EXPORT int ModPlug_GetLength(ModPlugFile* file); - -/* Seek to a particular position in the song. Note that seeking and MODs don't mix very - * well. Some mods will be missing instruments for a short time after a seek, as ModPlug - * does not scan the sequence backwards to find out which instruments were supposed to be - * playing at that time. (Doing so would be difficult and not very reliable.) Also, - * note that seeking is not very exact in some mods -- especially those for which - * ModPlug_GetLength() does not report the full length. */ -MODPLUG_EXPORT void ModPlug_Seek(ModPlugFile* file, int millisecond); - -enum _ModPlug_Flags -{ - MODPLUG_ENABLE_OVERSAMPLING = 1 << 0, /* Enable oversampling (*highly* recommended) */ - MODPLUG_ENABLE_NOISE_REDUCTION = 1 << 1, /* Enable noise reduction */ - MODPLUG_ENABLE_REVERB = 1 << 2, /* Enable reverb */ - MODPLUG_ENABLE_MEGABASS = 1 << 3, /* Enable megabass */ - MODPLUG_ENABLE_SURROUND = 1 << 4 /* Enable surround sound. */ -}; - -enum _ModPlug_ResamplingMode -{ - MODPLUG_RESAMPLE_NEAREST = 0, /* No interpolation (very fast, extremely bad sound quality) */ - MODPLUG_RESAMPLE_LINEAR = 1, /* Linear interpolation (fast, good quality) */ - MODPLUG_RESAMPLE_SPLINE = 2, /* Cubic spline interpolation (high quality) */ - MODPLUG_RESAMPLE_FIR = 3 /* 8-tap fir filter (extremely high quality) */ -}; - -typedef struct _ModPlug_Settings -{ - int mFlags; /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */ - - /* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then - * down-mixes to the settings you choose. */ - int mChannels; /* Number of channels - 1 for mono or 2 for stereo */ - int mBits; /* Bits per sample - 8, 16, or 32 */ - int mFrequency; /* Sampling rate - 11025, 22050, or 44100 */ - int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */ - - int mStereoSeparation; /* Stereo separation, 1 - 256 */ - int mMaxMixChannels; /* Maximum number of mixing channels (polyphony), 32 - 256 */ - - int mReverbDepth; /* Reverb level 0(quiet)-100(loud) */ - int mReverbDelay; /* Reverb delay in ms, usually 40-200ms */ - int mBassAmount; /* XBass level 0(quiet)-100(loud) */ - int mBassRange; /* XBass cutoff in Hz 10-100 */ - int mSurroundDepth; /* Surround level 0(quiet)-100(heavy) */ - int mSurroundDelay; /* Surround delay in ms, usually 5-40ms */ - int mLoopCount; /* Number of times to loop. Zero prevents looping. - * -1 loops forever. */ -} ModPlug_Settings; - -/* Get and set the mod decoder settings. All options, except for channels, bits-per-sample, - * sampling rate, and loop count, will take effect immediately. Those options which don't - * take effect immediately will take effect the next time you load a mod. */ -MODPLUG_EXPORT void ModPlug_GetSettings(ModPlug_Settings* settings); -MODPLUG_EXPORT void ModPlug_SetSettings(const ModPlug_Settings* settings); - -/* New ModPlug API Functions */ -/* NOTE: Master Volume (1-512) */ -MODPLUG_EXPORT unsigned int ModPlug_GetMasterVolume(ModPlugFile* file) ; -MODPLUG_EXPORT void ModPlug_SetMasterVolume(ModPlugFile* file,unsigned int cvol) ; - -MODPLUG_EXPORT int ModPlug_GetCurrentSpeed(ModPlugFile* file); -MODPLUG_EXPORT int ModPlug_GetCurrentTempo(ModPlugFile* file); -MODPLUG_EXPORT int ModPlug_GetCurrentOrder(ModPlugFile* file); -MODPLUG_EXPORT int ModPlug_GetCurrentPattern(ModPlugFile* file); -MODPLUG_EXPORT int ModPlug_GetCurrentRow(ModPlugFile* file); -MODPLUG_EXPORT int ModPlug_GetPlayingChannels(ModPlugFile* file); - -MODPLUG_EXPORT void ModPlug_SeekOrder(ModPlugFile* file,int order); -MODPLUG_EXPORT int ModPlug_GetModuleType(ModPlugFile* file); -MODPLUG_EXPORT char* ModPlug_GetMessage(ModPlugFile* file); - -#define MODPLUG_NO_FILESAVE /* experimental yet. must match stdafx.h. */ -#ifndef MODPLUG_NO_FILESAVE -/* - * EXPERIMENTAL Export Functions - */ -/*Export to a Scream Tracker 3 S3M module. EXPERIMENTAL (only works on Little-Endian platforms)*/ -MODPLUG_EXPORT char ModPlug_ExportS3M(ModPlugFile* file, const char* filepath); - -/*Export to a Extended Module (XM). EXPERIMENTAL (only works on Little-Endian platforms)*/ -MODPLUG_EXPORT char ModPlug_ExportXM(ModPlugFile* file, const char* filepath); - -/*Export to a Amiga MOD file. EXPERIMENTAL.*/ -MODPLUG_EXPORT char ModPlug_ExportMOD(ModPlugFile* file, const char* filepath); - -/*Export to a Impulse Tracker IT file. Should work OK in Little-Endian & Big-Endian platforms :-) */ -MODPLUG_EXPORT char ModPlug_ExportIT(ModPlugFile* file, const char* filepath); -#endif /* MODPLUG_NO_FILESAVE */ - -MODPLUG_EXPORT unsigned int ModPlug_NumInstruments(ModPlugFile* file); -MODPLUG_EXPORT unsigned int ModPlug_NumSamples(ModPlugFile* file); -MODPLUG_EXPORT unsigned int ModPlug_NumPatterns(ModPlugFile* file); -MODPLUG_EXPORT unsigned int ModPlug_NumChannels(ModPlugFile* file); -MODPLUG_EXPORT unsigned int ModPlug_SampleName(ModPlugFile* file, unsigned int qual, char* buff); -MODPLUG_EXPORT unsigned int ModPlug_InstrumentName(ModPlugFile* file, unsigned int qual, char* buff); - -/* - * Retrieve pattern note-data - */ -MODPLUG_EXPORT ModPlugNote* ModPlug_GetPattern(ModPlugFile* file, int pattern, unsigned int* numrows); - -/* - * ================= - * Mixer callback - * ================= - * - * Use this callback if you want to 'modify' the mixed data of LibModPlug. - * - * void proc(int* buffer,unsigned long channels,unsigned long nsamples) ; - * - * 'buffer': A buffer of mixed samples - * 'channels': N. of channels in the buffer - * 'nsamples': N. of samples in the buffeer (without taking care of n.channels) - * - * (Samples are signed 32-bit integers) - */ -MODPLUG_EXPORT void ModPlug_InitMixerCallback(ModPlugFile* file,ModPlugMixerProc proc) ; -MODPLUG_EXPORT void ModPlug_UnloadMixerCallback(ModPlugFile* file) ; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/MacOSX/codecs/include/mad.h b/MacOSX/codecs/include/mad.h deleted file mode 100644 index d7cdd9a0..00000000 --- a/MacOSX/codecs/include/mad.h +++ /dev/null @@ -1,1005 +0,0 @@ -/* - * libmad - MPEG audio decoder library - * Copyright (C) 2000-2004 Underbit Technologies, 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 - * - * If you would like to negotiate alternate licensing terms, you may do - * so by contacting: Underbit Technologies, Inc. <info@underbit.com> - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __i386__ -# define FPM_INTEL -# define SIZEOF_LONG 4 -#endif -#ifdef __x86_64__ -# define FPM_64BIT -# ifdef _WIN64 -# define SIZEOF_LONG 4 -# else -# define SIZEOF_LONG 8 -# endif -#endif -#if (defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__)) && !(defined(__ppc64__) || defined(__powerpc64__)) -# define FPM_PPC -# define SIZEOF_LONG 4 -#endif -#if defined(__ppc64__) || defined(__powerpc64__) -# define FPM_PPC -# define SIZEOF_LONG 8 -#endif - - - -#define SIZEOF_INT 4 -#define SIZEOF_LONG_LONG 8 - - -/* Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp */ - -# ifndef LIBMAD_VERSION_H -# define LIBMAD_VERSION_H - -# define MAD_VERSION_MAJOR 0 -# define MAD_VERSION_MINOR 15 -# define MAD_VERSION_PATCH 1 -# define MAD_VERSION_EXTRA " (beta)" - -# define MAD_VERSION_STRINGIZE(str) #str -# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num) - -# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \ - MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \ - MAD_VERSION_STRING(MAD_VERSION_PATCH) \ - MAD_VERSION_EXTRA - -# define MAD_PUBLISHYEAR "2000-2004" -# define MAD_AUTHOR "Underbit Technologies, Inc." -# define MAD_EMAIL "info@underbit.com" - -extern char const mad_version[]; -extern char const mad_copyright[]; -extern char const mad_author[]; -extern char const mad_build[]; - -# endif - -/* Id: fixed.h,v 1.38 2004/02/17 02:02:03 rob Exp */ - -# ifndef LIBMAD_FIXED_H -# define LIBMAD_FIXED_H - -# if SIZEOF_INT >= 4 -typedef signed int mad_fixed_t; - -typedef signed int mad_fixed64hi_t; -typedef unsigned int mad_fixed64lo_t; -# else -typedef signed long mad_fixed_t; - -typedef signed long mad_fixed64hi_t; -typedef unsigned long mad_fixed64lo_t; -# endif - -# if defined(_MSC_VER) -# define mad_fixed64_t signed __int64 -# elif 1 || defined(__GNUC__) -# define mad_fixed64_t signed long long -# endif - -# if defined(FPM_FLOAT) -typedef double mad_sample_t; -# else -typedef mad_fixed_t mad_sample_t; -# endif - -/* - * Fixed-point format: 0xABBBBBBB - * A == whole part (sign + 3 bits) - * B == fractional part (28 bits) - * - * Values are signed two's complement, so the effective range is: - * 0x80000000 to 0x7fffffff - * -8.0 to +7.9999999962747097015380859375 - * - * The smallest representable value is: - * 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9) - * - * 28 bits of fractional accuracy represent about - * 8.6 digits of decimal accuracy. - * - * Fixed-point numbers can be added or subtracted as normal - * integers, but multiplication requires shifting the 64-bit result - * from 56 fractional bits back to 28 (and rounding.) - * - * Changing the definition of MAD_F_FRACBITS is only partially - * supported, and must be done with care. - */ - -# define MAD_F_FRACBITS 28 - -# if MAD_F_FRACBITS == 28 -# define MAD_F(x) ((mad_fixed_t) (x##L)) -# else -# if MAD_F_FRACBITS < 28 -# warning "MAD_F_FRACBITS < 28" -# define MAD_F(x) ((mad_fixed_t) \ - (((x##L) + \ - (1L << (28 - MAD_F_FRACBITS - 1))) >> \ - (28 - MAD_F_FRACBITS))) -# elif MAD_F_FRACBITS > 28 -# error "MAD_F_FRACBITS > 28 not currently supported" -# define MAD_F(x) ((mad_fixed_t) \ - ((x##L) << (MAD_F_FRACBITS - 28))) -# endif -# endif - -# define MAD_F_MIN ((mad_fixed_t) -0x80000000L) -# define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL) - -# define MAD_F_ONE MAD_F(0x10000000) - -# define mad_f_tofixed(x) ((mad_fixed_t) \ - ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5)) -# define mad_f_todouble(x) ((double) \ - ((x) / (double) (1L << MAD_F_FRACBITS))) - -# define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS) -# define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1)) - /* (x should be positive) */ - -# define mad_f_fromint(x) ((x) << MAD_F_FRACBITS) - -# define mad_f_add(x, y) ((x) + (y)) -# define mad_f_sub(x, y) ((x) - (y)) - -# if defined(FPM_FLOAT) -# error "FPM_FLOAT not yet supported" - -# undef MAD_F -# define MAD_F(x) mad_f_todouble(x) - -# define mad_f_mul(x, y) ((x) * (y)) -# define mad_f_scale64 - -# undef ASO_ZEROCHECK - -# elif defined(FPM_64BIT) - -/* - * This version should be the most accurate if 64-bit types are supported by - * the compiler, although it may not be the most efficient. - */ -# if defined(OPT_ACCURACY) -# define mad_f_mul(x, y) \ - ((mad_fixed_t) \ - ((((mad_fixed64_t) (x) * (y)) + \ - (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS)) -# else -# define mad_f_mul(x, y) \ - ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS)) -# endif - -# define MAD_F_SCALEBITS MAD_F_FRACBITS - -/* --- Intel --------------------------------------------------------------- */ - -# elif defined(FPM_INTEL) - -# if defined(_MSC_VER) -# pragma warning(push) -# pragma warning(disable: 4035) /* no return value */ -static __forceinline -mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) -{ - enum { - fracbits = MAD_F_FRACBITS - }; - - __asm { - mov eax, x - imul y - shrd eax, edx, fracbits - } - - /* implicit return of eax */ -} -# pragma warning(pop) - -# define mad_f_mul mad_f_mul_inline -# define mad_f_scale64 -# else -/* - * This Intel version is fast and accurate; the disposition of the least - * significant bit depends on OPT_ACCURACY via mad_f_scale64(). - */ -# define MAD_F_MLX(hi, lo, x, y) \ - asm ("imull %3" \ - : "=a" (lo), "=d" (hi) \ - : "%a" (x), "rm" (y) \ - : "cc") - -# if defined(OPT_ACCURACY) -/* - * This gives best accuracy but is not very fast. - */ -# define MAD_F_MLA(hi, lo, x, y) \ - ({ mad_fixed64hi_t __hi; \ - mad_fixed64lo_t __lo; \ - MAD_F_MLX(__hi, __lo, (x), (y)); \ - asm ("addl %2,%0\n\t" \ - "adcl %3,%1" \ - : "=rm" (lo), "=rm" (hi) \ - : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \ - : "cc"); \ - }) -# endif /* OPT_ACCURACY */ - -# if defined(OPT_ACCURACY) -/* - * Surprisingly, this is faster than SHRD followed by ADC. - */ -# define mad_f_scale64(hi, lo) \ - ({ mad_fixed64hi_t __hi_; \ - mad_fixed64lo_t __lo_; \ - mad_fixed_t __result; \ - asm ("addl %4,%2\n\t" \ - "adcl %5,%3" \ - : "=rm" (__lo_), "=rm" (__hi_) \ - : "0" (lo), "1" (hi), \ - "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \ - : "cc"); \ - asm ("shrdl %3,%2,%1" \ - : "=rm" (__result) \ - : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \ - : "cc"); \ - __result; \ - }) -# elif defined(OPT_INTEL) -/* - * Alternate Intel scaling that may or may not perform better. - */ -# define mad_f_scale64(hi, lo) \ - ({ mad_fixed_t __result; \ - asm ("shrl %3,%1\n\t" \ - "shll %4,%2\n\t" \ - "orl %2,%1" \ - : "=rm" (__result) \ - : "0" (lo), "r" (hi), \ - "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \ - : "cc"); \ - __result; \ - }) -# else -# define mad_f_scale64(hi, lo) \ - ({ mad_fixed_t __result; \ - asm ("shrdl %3,%2,%1" \ - : "=rm" (__result) \ - : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \ - : "cc"); \ - __result; \ - }) -# endif /* OPT_ACCURACY */ - -# define MAD_F_SCALEBITS MAD_F_FRACBITS -# endif - -/* --- ARM ----------------------------------------------------------------- */ - -# elif defined(FPM_ARM) - -/* - * This ARM V4 version is as accurate as FPM_64BIT but much faster. The - * least significant bit is properly rounded at no CPU cycle cost! - */ -# if 1 -/* - * This is faster than the default implementation via MAD_F_MLX() and - * mad_f_scale64(). - */ -# define mad_f_mul(x, y) \ - ({ mad_fixed64hi_t __hi; \ - mad_fixed64lo_t __lo; \ - mad_fixed_t __result; \ - asm ("smull %0, %1, %3, %4\n\t" \ - "movs %0, %0, lsr %5\n\t" \ - "adc %2, %0, %1, lsl %6" \ - : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \ - : "%r" (x), "r" (y), \ - "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \ - : "cc"); \ - __result; \ - }) -# endif - -# define MAD_F_MLX(hi, lo, x, y) \ - asm ("smull %0, %1, %2, %3" \ - : "=&r" (lo), "=&r" (hi) \ - : "%r" (x), "r" (y)) - -# define MAD_F_MLA(hi, lo, x, y) \ - asm ("smlal %0, %1, %2, %3" \ - : "+r" (lo), "+r" (hi) \ - : "%r" (x), "r" (y)) - -#ifdef __thumb__ -/* In Thumb-2, the RSB-immediate instruction is only allowed with a zero - operand. If needed this code can also support Thumb-1 - (simply append "s" to the end of the second two instructions). */ -# define MAD_F_MLN(hi, lo) \ - asm ("rsbs %0, %0, #0\n\t" \ - "sbc %1, %1, %1\n\t" \ - "sub %1, %1, %2" \ - : "+&r" (lo), "=&r" (hi) \ - : "r" (hi) \ - : "cc") -#else /* ! __thumb__ */ -# define MAD_F_MLN(hi, lo) \ - asm ("rsbs %0, %2, #0\n\t" \ - "rsc %1, %3, #0" \ - : "=&r" (lo), "=r" (hi) \ - : "0" (lo), "1" (hi) \ - : "cc") -#endif /* __thumb__ */ - -# define mad_f_scale64(hi, lo) \ - ({ mad_fixed_t __result; \ - asm ("movs %0, %1, lsr %3\n\t" \ - "adc %0, %0, %2, lsl %4" \ - : "=&r" (__result) \ - : "r" (lo), "r" (hi), \ - "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \ - : "cc"); \ - __result; \ - }) - -# define MAD_F_SCALEBITS MAD_F_FRACBITS - -/* --- MIPS ---------------------------------------------------------------- */ - -# elif defined(FPM_MIPS) - -#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) - typedef unsigned int u64_di_t __attribute__ ((mode (DI))); -# define MAD_F_MLX(hi, lo, x, y) \ - do { \ - u64_di_t __ll = (u64_di_t) (x) * (y); \ - hi = __ll >> 32; \ - lo = __ll; \ - } while (0) -#else -/* - * This MIPS version is fast and accurate; the disposition of the least - * significant bit depends on OPT_ACCURACY via mad_f_scale64(). - */ -# define MAD_F_MLX(hi, lo, x, y) \ - asm ("mult %2,%3" \ - : "=l" (lo), "=h" (hi) \ - : "%r" (x), "r" (y)) - -# if defined(HAVE_MADD_ASM) -# define MAD_F_MLA(hi, lo, x, y) \ - asm ("madd %2,%3" \ - : "+l" (lo), "+h" (hi) \ - : "%r" (x), "r" (y)) -# elif defined(HAVE_MADD16_ASM) -/* - * This loses significant accuracy due to the 16-bit integer limit in the - * multiply/accumulate instruction. - */ -# define MAD_F_ML0(hi, lo, x, y) \ - asm ("mult %2,%3" \ - : "=l" (lo), "=h" (hi) \ - : "%r" ((x) >> 12), "r" ((y) >> 16)) -# define MAD_F_MLA(hi, lo, x, y) \ - asm ("madd16 %2,%3" \ - : "+l" (lo), "+h" (hi) \ - : "%r" ((x) >> 12), "r" ((y) >> 16)) -# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) -# endif -#endif /* MIPS / gcc-4.4. */ - -# if defined(OPT_SPEED) -# define mad_f_scale64(hi, lo) \ - ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS))) -# define MAD_F_SCALEBITS MAD_F_FRACBITS -# endif - -/* --- SPARC --------------------------------------------------------------- */ - -# elif defined(FPM_SPARC) - -/* - * This SPARC V8 version is fast and accurate; the disposition of the least - * significant bit depends on OPT_ACCURACY via mad_f_scale64(). - */ -# define MAD_F_MLX(hi, lo, x, y) \ - asm ("smul %2, %3, %0\n\t" \ - "rd %%y, %1" \ - : "=r" (lo), "=r" (hi) \ - : "%r" (x), "rI" (y)) - -/* --- PowerPC ------------------------------------------------------------- */ - -# elif defined(FPM_PPC) - -/* - * This PowerPC version is fast and accurate; the disposition of the least - * significant bit depends on OPT_ACCURACY via mad_f_scale64(). - */ -# define MAD_F_MLX(hi, lo, x, y) \ - do { \ - asm ("mullw %0,%1,%2" \ - : "=r" (lo) \ - : "%r" (x), "r" (y)); \ - asm ("mulhw %0,%1,%2" \ - : "=r" (hi) \ - : "%r" (x), "r" (y)); \ - } \ - while (0) - -# if defined(OPT_ACCURACY) -/* - * This gives best accuracy but is not very fast. - */ -# define MAD_F_MLA(hi, lo, x, y) \ - ({ mad_fixed64hi_t __hi; \ - mad_fixed64lo_t __lo; \ - MAD_F_MLX(__hi, __lo, (x), (y)); \ - asm ("addc %0,%2,%3\n\t" \ - "adde %1,%4,%5" \ - : "=r" (lo), "=r" (hi) \ - : "0" (lo), "r" (__lo), \ - "1" (hi), "r" (__hi) \ - : "xer"); \ - }) -# endif - -# if defined(OPT_ACCURACY) -/* - * This is slower than the truncating version below it. - */ -# define mad_f_scale64(hi, lo) \ - ({ mad_fixed_t __result, __round; \ - asm ("rotrwi %0,%1,%2" \ - : "=r" (__result) \ - : "r" (lo), "i" (MAD_F_SCALEBITS)); \ - asm ("extrwi %0,%1,1,0" \ - : "=r" (__round) \ - : "r" (__result)); \ - asm ("insrwi %0,%1,%2,0" \ - : "+r" (__result) \ - : "r" (hi), "i" (MAD_F_SCALEBITS)); \ - asm ("add %0,%1,%2" \ - : "=r" (__result) \ - : "%r" (__result), "r" (__round)); \ - __result; \ - }) -# else -# define mad_f_scale64(hi, lo) \ - ({ mad_fixed_t __result; \ - asm ("rotrwi %0,%1,%2" \ - : "=r" (__result) \ - : "r" (lo), "i" (MAD_F_SCALEBITS)); \ - asm ("insrwi %0,%1,%2,0" \ - : "+r" (__result) \ - : "r" (hi), "i" (MAD_F_SCALEBITS)); \ - __result; \ - }) -# endif - -# define MAD_F_SCALEBITS MAD_F_FRACBITS - -/* --- Default ------------------------------------------------------------- */ - -# elif defined(FPM_DEFAULT) - -/* - * This version is the most portable but it loses significant accuracy. - * Furthermore, accuracy is biased against the second argument, so care - * should be taken when ordering operands. - * - * The scale factors are constant as this is not used with SSO. - * - * Pre-rounding is required to stay within the limits of compliance. - */ -# if defined(OPT_SPEED) -# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16)) -# else -# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \ - (((y) + (1L << 15)) >> 16)) -# endif - -/* ------------------------------------------------------------------------- */ - -# else -# error "no FPM selected" -# endif - -/* default implementations */ - -# if !defined(mad_f_mul) -# define mad_f_mul(x, y) \ - ({ register mad_fixed64hi_t __hi; \ - register mad_fixed64lo_t __lo; \ - MAD_F_MLX(__hi, __lo, (x), (y)); \ - mad_f_scale64(__hi, __lo); \ - }) -# endif - -# if !defined(MAD_F_MLA) -# define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y))) -# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y))) -# define MAD_F_MLN(hi, lo) ((lo) = -(lo)) -# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo)) -# endif - -# if !defined(MAD_F_ML0) -# define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y)) -# endif - -# if !defined(MAD_F_MLN) -# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi)) -# endif - -# if !defined(MAD_F_MLZ) -# define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo)) -# endif - -# if !defined(mad_f_scale64) -# if defined(OPT_ACCURACY) -# define mad_f_scale64(hi, lo) \ - ((((mad_fixed_t) \ - (((hi) << (32 - (MAD_F_SCALEBITS - 1))) | \ - ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1) -# else -# define mad_f_scale64(hi, lo) \ - ((mad_fixed_t) \ - (((hi) << (32 - MAD_F_SCALEBITS)) | \ - ((lo) >> MAD_F_SCALEBITS))) -# endif -# define MAD_F_SCALEBITS MAD_F_FRACBITS -# endif - -/* C routines */ - -mad_fixed_t mad_f_abs(mad_fixed_t); -mad_fixed_t mad_f_div(mad_fixed_t, mad_fixed_t); - -# endif - -/* Id: bit.h,v 1.12 2004/01/23 09:41:32 rob Exp */ - -# ifndef LIBMAD_BIT_H -# define LIBMAD_BIT_H - -struct mad_bitptr { - unsigned char const *byte; - unsigned short cache; - unsigned short left; -}; - -void mad_bit_init(struct mad_bitptr *, unsigned char const *); - -# define mad_bit_finish(bitptr) /* nothing */ - -unsigned int mad_bit_length(struct mad_bitptr const *, - struct mad_bitptr const *); - -# define mad_bit_bitsleft(bitptr) ((bitptr)->left) -unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *); - -void mad_bit_skip(struct mad_bitptr *, unsigned int); -unsigned long mad_bit_read(struct mad_bitptr *, unsigned int); -void mad_bit_write(struct mad_bitptr *, unsigned int, unsigned long); - -unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short); - -# endif - -/* Id: timer.h,v 1.16 2004/01/23 09:41:33 rob Exp */ - -# ifndef LIBMAD_TIMER_H -# define LIBMAD_TIMER_H - -typedef struct { - signed long seconds; /* whole seconds */ - unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */ -} mad_timer_t; - -extern mad_timer_t const mad_timer_zero; - -# define MAD_TIMER_RESOLUTION 352800000UL - -enum mad_units { - MAD_UNITS_HOURS = -2, - MAD_UNITS_MINUTES = -1, - MAD_UNITS_SECONDS = 0, - - /* metric units */ - - MAD_UNITS_DECISECONDS = 10, - MAD_UNITS_CENTISECONDS = 100, - MAD_UNITS_MILLISECONDS = 1000, - - /* audio sample units */ - - MAD_UNITS_8000_HZ = 8000, - MAD_UNITS_11025_HZ = 11025, - MAD_UNITS_12000_HZ = 12000, - - MAD_UNITS_16000_HZ = 16000, - MAD_UNITS_22050_HZ = 22050, - MAD_UNITS_24000_HZ = 24000, - - MAD_UNITS_32000_HZ = 32000, - MAD_UNITS_44100_HZ = 44100, - MAD_UNITS_48000_HZ = 48000, - - /* video frame/field units */ - - MAD_UNITS_24_FPS = 24, - MAD_UNITS_25_FPS = 25, - MAD_UNITS_30_FPS = 30, - MAD_UNITS_48_FPS = 48, - MAD_UNITS_50_FPS = 50, - MAD_UNITS_60_FPS = 60, - - /* CD audio frames */ - - MAD_UNITS_75_FPS = 75, - - /* video drop-frame units */ - - MAD_UNITS_23_976_FPS = -24, - MAD_UNITS_24_975_FPS = -25, - MAD_UNITS_29_97_FPS = -30, - MAD_UNITS_47_952_FPS = -48, - MAD_UNITS_49_95_FPS = -50, - MAD_UNITS_59_94_FPS = -60 -}; - -# define mad_timer_reset(timer) ((void) (*(timer) = mad_timer_zero)) - -int mad_timer_compare(mad_timer_t, mad_timer_t); - -# define mad_timer_sign(timer) mad_timer_compare((timer), mad_timer_zero) - -void mad_timer_negate(mad_timer_t *); -mad_timer_t mad_timer_abs(mad_timer_t); - -void mad_timer_set(mad_timer_t *, unsigned long, unsigned long, unsigned long); -void mad_timer_add(mad_timer_t *, mad_timer_t); -void mad_timer_multiply(mad_timer_t *, signed long); - -signed long mad_timer_count(mad_timer_t, enum mad_units); -unsigned long mad_timer_fraction(mad_timer_t, unsigned long); -void mad_timer_string(mad_timer_t, char *, char const *, - enum mad_units, enum mad_units, unsigned long); - -# endif - -/* Id: stream.h,v 1.20 2004/02/05 09:02:39 rob Exp */ - -# ifndef LIBMAD_STREAM_H -# define LIBMAD_STREAM_H - - -# define MAD_BUFFER_GUARD 8 -# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD) - -enum mad_error { - MAD_ERROR_NONE = 0x0000, /* no error */ - - MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */ - MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */ - - MAD_ERROR_NOMEM = 0x0031, /* not enough memory */ - - MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */ - MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */ - MAD_ERROR_BADBITRATE = 0x0103, /* forbidden bitrate value */ - MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */ - MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */ - - MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */ - MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */ - MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */ - MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */ - MAD_ERROR_BADFRAMELEN = 0x0231, /* bad frame length */ - MAD_ERROR_BADBIGVALUES = 0x0232, /* bad big_values count */ - MAD_ERROR_BADBLOCKTYPE = 0x0233, /* reserved block_type */ - MAD_ERROR_BADSCFSI = 0x0234, /* bad scalefactor selection info */ - MAD_ERROR_BADDATAPTR = 0x0235, /* bad main_data_begin pointer */ - MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */ - MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */ - MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */ - MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */ -}; - -# define MAD_RECOVERABLE(error) ((error) & 0xff00) - -struct mad_stream { - unsigned char const *buffer; /* input bitstream buffer */ - unsigned char const *bufend; /* end of buffer */ - unsigned long skiplen; /* bytes to skip before next frame */ - - int sync; /* stream sync found */ - unsigned long freerate; /* free bitrate (fixed) */ - - unsigned char const *this_frame; /* start of current frame */ - unsigned char const *next_frame; /* start of next frame */ - struct mad_bitptr ptr; /* current processing bit pointer */ - - struct mad_bitptr anc_ptr; /* ancillary bits pointer */ - unsigned int anc_bitlen; /* number of ancillary bits */ - - unsigned char (*main_data)[MAD_BUFFER_MDLEN]; - /* Layer III main_data() */ - unsigned int md_len; /* bytes in main_data */ - - int options; /* decoding options (see below) */ - enum mad_error error; /* error code (see above) */ -}; - -enum { - MAD_OPTION_IGNORECRC = 0x0001, /* ignore CRC errors */ - MAD_OPTION_HALFSAMPLERATE = 0x0002 /* generate PCM at 1/2 sample rate */ -# if 0 /* not yet implemented */ - MAD_OPTION_LEFTCHANNEL = 0x0010, /* decode left channel only */ - MAD_OPTION_RIGHTCHANNEL = 0x0020, /* decode right channel only */ - MAD_OPTION_SINGLECHANNEL = 0x0030 /* combine channels */ -# endif -}; - -void mad_stream_init(struct mad_stream *); -void mad_stream_finish(struct mad_stream *); - -# define mad_stream_options(stream, opts) \ - ((void) ((stream)->options = (opts))) - -void mad_stream_buffer(struct mad_stream *, - unsigned char const *, unsigned long); -void mad_stream_skip(struct mad_stream *, unsigned long); - -int mad_stream_sync(struct mad_stream *); - -char const *mad_stream_errorstr(struct mad_stream const *); - -# endif - -/* Id: frame.h,v 1.20 2004/01/23 09:41:32 rob Exp */ - -# ifndef LIBMAD_FRAME_H -# define LIBMAD_FRAME_H - - -enum mad_layer { - MAD_LAYER_I = 1, /* Layer I */ - MAD_LAYER_II = 2, /* Layer II */ - MAD_LAYER_III = 3 /* Layer III */ -}; - -enum mad_mode { - MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */ - MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */ - MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */ - MAD_MODE_STEREO = 3 /* normal LR stereo */ -}; - -enum mad_emphasis { - MAD_EMPHASIS_NONE = 0, /* no emphasis */ - MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */ - MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */ - MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */ -}; - -struct mad_header { - enum mad_layer layer; /* audio layer (1, 2, or 3) */ - enum mad_mode mode; /* channel mode (see above) */ - int mode_extension; /* additional mode info */ - enum mad_emphasis emphasis; /* de-emphasis to use (see above) */ - - unsigned long bitrate; /* stream bitrate (bps) */ - unsigned int samplerate; /* sampling frequency (Hz) */ - - unsigned short crc_check; /* frame CRC accumulator */ - unsigned short crc_target; /* final target CRC checksum */ - - int flags; /* flags (see below) */ - int private_bits; /* private bits (see below) */ - - mad_timer_t duration; /* audio playing time of frame */ -}; - -struct mad_frame { - struct mad_header header; /* MPEG audio header */ - - int options; /* decoding options (from stream) */ - - mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples */ - mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ -}; - -# define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1) -# define MAD_NSBSAMPLES(header) \ - ((header)->layer == MAD_LAYER_I ? 12 : \ - (((header)->layer == MAD_LAYER_III && \ - ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36)) - -enum { - MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */ - MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */ - - MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */ - MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */ - MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */ - MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */ - - MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */ - MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */ - MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */ - - MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */ - MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */ - MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */ -}; - -enum { - MAD_PRIVATE_HEADER = 0x0100, /* header private bit */ - MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */ -}; - -void mad_header_init(struct mad_header *); - -# define mad_header_finish(header) /* nothing */ - -int mad_header_decode(struct mad_header *, struct mad_stream *); - -void mad_frame_init(struct mad_frame *); -void mad_frame_finish(struct mad_frame *); - -int mad_frame_decode(struct mad_frame *, struct mad_stream *); - -void mad_frame_mute(struct mad_frame *); - -# endif - -/* Id: synth.h,v 1.15 2004/01/23 09:41:33 rob Exp */ - -# ifndef LIBMAD_SYNTH_H -# define LIBMAD_SYNTH_H - - -struct mad_pcm { - unsigned int samplerate; /* sampling frequency (Hz) */ - unsigned short channels; /* number of channels */ - unsigned short length; /* number of samples per channel */ - mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */ -}; - -struct mad_synth { - mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */ - /* [ch][eo][peo][s][v] */ - - unsigned int phase; /* current processing phase */ - - struct mad_pcm pcm; /* PCM output */ -}; - -/* single channel PCM selector */ -enum { - MAD_PCM_CHANNEL_SINGLE = 0 -}; - -/* dual channel PCM selector */ -enum { - MAD_PCM_CHANNEL_DUAL_1 = 0, - MAD_PCM_CHANNEL_DUAL_2 = 1 -}; - -/* stereo PCM selector */ -enum { - MAD_PCM_CHANNEL_STEREO_LEFT = 0, - MAD_PCM_CHANNEL_STEREO_RIGHT = 1 -}; - -void mad_synth_init(struct mad_synth *); - -# define mad_synth_finish(synth) /* nothing */ - -void mad_synth_mute(struct mad_synth *); - -void mad_synth_frame(struct mad_synth *, struct mad_frame const *); - -# endif - -/* Id: decoder.h,v 1.17 2004/01/23 09:41:32 rob Exp */ - -# ifndef LIBMAD_DECODER_H -# define LIBMAD_DECODER_H - - -enum mad_decoder_mode { - MAD_DECODER_MODE_SYNC = 0, - MAD_DECODER_MODE_ASYNC -}; - -enum mad_flow { - MAD_FLOW_CONTINUE = 0x0000, /* continue normally */ - MAD_FLOW_STOP = 0x0010, /* stop decoding normally */ - MAD_FLOW_BREAK = 0x0011, /* stop decoding and signal an error */ - MAD_FLOW_IGNORE = 0x0020 /* ignore the current frame */ -}; - -struct mad_decoder { - enum mad_decoder_mode mode; - - int options; - - struct { - long pid; - int in; - int out; - } async; - - struct { - struct mad_stream stream; - struct mad_frame frame; - struct mad_synth synth; - } *sync; - - void *cb_data; - - enum mad_flow (*input_func)(void *, struct mad_stream *); - enum mad_flow (*header_func)(void *, struct mad_header const *); - enum mad_flow (*filter_func)(void *, - struct mad_stream const *, struct mad_frame *); - enum mad_flow (*output_func)(void *, - struct mad_header const *, struct mad_pcm *); - enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *); - enum mad_flow (*message_func)(void *, void *, unsigned int *); -}; - -void mad_decoder_init(struct mad_decoder *, void *, - enum mad_flow (*)(void *, struct mad_stream *), - enum mad_flow (*)(void *, struct mad_header const *), - enum mad_flow (*)(void *, - struct mad_stream const *, - struct mad_frame *), - enum mad_flow (*)(void *, - struct mad_header const *, - struct mad_pcm *), - enum mad_flow (*)(void *, - struct mad_stream *, - struct mad_frame *), - enum mad_flow (*)(void *, void *, unsigned int *)); -int mad_decoder_finish(struct mad_decoder *); - -# define mad_decoder_options(decoder, opts) \ - ((void) ((decoder)->options = (opts))) - -int mad_decoder_run(struct mad_decoder *, enum mad_decoder_mode); -int mad_decoder_message(struct mad_decoder *, void *, unsigned int *); - -# endif - -# ifdef __cplusplus -} -# endif diff --git a/MacOSX/codecs/include/mikmod.h b/MacOSX/codecs/include/mikmod.h deleted file mode 100644 index 7822a74d..00000000 --- a/MacOSX/codecs/include/mikmod.h +++ /dev/null @@ -1,879 +0,0 @@ -/* MikMod sound library - (c) 1998-2014 Miodrag Vallat and others - see the AUTHORS file - for complete list. - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU Library 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 Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ - -/*============================================================================== - - MikMod sound library include file - - ==============================================================================*/ - -#ifndef _MIKMOD_H_ -#define _MIKMOD_H_ - -#include <stdio.h> -#include <stdlib.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * ========== Compiler magic for shared libraries - * - * ========== NOTE TO WINDOWS DEVELOPERS: - * If you are compiling for Windows and will link to the static library - * (libmikmod.a with MinGW, or mikmod_static.lib with MSVC or LCC, etc), - * you must define MIKMOD_STATIC in your project. Otherwise, dllimport - * will be assumed. - */ -#if defined(_WIN32) || defined(__CYGWIN__) -# if defined(MIKMOD_BUILD) && defined(DLL_EXPORT) /* building libmikmod as a dll for windows */ -# define MIKMODAPI __declspec(dllexport) -# elif defined(MIKMOD_BUILD) || defined(MIKMOD_STATIC) /* building or using static libmikmod for windows */ -# define MIKMODAPI -# else -# define MIKMODAPI __declspec(dllimport) /* using libmikmod dll for windows */ -# endif -#elif defined(__OS2__) && defined(__WATCOMC__) -# if defined(MIKMOD_BUILD) && defined(__SW_BD) /* building libmikmod as a dll for os/2 */ -# define MIKMODAPI __declspec(dllexport) -# else -# define MIKMODAPI /* using dll or static libmikmod for os/2 */ -# endif -/* SYM_VISIBILITY should be defined if both the compiler - * and the target support the visibility attributes. the - * configury does that automatically. for the standalone - * makefiles, etc, the developer should add the required - * flags, i.e.: -DSYM_VISIBILITY -fvisibility=hidden */ -#elif defined(MIKMOD_BUILD) && defined(SYM_VISIBILITY) -# define MIKMODAPI __attribute__((visibility("default"))) -#else -# define MIKMODAPI -#endif - -/* - * ========== Library version - */ - -#define LIBMIKMOD_VERSION_MAJOR 3L -#define LIBMIKMOD_VERSION_MINOR 3L -#define LIBMIKMOD_REVISION 11L - -#define LIBMIKMOD_VERSION \ - ((LIBMIKMOD_VERSION_MAJOR<<16)| \ - (LIBMIKMOD_VERSION_MINOR<< 8)| \ - (LIBMIKMOD_REVISION)) - -MIKMODAPI extern long MikMod_GetVersion(void); - -/* - * ========== Dependency platform headers - */ - -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include <windows.h> -#include <io.h> -#include <mmsystem.h> -#define _MIKMOD_WIN32 -#endif - -#if defined(__DJGPP__) || defined(MSDOS) || defined(__MSDOS__) || defined(__DOS__) -#define _MIKMOD_DOS -#endif - -#if defined(__OS2__) || defined(__EMX__) -#define INCL_DOSSEMAPHORES -#include <os2.h> -#include <io.h> -#define _MIKMOD_OS2 -#endif - -#if defined(__MORPHOS__) || defined(__AROS__) || defined(_AMIGA) || defined(__AMIGA__) || defined(__amigaos__) || defined(AMIGAOS) -#include <exec/types.h> -#define _MIKMOD_AMIGA -#endif - -/* - * ========== Platform independent-type definitions - * (pain when it comes to cross-platform maintenance..) - */ - -#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32)) -typedef char CHAR; -#endif - -/* BOOL: 0=false, <>0 true -- 16 bits on Amiga, int-wide on others. */ -#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA)) -typedef int BOOL; -#endif - -/* 1 byte, signed and unsigned: */ -typedef signed char SBYTE; -#ifndef _MIKMOD_AMIGA -typedef unsigned char UBYTE; -#endif - -/* 2 bytes, signed and unsigned: */ -#if !(defined __LCC__ && defined _WIN32) -typedef signed short int SWORD; -#endif -#if !((defined __LCC__ && defined _WIN32) || defined(_MIKMOD_AMIGA)) -typedef unsigned short int UWORD; -#endif - -/* 4 bytes, signed and unsigned: */ -#if defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__) - /* 64 bit architectures: */ -typedef signed int SLONG; -#if !(defined(_WIN32) || defined(_MIKMOD_AMIGA)) -typedef unsigned int ULONG; -#endif - -#else /* 32 bit architectures: */ -typedef signed long int SLONG; -#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA)) -typedef unsigned long int ULONG; -#endif -#endif - -/* make sure types are of correct sizes: */ -typedef int __mikmod_typetest [ - ( - (sizeof(SBYTE)==1) && (sizeof(UBYTE)==1) - && (sizeof(SWORD)==2) && (sizeof(UWORD)==2) - && (sizeof(SLONG)==4) && (sizeof(ULONG)==4) -#ifndef _MIKMOD_AMIGA - && (sizeof(BOOL) == sizeof(int)) -#endif - && (sizeof(CHAR) == sizeof(char)) - ) * 2 - 1 ]; - -/* - * ========== Error codes - */ - -enum { - MMERR_OPENING_FILE = 1, - MMERR_OUT_OF_MEMORY, - MMERR_DYNAMIC_LINKING, - - MMERR_SAMPLE_TOO_BIG, - MMERR_OUT_OF_HANDLES, - MMERR_UNKNOWN_WAVE_TYPE, - - MMERR_LOADING_PATTERN, - MMERR_LOADING_TRACK, - MMERR_LOADING_HEADER, - MMERR_LOADING_SAMPLEINFO, - MMERR_NOT_A_MODULE, - MMERR_NOT_A_STREAM, - MMERR_MED_SYNTHSAMPLES, - MMERR_ITPACK_INVALID_DATA, - - MMERR_DETECTING_DEVICE, - MMERR_INVALID_DEVICE, - MMERR_INITIALIZING_MIXER, - MMERR_OPENING_AUDIO, - MMERR_8BIT_ONLY, - MMERR_16BIT_ONLY, - MMERR_STEREO_ONLY, - MMERR_ULAW, - MMERR_NON_BLOCK, - - MMERR_AF_AUDIO_PORT, - - MMERR_AIX_CONFIG_INIT, - MMERR_AIX_CONFIG_CONTROL, - MMERR_AIX_CONFIG_START, - - MMERR_GUS_SETTINGS, - MMERR_GUS_RESET, - MMERR_GUS_TIMER, - - MMERR_HP_SETSAMPLESIZE, - MMERR_HP_SETSPEED, - MMERR_HP_CHANNELS, - MMERR_HP_AUDIO_OUTPUT, - MMERR_HP_AUDIO_DESC, - MMERR_HP_BUFFERSIZE, - - MMERR_OSS_SETFRAGMENT, - MMERR_OSS_SETSAMPLESIZE, - MMERR_OSS_SETSTEREO, - MMERR_OSS_SETSPEED, - - MMERR_SGI_SPEED, - MMERR_SGI_16BIT, - MMERR_SGI_8BIT, - MMERR_SGI_STEREO, - MMERR_SGI_MONO, - - MMERR_SUN_INIT, - - MMERR_OS2_MIXSETUP, - MMERR_OS2_SEMAPHORE, - MMERR_OS2_TIMER, - MMERR_OS2_THREAD, - - MMERR_DS_PRIORITY, - MMERR_DS_BUFFER, - MMERR_DS_FORMAT, - MMERR_DS_NOTIFY, - MMERR_DS_EVENT, - MMERR_DS_THREAD, - MMERR_DS_UPDATE, - - MMERR_WINMM_HANDLE, - MMERR_WINMM_ALLOCATED, - MMERR_WINMM_DEVICEID, - MMERR_WINMM_FORMAT, - MMERR_WINMM_UNKNOWN, - - MMERR_MAC_SPEED, - MMERR_MAC_START, - - MMERR_OSX_UNKNOWN_DEVICE, - MMERR_OSX_BAD_PROPERTY, - MMERR_OSX_UNSUPPORTED_FORMAT, - MMERR_OSX_SET_STEREO, - MMERR_OSX_BUFFER_ALLOC, - MMERR_OSX_ADD_IO_PROC, - MMERR_OSX_DEVICE_START, - MMERR_OSX_PTHREAD, - - MMERR_DOSWSS_STARTDMA, - MMERR_DOSSB_STARTDMA, - - MMERR_NO_FLOAT32,/* should actually be after MMERR_ULAW or something */ - - MMERR_OPENAL_CREATECTX, - MMERR_OPENAL_CTXCURRENT, - MMERR_OPENAL_GENBUFFERS, - MMERR_OPENAL_GENSOURCES, - MMERR_OPENAL_SOURCE, - MMERR_OPENAL_QUEUEBUFFERS, - MMERR_OPENAL_UNQUEUEBUFFERS, - MMERR_OPENAL_BUFFERDATA, - MMERR_OPENAL_GETSOURCE, - MMERR_OPENAL_SOURCEPLAY, - MMERR_OPENAL_SOURCESTOP, - - MMERR_ALSA_NOCONFIG, - MMERR_ALSA_SETPARAMS, - MMERR_ALSA_SETFORMAT, - MMERR_ALSA_SETRATE, - MMERR_ALSA_SETCHANNELS, - MMERR_ALSA_BUFFERSIZE, - MMERR_ALSA_PCM_START, - MMERR_ALSA_PCM_WRITE, - MMERR_ALSA_PCM_RECOVER, - - MMERR_SNDIO_SETPARAMS, - MMERR_SNDIO_BADPARAMS, - - MMERR_MAX -}; - -/* - * ========== Error handling - */ - -typedef void (MikMod_handler)(void); -typedef MikMod_handler *MikMod_handler_t; - -MIKMODAPI extern int MikMod_errno; -MIKMODAPI extern BOOL MikMod_critical; -MIKMODAPI extern const char *MikMod_strerror(int); - -MIKMODAPI extern MikMod_handler_t MikMod_RegisterErrorHandler(MikMod_handler_t); - -/* - * ========== Library initialization and core functions - */ - -struct MDRIVER; - -MIKMODAPI extern void MikMod_RegisterAllDrivers(void); - -MIKMODAPI extern CHAR* MikMod_InfoDriver(void); -MIKMODAPI extern void MikMod_RegisterDriver(struct MDRIVER*); -MIKMODAPI extern int MikMod_DriverFromAlias(const CHAR*); -MIKMODAPI extern struct MDRIVER *MikMod_DriverByOrdinal(int); - -MIKMODAPI extern int MikMod_Init(const CHAR*); -MIKMODAPI extern void MikMod_Exit(void); -MIKMODAPI extern int MikMod_Reset(const CHAR*); -MIKMODAPI extern int MikMod_SetNumVoices(int,int); -MIKMODAPI extern BOOL MikMod_Active(void); -MIKMODAPI extern int MikMod_EnableOutput(void); -MIKMODAPI extern void MikMod_DisableOutput(void); -MIKMODAPI extern void MikMod_Update(void); - -MIKMODAPI extern BOOL MikMod_InitThreads(void); -MIKMODAPI extern void MikMod_Lock(void); -MIKMODAPI extern void MikMod_Unlock(void); - -MIKMODAPI extern void* MikMod_malloc(size_t); -MIKMODAPI extern void* MikMod_calloc(size_t,size_t); -MIKMODAPI extern void* MikMod_realloc(void*,size_t); -MIKMODAPI extern CHAR* MikMod_strdup(const CHAR*); -MIKMODAPI extern void MikMod_free(void*); /* frees if ptr != NULL */ - -/* - * ========== Reader, Writer - */ - -typedef struct MREADER { - int (*Seek)(struct MREADER*,long,int); - long (*Tell)(struct MREADER*); - BOOL (*Read)(struct MREADER*,void*,size_t); - int (*Get)(struct MREADER*); - BOOL (*Eof)(struct MREADER*); - long iobase; - long prev_iobase; -} MREADER; - -typedef struct MWRITER { - int (*Seek)(struct MWRITER*, long, int); - long (*Tell)(struct MWRITER*); - BOOL (*Write)(struct MWRITER*, const void*, size_t); - int (*Put)(struct MWRITER*, int); -} MWRITER; - -/* - * ========== Samples - */ - -/* Sample playback should not be interrupted */ -#define SFX_CRITICAL 1 - -/* Sample format [loading and in-memory] flags: */ -#define SF_16BITS 0x0001 -#define SF_STEREO 0x0002 -#define SF_SIGNED 0x0004 -#define SF_BIG_ENDIAN 0x0008 -#define SF_DELTA 0x0010 -#define SF_ITPACKED 0x0020 - -#define SF_FORMATMASK 0x003F - -/* General Playback flags */ - -#define SF_LOOP 0x0100 -#define SF_BIDI 0x0200 -#define SF_REVERSE 0x0400 -#define SF_SUSTAIN 0x0800 - -#define SF_PLAYBACKMASK 0x0C00 - -/* Module-only Playback Flags */ - -#define SF_OWNPAN 0x1000 -#define SF_UST_LOOP 0x2000 - -#define SF_EXTRAPLAYBACKMASK 0x3000 - -/* Panning constants */ -#define PAN_LEFT 0 -#define PAN_HALFLEFT 64 -#define PAN_CENTER 128 -#define PAN_HALFRIGHT 192 -#define PAN_RIGHT 255 -#define PAN_SURROUND 512 /* panning value for Dolby Surround */ - -typedef struct SAMPLE { - SWORD panning; /* panning (0-255 or PAN_SURROUND) */ - ULONG speed; /* Base playing speed/frequency of note */ - UBYTE volume; /* volume 0-64 */ - UWORD inflags; /* sample format on disk */ - UWORD flags; /* sample format in memory */ - ULONG length; /* length of sample (in samples!) */ - ULONG loopstart; /* repeat position (relative to start, in samples) */ - ULONG loopend; /* repeat end */ - ULONG susbegin; /* sustain loop begin (in samples) \ Not Supported */ - ULONG susend; /* sustain loop end / Yet! */ - - /* Variables used by the module player only! (ignored for sound effects) */ - UBYTE globvol; /* global volume */ - UBYTE vibflags; /* autovibrato flag stuffs */ - UBYTE vibtype; /* Vibratos moved from INSTRUMENT to SAMPLE */ - UBYTE vibsweep; - UBYTE vibdepth; - UBYTE vibrate; - CHAR* samplename; /* name of the sample */ - - /* Values used internally only */ - UWORD avibpos; /* autovibrato pos [player use] */ - UBYTE divfactor; /* for sample scaling, maintains proper period slides */ - ULONG seekpos; /* seek position in file */ - SWORD handle; /* sample handle used by individual drivers */ - void (*onfree)(void *ctx); /* called from Sample_Free if not NULL */ - void *ctx; /* context passed to previous function*/ -} SAMPLE; - -/* Sample functions */ - -MIKMODAPI extern SAMPLE *Sample_LoadRaw(const CHAR *,ULONG rate, ULONG channel, ULONG flags); -MIKMODAPI extern SAMPLE *Sample_LoadRawFP(FILE *fp,ULONG rate,ULONG channel, ULONG flags); -MIKMODAPI extern SAMPLE *Sample_LoadRawMem(const char *buf, int len, ULONG rate, ULONG channel, ULONG flags); -MIKMODAPI extern SAMPLE *Sample_LoadRawGeneric(MREADER*reader,ULONG rate, ULONG channel, ULONG flags); - -MIKMODAPI extern SAMPLE *Sample_Load(const CHAR*); -MIKMODAPI extern SAMPLE *Sample_LoadFP(FILE*); -MIKMODAPI extern SAMPLE *Sample_LoadMem(const char *buf, int len); -MIKMODAPI extern SAMPLE *Sample_LoadGeneric(MREADER*); -MIKMODAPI extern void Sample_Free(SAMPLE*); -MIKMODAPI extern SBYTE Sample_Play(SAMPLE*,ULONG,UBYTE); - -MIKMODAPI extern void Voice_SetVolume(SBYTE,UWORD); -MIKMODAPI extern UWORD Voice_GetVolume(SBYTE); -MIKMODAPI extern void Voice_SetFrequency(SBYTE,ULONG); -MIKMODAPI extern ULONG Voice_GetFrequency(SBYTE); -MIKMODAPI extern void Voice_SetPanning(SBYTE,ULONG); -MIKMODAPI extern ULONG Voice_GetPanning(SBYTE); -MIKMODAPI extern void Voice_Play(SBYTE,SAMPLE*,ULONG); -MIKMODAPI extern void Voice_Stop(SBYTE); -MIKMODAPI extern BOOL Voice_Stopped(SBYTE); -MIKMODAPI extern SLONG Voice_GetPosition(SBYTE); -MIKMODAPI extern ULONG Voice_RealVolume(SBYTE); - -/* - * ========== Internal module representation (UniMod) - */ - -/* - Instrument definition - for information only, the only field which may be - of use in user programs is the name field -*/ - -/* Instrument note count */ -#define INSTNOTES 120 - -/* Envelope point */ -typedef struct ENVPT { - SWORD pos; - SWORD val; -} ENVPT; - -/* Envelope point count */ -#define ENVPOINTS 32 - -/* Instrument structure */ -typedef struct INSTRUMENT { - CHAR* insname; - - UBYTE flags; - UWORD samplenumber[INSTNOTES]; - UBYTE samplenote[INSTNOTES]; - - UBYTE nnatype; - UBYTE dca; /* duplicate check action */ - UBYTE dct; /* duplicate check type */ - UBYTE globvol; - UWORD volfade; - SWORD panning; /* instrument-based panning var */ - - UBYTE pitpansep; /* pitch pan separation (0 to 255) */ - UBYTE pitpancenter; /* pitch pan center (0 to 119) */ - UBYTE rvolvar; /* random volume varations (0 - 100%) */ - UBYTE rpanvar; /* random panning varations (0 - 100%) */ - - /* volume envelope */ - UBYTE volflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE volpts; - UBYTE volsusbeg; - UBYTE volsusend; - UBYTE volbeg; - UBYTE volend; - ENVPT volenv[ENVPOINTS]; - /* panning envelope */ - UBYTE panflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE panpts; - UBYTE pansusbeg; - UBYTE pansusend; - UBYTE panbeg; - UBYTE panend; - ENVPT panenv[ENVPOINTS]; - /* pitch envelope */ - UBYTE pitflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE pitpts; - UBYTE pitsusbeg; - UBYTE pitsusend; - UBYTE pitbeg; - UBYTE pitend; - ENVPT pitenv[ENVPOINTS]; -} INSTRUMENT; - -struct MP_CONTROL; -struct MP_VOICE; - -/* - Module definition -*/ - -/* maximum master channels supported */ -#define UF_MAXCHAN 64 - -/* Module flags */ -#define UF_XMPERIODS 0x0001 /* XM periods / finetuning */ -#define UF_LINEAR 0x0002 /* LINEAR periods (UF_XMPERIODS must be set) */ -#define UF_INST 0x0004 /* Instruments are used */ -#define UF_NNA 0x0008 /* IT: NNA used, set numvoices rather - than numchn */ -#define UF_S3MSLIDES 0x0010 /* uses old S3M volume slides */ -#define UF_BGSLIDES 0x0020 /* continue volume slides in the background */ -#define UF_HIGHBPM 0x0040 /* MED: can use >255 bpm */ -#define UF_NOWRAP 0x0080 /* XM-type (i.e. illogical) pattern break - semantics */ -#define UF_ARPMEM 0x0100 /* IT: need arpeggio memory */ -#define UF_FT2QUIRKS 0x0200 /* emulate some FT2 replay quirks */ -#define UF_PANNING 0x0400 /* module uses panning effects or have - non-tracker default initial panning */ - -typedef struct MODULE { - /* general module information */ - CHAR* songname; /* name of the song */ - CHAR* modtype; /* string type of module loaded */ - CHAR* comment; /* module comments */ - - UWORD flags; /* See module flags above */ - UBYTE numchn; /* number of module channels */ - UBYTE numvoices; /* max # voices used for full NNA playback */ - UWORD numpos; /* number of positions in this song */ - UWORD numpat; /* number of patterns in this song */ - UWORD numins; /* number of instruments */ - UWORD numsmp; /* number of samples */ - - struct INSTRUMENT* instruments; /* all instruments */ - struct SAMPLE* samples; /* all samples */ - - UBYTE realchn; /* real number of channels used */ - UBYTE totalchn; /* total number of channels used (incl NNAs) */ - - /* playback settings */ - UWORD reppos; /* restart position */ - UBYTE initspeed; /* initial song speed */ - UWORD inittempo; /* initial song tempo */ - UBYTE initvolume; /* initial global volume (0 - 128) */ - UWORD panning[UF_MAXCHAN]; /* panning positions */ - UBYTE chanvol[UF_MAXCHAN]; /* channel positions */ - UWORD bpm; /* current beats-per-minute speed */ - UWORD sngspd; /* current song speed */ - SWORD volume; /* song volume (0-128) (or user volume) */ - - BOOL extspd; /* extended speed flag (default enabled) */ - BOOL panflag; /* panning flag (default enabled) */ - BOOL wrap; /* wrap module ? (default disabled) */ - BOOL loop; /* allow module to loop ? (default enabled) */ - BOOL fadeout; /* volume fade out during last pattern */ - - UWORD patpos; /* current row number */ - SWORD sngpos; /* current song position */ - ULONG sngtime; /* current song time in 2^-10 seconds */ - - SWORD relspd; /* relative speed factor */ - - /* internal module representation */ - UWORD numtrk; /* number of tracks */ - UBYTE** tracks; /* array of numtrk pointers to tracks */ - UWORD* patterns; /* array of Patterns */ - UWORD* pattrows; /* array of number of rows for each pattern */ - UWORD* positions; /* all positions */ - - BOOL forbid; /* if true, no player update! */ - UWORD numrow; /* number of rows on current pattern */ - UWORD vbtick; /* tick counter (counts from 0 to sngspd) */ - UWORD sngremainder;/* used for song time computation */ - - struct MP_CONTROL* control; /* Effects Channel info (size pf->numchn) */ - struct MP_VOICE* voice; /* Audio Voice information (size md_numchn) */ - - UBYTE globalslide; /* global volume slide rate */ - UBYTE pat_repcrazy;/* module has just looped to position -1 */ - UWORD patbrk; /* position where to start a new pattern */ - UBYTE patdly; /* patterndelay counter (command memory) */ - UBYTE patdly2; /* patterndelay counter (real one) */ - SWORD posjmp; /* flag to indicate a jump is needed... */ - UWORD bpmlimit; /* threshold to detect bpm or speed values */ -} MODULE; - - -/* This structure is used to query current playing voices status */ -typedef struct VOICEINFO { - INSTRUMENT* i; /* Current channel instrument */ - SAMPLE* s; /* Current channel sample */ - SWORD panning; /* panning position */ - SBYTE volume; /* channel's "global" volume (0..64) */ - UWORD period; /* period to play the sample at */ - UBYTE kick; /* if true = sample has been restarted */ -} VOICEINFO; - -/* - * ========== Module loaders - */ - -struct MLOADER; - -MIKMODAPI extern CHAR* MikMod_InfoLoader(void); -MIKMODAPI extern void MikMod_RegisterAllLoaders(void); -MIKMODAPI extern void MikMod_RegisterLoader(struct MLOADER*); - -MIKMODAPI extern struct MLOADER load_669; /* 669 and Extended-669 (by Tran/Renaissance) */ -MIKMODAPI extern struct MLOADER load_amf; /* DMP Advanced Module Format (by Otto Chrons) */ -MIKMODAPI extern struct MLOADER load_asy; /* ASYLUM Music Format 1.0 */ -MIKMODAPI extern struct MLOADER load_dsm; /* DSIK internal module format */ -MIKMODAPI extern struct MLOADER load_far; /* Farandole Composer (by Daniel Potter) */ -MIKMODAPI extern struct MLOADER load_gdm; /* General DigiMusic (by Edward Schlunder) */ -MIKMODAPI extern struct MLOADER load_gt2; /* Graoumf tracker */ -MIKMODAPI extern struct MLOADER load_it; /* Impulse Tracker (by Jeffrey Lim) */ -MIKMODAPI extern struct MLOADER load_imf; /* Imago Orpheus (by Lutz Roeder) */ -MIKMODAPI extern struct MLOADER load_med; /* Amiga MED modules (by Teijo Kinnunen) */ -MIKMODAPI extern struct MLOADER load_m15; /* Soundtracker 15-instrument */ -MIKMODAPI extern struct MLOADER load_mod; /* Standard 31-instrument Module loader */ -MIKMODAPI extern struct MLOADER load_mtm; /* Multi-Tracker Module (by Renaissance) */ -MIKMODAPI extern struct MLOADER load_okt; /* Amiga Oktalyzer */ -MIKMODAPI extern struct MLOADER load_stm; /* ScreamTracker 2 (by Future Crew) */ -MIKMODAPI extern struct MLOADER load_stx; /* STMIK 0.2 (by Future Crew) */ -MIKMODAPI extern struct MLOADER load_s3m; /* ScreamTracker 3 (by Future Crew) */ -MIKMODAPI extern struct MLOADER load_ult; /* UltraTracker (by MAS) */ -MIKMODAPI extern struct MLOADER load_umx; /* Unreal UMX container of Epic Games */ -MIKMODAPI extern struct MLOADER load_uni; /* MikMod and APlayer internal module format */ -MIKMODAPI extern struct MLOADER load_xm; /* FastTracker 2 (by Triton) */ - -/* - * ========== Module player - */ - -MIKMODAPI extern MODULE* Player_Load(const CHAR*,int,BOOL); -MIKMODAPI extern MODULE* Player_LoadFP(FILE*,int,BOOL); -MIKMODAPI extern MODULE* Player_LoadMem(const char *buffer,int len,int maxchan,BOOL curious); -MIKMODAPI extern MODULE* Player_LoadGeneric(MREADER*,int,BOOL); -MIKMODAPI extern CHAR* Player_LoadTitle(const CHAR*); -MIKMODAPI extern CHAR* Player_LoadTitleFP(FILE*); -MIKMODAPI extern CHAR* Player_LoadTitleMem(const char *buffer,int len); -MIKMODAPI extern CHAR* Player_LoadTitleGeneric(MREADER*); - -MIKMODAPI extern void Player_Free(MODULE*); -MIKMODAPI extern void Player_Start(MODULE*); -MIKMODAPI extern BOOL Player_Active(void); -MIKMODAPI extern void Player_Stop(void); -MIKMODAPI extern void Player_TogglePause(void); -MIKMODAPI extern BOOL Player_Paused(void); -MIKMODAPI extern void Player_NextPosition(void); -MIKMODAPI extern void Player_PrevPosition(void); -MIKMODAPI extern void Player_SetPosition(UWORD); -MIKMODAPI extern BOOL Player_Muted(UBYTE); -MIKMODAPI extern void Player_SetVolume(SWORD); -MIKMODAPI extern MODULE* Player_GetModule(void); -MIKMODAPI extern void Player_SetSpeed(UWORD); -MIKMODAPI extern void Player_SetTempo(UWORD); -MIKMODAPI extern void Player_Unmute(SLONG,...); -MIKMODAPI extern void Player_Mute(SLONG,...); -MIKMODAPI extern void Player_ToggleMute(SLONG,...); -MIKMODAPI extern int Player_GetChannelVoice(UBYTE); -MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE); -MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo); -MIKMODAPI extern int Player_GetRow(void); -MIKMODAPI extern int Player_GetOrder(void); - -typedef void (*MikMod_player_t)(void); -typedef void (*MikMod_callback_t)(unsigned char *data, size_t len); - -MIKMODAPI extern MikMod_player_t MikMod_RegisterPlayer(MikMod_player_t); - -#define MUTE_EXCLUSIVE 32000 -#define MUTE_INCLUSIVE 32001 - -/* - * ========== Drivers - */ - -enum { - MD_MUSIC = 0, - MD_SNDFX -}; - -enum { - MD_HARDWARE = 0, - MD_SOFTWARE -}; - -/* Mixing flags */ - -/* These ones take effect only after MikMod_Init or MikMod_Reset */ -#define DMODE_16BITS 0x0001 /* enable 16 bit output */ -#define DMODE_STEREO 0x0002 /* enable stereo output */ -#define DMODE_SOFT_SNDFX 0x0004 /* Process sound effects via software mixer */ -#define DMODE_SOFT_MUSIC 0x0008 /* Process music via software mixer */ -#define DMODE_HQMIXER 0x0010 /* Use high-quality (slower) software mixer */ -#define DMODE_FLOAT 0x0020 /* enable float output */ -/* These take effect immediately. */ -#define DMODE_SURROUND 0x0100 /* enable surround sound */ -#define DMODE_INTERP 0x0200 /* enable interpolation */ -#define DMODE_REVERSE 0x0400 /* reverse stereo */ -#define DMODE_SIMDMIXER 0x0800 /* enable SIMD mixing */ -#define DMODE_NOISEREDUCTION 0x1000 /* Low pass filtering */ - - -struct SAMPLOAD; - -typedef struct MDRIVER { - struct MDRIVER* next; - const CHAR* Name; - const CHAR* Version; - - UBYTE HardVoiceLimit; /* Limit of hardware mixer voices */ - UBYTE SoftVoiceLimit; /* Limit of software mixer voices */ - - const CHAR* Alias; - const CHAR* CmdLineHelp; - - void (*CommandLine) (const CHAR*); - BOOL (*IsPresent) (void); - SWORD (*SampleLoad) (struct SAMPLOAD*,int); - void (*SampleUnload) (SWORD); - ULONG (*FreeSampleSpace) (int); - ULONG (*RealSampleLength) (int,struct SAMPLE*); - int (*Init) (void); - void (*Exit) (void); - int (*Reset) (void); - int (*SetNumVoices) (void); - int (*PlayStart) (void); - void (*PlayStop) (void); - void (*Update) (void); - void (*Pause) (void); - void (*VoiceSetVolume) (UBYTE,UWORD); - UWORD (*VoiceGetVolume) (UBYTE); - void (*VoiceSetFrequency)(UBYTE,ULONG); - ULONG (*VoiceGetFrequency)(UBYTE); - void (*VoiceSetPanning) (UBYTE,ULONG); - ULONG (*VoiceGetPanning) (UBYTE); - void (*VoicePlay) (UBYTE,SWORD,ULONG,ULONG,ULONG,ULONG,UWORD); - void (*VoiceStop) (UBYTE); - BOOL (*VoiceStopped) (UBYTE); - SLONG (*VoiceGetPosition) (UBYTE); - ULONG (*VoiceRealVolume) (UBYTE); -} MDRIVER; - -/* These variables can be changed at ANY time and results will be immediate */ -MIKMODAPI extern UBYTE md_volume; /* global sound volume (0-128) */ -MIKMODAPI extern UBYTE md_musicvolume; /* volume of song */ -MIKMODAPI extern UBYTE md_sndfxvolume; /* volume of sound effects */ -MIKMODAPI extern UBYTE md_reverb; /* 0 = none; 15 = chaos */ -MIKMODAPI extern UBYTE md_pansep; /* 0 = mono; 128 == 100% (full left/right) */ - -/* The variables below can be changed at any time, but changes will not be - implemented until MikMod_Reset is called. A call to MikMod_Reset may result - in a skip or pop in audio (depending on the soundcard driver and the settings - changed). */ -MIKMODAPI extern UWORD md_device; /* device */ -MIKMODAPI extern UWORD md_mixfreq; /* mixing frequency */ -MIKMODAPI extern UWORD md_mode; /* mode. See DMODE_? flags above */ - -/* The following variable should not be changed! */ -MIKMODAPI extern MDRIVER* md_driver; /* Current driver in use. */ - -/* Known drivers list */ - -MIKMODAPI extern struct MDRIVER drv_nos; /* no sound */ -MIKMODAPI extern struct MDRIVER drv_pipe; /* piped output */ -MIKMODAPI extern struct MDRIVER drv_raw; /* raw file disk writer [music.raw] */ -MIKMODAPI extern struct MDRIVER drv_stdout; /* output to stdout */ -MIKMODAPI extern struct MDRIVER drv_wav; /* RIFF WAVE file disk writer [music.wav] */ -MIKMODAPI extern struct MDRIVER drv_aiff; /* AIFF file disk writer [music.aiff] */ - -MIKMODAPI extern struct MDRIVER drv_ultra; /* Linux Ultrasound driver */ -MIKMODAPI extern struct MDRIVER drv_sam9407;/* Linux sam9407 driver */ - -MIKMODAPI extern struct MDRIVER drv_AF; /* Dec Alpha AudioFile */ -MIKMODAPI extern struct MDRIVER drv_ahi; /* Amiga AHI */ -MIKMODAPI extern struct MDRIVER drv_aix; /* AIX audio device */ -MIKMODAPI extern struct MDRIVER drv_alsa; /* Advanced Linux Sound Architecture (ALSA) */ -MIKMODAPI extern struct MDRIVER drv_esd; /* Enlightened sound daemon (EsounD) */ -MIKMODAPI extern struct MDRIVER drv_pulseaudio; /* PulseAudio */ -MIKMODAPI extern struct MDRIVER drv_hp; /* HP-UX audio device */ -MIKMODAPI extern struct MDRIVER drv_nas; /* Network Audio System (NAS) */ -MIKMODAPI extern struct MDRIVER drv_oss; /* OpenSound System (Linux,FreeBSD...) */ -MIKMODAPI extern struct MDRIVER drv_openal; /* OpenAL driver */ -MIKMODAPI extern struct MDRIVER drv_sdl; /* SDL audio driver */ -MIKMODAPI extern struct MDRIVER drv_sgi; /* SGI audio library */ -MIKMODAPI extern struct MDRIVER drv_sndio; /* OpenBSD sndio */ -MIKMODAPI extern struct MDRIVER drv_sun; /* Sun/NetBSD/OpenBSD audio device */ - -MIKMODAPI extern struct MDRIVER drv_dart; /* OS/2 Direct Audio RealTime */ -MIKMODAPI extern struct MDRIVER drv_os2; /* OS/2 MMPM/2 */ - -MIKMODAPI extern struct MDRIVER drv_ds; /* Win32 DirectSound driver */ -MIKMODAPI extern struct MDRIVER drv_xaudio2;/* Win32 XAudio2 driver */ -MIKMODAPI extern struct MDRIVER drv_win; /* Win32 multimedia API driver */ - -MIKMODAPI extern struct MDRIVER drv_mac; /* Macintosh Sound Manager driver */ -MIKMODAPI extern struct MDRIVER drv_osx; /* MacOS X CoreAudio Driver */ - -MIKMODAPI extern struct MDRIVER drv_dc; /* Dreamcast driver */ -MIKMODAPI extern struct MDRIVER drv_gp32; /* GP32 Sound driver */ -MIKMODAPI extern struct MDRIVER drv_psp; /* PlayStation Portable driver */ - -MIKMODAPI extern struct MDRIVER drv_wss; /* DOS WSS driver */ -MIKMODAPI extern struct MDRIVER drv_sb; /* DOS S/B driver */ - -MIKMODAPI extern struct MDRIVER drv_osles; /* OpenSL ES driver for android */ - -/*========== Virtual channel mixer interface (for user-supplied drivers only) */ - -MIKMODAPI extern int VC_Init(void); -MIKMODAPI extern void VC_Exit(void); -MIKMODAPI extern void VC_SetCallback(MikMod_callback_t callback); -MIKMODAPI extern int VC_SetNumVoices(void); -MIKMODAPI extern ULONG VC_SampleSpace(int); -MIKMODAPI extern ULONG VC_SampleLength(int,SAMPLE*); - -MIKMODAPI extern int VC_PlayStart(void); -MIKMODAPI extern void VC_PlayStop(void); - -MIKMODAPI extern SWORD VC_SampleLoad(struct SAMPLOAD*,int); -MIKMODAPI extern void VC_SampleUnload(SWORD); - -MIKMODAPI extern ULONG VC_WriteBytes(SBYTE*,ULONG); -MIKMODAPI extern ULONG VC_SilenceBytes(SBYTE*,ULONG); - -MIKMODAPI extern void VC_VoiceSetVolume(UBYTE,UWORD); -MIKMODAPI extern UWORD VC_VoiceGetVolume(UBYTE); -MIKMODAPI extern void VC_VoiceSetFrequency(UBYTE,ULONG); -MIKMODAPI extern ULONG VC_VoiceGetFrequency(UBYTE); -MIKMODAPI extern void VC_VoiceSetPanning(UBYTE,ULONG); -MIKMODAPI extern ULONG VC_VoiceGetPanning(UBYTE); -MIKMODAPI extern void VC_VoicePlay(UBYTE,SWORD,ULONG,ULONG,ULONG,ULONG,UWORD); - -MIKMODAPI extern void VC_VoiceStop(UBYTE); -MIKMODAPI extern BOOL VC_VoiceStopped(UBYTE); -MIKMODAPI extern SLONG VC_VoiceGetPosition(UBYTE); -MIKMODAPI extern ULONG VC_VoiceRealVolume(UBYTE); - -#ifdef __cplusplus -} -#endif - -#endif - -/* ex:set ts=4: */ diff --git a/MacOSX/codecs/include/mikmod_config.txt b/MacOSX/codecs/include/mikmod_config.txt deleted file mode 100644 index 370825b5..00000000 --- a/MacOSX/codecs/include/mikmod_config.txt +++ /dev/null @@ -1,4 +0,0 @@ -libmikmod-3.3.9 (mercurial repo as of 2016-08-12) -only the "nosound" driver (drv_nos) is included, all of -the other libmikmod drivers were made "MISSING" drivers. -we only need/register/use drv_nos here and nothing else. diff --git a/MacOSX/codecs/include/modplug_config.txt b/MacOSX/codecs/include/modplug_config.txt deleted file mode 100644 index dd94dd2c..00000000 --- a/MacOSX/codecs/include/modplug_config.txt +++ /dev/null @@ -1,7 +0,0 @@ -libmodplug - v0.8.8.5 release + git (2014-11-27) using sezero's fork -at https://github.com/sezero/libmodplug/ - -midi formats (*.abc, *.mid) and GUS patches (*.pat) loading disabled. -wav format loading disabled. - -only the C-interface is exported in the dylibs, which is what we use. diff --git a/MacOSX/codecs/include/mpg123.h b/MacOSX/codecs/include/mpg123.h deleted file mode 100644 index f5c5b66d..00000000 --- a/MacOSX/codecs/include/mpg123.h +++ /dev/null @@ -1,1215 +0,0 @@ -/* - libmpg123: MPEG Audio Decoder library (version 1.22.4) - - copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 - see COPYING and AUTHORS files in distribution or http://mpg123.org -*/ - -#ifndef MPG123_LIB_H -#define MPG123_LIB_H - -/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ - -/* A macro to check at compile time which set of API functions to expect. - This should be incremented at least each time a new symbol is added to the header. */ -#define MPG123_API_VERSION 42 - -/* These aren't actually in use... seems to work without using libtool. */ -#ifdef BUILD_MPG123_DLL -/* The dll exports. */ -#define MPG123_EXPORT __declspec(dllexport) -#else -#ifdef LINK_MPG123_DLL -/* The exe imports. */ -#define MPG123_EXPORT __declspec(dllimport) -#else -/* Nothing on normal/UNIX builds */ -#define MPG123_EXPORT -#endif -#endif - -/* This is for Visual Studio, so this header works as distributed in the binary downloads */ -#if defined(_MSC_VER) && !defined(MPG123_DEF_SSIZE_T) -#define MPG123_DEF_SSIZE_T -#include <stddef.h> -typedef ptrdiff_t ssize_t; -#endif - -#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ -#include <stdlib.h> -#include <sys/types.h> - -/* Simplified large file handling. - I used to have a check here that prevents building for a library with conflicting large file setup - (application that uses 32 bit offsets with library that uses 64 bits). - While that was perfectly fine in an environment where there is one incarnation of the library, - it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the - correct header matching the 32 bit library (where large files need explicit support) or - the 64 bit library (where there is no distinction). - - New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). - Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when - building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. - Link failure is not the expected outcome of any half-sane usage anymore. - - More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. -*/ - -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. -*/ -#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) - -/* Need some trickery to concatenate the value(s) of the given macro(s). */ -#define MPG123_MACROCAT_REALLY(a, b) a ## b -#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) -#ifndef MPG123_LARGESUFFIX -#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) -#endif -#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) - -#define mpg123_open MPG123_LARGENAME(mpg123_open) -#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) -#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) -#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) -#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) -#define mpg123_tell MPG123_LARGENAME(mpg123_tell) -#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) -#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) -#define mpg123_seek MPG123_LARGENAME(mpg123_seek) -#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) -#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) -#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) -#define mpg123_index MPG123_LARGENAME(mpg123_index) -#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) -#define mpg123_position MPG123_LARGENAME(mpg123_position) -#define mpg123_length MPG123_LARGENAME(mpg123_length) -#define mpg123_framelength MPG123_LARGENAME(mpg123_framelength) -#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) -#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) -#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) -#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) - -#endif /* largefile hackery */ - -#endif /* MPG123_NO_CONFIGURE */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup mpg123_init mpg123 library and handle setup - * - * Functions to initialise and shutdown the mpg123 library and handles. - * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) - * Tip: Use a RVA setting... - * - * @{ - */ - -/** Opaque structure for the libmpg123 decoder handle. */ -struct mpg123_handle_struct; - -/** Opaque structure for the libmpg123 decoder handle. - * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. - */ -typedef struct mpg123_handle_struct mpg123_handle; - -/** Function to initialise the mpg123 library. - * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. - * - * \return MPG123_OK if successful, otherwise an error number. - */ -MPG123_EXPORT int mpg123_init(void); - -/** Function to close down the mpg123 library. - * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ -MPG123_EXPORT void mpg123_exit(void); - -/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). - * and optional retrieval of an error code to feed to mpg123_plain_strerror(). - * Optional means: Any of or both the parameters may be NULL. - * - * \return Non-NULL pointer when successful. - */ -MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); - -/** Delete handle, mh is either a valid mpg123 handle or NULL. */ -MPG123_EXPORT void mpg123_delete(mpg123_handle *mh); - -/** Enumeration of the parameters types that it is possible to set/get. */ -enum mpg123_parms -{ - MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ - MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ - MPG123_ADD_FLAGS, /**< add some flags (integer) */ - MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ - MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ - MPG123_RVA, /**< one of the RVA choices above (integer) */ - MPG123_DOWNSPEED, /**< play a frame N times (integer) */ - MPG123_UPSPEED, /**< play every Nth frame (integer) */ - MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ - MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ - MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ - MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ - MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ - MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ - MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ - MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ - ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ - ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ - ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ -}; - -/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ -enum mpg123_param_flags -{ - MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ - ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ - ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ - ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ - ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ - ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ - ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ - ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ - ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ - ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ - ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ - ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ - ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ - ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ - ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ - ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ - ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ - ,MPG123_PICTURE = 0x10000 /**< 17th bit: Enable storage of pictures from tags (ID3v2 APIC). */ -}; - -/** choices for MPG123_RVA */ -enum mpg123_param_rva -{ - MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ - ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ - ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ - ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ -}; - -/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ - -/** Set a specific parameter, for a specific mpg123_handle, using a parameter - * type key chosen from the mpg123_parms enumeration, to the specified value. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); - -/** Get a specific parameter, for a specific mpg123_handle. - * See the mpg123_parms enumeration for a list of available parameters. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); - -/** Feature set available for query with mpg123_feature. */ -enum mpg123_feature_set -{ - MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ - ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ - ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ - ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ - ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ - ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ - ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ - ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ - ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ - ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ - ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ - ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ - ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ - ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ -}; - -/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ -MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key); - -/* @} */ - - -/** \defgroup mpg123_error mpg123 error handling - * - * Functions to get text version of the error numbers and an enumeration - * of the error codes returned by libmpg123. - * - * Most functions operating on a mpg123_handle simply return MPG123_OK (0) - * on success and MPG123_ERR (-1) on failure, setting the internal error - * variable of the handle to the specific error code. If there was not a valid - * (non-NULL) handle provided to a function operating on one, MPG123_BAD_HANDLE - * may be returned if this can not be confused with a valid positive return - * value. - * Meaning: A function expected to return positive integers on success will - * always indicate error or a special condition by returning a negative one. - * - * Decoding/seek functions may also return message codes MPG123_DONE, - * MPG123_NEW_FORMAT and MPG123_NEED_MORE (all negative, see below on how to - * react). Note that calls to those can be nested, so generally watch out - * for these codes after initial handle setup. - * Especially any function that needs information about the current stream - * to work will try to at least parse the beginning if that did not happen - * yet. - * - * On a function that is supposed to return MPG123_OK on success and - * MPG123_ERR on failure, make sure you check for != MPG123_OK, not - * == MPG123_ERR, as the error code could get more specific in future, - * or there is just a special message from a decoding routine as indicated - * above. - * - * @{ - */ - -/** Enumeration of the message and error codes and returned by libmpg123 functions. */ -enum mpg123_errors -{ - MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ - MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ - MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ - MPG123_ERR=-1, /**< Generic Error */ - MPG123_OK=0, /**< Success */ - MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ - MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ - MPG123_BAD_RATE, /**< Invalid sample rate specified. */ - MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ - MPG123_BAD_PARAM, /**< Bad parameter id! */ - MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ - MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ - MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ - MPG123_BAD_DECODER, /**< Invalid decoder choice. */ - MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ - MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ - MPG123_BAD_RVA, /**< Invalid RVA mode. */ - MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ - MPG123_NO_SPACE, /**< Not enough buffer space. */ - MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ - MPG123_BAD_BAND, /**< Bad equalizer band. */ - MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ - MPG123_ERR_READER, /**< Error reading the stream. */ - MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ - MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ - MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ - MPG123_BAD_FILE, /**< File access error. */ - MPG123_NO_SEEK, /**< Seek not supported by stream. */ - MPG123_NO_READER, /**< No stream opened. */ - MPG123_BAD_PARS, /**< Bad parameter handle. */ - MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ - MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ - MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ - MPG123_NO_8BIT, /**< No 8bit encoding possible. */ - MPG123_BAD_ALIGN, /**< Stack aligmnent error */ - MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ - MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ - MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ - MPG123_BAD_KEY, /**< Bad key value given. */ - MPG123_NO_INDEX, /**< No frame index in this build. */ - MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ - MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ - MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ - ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ - ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ - ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ - ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ - ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ -}; - -/** Return a string describing that error errcode means. */ -MPG123_EXPORT const char* mpg123_plain_strerror(int errcode); - -/** Give string describing what error has occured in the context of handle mh. - * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via - * char *errmsg = mpg123_strerror(mh) - * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ -MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh); - -/** Return the plain errcode intead of a string. - * \return error code recorded in handle or MPG123_BAD_HANDLE - */ -MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh); - -/*@}*/ - - -/** \defgroup mpg123_decoder mpg123 decoder selection - * - * Functions to list and select the available decoders. - * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). - * - * @{ - */ - -/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ -MPG123_EXPORT const char **mpg123_decoders(void); - -/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ -MPG123_EXPORT const char **mpg123_supported_decoders(void); - -/** Set the chosen decoder to 'decoder_name' - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); - -/** Get the currently active decoder engine name. - The active decoder engine can vary depening on output constraints, - mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. - Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. - \return The decoder name or NULL on error. */ -MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); - -/*@}*/ - - -/** \defgroup mpg123_output mpg123 output audio format - * - * Functions to get and select the format of the decoded audio. - * - * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. - * - * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). - * - * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. - * - * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. - * - * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. - * - * @{ - */ - -/** An enum over all sample types possibly known to mpg123. - * The values are designed as bit flags to allow bitmasking for encoding families. - * - * Note that (your build of) libmpg123 does not necessarily support all these. - * Usually, you can expect the 8bit encodings and signed 16 bit. - * Also 32bit float will be usual beginning with mpg123-1.7.0 . - * What you should bear in mind is that (SSE, etc) optimized routines may be absent - * for some formats. We do have SSE for 16, 32 bit and float, though. - * 24 bit integer is done via postprocessing of 32 bit output -- just cutting - * the last byte, no rounding, even. If you want better, do it yourself. - * - * All formats are in native byte order. If you need different endinaness, you - * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). - * mpg123_encsize() can be helpful there. - */ -enum mpg123_enc_enum -{ - MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ - ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ - ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ - ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ - ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ - ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ - ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ - ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ - ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ - ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ - ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ - ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ - ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ - ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ - ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ - ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ - ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ - ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ - ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 - | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 - | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 - | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 - | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ -}; - -/** They can be combined into one number (3) to indicate mono and stereo... */ -enum mpg123_channelcount -{ - MPG123_MONO = 1 - ,MPG123_STEREO = 2 -}; - -/** An array of supported standard sample rates - * These are possible native sample rates of MPEG audio files. - * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. - * \param list Store a pointer to the sample rates array there. - * \param number Store the number of sample rates there. */ -MPG123_EXPORT void mpg123_rates(const long **list, size_t *number); - -/** An array of supported audio encodings. - * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). - * \param list Store a pointer to the encodings array there. - * \param number Store the number of encodings there. */ -MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number); - -/** Return the size (in bytes) of one mono sample of the named encoding. - * \param encoding The encoding value to analyze. - * \return positive size of encoding in bytes, 0 on invalid encoding. */ -MPG123_EXPORT int mpg123_encsize(int encoding); - -/** Configure a mpg123 handle to accept no output format at all, - * use before specifying supported formats with mpg123_format - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh); - -/** Configure mpg123 handle to accept all formats - * (also any custom rate you may set) -- this is default. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh); - -/** Set the audio format support of a mpg123_handle in detail: - * \param mh audio decoder handle - * \param rate The sample rate value (in Hertz). - * \param channels A combination of MPG123_STEREO and MPG123_MONO. - * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. - * \return MPG123_OK on success, MPG123_ERR if there was an error. */ -MPG123_EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); - -/** Check to see if a specific format at a specific rate is supported - * by mpg123_handle. - * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, - * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ -MPG123_EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); - -/** Get the current output format written to the addresses given. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); - -/*@}*/ - - -/** \defgroup mpg123_input mpg123 file input and decoding - * - * Functions for input bitstream and decoding operations. - * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). - * @{ - */ - -/* reading samples / triggering decoding, possible return values: */ -/** Enumeration of the error codes returned by libmpg123 functions. */ - -/** Open and prepare to decode the specified file by filesystem path. - * This does not open HTTP urls; libmpg123 contains no networking code. - * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). - * \param path filesystem path - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); - -/** Use an already opened file descriptor as the bitstream input - * mpg123_close() will _not_ close the file descriptor. - */ -MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); - -/** Use an opaque handle as bitstream input. This works only with the - * replaced I/O from mpg123_replace_reader_handle()! - * mpg123_close() will call the cleanup callback for your handle (if you gave one). - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); - -/** Open a new bitstream and prepare for direct feeding - * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh); - -/** Closes the source, if libmpg123 opened it. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_close(mpg123_handle *mh); - -/** Read from stream and decode up to outmemsize bytes. - * \param outmemory address of output buffer to write to - * \param outmemsize maximum number of bytes to write - * \param done address to store the number of actually decoded bytes to - * \return MPG123_OK or error/message code - */ -MPG123_EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); - -/** Feed data for a stream that has been opened with mpg123_open_feed(). - * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. - * \param in input buffer - * \param size number of input bytes - * \return MPG123_OK or error/message code. - */ -MPG123_EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); - -/** Decode MPEG Audio from inmemory to outmemory. - * This is very close to a drop-in replacement for old mpglib. - * When you give zero-sized output buffer the input will be parsed until - * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) - * without taking decoded data. - * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). - * You can actually always decide if you want those specialized functions in separate steps or one call this one here. - * \param inmemory input buffer - * \param inmemsize number of input bytes - * \param outmemory output buffer - * \param outmemsize maximum number of output bytes - * \param done address to store the number of actually decoded bytes to - * \return error/message code (watch out especially for MPG123_NEED_MORE) - */ -MPG123_EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); - -/** Decode next MPEG frame to internal buffer - * or read a frame and return after setting a new format. - * \param num current frame offset gets stored there - * \param audio This pointer is set to the internal buffer to read the decoded audio from. - * \param bytes number of output bytes ready in the buffer - * \return MPG123_OK or error/message code - */ -MPG123_EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); - -/** Decode current MPEG frame to internal buffer. - * Warning: This is experimental API that might change in future releases! - * Please watch mpg123 development closely when using it. - * \param num last frame offset gets stored there - * \param audio this pointer is set to the internal buffer to read the decoded audio from. - * \param bytes number of output bytes ready in the buffer - * \return MPG123_OK or error/message code - */ -MPG123_EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); - -/** Find, read and parse the next mp3 frame - * Warning: This is experimental API that might change in future releases! - * Please watch mpg123 development closely when using it. - * \return MPG123_OK or error/message code - */ -MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); - -/** Get access to the raw input data for the last parsed frame. - * This gives you a direct look (and write access) to the frame body data. - * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). - * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. - * You can provide NULL for a parameter pointer when you are not interested in the value. - * - * \param header the 4-byte MPEG header - * \param bodydata pointer to the frame body stored in the handle (without the header) - * \param bodybytes size of frame body in bytes (without the header) - * \return MPG123_OK if there was a yet un-decoded frame to get the - * data from, MPG123_BAD_HANDLE or MPG123_ERR otherwise (without further - * explanation, the error state of the mpg123_handle is not modified by - * this function). - */ -MPG123_EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); - -/** Get the input position (byte offset in stream) of the last parsed frame. - * This can be used for external seek index building, for example. - * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ -MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh); - -/*@}*/ - - -/** \defgroup mpg123_seek mpg123 position and seeking - * - * Functions querying and manipulating position in the decoded audio bitstream. - * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. - * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) - * The general usage is modelled after stdlib's ftell() and fseek(). - * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: - * - SEEK_SET: set position to (or near to) specified offset - * - SEEK_CUR: change position by offset from now - * - SEEK_END: set position to offset from end - * - * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. - * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! - * Short: When you care about the sample position, don't mess with those parameters;-) - * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). - * And yet another caveat: If the stream is concatenated out of differing pieces (Frankenstein stream), seeking may suffer, too. - * - * @{ - */ - -/** Returns the current position in samples. - * On the next successful read, you'd get that sample. - * \return sample offset or MPG123_ERR (null handle) - */ -MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh); - -/** Returns the frame number that the next read will give you data from. - * \return frame offset or MPG123_ERR (null handle) - */ -MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh); - -/** Returns the current byte offset in the input stream. - * \return byte offset or MPG123_ERR (null handle) - */ -MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); - -/** Seek to a desired sample offset. - * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. - * \return The resulting offset >= 0 or error/message code */ -MPG123_EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); - -/** Seek to a desired sample offset in data feeding mode. - * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. - * \param input_offset The position it expects to be at the - * next time data is fed to mpg123_decode(). - * \return The resulting offset >= 0 or error/message code */ -MPG123_EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); - -/** Seek to a desired MPEG frame index. - * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. - * \return The resulting offset >= 0 or error/message code */ -MPG123_EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); - -/** Return a MPEG frame offset corresponding to an offset in seconds. - * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. - * \return frame offset >= 0 or error/message code */ -MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); - -/** Give access to the frame index table that is managed for seeking. - * You are asked not to modify the values... Use mpg123_set_index to set the - * seek index - * \param offsets pointer to the index array - * \param step one index byte offset advances this many MPEG frames - * \param fill number of recorded index offsets; size of the array - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); - -/** Set the frame index table - * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets - * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. - * \param offsets pointer to the index array - * \param step one index byte offset advances this many MPEG frames - * \param fill number of recorded index offsets; size of the array - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); - -/** Get information about current and remaining frames/seconds. - * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! - * broken for various cases (p.ex. 24 bit output). Do never use. - * You provide an offset (in frames) from now and a number of output bytes - * served by libmpg123 but not yet played. You get the projected current frame - * and seconds, as well as the remaining frames/seconds. This does _not_ care - * about skipped samples due to gapless playback. */ -MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); - -/*@}*/ - - -/** \defgroup mpg123_voleq mpg123 volume and equalizer - * - * @{ - */ - -enum mpg123_channels -{ - MPG123_LEFT=0x1 /**< The Left Channel. */ - ,MPG123_RIGHT=0x2 /**< The Right Channel. */ - ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ -}; - -/** Set the 32 Band Audio Equalizer settings. - * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. - * \param band The equaliser band to change (from 0 to 31) - * \param val The (linear) adjustment factor. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); - -/** Get the 32 Band Audio Equalizer settings. - * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. - * \param band The equaliser band to change (from 0 to 31) - * \return The (linear) adjustment factor (zero for pad parameters) */ -MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); - -/** Reset the 32 Band Audio Equalizer settings to flat - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh); - -/** Set the absolute output volume including the RVA setting, - * vol<0 just applies (a possibly changed) RVA setting. */ -MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol); - -/** Adjust output volume including the RVA setting by chosen amount */ -MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); - -/** Return current volume setting, the actual value due to RVA, and the RVA - * adjustment itself. It's all as double float value to abstract the sample - * format. The volume values are linear factors / amplitudes (not percent) - * and the RVA value is in decibels. */ -MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); - -/* TODO: Set some preamp in addition / to replace internal RVA handling? */ - -/*@}*/ - - -/** \defgroup mpg123_status mpg123 status and information - * - * @{ - */ - -/** Enumeration of the mode types of Variable Bitrate */ -enum mpg123_vbr { - MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ - MPG123_VBR, /**< Variable Bitrate Mode */ - MPG123_ABR /**< Average Bitrate Mode */ -}; - -/** Enumeration of the MPEG Versions */ -enum mpg123_version { - MPG123_1_0=0, /**< MPEG Version 1.0 */ - MPG123_2_0, /**< MPEG Version 2.0 */ - MPG123_2_5 /**< MPEG Version 2.5 */ -}; - - -/** Enumeration of the MPEG Audio mode. - * Only the mono mode has 1 channel, the others have 2 channels. */ -enum mpg123_mode { - MPG123_M_STEREO=0, /**< Standard Stereo. */ - MPG123_M_JOINT, /**< Joint Stereo. */ - MPG123_M_DUAL, /**< Dual Channel. */ - MPG123_M_MONO /**< Single Channel. */ -}; - - -/** Enumeration of the MPEG Audio flag bits */ -enum mpg123_flags { - MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ - MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ - MPG123_PRIVATE=0x4, /**< The private bit has been set. */ - MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ -}; - -/** Data structure for storing information about a frame of MPEG Audio */ -struct mpg123_frameinfo -{ - enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ - int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ - long rate; /**< The sampling rate in Hz. */ - enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ - int mode_ext; /**< The mode extension bit flag. */ - int framesize; /**< The size of the frame (in bytes, including header). */ - enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ - int emphasis; /**< The emphasis type. */ - int bitrate; /**< Bitrate of the frame (kbps). */ - int abr_rate; /**< The target average bitrate. */ - enum mpg123_vbr vbr; /**< The VBR mode. */ -}; - -/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); - -/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ -MPG123_EXPORT size_t mpg123_safe_buffer(void); - -/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length - * value is stored. Seek index will be filled. A seek back to current position - * is performed. At all, this function refuses work when stream is - * not seekable. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_scan(mpg123_handle *mh); - -/** Return, if possible, the full (expected) length of current track in frames. - * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ -MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh); - -/** Return, if possible, the full (expected) length of current track in samples. - * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ -MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh); - -/** Override the value for file size in bytes. - * Useful for getting sensible track length values in feed mode or for HTTP streams. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); - -/** Returns the time (seconds) per frame; <0 is error. */ -MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh); - -/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ -MPG123_EXPORT int mpg123_spf(mpg123_handle *mh); - -/** Get and reset the clip count. */ -MPG123_EXPORT long mpg123_clip(mpg123_handle *mh); - - -/** The key values for state information from mpg123_getstate(). */ -enum mpg123_state -{ - MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true). */ - ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ - ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files. Seeking may yield unexpected results (also with MPG123_ACCURATE, it may be confused). */ - ,MPG123_FRESH_DECODER /**< Decoder structure has been updated, possibly indicating changed stream (integer value, 0 if false, 1 if true). Flag is cleared after retrieval. */ -}; - -/** Get various current decoder/stream state information. - * \param key the key to identify the information to give. - * \param val the address to return (long) integer values to - * \param fval the address to return floating point values to - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); - -/*@}*/ - - -/** \defgroup mpg123_metadata mpg123 metadata handling - * - * Functions to retrieve the metadata from MPEG Audio files and streams. - * Also includes string handling functions. - * - * @{ - */ - -/** Data structure for storing strings in a safer way than a standard C-String. - * Can also hold a number of null-terminated strings. */ -typedef struct -{ - char* p; /**< pointer to the string data */ - size_t size; /**< raw number of bytes allocated */ - size_t fill; /**< number of used bytes (including closing zero byte) */ -} mpg123_string; - -/** Create and allocate memory for a new mpg123_string */ -MPG123_EXPORT void mpg123_init_string(mpg123_string* sb); - -/** Free-up mempory for an existing mpg123_string */ -MPG123_EXPORT void mpg123_free_string(mpg123_string* sb); - -/** Change the size of a mpg123_string - * \return 0 on error, 1 on success */ -MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); - -/** Increase size of a mpg123_string if necessary (it may stay larger). - * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). - * That way, you can preallocate memory and safely work afterwards with pieces. - * \return 0 on error, 1 on success */ -MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); - -/** Copy the contents of one mpg123_string string to another. - * \return 0 on error, 1 on success */ -MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); - -/** Append a C-String to an mpg123_string - * \return 0 on error, 1 on success */ -MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); - -/** Append a C-substring to an mpg123 string - * \return 0 on error, 1 on success - * \param from offset to copy from - * \param count number of characters to copy (a null-byte is always appended) */ -MPG123_EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); - -/** Set the conents of a mpg123_string to a C-string - * \return 0 on error, 1 on success */ -MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); - -/** Set the contents of a mpg123_string to a C-substring - * \return 0 on error, 1 on success - * \param from offset to copy from - * \param count number of characters to copy (a null-byte is always appended) */ -MPG123_EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); - -/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). - * \return character count - * \param sb the string - * \param utf8 a flag to tell if the string is in utf8 encoding - * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. -*/ -MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); - -/** Remove trailing \r and \n, if present. - * \return 0 on error, 1 on success - * \param sb the string - */ -MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb); - -/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ -enum mpg123_text_encoding -{ - mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ - ,mpg123_text_utf8 = 1 /**< UTF-8 */ - ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ - ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ - ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ - ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. - * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when - * you don't mess with the reserved code points. If you want to decode little endian data - * without BOM you need to prepend 0xff 0xfe yourself. */ - ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ - ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, - * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 - * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 - * types (we expect a BOM before real data there), not so for utf16be!*/ - ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ -}; - -/** The encoding byte values from ID3v2. */ -enum mpg123_id3_enc -{ - mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ - ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ - ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ - ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ - ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ -}; - -/** Convert ID3 encoding byte to mpg123 encoding index. */ -MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); - -/** Store text data in string, after converting to UTF-8 from indicated encoding - * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) - * \param sb target string - * \param enc mpg123 text encoding value - * \param source source buffer with plain unsigned bytes (you might need to cast from char *) - * \param source_size number of bytes in the source buffer - * - * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). - * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). - */ -MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); - -/** Sub data structure for ID3v2, for storing various text fields (including comments). - * This is for ID3v2 COMM, TXXX and all the other text fields. - * Only COMM and TXXX have a description, only COMM and USLT have a language. - * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ -typedef struct -{ - char lang[3]; /**< Three-letter language code (not terminated). */ - char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ - mpg123_string description; /**< Empty for the generic comment... */ - mpg123_string text; /**< ... */ -} mpg123_text; - -/** The picture type values from ID3v2. */ -enum mpg123_id3_pic_type -{ - mpg123_id3_pic_other = 0 - ,mpg123_id3_pic_icon = 1 - ,mpg123_id3_pic_other_icon = 2 - ,mpg123_id3_pic_front_cover = 3 - ,mpg123_id3_pic_back_cover = 4 - ,mpg123_id3_pic_leaflet = 5 - ,mpg123_id3_pic_media = 6 - ,mpg123_id3_pic_lead = 7 - ,mpg123_id3_pic_artist = 8 - ,mpg123_id3_pic_conductor = 9 - ,mpg123_id3_pic_orchestra = 10 - ,mpg123_id3_pic_composer = 11 - ,mpg123_id3_pic_lyricist = 12 - ,mpg123_id3_pic_location = 13 - ,mpg123_id3_pic_recording = 14 - ,mpg123_id3_pic_performance = 15 - ,mpg123_id3_pic_video = 16 - ,mpg123_id3_pic_fish = 17 - ,mpg123_id3_pic_illustration = 18 - ,mpg123_id3_pic_artist_logo = 19 - ,mpg123_id3_pic_publisher_logo = 20 -}; - -/** Sub data structure for ID3v2, for storing picture data including comment. - * This is for the ID3v2 APIC field. You should consult the ID3v2 specification - * for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields" - * here to separate from MPEG frames). */ -typedef struct -{ - char type; - mpg123_string description; - mpg123_string mime_type; - size_t size; - unsigned char* data; -} mpg123_picture; - -/** Data structure for storing IDV3v2 tags. - * This structure is not a direct binary mapping with the file contents. - * The ID3v2 text frames are allowed to contain multiple strings. - * So check for null bytes until you reach the mpg123_string fill. - * All text is encoded in UTF-8. */ -typedef struct -{ - unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ - mpg123_string *title; /**< Title string (pointer into text_list). */ - mpg123_string *artist; /**< Artist string (pointer into text_list). */ - mpg123_string *album; /**< Album string (pointer into text_list). */ - mpg123_string *year; /**< The year as a string (pointer into text_list). */ - mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ - mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ - /* Encountered ID3v2 fields are appended to these lists. - There can be multiple occurences, the pointers above always point to the last encountered data. */ - mpg123_text *comment_list; /**< Array of comments. */ - size_t comments; /**< Number of comments. */ - mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ - size_t texts; /**< Numer of text fields. */ - mpg123_text *extra; /**< The array of extra (TXXX) fields. */ - size_t extras; /**< Number of extra text (TXXX) fields. */ - mpg123_picture *picture; /**< Array of ID3v2 pictures fields (APIC). */ - size_t pictures; /**< Number of picture (APIC) fields. */ -} mpg123_id3v2; - -/** Data structure for ID3v1 tags (the last 128 bytes of a file). - * Don't take anything for granted (like string termination)! - * Also note the change ID3v1.1 did: comment[28] = 0; comment[29] = track_number - * It is your task to support ID3v1 only or ID3v1.1 ...*/ -typedef struct -{ - char tag[3]; /**< Always the string "TAG", the classic intro. */ - char title[30]; /**< Title string. */ - char artist[30]; /**< Artist string. */ - char album[30]; /**< Album string. */ - char year[4]; /**< Year string. */ - char comment[30]; /**< Comment string. */ - unsigned char genre; /**< Genre index. */ -} mpg123_id3v1; - -#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ -#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ -#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ -#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ - -/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). - The check function returns a combination of flags. */ -MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ - -/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ -MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh); - -/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. - * v1 and/or v2 can be set to NULL when there is no corresponding data. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); - -/** Point icy_meta to existing data structure wich may change on any next read/decode function call. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ - -/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. - * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . - * \param icy_text The input data in ICY encoding - * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ -MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text); - - -/* @} */ - - -/** \defgroup mpg123_advpar mpg123 advanced parameter API - * - * Direct access to a parameter set without full handle around it. - * Possible uses: - * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). - * - Use one set of parameters for multiple handles. - * - * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() - * family) directly return a fully qualified mpg123 error code, the ones - * operating on full handles normally MPG123_OK or MPG123_ERR, storing the - * specific error code itseld inside the handle. - * - * @{ - */ - -/** Opaque structure for the libmpg123 decoder parameters. */ -struct mpg123_pars_struct; - -/** Opaque structure for the libmpg123 decoder parameters. */ -typedef struct mpg123_pars_struct mpg123_pars; - -/** Create a handle with preset parameters. */ -MPG123_EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); - -/** Allocate memory for and return a pointer to a new mpg123_pars */ -MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error); - -/** Delete and free up memory used by a mpg123_pars data structure */ -MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp); - -/** Configure mpg123 parameters to accept no output format at all, - * use before specifying supported formats with mpg123_format - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp); - -/** Configure mpg123 parameters to accept all formats - * (also any custom rate you may set) -- this is default. - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp); - -/** Set the audio format support of a mpg123_pars in detail: - \param rate The sample rate value (in Hertz). - \param channels A combination of MPG123_STEREO and MPG123_MONO. - \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). - \return MPG123_OK on success -*/ -MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp, long rate, int channels, int encodings); /* 0 is good, -1 is error */ - -/** Check to see if a specific format at a specific rate is supported - * by mpg123_pars. - * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, - * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ -MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding); - -/** Set a specific parameter, for a specific mpg123_pars, using a parameter - * type key chosen from the mpg123_parms enumeration, to the specified value. */ -MPG123_EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); - -/** Get a specific parameter, for a specific mpg123_pars. - * See the mpg123_parms enumeration for a list of available parameters. */ -MPG123_EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); - -/* @} */ - - -/** \defgroup mpg123_lowio mpg123 low level I/O - * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... - * - * @{ */ - -/** Replace default internal buffer with user-supplied buffer. - * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. - * Note that the required buffer size could be bigger than expected from output - * encoding if libmpg123 has to convert from primary decoder output (p.ex. 32 bit - * storage for 24 bit output. - * \param data pointer to user buffer - * \param size of buffer in bytes - * \return MPG123_OK on success - */ -MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); - -/** The max size of one frame's decoded output with current settings. - * Use that to determine an appropriate minimum buffer size for decoding one frame. */ -MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh); - -/** Replace low-level stream access functions; read and lseek as known in POSIX. - * You can use this to make any fancy file opening/closing yourself, - * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). - * Setting a function to NULL means that the default internal read is - * used (active from next mpg123_open call on). - * Note: As it would be troublesome to mess with this while having a file open, - * this implies mpg123_close(). */ -MPG123_EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); - -/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. - * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. - * There is no fallback to internal read/seek here. - * Note: As it would be troublesome to mess with this while having a file open, - * this mpg123_close() is implied here. - * \param r_read The callback for reading (behaviour like posix read). - * \param r_lseek The callback for seeking (like posix lseek). - * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ -MPG123_EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); - -/* @} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/MacOSX/codecs/include/mpg123_config.txt b/MacOSX/codecs/include/mpg123_config.txt deleted file mode 100644 index 2e82553f..00000000 --- a/MacOSX/codecs/include/mpg123_config.txt +++ /dev/null @@ -1,5 +0,0 @@ -mpg123-1.22.4, configured using: ---disable-modules --disable-debug --disable-fifo --disable-ipv6 --disable-network --disable-messages --disable-lfs-alias --with-audio=dummy -edited src/libmpg123/mpg123lib_intern.h and changed macros -NOQUIET, VERBOSE* and PVERB() to be 0, in order to disable -some debug messages from the library. diff --git a/MacOSX/codecs/include/ogg/config_types.h b/MacOSX/codecs/include/ogg/config_types.h deleted file mode 100644 index 4b00047a..00000000 --- a/MacOSX/codecs/include/ogg/config_types.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __CONFIG_TYPES_H__ -#define __CONFIG_TYPES_H__ - -/* these are filled in by configure */ -#define INCLUDE_INTTYPES_H 1 -#define INCLUDE_STDINT_H 1 -#define INCLUDE_SYS_TYPES_H 1 - -#if INCLUDE_INTTYPES_H -# include <inttypes.h> -#endif -#if INCLUDE_STDINT_H -# include <stdint.h> -#endif -#if INCLUDE_SYS_TYPES_H -# include <sys/types.h> -#endif - -typedef int16_t ogg_int16_t; -typedef uint16_t ogg_uint16_t; -typedef int32_t ogg_int32_t; -typedef uint32_t ogg_uint32_t; -typedef int64_t ogg_int64_t; - -#endif diff --git a/MacOSX/codecs/include/ogg/ogg.h b/MacOSX/codecs/include/ogg/ogg.h deleted file mode 100644 index cea4ebed..00000000 --- a/MacOSX/codecs/include/ogg/ogg.h +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: toplevel libogg include - last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $ - - ********************************************************************/ -#ifndef _OGG_H -#define _OGG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <stddef.h> -#include <ogg/os_types.h> - -typedef struct { - void *iov_base; - size_t iov_len; -} ogg_iovec_t; - -typedef struct { - long endbyte; - int endbit; - - unsigned char *buffer; - unsigned char *ptr; - long storage; -} oggpack_buffer; - -/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/ - -typedef struct { - unsigned char *header; - long header_len; - unsigned char *body; - long body_len; -} ogg_page; - -/* ogg_stream_state contains the current encode/decode state of a logical - Ogg bitstream **********************************************************/ - -typedef struct { - unsigned char *body_data; /* bytes from packet bodies */ - long body_storage; /* storage elements allocated */ - long body_fill; /* elements stored; fill mark */ - long body_returned; /* elements of fill returned */ - - - int *lacing_vals; /* The values that will go to the segment table */ - ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact - this way, but it is simple coupled to the - lacing fifo */ - long lacing_storage; - long lacing_fill; - long lacing_packet; - long lacing_returned; - - unsigned char header[282]; /* working space for header encode */ - int header_fill; - - int e_o_s; /* set when we have buffered the last packet in the - logical bitstream */ - int b_o_s; /* set after we've written the initial page - of a logical bitstream */ - long serialno; - long pageno; - ogg_int64_t packetno; /* sequence number for decode; the framing - knows where there's a hole in the data, - but we need coupling so that the codec - (which is in a separate abstraction - layer) also knows about the gap */ - ogg_int64_t granulepos; - -} ogg_stream_state; - -/* ogg_packet is used to encapsulate the data and metadata belonging - to a single raw Ogg/Vorbis packet *************************************/ - -typedef struct { - unsigned char *packet; - long bytes; - long b_o_s; - long e_o_s; - - ogg_int64_t granulepos; - - ogg_int64_t packetno; /* sequence number for decode; the framing - knows where there's a hole in the data, - but we need coupling so that the codec - (which is in a separate abstraction - layer) also knows about the gap */ -} ogg_packet; - -typedef struct { - unsigned char *data; - int storage; - int fill; - int returned; - - int unsynced; - int headerbytes; - int bodybytes; -} ogg_sync_state; - -/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/ - -extern void oggpack_writeinit(oggpack_buffer *b); -extern int oggpack_writecheck(oggpack_buffer *b); -extern void oggpack_writetrunc(oggpack_buffer *b,long bits); -extern void oggpack_writealign(oggpack_buffer *b); -extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); -extern void oggpack_reset(oggpack_buffer *b); -extern void oggpack_writeclear(oggpack_buffer *b); -extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); -extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); -extern long oggpack_look(oggpack_buffer *b,int bits); -extern long oggpack_look1(oggpack_buffer *b); -extern void oggpack_adv(oggpack_buffer *b,int bits); -extern void oggpack_adv1(oggpack_buffer *b); -extern long oggpack_read(oggpack_buffer *b,int bits); -extern long oggpack_read1(oggpack_buffer *b); -extern long oggpack_bytes(oggpack_buffer *b); -extern long oggpack_bits(oggpack_buffer *b); -extern unsigned char *oggpack_get_buffer(oggpack_buffer *b); - -extern void oggpackB_writeinit(oggpack_buffer *b); -extern int oggpackB_writecheck(oggpack_buffer *b); -extern void oggpackB_writetrunc(oggpack_buffer *b,long bits); -extern void oggpackB_writealign(oggpack_buffer *b); -extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits); -extern void oggpackB_reset(oggpack_buffer *b); -extern void oggpackB_writeclear(oggpack_buffer *b); -extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); -extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits); -extern long oggpackB_look(oggpack_buffer *b,int bits); -extern long oggpackB_look1(oggpack_buffer *b); -extern void oggpackB_adv(oggpack_buffer *b,int bits); -extern void oggpackB_adv1(oggpack_buffer *b); -extern long oggpackB_read(oggpack_buffer *b,int bits); -extern long oggpackB_read1(oggpack_buffer *b); -extern long oggpackB_bytes(oggpack_buffer *b); -extern long oggpackB_bits(oggpack_buffer *b); -extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b); - -/* Ogg BITSTREAM PRIMITIVES: encoding **************************/ - -extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op); -extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, - int count, long e_o_s, ogg_int64_t granulepos); -extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og); -extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill); -extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); -extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill); - -/* Ogg BITSTREAM PRIMITIVES: decoding **************************/ - -extern int ogg_sync_init(ogg_sync_state *oy); -extern int ogg_sync_clear(ogg_sync_state *oy); -extern int ogg_sync_reset(ogg_sync_state *oy); -extern int ogg_sync_destroy(ogg_sync_state *oy); -extern int ogg_sync_check(ogg_sync_state *oy); - -extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); -extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); -extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); -extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); -extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); -extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); -extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); - -/* Ogg BITSTREAM PRIMITIVES: general ***************************/ - -extern int ogg_stream_init(ogg_stream_state *os,int serialno); -extern int ogg_stream_clear(ogg_stream_state *os); -extern int ogg_stream_reset(ogg_stream_state *os); -extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); -extern int ogg_stream_destroy(ogg_stream_state *os); -extern int ogg_stream_check(ogg_stream_state *os); -extern int ogg_stream_eos(ogg_stream_state *os); - -extern void ogg_page_checksum_set(ogg_page *og); - -extern int ogg_page_version(const ogg_page *og); -extern int ogg_page_continued(const ogg_page *og); -extern int ogg_page_bos(const ogg_page *og); -extern int ogg_page_eos(const ogg_page *og); -extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); -extern int ogg_page_serialno(const ogg_page *og); -extern long ogg_page_pageno(const ogg_page *og); -extern int ogg_page_packets(const ogg_page *og); - -extern void ogg_packet_clear(ogg_packet *op); - - -#ifdef __cplusplus -} -#endif - -#endif /* _OGG_H */ diff --git a/MacOSX/codecs/include/ogg/os_types.h b/MacOSX/codecs/include/ogg/os_types.h deleted file mode 100644 index 8bf82107..00000000 --- a/MacOSX/codecs/include/ogg/os_types.h +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: #ifdef jail to whip a few platforms into the UNIX ideal. - last mod: $Id: os_types.h 19098 2014-02-26 19:06:45Z giles $ - - ********************************************************************/ -#ifndef _OS_TYPES_H -#define _OS_TYPES_H - -/* make it easy on the folks that want to compile the libs with a - different malloc than stdlib */ -#define _ogg_malloc malloc -#define _ogg_calloc calloc -#define _ogg_realloc realloc -#define _ogg_free free - -#if defined(_WIN32) - -# if defined(__CYGWIN__) -# include <stdint.h> - typedef int16_t ogg_int16_t; - typedef uint16_t ogg_uint16_t; - typedef int32_t ogg_int32_t; - typedef uint32_t ogg_uint32_t; - typedef int64_t ogg_int64_t; - typedef uint64_t ogg_uint64_t; -# elif defined(__MINGW32__) -# include <sys/types.h> - typedef short ogg_int16_t; - typedef unsigned short ogg_uint16_t; - typedef int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef long long ogg_int64_t; - typedef unsigned long long ogg_uint64_t; -# elif defined(__MWERKS__) - typedef long long ogg_int64_t; - typedef int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef short ogg_int16_t; - typedef unsigned short ogg_uint16_t; -# else - /* MSVC/Borland */ - typedef __int64 ogg_int64_t; - typedef __int32 ogg_int32_t; - typedef unsigned __int32 ogg_uint32_t; - typedef __int16 ogg_int16_t; - typedef unsigned __int16 ogg_uint16_t; -# endif - -#elif defined(__MACOS__) - -# include <sys/types.h> - typedef SInt16 ogg_int16_t; - typedef UInt16 ogg_uint16_t; - typedef SInt32 ogg_int32_t; - typedef UInt32 ogg_uint32_t; - typedef SInt64 ogg_int64_t; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include <inttypes.h> - typedef int16_t ogg_int16_t; - typedef uint16_t ogg_uint16_t; - typedef int32_t ogg_int32_t; - typedef uint32_t ogg_uint32_t; - typedef int64_t ogg_int64_t; - -#elif defined(__HAIKU__) - - /* Haiku */ -# include <sys/types.h> - typedef short ogg_int16_t; - typedef unsigned short ogg_uint16_t; - typedef int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef long long ogg_int64_t; - -#elif defined(__BEOS__) - - /* Be */ -# include <inttypes.h> - typedef int16_t ogg_int16_t; - typedef uint16_t ogg_uint16_t; - typedef int32_t ogg_int32_t; - typedef uint32_t ogg_uint32_t; - typedef int64_t ogg_int64_t; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short ogg_int16_t; - typedef unsigned short ogg_uint16_t; - typedef int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef long long ogg_int64_t; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short ogg_int16_t; - typedef int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef long long ogg_int64_t; - -#elif defined(R5900) - - /* PS2 EE */ - typedef long ogg_int64_t; - typedef int ogg_int32_t; - typedef unsigned ogg_uint32_t; - typedef short ogg_int16_t; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short ogg_int16_t; - typedef unsigned short ogg_uint16_t; - typedef signed int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef long long int ogg_int64_t; - -#elif defined(__TMS320C6X__) - - /* TI C64x compiler */ - typedef signed short ogg_int16_t; - typedef unsigned short ogg_uint16_t; - typedef signed int ogg_int32_t; - typedef unsigned int ogg_uint32_t; - typedef long long int ogg_int64_t; - -#else - -# include <ogg/config_types.h> - -#endif - -#endif /* _OS_TYPES_H */ diff --git a/MacOSX/codecs/include/opus/opus.h b/MacOSX/codecs/include/opus/opus.h deleted file mode 100644 index 462e6399..00000000 --- a/MacOSX/codecs/include/opus/opus.h +++ /dev/null @@ -1,906 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus.h - * @brief Opus reference implementation API - */ - -#ifndef OPUS_H -#define OPUS_H - -#include <opus/opus_types.h> -#include <opus/opus_defines.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @mainpage Opus - * - * The Opus codec is designed for interactive speech and audio transmission over the Internet. - * It is designed by the IETF Codec Working Group and incorporates technology from - * Skype's SILK codec and Xiph.Org's CELT codec. - * - * The Opus codec is designed to handle a wide range of interactive audio applications, - * including Voice over IP, videoconferencing, in-game chat, and even remote live music - * performances. It can scale from low bit-rate narrowband speech to very high quality - * stereo music. Its main features are: - - * @li Sampling rates from 8 to 48 kHz - * @li Bit-rates from 6 kb/s to 510 kb/s - * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) - * @li Audio bandwidth from narrowband to full-band - * @li Support for speech and music - * @li Support for mono and stereo - * @li Support for multichannel (up to 255 channels) - * @li Frame sizes from 2.5 ms to 60 ms - * @li Good loss robustness and packet loss concealment (PLC) - * @li Floating point and fixed-point implementation - * - * Documentation sections: - * @li @ref opus_encoder - * @li @ref opus_decoder - * @li @ref opus_repacketizer - * @li @ref opus_multistream - * @li @ref opus_libinfo - * @li @ref opus_custom - */ - -/** @defgroup opus_encoder Opus Encoder - * @{ - * - * @brief This page describes the process and functions used to encode Opus. - * - * Since Opus is a stateful codec, the encoding process starts with creating an encoder - * state. This can be done with: - * - * @code - * int error; - * OpusEncoder *enc; - * enc = opus_encoder_create(Fs, channels, application, &error); - * @endcode - * - * From this point, @c enc can be used for encoding an audio stream. An encoder state - * @b must @b not be used for more than one stream at the same time. Similarly, the encoder - * state @b must @b not be re-initialized for each frame. - * - * While opus_encoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * - * @code - * int size; - * int error; - * OpusEncoder *enc; - * size = opus_encoder_get_size(channels); - * enc = malloc(size); - * error = opus_encoder_init(enc, Fs, channels, application); - * @endcode - * - * where opus_encoder_get_size() returns the required size for the encoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The encoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * It is possible to change some of the encoder's settings using the opus_encoder_ctl() - * interface. All these settings already default to the recommended value, so they should - * only be changed when necessary. The most common settings one may want to change are: - * - * @code - * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); - * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); - * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); - * @endcode - * - * where - * - * @arg bitrate is in bits per second (b/s) - * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest - * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC - * - * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. - * - * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: - * @code - * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); - * @endcode - * - * where - * <ul> - * <li>audio_frame is the audio data in opus_int16 (or float for opus_encode_float())</li> - * <li>frame_size is the duration of the frame in samples (per channel)</li> - * <li>packet is the byte array to which the compressed data is written</li> - * <li>max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). - * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.</li> - * </ul> - * - * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. - * The return value <b>can be negative</b>, which indicates that an error has occurred. If the return value - * is 1 byte, then the packet does not need to be transmitted (DTX). - * - * Once the encoder state if no longer needed, it can be destroyed with - * - * @code - * opus_encoder_destroy(enc); - * @endcode - * - * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), - * then no action is required aside from potentially freeing the memory that was manually - * allocated for it (calling free(enc) for the example above) - * - */ - -/** Opus encoder state. - * This contains the complete state of an Opus encoder. - * It is position independent and can be freely copied. - * @see opus_encoder_create,opus_encoder_init - */ -typedef struct OpusEncoder OpusEncoder; - -/** Gets the size of an <code>OpusEncoder</code> structure. - * @param[in] channels <tt>int</tt>: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); - -/** - */ - -/** Allocates and initializes an encoder state. - * There are three coding modes: - * - * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice - * signals. It enhances the input signal by high-pass filtering and - * emphasizing formants and harmonics. Optionally it includes in-band - * forward error correction to protect against packet loss. Use this - * mode for typical VoIP applications. Because of the enhancement, - * even at high bitrates the output may sound different from the input. - * - * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most - * non-voice signals like music. Use this mode for music and mixed - * (music/voice) content, broadcast, and applications requiring less - * than 15 ms of coding delay. - * - * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that - * disables the speech-optimized mode in exchange for slightly reduced delay. - * This mode can only be set on an newly initialized or freshly reset encoder - * because it changes the codec delay. - * - * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). - * @param [in] Fs <tt>opus_int32</tt>: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal - * @param [in] application <tt>int</tt>: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @param [out] error <tt>int*</tt>: @ref opus_errorcodes - * @note Regardless of the sampling rate and number channels selected, the Opus encoder - * can switch to a lower audio bandwidth or number of channels if the bitrate - * selected is too low. This also means that it is safe to always use 48 kHz stereo input - * and let the encoder optimize the encoding. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( - opus_int32 Fs, - int channels, - int application, - int *error -); - -/** Initializes a previously allocated encoder state - * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. - * @see opus_encoder_create(),opus_encoder_get_size() - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st <tt>OpusEncoder*</tt>: Encoder state - * @param [in] Fs <tt>opus_int32</tt>: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal - * @param [in] application <tt>int</tt>: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_encoder_init( - OpusEncoder *st, - opus_int32 Fs, - int channels, - int application -) OPUS_ARG_NONNULL(1); - -/** Encodes an Opus frame. - * @param [in] st <tt>OpusEncoder*</tt>: Encoder state - * @param [in] pcm <tt>opus_int16*</tt>: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size <tt>int</tt>: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data <tt>unsigned char*</tt>: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( - OpusEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes an Opus frame from floating point input. - * @param [in] st <tt>OpusEncoder*</tt>: Encoder state - * @param [in] pcm <tt>float*</tt>: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. - * Samples with a range beyond +/-1.0 are supported but will - * be clipped by decoders using the integer API and should - * only be used if it is known that the far end supports - * extended dynamic range. - * length is frame_size*channels*sizeof(float) - * @param [in] frame_size <tt>int</tt>: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data <tt>unsigned char*</tt>: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( - OpusEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an <code>OpusEncoder</code> allocated by opus_encoder_create(). - * @param[in] st <tt>OpusEncoder*</tt>: State to be freed. - */ -OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); - -/** Perform a CTL function on an Opus encoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st <tt>OpusEncoder*</tt>: Encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_encoderctls. - * @see opus_genericctls - * @see opus_encoderctls - */ -OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); -/**@}*/ - -/** @defgroup opus_decoder Opus Decoder - * @{ - * - * @brief This page describes the process and functions used to decode Opus. - * - * The decoding process also starts with creating a decoder - * state. This can be done with: - * @code - * int error; - * OpusDecoder *dec; - * dec = opus_decoder_create(Fs, channels, &error); - * @endcode - * where - * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 - * @li channels is the number of channels (1 or 2) - * @li error will hold the error code in case of failure (or #OPUS_OK on success) - * @li the return value is a newly created decoder state to be used for decoding - * - * While opus_decoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * @code - * int size; - * int error; - * OpusDecoder *dec; - * size = opus_decoder_get_size(channels); - * dec = malloc(size); - * error = opus_decoder_init(dec, Fs, channels); - * @endcode - * where opus_decoder_get_size() returns the required size for the decoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The decoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: - * @code - * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); - * @endcode - * where - * - * @li packet is the byte array containing the compressed data - * @li len is the exact number of bytes contained in the packet - * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) - * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array - * - * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. - * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio - * buffer is too small to hold the decoded audio. - * - * Opus is a stateful codec with overlapping blocks and as a result Opus - * packets are not coded independently of each other. Packets must be - * passed into the decoder serially and in the correct order for a correct - * decode. Lost packets can be replaced with loss concealment by calling - * the decoder with a null pointer and zero length for the missing packet. - * - * A single codec state may only be accessed from a single thread at - * a time and any required locking must be performed by the caller. Separate - * streams must be decoded with separate decoder states and can be decoded - * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK - * defined. - * - */ - -/** Opus decoder state. - * This contains the complete state of an Opus decoder. - * It is position independent and can be freely copied. - * @see opus_decoder_create,opus_decoder_init - */ -typedef struct OpusDecoder OpusDecoder; - -/** Gets the size of an <code>OpusDecoder</code> structure. - * @param [in] channels <tt>int</tt>: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); - -/** Allocates and initializes a decoder state. - * @param [in] Fs <tt>opus_int32</tt>: Sample rate to decode at (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) to decode - * @param [out] error <tt>int*</tt>: #OPUS_OK Success or @ref opus_errorcodes - * - * Internally Opus stores data at 48000 Hz, so that should be the default - * value for Fs. However, the decoder can efficiently decode to buffers - * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use - * data at the full sample rate, or knows the compressed data doesn't - * use the full frequency range, it can request decoding at a reduced - * rate. Likewise, the decoder is capable of filling in either mono or - * interleaved stereo pcm buffers, at the caller's request. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( - opus_int32 Fs, - int channels, - int *error -); - -/** Initializes a previously allocated decoder state. - * The state must be at least the size returned by opus_decoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st <tt>OpusDecoder*</tt>: Decoder state. - * @param [in] Fs <tt>opus_int32</tt>: Sampling rate to decode to (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) to decode - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_decoder_init( - OpusDecoder *st, - opus_int32 Fs, - int channels -) OPUS_ARG_NONNULL(1); - -/** Decode an Opus packet. - * @param [in] st <tt>OpusDecoder*</tt>: Decoder state - * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len <tt>opus_int32</tt>: Number of bytes in payload* - * @param [out] pcm <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. - * @param [in] decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available, the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode an Opus packet with floating point output. - * @param [in] st <tt>OpusDecoder*</tt>: Decoder state - * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len <tt>opus_int32</tt>: Number of bytes in payload - * @param [out] pcm <tt>float*</tt>: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(float) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. - * @param [in] decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on an Opus decoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st <tt>OpusDecoder*</tt>: Decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_decoderctls. - * @see opus_genericctls - * @see opus_decoderctls - */ -OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an <code>OpusDecoder</code> allocated by opus_decoder_create(). - * @param[in] st <tt>OpusDecoder*</tt>: State to be freed. - */ -OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); - -/** Parse an opus packet into one or more frames. - * Opus_decode will perform this operation internally so most applications do - * not need to use this function. - * This function does not copy the frames, the returned pointers are pointers into - * the input packet. - * @param [in] data <tt>char*</tt>: Opus packet to be parsed - * @param [in] len <tt>opus_int32</tt>: size of data - * @param [out] out_toc <tt>char*</tt>: TOC pointer - * @param [out] frames <tt>char*[48]</tt> encapsulated frames - * @param [out] size <tt>opus_int16[48]</tt> sizes of the encapsulated frames - * @param [out] payload_offset <tt>int*</tt>: returns the position of the payload within the packet (in bytes) - * @returns number of frames - */ -OPUS_EXPORT int opus_packet_parse( - const unsigned char *data, - opus_int32 len, - unsigned char *out_toc, - const unsigned char *frames[48], - opus_int16 size[48], - int *payload_offset -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5); - -/** Gets the bandwidth of an Opus packet. - * @param [in] data <tt>char*</tt>: Opus packet - * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) - * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) - * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) - * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) - * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples per frame from an Opus packet. - * @param [in] data <tt>char*</tt>: Opus packet. - * This must contain at least one byte of - * data. - * @param [in] Fs <tt>opus_int32</tt>: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples per frame. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of channels from an Opus packet. - * @param [in] data <tt>char*</tt>: Opus packet - * @returns Number of channels - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of frames in an Opus packet. - * @param [in] packet <tt>char*</tt>: Opus packet - * @param [in] len <tt>opus_int32</tt>: Length of packet - * @returns Number of frames - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] packet <tt>char*</tt>: Opus packet - * @param [in] len <tt>opus_int32</tt>: Length of packet - * @param [in] Fs <tt>opus_int32</tt>: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] dec <tt>OpusDecoder*</tt>: Decoder state - * @param [in] packet <tt>char*</tt>: Opus packet - * @param [in] len <tt>opus_int32</tt>: Length of packet - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); -/**@}*/ - -/** @defgroup opus_repacketizer Repacketizer - * @{ - * - * The repacketizer can be used to merge multiple Opus packets into a single - * packet or alternatively to split Opus packets that have previously been - * merged. Splitting valid Opus packets is always guaranteed to succeed, - * whereas merging valid packets only succeeds if all frames have the same - * mode, bandwidth, and frame size, and when the total duration of the merged - * packet is no more than 120 ms. - * The repacketizer currently only operates on elementary Opus - * streams. It will not manipualte multistream packets successfully, except in - * the degenerate case where they consist of data from a single stream. - * - * The repacketizing process starts with creating a repacketizer state, either - * by calling opus_repacketizer_create() or by allocating the memory yourself, - * e.g., - * @code - * OpusRepacketizer *rp; - * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); - * if (rp != NULL) - * opus_repacketizer_init(rp); - * @endcode - * - * Then the application should submit packets with opus_repacketizer_cat(), - * extract new packets with opus_repacketizer_out() or - * opus_repacketizer_out_range(), and then reset the state for the next set of - * input packets via opus_repacketizer_init(). - * - * For example, to split a sequence of packets into individual frames: - * @code - * unsigned char *data; - * int len; - * while (get_next_packet(&data, &len)) - * { - * unsigned char out[1276]; - * opus_int32 out_len; - * int nb_frames; - * int err; - * int i; - * err = opus_repacketizer_cat(rp, data, len); - * if (err != OPUS_OK) - * { - * release_packet(data); - * return err; - * } - * nb_frames = opus_repacketizer_get_nb_frames(rp); - * for (i = 0; i < nb_frames; i++) - * { - * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packet(data); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * } - * opus_repacketizer_init(rp); - * release_packet(data); - * } - * @endcode - * - * Alternatively, to combine a sequence of frames into packets that each - * contain up to <code>TARGET_DURATION_MS</code> milliseconds of data: - * @code - * // The maximum number of packets with duration TARGET_DURATION_MS occurs - * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) - * // packets. - * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; - * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; - * int nb_packets; - * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; - * opus_int32 out_len; - * int prev_toc; - * nb_packets = 0; - * while (get_next_packet(data+nb_packets, len+nb_packets)) - * { - * int nb_frames; - * int err; - * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); - * if (nb_frames < 1) - * { - * release_packets(data, nb_packets+1); - * return nb_frames; - * } - * nb_frames += opus_repacketizer_get_nb_frames(rp); - * // If adding the next packet would exceed our target, or it has an - * // incompatible TOC sequence, output the packets we already have before - * // submitting it. - * // N.B., The nb_packets > 0 check ensures we've submitted at least one - * // packet since the last call to opus_repacketizer_init(). Otherwise a - * // single packet longer than TARGET_DURATION_MS would cause us to try to - * // output an (invalid) empty packet. It also ensures that prev_toc has - * // been set to a valid value. Additionally, len[nb_packets] > 0 is - * // guaranteed by the call to opus_packet_get_nb_frames() above, so the - * // reference to data[nb_packets][0] should be valid. - * if (nb_packets > 0 && ( - * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || - * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > - * TARGET_DURATION_MS*48)) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packets(data, nb_packets+1); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * opus_repacketizer_init(rp); - * release_packets(data, nb_packets); - * data[0] = data[nb_packets]; - * len[0] = len[nb_packets]; - * nb_packets = 0; - * } - * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); - * if (err != OPUS_OK) - * { - * release_packets(data, nb_packets+1); - * return err; - * } - * prev_toc = data[nb_packets][0]; - * nb_packets++; - * } - * // Output the final, partial packet. - * if (nb_packets > 0) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * release_packets(data, nb_packets); - * if (out_len < 0) - * return (int)out_len; - * output_next_packet(out, out_len); - * } - * @endcode - * - * An alternate way of merging packets is to simply call opus_repacketizer_cat() - * unconditionally until it fails. At that point, the merged packet can be - * obtained with opus_repacketizer_out() and the input packet for which - * opus_repacketizer_cat() needs to be re-added to a newly reinitialized - * repacketizer state. - */ - -typedef struct OpusRepacketizer OpusRepacketizer; - -/** Gets the size of an <code>OpusRepacketizer</code> structure. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); - -/** (Re)initializes a previously allocated repacketizer state. - * The state must be at least the size returned by opus_repacketizer_get_size(). - * This can be used for applications which use their own allocator instead of - * malloc(). - * It must also be called to reset the queue of packets waiting to be - * repacketized, which is necessary if the maximum packet duration of 120 ms - * is reached or if you wish to submit packets with a different Opus - * configuration (coding mode, audio bandwidth, frame size, or channel count). - * Failure to do so will prevent a new packet from being added with - * opus_repacketizer_cat(). - * @see opus_repacketizer_create - * @see opus_repacketizer_get_size - * @see opus_repacketizer_cat - * @param rp <tt>OpusRepacketizer*</tt>: The repacketizer state to - * (re)initialize. - * @returns A pointer to the same repacketizer state that was passed in. - */ -OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Allocates memory and initializes the new repacketizer with - * opus_repacketizer_init(). - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); - -/** Frees an <code>OpusRepacketizer</code> allocated by - * opus_repacketizer_create(). - * @param[in] rp <tt>OpusRepacketizer*</tt>: State to be freed. - */ -OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); - -/** Add a packet to the current repacketizer state. - * This packet must match the configuration of any packets already submitted - * for repacketization since the last call to opus_repacketizer_init(). - * This means that it must have the same coding mode, audio bandwidth, frame - * size, and channel count. - * This can be checked in advance by examining the top 6 bits of the first - * byte of the packet, and ensuring they match the top 6 bits of the first - * byte of any previously submitted packet. - * The total duration of audio in the repacketizer state also must not exceed - * 120 ms, the maximum duration of a single packet, after adding this packet. - * - * The contents of the current repacketizer state can be extracted into new - * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). - * - * In order to add a packet with a different configuration or to add more - * audio beyond 120 ms, you must clear the repacketizer state by calling - * opus_repacketizer_init(). - * If a packet is too large to add to the current repacketizer state, no part - * of it is added, even if it contains multiple frames, some of which might - * fit. - * If you wish to be able to add parts of such packets, you should first use - * another repacketizer to split the packet into pieces and add them - * individually. - * @see opus_repacketizer_out_range - * @see opus_repacketizer_out - * @see opus_repacketizer_init - * @param rp <tt>OpusRepacketizer*</tt>: The repacketizer state to which to - * add the packet. - * @param[in] data <tt>const unsigned char*</tt>: The packet data. - * The application must ensure - * this pointer remains valid - * until the next call to - * opus_repacketizer_init() or - * opus_repacketizer_destroy(). - * @param len <tt>opus_int32</tt>: The number of bytes in the packet data. - * @returns An error code indicating whether or not the operation succeeded. - * @retval #OPUS_OK The packet's contents have been added to the repacketizer - * state. - * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, - * the packet's TOC sequence was not compatible - * with previously submitted packets (because - * the coding mode, audio bandwidth, frame size, - * or channel count did not match), or adding - * this packet would increase the total amount of - * audio stored in the repacketizer state to more - * than 120 ms. - */ -OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * @param rp <tt>OpusRepacketizer*</tt>: The repacketizer state from which to - * construct the new packet. - * @param begin <tt>int</tt>: The index of the first frame in the current - * repacketizer state to include in the output. - * @param end <tt>int</tt>: One past the index of the last frame in the - * current repacketizer state to include in the - * output. - * @param[out] data <tt>const unsigned char*</tt>: The buffer in which to - * store the output packet. - * @param maxlen <tt>opus_int32</tt>: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * <code>1276</code> for a single frame, - * or for multiple frames, - * <code>1277*(end-begin)</code>. - * However, <code>1*(end-begin)</code> plus - * the size of all packet data submitted to - * the repacketizer since the last call to - * opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG <code>[begin,end)</code> was an invalid range of - * frames (begin < 0, begin >= end, or end > - * opus_repacketizer_get_nb_frames()). - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Return the total number of frames contained in packet data submitted to - * the repacketizer state so far via opus_repacketizer_cat() since the last - * call to opus_repacketizer_init() or opus_repacketizer_create(). - * This defines the valid range of packets that can be extracted with - * opus_repacketizer_out_range() or opus_repacketizer_out(). - * @param rp <tt>OpusRepacketizer*</tt>: The repacketizer state containing the - * frames. - * @returns The total number of frames contained in the packet data submitted - * to the repacketizer state. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * This is a convenience routine that returns all the data submitted so far - * in a single packet. - * It is equivalent to calling - * @code - * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), - * data, maxlen) - * @endcode - * @param rp <tt>OpusRepacketizer*</tt>: The repacketizer state from which to - * construct the new packet. - * @param[out] data <tt>const unsigned char*</tt>: The buffer in which to - * store the output packet. - * @param maxlen <tt>opus_int32</tt>: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * <code>1277*opus_repacketizer_get_nb_frames(rp)</code>. - * However, - * <code>1*opus_repacketizer_get_nb_frames(rp)</code> - * plus the size of all packet data - * submitted to the repacketizer since the - * last call to opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_H */ diff --git a/MacOSX/codecs/include/opus/opus_defines.h b/MacOSX/codecs/include/opus/opus_defines.h deleted file mode 100644 index bf983f94..00000000 --- a/MacOSX/codecs/include/opus/opus_defines.h +++ /dev/null @@ -1,659 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_defines.h - * @brief Opus reference implementation constants - */ - -#ifndef OPUS_DEFINES_H -#define OPUS_DEFINES_H - -#include <opus/opus_types.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup opus_errorcodes Error codes - * @{ - */ -/** No error @hideinitializer*/ -#define OPUS_OK 0 -/** One or more invalid/out of range arguments @hideinitializer*/ -#define OPUS_BAD_ARG -1 -/** The mode struct passed is invalid @hideinitializer*/ -#define OPUS_BUFFER_TOO_SMALL -2 -/** An internal error was detected @hideinitializer*/ -#define OPUS_INTERNAL_ERROR -3 -/** The compressed data passed is corrupted @hideinitializer*/ -#define OPUS_INVALID_PACKET -4 -/** Invalid/unsupported request number @hideinitializer*/ -#define OPUS_UNIMPLEMENTED -5 -/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ -#define OPUS_INVALID_STATE -6 -/** Memory allocation has failed @hideinitializer*/ -#define OPUS_ALLOC_FAIL -7 -/**@}*/ - -/** @cond OPUS_INTERNAL_DOC */ -/**Export control for opus functions */ - -#ifndef OPUS_EXPORT -# if defined(_WIN32) -# if defined(OPUS_BUILD) && defined(DLL_EXPORT) -# define OPUS_EXPORT __declspec(dllexport) -# else -# define OPUS_EXPORT -# endif -# elif defined(__GNUC__) && defined(OPUS_BUILD) -# define OPUS_EXPORT __attribute__ ((visibility ("default"))) -# else -# define OPUS_EXPORT -# endif -#endif - -# if !defined(OPUS_GNUC_PREREQ) -# if defined(__GNUC__)&&defined(__GNUC_MINOR__) -# define OPUS_GNUC_PREREQ(_maj,_min) \ - ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) -# else -# define OPUS_GNUC_PREREQ(_maj,_min) 0 -# endif -# endif - -#if (defined(__GNUC__) && !OPUS_GNUC_PREREQ(3,4)) -/* __restrict is broken with gcc < 3.4 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6392 */ -# define OPUS_RESTRICT -#elif (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(3,0) -# define OPUS_RESTRICT __restrict__ -# elif (defined(_MSC_VER) && _MSC_VER >= 1400) -# define OPUS_RESTRICT __restrict -# else -# define OPUS_RESTRICT -# endif -#else -# define OPUS_RESTRICT restrict -#endif - -/**Warning attributes for opus functions - * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out - * some paranoid null checks. */ -#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) -#else -# define OPUS_WARN_UNUSED_RESULT -#endif -#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) -#else -# define OPUS_ARG_NONNULL(_x) -#endif - -/** These are the actual Encoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -#define OPUS_SET_APPLICATION_REQUEST 4000 -#define OPUS_GET_APPLICATION_REQUEST 4001 -#define OPUS_SET_BITRATE_REQUEST 4002 -#define OPUS_GET_BITRATE_REQUEST 4003 -#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 -#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 -#define OPUS_SET_VBR_REQUEST 4006 -#define OPUS_GET_VBR_REQUEST 4007 -#define OPUS_SET_BANDWIDTH_REQUEST 4008 -#define OPUS_GET_BANDWIDTH_REQUEST 4009 -#define OPUS_SET_COMPLEXITY_REQUEST 4010 -#define OPUS_GET_COMPLEXITY_REQUEST 4011 -#define OPUS_SET_INBAND_FEC_REQUEST 4012 -#define OPUS_GET_INBAND_FEC_REQUEST 4013 -#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 -#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 -#define OPUS_SET_DTX_REQUEST 4016 -#define OPUS_GET_DTX_REQUEST 4017 -#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 -#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 -#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 -#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 -#define OPUS_SET_SIGNAL_REQUEST 4024 -#define OPUS_GET_SIGNAL_REQUEST 4025 -#define OPUS_GET_LOOKAHEAD_REQUEST 4027 -/* #define OPUS_RESET_STATE 4028 */ -#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 -#define OPUS_GET_FINAL_RANGE_REQUEST 4031 -#define OPUS_GET_PITCH_REQUEST 4033 -#define OPUS_SET_GAIN_REQUEST 4034 -#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ -#define OPUS_SET_LSB_DEPTH_REQUEST 4036 -#define OPUS_GET_LSB_DEPTH_REQUEST 4037 - -#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 - -/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ - -/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ -#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) -#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) -#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) -/** @endcond */ - -/** @defgroup opus_ctlvalues Pre-defined values for CTL interface - * @see opus_genericctls, opus_encoderctls - * @{ - */ -/* Values for the various encoder CTLs */ -#define OPUS_AUTO -1000 /**<Auto/default setting @hideinitializer*/ -#define OPUS_BITRATE_MAX -1 /**<Maximum bitrate @hideinitializer*/ - -/** Best for most VoIP/videoconference applications where listening quality and intelligibility matter most - * @hideinitializer */ -#define OPUS_APPLICATION_VOIP 2048 -/** Best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input - * @hideinitializer */ -#define OPUS_APPLICATION_AUDIO 2049 -/** Only use when lowest-achievable latency is what matters most. Voice-optimized modes cannot be used. - * @hideinitializer */ -#define OPUS_APPLICATION_RESTRICTED_LOWDELAY 2051 - -#define OPUS_SIGNAL_VOICE 3001 /**< Signal being encoded is voice */ -#define OPUS_SIGNAL_MUSIC 3002 /**< Signal being encoded is music */ -#define OPUS_BANDWIDTH_NARROWBAND 1101 /**< 4 kHz bandpass @hideinitializer*/ -#define OPUS_BANDWIDTH_MEDIUMBAND 1102 /**< 6 kHz bandpass @hideinitializer*/ -#define OPUS_BANDWIDTH_WIDEBAND 1103 /**< 8 kHz bandpass @hideinitializer*/ -#define OPUS_BANDWIDTH_SUPERWIDEBAND 1104 /**<12 kHz bandpass @hideinitializer*/ -#define OPUS_BANDWIDTH_FULLBAND 1105 /**<20 kHz bandpass @hideinitializer*/ - -/**@}*/ - - -/** @defgroup opus_encoderctls Encoder related CTLs - * - * These are convenience macros for use with the \c opus_encode_ctl - * interface. They are used to generate the appropriate series of - * arguments for that call, passing the correct type, size and so - * on as expected for each particular request. - * - * Some usage examples: - * - * @code - * int ret; - * ret = opus_encoder_ctl(enc_ctx, OPUS_SET_BANDWIDTH(OPUS_AUTO)); - * if (ret != OPUS_OK) return ret; - * - * opus_int32 rate; - * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&rate)); - * - * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); - * @endcode - * - * @see opus_genericctls, opus_encoder - * @{ - */ - -/** Configures the encoder's computational complexity. - * The supported range is 0-10 inclusive with 10 representing the highest complexity. - * @see OPUS_GET_COMPLEXITY - * @param[in] x <tt>opus_int32</tt>: Allowed values: 0-10, inclusive. - * - * @hideinitializer */ -#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) -/** Gets the encoder's complexity configuration. - * @see OPUS_SET_COMPLEXITY - * @param[out] x <tt>opus_int32 *</tt>: Returns a value in the range 0-10, - * inclusive. - * @hideinitializer */ -#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) - -/** Configures the bitrate in the encoder. - * Rates from 500 to 512000 bits per second are meaningful, as well as the - * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. - * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much - * rate as it can, which is useful for controlling the rate by adjusting the - * output buffer size. - * @see OPUS_GET_BITRATE - * @param[in] x <tt>opus_int32</tt>: Bitrate in bits per second. The default - * is determined based on the number of - * channels and the input sampling rate. - * @hideinitializer */ -#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) -/** Gets the encoder's bitrate configuration. - * @see OPUS_SET_BITRATE - * @param[out] x <tt>opus_int32 *</tt>: Returns the bitrate in bits per second. - * The default is determined based on the - * number of channels and the input - * sampling rate. - * @hideinitializer */ -#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables variable bitrate (VBR) in the encoder. - * The configured bitrate may not be met exactly because frames must - * be an integer number of bytes in length. - * @warning Only the MDCT mode of Opus can provide hard CBR behavior. - * @see OPUS_GET_VBR - * @see OPUS_SET_VBR_CONSTRAINT - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>0</dt><dd>Hard CBR. For LPC/hybrid modes at very low bit-rate, this can - * cause noticeable quality degradation.</dd> - * <dt>1</dt><dd>VBR (default). The exact type of VBR is controlled by - * #OPUS_SET_VBR_CONSTRAINT.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) -/** Determine if variable bitrate (VBR) is enabled in the encoder. - * @see OPUS_SET_VBR - * @see OPUS_GET_VBR_CONSTRAINT - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>0</dt><dd>Hard CBR.</dd> - * <dt>1</dt><dd>VBR (default). The exact type of VBR may be retrieved via - * #OPUS_GET_VBR_CONSTRAINT.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables constrained VBR in the encoder. - * This setting is ignored when the encoder is in CBR mode. - * @warning Only the MDCT mode of Opus currently heeds the constraint. - * Speech mode ignores it completely, hybrid mode may fail to obey it - * if the LPC layer uses more bitrate than the constraint would have - * permitted. - * @see OPUS_GET_VBR_CONSTRAINT - * @see OPUS_SET_VBR - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>0</dt><dd>Unconstrained VBR.</dd> - * <dt>1</dt><dd>Constrained VBR (default). This creates a maximum of one - * frame of buffering delay assuming a transport with a - * serialization speed of the nominal bitrate.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) -/** Determine if constrained VBR is enabled in the encoder. - * @see OPUS_SET_VBR_CONSTRAINT - * @see OPUS_GET_VBR - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>0</dt><dd>Unconstrained VBR.</dd> - * <dt>1</dt><dd>Constrained VBR (default).</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) - -/** Configures mono/stereo forcing in the encoder. - * This can force the encoder to produce packets encoded as either mono or - * stereo, regardless of the format of the input audio. This is useful when - * the caller knows that the input signal is currently a mono source embedded - * in a stereo stream. - * @see OPUS_GET_FORCE_CHANNELS - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>#OPUS_AUTO</dt><dd>Not forced (default)</dd> - * <dt>1</dt> <dd>Forced mono</dd> - * <dt>2</dt> <dd>Forced stereo</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) -/** Gets the encoder's forced channel configuration. - * @see OPUS_SET_FORCE_CHANNELS - * @param[out] x <tt>opus_int32 *</tt>: - * <dl> - * <dt>#OPUS_AUTO</dt><dd>Not forced (default)</dd> - * <dt>1</dt> <dd>Forced mono</dd> - * <dt>2</dt> <dd>Forced stereo</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) - -/** Configures the maximum bandpass that the encoder will select automatically. - * Applications should normally use this instead of #OPUS_SET_BANDWIDTH - * (leaving that set to the default, #OPUS_AUTO). This allows the - * application to set an upper bound based on the type of input it is - * providing, but still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_MAX_BANDWIDTH - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd> - * <dt>OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd> - * <dt>OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd> - * <dt>OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd> - * <dt>OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband (default)</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Gets the encoder's configured maximum allowed bandpass. - * @see OPUS_SET_MAX_BANDWIDTH - * @param[out] x <tt>opus_int32 *</tt>: Allowed values: - * <dl> - * <dt>#OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband (default)</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Sets the encoder's bandpass to a specific value. - * This prevents the encoder from automatically selecting the bandpass based - * on the available bitrate. If an application knows the bandpass of the input - * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH - * instead, which still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_BANDWIDTH - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>#OPUS_AUTO</dt> <dd>(default)</dd> - * <dt>#OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Configures the type of signal being encoded. - * This is a hint which helps the encoder's mode selection. - * @see OPUS_GET_SIGNAL - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>#OPUS_AUTO</dt> <dd>(default)</dd> - * <dt>#OPUS_SIGNAL_VOICE</dt><dd>Bias thresholds towards choosing LPC or Hybrid modes.</dd> - * <dt>#OPUS_SIGNAL_MUSIC</dt><dd>Bias thresholds towards choosing MDCT modes.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal type. - * @see OPUS_SET_SIGNAL - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>#OPUS_AUTO</dt> <dd>(default)</dd> - * <dt>#OPUS_SIGNAL_VOICE</dt><dd>Bias thresholds towards choosing LPC or Hybrid modes.</dd> - * <dt>#OPUS_SIGNAL_MUSIC</dt><dd>Bias thresholds towards choosing MDCT modes.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) - - -/** Configures the encoder's intended application. - * The initial value is a mandatory argument to the encoder_create function. - * @see OPUS_GET_APPLICATION - * @param[in] x <tt>opus_int32</tt>: Returns one of the following values: - * <dl> - * <dt>#OPUS_APPLICATION_VOIP</dt> - * <dd>Process signal for improved speech intelligibility.</dd> - * <dt>#OPUS_APPLICATION_AUDIO</dt> - * <dd>Favor faithfulness to the original input.</dd> - * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> - * <dd>Configure the minimum possible coding delay by disabling certain modes - * of operation.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured application. - * @see OPUS_SET_APPLICATION - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>#OPUS_APPLICATION_VOIP</dt> - * <dd>Process signal for improved speech intelligibility.</dd> - * <dt>#OPUS_APPLICATION_AUDIO</dt> - * <dd>Favor faithfulness to the original input.</dd> - * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> - * <dd>Configure the minimum possible coding delay by disabling certain modes - * of operation.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the sampling rate the encoder or decoder was initialized with. - * This simply returns the <code>Fs</code> value passed to opus_encoder_init() - * or opus_decoder_init(). - * @param[out] x <tt>opus_int32 *</tt>: Sampling rate of encoder or decoder. - * @hideinitializer - */ -#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) - -/** Gets the total samples of delay added by the entire codec. - * This can be queried by the encoder and then the provided number of samples can be - * skipped on from the start of the decoder's output to provide time aligned input - * and output. From the perspective of a decoding application the real data begins this many - * samples late. - * - * The decoder contribution to this delay is identical for all decoders, but the - * encoder portion of the delay may vary from implementation to implementation, - * version to version, or even depend on the encoder's initial configuration. - * Applications needing delay compensation should call this CTL rather than - * hard-coding a value. - * @param[out] x <tt>opus_int32 *</tt>: Number of lookahead samples - * @hideinitializer */ -#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of inband forward error correction (FEC). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_INBAND_FEC - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>0</dt><dd>Disable inband FEC (default).</dd> - * <dt>1</dt><dd>Enable inband FEC.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of inband forward error correction. - * @see OPUS_SET_INBAND_FEC - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>0</dt><dd>Inband FEC disabled (default).</dd> - * <dt>1</dt><dd>Inband FEC enabled.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's expected packet loss percentage. - * Higher values with trigger progressively more loss resistant behavior in the encoder - * at the expense of quality at a given bitrate in the lossless case, but greater quality - * under loss. - * @see OPUS_GET_PACKET_LOSS_PERC - * @param[in] x <tt>opus_int32</tt>: Loss percentage in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured packet loss percentage. - * @see OPUS_SET_PACKET_LOSS_PERC - * @param[out] x <tt>opus_int32 *</tt>: Returns the configured loss percentage - * in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of discontinuous transmission (DTX). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_DTX - * @param[in] x <tt>opus_int32</tt>: Allowed values: - * <dl> - * <dt>0</dt><dd>Disable DTX (default).</dd> - * <dt>1</dt><dd>Enabled DTX.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of discontinuous transmission. - * @see OPUS_SET_DTX - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>0</dt><dd>DTX disabled (default).</dd> - * <dt>1</dt><dd>DTX enabled.</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) -/** Configures the depth of signal being encoded. - * This is a hint which helps the encoder identify silence and near-silence. - * @see OPUS_GET_LSB_DEPTH - * @param[in] x <tt>opus_int32</tt>: Input precision in bits, between 8 and 24 - * (default: 24). - * @hideinitializer */ -#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal depth. - * @see OPUS_SET_LSB_DEPTH - * @param[out] x <tt>opus_int32 *</tt>: Input precision in bits, between 8 and - * 24 (default: 24). - * @hideinitializer */ -#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) - -/** Gets the duration (in samples) of the last packet successfully decoded or concealed. - * @param[out] x <tt>opus_int32 *</tt>: Number of samples (at current sampling rate). - * @hideinitializer */ -#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) -/**@}*/ - -/** @defgroup opus_genericctls Generic CTLs - * - * These macros are used with the \c opus_decoder_ctl and - * \c opus_encoder_ctl calls to generate a particular - * request. - * - * When called on an \c OpusDecoder they apply to that - * particular decoder instance. When called on an - * \c OpusEncoder they apply to the corresponding setting - * on that encoder instance, if present. - * - * Some usage examples: - * - * @code - * int ret; - * opus_int32 pitch; - * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); - * if (ret == OPUS_OK) return ret; - * - * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); - * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); - * - * opus_int32 enc_bw, dec_bw; - * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); - * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); - * if (enc_bw != dec_bw) { - * printf("packet bandwidth mismatch!\n"); - * } - * @endcode - * - * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls - * @{ - */ - -/** Resets the codec state to be equivalent to a freshly initialized state. - * This should be called when switching streams in order to prevent - * the back to back decoding from giving different results from - * one at a time decoding. - * @hideinitializer */ -#define OPUS_RESET_STATE 4028 - -/** Gets the final state of the codec's entropy coder. - * This is used for testing purposes, - * The encoder and decoder state should be identical after coding a payload - * (assuming no data corruption or software bugs) - * - * @param[out] x <tt>opus_uint32 *</tt>: Entropy coder state - * - * @hideinitializer */ -#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) - -/** Gets the pitch of the last decoded frame, if available. - * This can be used for any post-processing algorithm requiring the use of pitch, - * e.g. time stretching/shortening. If the last frame was not voiced, or if the - * pitch was not coded in the frame, then zero is returned. - * - * This CTL is only implemented for decoder instances. - * - * @param[out] x <tt>opus_int32 *</tt>: pitch period at 48 kHz (or 0 if not available) - * - * @hideinitializer */ -#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) - -/** Gets the encoder's configured bandpass or the decoder's last bandpass. - * @see OPUS_SET_BANDWIDTH - * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: - * <dl> - * <dt>#OPUS_AUTO</dt> <dd>(default)</dd> - * <dt>#OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd> - * <dt>#OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband</dd> - * </dl> - * @hideinitializer */ -#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_decoderctls Decoder related CTLs - * @see opus_genericctls, opus_encoderctls, opus_decoder - * @{ - */ - -/** Configures decoder gain adjustment. - * Scales the decoded output by a factor specified in Q8 dB units. - * This has a maximum range of -32768 to 32767 inclusive, and returns - * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. - * This setting survives decoder reset. - * - * gain = pow(10, x/(20.0*256)) - * - * @param[in] x <tt>opus_int32</tt>: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) -/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN - * - * @param[out] x <tt>opus_int32 *</tt>: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_libinfo Opus library information functions - * @{ - */ - -/** Converts an opus error code into a human readable string. - * - * @param[in] error <tt>int</tt>: Error number - * @returns Error string - */ -OPUS_EXPORT const char *opus_strerror(int error); - -/** Gets the libopus version string. - * - * @returns Version string - */ -OPUS_EXPORT const char *opus_get_version_string(void); -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_DEFINES_H */ diff --git a/MacOSX/codecs/include/opus/opus_multistream.h b/MacOSX/codecs/include/opus/opus_multistream.h deleted file mode 100644 index 965d54ab..00000000 --- a/MacOSX/codecs/include/opus/opus_multistream.h +++ /dev/null @@ -1,660 +0,0 @@ -/* Copyright (c) 2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_multistream.h - * @brief Opus reference implementation multistream API - */ - -#ifndef OPUS_MULTISTREAM_H -#define OPUS_MULTISTREAM_H - -#include <opus/opus.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** Macros to trigger compilation errors when the wrong types are provided to a - * CTL. */ -/**@{*/ -#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) -#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) -/**@}*/ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 -#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 -/**@}*/ - -/** @endcond */ - -/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and - * @ref opus_decoderctls may be applied to a multistream encoder or decoder as - * well. - * In addition, you may retrieve the encoder or decoder state for an specific - * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or - * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. - */ -/**@{*/ - -/** Gets the encoder state for an individual stream of a multistream encoder. - * @param[in] x <tt>opus_int32</tt>: The index of the stream whose encoder you - * wish to retrieve. - * This must be non-negative and less than - * the <code>streams</code> parameter used - * to initialize the encoder. - * @param[out] y <tt>OpusEncoder**</tt>: Returns a pointer to the given - * encoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) - -/** Gets the decoder state for an individual stream of a multistream decoder. - * @param[in] x <tt>opus_int32</tt>: The index of the stream whose decoder you - * wish to retrieve. - * This must be non-negative and less than - * the <code>streams</code> parameter used - * to initialize the decoder. - * @param[out] y <tt>OpusDecoder**</tt>: Returns a pointer to the given - * decoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) - -/**@}*/ - -/** @defgroup opus_multistream Opus Multistream API - * @{ - * - * The multistream API allows individual Opus streams to be combined into a - * single packet, enabling support for up to 255 channels. Unlike an - * elementary Opus stream, the encoder and decoder must negotiate the channel - * configuration before the decoder can successfully interpret the data in the - * packets produced by the encoder. Some basic information, such as packet - * duration, can be computed without any special negotiation. - * - * The format for multistream Opus packets is defined in the - * <a href="http://tools.ietf.org/html/draft-terriberry-oggopus">Ogg - * encapsulation specification</a> and is based on the self-delimited Opus - * framing described in Appendix B of <a href="http://tools.ietf.org/html/rfc6716">RFC 6716</a>. - * Normal Opus packets are just a degenerate case of multistream Opus packets, - * and can be encoded or decoded with the multistream API by setting - * <code>streams</code> to <code>1</code> when initializing the encoder or - * decoder. - * - * Multistream Opus streams can contain up to 255 elementary Opus streams. - * These may be either "uncoupled" or "coupled", indicating that the decoder - * is configured to decode them to either 1 or 2 channels, respectively. - * The streams are ordered so that all coupled streams appear at the - * beginning. - * - * A <code>mapping</code> table defines which decoded channel <code>i</code> - * should be used for each input/output (I/O) channel <code>j</code>. This table is - * typically provided as an unsigned char array. - * Let <code>i = mapping[j]</code> be the index for I/O channel <code>j</code>. - * If <code>i < 2*coupled_streams</code>, then I/O channel <code>j</code> is - * encoded as the left channel of stream <code>(i/2)</code> if <code>i</code> - * is even, or as the right channel of stream <code>(i/2)</code> if - * <code>i</code> is odd. Otherwise, I/O channel <code>j</code> is encoded as - * mono in stream <code>(i - coupled_streams)</code>, unless it has the special - * value 255, in which case it is omitted from the encoding entirely (the - * decoder will reproduce it as silence). Each value <code>i</code> must either - * be the special value 255 or be less than <code>streams + coupled_streams</code>. - * - * The output channels specified by the encoder - * should use the - * <a href="http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9">Vorbis - * channel ordering</a>. A decoder may wish to apply an additional permutation - * to the mapping the encoder used to achieve a different output channel - * order (e.g. for outputing in WAV order). - * - * Each multistream packet contains an Opus packet for each stream, and all of - * the Opus packets in a single multistream packet must have the same - * duration. Therefore the duration of a multistream packet can be extracted - * from the TOC sequence of the first stream, which is located at the - * beginning of the packet, just like an elementary Opus stream: - * - * @code - * int nb_samples; - * int nb_frames; - * nb_frames = opus_packet_get_nb_frames(data, len); - * if (nb_frames < 1) - * return nb_frames; - * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; - * @endcode - * - * The general encoding and decoding process proceeds exactly the same as in - * the normal @ref opus_encoder and @ref opus_decoder APIs. - * See their documentation for an overview of how to use the corresponding - * multistream functions. - */ - -/** Opus multistream encoder state. - * This contains the complete state of a multistream Opus encoder. - * It is position independent and can be freely copied. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_init - */ -typedef struct OpusMSEncoder OpusMSEncoder; - -/** Opus multistream decoder state. - * This contains the complete state of a multistream Opus decoder. - * It is position independent and can be freely copied. - * @see opus_multistream_decoder_create - * @see opus_multistream_decoder_init - */ -typedef struct OpusMSDecoder OpusMSDecoder; - -/**\name Multistream encoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSEncoder structure. - * @param streams <tt>int</tt>: The total number of streams to encode from the - * input. - * This must be no more than 255. - * @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (<code>streams + - * coupled_streams</code>) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( - int streams, - int coupled_streams -); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a multistream encoder state. - * Call opus_multistream_encoder_destroy() to release - * this object when finished. - * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels <tt>int</tt>: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (<code>streams + - * coupled_streams</code>). - * @param streams <tt>int</tt>: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (<code>streams + - * coupled_streams</code>) must be no - * more than the number of input channels. - * @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application <tt>int</tt>: The target encoder application. - * This must be one of the following: - * <dl> - * <dt>#OPUS_APPLICATION_VOIP</dt> - * <dd>Process signal for improved speech intelligibility.</dd> - * <dt>#OPUS_APPLICATION_AUDIO</dt> - * <dd>Favor faithfulness to the original input.</dd> - * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> - * <dd>Configure the minimum possible coding delay by disabling certain modes - * of operation.</dd> - * </dl> - * @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(5); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(5); - -/** Initialize a previously allocated multistream encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_get_size - * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to initialize. - * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels <tt>int</tt>: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (<code>streams + - * coupled_streams</code>). - * @param streams <tt>int</tt>: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (<code>streams + - * coupled_streams</code>) must be no - * more than the number of input channels. - * @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application <tt>int</tt>: The target encoder application. - * This must be one of the following: - * <dl> - * <dt>#OPUS_APPLICATION_VOIP</dt> - * <dd>Process signal for improved speech intelligibility.</dd> - * <dt>#OPUS_APPLICATION_AUDIO</dt> - * <dd>Favor faithfulness to the original input.</dd> - * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> - * <dd>Configure the minimum possible coding delay by disabling certain modes - * of operation.</dd> - * </dl> - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -OPUS_EXPORT int opus_multistream_surround_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -/** Encodes a multistream Opus frame. - * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. - * @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved - * samples. - * This must contain - * <code>frame_size*channels</code> - * samples. - * @param frame_size <tt>int</tt>: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data <tt>unsigned char*</tt>: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( - OpusMSEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes a multistream Opus frame from floating point input. - * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. - * @param[in] pcm <tt>const float*</tt>: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * <code>frame_size*channels</code> - * samples. - * @param frame_size <tt>int</tt>: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data <tt>unsigned char*</tt>: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( - OpusMSEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an <code>OpusMSEncoder</code> allocated by - * opus_multistream_encoder_create(). - * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); - -/** Perform a CTL function on a multistream Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/**@}*/ - -/**\name Multistream decoder functions */ -/**@{*/ - -/** Gets the size of an <code>OpusMSDecoder</code> structure. - * @param streams <tt>int</tt>: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams <tt>int</tt>: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (<code>streams + - * coupled_streams</code>) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( - int streams, - int coupled_streams -); - -/** Allocates and initializes a multistream decoder state. - * Call opus_multistream_decoder_destroy() to release - * this object when finished. - * @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels <tt>int</tt>: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (<code>streams + - * coupled_streams</code>). - * @param streams <tt>int</tt>: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (<code>streams + - * coupled_streams</code>) must be no - * more than 255. - * @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int *error -) OPUS_ARG_NONNULL(5); - -/** Intialize a previously allocated decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_decoder_create - * @see opus_multistream_deocder_get_size - * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to initialize. - * @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels <tt>int</tt>: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (<code>streams + - * coupled_streams</code>). - * @param streams <tt>int</tt>: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (<code>streams + - * coupled_streams</code>) must be no - * more than 255. - * @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_decoder_init( - OpusMSDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -/** Decode a multistream Opus packet. - * @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state. - * @param[in] data <tt>const unsigned char*</tt>: Input payload. - * Use a <code>NULL</code> - * pointer to indicate packet - * loss. - * @param len <tt>opus_int32</tt>: Number of bytes in payload. - * @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved - * samples. - * This must contain room for - * <code>frame_size*channels</code> - * samples. - * @param frame_size <tt>int</tt>: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * <b>must</b> be a multiple of 2.5 ms. - * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode a multistream Opus packet with floating point output. - * @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state. - * @param[in] data <tt>const unsigned char*</tt>: Input payload. - * Use a <code>NULL</code> - * pointer to indicate packet - * loss. - * @param len <tt>opus_int32</tt>: Number of bytes in payload. - * @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved - * samples. - * This must contain room for - * <code>frame_size*channels</code> - * samples. - * @param frame_size <tt>int</tt>: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * <b>must</b> be a multiple of 2.5 ms. - * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on a multistream Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an <code>OpusMSDecoder</code> allocated by - * opus_multistream_decoder_create(). - * @param st <tt>OpusMSDecoder</tt>: Multistream decoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_MULTISTREAM_H */ diff --git a/MacOSX/codecs/include/opus/opus_types.h b/MacOSX/codecs/include/opus/opus_types.h deleted file mode 100644 index b28e03ae..00000000 --- a/MacOSX/codecs/include/opus/opus_types.h +++ /dev/null @@ -1,159 +0,0 @@ -/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ -/* Modified by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* opus_types.h based on ogg_types.h from libogg */ - -/** - @file opus_types.h - @brief Opus reference implementation types -*/ -#ifndef OPUS_TYPES_H -#define OPUS_TYPES_H - -/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ -#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) -#include <stdint.h> - - typedef int16_t opus_int16; - typedef uint16_t opus_uint16; - typedef int32_t opus_int32; - typedef uint32_t opus_uint32; -#elif defined(_WIN32) - -# if defined(__CYGWIN__) -# include <_G_config.h> - typedef _G_int32_t opus_int32; - typedef _G_uint32_t opus_uint32; - typedef _G_int16 opus_int16; - typedef _G_uint16 opus_uint16; -# elif defined(__MINGW32__) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; -# elif defined(__MWERKS__) - typedef int opus_int32; - typedef unsigned int opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; -# else - /* MSVC/Borland */ - typedef __int32 opus_int32; - typedef unsigned __int32 opus_uint32; - typedef __int16 opus_int16; - typedef unsigned __int16 opus_uint16; -# endif - -#elif defined(__MACOS__) - -# include <sys/types.h> - typedef SInt16 opus_int16; - typedef UInt16 opus_uint16; - typedef SInt32 opus_int32; - typedef UInt32 opus_uint32; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include <sys/types.h> - typedef int16_t opus_int16; - typedef u_int16_t opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined(__BEOS__) - - /* Be */ -# include <inttypes.h> - typedef int16 opus_int16; - typedef u_int16 opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(R5900) - - /* PS2 EE */ - typedef int opus_int32; - typedef unsigned opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short opus_int16; - typedef unsigned short opus_uint16; - typedef signed int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef long opus_int32; - typedef unsigned long opus_uint32; - -#elif defined(CONFIG_TI_C6X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#else - - /* Give up, take a reasonable guess */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#endif - -#define opus_int int /* used for counters etc; at least 16 bits */ -#define opus_int64 long long -#define opus_int8 signed char - -#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ -#define opus_uint64 unsigned long long -#define opus_uint8 unsigned char - -#endif /* OPUS_TYPES_H */ diff --git a/MacOSX/codecs/include/opus/opusfile.h b/MacOSX/codecs/include/opus/opusfile.h deleted file mode 100644 index 220ac7f7..00000000 --- a/MacOSX/codecs/include/opus/opusfile.h +++ /dev/null @@ -1,2164 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * - * * - ******************************************************************** - - function: stdio-based convenience library for opening/seeking/decoding - last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $ - - ********************************************************************/ -#if !defined(_opusfile_h) -# define _opusfile_h (1) - -/**\mainpage - \section Introduction - - This is the documentation for the <tt>libopusfile</tt> C API. - - The <tt>libopusfile</tt> package provides a convenient high-level API for - decoding and basic manipulation of all Ogg Opus audio streams. - <tt>libopusfile</tt> is implemented as a layer on top of Xiph.Org's - reference - <tt><a href="https://www.xiph.org/ogg/doc/libogg/reference.html">libogg</a></tt> - and - <tt><a href="https://mf4.xiph.org/jenkins/view/opus/job/opus/ws/doc/html/index.html">libopus</a></tt> - libraries. - - <tt>libopusfile</tt> provides several sets of built-in routines for - file/stream access, and may also use custom stream I/O routines provided by - the embedded environment. - There are built-in I/O routines provided for ANSI-compliant - <code>stdio</code> (<code>FILE *</code>), memory buffers, and URLs - (including <file:> URLs, plus optionally <http:> and <https:> URLs). - - \section Organization - - The main API is divided into several sections: - - \ref stream_open_close - - \ref stream_info - - \ref stream_decoding - - \ref stream_seeking - - Several additional sections are not tied to the main API. - - \ref stream_callbacks - - \ref header_info - - \ref error_codes - - \section Overview - - The <tt>libopusfile</tt> API always decodes files to 48 kHz. - The original sample rate is not preserved by the lossy compression, though - it is stored in the header to allow you to resample to it after decoding - (the <tt>libopusfile</tt> API does not currently provide a resampler, - but the - <a href="http://www.speex.org/docs/manual/speex-manual/node7.html#SECTION00760000000000000000">the - Speex resampler</a> is a good choice if you need one). - In general, if you are playing back the audio, you should leave it at - 48 kHz, provided your audio hardware supports it. - When decoding to a file, it may be worth resampling back to the original - sample rate, so as not to surprise users who might not expect the sample - rate to change after encoding to Opus and decoding. - - Opus files can contain anywhere from 1 to 255 channels of audio. - The channel mappings for up to 8 channels are the same as the - <a href="http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9">Vorbis - mappings</a>. - A special stereo API can convert everything to 2 channels, making it simple - to support multichannel files in an application which only has stereo - output. - Although the <tt>libopusfile</tt> ABI provides support for the theoretical - maximum number of channels, the current implementation does not support - files with more than 8 channels, as they do not have well-defined channel - mappings. - - Like all Ogg files, Opus files may be "chained". - That is, multiple Opus files may be combined into a single, longer file just - by concatenating the original files. - This is commonly done in internet radio streaming, as it allows the title - and artist to be updated each time the song changes, since each link in the - chain includes its own set of metadata. - - <tt>libopusfile</tt> fully supports chained files. - It will decode the first Opus stream found in each link of a chained file - (ignoring any other streams that might be concurrently multiplexed with it, - such as a video stream). - - The channel count can also change between links. - If your application is not prepared to deal with this, it can use the stereo - API to ensure the audio from all links will always get decoded into a - common format. - Since <tt>libopusfile</tt> always decodes to 48 kHz, you do not have to - worry about the sample rate changing between links (as was possible with - Vorbis). - This makes application support for chained files with <tt>libopusfile</tt> - very easy.*/ - -# if defined(__cplusplus) -extern "C" { -# endif - -# include <stdarg.h> -# include <stdio.h> -# include <ogg/ogg.h> -# include <opus/opus_multistream.h> - -/**@cond PRIVATE*/ - -/*Enable special features for gcc and gcc-compatible compilers.*/ -# if !defined(OP_GNUC_PREREQ) -# if defined(__GNUC__)&&defined(__GNUC_MINOR__) -# define OP_GNUC_PREREQ(_maj,_min) \ - ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) -# else -# define OP_GNUC_PREREQ(_maj,_min) 0 -# endif -# endif - -# if OP_GNUC_PREREQ(4,0) -# pragma GCC visibility push(default) -# endif - -typedef struct OpusHead OpusHead; -typedef struct OpusTags OpusTags; -typedef struct OpusPictureTag OpusPictureTag; -typedef struct OpusServerInfo OpusServerInfo; -typedef struct OpusFileCallbacks OpusFileCallbacks; -typedef struct OggOpusFile OggOpusFile; - -/*Warning attributes for libopusfile functions.*/ -# if OP_GNUC_PREREQ(3,4) -# define OP_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) -# else -# define OP_WARN_UNUSED_RESULT -# endif -# if OP_GNUC_PREREQ(3,4) -# define OP_ARG_NONNULL(_x) __attribute__((__nonnull__(_x))) -# else -# define OP_ARG_NONNULL(_x) -# endif - -/**@endcond*/ - -/**\defgroup error_codes Error Codes*/ -/*@{*/ -/**\name List of possible error codes - Many of the functions in this library return a negative error code when a - function fails. - This list provides a brief explanation of the common errors. - See each individual function for more details on what a specific error code - means in that context.*/ -/*@{*/ - -/**A request did not succeed.*/ -#define OP_FALSE (-1) -/*Currently not used externally.*/ -#define OP_EOF (-2) -/**There was a hole in the page sequence numbers (e.g., a page was corrupt or - missing).*/ -#define OP_HOLE (-3) -/**An underlying read, seek, or tell operation failed when it should have - succeeded.*/ -#define OP_EREAD (-128) -/**A <code>NULL</code> pointer was passed where one was unexpected, or an - internal memory allocation failed, or an internal library error was - encountered.*/ -#define OP_EFAULT (-129) -/**The stream used a feature that is not implemented, such as an unsupported - channel family.*/ -#define OP_EIMPL (-130) -/**One or more parameters to a function were invalid.*/ -#define OP_EINVAL (-131) -/**A purported Ogg Opus stream did not begin with an Ogg page, a purported - header packet did not start with one of the required strings, "OpusHead" or - "OpusTags", or a link in a chained file was encountered that did not - contain any logical Opus streams.*/ -#define OP_ENOTFORMAT (-132) -/**A required header packet was not properly formatted, contained illegal - values, or was missing altogether.*/ -#define OP_EBADHEADER (-133) -/**The ID header contained an unrecognized version number.*/ -#define OP_EVERSION (-134) -/*Currently not used at all.*/ -#define OP_ENOTAUDIO (-135) -/**An audio packet failed to decode properly. - This is usually caused by a multistream Ogg packet where the durations of - the individual Opus packets contained in it are not all the same.*/ -#define OP_EBADPACKET (-136) -/**We failed to find data we had seen before, or the bitstream structure was - sufficiently malformed that seeking to the target destination was - impossible.*/ -#define OP_EBADLINK (-137) -/**An operation that requires seeking was requested on an unseekable stream.*/ -#define OP_ENOSEEK (-138) -/**The first or last granule position of a link failed basic validity checks.*/ -#define OP_EBADTIMESTAMP (-139) - -/*@}*/ -/*@}*/ - -/**\defgroup header_info Header Information*/ -/*@{*/ - -/**The maximum number of channels in an Ogg Opus stream.*/ -#define OPUS_CHANNEL_COUNT_MAX (255) - -/**Ogg Opus bitstream information. - This contains the basic playback parameters for a stream, and corresponds to - the initial ID header packet of an Ogg Opus stream.*/ -struct OpusHead{ - /**The Ogg Opus format version, in the range 0...255. - The top 4 bits represent a "major" version, and the bottom four bits - represent backwards-compatible "minor" revisions. - The current specification describes version 1. - This library will recognize versions up through 15 as backwards compatible - with the current specification. - An earlier draft of the specification described a version 0, but the only - difference between version 1 and version 0 is that version 0 did - not specify the semantics for handling the version field.*/ - int version; - /**The number of channels, in the range 1...255.*/ - int channel_count; - /**The number of samples that should be discarded from the beginning of the - stream.*/ - unsigned pre_skip; - /**The sampling rate of the original input. - All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz - for playback (unless the target hardware does not support this sampling - rate). - However, this field may be used to resample the audio back to the original - sampling rate, for example, when saving the output to a file.*/ - opus_uint32 input_sample_rate; - /**The gain to apply to the decoded output, in dB, as a Q8 value in the range - -32768...32767. - The <tt>libopusfile</tt> API will automatically apply this gain to the - decoded output before returning it, scaling it by - <code>pow(10,output_gain/(20.0*256))</code>. - You can adjust this behavior with op_set_gain_offset().*/ - int output_gain; - /**The channel mapping family, in the range 0...255. - Channel mapping family 0 covers mono or stereo in a single stream. - Channel mapping family 1 covers 1 to 8 channels in one or more streams, - using the Vorbis speaker assignments. - Channel mapping family 255 covers 1 to 255 channels in one or more - streams, but without any defined speaker assignment.*/ - int mapping_family; - /**The number of Opus streams in each Ogg packet, in the range 1...255.*/ - int stream_count; - /**The number of coupled Opus streams in each Ogg packet, in the range - 0...127. - This must satisfy <code>0 <= coupled_count <= stream_count</code> and - <code>coupled_count + stream_count <= 255</code>. - The coupled streams appear first, before all uncoupled streams, in an Ogg - Opus packet.*/ - int coupled_count; - /**The mapping from coded stream channels to output channels. - Let <code>index=mapping[k]</code> be the value for channel <code>k</code>. - If <code>index<2*coupled_count</code>, then it refers to the left channel - from stream <code>(index/2)</code> if even, and the right channel from - stream <code>(index/2)</code> if odd. - Otherwise, it refers to the output of the uncoupled stream - <code>(index-coupled_count)</code>.*/ - unsigned char mapping[OPUS_CHANNEL_COUNT_MAX]; -}; - -/**The metadata from an Ogg Opus stream. - - This structure holds the in-stream metadata corresponding to the 'comment' - header packet of an Ogg Opus stream. - The comment header is meant to be used much like someone jotting a quick - note on the label of a CD. - It should be a short, to the point text note that can be more than a couple - words, but not more than a short paragraph. - - The metadata is stored as a series of (tag, value) pairs, in length-encoded - string vectors, using the same format as Vorbis (without the final "framing - bit"), Theora, and Speex, except for the packet header. - The first occurrence of the '=' character delimits the tag and value. - A particular tag may occur more than once, and order is significant. - The character set encoding for the strings is always UTF-8, but the tag - names are limited to ASCII, and treated as case-insensitive. - See <a href="http://www.xiph.org/vorbis/doc/v-comment.html">the Vorbis - comment header specification</a> for details. - - In filling in this structure, <tt>libopusfile</tt> will null-terminate the - #user_comments strings for safety. - However, the bitstream format itself treats them as 8-bit clean vectors, - possibly containing NUL characters, so the #comment_lengths array should be - treated as their authoritative length. - - This structure is binary and source-compatible with a - <code>vorbis_comment</code>, and pointers to it may be freely cast to - <code>vorbis_comment</code> pointers, and vice versa. - It is provided as a separate type to avoid introducing a compile-time - dependency on the libvorbis headers.*/ -struct OpusTags{ - /**The array of comment string vectors.*/ - char **user_comments; - /**An array of the corresponding length of each vector, in bytes.*/ - int *comment_lengths; - /**The total number of comment streams.*/ - int comments; - /**The null-terminated vendor string. - This identifies the software used to encode the stream.*/ - char *vendor; -}; - -/**\name Picture tag image formats*/ -/*@{*/ - -/**The MIME type was not recognized, or the image data did not match the - declared MIME type.*/ -#define OP_PIC_FORMAT_UNKNOWN (-1) -/**The MIME type indicates the image data is really a URL.*/ -#define OP_PIC_FORMAT_URL (0) -/**The image is a JPEG.*/ -#define OP_PIC_FORMAT_JPEG (1) -/**The image is a PNG.*/ -#define OP_PIC_FORMAT_PNG (2) -/**The image is a GIF.*/ -#define OP_PIC_FORMAT_GIF (3) - -/*@}*/ - -/**The contents of a METADATA_BLOCK_PICTURE tag.*/ -struct OpusPictureTag{ - /**The picture type according to the ID3v2 APIC frame: - <ol start="0"> - <li>Other</li> - <li>32x32 pixels 'file icon' (PNG only)</li> - <li>Other file icon</li> - <li>Cover (front)</li> - <li>Cover (back)</li> - <li>Leaflet page</li> - <li>Media (e.g. label side of CD)</li> - <li>Lead artist/lead performer/soloist</li> - <li>Artist/performer</li> - <li>Conductor</li> - <li>Band/Orchestra</li> - <li>Composer</li> - <li>Lyricist/text writer</li> - <li>Recording Location</li> - <li>During recording</li> - <li>During performance</li> - <li>Movie/video screen capture</li> - <li>A bright colored fish</li> - <li>Illustration</li> - <li>Band/artist logotype</li> - <li>Publisher/Studio logotype</li> - </ol> - Others are reserved and should not be used. - There may only be one each of picture type 1 and 2 in a file.*/ - opus_int32 type; - /**The MIME type of the picture, in printable ASCII characters 0x20-0x7E. - The MIME type may also be <code>"-->"</code> to signify that the data part - is a URL pointing to the picture instead of the picture data itself. - In this case, a terminating NUL is appended to the URL string in #data, - but #data_length is set to the length of the string excluding that - terminating NUL.*/ - char *mime_type; - /**The description of the picture, in UTF-8.*/ - char *description; - /**The width of the picture in pixels.*/ - opus_uint32 width; - /**The height of the picture in pixels.*/ - opus_uint32 height; - /**The color depth of the picture in bits-per-pixel (<em>not</em> - bits-per-channel).*/ - opus_uint32 depth; - /**For indexed-color pictures (e.g., GIF), the number of colors used, or 0 - for non-indexed pictures.*/ - opus_uint32 colors; - /**The length of the picture data in bytes.*/ - opus_uint32 data_length; - /**The binary picture data.*/ - unsigned char *data; - /**The format of the picture data, if known. - One of - <ul> - <li>#OP_PIC_FORMAT_UNKNOWN,</li> - <li>#OP_PIC_FORMAT_URL,</li> - <li>#OP_PIC_FORMAT_JPEG,</li> - <li>#OP_PIC_FORMAT_PNG, or</li> - <li>#OP_PIC_FORMAT_GIF.</li> - </ul>*/ - int format; -}; - -/**\name Functions for manipulating header data - - These functions manipulate the #OpusHead and #OpusTags structures, - which describe the audio parameters and tag-value metadata, respectively. - These can be used to query the headers returned by <tt>libopusfile</tt>, or - to parse Opus headers from sources other than an Ogg Opus stream, provided - they use the same format.*/ -/*@{*/ - -/**Parses the contents of the ID header packet of an Ogg Opus stream. - \param[out] _head Returns the contents of the parsed packet. - The contents of this structure are untouched on error. - This may be <code>NULL</code> to merely test the header - for validity. - \param[in] _data The contents of the ID header packet. - \param _len The number of bytes of data in the ID header packet. - \return 0 on success or a negative value on error. - \retval #OP_ENOTFORMAT If the data does not start with the "OpusHead" - string. - \retval #OP_EVERSION If the version field signaled a version this library - does not know how to parse. - \retval #OP_EIMPL If the channel mapping family was 255, which general - purpose players should not attempt to play. - \retval #OP_EBADHEADER If the contents of the packet otherwise violate the - Ogg Opus specification: - <ul> - <li>Insufficient data,</li> - <li>Too much data for the known minor versions,</li> - <li>An unrecognized channel mapping family,</li> - <li>Zero channels or too many channels,</li> - <li>Zero coded streams,</li> - <li>Too many coupled streams, or</li> - <li>An invalid channel mapping index.</li> - </ul>*/ -OP_WARN_UNUSED_RESULT int opus_head_parse(OpusHead *_head, - const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); - -/**Converts a granule position to a sample offset for a given Ogg Opus stream. - The sample offset is simply <code>_gp-_head->pre_skip</code>. - Granule position values smaller than OpusHead#pre_skip correspond to audio - that should never be played, and thus have no associated sample offset. - This function returns -1 for such values. - This function also correctly handles extremely large granule positions, - which may have wrapped around to a negative number when stored in a signed - ogg_int64_t value. - \param _head The #OpusHead information from the ID header of the stream. - \param _gp The granule position to convert. - \return The sample offset associated with the given granule position - (counting at a 48 kHz sampling rate), or the special value -1 on - error (i.e., the granule position was smaller than the pre-skip - amount).*/ -ogg_int64_t opus_granule_sample(const OpusHead *_head,ogg_int64_t _gp) - OP_ARG_NONNULL(1); - -/**Parses the contents of the 'comment' header packet of an Ogg Opus stream. - \param[out] _tags An uninitialized #OpusTags structure. - This returns the contents of the parsed packet. - The contents of this structure are untouched on error. - This may be <code>NULL</code> to merely test the header - for validity. - \param[in] _data The contents of the 'comment' header packet. - \param _len The number of bytes of data in the 'info' header packet. - \retval 0 Success. - \retval #OP_ENOTFORMAT If the data does not start with the "OpusTags" - string. - \retval #OP_EBADHEADER If the contents of the packet otherwise violate the - Ogg Opus specification. - \retval #OP_EFAULT If there wasn't enough memory to store the tags.*/ -OP_WARN_UNUSED_RESULT int opus_tags_parse(OpusTags *_tags, - const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); - -/**Performs a deep copy of an #OpusTags structure. - \param _dst The #OpusTags structure to copy into. - If this function fails, the contents of this structure remain - untouched. - \param _src The #OpusTags structure to copy from. - \retval 0 Success. - \retval #OP_EFAULT If there wasn't enough memory to copy the tags.*/ -int opus_tags_copy(OpusTags *_dst,const OpusTags *_src) OP_ARG_NONNULL(1); - -/**Initializes an #OpusTags structure. - This should be called on a freshly allocated #OpusTags structure before - attempting to use it. - \param _tags The #OpusTags structure to initialize.*/ -void opus_tags_init(OpusTags *_tags) OP_ARG_NONNULL(1); - -/**Add a (tag, value) pair to an initialized #OpusTags structure. - \note Neither opus_tags_add() nor opus_tags_add_comment() support values - containing embedded NULs, although the bitstream format does support them. - To add such tags, you will need to manipulate the #OpusTags structure - directly. - \param _tags The #OpusTags structure to add the (tag, value) pair to. - \param _tag A NUL-terminated, case-insensitive, ASCII string containing - the tag to add (without an '=' character). - \param _value A NUL-terminated UTF-8 containing the corresponding value. - \return 0 on success, or a negative value on failure. - \retval #OP_EFAULT An internal memory allocation failed.*/ -int opus_tags_add(OpusTags *_tags,const char *_tag,const char *_value) - OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) OP_ARG_NONNULL(3); - -/**Add a comment to an initialized #OpusTags structure. - \note Neither opus_tags_add_comment() nor opus_tags_add() support comments - containing embedded NULs, although the bitstream format does support them. - To add such tags, you will need to manipulate the #OpusTags structure - directly. - \param _tags The #OpusTags structure to add the comment to. - \param _comment A NUL-terminated UTF-8 string containing the comment in - "TAG=value" form. - \return 0 on success, or a negative value on failure. - \retval #OP_EFAULT An internal memory allocation failed.*/ -int opus_tags_add_comment(OpusTags *_tags,const char *_comment) - OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Replace the binary suffix data at the end of the packet (if any). - \param _tags An initialized #OpusTags structure. - \param _data A buffer of binary data to append after the encoded user - comments. - The least significant bit of the first byte of this data must - be set (to ensure the data is preserved by other editors). - \param _len The number of bytes of binary data to append. - This may be zero to remove any existing binary suffix data. - \return 0 on success, or a negative value on error. - \retval #OP_EINVAL \a _len was negative, or \a _len was positive but - \a _data was <code>NULL</code> or the least significant - bit of the first byte was not set. - \retval #OP_EFAULT An internal memory allocation failed.*/ -int opus_tags_set_binary_suffix(OpusTags *_tags, - const unsigned char *_data,int _len) OP_ARG_NONNULL(1); - -/**Look up a comment value by its tag. - \param _tags An initialized #OpusTags structure. - \param _tag The tag to look up. - \param _count The instance of the tag. - The same tag can appear multiple times, each with a distinct - value, so an index is required to retrieve them all. - The order in which these values appear is significant and - should be preserved. - Use opus_tags_query_count() to get the legal range for the - \a _count parameter. - \return A pointer to the queried tag's value. - This points directly to data in the #OpusTags structure. - It should not be modified or freed by the application, and - modifications to the structure may invalidate the pointer. - \retval NULL If no matching tag is found.*/ -const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count) - OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Look up the number of instances of a tag. - Call this first when querying for a specific tag and then iterate over the - number of instances with separate calls to opus_tags_query() to retrieve - all the values for that tag in order. - \param _tags An initialized #OpusTags structure. - \param _tag The tag to look up. - \return The number of instances of this particular tag.*/ -int opus_tags_query_count(const OpusTags *_tags,const char *_tag) - OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Retrieve the binary suffix data at the end of the packet (if any). - \param _tags An initialized #OpusTags structure. - \param[out] _len Returns the number of bytes of binary suffix data returned. - \return A pointer to the binary suffix data, or <code>NULL</code> if none - was present.*/ -const unsigned char *opus_tags_get_binary_suffix(const OpusTags *_tags, - int *_len) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Get the album gain from an R128_ALBUM_GAIN tag, if one was specified. - This searches for the first R128_ALBUM_GAIN tag with a valid signed, - 16-bit decimal integer value and returns the value. - This routine is exposed merely for convenience for applications which wish - to do something special with the album gain (i.e., display it). - If you simply wish to apply the album gain instead of the header gain, you - can use op_set_gain_offset() with an #OP_ALBUM_GAIN type and no offset. - \param _tags An initialized #OpusTags structure. - \param[out] _gain_q8 The album gain, in 1/256ths of a dB. - This will lie in the range [-32768,32767], and should - be applied in <em>addition</em> to the header gain. - On error, no value is returned, and the previous - contents remain unchanged. - \return 0 on success, or a negative value on error. - \retval #OP_FALSE There was no album gain available in the given tags.*/ -int opus_tags_get_album_gain(const OpusTags *_tags,int *_gain_q8) - OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Get the track gain from an R128_TRACK_GAIN tag, if one was specified. - This searches for the first R128_TRACK_GAIN tag with a valid signed, - 16-bit decimal integer value and returns the value. - This routine is exposed merely for convenience for applications which wish - to do something special with the track gain (i.e., display it). - If you simply wish to apply the track gain instead of the header gain, you - can use op_set_gain_offset() with an #OP_TRACK_GAIN type and no offset. - \param _tags An initialized #OpusTags structure. - \param[out] _gain_q8 The track gain, in 1/256ths of a dB. - This will lie in the range [-32768,32767], and should - be applied in <em>addition</em> to the header gain. - On error, no value is returned, and the previous - contents remain unchanged. - \return 0 on success, or a negative value on error. - \retval #OP_FALSE There was no track gain available in the given tags.*/ -int opus_tags_get_track_gain(const OpusTags *_tags,int *_gain_q8) - OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Clears the #OpusTags structure. - This should be called on an #OpusTags structure after it is no longer - needed. - It will free all memory used by the structure members. - \param _tags The #OpusTags structure to clear.*/ -void opus_tags_clear(OpusTags *_tags) OP_ARG_NONNULL(1); - -/**Check if \a _comment is an instance of a \a _tag_name tag. - \see opus_tagncompare - \param _tag_name A NUL-terminated, case-insensitive, ASCII string containing - the name of the tag to check for (without the terminating - '=' character). - \param _comment The comment string to check. - \return An integer less than, equal to, or greater than zero if \a _comment - is found respectively, to be less than, to match, or be greater - than a "tag=value" string whose tag matches \a _tag_name.*/ -int opus_tagcompare(const char *_tag_name,const char *_comment); - -/**Check if \a _comment is an instance of a \a _tag_name tag. - This version is slightly more efficient than opus_tagcompare() if the length - of the tag name is already known (e.g., because it is a constant). - \see opus_tagcompare - \param _tag_name A case-insensitive ASCII string containing the name of the - tag to check for (without the terminating '=' character). - \param _tag_len The number of characters in the tag name. - This must be non-negative. - \param _comment The comment string to check. - \return An integer less than, equal to, or greater than zero if \a _comment - is found respectively, to be less than, to match, or be greater - than a "tag=value" string whose tag matches the first \a _tag_len - characters of \a _tag_name.*/ -int opus_tagncompare(const char *_tag_name,int _tag_len,const char *_comment); - -/**Parse a single METADATA_BLOCK_PICTURE tag. - This decodes the BASE64-encoded content of the tag and returns a structure - with the MIME type, description, image parameters (if known), and the - compressed image data. - If the MIME type indicates the presence of an image format we recognize - (JPEG, PNG, or GIF) and the actual image data contains the magic signature - associated with that format, then the OpusPictureTag::format field will be - set to the corresponding format. - This is provided as a convenience to avoid requiring applications to parse - the MIME type and/or do their own format detection for the commonly used - formats. - In this case, we also attempt to extract the image parameters directly from - the image data (overriding any that were present in the tag, which the - specification says applications are not meant to rely on). - The application must still provide its own support for actually decoding the - image data and, if applicable, retrieving that data from URLs. - \param[out] _pic Returns the parsed picture data. - No sanitation is done on the type, MIME type, or - description fields, so these might return invalid values. - The contents of this structure are left unmodified on - failure. - \param _tag The METADATA_BLOCK_PICTURE tag contents. - The leading "METADATA_BLOCK_PICTURE=" portion is optional, - to allow the function to be used on either directly on the - values in OpusTags::user_comments or on the return value - of opus_tags_query(). - \return 0 on success or a negative value on error. - \retval #OP_ENOTFORMAT The METADATA_BLOCK_PICTURE contents were not valid. - \retval #OP_EFAULT There was not enough memory to store the picture tag - contents.*/ -OP_WARN_UNUSED_RESULT int opus_picture_tag_parse(OpusPictureTag *_pic, - const char *_tag) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Initializes an #OpusPictureTag structure. - This should be called on a freshly allocated #OpusPictureTag structure - before attempting to use it. - \param _pic The #OpusPictureTag structure to initialize.*/ -void opus_picture_tag_init(OpusPictureTag *_pic) OP_ARG_NONNULL(1); - -/**Clears the #OpusPictureTag structure. - This should be called on an #OpusPictureTag structure after it is no longer - needed. - It will free all memory used by the structure members. - \param _pic The #OpusPictureTag structure to clear.*/ -void opus_picture_tag_clear(OpusPictureTag *_pic) OP_ARG_NONNULL(1); - -/*@}*/ - -/*@}*/ - -/**\defgroup url_options URL Reading Options*/ -/*@{*/ -/**\name URL reading options - Options for op_url_stream_create() and associated functions. - These allow you to provide proxy configuration parameters, skip SSL - certificate checks, etc. - Options are processed in order, and if the same option is passed multiple - times, only the value specified by the last occurrence has an effect - (unless otherwise specified). - They may be expanded in the future.*/ -/*@{*/ - -/**@cond PRIVATE*/ - -/*These are the raw numbers used to define the request codes. - They should not be used directly.*/ -#define OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST (6464) -#define OP_HTTP_PROXY_HOST_REQUEST (6528) -#define OP_HTTP_PROXY_PORT_REQUEST (6592) -#define OP_HTTP_PROXY_USER_REQUEST (6656) -#define OP_HTTP_PROXY_PASS_REQUEST (6720) -#define OP_GET_SERVER_INFO_REQUEST (6784) - -#define OP_URL_OPT(_request) ((_request)+(char *)0) - -/*These macros trigger compilation errors or warnings if the wrong types are - provided to one of the URL options.*/ -#define OP_CHECK_INT(_x) ((void)((_x)==(opus_int32)0),(opus_int32)(_x)) -#define OP_CHECK_CONST_CHAR_PTR(_x) ((_x)+((_x)-(const char *)(_x))) -#define OP_CHECK_SERVER_INFO_PTR(_x) ((_x)+((_x)-(OpusServerInfo *)(_x))) - -/**@endcond*/ - -/**HTTP/Shoutcast/Icecast server information associated with a URL.*/ -struct OpusServerInfo{ - /**The name of the server (icy-name/ice-name). - This is <code>NULL</code> if there was no <code>icy-name</code> or - <code>ice-name</code> header.*/ - char *name; - /**A short description of the server (icy-description/ice-description). - This is <code>NULL</code> if there was no <code>icy-description</code> or - <code>ice-description</code> header.*/ - char *description; - /**The genre the server falls under (icy-genre/ice-genre). - This is <code>NULL</code> if there was no <code>icy-genre</code> or - <code>ice-genre</code> header.*/ - char *genre; - /**The homepage for the server (icy-url/ice-url). - This is <code>NULL</code> if there was no <code>icy-url</code> or - <code>ice-url</code> header.*/ - char *url; - /**The software used by the origin server (Server). - This is <code>NULL</code> if there was no <code>Server</code> header.*/ - char *server; - /**The media type of the entity sent to the recepient (Content-Type). - This is <code>NULL</code> if there was no <code>Content-Type</code> - header.*/ - char *content_type; - /**The nominal stream bitrate in kbps (icy-br/ice-bitrate). - This is <code>-1</code> if there was no <code>icy-br</code> or - <code>ice-bitrate</code> header.*/ - opus_int32 bitrate_kbps; - /**Flag indicating whether the server is public (<code>1</code>) or not - (<code>0</code>) (icy-pub/ice-public). - This is <code>-1</code> if there was no <code>icy-pub</code> or - <code>ice-public</code> header.*/ - int is_public; - /**Flag indicating whether the server is using HTTPS instead of HTTP. - This is <code>0</code> unless HTTPS is being used. - This may not match the protocol used in the original URL if there were - redirections.*/ - int is_ssl; -}; - -/**Initializes an #OpusServerInfo structure. - All fields are set as if the corresponding header was not available. - \param _info The #OpusServerInfo structure to initialize. - \note If you use this function, you must link against <tt>libopusurl</tt>.*/ -void opus_server_info_init(OpusServerInfo *_info) OP_ARG_NONNULL(1); - -/**Clears the #OpusServerInfo structure. - This should be called on an #OpusServerInfo structure after it is no longer - needed. - It will free all memory used by the structure members. - \param _info The #OpusServerInfo structure to clear. - \note If you use this function, you must link against <tt>libopusurl</tt>.*/ -void opus_server_info_clear(OpusServerInfo *_info) OP_ARG_NONNULL(1); - -/**Skip the certificate check when connecting via TLS/SSL (https). - \param _b <code>opus_int32</code>: Whether or not to skip the certificate - check. - The check will be skipped if \a _b is non-zero, and will not be - skipped if \a _b is zero. - \hideinitializer*/ -#define OP_SSL_SKIP_CERTIFICATE_CHECK(_b) \ - OP_URL_OPT(OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST),OP_CHECK_INT(_b) - -/**Proxy connections through the given host. - If no port is specified via #OP_HTTP_PROXY_PORT, the port number defaults - to 8080 (http-alt). - All proxy parameters are ignored for non-http and non-https URLs. - \param _host <code>const char *</code>: The proxy server hostname. - This may be <code>NULL</code> to disable the use of a proxy - server. - \hideinitializer*/ -#define OP_HTTP_PROXY_HOST(_host) \ - OP_URL_OPT(OP_HTTP_PROXY_HOST_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) - -/**Use the given port when proxying connections. - This option only has an effect if #OP_HTTP_PROXY_HOST is specified with a - non-<code>NULL</code> \a _host. - If this option is not provided, the proxy port number defaults to 8080 - (http-alt). - All proxy parameters are ignored for non-http and non-https URLs. - \param _port <code>opus_int32</code>: The proxy server port. - This must be in the range 0...65535 (inclusive), or the - URL function this is passed to will fail. - \hideinitializer*/ -#define OP_HTTP_PROXY_PORT(_port) \ - OP_URL_OPT(OP_HTTP_PROXY_PORT_REQUEST),OP_CHECK_INT(_port) - -/**Use the given user name for authentication when proxying connections. - All proxy parameters are ignored for non-http and non-https URLs. - \param _user const char *: The proxy server user name. - This may be <code>NULL</code> to disable proxy - authentication. - A non-<code>NULL</code> value only has an effect - if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_PASS - are also specified with non-<code>NULL</code> - arguments. - \hideinitializer*/ -#define OP_HTTP_PROXY_USER(_user) \ - OP_URL_OPT(OP_HTTP_PROXY_USER_REQUEST),OP_CHECK_CONST_CHAR_PTR(_user) - -/**Use the given password for authentication when proxying connections. - All proxy parameters are ignored for non-http and non-https URLs. - \param _pass const char *: The proxy server password. - This may be <code>NULL</code> to disable proxy - authentication. - A non-<code>NULL</code> value only has an effect - if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_USER - are also specified with non-<code>NULL</code> - arguments. - \hideinitializer*/ -#define OP_HTTP_PROXY_PASS(_pass) \ - OP_URL_OPT(OP_HTTP_PROXY_PASS_REQUEST),OP_CHECK_CONST_CHAR_PTR(_pass) - -/**Parse information about the streaming server (if any) and return it. - Very little validation is done. - In particular, OpusServerInfo::url may not be a valid URL, - OpusServerInfo::bitrate_kbps may not really be in kbps, and - OpusServerInfo::content_type may not be a valid MIME type. - The character set of the string fields is not specified anywhere, and should - not be assumed to be valid UTF-8. - \param _info OpusServerInfo *: Returns information about the server. - If there is any error opening the stream, the - contents of this structure remain - unmodified. - On success, fills in the structure with the - server information that was available, if - any. - After a successful return, the contents of - this structure should be freed by calling - opus_server_info_clear(). - \hideinitializer*/ -#define OP_GET_SERVER_INFO(_info) \ - OP_URL_OPT(OP_GET_SERVER_INFO_REQUEST),OP_CHECK_SERVER_INFO_PTR(_info) - -/*@}*/ -/*@}*/ - -/**\defgroup stream_callbacks Abstract Stream Reading Interface*/ -/*@{*/ -/**\name Functions for reading from streams - These functions define the interface used to read from and seek in a stream - of data. - A stream does not need to implement seeking, but the decoder will not be - able to seek if it does not do so. - These functions also include some convenience routines for working with - standard <code>FILE</code> pointers, complete streams stored in a single - block of memory, or URLs.*/ -/*@{*/ - -/**Reads up to \a _nbytes bytes of data from \a _stream. - \param _stream The stream to read from. - \param[out] _ptr The buffer to store the data in. - \param _nbytes The maximum number of bytes to read. - This function may return fewer, though it will not - return zero unless it reaches end-of-file. - \return The number of bytes successfully read, or a negative value on - error.*/ -typedef int (*op_read_func)(void *_stream,unsigned char *_ptr,int _nbytes); - -/**Sets the position indicator for \a _stream. - The new position, measured in bytes, is obtained by adding \a _offset - bytes to the position specified by \a _whence. - If \a _whence is set to <code>SEEK_SET</code>, <code>SEEK_CUR</code>, or - <code>SEEK_END</code>, the offset is relative to the start of the stream, - the current position indicator, or end-of-file, respectively. - \retval 0 Success. - \retval -1 Seeking is not supported or an error occurred. - <code>errno</code> need not be set.*/ -typedef int (*op_seek_func)(void *_stream,opus_int64 _offset,int _whence); - -/**Obtains the current value of the position indicator for \a _stream. - \return The current position indicator.*/ -typedef opus_int64 (*op_tell_func)(void *_stream); - -/**Closes the underlying stream. - \retval 0 Success. - \retval EOF An error occurred. - <code>errno</code> need not be set.*/ -typedef int (*op_close_func)(void *_stream); - -/**The callbacks used to access non-<code>FILE</code> stream resources. - The function prototypes are basically the same as for the stdio functions - <code>fread()</code>, <code>fseek()</code>, <code>ftell()</code>, and - <code>fclose()</code>. - The differences are that the <code>FILE *</code> arguments have been - replaced with a <code>void *</code>, which is to be used as a pointer to - whatever internal data these functions might need, that #seek and #tell - take and return 64-bit offsets, and that #seek <em>must</em> return -1 if - the stream is unseekable.*/ -struct OpusFileCallbacks{ - /**Used to read data from the stream. - This must not be <code>NULL</code>.*/ - op_read_func read; - /**Used to seek in the stream. - This may be <code>NULL</code> if seeking is not implemented.*/ - op_seek_func seek; - /**Used to return the current read position in the stream. - This may be <code>NULL</code> if seeking is not implemented.*/ - op_tell_func tell; - /**Used to close the stream when the decoder is freed. - This may be <code>NULL</code> to leave the stream open.*/ - op_close_func close; -}; - -/**Opens a stream with <code>fopen()</code> and fills in a set of callbacks - that can be used to access it. - This is useful to avoid writing your own portable 64-bit seeking wrappers, - and also avoids cross-module linking issues on Windows, where a - <code>FILE *</code> must be accessed by routines defined in the same module - that opened it. - \param[out] _cb The callbacks to use for this file. - If there is an error opening the file, nothing will be - filled in here. - \param _path The path to the file to open. - On Windows, this string must be UTF-8 (to allow access to - files whose names cannot be represented in the current - MBCS code page). - All other systems use the native character encoding. - \param _mode The mode to open the file in. - \return A stream handle to use with the callbacks, or <code>NULL</code> on - error.*/ -OP_WARN_UNUSED_RESULT void *op_fopen(OpusFileCallbacks *_cb, - const char *_path,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) - OP_ARG_NONNULL(3); - -/**Opens a stream with <code>fdopen()</code> and fills in a set of callbacks - that can be used to access it. - This is useful to avoid writing your own portable 64-bit seeking wrappers, - and also avoids cross-module linking issues on Windows, where a - <code>FILE *</code> must be accessed by routines defined in the same module - that opened it. - \param[out] _cb The callbacks to use for this file. - If there is an error opening the file, nothing will be - filled in here. - \param _fd The file descriptor to open. - \param _mode The mode to open the file in. - \return A stream handle to use with the callbacks, or <code>NULL</code> on - error.*/ -OP_WARN_UNUSED_RESULT void *op_fdopen(OpusFileCallbacks *_cb, - int _fd,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(3); - -/**Opens a stream with <code>freopen()</code> and fills in a set of callbacks - that can be used to access it. - This is useful to avoid writing your own portable 64-bit seeking wrappers, - and also avoids cross-module linking issues on Windows, where a - <code>FILE *</code> must be accessed by routines defined in the same module - that opened it. - \param[out] _cb The callbacks to use for this file. - If there is an error opening the file, nothing will be - filled in here. - \param _path The path to the file to open. - On Windows, this string must be UTF-8 (to allow access - to files whose names cannot be represented in the - current MBCS code page). - All other systems use the native character encoding. - \param _mode The mode to open the file in. - \param _stream A stream previously returned by op_fopen(), op_fdopen(), - or op_freopen(). - \return A stream handle to use with the callbacks, or <code>NULL</code> on - error.*/ -OP_WARN_UNUSED_RESULT void *op_freopen(OpusFileCallbacks *_cb, - const char *_path,const char *_mode,void *_stream) OP_ARG_NONNULL(1) - OP_ARG_NONNULL(2) OP_ARG_NONNULL(3) OP_ARG_NONNULL(4); - -/**Creates a stream that reads from the given block of memory. - This block of memory must contain the complete stream to decode. - This is useful for caching small streams (e.g., sound effects) in RAM. - \param[out] _cb The callbacks to use for this stream. - If there is an error creating the stream, nothing will be - filled in here. - \param _data The block of memory to read from. - \param _size The size of the block of memory. - \return A stream handle to use with the callbacks, or <code>NULL</code> on - error.*/ -OP_WARN_UNUSED_RESULT void *op_mem_stream_create(OpusFileCallbacks *_cb, - const unsigned char *_data,size_t _size) OP_ARG_NONNULL(1); - -/**Creates a stream that reads from the given URL. - This function behaves identically to op_url_stream_create(), except that it - takes a va_list instead of a variable number of arguments. - It does not call the <code>va_end</code> macro, and because it invokes the - <code>va_arg</code> macro, the value of \a _ap is undefined after the call. - \note If you use this function, you must link against <tt>libopusurl</tt>. - \param[out] _cb The callbacks to use for this stream. - If there is an error creating the stream, nothing will - be filled in here. - \param _url The URL to read from. - Currently only the <file:>, <http:>, and <https:> - schemes are supported. - Both <http:> and <https:> may be disabled at compile - time, in which case opening such URLs will always fail. - Currently this only supports URIs. - IRIs should be converted to UTF-8 and URL-escaped, with - internationalized domain names encoded in punycode, - before passing them to this function. - \param[in,out] _ap A list of the \ref url_options "optional flags" to use. - This is a variable-length list of options terminated - with <code>NULL</code>. - \return A stream handle to use with the callbacks, or <code>NULL</code> on - error.*/ -OP_WARN_UNUSED_RESULT void *op_url_stream_vcreate(OpusFileCallbacks *_cb, - const char *_url,va_list _ap) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/**Creates a stream that reads from the given URL. - \note If you use this function, you must link against <tt>libopusurl</tt>. - \param[out] _cb The callbacks to use for this stream. - If there is an error creating the stream, nothing will be - filled in here. - \param _url The URL to read from. - Currently only the <file:>, <http:>, and <https:> schemes - are supported. - Both <http:> and <https:> may be disabled at compile time, - in which case opening such URLs will always fail. - Currently this only supports URIs. - IRIs should be converted to UTF-8 and URL-escaped, with - internationalized domain names encoded in punycode, before - passing them to this function. - \param ... The \ref url_options "optional flags" to use. - This is a variable-length list of options terminated with - <code>NULL</code>. - \return A stream handle to use with the callbacks, or <code>NULL</code> on - error.*/ -OP_WARN_UNUSED_RESULT void *op_url_stream_create(OpusFileCallbacks *_cb, - const char *_url,...) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); - -/*@}*/ -/*@}*/ - -/**\defgroup stream_open_close Opening and Closing*/ -/*@{*/ -/**\name Functions for opening and closing streams - - These functions allow you to test a stream to see if it is Opus, open it, - and close it. - Several flavors are provided for each of the built-in stream types, plus a - more general version which takes a set of application-provided callbacks.*/ -/*@{*/ - -/**Test to see if this is an Opus stream. - For good results, you will need at least 57 bytes (for a pure Opus-only - stream). - Something like 512 bytes will give more reliable results for multiplexed - streams. - This function is meant to be a quick-rejection filter. - Its purpose is not to guarantee that a stream is a valid Opus stream, but to - ensure that it looks enough like Opus that it isn't going to be recognized - as some other format (except possibly an Opus stream that is also - multiplexed with other codecs, such as video). - \param[out] _head The parsed ID header contents. - You may pass <code>NULL</code> if you do not need - this information. - If the function fails, the contents of this structure - remain untouched. - \param _initial_data An initial buffer of data from the start of the - stream. - \param _initial_bytes The number of bytes in \a _initial_data. - \return 0 if the data appears to be Opus, or a negative value on error. - \retval #OP_FALSE There was not enough data to tell if this was an Opus - stream or not. - \retval #OP_EFAULT An internal memory allocation failed. - \retval #OP_EIMPL The stream used a feature that is not implemented, - such as an unsupported channel family. - \retval #OP_ENOTFORMAT If the data did not contain a recognizable ID - header for an Opus stream. - \retval #OP_EVERSION If the version field signaled a version this library - does not know how to parse. - \retval #OP_EBADHEADER The ID header was not properly formatted or contained - illegal values.*/ -int op_test(OpusHead *_head, - const unsigned char *_initial_data,size_t _initial_bytes); - -/**Open a stream from the given file path. - \param _path The path to the file to open. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want the - failure code. - The failure code will be #OP_EFAULT if the file could not - be opened, or one of the other failure codes from - op_open_callbacks() otherwise. - \return A freshly opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_open_file(const char *_path,int *_error) - OP_ARG_NONNULL(1); - -/**Open a stream from a memory buffer. - \param _data The memory buffer to open. - \param _size The number of bytes in the buffer. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want the - failure code. - See op_open_callbacks() for a full list of failure codes. - \return A freshly opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_open_memory(const unsigned char *_data, - size_t _size,int *_error); - -/**Open a stream from a URL. - This function behaves identically to op_open_url(), except that it - takes a va_list instead of a variable number of arguments. - It does not call the <code>va_end</code> macro, and because it invokes the - <code>va_arg</code> macro, the value of \a _ap is undefined after the call. - \note If you use this function, you must link against <tt>libopusurl</tt>. - \param _url The URL to open. - Currently only the <file:>, <http:>, and <https:> - schemes are supported. - Both <http:> and <https:> may be disabled at compile - time, in which case opening such URLs will always - fail. - Currently this only supports URIs. - IRIs should be converted to UTF-8 and URL-escaped, - with internationalized domain names encoded in - punycode, before passing them to this function. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want - the failure code. - See op_open_callbacks() for a full list of failure - codes. - \param[in,out] _ap A list of the \ref url_options "optional flags" to - use. - This is a variable-length list of options terminated - with <code>NULL</code>. - \return A freshly opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_vopen_url(const char *_url, - int *_error,va_list _ap) OP_ARG_NONNULL(1); - -/**Open a stream from a URL. - \note If you use this function, you must link against <tt>libopusurl</tt>. - \param _url The URL to open. - Currently only the <file:>, <http:>, and <https:> schemes - are supported. - Both <http:> and <https:> may be disabled at compile - time, in which case opening such URLs will always fail. - Currently this only supports URIs. - IRIs should be converted to UTF-8 and URL-escaped, with - internationalized domain names encoded in punycode, - before passing them to this function. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want the - failure code. - See op_open_callbacks() for a full list of failure codes. - \param ... The \ref url_options "optional flags" to use. - This is a variable-length list of options terminated with - <code>NULL</code>. - \return A freshly opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_open_url(const char *_url, - int *_error,...) OP_ARG_NONNULL(1); - -/**Open a stream using the given set of callbacks to access it. - \param _stream The stream to read from (e.g., a <code>FILE *</code>). - This value will be passed verbatim as the first - argument to all of the callbacks. - \param _cb The callbacks with which to access the stream. - <code><a href="#op_read_func">read()</a></code> must - be implemented. - <code><a href="#op_seek_func">seek()</a></code> and - <code><a href="#op_tell_func">tell()</a></code> may - be <code>NULL</code>, or may always return -1 to - indicate a stream is unseekable, but if - <code><a href="#op_seek_func">seek()</a></code> is - implemented and succeeds on a particular stream, then - <code><a href="#op_tell_func">tell()</a></code> must - also. - <code><a href="#op_close_func">close()</a></code> may - be <code>NULL</code>, but if it is not, it will be - called when the \c OggOpusFile is destroyed by - op_free(). - It will not be called if op_open_callbacks() fails - with an error. - \param _initial_data An initial buffer of data from the start of the - stream. - Applications can read some number of bytes from the - start of the stream to help identify this as an Opus - stream, and then provide them here to allow the - stream to be opened, even if it is unseekable. - \param _initial_bytes The number of bytes in \a _initial_data. - If the stream is seekable, its current position (as - reported by - <code><a href="#opus_tell_func">tell()</a></code> - at the start of this function) must be equal to - \a _initial_bytes. - Otherwise, seeking to absolute positions will - generate inconsistent results. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want - the failure code. - The failure code will be one of - <dl> - <dt>#OP_EREAD</dt> - <dd>An underlying read, seek, or tell operation - failed when it should have succeeded, or we failed - to find data in the stream we had seen before.</dd> - <dt>#OP_EFAULT</dt> - <dd>There was a memory allocation failure, or an - internal library error.</dd> - <dt>#OP_EIMPL</dt> - <dd>The stream used a feature that is not - implemented, such as an unsupported channel - family.</dd> - <dt>#OP_EINVAL</dt> - <dd><code><a href="#op_seek_func">seek()</a></code> - was implemented and succeeded on this source, but - <code><a href="#op_tell_func">tell()</a></code> - did not, or the starting position indicator was - not equal to \a _initial_bytes.</dd> - <dt>#OP_ENOTFORMAT</dt> - <dd>The stream contained a link that did not have - any logical Opus streams in it.</dd> - <dt>#OP_EBADHEADER</dt> - <dd>A required header packet was not properly - formatted, contained illegal values, or was missing - altogether.</dd> - <dt>#OP_EVERSION</dt> - <dd>An ID header contained an unrecognized version - number.</dd> - <dt>#OP_EBADLINK</dt> - <dd>We failed to find data we had seen before after - seeking.</dd> - <dt>#OP_EBADTIMESTAMP</dt> - <dd>The first or last timestamp in a link failed - basic validity checks.</dd> - </dl> - \return A freshly opened \c OggOpusFile, or <code>NULL</code> on error. - <tt>libopusfile</tt> does <em>not</em> take ownership of the stream - if the call fails. - The calling application is responsible for closing the stream if - this call returns an error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_open_callbacks(void *_stream, - const OpusFileCallbacks *_cb,const unsigned char *_initial_data, - size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); - -/**Partially open a stream from the given file path. - \see op_test_callbacks - \param _path The path to the file to open. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want the - failure code. - The failure code will be #OP_EFAULT if the file could not - be opened, or one of the other failure codes from - op_open_callbacks() otherwise. - \return A partially opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_test_file(const char *_path,int *_error) - OP_ARG_NONNULL(1); - -/**Partially open a stream from a memory buffer. - \see op_test_callbacks - \param _data The memory buffer to open. - \param _size The number of bytes in the buffer. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want the - failure code. - See op_open_callbacks() for a full list of failure codes. - \return A partially opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_test_memory(const unsigned char *_data, - size_t _size,int *_error); - -/**Partially open a stream from a URL. - This function behaves identically to op_test_url(), except that it - takes a va_list instead of a variable number of arguments. - It does not call the <code>va_end</code> macro, and because it invokes the - <code>va_arg</code> macro, the value of \a _ap is undefined after the call. - \note If you use this function, you must link against <tt>libopusurl</tt>. - \see op_test_url - \see op_test_callbacks - \param _url The URL to open. - Currently only the <file:>, <http:>, and <https:> - schemes are supported. - Both <http:> and <https:> may be disabled at compile - time, in which case opening such URLs will always - fail. - Currently this only supports URIs. - IRIs should be converted to UTF-8 and URL-escaped, - with internationalized domain names encoded in - punycode, before passing them to this function. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want - the failure code. - See op_open_callbacks() for a full list of failure - codes. - \param[in,out] _ap A list of the \ref url_options "optional flags" to - use. - This is a variable-length list of options terminated - with <code>NULL</code>. - \return A partially opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_vtest_url(const char *_url, - int *_error,va_list _ap) OP_ARG_NONNULL(1); - -/**Partially open a stream from a URL. - \note If you use this function, you must link against <tt>libopusurl</tt>. - \see op_test_callbacks - \param _url The URL to open. - Currently only the <file:>, <http:>, and <https:> - schemes are supported. - Both <http:> and <https:> may be disabled at compile - time, in which case opening such URLs will always fail. - Currently this only supports URIs. - IRIs should be converted to UTF-8 and URL-escaped, with - internationalized domain names encoded in punycode, - before passing them to this function. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want the - failure code. - See op_open_callbacks() for a full list of failure - codes. - \param ... The \ref url_options "optional flags" to use. - This is a variable-length list of options terminated - with <code>NULL</code>. - \return A partially opened \c OggOpusFile, or <code>NULL</code> on error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_test_url(const char *_url, - int *_error,...) OP_ARG_NONNULL(1); - -/**Partially open a stream using the given set of callbacks to access it. - This tests for Opusness and loads the headers for the first link. - It does not seek (although it tests for seekability). - You can query a partially open stream for the few pieces of basic - information returned by op_serialno(), op_channel_count(), op_head(), and - op_tags() (but only for the first link). - You may also determine if it is seekable via a call to op_seekable(). - You cannot read audio from the stream, seek, get the size or duration, - get information from links other than the first one, or even get the total - number of links until you finish opening the stream with op_test_open(). - If you do not need to do any of these things, you can dispose of it with - op_free() instead. - - This function is provided mostly to simplify porting existing code that used - <tt>libvorbisfile</tt>. - For new code, you are likely better off using op_test() instead, which - is less resource-intensive, requires less data to succeed, and imposes a - hard limit on the amount of data it examines (important for unseekable - streams, where all such data must be buffered until you are sure of the - stream type). - \param _stream The stream to read from (e.g., a <code>FILE *</code>). - This value will be passed verbatim as the first - argument to all of the callbacks. - \param _cb The callbacks with which to access the stream. - <code><a href="#op_read_func">read()</a></code> must - be implemented. - <code><a href="#op_seek_func">seek()</a></code> and - <code><a href="#op_tell_func">tell()</a></code> may - be <code>NULL</code>, or may always return -1 to - indicate a stream is unseekable, but if - <code><a href="#op_seek_func">seek()</a></code> is - implemented and succeeds on a particular stream, then - <code><a href="#op_tell_func">tell()</a></code> must - also. - <code><a href="#op_close_func">close()</a></code> may - be <code>NULL</code>, but if it is not, it will be - called when the \c OggOpusFile is destroyed by - op_free(). - It will not be called if op_open_callbacks() fails - with an error. - \param _initial_data An initial buffer of data from the start of the - stream. - Applications can read some number of bytes from the - start of the stream to help identify this as an Opus - stream, and then provide them here to allow the - stream to be tested more thoroughly, even if it is - unseekable. - \param _initial_bytes The number of bytes in \a _initial_data. - If the stream is seekable, its current position (as - reported by - <code><a href="#opus_tell_func">tell()</a></code> - at the start of this function) must be equal to - \a _initial_bytes. - Otherwise, seeking to absolute positions will - generate inconsistent results. - \param[out] _error Returns 0 on success, or a failure code on error. - You may pass in <code>NULL</code> if you don't want - the failure code. - See op_open_callbacks() for a full list of failure - codes. - \return A partially opened \c OggOpusFile, or <code>NULL</code> on error. - <tt>libopusfile</tt> does <em>not</em> take ownership of the stream - if the call fails. - The calling application is responsible for closing the stream if - this call returns an error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_test_callbacks(void *_stream, - const OpusFileCallbacks *_cb,const unsigned char *_initial_data, - size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); - -/**Finish opening a stream partially opened with op_test_callbacks() or one of - the associated convenience functions. - If this function fails, you are still responsible for freeing the - \c OggOpusFile with op_free(). - \param _of The \c OggOpusFile to finish opening. - \return 0 on success, or a negative value on error. - \retval #OP_EREAD An underlying read, seek, or tell operation failed - when it should have succeeded. - \retval #OP_EFAULT There was a memory allocation failure, or an - internal library error. - \retval #OP_EIMPL The stream used a feature that is not implemented, - such as an unsupported channel family. - \retval #OP_EINVAL The stream was not partially opened with - op_test_callbacks() or one of the associated - convenience functions. - \retval #OP_ENOTFORMAT The stream contained a link that did not have any - logical Opus streams in it. - \retval #OP_EBADHEADER A required header packet was not properly - formatted, contained illegal values, or was - missing altogether. - \retval #OP_EVERSION An ID header contained an unrecognized version - number. - \retval #OP_EBADLINK We failed to find data we had seen before after - seeking. - \retval #OP_EBADTIMESTAMP The first or last timestamp in a link failed basic - validity checks.*/ -int op_test_open(OggOpusFile *_of) OP_ARG_NONNULL(1); - -/**Release all memory used by an \c OggOpusFile. - \param _of The \c OggOpusFile to free.*/ -void op_free(OggOpusFile *_of); - -/*@}*/ -/*@}*/ - -/**\defgroup stream_info Stream Information*/ -/*@{*/ -/**\name Functions for obtaining information about streams - - These functions allow you to get basic information about a stream, including - seekability, the number of links (for chained streams), plus the size, - duration, bitrate, header parameters, and meta information for each link - (or, where available, the stream as a whole). - Some of these (size, duration) are only available for seekable streams. - You can also query the current stream position, link, and playback time, - and instantaneous bitrate during playback. - - Some of these functions may be used successfully on the partially open - streams returned by op_test_callbacks() or one of the associated - convenience functions. - Their documention will indicate so explicitly.*/ -/*@{*/ - -/**Returns whether or not the stream being read is seekable. - This is true if - <ol> - <li>The <code><a href="#op_seek_func">seek()</a></code> and - <code><a href="#op_tell_func">tell()</a></code> callbacks are both - non-<code>NULL</code>,</li> - <li>The <code><a href="#op_seek_func">seek()</a></code> callback was - successfully executed at least once, and</li> - <li>The <code><a href="#op_tell_func">tell()</a></code> callback was - successfully able to report the position indicator afterwards.</li> - </ol> - This function may be called on partially-opened streams. - \param _of The \c OggOpusFile whose seekable status is to be returned. - \return A non-zero value if seekable, and 0 if unseekable.*/ -int op_seekable(const OggOpusFile *_of) OP_ARG_NONNULL(1); - -/**Returns the number of links in this chained stream. - This function may be called on partially-opened streams, but it will always - return 1. - The actual number of links is not known until the stream is fully opened. - \param _of The \c OggOpusFile from which to retrieve the link count. - \return For fully-open seekable streams, this returns the total number of - links in the whole stream, which will be at least 1. - For partially-open or unseekable streams, this always returns 1.*/ -int op_link_count(const OggOpusFile *_of) OP_ARG_NONNULL(1); - -/**Get the serial number of the given link in a (possibly-chained) Ogg Opus - stream. - This function may be called on partially-opened streams, but it will always - return the serial number of the Opus stream in the first link. - \param _of The \c OggOpusFile from which to retrieve the serial number. - \param _li The index of the link whose serial number should be retrieved. - Use a negative number to get the serial number of the current - link. - \return The serial number of the given link. - If \a _li is greater than the total number of links, this returns - the serial number of the last link. - If the stream is not seekable, this always returns the serial number - of the current link.*/ -opus_uint32 op_serialno(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Get the channel count of the given link in a (possibly-chained) Ogg Opus - stream. - This is equivalent to <code>op_head(_of,_li)->channel_count</code>, but - is provided for convenience. - This function may be called on partially-opened streams, but it will always - return the channel count of the Opus stream in the first link. - \param _of The \c OggOpusFile from which to retrieve the channel count. - \param _li The index of the link whose channel count should be retrieved. - Use a negative number to get the channel count of the current - link. - \return The channel count of the given link. - If \a _li is greater than the total number of links, this returns - the channel count of the last link. - If the stream is not seekable, this always returns the channel count - of the current link.*/ -int op_channel_count(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Get the total (compressed) size of the stream, or of an individual link in - a (possibly-chained) Ogg Opus stream, including all headers and Ogg muxing - overhead. - \warning If the Opus stream (or link) is concurrently multiplexed with other - logical streams (e.g., video), this returns the size of the entire stream - (or link), not just the number of bytes in the first logical Opus stream. - Returning the latter would require scanning the entire file. - \param _of The \c OggOpusFile from which to retrieve the compressed size. - \param _li The index of the link whose compressed size should be computed. - Use a negative number to get the compressed size of the entire - stream. - \return The compressed size of the entire stream if \a _li is negative, the - compressed size of link \a _li if it is non-negative, or a negative - value on error. - The compressed size of the entire stream may be smaller than that - of the underlying stream if trailing garbage was detected in the - file. - \retval #OP_EINVAL The stream is not seekable (so we can't know the length), - \a _li wasn't less than the total number of links in - the stream, or the stream was only partially open.*/ -opus_int64 op_raw_total(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Get the total PCM length (number of samples at 48 kHz) of the stream, or of - an individual link in a (possibly-chained) Ogg Opus stream. - Users looking for <code>op_time_total()</code> should use op_pcm_total() - instead. - Because timestamps in Opus are fixed at 48 kHz, there is no need for a - separate function to convert this to seconds (and leaving it out avoids - introducing floating point to the API, for those that wish to avoid it). - \param _of The \c OggOpusFile from which to retrieve the PCM offset. - \param _li The index of the link whose PCM length should be computed. - Use a negative number to get the PCM length of the entire stream. - \return The PCM length of the entire stream if \a _li is negative, the PCM - length of link \a _li if it is non-negative, or a negative value on - error. - \retval #OP_EINVAL The stream is not seekable (so we can't know the length), - \a _li wasn't less than the total number of links in - the stream, or the stream was only partially open.*/ -ogg_int64_t op_pcm_total(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Get the ID header information for the given link in a (possibly chained) Ogg - Opus stream. - This function may be called on partially-opened streams, but it will always - return the ID header information of the Opus stream in the first link. - \param _of The \c OggOpusFile from which to retrieve the ID header - information. - \param _li The index of the link whose ID header information should be - retrieved. - Use a negative number to get the ID header information of the - current link. - For an unseekable stream, \a _li is ignored, and the ID header - information for the current link is always returned, if - available. - \return The contents of the ID header for the given link.*/ -const OpusHead *op_head(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Get the comment header information for the given link in a (possibly - chained) Ogg Opus stream. - This function may be called on partially-opened streams, but it will always - return the tags from the Opus stream in the first link. - \param _of The \c OggOpusFile from which to retrieve the comment header - information. - \param _li The index of the link whose comment header information should be - retrieved. - Use a negative number to get the comment header information of - the current link. - For an unseekable stream, \a _li is ignored, and the comment - header information for the current link is always returned, if - available. - \return The contents of the comment header for the given link, or - <code>NULL</code> if this is an unseekable stream that encountered - an invalid link.*/ -const OpusTags *op_tags(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Retrieve the index of the current link. - This is the link that produced the data most recently read by - op_read_float() or its associated functions, or, after a seek, the link - that the seek target landed in. - Reading more data may advance the link index (even on the first read after a - seek). - \param _of The \c OggOpusFile from which to retrieve the current link index. - \return The index of the current link on success, or a negative value on - failure. - For seekable streams, this is a number between 0 (inclusive) and the - value returned by op_link_count() (exclusive). - For unseekable streams, this value starts at 0 and increments by one - each time a new link is encountered (even though op_link_count() - always returns 1). - \retval #OP_EINVAL The stream was only partially open.*/ -int op_current_link(const OggOpusFile *_of) OP_ARG_NONNULL(1); - -/**Computes the bitrate of the stream, or of an individual link in a - (possibly-chained) Ogg Opus stream. - The stream must be seekable to compute the bitrate. - For unseekable streams, use op_bitrate_instant() to get periodic estimates. - \warning If the Opus stream (or link) is concurrently multiplexed with other - logical streams (e.g., video), this uses the size of the entire stream (or - link) to compute the bitrate, not just the number of bytes in the first - logical Opus stream. - Returning the latter requires scanning the entire file, but this may be done - by decoding the whole file and calling op_bitrate_instant() once at the - end. - Install a trivial decoding callback with op_set_decode_callback() if you - wish to skip actual decoding during this process. - \param _of The \c OggOpusFile from which to retrieve the bitrate. - \param _li The index of the link whose bitrate should be computed. - Use a negative number to get the bitrate of the whole stream. - \return The bitrate on success, or a negative value on error. - \retval #OP_EINVAL The stream was only partially open, the stream was not - seekable, or \a _li was larger than the number of - links.*/ -opus_int32 op_bitrate(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); - -/**Compute the instantaneous bitrate, measured as the ratio of bits to playable - samples decoded since a) the last call to op_bitrate_instant(), b) the last - seek, or c) the start of playback, whichever was most recent. - This will spike somewhat after a seek or at the start/end of a chain - boundary, as pre-skip, pre-roll, and end-trimming causes samples to be - decoded but not played. - \param _of The \c OggOpusFile from which to retrieve the bitrate. - \return The bitrate, in bits per second, or a negative value on error. - \retval #OP_FALSE No data has been decoded since any of the events - described above. - \retval #OP_EINVAL The stream was only partially open.*/ -opus_int32 op_bitrate_instant(OggOpusFile *_of) OP_ARG_NONNULL(1); - -/**Obtain the current value of the position indicator for \a _of. - \param _of The \c OggOpusFile from which to retrieve the position indicator. - \return The byte position that is currently being read from. - \retval #OP_EINVAL The stream was only partially open.*/ -opus_int64 op_raw_tell(const OggOpusFile *_of) OP_ARG_NONNULL(1); - -/**Obtain the PCM offset of the next sample to be read. - If the stream is not properly timestamped, this might not increment by the - proper amount between reads, or even return monotonically increasing - values. - \param _of The \c OggOpusFile from which to retrieve the PCM offset. - \return The PCM offset of the next sample to be read. - \retval #OP_EINVAL The stream was only partially open.*/ -ogg_int64_t op_pcm_tell(const OggOpusFile *_of) OP_ARG_NONNULL(1); - -/*@}*/ -/*@}*/ - -/**\defgroup stream_seeking Seeking*/ -/*@{*/ -/**\name Functions for seeking in Opus streams - - These functions let you seek in Opus streams, if the underlying stream - support it. - Seeking is implemented for all built-in stream I/O routines, though some - individual streams may not be seekable (pipes, live HTTP streams, or HTTP - streams from a server that does not support <code>Range</code> requests). - - op_raw_seek() is the fastest: it is guaranteed to perform at most one - physical seek, but, since the target is a byte position, makes no guarantee - how close to a given time it will come. - op_pcm_seek() provides sample-accurate seeking. - The number of physical seeks it requires is still quite small (often 1 or - 2, even in highly variable bitrate streams). - - Seeking in Opus requires decoding some pre-roll amount before playback to - allow the internal state to converge (as if recovering from packet loss). - This is handled internally by <tt>libopusfile</tt>, but means there is - little extra overhead for decoding up to the exact position requested - (since it must decode some amount of audio anyway). - It also means that decoding after seeking may not return exactly the same - values as would be obtained by decoding the stream straight through. - However, such differences are expected to be smaller than the loss - introduced by Opus's lossy compression.*/ -/*@{*/ - -/**Seek to a byte offset relative to the <b>compressed</b> data. - This also scans packets to update the PCM cursor. - It will cross a logical bitstream boundary, but only if it can't get any - packets out of the tail of the link to which it seeks. - \param _of The \c OggOpusFile in which to seek. - \param _byte_offset The byte position to seek to. - This must be between 0 and #op_raw_total(\a _of,\c -1) - (inclusive). - \return 0 on success, or a negative error code on failure. - \retval #OP_EREAD The underlying seek operation failed. - \retval #OP_EINVAL The stream was only partially open, or the target was - outside the valid range for the stream. - \retval #OP_ENOSEEK This stream is not seekable. - \retval #OP_EBADLINK Failed to initialize a decoder for a stream for an - unknown reason.*/ -int op_raw_seek(OggOpusFile *_of,opus_int64 _byte_offset) OP_ARG_NONNULL(1); - -/**Seek to the specified PCM offset, such that decoding will begin at exactly - the requested position. - \param _of The \c OggOpusFile in which to seek. - \param _pcm_offset The PCM offset to seek to. - This is in samples at 48 kHz relative to the start of the - stream. - \return 0 on success, or a negative value on error. - \retval #OP_EREAD An underlying read or seek operation failed. - \retval #OP_EINVAL The stream was only partially open, or the target was - outside the valid range for the stream. - \retval #OP_ENOSEEK This stream is not seekable. - \retval #OP_EBADLINK We failed to find data we had seen before, or the - bitstream structure was sufficiently malformed that - seeking to the target destination was impossible.*/ -int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset) OP_ARG_NONNULL(1); - -/*@}*/ -/*@}*/ - -/**\defgroup stream_decoding Decoding*/ -/*@{*/ -/**\name Functions for decoding audio data - - These functions retrieve actual decoded audio data from the stream. - The general functions, op_read() and op_read_float() return 16-bit or - floating-point output, both using native endian ordering. - The number of channels returned can change from link to link in a chained - stream. - There are special functions, op_read_stereo() and op_read_float_stereo(), - which always output two channels, to simplify applications which do not - wish to handle multichannel audio. - These downmix multichannel files to two channels, so they can always return - samples in the same format for every link in a chained file. - - If the rest of your audio processing chain can handle floating point, the - floating-point routines should be preferred, as they prevent clipping and - other issues which might be avoided entirely if, e.g., you scale down the - volume at some other stage. - However, if you intend to consume 16-bit samples directly, the conversion in - <tt>libopusfile</tt> provides noise-shaping dithering and, if compiled - against <tt>libopus</tt> 1.1 or later, soft-clipping prevention. - - <tt>libopusfile</tt> can also be configured at compile time to use the - fixed-point <tt>libopus</tt> API. - If so, <tt>libopusfile</tt>'s floating-point API may also be disabled. - In that configuration, nothing in <tt>libopusfile</tt> will use any - floating-point operations, to simplify support on devices without an - adequate FPU. - - \warning HTTPS streams may be be vulnerable to truncation attacks if you do - not check the error return code from op_read_float() or its associated - functions. - If the remote peer does not close the connection gracefully (with a TLS - "close notify" message), these functions will return #OP_EREAD instead of 0 - when they reach the end of the file. - If you are reading from an <https:> URL (particularly if seeking is not - supported), you should make sure to check for this error and warn the user - appropriately.*/ -/*@{*/ - -/**Indicates that the decoding callback should produce signed 16-bit - native-endian output samples.*/ -#define OP_DEC_FORMAT_SHORT (7008) -/**Indicates that the decoding callback should produce 32-bit native-endian - float samples.*/ -#define OP_DEC_FORMAT_FLOAT (7040) - -/**Indicates that the decoding callback did not decode anything, and that - <tt>libopusfile</tt> should decode normally instead.*/ -#define OP_DEC_USE_DEFAULT (6720) - -/**Called to decode an Opus packet. - This should invoke the functional equivalent of opus_multistream_decode() or - opus_multistream_decode_float(), except that it returns 0 on success - instead of the number of decoded samples (which is known a priori). - \param _ctx The application-provided callback context. - \param _decoder The decoder to use to decode the packet. - \param[out] _pcm The buffer to decode into. - This will always have enough room for \a _nchannels of - \a _nsamples samples, which should be placed into this - buffer interleaved. - \param _op The packet to decode. - This will always have its granule position set to a valid - value. - \param _nsamples The number of samples expected from the packet. - \param _nchannels The number of channels expected from the packet. - \param _format The desired sample output format. - This is either #OP_DEC_FORMAT_SHORT or - #OP_DEC_FORMAT_FLOAT. - \param _li The index of the link from which this packet was decoded. - \return A non-negative value on success, or a negative value on error. - Any error codes should be the same as those returned by - opus_multistream_decode() or opus_multistream_decode_float(). - Success codes are as follows: - \retval 0 Decoding was successful. - The application has filled the buffer with - exactly <code>\a _nsamples*\a - _nchannels</code> samples in the requested - format. - \retval #OP_DEC_USE_DEFAULT No decoding was done. - <tt>libopusfile</tt> should do the decoding - by itself instead.*/ -typedef int (*op_decode_cb_func)(void *_ctx,OpusMSDecoder *_decoder,void *_pcm, - const ogg_packet *_op,int _nsamples,int _nchannels,int _format,int _li); - -/**Sets the packet decode callback function. - If set, this is called once for each packet that needs to be decoded. - This can be used by advanced applications to do additional processing on the - compressed or uncompressed data. - For example, an application might save the final entropy coder state for - debugging and testing purposes, or it might apply additional filters - before the downmixing, dithering, or soft-clipping performed by - <tt>libopusfile</tt>, so long as these filters do not introduce any - latency. - - A call to this function is no guarantee that the audio will eventually be - delivered to the application. - <tt>libopusfile</tt> may discard some or all of the decoded audio data - (i.e., at the beginning or end of a link, or after a seek), however the - callback is still required to provide all of it. - \param _of The \c OggOpusFile on which to set the decode callback. - \param _decode_cb The callback function to call. - This may be <code>NULL</code> to disable calling the - callback. - \param _ctx The application-provided context pointer to pass to the - callback on each call.*/ -void op_set_decode_callback(OggOpusFile *_of, - op_decode_cb_func _decode_cb,void *_ctx) OP_ARG_NONNULL(1); - -/**Gain offset type that indicates that the provided offset is relative to the - header gain. - This is the default.*/ -#define OP_HEADER_GAIN (0) - -/**Gain offset type that indicates that the provided offset is relative to the - R128_ALBUM_GAIN value (if any), in addition to the header gain.*/ -#define OP_ALBUM_GAIN (3007) - -/**Gain offset type that indicates that the provided offset is relative to the - R128_TRACK_GAIN value (if any), in addition to the header gain.*/ -#define OP_TRACK_GAIN (3008) - -/**Gain offset type that indicates that the provided offset should be used as - the gain directly, without applying any the header or track gains.*/ -#define OP_ABSOLUTE_GAIN (3009) - -/**Sets the gain to be used for decoded output. - By default, the gain in the header is applied with no additional offset. - The total gain (including header gain and/or track gain, if applicable, and - this offset), will be clamped to [-32768,32767]/256 dB. - This is more than enough to saturate or underflow 16-bit PCM. - \note The new gain will not be applied to any already buffered, decoded - output. - This means you cannot change it sample-by-sample, as at best it will be - updated packet-by-packet. - It is meant for setting a target volume level, rather than applying smooth - fades, etc. - \param _of The \c OggOpusFile on which to set the gain offset. - \param _gain_type One of #OP_HEADER_GAIN, #OP_ALBUM_GAIN, - #OP_TRACK_GAIN, or #OP_ABSOLUTE_GAIN. - \param _gain_offset_q8 The gain offset to apply, in 1/256ths of a dB. - \return 0 on success or a negative value on error. - \retval #OP_EINVAL The \a _gain_type was unrecognized.*/ -int op_set_gain_offset(OggOpusFile *_of, - int _gain_type,opus_int32 _gain_offset_q8) OP_ARG_NONNULL(1); - -/**Sets whether or not dithering is enabled for 16-bit decoding. - By default, when <tt>libopusfile</tt> is compiled to use floating-point - internally, calling op_read() or op_read_stereo() will first decode to - float, and then convert to fixed-point using noise-shaping dithering. - This flag can be used to disable that dithering. - When the application uses op_read_float() or op_read_float_stereo(), or when - the library has been compiled to decode directly to fixed point, this flag - has no effect. - \param _of The \c OggOpusFile on which to enable or disable dithering. - \param _enabled A non-zero value to enable dithering, or 0 to disable it.*/ -void op_set_dither_enabled(OggOpusFile *_of,int _enabled) OP_ARG_NONNULL(1); - -/**Reads more samples from the stream. - \note Although \a _buf_size must indicate the total number of values that - can be stored in \a _pcm, the return value is the number of samples - <em>per channel</em>. - This is done because - <ol> - <li>The channel count cannot be known a priori (reading more samples might - advance us into the next link, with a different channel count), so - \a _buf_size cannot also be in units of samples per channel,</li> - <li>Returning the samples per channel matches the <code>libopus</code> API - as closely as we're able,</li> - <li>Returning the total number of values instead of samples per channel - would mean the caller would need a division to compute the samples per - channel, and might worry about the possibility of getting back samples - for some channels and not others, and</li> - <li>This approach is relatively fool-proof: if an application passes too - small a value to \a _buf_size, they will simply get fewer samples back, - and if they assume the return value is the total number of values, then - they will simply read too few (rather than reading too many and going - off the end of the buffer).</li> - </ol> - \param _of The \c OggOpusFile from which to read. - \param[out] _pcm A buffer in which to store the output PCM samples, as - signed native-endian 16-bit values at 48 kHz - with a nominal range of <code>[-32768,32767)</code>. - Multiple channels are interleaved using the - <a href="http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9">Vorbis - channel ordering</a>. - This must have room for at least \a _buf_size values. - \param _buf_size The number of values that can be stored in \a _pcm. - It is recommended that this be large enough for at - least 120 ms of data at 48 kHz per channel (5760 - values per channel). - Smaller buffers will simply return less data, possibly - consuming more memory to buffer the data internally. - <tt>libopusfile</tt> may return less data than - requested. - If so, there is no guarantee that the remaining data - in \a _pcm will be unmodified. - \param[out] _li The index of the link this data was decoded from. - You may pass <code>NULL</code> if you do not need this - information. - If this function fails (returning a negative value), - this parameter is left unset. - \return The number of samples read per channel on success, or a negative - value on failure. - The channel count can be retrieved on success by calling - <code>op_head(_of,*_li)</code>. - The number of samples returned may be 0 if the buffer was too small - to store even a single sample for all channels, or if end-of-file - was reached. - The list of possible failure codes follows. - Most of them can only be returned by unseekable, chained streams - that encounter a new link. - \retval #OP_HOLE There was a hole in the data, and some samples - may have been skipped. - Call this function again to continue decoding - past the hole. - \retval #OP_EREAD An underlying read operation failed. - This may signal a truncation attack from an - <https:> source. - \retval #OP_EFAULT An internal memory allocation failed. - \retval #OP_EIMPL An unseekable stream encountered a new link that - used a feature that is not implemented, such as - an unsupported channel family. - \retval #OP_EINVAL The stream was only partially open. - \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that - did not have any logical Opus streams in it. - \retval #OP_EBADHEADER An unseekable stream encountered a new link with a - required header packet that was not properly - formatted, contained illegal values, or was - missing altogether. - \retval #OP_EVERSION An unseekable stream encountered a new link with - an ID header that contained an unrecognized - version number. - \retval #OP_EBADPACKET Failed to properly decode the next packet. - \retval #OP_EBADLINK We failed to find data we had seen before. - \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with - a starting timestamp that failed basic validity - checks.*/ -OP_WARN_UNUSED_RESULT int op_read(OggOpusFile *_of, - opus_int16 *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); - -/**Reads more samples from the stream. - \note Although \a _buf_size must indicate the total number of values that - can be stored in \a _pcm, the return value is the number of samples - <em>per channel</em>. - <ol> - <li>The channel count cannot be known a priori (reading more samples might - advance us into the next link, with a different channel count), so - \a _buf_size cannot also be in units of samples per channel,</li> - <li>Returning the samples per channel matches the <code>libopus</code> API - as closely as we're able,</li> - <li>Returning the total number of values instead of samples per channel - would mean the caller would need a division to compute the samples per - channel, and might worry about the possibility of getting back samples - for some channels and not others, and</li> - <li>This approach is relatively fool-proof: if an application passes too - small a value to \a _buf_size, they will simply get fewer samples back, - and if they assume the return value is the total number of values, then - they will simply read too few (rather than reading too many and going - off the end of the buffer).</li> - </ol> - \param _of The \c OggOpusFile from which to read. - \param[out] _pcm A buffer in which to store the output PCM samples as - signed floats at 48 kHz with a nominal range of - <code>[-1.0,1.0]</code>. - Multiple channels are interleaved using the - <a href="http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9">Vorbis - channel ordering</a>. - This must have room for at least \a _buf_size floats. - \param _buf_size The number of floats that can be stored in \a _pcm. - It is recommended that this be large enough for at - least 120 ms of data at 48 kHz per channel (5760 - samples per channel). - Smaller buffers will simply return less data, possibly - consuming more memory to buffer the data internally. - If less than \a _buf_size values are returned, - <tt>libopusfile</tt> makes no guarantee that the - remaining data in \a _pcm will be unmodified. - \param[out] _li The index of the link this data was decoded from. - You may pass <code>NULL</code> if you do not need this - information. - If this function fails (returning a negative value), - this parameter is left unset. - \return The number of samples read per channel on success, or a negative - value on failure. - The channel count can be retrieved on success by calling - <code>op_head(_of,*_li)</code>. - The number of samples returned may be 0 if the buffer was too small - to store even a single sample for all channels, or if end-of-file - was reached. - The list of possible failure codes follows. - Most of them can only be returned by unseekable, chained streams - that encounter a new link. - \retval #OP_HOLE There was a hole in the data, and some samples - may have been skipped. - Call this function again to continue decoding - past the hole. - \retval #OP_EREAD An underlying read operation failed. - This may signal a truncation attack from an - <https:> source. - \retval #OP_EFAULT An internal memory allocation failed. - \retval #OP_EIMPL An unseekable stream encountered a new link that - used a feature that is not implemented, such as - an unsupported channel family. - \retval #OP_EINVAL The stream was only partially open. - \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that - did not have any logical Opus streams in it. - \retval #OP_EBADHEADER An unseekable stream encountered a new link with a - required header packet that was not properly - formatted, contained illegal values, or was - missing altogether. - \retval #OP_EVERSION An unseekable stream encountered a new link with - an ID header that contained an unrecognized - version number. - \retval #OP_EBADPACKET Failed to properly decode the next packet. - \retval #OP_EBADLINK We failed to find data we had seen before. - \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with - a starting timestamp that failed basic validity - checks.*/ -OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of, - float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); - -/**Reads more samples from the stream and downmixes to stereo, if necessary. - This function is intended for simple players that want a uniform output - format, even if the channel count changes between links in a chained - stream. - \note \a _buf_size indicates the total number of values that can be stored - in \a _pcm, while the return value is the number of samples <em>per - channel</em>, even though the channel count is known, for consistency with - op_read(). - \param _of The \c OggOpusFile from which to read. - \param[out] _pcm A buffer in which to store the output PCM samples, as - signed native-endian 16-bit values at 48 kHz - with a nominal range of <code>[-32768,32767)</code>. - The left and right channels are interleaved in the - buffer. - This must have room for at least \a _buf_size values. - \param _buf_size The number of values that can be stored in \a _pcm. - It is recommended that this be large enough for at - least 120 ms of data at 48 kHz per channel (11520 - values total). - Smaller buffers will simply return less data, possibly - consuming more memory to buffer the data internally. - If less than \a _buf_size values are returned, - <tt>libopusfile</tt> makes no guarantee that the - remaining data in \a _pcm will be unmodified. - \return The number of samples read per channel on success, or a negative - value on failure. - The number of samples returned may be 0 if the buffer was too small - to store even a single sample for both channels, or if end-of-file - was reached. - The list of possible failure codes follows. - Most of them can only be returned by unseekable, chained streams - that encounter a new link. - \retval #OP_HOLE There was a hole in the data, and some samples - may have been skipped. - Call this function again to continue decoding - past the hole. - \retval #OP_EREAD An underlying read operation failed. - This may signal a truncation attack from an - <https:> source. - \retval #OP_EFAULT An internal memory allocation failed. - \retval #OP_EIMPL An unseekable stream encountered a new link that - used a feature that is not implemented, such as - an unsupported channel family. - \retval #OP_EINVAL The stream was only partially open. - \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that - did not have any logical Opus streams in it. - \retval #OP_EBADHEADER An unseekable stream encountered a new link with a - required header packet that was not properly - formatted, contained illegal values, or was - missing altogether. - \retval #OP_EVERSION An unseekable stream encountered a new link with - an ID header that contained an unrecognized - version number. - \retval #OP_EBADPACKET Failed to properly decode the next packet. - \retval #OP_EBADLINK We failed to find data we had seen before. - \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with - a starting timestamp that failed basic validity - checks.*/ -OP_WARN_UNUSED_RESULT int op_read_stereo(OggOpusFile *_of, - opus_int16 *_pcm,int _buf_size) OP_ARG_NONNULL(1); - -/**Reads more samples from the stream and downmixes to stereo, if necessary. - This function is intended for simple players that want a uniform output - format, even if the channel count changes between links in a chained - stream. - \note \a _buf_size indicates the total number of values that can be stored - in \a _pcm, while the return value is the number of samples <em>per - channel</em>, even though the channel count is known, for consistency with - op_read_float(). - \param _of The \c OggOpusFile from which to read. - \param[out] _pcm A buffer in which to store the output PCM samples, as - signed floats at 48 kHz with a nominal range of - <code>[-1.0,1.0]</code>. - The left and right channels are interleaved in the - buffer. - This must have room for at least \a _buf_size values. - \param _buf_size The number of values that can be stored in \a _pcm. - It is recommended that this be large enough for at - least 120 ms of data at 48 kHz per channel (11520 - values total). - Smaller buffers will simply return less data, possibly - consuming more memory to buffer the data internally. - If less than \a _buf_size values are returned, - <tt>libopusfile</tt> makes no guarantee that the - remaining data in \a _pcm will be unmodified. - \return The number of samples read per channel on success, or a negative - value on failure. - The number of samples returned may be 0 if the buffer was too small - to store even a single sample for both channels, or if end-of-file - was reached. - The list of possible failure codes follows. - Most of them can only be returned by unseekable, chained streams - that encounter a new link. - \retval #OP_HOLE There was a hole in the data, and some samples - may have been skipped. - Call this function again to continue decoding - past the hole. - \retval #OP_EREAD An underlying read operation failed. - This may signal a truncation attack from an - <https:> source. - \retval #OP_EFAULT An internal memory allocation failed. - \retval #OP_EIMPL An unseekable stream encountered a new link that - used a feature that is not implemented, such as - an unsupported channel family. - \retval #OP_EINVAL The stream was only partially open. - \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that - that did not have any logical Opus streams in it. - \retval #OP_EBADHEADER An unseekable stream encountered a new link with a - required header packet that was not properly - formatted, contained illegal values, or was - missing altogether. - \retval #OP_EVERSION An unseekable stream encountered a new link with - an ID header that contained an unrecognized - version number. - \retval #OP_EBADPACKET Failed to properly decode the next packet. - \retval #OP_EBADLINK We failed to find data we had seen before. - \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with - a starting timestamp that failed basic validity - checks.*/ -OP_WARN_UNUSED_RESULT int op_read_float_stereo(OggOpusFile *_of, - float *_pcm,int _buf_size) OP_ARG_NONNULL(1); - -/*@}*/ -/*@}*/ - -# if OP_GNUC_PREREQ(4,0) -# pragma GCC visibility pop -# endif - -# if defined(__cplusplus) -} -# endif - -#endif diff --git a/MacOSX/codecs/include/opusfile.h b/MacOSX/codecs/include/opusfile.h deleted file mode 100644 index e74eda2f..00000000 --- a/MacOSX/codecs/include/opusfile.h +++ /dev/null @@ -1,3 +0,0 @@ -/* just a wrapper to bypass the pkg-config thingy: the - * headers under opus/ are edited accordingly for this */ -#include <opus/opusfile.h> diff --git a/MacOSX/codecs/include/vorbis/codec.h b/MacOSX/codecs/include/vorbis/codec.h deleted file mode 100644 index 42aa2913..00000000 --- a/MacOSX/codecs/include/vorbis/codec.h +++ /dev/null @@ -1,242 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - - ******************************************************************** - - function: libvorbis codec headers - - ********************************************************************/ - -#ifndef _vorbis_codec_h_ -#define _vorbis_codec_h_ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include <ogg/ogg.h> - -typedef struct vorbis_info{ - int version; - int channels; - long rate; - - /* The below bitrate declarations are *hints*. - Combinations of the three values carry the following implications: - - all three set to the same value: - implies a fixed rate bitstream - only nominal set: - implies a VBR stream that averages the nominal bitrate. No hard - upper/lower limit - upper and or lower set: - implies a VBR bitstream that obeys the bitrate limits. nominal - may also be set to give a nominal rate. - none set: - the coder does not care to speculate. - */ - - long bitrate_upper; - long bitrate_nominal; - long bitrate_lower; - long bitrate_window; - - void *codec_setup; -} vorbis_info; - -/* vorbis_dsp_state buffers the current vorbis audio - analysis/synthesis state. The DSP state belongs to a specific - logical bitstream ****************************************************/ -typedef struct vorbis_dsp_state{ - int analysisp; - vorbis_info *vi; - - float **pcm; - float **pcmret; - int pcm_storage; - int pcm_current; - int pcm_returned; - - int preextrapolate; - int eofflag; - - long lW; - long W; - long nW; - long centerW; - - ogg_int64_t granulepos; - ogg_int64_t sequence; - - ogg_int64_t glue_bits; - ogg_int64_t time_bits; - ogg_int64_t floor_bits; - ogg_int64_t res_bits; - - void *backend_state; -} vorbis_dsp_state; - -typedef struct vorbis_block{ - /* necessary stream state for linking to the framing abstraction */ - float **pcm; /* this is a pointer into local storage */ - oggpack_buffer opb; - - long lW; - long W; - long nW; - int pcmend; - int mode; - - int eofflag; - ogg_int64_t granulepos; - ogg_int64_t sequence; - vorbis_dsp_state *vd; /* For read-only access of configuration */ - - /* local storage to avoid remallocing; it's up to the mapping to - structure it */ - void *localstore; - long localtop; - long localalloc; - long totaluse; - struct alloc_chain *reap; - - /* bitmetrics for the frame */ - long glue_bits; - long time_bits; - long floor_bits; - long res_bits; - - void *internal; - -} vorbis_block; - -/* vorbis_block is a single block of data to be processed as part of -the analysis/synthesis stream; it belongs to a specific logical -bitstream, but is independent from other vorbis_blocks belonging to -that logical bitstream. *************************************************/ - -struct alloc_chain{ - void *ptr; - struct alloc_chain *next; -}; - -/* vorbis_info contains all the setup information specific to the - specific compression/decompression mode in progress (eg, - psychoacoustic settings, channel setup, options, codebook - etc). vorbis_info and substructures are in backends.h. -*********************************************************************/ - -/* the comments are not part of vorbis_info so that vorbis_info can be - static storage */ -typedef struct vorbis_comment{ - /* unlimited user comment fields. libvorbis writes 'libvorbis' - whatever vendor is set to in encode */ - char **user_comments; - int *comment_lengths; - int comments; - char *vendor; - -} vorbis_comment; - - -/* libvorbis encodes in two abstraction layers; first we perform DSP - and produce a packet (see docs/analysis.txt). The packet is then - coded into a framed OggSquish bitstream by the second layer (see - docs/framing.txt). Decode is the reverse process; we sync/frame - the bitstream and extract individual packets, then decode the - packet back into PCM audio. - - The extra framing/packetizing is used in streaming formats, such as - files. Over the net (such as with UDP), the framing and - packetization aren't necessary as they're provided by the transport - and the streaming layer is not used */ - -/* Vorbis PRIMITIVES: general ***************************************/ - -extern void vorbis_info_init(vorbis_info *vi); -extern void vorbis_info_clear(vorbis_info *vi); -extern int vorbis_info_blocksize(vorbis_info *vi,int zo); -extern void vorbis_comment_init(vorbis_comment *vc); -extern void vorbis_comment_add(vorbis_comment *vc, const char *comment); -extern void vorbis_comment_add_tag(vorbis_comment *vc, - const char *tag, const char *contents); -extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count); -extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag); -extern void vorbis_comment_clear(vorbis_comment *vc); - -extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb); -extern int vorbis_block_clear(vorbis_block *vb); -extern void vorbis_dsp_clear(vorbis_dsp_state *v); -extern double vorbis_granule_time(vorbis_dsp_state *v, - ogg_int64_t granulepos); - -extern const char *vorbis_version_string(void); - -/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/ - -extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi); -extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op); -extern int vorbis_analysis_headerout(vorbis_dsp_state *v, - vorbis_comment *vc, - ogg_packet *op, - ogg_packet *op_comm, - ogg_packet *op_code); -extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals); -extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals); -extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb); -extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op); - -extern int vorbis_bitrate_addblock(vorbis_block *vb); -extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, - ogg_packet *op); - -/* Vorbis PRIMITIVES: synthesis layer *******************************/ -extern int vorbis_synthesis_idheader(ogg_packet *op); -extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc, - ogg_packet *op); - -extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi); -extern int vorbis_synthesis_restart(vorbis_dsp_state *v); -extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op); -extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op); -extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb); -extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm); -extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm); -extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples); -extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op); - -extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag); -extern int vorbis_synthesis_halfrate_p(vorbis_info *v); - -/* Vorbis ERRORS and return codes ***********************************/ - -#define OV_FALSE -1 -#define OV_EOF -2 -#define OV_HOLE -3 - -#define OV_EREAD -128 -#define OV_EFAULT -129 -#define OV_EIMPL -130 -#define OV_EINVAL -131 -#define OV_ENOTVORBIS -132 -#define OV_EBADHEADER -133 -#define OV_EVERSION -134 -#define OV_ENOTAUDIO -135 -#define OV_EBADPACKET -136 -#define OV_EBADLINK -137 -#define OV_ENOSEEK -138 - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/MacOSX/codecs/include/vorbis/vorbisfile.h b/MacOSX/codecs/include/vorbis/vorbisfile.h deleted file mode 100644 index 56626119..00000000 --- a/MacOSX/codecs/include/vorbis/vorbisfile.h +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: stdio-based convenience library for opening/seeking/decoding - - ********************************************************************/ - -#ifndef _OV_FILE_H_ -#define _OV_FILE_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include <stdio.h> -#include "codec.h" - -/* The function prototypes for the callbacks are basically the same as for - * the stdio functions fread, fseek, fclose, ftell. - * The one difference is that the FILE * arguments have been replaced with - * a void * - this is to be used as a pointer to whatever internal data these - * functions might need. In the stdio case, it's just a FILE * cast to a void * - * - * If you use other functions, check the docs for these functions and return - * the right values. For seek_func(), you *MUST* return -1 if the stream is - * unseekable - */ -typedef struct { - size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource); - int (*seek_func) (void *datasource, ogg_int64_t offset, int whence); - int (*close_func) (void *datasource); - long (*tell_func) (void *datasource); -} ov_callbacks; - -#ifndef OV_EXCLUDE_STATIC_CALLBACKS - -/* a few sets of convenient callbacks, especially for use under - * Windows where ov_open_callbacks() should always be used instead of - * ov_open() to avoid problems with incompatible crt.o version linking - * issues. */ - -static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){ - if(f==NULL)return(-1); - -#ifdef __MINGW32__ - return fseeko64(f,off,whence); -#elif defined (_WIN32) - return _fseeki64(f,off,whence); -#else - return fseek(f,off,whence); -#endif -} - -/* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as - * static data. That means that every file which includes this header - * will get its own copy of these structs whether it uses them or - * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS. - * These static symbols are essential on platforms such as Windows on - * which several different versions of stdio support may be linked to - * by different DLLs, and we need to be certain we know which one - * we're using (the same one as the main application). - */ - -static ov_callbacks OV_CALLBACKS_DEFAULT = { - (size_t (*)(void *, size_t, size_t, void *)) fread, - (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap, - (int (*)(void *)) fclose, - (long (*)(void *)) ftell -}; - -static ov_callbacks OV_CALLBACKS_NOCLOSE = { - (size_t (*)(void *, size_t, size_t, void *)) fread, - (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap, - (int (*)(void *)) NULL, - (long (*)(void *)) ftell -}; - -static ov_callbacks OV_CALLBACKS_STREAMONLY = { - (size_t (*)(void *, size_t, size_t, void *)) fread, - (int (*)(void *, ogg_int64_t, int)) NULL, - (int (*)(void *)) fclose, - (long (*)(void *)) NULL -}; - -static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = { - (size_t (*)(void *, size_t, size_t, void *)) fread, - (int (*)(void *, ogg_int64_t, int)) NULL, - (int (*)(void *)) NULL, - (long (*)(void *)) NULL -}; - -#endif - -#define NOTOPEN 0 -#define PARTOPEN 1 -#define OPENED 2 -#define STREAMSET 3 -#define INITSET 4 - -typedef struct OggVorbis_File { - void *datasource; /* Pointer to a FILE *, etc. */ - int seekable; - ogg_int64_t offset; - ogg_int64_t end; - ogg_sync_state oy; - - /* If the FILE handle isn't seekable (eg, a pipe), only the current - stream appears */ - int links; - ogg_int64_t *offsets; - ogg_int64_t *dataoffsets; - long *serialnos; - ogg_int64_t *pcmlengths; /* overloaded to maintain binary - compatibility; x2 size, stores both - beginning and end values */ - vorbis_info *vi; - vorbis_comment *vc; - - /* Decoding working state local storage */ - ogg_int64_t pcm_offset; - int ready_state; - long current_serialno; - int current_link; - - double bittrack; - double samptrack; - - ogg_stream_state os; /* take physical pages, weld into a logical - stream of packets */ - vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ - vorbis_block vb; /* local working space for packet->PCM decode */ - - ov_callbacks callbacks; - -} OggVorbis_File; - - -extern int ov_clear(OggVorbis_File *vf); -extern int ov_fopen(const char *path,OggVorbis_File *vf); -extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); -extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, - const char *initial, long ibytes, ov_callbacks callbacks); - -extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); -extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, - const char *initial, long ibytes, ov_callbacks callbacks); -extern int ov_test_open(OggVorbis_File *vf); - -extern long ov_bitrate(OggVorbis_File *vf,int i); -extern long ov_bitrate_instant(OggVorbis_File *vf); -extern long ov_streams(OggVorbis_File *vf); -extern long ov_seekable(OggVorbis_File *vf); -extern long ov_serialnumber(OggVorbis_File *vf,int i); - -extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i); -extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i); -extern double ov_time_total(OggVorbis_File *vf,int i); - -extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_time_seek(OggVorbis_File *vf,double pos); -extern int ov_time_seek_page(OggVorbis_File *vf,double pos); - -extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_time_seek_lap(OggVorbis_File *vf,double pos); -extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos); - -extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf); -extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf); -extern double ov_time_tell(OggVorbis_File *vf); - -extern vorbis_info *ov_info(OggVorbis_File *vf,int link); -extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link); - -extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples, - int *bitstream); -extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length, - int bigendianp,int word,int sgned,int *bitstream, - void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param); -extern long ov_read(OggVorbis_File *vf,char *buffer,int length, - int bigendianp,int word,int sgned,int *bitstream); -extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2); - -extern int ov_halfrate(OggVorbis_File *vf,int flag); -extern int ov_halfrate_p(OggVorbis_File *vf); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/MacOSX/codecs/include/xmp.h b/MacOSX/codecs/include/xmp.h deleted file mode 100644 index 8ec6deeb..00000000 --- a/MacOSX/codecs/include/xmp.h +++ /dev/null @@ -1,362 +0,0 @@ -#ifndef XMP_H -#define XMP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define XMP_VERSION "4.5.0" -#define XMP_VERCODE 0x040500 -#define XMP_VER_MAJOR 4 -#define XMP_VER_MINOR 5 -#define XMP_VER_RELEASE 0 - -#if defined(_WIN32) && !defined(__CYGWIN__) -# if defined(BUILDING_STATIC) -# define LIBXMP_EXPORT -# elif defined(BUILDING_DLL) -# define LIBXMP_EXPORT __declspec(dllexport) -# else -# define LIBXMP_EXPORT __declspec(dllimport) -# endif -#elif defined(__OS2__) && defined(__WATCOMC__) && defined(__SW_BD) -# define LIBXMP_EXPORT __declspec(dllexport) -#elif (defined(__GNUC__) || defined(__clang__) || defined(__HP_cc)) && defined(XMP_SYM_VISIBILITY) -# define LIBXMP_EXPORT __attribute__((visibility ("default"))) -#elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL) -# define LIBXMP_EXPORT __global -#elif defined(EMSCRIPTEN) -# define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE -#else -# define LIBXMP_EXPORT -#endif - -#define XMP_NAME_SIZE 64 /* Size of module name and type */ - -#define XMP_KEY_OFF 0x81 /* Note number for key off event */ -#define XMP_KEY_CUT 0x82 /* Note number for key cut event */ -#define XMP_KEY_FADE 0x83 /* Note number for fade event */ - -/* mixer parameter macros */ - -/* sample format flags */ -#define XMP_FORMAT_8BIT (1 << 0) /* Mix to 8-bit instead of 16 */ -#define XMP_FORMAT_UNSIGNED (1 << 1) /* Mix to unsigned samples */ -#define XMP_FORMAT_MONO (1 << 2) /* Mix to mono instead of stereo */ - -/* player parameters */ -#define XMP_PLAYER_AMP 0 /* Amplification factor */ -#define XMP_PLAYER_MIX 1 /* Stereo mixing */ -#define XMP_PLAYER_INTERP 2 /* Interpolation type */ -#define XMP_PLAYER_DSP 3 /* DSP effect flags */ -#define XMP_PLAYER_FLAGS 4 /* Player flags */ -#define XMP_PLAYER_CFLAGS 5 /* Player flags for current module */ -#define XMP_PLAYER_SMPCTL 6 /* Sample control flags */ -#define XMP_PLAYER_VOLUME 7 /* Player module volume */ -#define XMP_PLAYER_STATE 8 /* Internal player state (read only) */ -#define XMP_PLAYER_SMIX_VOLUME 9 /* SMIX volume */ -#define XMP_PLAYER_DEFPAN 10 /* Default pan setting */ -#define XMP_PLAYER_MODE 11 /* Player personality */ -#define XMP_PLAYER_MIXER_TYPE 12 /* Current mixer (read only) */ -#define XMP_PLAYER_VOICES 13 /* Maximum number of mixer voices */ - -/* interpolation types */ -#define XMP_INTERP_NEAREST 0 /* Nearest neighbor */ -#define XMP_INTERP_LINEAR 1 /* Linear (default) */ -#define XMP_INTERP_SPLINE 2 /* Cubic spline */ - -/* dsp effect types */ -#define XMP_DSP_LOWPASS (1 << 0) /* Lowpass filter effect */ -#define XMP_DSP_ALL (XMP_DSP_LOWPASS) - -/* player state */ -#define XMP_STATE_UNLOADED 0 /* Context created */ -#define XMP_STATE_LOADED 1 /* Module loaded */ -#define XMP_STATE_PLAYING 2 /* Module playing */ - -/* player flags */ -#define XMP_FLAGS_VBLANK (1 << 0) /* Use vblank timing */ -#define XMP_FLAGS_FX9BUG (1 << 1) /* Emulate FX9 bug */ -#define XMP_FLAGS_FIXLOOP (1 << 2) /* Emulate sample loop bug */ -#define XMP_FLAGS_A500 (1 << 3) /* Use Paula mixer in Amiga modules */ - -/* player modes */ -#define XMP_MODE_AUTO 0 /* Autodetect mode (default) */ -#define XMP_MODE_MOD 1 /* Play as a generic MOD player */ -#define XMP_MODE_NOISETRACKER 2 /* Play using Noisetracker quirks */ -#define XMP_MODE_PROTRACKER 3 /* Play using Protracker quirks */ -#define XMP_MODE_S3M 4 /* Play as a generic S3M player */ -#define XMP_MODE_ST3 5 /* Play using ST3 bug emulation */ -#define XMP_MODE_ST3GUS 6 /* Play using ST3+GUS quirks */ -#define XMP_MODE_XM 7 /* Play as a generic XM player */ -#define XMP_MODE_FT2 8 /* Play using FT2 bug emulation */ -#define XMP_MODE_IT 9 /* Play using IT quirks */ -#define XMP_MODE_ITSMP 10 /* Play using IT sample mode quirks */ - -/* mixer types */ -#define XMP_MIXER_STANDARD 0 /* Standard mixer */ -#define XMP_MIXER_A500 1 /* Amiga 500 */ -#define XMP_MIXER_A500F 2 /* Amiga 500 with led filter */ - -/* sample flags */ -#define XMP_SMPCTL_SKIP (1 << 0) /* Don't load samples */ - -/* limits */ -#define XMP_MAX_KEYS 121 /* Number of valid keys */ -#define XMP_MAX_ENV_POINTS 32 /* Max number of envelope points */ -#define XMP_MAX_MOD_LENGTH 256 /* Max number of patterns in module */ -#define XMP_MAX_CHANNELS 64 /* Max number of channels in module */ -#define XMP_MAX_SRATE 49170 /* max sampling rate (Hz) */ -#define XMP_MIN_SRATE 4000 /* min sampling rate (Hz) */ -#define XMP_MIN_BPM 20 /* min BPM */ -/* frame rate = (50 * bpm / 125) Hz */ -/* frame size = (sampling rate * channels * size) / frame rate */ -#define XMP_MAX_FRAMESIZE (5 * XMP_MAX_SRATE * 2 / XMP_MIN_BPM) - -/* error codes */ -#define XMP_END 1 -#define XMP_ERROR_INTERNAL 2 /* Internal error */ -#define XMP_ERROR_FORMAT 3 /* Unsupported module format */ -#define XMP_ERROR_LOAD 4 /* Error loading file */ -#define XMP_ERROR_DEPACK 5 /* Error depacking file */ -#define XMP_ERROR_SYSTEM 6 /* System error */ -#define XMP_ERROR_INVALID 7 /* Invalid parameter */ -#define XMP_ERROR_STATE 8 /* Invalid player state */ - -struct xmp_channel { - int pan; /* Channel pan (0x80 is center) */ - int vol; /* Channel volume */ -#define XMP_CHANNEL_SYNTH (1 << 0) /* Channel is synthesized */ -#define XMP_CHANNEL_MUTE (1 << 1) /* Channel is muted */ -#define XMP_CHANNEL_SPLIT (1 << 2) /* Split Amiga channel in bits 5-4 */ -#define XMP_CHANNEL_SURROUND (1 << 4) /* Surround channel */ - int flg; /* Channel flags */ -}; - -struct xmp_pattern { - int rows; /* Number of rows */ - int index[1]; /* Track index */ -}; - -struct xmp_event { - unsigned char note; /* Note number (0 means no note) */ - unsigned char ins; /* Patch number */ - unsigned char vol; /* Volume (0 to basevol) */ - unsigned char fxt; /* Effect type */ - unsigned char fxp; /* Effect parameter */ - unsigned char f2t; /* Secondary effect type */ - unsigned char f2p; /* Secondary effect parameter */ - unsigned char _flag; /* Internal (reserved) flags */ -}; - -struct xmp_track { - int rows; /* Number of rows */ - struct xmp_event event[1]; /* Event data */ -}; - -struct xmp_envelope { -#define XMP_ENVELOPE_ON (1 << 0) /* Envelope is enabled */ -#define XMP_ENVELOPE_SUS (1 << 1) /* Envelope has sustain point */ -#define XMP_ENVELOPE_LOOP (1 << 2) /* Envelope has loop */ -#define XMP_ENVELOPE_FLT (1 << 3) /* Envelope is used for filter */ -#define XMP_ENVELOPE_SLOOP (1 << 4) /* Envelope has sustain loop */ -#define XMP_ENVELOPE_CARRY (1 << 5) /* Don't reset envelope position */ - int flg; /* Flags */ - int npt; /* Number of envelope points */ - int scl; /* Envelope scaling */ - int sus; /* Sustain start point */ - int sue; /* Sustain end point */ - int lps; /* Loop start point */ - int lpe; /* Loop end point */ - short data[XMP_MAX_ENV_POINTS * 2]; -}; - -struct xmp_instrument { - char name[32]; /* Instrument name */ - int vol; /* Instrument volume */ - int nsm; /* Number of samples */ - int rls; /* Release (fadeout) */ - struct xmp_envelope aei; /* Amplitude envelope info */ - struct xmp_envelope pei; /* Pan envelope info */ - struct xmp_envelope fei; /* Frequency envelope info */ - - struct { - unsigned char ins; /* Instrument number for each key */ - signed char xpo; /* Instrument transpose for each key */ - } map[XMP_MAX_KEYS]; - - struct xmp_subinstrument { - int vol; /* Default volume */ - int gvl; /* Global volume */ - int pan; /* Pan */ - int xpo; /* Transpose */ - int fin; /* Finetune */ - int vwf; /* Vibrato waveform */ - int vde; /* Vibrato depth */ - int vra; /* Vibrato rate */ - int vsw; /* Vibrato sweep */ - int rvv; /* Random volume/pan variation (IT) */ - int sid; /* Sample number */ -#define XMP_INST_NNA_CUT 0x00 -#define XMP_INST_NNA_CONT 0x01 -#define XMP_INST_NNA_OFF 0x02 -#define XMP_INST_NNA_FADE 0x03 - int nna; /* New note action */ -#define XMP_INST_DCT_OFF 0x00 -#define XMP_INST_DCT_NOTE 0x01 -#define XMP_INST_DCT_SMP 0x02 -#define XMP_INST_DCT_INST 0x03 - int dct; /* Duplicate check type */ -#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT -#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF -#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE - int dca; /* Duplicate check action */ - int ifc; /* Initial filter cutoff */ - int ifr; /* Initial filter resonance */ - } *sub; - - void *extra; /* Extra fields */ -}; - -struct xmp_sample { - char name[32]; /* Sample name */ - int len; /* Sample length */ - int lps; /* Loop start */ - int lpe; /* Loop end */ -#define XMP_SAMPLE_16BIT (1 << 0) /* 16bit sample */ -#define XMP_SAMPLE_LOOP (1 << 1) /* Sample is looped */ -#define XMP_SAMPLE_LOOP_BIDIR (1 << 2) /* Bidirectional sample loop */ -#define XMP_SAMPLE_LOOP_REVERSE (1 << 3) /* Backwards sample loop */ -#define XMP_SAMPLE_LOOP_FULL (1 << 4) /* Play full sample before looping */ -#define XMP_SAMPLE_SLOOP (1 << 5) /* Sample has sustain loop */ -#define XMP_SAMPLE_SLOOP_BIDIR (1 << 6) /* Bidirectional sustain loop */ -#define XMP_SAMPLE_SYNTH (1 << 15) /* Data contains synth patch */ - int flg; /* Flags */ - unsigned char *data; /* Sample data */ -}; - -struct xmp_sequence { - int entry_point; - int duration; -}; - -struct xmp_module { - char name[XMP_NAME_SIZE]; /* Module title */ - char type[XMP_NAME_SIZE]; /* Module format */ - int pat; /* Number of patterns */ - int trk; /* Number of tracks */ - int chn; /* Tracks per pattern */ - int ins; /* Number of instruments */ - int smp; /* Number of samples */ - int spd; /* Initial speed */ - int bpm; /* Initial BPM */ - int len; /* Module length in patterns */ - int rst; /* Restart position */ - int gvl; /* Global volume */ - - struct xmp_pattern **xxp; /* Patterns */ - struct xmp_track **xxt; /* Tracks */ - struct xmp_instrument *xxi; /* Instruments */ - struct xmp_sample *xxs; /* Samples */ - struct xmp_channel xxc[XMP_MAX_CHANNELS]; /* Channel info */ - unsigned char xxo[XMP_MAX_MOD_LENGTH]; /* Orders */ -}; - -struct xmp_test_info { - char name[XMP_NAME_SIZE]; /* Module title */ - char type[XMP_NAME_SIZE]; /* Module format */ -}; - -struct xmp_module_info { - unsigned char md5[16]; /* MD5 message digest */ - int vol_base; /* Volume scale */ - struct xmp_module *mod; /* Pointer to module data */ - char *comment; /* Comment text, if any */ - int num_sequences; /* Number of valid sequences */ - struct xmp_sequence *seq_data; /* Pointer to sequence data */ -}; - -struct xmp_frame_info { /* Current frame information */ - int pos; /* Current position */ - int pattern; /* Current pattern */ - int row; /* Current row in pattern */ - int num_rows; /* Number of rows in current pattern */ - int frame; /* Current frame */ - int speed; /* Current replay speed */ - int bpm; /* Current bpm */ - int time; /* Current module time in ms */ - int total_time; /* Estimated replay time in ms*/ - int frame_time; /* Frame replay time in us */ - void *buffer; /* Pointer to sound buffer */ - int buffer_size; /* Used buffer size */ - int total_size; /* Total buffer size */ - int volume; /* Current master volume */ - int loop_count; /* Loop counter */ - int virt_channels; /* Number of virtual channels */ - int virt_used; /* Used virtual channels */ - int sequence; /* Current sequence */ - - struct xmp_channel_info { /* Current channel information */ - unsigned int period; /* Sample period (* 4096) */ - unsigned int position; /* Sample position */ - short pitchbend; /* Linear bend from base note*/ - unsigned char note; /* Current base note number */ - unsigned char instrument; /* Current instrument number */ - unsigned char sample; /* Current sample number */ - unsigned char volume; /* Current volume */ - unsigned char pan; /* Current stereo pan */ - unsigned char reserved; /* Reserved */ - struct xmp_event event; /* Current track event */ - } channel_info[XMP_MAX_CHANNELS]; -}; - - -typedef char *xmp_context; - -LIBXMP_EXPORT extern const char *xmp_version; -LIBXMP_EXPORT extern const unsigned int xmp_vercode; - -LIBXMP_EXPORT xmp_context xmp_create_context (void); -LIBXMP_EXPORT void xmp_free_context (xmp_context); -LIBXMP_EXPORT int xmp_test_module (char *, struct xmp_test_info *); -LIBXMP_EXPORT int xmp_load_module (xmp_context, char *); -LIBXMP_EXPORT void xmp_scan_module (xmp_context); -LIBXMP_EXPORT void xmp_release_module (xmp_context); -LIBXMP_EXPORT int xmp_start_player (xmp_context, int, int); -LIBXMP_EXPORT int xmp_play_frame (xmp_context); -LIBXMP_EXPORT int xmp_play_buffer (xmp_context, void *, int, int); -LIBXMP_EXPORT void xmp_get_frame_info (xmp_context, struct xmp_frame_info *); -LIBXMP_EXPORT void xmp_end_player (xmp_context); -LIBXMP_EXPORT void xmp_inject_event (xmp_context, int, struct xmp_event *); -LIBXMP_EXPORT void xmp_get_module_info (xmp_context, struct xmp_module_info *); -LIBXMP_EXPORT char **xmp_get_format_list (void); -LIBXMP_EXPORT int xmp_next_position (xmp_context); -LIBXMP_EXPORT int xmp_prev_position (xmp_context); -LIBXMP_EXPORT int xmp_set_position (xmp_context, int); -LIBXMP_EXPORT int xmp_set_row (xmp_context, int); -LIBXMP_EXPORT int xmp_set_tempo_factor(xmp_context, double); -LIBXMP_EXPORT void xmp_stop_module (xmp_context); -LIBXMP_EXPORT void xmp_restart_module (xmp_context); -LIBXMP_EXPORT int xmp_seek_time (xmp_context, int); -LIBXMP_EXPORT int xmp_channel_mute (xmp_context, int, int); -LIBXMP_EXPORT int xmp_channel_vol (xmp_context, int, int); -LIBXMP_EXPORT int xmp_set_player (xmp_context, int, int); -LIBXMP_EXPORT int xmp_get_player (xmp_context, int); -LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, char *); -LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, void *, long); -LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); - -/* External sample mixer API */ -LIBXMP_EXPORT int xmp_start_smix (xmp_context, int, int); -LIBXMP_EXPORT void xmp_end_smix (xmp_context); -LIBXMP_EXPORT int xmp_smix_play_instrument(xmp_context, int, int, int, int); -LIBXMP_EXPORT int xmp_smix_play_sample (xmp_context, int, int, int, int); -LIBXMP_EXPORT int xmp_smix_channel_pan (xmp_context, int, int); -LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, char *); -LIBXMP_EXPORT int xmp_smix_release_sample (xmp_context, int); - -#ifdef __cplusplus -} -#endif - -#endif /* XMP_H */ diff --git a/MacOSX/codecs/lib/libFLAC.dylib b/MacOSX/codecs/lib/libFLAC.dylib deleted file mode 100644 index face0420..00000000 Binary files a/MacOSX/codecs/lib/libFLAC.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libmad.dylib b/MacOSX/codecs/lib/libmad.dylib deleted file mode 100644 index 98f98d98..00000000 Binary files a/MacOSX/codecs/lib/libmad.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libmikmod.dylib b/MacOSX/codecs/lib/libmikmod.dylib deleted file mode 100644 index e28462c8..00000000 Binary files a/MacOSX/codecs/lib/libmikmod.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libmodplug.dylib b/MacOSX/codecs/lib/libmodplug.dylib deleted file mode 100644 index 46a29aff..00000000 Binary files a/MacOSX/codecs/lib/libmodplug.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libmpg123.dylib b/MacOSX/codecs/lib/libmpg123.dylib deleted file mode 100644 index 951f8460..00000000 Binary files a/MacOSX/codecs/lib/libmpg123.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libogg.dylib b/MacOSX/codecs/lib/libogg.dylib deleted file mode 100644 index 44374f4a..00000000 Binary files a/MacOSX/codecs/lib/libogg.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libopus.dylib b/MacOSX/codecs/lib/libopus.dylib deleted file mode 100644 index 2bf789c2..00000000 Binary files a/MacOSX/codecs/lib/libopus.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libopusfile.dylib b/MacOSX/codecs/lib/libopusfile.dylib deleted file mode 100644 index c3abf290..00000000 Binary files a/MacOSX/codecs/lib/libopusfile.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libvorbis.dylib b/MacOSX/codecs/lib/libvorbis.dylib deleted file mode 100644 index 06575941..00000000 Binary files a/MacOSX/codecs/lib/libvorbis.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libvorbisfile.dylib b/MacOSX/codecs/lib/libvorbisfile.dylib deleted file mode 100644 index a355dc51..00000000 Binary files a/MacOSX/codecs/lib/libvorbisfile.dylib and /dev/null differ diff --git a/MacOSX/codecs/lib/libxmp.dylib b/MacOSX/codecs/lib/libxmp.dylib deleted file mode 100644 index ef0d97fa..00000000 Binary files a/MacOSX/codecs/lib/libxmp.dylib and /dev/null differ diff --git a/QC/ai.qc b/QC/ai.qc index 557fceb7..c4f4f667 100644 --- a/QC/ai.qc +++ b/QC/ai.qc @@ -1,9 +1,3 @@ -void() movetarget_f; -void() t_movetarget; -void() knight_walk1; -void() knight_bow6; -void() knight_bow1; -void(entity etemp, entity stemp, entity stemp, float dmg) T_Damage; /* .enemy @@ -38,7 +32,6 @@ walkmove(angle, speed) primitive is all or nothing // entity sight_entity; float sight_entity_time; -void() FoundTarget; float(float v) anglemod = { @@ -47,7 +40,7 @@ float(float v) anglemod = while(v < 0) v = v + 360; return v; -}; +} /* ============================================================================== @@ -76,9 +69,9 @@ void() movetarget_f = self.solid = SOLID_TRIGGER; self.touch = t_movetarget; - setsize (self, '-8 -8 -8', '8 8 8'); + setsize(self, '-8 -8 -8', '8 8 8'); -}; +} /*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) Monsters will continue walking towards the next target corner. @@ -87,7 +80,7 @@ Monsters will continue walking towards the next target corner. void() path_corner = { movetarget_f(); -}; +} /* @@ -100,7 +93,7 @@ moving towards it, change the next destination and continue. */ void() t_movetarget = { -local entity temp; +entity temp; if(other.movetarget != self) return; @@ -115,11 +108,11 @@ local entity temp; if(self.classname == "monster_ogre") sound(self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound -//dprint ("t_movetarget\n"); +//dprint("t_movetarget\n"); //MED - if(other.target) + if(other.target != NULLSTR) { - self.goalentity = self.movetarget = find (world, targetname, other.target); + self.goalentity = self.movetarget = find(world, targetname, other.target); self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); if(!self.movetarget) { @@ -140,7 +133,7 @@ local entity temp; self.th_stand(); return; } -}; +} //MED 01/20/97 @@ -155,13 +148,14 @@ moving towards it, change the next destination and continue. */ void() t_followtarget = { - local entity temp; - local vector spot1, spot2; - local entity targ; - local entity client; + entity temp; + vector spot1, spot2; + entity targ; + entity client; - if(!other.flags & FL_MONSTER) + if(!(other.flags & FL_MONSTER)) return; + if(other.classname == "monster_decoy") return; // if(other.enemy == world) @@ -190,7 +184,7 @@ void() t_followtarget = self = other; other = temp; - self.goalentity = self.movetarget = find (world, targetname, other.target); + self.goalentity = self.movetarget = find(world, targetname, other.target); /* bprint("target "); bprint(other.target); @@ -232,11 +226,11 @@ void() followtarget_f = self.solid = SOLID_TRIGGER; self.touch = t_followtarget; - setmodel (self, self.model); // set size and link into world + setmodel(self, self.model); // set size and link into world self.movetype = MOVETYPE_NONE; self.modelindex = 0; self.model = ""; -// setsize (self, '-8 -8 -8', '8 8 8'); +// setsize(self, '-8 -8 -8', '8 8 8'); }; @@ -257,7 +251,7 @@ void() path_follow2 = { self.solid = SOLID_TRIGGER; self.touch = t_followtarget; - setsize (self, '-8 -8 -8', '8 8 8'); + setsize(self, '-8 -8 -8', '8 8 8'); }; @@ -276,20 +270,30 @@ returns the range catagorization of an entity reletive to self */ float(entity targ) range = { -local vector spot1, spot2; -local float r; + vector spot1, spot2; + float r; + float scale; // HONEY. + spot1 = self.origin + self.view_ofs; spot2 = targ.origin + targ.view_ofs; - r = vlen (spot1 - spot2); + r = vlen(spot1 - spot2); + + // HONEY. + if(self.rangescale) { scale = self.rangescale; } + else { scale = 1; } + if(r < 120) return RANGE_MELEE; + if(r < 500) return RANGE_NEAR; - if(r < 1000) + + if(r < 1000 * scale) return RANGE_MID; + return RANGE_FAR; -}; +} /* ============= @@ -298,25 +302,16 @@ visible returns 1 if the entity is visible to self, even if not infront () ============= */ -float (entity targ) visible = +float (entity client) visible = { - local vector spot1, spot2; + vector spot1, spot2; spot1 = self.origin + self.view_ofs; - spot2 = targ.origin + targ.view_ofs; - traceline(spot1, spot2, TRUE, self); // see through other monsters - - if(trace_inopen && trace_inwater) - return FALSE; // sight line crossed contents + spot2 = client.origin + client.view_ofs; -//MED 11/21/96 - if(trace_fraction == 1) - { - visible_distance = vlen(spot2-spot1); - return TRUE; - } - return FALSE; -}; + if(self.spawnflags & SPAWNFLAG_SF_AI_BBOX_CHECK) { return bbox_visible(self, spot2); } + else { return point_visible(spot1, spot2); } +} /* @@ -328,17 +323,18 @@ returns 1 if the entity is in front (in sight) of self */ float(entity targ) infront = { - local vector vec; - local float dot; + vector vec; + float dot; - makevectors (self.angles); - vec = normalize (targ.origin - self.origin); + makevectors(self.angles); + vec = normalize(targ.origin - self.origin); dot = vec * v_forward; - if( dot > 0.3) + if(dot > 0.3) { return TRUE; } + return FALSE; }; @@ -350,8 +346,8 @@ float(entity targ) infront = //============================================================================ void() UpdateCharmerGoal = { - local entity targ; - local vector d; + entity targ; + vector d; d = normalize(self.origin-self.charmer.origin); @@ -421,7 +417,19 @@ void() StopHuntingCharmer = void() HuntTarget = { self.goalentity = self.enemy; - self.think = self.th_run; + + // HONEY + // cg: tarbabies can now spawn really angry and start jumping around + // without even having a clear view of player + if(self.classname == "monster_tarbaby" && self.spawnflags & SPAWNFLAG_TBABY_LIVID) + { + self.think = self.th_missile; + } + else + { + self.think = self.th_run; + } + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); self.nextthink = time + 0.1; SUB_AttackFinished (1); // wait a while before first attack @@ -429,12 +437,22 @@ void() HuntTarget = void() SightSound = { -local float rsnd; + float rsnd; + + // HONEY + if(self.spawnflags & SPAWNFLAG_SF_SILENT_WAKEUP) + { + return; + } if(self.classname == "monster_ogre") sound(self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM); else if(self.classname == "monster_knight") - sound(self, CHAN_VOICE, "knight/ksight.wav", 1, ATTN_NORM); + { + // ROGUE + if(self.skin == 0) + sound(self, CHAN_VOICE, "knight/ksight.wav", 1, ATTN_NORM); + } else if(self.classname == "monster_shambler") sound(self, CHAN_VOICE, "shambler/ssight.wav", 1, ATTN_NORM); else if(self.classname == "monster_demon1") @@ -447,6 +465,7 @@ local float rsnd; sound(self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM); else if(self.classname == "monster_hell_knight") { + // ROGUE if(self.skin == 0) sound(self, CHAN_VOICE, "hknight/sight1.wav", 1, ATTN_NORM); } @@ -454,18 +473,16 @@ local float rsnd; sound(self, CHAN_VOICE, "blob/sight1.wav", 1, ATTN_NORM); else if(self.classname == "monster_vomit") { - // TODO VR: (P2) unused? (commented to avoid warnings) + // Unused. // sound(self, CHAN_VOICE, "vomitus/v_sight1.wav", 1, ATTN_NORM); } else if(self.classname == "monster_eel") { - // TODO VR: (P2) unused? (commented to avoid warnings) - // sound(self, CHAN_VOICE, "eel/eelc5.wav", 1, ATTN_NORM); + sound(self, CHAN_VOICE, "eel/eelc5.wav", 1, ATTN_NORM); } else if(self.classname == "monster_wrath") { - // TODO VR: (P2) unused? (commented to avoid warnings) - // sound(self, CHAN_VOICE, "wrath/wsee.wav", 1, ATTN_NORM); + sound(self, CHAN_VOICE, "wrath/wsee.wav", 1, ATTN_NORM); } else if(self.classname == "monster_enforcer") { @@ -497,8 +514,7 @@ local float rsnd; sound(self, CHAN_VOICE, "armagon/sight.wav", 1, 0.1); else if(self.classname == "monster_dragon") { - // TODO VR: (P2) unused? (commented to avoid warnings) - // sound(self, CHAN_VOICE, "dragon/see.wav", 1, ATTN_NORM); + sound(self, CHAN_VOICE, "dragon/see.wav", 1, ATTN_NORM); } }; @@ -553,8 +569,8 @@ slower noticing monsters. */ float() FindTarget = { - local entity client; - local float r; + entity client; + float r; // if the first spawnflag bit is set, the monster will only wake up on // really seeing the player, not another monster getting angry @@ -582,14 +598,14 @@ float() FindTarget = return TRUE; } } - else if(vlen (self.origin - self.charmer.origin) > MAX_CHARMER_DISTANCE) + else if(vlen(self.origin - self.charmer.origin) > MAX_CHARMER_DISTANCE) { // self.huntingcharmer = 1; // dprint("hunting\n"); HuntCharmer(); return FALSE; } - else if(vlen (self.origin - self.charmer.origin) < TOOCLOSE_CHARMER_DISTANCE) + else if(vlen(self.origin - self.charmer.origin) < TOOCLOSE_CHARMER_DISTANCE) { // self.huntingcharmer = 1; // dprint("fleeing\n"); @@ -597,7 +613,7 @@ float() FindTarget = return FALSE; } } - if(sight_entity_time >= time - 0.1 && !(self.spawnflags & 3) && !(self.charmed) ) + if(sight_entity_time >= time - 0.1 && !(self.spawnflags & 3) && !(self.charmed)) { client = sight_entity; if(client.enemy == self.enemy) @@ -606,9 +622,9 @@ float() FindTarget = //MED 10/17/96 added charmed clause else if(self.charmed) { - local entity head; - local entity selected; - local float dist; + entity head; + entity selected; + float dist; selected = world; dist = CHARMED_RADIUS; @@ -649,11 +665,12 @@ float() FindTarget = if(client.flags & FL_NOTARGET) return FALSE; } - if(client.items & IT_INVISIBILITY) + + if(VR_ItemUtil_EntHasItem(client, IID_INVISIBILITY)) return FALSE; r = range (client); - if(r == RANGE_FAR) + if(r == RANGE_FAR && /* HONEY */ self.classname != "monster_ogre_marksman") // can see really far return FALSE; if(!visible (client)) @@ -669,7 +686,7 @@ float() FindTarget = } else if(r == RANGE_MID) { - if( /* client.show_hostile < time || */ !infront (client)) + if(/* client.show_hostile < time || */ !infront (client)) return FALSE; } } @@ -693,9 +710,11 @@ float() FindTarget = } } -// PGM hack + // PGM hack if(self.classname != "dragon") + { FoundTarget(); + } return TRUE; }; @@ -705,12 +724,12 @@ float() FindTarget = void(float dist) ai_forward = { - walkmove (self.angles_y, dist); + walkmove(self.angles_y, dist); }; void(float dist) ai_back = { - walkmove ( (self.angles_y+180), dist); + walkmove((self.angles_y+180), dist); }; @@ -725,12 +744,12 @@ void(float dist) ai_pain = { ai_back (dist); /* - local float away; + float away; away = anglemod (vectoyaw (self.origin - self.enemy.origin) - + 180*(random()- 0.5) ); + + 180*(random()- 0.5)); - walkmove (away, dist); + walkmove(away, dist); */ }; @@ -743,7 +762,7 @@ stagger back a bit */ void(float dist) ai_painforward = { - walkmove (self.ideal_yaw, dist); + walkmove(self.ideal_yaw, dist); }; /* @@ -821,7 +840,7 @@ don't move, but turn towards ideal_yaw */ void() ai_turn_in_place = { - local float delta; + float delta; self.nextthink = time + 0.1; enemy_yaw = vectoyaw(self.enemy.origin - self.origin); @@ -846,7 +865,7 @@ ChooseTurn */ void(vector dest3) ChooseTurn = { - local vector dir, newdir; + vector dir, newdir; dir = self.origin - dest3; @@ -877,7 +896,7 @@ FacingIdeal */ float() FacingIdeal = { - local float delta; + float delta; delta = anglemod(self.angles_y - self.ideal_yaw); if(delta > 45 && delta < 315) @@ -899,25 +918,38 @@ float() CheckAnyAttack = { if(!enemy_vis) return FALSE; - if(self.classname == "monster_army") + + if(self.classname == "monster_army") return SoldierCheckAttack(); - if(self.classname == "monster_ogre") + + if(self.classname == "monster_ogre") return OgreCheckAttack(); - if(self.classname == "monster_shambler") + + if(self.classname == "monster_ogre_marksman") + return OgreMarksmanCheckAttack(); + + if(self.classname == "monster_shambler") return ShamCheckAttack(); + if(self.classname == "monster_demon1") return DemonCheckAttack(); + if(self.classname == "monster_dog") return DogCheckAttack(); + if(self.classname == "monster_wizard") return WizardCheckAttack(); - if(self.classname == "monster_gremlin") - return GremlinCheckAttack(); - if(self.classname == "monster_scourge") - return ScourgeCheckAttack(); - if(self.classname == "monster_armagon") - return ArmagonCheckAttack(); - return CheckAttack(); + + if(self.classname == "monster_gremlin") + return GremlinCheckAttack(); + + if(self.classname == "monster_scourge") + return ScourgeCheckAttack(); + + if(self.classname == "monster_armagon") + return ArmagonCheckAttack(); + + return CheckAttack(); }; @@ -969,7 +1001,7 @@ Strafe sideways, but stay at aproximately the same range */ void() ai_run_slide = { - local float ofs; + float ofs; self.ideal_yaw = enemy_yaw; ChangeYaw(); @@ -978,12 +1010,12 @@ void() ai_run_slide = else ofs = -90; - if(walkmove (self.ideal_yaw + ofs, movedist)) + if(walkmove(self.ideal_yaw + ofs, movedist)) return; self.lefty = 1 - self.lefty; - walkmove (self.ideal_yaw - ofs, movedist); + walkmove(self.ideal_yaw - ofs, movedist); }; //MED @@ -997,8 +1029,8 @@ Used by the Scourge. */ void() ai_run_dodge = { - local float ofs; - local float newyaw; + float ofs; + float newyaw; self.nextthink = time + 0.1; if(self.lefty) @@ -1014,7 +1046,7 @@ void() ai_run_dodge = newyaw = enemy_yaw + ofs; self.ideal_yaw = enemy_yaw; - if(walkmove (newyaw, movedist)) + if(walkmove(newyaw, movedist)) { ChangeYaw(); return; @@ -1024,7 +1056,7 @@ void() ai_run_dodge = self.ltime = time + 0.8; newyaw = enemy_yaw - ofs; self.ideal_yaw = enemy_yaw; - walkmove (newyaw, movedist); + walkmove(newyaw, movedist); ChangeYaw(); }; @@ -1038,7 +1070,7 @@ The monster has an enemy it is trying to kill float RUN_STRAIGHT; void(float dist) ai_run = { - local float axis; + float axis; movedist = dist; // see if the enemy is dead @@ -1088,7 +1120,7 @@ void(float dist) ai_run = //MED if(self.th_turn) { - local float angledelta; + float angledelta; angledelta = fabs(self.angles_y - enemy_yaw); if(angledelta > MIN_ANGLE_DELTA) @@ -1100,13 +1132,13 @@ void(float dist) ai_run = if(self.attack_state == AS_MISSILE) { -//dprint ("ai_run_missile\n"); +//dprint("ai_run_missile\n"); ai_run_missile(); return; } if(self.attack_state == AS_MELEE) { -//dprint ("ai_run_melee\n"); +//dprint("ai_run_melee\n"); ai_run_melee(); return; } @@ -1132,7 +1164,7 @@ void(float dist) ai_run = if(RUN_STRAIGHT && time > self.endtime) { RUN_STRAIGHT = 0; - axis = walkmove (self.angles_y, movedist); + axis = walkmove(self.angles_y, movedist); if(!axis) { self.endtime = time + 3; diff --git a/QC/boss.qc b/QC/boss.qc deleted file mode 100644 index 3321977d..00000000 --- a/QC/boss.qc +++ /dev/null @@ -1,410 +0,0 @@ -/* -============================================================================== - -BOSS-ONE - -============================================================================== -*/ -$cd id1/models/boss1 -$origin 0 0 -15 -$base base -$skin skin -$scale 5 - -$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 -$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 -$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 -$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 -$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 - -$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 -$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 -$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 -$frame attack23 - -$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 -$frame shocka9 shocka10 - -$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 - -$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 -$frame shockc9 shockc10 - - -void(float r, vector p) boss_missile; - -void() boss_face = -{ - -// go for another player if multi player - if(self.enemy.health <= 0 || random() < 0.02) - { - self.enemy = find(self.enemy, classname, "player"); - if(!self.enemy) - self.enemy = find(self.enemy, classname, "player"); - } - ai_face(); -}; - -void() boss_rise1 =[ $rise1, boss_rise2 ] { -sound(self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM); -}; -void() boss_rise2 =[ $rise2, boss_rise3 ] { -sound(self, CHAN_VOICE, "boss1/sight1.wav", 1, ATTN_NORM); -}; -void() boss_rise3 =[ $rise3, boss_rise4 ] {}; -void() boss_rise4 =[ $rise4, boss_rise5 ] {}; -void() boss_rise5 =[ $rise5, boss_rise6 ] {}; -void() boss_rise6 =[ $rise6, boss_rise7 ] {}; -void() boss_rise7 =[ $rise7, boss_rise8 ] {}; -void() boss_rise8 =[ $rise8, boss_rise9 ] {}; -void() boss_rise9 =[ $rise9, boss_rise10 ] {}; -void() boss_rise10 =[ $rise10, boss_rise11 ] {}; -void() boss_rise11 =[ $rise11, boss_rise12 ] {}; -void() boss_rise12 =[ $rise12, boss_rise13 ] {}; -void() boss_rise13 =[ $rise13, boss_rise14 ] {}; -void() boss_rise14 =[ $rise14, boss_rise15 ] {}; -void() boss_rise15 =[ $rise15, boss_rise16 ] {}; -void() boss_rise16 =[ $rise16, boss_rise17 ] {}; -void() boss_rise17 =[ $rise17, boss_missile1 ] {}; - -void() boss_idle1 =[ $walk1, boss_idle2 ] -{ -// look for other players -}; -void() boss_idle2 =[ $walk2, boss_idle3 ] {boss_face();}; -void() boss_idle3 =[ $walk3, boss_idle4 ] {boss_face();}; -void() boss_idle4 =[ $walk4, boss_idle5 ] {boss_face();}; -void() boss_idle5 =[ $walk5, boss_idle6 ] {boss_face();}; -void() boss_idle6 =[ $walk6, boss_idle7 ] {boss_face();}; -void() boss_idle7 =[ $walk7, boss_idle8 ] {boss_face();}; -void() boss_idle8 =[ $walk8, boss_idle9 ] {boss_face();}; -void() boss_idle9 =[ $walk9, boss_idle10 ] {boss_face();}; -void() boss_idle10 =[ $walk10, boss_idle11 ] {boss_face();}; -void() boss_idle11 =[ $walk11, boss_idle12 ] {boss_face();}; -void() boss_idle12 =[ $walk12, boss_idle13 ] {boss_face();}; -void() boss_idle13 =[ $walk13, boss_idle14 ] {boss_face();}; -void() boss_idle14 =[ $walk14, boss_idle15 ] {boss_face();}; -void() boss_idle15 =[ $walk15, boss_idle16 ] {boss_face();}; -void() boss_idle16 =[ $walk16, boss_idle17 ] {boss_face();}; -void() boss_idle17 =[ $walk17, boss_idle18 ] {boss_face();}; -void() boss_idle18 =[ $walk18, boss_idle19 ] {boss_face();}; -void() boss_idle19 =[ $walk19, boss_idle20 ] {boss_face();}; -void() boss_idle20 =[ $walk20, boss_idle21 ] {boss_face();}; -void() boss_idle21 =[ $walk21, boss_idle22 ] {boss_face();}; -void() boss_idle22 =[ $walk22, boss_idle23 ] {boss_face();}; -void() boss_idle23 =[ $walk23, boss_idle24 ] {boss_face();}; -void() boss_idle24 =[ $walk24, boss_idle25 ] {boss_face();}; -void() boss_idle25 =[ $walk25, boss_idle26 ] {boss_face();}; -void() boss_idle26 =[ $walk26, boss_idle27 ] {boss_face();}; -void() boss_idle27 =[ $walk27, boss_idle28 ] {boss_face();}; -void() boss_idle28 =[ $walk28, boss_idle29 ] {boss_face();}; -void() boss_idle29 =[ $walk29, boss_idle30 ] {boss_face();}; -void() boss_idle30 =[ $walk30, boss_idle31 ] {boss_face();}; -void() boss_idle31 =[ $walk31, boss_idle1 ] {boss_face();}; - -void() boss_missile1 =[ $attack1, boss_missile2 ] {boss_face();}; -void() boss_missile2 =[ $attack2, boss_missile3 ] {boss_face();}; -void() boss_missile3 =[ $attack3, boss_missile4 ] {boss_face();}; -void() boss_missile4 =[ $attack4, boss_missile5 ] {boss_face();}; -void() boss_missile5 =[ $attack5, boss_missile6 ] {boss_face();}; -void() boss_missile6 =[ $attack6, boss_missile7 ] {boss_face();}; -void() boss_missile7 =[ $attack7, boss_missile8 ] {boss_face();}; -void() boss_missile8 =[ $attack8, boss_missile9 ] {boss_face();}; -void() boss_missile9 =[ $attack9, boss_missile10 ] {boss_missile(0, '100 100 200');}; -void() boss_missile10 =[ $attack10, boss_missile11 ] {boss_face();}; -void() boss_missile11 =[ $attack11, boss_missile12 ] {boss_face();}; -void() boss_missile12 =[ $attack12, boss_missile13 ] {boss_face();}; -void() boss_missile13 =[ $attack13, boss_missile14 ] {boss_face();}; -void() boss_missile14 =[ $attack14, boss_missile15 ] {boss_face();}; -void() boss_missile15 =[ $attack15, boss_missile16 ] {boss_face();}; -void() boss_missile16 =[ $attack16, boss_missile17 ] {boss_face();}; -void() boss_missile17 =[ $attack17, boss_missile18 ] {boss_face();}; -void() boss_missile18 =[ $attack18, boss_missile19 ] {boss_face();}; -void() boss_missile19 =[ $attack19, boss_missile20 ] {boss_face();}; -void() boss_missile20 =[ $attack20, boss_missile21 ] {boss_missile(0, '100 -100 200');}; -void() boss_missile21 =[ $attack21, boss_missile22 ] {boss_face();}; -void() boss_missile22 =[ $attack22, boss_missile23 ] {boss_missile(1, '100 -100 200');}; -void() boss_missile23 =[ $attack23, boss_missile1 ] {boss_face();}; - -void() boss_shocka1 =[ $shocka1, boss_shocka2 ] {}; -void() boss_shocka2 =[ $shocka2, boss_shocka3 ] {}; -void() boss_shocka3 =[ $shocka3, boss_shocka4 ] {}; -void() boss_shocka4 =[ $shocka4, boss_shocka5 ] {}; -void() boss_shocka5 =[ $shocka5, boss_shocka6 ] {}; -void() boss_shocka6 =[ $shocka6, boss_shocka7 ] {}; -void() boss_shocka7 =[ $shocka7, boss_shocka8 ] {}; -void() boss_shocka8 =[ $shocka8, boss_shocka9 ] {}; -void() boss_shocka9 =[ $shocka9, boss_shocka10 ] {}; -void() boss_shocka10 =[ $shocka10, boss_missile1 ] {}; - -void() boss_shockb1 =[ $shockb1, boss_shockb2 ] {}; -void() boss_shockb2 =[ $shockb2, boss_shockb3 ] {}; -void() boss_shockb3 =[ $shockb3, boss_shockb4 ] {}; -void() boss_shockb4 =[ $shockb4, boss_shockb5 ] {}; -void() boss_shockb5 =[ $shockb5, boss_shockb6 ] {}; -void() boss_shockb6 =[ $shockb6, boss_shockb7 ] {}; -void() boss_shockb7 =[ $shockb1, boss_shockb8 ] {}; -void() boss_shockb8 =[ $shockb2, boss_shockb9 ] {}; -void() boss_shockb9 =[ $shockb3, boss_shockb10 ] {}; -void() boss_shockb10 =[ $shockb4, boss_missile1 ] {}; - -void() boss_shockc1 =[ $shockc1, boss_shockc2 ] {}; -void() boss_shockc2 =[ $shockc2, boss_shockc3 ] {}; -void() boss_shockc3 =[ $shockc3, boss_shockc4 ] {}; -void() boss_shockc4 =[ $shockc4, boss_shockc5 ] {}; -void() boss_shockc5 =[ $shockc5, boss_shockc6 ] {}; -void() boss_shockc6 =[ $shockc6, boss_shockc7 ] {}; -void() boss_shockc7 =[ $shockc7, boss_shockc8 ] {}; -void() boss_shockc8 =[ $shockc8, boss_shockc9 ] {}; -void() boss_shockc9 =[ $shockc9, boss_shockc10 ] {}; -void() boss_shockc10 =[ $shockc10, boss_death1 ] {}; - -void() boss_death1 = [$death1, boss_death2] { -sound(self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM); -}; -void() boss_death2 = [$death2, boss_death3] {}; -void() boss_death3 = [$death3, boss_death4] {}; -void() boss_death4 = [$death4, boss_death5] {}; -void() boss_death5 = [$death5, boss_death6] {}; -void() boss_death6 = [$death6, boss_death7] {}; -void() boss_death7 = [$death7, boss_death8] {}; -void() boss_death8 = [$death8, boss_death9] {}; -void() boss_death9 = [$death9, boss_death10] -{ - sound(self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LAVASPLASH); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); -}; - -void() boss_death10 = [$death9, boss_death10] -{ - killed_monsters = killed_monsters + 1; - WriteByte(MSG_ALL, SVC_KILLEDMONSTER); // FIXME: reliable broadcast - SUB_UseTargets(); - remove (self); -}; - -void(float r, vector p) boss_missile = -{ - local vector offang; - local vector org, vec, d; - local float t; - local float vel; - - // VR: Predicted direction attack. - if(r == 0) - { - vel = 450 + random() * 150; - } - else - { - vel = 100 + random() * 150; - } - - offang = vectoangles (self.enemy.origin - self.origin); - makevectors (offang); - - org = self.origin + p_x*v_forward + p_y*v_right + p_z*'0 0 1'; - -// lead the player on hard mode - if(skill > 1) - { - // VR: Predicted direction attack. - if(r == 0) - { - t = vlen(self.enemy.origin - org) / vel; - vec = self.enemy.velocity; - vec_z = 0; - d = self.enemy.origin + t * vec; - } - } - else - { - d = self.enemy.origin; - } - - vec = normalize (d - org); - - launch_spike (org, vec); - setmodel (newmis, "progs/lavaball.mdl"); - newmis.avelocity = '200 100 300'; - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - newmis.velocity = vec * vel; - - // VR: Randomized direction attack. - if(r == 1) - { - newmis.velocity_x = newmis.velocity_x + crandom() * 100; - newmis.velocity_y = newmis.velocity_y + crandom() * 100; - newmis.velocity_z = newmis.velocity_z + crandom() * 100; - } - - newmis.touch = T_MissileTouch; // rocket explosion - sound(self, CHAN_WEAPON, "boss1/throw.wav", 1, ATTN_NORM); - -// check for dead enemy - if(self.enemy.health <= 0) - boss_idle1(); -}; - - -void() boss_awake = -{ - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - self.takedamage = DAMAGE_NO; - - setmodel (self, "progs/boss.mdl"); - setsize (self, '-128 -128 -24', '128 128 256'); - - if(skill == 0) - self.health = 1; - else - self.health = 3; - - self.enemy = activator; - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LAVASPLASH); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - self.yaw_speed = 20; - boss_rise1(); -}; - - -/*QUAKED monster_boss (1 0 0) (-128 -128 -24) (128 128 256) -*/ -void() monster_boss = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/boss.mdl"); - precache_model ("progs/lavaball.mdl"); - - precache_sound("weapons/rocket1i.wav"); - precache_sound("boss1/out1.wav"); - precache_sound("boss1/sight1.wav"); - precache_sound("misc/power.wav"); - precache_sound("boss1/throw.wav"); - precache_sound("boss1/pain.wav"); - precache_sound("boss1/death.wav"); - - total_monsters = total_monsters + 1; - - self.use = boss_awake; -}; - -//=========================================================================== - -entity le1, le2; -float lightning_end; - -void() lightning_fire = -{ - local vector p1, p2; - - if(time >= lightning_end) - { // done here, put the terminals back up - self = le1; - door_go_down(); - self = le2; - door_go_down(); - return; - } - - p1 = (le1.mins + le1.maxs) * 0.5; - p1_z = le1.absmin_z - 16; - - p2 = (le2.mins + le2.maxs) * 0.5; - p2_z = le2.absmin_z - 16; - - // compensate for length of bolt - p2 = p2 - normalize(p2-p1)*100; - - self.nextthink = time + 0.1; - self.think = lightning_fire; - - WriteByte(MSG_ALL, SVC_TEMPENTITY); - WriteByte(MSG_ALL, TE_LIGHTNING3); - WriteEntity(MSG_ALL, world); - WriteByte(MSG_ALL, 0); /* disambiguator */ - WriteCoord(MSG_ALL, p1_x); - WriteCoord(MSG_ALL, p1_y); - WriteCoord(MSG_ALL, p1_z); - WriteCoord(MSG_ALL, p2_x); - WriteCoord(MSG_ALL, p2_y); - WriteCoord(MSG_ALL, p2_z); -}; - -void() lightning_use = -{ - if(lightning_end >= time + 1) - return; - - le1 = find( world, target, "lightning"); - le2 = find( le1, target, "lightning"); - if(!le1 || !le2) - { - dprint ("missing lightning targets\n"); - return; - } - - if( - (le1.state != STATE_TOP && le1.state != STATE_BOTTOM) - || (le2.state != STATE_TOP && le2.state != STATE_BOTTOM) - || (le1.state != le2.state) ) - { -// dprint ("not aligned\n"); - return; - } - -// don't let the electrodes go back up until the bolt is done - le1.nextthink = -1; - le2.nextthink = -1; - lightning_end = time + 1; - - sound(self, CHAN_VOICE, "misc/power.wav", 1, ATTN_NORM); - lightning_fire(); - -// advance the boss pain if down - self = find (world, classname, "monster_boss"); - if(!self) - return; - self.enemy = activator; - if(le1.state == STATE_TOP && self.health > 0) - { - sound(self, CHAN_VOICE, "boss1/pain.wav", 1, ATTN_NORM); - self.health = self.health - 1; - if(self.health >= 2) - boss_shocka1(); - else if(self.health == 1) - boss_shockb1(); - else if(self.health == 0) - boss_shockc1(); - } -}; - - -/*QUAKED event_lightning (0 1 1) (-16 -16 -16) (16 16 16) -Just for boss level. -*/ -void() event_lightning = -{ - self.use = lightning_use; -}; - - diff --git a/QC/builtins.qc b/QC/builtins.qc new file mode 100644 index 00000000..6fa3bec3 --- /dev/null +++ b/QC/builtins.qc @@ -0,0 +1,172 @@ +// +// builtin functions +// + +void(vector ang) makevectors = #1; // sets v_forward, etc globals +void(entity e, vector o) setorigin = #2; +void(entity e, string m) setmodel = #3; // set movetype and solid first +void(entity e, vector min, vector max) setsize = #4; +// #5 was removed +void() break = #6; +float() random = #7; // returns 0 - 1 + +// Frikbot overrides the following: +// void(entity e, float chan, string samp, float vol, float atten) sound = #8; + +vector(vector v) normalize = #9; +void(string e) error = #10; +void(string e) objerror = #11; +float(vector v) vlen = #12; +float(vector v) vectoyaw = #13; +entity() spawn = #14; +void(entity e) remove = #15; + +// sets trace_* globals +// nomonsters can be: +// An entity will also be ignored for testing if forent == test, +// forent->owner == test, or test->owner == forent +// a forent of world is ignored +void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16; + +entity() checkclient = #17; // returns a client to look for +entity(entity start, .string fld, string match) find = #18; +string(string s) precache_sound = #19; +string(string s) precache_model = #20; + +// Frikbot overrides the following: +// void(entity client, string s)stuffcmd = #21; + +entity(vector org, float rad) findradius = #22; +void(string s) bprint = #23; + +// Frikbot overrides the following: +// void(entity client, string s) sprint = #24; + +void(string s) dprint = #25; +string(float f) ftos = #26; +string(vector v) vtos = #27; +void() coredump = #28; // prints all edicts +void() traceon = #29; // turns statment trace on +void() traceoff = #30; +void(entity e) eprint = #31; // prints an entire edict +float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE +// #33 was removed +float() droptofloor= #34; // TRUE if landed on floor +void(float style, string value) lightstyle = #35; +float(float v) rint = #36; // round to nearest int +float(float v) floor = #37; // largest integer <= v +float(float v) ceil = #38; // smallest integer >= v +// #39 was removed +float(entity e) checkbottom = #40; // true if self is on ground +float(vector v) pointcontents = #41; // returns a CONTENT_* +// #42 was removed +float(float f) fabs = #43; + +// Frikbot overrides the following: +// vector(entity e, float speed) aim = #44; // returns the shooting vector + +float(string s) cvar = #45; // return cvar.value +void(string s) localcmd = #46; // put string into local que +entity(entity e) nextent = #47; // for looping through all ents +void(vector o, vector d, float color, float count) particle = #48;// start a particle effect +void() ChangeYaw = #49; // turn towards self.ideal_yaw + // at self.yaw_speed +// #50 was removed +vector(vector v) vectoangles = #51; + +// +// direct client message generation +// + +// Frikbot overrides the following: +// void(float to, float f) WriteByte = #52; +// void(float to, float f) WriteChar = #53; +// void(float to, float f) WriteShort = #54; +// void(float to, float f) WriteLong = #55; +// void(float to, float f) WriteCoord = #56; +// void(float to, float f) WriteAngle = #57; +// void(float to, string s) WriteString = #58; +// void(float to, entity s) WriteEntity = #59; + +// +// broadcast client message generation +// + +// void(float f) bWriteByte = #59; +// void(float f) bWriteChar = #60; +// void(float f) bWriteShort = #61; +// void(float f) bWriteLong = #62; +// void(float f) bWriteCoord = #63; +// void(float f) bWriteAngle = #64; +// void(string s) bWriteString = #65; +// void(entity e) bWriteEntity = #66; + +void(float step) movetogoal = #67; + +string(string s) precache_file = #68; // no effect except for -copy +void(entity e) makestatic = #69; +void(string s) changelevel = #70; + +//#71 was removed + +void(string var, string val) cvar_set = #72; // sets cvar.value + +// Frikbot overrides the following: +// void(entity client, string s) centerprint = #73; // sprint, but in middle + +void(vector pos, string samp, float vol, float atten) ambientsound = #74; + +string(string s) precache_model2 = #75; // registered version only +string(string s) precache_sound2 = #76; // registered version only +string(string s) precache_file2 = #77; // registered version only + +// Frikbot overrides the following: +// void(entity e) setspawnparms = #78; // set parm1... to the + // values at level start + // for coop respawn + +void(vector o, vector d, float preset, float count) particle2 = #79;// start a particle2 effect +float(float base, float exp) pow = #80; // power function +void(float hand, float delay, float duration, float frequency, float amplitude) haptic = #81; // VR haptics function +float(float a, float b) min = #82; +float(float a, float b) max = #83; +void(vector ang) makeforward = #84; // sets v_forward +float(float input, float inputmin, float inputMax, float outputMin, float outputMax) maprange = #85; // sets v_forward + +float(string s) cvar_hmake = #86; +float(float h) cvar_hget = #87; +void() cvar_hclear = #88; + +vector(vector input, vector exemplar) redirectvector = #89; + +void(float h, float v) cvar_hset = #90; + +float() worldtext_hmake = #91; +void(float h, string s) worldtext_hsettext = #92; +void(float h, vector v) worldtext_hsetpos = #93; +void(float h, vector v) worldtext_hsetangles = #94; + +void(float to, vector v) WriteVec3 = #95; + +void(float h, float v) worldtext_hsethalign = #96; + +float(string s) strlen = #97; +float(string s, float n) nthchar = #98; +string(string s, float b, float e) substr = #99; + +float(float entGravity, float throwSpeed, vector from, vector to) calcthrowangle = #100; +vector(vector vec, vector up, float angle) rotatevec = #101; + +float(float angle) sin = #102; +float(float angle) cos = #103; + +float(float angle) asin = #104; +float(float angle) acos = #105; + +float(float angle) tan = #106; +float(float angle) atan = #107; + +float(float v) sqrt = #108; + +float(float x, float y) atan2 = #109; + diff --git a/QC/buttons.qc b/QC/buttons.qc index c268afc0..9ab2e2b3 100644 --- a/QC/buttons.qc +++ b/QC/buttons.qc @@ -2,6 +2,11 @@ void(entity entPlayer) VRButtonPressHaptic = { + if(!entPlayer.ishuman) + { + return; + } + if(VRIsTouchingHandFake(entPlayer)) { haptic(0, 0.0, 0.3, 75, 1.0); @@ -12,9 +17,6 @@ void(entity entPlayer) VRButtonPressHaptic = haptic(VRGetTouchingHand(entPlayer), 0.0, 0.3, 75, 1.0); } -void() button_wait; -void() button_return; - void() button_wait = { self.state = STATE_TOP; @@ -32,12 +34,12 @@ void() button_done = void() button_return = { - local vector porg; + vector porg; porg_x = self.absmin_x + ((self.absmax_x - self.absmin_x) / 2); porg_y = self.absmin_y + ((self.absmax_y - self.absmin_y) / 2); porg_z = self.absmin_z + ((self.absmax_z - self.absmin_z) / 2); - particle2(porg, '0 0 0', 5 /* sparks preset */, 64); + particle2(porg, '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 64); self.state = STATE_DOWN; @@ -56,25 +58,28 @@ void() button_blocked = void() button_fire = { - local vector porg; - - if(self.state == STATE_UP || self.state == STATE_TOP) + if(self.state == STATE_UP || self.state == STATE_TOP || self.state == STATE_DISABLED) { return; } - - porg_x = self.absmin_x + ((self.absmax_x - self.absmin_x) / 2); - porg_y = self.absmin_y + ((self.absmax_y - self.absmin_y) / 2); - porg_z = self.absmin_z + ((self.absmax_z - self.absmin_z) / 2); - particle2(porg, '0 0 0', 5 /* sparks preset */, 64); + particle2(realorigin(self), '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 64); sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); self.state = STATE_UP; - SUB_CalcMove (self.pos2, self.speed, button_wait); -}; + SUB_CalcMove(self.pos2, self.speed, button_wait); + // VR + if(self.buttonEffect == 1) // Test + { + bprint("EFFECTS BUTTON!"); + } + else if(self.buttonEffect == 2) // Tutorial button + { + bprint("Congratulations! You have hands.\n"); + } +}; void() button_use = { @@ -118,6 +123,9 @@ When a button is touched, it moves some distance in the direction of it's angle, 1) wooden clunk 2) metallic click 3) in-out +"buttonEffect" // VR +0) normal button +N) code button */ void() func_button = { @@ -146,7 +154,7 @@ void() func_button = self.movetype = MOVETYPE_PUSH; self.solid = SOLID_BSP; - setmodel (self, self.model); + setmodel(self, self.model); self.blocked = button_blocked; self.use = button_use; @@ -177,9 +185,188 @@ void() func_button = if(!self.lip) self.lip = 4; + // HONEY + if(self.items) { + self.flags = self.flags | FL_SPECIFICDAMAGE; + } + self.state = STATE_BOTTOM; self.pos1 = self.origin; self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // HONEY + if(self.spawnflags & START_DISABLED) { + button_disable(self); + } + + if(self.worldtext != NULLSTR) + { + vector dir = self.movedir; + vector ang = vectoangles(dir); + + float wth = worldtext_hmake(); + worldtext_hsettext(wth, self.worldtext); + worldtext_hsetpos(wth, realorigin(self) + '0 0 12' - dir * 6.0); + worldtext_hsetangles(wth, ang); + } }; +// TODO VR: (P2) move +void() func_particle_emitter_think = +{ + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_BIGSMOKE, 1); + self.nextthink = time + 0.1; +} + +void() func_particle_emitter = +{ + self.think = func_particle_emitter_think; + self.nextthink = time + 0.1; +} + +void() func_worldtext_banner_think = +{ + float wth = self.weapon; + float len = self.t_length; + float nPages = self.lip; + + float startIdx; + float endIdx; + + if(self.state == 0) // On first page + { + startIdx = 0; + endIdx = VR_WorldTextUtil_GetPageStringCharStartIdx(self, 0); + } + else if(self.state == (nPages - 1)) // On last page + { + startIdx = VR_WorldTextUtil_GetPageStringCharStartIdx(self, self.state - 1) + 1; + endIdx = len; + } + else + { + startIdx = VR_WorldTextUtil_GetPageStringCharStartIdx(self, self.state - 1) + 1; + endIdx = VR_WorldTextUtil_GetPageStringCharStartIdx(self, self.state); + } + + string newText = substr(self.worldtext, startIdx, endIdx); + worldtext_hsettext(wth, newText); + + self.state += 1; + if(self.state == nPages) + { + self.state = 0; + } + + self.nextthink = time + (self.speed * (endIdx - startIdx)); +} + +float(entity xEntWorldText, float xPageIdx) +VR_WorldTextUtil_GetPageStringCharStartIdx = +{ + ASSERT(xPageIdx >= 0); + ASSERT(xPageIdx < 6); + ASSERT(xPageIdx < xEntWorldText.lip); + + return xEntWorldText.holsterhover[xPageIdx]; +} + +void(entity xEntWorldText, float xPageIdx, float xCharStartIdx) +VR_WorldTextUtil_SetPageStringCharStartIdx = +{ + ASSERT(xPageIdx >= 0); + ASSERT(xPageIdx < 6); + ASSERT(xPageIdx < xEntWorldText.lip); + + xEntWorldText.holsterhover[xPageIdx] = xCharStartIdx; +} + +float(entity xEntWorldText) +VR_WorldTextUtil_InitializePages = +{ + string s = xEntWorldText.worldtext; + ASSERT(s != NULLSTR); + + float nSeps = 0; + float len = xEntWorldText.t_length; + for(float i = 0; i < len; ++i) + { + if(nthchar(s, i) == '$') + { + VR_WorldTextUtil_SetPageStringCharStartIdx(xEntWorldText, nSeps, i); + ++nSeps; + } + } + + return nSeps + 1; +} + +// Parameters: +// * `.worldtext`: Text to display. The single character `$` is interpreted as +// a page break and will make the banner automatically scroll between pages. +// * `.worldtext_halign`: Horizontal text alignment. (`0`: Left, `1`: Center, +// `2`: Right) +// * `.speed`: Time to scroll to the next page, in seconds per character. +void() func_worldtext_banner = +{ + ASSERT(self.worldtext_halign == 0 || + self.worldtext_halign == 1 || + self.worldtext_halign == 2); + + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, self.model); + + if(self.worldtext == NULLSTR) + { + return; + } + + // Cache string length + self.t_length = strlen(self.worldtext); + + // Initialize pages + self.state = 0; // Current page + self.lip = VR_WorldTextUtil_InitializePages(self); // Number of pages + + // Create and cache world text handle + float wth = worldtext_hmake(); + self.weapon = wth; + + worldtext_hsetpos(wth, realorigin(self)); + worldtext_hsetangles(wth, self.angles + '0 180 0'); + worldtext_hsethalign(wth, self.worldtext_halign); + + if(self.lip > 1) + { + self.think = func_worldtext_banner_think; + self.nextthink = time + 0.05; + } + else + { + worldtext_hsettext(wth, self.worldtext); + } +} + + + +void() func_weapon_dispenser_use = +{ + CreateThrownWeapon(self, self.weapon, 0 /* weaponflags */, + self.origin, randomVec(180), + '0 0 0', randomVec(20), + FALSE /* disappear on hit */, + FALSE /* deal damage */, + WeaponIdToThrowDamage(self.weapon) + ); +} + +void() func_weapon_dispenser = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, self.model); + + self.use = func_weapon_dispenser_use; +} diff --git a/QC/client.qc b/QC/client.qc index a5cdb39d..1d46d92c 100644 --- a/QC/client.qc +++ b/QC/client.qc @@ -1,24 +1,14 @@ - -// prototypes -void() W_SetCurrentAmmo; -void(entity attacker, float damage) player_pain; -void(float xHand) player_stand1; -void (vector org) spawn_tfog; -void (vector org, entity death_owner) spawn_tdeath; - float modelindex_eyes, modelindex_player, modelindex_hammer; +// +// +// +// ---------------------------------------------------------------------------- +// Level changing / Intermission +// ---------------------------------------------------------------------------- -/* -============================================================================= - - LEVEL CHANGING / INTERMISSION - -============================================================================= -*/ - -float intermission_running; -float intermission_exittime; +float intermission_running; +float intermission_exittime; /*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16) This is the camera point for the intermission. @@ -28,60 +18,156 @@ void() info_intermission = { }; - - void() SetChangeParms = { if(self.health <= 0) { SetNewParms(); + + // ROGUE + parm22 = self.steam; // Save the current team of the player + return; } -//JIM -// remove items - self.items = self.items - (self.items & - (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD ) ); -//MED - self.hipnotic_items = self.hipnotic_items - (self.hipnotic_items & - (HIP_IT_WETSUIT | HIP_IT_EMPATHY_SHIELDS ) ); -//MED + VR_ItemUtil_EntDelItem(self, IID_KEY1); + VR_ItemUtil_EntDelItem(self, IID_KEY2); + VR_ItemUtil_EntDelItem(self, IID_INVISIBILITY); + VR_ItemUtil_EntDelItem(self, IID_INVULNERABILITY); + VR_ItemUtil_EntDelItem(self, IID_SUIT); + VR_ItemUtil_EntDelItem(self, IID_QUAD); + + // HIPNOTIC + VR_ItemUtil_EntDelItem(self, IID_WETSUIT); + VR_ItemUtil_EntDelItem(self, IID_EMPATHY_SHIELDS); + + // ROGUE + VR_ItemUtil_EntDelItem(self, IID_ANTIGRAV); + VR_ItemUtil_EntDelItem(self, IID_SHIELD); + VR_ItemUtil_EntDelItem(self, IID_SUPERHEALTH); + self.gravity = 1.0; -// cap super health + // cap super health if(self.health > 100) + { self.health = 100; + } if(self.health < 50) + { self.health = 50; + } - parm1 = self.items; - parm2 = self.health; - parm3 = self.armorvalue; - - if(self.ammo_shells < 25) - parm4 = 25; + // ROGUE + // Don't carry items between levels in CTF + teamplay = cvar_hget(cvarh_teamplay); + if(teamplay >= TEAM_CTF) + { + SetNewParms(); + } else - parm4 = self.ammo_shells; - - parm5 = self.ammo_nails; - parm6 = self.ammo_rockets; - parm7 = self.ammo_cells; - parm8 = self.weapon; - parm9 = self.armortype * 100; - parm10 = self.weapon2; - - parm11 = self.holsterweapon0; - parm12 = self.holsterweapon1; - parm13 = self.holsterweapon2; - parm14 = self.holsterweapon3; - parm15 = self.holsterweapon4; - parm16 = self.holsterweapon5; + { + parm1 = self.items; + parm2 = self.health; + parm3 = self.armorvalue; + + if(self.ammo_shells < 25) + parm4 = 25; + else + parm4 = self.ammo_shells; + + parm5 = self.ammo_nails; + parm6 = self.ammo_rockets; + parm7 = self.ammo_cells; + parm8 = self.weapon; + parm9 = self.armortype * 100; + parm10 = self.weapon2; + + // -------------------------------------------------------------------- + // Holster weapon ids: + parm11 = self.holsterweapon0; + parm12 = self.holsterweapon1; + parm13 = self.holsterweapon2; + parm14 = self.holsterweapon3; + parm15 = self.holsterweapon4; + parm16 = self.holsterweapon5; + + // -------------------------------------------------------------------- + // Mission packs: + // HIPNOTIC + parm17 = self.hipnotic_items; + + // ROGUE + parm18 = self.rogue_items; + parm19 = self.ammo_lava_nails; + parm20 = self.ammo_multi_rockets; + parm21 = self.ammo_plasma; + } + + // ROGUE + parm22 = self.steam; // Save team setting + + // ------------------------------------------------------------------------ + // Weapon flags: + parm23 = self.weaponflags; + parm24 = self.weaponflags2; + parm25 = self.holsterweaponflags0; + parm26 = self.holsterweaponflags1; + parm27 = self.holsterweaponflags2; + parm28 = self.holsterweaponflags3; + parm29 = self.holsterweaponflags4; + parm30 = self.holsterweaponflags5; }; +void() OnSpawnServerBeforeLoad = +{ + // float fromSaveFile; + // fromSaveFile = spawnServerFromSaveFile; + + VR_CVars_InitAllHandles(); +} + +void() OnSpawnServerAfterLoad = +{ + float fromSaveFile; + fromSaveFile = spawnServerFromSaveFile; + + VR_CVars_InitAllHandles(); + + if(!fromSaveFile) + { + if(!deathmatch && !VR_GameUtil_InTutorialMap()) + { + SpawnAllAmmoBoxWeapons(); + } + } +} + +void() OnLoadGame = +{ + VR_CVars_InitAllHandles(); +} + void() SetNewParms = { - parm1 = IT_SHOTGUN | IT_AXE; + // HONEY + // The secret count doesn't get updated when using the restart command for + // some reason. + if(VR_GameUtil_EnableHoneyExtensions()) + { + SUB_DoLater(Honey_UpdateSecrets, 0.2); + } + + if(VR_GameUtil_InTutorialMap()) + { + parm1 = 0; + } + else + { + parm1 = IT_SHOTGUN | IT_AXE; + } + parm2 = 100; parm3 = 0; parm4 = 25; @@ -92,29 +178,76 @@ void() SetNewParms = parm9 = 0; parm10 = WID_FIST; + // ------------------------------------------------------------------------ + // Holster weapon ids: parm11 = WID_FIST; parm12 = WID_FIST; - parm13 = WID_AXE; - parm14 = WID_SHOTGUN; + + if(VR_GameUtil_InTutorialMap()) + { + parm13 = WID_FIST; + parm14 = WID_FIST; + } + else + { + parm13 = WID_AXE; + parm14 = WID_SHOTGUN; + } + parm15 = WID_FIST; parm16 = WID_FIST; + + // ------------------------------------------------------------------------ + // Mission packs: + // HIPNOTIC + parm17 = 0; + + // ROGUE + if(deathmatch && teamplay >= TEAM_CTF) + { + parm18 = ROGUE_IT_GRAPPLE; + } + else + { + parm18 = 0; + } + + // ROGUE + parm19 = 0; + parm20 = 0; + parm21 = 0; + + // ROGUE + parm22 = -1; // CTF: reset current team selection + + // ------------------------------------------------------------------------ + // Weapon flags: + parm23 = 0; + parm24 = 0; + parm25 = 0; + parm26 = 0; + parm27 = 0; + parm28 = 0; + parm29 = 0; + parm30 = 0; }; void() DecodeLevelParms = { + if(VR_GameUtil_InTutorialMap()) + { + SetNewParms(); + } + if(!deathmatch) { if(world.model == "maps/start.bsp") SetNewParms(); // take away all stuff on starting new episode - if(world.model == "maps/orig_start.bsp") - SetNewParms(); // take away all stuff on starting new episode } -//HIPNOTIC + // HIPNOTIC if(world.model == "maps/start.bsp") SetNewParms(); // take away all stuff on starting new episode - if(world.model == "maps/orig_start.bsp") - SetNewParms(); // take away all stuff on starting new episode if(world.model == "maps/hip1m1.bsp") SetNewParms(); // take away all stuff on starting new episode if(world.model == "maps/hip2m1.bsp") @@ -122,6 +255,10 @@ void() DecodeLevelParms = if(world.model == "maps/hip3m1.bsp") SetNewParms(); // take away all stuff on starting new episode + // ROGUE + if(world.model == "maps/r2m1.bsp" && !deathmatch) + SetNewParms(); // PGM - 01/29 change to have level 8 reset all your stuff. + self.items = parm1; self.health = parm2; self.armorvalue = parm3; @@ -133,21 +270,50 @@ void() DecodeLevelParms = self.armortype = parm9 * 0.01; self.weapon2 = parm10; - self.prevweapon = parm8; - self.prevweapon2 = parm10; - + // ------------------------------------------------------------------------ + // Holster weapon ids: self.holsterweapon0 = parm11; self.holsterweapon1 = parm12; self.holsterweapon2 = parm13; self.holsterweapon3 = parm14; self.holsterweapon4 = parm15; self.holsterweapon5 = parm16; - self.holsterweaponmodel0 = WeaponIdToModel(self.holsterweapon0); - self.holsterweaponmodel1 = WeaponIdToModel(self.holsterweapon1); - self.holsterweaponmodel2 = WeaponIdToModel(self.holsterweapon2); - self.holsterweaponmodel3 = WeaponIdToModel(self.holsterweapon3); - self.holsterweaponmodel4 = WeaponIdToModel(self.holsterweapon4); - self.holsterweaponmodel5 = WeaponIdToModel(self.holsterweapon5); + self.holsterweaponmodel0 = WeaponIdToModel(self.holsterweapon0, parm25); + self.holsterweaponmodel1 = WeaponIdToModel(self.holsterweapon1, parm26); + self.holsterweaponmodel2 = WeaponIdToModel(self.holsterweapon2, parm27); + self.holsterweaponmodel3 = WeaponIdToModel(self.holsterweapon3, parm28); + self.holsterweaponmodel4 = WeaponIdToModel(self.holsterweapon4, parm29); + self.holsterweaponmodel5 = WeaponIdToModel(self.holsterweapon5, parm30); + + // ------------------------------------------------------------------------ + // Mission packs: + // HIPNOTIC + self.hipnotic_items = parm17; + + // ROGUE + self.rogue_items = parm18; + self.ammo_lava_nails = parm19; + self.ammo_multi_rockets = parm20; + self.ammo_plasma = parm21; + + // ROGUE + //ZOID-- + if(TeamColorIsLegal(parm22)) { + self.steam = parm22; + TeamSetSkin(); + } + //--ZOID + + // ------------------------------------------------------------------------ + // Weapon flags: + self.weaponflags = parm23; + self.weaponflags2 = parm24; + self.holsterweaponflags0 = parm25; + self.holsterweaponflags1 = parm26; + self.holsterweaponflags2 = parm27; + self.holsterweaponflags3 = parm28; + self.holsterweaponflags4 = parm29; + self.holsterweaponflags5 = parm30; }; /* @@ -159,31 +325,31 @@ Returns the entity to view from */ entity() FindIntermission = { - local entity spot; - local float cyc; + entity spot; + float cyc; // look for info_intermission first - spot = find (world, classname, "info_intermission"); + spot = find(world, classname, "info_intermission"); if(spot) { // pick a random one cyc = random() * 4; while(cyc > 1) { - spot = find (spot, classname, "info_intermission"); + spot = find(spot, classname, "info_intermission"); if(!spot) - spot = find (spot, classname, "info_intermission"); + spot = find(spot, classname, "info_intermission"); cyc = cyc - 1; } return spot; } // then look for the start position - spot = find (world, classname, "info_player_start"); + spot = find(world, classname, "info_player_start"); if(spot) return spot; // testinfo_player_start is only found in regioned levels - spot = find (world, classname, "testplayerstart"); + spot = find(world, classname, "testplayerstart"); if(spot) return spot; @@ -196,7 +362,7 @@ entity() FindIntermission = string nextmap; void() GotoNextMap = { - if(cvar("samelevel")) // if samelevel is set, stay on same level + if(cvar_hget(cvarh_samelevel)) // if samelevel is set, stay on same level changelevel (mapname); else changelevel (nextmap); @@ -205,7 +371,7 @@ void() GotoNextMap = void() ExitIntermission = { -// skip any text in deathmatch + // skip any text in deathmatch if(deathmatch) { GotoNextMap(); @@ -215,9 +381,7 @@ void() ExitIntermission = intermission_exittime = time + 1; intermission_running = intermission_running + 1; -// -// run some text if at the end of an episode -// + // run some text if at the end of an episode if(intermission_running == 2) { if(world.model == "maps/e1m7.bsp") @@ -225,15 +389,15 @@ void() ExitIntermission = WriteByte(MSG_ALL, SVC_CDTRACK); WriteByte(MSG_ALL, 2); WriteByte(MSG_ALL, 3); - if(!cvar("registered")) + if(!cvar_hget(cvarh_registered)) { WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!"); + WriteString(MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!"); } else { WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!"); + WriteString(MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!"); } return; } @@ -244,7 +408,7 @@ void() ExitIntermission = WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral."); + WriteString(MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral."); return; } else if(world.model == "maps/e3m6.bsp") @@ -254,7 +418,7 @@ void() ExitIntermission = WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth."); + WriteString(MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth."); return; } else if(world.model == "maps/e4m7.bsp") @@ -264,79 +428,86 @@ void() ExitIntermission = WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person."); + WriteString(MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person."); return; } -//HIPNOTIC - if(world.model == "maps/hip1m4.bsp") - { + // HIPNOTIC + if(world.model == "maps/hip1m4.bsp") + { WriteByte(MSG_ALL, SVC_CDTRACK); WriteByte(MSG_ALL, 6); WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "Deep within the bowels of the\nResearch Facility, you discover the\npassage that the followers of Quake\nhave used to enter our world.\nThe bastards used some type of\ngigantic teleporter to overload\none of our own slipgates! As long as\nthis portal exists, Earth will never\nbe safe from Quake's cruel minions." ); - //WriteString (MSG_ALL, "If you can find the source of the\nportal's power, you can shut it\ndown--possibly forever! With only a\nmoment's consideration for your own\nsafety, you re-enter the dark domain,\nknowing Hell would be a better fate\nthan experiencing the reign of Quake." ); - return; + WriteString(MSG_ALL, "Deep within the bowels of the\nResearch Facility, you discover the\npassage that the followers of Quake\nhave used to enter our world.\nThe bastards used some type of\ngigantic teleporter to overload\none of our own slipgates! As long as\nthis portal exists, Earth will never\nbe safe from Quake's cruel minions."); + return; } else if(world.model == "maps/hip2m5.bsp") { - WriteByte(MSG_ALL, SVC_CDTRACK); - WriteByte(MSG_ALL, 6); + WriteByte(MSG_ALL, SVC_CDTRACK); + WriteByte(MSG_ALL, 6); WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "After destroying the power generator,\nyou pass beyond the gate of Mortum's\nKeep. A wave of nausea suddenly flows\nover you and you find yourself cast\nout into a liquid void. You float\nlifelessly, yet aware, in a lavender\nsea of energy." ); - return; + WriteString(MSG_ALL, "After destroying the power generator,\nyou pass beyond the gate of Mortum's\nKeep. A wave of nausea suddenly flows\nover you and you find yourself cast\nout into a liquid void. You float\nlifelessly, yet aware, in a lavender\nsea of energy."); + return; } - else if(world.model == "maps/hipend.bsp") - { - - WriteByte(MSG_ALL, SVC_CDTRACK); - WriteByte(MSG_ALL, 2); + else if(world.model == "maps/hipend.bsp") + { + WriteByte(MSG_ALL, SVC_CDTRACK); + WriteByte(MSG_ALL, 2); WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "After the last echoes of Armagon's\ndeath yell fade away, you breathe a\nheavy sigh of relief. With the loss\nof his magic, Armagon's fortress\nbegins to collapse. The rift he\ncreated to send his grisly troops\nthrough time slowly closes and seals\nitself forever. In the chaos that\nensues, a wall collapses, revealing\none remaining time portal. With your\nchances to escape rapidly growing\nslim, you race for the portal,\nmindless of your destination. In a\nflash of light, you find yourself\nback at Command HQ, safe and sound." ); + WriteString(MSG_ALL, "After the last echoes of Armagon's\ndeath yell fade away, you breathe a\nheavy sigh of relief. With the loss\nof his magic, Armagon's fortress\nbegins to collapse. The rift he\ncreated to send his grisly troops\nthrough time slowly closes and seals\nitself forever. In the chaos that\nensues, a wall collapses, revealing\none remaining time portal. With your\nchances to escape rapidly growing\nslim, you race for the portal,\nmindless of your destination. In a\nflash of light, you find yourself\nback at Command HQ, safe and sound."); return; } - GotoNextMap(); + + // ROGUE + else if(world.model == "maps/r1m7.bsp") + { + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "Victory! The Overlord's mangled\nremains are the evidence. His evil\nWrath army? Cast out to wander\naimlessly throughout time.\n\nAs the Slipgate fog surrounds you,\nthoughts rage into your consciousness:\nHas Quake's oppressive reign ended?\nIs it Salvation, or Damnation, which\nwaits beyond the Vortex?\n\nAnother thought, not quite your own,\nrazors through the haze. \"Forgiveness\ncan yet be granted; Our Master remains\nto absolve your sins against his Chosen.\nFall down upon your knees-pray for\nQuake's mercy.\""); + return; + } + + GotoNextMap(); } if(intermission_running == 3) { - if(!cvar("registered")) + if(!cvar_hget(cvarh_registered)) { // shareware episode has been completed, go to sell screen WriteByte(MSG_ALL, SVC_SELLSCREEN); return; } - if( (serverflags&15) == 15) + if((serverflags&15) == 15) { WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born."); + WriteString(MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born."); return; } - //HIPNOTIC - if(world.model == "maps/hip1m4.bsp") - { - WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "If you can find the source of the\nportal's power, you can shut it\ndown--possibly forever! With only a\nmoment's consideration for your own\nsafety, you re-enter the dark domain,\nknowing Hell would be a better fate\nthan experiencing the reign of Quake." ); - return; + // HIPNOTIC + if(world.model == "maps/hip1m4.bsp") + { + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "If you can find the source of the\nportal's power, you can shut it\ndown--possibly forever! With only a\nmoment's consideration for your own\nsafety, you re-enter the dark domain,\nknowing Hell would be a better fate\nthan experiencing the reign of Quake."); + return; } else if(world.model == "maps/hip2m5.bsp") { - WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "After what seems like an eternity,\nyou feel the presence of a diabolical\nintelligence. You are held helpless\nfor a moment as your mind is open to\nthat of Armagon--Quake's General and\nmaster of this realm. Recognizing\nyou as the one who foiled his\nattempt to conquer Earth, a hellish\nhowl fills your mind and blots out\nall consciousness. When you awake,\nyou find yourself on the shores of\nreality, but in a time and place\nunknown to you." ); - return; - } - else if(world.model == "maps/hipend.bsp") - { - WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "Congratulations! You are victorious!\nThe minions of Quake have once again\nfallen before your mighty hand.\nIs this the last you will see of\nQuake's hellions?\n\nOnly time will tell..." ); - intermission_exittime = time + 10000000; // never allow exit + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "After what seems like an eternity,\nyou feel the presence of a diabolical\nintelligence. You are held helpless\nfor a moment as your mind is open to\nthat of Armagon--Quake's General and\nmaster of this realm. Recognizing\nyou as the one who foiled his\nattempt to conquer Earth, a hellish\nhowl fills your mind and blots out\nall consciousness. When you awake,\nyou find yourself on the shores of\nreality, but in a time and place\nunknown to you."); + return; + } + else if(world.model == "maps/hipend.bsp") + { + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "Congratulations! You are victorious!\nThe minions of Quake have once again\nfallen before your mighty hand.\nIs this the last you will see of\nQuake's hellions?\n\nOnly time will tell..."); + intermission_exittime = time + 10000000; // never allow exit return; } } @@ -362,13 +533,17 @@ void() IntermissionThink = ExitIntermission(); }; +float foundHoneyFogSettings; + void() execute_changelevel = { - local entity pos; + // HONEY + foundHoneyFogSettings = FALSE; + entity fogsettings = NULLENT; intermission_running = 1; -// enforce a wait time before allowing changelevel + // enforce a wait time before allowing changelevel if(deathmatch) intermission_exittime = time + 5; else @@ -378,9 +553,18 @@ void() execute_changelevel = WriteByte(MSG_ALL, 3); WriteByte(MSG_ALL, 3); - pos = FindIntermission(); + entity pos = FindIntermission(); + + // HONEY + if(pos.target != "") { + fogsettings = find(world, targetname, pos.target); + if(fogsettings.classname == "trigger_fogcontroller") { + foundHoneyFogSettings = TRUE; + fogsettings = fogsettings.owner; + } + } - other = find (world, classname, "player"); + other = find(world, classname, "player"); while(other != world) { other.view_ofs = '0 0 0'; @@ -391,8 +575,14 @@ void() execute_changelevel = other.solid = SOLID_NOT; other.movetype = MOVETYPE_NONE; other.modelindex = 0; - setorigin (other, pos.origin); - other = find (other, classname, "player"); + setorigin(other, pos.origin); + + // HONEY + if(fogsettings != NULLENT && fogsettings.classname == "trigger_fogcontroller") { + fog_setOverrideConditional(other, fogsettings.view_ofs, fogsettings.ideal_yaw, 1); + } + + other = find(other, classname, "player"); } WriteByte(MSG_ALL, SVC_INTERMISSION); @@ -404,23 +594,26 @@ void() changelevel_touch = if(other.classname != "player") return; - if((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) + float noexit; + noexit = cvar_hget(cvarh_noexit); + + if((noexit == 1) || ((noexit == 2) && (mapname != "start"))) { - T_Damage (other, self, self, 50000); + T_Damage(other, self, self, 50000); return; } if(coop || deathmatch) { - bprint (other.netname); - bprint (" exited the level\n"); + bprint(other.netname); + bprint(" exited the level\n"); } nextmap = self.map; SUB_UseTargets(); - if( (self.spawnflags & 1) && (deathmatch == 0) ) + if((self.spawnflags & 1) && (deathmatch == 0)) { // NO_INTERMISSION GotoNextMap(); return; @@ -463,23 +656,35 @@ void() respawn = if(coop) { // make a copy of the dead body for appearances sake - CopyToBodyQue (self); + // Unless the player died from falling in a pit! + if(!self.enemy) // HONEY + CopyToBodyQue(self); + // get the spawn parms as they were at level start - setspawnparms (self); + setspawnparms(self); + // respawn PutClientInServer(); } else if(deathmatch) { // make a copy of the dead body for appearances sake - CopyToBodyQue (self); + // Unless the player died from falling in a pit! + if(!self.enemy) // HONEY + CopyToBodyQue(self); + // set default spawn parms SetNewParms(); + // respawn PutClientInServer(); + + // set the skin correctly. + TeamSetSkin(); } else - { // restart the entire server + { + // restart the entire server localcmd ("restart\n"); } }; @@ -496,8 +701,44 @@ void() ClientKill = { if((intermission_running)&&((coop)||(deathmatch))) // not allowed during intermission return; - bprint (self.netname); - bprint (" suicides\n"); + + entity vSphere; + + // ZOID-- + if(self.suicide_count > 3) + { + sprint(self, "You have suicided too much already.\n"); + return; + } + + TeamDropFlagOfPlayer(self); + self.suicide_count = self.suicide_count + 1; + // --ZOID + + if(tag_token_owner == self) + { + self.health = 0; + self.solid = SOLID_NOT; + tag_token_drop(); + } + + if(VR_ItemUtil_EntHasItem(self, IID_V_SPHERE)) + { + vSphere = find(world, classname, "Vengeance"); + + while(vSphere) + { + if(vSphere.owner == self) + { + remove(vSphere); + } + + vSphere = find(vSphere, classname, "Vengeance"); + } + } + + bprint(self.netname); + bprint(" suicides\n"); set_suicide_frame(); self.modelindex = modelindex_player; self.frags = self.frags - 2; // extra penalty @@ -518,12 +759,18 @@ Returns the entity to spawn at */ entity() SelectSpawnPoint = { - local entity spot; - local entity thing; - local float pcount; + entity spot; + entity thing; + float pcount; + + //ZOID-- + entity startspot; + float t; + //--ZOID + // testinfo_player_start is only found in regioned levels - spot = find (world, classname, "testplayerstart"); + spot = find(world, classname, "testplayerstart"); if(spot) return spot; @@ -532,47 +779,104 @@ entity() SelectSpawnPoint = { lastspawn = find(lastspawn, classname, "info_player_coop"); if(lastspawn == world) - lastspawn = find (lastspawn, classname, "info_player_start"); + lastspawn = find(lastspawn, classname, "info_player_start"); if(lastspawn != world) return lastspawn; } else if(deathmatch) { - spot = lastspawn; + startspot = spot = lastspawn; + t = 0; + + if(!self.ctf_killed && teamplay >= TEAM_CTF) + { + if(self.steam == TEAM1) + { + startspot = spot = team1_lastspawn; + t = TEAM1; + } + else if(self.steam == TEAM2) + { + startspot = spot = team2_lastspawn; + t = TEAM2; + } + } + while(1) { - spot = find(spot, classname, "info_player_deathmatch"); + if(t == TEAM1) + { + spot = find(spot, classname, "info_player_team1"); + } + else if(t == TEAM2) + { + spot = find(spot, classname, "info_player_team2"); + } + else + { + spot = find(spot, classname, "info_player_deathmatch"); + } + if(spot != world) { - if(spot == lastspawn) - return lastspawn; + if(spot == startspot) + { + return startspot; + } + pcount = 0; thing = findradius(spot.origin, 32); + while(thing) { if(thing.classname == "player") pcount = pcount + 1; thing = thing.chain; } + if(pcount == 0) { - lastspawn = spot; + if(t == TEAM1) + { + team1_lastspawn = spot; + } + else if(t == TEAM2) + { + team2_lastspawn = spot; + } + else + { + lastspawn = spot; + } + return spot; } } + else + { + // pgm fix for ctf in levels w/o ctf support + t = 0; + } } } if(serverflags) { // return with a rune to start - spot = find (world, classname, "info_player_start2"); + spot = find(world, classname, "info_player_start2"); if(spot) return spot; } - spot = find (world, classname, "info_player_start"); + spot = find(world, classname, "info_player_start"); + if(!spot) - error ("PutClientInServer: no info_player_start on level"); + { + dprint("WARNING: PutClientInServer: no info_player_start on level"); + + // HONEY + spot = spawn(); + setorigin(spot, '0 0 0'); + } return spot; }; @@ -584,15 +888,9 @@ PutClientInServer called each time a player is spawned ============ */ -void() DecodeLevelParms; -void() PlayerDie; - - void() PutClientInServer = { - local entity spot; - - spot = SelectSpawnPoint(); + entity spot; self.classname = "player"; self.health = 100; @@ -618,8 +916,29 @@ void() PutClientInServer = self.hipnotic_items = 0; self.gravity = 1.0; + self.shield_finished = 0; + self.antigrav_finished = 0; + + //ZOID-- + self.ctf_lastreturnedflag = -10; + self.ctf_lastfraggedcarrier = -10; + self.ctf_flagsince = -10; + self.ctf_lasthurtcarrier = -10; + //--ZOID + + // HONEY + self.enemy = world; + // A hack: This doesn't work at level load, so if time is < 2 try again a bit later. + if(time < 2){ + SUB_DoLater(info_stuffcmd_do, 0.1); + } + + VR_ItemUtil_EntClearItems(self); DecodeLevelParms(); + // spawn selection must be after DecodeLevelParms because of team stuff + spot = SelectSpawnPoint (); + W_SetCurrentAmmo(); self.attack_finished = time; @@ -630,41 +949,41 @@ void() PutClientInServer = self.th_die = PlayerDie; self.deadflag = DEAD_NO; -// paustime is set by teleporters to keep the player from moving a while + // paustime is set by teleporters to keep the player from moving a while self.pausetime = 0; -// spot = SelectSpawnPoint(); - self.origin = self.oldorigin = spot.origin + '0 0 1'; // 1998-07-21 Respawning where player died fix by Robert Field self.angles = spot.angles; self.fixangle = TRUE; // turn this way immediately -// oh, this is a hack! + self.touch = player_touch; + + // oh, this is a hack! // VR: This works even if someone does not own SoA because it falls back to // 'progs/player.mdl'. (Hardcoded in C++.) - setmodel (self, "progs/playham.mdl"); + setmodel(self, "progs/playham.mdl"); modelindex_hammer = self.modelindex; - setmodel (self, "progs/eyes.mdl"); + setmodel(self, "progs/eyes.mdl"); modelindex_eyes = self.modelindex; - setmodel (self, "progs/player.mdl"); + setmodel(self, "progs/player.mdl"); modelindex_player = self.modelindex; - setsize (self, '-16 -16 -24', '16 16 26'); + setsize(self, '-16 -16 -24', '16 16 26'); self.view_ofs = '0 0 22'; self.velocity = '0 0 0'; // 1998-07-21 Player moves after respawn fix by Xian - player_stand1 (cVR_MainHand); - player_stand1 (cVR_OffHand); + player_stand1(cVR_MainHand); + player_stand1(cVR_OffHand); if(deathmatch || coop) { makevectors(self.angles); - spawn_tfog (self.origin + v_forward*20); + spawn_tfog(self.origin + v_forward*20); } // ROGUE @@ -686,25 +1005,33 @@ void() PutClientInServer = self.handavel = '0 0 0'; self.offhandavel = '0 0 0'; - self.offhand_grabbing = FALSE; - self.offhand_prevgrabbing = FALSE; + self.headvel = '0 0 0'; - self.mainhand_grabbing = FALSE; - self.mainhand_prevgrabbing = FALSE; + VRSetTeleporting(self, FALSE); + VRSetOffHandGrabbingBit(self, FALSE); + VRSetOffHandPrevGrabbingBit(self, FALSE); + VRSetMainHandGrabbingBit(self, FALSE); + VRSetMainHandPrevGrabbingBit(self, FALSE); + VRSet2HAiming(self, FALSE); self.offhand_forcegrabbing = FALSE; self.mainhand_forcegrabbing = FALSE; - spawn_tdeath (self.origin, self); + spawn_tdeath(self.origin, self); - readytime = time + 0.5; - - SpawnAllAmmoBoxWeapons(); + if(deathmatch) + { + readytime = time; + } + else + { + readytime = time + 0.5; + } }; void() SpawnAllAmmoBoxWeapons = { - local entity e; + entity e; for(e = nextent(world); e != world; e = nextent(e)) { if(IsAmmoBox(e)) @@ -751,6 +1078,7 @@ potential spawning position for deathmatch games */ void() info_player_deathmatch = { + SpawnRunes(); }; /*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24) @@ -770,16 +1098,14 @@ RULES /* go to the next level for deathmatch -only called if a time or frag limit has expired */ -// TODO VR: (P2) check here whether to go orig_start? void() NextLevel = { - local entity o; + entity o; if(mapname == "start") { - if(!cvar("registered")) + if(!cvar_hget(cvarh_registered)) { mapname = "e1m1"; } @@ -840,39 +1166,42 @@ Exit deathmatch games upon conditions */ void() CheckRules = { - local float timelimit; - local float fraglimit; + float timelimit; + float fraglimit; if(gameover) // someone else quit the game already return; - timelimit = cvar("timelimit") * 60; - fraglimit = cvar("fraglimit"); + timelimit = cvar_hget(cvarh_timelimit) * 60; + fraglimit = cvar_hget(cvarh_fraglimit); -// if(timelimit && time >= timelimit) if(deathmatch && timelimit && time >= timelimit) // 1998-07-27 Timelimit/Fraglimit fix by Maddes { NextLevel(); return; } -// if(fraglimit && self.frags >= fraglimit) if(deathmatch && fraglimit && self.frags >= fraglimit) // 1998-07-27 Timelimit/Fraglimit fix by Maddes { NextLevel(); return; } + + //ZOID-- + // update team scores? + TeamCheckUpdate(); + //--ZOID }; //============================================================================ void() PlayerDeathThink = { - local float forward; + float forward; if((self.flags & FL_ONGROUND)) { - forward = vlen (self.velocity); + forward = vlen(self.velocity); forward = forward - 20; if(forward <= 0) self.velocity = '0 0 0'; @@ -930,7 +1259,7 @@ void() PlayerJump = if(!(self.flags & FL_ONGROUND)) return; - if( !(self.flags & FL_JUMPRELEASED) ) + if(!(self.flags & FL_JUMPRELEASED)) return; // don't pogo stick self.flags = self.flags - (self.flags & FL_JUMPRELEASED); @@ -954,7 +1283,7 @@ WaterMove void() WaterMove = { -//dprint (ftos(self.waterlevel)); +//dprint(ftos(self.waterlevel)); if(self.movetype == MOVETYPE_NOCLIP) return; if(self.health < 0) @@ -976,7 +1305,7 @@ void() WaterMove = self.dmg = self.dmg + 2; if(self.dmg > 15) self.dmg = 10; - T_Damage (self, world, world, self.dmg); + T_Damage(self, world, world, self.dmg); self.pain_finished = time + 1; } } @@ -1001,7 +1330,7 @@ void() WaterMove = else self.dmgtime = time + 0.2; - T_Damage (self, world, world, 10*self.waterlevel); + T_Damage(self, world, world, 10*self.waterlevel); } } else if(self.watertype == CONTENT_SLIME) @@ -1009,11 +1338,11 @@ void() WaterMove = if(self.dmgtime < time && self.radsuit_finished < time) { self.dmgtime = time + 1; - T_Damage (self, world, world, 4*self.waterlevel); + T_Damage(self, world, world, 4*self.waterlevel); } } - if( !(self.flags & FL_INWATER) ) + if(!(self.flags & FL_INWATER)) { // player enter water sound @@ -1029,16 +1358,16 @@ void() WaterMove = self.dmgtime = 0; } - if(! (self.flags & FL_WATERJUMP) ) + if(! (self.flags & FL_WATERJUMP)) self.velocity = self.velocity - 0.8*self.waterlevel*frametime*self.velocity; }; void() CheckWaterJump = { - local vector start, end; + vector start, end; // check for a jump-out-of-water - makevectors (self.angles); + makevectors(self.angles); start = self.origin; start_z = start_z + 8; v_forward_z = 0; @@ -1114,6 +1443,13 @@ void() doWetsuit = void() PlayerPreThink = { + // FRIKBOT + if(BotPreFrame()) + return; + + // HONEY + fog_updateAll(); + if(intermission_running) { earthquake_prethink(); @@ -1124,29 +1460,57 @@ void() PlayerPreThink = if(self.view_ofs == '0 0 0') return; // intermission or finale -//JIM + // ROGUE + if(earthquake_active) + { + if(self.flags & FL_ONGROUND) + { + self.velocity_x = self.velocity_x + + (random() * earthquake_intensity * 2) - + earthquake_intensity; + + self.velocity_y = self.velocity_y + + (random() * earthquake_intensity * 2) - + earthquake_intensity; + + self.velocity_z = self.velocity_z + + (random() * earthquake_intensity * 2) - + earthquake_intensity; + } + } + + //JIM // Kill player on Edge of Oblivion - if( ( self.origin_z < -1300 ) && (world.model == "maps/hipdm1.bsp") && - ( self.health > 0 ) ) + if((self.origin_z < -1300) && (world.model == "maps/hipdm1.bsp") && + (self.health > 0)) { self.deathtype = "falling"; if(self.invincible_finished >= time) { self.invincible_finished = 0; - self.items = self.items - (self.items & IT_INVULNERABILITY); + + VR_ItemUtil_EntDelItem(self, IID_INVULNERABILITY); + self.invincible_time = 0; self.invincible_finished = 0; self.effects = self.effects - (self.effects & EF_DIMLIGHT); } - T_Damage( self, self, world, self.health + 1000 ); + T_Damage(self, self, world, self.health + 1000); } //JIM earthquake_prethink(); - makevectors (self.v_angle); // is this still used + makevectors(self.v_angle); // is this still used + //ZOID-- + // TeamCheckLock performs all necessary teamlock checking, and performs all + // actions needed. + TeamCheckLock(); + //--ZOID + + CheckMOTD(); CheckRules(); WaterMove(); @@ -1183,6 +1547,25 @@ void() PlayerPreThink = self.velocity = '0 0 0'; } + // ROGUE + if(VR_ItemUtil_EntHasItem(self, IID_ANTIGRAV)) + { + if(time > self.AGping) + { + sound(self, CHAN_AUTO, "belt/use.wav", 0.4, ATTN_NORM); + + self.AGping = time + 3; + + if(self.AGping >= (self.antigrav_finished - 3)) + { + self.AGping = self.antigrav_finished + 3; + } + } + } + + // ROGUE + RuneApplyElder(self); // regeneration rune + // Track the grapple if(self.hook_out2) { @@ -1222,8 +1605,8 @@ void() CheckPowerups = { if(self.invisible_time == 1) { - sprint (self, "Ring of Shadows magic is fading\n"); - stuffcmd (self, "bf\n"); + sprint(self, "Ring of Shadows magic is fading\n"); + stuffcmd(self, "bf\n"); sound(self, CHAN_AUTO, "items/inv2.wav", 1, ATTN_NORM); self.invisible_time = time + 1; } @@ -1231,13 +1614,13 @@ void() CheckPowerups = if(self.invisible_time < time) { self.invisible_time = time + 1; - stuffcmd (self, "bf\n"); + stuffcmd(self, "bf\n"); } } if(self.invisible_finished < time) { // just stopped - self.items = self.items - IT_INVISIBILITY; + VR_ItemUtil_EntDelItem(self, IID_INVISIBILITY); self.invisible_finished = 0; self.invisible_time = 0; } @@ -1261,8 +1644,8 @@ void() CheckPowerups = { if(self.invincible_time == 1) { - sprint (self, "Protection is almost burned out\n"); - stuffcmd (self, "bf\n"); + sprint(self, "Protection is almost burned out\n"); + stuffcmd(self, "bf\n"); sound(self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM); self.invincible_time = time + 1; } @@ -1270,13 +1653,13 @@ void() CheckPowerups = if(self.invincible_time < time) { self.invincible_time = time + 1; - stuffcmd (self, "bf\n"); + stuffcmd(self, "bf\n"); } } if(self.invincible_finished < time) { // just stopped - self.items = self.items - IT_INVULNERABILITY; + VR_ItemUtil_EntDelItem(self, IID_INVULNERABILITY); self.invincible_time = 0; self.invincible_finished = 0; } @@ -1296,8 +1679,8 @@ void() CheckPowerups = { if(self.super_time == 1) { - sprint (self, "Quad Damage is wearing off\n"); - stuffcmd (self, "bf\n"); + sprint(self, "Quad Damage is wearing off\n"); + stuffcmd(self, "bf\n"); sound(self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM); self.super_time = time + 1; } @@ -1305,13 +1688,13 @@ void() CheckPowerups = if(self.super_time < time) { self.super_time = time + 1; - stuffcmd (self, "bf\n"); + stuffcmd(self, "bf\n"); } } if(self.super_damage_finished < time) { // just stopped - self.items = self.items - IT_QUAD; + VR_ItemUtil_EntDelItem(self, IID_QUAD); self.super_damage_finished = 0; self.super_time = 0; } @@ -1331,8 +1714,8 @@ void() CheckPowerups = { if(self.rad_time == 1) { - sprint (self, "Air supply in Biosuit expiring\n"); - stuffcmd (self, "bf\n"); + sprint(self, "Air supply in Biosuit expiring\n"); + stuffcmd(self, "bf\n"); sound(self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM); self.rad_time = time + 1; } @@ -1340,13 +1723,13 @@ void() CheckPowerups = if(self.rad_time < time) { self.rad_time = time + 1; - stuffcmd (self, "bf\n"); + stuffcmd(self, "bf\n"); } } if(self.radsuit_finished < time) { // just stopped - self.items = self.items - IT_SUIT; + VR_ItemUtil_EntDelItem(self, IID_SUIT); self.rad_time = 0; self.radsuit_finished = 0; } @@ -1363,8 +1746,8 @@ void() CheckPowerups = { if(self.wetsuit_time == 1) { - sprint (self, "Air supply in Wetsuit is running out\n"); - stuffcmd (self, "bf\n"); + sprint(self, "Air supply in Wetsuit is running out\n"); + stuffcmd(self, "bf\n"); sound(self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM); self.wetsuit_time = time + 1; } @@ -1372,14 +1755,13 @@ void() CheckPowerups = if(self.wetsuit_time < time) { self.wetsuit_time = time + 1; - stuffcmd (self, "bf\n"); + stuffcmd(self, "bf\n"); } } if(self.wetsuit_finished < time) { // just stopped -//MED - self.hipnotic_items = self.hipnotic_items - HIP_IT_WETSUIT; + VR_ItemUtil_EntDelItem(self, IID_WETSUIT); self.wetsuit_time = 0; self.wetsuit_finished = 0; } @@ -1394,8 +1776,8 @@ void() CheckPowerups = { if(self.empathy_time == 1) { - sprint (self, "Empathy Shields are running out\n"); - stuffcmd (self, "bf\n"); + sprint(self, "Empathy Shields are running out\n"); + stuffcmd(self, "bf\n"); sound(self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM); self.empathy_time = time + 1; } @@ -1403,14 +1785,13 @@ void() CheckPowerups = if(self.empathy_time < time) { self.empathy_time = time + 1; - stuffcmd (self, "bf\n"); + stuffcmd(self, "bf\n"); } } if(self.empathy_finished < time) { // just stopped -//MED - self.hipnotic_items = self.hipnotic_items - HIP_IT_EMPATHY_SHIELDS; + VR_ItemUtil_EntDelItem(self, IID_EMPATHY_SHIELDS); self.empathy_time = 0; self.empathy_finished = 0; } @@ -1420,6 +1801,60 @@ void() CheckPowerups = else self.effects = self.effects - (self.effects & EF_DIMLIGHT); } + + if(self.shield_finished) + { + if(self.shield_finished < time + 3) + { + if(self.shield_time == 1) + { + sprint(self, "Shield failing...\n"); + sound(self, CHAN_AUTO, "shield/fadeout.wav", 1, ATTN_NORM); + self.shield_time = 0; + } + + if(self.shield_time < time) + { + self.shield_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + + if(self.shield_finished < time) + { + sprint(self, "Shield Lost.\n"); + self.shield_finished = 0; + + VR_ItemUtil_EntDelItem(self, IID_SHIELD); + } + } + + if(self.antigrav_finished) + { + if(self.antigrav_finished < time + 3) + { + if(self.antigrav_time == 1) + { + sprint(self, "Antigrav failing...\n"); + self.antigrav_time = 0; + sound(self, CHAN_AUTO, "belt/fadeout.wav", 1, ATTN_NORM); + } + + if(self.antigrav_time < time) + { + self.antigrav_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + + if(self.antigrav_finished < time) + { + sprint(self, "Antigrav Lost.\n"); + self.antigrav_finished = 0; + VR_ItemUtil_EntDelItem(self, IID_ANTIGRAV); + self.gravity = 1.0; + } + } }; @@ -1434,6 +1869,10 @@ Called every frame after physics are run */ void() PlayerPostThink = { + // FRIKBOT + if(BotPostFrame()) + return; + if(self.view_ofs == '0 0 0') { earthquake_postthink(); @@ -1460,7 +1899,15 @@ void() PlayerPostThink = if(self.deadflag) return; -// do weapon stuff + // ROGUE + if(cutscene_running) + { + xpackEnding(); + } + + // do weapon stuff + + VR_HandGrabUtil_UpdateState(self); PlayerVRMelee(); @@ -1475,7 +1922,7 @@ void() PlayerPostThink = sound(self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM); else if(self.jump_flag < -650) { - T_Damage (self, world, world, 5); + T_Damage(self, world, world, 5); sound(self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); self.deathtype = "falling"; } @@ -1501,10 +1948,36 @@ called when a player connects to a server */ void() ClientConnect = { - bprint (self.netname); - bprint (" entered the game\n"); + // FRIKBOT + ClientInRankings(); + + bprint(self.netname); + bprint(" entered the game\n"); -// a client connecting during an intermission can cause problems + //ZOID-- + self.suicide_count = 0; + self.ctf_killed = 0; + + SetMOTD(); + + // If this is our first connection, parm14 is < 0 + // Set lastteam negative. + if(parm14 < 0 && teamplay > 0) + { + if(cvar_hget(cvarh_gamecfg) & GAMECFG_USE_COLOR) + { + self.steam = self.team; // accept joining players color if legal + } + else + { + self.steam = -50; // always reassign + } + + TeamCheckLock(); + } + //--ZOID + + // a client connecting during an intermission can cause problems if(intermission_running) ExitIntermission(); }; @@ -1519,16 +1992,19 @@ called when a player disconnects from a server */ void() ClientDisconnect = { + // FRIKBOT + ClientDisconnected(); + if(gameover) return; // if the level end trigger has been activated, just return // since they aren't *really* leaving // let everyone else know - bprint (self.netname); - bprint (" left the game with "); - bprint (ftos(self.frags)); - bprint (" frags\n"); + bprint(self.netname); + bprint(" left the game with "); + bprint(ftos(self.frags)); + bprint(" frags\n"); sound(self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); set_suicide_frame(); }; @@ -1542,18 +2018,23 @@ called when a player dies */ void(entity targ, entity attacker) ClientObituary = { - local float rnum; - local string deathstring, deathstring2; + float rnum; + string deathstring = ""; + string deathstring2 = ""; rnum = random(); if(targ.classname == "player") { + // ZOID-- + TeamResetCarrier(targ); + // --ZOID + if(attacker.classname == "teledeath") { - bprint (targ.netname); - bprint (" was telefragged by "); - bprint (attacker.owner.netname); - bprint ("\n"); + bprint(targ.netname); + bprint(" was telefragged by "); + bprint(attacker.owner.netname); + bprint("\n"); attacker.owner.frags = attacker.owner.frags + 1; return; @@ -1561,9 +2042,9 @@ void(entity targ, entity attacker) ClientObituary = if(attacker.classname == "teledeath2") { - bprint ("Satan's power deflects "); - bprint (targ.netname); - bprint ("'s telefrag\n"); + bprint("Satan's power deflects "); + bprint(targ.netname); + bprint("'s telefrag\n"); targ.frags = targ.frags - 1; return; @@ -1575,23 +2056,41 @@ void(entity targ, entity attacker) ClientObituary = { // killed self attacker.frags = attacker.frags - 1; - bprint (targ.netname); + bprint(targ.netname); if(targ.weapon == WID_LIGHTNING && targ.waterlevel > 1) { - bprint (" discharges into the water.\n"); + bprint(" discharges into the water.\n"); return; } + if(targ.weapon == WID_GRENADE_LAUNCHER) - bprint (" tries to put the pin back in\n"); + { + bprint(" tries to put the pin back in\n"); + } + // ROGUE + //ZOID-- + //gibbed for changing teams + else if(teamplay && (targ.team != targ.steam)) + { + if(cvar_hget(cvarh_gamecfg) & GAMECFG_ALLOW_CHG) + { + bprint(" changed teams\n"); + } + else + { + bprint(" tried to change teams\n"); + } + } + //--ZOID //JIM - else if(rnum > 0.4 ) - bprint (" becomes bored with life\n"); + else if(rnum > 0.4) + bprint(" becomes bored with life\n"); else - bprint (" checks if his weapon is loaded\n"); + bprint(" checks if his weapon is loaded\n"); return; } - else if( (teamplay == 2) && (targ.team > 0)&&(targ.team == attacker.team) ) + else if((teamplay == 2) && (targ.team > 0)&&(targ.team == attacker.team)) { if(rnum < 0.25) deathstring = " mows down a teammate\n"; @@ -1601,37 +2100,49 @@ void(entity targ, entity attacker) ClientObituary = deathstring = " gets a frag for the other team\n"; else deathstring = " loses another friend\n"; - bprint (attacker.netname); - bprint (deathstring); + bprint(attacker.netname); + bprint(deathstring); attacker.frags = attacker.frags - 1; return; } else { - attacker.frags = attacker.frags + 1; + // ROGUE + if(teamplay == TEAM_DMATCH_TAG) + { + dmatch_score (targ, attacker); + } + else + { + attacker.frags = attacker.frags + 1; + //ZOID-- + TeamAssists(targ, attacker); + //--ZOID + } + //MED 01/19/97 if(empathyused == 1) { - bprint (targ.netname); + bprint(targ.netname); if(random()<0.5) - bprint (" shares "); + bprint(" shares "); else - bprint (" feels "); - bprint (attacker.netname); - bprint ("'s pain\n"); + bprint(" feels "); + bprint(attacker.netname); + bprint("'s pain\n"); return; } //MED 11/18/96 if(targ.dmg_inflictor.classname == "proximity_grenade") { - bprint (targ.netname); + bprint(targ.netname); if(random()<0.5) - bprint (" got too friendly with "); + bprint(" got too friendly with "); else - bprint (" did the rhumba with "); - bprint (attacker.netname); - bprint ("'s bomb\n"); + bprint(" did the rhumba with "); + bprint(attacker.netname); + bprint("'s bomb\n"); return; } rnum = attacker.weapon; @@ -1640,61 +2151,111 @@ void(entity targ, entity attacker) ClientObituary = deathstring = " was punched by "; deathstring2 = "\n"; } - if(rnum == WID_AXE) + else if(rnum == WID_AXE) { deathstring = " was ax-murdered by "; deathstring2 = "\n"; } - if(rnum == WID_SHOTGUN) + //ZOID-- + else if(rnum == WID_GRAPPLE) + { + deathstring = " was grappled by "; + deathstring2 = "\n"; + } + //--ZOID + else if(rnum == WID_SHOTGUN) { deathstring = " chewed on "; deathstring2 = "'s boomstick\n"; } - if(rnum == WID_SUPER_SHOTGUN) + else if(rnum == WID_SUPER_SHOTGUN) { deathstring = " ate 2 loads of "; deathstring2 = "'s buckshot\n"; } - if(rnum == WID_NAILGUN) + else if(rnum == WID_NAILGUN) { - deathstring = " was nailed by "; - deathstring2 = "\n"; + if(attacker.weaponflags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + deathstring = " was burned by "; + deathstring2 = "\n"; + } + else + { + deathstring = " was nailed by "; + deathstring2 = "\n"; + } } - if(rnum == WID_SUPER_NAILGUN) + else if(rnum == WID_SUPER_NAILGUN) { - deathstring = " was punctured by "; - deathstring2 = "\n"; + if(attacker.weaponflags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + deathstring = " was burned by "; + deathstring2 = "\n"; + } + else + { + deathstring = " was punctured by "; + deathstring2 = "\n"; + } } - if(rnum == WID_GRENADE_LAUNCHER) + else if(rnum == WID_GRENADE_LAUNCHER) { - deathstring = " eats "; - deathstring2 = "'s pineapple\n"; + if(attacker.weaponflags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + deathstring = " was blasted to bits by "; + deathstring2 = "\n"; + } + else + { + deathstring = " eats "; + deathstring2 = "'s pineapple\n"; + } + if(targ.health < -40) { deathstring = " was gibbed by "; deathstring2 = "'s grenade\n"; } + } - if(rnum == WID_ROCKET_LAUNCHER) + else if(rnum == WID_ROCKET_LAUNCHER) { - deathstring = " rides "; - deathstring2 = "'s rocket\n"; + if(attacker.weaponflags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + deathstring = " was blasted to bits by "; + deathstring2 = "\n"; + } + else + { + deathstring = " rides "; + deathstring2 = "'s rocket\n"; + } + if(targ.health < -40) { deathstring = " was gibbed by "; deathstring2 = "'s rocket\n" ; } } - if(rnum == WID_LIGHTNING) + else if(rnum == WID_LIGHTNING) { - deathstring = " accepts "; - if(attacker.waterlevel > 1) - deathstring2 = "'s discharge\n"; + if(attacker.weaponflags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + deathstring = " was fused by "; + deathstring2 = "\n"; + } else - deathstring2 = "'s shaft\n"; + { + deathstring = " accepts "; + if(attacker.waterlevel > 1) + deathstring2 = "'s discharge\n"; + else + deathstring2 = "'s shaft\n"; + } } -//MED - if(rnum == WID_LASER_CANNON) + //MED + else if(rnum == WID_LASER_CANNON) { if(random()<0.5) { @@ -1712,10 +2273,10 @@ void(entity targ, entity attacker) ClientObituary = deathstring = " was slammed by "; deathstring2 = "'s hammer\n"; } - bprint (targ.netname); - bprint (deathstring); - bprint (attacker.netname); - bprint (deathstring2); + bprint(targ.netname); + bprint(deathstring); + bprint(attacker.netname); + bprint(deathstring2); } return; } @@ -1724,60 +2285,79 @@ void(entity targ, entity attacker) ClientObituary = targ.frags = targ.frags - 1; // killed self rnum = targ.watertype; - bprint (targ.netname); + bprint(targ.netname); //JIM - if( attacker.deathtype ) + if(attacker.deathtype != NULLSTR) { - bprint( " " ); - bprint ( attacker.deathtype ); - bprint( "\n" ); + bprint(" "); + bprint(attacker.deathtype); + bprint("\n"); return; } + // TODO VR: (P2) elses... + if(attacker.flags & FL_MONSTER) { if(attacker.classname == "monster_army") - bprint (" was shot by a Grunt\n"); + bprint(" was shot by a Grunt\n"); if(attacker.classname == "monster_demon1") - bprint (" was eviscerated by a Fiend\n"); + bprint(" was eviscerated by a Fiend\n"); if(attacker.classname == "monster_dog") - bprint (" was mauled by a Rottweiler\n"); + bprint(" was mauled by a Rottweiler\n"); if(attacker.classname == "monster_dragon") - bprint (" was fried by a Dragon\n"); + bprint(" was annihilated by the Dragon\n"); + if(attacker.classname == "monster_dragon_dead") + bprint(" was squashed by the Dragon\n"); if(attacker.classname == "monster_enforcer") - bprint (" was blasted by an Enforcer\n"); + bprint(" was blasted by an Enforcer\n"); if(attacker.classname == "monster_fish") - bprint (" was fed to the Rotfish\n"); + bprint(" was fed to the Rotfish\n"); if(attacker.classname == "monster_hell_knight") - bprint (" was slain by a Death Knight\n"); + bprint(" was slain by a Death Knight\n"); if(attacker.classname == "monster_knight") - bprint (" was slashed by a Knight\n"); + bprint(" was slashed by a Knight\n"); if(attacker.classname == "monster_ogre") - bprint (" was destroyed by an Ogre\n"); + bprint(" was destroyed by an Ogre\n"); if(attacker.classname == "monster_oldone") - bprint (" became one with Shub-Niggurath\n"); + bprint(" became one with Shub-Niggurath\n"); if(attacker.classname == "monster_shalrath") - bprint (" was exploded by a Vore\n"); + bprint(" was exploded by a Vore\n"); if(attacker.classname == "monster_shambler") - bprint (" was smashed by a Shambler\n"); + bprint(" was smashed by a Shambler\n"); if(attacker.classname == "monster_tarbaby") - bprint (" was slimed by a Spawn\n"); + bprint(" was slimed by a Spawn\n"); if(attacker.classname == "monster_vomit") - bprint (" was vomited on by a Vomitus\n"); + bprint(" was vomited on by a Vomitus\n"); if(attacker.classname == "monster_wizard") - bprint (" was scragged by a Scrag\n"); + bprint(" was scragged by a Scrag\n"); if(attacker.classname == "monster_zombie") - bprint (" joins the Zombies\n"); -//MED - if(attacker.classname == "monster_gremlin") - bprint (" was outsmarted by a Gremlin\n"); -//MED - if(attacker.classname == "monster_scourge") - bprint (" was stung by a Centroid\n"); -//MED - if(attacker.classname == "monster_armagon") - bprint (" was outgunned by Armagon\n"); + bprint(" joins the Zombies\n"); + + // HIPNOTIC + if(attacker.classname == "monster_gremlin") + bprint(" was outsmarted by a Gremlin\n"); + if(attacker.classname == "monster_scourge") + bprint(" was stung by a Centroid\n"); + if(attacker.classname == "monster_armagon") + bprint(" was outgunned by Armagon\n"); + + // ROGUE + if(attacker.classname == "monster_eel") + bprint(" was electrified by an Eel\n"); + if(attacker.classname == "monster_wrath") + bprint(" was disintegrated by a Wrath\n"); + if(attacker.classname == "monster_super_wrath") + bprint(" was obliterated by an Overlord\n"); + if(attacker.classname == "monster_sword") + bprint(" was slit open by a Phantom Swordsman\n"); + if(attacker.classname == "monster_lava_man") + bprint(" fries in Hephaestus' fury\n"); + if(attacker.classname == "monster_morph") + bprint(" was crushed by a Guardian\n"); + if(attacker.classname == "monster_mummy") + bprint(" was Mummified\n"); return; } @@ -1785,33 +2365,89 @@ void(entity targ, entity attacker) ClientObituary = // tricks and traps if(attacker.classname == "explo_box") { - bprint (" blew up\n"); + bprint(" blew up\n"); return; } if(attacker.solid == SOLID_BSP && attacker != world) { - bprint (" was squished\n"); + bprint(" was squished\n"); return; } if(targ.deathtype == "falling") { targ.deathtype = ""; - bprint (" fell to his death\n"); + bprint(" fell to his death\n"); return; } if(attacker.classname == "trap_shooter" || attacker.classname == "trap_spikeshooter") { - bprint (" was spiked\n"); + bprint(" was spiked\n"); return; } if(attacker.classname == "fireball") { - bprint (" ate a lavaball\n"); + bprint(" ate a lavaball\n"); return; } if(attacker.classname == "trigger_changelevel") { - bprint (" tried to leave\n"); + bprint(" tried to leave\n"); + return; + } + if(attacker.classname == "trigger_deathpit") // HONEY + { + if(attacker.message != NULLSTR) { + bprint(attacker.message); + } else { + bprint(" fell into a deep and dark crevasse"); + } + + bprint("\n"); + return; + } + + // ROGUE + if(attacker.classname == "ltrail_start" || + attacker.classname == "ltrail_relay") + { + bprint(" rode the lightning\n"); + return; + } + if(attacker.classname == "pendulum") + { + bprint(" was cleaved in two\n"); + return; + } + if(attacker.classname == "buzzsaw") + { + bprint(" was sliced to pieces\n"); + return; + } + if(attacker.classname == "plasma") + { + bprint(" was turned to plasma\n"); + return; + } + if(attacker.classname == "Vengeance") + { + // vengeance sphere doesn't count as a negative frag + targ.frags = targ.frags + 1; + bprint(" was purged by the Vengeance Sphere\n"); + return; + } + if(attacker.classname == "power_shield") + { + // shield attacks should count for frags too.. + // shield death doesn't count as a negative frag + targ.frags = targ.frags + 1; + attacker.owner.frags = attacker.owner.frags + 1; + TeamAssists(targ, attacker.owner); //PGM + + deathstring = " was smashed by "; + deathstring2 = "\n"; + bprint(deathstring); + bprint(attacker.owner.netname); + bprint(deathstring2); return; } @@ -1820,30 +2456,30 @@ void(entity targ, entity attacker) ClientObituary = if(rnum == -3) { if(random() < 0.5) - bprint (" sleeps with the fishes\n"); + bprint(" sleeps with the fishes\n"); else - bprint (" sucks it down\n"); + bprint(" sucks it down\n"); return; } else if(rnum == -4) { if(random() < 0.5) - bprint (" gulped a load of slime\n"); + bprint(" gulped a load of slime\n"); else - bprint (" can't exist on slime alone\n"); + bprint(" can't exist on slime alone\n"); return; } else if(rnum == -5) { if(targ.health < -15) { - bprint (" burst into flames\n"); + bprint(" burst into flames\n"); return; } if(random() < 0.5) - bprint (" turned into hot slag\n"); + bprint(" turned into hot slag\n"); else - bprint (" visits the Volcano God\n"); + bprint(" visits the Volcano God\n"); return; } @@ -1851,12 +2487,12 @@ void(entity targ, entity attacker) ClientObituary = if(targ.deathtype == "falling") { targ.deathtype = ""; - bprint (" fell to his death\n"); + bprint(" fell to his death\n"); return; } // hell if I know; he's just dead!!! - bprint (" died\n"); + bprint(" died\n"); } } }; @@ -1930,10 +2566,10 @@ void(float xHand, float xInMelee, float xHandVelMag, float* xOutMeleeAttackFinished, float* xOutInMelee, float* xMeleeHitSoundPlayed) PlayerVRMeleeImpl = { - local float vr_melee_threshold; - vr_melee_threshold = cvar("vr_melee_threshold"); + float vr_melee_threshold; + vr_melee_threshold = cvar_hget(cvarh_vr_melee_threshold); - if(cvar("vr_enabled") == 1 && time >= xInMelee && xHandVelMag > vr_melee_threshold) + if(cvar_hget(cvarh_vr_enabled) == 1 && time >= xInMelee && xHandVelMag > vr_melee_threshold) { if(!DoXHandMelee(xHand, WID_FIST, "knight/sword1.wav", W_FistMelee)) if(!DoXHandMelee(xHand, WID_AXE, "weapons/ax1.wav", W_FireAxe)) @@ -1950,8 +2586,74 @@ void(float xHand, float xInMelee, float xHandVelMag, } } +void() PlayerVRMeleeHeadbutt = +{ + float headvelLen; + headvelLen = vlen(self.headvel); + + if(headvelLen >= cvar_hget(cvarh_vr_headbutt_velocity_threshold)) + { + if(!self.in_headbutt) + { + self.headbutt_start_time = time; + self.in_headbutt = TRUE; + self.headbutt_max_vec = self.headvel; + sound(self, CHAN_OTHER, "knight/sword1.wav", 1, ATTN_NORM); + } + else if(vlen(self.headbutt_max_vec) < headvelLen) + { + self.headbutt_max_vec = self.headvel; + } + } + else if(self.in_headbutt) + { + self.in_headbutt = FALSE; + + float xdmg; + xdmg = ( + vlen(self.headbutt_max_vec) / cvar_hget(cvarh_vr_headbutt_velocity_threshold) + ) * cvar_hget(cvarh_vr_headbutt_damage_mult); + + vector dir; + dir = normalize(self.headbutt_max_vec); + + vector adjOrigin; + adjOrigin = self.origin + '0 0 25'; + + traceline(adjOrigin, adjOrigin + dir * VRMeleeRange(28), FALSE, self); + + if(trace_fraction != 1.0) + { + sound(self, CHAN_OTHER, "fisthit.wav", 1.0, ATTN_NORM); + + if(trace_ent.takedamage) + { + VRGunHaptic(cVR_OffHand, 0.15, 100, 1.0); + VRGunHaptic(cVR_MainHand, 0.15, 100, 1.0); + + trace_ent.axhitme = 1; + SpawnBloodSplash(trace_endpos, xdmg); + T_Damage_VRMelee(trace_ent, self, self, xdmg); + } + else + { + // hit wall + VRGunHaptic(cVR_OffHand, 0.15, 100, 1.0); + VRGunHaptic(cVR_MainHand, 0.15, 100, 1.0); + + PainSound(); + SpawnBloodSplash(trace_endpos, xdmg); + + BroadcastGunshotEffect(trace_endpos); + } + } + } +} + void() PlayerVRMelee = { + PlayerVRMeleeHeadbutt(); + PlayerVRMeleeImpl( cVR_MainHand, self.in_melee, diff --git a/QC/combat.qc b/QC/combat.qc index 1f9608e3..11c8fc1a 100644 --- a/QC/combat.qc +++ b/QC/combat.qc @@ -2,12 +2,6 @@ float IsExplosionDamage; -void() T_MissileTouch; -void() info_player_start; -void(entity targ, entity attacker) ClientObituary; - -void() monster_death_use; - //============================================================================ /* @@ -58,13 +52,16 @@ Killed */ void(entity targ, entity attacker) Killed = { - local entity oself; + entity oself; oself = self; self = targ; if(self.health < -99) + { self.health = -99; // don't let sbar look bad if a player + } + //MED if(self.charmed) { @@ -106,18 +103,9 @@ void(entity targ, entity attacker) Killed = self = oself; }; -// TODO VR: (P2) rogue -// ==== -// Function prototype for shield impact handler. -// ==== -// float(entity targ, entity inflictor, entity attacker, float damage) shield_hit; - -void(vector org, float damage) SpawnBloodSplash; - - float() getVRMeleeBloodlust = { - return cvar("vr_melee_bloodlust"); + return cvar_hget(cvarh_vr_melee_bloodlust); } /* @@ -130,86 +118,114 @@ This should be the only function that ever reduces health. */ //MED 01/10/97 added empathyused variable float empathyused; -void(entity targ, entity inflictor, entity attacker, float damage, float isVRMelee) T_DamageImpl = +float(entity targ, entity inflictor, entity attacker, float damage, float isVRMelee) T_DamageImpl = { - local vector dir; - local entity oldself; - local float save; - local float take; + vector dir; + entity oldself; + float save; + float take; if(!targ.takedamage) - return; + { + return FALSE; + } if(targ.classname == "trigger_explosion") { - if( IsExplosionDamage != 1) - return; + if(IsExplosionDamage != 1) + { + return FALSE; + } } + IsExplosionDamage = 0; - // TODO VR: (P2) rogue - // if(targ.items2 & IT2_SHIELD) - // { - // // Allow some damage to pass through. - // damage = shield_hit(targ, inflictor, attacker, damage); - // if(damage == 0) - // return; - // } + if(VR_ItemUtil_EntHasItem(targ, IID_SHIELD)) + { + // Allow some damage to pass through. + damage = shield_hit(targ, inflictor, attacker, damage); + + if(damage == 0) + { + return FALSE; + } + } + + if(discharged && targ.wetsuit_finished) + { + return FALSE; + } + + //MED + // moved damage_attacker down a bit - if(discharged && targ.wetsuit_finished ) - return; -//MED moved damage_attacker down a bit + // HONEY + // cg: check if this needs a specific damage type + if((targ.flags & FL_SPECIFICDAMAGE) && !(attacker.damage_weapon & targ.items)) { + return FALSE; + } -// check for quad damage powerup on the attacker + // check for quad damage powerup on the attacker if(attacker.super_damage_finished > time) + { damage = damage * 4; + } - // TODO VR: (P2) rogue // rune power up (Black Magic) - // if(deathmatch) - // damage = RuneApplyBlack(damage, attacker); + if(deathmatch) + { + damage = RuneApplyBlack(damage, attacker); + } + //MED + //check for empathy shields + if(VR_ItemUtil_EntHasItem(targ, IID_EMPATHY_SHIELDS) && + !VR_ItemUtil_EntHasItem(inflictor, IID_EMPATHY_SHIELDS) && + (targ != attacker)) + { + empathyused = 1; + damage = damage/2; + T_DamageImpl (attacker,targ,targ,damage,isVRMelee); + empathyused = 0; + } -//MED -//check for empathy shields - if((targ.hipnotic_items & HIP_IT_EMPATHY_SHIELDS) && !(inflictor.hipnotic_items & HIP_IT_EMPATHY_SHIELDS) && (targ != attacker)) - { - empathyused = 1; - damage = damage/2; - T_DamageImpl (attacker,targ,targ,damage,isVRMelee); - empathyused = 0; - } -//MED -// used by buttons and triggers to set activator for target firing + //MED + // used by buttons and triggers to set activator for target firing damage_attacker = attacker; -//MED -// used to keep track of what hit us - damage_inflictor = inflictor; + //MED + // used to keep track of what hit us + damage_inflictor = inflictor; // save damage based on the target's armor level -// TODO VR: (P2) rogue -//ZOID-- - // if(TeamArmorDam(targ, inflictor, attacker, damage)) - save = ceil(targ.armortype*damage); - // else - // save = 0; -//--ZOID + //ZOID-- + if(TeamArmorDam(targ, inflictor, attacker, damage)) + { + save = ceil(targ.armortype * damage); + } + else + { + save = 0; + } + //--ZOID if(save >= targ.armorvalue) { save = targ.armorvalue; targ.armortype = 0; // lost all armor - targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); + + VR_ItemUtil_EntDelItem(targ, IID_ARMOR1); + VR_ItemUtil_EntDelItem(targ, IID_ARMOR2); + VR_ItemUtil_EntDelItem(targ, IID_ARMOR3); } targ.armorvalue = targ.armorvalue - save; take = ceil(damage-save); -// add to the damage total for clients, which will be sent as a single -// message at the end of the frame -// FIXME: remove after combining shotgun blasts? + // add to the damage total for clients, which will be sent as a single + // message at the end of the frame + // FIXME: remove after combining shotgun blasts? if(targ.flags & FL_CLIENT) { targ.dmg_take = targ.dmg_take + take; @@ -217,17 +233,20 @@ void(entity targ, entity inflictor, entity attacker, float damage, float isVRMel targ.dmg_inflictor = inflictor; } -// figure momentum add - if( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) + // figure momentum add + if((inflictor != world) && (targ.movetype == MOVETYPE_WALK)) { dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; dir = normalize(dir); targ.velocity = targ.velocity + dir*damage*8; } -// check for godmode or invincibility + // check for godmode or invincibility if(targ.flags & FL_GODMODE) - return; + { + return FALSE; + } + if(targ.invincible_finished >= time) { if(targ.invincible_sound < time) @@ -235,10 +254,12 @@ void(entity targ, entity inflictor, entity attacker, float damage, float isVRMel sound(targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); targ.invincible_sound = time + 2; } - return; + + return TRUE; } -//MED - if(targ.hipnotic_items & HIP_IT_EMPATHY_SHIELDS) + + //MED + if(VR_ItemUtil_EntHasItem(targ, IID_EMPATHY_SHIELDS)) { if(self.empathy_sound < time) { @@ -247,29 +268,34 @@ void(entity targ, entity inflictor, entity attacker, float damage, float isVRMel } } -// team play damage avoidance -// if( (teamplay == 1) && (targ.team > 0)&&(targ.team == attacker.team) ) - if( (teamplay == 1) && (targ.team > 0) && (targ.team == attacker.team) - && (targ != attacker) - && (attacker.classname == "player") - && (inflictor.classname != "door") ) // because squishing a teammate is still possible - return; + // team play damage avoidance + //ZOID-- + if(!TeamHealthDam(targ, inflictor, attacker, damage)) + { + return TRUE; // same team + } + //--ZOID if(targ.classname == "player") { SpawnBloodSplash(targ.origin, take / 2.0); SpawnBloodSplash(targ.handpos, take / 2.0); SpawnBloodSplash(targ.offhandpos, take / 2.0); - haptic(0, 0.0, 0.5, 30, 1.0); - haptic(1, 0.0, 0.5, 30, 1.0); + + if(targ.ishuman) + { + haptic(cVR_OffHand, 0.0, 0.5, 30, 1.0); + haptic(cVR_MainHand, 0.0, 0.5, 30, 1.0); + } } -// TODO VR: (P2) rogue -// rune power up (Earth Magic) - // if(deathmatch) - // take = RuneApplyEarth(take, targ); + // rune power up (Earth Magic) + if(deathmatch) + { + take = RuneApplyEarth(take, targ); + } -// do the damage + // do the damage targ.health = targ.health - take; if(targ.health <= 0) @@ -279,12 +305,15 @@ void(entity targ, entity inflictor, entity attacker, float damage, float isVRMel // VR melee takedown if(getVRMeleeBloodlust() == QVR_MELEEBLOODLUST_ENABLED) { - T_Heal(attacker, ceil(1 + take / 12), 1); + float bloodlustAmount = ceil(1 + take / 12) * + cvar_hget(cvarh_vr_melee_bloodlust_mult) * 0.75; + + T_Heal(attacker, bloodlustAmount, 1); } } Killed (targ, attacker); - return; + return TRUE; } else { @@ -298,23 +327,26 @@ void(entity targ, entity inflictor, entity attacker, float damage, float isVRMel } } -// react to the damage + // react to the damage oldself = self; self = targ; -//MED 10/17/96 added charmed stuff - if( (self.flags & FL_MONSTER) && attacker != world) + //MED 10/17/96 added charmed stuff + if((self.flags & FL_MONSTER) && attacker != world) { - // get mad unless of the same class (except for soldiers) - if(self != attacker && attacker != self.enemy && (self.charmer!=attacker)) + // get mad unless of the same class (except for soldiers) + if(self != attacker && attacker != self.enemy && (self.charmer != attacker)) { - if( (self.classname != attacker.classname) - || (self.classname == "monster_army" ) || (self.classname == "monster_armagon" ) ) + if((self.classname != attacker.classname) + || (self.classname == "monster_army") || (self.classname == "monster_armagon")) { - if( self.classname != "monster_dragon") + if(self.classname != "monster_dragon") { if(self.enemy.classname == "player") + { self.oldenemy = self.enemy; + } + self.enemy = attacker; FoundTarget(); } @@ -331,54 +363,17 @@ void(entity targ, entity inflictor, entity attacker, float damage, float isVRMel } self = oldself; + return TRUE; }; -void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = +float(entity targ, entity inflictor, entity attacker, float damage) T_Damage = { - T_DamageImpl(targ, inflictor, attacker, damage, 0); + return T_DamageImpl(targ, inflictor, attacker, damage, 0); }; -void(entity targ, entity inflictor, entity attacker, float damage) T_Damage_VRMelee = +float(entity targ, entity inflictor, entity attacker, float damage) T_Damage_VRMelee = { - T_DamageImpl(targ, inflictor, attacker, damage, 1); -}; - -/* -============ -T_EELZap -============ -*/ -void(entity inflictor, entity attacker, float damage) T_EELZap = -{ - local float points; - local entity head; - local vector org; - - head = findradius(inflictor.origin, damage+40); - - while(head) - { - if(head.takedamage) - { - org = head.origin + (head.mins + head.maxs)*0.5; - points = 0.5*vlen (inflictor.origin - org); - if(points < 0) - points = 0; - points = damage - points; - if(head == attacker) - points = points * 0.5; - if(points > 0) - { - if(CanDamage (head, inflictor)) - { // eels take no damage from this attack - if(head.classname != "monster_eel" && - (head.flags & FL_INWATER)) - T_Damage (head, inflictor, attacker, points); - } - } - } - head = head.chain; - } + return T_DamageImpl(targ, inflictor, attacker, damage, 1); }; /* @@ -388,9 +383,9 @@ T_RadiusDamage */ void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage = { - local float points; - local entity head; - local vector org; + float points; + entity head; + vector org; IsExplosionDamage = 1; @@ -403,7 +398,7 @@ void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDam if(head.takedamage) { org = head.origin + (head.mins + head.maxs)*0.5; - points = 0.5*vlen (inflictor.origin - org); + points = 0.5*vlen(inflictor.origin - org); if(points < 0) points = 0; points = damage - points; @@ -411,12 +406,12 @@ void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDam points = points * 0.5; if(points > 0) { - if(CanDamage (head, inflictor)) + if(CanDamage(head, inflictor)) { // shambler takes half damage from all explosions if(head.classname == "monster_shambler") - T_Damage (head, inflictor, attacker, points*0.5); + T_Damage(head, inflictor, attacker, points*0.5); else - T_Damage (head, inflictor, attacker, points); + T_Damage(head, inflictor, attacker, points); } } } @@ -432,8 +427,8 @@ T_BeamDamage */ void(entity attacker, float damage) T_BeamDamage = { - local float points; - local entity head; + float points; + entity head; head = findradius(attacker.origin, damage+40); @@ -441,7 +436,7 @@ void(entity attacker, float damage) T_BeamDamage = { if(head.takedamage) { - points = 0.5*vlen (attacker.origin - head.origin); + points = 0.5*vlen(attacker.origin - head.origin); if(points < 0) points = 0; points = damage - points; @@ -449,12 +444,12 @@ void(entity attacker, float damage) T_BeamDamage = points = points * 0.5; if(points > 0) { - if(CanDamage (head, attacker)) + if(CanDamage(head, attacker)) { if(head.classname == "monster_shambler") - T_Damage (head, attacker, attacker, points*0.5); + T_Damage(head, attacker, attacker, points*0.5); else - T_Damage (head, attacker, attacker, points); + T_Damage(head, attacker, attacker, points); } } } diff --git a/QC/defs.qc b/QC/defs.qc index 0c13932e..8cf12b4a 100644 --- a/QC/defs.qc +++ b/QC/defs.qc @@ -1,893 +1,827 @@ +#include "vr_macros.qc" + +// +// +// +// ---------------------------------------------------------------------------- +// System globals +// ---------------------------------------------------------------------------- -/* -============================================================================== +entity self; +entity other; +entity world; - SOURCE FOR GLOBALVARS_T C STRUCTURE +float time; +float frametime; -============================================================================== -*/ +float force_retouch; // Force all entities to touch triggers + // next frame. This is needed because + // non-moving things don't normally scan + // for triggers, and when a trigger is + // created (like a teleport trigger), it + // needs to catch everything. + // decremented each frame, so set to 2 + // to guarantee everything is touched. -// -// system globals -// -entity self; -entity other; -entity world; -float time; -float frametime; +string mapname; -float force_retouch; // force all entities to touch triggers - // next frame. this is needed because - // non-moving things don't normally scan - // for triggers, and when a trigger is - // created (like a teleport trigger), it - // needs to catch everything. - // decremented each frame, so set to 2 - // to guarantee everything is touched -string mapname; +float deathmatch; +float coop; +float teamplay; -float deathmatch; -float coop; -float teamplay; +float serverflags; // Propagated from level to level, used to + // keep track of completed episodes. -float serverflags; // propagated from level to level, used to - // keep track of completed episodes +float total_secrets; +float total_monsters; +float found_secrets; // Number of secrets found. +float killed_monsters; // Number of monsters killed. -float total_secrets; -float total_monsters; - -float found_secrets; // number of secrets found -float killed_monsters; // number of monsters killed +float spawnServerFromSaveFile; // Whether the last `OnSpawnServerXXX` call was + // from a save file or a brand new loaded map. +// +// +// +// ---------------------------------------------------------------------------- +// Spawnparms +// ---------------------------------------------------------------------------- -// spawnparms are used to encode information about clients across server -// level changes -float parm1; // items -float parm2; // health -float parm3; // armorvalue -float parm4; // ammo_shells -float parm5; // ammo_nails -float parm6; // ammo_rockets -float parm7; // ammo_cells -float parm8; // weapon -float parm9; // armortype -float parm10; // weapon2 -float parm11; // holsterweapon0 -float parm12; // holsterweapon1 -float parm13; // holsterweapon2 -float parm14; // holsterweapon3 -float parm15; // holsterweapon4 -float parm16; // holsterweapon5 +// Used to encode information about clients across server level changes. +float parm1; // Field: `.items`. +float parm2; // Field: `.health`. +float parm3; // Field: `.armorvalue`. +float parm4; // Field: `.ammo_shells`. +float parm5; // Field: `.ammo_nails`. +float parm6; // Field: `.ammo_rockets`. +float parm7; // Field: `.ammo_cells`. +float parm8; // Field: `.weapon`. +float parm9; // Field: `.armortype`. +float parm10; // Field: `.weapon2`. +float parm11; // Field: `.holsterweapon0`. +float parm12; // Field: `.holsterweapon1`. +float parm13; // Field: `.holsterweapon2`. +float parm14; // Field: `.holsterweapon3`. +float parm15; // Field: `.holsterweapon4`. +float parm16; // Field: `.holsterweapon5`. +float parm17; // Field: `.hipnotic_items`. +float parm18; // Field: `.rogue_items`. +float parm19; // Field: `.ammo_lava_nails`. +float parm20; // Field: `.ammo_multi_rockets`. +float parm21; // Field: `.ammo_plasma`. +float parm22; // Field: `.steam`. +float parm23; // Field: `.weaponflags`. +float parm24; // Field: `.weaponflags2`. +float parm25; // Field: `.holsterweaponflags0`. +float parm26; // Field: `.holsterweaponflags1`. +float parm27; // Field: `.holsterweaponflags2`. +float parm28; // Field: `.holsterweaponflags3`. +float parm29; // Field: `.holsterweaponflags4`. +float parm30; // Field: `.holsterweaponflags5`. +float parm31; // Unused. +float parm32; // Unused. // -// global variables set by built in functions // -vector v_forward, v_up, v_right; // set by makevectors() +// +// ---------------------------------------------------------------------------- +// Global variables set by builtins +// ---------------------------------------------------------------------------- + +vector v_forward; // Set by `makevectors` and `makeforward`. +vector v_up; // Set by `makevectors`. +vector v_right; // Set by `makevectors`. -// set by traceline / tracebox -float trace_allsolid; -float trace_startsolid; -float trace_fraction; -vector trace_endpos; -vector trace_plane_normal; -float trace_plane_dist; -entity trace_ent; -float trace_inopen; -float trace_inwater; +// Set by `traceline` and/or `tracebox`. +float trace_allsolid; +float trace_startsolid; +float trace_fraction; +vector trace_endpos; +vector trace_plane_normal; +float trace_plane_dist; +entity trace_ent; +float trace_inopen; +float trace_inwater; -entity msg_entity; // destination of single entity writes +entity msg_entity; // Destination of single entity writes. // -// required prog functions // -void() main; // only for testing +// +// ---------------------------------------------------------------------------- +// Required prog functions +// ---------------------------------------------------------------------------- -void() StartFrame; +void() main; // Only for testing. -void() PlayerPreThink; -void() PlayerPostThink; +void() StartFrame; -void() ClientKill; -void() ClientConnect; -void() PutClientInServer; // call after setting the parm1... parms -void() ClientDisconnect; +void() PlayerPreThink; +void() PlayerPostThink; -void() SetNewParms; // called when a client first connects to - // a server. sets parms so they can be - // saved off for restarts +void() ClientKill; +void() ClientConnect; +void() PutClientInServer; // Call after setting the parm1... parms. +void() ClientDisconnect; -void() SetChangeParms; // call to set parms for self so they can - // be saved for a level transition +void() SetNewParms; // Called when a client first connects to + // a server. Sets parms so they can be + // saved off for restarts. +void() SetChangeParms; // Call to set parms for self so they can + // be saved for a level transition. -//================================================ -void end_sys_globals; // flag for structure dumping -//================================================ +void() OnSpawnServerBeforeLoad; // Called when a new server + // is spawned, before + // loading any entities. -/* -============================================================================== +void() OnSpawnServerAfterLoad; // Called when a new server + // is spawned, after loading + // all the entities. - SOURCE FOR ENTVARS_T C STRUCTURE +void() OnLoadGame; // Called after loading a saved game, after spawning all the + // saved edicts. -============================================================================== -*/ +// +// +// +// ---------------------------------------------------------------------------- +// Special flag (!) +// ---------------------------------------------------------------------------- +void end_sys_globals; // Flag for structure dumping. + +// // -// system fields (*** = do not set in prog code, maintained by C code) // -.float modelindex; // *** model index in the precached list -.vector absmin, absmax; // *** origin + mins / maxs +// ---------------------------------------------------------------------------- +// System fields +// ---------------------------------------------------------------------------- -.float ltime; // local time for entity -.float movetype; -.float solid; +// `(***)` = do not set in prog code, maintained by C code) -.vector origin; // *** -.vector oldorigin; // *** -.vector velocity; -.vector angles; -.vector avelocity; -.vector scale; -.vector scale_origin; +.float modelindex; // (***) model index in the precached list -.vector punchangle; // temp angle adjust from damage or recoil +.vector absmin, absmax; // (***) origin + mins / maxs -.string classname; // spawn function -.string model; -.float frame; -.float skin; -.float effects; +.float ltime; // Local time for entity. -.vector mins, maxs; // bounding box extents reletive to origin -.vector size; // maxs - mins +.float movetype; +.float solid; -.void() touch; -.void() handtouch; // touched by VR hand -.void() vr_wpntouch; // touched by VR weapon -.void() use; -.void() think; -.void() think2; -.void() blocked; // for doors or plats, called when can't push other +.vector origin; // (***) +.vector oldorigin; // (***) +.vector velocity; +.vector angles; +.vector avelocity; -.float nextthink; -.float nextthink2; -.entity groundentity; +.vector punchangle; // Temp angle adjust from damage or recoil. -// stats -.float health; -.float frags; +.string classname; // Spawn function. -.float weapon; // WID -.string weaponmodel; -.float weaponframe; +.string model; -// QUAKE VR -.float weapon2; // WID -.string weaponmodel2; -.float weaponframe2; +.float frame; +.float skin; +.float effects; -// TODO VR: (P2) document, check meaning of prevweapon -.float prevweapon; -.float prevweapon2; -.float holsterweapon0; -.float holsterweapon1; -.float holsterweapon2; -.float holsterweapon3; -.float holsterweapon4; -.float holsterweapon5; -.string holsterweaponmodel0; -.string holsterweaponmodel1; -.string holsterweaponmodel2; -.string holsterweaponmodel3; -.string holsterweaponmodel4; -.string holsterweaponmodel5; +.vector mins, maxs; // Bounding box extents reletive to origin. +.vector size; // `maxs - mins`. -.float currentammo; -.float currentammo2; // off-hand +.void() touch; +.void() use; +.void() think; +.void() blocked; // For doors or plats, called when can't push other. -.float ammocounter; -.float ammocounter2; // off-hand +.float nextthink; +.entity groundentity; -.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; +// Stats. +.float health; +.float frags; -.float items; // bit flags +.float weapon; // Weapon ID. +.string weaponmodel; +.float weaponframe; -.float takedamage; -.entity chain; -.float deadflag; +.float currentammo; -.vector view_ofs; // add to origin to get eye point +.float ammocounter; +.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; -.float button0; // fire -.float button1; // use -.float button2; // jump -.float button3; // off-hand fire +.float items; // Bit flags. -.float impulse; // weapon changes +.float takedamage; +.entity chain; +.float deadflag; -.float fixangle; -.vector v_angle; // view / targeting angle for players -.float idealpitch; // calculated pitch angle for lookup up slopes +.vector view_ofs; // Add to origin to get eye point. -.string netname; +.float button0; // Fire. +.float button1; // Use. +.float button2; // Jump. -.entity enemy; +.float impulse; // Weapon changes. -.float flags; +.float fixangle; +.vector v_angle; // View / targeting angle for players. +.float idealpitch; // Calculated pitch angle for lookup up slopes. -.float colormap; -.float team; +.string netname; -.float max_health; // players maximum health is stored here +.entity enemy; -.float teleport_time; // don't back up +.float flags; -.float armortype; // save this fraction of incoming damage -.float armorvalue; +.float colormap; +.float team; -.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes -.float watertype; // a contents value -.float lastwatertime; // time of last water transition +.float max_health; // Players maximum health is stored here. -.float ideal_yaw; -.float yaw_speed; +.float teleport_time; // Don't back up. -.entity aiment; +.float armortype; // Save this fraction of incoming damage. +.float armorvalue; -.entity goalentity; // a movetarget or an enemy +.float waterlevel; // 0 = not in, 1 = feet, 2 = waist, 3 = eyes. +.float watertype; // A contents value. +.float lastwatertime; // Time of last water transition. -.float spawnflags; +.float ideal_yaw; +.float yaw_speed; -.string target; -.string targetname; +.entity aiment; -// damage is accumulated through a frame. and sent as one single -// message, so the super shotgun doesn't generate huge messages -.float dmg_take; -.float dmg_save; -.entity dmg_inflictor; +.entity goalentity; // A movetarget or an enemy. -.entity owner; // who launched a missile -.vector movedir; // mostly for doors, but also used for waterjump +.float spawnflags; -.string message; // trigger messages +.string target; +.string targetname; -.float sounds; // either a cd track number or sound number +// Damage is accumulated through a frame, and sent as one single +// message, so the super shotgun doesn't generate huge messages. +.float dmg_take; +.float dmg_save; +.entity dmg_inflictor; -.string noise, noise1, noise2, noise3; // contains names of wavs to play +.entity owner; // Who launched a missile. +.vector movedir; // Mostly for doors, but also used for waterjump. -.vector handpos; -.vector handrot; -.vector handvel; -.vector handthrowvel; -.float handvelmag; -.vector handavel; +.string message; // Trigger messages. -.vector v_viewangle; +.float sounds; // Either a cd track number or sound number. -.vector offhandpos; -.vector offhandrot; -.vector offhandvel; -.vector offhandthrowvel; -.float offhandvelmag; -.vector offhandavel; +.string noise, noise1, noise2, noise3; // Contains names of wavs to play. -.float touchinghand; -.vector muzzlepos; -.vector offmuzzlepos; -.float teleporting; -.vector teleport_target; +.vector v_viewangle; -.float offhand_grabbing; -.float offhand_prevgrabbing; +#include "vr_sys_fields.qc" -.float mainhand_grabbing; -.float mainhand_prevgrabbing; +// +// +// +// ---------------------------------------------------------------------------- +// Special flag (!) +// ---------------------------------------------------------------------------- -.float offhand_forcegrabbing; -.float mainhand_forcegrabbing; +void end_sys_fields; // Flag for structure dumping. -.float offhand_hotspot; -.float mainhand_hotspot; -.vector roomscalemove; -.float throwhit; -.float throwstabilize; -.float throwstabilizedim; -.float handtouch_hand; -.entity handtouch_ent; +// +// +// +// ---------------------------------------------------------------------------- +// Constants +// ---------------------------------------------------------------------------- + +float FALSE = 0; +float TRUE = 1; -//================================================ -void end_sys_fields; // flag for structure dumping -//================================================ - -/* -============================================================================== - - VARS NOT REFERENCED BY C CODE - -============================================================================== -*/ - - -// -// constants -// - -float cVR_OffHand = 0; -float cVR_MainHand = 1; -float cVR_FakeHand = 2; - -float FALSE = 0; -float TRUE = 1; - -// edict.flags -float FL_FLY = 1; -float FL_SWIM = 2; -float FL_CLIENT = 8; // set for all client edicts -float FL_INWATER = 16; // for enter / leave water splash -float FL_MONSTER = 32; -float FL_GODMODE = 64; // player cheat -float FL_NOTARGET = 128; // player cheat -float FL_ITEM = 256; // extra wide size for bonus items -float FL_ONGROUND = 512; // standing on something -float FL_PARTIALGROUND = 1024; // not all corners are valid -float FL_WATERJUMP = 2048; // player jumping out of water -float FL_JUMPRELEASED = 4096; // for jump debouncing -float FL_EASYHANDTOUCH = 8192; // adds bonus to boundaries for handtouch - -// edict.movetype values -float MOVETYPE_NONE = 0; // never moves -// float MOVETYPE_ANGLENOCLIP = 1; -// float MOVETYPE_ANGLECLIP = 2; -float MOVETYPE_WALK = 3; // players only -float MOVETYPE_STEP = 4; // discrete, not real time unless fall -float MOVETYPE_FLY = 5; -float MOVETYPE_TOSS = 6; // gravity -float MOVETYPE_PUSH = 7; // no clip to world, push and crush -float MOVETYPE_NOCLIP = 8; -float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters -float MOVETYPE_BOUNCE = 10; -float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size - -// edict.solid values -float SOLID_NOT = 0; // no interaction with other objects -float SOLID_TRIGGER = 1; // touch on edge, but not blocking -float SOLID_BBOX = 2; // touch on edge, block -float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground -float SOLID_BSP = 4; // bsp clip, touch on edge, block -float SOLID_NOT_BUT_TOUCHABLE = 5; // not solid, but can be [hand]touched - -// range values -float RANGE_MELEE = 0; -float RANGE_NEAR = 1; -float RANGE_MID = 2; -float RANGE_FAR = 3; - -// deadflag values - -float DEAD_NO = 0; -float DEAD_DYING = 1; -float DEAD_DEAD = 2; -float DEAD_RESPAWNABLE = 3; - -// takedamage values - -float DAMAGE_NO = 0; -float DAMAGE_YES = 1; -float DAMAGE_AIM = 2; - -// items -// TODO VR: (P2) decide what to do with these, as they are not enough -float IT_FIST = 0; -float IT_SHOTGUN = 1; -float IT_SUPER_SHOTGUN = 2; -float IT_NAILGUN = 4; -float IT_SUPER_NAILGUN = 8; -float IT_GRENADE_LAUNCHER = 16; -float IT_ROCKET_LAUNCHER = 32; -float IT_LIGHTNING = 64; -float IT_MJOLNIR = 128; -float IT_SHELLS = 256; -float IT_NAILS = 512; -float IT_ROCKETS = 1024; -float IT_CELLS = 2048; -float IT_AXE = 4096; - -float IT_ARMOR1 = 8192; -float IT_ARMOR2 = 16384; -float IT_ARMOR3 = 32768; -// TODO VR: (P1) deal with this, hipnotic comments the line below -//MED 11/02/96 added new hip weapon removed SUPERHEALTH -float IT_SUPERHEALTH = 65536; -// TODO VR: (P1) this conflicts with super health, grabbing super health gives -// the player proximity gun -float IT_PROXIMITY_GUN = 65536; - -float IT_KEY1 = 131072; -float IT_KEY2 = 262144; - -float IT_INVISIBILITY = 524288; -float IT_INVULNERABILITY = 1048576; -float IT_SUIT = 2097152; -float IT_QUAD = 4194304; -float IT_LASER_CANNON = 8388608; - -// weapon ids -float WID_FIST = 0; -float WID_GRAPPLE = 1; -float WID_AXE = 2; -float WID_MJOLNIR = 3; -float WID_SHOTGUN = 4; -float WID_SUPER_SHOTGUN = 5; -float WID_NAILGUN = 6; -float WID_SUPER_NAILGUN = 7; -float WID_GRENADE_LAUNCHER = 8; -float WID_PROXIMITY_GUN = 9; -float WID_ROCKET_LAUNCHER = 10; -float WID_LIGHTNING = 11; -float WID_LASER_CANNON = 12; - -// ammo ids -float AID_SHELLS = 0; -float AID_NAILS = 1; -float AID_ROCKETS = 2; -float AID_CELLS = 3; -float AID_NONE = 4; - -// hipnotic items -float HIP_IT_WETSUIT = 2; -float HIP_IT_EMPATHY_SHIELDS = 4; -float HIP_IT_HORN_OF_CONJURING = 8; - -// point content values - -float CONTENT_EMPTY = -1; -float CONTENT_SOLID = -2; -float CONTENT_WATER = -3; -float CONTENT_SLIME = -4; -float CONTENT_LAVA = -5; -float CONTENT_SKY = -6; - -float STATE_TOP = 0; -float STATE_BOTTOM = 1; -float STATE_UP = 2; -float STATE_DOWN = 3; - -vector VEC_ORIGIN = '0 0 0'; -vector VEC_HULL_MIN = '-16 -16 -24'; -vector VEC_HULL_MAX = '16 16 32'; - -vector VEC_HULL2_MIN = '-32 -32 -24'; -vector VEC_HULL2_MAX = '32 32 64'; - -// protocol bytes -float SVC_TEMPENTITY = 23; -float SVC_KILLEDMONSTER = 27; -float SVC_FOUNDSECRET = 28; -float SVC_INTERMISSION = 30; -float SVC_FINALE = 31; -float SVC_CDTRACK = 32; -float SVC_SELLSCREEN = 33; - -float TE_SPIKE = 0; -float TE_SUPERSPIKE = 1; -float TE_GUNSHOT = 2; -float TE_EXPLOSION = 3; -float TE_TAREXPLOSION = 4; -float TE_LIGHTNING1 = 5; -float TE_LIGHTNING2 = 6; -float TE_WIZSPIKE = 7; -float TE_KNIGHTSPIKE = 8; -float TE_LIGHTNING3 = 9; -float TE_LAVASPLASH = 10; -float TE_TELEPORT = 11; -float TE_EXPLOSION2 = 12; -float TE_BEAM = 13; - -// sound channels -// channel 0 never willingly overrides -// other channels (1-7) allways override a playing sound on that channel -float CHAN_AUTO = 0; -float CHAN_WEAPON = 1; -float CHAN_VOICE = 2; -float CHAN_ITEM = 3; -float CHAN_BODY = 4; -float CHAN_WEAPON2 = 5; -float CHAN_OTHER = 6; - -float ATTN_NONE = 0; -float ATTN_NORM = 1; -float ATTN_IDLE = 2; -float ATTN_STATIC = 3; - -// update types - -float UPDATE_GENERAL = 0; -float UPDATE_STATIC = 1; -float UPDATE_BINARY = 2; -float UPDATE_TEMP = 3; - -// entity effects - -float EF_BRIGHTFIELD = 1; -float EF_MUZZLEFLASH = 2; -float EF_BRIGHTLIGHT = 4; -float EF_DIMLIGHT = 8; - - -// messages -float MSG_BROADCAST = 0; // unreliable to all -float MSG_ONE = 1; // reliable to one (msg_entity) -float MSG_ALL = 2; // reliable to all -float MSG_INIT = 3; // write to the init string - -// Quake VR hotspots -float QVR_HS_NONE = 0; -float QVR_HS_OFFHAND_2H_GRAB = 1; // 2H grab - helper offhand -float QVR_HS_MAINHAND_2H_GRAB = 2; // 2H grab - helper mainhand -float QVR_HS_LEFT_SHOULDER_HOLSTER = 3; -float QVR_HS_RIGHT_SHOULDER_HOLSTER = 4; -float QVR_HS_LEFT_HIP_HOLSTER = 5; -float QVR_HS_RIGHT_HIP_HOLSTER = 6; -float QVR_HS_HAND_SWITCH = 7; -float QVR_HS_LEFT_UPPER_HOLSTER = 8; -float QVR_HS_RIGHT_UPPER_HOLSTER = 9; +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.flags` flag values +// ---------------------------------------------------------------------------- -// Quake VR throwhit values -float QVR_THROWHIT_NEVER_HIT = 0; -float QVR_THROWHIT_HIT = 1; -float QVR_THROWHIT_FORCEGRAB = 2; +float FL_FLY = VRUTIL_POWER_OF_TWO(0); +float FL_SWIM = VRUTIL_POWER_OF_TWO(1); +float FL_CONVEYOR = VRUTIL_POWER_OF_TWO(2); +float FL_CLIENT = VRUTIL_POWER_OF_TWO(3); // Set for all client edicts. +float FL_INWATER = VRUTIL_POWER_OF_TWO(4); // For enter / leave water splash. +float FL_MONSTER = VRUTIL_POWER_OF_TWO(5); +float FL_GODMODE = VRUTIL_POWER_OF_TWO(6); // Player cheat. +float FL_NOTARGET = VRUTIL_POWER_OF_TWO(7); // Player cheat. +float FL_ITEM = VRUTIL_POWER_OF_TWO(8); // Extra wide size for bonus items. +float FL_ONGROUND = VRUTIL_POWER_OF_TWO(9); // Standing on something. +float FL_PARTIALGROUND = VRUTIL_POWER_OF_TWO(10); // Not all corners are valid. +float FL_WATERJUMP = VRUTIL_POWER_OF_TWO(11); // Player jumping out of water. +float FL_JUMPRELEASED = VRUTIL_POWER_OF_TWO(12); // For jump debouncing. +float FL_EASYHANDTOUCH = VRUTIL_POWER_OF_TWO(13); // Adds bonus to boundaries for handtouch. +float FL_SPECIFICDAMAGE = VRUTIL_POWER_OF_TWO(14); // HONEY. +float FL_FORCEGRABBABLE = VRUTIL_POWER_OF_TWO(15); // VR. -// Quake VR Enum: `VrHolsterMode' -float QVR_WEAPONMODE_IMMERSIVE = 0; -float QVR_WEAPONMODE_CYCLEQUICKSLOT = 1; +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.movetype` values +// ---------------------------------------------------------------------------- -// Quake VR Enum: `VrWeaponThrowMode' -float QVR_WEAPONTHROWMODE_IMMERSIVE = 0; -float QVR_WEAPONTHROWMODE_DISAPPEARONHIT = 1; -float QVR_WEAPONTHROWMODE_DISCARD = 2; +float MOVETYPE_NONE = 0; // Never moves. +// float MOVETYPE_ANGLENOCLIP = 1; +// float MOVETYPE_ANGLECLIP = 2; +float MOVETYPE_WALK = 3; // Players only. +float MOVETYPE_STEP = 4; // Discrete, not real time unless fall. +float MOVETYPE_FLY = 5; +float MOVETYPE_TOSS = 6; // Gravity. +float MOVETYPE_PUSH = 7; // No clip to world, push and crush. +float MOVETYPE_NOCLIP = 8; +float MOVETYPE_FLYMISSILE = 9; // Fly with extra size against monsters. +float MOVETYPE_BOUNCE = 10; +float MOVETYPE_BOUNCEMISSILE = 11; // Bounce with extra size. -// Quake VR Enum: `VrWeaponCycleMode' -float QVR_WEAPONCYCLEMODE_DISABLED = 0; -float QVR_WEAPONCYCLEMODE_ALLOWED = 1; +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.solid` values +// ---------------------------------------------------------------------------- -// Quake VR Enum: `VrMeleeBloodlust' -float QVR_MELEEBLOODLUST_ENABLED = 0; -float QVR_MELEEBLOODLUST_DISABLED = 1; +float SOLID_NOT = 0; // No interaction with other objects. +float SOLID_TRIGGER = 1; // Touch on edge, but not blocking. +float SOLID_BBOX = 2; // Touch on edge, block. +float SOLID_SLIDEBOX = 3; // Touch on edge, but not an onground. +float SOLID_BSP = 4; // Bsp clip, touch on edge, block. +float SOLID_NOT_BUT_TOUCHABLE = 5; // Not solid, but can be [hand]touched. -// Quake VR Enum: `VrEnemyDrops` -float QVR_ENEMYDROPS_WHENELIGIBLE = 0; -float QVR_ENEMYDROPS_ALWAYS = 1; -float QVR_ENEMYDROPS_DISABLE = 2; +// +// +// +// ---------------------------------------------------------------------------- +// Range values +// ---------------------------------------------------------------------------- -// Quake VR Enum: `VrAmmoBoxDrops` -float QVR_AMMOBOXDROPS_WHENELIGIBLE = 0; -float QVR_AMMOBOXDROPS_ALWAYS = 1; -float QVR_AMMOBOXDROPS_DISABLE = 2; +float RANGE_MELEE = 0; +float RANGE_NEAR = 1; +float RANGE_MID = 2; +float RANGE_FAR = 3; -// Quake VR Enum: `VrForceGrabMode` -float QVR_VRFORCEGRABMODE_DISABLED = 0; -float QVR_VRFORCEGRABMODE_PARABOLA = 1; -float QVR_VRFORCEGRABMODE_LINEAR = 2; -float QVR_VRFORCEGRABMODE_INSTANT = 3; +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.deadflag` values +// ---------------------------------------------------------------------------- -//================================================ +float DEAD_NO = 0; +float DEAD_DYING = 1; +float DEAD_DEAD = 2; +float DEAD_RESPAWNABLE = 3; // -// globals // -float movedist; -float gameover; // set when a rule exits +// +// ---------------------------------------------------------------------------- +// Edict `.takedamage` values +// ---------------------------------------------------------------------------- -string string_null; // null string, nothing should be held here +float DAMAGE_NO = 0; +float DAMAGE_YES = 1; +float DAMAGE_AIM = 2; -entity newmis; // launch_spike sets this after spawning it +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.items` flag values +// ---------------------------------------------------------------------------- -entity activator; // the entity that activated a trigger or brush +float IT_FIST = 0; +float IT_SHOTGUN = VRUTIL_POWER_OF_TWO(0); +float IT_SUPER_SHOTGUN = VRUTIL_POWER_OF_TWO(1); +float IT_NAILGUN = VRUTIL_POWER_OF_TWO(2); +float IT_SUPER_NAILGUN = VRUTIL_POWER_OF_TWO(3); +float IT_GRENADE_LAUNCHER = VRUTIL_POWER_OF_TWO(4); +float IT_ROCKET_LAUNCHER = VRUTIL_POWER_OF_TWO(5); +float IT_LIGHTNING = VRUTIL_POWER_OF_TWO(6); +float IT_MJOLNIR = VRUTIL_POWER_OF_TWO(7); // HIPNOTIC. +float IT_SHELLS = VRUTIL_POWER_OF_TWO(8); +float IT_NAILS = VRUTIL_POWER_OF_TWO(9); +float IT_ROCKETS = VRUTIL_POWER_OF_TWO(10); +float IT_CELLS = VRUTIL_POWER_OF_TWO(11); +float IT_AXE = VRUTIL_POWER_OF_TWO(12); +float IT_ARMOR1 = VRUTIL_POWER_OF_TWO(13); +float IT_ARMOR2 = VRUTIL_POWER_OF_TWO(14); +float IT_ARMOR3 = VRUTIL_POWER_OF_TWO(15); +float IT_SUPERHEALTH = VRUTIL_POWER_OF_TWO(16); +float IT_KEY1 = VRUTIL_POWER_OF_TWO(17); +float IT_KEY2 = VRUTIL_POWER_OF_TWO(18); +float IT_INVISIBILITY = VRUTIL_POWER_OF_TWO(19); +float IT_INVULNERABILITY = VRUTIL_POWER_OF_TWO(20); +float IT_SUIT = VRUTIL_POWER_OF_TWO(21); +float IT_QUAD = VRUTIL_POWER_OF_TWO(22); +float IT_LASER_CANNON = VRUTIL_POWER_OF_TWO(23); // HIPNOTIC. -entity damage_attacker; // set by T_Damage -float framecount; +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.hipnotic_items` flag values +// ---------------------------------------------------------------------------- -float skill; +float HIP_IT_WETSUIT = VRUTIL_POWER_OF_TWO(1); // HIPNOTIC. +float HIP_IT_EMPATHY_SHIELDS = VRUTIL_POWER_OF_TWO(2); // HIPNOTIC. +float HIP_IT_HORN_OF_CONJURING = VRUTIL_POWER_OF_TWO(3); // HIPNOTIC. +float HIP_IT_PROXIMITY_GUN = VRUTIL_POWER_OF_TWO(4); // HIPNOTIC. -float readytime; // time after loading a map when the player is considered - // ready +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.rogue_items` flag values +// ---------------------------------------------------------------------------- -//================================================ +float ROGUE_IT_LAVA_NAILGUN = VRUTIL_POWER_OF_TWO(1); // ROGUE. +float ROGUE_IT_LAVA_SUPER_NAILGUN = VRUTIL_POWER_OF_TWO(2); // ROGUE. +float ROGUE_IT_MULTI_GRENADE = VRUTIL_POWER_OF_TWO(3); // ROGUE. +float ROGUE_IT_MULTI_ROCKET = VRUTIL_POWER_OF_TWO(4); // ROGUE. +float ROGUE_IT_PLASMA_GUN = VRUTIL_POWER_OF_TWO(5); // ROGUE. +float ROGUE_IT_GRAPPLE = VRUTIL_POWER_OF_TWO(6); // ROGUE. +float ROGUE_IT_LAVA_NAILS = VRUTIL_POWER_OF_TWO(7); // ROGUE. +float ROGUE_IT_PLASMA_AMMO = VRUTIL_POWER_OF_TWO(8); // ROGUE. +float ROGUE_IT_MULTI_ROCKETS = VRUTIL_POWER_OF_TWO(9); // ROGUE. +float ROGUE_IT_SHIELD = VRUTIL_POWER_OF_TWO(10); // ROGUE. +float ROGUE_IT_ANTIGRAV = VRUTIL_POWER_OF_TWO(11); // ROGUE. +float ROGUE_IT_EARTHQUAKE = VRUTIL_POWER_OF_TWO(12); // ROGUE. +float ROGUE_IT_V_SPHERE = VRUTIL_POWER_OF_TWO(13); // ROGUE. // -// world fields (FIXME: make globals) // -.string wad; -.string map; -.float worldtype; // 0=medieval 1=metal 2=base +// +// ---------------------------------------------------------------------------- +// Point content values +// ---------------------------------------------------------------------------- + +float CONTENT_EMPTY = -1; +float CONTENT_SOLID = -2; +float CONTENT_WATER = -3; +float CONTENT_SLIME = -4; +float CONTENT_LAVA = -5; +float CONTENT_SKY = -6; -//================================================ +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.state` values +// ---------------------------------------------------------------------------- -.string killtarget; +float STATE_TOP = 0; +float STATE_BOTTOM = 1; +float STATE_UP = 2; +float STATE_DOWN = 3; +float STATE_FALLING = 4; // HONEY. +float STATE_DISABLED = 5; // HONEY. // -// quakeed fields // -.float light_lev; // not used by game, but parsed by light util -.float style; +// +// ---------------------------------------------------------------------------- +// Vector constants +// ---------------------------------------------------------------------------- +vector VEC_ORIGIN = '0 0 0'; +vector VEC_HULL_MIN = '-16 -16 -24'; +vector VEC_HULL_MAX = '16 16 32'; +vector VEC_HULL2_MIN = '-32 -32 -24'; +vector VEC_HULL2_MAX = '32 32 64'; // -// monster ai // -.void() th_stand; -.void() th_walk; -.void() th_run; -.void() th_missile; -.void() th_melee; -.void(entity attacker, float damage) th_pain; -.void() th_die; +// +// ---------------------------------------------------------------------------- +// Protocol bytes +// ---------------------------------------------------------------------------- -.entity oldenemy; // mad at this player before taking damage +float SVC_CDTRACK = 32; +float SVC_CUTSCENE = 34; // ROGUE. +float SVC_FINALE = 31; +float SVC_FOUNDSECRET = 28; +float SVC_INTERMISSION = 30; +float SVC_KILLEDMONSTER = 27; +float SVC_SELLSCREEN = 33; +float SVC_SERVERINFO = 11; // HONEY. +float SVC_SETANGLES = 10; // HONEY. +float SVC_SETVIEWPORT = 5; // HONEY. +float SVC_TEMPENTITY = 23; +float SVC_UPDATESTAT = 3; // ROGUE, HONEY. [pgm black magic] -.float speed; +float TE_SPIKE = 0; +float TE_SUPERSPIKE = 1; +float TE_GUNSHOT = 2; +float TE_EXPLOSION = 3; +float TE_TAREXPLOSION = 4; +float TE_LIGHTNING1 = 5; +float TE_LIGHTNING2 = 6; +float TE_WIZSPIKE = 7; +float TE_KNIGHTSPIKE = 8; +float TE_LIGHTNING3 = 9; +float TE_LAVASPLASH = 10; +float TE_TELEPORT = 11; +float TE_EXPLOSION2 = 12; +float TE_BEAM = 13; -.float lefty; +// +// +// +// ---------------------------------------------------------------------------- +// Sound channels +// ---------------------------------------------------------------------------- -.float search_time; -.float attack_state; +// Channel 0 never willingly overrides. +// Other channels (1-7) allways override a playing sound on that channel. +float CHAN_AUTO = 0; +float CHAN_WEAPON = 1; +float CHAN_VOICE = 2; +float CHAN_ITEM = 3; +float CHAN_BODY = 4; +float CHAN_WEAPON2 = 5; +float CHAN_OTHER = 6; -float AS_STRAIGHT = 1; -float AS_SLIDING = 2; -float AS_MELEE = 3; -float AS_MISSILE = 4; +float ATTN_NONE = 0; +float ATTN_NORM = 1; +float ATTN_IDLE = 2; +float ATTN_STATIC = 3; // -// player only fields // -.float walkframe; +// +// ---------------------------------------------------------------------------- +// Update types +// ---------------------------------------------------------------------------- -.float attack_finished; -.float offhand_attack_finished; -.float mainhand_melee_attack_finished; -.float offhand_melee_attack_finished; -.float in_melee; -.float offhand_in_melee; -.float melee_hit_sound_played; -.float offhand_melee_hit_sound_played; -.float pain_finished; +float UPDATE_GENERAL = 0; +float UPDATE_STATIC = 1; +float UPDATE_BINARY = 2; +float UPDATE_TEMP = 3; -.float invincible_finished; -.float invisible_finished; -.float super_damage_finished; -.float radsuit_finished; +// +// +// +// ---------------------------------------------------------------------------- +// Edict `.effects` flag values +// ---------------------------------------------------------------------------- -.float invincible_time, invincible_sound; -.float invisible_time, invisible_sound; -.float super_time, super_sound; -.float rad_time; -.float fly_sound; +float EF_BRIGHTFIELD = VRUTIL_POWER_OF_TWO(0); +float EF_MUZZLEFLASH = VRUTIL_POWER_OF_TWO(1); +float EF_BRIGHTLIGHT = VRUTIL_POWER_OF_TWO(2); +float EF_DIMLIGHT = VRUTIL_POWER_OF_TWO(3); +float EF_VERYDIMLIGHT = VRUTIL_POWER_OF_TWO(4); +float EF_MINIROCKET = VRUTIL_POWER_OF_TWO(5); +float EF_LAVATRAIL = VRUTIL_POWER_OF_TWO(6); -.float axhitme; +// +// +// +// ---------------------------------------------------------------------------- +// Message types +// ---------------------------------------------------------------------------- -.float show_hostile; // set to time+0.2 whenever a client fires a - // weapon or takes damage. Used to alert - // monsters that otherwise would let the player go -.float jump_flag; // player jump flag -.float swim_flag; // player swimming sound flag -.float air_finished; // when time > air_finished, start drowning -.float bubble_count; // keeps track of the number of bubbles -.string deathtype; // keeps track of how the player died +float MSG_BROADCAST = 0; // Unreliable to all. +float MSG_ONE = 1; // Reliable to one (`msg_entity`). +float MSG_ALL = 2; // Reliable to all. +float MSG_INIT = 3; // Write to the init string. // -// object stuff // -.string mdl; -.vector mangle; // angle at start +// +// ---------------------------------------------------------------------------- +// Globals +// ---------------------------------------------------------------------------- + +float movedist; +float gameover; // Set when a rule exits. + +string string_null; // Null string, nothing should be held here. -.vector oldorigin; // only used by secret door +entity activator; // The entity that activated a trigger or brush. -.float t_length, t_width; +entity damage_attacker; // Set by `T_Damage`. + +float framecount; +float skill; + +#include "vr_defs.qc" // -// doors, etc // -.vector dest, dest1, dest2; -.float wait; // time from firing to restarting -.float delay; // time from activation to firing -.entity trigger_field; // door's trigger entity -.string noise4; +// +// ---------------------------------------------------------------------------- +// World fields +// ---------------------------------------------------------------------------- + +// World fields (FIXME: make globals). +.string wad; +.string map; +.float worldtype; // 0=medieval, 1=metal, 2=base. +.string killtarget; + +// // -// monsters // -.float pausetime; -.entity movetarget; +// ---------------------------------------------------------------------------- +// QuakeED fields +// ---------------------------------------------------------------------------- +.float light_lev; // not used by game, but parsed by light util +.float style; // -// doors // -.float aflag; -.float dmg; // damage done by door when hit +// +// ---------------------------------------------------------------------------- +// Monster AI +// ---------------------------------------------------------------------------- +.void() th_stand; +.void() th_walk; +.void() th_run; +.void() th_missile; +.void() th_melee; + +.void(entity attacker, float damage) th_pain; + +.void() th_die; + +.entity oldenemy; // Mad at this player before taking damage. + +.float speed; + +.float lefty; + +.float search_time; +.float attack_state; + +float AS_STRAIGHT = 1; +float AS_SLIDING = 2; +float AS_MELEE = 3; +float AS_MISSILE = 4; + +// // -// misc // -.float cnt; // misc flag +// ---------------------------------------------------------------------------- +// Player-only fields +// ---------------------------------------------------------------------------- + +.float walkframe; + +.float attack_finished; +.float pain_finished; + +.float invincible_finished; +.float invisible_finished; +.float super_damage_finished; +.float radsuit_finished; + +.float invincible_time, invincible_sound; +.float invisible_time, invisible_sound; +.float super_time, super_sound; +.float rad_time; +.float fly_sound; + +.float axhitme; + +.float show_hostile; // Set to time+0.2 whenever a client fires a + // weapon or takes damage. Used to alert + // monsters that otherwise would let the player go. + +.float jump_flag; // Player jump flag. +.float swim_flag; // Player swimming sound flag. +.float air_finished; // When `time > air_finished`, start drowning. +.float bubble_count; // Keeps track of the number of bubbles. +.string deathtype; // Keeps track of how the player died. // -// subs // -.void() think1; -.vector finaldest, finalangle; +// +// ---------------------------------------------------------------------------- +// Object stuff +// ---------------------------------------------------------------------------- + +.string mdl; +.vector mangle; // Angle at start. +.vector oldorigin; // Only used by secret door. + +.float t_length, t_width; + +// // -// triggers // -.float count; // for counting triggers +// ---------------------------------------------------------------------------- +// Doors, etc +// ---------------------------------------------------------------------------- +.vector dest, dest1, dest2; + +.float wait; // Time from firing to restarting. +.float delay; // Time from activation to firing. + +.entity trigger_field; // Door's trigger entity. +.string noise4; // -// plats / doors / buttons // -.float lip; -.float state; -.vector pos1, pos2; // top and bottom positions -.float height; +// +// ---------------------------------------------------------------------------- +// Monsters +// ---------------------------------------------------------------------------- + +.float pausetime; +.entity movetarget; // -// sounds // -.float waitmin, waitmax; -.float distance; -.float volume; - +// +// ---------------------------------------------------------------------------- +// Doors +// ---------------------------------------------------------------------------- +.float aflag; +.float dmg; // Damage done by door when hit. -//=========================================================================== +// +// +// +// ---------------------------------------------------------------------------- +// Misc +// ---------------------------------------------------------------------------- +.float cnt; // Misc flag. // -// builtin functions // +// +// ---------------------------------------------------------------------------- +// Subs +// ---------------------------------------------------------------------------- -void(vector ang) makevectors = #1; // sets v_forward, etc globals -void(entity e, vector o) setorigin = #2; -void(entity e, string m) setmodel = #3; // set movetype and solid first -void(entity e, vector min, vector max) setsize = #4; -// #5 was removed -void() break = #6; -float() random = #7; // returns 0 - 1 -void(entity e, float chan, string samp, float vol, float atten) sound = #8; -vector(vector v) normalize = #9; -void(string e) error = #10; -void(string e) objerror = #11; -float(vector v) vlen = #12; -float(vector v) vectoyaw = #13; -entity() spawn = #14; -void(entity e) remove = #15; +.void() think1; +.vector finaldest, finalangle; -// sets trace_* globals -// nomonsters can be: -// An entity will also be ignored for testing if forent == test, -// forent->owner == test, or test->owner == forent -// a forent of world is ignored -void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16; +// +// +// +// ---------------------------------------------------------------------------- +// Triggers +// ---------------------------------------------------------------------------- -entity() checkclient = #17; // returns a client to look for -entity(entity start, .string fld, string match) find = #18; -string(string s) precache_sound = #19; -string(string s) precache_model = #20; -void(entity client, string s)stuffcmd = #21; -entity(vector org, float rad) findradius = #22; -void(string s) bprint = #23; -void(entity client, string s) sprint = #24; -void(string s) dprint = #25; -string(float f) ftos = #26; -string(vector v) vtos = #27; -void() coredump = #28; // prints all edicts -void() traceon = #29; // turns statment trace on -void() traceoff = #30; -void(entity e) eprint = #31; // prints an entire edict -float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE -// #33 was removed -float() droptofloor= #34; // TRUE if landed on floor -void(float style, string value) lightstyle = #35; -float(float v) rint = #36; // round to nearest int -float(float v) floor = #37; // largest integer <= v -float(float v) ceil = #38; // smallest integer >= v -// #39 was removed -float(entity e) checkbottom = #40; // true if self is on ground -float(vector v) pointcontents = #41; // returns a CONTENT_* -// #42 was removed -float(float f) fabs = #43; -vector(entity e, float speed) aim = #44; // returns the shooting vector -float(string s) cvar = #45; // return cvar.value -void(string s) localcmd = #46; // put string into local que -entity(entity e) nextent = #47; // for looping through all ents -void(vector o, vector d, float color, float count) particle = #48;// start a particle effect -void() ChangeYaw = #49; // turn towards self.ideal_yaw - // at self.yaw_speed -// #50 was removed -vector(vector v) vectoangles = #51; +.float count; // For counting triggers. // -// direct client message generation // -void(float to, float f) WriteByte = #52; -void(float to, float f) WriteChar = #53; -void(float to, float f) WriteShort = #54; -void(float to, float f) WriteLong = #55; -void(float to, float f) WriteCoord = #56; -void(float to, float f) WriteAngle = #57; -void(float to, string s) WriteString = #58; -void(float to, entity s) WriteEntity = #59; +// +// ---------------------------------------------------------------------------- +// Plats / doors / buttons +// ---------------------------------------------------------------------------- +.float lip; +.float state; +.vector pos1, pos2; // Top and bottom positions. +.float height; + +// // -// broadcast client message generation // +// ---------------------------------------------------------------------------- +// Sounds +// ---------------------------------------------------------------------------- -// void(float f) bWriteByte = #59; -// void(float f) bWriteChar = #60; -// void(float f) bWriteShort = #61; -// void(float f) bWriteLong = #62; -// void(float f) bWriteCoord = #63; -// void(float f) bWriteAngle = #64; -// void(string s) bWriteString = #65; -// void(entity e) bWriteEntity = #66; +.float waitmin, waitmax; +.float distance; +.float volume; -void(float step) movetogoal = #67; - -string(string s) precache_file = #68; // no effect except for -copy -void(entity e) makestatic = #69; -void(string s) changelevel = #70; - -//#71 was removed - -void(string var, string val) cvar_set = #72; // sets cvar.value - -void(entity client, string s) centerprint = #73; // sprint, but in middle - -void(vector pos, string samp, float vol, float atten) ambientsound = #74; - -string(string s) precache_model2 = #75; // registered version only -string(string s) precache_sound2 = #76; // registered version only -string(string s) precache_file2 = #77; // registered version only - -void(entity e) setspawnparms = #78; // set parm1... to the - // values at level start - // for coop respawn - -void(vector o, vector d, float preset, float count) particle2 = #79;// start a particle2 effect -float(float base, float exp) pow = #80; // power function -void(float hand, float delay, float duration, float frequency, float amplitude) haptic = #81; // VR haptics function -float(float a, float b) min = #82; -float(float a, float b) max = #83; -void(vector ang) makeforward = #84; // sets v_forward -float(float input, float inputmin, float inputMax, float outputMin, float outputMax) maprange = #85; // sets v_forward - -//============================================================================ - -// -// subs.qc -// -void(vector tdest, float tspeed, void() func) SUB_CalcMove; -void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt; -void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove; -void() SUB_CalcMoveDone; -void() SUB_CalcAngleMoveDone; -void() SUB_Null; -void(entity attacker, float damage) SUB_NullPain; -void() SUB_UseTargets; -void() SUB_Remove; - -// -// combat.qc // -void(entity targ, entity inflictor, entity attacker, float damage) T_Damage; +// +// +// ---------------------------------------------------------------------------- +// Other non-system fields +// ---------------------------------------------------------------------------- +#include "vr_fields.qc" -float (entity e, float healamount, float ignore) T_Heal; // health function +// +// +// +// ---------------------------------------------------------------------------- +// Builtins +// ---------------------------------------------------------------------------- -float(entity targ, entity inflictor) CanDamage; +#include "builtins.qc" diff --git a/QC/demon.qc b/QC/demon.qc deleted file mode 100644 index 5923a64f..00000000 --- a/QC/demon.qc +++ /dev/null @@ -1,361 +0,0 @@ -/* -============================================================================== - -DEMON - -============================================================================== -*/ - -$cd id1/models/demon3 -$scale 0.8 -$origin 0 0 24 -$base base -$skin base - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 -$frame stand10 stand11 stand12 stand13 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 - -$frame run1 run2 run3 run4 run5 run6 - -$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 -$frame leap11 leap12 - -$frame pain1 pain2 pain3 pain4 pain5 pain6 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 - -$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 -$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 - -//============================================================================ - -void() Demon_JumpTouch; - -void() demon1_stand1 =[ $stand1, demon1_stand2 ] {ai_stand();}; -void() demon1_stand2 =[ $stand2, demon1_stand3 ] {ai_stand();}; -void() demon1_stand3 =[ $stand3, demon1_stand4 ] {ai_stand();}; -void() demon1_stand4 =[ $stand4, demon1_stand5 ] {ai_stand();}; -void() demon1_stand5 =[ $stand5, demon1_stand6 ] {ai_stand();}; -void() demon1_stand6 =[ $stand6, demon1_stand7 ] {ai_stand();}; -void() demon1_stand7 =[ $stand7, demon1_stand8 ] {ai_stand();}; -void() demon1_stand8 =[ $stand8, demon1_stand9 ] {ai_stand();}; -void() demon1_stand9 =[ $stand9, demon1_stand10 ] {ai_stand();}; -void() demon1_stand10 =[ $stand10, demon1_stand11 ] {ai_stand();}; -void() demon1_stand11 =[ $stand11, demon1_stand12 ] {ai_stand();}; -void() demon1_stand12 =[ $stand12, demon1_stand13 ] {ai_stand();}; -void() demon1_stand13 =[ $stand13, demon1_stand1 ] {ai_stand();}; - -void() demon1_walk1 =[ $walk1, demon1_walk2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "demon/idle1.wav", 1, ATTN_IDLE); -ai_walk(8); -}; -void() demon1_walk2 =[ $walk2, demon1_walk3 ] {ai_walk(6);}; -void() demon1_walk3 =[ $walk3, demon1_walk4 ] {ai_walk(6);}; -void() demon1_walk4 =[ $walk4, demon1_walk5 ] {ai_walk(7);}; -void() demon1_walk5 =[ $walk5, demon1_walk6 ] {ai_walk(4);}; -void() demon1_walk6 =[ $walk6, demon1_walk7 ] {ai_walk(6);}; -void() demon1_walk7 =[ $walk7, demon1_walk8 ] {ai_walk(10);}; -void() demon1_walk8 =[ $walk8, demon1_walk1 ] {ai_walk(10);}; - -void() demon1_run1 =[ $run1, demon1_run2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "demon/idle1.wav", 1, ATTN_IDLE); -ai_run(20);}; -void() demon1_run2 =[ $run2, demon1_run3 ] {ai_run(15);}; -void() demon1_run3 =[ $run3, demon1_run4 ] {ai_run(36);}; -void() demon1_run4 =[ $run4, demon1_run5 ] {ai_run(20);}; -void() demon1_run5 =[ $run5, demon1_run6 ] {ai_run(15);}; -void() demon1_run6 =[ $run6, demon1_run1 ] {ai_run(36);}; - -void() demon1_jump1 =[ $leap1, demon1_jump2 ] {ai_face();}; -void() demon1_jump2 =[ $leap2, demon1_jump3 ] {ai_face();}; -void() demon1_jump3 =[ $leap3, demon1_jump4 ] {ai_face();}; -void() demon1_jump4 =[ $leap4, demon1_jump5 ] -{ - ai_face(); - - self.touch = Demon_JumpTouch; - makevectors (self.angles); - self.origin_z = self.origin_z + 1; - self.velocity = v_forward * 600 + '0 0 250'; - if(self.flags & FL_ONGROUND) - self.flags = self.flags - FL_ONGROUND; -}; -void() demon1_jump5 =[ $leap5, demon1_jump6 ] {}; -void() demon1_jump6 =[ $leap6, demon1_jump7 ] {}; -void() demon1_jump7 =[ $leap7, demon1_jump8 ] {}; -void() demon1_jump8 =[ $leap8, demon1_jump9 ] {}; -void() demon1_jump9 =[ $leap9, demon1_jump10 ] {}; -void() demon1_jump10 =[ $leap10, demon1_jump1 ] { -self.nextthink = time + 3; -// if three seconds pass, assume demon is stuck and jump again -}; - -void() demon1_jump11 =[ $leap11, demon1_jump12 ] {}; -void() demon1_jump12 =[ $leap12, demon1_run1 ] {}; - - -void() demon1_atta1 =[ $attacka1, demon1_atta2 ] {ai_charge(4);}; -void() demon1_atta2 =[ $attacka2, demon1_atta3 ] {ai_charge(0);}; -void() demon1_atta3 =[ $attacka3, demon1_atta4 ] {ai_charge(0);}; -void() demon1_atta4 =[ $attacka4, demon1_atta5 ] {ai_charge(1);}; -void() demon1_atta5 =[ $attacka5, demon1_atta6 ] {ai_charge(2); Demon_Melee(200);}; -void() demon1_atta6 =[ $attacka6, demon1_atta7 ] {ai_charge(1);}; -void() demon1_atta7 =[ $attacka7, demon1_atta8 ] {ai_charge(6);}; -void() demon1_atta8 =[ $attacka8, demon1_atta9 ] {ai_charge(8);}; -void() demon1_atta9 =[ $attacka9, demon1_atta10] {ai_charge(4);}; -void() demon1_atta10 =[ $attacka10, demon1_atta11] {ai_charge(2);}; -void() demon1_atta11 =[ $attacka11, demon1_atta12] {Demon_Melee(-200);}; -void() demon1_atta12 =[ $attacka12, demon1_atta13] {ai_charge(5);}; -void() demon1_atta13 =[ $attacka13, demon1_atta14] {ai_charge(8);}; -void() demon1_atta14 =[ $attacka14, demon1_atta15] {ai_charge(4);}; -void() demon1_atta15 =[ $attacka15, demon1_run1] {ai_charge(4);}; - -void() demon1_pain1 =[ $pain1, demon1_pain2 ] {}; -void() demon1_pain2 =[ $pain2, demon1_pain3 ] {}; -void() demon1_pain3 =[ $pain3, demon1_pain4 ] {}; -void() demon1_pain4 =[ $pain4, demon1_pain5 ] {}; -void() demon1_pain5 =[ $pain5, demon1_pain6 ] {}; -void() demon1_pain6 =[ $pain6, demon1_run1 ] {}; - -void(entity attacker, float damage) demon1_pain = -{ - if(self.touch == Demon_JumpTouch) - return; - - if(self.pain_finished > time) - return; - - self.pain_finished = time + 1; - sound(self, CHAN_VOICE, "demon/dpain1.wav", 1, ATTN_NORM); - - if(random()*200 > damage) - return; // didn't flinch - - demon1_pain1(); -}; - -void() demon1_die1 =[ $death1, demon1_die2 ] { -sound(self, CHAN_VOICE, "demon/ddeath.wav", 1, ATTN_NORM);}; -void() demon1_die2 =[ $death2, demon1_die3 ] {}; -void() demon1_die3 =[ $death3, demon1_die4 ] {}; -void() demon1_die4 =[ $death4, demon1_die5 ] {}; -void() demon1_die5 =[ $death5, demon1_die6 ] {}; -void() demon1_die6 =[ $death6, demon1_die7 ] -{self.solid = SOLID_NOT;}; -void() demon1_die7 =[ $death7, demon1_die8 ] {}; -void() demon1_die8 =[ $death8, demon1_die9 ] {}; -void() demon1_die9 =[ $death9, demon1_die9 ] {}; - -void() demon_die = -{ -// check for gib - if(self.health < -80) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_demon.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - return; - } - -// regular death - demon1_die1(); -}; - - -void() Demon_MeleeAttack = -{ - demon1_atta1(); -}; - - -/*QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 64) Ambush - -*/ -void() monster_demon1 = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/demon.mdl"); - precache_model ("progs/h_demon.mdl"); - - precache_sound("demon/ddeath.wav"); - precache_sound("demon/dhit2.wav"); - precache_sound("demon/djump.wav"); - precache_sound("demon/dpain1.wav"); - precache_sound("demon/idle1.wav"); - precache_sound("demon/sight2.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/demon.mdl"); - - setsize (self, '-16 -16 -24', '16 16 24'); - self.health = 300; - - self.th_stand = demon1_stand1; - self.th_walk = demon1_walk1; - self.th_run = demon1_run1; - self.th_die = demon_die; - self.th_melee = Demon_MeleeAttack; // one of two attacks - self.th_missile = demon1_jump1; // jump attack - self.th_pain = demon1_pain; - - walkmonster_start(); -}; - - -/* -============================================================================== - -DEMON - -============================================================================== -*/ - -/* -============== -CheckDemonMelee - -Returns TRUE if a melee attack would hit right now -============== -*/ -float() CheckDemonMelee = -{ - if(enemy_range == RANGE_MELEE) - { // FIXME: check canreach - self.attack_state = AS_MELEE; - return TRUE; - } - return FALSE; -}; - -/* -============== -CheckDemonJump - -============== -*/ -float() CheckDemonJump = -{ - local vector dist; - local float d; - - if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z - + 0.75 * self.enemy.size_z) - return FALSE; - - if(self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z - + 0.25 * self.enemy.size_z) - return FALSE; - - dist = self.enemy.origin - self.origin; - dist_z = 0; - - d = vlen(dist); - - if(d < 100) - return FALSE; - - if(d > 200) - { - if(random() < 0.9) - return FALSE; - } - - return TRUE; -}; - -float() DemonCheckAttack = -{ - // if close enough for slashing, go for it - if(CheckDemonMelee ()) - { - self.attack_state = AS_MELEE; - return TRUE; - } - - if(CheckDemonJump ()) - { - self.attack_state = AS_MISSILE; - sound(self, CHAN_VOICE, "demon/djump.wav", 1, ATTN_NORM); - return TRUE; - } - - return FALSE; -}; - - -//=========================================================================== - -void(float side) Demon_Melee = -{ - local float ldmg; - local vector delta; - - ai_face(); - walkmove (self.ideal_yaw, 12); // allow a little closing - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - if(!CanDamage (self.enemy, self)) - return; - - sound(self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); - ldmg = 10 + 5*random(); - T_Damage (self.enemy, self, self, ldmg); - - makevectors (self.angles); - SpawnMeatSpray (self.origin + v_forward*16, side * v_right); -}; - - -void() Demon_JumpTouch = -{ - local float ldmg; - - if(self.health <= 0) - return; - - if(other.takedamage) - { - if( vlen(self.velocity) > 400 ) - { - ldmg = 40 + 10*random(); - T_Damage (other, self, self, ldmg); - } - } - - if(!checkbottom(self)) - { - if(self.flags & FL_ONGROUND) - { // jump randomly to not get hung up -//dprint ("popjump\n"); - self.touch = SUB_Null; - self.think = demon1_jump1; - self.nextthink = time + 0.1; - -// self.velocity_x = (random() - 0.5) * 600; -// self.velocity_y = (random() - 0.5) * 600; -// self.velocity_z = 200; -// self.flags = self.flags - FL_ONGROUND; - } - return; // not on ground yet - } - - self.touch = SUB_Null; - self.think = demon1_jump11; - self.nextthink = time + 0.1; -}; - diff --git a/QC/dog.qc b/QC/dog.qc deleted file mode 100644 index 43f3b8ce..00000000 --- a/QC/dog.qc +++ /dev/null @@ -1,361 +0,0 @@ -/* -============================================================================== - -DOG - -============================================================================== -*/ -$cd id1/models/dog -$origin 0 0 24 -$base base -$skin skin - -$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 - -$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 -$frame deathb9 - -$frame pain1 pain2 pain3 pain4 pain5 pain6 - -$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 -$frame painb11 painb12 painb13 painb14 painb15 painb16 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 - -$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 - - -void() dog_leap1; -void() dog_run1; - -/* -================ -dog_bite - -================ -*/ -void() dog_bite = -{ -local vector delta; -local float ldmg; - - if(!self.enemy) - return; - - ai_charge(10); - - if(!CanDamage (self.enemy, self)) - return; - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - - ldmg = (random() + random() + random()) * 8; - T_Damage (self.enemy, self, self, ldmg); -}; - -void() Dog_JumpTouch = -{ - local float ldmg; - - if(self.health <= 0) - return; - - if(other.takedamage) - { - if( vlen(self.velocity) > 300 ) - { - ldmg = 10 + 10*random(); - T_Damage (other, self, self, ldmg); - } - } - - if(!checkbottom(self)) - { - if(self.flags & FL_ONGROUND) - { // jump randomly to not get hung up -//dprint ("popjump\n"); - self.touch = SUB_Null; - self.think = dog_leap1; - self.nextthink = time + 0.1; - -// self.velocity_x = (random() - 0.5) * 600; -// self.velocity_y = (random() - 0.5) * 600; -// self.velocity_z = 200; -// self.flags = self.flags - FL_ONGROUND; - } - return; // not on ground yet - } - - self.touch = SUB_Null; - self.think = dog_run1; - self.nextthink = time + 0.1; -}; - - -void() dog_stand1 =[ $stand1, dog_stand2 ] {ai_stand();}; -void() dog_stand2 =[ $stand2, dog_stand3 ] {ai_stand();}; -void() dog_stand3 =[ $stand3, dog_stand4 ] {ai_stand();}; -void() dog_stand4 =[ $stand4, dog_stand5 ] {ai_stand();}; -void() dog_stand5 =[ $stand5, dog_stand6 ] {ai_stand();}; -void() dog_stand6 =[ $stand6, dog_stand7 ] {ai_stand();}; -void() dog_stand7 =[ $stand7, dog_stand8 ] {ai_stand();}; -void() dog_stand8 =[ $stand8, dog_stand9 ] {ai_stand();}; -void() dog_stand9 =[ $stand9, dog_stand1 ] {ai_stand();}; - -void() dog_walk1 =[ $walk1 , dog_walk2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); -ai_walk(8);}; -void() dog_walk2 =[ $walk2 , dog_walk3 ] {ai_walk(8);}; -void() dog_walk3 =[ $walk3 , dog_walk4 ] {ai_walk(8);}; -void() dog_walk4 =[ $walk4 , dog_walk5 ] {ai_walk(8);}; -void() dog_walk5 =[ $walk5 , dog_walk6 ] {ai_walk(8);}; -void() dog_walk6 =[ $walk6 , dog_walk7 ] {ai_walk(8);}; -void() dog_walk7 =[ $walk7 , dog_walk8 ] {ai_walk(8);}; -void() dog_walk8 =[ $walk8 , dog_walk1 ] {ai_walk(8);}; - -void() dog_run1 =[ $run1 , dog_run2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); -ai_run(16);}; -void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(32);}; -void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);}; -void() dog_run4 =[ $run4 , dog_run5 ] {ai_run(20);}; -void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);}; -void() dog_run6 =[ $run6 , dog_run7 ] {ai_run(32);}; -void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(16);}; -void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);}; -void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);}; -void() dog_run10 =[ $run10 , dog_run11 ] {ai_run(20);}; -void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);}; -void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);}; - -void() dog_atta1 =[ $attack1, dog_atta2 ] {ai_charge(10);}; -void() dog_atta2 =[ $attack2, dog_atta3 ] {ai_charge(10);}; -void() dog_atta3 =[ $attack3, dog_atta4 ] {ai_charge(10);}; -void() dog_atta4 =[ $attack4, dog_atta5 ] { -sound(self, CHAN_VOICE, "dog/dattack1.wav", 1, ATTN_NORM); -dog_bite();}; -void() dog_atta5 =[ $attack5, dog_atta6 ] {ai_charge(10);}; -void() dog_atta6 =[ $attack6, dog_atta7 ] {ai_charge(10);}; -void() dog_atta7 =[ $attack7, dog_atta8 ] {ai_charge(10);}; -void() dog_atta8 =[ $attack8, dog_run1 ] {ai_charge(10);}; - -void() dog_leap1 =[ $leap1, dog_leap2 ] {ai_face();}; -void() dog_leap2 =[ $leap2, dog_leap3 ] -{ - ai_face(); - - self.touch = Dog_JumpTouch; - makevectors (self.angles); - self.origin_z = self.origin_z + 1; - self.velocity = v_forward * 300 + '0 0 200'; - if(self.flags & FL_ONGROUND) - self.flags = self.flags - FL_ONGROUND; -}; - -void() dog_leap3 =[ $leap3, dog_leap4 ] {}; -void() dog_leap4 =[ $leap4, dog_leap5 ] {}; -void() dog_leap5 =[ $leap5, dog_leap6 ] {}; -void() dog_leap6 =[ $leap6, dog_leap7 ] {}; -void() dog_leap7 =[ $leap7, dog_leap8 ] {}; -void() dog_leap8 =[ $leap8, dog_leap9 ] {}; -void() dog_leap9 =[ $leap9, dog_leap9 ] {}; - -void() dog_pain1 =[ $pain1 , dog_pain2 ] {}; -void() dog_pain2 =[ $pain2 , dog_pain3 ] {}; -void() dog_pain3 =[ $pain3 , dog_pain4 ] {}; -void() dog_pain4 =[ $pain4 , dog_pain5 ] {}; -void() dog_pain5 =[ $pain5 , dog_pain6 ] {}; -void() dog_pain6 =[ $pain6 , dog_run1 ] {}; - -void() dog_painb1 =[ $painb1 , dog_painb2 ] {}; -void() dog_painb2 =[ $painb2 , dog_painb3 ] {}; -void() dog_painb3 =[ $painb3 , dog_painb4 ] {ai_pain(4);}; -void() dog_painb4 =[ $painb4 , dog_painb5 ] {ai_pain(12);}; -void() dog_painb5 =[ $painb5 , dog_painb6 ] {ai_pain(12);}; -void() dog_painb6 =[ $painb6 , dog_painb7 ] {ai_pain(2);}; -void() dog_painb7 =[ $painb7 , dog_painb8 ] {}; -void() dog_painb8 =[ $painb8 , dog_painb9 ] {ai_pain(4);}; -void() dog_painb9 =[ $painb9 , dog_painb10 ] {}; -void() dog_painb10 =[ $painb10 , dog_painb11 ] {ai_pain(10);}; -void() dog_painb11 =[ $painb11 , dog_painb12 ] {}; -void() dog_painb12 =[ $painb12 , dog_painb13 ] {}; -void() dog_painb13 =[ $painb13 , dog_painb14 ] {}; -void() dog_painb14 =[ $painb14 , dog_painb15 ] {}; -void() dog_painb15 =[ $painb15 , dog_painb16 ] {}; -void() dog_painb16 =[ $painb16 , dog_run1 ] {}; - -void(entity attacker, float damage) dog_pain = -{ - sound(self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM); - - if(random() > 0.5) - dog_pain1(); - else - dog_painb1(); -}; - -void() dog_die1 =[ $death1, dog_die2 ] {}; -void() dog_die2 =[ $death2, dog_die3 ] {}; -void() dog_die3 =[ $death3, dog_die4 ] {}; -void() dog_die4 =[ $death4, dog_die5 ] {}; -void() dog_die5 =[ $death5, dog_die6 ] {}; -void() dog_die6 =[ $death6, dog_die7 ] {}; -void() dog_die7 =[ $death7, dog_die8 ] {}; -void() dog_die8 =[ $death8, dog_die9 ] {}; -void() dog_die9 =[ $death9, dog_die9 ] {}; - -void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {}; -void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {}; -void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {}; -void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {}; -void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {}; -void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {}; -void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {}; -void() dog_dieb8 =[ $deathb8, dog_dieb9 ] {}; -void() dog_dieb9 =[ $deathb9, dog_dieb9 ] {}; - - -void() dog_die = -{ -// check for gib - if(self.health < -35) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowHead ("progs/h_dog.mdl", self.health); - return; - } - -// regular death - sound(self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); - self.solid = SOLID_NOT; - - if(random() > 0.5) - dog_die1(); - else - dog_dieb1(); -}; - -//============================================================================ - -/* -============== -CheckDogMelee - -Returns TRUE if a melee attack would hit right now -============== -*/ -float() CheckDogMelee = -{ - if(enemy_range == RANGE_MELEE) - { // FIXME: check canreach - self.attack_state = AS_MELEE; - return TRUE; - } - return FALSE; -}; - -/* -============== -CheckDogJump - -============== -*/ -float() CheckDogJump = -{ - local vector dist; - local float d; - - if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z - + 0.75 * self.enemy.size_z) - return FALSE; - - if(self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z - + 0.25 * self.enemy.size_z) - return FALSE; - - dist = self.enemy.origin - self.origin; - dist_z = 0; - - d = vlen(dist); - - if(d < 80) - return FALSE; - - if(d > 150) - return FALSE; - - return TRUE; -}; - -float() DogCheckAttack = -{ - // if close enough for slashing, go for it - if(CheckDogMelee ()) - { - self.attack_state = AS_MELEE; - return TRUE; - } - - if(CheckDogJump ()) - { - self.attack_state = AS_MISSILE; - return TRUE; - } - - return FALSE; -}; - - -//=========================================================================== - -/*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush - -*/ -void() monster_dog = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/h_dog.mdl"); - precache_model ("progs/dog.mdl"); - - precache_sound("dog/dattack1.wav"); - precache_sound("dog/ddeath.wav"); - precache_sound("dog/dpain1.wav"); - precache_sound("dog/dsight.wav"); - precache_sound("dog/idle.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/dog.mdl"); - - setsize (self, '-12 -12 -24', '12 12 16'); - self.health = 25; - - self.th_stand = dog_stand1; - self.th_walk = dog_walk1; - self.th_run = dog_run1; - self.th_pain = dog_pain; - self.th_die = dog_die; - self.th_melee = dog_atta1; - self.th_missile = dog_leap1; - - walkmonster_start(); -}; diff --git a/QC/doors.qc b/QC/doors.qc index 8d86be4d..036dbbe2 100644 --- a/QC/doors.qc +++ b/QC/doors.qc @@ -1,9 +1,11 @@ +#include "vr_macros.qc" -float DOOR_START_OPEN = 1; -float DOOR_DONT_LINK = 4; -float DOOR_GOLD_KEY = 8; -float DOOR_SILVER_KEY = 16; -float DOOR_TOGGLE = 32; +float DOOR_START_OPEN = VRUTIL_POWER_OF_TWO(0); +float DOOR_DONT_LINK = VRUTIL_POWER_OF_TWO(2); // This was 2^2, not sure why not 2^1 +float DOOR_GOLD_KEY = VRUTIL_POWER_OF_TWO(3); +float DOOR_SILVER_KEY = VRUTIL_POWER_OF_TWO(4); +float DOOR_TOGGLE = VRUTIL_POWER_OF_TWO(5); +float DOOR_TRIGGER_ON_END = VRUTIL_POWER_OF_TWO(6); // HONEY /* @@ -26,12 +28,9 @@ THINK FUNCTIONS ============================================================================= */ -void() door_go_down; -void() door_go_up; - void() door_blocked = { - T_Damage (other, self, self, self.dmg); + T_Damage(other, self, self, self.dmg); // if a door has a negative wait, it would never come back if blocked, // so let it just squash the object to death real fast @@ -49,8 +48,14 @@ void() door_hit_top = { sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); self.state = STATE_TOP; + + // HONEY + if(self.spawnflags & DOOR_TRIGGER_ON_END) + SUB_UseTargets(); + if(self.spawnflags & DOOR_TOGGLE) return; // don't come down automatically + self.think = door_go_down; self.nextthink = self.ltime + self.wait; }; @@ -63,6 +68,8 @@ void() door_hit_bottom = void() door_go_down = { + float speed2; // HONEY + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); if(self.max_health) { @@ -70,8 +77,12 @@ void() door_go_down = self.health = self.max_health; } + // HONEY + if(self.cnt) { speed2 = self.speed * self.cnt; } + else { speed2 = self.speed; } + self.state = STATE_DOWN; - SUB_CalcMove (self.pos1, self.speed, door_hit_bottom); + SUB_CalcMove(self.pos1, speed2, door_hit_bottom); }; void() door_go_up = @@ -89,7 +100,9 @@ void() door_go_up = self.state = STATE_UP; SUB_CalcMove (self.pos2, self.speed, door_hit_top); - SUB_UseTargets(); + if(!(self.spawnflags & DOOR_TRIGGER_ON_END)) { // HONEY + SUB_UseTargets(); + } }; @@ -103,17 +116,37 @@ ACTIVATION FUNCTIONS void() door_fire = { - local entity oself; - local entity starte; + entity oself; + entity starte; if(self.owner != self) objerror ("door_fire: self.owner != self"); // play use key sound - if(self.items) + if(self.vr_itemId) + { sound(self, CHAN_ITEM, self.noise4, 1, ATTN_NORM); + // HONEY + if(self.lefty) + { + self.vr_itemId = 0; + self.touch = SUB_Null; + self.goalentity = activator; // Save activator here + SUB_DoLater(door_fire, self.lefty); // Delay opening + return; + } + } + + // HONEY + if(self.lefty) + { + activator = self.goalentity; //Restore activator here + self.lefty = 0; + } + + self.message = string_null; // no more message oself = self; @@ -126,7 +159,7 @@ void() door_fire = { door_go_down(); self = self.enemy; - } while( (self != starte) && (self != world) ); + } while((self != starte) && (self != world)); self = oself; return; } @@ -138,14 +171,14 @@ void() door_fire = { door_go_up(); self = self.enemy; - } while( (self != starte) && (self != world) ); + } while((self != starte) && (self != world)); self = oself; }; void() door_use = { - local entity oself; + entity oself; self.message = ""; // door message are for touch only self.owner.message = ""; @@ -164,6 +197,7 @@ void() door_trigger_touch = if(time < self.attack_finished) return; + self.attack_finished = time + 1; activator = other; @@ -175,7 +209,7 @@ void() door_trigger_touch = void() door_killed = { - local entity oself; + entity oself; oself = self; self = self.owner; @@ -197,6 +231,7 @@ void() door_touch = { if(other.classname != "player") return; + if(self.owner.attack_finished > time) return; @@ -204,32 +239,32 @@ void() door_touch = if(self.owner.message != "") { - centerprint (other, self.owner.message); + centerprint(other, self.owner.message); sound(other, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); } // key door stuff - if(!self.items) + if(!self.vr_itemId) return; // FIXME: blink key on player's status bar - if( (self.items & other.items) != self.items ) + if(!VR_ItemUtil_EntHasItem(other, self.vr_itemId)) { - if(self.owner.items == IT_KEY1) + if(self.owner.vr_itemId == IID_KEY1) { if(world.worldtype == 2) { - centerprint (other, "You need the silver keycard"); + centerprint(other, "You need the silver keycard"); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); } else if(world.worldtype == 1) { - centerprint (other, "You need the silver runekey"); + centerprint(other, "You need the silver runekey"); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); } else if(world.worldtype == 0) { - centerprint (other, "You need the silver key"); + centerprint(other, "You need the silver key"); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); } } @@ -237,27 +272,34 @@ void() door_touch = { if(world.worldtype == 2) { - centerprint (other, "You need the gold keycard"); + centerprint(other, "You need the gold keycard"); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); } else if(world.worldtype == 1) { - centerprint (other, "You need the gold runekey"); + centerprint(other, "You need the gold runekey"); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); } else if(world.worldtype == 0) { - centerprint (other, "You need the gold key"); + centerprint(other, "You need the gold key"); sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); } } return; } - other.items = other.items - self.items; + VR_ItemUtil_EntDelItem(other, self.vr_itemId); self.touch = SUB_Null; + if(self.enemy) + { self.enemy.touch = SUB_Null; // get paired door + } + + // HONEY + activator = other; + door_use(); }; @@ -272,18 +314,27 @@ SPAWNING FUNCTIONS entity(vector fmins, vector fmaxs) spawn_field = { - local entity trigger; - local vector t1, t2; + entity trigger; + vector t1, t2; trigger = spawn(); trigger.movetype = MOVETYPE_NONE; trigger.solid = SOLID_TRIGGER; - trigger.owner = self; - trigger.touch = door_trigger_touch; + trigger.owner = self; //Always the master door... + + // HONEY + if(self.cnt) + { + trigger.touch = door_temp_trigger_touch; + } + else + { + trigger.touch = door_trigger_touch; + } t1 = fmins; t2 = fmaxs; - setsize (trigger, t1 - '60 60 8', t2 + '60 60 8'); + setsize(trigger, t1 - '60 60 8', t2 + '60 60 8'); return (trigger); }; @@ -310,17 +361,19 @@ float (entity e1, entity e2) EntitiesTouching = ============= LinkDoors +cg: self.owner always is the master door and self.enemy is always the next door in the chain ============= */ void() LinkDoors = { - local entity t, starte; - local vector cmins, cmaxs; + entity t, starte; + vector cmins, cmaxs; if(self.enemy) return; // already linked by another door - if(self.spawnflags & 4) + + if(self.spawnflags & DOOR_DONT_LINK) { self.owner = self.enemy = self; return; // don't want to link this door @@ -338,12 +391,22 @@ void() LinkDoors = if(self.health) starte.health = self.health; - if(self.targetname) + + // HONEY + if(self.cnt) + starte.cnt = self.cnt; + + // HONEY + if(self.lefty) + starte.lefty = self.lefty; + + if(self.targetname != NULLSTR) starte.targetname = self.targetname; + if(self.message != "") starte.message = self.message; - t = find (t, classname, self.classname); + t = find(t, classname, self.classname); if(!t) { self.enemy = starte; // make the chain a loop @@ -355,9 +418,11 @@ void() LinkDoors = if(self.health) return; - if(self.targetname) + + if(self.targetname != "" && /* HONEY */ !self.cnt) return; - if(self.items) + + if(self.vr_itemId) return; self.owner.trigger_field = spawn_field(cmins, cmaxs); @@ -386,7 +451,7 @@ void() LinkDoors = if(t.maxs_z > cmaxs_z) cmaxs_z = t.maxs_z; } - } while(1 ); + } while(1); }; @@ -418,8 +483,6 @@ Key doors are allways wait -1. void() func_door = { - local vector tempVect; - if(world.worldtype == 0) { precache_sound("doors/medtry.wav"); @@ -443,7 +506,7 @@ void() func_door = } else { - dprint ("no worldtype set!\n"); + dprint("no worldtype set!\n"); } if(self.sounds == 0) @@ -482,52 +545,70 @@ void() func_door = self.noise2 = "doors/ddoor1.wav"; } - SetMovedir(); + if(!self.movedir) + SetMovedir(); self.max_health = self.health; self.solid = SOLID_BSP; self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); + setorigin(self, self.origin); + setmodel(self, self.model); self.classname = "door"; self.blocked = door_blocked; self.use = door_use; if(self.spawnflags & DOOR_SILVER_KEY) - self.items = IT_KEY1; + { + self.vr_itemId = IID_KEY1; + } + if(self.spawnflags & DOOR_GOLD_KEY) - self.items = IT_KEY2; + { + self.vr_itemId = IID_KEY2; + } - if(!self.speed) - self.speed = 100; - if(!self.wait) - self.wait = 3; - if(!self.lip) - self.lip = 8; - if(!self.dmg) - self.dmg = 2; + if(!self.speed) { self.speed = 100; } + if(!self.wait) { self.wait = 3; } + if(!self.lip) { self.lip = 8; } + if(!self.dmg) { self.dmg = 2; } - self.pos1 = self.origin; - // self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + // HONEY + if(VR_GameUtil_EnableHoneyExtensions() && !self.lefty) + { + self.lefty = 1; + } -// PGM fix for cameron's door problem - 02/19/97 + self.pos1 = self.origin; + // PGM fix for cameron's door problem - 02/19/97 + vector tempVect; tempVect = self.movedir; + if(tempVect_x < 0) + { tempVect_x = 0 - tempVect_x; + } + if(tempVect_y < 0) + { tempVect_y = 0 - tempVect_y; -// if(tempVect_z < 0) -// tempVect_z = 0 - tempVect_z; -// self.pos2 = self.pos1 + self.movedir*(tempVect*self.size - self.lip); - self.pos2 = self.pos1 + self.movedir*(fabs(tempVect*self.size) - self.lip); + } -// DOOR_START_OPEN is to allow an entity to be lighted in the closed position -// but spawn in the open position + if(!self.pos2) // HONEY + { + self.pos2 = self.pos1 + self.movedir*(fabs(tempVect*self.size) - self.lip); + } + else + { + self.pos2 = self.pos1 + self.pos2; + } + + // DOOR_START_OPEN is to allow an entity to be lighted in the closed position + // but spawn in the open position if(self.spawnflags & DOOR_START_OPEN) { - setorigin (self, self.pos2); + setorigin(self, self.pos2); self.pos2 = self.pos1; self.pos1 = self.origin; } @@ -540,8 +621,10 @@ void() func_door = self.th_die = door_killed; } - if(self.items) + if(self.vr_itemId) + { self.wait = -1; + } self.touch = door_touch; @@ -576,7 +659,7 @@ float SECRET_YES_SHOOT = 16; // shootable even if targeted void () fd_secret_use = { - local float temp; + float temp; self.health = 10000; @@ -614,12 +697,19 @@ void () fd_secret_use = if(!self.t_length) self. t_length = fabs(v_forward * self.size); - if(self.spawnflags & SECRET_1ST_DOWN) - self.dest1 = self.origin - v_up * self.t_width; - else - self.dest1 = self.origin + v_right * (self.t_width * temp); + if(!(self.dest1_x|self.dest1_y|self.dest1_z)) // HONEY + { + if(self.spawnflags & SECRET_1ST_DOWN) + self.dest1 = self.origin - v_up * self.t_width; + else + self.dest1 = self.origin + v_right * (self.t_width * temp); + } + + if(!(self.dest2_x|self.dest2_y|self.dest2_z)) // HONEY + { + self.dest2 = self.dest1 + v_forward * self.t_length; + } - self.dest2 = self.dest1 + v_forward * self.t_length; SUB_CalcMove(self.dest1, self.speed, fd_secret_move1); sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); }; @@ -692,7 +782,7 @@ void () secret_blocked = if(time < self.attack_finished) return; self.attack_finished = time + 0.5; - T_Damage (other, self, self, self.dmg); + T_Damage(other, self, self, self.dmg); }; /* @@ -711,9 +801,9 @@ void() secret_touch = self.attack_finished = time + 2; - if(self.message) + if(self.message != NULLSTR) { - centerprint (other, self.message); + centerprint(other, self.message); sound(other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); } }; @@ -775,14 +865,25 @@ void () func_door_secret = self.solid = SOLID_BSP; self.movetype = MOVETYPE_PUSH; self.classname = "door"; - setmodel (self, self.model); - setorigin (self, self.origin); + setmodel(self, self.model); + setorigin(self, self.origin); + + // HONEY + if(self.dest2_x|self.dest2_y|self.dest2_z) + self.dest2 = self.origin + self.dest2 + self.dest1; + + // HONEY + if(self.dest1_x|self.dest1_y|self.dest1_z) + self.dest1 = self.origin + self.dest1; self.touch = secret_touch; self.blocked = secret_blocked; - self.speed = 50; + + if(!self.speed) // HONEY + self.speed = 50; + self.use = fd_secret_use; - if( !self.targetname || self.spawnflags&SECRET_YES_SHOOT) + if(!self.targetname || self.spawnflags&SECRET_YES_SHOOT) { self.health = 10000; self.takedamage = DAMAGE_YES; diff --git a/QC/enforcer.qc b/QC/enforcer.qc deleted file mode 100644 index 09607ac6..00000000 --- a/QC/enforcer.qc +++ /dev/null @@ -1,380 +0,0 @@ -/* -============================================================================== - -SOLDIER / PLAYER - -============================================================================== -*/ - -$cd id1/models/enforcer -$origin 0 -6 24 -$base base -$skin skin - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 -$frame walk11 walk12 walk13 walk14 walk15 walk16 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 - -$frame attack1 attack2 attack3 attack4 attack5 attack6 -$frame attack7 attack8 attack9 attack10 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 -$frame death9 death10 death11 death12 death13 death14 - -$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 -$frame fdeath9 fdeath10 fdeath11 - -$frame paina1 paina2 paina3 paina4 - -$frame painb1 painb2 painb3 painb4 painb5 - -$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 - -$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 -$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 -$frame paind17 paind18 paind19 - - -void() Laser_Touch = -{ - local vector org; - - if(other == self.owner) - return; // don't explode on owner - - if(pointcontents(self.origin) == CONTENT_SKY) - { - remove(self); - return; - } - -//MED 01/16/97 added silent command - - if(!(self.spawnflags & SPAWNFLAG_SILENT)) - sound(self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); - org = self.origin - 8*normalize(self.velocity); - - if(other.health) - { - SpawnBlood (org, self.velocity*0.2, 15); - T_Damage (other, self, self.owner, 15); - } - else - { - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_GUNSHOT); - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); - } - - remove(self); -}; - -void(vector org, vector vec) LaunchLaser = -{ - if(self.classname == "monster_enforcer") - sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); - - vec = normalize(vec); - - newmis = spawn(); - newmis.owner = self; - newmis.movetype = MOVETYPE_FLY; - newmis.solid = SOLID_BBOX; - newmis.effects = EF_DIMLIGHT; - newmis.classname = "enforcer_laser"; - - setmodel (newmis, "progs/laser.mdl"); - setsize (newmis, '0 0 0', '0 0 0'); - - if(self.classname == "monster_morph") - { - if(!self.owner) - newmis.skin = 1; - } - - setorigin (newmis, org); - - newmis.velocity = vec * 600; - newmis.angles = vectoangles(newmis.velocity); - - newmis.nextthink = time + 5; - newmis.think = SUB_Remove; - newmis.touch = Laser_Touch; -}; - - - -void() enforcer_fire = -{ - local vector org; - - self.effects = self.effects | EF_MUZZLEFLASH; - makevectors (self.angles); - - org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16'; - - LaunchLaser(org, self.enemy.origin - self.origin); -}; - -//============================================================================ - -void() enf_stand1 =[ $stand1, enf_stand2 ] {ai_stand();}; -void() enf_stand2 =[ $stand2, enf_stand3 ] {ai_stand();}; -void() enf_stand3 =[ $stand3, enf_stand4 ] {ai_stand();}; -void() enf_stand4 =[ $stand4, enf_stand5 ] {ai_stand();}; -void() enf_stand5 =[ $stand5, enf_stand6 ] {ai_stand();}; -void() enf_stand6 =[ $stand6, enf_stand7 ] {ai_stand();}; -void() enf_stand7 =[ $stand7, enf_stand1 ] {ai_stand();}; - -void() enf_walk1 =[ $walk1 , enf_walk2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE); -ai_walk(2);}; -void() enf_walk2 =[ $walk2 , enf_walk3 ] {ai_walk(4);}; -void() enf_walk3 =[ $walk3 , enf_walk4 ] {ai_walk(4);}; -void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3);}; -void() enf_walk5 =[ $walk5 , enf_walk6 ] {ai_walk(1);}; -void() enf_walk6 =[ $walk6 , enf_walk7 ] {ai_walk(2);}; -void() enf_walk7 =[ $walk7 , enf_walk8 ] {ai_walk(2);}; -void() enf_walk8 =[ $walk8 , enf_walk9 ] {ai_walk(1);}; -void() enf_walk9 =[ $walk9 , enf_walk10 ] {ai_walk(2);}; -void() enf_walk10 =[ $walk10, enf_walk11 ] {ai_walk(4);}; -void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);}; -void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);}; -void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);}; -void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);}; -void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);}; -void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);}; - -void() enf_run1 =[ $run1 , enf_run2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE); -ai_run(18);}; -void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14);}; -void() enf_run3 =[ $run3 , enf_run4 ] {ai_run(7);}; -void() enf_run4 =[ $run4 , enf_run5 ] {ai_run(12);}; -void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14);}; -void() enf_run6 =[ $run6 , enf_run7 ] {ai_run(14);}; -void() enf_run7 =[ $run7 , enf_run8 ] {ai_run(7);}; -void() enf_run8 =[ $run8 , enf_run1 ] {ai_run(11);}; - -void() enf_atk1 =[ $attack1, enf_atk2 ] {ai_face();}; -void() enf_atk2 =[ $attack2, enf_atk3 ] {ai_face();}; -void() enf_atk3 =[ $attack3, enf_atk4 ] {ai_face();}; -void() enf_atk4 =[ $attack4, enf_atk5 ] {ai_face();}; -void() enf_atk5 =[ $attack5, enf_atk6 ] {ai_face();}; -void() enf_atk6 =[ $attack6, enf_atk7 ] {enforcer_fire();}; -void() enf_atk7 =[ $attack7, enf_atk8 ] {ai_face();}; -void() enf_atk8 =[ $attack8, enf_atk9 ] {ai_face();}; -void() enf_atk9 =[ $attack5, enf_atk10 ] {ai_face();}; -void() enf_atk10 =[ $attack6, enf_atk11 ] {enforcer_fire();}; -void() enf_atk11 =[ $attack7, enf_atk12 ] {ai_face();}; -void() enf_atk12 =[ $attack8, enf_atk13 ] {ai_face();}; -void() enf_atk13 =[ $attack9, enf_atk14 ] {ai_face();}; -void() enf_atk14 =[ $attack10, enf_run1 ] {ai_face(); -SUB_CheckRefire (enf_atk1); -}; - -void() enf_paina1 =[ $paina1, enf_paina2 ] {}; -void() enf_paina2 =[ $paina2, enf_paina3 ] {}; -void() enf_paina3 =[ $paina3, enf_paina4 ] {}; -void() enf_paina4 =[ $paina4, enf_run1 ] {}; - -void() enf_painb1 =[ $painb1, enf_painb2 ] {}; -void() enf_painb2 =[ $painb2, enf_painb3 ] {}; -void() enf_painb3 =[ $painb3, enf_painb4 ] {}; -void() enf_painb4 =[ $painb4, enf_painb5 ] {}; -void() enf_painb5 =[ $painb5, enf_run1 ] {}; - -void() enf_painc1 =[ $painc1, enf_painc2 ] {}; -void() enf_painc2 =[ $painc2, enf_painc3 ] {}; -void() enf_painc3 =[ $painc3, enf_painc4 ] {}; -void() enf_painc4 =[ $painc4, enf_painc5 ] {}; -void() enf_painc5 =[ $painc5, enf_painc6 ] {}; -void() enf_painc6 =[ $painc6, enf_painc7 ] {}; -void() enf_painc7 =[ $painc7, enf_painc8 ] {}; -void() enf_painc8 =[ $painc8, enf_run1 ] {}; - -void() enf_paind1 =[ $paind1, enf_paind2 ] {}; -void() enf_paind2 =[ $paind2, enf_paind3 ] {}; -void() enf_paind3 =[ $paind3, enf_paind4 ] {}; -void() enf_paind4 =[ $paind4, enf_paind5 ] {ai_painforward(2);}; -void() enf_paind5 =[ $paind5, enf_paind6 ] {ai_painforward(1);}; -void() enf_paind6 =[ $paind6, enf_paind7 ] {}; -void() enf_paind7 =[ $paind7, enf_paind8 ] {}; -void() enf_paind8 =[ $paind8, enf_paind9 ] {}; -void() enf_paind9 =[ $paind9, enf_paind10 ] {}; -void() enf_paind10 =[ $paind10, enf_paind11 ] {}; -void() enf_paind11 =[ $paind11, enf_paind12 ] {ai_painforward(1);}; -void() enf_paind12 =[ $paind12, enf_paind13 ] {ai_painforward(1);}; -void() enf_paind13 =[ $paind13, enf_paind14 ] {ai_painforward(1);}; -void() enf_paind14 =[ $paind14, enf_paind15 ] {}; -void() enf_paind15 =[ $paind15, enf_paind16 ] {}; -void() enf_paind16 =[ $paind16, enf_paind17 ] {ai_pain(1);}; -void() enf_paind17 =[ $paind17, enf_paind18 ] {ai_pain(1);}; -void() enf_paind18 =[ $paind18, enf_paind19 ] {}; -void() enf_paind19 =[ $paind19, enf_run1 ] {}; - -void(entity attacker, float damage) enf_pain = -{ - local float r; - - r = random(); - if(self.pain_finished > time) - return; - - - if(r < 0.5) - sound(self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "enforcer/pain2.wav", 1, ATTN_NORM); - - if(r < 0.2) - { - self.pain_finished = time + 1; - enf_paina1(); - } - else if(r < 0.4) - { - self.pain_finished = time + 1; - enf_painb1(); - } - else if(r < 0.7) - { - self.pain_finished = time + 1; - enf_painc1(); - } - else - { - self.pain_finished = time + 2; - enf_paind1(); - } -}; - -//============================================================================ - -void() EnforcerDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - self.ammo_cells = 5; - DropBackpack(); - - if(entPlayer != world && random() > 0.65) - { - if(!TryEnemyDrop(entPlayer, WID_NAILGUN, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_NAILGUN, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_LASER_CANNON, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_LIGHTNING, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_AXE, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_SHOTGUN, 0.2)) - if(!TryEnemyDrop(entPlayer, WID_SHOTGUN, 0.2)) - { /* Intentionally empty. */ } - } -} - - -void() enf_die1 =[ $death1, enf_die2 ] {}; -void() enf_die2 =[ $death2, enf_die3 ] {}; -void() enf_die3 =[ $death3, enf_die4 ] -{EnforcerDrop();}; -void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);}; -void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);}; -void() enf_die6 =[ $death6, enf_die7 ] {}; -void() enf_die7 =[ $death7, enf_die8 ] {}; -void() enf_die8 =[ $death8, enf_die9 ] {}; -void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);}; -void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);}; -void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);}; -void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);}; -void() enf_die13 =[ $death13, enf_die14 ] {}; -void() enf_die14 =[ $death14, enf_die14 ] {}; - -void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] { - -}; -void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {}; -void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] -{EnforcerDrop();}; -void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {}; -void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {}; -void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {}; -void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {}; -void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {}; -void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {}; -void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {}; -void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {}; - - -void() enf_die = -{ -// check for gib - if(self.health < -35) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_mega.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - EnforcerDrop(); - return; - } - -// regular death - sound(self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); - if(random() > 0.5) - enf_die1(); - else - enf_fdie1(); -}; - - -/*QUAKED monster_enforcer (1 0 0) (-16 -16 -24) (16 16 40) Ambush - -*/ -void() monster_enforcer = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model2 ("progs/enforcer.mdl"); - precache_model2 ("progs/h_mega.mdl"); - precache_model2 ("progs/laser.mdl"); - - precache_sound2 ("enforcer/death1.wav"); - precache_sound2 ("enforcer/enfire.wav"); - precache_sound2 ("enforcer/enfstop.wav"); - precache_sound2 ("enforcer/idle1.wav"); - precache_sound2 ("enforcer/pain1.wav"); - precache_sound2 ("enforcer/pain2.wav"); - precache_sound2 ("enforcer/sight1.wav"); - precache_sound2 ("enforcer/sight2.wav"); - precache_sound2 ("enforcer/sight3.wav"); - precache_sound2 ("enforcer/sight4.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/enforcer.mdl"); - - setsize (self, '-14 -14 -24', '14 14 28'); - self.health = 80; - - self.th_stand = enf_stand1; - self.th_walk = enf_walk1; - self.th_run = enf_run1; - self.th_pain = enf_pain; - self.th_die = enf_die; - self.th_missile = enf_atk1; - - walkmonster_start(); -}; diff --git a/QC/fight.qc b/QC/fight.qc index 64641a45..ad354f6c 100644 --- a/QC/fight.qc +++ b/QC/fight.qc @@ -8,24 +8,6 @@ When it decides it can't attack, it goes into hunt mode. */ -float(float v) anglemod; - -void() knight_atk1; -void() knight_runatk1; -void() ogre_smash1; -void() ogre_swing1; - -void() sham_smash1; -void() sham_swingr1; -void() sham_swingl1; - -float() DemonCheckAttack; -void(float side) Demon_Melee; - -void(vector dest) ChooseTurn; - -void() ai_face; - float enemy_vis, enemy_infront, enemy_range; float enemy_yaw; @@ -33,7 +15,7 @@ float enemy_yaw; void() knight_attack = { - local float len; + float len; // decide if now is a good swing time len = vlen(self.enemy.origin+self.enemy.view_ofs - (self.origin+self.view_ofs)); @@ -56,9 +38,9 @@ Returns FALSE if movement should continue */ float() CheckAttack = { - local vector spot1, spot2; - local entity targ; - local float chance; + vector spot1, spot2; + entity targ; + float chance; targ = self.enemy; @@ -162,15 +144,15 @@ void(float d) ai_charge = void() ai_charge_side = { - local vector dtemp; - local float heading; + vector dtemp; + float heading; // aim to the left of the enemy for a flyby self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); ChangeYaw(); - makevectors (self.angles); + makevectors(self.angles); dtemp = self.enemy.origin - 30*v_right; heading = vectoyaw(dtemp - self.origin); @@ -186,8 +168,8 @@ ai_melee */ void() ai_melee = { - local vector delta; - local float ldmg; + vector delta; + float ldmg; if(!self.enemy) return; // removed before stroke @@ -198,14 +180,14 @@ void() ai_melee = return; ldmg = (random() + random() + random()) * 3; - T_Damage (self.enemy, self, self, ldmg); + T_Damage(self.enemy, self, self, ldmg); }; void() ai_melee_side = { - local vector delta; - local float ldmg; + vector delta; + float ldmg; if(!self.enemy) return; // removed before stroke @@ -216,10 +198,10 @@ void() ai_melee_side = if(vlen(delta) > 60) return; - if(!CanDamage (self.enemy, self)) + if(!CanDamage(self.enemy, self)) return; ldmg = (random() + random() + random()) * 3; - T_Damage (self.enemy, self, self, ldmg); + T_Damage(self.enemy, self, self, ldmg); }; @@ -235,9 +217,9 @@ Returns FALSE if movement should continue */ float() SoldierCheckAttack = { - local vector spot1, spot2; - local entity targ; - local float chance; + vector spot1, spot2; + entity targ; + float chance; targ = self.enemy; @@ -294,12 +276,12 @@ Returns FALSE if movement should continue */ float() ShamCheckAttack = { - local vector spot1, spot2; - local entity targ; + vector spot1, spot2; + entity targ; if(enemy_range == RANGE_MELEE) { - if(CanDamage (self.enemy, self)) + if(CanDamage(self.enemy, self)) { self.attack_state = AS_MELEE; return TRUE; @@ -352,13 +334,13 @@ Returns FALSE if movement should continue */ float() OgreCheckAttack = { - local vector spot1, spot2; - local entity targ; - local float chance; + vector spot1, spot2; + entity targ; + float chance; if(enemy_range == RANGE_MELEE) { - if(CanDamage (self.enemy, self)) + if(CanDamage(self.enemy, self)) { self.attack_state = AS_MELEE; return TRUE; diff --git a/QC/fish.qc b/QC/fish.qc deleted file mode 100644 index 7360c8ed..00000000 --- a/QC/fish.qc +++ /dev/null @@ -1,209 +0,0 @@ -$cd id1/models/fish -$origin 0 0 24 -$base base -$skin skin - -$frame attack1 attack2 attack3 attack4 attack5 attack6 -$frame attack7 attack8 attack9 attack10 attack11 attack12 attack13 -$frame attack14 attack15 attack16 attack17 attack18 - -$frame death1 death2 death3 death4 death5 death6 death7 -$frame death8 death9 death10 death11 death12 death13 death14 death15 -$frame death16 death17 death18 death19 death20 death21 - -$frame swim1 swim2 swim3 swim4 swim5 swim6 swim7 swim8 -$frame swim9 swim10 swim11 swim12 swim13 swim14 swim15 swim16 swim17 -$frame swim18 - -$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 -$frame pain9 - -void() swimmonster_start; - -void() f_stand1 =[ $swim1, f_stand2 ] {ai_stand();}; -void() f_stand2 =[ $swim2, f_stand3 ] {ai_stand();}; -void() f_stand3 =[ $swim3, f_stand4 ] {ai_stand();}; -void() f_stand4 =[ $swim4, f_stand5 ] {ai_stand();}; -void() f_stand5 =[ $swim5, f_stand6 ] {ai_stand();}; -void() f_stand6 =[ $swim6, f_stand7 ] {ai_stand();}; -void() f_stand7 =[ $swim7, f_stand8 ] {ai_stand();}; -void() f_stand8 =[ $swim8, f_stand9 ] {ai_stand();}; -void() f_stand9 =[ $swim9, f_stand10 ] {ai_stand();}; -void() f_stand10 =[ $swim10, f_stand11 ] {ai_stand();}; -void() f_stand11 =[ $swim11, f_stand12 ] {ai_stand();}; -void() f_stand12 =[ $swim12, f_stand13 ] {ai_stand();}; -void() f_stand13 =[ $swim13, f_stand14 ] {ai_stand();}; -void() f_stand14 =[ $swim14, f_stand15 ] {ai_stand();}; -void() f_stand15 =[ $swim15, f_stand16 ] {ai_stand();}; -void() f_stand16 =[ $swim16, f_stand17 ] {ai_stand();}; -void() f_stand17 =[ $swim17, f_stand18 ] {ai_stand();}; -void() f_stand18 =[ $swim18, f_stand1 ] {ai_stand();}; - -void() f_walk1 =[ $swim1, f_walk2 ] {ai_walk(8);}; -void() f_walk2 =[ $swim2, f_walk3 ] {ai_walk(8);}; -void() f_walk3 =[ $swim3, f_walk4 ] {ai_walk(8);}; -void() f_walk4 =[ $swim4, f_walk5 ] {ai_walk(8);}; -void() f_walk5 =[ $swim5, f_walk6 ] {ai_walk(8);}; -void() f_walk6 =[ $swim6, f_walk7 ] {ai_walk(8);}; -void() f_walk7 =[ $swim7, f_walk8 ] {ai_walk(8);}; -void() f_walk8 =[ $swim8, f_walk9 ] {ai_walk(8);}; -void() f_walk9 =[ $swim9, f_walk10 ] {ai_walk(8);}; -void() f_walk10 =[ $swim10, f_walk11 ] {ai_walk(8);}; -void() f_walk11 =[ $swim11, f_walk12 ] {ai_walk(8);}; -void() f_walk12 =[ $swim12, f_walk13 ] {ai_walk(8);}; -void() f_walk13 =[ $swim13, f_walk14 ] {ai_walk(8);}; -void() f_walk14 =[ $swim14, f_walk15 ] {ai_walk(8);}; -void() f_walk15 =[ $swim15, f_walk16 ] {ai_walk(8);}; -void() f_walk16 =[ $swim16, f_walk17 ] {ai_walk(8);}; -void() f_walk17 =[ $swim17, f_walk18 ] {ai_walk(8);}; -void() f_walk18 =[ $swim18, f_walk1 ] {ai_walk(8);}; - -void() f_run1 =[ $swim1, f_run2 ] {ai_run(12); - if(random() < 0.5) - sound(self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM); -}; -void() f_run2 =[ $swim3, f_run3 ] {ai_run(12);}; -void() f_run3 =[ $swim5, f_run4 ] {ai_run(12);}; -void() f_run4 =[ $swim7, f_run5 ] {ai_run(12);}; -void() f_run5 =[ $swim9, f_run6 ] {ai_run(12);}; -void() f_run6 =[ $swim11, f_run7 ] {ai_run(12);}; -void() f_run7 =[ $swim13, f_run8 ] {ai_run(12);}; -void() f_run8 =[ $swim15, f_run9 ] {ai_run(12);}; -void() f_run9 =[ $swim17, f_run1 ] {ai_run(12);}; - -void() fish_melee = -{ - local vector delta; - local float ldmg; - - if(!self.enemy) - return; // removed before stroke - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 60) - return; - - sound(self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM); - ldmg = (random() + random()) * 3; - T_Damage (self.enemy, self, self, ldmg); -}; - -void() f_attack1 =[ $attack1, f_attack2 ] {ai_charge(10);}; -void() f_attack2 =[ $attack2, f_attack3 ] {ai_charge(10);}; -void() f_attack3 =[ $attack3, f_attack4 ] {fish_melee();}; -void() f_attack4 =[ $attack4, f_attack5 ] {ai_charge(10);}; -void() f_attack5 =[ $attack5, f_attack6 ] {ai_charge(10);}; -void() f_attack6 =[ $attack6, f_attack7 ] {ai_charge(10);}; -void() f_attack7 =[ $attack7, f_attack8 ] {ai_charge(10);}; -void() f_attack8 =[ $attack8, f_attack9 ] {ai_charge(10);}; -void() f_attack9 =[ $attack9, f_attack10] {fish_melee();}; -void() f_attack10 =[ $attack10, f_attack11] {ai_charge(10);}; -void() f_attack11 =[ $attack11, f_attack12] {ai_charge(10);}; -void() f_attack12 =[ $attack12, f_attack13] {ai_charge(10);}; -void() f_attack13 =[ $attack13, f_attack14] {ai_charge(10);}; -void() f_attack14 =[ $attack14, f_attack15] {ai_charge(10);}; -void() f_attack15 =[ $attack15, f_attack16] {fish_melee();}; -void() f_attack16 =[ $attack16, f_attack17] {ai_charge(10);}; -void() f_attack17 =[ $attack17, f_attack18] {ai_charge(10);}; -void() f_attack18 =[ $attack18, f_run1 ] {ai_charge(10);}; - -void() f_death1 =[ $death1, f_death2 ] { -sound(self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM); -}; -void() f_death2 =[ $death2, f_death3 ] {}; -void() f_death3 =[ $death3, f_death4 ] {}; -void() f_death4 =[ $death4, f_death5 ] {}; -//MED 01/15/97 moved solid to here -void() f_death5 =[ $death5, f_death6 ] {self.solid = SOLID_NOT;}; -void() f_death6 =[ $death6, f_death7 ] {}; -void() f_death7 =[ $death7, f_death8 ] {}; -void() f_death8 =[ $death8, f_death9 ] {}; -void() f_death9 =[ $death9, f_death10 ] {}; -void() f_death10 =[ $death10, f_death11 ] {}; -void() f_death11 =[ $death11, f_death12 ] {}; -void() f_death12 =[ $death12, f_death13 ] {}; -void() f_death13 =[ $death13, f_death14 ] {}; -void() f_death14 =[ $death14, f_death15 ] {}; -void() f_death15 =[ $death15, f_death16 ] {}; -void() f_death16 =[ $death16, f_death17 ] {}; -void() f_death17 =[ $death17, f_death18 ] {}; -void() f_death18 =[ $death18, f_death19 ] {}; -void() f_death19 =[ $death19, f_death20 ] {}; -void() f_death20 =[ $death20, f_death21 ] {}; -//MED 01/15/97 removed solid from here -//void() f_death21 =[ $death21, f_death21 ] {self.solid = SOLID_NOT;}; -void() f_death21 =[ $death21, f_death21 ] {}; - -//MED 01/15/97 added fish_die -void() fish_die = -{ -// check for gib - if(self.health < -20) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - self.think = SUB_Remove; - self.nextthink= time + 0.1; - return; - } - -// regular death - f_death1(); -}; - -void() f_pain1 =[ $pain1, f_pain2 ] {}; -void() f_pain2 =[ $pain2, f_pain3 ] {ai_pain(6);}; -void() f_pain3 =[ $pain3, f_pain4 ] {ai_pain(6);}; -void() f_pain4 =[ $pain4, f_pain5 ] {ai_pain(6);}; -void() f_pain5 =[ $pain5, f_pain6 ] {ai_pain(6);}; -void() f_pain6 =[ $pain6, f_pain7 ] {ai_pain(6);}; -void() f_pain7 =[ $pain7, f_pain8 ] {ai_pain(6);}; -void() f_pain8 =[ $pain8, f_pain9 ] {ai_pain(6);}; -void() f_pain9 =[ $pain9, f_run1 ] {ai_pain(6);}; - -void(entity attacker, float damage) fish_pain = -{ - -// fish allways do pain frames - f_pain1(); -}; - - - -/*QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) Ambush -*/ -void() monster_fish = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model2 ("progs/fish.mdl"); - - precache_sound2 ("fish/death.wav"); - precache_sound2 ("fish/bite.wav"); - precache_sound2 ("fish/idle.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/fish.mdl"); - - // TODO VR: (P2) tweak hitbox - setsize (self, '-16 -16 -24', '16 16 24'); - self.health = 25; - - self.th_stand = f_stand1; - self.th_walk = f_walk1; - self.th_run = f_run1; -//MED 01/15/97 added fish death - self.th_die = fish_die; - self.th_pain = fish_pain; - self.th_melee = f_attack1; - - swimmonster_start(); -}; diff --git a/QC/frikbot/bot.qc b/QC/frikbot/bot.qc new file mode 100644 index 00000000..6c928ca4 --- /dev/null +++ b/QC/frikbot/bot.qc @@ -0,0 +1,1277 @@ + +/* +====================================== +FrikBot X (Version 0.10.2) +====================================== + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +====================================== +These installation instructions only apply to Normal Quake (as does this +entire file). + +-------------------------------------- +To install on a new mod, do all this: +-------------------------------------- +Place all included bot*.qc files in the subdirectory "frikbot" +in your source folder, then... + +* Add the following lines to progs.src right after the defs.qc line +frikbot/bot.qc +frikbot/bot_way.qc +frikbot/bot_fight.qc +frikbot/bot_ai.qc +frikbot/bot_misc.qc +frikbot/bot_phys.qc +frikbot/bot_move.qc +frikbot/bot_ed.qc + +-------------------------------------- +* Comment out the following functions in defs.qc +sound, stuffcmd, sprint, aim, centerprint, setspawnparms +WriteByte, WriteChar, WriteShort, WriteLong, WriteCoord +WriteAngle, WriteString, WriteEntity +-------------------------------------- +* Add this to worldspawn() in world.qc, right at the very top, before InitBodyQue(); +BotInit(); // FrikBot +-------------------------------------- +* Add this line to StartFrame() in world.qc, at the very top +BotFrame(); // FrikBot +-------------------------------------- +* Add these two lines to PlayerPreThink in client.qc at the very top +if(BotPreFrame()) // FrikBot + return; +-------------------------------------- +* Add this line to PlayerPostThink in client.qc at the very top +if(BotPostFrame()) // FrikBot + return; +-------------------------------------- +* Add the following line to the very top of Client Connect in client.qc +ClientInRankings(); // FrikBot +-------------------------------------- +* Add these lines to the very top of ClientDisconnect in client.qc +ClientDisconnected(); // FrikBot +-------------------------------------- + +To install the waypoints: + +add + +waypoints/map_dm1.qc +waypoints/map_dm2.qc +waypoints/map_dm3.qc +waypoints/map_dm4.qc +waypoints/map_dm5.qc +waypoints/map_dm6.qc + +To progs.src, immediately after defs.qc + +To remove these waypoints: + +Delete the code in bot_map_load, located below. +*/ + +void() bot_map_load = +{ + // place your qc loaded waypoints here + + if(mapname == "dm1") + map_dm1(); + else if(mapname == "dm2") + map_dm2(); + else if(mapname == "dm3") + map_dm3(); + else if(mapname == "dm4") + map_dm4(); + else if(mapname == "dm5") + map_dm5(); + else if(mapname == "dm6") + map_dm6(); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Variables and shtuff + +bot.qc has become pretty much a header file +for all variables in the bot... + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +// ----- entity fields --- +.float wallhug, keys, oldkeys; +.float b_frags, b_clientno, b_shirt, b_pants; +.float priority, ai_time, b_sound, missile_speed; +.float portal_time, b_skill, switch_wallhug; +.float b_aiflags, b_num, b_chattime; +.float b_menu, b_menu_time, b_menu_value; +.float route_failed, dyn_flags, dyn_time; +.float dyn_plat; +.entity temp_way, last_way, phys_obj; +.entity target1, target2, target3, target4; +.entity _next, _last; +.entity current_way; +.vector b_angle, b_dest, mouse_emu, obs_dir; +.vector movevect, b_dir; +.vector dyn_dest; + +// --------defines----- +float SVC_UPDATENAME = 13; +float SVC_UPDATEFRAGS = 14; +float SVC_UPDATECOLORS = 17; + +// used for the physics & movement AI +float KEY_MOVEUP = 1; +float KEY_MOVEDOWN = 2; +float KEY_MOVELEFT = 4; +float KEY_MOVERIGHT = 8; +float KEY_MOVEFORWARD = 16; +float KEY_MOVEBACK = 32; +float KEY_LOOKUP = 64; +float KEY_LOOKDOWN = 128; +float KEY_LOOKLEFT = 256; +float KEY_LOOKRIGHT = 512; + +// these are aiflags for waypoints +// some overlap to the bot +float AI_TELELINK_1 = 1; // link type +float AI_TELELINK_2 = 2; // link type +float AI_TELELINK_3 = 4; // link type +float AI_TELELINK_4 = 8; // link type +float AI_DOORFLAG = 16; // read ahead +float AI_PRECISION = 32; // read ahead + point +float AI_SURFACE = 64; // point +float AI_BLIND = 128; // read ahead + point +float AI_JUMP = 256; // point + ignore +float AI_DIRECTIONAL = 512; // read ahead + ignore +float AI_PLAT_BOTTOM = 1024; // read ahead +float AI_RIDE_TRAIN = 2048; // read ahead +float AI_SUPER_JUMP = 4096; // point + ignore + route test +float AI_SNIPER = 8192; // point type +float AI_AMBUSH = 16384; // point type +float AI_DOOR_NO_OPEN = 32768; // read ahead +float AI_DIFFICULT = 65536; // route test +float AI_TRACE_TEST = 131072; // route test + +// these are flags for bots/players (dynamic/editor flags) +float AI_OBSTRUCTED = 1; +float AI_HOLD_SELECT = 2; +float AI_ROUTE_FAILED = 2; +float AI_WAIT = 4; +float AI_DANGER = 8; + + +// addition masks +float AI_POINT_TYPES = 29152; +float AI_READAHEAD_TYPES = 36528; +float AI_IGNORE_TYPES = 4864; + +float WM_UNINIT = 0; +float WM_DYNAMIC = 1; +float WM_LOADING = 2; +float WM_LOADED = 3; +float WM_EDITOR = 4; +float WM_EDITOR_DYNAMIC = 5; +float WM_EDITOR_DYNLINK = 6; + + +float OPT_SAVEBOTS = 1; +float OPT_NOCHAT = 2; + +// -------globals----- +float active_clients; +float max_clients, real_frametime; +float bot_count, b_options; +float waypoint_mode, dump_mode; +float waypoints, direct_route; +float sv_friction, sv_gravity; +float sv_accelerate, sv_maxspeed, sv_stopspeed; +entity fixer; +entity route_table; +entity b_temp1, b_temp2, b_temp3; +entity player_head, phys_head, way_head; +float busy_waypoints; +float saved_bots, saved_skills1, saved_skills2, current_bots; + +// -------ProtoTypes------ +// external +void() ClientConnect; +void() ClientDisconnect; +void() SetNewParms; + +// rankings +float(float clientno) ClientBitFlag; +float() ClientNextAvailable; +void(float whichteam, float whatbot, float whatskill) BotConnect; +void(entity bot) BotDisconnect; +void(float clientno) BotInvalidClientNo; +void(entity who) UpdateClient; + +// waypointing +void() DynamicWaypoint; +entity(vector org) make_waypoint; +void() ClearAllWays; +void() FixWaypoints; +float() begin_route; +void(entity this, float direct) bot_get_path; +void() WaypointThink; +entity(entity start) FindWayPoint; + +// physics & movement +float(entity e) bot_can_rj; +void() bot_jump; +void() frik_bot_roam; +float(vector weird) frik_walkmove; +void() frik_movetogoal; +void() frik_obstacles; +float(float flag) frik_recognize_plat; +float(vector sdir) frik_KeysForDir; +void(vector whichway, float danger) frik_obstructed; +void() SV_Physics_Client; +void() SV_ClientThink; +void() CL_KeyMove; + +// ai & misc +string() PickARandomName; +float(entity targ) fov; +float(float y1, float y2) angcomp; +float(entity targ1, entity targ2) wisible; +float(entity targ) sisible; +float(entity targ) fisible; +vector(entity ent) realorigin; +void(entity ent) target_drop; +void(entity ent) target_add; +void() KickABot; +void() BotImpulses; +void(entity targ, float success) bot_lost; +string(float r) BotName; +float(float v) frik_anglemod; +void() bot_chat; +void(float tpic) bot_start_topic; + + +// editor stuffs + +void() bot_way_edit; +void() bot_menu_display; + + +// ----------Commands--------- +void(entity e, float chan, string samp, float vol, float atten) frik_sound = #8; +void(entity client, string s) frik_stuffcmd = #21; +void(entity client, string s) frik_sprint = #24; +vector(entity e, float sped) frik_aim = #44; +void(entity client, string s) frik_centerprint = #73; +void(entity e) frik_setspawnparms = #78; +void(float to, float f) frik_WriteByte = #52; +void(float to, float f) frik_WriteChar = #53; +void(float to, float f) frik_WriteShort = #54; +void(float to, float f) frik_WriteLong = #55; +void(float to, float f) frik_WriteCoord = #56; +void(float to, float f) frik_WriteAngle = #57; +void(float to, string s) frik_WriteString = #58; +void(float to, entity s) frik_WriteEntity = #59; + +void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) +frik_big_centerprint = #73; + +//---------------------------------------------------------------------------- + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Function redclarations. These allow function +designed to work for clients (sprint, so forth) +to mainly not complain when working with a bot + +Although these shouldn't be needed anymore, +as the bots truly are clients now, if you don't +stop the SZ_ buffer from filling up by disabling +direct messages to the bots, it crashes quake :-( + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(entity client, string s) stuffcmd = +{ + if(client.ishuman == 1) + frik_stuffcmd(client, s); + b_temp1 = player_head; + + while(b_temp1) + { + if(b_temp1.classname == "botcam") + { + if((b_temp1.enemy == client) && b_temp1.ishuman) + frik_stuffcmd(b_temp1, s); + } + b_temp1 = b_temp1._next; + } +}; + +void(entity e) setspawnparms = +{ + if(e.ishuman == 1) + frik_setspawnparms(e); + else + { + b_temp1 = player_head; + while(b_temp1) + { + if(b_temp1.ishuman) + { + frik_setspawnparms(b_temp1); + return; + } + b_temp1 = b_temp1._next; + } + SetNewParms(); + } +}; +void(entity client, string s) sprint = +{ + if(client.ishuman == 1) + frik_sprint(client, s); + b_temp1 = player_head; + + while(b_temp1) + { + if(b_temp1.classname == "botcam") + { + if((b_temp1.enemy == client) && b_temp1.ishuman) + frik_sprint(b_temp1, s); + } + b_temp1 = b_temp1._next; + } + +}; +void(entity client, string s) centerprint = +{ + if(client.ishuman == 1) + frik_centerprint(client, s); + b_temp1 = player_head; + + while(b_temp1) + { + if(b_temp1.classname == "botcam") + { + if((b_temp1.enemy == client) && b_temp1.ishuman) + frik_centerprint(b_temp1, s); + } + b_temp1 = b_temp1._next; + } +}; + +vector(entity e, float sped) aim = +{ + e.missile_speed = sped; + return frik_aim(e, sped); +}; + +void(entity e, float chan, string samp, float vol, float atten) sound = +{ + + frik_sound(e, chan, samp, vol, atten); + if(samp == "items/inv3.wav") + return; + else if(e.classname == "player") + e.b_sound = time + 1; + else if(other.classname == "player") + other.b_sound = time + 1; + +}; +void(float to, float f) WriteByte = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteByte(to, f); +}; +void(float to, float f) WriteChar = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteChar(to, f); +}; +void(float to, float f) WriteShort = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteShort(to, f); +}; +void(float to, float f) WriteLong = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteLong(to, f); +}; +void(float to, float f) WriteCoord = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteCoord(to, f); +}; +void(float to, float f) WriteAngle = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteAngle(to, f); +}; +void(float to, string s) WriteString = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteString(to, s); +}; +void(float to, entity s) WriteEntity = +{ + if((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteEntity(to, s); +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Cam, see what the bot sees (or any other player) + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float() botcam = +{ + if(self.classname != "botcam") + return FALSE; + setorigin(self, self.enemy.origin); + self.items = self.enemy.items; + self.weapon = self.enemy.weapon; + self.weaponmodel = self.enemy.weaponmodel; + self.currentammo = self.enemy.currentammo; + self.weaponframe = self.enemy.weaponframe; + self.ammo_shells = self.enemy.ammo_shells; + self.ammo_nails = self.enemy.ammo_nails; + self.ammo_rockets= self.enemy.ammo_rockets; + self.ammo_cells = self.enemy.ammo_cells; + self.view_ofs = self.enemy.view_ofs; + self.health = self.enemy.health; + self.armorvalue = self.enemy.armorvalue; + self.dmg_take = self.enemy.dmg_take; + self.dmg_save = self.enemy.dmg_save; + self.dmg_inflictor = self.enemy.dmg_inflictor; + self.punchangle = self.enemy.punchangle; + self.deadflag = self.enemy.deadflag; + msg_entity = self; + WriteByte(MSG_ONE,5); + WriteEntity (MSG_ONE, self.enemy); + WriteByte(MSG_ONE, 10); + WriteAngle (MSG_ONE,self.enemy.v_angle_x); + WriteAngle (MSG_ONE,self.enemy.v_angle_y); + WriteAngle (MSG_ONE,self.enemy.v_angle_z); + self.modelindex = 0; + + self.impulse = 0; + return TRUE; +}; + +void() botcam_u = +{ + // sloppy cycling code + if(self.classname != "botcam") + { + self.enemy = player_head; + } + else + { + do + self.enemy = self.enemy._next; + while (self.enemy.classname == "botcam"); + } + if(self.enemy == self) + { + do + self.enemy = self.enemy._next; + while (self.enemy.classname == "botcam"); + } + self.classname = "botcam"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + + if(!self.enemy) + { + sprint(self, "No one left to track!\n"); + msg_entity = self; + WriteByte(MSG_ONE,5); + WriteEntity (MSG_ONE, self); + PutClientInServer(); + return; + } + if(!self.enemy.ishuman) + { + self.enemy.dmg_take = 0; + self.enemy.dmg_save = 0; + } + sprint(self, "Now tracking "); + sprint(self, self.enemy.netname); + sprint(self, "\n"); +}; + + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Stuff mentioned up top +it just links the bot into the mod + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClientFixRankings = +{ + float cno; + + if(self.switch_wallhug > time) + return; + self.switch_wallhug = 0; + + b_temp2 = nextent(world); + cno = 0; + + while (cno < max_clients) + { + if((!b_temp2.ishuman) && (active_clients & ClientBitFlag(cno))) + UpdateClient(b_temp2); + cno = cno + 1; + b_temp2 = nextent(b_temp2); + } +}; + +void() ClientInRankings = +{ + float cno; + + cno = self.colormap - 1; + BotInvalidClientNo (cno); + + if(player_head) + player_head._last = self; + + self._next = player_head; + self._last = world; + player_head = self; + + if(!self.phys_obj) + { + b_temp2 = phys_head; + while (b_temp2 != world && b_temp2.owner != self) + b_temp2 = b_temp2._next; + self.phys_obj = b_temp2; + } + + if(self.ishuman == 2) + { + self.ishuman = FALSE; + return; + } + active_clients = active_clients | ClientBitFlag(cno); + + self.b_clientno = cno; + self.ishuman = TRUE; + self.switch_wallhug = time + 1; +}; + + +void() ClientDisconnected = +{ + if(player_head == self) + player_head = self._next; + if(self._next) + self._next._last = self._last; + if(self._last) + self._last._next = self._next; + + active_clients = active_clients - active_clients & ClientBitFlag(self.b_clientno); +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotPreFrame & BotPostFrame, used to make the +bot easier to install + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float() BotPreFrame = +{ + if(self.b_clientno == -1) + return TRUE; + if(self.ishuman) + { + if(self.switch_wallhug) + ClientFixRankings(); + if(self.classname == "botcam") + return TRUE; + + } + if(self.b_frags != self.frags) + { + + if(self.b_frags > self.frags) + { + if(pointcontents(self.origin) == CONTENT_LAVA) + bot_start_topic(10); + else + bot_start_topic(9); + } + else + bot_start_topic(2); + self.b_frags = self.frags; + } + DynamicWaypoint(); + return FALSE; +}; + +float() BotPostFrame = +{ + if(self.b_clientno == -1) + return TRUE; + + if(self.ishuman) + { + if(waypoint_mode > WM_LOADED) + bot_menu_display(); + + BotImpulses(); + + if(botcam()) + return TRUE; + } + + bot_setvrfields(); + return FALSE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Chat code + +The rest of this code is in bot_misc.qc + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(string h) BotSay = // simulate talking by composing a 'chat' message +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, self.netname); + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 2); + WriteString(MSG_ALL, h); +}; +void() BotSayInit = +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, self.netname); +}; +void(string h) BotSay2 = +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 2); + WriteString(MSG_ALL, h); +}; +void(string h) BotSayTeam = +{ + entity t; + if(!teamplay) + return; + t = player_head; + while(t) + { + if(t.team == self.team) + { + msg_entity = t; + WriteByte(MSG_ONE, 8); + WriteByte(MSG_ONE, 1); + WriteByte(MSG_ONE, 40); + WriteString(MSG_ONE, self.netname); + WriteByte(MSG_ONE, 8); + WriteByte(MSG_ONE, 2); + WriteByte(MSG_ONE, 41); + WriteString(MSG_ONE, h); + } + t = t._next; + } +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotInit + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void() BotInit = +{ + // spawn entities for the physics + entity ent = nextent(world); + max_clients = 0; + + while(ent != world) + { + max_clients = max_clients + 1; + ent = nextent(ent); + } + + if(max_clients > 16) + { + max_clients = 16; + } + + ent = nextent(world); + entity fisent = world; + + float numents = 0; + while (numents < max_clients) + { + phys_head = spawn(); + + if(fisent) + { + fisent._next = phys_head; + } + + phys_head._last = fisent; + fisent = phys_head; + ent.phys_obj = phys_head; + + phys_head.classname = "phys_obj"; + phys_head.owner = ent; + + numents = numents + 1; + ent = nextent(ent); + } + + precache_model("progs/s_light.spr"); + precache_model("progs/s_bubble.spr"); + + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Rankings 'utilities'. Written by Alan Kivlin, +this code just fools clients by sending precisely +the same network messages as when a real player +signs on to the server. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void(entity who) UpdateClient = +{ + WriteByte(MSG_ALL, SVC_UPDATENAME); + WriteByte(MSG_ALL, who.b_clientno); + WriteString (MSG_ALL, who.netname); + WriteByte(MSG_ALL, SVC_UPDATECOLORS); + WriteByte(MSG_ALL, who.b_clientno); + WriteByte(MSG_ALL, who.b_shirt * 16 + who.b_pants); + WriteByte(MSG_ALL, SVC_UPDATEFRAGS); + WriteByte(MSG_ALL, who.b_clientno); + WriteShort (MSG_ALL, who.frags); +}; + +float(float clientno) ClientBitFlag = +{ + // bigger, but faster + if(clientno == 0) + return 1; + else if(clientno == 1) + return 2; + else if(clientno == 2) + return 4; + else if(clientno == 3) + return 8; + else if(clientno == 4) + return 16; + else if(clientno == 5) + return 32; + else if(clientno == 6) + return 64; + else if(clientno == 7) + return 128; + else if(clientno == 8) + return 256; + else if(clientno == 9) + return 512; + else if(clientno == 10) + return 1024; + else if(clientno == 11) + return 2048; + else if(clientno == 12) + return 4096; + else if(clientno == 13) + return 8192; + else if(clientno == 14) + return 16384; + else if(clientno == 15) + return 32768; + return 0; +}; + +float() ClientNextAvailable = +{ + float clientno; + + clientno = max_clients; + while(clientno > 0) + { + clientno = clientno - 1; + + if(!(active_clients & ClientBitFlag(clientno))) + return clientno; + } + + return -1; +}; + + +void(entity e1, entity e2, float flag) DeveloperLightning = +{ + // used to show waypoint links for debugging + WriteByte(MSG_BROADCAST, 23); + if(flag) + WriteByte(MSG_BROADCAST, 6); + else + WriteByte(MSG_BROADCAST, 13); + WriteEntity(MSG_BROADCAST, e2); + WriteVec3(MSG_BROADCAST, e1.origin); + WriteVec3(MSG_BROADCAST, e2.origin); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Find Another Color + +Team finding code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float(float tcolor) FindAnotherColor = +{ + float bestbet, pcount, bestp; + float scolor = 0; + bestbet = -1; + bestp = 16; + while(scolor < 14) + { + if(scolor != tcolor) + { + b_temp2 = player_head; + pcount = 0; + while(b_temp2 != world) + { + if(b_temp2.team == scolor + 1) + pcount = pcount + 1; + b_temp2 = b_temp2._next; + } + if((pcount < bestp) && pcount) + { + bestbet = scolor; + bestp = pcount; + } + } + scolor = scolor + 1; + } + if(bestbet < 0) + { + bestbet = tcolor; + while (bestbet == tcolor) + { + bestbet = floor(random() * 13); + } + } + return bestbet; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotConnect and related functions. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +entity(float num) GetClientEntity = +{ + entity upsy; + upsy = world; + num = num + 1; + while (num > 0) + { + num = num - 1; + upsy = nextent(upsy); + } + return upsy; +}; + +void(float whichteam, float whatbot, float whatskill) BotConnect = +{ + float f; + string h; + entity uself; + + f = ClientNextAvailable(); + uself = self; + if(f == -1) + { + bprint("Unable to connect a bot, server is full.\n"); + return; + } + + // chat thing + + bot_count = bot_count + 1; + self = GetClientEntity(f); + if(!saved_bots) + bot_start_topic(1); + self.b_clientno = f; + self.colormap = f + 1; + if(whatbot) + self.netname = BotName(whatbot); + else + self.netname = PickARandomName(); + // players can set skill all weird, so leave these checks in + whatskill = rint(whatskill); + if(whatskill > 3) + whatskill = 3; + else if(whatskill < 0) + whatskill = 0; + self.b_skill = whatskill; + + if(teamplay && !coop) + { + if(whichteam) + self.b_pants = FindAnotherColor(uself.team - 1); + else + self.b_pants = uself.team - 1; + self.b_shirt = self.b_pants; + } + + self.team = self.b_pants + 1; + UpdateClient(self); + SetNewParms(); + self.ishuman = 2; + ClientConnect(); + PutClientInServer(); + + active_clients = active_clients | ClientBitFlag(f); + + // this is risky... could corrupt .way files if done wrong + // If you're not the gambling type, comment this out + + f = ClientBitFlag(self.b_num - 1); + current_bots = current_bots | f; + + if(self.b_num <= 8) + saved_skills1 = (saved_skills1 & (65536 - (3 * f)) | (self.b_skill * f)); + else + { + f = ClientBitFlag(self.b_num - 9); + saved_skills2 = (saved_skills2 & (65536 - (3 * f)) | (self.b_skill * f)); + } + + h = ftos(current_bots); + cvar_set("scratch1", h); + h = ftos(saved_skills1); + cvar_set("scratch2", h); + h = ftos(saved_skills2); + cvar_set("scratch3", h); + self = uself; + +}; + +void(entity bot) BotDisconnect = +{ + string h; + entity uself; + uself = self; + self = bot; + + bot_count = bot_count - 1; + current_bots = current_bots - (current_bots & ClientBitFlag(self.b_num - 1)); + h = ftos(current_bots); + cvar_set("scratch1", h); + + + ClientDisconnect(); + + if(self.b_clientno != -1) + { + // the bot's client number is not in use by a real player so we + // must remove it's entry in the rankings + // Quake engine sets all fields to 0, can only do the most important here + self.b_frags = self.frags = 0; + self.netname = ""; + self.classname = ""; + self.health = 0; + VR_ItemUtil_EntClearItems(self); + self.armorvalue = 0; + self.weaponmodel = ""; + self.b_pants = 0; + self.b_shirt = 0; + self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = 0; + UpdateClient(self); + active_clients = active_clients - (active_clients & ClientBitFlag(self.b_clientno)); + self.b_clientno = -1; + } + self = uself; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotInvalidClientNo +kicks a bot if a player connects and takes the bot's space + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(float clientno) BotInvalidClientNo = +{ + entity bot; + + bot = GetClientEntity(clientno); + if(bot.b_clientno > 0) + { + if(active_clients & ClientBitFlag(self.b_clientno)) + { + bot.b_clientno = -1; + BotDisconnect(bot); + active_clients = active_clients | ClientBitFlag(self.b_clientno); + BotConnect(0, bot.b_num, bot.b_skill); + return; + } + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Loading from file + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void() LoadWaypoint = +{ + vector org; + entity tep; + float r; + org_x = cvar_hget(cvarh_saved1); + org_y = cvar_hget(cvarh_saved2); + org_z = cvar_hget(cvarh_saved3); + + tep = make_waypoint(org); + + r = cvar_hget(cvarh_saved4); + + tep.b_aiflags = floor(r / 4); + tep.b_pants = cvar_hget(cvarh_scratch1); + tep.b_skill = cvar_hget(cvarh_scratch2); + tep.b_shirt = cvar_hget(cvarh_scratch3); + tep.b_frags = cvar_hget(cvarh_scratch4); +}; + +void() bot_return = +{ + if(time > 2) + { + if((waypoint_mode == WM_DYNAMIC) || (waypoint_mode == WM_LOADED)) + { + // minor precaution + + if(saved_bots & 1) BotConnect(0, 1, saved_skills1 & 3); + if(saved_bots & 2) BotConnect(0, 2, (saved_skills1 & 12) / 4); + if(saved_bots & 4) BotConnect(0, 3, (saved_skills1 & 48) / 16); + if(saved_bots & 8) BotConnect(0, 4, (saved_skills1 & 192) / 64); + if(saved_bots & 16) BotConnect(0, 5, (saved_skills1 & 768) / 256); + if(saved_bots & 32) BotConnect(0, 6, (saved_skills1 & 3072) / 1024); + if(saved_bots & 64) BotConnect(0, 7, (saved_skills1 & 12288) / 4096); + if(saved_bots & 128) BotConnect(0, 8, (saved_skills1 & 49152) / 16384); + if(saved_bots & 256) BotConnect(0, 9, saved_skills2 & 3); + if(saved_bots & 512) BotConnect(0, 10, (saved_skills2 & 12) / 4); + if(saved_bots & 1024) BotConnect(0, 11, (saved_skills2& 48) / 16); + if(saved_bots & 2048) BotConnect(0, 12, (saved_skills2 & 192) / 64); + if(saved_bots & 4096) BotConnect(0, 13, (saved_skills2 & 768) / 256); + if(saved_bots & 8192) BotConnect(0, 14, (saved_skills2 & 3072) / 1024); + if(saved_bots & 16384) BotConnect(0, 15, (saved_skills2 & 12288) / 4096); + if(saved_bots & 32768) BotConnect(0, 16, (saved_skills2 & 49152) / 16384); + saved_bots = 0; + } + } +}; + + +void() WaypointWatch = +{ + // Waypoint Baywatch + float bigboobs; + string h; + if(framecount < 4) + return; + if(max_clients < 2) + return; + if(waypoint_mode != WM_UNINIT) + { + bigboobs = cvar_hget(cvarh_saved4); + if(bigboobs != 0) + { + if((bigboobs & 3) == 1) + ClearAllWays(); + else if((bigboobs & 3) == 3) + { + FixWaypoints(); + h = ftos(b_options); + cvar_set("saved1", h); + cvar_set("saved4", "0"); + cvar_set("scratch1", "0"); + waypoint_mode = WM_LOADED; + return; + } + LoadWaypoint(); + waypoint_mode = WM_LOADING; + cvar_set("saved4", "0"); + } + } + else + { + // the bots return! + b_options = cvar_hget(cvarh_saved1); + if(coop || (b_options & OPT_SAVEBOTS)) + { + saved_bots = cvar_hget(cvarh_scratch1); + saved_skills1 = cvar_hget(cvarh_scratch2); + saved_skills2 = cvar_hget(cvarh_scratch3); + } + cvar_set("saved4", "0"); + if(max_clients > 1) + { + localcmd("exec maps/"); + localcmd(mapname); + localcmd(".way\n"); + waypoint_mode = WM_DYNAMIC; + bot_map_load(); + } + else + waypoint_mode = WM_LOADED; + } +}; +void() BotFrame = +{ + float num; + + // for the sake of speed + sv_maxspeed = cvar_hget(cvarh_sv_maxspeed); + sv_gravity = cvar_hget(cvarh_sv_gravity); + sv_friction = cvar_hget(cvarh_sv_friction); + sv_accelerate = cvar_hget(cvarh_sv_accelerate); + sv_stopspeed = cvar_hget(cvarh_sv_stopspeed); + real_frametime = frametime; // in NQ this is alright + + self = nextent(world); + num = 0; + while (num < max_clients) + { + if(self.ishuman == FALSE) + { + if(active_clients & ClientBitFlag(num)) + { + frik_obstacles(); + CL_KeyMove(); + + bot_setvrfields(); + + SV_ClientThink(); + SV_Physics_Client(); + } + } + self = nextent(self); + num = num + 1; + } + WaypointWatch(); + + if(saved_bots) + bot_return(); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Impulses. Allows the player to perform bot +related functions. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() BotImpulses = +{ + float f; + + if(self.impulse == 100) + { + f = cvar_hget(cvarh_skill); + BotConnect(0, 0, f); + } + else if(self.impulse == 101) + { + f = cvar_hget(cvarh_skill); + BotConnect(1, 0, f); + } + else if(self.impulse == 102) + KickABot(); + else if(self.impulse == 103) + botcam_u(); + else if(self.impulse == 104) + bot_way_edit(); + else + return; + + self.impulse = 0; +}; + + + diff --git a/QC/frikbot/bot_ai.qc b/QC/frikbot/bot_ai.qc new file mode 100644 index 00000000..b9292d39 --- /dev/null +++ b/QC/frikbot/bot_ai.qc @@ -0,0 +1,1169 @@ +/*********************************************** +* * +* FrikBot General AI * +* "The I'd rather be playing Quake AI" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +target_onstack + +checks to see if an entity is on the bot's stack + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float(entity scot) target_onstack = +{ + if(scot == world) + { + return FALSE; + } + + if(self.target1 == scot) + { + return 1; + } + + if(self.target2 == scot) + { + return 2; + } + + if(self.target3 == scot) + { + return 3; + } + + if(self.target4 == scot) + { + return 4; + } + + return FALSE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +target_add + +adds a new entity to the stack, since it's a +LIFO stack, this will be the bot's new target1 + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity ent) target_add = +{ + if(ent == world) + { + return; + } + + if(target_onstack(ent)) + { + return; + } + + self.target4 = self.target3; + self.target3 = self.target2; + self.target2 = self.target1; + self.target1 = ent; + self.search_time = time + 5; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +target_drop + +Removes an entity from the bot's target stack. +The stack will empty everything up to the object +So if you have target2 item_health, target1 +waypoint, and you drop the health, the waypoint +is gone too. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity ent) target_drop = +{ + float tg; + + tg = target_onstack(ent); + + if(tg == 1) + { + self.target1 = self.target2; + self.target2 = self.target3; + self.target3 = self.target4; + self.target4 = world; + } + else if(tg == 2) + { + self.target1 = self.target3; + self.target2 = self.target4; + self.target3 = self.target4 = world; + } + else if(tg == 3) + { + self.target1 = self.target4; + self.target2 = self.target3 = self.target4 = world; + } + else if(tg == 4) + { + self.target1 = self.target2 = self.target3 = self.target4 = world; + } + else + { + bprint("Invalid target tg '"); + bprint(ftos(tg)); + bprint("'\n"); + } + + self.search_time = time + 5; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_lost + +Bot has lost its target. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity targ, float success) bot_lost = +{ + if(!targ) + return; + + target_drop(targ); + if(targ.classname == "waypoint") + targ.b_sound = targ.b_sound - (targ.b_sound & ClientBitFlag(self.b_clientno)); + + // find a new route + if(!success) + { + self.target1 = self.target2 = self.target3 = self.target4 = world; + self.last_way = FindWayPoint(self.current_way); + ClearMyRoute(); + self.b_aiflags = 0; + } + else + { + if(targ.classname == "item_artifact_invisibility") + { + if(self.items & 524288) + { + bot_start_topic(3); + } + } + + if(targ.flags & FL_ITEM) + { + if(targ.model == string_null) + targ._last = world; + else + targ._last = self; + } + } + + + if(targ.classname != "player") + targ.search_time = time + 5; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_check_lost + +decide if my most immediate target should be +removed. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(entity targ) bot_check_lost = +{ + if(targ == world) + return; + + vector dist = realorigin(targ) - self.origin; + dist_z = 0; + + // waypoints and items are lost if you get close enough to them + + if(targ.flags & FL_ITEM) + { + if(vlen(targ.origin - self.origin) < 32) + bot_lost(targ, TRUE); + else if(targ.model == string_null) + bot_lost(targ, TRUE); + } + else if(targ.classname == "waypoint") + { + if(!(self.b_aiflags & (AI_SNIPER | AI_AMBUSH))) + { + if(self.b_aiflags & AI_RIDE_TRAIN) + { + if(vlen(targ.origin - self.origin) < 48) + bot_lost(targ, TRUE); + } + else if(self.b_aiflags & AI_PRECISION) + { + if(vlen(targ.origin - self.origin) < 24) + bot_lost(targ, TRUE); + } + else if(vlen(targ.origin - self.origin) < 32) + bot_lost(targ, TRUE); + } + } + else if(targ.classname == "temp_waypoint") + { + if(vlen(targ.origin - self.origin) < 32) + bot_lost(targ, TRUE); + } + else if(targ.classname == "player") + { + if(targ.health <= 0) + bot_lost(targ, TRUE); + else if((coop) || (teamplay && targ.team == self.team)) + { + if(targ.target1.classname == "player") + { + if(!targ.target1.ishuman) + bot_lost(targ, TRUE); + } + else if(targ.teleport_time > time) + { + // try not to telefrag teammates + self.keys = self.keys & 960; + } + else if(vlen(targ.origin - self.origin) < 128) + { + if(vlen(targ.origin - self.origin) < 48) + frik_walkmove(self.origin - targ.origin); + else + { + self.keys = self.keys & 960; + bot_start_topic(4); + } + self.search_time = time + 5; // never time out + } + else if(!fisible(targ)) + bot_lost(targ, FALSE); + } + else if(waypoint_mode > WM_LOADED) + { + if(vlen(targ.origin - self.origin) < 128) + { + bot_lost(targ, TRUE); + } + } + } + + // buttons are lost of their frame changes + else if(targ.classname == "func_button") + { + if(targ.frame) + { + bot_lost(targ, TRUE); + if(self.enemy == targ) + self.enemy = world; + //if(self.target1) + // bot_get_path(self.target1, TRUE); + + } + } + // trigger_multiple style triggers are lost if their thinktime changes + else if((targ.movetype == MOVETYPE_NONE) && (targ.solid == SOLID_TRIGGER)) + { + if(targ.nextthink >= time) + { + bot_lost(targ, TRUE); + //if(self.target1) + // bot_get_path(self.target1, TRUE); + } + } + // lose any target way above the bot's head + // FIXME: if the bot can fly in your mod.. + if((targ.origin_z - self.origin_z) > 64) + { + dist = targ.origin - self.origin; + dist_z = 0; + if(vlen(dist) < 32) + if(self.flags & FL_ONGROUND) + if(!frik_recognize_plat(FALSE)) + bot_lost(targ, FALSE); + } + else if(targ.classname == "train") + { + if(frik_recognize_plat(FALSE)) + bot_lost(targ, TRUE); + } + // targets are lost if the bot's search time has expired + if(time > self.search_time) + bot_lost(targ, FALSE); +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_handle_ai + +This is a 0.10 addition. Handles any action +based b_aiflags. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_handle_ai = +{ + entity newt; + vector v; + + // handle ai flags -- note, not all aiflags are handled + // here, just those that perform some sort of action + + // wait is used by the ai to stop the bot until his search time expires / or route changes + + if(self.b_aiflags & AI_WAIT) + self.keys = self.keys & 960; + + if(self.b_aiflags & AI_DOORFLAG) // was on a door when spawned + { + b_temp3 = self; + self = self.last_way; + if(!frik_recognize_plat(FALSE)) // if there is nothing there now + { + newt = FindThing("door"); // this is likely the door responsible (crossfingers) + self = b_temp3; + + if(self.b_aiflags & AI_DOOR_NO_OPEN) + { + if(newt.nextthink) + self.keys = self.keys & 960; // wait until it closes + else + { + bot_lost(self.last_way, FALSE); + } + } + else + { + if(newt.targetname != NULLSTR) + { + newt = find(world, target, newt.targetname); + if(newt.health > 0) + { + self.enemy = newt; + bot_weapon_switch(1); + } + else + { + // target_drop(self.last_way); + target_add(newt); + // bot_get_path(newt, TRUE); + } + } + self.b_aiflags = self.b_aiflags - AI_DOORFLAG; + } + } + else + self = b_temp3; + } + + if(self.b_aiflags & AI_JUMP) + { + if(self.flags & FL_ONGROUND) + { + bot_jump(); + self.b_aiflags = self.b_aiflags - AI_JUMP; + } + } + else if(self.b_aiflags & AI_SUPER_JUMP) + { + if(self.weapon != WID_ROCKET_LAUNCHER) + self.impulse = 7; + + else if(self.flags & FL_ONGROUND) + { + self.b_aiflags = self.b_aiflags - AI_SUPER_JUMP; + if(bot_can_rj(self)) + { + bot_jump(); + self.v_angle_x = self.b_angle_x = 80; + self.button0 = TRUE; + } + else + bot_lost(self.target1, FALSE); + + } + } + if(self.b_aiflags & AI_SURFACE) + { + if(self.waterlevel > 2) + { + self.keys = KEY_MOVEUP; + self.button2 = TRUE; // swim! + } + else + self.b_aiflags = self.b_aiflags - AI_SURFACE; + } + if(self.b_aiflags & AI_RIDE_TRAIN) + { + // simple, but effective + // this can probably be used for a lot of different + // things, not just trains (door elevators come to mind) + b_temp3 = self; + self = self.last_way; + + if(!frik_recognize_plat(FALSE)) // if there is nothing there now + { + self = b_temp3; + self.keys = self.keys & 960; + } + else + { + self = b_temp3; + if(frik_recognize_plat(FALSE)) + { + v = realorigin(trace_ent) + trace_ent.origin - self.origin; + v_z = 0; + if(vlen(v) < 24) + self.keys = self.keys & 960; + else + { + self.b_aiflags = self.b_aiflags | AI_PRECISION; + self.keys = frik_KeysForDir(v); + } + } + } + } + if(self.b_aiflags & AI_PLAT_BOTTOM) + { + newt = FindThing("plat"); + if(newt.state != 1) + { + v = self.origin - realorigin(newt); + v_z = 0; + if(vlen(v) > 96) + self.keys = self.keys & 960; + else + frik_walkmove(v); + } + else + self.b_aiflags = self.b_aiflags - AI_PLAT_BOTTOM; + } + if(self.b_aiflags & AI_DIRECTIONAL) + { + if((normalize(self.last_way.origin - self.origin) * self.b_dir) > 0.4) + { + self.b_aiflags = self.b_aiflags - AI_DIRECTIONAL; + bot_lost(self.target1, TRUE); + } + } + if(self.b_aiflags & AI_SNIPER) + { + self.b_aiflags = (self.b_aiflags | AI_WAIT | AI_PRECISION) - AI_SNIPER; + // FIXME: Add a switch to wep command + // FIXME: increase delay? + } + if(self.b_aiflags & AI_AMBUSH) + { + self.b_aiflags = (self.b_aiflags | AI_WAIT) - AI_AMBUSH; + // FIXME: Add a switch to wep command + // FIXME: increase delay? + } + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_path + +Bot will follow a route generated by the +begin_route set of functions in bot_way.qc. +This code, while it works pretty well, can get +confused + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_path = +{ + entity jj, tele; + + bot_check_lost(self.target1); + + if(!self.target1) + { + self.keys = 0; + return; + } + + if(target_onstack(self.last_way)) + { + return; // old waypoint still being hunted + } + + jj = FindRoute(self.last_way); + if(!jj) + { + // this is an ugly hack + if(self.target1.current_way != self.last_way) + { + if(self.target1.classname != "temp_waypoint") + if(self.target1.classname != "player") + bot_lost(self.target1, FALSE); + } + + return; + } + + // update the bot's special ai features + + // Readahed types are AI conditions to perform while heading to a waypoint + // point types are AI flags that should be executed once reaching a waypoint + + self.b_aiflags = (jj.b_aiflags & AI_READAHEAD_TYPES) | (self.last_way.b_aiflags & AI_POINT_TYPES); + target_add(jj); + if(self.last_way) + { + if(CheckLinked(self.last_way, jj) == 2) // waypoints are telelinked + { + tele = FindThing("trigger_teleport"); // this is probbly the teleport responsible + target_add(tele); + } + + traceline(self.last_way.origin, jj.origin, FALSE, self); // check for blockage + + if(trace_fraction != 1) + { + if(trace_ent.classname == "door" && !(self.b_aiflags & AI_DOOR_NO_OPEN)) // a door blocks the way + { + // linked doors fix + if(trace_ent.owner) + trace_ent = trace_ent.owner; + if((trace_ent.health > 0) && (self.enemy == world)) + { + self.enemy = trace_ent; + bot_weapon_switch(1); + self.b_aiflags = self.b_aiflags | AI_BLIND; // nick knack paddy hack + } + else if(trace_ent.targetname != NULLSTR) + { + tele = find(world, target, trace_ent.targetname); + if(tele.health > 0) + { + self.enemy = tele; + bot_weapon_switch(1); + } + else + { + // target_drop(jj); + target_add(tele); + // bot_get_path(tele, TRUE); + self.b_aiflags = self.b_aiflags | AI_BLIND; // give a bot a bone + return; + } + } + } + else if(trace_ent.classname == "func_wall") + { + // give up + bot_lost(self.target1, FALSE); + return; + } + } + } + // this is used for AI_DRIECTIONAL + self.b_dir = normalize(jj.origin - self.last_way.origin); + + self.last_way = jj; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Priority Look. What a stupid name. This is where +the bot finds things it wants to kill/grab. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +// priority scale +// 0 - 10 virtually ignore +// 10 - 30 normal item range +// 30 - 50 bot will consider this a target worth changing course for +// 50 - 90 bot will hunt these as vital items + +// *!* Make sure you add code to bot_check_lost to remove the target *!* + +float(float wid) get_weapon_priority = +{ + if(wid == WID_ROCKET_LAUNCHER) { return 60; } + if(wid == WID_LIGHTNING) { return 50; } + if(wid == WID_GRENADE_LAUNCHER) { return 45; } + if(wid == WID_SUPER_NAILGUN) { return 35; } + if(wid == WID_NAILGUN) { return 30; } + if(wid == WID_SUPER_SHOTGUN) { return 25; } + + return 5; +} + +float(entity thing) priority_for_thing = +{ + if(cvar_hget(cvarh_vr_verbosebots)) + { + bprint("priority_for_thing("); + bprint(thing.netname); + bprint(")\n"); + } + + float thisp, isThrownWeapon; + thisp = 0; + isThrownWeapon = 0; + // This is the most executed function in the bot. Careful what you do here. + + if( + ((thing.flags & FL_ITEM) || thing.classname == "thrown_weapon") && + (thing.model != string_null) && + (thing.search_time < time) + ) + { + // ugly hack + if(thing._last != self) + thisp = 20; + //~ ai fix start + + if(thing.classname == "thrown_weapon" && + !VR_WeaponUtil_EntHasWeapon(self, thing.weapon)) + { + thisp = get_weapon_priority(thing.weapon) + 1; + isThrownWeapon = 1; + } + else if(thing.classname == "item_artifact_super_damage") + { + thisp = 10*(random()) + 55; + } + else if(thing.classname == "item_artifact_invulnerability") + { + thisp = 10*(random()) + 55; + } + else if(thing.classname == "item_artifact_invisibility") + { + thisp = 10*(random()) + 55; + } + else if(thing.classname == "item_health") + { + if(thing.spawnflags & 2) + thisp = 10*(random()) + 50; + if(self.health <= 50) + thisp = 70; + } + else if(thing.classname == "weapon_rocketlauncher") + { + thisp = get_weapon_priority(WID_ROCKET_LAUNCHER); + } + else if(thing.classname == "weapon_lightning") + { + thisp = get_weapon_priority(WID_LIGHTNING); + } + else if(thing.classname == "weapon_grenadelauncher") + { + thisp = get_weapon_priority(WID_GRENADE_LAUNCHER); + } + else if(thing.classname == "weapon_supernailgun") + { + thisp = get_weapon_priority(WID_SUPER_NAILGUN); + } + else if(thing.classname == "weapon_nailgun") + { + thisp = get_weapon_priority(WID_NAILGUN); + } + else if(thing.classname == "weapon_supershotgun") + { + thisp = get_weapon_priority(WID_SUPER_SHOTGUN); + } + else if(thing.model == "progs/armor.mdl") + { + if(self.armorvalue < 200) + { + if(self.armorvalue <= 50) + thisp = 60; + else if(self.armorvalue <= 100 && thing.classname != ITEM_NAME_ARMOR1) + thisp = 55; + else if(self.armorvalue <= 150 && thing.classname == ITEM_NAME_ARMORINV) + thisp = 50; + } + } + else if(thing.model == "progs/backpack.mdl") + thisp = 45; + else if(thing.classname == "item_artifact_envirosuit") + thisp = 30; + } + //~ ai fix end + else if((thing.flags & FL_MONSTER) && thing.health > 0) + thisp = 45; + else if(thing.classname == "player") + { + if(thing.health > 0) + { + if(thing == self) + return 0; + else + { + if(VR_ItemUtil_EntHasItem(thing, IID_INVISIBILITY)) //FIXME + thisp = 2; + else if(coop) + { + thisp = 200; + if(thing.target1.classname == "player") + if(!thing.target1.ishuman) + return 0; + } + else if(teamplay && thing.team == self.team) + { + thisp = 100; + if(thing.target1.classname == "player") + return 0; + } + else thisp = 30; + } + } + } + else if(thing.classname == "waypoint") + { + if(thing.b_aiflags & AI_SNIPER) + thisp = 45; //~ ai fix + else if(thing.b_aiflags & AI_AMBUSH) + thisp = 30; + } + + if(!isThrownWeapon && + pointcontents(thing.origin) < -3) + { + return 0; + } + + if(thisp) + { + if(thing.current_way) + { + // check to see if it's unreachable + if(thing.current_way.items == -1) + return 0; + else + thisp = thisp + (13000 - thing.current_way.items) * 0.05; + } + else if(isThrownWeapon && + vlen(self.origin - thing.origin) < VR_ForcegrabUtil_GetForcegrabRange()) + { + sound(self, VRGetGunChannel(cVR_MainHand), "forcegrab.wav", 0.75, ATTN_NORM); + wpnthrow_handtouch_impl(cVR_MainHand, thing, self, &self.weapon, &self.weaponflags); + thisp = 0; + } + } + + return thisp; +}; + +void(float scope) bot_look_for_crap = +{ + float radius; + + if(scope == 1) + { + radius = 13000; + } + else + { + radius = 500; + } + + if(cvar_hget(cvarh_vr_verbosebots)) + { + bprint("bot_look_for_crap("); + bprint(ftos(scope)); + bprint(") [radius: "); + bprint(ftos(radius)); + bprint("]\n"); + } + + entity best = NULLENT; + entity foe = findradius(self.origin, radius); + + float bestp = 1; + while(foe) + { + float thatp = priority_for_thing(foe); + + if(cvar_hget(cvarh_vr_verbosebots)) + { + bprint(" -> "); + bprint(ftos(thatp)); + bprint("\n\n"); + } + + if(thatp && !scope) + { + if(!sisible(foe)) + { + thatp = 0; + } + } + + if(thatp > bestp) + { + bestp = thatp; + best = foe; + float dist = vlen(self.origin - foe.origin); + } + + foe = foe.chain; + } + + if(best == world) + { + if(cvar_hget(cvarh_vr_verbosebots)) + { + bprint("found nothing (best == world)\n"); + } + + return; + } + + if(!target_onstack(best)) + { + target_add(best); + + if(cvar_hget(cvarh_vr_verbosebots)) + { + bprint("added best:"); + bprint(best.netname); + bprint("\n"); + } + + if(scope) + { + bot_get_path(best, FALSE); + self.b_aiflags = self.b_aiflags | AI_WAIT; + } + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_angle_set + +Sets the bots look keys & b_angle to point at +the target - used for fighting and just +generally making the bot look good. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_angle_set = +{ + + if(self.enemy) + { + if(self.enemy.items & 524288) + { + if(random() > 0.01) + { + return; + } + } + + if(self.missile_speed == 0) + { + self.missile_speed = 10000; + } + + vector view; + if(self.enemy.solid == SOLID_BSP) + { + view = (((self.enemy.absmin + self.enemy.absmax) * 0.5) - self.origin); + } + else + { + float levels = 3; + + view = self.enemy.origin; + + while(levels) + { + float h = vlen(view - self.origin) / self.missile_speed; + if(self.enemy.flags & FL_ONGROUND) + view = self.enemy.velocity * h + '0 0 -20'; + else + view = (self.enemy.velocity - (sv_gravity * '0 0 1') * h) * h; + view = self.enemy.origin + view; + traceline(self.enemy.origin, view, FALSE, self); + view = trace_endpos; + levels = levels - 1; + } + + view = normalize(view - self.origin); + } + + view = vectoangles(view); + view_x = view_x * -1; + self.b_angle = view; + } + else if(self.target1) + { + vector view = realorigin(self.target1); + + if(self.target1.flags & FL_ITEM) + { + view = view + '0 0 48'; + } + + view = view - (self.origin + self.view_ofs); + view = vectoangles(view); + view_x = view_x * -1; + self.b_angle = view; + } + else + self.b_angle_x = 0; + // HACK HACK HACK HACK + // The bot falls off ledges a lot because of "turning around" + // so let the bot use instant turn around when not hunting a player + if(self.b_skill == 3) + { + self.keys = self.keys & 63; + self.v_angle = self.b_angle; + while (self.v_angle_x < -180) + self.v_angle_x = self.v_angle_x + 360; + while (self.v_angle_x > 180) + self.v_angle_x = self.v_angle_x - 360; + + } + else if((self.enemy == world || self.enemy.movetype == MOVETYPE_PUSH) && self.target1.classname != "player") + { + self.keys = self.keys & 63; + self.v_angle = self.b_angle; + while (self.v_angle_x < -180) + self.v_angle_x = self.v_angle_x + 360; + while (self.v_angle_x > 180) + self.v_angle_x = self.v_angle_x - 360; + } + else if(self.b_skill < 2) // skill 2 handled in bot_phys + { + if(self.b_angle_x > 180) + self.b_angle_x = self.b_angle_x - 360; + self.keys = self.keys & 63; + + if(angcomp(self.b_angle_y, self.v_angle_y) > 10) + self.keys = self.keys | KEY_LOOKLEFT; + else if(angcomp(self.b_angle_y, self.v_angle_y) < -10) + self.keys = self.keys | KEY_LOOKRIGHT; + if(angcomp(self.b_angle_x, self.v_angle_x) < -10) + self.keys = self.keys | KEY_LOOKUP; + else if(angcomp(self.b_angle_x, self.v_angle_x) > 10) + self.keys = self.keys | KEY_LOOKDOWN; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotAI + +This is the main ai loop. Though called every +frame, the ai_time limits it's actual updating + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float stagger_think; + +void() BotAI = +{ + // am I dead? Fire randomly until I respawn + // health < 1 is used because fractional healths show up as 0 on normal player + // status bars, and the mod probably already compensated for that + + if(self.health < 1) + { + self.button0 = floor(random() * 2); + self.button2 = 0; + self.keys = 0; + self.b_aiflags = 0; + ClearMyRoute(); + self.target1 = self.target2 = self.target3 = self.target4 = self.enemy = world; + self.last_way = world; + return; + } + + // stagger the bot's AI out so they all don't think at the same time, causing game + // 'spikes' + if(self.b_skill < 2) + { + if(self.ai_time > time) + return; + + self.ai_time = time + 0.05; + if(bot_count > 0) + { + if((time - stagger_think) < (0.1 / bot_count)) + self.ai_time = self.ai_time + 0.1 / (2 * bot_count); + } + else + return; + } + + if(self.view_ofs == '0 0 0') + { + bot_start_topic(7); + } + + stagger_think = time; + + // shut the bot's buttons off, various functions will turn them on by AI end + + self.button2 = 0; + self.button0 = 0; + + // switch empty weapons + if(!W_CheckNoAmmo(cVR_MainHand) && random() > 0.3) + { + bot_weapon_switch(1); + } + + // target1 is like goalentity in normal Quake monster AI. + // it's the bot's most immediate target + if(route_table == self) + { + if(busy_waypoints <= 0) + { + if(waypoint_mode < WM_EDITOR) + { + bot_look_for_crap(TRUE); + } + } + self.b_aiflags = 0; + self.keys = 0; + } + else if(self.target1) + { + frik_movetogoal(); + bot_path(); + } + else + { + if(waypoint_mode < WM_EDITOR) + { + if(self.route_failed) + { + if(waypoint_mode == WM_DYNAMIC) + frik_bot_roam(); + else + self.keys = 0; + self.route_failed = 0; + } + else if(!begin_route()) + { + bot_look_for_crap(FALSE); + self.keys = 0; + } + } + else + { + self.b_aiflags = AI_WAIT; + self.keys = 0; + } + } + + // bot_angle_set points the bot at it's goal (self.enemy or target1) + + bot_angle_set(); + + if(self.weapon == WID_FIST) + { + bot_weapon_switch(-1); + } + + // fight my enemy. Enemy is probably a field QC coders will most likely use a lot + // for their own needs, since it's unused on a normal player + // FIXME + if(self.enemy) + { + bot_fight_style(); + } + else if(random() < 0.2) + if(random() < 0.2) + bot_weapon_switch(-1); + bot_dodge_stuff(); + + // checks to see if bot needs to start going up for air + if(self.waterlevel > 2) + { + if(time > (self.air_finished - 2)) + { + traceline (self.origin, self.origin + '0 0 6800', TRUE, self); + if(trace_inopen) + { + self.keys = KEY_MOVEUP; + self.button2 = TRUE; // swim! + return; // skip ai flags for now - this is life or death + } + } + } + + // b_aiflags handling + + + if(self.b_aiflags) + bot_handle_ai(); + else + bot_chat(); // don't want chat to screw him up if he's rjing or something +}; diff --git a/QC/frikbot/bot_ed.qc b/QC/frikbot/bot_ed.qc new file mode 100644 index 00000000..748081f7 --- /dev/null +++ b/QC/frikbot/bot_ed.qc @@ -0,0 +1,1646 @@ +/*********************************************** +* * +* FrikBot Waypoint Editor * +* "The 'wtf is this doing in my mod' code" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +float saved1, saved2, saved3, scratch1, scratch2, scratch3, scratch4; +float bytecounter, filecount; + +float MENU_MAIN = 1; +float MENU_WAYPOINTS = 2; +float MENU_LINKS = 3; +float MENU_FLAGS = 4; +float MENU_FLAGS2 = 5; +float MENU_BOTS = 6; +float MENU_WAYLIST = 7; +// 8 = link way +// 9 = telelink way +// 10 = delete link +// 11 = create link X2 +// 12 = delete link x2 +// 13 = confirmation of delete all +// 14 = Teleport to way +// 15 = confirmation of delete point + +void() BSPDumpWaypoints; +void() QCDumpWaypoints; +void() DumpWaypoints; +void() SaveWays; +/* +// source for the menu strings... + +|-- Main Menu --|\n +(1) >>Waypoint Management\n +(2) >>Link Management \n +(3) >>AI Flag Management \n +(4) >>Bot Management \n +(5) >>Waylist Management \n +(6) ** Noclip \n +(7) ** Godmode \n +(8) ** Hold Select \n +(9) Teleport to Way # \n +\[\0\] Close Menu \n + +// missing from main is show way info +// iffy on the teleport to way thing being on main...seems like either a bot or way list thing + +|-- Waypoint Management --|\n +(1) Move Waypoint \n +(2) Delete Waypoint \n +(3) Make Waypoint \n +(4) Make Way + Link \n +(5) Make Way + Link X2 \n +(6) Make Way + Telelink \n +(7) Show waypoint info \n +(8) >>Link Management \n +(9) >>AI Flag Management \n +\[\0\] >>Main Menu \n + +|-- Link Management --|\n +(1) Unlink Waypoint \n +(2) Create Link \n +(3) Create Telelink \n +(4) Delete Link \n +(5) Create Link X2 \n +(6) Delete Link X2 \n +(7) >Make Waypoint \n +(8) >>Waypoint Management\n +(9) >>AI Flag Management \n +\[\0\] >>Main Menu \n + +// Ai flags...ugh + +|-- AI Flag Management --|\n +(1) ** Door Flag \n +(2) ** Precision \n +(3) ** Surface for air \n +(4) ** Blind mode \n +(5) ** Jump \n +(6) ** Directional \n +(7) ** Super Jump \n +\n +(9) >>AI Flags page 2 \n +\[\0\] >>Main Menu \n + +|-- AI Flags pg. 2--|\n +(1) ** Difficult \n +(2) ** Wait for plat \n +(3) ** Ride train \n +(4) ** Door flag no open\n +(5) ** Ambush \n +(6) ** Snipe \n +(7) ** Trace Test \n +\n +(9) >>AI Flag Management \n +\[\0\] >>Main Menu \n + +|-- Bot Management --|\n +(1) Add a Test Bot \n +(2) Order Test Bot here \n +(3) Remove Test Bot \n +(4) Stop Test Bot \n +(5) Teleport Bot here \n +(6) Teleport to Way # \n +\n +\n +\n +\[\0\] >>Main Menu \n + +|-- Waylist Management --|\n +(1) Delete ALL Waypoints \n +(2) Dump Waypoints \n +(3) Check For Errors \n +(4) Save Waypoints \n +(5) ** Dynamic Mode \n +(6) ** Dynamic Link \n +(7) ** WAY output \n +(8) ** QC output \n +(9) ** BSP ents output \n +\[\0\] Main Menu \n + +|-- Misc Commands --|\n +(1) Teleport to Selected \n +(2) Select \n +(3) Swap to old \n +(4) Trace select \n +(5) Create way in path \n +(6) Delete Way from path \n + + +|-- Editor Memory --|\n +(1) Store as slot 1 \n +(2) Store as slot 2 \n +(3) Store as slot 3 \n +(4) Store as slot 4 \n +(5) Recall slot 1 \n +(6) Recall slot 2 \n +(7) Recall slot 3 \n +(8) Recall slot 4 \n + +*/ + +void() bot_menu_display = +{ +// build options + string h; + entity t; + +// check impulses + if(self.impulse > 0 && self.impulse < 11 && self.b_menu) + { + if(self.b_menu == MENU_MAIN) + { + if(self.impulse == 1) + { + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + else if(self.impulse == 3) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if(self.impulse == 4) + { + self.b_menu = MENU_BOTS; + self.b_menu_time = time; + } + else if(self.impulse == 5) + { + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + else if(self.impulse == 6) + { + if(self.movetype == MOVETYPE_NOCLIP) + self.movetype = MOVETYPE_WALK; + else + self.movetype = MOVETYPE_NOCLIP; + self.b_menu_time = time; + + } + else if(self.impulse == 7) + { + if(self.flags & FL_GODMODE) + self.flags = self.flags - FL_GODMODE; + else + self.flags = self.flags | FL_GODMODE; + self.b_menu_time = time; + + } + else if(self.impulse == 8) + { + if(self.b_aiflags & AI_HOLD_SELECT) + self.b_aiflags = self.b_aiflags - AI_HOLD_SELECT; + else + self.b_aiflags = self.b_aiflags | AI_HOLD_SELECT; + self.b_menu_time = time; + } + else if(self.impulse == 9) + { + self.b_menu = 14; + self.b_menu_time = time; + } + else if(self.impulse == 10) + bot_way_edit(); + } + else if(self.b_menu == MENU_WAYPOINTS) + { + if(self.impulse == 1) + { + if(self.current_way) + setorigin(self.current_way, self.origin + self.view_ofs); + } + else if(self.impulse == 2) + { + if(self.current_way) + { + self.b_menu = 15; + self.b_menu_time = time; + self.last_way = self.current_way; + } + } + else if(self.impulse == 3) + { + make_waypoint(self.origin + self.view_ofs); + } + else if(self.impulse == 4) + { + t = make_waypoint(self.origin + self.view_ofs); + if(!LinkWays(self.current_way, t)) + sprint(self, "Unable to link them\n"); + } + else if(self.impulse == 5) + { + t = make_waypoint(self.origin + self.view_ofs); + if(!LinkWays(self.current_way, t)) + sprint(self, "Unable to link old to new\n"); + LinkWays(t, self.current_way); + } + else if(self.impulse == 6) + { + t = make_waypoint(self.origin + self.view_ofs); + if(!TeleLinkWays(self.current_way, t)) + sprint(self, "Unable to link them\n"); + } + else if(self.impulse == 7) + { + if(self.current_way) + { + sprint(self, "\nwaypoint info for waypoint #"); + h = ftos(self.current_way.count); + sprint(self, h); + sprint(self, "\nAI Flag value: "); + h = ftos(self.current_way.b_aiflags); + sprint(self, h); + + if(self.current_way.target1) + { + h = ftos(self.current_way.target1.count); + if(self.current_way.b_aiflags & AI_TELELINK_1) + sprint(self, "\nTelelink1 to:"); + else + sprint(self, "\nLink1 to:"); + sprint(self, h); + } + if(self.current_way.target2) + { + h = ftos(self.current_way.target2.count); + if(self.current_way.b_aiflags & AI_TELELINK_2) + sprint(self, "\nTelelink2 to:"); + else + sprint(self, "\nLink2 to:"); + sprint(self, h); + } + if(self.current_way.target3) + { + h = ftos(self.current_way.target3.count); + if(self.current_way.b_aiflags & AI_TELELINK_3) + sprint(self, "\nTelelink3 to:"); + else + sprint(self, "\nLink3 to:"); + sprint(self, h); + } + if(self.current_way.target4) + { + h = ftos(self.current_way.target4.count); + if(self.current_way.b_aiflags & AI_TELELINK_4) + sprint(self, "\nTelelink4 to:"); + else + sprint(self, "\nLink4 to:"); + sprint(self, h); + } + sprint(self, "\n\n"); + } + + } + if(self.impulse == 8) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + else if(self.impulse == 9) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if(self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if(self.b_menu == MENU_LINKS) + { + if(self.impulse == 1) + { + self.b_menu = 16; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if(self.impulse == 2) + { + self.b_menu = 8; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if(self.impulse == 3) + { + self.b_menu = 9; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if(self.impulse == 4) + { + self.b_menu = 10; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if(self.impulse == 5) + { + self.b_menu = 11; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if(self.impulse == 6) + { + self.b_menu = 12; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if(self.impulse == 7) + make_waypoint(self.origin + self.view_ofs); + else if(self.impulse == 8) + { + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + else if(self.impulse == 9) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if(self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if(self.b_menu == MENU_FLAGS) + { + + if(self.current_way) + { + if(self.impulse == 1) + { + if(self.current_way.b_aiflags & AI_DOORFLAG) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOORFLAG); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOORFLAG; + + self.b_menu_time = time; + } + else if(self.impulse == 2) + { + if(self.current_way.b_aiflags & AI_PRECISION) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PRECISION); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; + self.b_menu_time = time; + } + else if(self.impulse == 3) + { + if(self.current_way.b_aiflags & AI_SURFACE) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SURFACE); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SURFACE; + self.b_menu_time = time; + } + else if(self.impulse == 4) + { + if(self.current_way.b_aiflags & AI_BLIND) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_BLIND); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; + self.b_menu_time = time; + } + else if(self.impulse == 5) + { + if(self.current_way.b_aiflags & AI_JUMP) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_JUMP); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_JUMP; + self.b_menu_time = time; + } + else if(self.impulse == 6) + { + if(self.current_way.b_aiflags & AI_DIRECTIONAL) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIRECTIONAL); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIRECTIONAL; + self.b_menu_time = time; + } + else if(self.impulse == 7) + { + if(self.current_way.b_aiflags & AI_SUPER_JUMP) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SUPER_JUMP); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SUPER_JUMP; + self.b_menu_time = time; + } + } + if(self.impulse == 9) + { + self.b_menu = MENU_FLAGS2; + self.b_menu_time = time; + } + else if(self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if(self.b_menu == MENU_FLAGS2) + { + + if(self.current_way) + { + if(self.impulse == 1) + { + if(self.current_way.b_aiflags & AI_DIFFICULT) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIFFICULT); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIFFICULT; self.b_menu_time = time; + } + else if(self.impulse == 2) + { + if(self.current_way.b_aiflags & AI_PLAT_BOTTOM) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PLAT_BOTTOM); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PLAT_BOTTOM; + self.b_menu_time = time; + } + else if(self.impulse == 3) + { + if(self.current_way.b_aiflags & AI_RIDE_TRAIN) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_RIDE_TRAIN); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_RIDE_TRAIN; + self.b_menu_time = time; + } + else if(self.impulse == 4) + { + if(self.current_way.b_aiflags & AI_DOOR_NO_OPEN) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOOR_NO_OPEN); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOOR_NO_OPEN; + self.b_menu_time = time; + } + else if(self.impulse == 5) + { + if(self.current_way.b_aiflags & AI_AMBUSH) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_AMBUSH); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_AMBUSH; + self.b_menu_time = time; + } + else if(self.impulse == 6) + { + if(self.current_way.b_aiflags & AI_SNIPER) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SNIPER); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SNIPER; + self.b_menu_time = time; + } + else if(self.impulse == 7) + { + if(self.current_way.b_aiflags & AI_TRACE_TEST) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_TRACE_TEST); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_TRACE_TEST; + self.b_menu_time = time; + } + + } + if(self.impulse == 9) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if(self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + + else if(self.b_menu == MENU_BOTS) + { + if(self.impulse == 1) + { + self.impulse = 100; + return; + } + else if(self.impulse == 2) + { + b_temp3 = self; + self = player_head; + while(self) + { + if(!self.ishuman) + { + target_add(b_temp3); + bot_get_path(b_temp3, TRUE); + self = world; + } + else + self = self._next; + } + self = b_temp3; + } + else if(self.impulse == 3) + { + self.impulse = 102; + return; + } + else if(self.impulse == 4) + { + b_temp1 = self; + self = player_head; + while(self) + { + if(!self.ishuman) + { + self.target1 = self.target2 = self.target3 = self.target4 = world; + route_table = world; + } + self = self._next; + } + self = b_temp1; + } + else if(self.impulse == 5) + { + if(self.current_way) + { + b_temp1 = self; + self = player_head; + while(self) + { + if(!self.ishuman) + { + setorigin(self, b_temp1.current_way.origin); + } + self = self._next; + } + self = b_temp1; + } + else + sprint(self, "select a waypoint first\n"); + } + else if(self.impulse == 6) + { + self.b_menu = 14; + self.b_menu_time = time; + } + else if(self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if(self.b_menu == MENU_WAYLIST) + { + if(self.impulse == 1) + { + self.b_menu = 13; + self.b_menu_time = time; + } + else if(self.impulse == 2) + { + if(dump_mode == 0) + DumpWaypoints(); + else if(dump_mode == 1) + QCDumpWaypoints(); + else if(dump_mode == 2) + BSPDumpWaypoints(); + } + else if(self.impulse == 3) + { + t = way_head; + while(t) + { + if((t.target1 == world) && (t.target2 == world) && (t.target3 == world) && (t.target4 == world)) + { + sprint(self, "Waypoint #"); + h = ftos(t.count); + sprint(self, h); + sprint(self, " has no outbound links\n"); + } + if((t.target1 == t) || (t.target2 == t) || (t.target3 == t) || (t.target4 == t)) + { + sprint(self, "Waypoint #"); + h = ftos(t.count); + sprint(self, h); + sprint(self, " links to itself (??)\n"); + } + t = t._next; + } + sprint(self, "Error check complete\n"); + } + else if(self.impulse == 4) + { + { + self.b_menu = 17; + self.b_menu_time = time; + } + } + else if(self.impulse == 5) + { + if(waypoint_mode == WM_EDITOR_DYNAMIC) + waypoint_mode = WM_EDITOR; + else + waypoint_mode = WM_EDITOR_DYNAMIC; + self.b_menu_time = time; + + } + else if(self.impulse == 6) + { + if(waypoint_mode == WM_EDITOR_DYNLINK) + waypoint_mode = WM_EDITOR; + else + waypoint_mode = WM_EDITOR_DYNLINK; + self.b_menu_time = time; + } + else if(self.impulse == 7) + { + dump_mode = 0; + self.b_menu_time = time; + } + else if(self.impulse == 8) + { + dump_mode = 1; + self.b_menu_time = time; + } + else if(self.impulse == 9) + { + dump_mode = 2; + self.b_menu_time = time; + } + else if(self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if(self.b_menu == 8) + { + if(self.impulse == 1) + { + if(self.current_way) + { + if(!LinkWays(self.last_way, self.current_way)) + sprint(self, "Unable to link them\n"); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 9) + { + if(self.impulse == 1) + { + if(self.current_way) + { + if(!TeleLinkWays(self.last_way, self.current_way)) + sprint(self, "Unable to link them\n"); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 10) + { + if(self.impulse == 1) + { + if(self.current_way) + { + UnlinkWays(self.last_way, self.current_way); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 11) + { + if(self.impulse == 1) + { + if(self.current_way) + { + if(!LinkWays(self.last_way, self.current_way)) + sprint(self, "Unable to link 1 to 2\n"); + if(!LinkWays(self.current_way, self.last_way)) + sprint(self, "Unable to link 2 to 1\n"); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 12) + { + if(self.impulse == 1) + { + if(self.current_way) + { + UnlinkWays(self.last_way, self.current_way); + UnlinkWays(self.current_way, self.last_way); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 13) + { + if(self.impulse == 1) + { + ClearAllWays(); + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + else if(self.impulse == 2) + { + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + } + else if(self.b_menu == 14) + { + if(self.impulse == 10) + self.impulse = 0; + self.b_menu_value = self.b_menu_value * 10 + self.impulse; + self.b_menu_time = 0; + } + else if(self.b_menu == 15) + { + if(self.impulse == 1) + { + delete_waypoint(self.last_way); + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + else if(self.impulse == 2) + { + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 16) + { + if(self.impulse == 1) + { + if(self.last_way) + { + self.last_way.target1 = self.last_way.target2 = self.last_way.target3 = self.last_way.target4 = world; + self.last_way.b_aiflags = self.last_way.b_aiflags - (self.last_way.b_aiflags & 15); + } + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + else if(self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if(self.b_menu == 17) + { + if(self.impulse < 3) + { + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + } + self.impulse = 0; + } + if(self.b_menu_time <= time) + { + string s1 = ""; + string s2 = ""; + string s3 = ""; + string s4 = ""; + string s5 = ""; + string s6 = ""; + string s7 = ""; + + if(self.b_menu == MENU_MAIN) + { + s1 = "|-- Main Menu --|\n(1) >>Waypoint Management\n(2) >>Link Management \n(3) >>AI Flag Management \n(4) >>Bot Management \n(5) >>Waylist Management \n"; + if(self.movetype == MOVETYPE_NOCLIP) + s2 = "(6) ** Noclip \n"; + else + s2 = "(6) -- Noclip \n"; + + if(self.flags & FL_GODMODE) + s3 = "(7) ** Godmode \n"; + else + s3 = "(7) -- Godmode \n"; + if(self.b_aiflags & AI_HOLD_SELECT) + s4 = "(8) ** Hold Select \n"; + else + s4 = "(8) -- Hold Select \n"; + s5 = "(9) Teleport to Way # \n\[\0\] Close Menu \n"; + } + else if(self.b_menu == MENU_WAYPOINTS) + { + s1 = "|-- Waypoint Management --|\n(1) Move Waypoint \n(2) Delete Waypoint \n(3) Make Waypoint \n(4) Make Way + Link \n(5) Make Way + Link X2 \n(6) Make Way + Telelink \n(7) Show waypoint info \n(8) >>Link Management \n(9) >>AI Flag Management \n\[\0\] >>Main Menu \n"; + } + else if(self.b_menu == MENU_LINKS) + { + s1 = "|-- Link Management --|\n(1) Unlink Waypoint \n(2) Create Link \n(3) Create Telelink \n(4) Delete Link \n(5) Create Link X2 \n(6) Delete Link X2 \n(7) >Make Waypoint \n(8) >>Waypoint Management\n(9) >>AI Flag Management \n\[\0\] >>Main Menu \n"; + } + else if(self.b_menu == MENU_FLAGS) + { + if(self.current_way.b_aiflags & AI_DOORFLAG) + s1 = "|-- AI Flag Management --|\n(1) ** Door Flag \n"; + else + s1 = "|-- AI Flag Management --|\n(1) -- Door Flag \n"; + + if(self.current_way.b_aiflags & AI_PRECISION) + s2 = "(2) ** Precision \n"; + else + s2 = "(2) -- Precision \n"; + + if(self.current_way.b_aiflags & AI_SURFACE) + s3 = "(3) ** Surface for air \n"; + else + s3 = "(3) -- Surface for air \n"; + + if(self.current_way.b_aiflags & AI_BLIND) + s4 = "(4) ** Blind mode \n"; + else + s4 = "(4) -- Blind mode \n"; + + if(self.current_way.b_aiflags & AI_JUMP) + s5 = "(5) ** Jump \n"; + else + s5 = "(5) -- Jump \n"; + + if(self.current_way.b_aiflags & AI_DIRECTIONAL) + s6 = "(6) ** Directional \n"; + else + s6 = "(6) -- Directional \n"; + + if(self.current_way.b_aiflags & AI_SUPER_JUMP) + s7 = "(7) ** Super Jump \n\n(9) >>AI Flags page 2 \n\[\0\] >>Main Menu \n"; + else + s7 = "(7) -- Super Jump \n\n(9) >>AI Flags page 2 \n\[\0\] >>Main Menu \n"; + } + else if(self.b_menu == MENU_FLAGS2) + { + if(self.current_way.b_aiflags & AI_DIFFICULT) + s1 = "|-- AI Flags pg. 2--|\n(1) ** Difficult \n"; + else + s1 = "|-- AI Flags pg. 2--|\n(1) -- Difficult \n"; + + if(self.current_way.b_aiflags & AI_PLAT_BOTTOM) + s2 = "(2) ** Wait for plat \n"; + else + s2 = "(2) -- Wait for plat \n"; + + if(self.current_way.b_aiflags & AI_RIDE_TRAIN) + s3 = "(3) ** Ride train \n"; + else + s3 = "(3) -- Ride train \n"; + + if(self.current_way.b_aiflags & AI_DOOR_NO_OPEN) + s4 = "(4) ** Door flag no open\n"; + else + s4 = "(4) -- Door flag no open\n"; + + if(self.current_way.b_aiflags & AI_AMBUSH) + s5 = "(5) ** Ambush \n"; + else + s5 = "(5) -- Ambush \n"; + + if(self.current_way.b_aiflags & AI_SNIPER) + s6 = "(6) ** Snipe \n"; + else + s6 = "(6) -- Snipe \n"; + + if(self.current_way.b_aiflags & AI_TRACE_TEST) + s7 = "(7) ** Trace Test \n\n(9) >>AI Flag Management \n\[\0\] >>Main Menu \n"; + else + s7 = "(7) -- Trace Test \n\n(9) >>AI Flag Management \n\[\0\] >>Main Menu \n"; + + } + else if(self.b_menu == MENU_BOTS) + { + s1 = "|-- Bot Management --|\n(1) Add a Test Bot \n(2) Order Test Bot here \n(3) Remove Test Bot \n(4) Stop Test Bot \n(5) Teleport Bot here \n(6) Teleport to Way # \n\n\n\n\[\0\] >>Main Menu \n"; + } + else if(self.b_menu == MENU_WAYLIST) + { + s1 = "|-- Waylist Management --|\n(1) Delete ALL Waypoints \n(2) Dump Waypoints \n(3) Check For Errors \n(4) Save Waypoints \n"; + + if(waypoint_mode == WM_EDITOR_DYNAMIC) + s2 = "(5) ** Dynamic Mode \n(6) ** Dynamic Link \n"; + else if(waypoint_mode == WM_EDITOR_DYNLINK) + s2 = "(5) -- Dynamic Mode \n(6) ** Dynamic Link \n"; + else + s2 = "(5) -- Dynamic Mode \n(6) -- Dynamic Link \n"; + if(dump_mode == 0) + s3 = "(7) ** WAY output \n(8) -- QC output \n(9) -- BSP ents output \n\[\0\] Main Menu \n"; + else if(dump_mode == 1) + s3 = "(7) -- WAY output \n(8) ** QC output \n(9) -- BSP ents output \n\[\0\] Main Menu \n"; + else if(dump_mode == 2) + s3 = "(7) -- WAY output \n(8) -- QC output \n(9) ** BSP ents output \n\[\0\] Main Menu \n"; + + } + else if(self.b_menu == 8) + s1 = "|-- Link Ways --|\n\nSelect another way and push 1\nor press 2 to cancel"; + else if(self.b_menu == 9) + s1 = "|-- Telelink Ways --|\n\nSelect another way and push 1\nor press 2 to cancel"; + else if(self.b_menu == 10) + s1 = "|-- Delete Link --|\n\nSelect another way and push 1\nor press 2 to cancel"; + else if(self.b_menu == 11) + s1 = "|-- Create Link X2 --|\n\nSelect another way and push 1\nor press 2 to cancel"; + else if(self.b_menu == 12) + s1 = "|-- Delete Link X2 --|\n\nSelect another way and push 1\nor press 2 to cancel"; + else if(self.b_menu == 13) + s1 = "|-- Delete ALL Ways --|\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; + else if(self.b_menu == 14) + { + s1 = "|-- Teleport to Way # --|\n\nEnter way number and press\nimpulse 104 to warp\n\nWaypoint #"; + s2 = ftos(self.b_menu_value); + + } + else if(self.b_menu == 15) + s1 = "|-- Delete Waypoint --|\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; + else if(self.b_menu == 16) + s1 = "|-- Unlink Waypoint --|\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; + else if(self.b_menu == 17) + s1 = "|-- Save Waypoints --|\n\nSave Waypoints requires\nFRIK_FILE support from\nwww.quakesrc.org to be present\n in the engine code.\n Push 1 to return to previous menu."; + + frik_big_centerprint(self, s1, s2, s3, s4, s5, s6, s7); + self.b_menu_time = time + 1.25; + } +}; + + +// engage menu +void() bot_way_edit = +{ + entity t; + float f; + if(self.b_menu_value) + { + if(self.b_menu == 14) + { + t = WaypointForNum(self.b_menu_value); + if(t) + setorigin(self, t.origin - self.view_ofs); + else + sprint(self, "No waypoint with that number\n"); + + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + self.b_menu_value = 0; + return; + } + if(waypoint_mode < WM_EDITOR) + { + self.b_menu = MENU_MAIN; + waypoint_mode = WM_EDITOR; + self.b_menu_time = 0; + cvar_set("saved2", "0"); + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n"); + localcmd("cmdline\n"); + t = way_head; + while (t) + { + setmodel(t, "progs/s_bubble.spr"); // show the waypoints + t = t._next; + } + if(self.current_way) + setmodel(self.current_way, "progs/s_light.spr"); + } + else + { + saved2 = cvar_hget(cvarh_saved2); + if(saved2 != 0) + { + f = self.b_menu; + self.b_menu = floor(saved2/16); + self.impulse = saved2 & 15; + bot_menu_display(); + if(self.b_menu == floor(saved2/16)) + self.b_menu = f; + cvar_set("saved2", "0"); + return; + } + self.b_menu = 0; + waypoint_mode = WM_LOADED; + t = way_head; + while (t) + { + setmodel(t, string_null); // hide the waypoints + t = t._next; + } + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Saving to file. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +// bytecount is really iffy +// since there is no true way to determine the length of an ftos +// it uses an approximate of 5 +// various other things are guesses, but I don't cut it at the absolute +// max so it should be okay + +void() PrintWaypoint = +{ + entity t; + string h; + + if(self.enemy == world) + t = way_head; + else + t = self.enemy._next; + if(bytecounter >= 8000) + { + bprint("exec maps/"); + bprint(mapname); + bprint(".wa"); + h = ftos(filecount); + bprint(h); + filecount = filecount + 1; + bprint("\n// **** break here ****\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + bytecounter = 26; + } + if(t == world) + { + remove(self); + fixer = world; + bprint("saved4 3\n// end waypoint dump\n"); + bytecounter = bytecounter + 27; + return; + } +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + + float needcolon = FALSE; + + if((t.origin_x != saved1) || (t.count == 1)) + { + bprint("saved1 "); + h = ftos(t.origin_x); + bprint(h); + saved1 = t.origin_x; + bytecounter = bytecounter + 12; + needcolon = TRUE; + } + if((t.origin_y != saved2) || (t.count == 1)) + { + if(needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("saved2 "); + h = ftos(t.origin_y); + bprint(h); + bytecounter = bytecounter + 12; + saved2 = t.origin_y; + } + if((t.origin_z != saved3) || (t.count == 1)) + { + if(needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("saved3 "); + h = ftos(t.origin_z); + bprint(h); + bytecounter = bytecounter + 12; + saved3 = t.origin_z; + } + if(needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + bytecounter = bytecounter + 1; + bprint("\n"); + needcolon = FALSE; + } + if((scratch1 != t.target1.count) || t.count == 1) + { + needcolon = TRUE; + bprint("scratch1 "); + bytecounter = bytecounter + 14; + h = ftos(t.target1.count); + bprint(h); + scratch1 = t.target1.count; + } + if((scratch2 != t.target2.count) || t.count == 1) + { + if(needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("scratch2 "); + bytecounter = bytecounter + 14; + h = ftos(t.target2.count); + bprint(h); + scratch2 = t.target2.count; + } + if((scratch3 != t.target3.count) || t.count == 1) + { + if(needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("scratch3 "); + bytecounter = bytecounter + 14; + h = ftos(t.target3.count); + bprint(h); + scratch3 = t.target3.count; + } + if((scratch4 != t.target4.count) || t.count == 1) + { + if(needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("scratch4 "); + bytecounter = bytecounter + 14; + h = ftos(t.target4.count); + bprint(h); + scratch4 = t.target4.count; + } + if(needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + bprint("\n"); + needcolon = FALSE; + } + bprint("saved4 "); + bytecounter = bytecounter + 19; + if(t.count != 1) + h = ftos(t.b_aiflags * 4 + 2); + else + h = ftos(t.b_aiflags * 4 + 1); + bprint(h); + bprint ("; wait\n"); + self.nextthink = time + 0.01; + self.enemy = t; +}; + +// to allow for 100+ waypoints, we need to trick the runaway loop counter +void() DumpWaypoints = +{ + bytecounter = 50; + filecount = 1; + + bprint("// "); + bprint(world.message); + bprint(" - maps/"); // 2001-09-10 FrikBot support by FrikaC/Maddes + bprint(mapname); + bprint(".way\n"); + bprint("// Ways by "); + bprint(self.netname); + bprint("\n"); + if(!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = PrintWaypoint; + fixer.enemy = world; + } +}; + +void() PrintQCWaypoint = +{ + entity t; + string h; + + if(self.enemy == world) + t = way_head; + else + t = self.enemy._next; + + if(t == world) + { + remove(self); + fixer = world; + bprint("};\n// End dump\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + return; + } + bprint(" make_way("); +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + h = vtos(t.origin); + bprint(h); + bprint(", '"); + h = ftos(t.target1.count); + bprint(h); + bprint(" "); + h = ftos(t.target2.count); + bprint(h); + bprint(" "); + h = ftos(t.target3.count); + bprint(h); + bprint("', "); + h = ftos(t.target4.count); + bprint(h); + bprint(", "); + h = ftos(t.b_aiflags); + bprint(h); + bprint(");\n"); + self.nextthink = time + 0.01; + self.enemy = t; + +}; + +void() QCDumpWaypoints = +{ + bprint("/* QC Waypoint Dump - src/frikbot/map_"); + + bprint(mapname); + bprint(".qc\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, float flargs) make_way;\n"); + bprint("// Ways by "); + bprint(self.netname); + bprint("\n\n"); + + bprint("void() map_"); + bprint(mapname); + bprint(" =\n{\n"); + + if(!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = PrintQCWaypoint; + fixer.enemy = world; + } +}; + +void() PrintBSPWaypoint = +{ + entity t; + string h; + + if(self.enemy == world) + t = way_head; + else + t = self.enemy._next; + + if(t == world) + { + bprint("// End dump\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + remove(self); + fixer = world; + return; + } + bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \""); +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + h = ftos(t.origin_x); + bprint(h); + bprint(" "); + h = ftos(t.origin_y); + bprint(h); + bprint(" "); + h = ftos(t.origin_z); + bprint(h); + if(t.target1.count) + { + bprint("\"\n\"b_pants\" \""); + h = ftos(t.target1.count); + bprint(h); + } + if(t.target2.count) + { + bprint("\"\n\"b_skill\" \""); + h = ftos(t.target2.count); + bprint(h); + } + if(t.target3.count) + { + bprint("\"\n\"b_shirt\" \""); + h = ftos(t.target3.count); + bprint(h); + } + if(t.target4.count) + { + bprint("\"\n\"b_frags\" \""); + h = ftos(t.target4.count); + bprint(h); + } + if(t.b_aiflags) + { + bprint("\"\n\"b_aiflags\" \""); + h = ftos(t.b_aiflags); + bprint(h); + } + bprint("\"\n}\n"); + self.nextthink = time + 0.01; + self.enemy = t; + +}; + +void() BSPDumpWaypoints = +{ + bprint("/* BSP entities Dump - maps/"); + + bprint(mapname); + bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + + if(!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = PrintBSPWaypoint; + fixer.enemy = world; + } +}; + +// FrikaC's file access tutorial... +string(string s1, string s2) strcat = #115; +float(string filename, float mode) open = #110; +string(string s) zone = #118; +void(string s) unzone = #119; +void(float handle) close = #111; +void(float handle, string s) write = #113; +float(string ext) frik_checkextension = #99; +float file; + +void() SaveWaypoint = +{ + entity t; + string h, j, k, l; + + if(self.enemy == world) + t = way_head; + else + t = self.enemy._next; + if(bytecounter >= 8000) + { + h = "maps/"; + j = ftos(filecount); + k = h = zone(strcat("maps/", mapname)); + l = h = zone(strcat(h, ".wa")); + unzone(k); + h = zone(strcat(h, j)); + unzone(l); + write(file, "exec "); + write(file, h); + write(file, "\n"); + filecount = filecount + 1; + close(file); + file = open(h, 2); + unzone(h); + if(file == -1) + { + remove(self); + fixer = world; + bprint("Error: failed to save file\n"); + return; + } + bytecounter = 0; + } + if(t == world) + { + remove(self); + fixer = world; + write(file, "saved4 3\n"); + close(file); + bprint("waypoints saved.\n"); + bytecounter = bytecounter + 27; + return; + } +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + + float needcolon = FALSE; + + if((t.origin_x != saved1) || (t.count == 1)) + { + write(file, "saved1 "); + h = ftos(t.origin_x); + write(file, h); + saved1 = t.origin_x; + bytecounter = bytecounter + 12; + needcolon = TRUE; + } + if((t.origin_y != saved2) || (t.count == 1)) + { + if(needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "saved2 "); + h = ftos(t.origin_y); + write(file, h); + bytecounter = bytecounter + 12; + saved2 = t.origin_y; + } + if((t.origin_z != saved3) || (t.count == 1)) + { + if(needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "saved3 "); + h = ftos(t.origin_z); + write(file, h); + bytecounter = bytecounter + 12; + saved3 = t.origin_z; + } + if(needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + bytecounter = bytecounter + 1; + write(file, "\n"); + needcolon = FALSE; + } + if((scratch1 != t.target1.count) || t.count == 1) + { + needcolon = TRUE; + write(file, "scratch1 "); + bytecounter = bytecounter + 14; + h = ftos(t.target1.count); + write(file, h); + scratch1 = t.target1.count; + } + if((scratch2 != t.target2.count) || t.count == 1) + { + if(needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "scratch2 "); + bytecounter = bytecounter + 14; + h = ftos(t.target2.count); + write(file, h); + scratch2 = t.target2.count; + } + if((scratch3 != t.target3.count) || t.count == 1) + { + if(needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "scratch3 "); + bytecounter = bytecounter + 14; + h = ftos(t.target3.count); + write(file, h); + scratch3 = t.target3.count; + } + if((scratch4 != t.target4.count) || t.count == 1) + { + if(needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "scratch4 "); + bytecounter = bytecounter + 14; + h = ftos(t.target4.count); + write(file, h); + scratch4 = t.target4.count; + } + if(needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + write(file, "\n"); + needcolon = FALSE; + } + write(file, "saved4 "); + bytecounter = bytecounter + 19; + if(t.count != 1) + h = ftos(t.b_aiflags * 4 + 2); + else + h = ftos(t.b_aiflags * 4 + 1); + write(file, h); + write(file, "; wait\n"); + self.nextthink = time + 0.01; + self.enemy = t; +}; + +// to allow for 100+ waypoints, we need to trick the runaway loop counter +void() SaveWays = +{ + string h, f; + bytecounter = 50; + filecount = 1; + h = strcat("maps/", mapname); + f = h = zone(h); + h = strcat(h, ".way"); + unzone(f); + file = open(h, 2); + if(file == -1) + { + bprint("Error: failed to open file\n"); + return; + } + if(!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = SaveWaypoint; + fixer.enemy = world; + } +}; diff --git a/QC/frikbot/bot_fight.qc b/QC/frikbot/bot_fight.qc new file mode 100644 index 00000000..1f3a4fb1 --- /dev/null +++ b/QC/frikbot/bot_fight.qc @@ -0,0 +1,519 @@ +/*********************************************** +* * +* FrikBot Fight Code * +* "Because I ain't no Ghandi code" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +.entity avoid; + +float(entity e, float wid) ent_is_holding = +{ + return e.weapon == wid || e.weapon2 == wid; +} + +float(entity e) bot_size_player = +{ + float sz; + + sz = e.health + e.armorvalue * e.armortype; + + if(ent_is_holding(e, WID_ROCKET_LAUNCHER)) + sz = sz + 60; + else if(ent_is_holding(e, WID_LIGHTNING)) + sz = sz + 60; + else if(ent_is_holding(e, WID_GRENADE_LAUNCHER)) + sz = sz + 50; + else if(ent_is_holding(e, WID_SUPER_NAILGUN)) + sz = sz + 50; + else if(ent_is_holding(e, WID_NAILGUN)) + sz = sz + 40; + else if(ent_is_holding(e, WID_SUPER_SHOTGUN)) + sz = sz + 40; + else if(ent_is_holding(e, WID_SHOTGUN)) + sz = sz + 10; + else if(ent_is_holding(e, WID_AXE)) + sz = sz - 50; + + if(VR_ItemUtil_EntHasItem(e, IID_QUAD)) + sz = sz + 200; + + if(VR_ItemUtil_EntHasItem(e, IID_INVULNERABILITY)) + sz = sz + 300; + + if(VR_ItemUtil_EntHasItem(e, IID_INVISIBILITY)) + sz = sz + 250; + + return sz; +}; + +void() bot_dodge_stuff = +{ + entity foe; + float avdist, foesz, flen, tsz; + vector v; + + if(waypoint_mode > WM_LOADED) + return; + + self.avoid = world; + + + if(self.enemy) + { + v = self.origin - realorigin(self.enemy); + + foesz = bot_size_player(self.enemy); + foesz = foesz + vlen(v) * 0.5; + } + else + foesz = 9999999; + avdist = 256; + + foe = find(world, classname, "grenade"); + while(foe) + { + flen = vlen(foe.origin - self.origin); + if(flen < avdist) + { + avdist = flen; + self.avoid = foe; + } + foe = find(foe, classname, "grenade"); + } + if(!self.avoid) + { + foe = find(world, classname, "missile"); + while(foe) + { + if(foe.owner != self) + { + flen = vlen(foe.origin - self.origin); + if(flen < avdist) + { + avdist = flen; + self.avoid = foe; + } + } + foe = find(foe, classname, "missile"); + } + if(!self.avoid) + { + foe = find(world, classname, "spike"); + while(foe) + { + if(foe.owner != self) + { + flen = vlen(foe.origin - self.origin); + if(flen < avdist) + { + avdist = flen; + self.avoid = foe; + } + } + foe = find(foe, classname, "spike"); + } + } + } + if(coop) + { + if(!self.enemy) + { + foe = findradius(self.origin, 9999); + while(foe) + { + if(foe.flags & FL_MONSTER) + { + if(foe.health > 0) + { + tsz = bot_size_player(foe) + vlen(foe.origin - self.origin) * 0.5; + if(tsz < foesz) + { + if(fisible(foe)) + { + self.enemy = foe; + foesz = tsz; + } + } + } + } + foe = foe.chain; + } + } + } + else + { + foe = player_head; + while(foe) + { + if(foe != self) + { + if(foe.modelindex != 0) + { + if(foe.health > 0) + { + if(!(teamplay && self.team == foe.team)) + { + tsz = bot_size_player(foe) + vlen(foe.origin - self.origin) * 0.5; + if(tsz < foesz) + { + if(fov(foe) || foe.b_sound > time || self.b_skill == 3) + { + if(fisible(foe)) + { + self.enemy = foe; + foesz = tsz; + } + } + } + } + } + } + } + foe = foe._next; + } + } +}; + + + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +weapon_range + +_x "sweet spot range" - try to maintain this range if possible +_y minimum range bot can be to be effective (rl/gl) (move away) +_z maximum range bot can be to be effective (lg/axe) (move in) +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +vector(float wid) weapon_range = +{ + if(wid == WID_AXE) { return '48 0 64'; } + if(wid == WID_MJOLNIR) { return '48 0 64'; } + if(wid == WID_SHOTGUN) { return '128 8 3000'; } + if(wid == WID_SUPER_SHOTGUN) { return '128 0 3000'; } + if(wid == WID_NAILGUN) { return '180 0 3000'; } + if(wid == WID_SUPER_NAILGUN) { return '180 0 3000'; } + if(wid == WID_GRENADE_LAUNCHER) { return '180 48 3000'; } + if(wid == WID_PROXIMITY_GUN) { return '180 48 3000'; } + if(wid == WID_ROCKET_LAUNCHER) { return '180 48 3000'; } + if(wid == WID_LIGHTNING) { return '350 0 512'; } + if(wid == WID_LASER_CANNON) { return '350 0 512'; } + + bprint("Invalid wid in bot weapon_range: '"); + bprint(ftos(wid)); + bprint("'\n"); + + return '128 8 3000'; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_weapon_switch + +Pick a weapon based on range / ammo + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float(float brange) bot_pick_weapon = +{ + float wid; + vector v; + + if( (VR_WeaponUtil_EntHasWeapon(self, WID_ROCKET_LAUNCHER)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) >= 1)) + { + wid = WID_ROCKET_LAUNCHER; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + if(self.waterlevel <= 1 && + (VR_WeaponUtil_EntHasWeapon(self, WID_LIGHTNING)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_CELLS) >= 1)) + { + wid = WID_LIGHTNING; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + if((VR_WeaponUtil_EntHasWeapon(self, WID_SUPER_NAILGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_NAILS) >= 2)) + { + wid = WID_SUPER_NAILGUN; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + if((VR_WeaponUtil_EntHasWeapon(self, WID_GRENADE_LAUNCHER)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) >= 1)) + { + wid = WID_GRENADE_LAUNCHER; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + if((VR_WeaponUtil_EntHasWeapon(self, WID_SUPER_SHOTGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) >= 2)) + { + wid = WID_SUPER_SHOTGUN; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + if((VR_WeaponUtil_EntHasWeapon(self, WID_NAILGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_NAILS) >= 1)) + { + wid = WID_NAILGUN; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + if((VR_WeaponUtil_EntHasWeapon(self, WID_SHOTGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) >= 1)) + { + wid = WID_SHOTGUN; + v = weapon_range(wid); + + if(brange == -1 || (brange >= v_y && brange <= v_z)) + { + return wid; + } + } + + wid = WID_AXE; + return wid; +}; + +void(float brange) bot_weapon_switch = +{ + self.weapon = bot_pick_weapon(brange); + W_SetCurrentAmmo(); +}; + +void() bot_setvrfields = +{ + if(self.ishuman) + return; + + self.handrot = self.v_angle; + self.offhandrot = self.v_angle; + + makeforward(self.v_angle); + + self.handpos = self.origin + '0 0 16' + (v_forward * 8); + self.offhandpos = self.origin + '0 0 16' + (v_forward * 8); + + self.muzzlepos = self.origin + '0 0 16' + (v_forward * 32); + self.offmuzzlepos = self.origin + '0 0 16' + (v_forward * 32); + + VRSetTeleporting(self, FALSE); + VRSetOffHandGrabbingBit(self, TRUE); + VRSetOffHandPrevGrabbingBit(self, TRUE); + VRSetMainHandGrabbingBit(self, TRUE); + VRSetMainHandPrevGrabbingBit(self, TRUE); + VRSet2HAiming(self, FALSE); +} + +void() bot_shoot = +{ + // quick little function to stop making him shoot the wrong way ! Argh + float g; + + g = angcomp(self.v_angle_x, self.b_angle_x); + if(fabs(g) > 30) + return; // argh, too far away + + g = angcomp(self.v_angle_y, self.b_angle_y); + if(fabs(g) > 30) + return; // not again! + + bot_setvrfields(); + self.button0 = TRUE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot_fight_style + +This is the core of the bot's thinking when +attacking an enemy. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_fight_style = +{ + vector v1, v2; + float mysz, foesz; + + if(self.enemy.health <= 0) + { + self.enemy = world; + return; + } + + if(!self.enemy.takedamage) + { + self.enemy = world; + return; + } + + if(!fisible(self.enemy)) + { + self.enemy = world; + return; + } + + vector org = realorigin(self.enemy); + makevectors(self.v_angle); + + // decide if I should shoot + + float foedist = vlen(org - self.origin); + + vector v = weapon_range(self.weapon); + + if(foedist > v_y && foedist < v_z) + { + traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * v_z, FALSE, self); + if(vlen(trace_endpos - (self.origin + self.view_ofs)) >= v_y) + { + // try to avoid shooting teammates + if(trace_ent.classname == "player") + if((trace_ent.team == self.team && teamplay) || (coop)) + return; + bot_shoot(); + } + } + else + bot_weapon_switch(foedist); + + if(!(self.b_aiflags & (AI_PRECISION | AI_BLIND | AI_OBSTRUCTED))) + { + foesz = bot_size_player(self.enemy); + mysz = bot_size_player(self) + 5; + + if(foesz > mysz) + { + if(teamplay) + { + if(random() < 0.02) + { + bot_start_topic(5); + self.b_chattime = 1; + } + } + + return; + } + else if(mysz < 140) + return; + else if(self.avoid) + { + if(self.avoid.velocity) + v = self.avoid.velocity; + else + v = normalize(self.avoid.origin - self.origin); + v1_x = v_y * -1; + v1_y = v_x; + v2_x = v_y; + v2_y = v_x * -1; + foedist = vlen(self.avoid.origin - (self.origin + v1)); + if(foedist < vlen(self.avoid.origin - (self.origin + v2))) + frik_walkmove(v2); + else + frik_walkmove(v1); + } + else if(!(self.enemy.flags & FL_MONSTER)) + { + if(foedist + 32 < v_x) + frik_walkmove(self.origin - org); + else if(foedist - 32 > v_x) + frik_walkmove(org - self.origin); + else if(self.wallhug) + frik_walkmove(v_right); + else + frik_walkmove(v_right * -1); + } + } + else + { + foesz = bot_size_player(self.enemy); + mysz = bot_size_player(self) + 5; + + if(foesz > mysz) + return; + else if(mysz < 140) + return; + self.keys = self.keys & 960; + } +}; + + diff --git a/QC/frikbot/bot_misc.qc b/QC/frikbot/bot_misc.qc new file mode 100644 index 00000000..c71ad1c3 --- /dev/null +++ b/QC/frikbot/bot_misc.qc @@ -0,0 +1,781 @@ +/*********************************************** +* * +* FrikBot Misc Code * +* "Because you can't name it anything else" * +* * +***********************************************/ + +/* +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotName + +Sets bot's name and colors + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +string(float r) BotName = +{ + self.b_num = r; + if(r == 1) + { + self.b_pants = 11; + self.b_shirt = 0; + return "Vincent"; + } + else if(r == 2) + { + self.b_pants = 1; + self.b_shirt = 3; + return "Bishop"; + } + else if(r == 3) + { + self.b_pants = 13; + self.b_shirt = 2; + return "Nomad"; + } + else if(r == 4) + { + self.b_pants = 7; + self.b_shirt = 6; + return "Hudson"; + } + else if(r == 5) + { + self.b_pants = 12; + self.b_shirt = 6; + return "Lore"; + } + else if(r == 6) + { + self.b_pants = 4; + self.b_shirt = 4; + return "Servo"; + } + else if(r == 7) + { + self.b_pants = 2; + self.b_shirt = 5; + return "Gort"; + } + else if(r == 8) + { + self.b_pants = 10; + self.b_shirt = 3; + return "Kryten"; + } + else if(r == 9) + { + self.b_pants = 9; + self.b_shirt = 4; + return "Pimp Bot"; + } + else if(r == 10) + { + self.b_pants = 4; + self.b_shirt = 7; + return "Max"; + } + else if(r == 11) + { + self.b_pants = 3; + self.b_shirt = 11; + return "Marvin"; + } + else if(r == 12) + { + self.b_pants = 13; + self.b_shirt = 12; + return "Erwin"; + } + else if(r == 13) + { + self.b_pants = 11; + self.b_shirt = 2; + return "FrikBot"; + } + else if(r == 14) + { + self.b_pants = 0; + self.b_shirt = 2; + return "Krosis"; + } + else if(r == 15) + { + self.b_pants = 8; + self.b_shirt = 9; + return "Gypsy"; + } + else // if(r == 16) + { + self.b_pants = 5; + self.b_shirt = 10; + return "Hal"; + } +}; +string () PickARandomName = +{ + if(bot_count > 16) + return "player"; + + float y, test; + string h = "Random"; + entity t; + y = TRUE; + while(y) + { + test = ceil(random() * 16); + h = BotName(test); + t = find(world, netname, h); + if(t == world) + y = FALSE; + } + return h; +}; + + + +// I didn't like the old code so this is very stripped down + +entity b_originator; +float b_topic; +/* FBX Topics + +b_originator == self + 1 - sign on + 2 - killed targ + 3 - team message "friendly eyes" + 4 - team message "on your back" + 5 - team message "need back up" + 6 - excuses + ---- + 7 - gameover + ---- + 8 - welcoming someone onto server + 9 - ridicule lost frag (killed self?) + 10 - ridicule lost frag (lava) + 11 - lag +b_originator == targ + + +*/ +void(float tpic) bot_start_topic = +{ + if(random() < 0.2) + { + b_topic = tpic; + b_originator = self; + } + else + b_topic = 0; +}; + +void() bot_chat = +{ + float r; + if(b_options & OPT_NOCHAT) + return; + r = ceil (random() * 6); + + if(self.b_chattime > time) + { + if(self.b_skill < 2) + self.keys = self.button0 = self.button2 = 0; + return; + } + else if(self.b_chattime) + { + if(b_topic == 1) + { + if(b_originator == self) + { + if(r == 1) + { + BotSay(": lo all\n"); + bot_start_topic(8); + } + else if(r == 2) + { + BotSay(": hey everyone\n"); + bot_start_topic(8); + } + else if(r == 3) + { + BotSay(": prepare to be fragged!\n"); + bot_start_topic(0); + } + else if(r == 4) + { + BotSay(": boy this is laggy\n"); + bot_start_topic(11); + } + else if(r == 5) + { + BotSay(": #mm getting some lag here\n"); + bot_start_topic(11); + } + else + { + BotSay(": hi everyone\n"); + bot_start_topic(8); + } + } + } + else if(b_topic == 2) + { + if(b_originator == self) + { + if(r == 1) + BotSay(": take that\n"); + else if(r == 2) + BotSay(": yehaww!\n"); + else if(r == 3) + BotSay(": wh00p\n"); + else if(r == 4) + BotSay(": j00_sawk();\n"); + else if(r == 5) + BotSay(": i rule\n"); + else + BotSay(": eat that\n"); + bot_start_topic(0); + } + } + else if(b_topic == 3) + { + if(b_originator == self) + { + if(r < 3) + BotSayTeam(": friendly eyes\n"); + else + BotSayTeam(": team eyes\n"); + bot_start_topic(0); + } + } + else if(b_topic == 4) + { + if(b_originator == self) + { + if(r < 3) + BotSayTeam(": on your back\n"); + else + BotSayTeam(": I'm with you\n"); + bot_start_topic(0); + } + } + else if(b_topic == 5) + { + if(b_originator == self) + { + if(r < 3) + BotSayTeam(": I need help\n"); + else + BotSayTeam(": need backup\n"); + bot_start_topic(0); + } + } + else if(b_topic == 6) + { + if(b_originator == self) + { + if(r == 1) + { + BotSay(": sun got in my eyes\n"); + bot_start_topic(0); + } + else if(r == 2) + { + BotSay(": mouse needs cleaning\n"); + bot_start_topic(0); + } + else if(r == 3) + { + BotSay(": i meant to do that\n"); + bot_start_topic(0); + } + else if(r == 4) + { + BotSay(": lag\n"); + bot_start_topic(11); + } + else if(r == 5) + { + BotSay(": killer lag\n"); + bot_start_topic(11); + } + else + { + BotSay(": 100% lag\n"); + bot_start_topic(11); + } + } + } + else if(b_topic == 7) + { + if(r == 1) + BotSay(": gg\n"); + else if(r == 2) + BotSay(": gg all\n"); + else if(r == 3) + BotSay(": that was fun\n"); + else if(r == 4) + BotSay(": good game\n"); + else if(r == 5) + BotSay(": pah\n"); + else + BotSay(": hrm\n"); + bot_start_topic(0); + } + else if(b_topic == 8) + { + if(b_originator != self) + { + if(r == 1) + { + BotSay(": heya\n"); + bot_start_topic(0); + } + else if(r == 2) + { + BotSay(": welcome\n"); + bot_start_topic(0); + } + else if(r == 3) + { + BotSayInit(); + BotSay2(": hi "); + BotSay2(b_originator.netname); + BotSay2("\n"); + bot_start_topic(0); + } + else if(r == 4) + { + BotSayInit(); + BotSay2(": hey "); + BotSay2(b_originator.netname); + BotSay2("\n"); + bot_start_topic(0); + } + else if(r == 5) + { + BotSay(": howdy\n"); + bot_start_topic(0); + } + else + { + BotSay(": lo\n"); + bot_start_topic(0); + } + } + } + + else if(b_topic == 9) + { + if(b_originator != self) + { + if(r == 1) + BotSay(": hah\n"); + else if(r == 2) + BotSay(": heheh\n"); + else if(r == 3) + { + BotSayInit(); + BotSay2(": good work "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if(r == 4) + { + BotSayInit(); + BotSay2(": nice1 "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if(r == 5) + BotSay(": lol\n"); + else + BotSay(": :)\n"); + b_topic = 6; + } + } + else if(b_topic == 10) + { + if(b_originator != self) + { + if(r == 1) + BotSay(": have a nice dip?\n"); + else if(r == 2) + BotSay(": bah I hate levels with lava\n"); + else if(r == 3) + { + BotSayInit(); + BotSay2(": good job "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if(r == 4) + { + BotSayInit(); + BotSay2(": nice backflip "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if(r == 5) + BotSay(": watch your step\n"); + else + BotSay(": hehe\n"); + b_topic = 6; + } + } + + else if(b_topic == 11) + { + if(b_originator != self) + { + if(r == 1) + { + BotSayInit(); + BotSay2(": yeah right "); + BotSay2(b_originator.netname); + BotSay2("\n"); + bot_start_topic(0); + } + else if(r == 2) + { + BotSay(": ping\n"); + bot_start_topic(0); + } + else if(r == 3) + { + BotSay(": shuddup, you're an lpb\n"); + bot_start_topic(0); + } + else if(r == 4) + { + BotSay(": lag my eye\n"); + bot_start_topic(0); + } + else if(r == 5) + { + BotSay(": yeah\n"); + bot_start_topic(11); + } + else + { + BotSay(": totally\n"); + bot_start_topic(11); + } + } + } + self.b_chattime = 0; + } + else if(b_topic) + { + if(random() < 0.5) + { + if(self == b_originator) + { + if(b_topic <= 7) + self.b_chattime = time + 2; + } + else + { + if(b_topic >= 7) + self.b_chattime = time + 2; + } + } + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Kick A Bot. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() KickABot = +{ + entity ty; + ty = find(world, classname, "player"); + while (ty != world) + { + if(!(ty.ishuman)) + { + + BotDisconnect(ty); + ty.ishuman = TRUE; + ty = world; + } + else + ty = find(ty, classname, "player"); + } + +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Simplified origin checking. + +God, I wish I had inline + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +vector(entity ent) realorigin = +{ + // even more simplified... + return (ent.absmin + ent.absmax) * 0.5; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +fisible + +a version of visible that checks for corners +of the bounding boxes + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float (entity targ) fisible = +{ + float thruwater; + + vector org = realorigin(targ); + vector spot1 = self.origin + self.view_ofs; + + if(targ.solid == SOLID_BSP) + { + traceline(spot1, org, TRUE, self); + + if(trace_ent == targ) + return TRUE; + + else if(trace_fraction == 1) + return TRUE; + + return FALSE; + } + + float pc1 = pointcontents(org); + float pc2 = pointcontents(spot1); + + if(targ.classname == "player") + thruwater = FALSE; + else if(pc1 == CONTENT_LAVA) + return FALSE; + else + thruwater = TRUE; + + if(pc1 < -1) // targ's origin is in water or other liquid + { + if(pc2 != pc1) + { + // look for their head + traceline (spot1, org + targ.mins, TRUE, self); + // cross the water check + if(trace_inopen) + if(trace_inwater) + if(!thruwater) + return FALSE; + if(trace_ent == targ) + return TRUE; + else if(trace_fraction == 1) + return TRUE; + return FALSE; + } + } + else + { + if(pc2 != pc1) + { + traceline (spot1, org + targ.maxs, TRUE, self); + if(trace_inopen) + if(trace_inwater) + if(!thruwater) + return FALSE; + if(trace_ent == targ) + return TRUE; + else if(trace_fraction == 1) + return TRUE; + return FALSE; + } + } + traceline (spot1, org, TRUE, self); + if(trace_ent == targ) + return TRUE; + else if(trace_fraction == 1) + return TRUE; + traceline (spot1, org + targ.maxs, TRUE, self); + if(trace_ent == targ) + return TRUE; + else if(trace_fraction == 1) + return TRUE; + traceline (spot1, org + targ.mins, TRUE, self); + if(trace_ent == targ) + return TRUE; + else if(trace_fraction == 1) + return TRUE; + return FALSE; +} + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Wisible + +goes through movable brushes/entities, used +for waypoints + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +// this is used for waypoint stuff.... +float (entity targ1, entity targ2) wisible = +{ + vector spot1, spot2; + entity ignore; + + spot1 = targ1.origin; + spot2 = realorigin(targ2); + + ignore = self; + do + { + traceline (spot1, spot2, TRUE, ignore); + spot1 = realorigin(trace_ent); + ignore = trace_ent; + } while ((trace_ent != world) && (trace_fraction != 1)); + if(trace_endpos == spot2) + return TRUE; + else + return FALSE; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +sisible + +Now this is getting ridiculous. Simple visible, +used when we need just a simple traceline nothing else + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float(entity targ) sisible = +{ + traceline(self.origin, targ.origin, TRUE, self); + + if(trace_ent == targ) + return TRUE; + else if(trace_fraction == 1) + return TRUE; + + return FALSE; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +angcomp + +subtracts one angle from another + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float (float y1, float y2) angcomp = +{ + y1 = frik_anglemod(y1); + y2 = frik_anglemod(y2); + + float answer; + answer = y1 - y2; + if(answer > 180) + answer = answer - 360; + else if(answer < -180) + answer = answer + 360; + return answer; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +fov + +is the entity in the bot's field of view + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float (entity targ) fov = +{ + vector yawn; + float g; + yawn = realorigin(targ); + yawn = (yawn + targ.view_ofs) - (self.origin + self.view_ofs); + yawn = normalize(yawn); + yawn = vectoangles(yawn); + g = angcomp(self.v_angle_x, yawn_x); + if(fabs(g) > 45) + return FALSE; + g = angcomp(self.v_angle_y, yawn_y); + if(fabs(g) > 60) + return FALSE; + + return TRUE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +frik_anglemod + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float(float v) frik_anglemod = +{ + return v - floor(v/360) * 360; +}; diff --git a/QC/frikbot/bot_move.qc b/QC/frikbot/bot_move.qc new file mode 100644 index 00000000..47bc6c6b --- /dev/null +++ b/QC/frikbot/bot_move.qc @@ -0,0 +1,529 @@ +/*********************************************** +* * +* FrikBot Movement AI * +* "The slightly better movement AI" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +void() bot_jump = +{ + // TODO check for precision, etc. + self.button2 = TRUE; +}; + +float(entity e) bot_can_rj = +{ + // this returns true of the bot can rocket/superjump/hook + // if your mod doesn't have an RL you can just return FALSE all the time + // if it has a hook or some other means for the bot to get to high places + // you can check here for that capability + + // am I dumb? + if(e.b_skill == 0) + return FALSE; + + // quad = bad + if(e.items & 4194304) + return FALSE; + + // do I have rockets & RL? + if(!((e.items & 32) && (e.ammo_rockets > 0))) + return FALSE; + + // do I have pent? + if(e.items & 1048576) + return TRUE; + + if(e.health > 50) + return TRUE; + else + return FALSE; +}; + +float(float flag) frik_recognize_plat = +{ + if((self.classname != "waypoint") && !(self.flags & FL_ONGROUND)) + return FALSE; + traceline(self.origin, self.origin - '0 0 64', TRUE, self); + if(trace_ent != world) + { + if(flag) // afect bot movement too + { + if(self.keys & KEY_MOVEUP) + { + if(trace_ent.velocity_z > 0) + self.keys = self.keys & 960; // 960 is all view keys + } + else if(self.keys & KEY_MOVEDOWN) + { + if(trace_ent.velocity_z < 0) + self.keys = self.keys & 960; + } + } + return TRUE; + } + else + return FALSE; +}; + +float(vector sdir) frik_KeysForDir = +{ + + vector keydir; + float outkeys, tang; + outkeys = 0; + if(sdir_x || sdir_y) + { + // Everything is tested against 60 degrees, + // this allows the bot to overlap the keys + // 30 degrees on each diagonal 45 degrees + // might look more realistic + + keydir = vectoangles(sdir); + tang = angcomp(keydir_y, self.v_angle_y); + if((tang <= 150) && (tang >= 30)) + outkeys = outkeys + KEY_MOVELEFT; + else if((tang >= -150) && (tang <= -30)) + outkeys = outkeys + KEY_MOVERIGHT; + if(fabs(tang) <= 60) + outkeys = outkeys + KEY_MOVEFORWARD; + else if(fabs(tang) >= 120) + outkeys = outkeys + KEY_MOVEBACK; + } + if(sdir_z > 0) + outkeys = outkeys + KEY_MOVEUP; + else if(sdir_z < 0) + outkeys = outkeys + KEY_MOVEDOWN; + return outkeys; + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +frik_obstructed + +Bot has hit a ledge or wall that he should +manuever around. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(vector whichway, float danger) frik_obstructed = +{ + float dist; + vector disway; +// TODO: something + + if(self.b_aiflags & AI_BLIND) + return; + + vector org = realorigin(self.target1); + + if(danger) + { + self.b_aiflags = self.b_aiflags | AI_DANGER; + self.keys = frik_KeysForDir('0 0 0' - whichway); + } + + if(self.b_aiflags & AI_PRECISION) + return; + + if(self.target1) + { + if(self.b_aiflags & AI_OBSTRUCTED) + { + if(!(self.b_aiflags & AI_DANGER)) + { + self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + return; + } + else if(!danger) + return; + } + self.obs_dir = whichway; + disway_x = whichway_y * -1; + disway_y = whichway_x; + dist = vlen(org - (self.origin + disway)); + disway_x = whichway_y; + disway_y = whichway_x * -1; + self.wallhug = vlen(org - (self.origin + disway)) > dist; + self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; + + } + else + { + disway_x = whichway_y * -1; + disway_y = whichway_x; + dist = vlen(disway - self.obs_dir); + disway_x = whichway_y; + disway_y = whichway_x * -1; + self.wallhug = vlen(disway - self.obs_dir) < dist; + self.obs_dir = whichway; + + self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +frik_obstacles + +Detects small bumps the bot needs to jump over +or ledges the bot should avoid falling in. + +Also responsible for jumping gaps. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_obstacles = +{ + vector start, stop, ang; + float test, conts, dist, hgt; + + if(!(self.flags & FL_ONGROUND)) + return; + if(self.b_aiflags & AI_BLIND) + return; + + ang = normalize(self.velocity); + ang_z = 0; + start = self.origin + ang * 32; // ahem + start_z = self.origin_z + self.maxs_z; + stop = start; + stop_z = self.origin_z + self.mins_z; + traceline(start, stop - '0 0 256', TRUE, self); + if(trace_allsolid || trace_startsolid) + return; + hgt = trace_endpos_z - stop_z; + + if(hgt > 18) + { + bot_jump(); + return; + } + if(hgt >= 0) + return; + + conts = pointcontents(trace_endpos + '0 0 4'); + start = stop - '0 0 8'; + stop = start + ang * 256; + traceline(start, stop, TRUE, self); + test = vlen(trace_endpos - start); + if(test <= 20) + return; // it's a walkable gap, do nothing + ang_x = self.velocity_y * -1; + ang_y = self.velocity_x; + ang = normalize(ang); + traceline(start - (ang * 10), start + (ang * 10), TRUE, self); + if((trace_fraction != 1) || trace_startsolid) + return; // gap is only 20 wide, walkable + ang = self.velocity; + ang_z = 0; + dist = ((540 / sv_gravity) * vlen(ang))/* + 32*/; + if(test > dist) // I can't make it + { + if(conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + else + { + if(self.target1) + { + stop = realorigin(self.target1); + if((stop_z - self.origin_z) < -32) + return; // safe to fall + } + frik_obstructed(ang, FALSE); + return; + } + } + else + { + ang = normalize(ang); + //look for a ledge + traceline(self.origin, self.origin + (ang * (test + 20)), TRUE, self); + if(trace_fraction != 1) + { + if(conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + else + { + if(self.target1) + { + stop = realorigin(self.target1); + if((stop_z - self.origin_z) < -32) + return; // safe to fall + } + frik_obstructed(ang, FALSE); + return; + } + } + + if(self.target1) + { + // getting furter away from my target? + test = vlen(self.target1.origin - (ang + self.origin)); + if(test > vlen(self.target1.origin - self.origin)) + { + if(conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + else + { + frik_obstructed(ang, FALSE); + return; + } + } + } + } + if(hgt < -18) + { + if(conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + if(self.target1) + { + stop = realorigin(self.target1); + if((stop_z - self.origin_z) < -32) + { + + return; // safe to fall + } + } + bot_jump(); + } + // go for it +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +After frik_obstructed, the bot uses the +following funtion to move "around" the obstacle + +I have no idea how well it will work + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_dodge_obstruction = +{ + vector way, org; + float oflags, yaw; + + if(!(self.b_aiflags & AI_OBSTRUCTED)) + return; + if((self.b_aiflags & (AI_BLIND | AI_PRECISION)) || !(self.flags & FL_ONGROUND)) + { + self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + return; + } + + // perform a walkmove check to see if the obs_dir is still obstructed + // walkmove is less forgiving than frik_obstacles, so I dunno + // how well this will work + + oflags = self.flags; + org = self.origin; + + yaw = vectoyaw(self.obs_dir); + if(walkmove(yaw, 32)) + self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + else + { + if(self.b_aiflags & AI_DANGER) + { + way = '0 0 0' - self.obs_dir; + } + else if(self.wallhug) + { + way_x = self.obs_dir_y * -1; + way_y = self.obs_dir_x; + } + else + { + way_x = self.obs_dir_y; + way_y = self.obs_dir_x * -1; + } + self.keys = self.keys & 960 + frik_KeysForDir(way); + } + + // fix the bot + + self.origin = org; + self.flags = oflags; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +movetogoal and walkmove replacements + +blah + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_movetogoal = +{ + vector way; + float g; + + if(self.target1 == world) + { + makeforward(self.v_angle); + frik_walkmove(v_forward); + return; + } + way = realorigin(self.target1) - self.origin; + if(vlen(way) < 25) + { + self.keys = self.keys & 960; + return; + } + + way = normalize(way); + self.keys = self.keys & 960 + frik_KeysForDir(way); + + frik_dodge_obstruction(); + frik_recognize_plat(TRUE); + + if(self.b_aiflags & AI_PRECISION) + { + g = angcomp(self.v_angle_x, self.b_angle_x); + + if(fabs(g) > 10) + { + self.keys = self.keys & 960; + } + + g = angcomp(self.v_angle_y, self.b_angle_y); + + if(fabs(g) > 10) + { + self.keys = self.keys & 960; + } + } +}; + +float(vector weird) frik_walkmove = +{ + // okay so it's not walkmove + // sue me + self.keys = self.keys & 960 + frik_KeysForDir(weird); + + frik_dodge_obstruction(); + frik_recognize_plat(TRUE); + if(self.b_aiflags & AI_OBSTRUCTED) + return FALSE; + else + return TRUE; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The "hook" method of navigation. This nav +system is copyrighted 1999 by Ryan "Frika C" +Smith, keep that in mind when you steal it. + +I brought this back because normal roaming +won't work - the bot gets distracted by it's +own waypoints. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_bot_roam = +{ + vector org, ang, org1; + float loopcount, flag, dist; + + loopcount = 26; + flag = FALSE; + while((loopcount > 0) && !flag) + { + loopcount = loopcount - 1; + org = self.origin + self.view_ofs; + ang = self.angles; + ang_y = frik_anglemod(ang_y - 90 + (random() * 180)); + ang_x = 0; // avoid upward sloping + makeforward(ang); + traceline(org, org + v_forward * 2300, TRUE, self); + if(trace_fraction != 1) + { + org1 = trace_endpos; + ang = normalize(trace_plane_normal); + ang_z = 0; // avoid upward sloping + traceline(org1, org1 + (ang * 2300), TRUE, self); + if((trace_fraction != 1) && (vlen(trace_endpos - org1) >= 64)) + { + org = trace_endpos; + traceline(org, self.origin + self.view_ofs, TRUE, self); + if(trace_fraction != 1) + { + dist = vlen(org1 - org) /2; + org = org1 + (ang * dist); + traceline(org, org - '0 0 48', TRUE, self); + if(trace_fraction != 1) + { + SpawnTempWaypoint(org); + flag = TRUE; + } + } + } + } + } + self.b_angle_y = self.v_angle_y + 10; + frik_walkmove(v_forward); +}; diff --git a/QC/frikbot/bot_phys.qc b/QC/frikbot/bot_phys.qc new file mode 100644 index 00000000..c5d37751 --- /dev/null +++ b/QC/frikbot/bot_phys.qc @@ -0,0 +1,696 @@ +/*********************************************** +* * +* FrikBot Physics * +* The near-perfect emulation of * +* Client movement * +* * +* Special Thanks to: Asdf, Frog * +* Alan "Strider" Kivlin * +* * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +/* +========================================= + +Stuff mimicking cl_input.c code + +========================================= +*/ +float(float key) CL_KeyState = +{ + return ((self.keys & key) > 0); +}; + +void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles +{ + float anglespeed; + vector view; + if(self.keys != self.oldkeys) + { + self.movevect = '0 0 0'; + self.movevect_y = self.movevect_y + (350 * CL_KeyState(KEY_MOVERIGHT)); + // 350 is the default cl_sidespeed + self.movevect_y = self.movevect_y - (350 * CL_KeyState(KEY_MOVELEFT)); + // 350 is the default cl_sidespeed + self.movevect_x = self.movevect_x + (200 * CL_KeyState(KEY_MOVEFORWARD)); + // 200 is the default cl_forwardspeed + self.movevect_x = self.movevect_x - (200 * CL_KeyState(KEY_MOVEBACK)); + // 200 is the default cl_backspeed + self.movevect_z = self.movevect_z + (200 * CL_KeyState(KEY_MOVEUP)); + // 200 is the default cl_upspeed + self.movevect_z = self.movevect_z - (200 * CL_KeyState(KEY_MOVEDOWN)); + // 200 is the default cl_upspeed + if(!(self.b_aiflags & AI_PRECISION)) + self.movevect = self.movevect * 2; + // 2 is the default cl_movespeedkey & bot always has +speed + } + self.oldkeys = self.keys; + + if(self.b_skill != 2) // use mouse emulation + { + anglespeed = 1.5 * real_frametime; + // 1.5 is the default cl_anglespeedkey & bot always has +speed + self.v_angle_y = self.v_angle_y + anglespeed * CL_KeyState(KEY_LOOKLEFT) * 140; + // 140 is default cl_yawspeed + self.v_angle_y = self.v_angle_y - anglespeed * CL_KeyState(KEY_LOOKRIGHT) * 140; + // 140 is default cl_yawspeed + self.v_angle_x = self.v_angle_x - anglespeed * CL_KeyState(KEY_LOOKUP) * 150; + // 150 is default cl_pitchspeed + self.v_angle_x = self.v_angle_x + anglespeed * CL_KeyState(KEY_LOOKDOWN) * 150; + // 150 is default cl_pitchspeed + } + else + { + view_x = angcomp(self.b_angle_x, self.v_angle_x); + view_y = angcomp(self.b_angle_y, self.v_angle_y); + if(vlen(view) > 30) + { + self.mouse_emu = self.mouse_emu + (view * 30); + if(vlen(self.mouse_emu) > 180) + self.mouse_emu = normalize(self.mouse_emu) * 180; + } + else + self.mouse_emu = view * (1 / real_frametime); + self.v_angle = self.v_angle + self.mouse_emu * real_frametime; + + + } + if(self.v_angle_x > 80) + self.v_angle_x = 80; + else if(self.v_angle_x < -70) + self.v_angle_x = -70; + + if(self.v_angle_z > 50) + self.v_angle_z = 50; + else if(self.v_angle_z < -50) + self.v_angle_z = -50; + self.v_angle_y = frik_anglemod(self.v_angle_y); + +}; + +/* +========================================= + +Stuff mimicking sv_user.c + +========================================= +*/ +void() SV_UserFriction = +{ + vector vel, start, stop; + float sped, friction, newspeed; + + vel = self.velocity; + vel_z =0; + sped = vlen(vel); + vel = self.velocity; + + if(!sped) + return; + +// if the leading edge is over a dropoff, increase friction + + start_x = stop_x = self.origin_x + vel_x / (sped * 16); + start_y = stop_y = self.origin_y + vel_y / (sped * 16); + start_z = self.origin_z + self.mins_z; + stop_z = start_z - 34; + + traceline(start, stop, TRUE, self); + + if(trace_fraction == 1) + friction = sv_friction * 2; // 2 is default edgefriction, removed for QW compatability + else + friction = sv_friction; + if(sped < sv_stopspeed) + newspeed = sped - real_frametime * sv_stopspeed * friction; + else + newspeed = sped - real_frametime * sped * friction; + + if(newspeed < 0) + newspeed = 0; + newspeed = newspeed / sped; + + self.velocity_y = vel_y * newspeed; + self.velocity_x = vel_x * newspeed; +}; +void() SV_WaterJump = +{ + if(time > self.teleport_time || !self.waterlevel) + { + self.flags = self.flags - (self.flags & FL_WATERJUMP); + self.teleport_time = 0; + } + self.velocity_x = self.movedir_x; + self.velocity_y = self.movedir_y; +}; + +void() DropPunchAngle = +{ + float len; + len = vlen(self.punchangle); + self.punchangle = normalize(self.punchangle); + len = len - 10 * real_frametime; + if(len < 0) + len = 0; + self.punchangle = self.punchangle * len; +}; + + +void(vector wishvel) SV_AirAccelerate = +{ + float addspeed, wishspd, accelspeed, currentspeed; + + wishspd = vlen(wishvel); + wishvel = normalize(wishvel); + if(wishspd > 30) + wishspd = 30; + currentspeed = self.velocity * wishvel; + addspeed = wishspd - currentspeed; + if(addspeed <= 0) + return; + accelspeed = 10 * sv_accelerate * wishspd * real_frametime; + if(accelspeed > addspeed) + accelspeed = addspeed; + + self.velocity = self.velocity + accelspeed * wishvel; +}; + +void(vector wishvel) SV_Accelerate = +{ + float addspeed, wishspd, accelspeed, currentspeed; + + wishspd = vlen(wishvel); + wishvel = normalize(wishvel); + + currentspeed = self.velocity * wishvel; + addspeed = wishspd - currentspeed; + if(addspeed <= 0) + return; + accelspeed = sv_accelerate * wishspd * real_frametime; + if(accelspeed > addspeed) + accelspeed = addspeed; + + self.velocity = self.velocity + accelspeed * wishvel; +}; +void() SV_WaterMove = +{ + float max_speed; + max_speed = sv_maxspeed * 1.0; + + vector wishvel; + float wishspeed, addspeed, cspeed, newspeed; + + makevectors(self.v_angle); + wishvel = v_right * self.movevect_y + v_forward * self.movevect_x; + + if(self.movevect == '0 0 0') + wishvel_z = wishvel_z - 60; + else + wishvel_z = wishvel_z + self.movevect_z; + wishspeed = vlen(wishvel); + + if(wishspeed > max_speed) + { + wishvel = (max_speed / wishspeed) * wishvel; + wishspeed = max_speed; + } + wishspeed = wishspeed * 0.7; + cspeed = vlen(self.velocity); + if(cspeed) + { + newspeed = cspeed - (real_frametime * cspeed * sv_friction); + if(newspeed < 0) + newspeed = 0; + self.velocity = self.velocity * (newspeed / cspeed); + + } + else + newspeed = 0; + + if(!wishspeed) + return; + addspeed = wishspeed - newspeed; + if(addspeed <= 0) + return; + wishvel = normalize(wishvel); + cspeed = sv_accelerate * wishspeed * real_frametime; + if(cspeed > addspeed) + cspeed = addspeed; + self.velocity = self.velocity + cspeed * wishvel; +}; +void() SV_AirMove = +{ + float max_speed; + max_speed = sv_maxspeed * 1.0; + + vector wishvel, vangle; + + vangle = self.v_angle; + vangle_x = vangle_z = 0; + makevectors(vangle); + if(time < self.teleport_time && (self.movevect_x < 0)) + self.movevect_x = 0; + wishvel = v_right * self.movevect_y + v_forward * self.movevect_x; + + + if(self.movetype != MOVETYPE_WALK) + wishvel_z = self.movevect_z; + else + wishvel_z = 0; + if(vlen(wishvel) > max_speed) + wishvel = normalize(wishvel) * max_speed; + if(self.movetype == MOVETYPE_NOCLIP) + self.velocity = wishvel; + else if(self.flags & FL_ONGROUND) + { + SV_UserFriction(); + SV_Accelerate(wishvel); + } + else + SV_AirAccelerate (wishvel); +}; + +void() SV_ClientThink = +{ + vector vangle; + + if(self.movetype == MOVETYPE_NONE) + return; + DropPunchAngle(); + if(self.health <= 0) + return; + self.v_angle_z = 0; // V_CalcRoll removed, sucks + self.angles_z = self.v_angle_z * 4; + vangle = self.v_angle + self.punchangle; + if(!self.fixangle) + { + self.angles_x = (vangle_x / -3); + self.angles_y = vangle_y; + } else + { + self.v_angle = self.angles; + self.fixangle = 0; + } + if(self.flags & FL_WATERJUMP) + { + SV_WaterJump(); + return; + } + if((self.waterlevel >= 2) && (self.movetype != MOVETYPE_NOCLIP)) + { + SV_WaterMove(); + return; + } + SV_AirMove(); + +}; +/* +========================================= + +Stuff mimicking sv_phys.c + +========================================= +*/ + +float() SV_RunThink = +{ + float thinktime, bkuptime; + thinktime = self.nextthink; + bkuptime = time; + if(thinktime <= 0 || thinktime > (time + real_frametime)) + return TRUE; + if(thinktime < time) + thinktime = time; + self.nextthink = 0; + time = thinktime; + other = world; + makevectors(self.v_angle); // hack + self.think(); + time = bkuptime; + return TRUE; +}; + +void(float scale) SV_AddGravity = +{ + self.velocity_z = self.velocity_z - (scale * sv_gravity * real_frametime); +}; + +float() SV_CheckWater = +{ + vector point; + float cont; + + point_x = self.origin_x; + point_y = self.origin_y; + self.waterlevel = 0; + self.watertype = CONTENT_EMPTY; + point_z = self.origin_z + self.mins_z + 1; + cont = pointcontents(point); + if(cont <= CONTENT_WATER) + { + self.watertype = cont; + self.waterlevel = 1; + point_z = self.origin_z + (self.mins_z + self.maxs_z) * 0.5; + cont = pointcontents(point); + if(cont <= CONTENT_WATER) + { + self.waterlevel = 2; + point_z = self.origin_z + self.view_ofs_z; + cont = pointcontents(point); + if(cont <= CONTENT_WATER) + self.waterlevel = 3; + } + } + return (self.waterlevel > 1); + +}; +void() RemoveThud = // well sometimes +{ + entity oself; + if(other == world) + { + if(self.flags & FL_ONGROUND) + { + self.flags = self.flags - FL_ONGROUND; + } + } + else + { + if(other.solid == SOLID_BSP && (self.flags & FL_ONGROUND)) + { + // RM: Does this break anything? + // If not, then some more thuds have been removed. + self.flags = self.flags - FL_ONGROUND; + } + if(other == self.owner) + return; + if(self.owner.solid == SOLID_NOT) + return; + oself = other; + other = self.owner; + self = oself; + if(self.solid == SOLID_BSP) + if(self.touch) + self.touch(); + } + +}; +void() SV_CheckOnGround = +{ + vector org, v; + org = self.origin; + float currentflags; + currentflags = self.flags; + self.flags = self.flags | FL_ONGROUND | FL_PARTIALGROUND; + walkmove(0,0); // perform C touch function + self.flags = currentflags | FL_ONGROUND; + if((org_x != self.origin_x) || (org_y != self.origin_y)) + org = self.origin; + else + self.origin = org; + v = org; + v_z = self.maxs_z + org_z + 1; + traceline (org, v, TRUE, self); + if((self.waterlevel == 3) && (self.movetype == MOVETYPE_WALK)) + self.flags = self.flags - FL_ONGROUND; + else if((trace_plane_normal_z <= 0.7) && (trace_fraction != 1)) + self.flags = self.flags - FL_ONGROUND; + //~ else if(!droptofloor(0,0)) + else if(!droptofloor()) //~ hip_fbx bugfix + self.flags = self.flags - FL_ONGROUND; + else if(org_z - self.origin_z < 2) + self.flags = self.flags | FL_ONGROUND; + else + self.flags = self.flags - FL_ONGROUND; + setorigin(self, org); +}; +// Thanks to Alan Kivlin for this function +// modified heavily by me +float(vector dir) botCheckForStep = +{ + vector currentorigin, v; + float currentflags, yaw, stepdistance, movedistance; + currentorigin = self.origin; + currentflags = self.flags; + self.flags = FL_ONGROUND | FL_PARTIALGROUND; + dir = normalize(dir); + dir_z = 0; + yaw = vectoyaw(dir); + if(walkmove(yaw, 3)) + { + //~ if(droptofloor(0,0)) + if(droptofloor()) + { + stepdistance = self.origin_z - currentorigin_z; + v = self.origin - currentorigin; + v_z = 0; + movedistance = vlen(v); + if((stepdistance > 0 && stepdistance <= 16) && movedistance != 0) + { + self.flags = currentflags | FL_PARTIALGROUND; + return 1; + } + } + } + self.flags = currentflags; + v = currentorigin; + v_z = self.origin_z; + if(vlen(v - self.origin) <= 4) + setorigin(self, currentorigin); + return 0; +}; + +// this is merely here to fix a problem with e3m5 +void(vector dir) BruteForceStep = +{ + vector currentorigin; + float currentflags, i, len; + + currentorigin = self.origin; + currentflags = self.flags; + len = vlen(dir); + if(len > 16) + dir = normalize(dir) * 16; + + setorigin(self, currentorigin + dir); + + while(i < 18 && !walkmove(0, 0)) + { + self.origin_z = currentorigin_z + i; + i = i + 2; + } + + self.flags = currentflags; + + if(i >=18) + setorigin(self, currentorigin); +}; + +void() PostPhysics = +{ + vector obstr, org; + float back, dst,cflags; + + self = self.owner; + + self.velocity = self.velocity - self.phys_obj.dest1 + self.phys_obj.velocity; + if(self.phys_obj.dest2 == self.origin) + { + setorigin(self, self.phys_obj.origin); + // might've been moved during other person's physics + // (teleporters / plats) + + if(self.movetype == MOVETYPE_WALK) + { + if(self.phys_obj.dest1_x || self.phys_obj.dest1_y) + { + if((self.flags & FL_ONGROUND) || (self.waterlevel <= 2)) + { + obstr = self.phys_obj.movedir - self.origin; + obstr_z = 0; + if(vlen(obstr) > 0.1) + { + dst = vlen(obstr); + back = vectoyaw(obstr); + cflags = self.flags; + self.flags = self.flags | FL_PARTIALGROUND; + if(walkmove(back, dst)) + { + self.flags = cflags; + self.phys_obj.dest1_z = 0; + self.velocity = self.velocity + self.phys_obj.dest1 - self.phys_obj.velocity; + } + else + { + if(dst > 1) + { + frik_obstructed(obstr, FALSE); + } + + org = self.origin; + self.flags = cflags; + obstr = self.phys_obj.dest1; + obstr_x = 0; + if(!botCheckForStep(obstr)) + { + obstr = self.phys_obj.dest1; + obstr_y = 0; + if(!botCheckForStep(obstr)) + { + // if no steps were found, bot is really obstucted + BruteForceStep(self.phys_obj.dest1); + } + } + } + } + } + } + } + } + + + SV_CheckOnGround(); + PlayerPostThink(); + BotAI(); + + self.dmg_take = self.dmg_save = 0; +}; +// Avoid calling BotAI and the physics at the same time +// Can trip the runaway loop counter + +void() SV_FlyMove = +{ + // This is nothing like the Quake function. + + if(self.phys_obj == world) + { + self.phys_obj = find(world,classname,"phys_obj"); + while (self.phys_obj.owner != self) + { + self.phys_obj = find(self.phys_obj,classname,"phys_obj"); + if(self.phys_obj == world) + { + error("No physics entity spawned!\nMake sure BotInit was called\n"); + } + } + } + + setmodel(self.phys_obj, string_null); + self.phys_obj.movetype = MOVETYPE_STEP; + + self.phys_obj.solid = SOLID_TRIGGER; + self.phys_obj.touch = RemoveThud; + setsize(self.phys_obj, self.mins, self.maxs); + self.phys_obj.dest2 = self.phys_obj.origin = self.origin; + self.phys_obj.watertype = 0; + self.phys_obj.movedir = self.origin + real_frametime * self.velocity; + self.phys_obj.dest1 = self.phys_obj.velocity = self.velocity; + self.phys_obj.velocity_z = self.phys_obj.velocity_z + sv_gravity * real_frametime; + self.phys_obj.flags = 0; + self.phys_obj.think = PostPhysics; + self.phys_obj.nextthink = time; +}; + + +void() SV_Physics_Toss = +{ + if(!SV_RunThink()) + return; + if(self.flags & FL_ONGROUND) + { + self.velocity = '0 0 0'; + BotAI(); + return; + } + if(self.movetype != MOVETYPE_FLY) + SV_AddGravity(1); + self.angles = self.angles + real_frametime * self.avelocity; + SV_FlyMove(); + +}; +void() SV_Physics_Client = +{ + + PlayerPreThink(); + + if(self.movetype == MOVETYPE_NONE) + { + if(!SV_RunThink()) + return; + PlayerPostThink(); + BotAI(); + + } + else if((self.movetype == MOVETYPE_WALK) || (self.movetype == MOVETYPE_STEP)) + { + if(!SV_RunThink()) + return; + + if(!(SV_CheckWater()) && (!(self.flags & FL_WATERJUMP))) + SV_AddGravity(1); + + SV_FlyMove(); + } + else if((self.movetype == MOVETYPE_TOSS) || (self.movetype == MOVETYPE_BOUNCE)) + { + SV_Physics_Toss(); + } + else if(self.movetype == MOVETYPE_FLY) + { + if(!SV_RunThink()) + return; + SV_FlyMove(); + } + else if(self.movetype == MOVETYPE_NOCLIP) + { + if(!SV_RunThink()) + return; + self.origin = self.origin + real_frametime * self.velocity; + + PlayerPostThink(); + BotAI(); + } + else + error ("SV_Physics_Client: Bad Movetype (BOT)"); + +}; + + diff --git a/QC/frikbot/bot_way.qc b/QC/frikbot/bot_way.qc new file mode 100644 index 00000000..b0c5c3d8 --- /dev/null +++ b/QC/frikbot/bot_way.qc @@ -0,0 +1,1017 @@ + /*********************************************** +* * +* FrikBot Waypoints * +* "The better than roaming AI" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Linking code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +float (entity e1, entity e2) CheckLinked = +{ + if((e1 == e2) || (e2 == world) || (e1 == world)) + return FALSE; + else if(e1.target1 == e2) + { + if(e1.b_aiflags & AI_TELELINK_1) + return 2; + else return TRUE; + } + else if(e1.target2 == e2) + { + if(e1.b_aiflags & AI_TELELINK_2) + return 2; + else return TRUE; + } + else if(e1.target3 == e2) + { + if(e1.b_aiflags & AI_TELELINK_3) + return 2; + else return TRUE; + } + else if(e1.target4 == e2) + { + if(e1.b_aiflags & AI_TELELINK_4) + return 2; + else return TRUE; + } + + else return FALSE; +}; + + +float (entity e1, entity e2) LinkWays = +{ + if((e1 == e2) || (e2 == world) || (e1 == world)) + { + return FALSE; + } + else if(CheckLinked(e1, e2)) + { + return FALSE; // already linked!!! + } + + if(e1.target1 == world) + { + e1.target1 = e2; + return TRUE; + } + else if(e1.target2 == world) + { + e1.target2 = e2; + return TRUE; + } + else if(e1.target3 == world) + { + e1.target3 = e2; + return TRUE; + } + else if(e1.target4 == world) + { + e1.target4 = e2; + return TRUE; + } + else + { + return FALSE; + } + +}; +// Link Ways part 2, used only for teleporters + +float (entity e1, entity e2) TeleLinkWays = +{ + if((e1 == e2) || (e2 == world) || (e1 == world)) + return FALSE; + else if(CheckLinked(e1, e2)) + return FALSE; // already linked!!! + + if(e1.target1 == world) + { + e1.target1 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_1; + return TRUE; + } + else if(e1.target2 == world) + { + e1.target2 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_2; + return TRUE; + } + else if(e1.target3 == world) + { + e1.target3 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_3; + return TRUE; + } + else if(e1.target4 == world) + { + e1.target4 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_4; + return TRUE; + } + else + return FALSE; + +}; + +void (entity e1, entity e2) UnlinkWays = +{ + if((e1 == e2) || (e2 == world) || (e1 == world)) + return; + + if(!CheckLinked(e1, e2)) + return; + + if(e1.target1 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_1); + e1.target1 = world; + } + if(e1.target2 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_2); + e1.target2 = world; + } + if(e1.target3 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_3); + e1.target3 = world; + } + if(e1.target4 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_4); + e1.target4 = world; + } + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +FindWaypoint + +This is used quite a bit, by many different +functions big lag causer + +Finds the closest, fisible, waypoint to e + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +entity(entity start) FindWayPoint = +{ + vector org = realorigin(self); + + float dst; + entity best; + if(start != world) + { + dst = vlen(start.origin - org); + best = start; + } + else + { + dst = 100000; + best = world; + } + + float iterations = 0; + + for(entity t = way_head; t; t = t._next) + { + // real players cut through ignore types + if(dst < 20) + { + return best; + } + + if(!(t.b_aiflags & AI_IGNORE_TYPES) || self.ishuman) + { + float tdst = vlen(t.origin - org); + if(tdst < dst) + { + if(sisible(t)) + { + dst = tdst; + best = t; + } + } + } + } + + return best; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Spawning Code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +entity way_foot; // Ugh. Do I need a foot for this or not? + +entity(vector org) make_waypoint = +{ + entity point; + point = spawn(); + point.classname = "waypoint"; + point.solid = SOLID_TRIGGER; + point.movetype = MOVETYPE_NONE; + point.items = -1; + setorigin(point, org); + + setsize(point, VEC_HULL_MIN, VEC_HULL_MAX); + waypoints = waypoints + 1; + if(!way_head) + { + way_head = point; + way_foot = point; + } + else + { + way_foot._next = point; + point._last = way_foot; + way_foot = point; + } + + point.count = waypoints; + if(waypoint_mode > WM_LOADED) // editor modes + setmodel(point, "progs/s_bubble.spr"); + return point; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Dynamic Waypoint spawning and linking. Not +very good all things considered. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() DynamicWaypoint = +{ + entity t; + float dist = 0, dynlink = 0, dynpoint = 0, editor = 0; + + if(self.teleport_time > self.portal_time) + { + if(!(self.flags & FL_WATERJUMP)) + { + self.dyn_flags = 2; + if(!self.ishuman) + { + bot_lost(self.target1, TRUE); + self.enemy = world; + } + } + self.portal_time = self.teleport_time; + } +// stacking everything on waypoint_mode might've been good for the editor, +// but it sucks to beat hell for this code. + + +// convert waypoint_mode to something more usable.. + if(waypoint_mode > WM_LOADED) + { + if(self.ishuman) + { + if(waypoint_mode == WM_EDITOR_DYNLINK) + dynlink = 1; + else if(waypoint_mode == WM_EDITOR_DYNAMIC) + dynlink = dynpoint = 1; + editor = 1; + } + } + else if(waypoint_mode == WM_DYNAMIC) + dynlink = dynpoint = 1; + +// if there's nothing for dynamic to do.. + if(!dynpoint) + { + if(!editor) + return; + } +// for speed sake, I won't have bots dynamic waypoint in coop + if(!self.ishuman) + if(coop) + return; + +// don't waypoint in single player + if(max_clients < 2) + return; +// if you're dead + else if(self.health <= 0) + { + if(dynpoint) + { + if(self.current_way) + { + if(pointcontents(self.origin) < -4) + { + if(self.current_way.b_aiflags & AI_BLIND) + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; + } + } + } + self.dyn_dest = '0 0 0'; + self.current_way = world; + self.dyn_flags = 0; + return; + } + +// you shouldn't be making waypoints mid air + if(dynpoint) + { + if(!((self.flags & FL_ONGROUND) || self.waterlevel == 3)) + { + if(self.dyn_flags != 2) + { + self.dyn_flags = 1; + } + return; + } + } +// keep from doing the rest of this every frame + if(self.dyn_time > time) + return; + self.dyn_time = time + 0.2; + +// display the links for editor mode + if(editor) + { + if(self.current_way) + { + if(self.current_way.target1) + DeveloperLightning(self.current_way, self.current_way.target1, self.current_way.b_aiflags & AI_TELELINK_1); + if(self.current_way.target2) + DeveloperLightning(self.current_way, self.current_way.target2, self.current_way.b_aiflags & AI_TELELINK_2); + if(self.current_way.target3) + DeveloperLightning(self.current_way, self.current_way.target3, self.current_way.b_aiflags & AI_TELELINK_3); + if(self.current_way.target4) + DeveloperLightning(self.current_way, self.current_way.target4, self.current_way.b_aiflags & AI_TELELINK_4); + } + if(self.b_aiflags & AI_HOLD_SELECT) + return; + } + + t = FindWayPoint(self.current_way); + if(t) + { + dist = vlen(self.origin - t.origin); + if(dist < 192) + { + if(dist < 64) + { + + if(t != self.current_way) + { + if(dynlink) + { + if(!self.dyn_flags) + { + if(wisible(t, self.current_way)) + LinkWays(t, self.current_way); + } + if(self.dyn_flags == 2) + TeleLinkWays(self.current_way, t); + else if(wisible(t, self.current_way)) + LinkWays(self.current_way, t); + } + if(editor) + { + setmodel(t, "progs/s_light.spr"); + if(self.current_way) + setmodel(self.current_way, "progs/s_bubble.spr"); + } + } + self.current_way = t; + self.dyn_flags = 0; + } + self.dyn_dest = self.origin + self.view_ofs; + return; + } + } + + if(frik_recognize_plat(FALSE)) + { + if(vlen(trace_ent.velocity) > 0) + { + if(self.dyn_plat) + return; + self.dyn_plat = TRUE; + if(!self.dyn_flags) + self.dyn_flags = 1; + //bprint("on a plat!!!!!\n"); + } + else + self.dyn_plat = FALSE; + } + else + self.dyn_plat = FALSE; + + if(self.dyn_flags == 2) + self.dyn_dest = self.origin + self.view_ofs; + else if(self.dyn_dest == '0 0 0') + self.dyn_dest = self.origin + self.view_ofs; + if(!dynpoint) + return; + t = make_waypoint(self.dyn_dest); + + if(!self.dyn_flags) + { + if(wisible(t, self.current_way)) + LinkWays(t, self.current_way); + } + if(self.dyn_flags == 2) + TeleLinkWays(self.current_way, t); + else if(wisible(t, self.current_way)) + LinkWays(self.current_way, t); + + if(editor) + { + setmodel(t, "progs/s_light.spr"); + if(self.current_way) + setmodel(self.current_way, "progs/s_bubble.spr"); + } + self.current_way = t; + self.dyn_flags = 0; + + self.dyn_dest = self.origin + self.view_ofs; + + if(frik_recognize_plat(FALSE)) + { + if(trace_ent.classname == "door") + t.b_aiflags = t.b_aiflags | AI_DOORFLAG; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Loading from file + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClearAllWays = +{ + + entity t, n; + t = way_head; + while(t) + { + n = t._next; + remove(t); + t = n; + } + way_head = world; + way_foot = world; + waypoints = 0; +}; + +entity(float num) WaypointForNum = +{ + entity t; + if(!num) + return world; + + t = way_head; + while (t) + { + if(t.count == num) + return t; + t = t._next; + } + return world; +}; + +void() FixThisWaypoint = +{ + self.enemy.target1 = WaypointForNum(self.enemy.b_pants); + self.enemy.target2 = WaypointForNum(self.enemy.b_skill); + self.enemy.target3 = WaypointForNum(self.enemy.b_shirt); + self.enemy.target4 = WaypointForNum(self.enemy.b_frags); + self.enemy = self.enemy._next; + self.nextthink = time; + if(self.enemy == world) + { + remove(self); + fixer = world; + } +}; + +void() FixWaypoints = +{ + if(!fixer) + fixer = spawn(); + fixer.nextthink = time; + fixer.think = FixThisWaypoint; + fixer.enemy = way_head; +}; + + + +void(entity what) delete_waypoint = +{ + entity t; + + if(way_head == what) + way_head = what._next; + if(way_foot == what) + way_foot = what._last; + if(what._last) + what._last._next = what._next; + if(what._next) + what._next._last = what._last; + waypoints = 0; + t = way_head; + while(t) + { + t.count = waypoints = waypoints + 1; + if(CheckLinked(t, what)) + UnlinkWays(t, what); + t = t._next; + } + if(self.current_way == what) + self.current_way = world; + remove(what); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +FindRoute & FindThing used by the pathing code +in bot_ai.qc + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +entity(string s) FindThing = +{ + entity t; + float tdst, dst; + entity best; + dst = 100000; + best = world; + t = find (world, classname, s); + while (t != world) + { + tdst = vlen(((t.absmin + t.absmax) * 0.5) - self.origin); + if(tdst < dst) + { + dst = tdst; + best = t; + } + t = find(t, classname, s); + } + return best; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +FindRoute, this is a key function in the +pathing. The name is a bit misleading, this +code finds the closest waypoint that is part +of a route calculated by the begin_route and +end_route routines This is a definite path to +an object. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +entity(entity lastone) FindRoute = +{ + // kinda like FindWaypoint, only of this bots route though + entity t, best; + float dst, tdst, flag; + flag = ClientBitFlag(self.b_clientno); + + if(lastone) + { + if(lastone.target1.b_sound & flag) + return lastone.target1; + else if(lastone.target2.b_sound & flag) + return lastone.target2; + else if(lastone.target3.b_sound & flag) + return lastone.target3; + else if(lastone.target4.b_sound & flag) + return lastone.target4; + } + + t = way_head; + dst = 100000; + best = world; + while(t) + { + tdst = vlen(t.origin - self.origin); + if((tdst < dst) && (t.b_sound & flag)) + { + dst = tdst; + best = t; + } + t = t._next; + } + return best; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Route & path table management + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClearRouteTable = +{ + // cleans up route table + + entity t; + t = way_head; + while (t) + { + t. keys = FALSE; + t.enemy = world; + t.items = -1; // not in table + t = t._next; + } +}; + +void() ClearMyRoute = +{ + float flag; + entity t; + + flag = ClientBitFlag(self.b_clientno); + + t = way_head; + while (t) + { + t.b_sound = t.b_sound - (t.b_sound & flag); + t = t._next; + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Mark_path + +After the route has been found, mark it with +bitflags so the table can be used for a +different bot. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void(entity this) mark_path = +{ + entity t, oself; + float flag; + + ClearMyRoute(); + + oself = self; + self = this; + t = FindWayPoint(this.current_way); + self = oself; + // FIXME + // ugh, better way to find players please!!! + if(this.classname != "player") + this.current_way = t; + + if(t.enemy == world) + { + bot_lost(this, FALSE); + self.route_failed = TRUE; + return; + } + + flag = ClientBitFlag(self.b_clientno); + + while(t) + { + if(t.b_sound & flag) + return; + if(t == self.last_way) + return; + t.b_sound = t.b_sound | flag; + t = t.enemy; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +WaypointThink + +Calculates the routes. We use thinks to avoid +tripping the runaway loop counter + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity e2, float b_bit) FollowLink = +{ + float dist; + + if(self.b_aiflags & b_bit) + dist = self.items; + else + dist = vlen(self.origin - e2.origin) + self.items; + + // check if this is an RJ link + if(e2.b_aiflags & AI_SUPER_JUMP) + { + if(!bot_can_rj(route_table)) + return; + } + if(e2.b_aiflags & AI_DIFFICULT) + dist = dist + 1000; + + if((dist < e2.items) || (e2.items == -1)) + { + if(!e2.keys) + busy_waypoints = busy_waypoints + 1; + e2.keys = TRUE; + e2.items = dist; + e2.think = WaypointThink; + e2.nextthink = time; + e2.enemy = self; + } +}; + +void() WaypointThink = +{ + entity oself; + + if(self.items == -1) + return; + // can you say ugly? + if(self.b_aiflags & AI_TRACE_TEST) + { + if(self.target1) + { + traceline(self.origin, self.target1.origin, TRUE, self); + if(trace_fraction == 1) + FollowLink(self.target1, AI_TELELINK_1); + } + if(self.target2) + { + traceline(self.origin, self.target2.origin, TRUE, self); + if(trace_fraction == 1) + FollowLink(self.target2, AI_TELELINK_2); + } + if(self.target3) + { + traceline(self.origin, self.target3.origin, TRUE, self); + if(trace_fraction == 1) + FollowLink(self.target3, AI_TELELINK_3); + } + if(self.target4) + { + traceline(self.origin, self.target4.origin, TRUE, self); + if(trace_fraction == 1) + FollowLink(self.target4, AI_TELELINK_4); + } + } + else + { + if(self.target1) + FollowLink(self.target1, AI_TELELINK_1); + if(self.target2) + FollowLink(self.target2, AI_TELELINK_2); + if(self.target3) + FollowLink(self.target3, AI_TELELINK_3); + if(self.target4) + FollowLink(self.target4, AI_TELELINK_4); + } + + busy_waypoints = busy_waypoints - 1; + self.keys = FALSE; + + if(busy_waypoints <= 0) + { + if(direct_route) + { + oself = self; + self = route_table; + bot_get_path(self.target1, FALSE); + self = oself; + direct_route = FALSE; + } + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +begin_route and bot_get_path + +PLEASE NOTE: bot_get_path replaces the old +calls to begin_route. + +Routing isn't done all at once now, but in two +stages, the bot will calc a route *THEN* +choose a target, *THEN* mark a path. + +Boy it's confusing. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float() begin_route = +{ + if(busy_waypoints > 0) + return FALSE; + + if(route_table != world) + { + if(!route_table.ishuman) + { + if(route_table.b_clientno != -1) + return FALSE; + } + } + + route_table = self; + ClearRouteTable(); + self.last_way = FindWayPoint(self.current_way); + + if(self.last_way != world) + { + self.last_way.items = vlen(self.last_way.origin - self.origin); + self.last_way.nextthink = time; + self.last_way.think = WaypointThink; + self.last_way.keys = TRUE; + busy_waypoints = 1; + return TRUE; + } + else + { + route_table = world; + busy_waypoints = 0; + return FALSE; + } +}; + +void(entity this, float direct) bot_get_path = +{ + if(this == world) + return; + + if(route_table == self) + { + if(busy_waypoints <= 0) + { + route_table = world; + mark_path(this); + } + return; + } + if(direct) + { + if(begin_route()) + direct_route = TRUE; + else + bot_lost(this, FALSE); + return; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BSP/QC Waypoint loading + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() waypoint = +{ + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setorigin(self, self.origin); + + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + waypoints = waypoints + 1; + if(!way_head) + { + way_head = self; + way_foot = self; + } + else + { + way_foot._next = self; + self._last = way_foot; + way_foot = self; + } + + self.count = waypoints; + waypoint_mode = WM_LOADED; + if(self.count == 1) + { + localcmd("echo BSP waypoints detected\n"); + self.think = FixWaypoints; // wait until all bsp loaded points are spawned + self.nextthink = time; + } +}; + +void(vector org, vector bit1, float bit4, float flargs) make_way = +{ + entity y; + waypoint_mode = WM_LOADED; + y = make_waypoint(org); + y.b_aiflags = flargs; + y.b_pants = bit1_x; + y.b_skill = bit1_y; + y.b_shirt = bit1_z; + y.b_frags = bit4; + if(y.count == 1) + { + localcmd("echo QuakeC waypoints detected\n"); + y.think = FixWaypoints; // wait until all qc loaded points are spawned + y.nextthink = time; + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Temporary Marker code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(vector org) SpawnTempWaypoint = +{ + entity tep; + + if(!self.temp_way) + self.temp_way = tep = spawn(); + else + tep = self.temp_way; + + tep.classname = "temp_waypoint"; + tep.solid = SOLID_TRIGGER; + tep.movetype = MOVETYPE_NOCLIP; + setorigin(tep, org); + target_add(tep); + setsize(tep, VEC_HULL_MIN, VEC_HULL_MAX); // FIXME: convert these to numerical +}; diff --git a/QC/grapple.qc b/QC/grapple.qc deleted file mode 100644 index e3866594..00000000 --- a/QC/grapple.qc +++ /dev/null @@ -1,335 +0,0 @@ -// Rogue Grapple Implementation -// Jan'97 by ZOID <zoid@threewave.com> -// Under contract to id software for Rogue Entertainment - -// New entity fields -.entity hook; // this is my hook -.float on_hook; // we're on it -.float hook_out; // it's out - -.entity hook2; // (off-hand) this is my hook -.float on_hook2; // (off-hand) we're on it -.float hook_out2; // (off-hand) it's out - -.float handParm; - -void(float xHand, entity v) setHook = -{ - if(xHand == cVR_OffHand) self.hook2 = v; - else self.hook = v; -} - -void(float xHand, float v) setOnHook = -{ - if(xHand == cVR_OffHand) self.on_hook2 = v; - else self.on_hook = v; -} - -void(float xHand, float v) setHookOut = -{ - if(xHand == cVR_OffHand) self.hook_out2 = v; - else self.hook_out = v; -} - -entity(float xHand) getHook = -{ - if(xHand == cVR_OffHand) return self.hook2; - else return self.hook; -} - -float(float xHand) getOnHook = -{ - if(xHand == cVR_OffHand) return self.on_hook2; - else return self.on_hook; -} - -float(float xHand) getHookOut = -{ - if(xHand == cVR_OffHand) return self.hook_out2; - else return self.hook_out; -} - -void(float xHand, float v) setOwnerOnHook = -{ - if(xHand == cVR_OffHand) self.owner.on_hook2 = v; - else self.owner.on_hook = v; -} - -void(float xHand, float v) setOwnerHookOut = -{ - if(xHand == cVR_OffHand) self.owner.hook_out2 = v; - else self.owner.hook_out = v; -} - -float(float xHand) getOwnerOnHook = -{ - if(xHand == cVR_OffHand) return self.owner.on_hook2; - else return self.owner.on_hook; -} - -float(float xHand) getOwnerHookOut = -{ - if(xHand == cVR_OffHand) return self.owner.hook_out2; - else return self.owner.hook_out; -} - -float(float xHand) ownerFireButtonPressed = -{ - if(xHand == cVR_OffHand) return self.owner.button3; - else return self.owner.button0; -} - -// prototypes for WEAPONS.QC functions -float() crandom; -void(vector org, vector vel, float damage) SpawnBlood; - -void(entity h, vector startPos, vector endPos) GrappleTrail = -{ - // draw a line to the hook - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_BEAM); - WriteEntity(MSG_BROADCAST, h); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, startPos_x); - WriteCoord(MSG_BROADCAST, startPos_y); - WriteCoord(MSG_BROADCAST, startPos_z); - WriteCoord(MSG_BROADCAST, endPos_x); - WriteCoord(MSG_BROADCAST, endPos_y); - WriteCoord(MSG_BROADCAST, endPos_z); -}; - -void() GrappleResetFromHook = -{ - local float xHand; - xHand = self.handParm; - - setOwnerOnHook(xHand, FALSE); - setOwnerHookOut(xHand, FALSE); - VRSetWeaponFrame(xHand, 0); - VRSetAttackFinished(xHand, time + 0.25); - - remove(self); -}; - -void(float xHand) GrappleResetFromPlayer = -{ - setOwnerOnHook(xHand, FALSE); - setOwnerHookOut(xHand, FALSE); - VRSetWeaponFrame(xHand, 0); - VRSetAttackFinished(xHand, time + 0.25); - - remove(self); -}; - -void() GrappleTrack = -{ - local vector spray; - local float xHand; - - xHand = self.handParm; - - // Release dead targets - if(self.enemy.classname == "player" && self.enemy.health <= 0) - { - setOwnerOnHook(xHand, FALSE); - } - - // drop the hook if owner is dead or has released the button - if(!getOwnerOnHook(xHand) || self.owner.health <= 0) - { - GrappleResetFromHook(); - return; - } - - if(self.enemy.classname == "player") - { - if(self.enemy.teleport_time > time) - { - GrappleResetFromHook(); - return; - } - - // move the hook along with the player. It's invisible, but - // we need this to make the sound come from the right spot - setorigin(self, self.enemy.origin); - -// sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); - sound(self, CHAN_WEAPON, "pendulum/hit.wav", 1, ATTN_NORM); - T_Damage (self.enemy, self, self.owner, 1); - makevectors (self.v_angle); - spray_x = 100 * crandom(); - spray_y = 100 * crandom(); - spray_z = 100 * crandom() + 50; - SpawnBlood(self.origin, spray, 20); - } - if(self.enemy.solid == SOLID_SLIDEBOX) { - self.velocity = '0 0 0'; - setorigin(self, self.enemy.origin + self.enemy.mins + - self.enemy.size * 0.5); - } else - self.velocity = self.enemy.velocity; - - self.nextthink = time + 0.1; -}; - -// Tries to anchor the grapple to whatever it touches -void () GrappleAnchor = -{ - local float xHand; - - xHand = self.handParm; - - if(other == self.owner) // don't hook the guy that fired it - return; - - if(pointcontents(self.origin) == CONTENT_SKY) { - - // TODO VR: (P1) never prints: - bprint("Grapple sky\n"); - - GrappleResetFromHook(); - return; - } - - if(other.classname == "player") - { - // glance off of teammates - // TODO VR: (P2) rogue - // if(other.steam == self.owner.steam) - // { - // GrappleReset(); // PGM - fix drift after teammate hit 01/20/97 - // return; - // } - - sound(self, CHAN_WEAPON, "player/axhit1.wav", 1, ATTN_NORM); - T_Damage (other, self, self.owner, 10); - } else { - sound(self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); - - // One point of damage inflicted upon impact. Subsequent - // damage will only be done to PLAYERS... this way secret - // doors and triggers will only be damaged once. - if(other.takedamage) - { - T_Damage (other, self, self.owner, 1); - } - - self.velocity = '0 0 0'; - self.avelocity = '0 0 0'; - } - - self.frame = 2; // anchored - - sound(self.owner, CHAN_WEAPON, "weapons/tink1.wav", 1, ATTN_NORM); - particle2(self.origin, '0 0 0', 0 /* bullet puff preset */, 48); - - if(!ownerFireButtonPressed(xHand)) { - GrappleResetFromHook(); - return; - } - - setOwnerOnHook(xHand, TRUE); - if(self.owner.flags & FL_ONGROUND) - self.owner.flags = self.owner.flags - FL_ONGROUND; - - self.enemy = other;// remember this guy! - self.think = GrappleTrack; - self.nextthink = time; - self.solid = SOLID_NOT; - self.touch = SUB_Null; -}; - -void (float xHand) W_FireGrapple = -{ - if(getHookOut(xHand))// reject subsequent calls from player.qc - return; - - VRGunHaptic(xHand, 0.55, 75, 1.0); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 5 /* sparks preset */, 8); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 1); - - self.punchangle_x = -2; // bump him - - // chain out sound(loops) - sound(self, CHAN_WEAPON, "weapons/chain1.wav", 1, ATTN_NORM); - - newmis = spawn(); - newmis.handParm = xHand; - newmis.movetype = MOVETYPE_FLYMISSILE; - newmis.solid = SOLID_BBOX; - newmis.owner = self; // newmis belongs to me - setHook(xHand, newmis); // This is my newmis - newmis.classname = "hook"; - - makevectors (VRGetHandRot(xHand)); - newmis.velocity = v_forward * 1500; -// newmis.avelocity = '0 0 -500'; - newmis.angles = vectoangles(v_forward); - - newmis.touch = GrappleAnchor; - newmis.think = GrappleResetFromHook; - // grapple only lives for two seconds, this gives max range on it - newmis.nextthink = time + 1.8; - newmis.frame = 1; // hook spread - - setmodel (newmis,"progs/hook.mdl"); - setorigin (newmis, VRGetMuzzlePos(xHand) + v_forward * 6); - setsize(newmis, '0 0 0' , '0 0 0 '); - - setHookOut(xHand, TRUE); -}; - -// called each frame by CLIENT.QC if client has hook_out -void(float xHand) GrappleService = -{ - local vector vel, hookfwd; - local float v, dot; - local entity xHook; - - xHook = getHook(xHand); - - makevectors (xHook.angles); - hookfwd = v_forward; - - makevectors (VRGetHandRot(xHand)); - - if(!getOnHook(xHand)) { - // TODO VR: (P2) still wonky position on hook , dunno why - GrappleTrail(xHook, xHook.origin - hookfwd * 6.5, VRGetMuzzlePos(xHand) + v_forward * 1.5); - return; - } - - // drop the hook if player lets go of button - if((!VRGetFireButtonPressed(xHand)) || - self.teleport_time > time || - VRGetWeapon(xHand) != WID_GRAPPLE) - { // release when we get 'ported - self = xHook; - GrappleResetFromPlayer(xHand); - return; - } - - vel = xHook.origin - VRGetMuzzlePos(xHand); - v = vlen (vel); - - // if(v <= 250) - // { - // vel = normalize(vel) * 250; - // } - - if(v >= 350) - { - vel = normalize(vel) * 350; - } - - dot = vel * self.velocity; - - if(dot < 0 || vlen(self.velocity) < 800) - { - self.velocity = self.velocity + (vel * 8 * frametime); - } - - GrappleTrail(xHook, xHook.origin - hookfwd * 6.5, VRGetMuzzlePos(xHand) + v_forward * 1.5); -}; - - diff --git a/QC/hip_brk.qc b/QC/hip_brk.qc index bb6a4d0f..5d52fbcc 100644 --- a/QC/hip_brk.qc +++ b/QC/hip_brk.qc @@ -9,25 +9,26 @@ float MULTI_USE = 1; float INVISIBLE = 2; void() damagethreshold_killed = - { +{ self.health = self.max_health; // self.solid = SOLID_NOT; - activator = damage_attacker; + + activator = damage_attacker; self.takedamage = DAMAGE_NO; SUB_UseTargets(); self.takedamage = DAMAGE_YES; - if( !( self.spawnflags & MULTI_USE ) ) - { - remove( self ); - } - }; + if(!(self.spawnflags & MULTI_USE)) + { + remove(self); + } +}; void(entity attacker, float damage) damagethreshold_pain = - { +{ self.health = self.max_health; - }; +}; /*QUAKED trigger_damagethreshold (0 .5 .8) ? MULTI_USE INVISIBLE Triggers only when a threshold of damage is exceeded. @@ -45,48 +46,114 @@ Default is 60. */ void() trigger_damagethreshold = - { self.mangle = self.angles; self.angles = '0 0 0'; self.classname = "damagethreshold"; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - if( self.spawnflags & INVISIBLE ) - { - self.model = string_null; - } + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + + setorigin(self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins , self.maxs); + + if(self.spawnflags & INVISIBLE) + { + self.model = string_null; + } if(!self.health) - { + { self.health = 60; - } + } + self.max_health = self.health; self.takedamage = DAMAGE_YES; self.blocked = SUB_Null; self.th_pain = damagethreshold_pain; self.th_die = damagethreshold_killed; - }; +}; /*QUAKED func_breakawaywall (0 .5 .8) ? Special walltype that removes itself when triggered. */ void() func_breakawaywall = - { +{ self.mangle = self.angles; self.angles = '0 0 0'; self.classname = "breakaway"; self.solid = SOLID_BSP; self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); + setorigin(self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins , self.maxs); self.use = SUB_Remove; - }; +}; + + +// TODO VR: (P1) organize +void() breakablewallwithrubble_killed = +{ + activator = damage_attacker; + SUB_UseTargets(); + + self.origin = realorigin(self); + hip_rubble_use(); + + remove(self); +}; + +void() func_breakablewallwithrubble_think +{ + /*vector bottom = self.origin; + bottom_z += self.mins_z; + + traceline(bottom + '0 0 -1', bottom + '0 0 -2', FALSE, self); + + if(trace_fraction == 1.0) + { + setorigin(self, self.origin + '0 0 -1'); + } + + + self.nextthink = time + 0.01;*/ +} + +void() func_breakablewallwithrubble +{ + precache_model("progs/rubble1.mdl"); + precache_model("progs/rubble2.mdl"); + precache_model("progs/rubble3.mdl"); + precache_sound("zombie/z_hit.wav"); + + self.mangle = self.angles; + self.angles = '0 0 0'; + + self.classname = "breakablewallwithrubble"; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_NONE; + + setorigin(self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins, self.maxs); + + if(!self.health) + { + self.health = 10; + } + + self.takedamage = DAMAGE_YES; + + self.blocked = SUB_Null; + self.th_pain = SUB_NullPain; + self.th_die = breakablewallwithrubble_killed; + + self.cnt = 0; + + // self.think = func_breakablewallwithrubble_think; + // self.nextthink = time + 0.01; +} diff --git a/QC/hip_clock.qc b/QC/hip_clock.qc new file mode 100644 index 00000000..0ea6ca6d --- /dev/null +++ b/QC/hip_clock.qc @@ -0,0 +1,87 @@ +/* Clock QuickC program + By Jim Dose' 11/25/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +void() clock_setpos = + { + float pos; + float ang; + float seconds; + string temp; + + // How much time has elapsed. + seconds = time + self.cnt; + + // divide by time it takes for one revolution + pos = seconds / self.count; + + // chop off non-fractional component + pos = pos - floor(pos); + + ang = 360 * pos; + if(self.event != NULLSTR) + { + if(self.ltime > ang) + { + // past twelve + temp = self.target; + self.target = self.event; + SUB_UseTargets(); + self.target = temp; + } + } + + self.angles_x = ang * self.movedir_x; + self.angles_y = ang * self.movedir_y; + self.angles_z = ang * self.movedir_z; + RotateTargetsFinal(); + + self.ltime = ang; + }; + +void() clock_think = + { + clock_setpos(); + self.nextthink = time + 1; + }; + +void() clock_firstthink = + { + LinkRotateTargets(); + self.think = clock_think; + clock_think(); + }; + +/*QUAKED func_clock (0 0 0.5) (0 0 0) (32 32 32) +Creates one hand of a "clock". + +Set the angle to be the direction the clock is facing. + +"event" is the targetname of the entities to trigger when hand strikes 12. +"cnt" is the time to start at. +"count" is the # of seconds it takes to make a full revolution (seconds is 60, minutes 3600, hours 43200). default is 60. +*/ + +void() func_clock = + { + vector temp; + + self.classname = "clock"; + self.think = clock_firstthink; + self.nextthink = time + 0.1; + self.ltime = time; + SetMovedir(); + temp = self.movedir; + self.movedir_x = 0 - temp_y; + self.movedir_y = 0 - temp_z; + self.movedir_z = 0 - temp_x; + + if(!self.count) + { + self.count = 60; + } + self.cnt = self.cnt * (self.count / 12); + }; diff --git a/QC/hip_count.qc b/QC/hip_count.qc new file mode 100644 index 00000000..f689c2e4 --- /dev/null +++ b/QC/hip_count.qc @@ -0,0 +1,188 @@ +/* Counter QuickC program + By Jim Dose' 9/13/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +float COUNTER_TOGGLE = 1; +float COUNTER_LOOP = 2; +float COUNTER_STEP = 4; +float COUNTER_RESET = 8; +float COUNTER_RANDOM = 16; +float COUNTER_FINISHCOUNT = 32; +float COUNTER_START_ON = 64; + +void() counter_think = + { + self.cnt = self.cnt + 1; + if(self.spawnflags & COUNTER_RANDOM) + { + self.state = random() * self.count; + self.state = floor(self.state) + 1; + } + else + { + self.state = self.cnt; + } + + activator = other; + SUB_UseTargets(); + self.nextthink = time + self.wait; + + if(self.spawnflags & COUNTER_STEP) + { + counter_on_use(); + } + + if(self.cnt >= self.count) + { + self.cnt = 0; + if((self.aflag) || !(self.spawnflags & COUNTER_LOOP)) + { + if(self.spawnflags & COUNTER_TOGGLE) + { + counter_on_use(); + } + else + { + remove(self); + } + } + } + }; + +void() counter_on_use = + { + if((self.cnt != 0) && (self.spawnflags & COUNTER_FINISHCOUNT)) + { + self.aflag = TRUE; + return; + } + + self.use = counter_off_use; + self.think = SUB_Null; + self.aflag = FALSE; + }; + +void() counter_off_use = + { + self.aflag = FALSE; + if(self.spawnflags & COUNTER_TOGGLE) + { + self.use = counter_on_use; + } + else + { + self.use = SUB_Null; + } + + if(self.spawnflags & COUNTER_RESET) + { + self.cnt = 0; + self.state = 0; + } + self.think = counter_think; + if(self.delay) + { + self.nextthink = time + self.delay; + } + else + { + counter_think(); + } + }; + +float(entity counter) counter_GetCount = +{ + if(counter.classname == "counter") + { + return counter.state; + } + + return 0; +}; + +/*QUAKED func_counter (0 0 0.5) (0 0 0) (32 32 32) TOGGLE LOOP STEP RESET RANDOM FINISHCOUNT START_ON +TOGGLE causes the counter to switch between an on and off state +each time the counter is triggered. + +LOOP causes the counter to repeat infinitly. The count resets to zero +after reaching the value in "count". + +STEP causes the counter to only increment when triggered. Effectively, +this turns the counter into a relay with counting abilities. + +RESET causes the counter to reset to 0 when restarted. + +RANDOM causes the counter to generate random values in the range 1 to "count" +at the specified interval. + +FINISHCOUNT causes the counter to continue counting until it reaches "count" +before shutting down even after being set to an off state. + +START_ON causes the counter to be on when the level starts. + +"count" specifies how many times to repeat the event. If LOOP is set, +it specifies how high to count before reseting to zero. Default is 10. + +"wait" the length of time between each trigger event. Default is 1 second. + +"delay" how much time to wait before firing after being switched on. +*/ + +void() func_counter = + { + if(!self.wait) + { + self.wait = 1; + } + + self.count = floor(self.count); + if(self.count <= 0) + { + self.count = 10; + } + self.cnt = 0; + self.state = 0; + + self.classname = "counter"; + self.use = counter_off_use; + self.think = SUB_Null; + if(self.spawnflags & COUNTER_START_ON) + { + self.think = counter_off_use; + self.nextthink = time + 0.1; + } + }; + +void() oncount_use = + { + if(counter_GetCount(other) == self.count) + { + activator = other; + SUB_UseTargets(); + } + }; + +/*QUAKED func_oncount (0 0 0.5) (0 0 0) (16 16 16) +Must be used as the target for func_counter. When the counter +reaches the value set by count, func_oncount triggers its targets. + +"count" specifies the value to trigger on. Default is 1. + +"delay" how much time to wait before firing after being triggered. +*/ + +void() func_oncount = + { + self.count = floor(self.count); + if(self.count <= 0) + { + self.count = 1; + } + + self.classname = "oncount"; + self.use = oncount_use; + self.think = SUB_Null; + }; diff --git a/QC/hip_decoy.qc b/QC/hip_decoy.qc new file mode 100644 index 00000000..a859ec34 --- /dev/null +++ b/QC/hip_decoy.qc @@ -0,0 +1,173 @@ +/* +============================================================================== + +PLAYER decoy + +============================================================================== +*/ + +$cd id1/models/player_4 +$origin 0 -6 24 +$base base +$skin skin + +// +// running +// +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 + +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 + +// +// standing +// +$frame stand1 stand2 stand3 stand4 stand5 + +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 + + +void() decoy_stand1 =[ $axstnd1, decoy_stand1 ] + { + ChangeYaw(); + if(self.walkframe >= 5) + self.walkframe = 0; + self.frame = $stand1 + self.walkframe; + self.walkframe = self.walkframe + 1; + if(time > self.pausetime) + self.th_walk(); + }; + +void(entity attacker, float damage) decoy_stand1_pain = +{ + decoy_stand1(); +} + +void() decoy_walk1 =[ $rockrun1, decoy_walk1 ] + { +// vector a; + movetogoal (12); +// a = '0 0 0'; +// a_y = self.ideal_yaw; +// makevectors(a); +// self.velocity = 1*v_forward; + self.weaponframe=0; + if(self.walkframe == 6) + self.walkframe = 0; + if(self.walkframe == 2 || self.walkframe == 5) + { + float r; + r = random(); + if(r < 0.14) + sound(self, CHAN_VOICE, "misc/foot1.wav", 0.5, ATTN_NORM); + else if(r < 0.29) + sound(self, CHAN_VOICE, "misc/foot2.wav", 0.5, ATTN_NORM); + else if(r < 0.43) + sound(self, CHAN_VOICE, "misc/foot3.wav", 0.5, ATTN_NORM); + else if(r < 0.58) + sound(self, CHAN_VOICE, "misc/foot4.wav", 0.5, ATTN_NORM); + else if(r < 0.72) + sound(self, CHAN_VOICE, "misc/foot5.wav", 0.5, ATTN_NORM); + else if(r < 0.86) + sound(self, CHAN_VOICE, "misc/foot6.wav", 0.5, ATTN_NORM); + else + sound(self, CHAN_VOICE, "misc/foot7.wav", 0.5, ATTN_NORM); + } + self.frame = self.frame + self.walkframe; + self.walkframe = self.walkframe + 1; + }; + +void(entity decoy) setup_decoy = +{ + entity pl; + + decoy.classname = "monster_decoy"; + setmodel(decoy, "progs/player.mdl"); + setsize(decoy, VEC_HULL_MIN, VEC_HULL_MAX); + decoy.view_ofs = '0 0 22'; + + decoy.solid = SOLID_SLIDEBOX; + decoy.movetype = MOVETYPE_STEP; + + decoy.health = 3000000; + + decoy.th_stand = decoy_stand1; + decoy.th_walk = decoy_walk1; + decoy.th_run = decoy_walk1; + decoy.th_missile = decoy_stand1; + decoy.th_pain = decoy_stand1_pain; + decoy.th_die = decoy_stand1; + + pl = find(world, classname, "player"); + decoy.colormap = pl.colormap; +}; + +/*QUAKED monster_decoy (1 0 0) (-16 -16 -24) (16 16 40) +*/ +void() monster_decoy = +{ + if(deathmatch) + { + remove(self); + return; + } + setup_decoy(self); + + walkmonster_start(); + total_monsters = total_monsters - 1; +}; + +void(string targ, vector orig) become_decoy = +{ + entity decoy; + entity temp; + + decoy = hipdecoy = spawn(); + + temp = self; + self = decoy; + + setup_decoy(decoy); + + setorigin(decoy, orig); + + decoy.origin = orig; + + decoy.target = targ; + + decoy.takedamage = DAMAGE_AIM; + + decoy.ideal_yaw = decoy.angles * '0 1 0'; + if(!decoy.yaw_speed) + decoy.yaw_speed = 20; + decoy.use = monster_use; + + decoy.flags = decoy.flags | FL_MONSTER; + + if(decoy.target != NULLSTR) + { + decoy.goalentity = decoy.movetarget = find(world, targetname, decoy.target); + decoy.ideal_yaw = vectoyaw(decoy.goalentity.origin - decoy.origin); + if(!decoy.movetarget) + { + dprint("Monster can't find target at "); + dprint(vtos(decoy.origin)); + dprint("\n"); + } +// this used to be an objerror + if(decoy.movetarget.classname == "path_corner") + decoy.th_walk(); + else + decoy.pausetime = 99999999; + decoy.th_stand(); + } + else + { + decoy.pausetime = 99999999; + decoy.th_stand(); + } + +// spread think times so they don't all happen at same time + decoy.nextthink = decoy.nextthink + random()*0.5; + self = temp; +}; diff --git a/QC/hip_defs.qc b/QC/hip_defs.qc new file mode 100644 index 00000000..124fb656 --- /dev/null +++ b/QC/hip_defs.qc @@ -0,0 +1,112 @@ +/* Level pack definitons + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +entity nullentity; +entity bulletholes; +entity lastbullet; +float numbulletholes; +float lastbulletholeroll; + +//added update stat message +float SVC_UPDATESTAT = 3; +float SVC_CUTSCENE = 34; +//added total monster message +float STAT_TOTALMONSTERS = 12; +float STAT_TOTALSECRETS = 11; +.void() th_turn; +float AS_DODGING = 5; +float CHARMED_RADIUS = 1500; +float MAX_CHARMER_DISTANCE = 200; +float MIN_CHARMER_DISTANCE = 150; +float TOOCLOSE_CHARMER_DISTANCE = 120; +float visible_distance; +entity damage_inflictor; +float footsteps; + +// Hipnotic Constants +float MIN_ANGLE_DELTA = 10; + +.float wetsuit_finished; +.float wetsuit_time; +.float empathy_finished; +.float empathy_time; +.float empathy_sound; +.float color; + +// +// Hipnotic entries +// +// have to use a new items flag because we ran out of bits in the original +.float hipnotic_items; +// gremlin stuff +.float gorging; +.float stoleweapon; +.entity lastvictim; +// spawn variables +.void() spawnfunction; +.string spawnclassname; +.float spawnsolidtype; +.string spawnmodel; +.void() spawnthink; +.entity spawnmaster; +.vector spawnmins; +.vector spawnmaxs; +.float spawnsilent; +.float spawnmulti; +// horn of conjuring +.float charmed; +.entity charmer; +.float huntingcharmer; +float horn_active; +entity horn_charmer; +// laser cannon +.vector old_velocity; +//misc +.float duration; +// used for linked list of entities +.entity next_ent; +// Mjolnir +.float struck_by_mjolnir; +// teleport invulnerability +.float last_teleport_time; + +// Rotation +.vector neworigin; +.vector rotate; +.float endtime; +.float rotate_type; +.string path; +.string group; +.string event; + +// Miscellaneous +.float gravity; + +//MED 01/05/97 added discharge variable +float discharged; +//MED 01/05/97 added hipnotic decoy +entity hipdecoy; +// +// Hipnotic's Prototypes +// +void() StopEarthQuake; +void(float value) EarthQuakeTime; +void() earthquake_postthink; +void() earthquake_prethink; +float(entity counter) counter_GetCount; +vector (vector ang) SUB_NormalizeAngles; +void (entity srcent, entity destent) SUB_CopyEntity; +//multi explosion +void(vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion; +void(string targ, vector orig) become_decoy; + + +//void(vector origin, vector dir, float color, float count, float lifespan) particlestream = #79; + +void() RotateTargets; +void() RotateTargetsFinal; +void() SetTargetOrigin; +void() LinkRotateTargets; diff --git a/QC/hip_expl.qc b/QC/hip_expl.qc index bc4b9aee..df38046f 100644 --- a/QC/hip_expl.qc +++ b/QC/hip_expl.qc @@ -7,11 +7,9 @@ float USE_PARTICLES = 1; -void() BecomeExplosion; - void() exploder_fire = { - local entity temp; + entity temp; temp = self; activator = other; @@ -26,14 +24,12 @@ void() exploder_fire = { sound(self , CHAN_AUTO, "misc/longexpl.wav", self.volume, self.speed); } - T_RadiusDamage (self, self.owner, self.dmg, other); + T_RadiusDamage(self, self.owner, self.dmg, other); if(self.spawnflags & USE_PARTICLES) { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); + WriteVec3(MSG_BROADCAST, self.origin); } BecomeExplosion(); }; @@ -66,19 +62,19 @@ void() func_exploder = precache_sound("misc/longexpl.wav"); self.classname = "exploder"; self.use = exploder_use; - if( self.dmg == 0 ) + if(self.dmg == 0) { self.dmg = 120; } - if( self.dmg < 0 ) + if(self.dmg < 0) { self.dmg = 0; } - if( self.speed == 0 ) + if(self.speed == 0) { self.speed = 1; } - if( self.volume == 0 ) + if(self.volume == 0) { self.volume = 1.0; } @@ -86,8 +82,8 @@ void() func_exploder = void() multi_exploder_fire = { - local entity temp; - local entity expl; + entity temp; + entity expl; self.nextthink = time + self.wait; if(self.state == 0) @@ -112,14 +108,12 @@ void() multi_exploder_fire = expl.origin_y = self.absmin_y + (random() * (self.absmax_y - self.absmin_y)); expl.origin_z = self.absmin_z + (random() * (self.absmax_z - self.absmin_z)); sound(expl , CHAN_VOICE, "misc/shortexp.wav", self.volume, self.speed); - T_RadiusDamage (expl, self.owner, self.dmg, other); + T_RadiusDamage(expl, self.owner, self.dmg, other); if(self.spawnflags & USE_PARTICLES) { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, expl.origin_x); - WriteCoord(MSG_BROADCAST, expl.origin_y); - WriteCoord(MSG_BROADCAST, expl.origin_z); + WriteVec3(MSG_BROADCAST, expl.origin); } temp = self; self = expl; @@ -127,9 +121,9 @@ void() multi_exploder_fire = self = temp; }; -void( vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion = +void(vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion = { - local entity temp; + entity temp; temp = self; self = spawn(); @@ -184,11 +178,11 @@ void() func_multi_exploder = self.movetype = MOVETYPE_NONE; self.modelindex = 0; self.model = ""; - if( self.dmg == 0 ) + if(self.dmg == 0) { self.dmg = 120; } - if( self.dmg < 0 ) + if(self.dmg < 0) { self.dmg = 0; } diff --git a/QC/hip_holes.qc b/QC/hip_holes.qc new file mode 100644 index 00000000..6327ba11 --- /dev/null +++ b/QC/hip_holes.qc @@ -0,0 +1,124 @@ +/* Bullet holes QuickC program + By Jim Dose' 11/20/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +/*QUAKED wallsprite (0 1 0) (-8 -8 -8) (8 8 8) +Places a sprite on a wall. Angles should be opposite of face. + +"model" sprite to place on wall. Default is "progs/s_blood1.spr". +*/ +void() wallsprite = + { + if(!self.model) + { + self.model = "progs/s_blood1.spr"; + } + + precache_model(self.model); + setmodel(self, self.model); + + // QuakeEd doesn't save up and down angles properly. + if(self.angles == '0 -1 0') + self.angles = '-90 0 0'; + else if(self.angles == '0 -2 0') + self.angles = '90 0 0'; + + // Pull the sprite away from the wall slightly to + // get rid of z sort errors. + makeforward(self.angles); + setorigin(self, self.origin - (v_forward * 0.2)); + makestatic(self); + }; + +void() InitBulletHoles = + { + precache_model("progs/s_bullet.spr"); + + bulletholes = nullentity; + lastbullet = nullentity; + numbulletholes = 0; + lastbulletholeroll = 0; + }; + +void() remove_bullethole = + { + entity ent; + + // There is a possibility that this is not the first bullet + // in the list, but it doesn't really matter. All that + // matters is there is one less bullet. Just make sure + // we don't remove the world! + if(bulletholes == nullentity) + { + objerror("remove_bullethole: bulletholes == nullentity! "); + } + + ent = bulletholes; + if(ent.classname != "bullethole") + { + objerror("remove_bullethole: Tried to remove non-bullethole!"); + } + + bulletholes = bulletholes.lastvictim; + remove(ent); + if(lastbullet == ent) + { + lastbullet = nullentity; + } + numbulletholes = numbulletholes - 1; + }; + +void(vector pos) placebullethole = +{ + entity new; + vector norm; + + new = spawn(); + new.owner = new; + new.movetype = MOVETYPE_NONE; + new.solid = SOLID_NOT; + new.classname = "bullethole"; + setmodel(new, "progs/s_bullet.spr"); + setsize(new, '0 0 0', '0 0 0'); + + norm = trace_plane_normal; + norm_x = 0 - norm_x; + norm_y = 0 - norm_y; + new.angles = vectoangles(norm); + new.angles_z = lastbulletholeroll; + + lastbulletholeroll = lastbulletholeroll + 35 + 15 * random(); + + if(lastbulletholeroll > 360) + { + lastbulletholeroll = 0; + } + + makeforward_mdl(self.angles); + setorigin(new, pos - (v_forward * (0.03 + new.angles_z / 450))); + // try to avoid z-fighting for overlapping sprites + + new.think = remove_bullethole; + new.nextthink = time + 250 + (150 * random()); + + numbulletholes = numbulletholes + 1; + if(numbulletholes > 64) + { + remove_bullethole(); + } + + if(lastbullet != nullentity) + { + lastbullet.lastvictim = new; + } + else + { + bulletholes = new; + } + + new.lastvictim = nullentity; + lastbullet = new; +}; diff --git a/QC/hip_items.qc b/QC/hip_items.qc new file mode 100644 index 00000000..9b0ba547 --- /dev/null +++ b/QC/hip_items.qc @@ -0,0 +1,847 @@ +/* Items QuickC program + By Jim Dose' 9/13/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +float UNDERWATER = 2; + +/* +=============================================================================== + +HIPNOTIC ITEMS + +=============================================================================== +*/ +// +// HIP_powerup_touch function +// +void() HIP_powerup_touch = +{ + if(other.classname != "player") + return; + if(other.health <= 0) + return; + + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other,"\n"); + + if(deathmatch) + { + self.mdl = self.model; + +// if((self.classname == "item_artifact_invulnerability") || +// (self.classname == "item_artifact_invisibility")) +// self.nextthink = time + 60*5; +// else + self.nextthink = time + 60; + + self.think = SUB_regen; + } + + sound(other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + stuffcmd(other, "bf\n"); + self.solid = SOLID_NOT; + VR_ItemUtil_EntAddItem(other, self.vr_itemId); + self.model = string_null; + +// do the apropriate action + if(self.classname == "item_artifact_wetsuit") + { + other.wetsuit_time = 1; + other.wetsuit_finished = time + 30; + } + if(self.classname == "item_artifact_empathy_shields") + { + other.empathy_time = 1; + other.empathy_finished = time + 30; + } + + activator = other; + SUB_UseTargets(); // fire all targets / killtargets +}; + + +/*QUAKED item_artifact_wetsuit (0 .5 .8) (-16 -16 -24) (16 16 32) +Player takes no damage from electrical attacks and swims faster for 30 seconds +*/ +void() item_artifact_wetsuit = +{ + self.handtouch = HIP_powerup_touch; + + precache_model("progs/wetsuit.mdl"); + precache_sound("misc/wetsuit.wav"); + precache_sound("misc/weton.wav"); + precache_sound("items/suit2.wav"); + self.noise = "misc/weton.wav"; + setmodel(self, "progs/wetsuit.mdl"); + self.netname = "Wetsuit"; + self.vr_itemId = IID_WETSUIT; + setsize(self, '-16 -16 -24', '16 16 32'); + + StartItem(); +}; + +/* +=============================================================================== +// +// Horn of Conjuring +// +=============================================================================== +*/ + +void() horn_touch = +{ + if(other.classname != "player") + return; + + if(deathmatch) + { + self.mdl = self.model; + + self.nextthink = time + 60; + + self.think = SUB_regen; + } + + self.solid = SOLID_NOT; + self.model = string_null; + sprint(other, "You got the Horn of Conjuring\n"); + sound(other, CHAN_VOICE, self.noise, 1, ATTN_NONE); + stuffcmd(other, "bf\n"); + activator = other; + horn_active = 1; + horn_charmer = other; + SUB_UseTargets(); // fire all targets / killtargets + horn_active = 0; +}; + +/*QUAKED item_hornofconjuring (0 .5 .8) (-16 -16 0) (16 16 32) +Horn of Conjuring. +You must make func_spawn entities connected to this entity +to spawn the charmed creature. +*/ +void() item_hornofconjuring = + { + self.touch = horn_touch; + + precache_model("progs/horn.mdl"); + precache_sound("hipitems/horn.wav"); + setmodel(self, "progs/horn.mdl"); + self.noise = "hipitems/horn.wav"; + setsize(self, '-16 -16 0', '16 16 32'); + StartItem(); + }; + +/*QUAKED item_artifact_empathy_shields (0 .5 .8) (-16 -16 0) (16 16 32) +Empathy Shield. +*/ +void() item_artifact_empathy_shields = + { + self.handtouch = HIP_powerup_touch; + + precache_model("progs/empathy.mdl"); + precache_sound("hipitems/empathy.wav"); + precache_sound("hipitems/empathy2.wav"); + precache_sound("items/suit2.wav"); + setmodel(self, "progs/empathy.mdl"); + self.noise = "hipitems/empathy.wav"; + self.netname = "Empathy Shields"; + self.vr_itemId = IID_EMPATHY_SHIELDS; + setsize(self, '-16 -16 0', '16 16 32'); + StartItem(); + }; +/* +=============================================================================== + +HIPNOTIC WEAPONS + +=============================================================================== +*/ + +/*QUAKED weapon_mjolnir (0 .5 .8) (-16 -16 0) (16 16 32) +*/ +void() weapon_mjolnir = +{ + impl_weapon_item("progs/g_hammer.mdl", WID_MJOLNIR); +} + +/*QUAKED weapon_laser_gun (0 .5 .8) (-16 -16 0) (16 16 32) +*/ +void() weapon_laser_gun = +{ + impl_weapon_item("progs/g_laserg.mdl", WID_LASER_CANNON); +} + +/*QUAKED weapon_proximity_gun (0 .5 .8) (-16 -16 0) (16 16 32) +*/ +void() weapon_proximity_gun = +{ + impl_weapon_item("progs/g_prox.mdl", WID_PROXIMITY_GUN); +} + +/* +=============================================================================== + +HIPNOTIC HAZARDS + +=============================================================================== +*/ + +void() spikemine_Home = + { + entity head; + entity selected; + float cur_dist; + float head_dist; + vector dir, vtemp; + + self.frame = self.frame + 1; + if(self.frame==9) self.frame = 0; + self.nextthink = time + 0.2; + self.think = spikemine_Home; + +// look in our immediate vicinity + + if(self.search_time < time) + { + selected = world; + cur_dist = 2000; + head = findradius(self.origin, 2000); + while(head) + { + if(!(head.flags & FL_NOTARGET) && (head.flags & FL_CLIENT)) + { + if(visible(head) && (head.health > 0)) + { + head_dist = vlen(head.origin-self.origin); + if(head_dist < cur_dist) + { + selected = head; + cur_dist = head_dist; + } + } + } + head = head.chain; + } +// if(selected != world && selected != self.enemy) + if(selected != world) + sound(self, CHAN_VOICE, "hipitems/spikmine.wav", 1, ATTN_NORM); + self.enemy = selected; + self.search_time = time + 1.3; + } + if(self.enemy == world) + { + sound(self, CHAN_VOICE, "misc/null.wav", 1, ATTN_NORM); + self.velocity = '0 0 0'; + return; + } + vtemp = self.enemy.origin + '0 0 10'; + dir = normalize(vtemp - self.origin); + if(infront(self.enemy)) + { + self.velocity = dir * ((skill*50) + 50); + } + else + { + self.velocity = dir * ((skill*50) + 150); + } + }; + +void() spikemine_Touch = + { + if(self.health>0) + { + if(other.classname == "trap_spike_mine") + return; + if(other.classname == "missile") + return; + if(other.classname == "grenade") + return; + if(other.classname == "hiplaser") + return; + if(other.classname == "proximity_grenade") + return; + + T_Damage(self,self,self,self.health+10); +// killed_monsters = killed_monsters + 1; +// WriteByte(MSG_ALL, SVC_KILLEDMONSTER); + } +// self.effects = self.effects | EF_MUZZLEFLASH; + + T_RadiusDamage(self, self, 110, world); + sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + sound(self, CHAN_VOICE, "misc/null.wav", 1, ATTN_NORM); + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel(self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1(); + }; + +/* +spike_mine_first_think +*/ + +void() spike_mine_first_think = + { + self.think = spikemine_Home; + self.nextthink = time + 0.1; + self.search_time = 0; + self.takedamage = DAMAGE_AIM; + self.use = monster_use; + }; + +/*QUAKED trap_spike_mine (0 .5 .8) (-16 -16 0) (16 16 32) +*/ + +void() trap_spike_mine = + { + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/spikmine.mdl"); + precache_sound("weapons/r_exp3.wav"); + precache_sound("hipitems/spikmine.wav"); + precache_sound("misc/null.wav"); + setmodel(self, "progs/spikmine.mdl"); +// setmodel(self, "progs/spike.mdl"); + setsize(self, self.mins, self.maxs); + self.classname = "trap_spike_mine"; + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_FLYMISSILE; +// setsize(self, '0 0 0', '0 0 0'); +// self.avelocity = '-100 100 -100'; + self.avelocity = '-50 100 150'; + if(cvar_hget(cvarh_skill) <= 1) + self.health = 200; + else + self.health = 400; + self.frame = 0; + self.think = spike_mine_first_think; + self.touch = spikemine_Touch; + self.th_die = spikemine_Touch; + self.th_stand = spikemine_Home; + self.th_walk = spikemine_Home; + self.th_run = spikemine_Home; + self.th_melee = spikemine_Home; + self.th_missile = spikemine_Home; + self.nextthink = time + 0.2; + total_monsters = total_monsters + 1; + self.flags = self.flags | FL_MONSTER; + self.deathtype = "was blasted by a spike mine"; + }; + +//============================================================================ +float LIGHTNING_RANDOM = 1; +float LIGHTNING_BOOM = 2; + +void() SpawnLightningThink = + { + if(time > self.delay) + { + remove(self); + return; + } + self.think = SpawnLightningThink; + if(checkclient()) + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity(MSG_BROADCAST, self); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, self.origin); + WriteVec3(MSG_BROADCAST, self.oldorigin); + } + LightningDamage(self.origin, self.oldorigin, self.lastvictim, self.dmg); + self.nextthink = time + 0.1; + }; + +void() trap_lightning_use = + { + vector p1, p2; + vector dir; + float dst; + float remainder; + + if(time >= self.pausetime) + { + if(self.spawnflags & LIGHTNING_BOOM) + sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + else + sound(self, CHAN_AUTO, "weapons/lhit.wav", 1, ATTN_NORM); + if(self.classname == "trap_lightning_triggered") + self.pausetime = time + 0.1; + } + if(self.target != NULLSTR) + { + p1 = self.origin; + p2 = self.enemy.origin; + } + else + { + makevectors(self.angles); + self.movedir = v_forward; + traceline(self.origin, self.origin + self.movedir*600, TRUE, self); + p1 = self.origin; + p2 = trace_endpos; + } + // fix up both ends of the lightning + // lightning bolts are 30 units long each + dir = normalize(p2-p1); + dst = vlen(p2-p1); + dst = dst / 30.0; + remainder = dst - floor(dst); + if(remainder > 0) + { + remainder = remainder - 1; + // split half the remainder with the front and back + remainder = remainder * 15; + p1 = p1 + (remainder*dir); + p2 = p2 - (remainder*dir); + } + if(self.duration > 0.1) + { + entity temp; + + temp = self; + self = spawn(); + self.origin = p1; + self.oldorigin = p2; + self.lastvictim = temp; + self.dmg = temp.dmg; + self.delay = time + temp.duration; + SpawnLightningThink(); + self = temp; + } + else if(checkclient()) + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity(MSG_BROADCAST, self); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, p1); + WriteVec3(MSG_BROADCAST, p2); + LightningDamage(p1, p2, self, self.dmg); + } + else + LightningDamage(p1, p2, self, self.dmg); + }; + +void() lightning_think = + { + float timedelay; + + if(self.state) + { + trap_lightning_use(); + } + if(self.cnt == 0) + { + if(self.spawnflags & LIGHTNING_RANDOM) + { + timedelay = self.wait*random(); + } + else + { + timedelay = self.wait; + } + self.cnt = 1; + self.t_length = time + self.duration - 0.1; + self.pausetime = time + self.duration - 0.1; + if(self.pausetime < time + 0.3) + self.pausetime = time + 0.3; + if(timedelay < self.duration) + timedelay = self.duration; + self.t_width = time + timedelay; + } + if(time >= self.t_length) + { + self.cnt = 0; + self.nextthink = self.t_width; + } + else + { + self.nextthink = time + 0.2; + } + }; + +void() lightning_firstthink = + { + entity targ; + if(self.target != NULLSTR) + { + targ = find(world,targetname,self.target); + self.dest = targ.origin; + self.enemy = targ; + } + self.think = SUB_Null; + self.nextthink = 0; + if(self.classname != "trap_lightning_triggered") + { + self.nextthink = self.huntingcharmer + self.wait + self.ltime; + self.think = lightning_think; + } + }; + +/*QUAKED trap_lightning_triggered (0 .5 .8) (-8 -8 -8) (8 8 8) random boom +When triggered, fires lightning in the direction set in QuakeEd. +"wait" how long to wait between blasts (1.0 default) + if in random mode wait is multiplied by random +"dmg" how much damage lightning should inflict (30 default) +"duration" how long each lightning attack should last (0.1 default) +*/ + +void() trap_lightning_triggered = + { + if(self.wait == 0) + self.wait = 1.0; + if(self.dmg == 0) + self.dmg = 30; + if(self.duration == 0) + self.duration = 0.1; + self.cnt = 0; + self.use = trap_lightning_use; + precache_sound("weapons/lhit.wav"); + precache_sound("weapons/lstart.wav"); + self.huntingcharmer = self.nextthink; + self.think = lightning_firstthink; + self.nextthink = time + 0.25; + self.deathtype = "is electrocuted"; + }; + + +/*QUAKED trap_lightning (0 .5 .8) (-8 -8 -8) (8 8 8) random boom +Continuously fire lightning. +"wait" how long to wait between blasts (1.0 default) + if in random mode wait is multiplied by random +"nextthink" delay before firing first lightning, so multiple traps can be stagered. +"dmg" how much damage lightning should inflict (30 default) +"duration" how long each lightning attack should last (0.1 default) +*/ +void() trap_lightning = + { + trap_lightning_triggered(); + self.state = 1; + }; + +void() trap_lightning_switched_use = + { + self.state = 1 - self.state; + if(self.state == 1) + self.nextthink = self.huntingcharmer; + }; +/*QUAKED trap_lightning_switched (0 .5 .8) (-8 -8 -8) (8 8 8) random boom +Continuously fires lightning. +"wait" how long to wait between blasts (1.0 default) + if in random mode wait is multiplied by random +"nextthink" delay before firing first lightning, so multiple traps can be stagered. +"dmg" how much damage lightning should inflict (30 default) +"duration" how long each lightning attack should last (0.1 default) +"state" 0 (default) initially off, 1 initially on. +*/ +void() trap_lightning_switched = + { + trap_lightning_triggered(); + self.use = trap_lightning_switched_use; + }; + + +entity tesla_target; +float tesla_numtargets; +void() trap_tesla_scan = +{ + entity prev = world; + + // look in our immediate vicinity + + tesla_numtargets = 0; + entity head = findradius(self.origin, self.distance); + + while(head) + { + if(!(head.flags & FL_NOTARGET) && (head.flags & self.cnt)) + { + if(visible(head) && (head.health > 0) && + (head.struck_by_mjolnir == 0)) + { + if(tesla_numtargets == 0) + { + tesla_target = head; + } + else + { + ASSERT(prev != world); + prev.next_ent = head; + } + + tesla_numtargets = tesla_numtargets + 1; + prev = head; + if(tesla_numtargets == self.count) return; + } + } + + head = head.chain; + } +}; + +void() TeslaLightningThink = + { + self.owner.attack_state = 2; + if(time > self.delay) + { + self.enemy.struck_by_mjolnir = 0; + remove(self); + return; + } + traceline(self.origin, self.enemy.origin, TRUE, self); + + if(trace_fraction != 1.0 || self.enemy.health<=0 || vlen(self.origin-self.enemy.origin) > (self.distance+10)) + { + self.enemy.struck_by_mjolnir = 0; + remove(self); + return; + } + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity(MSG_BROADCAST, self); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, self.origin); + WriteVec3(MSG_BROADCAST, trace_endpos); + LightningDamage(self.origin, trace_endpos, self.lastvictim, self.dmg); + self.nextthink = time + 0.1; + }; + +void(entity targ) SpawnTeslaLightning = + { + entity lgt; + // spawn actual lightning + lgt = spawn(); + if(self.duration>0) + { + lgt.delay = time + self.duration; + } + else + { + lgt.delay = time + 9999; + } + lgt.enemy = targ; + targ.struck_by_mjolnir = 1; + lgt.distance = self.distance; + lgt.owner = self; + lgt.lastvictim = self.lastvictim; + lgt.dmg = self.dmg; + lgt.origin = self.origin; + lgt.think = TeslaLightningThink; + lgt.nextthink = time; + lgt.deathtype = self.deathtype; + }; + +void() trap_tesla_think = + { + if(self.state == 0) + { + self.nextthink = time + 0.25; + return; + } + if(self.attack_state == 0) + { + self.think = trap_tesla_think; + trap_tesla_scan(); + if(tesla_numtargets > 0) + { + if(self.wait > 0) + sound(self, CHAN_AUTO, "misc/tesla.wav", 1, ATTN_NORM); + self.attack_state = 1; + self.nextthink = time + self.wait; + return; + } + self.nextthink = time + 0.25; + if(self.delay > 0) + { + if(time > self.search_time) + { + self.attack_state = 3; + } + } + } + else if(self.attack_state == 1) + { + trap_tesla_scan(); + while(tesla_numtargets > 0) + { + sound(self, CHAN_AUTO, "hipweap/mjolhit.wav", 1, ATTN_NORM); + SpawnTeslaLightning (tesla_target); + tesla_target = tesla_target.next_ent; + tesla_numtargets = tesla_numtargets - 1; + } + self.attack_state = 2; + self.nextthink = time + 1; + } + else if(self.attack_state == 2) + { + self.attack_state = 3; + self.nextthink = time + 0.2; + } + else if(self.attack_state == 3) + { + self.attack_state = 0; + self.nextthink = time + 0.1; + if(self.classname == "trap_gods_wrath") + { + self.nextthink = -1; + } + } + }; + +/*QUAKED trap_tesla_coil (0 .5 .8) (-8 -8 -8) (8 8 8) targetenemies +targets enemies in vicinity and fires at them +"wait" how long build up should be (2 second default) +"dmg" how much damage lightning should inflict (2 + 5*skill default) +"duration" how long each lightning attack should last (continuous default) +"distance" how far the tesla coil should reach (600 default) +"state" on/off for the coil (0 default is off) +"count" number of people to target (2 default) +*/ +void() trap_tesla_coil = + { + precache_sound("misc/tesla.wav"); + precache_sound("hipweap/mjolhit.wav"); // lightning sound + if(self.wait == 0) + self.wait = 2; + if(self.dmg == 0) + self.dmg = 2 + (5*cvar_hget(cvarh_skill)); + if(self.duration == 0) + self.duration = -1; + if(self.distance == 0) + self.distance = 600; + if(self.spawnflags & 1) + self.cnt = FL_CLIENT | FL_MONSTER; + else + self.cnt = FL_CLIENT; + self.use = trap_lightning_switched_use; + if(self.delay == 0) + self.delay = -1; + self.nextthink = time + random(); + self.think = trap_tesla_think; + self.lastvictim = world; + tesla_numtargets = 0; + self.attack_state = 0; + self.deathtype = "is electrocuted"; + }; + +void() trap_gods_wrath_use = + { + if(self.attack_state==0) + { + self.search_time = time + self.delay; + self.lastvictim = activator; + trap_tesla_think(); + } + }; + +/*QUAKED trap_gods_wrath (0 .5 .8) (-8 -8 -8) (8 8 8) targetenemies +targets enemies in vicinity and fires at them +"dmg" how much damage lightning should inflict (5 default) +"duration" how long each lightning attack should last (continuous default) +"distance" how far god's wrath should reach (600 default) +"delay" how long to wait until god calms down + this is only needed if no one is targetted (5 seconds default) +"count" number of people to target (2 default) +*/ +void() trap_gods_wrath = + { + if(self.delay == 0) + self.delay = 5; + trap_tesla_coil(); + self.wait = 0; + self.state = 1; + self.nextthink = -1; + self.deathtype = "suffers the wrath of God"; +// self.attack_state = 1; + self.use = trap_gods_wrath_use; + }; + +void() trap_gravity_touch = + { + if(self.attack_finished > time) + return; + + if(other.takedamage) + { + T_Damage(other, self, self, self.dmg); + self.attack_finished = time + 0.2; + } + }; + +void() trap_gravity_think = + { + vector vel; + vector dir; + vector delta; + + self.ltime = time; + trap_tesla_scan(); + while(tesla_numtargets > 0) + { + delta = self.origin - tesla_target.origin; + dir = normalize(delta); + vel = dir * self.speed; + if((tesla_target.wetsuit_finished > time) && + (self.spawnflags & UNDERWATER)) + { + vel = vel * 0.6; + } + + tesla_target.velocity = tesla_target.velocity + vel; + tesla_target = tesla_target.next_ent; + tesla_numtargets = tesla_numtargets - 1; + } + self.nextthink = time + 0.1; + }; + +/*QUAKED trap_gravity_well (.8 .5 0) (-8 -8 -8) (8 8 8) targetenemies UNDERWATER +targets enemies in vicinity and draws them near, gibbing them on contact. + +UNDERWATER cuts the pull in half for players wearing the wetsuit + +"distance" how far the gravity well should reach (600 default) +"count" number of people to target (2 default) +"speed" is how strong the pull is. (210 default) +"dmg" is how much damage to do each touch. (10000 default) +*/ +void() trap_gravity_well = + { + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setsize(self, '-16 -16 -16','16 16 16'); + if(self.dmg == 0) + { + self.dmg = 10000; + } + if(self.speed == 0) + self.speed = 210; + if(self.distance == 0) + self.distance = 600; + if(self.spawnflags & 1) + self.cnt = FL_CLIENT | FL_MONSTER; + else + self.cnt = FL_CLIENT; + + self.attack_finished = 0; + self.think = trap_gravity_think; + self.touch = trap_gravity_touch; + self.lastvictim = world; + tesla_numtargets = 0; + self.nextthink = time + 0.1; + self.ltime = time; + }; diff --git a/QC/hip_misc.qc b/QC/hip_misc.qc new file mode 100644 index 00000000..98102152 --- /dev/null +++ b/QC/hip_misc.qc @@ -0,0 +1,550 @@ +/* Miscelanneous QuickC program + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +void() play_sound_use = + { + if(self.spawnflags & 1) + { + if(self.state == 0) + { + self.state = 1; + sound(self, self.impulse, self.noise, self.volume, self.speed); + } + else + { + self.state = 0; + sound(self, self.impulse, "misc/null.wav", self.volume, self.speed); + } + } + else + { + sound(self, self.impulse, self.noise, self.volume, self.speed); + } + }; + +void() PlaySoundThink = + { + float t; + t = self.wait * random(); + if(t < self.delay) + t = self.delay; + self.nextthink = time + t; + play_sound_use(); + }; + +/*QUAKED play_sound_triggered (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) toggle +play a sound when it is used +"toggle" determines whether sound should be stopped when triggered again +"volume" how loud (1 default full volume) +"noise" sound to play +"impulse" channel on which to play sound(0-7) (0 automatic is default) +"speed" attenuation factor + -1 - no attenuation + 1 - normal + 2 - idle + 3 - static +*/ +void() play_sound_triggered = + { + precache_sound(self.noise); + precache_sound("misc/null.wav"); + if(self.volume == 0) + self.volume = 1; + if(self.speed == 0) + self.speed = 1; + if(self.speed == -1) + self.speed = 0; + if(self.spawnflags & 1) + if(self.impulse == 0) + self.impulse = 7; + self.use = play_sound_use; + }; + +/*QUAKED play_sound(0.3 0.1 0.6) (-8 -8 -8) (8 8 8) +play a sound on a periodic basis +"volume" how loud (1 default full volume) +"noise" sound to play +"wait" random time between sounds (default 20) +"delay" minimum delay between sounds (default 2) +"impulse" channel on which to play sound(0-7) (0 automatic is default) +"speed" attenuation factor + -1 - no attenuation + 1 - normal + 2 - idle + 3 - static +*/ +void() play_sound = + { + float t; + + play_sound_triggered(); + if(self.wait == 0) + self.wait = 20; + if(self.delay == 0) + self.delay = 2; + self.think = PlaySoundThink; + t = self.wait * random(); + if(t < self.delay) + t = self.delay; + self.nextthink = time + t; + }; + +/*QUAKED random_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +"wait" random time between strikes (default 20) +"delay" minimum delay between strikes (default 2) +"volume" how loud (1 default full volume) +"speed" attenuation factor + -1 - no attenuation + 1 - normal + 2 - idle + 3 - static +*/ +void() random_thunder = + { + self.noise = "ambience/thunder1.wav"; + play_sound(); + self.impulse = 6; + }; + +/*QUAKED random_thunder_triggered (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) toggle +"toggle" determines whether sound should be stopped when triggered again +"volume" how loud (1 default full volume) +"speed" attenuation factor + -1 - no attenuation + 1 - normal + 2 - idle + 3 - static +*/ +void() random_thunder_triggered = + { + self.noise = "ambience/thunder1.wav"; + play_sound_triggered(); + self.impulse = 6; + }; + +/*QUAKED ambient_humming (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + "volume" how loud it should be (0.5 is default) +*/ +void() ambient_humming = +{ + if(self.volume==0) + self.volume = 0.5; + precache_sound("ambient/humming.wav"); + ambientsound(self.origin, "ambient/humming.wav", self.volume, ATTN_STATIC); +}; + +/*QUAKED ambient_rushing (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + "volume" how loud it should be (0.5 is default) +*/ +void() ambient_rushing = +{ + if(self.volume==0) + self.volume = 0.5; + precache_sound("ambient/rushing.wav"); + ambientsound(self.origin, "ambient/rushing.wav", self.volume, ATTN_STATIC); +}; + +/*QUAKED ambient_running_water (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + "volume" how loud it should be (0.5 is default) +*/ +void() ambient_running_water = +{ + if(self.volume==0) + self.volume = 0.5; + precache_sound("ambient/runwater.wav"); + ambientsound(self.origin, "ambient/runwater.wav", self.volume, ATTN_STATIC); +}; + +/*QUAKED ambient_fan_blowing (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + "volume" how loud it should be (0.5 is default) +*/ +void() ambient_fan_blowing = +{ + if(self.volume==0) + self.volume = 0.5; + precache_sound("ambient/fanblow.wav"); + ambientsound(self.origin, "ambient/fanblow.wav", self.volume, ATTN_STATIC); +}; + +/*QUAKED ambient_waterfall (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + "volume" how loud it should be (0.5 is default) +*/ +void() ambient_waterfall = +{ + if(self.volume==0) + self.volume = 0.5; + precache_sound("ambient/waterfal.wav"); + ambientsound(self.origin, "ambient/waterfal.wav", self.volume, ATTN_STATIC); +}; + +/*QUAKED ambient_riftpower (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + "volume" how loud it should be (0.5 is default) +*/ +void() ambient_riftpower = +{ + if(self.volume==0) + self.volume = 0.5; + precache_sound("ambient/riftpowr.wav"); + ambientsound(self.origin, "ambient/riftpowr.wav", self.volume, ATTN_STATIC); +}; + + +/*QUAKED info_command (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + Stuffs a command into the console to allow map designers + to set server variables. + + "message" is the command to send to the console. +*/ + +void() info_command = + { + if(self.message != NULLSTR) + localcmd(self.message); + }; + +void() effect_teleport_use = + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_TELEPORT); + WriteVec3(MSG_BROADCAST, self.origin); + + sound(self, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + }; + +/*QUAKED effect_teleport (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) + Create a teleport effect when triggered +*/ + +void() effect_teleport = + { + precache_sound("misc/r_tele1.wav"); + self.use = effect_teleport_use; + }; + + +/* +============= +camerathink + +camera think function +============== +*/ +/* +void() camerathink = + { + entity pl; + vector d_diff; + vector a_diff; + vector p; + vector a; + float dist; + float timeelapsed; + + timeelapsed = (time - self.cnt) * self.duration; + if(timeelapsed > 1) + timeelapsed = 1; + + p = self.oldorigin + (timeelapsed * (self.movetarget.origin - self.oldorigin)); + d_diff = p - self.origin; + + a = self.mangle + (timeelapsed * (self.movetarget.mangle - self.mangle)); + a_diff = a - self.angles; + + self.origin = self.origin + self.pos1 + (1.0 * d_diff); + self.angles = self.v_angle = self.angles + self.avelocity + (1.0 * a_diff); + + self.nextthink = time + 0.1; + }; +*/ +/* +============= +camerachase + +camera chase function +============== +*/ +/* +void() camerachase = + { + float timeelapsed; + vector v; + vector a; + + + timeelapsed = time - self.cnt; + if(timeelapsed > 1) + timeelapsed = 1; + self.cnt = time; + + self.velocity = (self.movetarget.origin - self.oldorigin)*(1/timeelapsed); + self.oldorigin = self.movetarget.origin; + if(self.state == 0) // setup + { + self.velocity = '0 0 0'; + self.cnt = time; + } + // calculate new camera position + a = '0 0 0'; + a_y = vectoyaw(normalize(self.movetarget.origin - self.movetarget.movetarget.origin)); + makevectors(a); + self.origin = self.movetarget.origin + v_forward * self.distance; + self.origin_z = self.origin_z + self.height; + + v = normalize(self.movetarget.origin - self.origin); + a = self.angles; + a_y = vectoyaw(v); + v_x = v_y; + v_y = 0 - v_z; + a_x = vectoyaw(v); + self.angles = a; +// SetViewPoint(self, self); +// UpdateCamera(self, self); + SetViewAngle(self, a); + + self.think = camerachase; + self.nextthink = time + 0.1; + }; +*/ + +/* +============= +camerafollow + +camera follow function +============== +*/ +/* +void() camerafollow = + { + vector v; + vector a; + + v = normalize(self.movetarget.origin - self.origin); + a = self.angles; + a_y = vectoyaw(v); + v_x = v_y; + v_y = 0 - v_z; + a_x = vectoyaw(v); + self.angles = a; + SetViewAngle(self, a); + + self.think = camerafollow; + self.nextthink = time + 0.01; + }; +*/ +/* +============= +t_cameratarget + +a camera has reached a path trigger +============== +*/ +/* +void() t_cameratarget = +{ +entity temp; + + if(other.movetarget != self) + return; + + temp = self; + self = other; + other = temp; + + self.angles = self.movetarget.mangle; + self.movetarget = find(world, targetname, other.target); + if(!self.movetarget) + { + self.nextthink = time + 999999; + } + else + { + vector d_diff; + vector a_diff; + float t; + + self.think = camerathink; + self.duration = 1 / other.duration; + self.cnt = time; + + self.oldorigin = self.origin; + d_diff = self.movetarget.origin - self.oldorigin; + self.pos1 = d_diff*self.duration; + + self.mangles = self.angles; + a_diff = self.movetarget.mangle - self.mangle; + self.avelocity = a_diff*self.duration; + if(other.delay) + { + self.nextthink = time + other.delay; + self.cnt = time + other.delay; + } + } +}; +*/ + +/*QUAKED path_camera (0.5 0.3 0) (-8 -8 -8) (8 8 8) +path for a camera +"delay" delay to wait before proceeding to next segment; +"mangle" position the camera should be when it gets here +"duration" how long it should take to cover the distance + (default 10 seconds) +*/ +/* +void() path_camera = +{ + self.solid = SOLID_TRIGGER; + self.touch = t_cameratarget; + if(!self.duration) + self.duration = 10; + setsize(self, '-8 -8 -8', '8 8 8'); +}; +*/ +float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80 +void(entity me, entity camera) UpdateCamera = +{ + msg_entity = me; // target of message + WriteByte(MSG_ONE, SVC_UPDATEENTITY|15); // 0x80|1|2|4|8 + WriteByte(MSG_ONE, 64); // 0x40 + WriteEntity(MSG_ONE, camera); + WriteVec3(MSG_ONE, camera.origin); +}; + + +//void() effect_finale_think = +// { +// self.flags = self.flags - (self.flags & FL_ONGROUND); +// self.angles = self.mangle; +// self.v_angle = self.mangle; +// self.fixangle = TRUE; +// NezuUpdateCamera(self,self.trigger_field); +// NezuSetViewPoint(self,self.trigger_field); +// NezuSetViewAngle(self,self.mangle); +// self.think = effect_finale_think; +// self.nextthink = time + 0.05; +// }; + + +void() effect_finale_use = +{ + entity pos, pl, targ; + + if(self.state == 1) + return; + +// intermission_exittime = time + 10000000; // never allow exit +// intermission_running = 1; + self.state = 1; + + // find the intermission spot + pos = find(world, targetname, self.target); + if(!pos) + error ("no target in finale"); + +// WriteByte(MSG_ALL, SVC_FINALE); + WriteByte(MSG_ALL, SVC_CUTSCENE); + WriteString (MSG_ALL, ""); + + //setup decoy + if(!(self.spawnflags & 2)) + { + if(self.spawnflags & 1) + { + pl = find(world, classname, "player"); + targ = find(world, targetname, self.mdl); + become_decoy(targ.target, pl.origin); + } + else + { + targ = find(world, targetname, self.mdl); + become_decoy(targ.target, targ.origin); + } + } + + pl = find(world, classname, "player"); + while(pl != world) + { + pl.view_ofs = '0 0 0'; + pl.angles = other.v_angle = pos.mangle; + pl.mangle = pos.mangle; + pl.fixangle = TRUE; // turn this way immediately + pl.trigger_field = self; + pl.nextthink = time + 0.5; + pl.takedamage = DAMAGE_NO; + pl.solid = SOLID_NOT; + pl.movetype = MOVETYPE_NONE; + pl.modelindex = 0; + setorigin(pl, pos.origin); + pl.origin = pos.origin; + pl.oldorigin = pos.origin; + UpdateCamera(pl,pl); + UpdateCamera(pl,pl.trigger_field); + pl = find(pl, classname, "player"); + } + + // wait for next sequence + if(self.spawnfunction) + { + self.nextthink = time + self.wait; + self.think = self.spawnfunction; + } +// intermission_running = 0; +}; +/* + "count" 0 - static camera + 1 - path camera + 2 - chase camera + "distance" distance from chase guy + (default 100) + "height" height distance from chase guy + (default 64) +*/ + +/*QUAKED effect_finale (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) useplayer nodecoy + start the finale sequence + "target" the camera to go to. + "mdl" if useplayer is specified, this is a + path corner with target of the next + path_corner to run to. + if use player isn't specified this becomes + the spawn point as well. + "spawnfunction" next routine to run + "delay" time to wait until running routine + useplayer - use the current player as + decoy location. + nodecoy - no decoy, only the camera +*/ + +void() effect_finale = + { + if(deathmatch) + { + remove(self); + return; + } + setorigin(self,self.origin); + self.angles = self.mangle; + self.use = effect_finale_use; +// setsize(self,'-16 -16 -16','16 16 16'); +// self.touch = effect_finale_use; +// InitTrigger(); + self.state = 0; + }; + +void() info_startendtext_use = + { + intermission_running = 1; + ExitIntermission(); + }; + +/*QUAKED info_startendtext (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) + start the end text +*/ + +void() info_startendtext = + { + self.use = info_startendtext_use; + }; diff --git a/QC/hipmodel.qc b/QC/hip_model.qc similarity index 100% rename from QC/hipmodel.qc rename to QC/hip_model.qc diff --git a/QC/hip_mon_arma.qc b/QC/hip_mon_arma.qc new file mode 100644 index 00000000..3607abac --- /dev/null +++ b/QC/hip_mon_arma.qc @@ -0,0 +1,953 @@ +/* +============================================================================== + +armagon + +============================================================================== +*/ + + +$cd hipwork\models\armagon +$origin 0 0 24 +$base bodybase.asc + +$skin armab + +$frame lwalk1.asc lwalk2.asc lwalk3.asc lwalk4.asc lwalk5.asc lwalk6.asc lwalk7.asc +$frame lwalk8.asc lwalk9.asc lwalk10.asc lwalk11.asc lwalk12.asc + +$frame lw0fir1.asc lw0fir2.asc lw0fir3.asc lw0fir4.asc lw0fir5.asc lw0fir6.asc +$frame lw0fir7.asc lw0fir8.asc lw0fir9.asc lw0fir10.asc lw0fir11.asc lw0fir12.asc +$frame lw0fir13.asc + +$frame lw1fir1.asc lw1fir2.asc lw1fir3.asc lw1fir4.asc lw1fir5.asc lw1fir6.asc +$frame lw1fir7.asc lw1fir8.asc lw1fir9.asc lw1fir10.asc lw1fir11.asc lw1fir12.asc +$frame lw1fir13.asc lw1fir14.asc lw1fir15.asc + +$frame lw2fir1.asc lw2fir2.asc lw2fir3.asc lw2fir4.asc lw2fir5.asc lw2fir6.asc +$frame lw2fir7.asc lw2fir8.asc lw2fir9.asc lw2fir10.asc lw2fir11.asc lw2fir12.asc + +$frame lsfire1.asc lsfire2.asc lsfire3.asc lsfire4.asc lsfire5.asc lsfire6.asc +$frame lsfire7.asc lsfire8.asc lsfire9.asc lsfire10.asc lsfire11.asc lsfire12.asc + +$frame lstand1.asc lstand2.asc lstand3.asc lstand4.asc lstand5.asc lstand6.asc +$frame lstand7.asc lstand8.asc lstand9.asc lstand10.asc lstand11.asc lstand12.asc +$frame lstand13.asc lstand14.asc lstand15.asc lstand16.asc lstand17.asc +$frame lstand18.asc lstand19.asc lstand20.asc + +$frame tranl1.asc tranl2.asc + +$frame ldie1.asc ldie2.asc ldie3.asc ldie4.asc ldie5.asc ldie6.asc +$frame ldie7.asc ldie8.asc ldie9.asc ldie10.asc ldie11.asc ldie12.asc + +float ATTN_ARMAGON = 0.5; +float SERVO_VOLUME = 0.5; + +void(float ofs, float turn) armagon_launch_missile = + { + vector src, vec, targ; + vector ang; + entity missile; + float dist; + + ang = self.angles; + ang_y = ang_y + self.fixangle; + if(turn==1) + { + ang_y = ang_y + 165; + } + else if(turn==2) + { + ang_y = ang_y - 165; + } + makevectors(ang); + src = self.origin + '0 0 66' + v_right*ofs + v_forward*84; + targ = self.enemy.origin + self.enemy.view_ofs; + if(skill!=0) + { + dist = vlen(targ-src); + targ = targ + (self.enemy.velocity * (dist/1000)); + } + vec = (targ - src); + vec = normalize(vec); + dist = vec*v_forward; + if(dist<self.worldtype) + vec=v_forward; + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + + self.punchangle_x = -2; + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "missile"; + +// set missile speed + missile.velocity = vec * 1000; + missile.angles = vectoangles(vec); + missile.touch = T_MissileTouch; + +// set missile duration + missile.nextthink = time + 5; + missile.think = SUB_Remove; + + setmodel(missile, "progs/missile.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, src); + }; + +void(float ofs) armagon_launch_laser = + { + vector src, vec, targ; + float dist; + vector ang; + + ang = self.angles; + ang_y = ang_y + self.fixangle; + makevectors(ang); + src = self.origin + '0 0 66' + v_right*ofs + v_forward*84; + targ = self.enemy.origin + self.enemy.view_ofs; + if(skill!=0) + { + dist = vlen(targ-src); + targ = targ + (self.enemy.velocity * (dist/1000)); + } + vec = (targ - src); + vec = normalize(vec); + dist = vec*v_forward; + if(dist<self.worldtype) + vec=v_forward; + self.effects = self.effects | EF_MUZZLEFLASH; + + HIP_LaunchLaser(src, vec, '0 0 0', 0); + }; + +void(float angdelta, float delta) armagon_turn = + { + if(fabs(angdelta)<10) + self.fixangle = delta; + else + { + if(angdelta > 5) + { + self.fixangle = self.fixangle + 9; + } + else if(angdelta < -5) + { + self.fixangle = self.fixangle - 9; + } + else + { + self.fixangle = delta; + } + } + }; +void() armagon_overleft1; +void() armagon_overright1; + +void() armagon_think = + { + float delta; + float angdelta; + setorigin(self.trigger_field, self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + self.ideal_yaw = enemy_yaw; + delta = self.ideal_yaw - self.angles_y; + self.cnt = 0; + if(delta > 180) delta = delta - 360; + if(delta < -180) delta = delta + 360; + if(fabs(delta) > 90) + { + delta = 0; + self.cnt = 1; + } + angdelta = delta-self.fixangle; + armagon_turn(angdelta,delta); +// self.nextthink = time + 0.1; + if(self.health < 0) + return; + if(time > self.super_time) + { + float r; + + self.super_time = time + 3; + if(random() < 0.5) + { + r = random(); + if(r < 0.25) + sound(self, CHAN_VOICE, "armagon/idle1.wav", 1, ATTN_ARMAGON); + else if(r < 0.5) + sound(self, CHAN_VOICE, "armagon/idle2.wav", 1, ATTN_ARMAGON); + else if(r < 0.75) + sound(self, CHAN_VOICE, "armagon/idle3.wav", 1, ATTN_ARMAGON); + else + sound(self, CHAN_VOICE, "armagon/idle4.wav", 1, ATTN_ARMAGON); + } + } + }; + +void() armagon_walkthink = + { + float delta; + float angdelta; + entity client; + setorigin(self.trigger_field, self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; + ChangeYaw(); + delta = 0; + self.cnt = 0; + if(delta > 180) delta = delta - 360; + if(delta < -180) delta = delta + 360; + if(fabs(delta) > 90) + { + delta = 0; + self.cnt = 1; + } + angdelta = delta-self.fixangle; + armagon_turn(angdelta,delta); + if(self.health < 0) + return; + if(time > self.super_time) + { + float r; + + self.super_time = time + 3; + if(random() < 0.5) + { + r = random(); + if(r < 0.25) + sound(self, CHAN_VOICE, "armagon/idle1.wav", 1, ATTN_ARMAGON); + else if(r < 0.5) + sound(self, CHAN_VOICE, "armagon/idle2.wav", 1, ATTN_ARMAGON); + else if(r < 0.75) + sound(self, CHAN_VOICE, "armagon/idle3.wav", 1, ATTN_ARMAGON); + else + sound(self, CHAN_VOICE, "armagon/idle4.wav", 1, ATTN_ARMAGON); + } + } + client = checkclient(); + if(!client) + return; // current check entity isn't in PVS + if(visible(client)) + { + self.enemy = client; + FoundTarget(); + } + }; + +void() armagon_overleft_think = + { + float delta; + float angdelta; + + ChangeYaw(); + walkmove(self.angles_y, 14); + setorigin(self.trigger_field, self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; + if(self.count == 0) + { + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + self.ideal_yaw = enemy_yaw; + delta = self.ideal_yaw - self.angles_y - 165; + if(delta > 180) delta = delta - 360; + if(delta < -180) delta = delta + 360; + angdelta = delta-self.fixangle; + } + else if(self.count == 1) + { + armagon_launch_missile(40,1); + return; + } + else + { + delta = 0; + angdelta = delta-self.fixangle; + } + armagon_turn(angdelta,delta); +// self.nextthink = time + 0.1; + }; + +void() armagon_overright_think = + { + float delta; + float angdelta; + + ChangeYaw(); + walkmove(self.angles_y, 14); + setorigin(self.trigger_field, self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; + if(self.count == 0) + { + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + self.ideal_yaw = enemy_yaw; + delta = self.ideal_yaw - self.angles_y + 165; + if(delta > 180) delta = delta - 360; + if(delta < -180) delta = delta + 360; + angdelta = delta-self.fixangle; + } + else if(self.count == 1) + { + armagon_launch_missile(-40,2); + return; + } + else + { + delta = 0; + angdelta = delta-self.fixangle; + } + armagon_turn(angdelta,delta); +// self.nextthink = time + 0.1; + }; + +void() armagon_stand_attack; + +void() armagon_stand1 =[ $lstand1.asc, armagon_stand2 ] {ai_stand();armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand2 =[ $lstand2.asc, armagon_stand3 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand3 =[ $lstand3.asc, armagon_stand4 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand4 =[ $lstand4.asc, armagon_stand5 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand5 =[ $lstand5.asc, armagon_stand6 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand6 =[ $lstand6.asc, armagon_stand7 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand7 =[ $lstand7.asc, armagon_stand8 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand8 =[ $lstand8.asc, armagon_stand9 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand9 =[ $lstand9.asc, armagon_stand10 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand10 =[ $lstand10.asc, armagon_stand11 ] {ai_stand();armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand11 =[ $lstand11.asc, armagon_stand12 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand12 =[ $lstand12.asc, armagon_stand13 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand13 =[ $lstand13.asc, armagon_stand14 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand14 =[ $lstand14.asc, armagon_stand15 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand15 =[ $lstand15.asc, armagon_stand16 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand16 =[ $lstand16.asc, armagon_stand17 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand17 =[ $lstand17.asc, armagon_stand18 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand18 =[ $lstand18.asc, armagon_stand19 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand19 =[ $lstand19.asc, armagon_stand20 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_stand20 =[ $lstand20.asc, armagon_stand1 ] {ai_stand();armagon_think();self.nextthink = time + 0.2;}; + +void() armagon_walk1 =[ $lwalk1.asc , armagon_walk2 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk2 =[ $lwalk2.asc , armagon_walk3 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk3 =[ $lwalk3.asc , armagon_walk4 ] + { + sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk4 =[ $lwalk4.asc , armagon_walk5 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk5 =[ $lwalk5.asc , armagon_walk6 ] + { + sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk6 =[ $lwalk6.asc , armagon_walk7 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk7 =[ $lwalk7.asc , armagon_walk8 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk8 =[ $lwalk8.asc , armagon_walk9 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk9 =[ $lwalk9.asc , armagon_walk10 ] + { + sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk10 =[ $lwalk10.asc , armagon_walk11 ] + { + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk11 =[ $lwalk11.asc , armagon_walk12 ] + { + sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); + movetogoal(14); + armagon_walkthink(); + }; +void() armagon_walk12 =[ $lwalk12.asc , armagon_walk1 ] + { + movetogoal(14); + armagon_walkthink(); + }; + +void() armagon_run1 =[ $lwalk1.asc , armagon_run2 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run2 =[ $lwalk2.asc , armagon_run3 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run3 =[ $lwalk3.asc , armagon_run4 ] + { + sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run4 =[ $lwalk4.asc , armagon_run5 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run5 =[ $lwalk5.asc , armagon_run6 ] + { + sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run6 =[ $lwalk6.asc , armagon_run7 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run7 =[ $lwalk7.asc , armagon_run8 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run8 =[ $lwalk8.asc , armagon_run9 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run9 =[ $lwalk9.asc , armagon_run10 ] + { + sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run10 =[ $lwalk10.asc , armagon_run11 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run11 =[ $lwalk11.asc , armagon_run12 ] + { + sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + }; +void() armagon_run12 =[ $lwalk12.asc , armagon_run1 ] + { + ChangeYaw(); + RUN_STRAIGHT = 1; + ai_run(14); + armagon_think(); + if((self.cnt == 1) && (time > self.attack_finished)) + { + float delta; + delta = self.ideal_yaw - self.angles_y; + if(delta > 180) delta = delta - 360; + if(delta < -180) delta = delta + 360; + if(delta>0) + self.think = armagon_overleft1; + else + self.think = armagon_overright1; + return; + } + if(self.lefty == 1) + { + self.lefty = 0; + self.think = self.th_missile; + } + }; + +void() armagon_watk1 =[ $lw0fir1.asc, armagon_watk2 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk2 =[ $lw0fir2.asc, armagon_watk3 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk3 =[ $lw0fir3.asc, armagon_watk4 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk4 =[ $lw0fir4.asc, armagon_watk5 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk5 =[ $lw0fir5.asc, armagon_watk6 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk6 =[ $lw0fir6.asc, armagon_watk7 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();armagon_launch_missile(40,0);}; +void() armagon_watk7 =[ $lw0fir7.asc, armagon_watk8 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk8 =[ $lw0fir8.asc, armagon_watk9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk9 =[ $lw0fir9.asc, armagon_watk10 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk10 =[ $lw0fir10.asc, armagon_watk11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk11 =[ $lw0fir11.asc, armagon_watk13 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();armagon_launch_missile(-40,0);}; +//void() armagon_watk12 =[ $lw0fir12.asc, armagon_watk13 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_watk13 =[ $lw0fir12.asc, armagon_run1 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();SUB_AttackFinished (1.0);}; + +void() armagon_wlaseratk1 =[ $lw0fir1.asc, armagon_wlaseratk2 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk2 =[ $lw0fir2.asc, armagon_wlaseratk3 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk3 =[ $lw0fir3.asc, armagon_wlaseratk4 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk4 =[ $lw0fir4.asc, armagon_wlaseratk5 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk5 =[ $lw0fir5.asc, armagon_wlaseratk6 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk6 =[ $lw0fir6.asc, armagon_wlaseratk7 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();armagon_launch_laser(40);}; +void() armagon_wlaseratk7 =[ $lw0fir7.asc, armagon_wlaseratk8 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk8 =[ $lw0fir8.asc, armagon_wlaseratk9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk9 =[ $lw0fir9.asc, armagon_wlaseratk10 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk10 =[ $lw0fir10.asc, armagon_wlaseratk11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk11 =[ $lw0fir11.asc, armagon_wlaseratk13 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();armagon_launch_laser(-40);}; +//void() armagon_wlaseratk12 =[ $lw0fir12.asc, armagon_wlaseratk13 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();}; +void() armagon_wlaseratk13 =[ $lw0fir12.asc, armagon_run1 ] {ChangeYaw();walkmove(self.angles_y, 14);armagon_think();SUB_AttackFinished (1.0);}; + +void() armagon_overleft1 =[ $lw1fir1.asc, armagon_overleft2 ] {self.count=0;armagon_overleft_think();}; +void() armagon_overleft2 =[ $lw1fir2.asc, armagon_overleft3 ] {armagon_overleft_think();}; +void() armagon_overleft3 =[ $lw1fir3.asc, armagon_overleft4 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overleft_think();}; +void() armagon_overleft4 =[ $lw1fir4.asc, armagon_overleft5 ] {armagon_overleft_think();}; +void() armagon_overleft5 =[ $lw1fir5.asc, armagon_overleft6 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_overleft_think();}; +void() armagon_overleft6 =[ $lw1fir6.asc, armagon_overleft7 ] {armagon_overleft_think();}; +void() armagon_overleft7 =[ $lw1fir7.asc, armagon_overleft8 ] {armagon_overleft_think();}; +void() armagon_overleft8 =[ $lw1fir8.asc, armagon_overleft9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overleft_think();}; +void() armagon_overleft9 =[ $lw1fir9.asc, armagon_overleft10 ] {armagon_overleft_think();}; +void() armagon_overleft10 =[ $lw1fir10.asc, armagon_overleft11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_overleft_think();}; +void() armagon_overleft11 =[ $lw1fir11.asc, armagon_overleft12 ] {self.count=1;armagon_overleft_think();}; +void() armagon_overleft12 =[ $lw1fir12.asc, armagon_overleft13 ] {self.count=2;armagon_overleft_think();}; +void() armagon_overleft13 =[ $lw1fir13.asc, armagon_overleft14 ] {armagon_overleft_think();}; +void() armagon_overleft14 =[ $lw1fir14.asc, armagon_overleft15 ] {armagon_overleft_think();}; +void() armagon_overleft15 =[ $lw1fir15.asc, armagon_run1 ] {armagon_overleft_think();SUB_AttackFinished (1.0);}; + +void() armagon_overright1 =[ $lw2fir1.asc, armagon_overright2 ] {self.count=0;armagon_overright_think();}; +void() armagon_overright2 =[ $lw2fir2.asc, armagon_overright3 ] {armagon_overright_think();}; +void() armagon_overright3 =[ $lw2fir3.asc, armagon_overright4 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overright_think();}; +void() armagon_overright4 =[ $lw2fir4.asc, armagon_overright5 ] {armagon_overright_think();}; +void() armagon_overright5 =[ $lw2fir5.asc, armagon_overright6 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);self.count=1;armagon_overright_think();}; +void() armagon_overright6 =[ $lw2fir6.asc, armagon_overright7 ] {self.count=2;armagon_overright_think();}; +void() armagon_overright7 =[ $lw2fir7.asc, armagon_overright8 ] {armagon_overright_think();}; +void() armagon_overright8 =[ $lw2fir8.asc, armagon_overright9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overright_think();}; +void() armagon_overright9 =[ $lw2fir9.asc, armagon_overright10 ] {armagon_overright_think();}; +void() armagon_overright10 =[ $lw2fir10.asc, armagon_overright11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_overright_think();}; +void() armagon_overright11 =[ $lw2fir11.asc, armagon_overright12 ] {armagon_overright_think();}; +void() armagon_overright12 =[ $lw2fir12.asc, armagon_run1 ] {armagon_overright_think();SUB_AttackFinished (1.0);}; + +void() armagon_plant1 =[ $lstand1.asc, armagon_plant1 ] {armagon_stand_attack();armagon_think();}; + +void() armagon_stop1 =[ $tranl1.asc, armagon_stop2 ] {armagon_think();}; +void() armagon_stop2 =[ $tranl2.asc, armagon_plant1 ] {sound(self, 6, "armagon/footfall.wav",1,ATTN_ARMAGON);armagon_think();}; + + + +void() armagon_satk1 =[ $lsfire1.asc, armagon_satk2 ] {armagon_think();}; +void() armagon_satk2 =[ $lsfire2.asc, armagon_satk3 ] {armagon_think();}; +void() armagon_satk3 =[ $lsfire3.asc, armagon_satk4 ] {armagon_think();}; +void() armagon_satk4 =[ $lsfire4.asc, armagon_satk5 ] {armagon_think();}; +void() armagon_satk5 =[ $lsfire5.asc, armagon_satk6 ] {armagon_think();}; +void() armagon_satk6 =[ $lsfire6.asc, armagon_satk7 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_think();}; +void() armagon_satk7 =[ $lsfire7.asc, armagon_satk8 ] {armagon_think();}; +void() armagon_satk8 =[ $lsfire8.asc, armagon_satk9 ] {armagon_think();}; +void() armagon_satk9 =[ $lsfire9.asc, armagon_satk10 ] {armagon_think();armagon_launch_missile(40,0);armagon_launch_missile(-40,0);}; +void() armagon_satk10 =[ $lsfire10.asc, armagon_satk11 ] {armagon_think();}; +void() armagon_satk11 =[ $lsfire9.asc, armagon_satk12 ] {armagon_think();armagon_launch_missile(40,0);armagon_launch_missile(-40,0);}; +void() armagon_satk12 =[ $lsfire10.asc, armagon_satk13 ] {armagon_think();}; +void() armagon_satk13 =[ $lsfire9.asc, armagon_satk14 ] {armagon_think();armagon_launch_missile(40,0);armagon_launch_missile(-40,0);}; +void() armagon_satk14 =[ $lsfire10.asc, armagon_satk15 ] {armagon_think();}; +void() armagon_satk15 =[ $lsfire11.asc, armagon_satk16 ] {armagon_think();}; +void() armagon_satk16 =[ $lsfire12.asc, armagon_plant1 ] {armagon_think();SUB_AttackFinished (0.3);}; + +void() armagon_slaser1 =[ $lsfire1.asc, armagon_slaser2 ] {armagon_think();}; +void() armagon_slaser2 =[ $lsfire2.asc, armagon_slaser3 ] {armagon_think();}; +void() armagon_slaser3 =[ $lsfire3.asc, armagon_slaser4 ] {armagon_think();}; +void() armagon_slaser4 =[ $lsfire4.asc, armagon_slaser5 ] {armagon_think();}; +void() armagon_slaser5 =[ $lsfire5.asc, armagon_slaser6 ] {armagon_think();}; +void() armagon_slaser6 =[ $lsfire6.asc, armagon_slaser7 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_think();}; +void() armagon_slaser7 =[ $lsfire7.asc, armagon_slaser8 ] {armagon_think();}; +void() armagon_slaser8 =[ $lsfire8.asc, armagon_slaser9 ] {armagon_think();}; +void() armagon_slaser9 =[ $lsfire9.asc, armagon_slaser10 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; +void() armagon_slaser10 =[ $lsfire10.asc, armagon_slaser11 ] {armagon_think();}; +void() armagon_slaser11 =[ $lsfire9.asc, armagon_slaser12 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; +void() armagon_slaser12 =[ $lsfire10.asc, armagon_slaser13 ] {armagon_think();}; +void() armagon_slaser13 =[ $lsfire9.asc, armagon_slaser14 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; +void() armagon_slaser14 =[ $lsfire10.asc, armagon_slaser15 ] {armagon_think();}; +void() armagon_slaser15 =[ $lsfire9.asc, armagon_slaser16 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; +void() armagon_slaser16 =[ $lsfire10.asc, armagon_slaser17 ] {armagon_think();}; +void() armagon_slaser17 =[ $lsfire9.asc, armagon_slaser18 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; +void() armagon_slaser18 =[ $lsfire10.asc, armagon_slaser19 ] {armagon_think();}; +void() armagon_slaser19 =[ $lsfire11.asc, armagon_slaser20 ] {armagon_think();}; +void() armagon_slaser20 =[ $lsfire12.asc, armagon_plant1 ] {armagon_think();SUB_AttackFinished (0.3);}; + +void() armagon_body_explode1; + +void() armagon_die1 =[ $tranl1.asc, armagon_die2 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die2 =[ $tranl2.asc, armagon_die3 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die3 =[ $ldie1.asc, armagon_die4 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die4 =[ $ldie2.asc, armagon_die5 ] + { + armagon_think(); + multi_explosion(self.origin + '0 0 48', 48, 10, 6, 0.3, 0.3); + sound(self, CHAN_AUTO, "armagon/death.wav", 1, ATTN_NONE); + self.nextthink = time + 0.2; + }; +void() armagon_die5 =[ $ldie3.asc, armagon_die6 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die6 =[ $ldie4.asc, armagon_die7 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die7 =[ $ldie5.asc, armagon_die8 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die8 =[ $ldie6.asc, armagon_die9 ] + { + armagon_think(); + self.nextthink = time + 2; + }; +void() armagon_die9 =[ $ldie7.asc, armagon_die10 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die10 =[ $ldie8.asc, armagon_die11 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die11 =[ $ldie9.asc, armagon_die12 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die12 =[ $ldie10.asc, armagon_die13 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die13 =[ $ldie11.asc, armagon_die14 ] {armagon_think();self.nextthink = time + 0.2;}; +void() armagon_die14 =[ $ldie12.asc, armagon_die14 ] + { + entity body; + + armagon_think(); + multi_explosion(self.origin + '0 0 80', 20, 10, 3, 0.1, 0.5); + // legs + self.nextthink = -1; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + setsize(self, '-32 -32 -24', '32 32 32'); + self.flags = 0; + self.gorging = TRUE; + self.wait = time + 5; + + //body + body = self.trigger_field; + body.nextthink = -1; + self.movetype = MOVETYPE_NONE; + body.takedamage = DAMAGE_NO; + body.solid = SOLID_NOT; +// setsize(body, '-32 -32 30', '32 32 64'); + body.think = armagon_body_explode1; + body.nextthink = time + 0.1; + body.gorging = TRUE; + }; + +void() armagon_body_explode2 = + { + sound(self , CHAN_AUTO, "misc/longexpl.wav", 1, ATTN_ARMAGON); + self.think = armagon_body_explode2; + ThrowGib("progs/gib1.mdl", -200); + ThrowGib("progs/gib2.mdl", -200); + ThrowGib("progs/gib3.mdl", -200); + ThrowGib("progs/gib1.mdl", -200); + ThrowGib("progs/gib2.mdl", -200); + ThrowGib("progs/gib3.mdl", -200); + ThrowGib("progs/gib1.mdl", -200); + ThrowGib("progs/gib2.mdl", -200); + ThrowGib("progs/gib3.mdl", -200); + self.movetype = MOVETYPE_NONE; + setmodel(self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + self.nextthink = time + 0.1; + s_explode1(); + }; + +void() armagon_body_explode1 = + { + + self.think = armagon_body_explode1; + self.nextthink = time + 0.1; + if(self.cnt == 0) + { + self.count = 0; + } + if(self.cnt < 25) + { + if(self.cnt > self.count) + { + ThrowGib("progs/gib1.mdl", -100); + ThrowGib("progs/gib2.mdl", -100); + ThrowGib("progs/gib3.mdl", -100); + self.count = self.cnt + 1; + } + self.cnt = self.cnt + 1; + } + else + { + self.cnt = 0; + self.think = armagon_body_explode2; + } + }; + +void(entity attacker, float damage) armagon_pain = + { + if(self.health <= 0) + return; // allready dying, don't go into pain frame + + if(damage < 25) + return; + if(self.pain_finished > time) + return; + self.pain_finished = time + 2; + + sound(self, CHAN_VOICE, "armagon/pain.wav", 1, ATTN_NORM); + }; + + + +void() armagon_missile_attack = + { + if(random()<0.5) + armagon_watk1(); + else + armagon_wlaseratk1(); +// self.nextthink = time + 0.1; + }; + +void() armagon_repulse_attack = + { + armagon_think(); + if(self.state == 0) + { + SUB_AttackFinished (0.5); + sound(self, CHAN_BODY, "armagon/repel.wav", 1, ATTN_NORM); + self.state = 1; + return; + } + else if(self.state == 1) + { + entity head; + vector dir; + + // look in our immediate vicinity + head = findradius(self.origin, 300); + while(head) + { + if(!(head.flags & FL_NOTARGET) && (head.flags & FL_CLIENT)) + { + if(visible(head) && (head.health > 0)) + { + dir = head.origin - (self.origin - '0 0 24'); + dir = normalize(dir); + head.velocity = head.velocity + dir*1500; + } + } + head = head.chain; + } + T_RadiusDamage(self, self, 60, self); + self.state = 0; + SUB_AttackFinished (0.1); + } +// self.nextthink = time + 0.1; + }; + +void() armagon_stand_attack = + { + vector spot1, spot2; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = self.enemy.origin + self.enemy.view_ofs; + + traceline(spot1, spot2, FALSE, self); + + if(trace_ent != self.enemy) + { + armagon_run1(); + return; + } + + if(trace_inopen && trace_inwater) + { + armagon_run1(); + return; + } + + if(time < self.attack_finished) + { + return; + } + + if((vlen(spot2-spot1) < 200) && (self.enemy.classname == "player")) + { + armagon_repulse_attack(); + return; + } + + self.state = 0; + + if(vlen(spot2-spot1) > 450) + { + armagon_run1(); + return; + } + + if(random()<0.5) + armagon_satk1(); + else + armagon_slaser1(); + + if(self.cnt == 1) + { + armagon_run1(); + return; + } + }; + + +float() ArmagonCheckAttack = + { + vector spot1, spot2; + entity targ; + float ang; + float delta; + float dist; + + self.lefty = 0; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline(spot1, spot2, FALSE, self); + + if((trace_ent != targ) && (!self.charmed)) + return FALSE; // don't have a clear shot + + if(trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if(time < self.attack_finished) + return FALSE; + + ang = self.angles_y + self.fixangle; + delta = self.ideal_yaw - ang; + dist = vlen(spot2-spot1); + if((fabs(delta) > 10 && (dist > 200)) || (self.enemy.classname != "player")) + return FALSE; + if(dist < 400) + { // melee attack + self.th_melee(); + return TRUE; + } +// missile attack + self.lefty = 1; +// self.th_missile(); +// SUB_AttackFinished (1.5*random()); + return FALSE; + }; + + +/*QUAKED monster_armagon (1 0 0) (-32 -32 -24) (32 32 64) Ambush +*/ +void() monster_armagon +{ + entity body; + float sk; + if(deathmatch) + { + remove(self); + return; + } + + self.lefty = 0; + + sk = cvar_hget(cvarh_skill); + + precache_model("progs/armabody.mdl"); + precache_model("progs/armalegs.mdl"); + + precache_sound("armagon/footfall.wav"); + precache_sound("armagon/servo.wav"); +// precache_sound("armagon/footfall2.wav"); + precache_sound("armagon/death.wav"); +// precache_sound("armagon/death2.wav"); + precache_sound("armagon/pain.wav"); + precache_sound("armagon/repel.wav"); +// precache_sound("armagon/idle.wav"); + precache_sound("armagon/sight.wav"); + precache_sound("armagon/idle1.wav"); + precache_sound("armagon/idle2.wav"); + precache_sound("armagon/idle3.wav"); + precache_sound("armagon/idle4.wav"); + + body = spawn(); + body.origin = self.origin; + body.origin = body.origin - '0 0 64'; +// SUB_CopyEntity(self,body); + + self.solid = SOLID_SLIDEBOX; + self.fixangle = 0; + self.movetype = MOVETYPE_STEP; + body.solid = SOLID_NOT; + body.movetype = MOVETYPE_STEP; + self.trigger_field = body; + body.trigger_field = self; + + setmodel(body, "progs/armabody.mdl"); + setmodel(self, "progs/armalegs.mdl"); + + setsize(self, '-48 -48 -24', '48 48 84'); + setorigin(self, self.origin); + setorigin(body, body.origin); + if(sk==0) + { + self.yaw_speed = 5; + self.health = 2000; + self.worldtype = 0.9; + } + else if(sk==1) + { + self.yaw_speed = 9; + self.health = 2500; + self.worldtype = 0.85; + } + else + { + self.yaw_speed = 12; + self.health = 3500; + self.worldtype = 0.75; + } + self.state = 0; + self.super_time = 0; + self.endtime = 0; + + self.th_stand = armagon_stand1; + self.th_walk = armagon_walk1; + self.th_run = armagon_run1; + self.th_die = armagon_die1; + self.th_missile = armagon_missile_attack; + self.th_melee = armagon_stop1; + self.th_pain = armagon_pain; + walkmonster_start(); +}; diff --git a/QC/hip_mon_grem.qc b/QC/hip_mon_grem.qc new file mode 100644 index 00000000..d718ac58 --- /dev/null +++ b/QC/hip_mon_grem.qc @@ -0,0 +1,1933 @@ +/* +============================================================================== + +gremlin + +============================================================================== +*/ +$cd hipwork\models\grem +$origin 0 0 23 +$scale 2 +$base grembase.asc + +$skin grem + +$frame stand1.asc stand2.asc stand3.asc stand4.asc stand5.asc stand6.asc +$frame stand7.asc stand8.asc stand9.asc stand10.asc stand11.asc stand12.asc +$frame stand13.asc stand14.asc stand15.asc stand16.asc stand17.asc + +$frame walk1.asc walk2.asc walk3.asc walk4.asc walk5.asc walk6.asc +$frame walk7.asc walk8.asc walk9.asc walk10.asc walk11.asc walk12.asc + +$frame run1.asc run2.asc run3.asc run4.asc run5.asc run6.asc run7.asc run8.asc +$frame run9.asc run10.asc run11.asc run12.asc run13.asc run14.asc run15.asc + +$frame jump1.asc jump2.asc jump3.asc jump4.asc jump5.asc jump6.asc jump7.asc +$frame jump8.asc jump9.asc jump10.asc jump11.asc jump12.asc jump13.asc jump14.asc +$frame jump15.asc jump16.asc + +$frame attk1.asc attk2.asc attk3.asc attk4.asc attk5.asc attk6.asc +$frame attk7.asc attk8.asc attk9.asc attk10.asc attk11.asc + +$frame maul1.asc maul2.asc maul3.asc maul4.asc maul5.asc maul6.asc +$frame maul7.asc maul8.asc maul9.asc maul10.asc maul11.asc maul12.asc maul13.asc + +$frame spawn1.asc spawn2.asc spawn3.asc spawn4.asc spawn5.asc spawn6.asc + +$frame look1.asc look2.asc look3.asc look4.asc look5.asc look6.asc look7.asc +$frame look8.asc look9.asc look10.asc + +$frame pain1.asc pain2.asc pain3.asc pain4.asc + +$frame death1.asc death2.asc death3.asc death4.asc death5.asc death6.asc death7.asc +$frame death8.asc death9.asc death10.asc death11.asc death12.asc + +$frame flip1.asc flip2.asc flip3.asc flip4.asc flip5.asc flip6.asc flip7.asc +$frame flip8.asc + +$frame lunge1.asc lunge2.asc lunge3.asc lunge4.asc lunge5.asc lunge6.asc lunge7.asc +$frame lunge8.asc lunge9.asc lunge10.asc lunge11.asc + +$frame gfire1.asc gfire2.asc gfire3.asc gfire4.asc gfire5.asc gfire6.asc + +$frame glook1.asc glook2.asc glook3.asc glook4.asc glook5.asc glook6.asc glook7.asc +$frame glook8.asc glook9.asc glook10.asc glook11.asc glook12.asc glook13.asc +$frame glook14.asc glook15.asc glook16.asc glook17.asc glook18.asc glook19.asc glook20.asc + +$frame gpain1.asc gpain2.asc gpain3.asc + +$frame grun1.asc grun2.asc grun3.asc grun4.asc grun5.asc grun6.asc grun7.asc +$frame grun8.asc grun9.asc grun10.asc grun11.asc grun12.asc grun13.asc grun14.asc grun15.asc + +//============================================================================ + +float NumGremlins; +float NumSpawnGremlins; + +/* +=========== +GremlinAttemptWeaponSteal + +see if we can steal enemy's weapon + +============ +*/ +void(entity xEntVictim, entity xEntGremlin, + float xWeaponId, float xAmmoId, float xAmmoLimit) GremlinDoAmmoAndWeaponSteal = +{ + float amount; + amount = VR_AmmoUtil_GetAmmoCountByAmmoId(xEntVictim, xAmmoId); + + if(amount > xAmmoLimit) { amount = xAmmoLimit; } + + VR_AmmoUtil_DelAmmoCountByAmmoId(xEntVictim, xAmmoId, amount); + VR_AmmoUtil_AddAmmoCountByAmmoId(xEntGremlin, xAmmoId, amount); + VR_ItemUtil_EntAddItem(xEntGremlin, VR_AmmoUtil_AmmoIdToItemId(xAmmoId)); + xEntGremlin.currentammo = VR_AmmoUtil_GetAmmoCountByAmmoId(xEntGremlin, xAmmoId); + + sprint(xEntVictim, "Gremlin stole your "); + sprint(xEntVictim, WeaponIdToWeaponName(xWeaponId)); + sprint(xEntVictim, "!\n"); +} + + +float() GremlinAttemptWeaponSteal = +{ + vector delta; + float best; + entity victim; + + if(self.stoleweapon) + { + dprint("gremlin trying to steal a weapon again\n"); + return FALSE; + } + + if(!(self.enemy.flags & FL_CLIENT)) + { + return FALSE; + } + + delta = (self.enemy.origin - self.origin); + + if(vlen(delta) > 100) + return FALSE; + + if(random() < 0.4) + return FALSE; + + // + // we are within range so lets go for it + // + victim = self.enemy; + + float victimWeapons[8]; + victimWeapons[0] = victim.holsterweapon0; + victimWeapons[1] = victim.holsterweapon1; + victimWeapons[2] = victim.holsterweapon2; + victimWeapons[3] = victim.holsterweapon3; + victimWeapons[4] = victim.holsterweapon4; + victimWeapons[5] = victim.holsterweapon5; + victimWeapons[6] = victim.weapon; + victimWeapons[7] = victim.weapon2; + + float idx = -1; + best = WID_FIST; + for(float tries = 0; tries < 15; ++tries) + { + idx = ceil(random() * 7.1); + + if(idx < 0) { idx = 0; } + else if(idx > 7) { idx = 7; } + + if(victimWeapons[idx] == WID_FIST) + { + continue; + } + + best = victimWeapons[idx]; + break; + } + + if(best == WID_FIST || best == WID_MJOLNIR) + { + return FALSE; + } + + // take that weapon from the entity + if(getWeaponMode() == QVR_WEAPONMODE_CYCLEQUICKSLOT) + { + VR_WeaponUtil_EntDelWeapon(victim, best); + } + + // deal with stolen holster weapon + float hotspot; + hotspot = -1; + + if(idx == 0) { hotspot = QVR_HS_LEFT_SHOULDER_HOLSTER; } + else if(idx == 1) { hotspot = QVR_HS_RIGHT_SHOULDER_HOLSTER; } + else if(idx == 2) { hotspot = QVR_HS_LEFT_HIP_HOLSTER; } + else if(idx == 3) { hotspot = QVR_HS_RIGHT_HIP_HOLSTER; } + else if(idx == 4) { hotspot = QVR_HS_LEFT_UPPER_HOLSTER; } + else { ASSERT(idx == 5); hotspot = QVR_HS_RIGHT_UPPER_HOLSTER; } + + entity tmpSelf; + + if(hotspot != -1) + { + tmpSelf = self; + self = victim; + setHolsterWeapon(hotspot, WID_FIST); + setHolsterWeaponModel(hotspot, WeaponIdToModel(WID_FIST, 0 /* weaponflags */)); + self = tmpSelf; + } + else + { + // deal with stolen hand weapon + + float hand; + + if(idx == 6) { hand = cVR_MainHand; } + else { ASSERT(idx == 7); hand = cVR_OffHand; } + + VRSetHandEmpty(victim, hand); + + tmpSelf = self; + self = victim; + W_SetCurrentAmmoFor(hand); + self = tmpSelf; + } + + sound(victim, CHAN_BODY, "knight/sword2.wav", 0.7, ATTN_NORM); + + // give it to our gremlin + VR_WeaponUtil_EntAddWeapon(self, best); + self.weapon = best; + + // take some ammo while we are at it + VR_ItemUtil_EntDelItem(self, IID_SHELLS); + VR_ItemUtil_EntDelItem(self, IID_NAILS); + VR_ItemUtil_EntDelItem(self, IID_ROCKETS); + VR_ItemUtil_EntDelItem(self, IID_CELLS); + + if(best == WID_AXE) + { + sprint(victim, "Gremlin stole your "); + sprint(victim, WeaponIdToWeaponName(best)); + sprint(victim, "!\n"); + } + else if(best == WID_SHOTGUN) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_SHOTGUN, AID_SHELLS, 10); + } + else if(best == WID_SUPER_SHOTGUN) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_SUPER_SHOTGUN, AID_SHELLS, 20); + } + else if(best == WID_NAILGUN) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_NAILGUN, AID_NAILS, 40); + } + else if(best == WID_SUPER_NAILGUN) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_SUPER_NAILGUN, AID_NAILS, 40); + } + else if(best == WID_GRENADE_LAUNCHER) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_GRENADE_LAUNCHER, AID_ROCKETS, 5); + } + else if(best == WID_ROCKET_LAUNCHER) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_ROCKET_LAUNCHER, AID_ROCKETS, 5); + } + else if(best == WID_LIGHTNING) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_LIGHTNING, AID_CELLS, 40); + } + else if(best == WID_LASER_CANNON) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_LASER_CANNON, AID_CELLS, 40); + } + else if(best == WID_PROXIMITY_GUN) + { + GremlinDoAmmoAndWeaponSteal(victim, self, WID_PROXIMITY_GUN, AID_ROCKETS, 5); + } + + // tag the gremlin as having stolen a weapon + self.stoleweapon = TRUE; + self.attack_finished = time; + + // don't fire the first shot at the person we stole the weapon from + // all the time + if(random() > 0.85) + self.lastvictim = victim; + else + self.lastvictim = self; + + // self.attack_state = AS_STRAIGHT; + + // find a recipient + victim = GremlinFindVictim(); + + if(victim != world) + { + self.enemy = victim; + FoundTarget(); + self.attack_finished = time; + self.search_time = time + 1.0; + } + + return TRUE; +} + +//============================================================================ + +/* +=========== +GremlinFindTarget + +gremlin is currently not attacking anything, so try to find a target + +============ +*/ +float() GremlinFindTarget = + { + entity head; + entity gorge; + float dist; + float result; + + if((self.stoleweapon==0) && time > self.wait) + { + self.wait = time + 1.0; + dist = 2000; + gorge = world; + head = nextent(world); + while(head!=world) + { + if((head.health < 1) && (head.flags & (FL_MONSTER|FL_CLIENT))) + { + result = fabs(head.origin_z - self.origin_z); + if((visible(head)) && (result<80) && (head.gorging == FALSE) && (visible_distance<dist)) + { + dist = visible_distance; + gorge = head; + } + } + head = nextent(head); + } + if((gorge != world) && (dist < (700*random()))) + { +// dprint("starting to gorge on "); +// dprint(gorge.classname); +// dprint("\n"); + self.oldenemy = self.enemy; + self.gorging = TRUE; + self.enemy = gorge; + self.search_time = time + 4.0; + FoundTarget(); + return TRUE; + } + } + else if(self.stoleweapon) + { + head = GremlinFindVictim(); + if(head != world) + { + self.enemy = head; + FoundTarget(); + self.attack_finished = time; + self.search_time = time + 2.0; + return TRUE; + } + } + result = FindTarget(); + self.search_time = time + 2.0; + return result; + }; +//============================================================================ +/* +============= +gremlin_walk + +The monster is walking it's beat +============= +*/ +void(float dist) gremlin_walk = + { + movedist = dist; + + // check for noticing a player + if(GremlinFindTarget ()) + return; + + movetogoal (dist); + }; + +//============================================================================ + +/* +============= +gremlin_stand + +The monster is staying in one place for a while, with slight angle turns +============= +*/ +void() gremlin_stand = + { + if(FindTarget ()) + return; + + if(time > self.pausetime) + { + self.th_walk(); + return; + } + }; + +//============================================================================ +float() GremlinCheckNoAmmo; +void() gremlin_glook1; +/* +============= +gremlin_run + +The monster has an enemy it is trying to kill +============= +*/ +void(float dist) gremlin_run = +{ + float r; + vector d; + + if(self.watertype == CONTENT_LAVA) + { // do damage + T_Damage(self, world, world, 2000); + } + + movedist = dist; + + if(self.stoleweapon && self.weapon != WID_AXE) + { + self.frame = self.frame + $grun1.asc - $run1.asc; + } + + if(self.gorging) + { + traceline(self.origin, self.enemy.origin, TRUE, self); + if(trace_fraction != 1.0) + { + self.gorging = FALSE; + return; + } + + if(!visible(self.enemy)) + { + self.gorging = FALSE; + return; + } + + r = vlen(self.enemy.origin - self.origin); + + if(r < 130) + { + ai_face(); + + if(r < 45) + { + self.th_melee(); + self.attack_state = AS_STRAIGHT; + return; + } + else if(walkmove(self.angles_y, dist) == FALSE) + { + self.gorging = FALSE; + return; + } + + return; + } + + movetogoal (dist); // done in C code... + } + else + { + if(random()>0.97) + { + if(GremlinFindTarget()) + return; + } + // get away from player if we stole a weapon + if(self.stoleweapon && self.weapon != WID_AXE) + { + if(self.enemy.health < 0 && self.enemy.classname == "player") + { + gremlin_glook1(); + return; + } + if(!GremlinCheckNoAmmo()) + { + if(self.t_length==1) + { + remove(self.trigger_field); + self.goalentity = self.enemy; + self.t_length = 0; + } + return; + } + r = vlen(self.enemy.origin - self.origin); + d = normalize(self.origin-self.enemy.origin); + if(self.t_length == 0) + { + if(r<150) + { + self.trigger_field = spawn(); + setsize(self.trigger_field,'-1 -1 -1','1 1 1'); + self.t_length = 1; + } + } + if(self.t_length==1) + { + if(r > 250) + { + remove(self.trigger_field); + self.goalentity = self.enemy; + self.t_length = 0; +// self.attack_state = AS_SLIDING; + } + else + { + if(r < 160) + { + vector ang; + float done; + vector end = self.enemy.origin; + float c; + + ang = vectoangles(d); + done = 0; + c = 0; + while(done == 0) + { + makevectors(ang); + end = self.enemy.origin + v_forward * 350; + traceline(self.enemy.origin,end,FALSE,self); + if(trace_fraction == 1.0) + { + traceline(self.origin,end,FALSE,self); + if(trace_fraction == 1.0) + done = 1; + } + ang_y = anglemod(ang_y + 36); + c = c + 1; + if(c == 10) + { + done = 1; + } + } + setorigin(self.trigger_field,end); + } + self.goalentity = self.trigger_field; + self.ideal_yaw = vectoyaw(normalize(self.goalentity.origin-self.origin)); + ChangeYaw(); + movetogoal (dist); // done in C code... + self.nextthink = time + 0.1; + return; + } + } + } + ai_run(dist); + self.nextthink = time + 0.1; + } + }; + +//============================================================================ + +void() Gremlin_JumpTouch; +void() Gremlin_FlipTouch; +void(float side) Gremlin_Melee; +void(float side) Gremlin_Gorge; + +void() gremlin_stand1 =[ $stand1.asc, gremlin_stand2 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand2 =[ $stand2.asc, gremlin_stand3 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand3 =[ $stand3.asc, gremlin_stand4 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand4 =[ $stand4.asc, gremlin_stand5 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand5 =[ $stand5.asc, gremlin_stand6 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand6 =[ $stand6.asc, gremlin_stand7 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand7 =[ $stand7.asc, gremlin_stand8 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand8 =[ $stand8.asc, gremlin_stand9 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand9 =[ $stand9.asc, gremlin_stand10 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand10 =[ $stand10.asc, gremlin_stand11 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand11 =[ $stand11.asc, gremlin_stand12 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand12 =[ $stand12.asc, gremlin_stand13 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand13 =[ $stand13.asc, gremlin_stand14 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand14 =[ $stand14.asc, gremlin_stand15 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand15 =[ $stand15.asc, gremlin_stand16 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand16 =[ $stand16.asc, gremlin_stand17 ] {gremlin_stand();self.nextthink = time + 0.2;}; +void() gremlin_stand17 =[ $stand17.asc, gremlin_stand1 ] {gremlin_stand();self.nextthink = time + 0.2;}; + +void() gremlin_walk1 =[ $walk1.asc, gremlin_walk2 ] { +if(random() < 0.1) + sound(self, CHAN_VOICE, "grem/idle.wav", 1, ATTN_IDLE); +gremlin_walk(8);}; +void() gremlin_walk2 =[ $walk2.asc, gremlin_walk3 ] {gremlin_walk(8);}; +void() gremlin_walk3 =[ $walk3.asc, gremlin_walk4 ] {gremlin_walk(8);}; +void() gremlin_walk4 =[ $walk4.asc, gremlin_walk5 ] {gremlin_walk(8);}; +void() gremlin_walk5 =[ $walk5.asc, gremlin_walk6 ] {gremlin_walk(8);}; +void() gremlin_walk6 =[ $walk6.asc, gremlin_walk7 ] {gremlin_walk(8);}; +void() gremlin_walk7 =[ $walk7.asc, gremlin_walk8 ] {gremlin_walk(8);}; +void() gremlin_walk8 =[ $walk8.asc, gremlin_walk9 ] {gremlin_walk(8);}; +void() gremlin_walk9 =[ $walk9.asc, gremlin_walk10 ] {gremlin_walk(8);}; +void() gremlin_walk10 =[ $walk10.asc, gremlin_walk11 ] {gremlin_walk(8);}; +void() gremlin_walk11 =[ $walk11.asc, gremlin_walk12 ] {gremlin_walk(8);}; +void() gremlin_walk12 =[ $walk12.asc, gremlin_walk1 ] {gremlin_walk(8);}; + +void() gremlin_run1 =[ $run1.asc, gremlin_run2 ] { +if(random() < 0.1) + sound(self, CHAN_VOICE, "grem/idle.wav", 1, ATTN_IDLE); +gremlin_run(0);}; +void() gremlin_run2 =[ $run2.asc, gremlin_run3 ] {gremlin_run(8);}; +void() gremlin_run3 =[ $run3.asc, gremlin_run4 ] {gremlin_run(12);}; +void() gremlin_run4 =[ $run4.asc, gremlin_run5 ] {gremlin_run(16);}; +void() gremlin_run5 =[ $run5.asc, gremlin_run6 ] {gremlin_run(16);}; +void() gremlin_run6 =[ $run6.asc, gremlin_run7 ] {gremlin_run(12);}; +void() gremlin_run7 =[ $run7.asc, gremlin_run8 ] {gremlin_run(8);}; +void() gremlin_run8 =[ $run8.asc, gremlin_run9 ] {gremlin_run(0);}; +void() gremlin_run9 =[ $run9.asc, gremlin_run10 ] {gremlin_run(8);}; +void() gremlin_run10 =[ $run10.asc, gremlin_run11 ] {gremlin_run(12);}; +void() gremlin_run11 =[ $run11.asc, gremlin_run12 ] {gremlin_run(16);}; +void() gremlin_run12 =[ $run12.asc, gremlin_run1 ] {gremlin_run(16);}; +void() gremlin_run13 =[ $run13.asc, gremlin_run14 ] {gremlin_run(12);}; +void() gremlin_run14 =[ $run14.asc, gremlin_run15 ] {gremlin_run(8);}; +void() gremlin_run15 =[ $run15.asc, gremlin_run1 ] {gremlin_run(0);}; + +void() gremlin_jump1 =[ $jump1.asc, gremlin_jump2 ] {ai_face();}; +void() gremlin_jump2 =[ $jump2.asc, gremlin_jump3 ] {ai_face();}; +void() gremlin_jump3 =[ $jump3.asc, gremlin_jump4 ] {ai_face();}; +void() gremlin_jump4 =[ $jump4.asc, gremlin_jump5 ] {ai_face();}; +void() gremlin_jump5 =[ $jump5.asc, gremlin_jump6 ] +{ + ai_face(); + + if(self.flags & FL_ONGROUND) + { + self.touch = Gremlin_JumpTouch; + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 300 + '0 0 300'; + self.flags = self.flags - FL_ONGROUND; + } + else + { + gremlin_run1(); + } +}; +void() gremlin_jump6 =[ $jump6.asc, gremlin_jump7 ] {}; +void() gremlin_jump7 =[ $jump7.asc, gremlin_jump8 ] {}; +void() gremlin_jump8 =[ $jump8.asc, gremlin_jump9 ] {}; +void() gremlin_jump9 =[ $jump9.asc, gremlin_jump10 ] {}; +void() gremlin_jump10 =[ $jump10.asc, gremlin_jump11 ] {}; +void() gremlin_jump11 =[ $jump11.asc, gremlin_jump1 ] + { + self.nextthink = time + 3; + // if three seconds pass, assume gremlin is stuck and jump again + }; + +void() gremlin_jump12 =[ $jump12.asc, gremlin_jump13 ] {}; +void() gremlin_jump13 =[ $jump13.asc, gremlin_jump14 ] {}; +void() gremlin_jump14 =[ $jump14.asc, gremlin_jump15 ] {}; +void() gremlin_jump15 =[ $jump15.asc, gremlin_jump16 ] {}; +void() gremlin_jump16 =[ $jump16.asc, gremlin_run1 ] {}; + +void() gremlin_shot1 = [$gfire1.asc, gremlin_shot2 ] {self.effects = self.effects | EF_MUZZLEFLASH;}; +void() gremlin_shot2 = [$gfire2.asc, gremlin_shot3 ] {}; +void() gremlin_shot3 = [$gfire3.asc, gremlin_shot4 ] {}; +void() gremlin_shot4 = [$gfire4.asc, gremlin_shot5 ] {}; +void() gremlin_shot5 = [$gfire5.asc, gremlin_shot6 ] {}; +void() gremlin_shot6 = [$gfire6.asc, gremlin_run1 ] {}; + + +//============================================================================ +void(float ox) Gremlin_FireNailGun; + +void() gremlin_nail1 =[$gfire1.asc, gremlin_nail2 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireNailGun(4); + }; +void() gremlin_nail2 =[$gfire1.asc, gremlin_nail3 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireNailGun(4); + }; +void() gremlin_nail3 =[$gfire1.asc, gremlin_nail4 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireNailGun(4); + }; +void() gremlin_nail4 =[$gfire1.asc, gremlin_nail5 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireNailGun(4); + }; +void() gremlin_nail5 =[$gfire1.asc, gremlin_nail6 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireNailGun(4); + }; +void() gremlin_nail6 =[$gfire1.asc, gremlin_nail7 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireNailGun(4); + }; +void() gremlin_nail7 = [$gfire1.asc, gremlin_run1 ] {}; + + +void(float ox) Gremlin_FireLaserGun; + +void() gremlin_laser1 =[$gfire1.asc, gremlin_laser2 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireLaserGun(4); + }; +void() gremlin_laser2 =[$gfire1.asc, gremlin_laser3 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireLaserGun(4); + }; +void() gremlin_laser3 =[$gfire1.asc, gremlin_laser4 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireLaserGun(4); + }; +void() gremlin_laser4 =[$gfire1.asc, gremlin_laser5 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireLaserGun(4); + }; +void() gremlin_laser5 =[$gfire1.asc, gremlin_laser6 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireLaserGun(4); + }; +void() gremlin_laser6 =[$gfire1.asc, gremlin_laser7 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + Gremlin_FireLaserGun(4); + }; +void() gremlin_laser7 = [$gfire1.asc, gremlin_run1 ] {}; + +//============================================================================ + +void() Gremlin_FireLightningGun; +void() gremlin_light1 =[$gfire1.asc, gremlin_light2 ] + { + Gremlin_FireLightningGun(); + }; +void() gremlin_light2 = [$gfire1.asc, gremlin_light3 ] + { + Gremlin_FireLightningGun(); + }; +void() gremlin_light3 =[$gfire1.asc, gremlin_light4 ] + { + Gremlin_FireLightningGun(); + }; +void() gremlin_light4 = [$gfire1.asc, gremlin_light5 ] +{ + Gremlin_FireLightningGun(); +}; +void() gremlin_light5 = [$gfire1.asc, gremlin_run1 ] {}; + +//============================================================================ + +void() gremlin_rocket1 = [$gfire1.asc, gremlin_rocket2 ] {self.effects = self.effects | EF_MUZZLEFLASH;}; +void() gremlin_rocket2 = [$gfire2.asc, gremlin_rocket3 ] {}; +void() gremlin_rocket3 = [$gfire3.asc, gremlin_rocket4 ] {}; +void() gremlin_rocket4 = [$gfire4.asc, gremlin_rocket5 ] {}; +void() gremlin_rocket5 = [$gfire5.asc, gremlin_rocket6 ] {}; +void() gremlin_rocket6 = [$gfire6.asc, gremlin_run1 ] {}; + +void() gremlin_lunge1 =[ $lunge1.asc, gremlin_lunge2 ] {ai_charge(0);}; +void() gremlin_lunge2 =[ $lunge2.asc, gremlin_lunge3 ] {ai_charge(0);}; +void() gremlin_lunge3 =[ $lunge3.asc, gremlin_lunge4 ] {ai_charge(0);}; +void() gremlin_lunge4 =[ $lunge4.asc, gremlin_lunge5 ] {ai_charge(0);}; +void() gremlin_lunge5 =[ $lunge5.asc, gremlin_lunge6 ] {ai_charge(0);}; +void() gremlin_lunge6 =[ $lunge6.asc, gremlin_lunge7 ] {ai_charge(0);}; +void() gremlin_lunge7 =[ $lunge7.asc, gremlin_lunge8 ] {ai_charge(15);}; +void() gremlin_lunge8 =[ $lunge8.asc, gremlin_lunge9 ] {ai_charge(0);Gremlin_Melee(0);}; +void() gremlin_lunge9 =[ $lunge9.asc, gremlin_lunge10] {ai_charge(0);}; +void() gremlin_lunge10 =[ $lunge10.asc, gremlin_lunge11] {ai_charge(0);}; +void() gremlin_lunge11 =[ $lunge11.asc, gremlin_run1] {ai_charge(0);}; + +void() gremlin_claw1 =[ $attk1.asc, gremlin_claw2 ] {ai_charge(0);}; +void() gremlin_claw2 =[ $attk2.asc, gremlin_claw3 ] {ai_charge(0);}; +void() gremlin_claw3 =[ $attk3.asc, gremlin_claw4 ] {ai_charge(0);}; +void() gremlin_claw4 =[ $attk4.asc, gremlin_claw5 ] {ai_charge(0);}; +void() gremlin_claw5 =[ $attk5.asc, gremlin_claw6 ] {ai_charge(0);}; +void() gremlin_claw6 =[ $attk6.asc, gremlin_claw7 ] {ai_charge(0);Gremlin_Melee(200);}; +void() gremlin_claw7 =[ $attk7.asc, gremlin_claw8 ] {ai_charge(15);}; +void() gremlin_claw8 =[ $attk8.asc, gremlin_claw9 ] {ai_charge(0);}; +void() gremlin_claw9 =[ $attk9.asc, gremlin_claw10] {ai_charge(0);}; +void() gremlin_claw10 =[ $attk10.asc, gremlin_claw11] {ai_charge(0);}; +void() gremlin_claw11 =[ $attk11.asc, gremlin_run1] {ai_charge(0);}; + +void() gremlin_gorge1 =[ $maul1.asc, gremlin_gorge2] {ai_charge(1);}; +void() gremlin_gorge2 =[ $maul2.asc, gremlin_gorge3] {ai_charge(1);}; +void() gremlin_gorge3 =[ $maul3.asc, gremlin_gorge4] {ai_charge(2);}; +void() gremlin_gorge4 =[ $maul4.asc, gremlin_gorge5] {ai_charge(0);}; +void() gremlin_gorge5 =[ $maul5.asc, gremlin_gorge6] {ai_charge(0);}; +void() gremlin_gorge6 =[ $maul6.asc, gremlin_gorge7] {ai_charge(0);Gremlin_Gorge(200);}; +void() gremlin_gorge7 =[ $maul7.asc, gremlin_gorge8] {ai_charge(0);}; +void() gremlin_gorge8 =[ $maul8.asc, gremlin_gorge9] {ai_charge(0);Gremlin_Gorge(-200);}; +void() gremlin_gorge9 =[ $maul9.asc, gremlin_gorge10] {ai_charge(0);}; +void() gremlin_gorge10 =[ $maul10.asc, gremlin_gorge11] {ai_charge(0);}; +void() gremlin_gorge11 =[ $maul11.asc, gremlin_gorge12] {ai_charge(0);}; +void() gremlin_gorge12 =[ $maul12.asc, gremlin_gorge13] {ai_charge(0);}; +void() gremlin_gorge13 =[ $maul13.asc, gremlin_gorge1] {ai_charge(0);}; + +void() gremlin_look1 =[ $look1.asc, gremlin_look2] {self.nextthink = time + 0.2;}; +void() gremlin_look2 =[ $look2.asc, gremlin_look3] {self.nextthink = time + 0.2;}; +void() gremlin_look3 =[ $look3.asc, gremlin_look4] {self.nextthink = time + 0.2;}; +void() gremlin_look4 =[ $look4.asc, gremlin_look5] {self.nextthink = time + 0.2;}; +void() gremlin_look5 =[ $look5.asc, gremlin_look6] {self.nextthink = time + 0.2;}; +void() gremlin_look6 =[ $look6.asc, gremlin_look7] {self.nextthink = time + 0.2;}; +void() gremlin_look7 =[ $look7.asc, gremlin_look8] {self.nextthink = time + 0.2;}; +void() gremlin_look8 =[ $look8.asc, gremlin_look9] {self.nextthink = time + 0.2;}; +void() gremlin_look9 =[ $look9.asc, gremlin_run1] + { + if(self.oldenemy.health > 0) + { + self.enemy = self.oldenemy; + HuntTarget(); + } + else + { + if(self.movetarget) + self.th_walk(); + else + self.th_stand(); + } + }; + + +void() GremlinDropBackpack; +void() gremlin_glook1 =[ $glook1.asc, gremlin_glook2] {}; +void() gremlin_glook2 =[ $glook2.asc, gremlin_glook3] {}; +void() gremlin_glook3 =[ $glook3.asc, gremlin_glook4] {}; +void() gremlin_glook4 =[ $glook4.asc, gremlin_glook5] {}; +void() gremlin_glook5 =[ $glook5.asc, gremlin_glook6] {}; +void() gremlin_glook6 =[ $glook6.asc, gremlin_glook7] {}; +void() gremlin_glook7 =[ $glook7.asc, gremlin_glook8] {}; +void() gremlin_glook8 =[ $glook8.asc, gremlin_glook9] {}; +void() gremlin_glook9 =[ $glook9.asc, gremlin_glook10] {}; +void() gremlin_glook10 =[ $glook10.asc, gremlin_glook11] {}; +void() gremlin_glook11 =[ $glook11.asc, gremlin_glook12] {}; +void() gremlin_glook12 =[ $glook12.asc, gremlin_glook13] {}; +void() gremlin_glook13 =[ $glook13.asc, gremlin_glook14] {}; +void() gremlin_glook14 =[ $glook14.asc, gremlin_glook15] {}; +void() gremlin_glook15 =[ $glook15.asc, gremlin_glook16] {}; +void() gremlin_glook16 =[ $glook16.asc, gremlin_glook17] {}; +void() gremlin_glook17 =[ $glook17.asc, gremlin_glook18] {}; +void() gremlin_glook18 =[ $glook18.asc, gremlin_glook19] {}; +void() gremlin_glook19 =[ $glook19.asc, gremlin_glook20] {}; +void() gremlin_glook20 =[ $glook20.asc, gremlin_glook20] + { + GremlinDropBackpack(); + self.stoleweapon = FALSE; + if(self.oldenemy.health > 0) + { + self.enemy = self.oldenemy; + HuntTarget(); + } + else + { + if(self.movetarget) + self.th_walk(); + else + self.th_stand(); + } + }; + +void() gremlin_pain1 =[ $pain1.asc, gremlin_pain2 ] {ai_back(4);}; +void() gremlin_pain2 =[ $pain2.asc, gremlin_pain3 ] {ai_back(4);}; +void() gremlin_pain3 =[ $pain3.asc, gremlin_pain4 ] {ai_back(2);}; +void() gremlin_pain4 =[ $pain4.asc, gremlin_run1 ] {}; + +void() gremlin_gunpain1 =[ $gpain1.asc, gremlin_gunpain2 ] {ai_back(4);}; +void() gremlin_gunpain2 =[ $gpain2.asc, gremlin_gunpain3 ] {ai_back(2);}; +void() gremlin_gunpain3 =[ $gpain3.asc, gremlin_run1 ] {}; + +void(entity attacker, float damage) gremlin_pain = +{ + float r; + + if(random()<0.8) + { + self.gorging = FALSE; + self.enemy = attacker; + FoundTarget(); + } + if(self.touch == Gremlin_JumpTouch) + return; + + if(self.pain_finished > time) + return; + + self.pain_finished = time + 1; +// if(random()<0.5) +// sound(self, CHAN_VOICE, "grem/pain2.wav", 1, ATTN_NORM); +// else + r = random(); + if(r<0.33) + sound(self, CHAN_VOICE, "grem/pain1.wav", 1, ATTN_NORM); + else if(r<0.66) + sound(self, CHAN_VOICE, "grem/pain2.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "grem/pain3.wav", 1, ATTN_NORM); + + if(self.stoleweapon && self.weapon != WID_AXE) + { + gremlin_gunpain1(); + } + else + { + gremlin_pain1(); + } +}; + +void() gremlin_spawn1 =[ $spawn1.asc, gremlin_spawn2 ] {self.nextthink = time + 0.3; + self.th_pain = SUB_NullPain; +}; +void() gremlin_spawn2 =[ $spawn2.asc, gremlin_spawn3 ] {self.nextthink = time + 0.3;}; +void() gremlin_spawn3 =[ $spawn3.asc, gremlin_spawn4 ] {self.nextthink = time + 0.3;}; +void() gremlin_spawn4 =[ $spawn4.asc, gremlin_spawn5 ] {self.nextthink = time + 0.3;}; +void() gremlin_spawn5 =[ $spawn5.asc, gremlin_spawn6 ] {self.nextthink = time + 0.3;}; +void() gremlin_spawn6 =[ $spawn6.asc, gremlin_run1 ] { + self.th_pain = gremlin_pain; +}; + + +void() gremlin_die1 =[ $death1.asc, gremlin_die2 ] { +sound(self, CHAN_VOICE, "grem/death.wav", 1, ATTN_NORM);}; +void() gremlin_die2 =[ $death2.asc, gremlin_die3 ] {ai_forward(2);}; +void() gremlin_die3 =[ $death3.asc, gremlin_die4 ] {ai_forward(1);}; +void() gremlin_die4 =[ $death4.asc, gremlin_die5 ] {ai_forward(2);}; +void() gremlin_die5 =[ $death5.asc, gremlin_die6 ] {ai_forward(1);}; +void() gremlin_die6 =[ $death6.asc, gremlin_die7 ] +{self.solid = SOLID_NOT;}; +void() gremlin_die7 =[ $death7.asc, gremlin_die8 ] {ai_forward(2);}; +void() gremlin_die8 =[ $death8.asc, gremlin_die9 ] {ai_forward(1);}; +void() gremlin_die9 =[ $death9.asc, gremlin_die10 ] {ai_forward(2);}; +void() gremlin_die10 =[ $death10.asc, gremlin_die11 ] {ai_forward(1);}; +void() gremlin_die11 =[ $death11.asc, gremlin_die12 ] {ai_forward(2);}; +void() gremlin_die12 =[ $death12.asc, gremlin_die12 ] {}; + +void() gremlin_gib= + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_grem.mdl", -35); + ThrowGib("progs/gib1.mdl", -35); + ThrowGib("progs/gib1.mdl", -35); + ThrowGib("progs/gib1.mdl", -35); + }; + +void() gremlin_flip1 =[ $flip1.asc, gremlin_flip2 ] + { + ai_face(); + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = '0 0 350' - (v_forward * 200); + if(self.flags & FL_ONGROUND) + self.flags = self.flags - FL_ONGROUND; + sound(self, CHAN_VOICE, "grem/death.wav", 1, ATTN_NORM); + }; +void() gremlin_flip2 =[ $flip2.asc, gremlin_flip3 ] {ai_face();}; +void() gremlin_flip3 =[ $flip3.asc, gremlin_flip4 ] {}; +void() gremlin_flip4 =[ $flip4.asc, gremlin_flip5 ] {}; +void() gremlin_flip5 =[ $flip5.asc, gremlin_flip6 ] {}; +void() gremlin_flip6 =[ $flip6.asc, gremlin_flip7 ] {self.touch = Gremlin_FlipTouch;}; +void() gremlin_flip7 =[ $flip7.asc, gremlin_gib ] + { + self.nextthink = time + 3; + // if three seconds pass, assume gremlin is stuck and jump again + }; +void() gremlin_flip8 =[ $flip8.asc, gremlin_flip8 ] + { + self.solid = SOLID_NOT; + }; + +/* +=============== +GremlinDropBackpack +=============== +*/ +void() GremlinDropBackpack = +{ + entity item; + + if(!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells)) + return; // nothing in it + + item = spawn(); + item.origin = self.origin - '0 0 24'; + + item.ammo_shells = self.ammo_shells; + item.ammo_nails = self.ammo_nails; + item.ammo_rockets = self.ammo_rockets; + item.ammo_cells = self.ammo_cells; + + if(item.ammo_shells < 0) { item.ammo_shells = 0; } + if(item.ammo_nails < 0) { item.ammo_nails = 0; } + if(item.ammo_rockets < 0) { item.ammo_rockets = 0; } + if(item.ammo_cells < 0) { item.ammo_cells = 0; } + + item.velocity_z = 300; + item.velocity_x = -100 + (random() * 200); + item.velocity_y = -100 + (random() * 200); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + setmodel(item, "progs/backpack.mdl"); + setsize(item, '-8 -8 0', '8 8 24'); + item.touch = BackpackTouch; + + item.nextthink = time + 120; // remove after 2 minutes + item.think = SUB_Remove; +}; + +void() gremlin_die = +{ + vector vec; + float dot; + + GremlinDropBackpack(); + + if(self.stoleweapon) + { + CreateWeaponDrop(self, self.weapon, self.origin); + self.stoleweapon = FALSE; + } + + makevectors(self.angles); + vec = normalize(damage_attacker.origin - self.origin); + dot = vec * v_forward; + + if(self.health < -35) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead("progs/h_grem.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + return; + } + + if(dot>0.7 && (random() < 0.5) && (self.flags & FL_ONGROUND)) + { + gremlin_flip1(); + return; + } + + // regular death + gremlin_die1(); +}; + + +float() GremlinWeaponAttack; + +void() Gremlin_MeleeAttack = +{ + float num; + if(self.gorging) + { + gremlin_gorge1(); + } + else + { + if(self.stoleweapon == 1) + { + if(self.weapon != WID_AXE) + { + objerror("gremlin meleeing with stolen weapon"); + } + } + else if((self.enemy.flags & FL_CLIENT) && random() < 0.4) + { + if(GremlinAttemptWeaponSteal()) + return; + } + + num = random(); + + if(num < 0.3) + { + gremlin_claw1(); + } + else if(num < 0.6) + { + gremlin_lunge1(); + } + else + { + gremlin_claw1(); + } + } +} + +/* +============ +gremlin_recoil +============ +*/ +/* +void() gremlin_recoil = + { + self.nextthink = time + 0.1; + self.flags = self.flags - FL_ONGROUND; + if(vlen(self.velocity)<2) + { + self.movetype = self.spawnsolidtype; + self.think = self.spawnthink; + } + }; +*/ +/* +============ +GremlinRecoil +============ +*/ +/* +void(vector dir, float mag) GremlinRecoil = + { + self.spawnsolidtype = self.movetype; + self.movetype = MOVETYPE_BOUNCE; + self.spawnthink = self.think; + self.think = gremlin_recoil; + self.nextthink = time; + self.velocity = mag * dir; + self.velocity_z = self.velocity_z + 100; + self.flags = self.flags - FL_ONGROUND; + }; +*/ + +/* +============ +GremlinCheckNoAmmo + +attack with a weapon +============ +*/ +float() GremlinCheckNoAmmo = +{ + if(self.weapon == WID_AXE) + return TRUE; + + if(self.currentammo > 0) + return TRUE; + + self.stoleweapon = FALSE; + return FALSE; +} + +/* +============ +GremlinFindVictim + +find a victim to shoot at +============ +*/ +entity() GremlinFindVictim = +{ + entity head; + entity selected; + float dist; + float head_dist; + + self.search_time = time + 1.0; + // look in our immediate vicinity + + selected = world; + dist = 1000; + head = findradius(self.origin, 1000); + + while(head) + { + if(!(head.flags & FL_NOTARGET) && ((head.flags & FL_MONSTER) || (head.flags & FL_CLIENT))) + { + if(visible(head) && (head.health > 0) && (head != self)) + { + head_dist = vlen(head.origin-self.origin); + + if(head == self.lastvictim) + head_dist = head_dist * 2; + + if(head.flags & FL_CLIENT) + head_dist = head_dist / 1.5; + + if(head.classname == self.classname) + head_dist = head_dist * 1.5; + + if(head_dist < dist) + { + selected = head; + dist = head_dist; + } + } + } + + head = head.chain; + } + + self.lastvictim = selected; + + return selected; +} + +/* +============ +Gremlin_FireRocket + +fire a rocket +============ +*/ +void() Gremlin_FireRocket = +{ + entity missile; + vector dir; + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + + self.punchangle_x = -2; + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "missile"; + +// set missile speed + + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.1 * v_right + crandom()* 0.1 *v_up; + missile.velocity = normalize(dir); + missile.velocity = missile.velocity * 1000; + missile.angles = vectoangles(missile.velocity); + + missile.touch = T_MissileTouch; + +// set missile duration + missile.nextthink = time + 5; + missile.think = SUB_Remove; + + setmodel(missile, "progs/missile.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin + v_forward*8 + '0 0 16'); +// GremlinRecoil(dir,-1000); +}; + +/* +============ +Gremlin_FireNailGun + +fire a nailgun +============ +*/ +void(float ox) Gremlin_FireNailGun = +{ + vector dir; + + self.currentammo = self.ammo_nails = self.ammo_nails - 1; + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.1 * v_right + crandom()* 0.1 *v_up; + dir = normalize(dir); + launch_spike (self.origin + '0 0 16', dir); +}; + +/* +============ +Gremlin_FireLaserGun + +fire a laser cannon +============ +*/ +void(float ox) Gremlin_FireLaserGun = +{ + vector dir; + + self.currentammo = self.ammo_cells = self.ammo_cells - 1; + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.1 * v_right + crandom()* 0.1 *v_up; + dir = normalize(dir); + HIP_LaunchLaser(self.origin + '0 0 16', dir, '0 0 0', 0); +}; + +/* +============ +Gremlin_FireShotGun + +fire a shotgun +============ +*/ +void() Gremlin_FireShotGun = +{ + vector dir; + + self.currentammo = self.ammo_shells = self.ammo_shells - 1; + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM); + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.1 *v_right + crandom()* 0.1 *v_up; + dir = normalize(dir); + self.v_angle = vectoangles(dir); + EnemyFireBullets(6, dir, '0.04 0.04 0'); +}; + +/* +============ +Gremlin_FireSuperShotGun + +fire a shotgun +============ +*/ +void() Gremlin_FireSuperShotGun = +{ + vector dir; + + self.currentammo = self.ammo_shells = self.ammo_shells - 2; + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM); + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.3 *v_right + crandom()* 0.3 *v_up; + dir = normalize(dir); + self.v_angle = vectoangles(dir); + EnemyFireBullets(14, dir, '0.14 0.08 0'); +}; + +/* +============ +Gremlin_FireLightningGun + +fire lightning gun +============ +*/ +void() Gremlin_FireLightningGun = + { + vector org, dir; + float cells; + +// explode if under water + if(self.watertype <= CONTENT_WATER) + { + cells = self.ammo_cells; + self.ammo_cells = 0; + discharged = 1; + T_RadiusDamage(self, self, 35*cells, world); + discharged = 0; + return; + } + + self.effects = self.effects | EF_MUZZLEFLASH; + + ai_face(); + + self.currentammo = self.ammo_cells = self.ammo_cells - 2; + org = self.origin + '0 0 16'; + + dir = self.enemy.origin + '0 0 16' - org; + dir = normalize(dir); + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.1 *v_right + crandom()* 0.1 *v_up; + dir = normalize(dir); + + traceline(org, self.origin + dir*600, TRUE, self); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity(MSG_BROADCAST, self); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, org); + WriteVec3(MSG_BROADCAST, trace_endpos); + + LightningDamage(org, trace_endpos+(dir*4), self, 30); +}; + +/* +================ +GremlinFireProximityGrenade +================ +*/ +void() GremlinFireProximityGrenade = +{ + entity missile; + vector dir; + + NumProximityGrenades = NumProximityGrenades + 1; + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + + sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + + missile = spawn(); + missile.owner = self; + missile.lastvictim = self; + missile.movetype = MOVETYPE_TOSS; + missile.solid = SOLID_BBOX; + missile.classname = "proximity_grenade"; + missile.takedamage = DAMAGE_NO; + missile.health = 5; + missile.state = 0; + + // set missile speed + dir = normalize(self.enemy.origin - self.origin); + self.v_angle = vectoangles(dir); + makevectors(self.v_angle); + dir = dir + crandom()* 0.1 *v_right + crandom()* 0.1 *v_up; + dir = normalize(dir); + missile.velocity = dir * 600; + missile.velocity_z = 200; + + missile.avelocity = '100 600 100'; + missile.angles = vectoangles(missile.velocity); + missile.touch = ProximityGrenadeTouch; + + // set missile duration + missile.nextthink = time + 2; + missile.delay = time + 15 + (10*random()); + missile.think = ProximityBomb; + missile.th_die = ProximityGrenadeExplode; + + setmodel(missile, "progs/proxbomb.mdl"); + setorigin(missile, self.origin); + setsize(missile, '-1 -1 -1', '1 1 1'); +}; + +/* +============ +GremlinWeaponAttack + +attack with a weapon +============ +*/ +void() gremlin_shot1; +void() gremlin_nail1; +void() gremlin_light1; +void() gremlin_rocket1; + +float() GremlinWeaponAttack = +{ + if(!GremlinCheckNoAmmo()) + { + return FALSE; + } + + self.show_hostile = time + 1; // wake monsters up + + if(self.weapon == WID_SHOTGUN) + { + gremlin_shot1(); + Gremlin_FireShotGun(); + SUB_AttackFinished(1); + } + else if(self.weapon == WID_SUPER_SHOTGUN) + { + gremlin_shot1(); + Gremlin_FireSuperShotGun(); + SUB_AttackFinished(1); + } + else if(self.weapon == WID_NAILGUN) + { + gremlin_nail3(); + SUB_AttackFinished(1); + } + else if(self.weapon == WID_SUPER_NAILGUN) + { + gremlin_nail3(); + SUB_AttackFinished(1); + } + else if(self.weapon == WID_GRENADE_LAUNCHER) + { + gremlin_rocket1(); + OgreFireGrenade(); + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + SUB_AttackFinished(1); + } + else if(self.weapon == WID_ROCKET_LAUNCHER) + { + gremlin_rocket1(); + Gremlin_FireRocket(); + SUB_AttackFinished(1); + } + else if(self.weapon == WID_LIGHTNING) + { + gremlin_light1(); + SUB_AttackFinished(1); + sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + } + else if(self.weapon == WID_LASER_CANNON) + { + gremlin_laser3(); + SUB_AttackFinished(1); + } + else if(self.weapon == WID_PROXIMITY_GUN) + { + gremlin_rocket1(); + GremlinFireProximityGrenade(); + SUB_AttackFinished(1); + } + + return TRUE; +} + +void() Gremlin_MissileAttack = +{ + if(self.stoleweapon && self.weapon != WID_AXE) + { + if(GremlinWeaponAttack()) + { + return; + } + + if((random()<0.1) && (self.flags & FL_ONGROUND)) + { + gremlin_jump1(); + return; + } + } + + if(self.flags & FL_ONGROUND) + gremlin_jump1(); +} + +/*QUAKED monster_gremlin (1 0 0) (-32 -32 -24) (32 32 64) Ambush + +*/ +void() monster_gremlin = +{ + if(deathmatch) + { + remove(self); + return; + } + + NumGremlins = NumGremlins + 1; + precache_model("progs/grem.mdl"); + precache_model("progs/h_grem.mdl"); + + precache_sound("grem/death.wav"); + precache_sound("grem/attack.wav"); + precache_sound("demon/djump.wav"); + precache_sound("demon/dhit2.wav"); + precache_sound("grem/pain1.wav"); + precache_sound("grem/pain2.wav"); + precache_sound("grem/pain3.wav"); + precache_sound("grem/idle.wav"); + precache_sound("grem/sight1.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/grem.mdl"); + + setsize(self, '-12 -12 -18', '12 12 18'); + self.health = 100; + self.max_health = 101; + self.yaw_speed = 40; + + self.th_stand = gremlin_stand1; + self.th_walk = gremlin_walk1; + self.th_run = gremlin_run1; + self.th_die = gremlin_die; + self.th_melee = Gremlin_MeleeAttack; // one of two attacks + self.th_missile = Gremlin_MissileAttack; // check for random jump or firing of weapon + self.th_pain = gremlin_pain; + + walkmonster_start(); +}; + +float() GremlinCheckAttack = +{ + vector spot1, spot2; + entity targ; + float chance; + + targ = self.enemy; + + if(time < self.attack_finished) + return FALSE; + + // see if any entities are in the way of the shot + spot1 = self.origin;// + self.view_ofs; + spot2 = targ.origin;// + targ.view_ofs; + + if((vlen(spot2 - spot1) <= 90) && + (self.stoleweapon == 0 || self.weapon == WID_AXE)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + + // missile attack + chance = 0.03 + self.stoleweapon; + if(random() < chance) + { + self.attack_state = AS_MISSILE; + return TRUE; + } + + return FALSE; +} + + +//=========================================================================== + +void(float side) Gremlin_Melee = +{ + float ldmg; + vector delta; + + ai_face(); + + // walkmove(self.ideal_yaw, 12); // allow a little closing + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + if(!CanDamage(self.enemy, self)) + return; + + sound(self, CHAN_WEAPON, "grem/attack.wav", 1, ATTN_NORM); + ldmg = 10 + 5*random(); + T_Damage(self.enemy, self, self, ldmg); + + makevectors(self.angles); + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); +}; + +//=========================================================================== + +void(float dm) Gremlin_ThrowHead = +{ + string gibname; + + if(self.classname == "monster_ogre") + gibname = "progs/h_ogre.mdl"; + else if(self.classname == "monster_knight") + gibname = "progs/h_knight.mdl"; + else if(self.classname == "monster_shambler") + gibname = "progs/h_shams.mdl"; + else if(self.classname == "monster_demon1") + gibname = "progs/h_demon.mdl"; + else if(self.classname == "monster_wizard") + gibname = "progs/h_wizard.mdl"; + else if(self.classname == "monster_zombie") + gibname = "progs/h_zombie.mdl"; + else if(self.classname == "monster_dog") + gibname = "progs/h_dog.mdl"; + else if(self.classname == "monster_hell_knight") + gibname = "progs/h_hellkn.mdl"; + else if(self.classname == "monster_enforcer") + gibname = "progs/h_mega.mdl"; + else if(self.classname == "monster_army") + gibname = "progs/h_guard.mdl"; + else if(self.classname == "monster_shalrath") + gibname = "progs/h_shal.mdl"; + else if(self.classname == "monster_gremlin") + gibname = "progs/h_grem.mdl"; + else if(self.classname == "monster_scourge") + gibname = "progs/h_scourg.mdl"; + else if(self.classname == "monster_fish") + gibname = "progs/gib1.mdl"; + else + gibname = "progs/h_player.mdl"; + + ThrowHead(gibname, dm); +} + +//=========================================================================== + +/* +============ +Gremlin_Damage + +The damage is coming from inflictor, but get mad at attacker +============ +*/ +void(entity targ, entity inflictor, entity attacker, float damage) Gremlin_Damage = +{ + // check for godmode or invincibility + if(targ.flags & FL_GODMODE) + { + return; + } + + if(targ.invincible_finished >= time) + { + if(self.invincible_sound < time) + { + sound(targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); + self.invincible_sound = time + 2; + } + + return; + } + + // team play damage avoidance + if((teamplay == 1) && (targ.team > 0)&&(targ.team == attacker.team)) + { + return; + } + + // do the damage + targ.health = targ.health - damage; +} + +void() Gremlin_Split = +{ + + if(NumSpawnGremlins >= (NumGremlins * 2)) + return; + + float done = 0; + float c = 0; + vector ang = self.angles; + vector pos = self.origin + (80 * v_forward); + while(done == 0) + { + makevectors(ang); + pos = self.origin + (80 * v_forward); + entity head = findradius(pos, 35); + float proceed = 1; + while(head) + { + if((head.health > 0) && (head.flags & (FL_MONSTER | FL_CLIENT))) + proceed = 0; + head = head.chain; + } + traceline(self.origin, pos, FALSE, self); + if(trace_fraction == 1 && (proceed == 1)) + { + traceline(self.origin, (pos - '40 40 0'), FALSE, self); + if(trace_fraction == 1) + { + traceline(self.origin, (pos + '40 40 0'), FALSE, self); + if(trace_fraction == 1) + { + traceline(self.origin, (pos + '0 0 64'), FALSE, self); + if(trace_fraction == 1) + { + traceline(self.origin, (pos - '0 0 64'), FALSE, self); + if(trace_fraction != 1) + { + done = 1; + } + } + } + } + } + if(done == 0) + { + ang_y = ang_y + 36; + c = c + 1; + if(c == 10) + { + return; + } + } + } + + NumSpawnGremlins = NumSpawnGremlins + 1; + + entity grem = spawn(); + + SUB_CopyEntity(self, grem); + + grem.solid = SOLID_SLIDEBOX; + grem.movetype = MOVETYPE_STEP; + + setmodel(grem, "progs/grem.mdl"); + setsize(grem, '-12 -12 -18', '12 12 18'); + + if(self.health < 100) + self.health = 100; + + grem.health = self.health / 2; + self.health = self.health / 2; + grem.stoleweapon = FALSE; + + VR_ItemUtil_EntClearItems(grem); + total_monsters = total_monsters + 1; + + WriteByte(MSG_BROADCAST, SVC_UPDATESTAT); + WriteByte(MSG_BROADCAST, STAT_TOTALMONSTERS); + WriteLong(MSG_BROADCAST, total_monsters); + setorigin(grem, pos); + + entity temp = self; + self = grem; + + gremlin_spawn1(); + + self.enemy = world; + self.gorging = FALSE; + self = temp; +} + +void(float side) Gremlin_Gorge = +{ + float ldmg; + vector delta; + entity temp; + + // ai_face(); + // walkmove(self.ideal_yaw, 6); // allow a little closing + + delta = self.enemy.origin - self.origin; + // self.enemy.takedamage = DAMAGE_YES; + + sound(self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); + // sound(self, CHAN_WEAPON, "grem/attack.wav", 1, ATTN_NORM); + ldmg = 7+5*random(); + Gremlin_Damage(self.enemy, self, self, ldmg); + + makevectors(self.angles); + SpawnMeatSpray(self.origin + v_forward*16, side * v_right); + + if(self.enemy.health < -200.0) + { + if(self.enemy.gorging==FALSE) + { + self.enemy.gorging = TRUE; + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + temp = self; + self = self.enemy; + Gremlin_ThrowHead(-15); + // ThrowGib("progs/gib1.mdl", -15); + // ThrowGib("progs/gib2.mdl", -15); + // ThrowGib("progs/gib3.mdl", -15); + self = temp; + ldmg = 150 + 100*random(); + T_Heal(self,ldmg,FALSE); + // if(self.health >= self.max_health) + Gremlin_Split(); + } + + self.enemy = world; + self.gorging = FALSE; + + /* + if(self.stoleweapon) + { + temp = GremlinFindVictim(); + if(temp != world) + { + self.enemy = temp; + FoundTarget(); + self.search_time = time + 1.0; + // return; + } + } + */ + + // FindTarget(); + + /* + if(self.oldenemy.health > 0) + { + self.enemy = self.oldenemy; + HuntTarget(); + } + else + { + if(self.movetarget) + self.th_walk(); + else + self.th_stand(); + } + */ + + gremlin_look1(); + } +}; + + +void() Gremlin_JumpTouch = +{ + if(self.health <= 0) + { + return; + } + + /* + if(other.takedamage) + { + if(vlen(self.velocity) > 400) + { + ldmg = 40 + 10*random(); + T_Damage(other, self, self, ldmg); + } + } + */ + + if(!checkbottom(self)) + { + if(self.flags & FL_ONGROUND) + { + self.touch = SUB_Null; + self.think = gremlin_jump1; + self.nextthink = time + 0.1; + } + + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = gremlin_jump12; + self.nextthink = time + 0.1; +}; + +void() Gremlin_FlipTouch = +{ + if(!checkbottom(self)) + { + if(self.flags & FL_ONGROUND) + { + self.touch = SUB_Null; + self.think = gremlin_flip1; + self.nextthink = time + 0.1; + } + + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = gremlin_flip8; + self.nextthink = time + 0.1; +} diff --git a/QC/hip_mon_scrge.qc b/QC/hip_mon_scrge.qc new file mode 100644 index 00000000..51a5fd23 --- /dev/null +++ b/QC/hip_mon_scrge.qc @@ -0,0 +1,467 @@ +/* +============================================================================== + +SCOURGE + +============================================================================== +*/ + +$cd hipwork\models\scourge +$origin 0 0 23 +$base scorbase.asc + +$skin skin + +$frame stand1.asc stand2.asc stand3.asc stand4.asc stand5.asc stand6.asc +$frame stand7.asc stand8.asc stand9.asc stand10.asc stand11.asc stand12.asc + +$frame walk1.asc walk2.asc walk3.asc walk4.asc walk5.asc walk6.asc + +$frame shoot1.asc shoot2.asc + +$frame sting1.asc sting2.asc sting3.asc sting4.asc sting5.asc sting6.asc +$frame sting7.asc sting8.asc sting9.asc sting10.asc sting11.asc + +$frame pain1.asc pain2.asc pain3.asc pain4.asc pain5.asc + +$frame death1.asc death2.asc death3.asc death4.asc death5.asc + +/* +=========== +ScourgeCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() ScourgeCheckAttack = +{ + entity targ = self.enemy; + + // see if any entities are in the way of the shot + vector spot1 = self.origin + self.view_ofs; + vector spot2 = targ.origin + targ.view_ofs; + + if(vlen(spot1 - spot2) <= 100) + { + if(CanDamage(self.enemy, self)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if(time < self.attack_finished) + return FALSE; + + if(!enemy_vis) + return FALSE; + + + float chance = spot2_z - spot1_z; + + if(chance > 64) + return FALSE; + + if(chance < -200) + return FALSE; + + if(vlen(spot1 - spot2) > 1000) + return FALSE; + + if(vlen(spot1 - spot2) < 150) + return FALSE; + + traceline(spot1, spot2, FALSE, self); + + if(trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if(trace_ent != targ) + { + return FALSE; // don't have a clear shot + } + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); + return TRUE; +} + +void(float ox) SCOURGE_FireSpikes = +{ + ai_face(); + makevectors(self.angles); + vector src = self.origin - '0 0 19' + v_right*ox + v_forward*14; + vector vec = (self.enemy.origin + (200*v_forward)) - src; + vec = normalize(vec); + sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + launch_spike(src, vec); + + self.attack_finished = time + 0.2; +} + +// Attack_With_Tail +// +void() Attack_With_Tail = +{ + ai_face(); + + vector delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + if(!CanDamage(self.enemy, self)) + return; + + float ldmg = (random() + random() + random()) * 40; + T_Damage(self.enemy, self, self, ldmg); + sound(self, CHAN_WEAPON, "shambler/smack.wav", 1, ATTN_NORM); + + SpawnMeatSpray(self.origin + v_forward*16, crandom() * 50 * v_right); +}; + +void() scourge_think = +{ + if(!self.state) + { + entity trig = spawn(); + trig.angles = '0 0 0'; + trig.solid = SOLID_TRIGGER; + setsize(trig, '-64 -64 -24', '64 64 64'); + trig.takedamage = DAMAGE_NO; + trig.movetype = MOVETYPE_NONE; + trig.modelindex = 0; + trig.model = ""; + trig.lastvictim = self; + trig.think = ScourgeTriggerThink; + trig.touch = ScourgeTriggerTouch; + trig.nextthink = time + 0.1 + random(); + setorigin(trig, self.origin); + self.lastvictim = trig; + self.state = 1; + } + + if((self.spawnsilent == 0) && (self.spawnmulti == 1)) + { + sound(self, CHAN_BODY, "misc/null.wav", 1, ATTN_IDLE); + } + else if((self.spawnsilent == 1) && (self.spawnmulti == 0)) + { + sound(self, CHAN_BODY, "scourge/walk.wav", 1, ATTN_IDLE); + } + + self.spawnmulti = self.spawnsilent; +}; + +void(float dist) ai_right = +{ + walkmove((self.angles_y+90), dist); +}; + +void(float dist) ai_left = +{ + walkmove((self.angles_y+270), dist); +}; + +//============================================================================ + +void() scourge_stand1 =[ $stand1.asc, scourge_stand2 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand2 =[ $stand2.asc, scourge_stand3 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand3 =[ $stand3.asc, scourge_stand4 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand4 =[ $stand4.asc, scourge_stand5 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand5 =[ $stand5.asc, scourge_stand6 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand6 =[ $stand6.asc, scourge_stand7 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand7 =[ $stand7.asc, scourge_stand8 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand8 =[ $stand8.asc, scourge_stand9 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand9 =[ $stand9.asc, scourge_stand10 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand10 =[ $stand10.asc, scourge_stand11 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand11 =[ $stand11.asc, scourge_stand12 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; +void() scourge_stand12 =[ $stand12.asc, scourge_stand1 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; + +void() scourge_walk1 =[ $walk1.asc , scourge_walk2 ] { +if(random() < 0.1) + sound(self, CHAN_VOICE, "scourge/idle.wav", 1, ATTN_IDLE); +self.spawnsilent = 1; +scourge_think(); +ai_walk(8);}; +void() scourge_walk2 =[ $walk2.asc , scourge_walk3 ] {ai_walk(8);}; +void() scourge_walk3 =[ $walk3.asc , scourge_walk4 ] {ai_walk(8);}; +void() scourge_walk4 =[ $walk4.asc , scourge_walk5 ] {ai_walk(8);}; +void() scourge_walk5 =[ $walk5.asc , scourge_walk6 ] {ai_walk(8);}; +void() scourge_walk6 =[ $walk6.asc , scourge_walk1 ] {ai_walk(8);}; + +void() scourge_run1 =[ $walk1.asc , scourge_run2 ] { +if(random() < 0.1) + sound(self, CHAN_VOICE, "scourge/idle.wav", 1, ATTN_IDLE); +self.spawnsilent = 1; +scourge_think(); +ai_run(18);}; +void() scourge_run2 =[ $walk2.asc , scourge_run3 ] {scourge_think();ai_run(14);}; +void() scourge_run3 =[ $walk3.asc , scourge_run4 ] {ai_run(14);}; +void() scourge_run4 =[ $walk4.asc , scourge_run5 ] {ai_run(14);}; +void() scourge_run5 =[ $walk5.asc , scourge_run6 ] {ai_run(14);}; +void() scourge_run6 =[ $walk6.asc , scourge_run1 ] {ai_run(14);}; + +void() scourge_strafeleft1 =[ $walk1.asc , scourge_strafeleft2 ] {self.spawnsilent = 1;scourge_think();ai_left(20);}; +void() scourge_strafeleft2 =[ $walk2.asc , scourge_strafeleft3 ] {ai_left(20);}; +void() scourge_strafeleft3 =[ $walk3.asc , scourge_strafeleft4 ] {ai_left(20);}; +void() scourge_strafeleft4 =[ $walk4.asc , scourge_strafeleft5 ] {ai_left(14);}; +void() scourge_strafeleft5 =[ $walk5.asc , scourge_strafeleft6 ] {ai_left(14);}; +void() scourge_strafeleft6 =[ $walk6.asc , scourge_run1 ] {ai_left(14);}; + +void() scourge_straferight1 =[ $walk1.asc , scourge_straferight2 ] {self.spawnsilent = 1;scourge_think();ai_right(20);}; +void() scourge_straferight2 =[ $walk2.asc , scourge_straferight3 ] {ai_right(20);}; +void() scourge_straferight3 =[ $walk3.asc , scourge_straferight4 ] {ai_right(20);}; +void() scourge_straferight4 =[ $walk4.asc , scourge_straferight5 ] {ai_right(14);}; +void() scourge_straferight5 =[ $walk5.asc , scourge_straferight6 ] {ai_right(14);}; +void() scourge_straferight6 =[ $walk6.asc , scourge_run1 ] {ai_right(14);}; + +void() scourge_turn1 =[ $walk1.asc, scourge_turn2 ] {self.spawnsilent = 1;scourge_think();ai_turn_in_place();}; +void() scourge_turn2 =[ $walk2.asc, scourge_turn3 ] {ai_turn_in_place();}; +void() scourge_turn3 =[ $walk3.asc, scourge_turn4 ] {ai_turn_in_place();}; +void() scourge_turn4 =[ $walk4.asc, scourge_turn5 ] {ai_turn_in_place();}; +void() scourge_turn5 =[ $walk5.asc, scourge_turn6 ] {ai_turn_in_place();}; +void() scourge_turn6 =[ $walk6.asc, scourge_turn1 ] {ai_turn_in_place();}; + +void() scourge_atk1 =[ $shoot1.asc, scourge_atk2 ] + { + self.spawnsilent = 0; + scourge_think(); + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(40); + }; +void() scourge_atk2 =[ $shoot2.asc, scourge_atk3 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(-56); + }; +void() scourge_atk3 =[ $shoot1.asc, scourge_atk4 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(-40); + }; +void() scourge_atk4 =[ $shoot2.asc, scourge_atk5 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(56); + }; +void() scourge_atk5 =[ $shoot1.asc, scourge_atk6 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(40); + }; +void() scourge_atk6 =[ $shoot2.asc, scourge_atk7 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(-56); + }; +void() scourge_atk7 =[ $shoot1.asc, scourge_atk8 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(-40); + }; +void() scourge_atk8 =[ $shoot2.asc, scourge_run1 ] + { + self.effects = self.effects | EF_MUZZLEFLASH; + SCOURGE_FireSpikes(56); + SUB_AttackFinished (4*random()); + }; + +void() scourge_melee1 =[ $sting1.asc, scourge_melee2 ] {self.spawnsilent = 0;scourge_think();ai_charge(3);}; +void() scourge_melee2 =[ $sting2.asc, scourge_melee3 ] {ai_charge(3);}; +void() scourge_melee3 =[ $sting3.asc, scourge_melee4 ] {ai_charge(2);}; +void() scourge_melee4 =[ $sting4.asc, scourge_melee5 ] {ai_charge(2);}; +void() scourge_melee5 =[ $sting5.asc, scourge_melee6 ] + { + sound(self, CHAN_WEAPON, "scourge/tailswng.wav", 1, ATTN_NORM); + ai_charge(3); + }; +void() scourge_melee6 =[ $sting6.asc, scourge_melee7 ] {ai_charge(1);}; +void() scourge_melee7 =[ $sting7.asc, scourge_melee8 ] + { + Attack_With_Tail(); + }; +void() scourge_melee8 =[ $sting8.asc, scourge_melee9 ] {ai_face();}; +void() scourge_melee9 =[ $sting9.asc, scourge_melee10 ] {ai_face();}; +void() scourge_melee10 =[ $sting10.asc, scourge_melee11 ] {ai_face();}; +void() scourge_melee11 =[ $sting11.asc, scourge_run1 ] {ai_face(); +SUB_CheckRefire (scourge_melee1); +}; + +void() scourge_pain1 =[ $pain1.asc, scourge_pain2 ] {self.spawnsilent = 0;scourge_think();}; +void() scourge_pain2 =[ $pain2.asc, scourge_pain3 ] {}; +void() scourge_pain3 =[ $pain3.asc, scourge_pain4 ] {}; +void() scourge_pain4 =[ $pain4.asc, scourge_pain5 ] {}; +void() scourge_pain5 =[ $pain5.asc, scourge_run1 ] {}; + +void(entity attacker, float damage) scourge_pain = +{ + if(random()*50 > damage) + return; // didn't flinch + + if(self.pain_finished > time) + return; + + float r = random(); + sound(self, CHAN_VOICE, "scourge/pain.wav", 1, ATTN_NORM); + + self.pain_finished = time + 2.0; + scourge_pain1(); +}; + +//============================================================================ + +void() ScourgeDrop = +{ + entity entPlayer = FindEntPlayerForDrop(); + + self.solid = SOLID_NOT; + + if(entPlayer != world && ShouldDropEnemyWpn(0.45)) + { + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_NAILGUN, 0.4)) + if(!TryEnemyDrop(self, entPlayer, WID_NAILGUN, 0.5)) + { /* Intentionally empty. */ } + } +} + +void() scourge_die1 =[ $death1.asc, scourge_die2 ] {self.spawnsilent = 0;scourge_think();}; +void() scourge_die2 =[ $death2.asc, scourge_die3 ] {}; +void() scourge_die3 =[ $death3.asc, scourge_die4 ] {ScourgeDrop();}; +void() scourge_die4 =[ $death4.asc, scourge_die5 ] {}; +void() scourge_die5 =[ $death5.asc, scourge_die5 ] {}; + +void() scourge_die = +{ + // check for gib + // stop sound + remove(self.lastvictim); + self.spawnsilent = 0; + scourge_think(); + if(self.health < -35) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_scourg.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + ScourgeDrop(); + return; + } + +// regular death + sound(self, CHAN_VOICE, "scourge/pain2.wav", 1, ATTN_NORM); + scourge_die1(); +}; + +void() scourge_melee = +{ + scourge_melee1(); + SUB_AttackFinished (2*random()); +} + +void() ScourgeTriggerThink = +{ + if(self.lastvictim.health<=0) + { + remove(self); + return; + } + + entity targ = self.lastvictim; + makevectors(targ.angles); + setorigin(self, targ.origin + (v_forward*300)); + self.nextthink = time + 0.1; +} + +void() ScourgeTriggerTouch = +{ + if(other.flags & (FL_MONSTER | FL_CLIENT)) + return; + + if(other.movetype != MOVETYPE_FLYMISSILE) + return; + + entity targ = self.lastvictim; + if(targ.health <= 0) + { + remove(self); + return; + } + + vector dir = targ.origin - other.origin; + dir = normalize(dir); + + if((dir * normalize(other.velocity))<0.8) + return; + + entity tempent; + if(time > self.lastvictim.duration) + { + tempent = self; + self = targ; + + if(random()<0.5) + scourge_strafeleft1(); + else + scourge_straferight1(); + + self = tempent; + self.lastvictim.duration = time + 1.25; + } + +}; + +/*QUAKED monster_scourge (1 0 0) (-16 -16 -24) (16 16 40) Ambush + +*/ +void() monster_scourge = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model2("progs/scor.mdl"); + precache_model2("progs/h_scourg.mdl"); + precache_model2("progs/laser.mdl"); + precache_model2("progs/s_light.mdl"); + precache_model2("progs/spike.mdl"); + + precache_sound("misc/null.wav"); + precache_sound("scourge/idle.wav"); + precache_sound("scourge/pain.wav"); + precache_sound("scourge/pain2.wav"); + precache_sound("scourge/sight.wav"); + precache_sound("scourge/tailswng.wav"); + precache_sound("scourge/walk.wav"); + precache_sound2("shambler/smack.wav"); + precache_sound2("weapons/rocket1i.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/scor.mdl"); + + setsize(self, '-32 -32 -24', '32 32 24'); + self.health = 300; + + self.th_stand = scourge_stand1; + self.th_walk = scourge_walk1; + self.th_run = scourge_run1; + self.th_pain = scourge_pain; + self.th_die = scourge_die; + self.th_melee = scourge_melee; + self.th_missile = scourge_atk1; + self.yaw_speed = 60; + self.attack_state = AS_DODGING; + self.state = 0; + self.duration = time; + + walkmonster_start(); +}; diff --git a/QC/hip_mon_spike.qc b/QC/hip_mon_spike.qc new file mode 100644 index 00000000..36660b69 --- /dev/null +++ b/QC/hip_mon_spike.qc @@ -0,0 +1,59 @@ +/* +============================================================================== + +spike mine + +============================================================================== +*/ + +$cd id1/models/demon3 +$scale 0.8 +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +$frame run1 run2 run3 run4 run5 run6 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 +$frame leap11 leap12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 +$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 + +void() monster_spikemine = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/demon.mdl"); + precache_model("progs/h_demon.mdl"); + + precache_sound("demon/ddeath.wav"); + precache_sound("demon/dhit2.wav"); + precache_sound("demon/djump.wav"); + precache_sound("demon/dpain1.wav"); + precache_sound("demon/idle1.wav"); + precache_sound("demon/sight2.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/demon.mdl"); + + // TODO VR: (P2) tweak hitbox + setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX); +}; diff --git a/QC/hip_part.qc b/QC/hip_part.qc index 3049a259..de21bd53 100644 --- a/QC/hip_part.qc +++ b/QC/hip_part.qc @@ -10,38 +10,38 @@ float USE_COUNT = 1; void () particlefield_XZ = { - local vector pos; - local vector start; - local vector end; + vector pos; + vector start; + vector end; - if( ( self.spawnflags & USE_COUNT ) && - ( counter_GetCount( other ) != self.cnt ) ) + if((self.spawnflags & USE_COUNT) && + (counter_GetCount(other) != self.cnt)) { return; } -// dprint( "XZ\n" ); +// dprint("XZ\n"); self.ltime = time + 0.25; - if( self.noise ) + if(self.noise != NULLSTR) { sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); } // Only show particles if client is visible. // This helps to keep network traffic down to a minimum. - if(!checkclient() ) + if(!checkclient()) return; start = self.dest1 + self.origin; end = self.dest2 + self.origin; pos_y = start_y; pos_z = start_z; - while( pos_z <= end_z ) + while(pos_z <= end_z) { pos_x = start_x; - while( pos_x <= end_x ) + while(pos_x <= end_x) { - particle ( pos, '0 0 0', self.color, self.count ); + particle (pos, '0 0 0', self.color, self.count); pos_x = pos_x + 16; } pos_z = pos_z + 16; @@ -50,42 +50,42 @@ void () particlefield_XZ = void () particlefield_YZ = { - local vector pos; - local vector start; - local vector end; + vector pos; + vector start; + vector end; - if( ( self.spawnflags & USE_COUNT ) && - ( counter_GetCount( other ) != self.cnt ) ) + if((self.spawnflags & USE_COUNT) && + (counter_GetCount(other) != self.cnt)) { return; } -// dprint( "YZ: " ); -// dprint( vtos( self.dest1 ) ); -// dprint( " - " ); -// dprint( vtos( self.dest2 ) ); -// dprint( "\n" ); +// dprint("YZ: "); +// dprint(vtos(self.dest1)); +// dprint(" - "); +// dprint(vtos(self.dest2)); +// dprint("\n"); self.ltime = time + 0.25; - if( self.noise ) + if(self.noise != NULLSTR) { sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); } // Only show particles if client is visible. // This helps to keep network traffic down to a minimum. - if(!checkclient() ) + if(!checkclient()) return; start = self.dest1 + self.origin; end = self.dest2 + self.origin; pos_x = start_x; pos_z = start_z; - while( pos_z < end_z ) + while(pos_z < end_z) { pos_y = start_y; - while( pos_y < end_y ) + while(pos_y < end_y) { - particle ( pos, '0 0 0', self.color, self.count ); + particle (pos, '0 0 0', self.color, self.count); pos_y = pos_y + 16; } pos_z = pos_z + 16; @@ -94,26 +94,26 @@ void () particlefield_YZ = void () particlefield_XY = { - local vector pos; - local vector start; - local vector end; + vector pos; + vector start; + vector end; - if( ( self.spawnflags & USE_COUNT ) && - ( counter_GetCount( other ) != self.cnt ) ) + if((self.spawnflags & USE_COUNT) && + (counter_GetCount(other) != self.cnt)) { return; } -// dprint( "XY\n" ); +// dprint("XY\n"); self.ltime = time + 0.25; - if( self.noise ) + if(self.noise != NULLSTR) { sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); } // Only show particles if client is visible. // This helps to keep network traffic down to a minimum. - if(!checkclient() ) + if(!checkclient()) return; @@ -121,12 +121,12 @@ void () particlefield_XY = end = self.dest2 + self.origin; pos_x = start_x; pos_z = start_z; - while( pos_x < end_x ) + while(pos_x < end_x) { pos_y = start_y; - while( pos_y < end_y ) + while(pos_y < end_y) { - particle ( pos, '0 0 0', self.color, self.count ); + particle (pos, '0 0 0', self.color, self.count); pos_y = pos_y + 16; } pos_x = pos_x + 16; @@ -135,16 +135,16 @@ void () particlefield_XY = void () particlefield_touch = { - if( !self.dmg ) + if(!self.dmg) return; - if( time > self.ltime) + if(time > self.ltime) return; if(time < self.attack_finished) return; self.attack_finished = time + 0.5; - T_Damage (other, self, self, self.dmg); + T_Damage(other, self, self, self.dmg); }; /*QUAKED func_particlefield (0 .5 .8) ? USE_COUNT @@ -164,98 +164,98 @@ USE_COUNT when the activator is a func_counter, the field will only void() func_particlefield = { - if( !self.color ) + if(!self.color) { self.color = 192; } - if( self.count == 0 ) + if(self.count == 0) { self.count = 2; } self.classname = "particlefield"; self.solid = SOLID_NOT; self.movetype = MOVETYPE_NONE; - setmodel (self, self.model); + setmodel(self, self.model); self.model = string_null; - self.origin = ( self.mins + self.maxs ) * 0.5; - setorigin (self, self.origin); + self.origin = (self.mins + self.maxs) * 0.5; + setorigin(self, self.origin); self.dest = self.maxs - self.mins - '16 16 16'; self.dest1 = self.mins + '8 8 8' - self.origin; self.dest2 = self.maxs + '7.9 7.9 7.9' - self.origin; - setsize (self, self.mins, self.maxs); + setsize(self, self.mins, self.maxs); self.touch = particlefield_touch; -// dprint( vtos( self.dest ) ); -// dprint( " " ); - if( self.dest_x > self.dest_z ) +// dprint(vtos(self.dest)); +// dprint(" "); + if(self.dest_x > self.dest_z) { - if( self.dest_y > self.dest_z ) + if(self.dest_y > self.dest_z) { -// dprint( "XY1 - " ); -// dprint( ftos( self.cnt ) ); -// dprint( "\n" ); +// dprint("XY1 - "); +// dprint(ftos(self.cnt)); +// dprint("\n"); self.use = particlefield_XY; - self.dest1_z = ( self.dest1_z + self.dest2_z ) / 2; + self.dest1_z = (self.dest1_z + self.dest2_z) / 2; } else { -// dprint( "XZ1 - " ); -// dprint( ftos( self.cnt ) ); -// dprint( "\n" ); +// dprint("XZ1 - "); +// dprint(ftos(self.cnt)); +// dprint("\n"); self.use = particlefield_XZ; - self.dest1_y = ( self.dest1_y + self.dest2_y ) / 2; + self.dest1_y = (self.dest1_y + self.dest2_y) / 2; } } else { - if( self.dest_y > self.dest_x ) + if(self.dest_y > self.dest_x) { -// dprint( "YZ2 - " ); -// dprint( ftos( self.cnt ) ); -// dprint( "\n" ); +// dprint("YZ2 - "); +// dprint(ftos(self.cnt)); +// dprint("\n"); self.use = particlefield_YZ; - self.dest1_x = ( self.dest1_x + self.dest2_x ) / 2; + self.dest1_x = (self.dest1_x + self.dest2_x) / 2; } else { -// dprint( "XZ2 - " ); -// dprint( ftos( self.cnt ) ); -// dprint( "\n" ); +// dprint("XZ2 - "); +// dprint(ftos(self.cnt)); +// dprint("\n"); self.use = particlefield_XZ; - self.dest1_y = ( self.dest1_y + self.dest2_y ) / 2; + self.dest1_y = (self.dest1_y + self.dest2_y) / 2; } } - if( self.noise ) + if(self.noise != NULLSTR) { - precache_sound( self.noise ); + precache_sound(self.noise); } self.ltime = time; }; void () blocker_touch = { - if( !self.dmg ) + if(!self.dmg) return; if(time < self.attack_finished) return; self.attack_finished = time + 0.5; - T_Damage (other, self, self, self.dmg); + T_Damage(other, self, self, self.dmg); }; void () blocker_use = { - if( !self.state ) + if(!self.state) { self.state = 1; - setorigin( self, self.origin - '8000 8000 8000' ); + setorigin(self, self.origin - '8000 8000 8000'); sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); } else { self.state = 0; - setorigin( self, self.origin + '8000 8000 8000' ); + setorigin(self, self.origin + '8000 8000 8000'); sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); } }; @@ -275,29 +275,29 @@ void() func_togglewall = self.classname = "togglewall"; self.movetype = MOVETYPE_PUSH; self.mdl = self.model; - setmodel (self, self.model); - setsize (self, self.mins, self.maxs); - setorigin (self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins, self.maxs); + setorigin(self, self.origin); self.touch = blocker_touch; self.use = blocker_use; - if( !self.noise ) + if(!self.noise) { self.noise = ("misc/null.wav"); } - if( !self.noise1 ) + if(!self.noise1) { self.noise1 = ("misc/null.wav"); } - precache_sound( self.noise ); - precache_sound( self.noise1 ); + precache_sound(self.noise); + precache_sound(self.noise1); self.solid = SOLID_BSP; self.model = string_null; - if( self.spawnflags & START_OFF ) + if(self.spawnflags & START_OFF) { self.state = 0; - setorigin( self, self.origin + '8000 8000 8000' ); + setorigin(self, self.origin + '8000 8000 8000'); } else { diff --git a/QC/hip_push.qc b/QC/hip_push.qc index 55f9425f..016ce60f 100644 --- a/QC/hip_push.qc +++ b/QC/hip_push.qc @@ -7,27 +7,27 @@ void() push_use = { - local vector delta; - local float x; - local float y; + vector delta; + float x; + float y; -// walkmove (other.angles_y, 16 * frametime); +// walkmove(other.angles_y, 16 * frametime); /* - if( (other.angles_y >= 315) || (other.angles_y < 45)) + if((other.angles_y >= 315) || (other.angles_y < 45)) { - walkmove ( 0, 16 * frametime); + walkmove(0, 16 * frametime); } - else if( (other.angles_y >= 45) && (other.angles_y < 135)) + else if((other.angles_y >= 45) && (other.angles_y < 135)) { - walkmove ( 90, 16 * frametime); + walkmove(90, 16 * frametime); } - else if( (other.angles_y >= 135) && (other.angles_y < 225)) + else if((other.angles_y >= 135) && (other.angles_y < 225)) { - walkmove ( 180, 16 * frametime); + walkmove(180, 16 * frametime); } - else if( (other.angles_y >= 225) && (other.angles_y < 315)) + else if((other.angles_y >= 225) && (other.angles_y < 315)) { - walkmove ( 270, 16 * frametime); + walkmove(270, 16 * frametime); } else { @@ -36,40 +36,40 @@ void() push_use = */ makevectors(other.angles); -// x = fabs( v_forward_x ); -// y = fabs( v_forward_y ); - x = fabs( other.velocity_x ); - y = fabs( other.velocity_y ); - dprint( ftos( x ) ); - dprint( ", " ); - dprint( ftos( y ) ); - if( x > y ) +// x = fabs(v_forward_x); +// y = fabs(v_forward_y); + x = fabs(other.velocity_x); + y = fabs(other.velocity_y); + dprint(ftos(x)); + dprint(", "); + dprint(ftos(y)); + if(x > y) { - dprint( " x move\n\n\n\n" ); - if( other.velocity_x > 0 ) + dprint(" x move\n\n\n\n"); + if(other.velocity_x > 0) { - walkmove ( 0, 16 * frametime); + walkmove(0, 16 * frametime); } else { - walkmove( 180, 16 * frametime ); + walkmove(180, 16 * frametime); } } else { - dprint( " y move\n\n\n\n" ); - if( other.velocity_y > 0 ) + dprint(" y move\n\n\n\n"); + if(other.velocity_y > 0) { - walkmove ( 90, 16 * frametime); + walkmove(90, 16 * frametime); } else { - walkmove( 270, 16 * frametime ); + walkmove(270, 16 * frametime); } } delta = self.origin - self.oldorigin; - setorigin (self.owner, self.owner.oldorigin + delta ); + setorigin(self.owner, self.owner.oldorigin + delta); }; /*QUAKED func_pushable (0 .5 .8) ? @@ -78,8 +78,8 @@ Pushable walls. void() func_pushable = { - local entity new; - local vector newsize; + entity new; + vector newsize; self.mangle = self.angles; self.angles = '0 0 0'; @@ -87,9 +87,9 @@ void() func_pushable = self.classname = "pushablewall"; self.solid = SOLID_BSP; self.movetype = MOVETYPE_PUSH; - setmodel (self, self.model); - setorigin( self, self.origin ); - setsize (self, self.mins, self.maxs ); + setmodel(self, self.model); + setorigin(self, self.origin); + setsize(self, self.mins, self.maxs); self.oldorigin = self.origin; new = spawn(); @@ -100,12 +100,12 @@ void() func_pushable = new.classname = "pushablewallproxy"; new.solid = SOLID_BBOX; new.movetype = MOVETYPE_STEP; - new.origin = ( self.mins + self.maxs ) * 0.5 + '0 0 1'; - newsize = ( self.maxs - self.mins ) * 0.5; + new.origin = (self.mins + self.maxs) * 0.5 + '0 0 1'; + newsize = (self.maxs - self.mins) * 0.5; new.mins = '-1 -1 0' - newsize; new.maxs = '1 1 -2' + newsize; - setsize( new, new.mins, new.maxs ); - setorigin( new, new.origin ); + setsize(new, new.mins, new.maxs); + setorigin(new, new.origin); new.oldorigin = new.origin; new.touch = push_use; }; diff --git a/QC/hip_quake.qc b/QC/hip_quake.qc new file mode 100644 index 00000000..07cc8adc --- /dev/null +++ b/QC/hip_quake.qc @@ -0,0 +1,84 @@ +/* Earthquake QuickC program + By Jim Dose' 9/13/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ +//JIM +float hip_earthquake; +float quakeactive; + +void() StopEarthQuake = + { + hip_earthquake = 0; + }; + +void(float value) EarthQuakeTime = + { + value = value + time; + if(value > hip_earthquake) + { + hip_earthquake = value; + } + }; + +void() earthquake_prethink = + { +// if(lastearthquake) +// { +// self.view_ofs_z = self.savedz; +// lastearthquake = 0; +// } + }; + +void() earthquake_postthink = + { + if(hip_earthquake > time) + { + if(quakeactive == 0) + { + sound(self, CHAN_VOICE, "misc/quake.wav", 1, ATTN_NONE); + quakeactive = 1; + } +// lastearthquake = 1; +// self.savedz = self.view_ofs_z; + if(self.flags & FL_ONGROUND) + { +// self.view_ofs_z = self.view_ofs_z - 5 + random() * 10; + self.velocity = self.velocity + (random() * '0 0 150'); + } + } + else + { + if(quakeactive == 1) + { + sound(self, CHAN_VOICE, "misc/quakeend.wav", 1, ATTN_NONE); + quakeactive = 0; + } + } + }; + +void() hip_earthquake_use = + { + EarthQuakeTime(self.dmg); + }; + +/*QUAKED func_earthquake (0 0 0.5) (0 0 0) (32 32 32) +Causes an earthquake. Triggers targets. + +"dmg" is the duration of the earthquake. Default is 0.8 seconds. +*/ + +void() func_earthquake = + { + quakeactive = 0; + precache_sound("misc/quake.wav"); + precache_sound("misc/quakeend.wav"); + self.classname = "earthquake"; + self.use = hip_earthquake_use; + self.think = SUB_Null; + if(!self.dmg) + { + self.dmg = 0.8; + } + }; diff --git a/QC/hip_rot.qc b/QC/hip_rot.qc new file mode 100644 index 00000000..59037b65 --- /dev/null +++ b/QC/hip_rot.qc @@ -0,0 +1,1122 @@ +/* Rotate QuickC program + By Jim Dose' 10/17/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +float STATE_ACTIVE = 0; +float STATE_INACTIVE = 1; +float STATE_SPEEDINGUP = 2; +float STATE_SLOWINGDOWN = 3; + +float STATE_CLOSED = 4; +float STATE_OPEN = 5; +float STATE_OPENING = 6; +float STATE_CLOSING = 7; + +float STATE_WAIT = 0; +float STATE_MOVE = 1; +float STATE_STOP = 2; +float STATE_FIND = 3; +float STATE_NEXT = 4; + +float OBJECT_ROTATE = 0; +float OBJECT_MOVEWALL = 1; +float OBJECT_SETORIGIN = 2; + +float TOGGLE = 1; +float START_ON = 2; + +float ROTATION = 1; +float ANGLES = 2; +float STOP = 4; +float NO_ROTATE = 8; +float DAMAGE = 16; +float MOVETIME = 32; +float SET_DAMAGE = 64; + +float VISIBLE = 1; +float TOUCH = 2; +float NONBLOCKING = 4; + +float STAYOPEN = 1; + +/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) +Used as the point of rotation for rotatable objects. +*/ +void() info_rotate = +{ +// remove self after a little while, to make sure that entities that +// have targeted it have had a chance to spawn + self.nextthink = time + 2; + self.think = SUB_Remove; +}; + +void() RotateTargets = + { + entity ent; + vector vx; + vector vy; + vector vz; + vector org; + + makevectors(self.angles); + + ent = find(world, targetname, self.target); + while(ent) + { + if(ent.rotate_type == OBJECT_SETORIGIN) + { + org = ent.oldorigin; + vx = (v_forward * org_x); + vy = (v_right * org_y); + vy = vy * -1; + vz = (v_up * org_z); + ent.neworigin = vx + vy + vz; + setorigin(ent, ent.neworigin + self.origin); + } + else if(ent.rotate_type == OBJECT_ROTATE) + { + ent.angles = self.angles; + org = ent.oldorigin; + vx = (v_forward * org_x); + vy = (v_right * org_y); + vy = vy * -1; + vz = (v_up * org_z); + ent.neworigin = vx + vy + vz; + setorigin(ent, ent.neworigin + self.origin); + } + else + { + org = ent.oldorigin; + vx = (v_forward * org_x); + vy = (v_right * org_y); + vy = vy * -1; + vz = (v_up * org_z); + ent.neworigin = vx + vy + vz; + ent.neworigin = self.origin - self.oldorigin + (ent.neworigin - ent.oldorigin); + ent.velocity = (ent.neworigin-ent.origin)*25; + } + ent = find(ent, targetname, self.target); + } + }; + +void() RotateTargetsFinal = + { + entity ent; + + ent = find(world, targetname, self.target); + while(ent) + { + ent.velocity = '0 0 0'; + if(ent.rotate_type == OBJECT_ROTATE) + { + ent.angles = self.angles; + } + ent = find(ent, targetname, self.target); + } + }; + +void() SetTargetOrigin = + { + entity ent; + + ent = find(world, targetname, self.target); + while(ent) + { + if(ent.rotate_type == OBJECT_MOVEWALL) + { + setorigin(ent, self.origin - self.oldorigin + + (ent.neworigin - ent.oldorigin)); + } + else + { + setorigin(ent, ent.neworigin + self.origin); + } + ent = find(ent, targetname, self.target); + } + }; + +void() LinkRotateTargets = + { + entity ent; + vector tempvec; + + self.oldorigin = self.origin; + ent = find(world, targetname, self.target); + while(ent) + { + if(ent.classname == "rotate_object") + { + ent.rotate_type = OBJECT_ROTATE; + ent.oldorigin = ent.origin - self.oldorigin; + ent.neworigin = ent.origin - self.oldorigin; + ent.owner = self; + } + else if(ent.classname == "func_movewall") + { + ent.rotate_type = OBJECT_MOVEWALL; + tempvec = (ent.absmin + ent.absmax) * 0.5; + ent.oldorigin = tempvec - self.oldorigin; + ent.neworigin = ent.oldorigin; + ent.owner = self; + } + else + { + ent.rotate_type = OBJECT_SETORIGIN; + ent.oldorigin = ent.origin - self.oldorigin; + ent.neworigin = ent.origin - self.oldorigin; + } + ent = find(ent, targetname, self.target); + } + }; + +void(float amount) SetDamageOnTargets = + { + entity ent; + + ent = find(world, targetname, self.target); + while(ent) + { + if(ent.classname == "trigger_hurt") + { + hurt_setdamage(ent, amount); + } + else if(ent.classname == "func_movewall") + { + ent.dmg = amount; + } + ent = find(ent, targetname, self.target); + } + }; + + +//************************************************ +// +// Simple continual rotatation +// +//************************************************ + +void() rotate_entity_think = + { + float t; + + t = time - self.ltime; + self.ltime = time; + + if(self.state == STATE_SPEEDINGUP) + { + self.count = self.count + self.cnt * t; + if(self.count > 1) + { + self.count = 1; + } + + // get rate of rotation + t = t * self.count; + } + else if(self.state == STATE_SLOWINGDOWN) + { + self.count = self.count - self.cnt * t; + if(self.count < 0) + { + RotateTargetsFinal(); + self.state = STATE_INACTIVE; + self.think = SUB_Null; + return; + } + + // get rate of rotation + t = t * self.count; + } + + self.angles = self.angles + (self.rotate * t); + self.angles = SUB_NormalizeAngles(self.angles); + RotateTargets(); + self.nextthink = time + 0.02; + }; + +void() rotate_entity_use = + { + // change to alternate textures + self.frame = 1 - self.frame; + + if(self.state == STATE_ACTIVE) + { + if(self.spawnflags & TOGGLE) + { + if(self.speed) + { + self.count = 1; + self.state = STATE_SLOWINGDOWN; + } + else + { + self.state = STATE_INACTIVE; + self.think = SUB_Null; + } + } + } + else if(self.state == STATE_INACTIVE) + { + self.think = rotate_entity_think; + self.nextthink = time + 0.02; + self.ltime = time; + if(self.speed) + { + self.count = 0; + self.state = STATE_SPEEDINGUP; + } + else + { + self.state = STATE_ACTIVE; + } + } + else if(self.state == STATE_SPEEDINGUP) + { + if(self.spawnflags & TOGGLE) + { + self.state = STATE_SLOWINGDOWN; + } + } + else + { + self.state = STATE_SPEEDINGUP; + } + }; + +void() rotate_entity_firstthink = + { + LinkRotateTargets(); + if(self.spawnflags & START_ON) + { + self.state = STATE_ACTIVE; + self.think = rotate_entity_think; + self.nextthink = time + 0.02; + self.ltime = time; + } + else + { + self.state = STATE_INACTIVE; + self.think = SUB_Null; + } + self.use = rotate_entity_use; + }; + +/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON +Creates an entity that continually rotates. Can be toggled on and +off if targeted. + +TOGGLE = allows the rotation to be toggled on/off + +START_ON = wether the entity is spinning when spawned. If TOGGLE is 0, entity can be turned on, but not off. + +If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train. + +"rotate" is the rate to rotate. +"target" is the center of rotation. +"speed" is how long the entity takes to go from standing still to full speed and vice-versa. +*/ + +void() func_rotate_entity = + { + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + setmodel(self, self.model); + setsize(self, self.mins, self.maxs); + + if(self.speed != 0) + { + self.cnt = 1 / self.speed; + } + + self.think = rotate_entity_firstthink; + self.nextthink = time + 0.1; + self.ltime = time; + }; + +//************************************************ +// +// Train with rotation functionality +// +//************************************************ + +/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE + Path for rotate_train. + + ROTATION tells train to rotate at rate specified by "rotate". Use '0 0 0' to stop rotation. + + ANGLES tells train to rotate to the angles specified by "angles" while traveling to this path_rotate. Use values < 0 or > 360 to guarantee that it turns in a certain direction. Having this flag set automatically clears any rotation. + + STOP tells the train to stop and wait to be retriggered. + + NO_ROTATE tells the train to stop rotating when waiting to be triggered. + + DAMAGE tells the train to cause damage based on "dmg". + + MOVETIME tells the train to interpret "speed" as the length of time to take moving from one corner to another. + + SET_DAMAGE tells the train to set all targets damage to "dmg" + + "noise" contains the name of the sound to play when train stops. + "noise1" contains the name of the sound to play when train moves. + "event" is a target to trigger when train arrives at path_rotate. +*/ +void() path_rotate = + { + if(self.noise != NULLSTR) + { + precache_sound(self.noise); + } + if(self.noise1 != NULLSTR) + { + precache_sound(self.noise1); + } + }; + + +void() rotate_train; +void() rotate_train_next; +void() rotate_train_find; + +void() rotate_train_think = + { + float t; + float timeelapsed; + + t = time - self.ltime; + self.ltime = time; + + if((self.endtime) && (time >= self.endtime)) + { + self.endtime = 0; + if(self.state == STATE_MOVE) + { + setorigin(self, self.finaldest); + self.velocity = '0 0 0'; + } + + if(self.think1) + self.think1(); + } + else + { + timeelapsed = (time - self.cnt) * self.duration; + if(timeelapsed > 1) + timeelapsed = 1; + setorigin(self, self.dest1 + (self.dest2 * timeelapsed)); + } + + self.angles = self.angles + (self.rotate * t); + self.angles = SUB_NormalizeAngles(self.angles); + RotateTargets(); + + self.nextthink = time + 0.02; + }; + +void() rotate_train_use = + { + if(self.think1 != rotate_train_find) + { + if(self.velocity != '0 0 0') + return; // already activated + if(self.think1) + { + self.think1(); + } + } + }; + +void() rotate_train_wait = + { + self.state = STATE_WAIT; + + if(self.goalentity.noise != NULLSTR) + { + sound(self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); + } + else + { + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + if(self.goalentity.spawnflags & ANGLES) + { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + if(self.goalentity.spawnflags & NO_ROTATE) + { + self.rotate = '0 0 0'; + } + self.endtime = self.ltime + self.goalentity.wait; + self.think1 = rotate_train_next; + }; + +void() rotate_train_stop = + { + self.state = STATE_STOP; + + if(self.goalentity.noise != NULLSTR) + { + sound(self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); + } + else + { + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + if(self.goalentity.spawnflags & ANGLES) + { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + if(self.goalentity.spawnflags & NO_ROTATE) + { + self.rotate = '0 0 0'; + } + + self.dmg = 0; + self.think1 = rotate_train_next; + }; + +void() rotate_train_next = +{ + entity targ; + entity current; + vector vdestdelta; + float len, traveltime, div; + string temp; + + self.state = STATE_NEXT; + + current = self.goalentity; + targ = find(world, targetname, self.path); + if(targ.classname != "path_rotate") + objerror("Next target is not path_rotate"); + + if(self.goalentity.noise1 != NULLSTR) + { + self.noise1 = self.goalentity.noise1; + } + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + + self.goalentity = targ; + self.path = targ.target; + if(!self.path) + objerror ("rotate_train_next: no next target"); + + if(targ.spawnflags & STOP) + { + self.think1 = rotate_train_stop; + } + else if(targ.wait) + { + self.think1 = rotate_train_wait; + } + else + { + self.think1 = rotate_train_next; + } + + if(current.event != NULLSTR) + { + // Trigger any events that should happen at the corner. + temp = self.target; + self.target = current.event; + self.message = current.message; + SUB_UseTargets(); + self.target = temp; + self.message = string_null; + } + + if(current.spawnflags & ANGLES) + { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + + if(current.spawnflags & ROTATION) + { + self.rotate = current.rotate; + } + + if(current.spawnflags & DAMAGE) + { + self.dmg = current.dmg; + } + + if(current.spawnflags & SET_DAMAGE) + { + SetDamageOnTargets(current.dmg); + } + + if(current.speed == -1) + { + // Warp to the next path_corner + setorigin(self, targ.origin); + self.endtime = self.ltime + 0.01; + SetTargetOrigin(); + + if(targ.spawnflags & ANGLES) + { + self.angles = targ.angles; + } + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + self.finaldest = self.origin; + } + else + { + self.state = STATE_MOVE; + + self.finaldest = targ.origin; + if(self.finaldest == self.origin) + { + self.velocity = '0 0 0'; + self.endtime = self.ltime + 0.1; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + self.finaldest = self.origin; + return; + } + // set destdelta to the vector needed to move + vdestdelta = self.finaldest - self.origin; + + // calculate length of vector + len = vlen(vdestdelta); + + if(current.spawnflags & MOVETIME) + { + traveltime = current.speed; + } + else + { + // check if there's a speed change + if(current.speed>0) + self.speed = current.speed; + + if(!self.speed) + objerror("No speed is defined!"); + + // divide by speed to get time to reach dest + traveltime = len / self.speed; + } + + if(traveltime < 0.1) + { + self.velocity = '0 0 0'; + self.endtime = self.ltime + 0.1; + if(targ.spawnflags & ANGLES) + { + self.angles = targ.angles; + } + return; + } + + // qcc won't take vec/float + div = 1 / traveltime; + + if(targ.spawnflags & ANGLES) + { + self.finalangle = SUB_NormalizeAngles(targ.angles); + self.rotate = (targ.angles - self.angles) * div; + } + + // set endtime to trigger a think when dest is reached + self.endtime = self.ltime + traveltime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * div; + + self.duration = div; // 1 / duration + self.cnt = time; // start time + self.dest2 = vdestdelta; // delta + self.dest1 = self.origin; // original position + } + }; + +void() rotate_train_find = + { + entity targ; + + self.state = STATE_FIND; + + LinkRotateTargets(); + + // the first target is the point of rotation. + // the second target is the path. + targ = find(world, targetname, self.path); + if(targ.classname != "path_rotate") + objerror("Next target is not path_rotate"); + + // Save the current entity + self.goalentity = targ; + + if(targ.spawnflags & ANGLES) + { + self.angles = targ.angles; + self.finalangle = SUB_NormalizeAngles(targ.angles); + } + + self.path = targ.target; + setorigin(self, targ.origin); + SetTargetOrigin(); + RotateTargetsFinal(); + self.think1 = rotate_train_next; + if(!self.targetname) + { + // not triggered, so start immediately + self.endtime = self.ltime + 0.1; + } + else + { + self.endtime = 0; + } + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + }; + +/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) +In path_rotate, set speed to be the new speed of the train after it reaches +the path change. If speed is -1, the train will warp directly to the next +path change after the specified wait time. If MOVETIME is set on the +path_rotate, the train to interprets "speed" as the length of time to +take moving from one corner to another. + +"noise" contains the name of the sound to play when train stops. +"noise1" contains the name of the sound to play when train moves. +Both "noise" and "noise1" defaults depend upon "sounds" variable and +can be overridden by the "noise" and "noise1" variable in path_rotate. + +Also in path_rotate, if STOP is set, the train will wait until it is +retriggered before moving on to the next goal. + +Trains are moving platforms that players can ride. +"path" specifies the first path_rotate and is the starting position. +If the train is the target of a button or trigger, it will not begin moving until activated. +The func_rotate_train entity is the center of rotation of all objects targeted by it. + +If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train. + +speed default 100 +dmg default 0 +sounds +1) ratchet metal +*/ + +void() rotate_train = + { + objerror ("rotate_train entities should be changed to rotate_object with\nfunc_rotate_train controllers\n"); + }; + +void() func_rotate_train = + { + if(!self.speed) + self.speed = 100; + if(!self.target) + objerror ("rotate_train without a target"); + + if(!self.noise) + { + if(self.sounds == 0) + { + self.noise = ("misc/null.wav"); + } + + if(self.sounds == 1) + { + self.noise = ("plats/train2.wav"); + } + } + if(!self.noise1) + { + if(self.sounds == 0) + { + self.noise1 = ("misc/null.wav"); + } + if(self.sounds == 1) + { + self.noise1 = ("plats/train1.wav"); + } + } + + precache_sound(self.noise); + precache_sound(self.noise1); + + self.cnt = 1; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_STEP; + self.use = rotate_train_use; + + setmodel(self, self.model); + setsize(self, self.mins, self.maxs); + setorigin(self, self.origin); + +// start trains on the second frame, to make sure their targets have had +// a chance to spawn + self.ltime = time; + self.nextthink = self.ltime + 0.1; + self.endtime = self.ltime + 0.1; + self.think = rotate_train_think; + self.think1 = rotate_train_find; + self.state = STATE_FIND; + + self.duration = 1; // 1 / duration + self.cnt = 0.1; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + + + self.flags = self.flags | FL_ONGROUND; + }; + +//************************************************ +// +// Moving clip walls +// +//************************************************ + +void() rotate_door_reversedirection; +void() rotate_door_group_reversedirection; + +void() movewall_touch = + { + if(time < self.owner.attack_finished) + return; + + if(self.dmg) + { + T_Damage(other, self, self.owner, self.dmg); + self.owner.attack_finished = time + 0.5; + } + else if(self.owner.dmg) + { + T_Damage(other, self, self.owner, self.owner.dmg); + self.owner.attack_finished = time + 0.5; + } + }; + +void() movewall_blocked = + { + entity temp; + + if(time < self.owner.attack_finished) + return; + + self.owner.attack_finished = time + 0.5; + + if(self.owner.classname == "func_rotate_door") + { + temp = self; + self = self.owner; + rotate_door_group_reversedirection(); + self = temp; + } + + if(self.dmg) + { + T_Damage(other, self, self.owner, self.dmg); + self.owner.attack_finished = time + 0.5; + } + else if(self.owner.dmg) + { + T_Damage(other, self, self.owner, self.owner.dmg); + self.owner.attack_finished = time + 0.5; + } + }; + +void() movewall_think = + { + self.ltime = time; + self.nextthink = time + 0.02; + }; + +/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING +Used to emulate collision on rotating objects. + +VISIBLE causes brush to be displayed. + +TOUCH specifies whether to cause damage when touched by player. + +NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set. + +"dmg" specifies the damage to cause when touched or blocked. +*/ +void() func_movewall = + { + self.angles = '0 0 0'; + self.movetype = MOVETYPE_PUSH; + if(self.spawnflags & NONBLOCKING) + { + self.solid = SOLID_NOT; + } + else + { + self.solid = SOLID_BSP; + self.blocked = movewall_blocked; + } + if(self.spawnflags & TOUCH) + { + self.touch = movewall_touch; + } + setmodel(self,self.model); + if(!(self.spawnflags & VISIBLE)) + { + self.model = string_null; + } + self.think = movewall_think; + self.nextthink = time + 0.02; + self.ltime = time; + }; + +/*QUAKED rotate_object (0 .5 .8) ? +This defines an object to be rotated. Used as the target of func_rotate_door. +*/ +void() rotate_object = + { + self.classname = "rotate_object"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setmodel(self,self.model); + setsize(self, self.mins, self.maxs); + self.think = SUB_Null; + }; + +//************************************************ +// +// Rotating doors +// +//************************************************ + +void() rotate_door_think2 = + { + float t; + + t = time - self.ltime; + self.ltime = time; + + // change to alternate textures + self.frame = 1 - self.frame; + + self.angles = self.dest; + + if(self.state == STATE_OPENING) + { + self.state = STATE_OPEN; + } + else + { + if(self.spawnflags & STAYOPEN) + { + rotate_door_group_reversedirection(); + return; + } + self.state = STATE_CLOSED; + } + + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + self.think = SUB_Null; + + RotateTargetsFinal(); + }; + +void() rotate_door_think = + { + float t; + + t = time - self.ltime; + self.ltime = time; + + if(time < self.endtime) + { + self.angles = self.angles + (self.rotate * t); + RotateTargets(); + } + else + { + self.angles = self.dest; + RotateTargets(); + self.think = rotate_door_think2; + } + + self.nextthink = time + 0.01; + }; + +void() rotate_door_reversedirection = + { + vector start; + + // change to alternate textures + self.frame = 1 - self.frame; + + if(self.state == STATE_CLOSING) + { + start = self.dest1; + self.dest = self.dest2; + self.state = STATE_OPENING; + } + else + { + start = self.dest2; + self.dest = self.dest1; + self.state = STATE_CLOSING; + } + + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + + self.rotate = (self.dest - start) * (1 / self.speed); + self.think = rotate_door_think; + self.nextthink = time + 0.02; + self.endtime = time + self.speed - (self.endtime - time); + self.ltime = time; + }; + +void() rotate_door_group_reversedirection = + { + string name; + + // tell all associated rotaters to reverse direction + if(self.group != NULLSTR) + { + name = self.group; + self = find(world, group, name); + while(self) + { + rotate_door_reversedirection(); + self = find(self, group, name); + } + } + else + { + rotate_door_reversedirection(); + } + }; + +void() rotate_door_use = + { + vector start; + + if((self.state != STATE_OPEN) && (self.state != STATE_CLOSED)) + return; + + if(!self.cnt) + { + self.cnt = 1; + LinkRotateTargets(); + } + + // change to alternate textures + self.frame = 1 - self.frame; + + if(self.state == STATE_CLOSED) + { + start = self.dest1; + self.dest = self.dest2; + self.state = STATE_OPENING; + } + else + { + start = self.dest2; + self.dest = self.dest1; + self.state = STATE_CLOSING; + } + + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + + self.rotate = (self.dest - start) * (1 / self.speed); + self.think = rotate_door_think; + self.nextthink = time + 0.01; + self.endtime = time + self.speed; + self.ltime = time; + }; + + +/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN +Creates a door that rotates between two positions around a point of +rotation each time it's triggered. + +STAYOPEN tells the door to reopen after closing. This prevents a trigger- +once door from closing again when it's blocked. + +"dmg" specifies the damage to cause when blocked. Defaults to 2. Negative numbers indicate no damage. +"speed" specifies how the time it takes to rotate + +"sounds" +1) medieval (default) +2) metal +3) base +*/ + +void() func_rotate_door = + { + if(!self.target) + { + objerror("rotate_door without target."); + } + + self.dest1 = '0 0 0'; + self.dest2 = self.angles; + self.angles = self.dest1; + + // default to 2 seconds + if(!self.speed) + { + self.speed = 2; + } + + self.cnt = 0; + + if(!self.dmg) + self.dmg = 2; + else if(self.dmg < 0) + { + self.dmg = 0; + } + + if(self.sounds == 0) + self.sounds = 1; + if(self.sounds == 1) + { + precache_sound("doors/latch2.wav"); + precache_sound("doors/winch2.wav"); + precache_sound("doors/drclos4.wav"); + self.noise1 = "doors/latch2.wav"; + self.noise2 = "doors/winch2.wav"; + self.noise3 = "doors/drclos4.wav"; + } + if(self.sounds == 2) + { + precache_sound("doors/airdoor1.wav"); + precache_sound("doors/airdoor2.wav"); + self.noise2 = "doors/airdoor1.wav"; + self.noise1 = "doors/airdoor2.wav"; + self.noise3 = "doors/airdoor2.wav"; + } + if(self.sounds == 3) + { + precache_sound("doors/basesec1.wav"); + precache_sound("doors/basesec2.wav"); + self.noise2 = "doors/basesec1.wav"; + self.noise1 = "doors/basesec2.wav"; + self.noise3 = "doors/basesec2.wav"; + } + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setmodel(self, self.model); + setorigin(self, self.origin); + setsize(self, self.mins, self.maxs); + self.state = STATE_CLOSED; + self.use = rotate_door_use; + self.think = SUB_Null; + }; diff --git a/QC/hip_rubbl.qc b/QC/hip_rubbl.qc new file mode 100644 index 00000000..4a672cc5 --- /dev/null +++ b/QC/hip_rubbl.qc @@ -0,0 +1,141 @@ +/* Rubble QuickC program + By Jim Dose' 9/15/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +void() hipRubbleTouch = +{ + if(self.lip || vlen(self.velocity) < 10.0) + { + return; + } + + if(other.takedamage) + { + T_Damage(other, self, self.owner, self.dmg); + sound(self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + self.lip = TRUE; + } +} + +void(string rubblename) hipThrowRubble = +{ + entity newent; + + newent = spawn(); + newent.origin = self.origin; + setmodel(newent, rubblename); + setsize(newent, '0 0 0', '0 0 0'); + newent.velocity_x = 70 * crandom(); + newent.velocity_y = 70 * crandom(); + newent.velocity_z = 140 + 70 * random(); + newent.movetype = MOVETYPE_BOUNCE; + newent.solid = SOLID_BBOX; + newent.avelocity_x = random()*600; + newent.avelocity_y = random()*600; + newent.avelocity_z = random()*600; + newent.think = SUB_Remove; + newent.touch = hipRubbleTouch; + newent.nextthink = time + 13 + random()*10; + newent.frame = 0; + newent.flags = 0; + newent.lip = FALSE; // hit someone yet? + newent.dmg = self.dmg; +} + +void() hip_rubble_use = +{ + float index = 0; + + do + { + float which = self.cnt; + + if(self.cnt == 0) + { + which = 1 + 3*random(); + which = floor(which); + } + + if(which == 1) + { + hipThrowRubble("progs/rubble1.mdl"); + } + else if(which == 2) + { + hipThrowRubble("progs/rubble3.mdl"); + } + else + { + hipThrowRubble("progs/rubble2.mdl"); + } + + index += 1; + } + while(index < self.count); +} + +/*QUAKED func_rubble (0.4 0.4 0.2) (0 0 0) (32 32 32) + Spawns random sized rubble when triggered. + + "count" is the number of pieces of rubble to spawn. Default is 1. +*/ +void() func_rubble = +{ + precache_model("progs/rubble1.mdl"); + precache_model("progs/rubble2.mdl"); + precache_model("progs/rubble3.mdl"); + precache_sound("zombie/z_hit.wav"); + self.classname = "rubble"; + self.cnt = 0; + self.use = hip_rubble_use; + if(!self.dmg) { self.dmg = 10; } +} + +/*QUAKED func_rubble1 (0.4 0.4 0.2) (0 0 0) (8 8 8) + Spawns small rubble when triggered. + + "count" is the number of pieces of rubble to spawn. Default is 1. +*/ +void() func_rubble1 = +{ + precache_model("progs/rubble1.mdl"); + precache_sound("zombie/z_hit.wav"); + self.classname = "rubble1"; + self.cnt = 1; + self.use = hip_rubble_use; + if(!self.dmg) { self.dmg = 10; } +} + +/*QUAKED func_rubble2 (0.4 0.4 0.2) (0 0 0) (16 16 16) + Spawns medium rubble when triggered. + + "count" is the number of pieces of rubble to spawn. Default is 1. +*/ +void() func_rubble2 = +{ + precache_model("progs/rubble3.mdl"); + precache_sound("zombie/z_hit.wav"); + self.classname = "rubble2"; + self.cnt = 2; + self.use = hip_rubble_use; + if(!self.dmg) { self.dmg = 10; } +} + +/*QUAKED func_rubble3 (0.4 0.4 0.2) (0 0 0) (32 32 32) + Spawns large rubble when triggered. + + "count" is the number of pieces of rubble to spawn. Default is 1. +*/ +void() func_rubble3 = +{ + precache_model("progs/rubble2.mdl"); + precache_sound("zombie/z_hit.wav"); + self.classname = "rubble3"; + self.cnt = 3; + self.use = hip_rubble_use; + if(!self.dmg) { self.dmg = 10; } +} + diff --git a/QC/hip_spawn.qc b/QC/hip_spawn.qc new file mode 100644 index 00000000..691a588f --- /dev/null +++ b/QC/hip_spawn.qc @@ -0,0 +1,355 @@ +//===================================================================== +// +// Spawning Functions (Hipnotic) +// +//===================================================================== + +//================ +// +// spawn_think +// +//================ + +void() spawn_think = + { + self.think = spawn_think; + self.nextthink = time + 1; + }; + +//================ +// +// spawn_use +// +//================ + +void() spawn_use = +{ + entity spawnentity; + + if((self.spawnmulti == 1) || (horn_active)) + { + // spawn the new entity + spawnentity = spawn(); + // copy the master mold + SUB_CopyEntity(self.spawnmaster,spawnentity); + } + else + { + spawnentity = self.spawnmaster; + } + // restore the model + spawnentity.model = spawnentity.spawnmodel; + //restore solid flag + spawnentity.solid = spawnentity.spawnsolidtype; + //restore thinking function + spawnentity.think = spawnentity.spawnthink; + setmodel(spawnentity, spawnentity.model); + setorigin(spawnentity, spawnentity.origin); + spawnentity.mins = spawnentity.spawnmins; + spawnentity.maxs = spawnentity.spawnmaxs; + setsize(spawnentity, spawnentity.mins, spawnentity.maxs); + // spawn the teleport effect + if(self.spawnsilent == 0) + spawn_tfog (spawnentity.origin); +// horn_active = 0; +// horn_charmer = find(world, classname, "player"); + // call spawnentity think function + if(horn_active) + { + spawnentity.charmer = horn_charmer; + spawnentity.charmed = 1; + } +// if(spawnentity.think) +// { +// spawnentity.nextthink = time+0.1; +// tempself = self; +// self = spawnentity; +// self.think(); +// self = tempself; +// spawnentity.nextthink = time+0.1; +// self.nextthink = 1; +// if(spawnentity.nextthink < time) +// spawnentity.nextthink = 1; +// } + // check to see if it is a monster + if(spawnentity.flags & FL_MONSTER) + { + if((self.spawnmulti != 0) && (horn_active == 0)) + { + total_monsters = total_monsters + 1; + WriteByte(MSG_BROADCAST, SVC_UPDATESTAT); + WriteByte(MSG_BROADCAST, STAT_TOTALMONSTERS); + WriteLong (MSG_BROADCAST, total_monsters); + } + // spawn the telefrag effect +// if(self.spawnsilent == 0) +// spawn_tdeath(spawnentity.origin, spawnentity); + if(horn_active) + { + spawnentity.effects = spawnentity.effects | EF_DIMLIGHT; +// spawnentity.effects = spawnentity.effects | EF_BRIGHTFIELD; + } + } + if((self.spawnmulti == 0) && (horn_active == 0)) + { + remove(self); + } + }; + +//================ +// +// func_spawn +// +//================ +/*QUAKED func_spawn (0 .5 .8) (-32 -32 -24) (32 32 64) big/ambush megahealth +This will spawn a thing upon being used. The thing that +is spawned depends upon the value of "spawnfunction". +"spawnclassname" should contain the same value as "spawnfunction". +If "spawnfunction" is unspecified a random monster is chosen. +The angles, target and all flags are passed on +Think of it like setting up a normal entity. +"spawnsilent" set this to 1 if you want a silent spawn. +"spawnmulti" set this to 1 if you want this spawn to be reoccuring. +*/ + +void() func_spawn = + { + entity tempself; + entity monster; + float tempdeathmatch; + float temptotal_monsters; + + // save off deathmatch and zero it out + tempself = self; + tempdeathmatch = deathmatch; + deathmatch = 0; + if(!self.spawnfunction) + { + float spawnchance; + + spawnchance = random(); + monster = tempself; + + // save off monster count so it doesn't get f'ed up + temptotal_monsters = total_monsters; + + // spawn dog + // spawn the new entity + self = spawn(); + // copy over everything + SUB_CopyEntity(tempself,self); + self.spawnfunction = monster_dog; + self.spawnclassname = "monster_dog"; + self.classname = self.spawnclassname; + + // call the named spawn function + self.spawnfunction(); + self.spawnmodel = self.model; + self.spawnmins = self.mins; + self.spawnmaxs = self.maxs; + setmodel(self, ""); + setsize(self, self.spawnmins, self.spawnmaxs); + //save off solid flag + self.spawnsolidtype = self.solid; + self.solid = SOLID_NOT; + //save off think func and + //get rid of his thinking + self.spawnthink = self.think; + self.think = spawn_think; + self.nextthink = time + 1; + + if(spawnchance<0.5 && monster==tempself) + { + monster = self; + } + + // spawn ogre + // spawn the new entity + self = spawn(); + // copy over everything + SUB_CopyEntity(tempself,self); + self.spawnfunction = monster_ogre; + self.spawnclassname = "monster_ogre"; + self.classname = self.spawnclassname; + + // call the named spawn function + self.spawnfunction(); + self.spawnmodel = self.model; + self.spawnmins = self.mins; + self.spawnmaxs = self.maxs; + setmodel(self, ""); + setsize(self, self.spawnmins, self.spawnmaxs); + //save off solid flag + self.spawnsolidtype = self.solid; + self.solid = SOLID_NOT; + //save off think func and + //get rid of his thinking + self.spawnthink = self.think; + self.think = spawn_think; + self.nextthink = time + 1; + + if(spawnchance<0.8 && monster==tempself) + { + monster = self; + } + + // spawn fiend + // spawn the new entity + self = spawn(); + // copy over everything + SUB_CopyEntity(tempself,self); + self.spawnfunction = monster_demon1; + self.spawnclassname = "monster_demon1"; + self.classname = self.spawnclassname; + + // call the named spawn function + self.spawnfunction(); + self.spawnmodel = self.model; + self.spawnmins = self.mins; + self.spawnmaxs = self.maxs; + setmodel(self, ""); + setsize(self, self.spawnmins, self.spawnmaxs); + //save off solid flag + self.spawnsolidtype = self.solid; + self.solid = SOLID_NOT; + //save off think func and + //get rid of his thinking + self.spawnthink = self.think; + self.think = spawn_think; + self.nextthink = time + 1; + + if(spawnchance<0.92 && monster==tempself) + { + monster = self; + } + + // spawn zombie + // spawn the new entity + self = spawn(); + // copy over everything + SUB_CopyEntity(tempself,self); + self.spawnfunction = monster_zombie; + self.spawnclassname = "monster_zombie"; + self.classname = self.spawnclassname; + + // call the named spawn function + self.spawnfunction(); + self.spawnmodel = self.model; + self.spawnmins = self.mins; + self.spawnmaxs = self.maxs; + setmodel(self, ""); + setsize(self, self.spawnmins, self.spawnmaxs); + //save off solid flag + self.spawnsolidtype = self.solid; + self.solid = SOLID_NOT; + //save off think func and + //get rid of his thinking + self.spawnthink = self.think; + self.think = spawn_think; + self.nextthink = time + 1; + + if(spawnchance<0.97 && monster==tempself) + { + monster = self; + } + + // spawn shambler + // spawn the new entity + self = spawn(); + // copy over everything + SUB_CopyEntity(tempself,self); + self.spawnfunction = monster_shambler; + self.spawnclassname = "monster_shambler"; + self.classname = self.spawnclassname; + + // call the named spawn function + self.spawnfunction(); + self.spawnmodel = self.model; + self.spawnmins = self.mins; + self.spawnmaxs = self.maxs; + setmodel(self, ""); + setsize(self, self.spawnmins, self.spawnmaxs); + //save off solid flag + self.spawnsolidtype = self.solid; + self.solid = SOLID_NOT; + //save off think func and + //get rid of his thinking + self.spawnthink = self.think; + self.think = spawn_think; + self.nextthink = time + 1; + + if(monster==tempself) + { + monster = self; + } + // make sure monster count is correct + total_monsters = temptotal_monsters + 1; + } + else + { + // spawn the new entity + self = spawn(); + // copy over everything + SUB_CopyEntity(tempself,self); + + // save off monster count so it doesn't get f'ed up + temptotal_monsters = total_monsters; + if(self.spawnclassname == string_null) + { + objerror("No spawnclassname defined"); + } + self.classname = self.spawnclassname; + // call the named spawn function + self.spawnfunction(); + if(self.spawnmulti != 0) + { + // make sure monster count is correct + total_monsters = temptotal_monsters; + } + self.spawnmodel = self.model; + self.spawnmins = self.mins; + self.spawnmaxs = self.maxs; + setmodel(self, ""); + self.model = ""; + setsize(self, self.spawnmins, self.spawnmaxs); + //save off solid flag + self.spawnsolidtype = self.solid; + self.solid = SOLID_NOT; + //save off think func and + //get rid of his thinking + self.spawnthink = self.think; + self.think = spawn_think; + self.nextthink = time + 1; + monster = self; + } + self = tempself; + deathmatch = tempdeathmatch; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.modelindex = 0; + self.model = ""; + setmodel(self, self.model); // set size and link into world + self.use = spawn_use; + self.spawnmaster = monster; + }; + +//================ +// +// func_spawn_small +// +//================ +/*QUAKED func_spawn_small (0 .5 .8) (-16 -16 -24) (16 16 40) big/ambush megahealth +This will spawn a thing upon being used. The thing that +is spawned depends upon the value of "spawnfunction". +"spawnclassname" should contain the same value as "spawnfunction". +If "spawnfunction" is unspecified a random monster is chosen. +The angles, target and all flags are passed on +Think of it like setting up a normal entity. +"spawnsilent" set this to 1 if you want a silent spawn. +"spawnmulti" set this to 1 if you want this spawn to be reoccuring. +*/ + +void() func_spawn_small = + { + func_spawn(); + }; diff --git a/QC/hipspr.qc b/QC/hip_spr.qc similarity index 100% rename from QC/hipspr.qc rename to QC/hip_spr.qc diff --git a/QC/hip_subs.qc b/QC/hip_subs.qc new file mode 100644 index 00000000..a2cb47e0 --- /dev/null +++ b/QC/hip_subs.qc @@ -0,0 +1,237 @@ +//========================= +// +// Hipnotic Sub-routines +// +//========================= + + +//========================= +// +// SUB_CopyEntity +// +//========================= + +void (entity srcent, entity destent) SUB_CopyEntity = + { + destent.modelindex=srcent.modelindex; + destent.absmin=srcent.absmin; + destent.absmax=srcent.absmax; + destent.ltime=srcent.ltime; + destent.movetype=srcent.movetype; + destent.solid=srcent.solid; + destent.origin=srcent.origin; + destent.oldorigin=srcent.oldorigin; + destent.velocity=srcent.velocity; + destent.angles=srcent.angles; + destent.avelocity=srcent.avelocity; + destent.punchangle=srcent.punchangle; + destent.classname=srcent.classname; + destent.model=srcent.model; + destent.frame=srcent.frame; + destent.skin=srcent.skin; + destent.effects=srcent.effects; + destent.mins=srcent.mins; + destent.maxs=srcent.maxs; + destent.size=srcent.size; + destent.touch=srcent.touch; + destent.use=srcent.use; + destent.think=srcent.think; + destent.blocked=srcent.blocked; + destent.nextthink=srcent.nextthink; + destent.groundentity=srcent.groundentity; + destent.health=srcent.health; + destent.frags=srcent.frags; + destent.weapon=srcent.weapon; + destent.weaponmodel=srcent.weaponmodel; + destent.weaponframe=srcent.weaponframe; + destent.weaponflags=srcent.weaponflags; + destent.weapon2=srcent.weapon2; + destent.weaponmodel2=srcent.weaponmodel2; + destent.weaponframe2=srcent.weaponframe2; + destent.weaponflags2=srcent.weaponflags2; + destent.holsterweapon0=srcent.holsterweapon0; + destent.holsterweapon1=srcent.holsterweapon1; + destent.holsterweapon2=srcent.holsterweapon2; + destent.holsterweapon3=srcent.holsterweapon3; + destent.holsterweapon4=srcent.holsterweapon4; + destent.holsterweapon5=srcent.holsterweapon5; + destent.holsterweaponmodel0=srcent.holsterweaponmodel0; + destent.holsterweaponmodel1=srcent.holsterweaponmodel1; + destent.holsterweaponmodel2=srcent.holsterweaponmodel2; + destent.holsterweaponmodel3=srcent.holsterweaponmodel3; + destent.holsterweaponmodel4=srcent.holsterweaponmodel4; + destent.holsterweaponmodel5=srcent.holsterweaponmodel5; + destent.holsterweaponflags0=srcent.holsterweaponflags0; + destent.holsterweaponflags1=srcent.holsterweaponflags1; + destent.holsterweaponflags2=srcent.holsterweaponflags2; + destent.holsterweaponflags3=srcent.holsterweaponflags3; + destent.holsterweaponflags4=srcent.holsterweaponflags4; + destent.holsterweaponflags5=srcent.holsterweaponflags5; + destent.currentammo=srcent.currentammo; + destent.currentammo2=srcent.currentammo2; + destent.ammocounter=srcent.ammocounter; + destent.ammocounter2=srcent.ammocounter2; + destent.ammo_shells=srcent.ammo_shells; + destent.ammo_nails=srcent.ammo_nails; + destent.ammo_rockets=srcent.ammo_rockets; + destent.ammo_cells=srcent.ammo_cells; + destent.items=srcent.items; + destent.takedamage=srcent.takedamage; + destent.chain=srcent.chain; + destent.deadflag=srcent.deadflag; + destent.view_ofs=srcent.view_ofs; + destent.button0=srcent.button0; + destent.button1=srcent.button1; + destent.button2=srcent.button2; + destent.impulse=srcent.impulse; + destent.fixangle=srcent.fixangle; + destent.v_angle=srcent.v_angle; + destent.idealpitch=srcent.idealpitch; + destent.netname=srcent.netname; + destent.enemy=srcent.enemy; + destent.flags=srcent.flags; + destent.colormap=srcent.colormap; + destent.team=srcent.team; + destent.max_health=srcent.max_health; + destent.teleport_time=srcent.teleport_time; + destent.armortype=srcent.armortype; + destent.armorvalue=srcent.armorvalue; + destent.waterlevel=srcent.waterlevel; + destent.watertype=srcent.watertype; + destent.ideal_yaw=srcent.ideal_yaw; + destent.yaw_speed=srcent.yaw_speed; + destent.aiment=srcent.aiment; + destent.goalentity=srcent.goalentity; + destent.spawnflags=srcent.spawnflags; + destent.target=srcent.target; + destent.targetname=srcent.targetname; + destent.dmg_take=srcent.dmg_take; + destent.dmg_save=srcent.dmg_save; + destent.dmg_inflictor=srcent.dmg_inflictor; + destent.owner=srcent.owner; + destent.movedir=srcent.movedir; + destent.message=srcent.message; + destent.sounds=srcent.sounds; + destent.noise=srcent.noise; + destent.noise1=srcent.noise1; + destent.noise2=srcent.noise2; + destent.noise3=srcent.noise3; + destent.wad=srcent.wad; + destent.map=srcent.map; + destent.worldtype=srcent.worldtype; + destent.killtarget=srcent.killtarget; + destent.light_lev=srcent.light_lev; + destent.style=srcent.style; + destent.th_stand=srcent.th_stand; + destent.th_walk=srcent.th_walk; + destent.th_run=srcent.th_run; + destent.th_missile=srcent.th_missile; + destent.th_melee=srcent.th_melee; + destent.th_pain=srcent.th_pain; + destent.th_die=srcent.th_die; + destent.th_turn=srcent.th_turn; + destent.oldenemy=srcent.oldenemy; + destent.speed=srcent.speed; + destent.lefty=srcent.lefty; + destent.search_time=srcent.search_time; + destent.attack_state=srcent.attack_state; + destent.walkframe=srcent.walkframe; + destent.attack_finished=srcent.attack_finished; + destent.pain_finished=srcent.pain_finished; + destent.invincible_finished=srcent.invincible_finished; + destent.invisible_finished=srcent.invisible_finished; + destent.super_damage_finished=srcent.super_damage_finished; + destent.radsuit_finished=srcent.radsuit_finished; + destent.invincible_time=srcent.invincible_time; + destent.invincible_sound=srcent.invincible_sound; + destent.invisible_time=srcent.invisible_time; + destent.invisible_sound=srcent.invisible_sound; + destent.super_time=srcent.super_time; + destent.super_sound=srcent.super_sound; + destent.rad_time=srcent.rad_time; + destent.fly_sound=srcent.fly_sound; + destent.axhitme=srcent.axhitme; + destent.show_hostile=srcent.show_hostile; + destent.jump_flag=srcent.jump_flag; + destent.swim_flag=srcent.swim_flag; + destent.air_finished=srcent.air_finished; + destent.bubble_count=srcent.bubble_count; + destent.deathtype=srcent.deathtype; + destent.mdl=srcent.mdl; + destent.mangle=srcent.mangle; + destent.oldorigin=srcent.oldorigin; + destent.t_length=srcent.t_length; + destent.t_width=srcent.t_width; + destent.dest=srcent.dest; + destent.dest1=srcent.dest1; + destent.dest2=srcent.dest2; + destent.wait=srcent.wait; + destent.delay=srcent.delay; + destent.trigger_field=srcent.trigger_field; + destent.noise4=srcent.noise4; + destent.pausetime=srcent.pausetime; + destent.movetarget=srcent.movetarget; + destent.aflag=srcent.aflag; + destent.dmg=srcent.dmg; + destent.cnt=srcent.cnt; + destent.think1=srcent.think1; + destent.finaldest=srcent.finaldest; + destent.finalangle=srcent.finalangle; + destent.count=srcent.count; + destent.lip=srcent.lip; + destent.state=srcent.state; + destent.pos1=srcent.pos1; + destent.pos2=srcent.pos2; + destent.height=srcent.height; + destent.waitmin=srcent.waitmin; + destent.waitmax=srcent.waitmax; + destent.distance=srcent.distance; + destent.volume=srcent.volume; + destent.gorging=srcent.gorging; + destent.stoleweapon=srcent.stoleweapon; + destent.spawnfunction=srcent.spawnfunction; + destent.spawnthink=srcent.spawnthink; + destent.spawnmodel=srcent.spawnmodel; + destent.spawnsolidtype=srcent.spawnsolidtype; + destent.spawnmins=srcent.spawnmins; + destent.spawnmaxs=srcent.spawnmaxs; + destent.spawnclassname=srcent.spawnclassname; + }; + +//========================= +// +// SUB_NormalizeAngles +// +//========================= + +vector (vector ang) SUB_NormalizeAngles = + { + while(ang_x > 360) + { + ang_x = ang_x - 360; + } + while(ang_x < 0) + { + ang_x = ang_x + 360; + } + + while(ang_y > 360) + { + ang_y = ang_y - 360; + } + while(ang_y < 0) + { + ang_y = ang_y + 360; + } + + while(ang_z > 360) + { + ang_z = ang_z - 360; + } + while(ang_z < 0) + { + ang_z = ang_z + 360; + } + + return ang; + }; diff --git a/QC/hip_train.qc b/QC/hip_train.qc new file mode 100644 index 00000000..8e2e1e6b --- /dev/null +++ b/QC/hip_train.qc @@ -0,0 +1,200 @@ +/* Train QuickC program + By Jim Dose' 9/11/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +void() HIP_train_use = +{ + if(self.think != HIP_func_train_find) + { + if(self.velocity != '0 0 0') + return; // already activated + } + HIP_train_next(); +}; + +void() HIP_train_wait = + { + if(self.wait) + { + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + if(self.wait != -1) + { + self.nextthink = self.ltime + self.wait; + self.wait = 0; + } + } + else + self.nextthink = self.ltime + 0.1; + + self.think = HIP_train_next; + }; + + +void() HIP_train_next = +{ + entity targ; + float current; + string temp; + + // Get the speed of the current path_corner. + // (we must save this off at each path change since + // we don't have a pointer to the current path_corner). + current = self.cnt; + + targ = find(world, targetname, self.target); + + // Save the speed in cnt for later use + self.cnt = targ.speed; + self.target = targ.target; + if(!self.target) + objerror ("HIP_train_next: no next target"); + + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + + self.wait = targ.wait; + if(targ.wait) + { + self.think = HIP_train_wait; + } + else + { + self.think = HIP_train_next; + } + + if(self.goalentity.event != NULLSTR) + { + // Trigger any events that should happen at the corner. + temp = self.target; + self.target = self.goalentity.event; + self.message = self.goalentity.message; + SUB_UseTargets(); + self.target = temp; + self.message = string_null; + } + + // Save the current entity + self.goalentity = targ; + + if(current == -1) + { + // Warp to the next path_corner + setorigin(self, targ.origin - self.mins); + self.nextthink = self.ltime + 0.01; + } + else + { + // check if there's a speed change + if(current>0) + self.speed = current; + + // travel to the next path change + SUB_CalcMove (targ.origin - self.mins, self.speed, self.think); + } + }; + +void() HIP_func_train_find = + +{ + entity targ; + + targ = find(world, targetname, self.target); + + // Save the current entity + self.goalentity = targ; + + // Save the speed in cnt for later use + self.cnt = targ.speed; + + self.target = targ.target; + setorigin(self, targ.origin - self.mins); + if(!self.targetname) + { // not triggered, so start immediately + self.nextthink = self.ltime + 0.1; + self.think = HIP_train_next; + } +}; + +/*QUAKED func_train2 (0 .5 .8) ? +This is a modification of the standard func_train entity. +It is functionally equivalent, except that it removes a slight delay that +would occur after each path entry, and it adds a speed variable to the +path_corner entity. + +"noise" contains the name of the sound to play when train stops. +"noise1" contains the name of the sound to play when train moves. +Both "noise" and "noise1" defaults depend upon "sounds" variable. + +In path_corner, set speed to be the new speed of the train after it reaches +the path change. If speed is -1, the train will warp directly to the next +path change after the specified wait time. + +Also in path_corner, if wait is set to -1, the train will wait until it is +retriggered before moving on to the next goal. + +Here is a reiteration of the func_train docs: + +Trains are moving platforms that players can ride. +The targets origin specifies the min point of the train at each corner. +The train spawns at the first target it is pointing at. +If the train is the target of a button or trigger, it will not begin moving until activated. +speed default 100 +dmg default 2 +sounds +1) ratchet metal + +*/ +void() func_train2 = +{ + if(!self.speed) + self.speed = 100; + if(!self.target) + objerror ("func_train without a target"); + if(!self.dmg) + self.dmg = 2; + + if(!self.noise) + { + if(self.sounds == 0) + { + self.noise = ("misc/null.wav"); + } + + if(self.sounds == 1) + { + self.noise = ("plats/train2.wav"); + } + } + if(!self.noise1) + { + if(self.sounds == 0) + { + self.noise1 = ("misc/null.wav"); + } + if(self.sounds == 1) + { + self.noise1 = ("plats/train1.wav"); + } + } + + precache_sound(self.noise); + precache_sound(self.noise1); + + self.cnt = 1; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + self.blocked = train_blocked; + self.use = HIP_train_use; + self.classname = "train2"; + + setmodel(self, self.model); + setsize(self, self.mins , self.maxs); + setorigin(self, self.origin); + +// start trains on the second frame, to make sure their targets have had +// a chance to spawn + self.nextthink = self.ltime + 0.1; + self.think = HIP_func_train_find; +}; diff --git a/QC/hip_trig.qc b/QC/hip_trig.qc new file mode 100644 index 00000000..33eefad2 --- /dev/null +++ b/QC/hip_trig.qc @@ -0,0 +1,287 @@ +/* Trigger QuickC program + By Jim Dose' 12/2/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +float USE_GOLD_KEY = 1; + +void() keytrigger_use = +{ + if(activator.classname != "player") + return; + + if(self.attack_finished > time) + return; + + self.attack_finished = time + 2; + +// FIXME: blink key on player's status bar + if(!VR_ItemUtil_EntHasItem(activator, self.vr_itemId)) + { + if(self.message != "") + { + centerprint(activator, self.message); + } + else + { + if(self.owner.vr_itemId == IID_KEY1) + { + if(world.worldtype == 2) + { + centerprint(activator, "You need the silver keycard"); + } + else if(world.worldtype == 1) + { + centerprint(activator, "You need the silver runekey"); + } + else if(world.worldtype == 0) + { + centerprint(activator, "You need the silver key"); + } + } + else + { + if(world.worldtype == 2) + { + centerprint(activator, "You need the gold keycard"); + } + else if(world.worldtype == 1) + { + centerprint(activator, "You need the gold runekey"); + } + else if(world.worldtype == 0) + { + centerprint(activator, "You need the gold key"); + } + } + } + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + return; + } + + VR_ItemUtil_EntDelItem(activator, self.vr_itemId); + + // we can't just remove(self) here, because this is a touch function + // called while C code is looping through area links... + self.touch = SUB_Null; + self.use = SUB_Null; + self.nextthink = time + 0.1; + self.think = SUB_Remove; + self.message = ""; + + sound(self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); + + SUB_UseTargets(); + }; + +void() keytrigger_touch = + { + activator = other; + keytrigger_use(); + }; + +/*QUAKED trigger_usekey (0 .5 0) ? USE_GOLD_KEY +Variable sized single use trigger that requires a key to trigger targets. Must be targeted at one or more entities. + +"message" is printed when the trigger is touched without having the right key. +*/ + +void() trigger_usekey = + { + if(world.worldtype == 0) + { + precache_sound("doors/medtry.wav"); + precache_sound("doors/meduse.wav"); + self.noise3 = "doors/medtry.wav"; + self.noise4 = "doors/meduse.wav"; + } + else if(world.worldtype == 1) + { + precache_sound("doors/runetry.wav"); + precache_sound("doors/runeuse.wav"); + self.noise3 = "doors/runetry.wav"; + self.noise4 = "doors/runeuse.wav"; + } + else if(world.worldtype == 2) + { + precache_sound("doors/basetry.wav"); + precache_sound("doors/baseuse.wav"); + self.noise3 = "doors/basetry.wav"; + self.noise4 = "doors/baseuse.wav"; + } + else + { + dprint("no worldtype set!\n"); + } + + if(self.spawnflags & USE_GOLD_KEY) + { + self.vr_itemId = IID_KEY2; + } + else + { + self.vr_itemId = IID_KEY1; + } + + self.use = keytrigger_use; + self.touch = keytrigger_touch; + + InitTrigger(); + }; + +void() remove_touch = + { + if(other.flags & self.cnt) + return; + other.touch = SUB_Null; + other.model = ""; + remove(self); +// other.nextthink = time + 0.1; +// other.think = SUB_Remove; + }; + +/*QUAKED trigger_remove(.5 .5 .5) ? ignoremonsters ignoreplayers +Variable sized trigger that removes the thing +that touches it. Does not affect monsters or +players. +*/ +void() trigger_remove = + { + self.cnt = FL_CLIENT|FL_MONSTER; + if(self.spawnflags & 1) + self.cnt = self.cnt - FL_MONSTER; + if(self.spawnflags & 2) + self.cnt = self.cnt - FL_CLIENT; + InitTrigger(); + self.touch = remove_touch; + }; +/* +============================================================================== + +trigger_setgravity + +============================================================================== +*/ + +void() trigger_gravity_touch = +{ + if(other.classname != "player") + return; + if(self.gravity == -1) + other.gravity = 1.0; + else + other.gravity = self.gravity; +}; + +/*QUAKED trigger_setgravity (.5 .5 .5) ? +set the gravity of a player +"gravity" what to set the players gravity to + - 0 (default) normal gravity + - 1 no gravity + - 2 almost no gravity + - ... + - 101 normal gravity + - 102 slightly higher gravity + - ... + - 1000 very high gravity +*/ +void() trigger_setgravity = +{ + InitTrigger(); + self.touch = trigger_gravity_touch; + if(!self.gravity) + { + self.gravity = -1; + } + else + { + self.gravity = ((self.gravity - 1) / 100); + } +}; + +void() trigger_command_use = + { + if(self.message != NULLSTR) + localcmd(self.message); + }; + +/*QUAKED trigger_command (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) + When triggered, stuffs a command into the console to allow map + designers to set server variables. + + "message" is the command to send to the console. +*/ + +void() trigger_command = + { + self.use = oncount_use; + self.think = SUB_Null; + }; + +void() trigger_decoy_touch = + { + if(other.classname != "monster_decoy") + return; + self.touch = SUB_Null; + self.nextthink = time + 0.1; + self.think = SUB_Remove; + SUB_UseTargets(); + }; + +/*QUAKED trigger_decoy_use (.5 .5 .5) ? + only the decoy player can trigger this + once triggers, all targets are used +*/ + +void() trigger_decoy_use = + { + if(deathmatch) + { + remove(self); + return; + } + InitTrigger(); + self.touch = trigger_decoy_touch; + }; + +void() trigger_waterfall_touch = + { + // only affect players + if(!(other.flags & FL_CLIENT)) + { + return; + } + + other.velocity = other.velocity + self.movedir; + other.velocity_x = other.velocity_x + self.count * (random() - 0.5); + other.velocity_y = other.velocity_y + self.count * (random() - 0.5); + }; + +/*QUAKED trigger_waterfall (.2 .5 .2) ? + Pushes the player in the direction specified by angles. + + "speed" is the strength of the push (default 50). + "count" amount of random xy movement to add to velocity (default 100). +*/ + +void() trigger_waterfall = + { + InitTrigger(); + self.touch = trigger_waterfall_touch; + + if(self.count == 0) + { + self.count = 100; + } + + if(self.speed == 0) + { + self.movedir = self.movedir * 50; + } + else + { + self.movedir = self.movedir * self.speed; + } + }; diff --git a/QC/hip_water.qc b/QC/hip_water.qc new file mode 100644 index 00000000..7913104b --- /dev/null +++ b/QC/hip_water.qc @@ -0,0 +1,53 @@ +/* Water QuickC program + By Jim Dose' 12/16/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + All rights reserved. + Do not distribute. +*/ + +void() bobbingwater_think = + { + vector ang; + + self.count = self.count + self.speed * (time - self.ltime); + if(self.count > 360) + { + self.count = self.count - 360; + } + ang_x = self.count; + ang_y = 0; + ang_z = 0; + makevectors(ang); + self.origin_z = v_forward_z * self.cnt; + setorigin(self, self.origin); + self.ltime = time; + self.nextthink = time + 0.02; + }; + +/*QUAKED func_bobbingwater (0 .5 .8) ? +Used to emulate water. To use, create a thin water brush and center it +on the water line of the body of water to bob. The amount of the bob +is the depth of the brush. + +"speed" is how long in seconds it takes the brush to do one full bob. +*/ +void() func_bobbingwater = + { + self.angles = '0 0 0'; + self.movetype = MOVETYPE_STEP; + self.solid = SOLID_NOT; + setmodel(self,self.model); + self.think = bobbingwater_think; + + self.count = 0; + self.cnt = self.size_z / 2; + if(!self.speed) + { + self.speed = 4; + } + + self.speed = 360 / self.speed; + + self.nextthink = time + 0.02; + self.ltime = time; + }; diff --git a/QC/hiparma.qc b/QC/hiparma.qc deleted file mode 100644 index d3d475a7..00000000 --- a/QC/hiparma.qc +++ /dev/null @@ -1,953 +0,0 @@ -/* -============================================================================== - -armagon - -============================================================================== -*/ - - -$cd hipwork\models\armagon -$origin 0 0 24 -$base bodybase.asc - -$skin armab - -$frame lwalk1.asc lwalk2.asc lwalk3.asc lwalk4.asc lwalk5.asc lwalk6.asc lwalk7.asc -$frame lwalk8.asc lwalk9.asc lwalk10.asc lwalk11.asc lwalk12.asc - -$frame lw0fir1.asc lw0fir2.asc lw0fir3.asc lw0fir4.asc lw0fir5.asc lw0fir6.asc -$frame lw0fir7.asc lw0fir8.asc lw0fir9.asc lw0fir10.asc lw0fir11.asc lw0fir12.asc -$frame lw0fir13.asc - -$frame lw1fir1.asc lw1fir2.asc lw1fir3.asc lw1fir4.asc lw1fir5.asc lw1fir6.asc -$frame lw1fir7.asc lw1fir8.asc lw1fir9.asc lw1fir10.asc lw1fir11.asc lw1fir12.asc -$frame lw1fir13.asc lw1fir14.asc lw1fir15.asc - -$frame lw2fir1.asc lw2fir2.asc lw2fir3.asc lw2fir4.asc lw2fir5.asc lw2fir6.asc -$frame lw2fir7.asc lw2fir8.asc lw2fir9.asc lw2fir10.asc lw2fir11.asc lw2fir12.asc - -$frame lsfire1.asc lsfire2.asc lsfire3.asc lsfire4.asc lsfire5.asc lsfire6.asc -$frame lsfire7.asc lsfire8.asc lsfire9.asc lsfire10.asc lsfire11.asc lsfire12.asc - -$frame lstand1.asc lstand2.asc lstand3.asc lstand4.asc lstand5.asc lstand6.asc -$frame lstand7.asc lstand8.asc lstand9.asc lstand10.asc lstand11.asc lstand12.asc -$frame lstand13.asc lstand14.asc lstand15.asc lstand16.asc lstand17.asc -$frame lstand18.asc lstand19.asc lstand20.asc - -$frame tranl1.asc tranl2.asc - -$frame ldie1.asc ldie2.asc ldie3.asc ldie4.asc ldie5.asc ldie6.asc -$frame ldie7.asc ldie8.asc ldie9.asc ldie10.asc ldie11.asc ldie12.asc - -float ATTN_ARMAGON = 0.5; -float SERVO_VOLUME = 0.5; - -void(float ofs, float turn) armagon_launch_missile = - { - local vector src, vec, targ; - local vector ang; - local entity missile; - local float dist; - - ang = self.angles; - ang_y = ang_y + self.fixangle; - if(turn==1) - { - ang_y = ang_y + 165; - } - else if(turn==2) - { - ang_y = ang_y - 165; - } - makevectors(ang); - src = self.origin + '0 0 66' + v_right*ofs + v_forward*84; - targ = self.enemy.origin + self.enemy.view_ofs; - if(skill!=0) - { - dist = vlen(targ-src); - targ = targ + (self.enemy.velocity * (dist/1000)); - } - vec = (targ - src); - vec = normalize(vec); - dist = vec*v_forward; - if(dist<self.worldtype) - vec=v_forward; - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_FLYMISSILE; - missile.solid = SOLID_BBOX; - missile.classname = "missile"; - -// set missile speed - missile.velocity = vec * 1000; - missile.angles = vectoangles(vec); - missile.touch = T_MissileTouch; - -// set missile duration - missile.nextthink = time + 5; - missile.think = SUB_Remove; - - setmodel (missile, "progs/missile.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, src); - }; - -void(float ofs) armagon_launch_laser = - { - local vector src, vec, targ; - local float dist; - local vector ang; - - ang = self.angles; - ang_y = ang_y + self.fixangle; - makevectors(ang); - src = self.origin + '0 0 66' + v_right*ofs + v_forward*84; - targ = self.enemy.origin + self.enemy.view_ofs; - if(skill!=0) - { - dist = vlen(targ-src); - targ = targ + (self.enemy.velocity * (dist/1000)); - } - vec = (targ - src); - vec = normalize(vec); - dist = vec*v_forward; - if(dist<self.worldtype) - vec=v_forward; - self.effects = self.effects | EF_MUZZLEFLASH; - - HIP_LaunchLaser(src, vec, 0); - }; - -void(float angdelta, float delta) armagon_turn = - { - if(fabs(angdelta)<10) - self.fixangle = delta; - else - { - if(angdelta > 5) - { - self.fixangle = self.fixangle + 9; - } - else if(angdelta < -5) - { - self.fixangle = self.fixangle - 9; - } - else - { - self.fixangle = delta; - } - } - }; -void() armagon_overleft1; -void() armagon_overright1; - -void() armagon_think = - { - local float delta; - local float angdelta; - setorigin (self.trigger_field, self.origin); - self.trigger_field.angles = self.angles; - self.trigger_field.frame = self.frame; - self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; - enemy_yaw = vectoyaw(self.enemy.origin - self.origin); - self.ideal_yaw = enemy_yaw; - delta = self.ideal_yaw - self.angles_y; - self.cnt = 0; - if(delta > 180) delta = delta - 360; - if(delta < -180) delta = delta + 360; - if(fabs(delta) > 90) - { - delta = 0; - self.cnt = 1; - } - angdelta = delta-self.fixangle; - armagon_turn(angdelta,delta); -// self.nextthink = time + 0.1; - if(self.health < 0) - return; - if(time > self.super_time) - { - local float r; - - self.super_time = time + 3; - if(random() < 0.5) - { - r = random(); - if(r < 0.25) - sound(self, CHAN_VOICE, "armagon/idle1.wav", 1, ATTN_ARMAGON); - else if(r < 0.5) - sound(self, CHAN_VOICE, "armagon/idle2.wav", 1, ATTN_ARMAGON); - else if(r < 0.75) - sound(self, CHAN_VOICE, "armagon/idle3.wav", 1, ATTN_ARMAGON); - else - sound(self, CHAN_VOICE, "armagon/idle4.wav", 1, ATTN_ARMAGON); - } - } - }; - -void() armagon_walkthink = - { - local float delta; - local float angdelta; - local entity client; - setorigin (self.trigger_field, self.origin); - self.trigger_field.angles = self.angles; - self.trigger_field.frame = self.frame; - self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; - ChangeYaw(); - delta = 0; - self.cnt = 0; - if(delta > 180) delta = delta - 360; - if(delta < -180) delta = delta + 360; - if(fabs(delta) > 90) - { - delta = 0; - self.cnt = 1; - } - angdelta = delta-self.fixangle; - armagon_turn(angdelta,delta); - if(self.health < 0) - return; - if(time > self.super_time) - { - local float r; - - self.super_time = time + 3; - if(random() < 0.5) - { - r = random(); - if(r < 0.25) - sound(self, CHAN_VOICE, "armagon/idle1.wav", 1, ATTN_ARMAGON); - else if(r < 0.5) - sound(self, CHAN_VOICE, "armagon/idle2.wav", 1, ATTN_ARMAGON); - else if(r < 0.75) - sound(self, CHAN_VOICE, "armagon/idle3.wav", 1, ATTN_ARMAGON); - else - sound(self, CHAN_VOICE, "armagon/idle4.wav", 1, ATTN_ARMAGON); - } - } - client = checkclient(); - if(!client) - return; // current check entity isn't in PVS - if(visible(client)) - { - self.enemy = client; - FoundTarget(); - } - }; - -void() armagon_overleft_think = - { - local float delta; - local float angdelta; - - ChangeYaw(); - walkmove (self.angles_y, 14); - setorigin (self.trigger_field, self.origin); - self.trigger_field.angles = self.angles; - self.trigger_field.frame = self.frame; - self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; - if(self.count == 0) - { - enemy_yaw = vectoyaw(self.enemy.origin - self.origin); - self.ideal_yaw = enemy_yaw; - delta = self.ideal_yaw - self.angles_y - 165; - if(delta > 180) delta = delta - 360; - if(delta < -180) delta = delta + 360; - angdelta = delta-self.fixangle; - } - else if(self.count == 1) - { - armagon_launch_missile(40,1); - return; - } - else - { - delta = 0; - angdelta = delta-self.fixangle; - } - armagon_turn(angdelta,delta); -// self.nextthink = time + 0.1; - }; - -void() armagon_overright_think = - { - local float delta; - local float angdelta; - - ChangeYaw(); - walkmove (self.angles_y, 14); - setorigin (self.trigger_field, self.origin); - self.trigger_field.angles = self.angles; - self.trigger_field.frame = self.frame; - self.trigger_field.angles_y = self.trigger_field.angles_y + self.fixangle; - if(self.count == 0) - { - enemy_yaw = vectoyaw(self.enemy.origin - self.origin); - self.ideal_yaw = enemy_yaw; - delta = self.ideal_yaw - self.angles_y + 165; - if(delta > 180) delta = delta - 360; - if(delta < -180) delta = delta + 360; - angdelta = delta-self.fixangle; - } - else if(self.count == 1) - { - armagon_launch_missile(-40,2); - return; - } - else - { - delta = 0; - angdelta = delta-self.fixangle; - } - armagon_turn(angdelta,delta); -// self.nextthink = time + 0.1; - }; - -void() armagon_stand_attack; - -void() armagon_stand1 =[ $lstand1.asc, armagon_stand2 ] {ai_stand();armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand2 =[ $lstand2.asc, armagon_stand3 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand3 =[ $lstand3.asc, armagon_stand4 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand4 =[ $lstand4.asc, armagon_stand5 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand5 =[ $lstand5.asc, armagon_stand6 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand6 =[ $lstand6.asc, armagon_stand7 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand7 =[ $lstand7.asc, armagon_stand8 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand8 =[ $lstand8.asc, armagon_stand9 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand9 =[ $lstand9.asc, armagon_stand10 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand10 =[ $lstand10.asc, armagon_stand11 ] {ai_stand();armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand11 =[ $lstand11.asc, armagon_stand12 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand12 =[ $lstand12.asc, armagon_stand13 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand13 =[ $lstand13.asc, armagon_stand14 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand14 =[ $lstand14.asc, armagon_stand15 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand15 =[ $lstand15.asc, armagon_stand16 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand16 =[ $lstand16.asc, armagon_stand17 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand17 =[ $lstand17.asc, armagon_stand18 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand18 =[ $lstand18.asc, armagon_stand19 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand19 =[ $lstand19.asc, armagon_stand20 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_stand20 =[ $lstand20.asc, armagon_stand1 ] {ai_stand();armagon_think();self.nextthink = time + 0.2;}; - -void() armagon_walk1 =[ $lwalk1.asc , armagon_walk2 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk2 =[ $lwalk2.asc , armagon_walk3 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk3 =[ $lwalk3.asc , armagon_walk4 ] - { - sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk4 =[ $lwalk4.asc , armagon_walk5 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk5 =[ $lwalk5.asc , armagon_walk6 ] - { - sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk6 =[ $lwalk6.asc , armagon_walk7 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk7 =[ $lwalk7.asc , armagon_walk8 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk8 =[ $lwalk8.asc , armagon_walk9 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk9 =[ $lwalk9.asc , armagon_walk10 ] - { - sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk10 =[ $lwalk10.asc , armagon_walk11 ] - { - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk11 =[ $lwalk11.asc , armagon_walk12 ] - { - sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); - movetogoal(14); - armagon_walkthink(); - }; -void() armagon_walk12 =[ $lwalk12.asc , armagon_walk1 ] - { - movetogoal(14); - armagon_walkthink(); - }; - -void() armagon_run1 =[ $lwalk1.asc , armagon_run2 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run2 =[ $lwalk2.asc , armagon_run3 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run3 =[ $lwalk3.asc , armagon_run4 ] - { - sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run4 =[ $lwalk4.asc , armagon_run5 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run5 =[ $lwalk5.asc , armagon_run6 ] - { - sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run6 =[ $lwalk6.asc , armagon_run7 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run7 =[ $lwalk7.asc , armagon_run8 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run8 =[ $lwalk8.asc , armagon_run9 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run9 =[ $lwalk9.asc , armagon_run10 ] - { - sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON); - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run10 =[ $lwalk10.asc , armagon_run11 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run11 =[ $lwalk11.asc , armagon_run12 ] - { - sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON); - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - }; -void() armagon_run12 =[ $lwalk12.asc , armagon_run1 ] - { - ChangeYaw(); - RUN_STRAIGHT = 1; - ai_run(14); - armagon_think(); - if((self.cnt == 1) && (time > self.attack_finished)) - { - local float delta; - delta = self.ideal_yaw - self.angles_y; - if(delta > 180) delta = delta - 360; - if(delta < -180) delta = delta + 360; - if(delta>0) - self.think = armagon_overleft1; - else - self.think = armagon_overright1; - return; - } - if(self.lefty == 1) - { - self.lefty = 0; - self.think = self.th_missile; - } - }; - -void() armagon_watk1 =[ $lw0fir1.asc, armagon_watk2 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk2 =[ $lw0fir2.asc, armagon_watk3 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk3 =[ $lw0fir3.asc, armagon_watk4 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk4 =[ $lw0fir4.asc, armagon_watk5 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk5 =[ $lw0fir5.asc, armagon_watk6 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk6 =[ $lw0fir6.asc, armagon_watk7 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();armagon_launch_missile(40,0);}; -void() armagon_watk7 =[ $lw0fir7.asc, armagon_watk8 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk8 =[ $lw0fir8.asc, armagon_watk9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk9 =[ $lw0fir9.asc, armagon_watk10 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk10 =[ $lw0fir10.asc, armagon_watk11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk11 =[ $lw0fir11.asc, armagon_watk13 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();armagon_launch_missile(-40,0);}; -//void() armagon_watk12 =[ $lw0fir12.asc, armagon_watk13 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_watk13 =[ $lw0fir12.asc, armagon_run1 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();SUB_AttackFinished (1.0);}; - -void() armagon_wlaseratk1 =[ $lw0fir1.asc, armagon_wlaseratk2 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk2 =[ $lw0fir2.asc, armagon_wlaseratk3 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk3 =[ $lw0fir3.asc, armagon_wlaseratk4 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk4 =[ $lw0fir4.asc, armagon_wlaseratk5 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk5 =[ $lw0fir5.asc, armagon_wlaseratk6 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk6 =[ $lw0fir6.asc, armagon_wlaseratk7 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();armagon_launch_laser(40);}; -void() armagon_wlaseratk7 =[ $lw0fir7.asc, armagon_wlaseratk8 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk8 =[ $lw0fir8.asc, armagon_wlaseratk9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk9 =[ $lw0fir9.asc, armagon_wlaseratk10 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk10 =[ $lw0fir10.asc, armagon_wlaseratk11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk11 =[ $lw0fir11.asc, armagon_wlaseratk13 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();armagon_launch_laser(-40);}; -//void() armagon_wlaseratk12 =[ $lw0fir12.asc, armagon_wlaseratk13 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();}; -void() armagon_wlaseratk13 =[ $lw0fir12.asc, armagon_run1 ] {ChangeYaw();walkmove (self.angles_y, 14);armagon_think();SUB_AttackFinished (1.0);}; - -void() armagon_overleft1 =[ $lw1fir1.asc, armagon_overleft2 ] {self.count=0;armagon_overleft_think();}; -void() armagon_overleft2 =[ $lw1fir2.asc, armagon_overleft3 ] {armagon_overleft_think();}; -void() armagon_overleft3 =[ $lw1fir3.asc, armagon_overleft4 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overleft_think();}; -void() armagon_overleft4 =[ $lw1fir4.asc, armagon_overleft5 ] {armagon_overleft_think();}; -void() armagon_overleft5 =[ $lw1fir5.asc, armagon_overleft6 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_overleft_think();}; -void() armagon_overleft6 =[ $lw1fir6.asc, armagon_overleft7 ] {armagon_overleft_think();}; -void() armagon_overleft7 =[ $lw1fir7.asc, armagon_overleft8 ] {armagon_overleft_think();}; -void() armagon_overleft8 =[ $lw1fir8.asc, armagon_overleft9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overleft_think();}; -void() armagon_overleft9 =[ $lw1fir9.asc, armagon_overleft10 ] {armagon_overleft_think();}; -void() armagon_overleft10 =[ $lw1fir10.asc, armagon_overleft11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_overleft_think();}; -void() armagon_overleft11 =[ $lw1fir11.asc, armagon_overleft12 ] {self.count=1;armagon_overleft_think();}; -void() armagon_overleft12 =[ $lw1fir12.asc, armagon_overleft13 ] {self.count=2;armagon_overleft_think();}; -void() armagon_overleft13 =[ $lw1fir13.asc, armagon_overleft14 ] {armagon_overleft_think();}; -void() armagon_overleft14 =[ $lw1fir14.asc, armagon_overleft15 ] {armagon_overleft_think();}; -void() armagon_overleft15 =[ $lw1fir15.asc, armagon_run1 ] {armagon_overleft_think();SUB_AttackFinished (1.0);}; - -void() armagon_overright1 =[ $lw2fir1.asc, armagon_overright2 ] {self.count=0;armagon_overright_think();}; -void() armagon_overright2 =[ $lw2fir2.asc, armagon_overright3 ] {armagon_overright_think();}; -void() armagon_overright3 =[ $lw2fir3.asc, armagon_overright4 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overright_think();}; -void() armagon_overright4 =[ $lw2fir4.asc, armagon_overright5 ] {armagon_overright_think();}; -void() armagon_overright5 =[ $lw2fir5.asc, armagon_overright6 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);self.count=1;armagon_overright_think();}; -void() armagon_overright6 =[ $lw2fir6.asc, armagon_overright7 ] {self.count=2;armagon_overright_think();}; -void() armagon_overright7 =[ $lw2fir7.asc, armagon_overright8 ] {armagon_overright_think();}; -void() armagon_overright8 =[ $lw2fir8.asc, armagon_overright9 ] {sound(self, 7, "armagon/servo.wav", SERVO_VOLUME, ATTN_ARMAGON);armagon_overright_think();}; -void() armagon_overright9 =[ $lw2fir9.asc, armagon_overright10 ] {armagon_overright_think();}; -void() armagon_overright10 =[ $lw2fir10.asc, armagon_overright11 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_overright_think();}; -void() armagon_overright11 =[ $lw2fir11.asc, armagon_overright12 ] {armagon_overright_think();}; -void() armagon_overright12 =[ $lw2fir12.asc, armagon_run1 ] {armagon_overright_think();SUB_AttackFinished (1.0);}; - -void() armagon_plant1 =[ $lstand1.asc, armagon_plant1 ] {armagon_stand_attack();armagon_think();}; - -void() armagon_stop1 =[ $tranl1.asc, armagon_stop2 ] {armagon_think();}; -void() armagon_stop2 =[ $tranl2.asc, armagon_plant1 ] {sound(self, 6, "armagon/footfall.wav",1,ATTN_ARMAGON);armagon_think();}; - - - -void() armagon_satk1 =[ $lsfire1.asc, armagon_satk2 ] {armagon_think();}; -void() armagon_satk2 =[ $lsfire2.asc, armagon_satk3 ] {armagon_think();}; -void() armagon_satk3 =[ $lsfire3.asc, armagon_satk4 ] {armagon_think();}; -void() armagon_satk4 =[ $lsfire4.asc, armagon_satk5 ] {armagon_think();}; -void() armagon_satk5 =[ $lsfire5.asc, armagon_satk6 ] {armagon_think();}; -void() armagon_satk6 =[ $lsfire6.asc, armagon_satk7 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_think();}; -void() armagon_satk7 =[ $lsfire7.asc, armagon_satk8 ] {armagon_think();}; -void() armagon_satk8 =[ $lsfire8.asc, armagon_satk9 ] {armagon_think();}; -void() armagon_satk9 =[ $lsfire9.asc, armagon_satk10 ] {armagon_think();armagon_launch_missile(40,0);armagon_launch_missile(-40,0);}; -void() armagon_satk10 =[ $lsfire10.asc, armagon_satk11 ] {armagon_think();}; -void() armagon_satk11 =[ $lsfire9.asc, armagon_satk12 ] {armagon_think();armagon_launch_missile(40,0);armagon_launch_missile(-40,0);}; -void() armagon_satk12 =[ $lsfire10.asc, armagon_satk13 ] {armagon_think();}; -void() armagon_satk13 =[ $lsfire9.asc, armagon_satk14 ] {armagon_think();armagon_launch_missile(40,0);armagon_launch_missile(-40,0);}; -void() armagon_satk14 =[ $lsfire10.asc, armagon_satk15 ] {armagon_think();}; -void() armagon_satk15 =[ $lsfire11.asc, armagon_satk16 ] {armagon_think();}; -void() armagon_satk16 =[ $lsfire12.asc, armagon_plant1 ] {armagon_think();SUB_AttackFinished (0.3);}; - -void() armagon_slaser1 =[ $lsfire1.asc, armagon_slaser2 ] {armagon_think();}; -void() armagon_slaser2 =[ $lsfire2.asc, armagon_slaser3 ] {armagon_think();}; -void() armagon_slaser3 =[ $lsfire3.asc, armagon_slaser4 ] {armagon_think();}; -void() armagon_slaser4 =[ $lsfire4.asc, armagon_slaser5 ] {armagon_think();}; -void() armagon_slaser5 =[ $lsfire5.asc, armagon_slaser6 ] {armagon_think();}; -void() armagon_slaser6 =[ $lsfire6.asc, armagon_slaser7 ] {sound(self, 6, "armagon/footfall.wav", 1, ATTN_ARMAGON);armagon_think();}; -void() armagon_slaser7 =[ $lsfire7.asc, armagon_slaser8 ] {armagon_think();}; -void() armagon_slaser8 =[ $lsfire8.asc, armagon_slaser9 ] {armagon_think();}; -void() armagon_slaser9 =[ $lsfire9.asc, armagon_slaser10 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; -void() armagon_slaser10 =[ $lsfire10.asc, armagon_slaser11 ] {armagon_think();}; -void() armagon_slaser11 =[ $lsfire9.asc, armagon_slaser12 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; -void() armagon_slaser12 =[ $lsfire10.asc, armagon_slaser13 ] {armagon_think();}; -void() armagon_slaser13 =[ $lsfire9.asc, armagon_slaser14 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; -void() armagon_slaser14 =[ $lsfire10.asc, armagon_slaser15 ] {armagon_think();}; -void() armagon_slaser15 =[ $lsfire9.asc, armagon_slaser16 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; -void() armagon_slaser16 =[ $lsfire10.asc, armagon_slaser17 ] {armagon_think();}; -void() armagon_slaser17 =[ $lsfire9.asc, armagon_slaser18 ] {armagon_think();armagon_launch_laser(40);armagon_launch_laser(-40);}; -void() armagon_slaser18 =[ $lsfire10.asc, armagon_slaser19 ] {armagon_think();}; -void() armagon_slaser19 =[ $lsfire11.asc, armagon_slaser20 ] {armagon_think();}; -void() armagon_slaser20 =[ $lsfire12.asc, armagon_plant1 ] {armagon_think();SUB_AttackFinished (0.3);}; - -void() armagon_body_explode1; - -void() armagon_die1 =[ $tranl1.asc, armagon_die2 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die2 =[ $tranl2.asc, armagon_die3 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die3 =[ $ldie1.asc, armagon_die4 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die4 =[ $ldie2.asc, armagon_die5 ] - { - armagon_think(); - multi_explosion( self.origin + '0 0 48', 48, 10, 6, 0.3, 0.3); - sound(self, CHAN_AUTO, "armagon/death.wav", 1, ATTN_NONE); - self.nextthink = time + 0.2; - }; -void() armagon_die5 =[ $ldie3.asc, armagon_die6 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die6 =[ $ldie4.asc, armagon_die7 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die7 =[ $ldie5.asc, armagon_die8 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die8 =[ $ldie6.asc, armagon_die9 ] - { - armagon_think(); - self.nextthink = time + 2; - }; -void() armagon_die9 =[ $ldie7.asc, armagon_die10 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die10 =[ $ldie8.asc, armagon_die11 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die11 =[ $ldie9.asc, armagon_die12 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die12 =[ $ldie10.asc, armagon_die13 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die13 =[ $ldie11.asc, armagon_die14 ] {armagon_think();self.nextthink = time + 0.2;}; -void() armagon_die14 =[ $ldie12.asc, armagon_die14 ] - { - local entity body; - - armagon_think(); - multi_explosion( self.origin + '0 0 80', 20, 10, 3, 0.1, 0.5); - // legs - self.nextthink = -1; - self.movetype = MOVETYPE_NONE; - self.takedamage = DAMAGE_NO; - self.solid = SOLID_NOT; - setsize (self, '-32 -32 -24', '32 32 32' ); - self.flags = 0; - self.gorging = TRUE; - self.wait = time + 5; - - //body - body = self.trigger_field; - body.nextthink = -1; - self.movetype = MOVETYPE_NONE; - body.takedamage = DAMAGE_NO; - body.solid = SOLID_NOT; -// setsize (body, '-32 -32 30', '32 32 64' ); - body.think = armagon_body_explode1; - body.nextthink = time + 0.1; - body.gorging = TRUE; - }; - -void() armagon_body_explode2 = - { - sound(self , CHAN_AUTO, "misc/longexpl.wav", 1, ATTN_ARMAGON); - self.think = armagon_body_explode2; - ThrowGib ("progs/gib1.mdl", -200); - ThrowGib ("progs/gib2.mdl", -200); - ThrowGib ("progs/gib3.mdl", -200); - ThrowGib ("progs/gib1.mdl", -200); - ThrowGib ("progs/gib2.mdl", -200); - ThrowGib ("progs/gib3.mdl", -200); - ThrowGib ("progs/gib1.mdl", -200); - ThrowGib ("progs/gib2.mdl", -200); - ThrowGib ("progs/gib3.mdl", -200); - self.movetype = MOVETYPE_NONE; - setmodel (self, "progs/s_explod.spr"); - self.solid = SOLID_NOT; - self.nextthink = time + 0.1; - s_explode1(); - }; - -void() armagon_body_explode1 = - { - - self.think = armagon_body_explode1; - self.nextthink = time + 0.1; - if(self.cnt == 0) - { - self.count = 0; - } - if(self.cnt < 25) - { - if(self.cnt > self.count) - { - ThrowGib ("progs/gib1.mdl", -100); - ThrowGib ("progs/gib2.mdl", -100); - ThrowGib ("progs/gib3.mdl", -100); - self.count = self.cnt + 1; - } - self.cnt = self.cnt + 1; - } - else - { - self.cnt = 0; - self.think = armagon_body_explode2; - } - }; - -void(entity attacker, float damage) armagon_pain = - { - if(self.health <= 0) - return; // allready dying, don't go into pain frame - - if(damage < 25) - return; - if(self.pain_finished > time) - return; - self.pain_finished = time + 2; - - sound(self, CHAN_VOICE, "armagon/pain.wav", 1, ATTN_NORM); - }; - - - -void() armagon_missile_attack = - { - if(random()<0.5) - armagon_watk1(); - else - armagon_wlaseratk1(); -// self.nextthink = time + 0.1; - }; - -void() armagon_repulse_attack = - { - armagon_think(); - if(self.state == 0) - { - SUB_AttackFinished (0.5); - sound(self, CHAN_BODY, "armagon/repel.wav", 1, ATTN_NORM); - self.state = 1; - return; - } - else if(self.state == 1) - { - local entity head; - local vector dir; - - // look in our immediate vicinity - head = findradius(self.origin, 300); - while(head) - { - if(!(head.flags & FL_NOTARGET) && (head.flags & FL_CLIENT)) - { - if(visible(head) && (head.health > 0)) - { - dir = head.origin - (self.origin - '0 0 24'); - dir = normalize(dir); - head.velocity = head.velocity + dir*1500; - } - } - head = head.chain; - } - T_RadiusDamage (self, self, 60, self); - self.state = 0; - SUB_AttackFinished (0.1); - } -// self.nextthink = time + 0.1; - }; - -void() armagon_stand_attack = - { - local vector spot1, spot2; - -// see if any entities are in the way of the shot - spot1 = self.origin + self.view_ofs; - spot2 = self.enemy.origin + self.enemy.view_ofs; - - traceline(spot1, spot2, FALSE, self); - - if(trace_ent != self.enemy) - { - armagon_run1(); - return; - } - - if(trace_inopen && trace_inwater) - { - armagon_run1(); - return; - } - - if(time < self.attack_finished) - { - return; - } - - if((vlen(spot2-spot1) < 200) && (self.enemy.classname == "player")) - { - armagon_repulse_attack(); - return; - } - - self.state = 0; - - if(vlen(spot2-spot1) > 450) - { - armagon_run1(); - return; - } - - if(random()<0.5) - armagon_satk1(); - else - armagon_slaser1(); - - if(self.cnt == 1) - { - armagon_run1(); - return; - } - }; - - -float() ArmagonCheckAttack = - { - local vector spot1, spot2; - local entity targ; - local float ang; - local float delta; - local float dist; - - self.lefty = 0; - - targ = self.enemy; - -// see if any entities are in the way of the shot - spot1 = self.origin + self.view_ofs; - spot2 = targ.origin + targ.view_ofs; - - traceline(spot1, spot2, FALSE, self); - - if((trace_ent != targ) && (!self.charmed)) - return FALSE; // don't have a clear shot - - if(trace_inopen && trace_inwater) - return FALSE; // sight line crossed contents - - if(time < self.attack_finished) - return FALSE; - - ang = self.angles_y + self.fixangle; - delta = self.ideal_yaw - ang; - dist = vlen(spot2-spot1); - if((fabs(delta) > 10 && (dist > 200)) || (self.enemy.classname != "player")) - return FALSE; - if(dist < 400) - { // melee attack - self.th_melee(); - return TRUE; - } -// missile attack - self.lefty = 1; -// self.th_missile(); -// SUB_AttackFinished (1.5*random()); - return FALSE; - }; - - -/*QUAKED monster_armagon (1 0 0) (-32 -32 -24) (32 32 64) Ambush -*/ -void() monster_armagon -{ - local entity body; - local float sk; - if(deathmatch) - { - remove(self); - return; - } - - self.lefty = 0; - - sk = cvar("skill"); - - precache_model ("progs/armabody.mdl"); - precache_model ("progs/armalegs.mdl"); - - precache_sound("armagon/footfall.wav"); - precache_sound("armagon/servo.wav"); -// precache_sound("armagon/footfall2.wav"); - precache_sound("armagon/death.wav"); -// precache_sound("armagon/death2.wav"); - precache_sound("armagon/pain.wav"); - precache_sound("armagon/repel.wav"); -// precache_sound("armagon/idle.wav"); - precache_sound("armagon/sight.wav"); - precache_sound("armagon/idle1.wav"); - precache_sound("armagon/idle2.wav"); - precache_sound("armagon/idle3.wav"); - precache_sound("armagon/idle4.wav"); - - body = spawn(); - body.origin = self.origin; - body.origin = body.origin - '0 0 64'; -// SUB_CopyEntity(self,body); - - self.solid = SOLID_SLIDEBOX; - self.fixangle = 0; - self.movetype = MOVETYPE_STEP; - body.solid = SOLID_NOT; - body.movetype = MOVETYPE_STEP; - self.trigger_field = body; - body.trigger_field = self; - - setmodel (body, "progs/armabody.mdl"); - setmodel (self, "progs/armalegs.mdl"); - - setsize (self, '-48 -48 -24', '48 48 84' ); - setorigin (self, self.origin); - setorigin (body, body.origin); - if(sk==0) - { - self.yaw_speed = 5; - self.health = 2000; - self.worldtype = 0.9; - } - else if(sk==1) - { - self.yaw_speed = 9; - self.health = 2500; - self.worldtype = 0.85; - } - else - { - self.yaw_speed = 12; - self.health = 3500; - self.worldtype = 0.75; - } - self.state = 0; - self.super_time = 0; - self.endtime = 0; - - self.th_stand = armagon_stand1; - self.th_walk = armagon_walk1; - self.th_run = armagon_run1; - self.th_die = armagon_die1; - self.th_missile = armagon_missile_attack; - self.th_melee = armagon_stop1; - self.th_pain = armagon_pain; - walkmonster_start(); -}; diff --git a/QC/hipclock.qc b/QC/hipclock.qc deleted file mode 100644 index 03da71ab..00000000 --- a/QC/hipclock.qc +++ /dev/null @@ -1,87 +0,0 @@ -/* Clock QuickC program - By Jim Dose' 11/25/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -void() clock_setpos = - { - local float pos; - local float ang; - local float seconds; - local string temp; - - // How much time has elapsed. - seconds = time + self.cnt; - - // divide by time it takes for one revolution - pos = seconds / self.count; - - // chop off non-fractional component - pos = pos - floor( pos ); - - ang = 360 * pos; - if( self.event ) - { - if( self.ltime > ang ) - { - // past twelve - temp = self.target; - self.target = self.event; - SUB_UseTargets(); - self.target = temp; - } - } - - self.angles_x = ang * self.movedir_x; - self.angles_y = ang * self.movedir_y; - self.angles_z = ang * self.movedir_z; - RotateTargetsFinal(); - - self.ltime = ang; - }; - -void() clock_think = - { - clock_setpos(); - self.nextthink = time + 1; - }; - -void() clock_firstthink = - { - LinkRotateTargets(); - self.think = clock_think; - clock_think(); - }; - -/*QUAKED func_clock (0 0 0.5) (0 0 0) (32 32 32) -Creates one hand of a "clock". - -Set the angle to be the direction the clock is facing. - -"event" is the targetname of the entities to trigger when hand strikes 12. -"cnt" is the time to start at. -"count" is the # of seconds it takes to make a full revolution (seconds is 60, minutes 3600, hours 43200). default is 60. -*/ - -void() func_clock = - { - local vector temp; - - self.classname = "clock"; - self.think = clock_firstthink; - self.nextthink = time + 0.1; - self.ltime = time; - SetMovedir(); - temp = self.movedir; - self.movedir_x = 0 - temp_y; - self.movedir_y = 0 - temp_z; - self.movedir_z = 0 - temp_x; - - if( !self.count ) - { - self.count = 60; - } - self.cnt = self.cnt * ( self.count / 12 ); - }; diff --git a/QC/hipcount.qc b/QC/hipcount.qc deleted file mode 100644 index cff8fcde..00000000 --- a/QC/hipcount.qc +++ /dev/null @@ -1,191 +0,0 @@ -/* Counter QuickC program - By Jim Dose' 9/13/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -float COUNTER_TOGGLE = 1; -float COUNTER_LOOP = 2; -float COUNTER_STEP = 4; -float COUNTER_RESET = 8; -float COUNTER_RANDOM = 16; -float COUNTER_FINISHCOUNT = 32; -float COUNTER_START_ON = 64; - -void() counter_on_use; -void() counter_off_use; - -void() counter_think = - { - self.cnt = self.cnt + 1; - if( self.spawnflags & COUNTER_RANDOM ) - { - self.state = random() * self.count; - self.state = floor( self.state ) + 1; - } - else - { - self.state = self.cnt; - } - - activator = other; - SUB_UseTargets(); - self.nextthink = time + self.wait; - - if( self.spawnflags & COUNTER_STEP ) - { - counter_on_use(); - } - - if( self.cnt >= self.count ) - { - self.cnt = 0; - if( ( self.aflag ) || !( self.spawnflags & COUNTER_LOOP ) ) - { - if(self.spawnflags & COUNTER_TOGGLE) - { - counter_on_use(); - } - else - { - remove (self); - } - } - } - }; - -void() counter_on_use = - { - if( ( self.cnt != 0 ) && ( self.spawnflags & COUNTER_FINISHCOUNT ) ) - { - self.aflag = TRUE; - return; - } - - self.use = counter_off_use; - self.think = SUB_Null; - self.aflag = FALSE; - }; - -void() counter_off_use = - { - self.aflag = FALSE; - if(self.spawnflags & COUNTER_TOGGLE) - { - self.use = counter_on_use; - } - else - { - self.use = SUB_Null; - } - - if( self.spawnflags & COUNTER_RESET ) - { - self.cnt = 0; - self.state = 0; - } - self.think = counter_think; - if(self.delay) - { - self.nextthink = time + self.delay; - } - else - { - counter_think(); - } - }; - -float( entity counter ) counter_GetCount = -{ - if( counter.classname == "counter" ) - { - return counter.state; - } - - return 0; -}; - -/*QUAKED func_counter (0 0 0.5) (0 0 0) (32 32 32) TOGGLE LOOP STEP RESET RANDOM FINISHCOUNT START_ON -TOGGLE causes the counter to switch between an on and off state -each time the counter is triggered. - -LOOP causes the counter to repeat infinitly. The count resets to zero -after reaching the value in "count". - -STEP causes the counter to only increment when triggered. Effectively, -this turns the counter into a relay with counting abilities. - -RESET causes the counter to reset to 0 when restarted. - -RANDOM causes the counter to generate random values in the range 1 to "count" -at the specified interval. - -FINISHCOUNT causes the counter to continue counting until it reaches "count" -before shutting down even after being set to an off state. - -START_ON causes the counter to be on when the level starts. - -"count" specifies how many times to repeat the event. If LOOP is set, -it specifies how high to count before reseting to zero. Default is 10. - -"wait" the length of time between each trigger event. Default is 1 second. - -"delay" how much time to wait before firing after being switched on. -*/ - -void() func_counter = - { - if( !self.wait ) - { - self.wait = 1; - } - - self.count = floor( self.count ); - if( self.count <= 0 ) - { - self.count = 10; - } - self.cnt = 0; - self.state = 0; - - self.classname = "counter"; - self.use = counter_off_use; - self.think = SUB_Null; - if( self.spawnflags & COUNTER_START_ON ) - { - self.think = counter_off_use; - self.nextthink = time + 0.1; - } - }; - -void() oncount_use = - { - if( counter_GetCount( other ) == self.count ) - { - activator = other; - SUB_UseTargets(); - } - }; - -/*QUAKED func_oncount (0 0 0.5) (0 0 0) (16 16 16) -Must be used as the target for func_counter. When the counter -reaches the value set by count, func_oncount triggers its targets. - -"count" specifies the value to trigger on. Default is 1. - -"delay" how much time to wait before firing after being triggered. -*/ - -void() func_oncount = - { - self.count = floor( self.count ); - if( self.count <= 0 ) - { - self.count = 1; - } - - self.classname = "oncount"; - self.use = oncount_use; - self.think = SUB_Null; - }; diff --git a/QC/hipdecoy.qc b/QC/hipdecoy.qc deleted file mode 100644 index fc9a162a..00000000 --- a/QC/hipdecoy.qc +++ /dev/null @@ -1,173 +0,0 @@ -/* -============================================================================== - -PLAYER decoy - -============================================================================== -*/ - -$cd id1/models/player_4 -$origin 0 -6 24 -$base base -$skin skin - -// -// running -// -$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 - -$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 - -// -// standing -// -$frame stand1 stand2 stand3 stand4 stand5 - -$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 -$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 - - -void() decoy_stand1 =[ $axstnd1, decoy_stand1 ] - { - ChangeYaw(); - if(self.walkframe >= 5) - self.walkframe = 0; - self.frame = $stand1 + self.walkframe; - self.walkframe = self.walkframe + 1; - if(time > self.pausetime) - self.th_walk(); - }; - -void(entity attacker, float damage) decoy_stand1_pain = -{ - decoy_stand1(); -} - -void() decoy_walk1 =[ $rockrun1, decoy_walk1 ] - { -// local vector a; - movetogoal (12); -// a = '0 0 0'; -// a_y = self.ideal_yaw; -// makevectors(a); -// self.velocity = 1*v_forward; - self.weaponframe=0; - if(self.walkframe == 6) - self.walkframe = 0; - if(self.walkframe == 2 || self.walkframe == 5) - { - local float r; - r = random(); - if(r < 0.14) - sound(self, CHAN_VOICE, "misc/foot1.wav", 0.5, ATTN_NORM); - else if(r < 0.29) - sound(self, CHAN_VOICE, "misc/foot2.wav", 0.5, ATTN_NORM); - else if(r < 0.43) - sound(self, CHAN_VOICE, "misc/foot3.wav", 0.5, ATTN_NORM); - else if(r < 0.58) - sound(self, CHAN_VOICE, "misc/foot4.wav", 0.5, ATTN_NORM); - else if(r < 0.72) - sound(self, CHAN_VOICE, "misc/foot5.wav", 0.5, ATTN_NORM); - else if(r < 0.86) - sound(self, CHAN_VOICE, "misc/foot6.wav", 0.5, ATTN_NORM); - else - sound(self, CHAN_VOICE, "misc/foot7.wav", 0.5, ATTN_NORM); - } - self.frame = self.frame + self.walkframe; - self.walkframe = self.walkframe + 1; - }; - -void(entity decoy) setup_decoy = -{ - local entity pl; - - decoy.classname = "monster_decoy"; - setmodel (decoy, "progs/player.mdl"); - setsize (decoy, VEC_HULL_MIN, VEC_HULL_MAX); - decoy.view_ofs = '0 0 22'; - - decoy.solid = SOLID_SLIDEBOX; - decoy.movetype = MOVETYPE_STEP; - - decoy.health = 3000000; - - decoy.th_stand = decoy_stand1; - decoy.th_walk = decoy_walk1; - decoy.th_run = decoy_walk1; - decoy.th_missile = decoy_stand1; - decoy.th_pain = decoy_stand1_pain; - decoy.th_die = decoy_stand1; - - pl = find (world, classname, "player"); - decoy.colormap = pl.colormap; -}; - -/*QUAKED monster_decoy (1 0 0) (-16 -16 -24) (16 16 40) -*/ -void() monster_decoy = -{ - if(deathmatch) - { - remove(self); - return; - } - setup_decoy(self); - - walkmonster_start(); - total_monsters = total_monsters - 1; -}; - -void(string targ, vector orig) become_decoy = -{ - local entity decoy; - local entity temp; - - decoy = hipdecoy = spawn(); - - temp = self; - self = decoy; - - setup_decoy(decoy); - - setorigin(decoy, orig); - - decoy.origin = orig; - - decoy.target = targ; - - decoy.takedamage = DAMAGE_AIM; - - decoy.ideal_yaw = decoy.angles * '0 1 0'; - if(!decoy.yaw_speed) - decoy.yaw_speed = 20; - decoy.use = monster_use; - - decoy.flags = decoy.flags | FL_MONSTER; - - if(decoy.target) - { - decoy.goalentity = decoy.movetarget = find(world, targetname, decoy.target); - decoy.ideal_yaw = vectoyaw(decoy.goalentity.origin - decoy.origin); - if(!decoy.movetarget) - { - dprint ("Monster can't find target at "); - dprint (vtos(decoy.origin)); - dprint ("\n"); - } -// this used to be an objerror - if(decoy.movetarget.classname == "path_corner") - decoy.th_walk(); - else - decoy.pausetime = 99999999; - decoy.th_stand(); - } - else - { - decoy.pausetime = 99999999; - decoy.th_stand(); - } - -// spread think times so they don't all happen at same time - decoy.nextthink = decoy.nextthink + random()*0.5; - self = temp; -}; diff --git a/QC/hipdefs.qc b/QC/hipdefs.qc deleted file mode 100644 index 381e7e9e..00000000 --- a/QC/hipdefs.qc +++ /dev/null @@ -1,120 +0,0 @@ -/* Level pack definitons - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -entity nullentity; -entity bulletholes; -entity lastbullet; -float numbulletholes; -float lastbulletholeroll; - -//added update stat message -float SVC_UPDATESTAT = 3; -float SVC_CUTSCENE = 34; -//added total monster message -float STAT_TOTALMONSTERS = 12; -float STAT_TOTALSECRETS = 11; -.void() th_turn; -float AS_DODGING = 5; -float CHARMED_RADIUS = 1500; -float MAX_CHARMER_DISTANCE = 200; -float MIN_CHARMER_DISTANCE = 150; -float TOOCLOSE_CHARMER_DISTANCE = 120; -float visible_distance; -entity damage_inflictor; -float footsteps; - - -//MED 11/09/96 added new spawnflags -float SPAWNFLAG_SUPERSPIKE = 1; -float SPAWNFLAG_LASER = 2; -float SPAWNFLAG_LAVABALL = 4; -float SPAWNFLAG_ROCKET = 8; -float SPAWNFLAG_SILENT = 16; - -// Hipnotic Constants -float MIN_ANGLE_DELTA = 10; - -.float wetsuit_finished; -.float wetsuit_time; -.float empathy_finished; -.float empathy_time; -.float empathy_sound; -.float color; - -// -// Hipnotic entries -// -// have to use a new items flag because we ran out of bits in the original -.float hipnotic_items; -// gremlin stuff -.float gorging; -.float stoleweapon; -.entity lastvictim; -// spawn variables -.void() spawnfunction; -.string spawnclassname; -.float spawnsolidtype; -.string spawnmodel; -.void() spawnthink; -.entity spawnmaster; -.vector spawnmins; -.vector spawnmaxs; -.float spawnsilent; -.float spawnmulti; -// horn of conjuring -.float charmed; -.entity charmer; -.float huntingcharmer; -float horn_active; -entity horn_charmer; -// laser cannon -.vector old_velocity; -//misc -.float duration; -// used for linked list of entities -.entity next_ent; -// Mjolnir -.float struck_by_mjolnir; -// teleport invulnerability -.float last_teleport_time; - -// Rotation -.vector neworigin; -.vector rotate; -.float endtime; -.float rotate_type; -.string path; -.string group; -.string event; - -// Miscellaneous -.float gravity; - -//MED 01/05/97 added discharge variable -float discharged; -//MED 01/05/97 added hipnotic decoy -entity hipdecoy; -// -// Hipnotic's Prototypes -// -void() StopEarthQuake; -void( float value ) EarthQuakeTime; -void() earthquake_postthink; -void() earthquake_prethink; -float( entity counter ) counter_GetCount; -vector ( vector ang ) SUB_NormalizeAngles; -void (entity srcent, entity destent) SUB_CopyEntity; -//multi explosion -void( vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion; -void(string targ, vector orig) become_decoy; - - -//void(vector origin, vector dir, float color, float count, float lifespan) particlestream = #79; - -void() RotateTargets; -void() RotateTargetsFinal; -void() SetTargetOrigin; -void() LinkRotateTargets; diff --git a/QC/hipgrem.qc b/QC/hipgrem.qc deleted file mode 100644 index 3f85824b..00000000 --- a/QC/hipgrem.qc +++ /dev/null @@ -1,2024 +0,0 @@ -/* -============================================================================== - -gremlin - -============================================================================== -*/ -$cd hipwork\models\grem -$origin 0 0 23 -$scale 2 -$base grembase.asc - -$skin grem - -$frame stand1.asc stand2.asc stand3.asc stand4.asc stand5.asc stand6.asc -$frame stand7.asc stand8.asc stand9.asc stand10.asc stand11.asc stand12.asc -$frame stand13.asc stand14.asc stand15.asc stand16.asc stand17.asc - -$frame walk1.asc walk2.asc walk3.asc walk4.asc walk5.asc walk6.asc -$frame walk7.asc walk8.asc walk9.asc walk10.asc walk11.asc walk12.asc - -$frame run1.asc run2.asc run3.asc run4.asc run5.asc run6.asc run7.asc run8.asc -$frame run9.asc run10.asc run11.asc run12.asc run13.asc run14.asc run15.asc - -$frame jump1.asc jump2.asc jump3.asc jump4.asc jump5.asc jump6.asc jump7.asc -$frame jump8.asc jump9.asc jump10.asc jump11.asc jump12.asc jump13.asc jump14.asc -$frame jump15.asc jump16.asc - -$frame attk1.asc attk2.asc attk3.asc attk4.asc attk5.asc attk6.asc -$frame attk7.asc attk8.asc attk9.asc attk10.asc attk11.asc - -$frame maul1.asc maul2.asc maul3.asc maul4.asc maul5.asc maul6.asc -$frame maul7.asc maul8.asc maul9.asc maul10.asc maul11.asc maul12.asc maul13.asc - -$frame spawn1.asc spawn2.asc spawn3.asc spawn4.asc spawn5.asc spawn6.asc - -$frame look1.asc look2.asc look3.asc look4.asc look5.asc look6.asc look7.asc -$frame look8.asc look9.asc look10.asc - -$frame pain1.asc pain2.asc pain3.asc pain4.asc - -$frame death1.asc death2.asc death3.asc death4.asc death5.asc death6.asc death7.asc -$frame death8.asc death9.asc death10.asc death11.asc death12.asc - -$frame flip1.asc flip2.asc flip3.asc flip4.asc flip5.asc flip6.asc flip7.asc -$frame flip8.asc - -$frame lunge1.asc lunge2.asc lunge3.asc lunge4.asc lunge5.asc lunge6.asc lunge7.asc -$frame lunge8.asc lunge9.asc lunge10.asc lunge11.asc - -$frame gfire1.asc gfire2.asc gfire3.asc gfire4.asc gfire5.asc gfire6.asc - -$frame glook1.asc glook2.asc glook3.asc glook4.asc glook5.asc glook6.asc glook7.asc -$frame glook8.asc glook9.asc glook10.asc glook11.asc glook12.asc glook13.asc -$frame glook14.asc glook15.asc glook16.asc glook17.asc glook18.asc glook19.asc glook20.asc - -$frame gpain1.asc gpain2.asc gpain3.asc - -$frame grun1.asc grun2.asc grun3.asc grun4.asc grun5.asc grun6.asc grun7.asc -$frame grun8.asc grun9.asc grun10.asc grun11.asc grun12.asc grun13.asc grun14.asc grun15.asc - -//============================================================================ - -float NumGremlins; -float NumSpawnGremlins; - -/* -=========== -GremlinAttemptWeaponSteal - -see if we can steal enemy's weapon - -============ -*/ -entity()GremlinFindVictim; -float() GremlinFindTarget; - -float() GremlinAttemptWeaponSteal = -{ - local vector delta; - local float best; - local entity victim; - local float amount; - - if(self.stoleweapon) - { - dprint("gremlin trying to steal a weapon again\n"); - return FALSE; - } - - if(!(self.enemy.flags & FL_CLIENT)) - { - return FALSE; - } - - delta = (self.enemy.origin - self.origin); - - if(vlen(delta) > 100) - return FALSE; - - if(random() < 0.4) - return FALSE; - - // - // we are within range so lets go for it - // - victim = self.enemy; - - local float victimWeapons[8]; - victimWeapons[0] = victim.holsterweapon0; - victimWeapons[1] = victim.holsterweapon1; - victimWeapons[2] = victim.holsterweapon2; - victimWeapons[3] = victim.holsterweapon3; - victimWeapons[4] = victim.holsterweapon4; - victimWeapons[5] = victim.holsterweapon5; - victimWeapons[6] = victim.weapon; - victimWeapons[7] = victim.weapon2; - - local float tries; - local float idx; - - best = WID_FIST; - for(tries = 0; tries < 15; ++tries) - { - idx = ceil(random() * 7.1); - - if(idx < 0) { idx = 0; } - else if (idx > 7) { idx = 7; } - - if(victimWeapons[idx] == WID_FIST) - { - continue; - } - - best = victimWeapons[idx]; - break; - } - - if(best == WID_FIST || best == WID_MJOLNIR) - { - return FALSE; - } - - // take that weapon from the entity - if(getWeaponMode() == QVR_WEAPONMODE_CYCLEQUICKSLOT) - { - victim.items = victim.items - (victim.items & WeaponIdToItemId(best)); - } - - // deal with stolen holster weapon - local float hotspot; - hotspot = -1; - - if(idx == 0) { hotspot = QVR_HS_LEFT_SHOULDER_HOLSTER; } - else if(idx == 1) { hotspot = QVR_HS_RIGHT_SHOULDER_HOLSTER; } - else if(idx == 2) { hotspot = QVR_HS_LEFT_HIP_HOLSTER; } - else if(idx == 3) { hotspot = QVR_HS_RIGHT_HIP_HOLSTER; } - else if(idx == 4) { hotspot = QVR_HS_LEFT_UPPER_HOLSTER; } - else if(idx == 5) { hotspot = QVR_HS_RIGHT_UPPER_HOLSTER; } - - local entity tmpSelf; - - if(hotspot != -1) - { - tmpSelf = self; - self = victim; - setHolsterWeapon(hotspot, WID_FIST); - setHolsterWeaponModel(hotspot, WeaponIdToModel(WID_FIST)); - self = tmpSelf; - } - else - { - // deal with stolen hand weapon - - local float hand; - - if(idx == 6) { hand = cVR_MainHand; } - else if(idx == 7) { hand = cVR_OffHand; } - - VRSetHandEmpty(victim, hand); - - tmpSelf = self; - self = victim; - W_SetCurrentAmmoFor(hand); - self = tmpSelf; - } - - sound(victim, CHAN_BODY, "knight/sword2.wav", 0.7, ATTN_NORM); - - // give it to our gremlin - self.items = self.items | WeaponIdToItemId(best); - self.weapon = best; - - // take some ammo while we are at it - self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS ) ); - - // TODO VR: (P1) huge code repetition - if(best == WID_AXE) - { - sprint (victim, "Gremlin stole your Axe\n"); - } - else if(best == WID_SHOTGUN) - { - amount = victim.ammo_shells; - - if(amount > 10) - amount = 10; - - victim.ammo_shells = victim.ammo_shells - amount; - self.ammo_shells = self.ammo_shells + amount; - self.items = self.items | IT_SHELLS; - self.currentammo = self.ammo_shells; - sprint (victim, "Gremlin stole your Shotgun\n"); - } - else if(best == WID_SUPER_SHOTGUN) - { - amount = victim.ammo_shells; - - if(amount > 20) - amount = 20; - - victim.ammo_shells = victim.ammo_shells - amount; - self.ammo_shells = self.ammo_shells + amount; - self.items = self.items | IT_SHELLS; - self.currentammo = self.ammo_shells; - sprint (victim, "Gremlin stole your Super Shotgun\n"); - } - else if(best == WID_NAILGUN) - { - amount = victim.ammo_nails; - - if(amount > 40) - amount = 40; - - victim.ammo_nails = victim.ammo_nails - amount; - self.ammo_nails = self.ammo_nails + amount; - self.items = self.items | IT_NAILS; - self.currentammo = self.ammo_nails; - sprint (victim, "Gremlin stole your Nailgun\n"); - } - else if(best == WID_SUPER_NAILGUN) - { - amount = victim.ammo_nails; - - if(amount > 40) - amount = 40; - - victim.ammo_nails = victim.ammo_nails - amount; - self.ammo_nails = self.ammo_nails + amount; - self.items = self.items | IT_NAILS; - self.currentammo = self.ammo_nails; - sprint (victim, "Gremlin stole your Super Nailgun\n"); - } - else if(best == WID_GRENADE_LAUNCHER) - { - amount = victim.ammo_rockets; - - if(amount > 5) - amount = 5; - - victim.ammo_rockets = victim.ammo_rockets - amount; - self.ammo_rockets = self.ammo_rockets + amount; - self.items = self.items | IT_ROCKETS; - self.currentammo = self.ammo_rockets; - sprint (victim, "Gremlin stole your Grenade Launcher\n"); - } - else if(best == WID_ROCKET_LAUNCHER) - { - amount = victim.ammo_rockets; - - if(amount > 5) - amount = 5; - - victim.ammo_rockets = victim.ammo_rockets - amount; - self.ammo_rockets = self.ammo_rockets + amount; - self.items = self.items | IT_ROCKETS; - self.currentammo = self.ammo_rockets; - sprint (victim, "Gremlin stole your Rocket Launcher\n"); - } - else if(best == WID_LIGHTNING) - { - amount = victim.ammo_cells; - - if(amount > 40) - amount = 40; - - victim.ammo_cells = victim.ammo_cells - amount; - self.ammo_cells = self.ammo_cells + amount; - self.items = self.items | IT_CELLS; - self.currentammo = self.ammo_cells; - sprint (victim, "Gremlin stole your Lightning Gun\n"); - } - else if(best == WID_LASER_CANNON) - { - amount = victim.ammo_cells; - - if(amount > 40) - amount = 40; - - victim.ammo_cells = victim.ammo_cells - amount; - self.ammo_cells = self.ammo_cells + amount; - self.items = self.items | IT_CELLS; - self.currentammo = self.ammo_cells; - sprint (victim, "Gremlin stole your Laser Cannon\n"); - } - else if(best == WID_PROXIMITY_GUN) - { - amount = victim.ammo_rockets; - - if(amount > 5) - amount = 5; - - victim.ammo_rockets = victim.ammo_rockets - amount; - self.ammo_rockets = self.ammo_rockets + amount; - self.items = self.items | IT_ROCKETS; - self.currentammo = self.ammo_rockets; - sprint (victim, "Gremlin stole your Proximity Gun\n"); - } - - // tag the gremlin as having stolen a weapon - self.stoleweapon = TRUE; - self.attack_finished = time; - - // don't fire the first shot at the person we stole the weapon from - // all the time - if(random() > 0.85) - self.lastvictim = victim; - else - self.lastvictim = self; - - // self.attack_state = AS_STRAIGHT; - - // find a recipient - victim = GremlinFindVictim(); - - if(victim != world) - { - self.enemy = victim; - FoundTarget(); - self.attack_finished = time; - self.search_time = time + 1.0; - } - - return TRUE; -} - -//============================================================================ - -/* -=========== -GremlinFindTarget - -gremlin is currently not attacking anything, so try to find a target - -============ -*/ -float() GremlinFindTarget = - { - local entity head; - local entity gorge; - local float dist; - local float result; - - if((self.stoleweapon==0) && time > self.wait) - { - self.wait = time + 1.0; - dist = 2000; - gorge = world; - head = nextent(world); - while(head!=world) - { - if((head.health < 1) && (head.flags & (FL_MONSTER|FL_CLIENT))) - { - result = fabs(head.origin_z - self.origin_z); - if((visible(head)) && (result<80) && (head.gorging == FALSE) && (visible_distance<dist)) - { - dist = visible_distance; - gorge = head; - } - } - head = nextent(head); - } - if((gorge != world) && (dist < (700*random()))) - { -// dprint("starting to gorge on "); -// dprint(gorge.classname); -// dprint("\n"); - self.oldenemy = self.enemy; - self.gorging = TRUE; - self.enemy = gorge; - self.search_time = time + 4.0; - FoundTarget(); - return TRUE; - } - } - else if(self.stoleweapon) - { - head = GremlinFindVictim(); - if(head != world) - { - self.enemy = head; - FoundTarget(); - self.attack_finished = time; - self.search_time = time + 2.0; - return TRUE; - } - } - result = FindTarget(); - self.search_time = time + 2.0; - return result; - }; -//============================================================================ -/* -============= -gremlin_walk - -The monster is walking it's beat -============= -*/ -void(float dist) gremlin_walk = - { - movedist = dist; - - // check for noticing a player - if(GremlinFindTarget ()) - return; - - movetogoal (dist); - }; - -//============================================================================ - -/* -============= -gremlin_stand - -The monster is staying in one place for a while, with slight angle turns -============= -*/ -void() gremlin_stand = - { - if(FindTarget ()) - return; - - if(time > self.pausetime) - { - self.th_walk(); - return; - } - }; - -//============================================================================ -float() GremlinCheckNoAmmo; -void() gremlin_glook1; -/* -============= -gremlin_run - -The monster has an enemy it is trying to kill -============= -*/ -void(float dist) gremlin_run = -{ - local float r; - local vector d; - - if(self.watertype == CONTENT_LAVA) - { // do damage - T_Damage (self, world, world, 2000); - } - - movedist = dist; - - if(self.stoleweapon && self.weapon != WID_AXE) - { - self.frame = self.frame + $grun1.asc - $run1.asc; - } - - if(self.gorging) - { - traceline(self.origin, self.enemy.origin, TRUE, self); - if(trace_fraction != 1.0) - { - self.gorging = FALSE; - return; - } - - if(!visible(self.enemy)) - { - self.gorging = FALSE; - return; - } - - r = vlen(self.enemy.origin - self.origin); - - if(r < 130) - { - ai_face(); - - if(r < 45) - { - self.th_melee(); - self.attack_state = AS_STRAIGHT; - return; - } - else if(walkmove (self.angles_y, dist) == FALSE) - { - self.gorging = FALSE; - return; - } - - return; - } - - movetogoal (dist); // done in C code... - } - else - { - if(random()>0.97) - { - if(GremlinFindTarget()) - return; - } - // get away from player if we stole a weapon - if(self.stoleweapon && self.weapon != WID_AXE) - { - if(self.enemy.health < 0 && self.enemy.classname == "player") - { - gremlin_glook1(); - return; - } - if(!GremlinCheckNoAmmo()) - { - if(self.t_length==1) - { - remove(self.trigger_field); - self.goalentity = self.enemy; - self.t_length = 0; - } - return; - } - r = vlen(self.enemy.origin - self.origin); - d = normalize(self.origin-self.enemy.origin); - if(self.t_length == 0) - { - if(r<150) - { - self.trigger_field = spawn(); - setsize(self.trigger_field,'-1 -1 -1','1 1 1'); - self.t_length = 1; - } - } - if(self.t_length==1) - { - if(r > 250) - { - remove(self.trigger_field); - self.goalentity = self.enemy; - self.t_length = 0; -// self.attack_state = AS_SLIDING; - } - else - { - if(r < 160) - { - local vector ang; - local float done; - local vector end; - local float c; - - ang = vectoangles(d); - done = 0; - c = 0; - while(done == 0) - { - makevectors(ang); - end = self.enemy.origin + v_forward * 350; - traceline(self.enemy.origin,end,FALSE,self); - if(trace_fraction == 1.0) - { - traceline(self.origin,end,FALSE,self); - if(trace_fraction == 1.0) - done = 1; - } - ang_y = anglemod(ang_y + 36); - c = c + 1; - if(c == 10) - { - done = 1; - } - } - setorigin(self.trigger_field,end); - } - self.goalentity = self.trigger_field; - self.ideal_yaw = vectoyaw(normalize(self.goalentity.origin-self.origin)); - ChangeYaw(); - movetogoal (dist); // done in C code... - self.nextthink = time + 0.1; - return; - } - } - } - ai_run(dist); - self.nextthink = time + 0.1; - } - }; - -//============================================================================ - -void() Gremlin_JumpTouch; -void() Gremlin_FlipTouch; -void(float side) Gremlin_Melee; -void(float side) Gremlin_Gorge; - -void() gremlin_stand1 =[ $stand1.asc, gremlin_stand2 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand2 =[ $stand2.asc, gremlin_stand3 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand3 =[ $stand3.asc, gremlin_stand4 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand4 =[ $stand4.asc, gremlin_stand5 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand5 =[ $stand5.asc, gremlin_stand6 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand6 =[ $stand6.asc, gremlin_stand7 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand7 =[ $stand7.asc, gremlin_stand8 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand8 =[ $stand8.asc, gremlin_stand9 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand9 =[ $stand9.asc, gremlin_stand10 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand10 =[ $stand10.asc, gremlin_stand11 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand11 =[ $stand11.asc, gremlin_stand12 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand12 =[ $stand12.asc, gremlin_stand13 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand13 =[ $stand13.asc, gremlin_stand14 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand14 =[ $stand14.asc, gremlin_stand15 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand15 =[ $stand15.asc, gremlin_stand16 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand16 =[ $stand16.asc, gremlin_stand17 ] {gremlin_stand();self.nextthink = time + 0.2;}; -void() gremlin_stand17 =[ $stand17.asc, gremlin_stand1 ] {gremlin_stand();self.nextthink = time + 0.2;}; - -void() gremlin_walk1 =[ $walk1.asc, gremlin_walk2 ] { -if(random() < 0.1) - sound(self, CHAN_VOICE, "grem/idle.wav", 1, ATTN_IDLE); -gremlin_walk(8);}; -void() gremlin_walk2 =[ $walk2.asc, gremlin_walk3 ] {gremlin_walk(8);}; -void() gremlin_walk3 =[ $walk3.asc, gremlin_walk4 ] {gremlin_walk(8);}; -void() gremlin_walk4 =[ $walk4.asc, gremlin_walk5 ] {gremlin_walk(8);}; -void() gremlin_walk5 =[ $walk5.asc, gremlin_walk6 ] {gremlin_walk(8);}; -void() gremlin_walk6 =[ $walk6.asc, gremlin_walk7 ] {gremlin_walk(8);}; -void() gremlin_walk7 =[ $walk7.asc, gremlin_walk8 ] {gremlin_walk(8);}; -void() gremlin_walk8 =[ $walk8.asc, gremlin_walk9 ] {gremlin_walk(8);}; -void() gremlin_walk9 =[ $walk9.asc, gremlin_walk10 ] {gremlin_walk(8);}; -void() gremlin_walk10 =[ $walk10.asc, gremlin_walk11 ] {gremlin_walk(8);}; -void() gremlin_walk11 =[ $walk11.asc, gremlin_walk12 ] {gremlin_walk(8);}; -void() gremlin_walk12 =[ $walk12.asc, gremlin_walk1 ] {gremlin_walk(8);}; - -void() gremlin_run1 =[ $run1.asc, gremlin_run2 ] { -if(random() < 0.1) - sound(self, CHAN_VOICE, "grem/idle.wav", 1, ATTN_IDLE); -gremlin_run(0);}; -void() gremlin_run2 =[ $run2.asc, gremlin_run3 ] {gremlin_run(8);}; -void() gremlin_run3 =[ $run3.asc, gremlin_run4 ] {gremlin_run(12);}; -void() gremlin_run4 =[ $run4.asc, gremlin_run5 ] {gremlin_run(16);}; -void() gremlin_run5 =[ $run5.asc, gremlin_run6 ] {gremlin_run(16);}; -void() gremlin_run6 =[ $run6.asc, gremlin_run7 ] {gremlin_run(12);}; -void() gremlin_run7 =[ $run7.asc, gremlin_run8 ] {gremlin_run(8);}; -void() gremlin_run8 =[ $run8.asc, gremlin_run9 ] {gremlin_run(0);}; -void() gremlin_run9 =[ $run9.asc, gremlin_run10 ] {gremlin_run(8);}; -void() gremlin_run10 =[ $run10.asc, gremlin_run11 ] {gremlin_run(12);}; -void() gremlin_run11 =[ $run11.asc, gremlin_run12 ] {gremlin_run(16);}; -void() gremlin_run12 =[ $run12.asc, gremlin_run1 ] {gremlin_run(16);}; -void() gremlin_run13 =[ $run13.asc, gremlin_run14 ] {gremlin_run(12);}; -void() gremlin_run14 =[ $run14.asc, gremlin_run15 ] {gremlin_run(8);}; -void() gremlin_run15 =[ $run15.asc, gremlin_run1 ] {gremlin_run(0);}; - -void() gremlin_jump1 =[ $jump1.asc, gremlin_jump2 ] {ai_face();}; -void() gremlin_jump2 =[ $jump2.asc, gremlin_jump3 ] {ai_face();}; -void() gremlin_jump3 =[ $jump3.asc, gremlin_jump4 ] {ai_face();}; -void() gremlin_jump4 =[ $jump4.asc, gremlin_jump5 ] {ai_face();}; -void() gremlin_jump5 =[ $jump5.asc, gremlin_jump6 ] -{ - ai_face(); - - if(self.flags & FL_ONGROUND) - { - self.touch = Gremlin_JumpTouch; - makevectors (self.angles); - self.origin_z = self.origin_z + 1; - self.velocity = v_forward * 300 + '0 0 300'; - self.flags = self.flags - FL_ONGROUND; - } - else - { - gremlin_run1(); - } -}; -void() gremlin_jump6 =[ $jump6.asc, gremlin_jump7 ] {}; -void() gremlin_jump7 =[ $jump7.asc, gremlin_jump8 ] {}; -void() gremlin_jump8 =[ $jump8.asc, gremlin_jump9 ] {}; -void() gremlin_jump9 =[ $jump9.asc, gremlin_jump10 ] {}; -void() gremlin_jump10 =[ $jump10.asc, gremlin_jump11 ] {}; -void() gremlin_jump11 =[ $jump11.asc, gremlin_jump1 ] - { - self.nextthink = time + 3; - // if three seconds pass, assume gremlin is stuck and jump again - }; - -void() gremlin_jump12 =[ $jump12.asc, gremlin_jump13 ] {}; -void() gremlin_jump13 =[ $jump13.asc, gremlin_jump14 ] {}; -void() gremlin_jump14 =[ $jump14.asc, gremlin_jump15 ] {}; -void() gremlin_jump15 =[ $jump15.asc, gremlin_jump16 ] {}; -void() gremlin_jump16 =[ $jump16.asc, gremlin_run1 ] {}; - -void() gremlin_shot1 = [$gfire1.asc, gremlin_shot2 ] {self.effects = self.effects | EF_MUZZLEFLASH;}; -void() gremlin_shot2 = [$gfire2.asc, gremlin_shot3 ] {}; -void() gremlin_shot3 = [$gfire3.asc, gremlin_shot4 ] {}; -void() gremlin_shot4 = [$gfire4.asc, gremlin_shot5 ] {}; -void() gremlin_shot5 = [$gfire5.asc, gremlin_shot6 ] {}; -void() gremlin_shot6 = [$gfire6.asc, gremlin_run1 ] {}; - - -//============================================================================ -void(float ox) Gremlin_FireNailGun; - -void() gremlin_nail1 =[$gfire1.asc, gremlin_nail2 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireNailGun(4); - }; -void() gremlin_nail2 =[$gfire1.asc, gremlin_nail3 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireNailGun(4); - }; -void() gremlin_nail3 =[$gfire1.asc, gremlin_nail4 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireNailGun(4); - }; -void() gremlin_nail4 =[$gfire1.asc, gremlin_nail5 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireNailGun(4); - }; -void() gremlin_nail5 =[$gfire1.asc, gremlin_nail6 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireNailGun(4); - }; -void() gremlin_nail6 =[$gfire1.asc, gremlin_nail7 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireNailGun(4); - }; -void() gremlin_nail7 = [$gfire1.asc, gremlin_run1 ] {}; - - -void(float ox) Gremlin_FireLaserGun; - -void() gremlin_laser1 =[$gfire1.asc, gremlin_laser2 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireLaserGun(4); - }; -void() gremlin_laser2 =[$gfire1.asc, gremlin_laser3 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireLaserGun(4); - }; -void() gremlin_laser3 =[$gfire1.asc, gremlin_laser4 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireLaserGun(4); - }; -void() gremlin_laser4 =[$gfire1.asc, gremlin_laser5 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireLaserGun(4); - }; -void() gremlin_laser5 =[$gfire1.asc, gremlin_laser6 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireLaserGun(4); - }; -void() gremlin_laser6 =[$gfire1.asc, gremlin_laser7 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - Gremlin_FireLaserGun(4); - }; -void() gremlin_laser7 = [$gfire1.asc, gremlin_run1 ] {}; - -//============================================================================ - -void() Gremlin_FireLightningGun; -void() gremlin_light1 =[$gfire1.asc, gremlin_light2 ] - { - Gremlin_FireLightningGun(); - }; -void() gremlin_light2 = [$gfire1.asc, gremlin_light3 ] - { - Gremlin_FireLightningGun(); - }; -void() gremlin_light3 =[$gfire1.asc, gremlin_light4 ] - { - Gremlin_FireLightningGun(); - }; -void() gremlin_light4 = [$gfire1.asc, gremlin_light5 ] -{ - Gremlin_FireLightningGun(); -}; -void() gremlin_light5 = [$gfire1.asc, gremlin_run1 ] {}; - -//============================================================================ - -void() gremlin_rocket1 = [$gfire1.asc, gremlin_rocket2 ] {self.effects = self.effects | EF_MUZZLEFLASH;}; -void() gremlin_rocket2 = [$gfire2.asc, gremlin_rocket3 ] {}; -void() gremlin_rocket3 = [$gfire3.asc, gremlin_rocket4 ] {}; -void() gremlin_rocket4 = [$gfire4.asc, gremlin_rocket5 ] {}; -void() gremlin_rocket5 = [$gfire5.asc, gremlin_rocket6 ] {}; -void() gremlin_rocket6 = [$gfire6.asc, gremlin_run1 ] {}; - -void() gremlin_lunge1 =[ $lunge1.asc, gremlin_lunge2 ] {ai_charge(0);}; -void() gremlin_lunge2 =[ $lunge2.asc, gremlin_lunge3 ] {ai_charge(0);}; -void() gremlin_lunge3 =[ $lunge3.asc, gremlin_lunge4 ] {ai_charge(0);}; -void() gremlin_lunge4 =[ $lunge4.asc, gremlin_lunge5 ] {ai_charge(0);}; -void() gremlin_lunge5 =[ $lunge5.asc, gremlin_lunge6 ] {ai_charge(0);}; -void() gremlin_lunge6 =[ $lunge6.asc, gremlin_lunge7 ] {ai_charge(0);}; -void() gremlin_lunge7 =[ $lunge7.asc, gremlin_lunge8 ] {ai_charge(15);}; -void() gremlin_lunge8 =[ $lunge8.asc, gremlin_lunge9 ] {ai_charge(0);Gremlin_Melee(0);}; -void() gremlin_lunge9 =[ $lunge9.asc, gremlin_lunge10] {ai_charge(0);}; -void() gremlin_lunge10 =[ $lunge10.asc, gremlin_lunge11] {ai_charge(0);}; -void() gremlin_lunge11 =[ $lunge11.asc, gremlin_run1] {ai_charge(0);}; - -void() gremlin_claw1 =[ $attk1.asc, gremlin_claw2 ] {ai_charge(0);}; -void() gremlin_claw2 =[ $attk2.asc, gremlin_claw3 ] {ai_charge(0);}; -void() gremlin_claw3 =[ $attk3.asc, gremlin_claw4 ] {ai_charge(0);}; -void() gremlin_claw4 =[ $attk4.asc, gremlin_claw5 ] {ai_charge(0);}; -void() gremlin_claw5 =[ $attk5.asc, gremlin_claw6 ] {ai_charge(0);}; -void() gremlin_claw6 =[ $attk6.asc, gremlin_claw7 ] {ai_charge(0);Gremlin_Melee(200);}; -void() gremlin_claw7 =[ $attk7.asc, gremlin_claw8 ] {ai_charge(15);}; -void() gremlin_claw8 =[ $attk8.asc, gremlin_claw9 ] {ai_charge(0);}; -void() gremlin_claw9 =[ $attk9.asc, gremlin_claw10] {ai_charge(0);}; -void() gremlin_claw10 =[ $attk10.asc, gremlin_claw11] {ai_charge(0);}; -void() gremlin_claw11 =[ $attk11.asc, gremlin_run1] {ai_charge(0);}; - -void() gremlin_gorge1 =[ $maul1.asc, gremlin_gorge2] {ai_charge(1);}; -void() gremlin_gorge2 =[ $maul2.asc, gremlin_gorge3] {ai_charge(1);}; -void() gremlin_gorge3 =[ $maul3.asc, gremlin_gorge4] {ai_charge(2);}; -void() gremlin_gorge4 =[ $maul4.asc, gremlin_gorge5] {ai_charge(0);}; -void() gremlin_gorge5 =[ $maul5.asc, gremlin_gorge6] {ai_charge(0);}; -void() gremlin_gorge6 =[ $maul6.asc, gremlin_gorge7] {ai_charge(0);Gremlin_Gorge(200);}; -void() gremlin_gorge7 =[ $maul7.asc, gremlin_gorge8] {ai_charge(0);}; -void() gremlin_gorge8 =[ $maul8.asc, gremlin_gorge9] {ai_charge(0);Gremlin_Gorge(-200);}; -void() gremlin_gorge9 =[ $maul9.asc, gremlin_gorge10] {ai_charge(0);}; -void() gremlin_gorge10 =[ $maul10.asc, gremlin_gorge11] {ai_charge(0);}; -void() gremlin_gorge11 =[ $maul11.asc, gremlin_gorge12] {ai_charge(0);}; -void() gremlin_gorge12 =[ $maul12.asc, gremlin_gorge13] {ai_charge(0);}; -void() gremlin_gorge13 =[ $maul13.asc, gremlin_gorge1] {ai_charge(0);}; - -void() gremlin_look1 =[ $look1.asc, gremlin_look2] {self.nextthink = time + 0.2;}; -void() gremlin_look2 =[ $look2.asc, gremlin_look3] {self.nextthink = time + 0.2;}; -void() gremlin_look3 =[ $look3.asc, gremlin_look4] {self.nextthink = time + 0.2;}; -void() gremlin_look4 =[ $look4.asc, gremlin_look5] {self.nextthink = time + 0.2;}; -void() gremlin_look5 =[ $look5.asc, gremlin_look6] {self.nextthink = time + 0.2;}; -void() gremlin_look6 =[ $look6.asc, gremlin_look7] {self.nextthink = time + 0.2;}; -void() gremlin_look7 =[ $look7.asc, gremlin_look8] {self.nextthink = time + 0.2;}; -void() gremlin_look8 =[ $look8.asc, gremlin_look9] {self.nextthink = time + 0.2;}; -void() gremlin_look9 =[ $look9.asc, gremlin_run1] - { - if(self.oldenemy.health > 0) - { - self.enemy = self.oldenemy; - HuntTarget(); - } - else - { - if(self.movetarget) - self.th_walk(); - else - self.th_stand(); - } - }; - - -void() GremlinDropBackpack; -void() gremlin_glook1 =[ $glook1.asc, gremlin_glook2] {}; -void() gremlin_glook2 =[ $glook2.asc, gremlin_glook3] {}; -void() gremlin_glook3 =[ $glook3.asc, gremlin_glook4] {}; -void() gremlin_glook4 =[ $glook4.asc, gremlin_glook5] {}; -void() gremlin_glook5 =[ $glook5.asc, gremlin_glook6] {}; -void() gremlin_glook6 =[ $glook6.asc, gremlin_glook7] {}; -void() gremlin_glook7 =[ $glook7.asc, gremlin_glook8] {}; -void() gremlin_glook8 =[ $glook8.asc, gremlin_glook9] {}; -void() gremlin_glook9 =[ $glook9.asc, gremlin_glook10] {}; -void() gremlin_glook10 =[ $glook10.asc, gremlin_glook11] {}; -void() gremlin_glook11 =[ $glook11.asc, gremlin_glook12] {}; -void() gremlin_glook12 =[ $glook12.asc, gremlin_glook13] {}; -void() gremlin_glook13 =[ $glook13.asc, gremlin_glook14] {}; -void() gremlin_glook14 =[ $glook14.asc, gremlin_glook15] {}; -void() gremlin_glook15 =[ $glook15.asc, gremlin_glook16] {}; -void() gremlin_glook16 =[ $glook16.asc, gremlin_glook17] {}; -void() gremlin_glook17 =[ $glook17.asc, gremlin_glook18] {}; -void() gremlin_glook18 =[ $glook18.asc, gremlin_glook19] {}; -void() gremlin_glook19 =[ $glook19.asc, gremlin_glook20] {}; -void() gremlin_glook20 =[ $glook20.asc, gremlin_glook20] - { - GremlinDropBackpack(); - self.stoleweapon = FALSE; - if(self.oldenemy.health > 0) - { - self.enemy = self.oldenemy; - HuntTarget(); - } - else - { - if(self.movetarget) - self.th_walk(); - else - self.th_stand(); - } - }; - -void() gremlin_pain1 =[ $pain1.asc, gremlin_pain2 ] {ai_back(4);}; -void() gremlin_pain2 =[ $pain2.asc, gremlin_pain3 ] {ai_back(4);}; -void() gremlin_pain3 =[ $pain3.asc, gremlin_pain4 ] {ai_back(2);}; -void() gremlin_pain4 =[ $pain4.asc, gremlin_run1 ] {}; - -void() gremlin_gunpain1 =[ $gpain1.asc, gremlin_gunpain2 ] {ai_back(4);}; -void() gremlin_gunpain2 =[ $gpain2.asc, gremlin_gunpain3 ] {ai_back(2);}; -void() gremlin_gunpain3 =[ $gpain3.asc, gremlin_run1 ] {}; - -void(entity attacker, float damage) gremlin_pain = -{ - local float r; - - if(random()<0.8) - { - self.gorging = FALSE; - self.enemy = attacker; - FoundTarget(); - } - if(self.touch == Gremlin_JumpTouch) - return; - - if(self.pain_finished > time) - return; - - self.pain_finished = time + 1; -// if(random()<0.5) -// sound(self, CHAN_VOICE, "grem/pain2.wav", 1, ATTN_NORM); -// else - r = random(); - if(r<0.33) - sound(self, CHAN_VOICE, "grem/pain1.wav", 1, ATTN_NORM); - else if(r<0.66) - sound(self, CHAN_VOICE, "grem/pain2.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "grem/pain3.wav", 1, ATTN_NORM); - - if(self.stoleweapon && self.weapon != WID_AXE) - { - gremlin_gunpain1(); - } - else - { - gremlin_pain1(); - } -}; - -void() gremlin_spawn1 =[ $spawn1.asc, gremlin_spawn2 ] {self.nextthink = time + 0.3; - self.th_pain = SUB_NullPain; -}; -void() gremlin_spawn2 =[ $spawn2.asc, gremlin_spawn3 ] {self.nextthink = time + 0.3;}; -void() gremlin_spawn3 =[ $spawn3.asc, gremlin_spawn4 ] {self.nextthink = time + 0.3;}; -void() gremlin_spawn4 =[ $spawn4.asc, gremlin_spawn5 ] {self.nextthink = time + 0.3;}; -void() gremlin_spawn5 =[ $spawn5.asc, gremlin_spawn6 ] {self.nextthink = time + 0.3;}; -void() gremlin_spawn6 =[ $spawn6.asc, gremlin_run1 ] { - self.th_pain = gremlin_pain; -}; - - -void() gremlin_die1 =[ $death1.asc, gremlin_die2 ] { -sound(self, CHAN_VOICE, "grem/death.wav", 1, ATTN_NORM);}; -void() gremlin_die2 =[ $death2.asc, gremlin_die3 ] {ai_forward(2);}; -void() gremlin_die3 =[ $death3.asc, gremlin_die4 ] {ai_forward(1);}; -void() gremlin_die4 =[ $death4.asc, gremlin_die5 ] {ai_forward(2);}; -void() gremlin_die5 =[ $death5.asc, gremlin_die6 ] {ai_forward(1);}; -void() gremlin_die6 =[ $death6.asc, gremlin_die7 ] -{self.solid = SOLID_NOT;}; -void() gremlin_die7 =[ $death7.asc, gremlin_die8 ] {ai_forward(2);}; -void() gremlin_die8 =[ $death8.asc, gremlin_die9 ] {ai_forward(1);}; -void() gremlin_die9 =[ $death9.asc, gremlin_die10 ] {ai_forward(2);}; -void() gremlin_die10 =[ $death10.asc, gremlin_die11 ] {ai_forward(1);}; -void() gremlin_die11 =[ $death11.asc, gremlin_die12 ] {ai_forward(2);}; -void() gremlin_die12 =[ $death12.asc, gremlin_die12 ] {}; - -void() gremlin_gib= - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_grem.mdl", -35); - ThrowGib ("progs/gib1.mdl", -35); - ThrowGib ("progs/gib1.mdl", -35); - ThrowGib ("progs/gib1.mdl", -35); - }; - -void() gremlin_flip1 =[ $flip1.asc, gremlin_flip2 ] - { - ai_face(); - makevectors (self.angles); - self.origin_z = self.origin_z + 1; - self.velocity = '0 0 350' - (v_forward * 200); - if(self.flags & FL_ONGROUND) - self.flags = self.flags - FL_ONGROUND; - sound(self, CHAN_VOICE, "grem/death.wav", 1, ATTN_NORM); - }; -void() gremlin_flip2 =[ $flip2.asc, gremlin_flip3 ] {ai_face();}; -void() gremlin_flip3 =[ $flip3.asc, gremlin_flip4 ] {}; -void() gremlin_flip4 =[ $flip4.asc, gremlin_flip5 ] {}; -void() gremlin_flip5 =[ $flip5.asc, gremlin_flip6 ] {}; -void() gremlin_flip6 =[ $flip6.asc, gremlin_flip7 ] {self.touch = Gremlin_FlipTouch;}; -void() gremlin_flip7 =[ $flip7.asc, gremlin_gib ] - { - self.nextthink = time + 3; - // if three seconds pass, assume gremlin is stuck and jump again - }; -void() gremlin_flip8 =[ $flip8.asc, gremlin_flip8 ] - { - self.solid = SOLID_NOT; - }; - -/* -=============== -GremlinDropBackpack -=============== -*/ -void() GremlinDropBackpack = -{ - local entity item; - - if(!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells)) - return; // nothing in it - - item = spawn(); - item.origin = self.origin - '0 0 24'; - - /* - self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS ) ); - item.items = self.items; - - if(item.items & IT_AXE) - item.netname = "Axe"; - else if(item.items & IT_SHOTGUN) - item.netname = "Shotgun"; - else if(item.items & IT_SUPER_SHOTGUN) - item.netname = "Double-barrelled Shotgun"; - else if(item.items & IT_NAILGUN) - item.netname = "Nailgun"; - else if(item.items & IT_SUPER_NAILGUN) - item.netname = "Super Nailgun"; - else if(item.items & IT_GRENADE_LAUNCHER) - item.netname = "Grenade Launcher"; - else if(item.items & IT_ROCKET_LAUNCHER) - item.netname = "Rocket Launcher"; - else if(item.items & IT_LIGHTNING) - item.netname = "Thunderbolt"; - else if(item.items & IT_LASER_CANNON) - item.netname = "Laser Cannon"; - else if(item.items & IT_PROXIMITY_GUN) - item.netname = "Proximity Gun"; - else if(item.items & IT_MJOLNIR) - item.netname = "Mjolnir"; - else - item.netname = ""; - */ - - item.ammo_shells = self.ammo_shells; - item.ammo_nails = self.ammo_nails; - item.ammo_rockets = self.ammo_rockets; - item.ammo_cells = self.ammo_cells; - - if(item.ammo_shells < 0) { item.ammo_shells = 0; } - if(item.ammo_nails < 0) { item.ammo_nails = 0; } - if(item.ammo_rockets < 0) { item.ammo_rockets = 0; } - if(item.ammo_cells < 0) { item.ammo_cells = 0; } - - item.velocity_z = 300; - item.velocity_x = -100 + (random() * 200); - item.velocity_y = -100 + (random() * 200); - - item.flags = FL_ITEM; - item.solid = SOLID_TRIGGER; - item.movetype = MOVETYPE_TOSS; - setmodel (item, "progs/backpack.mdl"); - setsize (item, '-8 -8 0', '8 8 24'); - item.touch = BackpackTouch; - - item.nextthink = time + 120; // remove after 2 minutes - item.think = SUB_Remove; -}; - -void() gremlin_die = -{ - local vector vec; - local float dot; - - GremlinDropBackpack(); - - if(self.stoleweapon) - { - CreateWeaponDrop(self, self.weapon, self.origin); - self.stoleweapon = FALSE; - } - - makevectors(self.angles); - vec = normalize(damage_attacker.origin - self.origin); - dot = vec * v_forward; - - if(self.health < -35) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead("progs/h_grem.mdl", self.health); - ThrowGib("progs/gib1.mdl", self.health); - ThrowGib("progs/gib1.mdl", self.health); - ThrowGib("progs/gib1.mdl", self.health); - return; - } - - if(dot>0.7 && (random() < 0.5) && (self.flags & FL_ONGROUND)) - { - gremlin_flip1(); - return; - } - - // regular death - gremlin_die1(); -}; - - -float() GremlinWeaponAttack; - -void() Gremlin_MeleeAttack = -{ - local float num; - if(self.gorging) - { - gremlin_gorge1(); - } - else - { - if(self.stoleweapon == 1) - { - if(self.weapon != WID_AXE) - { - objerror("gremlin meleeing with stolen weapon"); - } - } - else if((self.enemy.flags & FL_CLIENT) && random() < 0.4) - { - if(GremlinAttemptWeaponSteal()) - return; - } - - num = random(); - - if(num < 0.3) - { - gremlin_claw1(); - } - else if(num < 0.6) - { - gremlin_lunge1(); - } - else - { - gremlin_claw1(); - } - } -} - -/* -============ -gremlin_recoil -============ -*/ -/* -void() gremlin_recoil = - { - self.nextthink = time + 0.1; - self.flags = self.flags - FL_ONGROUND; - if(vlen(self.velocity)<2) - { - self.movetype = self.spawnsolidtype; - self.think = self.spawnthink; - } - }; -*/ -/* -============ -GremlinRecoil -============ -*/ -/* -void(vector dir, float mag) GremlinRecoil = - { - self.spawnsolidtype = self.movetype; - self.movetype = MOVETYPE_BOUNCE; - self.spawnthink = self.think; - self.think = gremlin_recoil; - self.nextthink = time; - self.velocity = mag * dir; - self.velocity_z = self.velocity_z + 100; - self.flags = self.flags - FL_ONGROUND; - }; -*/ - -/* -============ -GremlinCheckNoAmmo - -attack with a weapon -============ -*/ -float() GremlinCheckNoAmmo = -{ - if(self.weapon == WID_AXE) - return TRUE; - - if(self.currentammo > 0) - return TRUE; - - self.stoleweapon = FALSE; - return FALSE; -} - -/* -============ -GremlinFindVictim - -find a victim to shoot at -============ -*/ -entity() GremlinFindVictim = -{ - local entity head; - local entity selected; - local float dist; - local float head_dist; - - self.search_time = time + 1.0; - // look in our immediate vicinity - - selected = world; - dist = 1000; - head = findradius(self.origin, 1000); - - while(head) - { - if(!(head.flags & FL_NOTARGET) && ((head.flags & FL_MONSTER) || (head.flags & FL_CLIENT))) - { - if(visible(head) && (head.health > 0) && (head != self)) - { - head_dist = vlen(head.origin-self.origin); - - if(head == self.lastvictim) - head_dist = head_dist * 2; - - if(head.flags & FL_CLIENT) - head_dist = head_dist / 1.5; - - if(head.classname == self.classname) - head_dist = head_dist * 1.5; - - if(head_dist < dist) - { - selected = head; - dist = head_dist; - } - } - } - - head = head.chain; - } - - self.lastvictim = selected; - - return selected; -} - -/* -============ -Gremlin_FireRocket - -fire a rocket -============ -*/ -void() Gremlin_FireRocket = -{ - local entity missile; - local vector dir; - - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_FLYMISSILE; - missile.solid = SOLID_BBOX; - missile.classname = "missile"; - -// set missile speed - - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.1 * v_right + crandom()* 0.1 *v_up; - missile.velocity = normalize(dir); - missile.velocity = missile.velocity * 1000; - missile.angles = vectoangles(missile.velocity); - - missile.touch = T_MissileTouch; - -// set missile duration - missile.nextthink = time + 5; - missile.think = SUB_Remove; - - setmodel (missile, "progs/missile.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin + v_forward*8 + '0 0 16'); -// GremlinRecoil(dir,-1000); -}; - -/* -============ -Gremlin_FireNailGun - -fire a nailgun -============ -*/ -void(float ox) Gremlin_FireNailGun = -{ - local vector dir; - - self.currentammo = self.ammo_nails = self.ammo_nails - 1; - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.1 * v_right + crandom()* 0.1 *v_up; - dir = normalize(dir); - launch_spike (self.origin + '0 0 16', dir); -}; - -/* -============ -Gremlin_FireLaserGun - -fire a laser cannon -============ -*/ -void(float ox) Gremlin_FireLaserGun = -{ - local vector dir; - - self.currentammo = self.ammo_cells = self.ammo_cells - 1; - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.1 * v_right + crandom()* 0.1 *v_up; - dir = normalize(dir); - HIP_LaunchLaser(self.origin + '0 0 16', dir, 0); -}; - -/* -============ -Gremlin_FireShotGun - -fire a shotgun -============ -*/ -void() Gremlin_FireShotGun = -{ - local vector dir; - - self.currentammo = self.ammo_shells = self.ammo_shells - 1; - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM); - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.1 *v_right + crandom()* 0.1 *v_up; - dir = normalize(dir); - self.v_angle = vectoangles(dir); - EnemyFireBullets (6, dir, '0.04 0.04 0'); -}; - -/* -============ -Gremlin_FireSuperShotGun - -fire a shotgun -============ -*/ -void() Gremlin_FireSuperShotGun = -{ - local vector dir; - - self.currentammo = self.ammo_shells = self.ammo_shells - 2; - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM); - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.3 *v_right + crandom()* 0.3 *v_up; - dir = normalize(dir); - self.v_angle = vectoangles(dir); - EnemyFireBullets (14, dir, '0.14 0.08 0'); -}; - -/* -============ -Gremlin_FireLightningGun - -fire lightning gun -============ -*/ -void() Gremlin_FireLightningGun = - { - local vector org, dir; - local float cells; - -// explode if under water - if(self.watertype <= CONTENT_WATER) - { - cells = self.ammo_cells; - self.ammo_cells = 0; - discharged = 1; - T_RadiusDamage (self, self, 35*cells, world); - discharged = 0; - return; - } - - self.effects = self.effects | EF_MUZZLEFLASH; - - ai_face(); - - self.currentammo = self.ammo_cells = self.ammo_cells - 2; - org = self.origin + '0 0 16'; - - dir = self.enemy.origin + '0 0 16' - org; - dir = normalize (dir); - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.1 *v_right + crandom()* 0.1 *v_up; - dir = normalize(dir); - - traceline(org, self.origin + dir*600, TRUE, self); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LIGHTNING2); - WriteEntity(MSG_BROADCAST, self); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); - WriteCoord(MSG_BROADCAST, trace_endpos_x); - WriteCoord(MSG_BROADCAST, trace_endpos_y); - WriteCoord(MSG_BROADCAST, trace_endpos_z); - - LightningDamage (org, trace_endpos+(dir*4), self, 30); -}; - -/* -================ -GremlinFireProximityGrenade -================ -*/ -void() GremlinFireProximityGrenade = -{ - local entity missile; - local vector dir; - - NumProximityGrenades = NumProximityGrenades + 1; - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; - - sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); - - missile = spawn(); - missile.owner = self; - missile.lastvictim = self; - missile.movetype = MOVETYPE_TOSS; - missile.solid = SOLID_BBOX; - missile.classname = "proximity_grenade"; - missile.takedamage = DAMAGE_NO; - missile.health = 5; - missile.state = 0; - - // set missile speed - dir = normalize(self.enemy.origin - self.origin); - self.v_angle = vectoangles(dir); - makevectors(self.v_angle); - dir = dir + crandom()* 0.1 *v_right + crandom()* 0.1 *v_up; - dir = normalize(dir); - missile.velocity = dir * 600; - missile.velocity_z = 200; - - missile.avelocity = '100 600 100'; - missile.angles = vectoangles(missile.velocity); - missile.touch = ProximityGrenadeTouch; - - // set missile duration - missile.nextthink = time + 2; - missile.delay = time + 15 + (10*random()); - missile.think = ProximityBomb; - missile.th_die = ProximityGrenadeExplode; - - setmodel(missile, "progs/proxbomb.mdl"); - setorigin(missile, self.origin); - setsize(missile, '-1 -1 -1', '1 1 1'); -}; - -/* -============ -GremlinWeaponAttack - -attack with a weapon -============ -*/ -void() gremlin_shot1; -void() gremlin_nail1; -void() gremlin_light1; -void() gremlin_rocket1; - -float() GremlinWeaponAttack = -{ - if(!GremlinCheckNoAmmo()) - { - return FALSE; - } - - self.show_hostile = time + 1; // wake monsters up - - if(self.weapon == WID_SHOTGUN) - { - gremlin_shot1(); - Gremlin_FireShotGun(); - SUB_AttackFinished(1); - } - else if(self.weapon == WID_SUPER_SHOTGUN) - { - gremlin_shot1(); - Gremlin_FireSuperShotGun(); - SUB_AttackFinished(1); - } - else if(self.weapon == WID_NAILGUN) - { - gremlin_nail3(); - SUB_AttackFinished(1); - } - else if(self.weapon == WID_SUPER_NAILGUN) - { - gremlin_nail3(); - SUB_AttackFinished(1); - } - else if(self.weapon == WID_GRENADE_LAUNCHER) - { - gremlin_rocket1(); - OgreFireGrenade(); - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; - SUB_AttackFinished(1); - } - else if(self.weapon == WID_ROCKET_LAUNCHER) - { - gremlin_rocket1(); - Gremlin_FireRocket(); - SUB_AttackFinished(1); - } - else if(self.weapon == WID_LIGHTNING) - { - gremlin_light1(); - SUB_AttackFinished(1); - sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); - } - else if(self.weapon == WID_LASER_CANNON) - { - gremlin_laser3(); - SUB_AttackFinished(1); - } - else if(self.weapon == WID_PROXIMITY_GUN) - { - gremlin_rocket1(); - GremlinFireProximityGrenade(); - SUB_AttackFinished(1); - } - - return TRUE; -} - -void() Gremlin_MissileAttack = -{ - if(self.stoleweapon && self.weapon != WID_AXE) - { - if(GremlinWeaponAttack()) - { - return; - } - - if((random()<0.1) && (self.flags & FL_ONGROUND)) - { - gremlin_jump1(); - return; - } - } - - if(self.flags & FL_ONGROUND) - gremlin_jump1(); -} - -/*QUAKED monster_gremlin (1 0 0) (-32 -32 -24) (32 32 64) Ambush - -*/ -void() monster_gremlin = -{ - if(deathmatch) - { - remove(self); - return; - } - - NumGremlins = NumGremlins + 1; - precache_model ("progs/grem.mdl"); - precache_model ("progs/h_grem.mdl"); - - precache_sound("grem/death.wav"); - precache_sound("grem/attack.wav"); - precache_sound("demon/djump.wav"); - precache_sound("demon/dhit2.wav"); - precache_sound("grem/pain1.wav"); - precache_sound("grem/pain2.wav"); - precache_sound("grem/pain3.wav"); - precache_sound("grem/idle.wav"); - precache_sound("grem/sight1.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/grem.mdl"); - - setsize (self, '-12 -12 -18', '12 12 18'); - self.health = 100; - self.max_health = 101; - self.yaw_speed = 40; - - self.th_stand = gremlin_stand1; - self.th_walk = gremlin_walk1; - self.th_run = gremlin_run1; - self.th_die = gremlin_die; - self.th_melee = Gremlin_MeleeAttack; // one of two attacks - self.th_missile = Gremlin_MissileAttack; // check for random jump or firing of weapon - self.th_pain = gremlin_pain; - - walkmonster_start(); -}; - -float() GremlinCheckAttack = -{ - local vector spot1, spot2; - local entity targ; - local float chance; - - targ = self.enemy; - - if(time < self.attack_finished) - return FALSE; - - // see if any entities are in the way of the shot - spot1 = self.origin;// + self.view_ofs; - spot2 = targ.origin;// + targ.view_ofs; - - if((vlen(spot2 - spot1) <= 90) && - (self.stoleweapon == 0 || self.weapon == WID_AXE)) - { - self.attack_state = AS_MELEE; - return TRUE; - } - - // missile attack - chance = 0.03 + self.stoleweapon; - if(random() < chance) - { - self.attack_state = AS_MISSILE; - return TRUE; - } - - return FALSE; -} - - -//=========================================================================== - -void(float side) Gremlin_Melee = -{ - local float ldmg; - local vector delta; - - ai_face(); - - // walkmove (self.ideal_yaw, 12); // allow a little closing - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - - if(!CanDamage (self.enemy, self)) - return; - - sound(self, CHAN_WEAPON, "grem/attack.wav", 1, ATTN_NORM); - ldmg = 10 + 5*random(); - T_Damage (self.enemy, self, self, ldmg); - - makevectors (self.angles); - SpawnMeatSpray (self.origin + v_forward*16, side * v_right); -}; - -//=========================================================================== - -void(float dm) Gremlin_ThrowHead = -{ - local string gibname; - - if(self.classname == "monster_ogre") - gibname = "progs/h_ogre.mdl"; - else if(self.classname == "monster_knight") - gibname = "progs/h_knight.mdl"; - else if(self.classname == "monster_shambler") - gibname = "progs/h_shams.mdl"; - else if(self.classname == "monster_demon1") - gibname = "progs/h_demon.mdl"; - else if(self.classname == "monster_wizard") - gibname = "progs/h_wizard.mdl"; - else if(self.classname == "monster_zombie") - gibname = "progs/h_zombie.mdl"; - else if(self.classname == "monster_dog") - gibname = "progs/h_dog.mdl"; - else if(self.classname == "monster_hell_knight") - gibname = "progs/h_hellkn.mdl"; - else if(self.classname == "monster_enforcer") - gibname = "progs/h_mega.mdl"; - else if(self.classname == "monster_army") - gibname = "progs/h_guard.mdl"; - else if(self.classname == "monster_shalrath") - gibname = "progs/h_shal.mdl"; - else if(self.classname == "monster_gremlin") - gibname = "progs/h_grem.mdl"; - else if(self.classname == "monster_scourge") - gibname = "progs/h_scourg.mdl"; - else if(self.classname == "monster_fish") - gibname = "progs/gib1.mdl"; - else - gibname = "progs/h_player.mdl"; - - ThrowHead(gibname, dm); -} - -//=========================================================================== - -/* -============ -Gremlin_Damage - -The damage is coming from inflictor, but get mad at attacker -============ -*/ -void(entity targ, entity inflictor, entity attacker, float damage) Gremlin_Damage = -{ - // check for godmode or invincibility - if(targ.flags & FL_GODMODE) - { - return; - } - - if(targ.invincible_finished >= time) - { - if(self.invincible_sound < time) - { - sound(targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); - self.invincible_sound = time + 2; - } - - return; - } - - // team play damage avoidance - if( (teamplay == 1) && (targ.team > 0)&&(targ.team == attacker.team) ) - { - return; - } - - // do the damage - targ.health = targ.health - damage; -} - -void() Gremlin_Split = -{ - local entity grem; - local entity temp; - local entity head; - local float done; - local vector ang; - local float c; - local vector pos; - local float proceed; - - if(NumSpawnGremlins >= (NumGremlins*2)) - return; - - done = 0; - c = 0; - ang = self.angles; - while(done == 0) - { - makevectors(ang); - pos = self.origin + (80 * v_forward); - head = findradius(pos, 35); - proceed = 1; - while(head) - { - if((head.health > 0) && (head.flags & (FL_MONSTER | FL_CLIENT))) - proceed = 0; - head = head.chain; - } - traceline(self.origin,pos,FALSE,self); - if(trace_fraction == 1 && (proceed == 1)) - { - traceline(self.origin,(pos-'40 40 0'),FALSE,self); - if(trace_fraction == 1) - { - traceline(self.origin,(pos+'40 40 0'),FALSE,self); - if(trace_fraction == 1) - { - traceline(self.origin,(pos + '0 0 64'),FALSE,self); - if(trace_fraction == 1) - { - traceline(self.origin,(pos - '0 0 64'),FALSE,self); - if(trace_fraction != 1) - { - done = 1; - } - } - } - } - } - if(done == 0) - { - ang_y = ang_y + 36; - c = c + 1; - if(c==10) - { - return; - } - } - } - NumSpawnGremlins = NumSpawnGremlins + 1; - grem = spawn(); - SUB_CopyEntity(self,grem); - grem.solid = SOLID_SLIDEBOX; - grem.movetype = MOVETYPE_STEP; - setmodel (grem, "progs/grem.mdl"); - setsize (grem, '-12 -12 -18', '12 12 18'); - if(self.health < 100) self.health = 100; - grem.health = self.health / 2; - self.health = self.health / 2; - // grem.max_health = 101; - // grem.gorging = FALSE; - grem.stoleweapon = FALSE; - grem.items = 0; - total_monsters = total_monsters + 1; - WriteByte(MSG_BROADCAST, SVC_UPDATESTAT); - WriteByte(MSG_BROADCAST, STAT_TOTALMONSTERS); - WriteLong (MSG_BROADCAST, total_monsters); - setorigin(grem, pos); - temp = self; - self = grem; - gremlin_spawn1(); - self.enemy = world; - self.gorging = FALSE; - self = temp; -} - -void(float side) Gremlin_Gorge = -{ - local float ldmg; - local vector delta; - local entity temp; - - // ai_face(); - // walkmove (self.ideal_yaw, 6); // allow a little closing - - delta = self.enemy.origin - self.origin; - // self.enemy.takedamage = DAMAGE_YES; - - sound(self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); - // sound(self, CHAN_WEAPON, "grem/attack.wav", 1, ATTN_NORM); - ldmg = 7+5*random(); - Gremlin_Damage(self.enemy, self, self, ldmg); - - makevectors(self.angles); - SpawnMeatSpray(self.origin + v_forward*16, side * v_right); - - if(self.enemy.health < -200.0) - { - if(self.enemy.gorging==FALSE) - { - self.enemy.gorging = TRUE; - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - temp = self; - self = self.enemy; - Gremlin_ThrowHead(-15); - // ThrowGib ("progs/gib1.mdl", -15); - // ThrowGib ("progs/gib2.mdl", -15); - // ThrowGib ("progs/gib3.mdl", -15); - self = temp; - ldmg = 150 + 100*random(); - T_Heal(self,ldmg,FALSE); - // if(self.health >= self.max_health) - Gremlin_Split(); - } - - self.enemy = world; - self.gorging = FALSE; - - /* - if(self.stoleweapon) - { - temp = GremlinFindVictim(); - if(temp != world) - { - self.enemy = temp; - FoundTarget(); - self.search_time = time + 1.0; - // return; - } - } - */ - - // FindTarget(); - - /* - if(self.oldenemy.health > 0) - { - self.enemy = self.oldenemy; - HuntTarget(); - } - else - { - if(self.movetarget) - self.th_walk(); - else - self.th_stand(); - } - */ - - gremlin_look1(); - } -}; - - -void() Gremlin_JumpTouch = -{ - if(self.health <= 0) - { - return; - } - - /* - if(other.takedamage) - { - if( vlen(self.velocity) > 400 ) - { - ldmg = 40 + 10*random(); - T_Damage (other, self, self, ldmg); - } - } - */ - - if(!checkbottom(self)) - { - if(self.flags & FL_ONGROUND) - { - self.touch = SUB_Null; - self.think = gremlin_jump1; - self.nextthink = time + 0.1; - } - - return; // not on ground yet - } - - self.touch = SUB_Null; - self.think = gremlin_jump12; - self.nextthink = time + 0.1; -}; - -void() Gremlin_FlipTouch = -{ - if(!checkbottom(self)) - { - if(self.flags & FL_ONGROUND) - { - self.touch = SUB_Null; - self.think = gremlin_flip1; - self.nextthink = time + 0.1; - } - - return; // not on ground yet - } - - self.touch = SUB_Null; - self.think = gremlin_flip8; - self.nextthink = time + 0.1; -} diff --git a/QC/hipholes.qc b/QC/hipholes.qc deleted file mode 100644 index 8c5bd403..00000000 --- a/QC/hipholes.qc +++ /dev/null @@ -1,124 +0,0 @@ -/* Bullet holes QuickC program - By Jim Dose' 11/20/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -/*QUAKED wallsprite (0 1 0) (-8 -8 -8) (8 8 8) -Places a sprite on a wall. Angles should be opposite of face. - -"model" sprite to place on wall. Default is "progs/s_blood1.spr". -*/ -void() wallsprite = - { - if( !self.model ) - { - self.model = "progs/s_blood1.spr"; - } - - precache_model( self.model ); - setmodel (self, self.model ); - - // QuakeEd doesn't save up and down angles properly. - if(self.angles == '0 -1 0') - self.angles = '-90 0 0'; - else if(self.angles == '0 -2 0') - self.angles = '90 0 0'; - - // Pull the sprite away from the wall slightly to - // get rid of z sort errors. - makeforward(self.angles); - setorigin( self, self.origin - ( v_forward * 0.2 ) ); - makestatic (self); - }; - -void() InitBulletHoles = - { - precache_model ("progs/s_bullet.spr"); - - bulletholes = nullentity; - lastbullet = nullentity; - numbulletholes = 0; - lastbulletholeroll = 0; - }; - -void() remove_bullethole = - { - local entity ent; - - // There is a possibility that this is not the first bullet - // in the list, but it doesn't really matter. All that - // matters is there is one less bullet. Just make sure - // we don't remove the world! - if( bulletholes == nullentity ) - { - objerror("remove_bullethole: bulletholes == nullentity! " ); - } - - ent = bulletholes; - if( ent.classname != "bullethole" ) - { - objerror("remove_bullethole: Tried to remove non-bullethole!" ); - } - - bulletholes = bulletholes.lastvictim; - remove( ent ); - if( lastbullet == ent ) - { - lastbullet = nullentity; - } - numbulletholes = numbulletholes - 1; - }; - -void( vector pos ) placebullethole = -{ - local entity new; - local vector norm; - - new = spawn(); - new.owner = new; - new.movetype = MOVETYPE_NONE; - new.solid = SOLID_NOT; - new.classname = "bullethole"; - setmodel( new, "progs/s_bullet.spr" ); - setsize (new, '0 0 0', '0 0 0'); - - norm = trace_plane_normal; - norm_x = 0 - norm_x; - norm_y = 0 - norm_y; - new.angles = vectoangles( norm ); - new.angles_z = lastbulletholeroll; - - lastbulletholeroll = lastbulletholeroll + 35 + 15 * random(); - - if(lastbulletholeroll > 360) - { - lastbulletholeroll = 0; - } - - makeforward_mdl(self.angles); - setorigin( new, pos - ( v_forward * (0.03 + new.angles_z / 450) ) ); - // try to avoid z-fighting for overlapping sprites - - new.think = remove_bullethole; - new.nextthink = time + 250 + (150 * random()); - - numbulletholes = numbulletholes + 1; - if( numbulletholes > 64 ) - { - remove_bullethole(); - } - - if( lastbullet != nullentity ) - { - lastbullet.lastvictim = new; - } - else - { - bulletholes = new; - } - - new.lastvictim = nullentity; - lastbullet = new; -}; diff --git a/QC/hipitems.qc b/QC/hipitems.qc deleted file mode 100644 index ffc606c5..00000000 --- a/QC/hipitems.qc +++ /dev/null @@ -1,882 +0,0 @@ -/* Items QuickC program - By Jim Dose' 9/13/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -float UNDERWATER = 2; - -/* -=============================================================================== - -HIPNOTIC ITEMS - -=============================================================================== -*/ -// -// HIP_powerup_touch function -// -void() HIP_powerup_touch = -{ - if(other.classname != "player") - return; - if(other.health <= 0) - return; - - sprint (other, "You got the "); - sprint (other, self.netname); - sprint (other,"\n"); - - if(deathmatch) - { - self.mdl = self.model; - -// if((self.classname == "item_artifact_invulnerability") || -// (self.classname == "item_artifact_invisibility")) -// self.nextthink = time + 60*5; -// else - self.nextthink = time + 60; - - self.think = SUB_regen; - } - - sound(other, CHAN_VOICE, self.noise, 1, ATTN_NORM); - stuffcmd (other, "bf\n"); - self.solid = SOLID_NOT; - other.hipnotic_items = other.hipnotic_items | self.hipnotic_items; - self.model = string_null; - -// do the apropriate action - if( self.classname == "item_artifact_wetsuit" ) - { - other.wetsuit_time = 1; - other.wetsuit_finished = time + 30; - } - if( self.classname == "item_artifact_empathy_shields" ) - { - other.empathy_time = 1; - other.empathy_finished = time + 30; - } - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets -}; - - -/*QUAKED item_artifact_wetsuit (0 .5 .8) (-16 -16 -24) (16 16 32) -Player takes no damage from electrical attacks and swims faster for 30 seconds -*/ -void() item_artifact_wetsuit = -{ - self.touch = HIP_powerup_touch; - - precache_model ("progs/wetsuit.mdl"); - precache_sound("misc/wetsuit.wav"); - precache_sound("misc/weton.wav"); - precache_sound("items/suit2.wav"); - self.noise = "misc/weton.wav"; - setmodel (self, "progs/wetsuit.mdl"); - self.netname = "Wetsuit"; - self.hipnotic_items = HIP_IT_WETSUIT; - setsize (self, '-16 -16 -24', '16 16 32'); - - StartItem(); -}; - -/* -=============================================================================== -// -// Horn of Conjuring -// -=============================================================================== -*/ - -void() horn_touch = -{ - if(other.classname != "player") - return; - - if(deathmatch) - { - self.mdl = self.model; - - self.nextthink = time + 60; - - self.think = SUB_regen; - } - - self.solid = SOLID_NOT; - self.model = string_null; - sprint (other, "You got the Horn of Conjuring\n"); - sound(other, CHAN_VOICE, self.noise, 1, ATTN_NONE); - stuffcmd (other, "bf\n"); - activator = other; - horn_active = 1; - horn_charmer = other; - SUB_UseTargets(); // fire all targets / killtargets - horn_active = 0; -}; - -/*QUAKED item_hornofconjuring (0 .5 .8) (-16 -16 0) (16 16 32) -Horn of Conjuring. -You must make func_spawn entities connected to this entity -to spawn the charmed creature. -*/ -void() item_hornofconjuring = - { - self.touch = horn_touch; - - precache_model("progs/horn.mdl"); - precache_sound("hipitems/horn.wav"); - setmodel(self, "progs/horn.mdl"); - self.noise = "hipitems/horn.wav"; - setsize (self, '-16 -16 0', '16 16 32'); - StartItem(); - }; - -/*QUAKED item_artifact_empathy_shields (0 .5 .8) (-16 -16 0) (16 16 32) -Empathy Shield. -*/ -void() item_artifact_empathy_shields = - { - self.touch = HIP_powerup_touch; - - precache_model("progs/empathy.mdl"); - precache_sound("hipitems/empathy.wav"); - precache_sound("hipitems/empathy2.wav"); - precache_sound("items/suit2.wav"); - setmodel(self, "progs/empathy.mdl"); - self.noise = "hipitems/empathy.wav"; - self.netname = "Empathy Shields"; - self.hipnotic_items = HIP_IT_EMPATHY_SHIELDS; - setsize (self, '-16 -16 0', '16 16 32'); - StartItem(); - }; -/* -=============================================================================== - -HIPNOTIC WEAPONS - -=============================================================================== -*/ - -/*QUAKED weapon_mjolnir (0 .5 .8) (-16 -16 0) (16 16 32) -*/ - -void() weapon_mjolnir = -{ - precache_model ("progs/g_hammer.mdl"); - setmodel (self, "progs/g_hammer.mdl"); - self.weapon = WID_MJOLNIR; - self.netname = "Mjolnir"; - self.items = IT_MJOLNIR; - self.handtouch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem(); -}; - -/*QUAKED weapon_laser_gun (0 .5 .8) (-16 -16 0) (16 16 32) -*/ - -void() weapon_laser_gun = -{ - precache_model ("progs/g_laserg.mdl"); - setmodel (self, "progs/g_laserg.mdl"); - self.weapon = WID_LASER_CANNON; - self.netname = "Laser Cannon"; - self.items = IT_LASER_CANNON; - self.handtouch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem(); -}; - -/*QUAKED weapon_proximity_gun (0 .5 .8) (-16 -16 0) (16 16 32) -*/ - -void() weapon_proximity_gun = -{ - precache_model ("progs/g_prox.mdl"); - setmodel (self, "progs/g_prox.mdl"); - self.weapon = WID_PROXIMITY_GUN; - self.netname = "Proximity Gun"; - self.items = IT_PROXIMITY_GUN; - self.handtouch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem(); -}; - -/* -=============================================================================== - -HIPNOTIC HAZARDS - -=============================================================================== -*/ - -void() spikemine_Home = - { - local entity head; - local entity selected; - local float cur_dist; - local float head_dist; - local vector dir, vtemp; - - self.frame = self.frame + 1; - if(self.frame==9) self.frame = 0; - self.nextthink = time + 0.2; - self.think = spikemine_Home; - -// look in our immediate vicinity - - if(self.search_time < time) - { - selected = world; - cur_dist = 2000; - head = findradius(self.origin, 2000); - while(head) - { - if(!(head.flags & FL_NOTARGET) && (head.flags & FL_CLIENT)) - { - if(visible(head) && (head.health > 0)) - { - head_dist = vlen(head.origin-self.origin); - if(head_dist < cur_dist) - { - selected = head; - cur_dist = head_dist; - } - } - } - head = head.chain; - } -// if(selected != world && selected != self.enemy) - if(selected != world) - sound(self, CHAN_VOICE, "hipitems/spikmine.wav", 1, ATTN_NORM); - self.enemy = selected; - self.search_time = time + 1.3; - } - if(self.enemy == world) - { - sound(self, CHAN_VOICE, "misc/null.wav", 1, ATTN_NORM); - self.velocity = '0 0 0'; - return; - } - vtemp = self.enemy.origin + '0 0 10'; - dir = normalize(vtemp - self.origin); - if(infront(self.enemy)) - { - self.velocity = dir * ((skill*50) + 50); - } - else - { - self.velocity = dir * ((skill*50) + 150); - } - }; - -void() spikemine_Touch = - { - if(self.health>0) - { - if(other.classname == "trap_spike_mine") - return; - if(other.classname == "missile") - return; - if(other.classname == "grenade") - return; - if(other.classname == "hiplaser") - return; - if(other.classname == "proximity_grenade") - return; - - T_Damage(self,self,self,self.health+10); -// killed_monsters = killed_monsters + 1; -// WriteByte(MSG_ALL, SVC_KILLEDMONSTER); - } -// self.effects = self.effects | EF_MUZZLEFLASH; - - T_RadiusDamage (self, self, 110, world); - sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - sound(self, CHAN_VOICE, "misc/null.wav", 1, ATTN_NORM); - self.velocity = '0 0 0'; - self.touch = SUB_Null; - setmodel (self, "progs/s_explod.spr"); - self.solid = SOLID_NOT; - s_explode1(); - }; - -/* -spike_mine_first_think -*/ - -void() spike_mine_first_think = - { - self.think = spikemine_Home; - self.nextthink = time + 0.1; - self.search_time = 0; - self.takedamage = DAMAGE_AIM; - self.use = monster_use; - }; - -/*QUAKED trap_spike_mine (0 .5 .8) (-16 -16 0) (16 16 32) -*/ - -void() trap_spike_mine = - { - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/spikmine.mdl"); - precache_sound("weapons/r_exp3.wav"); - precache_sound("hipitems/spikmine.wav"); - precache_sound("misc/null.wav"); - setmodel (self, "progs/spikmine.mdl"); -// setmodel (self, "progs/spike.mdl"); - setsize (self, self.mins, self.maxs); - self.classname = "trap_spike_mine"; - self.solid = SOLID_BBOX; - self.movetype = MOVETYPE_FLYMISSILE; -// setsize (self, '0 0 0', '0 0 0'); -// self.avelocity = '-100 100 -100'; - self.avelocity = '-50 100 150'; - if(cvar("skill") <= 1) - self.health = 200; - else - self.health = 400; - self.frame = 0; - self.think = spike_mine_first_think; - self.touch = spikemine_Touch; - self.th_die = spikemine_Touch; - self.th_stand = spikemine_Home; - self.th_walk = spikemine_Home; - self.th_run = spikemine_Home; - self.th_melee = spikemine_Home; - self.th_missile = spikemine_Home; - self.nextthink = time + 0.2; - total_monsters = total_monsters + 1; - self.flags = self.flags | FL_MONSTER; - self.deathtype = "was blasted by a spike mine"; - }; - -//============================================================================ -float LIGHTNING_RANDOM = 1; -float LIGHTNING_BOOM = 2; - -void() SpawnLightningThink = - { - if(time > self.delay) - { - remove(self); - return; - } - self.think = SpawnLightningThink; - if(checkclient()) - { - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LIGHTNING2); - WriteEntity(MSG_BROADCAST, self); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - WriteCoord(MSG_BROADCAST, self.oldorigin_x); - WriteCoord(MSG_BROADCAST, self.oldorigin_y); - WriteCoord(MSG_BROADCAST, self.oldorigin_z); - } - LightningDamage(self.origin, self.oldorigin, self.lastvictim, self.dmg); - self.nextthink = time + 0.1; - }; - -void() trap_lightning_use = - { - local vector p1, p2; - local vector dir; - local float dst; - local float remainder; - - if(time >= self.pausetime) - { - if(self.spawnflags & LIGHTNING_BOOM) - sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); - else - sound(self, CHAN_AUTO, "weapons/lhit.wav", 1, ATTN_NORM); - if(self.classname == "trap_lightning_triggered") - self.pausetime = time + 0.1; - } - if(self.target) - { - p1 = self.origin; - p2 = self.enemy.origin; - } - else - { - makevectors (self.angles); - self.movedir = v_forward; - traceline(self.origin, self.origin + self.movedir*600, TRUE, self); - p1 = self.origin; - p2 = trace_endpos; - } - // fix up both ends of the lightning - // lightning bolts are 30 units long each - dir = normalize( p2-p1 ); - dst = vlen(p2-p1); - dst = dst / 30.0; - remainder = dst - floor(dst); - if(remainder > 0) - { - remainder = remainder - 1; - // split half the remainder with the front and back - remainder = remainder * 15; - p1 = p1 + (remainder*dir); - p2 = p2 - (remainder*dir); - } - if(self.duration > 0.1) - { - local entity temp; - - temp = self; - self = spawn(); - self.origin = p1; - self.oldorigin = p2; - self.lastvictim = temp; - self.dmg = temp.dmg; - self.delay = time + temp.duration; - SpawnLightningThink(); - self = temp; - } - else if(checkclient()) - { - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LIGHTNING2); - WriteEntity(MSG_BROADCAST, self); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, p1_x); - WriteCoord(MSG_BROADCAST, p1_y); - WriteCoord(MSG_BROADCAST, p1_z); - WriteCoord(MSG_BROADCAST, p2_x); - WriteCoord(MSG_BROADCAST, p2_y); - WriteCoord(MSG_BROADCAST, p2_z); - LightningDamage(p1, p2, self, self.dmg); - } - else - LightningDamage(p1, p2, self, self.dmg); - }; - -void() lightning_think = - { - local float timedelay; - - if(self.state) - { - trap_lightning_use(); - } - if(self.cnt == 0) - { - if(self.spawnflags & LIGHTNING_RANDOM) - { - timedelay = self.wait*random(); - } - else - { - timedelay = self.wait; - } - self.cnt = 1; - self.t_length = time + self.duration - 0.1; - self.pausetime = time + self.duration - 0.1; - if(self.pausetime < time + 0.3) - self.pausetime = time + 0.3; - if(timedelay < self.duration) - timedelay = self.duration; - self.t_width = time + timedelay; - } - if(time >= self.t_length) - { - self.cnt = 0; - self.nextthink = self.t_width; - } - else - { - self.nextthink = time + 0.2; - } - }; - -void() lightning_firstthink = - { - local entity targ; - if(self.target) - { - targ = find(world,targetname,self.target); - self.dest = targ.origin; - self.enemy = targ; - } - self.think = SUB_Null; - self.nextthink = 0; - if(self.classname != "trap_lightning_triggered") - { - self.nextthink = self.huntingcharmer + self.wait + self.ltime; - self.think = lightning_think; - } - }; - -/*QUAKED trap_lightning_triggered (0 .5 .8) (-8 -8 -8) (8 8 8) random boom -When triggered, fires lightning in the direction set in QuakeEd. -"wait" how long to wait between blasts (1.0 default) - if in random mode wait is multiplied by random -"dmg" how much damage lightning should inflict (30 default) -"duration" how long each lightning attack should last (0.1 default) -*/ - -void() trap_lightning_triggered = - { - if(self.wait == 0) - self.wait = 1.0; - if(self.dmg == 0) - self.dmg = 30; - if(self.duration == 0) - self.duration = 0.1; - self.cnt = 0; - self.use = trap_lightning_use; - precache_sound("weapons/lhit.wav"); - precache_sound("weapons/lstart.wav"); - self.huntingcharmer = self.nextthink; - self.think = lightning_firstthink; - self.nextthink = time + 0.25; - self.deathtype = "is electrocuted"; - }; - - -/*QUAKED trap_lightning (0 .5 .8) (-8 -8 -8) (8 8 8) random boom -Continuously fire lightning. -"wait" how long to wait between blasts (1.0 default) - if in random mode wait is multiplied by random -"nextthink" delay before firing first lightning, so multiple traps can be stagered. -"dmg" how much damage lightning should inflict (30 default) -"duration" how long each lightning attack should last (0.1 default) -*/ -void() trap_lightning = - { - trap_lightning_triggered(); - self.state = 1; - }; - -void() trap_lightning_switched_use = - { - self.state = 1 - self.state; - if(self.state == 1) - self.nextthink = self.huntingcharmer; - }; -/*QUAKED trap_lightning_switched (0 .5 .8) (-8 -8 -8) (8 8 8) random boom -Continuously fires lightning. -"wait" how long to wait between blasts (1.0 default) - if in random mode wait is multiplied by random -"nextthink" delay before firing first lightning, so multiple traps can be stagered. -"dmg" how much damage lightning should inflict (30 default) -"duration" how long each lightning attack should last (0.1 default) -"state" 0 (default) initially off, 1 initially on. -*/ -void() trap_lightning_switched = - { - trap_lightning_triggered(); - self.use = trap_lightning_switched_use; - }; - - -entity tesla_target; -float tesla_numtargets; -void() trap_tesla_scan = - { - local entity head; - local entity prev; - -// look in our immediate vicinity - - tesla_numtargets = 0; - head = findradius(self.origin, self.distance); - while(head) - { - if(!(head.flags & FL_NOTARGET) && (head.flags & self.cnt)) - { - if(visible(head) && (head.health > 0) && (head.struck_by_mjolnir==0)) - { - if(tesla_numtargets == 0) - { - tesla_target = head; - } - else - { - prev.next_ent = head; - } - tesla_numtargets = tesla_numtargets + 1; - prev = head; - if(tesla_numtargets==self.count) - return; - } - } - head = head.chain; - } - }; - -void() TeslaLightningThink = - { - self.owner.attack_state = 2; - if(time > self.delay) - { - self.enemy.struck_by_mjolnir = 0; - remove(self); - return; - } - traceline(self.origin, self.enemy.origin, TRUE, self); - - if(trace_fraction != 1.0 || self.enemy.health<=0 || vlen(self.origin-self.enemy.origin) > (self.distance+10)) - { - self.enemy.struck_by_mjolnir = 0; - remove(self); - return; - } - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LIGHTNING2); - WriteEntity(MSG_BROADCAST, self); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - WriteCoord(MSG_BROADCAST, trace_endpos_x); - WriteCoord(MSG_BROADCAST, trace_endpos_y); - WriteCoord(MSG_BROADCAST, trace_endpos_z); - LightningDamage(self.origin, trace_endpos, self.lastvictim, self.dmg); - self.nextthink = time + 0.1; - }; - -void(entity targ) SpawnTeslaLightning = - { - local entity lgt; - // spawn actual lightning - lgt = spawn(); - if(self.duration>0) - { - lgt.delay = time + self.duration; - } - else - { - lgt.delay = time + 9999; - } - lgt.enemy = targ; - targ.struck_by_mjolnir = 1; - lgt.distance = self.distance; - lgt.owner = self; - lgt.lastvictim = self.lastvictim; - lgt.dmg = self.dmg; - lgt.origin = self.origin; - lgt.think = TeslaLightningThink; - lgt.nextthink = time; - lgt.deathtype = self.deathtype; - }; - -void() trap_tesla_think = - { - if(self.state == 0) - { - self.nextthink = time + 0.25; - return; - } - if(self.attack_state == 0) - { - self.think = trap_tesla_think; - trap_tesla_scan(); - if(tesla_numtargets > 0) - { - if(self.wait > 0) - sound(self, CHAN_AUTO, "misc/tesla.wav", 1, ATTN_NORM); - self.attack_state = 1; - self.nextthink = time + self.wait; - return; - } - self.nextthink = time + 0.25; - if(self.delay > 0) - { - if(time > self.search_time) - { - self.attack_state = 3; - } - } - } - else if(self.attack_state == 1) - { - trap_tesla_scan(); - while(tesla_numtargets > 0) - { - sound(self, CHAN_AUTO, "hipweap/mjolhit.wav", 1, ATTN_NORM); - SpawnTeslaLightning (tesla_target); - tesla_target = tesla_target.next_ent; - tesla_numtargets = tesla_numtargets - 1; - } - self.attack_state = 2; - self.nextthink = time + 1; - } - else if(self.attack_state == 2) - { - self.attack_state = 3; - self.nextthink = time + 0.2; - } - else if(self.attack_state == 3) - { - self.attack_state = 0; - self.nextthink = time + 0.1; - if(self.classname == "trap_gods_wrath") - { - self.nextthink = -1; - } - } - }; - -/*QUAKED trap_tesla_coil (0 .5 .8) (-8 -8 -8) (8 8 8) targetenemies -targets enemies in vicinity and fires at them -"wait" how long build up should be (2 second default) -"dmg" how much damage lightning should inflict (2 + 5*skill default) -"duration" how long each lightning attack should last (continuous default) -"distance" how far the tesla coil should reach (600 default) -"state" on/off for the coil (0 default is off) -"count" number of people to target (2 default) -*/ -void() trap_tesla_coil = - { - precache_sound("misc/tesla.wav"); - precache_sound("hipweap/mjolhit.wav"); // lightning sound - if(self.wait == 0) - self.wait = 2; - if(self.dmg == 0) - self.dmg = 2 + (5*cvar("skill")); - if(self.duration == 0) - self.duration = -1; - if(self.distance == 0) - self.distance = 600; - if(self.spawnflags & 1) - self.cnt = FL_CLIENT | FL_MONSTER; - else - self.cnt = FL_CLIENT; - self.use = trap_lightning_switched_use; - if(self.delay == 0) - self.delay = -1; - self.nextthink = time + random(); - self.think = trap_tesla_think; - self.lastvictim = world; - tesla_numtargets = 0; - self.attack_state = 0; - self.deathtype = "is electrocuted"; - }; - -void() trap_gods_wrath_use = - { - if(self.attack_state==0) - { - self.search_time = time + self.delay; - self.lastvictim = activator; - trap_tesla_think(); - } - }; - -/*QUAKED trap_gods_wrath (0 .5 .8) (-8 -8 -8) (8 8 8) targetenemies -targets enemies in vicinity and fires at them -"dmg" how much damage lightning should inflict (5 default) -"duration" how long each lightning attack should last (continuous default) -"distance" how far god's wrath should reach (600 default) -"delay" how long to wait until god calms down - this is only needed if no one is targetted (5 seconds default) -"count" number of people to target (2 default) -*/ -void() trap_gods_wrath = - { - if(self.delay == 0) - self.delay = 5; - trap_tesla_coil(); - self.wait = 0; - self.state = 1; - self.nextthink = -1; - self.deathtype = "suffers the wrath of God"; -// self.attack_state = 1; - self.use = trap_gods_wrath_use; - }; - -void() trap_gravity_touch = - { - if( self.attack_finished > time ) - return; - - if(other.takedamage) - { - T_Damage (other, self, self, self.dmg ); - self.attack_finished = time + 0.2; - } - }; - -void() trap_gravity_think = - { - local vector vel; - local vector dir; - local vector delta; - - self.ltime = time; - trap_tesla_scan(); - while(tesla_numtargets > 0) - { - delta = self.origin - tesla_target.origin; - dir = normalize( delta ); - vel = dir * self.speed; - if( ( tesla_target.wetsuit_finished > time ) && - ( self.spawnflags & UNDERWATER ) ) - { - vel = vel * 0.6; - } - - tesla_target.velocity = tesla_target.velocity + vel; - tesla_target = tesla_target.next_ent; - tesla_numtargets = tesla_numtargets - 1; - } - self.nextthink = time + 0.1; - }; - -/*QUAKED trap_gravity_well (.8 .5 0) (-8 -8 -8) (8 8 8) targetenemies UNDERWATER -targets enemies in vicinity and draws them near, gibbing them on contact. - -UNDERWATER cuts the pull in half for players wearing the wetsuit - -"distance" how far the gravity well should reach (600 default) -"count" number of people to target (2 default) -"speed" is how strong the pull is. (210 default) -"dmg" is how much damage to do each touch. (10000 default) -*/ -void() trap_gravity_well = - { - self.solid = SOLID_TRIGGER; - self.movetype = MOVETYPE_NONE; - setsize( self, '-16 -16 -16','16 16 16'); - if( self.dmg == 0 ) - { - self.dmg = 10000; - } - if( self.speed == 0 ) - self.speed = 210; - if(self.distance == 0) - self.distance = 600; - if(self.spawnflags & 1) - self.cnt = FL_CLIENT | FL_MONSTER; - else - self.cnt = FL_CLIENT; - - self.attack_finished = 0; - self.think = trap_gravity_think; - self.touch = trap_gravity_touch; - self.lastvictim = world; - tesla_numtargets = 0; - self.nextthink = time + 0.1; - self.ltime = time; - }; diff --git a/QC/hipmisc.qc b/QC/hipmisc.qc deleted file mode 100644 index 1994c3bd..00000000 --- a/QC/hipmisc.qc +++ /dev/null @@ -1,554 +0,0 @@ -/* Miscelanneous QuickC program - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -void() play_sound_use = - { - if(self.spawnflags & 1) - { - if(self.state == 0) - { - self.state = 1; - sound(self, self.impulse, self.noise, self.volume, self.speed); - } - else - { - self.state = 0; - sound(self, self.impulse, "misc/null.wav", self.volume, self.speed); - } - } - else - { - sound(self, self.impulse, self.noise, self.volume, self.speed); - } - }; - -void() PlaySoundThink = - { - local float t; - t = self.wait * random(); - if(t < self.delay) - t = self.delay; - self.nextthink = time + t; - play_sound_use(); - }; - -/*QUAKED play_sound_triggered (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) toggle -play a sound when it is used -"toggle" determines whether sound should be stopped when triggered again -"volume" how loud (1 default full volume) -"noise" sound to play -"impulse" channel on which to play sound(0-7) (0 automatic is default) -"speed" attenuation factor - -1 - no attenuation - 1 - normal - 2 - idle - 3 - static -*/ -void() play_sound_triggered = - { - precache_sound(self.noise); - precache_sound("misc/null.wav"); - if(self.volume == 0) - self.volume = 1; - if(self.speed == 0) - self.speed = 1; - if(self.speed == -1) - self.speed = 0; - if(self.spawnflags & 1) - if(self.impulse == 0) - self.impulse = 7; - self.use = play_sound_use; - }; - -/*QUAKED play_sound(0.3 0.1 0.6) (-8 -8 -8) (8 8 8) -play a sound on a periodic basis -"volume" how loud (1 default full volume) -"noise" sound to play -"wait" random time between sounds (default 20) -"delay" minimum delay between sounds (default 2) -"impulse" channel on which to play sound(0-7) (0 automatic is default) -"speed" attenuation factor - -1 - no attenuation - 1 - normal - 2 - idle - 3 - static -*/ -void() play_sound = - { - local float t; - - play_sound_triggered(); - if(self.wait == 0) - self.wait = 20; - if(self.delay == 0) - self.delay = 2; - self.think = PlaySoundThink; - t = self.wait * random(); - if(t < self.delay) - t = self.delay; - self.nextthink = time + t; - }; - -/*QUAKED random_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) -"wait" random time between strikes (default 20) -"delay" minimum delay between strikes (default 2) -"volume" how loud (1 default full volume) -"speed" attenuation factor - -1 - no attenuation - 1 - normal - 2 - idle - 3 - static -*/ -void() random_thunder = - { - self.noise = "ambience/thunder1.wav"; - play_sound(); - self.impulse = 6; - }; - -/*QUAKED random_thunder_triggered (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) toggle -"toggle" determines whether sound should be stopped when triggered again -"volume" how loud (1 default full volume) -"speed" attenuation factor - -1 - no attenuation - 1 - normal - 2 - idle - 3 - static -*/ -void() random_thunder_triggered = - { - self.noise = "ambience/thunder1.wav"; - play_sound_triggered(); - self.impulse = 6; - }; - -/*QUAKED ambient_humming (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - "volume" how loud it should be (0.5 is default) -*/ -void() ambient_humming = -{ - if(self.volume==0) - self.volume = 0.5; - precache_sound("ambient/humming.wav"); - ambientsound(self.origin, "ambient/humming.wav", self.volume, ATTN_STATIC); -}; - -/*QUAKED ambient_rushing (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - "volume" how loud it should be (0.5 is default) -*/ -void() ambient_rushing = -{ - if(self.volume==0) - self.volume = 0.5; - precache_sound("ambient/rushing.wav"); - ambientsound(self.origin, "ambient/rushing.wav", self.volume, ATTN_STATIC); -}; - -/*QUAKED ambient_running_water (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - "volume" how loud it should be (0.5 is default) -*/ -void() ambient_running_water = -{ - if(self.volume==0) - self.volume = 0.5; - precache_sound("ambient/runwater.wav"); - ambientsound(self.origin, "ambient/runwater.wav", self.volume, ATTN_STATIC); -}; - -/*QUAKED ambient_fan_blowing (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - "volume" how loud it should be (0.5 is default) -*/ -void() ambient_fan_blowing = -{ - if(self.volume==0) - self.volume = 0.5; - precache_sound("ambient/fanblow.wav"); - ambientsound(self.origin, "ambient/fanblow.wav", self.volume, ATTN_STATIC); -}; - -/*QUAKED ambient_waterfall (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - "volume" how loud it should be (0.5 is default) -*/ -void() ambient_waterfall = -{ - if(self.volume==0) - self.volume = 0.5; - precache_sound("ambient/waterfal.wav"); - ambientsound(self.origin, "ambient/waterfal.wav", self.volume, ATTN_STATIC); -}; - -/*QUAKED ambient_riftpower (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - "volume" how loud it should be (0.5 is default) -*/ -void() ambient_riftpower = -{ - if(self.volume==0) - self.volume = 0.5; - precache_sound("ambient/riftpowr.wav"); - ambientsound(self.origin, "ambient/riftpowr.wav", self.volume, ATTN_STATIC); -}; - - -/*QUAKED info_command (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - Stuffs a command into the console to allow map designers - to set server variables. - - "message" is the command to send to the console. -*/ - -void() info_command = - { - if( self.message ) - localcmd( self.message ); - }; - -void() effect_teleport_use = - { - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_TELEPORT); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - sound(self, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); - }; - -/*QUAKED effect_teleport (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) - Create a teleport effect when triggered -*/ - -void() effect_teleport = - { - precache_sound("misc/r_tele1.wav"); - self.use = effect_teleport_use; - }; - - -/* -============= -camerathink - -camera think function -============== -*/ -/* -void() camerathink = - { - local entity pl; - local vector d_diff; - local vector a_diff; - local vector p; - local vector a; - local float dist; - local float timeelapsed; - - timeelapsed = (time - self.cnt) * self.duration; - if( timeelapsed > 1 ) - timeelapsed = 1; - - p = self.oldorigin + (timeelapsed * (self.movetarget.origin - self.oldorigin)); - d_diff = p - self.origin; - - a = self.mangle + (timeelapsed * (self.movetarget.mangle - self.mangle)); - a_diff = a - self.angles; - - self.origin = self.origin + self.pos1 + (1.0 * d_diff); - self.angles = self.v_angle = self.angles + self.avelocity + (1.0 * a_diff); - - self.nextthink = time + 0.1; - }; -*/ -/* -============= -camerachase - -camera chase function -============== -*/ -/* -void() camerachase = - { - local float timeelapsed; - local vector v; - local vector a; - - - timeelapsed = time - self.cnt; - if( timeelapsed > 1 ) - timeelapsed = 1; - self.cnt = time; - - self.velocity = (self.movetarget.origin - self.oldorigin)*(1/timeelapsed); - self.oldorigin = self.movetarget.origin; - if(self.state == 0) // setup - { - self.velocity = '0 0 0'; - self.cnt = time; - } - // calculate new camera position - a = '0 0 0'; - a_y = vectoyaw( normalize( self.movetarget.origin - self.movetarget.movetarget.origin) ); - makevectors(a); - self.origin = self.movetarget.origin + v_forward * self.distance; - self.origin_z = self.origin_z + self.height; - - v = normalize( self.movetarget.origin - self.origin ); - a = self.angles; - a_y = vectoyaw(v); - v_x = v_y; - v_y = 0 - v_z; - a_x = vectoyaw(v); - self.angles = a; -// SetViewPoint(self, self); -// UpdateCamera(self, self); - SetViewAngle(self, a); - - self.think = camerachase; - self.nextthink = time + 0.1; - }; -*/ - -/* -============= -camerafollow - -camera follow function -============== -*/ -/* -void() camerafollow = - { - local vector v; - local vector a; - - v = normalize( self.movetarget.origin - self.origin ); - a = self.angles; - a_y = vectoyaw(v); - v_x = v_y; - v_y = 0 - v_z; - a_x = vectoyaw(v); - self.angles = a; - SetViewAngle(self, a); - - self.think = camerafollow; - self.nextthink = time + 0.01; - }; -*/ -/* -============= -t_cameratarget - -a camera has reached a path trigger -============== -*/ -/* -void() t_cameratarget = -{ -local entity temp; - - if(other.movetarget != self) - return; - - temp = self; - self = other; - other = temp; - - self.angles = self.movetarget.mangle; - self.movetarget = find (world, targetname, other.target); - if(!self.movetarget) - { - self.nextthink = time + 999999; - } - else - { - local vector d_diff; - local vector a_diff; - local float t; - - self.think = camerathink; - self.duration = 1 / other.duration; - self.cnt = time; - - self.oldorigin = self.origin; - d_diff = self.movetarget.origin - self.oldorigin; - self.pos1 = d_diff*self.duration; - - self.mangles = self.angles; - a_diff = self.movetarget.mangle - self.mangle; - self.avelocity = a_diff*self.duration; - if(other.delay) - { - self.nextthink = time + other.delay; - self.cnt = time + other.delay; - } - } -}; -*/ - -/*QUAKED path_camera (0.5 0.3 0) (-8 -8 -8) (8 8 8) -path for a camera -"delay" delay to wait before proceeding to next segment; -"mangle" position the camera should be when it gets here -"duration" how long it should take to cover the distance - (default 10 seconds) -*/ -/* -void() path_camera = -{ - self.solid = SOLID_TRIGGER; - self.touch = t_cameratarget; - if(!self.duration) - self.duration = 10; - setsize (self, '-8 -8 -8', '8 8 8'); -}; -*/ -float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80 -void(entity me, entity camera) UpdateCamera = -{ - msg_entity = me; // target of message - WriteByte(MSG_ONE, SVC_UPDATEENTITY|15); // 0x80|1|2|4|8 - WriteByte(MSG_ONE, 64); // 0x40 - WriteEntity(MSG_ONE,camera); - WriteCoord(MSG_ONE,camera.origin_x); - WriteCoord(MSG_ONE,camera.origin_y); - WriteCoord(MSG_ONE,camera.origin_z); -}; - - -//void() effect_finale_think = -// { -// self.flags = self.flags - (self.flags & FL_ONGROUND); -// self.angles = self.mangle; -// self.v_angle = self.mangle; -// self.fixangle = TRUE; -// NezuUpdateCamera(self,self.trigger_field); -// NezuSetViewPoint(self,self.trigger_field); -// NezuSetViewAngle(self,self.mangle); -// self.think = effect_finale_think; -// self.nextthink = time + 0.05; -// }; - - -void() effect_finale_use = -{ - local entity pos, pl, targ; - - if(self.state == 1) - return; - -// intermission_exittime = time + 10000000; // never allow exit -// intermission_running = 1; - self.state = 1; - - // find the intermission spot - pos = find (world, targetname, self.target); - if(!pos) - error ("no target in finale"); - -// WriteByte(MSG_ALL, SVC_FINALE); - WriteByte(MSG_ALL, SVC_CUTSCENE); - WriteString (MSG_ALL, ""); - - //setup decoy - if(!self.spawnflags & 2) - { - if(self.spawnflags & 1) - { - pl = find (world, classname, "player"); - targ = find (world, targetname, self.mdl); - become_decoy( targ.target, pl.origin ); - } - else - { - targ = find (world, targetname, self.mdl); - become_decoy( targ.target, targ.origin ); - } - } - - pl = find (world, classname, "player"); - while(pl != world) - { - pl.view_ofs = '0 0 0'; - pl.angles = other.v_angle = pos.mangle; - pl.mangle = pos.mangle; - pl.fixangle = TRUE; // turn this way immediately - pl.trigger_field = self; - pl.nextthink = time + 0.5; - pl.takedamage = DAMAGE_NO; - pl.solid = SOLID_NOT; - pl.movetype = MOVETYPE_NONE; - pl.modelindex = 0; - setorigin (pl, pos.origin); - pl.origin = pos.origin; - pl.oldorigin = pos.origin; - UpdateCamera(pl,pl); - UpdateCamera(pl,pl.trigger_field); - pl = find (pl, classname, "player"); - } - - // wait for next sequence - if(self.spawnfunction) - { - self.nextthink = time + self.wait; - self.think = self.spawnfunction; - } -// intermission_running = 0; -}; -/* - "count" 0 - static camera - 1 - path camera - 2 - chase camera - "distance" distance from chase guy - (default 100) - "height" height distance from chase guy - (default 64) -*/ - -/*QUAKED effect_finale (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) useplayer nodecoy - start the finale sequence - "target" the camera to go to. - "mdl" if useplayer is specified, this is a - path corner with target of the next - path_corner to run to. - if use player isn't specified this becomes - the spawn point as well. - "spawnfunction" next routine to run - "delay" time to wait until running routine - useplayer - use the current player as - decoy location. - nodecoy - no decoy, only the camera -*/ - -void() effect_finale = - { - if(deathmatch) - { - remove(self); - return; - } - setorigin(self,self.origin); - self.angles = self.mangle; - self.use = effect_finale_use; -// setsize(self,'-16 -16 -16','16 16 16'); -// self.touch = effect_finale_use; -// InitTrigger(); - self.state = 0; - }; - -void() info_startendtext_use = - { - intermission_running = 1; - ExitIntermission(); - }; - -/*QUAKED info_startendtext (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) - start the end text -*/ - -void() info_startendtext = - { - self.use = info_startendtext_use; - }; diff --git a/QC/hipquake.qc b/QC/hipquake.qc deleted file mode 100644 index 04eab482..00000000 --- a/QC/hipquake.qc +++ /dev/null @@ -1,84 +0,0 @@ -/* Earthquake QuickC program - By Jim Dose' 9/13/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ -//JIM -float earthquake; -float quakeactive; - -void() StopEarthQuake = - { - earthquake = 0; - }; - -void( float value ) EarthQuakeTime = - { - value = value + time; - if( value > earthquake ) - { - earthquake = value; - } - }; - -void() earthquake_prethink = - { -// if( lastearthquake ) -// { -// self.view_ofs_z = self.savedz; -// lastearthquake = 0; -// } - }; - -void() earthquake_postthink = - { - if( earthquake > time ) - { - if(quakeactive == 0) - { - sound(self, CHAN_VOICE, "misc/quake.wav", 1, ATTN_NONE); - quakeactive = 1; - } -// lastearthquake = 1; -// self.savedz = self.view_ofs_z; - if( self.flags & FL_ONGROUND ) - { -// self.view_ofs_z = self.view_ofs_z - 5 + random() * 10; - self.velocity = self.velocity + (random() * '0 0 150'); - } - } - else - { - if(quakeactive == 1) - { - sound(self, CHAN_VOICE, "misc/quakeend.wav", 1, ATTN_NONE); - quakeactive = 0; - } - } - }; - -void() earthquake_use = - { - EarthQuakeTime( self.dmg ); - }; - -/*QUAKED func_earthquake (0 0 0.5) (0 0 0) (32 32 32) -Causes an earthquake. Triggers targets. - -"dmg" is the duration of the earthquake. Default is 0.8 seconds. -*/ - -void() func_earthquake = - { - quakeactive = 0; - precache_sound("misc/quake.wav"); - precache_sound("misc/quakeend.wav"); - self.classname = "earthquake"; - self.use = earthquake_use; - self.think = SUB_Null; - if( !self.dmg ) - { - self.dmg = 0.8; - } - }; diff --git a/QC/hiprot.qc b/QC/hiprot.qc deleted file mode 100644 index f2e4b0d1..00000000 --- a/QC/hiprot.qc +++ /dev/null @@ -1,1122 +0,0 @@ -/* Rotate QuickC program - By Jim Dose' 10/17/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -float STATE_ACTIVE = 0; -float STATE_INACTIVE = 1; -float STATE_SPEEDINGUP = 2; -float STATE_SLOWINGDOWN = 3; - -float STATE_CLOSED = 4; -float STATE_OPEN = 5; -float STATE_OPENING = 6; -float STATE_CLOSING = 7; - -float STATE_WAIT = 0; -float STATE_MOVE = 1; -float STATE_STOP = 2; -float STATE_FIND = 3; -float STATE_NEXT = 4; - -float OBJECT_ROTATE = 0; -float OBJECT_MOVEWALL = 1; -float OBJECT_SETORIGIN = 2; - -float TOGGLE = 1; -float START_ON = 2; - -float ROTATION = 1; -float ANGLES = 2; -float STOP = 4; -float NO_ROTATE = 8; -float DAMAGE = 16; -float MOVETIME = 32; -float SET_DAMAGE = 64; - -float VISIBLE = 1; -float TOUCH = 2; -float NONBLOCKING = 4; - -float STAYOPEN = 1; - -/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) -Used as the point of rotation for rotatable objects. -*/ -void() info_rotate = -{ -// remove self after a little while, to make sure that entities that -// have targeted it have had a chance to spawn - self.nextthink = time + 2; - self.think = SUB_Remove; -}; - -void() RotateTargets = - { - local entity ent; - local vector vx; - local vector vy; - local vector vz; - local vector org; - - makevectors (self.angles); - - ent = find( world, targetname, self.target); - while( ent ) - { - if( ent.rotate_type == OBJECT_SETORIGIN ) - { - org = ent.oldorigin; - vx = ( v_forward * org_x ); - vy = ( v_right * org_y ); - vy = vy * -1; - vz = ( v_up * org_z ); - ent.neworigin = vx + vy + vz; - setorigin( ent, ent.neworigin + self.origin ); - } - else if( ent.rotate_type == OBJECT_ROTATE ) - { - ent.angles = self.angles; - org = ent.oldorigin; - vx = ( v_forward * org_x ); - vy = ( v_right * org_y ); - vy = vy * -1; - vz = ( v_up * org_z ); - ent.neworigin = vx + vy + vz; - setorigin( ent, ent.neworigin + self.origin ); - } - else - { - org = ent.oldorigin; - vx = ( v_forward * org_x ); - vy = ( v_right * org_y ); - vy = vy * -1; - vz = ( v_up * org_z ); - ent.neworigin = vx + vy + vz; - ent.neworigin = self.origin - self.oldorigin + (ent.neworigin - ent.oldorigin); - ent.velocity = (ent.neworigin-ent.origin)*25; - } - ent = find( ent, targetname, self.target); - } - }; - -void() RotateTargetsFinal = - { - local entity ent; - - ent = find( world, targetname, self.target); - while( ent ) - { - ent.velocity = '0 0 0'; - if( ent.rotate_type == OBJECT_ROTATE ) - { - ent.angles = self.angles; - } - ent = find( ent, targetname, self.target); - } - }; - -void() SetTargetOrigin = - { - local entity ent; - - ent = find( world, targetname, self.target); - while( ent ) - { - if( ent.rotate_type == OBJECT_MOVEWALL ) - { - setorigin( ent, self.origin - self.oldorigin + - (ent.neworigin - ent.oldorigin) ); - } - else - { - setorigin( ent, ent.neworigin + self.origin ); - } - ent = find( ent, targetname, self.target); - } - }; - -void() LinkRotateTargets = - { - local entity ent; - local vector tempvec; - - self.oldorigin = self.origin; - ent = find( world, targetname, self.target); - while( ent ) - { - if( ent.classname == "rotate_object" ) - { - ent.rotate_type = OBJECT_ROTATE; - ent.oldorigin = ent.origin - self.oldorigin; - ent.neworigin = ent.origin - self.oldorigin; - ent.owner = self; - } - else if( ent.classname == "func_movewall" ) - { - ent.rotate_type = OBJECT_MOVEWALL; - tempvec = ( ent.absmin + ent.absmax ) * 0.5; - ent.oldorigin = tempvec - self.oldorigin; - ent.neworigin = ent.oldorigin; - ent.owner = self; - } - else - { - ent.rotate_type = OBJECT_SETORIGIN; - ent.oldorigin = ent.origin - self.oldorigin; - ent.neworigin = ent.origin - self.oldorigin; - } - ent = find (ent, targetname, self.target); - } - }; - -void( float amount ) SetDamageOnTargets = - { - local entity ent; - - ent = find( world, targetname, self.target); - while( ent ) - { - if( ent.classname == "trigger_hurt" ) - { - hurt_setdamage( ent, amount ); - } - else if( ent.classname == "func_movewall" ) - { - ent.dmg = amount; - } - ent = find( ent, targetname, self.target); - } - }; - - -//************************************************ -// -// Simple continual rotatation -// -//************************************************ - -void() rotate_entity_think = - { - local float t; - - t = time - self.ltime; - self.ltime = time; - - if( self.state == STATE_SPEEDINGUP ) - { - self.count = self.count + self.cnt * t; - if( self.count > 1 ) - { - self.count = 1; - } - - // get rate of rotation - t = t * self.count; - } - else if( self.state == STATE_SLOWINGDOWN ) - { - self.count = self.count - self.cnt * t; - if( self.count < 0 ) - { - RotateTargetsFinal(); - self.state = STATE_INACTIVE; - self.think = SUB_Null; - return; - } - - // get rate of rotation - t = t * self.count; - } - - self.angles = self.angles + ( self.rotate * t ); - self.angles = SUB_NormalizeAngles( self.angles ); - RotateTargets(); - self.nextthink = time + 0.02; - }; - -void() rotate_entity_use = - { - // change to alternate textures - self.frame = 1 - self.frame; - - if( self.state == STATE_ACTIVE ) - { - if( self.spawnflags & TOGGLE ) - { - if( self.speed ) - { - self.count = 1; - self.state = STATE_SLOWINGDOWN; - } - else - { - self.state = STATE_INACTIVE; - self.think = SUB_Null; - } - } - } - else if( self.state == STATE_INACTIVE ) - { - self.think = rotate_entity_think; - self.nextthink = time + 0.02; - self.ltime = time; - if( self.speed ) - { - self.count = 0; - self.state = STATE_SPEEDINGUP; - } - else - { - self.state = STATE_ACTIVE; - } - } - else if( self.state == STATE_SPEEDINGUP ) - { - if( self.spawnflags & TOGGLE ) - { - self.state = STATE_SLOWINGDOWN; - } - } - else - { - self.state = STATE_SPEEDINGUP; - } - }; - -void() rotate_entity_firstthink = - { - LinkRotateTargets(); - if( self.spawnflags & START_ON ) - { - self.state = STATE_ACTIVE; - self.think = rotate_entity_think; - self.nextthink = time + 0.02; - self.ltime = time; - } - else - { - self.state = STATE_INACTIVE; - self.think = SUB_Null; - } - self.use = rotate_entity_use; - }; - -/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON -Creates an entity that continually rotates. Can be toggled on and -off if targeted. - -TOGGLE = allows the rotation to be toggled on/off - -START_ON = wether the entity is spinning when spawned. If TOGGLE is 0, entity can be turned on, but not off. - -If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train. - -"rotate" is the rate to rotate. -"target" is the center of rotation. -"speed" is how long the entity takes to go from standing still to full speed and vice-versa. -*/ - -void() func_rotate_entity = - { - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - - setmodel (self, self.model); - setsize( self, self.mins, self.maxs ); - - if( self.speed != 0 ) - { - self.cnt = 1 / self.speed; - } - - self.think = rotate_entity_firstthink; - self.nextthink = time + 0.1; - self.ltime = time; - }; - -//************************************************ -// -// Train with rotation functionality -// -//************************************************ - -/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE - Path for rotate_train. - - ROTATION tells train to rotate at rate specified by "rotate". Use '0 0 0' to stop rotation. - - ANGLES tells train to rotate to the angles specified by "angles" while traveling to this path_rotate. Use values < 0 or > 360 to guarantee that it turns in a certain direction. Having this flag set automatically clears any rotation. - - STOP tells the train to stop and wait to be retriggered. - - NO_ROTATE tells the train to stop rotating when waiting to be triggered. - - DAMAGE tells the train to cause damage based on "dmg". - - MOVETIME tells the train to interpret "speed" as the length of time to take moving from one corner to another. - - SET_DAMAGE tells the train to set all targets damage to "dmg" - - "noise" contains the name of the sound to play when train stops. - "noise1" contains the name of the sound to play when train moves. - "event" is a target to trigger when train arrives at path_rotate. -*/ -void() path_rotate = - { - if( self.noise ) - { - precache_sound( self.noise ); - } - if( self.noise1 ) - { - precache_sound( self.noise1 ); - } - }; - - -void() rotate_train; -void() rotate_train_next; -void() rotate_train_find; - -void() rotate_train_think = - { - local float t; - local float timeelapsed; - - t = time - self.ltime; - self.ltime = time; - - if( ( self.endtime ) && ( time >= self.endtime ) ) - { - self.endtime = 0; - if( self.state == STATE_MOVE ) - { - setorigin(self, self.finaldest); - self.velocity = '0 0 0'; - } - - if(self.think1) - self.think1(); - } - else - { - timeelapsed = (time - self.cnt) * self.duration; - if( timeelapsed > 1 ) - timeelapsed = 1; - setorigin( self, self.dest1 + ( self.dest2 * timeelapsed ) ); - } - - self.angles = self.angles + ( self.rotate * t ); - self.angles = SUB_NormalizeAngles( self.angles ); - RotateTargets(); - - self.nextthink = time + 0.02; - }; - -void() rotate_train_use = - { - if(self.think1 != rotate_train_find) - { - if( self.velocity != '0 0 0' ) - return; // already activated - if( self.think1 ) - { - self.think1(); - } - } - }; - -void() rotate_train_wait = - { - self.state = STATE_WAIT; - - if( self.goalentity.noise ) - { - sound(self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); - } - else - { - sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - } - if( self.goalentity.spawnflags & ANGLES ) - { - self.rotate = '0 0 0'; - self.angles = self.finalangle; - } - if( self.goalentity.spawnflags & NO_ROTATE ) - { - self.rotate = '0 0 0'; - } - self.endtime = self.ltime + self.goalentity.wait; - self.think1 = rotate_train_next; - }; - -void() rotate_train_stop = - { - self.state = STATE_STOP; - - if( self.goalentity.noise ) - { - sound(self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); - } - else - { - sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - } - if( self.goalentity.spawnflags & ANGLES ) - { - self.rotate = '0 0 0'; - self.angles = self.finalangle; - } - if( self.goalentity.spawnflags & NO_ROTATE ) - { - self.rotate = '0 0 0'; - } - - self.dmg = 0; - self.think1 = rotate_train_next; - }; - -void() rotate_train_next = -{ - local entity targ; - local entity current; - local vector vdestdelta; - local float len, traveltime, div; - local string temp; - - self.state = STATE_NEXT; - - current = self.goalentity; - targ = find (world, targetname, self.path ); - if( targ.classname != "path_rotate" ) - objerror( "Next target is not path_rotate" ); - - if( self.goalentity.noise1 ) - { - self.noise1 = self.goalentity.noise1; - } - sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - - self.goalentity = targ; - self.path = targ.target; - if(!self.path ) - objerror ("rotate_train_next: no next target"); - - if( targ.spawnflags & STOP ) - { - self.think1 = rotate_train_stop; - } - else if(targ.wait) - { - self.think1 = rotate_train_wait; - } - else - { - self.think1 = rotate_train_next; - } - - if( current.event ) - { - // Trigger any events that should happen at the corner. - temp = self.target; - self.target = current.event; - self.message = current.message; - SUB_UseTargets(); - self.target = temp; - self.message = string_null; - } - - if( current.spawnflags & ANGLES ) - { - self.rotate = '0 0 0'; - self.angles = self.finalangle; - } - - if( current.spawnflags & ROTATION ) - { - self.rotate = current.rotate; - } - - if( current.spawnflags & DAMAGE ) - { - self.dmg = current.dmg; - } - - if( current.spawnflags & SET_DAMAGE ) - { - SetDamageOnTargets( current.dmg ); - } - - if( current.speed == -1 ) - { - // Warp to the next path_corner - setorigin( self, targ.origin ); - self.endtime = self.ltime + 0.01; - SetTargetOrigin(); - - if( targ.spawnflags & ANGLES ) - { - self.angles = targ.angles; - } - - self.duration = 1; // 1 / duration - self.cnt = time; // start time - self.dest2 = '0 0 0'; // delta - self.dest1 = self.origin; // original position - self.finaldest = self.origin; - } - else - { - self.state = STATE_MOVE; - - self.finaldest = targ.origin; - if(self.finaldest == self.origin) - { - self.velocity = '0 0 0'; - self.endtime = self.ltime + 0.1; - - self.duration = 1; // 1 / duration - self.cnt = time; // start time - self.dest2 = '0 0 0'; // delta - self.dest1 = self.origin; // original position - self.finaldest = self.origin; - return; - } - // set destdelta to the vector needed to move - vdestdelta = self.finaldest - self.origin; - - // calculate length of vector - len = vlen (vdestdelta); - - if( current.spawnflags & MOVETIME ) - { - traveltime = current.speed; - } - else - { - // check if there's a speed change - if(current.speed>0) - self.speed = current.speed; - - if(!self.speed) - objerror("No speed is defined!"); - - // divide by speed to get time to reach dest - traveltime = len / self.speed; - } - - if(traveltime < 0.1) - { - self.velocity = '0 0 0'; - self.endtime = self.ltime + 0.1; - if( targ.spawnflags & ANGLES ) - { - self.angles = targ.angles; - } - return; - } - - // qcc won't take vec/float - div = 1 / traveltime; - - if( targ.spawnflags & ANGLES ) - { - self.finalangle = SUB_NormalizeAngles( targ.angles ); - self.rotate = ( targ.angles - self.angles ) * div; - } - - // set endtime to trigger a think when dest is reached - self.endtime = self.ltime + traveltime; - - // scale the destdelta vector by the time spent traveling to get velocity - self.velocity = vdestdelta * div; - - self.duration = div; // 1 / duration - self.cnt = time; // start time - self.dest2 = vdestdelta; // delta - self.dest1 = self.origin; // original position - } - }; - -void() rotate_train_find = - { - local entity targ; - - self.state = STATE_FIND; - - LinkRotateTargets(); - - // the first target is the point of rotation. - // the second target is the path. - targ = find ( world, targetname, self.path); - if( targ.classname != "path_rotate" ) - objerror( "Next target is not path_rotate" ); - - // Save the current entity - self.goalentity = targ; - - if( targ.spawnflags & ANGLES ) - { - self.angles = targ.angles; - self.finalangle = SUB_NormalizeAngles( targ.angles ); - } - - self.path = targ.target; - setorigin (self, targ.origin ); - SetTargetOrigin(); - RotateTargetsFinal(); - self.think1 = rotate_train_next; - if(!self.targetname) - { - // not triggered, so start immediately - self.endtime = self.ltime + 0.1; - } - else - { - self.endtime = 0; - } - - self.duration = 1; // 1 / duration - self.cnt = time; // start time - self.dest2 = '0 0 0'; // delta - self.dest1 = self.origin; // original position - }; - -/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) -In path_rotate, set speed to be the new speed of the train after it reaches -the path change. If speed is -1, the train will warp directly to the next -path change after the specified wait time. If MOVETIME is set on the -path_rotate, the train to interprets "speed" as the length of time to -take moving from one corner to another. - -"noise" contains the name of the sound to play when train stops. -"noise1" contains the name of the sound to play when train moves. -Both "noise" and "noise1" defaults depend upon "sounds" variable and -can be overridden by the "noise" and "noise1" variable in path_rotate. - -Also in path_rotate, if STOP is set, the train will wait until it is -retriggered before moving on to the next goal. - -Trains are moving platforms that players can ride. -"path" specifies the first path_rotate and is the starting position. -If the train is the target of a button or trigger, it will not begin moving until activated. -The func_rotate_train entity is the center of rotation of all objects targeted by it. - -If "deathtype" is set with a string, this is the message that will appear when a player is killed by the train. - -speed default 100 -dmg default 0 -sounds -1) ratchet metal -*/ - -void() rotate_train = - { - objerror ("rotate_train entities should be changed to rotate_object with\nfunc_rotate_train controllers\n"); - }; - -void() func_rotate_train = - { - if(!self.speed) - self.speed = 100; - if(!self.target) - objerror ("rotate_train without a target"); - - if( !self.noise ) - { - if(self.sounds == 0) - { - self.noise = ("misc/null.wav"); - } - - if(self.sounds == 1) - { - self.noise = ("plats/train2.wav"); - } - } - if( !self.noise1 ) - { - if(self.sounds == 0) - { - self.noise1 = ("misc/null.wav"); - } - if(self.sounds == 1) - { - self.noise1 = ("plats/train1.wav"); - } - } - - precache_sound( self.noise ); - precache_sound( self.noise1 ); - - self.cnt = 1; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_STEP; - self.use = rotate_train_use; - - setmodel (self, self.model); - setsize (self, self.mins, self.maxs); - setorigin (self, self.origin); - -// start trains on the second frame, to make sure their targets have had -// a chance to spawn - self.ltime = time; - self.nextthink = self.ltime + 0.1; - self.endtime = self.ltime + 0.1; - self.think = rotate_train_think; - self.think1 = rotate_train_find; - self.state = STATE_FIND; - - self.duration = 1; // 1 / duration - self.cnt = 0.1; // start time - self.dest2 = '0 0 0'; // delta - self.dest1 = self.origin; // original position - - - self.flags = self.flags | FL_ONGROUND; - }; - -//************************************************ -// -// Moving clip walls -// -//************************************************ - -void() rotate_door_reversedirection; -void() rotate_door_group_reversedirection; - -void() movewall_touch = - { - if(time < self.owner.attack_finished) - return; - - if( self.dmg ) - { - T_Damage (other, self, self.owner, self.dmg); - self.owner.attack_finished = time + 0.5; - } - else if( self.owner.dmg ) - { - T_Damage (other, self, self.owner, self.owner.dmg); - self.owner.attack_finished = time + 0.5; - } - }; - -void() movewall_blocked = - { - local entity temp; - - if(time < self.owner.attack_finished) - return; - - self.owner.attack_finished = time + 0.5; - - if( self.owner.classname == "func_rotate_door" ) - { - temp = self; - self = self.owner; - rotate_door_group_reversedirection(); - self = temp; - } - - if( self.dmg ) - { - T_Damage (other, self, self.owner, self.dmg); - self.owner.attack_finished = time + 0.5; - } - else if( self.owner.dmg ) - { - T_Damage (other, self, self.owner, self.owner.dmg); - self.owner.attack_finished = time + 0.5; - } - }; - -void() movewall_think = - { - self.ltime = time; - self.nextthink = time + 0.02; - }; - -/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING -Used to emulate collision on rotating objects. - -VISIBLE causes brush to be displayed. - -TOUCH specifies whether to cause damage when touched by player. - -NONBLOCKING makes the brush non-solid. This is useless if VISIBLE is set. - -"dmg" specifies the damage to cause when touched or blocked. -*/ -void() func_movewall = - { - self.angles = '0 0 0'; - self.movetype = MOVETYPE_PUSH; - if( self.spawnflags & NONBLOCKING ) - { - self.solid = SOLID_NOT; - } - else - { - self.solid = SOLID_BSP; - self.blocked = movewall_blocked; - } - if( self.spawnflags & TOUCH ) - { - self.touch = movewall_touch; - } - setmodel (self,self.model); - if( !( self.spawnflags & VISIBLE ) ) - { - self.model = string_null; - } - self.think = movewall_think; - self.nextthink = time + 0.02; - self.ltime = time; - }; - -/*QUAKED rotate_object (0 .5 .8) ? -This defines an object to be rotated. Used as the target of func_rotate_door. -*/ -void() rotate_object = - { - self.classname = "rotate_object"; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - setmodel (self,self.model); - setsize( self, self.mins, self.maxs ); - self.think = SUB_Null; - }; - -//************************************************ -// -// Rotating doors -// -//************************************************ - -void() rotate_door_think2 = - { - local float t; - - t = time - self.ltime; - self.ltime = time; - - // change to alternate textures - self.frame = 1 - self.frame; - - self.angles = self.dest; - - if( self.state == STATE_OPENING ) - { - self.state = STATE_OPEN; - } - else - { - if( self.spawnflags & STAYOPEN ) - { - rotate_door_group_reversedirection(); - return; - } - self.state = STATE_CLOSED; - } - - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); - self.think = SUB_Null; - - RotateTargetsFinal(); - }; - -void() rotate_door_think = - { - local float t; - - t = time - self.ltime; - self.ltime = time; - - if( time < self.endtime ) - { - self.angles = self.angles + ( self.rotate * t ); - RotateTargets(); - } - else - { - self.angles = self.dest; - RotateTargets(); - self.think = rotate_door_think2; - } - - self.nextthink = time + 0.01; - }; - -void() rotate_door_reversedirection = - { - local vector start; - - // change to alternate textures - self.frame = 1 - self.frame; - - if( self.state == STATE_CLOSING ) - { - start = self.dest1; - self.dest = self.dest2; - self.state = STATE_OPENING; - } - else - { - start = self.dest2; - self.dest = self.dest1; - self.state = STATE_CLOSING; - } - - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - - self.rotate = ( self.dest - start ) * ( 1 / self.speed ); - self.think = rotate_door_think; - self.nextthink = time + 0.02; - self.endtime = time + self.speed - ( self.endtime - time ); - self.ltime = time; - }; - -void() rotate_door_group_reversedirection = - { - local string name; - - // tell all associated rotaters to reverse direction - if( self.group ) - { - name = self.group; - self = find( world, group, name); - while( self ) - { - rotate_door_reversedirection(); - self = find( self, group, name); - } - } - else - { - rotate_door_reversedirection(); - } - }; - -void() rotate_door_use = - { - local vector start; - - if( ( self.state != STATE_OPEN ) && ( self.state != STATE_CLOSED ) ) - return; - - if( !self.cnt ) - { - self.cnt = 1; - LinkRotateTargets(); - } - - // change to alternate textures - self.frame = 1 - self.frame; - - if( self.state == STATE_CLOSED ) - { - start = self.dest1; - self.dest = self.dest2; - self.state = STATE_OPENING; - } - else - { - start = self.dest2; - self.dest = self.dest1; - self.state = STATE_CLOSING; - } - - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - - self.rotate = ( self.dest - start ) * ( 1 / self.speed ); - self.think = rotate_door_think; - self.nextthink = time + 0.01; - self.endtime = time + self.speed; - self.ltime = time; - }; - - -/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN -Creates a door that rotates between two positions around a point of -rotation each time it's triggered. - -STAYOPEN tells the door to reopen after closing. This prevents a trigger- -once door from closing again when it's blocked. - -"dmg" specifies the damage to cause when blocked. Defaults to 2. Negative numbers indicate no damage. -"speed" specifies how the time it takes to rotate - -"sounds" -1) medieval (default) -2) metal -3) base -*/ - -void() func_rotate_door = - { - if(!self.target) - { - objerror( "rotate_door without target." ); - } - - self.dest1 = '0 0 0'; - self.dest2 = self.angles; - self.angles = self.dest1; - - // default to 2 seconds - if( !self.speed ) - { - self.speed = 2; - } - - self.cnt = 0; - - if(!self.dmg) - self.dmg = 2; - else if( self.dmg < 0 ) - { - self.dmg = 0; - } - - if(self.sounds == 0) - self.sounds = 1; - if(self.sounds == 1) - { - precache_sound("doors/latch2.wav"); - precache_sound("doors/winch2.wav"); - precache_sound("doors/drclos4.wav"); - self.noise1 = "doors/latch2.wav"; - self.noise2 = "doors/winch2.wav"; - self.noise3 = "doors/drclos4.wav"; - } - if(self.sounds == 2) - { - precache_sound("doors/airdoor1.wav"); - precache_sound("doors/airdoor2.wav"); - self.noise2 = "doors/airdoor1.wav"; - self.noise1 = "doors/airdoor2.wav"; - self.noise3 = "doors/airdoor2.wav"; - } - if(self.sounds == 3) - { - precache_sound("doors/basesec1.wav"); - precache_sound("doors/basesec2.wav"); - self.noise2 = "doors/basesec1.wav"; - self.noise1 = "doors/basesec2.wav"; - self.noise3 = "doors/basesec2.wav"; - } - - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - setmodel (self, self.model); - setorigin( self, self.origin ); - setsize( self, self.mins, self.maxs ); - self.state = STATE_CLOSED; - self.use = rotate_door_use; - self.think = SUB_Null; - }; diff --git a/QC/hiprubbl.qc b/QC/hiprubbl.qc deleted file mode 100644 index 4cb1fc54..00000000 --- a/QC/hiprubbl.qc +++ /dev/null @@ -1,135 +0,0 @@ -/* Rubble QuickC program - By Jim Dose' 9/15/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -void() hipRubbleTouch = - { - if( self.ltime < self.pausetime ) - return; - - if(other.takedamage) - { - T_Damage (other, self, self.owner, 10 ); - sound(self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); - self.pausetime = self.ltime + 0.1; - } - }; - -void(string rubblename) hipThrowRubble = -{ - local entity new; - - new = spawn(); - new.origin = self.origin; - setmodel (new, rubblename ); - setsize (new, '0 0 0', '0 0 0'); - new.velocity_x = 70 * crandom(); - new.velocity_y = 70 * crandom(); - new.velocity_z = 140 + 70 * random(); - new.movetype = MOVETYPE_BOUNCE; - new.solid = SOLID_BBOX; - new.avelocity_x = random()*600; - new.avelocity_y = random()*600; - new.avelocity_z = random()*600; - new.think = SUB_Remove; - new.touch = hipRubbleTouch; - new.ltime = time; - new.nextthink = time + 13 + random()*10; - self.pausetime = time; - new.frame = 0; - new.flags = 0; -}; - -void() rubble_use = - { - local float which; - local float index; - - index = 0; - - do - { - which = self.cnt; - if( self.cnt == 0 ) - { - which = 1 + 3*random(); - which = floor( which ); - } - if( which == 1 ) - { - hipThrowRubble( "progs/rubble1.mdl" ); - } - else if( which == 2 ) - { - hipThrowRubble( "progs/rubble3.mdl" ); - } - else - { - hipThrowRubble( "progs/rubble2.mdl" ); - } - index = index + 1; - } - while( index < self.count ); - }; - -/*QUAKED func_rubble (0.4 0.4 0.2) (0 0 0) (32 32 32) - Spawns random sized rubble when triggered. - - "count" is the number of pieces of rubble to spawn. Default is 1. -*/ -void() func_rubble = - { - precache_model ("progs/rubble1.mdl"); - precache_model ("progs/rubble2.mdl"); - precache_model ("progs/rubble3.mdl"); - precache_sound("zombie/z_hit.wav"); - self.classname = "rubble"; - self.cnt = 0; - self.use = rubble_use; - }; - -/*QUAKED func_rubble1 (0.4 0.4 0.2) (0 0 0) (8 8 8) - Spawns small rubble when triggered. - - "count" is the number of pieces of rubble to spawn. Default is 1. -*/ -void() func_rubble1 = - { - precache_model ("progs/rubble1.mdl"); - precache_sound("zombie/z_hit.wav"); - self.classname = "rubble1"; - self.cnt = 1; - self.use = rubble_use; - }; - -/*QUAKED func_rubble2 (0.4 0.4 0.2) (0 0 0) (16 16 16) - Spawns medium rubble when triggered. - - "count" is the number of pieces of rubble to spawn. Default is 1. -*/ -void() func_rubble2 = - { - precache_model ("progs/rubble3.mdl"); - precache_sound("zombie/z_hit.wav"); - self.classname = "rubble2"; - self.cnt = 2; - self.use = rubble_use; - }; - -/*QUAKED func_rubble3 (0.4 0.4 0.2) (0 0 0) (32 32 32) - Spawns large rubble when triggered. - - "count" is the number of pieces of rubble to spawn. Default is 1. -*/ -void() func_rubble3 = - { - precache_model ("progs/rubble2.mdl"); - precache_sound("zombie/z_hit.wav"); - self.classname = "rubble3"; - self.cnt = 3; - self.use = rubble_use; - }; - diff --git a/QC/hipscrge.qc b/QC/hipscrge.qc deleted file mode 100644 index ce006772..00000000 --- a/QC/hipscrge.qc +++ /dev/null @@ -1,516 +0,0 @@ -/* -============================================================================== - -SCOURGE - -============================================================================== -*/ - -$cd hipwork\models\scourge -$origin 0 0 23 -$base scorbase.asc - -$skin skin - -$frame stand1.asc stand2.asc stand3.asc stand4.asc stand5.asc stand6.asc -$frame stand7.asc stand8.asc stand9.asc stand10.asc stand11.asc stand12.asc - -$frame walk1.asc walk2.asc walk3.asc walk4.asc walk5.asc walk6.asc - -$frame shoot1.asc shoot2.asc - -$frame sting1.asc sting2.asc sting3.asc sting4.asc sting5.asc sting6.asc -$frame sting7.asc sting8.asc sting9.asc sting10.asc sting11.asc - -$frame pain1.asc pain2.asc pain3.asc pain4.asc pain5.asc - -$frame death1.asc death2.asc death3.asc death4.asc death5.asc - -/* -=========== -ScourgeCheckAttack - -The player is in view, so decide to move or launch an attack -Returns FALSE if movement should continue -============ -*/ -float() ScourgeCheckAttack = -{ - local vector spot1, spot2; - local entity targ; - local float chance; - - targ = self.enemy; -// see if any entities are in the way of the shot - spot1 = self.origin + self.view_ofs; - spot2 = targ.origin + targ.view_ofs; - - if(vlen(spot1 - spot2) <= 100 ) - { - if(CanDamage (self.enemy, self)) - { - self.attack_state = AS_MELEE; - return TRUE; - } - } - if(time < self.attack_finished) - return FALSE; - - if(!enemy_vis) - return FALSE; - - - chance = spot2_z - spot1_z; - if(chance > 64) - return FALSE; - else if(chance < -200) - return FALSE; - - if(vlen(spot1 - spot2) > 1000) - return FALSE; - - if(vlen(spot1 - spot2) < 150) - return FALSE; - - traceline(spot1, spot2, FALSE, self); - - if(trace_inopen && trace_inwater) - return FALSE; // sight line crossed contents - - if(trace_ent != targ) - { - return FALSE; // don't have a clear shot - } - -// missile attack -// if(enemy_range == RANGE_FAR) -// return FALSE; - - self.attack_state = AS_MISSILE; - SUB_AttackFinished (2 + 2*random()); - return TRUE; -}; - -void(float ox) SCOURGE_FireSpikes = -{ - local vector src, vec; - - ai_face(); - makevectors(self.angles); - src = self.origin - '0 0 19' + v_right*ox + v_forward*14; - vec = (self.enemy.origin + (200*v_forward)) - src; - vec = normalize(vec); - sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); - launch_spike (src, vec); - - self.attack_finished = time + 0.2; -}; - -// Attack_With_Tail -// -void() Attack_With_Tail = - { - local float ldmg; - local vector delta; - - ai_face(); - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - if(!CanDamage (self.enemy, self)) - return; - - ldmg = (random() + random() + random()) * 40; - T_Damage (self.enemy, self, self, ldmg); - sound(self, CHAN_WEAPON, "shambler/smack.wav", 1, ATTN_NORM); - - SpawnMeatSpray (self.origin + v_forward*16, crandom() * 50 * v_right); - }; - -void() ScourgeTriggerThink; -void() ScourgeTriggerTouch; -void() scourge_think = - { - local entity trig; - if(!self.state) - { - trig = spawn(); - trig.angles = '0 0 0'; - trig.solid = SOLID_TRIGGER; - setsize( trig, '-64 -64 -24', '64 64 64'); - trig.takedamage = DAMAGE_NO; - trig.movetype = MOVETYPE_NONE; - trig.modelindex = 0; - trig.model = ""; - trig.lastvictim = self; - trig.think = ScourgeTriggerThink; - trig.touch = ScourgeTriggerTouch; - trig.nextthink = time + 0.1 + random(); - setorigin(trig,self.origin); - self.lastvictim = trig; - self.state = 1; - } - if((self.spawnsilent == 0) && (self.spawnmulti == 1)) - { - sound(self, CHAN_BODY, "misc/null.wav", 1, ATTN_IDLE); - } - else if((self.spawnsilent == 1) && (self.spawnmulti == 0)) - { - sound(self, CHAN_BODY, "scourge/walk.wav", 1, ATTN_IDLE); - } - self.spawnmulti = self.spawnsilent; - }; - -void(float dist) ai_right = -{ - walkmove ( (self.angles_y+90), dist); -}; - -void(float dist) ai_left = -{ - walkmove ( (self.angles_y+270), dist); -}; -//============================================================================ - -//void() scourge_wake1; -void() scourge_stand1 =[ $stand1.asc, scourge_stand2 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand2 =[ $stand2.asc, scourge_stand3 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand3 =[ $stand3.asc, scourge_stand4 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand4 =[ $stand4.asc, scourge_stand5 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand5 =[ $stand5.asc, scourge_stand6 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand6 =[ $stand6.asc, scourge_stand7 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand7 =[ $stand7.asc, scourge_stand8 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand8 =[ $stand8.asc, scourge_stand9 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand9 =[ $stand9.asc, scourge_stand10 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand10 =[ $stand10.asc, scourge_stand11 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand11 =[ $stand11.asc, scourge_stand12 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; -void() scourge_stand12 =[ $stand12.asc, scourge_stand1 ] {self.spawnsilent = 0;ai_stand();scourge_think();}; - -void() scourge_walk1 =[ $walk1.asc , scourge_walk2 ] { -if(random() < 0.1) - sound(self, CHAN_VOICE, "scourge/idle.wav", 1, ATTN_IDLE); -self.spawnsilent = 1; -scourge_think(); -ai_walk(8);}; -void() scourge_walk2 =[ $walk2.asc , scourge_walk3 ] {ai_walk(8);}; -void() scourge_walk3 =[ $walk3.asc , scourge_walk4 ] {ai_walk(8);}; -void() scourge_walk4 =[ $walk4.asc , scourge_walk5 ] {ai_walk(8);}; -void() scourge_walk5 =[ $walk5.asc , scourge_walk6 ] {ai_walk(8);}; -void() scourge_walk6 =[ $walk6.asc , scourge_walk1 ] {ai_walk(8);}; - -void() scourge_run1 =[ $walk1.asc , scourge_run2 ] { -if(random() < 0.1) - sound(self, CHAN_VOICE, "scourge/idle.wav", 1, ATTN_IDLE); -self.spawnsilent = 1; -scourge_think(); -ai_run(18);}; -void() scourge_run2 =[ $walk2.asc , scourge_run3 ] {scourge_think();ai_run(14);}; -void() scourge_run3 =[ $walk3.asc , scourge_run4 ] {ai_run(14);}; -void() scourge_run4 =[ $walk4.asc , scourge_run5 ] {ai_run(14);}; -void() scourge_run5 =[ $walk5.asc , scourge_run6 ] {ai_run(14);}; -void() scourge_run6 =[ $walk6.asc , scourge_run1 ] {ai_run(14);}; - -void() scourge_strafeleft1 =[ $walk1.asc , scourge_strafeleft2 ] {self.spawnsilent = 1;scourge_think();ai_left(20);}; -void() scourge_strafeleft2 =[ $walk2.asc , scourge_strafeleft3 ] {ai_left(20);}; -void() scourge_strafeleft3 =[ $walk3.asc , scourge_strafeleft4 ] {ai_left(20);}; -void() scourge_strafeleft4 =[ $walk4.asc , scourge_strafeleft5 ] {ai_left(14);}; -void() scourge_strafeleft5 =[ $walk5.asc , scourge_strafeleft6 ] {ai_left(14);}; -void() scourge_strafeleft6 =[ $walk6.asc , scourge_run1 ] {ai_left(14);}; - -void() scourge_straferight1 =[ $walk1.asc , scourge_straferight2 ] {self.spawnsilent = 1;scourge_think();ai_right(20);}; -void() scourge_straferight2 =[ $walk2.asc , scourge_straferight3 ] {ai_right(20);}; -void() scourge_straferight3 =[ $walk3.asc , scourge_straferight4 ] {ai_right(20);}; -void() scourge_straferight4 =[ $walk4.asc , scourge_straferight5 ] {ai_right(14);}; -void() scourge_straferight5 =[ $walk5.asc , scourge_straferight6 ] {ai_right(14);}; -void() scourge_straferight6 =[ $walk6.asc , scourge_run1 ] {ai_right(14);}; - -/* -void() scourge_wake1 =[ $stand2.asc, scourge_wake2 ] {self.spawnsilent = 0;scourge_think();}; -void() scourge_wake2 =[ $stand3.asc, scourge_wake3 ] {}; -void() scourge_wake3 =[ $stand4.asc, scourge_wake4 ] {}; -void() scourge_wake4 =[ $stand5.asc, scourge_wake5 ] {}; -void() scourge_wake5 =[ $stand6.asc, scourge_wake6 ] {}; -void() scourge_wake6 =[ $stand7.asc, scourge_run1 ] - { - SUB_AttackFinished(1); - }; -//void() scourge_wake7 =[ $stand7.asc, scourge_run1 ] {}; -*/ - -void() scourge_turn1 =[ $walk1.asc, scourge_turn2 ] {self.spawnsilent = 1;scourge_think();ai_turn_in_place();}; -void() scourge_turn2 =[ $walk2.asc, scourge_turn3 ] {ai_turn_in_place();}; -void() scourge_turn3 =[ $walk3.asc, scourge_turn4 ] {ai_turn_in_place();}; -void() scourge_turn4 =[ $walk4.asc, scourge_turn5 ] {ai_turn_in_place();}; -void() scourge_turn5 =[ $walk5.asc, scourge_turn6 ] {ai_turn_in_place();}; -void() scourge_turn6 =[ $walk6.asc, scourge_turn1 ] {ai_turn_in_place();}; - -void() scourge_atk1 =[ $shoot1.asc, scourge_atk2 ] - { - self.spawnsilent = 0; - scourge_think(); - self.effects = self.effects | EF_MUZZLEFLASH; - SCOURGE_FireSpikes(40); -// SCOURGE_FireSpikes(-40); - }; -void() scourge_atk2 =[ $shoot2.asc, scourge_atk3 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; -// SCOURGE_FireSpikes(56); - SCOURGE_FireSpikes(-56); - }; -void() scourge_atk3 =[ $shoot1.asc, scourge_atk4 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; -// SCOURGE_FireSpikes(40); - SCOURGE_FireSpikes(-40); - }; -void() scourge_atk4 =[ $shoot2.asc, scourge_atk5 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - SCOURGE_FireSpikes(56); -// SCOURGE_FireSpikes(-56); - }; -void() scourge_atk5 =[ $shoot1.asc, scourge_atk6 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - SCOURGE_FireSpikes(40); -// SCOURGE_FireSpikes(-40); - }; -void() scourge_atk6 =[ $shoot2.asc, scourge_atk7 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; -// SCOURGE_FireSpikes(56); - SCOURGE_FireSpikes(-56); - }; -void() scourge_atk7 =[ $shoot1.asc, scourge_atk8 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; -// SCOURGE_FireSpikes(40); - SCOURGE_FireSpikes(-40); - }; -void() scourge_atk8 =[ $shoot2.asc, scourge_run1 ] - { - self.effects = self.effects | EF_MUZZLEFLASH; - SCOURGE_FireSpikes(56); -// SCOURGE_FireSpikes(-56); - SUB_AttackFinished (4*random()); - }; - -void() scourge_melee1 =[ $sting1.asc, scourge_melee2 ] {self.spawnsilent = 0;scourge_think();ai_charge(3);}; -void() scourge_melee2 =[ $sting2.asc, scourge_melee3 ] {ai_charge(3);}; -void() scourge_melee3 =[ $sting3.asc, scourge_melee4 ] {ai_charge(2);}; -void() scourge_melee4 =[ $sting4.asc, scourge_melee5 ] {ai_charge(2);}; -void() scourge_melee5 =[ $sting5.asc, scourge_melee6 ] - { - sound(self, CHAN_WEAPON, "scourge/tailswng.wav", 1, ATTN_NORM); - ai_charge(3); - }; -void() scourge_melee6 =[ $sting6.asc, scourge_melee7 ] {ai_charge(1);}; -void() scourge_melee7 =[ $sting7.asc, scourge_melee8 ] - { - Attack_With_Tail(); - }; -void() scourge_melee8 =[ $sting8.asc, scourge_melee9 ] {ai_face();}; -void() scourge_melee9 =[ $sting9.asc, scourge_melee10 ] {ai_face();}; -void() scourge_melee10 =[ $sting10.asc, scourge_melee11 ] {ai_face();}; -void() scourge_melee11 =[ $sting11.asc, scourge_run1 ] {ai_face(); -SUB_CheckRefire (scourge_melee1); -}; - -void() scourge_pain1 =[ $pain1.asc, scourge_pain2 ] {self.spawnsilent = 0;scourge_think();}; -void() scourge_pain2 =[ $pain2.asc, scourge_pain3 ] {}; -void() scourge_pain3 =[ $pain3.asc, scourge_pain4 ] {}; -void() scourge_pain4 =[ $pain4.asc, scourge_pain5 ] {}; -void() scourge_pain5 =[ $pain5.asc, scourge_run1 ] {}; - -void(entity attacker, float damage) scourge_pain = -{ - local float r; - - - if(random()*50 > damage) - return; // didn't flinch - - if(self.pain_finished > time) - return; - - - r = random(); - sound(self, CHAN_VOICE, "scourge/pain.wav", 1, ATTN_NORM); - - self.pain_finished = time + 2.0; - scourge_pain1(); -}; - -//============================================================================ - - -void() ScourgeDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - - if(entPlayer != world && random() > 0.65) - { - if(!TryEnemyDrop(entPlayer, WID_SUPER_NAILGUN, 0.4)) - if(!TryEnemyDrop(entPlayer, WID_NAILGUN, 0.5)) - { /* Intentionally empty. */ } - } -} - -void() scourge_die1 =[ $death1.asc, scourge_die2 ] {self.spawnsilent = 0;scourge_think();}; -void() scourge_die2 =[ $death2.asc, scourge_die3 ] {}; -void() scourge_die3 =[ $death3.asc, scourge_die4 ] {ScourgeDrop();}; -void() scourge_die4 =[ $death4.asc, scourge_die5 ] {}; -void() scourge_die5 =[ $death5.asc, scourge_die5 ] {}; - -void() scourge_die = -{ -// check for gib - // stop sound - remove (self.lastvictim); - self.spawnsilent = 0; - scourge_think(); - if(self.health < -35) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_scourg.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ScourgeDrop(); - return; - } - -// regular death - sound(self, CHAN_VOICE, "scourge/pain2.wav", 1, ATTN_NORM); - scourge_die1(); -}; - -// -// scourge_melee -// -void() scourge_melee = -{ - scourge_melee1(); - SUB_AttackFinished (2*random()); -}; - -// -// ScourgeTriggerThink -// -void() ScourgeTriggerThink = - { - local entity targ; - - if(self.lastvictim.health<=0) - { - remove(self); - return; - } - targ = self.lastvictim; - makevectors(targ.angles); - setorigin(self, targ.origin + (v_forward*300) ); - self.nextthink = time + 0.1; - }; - -// -// ScourgeTriggerTouch -// -void() ScourgeTriggerTouch = - { - local entity targ; - local entity tempent; - local vector dir; - - if(other.flags & (FL_MONSTER|FL_CLIENT)) - return; - if(other.movetype != MOVETYPE_FLYMISSILE) - return; - targ = self.lastvictim; - if(targ.health<=0) - { - remove(self); - return; - } - dir = targ.origin - other.origin; - dir = normalize(dir); - if((dir * normalize(other.velocity))<0.8) - return; - -// targ.think = targ.th_run; -// if(targ.flags & FL_ONGROUND) -// { - if(time > self.duration) - { - tempent = self; - self = targ; - if(random()<0.5) - scourge_strafeleft1(); - else - scourge_straferight1(); - self.duration = time + 1.5; - } -/* - targ.origin_z = targ.origin_z + 1; - targ.velocity = targ.velocity + '0 0 500'; - targ.flags = targ.flags - FL_ONGROUND; -*/ - self = tempent; -// } -// dprint("ouch\n"); - }; - -/*QUAKED monster_scourge (1 0 0) (-16 -16 -24) (16 16 40) Ambush - -*/ -void() monster_scourge = -{ - if(deathmatch) - { - remove(self); - return; - } - - precache_model2 ("progs/scor.mdl"); - precache_model2 ("progs/h_scourg.mdl"); - precache_model2 ("progs/laser.mdl"); - precache_model2 ("progs/s_light.mdl"); - precache_model2 ("progs/spike.mdl"); - - precache_sound("misc/null.wav"); - precache_sound("scourge/idle.wav"); - precache_sound("scourge/pain.wav"); - precache_sound("scourge/pain2.wav"); - precache_sound("scourge/sight.wav"); - precache_sound("scourge/tailswng.wav"); - precache_sound("scourge/walk.wav"); - precache_sound2 ("shambler/smack.wav"); - precache_sound2 ("weapons/rocket1i.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/scor.mdl"); - - // TODO VR: (P2) tweak hitbox - setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 300; - - self.th_stand = scourge_stand1; - self.th_walk = scourge_walk1; - self.th_run = scourge_run1; - self.th_pain = scourge_pain; - self.th_die = scourge_die; - self.th_melee = scourge_melee; - self.th_missile = scourge_atk1; - self.yaw_speed = 60; - self.attack_state = AS_DODGING; - self.state = 0; - - walkmonster_start(); -}; diff --git a/QC/hipspawn.qc b/QC/hipspawn.qc deleted file mode 100644 index cf9399be..00000000 --- a/QC/hipspawn.qc +++ /dev/null @@ -1,355 +0,0 @@ -//===================================================================== -// -// Spawning Functions (Hipnotic) -// -//===================================================================== - -//================ -// -// spawn_think -// -//================ - -void() spawn_think = - { - self.think = spawn_think; - self.nextthink = time + 1; - }; - -//================ -// -// spawn_use -// -//================ - -void() spawn_use = -{ - local entity spawnentity; - - if((self.spawnmulti == 1) || (horn_active)) - { - // spawn the new entity - spawnentity = spawn(); - // copy the master mold - SUB_CopyEntity(self.spawnmaster,spawnentity); - } - else - { - spawnentity = self.spawnmaster; - } - // restore the model - spawnentity.model = spawnentity.spawnmodel; - //restore solid flag - spawnentity.solid = spawnentity.spawnsolidtype; - //restore thinking function - spawnentity.think = spawnentity.spawnthink; - setmodel (spawnentity, spawnentity.model); - setorigin (spawnentity, spawnentity.origin); - spawnentity.mins = spawnentity.spawnmins; - spawnentity.maxs = spawnentity.spawnmaxs; - setsize (spawnentity, spawnentity.mins, spawnentity.maxs); - // spawn the teleport effect - if(self.spawnsilent == 0) - spawn_tfog (spawnentity.origin); -// horn_active = 0; -// horn_charmer = find( world, classname, "player" ); - // call spawnentity think function - if(horn_active) - { - spawnentity.charmer = horn_charmer; - spawnentity.charmed = 1; - } -// if(spawnentity.think) -// { -// spawnentity.nextthink = time+0.1; -// tempself = self; -// self = spawnentity; -// self.think(); -// self = tempself; -// spawnentity.nextthink = time+0.1; -// self.nextthink = 1; -// if(spawnentity.nextthink < time) -// spawnentity.nextthink = 1; -// } - // check to see if it is a monster - if(spawnentity.flags & FL_MONSTER) - { - if((self.spawnmulti != 0) && (horn_active == 0)) - { - total_monsters = total_monsters + 1; - WriteByte(MSG_BROADCAST, SVC_UPDATESTAT); - WriteByte(MSG_BROADCAST, STAT_TOTALMONSTERS); - WriteLong (MSG_BROADCAST, total_monsters); - } - // spawn the telefrag effect -// if(self.spawnsilent == 0) -// spawn_tdeath(spawnentity.origin, spawnentity); - if(horn_active) - { - spawnentity.effects = spawnentity.effects | EF_DIMLIGHT; -// spawnentity.effects = spawnentity.effects | EF_BRIGHTFIELD; - } - } - if((self.spawnmulti == 0) && (horn_active == 0)) - { - remove(self); - } - }; - -//================ -// -// func_spawn -// -//================ -/*QUAKED func_spawn (0 .5 .8) (-32 -32 -24) (32 32 64) big/ambush megahealth -This will spawn a thing upon being used. The thing that -is spawned depends upon the value of "spawnfunction". -"spawnclassname" should contain the same value as "spawnfunction". -If "spawnfunction" is unspecified a random monster is chosen. -The angles, target and all flags are passed on -Think of it like setting up a normal entity. -"spawnsilent" set this to 1 if you want a silent spawn. -"spawnmulti" set this to 1 if you want this spawn to be reoccuring. -*/ - -void() func_spawn = - { - local entity tempself; - local entity monster; - local float tempdeathmatch; - local float temptotal_monsters; - - // save off deathmatch and zero it out - tempself = self; - tempdeathmatch = deathmatch; - deathmatch = 0; - if(!self.spawnfunction) - { - local float spawnchance; - - spawnchance = random(); - monster = tempself; - - // save off monster count so it doesn't get f'ed up - temptotal_monsters = total_monsters; - - // spawn dog - // spawn the new entity - self = spawn(); - // copy over everything - SUB_CopyEntity(tempself,self); - self.spawnfunction = monster_dog; - self.spawnclassname = "monster_dog"; - self.classname = self.spawnclassname; - - // call the named spawn function - self.spawnfunction(); - self.spawnmodel = self.model; - self.spawnmins = self.mins; - self.spawnmaxs = self.maxs; - setmodel (self, ""); - setsize (self, self.spawnmins, self.spawnmaxs); - //save off solid flag - self.spawnsolidtype = self.solid; - self.solid = SOLID_NOT; - //save off think func and - //get rid of his thinking - self.spawnthink = self.think; - self.think = spawn_think; - self.nextthink = time + 1; - - if(spawnchance<0.5 && monster==tempself) - { - monster = self; - } - - // spawn ogre - // spawn the new entity - self = spawn(); - // copy over everything - SUB_CopyEntity(tempself,self); - self.spawnfunction = monster_ogre; - self.spawnclassname = "monster_ogre"; - self.classname = self.spawnclassname; - - // call the named spawn function - self.spawnfunction(); - self.spawnmodel = self.model; - self.spawnmins = self.mins; - self.spawnmaxs = self.maxs; - setmodel (self, ""); - setsize (self, self.spawnmins, self.spawnmaxs); - //save off solid flag - self.spawnsolidtype = self.solid; - self.solid = SOLID_NOT; - //save off think func and - //get rid of his thinking - self.spawnthink = self.think; - self.think = spawn_think; - self.nextthink = time + 1; - - if(spawnchance<0.8 && monster==tempself) - { - monster = self; - } - - // spawn fiend - // spawn the new entity - self = spawn(); - // copy over everything - SUB_CopyEntity(tempself,self); - self.spawnfunction = monster_demon1; - self.spawnclassname = "monster_demon1"; - self.classname = self.spawnclassname; - - // call the named spawn function - self.spawnfunction(); - self.spawnmodel = self.model; - self.spawnmins = self.mins; - self.spawnmaxs = self.maxs; - setmodel (self, ""); - setsize (self, self.spawnmins, self.spawnmaxs); - //save off solid flag - self.spawnsolidtype = self.solid; - self.solid = SOLID_NOT; - //save off think func and - //get rid of his thinking - self.spawnthink = self.think; - self.think = spawn_think; - self.nextthink = time + 1; - - if(spawnchance<0.92 && monster==tempself) - { - monster = self; - } - - // spawn zombie - // spawn the new entity - self = spawn(); - // copy over everything - SUB_CopyEntity(tempself,self); - self.spawnfunction = monster_zombie; - self.spawnclassname = "monster_zombie"; - self.classname = self.spawnclassname; - - // call the named spawn function - self.spawnfunction(); - self.spawnmodel = self.model; - self.spawnmins = self.mins; - self.spawnmaxs = self.maxs; - setmodel (self, ""); - setsize (self, self.spawnmins, self.spawnmaxs); - //save off solid flag - self.spawnsolidtype = self.solid; - self.solid = SOLID_NOT; - //save off think func and - //get rid of his thinking - self.spawnthink = self.think; - self.think = spawn_think; - self.nextthink = time + 1; - - if(spawnchance<0.97 && monster==tempself) - { - monster = self; - } - - // spawn shambler - // spawn the new entity - self = spawn(); - // copy over everything - SUB_CopyEntity(tempself,self); - self.spawnfunction = monster_shambler; - self.spawnclassname = "monster_shambler"; - self.classname = self.spawnclassname; - - // call the named spawn function - self.spawnfunction(); - self.spawnmodel = self.model; - self.spawnmins = self.mins; - self.spawnmaxs = self.maxs; - setmodel (self, ""); - setsize (self, self.spawnmins, self.spawnmaxs); - //save off solid flag - self.spawnsolidtype = self.solid; - self.solid = SOLID_NOT; - //save off think func and - //get rid of his thinking - self.spawnthink = self.think; - self.think = spawn_think; - self.nextthink = time + 1; - - if(monster==tempself) - { - monster = self; - } - // make sure monster count is correct - total_monsters = temptotal_monsters + 1; - } - else - { - // spawn the new entity - self = spawn(); - // copy over everything - SUB_CopyEntity(tempself,self); - - // save off monster count so it doesn't get f'ed up - temptotal_monsters = total_monsters; - if(self.spawnclassname == string_null) - { - objerror("No spawnclassname defined"); - } - self.classname = self.spawnclassname; - // call the named spawn function - self.spawnfunction(); - if(self.spawnmulti != 0) - { - // make sure monster count is correct - total_monsters = temptotal_monsters; - } - self.spawnmodel = self.model; - self.spawnmins = self.mins; - self.spawnmaxs = self.maxs; - setmodel (self, ""); - self.model = ""; - setsize (self, self.spawnmins, self.spawnmaxs); - //save off solid flag - self.spawnsolidtype = self.solid; - self.solid = SOLID_NOT; - //save off think func and - //get rid of his thinking - self.spawnthink = self.think; - self.think = spawn_think; - self.nextthink = time + 1; - monster = self; - } - self = tempself; - deathmatch = tempdeathmatch; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - self.modelindex = 0; - self.model = ""; - setmodel (self, self.model); // set size and link into world - self.use = spawn_use; - self.spawnmaster = monster; - }; - -//================ -// -// func_spawn_small -// -//================ -/*QUAKED func_spawn_small (0 .5 .8) (-16 -16 -24) (16 16 40) big/ambush megahealth -This will spawn a thing upon being used. The thing that -is spawned depends upon the value of "spawnfunction". -"spawnclassname" should contain the same value as "spawnfunction". -If "spawnfunction" is unspecified a random monster is chosen. -The angles, target and all flags are passed on -Think of it like setting up a normal entity. -"spawnsilent" set this to 1 if you want a silent spawn. -"spawnmulti" set this to 1 if you want this spawn to be reoccuring. -*/ - -void() func_spawn_small = - { - func_spawn(); - }; diff --git a/QC/hipspike.qc b/QC/hipspike.qc deleted file mode 100644 index 07fb3fc4..00000000 --- a/QC/hipspike.qc +++ /dev/null @@ -1,56 +0,0 @@ -/* -============================================================================== - -spike mine - -============================================================================== -*/ - -$cd id1/models/demon3 -$scale 0.8 -$origin 0 0 24 -$base base -$skin base - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 -$frame stand10 stand11 stand12 stand13 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 - -$frame run1 run2 run3 run4 run5 run6 - -$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 -$frame leap11 leap12 - -$frame pain1 pain2 pain3 pain4 pain5 pain6 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 - -$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 -$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 - -void() monster_spikemine = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/demon.mdl"); - precache_model ("progs/h_demon.mdl"); - - precache_sound("demon/ddeath.wav"); - precache_sound("demon/dhit2.wav"); - precache_sound("demon/djump.wav"); - precache_sound("demon/dpain1.wav"); - precache_sound("demon/idle1.wav"); - precache_sound("demon/sight2.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/demon.mdl"); - - // TODO VR: (P2) tweak hitbox - setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); -}; diff --git a/QC/hipsubs.qc b/QC/hipsubs.qc deleted file mode 100644 index d68d12d2..00000000 --- a/QC/hipsubs.qc +++ /dev/null @@ -1,231 +0,0 @@ -//========================= -// -// Hipnotic Sub-routines -// -//========================= - - -//========================= -// -// SUB_CopyEntity -// -//========================= - -void (entity srcent, entity destent) SUB_CopyEntity = - { - destent.modelindex=srcent.modelindex; - destent.absmin=srcent.absmin; - destent.absmax=srcent.absmax; - destent.ltime=srcent.ltime; - destent.movetype=srcent.movetype; - destent.solid=srcent.solid; - destent.origin=srcent.origin; - destent.oldorigin=srcent.oldorigin; - destent.velocity=srcent.velocity; - destent.angles=srcent.angles; - destent.avelocity=srcent.avelocity; - destent.punchangle=srcent.punchangle; - destent.classname=srcent.classname; - destent.model=srcent.model; - destent.frame=srcent.frame; - destent.skin=srcent.skin; - destent.effects=srcent.effects; - destent.mins=srcent.mins; - destent.maxs=srcent.maxs; - destent.size=srcent.size; - destent.touch=srcent.touch; - destent.use=srcent.use; - destent.think=srcent.think; - destent.blocked=srcent.blocked; - destent.nextthink=srcent.nextthink; - destent.groundentity=srcent.groundentity; - destent.health=srcent.health; - destent.frags=srcent.frags; - destent.weapon=srcent.weapon; - destent.weaponmodel=srcent.weaponmodel; - destent.weaponframe=srcent.weaponframe; - destent.weapon2=srcent.weapon2; - destent.weaponmodel2=srcent.weaponmodel2; - destent.weaponframe2=srcent.weaponframe2; - destent.prevweapon=srcent.prevweapon; - destent.prevweapon2=srcent.prevweapon2; - destent.holsterweapon0=srcent.holsterweapon0; - destent.holsterweapon1=srcent.holsterweapon1; - destent.holsterweapon2=srcent.holsterweapon2; - destent.holsterweapon3=srcent.holsterweapon3; - destent.holsterweapon4=srcent.holsterweapon4; - destent.holsterweapon5=srcent.holsterweapon5; - destent.holsterweaponmodel0=srcent.holsterweaponmodel0; - destent.holsterweaponmodel1=srcent.holsterweaponmodel1; - destent.holsterweaponmodel2=srcent.holsterweaponmodel2; - destent.holsterweaponmodel3=srcent.holsterweaponmodel3; - destent.holsterweaponmodel4=srcent.holsterweaponmodel4; - destent.holsterweaponmodel5=srcent.holsterweaponmodel5; - destent.currentammo=srcent.currentammo; - destent.currentammo2=srcent.currentammo2; - destent.ammocounter=srcent.ammocounter; - destent.ammocounter2=srcent.ammocounter2; - destent.ammo_shells=srcent.ammo_shells; - destent.ammo_nails=srcent.ammo_nails; - destent.ammo_rockets=srcent.ammo_rockets; - destent.ammo_cells=srcent.ammo_cells; - destent.items=srcent.items; - destent.takedamage=srcent.takedamage; - destent.chain=srcent.chain; - destent.deadflag=srcent.deadflag; - destent.view_ofs=srcent.view_ofs; - destent.button0=srcent.button0; - destent.button1=srcent.button1; - destent.button2=srcent.button2; - destent.impulse=srcent.impulse; - destent.fixangle=srcent.fixangle; - destent.v_angle=srcent.v_angle; - destent.idealpitch=srcent.idealpitch; - destent.netname=srcent.netname; - destent.enemy=srcent.enemy; - destent.flags=srcent.flags; - destent.colormap=srcent.colormap; - destent.team=srcent.team; - destent.max_health=srcent.max_health; - destent.teleport_time=srcent.teleport_time; - destent.armortype=srcent.armortype; - destent.armorvalue=srcent.armorvalue; - destent.waterlevel=srcent.waterlevel; - destent.watertype=srcent.watertype; - destent.ideal_yaw=srcent.ideal_yaw; - destent.yaw_speed=srcent.yaw_speed; - destent.aiment=srcent.aiment; - destent.goalentity=srcent.goalentity; - destent.spawnflags=srcent.spawnflags; - destent.target=srcent.target; - destent.targetname=srcent.targetname; - destent.dmg_take=srcent.dmg_take; - destent.dmg_save=srcent.dmg_save; - destent.dmg_inflictor=srcent.dmg_inflictor; - destent.owner=srcent.owner; - destent.movedir=srcent.movedir; - destent.message=srcent.message; - destent.sounds=srcent.sounds; - destent.noise=srcent.noise; - destent.noise1=srcent.noise1; - destent.noise2=srcent.noise2; - destent.noise3=srcent.noise3; - destent.wad=srcent.wad; - destent.map=srcent.map; - destent.worldtype=srcent.worldtype; - destent.killtarget=srcent.killtarget; - destent.light_lev=srcent.light_lev; - destent.style=srcent.style; - destent.th_stand=srcent.th_stand; - destent.th_walk=srcent.th_walk; - destent.th_run=srcent.th_run; - destent.th_missile=srcent.th_missile; - destent.th_melee=srcent.th_melee; - destent.th_pain=srcent.th_pain; - destent.th_die=srcent.th_die; - destent.th_turn=srcent.th_turn; - destent.oldenemy=srcent.oldenemy; - destent.speed=srcent.speed; - destent.lefty=srcent.lefty; - destent.search_time=srcent.search_time; - destent.attack_state=srcent.attack_state; - destent.walkframe=srcent.walkframe; - destent.attack_finished=srcent.attack_finished; - destent.pain_finished=srcent.pain_finished; - destent.invincible_finished=srcent.invincible_finished; - destent.invisible_finished=srcent.invisible_finished; - destent.super_damage_finished=srcent.super_damage_finished; - destent.radsuit_finished=srcent.radsuit_finished; - destent.invincible_time=srcent.invincible_time; - destent.invincible_sound=srcent.invincible_sound; - destent.invisible_time=srcent.invisible_time; - destent.invisible_sound=srcent.invisible_sound; - destent.super_time=srcent.super_time; - destent.super_sound=srcent.super_sound; - destent.rad_time=srcent.rad_time; - destent.fly_sound=srcent.fly_sound; - destent.axhitme=srcent.axhitme; - destent.show_hostile=srcent.show_hostile; - destent.jump_flag=srcent.jump_flag; - destent.swim_flag=srcent.swim_flag; - destent.air_finished=srcent.air_finished; - destent.bubble_count=srcent.bubble_count; - destent.deathtype=srcent.deathtype; - destent.mdl=srcent.mdl; - destent.mangle=srcent.mangle; - destent.oldorigin=srcent.oldorigin; - destent.t_length=srcent.t_length; - destent.t_width=srcent.t_width; - destent.dest=srcent.dest; - destent.dest1=srcent.dest1; - destent.dest2=srcent.dest2; - destent.wait=srcent.wait; - destent.delay=srcent.delay; - destent.trigger_field=srcent.trigger_field; - destent.noise4=srcent.noise4; - destent.pausetime=srcent.pausetime; - destent.movetarget=srcent.movetarget; - destent.aflag=srcent.aflag; - destent.dmg=srcent.dmg; - destent.cnt=srcent.cnt; - destent.think1=srcent.think1; - destent.finaldest=srcent.finaldest; - destent.finalangle=srcent.finalangle; - destent.count=srcent.count; - destent.lip=srcent.lip; - destent.state=srcent.state; - destent.pos1=srcent.pos1; - destent.pos2=srcent.pos2; - destent.height=srcent.height; - destent.waitmin=srcent.waitmin; - destent.waitmax=srcent.waitmax; - destent.distance=srcent.distance; - destent.volume=srcent.volume; - destent.gorging=srcent.gorging; - destent.stoleweapon=srcent.stoleweapon; - destent.spawnfunction=srcent.spawnfunction; - destent.spawnthink=srcent.spawnthink; - destent.spawnmodel=srcent.spawnmodel; - destent.spawnsolidtype=srcent.spawnsolidtype; - destent.spawnmins=srcent.spawnmins; - destent.spawnmaxs=srcent.spawnmaxs; - destent.spawnclassname=srcent.spawnclassname; - }; - -//========================= -// -// SUB_NormalizeAngles -// -//========================= - -vector ( vector ang ) SUB_NormalizeAngles = - { - while( ang_x > 360 ) - { - ang_x = ang_x - 360; - } - while( ang_x < 0 ) - { - ang_x = ang_x + 360; - } - - while( ang_y > 360 ) - { - ang_y = ang_y - 360; - } - while( ang_y < 0 ) - { - ang_y = ang_y + 360; - } - - while( ang_z > 360 ) - { - ang_z = ang_z - 360; - } - while( ang_z < 0 ) - { - ang_z = ang_z + 360; - } - - return ang; - }; diff --git a/QC/hiptrain.qc b/QC/hiptrain.qc deleted file mode 100644 index 0cb4d442..00000000 --- a/QC/hiptrain.qc +++ /dev/null @@ -1,205 +0,0 @@ -/* Train QuickC program - By Jim Dose' 9/11/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -void() train_blocked; -void() func_train; -void() HIP_train_next; -void() HIP_func_train_find; - -void() HIP_train_use = -{ - if(self.think != HIP_func_train_find) - { - if( self.velocity != '0 0 0' ) - return; // already activated - } - HIP_train_next(); -}; - -void() HIP_train_wait = - { - if(self.wait) - { - sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - if( self.wait != -1 ) - { - self.nextthink = self.ltime + self.wait; - self.wait = 0; - } - } - else - self.nextthink = self.ltime + 0.1; - - self.think = HIP_train_next; - }; - - -void() HIP_train_next = -{ - local entity targ; - local float current; - local string temp; - - // Get the speed of the current path_corner. - // (we must save this off at each path change since - // we don't have a pointer to the current path_corner). - current = self.cnt; - - targ = find (world, targetname, self.target); - - // Save the speed in cnt for later use - self.cnt = targ.speed; - self.target = targ.target; - if(!self.target) - objerror ("HIP_train_next: no next target"); - - sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - - self.wait = targ.wait; - if(targ.wait) - { - self.think = HIP_train_wait; - } - else - { - self.think = HIP_train_next; - } - - if( self.goalentity.event ) - { - // Trigger any events that should happen at the corner. - temp = self.target; - self.target = self.goalentity.event; - self.message = self.goalentity.message; - SUB_UseTargets(); - self.target = temp; - self.message = string_null; - } - - // Save the current entity - self.goalentity = targ; - - if( current == -1 ) - { - // Warp to the next path_corner - setorigin (self, targ.origin - self.mins ); - self.nextthink = self.ltime + 0.01; - } - else - { - // check if there's a speed change - if(current>0) - self.speed = current; - - // travel to the next path change - SUB_CalcMove (targ.origin - self.mins, self.speed, self.think ); - } - }; - -void() HIP_func_train_find = - -{ - local entity targ; - - targ = find (world, targetname, self.target); - - // Save the current entity - self.goalentity = targ; - - // Save the speed in cnt for later use - self.cnt = targ.speed; - - self.target = targ.target; - setorigin (self, targ.origin - self.mins); - if(!self.targetname) - { // not triggered, so start immediately - self.nextthink = self.ltime + 0.1; - self.think = HIP_train_next; - } -}; - -/*QUAKED func_train2 (0 .5 .8) ? -This is a modification of the standard func_train entity. -It is functionally equivalent, except that it removes a slight delay that -would occur after each path entry, and it adds a speed variable to the -path_corner entity. - -"noise" contains the name of the sound to play when train stops. -"noise1" contains the name of the sound to play when train moves. -Both "noise" and "noise1" defaults depend upon "sounds" variable. - -In path_corner, set speed to be the new speed of the train after it reaches -the path change. If speed is -1, the train will warp directly to the next -path change after the specified wait time. - -Also in path_corner, if wait is set to -1, the train will wait until it is -retriggered before moving on to the next goal. - -Here is a reiteration of the func_train docs: - -Trains are moving platforms that players can ride. -The targets origin specifies the min point of the train at each corner. -The train spawns at the first target it is pointing at. -If the train is the target of a button or trigger, it will not begin moving until activated. -speed default 100 -dmg default 2 -sounds -1) ratchet metal - -*/ -void() func_train2 = -{ - if(!self.speed) - self.speed = 100; - if(!self.target) - objerror ("func_train without a target"); - if(!self.dmg) - self.dmg = 2; - - if( !self.noise ) - { - if(self.sounds == 0) - { - self.noise = ("misc/null.wav"); - } - - if(self.sounds == 1) - { - self.noise = ("plats/train2.wav"); - } - } - if( !self.noise1 ) - { - if(self.sounds == 0) - { - self.noise1 = ("misc/null.wav"); - } - if(self.sounds == 1) - { - self.noise1 = ("plats/train1.wav"); - } - } - - precache_sound( self.noise ); - precache_sound( self.noise1 ); - - self.cnt = 1; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - self.blocked = train_blocked; - self.use = HIP_train_use; - self.classname = "train2"; - - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - setorigin (self, self.origin); - -// start trains on the second frame, to make sure their targets have had -// a chance to spawn - self.nextthink = self.ltime + 0.1; - self.think = HIP_func_train_find; -}; diff --git a/QC/hiptrig.qc b/QC/hiptrig.qc deleted file mode 100644 index d4f9af82..00000000 --- a/QC/hiptrig.qc +++ /dev/null @@ -1,282 +0,0 @@ -/* Trigger QuickC program - By Jim Dose' 12/2/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -float USE_GOLD_KEY = 1; - -void() keytrigger_use = - { - if(activator.classname != "player") - return; - if(self.attack_finished > time) - return; - - self.attack_finished = time + 2; - -// FIXME: blink key on player's status bar - if( (self.items & activator.items) != self.items ) - { - if(self.message != "") - { - centerprint (activator, self.message); - } - else - { - if(self.owner.items == IT_KEY1) - { - if(world.worldtype == 2) - { - centerprint (activator, "You need the silver keycard"); - } - else if(world.worldtype == 1) - { - centerprint (activator, "You need the silver runekey"); - } - else if(world.worldtype == 0) - { - centerprint (activator, "You need the silver key"); - } - } - else - { - if(world.worldtype == 2) - { - centerprint (activator, "You need the gold keycard"); - } - else if(world.worldtype == 1) - { - centerprint (activator, "You need the gold runekey"); - } - else if(world.worldtype == 0) - { - centerprint (activator, "You need the gold key"); - } - } - } - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); - return; - } - - activator.items = activator.items - self.items; - - // we can't just remove (self) here, because this is a touch function - // called while C code is looping through area links... - self.touch = SUB_Null; - self.use = SUB_Null; - self.nextthink = time + 0.1; - self.think = SUB_Remove; - self.message = ""; - - sound(self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); - - SUB_UseTargets(); - }; - -void() keytrigger_touch = - { - activator = other; - keytrigger_use(); - }; - -/*QUAKED trigger_usekey (0 .5 0) ? USE_GOLD_KEY -Variable sized single use trigger that requires a key to trigger targets. Must be targeted at one or more entities. - -"message" is printed when the trigger is touched without having the right key. -*/ - -void() trigger_usekey = - { - if(world.worldtype == 0) - { - precache_sound("doors/medtry.wav"); - precache_sound("doors/meduse.wav"); - self.noise3 = "doors/medtry.wav"; - self.noise4 = "doors/meduse.wav"; - } - else if(world.worldtype == 1) - { - precache_sound("doors/runetry.wav"); - precache_sound("doors/runeuse.wav"); - self.noise3 = "doors/runetry.wav"; - self.noise4 = "doors/runeuse.wav"; - } - else if(world.worldtype == 2) - { - precache_sound("doors/basetry.wav"); - precache_sound("doors/baseuse.wav"); - self.noise3 = "doors/basetry.wav"; - self.noise4 = "doors/baseuse.wav"; - } - else - { - dprint ("no worldtype set!\n"); - } - - if(self.spawnflags & USE_GOLD_KEY) - self.items = IT_KEY2; - else - self.items = IT_KEY1; - - self.use = keytrigger_use; - self.touch = keytrigger_touch; - - InitTrigger(); - }; - -void() remove_touch = - { - if(other.flags & self.cnt) - return; - other.touch = SUB_Null; - other.model = ""; - remove(self); -// other.nextthink = time + 0.1; -// other.think = SUB_Remove; - }; - -/*QUAKED trigger_remove (.5 .5 .5) ? ignoremonsters ignoreplayers -Variable sized trigger that removes the thing -that touches it. Does not affect monsters or -players. -*/ -void() trigger_remove = - { - self.cnt = FL_CLIENT|FL_MONSTER; - if(self.spawnflags & 1) - self.cnt = self.cnt - FL_MONSTER; - if(self.spawnflags & 2) - self.cnt = self.cnt - FL_CLIENT; - InitTrigger(); - self.touch = remove_touch; - }; -/* -============================================================================== - -trigger_setgravity - -============================================================================== -*/ - -void() trigger_gravity_touch = -{ - if(other.classname != "player") - return; - if(self.gravity == -1) - other.gravity = 1.0; - else - other.gravity = self.gravity; -}; - -/*QUAKED trigger_setgravity (.5 .5 .5) ? -set the gravity of a player -"gravity" what to set the players gravity to - - 0 (default) normal gravity - - 1 no gravity - - 2 almost no gravity - - ... - - 101 normal gravity - - 102 slightly higher gravity - - ... - - 1000 very high gravity -*/ -void() trigger_setgravity = -{ - InitTrigger(); - self.touch = trigger_gravity_touch; - if(!self.gravity) - { - self.gravity = -1; - } - else - { - self.gravity = ((self.gravity - 1) / 100); - } -}; - -void() trigger_command_use = - { - if( self.message ) - localcmd( self.message ); - }; - -/*QUAKED trigger_command (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) - When triggered, stuffs a command into the console to allow map - designers to set server variables. - - "message" is the command to send to the console. -*/ - -void() trigger_command = - { - self.use = oncount_use; - self.think = SUB_Null; - }; - -void() trigger_decoy_touch = - { - if(other.classname != "monster_decoy") - return; - self.touch = SUB_Null; - self.nextthink = time + 0.1; - self.think = SUB_Remove; - SUB_UseTargets(); - }; - -/*QUAKED trigger_decoy_use (.5 .5 .5) ? - only the decoy player can trigger this - once triggers, all targets are used -*/ - -void() trigger_decoy_use = - { - if(deathmatch) - { - remove(self); - return; - } - InitTrigger(); - self.touch = trigger_decoy_touch; - }; - -void() trigger_waterfall_touch = - { - // only affect players - if(!(other.flags & FL_CLIENT)) - { - return; - } - - other.velocity = other.velocity + self.movedir; - other.velocity_x = other.velocity_x + self.count * ( random() - 0.5 ); - other.velocity_y = other.velocity_y + self.count * ( random() - 0.5 ); - }; - -/*QUAKED trigger_waterfall (.2 .5 .2) ? - Pushes the player in the direction specified by angles. - - "speed" is the strength of the push (default 50). - "count" amount of random xy movement to add to velocity (default 100). -*/ - -void() trigger_waterfall = - { - InitTrigger(); - self.touch = trigger_waterfall_touch; - - if( self.count == 0 ) - { - self.count = 100; - } - - if( self.speed == 0 ) - { - self.movedir = self.movedir * 50; - } - else - { - self.movedir = self.movedir * self.speed; - } - }; diff --git a/QC/hipwater.qc b/QC/hipwater.qc deleted file mode 100644 index a2927fa5..00000000 --- a/QC/hipwater.qc +++ /dev/null @@ -1,53 +0,0 @@ -/* Water QuickC program - By Jim Dose' 12/16/96 - Copyright (c)1996 Hipnotic Interactive, Inc. - All rights reserved. - Do not distribute. -*/ - -void() bobbingwater_think = - { - local vector ang; - - self.count = self.count + self.speed * ( time - self.ltime ); - if( self.count > 360 ) - { - self.count = self.count - 360; - } - ang_x = self.count; - ang_y = 0; - ang_z = 0; - makevectors( ang ); - self.origin_z = v_forward_z * self.cnt; - setorigin( self, self.origin ); - self.ltime = time; - self.nextthink = time + 0.02; - }; - -/*QUAKED func_bobbingwater (0 .5 .8) ? -Used to emulate water. To use, create a thin water brush and center it -on the water line of the body of water to bob. The amount of the bob -is the depth of the brush. - -"speed" is how long in seconds it takes the brush to do one full bob. -*/ -void() func_bobbingwater = - { - self.angles = '0 0 0'; - self.movetype = MOVETYPE_STEP; - self.solid = SOLID_NOT; - setmodel (self,self.model); - self.think = bobbingwater_think; - - self.count = 0; - self.cnt = self.size_z / 2; - if( !self.speed ) - { - self.speed = 4; - } - - self.speed = 360 / self.speed; - - self.nextthink = time + 0.02; - self.ltime = time; - }; diff --git a/QC/hknight.qc b/QC/hknight.qc deleted file mode 100644 index 11acae47..00000000 --- a/QC/hknight.qc +++ /dev/null @@ -1,545 +0,0 @@ -/* -============================================================================== - -KNIGHT - -============================================================================== -*/ - -$cd id1/models/knight2 -// TODO VR: (P2) rogue -// $cd /raid/quake/id1/models/knight2 -$origin 0 0 24 -$base base -$skin skin -$skin statue2 - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 -$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 -$frame walk18 walk19 walk20 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 - -$frame pain1 pain2 pain3 pain4 pain5 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 -$frame death9 death10 death11 death12 - -$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 -$frame deathb9 - -$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 -$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 - -$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 -$frame magica9 magica10 magica11 magica12 magica13 magica14 - -$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 -$frame magicb9 magicb10 magicb11 magicb12 magicb13 - -$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 - -$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 - -$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 -$frame smash11 - -$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 -$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 -$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 -$frame w_attack21 w_attack22 - -$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 -$frame magicc9 magicc10 magicc11 - - -void() hknight_char_a1; -void() hknight_run1; -void() hk_idle_sound; - -void(float offset) hknight_shot = -{ - local vector offang; - local vector org, vec; - - offang = vectoangles (self.enemy.origin - self.origin); - offang_y = offang_y + offset * 6; - - makevectors (offang); - - org = self.origin + self.mins + self.size*0.5 + v_forward * 20; - -// set missile speed - vec = normalize (v_forward); - vec_z = 0 - vec_z + (random() - 0.5)*0.1; - - launch_spike (org, vec); - newmis.classname = "knightspike"; - setmodel (newmis, "progs/k_spike.mdl"); - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - newmis.velocity = vec*300; - sound(self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); -}; - -void() CheckForCharge = -{ -// check for mad charge -if(!enemy_vis) - return; -if(time < self.attack_finished) - return; -if( fabs(self.origin_z - self.enemy.origin_z) > 20) - return; // too much height change -if( vlen (self.origin - self.enemy.origin) < 80) - return; // use regular attack - -// charge - SUB_AttackFinished (2); - hknight_char_a1(); - -}; - -void() CheckContinueCharge = -{ - if(time > self.attack_finished) - { - SUB_AttackFinished (3); - hknight_run1(); - return; // done charging - } - if(random() > 0.5) - sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); - else - sound(self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); -}; - -//=========================================================================== - -void() hknight_stand1 =[ $stand1, hknight_stand2 ] {ai_stand();}; -void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();}; -void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();}; -void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();}; -void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();}; -void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();}; -void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();}; -void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();}; -void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();}; - -//=========================================================================== - -void() hknight_walk1 =[ $walk1, hknight_walk2 ] { -hk_idle_sound(); -ai_walk(2);}; -void() hknight_walk2 =[ $walk2, hknight_walk3 ] {ai_walk(5);}; -void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);}; -void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);}; -void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);}; -void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);}; -void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);}; -void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);}; -void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);}; -void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);}; -void() hknight_walk11 =[ $walk11, hknight_walk12 ] {ai_walk(3);}; -void() hknight_walk12 =[ $walk12, hknight_walk13 ] {ai_walk(4);}; -void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);}; -void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);}; -void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);}; -void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);}; -void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);}; -void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);}; -void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);}; -void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);}; - -//=========================================================================== - -void() hknight_run1 =[ $run1, hknight_run2 ] { -hk_idle_sound(); -ai_run (20); CheckForCharge(); }; -void() hknight_run2 =[ $run2, hknight_run3 ] {ai_run(25);}; -void() hknight_run3 =[ $run3, hknight_run4 ] {ai_run(18);}; -void() hknight_run4 =[ $run4, hknight_run5 ] {ai_run(16);}; -void() hknight_run5 =[ $run5, hknight_run6 ] {ai_run(14);}; -void() hknight_run6 =[ $run6, hknight_run7 ] {ai_run(25);}; -void() hknight_run7 =[ $run7, hknight_run8 ] {ai_run(21);}; -void() hknight_run8 =[ $run8, hknight_run1 ] {ai_run(13);}; - -//============================================================================ - -void() hknight_pain1 =[ $pain1, hknight_pain2 ] - { - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/pain.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM); - }; -void() hknight_pain2 =[ $pain2, hknight_pain3 ] {}; -void() hknight_pain3 =[ $pain3, hknight_pain4 ] {}; -void() hknight_pain4 =[ $pain4, hknight_pain5 ] {}; -void() hknight_pain5 =[ $pain5, hknight_run1 ] {}; - -//============================================================================ - -void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);}; -void() hknight_die2 =[ $death2, hknight_die3 ] {ai_forward(8);}; -void() hknight_die3 =[ $death3, hknight_die4 ] -{self.solid = SOLID_NOT; ai_forward(7);}; -void() hknight_die4 =[ $death4, hknight_die5 ] {}; -void() hknight_die5 =[ $death5, hknight_die6 ] {}; -void() hknight_die6 =[ $death6, hknight_die7 ] {}; -void() hknight_die7 =[ $death7, hknight_die8 ] {}; -void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);}; -void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);}; -void() hknight_die10 =[ $death10, hknight_die11 ] {}; -void() hknight_die11 =[ $death11, hknight_die12 ] {}; -void() hknight_die12 =[ $death12, hknight_die12 ] {}; - -void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {}; -void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {}; -void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] -{self.solid = SOLID_NOT;}; -void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {}; -void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {}; -void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {}; -void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {}; -void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {}; -void() hknight_dieb9 =[ $deathb9, hknight_dieb9 ] {}; - -void() hknight_die = -{ -// check for gib - if(self.health < -40) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_hellkn.mdl", self.health); - - if(self.spawnflags & 2) // statue - { - ThrowGib ( "progs/statgib1.mdl", self.health); - ThrowGib ( "progs/statgib2.mdl", self.health); - ThrowGib ( "progs/statgib3.mdl", self.health); - } - else - { - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - } - return; - } - -// regular death - - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/death.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); - - if(random() > 0.5) - hknight_die1(); - else - hknight_dieb1(); -}; - - -//============================================================================ - -void() hknight_magica1 =[ $magica1, hknight_magica2 ] {ai_face();}; -void() hknight_magica2 =[ $magica2, hknight_magica3 ] {ai_face();}; -void() hknight_magica3 =[ $magica3, hknight_magica4 ] {ai_face();}; -void() hknight_magica4 =[ $magica4, hknight_magica5 ] {ai_face();}; -void() hknight_magica5 =[ $magica5, hknight_magica6 ] {ai_face();}; -void() hknight_magica6 =[ $magica6, hknight_magica7 ] {ai_face();}; -void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);}; -void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);}; -void() hknight_magica9 =[ $magica9, hknight_magica10] {hknight_shot(0);}; -void() hknight_magica10 =[ $magica10, hknight_magica11] {hknight_shot(1);}; -void() hknight_magica11 =[ $magica11, hknight_magica12] {hknight_shot(2);}; -void() hknight_magica12 =[ $magica12, hknight_magica13] {hknight_shot(3);}; -void() hknight_magica13 =[ $magica13, hknight_magica14] {ai_face();}; -void() hknight_magica14 =[ $magica14, hknight_run1 ] {ai_face();}; - -//============================================================================ - -void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {ai_face();}; -void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {ai_face();}; -void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {ai_face();}; -void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {ai_face();}; -void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {ai_face();}; -void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {ai_face();}; -void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);}; -void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);}; -void() hknight_magicb9 =[ $magicb9, hknight_magicb10] {hknight_shot(0);}; -void() hknight_magicb10 =[ $magicb10, hknight_magicb11] {hknight_shot(1);}; -void() hknight_magicb11 =[ $magicb11, hknight_magicb12] {hknight_shot(2);}; -void() hknight_magicb12 =[ $magicb12, hknight_magicb13] {hknight_shot(3);}; -void() hknight_magicb13 =[ $magicb13, hknight_run1] {ai_face();}; - -//============================================================================ - -void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {ai_face();}; -void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {ai_face();}; -void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {ai_face();}; -void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {ai_face();}; -void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {ai_face();}; -void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2);}; -void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1);}; -void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0);}; -void() hknight_magicc9 =[ $magicc9, hknight_magicc10] {hknight_shot(1);}; -void() hknight_magicc10 =[ $magicc10, hknight_magicc11] {hknight_shot(2);}; -void() hknight_magicc11 =[ $magicc11, hknight_run1] {hknight_shot(3);}; - -//=========================================================================== - -void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] {ai_charge(20);}; -void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {ai_charge(25);}; -void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {ai_charge(18);}; -void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] {ai_charge(16);}; -void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {ai_charge(14);}; -void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {ai_charge(20); ai_melee();}; -void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {ai_charge(21); ai_melee();}; -void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {ai_charge(13); ai_melee();}; -void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {ai_charge(20); ai_melee();}; -void() hknight_char_a10=[ $char_a10, hknight_char_a11 ] {ai_charge(20); ai_melee();}; -void() hknight_char_a11=[ $char_a11, hknight_char_a12 ] {ai_charge(18); ai_melee();}; -void() hknight_char_a12=[ $char_a12, hknight_char_a13 ] {ai_charge(16);}; -void() hknight_char_a13=[ $char_a13, hknight_char_a14 ] {ai_charge(14);}; -void() hknight_char_a14=[ $char_a14, hknight_char_a15 ] {ai_charge(25);}; -void() hknight_char_a15=[ $char_a15, hknight_char_a16 ] {ai_charge(21);}; -void() hknight_char_a16=[ $char_a16, hknight_run1 ] {ai_charge(13);}; - -//=========================================================================== - -void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] -{CheckContinueCharge(); ai_charge(23); ai_melee();}; -void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {ai_charge(17); ai_melee();}; -void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {ai_charge(12); ai_melee();}; -void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {ai_charge(22); ai_melee();}; -void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {ai_charge(18); ai_melee();}; -void() hknight_char_b6 =[ $char_b6, hknight_char_b1 ] {ai_charge(8); ai_melee();}; - -//=========================================================================== - -void() hknight_slice1 =[ $slice1, hknight_slice2 ] {ai_charge(9);}; -void() hknight_slice2 =[ $slice2, hknight_slice3 ] {ai_charge(6);}; -void() hknight_slice3 =[ $slice3, hknight_slice4 ] {ai_charge(13);}; -void() hknight_slice4 =[ $slice4, hknight_slice5 ] {ai_charge(4);}; -void() hknight_slice5 =[ $slice5, hknight_slice6 ] {ai_charge(7); ai_melee();}; -void() hknight_slice6 =[ $slice6, hknight_slice7 ] {ai_charge(15); ai_melee();}; -void() hknight_slice7 =[ $slice7, hknight_slice8 ] {ai_charge(8); ai_melee();}; -void() hknight_slice8 =[ $slice8, hknight_slice9 ] {ai_charge(2); ai_melee();}; -void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();}; -void() hknight_slice10 =[ $slice10, hknight_run1 ] {ai_charge(3);}; - -//=========================================================================== - -void() hknight_smash1 =[ $smash1, hknight_smash2 ] {ai_charge(1);}; -void() hknight_smash2 =[ $smash2, hknight_smash3 ] {ai_charge(13);}; -void() hknight_smash3 =[ $smash3, hknight_smash4 ] {ai_charge(9);}; -void() hknight_smash4 =[ $smash4, hknight_smash5 ] {ai_charge(11);}; -void() hknight_smash5 =[ $smash5, hknight_smash6 ] {ai_charge(10); ai_melee();}; -void() hknight_smash6 =[ $smash6, hknight_smash7 ] {ai_charge(7); ai_melee();}; -void() hknight_smash7 =[ $smash7, hknight_smash8 ] {ai_charge(12); ai_melee();}; -void() hknight_smash8 =[ $smash8, hknight_smash9 ] {ai_charge(2); ai_melee();}; -void() hknight_smash9 =[ $smash9, hknight_smash10 ] {ai_charge(3); ai_melee();}; -void() hknight_smash10 =[ $smash10, hknight_smash11 ] {ai_charge(0);}; -void() hknight_smash11 =[ $smash11, hknight_run1 ] {ai_charge(0);}; - -//============================================================================ - -void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {ai_charge(2);}; -void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {ai_charge(0);}; -void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {ai_charge(0);}; -void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {ai_melee();}; -void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_melee();}; -void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_melee();}; -void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {ai_charge(1);}; -void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {ai_charge(4);}; -void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {ai_charge(5);}; -void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {ai_charge(3); ai_melee();}; -void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {ai_charge(2); ai_melee();}; -void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {ai_charge(2); ai_melee();}; -void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {ai_charge(0);}; -void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {ai_charge(0);}; -void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {ai_charge(0);}; -void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {ai_charge(1);}; -void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {ai_charge(1); ai_melee();}; -void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {ai_charge(3); ai_melee();}; -void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {ai_charge(4); ai_melee();}; -void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {ai_charge(6);}; -void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {ai_charge(7);}; -void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {ai_charge(3);}; - -//============================================================================ - -void() hk_idle_sound = -{ - if(random() < 0.2) - { - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/idle.wav", 1, ATTN_IDLE); - else - sound(self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); - } -}; - -void(entity attacker, float damage) hknight_pain = -{ - if(self.pain_finished > time) - return; - - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/pain.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM); - - if(time - self.pain_finished > 5) - { // allways go into pain frame if it has been a while - hknight_pain1(); - self.pain_finished = time + 1; - return; - } - - if((random()*30 > damage) ) - return; // didn't flinch - - self.pain_finished = time + 1; - hknight_pain1(); -}; - -float hknight_type; - -void() hknight_melee = -{ - hknight_type = hknight_type + 1; - - sound(self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); - if(hknight_type == 1) - hknight_slice1(); - else if(hknight_type == 2) - hknight_smash1(); - else if(hknight_type == 3) - { - hknight_watk1(); - hknight_type = 0; - } -}; - -void() hknight_pause = -{ - sound( self, CHAN_VOICE, "statue/see.wav", 1, ATTN_NORM); - - self.takedamage = DAMAGE_AIM; - self.th_stand = hknight_stand1; - self.th_walk = hknight_walk1; - self.th_run = hknight_run1; - self.th_melee = hknight_melee; - self.th_missile = hknight_magicc1; - self.th_pain = hknight_pain; - self.th_die = hknight_die; - self.use = SUB_Null; - - self.enemy = activator; - self.nextthink = time + 0.1; - self.think = FoundTarget; - - self.delay = 0; -}; - -void() hknight_pause1 = -{ - self.takedamage = DAMAGE_NO; - self.use = hknight_pause; - self.think = hknight_pause1; - self.nextthink = time + 0.1; -}; - -/*QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush Statue - -Statue - select this to use the stone skin and have him frozen in place. - -delay: time from sight to attack (default 5) -frame: frame to be frozen in. (default 73) -*/ -void() monster_hell_knight = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model2 ("progs/hknight.mdl"); - precache_model2 ("progs/k_spike.mdl"); - precache_model2 ("progs/h_hellkn.mdl"); - - if(self.spawnflags & 2) // statue - { - precache_model ( "progs/statgib1.mdl"); - precache_model ( "progs/statgib2.mdl"); - precache_model ( "progs/statgib3.mdl"); - precache_sound( "statue/see.wav"); - precache_sound( "statue/idle.wav"); - precache_sound( "statue/pain.wav"); - precache_sound( "statue/death.wav"); - } - else - { - precache_sound2 ("hknight/death1.wav"); - precache_sound2 ("hknight/pain1.wav"); - precache_sound2 ("hknight/sight1.wav"); - precache_sound2 ("hknight/idle.wav"); - - } - - precache_sound2 ("hknight/attack1.wav"); - precache_sound("hknight/hit.wav"); // used by C code, so don't sound2 - precache_sound2 ("hknight/slash1.wav"); - precache_sound2 ("hknight/grunt.wav"); - - precache_sound("knight/sword1.wav"); - precache_sound("knight/sword2.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/hknight.mdl"); - - setsize (self, '-12 -12 -24', '12 12 36'); - self.health = 250; - - if(self.spawnflags & 2) // statue - { - if(self.frame == 0) - self.frame = 73; - self.skin = 1; - - if(!self.targetname) - { - dprint ("statue not targeted\n"); - dprint (self.classname); - dprint (" at "); - dprint (vtos(self.origin)); - dprint ("\n"); - return; - } - - self.use = hknight_pause; - self.th_stand = hknight_pause1; - self.th_walk = hknight_pause1; - self.th_run = hknight_pause1; - walkmonster_start(); - } - else - { - self.th_stand = hknight_stand1; - self.th_walk = hknight_walk1; - self.th_run = hknight_run1; - self.th_melee = hknight_melee; - self.th_missile = hknight_magicc1; - self.th_pain = hknight_pain; - self.th_die = hknight_die; - - walkmonster_start(); - } -}; diff --git a/QC/honey_ai.qc b/QC/honey_ai.qc new file mode 100644 index 00000000..e4e61278 --- /dev/null +++ b/QC/honey_ai.qc @@ -0,0 +1,120 @@ +/* +============= +point_visible + +returns 1 if the entity is visible to self's origin, even if not infront () +============= +*/ + +float (vector spot1, vector spot2) point_visible = +{ + // see through other monsters + traceline(spot1, spot2, TRUE, self); + + if(trace_inopen && trace_inwater) + { + // sight line crossed contents + return FALSE; + } + + //MED 11/21/96 + if(trace_fraction == 1) + { + visible_distance = vlen(spot2 - spot1); + return TRUE; + } + + return FALSE; +} + +/* +============= +bbox_visible + +returns 1 if the entity is visible to self's bounding box, even if not infront () +============= +*/ + +float (entity client, vector spot2) bbox_visible = +{ + vector spot1, bboxspot; + float res; + float bbox_scale = 1.25; + +// dprint_str_v_str("player is at ",spot2, "\n"); + + spot1 = client.origin + client.view_ofs; + + bboxspot_x = spot1_x + client.maxs_x * bbox_scale; + bboxspot_y = spot1_y + client.maxs_y * bbox_scale; + bboxspot_z = spot1_z; +// dprint_str_v_str("1: Testing visibility to ",bboxspot, "\n"); + res = point_visible(bboxspot, spot2); + if(res) return res; + + bboxspot_x = spot1_x + client.mins_x * bbox_scale; + bboxspot_y = spot1_y + client.maxs_y * bbox_scale; + bboxspot_z = spot1_z; +// dprint_str_v_str("2: Testing visibility to ",bboxspot, "\n"); + res = point_visible(bboxspot, spot2); + if(res) return res; + + bboxspot_x = spot1_x + client.maxs_x * bbox_scale; + bboxspot_y = spot1_y + client.mins_y * bbox_scale; + bboxspot_z = spot1_z; +// dprint_str_v_str("3: Testing visibility to ",bboxspot, "\n"); + res = point_visible(bboxspot, spot2); + if(res) return res; + + bboxspot_x = spot1_x + client.mins_x * bbox_scale; + bboxspot_y = spot1_y + client.mins_y * bbox_scale; + bboxspot_z = spot1_z; +// dprint_str_v_str("4: Testing visibility to ",bboxspot, "\n"); + res = point_visible(bboxspot, spot2); + if(res) return res; + +// dprint("Not visible.\n"); + + return FALSE; +} + +float(vector targ) infront_v = +{ + vector vec; + float dot; + + makevectors(self.angles); + vec = normalize(targ - self.origin); + dot = vec * v_forward; + + if(dot > 0.4) + { + return TRUE; + } + + return FALSE; +} + +/* +============= +canSee + +returns 1 if the entity is in front (in sight) of self and in line of sight +============= +*/ +float(entity src, entity targ) canSee = +{ + float res; + + entity oself; + oself = self; + res = FALSE; + self = src; + + if(infront(targ)) + if(bbox_visible(targ, src.origin + src.view_ofs)) + res = TRUE; + + self = oself; + return res; +} diff --git a/QC/honey_buttons.qc b/QC/honey_buttons.qc new file mode 100644 index 00000000..6e17ebba --- /dev/null +++ b/QC/honey_buttons.qc @@ -0,0 +1,71 @@ +float START_DISABLED = 2; + +void(entity but) button_disable = +{ + but.state = STATE_DISABLED; + but.nextthink = -1; + but.think = SUB_Null; + but.frame = 1; // use alternate textures + but.velocity = '0 0 0'; + but.takedamage = DAMAGE_NO; + setorigin(but, but.pos2); +}; + +void(entity but) button_enable = +{ + but.state = STATE_BOTTOM; + but.nextthink = -1; + but.think = SUB_Null; + but.frame = 0; // use normal textures + but.velocity = '0 0 0'; + if(but.max_health){ + but.takedamage = DAMAGE_YES; + but.health = but.max_health; + } + setorigin(but, but.pos1); +}; + +void() trigger_buttonenabler_enable = +{ + entity butt; + + if(self.spawnflags & START_DISABLED){ + self.spawnflags = self.spawnflags - START_DISABLED; + + butt = find(world, targetname, self.target); + while(butt){ + button_enable(butt); + butt = find(butt, targetname, self.target); + } + } +} + +void() trigger_buttonenabler_disable = +{ + entity butt; + + if((self.spawnflags & START_DISABLED) == 0){ + self.spawnflags = self.spawnflags | START_DISABLED; + + butt = find(world, targetname, self.target); + while(butt){ + button_disable(butt); + butt = find(butt, targetname, self.target); + } + } + +} + +void() trigger_buttonenabler_toggle = +{ + if(self.spawnflags & START_DISABLED){ + trigger_buttonenabler_enable(); + }else{ + trigger_buttonenabler_disable(); + } +} + +void() trigger_buttontoggle = +{ + self.use = trigger_buttonenabler_toggle; +} diff --git a/QC/honey_client.qc b/QC/honey_client.qc new file mode 100644 index 00000000..70c1e736 --- /dev/null +++ b/QC/honey_client.qc @@ -0,0 +1,6 @@ +void() Honey_UpdateSecrets = +{ + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 11); // STAT_SECRETS + WriteLong(MSG_ALL, total_secrets); +} diff --git a/QC/honey_defs.qc b/QC/honey_defs.qc new file mode 100644 index 00000000..20defa11 --- /dev/null +++ b/QC/honey_defs.qc @@ -0,0 +1,24 @@ +#include "vr_macros.qc" + +// +// +// +// ---------------------------------------------------------------------------- +// Zombie axe hack +// ---------------------------------------------------------------------------- + +string ZOMBIE_ONGROUND = "ZOMBIE_ONGROUND"; + +// +// +// +// ---------------------------------------------------------------------------- +// Fields +// ---------------------------------------------------------------------------- + +.float alpha; + +.float damage_weapon; //cg: used to indicate what weapon caused the damage. + // so far reliable only for player weapons + +.float rangescale; diff --git a/QC/honey_endcam.qc b/QC/honey_endcam.qc new file mode 100644 index 00000000..59c6c6ab --- /dev/null +++ b/QC/honey_endcam.qc @@ -0,0 +1,271 @@ + +/* + All of this is horrible shit that noone should use. + +*/ + + +/***************************************************************************************************/ + +entity endcam; +void() execute_endcam; + +void() info_endcam = +{ + endcam = self; + if(!self.wait) self.wait = 180; + self.think = execute_endcam; + self.nextthink = 2; + //self.view_ofs = '0 0 1'; +} + +void() clear_idlescale = +{ + entity p; + endcam.pos1_x = cvar_hget(cvarh_v_iyaw_level); + endcam.pos1_y = cvar_hget(cvarh_v_iroll_level); + endcam.pos1_z = cvar_hget(cvarh_v_ipitch_level); + + p = find(world, classname, "player"); + while (p != world) + { + stuffcmd(p, "v_iyaw_level 0\nv_iroll_level 0\nv_ipitch_level 0\n"); + p = find(p, classname, "player"); + } +} + +void() reset_idlescale = +{ + entity p; + + p = find(world, classname, "player"); + while (p != world) + { + stuffcmd(p, "v_iyaw_level "); + stuffcmd_float(p, endcam.pos1_x); + stuffcmd(p, "\nv_iroll_level "); + stuffcmd_float(p, endcam.pos1_y); + stuffcmd(p, "\nv_ipitch_level "); + stuffcmd_float(p, endcam.pos1_z); + stuffcmd(p, "\n"); + p = find(p, classname, "player"); + } +} + +void() endcam_done = +{ + reset_idlescale(); + + if(!nextmap) + if(endcam.map != NULLSTR) + { + nextmap = endcam.map; + } + else nextmap = "start"; + + GotoNextMap(); +} + + +void() endcam_cutscene = +{ + other = find(world, classname, "player"); + while (other != world) + { + other.view_ofs = '0 0 0'; + other.angles = other.v_angle = endcam.mangle; + other.fixangle = TRUE; // turn this way immediately + other.nextthink = time + 0.5; + other.takedamage = DAMAGE_NO; + other.solid = SOLID_NOT; + other.movetype = MOVETYPE_NONE; + other.weaponmodel = ""; + other.modelindex = 0; + setorigin(other, endcam.origin); + + other = find(other, classname, "player"); + } + + WriteByte(MSG_ALL, SVC_CUTSCENE); + WriteString (MSG_ALL, ""); + +} + + +void() execute_endcam = +{ + clear_idlescale(); + + WriteByte(MSG_ALL, SVC_CDTRACK); + WriteByte(MSG_ALL, 0); + WriteByte(MSG_ALL, 0); + + other = find(world, classname, "player"); + while (other != world) + { + other.movetype = MOVETYPE_NOCLIP; + + other = find(other, classname, "player"); + } + + + SUB_DoLater(endcam_cutscene, 0); + + + //WTF does this do? + //Oh ok seems to be a roundabout way of doing SUB_UseTargets + SUB_Activate(endcam); + + endcam.think = endcam_done; + //FIXME: should probably never exit... + endcam.nextthink = time + endcam.wait; +}; + +/***************************************************************************************************/ + + +void() endcam_muzak_start = +{ + sound(self, CHAN_VOICE, "honey/muzak4.wav", 1, ATTN_NONE); +} + +/*QUAKED endcam_muzak (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +*/ +void() endcam_muzak = +{ + precache_sound("honey/muzak4.wav"); + + if(self.targetname != NULLSTR){ + self.use = endcam_muzak_start; + }else{ + endcam_muzak_start(); + } + +}; + +/***************************************************************************************************/ + + +void() func_slide_done; + +void() func_slide_think = +{ + vector tdest; + tdest = self.origin + self.movedir; + SUB_CalcMove(tdest, self.speed, func_slide_done); +} + +void() func_slide_done = +{ + //eprint(self); + if(self.cnt){ + self.cnt = self.cnt - 1; + self.think = func_slide_think; + self.nextthink = self.ltime + self.wait; + if(self.cnt == 3) + self.nextthink = self.ltime + 0.2; //lol + else if(self.cnt == 1) + self.nextthink = self.ltime + 4.20; //heh :) + }else{ + SUB_UseTargets(); + SUB_Remove(); + } +} + +/*QUAKED func_slide (0.3 0.1 0.6) (? ? ?) (? ? ?) +*/ +void() func_slide = +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_PUSH; + setorigin(self, self.origin); + setmodel(self, self.model); + + + if(!self.movedir) self.movedir= '128 0 0'; + if(!self.speed) self.speed = 512; + + if(!self.wait) self.wait = 3; + if(!self.cnt) self.cnt = 20; + + self.use = func_slide_think; +} + + +/***************************************************************************************************/ + + +void() func_slide_repeating_done; +void() func_slide_repeating_think; + +void() func_slide_repeating_think_first = +{ + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir; + + self.enemy.pos1 = self.pos1; + self.enemy.pos2 = self.pos2; + + if(self.delay){ + self.think = func_slide_repeating_think; + self.nextthink = self.ltime + self.delay; + }else{ + func_slide_repeating_think(); + } + +} + +void() func_slide_repeating_think = +{ + setorigin(self, self.pos1); + SUB_CalcMove(self.pos2, 128, func_slide_repeating_done); +} + +void() func_slide_repeating_done = +{ + entity oself; + oself = self; + + if(self.enemy){ + self = self.enemy; + + }else if(self.owner){ + self = self.owner; + + } + + func_slide_repeating_think(); + + self = oself; +} + +/*QUAKED func_slide_repeating (0.3 0.1 0.6) (? ? ?) (? ? ?) +*/ +void() func_slide_repeating = +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_PUSH; + + vector org; + org = self.origin + self.pos1; + + setorigin(self, org); + setmodel(self, self.model); + + + if(!self.movedir) self.movedir= '128 0 128'; + + + self.use = func_slide_repeating_think_first; + + //Make a duplicate + self.enemy = spawn(); + self.enemy.owner = self; + + setorigin(self.enemy, org); + setmodel(self.enemy, self.model); + self.enemy.movedir = self.movedir; + self.enemy.speed = self.speed; + + +} diff --git a/QC/honey_fight.qc b/QC/honey_fight.qc new file mode 100644 index 00000000..780aff3c --- /dev/null +++ b/QC/honey_fight.qc @@ -0,0 +1,53 @@ +/* +=========== +OgreMarksmanCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() OgreMarksmanCheckAttack = +{ + vector spot1, spot2; + entity targ; +// float chance; + + if(enemy_range == RANGE_MELEE) + { + if(CanDamage(self.enemy, self)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if(time < self.attack_finished) + return FALSE; + + if(!enemy_vis) + return FALSE; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, FALSE, self); + + if(trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if(trace_ent != targ) + { + return FALSE; // don't have a clear shot + } + +// missile attack + if(time < self.attack_finished) + return FALSE; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); + return TRUE; +}; diff --git a/QC/honey_fog.qc b/QC/honey_fog.qc new file mode 100644 index 00000000..55013f55 --- /dev/null +++ b/QC/honey_fog.qc @@ -0,0 +1,370 @@ +/**************************************************************************/ +/* Fog Controlling stuff */ +/**************************************************************************/ + +void setFog(entity client, float density, vector color) = +{ + stuffcmd(client, "\nfog "); + stuffcmd_float(client, density); + stuffcmd(client, " "); + stuffcmd_float(client, color_x); + stuffcmd(client, " "); + stuffcmd_float(client, color_y); + stuffcmd(client, " "); + stuffcmd_float(client, color_z); + stuffcmd(client, "\n"); + +} + +.vector fog_current_color; +.float fog_current_density; + +vector fog_global_color; +float fog_global_density; + +.entity fog_local_owner; +.vector fog_local_color; +.float fog_local_density; +.vector fog_local_colorCurrent; +.float fog_local_densityCurrent; +.vector fog_local_colorBase; +.float fog_local_densityBase; +.float fog_local_fraction; +.float fog_local_fractionStep; + + +.entity fog_override_owner; +.vector fog_override_color; +.float fog_override_density; +.vector fog_override_colorBase; +.float fog_override_densityBase; +.float fog_override_fraction; +.float fog_override_fractionStep; +.float fog_override_fractionControl; + +float FOG_OVERRIDE_DIRECT_CONTROL = -99999; + +void() fog_updateAll = +{ + if(!VR_GameUtil_EnableHoneyExtensions() && !foundHoneyFogSettings) + { + return; + } + + entity c = self; + + // 1: This is the starting point + c.fog_current_color = fog_global_color; + c.fog_current_density = fog_global_density; + + // 2: Figure out the local fog, if any + c.fog_local_fraction = c.fog_local_fraction + c.fog_local_fractionStep; + c.fog_local_fraction = clamp(c.fog_local_fraction, 0, 1); + + if(c.fog_local_fraction >= 1){ //Local fog is in full effect + c.fog_current_color = c.fog_local_color; + c.fog_current_density = c.fog_local_density; + + //Reset these + c.fog_local_colorBase = fog_global_color; + c.fog_local_densityBase = fog_global_density; + + + }else if(c.fog_local_fraction <= 0){ //No local fog at all + SUB_Null(); + + }else{ //Local fog is transitioning + + c.fog_current_density = tween_f(c.fog_local_densityBase, c.fog_local_density, c.fog_local_fraction); + c.fog_current_color = tween_v(c.fog_local_colorBase, c.fog_local_color, c.fog_local_fraction); + } + + + c.fog_local_colorCurrent = c.fog_current_color; + c.fog_local_densityCurrent = c.fog_current_density; + + // 3: Figure out the override fog if any + if(c.fog_override_fractionStep != FOG_OVERRIDE_DIRECT_CONTROL){ + // 3.a: Tween the fog as usual + + c.fog_override_fraction = c.fog_override_fraction + c.fog_override_fractionStep; + c.fog_override_fraction = clamp(c.fog_override_fraction, 0, 1); + + if(c.fog_override_fraction >= 1){ //override fog is in full effect + c.fog_current_color = c.fog_override_color; + c.fog_current_density = c.fog_override_density; + + //Reset these + c.fog_override_colorBase = c.fog_local_colorCurrent; + c.fog_override_densityBase = c.fog_local_densityCurrent; + + }else if(c.fog_override_fraction <= 0){ + SUB_Null(); + + }else{ //override fog is transitioning + + c.fog_current_color = tween_v(c.fog_override_colorBase, c.fog_override_color, c.fog_override_fraction); + c.fog_current_density = tween_f(c.fog_override_densityBase, c.fog_override_density, c.fog_override_fraction); + + } + }else{ + + // 3.b: The override fog is being controlled directly by an entity + c.fog_current_color = tween_v(c.fog_override_colorBase, c.fog_override_color, c.fog_override_fractionControl); + c.fog_current_density = tween_f(c.fog_override_densityBase, c.fog_override_density, c.fog_override_fractionControl); + + } + + // 4: Push the fog + setFog(c, c.fog_current_density, c.fog_current_color); +} + +void(entity c, vector color, float density, float duration) fog_setLocal = +{ + if(self == c.fog_local_owner) return; + + c.fog_local_owner = self; + + if(!(c.fog_local_color == color && c.fog_local_density == density)){ + + c.fog_local_color = color; + c.fog_local_density = density; + + c.fog_local_colorBase = c.fog_local_colorCurrent; + c.fog_local_densityBase = c.fog_local_densityCurrent; + + c.fog_local_fraction = 0; + } + c.fog_local_fractionStep = 0.05 / duration; //FIXME: This magic number should actually be tied to the framerate somehow + if(c.fog_local_fractionStep <= 0) c.fog_local_fractionStep = 0.05; + +} + +void(entity c) fog_releaseLocal = +{ + if(self != c.fog_local_owner) return; + c.fog_local_owner = world; + + if(c.fog_local_fractionStep > 0) c.fog_local_fractionStep = c.fog_local_fractionStep * -1; +} + +void fog_setOverride (entity c, vector color, float density, float startAt, float duration) = +{ + c.fog_override_owner = self; + + c.fog_override_color = color; + c.fog_override_density = density; + + c.fog_override_colorBase = c.fog_current_color; + c.fog_override_densityBase = c.fog_current_density; + + if(startAt != -1) + c.fog_override_fraction = startAt; + else + c.fog_override_fraction = 0; + + if(duration){ + c.fog_override_fractionStep = 0.05 / duration; //FIXME: This magic number should actually be tied to the framerate somehow + if(c.fog_override_fractionStep <= 0) c.fog_override_fractionStep = 0.05; + + }else{ + c.fog_override_fractionStep = 0.05; + } + +} + +void(entity c) fog_releaseOverride = +{ + if(self != c.fog_override_owner) { + return; + } + c.fog_override_owner = world; + + if(c.fog_override_fractionStep == FOG_OVERRIDE_DIRECT_CONTROL) c.fog_override_fractionStep = -0.05; + else if(c.fog_override_fractionStep > 0) c.fog_override_fractionStep = c.fog_override_fractionStep * -1; +} + +void fog_setOverrideConditional(entity c, vector color, float density, float currentFraction) = +{ + + if(c.fog_override_owner == self) return; + c.fog_override_owner = self; + + + c.fog_override_color = color; + c.fog_override_density = density; + + c.fog_override_colorBase = c.fog_current_color; + c.fog_override_densityBase = c.fog_current_density; + + c.fog_override_fraction = currentFraction; + c.fog_override_fractionStep = FOG_OVERRIDE_DIRECT_CONTROL; + c.fog_override_fractionControl = currentFraction; + +} + +void fog_setOverrideFraction(entity c, float fraction) = +{ + if(self != c.fog_override_owner) return; + c.fog_override_fractionControl = clamp(fraction, 0, 1); +} + + +/***************************************************************************************************/ +/* Controlling entities */ +/***************************************************************************************************/ + +float foggroup_cnt; +float foggroup_current; + +void() fogcontroller_linkgroups = +{ + entity t, starte; + + self.think = SUB_Null; + if(self.oldenemy) + return; // already linked by another controller + + + foggroup_cnt = foggroup_cnt + 1; + self.cnt = foggroup_cnt; + + if(self.targetname == "") + { + self.owner = self; + return; // not in a group + } + + starte = self; + t = self; + + do + { + self.owner = starte; // master + + if(self.view_ofs) starte.view_ofs = self.view_ofs; //Target Color + if(self.ideal_yaw) starte.ideal_yaw = self.ideal_yaw; //Target Density + if(self.attack_finished) starte.attack_finished = self.attack_finished; //Duration + + t = find(t, targetname, self.targetname); + if(!t) + { + self.oldenemy = starte; // make the chain a loop + return; + } + if(t.classname == "trigger_fogcontroller"){ + if(t.oldenemy) + objerror ("cross connected fogcontrollers"); + + self.oldenemy = t; + self = t; + } + } while (1); +} + + +float (entity o) trigger_touching = +{ + vector o_maxs, o_mins; + o_maxs = o.maxs + o.origin; + o_mins = o.mins + o.origin; + + if(self.mins_x > o_maxs_x) + return FALSE; + if(self.mins_y > o_maxs_y) + return FALSE; + if(self.mins_z > o_maxs_z) + return FALSE; + if(self.maxs_x < o_mins_x) + return FALSE; + if(self.maxs_y < o_mins_y) + return FALSE; + if(self.maxs_z < o_mins_z) + return FALSE; + return TRUE; +}; + +float (entity o) trigger_touching_group = +{ + entity starte, oself; + float touching; + touching = FALSE; + + if(!self.owner) return trigger_touching(o); // Not in a group + + oself = self; + starte = self.owner; + self = starte; + do{ + touching = trigger_touching(o); + if(touching) break; + + self = self.oldenemy; + }while(self != starte && self != world); + + self = oself; + return touching; +} + + +void() fogcontroller_think = +{ + if(trigger_touching_group(self.enemy)){ + self.nextthink = time + 0.1; + return; + }else{ + fog_releaseLocal(self.enemy); + self.state = 0; + foggroup_current = 0; + } +}; + +void() fogcontroller_enable = +{ + self.state = 1; + fog_setLocal(self.enemy, self.view_ofs, self.ideal_yaw, self.attack_finished); + + self.think = fogcontroller_think; + self.nextthink = time + 0.1; +}; + + +void() fogcontroller_touch = +{ + if(other.classname != "player") return; + if(self.owner) self = self.owner; //Delegate to master + + + + + if(self.state && foggroup_current == self.cnt) return; + + foggroup_current = self.cnt; + + self.enemy = other; + fogcontroller_enable(); + +}; + + + +/*QUAKED trigger_fogcontroller (.5 .5 .5) ? + while inside the global fog is faded to the specified color and density. + the transition takes as long as specified. + DO NOT make it possible for the player to get from one controller + to another while the effect from the first is still active. + +*/ +void() trigger_fogcontroller = +{ + if(!self.view_ofs) self.view_ofs = '1 0 0'; //Target Color + if(!self.ideal_yaw) self.ideal_yaw = 0.5; //Target Density + if(!self.attack_finished) self.attack_finished = 1; //Duration + + + self.touch = fogcontroller_touch; + self.think = fogcontroller_linkgroups; + self.nextthink = time + 0.1; + + InitTrigger(); +}; diff --git a/QC/honey_fog_debug.qc b/QC/honey_fog_debug.qc new file mode 100644 index 00000000..fc16c87a --- /dev/null +++ b/QC/honey_fog_debug.qc @@ -0,0 +1,142 @@ +void() fdbg_redUp; +void() fdbg_redDown; +void() fdbg_greenUp; +void() fdbg_greenDown; +void() fdbg_blueUp; +void() fdbg_blueDown; +void() fdbg_densityUp; +void() fdbg_densityDown; + +float STEP = 0.001; + +float() getCurrentFogDensity = +{ + if(self.fog_override_owner) return self.fog_override_density; + else return self.fog_local_density; +} + +vector() getCurrentFogColor = +{ + if(self.fog_override_owner) return self.fog_override_color; + else return self.fog_local_color; +} + +void() fdbg_redUp = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + c_x = clamp(c_x + STEP, 0, 1); + + + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_redDown = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + c_x = clamp(c_x - STEP, 0, 1); + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_greenUp = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + c_y = clamp(c_y + STEP, 0, 1); + + + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_greenDown = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + c_y = clamp(c_y - STEP, 0, 1); + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_blueUp = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + c_z = clamp(c_z + STEP, 0, 1); + + + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_blueDown = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + c_z = clamp(c_z - STEP, 0, 1); + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_densityUp = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + d = clamp(d + STEP, 0, 1); + + + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} + +void() fdbg_densityDown = { + vector c; + float d; + + d = getCurrentFogDensity(); + c = getCurrentFogColor(); + + d = clamp(d - STEP, 0, 1); + + fog_setOverride (self, c, d, 0, 0.05); + dprint_str_v_str("Fog color: ",c," "); + dprint_str_f_str("Fog density: ",d,"\n"); +} diff --git a/QC/honey_items.qc b/QC/honey_items.qc new file mode 100644 index 00000000..5b54aeb9 --- /dev/null +++ b/QC/honey_items.qc @@ -0,0 +1,69 @@ +float HONEY_SPAWNFLAG_ITEM_SECRET = 128; +float HONEY_SPAWNFLAG_ITEM_FLOATING = 16; + +void() itemTouch = +{ + if(other.classname != "player") + return; + + if(other.health <= 0) + return; + + //self.touch = self.th_die; + self.th_die(); + + if(self.spawnflags & HONEY_SPAWNFLAG_ITEM_SECRET) + { + found_secrets = found_secrets + 1; + WriteByte(MSG_ALL, SVC_FOUNDSECRET); + self.spawnflags = self.spawnflags - (self.spawnflags & HONEY_SPAWNFLAG_ITEM_SECRET); + + sound(self, CHAN_ITEM, "misc/secret.wav", 1, ATTN_NORM); + centerprint(other, self.message); + self.message = string_null; + if(self.classname == "item_health" && self.spawnflags & H_MEGA) // Do nothing + SUB_Null(); + else + self.think = SUB_Null; + } + + if(self.wait && self.solid == SOLID_NOT) { + self.nextthink2 = time + self.wait; + self.think2 = SUB_regen; + } + + activator = other; + SUB_UseTargets(); // fire all targets / killtargets +}; + + +void() item_spawn = +{ + self.use = SUB_Null; + self.model = self.mdl; + setmodel(self, self.model); + + self.solid = SOLID_TRIGGER; + self.handtouch = fromPainToTouchFn(self.th_pain); + + force_retouch = 2; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_TFOG){ + self.spawnflags = self.spawnflags - SPAWNFLAG_TRIGGER_SPAWN_TFOG; + spawn_tfog(self.origin); + } + +} + +void() item_unspawn = +{ + self.mdl = self.model; // so it can be restored on respawn + + self.th_pain = asPainFn(self.handtouch); + + self.solid = SOLID_NOT; + self.model = string_null; + + self.use = item_spawn; +} + diff --git a/QC/honey_misc.qc b/QC/honey_misc.qc new file mode 100644 index 00000000..e5591e7d --- /dev/null +++ b/QC/honey_misc.qc @@ -0,0 +1,148 @@ +void() light_fade_in = +{ + if(self.cnt == 0) lightstyle(self.style, "b"); + else if(self.cnt == 1) lightstyle(self.style, "c"); + else if(self.cnt == 2) lightstyle(self.style, "d"); + else if(self.cnt == 3) lightstyle(self.style, "e"); + else if(self.cnt == 4) lightstyle(self.style, "f"); + else if(self.cnt == 5) lightstyle(self.style, "g"); + else if(self.cnt == 6) lightstyle(self.style, "h"); + else if(self.cnt == 7) lightstyle(self.style, "i"); + else if(self.cnt == 8) lightstyle(self.style, "j"); + else if(self.cnt == 9) lightstyle(self.style, "k"); + else if(self.cnt == 10) lightstyle(self.style, "l"); + else if(self.cnt == 11){ lightstyle(self.style, "m"); + return; + } + self.cnt = self.cnt + 1; + self.nextthink = time + self.waitmin; +} + +void() light_fade_out= +{ + if(self.cnt == 11) lightstyle(self.style, "l"); + else if(self.cnt == 10) lightstyle(self.style, "k"); + else if(self.cnt == 9) lightstyle(self.style, "j"); + else if(self.cnt == 8) lightstyle(self.style, "i"); + else if(self.cnt == 7) lightstyle(self.style, "h"); + else if(self.cnt == 6) lightstyle(self.style, "g"); + else if(self.cnt == 5) lightstyle(self.style, "f"); + else if(self.cnt == 4) lightstyle(self.style, "e"); + else if(self.cnt == 3) lightstyle(self.style, "d"); + else if(self.cnt == 2) lightstyle(self.style, "c"); + else if(self.cnt == 1) lightstyle(self.style, "b"); + else if(self.cnt == 0) { lightstyle(self.style, "a"); + return; + } + self.cnt = self.cnt - 1; + self.nextthink = time + self.waitmin; +} + +void() model_candle_think = +{ + self.frame = self.frame + 1; + if(self.frame > 3) + self.frame = 0; + self.nextthink = time + 0.1; +}; + +void() model_candle = +{ + + precache_model("progs/candle.mdl"); + + setmodel(self, "progs/candle.mdl"); + + //self.think = model_candle_think; + //self.nextthink = time + 0.1; +}; + +void() air_bubbles_use = +{ + self.state = 1 - self.state; + + if(self.state){ //switch them on + make_bubbles(); + }else{ //switch them off + self.nextthink = -1; + } +} + +void() wow_whoa_plopp = +{ + precache_sound("honey/blaahd.wav"); + ambientsound(self.origin, "honey/blaahd.wav", 1, ATTN_STATIC); + SUB_Remove(); +} + +// Conflict with hipnotic +/* +void() ambient_waterfall = +{ + precache_sound("honey/q2watr.wav"); + ambientsound(self.origin, "honey/q2watr.wav", 1, ATTN_IDLE); + SUB_Remove(); +} +*/ + +void() ambient_use = +{ + sound(self, CHAN_VOICE, self.noise, self.volume, self.delay); + self.use = SUB_Null; +} + +void() ambient_machine = +{ + self.noise = "honey/machine.wav"; + if(!self.volume) self.volume = 0.7; + if(!self.delay) self.delay = ATTN_NORM; + precache_sound(self.noise); + self.use = ambient_use; +} + +void() ambient_teleport = +{ + precache_sound("ambience/hum1.wav"); + ambientsound(self.origin, "ambience/hum1.wav",0.5 , ATTN_STATIC); + SUB_Remove(); +} + + +void() ambient_secret_think = +{ + float rnd, rnd2; + + rnd = random(); + rnd2 = 0.5 + 0.5 * random(); + if(rnd < 0.25){ + sound(self, CHAN_AUTO, "honey/ting1.wav",rnd2 , 1.2); + + }else if(rnd < 0.5){ + sound(self, CHAN_AUTO, "honey/ting2.wav",rnd2 , 1.2); + + }else if(rnd < 0.75){ + sound(self, CHAN_AUTO, "honey/ting3.wav",rnd2 , 1.2); + + }else{ + sound(self, CHAN_AUTO, "honey/ting4.wav",rnd2 , 1.2); + + } + + rnd = 0.2 + 3 * random(); + self.think = ambient_secret_think; + self.nextthink = time + rnd; + +} + +entity(vector org) ambient_secret_spawn = +{ + entity ambi, oself; + ambi = spawn(); + setorigin(ambi, org); + oself= self; + self = ambi; + ambient_secret_think(); + self = oself; + return ambi; +} + diff --git a/QC/honey_misc2.qc b/QC/honey_misc2.qc new file mode 100644 index 00000000..c7cac2d4 --- /dev/null +++ b/QC/honey_misc2.qc @@ -0,0 +1,1076 @@ + + + +/**************************************************************************/ +/* Major changes not in this file: */ +/* */ +/* Combat system has been changed to support specific */ +/* damage types by player weapons. */ +/* Probably every entity with takedamage set can now */ +/* also set self.flags | FL_SPECIFICDAMAGE (8192) and then */ +/* self.items = IT_<any weapon> to filter damage received */ +/* as from only those weapons. */ +/* Objects when shot with the incorrect weapon will behave */ +/* as a normal wall. All instances I can think of have been */ +/* covered. */ +/* If needed, you can check the damage type given in th_pain, th_die etc */ +/* using self.damage_weapon or damage_attacker.damage_weapon. */ +/* This has so far only been tested on buttons and monsters, and there */ +/* are guaranteed to be places where this doesn't work or works */ +/* unexpectedly. Use with care. Also it's a hack. */ +/* T_Damage now returns either TRUE or FALSE depending on if the hit */ +/* target should bleed or not. */ +/* */ +/* */ +/* */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/* misc_tree */ +/* A tree, the model comes from Quoth, I added a second skin */ +/**************************************************************************/ + +void() misc_tree = +{ + precache_model("progs/tree1.mdl"); + setmodel(self, "progs/tree1.mdl"); + + makestatic(self); +} + +/**************************************************************************/ +/* info_stuffcmd */ +/**************************************************************************/ + +void() info_stuffcmd_do = +{ + entity isc; + isc = find(world, classname, "info_stuffcmd"); + while(isc){ + stuffcmd(self, isc.message); + stuffcmd(self, "\n"); + isc = find(isc, classname, "info_stuffcmd"); + } +} + +/*QUAKED info_stuffcmd (0 .5 .8) ? + puts the specified message into the console when the client spawns. + +*/ +void() info_stuffcmd = +{ + if(self.message == "") SUB_Remove(); +} + +/**************************************************************************/ +/* trigger_settarget */ +/**************************************************************************/ + +void() trigger_settarget_use = +{ + entity t; + t = find(world, targetname, self.target); + while(t){ + t.target = self.message; + t = find(t, targetname, self.target); + } + SUB_Remove(); +} + +/*QUAKED trigger_settarget (0 .5 .8) ? + When triggered this enetity changes the target field of the target entity to its + own message field. Useful for path_corners or trigger_teleports + +*/ +void() trigger_settarget = +{ + if(!self.target) + { + objerror("setTarget with no Target!\n"); + SUB_Remove(); + return; + } + + if(!self.message) + { + objerror("setTarget with no Message!\n"); + SUB_Remove(); + return; + } + + self.use = trigger_settarget_use; +} + +/**************************************************************************/ +/* trigger_setmessage */ +/**************************************************************************/ + +void() trigger_setmessage_use = +{ + entity t; + t = find(world, targetname, self.target); + while(t){ + t.message = self.message; + t = find(t, targetname, self.target); + } + SUB_Remove(); +} + +/*QUAKED trigger_setmessage (0 .5 .8) ? + When triggered this enetity changes the target field of the target entity to its + own message field. Useful for path_corners or trigger_teleports + +*/ +void() trigger_setmessage = +{ + if(!self.target) + { + objerror("setMessage with no Target!\n"); + SUB_Remove(); + return; + } + + if(!self.message) + { + objerror("setMessage with no Message!\n"); + SUB_Remove(); + return; + } + + self.use = trigger_setmessage_use; +} + +/**************************************************************************/ +/* func_refwall */ +/**************************************************************************/ + +float REFWALL_NOSOLID = 1; + +/*QUAKED func_refwall (0 .5 .8) ? +This is just a solid wall that grabs model from a pre-existing func_wall or external bmodel + +Doesn't work very well. + +Fuck this dumb shit forever!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +*/ +void() func_refwall = +{ + entity ref; + string myModel; + vector refOrigin; + + if(self.target != NULLSTR) + { + ref = find(world, targetname, self.target); + if(!ref) + { objerror("Warning: RefWall without valid reference! (target = "); + objerror(self.target); + objerror(")\n"); + SUB_Remove(); + return; + } + refOrigin = ref.pos1; + myModel = ref.model; + + }else if(self.model != NULLSTR){ + refOrigin = '0 0 0'; + myModel = self.model; + precache_model(self.model); + + }else{ + SUB_Remove(); + return; + } + + + self.origin = self.origin - refOrigin; + + if(self.spawnflags & REFWALL_NOSOLID) + { + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + }else{ + self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + self.solid = SOLID_BSP; + } + + self.use = func_wall_use; + setmodel(self, myModel); + setorigin(self, self.origin); +} + + +/**************************************************************************/ +/* Aimhelp for rockets */ +/**************************************************************************/ + + +vector missile_check_aimhelp(entity client, vector morg, vector defaultvec) = +{ + entity aimhelp; + float dist; + vector aimPoint; + + //TODO: atm just returns the first valid aimhelp, but should maybe check if there are multiple and choose the best one + //TODO: also should make sure the original aim vector wouldn't have hit a monster or something + + + //don't do anything if sv_aim >= 3; + if(cvar_hget(cvarh_sv_aim) >= 3) + return defaultvec; + + //for each aimhelp + aimhelp = find(world, classname, "info_aimhelp_rocket"); + while(aimhelp) + { + + //if close enough to player, but not too close + dist = vlen(morg - aimhelp.origin); + if(dist < aimhelp.distance && dist > aimhelp.volume) //160 = radiusdamage done by rockets + { + //if can trace from player to aimhelp + traceline (morg, aimhelp.origin, FALSE, client); + if(trace_fraction == 1) + { + //multiply normalized aiming vector with distance and add to origin to get equivalent point + aimPoint = morg + (defaultvec * dist); + + //get distance from aimed at point to aimhelp origin + dist = vlen(aimPoint - aimhelp.origin); + + //if that is less than some distance + if(dist < aimhelp.lip){ + //return aim at aimhelp instead of aiming vector. + return normalize(aimhelp.origin - morg); + } + } + } + aimhelp = find(aimhelp, classname, "info_aimhelp_rocket"); + } + + //no good aimhelp found, just return. + return defaultvec; +} + +/*QUAKED info_aimhelp_rocket (0 0.5 0) (-4 -4 -4) (4 4 4) +Used as a helpful aim target for rockets. +*/ +void() info_aimhelp_rocket = +{ + if(!self.distance) + self.distance = 768; //Max distance + if(!self.volume) + self.volume = 160; //Min distance + + if(!self.lip) + self.lip = 32; //Maximum path correction in distance aimed away from self, not degrees + +}; + + + + + + +/**************************************************************************/ +/* The deathpit and everything that entails */ +/**************************************************************************/ + + +//float deathpit_getDepthFraction(entity pit, vector point); +void() PlayerLingerInPit = +{ + //fog_releaseOverride(self); + fog_setOverride(self, '0 0 0', 16, 0.0 , 10); +} + +void() PlayerHitPitBottom = +{ + //TODO: play a better crunchy sound. + sound(self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); + + + self.items = self.items - (self.items & IT_INVISIBILITY); + self.invisible_finished = 0; // don't die as eyes + self.invincible_finished = 0; + self.super_damage_finished = 0; + self.radsuit_finished = 0; + self.modelindex = modelindex_player; // don't use eyes + self.solid = SOLID_NOT; + + //self.weaponmodel=""; + self.view_ofs = '0 0 -8'; + + + self.state = 0; + + self.angles_x = 0; + self.angles_z = 0; + + fog_releaseOverride(self); + fog_setOverride(self, '1 0 0', 16, 1.0, 0.1); + ClientObituary(self, self.enemy); + self.deadflag = DEAD_DEAD; + self.health = -45 - (30*random()); + + self.nextthink = time + 1; + self.think = PlayerLingerInPit; +} + +void(entity client) PlayerStartFallInPit = +{ + entity oself; + if(client.state == STATE_FALLING) return; + + client.state = STATE_FALLING; + //TODO: play falling sound? + sound(other, CHAN_VOICE, "ambience/windfly.wav", 1, ATTN_NORM); + + centerprint(client, "\nOh no!\n"); + + client.weaponmodel=""; + client.nextthink = -1; + client.deadflag = DEAD_DYING; + //client.solid = SOLID_NOT; + client.flags = client.flags - (client.flags & FL_ONGROUND); + client.movetype = MOVETYPE_TOSS; + + client.enemy = self.owner; + //client.attacker = self; + + oself = self; + self = client; + SUB_DoLater(PlayerHitPitBottom, 1.5 + (random() * 2.5)); + self = oself; + +}; + +float(entity pit, vector point) deathpit_getDepthFraction{ + //1 = at top, 0 = at bottom + float depth, min_z, max_z; + max_z = pit.height; + min_z = pit.lip; + + if(max_z <= point_z) depth = 1; //Above the pit. + if(min_z >= point_z) depth = 0; //Below the pit. + else depth = (point_z - min_z) / (max_z - min_z); + + //dprint_str_f_str("depth fraction = ", depth, "\n"); + //dprint_str_f_str("height = ", point_z, "\n"); + return depth; +} + +void() deathpit_checkplayer_think = +{ + float depth; + vector o; + + depth = deathpit_getDepthFraction(self.owner, self.enemy.origin); + if(depth <= 1){ //FUCK YOU FUUUUUUCK + depth = 1 - depth; + depth = 1 - (depth * depth); + } + fog_setOverrideFraction(self.enemy, 1 - depth); + + if(depth <= 0){ + //Someone's gonna die, so let's just die with him + remove(self); + return; + + }else if(depth <= 0.65){ + if(self.enemy.flags & FL_GODMODE) { + o = self.enemy.origin; + o_z = 0; + setorigin(self.enemy, o); + stuffcmd(self.enemy, "\nnoclip\n"); + centerprint(self.enemy,"Saved by the godmode!\n"); + self.enemy.trigger_field = world; + //fog_setOverrideFraction(self.enemy, 0); + fog_releaseOverride(self.enemy); + remove(self); + return; + }else{ + + PlayerStartFallInPit(self.enemy); + } + }else if(depth >= 1){ + fog_releaseOverride(self.enemy); + self.enemy.trigger_field = world; + remove(self); + return; + } + self.nextthink = time + 0.02; + +} + + +void deathpit_checkmonster_think() = +{ + float depth; + + depth = deathpit_getDepthFraction(self.owner, self.enemy.origin); + if(depth <= 0.1) { + + Killed(self.enemy, self.owner); + remove(self.enemy); + remove(self); + return; + } + + self.nextthink = time + 0.1; +} + +void deathpit_MissileTouch() = +{ + float depth; + depth = deathpit_getDepthFraction(self.groundentity, self.origin); + + if(depth < 0.1){ //Pretty deep, so we won't explode + //SUB_DoLater(SUB_Remove, 0.1); + SUB_Remove(); + return; + }else{ + T_MissileTouch(); + } +} + +void deathpit_GrenadeTouch() = +{ + float depth; + depth = deathpit_getDepthFraction(self.groundentity, self.origin); + + + if(depth < 0.1){ //Pretty deep, so we won't explode + //SUB_DoLater(SUB_Remove, 0.1); + SUB_Remove(); + return; + }else{ + GrenadeTouch(); + } +} + +void() ZombieGrenadeTouch; +void() deathpit_ZombieGrenadeTouch = +{ + float depth; + depth = deathpit_getDepthFraction(self.groundentity, self.origin); + + + if(depth < 0.1){ //Pretty deep, so we won't explode + //SUB_DoLater(SUB_Remove, 0.1); + SUB_Remove(); + return; + }else{ + ZombieGrenadeTouch(); + } +}; + + +void deathpit_touch() = +{ + entity tmp; + float depth; + + if(other.classname == "player"){ + if(other.trigger_field) return; + + //player touch: Start to fall down + tmp = spawn(); + tmp.enemy = other; + tmp.owner = self; + other.trigger_field = tmp; + tmp.think = deathpit_checkplayer_think; + tmp.nextthink = time + 0.1; + self = tmp; + fog_setOverrideConditional(self.enemy,'0 0 0', 3, 0); + + }else if(other.classname == "missile"){ + //rocket touch: replace the missile touch function + other.groundentity = self; + other.touch = deathpit_MissileTouch; + + + }else if(other.classname == "grenade"){ + //grenade touch: replace the grenade touch function + other.groundentity = self; + other.touch = deathpit_GrenadeTouch; + + + }else if(other.classname == "zgrenade"){ + //zombie gib touch: replace the zombie gib touch function + other.groundentity = self; + other.touch = deathpit_ZombieGrenadeTouch; + + + }else if(other.flags & FL_MONSTER){ + + if(other.trigger_field) return; + + //monster touch: silently kill the monster once it reaches the bottom + tmp = spawn(); + other.trigger_field = tmp; + tmp.enemy = other; //monster + tmp.owner = self; //pit + tmp.think = deathpit_checkmonster_think; + tmp.nextthink = time + 0.1; + + }else{ + depth = deathpit_getDepthFraction(self, other.origin); + if(depth < 0.1){ + self = other; + SUB_DoLater(SUB_Remove, 0.1); + } + } +} + + + +/*QUAKED trigger_deathpit (.5 .5 .5) ? +Causes fog to fade to black as the player falls into it and eventually kills him. +Also causes rockets and grenades inside it to not explode. + +//TODO: Change this so it's just heights specified in the worldspawn (or elsewhere), so we don't run into problems +// OK, but what about missiles and grenades then? huh?! +// just check in grenade_touch for depth before exploding. + +*/ +void() trigger_deathpit = +{ + precache_sound("ambience/windfly.wav"); + + InitTrigger (); + + if(!self.height) + self.height = self.absmax_z; + + if(!self.lip) + self.lip = self.absmin_z + 160; + + //?????????????????????????????????????? + //dprint_str_f_str("height = ", self.height, "\n"); + //dprint_str_f_str("lip = ", self.lip, "\n"); + + self.touch = deathpit_touch; + +}; + + + + + + +// +// Door crap +// + +//Just for utility +void(void() action) door_do = +{ + entity starte; + starte = self; + do + { + action (); + self = self.enemy; + } while ((self != starte) && (self != world)); +}; + + +float DTT_STATE_CLOSED = 0; +float DTT_STATE_ENTERED = 1; +float DTT_STATE_OPENING = 2; +float DTT_STATE_CLOSING = 3; + +void() door_temp_trigger_check = +{ + float player_inside; + entity oself; + oself = self; + + + if(self.state == DTT_STATE_CLOSED) + return; + + activator = self.enemy; + player_inside = trigger_touching(activator); + + if(activator.health <= 0) player_inside = FALSE; + + if(player_inside){ + + if(self.state == DTT_STATE_ENTERED){ + self.state = DTT_STATE_OPENING; + self = self.owner; + if(self.message != "") + { + centerprint(activator, self.message); + sound(activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + } + + door_do(door_go_up); + + }else if(self.state == DTT_STATE_OPENING){ + if(self.owner.state == STATE_TOP){ // Hit the top + SUB_Remove(); //Bye bye + return; + } + }else if(self.state == DTT_STATE_CLOSING){ + self.state = DTT_STATE_OPENING; + self = self.owner; + door_do(door_go_up); + + } + + }else{ // Player is NOT inside + + if(self.state == DTT_STATE_ENTERED){ + self.state = DTT_STATE_CLOSED; + return; //how did we even get here? + + }else if(self.state == DTT_STATE_OPENING){ + self.state = DTT_STATE_CLOSING; + self = self.owner; + door_do(door_go_down); + + }else if(self.state == DTT_STATE_CLOSING){ + if(self.owner.state == STATE_BOTTOM){ // Hit the bottom + self.state = DTT_STATE_CLOSED; + return; + } + + } + } + self = oself; + self.nextthink = time + 0.1; +}; + +/* + spawn_field is modified to set the touch funtion to this instead of the original if the .cnt field is set. +*/ +void() door_temp_trigger_touch = +{ + + if(self.state != DTT_STATE_CLOSED) //Already started opening it + return; + if(other.health <= 0) + return; + + self.state = DTT_STATE_ENTERED; + + self.think = door_temp_trigger_check; + + self.enemy = other; // Activator + door_temp_trigger_check(); + +}; + + +/*QUAKED func_door_temp (0 .5 .8) + +"angle" determines the opening direction +"targetname" if set, no touch field will be spawned and a remote button or trigger field activates the door. +"health" if set, door must be shot open +"speed" movement speed (100 default) +"wait" wait before returning (3 default, -1 = never return) +"lip" lip remaining at end of move (8 default) +"dmg" damage to inflict when blocked (2 default) +"sounds" +0) no sound +1) stone +2) base +3) stone chain +4) screechy metal +*/ + +void() func_door_temp = + +{ + + if(self.sounds == 0) + { + precache_sound("misc/null.wav"); + precache_sound("misc/null.wav"); + self.noise1 = "misc/null.wav"; + self.noise2 = "misc/null.wav"; + } + if(self.sounds == 1) + { + precache_sound("doors/drclos4.wav"); + precache_sound("doors/doormv1.wav"); + self.noise1 = "doors/drclos4.wav"; + self.noise2 = "doors/doormv1.wav"; + } + if(self.sounds == 2) + { + precache_sound("doors/hydro1.wav"); + precache_sound("doors/hydro2.wav"); + self.noise2 = "doors/hydro1.wav"; + self.noise1 = "doors/hydro2.wav"; + } + if(self.sounds == 3) + { + precache_sound("doors/stndr1.wav"); + precache_sound("doors/stndr2.wav"); + self.noise2 = "doors/stndr1.wav"; + self.noise1 = "doors/stndr2.wav"; + } + if(self.sounds == 4) + { + precache_sound("doors/ddoor1.wav"); + precache_sound("doors/ddoor2.wav"); + self.noise1 = "doors/ddoor2.wav"; + self.noise2 = "doors/ddoor1.wav"; + } + + if(!self.movedir) + SetMovedir (); + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin(self, self.origin); + setmodel(self, self.model); + self.classname = "door_temp"; + self.spawnflags = self.spawnflags & DOOR_START_OPEN; //Clear all but this one + self.spawnflags = self.spawnflags | DOOR_TRIGGER_ON_END; //Add this one + + self.blocked = door_blocked; + + if(!self.speed) + self.speed = 100; + self.wait = -1; + + if(!self.lip) + self.lip = 8; + if(!self.cnt) + self.cnt = 5; //How many times faster it closes than opens + if(!self.dmg) + self.dmg = 2; + + self.pos1 = self.origin; + if(!self.pos2) + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + else + self.pos2 = self.pos1 + self.pos2; + +// DOOR_START_OPEN is to allow an entity to be lighted in the closed position +// but spawn in the open position + if(self.spawnflags & DOOR_START_OPEN) + { + setorigin(self, self.pos2); + self.pos2 = self.pos1; + self.pos1 = self.origin; + } + + self.state = STATE_BOTTOM; + +// LinkDoors can't be done until all of the doors have been spawned, so +// the sizes can be detected properly. + self.think = LinkDoors; + self.nextthink = self.ltime + 0.1; +}; + + + +/***********************************************************************/ +/* Hub biz *************************************************************/ +/* Mostly copied from trigger_changelevel ******************************/ +/***********************************************************************/ + +float LEVEL_1 = 2; //Honey +float LEVEL_2 = 4; //Saint + +void() hublevel_touch = +{ + if(other.classname != "player") + return; + + float noexit; + noexit = cvar_hget(cvarh_noexit); + + if((noexit == 1) || ((noexit == 2) && (mapname != "start"))) + { + T_Damage(other, self, self, 50000); + return; + } + + if(coop || deathmatch) + { + bprint(other.netname); + bprint(" exited the level\n"); + } + + serverflags = serverflags | self.spawnflags; + + if((serverflags & (LEVEL_1|LEVEL_2)) == (LEVEL_1|LEVEL_2)){ + nextmap = "h_end"; + }else if(serverflags & LEVEL_1){ + nextmap = "h_hub1"; + }else if(serverflags & LEVEL_2){ + nextmap = "h_hub2"; + } + + SUB_UseTargets (); + + if((self.spawnflags & 1) && (deathmatch == 0)) + { // NO_INTERMISSION + GotoNextMap(); + return; + } + + self.touch = SUB_Null; + +// we can't move people right now, because touch functions are called +// in the middle of C movement code, so set a think time to do it + self.think = execute_changelevel; + self.nextthink = time + 0.1; +}; + +/*QUAKED trigger_backtohub (0.5 0.5 0.5) LEVEL_1 LEVEL_2 +When the player touches this, he gets sent back to the hub. + +*/ +void() trigger_backtohub = +{ + precache_sound("misc/null.wav"); //Don't ask + precache_sound("misc/runekey.wav"); //Don't ask + + if(!self.spawnflags) + objerror ("backtohub without level flag set"); + + InitTrigger (); + self.touch = hublevel_touch; +}; + + + +/***********************************************************************/ +/* A ghost! Whoa! */ +/* The idea for making the ghosts flicker came from rubicon 2 */ +/***********************************************************************/ + +float(float t, float d) ghost_func = +{ + float at, min, max; + + at = mod(t, d); + at = at / d; + min = 0; + max = 1; + + if(at < 0.5){ + at = at * 2; + return tween_f(min, max, at); + + }else{ + at = (at - 0.5) * 2; + return tween_f_sq(max, min, at); + } +} + +entity ghost_boss; + +void() ghost_think = +{ + entity starte, e; + float value, value2; + + starte = e = self.owner; + + + do{ + value = sin_interpolate(((time+e.delay)* e.speed) * 10); + value2 = sin_interpolate(((time+e.delay)* e.speed * 12)); + + e.alpha = ((value2 + 1) * 0.2) + 0.2; + + e.velocity_z = (value * 5); + + e = e.oldenemy; + }while(e != world && e != starte); + + self.nextthink = time + 0.05; +} + +void() ghost_think_OLD = +{ + entity starte, e; + float value, value2, dist; + + + starte = e = self.owner; + + float caunt = 0; + do{ + value = ghost_func(time+e.delay, e.speed); + value2 = ghost_func(time+e.delay, e.speed * 0.5); + + e.alpha = (value2 * 0.5) + 0.3; + + dist = e.origin_z - e.oldorigin_z; + if(dist > 15){ + e.dmg = -10; + }else if(dist < -15){ + e.dmg = 10; + } + + e.velocity_z = ((value - 0.5) * 50) + e.dmg; + + caunt = caunt + 1; + e = e.oldenemy; + } while(e != world && e != starte); + + self.nextthink = time + 0.05; +} + +void() ghost_touch = +{ + entity oself; + if(other.classname != "player") + return; + if(self.attack_finished > time) + return; + if(self.message == "") + return; + + oself = self; + self = other; + if(!infront_v(oself.dest)){ + self = oself; + return; + } + self = oself; + + + self.attack_finished = time + 2; + + centerprint(other, self.message); + sound(other, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); +} + + +void() ghost = +{ + + + if(!ghost_boss.think){ + ghost_boss = spawn(); + ghost_boss.classname = "ghost_manager"; + ghost_boss.think = ghost_think; + ghost_boss.nextthink = time + 1; + + //Link it... + ghost_boss.owner = self; + ghost_boss.enemy = self; + self.oldenemy = ghost_boss; + }else{ + + //Link it... + self.oldenemy = ghost_boss.owner; + ghost_boss.enemy.oldenemy = self; + ghost_boss.enemy = self; + } + + if(!self.speed) self.speed = 1 + random() * 3; + if(!self.delay) self.delay = 1 + random() * self.speed; + self.dmg = 8; + + self.angles = '0 0 0'; + self.movetype = MOVETYPE_NOCLIP; + self.solid = SOLID_TRIGGER; + self.touch = ghost_touch; + + self.takedamage = DAMAGE_NO; + self.th_die = SUB_Null; + self.th_pain = SUB_NullPain; + + setorigin(self, self.origin); + self.oldorigin = self.origin; + setmodel(self, self.model); + + self.dest = (self.mins + self.maxs) * 0.5; + self.dest_z = self.dest_z - 15; + + setsize(self, self.mins - '60 60 30', self.maxs + '60 60 30'); +} + + +/*********************************************************************************/ +// An undulating pumpy thing +/*********************************************************************************/ + +void() func_pump_use = +{ + self.velocity = '0 0 0'; + self.think = SUB_Null; + self.nextthink = -1; + sound(self, CHAN_VOICE, self.noise3, 0.8, 1.8); + sound(self, CHAN_WEAPON, "misc/null.wav", 0.8, 1.8); +} + +void() func_pump_blocked = +{ + if(time < self.attack_finished) return; + + T_Damage(other, self, self, self.dmg); + self.attack_finished = time + 0.5; +} + +void() func_pump_think = +{ + float sin, dir, t; + if(!self.search_time){ + self.search_time = self.ltime; + } + t = ((self.ltime - self.search_time + self.delay) * self.speed) + 5.6; //Magyck numbre!! + sin = sin_interpolate(t); + +/* if(!self.attack_state){ + dprint_str_f_str("First sine lookup was using ", t, " and "); + dprint_str_f_str("that resulted in the value ", sin, ".\n"); + self.attack_state = 1; + } +*/ + self.velocity = self.pos2 * sin; + + dir = ceil(sin); + if(dir != self.state){ + self.state = 1 - self.state; + if(self.state){ + sound(self, CHAN_VOICE, self.noise1, 0.6, 1.8); + }else{ + sound(self, CHAN_WEAPON, self.noise2, 0.6 , 1.8); + } + } + + self.nextthink = self.ltime + 0.05; +} + +void() func_pump = +{ + self.angles = '0 0 0'; + self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + self.solid = SOLID_BSP; + self.think = func_pump_think; + self.blocked = func_pump_blocked; + self.use = func_pump_use; + setmodel(self, self.model); + + if(!self.pos2) self.pos2 = '0 0 20'; + if(!self.speed) self.speed = 12.75; + if(!self.dmg) self.dmg = 5; + + self.pos2 = self.pos2 * 1.2; + + if(!self.noise1) self.noise1 = "honey/ting1.wav"; + if(!self.noise2) self.noise2 = "honey/ting4.wav"; + if(!self.noise3) self.noise3 = "misc/null.wav"; + + precache_sound(self.noise1); + precache_sound(self.noise2); + precache_sound(self.noise3); + + + self.nextthink = time + 0.2; +} diff --git a/QC/honey_mon_demon.qc b/QC/honey_mon_demon.qc new file mode 100644 index 00000000..688015c6 --- /dev/null +++ b/QC/honey_mon_demon.qc @@ -0,0 +1,46 @@ +void() demon1_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_demon1"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 300; + n.th_stand = demon1_stand1; + n.th_walk = demon1_walk1; + n.th_run = demon1_run1; + n.th_die = demon_die; + n.th_melee = Demon_MeleeAttack; + n.th_missile = demon1_jump1; + n.th_pain = demon1_pain; + + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/demon.mdl"); + + setsize(n, VEC_HULL2_MIN, VEC_HULL2_MAX); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_dog.qc b/QC/honey_mon_dog.qc new file mode 100644 index 00000000..8ba8c91c --- /dev/null +++ b/QC/honey_mon_dog.qc @@ -0,0 +1,46 @@ +void() dog_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_dog"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 25; + n.th_stand = dog_stand1; + n.th_walk = dog_walk1; + n.th_run = dog_run1; + n.th_pain = dog_pain; + n.th_die = dog_die; + n.th_melee = dog_atta1; + n.th_missile = dog_leap1; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/dog.mdl"); + + setsize(n, '-32 -32 -24', '32 32 40'); + + self = n; + + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_enforcer.qc b/QC/honey_mon_enforcer.qc new file mode 100644 index 00000000..2b3472dd --- /dev/null +++ b/QC/honey_mon_enforcer.qc @@ -0,0 +1,46 @@ +void() enforcer_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_enforcer"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 80; + + n.th_stand = enf_stand1; + n.th_walk = enf_walk1; + n.th_run = enf_run1; + n.th_pain = enf_pain; + n.th_die = enf_die; + n.th_missile = enf_atk1; + + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/enforcer.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_fish.qc b/QC/honey_mon_fish.qc new file mode 100644 index 00000000..c3f4ae73 --- /dev/null +++ b/QC/honey_mon_fish.qc @@ -0,0 +1,45 @@ +void() fish_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_fish"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 25; + + n.th_stand = f_stand1; + n.th_walk = f_walk1; + n.th_run = f_run1; + n.th_die = f_death1; + n.th_pain = fish_pain; + n.th_melee = f_attack1; + + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/fish.mdl"); + + setsize(n, '-16 -16 -24', '16 16 24'); + + self = n; + teleport_glitter(); + swimmonster_start(); +}; diff --git a/QC/honey_mon_hknight.qc b/QC/honey_mon_hknight.qc new file mode 100644 index 00000000..65606a26 --- /dev/null +++ b/QC/honey_mon_hknight.qc @@ -0,0 +1,45 @@ +void() hell_knight_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_hell_knight"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 250; + + n.th_stand = hknight_stand1; + n.th_walk = hknight_walk1; + n.th_run = hknight_run1; + n.th_melee = hknight_melee; + n.th_missile = hknight_magicc1; + n.th_pain = hknight_pain; + n.th_die = hknight_die; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/hknight.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_knight.qc b/QC/honey_mon_knight.qc new file mode 100644 index 00000000..c2977b16 --- /dev/null +++ b/QC/honey_mon_knight.qc @@ -0,0 +1,44 @@ +void() knight_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_knight"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 75; + + n.th_stand = knight_stand1; + n.th_walk = knight_walk1; + n.th_run = knight_run1; + n.th_melee = knight_atk1; + n.th_pain = knight_pain; + n.th_die = knight_die; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/knight.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_ogre.qc b/QC/honey_mon_ogre.qc new file mode 100644 index 00000000..04165783 --- /dev/null +++ b/QC/honey_mon_ogre.qc @@ -0,0 +1,122 @@ +void() ogre_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = self.classname; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + n.wad = self.wad; + + n.health = 200; + + n.th_stand = ogre_stand1; + n.th_walk = ogre_walk1; + n.th_run = ogre_run1; + n.th_die = ogre_die; + n.th_melee = ogre_melee; + n.th_missile = ogre_nail1; + n.th_pain = ogre_pain; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, n.wad); + setsize(n, VEC_HULL2_MIN, VEC_HULL2_MAX); + + self = n; + ogre_spawncrown(); + teleport_glitter(); + walkmonster_start(); +}; + +void() monster_ogre_marksman = +{ + self.wad = "progs/mogre.mdl"; + precache_model("progs/s_light2.spr"); + monster_ogre_real(); +}; + + +/* + MARKSMAN CROWN +*/ +vector ogre_crownheight = '0 0 52'; + +void() ogre_crown_update = +{ + vector ogr_org, ogr_ang, offs; + float tm, overshoot; + + if(self.owner.enemy){ tm = 3; offs = '4 4 32'; overshoot = 40;} + else { tm = 8; offs = '32 32 16'; overshoot = 8;} + + ogr_ang = '0 0 0'; + ogr_ang_x = (4 * random()) - 2; + if(self.owner.enemy) ogr_ang_y = self.owner.angles_y + ((40 * random()) - 20); + else ogr_ang_y = self.angles_y + ((20 * random()) - 10) + 180; + + ogr_org = self.owner.origin + ogre_crownheight; + ogr_org_x = ogr_org_x + (random() * offs_x) - (offs_x / 2); + ogr_org_y = ogr_org_y + (random() * offs_y) - (offs_y / 2); + ogr_org_z = ogr_org_z + (random() * offs_z); + + + //SUB_CalcMoveSpline_norotate(vector tdest, vector tangle, float ttime, float cpOffset, void() func); + SUB_CalcMoveSpline_norotate(ogr_org, ogr_ang, tm, overshoot, ogre_crown_update); +}; + +void() ogre_spawncrown = +{ + entity tf; + if(self.classname != "monster_ogre_marksman") return; + if(self.trigger_field) return; + + tf = spawn(); + tf.owner = self; + tf.alpha = 0.6; + tf.movetype = MOVETYPE_NOCLIP; + setmodel(tf,"progs/s_light2.spr"); + setorigin(tf, self.origin); + tf.oldorigin = self.angles; + + + tf.nextthink = time + 0.2; + tf.think = ogre_crown_update; + self.trigger_field = tf; +} + +void() ogre_crown_die = +{ + entity tf; + tf = self.trigger_field; + + if(tf == world) + { + return; + } + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_TAREXPLOSION); + WriteVec3(MSG_BROADCAST, tf.origin); + + self.trigger_field = world; + + remove(tf); +} diff --git a/QC/honey_mon_shalrath.qc b/QC/honey_mon_shalrath.qc new file mode 100644 index 00000000..d2b4d292 --- /dev/null +++ b/QC/honey_mon_shalrath.qc @@ -0,0 +1,45 @@ + +void() shalrath_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_shalrath"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 400; + + n.th_stand = shal_stand; + n.th_walk = shal_walk1; + n.th_run = shal_run1; + n.th_die = shalrath_die; + n.th_pain = shalrath_pain; + n.th_missile = shal_attack1; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/shalrath.mdl"); + + setsize(n, VEC_HULL2_MIN, VEC_HULL2_MAX); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_shambler.qc b/QC/honey_mon_shambler.qc new file mode 100644 index 00000000..98c21489 --- /dev/null +++ b/QC/honey_mon_shambler.qc @@ -0,0 +1,45 @@ + +void() shambler_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_shambler"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 600; + + n.th_stand = sham_stand1; + n.th_walk = sham_walk1; + n.th_run = sham_run1; + n.th_die = sham_die; + n.th_melee = sham_melee; + n.th_missile = sham_magic1; + n.th_pain = sham_pain; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + setmodel(n, "progs/shambler.mdl"); + + setsize(n, VEC_HULL2_MIN, VEC_HULL2_MAX); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_soldier.qc b/QC/honey_mon_soldier.qc new file mode 100644 index 00000000..0c954cc5 --- /dev/null +++ b/QC/honey_mon_soldier.qc @@ -0,0 +1,45 @@ +void() army_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_soldier"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 30; + + n.th_stand = army_stand1; + n.th_walk = army_walk1; + n.th_run = army_run1; + n.th_missile = army_atk1; + n.th_pain = army_pain; + n.th_die = army_die; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/soldier.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_tarbaby.qc b/QC/honey_mon_tarbaby.qc new file mode 100644 index 00000000..843acf9d --- /dev/null +++ b/QC/honey_mon_tarbaby.qc @@ -0,0 +1,47 @@ +void() tarbaby_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_tarbaby"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 80; + + n.th_stand = tbaby_stand1; + n.th_walk = tbaby_walk1; + n.th_run = tbaby_run1; + n.th_missile = tbaby_jump1; + n.th_melee = tbaby_jump1; + n.th_die = tbaby_die1; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.distance = 200; + + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/tarbaby.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_mon_wizard.qc b/QC/honey_mon_wizard.qc new file mode 100644 index 00000000..2bea741f --- /dev/null +++ b/QC/honey_mon_wizard.qc @@ -0,0 +1,44 @@ +void() scrag_start = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_wizard"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 80; + + n.th_stand = wiz_stand1; + n.th_walk = wiz_walk1; + n.th_run = wiz_run1; + n.th_missile = Wiz_Missile; + n.th_pain = Wiz_Pain; + n.th_die = wiz_die; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/wizard.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + flymonster_start(); +}; diff --git a/QC/honey_mon_zombie.qc b/QC/honey_mon_zombie.qc new file mode 100644 index 00000000..377bbf4a --- /dev/null +++ b/QC/honey_mon_zombie.qc @@ -0,0 +1,45 @@ + +void() zombie_start2 = +{ + entity n; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && self.cnt != 0) + { + self.cnt = self.cnt - 1; + n = spawn(); + setorigin(n, self.origin); + n.angles = self.angles; + n.classname = "monster_zombie"; + n.spawnflags = self.spawnflags; + n.target = self.target; + n.killtarget = self.killtarget; + + n.health = 60; + + n.th_stand = zombie_stand1; + n.th_walk = zombie_walk1; + n.th_run = zombie_run1; + n.th_pain = zombie_pain; + n.th_die = zombie_die; + n.th_missile = zombie_missile; + if(self.cnt <= -1){ + total_monsters = total_monsters + 1; + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } + }else{ + n = self; + } + + n.solid = SOLID_SLIDEBOX; + n.movetype = MOVETYPE_STEP; + + setmodel(n, "progs/zombie.mdl"); + + setsize(n, '-16 -16 -24', '16 16 40'); + + self = n; + teleport_glitter(); + walkmonster_start(); +}; diff --git a/QC/honey_monsters.qc b/QC/honey_monsters.qc new file mode 100644 index 00000000..61c1e8ef --- /dev/null +++ b/QC/honey_monsters.qc @@ -0,0 +1,69 @@ +void() teleport_glitter = +{ + spawn_tdeath(self.origin, self); + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_TFOG) + { + spawn_tfog(self.origin); + } +}; + +void() monster_add_to_counter = +{ + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE){ + if(self.cnt != -1){ + total_monsters = total_monsters + self.cnt + 1; + }else{ + return; + //Do nothing, we don't know how many will spawn, so the number will update when they actaully spawn. + } + }else{ + total_monsters = total_monsters + 1; + } + +} + +/* +================ +monster_SPAWNFLAG_REMOVE_CORPSE + +================ +*/ +void() monster_SPAWNFLAG_REMOVE_CORPSE = +{ + //Screw this, just delete it, it's not visible. + /* + self.movetype = MOVETYPE_NOCLIP; + self.velocity = '0 0 -18'; + self.think = SUB_Remove; + self.nextthink = time + 2; + */ + SUB_Remove(); +} + +/* +================ +monster_check_remove_corpse + +================ +*/ +void() monster_check_remove_corpse = +{ + entity player; + + if(!(self.spawnflags & SPAWNFLAG_REMOVE_CORPSE)) { return; } + + player = find(world, classname, "player"); + while (player) + { + if(canSee(player, self)) { + self.think = monster_check_remove_corpse; + self.nextthink = time + 5; + return; + } + player = find(player, classname, "player"); + } + + monster_SPAWNFLAG_REMOVE_CORPSE(); + + +} diff --git a/QC/honey_sknight.qc b/QC/honey_sknight.qc new file mode 100644 index 00000000..01b307ff --- /dev/null +++ b/QC/honey_sknight.qc @@ -0,0 +1,350 @@ +/* +============================================================================== + +SPEARKNIGHT + +============================================================================== +*/ + +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +$frame stand1 + + +float SKNIGHT_NUMSPEARS = 18; + + +float SK_STATE_HUNT = 1; +float SK_STATE_DOWN = 2; +float SK_STATE_SATTACK = 3; +float SK_STATE_SLEEPING = 4; + +float SPEAR_STATE_STUCK = 1; +float SPEAR_STATE_FLYING = 2; +float SPEAR_STATE_PARENTED = 3; + +float SKNIGHT_RADIUS = 64; +float SKNIGHT_SPEED = 250; + +float SKNIGHT_MOVETIME; + + +//To easily call a function on all spears. +void(void() call) sknight_spears_do = +{ + entity oself; + oself = self; + self = find(world, classname, "spear"); + + while(self){ + call(); + self = find(self, classname, "spear"); + } + self = oself; +}; + +void(float() conditional, void() call) sknight_spears_do_if = +{ + entity spear, oself; + spear = find(world, classname, "spear"); + oself = self; + + while(spear){ + self = spear; + if(conditional()){ + call(); + } + spear = find(spear, classname, "spear"); + } + self = oself; +}; + +void(float() conditional, void() call) sknight_spears_do_if_not = +{ + entity spear, oself; + spear = find(world, classname, "spear"); + oself = self; + + while(spear){ + self = spear; + if(conditional() == FALSE){ + call(); + } + spear = find(spear, classname, "spear"); + } + self = oself; +}; + +float() IS_PARENTED = +{ + return (self.classname == "spear") && (self.flags = SPEAR_STATE_PARENTED); +} + +/**********************************************************************************************/ +/* Returns a position a spear would be in if it was at position o with angle a */ +/* and offset distance d towards the spear tip. */ +/**********************************************************************************************/ +vector (vector o, vector a, float d) getSpearOffset = { + + vector dir; + a_x = a_x * -1; //Why? + + makevectors(a); + dir = normalize(v_forward) * d; + + return o + dir; +} + + + +/**********************************************************************************************/ +/* Reset spears to initial position */ +/**********************************************************************************************/ +void () sknight_reset_spears_think2 = +{ + vector d; + d = self.owner.origin + self.pos1; + + + SUB_CalcMoveRotateTime(d, SKNIGHT_MOVETIME / 4 , self.pos2, SUB_Null); +} + +void () sknight_reset_spears_think = +{ + vector d; + d = self.owner.origin + self.pos1; + d = getSpearOffset(d, self.pos2, -192); + + + //SUB_CalcMoveSpline(destination, finalAngle, time, cpOffset, angOffset, func); + SUB_CalcMoveSpline(d, self.pos2, 3 * SKNIGHT_MOVETIME / 4, 192, '0 0 0', sknight_reset_spears_think2); + + //SUB_CalcMoveRotateTime(d, SKNIGHT_MOVETIME / 2 , self.pos2, sknight_reset_spears_think2); +} + +void (float t) sknight_reset_spears = +{ + SKNIGHT_MOVETIME = t; + sknight_spears_do(sknight_reset_spears_think); +} + + +/**********************************************************************************************/ +/* Move all spears in a uniform manner to the given offset */ +/**********************************************************************************************/ +void () sknight_move_spears_think = +{ + vector d; + d = self.origin + self.owner.dest; + SUB_CalcMoveRotate(d, SKNIGHT_SPEED, self.angles, SUB_Null); +} + +void (vector offset) sknight_move_spears = +{ + self.dest = offset; + sknight_spears_do(sknight_move_spears_think); +} + + +/**********************************************************************************************/ +/* Everything needed for the spinning spear attack */ +/**********************************************************************************************/ +vector(vector center, vector ang) sknight_getNextSpearPos = +{ + vector vx, vy, org; + + makevectors(ang); + + org = center; + vx = (v_forward * SKNIGHT_RADIUS); + vy = (v_right * SKNIGHT_RADIUS); + org = vx + vy;// + vz; + + return org + center; +} + + +void() sknight_spears_orbit = +{ + vector center, ang, nOrg; + + ang = '0 0 0'; + ang_y = ((self.cnt / SKNIGHT_NUMSPEARS) *360) + (time * SKNIGHT_SPEED); + center = self.owner.origin; + + nOrg = sknight_getNextSpearPos(center, ang); + ang_y = ang_y - 90; + ang_z = 90; + SUB_CalcMoveRotateTime(nOrg, 0.1, ang, sknight_spears_orbit); + + +} + + +void () sknight_star_attack_end_think = +{ + vector dir, ang; + + ang = self.angles; + //self.avelocity = '0 0 0'; + dir = self.origin - self.owner.origin; + dir = normalize(dir); + + dir = dir * 384; + dir = dir + self.owner.origin; + + SUB_CalcMoveRotate(dir, SKNIGHT_SPEED, self.angles, SUB_Null); +} + +void () sknight_star_attack_end = +{ + sknight_spears_do(sknight_star_attack_end_think); + self.state = SK_STATE_DOWN; +} + +void () sknight_star_attack_begin_think = +{ + vector center, ang, nOrg; + + ang = '0 0 0'; + ang_y = ((self.cnt / SKNIGHT_NUMSPEARS) *360) + ((time + 0.9) * SKNIGHT_SPEED); + center = self.owner.origin; + + nOrg = sknight_getNextSpearPos(center, ang); + ang_y = ang_y - 90; + ang_z = 90; + SUB_CalcMoveRotateTime(nOrg, 1, ang, sknight_spears_orbit); +} + +void () sknight_star_attack_begin = +{ + sknight_spears_do(sknight_star_attack_begin_think); + self.state = SK_STATE_SATTACK; +} + +/**********************************************************************************************/ +/* Create and initialize all the spears */ +/**********************************************************************************************/ +void(entity sknight) sknight_setup_spears = +{ + entity spear; + vector dOrg; + + dOrg = sknight.origin; + + + float i; + i = 0; + while(i < SKNIGHT_NUMSPEARS){ + spear = spawn(); + spear.classname = "spear"; + spear.cnt = i; + spear.solid = SOLID_NOT; + spear.movetype = MOVETYPE_NOCLIP; + spear.owner = sknight; + spear.flags = SPEAR_STATE_PARENTED; + + setmodel(spear, "progs/spear.mdl"); + setsize(spear, '-1 -1 -34', '1 1 37'); + + i = i + 1; + } + + //see sknight_tbl.qc + sknight_spears_do(sknight_spearpos_init); + + sknight_reset_spears(0.2); +}; + +/**********************************************************************************************/ +/* Actual AI stuff */ +/**********************************************************************************************/ +void() sknight_die = +{ +// check for gib + if(self.health < -40) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_hellkn.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + }else{ + sound(self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + } + self.think = SUB_Null; + self.nextthink = -1; +}; + + + +/*QUAKED monster_sknight (1 0 0) (-16 -16 -24) (16 16 40) + Only one per level please! +*/ +void() monster_sknight = +{ + if(deathmatch) + { + remove(self); + return; + } + //precache_model2("progs/sknight.mdl"); + precache_model2("progs/hknight.mdl"); + precache_model2("progs/k_spike.mdl"); + precache_model2("progs/h_hellkn.mdl"); + precache_model2("progs/spear.mdl"); + precache_model2("progs/s_light.spr"); + precache_model2("progs/s_bubble.spr"); + + + precache_sound2("hknight/attack1.wav"); + precache_sound2("hknight/death1.wav"); + precache_sound2("hknight/pain1.wav"); + precache_sound2("hknight/sight1.wav"); + precache_sound("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound2("hknight/slash1.wav"); + precache_sound2("hknight/idle.wav"); + precache_sound2("hknight/grunt.wav"); + + precache_sound("knight/sword1.wav"); + precache_sound("knight/sword2.wav"); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + self.health = 250; + + self.th_stand = hknight_stand1; + self.th_walk = SUB_Null; + self.th_run = hknight_run1; + self.th_melee = SUB_Null; + self.th_missile = hknight_magicc1; + self.th_pain = SUB_NullPain; + self.th_die = hknight_die; + + self.state = SK_STATE_SLEEPING; + + sknight_setup_spears(self); + + self.solid = SOLID_SLIDEBOX; + + if(self.targetname != NULLSTR) + { + total_monsters = total_monsters + 1; + self.movetype = MOVETYPE_STEP; + self.use = flymonster_start; + } + else + { + flymonster_start(); + } + + setmodel(self, "progs/hknight.mdl"); + + setsize(self, '-16 -16 -24', '16 16 40'); + + +}; diff --git a/QC/honey_sknight_debug.qc b/QC/honey_sknight_debug.qc new file mode 100644 index 00000000..1e5cb017 --- /dev/null +++ b/QC/honey_sknight_debug.qc @@ -0,0 +1,248 @@ + +entity D_SK_CURRENTSPEAR; + +void() D_SK_printspear{ + vector p,a; + p = self.origin - self.owner.origin; + a = self.angles; + + +//What we want: + +// }else if(self.cnt == ???){ //index +// self.pos1 = ???; //position relative to sknight +// self.pos2 = ???; //angle +// return; +// + + if(self.cnt) + dprint("\t}else if(self.cnt == "); + else + dprint("\tif(self.cnt == "); + dprint_float(self.cnt); + dprint("){\n"); + dprint("\t\tself.pos1 = '"); + dprint_float(p_x); + dprint(" "); + dprint_float(p_y); + dprint(" "); + dprint_float(p_z); + dprint("';\n"); + dprint("\t\tself.pos2 = '"); + dprint_float(a_x); + dprint(" "); + dprint_float(a_y); + dprint(" "); + dprint_float(a_z); + dprint("';\n"); + dprint("\t\treturn;\n"); + dprint("\n"); +} + +void() D_SK_printspears{ + + entity player; + player = find(world,classname,"player"); + dprint("All spears:\n"); + dprint("-----------\n"); + sknight_spears_do(D_SK_printspear); + dprint("\t}\n"); + dprint("-----------\n"); + stuffcmd (player, "condump\n"); +} + +void() D_SK_selectNext = +{ + entity b; + vector o; + + if(D_SK_CURRENTSPEAR) + b = D_SK_CURRENTSPEAR; + else + b = world; + + D_SK_CURRENTSPEAR = find(b,classname,"spear"); + + if(!D_SK_CURRENTSPEAR){ //Was on last one, get the first one again + D_SK_CURRENTSPEAR = find(world,classname,"spear"); + dprint("Spears: looped around\n"); + } + + o = D_SK_CURRENTSPEAR.origin; + //oh hello there + particle(o,'0 0 2',47,12); + +} + +entity() D_SK_getCur = +{ + if(!D_SK_CURRENTSPEAR) + D_SK_selectNext(); + + return D_SK_CURRENTSPEAR; +} + +void() D_SK_setVPos = +{ + entity player, spear; + vector pos,ang; + + player = find(world,classname,"player"); + spear = D_SK_getCur(); + + pos = player.origin; + pos_z = pos_z + 14; + setorigin(spear, pos); + + ang = player.v_angle; + //ang_x = ang_x - 90; + ang_x = ang_x * -1; //Why? + spear.angles = ang; + spear.avelocity = '0 0 0'; + spear.velocity = '0 0 0'; + + + +} + +/**********************************************************************************************/ +/* DEBUG STUFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF */ +/**********************************************************************************************/ + + +/**********************************************************************************************/ +/* Move all spears in a random manner to the given offset */ +/**********************************************************************************************/ + +void(entity e) D_SK_debugSpline; + +void () sknight_randomize_spears_think = +{ + vector a, d; + + a = '360 360 360'; + a_x = (a_x * random()) - 180; + a_y = (a_y * random()) - 180; + a_z = (a_z * random()) - 180; + + d = '256 256 256'; + d_x = (d_x * random()) - 128; + d_y = (d_y * random()) - 128; + d_z = (d_z * random()); + +// dprint("offsetting spear "); +// dprint(ftos(self.cnt)); +// dprint(" with "); +// dprint(vtos(d)); +// dprint("\n"); + + d = d + self.origin; + //SUB_CalcMoveRotate(d, SKNIGHT_SPEED, a, SUB_Null); + + SUB_CalcMoveSpline(d, a, 3, -256, '-180 0 0', SUB_Null); + //D_SK_debugSpline(self); + +} + +void () sknight_randomize_spears = +{ + sknight_spears_do(sknight_randomize_spears_think); +} + +/**********************************************************************************************/ +/* Draw a debugging outline of the spline path using sprites */ +/**********************************************************************************************/ + +void(vector o, vector a, string spr) D_SK_spawnSprite = +{ + entity tmp; + tmp = spawn(); + tmp.classname = "tmpSprite"; + tmp.angles = a; + tmp.nextthink = time + 1; + tmp.think = SUB_Remove; + setorigin(tmp,o); + setmodel(tmp,spr); + +} + + +void(entity spline) D_SK_debugSpline = +{ + float rem; + rem = FALSE; + if(!spline){ + spline = spawn(); + setorigin(spline, '0 192 64'); + + spline.s_p0 = '0 192 64'; + spline.s_p1 = '0 0 0'; + spline.s_p2 = '0 0 128'; + spline.s_p3 = '0 -192 64'; + + spline.numTicks = 64; + + rem = TRUE; + } + + entity oself; + oself = self; + + self = spline; + while(spline.currentTick < spline.numTicks){ + + spline.currentTick = spline.currentTick + 1; + vector p, a; + p = InterpolatePoint(); + a = InterpolateAngle(); + D_SK_spawnSprite(p,a,"progs/spike.mdl"); + } + + spline.currentTick = 0; + + + D_SK_spawnSprite(self.s_p0,'0 0 0', "progs/s_bubble.spr"); + D_SK_spawnSprite(self.s_p1,'0 0 0', "progs/s_bubble.spr"); + D_SK_spawnSprite(self.s_p2,'0 0 0', "progs/s_bubble.spr"); + D_SK_spawnSprite(self.s_p3,'0 0 0', "progs/s_bubble.spr"); + + + self = oself; + + if(rem) + remove(spline); +} + + +/**********************************************************************************************/ +/* IMPULSIVE SHIT */ +/**********************************************************************************************/ + +void(float i) D_SK_handleImpulse = +{ + if(i == 33) + D_SK_printspears (); + if(i == 34) + sknight_randomize_spears (); + if(i == 35) + sknight_reset_spears(1); + if(i == 36) + D_SK_selectNext(); + if(i == 37){ + D_SK_selectNext(); + entity oself; oself = self; + self = D_SK_CURRENTSPEAR; + sknight_randomize_spears_think(); + D_SK_debugSpline(D_SK_CURRENTSPEAR); + D_SK_CURRENTSPEAR.think = SUB_Null; + D_SK_CURRENTSPEAR.velocity = '0 0 0'; + D_SK_CURRENTSPEAR.avelocity = '0 0 0'; + self = oself; + } + if(i == 38){ + D_SK_selectNext(); + D_SK_setVPos(); + } + +} + diff --git a/QC/honey_sknight_tbl.qc b/QC/honey_sknight_tbl.qc new file mode 100644 index 00000000..eebac76c --- /dev/null +++ b/QC/honey_sknight_tbl.qc @@ -0,0 +1,117 @@ + + + +//This is a terrible hack +//See sknight_debug.qc: D_SK_printspears(); + +void() sknight_spearpos_init = +{ + //pos1 = offset from origin + //pos2 = angles + + if(self.cnt == 0){ + self.pos1 = '-19.9 -17.3 34.3'; + self.pos2 = '-42.2 33.8 0.0'; + return; + + }else if(self.cnt == 1){ + self.pos1 = '-18.7 5.1 34.3'; + self.pos2 = '-54.8 -12.7 0.0'; + return; + + }else if(self.cnt == 2){ + self.pos1 = '-3.9 9.6 12.8'; + self.pos2 = '-57.7 -39.4 0.0'; + return; + + }else if(self.cnt == 3){ + self.pos1 = '-7.3 2.0 15.0'; + self.pos2 = '-54.8 -7.0 0.0'; + return; + + }else if(self.cnt == 4){ + self.pos1 = '-10.1 -9.8 13.3'; + self.pos2 = '-40.8 29.5 0.0'; + return; + + }else if(self.cnt == 5){ + self.pos1 = '-12.6 16.0 17.8'; + self.pos2 = '-40.8 -42.2 0.0'; + return; + + }else if(self.cnt == 6){ + self.pos1 = '-15.3 3.0 25.8'; + self.pos2 = '-64.7 -11.3 0.0'; + return; + + }else if(self.cnt == 7){ + self.pos1 = '-3.2 5.2 11.3'; + self.pos2 = '-56.3 -52.0 0.0'; + return; + + }else if(self.cnt == 8){ + self.pos1 = '-1.4 15.3 14.0'; + self.pos2 = '-60.5 -50.6 0.0'; + return; + + }else if(self.cnt == 9){ + self.pos1 = '-6.1 6.0 6.6'; + self.pos2 = '-57.7 -52.0 0.0'; + return; + + }else if(self.cnt == 10){ + self.pos1 = '-11.0 14.1 21.6'; + self.pos2 = '-54.8 -39.4 0.0'; + return; + + }else if(self.cnt == 11){ + self.pos1 = '-17.2 8.0 27.5'; + self.pos2 = '-47.8 -15.5 0.0'; + return; + + }else if(self.cnt == 12){ + self.pos1 = '-16.1 -5.6 20.9'; + self.pos2 = '-47.8 12.7 0.0'; + return; + + }else if(self.cnt == 13){ + self.pos1 = '-25.7 -8.3 36.7'; + self.pos2 = '-42.2 12.7 0.0'; + return; + + }else if(self.cnt == 14){ + self.pos1 = '-14.5 21.2 31.4'; + self.pos2 = '-45.0 -39.4 0.0'; + return; + + }else if(self.cnt == 15){ + self.pos1 = '-9.9 13.7 27.7'; + self.pos2 = '-40.8 -46.4 0.0'; + return; + + }else if(self.cnt == 16){ + self.pos1 = '-8.4 15.9 20.3'; + self.pos2 = '-46.4 -57.7 0.0'; + return; + + }else if(self.cnt == 17){ + self.pos1 = '-19.5 -6.1 27.1'; + self.pos2 = '-40.8 18.3 0.0'; + return; + + } + + //Default: + else{ + dprint("WARNING: Unaccounted for spear: #"); + dprint(ftos(self.cnt)); + dprint(".\n"); + + self.pos1 = '0 0 0'; + self.pos2 = '0 0 0'; + return; + } +} + + + diff --git a/QC/honey_subs.qc b/QC/honey_subs.qc new file mode 100644 index 00000000..3ab5038c --- /dev/null +++ b/QC/honey_subs.qc @@ -0,0 +1,111 @@ +void(vector tdest, float traveltime, void() func) SUB_CalcMove_time = +{ + vector vdestdelta; + + if(!traveltime) + objerror("No time is defined!"); + + self.think1 = func; + self.finaldest = tdest; + self.think = SUB_CalcMoveDone; + + if(tdest == self.origin) + { + self.velocity = '0 0 0'; + self.nextthink = self.ltime + traveltime; + return; + } + +// set destdelta to the vector needed to move + vdestdelta = tdest - self.origin; + + // set nextthink to trigger a think when dest is reached + self.nextthink = self.ltime + traveltime; + +// scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float +} + + +void(entity e) SUB_Activate = +{ + entity tmp; + tmp = self; + self = e; + SUB_UseTargets(); + self = tmp; +} + + +void(string t) SUB_Trigger= +{ + float oldD; + activator = self; + self.target = t; + oldD = self.delay; + self.delay = 0; + SUB_UseTargets(); + self.delay = oldD; +} + +void(string t, string kt) SUB_KillTrigger= +{ + float oldD; + activator = self; + self.target = t; + self.killtarget = kt; + oldD = self.delay; + self.delay = 0; + SUB_UseTargets(); + self.delay = oldD; +} + +void(string t, float d) SUB_DelayTrigger= +{ + float oldD; + activator = self; + self.target = t; + oldD = self.delay; + self.delay = d; + SUB_UseTargets(); + self.delay = oldD; +} + +void(string t, string kt, float d) SUB_DelayKillTrigger= +{ + float oldD; + activator = self; + self.target = t; + self.killtarget = kt; + oldD = self.delay; + self.delay = d; + SUB_UseTargets(); + self.delay = oldD; +} + +void() DelayCenterprint_think= +{ + centerprint(self.enemy, self.message); + sound(self.enemy, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); +} + +void(entity to, string msg, float dly) SUB_DelayCenterprint= +{ + entity t; + if(dly){ + t = spawn(); + t.message = msg; + t.enemy = to; + t.think = DelayCenterprint_think; + t.nextthink = time + dly; + return; + } + centerprint(to, msg); + sound(to, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); +} + +void(void() t, float d) SUB_DelayCall = +{ + self.think = t; + self.nextthink = self.ltime + d; +} diff --git a/QC/honey_subs2.qc b/QC/honey_subs2.qc new file mode 100644 index 00000000..2582b2dc --- /dev/null +++ b/QC/honey_subs2.qc @@ -0,0 +1,947 @@ + + +void(entity t) D_SK_debugSpline; + +//Does a shitty modulo operation. +float(float v, float m) mod = +{ + float r; + + if(m == 0) objerror("Illegal op: mod(x, 0)!"); + if(fabs(v) < m) return v; + if(v == m) return 0; + + r = floor(v / m) * m; + + return v - r; +} + +vector(vector v, float m) modvec = +{ + v_x = mod(v_x, m); + v_y = mod(v_y, m); + v_z = mod(v_z, m); + + return v; +} + +float(float v, float min, float max) clamp = +{ + if(v < min) return min; + if(v > max) return max; + return v; +} + +float (float from, float to, float fraction) tween_f = +{ + return (from * (1 - fraction)) + (to * fraction); +} + +vector (vector from, vector to, float fraction) tween_v = +{ + vector res; + + res_x = tween_f(from_x, to_x, fraction); + res_y = tween_f(from_y, to_y, fraction); + res_z = tween_f(from_z, to_z, fraction); + + return res; +} + +float (float from, float to, float fraction) tween_f_sq = +{ + + fraction = 1 - fraction; + fraction = fraction * fraction; + fraction = 1 - fraction; + + return (to * (1 - fraction)) + (from * fraction); +} + +vector (vector from, vector to, float fraction) tween_v_sq = +{ + vector res; + + res_x = tween_f_sq(from_x, to_x, fraction); + res_y = tween_f_sq(from_y, to_y, fraction); + res_z = tween_f_sq(from_z, to_z, fraction); + + return res; +} + + +/* +============= +stuffcmd_float + +This is a horrible hack that I am ashamed of! +=============== +*/ +void stuffcmd_digit(entity client, float f) = +{ + float d; + d = floor(f); + d = mod(d, 10); + + //CLOSE YOUR EYES, HONEY! DON'T LOOK! + if(d == 0) + stuffcmd(client, "0"); + else if(d == 1) + stuffcmd(client, "1"); + else if(d == 2) + stuffcmd(client, "2"); + else if(d == 3) + stuffcmd(client, "3"); + else if(d == 4) + stuffcmd(client, "4"); + else if(d == 5) + stuffcmd(client, "5"); + else if(d == 6) + stuffcmd(client, "6"); + else if(d == 7) + stuffcmd(client, "7"); + else if(d == 8) + stuffcmd(client, "8"); + else if(d == 9) + stuffcmd(client, "9"); +} + +void stuffcmd_int(entity client, float f, float numdigits) = +{ + + float tmp; + + + if(f == 0){ + stuffcmd(client, "0"); + return; + } + + if(f < 0){ + // Yeah sure. + stuffcmd(client, "-"); + f = fabs(f); + } + + if(numdigits <= 0){ + tmp = f; + numdigits = 1; + while(tmp >= 1){ + tmp = tmp / 10; + numdigits = numdigits * 10; + } + } + + //I don't know what I'm thinking here... + //I need to do this to get zero-padding to work. + + while(numdigits > 1){ + + numdigits = numdigits / 10; + tmp = f / numdigits; + stuffcmd_digit(client, tmp); + + } + + +} + +void stuffcmd_float(entity client, float f) = +{ + float intpart, decpart, isNegative; + + isNegative = FALSE; + + if(f == 0){ + stuffcmd(client, "0"); + return; + } + + if(f < 0){ + // easier this way + isNegative = TRUE; + f = fabs(f); + } + + + // 1: stuff the integer part. + intpart = floor(f); + if(isNegative) + stuffcmd(client, "-"); + stuffcmd_int(client, intpart, 0); + + + // 2: stuff the decimal point. + stuffcmd(client, "."); + + + // 3: stuff the decimal part. + decpart = mod(f, 1); + decpart = decpart * 10000; + stuffcmd_int(client, decpart, 10000); + +} + +/* +============= +dprint_float + +This is a horrible hack that I am ashamed of! +=============== +*/ +void dprint_digit(float f) = +{ + float d; + d = floor(f); + d = mod(d, 10); + + //CLOSE YOUR EYES, HONEY! DON'T LOOK! + if(d == 0) + dprint("0"); + else if(d == 1) + dprint("1"); + else if(d == 2) + dprint("2"); + else if(d == 3) + dprint("3"); + else if(d == 4) + dprint("4"); + else if(d == 5) + dprint("5"); + else if(d == 6) + dprint("6"); + else if(d == 7) + dprint("7"); + else if(d == 8) + dprint("8"); + else if(d == 9) + dprint("9"); +} + +void dprint_int(float f, float numdigits) = +{ + + float tmp; + + + if(f == 0){ + dprint("0"); + return; + } + + if(f < 0){ + // Yeah sure. + dprint("-"); + f = fabs(f); + } + + if(numdigits <= 0){ + tmp = f; + numdigits = 1; + while(tmp >= 1){ + tmp = tmp / 10; + numdigits = numdigits * 10; + } + } + + //I don't know what I'm thinking here... + //I need to do this to get zero-padding to work. + + while(numdigits > 1){ + + numdigits = numdigits / 10; + tmp = f / numdigits; + dprint_digit(tmp); + + } + + +} + +void dprint_float(float f) = +{ + float intpart, decpart, isNegative; + + isNegative = FALSE; + + if(f == 0){ + dprint("0"); + return; + } + + if(f < 0){ + // easier this way + isNegative = TRUE; + f = fabs(f); + } + + + // 1: stuff the integer part. + intpart = floor(f); + if(isNegative) + dprint("-"); + dprint_int(intpart, 0); + + + // 2: stuff the decimal point. + dprint("."); + + + // 3: stuff the decimal part. + decpart = mod(f, 1); + decpart = decpart * 10000; + dprint_int(decpart, 10000); + +} + +void dprint_str_f_str(string s1, float f, string s2) = +{ + dprint(s1); + dprint_float(f); + dprint(s2); +} + +void dprint_str_v_str(string s1, vector v, string s2) = +{ + dprint(s1); + dprint("["); + dprint_float(v_x); + dprint(", "); + dprint_float(v_y); + dprint(", "); + dprint_float(v_z); + dprint("]"); + dprint(s2); +} + +/* +============= +SUB_RotatePoint + +rotates a point around origin. +============= +*/ +vector(vector point, vector toAngles) SUB_RotatePoint = +{ + vector ang, noZ; + float oldZ; + + dprint_str_v_str("rotating point ", point, " around angles"); + dprint_str_v_str(" ", toAngles, "\n"); + + oldZ = point_z; + noZ = point; + noZ_z = 0; //ignore Z-axis + toAngles_x = 0; //no pitching + + ang = vectoangles(noZ); + makevectors(toAngles + ang); + + v_forward = normalize(v_forward); + noZ = v_forward * vlen(point); + noZ_z = oldZ; + + dprint_str_v_str("Got ", noZ, "\n"); + return noZ; + + +} + +/* +============= +SUB_CalcMoveRotate + +calculate self.velocity, self.avelocity and self.nextthink to reach tdest at tangle from +self.origin traveling at tspeed +=============== +*/ + +void() SUB_CalcMoveRotateDone; +void(vector tdest, float tspeed, vector tangle, void() func) SUB_CalcMoveRotate; +void(vector tdest, float ttime, vector tangle, void() func) SUB_CalcMoveRotateTime; + +void(entity ent, vector tdest, float tspeed, vector tangle, void() func) SUB_CalcMoveRotateEnt = +{ +entity stemp; + stemp = self; + self = ent; + + SUB_CalcMoveRotate (tdest, tspeed, tangle, func); + self = stemp; +} + +void(entity ent, vector tdest, float ttime, vector tangle, void() func) SUB_CalcMoveRotateTimeEnt = +{ +entity stemp; + stemp = self; + self = ent; + + SUB_CalcMoveRotate (tdest, ttime, tangle, func); + self = stemp; +} + +void(vector tdest, float tspeed, vector tangle, void() func) SUB_CalcMoveRotate = +{ + vector vdestdelta, adestdelta; + float len, traveltime; + + if(!tspeed) + objerror("No speed is defined!"); + + self.think1 = func; + self.finaldest = tdest; + //self.finalangle = modvec(tangle, 360); //Causes jerkiness + self.finalangle = tangle; + self.think = SUB_CalcMoveRotateDone; + + + + if(tdest == self.origin) + { + self.velocity = '0 0 0'; + self.angles = tangle; + self.avelocity = '0 0 0'; + self.nextthink = time + 0.1; + return; + } + + // set adestdelta to the angle needed to move + adestdelta = tangle - self.angles; + //Do we really need to rotate so much? + if(adestdelta_x > 180) adestdelta_x = adestdelta_x - 360; + else if(adestdelta_x < -180) adestdelta_x = adestdelta_x + 360; + + if(adestdelta_y > 180) adestdelta_y = adestdelta_y - 360; + else if(adestdelta_y < -180) adestdelta_y = adestdelta_y + 360; + + if(adestdelta_z > 180) adestdelta_z = adestdelta_z - 360; + else if(adestdelta_z < -180) adestdelta_z = adestdelta_z + 360; + + + + // set vdestdelta to the vector needed to move + vdestdelta = tdest - self.origin; + + // calculate length of vector + len = vlen(vdestdelta); + // divide by speed to get time to reach dest + traveltime = len / tspeed; + + if(traveltime < 0.1) + { + self.velocity = '0 0 0'; + self.nextthink = time + 0.1; + return; + } + + // set nextthink to trigger a think when dest is reached + self.nextthink = time + traveltime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float + // scale the destdelta vector by the time spent traveling to get velocity + self.avelocity = adestdelta * (1 / traveltime); + + +} + +void(vector tdest, float ttime, vector tangle, void() func) SUB_CalcMoveRotateTime = +{ + vector vdestdelta, adestdelta; + float len, travelspeed; + + if(!ttime) + objerror("No time is defined!"); + + self.think1 = func; + self.finaldest = tdest; + //self.finalangle = modvec(tangle, 360); //Causes jerkiness + self.finalangle = tangle; + self.think = SUB_CalcMoveRotateDone; + + + + if(tdest == self.origin) + { + self.velocity = '0 0 0'; + self.angles = tangle; + self.avelocity = '0 0 0'; + self.nextthink = time + 0.1; + return; + } + + // set adestdelta to the angle needed to move + adestdelta = self.finalangle - self.angles; + +//* //Do we really need to rotate so much? + if(adestdelta_x > 180) adestdelta_x = adestdelta_x - 360; + else if(adestdelta_x < -180) adestdelta_x = adestdelta_x + 360; + + if(adestdelta_y > 180) adestdelta_y = adestdelta_y - 360; + else if(adestdelta_y < -180) adestdelta_y = adestdelta_y + 360; + + if(adestdelta_z > 180) adestdelta_z = adestdelta_z - 360; + else if(adestdelta_z < -180) adestdelta_z = adestdelta_z + 360; +//*/ + + + // set vdestdelta to the vector needed to move + vdestdelta = tdest - self.origin; + + // calculate length of vector + len = vlen(vdestdelta); + // divide by time to get speed to reach dest + travelspeed = len / ttime; + + + // set nextthink to trigger a think when dest is reached + self.nextthink = time + ttime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/ttime); // qcc won't take vec/float + // scale the destdelta vector by the time spent traveling to get velocity + self.avelocity = adestdelta * (1 / ttime); +} + +void(vector tdest, float ttime, void() func) SUB_CalcMoveTime = +{ + vector vdestdelta; + float len, travelspeed; + + if(!ttime) + objerror("No time is defined!"); + + self.think1 = func; + self.finaldest = tdest; + self.think = SUB_CalcMoveRotateDone; + + + + if(tdest == self.origin) + { + self.velocity = '0 0 0'; + self.nextthink = time + 0.1; + return; + } + + // set vdestdelta to the vector needed to move + vdestdelta = tdest - self.origin; + + // calculate length of vector + len = vlen(vdestdelta); + // divide by time to get speed to reach dest + travelspeed = len / ttime; + + + // set nextthink to trigger a think when dest is reached + self.nextthink = time + ttime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/ttime); // qcc won't take vec/float + +} + +/* +============ +After moving, set origin and angles to exact final destination +============ +*/ +void() SUB_CalcMoveRotateDone = +{ + setorigin(self, self.finaldest); + self.velocity = '0 0 0'; + self.angles = self.finalangle; + self.avelocity = '0 0 0'; + + self.nextthink = -1; + if(self.think1) + self.think1(); +} + + +/* +============ +Spline movement?! +============ +*/ + +//New fields: +.vector s_p0, s_p1, s_p2, s_p3; // The four points of the spline +.vector angle_ofs; // Angle offset the entity should have to spline tangent (To make it appear it's moving backwards, sideways, etc) +.vector s_finalangle; // Angle the entity should end at (This is used to calculate .s_p2) +.float numTicks, currentTick; // Number of 0.1 second ticks the movement takes, and current tick. +.void() think2; // What to ACTUALLY do when the movement ends (SUB_CalcMoveRotateTime overwrites .think1) + + + +void() SUB_CalcMoveSplineTick; +void() SUB_CalcMoveSplineTick_norotate; +void() SUB_CalcMoveSplineDone; +void() SUB_CalcMoveSplineDone_norotate; + + +void(vector tdest, vector tangle, float ttime, float cpOffset, vector aOffset, void() func) SUB_CalcMoveSpline = +{ + vector tmp, a; + + if(!cpOffset) cpOffset = 128; + + if(!ttime) + objerror("No time is defined!"); + + + //dprint_str_v_str("Starting angle = ", self.angles, "\n"); + + self.think2 = func; //What to do when done + + self.numTicks = ttime * 10; //Number of interpolation points + self.currentTick = 0; + + /** Set up the control points **/ + + self.s_p0 = self.origin; //First point + + a = self.angles; + a_x = a_x * -1; + makevectors(a); + tmp = v_forward * cpOffset; + self.s_p1 = self.s_p0 + tmp; //Second point + + self.s_p3 = tdest; //Final point + + a = tangle; + a_x = a_x * -1; + makevectors(a); + tmp = v_forward * cpOffset; + self.s_p2 = self.s_p3 - tmp; //Third point + + + + self.angle_ofs = aOffset; + self.s_finalangle = tangle; + + self.think = SUB_CalcMoveSplineTick; + SUB_CalcMoveSplineTick(); +} + +void(vector tdest, vector tangle, float ttime, float cpOffset, void() func) SUB_CalcMoveSpline_norotate = +{ + // .oldorigin is used as angles + vector tmp, a; + + if(!cpOffset) cpOffset = 128; + + if(!ttime) + objerror("No time is defined!"); + + + //dprint_str_v_str("Starting angle = ", self.angles, "\n"); + + self.think2 = func; //What to do when done + + self.numTicks = ttime * 10; //Number of interpolation points + self.currentTick = 0; + + /** Set up the control points **/ + + self.s_p0 = self.origin; //First point + + a = self.oldorigin; + a_x = a_x * -1; + makevectors(a); + tmp = v_forward * cpOffset; + self.s_p1 = self.s_p0 + tmp; //Second point + + self.s_p3 = tdest; //Final point + + a = tangle; + a_x = a_x * -1; + makevectors(a); + tmp = v_forward * cpOffset; + self.s_p2 = self.s_p3 - tmp; //Third point + + + + self.s_finalangle = tangle; + + self.think = SUB_CalcMoveSplineTick_norotate; + SUB_CalcMoveSplineTick_norotate(); +} + +//USE CAREFULLY, SPAWNS LOTS OF ENTITIES! +void(vector tdest, vector tangle, float ttime, float cpOffset, vector aOffset, void() func) SUB_CalcMoveSplineDEBUG = +{ + SUB_CalcMoveSpline(tdest,tangle,ttime,cpOffset,aOffset,func); + D_SK_debugSpline(self); +} + +vector() InterpolatePoint; +vector() InterpolateAngle; + +//FIXME: Try to eliminate all the crazy jerkings at start and end. +void() SUB_CalcMoveSplineTick = +{ + vector nextOrigin, nextAngle; + + self.currentTick = self.currentTick + 1; + + if(self.currentTick < self.numTicks){ + nextOrigin = InterpolatePoint(); + nextAngle = InterpolateAngle(); + + SUB_CalcMoveRotateTime(nextOrigin, 0.1, nextAngle, SUB_CalcMoveSplineTick); + }else{ + nextOrigin = self.s_p3; + nextAngle = self.s_finalangle; + + SUB_CalcMoveRotateTime(nextOrigin, 0.1, nextAngle, SUB_CalcMoveSplineDone); + } + + +} + +void() SUB_CalcMoveSplineTick_norotate = +{ + vector nextOrigin; + + self.currentTick = self.currentTick + 1; + + if(self.currentTick < self.numTicks){ + nextOrigin = InterpolatePoint(); + + SUB_CalcMove_time(nextOrigin, 0.1, SUB_CalcMoveSplineTick_norotate); + }else{ + nextOrigin = self.s_p3; + + SUB_CalcMove_time(nextOrigin, 0.1, SUB_CalcMoveSplineDone_norotate); + } + + +} + +void() SUB_CalcMoveSplineDone = +{ + void() doIt; //Amazed that this actually works... + setorigin(self, self.s_p3); + self.velocity = '0 0 0'; + self.angles = self.s_finalangle; + self.avelocity = '0 0 0'; + + self.nextthink = -1; + if(self.think2){ + doIt = self.think2; + self.think2 = SUB_Null; + doIt(); + } +} + +void() SUB_CalcMoveSplineDone_norotate = +{ + void() doIt; //Amazed that this actually works... + setorigin(self, self.s_p3); + self.velocity = '0 0 0'; + self.oldorigin = self.s_finalangle; + + self.nextthink = -1; + if(self.think2){ + doIt = self.think2; + self.think2 = SUB_Null; + doIt(); + } +} + + +//Actual spline math bits below here: + +//Basis Functions: +float(float t) B1 = { return t * t * t;} +float(float t) B2 = { return 3 * t * t * (1 - t);} +float(float t) B3 = { return 3 * t * (1 - t) * (1 - t);} +float(float t) B4 = { return (1 - t) * (1 - t) * (1 - t);} + +vector() InterpolatePoint = +{ + float t; + vector ret; + + t = 1 - (self.currentTick / self.numTicks); + + ret = self.s_p0 * B1(t); + ret = ret + self.s_p1 * B2(t); + ret = ret + self.s_p2 * B3(t); + ret = ret + self.s_p3 * B4(t); + + return ret; +} + +//vector(vector a, vector b) AngleMatch; + +vector() InterpolateAngle = +{ + float t; + + t = self.currentTick / self.numTicks; + + vector A; A = self.s_p0 + (t * (self.s_p1 - self.s_p0)); + vector B; B = self.s_p1 + (t * (self.s_p2 - self.s_p1)); + vector C; C = self.s_p2 + (t * (self.s_p3 - self.s_p2)); + + vector AB; AB = B - A; + vector BC; BC = C - B; + + vector DE; DE = (B + (BC * t)) - (A + (AB * t)); + + DE = normalize(DE); + + //dprint("For tangent "); + //dprint(vtos(DE)); + //dprint(" the angle is "); + + DE = vectoangles(DE); + DE = DE + self.angle_ofs; + //dprint(vtos(DE)); + //dprint("\n"); + + return DE; +} + + +/* +============ +Utility for invoking a function call later. Costs one entity. +============ +*/ + +void() SUB_DoLater_think = +{ + entity oself, oactivator; + + + + oself = self; + self = self.enemy; + + oactivator = activator; + activator = oself.movetarget; + + //self.think1 = oself.think1; // This doesn't work if world calls SUB_DoLater + oself.think1(); //this looks confusing because it looks like we're calling a method on the tmp entity, + //but we're just calling the function and self is still self + + self = oself; + activator = oactivator; + + SUB_Remove(); +} + +void(void() func, float later) SUB_DoLater = +{ + if(later <= 0){ + func(); + return; + } + + entity tmp; + tmp = spawn(); + tmp.think1 = func; + tmp.enemy = self; + tmp.movetarget = activator; + tmp.think = SUB_DoLater_think; + tmp.nextthink = time + later; +} + +void() SUB_DoLaterSelf_think = +{ + entity oactivator; + + oactivator = activator; + activator = self.movetarget; + + self.think1(); + + activator = oactivator; +} + +void(void() func, float later) SUB_DoLaterSelf = +{ + if(later <= 0){ + func(); + return; + } + self.think1 = func; + self.movetarget = activator; + self.think = SUB_DoLaterSelf_think; + self.nextthink = time + later; +} + + +// +// Some shitty sine table? +// + +float sin_tbl (float v) = +{ + float r; + v = mod(v, 20); +//* + if(v <= 1) r = 0; + else if(v <= 2) r = 0.30901699437495; + else if(v <= 3) r = 0.58778525229247; + else if(v <= 4) r = 0.80901699437495; + else if(v <= 5) r = 0.95105651629515; + else if(v <= 6) r = 1; + else if(v <= 7) r = 0.95105651629515; + else if(v <= 8) r = 0.80901699437495; + else if(v <= 9) r = 0.58778525229247; + else if(v <= 10) r = 0.30901699437495; + else if(v <= 11) r = 0; + else if(v <= 12) r = -0.30901699437495; + else if(v <= 13) r = -0.58778525229247; + else if(v <= 14) r = -0.80901699437495; + else if(v <= 15) r = -0.95105651629515; + else if(v <= 16) r = -1; + else if(v <= 17) r = -0.95105651629515; + else if(v <= 18) r = -0.80901699437495; + else if(v <= 19) r = -0.58778525229247; + else if(v <= 20) r = -0.30901699437495; + else r = 0; +//*/ +/* //Doesn't work? + if(v <= 1) r = 1; + else if(v <= 2) r = 0.95105651629515; + else if(v <= 3) r = 0.80901699437495; + else if(v <= 4) r = 0.58778525229247; + else if(v <= 5) r = 0.30901699437495; + else if(v <= 6) r = 0; + else if(v <= 7) r = -0.30901699437495; + else if(v <= 8) r = -0.58778525229247; + else if(v <= 9) r = -0.80901699437495; + else if(v <= 10) r = -0.95105651629515; + else if(v <= 11) r = -1; + else if(v <= 12) r = -0.95105651629515; + else if(v <= 13) r = -0.80901699437495; + else if(v <= 14) r = -0.58778525229247; + else if(v <= 15) r = -0.30901699437495; + else if(v <= 16) r = 0; + else if(v <= 27) r = 0.30901699437495; + else if(v <= 18) r = 0.58778525229247; + else if(v <= 19) r = 0.80901699437495; + else if(v <= 20) r = 0.95105651629515; + else r = 1; +*/ + return r; +} + +float sin_interpolate (float v) = +{ + float y1, y2, frac; + + y1 = sin_tbl(v); + y2 = sin_tbl(v+1); + + frac = mod(v, 1); + + return tween_f (y1, y2, frac); +} + + diff --git a/QC/honey_trigger.qc b/QC/honey_trigger.qc new file mode 100644 index 00000000..66df35f3 --- /dev/null +++ b/QC/honey_trigger.qc @@ -0,0 +1,95 @@ +void() SPAWNFLAG_TRIGGER_SPAWN_use = +{ + self.sounds = 0; + self.targetname = ""; + SUB_DoLater(self.think1, 0.1); +} + +void() trigger_once_spawn = +{ + self.think1 = trigger_once; + self.use = SPAWNFLAG_TRIGGER_SPAWN_use; +} + +void() trigger_multiple_spawn = +{ + self.think1 = trigger_multiple; + self.use = SPAWNFLAG_TRIGGER_SPAWN_use; +} + +void() trigger_monsterjump_spawn = +{ + self.think1 = trigger_monsterjump; + self.use = SPAWNFLAG_TRIGGER_SPAWN_use; +} + +void() relay_many_think = +{ + activator = self.enemy; + SUB_UseTargets(); + self.cnt = self.cnt - 1; + if(self.cnt > 0) + { + self.nextthink = time + self.wait; + } +} + +void() relay_many_use = +{ + if(self.cnt > 0) return; + self.enemy = activator; + self.cnt = self.count; + relay_many_think(); +} + +/*QUAKED trigger_relay_many (.5 .5 .5) (-8 -8 -8) (8 8 8) +This fixed size trigger cannot be touched, it can only be fired by other events. It can contain killtargets, targets, delays, and messages. +*/ +void() trigger_relay_many = +{ + self.use = relay_many_use; + self.think = relay_many_think; + if(!self.count) self.count = 3; + if(!self.wait) self.wait = 1; +}; + +void() trigger_skill_use = +{ + cvar_set ("skill", self.message); +}; + +void() target_setskill = +{ + self.use = trigger_skill_use; +}; + +void() trigger_babyhop_touch = +{ + if(other.classname != "monster_tarbaby") + return; + + + other.velocity_z = other.velocity_z * -1; +} + +void() trigger_babyhop = +{ + self.touch = trigger_babyhop_touch; + InitTrigger(); +} + +void() trigger_babyboost_touch = +{ + if(other.classname != "monster_tarbaby") + return; + + //dprint("touched by an angel!\n"); + other.distance = self.speed; +} + +void() trigger_babyboost = +{ + if(!self.speed) self.speed = 500; + InitTrigger(); + self.touch = trigger_babyboost_touch; +} diff --git a/QC/honey_weapons.qc b/QC/honey_weapons.qc new file mode 100644 index 00000000..c6ec3dd8 --- /dev/null +++ b/QC/honey_weapons.qc @@ -0,0 +1,21 @@ +void() splashy = +{ + spawn_tfog(self.origin); + self.think = splashy; + self.nextthink = time + 1; +} + +void(string lol) poopy = +{ + entity rnde; + rnde = find(world, classname, lol); + while(rnde){ + + if(rnde.health > 0){ + eprint(rnde); + rnde.think = splashy; + rnde.nextthink = time + 0.1; + } + rnde = find(rnde, classname, lol); + } +} diff --git a/QC/items.qc b/QC/items.qc index e2200535..3ffbacca 100644 --- a/QC/items.qc +++ b/QC/items.qc @@ -1,16 +1,17 @@ -void() W_SetCurrentAmmo; /* ALL LIGHTS SHOULD BE 0 1 0 IN COLOR ALL OTHER ITEMS SHOULD BE .8 .3 .4 IN COLOR */ -float(float wid) WeaponIdToItemId; -float(float it) ItemIdToWeaponId; - void(entity entPlayer) VRItemPickupHaptic = { + if(!entPlayer.ishuman) + { + return; + } + if(VRIsTouchingHandFake(entPlayer)) { - haptic(0, 0.0, 0.3, 75, 1.0); - haptic(1, 0.0, 0.3, 75, 1.0); + haptic(cVR_OffHand, 0.0, 0.3, 75, 1.0); + haptic(cVR_MainHand, 0.0, 0.3, 75, 1.0); return; } @@ -22,7 +23,7 @@ void() SUB_regen = self.model = self.mdl; // restore original model self.solid = SOLID_TRIGGER; // allow it to be touched again sound(self, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); // play respawn sound - setorigin (self, self.origin); + setorigin(self, self.origin); }; @@ -32,42 +33,71 @@ prints a warning message when spawned */ void() noclass = { - dprint ("noclass spawned at"); - dprint (vtos(self.origin)); - dprint ("\n"); - remove (self); + dprint("noclass spawned at"); + dprint(vtos(self.origin)); + dprint("\n"); + remove(self); }; float(entity ent) IsAmmoBox = { - return ent.classname == "item_shells" || - ent.classname == "item_spikes" || - ent.classname == "item_rockets" || - ent.classname == "item_cells"; + return ent.classname == ITEM_NAME_SHELLS || + ent.classname == ITEM_NAME_SPIKES || + ent.classname == ITEM_NAME_ROCKETS || + ent.classname == ITEM_NAME_CELLS; +} + +// TODO VR: (P1) move +float(float xFactor, float xMult) ShouldDropImpl = +{ + float chance; + chance = (1.0 - xFactor) / xMult; + + if(chance < 0.0) + { + chance = 0.0; + } + + if(chance > 1.0) + { + chance = 1.0; + } + + return random() > chance; +} + +float(float xFactor) ShouldDropEnemyWpn = +{ + return ShouldDropImpl(xFactor, cvar_hget(cvarh_vr_enemy_drops_chance_mult)); +} + +float(float xFactor) ShouldDropAmmoBox = +{ + return ShouldDropImpl(xFactor, cvar_hget(cvarh_vr_ammobox_drops_chance_mult)); } void(entity ent, entity entPlayer) SpawnAmmoBoxWeaponsImpl = { - if(random() < 0.65) + if(!ShouldDropAmmoBox(0.45)) { return; } - if(ent.classname == "item_shells") + if(ent.classname == ITEM_NAME_SHELLS) { if(!TryAmmoBoxDrop(ent, entPlayer, WID_AXE, 0.2)) if(!TryAmmoBoxDrop(ent, entPlayer, WID_SHOTGUN, 0.5)) if(!TryAmmoBoxDrop(ent, entPlayer, WID_SUPER_SHOTGUN, 0.7)) { /* Intentionally empty. */ } } - else if(ent.classname == "item_spikes") + else if(ent.classname == ITEM_NAME_SPIKES || ent.classname == ITEM_NAME_LAVA_NAILS) { if(!TryAmmoBoxDrop(ent, entPlayer, WID_NAILGUN, 0.4)) if(!TryAmmoBoxDrop(ent, entPlayer, WID_SUPER_NAILGUN, 0.5)) if(!TryAmmoBoxDrop(ent, entPlayer, WID_AXE, 0.2)) { /* Intentionally empty. */ } } - else if(ent.classname == "item_rockets") + else if(ent.classname == ITEM_NAME_ROCKETS || ent.classname == ITEM_NAME_MULTI_ROCKETS) { if(!TryAmmoBoxDrop(ent, entPlayer, WID_GRENADE_LAUNCHER, 0.3)) if(!TryAmmoBoxDrop(ent, entPlayer, WID_PROXIMITY_GUN, 0.4)) @@ -75,7 +105,7 @@ void(entity ent, entity entPlayer) SpawnAmmoBoxWeaponsImpl = if(!TryAmmoBoxDrop(ent, entPlayer, WID_AXE, 0.2)) { /* Intentionally empty. */ } } - else if(ent.classname == "item_cells") + else if(ent.classname == ITEM_NAME_CELLS || ent.classname == ITEM_NAME_PLASMA) { if(!TryAmmoBoxDrop(ent, entPlayer, WID_LIGHTNING, 0.3)) if(!TryAmmoBoxDrop(ent, entPlayer, WID_LASER_CANNON, 0.4)) @@ -87,7 +117,7 @@ void(entity ent, entity entPlayer) SpawnAmmoBoxWeaponsImpl = void(entity ent) SpawnAmmoBoxWeapons = { - local entity entPlayer; + entity entPlayer; entPlayer = find(world, classname, "player"); @@ -110,25 +140,71 @@ plants the object on the floor */ void() PlaceItem = { - local float oldz; + float oldz; self.mdl = self.model; // so it can be restored on respawn self.flags = FL_ITEM; // make extra wide self.solid = SOLID_TRIGGER; self.movetype = MOVETYPE_TOSS; self.velocity = '0 0 0'; - self.origin_z = self.origin_z + 6; - oldz = self.origin_z; - if(!droptofloor()) - { - dprint ("Bonus item fell out of level at "); - dprint (vtos(self.origin)); - dprint ("\n"); - remove(self); - return; + + float enableHoneyExtensions; + enableHoneyExtensions = VR_GameUtil_EnableHoneyExtensions(); + + // HONEY + if(enableHoneyExtensions && + (self.spawnflags & HONEY_SPAWNFLAG_ITEM_FLOATING)) + { + self.movetype = MOVETYPE_NONE; + setorigin(self, self.origin); + } + else + { + self.origin_z = self.origin_z + 6; + oldz = self.origin_z; + if(!droptofloor()) + { + dprint("Bonus item fell out of level!\n"); + dprint(self.classname); + dprint(" at "); + dprint(vtos(self.origin)); + dprint("\n"); + remove(self); + return; + } + } + + // HONEY + if(enableHoneyExtensions && + (self.spawnflags & HONEY_SPAWNFLAG_ITEM_SECRET)) + { + total_secrets += 1; + + if(!self.message) + { + self.message = "You found a secret item!"; + } + + if(skill == 0 || world.model == "maps/start.bsp") + { + ambient_secret_think(); + } + } + + // HONEY + self.th_die = self.handtouch; // Overriding self.touch and saving it to support items flagged as secret + self.handtouch = itemTouch; + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + item_unspawn(); } SpawnAmmoBoxWeapons(self); + + self.nextthink = time + 0.2; + self.think = PlacedItem; }; /* @@ -140,8 +216,6 @@ Sets the clipping size and plants the object on the floor */ void() StartItem = { - // TODO VR: (P2) doesn't seem to ever be called? - self.nextthink = time + 0.2; // items start after other solids self.think = PlaceItem; }; @@ -189,8 +263,6 @@ one point per second. float H_ROTTEN = 1; float H_MEGA = 2; .float healamount, healtype; -void() health_touch; -void() item_megahealth_rot; void() item_health = { @@ -205,7 +277,8 @@ void() item_health = self.noise = "items/r_item1.wav"; self.healamount = 15; self.healtype = 0; - setsize (self, '0 0 0', '32 32 16'); + setsize(self, '0 0 0', '32 32 16'); + if(deathmatch) { self.wait = 20; } } else if(self.spawnflags & H_MEGA) { @@ -215,7 +288,8 @@ void() item_health = self.noise = "items/r_item2.wav"; self.healamount = 100; self.healtype = 2; - setsize (self, '0 0 0', '32 32 32'); + setsize(self, '0 0 0', '32 32 32'); + if(deathmatch) { self.wait = 35; } } else { @@ -225,24 +299,26 @@ void() item_health = self.noise = "items/health1.wav"; self.healamount = 25; self.healtype = 1; - setsize (self, '0 0 0', '32 32 16'); + setsize(self, '0 0 0', '32 32 16'); + if(deathmatch) { self.wait = 20; } } StartItem(); + + self.think2 = AfterPlacementHealthBox; + self.nextthink2 = time + 0.75; }; void() health_touch = { - local string s; - - if(other.classname != "player") - return; + string s; if(self.healtype == 2) // Megahealth? Ignore max_health... { if(other.health >= 250) return; + if(!T_Heal(other, self.healamount, 1)) return; } @@ -262,33 +338,19 @@ void() health_touch = // health touch sound sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); - stuffcmd (other, "bf\n"); + stuffcmd(other, "bf\n"); self.model = string_null; self.solid = SOLID_NOT; // Megahealth = rot down the player's super health - if(self.healtype == 2) + if(self.healtype == 2 && !RuneHasElder(other)) { -// TODO VR: (P1) deal with superhealth hipnotic removal -// 11/02/96 removed SUPERHEALTH from defs.qc - other.items = other.items | IT_SUPERHEALTH; + VR_ItemUtil_EntAddItem(other, IID_SUPERHEALTH); self.nextthink = time + 5; self.think = item_megahealth_rot; self.owner = other; } - else - { - if(deathmatch != 2) // deathmatch 2 is the silly old rules - { - if(deathmatch) - self.nextthink = time + 20; - self.think = SUB_regen; - } - } - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets }; void() item_megahealth_rot = @@ -302,17 +364,9 @@ void() item_megahealth_rot = return; } -// it is possible for a player to die and respawn between rots, so don't -// just blindly subtract the flag off -// TODO VR: (P1) deal with superhealth hipnotic removal -// 11/02/96 removed SUPERHEALTH from defs.qc - other.items = other.items - (other.items & IT_SUPERHEALTH); - - if(deathmatch == 1) // deathmatch 2 is silly old rules - { - self.nextthink = time + 20; - self.think = SUB_regen; - } + // it is possible for a player to die and respawn between rots, so don't + // just blindly subtract the flag off + VR_ItemUtil_EntDelItem(other, IID_SUPERHEALTH); }; /* @@ -323,98 +377,98 @@ ARMOR =============================================================================== */ -void() armor_touch; - void() armor_touch = { - local float type, value, bit; - - if(other.health <= 0) - return; - if(other.classname != "player") - return; + float type, value, itemId; - if(self.classname == "item_armor1") + if(self.classname == ITEM_NAME_ARMOR1) { type = 0.3; value = 100; - bit = IT_ARMOR1; + itemId = IID_ARMOR1; } - if(self.classname == "item_armor2") + else if(self.classname == ITEM_NAME_ARMOR2) { type = 0.6; value = 150; - bit = IT_ARMOR2; + itemId = IID_ARMOR2; } - if(self.classname == "item_armorInv") + else { + ASSERT(self.classname == ITEM_NAME_ARMORINV); + type = 0.8; value = 200; - bit = IT_ARMOR3; + itemId = IID_ARMOR3; } - if(other.armortype*other.armorvalue >= type*value) + + if(other.armortype * other.armorvalue >= type * value) + { return; + } other.armortype = type; other.armorvalue = value; - other.items = other.items - (other.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit; + + VR_ItemUtil_EntDelItem(other, IID_ARMOR1); + VR_ItemUtil_EntDelItem(other, IID_ARMOR2); + VR_ItemUtil_EntDelItem(other, IID_ARMOR3); + + VR_ItemUtil_EntAddItem(other, itemId); self.solid = SOLID_NOT; self.model = string_null; - if(deathmatch == 1) - self.nextthink = time + 20; - self.think = SUB_regen; VRItemPickupHaptic(other); sprint(other, "You got armor\n"); // armor touch sound sound(other, CHAN_ITEM, "items/armor1.wav", 1, ATTN_NORM); - stuffcmd (other, "bf\n"); - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets + stuffcmd(other, "bf\n"); }; +void(string xModelName, float xWait) impl_equipment_item = +{ + precache_model(xModelName); + setmodel(self, xModelName); + if(deathmatch) { self.wait = xWait; } +} + +void(float xSkin) impl_equipment_armor = +{ + impl_equipment_item("progs/armor.mdl", 20); + + self.handtouch = armor_touch; + self.skin = xSkin; + setsize(self, '-11 -11 0', '11 11 31'); + StartItem(); +} /*QUAKED item_armor1 (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() item_armor1 = { - self.handtouch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 0; - setsize (self, '-10 -10 0', '10 10 28'); - StartItem(); -}; + impl_equipment_armor(0); +} /*QUAKED item_armor2 (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() item_armor2 = { - self.handtouch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 1; - setsize (self, '-10 -10 0', '10 10 28'); - StartItem(); -}; + impl_equipment_armor(1); +} /*QUAKED item_armorInv (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() item_armorInv = { - self.handtouch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 2; - setsize (self, '-10 -10 0', '10 10 28'); - StartItem(); -}; + impl_equipment_armor(2); +} + +void() item_armorinv = +{ + item_armorInv(); +} /* =============================================================================== @@ -434,6 +488,15 @@ void() bound_other_ammo = other.ammo_rockets = 100; if(other.ammo_cells > 100) other.ammo_cells = 100; + + // ROGUE + // PGM addition + if(other.ammo_lava_nails > 200) + other.ammo_lava_nails = 200; + if(other.ammo_multi_rockets > 100) + other.ammo_multi_rockets = 100; + if(other.ammo_plasma > 100) + other.ammo_plasma = 100; }; @@ -461,285 +524,212 @@ float(float w) RankForWeapon = return 10; }; -/* -============= -Deathmatch_Weapon - -Deathmatch weapon change rules for picking up a weapon - -.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; -============= -*/ -void(float old, float new) Deathmatch_Weapon = -{ - local float or, nr; - -// change self.weapon if desired - or = RankForWeapon (self.weapon); - nr = RankForWeapon (new); - if( nr < or ) - self.weapon = new; -}; - /* ============= weapon_touch ============= */ -float() W_BestWeapon; - void() weapon_touch = { - local float hadammo, best, newIt, old; - local entity stemp; - local float leave; + float hadammo; + entity stemp; + float leave; - if(!(other.flags & FL_CLIENT)) - return; + float touchinghandIsBody; - // Do not pick up the weapon if the touching hand is not grabbing. - if(cvar("vr_body_interactions") == 0 && cvar("vr_enabled") == 1) + // True if `other` has "VR body interactions" enabled. + touchinghandIsBody = VRIsTouchingHandFake(other); + + // Do not pick up if the touching hand is not empty and grabbing. + if(other.ishuman && !touchinghandIsBody) { - if(!VRIsEntHandGrabbing(other, VRGetTouchingHand(other)) || + if(!VR_HandGrabUtil_IsHandGrabbing(other, VRGetTouchingHand(other)) || VRGetEntWeapon(other, VRGetTouchingHand(other)) != WID_FIST) { return; } } -// if the player was using his best weapon, change up to the new one if better - stemp = self; - self = other; - best = W_BestWeapon(); - self = stemp; + // Do not pick up the weapon if body interactions is enabled and no hands + // are free. + if(other.ishuman && touchinghandIsBody && + !VRIsHandEmpty(other, cVR_MainHand) && + !VRIsHandEmpty(other, cVR_OffHand)) + { + // TODO VR: (P1) revisit this behavior, maybe put in holder or drop? + // or cvar? + return; + } + + // If `other` is a bot, they will always drop their main hand weapon. if(deathmatch == 2 || coop) leave = 1; else leave = 0; - if(self.classname == "weapon_nailgun") - { - if(leave && (other.items & IT_NAILGUN) ) - return; - hadammo = other.ammo_nails; - newIt = IT_NAILGUN; - other.ammo_nails = other.ammo_nails + 30; - } - else if(self.classname == "weapon_supernailgun") - { - if(leave && (other.items & IT_SUPER_NAILGUN) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_SUPER_NAILGUN; - other.ammo_nails = other.ammo_nails + 30; - } - else if(self.classname == "weapon_supershotgun") - { - if(leave && (other.items & IT_SUPER_SHOTGUN) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_SUPER_SHOTGUN; - other.ammo_shells = other.ammo_shells + 5; - } - else if(self.classname == "weapon_rocketlauncher") - { - if(leave && (other.items & IT_ROCKET_LAUNCHER) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_ROCKET_LAUNCHER; - other.ammo_rockets = other.ammo_rockets + 5; - } - else if(self.classname == "weapon_grenadelauncher") - { - if(leave && (other.items & IT_GRENADE_LAUNCHER) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_GRENADE_LAUNCHER; - other.ammo_rockets = other.ammo_rockets + 5; - } - else if(self.classname == "weapon_lightning") - { - if(leave && (other.items & IT_LIGHTNING) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_LIGHTNING; - other.ammo_cells = other.ammo_cells + 15; - } -//MED - else if(self.classname == "weapon_laser_gun") - { - if(leave && (other.items & IT_LASER_CANNON) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_LASER_CANNON; - other.ammo_cells = other.ammo_cells + 30; - } -//MED - else if(self.classname == "weapon_mjolnir") + float weaponId; + weaponId = WeaponClassNameToWeaponId(self.classname); + + if(weaponId == WID_FIST) { - if(leave && (other.items & IT_MJOLNIR) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_MJOLNIR; - other.ammo_cells = other.ammo_cells + 30; + objerror("weapon_touch: unknown classname"); } -//MED - else if(self.classname == "weapon_proximity_gun") + + if(leave && VR_WeaponUtil_EntHasWeapon(other, weaponId)) { - if(leave && (other.hipnotic_items & IT_PROXIMITY_GUN) ) - return; - hadammo = other.ammo_rockets; - newIt = IT_PROXIMITY_GUN; - other.ammo_rockets = other.ammo_rockets + 6; + return; } - else - objerror ("weapon_touch: unknown classname"); + + float ammoId; + ammoId = WeaponIdToAmmoId(weaponId, 0 /* weaponflags */); + + hadammo = VR_AmmoUtil_GetAmmoCountByAmmoId(other, ammoId); + + VR_AmmoUtil_SetAmmoCountByAmmoId(other, ammoId, + hadammo + WeaponIdToInitialAmmoCount(weaponId)); VRItemPickupHaptic(other); - sprint (other, "You got the "); - sprint (other, self.netname); - sprint (other, "\n"); -// weapon touch sound + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other, "\n"); + + // weapon touch sound sound(other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); - stuffcmd (other, "bf\n"); + stuffcmd(other, "bf\n"); bound_other_ammo(); -// change to the weapon - old = other.items; - other.items = other.items | newIt; + VR_WeaponUtil_EntAddWeapon(other, weaponId); stemp = self; self = other; - local float touchinghandIsBody; - touchinghandIsBody = VRIsTouchingHandFake(other); - - local float touchinghand; - touchinghand = VRGetTouchingHand(other); - - if(!deathmatch) + if(touchinghandIsBody) { - if(touchinghandIsBody && VRGetEntWeapon(other, touchinghand) != WID_FIST) + if(other.ishuman) { - // This can happen if VR body interactions is on. - DropWeaponInHand(other, touchinghand, - VRGetEntWeapon(other, touchinghand)); + if(VRIsHandEmpty(other, cVR_MainHand)) + { + VRSetWeapon(cVR_MainHand, weaponId); + W_SetCurrentAmmoFor(cVR_MainHand); + } + else if(VRIsHandEmpty(other, cVR_OffHand)) + { + VRSetWeapon(cVR_OffHand, weaponId); + W_SetCurrentAmmoFor(cVR_OffHand); + } + else + { + bprint("BUG: Attempting to pick weapon with no hands free."); + } + } + else + { + DropWeaponInHand(other, cVR_MainHand, + VRGetEntWeapon(other, cVR_MainHand), + VRGetEntWeaponFlags(other, cVR_MainHand)); } - - VRSetWeapon(touchinghand, ItemIdToWeaponId(newIt)); } else { - // TODO VR: (P2) what should this do? - Deathmatch_Weapon (old, ItemIdToWeaponId(newIt)); + float touchinghand; + touchinghand = VRGetTouchingHand(other); + + if(!VRIsHandEmpty(other, touchinghand)) + { + bprint("BUG: Attempting to pick weapon with full hand."); + } + + VRSetWeapon(touchinghand, weaponId); + W_SetCurrentAmmoFor(touchinghand); } - W_SetCurrentAmmoFor(touchinghand); self = stemp; if(leave) return; -// remove it in single player, or setup for respawning in deathmatch + // remove it in single player, or setup for respawning in deathmatch self.model = string_null; self.solid = SOLID_NOT; - if(deathmatch == 1) - self.nextthink = time + 30; - self.think = SUB_regen; - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets }; +void() weapon_item_think = +{ + if(self.model != string_null) + { + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_GUNPICKUP, 2); + self.nextthink2 = time + 0.05; + } +} + +void(string xModelName, float xWeaponId) impl_weapon_item = +{ + precache_model(xModelName); + setmodel(self, xModelName); + self.weapon = xWeaponId; + self.vr_itemId = WeaponIdToItemId(self.weapon); + self.netname = WeaponIdToWeaponName(self.weapon); + self.handtouch = weapon_touch; + self.think2 = weapon_item_think; + self.nextthink2 = time + 0.05; + setsize(self, '-8 -8 -4', '8 8 38'); + if(deathmatch) { self.wait = 30; } + StartItem(); +} -/*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32) +/*QUAKED weapon_shotgun (0 .5 .8) (-16 -16 0) (16 16 32) */ +void() weapon_shotgun = +{ + impl_weapon_item("progs/g_shot0.mdl", WID_SHOTGUN); +} + +/*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32) +*/ void() weapon_supershotgun = { - precache_model ("progs/g_shot.mdl"); - setmodel (self, "progs/g_shot.mdl"); - self.weapon = WID_SUPER_SHOTGUN; - self.netname = "Double-barrelled Shotgun"; - self.handtouch = weapon_touch; - setsize (self, '-8 -8 16', '8 8 38'); - StartItem(); -}; + impl_weapon_item("progs/g_shot.mdl", WID_SUPER_SHOTGUN); +} /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() weapon_nailgun = { - precache_model ("progs/g_nail.mdl"); - setmodel (self, "progs/g_nail.mdl"); - self.weapon = WID_NAILGUN; - self.netname = "nailgun"; - self.handtouch = weapon_touch; - setsize (self, '-8 -8 16', '8 8 38'); - StartItem(); -}; + impl_weapon_item("progs/g_nail.mdl", WID_NAILGUN); +} /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() weapon_supernailgun = { - precache_model ("progs/g_nail2.mdl"); - setmodel (self, "progs/g_nail2.mdl"); - self.weapon = WID_SUPER_NAILGUN; - self.netname = "Super Nailgun"; - self.handtouch = weapon_touch; - setsize (self, '-8 -8 16', '8 8 38'); - StartItem(); -}; + impl_weapon_item("progs/g_nail2.mdl", WID_SUPER_NAILGUN); +} /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() weapon_grenadelauncher = { - precache_model ("progs/g_rock.mdl"); - setmodel (self, "progs/g_rock.mdl"); - self.weapon = WID_GRENADE_LAUNCHER; - self.netname = "Grenade Launcher"; - self.handtouch = weapon_touch; - setsize (self, '-8 -8 16', '8 8 38'); - StartItem(); -}; + impl_weapon_item("progs/g_rock.mdl", WID_GRENADE_LAUNCHER); +} /*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() weapon_rocketlauncher = { - precache_model ("progs/g_rock2.mdl"); - setmodel (self, "progs/g_rock2.mdl"); - self.weapon = WID_ROCKET_LAUNCHER; - self.netname = "Rocket Launcher"; - self.handtouch = weapon_touch; - setsize (self, '-8 -8 16', '8 8 38'); - StartItem(); -}; - + impl_weapon_item("progs/g_rock2.mdl", WID_ROCKET_LAUNCHER); +} /*QUAKED weapon_lightning (0 .5 .8) (-16 -16 0) (16 16 32) */ - void() weapon_lightning = { - precache_model ("progs/g_light.mdl"); - setmodel (self, "progs/g_light.mdl"); - self.weapon = WID_LIGHTNING; - self.netname = "Thunderbolt"; - self.handtouch = weapon_touch; - setsize (self, '-8 -8 16', '8 8 38'); - StartItem(); -}; + impl_weapon_item("progs/g_light.mdl", WID_LIGHTNING); +} /* @@ -752,92 +742,65 @@ AMMO void() ammo_touch = { -local entity stemp; -local float best; - - if(other.classname != "player") - return; - if(other.health <= 0) - return; + entity stemp; -// if the player was using his best weapon, change up to the new one if better - stemp = self; - self = other; - best = W_BestWeapon(); - self = stemp; - - -// shotgun - if(self.weapon == 1) + if(self.weapon == AID_SHELLS) { - if(other.ammo_shells >= 100) - return; + if(other.ammo_shells >= 100) { return; } other.ammo_shells = other.ammo_shells + self.aflag; } - -// spikes - if(self.weapon == 2) + else if(self.weapon == AID_NAILS) { - if(other.ammo_nails >= 200) - return; + if(other.ammo_nails >= 200) { return; } other.ammo_nails = other.ammo_nails + self.aflag; } - -// rockets - if(self.weapon == 3) + else if(self.weapon == AID_ROCKETS) { - if(other.ammo_rockets >= 100) - return; + if(other.ammo_rockets >= 100) { return; } other.ammo_rockets = other.ammo_rockets + self.aflag; } - -// cells - if(self.weapon == 4) + else if(self.weapon == AID_CELLS) { - if(other.ammo_cells >= 100) - return; + if(other.ammo_cells >= 100) { return; } other.ammo_cells = other.ammo_cells + self.aflag; } + else if(self.weapon == AID_LAVA_NAILS) + { + if(other.ammo_lava_nails >= 200) { return; } + other.ammo_lava_nails = other.ammo_lava_nails + self.aflag; + } + else if(self.weapon == AID_MULTI_ROCKETS) + { + if(other.ammo_multi_rockets >= 100) { return; } + other.ammo_multi_rockets = other.ammo_multi_rockets + self.aflag; + } + else if(self.weapon == AID_PLASMA) + { + if(other.ammo_plasma >= 100) { return; } + other.ammo_plasma = other.ammo_plasma + self.aflag; + } bound_other_ammo(); VRItemPickupHaptic(other); - sprint (other, "You got the "); - sprint (other, self.netname); - sprint (other, "\n"); -// ammo touch sound - sound(other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); - stuffcmd (other, "bf\n"); - -// change to a better weapon if appropriate + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other, "\n"); - if( other.weapon == best ) - { - stemp = self; - self = other; - - // self.weapon = W_BestWeapon(); - // W_SetCurrentAmmo(); - - self = stemp; - } + // ammo touch sound + sound(other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); + stuffcmd(other, "bf\n"); -// if changed current ammo, update it + // if changed current ammo, update it stemp = self; self = other; W_SetCurrentAmmo(); self = stemp; -// remove it in single player, or setup for respawning in deathmatch + // remove it in single player, or setup for respawning in deathmatch self.model = string_null; self.solid = SOLID_NOT; - if(deathmatch == 1) - self.nextthink = time + 30; - self.think = SUB_regen; - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets }; @@ -845,185 +808,219 @@ local float best; float WEAPON_BIG2 = 1; -/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) big -*/ -void() item_shells = +void() PlacedItem = { - self.handtouch = ammo_touch; +} - if(self.spawnflags & WEAPON_BIG2) +void(float xTime) forcegrabbable_item_reposition = +{ + vector o0 = self.origin; + o0.z = 0; + + vector o1 = self.oldorigin; + o1.z = 0; + + float origDiff = vlen(o1 - o0); + + if(origDiff > 1 || (time < self.nextthink2)) { - precache_model ("maps/b_shell1.bsp"); - setmodel (self, "maps/b_shell1.bsp"); - self.aflag = 40; + if(self.rad_time == -999) + { + self.rad_time = time + xTime; + } + else if(time >= self.rad_time || self.solid == SOLID_NOT) + { + setorigin(self, self.oldorigin); + self.rad_time = -999; + + if(self.solid != SOLID_NOT) + { + sound(self, CHAN_AUTO, "misc/r_tele4.wav", 0.25, ATTN_NORM); + } + } } - else +} + +void() forcegrabbable_item_think = +{ + float repositionTimeDeathmatch = + cvar_hget(cvarh_vr_forcegrabbable_return_time_deathmatch); + + float repositionTimeSingleplayer = + cvar_hget(cvarh_vr_forcegrabbable_return_time_singleplayer); + + if(deathmatch && repositionTimeDeathmatch > 0) { - precache_model ("maps/b_shell0.bsp"); - setmodel (self, "maps/b_shell0.bsp"); - self.aflag = 20; + forcegrabbable_item_reposition(repositionTimeDeathmatch); + } + else if(!deathmatch && repositionTimeSingleplayer > 0) + { + forcegrabbable_item_reposition(repositionTimeSingleplayer); } - self.weapon = 1; - self.netname = "shells"; - self.classname = "item_shells"; - - setsize (self, '0 0 0', '24 24 24'); - StartItem(); -}; -/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) big -*/ + forcegrabbable_think_impl(); + self.nextthink = time + 0.02; +} -void() item_spikes = +void(entity xEnt, float scaleFactor) MakeItemGrabbable = { - self.handtouch = ammo_touch; + self.oldorigin = self.origin; + self.rad_time = -999; - if(self.spawnflags & WEAPON_BIG2) + vector factorVector; + factorVector.x = scaleFactor; + factorVector.y = scaleFactor; + factorVector.z = scaleFactor; + + VR_ScaleUtil_SetScale(self, factorVector); + setsize(self, '0 0 0', self.maxs * scaleFactor); + + MakeGrabbable(self); + self.flags |= FL_FORCEGRABBABLE; + + SetThrownWeaponDealDamage(self, FALSE); + SetThrownWeaponDisappearOnHit(self, FALSE); + + self.think = forcegrabbable_item_think; + self.nextthink = time + 0.02; + + self.touch = forcegrabbable_touch; + self.owner = world; +} + +void() AfterPlacementAmmoBox = +{ + if(cvar_hget(cvarh_vr_forcegrabbable_ammo_boxes)) { - precache_model ("maps/b_nail1.bsp"); - setmodel (self, "maps/b_nail1.bsp"); - self.aflag = 50; + MakeItemGrabbable(self, 0.4); } - else +} + +void() AfterPlacementHealthBox = +{ + if(cvar_hget(cvarh_vr_forcegrabbable_health_boxes)) { - precache_model ("maps/b_nail0.bsp"); - setmodel (self, "maps/b_nail0.bsp"); - self.aflag = 25; + MakeItemGrabbable(self, 0.4); } - self.weapon = 2; - self.netname = "nails"; - self.classname = "item_spikes"; - setsize (self, '0 0 0', '24 24 24'); - StartItem(); -}; - -/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) big -*/ +} -void() item_rockets = +void(string xModelNameSmall, string xModelNameBig, + float xAmmoCountSmall, float xAmmoCountBig, + float xAmmoId, vector xSize) +impl_item_ammo_pickup = { self.handtouch = ammo_touch; if(self.spawnflags & WEAPON_BIG2) { - precache_model ("maps/b_rock1.bsp"); - setmodel (self, "maps/b_rock1.bsp"); - self.aflag = 10; + precache_model(xModelNameBig); + setmodel(self, xModelNameBig); + self.aflag = xAmmoCountBig; } else { - precache_model ("maps/b_rock0.bsp"); - setmodel (self, "maps/b_rock0.bsp"); - self.aflag = 5; + precache_model(xModelNameSmall); + setmodel(self, xModelNameSmall); + self.aflag = xAmmoCountSmall; } - self.weapon = 3; - self.netname = "rockets"; - self.classname = "item_rockets"; - setsize (self, '0 0 0', '16 16 32'); + self.weapon = xAmmoId; + self.netname = VR_AmmoUtil_AmmoIdToNetname(xAmmoId); + self.classname = VR_AmmoUtil_AmmoIdToItemName(xAmmoId); + + setsize(self, '0 0 0', xSize); + if(deathmatch) { self.wait = 30; } StartItem(); + + self.think2 = AfterPlacementAmmoBox; + self.nextthink2 = time + 0.75; +} + +/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 20, Big box is 40. +*/ + +void() item_shells = +{ + impl_item_ammo_pickup( + "maps/b_shell0.bsp", "maps/b_shell1.bsp", + 20, 40, + AID_SHELLS, '24 24 24'); }; -/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) big +/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 25, Big box is 50. */ -void() item_cells = +void() item_spikes = { - self.handtouch = ammo_touch; + impl_item_ammo_pickup( + "maps/b_nail0.bsp", "maps/b_nail1.bsp", + 25, 50, + AID_NAILS, '24 24 24'); +}; - if(self.spawnflags & WEAPON_BIG2) - { - precache_model ("maps/b_batt1.bsp"); - setmodel (self, "maps/b_batt1.bsp"); - self.aflag = 12; - } - else - { - precache_model ("maps/b_batt0.bsp"); - setmodel (self, "maps/b_batt0.bsp"); - self.aflag = 6; - } - self.weapon = 4; - self.netname = "cells"; - self.classname = "item_cells"; +/*QUAKED item_lava_spikes (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 25, Big box is 50. +*/ - setsize (self, '0 0 0', '24 24 24'); - StartItem(); +void() item_lava_spikes = +{ + impl_item_ammo_pickup( + "maps/b_lnail0.bsp", "maps/b_lnail1.bsp", + 25, 50, + AID_LAVA_NAILS, '24 24 24'); }; -/*QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big -DO NOT USE THIS!!!! IT WILL BE REMOVED! +/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 5, Big box is 10. */ -float WEAPON_SHOTGUN = 1; -float WEAPON_ROCKET = 2; -float WEAPON_SPIKES = 4; -float WEAPON_BIG = 8; -void() item_weapon = +void() item_rockets = { - self.handtouch = ammo_touch; + impl_item_ammo_pickup( + "maps/b_rock0.bsp", "maps/b_rock1.bsp", + 5, 10, + AID_ROCKETS, '16 16 32'); +}; - if(self.spawnflags & WEAPON_SHOTGUN) - { - if(self.spawnflags & WEAPON_BIG) - { - precache_model ("maps/b_shell1.bsp"); - setmodel (self, "maps/b_shell1.bsp"); - self.aflag = 40; - } - else - { - precache_model ("maps/b_shell0.bsp"); - setmodel (self, "maps/b_shell0.bsp"); - self.aflag = 20; - } - self.weapon = 1; - self.netname = "shells"; - } +/*QUAKED item_multi_rockets (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 5, Big box is 10. +*/ - if(self.spawnflags & WEAPON_SPIKES) - { - if(self.spawnflags & WEAPON_BIG) - { - precache_model ("maps/b_nail1.bsp"); - setmodel (self, "maps/b_nail1.bsp"); - self.aflag = 40; - } - else - { - precache_model ("maps/b_nail0.bsp"); - setmodel (self, "maps/b_nail0.bsp"); - self.aflag = 20; - } - self.weapon = 2; - self.netname = "spikes"; - } +void() item_multi_rockets = +{ + impl_item_ammo_pickup( + "maps/b_mrock1.bsp", "maps/b_mrock0.bsp", + 5, 10, + AID_MULTI_ROCKETS, '24 24 24'); +}; - if(self.spawnflags & WEAPON_ROCKET) - { - if(self.spawnflags & WEAPON_BIG) - { - precache_model ("maps/b_rock1.bsp"); - setmodel (self, "maps/b_rock1.bsp"); - self.aflag = 10; - } - else - { - precache_model ("maps/b_rock0.bsp"); - setmodel (self, "maps/b_rock0.bsp"); - self.aflag = 5; - } - self.weapon = 3; - self.netname = "rockets"; - } +/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 6, Big box is 12. +*/ - setsize (self, '0 0 0', '24 24 24'); - StartItem(); +void() item_cells = +{ + impl_item_ammo_pickup( + "maps/b_batt1.bsp", "maps/b_batt0.bsp", + 6, 12, + AID_CELLS, '24 24 24'); }; +/*QUAKED item_plasma (0 .5 .8) (0 0 0) (32 32 32) big +Small box is 6, Big box is 12. +*/ +void() item_plasma = +{ + impl_item_ammo_pickup( + "maps/b_plas1.bsp", "maps/b_plas0.bsp", + 6, 12, + AID_PLASMA, '24 24 24'); +}; /* =============================================================================== @@ -1035,33 +1032,25 @@ KEYS void() key_touch = { - if(other.classname != "player") - return; - - if(other.health <= 0) - return; - - if(other.items & self.items) + if(VR_ItemUtil_EntHasItem(other, self.vr_itemId)) return; VRItemPickupHaptic(other); - sprint (other, "You got the "); - sprint (other, self.netname); - sprint (other,"\n"); + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other,"\n"); sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); - stuffcmd (other, "bf\n"); - other.items = other.items | self.items; + stuffcmd(other, "bf\n"); + + VR_ItemUtil_EntAddItem(other, self.vr_itemId); if(!coop) { self.solid = SOLID_NOT; self.model = string_null; } - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets }; @@ -1072,14 +1061,14 @@ void() key_setsounds = precache_sound("misc/medkey.wav"); self.noise = "misc/medkey.wav"; } - if(world.worldtype == 1) + else if(world.worldtype == 1) { precache_sound("misc/runekey.wav"); self.noise = "misc/runekey.wav"; } - if(world.worldtype == 2) + else if(world.worldtype == 2) { - precache_sound2 ("misc/basekey.wav"); + precache_sound2("misc/basekey.wav"); self.noise = "misc/basekey.wav"; } }; @@ -1099,28 +1088,28 @@ void() item_key1 = { if(world.worldtype == 0) { - precache_model ("progs/w_s_key.mdl"); - setmodel (self, "progs/w_s_key.mdl"); + precache_model("progs/w_s_key.mdl"); + setmodel(self, "progs/w_s_key.mdl"); self.netname = "silver key"; } else if(world.worldtype == 1) { - precache_model ("progs/m_s_key.mdl"); - setmodel (self, "progs/m_s_key.mdl"); + precache_model("progs/m_s_key.mdl"); + setmodel(self, "progs/m_s_key.mdl"); self.netname = "silver runekey"; } else if(world.worldtype == 2) { - precache_model2 ("progs/b_s_key.mdl"); - setmodel (self, "progs/b_s_key.mdl"); + precache_model2("progs/b_s_key.mdl"); + setmodel(self, "progs/b_s_key.mdl"); self.netname = "silver keycard"; } key_setsounds(); self.handtouch = key_touch; - self.items = IT_KEY1; + self.vr_itemId = IID_KEY1; - setsize (self, '-16 -16 -24', '16 16 32'); + setsize(self, '-8 -8 -24', '8 8 32'); StartItem(); }; @@ -1140,33 +1129,28 @@ void() item_key2 = { if(world.worldtype == 0) { - precache_model ("progs/w_g_key.mdl"); - setmodel (self, "progs/w_g_key.mdl"); + precache_model("progs/w_g_key.mdl"); + setmodel(self, "progs/w_g_key.mdl"); self.netname = "gold key"; } else if(world.worldtype == 1) { - precache_model ("progs/m_g_key.mdl"); - setmodel (self, "progs/m_g_key.mdl"); + precache_model("progs/m_g_key.mdl"); + setmodel(self, "progs/m_g_key.mdl"); self.netname = "gold runekey"; } else if(world.worldtype == 2) { - precache_model2 ("progs/b_g_key.mdl"); - setmodel (self, "progs/b_g_key.mdl"); + precache_model2("progs/b_g_key.mdl"); + setmodel(self, "progs/b_g_key.mdl"); self.netname = "gold keycard"; } key_setsounds(); self.handtouch = key_touch; - self.items = IT_KEY2; + self.vr_itemId = IID_KEY2; - setsize (self, '-16 -16 -24', '16 16 32'); - - // TODO VR: (P2) these cannot be made smaller otherwise they get OOB in - // some maps. Need to fix up origin but haven't figured out how. - // setsize (self, '-8 -8 -24', '8 8 32'); - // self.origin = self.origin + '0 -16 0'; + setsize(self, '-8 -8 -24', '8 8 32'); StartItem(); }; @@ -1183,22 +1167,14 @@ END OF LEVEL RUNES void() sigil_touch = { - if(other.classname != "player") - return; - if(other.health <= 0) - return; - - centerprint (other, "You got the rune!"); + centerprint(other, "You got the rune!"); sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); - stuffcmd (other, "bf\n"); + stuffcmd(other, "bf\n"); self.solid = SOLID_NOT; self.model = string_null; serverflags = serverflags | (self.spawnflags & 15); self.classname = ""; // so rune doors won't find it - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets }; @@ -1216,31 +1192,31 @@ void() item_sigil = if(self.spawnflags & 1) { - precache_model ("progs/end1.mdl"); - setmodel (self, "progs/end1.mdl"); + precache_model("progs/end1.mdl"); + setmodel(self, "progs/end1.mdl"); } if(self.spawnflags & 2) { - precache_model2 ("progs/end2.mdl"); - setmodel (self, "progs/end2.mdl"); + precache_model2("progs/end2.mdl"); + setmodel(self, "progs/end2.mdl"); } if(self.spawnflags & 4) { - precache_model2 ("progs/end3.mdl"); - setmodel (self, "progs/end3.mdl"); + precache_model2("progs/end3.mdl"); + setmodel(self, "progs/end3.mdl"); } if(self.spawnflags & 8) { - precache_model2 ("progs/end4.mdl"); - setmodel (self, "progs/end4.mdl"); + precache_model2("progs/end4.mdl"); + setmodel(self, "progs/end4.mdl"); } self.handtouch = sigil_touch; - setsize (self, '-16 -16 -24', '16 16 32'); + setsize(self, '-16 -16 -24', '16 16 32'); StartItem(); }; @@ -1252,39 +1228,39 @@ POWERUPS =============================================================================== */ -void() powerup_touch; - - void() powerup_touch = { - if(other.classname != "player") - return; - if(other.health <= 0) - return; - VRItemPickupHaptic(other); - sprint (other, "You got the "); - sprint (other, self.netname); - sprint (other,"\n"); + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other,"\n"); if(deathmatch) { self.mdl = self.model; - if((self.classname == "item_artifact_invulnerability") || - (self.classname == "item_artifact_invisibility")) - self.nextthink = time + 60*5; + if(self.classname == "item_random_powerup") + { + self.nextthink = time + 30; + self.think = random_regen; + } else - self.nextthink = time + 60; + { + if((self.classname == "item_artifact_invulnerability") || + (self.classname == "item_artifact_invisibility")) + self.nextthink = time + 60*5; + else + self.nextthink = time + 60; - self.think = SUB_regen; + self.think = SUB_regen; + } } sound(other, CHAN_VOICE, self.noise, 1, ATTN_NORM); - stuffcmd (other, "bf\n"); + stuffcmd(other, "bf\n"); self.solid = SOLID_NOT; - other.items = other.items | self.items; + VR_ItemUtil_EntAddItem(other, self.vr_itemId); self.model = string_null; // do the apropriate action @@ -1311,9 +1287,6 @@ void() powerup_touch = other.super_time = 1; other.super_damage_finished = time + 30; } - - activator = other; - SUB_UseTargets(); // fire all targets / killtargets }; @@ -1325,15 +1298,17 @@ void() item_artifact_invulnerability = { self.handtouch = powerup_touch; - precache_model ("progs/invulner.mdl"); + precache_model("progs/invulner.mdl"); precache_sound("items/protect.wav"); precache_sound("items/protect2.wav"); precache_sound("items/protect3.wav"); self.noise = "items/protect.wav"; - setmodel (self, "progs/invulner.mdl"); + setmodel(self, "progs/invulner.mdl"); + self.classname = "item_artifact_invulnerability"; self.netname = "Pentagram of Protection"; - self.items = IT_INVULNERABILITY; - setsize (self, '-16 -16 -24', '16 16 32'); + self.vr_itemId = IID_INVULNERABILITY; + setsize(self, '-8 -8 -24', '8 8 32'); + if(deathmatch) { self.wait = 60*5; } StartItem(); }; @@ -1345,15 +1320,16 @@ void() item_artifact_envirosuit = { self.handtouch = powerup_touch; - precache_model ("progs/suit.mdl"); + precache_model("progs/suit.mdl"); precache_sound("items/suit.wav"); precache_sound("items/suit2.wav"); self.noise = "items/suit.wav"; - setmodel (self, "progs/suit.mdl"); + setmodel(self, "progs/suit.mdl"); + self.classname = "item_artifact_envirosuit"; self.netname = "Biosuit"; - self.items = IT_SUIT; - // TODO VR: (P2) changing 16 to 8 makes biosuit disappear from E1M1, why? - setsize (self, '-16 -16 -24', '16 16 32'); + self.vr_itemId = IID_SUIT; + setsize(self, '-8 -8 -24', '8 8 32'); + if(deathmatch) { self.wait = 60; } StartItem(); }; @@ -1365,15 +1341,17 @@ void() item_artifact_invisibility = { self.handtouch = powerup_touch; - precache_model ("progs/invisibl.mdl"); + precache_model("progs/invisibl.mdl"); precache_sound("items/inv1.wav"); precache_sound("items/inv2.wav"); precache_sound("items/inv3.wav"); self.noise = "items/inv1.wav"; - setmodel (self, "progs/invisibl.mdl"); + setmodel(self, "progs/invisibl.mdl"); + self.classname = "item_artifact_invisibility"; self.netname = "Ring of Shadows"; - self.items = IT_INVISIBILITY; - setsize (self, '-16 -16 -24', '16 16 32'); + self.vr_itemId = IID_INVISIBILITY; + setsize(self, '-8 -8 -24', '8 8 32'); + if(deathmatch) { self.wait = 60*5; } StartItem(); }; @@ -1385,15 +1363,17 @@ void() item_artifact_super_damage = { self.handtouch = powerup_touch; - precache_model ("progs/quaddama.mdl"); + precache_model("progs/quaddama.mdl"); precache_sound("items/damage.wav"); precache_sound("items/damage2.wav"); precache_sound("items/damage3.wav"); self.noise = "items/damage.wav"; - setmodel (self, "progs/quaddama.mdl"); + setmodel(self, "progs/quaddama.mdl"); + self.classname = "item_artifact_super_damage"; self.netname = "Quad Damage"; - self.items = IT_QUAD; - setsize (self, '-16 -16 -24', '16 16 32'); + self.vr_itemId = IID_QUAD; + setsize(self, '-8 -8 -24', '8 8 32'); + if(deathmatch) { self.wait = 60; } StartItem(); }; @@ -1409,10 +1389,8 @@ PLAYER BACKPACKS void() BackpackTouch = { - local string s; - local float best, old, newIt; - local entity stemp; - local float acount; + string s; + float acount; if(other.classname != "player") { @@ -1424,52 +1402,36 @@ void() BackpackTouch = return; } + //ZOID-- + // Don't let the owner pick up his own backpack for a second. + if((other == self.owner) && ((self.nextthink - time) > 119)) + return; + //--ZOID + VRItemPickupHaptic(other); acount = 0; sprint(other, "You get "); - if(self.items) - { - if((other.items & self.items) == 0) - { - acount = 1; - sprint (other, "the "); - sprint (other, self.netname); - } - } - - // if the player was using his best weapon, change up to the new one if better - stemp = self; - self = other; - best = W_BestWeapon(); - self = stemp; + other.ammo_shells += self.ammo_shells; + other.ammo_nails += self.ammo_nails; + other.ammo_rockets += self.ammo_rockets; + other.ammo_cells += self.ammo_cells; - // change weapons - other.ammo_shells = other.ammo_shells + self.ammo_shells; - other.ammo_nails = other.ammo_nails + self.ammo_nails; - other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; - other.ammo_cells = other.ammo_cells + self.ammo_cells; + other.ammo_lava_nails += self.ammo_lava_nails; + other.ammo_multi_rockets += self.ammo_multi_rockets; + other.ammo_plasma += self.ammo_plasma; bound_other_ammo(); - // VR: Do not change weapons. - /* - newIt = self.items; - if(!newIt) - newIt = WeaponIdToItemId(other.weapon); - old = other.items; - other.items = other.items | newIt; - */ - if(self.ammo_shells) { if(acount) sprint(other, ", "); acount = 1; s = ftos(self.ammo_shells); - sprint (other, s); - sprint (other, " shells"); + sprint(other, s); + sprint(other, " shells"); } if(self.ammo_nails) @@ -1478,8 +1440,8 @@ void() BackpackTouch = sprint(other, ", "); acount = 1; s = ftos(self.ammo_nails); - sprint (other, s); - sprint (other, " nails"); + sprint(other, s); + sprint(other, " nails"); } if(self.ammo_rockets) @@ -1488,8 +1450,8 @@ void() BackpackTouch = sprint(other, ", "); acount = 1; s = ftos(self.ammo_rockets); - sprint (other, s); - sprint (other, " rockets"); + sprint(other, s); + sprint(other, " rockets"); } if(self.ammo_cells) @@ -1498,29 +1460,50 @@ void() BackpackTouch = sprint(other, ", "); acount = 1; s = ftos(self.ammo_cells); - sprint (other, s); - sprint (other, " cells"); + sprint(other, s); + sprint(other, " cells"); + } + + if(self.ammo_lava_nails) + { + if(acount) + sprint(other, ", "); + acount = 1; + s = ftos(self.ammo_lava_nails); + sprint(other, s); + sprint(other, " lava nails"); + } + + if(self.ammo_multi_rockets) + { + if(acount) + sprint(other, ", "); + acount = 1; + s = ftos(self.ammo_multi_rockets); + sprint(other, s); + sprint(other, " multi rockets"); + } + + if(self.ammo_plasma) + { + if(acount) + sprint(other, ", "); + acount = 1; + s = ftos(self.ammo_plasma); + sprint(other, s); + sprint(other, " plasma balls"); } - sprint (other, "\n"); + sprint(other, "\n"); + // backpack touch sound sound(other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); - stuffcmd (other, "bf\n"); + stuffcmd(other, "bf\n"); // remove the backpack, change self to the player remove(self); self = other; - // change to the weapon - // VR: Do not change weapons. - - /* - if(!deathmatch) - self.weapon = ItemIdToWeaponId(newIt); - else - Deathmatch_Weapon (old, ItemIdToWeaponId(newIt)); - */ - W_SetCurrentAmmo(); }; @@ -1531,41 +1514,15 @@ DropBackpack */ void() DropBackpack = { - local entity item; + entity item; - if(!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells)) + if(!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells + + self.ammo_lava_nails + self.ammo_multi_rockets + self.ammo_plasma)) return; // nothing in it item = spawn(); item.origin = self.origin - '0 0 24'; - item.items = self.weapon; - - if(item.items == IT_AXE) - item.netname = "Axe"; - else if(item.items == IT_SHOTGUN) - item.netname = "Shotgun"; - else if(item.items == IT_SUPER_SHOTGUN) - item.netname = "Double-barrelled Shotgun"; - else if(item.items == IT_NAILGUN) - item.netname = "Nailgun"; - else if(item.items == IT_SUPER_NAILGUN) - item.netname = "Super Nailgun"; - else if(item.items == IT_GRENADE_LAUNCHER) - item.netname = "Grenade Launcher"; - else if(item.items == IT_ROCKET_LAUNCHER) - item.netname = "Rocket Launcher"; - else if(item.items == IT_LIGHTNING) - item.netname = "Thunderbolt"; - else if(item.items == IT_LASER_CANNON) - item.netname = "Laser Cannon"; - else if(item.items == IT_PROXIMITY_GUN) - item.netname = "Proximity Gun"; - else if(item.items == IT_MJOLNIR) - item.netname = "Mjolnir"; - else - item.netname = ""; - item.ammo_shells = self.ammo_shells; item.ammo_nails = self.ammo_nails; item.ammo_rockets = self.ammo_rockets; @@ -1578,8 +1535,8 @@ void() DropBackpack = item.flags = FL_ITEM; item.solid = SOLID_TRIGGER; item.movetype = MOVETYPE_TOSS; - setmodel (item, "progs/backpack.mdl"); - setsize (item, '-8 -8 0', '8 8 24'); + setmodel(item, "progs/backpack.mdl"); + setsize(item, '-8 -8 0', '8 8 24'); item.handtouch = BackpackTouch; // TODO VR: (P2) backpack spins because of MF_ROTATE/EF_ROTATE flag in mdl file diff --git a/QC/knight.qc b/QC/knight.qc deleted file mode 100644 index 45a510ec..00000000 --- a/QC/knight.qc +++ /dev/null @@ -1,378 +0,0 @@ -/* -============================================================================== - -KNIGHT - -============================================================================== -*/ - -$cd id1/models/knight -// TODO VR: (P2) rogue -// $cd /raid/quake/id1/models/knight -$origin 0 0 24 -$base base -$skin badass3 -$skin statue - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 - -$frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8 - -//frame runc1 runc2 runc3 runc4 runc5 runc6 - -$frame runattack1 runattack2 runattack3 runattack4 runattack5 -$frame runattack6 runattack7 runattack8 runattack9 runattack10 -$frame runattack11 - -$frame pain1 pain2 pain3 - -$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 -$frame painb10 painb11 - -//frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 -//frame attack8 attack9 attack10 attack11 - -$frame attackb1 attackb1 attackb2 attackb3 attackb4 attackb5 -$frame attackb6 attackb7 attackb8 attackb9 attackb10 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 -$frame walk10 walk11 walk12 walk13 walk14 - -$frame kneel1 kneel2 kneel3 kneel4 kneel5 - -$frame standing2 standing3 standing4 standing5 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 -$frame death9 death10 - -$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 -$frame deathb9 deathb10 deathb11 - -void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();}; -void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();}; -void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();}; -void() knight_stand4 =[ $stand4, knight_stand5 ] {ai_stand();}; -void() knight_stand5 =[ $stand5, knight_stand6 ] {ai_stand();}; -void() knight_stand6 =[ $stand6, knight_stand7 ] {ai_stand();}; -void() knight_stand7 =[ $stand7, knight_stand8 ] {ai_stand();}; -void() knight_stand8 =[ $stand8, knight_stand9 ] {ai_stand();}; -void() knight_stand9 =[ $stand9, knight_stand1 ] {ai_stand();}; - -void() kn_idle_sound = -{ - if(random() < 0.2) - { - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/idle.wav", 1, ATTN_IDLE); - else - sound(self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); - } -}; - -void() knight_walk1 =[ $walk1, knight_walk2 ] - { kn_idle_sound(); ai_walk(3);}; -void() knight_walk2 =[ $walk2, knight_walk3 ] {ai_walk(2);}; -void() knight_walk3 =[ $walk3, knight_walk4 ] {ai_walk(3);}; -void() knight_walk4 =[ $walk4, knight_walk5 ] {ai_walk(4);}; -void() knight_walk5 =[ $walk5, knight_walk6 ] {ai_walk(3);}; -void() knight_walk6 =[ $walk6, knight_walk7 ] {ai_walk(3);}; -void() knight_walk7 =[ $walk7, knight_walk8 ] {ai_walk(3);}; -void() knight_walk8 =[ $walk8, knight_walk9 ] {ai_walk(4);}; -void() knight_walk9 =[ $walk9, knight_walk10 ] {ai_walk(3);}; -void() knight_walk10 =[ $walk10, knight_walk11 ] {ai_walk(3);}; -void() knight_walk11 =[ $walk11, knight_walk12 ] {ai_walk(2);}; -void() knight_walk12 =[ $walk12, knight_walk13 ] {ai_walk(3);}; -void() knight_walk13 =[ $walk13, knight_walk14 ] {ai_walk(4);}; -void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);}; - - -void() knight_run1 =[ $runb1, knight_run2 ] - { kn_idle_sound(); ai_run(16); }; -void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(20);}; -void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);}; -void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);}; -void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);}; -void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(20);}; -void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);}; -void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);}; - - -void() knight_runatk1 =[ $runattack1, knight_runatk2 ] -{ -if(random() > 0.5) - sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); -else - sound(self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); -ai_charge(20); -}; -void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side();}; -void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side();}; -void() knight_runatk4 =[ $runattack4, knight_runatk5 ] {ai_charge_side();}; -void() knight_runatk5 =[ $runattack5, knight_runatk6 ] {ai_melee_side();}; -void() knight_runatk6 =[ $runattack6, knight_runatk7 ] {ai_melee_side();}; -void() knight_runatk7 =[ $runattack7, knight_runatk8 ] {ai_melee_side();}; -void() knight_runatk8 =[ $runattack8, knight_runatk9 ] {ai_melee_side();}; -void() knight_runatk9 =[ $runattack9, knight_runatk10 ] {ai_melee_side();}; -void() knight_runatk10 =[ $runattack10, knight_runatk11 ] {ai_charge_side();}; -void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10);}; - -void() knight_atk1 =[ $attackb1, knight_atk2 ] -{ -sound(self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); -ai_charge(0);}; -void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);}; -void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4);}; -void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(0);}; -void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(3);}; -void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();}; -void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();}; -void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3); -ai_melee();}; -void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1);}; -void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);}; - -//void() knight_atk9 =[ $attack9, knight_atk10 ] {}; -//void() knight_atk10 =[ $attack10, knight_atk11 ] {}; -//void() knight_atk11 =[ $attack11, knight_run1 ] {}; - -//=========================================================================== - -void() knight_pain1 =[ $pain1, knight_pain2 ] {}; -void() knight_pain2 =[ $pain2, knight_pain3 ] {}; -void() knight_pain3 =[ $pain3, knight_run1 ] {}; - -void() knight_painb1 =[ $painb1, knight_painb2 ] {ai_painforward(0);}; -void() knight_painb2 =[ $painb2, knight_painb3 ] {ai_painforward(3);}; -void() knight_painb3 =[ $painb3, knight_painb4 ] {}; -void() knight_painb4 =[ $painb4, knight_painb5 ] {}; -void() knight_painb5 =[ $painb5, knight_painb6 ] {ai_painforward(2);}; -void() knight_painb6 =[ $painb6, knight_painb7 ] {ai_painforward(4);}; -void() knight_painb7 =[ $painb7, knight_painb8 ] {ai_painforward(2);}; -void() knight_painb8 =[ $painb8, knight_painb9 ] {ai_painforward(5);}; -void() knight_painb9 =[ $painb9, knight_painb10 ] {ai_painforward(5);}; -void() knight_painb10 =[ $painb10, knight_painb11 ] {ai_painforward(0);}; -void() knight_painb11 =[ $painb11, knight_run1 ] {}; - -void(entity attacker, float damage) knight_pain = -{ - local float r; - - if(self.pain_finished > time) - return; - - r = random(); - - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/pain.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "knight/khurt.wav", 1, ATTN_NORM); - - if(r < 0.85) - { - knight_pain1(); - self.pain_finished = time + 1; - } - else - { - knight_painb1(); - self.pain_finished = time + 1; - } - -}; - -//=========================================================================== - -void() knight_bow1 =[ $kneel1, knight_bow2 ] {ai_turn();}; -void() knight_bow2 =[ $kneel2, knight_bow3 ] {ai_turn();}; -void() knight_bow3 =[ $kneel3, knight_bow4 ] {ai_turn();}; -void() knight_bow4 =[ $kneel4, knight_bow5 ] {ai_turn();}; - -void() knight_bow5 =[ $kneel5, knight_bow5 ] {ai_turn();}; - -void() knight_bow6 =[ $kneel4, knight_bow7 ] {ai_turn();}; -void() knight_bow7 =[ $kneel3, knight_bow8 ] {ai_turn();}; -void() knight_bow8 =[ $kneel2, knight_bow9 ] {ai_turn();}; -void() knight_bow9 =[ $kneel1, knight_bow10 ] {ai_turn();}; -void() knight_bow10 =[ $walk1, knight_walk1 ] {ai_turn();}; - - - -void() knight_die1 =[ $death1, knight_die2 ] {}; -void() knight_die2 =[ $death2, knight_die3 ] {}; -void() knight_die3 =[ $death3, knight_die4 ] -{self.solid = SOLID_NOT;}; -void() knight_die4 =[ $death4, knight_die5 ] {}; -void() knight_die5 =[ $death5, knight_die6 ] {}; -void() knight_die6 =[ $death6, knight_die7 ] {}; -void() knight_die7 =[ $death7, knight_die8 ] {}; -void() knight_die8 =[ $death8, knight_die9 ] {}; -void() knight_die9 =[ $death9, knight_die10] {}; -void() knight_die10=[ $death10, knight_die10] {}; - - -void() knight_dieb1 =[ $deathb1, knight_dieb2 ] {}; -void() knight_dieb2 =[ $deathb2, knight_dieb3 ] {}; -void() knight_dieb3 =[ $deathb3, knight_dieb4 ] -{self.solid = SOLID_NOT;}; -void() knight_dieb4 =[ $deathb4, knight_dieb5 ] {}; -void() knight_dieb5 =[ $deathb5, knight_dieb6 ] {}; -void() knight_dieb6 =[ $deathb6, knight_dieb7 ] {}; -void() knight_dieb7 =[ $deathb7, knight_dieb8 ] {}; -void() knight_dieb8 =[ $deathb8, knight_dieb9 ] {}; -void() knight_dieb9 =[ $deathb9, knight_dieb10] {}; -void() knight_dieb10 = [ $deathb10, knight_dieb11] {}; -void() knight_dieb11 = [ $deathb11, knight_dieb11] {}; - - -void() knight_die = -{ -// check for gib - if(self.health < -40) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_knight.mdl", self.health); - - if(self.spawnflags & 2) // statue - { - ThrowGib ( "progs/statgib1.mdl", self.health); - ThrowGib ( "progs/statgib2.mdl", self.health); - ThrowGib ( "progs/statgib3.mdl", self.health); - } - else - { - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - } - return; - } - -// regular death - if(self.spawnflags & 2) // statue - sound(self, CHAN_VOICE, "statue/death.wav", 1, ATTN_NORM); - else - sound(self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); - - if(random() < 0.5) - knight_die1(); - else - knight_dieb1(); -}; - -void() knight_pause = -{ - sound( self, CHAN_VOICE, "statue/see.wav", 1, ATTN_NORM); - - self.takedamage = DAMAGE_AIM; - self.th_stand = knight_stand1; - self.th_walk = knight_walk1; - self.th_run = knight_run1; - self.th_melee = knight_atk1; - self.th_pain = knight_pain; - self.th_die = knight_die; - self.use = SUB_Null; - - self.think = knight_run1; - - self.enemy = activator; - self.nextthink = time + 0.1; - self.think = FoundTarget; - - self.delay = 0; -}; - -void() knight_pause1 = -{ - self.takedamage = DAMAGE_NO; - self.use = knight_pause; - self.think = knight_pause1; - self.nextthink = time + 0.1; -}; - -/*QUAKED monster_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush Statue - -Statue - select this to use the stone skin and have him frozen in place. - -delay: time from sight to attack (default 5) -frame: frame to be frozen in. (default 44) -*/ -void() monster_knight = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/knight.mdl"); - precache_model ("progs/h_knight.mdl"); - - if(self.spawnflags & 2) // statue - { - precache_model ( "progs/statgib1.mdl"); - precache_model ( "progs/statgib2.mdl"); - precache_model ( "progs/statgib3.mdl"); - precache_sound( "statue/see.wav"); - precache_sound( "statue/idle.wav"); - precache_sound( "statue/pain.wav"); - precache_sound( "statue/death.wav"); - } - else - { - precache_sound("knight/kdeath.wav"); - precache_sound("knight/khurt.wav"); - precache_sound("knight/ksight.wav"); - precache_sound("knight/idle.wav"); - } - - precache_sound("knight/sword1.wav"); - precache_sound("knight/sword2.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/knight.mdl"); - - setsize (self, '-12 -12 -24', '12 12 26'); - self.health = 75; - - if(self.spawnflags & 2) // statue - { - if(self.frame == 0) - self.frame = 44; - self.skin = 1; - - if(!self.targetname) - { - dprint ("statue not targeted\n"); - dprint (self.classname); - dprint (" at "); - dprint (vtos(self.origin)); - dprint ("\n"); - return; - } - - self.use = knight_pause; - self.th_stand = knight_pause1; - self.th_walk = knight_pause1; - self.th_run = knight_pause1; -/* - self.th_stand = knight_pause1; - self.th_walk = knight_pause; - self.th_run = knight_pause; - self.th_melee = knight_atk1; - self.th_pain = knight_pause; - self.th_die = knight_die; -*/ - walkmonster_start(); - } - else - { - self.th_stand = knight_stand1; - self.th_walk = knight_walk1; - self.th_run = knight_run1; - self.th_melee = knight_atk1; - self.th_pain = knight_pain; - self.th_die = knight_die; - walkmonster_start(); - } -}; diff --git a/QC/misc.qc b/QC/misc.qc index 174a6e13..99d4dc67 100644 --- a/QC/misc.qc +++ b/QC/misc.qc @@ -17,22 +17,36 @@ void() info_notnull = //============================================================================ float START_OFF = 1; +float SWITCH_TO_FLICKER = 2; // HONEY +float SWITCH_TO_FADE = 4; // HONEY void() light_use = { if(self.spawnflags & START_OFF) { - lightstyle(self.style, "m"); + if(self.spawnflags & SWITCH_TO_FADE){ // HONEY + self.think = light_fade_in; + light_fade_in(); + }else{ + lightstyle(self.style, "m"); + } self.spawnflags = self.spawnflags - START_OFF; } else { - lightstyle(self.style, "a"); + if(self.spawnflags & SWITCH_TO_FLICKER) // HONEY + lightstyle(self.style, "cbaabktsdtbccbrtbklcdfbabcbacacbclkkquakeacbcbcbbklklc"); + else if(self.spawnflags & SWITCH_TO_FADE){ + self.think = light_fade_out; + light_fade_out(); + }else{ + lightstyle(self.style, "a"); + } self.spawnflags = self.spawnflags + START_OFF; } }; -/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF +/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF SWITCH_TO_FLICKER SWITCH_TO_FADE Non-displayed light. Default light value is 300 Default style is 0 @@ -40,19 +54,40 @@ If targeted, it will toggle between on or off. */ void() light = { + entity e; + if(!self.targetname) { // inert light remove(self); return; } + // HONEY + if(!self.waitmin) { self.waitmin = 0.1; } + if(self.style >= 32) { + // HONEY + //make sure there only is ONE light per light style, dunno why :| + e = find(world, targetname, self.targetname); + while(e.classname != "light"){ + e = find(e, targetname, self.targetname); + } + + // HONEY + if(e.style == self.style && e != self) { + remove(self); + return; + } + self.use = light_use; - if(self.spawnflags & START_OFF) + if(self.spawnflags & START_OFF){ lightstyle(self.style, "a"); - else + + }else{ lightstyle(self.style, "m"); + self.cnt = 11; //for fading + } } }; @@ -100,9 +135,9 @@ Default style is 0 */ void() light_globe = { - precache_model ("progs/s_light.spr"); - setmodel (self, "progs/s_light.spr"); - makestatic (self); + precache_model("progs/s_light.spr"); + setmodel(self, "progs/s_light.spr"); + makestatic(self); }; void() FireAmbient = @@ -112,17 +147,20 @@ void() FireAmbient = ambientsound(self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC); }; -/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) +/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) Quiet Short wall torch -Default light value is 200 +Default light value is 300 Default style is 0 */ void() light_torch_small_walltorch = { - precache_model ("progs/flame.mdl"); - setmodel (self, "progs/flame.mdl"); - FireAmbient(); - makestatic (self); + precache_model("progs/flame.mdl"); + setmodel(self, "progs/flame.mdl"); + + if(!(self.spawnflags & 1)) + FireAmbient(); + + makestatic(self); }; /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18) @@ -130,11 +168,11 @@ Large yellow flame ball */ void() light_flame_large_yellow = { - precache_model ("progs/flame2.mdl"); - setmodel (self, "progs/flame2.mdl"); + precache_model("progs/flame2.mdl"); + setmodel(self, "progs/flame2.mdl"); self.frame = 1; FireAmbient(); - makestatic (self); + makestatic(self); }; /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF @@ -142,10 +180,10 @@ Small yellow flame ball */ void() light_flame_small_yellow = { - precache_model ("progs/flame2.mdl"); - setmodel (self, "progs/flame2.mdl"); + precache_model("progs/flame2.mdl"); + setmodel(self, "progs/flame2.mdl"); FireAmbient(); - makestatic (self); + makestatic(self); }; /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF @@ -153,10 +191,10 @@ Small white flame ball */ void() light_flame_small_white = { - precache_model ("progs/flame2.mdl"); - setmodel (self, "progs/flame2.mdl"); + precache_model("progs/flame2.mdl"); + setmodel(self, "progs/flame2.mdl"); FireAmbient(); - makestatic (self); + makestatic(self); }; //============================================================================ @@ -171,7 +209,7 @@ void() fire_touch; void() misc_fireball = { - precache_model ("progs/lavaball.mdl"); + precache_model("progs/lavaball.mdl"); self.classname = "fireball"; self.nextthink = time + (random() * 5); self.think = fire_fly; @@ -181,7 +219,7 @@ void() misc_fireball = void() fire_fly = { -local entity fireball; +entity fireball; fireball = spawn(); fireball.solid = SOLID_TRIGGER; @@ -191,9 +229,9 @@ local entity fireball; fireball.velocity_y = (random() * 100) - 50; fireball.velocity_z = self.speed + (random() * 200); fireball.classname = "fireball"; - setmodel (fireball, "progs/lavaball.mdl"); - setsize (fireball, '0 0 0', '0 0 0'); - setorigin (fireball, self.origin); + setmodel(fireball, "progs/lavaball.mdl"); + setsize(fireball, '0 0 0', '0 0 0'); + setorigin(fireball, self.origin); fireball.nextthink = time + 5; fireball.think = SUB_Remove; fireball.touch = fire_touch; @@ -205,7 +243,7 @@ local entity fireball; void() fire_touch = { - T_Damage (other, self, self, 20); + T_Damage(other, self, self, 20); remove(self); }; @@ -217,9 +255,9 @@ void() barrel_explode = self.takedamage = DAMAGE_NO; self.classname = "explo_box"; // did say self.owner - T_RadiusDamage (self, self, 160, world); + T_RadiusDamage(self, self, 160, world); sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); - particle2(self.origin, '0 0 0', 2 /* explosion preset */, 1); + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_EXPLOSION, 1); self.origin_z = self.origin_z + 32; BecomeExplosion(); @@ -233,12 +271,12 @@ TESTING THING void() misc_explobox = { - local float oldz; + float oldz; self.solid = SOLID_BBOX; self.movetype = MOVETYPE_NONE; - precache_model ("maps/b_explob.bsp"); - setmodel (self, "maps/b_explob.bsp"); + precache_model("maps/b_explob.bsp"); + setmodel(self, "maps/b_explob.bsp"); precache_sound("weapons/r_exp3.wav"); self.health = 20; self.th_die = barrel_explode; @@ -249,9 +287,9 @@ void() misc_explobox = droptofloor(); if(oldz - self.origin_z > 250) { - dprint ("item fell out of level at "); - dprint (vtos(self.origin)); - dprint ("\n"); + dprint("explobox fell out of level at "); + dprint(vtos(self.origin)); + dprint("\n"); remove(self); } }; @@ -265,12 +303,12 @@ Smaller exploding box, REGISTERED ONLY void() misc_explobox2 = { - local float oldz; + float oldz; self.solid = SOLID_BBOX; self.movetype = MOVETYPE_NONE; - precache_model2 ("maps/b_exbox2.bsp"); - setmodel (self, "maps/b_exbox2.bsp"); + precache_model2("maps/b_exbox2.bsp"); + setmodel(self, "maps/b_exbox2.bsp"); precache_sound("weapons/r_exp3.wav"); self.health = 20; self.th_die = barrel_explode; @@ -281,32 +319,47 @@ void() misc_explobox2 = droptofloor(); if(oldz - self.origin_z > 250) { - dprint ("item fell out of level at "); - dprint (vtos(self.origin)); - dprint ("\n"); + dprint("explobox fell out of level at "); + dprint(vtos(self.origin)); + dprint("\n"); remove(self); } }; //============================================================================ - -void(vector org, vector vec) LaunchLaser; - //MED 11/09/96 added lava ball and rocket void() spikeshooter_use = { - local entity lavaball; - if(self.spawnflags & SPAWNFLAG_LASER) + entity newmis; + entity lavaball; + + if(mapname == "e2m3" || // VR: There is a bug in e2m3 where spikeshoorters + // have spawn flags '256', which is invalid in Q1 + // but valid (fireball) in DoE. + (self.spawnflags & SPAWNFLAG_SUPERSPIKE) || + !(self.spawnflags)) + { + sound(self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM); + newmis = launch_spike (self.origin, self.movedir); + newmis.velocity = self.movedir * 500; + if(self.spawnflags & SPAWNFLAG_SUPERSPIKE) + newmis.touch = superspike_touch; + } + else if(self.spawnflags & SPAWNFLAG_LASER) { - if(!self.spawnflags & SPAWNFLAG_SILENT) + if(!(self.spawnflags & SPAWNFLAG_SILENT)) sound(self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM); - LaunchLaser (self.origin, self.movedir); + newmis = LaunchLaser (self.origin, self.movedir); newmis.spawnflags = self.spawnflags; } + else if(self.spawnflags & SPAWNFLAG_FIREBALL) + { + newmis = launch_fireball (self.origin, self.movedir); + } else if(self.spawnflags & SPAWNFLAG_LAVABALL) { - if(!self.spawnflags & SPAWNFLAG_SILENT) + if(!(self.spawnflags & SPAWNFLAG_SILENT)) sound(self, CHAN_VOICE, "misc/spike.wav", 1, ATTN_NORM); lavaball = spawn(); lavaball.movetype = MOVETYPE_FLYMISSILE; @@ -317,27 +370,37 @@ void() spikeshooter_use = lavaball.angles = vectoangles(lavaball.velocity); lavaball.owner = self; lavaball.touch = T_MissileTouch; - setmodel (lavaball, "progs/lavarock.mdl"); - setsize (lavaball, '-4 -4 -4', '4 4 4'); - setorigin (lavaball, self.origin); + setmodel(lavaball, "progs/lavarock.mdl"); + setsize(lavaball, '-4 -4 -4', '4 4 4'); + setorigin(lavaball, self.origin); lavaball.avelocity = '0 0 400'; lavaball.nextthink = time + 5; lavaball.think = SUB_Remove; } else if(self.spawnflags & SPAWNFLAG_ROCKET) { - if(!self.spawnflags & SPAWNFLAG_SILENT) + if(!(self.spawnflags & SPAWNFLAG_SILENT)) sound(self, CHAN_VOICE, "weapons/sgun1.wav", 1, ATTN_NORM); - W_FireRocket(cVR_MainHand); // TODO VR: (P2) this will spawn particles at the gun position + newmis = W_FireRocket(cVR_MainHand); // TODO VR: (P2) this will spawn particles at the gun position newmis.velocity = self.movedir*1000; newmis.angles = vectoangles(newmis.velocity); - setorigin (newmis, self.origin + self.movedir*8); + setorigin(newmis, self.origin + self.movedir*8); + } + else if(self.spawnflags & (SPAWNFLAG_SUPERLAVA | SPAWNFLAG_LAVASKILL | SPAWNFLAG_LAVASPIKE)) + { + sound(self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM); + newmis = launch_lava_spike (self.origin, self.movedir); + newmis.velocity = self.movedir * 500; + if(self.spawnflags & SPAWNFLAG_SUPERLAVA) + newmis.touch = superlavaspike_touch; + else if((self.spawnflags & SPAWNFLAG_LAVASKILL) && (skill > 1)) + newmis.touch = superlavaspike_touch; } else { - if(!self.spawnflags & SPAWNFLAG_SILENT) + if(!(self.spawnflags & SPAWNFLAG_SILENT)) sound(self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM); - launch_spike (self.origin, self.movedir); + newmis = launch_spike (self.origin, self.movedir); newmis.velocity = self.movedir * 500; if(self.spawnflags & SPAWNFLAG_SUPERSPIKE) newmis.touch = superspike_touch; @@ -352,13 +415,13 @@ void() shooter_think = spikeshooter_use(); } self.nextthink = time + self.wait; - newmis.velocity = self.movedir * 500; + // newmis.velocity = self.movedir * 500; }; -/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent +/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lava superlava skilllava fireball When triggered, fires a spike in the direction set in QuakeEd. -Laser is only for REGISTERED. +Laser, Lava and SuperLava are only for REGISTERED. */ //MED 11/01/96 commented out setmovedir @@ -366,26 +429,51 @@ void() trap_spikeshooter = { SetMovedir(); self.use = spikeshooter_use; + if(self.spawnflags & SPAWNFLAG_LASER) { - precache_model2 ("progs/laser.mdl"); - - precache_sound2 ("enforcer/enfire.wav"); - precache_sound2 ("enforcer/enfstop.wav"); + precache_model2("progs/laser.mdl"); + precache_sound2("enforcer/enfire.wav"); + precache_sound2("enforcer/enfstop.wav"); + } + else if(self.spawnflags & SPAWNFLAG_LAVASPIKE) + { + precache_model2("progs/lspike.mdl"); + precache_sound2("lavagun/snail.wav"); // lava nail gun cooldown + precache_sound2("weapons/rocket1i.wav"); + } + else if(self.spawnflags & SPAWNFLAG_SUPERLAVA) + { + precache_model2("progs/lspike.mdl"); + precache_sound2("lavagun/snail.wav"); // lava nail gun cooldown + precache_sound2("weapons/spike2.wav"); + } + else if(self.spawnflags & SPAWNFLAG_LAVASKILL) + { + precache_model2("progs/lspike.mdl"); + precache_sound2("lavagun/snail.wav"); // lava nail gun cooldown + precache_sound2("weapons/rocket1i.wav"); + precache_sound2("weapons/spike2.wav"); + } + else if(self.spawnflags & SPAWNFLAG_FIREBALL) + { + precache_model("progs/fireball.mdl"); } else if(self.spawnflags & SPAWNFLAG_LAVABALL) { - precache_model ("progs/lavarock.mdl"); - precache_sound2 ("misc/spike.wav"); + precache_model("progs/lavarock.mdl"); + precache_sound2("misc/spike.wav"); } else if(self.spawnflags & SPAWNFLAG_ROCKET) { - precache_model ("progs/missile.mdl"); + precache_model("progs/missile.mdl"); precache_sound("weapons/sgun1.wav"); } else + { precache_sound("weapons/spike2.wav"); -}; + } +} /*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent @@ -439,76 +527,112 @@ void() trap_switched_shooter = */ -void() make_bubbles; -void() bubble_remove; -void() bubble_bob; - /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) testing air bubbles */ void() air_bubbles = - { if(deathmatch) { remove (self); return; } - precache_model ("progs/s_bubble.spr"); - self.nextthink = time + 1; + + precache_model("progs/s_bubble.spr"); + + // HONEY + if(!self.speed) self.speed = 15; + if(!self.count) self.count = 20; + self.count = ceil(self.count); + if(!self.waitmin) self.waitmin = 1; + + // HONEY + //cg: changed to make the bubbles toggleable + self.use = air_bubbles_use; + self.think = make_bubbles; + + // HONEY + self.state = self.state & 1; + if(self.targetname == "" || self.state){ + self.nextthink = time + 1; + self.state = 1; + } }; void() make_bubbles = { -local entity bubble; + entity bubble; bubble = spawn(); - setmodel (bubble, "progs/s_bubble.spr"); - setorigin (bubble, self.origin); + + // HONEY + bubble.owner = self; + + setmodel(bubble, "progs/s_bubble.spr"); + setorigin(bubble, self.origin); bubble.movetype = MOVETYPE_NOCLIP; bubble.solid = SOLID_NOT; - bubble.velocity = '0 0 15'; - bubble.nextthink = time + 0.5; + + // HONEY + bubble.velocity = '0 0 0'; + bubble.velocity_z = self.speed; + bubble.nextthink = time + 0.5 * random(); + bubble.think = bubble_bob; bubble.touch = bubble_remove; bubble.classname = "bubble"; bubble.frame = 0; bubble.cnt = 0; - setsize (bubble, '-8 -8 -8', '8 8 8'); - self.nextthink = time + random() + 0.5; + setsize(bubble, '-8 -8 -8', '8 8 8'); + + // HONEY + self.nextthink = time + self.owner.waitmin + random(); + self.think = make_bubbles; }; void() bubble_split = { -local entity bubble; + entity bubble; + bubble = spawn(); - setmodel (bubble, "progs/s_bubble.spr"); - setorigin (bubble, self.origin); + + // HONEY + bubble.owner = self.owner; + + setmodel(bubble, "progs/s_bubble.spr"); + setorigin(bubble, self.origin); bubble.movetype = MOVETYPE_NOCLIP; bubble.solid = SOLID_NOT; + + // HONEY bubble.velocity = self.velocity; - bubble.nextthink = time + 0.5; + bubble.velocity_z = bubble.velocity_z * 0.9; + bubble.alpha = self.alpha; + bubble.nextthink = time + 0.5 * random(); + bubble.think = bubble_bob; bubble.touch = bubble_remove; bubble.classname = "bubble"; bubble.frame = 1; - bubble.cnt = 10; - setsize (bubble, '-8 -8 -8', '8 8 8'); self.frame = 1; - self.cnt = 10; - if(self.waterlevel != 3) - remove (self); + + // HONEY + self.cnt = bubble.cnt = self.owner.count * 0.5; + setsize(bubble, '-8 -8 -8', '8 8 8'); + + // HONEY + bubble_bob(); }; void() bubble_remove = { if(other.classname == self.classname) { -// dprint ("bump"); +// dprint("bump"); return; } remove(self); @@ -516,8 +640,10 @@ void() bubble_remove = void() bubble_bob = { - local float rnd1, rnd2, rnd3; + float rnd1, rnd2, rnd3; + float maxz, minz; + // ROGUE // PGM fix - 02/25/97 so bubbles won't go through walls rnd1 = pointcontents(self.origin); if(rnd1 == CONTENT_SOLID) @@ -530,10 +656,11 @@ void() bubble_bob = } self.cnt = self.cnt + 1; - if(self.cnt == 4) + if(self.cnt == ceil(self.count * 0.2)) // HONEY bubble_split(); - if(self.cnt == 20) + if(self.cnt >= self.owner.count) { // HONEY remove(self); + } rnd1 = self.velocity_x + (-10 + (random() * 20)); rnd2 = self.velocity_y + (-10 + (random() * 20)); @@ -549,16 +676,28 @@ void() bubble_bob = if(rnd2 < -10) rnd2 = -5; - if(rnd3 < 10) - rnd3 = 15; - if(rnd3 > 30) - rnd3 = 25; + // HONEY + if(self.owner.speed){ + maxz = self.owner.speed + 15; + minz = self.owner.speed - 5; + }else{ + maxz = 30; + minz = 10; + } + + // HONEY + if(rnd3 < minz) + rnd3 = minz + 5; + if(rnd3 > maxz) + rnd3 = maxz - 5; self.velocity_x = rnd1; self.velocity_y = rnd2; self.velocity_z = rnd3; - self.nextthink = time + 0.5; + // HONEY + self.nextthink = time + 0.5 * random(); + self.think = bubble_bob; }; @@ -575,8 +714,8 @@ void() viewthing = { self.movetype = MOVETYPE_NONE; self.solid = SOLID_NOT; - precache_model ("progs/player.mdl"); - setmodel (self, "progs/player.mdl"); + precache_model("progs/player.mdl"); + setmodel(self, "progs/player.mdl"); }; @@ -602,7 +741,7 @@ void() func_wall = self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything self.solid = SOLID_BSP; self.use = func_wall_use; - setmodel (self, self.model); + setmodel(self, self.model); }; @@ -615,8 +754,8 @@ void() func_illusionary = self.angles = '0 0 0'; self.movetype = MOVETYPE_NONE; self.solid = SOLID_NOT; - setmodel (self, self.model); - makestatic (self); + setmodel(self, self.model); + makestatic(self); }; /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 @@ -632,7 +771,7 @@ void() func_episodegate = self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything self.solid = SOLID_BSP; self.use = func_wall_use; - setmodel (self, self.model); + setmodel(self, self.model); }; /*QUAKED func_bossgate (0 .5 .8) ? @@ -641,13 +780,13 @@ This bmodel appears unless players have all of the episode sigils. void() func_bossgate = { - if( (serverflags & 15) == 15) + if((serverflags & 15) == 15) return; // all episodes completed self.angles = '0 0 0'; self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything self.solid = SOLID_BSP; self.use = func_wall_use; - setmodel (self, self.model); + setmodel(self, self.model); }; //============================================================================ @@ -656,7 +795,8 @@ void() func_bossgate = void() ambient_suck_wind = { precache_sound("ambience/suck1.wav"); - ambientsound(self.origin, "ambience/suck1.wav", 1, ATTN_STATIC); + ambientsound(self.origin, "ambience/suck1.wav", 1, ATTN_IDLE); + SUB_Remove(); }; /*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) @@ -665,6 +805,7 @@ void() ambient_drone = { precache_sound("ambience/drone6.wav"); ambientsound(self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) @@ -673,6 +814,7 @@ void() ambient_flouro_buzz = { precache_sound("ambience/buzz1.wav"); ambientsound(self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ @@ -680,6 +822,7 @@ void() ambient_drip = { precache_sound("ambience/drip1.wav"); ambientsound(self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ @@ -687,6 +830,7 @@ void() ambient_comp_hum = { precache_sound("ambience/comp1.wav"); ambientsound(self.origin, "ambience/comp1.wav", 1, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ @@ -694,6 +838,7 @@ void() ambient_thunder = { precache_sound("ambience/thunder1.wav"); ambientsound(self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ @@ -701,6 +846,7 @@ void() ambient_light_buzz = { precache_sound("ambience/fl_hum1.wav"); ambientsound(self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ @@ -708,6 +854,7 @@ void() ambient_swamp1 = { precache_sound("ambience/swamp1.wav"); ambientsound(self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC); + SUB_Remove(); }; /*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ @@ -715,8 +862,11 @@ void() ambient_swamp2 = { precache_sound("ambience/swamp2.wav"); ambientsound(self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC); + SUB_Remove(); }; + + //============================================================================ void() noise_think = @@ -739,16 +889,16 @@ For optimzation testing, starts a lot of sounds. void() misc_noisemaker = { - precache_sound2 ("enforcer/enfire.wav"); - precache_sound2 ("enforcer/enfstop.wav"); - precache_sound2 ("enforcer/sight1.wav"); - precache_sound2 ("enforcer/sight2.wav"); - precache_sound2 ("enforcer/sight3.wav"); - precache_sound2 ("enforcer/sight4.wav"); - precache_sound2 ("enforcer/pain1.wav"); - precache_sound2 ("enforcer/pain2.wav"); - precache_sound2 ("enforcer/death1.wav"); - precache_sound2 ("enforcer/idle1.wav"); + precache_sound2("enforcer/enfire.wav"); + precache_sound2("enforcer/enfstop.wav"); + precache_sound2("enforcer/sight1.wav"); + precache_sound2("enforcer/sight2.wav"); + precache_sound2("enforcer/sight3.wav"); + precache_sound2("enforcer/sight4.wav"); + precache_sound2("enforcer/pain1.wav"); + precache_sound2("enforcer/pain2.wav"); + precache_sound2("enforcer/death1.wav"); + precache_sound2("enforcer/idle1.wav"); self.nextthink = time + 0.1 + random(); self.think = noise_think; diff --git a/QC/monsters.qc b/QC/monsters.qc index 6ca0dc3b..f0a4bca7 100644 --- a/QC/monsters.qc +++ b/QC/monsters.qc @@ -22,12 +22,16 @@ void() monster_use = { if(self.enemy) return; + if(self.health <= 0) return; - if(activator.items & IT_INVISIBILITY) + + if(VR_ItemUtil_EntHasItem(activator, IID_INVISIBILITY)) return; + if(activator.flags & FL_NOTARGET) return; + if(activator.classname != "player") return; @@ -42,7 +46,7 @@ void() monster_use = ================ monster_death_use -When a mosnter dies, it fires all of its targets with the current +When a monster dies, it fires all of its targets with the current enemy as activator. ================ */ @@ -54,7 +58,7 @@ void() monster_death_use = if(self.flags & FL_SWIM) self.flags = self.flags - FL_SWIM; - if(!self.target) + if(!self.target && /* HONEY */ !self.killtarget) return; activator = self.enemy; @@ -67,16 +71,18 @@ void() monster_death_use = void() walkmonster_start_go = { self.origin_z = self.origin_z + 1; // raise off floor a bit - droptofloor(); - if(!walkmove(0,0)) + // HONEY + if(self.classname == "monster_tarbaby" && + self.spawnflags & SPAWNFLAG_TBABY_HIPHOP) { - dprint ("walkmonster in wall!\n"); - dprint (self.classname); - dprint (" at "); - dprint (vtos(self.origin)); - dprint ("\n"); + // Don't do anything.. } + else + { + droptofloor(); + } + self.takedamage = DAMAGE_AIM; @@ -88,15 +94,15 @@ void() walkmonster_start_go = self.flags = self.flags | FL_MONSTER; - if(self.target) + if(self.target != NULLSTR) { self.goalentity = self.movetarget = find(world, targetname, self.target); self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); if(!self.movetarget) { - dprint ("Monster can't find target at "); - dprint (vtos(self.origin)); - dprint ("\n"); + dprint("Monster can't find target at "); + dprint(vtos(self.origin)); + dprint("\n"); } // this used to be an objerror if(self.movetarget.classname == "path_corner") @@ -111,6 +117,19 @@ void() walkmonster_start_go = self.th_stand(); } + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_ANGRY){ + if(activator.items & IT_INVISIBILITY) + return; + if(activator.flags & FL_NOTARGET) + return; + self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + }else{ + self.enemy = world; + } + // spread think times so they don't all happen at same time self.nextthink = self.nextthink + random()*0.5; }; @@ -123,7 +142,16 @@ void() walkmonster_start = self.nextthink = self.nextthink + random()*0.5; self.flags = self.flags | FL_MONSTER; self.think = walkmonster_start_go; - total_monsters = total_monsters + 1; + + // total_monsters = total_monsters + 1; + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN && !intermission_running) + { + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong(MSG_ALL, total_monsters); + } }; @@ -143,21 +171,21 @@ void() flymonster_start_go = if(!walkmove(0,0)) { - dprint ("flymonster in wall!\n"); - dprint (self.classname); - dprint (" at "); - dprint (vtos(self.origin)); - dprint ("\n"); + dprint("flymonster in wall!\n"); + dprint(self.classname); + dprint(" at "); + dprint(vtos(self.origin)); + dprint("\n"); } - if(self.target) + if(self.target != NULLSTR) { self.goalentity = self.movetarget = find(world, targetname, self.target); if(!self.movetarget) { - dprint ("Monster can't find target at "); - dprint (vtos(self.origin)); - dprint ("\n"); + dprint("Monster can't find target at "); + dprint(vtos(self.origin)); + dprint("\n"); } // this used to be an objerror if(self.movetarget.classname == "path_corner") @@ -171,15 +199,40 @@ void() flymonster_start_go = self.pausetime = 99999999; self.th_stand(); } + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_ANGRY){ + if(activator.items & IT_INVISIBILITY) + return; + if(activator.flags & FL_NOTARGET) + return; + + //self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + }else{ + self.enemy = world; + } }; void() flymonster_start = { + self.enemy = activator; + // spread think times so they don't all happen at same time self.nextthink = self.nextthink + random()*0.5; self.flags = self.flags | FL_MONSTER; self.think = flymonster_start_go; - total_monsters = total_monsters + 1; + + // total_monsters = total_monsters + 1; + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN && !intermission_running) + { + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } }; @@ -202,14 +255,14 @@ void() swimmonster_start_go = self.flags = self.flags | FL_SWIM; self.flags = self.flags | FL_MONSTER; - if(self.target) + if(self.target != NULLSTR) { self.goalentity = self.movetarget = find(world, targetname, self.target); if(!self.movetarget) { - dprint ("Monster can't find target at "); - dprint (vtos(self.origin)); - dprint ("\n"); + dprint("Monster can't find target at "); + dprint(vtos(self.origin)); + dprint("\n"); } // this used to be an objerror self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); @@ -221,15 +274,39 @@ void() swimmonster_start_go = self.th_stand(); } -// spread think times so they don't all happen at same time + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_ANGRY){ + if(activator.items & IT_INVISIBILITY) + return; + if(activator.flags & FL_NOTARGET) + return; + + //self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + }else{ + self.enemy = world; + } + + // spread think times so they don't all happen at same time self.nextthink = self.nextthink + random()*0.5; }; void() swimmonster_start = { -// spread think times so they don't all happen at same time + self.enemy = activator; + + // spread think times so they don't all happen at same time self.flags = self.flags | FL_MONSTER; self.nextthink = self.nextthink + random()*0.5; self.think = swimmonster_start_go; - total_monsters = total_monsters + 1; + + // total_monsters = total_monsters + 1; + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN && !intermission_running) + { + WriteByte(MSG_ALL, SVC_UPDATESTAT); + WriteByte(MSG_ALL, 12); + WriteLong (MSG_ALL, total_monsters); + } }; diff --git a/QC/mult_wpn.qc b/QC/mult_wpn.qc deleted file mode 100644 index 5d189eaa..00000000 --- a/QC/mult_wpn.qc +++ /dev/null @@ -1,571 +0,0 @@ -// multi_weapons.qc -// pmack -// sept 96 - -//============================================================================= -// Multi Grenade Code -//============================================================================= -void() MultiGrenadeTouch; - -//================================ -//================================ -void() MiniGrenadeExplode = -{ - if( self.owner.classname == "player") - T_RadiusDamage (self, self.owner, 90, world); - else - T_RadiusDamage (self, self.owner, 60, world); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_EXPLOSION2); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - WriteByte(MSG_BROADCAST, 230); - WriteByte(MSG_BROADCAST, 5); - - BecomeExplosion(); -}; - -//================================ -//================================ -void(float offsetAngle) MiniGrenadeLaunch = -{ - local entity missile; - local float tempRand; - - missile = spawn(); - missile.owner = self.owner; - missile.movetype = MOVETYPE_BOUNCE; - missile.solid = SOLID_BBOX; - missile.classname = "MiniGrenade"; - -// set missile speed - missile.v_angle = self.v_angle; - missile.v_angle_y = missile.v_angle_y + offsetAngle; - makevectors (missile.v_angle); - - missile.velocity = v_forward*100 + v_up*400; - tempRand = (crandom()*60) - 30; - missile.velocity = missile.velocity + tempRand * v_forward; - tempRand = (crandom()*40) - 20; - missile.velocity = missile.velocity + tempRand * v_right; - tempRand = (crandom()*60) - 30; - missile.velocity = missile.velocity + tempRand * v_up; - - missile.avelocity = '300 300 300'; - missile.angles = vectoangles(missile.velocity); - missile.touch = MultiGrenadeTouch; - - setmodel (missile, "progs/mervup.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin); - -// set missile duration - missile.nextthink = time + 1 + (crandom() * 0.5); - missile.think = MiniGrenadeExplode; -}; - -//================================ -//================================ -void() MultiGrenadeExplode = -{ - MiniGrenadeLaunch(0); - MiniGrenadeLaunch(72); - MiniGrenadeLaunch(144); - MiniGrenadeLaunch(216); - MiniGrenadeLaunch(288); - - remove (self); -}; - -//================================ -//================================ -void() MultiGrenadeTouch = -{ - if(other == self.owner) - return; // don't explode on owner - if(other.takedamage == DAMAGE_AIM) - { - if(self.classname == "MiniGrenade") - MiniGrenadeExplode(); - else - { - if(self.owner.classname == "player") - GrenadeExplode(); - else - MiniGrenadeExplode(); - } - return; - } - // bounce sound - sound(self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); - if(self.velocity == '0 0 0') - self.avelocity = '0 0 0'; -}; - -//================================ -//================================ -void() W_FireMultiGrenade = -{ - local entity missile; - - // TODO VR: (P2) rogue - // self.currentammo = self.ammo_multi_rockets = self.ammo_multi_rockets - 1; - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; - - // TODO VR: (P2) rogue - // UpdateAmmoCounts (self); - - sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_BOUNCE; - missile.solid = SOLID_BBOX; - missile.classname = "MultiGrenade"; - -// set missile speed - makevectors (self.v_angle); - if(self.v_angle_x) - missile.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; - else - { - missile.velocity = aim(self, 10000); - missile.velocity = missile.velocity * 600; - missile.velocity_z = 200; - } - - missile.avelocity = '300 300 300'; - missile.angles = vectoangles(missile.velocity); - missile.touch = MultiGrenadeTouch; - -// set missile duration - missile.nextthink = time + 1; - missile.think = MultiGrenadeExplode; - - setmodel (missile, "progs/mervup.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin); -}; - -//============================================================================= -// Multi Rocket Code -//============================================================================= - -//================================ -//================================ -void() MultiRocketExplode = -{ - local float damg; - -// Stock Single Rocket Damage... -// damg = 100 + random()*20; - - damg = 60 + random()*15; - - if(other.health) - { - if(other.classname == "monster_shambler") - damg = damg * 0.5; // mostly immune - if(other.classname == "monster_dragon") - damg = damg * 0.5; // mostly immune - T_Damage (other, self, self.owner, damg ); - } - - // don't do radius damage to the other, because all the damage - // was done in the impact -// Stock single rocket damage. -// T_RadiusDamage (self, self.owner, 120, other); - - T_RadiusDamage (self, self.owner, 75, other); - -// sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); - self.origin = self.origin - 8*normalize(self.velocity); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - BecomeExplosion(); -}; - -//================================ -//================================ -void() MultiRocketTouch = -{ - if(other == self.owner) - return; // don't explode on owner - - if(pointcontents(self.origin) == CONTENT_SKY) - { - remove(self); - return; - } - - MultiRocketExplode(); -}; - - -//================================ -//================================ -void() HomingMissileThink = -{ - local vector dir; - - if(self.enemy.health < 1) - { - remove(self); - return; - } - - dir = normalize(self.enemy.origin - self.origin); - self.velocity = dir * 1000; - self.nextthink = time + 0.1; - self.think = HomingMissileThink; -}; - - -//================================ -//================================ -void() HomingMissileAcquire = -{ - local vector oldVelocity; - local vector aimangle; - - if( self.delay < time ) - { - MultiRocketExplode(); - return; - } - - oldVelocity = self.velocity; - makevectors (self.v_angle); - self.velocity = aim (self, 1000); - self.velocity = self.velocity * 1000; - - aimangle = self.origin + self.velocity; - traceline( self.origin, aimangle, FALSE, self ); - if(trace_fraction < 1) - { - if(trace_ent.flags & FL_MONSTER) - { - self.enemy = trace_ent; - HomingMissileThink(); - return; - } - } - - self.velocity = oldVelocity; - self.v_angle = vectoangles ( self.velocity ); - self.angles = self.v_angle; - self.think = HomingMissileAcquire; - self.nextthink = time + 0.2; -}; - -//================================ -//================================ -void(float offset, float frameNum) MultiRocketLaunch = -{ - local entity missile; - local vector aimangle; - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_FLYMISSILE; - missile.solid = SOLID_BBOX; - missile.classname = "MultiRocket"; - missile.delay = time + 4; - missile.frame = frameNum; - missile.touch = MultiRocketTouch; - - // TODO VR: (P2) rogue (commented to avoid warnings) - // if(deathmatch || coop) - // setmodel (missile, "progs/rockup_d.mdl"); - // else - // setmodel (missile, "progs/rockup.mdl"); - - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin + v_forward*8 + '0 0 16'); - - if( coop || deathmatch) - { - aimangle = self.v_angle; - aimangle_y = aimangle_y + (offset * 0.66); - makevectors (aimangle); - missile.velocity = aim(self, 1000); - missile.velocity = missile.velocity * 1000; - missile.angles = vectoangles(missile.velocity); - - missile.think = MultiRocketExplode; - missile.nextthink = time + 4; - } - else - { - makevectors (self.v_angle); - missile.velocity = v_forward * 1000 - v_right*offset*8; - missile.angles = vectoangles(missile.velocity); - missile.v_angle = self.v_angle; - - aimangle = missile.origin + missile.velocity; - traceline( missile.origin, aimangle, FALSE, self ); - if(trace_fraction < 1) - { - if(trace_ent.flags & FL_MONSTER) - { - missile.enemy = trace_ent; - missile.think = HomingMissileThink; - return; - } - } - - missile.think = HomingMissileAcquire; - missile.nextthink = time + 0.1; - } -}; - -//================================ -//================================ -void() W_FireMultiRocket = -{ - // TODO VR: (P2) rogue - // self.currentammo = self.ammo_multi_rockets = self.ammo_multi_rockets - 1; - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; - - // TODO VR: (P2) rogue - // UpdateAmmoCounts (self); - - sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - MultiRocketLaunch ( -10, 2 ); - MultiRocketLaunch ( -5, 3 ); - MultiRocketLaunch ( 5, 0 ); - MultiRocketLaunch ( 10, 1 ); -}; - -//============================================================================= -// Plasma Gun Code -//============================================================================= -void(vector p1, vector p2, entity from, float damage) PlasmaDamage = -{ - local entity e1, e2; - local vector f; - - f = p2 - p1; - normalize (f); - f_x = 0 - f_y; - f_y = f_x; - f_z = 0; - f = f*16; - - e1 = e2 = world; - - traceline(p1, p2, FALSE, self); - if(trace_ent.takedamage) - { - particle (trace_endpos, '0 0 100', 225, damage*4); - T_Damage (trace_ent, from, from.owner, damage); - if(self.classname == "player") - { - if(other.classname == "player") - trace_ent.velocity_z = trace_ent.velocity_z + 400; - } - } - e1 = trace_ent; - - traceline(p1 + f, p2 + f, FALSE, self); - if(trace_ent != e1 && trace_ent.takedamage) - { - particle (trace_endpos, '0 0 100', 225, damage*4); - T_Damage (trace_ent, from, from.owner, damage); - } - e2 = trace_ent; - - traceline(p1 - f, p2 - f, FALSE, self); - if(trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage) - { - particle (trace_endpos, '0 0 100', 225, damage*4); - T_Damage (trace_ent, from, from.owner, damage); - } -}; - -//================================ -//================================ -void(entity current, float doDamage) PlasmaDischarge = -{ - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LIGHTNING2); - WriteEntity(MSG_BROADCAST, current); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, current.origin_x); - WriteCoord(MSG_BROADCAST, current.origin_y); - WriteCoord(MSG_BROADCAST, current.origin_z); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - sound(self, CHAN_VOICE, "weapons/lhit.wav", 1, ATTN_NORM); - if(doDamage == 1) - PlasmaDamage (self.origin, current.origin, self, 50); -}; - -//================================ -//================================ -void() PlasmaGroundOut = -{ - local entity current, start; - local float monstersHit; - - monstersHit = 0; - current = findradius ( self.origin, 320 ); - start = current; - while( monstersHit < 5 ) - { - if( current.flags & FL_MONSTER || current.classname == "player") - { - if( current != self.owner ) - { - traceline( self.origin, current.origin, TRUE, world ); - if(trace_fraction == 1) - { - monstersHit = monstersHit + 1; - PlasmaDischarge ( current, 1 ); - } - } - } - current = current.chain; - if(start == current || !current) - return; - } -}; - -//================================ -//================================ -void() PlasmaTouch = -{ - local float damg; - - if(other == self.owner) - return; // don't explode on owner - - if(pointcontents(self.origin) == CONTENT_SKY) - { - remove(self); - return; - } - - damg = 80 + random()*20; - - // TODO VR: (P2) rogue (commented to avoid warnings) - // sound(self, CHAN_WEAPON, "plasma/explode.wav", 1, ATTN_NORM); - - if(other.health) - { - if(other.classname == "monster_shambler") - damg = damg * 0.5; // mostly immune - T_Damage (other, self, self.owner, damg ); - } - - // don't do radius damage to the other, because all the damage - // was done in the impact - T_RadiusDamage (self, self.owner, 70, other); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_EXPLOSION2); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - WriteByte(MSG_BROADCAST, 244); - WriteByte(MSG_BROADCAST, 3); - - PlasmaGroundOut(); - remove (self); -}; - -//================================ -//================================ -void() PlasmaLaunch = -{ - self.velocity = normalize(self.velocity); - self.velocity = self.velocity * 1250; - - self.nextthink = time + 5; - self.think = SUB_Remove; -}; - -void(vector org, vector dir) launch_plasma = -{ - local entity missile; - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_FLYMISSILE; - missile.solid = SOLID_BBOX; - missile.classname = "plasma"; - -// set missile speed - missile.velocity = dir * 0.01; - missile.avelocity = '300 300 300'; - missile.angles = vectoangles(missile.velocity); - missile.touch = PlasmaTouch; - - // TODO VR: (P2) rogue (commented to avoid warnings) - // setmodel (missile, "progs/plasma.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, org); - - // TODO VR: (P2) rogue (commented to avoid warnings) - // sound(missile, CHAN_WEAPON, "plasma/flight.wav", 1, ATTN_NORM); - - if(!deathmatch && !coop) - missile.effects = EF_BRIGHTLIGHT; - -// set missile duration - missile.think = PlasmaLaunch; - missile.nextthink = time + 0.1; -}; - -//================================ -//================================ - -// TODO VR: (P2) rogue -/* -void() W_FirePlasma = -{ - local float cells; - local vector dir; - - if(self.ammo_plasma < 1) - { - self.weapon = W_BestWeapon(); - W_SetCurrentAmmo(); - return; - } - -// explode if under water - if(self.waterlevel > 1) - { - cells = self.ammo_plasma; - self.ammo_plasma = 0; - W_SetCurrentAmmo(); - T_RadiusDamage (self, self, 35*cells, world); - return; - } - self.currentammo = self.ammo_plasma = self.ammo_plasma - 1; - - // TODO VR: (P2) rogue - // UpdateAmmoCounts (self); - sound(self, CHAN_WEAPON, "plasma/fire.wav", 0.5, ATTN_NORM); - self.punchangle_x = -2; - - makevectors (self.v_angle); - dir = aim ( self, 1000 ); - launch_plasma (self.origin + v_forward*24 + '0 0 16', dir); -}; -*/ diff --git a/QC/ogre.qc b/QC/ogre.qc deleted file mode 100644 index 8c762790..00000000 --- a/QC/ogre.qc +++ /dev/null @@ -1,533 +0,0 @@ -/* -============================================================================== - -OGRE - -============================================================================== -*/ - -$cd id1/models/ogre_c -$origin 0 0 24 -$base base -$skin base - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 -$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 - -$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 -$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 - -$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 -$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 - -$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 - -$frame pain1 pain2 pain3 pain4 pain5 - -$frame painb1 painb2 painb3 - -$frame painc1 painc2 painc3 painc4 painc5 painc6 - -$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 -$frame paind11 paind12 paind13 paind14 paind15 paind16 - -$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 -$frame paine11 paine12 paine13 paine14 paine15 - -$frame death1 death2 death3 death4 death5 death6 -$frame death7 death8 death9 death10 death11 death12 -$frame death13 death14 - -$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 -$frame bdeath7 bdeath8 bdeath9 bdeath10 - -$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 - -//============================================================================= - -float OGRE_BOSS = 2; -float OGRE_NORMAL = 4; - -void() OgreGrenadeExplode = -{ - T_RadiusDamage (self, self.owner, 40, world); - sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - self.velocity = '0 0 0'; - self.touch = SUB_Null; - setmodel (self, "progs/s_explod.spr"); - self.solid = SOLID_NOT; - s_explode1(); -}; - -void() OgreGrenadeTouch = -{ - if(other == self.owner) - return; // don't explode on owner - if(other.takedamage == DAMAGE_AIM) - { - OgreGrenadeExplode(); - return; - } - sound(self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound - if(self.velocity == '0 0 0') - self.avelocity = '0 0 0'; -}; - -/* -================ -OgreFireGrenade -================ -*/ -void() MultiGrenadeTouch; -void() MultiGrenadeExplode; - -void() OgreFireGrenade = -{ - local entity missile; - - self.effects = self.effects | EF_MUZZLEFLASH; - - sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_BOUNCE; - missile.solid = SOLID_BBOX; - missile.classname = "ogre_grenade"; - -// set missile speed - - makevectors (self.angles); - missile.velocity = normalize(self.enemy.origin - self.origin); - missile.velocity = missile.velocity * 600; - missile.velocity_z = 200; - missile.avelocity = '300 300 300'; - missile.angles = vectoangles(missile.velocity); - -// set missile duration - if(self.spawnflags & OGRE_BOSS) - { - missile.touch = MultiGrenadeTouch; - missile.nextthink = time + 2.5; - missile.think = MultiGrenadeExplode; - setmodel (missile, "progs/mervup.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin); - missile.classname = "MultiGrenade"; - } - else - { - missile.touch = OgreGrenadeTouch; - missile.nextthink = time + 2.5; - missile.think = OgreGrenadeExplode; - setmodel (missile, "progs/grenade.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin); - } -}; - - -//============================================================================= - -/* -================ -chainsaw - -FIXME -================ -*/ -void(float side) chainsaw = -{ -local vector delta; -local float ldmg; - - if(!self.enemy) - return; - if(!CanDamage (self.enemy, self)) - return; - - ai_charge(10); - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - - ldmg = (random() + random() + random()) * 4; - T_Damage (self.enemy, self, self, ldmg); - - if(side) - { - makevectors (self.angles); - if(side == 1) - SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); - else - SpawnMeatSpray (self.origin + v_forward*16, side * v_right); - } -}; - - -void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();}; -void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();}; -void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();}; -void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();}; -void() ogre_stand5 =[ $stand5, ogre_stand6 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); -ai_stand(); -}; -void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();}; -void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();}; -void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();}; -void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();}; - -void() ogre_walk1 =[ $walk1, ogre_walk2 ] {ai_walk(3);}; -void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);}; -void() ogre_walk3 =[ $walk3, ogre_walk4 ] { -ai_walk(2); -if(random() < 0.2) - sound(self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); -}; -void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);}; -void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);}; -void() ogre_walk6 =[ $walk6, ogre_walk7 ] { -ai_walk(5); -if(random() < 0.1) - sound(self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); -}; -void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);}; -void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);}; -void() ogre_walk9 =[ $walk9, ogre_walk10 ] {ai_walk(3);}; -void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);}; -void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);}; -void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);}; -void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);}; -void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);}; -void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);}; -void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);}; - -void() ogre_run1 =[ $run1, ogre_run2 ] {ai_run(9); -if(random() < 0.2) - sound(self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE); -}; -void() ogre_run2 =[ $run2, ogre_run3 ] {ai_run(12);}; -void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);}; -void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);}; -void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);}; -void() ogre_run6 =[ $run6, ogre_run7 ] {ai_run(4);}; -void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);}; -void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);}; - -void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11); -sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); -}; -void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);}; -void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);}; -void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);}; -void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);self.angles_y = self.angles_y + random()*25;}; -void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);}; -void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);}; -void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);}; - -void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6); -sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); -}; -void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);}; -void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);}; -void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);}; -void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);}; -void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0);}; -void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);}; -void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);}; -void() ogre_smash9 =[ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);}; -void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1);}; -void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0); -self.nextthink = self.nextthink + random()*0.2;}; // slight variation -void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge(0);}; -void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);}; -void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);}; - -void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();}; -void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();}; -void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();}; -void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireGrenade();}; -void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();}; -void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();}; -void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();}; - -void() ogre_pain1 =[ $pain1, ogre_pain2 ] {}; -void() ogre_pain2 =[ $pain2, ogre_pain3 ] {}; -void() ogre_pain3 =[ $pain3, ogre_pain4 ] {}; -void() ogre_pain4 =[ $pain4, ogre_pain5 ] {}; -void() ogre_pain5 =[ $pain5, ogre_run1 ] {}; - - -void() ogre_painb1 =[ $painb1, ogre_painb2 ] {}; -void() ogre_painb2 =[ $painb2, ogre_painb3 ] {}; -void() ogre_painb3 =[ $painb3, ogre_run1 ] {}; - - -void() ogre_painc1 =[ $painc1, ogre_painc2 ] {}; -void() ogre_painc2 =[ $painc2, ogre_painc3 ] {}; -void() ogre_painc3 =[ $painc3, ogre_painc4 ] {}; -void() ogre_painc4 =[ $painc4, ogre_painc5 ] {}; -void() ogre_painc5 =[ $painc5, ogre_painc6 ] {}; -void() ogre_painc6 =[ $painc6, ogre_run1 ] {}; - - -void() ogre_paind1 =[ $paind1, ogre_paind2 ] {}; -void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);}; -void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);}; -void() ogre_paind4 =[ $paind4, ogre_paind5 ] {ai_pain(4);}; -void() ogre_paind5 =[ $paind5, ogre_paind6 ] {}; -void() ogre_paind6 =[ $paind6, ogre_paind7 ] {}; -void() ogre_paind7 =[ $paind7, ogre_paind8 ] {}; -void() ogre_paind8 =[ $paind8, ogre_paind9 ] {}; -void() ogre_paind9 =[ $paind9, ogre_paind10 ] {}; -void() ogre_paind10=[ $paind10, ogre_paind11 ] {}; -void() ogre_paind11=[ $paind11, ogre_paind12 ] {}; -void() ogre_paind12=[ $paind12, ogre_paind13 ] {}; -void() ogre_paind13=[ $paind13, ogre_paind14 ] {}; -void() ogre_paind14=[ $paind14, ogre_paind15 ] {}; -void() ogre_paind15=[ $paind15, ogre_paind16 ] {}; -void() ogre_paind16=[ $paind16, ogre_run1 ] {}; - -void() ogre_paine1 =[ $paine1, ogre_paine2 ] {}; -void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);}; -void() ogre_paine3 =[ $paine3, ogre_paine4 ] {ai_pain(9);}; -void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);}; -void() ogre_paine5 =[ $paine5, ogre_paine6 ] {}; -void() ogre_paine6 =[ $paine6, ogre_paine7 ] {}; -void() ogre_paine7 =[ $paine7, ogre_paine8 ] {}; -void() ogre_paine8 =[ $paine8, ogre_paine9 ] {}; -void() ogre_paine9 =[ $paine9, ogre_paine10 ] {}; -void() ogre_paine10=[ $paine10, ogre_paine11 ] {}; -void() ogre_paine11=[ $paine11, ogre_paine12 ] {}; -void() ogre_paine12=[ $paine12, ogre_paine13 ] {}; -void() ogre_paine13=[ $paine13, ogre_paine14 ] {}; -void() ogre_paine14=[ $paine14, ogre_paine15 ] {}; -void() ogre_paine15=[ $paine15, ogre_run1 ] {}; - - -void(entity attacker, float damage) ogre_pain = -{ - local float r; - -// don't make multiple pain sounds right after each other - if(self.pain_finished > time) - return; - - sound(self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); - - r = random(); - - if(r < 0.25) - { - ogre_pain1(); - self.pain_finished = time + 1; - } - else if(r < 0.5) - { - ogre_painb1(); - self.pain_finished = time + 1; - } - else if(r < 0.75) - { - ogre_painc1(); - self.pain_finished = time + 1; - } - else if(r < 0.88) - { - ogre_paind1(); - self.pain_finished = time + 2; - } - else - { - ogre_paine1(); - self.pain_finished = time + 2; - } -}; - -void() OgreDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - self.ammo_rockets = 2; - DropBackpack(); - - if(entPlayer != world && random() > 0.65) - { - if(!TryEnemyDrop(entPlayer, WID_GRENADE_LAUNCHER, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_PROXIMITY_GUN, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_ROCKET_LAUNCHER, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_NAILGUN, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_NAILGUN, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_AXE, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_SHOTGUN, 0.1)) - if(!TryEnemyDrop(entPlayer, WID_SHOTGUN, 0.1)) - { /* Intentionally empty. */ } - } -} - - -void() ogre_die1 =[ $death1, ogre_die2 ] {}; -void() ogre_die2 =[ $death2, ogre_die3 ] {}; -void() ogre_die3 =[ $death3, ogre_die4 ] - { - self.solid = SOLID_NOT; - if(self.spawnflags & OGRE_BOSS) - { - // TODO VR: (P2) rogue - // self.ammo_multi_rockets = 2; - self.ammo_rockets = 2; - } - else - self.ammo_rockets = 2; - OgreDrop(); - }; -void() ogre_die4 =[ $death4, ogre_die5 ] {}; -void() ogre_die5 =[ $death5, ogre_die6 ] {}; -void() ogre_die6 =[ $death6, ogre_die7 ] {}; -void() ogre_die7 =[ $death7, ogre_die8 ] {}; -void() ogre_die8 =[ $death8, ogre_die9 ] {}; -void() ogre_die9 =[ $death9, ogre_die10 ] {}; -void() ogre_die10 =[ $death10, ogre_die11 ] {}; -void() ogre_die11 =[ $death11, ogre_die12 ] {}; -void() ogre_die12 =[ $death12, ogre_die13 ] {}; -void() ogre_die13 =[ $death13, ogre_die14 ] {}; -void() ogre_die14 =[ $death14, ogre_die14 ] {}; - -void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {}; -void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {ai_forward(5);}; -void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] - { - self.solid = SOLID_NOT; - if(self.spawnflags & OGRE_BOSS) - { - // TODO VR: (P2) rogue - // self.ammo_multi_rockets = 2; - self.ammo_rockets = 2; - } - else - self.ammo_rockets = 2; - OgreDrop(); - }; -void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);}; -void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);}; -void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);}; -void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);}; -void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {}; -void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {}; -void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {}; - -void() ogre_die = -{ -// check for gib - if(self.health < -80) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_ogre.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - OgreDrop(); - return; - } - - sound(self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); - - if(random() < 0.5) - ogre_die1(); - else - ogre_bdie1(); -}; - -void() ogre_melee = -{ - if(random() > 0.5) - ogre_smash1(); - else - ogre_swing1(); -}; - - -/*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush Boss Normal -The Ogre - -Boss: use the modified skin and fire multigrenades. -Normal: use the original skin and fire normal grenades. -*/ -void() monster_ogre = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/ogre.mdl"); - precache_model ("progs/h_ogre.mdl"); - precache_model ("progs/grenade.mdl"); - - precache_sound("ogre/ogdrag.wav"); - precache_sound("ogre/ogdth.wav"); - precache_sound("ogre/ogidle.wav"); - precache_sound("ogre/ogidle2.wav"); - precache_sound("ogre/ogpain1.wav"); - precache_sound("ogre/ogsawatk.wav"); - precache_sound("ogre/ogwake.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/ogre.mdl"); - - // none specified - choose random. 25% boss on normal, hard, bloodbath - if(self.spawnflags <= 1) - { - if(cvar("skill") > 0) - { - if( random() <= 0.25 ) - { - self.spawnflags = self.spawnflags | OGRE_BOSS; - } - } - } - - if(self.spawnflags & OGRE_BOSS) - { - // TODO VR: (P2) rogue - // self.skin = 1; - } - - setsize (self, '-24 -24 -24', '24 24 40'); - self.health = 200; - - self.th_stand = ogre_stand1; - self.th_walk = ogre_walk1; - self.th_run = ogre_run1; - self.th_die = ogre_die; - self.th_melee = ogre_melee; - self.th_missile = ogre_nail1; - self.th_pain = ogre_pain; - - walkmonster_start(); -}; diff --git a/QC/oldone.qc b/QC/oldone.qc deleted file mode 100644 index 39b677e6..00000000 --- a/QC/oldone.qc +++ /dev/null @@ -1,286 +0,0 @@ -/* -============================================================================== - -OLD ONE - -============================================================================== -*/ -$cd id1/models/old_one -$origin 0 0 24 -$base base -$skin skin -$scale 1 - -void() finale_1; -void() finale_2; -void() finale_3; -void() finale_4; - - -entity shub; - -$frame old1 old2 old3 old4 old5 old6 old7 old8 old9 -$frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19 -$frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29 -$frame old30 old31 old32 old33 old34 old35 old36 old37 old38 old39 -$frame old40 old41 old42 old43 old44 old45 old46 - -$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 -$frame shake9 shake10 shake11 shake12 shake12 shake13 shake14 -$frame shake15 shake16 shake17 shake18 shake19 shake20 - -//void() old_stand =[ $old1, old_stand ] {}; - -void() old_idle1 =[ $old1, old_idle2 ] {}; -void() old_idle2 =[ $old2, old_idle3 ] {}; -void() old_idle3 =[ $old3, old_idle4 ] {}; -void() old_idle4 =[ $old4, old_idle5 ] {}; -void() old_idle5 =[ $old5, old_idle6 ] {}; -void() old_idle6 =[ $old6, old_idle7 ] {}; -void() old_idle7 =[ $old7, old_idle8 ] {}; -void() old_idle8 =[ $old8, old_idle9 ] {}; -void() old_idle9 =[ $old9, old_idle10 ] {}; -void() old_idle10 =[ $old10, old_idle11 ] {}; -void() old_idle11 =[ $old11, old_idle12 ] {}; -void() old_idle12 =[ $old12, old_idle13 ] {}; -void() old_idle13 =[ $old13, old_idle14 ] {}; -void() old_idle14 =[ $old14, old_idle15 ] {}; -void() old_idle15 =[ $old15, old_idle16 ] {}; -void() old_idle16 =[ $old16, old_idle17 ] {}; -void() old_idle17 =[ $old17, old_idle18 ] {}; -void() old_idle18 =[ $old18, old_idle19 ] {}; -void() old_idle19 =[ $old19, old_idle20 ] {}; -void() old_idle20 =[ $old20, old_idle21 ] {}; -void() old_idle21 =[ $old21, old_idle22 ] {}; -void() old_idle22 =[ $old22, old_idle23 ] {}; -void() old_idle23 =[ $old23, old_idle24 ] {}; -void() old_idle24 =[ $old24, old_idle25 ] {}; -void() old_idle25 =[ $old25, old_idle26 ] {}; -void() old_idle26 =[ $old26, old_idle27 ] {}; -void() old_idle27 =[ $old27, old_idle28 ] {}; -void() old_idle28 =[ $old28, old_idle29 ] {}; -void() old_idle29 =[ $old29, old_idle30 ] {}; -void() old_idle30 =[ $old30, old_idle31 ] {}; -void() old_idle31 =[ $old31, old_idle32 ] {}; -void() old_idle32 =[ $old32, old_idle33 ] {}; -void() old_idle33 =[ $old33, old_idle34 ] {}; -void() old_idle34 =[ $old34, old_idle35 ] {}; -void() old_idle35 =[ $old35, old_idle36 ] {}; -void() old_idle36 =[ $old36, old_idle37 ] {}; -void() old_idle37 =[ $old37, old_idle38 ] {}; -void() old_idle38 =[ $old38, old_idle39 ] {}; -void() old_idle39 =[ $old39, old_idle40 ] {}; -void() old_idle40 =[ $old40, old_idle41 ] {}; -void() old_idle41 =[ $old41, old_idle42 ] {}; -void() old_idle42 =[ $old42, old_idle43 ] {}; -void() old_idle43 =[ $old43, old_idle44 ] {}; -void() old_idle44 =[ $old44, old_idle45 ] {}; -void() old_idle45 =[ $old45, old_idle46 ] {}; -void() old_idle46 =[ $old46, old_idle1 ] {}; - - -void() old_thrash1 =[ $shake1, old_thrash2 ] {lightstyle(0, "m");}; -void() old_thrash2 =[ $shake2, old_thrash3 ] {lightstyle(0, "k");}; -void() old_thrash3 =[ $shake3, old_thrash4 ] {lightstyle(0, "k");}; -void() old_thrash4 =[ $shake4, old_thrash5 ] {lightstyle(0, "i");}; -void() old_thrash5 =[ $shake5, old_thrash6 ] {lightstyle(0, "g");}; -void() old_thrash6 =[ $shake6, old_thrash7 ] {lightstyle(0, "e");}; -void() old_thrash7 =[ $shake7, old_thrash8 ] {lightstyle(0, "c");}; -void() old_thrash8 =[ $shake8, old_thrash9 ] {lightstyle(0, "a");}; -void() old_thrash9 =[ $shake9, old_thrash10 ] {lightstyle(0, "c");}; -void() old_thrash10 =[ $shake10, old_thrash11 ] {lightstyle(0, "e");}; -void() old_thrash11 =[ $shake11, old_thrash12 ] {lightstyle(0, "g");}; -void() old_thrash12 =[ $shake12, old_thrash13 ] {lightstyle(0, "i");}; -void() old_thrash13 =[ $shake13, old_thrash14 ] {lightstyle(0, "k");}; -void() old_thrash14 =[ $shake14, old_thrash15 ] {lightstyle(0, "m");}; -void() old_thrash15 =[ $shake15, old_thrash16 ] {lightstyle(0, "m"); -self.cnt = self.cnt + 1; -if(self.cnt != 3) - self.think = old_thrash1; -}; -void() old_thrash16 =[ $shake16, old_thrash17 ] {lightstyle(0, "g");}; -void() old_thrash17 =[ $shake17, old_thrash18 ] {lightstyle(0, "c");}; -void() old_thrash18 =[ $shake18, old_thrash19 ] {lightstyle(0, "b");}; -void() old_thrash19 =[ $shake19, old_thrash20 ] {lightstyle(0, "a");}; -void() old_thrash20 =[ $shake20, old_thrash20 ] {finale_4();}; - -//============================================================================ - -void() finale_1 = -{ - local entity pos, pl; - local entity timer; - - killed_monsters = killed_monsters + 1; - WriteByte(MSG_ALL, SVC_KILLEDMONSTER); // FIXME: reliable broadcast - - intermission_exittime = time + 10000000; // never allow exit - intermission_running = 1; - - // find the intermission spot - pos = find (world, classname, "info_intermission"); - if(!pos) - error ("no info_intermission"); - pl = find (world, classname, "misc_teleporttrain"); - if(!pl) - error ("no teleporttrain"); - remove (pl); - - WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, ""); - - pl = find (world, classname, "player"); - while(pl != world) - { - pl.view_ofs = '0 0 0'; - pl.angles = other.v_angle = pos.mangle; - pl.fixangle = TRUE; // turn this way immediately - pl.map = self.map; - pl.nextthink = time + 0.5; - pl.takedamage = DAMAGE_NO; - pl.solid = SOLID_NOT; - pl.movetype = MOVETYPE_NONE; - pl.modelindex = 0; - setorigin (pl, pos.origin); - pl = find (pl, classname, "player"); - } - - // make fake versions of all players as standins, and move the real - // players to the intermission spot - - // wait for 1 second - timer = spawn(); - timer.nextthink = time + 1; - timer.think = finale_2; -}; - -void() finale_2 = -{ - local vector o; - - // start a teleport splash inside shub - - o = shub.origin - '0 100 0'; - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_TELEPORT); - WriteCoord(MSG_BROADCAST, o_x); - WriteCoord(MSG_BROADCAST, o_y); - WriteCoord(MSG_BROADCAST, o_z); - - sound(shub, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); - - self.nextthink = time + 2; - self.think = finale_3; -}; - -void() finale_3 = -{ - // start shub thrashing wildly - shub.think = old_thrash1; - sound(shub, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NORM); - lightstyle(0, "abcdefghijklmlkjihgfedcb"); -}; - -void() finale_4 = -{ - // throw tons of meat chunks - local vector oldo; - local float x, y, z; - local float r; - local entity n; - - sound(self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM); - - oldo = self.origin; - - z = 16; - while(z <= 144) - { - x = -64; - while(x <= 64) - { - y = -64; - while(y <= 64) - { - self.origin_x = oldo_x + x; - self.origin_y = oldo_y + y; - self.origin_z = oldo_z + z; - - r = random(); - if(r < 0.3) - ThrowGib ("progs/gib1.mdl", -999); - else if(r < 0.6) - ThrowGib ("progs/gib2.mdl", -999); - else - ThrowGib ("progs/gib3.mdl", -999); - y = y + 32; - } - x = x + 32; - } - z = z + 96; - } - // start the end text - WriteByte(MSG_ALL, SVC_FINALE); - WriteString (MSG_ALL, "Congratulations and well done! You have\nbeaten the hideous Shub-Niggurath, and\nher hundreds of ugly changelings and\nmonsters. You have proven that your\nskill and your cunning are greater than\nall the powers of Quake. You are the\nmaster now. Id Software salutes you."); - -// put a player model down - n = spawn(); - setmodel (n, "progs/player.mdl"); - oldo = oldo - '32 264 0'; - setorigin (n, oldo); - n.angles = '0 290 0'; - n.frame = 1; - - remove (self); - -// switch cd track - WriteByte(MSG_ALL, SVC_CDTRACK); - WriteByte(MSG_ALL, 3); - WriteByte(MSG_ALL, 3); - lightstyle(0, "m"); -}; - -//============================================================================ - -void (entity attacker, float damage) nopain = -{ - self.health = 40000; -}; - -//============================================================================ - - -/*QUAKED monster_oldone (1 0 0) (-16 -16 -24) (16 16 32) -*/ -void() monster_oldone = -{ - if(deathmatch) - { - remove(self); - return; - } - - precache_model2 ("progs/oldone.mdl"); - - precache_sound2 ("boss2/death.wav"); - precache_sound2 ("boss2/idle.wav"); - precache_sound2 ("boss2/sight.wav"); - precache_sound2 ("boss2/pop2.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/oldone.mdl"); - setsize (self, '-160 -128 -24', '160 128 256'); - - self.health = 40000; // kill by telefrag - self.think = old_idle1; - self.nextthink = time + 0.1; - self.takedamage = DAMAGE_YES; - self.th_pain = nopain; - self.th_die = finale_1; - shub = self; - - total_monsters = total_monsters + 1; -}; - diff --git a/QC/orig_mon_boss.qc b/QC/orig_mon_boss.qc new file mode 100644 index 00000000..1efbb373 --- /dev/null +++ b/QC/orig_mon_boss.qc @@ -0,0 +1,404 @@ +/* +============================================================================== + +BOSS-ONE + +============================================================================== +*/ +$cd id1/models/boss1 +$origin 0 0 -15 +$base base +$skin skin +$scale 5 + +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +void() boss_face = +{ + +// go for another player if multi player + if(self.enemy.health <= 0 || random() < 0.02) + { + self.enemy = find(self.enemy, classname, "player"); + if(!self.enemy) + self.enemy = find(self.enemy, classname, "player"); + } + ai_face(); +}; + +void() boss_rise1 =[ $rise1, boss_rise2 ] { +sound(self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM); +}; +void() boss_rise2 =[ $rise2, boss_rise3 ] { +sound(self, CHAN_VOICE, "boss1/sight1.wav", 1, ATTN_NORM); +}; +void() boss_rise3 =[ $rise3, boss_rise4 ] {}; +void() boss_rise4 =[ $rise4, boss_rise5 ] {}; +void() boss_rise5 =[ $rise5, boss_rise6 ] {}; +void() boss_rise6 =[ $rise6, boss_rise7 ] {}; +void() boss_rise7 =[ $rise7, boss_rise8 ] {}; +void() boss_rise8 =[ $rise8, boss_rise9 ] {}; +void() boss_rise9 =[ $rise9, boss_rise10 ] {}; +void() boss_rise10 =[ $rise10, boss_rise11 ] {}; +void() boss_rise11 =[ $rise11, boss_rise12 ] {}; +void() boss_rise12 =[ $rise12, boss_rise13 ] {}; +void() boss_rise13 =[ $rise13, boss_rise14 ] {}; +void() boss_rise14 =[ $rise14, boss_rise15 ] {}; +void() boss_rise15 =[ $rise15, boss_rise16 ] {}; +void() boss_rise16 =[ $rise16, boss_rise17 ] {}; +void() boss_rise17 =[ $rise17, boss_missile1 ] {}; + +void() boss_idle1 =[ $walk1, boss_idle2 ] +{ +// look for other players +}; +void() boss_idle2 =[ $walk2, boss_idle3 ] {boss_face();}; +void() boss_idle3 =[ $walk3, boss_idle4 ] {boss_face();}; +void() boss_idle4 =[ $walk4, boss_idle5 ] {boss_face();}; +void() boss_idle5 =[ $walk5, boss_idle6 ] {boss_face();}; +void() boss_idle6 =[ $walk6, boss_idle7 ] {boss_face();}; +void() boss_idle7 =[ $walk7, boss_idle8 ] {boss_face();}; +void() boss_idle8 =[ $walk8, boss_idle9 ] {boss_face();}; +void() boss_idle9 =[ $walk9, boss_idle10 ] {boss_face();}; +void() boss_idle10 =[ $walk10, boss_idle11 ] {boss_face();}; +void() boss_idle11 =[ $walk11, boss_idle12 ] {boss_face();}; +void() boss_idle12 =[ $walk12, boss_idle13 ] {boss_face();}; +void() boss_idle13 =[ $walk13, boss_idle14 ] {boss_face();}; +void() boss_idle14 =[ $walk14, boss_idle15 ] {boss_face();}; +void() boss_idle15 =[ $walk15, boss_idle16 ] {boss_face();}; +void() boss_idle16 =[ $walk16, boss_idle17 ] {boss_face();}; +void() boss_idle17 =[ $walk17, boss_idle18 ] {boss_face();}; +void() boss_idle18 =[ $walk18, boss_idle19 ] {boss_face();}; +void() boss_idle19 =[ $walk19, boss_idle20 ] {boss_face();}; +void() boss_idle20 =[ $walk20, boss_idle21 ] {boss_face();}; +void() boss_idle21 =[ $walk21, boss_idle22 ] {boss_face();}; +void() boss_idle22 =[ $walk22, boss_idle23 ] {boss_face();}; +void() boss_idle23 =[ $walk23, boss_idle24 ] {boss_face();}; +void() boss_idle24 =[ $walk24, boss_idle25 ] {boss_face();}; +void() boss_idle25 =[ $walk25, boss_idle26 ] {boss_face();}; +void() boss_idle26 =[ $walk26, boss_idle27 ] {boss_face();}; +void() boss_idle27 =[ $walk27, boss_idle28 ] {boss_face();}; +void() boss_idle28 =[ $walk28, boss_idle29 ] {boss_face();}; +void() boss_idle29 =[ $walk29, boss_idle30 ] {boss_face();}; +void() boss_idle30 =[ $walk30, boss_idle31 ] {boss_face();}; +void() boss_idle31 =[ $walk31, boss_idle1 ] {boss_face();}; + +void() boss_missile1 =[ $attack1, boss_missile2 ] {boss_face();}; +void() boss_missile2 =[ $attack2, boss_missile3 ] {boss_face();}; +void() boss_missile3 =[ $attack3, boss_missile4 ] {boss_face();}; +void() boss_missile4 =[ $attack4, boss_missile5 ] {boss_face();}; +void() boss_missile5 =[ $attack5, boss_missile6 ] {boss_face();}; +void() boss_missile6 =[ $attack6, boss_missile7 ] {boss_face();}; +void() boss_missile7 =[ $attack7, boss_missile8 ] {boss_face();}; +void() boss_missile8 =[ $attack8, boss_missile9 ] {boss_face();}; +void() boss_missile9 =[ $attack9, boss_missile10 ] {boss_missile(0, '100 100 200');}; +void() boss_missile10 =[ $attack10, boss_missile11 ] {boss_face();}; +void() boss_missile11 =[ $attack11, boss_missile12 ] {boss_face();}; +void() boss_missile12 =[ $attack12, boss_missile13 ] {boss_face();}; +void() boss_missile13 =[ $attack13, boss_missile14 ] {boss_face();}; +void() boss_missile14 =[ $attack14, boss_missile15 ] {boss_face();}; +void() boss_missile15 =[ $attack15, boss_missile16 ] {boss_face();}; +void() boss_missile16 =[ $attack16, boss_missile17 ] {boss_face();}; +void() boss_missile17 =[ $attack17, boss_missile18 ] {boss_face();}; +void() boss_missile18 =[ $attack18, boss_missile19 ] {boss_face();}; +void() boss_missile19 =[ $attack19, boss_missile20 ] {boss_face();}; +void() boss_missile20 =[ $attack20, boss_missile21 ] {boss_missile(0, '100 -100 200');}; +void() boss_missile21 =[ $attack21, boss_missile22 ] {boss_face();}; +void() boss_missile22 =[ $attack22, boss_missile23 ] {boss_missile(1, '100 -100 200');}; +void() boss_missile23 =[ $attack23, boss_missile1 ] {boss_face();}; + +void() boss_shocka1 =[ $shocka1, boss_shocka2 ] {}; +void() boss_shocka2 =[ $shocka2, boss_shocka3 ] {}; +void() boss_shocka3 =[ $shocka3, boss_shocka4 ] {}; +void() boss_shocka4 =[ $shocka4, boss_shocka5 ] {}; +void() boss_shocka5 =[ $shocka5, boss_shocka6 ] {}; +void() boss_shocka6 =[ $shocka6, boss_shocka7 ] {}; +void() boss_shocka7 =[ $shocka7, boss_shocka8 ] {}; +void() boss_shocka8 =[ $shocka8, boss_shocka9 ] {}; +void() boss_shocka9 =[ $shocka9, boss_shocka10 ] {}; +void() boss_shocka10 =[ $shocka10, boss_missile1 ] {}; + +void() boss_shockb1 =[ $shockb1, boss_shockb2 ] {}; +void() boss_shockb2 =[ $shockb2, boss_shockb3 ] {}; +void() boss_shockb3 =[ $shockb3, boss_shockb4 ] {}; +void() boss_shockb4 =[ $shockb4, boss_shockb5 ] {}; +void() boss_shockb5 =[ $shockb5, boss_shockb6 ] {}; +void() boss_shockb6 =[ $shockb6, boss_shockb7 ] {}; +void() boss_shockb7 =[ $shockb1, boss_shockb8 ] {}; +void() boss_shockb8 =[ $shockb2, boss_shockb9 ] {}; +void() boss_shockb9 =[ $shockb3, boss_shockb10 ] {}; +void() boss_shockb10 =[ $shockb4, boss_missile1 ] {}; + +void() boss_shockc1 =[ $shockc1, boss_shockc2 ] {}; +void() boss_shockc2 =[ $shockc2, boss_shockc3 ] {}; +void() boss_shockc3 =[ $shockc3, boss_shockc4 ] {}; +void() boss_shockc4 =[ $shockc4, boss_shockc5 ] {}; +void() boss_shockc5 =[ $shockc5, boss_shockc6 ] {}; +void() boss_shockc6 =[ $shockc6, boss_shockc7 ] {}; +void() boss_shockc7 =[ $shockc7, boss_shockc8 ] {}; +void() boss_shockc8 =[ $shockc8, boss_shockc9 ] {}; +void() boss_shockc9 =[ $shockc9, boss_shockc10 ] {}; +void() boss_shockc10 =[ $shockc10, boss_death1 ] {}; + +void() boss_death1 = [$death1, boss_death2] { +sound(self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM); +}; +void() boss_death2 = [$death2, boss_death3] {}; +void() boss_death3 = [$death3, boss_death4] {}; +void() boss_death4 = [$death4, boss_death5] {}; +void() boss_death5 = [$death5, boss_death6] {}; +void() boss_death6 = [$death6, boss_death7] {}; +void() boss_death7 = [$death7, boss_death8] {}; +void() boss_death8 = [$death8, boss_death9] {}; +void() boss_death9 = [$death9, boss_death10] +{ + sound(self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteVec3(MSG_BROADCAST, self.origin); +}; + +void() boss_death10 = [$death9, boss_death10] +{ + killed_monsters = killed_monsters + 1; + WriteByte(MSG_ALL, SVC_KILLEDMONSTER); // FIXME: reliable broadcast + SUB_UseTargets(); + remove(self); +}; + +void(float r, vector p) boss_missile = +{ + vector offang; + vector org, vec, d; + float t; + float vel; + entity newmis; + + // VR: Predicted direction attack. + if(r == 0) + { + vel = 450 + random() * 150; + } + else + { + vel = 100 + random() * 150; + } + + offang = vectoangles (self.enemy.origin - self.origin); + makevectors(offang); + + org = self.origin + p_x*v_forward + p_y*v_right + p_z*'0 0 1'; + +// lead the player on hard mode + if(skill > 1) + { + // VR: Predicted direction attack. + if(r == 0) + { + t = vlen(self.enemy.origin - org) / vel; + vec = self.enemy.velocity; + vec_z = 0; + d = self.enemy.origin + t * vec; + } + else + { + d = self.enemy.origin; + } + } + else + { + d = self.enemy.origin; + } + + vec = normalize(d - org); + + newmis = launch_spike(org, vec); + setmodel(newmis, "progs/lavaball.mdl"); + newmis.avelocity = '200 100 300'; + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vec * vel; + + // VR: Randomized direction attack. + if(r == 1) + { + newmis.velocity_x = newmis.velocity_x + crandom() * 100; + newmis.velocity_y = newmis.velocity_y + crandom() * 100; + newmis.velocity_z = newmis.velocity_z + crandom() * 100; + } + + newmis.touch = T_MissileTouch; // rocket explosion + sound(self, CHAN_WEAPON, "boss1/throw.wav", 1, ATTN_NORM); + +// check for dead enemy + if(self.enemy.health <= 0) + boss_idle1(); +}; + + +void() boss_awake = +{ + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_NO; + + setmodel(self, "progs/boss.mdl"); + setsize(self, '-128 -128 -24', '128 128 256'); + + if(skill == 0) + self.health = 1; + else + self.health = 3; + + self.enemy = activator; + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteVec3(MSG_BROADCAST, self.origin); + + self.yaw_speed = 20; + boss_rise1(); +}; + + +/*QUAKED monster_boss (1 0 0) (-128 -128 -24) (128 128 256) +*/ +void() monster_boss = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/boss.mdl"); + precache_model("progs/lavaball.mdl"); + + precache_sound("weapons/rocket1i.wav"); + precache_sound("boss1/out1.wav"); + precache_sound("boss1/sight1.wav"); + precache_sound("misc/power.wav"); + precache_sound("boss1/throw.wav"); + precache_sound("boss1/pain.wav"); + precache_sound("boss1/death.wav"); + + total_monsters = total_monsters + 1; + + self.use = boss_awake; +}; + +//=========================================================================== + +entity le1, le2; +float lightning_end; + +void() lightning_fire = +{ + vector p1, p2; + + if(time >= lightning_end) + { // done here, put the terminals back up + self = le1; + door_go_down(); + self = le2; + door_go_down(); + return; + } + + p1 = (le1.mins + le1.maxs) * 0.5; + p1_z = le1.absmin_z - 16; + + p2 = (le2.mins + le2.maxs) * 0.5; + p2_z = le2.absmin_z - 16; + + // compensate for length of bolt + p2 = p2 - normalize(p2-p1)*100; + + self.nextthink = time + 0.1; + self.think = lightning_fire; + + WriteByte(MSG_ALL, SVC_TEMPENTITY); + WriteByte(MSG_ALL, TE_LIGHTNING3); + WriteEntity(MSG_ALL, world); + WriteByte(MSG_ALL, 0); /* disambiguator */ + WriteVec3(MSG_ALL, p1); + WriteVec3(MSG_ALL, p2); +}; + +void() lightning_use = +{ + if(lightning_end >= time + 1) + return; + + le1 = find(world, target, "lightning"); + le2 = find(le1, target, "lightning"); + if(!le1 || !le2) + { + objerror("missing lightning targets\n"); + return; + } + + if( + (le1.state != STATE_TOP && le1.state != STATE_BOTTOM) + || (le2.state != STATE_TOP && le2.state != STATE_BOTTOM) + || (le1.state != le2.state)) + { +// dprint("not aligned\n"); + return; + } + +// don't let the electrodes go back up until the bolt is done + le1.nextthink = -1; + le2.nextthink = -1; + lightning_end = time + 2; + + sound(self, CHAN_VOICE, "misc/power.wav", 1, ATTN_NORM); + lightning_fire(); + +// advance the boss pain if down + self = find(world, classname, "monster_boss"); + if(!self) + return; + self.enemy = activator; + if(le1.state == STATE_TOP && self.health > 0) + { + sound(self, CHAN_VOICE, "boss1/pain.wav", 1, ATTN_NORM); + self.health = self.health - 1; + if(self.health >= 2) + boss_shocka1(); + else if(self.health == 1) + boss_shockb1(); + else if(self.health == 0) + boss_shockc1(); + } +}; + + +/*QUAKED event_lightning (0 1 1) (-16 -16 -16) (16 16 16) +Just for boss level. +*/ +void() event_lightning = +{ + self.use = lightning_use; +}; + + diff --git a/QC/orig_mon_demon.qc b/QC/orig_mon_demon.qc new file mode 100644 index 00000000..a5d74f4e --- /dev/null +++ b/QC/orig_mon_demon.qc @@ -0,0 +1,373 @@ +/* +============================================================================== + +DEMON + +============================================================================== +*/ + +$cd id1/models/demon3 +$scale 0.8 +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +$frame run1 run2 run3 run4 run5 run6 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 +$frame leap11 leap12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 +$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 + +//============================================================================ + +void() demon1_stand1 =[ $stand1, demon1_stand2 ] {ai_stand();}; +void() demon1_stand2 =[ $stand2, demon1_stand3 ] {ai_stand();}; +void() demon1_stand3 =[ $stand3, demon1_stand4 ] {ai_stand();}; +void() demon1_stand4 =[ $stand4, demon1_stand5 ] {ai_stand();}; +void() demon1_stand5 =[ $stand5, demon1_stand6 ] {ai_stand();}; +void() demon1_stand6 =[ $stand6, demon1_stand7 ] {ai_stand();}; +void() demon1_stand7 =[ $stand7, demon1_stand8 ] {ai_stand();}; +void() demon1_stand8 =[ $stand8, demon1_stand9 ] {ai_stand();}; +void() demon1_stand9 =[ $stand9, demon1_stand10 ] {ai_stand();}; +void() demon1_stand10 =[ $stand10, demon1_stand11 ] {ai_stand();}; +void() demon1_stand11 =[ $stand11, demon1_stand12 ] {ai_stand();}; +void() demon1_stand12 =[ $stand12, demon1_stand13 ] {ai_stand();}; +void() demon1_stand13 =[ $stand13, demon1_stand1 ] {ai_stand();}; + +void() demon1_walk1 =[ $walk1, demon1_walk2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "demon/idle1.wav", 1, ATTN_IDLE); +ai_walk(8); +}; +void() demon1_walk2 =[ $walk2, demon1_walk3 ] {ai_walk(6);}; +void() demon1_walk3 =[ $walk3, demon1_walk4 ] {ai_walk(6);}; +void() demon1_walk4 =[ $walk4, demon1_walk5 ] {ai_walk(7);}; +void() demon1_walk5 =[ $walk5, demon1_walk6 ] {ai_walk(4);}; +void() demon1_walk6 =[ $walk6, demon1_walk7 ] {ai_walk(6);}; +void() demon1_walk7 =[ $walk7, demon1_walk8 ] {ai_walk(10);}; +void() demon1_walk8 =[ $walk8, demon1_walk1 ] {ai_walk(10);}; + +void() demon1_run1 =[ $run1, demon1_run2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "demon/idle1.wav", 1, ATTN_IDLE); +ai_run(20);}; +void() demon1_run2 =[ $run2, demon1_run3 ] {ai_run(15);}; +void() demon1_run3 =[ $run3, demon1_run4 ] {ai_run(36);}; +void() demon1_run4 =[ $run4, demon1_run5 ] {ai_run(20);}; +void() demon1_run5 =[ $run5, demon1_run6 ] {ai_run(15);}; +void() demon1_run6 =[ $run6, demon1_run1 ] {ai_run(36);}; + +void() demon1_jump1 =[ $leap1, demon1_jump2 ] {ai_face();}; +void() demon1_jump2 =[ $leap2, demon1_jump3 ] {ai_face();}; +void() demon1_jump3 =[ $leap3, demon1_jump4 ] {ai_face();}; +void() demon1_jump4 =[ $leap4, demon1_jump5 ] +{ + ai_face(); + + self.touch = Demon_JumpTouch; + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 600 + '0 0 250'; + if(self.flags & FL_ONGROUND) + self.flags = self.flags - FL_ONGROUND; +}; +void() demon1_jump5 =[ $leap5, demon1_jump6 ] {}; +void() demon1_jump6 =[ $leap6, demon1_jump7 ] {}; +void() demon1_jump7 =[ $leap7, demon1_jump8 ] {}; +void() demon1_jump8 =[ $leap8, demon1_jump9 ] {}; +void() demon1_jump9 =[ $leap9, demon1_jump10 ] {}; +void() demon1_jump10 =[ $leap10, demon1_jump1 ] { +self.nextthink = time + 3; +// if three seconds pass, assume demon is stuck and jump again +}; + +void() demon1_jump11 =[ $leap11, demon1_jump12 ] {}; +void() demon1_jump12 =[ $leap12, demon1_run1 ] {}; + + +void() demon1_atta1 =[ $attacka1, demon1_atta2 ] {ai_charge(4);}; +void() demon1_atta2 =[ $attacka2, demon1_atta3 ] {ai_charge(0);}; +void() demon1_atta3 =[ $attacka3, demon1_atta4 ] {ai_charge(0);}; +void() demon1_atta4 =[ $attacka4, demon1_atta5 ] {ai_charge(1);}; +void() demon1_atta5 =[ $attacka5, demon1_atta6 ] {ai_charge(2); Demon_Melee(200);}; +void() demon1_atta6 =[ $attacka6, demon1_atta7 ] {ai_charge(1);}; +void() demon1_atta7 =[ $attacka7, demon1_atta8 ] {ai_charge(6);}; +void() demon1_atta8 =[ $attacka8, demon1_atta9 ] {ai_charge(8);}; +void() demon1_atta9 =[ $attacka9, demon1_atta10] {ai_charge(4);}; +void() demon1_atta10 =[ $attacka10, demon1_atta11] {ai_charge(2);}; +void() demon1_atta11 =[ $attacka11, demon1_atta12] {Demon_Melee(-200);}; +void() demon1_atta12 =[ $attacka12, demon1_atta13] {ai_charge(5);}; +void() demon1_atta13 =[ $attacka13, demon1_atta14] {ai_charge(8);}; +void() demon1_atta14 =[ $attacka14, demon1_atta15] {ai_charge(4);}; +void() demon1_atta15 =[ $attacka15, demon1_run1] {ai_charge(4);}; + +void() demon1_pain1 =[ $pain1, demon1_pain2 ] {}; +void() demon1_pain2 =[ $pain2, demon1_pain3 ] {}; +void() demon1_pain3 =[ $pain3, demon1_pain4 ] {}; +void() demon1_pain4 =[ $pain4, demon1_pain5 ] {}; +void() demon1_pain5 =[ $pain5, demon1_pain6 ] {}; +void() demon1_pain6 =[ $pain6, demon1_run1 ] {}; + +void(entity attacker, float damage) demon1_pain = +{ + if(self.touch == Demon_JumpTouch) + return; + + if(self.pain_finished > time) + return; + + self.pain_finished = time + 1; + sound(self, CHAN_VOICE, "demon/dpain1.wav", 1, ATTN_NORM); + + if(random()*200 > damage) + return; // didn't flinch + + demon1_pain1(); +}; + +void() demon1_die1 =[ $death1, demon1_die2 ] { +sound(self, CHAN_VOICE, "demon/ddeath.wav", 1, ATTN_NORM);}; +void() demon1_die2 =[ $death2, demon1_die3 ] {}; +void() demon1_die3 =[ $death3, demon1_die4 ] {}; +void() demon1_die4 =[ $death4, demon1_die5 ] {}; +void() demon1_die5 =[ $death5, demon1_die6 ] {}; +void() demon1_die6 =[ $death6, demon1_die7 ] +{self.solid = SOLID_NOT;}; +void() demon1_die7 =[ $death7, demon1_die8 ] {}; +void() demon1_die8 =[ $death8, demon1_die9 ] {}; +void() demon1_die9 =[ $death9, demon1_die9 ] { monster_check_remove_corpse(); }; + +void() demon_die = +{ +// check for gib + if(self.health < -80) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_demon.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + return; + } + +// regular death + demon1_die1(); +}; + + +void() Demon_MeleeAttack = +{ + demon1_atta1(); +}; + + +/*QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 64) Ambush + +*/ +void() monster_demon1 = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/demon.mdl"); + precache_model("progs/h_demon.mdl"); + + precache_sound("demon/ddeath.wav"); + precache_sound("demon/dhit2.wav"); + precache_sound("demon/djump.wav"); + precache_sound("demon/dpain1.wav"); + precache_sound("demon/idle1.wav"); + precache_sound("demon/sight2.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + self.health = 300; + + self.th_stand = demon1_stand1; + self.th_walk = demon1_walk1; + self.th_run = demon1_run1; + self.th_die = demon_die; + self.th_melee = Demon_MeleeAttack; // one of two attacks + self.th_missile = demon1_jump1; // jump attack + self.th_pain = demon1_pain; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = demon1_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/demon.mdl"); + setsize(self, '-16 -16 -24', '16 16 24'); + + walkmonster_start(); +}; + + +/* +============================================================================== + +DEMON + +============================================================================== +*/ + +/* +============== +CheckDemonMelee + +Returns TRUE if a melee attack would hit right now +============== +*/ +float() CheckDemonMelee = +{ + if(enemy_range == RANGE_MELEE) + { // FIXME: check canreach + self.attack_state = AS_MELEE; + return TRUE; + } + return FALSE; +}; + +/* +============== +CheckDemonJump + +============== +*/ +float() CheckDemonJump = +{ + vector dist; + float d; + + if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) + return FALSE; + + if(self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) + return FALSE; + + dist = self.enemy.origin - self.origin; + dist_z = 0; + + d = vlen(dist); + + if(d < 100) + return FALSE; + + if(d > 200) + { + if(random() < 0.9) + return FALSE; + } + + return TRUE; +}; + +float() DemonCheckAttack = +{ + // if close enough for slashing, go for it + if(CheckDemonMelee ()) + { + self.attack_state = AS_MELEE; + return TRUE; + } + + if(CheckDemonJump ()) + { + self.attack_state = AS_MISSILE; + sound(self, CHAN_VOICE, "demon/djump.wav", 1, ATTN_NORM); + return TRUE; + } + + return FALSE; +}; + + +//=========================================================================== + +void(float side) Demon_Melee = +{ + float ldmg; + vector delta; + + ai_face(); + walkmove(self.ideal_yaw, 12); // allow a little closing + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + if(!CanDamage(self.enemy, self)) + return; + + sound(self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); + ldmg = 10 + 5*random(); + T_Damage(self.enemy, self, self, ldmg); + + makevectors(self.angles); + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); +}; + + +void() Demon_JumpTouch = +{ + float ldmg; + + if(self.health <= 0) + return; + + if(other.takedamage) + { + if(vlen(self.velocity) > 400) + { + ldmg = 40 + 10*random(); + T_Damage(other, self, self, ldmg); + } + } + + if(!checkbottom(self)) + { + if(self.flags & FL_ONGROUND) + { // jump randomly to not get hung up +//dprint("popjump\n"); + self.touch = SUB_Null; + self.think = demon1_jump1; + self.nextthink = time + 0.1; + +// self.velocity_x = (random() - 0.5) * 600; +// self.velocity_y = (random() - 0.5) * 600; +// self.velocity_z = 200; +// self.flags = self.flags - FL_ONGROUND; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = demon1_jump11; + self.nextthink = time + 0.1; +}; + diff --git a/QC/orig_mon_dog.qc b/QC/orig_mon_dog.qc new file mode 100644 index 00000000..a4060014 --- /dev/null +++ b/QC/orig_mon_dog.qc @@ -0,0 +1,370 @@ +/* +============================================================================== + +DOG + +============================================================================== +*/ +$cd id1/models/dog +$origin 0 0 24 +$base base +$skin skin + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +/* +================ +dog_bite + +================ +*/ +void() dog_bite = +{ +vector delta; +float ldmg; + + if(!self.enemy) + return; + + ai_charge(10); + + if(!CanDamage(self.enemy, self)) + return; + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + ldmg = (random() + random() + random()) * 8; + T_Damage(self.enemy, self, self, ldmg); +}; + +void() Dog_JumpTouch = +{ + float ldmg; + + if(self.health <= 0) + return; + + if(other.takedamage) + { + if(vlen(self.velocity) > 300) + { + ldmg = 10 + 10*random(); + T_Damage(other, self, self, ldmg); + } + } + + if(!checkbottom(self)) + { + if(self.flags & FL_ONGROUND) + { // jump randomly to not get hung up +//dprint("popjump\n"); + self.touch = SUB_Null; + self.think = dog_leap1; + self.nextthink = time + 0.1; + +// self.velocity_x = (random() - 0.5) * 600; +// self.velocity_y = (random() - 0.5) * 600; +// self.velocity_z = 200; +// self.flags = self.flags - FL_ONGROUND; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = dog_run1; + self.nextthink = time + 0.1; +}; + + +void() dog_stand1 =[ $stand1, dog_stand2 ] {ai_stand();}; +void() dog_stand2 =[ $stand2, dog_stand3 ] {ai_stand();}; +void() dog_stand3 =[ $stand3, dog_stand4 ] {ai_stand();}; +void() dog_stand4 =[ $stand4, dog_stand5 ] {ai_stand();}; +void() dog_stand5 =[ $stand5, dog_stand6 ] {ai_stand();}; +void() dog_stand6 =[ $stand6, dog_stand7 ] {ai_stand();}; +void() dog_stand7 =[ $stand7, dog_stand8 ] {ai_stand();}; +void() dog_stand8 =[ $stand8, dog_stand9 ] {ai_stand();}; +void() dog_stand9 =[ $stand9, dog_stand1 ] {ai_stand();}; + +void() dog_walk1 =[ $walk1 , dog_walk2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); +ai_walk(8);}; +void() dog_walk2 =[ $walk2 , dog_walk3 ] {ai_walk(8);}; +void() dog_walk3 =[ $walk3 , dog_walk4 ] {ai_walk(8);}; +void() dog_walk4 =[ $walk4 , dog_walk5 ] {ai_walk(8);}; +void() dog_walk5 =[ $walk5 , dog_walk6 ] {ai_walk(8);}; +void() dog_walk6 =[ $walk6 , dog_walk7 ] {ai_walk(8);}; +void() dog_walk7 =[ $walk7 , dog_walk8 ] {ai_walk(8);}; +void() dog_walk8 =[ $walk8 , dog_walk1 ] {ai_walk(8);}; + +void() dog_run1 =[ $run1 , dog_run2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); +ai_run(16);}; +void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(32);}; +void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);}; +void() dog_run4 =[ $run4 , dog_run5 ] {ai_run(20);}; +void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);}; +void() dog_run6 =[ $run6 , dog_run7 ] {ai_run(32);}; +void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(16);}; +void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);}; +void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);}; +void() dog_run10 =[ $run10 , dog_run11 ] {ai_run(20);}; +void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);}; +void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);}; + +void() dog_atta1 =[ $attack1, dog_atta2 ] {ai_charge(10);}; +void() dog_atta2 =[ $attack2, dog_atta3 ] {ai_charge(10);}; +void() dog_atta3 =[ $attack3, dog_atta4 ] {ai_charge(10);}; +void() dog_atta4 =[ $attack4, dog_atta5 ] { +sound(self, CHAN_VOICE, "dog/dattack1.wav", 1, ATTN_NORM); +dog_bite();}; +void() dog_atta5 =[ $attack5, dog_atta6 ] {ai_charge(10);}; +void() dog_atta6 =[ $attack6, dog_atta7 ] {ai_charge(10);}; +void() dog_atta7 =[ $attack7, dog_atta8 ] {ai_charge(10);}; +void() dog_atta8 =[ $attack8, dog_run1 ] {ai_charge(10);}; + +void() dog_leap1 =[ $leap1, dog_leap2 ] {ai_face();}; +void() dog_leap2 =[ $leap2, dog_leap3 ] +{ + ai_face(); + + self.touch = Dog_JumpTouch; + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 300 + '0 0 200'; + if(self.flags & FL_ONGROUND) + self.flags = self.flags - FL_ONGROUND; +}; + +void() dog_leap3 =[ $leap3, dog_leap4 ] {}; +void() dog_leap4 =[ $leap4, dog_leap5 ] {}; +void() dog_leap5 =[ $leap5, dog_leap6 ] {}; +void() dog_leap6 =[ $leap6, dog_leap7 ] {}; +void() dog_leap7 =[ $leap7, dog_leap8 ] {}; +void() dog_leap8 =[ $leap8, dog_leap9 ] {}; +void() dog_leap9 =[ $leap9, dog_leap9 ] {}; + +void() dog_pain1 =[ $pain1 , dog_pain2 ] {}; +void() dog_pain2 =[ $pain2 , dog_pain3 ] {}; +void() dog_pain3 =[ $pain3 , dog_pain4 ] {}; +void() dog_pain4 =[ $pain4 , dog_pain5 ] {}; +void() dog_pain5 =[ $pain5 , dog_pain6 ] {}; +void() dog_pain6 =[ $pain6 , dog_run1 ] {}; + +void() dog_painb1 =[ $painb1 , dog_painb2 ] {}; +void() dog_painb2 =[ $painb2 , dog_painb3 ] {}; +void() dog_painb3 =[ $painb3 , dog_painb4 ] {ai_pain(4);}; +void() dog_painb4 =[ $painb4 , dog_painb5 ] {ai_pain(12);}; +void() dog_painb5 =[ $painb5 , dog_painb6 ] {ai_pain(12);}; +void() dog_painb6 =[ $painb6 , dog_painb7 ] {ai_pain(2);}; +void() dog_painb7 =[ $painb7 , dog_painb8 ] {}; +void() dog_painb8 =[ $painb8 , dog_painb9 ] {ai_pain(4);}; +void() dog_painb9 =[ $painb9 , dog_painb10 ] {}; +void() dog_painb10 =[ $painb10 , dog_painb11 ] {ai_pain(10);}; +void() dog_painb11 =[ $painb11 , dog_painb12 ] {}; +void() dog_painb12 =[ $painb12 , dog_painb13 ] {}; +void() dog_painb13 =[ $painb13 , dog_painb14 ] {}; +void() dog_painb14 =[ $painb14 , dog_painb15 ] {}; +void() dog_painb15 =[ $painb15 , dog_painb16 ] {}; +void() dog_painb16 =[ $painb16 , dog_run1 ] {}; + +void(entity attacker, float damage) dog_pain = +{ + sound(self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM); + + if(random() > 0.5) + dog_pain1(); + else + dog_painb1(); +}; + +void() dog_die1 =[ $death1, dog_die2 ] {}; +void() dog_die2 =[ $death2, dog_die3 ] {}; +void() dog_die3 =[ $death3, dog_die4 ] {}; +void() dog_die4 =[ $death4, dog_die5 ] {}; +void() dog_die5 =[ $death5, dog_die6 ] {}; +void() dog_die6 =[ $death6, dog_die7 ] {}; +void() dog_die7 =[ $death7, dog_die8 ] {}; +void() dog_die8 =[ $death8, dog_die9 ] {}; +void() dog_die9 =[ $death9, dog_die9 ] { monster_check_remove_corpse(); }; + +void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {}; +void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {}; +void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {}; +void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {}; +void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {}; +void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {}; +void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {}; +void() dog_dieb8 =[ $deathb8, dog_dieb9 ] {}; +void() dog_dieb9 =[ $deathb9, dog_dieb9 ] { monster_check_remove_corpse(); }; + + +void() dog_die = +{ +// check for gib + if(self.health < -35) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib("progs/gib3.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + ThrowHead ("progs/h_dog.mdl", self.health); + return; + } + +// regular death + sound(self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; + + if(random() > 0.5) + dog_die1(); + else + dog_dieb1(); +}; + +//============================================================================ + +/* +============== +CheckDogMelee + +Returns TRUE if a melee attack would hit right now +============== +*/ +float() CheckDogMelee = +{ + if(enemy_range == RANGE_MELEE) + { // FIXME: check canreach + self.attack_state = AS_MELEE; + return TRUE; + } + return FALSE; +}; + +/* +============== +CheckDogJump + +============== +*/ +float() CheckDogJump = +{ + vector dist; + float d; + + if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) + return FALSE; + + if(self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) + return FALSE; + + dist = self.enemy.origin - self.origin; + dist_z = 0; + + d = vlen(dist); + + if(d < 80) + return FALSE; + + if(d > 150) + return FALSE; + + return TRUE; +}; + +float() DogCheckAttack = +{ + // if close enough for slashing, go for it + if(CheckDogMelee ()) + { + self.attack_state = AS_MELEE; + return TRUE; + } + + if(CheckDogJump ()) + { + self.attack_state = AS_MISSILE; + return TRUE; + } + + return FALSE; +}; + + +//=========================================================================== + +/*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush + +*/ +void() monster_dog = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/h_dog.mdl"); + precache_model("progs/dog.mdl"); + + precache_sound("dog/dattack1.wav"); + precache_sound("dog/ddeath.wav"); + precache_sound("dog/dpain1.wav"); + precache_sound("dog/dsight.wav"); + precache_sound("dog/idle.wav"); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + self.health = 25; + + self.th_stand = dog_stand1; + self.th_walk = dog_walk1; + self.th_run = dog_run1; + self.th_pain = dog_pain; + self.th_die = dog_die; + self.th_melee = dog_atta1; + self.th_missile = dog_leap1; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = dog_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/dog.mdl"); + setsize(self, '-12 -12 -24', '12 12 16'); + + walkmonster_start(); +}; diff --git a/QC/orig_mon_enforcer.qc b/QC/orig_mon_enforcer.qc new file mode 100644 index 00000000..cc665001 --- /dev/null +++ b/QC/orig_mon_enforcer.qc @@ -0,0 +1,398 @@ +/* +============================================================================== + +SOLDIER / PLAYER + +============================================================================== +*/ + +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 + + +void() Laser_Touch = +{ + vector org; + + if(other == self.owner) + return; // don't explode on owner + + if(pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + +//MED 01/16/97 added silent command + + if(!(self.spawnflags & SPAWNFLAG_SILENT)) + sound(self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + org = self.origin - 8*normalize(self.velocity); + + if(other.health) + { + SpawnBlood (org, self.velocity*0.2, 15); + T_Damage(other, self, self.owner, 15); + } + else + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_GUNSHOT); + WriteVec3(MSG_BROADCAST, org); + } + + remove(self); +}; + +entity(vector org, vector vec) LaunchLaser = +{ + entity newmis; + + if(self.classname == "monster_enforcer") + sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + vec = normalize(vec); + + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLY; + newmis.solid = SOLID_BBOX; + newmis.effects = EF_DIMLIGHT; + newmis.classname = "enforcer_laser"; + + setmodel(newmis, "progs/laser.mdl"); + setsize(newmis, '0 0 0', '0 0 0'); + + if(self.classname == "monster_morph") + { + if(!self.owner) + { + newmis.skin = 1; + } + } + + setorigin(newmis, org); + + newmis.velocity = vec * 600; + newmis.angles = vectoangles(newmis.velocity); + + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + newmis.touch = Laser_Touch; + + return newmis; +}; + + + +void() enforcer_fire = +{ + vector org; + + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors(self.angles); + + org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16'; + + LaunchLaser(org, self.enemy.origin - self.origin); +}; + +//============================================================================ + +void() enf_stand1 =[ $stand1, enf_stand2 ] {ai_stand();}; +void() enf_stand2 =[ $stand2, enf_stand3 ] {ai_stand();}; +void() enf_stand3 =[ $stand3, enf_stand4 ] {ai_stand();}; +void() enf_stand4 =[ $stand4, enf_stand5 ] {ai_stand();}; +void() enf_stand5 =[ $stand5, enf_stand6 ] {ai_stand();}; +void() enf_stand6 =[ $stand6, enf_stand7 ] {ai_stand();}; +void() enf_stand7 =[ $stand7, enf_stand1 ] {ai_stand();}; + +void() enf_walk1 =[ $walk1 , enf_walk2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE); +ai_walk(2);}; +void() enf_walk2 =[ $walk2 , enf_walk3 ] {ai_walk(4);}; +void() enf_walk3 =[ $walk3 , enf_walk4 ] {ai_walk(4);}; +void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3);}; +void() enf_walk5 =[ $walk5 , enf_walk6 ] {ai_walk(1);}; +void() enf_walk6 =[ $walk6 , enf_walk7 ] {ai_walk(2);}; +void() enf_walk7 =[ $walk7 , enf_walk8 ] {ai_walk(2);}; +void() enf_walk8 =[ $walk8 , enf_walk9 ] {ai_walk(1);}; +void() enf_walk9 =[ $walk9 , enf_walk10 ] {ai_walk(2);}; +void() enf_walk10 =[ $walk10, enf_walk11 ] {ai_walk(4);}; +void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);}; +void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);}; +void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);}; +void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);}; +void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);}; +void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);}; + +void() enf_run1 =[ $run1 , enf_run2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE); +ai_run(18);}; +void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14);}; +void() enf_run3 =[ $run3 , enf_run4 ] {ai_run(7);}; +void() enf_run4 =[ $run4 , enf_run5 ] {ai_run(12);}; +void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14);}; +void() enf_run6 =[ $run6 , enf_run7 ] {ai_run(14);}; +void() enf_run7 =[ $run7 , enf_run8 ] {ai_run(7);}; +void() enf_run8 =[ $run8 , enf_run1 ] {ai_run(11);}; + +void() enf_atk1 =[ $attack1, enf_atk2 ] {ai_face();}; +void() enf_atk2 =[ $attack2, enf_atk3 ] {ai_face();}; +void() enf_atk3 =[ $attack3, enf_atk4 ] {ai_face();}; +void() enf_atk4 =[ $attack4, enf_atk5 ] {ai_face();}; +void() enf_atk5 =[ $attack5, enf_atk6 ] {ai_face();}; +void() enf_atk6 =[ $attack6, enf_atk7 ] {enforcer_fire();}; +void() enf_atk7 =[ $attack7, enf_atk8 ] {ai_face();}; +void() enf_atk8 =[ $attack8, enf_atk9 ] {ai_face();}; +void() enf_atk9 =[ $attack5, enf_atk10 ] {ai_face();}; +void() enf_atk10 =[ $attack6, enf_atk11 ] {enforcer_fire();}; +void() enf_atk11 =[ $attack7, enf_atk12 ] {ai_face();}; +void() enf_atk12 =[ $attack8, enf_atk13 ] {ai_face();}; +void() enf_atk13 =[ $attack9, enf_atk14 ] {ai_face();}; +void() enf_atk14 =[ $attack10, enf_run1 ] {ai_face(); +SUB_CheckRefire (enf_atk1); +}; + +void() enf_paina1 =[ $paina1, enf_paina2 ] {}; +void() enf_paina2 =[ $paina2, enf_paina3 ] {}; +void() enf_paina3 =[ $paina3, enf_paina4 ] {}; +void() enf_paina4 =[ $paina4, enf_run1 ] {}; + +void() enf_painb1 =[ $painb1, enf_painb2 ] {}; +void() enf_painb2 =[ $painb2, enf_painb3 ] {}; +void() enf_painb3 =[ $painb3, enf_painb4 ] {}; +void() enf_painb4 =[ $painb4, enf_painb5 ] {}; +void() enf_painb5 =[ $painb5, enf_run1 ] {}; + +void() enf_painc1 =[ $painc1, enf_painc2 ] {}; +void() enf_painc2 =[ $painc2, enf_painc3 ] {}; +void() enf_painc3 =[ $painc3, enf_painc4 ] {}; +void() enf_painc4 =[ $painc4, enf_painc5 ] {}; +void() enf_painc5 =[ $painc5, enf_painc6 ] {}; +void() enf_painc6 =[ $painc6, enf_painc7 ] {}; +void() enf_painc7 =[ $painc7, enf_painc8 ] {}; +void() enf_painc8 =[ $painc8, enf_run1 ] {}; + +void() enf_paind1 =[ $paind1, enf_paind2 ] {}; +void() enf_paind2 =[ $paind2, enf_paind3 ] {}; +void() enf_paind3 =[ $paind3, enf_paind4 ] {}; +void() enf_paind4 =[ $paind4, enf_paind5 ] {ai_painforward(2);}; +void() enf_paind5 =[ $paind5, enf_paind6 ] {ai_painforward(1);}; +void() enf_paind6 =[ $paind6, enf_paind7 ] {}; +void() enf_paind7 =[ $paind7, enf_paind8 ] {}; +void() enf_paind8 =[ $paind8, enf_paind9 ] {}; +void() enf_paind9 =[ $paind9, enf_paind10 ] {}; +void() enf_paind10 =[ $paind10, enf_paind11 ] {}; +void() enf_paind11 =[ $paind11, enf_paind12 ] {ai_painforward(1);}; +void() enf_paind12 =[ $paind12, enf_paind13 ] {ai_painforward(1);}; +void() enf_paind13 =[ $paind13, enf_paind14 ] {ai_painforward(1);}; +void() enf_paind14 =[ $paind14, enf_paind15 ] {}; +void() enf_paind15 =[ $paind15, enf_paind16 ] {}; +void() enf_paind16 =[ $paind16, enf_paind17 ] {ai_pain(1);}; +void() enf_paind17 =[ $paind17, enf_paind18 ] {ai_pain(1);}; +void() enf_paind18 =[ $paind18, enf_paind19 ] {}; +void() enf_paind19 =[ $paind19, enf_run1 ] {}; + +void(entity attacker, float damage) enf_pain = +{ + float r; + + r = random(); + if(self.pain_finished > time) + return; + + + if(r < 0.5) + sound(self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "enforcer/pain2.wav", 1, ATTN_NORM); + + if(r < 0.2) + { + self.pain_finished = time + 1; + enf_paina1(); + } + else if(r < 0.4) + { + self.pain_finished = time + 1; + enf_painb1(); + } + else if(r < 0.7) + { + self.pain_finished = time + 1; + enf_painc1(); + } + else + { + self.pain_finished = time + 2; + enf_paind1(); + } +}; + +//============================================================================ + +void() EnforcerDrop = +{ + entity entPlayer; + entPlayer = FindEntPlayerForDrop(); + + self.solid = SOLID_NOT; + self.ammo_cells = 5; + DropBackpack(); + + if(entPlayer != world && ShouldDropEnemyWpn(0.45)) + { + if(!TryEnemyDrop(self, entPlayer, WID_NAILGUN, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_NAILGUN, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_LASER_CANNON, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_LIGHTNING, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_AXE, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_SHOTGUN, 0.2)) + if(!TryEnemyDrop(self, entPlayer, WID_SHOTGUN, 0.2)) + { /* Intentionally empty. */ } + } +} + + +void() enf_die1 =[ $death1, enf_die2 ] {}; +void() enf_die2 =[ $death2, enf_die3 ] {}; +void() enf_die3 =[ $death3, enf_die4 ] +{EnforcerDrop();}; +void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);}; +void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);}; +void() enf_die6 =[ $death6, enf_die7 ] {}; +void() enf_die7 =[ $death7, enf_die8 ] {}; +void() enf_die8 =[ $death8, enf_die9 ] {}; +void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);}; +void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);}; +void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);}; +void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);}; +void() enf_die13 =[ $death13, enf_die14 ] {}; +void() enf_die14 =[ $death14, enf_die14 ] { monster_check_remove_corpse(); }; + +void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] { + +}; +void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {}; +void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] +{EnforcerDrop();}; +void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {}; +void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {}; +void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {}; +void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {}; +void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {}; +void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {}; +void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {}; +void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] { monster_check_remove_corpse(); }; + + +void() enf_die = +{ +// check for gib + if(self.health < -35) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_mega.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + EnforcerDrop(); + return; + } + +// regular death + sound(self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + if(random() > 0.5) + enf_die1(); + else + enf_fdie1(); +}; + + +/*QUAKED monster_enforcer (1 0 0) (-16 -16 -24) (16 16 40) Ambush + +*/ +void() monster_enforcer = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model2("progs/enforcer.mdl"); + precache_model2("progs/h_mega.mdl"); + precache_model2("progs/laser.mdl"); + + precache_sound2("enforcer/death1.wav"); + precache_sound2("enforcer/enfire.wav"); + precache_sound2("enforcer/enfstop.wav"); + precache_sound2("enforcer/idle1.wav"); + precache_sound2("enforcer/pain1.wav"); + precache_sound2("enforcer/pain2.wav"); + precache_sound2("enforcer/sight1.wav"); + precache_sound2("enforcer/sight2.wav"); + precache_sound2("enforcer/sight3.wav"); + precache_sound2("enforcer/sight4.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + self.health = 80; + + self.th_stand = enf_stand1; + self.th_walk = enf_walk1; + self.th_run = enf_run1; + self.th_pain = enf_pain; + self.th_die = enf_die; + self.th_missile = enf_atk1; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = enforcer_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/enforcer.mdl"); + setsize(self, '-14 -14 -24', '14 14 28'); + + walkmonster_start(); +}; diff --git a/QC/orig_mon_fish.qc b/QC/orig_mon_fish.qc new file mode 100644 index 00000000..3fb61169 --- /dev/null +++ b/QC/orig_mon_fish.qc @@ -0,0 +1,223 @@ +$cd id1/models/fish +$origin 0 0 24 +$base base +$skin skin + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 attack11 attack12 attack13 +$frame attack14 attack15 attack16 attack17 attack18 + +$frame death1 death2 death3 death4 death5 death6 death7 +$frame death8 death9 death10 death11 death12 death13 death14 death15 +$frame death16 death17 death18 death19 death20 death21 + +$frame swim1 swim2 swim3 swim4 swim5 swim6 swim7 swim8 +$frame swim9 swim10 swim11 swim12 swim13 swim14 swim15 swim16 swim17 +$frame swim18 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 +$frame pain9 + +void() f_stand1 =[ $swim1, f_stand2 ] {ai_stand();}; +void() f_stand2 =[ $swim2, f_stand3 ] {ai_stand();}; +void() f_stand3 =[ $swim3, f_stand4 ] {ai_stand();}; +void() f_stand4 =[ $swim4, f_stand5 ] {ai_stand();}; +void() f_stand5 =[ $swim5, f_stand6 ] {ai_stand();}; +void() f_stand6 =[ $swim6, f_stand7 ] {ai_stand();}; +void() f_stand7 =[ $swim7, f_stand8 ] {ai_stand();}; +void() f_stand8 =[ $swim8, f_stand9 ] {ai_stand();}; +void() f_stand9 =[ $swim9, f_stand10 ] {ai_stand();}; +void() f_stand10 =[ $swim10, f_stand11 ] {ai_stand();}; +void() f_stand11 =[ $swim11, f_stand12 ] {ai_stand();}; +void() f_stand12 =[ $swim12, f_stand13 ] {ai_stand();}; +void() f_stand13 =[ $swim13, f_stand14 ] {ai_stand();}; +void() f_stand14 =[ $swim14, f_stand15 ] {ai_stand();}; +void() f_stand15 =[ $swim15, f_stand16 ] {ai_stand();}; +void() f_stand16 =[ $swim16, f_stand17 ] {ai_stand();}; +void() f_stand17 =[ $swim17, f_stand18 ] {ai_stand();}; +void() f_stand18 =[ $swim18, f_stand1 ] {ai_stand();}; + +void() f_walk1 =[ $swim1, f_walk2 ] {ai_walk(8);}; +void() f_walk2 =[ $swim2, f_walk3 ] {ai_walk(8);}; +void() f_walk3 =[ $swim3, f_walk4 ] {ai_walk(8);}; +void() f_walk4 =[ $swim4, f_walk5 ] {ai_walk(8);}; +void() f_walk5 =[ $swim5, f_walk6 ] {ai_walk(8);}; +void() f_walk6 =[ $swim6, f_walk7 ] {ai_walk(8);}; +void() f_walk7 =[ $swim7, f_walk8 ] {ai_walk(8);}; +void() f_walk8 =[ $swim8, f_walk9 ] {ai_walk(8);}; +void() f_walk9 =[ $swim9, f_walk10 ] {ai_walk(8);}; +void() f_walk10 =[ $swim10, f_walk11 ] {ai_walk(8);}; +void() f_walk11 =[ $swim11, f_walk12 ] {ai_walk(8);}; +void() f_walk12 =[ $swim12, f_walk13 ] {ai_walk(8);}; +void() f_walk13 =[ $swim13, f_walk14 ] {ai_walk(8);}; +void() f_walk14 =[ $swim14, f_walk15 ] {ai_walk(8);}; +void() f_walk15 =[ $swim15, f_walk16 ] {ai_walk(8);}; +void() f_walk16 =[ $swim16, f_walk17 ] {ai_walk(8);}; +void() f_walk17 =[ $swim17, f_walk18 ] {ai_walk(8);}; +void() f_walk18 =[ $swim18, f_walk1 ] {ai_walk(8);}; + +void() f_run1 =[ $swim1, f_run2 ] {ai_run(12); + if(random() < 0.5) + sound(self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM); +}; +void() f_run2 =[ $swim3, f_run3 ] {ai_run(12);}; +void() f_run3 =[ $swim5, f_run4 ] {ai_run(12);}; +void() f_run4 =[ $swim7, f_run5 ] {ai_run(12);}; +void() f_run5 =[ $swim9, f_run6 ] {ai_run(12);}; +void() f_run6 =[ $swim11, f_run7 ] {ai_run(12);}; +void() f_run7 =[ $swim13, f_run8 ] {ai_run(12);}; +void() f_run8 =[ $swim15, f_run9 ] {ai_run(12);}; +void() f_run9 =[ $swim17, f_run1 ] {ai_run(12);}; + +void() fish_melee = +{ + vector delta; + float ldmg; + + if(!self.enemy) + return; // removed before stroke + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 60) + return; + + sound(self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM); + ldmg = (random() + random()) * 3; + T_Damage(self.enemy, self, self, ldmg); +}; + +void() f_attack1 =[ $attack1, f_attack2 ] {ai_charge(10);}; +void() f_attack2 =[ $attack2, f_attack3 ] {ai_charge(10);}; +void() f_attack3 =[ $attack3, f_attack4 ] {fish_melee();}; +void() f_attack4 =[ $attack4, f_attack5 ] {ai_charge(10);}; +void() f_attack5 =[ $attack5, f_attack6 ] {ai_charge(10);}; +void() f_attack6 =[ $attack6, f_attack7 ] {ai_charge(10);}; +void() f_attack7 =[ $attack7, f_attack8 ] {ai_charge(10);}; +void() f_attack8 =[ $attack8, f_attack9 ] {ai_charge(10);}; +void() f_attack9 =[ $attack9, f_attack10] {fish_melee();}; +void() f_attack10 =[ $attack10, f_attack11] {ai_charge(10);}; +void() f_attack11 =[ $attack11, f_attack12] {ai_charge(10);}; +void() f_attack12 =[ $attack12, f_attack13] {ai_charge(10);}; +void() f_attack13 =[ $attack13, f_attack14] {ai_charge(10);}; +void() f_attack14 =[ $attack14, f_attack15] {ai_charge(10);}; +void() f_attack15 =[ $attack15, f_attack16] {fish_melee();}; +void() f_attack16 =[ $attack16, f_attack17] {ai_charge(10);}; +void() f_attack17 =[ $attack17, f_attack18] {ai_charge(10);}; +void() f_attack18 =[ $attack18, f_run1 ] {ai_charge(10);}; + +void() f_death1 =[ $death1, f_death2 ] { +sound(self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM); +}; +void() f_death2 =[ $death2, f_death3 ] {}; +void() f_death3 =[ $death3, f_death4 ] {}; +void() f_death4 =[ $death4, f_death5 ] {}; +//MED 01/15/97 moved solid to here +void() f_death5 =[ $death5, f_death6 ] {self.solid = SOLID_NOT;}; +void() f_death6 =[ $death6, f_death7 ] {}; +void() f_death7 =[ $death7, f_death8 ] {}; +void() f_death8 =[ $death8, f_death9 ] {}; +void() f_death9 =[ $death9, f_death10 ] {}; +void() f_death10 =[ $death10, f_death11 ] {}; +void() f_death11 =[ $death11, f_death12 ] {}; +void() f_death12 =[ $death12, f_death13 ] {}; +void() f_death13 =[ $death13, f_death14 ] {}; +void() f_death14 =[ $death14, f_death15 ] {}; +void() f_death15 =[ $death15, f_death16 ] {}; +void() f_death16 =[ $death16, f_death17 ] {}; +void() f_death17 =[ $death17, f_death18 ] {}; +void() f_death18 =[ $death18, f_death19 ] {}; +void() f_death19 =[ $death19, f_death20 ] {}; +void() f_death20 =[ $death20, f_death21 ] {}; +//MED 01/15/97 removed solid from here +//void() f_death21 =[ $death21, f_death21 ] {self.solid = SOLID_NOT;}; +void() f_death21 =[ $death21, f_death21 ] {monster_check_remove_corpse();}; + +//MED 01/15/97 added fish_die +void() fish_die = +{ +// check for gib + if(self.health < -20) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + self.think = SUB_Remove; + self.nextthink= time + 0.1; + return; + } + +// regular death + f_death1(); +}; + +void() f_pain1 =[ $pain1, f_pain2 ] {}; +void() f_pain2 =[ $pain2, f_pain3 ] {ai_pain(6);}; +void() f_pain3 =[ $pain3, f_pain4 ] {ai_pain(6);}; +void() f_pain4 =[ $pain4, f_pain5 ] {ai_pain(6);}; +void() f_pain5 =[ $pain5, f_pain6 ] {ai_pain(6);}; +void() f_pain6 =[ $pain6, f_pain7 ] {ai_pain(6);}; +void() f_pain7 =[ $pain7, f_pain8 ] {ai_pain(6);}; +void() f_pain8 =[ $pain8, f_pain9 ] {ai_pain(6);}; +void() f_pain9 =[ $pain9, f_run1 ] {ai_pain(6);}; + +void(entity attacker, float damage) fish_pain = +{ + +// fish allways do pain frames + f_pain1(); +}; + + + +/*QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) Ambush +*/ +void() monster_fish = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model2("progs/fish.mdl"); + + precache_sound2("fish/death.wav"); + precache_sound2("fish/bite.wav"); + precache_sound2("fish/idle.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + + self.health = 25; + + self.th_stand = f_stand1; + self.th_walk = f_walk1; + self.th_run = f_run1; +//MED 01/15/97 added fish death + self.th_die = fish_die; + self.th_pain = fish_pain; + self.th_melee = f_attack1; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = fish_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/fish.mdl"); + + // TODO VR: (P2) tweak hitbox + setsize(self, '-16 -16 -24', '16 16 24'); + + swimmonster_start(); +}; diff --git a/QC/orig_mon_hknight.qc b/QC/orig_mon_hknight.qc new file mode 100644 index 00000000..da9241f7 --- /dev/null +++ b/QC/orig_mon_hknight.qc @@ -0,0 +1,556 @@ +/* +============================================================================== + +KNIGHT + +============================================================================== +*/ + +$cd id1/models/knight2 +// TODO VR: (P2) rogue +// $cd /raid/quake/id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin +$skin statue2 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +void(float offset) hknight_shot = +{ + vector offang; + vector org, vec; + entity newmis; + + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 6; + + makevectors(offang); + + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + +// set missile speed + vec = normalize(v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + + newmis = launch_spike (org, vec); + newmis.classname = "knightspike"; + setmodel(newmis, "progs/k_spike.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vec*300; + sound(self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); +}; + +void() CheckForCharge = +{ +// check for mad charge +if(!enemy_vis) + return; +if(time < self.attack_finished) + return; +if(fabs(self.origin_z - self.enemy.origin_z) > 20) + return; // too much height change +if(vlen(self.origin - self.enemy.origin) < 80) + return; // use regular attack + +// charge + SUB_AttackFinished (2); + hknight_char_a1(); + +}; + +void() CheckContinueCharge = +{ + if(time > self.attack_finished) + { + SUB_AttackFinished (3); + hknight_run1(); + return; // done charging + } + if(random() > 0.5) + sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + else + sound(self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +}; + +//=========================================================================== + +void() hknight_stand1 =[ $stand1, hknight_stand2 ] {ai_stand();}; +void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();}; +void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();}; +void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();}; +void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();}; +void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();}; +void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();}; +void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();}; +void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();}; + +//=========================================================================== + +void() hknight_walk1 =[ $walk1, hknight_walk2 ] { +hk_idle_sound(); +ai_walk(2);}; +void() hknight_walk2 =[ $walk2, hknight_walk3 ] {ai_walk(5);}; +void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);}; +void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);}; +void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);}; +void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);}; +void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);}; +void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);}; +void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);}; +void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);}; +void() hknight_walk11 =[ $walk11, hknight_walk12 ] {ai_walk(3);}; +void() hknight_walk12 =[ $walk12, hknight_walk13 ] {ai_walk(4);}; +void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);}; +void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);}; +void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);}; +void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);}; +void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);}; +void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);}; +void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);}; +void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);}; + +//=========================================================================== + +void() hknight_run1 =[ $run1, hknight_run2 ] { +hk_idle_sound(); +ai_run (20); CheckForCharge(); }; +void() hknight_run2 =[ $run2, hknight_run3 ] {ai_run(25);}; +void() hknight_run3 =[ $run3, hknight_run4 ] {ai_run(18);}; +void() hknight_run4 =[ $run4, hknight_run5 ] {ai_run(16);}; +void() hknight_run5 =[ $run5, hknight_run6 ] {ai_run(14);}; +void() hknight_run6 =[ $run6, hknight_run7 ] {ai_run(25);}; +void() hknight_run7 =[ $run7, hknight_run8 ] {ai_run(21);}; +void() hknight_run8 =[ $run8, hknight_run1 ] {ai_run(13);}; + +//============================================================================ + +void() hknight_pain1 =[ $pain1, hknight_pain2 ] + { + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/pain.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM); + }; +void() hknight_pain2 =[ $pain2, hknight_pain3 ] {}; +void() hknight_pain3 =[ $pain3, hknight_pain4 ] {}; +void() hknight_pain4 =[ $pain4, hknight_pain5 ] {}; +void() hknight_pain5 =[ $pain5, hknight_run1 ] {}; + +//============================================================================ + +void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);}; +void() hknight_die2 =[ $death2, hknight_die3 ] {ai_forward(8);}; +void() hknight_die3 =[ $death3, hknight_die4 ] +{self.solid = SOLID_NOT; ai_forward(7);}; +void() hknight_die4 =[ $death4, hknight_die5 ] {}; +void() hknight_die5 =[ $death5, hknight_die6 ] {}; +void() hknight_die6 =[ $death6, hknight_die7 ] {}; +void() hknight_die7 =[ $death7, hknight_die8 ] {}; +void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);}; +void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);}; +void() hknight_die10 =[ $death10, hknight_die11 ] {}; +void() hknight_die11 =[ $death11, hknight_die12 ] {}; +void() hknight_die12 =[ $death12, hknight_die12 ] {monster_check_remove_corpse();}; + +void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {}; +void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {}; +void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] +{self.solid = SOLID_NOT;}; +void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {}; +void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {}; +void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {}; +void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {}; +void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {}; +void() hknight_dieb9 =[ $deathb9, hknight_dieb9 ] {monster_check_remove_corpse();}; + +void() hknight_die = +{ + // check for gib + if(self.health < -40) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead("progs/h_hellkn.mdl", self.health); + + if(self.spawnflags & 2) // statue + { + ThrowGib("progs/statgib1.mdl", self.health); + ThrowGib("progs/statgib2.mdl", self.health); + ThrowGib("progs/statgib3.mdl", self.health); + } + else + { + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + } + + return; + } + + // regular death + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/death.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + + if(random() > 0.5) + hknight_die1(); + else + hknight_dieb1(); +}; + + +//============================================================================ + +void() hknight_magica1 =[ $magica1, hknight_magica2 ] {ai_face();}; +void() hknight_magica2 =[ $magica2, hknight_magica3 ] {ai_face();}; +void() hknight_magica3 =[ $magica3, hknight_magica4 ] {ai_face();}; +void() hknight_magica4 =[ $magica4, hknight_magica5 ] {ai_face();}; +void() hknight_magica5 =[ $magica5, hknight_magica6 ] {ai_face();}; +void() hknight_magica6 =[ $magica6, hknight_magica7 ] {ai_face();}; +void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);}; +void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);}; +void() hknight_magica9 =[ $magica9, hknight_magica10] {hknight_shot(0);}; +void() hknight_magica10 =[ $magica10, hknight_magica11] {hknight_shot(1);}; +void() hknight_magica11 =[ $magica11, hknight_magica12] {hknight_shot(2);}; +void() hknight_magica12 =[ $magica12, hknight_magica13] {hknight_shot(3);}; +void() hknight_magica13 =[ $magica13, hknight_magica14] {ai_face();}; +void() hknight_magica14 =[ $magica14, hknight_run1 ] {ai_face();}; + +//============================================================================ + +void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {ai_face();}; +void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {ai_face();}; +void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {ai_face();}; +void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {ai_face();}; +void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {ai_face();}; +void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {ai_face();}; +void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);}; +void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);}; +void() hknight_magicb9 =[ $magicb9, hknight_magicb10] {hknight_shot(0);}; +void() hknight_magicb10 =[ $magicb10, hknight_magicb11] {hknight_shot(1);}; +void() hknight_magicb11 =[ $magicb11, hknight_magicb12] {hknight_shot(2);}; +void() hknight_magicb12 =[ $magicb12, hknight_magicb13] {hknight_shot(3);}; +void() hknight_magicb13 =[ $magicb13, hknight_run1] {ai_face();}; + +//============================================================================ + +void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {ai_face();}; +void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {ai_face();}; +void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {ai_face();}; +void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {ai_face();}; +void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {ai_face();}; +void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2);}; +void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1);}; +void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0);}; +void() hknight_magicc9 =[ $magicc9, hknight_magicc10] {hknight_shot(1);}; +void() hknight_magicc10 =[ $magicc10, hknight_magicc11] {hknight_shot(2);}; +void() hknight_magicc11 =[ $magicc11, hknight_run1] {hknight_shot(3);}; + +//=========================================================================== + +void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] {ai_charge(20);}; +void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {ai_charge(25);}; +void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {ai_charge(18);}; +void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] {ai_charge(16);}; +void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {ai_charge(14);}; +void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {ai_charge(20); ai_melee();}; +void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {ai_charge(21); ai_melee();}; +void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {ai_charge(13); ai_melee();}; +void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {ai_charge(20); ai_melee();}; +void() hknight_char_a10=[ $char_a10, hknight_char_a11 ] {ai_charge(20); ai_melee();}; +void() hknight_char_a11=[ $char_a11, hknight_char_a12 ] {ai_charge(18); ai_melee();}; +void() hknight_char_a12=[ $char_a12, hknight_char_a13 ] {ai_charge(16);}; +void() hknight_char_a13=[ $char_a13, hknight_char_a14 ] {ai_charge(14);}; +void() hknight_char_a14=[ $char_a14, hknight_char_a15 ] {ai_charge(25);}; +void() hknight_char_a15=[ $char_a15, hknight_char_a16 ] {ai_charge(21);}; +void() hknight_char_a16=[ $char_a16, hknight_run1 ] {ai_charge(13);}; + +//=========================================================================== + +void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] +{CheckContinueCharge(); ai_charge(23); ai_melee();}; +void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {ai_charge(17); ai_melee();}; +void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {ai_charge(12); ai_melee();}; +void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {ai_charge(22); ai_melee();}; +void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {ai_charge(18); ai_melee();}; +void() hknight_char_b6 =[ $char_b6, hknight_char_b1 ] {ai_charge(8); ai_melee();}; + +//=========================================================================== + +void() hknight_slice1 =[ $slice1, hknight_slice2 ] {ai_charge(9);}; +void() hknight_slice2 =[ $slice2, hknight_slice3 ] {ai_charge(6);}; +void() hknight_slice3 =[ $slice3, hknight_slice4 ] {ai_charge(13);}; +void() hknight_slice4 =[ $slice4, hknight_slice5 ] {ai_charge(4);}; +void() hknight_slice5 =[ $slice5, hknight_slice6 ] {ai_charge(7); ai_melee();}; +void() hknight_slice6 =[ $slice6, hknight_slice7 ] {ai_charge(15); ai_melee();}; +void() hknight_slice7 =[ $slice7, hknight_slice8 ] {ai_charge(8); ai_melee();}; +void() hknight_slice8 =[ $slice8, hknight_slice9 ] {ai_charge(2); ai_melee();}; +void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();}; +void() hknight_slice10 =[ $slice10, hknight_run1 ] {ai_charge(3);}; + +//=========================================================================== + +void() hknight_smash1 =[ $smash1, hknight_smash2 ] {ai_charge(1);}; +void() hknight_smash2 =[ $smash2, hknight_smash3 ] {ai_charge(13);}; +void() hknight_smash3 =[ $smash3, hknight_smash4 ] {ai_charge(9);}; +void() hknight_smash4 =[ $smash4, hknight_smash5 ] {ai_charge(11);}; +void() hknight_smash5 =[ $smash5, hknight_smash6 ] {ai_charge(10); ai_melee();}; +void() hknight_smash6 =[ $smash6, hknight_smash7 ] {ai_charge(7); ai_melee();}; +void() hknight_smash7 =[ $smash7, hknight_smash8 ] {ai_charge(12); ai_melee();}; +void() hknight_smash8 =[ $smash8, hknight_smash9 ] {ai_charge(2); ai_melee();}; +void() hknight_smash9 =[ $smash9, hknight_smash10 ] {ai_charge(3); ai_melee();}; +void() hknight_smash10 =[ $smash10, hknight_smash11 ] {ai_charge(0);}; +void() hknight_smash11 =[ $smash11, hknight_run1 ] {ai_charge(0);}; + +//============================================================================ + +void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {ai_charge(2);}; +void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {ai_charge(0);}; +void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {ai_charge(0);}; +void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {ai_melee();}; +void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_melee();}; +void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_melee();}; +void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {ai_charge(1);}; +void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {ai_charge(4);}; +void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {ai_charge(5);}; +void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {ai_charge(3); ai_melee();}; +void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {ai_charge(2); ai_melee();}; +void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {ai_charge(2); ai_melee();}; +void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {ai_charge(0);}; +void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {ai_charge(0);}; +void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {ai_charge(0);}; +void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {ai_charge(1);}; +void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {ai_charge(1); ai_melee();}; +void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {ai_charge(3); ai_melee();}; +void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {ai_charge(4); ai_melee();}; +void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {ai_charge(6);}; +void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {ai_charge(7);}; +void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {ai_charge(3);}; + +//============================================================================ + +void() hk_idle_sound = +{ + if(random() < 0.2) + { + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/idle.wav", 1, ATTN_IDLE); + else + sound(self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + } +}; + +void(entity attacker, float damage) hknight_pain = +{ + if(self.pain_finished > time) + return; + + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/pain.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM); + + if(time - self.pain_finished > 5) + { // allways go into pain frame if it has been a while + hknight_pain1(); + self.pain_finished = time + 1; + return; + } + + if((random()*30 > damage)) + return; // didn't flinch + + self.pain_finished = time + 1; + hknight_pain1(); +}; + +float hknight_type; + +void() hknight_melee = +{ + hknight_type = hknight_type + 1; + + sound(self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); + if(hknight_type == 1) + hknight_slice1(); + else if(hknight_type == 2) + hknight_smash1(); + else if(hknight_type == 3) + { + hknight_watk1(); + hknight_type = 0; + } +}; + +void() hknight_pause = +{ + sound(self, CHAN_VOICE, "statue/see.wav", 1, ATTN_NORM); + + self.takedamage = DAMAGE_AIM; + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = hknight_run1; + self.th_melee = hknight_melee; + self.th_missile = hknight_magicc1; + self.th_pain = hknight_pain; + self.th_die = hknight_die; + self.use = SUB_Null; + + self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + + self.delay = 0; +}; + +void() hknight_pause1 = +{ + self.takedamage = DAMAGE_NO; + self.use = hknight_pause; + self.think = hknight_pause1; + self.nextthink = time + 0.1; +}; + +/*QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush Statue + +Statue - select this to use the stone skin and have him frozen in place. + +delay: time from sight to attack (default 5) +frame: frame to be frozen in. (default 73) +*/ +void() monster_hell_knight = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model2("progs/hknight.mdl"); + precache_model2("progs/k_spike.mdl"); + precache_model2("progs/h_hellkn.mdl"); + + if(self.spawnflags & 2) // statue + { + precache_model("progs/statgib1.mdl"); + precache_model("progs/statgib2.mdl"); + precache_model("progs/statgib3.mdl"); + precache_sound("statue/see.wav"); + precache_sound("statue/idle.wav"); + precache_sound("statue/pain.wav"); + precache_sound("statue/death.wav"); + } + else + { + precache_sound2("hknight/death1.wav"); + precache_sound2("hknight/pain1.wav"); + precache_sound2("hknight/sight1.wav"); + precache_sound2("hknight/idle.wav"); + + } + + precache_sound2("hknight/attack1.wav"); + precache_sound("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound2("hknight/slash1.wav"); + precache_sound2("hknight/grunt.wav"); + + precache_sound("knight/sword1.wav"); + precache_sound("knight/sword2.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + self.health = 250; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = hell_knight_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/hknight.mdl"); + setsize(self, '-12 -12 -24', '12 12 36'); + + if(self.spawnflags & 2) // statue + { + if(self.frame == 0) + self.frame = 73; + self.skin = 1; + + if(!self.targetname) + { + dprint("statue not targeted\n"); + dprint(self.classname); + dprint(" at "); + dprint(vtos(self.origin)); + dprint("\n"); + return; + } + + self.use = hknight_pause; + self.th_stand = hknight_pause1; + self.th_walk = hknight_pause1; + self.th_run = hknight_pause1; + + walkmonster_start(); + } + else + { + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = hknight_run1; + self.th_melee = hknight_melee; + self.th_missile = hknight_magicc1; + self.th_pain = hknight_pain; + self.th_die = hknight_die; + + walkmonster_start(); + } +}; diff --git a/QC/orig_mon_knight.qc b/QC/orig_mon_knight.qc new file mode 100644 index 00000000..3b05e3d3 --- /dev/null +++ b/QC/orig_mon_knight.qc @@ -0,0 +1,391 @@ +/* +============================================================================== + +KNIGHT + +============================================================================== +*/ + +$cd id1/models/knight +// TODO VR: (P2) rogue +// $cd /raid/quake/id1/models/knight +$origin 0 0 24 +$base base +$skin badass3 +$skin statue + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8 + +//frame runc1 runc2 runc3 runc4 runc5 runc6 + +$frame runattack1 runattack2 runattack3 runattack4 runattack5 +$frame runattack6 runattack7 runattack8 runattack9 runattack10 +$frame runattack11 + +$frame pain1 pain2 pain3 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 +$frame painb10 painb11 + +//frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 +//frame attack8 attack9 attack10 attack11 + +$frame attackb1 attackb2 attackb3 attackb4 attackb5 +$frame attackb6 attackb7 attackb8 attackb9 attackb10 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +$frame kneel1 kneel2 kneel3 kneel4 kneel5 + +$frame standing2 standing3 standing4 standing5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 + +void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();}; +void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();}; +void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();}; +void() knight_stand4 =[ $stand4, knight_stand5 ] {ai_stand();}; +void() knight_stand5 =[ $stand5, knight_stand6 ] {ai_stand();}; +void() knight_stand6 =[ $stand6, knight_stand7 ] {ai_stand();}; +void() knight_stand7 =[ $stand7, knight_stand8 ] {ai_stand();}; +void() knight_stand8 =[ $stand8, knight_stand9 ] {ai_stand();}; +void() knight_stand9 =[ $stand9, knight_stand1 ] {ai_stand();}; + +void() kn_idle_sound = +{ + if(random() < 0.2) + { + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/idle.wav", 1, ATTN_IDLE); + else + sound(self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); + } +}; + +void() knight_walk1 =[ $walk1, knight_walk2 ] + { kn_idle_sound(); ai_walk(3);}; +void() knight_walk2 =[ $walk2, knight_walk3 ] {ai_walk(2);}; +void() knight_walk3 =[ $walk3, knight_walk4 ] {ai_walk(3);}; +void() knight_walk4 =[ $walk4, knight_walk5 ] {ai_walk(4);}; +void() knight_walk5 =[ $walk5, knight_walk6 ] {ai_walk(3);}; +void() knight_walk6 =[ $walk6, knight_walk7 ] {ai_walk(3);}; +void() knight_walk7 =[ $walk7, knight_walk8 ] {ai_walk(3);}; +void() knight_walk8 =[ $walk8, knight_walk9 ] {ai_walk(4);}; +void() knight_walk9 =[ $walk9, knight_walk10 ] {ai_walk(3);}; +void() knight_walk10 =[ $walk10, knight_walk11 ] {ai_walk(3);}; +void() knight_walk11 =[ $walk11, knight_walk12 ] {ai_walk(2);}; +void() knight_walk12 =[ $walk12, knight_walk13 ] {ai_walk(3);}; +void() knight_walk13 =[ $walk13, knight_walk14 ] {ai_walk(4);}; +void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);}; + + +void() knight_run1 =[ $runb1, knight_run2 ] + { kn_idle_sound(); ai_run(16); }; +void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(20);}; +void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);}; +void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);}; +void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);}; +void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(20);}; +void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);}; +void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);}; + + +void() knight_runatk1 =[ $runattack1, knight_runatk2 ] +{ +if(random() > 0.5) + sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +else + sound(self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +ai_charge(20); +}; +void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side();}; +void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side();}; +void() knight_runatk4 =[ $runattack4, knight_runatk5 ] {ai_charge_side();}; +void() knight_runatk5 =[ $runattack5, knight_runatk6 ] {ai_melee_side();}; +void() knight_runatk6 =[ $runattack6, knight_runatk7 ] {ai_melee_side();}; +void() knight_runatk7 =[ $runattack7, knight_runatk8 ] {ai_melee_side();}; +void() knight_runatk8 =[ $runattack8, knight_runatk9 ] {ai_melee_side();}; +void() knight_runatk9 =[ $runattack9, knight_runatk10 ] {ai_melee_side();}; +void() knight_runatk10 =[ $runattack10, knight_runatk11 ] {ai_charge_side();}; +void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10);}; + +void() knight_atk1 =[ $attackb1, knight_atk2 ] +{ +sound(self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +ai_charge(0);}; +void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);}; +void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4);}; +void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(0);}; +void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(3);}; +void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();}; +void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();}; +void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3); +ai_melee();}; +void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1);}; +void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);}; + +//void() knight_atk9 =[ $attack9, knight_atk10 ] {}; +//void() knight_atk10 =[ $attack10, knight_atk11 ] {}; +//void() knight_atk11 =[ $attack11, knight_run1 ] {}; + +//=========================================================================== + +void() knight_pain1 =[ $pain1, knight_pain2 ] {}; +void() knight_pain2 =[ $pain2, knight_pain3 ] {}; +void() knight_pain3 =[ $pain3, knight_run1 ] {}; + +void() knight_painb1 =[ $painb1, knight_painb2 ] {ai_painforward(0);}; +void() knight_painb2 =[ $painb2, knight_painb3 ] {ai_painforward(3);}; +void() knight_painb3 =[ $painb3, knight_painb4 ] {}; +void() knight_painb4 =[ $painb4, knight_painb5 ] {}; +void() knight_painb5 =[ $painb5, knight_painb6 ] {ai_painforward(2);}; +void() knight_painb6 =[ $painb6, knight_painb7 ] {ai_painforward(4);}; +void() knight_painb7 =[ $painb7, knight_painb8 ] {ai_painforward(2);}; +void() knight_painb8 =[ $painb8, knight_painb9 ] {ai_painforward(5);}; +void() knight_painb9 =[ $painb9, knight_painb10 ] {ai_painforward(5);}; +void() knight_painb10 =[ $painb10, knight_painb11 ] {ai_painforward(0);}; +void() knight_painb11 =[ $painb11, knight_run1 ] {}; + +void(entity attacker, float damage) knight_pain = +{ + float r; + + if(self.pain_finished > time) + return; + + r = random(); + + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/pain.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "knight/khurt.wav", 1, ATTN_NORM); + + if(r < 0.85) + { + knight_pain1(); + self.pain_finished = time + 1; + } + else + { + knight_painb1(); + self.pain_finished = time + 1; + } + +}; + +//=========================================================================== + +void() knight_bow1 =[ $kneel1, knight_bow2 ] {ai_turn();}; +void() knight_bow2 =[ $kneel2, knight_bow3 ] {ai_turn();}; +void() knight_bow3 =[ $kneel3, knight_bow4 ] {ai_turn();}; +void() knight_bow4 =[ $kneel4, knight_bow5 ] {ai_turn();}; + +void() knight_bow5 =[ $kneel5, knight_bow5 ] {ai_turn();}; + +void() knight_bow6 =[ $kneel4, knight_bow7 ] {ai_turn();}; +void() knight_bow7 =[ $kneel3, knight_bow8 ] {ai_turn();}; +void() knight_bow8 =[ $kneel2, knight_bow9 ] {ai_turn();}; +void() knight_bow9 =[ $kneel1, knight_bow10 ] {ai_turn();}; +void() knight_bow10 =[ $walk1, knight_walk1 ] {ai_turn();}; + + + +void() knight_die1 =[ $death1, knight_die2 ] {}; +void() knight_die2 =[ $death2, knight_die3 ] {}; +void() knight_die3 =[ $death3, knight_die4 ] +{self.solid = SOLID_NOT;}; +void() knight_die4 =[ $death4, knight_die5 ] {}; +void() knight_die5 =[ $death5, knight_die6 ] {}; +void() knight_die6 =[ $death6, knight_die7 ] {}; +void() knight_die7 =[ $death7, knight_die8 ] {}; +void() knight_die8 =[ $death8, knight_die9 ] {}; +void() knight_die9 =[ $death9, knight_die10] {}; +void() knight_die10=[ $death10, knight_die10] {monster_check_remove_corpse();}; + + +void() knight_dieb1 =[ $deathb1, knight_dieb2 ] {}; +void() knight_dieb2 =[ $deathb2, knight_dieb3 ] {}; +void() knight_dieb3 =[ $deathb3, knight_dieb4 ] +{self.solid = SOLID_NOT;}; +void() knight_dieb4 =[ $deathb4, knight_dieb5 ] {}; +void() knight_dieb5 =[ $deathb5, knight_dieb6 ] {}; +void() knight_dieb6 =[ $deathb6, knight_dieb7 ] {}; +void() knight_dieb7 =[ $deathb7, knight_dieb8 ] {}; +void() knight_dieb8 =[ $deathb8, knight_dieb9 ] {}; +void() knight_dieb9 =[ $deathb9, knight_dieb10] {}; +void() knight_dieb10 = [ $deathb10, knight_dieb11] {}; +void() knight_dieb11 = [ $deathb11, knight_dieb11] {monster_check_remove_corpse();}; + + +void() knight_die = +{ +// check for gib + if(self.health < -40) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_knight.mdl", self.health); + + if(self.spawnflags & 2) // statue + { + ThrowGib("progs/statgib1.mdl", self.health); + ThrowGib("progs/statgib2.mdl", self.health); + ThrowGib("progs/statgib3.mdl", self.health); + } + else + { + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + } + return; + } + +// regular death + if(self.spawnflags & 2) // statue + sound(self, CHAN_VOICE, "statue/death.wav", 1, ATTN_NORM); + else + sound(self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + + if(random() < 0.5) + knight_die1(); + else + knight_dieb1(); +}; + +void() knight_pause = +{ + sound(self, CHAN_VOICE, "statue/see.wav", 1, ATTN_NORM); + + self.takedamage = DAMAGE_AIM; + self.th_stand = knight_stand1; + self.th_walk = knight_walk1; + self.th_run = knight_run1; + self.th_melee = knight_atk1; + self.th_pain = knight_pain; + self.th_die = knight_die; + self.use = SUB_Null; + + self.think = knight_run1; + + self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + + self.delay = 0; +}; + +void() knight_pause1 = +{ + self.takedamage = DAMAGE_NO; + self.use = knight_pause; + self.think = knight_pause1; + self.nextthink = time + 0.1; +}; + +/*QUAKED monster_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush Statue + +Statue - select this to use the stone skin and have him frozen in place. + +delay: time from sight to attack (default 5) +frame: frame to be frozen in. (default 44) +*/ +void() monster_knight = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/knight.mdl"); + precache_model("progs/h_knight.mdl"); + + if(self.spawnflags & 2) // statue + { + precache_model("progs/statgib1.mdl"); + precache_model("progs/statgib2.mdl"); + precache_model("progs/statgib3.mdl"); + precache_sound("statue/see.wav"); + precache_sound("statue/idle.wav"); + precache_sound("statue/pain.wav"); + precache_sound("statue/death.wav"); + } + else + { + precache_sound("knight/kdeath.wav"); + precache_sound("knight/khurt.wav"); + precache_sound("knight/ksight.wav"); + precache_sound("knight/idle.wav"); + } + + precache_sound("knight/sword1.wav"); + precache_sound("knight/sword2.wav"); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + self.health = 75; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = knight_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/knight.mdl"); + setsize(self, '-12 -12 -24', '12 12 26'); + + if(self.spawnflags & 2) // statue + { + if(self.frame == 0) + self.frame = 44; + self.skin = 1; + + if(!self.targetname) + { + dprint("statue not targeted\n"); + dprint(self.classname); + dprint(" at "); + dprint(vtos(self.origin)); + dprint("\n"); + return; + } + + self.use = knight_pause; + self.th_stand = knight_pause1; + self.th_walk = knight_pause1; + self.th_run = knight_pause1; +/* + self.th_stand = knight_pause1; + self.th_walk = knight_pause; + self.th_run = knight_pause; + self.th_melee = knight_atk1; + self.th_pain = knight_pause; + self.th_die = knight_die; +*/ + walkmonster_start(); + } + else + { + self.th_stand = knight_stand1; + self.th_walk = knight_walk1; + self.th_run = knight_run1; + self.th_melee = knight_atk1; + self.th_pain = knight_pain; + self.th_die = knight_die; + walkmonster_start(); + } +}; diff --git a/QC/orig_mon_ogre.qc b/QC/orig_mon_ogre.qc new file mode 100644 index 00000000..cd2f3e65 --- /dev/null +++ b/QC/orig_mon_ogre.qc @@ -0,0 +1,613 @@ +/* +============================================================================== + +OGRE + +============================================================================== +*/ + +$cd id1/models/ogre_c +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame painb1 painb2 painb3 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 paind14 paind15 paind16 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 death12 +$frame death13 death14 + +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 + +//============================================================================= + +float OGRE_BOSS = 2; +float OGRE_NORMAL = 4; + +void() OgreGrenadeExplode = +{ + T_RadiusDamage(self, self.owner, 40, world); + sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel(self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1(); +}; + +void() OgreGrenadeTouch = +{ + if(other == self.owner) + return; // don't explode on owner + if(other.takedamage == DAMAGE_AIM) + { + OgreGrenadeExplode(); + return; + } + sound(self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound + if(self.velocity == '0 0 0') + self.avelocity = '0 0 0'; +}; + +/* +================ +OgreFireGrenade +================ +*/ +void() OgreFireGrenade = +{ + entity missile; + + // HONEY + vector trajectory; + float dist, vol, speeeed, zmul; + vector nozdistancedelta; + + self.effects = self.effects | EF_MUZZLEFLASH; + + sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "ogre_grenade"; + + // HONEY + trajectory = self.enemy.origin - self.origin; + missile.velocity = normalize(trajectory); + + // set missile speed + // HONEY + if(self.classname == "monster_ogre_marksman") + { + if(enemy_range == RANGE_NEAR) + { + speeeed = 600; + zmul = 0.7; + } + else if(enemy_range == RANGE_MID) + { + speeeed = 700; + zmul = 0.545; + } + else + { + ASSERT(enemy_range == RANGE_FAR); + + speeeed = 1050; + zmul = 0.38; + } + + //from some inside3d tutorial, + some extra oomph + nozdistancedelta = trajectory; //copy to no height distance vector + + nozdistancedelta_z = 0; //remove height + + missile.velocity = normalize(trajectory); //set the velocity to the distance + missile.velocity = missile.velocity * speeeed; //give it more power + + missile.velocity_z = missile.velocity_z + vlen(nozdistancedelta)*zmul; //add extra height for extra distance + + //Manually attenuate the sound based on distance to player. This is not good for coop :/ + dist = vlen(trajectory); + vol = 1 - (dist / 2048); + if(vol > 0 && vol <= 1) + { + sound(self, CHAN_ITEM, "weapons/grenade.wav", vol, ATTN_NONE); + } + } + else + { + sound(self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + missile.velocity = missile.velocity * 600; + missile.velocity_z = 200; + } + + missile.avelocity = '300 300 300'; + missile.angles = vectoangles(missile.velocity); + + // set missile duration + if(self.spawnflags & OGRE_BOSS) + { + missile.touch = MultiGrenadeTouch; + missile.nextthink = time + 2.5; + missile.think = MultiGrenadeExplode; + setmodel(missile, "progs/mervup.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin); + missile.classname = "MultiGrenade"; + } + else + { + missile.touch = OgreGrenadeTouch; + missile.nextthink = time + 2.5; + missile.think = OgreGrenadeExplode; + setmodel(missile, "progs/grenade.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin); + } +}; + + +//============================================================================= + +/* +================ +chainsaw + +FIXME +================ +*/ +void(float side) chainsaw = +{ +vector delta; +float ldmg; + + if(!self.enemy) + return; + if(!CanDamage(self.enemy, self)) + return; + + ai_charge(10); + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + ldmg = (random() + random() + random()) * 4; + + // HONEY + if(self.classname == "monster_ogre_marksman"){ + if(self.enemy.classname == "monster_ogre"){ + ldmg = ldmg * 1.8; + } + } + + T_Damage(self.enemy, self, self, ldmg); + + if(side) + { + makevectors(self.angles); + if(side == 1) + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); + else + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); + } +}; + + +void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();}; +void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();}; +void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();}; +void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();}; +void() ogre_stand5 =[ $stand5, ogre_stand6 ] +{ + if(random() < 0.2 && /* HONEY */ (self.spawnflags & SPAWNFLAG_SF_SILENT_WAKEUP) != SPAWNFLAG_SF_SILENT_WAKEUP) + sound(self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); + + ai_stand(); +}; +void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();}; +void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();}; +void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();}; +void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();}; + +void() ogre_walk1 =[ $walk1, ogre_walk2 ] {ai_walk(3);}; +void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);}; +void() ogre_walk3 =[ $walk3, ogre_walk4 ] { +ai_walk(2); +if(random() < 0.2) + sound(self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); +}; +void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);}; +void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);}; +void() ogre_walk6 =[ $walk6, ogre_walk7 ] { +ai_walk(5); +if(random() < 0.1) + sound(self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); +}; +void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);}; +void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);}; +void() ogre_walk9 =[ $walk9, ogre_walk10 ] {ai_walk(3);}; +void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);}; +void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);}; +void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);}; +void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);}; +void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);}; +void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);}; +void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);}; + +void() ogre_run1 =[ $run1, ogre_run2 ] {ai_run(9); +if(random() < 0.2) + sound(self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE); +}; +void() ogre_run2 =[ $run2, ogre_run3 ] {ai_run(12);}; +void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);}; +void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);}; +void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);}; +void() ogre_run6 =[ $run6, ogre_run7 ] {ai_run(4);}; +void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);}; +void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);}; + +void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11); +sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); +}; +void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);}; +void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);}; +void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);}; +void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);self.angles_y = self.angles_y + random()*25;}; +void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);}; +void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);}; +void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);}; + +void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6); +sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); +}; +void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);}; +void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);}; +void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);}; +void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);}; +void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0);}; +void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);}; +void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);}; +void() ogre_smash9 =[ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);}; +void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1);}; +void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0); +self.nextthink = self.nextthink + random()*0.2;}; // slight variation +void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge(0);}; +void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);}; +void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);}; + +void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();}; +void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();}; +void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();}; +void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireGrenade();}; +void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();}; +void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();}; +void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +void() ogre_pain1 =[ $pain1, ogre_pain2 ] {}; +void() ogre_pain2 =[ $pain2, ogre_pain3 ] {}; +void() ogre_pain3 =[ $pain3, ogre_pain4 ] {}; +void() ogre_pain4 =[ $pain4, ogre_pain5 ] {}; +void() ogre_pain5 =[ $pain5, ogre_run1 ] {}; + + +void() ogre_painb1 =[ $painb1, ogre_painb2 ] {}; +void() ogre_painb2 =[ $painb2, ogre_painb3 ] {}; +void() ogre_painb3 =[ $painb3, ogre_run1 ] {}; + + +void() ogre_painc1 =[ $painc1, ogre_painc2 ] {}; +void() ogre_painc2 =[ $painc2, ogre_painc3 ] {}; +void() ogre_painc3 =[ $painc3, ogre_painc4 ] {}; +void() ogre_painc4 =[ $painc4, ogre_painc5 ] {}; +void() ogre_painc5 =[ $painc5, ogre_painc6 ] {}; +void() ogre_painc6 =[ $painc6, ogre_run1 ] {}; + + +void() ogre_paind1 =[ $paind1, ogre_paind2 ] {}; +void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);}; +void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);}; +void() ogre_paind4 =[ $paind4, ogre_paind5 ] {ai_pain(4);}; +void() ogre_paind5 =[ $paind5, ogre_paind6 ] {}; +void() ogre_paind6 =[ $paind6, ogre_paind7 ] {}; +void() ogre_paind7 =[ $paind7, ogre_paind8 ] {}; +void() ogre_paind8 =[ $paind8, ogre_paind9 ] {}; +void() ogre_paind9 =[ $paind9, ogre_paind10 ] {}; +void() ogre_paind10=[ $paind10, ogre_paind11 ] {}; +void() ogre_paind11=[ $paind11, ogre_paind12 ] {}; +void() ogre_paind12=[ $paind12, ogre_paind13 ] {}; +void() ogre_paind13=[ $paind13, ogre_paind14 ] {}; +void() ogre_paind14=[ $paind14, ogre_paind15 ] {}; +void() ogre_paind15=[ $paind15, ogre_paind16 ] {}; +void() ogre_paind16=[ $paind16, ogre_run1 ] {}; + +void() ogre_paine1 =[ $paine1, ogre_paine2 ] {}; +void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);}; +void() ogre_paine3 =[ $paine3, ogre_paine4 ] {ai_pain(9);}; +void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);}; +void() ogre_paine5 =[ $paine5, ogre_paine6 ] {}; +void() ogre_paine6 =[ $paine6, ogre_paine7 ] {}; +void() ogre_paine7 =[ $paine7, ogre_paine8 ] {}; +void() ogre_paine8 =[ $paine8, ogre_paine9 ] {}; +void() ogre_paine9 =[ $paine9, ogre_paine10 ] {}; +void() ogre_paine10=[ $paine10, ogre_paine11 ] {}; +void() ogre_paine11=[ $paine11, ogre_paine12 ] {}; +void() ogre_paine12=[ $paine12, ogre_paine13 ] {}; +void() ogre_paine13=[ $paine13, ogre_paine14 ] {}; +void() ogre_paine14=[ $paine14, ogre_paine15 ] {}; +void() ogre_paine15=[ $paine15, ogre_run1 ] {}; + + +void(entity attacker, float damage) ogre_pain = +{ + float r; + +// don't make multiple pain sounds right after each other + if(self.pain_finished > time) + return; + + sound(self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); + + r = random(); + + if(r < 0.25) + { + ogre_pain1(); + self.pain_finished = time + 1; + } + else if(r < 0.5) + { + ogre_painb1(); + self.pain_finished = time + 1; + } + else if(r < 0.75) + { + ogre_painc1(); + self.pain_finished = time + 1; + } + else if(r < 0.88) + { + ogre_paind1(); + self.pain_finished = time + 2; + } + else + { + ogre_paine1(); + self.pain_finished = time + 2; + } +}; + +void() OgreDrop = +{ + entity entPlayer; + entPlayer = FindEntPlayerForDrop(); + + self.solid = SOLID_NOT; + self.ammo_rockets = 2; + DropBackpack(); + + if(entPlayer != world && ShouldDropEnemyWpn(0.45)) + { + if(!TryEnemyDrop(self, entPlayer, WID_GRENADE_LAUNCHER, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_PROXIMITY_GUN, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_ROCKET_LAUNCHER, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_NAILGUN, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_NAILGUN, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_AXE, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_SHOTGUN, 0.1)) + if(!TryEnemyDrop(self, entPlayer, WID_SHOTGUN, 0.1)) + { /* Intentionally empty. */ } + } +} + + +void() ogre_die1 =[ $death1, ogre_die2 ] {}; +void() ogre_die2 =[ $death2, ogre_die3 ] {}; +void() ogre_die3 =[ $death3, ogre_die4 ] + { + self.solid = SOLID_NOT; + if(self.spawnflags & OGRE_BOSS) + { + self.ammo_multi_rockets = 2; + } + else + { + self.ammo_rockets = 2; + } + OgreDrop(); + }; +void() ogre_die4 =[ $death4, ogre_die5 ] {}; +void() ogre_die5 =[ $death5, ogre_die6 ] {}; +void() ogre_die6 =[ $death6, ogre_die7 ] {}; +void() ogre_die7 =[ $death7, ogre_die8 ] {}; +void() ogre_die8 =[ $death8, ogre_die9 ] {}; +void() ogre_die9 =[ $death9, ogre_die10 ] {}; +void() ogre_die10 =[ $death10, ogre_die11 ] {}; +void() ogre_die11 =[ $death11, ogre_die12 ] {}; +void() ogre_die12 =[ $death12, ogre_die13 ] {}; +void() ogre_die13 =[ $death13, ogre_die14 ] {}; +void() ogre_die14 =[ $death14, ogre_die14 ] {monster_check_remove_corpse();}; + +void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {}; +void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {ai_forward(5);}; +void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] + { + self.solid = SOLID_NOT; + if(self.spawnflags & OGRE_BOSS) + { + self.ammo_multi_rockets = 2; + } + else + { + self.ammo_rockets = 2; + } + OgreDrop(); + }; +void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);}; +void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);}; +void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);}; +void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);}; +void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {}; +void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {}; +void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {monster_check_remove_corpse();}; + +void() ogre_die = +{ + // check for gib + ogre_crown_die(); + + if(self.health < -80) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_ogre.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + OgreDrop(); + return; + } + + sound(self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + + if(random() < 0.5) + ogre_die1(); + else + ogre_bdie1(); +}; + +void() ogre_melee = +{ + if(random() > 0.5) + ogre_smash1(); + else + ogre_swing1(); +}; + + +/*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush Boss Normal +The Ogre + +Boss: use the modified skin and fire multigrenades. +Normal: use the original skin and fire normal grenades. +*/ +void() monster_ogre_real = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model(self.wad); + + precache_model("progs/ogre.mdl"); + precache_model("progs/h_ogre.mdl"); + precache_model("progs/grenade.mdl"); + + precache_sound("ogre/ogdrag.wav"); + precache_sound("ogre/ogdth.wav"); + precache_sound("ogre/ogidle.wav"); + precache_sound("ogre/ogidle2.wav"); + precache_sound("ogre/ogpain1.wav"); + precache_sound("ogre/ogsawatk.wav"); + precache_sound("ogre/ogwake.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt) { + self.cnt = -1; + } + + self.health = 200; + + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_die = ogre_die; + self.th_melee = ogre_melee; + self.th_missile = ogre_nail1; + self.th_pain = ogre_pain; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = ogre_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, self.wad); + + // none specified - choose random. 25% boss on normal, hard, bloodbath + if(self.spawnflags <= 1) + { + if(cvar_hget(cvarh_skill) > 0) + { + if(random() <= 0.25) + { + self.spawnflags = self.spawnflags | OGRE_BOSS; + } + } + } + + if(self.spawnflags & OGRE_BOSS) + { + // TODO VR: (P2) rogue skins + // self.skin = 1; + } + + setsize(self, '-20 -20 -22', '20 20 40'); + walkmonster_start(); +}; + +void() monster_ogre = +{ + self.wad = "progs/ogre.mdl"; + monster_ogre_real(); +}; diff --git a/QC/orig_mon_oldone.qc b/QC/orig_mon_oldone.qc new file mode 100644 index 00000000..616867b3 --- /dev/null +++ b/QC/orig_mon_oldone.qc @@ -0,0 +1,278 @@ +/* +============================================================================== + +OLD ONE + +============================================================================== +*/ +$cd id1/models/old_one +$origin 0 0 24 +$base base +$skin skin +$scale 1 + +entity shub; + +$frame old1 old2 old3 old4 old5 old6 old7 old8 old9 +$frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19 +$frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29 +$frame old30 old31 old32 old33 old34 old35 old36 old37 old38 old39 +$frame old40 old41 old42 old43 old44 old45 old46 + +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 +$frame shake16 shake17 shake18 shake19 shake20 + +//void() old_stand =[ $old1, old_stand ] {}; + +void() old_idle1 =[ $old1, old_idle2 ] {}; +void() old_idle2 =[ $old2, old_idle3 ] {}; +void() old_idle3 =[ $old3, old_idle4 ] {}; +void() old_idle4 =[ $old4, old_idle5 ] {}; +void() old_idle5 =[ $old5, old_idle6 ] {}; +void() old_idle6 =[ $old6, old_idle7 ] {}; +void() old_idle7 =[ $old7, old_idle8 ] {}; +void() old_idle8 =[ $old8, old_idle9 ] {}; +void() old_idle9 =[ $old9, old_idle10 ] {}; +void() old_idle10 =[ $old10, old_idle11 ] {}; +void() old_idle11 =[ $old11, old_idle12 ] {}; +void() old_idle12 =[ $old12, old_idle13 ] {}; +void() old_idle13 =[ $old13, old_idle14 ] {}; +void() old_idle14 =[ $old14, old_idle15 ] {}; +void() old_idle15 =[ $old15, old_idle16 ] {}; +void() old_idle16 =[ $old16, old_idle17 ] {}; +void() old_idle17 =[ $old17, old_idle18 ] {}; +void() old_idle18 =[ $old18, old_idle19 ] {}; +void() old_idle19 =[ $old19, old_idle20 ] {}; +void() old_idle20 =[ $old20, old_idle21 ] {}; +void() old_idle21 =[ $old21, old_idle22 ] {}; +void() old_idle22 =[ $old22, old_idle23 ] {}; +void() old_idle23 =[ $old23, old_idle24 ] {}; +void() old_idle24 =[ $old24, old_idle25 ] {}; +void() old_idle25 =[ $old25, old_idle26 ] {}; +void() old_idle26 =[ $old26, old_idle27 ] {}; +void() old_idle27 =[ $old27, old_idle28 ] {}; +void() old_idle28 =[ $old28, old_idle29 ] {}; +void() old_idle29 =[ $old29, old_idle30 ] {}; +void() old_idle30 =[ $old30, old_idle31 ] {}; +void() old_idle31 =[ $old31, old_idle32 ] {}; +void() old_idle32 =[ $old32, old_idle33 ] {}; +void() old_idle33 =[ $old33, old_idle34 ] {}; +void() old_idle34 =[ $old34, old_idle35 ] {}; +void() old_idle35 =[ $old35, old_idle36 ] {}; +void() old_idle36 =[ $old36, old_idle37 ] {}; +void() old_idle37 =[ $old37, old_idle38 ] {}; +void() old_idle38 =[ $old38, old_idle39 ] {}; +void() old_idle39 =[ $old39, old_idle40 ] {}; +void() old_idle40 =[ $old40, old_idle41 ] {}; +void() old_idle41 =[ $old41, old_idle42 ] {}; +void() old_idle42 =[ $old42, old_idle43 ] {}; +void() old_idle43 =[ $old43, old_idle44 ] {}; +void() old_idle44 =[ $old44, old_idle45 ] {}; +void() old_idle45 =[ $old45, old_idle46 ] {}; +void() old_idle46 =[ $old46, old_idle1 ] {}; + + +void() old_thrash1 =[ $shake1, old_thrash2 ] {lightstyle(0, "m");}; +void() old_thrash2 =[ $shake2, old_thrash3 ] {lightstyle(0, "k");}; +void() old_thrash3 =[ $shake3, old_thrash4 ] {lightstyle(0, "k");}; +void() old_thrash4 =[ $shake4, old_thrash5 ] {lightstyle(0, "i");}; +void() old_thrash5 =[ $shake5, old_thrash6 ] {lightstyle(0, "g");}; +void() old_thrash6 =[ $shake6, old_thrash7 ] {lightstyle(0, "e");}; +void() old_thrash7 =[ $shake7, old_thrash8 ] {lightstyle(0, "c");}; +void() old_thrash8 =[ $shake8, old_thrash9 ] {lightstyle(0, "a");}; +void() old_thrash9 =[ $shake9, old_thrash10 ] {lightstyle(0, "c");}; +void() old_thrash10 =[ $shake10, old_thrash11 ] {lightstyle(0, "e");}; +void() old_thrash11 =[ $shake11, old_thrash12 ] {lightstyle(0, "g");}; +void() old_thrash12 =[ $shake12, old_thrash13 ] {lightstyle(0, "i");}; +void() old_thrash13 =[ $shake13, old_thrash14 ] {lightstyle(0, "k");}; +void() old_thrash14 =[ $shake14, old_thrash15 ] {lightstyle(0, "m");}; +void() old_thrash15 =[ $shake15, old_thrash16 ] {lightstyle(0, "m"); +self.cnt = self.cnt + 1; +if(self.cnt != 3) + self.think = old_thrash1; +}; +void() old_thrash16 =[ $shake16, old_thrash17 ] {lightstyle(0, "g");}; +void() old_thrash17 =[ $shake17, old_thrash18 ] {lightstyle(0, "c");}; +void() old_thrash18 =[ $shake18, old_thrash19 ] {lightstyle(0, "b");}; +void() old_thrash19 =[ $shake19, old_thrash20 ] {lightstyle(0, "a");}; +void() old_thrash20 =[ $shake20, old_thrash20 ] {finale_4();}; + +//============================================================================ + +void() finale_1 = +{ + entity pos, pl; + entity timer; + + killed_monsters = killed_monsters + 1; + WriteByte(MSG_ALL, SVC_KILLEDMONSTER); // FIXME: reliable broadcast + + intermission_exittime = time + 10000000; // never allow exit + intermission_running = 1; + + // find the intermission spot + pos = find(world, classname, "info_intermission"); + if(!pos) + error ("no info_intermission"); + pl = find(world, classname, "misc_teleporttrain"); + if(!pl) + error ("no teleporttrain"); + remove(pl); + + WriteByte(MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, ""); + + pl = find(world, classname, "player"); + while(pl != world) + { + pl.view_ofs = '0 0 0'; + pl.angles = other.v_angle = pos.mangle; + pl.fixangle = TRUE; // turn this way immediately + pl.map = self.map; + pl.nextthink = time + 0.5; + pl.takedamage = DAMAGE_NO; + pl.solid = SOLID_NOT; + pl.movetype = MOVETYPE_NONE; + pl.modelindex = 0; + setorigin(pl, pos.origin); + pl = find(pl, classname, "player"); + } + + // make fake versions of all players as standins, and move the real + // players to the intermission spot + + // wait for 1 second + timer = spawn(); + timer.nextthink = time + 1; + timer.think = finale_2; +}; + +void() finale_2 = +{ + vector o; + + // start a teleport splash inside shub + + o = shub.origin - '0 100 0'; + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_TELEPORT); + WriteVec3(MSG_BROADCAST, o); + + sound(shub, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + + self.nextthink = time + 2; + self.think = finale_3; +}; + +void() finale_3 = +{ + // start shub thrashing wildly + shub.think = old_thrash1; + sound(shub, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NORM); + lightstyle(0, "abcdefghijklmlkjihgfedcb"); +}; + +void() finale_4 = +{ + // throw tons of meat chunks + vector oldo; + float x, y, z; + float r; + entity n; + + sound(self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM); + + oldo = self.origin; + + z = 16; + while(z <= 144) + { + x = -64; + while(x <= 64) + { + y = -64; + while(y <= 64) + { + self.origin_x = oldo_x + x; + self.origin_y = oldo_y + y; + self.origin_z = oldo_z + z; + + r = random(); + if(r < 0.3) + ThrowGib("progs/gib1.mdl", -999); + else if(r < 0.6) + ThrowGib("progs/gib2.mdl", -999); + else + ThrowGib("progs/gib3.mdl", -999); + y = y + 32; + } + x = x + 32; + } + z = z + 96; + } + // start the end text + WriteByte(MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Congratulations and well done! You have\nbeaten the hideous Shub-Niggurath, and\nher hundreds of ugly changelings and\nmonsters. You have proven that your\nskill and your cunning are greater than\nall the powers of Quake. You are the\nmaster now. Id Software salutes you."); + +// put a player model down + n = spawn(); + setmodel(n, "progs/player.mdl"); + oldo = oldo - '32 264 0'; + setorigin(n, oldo); + n.angles = '0 290 0'; + n.frame = 1; + + remove(self); + +// switch cd track + WriteByte(MSG_ALL, SVC_CDTRACK); + WriteByte(MSG_ALL, 3); + WriteByte(MSG_ALL, 3); + lightstyle(0, "m"); +}; + +//============================================================================ + +void (entity attacker, float damage) nopain = +{ + self.health = 40000; +}; + +//============================================================================ + + +/*QUAKED monster_oldone (1 0 0) (-16 -16 -24) (16 16 32) +*/ +void() monster_oldone = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model2("progs/oldone.mdl"); + + precache_sound2("boss2/death.wav"); + precache_sound2("boss2/idle.wav"); + precache_sound2("boss2/sight.wav"); + precache_sound2("boss2/pop2.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/oldone.mdl"); + setsize(self, '-160 -128 -24', '160 128 256'); + + self.health = 40000; // kill by telefrag + self.think = old_idle1; + self.nextthink = time + 0.1; + self.takedamage = DAMAGE_YES; + self.th_pain = nopain; + self.th_die = finale_1; + shub = self; + + total_monsters = total_monsters + 1; +}; + diff --git a/QC/orig_mon_shalrath.qc b/QC/orig_mon_shalrath.qc new file mode 100644 index 00000000..758c5450 --- /dev/null +++ b/QC/orig_mon_shalrath.qc @@ -0,0 +1,248 @@ +/* +============================================================================== + +SHAL-RATH + +============================================================================== +*/ +$cd id1/models/shalrath +$origin 0 0 24 +$base base +$skin skin +$scale 0.7 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 + +void() shal_stand =[ $walk1, shal_stand ] {ai_stand();}; + +void() shal_walk1 =[ $walk2, shal_walk2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE); +ai_walk(6);}; +void() shal_walk2 =[ $walk3, shal_walk3 ] {ai_walk(4);}; +void() shal_walk3 =[ $walk4, shal_walk4 ] {ai_walk(0);}; +void() shal_walk4 =[ $walk5, shal_walk5 ] {ai_walk(0);}; +void() shal_walk5 =[ $walk6, shal_walk6 ] {ai_walk(0);}; +void() shal_walk6 =[ $walk7, shal_walk7 ] {ai_walk(0);}; +void() shal_walk7 =[ $walk8, shal_walk8 ] {ai_walk(5);}; +void() shal_walk8 =[ $walk9, shal_walk9 ] {ai_walk(6);}; +void() shal_walk9 =[ $walk10, shal_walk10 ] {ai_walk(5);}; +void() shal_walk10 =[ $walk11, shal_walk11 ] {ai_walk(0);}; +void() shal_walk11 =[ $walk12, shal_walk12 ] {ai_walk(4);}; +void() shal_walk12 =[ $walk1, shal_walk1 ] {ai_walk(5);}; + +void() shal_run1 =[ $walk2, shal_run2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE); +ai_run(6);}; +void() shal_run2 =[ $walk3, shal_run3 ] {ai_run(4);}; +void() shal_run3 =[ $walk4, shal_run4 ] {ai_run(0);}; +void() shal_run4 =[ $walk5, shal_run5 ] {ai_run(0);}; +void() shal_run5 =[ $walk6, shal_run6 ] {ai_run(0);}; +void() shal_run6 =[ $walk7, shal_run7 ] {ai_run(0);}; +void() shal_run7 =[ $walk8, shal_run8 ] {ai_run(5);}; +void() shal_run8 =[ $walk9, shal_run9 ] {ai_run(6);}; +void() shal_run9 =[ $walk10, shal_run10 ] {ai_run(5);}; +void() shal_run10 =[ $walk11, shal_run11 ] {ai_run(0);}; +void() shal_run11 =[ $walk12, shal_run12 ] {ai_run(4);}; +void() shal_run12 =[ $walk1, shal_run1 ] {ai_run(5);}; + +void() shal_attack1 =[ $attack1, shal_attack2 ] { +sound(self, CHAN_VOICE, "shalrath/attack.wav", 1, ATTN_NORM); +ai_face(); +}; +void() shal_attack2 =[ $attack2, shal_attack3 ] {ai_face();}; +void() shal_attack3 =[ $attack3, shal_attack4 ] {ai_face();}; +void() shal_attack4 =[ $attack4, shal_attack5 ] {ai_face();}; +void() shal_attack5 =[ $attack5, shal_attack6 ] {ai_face();}; +void() shal_attack6 =[ $attack6, shal_attack7 ] {ai_face();}; +void() shal_attack7 =[ $attack7, shal_attack8 ] {ai_face();}; +void() shal_attack8 =[ $attack8, shal_attack9 ] {ai_face();}; +void() shal_attack9 =[ $attack9, shal_attack10 ] {ShalMissile();}; +void() shal_attack10 =[ $attack10, shal_attack11 ] {ai_face();}; +void() shal_attack11 =[ $attack11, shal_run1 ] {}; + +void() shal_pain1 =[ $pain1, shal_pain2 ] {}; +void() shal_pain2 =[ $pain2, shal_pain3 ] {}; +void() shal_pain3 =[ $pain3, shal_pain4 ] {}; +void() shal_pain4 =[ $pain4, shal_pain5 ] {}; +void() shal_pain5 =[ $pain5, shal_run1 ] {}; + +void() shal_death1 =[ $death1, shal_death2 ] {}; +void() shal_death2 =[ $death2, shal_death3 ] {}; +void() shal_death3 =[ $death3, shal_death4 ] {}; +void() shal_death4 =[ $death4, shal_death5 ] {}; +void() shal_death5 =[ $death5, shal_death6 ] {}; +void() shal_death6 =[ $death6, shal_death7 ] {}; +void() shal_death7 =[ $death7, shal_death7 ] {monster_check_remove_corpse();}; + + +void(entity attacker, float damage) shalrath_pain = +{ + if(self.pain_finished > time) + return; + + sound(self, CHAN_VOICE, "shalrath/pain.wav", 1, ATTN_NORM); + shal_pain1(); + self.pain_finished = time + 3; +}; + +void() shalrath_die = +{ +// check for gib + if(self.health < -90) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_shal.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + return; + } + + sound(self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM); + shal_death1(); + self.solid = SOLID_NOT; + // insert death sounds here +}; + +/* +================ +ShalMissile +================ +*/ +void() ShalMissileTouch; +void() ShalHome; +void() ShalMissile = +{ + entity missile; + vector dir; + float dist, flytime; + + dir = normalize((self.enemy.origin + '0 0 10') - self.origin); + dist = vlen(self.enemy.origin - self.origin); + flytime = dist * 0.002; + if(flytime < 0.1) + flytime = 0.1; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound(self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM); + + missile = spawn(); + missile.owner = self; + + missile.solid = SOLID_BBOX; + missile.movetype = MOVETYPE_FLYMISSILE; + setmodel(missile, "progs/v_spike.mdl"); + + setsize(missile, '0 0 0', '0 0 0'); + + missile.origin = self.origin + '0 0 10'; + missile.velocity = dir * 400; + missile.avelocity = '300 300 300'; + missile.nextthink = flytime + time; + missile.think = ShalHome; + missile.enemy = self.enemy; + missile.touch = ShalMissileTouch; +}; + +void() ShalHome = +{ + vector dir, vtemp; + vtemp = self.enemy.origin + '0 0 10'; + if(self.enemy.health < 1) + { + remove(self); + return; + } + dir = normalize(vtemp - self.origin); + if(skill == 3) + self.velocity = dir * 350; + else + self.velocity = dir * 250; + self.nextthink = time + 0.2; + self.think = ShalHome; +}; + +void() ShalMissileTouch = +{ + if(other == self.owner) + return; // don't explode on owner + + if(other.classname == "monster_zombie") + T_Damage(other, self, self, 110); + T_RadiusDamage(self, self.owner, 40, world); + sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel(self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1(); +}; + +//================================================================= + +/*QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) Ambush +*/ +void() monster_shalrath = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model2("progs/shalrath.mdl"); + precache_model2("progs/h_shal.mdl"); + precache_model2("progs/v_spike.mdl"); + + precache_sound2("shalrath/attack.wav"); + precache_sound2("shalrath/attack2.wav"); + precache_sound2("shalrath/death.wav"); + precache_sound2("shalrath/idle.wav"); + precache_sound2("shalrath/pain.wav"); + precache_sound2("shalrath/sight.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + + self.health = 400; + + self.th_stand = shal_stand; + self.th_walk = shal_walk1; + self.th_run = shal_run1; + self.th_die = shalrath_die; + self.th_pain = shalrath_pain; + self.th_missile = shal_attack1; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = shalrath_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/shalrath.mdl"); + setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX); + + walkmonster_start(); +}; diff --git a/QC/orig_mon_shambler.qc b/QC/orig_mon_shambler.qc new file mode 100644 index 00000000..600836a6 --- /dev/null +++ b/QC/orig_mon_shambler.qc @@ -0,0 +1,409 @@ +/* +============================================================================== + +SHAMBLER + +============================================================================== +*/ + +$cd id1/models/shams +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 + +$frame run1 run2 run3 run4 run5 run6 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 + +$frame swingr1 swingr2 swingr3 swingr4 swingr5 +$frame swingr6 swingr7 swingr8 swingr9 + +$frame swingl1 swingl2 swingl3 swingl4 swingl5 +$frame swingl6 swingl7 swingl8 swingl9 + +$frame magic1 magic2 magic3 magic4 magic5 +$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 + +void() sham_stand1 =[ $stand1, sham_stand2 ] {ai_stand();}; +void() sham_stand2 =[ $stand2, sham_stand3 ] {ai_stand();}; +void() sham_stand3 =[ $stand3, sham_stand4 ] {ai_stand();}; +void() sham_stand4 =[ $stand4, sham_stand5 ] {ai_stand();}; +void() sham_stand5 =[ $stand5, sham_stand6 ] {ai_stand();}; +void() sham_stand6 =[ $stand6, sham_stand7 ] {ai_stand();}; +void() sham_stand7 =[ $stand7, sham_stand8 ] {ai_stand();}; +void() sham_stand8 =[ $stand8, sham_stand9 ] {ai_stand();}; +void() sham_stand9 =[ $stand9, sham_stand10] {ai_stand();}; +void() sham_stand10 =[ $stand10, sham_stand11] {ai_stand();}; +void() sham_stand11 =[ $stand11, sham_stand12] {ai_stand();}; +void() sham_stand12 =[ $stand12, sham_stand13] {ai_stand();}; +void() sham_stand13 =[ $stand13, sham_stand14] {ai_stand();}; +void() sham_stand14 =[ $stand14, sham_stand15] {ai_stand();}; +void() sham_stand15 =[ $stand15, sham_stand16] {ai_stand();}; +void() sham_stand16 =[ $stand16, sham_stand17] {ai_stand();}; +void() sham_stand17 =[ $stand17, sham_stand1 ] {ai_stand();}; + +void() sham_walk1 =[ $walk1, sham_walk2 ] {ai_walk(10);}; +void() sham_walk2 =[ $walk2, sham_walk3 ] {ai_walk(9);}; +void() sham_walk3 =[ $walk3, sham_walk4 ] {ai_walk(9);}; +void() sham_walk4 =[ $walk4, sham_walk5 ] {ai_walk(5);}; +void() sham_walk5 =[ $walk5, sham_walk6 ] {ai_walk(6);}; +void() sham_walk6 =[ $walk6, sham_walk7 ] {ai_walk(12);}; +void() sham_walk7 =[ $walk7, sham_walk8 ] {ai_walk(8);}; +void() sham_walk8 =[ $walk8, sham_walk9 ] {ai_walk(3);}; +void() sham_walk9 =[ $walk9, sham_walk10] {ai_walk(13);}; +void() sham_walk10 =[ $walk10, sham_walk11] {ai_walk(9);}; +void() sham_walk11 =[ $walk11, sham_walk12] {ai_walk(7);}; +void() sham_walk12 =[ $walk12, sham_walk1 ] {ai_walk(7); +if(random() > 0.8) + sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);}; + +void() sham_run1 =[ $run1, sham_run2 ] {ai_run(20);}; +void() sham_run2 =[ $run2, sham_run3 ] {ai_run(24);}; +void() sham_run3 =[ $run3, sham_run4 ] {ai_run(20);}; +void() sham_run4 =[ $run4, sham_run5 ] {ai_run(20);}; +void() sham_run5 =[ $run5, sham_run6 ] {ai_run(24);}; +void() sham_run6 =[ $run6, sham_run1 ] {ai_run(20); +if(random() > 0.8) + sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE); +}; + +void() sham_smash1 =[ $smash1, sham_smash2 ] { +sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); +ai_charge(2);}; +void() sham_smash2 =[ $smash2, sham_smash3 ] {ai_charge(6);}; +void() sham_smash3 =[ $smash3, sham_smash4 ] {ai_charge(6);}; +void() sham_smash4 =[ $smash4, sham_smash5 ] {ai_charge(5);}; +void() sham_smash5 =[ $smash5, sham_smash6 ] {ai_charge(4);}; +void() sham_smash6 =[ $smash6, sham_smash7 ] {ai_charge(1);}; +void() sham_smash7 =[ $smash7, sham_smash8 ] {ai_charge(0);}; +void() sham_smash8 =[ $smash8, sham_smash9 ] {ai_charge(0);}; +void() sham_smash9 =[ $smash9, sham_smash10 ] {ai_charge(0);}; +void() sham_smash10 =[ $smash10, sham_smash11 ] { +vector delta; +float ldmg; + + if(!self.enemy) + return; + ai_charge(0); + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + if(!CanDamage(self.enemy, self)) + return; + + ldmg = (random() + random() + random()) * 40; + T_Damage(self.enemy, self, self, ldmg); + sound(self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); + + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); +}; +void() sham_smash11 =[ $smash11, sham_smash12 ] {ai_charge(5);}; +void() sham_smash12 =[ $smash12, sham_run1 ] {ai_charge(4);}; + +void() sham_swingr1; + +void(float side) ShamClaw = +{ +vector delta; +float ldmg; + + if(!self.enemy) + return; + ai_charge(10); + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + ldmg = (random() + random() + random()) * 20; + T_Damage(self.enemy, self, self, ldmg); + sound(self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); + + if(side) + { + makevectors(self.angles); + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); + } +}; + +void() sham_swingl1 =[ $swingl1, sham_swingl2 ] { +sound(self, CHAN_VOICE, "shambler/melee2.wav", 1, ATTN_NORM); +ai_charge(5);}; +void() sham_swingl2 =[ $swingl2, sham_swingl3 ] {ai_charge(3);}; +void() sham_swingl3 =[ $swingl3, sham_swingl4 ] {ai_charge(7);}; +void() sham_swingl4 =[ $swingl4, sham_swingl5 ] {ai_charge(3);}; +void() sham_swingl5 =[ $swingl5, sham_swingl6 ] {ai_charge(7);}; +void() sham_swingl6 =[ $swingl6, sham_swingl7 ] {ai_charge(9);}; +void() sham_swingl7 =[ $swingl7, sham_swingl8 ] {ai_charge(5); ShamClaw(250);}; +void() sham_swingl8 =[ $swingl8, sham_swingl9 ] {ai_charge(4);}; +void() sham_swingl9 =[ $swingl9, sham_run1 ] { +ai_charge(8); +if(random()<0.5) + self.think = sham_swingr1; +}; + +void() sham_swingr1 =[ $swingr1, sham_swingr2 ] { +sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); +ai_charge(1);}; +void() sham_swingr2 =[ $swingr2, sham_swingr3 ] {ai_charge(8);}; +void() sham_swingr3 =[ $swingr3, sham_swingr4 ] {ai_charge(14);}; +void() sham_swingr4 =[ $swingr4, sham_swingr5 ] {ai_charge(7);}; +void() sham_swingr5 =[ $swingr5, sham_swingr6 ] {ai_charge(3);}; +void() sham_swingr6 =[ $swingr6, sham_swingr7 ] {ai_charge(6);}; +void() sham_swingr7 =[ $swingr7, sham_swingr8 ] {ai_charge(6); ShamClaw(-250);}; +void() sham_swingr8 =[ $swingr8, sham_swingr9 ] {ai_charge(3);}; +void() sham_swingr9 =[ $swingr9, sham_run1 ] {ai_charge(1); +ai_charge(10); +if(random()<0.5) + self.think = sham_swingl1; +}; + +void() sham_melee = +{ + float chance; + + chance = random(); + if(chance > 0.6 || self.health == 600) + sham_smash1(); + else if(chance > 0.3) + sham_swingr1(); + else + sham_swingl1(); +}; + + +//============================================================================ + +void() CastLightning = +{ + vector org, dir; + + self.effects = self.effects | EF_MUZZLEFLASH; + + ai_face(); + + org = self.origin + '0 0 40'; + + dir = self.enemy.origin + '0 0 16' - org; + dir = normalize(dir); + + traceline(org, self.origin + dir*600, TRUE, self); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity(MSG_BROADCAST, self); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, org); + WriteVec3(MSG_BROADCAST, trace_endpos); + + LightningDamage(org, trace_endpos, self, 10); +}; + +void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face(); + sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM); +}; +void() sham_magic2 =[ $magic2, sham_magic3 ] {ai_face();}; +void() sham_magic3 =[ $magic3, sham_magic4 ] {ai_face();self.nextthink = self.nextthink + 0.2; +entity o; + +self.effects = self.effects | EF_MUZZLEFLASH; +ai_face(); +self.owner = spawn(); +o = self.owner; +setmodel(o, "progs/s_light.mdl"); +setorigin(o, self.origin); +o.angles = self.angles; +o.nextthink = time + 0.7; +o.think = SUB_Remove; +}; +void() sham_magic4 =[ $magic4, sham_magic5 ] +{ +self.effects = self.effects | EF_MUZZLEFLASH; +self.owner.frame = 1; +}; +void() sham_magic5 =[ $magic5, sham_magic6 ] +{ +self.effects = self.effects | EF_MUZZLEFLASH; +self.owner.frame = 2; +}; +void() sham_magic6 =[ $magic6, sham_magic9 ] +{ +remove(self.owner); +CastLightning(); +sound(self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM); +}; +void() sham_magic9 =[ $magic9, sham_magic10 ] +{CastLightning();}; +void() sham_magic10 =[ $magic10, sham_magic11 ] +{CastLightning();}; +void() sham_magic11 =[ $magic11, sham_magic12 ] +{ +if(skill == 3) + CastLightning(); +}; +void() sham_magic12 =[ $magic12, sham_run1 ] {}; + + + +void() sham_pain1 =[ $pain1, sham_pain2 ] {}; +void() sham_pain2 =[ $pain2, sham_pain3 ] {}; +void() sham_pain3 =[ $pain3, sham_pain4 ] {}; +void() sham_pain4 =[ $pain4, sham_pain5 ] {}; +void() sham_pain5 =[ $pain5, sham_pain6 ] {}; +void() sham_pain6 =[ $pain6, sham_run1 ] {}; + +void(entity attacker, float damage) sham_pain = +{ + sound(self, CHAN_VOICE, "shambler/shurt2.wav", 1, ATTN_NORM); + + if(self.health <= 0) + return; // allready dying, don't go into pain frame + + if(random()*400 > damage) + return; // didn't flinch + + if(self.pain_finished > time) + return; + self.pain_finished = time + 2; + + sham_pain1(); +}; + + +//============================================================================ + +void(entity entPlayer) ShamblerDropImpl = +{ + if(!TryEnemyDrop(self, entPlayer, WID_LIGHTNING, 0.5)) + if(!TryEnemyDrop(self, entPlayer, WID_PROXIMITY_GUN, 0.4)) + if(!TryEnemyDrop(self, entPlayer, WID_ROCKET_LAUNCHER, 0.4)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_NAILGUN, 0.2)) + if(!TryEnemyDrop(self, entPlayer, WID_NAILGUN, 0.2)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_SHOTGUN, 0.1)) + if(!TryEnemyDrop(self, entPlayer, WID_SHOTGUN, 0.1)) + if(!TryEnemyDrop(self, entPlayer, WID_AXE, 0.1)) + if(!TryEnemyDrop(self, entPlayer, WID_MJOLNIR, 0.1)) + { /* Intentionally empty. */ } +} + +void() ShamblerDrop = +{ + entity entPlayer; + entPlayer = FindEntPlayerForDrop(); + + self.solid = SOLID_NOT; + + if(entPlayer != world) + { + if(ShouldDropEnemyWpn(0.45)) { ShamblerDropImpl(entPlayer); } + if(ShouldDropEnemyWpn(0.45)) { ShamblerDropImpl(entPlayer); } + } +} + + +void() sham_death1 =[ $death1, sham_death2 ] {}; +void() sham_death2 =[ $death2, sham_death3 ] {}; +void() sham_death3 =[ $death3, sham_death4 ] {ShamblerDrop();}; +void() sham_death4 =[ $death4, sham_death5 ] {}; +void() sham_death5 =[ $death5, sham_death6 ] {}; +void() sham_death6 =[ $death6, sham_death7 ] {}; +void() sham_death7 =[ $death7, sham_death8 ] {}; +void() sham_death8 =[ $death8, sham_death9 ] {}; +void() sham_death9 =[ $death9, sham_death10 ] {}; +void() sham_death10 =[ $death10, sham_death11 ] {}; +void() sham_death11 =[ $death11, sham_death11 ] {monster_check_remove_corpse();}; + +void() sham_die = +{ +// check for gib + if(self.health < -60) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_shams.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + ShamblerDrop(); + return; + } + +// regular death + sound(self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM); + sham_death1(); +}; + +//============================================================================ + + +/*QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush +*/ +void() monster_shambler = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/shambler.mdl"); + precache_model("progs/s_light.mdl"); + precache_model("progs/h_shams.mdl"); + precache_model("progs/bolt.mdl"); + + precache_sound("shambler/sattck1.wav"); + precache_sound("shambler/sboom.wav"); + precache_sound("shambler/sdeath.wav"); + precache_sound("shambler/shurt2.wav"); + precache_sound("shambler/sidle.wav"); + precache_sound("shambler/ssight.wav"); + precache_sound("shambler/melee1.wav"); + precache_sound("shambler/melee2.wav"); + precache_sound("shambler/smack.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + + self.health = 600; + + self.th_stand = sham_stand1; + self.th_walk = sham_walk1; + self.th_run = sham_run1; + self.th_die = sham_die; + self.th_melee = sham_melee; + self.th_missile = sham_magic1; + self.th_pain = sham_pain; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = shambler_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/shambler.mdl"); + setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX); + + walkmonster_start(); +}; diff --git a/QC/orig_mon_soldier.qc b/QC/orig_mon_soldier.qc new file mode 100644 index 00000000..0712c28b --- /dev/null +++ b/QC/orig_mon_soldier.qc @@ -0,0 +1,338 @@ +/* +============================================================================== + +SOLDIER / PLAYER + +============================================================================== +*/ + +$cd id1/models/soldier3 +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 + +$frame load1 load2 load3 load4 load5 load6 load7 load8 load9 load10 load11 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 shoot9 + +$frame prowl_1 prowl_2 prowl_3 prowl_4 prowl_5 prowl_6 prowl_7 prowl_8 +$frame prowl_9 prowl_10 prowl_11 prowl_12 prowl_13 prowl_14 prowl_15 prowl_16 +$frame prowl_17 prowl_18 prowl_19 prowl_20 prowl_21 prowl_22 prowl_23 prowl_24 + +/* +============================================================================== +SOLDIER CODE +============================================================================== +*/ + +void() army_stand1 =[ $stand1, army_stand2 ] {ai_stand();}; +void() army_stand2 =[ $stand2, army_stand3 ] {ai_stand();}; +void() army_stand3 =[ $stand3, army_stand4 ] {ai_stand();}; +void() army_stand4 =[ $stand4, army_stand5 ] {ai_stand();}; +void() army_stand5 =[ $stand5, army_stand6 ] {ai_stand();}; +void() army_stand6 =[ $stand6, army_stand7 ] {ai_stand();}; +void() army_stand7 =[ $stand7, army_stand8 ] {ai_stand();}; +void() army_stand8 =[ $stand8, army_stand1 ] {ai_stand();}; + +void() army_walk1 =[ $prowl_1, army_walk2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); +ai_walk(1);}; +void() army_walk2 =[ $prowl_2, army_walk3 ] {ai_walk(1);}; +void() army_walk3 =[ $prowl_3, army_walk4 ] {ai_walk(1);}; +void() army_walk4 =[ $prowl_4, army_walk5 ] {ai_walk(1);}; +void() army_walk5 =[ $prowl_5, army_walk6 ] {ai_walk(2);}; +void() army_walk6 =[ $prowl_6, army_walk7 ] {ai_walk(3);}; +void() army_walk7 =[ $prowl_7, army_walk8 ] {ai_walk(4);}; +void() army_walk8 =[ $prowl_8, army_walk9 ] {ai_walk(4);}; +void() army_walk9 =[ $prowl_9, army_walk10 ] {ai_walk(2);}; +void() army_walk10 =[ $prowl_10, army_walk11 ] {ai_walk(2);}; +void() army_walk11 =[ $prowl_11, army_walk12 ] {ai_walk(2);}; +void() army_walk12 =[ $prowl_12, army_walk13 ] {ai_walk(1);}; +void() army_walk13 =[ $prowl_13, army_walk14 ] {ai_walk(0);}; +void() army_walk14 =[ $prowl_14, army_walk15 ] {ai_walk(1);}; +void() army_walk15 =[ $prowl_15, army_walk16 ] {ai_walk(1);}; +void() army_walk16 =[ $prowl_16, army_walk17 ] {ai_walk(1);}; +void() army_walk17 =[ $prowl_17, army_walk18 ] {ai_walk(3);}; +void() army_walk18 =[ $prowl_18, army_walk19 ] {ai_walk(3);}; +void() army_walk19 =[ $prowl_19, army_walk20 ] {ai_walk(3);}; +void() army_walk20 =[ $prowl_20, army_walk21 ] {ai_walk(3);}; +void() army_walk21 =[ $prowl_21, army_walk22 ] {ai_walk(2);}; +void() army_walk22 =[ $prowl_22, army_walk23 ] {ai_walk(1);}; +void() army_walk23 =[ $prowl_23, army_walk24 ] {ai_walk(1);}; +void() army_walk24 =[ $prowl_24, army_walk1 ] {ai_walk(1);}; + +void() army_run1 =[ $run1, army_run2 ] { +if(random() < 0.2) + sound(self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); +ai_run(11);}; +void() army_run2 =[ $run2, army_run3 ] {ai_run(15);}; +void() army_run3 =[ $run3, army_run4 ] {ai_run(10);}; +void() army_run4 =[ $run4, army_run5 ] {ai_run(10);}; +void() army_run5 =[ $run5, army_run6 ] {ai_run(8);}; +void() army_run6 =[ $run6, army_run7 ] {ai_run(15);}; +void() army_run7 =[ $run7, army_run8 ] {ai_run(10);}; +void() army_run8 =[ $run8, army_run1 ] {ai_run(8);}; + +void() army_atk1 =[ $shoot1, army_atk2 ] {ai_face();}; +void() army_atk2 =[ $shoot2, army_atk3 ] {ai_face();}; +void() army_atk3 =[ $shoot3, army_atk4 ] {ai_face();}; +void() army_atk4 =[ $shoot4, army_atk5 ] {ai_face();}; +void() army_atk5 =[ $shoot5, army_atk6 ] {ai_face();army_fire(); +self.effects = self.effects | EF_MUZZLEFLASH;}; +void() army_atk6 =[ $shoot6, army_atk7 ] {ai_face();}; +void() army_atk7 =[ $shoot7, army_atk8 ] {ai_face();SUB_CheckRefire (army_atk1);}; +void() army_atk8 =[ $shoot8, army_atk9 ] {ai_face();}; +void() army_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + + +void() army_pain1 =[ $pain1, army_pain2 ] {}; +void() army_pain2 =[ $pain2, army_pain3 ] {}; +void() army_pain3 =[ $pain3, army_pain4 ] {}; +void() army_pain4 =[ $pain4, army_pain5 ] {}; +void() army_pain5 =[ $pain5, army_pain6 ] {}; +void() army_pain6 =[ $pain6, army_run1 ] {ai_pain(1);}; + +void() army_painb1 =[ $painb1, army_painb2 ] {}; +void() army_painb2 =[ $painb2, army_painb3 ] {ai_painforward(13);}; +void() army_painb3 =[ $painb3, army_painb4 ] {ai_painforward(9);}; +void() army_painb4 =[ $painb4, army_painb5 ] {}; +void() army_painb5 =[ $painb5, army_painb6 ] {}; +void() army_painb6 =[ $painb6, army_painb7 ] {}; +void() army_painb7 =[ $painb7, army_painb8 ] {}; +void() army_painb8 =[ $painb8, army_painb9 ] {}; +void() army_painb9 =[ $painb9, army_painb10] {}; +void() army_painb10=[ $painb10, army_painb11] {}; +void() army_painb11=[ $painb11, army_painb12] {}; +void() army_painb12=[ $painb12, army_painb13] {ai_pain(2);}; +void() army_painb13=[ $painb13, army_painb14] {}; +void() army_painb14=[ $painb14, army_run1 ] {}; + +void() army_painc1 =[ $painc1, army_painc2 ] {}; +void() army_painc2 =[ $painc2, army_painc3 ] {ai_pain(1);}; +void() army_painc3 =[ $painc3, army_painc4 ] {}; +void() army_painc4 =[ $painc4, army_painc5 ] {}; +void() army_painc5 =[ $painc5, army_painc6 ] {ai_painforward(1);}; +void() army_painc6 =[ $painc6, army_painc7 ] {ai_painforward(1);}; +void() army_painc7 =[ $painc7, army_painc8 ] {}; +void() army_painc8 =[ $painc8, army_painc9 ] {ai_pain(1);}; +void() army_painc9 =[ $painc9, army_painc10] {ai_painforward(4);}; +void() army_painc10=[ $painc10, army_painc11] {ai_painforward(3);}; +void() army_painc11=[ $painc11, army_painc12] {ai_painforward(6);}; +void() army_painc12=[ $painc12, army_painc13] {ai_painforward(8);}; +void() army_painc13=[ $painc13, army_run1] {}; + +void(entity attacker, float damage) army_pain = +{ + float r; + + if(self.pain_finished > time) + return; + + r = random(); + + if(r < 0.2) + { + self.pain_finished = time + 0.6; + army_pain1(); + sound(self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); + } + else if(r < 0.6) + { + self.pain_finished = time + 1.1; + army_painb1(); + sound(self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + } + else + { + self.pain_finished = time + 1.1; + army_painc1(); + sound(self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + } +}; + + +void() army_fire = +{ + // vector src, vec; + vector dir; + entity en; + + ai_face(); + + sound(self, CHAN_WEAPON, "soldier/sattck1.wav", 1, ATTN_NORM); + + // TODO VR: (P2) opportunity for extra difficulty + // fire somewhat behind the player, so a dodging player is harder to hit + en = self.enemy; + + // TODO VR: (P2) this works + // self.scale = ((self.scale + '1 1 1') * 1.1) - '1 1 1'; + + dir = en.origin - en.velocity*0.2; + dir = normalize(dir - self.origin); + + EnemyFireBullets(4, dir, '0.1 0.1 0'); + + // TODO VR: (P2) nail shooting variant? + // makevectors(self.angles); + // src = self.origin - '0 0 19' + v_forward*14; + // vec = (self.enemy.origin + (200*v_forward)) - src; + // vec = normalize(vec); + // sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + // launch_spike (src, vec); + + // HONEY + // TODO VR: (P1) check how this works, also might be wrong in plasma and + // other missile fns + self.damage_weapon = IT_SHOTGUN; +}; + +void() SoldierDrop = +{ + entity entPlayer; + entPlayer = FindEntPlayerForDrop(); + + self.solid = SOLID_NOT; + self.ammo_shells = 5; + DropBackpack(); + + if(entPlayer != world && ShouldDropEnemyWpn(0.45)) + { + if(!TryEnemyDrop(self, entPlayer, WID_AXE, 0.2)) + if(!TryEnemyDrop(self, entPlayer, WID_SHOTGUN, 0.4)) + if(!TryEnemyDrop(self, entPlayer, WID_SUPER_SHOTGUN, 0.6)) + { /* Intentionally empty. */ } + } +} + +void() army_die1 =[ $death1, army_die2 ] {}; +void() army_die2 =[ $death2, army_die3 ] {}; +void() army_die3 =[ $death3, army_die4 ] +{ + SoldierDrop(); +}; +void() army_die4 =[ $death4, army_die5 ] {}; +void() army_die5 =[ $death5, army_die6 ] {}; +void() army_die6 =[ $death6, army_die7 ] {}; +void() army_die7 =[ $death7, army_die8 ] {}; +void() army_die8 =[ $death8, army_die9 ] {}; +void() army_die9 =[ $death9, army_die10 ] {}; +void() army_die10 =[ $death10, army_die10 ] {monster_check_remove_corpse();}; + +void() army_cdie1 =[ $deathc1, army_cdie2 ] {}; +void() army_cdie2 =[ $deathc2, army_cdie3 ] {ai_back(5);}; +void() army_cdie3 =[ $deathc3, army_cdie4 ] +{ + SoldierDrop(); + ai_back(4); +}; +void() army_cdie4 =[ $deathc4, army_cdie5 ] {ai_back(13);}; +void() army_cdie5 =[ $deathc5, army_cdie6 ] {ai_back(3);}; +void() army_cdie6 =[ $deathc6, army_cdie7 ] {ai_back(4);}; +void() army_cdie7 =[ $deathc7, army_cdie8 ] {}; +void() army_cdie8 =[ $deathc8, army_cdie9 ] {}; +void() army_cdie9 =[ $deathc9, army_cdie10 ] {}; +void() army_cdie10 =[ $deathc10, army_cdie11 ] {}; +void() army_cdie11 =[ $deathc11, army_cdie11 ] {monster_check_remove_corpse();}; + + +void() army_die = +{ +// check for gib + if(self.health < -35) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_guard.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); + SoldierDrop(); + return; + } + +// regular death + sound(self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); + if(random() < 0.5) + army_die1(); + else + army_cdie1(); +}; + + +/*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush +*/ +void() monster_army = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/soldier.mdl"); + precache_model("progs/h_guard.mdl"); + precache_model("progs/gib1.mdl"); + precache_model("progs/gib2.mdl"); + precache_model("progs/gib3.mdl"); + + precache_sound("soldier/death1.wav"); + precache_sound("soldier/idle.wav"); + precache_sound("soldier/pain1.wav"); + precache_sound("soldier/pain2.wav"); + precache_sound("soldier/sattck1.wav"); + precache_sound("soldier/sight1.wav"); + + precache_sound("player/udeath.wav"); // gib death + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + + + // TODO VR: (P2) this works + // self.scale_origin = '0 0 25'; + + self.health = 30; + + self.th_stand = army_stand1; + self.th_walk = army_walk1; + self.th_run = army_run1; + self.th_missile = army_atk1; + self.th_pain = army_pain; + self.th_die = army_die; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = army_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/soldier.mdl"); + setsize(self, '-12 -12 -24', '12 12 27'); + + walkmonster_start(); +}; diff --git a/QC/orig_mon_tarbaby.qc b/QC/orig_mon_tarbaby.qc new file mode 100644 index 00000000..7fd78212 --- /dev/null +++ b/QC/orig_mon_tarbaby.qc @@ -0,0 +1,380 @@ +/* +============================================================================== + +BLOB + +============================================================================== +*/ + +$cd id1/models/tarbaby +$origin 0 0 24 +$base base + +//$skin skin +$skin base +$skin skin2 +$skin skin + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 +$frame walk20 walk21 walk22 walk23 walk24 walk25 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13 +$frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23 +$frame run24 run25 + +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +$frame fly1 fly2 fly3 fly4 + +$frame exp + +void() tbaby_stand1 =[ $walk1, tbaby_stand1 ] {ai_stand();}; + +void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();}; + +void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();}; +void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();}; +void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();}; +void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();}; +void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();}; +void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_turn();}; +void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_turn();}; +void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_turn();}; +void() tbaby_walk9 =[ $walk9, tbaby_walk10 ] {ai_turn();}; +void() tbaby_walk10 =[ $walk10, tbaby_walk11 ] {ai_turn();}; +void() tbaby_walk11 =[ $walk11, tbaby_walk12 ] {ai_walk(2);}; +void() tbaby_walk12 =[ $walk12, tbaby_walk13 ] {ai_walk(2);}; +void() tbaby_walk13 =[ $walk13, tbaby_walk14 ] {ai_walk(2);}; +void() tbaby_walk14 =[ $walk14, tbaby_walk15 ] {ai_walk(2);}; +void() tbaby_walk15 =[ $walk15, tbaby_walk16 ] {ai_walk(2);}; +void() tbaby_walk16 =[ $walk16, tbaby_walk17 ] {ai_walk(2);}; +void() tbaby_walk17 =[ $walk17, tbaby_walk18 ] {ai_walk(2);}; +void() tbaby_walk18 =[ $walk18, tbaby_walk19 ] {ai_walk(2);}; +void() tbaby_walk19 =[ $walk19, tbaby_walk20 ] {ai_walk(2);}; +void() tbaby_walk20 =[ $walk20, tbaby_walk21 ] {ai_walk(2);}; +void() tbaby_walk21 =[ $walk21, tbaby_walk22 ] {ai_walk(2);}; +void() tbaby_walk22 =[ $walk22, tbaby_walk23 ] {ai_walk(2);}; +void() tbaby_walk23 =[ $walk23, tbaby_walk24 ] {ai_walk(2);}; +void() tbaby_walk24 =[ $walk24, tbaby_walk25 ] {ai_walk(2);}; +void() tbaby_walk25 =[ $walk25, tbaby_walk1 ] {ai_walk(2);}; + +void() tbaby_run1 =[ $run1, tbaby_run2 ] {ai_face();}; +void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();}; +void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();}; +void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();}; +void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();}; +void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();}; +void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_face();}; +void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_face();}; +void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_face();}; +void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_face();}; +void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);}; +void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(2);}; +void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(2);}; +void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(2);}; +void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_run(2);}; +void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_run(2);}; +void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);}; +void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(2);}; +void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(2);}; +void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(2);}; +void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(2);}; +void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);}; +void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);}; +void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(2);}; +void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(2);}; + + +//============================================================================ + +void() Tar_JumpTouch = +{ + float ldmg; + + if(other.takedamage && other.classname != self.classname) + { + if(vlen(self.velocity) > 400) + { + ldmg = 10 + 10*random(); + T_Damage(other, self, self, ldmg); + sound(self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM); + } + } + else + sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); + + + if(!checkbottom(self)) + { + if(self.flags & FL_ONGROUND) + { // jump randomly to not get hung up +//dprint("popjump\n"); + self.touch = SUB_Null; + self.think = tbaby_run1; + self.movetype = MOVETYPE_STEP; + self.nextthink = time + 0.1; + +// self.velocity_x = (random() - 0.5) * 600; +// self.velocity_y = (random() - 0.5) * 600; +// self.velocity_z = 200; +// self.flags = self.flags - FL_ONGROUND; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = tbaby_jump1; + self.nextthink = time + 0.1; +}; + +void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {}; +void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {}; +void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {}; +void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] { +self.cnt = self.cnt + 1; +if(self.cnt == 4) +{ +//dprint("spawn hop\n"); +tbaby_jump5(); +} +}; + +void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();}; +void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();}; +void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();}; +void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();}; +void() tbaby_jump5 =[ $jump5, tbaby_jump6 ] +{ + // HONEY + vector power; + if(self.spawnflags & SPAWNFLAG_TBABY_LIVID){ + self.th_missile = tbaby_jump1; //Reset + self.spawnflags = self.spawnflags - SPAWNFLAG_TBABY_LIVID; + } + + self.movetype = MOVETYPE_BOUNCE; + self.touch = Tar_JumpTouch; + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + + // HONEY + if(self.spawnflags & SPAWNFLAG_TBABY_HIPHOP){// Makes it start off by jumping really high the first time + self.velocity = v_forward * 150 + '0 0 700'; + self.spawnflags = self.spawnflags - SPAWNFLAG_TBABY_HIPHOP; + }else{ + power = '0 0 0' ; + power_z = self.distance; + self.velocity = v_forward * 600 + power; + self.velocity_z = self.velocity_z + random()*150; + self.distance = 200; + } + + self.velocity_z = self.velocity_z + random()*150; + if(self.flags & FL_ONGROUND) + self.flags = self.flags - FL_ONGROUND; + self.cnt = 0; +}; +void() tbaby_jump6 =[ $jump6,tbaby_fly1 ] {}; + + + +//============================================================================= + +void() tbaby_die1 =[ $exp, tbaby_die2 ] { +self.takedamage = DAMAGE_NO; +}; +void() tbaby_die2 =[ $exp, tbaby_run1 ] +{ + T_RadiusDamage(self, self, 120, world); + + sound(self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_TAREXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + BecomeExplosion(); +}; + +//============================================================================= + + +void() tbaby_checknew = +{ + if(!walkmove(0,0)) + { + remove(self); + return; + } + + self.enemy = self.enemy; + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + self.th_missile = tbaby_jump1; + self.th_melee = tbaby_jump1; + self.th_die = tbaby_die1; + self.origin_z = self.origin_z + 1; // raise off floor a bit + droptofloor(); + + if(!walkmove(0,0)) + { + self.owner.th_pain = tbaby_mitosis; + remove(self); + return; + } + + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + if(!self.yaw_speed) + self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + self.use = monster_use; + self.flags = self.flags | FL_MONSTER; + self.pausetime = 99999999; + self.th_stand (); + self.nextthink = self.nextthink + random()*0.5; + + total_monsters = total_monsters + 1; + + WriteByte(MSG_BROADCAST, SVC_UPDATESTAT); + WriteByte(MSG_BROADCAST, STAT_TOTALMONSTERS); + WriteLong (MSG_BROADCAST, total_monsters); +}; + +void(entity attacker, float damage) tbaby_mitosis = +{ + entity newSpawn; + + if(random() < 0.35) + { + newSpawn = spawn(); + newSpawn.classname = self.classname; + newSpawn.movetype = MOVETYPE_STEP; + setsize(newSpawn, '-16 -16 -24', '16 16 40'); + newSpawn.health = 80; + if(self.skin == 1) + newSpawn.health = 60; + else if(self.skin == 2) + newSpawn.health = 100; + + newSpawn.owner = self; + self.th_pain = SUB_NullPain; + + setmodel(newSpawn, "progs/tarbaby.mdl"); + newSpawn.solid = SOLID_SLIDEBOX; + newSpawn.skin = self.skin; + + setorigin(newSpawn, self.origin); + newSpawn.think = tbaby_checknew; + newSpawn.nextthink = time + 0.5; + + sound(newSpawn, CHAN_VOICE, "blob/mytosis.wav", 1, ATTN_NORM); + } +}; + +/*QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush Blue Green Spots +The Spawn (and hellspawn) + +The spawn type is random by default. +If you want a specific type, select "Blue", "Green", or "Spots". +*/ +void() monster_tarbaby = +{ + float myRand; + float skillLevel; + + if(deathmatch) + { + remove(self); + return; + } + precache_model2("progs/tarbaby.mdl"); + + precache_sound2("blob/death1.wav"); + precache_sound2("blob/hit1.wav"); + precache_sound2("blob/land1.wav"); + precache_sound2("blob/sight1.wav"); + precache_sound2("blob/mytosis.wav"); + + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + + self.health = 80; + + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + + // HONEY + if(self.spawnflags & SPAWNFLAG_TBABY_LIVID) { self.th_missile = tbaby_jump5; } // Really go flying + else { self.th_missile = tbaby_jump1; } + + self.th_melee = tbaby_jump1; + self.th_die = tbaby_die1; + + // TODO VR: (P0) might need to control with cvar due to missing resources + // ROGUE + if(self.spawnflags & 8) + { + self.th_pain = tbaby_mitosis; + self.skin = 2; + self.health = 100; + } + else if(self.spawnflags & 4) + { + self.th_pain = tbaby_mitosis; + self.skin = 1; + self.health = 60; + } + else if(self.spawnflags & 2) + { + self.skin = 0; + } + else + { + skillLevel = cvar_hget(cvarh_skill); + myRand = skillLevel * 0.2; + myRand = myRand + random(); + + if(myRand > 0.8 && skillLevel > 1) + { + self.th_pain = tbaby_mitosis; + self.skin = 2; + self.health = 100; + } + else if(myRand > 0.5) + { + self.th_pain = tbaby_mitosis; + self.skin = 1; + self.health = 60; + } + else + { + self.skin = 0; + } + } + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = tarbaby_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/tarbaby.mdl"); + setsize(self, '-12 -12 -24', '12 12 24'); + + + walkmonster_start(); +}; + diff --git a/QC/orig_mon_wizard.qc b/QC/orig_mon_wizard.qc new file mode 100644 index 00000000..8cb361f7 --- /dev/null +++ b/QC/orig_mon_wizard.qc @@ -0,0 +1,421 @@ +/* +============================================================================== + +WIZARD + +============================================================================== +*/ + +$cd id1/models/a_wizard +$origin 0 0 24 +$base wizbase +$skin wizbase + +$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 +$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 + +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 fly9 fly10 +$frame fly11 fly12 fly13 fly14 + +$frame magatt1 magatt2 magatt3 magatt4 magatt5 magatt6 magatt7 +$frame magatt8 magatt9 magatt10 magatt11 magatt12 magatt13 + +$frame pain1 pain2 pain3 pain4 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 + +/* +============================================================================== + +WIZARD + +If the player moves behind cover before the missile is launched, launch it +at the last visible spot with no velocity leading, in hopes that the player +will duck back out and catch it. +============================================================================== +*/ + +/* +============= +LaunchMissile + +Sets the given entities velocity and angles so that it will hit self.enemy +if self.enemy maintains it's current velocity +0.1 is moderately accurate, 0.0 is totally accurate +============= +*/ +void(entity missile, float mspeed, float accuracy) LaunchMissile = +{ + vector vec, move; + float fly; + + makevectors(self.angles); + +// set missile speed + vec = self.enemy.origin + self.enemy.mins + self.enemy.size * 0.7 - missile.origin; + +// calc aproximate time for missile to reach vec + fly = vlen(vec) / mspeed; + +// get the entities xy velocity + move = self.enemy.velocity; + move_z = 0; + +// project the target forward in time + vec = vec + move * fly; + + vec = normalize(vec); + vec = vec + accuracy*v_up*(random()- 0.5) + accuracy*v_right*(random()- 0.5); + + missile.velocity = vec * mspeed; + + missile.angles = '0 0 0'; + missile.angles_y = vectoyaw(missile.velocity); + +// set missile duration + missile.nextthink = time + 5; + missile.think = SUB_Remove; +}; + +/* +================= +WizardCheckAttack +================= +*/ +float() WizardCheckAttack = +{ + vector spot1, spot2; + entity targ; + float chance; + + if(time < self.attack_finished) + return FALSE; + if(!enemy_vis) + return FALSE; + + if(enemy_range == RANGE_FAR) + { + if(self.attack_state != AS_STRAIGHT) + { + self.attack_state = AS_STRAIGHT; + wiz_run1(); + } + return FALSE; + } + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline(spot1, spot2, FALSE, self); + + if(trace_ent != targ) + { // don't have a clear shot, so move to a side + if(self.attack_state != AS_STRAIGHT) + { + self.attack_state = AS_STRAIGHT; + wiz_run1(); + } + return FALSE; + } + + if(enemy_range == RANGE_MELEE) + chance = 0.9; + else if(enemy_range == RANGE_NEAR) + chance = 0.6; + else if(enemy_range == RANGE_MID) + chance = 0.2; + else + chance = 0; + + if(random () < chance) + { + self.attack_state = AS_MISSILE; + return TRUE; + } + + if(enemy_range == RANGE_MID) + { + if(self.attack_state != AS_STRAIGHT) + { + self.attack_state = AS_STRAIGHT; + wiz_run1(); + } + } + else + { + if(self.attack_state != AS_SLIDING) + { + self.attack_state = AS_SLIDING; + wiz_side1(); + } + } + + return FALSE; +}; + +/* +================= +WizardAttackFinished +================= +*/ +void() WizardAttackFinished = +{ + if(enemy_range >= RANGE_MID || !enemy_vis) + { + self.attack_state = AS_STRAIGHT; + self.think = wiz_run1; + } + else + { + self.attack_state = AS_SLIDING; + self.think = wiz_side1; + } +}; + +/* +============================================================================== + +FAST ATTACKS + +============================================================================== +*/ + +void() Wiz_FastFire = +{ + vector vec; + vector dst; + entity newmis; + + if(self.owner.health > 0) + { + self.owner.effects = self.owner.effects | EF_MUZZLEFLASH; + + makevectors(self.enemy.angles); + dst = self.enemy.origin - 13*self.movedir; + + vec = normalize(dst - self.origin); + sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + newmis = launch_spike (self.origin, vec); + newmis.velocity = vec*600; + newmis.owner = self.owner; + newmis.classname = "wizspike"; + setmodel(newmis, "progs/w_spike.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + } + + remove(self); +}; + + +void() Wiz_StartFast = +{ + entity missile; + + sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + self.v_angle = self.angles; + makevectors(self.angles); + + missile = spawn(); + missile.owner = self; + missile.nextthink = time + 0.6; + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin + '0 0 30' + v_forward*14 + v_right*14); + missile.enemy = self.enemy; + missile.nextthink = time + 0.8; + missile.think = Wiz_FastFire; + missile.movedir = v_right; + + missile = spawn(); + missile.owner = self; + missile.nextthink = time + 1; + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin + '0 0 30' + v_forward*14 + v_right* -14); + missile.enemy = self.enemy; + missile.nextthink = time + 0.3; + missile.think = Wiz_FastFire; + missile.movedir = VEC_ORIGIN - v_right; +}; + + + +void() Wiz_idlesound = +{ +float wr; + wr = random() * 5; + + if(self.waitmin < time) + { + self.waitmin = time + 2; + if(wr > 4.5) + sound(self, CHAN_VOICE, "wizard/widle1.wav", 1, ATTN_IDLE); + if(wr < 1.5) + sound(self, CHAN_VOICE, "wizard/widle2.wav", 1, ATTN_IDLE); + } + return; +}; + +void() wiz_stand1 =[ $hover1, wiz_stand2 ] {ai_stand();}; +void() wiz_stand2 =[ $hover2, wiz_stand3 ] {ai_stand();}; +void() wiz_stand3 =[ $hover3, wiz_stand4 ] {ai_stand();}; +void() wiz_stand4 =[ $hover4, wiz_stand5 ] {ai_stand();}; +void() wiz_stand5 =[ $hover5, wiz_stand6 ] {ai_stand();}; +void() wiz_stand6 =[ $hover6, wiz_stand7 ] {ai_stand();}; +void() wiz_stand7 =[ $hover7, wiz_stand8 ] {ai_stand();}; +void() wiz_stand8 =[ $hover8, wiz_stand1 ] {ai_stand();}; + +void() wiz_walk1 =[ $hover1, wiz_walk2 ] {ai_walk(8); +Wiz_idlesound();}; +void() wiz_walk2 =[ $hover2, wiz_walk3 ] {ai_walk(8);}; +void() wiz_walk3 =[ $hover3, wiz_walk4 ] {ai_walk(8);}; +void() wiz_walk4 =[ $hover4, wiz_walk5 ] {ai_walk(8);}; +void() wiz_walk5 =[ $hover5, wiz_walk6 ] {ai_walk(8);}; +void() wiz_walk6 =[ $hover6, wiz_walk7 ] {ai_walk(8);}; +void() wiz_walk7 =[ $hover7, wiz_walk8 ] {ai_walk(8);}; +void() wiz_walk8 =[ $hover8, wiz_walk1 ] {ai_walk(8);}; + +void() wiz_side1 =[ $hover1, wiz_side2 ] {ai_run(8); +Wiz_idlesound();}; +void() wiz_side2 =[ $hover2, wiz_side3 ] {ai_run(8);}; +void() wiz_side3 =[ $hover3, wiz_side4 ] {ai_run(8);}; +void() wiz_side4 =[ $hover4, wiz_side5 ] {ai_run(8);}; +void() wiz_side5 =[ $hover5, wiz_side6 ] {ai_run(8);}; +void() wiz_side6 =[ $hover6, wiz_side7 ] {ai_run(8);}; +void() wiz_side7 =[ $hover7, wiz_side8 ] {ai_run(8);}; +void() wiz_side8 =[ $hover8, wiz_side1 ] {ai_run(8);}; + +void() wiz_run1 =[ $fly1, wiz_run2 ] {ai_run(16); +Wiz_idlesound(); +}; +void() wiz_run2 =[ $fly2, wiz_run3 ] {ai_run(16);}; +void() wiz_run3 =[ $fly3, wiz_run4 ] {ai_run(16);}; +void() wiz_run4 =[ $fly4, wiz_run5 ] {ai_run(16);}; +void() wiz_run5 =[ $fly5, wiz_run6 ] {ai_run(16);}; +void() wiz_run6 =[ $fly6, wiz_run7 ] {ai_run(16);}; +void() wiz_run7 =[ $fly7, wiz_run8 ] {ai_run(16);}; +void() wiz_run8 =[ $fly8, wiz_run9 ] {ai_run(16);}; +void() wiz_run9 =[ $fly9, wiz_run10 ] {ai_run(16);}; +void() wiz_run10 =[ $fly10, wiz_run11 ] {ai_run(16);}; +void() wiz_run11 =[ $fly11, wiz_run12 ] {ai_run(16);}; +void() wiz_run12 =[ $fly12, wiz_run13 ] {ai_run(16);}; +void() wiz_run13 =[ $fly13, wiz_run14 ] {ai_run(16);}; +void() wiz_run14 =[ $fly14, wiz_run1 ] {ai_run(16);}; + +void() wiz_fast1 =[ $magatt1, wiz_fast2 ] {ai_face();Wiz_StartFast();}; +void() wiz_fast2 =[ $magatt2, wiz_fast3 ] {ai_face();}; +void() wiz_fast3 =[ $magatt3, wiz_fast4 ] {ai_face();}; +void() wiz_fast4 =[ $magatt4, wiz_fast5 ] {ai_face();}; +void() wiz_fast5 =[ $magatt5, wiz_fast6 ] {ai_face();}; +void() wiz_fast6 =[ $magatt6, wiz_fast7 ] {ai_face();}; +void() wiz_fast7 =[ $magatt5, wiz_fast8 ] {ai_face();}; +void() wiz_fast8 =[ $magatt4, wiz_fast9 ] {ai_face();}; +void() wiz_fast9 =[ $magatt3, wiz_fast10 ] {ai_face();}; +void() wiz_fast10 =[ $magatt2, wiz_run1 ] {ai_face();SUB_AttackFinished(2);WizardAttackFinished();}; + +void() wiz_pain1 =[ $pain1, wiz_pain2 ] {}; +void() wiz_pain2 =[ $pain2, wiz_pain3 ] {}; +void() wiz_pain3 =[ $pain3, wiz_pain4 ] {}; +void() wiz_pain4 =[ $pain4, wiz_run1 ] {}; + +void() wiz_death1 =[ $death1, wiz_death2 ] { + +self.velocity_x = -200 + 400*random(); +self.velocity_y = -200 + 400*random(); +self.velocity_z = 100 + 100*random(); +self.flags = self.flags - (self.flags & FL_ONGROUND); +sound(self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM); +}; +void() wiz_death2 =[ $death2, wiz_death3 ] {}; +void() wiz_death3 =[ $death3, wiz_death4 ]{self.solid = SOLID_NOT;}; +void() wiz_death4 =[ $death4, wiz_death5 ] {}; +void() wiz_death5 =[ $death5, wiz_death6 ] {}; +void() wiz_death6 =[ $death6, wiz_death7 ] {}; +void() wiz_death7 =[ $death7, wiz_death8 ] {}; +void() wiz_death8 =[ $death8, wiz_death8 ] {SUB_DoLaterSelf(monster_check_remove_corpse, 5);}; + +void() wiz_die = +{ +// check for gib + if(self.health < -40) + { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_wizard.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + return; + } + + wiz_death1(); +}; + + +void(entity attacker, float damage) Wiz_Pain = +{ + sound(self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM); + if(random()*70 > damage) + return; // didn't flinch + + wiz_pain1(); +}; + + +void() Wiz_Missile = +{ + wiz_fast1(); +}; + +/*QUAKED monster_wizard (1 0 0) (-16 -16 -24) (16 16 40) Ambush +*/ +void() monster_wizard = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/wizard.mdl"); + precache_model("progs/h_wizard.mdl"); + precache_model("progs/w_spike.mdl"); + + precache_sound("wizard/hit.wav"); // used by c code + precache_sound("wizard/wattack.wav"); + precache_sound("wizard/wdeath.wav"); + precache_sound("wizard/widle1.wav"); + precache_sound("wizard/widle2.wav"); + precache_sound("wizard/wpain.wav"); + precache_sound("wizard/wsight.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + + self.health = 80; + + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = Wiz_Missile; + self.th_pain = Wiz_Pain; + self.th_die = wiz_die; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = scrag_start; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/wizard.mdl"); + setsize(self, '-12 -12 -24', '12 12 42'); + + flymonster_start(); +}; diff --git a/QC/orig_mon_zombie.qc b/QC/orig_mon_zombie.qc new file mode 100644 index 00000000..73e0168a --- /dev/null +++ b/QC/orig_mon_zombie.qc @@ -0,0 +1,746 @@ +/* +============================================================================== + +ZOMBIE + +============================================================================== +*/ +$cd id1/models/zombie + +$origin 0 0 24 + +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 +$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 +$frame run13 run14 run15 run16 run17 run18 + +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11 +$frame atta12 atta13 + +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11 +$frame attb12 attb13 attb14 + +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11 +$frame attc12 + +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10 +$frame paina11 paina12 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19 +$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19 +$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28 +$frame paine29 paine30 + +$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6 cruc_7 +$frame cruc_8 cruc_9 cruc_10 cruc_11 cruc_12 cruc_13 +$frame cruc_14 cruc_15 cruc_16 + +float SPAWN_CRUCIFIED = 1; + +// ROGUE +float SPAWN_LYING = 2; +float SPAWN_AMBUSH = 4; +float SPAWN_SNEAKY = 8; + +//HIPNOTIC +float SPAWN_LYINGDOWN = 16; + +//============================================================================= + +.float inpain; + +void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand();}; +void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();}; +void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();}; +void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();}; +void() zombie_stand5 =[ $stand5, zombie_stand6 ] {ai_stand();}; +void() zombie_stand6 =[ $stand6, zombie_stand7 ] {ai_stand();}; +void() zombie_stand7 =[ $stand7, zombie_stand8 ] {ai_stand();}; +void() zombie_stand8 =[ $stand8, zombie_stand9 ] {ai_stand();}; +void() zombie_stand9 =[ $stand9, zombie_stand10 ] {ai_stand();}; +void() zombie_stand10 =[ $stand10, zombie_stand11 ] {ai_stand();}; +void() zombie_stand11 =[ $stand11, zombie_stand12 ] {ai_stand();}; +void() zombie_stand12 =[ $stand12, zombie_stand13 ] {ai_stand();}; +void() zombie_stand13 =[ $stand13, zombie_stand14 ] {ai_stand();}; +void() zombie_stand14 =[ $stand14, zombie_stand15 ] {ai_stand();}; +void() zombie_stand15 =[ $stand15, zombie_stand1 ] {ai_stand();}; + +// zombie_lurk is an improved version of what zombie did in zombie_crucXX +// with an added check for enemies if they're sneaky types... +void() zombie_lurk = +{ + if(self.spawnflags & SPAWN_SNEAKY) + { + // not pausing before attack, but looking for player. + if(!self.pain_finished) + { + if(FindTarget ()) + return; + } + else + { + // if we've waited long enough, pounce! + if(self.pain_finished < time) + { + self.think = zombie_escape1; + self.nextthink = time + 0.1; + return; + } + } + } + self.nextthink = time + 0.1 + random()*0.1; +}; + +void() zombie_cruc1 = [ $cruc_1, zombie_cruc2 ] + { + zombie_lurk(); + if(random() < 0.1) + sound(self, CHAN_VOICE, "zombie/idle_w2.wav", 1, ATTN_STATIC); + }; +void() zombie_cruc2 = [ $cruc_2, zombie_cruc3 ] { zombie_lurk(); }; +void() zombie_cruc3 = [ $cruc_3, zombie_cruc4 ] { zombie_lurk(); }; +void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] { zombie_lurk(); }; +void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] { zombie_lurk(); }; +void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] { zombie_lurk(); }; + +void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(0);}; +void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(2);}; +void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);}; +void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);}; +void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);}; +void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);}; +void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);}; +void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);}; +void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);}; +void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);}; +void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);}; +void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(2);}; +void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);}; +void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);}; +void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);}; +void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);}; +void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);}; +void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);}; +void() zombie_walk19 =[ $walk19, zombie_walk1 ] { +ai_walk(0); +if(random() < 0.2) + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);}; + +void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(1);self.inpain = 0;}; +void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);}; +void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);}; +void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);}; +void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);}; +void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);}; +void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);}; +void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);}; +void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(2);}; +void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(0);}; +void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(0);}; +void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(0);}; +void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(2);}; +void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);}; +void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(6);}; +void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(7);}; +void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(3);}; +void() zombie_run18 =[ $run18, zombie_run1 ] { +ai_run(8); +if(random() < 0.2) + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); +if(random() > 0.8) + sound(self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); +}; + +/* +============================================================================= + +ATTACKS + +============================================================================= +*/ + +void() ZombieGrenadeTouch = +{ + if(other == self.owner) + return; // don't explode on owner + if(other.takedamage) + { + T_Damage(other, self, self.owner, 10); + sound(self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + remove(self); + return; + } + sound(self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound + self.velocity = '0 0 0'; + self.avelocity = '0 0 0'; + self.touch = SUB_Remove; +}; + +/* +================ +ZombieFireGrenade +================ +*/ +void(vector st) ZombieFireGrenade = +{ + entity missile; + vector org; + + sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); + + missile = spawn(); + missile.classname = "zgrenade"; + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + +// calc org + org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up; + +// set missile speed + + makevectors(self.angles); + + missile.velocity = normalize(self.enemy.origin - org); + missile.velocity = missile.velocity * 600; + missile.velocity_z = 200; + + missile.avelocity = '3000 1000 2000'; + + missile.touch = ZombieGrenadeTouch; + +// set missile duration + missile.nextthink = time + 2.5; + missile.think = SUB_Remove; + + setmodel(missile, "progs/zom_gib.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, org); +}; + + +void() zombie_atta1 =[ $atta1, zombie_atta2 ] {ai_face();}; +void() zombie_atta2 =[ $atta2, zombie_atta3 ] {ai_face();}; +void() zombie_atta3 =[ $atta3, zombie_atta4 ] {ai_face();}; +void() zombie_atta4 =[ $atta4, zombie_atta5 ] {ai_face();}; +void() zombie_atta5 =[ $atta5, zombie_atta6 ] {ai_face();}; +void() zombie_atta6 =[ $atta6, zombie_atta7 ] {ai_face();}; +void() zombie_atta7 =[ $atta7, zombie_atta8 ] {ai_face();}; +void() zombie_atta8 =[ $atta8, zombie_atta9 ] {ai_face();}; +void() zombie_atta9 =[ $atta9, zombie_atta10 ] {ai_face();}; +void() zombie_atta10 =[ $atta10, zombie_atta11 ] {ai_face();}; +void() zombie_atta11 =[ $atta11, zombie_atta12 ] {ai_face();}; +void() zombie_atta12 =[ $atta12, zombie_atta13 ] {ai_face();}; +void() zombie_atta13 =[ $atta13, zombie_run1 ] {ai_face();ZombieFireGrenade('-10 -22 30');}; + +void() zombie_attb1 =[ $attb1, zombie_attb2 ] {ai_face();}; +void() zombie_attb2 =[ $attb2, zombie_attb3 ] {ai_face();}; +void() zombie_attb3 =[ $attb3, zombie_attb4 ] {ai_face();}; +void() zombie_attb4 =[ $attb4, zombie_attb5 ] {ai_face();}; +void() zombie_attb5 =[ $attb5, zombie_attb6 ] {ai_face();}; +void() zombie_attb6 =[ $attb6, zombie_attb7 ] {ai_face();}; +void() zombie_attb7 =[ $attb7, zombie_attb8 ] {ai_face();}; +void() zombie_attb8 =[ $attb8, zombie_attb9 ] {ai_face();}; +void() zombie_attb9 =[ $attb9, zombie_attb10 ] {ai_face();}; +void() zombie_attb10 =[ $attb10, zombie_attb11 ] {ai_face();}; +void() zombie_attb11 =[ $attb11, zombie_attb12 ] {ai_face();}; +void() zombie_attb12 =[ $attb12, zombie_attb13 ] {ai_face();}; +void() zombie_attb13 =[ $attb13, zombie_attb14 ] {ai_face();}; +void() zombie_attb14 =[ $attb13, zombie_run1 ] {ai_face();ZombieFireGrenade('-10 -24 29');}; + +void() zombie_attc1 =[ $attc1, zombie_attc2 ] {ai_face();}; +void() zombie_attc2 =[ $attc2, zombie_attc3 ] {ai_face();}; +void() zombie_attc3 =[ $attc3, zombie_attc4 ] {ai_face();}; +void() zombie_attc4 =[ $attc4, zombie_attc5 ] {ai_face();}; +void() zombie_attc5 =[ $attc5, zombie_attc6 ] {ai_face();}; +void() zombie_attc6 =[ $attc6, zombie_attc7 ] {ai_face();}; +void() zombie_attc7 =[ $attc7, zombie_attc8 ] {ai_face();}; +void() zombie_attc8 =[ $attc8, zombie_attc9 ] {ai_face();}; +void() zombie_attc9 =[ $attc9, zombie_attc10 ] {ai_face();}; +void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face();}; +void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face();}; +void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('-12 -19 29');}; + +void() zombie_missile = +{ + float r; + + droptofloor(); + r = random(); + + if(r < 0.3) + zombie_atta1(); + else if(r < 0.6) + zombie_attb1(); + else + zombie_attc1(); +}; + + +/* +============================================================================= + +PAIN + +============================================================================= +*/ + +void() zombie_paina1 =[ $paina1, zombie_paina2 ] {sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);}; +void() zombie_paina2 =[ $paina2, zombie_paina3 ] {ai_painforward(3);}; +void() zombie_paina3 =[ $paina3, zombie_paina4 ] {ai_painforward(1);}; +void() zombie_paina4 =[ $paina4, zombie_paina5 ] {ai_pain(1);}; +void() zombie_paina5 =[ $paina5, zombie_paina6 ] {ai_pain(3);}; +void() zombie_paina6 =[ $paina6, zombie_paina7 ] {ai_pain(1);}; +void() zombie_paina7 =[ $paina7, zombie_paina8 ] {}; +void() zombie_paina8 =[ $paina8, zombie_paina9 ] {}; +void() zombie_paina9 =[ $paina9, zombie_paina10 ] {}; +void() zombie_paina10 =[ $paina10, zombie_paina11 ] {}; +void() zombie_paina11 =[ $paina11, zombie_paina12 ] {}; +void() zombie_paina12 =[ $paina12, zombie_run1 ] {}; + +void() zombie_painb1 =[ $painb1, zombie_painb2 ] {sound(self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);}; +void() zombie_painb2 =[ $painb2, zombie_painb3 ] {ai_pain(2);}; +void() zombie_painb3 =[ $painb3, zombie_painb4 ] {ai_pain(8);}; +void() zombie_painb4 =[ $painb4, zombie_painb5 ] {ai_pain(6);}; +void() zombie_painb5 =[ $painb5, zombie_painb6 ] {ai_pain(2);}; +void() zombie_painb6 =[ $painb6, zombie_painb7 ] {}; +void() zombie_painb7 =[ $painb7, zombie_painb8 ] {}; +void() zombie_painb8 =[ $painb8, zombie_painb9 ] {}; +void() zombie_painb9 =[ $painb9, zombie_painb10 ] { + sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + + // HONEY + self.wad = ZOMBIE_ONGROUND; +}; +void() zombie_painb10 =[ $painb10, zombie_painb11 ] {}; +void() zombie_painb11 =[ $painb11, zombie_painb12 ] {}; +void() zombie_painb12 =[ $painb12, zombie_painb13 ] +{ + // HONEY + self.wad = ""; +}; +void() zombie_painb13 =[ $painb13, zombie_painb14 ] {}; +void() zombie_painb14 =[ $painb14, zombie_painb15 ] {}; +void() zombie_painb15 =[ $painb15, zombie_painb16 ] {}; +void() zombie_painb16 =[ $painb16, zombie_painb17 ] {}; +void() zombie_painb17 =[ $painb17, zombie_painb18 ] {}; +void() zombie_painb18 =[ $painb18, zombie_painb19 ] {}; +void() zombie_painb19 =[ $painb19, zombie_painb20 ] {}; +void() zombie_painb20 =[ $painb20, zombie_painb21 ] {}; +void() zombie_painb21 =[ $painb21, zombie_painb22 ] {}; +void() zombie_painb22 =[ $painb22, zombie_painb23 ] {}; +void() zombie_painb23 =[ $painb23, zombie_painb24 ] {}; +void() zombie_painb24 =[ $painb24, zombie_painb25 ] {}; +void() zombie_painb25 =[ $painb25, zombie_painb26 ] {ai_painforward(1);}; +void() zombie_painb26 =[ $painb26, zombie_painb27 ] {}; +void() zombie_painb27 =[ $painb27, zombie_painb28 ] {}; +void() zombie_painb28 =[ $painb28, zombie_run1 ] {}; + +void() zombie_painc1 =[ $painc1, zombie_painc2 ] {sound(self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);}; +void() zombie_painc2 =[ $painc2, zombie_painc3 ] {}; +void() zombie_painc3 =[ $painc3, zombie_painc4 ] {ai_pain(3);}; +void() zombie_painc4 =[ $painc4, zombie_painc5 ] {ai_pain(1);}; +void() zombie_painc5 =[ $painc5, zombie_painc6 ] {}; +void() zombie_painc6 =[ $painc6, zombie_painc7 ] {}; +void() zombie_painc7 =[ $painc7, zombie_painc8 ] {}; +void() zombie_painc8 =[ $painc8, zombie_painc9 ] {}; +void() zombie_painc9 =[ $painc9, zombie_painc10 ] {}; +void() zombie_painc10 =[ $painc10, zombie_painc11 ] {}; +void() zombie_painc11 =[ $painc11, zombie_painc12 ] {ai_painforward(1);}; +void() zombie_painc12 =[ $painc12, zombie_painc13 ] {ai_painforward(1);}; +void() zombie_painc13 =[ $painc13, zombie_painc14 ] {}; +void() zombie_painc14 =[ $painc14, zombie_painc15 ] {}; +void() zombie_painc15 =[ $painc15, zombie_painc16 ] {}; +void() zombie_painc16 =[ $painc16, zombie_painc17 ] {}; +void() zombie_painc17 =[ $painc17, zombie_painc18 ] {}; +void() zombie_painc18 =[ $painc18, zombie_run1 ] {}; + +void() zombie_paind1 =[ $paind1, zombie_paind2 ] +{ + sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); + droptofloor(); +}; +void() zombie_paind2 =[ $paind2, zombie_paind3 ] {}; +void() zombie_paind3 =[ $paind3, zombie_paind4 ] {}; +void() zombie_paind4 =[ $paind4, zombie_paind5 ] {}; +void() zombie_paind5 =[ $paind5, zombie_paind6 ] {}; +void() zombie_paind6 =[ $paind6, zombie_paind7 ] {}; +void() zombie_paind7 =[ $paind7, zombie_paind8 ] {}; +void() zombie_paind8 =[ $paind8, zombie_paind9 ] {}; +void() zombie_paind9 =[ $paind9, zombie_paind10 ] {ai_pain(1);}; +void() zombie_paind10 =[ $paind10, zombie_paind11 ] {}; +void() zombie_paind11 =[ $paind11, zombie_paind12 ] {}; +void() zombie_paind12 =[ $paind12, zombie_paind13 ] {}; +void() zombie_paind13 =[ $paind13, zombie_run1 ] {}; + +void() zombie_paine1 =[ $paine1, zombie_paine2 ] +{ + sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); + self.health = 60; +}; +void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);}; +void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);}; +void() zombie_paine4 =[ $paine4, zombie_paine5 ] {ai_pain(3);}; +void() zombie_paine5 =[ $paine5, zombie_paine6 ] {ai_pain(1);}; +void() zombie_paine6 =[ $paine6, zombie_paine7 ] {ai_pain(2);}; +void() zombie_paine7 =[ $paine7, zombie_paine8 ] {ai_pain(1);}; +void() zombie_paine8 =[ $paine8, zombie_paine9 ] {ai_pain(1);}; +void() zombie_paine9 =[ $paine9, zombie_paine10 ] {ai_pain(2);}; +void() zombie_paine10 =[ $paine10, zombie_paine11 ] +{ + sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; + + // HONEY + self.wad = ZOMBIE_ONGROUND; +}; +void() zombie_paine11 =[ $paine11, zombie_paine12 ] +{ + droptofloor(); + self.nextthink = self.nextthink + 5; + self.health = 60; +}; +void() zombie_paine12 =[ $paine12, zombie_paine13 ] +{ + // see if ok to stand up + droptofloor(); + self.health = 60; + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.solid = SOLID_SLIDEBOX; + if(!walkmove(0, 0)) + { + self.think = zombie_paine11; + self.solid = SOLID_NOT; + return; + } + + // HONEY + self.wad = ""; +}; +void() zombie_paine13 =[ $paine13, zombie_paine14 ] {}; +void() zombie_paine14 =[ $paine14, zombie_paine15 ] {}; +void() zombie_paine15 =[ $paine15, zombie_paine16 ] {}; +void() zombie_paine16 =[ $paine16, zombie_paine17 ] {}; +void() zombie_paine17 =[ $paine17, zombie_paine18 ] {}; +void() zombie_paine18 =[ $paine18, zombie_paine19 ] {}; +void() zombie_paine19 =[ $paine19, zombie_paine20 ] {}; +void() zombie_paine20 =[ $paine20, zombie_paine21 ] {}; +void() zombie_paine21 =[ $paine21, zombie_paine22 ] {}; +void() zombie_paine22 =[ $paine22, zombie_paine23 ] {}; +void() zombie_paine23 =[ $paine23, zombie_paine24 ] {}; +void() zombie_paine24 =[ $paine24, zombie_paine25 ] {}; +void() zombie_paine25 =[ $paine25, zombie_paine26 ] {ai_painforward(5);}; +void() zombie_paine26 =[ $paine26, zombie_paine27 ] {ai_painforward(3);}; +void() zombie_paine27 =[ $paine27, zombie_paine28 ] {ai_painforward(1);}; +void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);}; +void() zombie_paine29 =[ $paine29, zombie_paine30 ] {}; +void() zombie_paine30 =[ $paine30, zombie_run1 ] {}; + +void() zombie_die = +{ + sound(self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_zombie.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); +}; + +/* +================= +zombie_pain + +Zombies can only be killed (gibbed) by doing 60 hit points of damage +in a single frame (rockets, grenades, quad shotgun, quad nailgun). + +A hit of 25 points or more (super shotgun, quad nailgun) will allways put it +down to the ground. + +A hit of from 10 to 40 points in one frame will cause it to go down if it +has been twice in two seconds, otherwise it goes into one of the four +fast pain frames. + +A hit of less than 10 points of damage (winged by a shotgun) will be ignored. + +FIXME: don't use pain_finished because of nightmare hack +================= +*/ +void(entity attacker, float take) zombie_pain = +{ + float r; + + self.health = 60; // allways reset health + + if(take < 9) + return; // totally ignore + + if(self.inpain == 2) + return; // down on ground, so don't reset any counters + +// go down immediately if a big enough hit + if(take >= 25) + { + self.inpain = 2; + zombie_paine1(); + return; + } + + if(self.inpain) + { +// if hit again in next gre seconds while not in pain frames, definately drop + self.pain_finished = time + 3; + return; // currently going through an animation, don't change + } + + if(self.pain_finished > time) + { +// hit again, so drop down + self.inpain = 2; + zombie_paine1(); + return; + } + +// gp into one of the fast pain animations + self.inpain = 1; + + r = random(); + if(r < 0.25) + zombie_paina1(); + else if(r < 0.5) + zombie_painb1(); + else if(r < 0.75) + zombie_painc1(); + else + zombie_paind1(); +}; + +// ROGUE +void() zombie_sleep = [ $paine11, zombie_sleep ] { ai_stand(); }; + +void() zombie_wake = +{ + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_pain = zombie_pain; + self.th_run = zombie_run1; + self.th_missile = zombie_missile; + +// paine12 will handle setting solid, just make the size box correct. +// self.solid = SOLID_SLIDEBOX; +// setsize(self, '-16 -16 -24', '16 16 40'); + + zombie_paine12(); +}; + +void() zombie_escape1=[ $cruc_1, zombie_escape2 ] {self.nextthink=time+0.20;}; +void() zombie_escape2=[ $cruc_2, zombie_escape3 ] {self.nextthink=time+0.20;}; +void() zombie_escape3=[ $cruc_3, zombie_escape4 ] {self.nextthink=time+0.20;}; +void() zombie_escape4=[ $cruc_4, zombie_escape5 ] {self.nextthink=time+0.20;}; +void() zombie_escape5=[ $cruc_5, zombie_escape6 ] {self.nextthink=time+0.15;}; +void() zombie_escape6=[ $cruc_6, zombie_escape7 ] {self.nextthink=time+0.15;}; +void() zombie_escape7=[ $cruc_7, zombie_escape8 ] {self.nextthink=time+0.15;}; +void() zombie_escape8=[ $cruc_8, zombie_escape9 ] {self.nextthink=time+0.15;}; +void() zombie_escape9=[ $cruc_9, zombie_escape10 ] {self.nextthink=time+0.15;}; +void() zombie_escape10=[$cruc_10, zombie_escape11] {self.nextthink=time+0.15;}; +void() zombie_escape11=[$cruc_11, zombie_escape12] {self.nextthink=time+0.10;}; +void() zombie_escape12=[$cruc_12, zombie_escape13] {self.nextthink=time+0.10;}; +void() zombie_escape13=[$cruc_13, zombie_escape14] {self.nextthink=time+0.10;}; +void() zombie_escape14=[$cruc_14, zombie_escape15] +{ + makevectors(self.angles); + setorigin(self, self.origin + v_forward * 8); + self.nextthink=time+0.15; +}; +void() zombie_escape15=[ $cruc_15, zombie_escape16] +{ + makevectors(self.angles); + setorigin(self, self.origin + v_forward * 8); + self.nextthink=time+0.15; +}; +void() zombie_escape16 = [ $cruc_16, zombie_run1 ] +{ + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_AIM; + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_pain = zombie_pain; + self.th_run = zombie_run1; + self.th_missile = zombie_missile; + self.health = 60; + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + + droptofloor(); +}; + +void() zombie_escape = +{ + if(!self.pain_finished) + { + self.pain_finished = time + self.delay; + } + self.think = zombie_cruc1; + self.nextthink = time + 0.1; +}; + +//HIPNOTIC +void() zombie_lay12 =[ $paine12, zombie_paine13 ] + {self.th_pain = zombie_pain;}; + +void(entity attacker, float damage) zombie_lay12_pain = +{ + zombie_lay12(); +} + +void() zombie_lay =[ $paine11, zombie_lay ] + { + self.th_stand = zombie_stand1; + self.th_pain = zombie_lay12_pain; + + self.nextthink = self.nextthink + 0.1; + self.health = 60; + + if(FindTarget ()) + { + zombie_lay12(); + return; + } + }; + +//HIPNOTIC +//============================================================================ + +/*QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) Crucified Lying ambush Sneaky + +Crucified - Zombie stays stuck in the wall, moans and writhes. +Lying - Zombie will start lying down, and stand when player spotted. +Ambush - Just like all the other ambush flags. +Sneaky - Zombie stays stuck in the wall, but breaks his chains, hops off the wall, and attacks after seeing the player. + +If crucified, stick the bounding box 12 pixels back into a wall to look right. +*/ +void() monster_zombie = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model("progs/zombie.mdl"); + precache_model("progs/h_zombie.mdl"); + precache_model("progs/zom_gib.mdl"); + + precache_sound("zombie/z_idle.wav"); + precache_sound("zombie/z_idle1.wav"); + precache_sound("zombie/z_shot1.wav"); + precache_sound("zombie/z_gib.wav"); + precache_sound("zombie/z_pain.wav"); + precache_sound("zombie/z_pain1.wav"); + precache_sound("zombie/z_fall.wav"); + precache_sound("zombie/z_miss.wav"); + precache_sound("zombie/z_hit.wav"); + precache_sound("zombie/idle_w2.wav"); + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE && !self.cnt){ + self.cnt = -1; + } + + self.health = 60; + + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; + + // HONEY + monster_add_to_counter(); + + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN) + { + self.use = zombie_start2; + return; + } + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/zombie.mdl"); + setsize(self, '-12 -12 -24', '12 12 24'); + + if(self.spawnflags & SPAWN_CRUCIFIED) + { + self.movetype = MOVETYPE_NONE; + zombie_cruc1(); + } + else if(self.spawnflags & SPAWN_LYING) + { + self.solid = SOLID_NOT; + self.th_stand = zombie_sleep; + self.th_run = zombie_wake; + self.th_walk = zombie_wake; + self.th_pain = asPainFn(zombie_wake); + self.th_missile = zombie_wake; + setsize(self, '-16 -16 -24', '16 16 -16'); + + // HOLY HACK, BATMAN! - Don't blame me. Check out FindTarget in ai.qc! + if(self.spawnflags & SPAWN_AMBUSH) + self.spawnflags = SPAWN_LYING; + + walkmonster_start(); + } + else if(self.spawnflags & SPAWN_SNEAKY) + { + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.th_stand = zombie_cruc1; + self.th_run = zombie_escape; + self.th_walk = zombie_escape; + self.th_pain = asPainFn(zombie_escape); + self.th_missile = zombie_escape; + + if(!self.delay) + self.delay = 3; + + self.ideal_yaw = self.angles * '0 1 0'; + if(!self.yaw_speed) + self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + self.flags = self.flags | FL_MONSTER; + self.th_stand (); + self.nextthink = self.nextthink + random()*0.5; + total_monsters = total_monsters + 1; + } + else + { + if(self.spawnflags & SPAWN_AMBUSH) + self.spawnflags = SPAWN_LYING; + walkmonster_start(); + } + + //HIPNOTIC + if(self.spawnflags & SPAWN_LYINGDOWN) + { + self.th_stand = zombie_lay; + } +}; diff --git a/QC/pak11.pak b/QC/pak11.pak index 3bbdf19f..e3b604a3 100644 Binary files a/QC/pak11.pak and b/QC/pak11.pak differ diff --git a/QC/plats.qc b/QC/plats.qc index ac2299da..e6d62791 100644 --- a/QC/plats.qc +++ b/QC/plats.qc @@ -1,17 +1,9 @@ - - -void() plat_center_touch; -void() plat_outside_touch; -void() plat_trigger_use; -void() plat_go_up; -void() plat_go_down; -void() plat_crush; float PLAT_LOW_TRIGGER = 1; void() plat_spawn_inside_trigger = { - local entity trigger; - local vector tmin, tmax; + entity trigger; + vector tmin, tmax; // // middle trigger @@ -39,7 +31,7 @@ void() plat_spawn_inside_trigger = tmax_y = tmin_y + 1; } - setsize (trigger, tmin, tmax); + setsize(trigger, tmin, tmax); }; void() plat_hit_top = @@ -93,7 +85,7 @@ void() plat_outside_touch = if(other.health <= 0) return; -//dprint ("plat_outside_touch\n"); +//dprint("plat_outside_touch\n"); self = self.enemy; if(self.state == STATE_TOP) plat_go_down(); @@ -109,9 +101,9 @@ void() plat_trigger_use = void() plat_crush = { -//dprint ("plat_crush\n"); +//dprint("plat_crush\n"); - T_Damage (other, self, self, 1); + T_Damage(other, self, self, 1); if(self.state == STATE_UP) plat_go_down(); @@ -177,9 +169,9 @@ void() func_plat = self.classname = "plat"; self.solid = SOLID_BSP; self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); + setorigin(self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins , self.maxs); self.blocked = plat_crush; if(!self.speed) @@ -187,6 +179,11 @@ void() func_plat = // pos1 is the top position, pos2 is the bottom self.pos1 = self.origin; + + // HONEY + if(self.distance) + self.pos1_z = self.origin_z + self.distance; + self.pos2 = self.origin; if(self.height) self.pos2_z = self.origin_z - self.height; @@ -197,14 +194,14 @@ void() func_plat = plat_spawn_inside_trigger(); // the "start moving" trigger - if(self.targetname) + if(self.targetname != NULLSTR) { self.state = STATE_UP; self.use = plat_use; } else { - setorigin (self, self.pos2); + setorigin(self, self.pos2); self.state = STATE_BOTTOM; } }; @@ -219,7 +216,7 @@ void() train_blocked = if(time < self.attack_finished) return; self.attack_finished = time + 0.5; - T_Damage (other, self, self, self.dmg); + T_Damage(other, self, self, self.dmg); }; void() train_use = { @@ -243,9 +240,9 @@ void() train_wait = void() train_next = { - local entity targ; + entity targ; - targ = find (world, targetname, self.target); + targ = find(world, targetname, self.target); self.target = targ.target; if(!self.target) objerror ("train_next: no next target"); @@ -260,11 +257,11 @@ void() train_next = void() func_train_find = { - local entity targ; + entity targ; - targ = find (world, targetname, self.target); + targ = find(world, targetname, self.target); self.target = targ.target; - setorigin (self, targ.origin - self.mins); + setorigin(self, targ.origin - self.mins); if(!self.targetname) { // not triggered, so start immediately self.nextthink = self.ltime + 0.1; @@ -315,9 +312,9 @@ void() func_train = self.use = train_use; self.classname = "train"; - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - setorigin (self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins , self.maxs); + setorigin(self, self.origin); // start trains on the second frame, to make sure their targets have had // a chance to spawn @@ -347,10 +344,10 @@ void() misc_teleporttrain = self.noise1 = ("misc/null.wav"); precache_sound("misc/null.wav"); - precache_model2 ("progs/teleport.mdl"); - setmodel (self, "progs/teleport.mdl"); - setsize (self, self.mins , self.maxs); - setorigin (self, self.origin); + precache_model2("progs/teleport.mdl"); + setmodel(self, "progs/teleport.mdl"); + setsize(self, self.mins , self.maxs); + setorigin(self, self.origin); // start trains on the second frame, to make sure their targets have had // a chance to spawn diff --git a/QC/player.qc b/QC/player.qc index 5bf97198..0ea7ee55 100644 --- a/QC/player.qc +++ b/QC/player.qc @@ -1,6 +1,4 @@ -void() bubble_bob; - /* ============================================================================== @@ -86,15 +84,13 @@ PLAYER ============================================================================== */ -void(float xHand) player_run; - void(float xHand) player_stand1 = { setHandThinkWithArg(xHand, $axstnd1, player_stand1); if(self.velocity_x || self.velocity_y) { - self.walkframe=0; + self.walkframe = 0; player_run(xHand); return; @@ -122,6 +118,11 @@ void(float xHand) player_run = { VRSetWeaponFrame(xHand, 0); + if(self.health <= 0) + { + return; + } + setHandThinkWithArg(xHand, $rockrun1, player_run); if(!self.velocity_x && !self.velocity_y) @@ -155,7 +156,7 @@ void(float xHand) player_run = { if(self.spawnsilent > 95) { - local float r; + float r; if(self.spawnsilent > 190) self.spawnsilent = 0; else @@ -188,11 +189,6 @@ void() player_run_no_arg = player_run(cVR_MainHand); }; -.void(float) thinkArgFn; -.void(float) think2ArgFn; -.float thinkArg; -.float think2Arg; - void() doThinkArgFn = { self.thinkArgFn(self.thinkArg); @@ -242,7 +238,7 @@ void(float xHand, float xFrame, void(float) xFn) setHandThinkWithArg = void(float xHand, float xFrame, void() xFn) setHandThink = { if(xHand == cVR_OffHand) setThink2(xFrame, xFn); - else setThink(xFrame, xFn); + else setThink(xFrame, xFn); } void(float xHand) player_shot1 = { setHandThinkWithArg(xHand, $shotatt1, player_shot2); VRSetWeaponFrame(xHand, 1); self.effects = self.effects | EF_MUZZLEFLASH; }; @@ -335,9 +331,10 @@ void(float xHand) player_grapple5 = //--ZOID //============================================================================ -void(float xHand, float xOffset, float xNailAtt, void(float) xNailFn) player_nail_Impl = +void(float xHand, float xOffset, float xNailAtt, void(float) xNailFn, + float xAmmoCount, void(float, float) xFireFn) player_nail_BaseImpl = { - if(self.ammo_nails < 1 || !VRGetFireButtonPressed(xHand)) + if(xAmmoCount < 1 || !VRGetFireButtonPressed(xHand)) { player_run(xHand); return; @@ -351,10 +348,16 @@ void(float xHand, float xOffset, float xNailAtt, void(float) xNailFn) player_nai VRSetWeaponFrame(xHand, 1); SuperDamageSound(); - W_FireSpikes (xHand, xOffset); + xFireFn(xHand, xOffset); VRSetAttackFinished(xHand, time + 0.2); } +void(float xHand, float xOffset, float xNailAtt, void(float) xNailFn) player_nail_Impl = +{ + player_nail_BaseImpl(xHand, xOffset, xNailAtt, xNailFn, + self.ammo_nails, W_FireSpikes); +} + void(float xHand) player_nail1 = { player_nail_Impl(xHand, 2.35, $nailatt1, player_nail2); @@ -365,9 +368,25 @@ void(float xHand) player_nail2 = player_nail_Impl(xHand, -2.35, $nailatt2, player_nail1); } +void(float xHand, float xOffset, float xNailAtt, void(float) xNailFn) player_lava_nail_Impl = +{ + player_nail_BaseImpl(xHand, xOffset, xNailAtt, xNailFn, + self.ammo_lava_nails, W_FireLavaSpikes); +} + +void(float xHand) player_lava_nail1 = +{ + player_lava_nail_Impl(xHand, 2.35, $nailatt1, player_lava_nail2); +} + +void(float xHand) player_lava_nail2 = +{ + player_lava_nail_Impl(xHand, -2.35, $nailatt2, player_lava_nail1); +} + //============================================================================ -void(float xHand) player_light1 = +void(float xHand, float xLightAtt, void(float) xLightFn) player_light_Impl = { if(self.ammo_cells < 1) { @@ -375,7 +394,7 @@ void(float xHand) player_light1 = return; } - setHandThinkWithArg(xHand, $light1, player_light2); + setHandThinkWithArg(xHand, xLightAtt, xLightFn); self.effects = self.effects | EF_MUZZLEFLASH; @@ -390,35 +409,37 @@ void(float xHand) player_light1 = VRSetWeaponFrame(xHand, 1); SuperDamageSound(); - W_FireLightning(xHand); - VRSetAttackFinished(xHand, time + 0.2); -}; +} -void(float xHand) player_light2 = +void(float xHand) player_light1 = { - if(self.ammo_cells < 1) + player_light_Impl(xHand, $light1, player_light2); + + if(VRGetWeaponFlags(xHand) & QVR_WPNFLAG_USE_SECONDARY_AMMO) { + W_FirePlasma(xHand); player_run(xHand); return; } - - setHandThinkWithArg(xHand, $light2, player_light1); - - self.effects = self.effects | EF_MUZZLEFLASH; - - if(!VRGetFireButtonPressed(xHand)) + else { - player_run(xHand); - return; + W_FireLightning(xHand); + VRSetAttackFinished(xHand, time + 0.2); } +}; - VRSetWeaponFrame(xHand, VRGetWeaponFrame(xHand) + 1); - if(VRGetWeaponFrame(xHand) == 5) - VRSetWeaponFrame(xHand, 1); +void(float xHand) player_light2 = +{ + player_light_Impl(xHand, $light2, player_light1); - SuperDamageSound(); - W_FireLightning(xHand); - VRSetAttackFinished(xHand, time + 0.2); + if(VRGetWeaponFlags(xHand) & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + } + else + { + W_FireLightning(xHand); + VRSetAttackFinished(xHand, time + 0.2); + } }; //MED 10/18/96 added HIPWEAPONS @@ -439,12 +460,45 @@ void(float xHand) player_mjolnir6 = { setHandThinkWithArg(xHand, 43, player_run) //============================================================================ +void(float xHand, float xLaserAtt, void(float) xLaserFn) player_laser_Impl = +{ + if(self.ammo_cells < 1) + { + player_run(xHand); + return; + } + + setHandThinkWithArg(xHand, xLaserAtt, xLaserFn); + VRSetAttackFinished(xHand, time + 0.1); +} + //MED 10/18/96 added HIPSWEAPONS -// TODO VR: (P1) laser animation keeps playing when ammo=0 -void(float xHand) player_laser1 = { setHandThinkWithArg(xHand, $nailatt1, player_laser3); VRSetAttackFinished(xHand, time + 0.1); VRSetWeaponFrame(xHand, 1); HIP_FireLaser(xHand, 0); }; -void(float xHand) player_laser2 = { setHandThinkWithArg(xHand, $nailatt2, player_laser3); VRSetAttackFinished(xHand, time + 0.1); VRSetWeaponFrame(xHand, 2); }; -void(float xHand) player_laser3 = { setHandThinkWithArg(xHand, $nailatt2, player_laser1); VRSetAttackFinished(xHand, time + 0.1); VRSetWeaponFrame(xHand, 4); HIP_FireLaser(xHand, 1); }; -void(float xHand) player_laser4 = { setHandThinkWithArg(xHand, $nailatt1, player_laser1); VRSetAttackFinished(xHand, time + 0.1); VRSetWeaponFrame(xHand, 5); }; +void(float xHand) player_laser1 = +{ + player_laser_Impl(xHand, $nailatt1, player_laser3); + VRSetWeaponFrame(xHand, 1); + HIP_FireLaser(xHand, 0); +} + +void(float xHand) player_laser2 = +{ + player_laser_Impl(xHand, $nailatt2, player_laser3); + VRSetWeaponFrame(xHand, 2); +} + +void(float xHand) player_laser3 = +{ + player_laser_Impl(xHand, $nailatt2, player_laser1); + VRSetWeaponFrame(xHand, 4); + HIP_FireLaser(xHand, 1); +} + +void(float xHand) player_laser4 = +{ + player_laser_Impl(xHand, $nailatt1, player_laser1); + VRSetWeaponFrame(xHand, 5); +} + //============================================================================ void(float xHand) player_rocket1 = { setHandThinkWithArg(xHand, $rockatt1, player_rocket2); VRSetWeaponFrame(xHand, 1); self.effects = self.effects | EF_MUZZLEFLASH; }; void(float xHand) player_rocket2 = { setHandThinkWithArg(xHand, $rockatt2, player_rocket3); VRSetWeaponFrame(xHand, 2); }; @@ -456,7 +510,7 @@ void(float num_bubbles) DeathBubbles; void() PainSound = { -local float rs; +float rs; if(self.health < 0) return; @@ -538,21 +592,21 @@ local float rs; return; }; -void() player_pain1 = [ $pain1, player_pain2 ] {PainSound();/* TODO VR: (P2) self.weaponframe=0; */ }; +void() player_pain1 = [ $pain1, player_pain2 ] { PainSound(); }; void() player_pain2 = [ $pain2, player_pain3 ] {}; void() player_pain3 = [ $pain3, player_pain4 ] {}; void() player_pain4 = [ $pain4, player_pain5 ] {}; void() player_pain5 = [ $pain5, player_pain6 ] {}; void() player_pain6 = [ $pain6, player_run_no_arg ] {}; -void() player_axpain1 = [ $axpain1, player_axpain2 ] {PainSound();/* TODO VR: (P2) self.weaponframe=0; */ }; +void() player_axpain1 = [ $axpain1, player_axpain2 ] { PainSound(); }; void() player_axpain2 = [ $axpain2, player_axpain3 ] {}; void() player_axpain3 = [ $axpain3, player_axpain4 ] {}; void() player_axpain4 = [ $axpain4, player_axpain5 ] {}; void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; void() player_axpain6 = [ $axpain6, player_run_no_arg ] {}; -void() player_hampain1 = [ 18, player_hampain2 ] {PainSound(); /* TODO VR: (P2) self.weaponframe=0; */ }; +void() player_hampain1 = [ 18, player_hampain2 ] { PainSound(); }; void() player_hampain2 = [ 19, player_hampain3 ] {}; void() player_hampain3 = [ 20, player_hampain4 ] {}; void() player_hampain4 = [ 21, player_hampain5 ] {}; @@ -585,7 +639,7 @@ void() player_die_ham1; void() DeathBubblesSpawn = { - local entity bubble; + entity bubble; if((self.owner.waterlevel != 3) && (self.owner.health > 0)) { remove(self); // remove bubble spawner @@ -593,8 +647,8 @@ void() DeathBubblesSpawn = } bubble = spawn(); - setmodel (bubble, "progs/s_bubble.spr"); - setorigin (bubble, self.owner.origin + '0 0 24'); + setmodel(bubble, "progs/s_bubble.spr"); + setorigin(bubble, self.owner.origin + '0 0 24'); bubble.movetype = MOVETYPE_NOCLIP; bubble.solid = SOLID_NOT; bubble.velocity = '0 0 15'; @@ -603,7 +657,11 @@ void() DeathBubblesSpawn = bubble.classname = "bubble"; bubble.frame = 0; bubble.cnt = 0; - setsize (bubble, '-8 -8 -8', '8 8 8'); + + // HONEY + bubble.count = 20; + + setsize(bubble, '-8 -8 -8', '8 8 8'); self.nextthink = time + 0.01; self.think = DeathBubblesSpawn; self.air_finished = self.air_finished + 1; @@ -613,10 +671,10 @@ void() DeathBubblesSpawn = void(float num_bubbles) DeathBubbles = { -local entity bubble_spawner; +entity bubble_spawner; bubble_spawner = spawn(); - setorigin (bubble_spawner, self.origin); + setorigin(bubble_spawner, self.origin); bubble_spawner.movetype = MOVETYPE_NONE; bubble_spawner.solid = SOLID_NOT; bubble_spawner.nextthink = time + 0.01; @@ -629,7 +687,7 @@ local entity bubble_spawner; void() DeathSound = { -local float rs; +float rs; // water death sounds if(self.waterlevel == 3) @@ -665,7 +723,7 @@ void() PlayerDead = vector(float dm) VelocityForDamage = { - local vector v; + vector v; //MED 01/17/97 if(vlen(damage_inflictor.velocity)>0) @@ -685,12 +743,12 @@ vector(float dm) VelocityForDamage = if(dm > -50) { -// dprint ("level 1\n"); +// dprint("level 1\n"); v = v * 0.7; } else if(dm > -200) { -// dprint ("level 3\n"); +// dprint("level 3\n"); v = v * 2; } else @@ -701,13 +759,13 @@ vector(float dm) VelocityForDamage = void(string gibname, float dm) ThrowGib = { - local entity new; + entity new; new = spawn(); new.origin = self.origin; - setmodel (new, gibname); - setsize (new, '0 0 0', '0 0 0'); - new.velocity = VelocityForDamage (dm); + setmodel(new, gibname); + setsize(new, '0 0 0', '0 0 0'); + new.velocity = VelocityForDamage(dm); new.movetype = MOVETYPE_BOUNCE; new.solid = SOLID_NOT; new.avelocity_x = random()*600; @@ -719,13 +777,15 @@ void(string gibname, float dm) ThrowGib = new.frame = 0; new.flags = 0; - particle2(self.origin, new.velocity, 1 /* blood preset */, 40); + particle2(self.origin, new.velocity, QVR_PARTICLE_PRESET_BLOOD, 40); }; //MED void() HeadThink = { - self.nextthink = -1; + self.nextthink = time + 10; + self.think = monster_check_remove_corpse; + if(world.worldtype != 2) { if(random()<0.1) @@ -735,7 +795,7 @@ void() HeadThink = void(string gibname, float dm) ThrowHead = { - setmodel (self, gibname); + setmodel(self, gibname); self.frame = 0; // self.nextthink = -1; //MED @@ -744,8 +804,8 @@ void(string gibname, float dm) ThrowHead = self.takedamage = DAMAGE_NO; self.solid = SOLID_NOT; self.view_ofs = '0 0 8'; - setsize (self, '-16 -16 0', '16 16 56'); - self.velocity = VelocityForDamage (dm); + setsize(self, '-10 -10 0', '10 10 10'); + self.velocity = VelocityForDamage(dm); self.origin_z = self.origin_z - 24; self.flags = self.flags - (self.flags & FL_ONGROUND); self.avelocity = crandom() * '0 600 0'; @@ -753,16 +813,16 @@ void(string gibname, float dm) ThrowHead = self.gorging = TRUE; self.think = HeadThink; - particle2(self.origin, self.velocity, 1 /* blood preset */, 40); + particle2(self.origin, self.velocity, QVR_PARTICLE_PRESET_BLOOD, 40); }; void() GibPlayer = { ThrowHead ("progs/h_player.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); self.deadflag = DEAD_DEAD; @@ -786,11 +846,13 @@ void() GibPlayer = void() PlayerDie = { - local float i; + float i; + + VR_ItemUtil_EntDelItem(self, IID_INVISIBILITY); + VR_ItemUtil_EntDelItem(self, IID_INVULNERABILITY); + VR_ItemUtil_EntDelItem(self, IID_SUIT); + VR_ItemUtil_EntDelItem(self, IID_QUAD); -// self.items = self.items - (self.items & IT_INVISIBILITY); - self.items = self.items - (self.items & - (IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); self.invisible_finished = 0; // don't die as eyes self.invincible_finished = 0; self.super_damage_finished = 0; @@ -801,18 +863,52 @@ void() PlayerDie = self.modelindex = modelindex_player; // don't use eyes //JIM self.empathy_finished = 0; - self.hipnotic_items = self.hipnotic_items - (self.hipnotic_items & HIP_IT_EMPATHY_SHIELDS); + + // ROGUE + self.gravity = 1.0; + self.shield_finished = 0; + self.antigrav_finished = 0; + + VR_ItemUtil_EntDelItem(self, IID_EMPATHY_SHIELDS); if(deathmatch || coop) + { DropBackpack(); - self.weaponmodel=""; - self.weaponmodel2=""; + // ROGUE + TeamDropFlagOfPlayer(self); + DropRune(); + + if(self.weapon != WID_FIST) { CreateWeaponDrop(self, self.weapon, self.origin); } + if(self.weapon2 != WID_FIST) { CreateWeaponDrop(self, self.weapon2, self.origin); } + if(self.holsterweapon0 != WID_FIST) { CreateWeaponDrop(self, self.holsterweapon0, self.origin); } + if(self.holsterweapon1 != WID_FIST) { CreateWeaponDrop(self, self.holsterweapon1, self.origin); } + if(self.holsterweapon2 != WID_FIST) { CreateWeaponDrop(self, self.holsterweapon2, self.origin); } + if(self.holsterweapon3 != WID_FIST) { CreateWeaponDrop(self, self.holsterweapon3, self.origin); } + if(self.holsterweapon4 != WID_FIST) { CreateWeaponDrop(self, self.holsterweapon4, self.origin); } + if(self.holsterweapon5 != WID_FIST) { CreateWeaponDrop(self, self.holsterweapon5, self.origin); } + } + + if(self.ctf_killed == 2) + { + self.ctf_killed = 0; + } + else + { + self.ctf_killed = 1; + } + + self.weaponmodel = ""; + self.weaponmodel2 = ""; self.view_ofs = '0 0 -8'; self.deadflag = DEAD_DYING; self.solid = SOLID_NOT; self.flags = self.flags - (self.flags & FL_ONGROUND); self.movetype = MOVETYPE_TOSS; + + self.think = SUB_Null; + self.think2 = SUB_Null; + if(self.velocity_z < 10) self.velocity_z = self.velocity_z + random()*300; @@ -840,7 +936,7 @@ void() PlayerDie = return; } - i = cvar("temp1"); + i = cvar_hget(cvarh_temp1); if(!i) i = 1 + floor(random()*6); @@ -945,3 +1041,53 @@ void() player_die_ham5 = [ 28 , player_die_ham6 ] {}; void() player_die_ham6 = [ 29 , player_die_ham7 ] {}; void() player_die_ham7 = [ 30 , player_die_ham8 ] {}; void() player_die_ham8 = [ 31 , player_die_ham8 ] {PlayerDead(); }; + +void() player_touch = +{ + vector vec; + float dot; + float doDamage; + + if(VR_ItemUtil_EntHasItem(self, IID_SHIELD)) + { + if(other.classname == "player") + { + makevectors(self.angles); + vec = normalize(other.origin - self.origin); + dot = vec * v_forward; + if(dot < 0.3) + return; + + makevectors(self.angles); + other.velocity = v_forward * 500; + other.velocity_z = 250; + + doDamage = FALSE; + if(TeamArmorDam(other, self, self, 15)) + { + if(self.shield_death_time < time) + doDamage = TRUE; + } + + // if shield has timed out, respawn it. + // don't do particles more than twice a second. + if(self.shield_death_time < time) + { + sound(self,CHAN_WEAPON,"enforcer/enfstop.wav", 1, ATTN_NORM); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, other.origin); + WriteByte(MSG_BROADCAST, 230); + WriteByte(MSG_BROADCAST, 5); + + shield_spawn (self, v_forward); + } + + if(doDamage) + T_Damage(other, self.shield_entity, self.shield_entity, 15); + +// self.shield_death_time = time + 0.5; + } + } +}; diff --git a/QC/progdefs.h b/QC/progdefs.h index 0e5c0b68..25d66e13 100644 --- a/QC/progdefs.h +++ b/QC/progdefs.h @@ -27,6 +27,7 @@ typedef struct globalvars_s float total_monsters; float found_secrets; float killed_monsters; + float spawnServerFromSaveFile; float parm1; float parm2; float parm3; @@ -43,6 +44,22 @@ typedef struct globalvars_s float parm14; float parm15; float parm16; + float parm17; + float parm18; + float parm19; + float parm20; + float parm21; + float parm22; + float parm23; + float parm24; + float parm25; + float parm26; + float parm27; + float parm28; + float parm29; + float parm30; + float parm31; + float parm32; vec3_t v_forward; vec3_t v_up; vec3_t v_right; @@ -66,6 +83,9 @@ typedef struct globalvars_s func_t ClientDisconnect; func_t SetNewParms; func_t SetChangeParms; + func_t OnSpawnServerBeforeLoad; + func_t OnSpawnServerAfterLoad; + func_t OnLoadGame; } globalvars_t; typedef struct entvars_s @@ -81,8 +101,6 @@ typedef struct entvars_s vec3_t velocity; vec3_t angles; vec3_t avelocity; - vec3_t scale; - vec3_t scale_origin; vec3_t punchangle; string_t classname; string_t model; @@ -93,41 +111,18 @@ typedef struct entvars_s vec3_t maxs; vec3_t size; func_t touch; - func_t handtouch; - func_t vr_wpntouch; func_t use; func_t think; - func_t think2; func_t blocked; float nextthink; - float nextthink2; int groundentity; float health; float frags; float weapon; string_t weaponmodel; float weaponframe; - float weapon2; - string_t weaponmodel2; - float weaponframe2; - float prevweapon; - float prevweapon2; - float holsterweapon0; - float holsterweapon1; - float holsterweapon2; - float holsterweapon3; - float holsterweapon4; - float holsterweapon5; - string_t holsterweaponmodel0; - string_t holsterweaponmodel1; - string_t holsterweaponmodel2; - string_t holsterweaponmodel3; - string_t holsterweaponmodel4; - string_t holsterweaponmodel5; float currentammo; - float currentammo2; float ammocounter; - float ammocounter2; float ammo_shells; float ammo_nails; float ammo_rockets; @@ -140,7 +135,6 @@ typedef struct entvars_s float button0; float button1; float button2; - float button3; float impulse; float fixangle; vec3_t v_angle; @@ -175,38 +169,65 @@ typedef struct entvars_s string_t noise1; string_t noise2; string_t noise3; + vec3_t v_viewangle; + vec3_t scale; + vec3_t scale_origin; + float vr_itemId; + func_t handtouch; + func_t vr_wpntouch; + func_t think2; + float nextthink2; + float weaponflags; + float weapon2; + string_t weaponmodel2; + float weaponframe2; + float weaponflags2; + float holsterweapon0; + float holsterweapon1; + float holsterweapon2; + float holsterweapon3; + float holsterweapon4; + float holsterweapon5; + string_t holsterweaponmodel0; + string_t holsterweaponmodel1; + string_t holsterweaponmodel2; + string_t holsterweaponmodel3; + string_t holsterweaponmodel4; + string_t holsterweaponmodel5; + float holsterweaponflags0; + float holsterweaponflags1; + float holsterweaponflags2; + float holsterweaponflags3; + float holsterweaponflags4; + float holsterweaponflags5; + float offhand_hotspot; + float mainhand_hotspot; + float currentammo2; + float ammocounter2; + float button3; + float vryaw; vec3_t handpos; vec3_t handrot; vec3_t handvel; vec3_t handthrowvel; float handvelmag; vec3_t handavel; - vec3_t v_viewangle; vec3_t offhandpos; vec3_t offhandrot; vec3_t offhandvel; vec3_t offhandthrowvel; float offhandvelmag; vec3_t offhandavel; - float touchinghand; + vec3_t headvel; vec3_t muzzlepos; vec3_t offmuzzlepos; - float teleporting; + float vrbits0; vec3_t teleport_target; - float offhand_grabbing; - float offhand_prevgrabbing; - float mainhand_grabbing; - float mainhand_prevgrabbing; - float offhand_forcegrabbing; - float mainhand_forcegrabbing; - float offhand_hotspot; - float mainhand_hotspot; vec3_t roomscalemove; - float throwhit; - float throwstabilize; - float throwstabilizedim; + float touchinghand; float handtouch_hand; int handtouch_ent; + float ishuman; } entvars_t; -#define PROGHEADER_CRC 47192 +#define PROGHEADER_CRC 51933 diff --git a/QC/progs.dat b/QC/progs.dat index 9121e582..dc37e376 100644 Binary files a/QC/progs.dat and b/QC/progs.dat differ diff --git a/QC/progs.src b/QC/progs.src index 393017e0..6bc3951e 100644 --- a/QC/progs.src +++ b/QC/progs.src @@ -1,75 +1,152 @@ -progs.dat +vrprogs.dat defs.qc -hipdefs.qc //JIM -subs.qc -fight.qc + ai.qc combat.qc +fight.qc items.qc +subs.qc -// ROGUE -grapple.qc +vr_ammoutil.qc +vr_cvars.qc +vr_gameutil.qc +vr_grapple.qc +vr_handgrabutil.qc +vr_itemutil.qc +vr_macros.qc +vr_scaleutil.qc +vr_util.qc +vr_weaponutil.qc +vr_wpnforcegrab.qc -vrutil.qc -wpnforcegrab.qc -weaponutil.qc -weapons.qc -world.qc +buttons.qc client.qc -player.qc -monsters.qc doors.qc -buttons.qc -triggers.qc -plats.qc misc.qc +monsters.qc +plats.qc +player.qc +triggers.qc +weapons.qc +world.qc -ogre.qc -demon.qc -shambler.qc -knight.qc -soldier.qc -wizard.qc -dog.qc -zombie.qc -boss.qc - -tarbaby.qc // registered -hknight.qc // registered -fish.qc // registered -shalrath.qc // registered -enforcer.qc // registered -oldone.qc // registered - -// HIPNOTIC -// Hipnotic Quake additions +orig_mon_boss.qc +orig_mon_demon.qc +orig_mon_dog.qc +orig_mon_enforcer.qc +orig_mon_fish.qc +orig_mon_hknight.qc +orig_mon_knight.qc +orig_mon_ogre.qc +orig_mon_oldone.qc +orig_mon_shalrath.qc +orig_mon_shambler.qc +orig_mon_soldier.qc +orig_mon_tarbaby.qc +orig_mon_wizard.qc +orig_mon_zombie.qc -hipsubs.qc hip_brk.qc -hiptrain.qc +hip_clock.qc +hip_count.qc +hip_decoy.qc +hip_defs.qc hip_expl.qc -hipquake.qc -hipcount.qc -hipitems.qc -hiprubbl.qc -hip_push.qc +hip_holes.qc +hip_items.qc +hip_misc.qc +hip_mon_arma.qc +hip_mon_grem.qc +hip_mon_scrge.qc +hip_mon_spike.qc hip_part.qc -hipspawn.qc -hipgrem.qc -hiparma.qc -hipspike.qc -hiprot.qc -hipscrge.qc -hipholes.qc -hipclock.qc -hiptrig.qc -hipmisc.qc -hipwater.qc -hipdecoy.qc +hip_push.qc +hip_quake.qc +hip_rot.qc +hip_rubbl.qc +hip_spawn.qc +hip_subs.qc +hip_train.qc +hip_trig.qc +hip_water.qc -// Rogue Quake additions +rogue_buzzsaw.qc +rogue_combat.qc +rogue_defs.qc +rogue_dmatch.qc +rogue_dragon.qc +rogue_earthq.qc +rogue_eel.qc +rogue_elevatr.qc +rogue_ending.qc +rogue_invis_sw.qc +rogue_lava_wpn.qc +rogue_lavaman.qc +rogue_lightnin.qc +rogue_morph.qc +rogue_motd.qc +rogue_mult_wpn.qc +rogue_mummy.qc +rogue_new_ai.qc +rogue_newitems.qc +rogue_newmisc.qc +rogue_newplats.qc +rogue_pendulum.qc +rogue_random.qc +rogue_runes.qc +rogue_s_wrath.qc +rogue_shield.qc +rogue_sphere.qc +rogue_teamplay.qc +rogue_timemach.qc +rogue_wrath.qc -mult_wpn.qc +honey_ai.qc +honey_buttons.qc +honey_client.qc +honey_defs.qc +honey_endcam.qc +honey_fight.qc +honey_fog_debug.qc +honey_fog.qc +honey_items.qc +honey_misc.qc +honey_misc2.qc +honey_mon_demon.qc +honey_mon_dog.qc +honey_mon_enforcer.qc +honey_mon_fish.qc +honey_mon_hknight.qc +honey_mon_knight.qc +honey_mon_ogre.qc +honey_mon_shalrath.qc +honey_mon_shambler.qc +honey_mon_soldier.qc +honey_mon_tarbaby.qc +honey_mon_wizard.qc +honey_mon_zombie.qc +honey_monsters.qc +honey_sknight_debug.qc +honey_sknight_tbl.qc +honey_sknight.qc +honey_subs.qc +honey_subs2.qc +honey_trigger.qc +honey_weapons.qc +frikbot/bot.qc +frikbot/bot_way.qc +frikbot/bot_fight.qc +frikbot/bot_ai.qc +frikbot/bot_misc.qc +frikbot/bot_phys.qc +frikbot/bot_move.qc +frikbot/bot_ed.qc +waypoints/map_dm1.qc +waypoints/map_dm2.qc +waypoints/map_dm3.qc +waypoints/map_dm4.qc +waypoints/map_dm5.qc +waypoints/map_dm6.qc diff --git a/QC/rogue_buzzsaw.qc b/QC/rogue_buzzsaw.qc new file mode 100644 index 00000000..169dd8e4 --- /dev/null +++ b/QC/rogue_buzzsaw.qc @@ -0,0 +1,145 @@ +// buzzsaw.qc + +$skin buzzsaw +$frame buzzsaw +$frame bzzrot01 bzzrot02 bzzrot03 bzzrot04 bzzrot05 bzzrot06 + +void() buzzsaw_stand1 = [ $buzzsaw, buzzsaw_stand1 ] +{ + if(self.pain_finished < time) + { + sound(self, CHAN_VOICE, "buzz/buzz1.wav", 0.2, ATTN_NORM); + self.pain_finished = time + 1; + } + + self.angles_x = self.angles_x - 60; + self.avelocity_x = 60; +}; + +void() buzzsaw_fly = +{ + vector dir; + + if(self.pain_finished < time) + { + sound(self, CHAN_VOICE, "buzz/buzz1.wav", 0.2, ATTN_NORM); + self.pain_finished = time + 1; + } + + dir = self.goalentity.origin - self.origin; + dir = normalize(dir); + dir = dir * self.speed; + setorigin(self, self.origin + dir); + self.angles_x = self.angles_x - 60; + self.avelocity_x = 60; +}; + +/* +void() buzzsaw_fly1 = [ $bzzrot01, buzzsaw_fly2 ] { buzzsaw_fly(); }; +void() buzzsaw_fly2 = [ $bzzrot02, buzzsaw_fly3 ] { buzzsaw_fly(); }; +void() buzzsaw_fly3 = [ $bzzrot03, buzzsaw_fly4 ] { buzzsaw_fly(); }; +void() buzzsaw_fly4 = [ $bzzrot04, buzzsaw_fly5 ] { buzzsaw_fly(); }; +void() buzzsaw_fly5 = [ $bzzrot05, buzzsaw_fly6 ] { buzzsaw_fly(); }; +void() buzzsaw_fly6 = [ $bzzrot06, buzzsaw_fly1 ] { buzzsaw_fly(); }; +*/ + +void() buzzsaw_fly1 = [ $bzzrot01, buzzsaw_fly1 ] { buzzsaw_fly(); }; + +void() buzzsaw_touch = +{ + vector sprayDir; + + if(other.classname == "player" || other.flags & FL_MONSTER) + { + if(self.attack_finished < time) + { + sound(self, CHAN_WEAPON, "buzz/buzz.wav", 1, ATTN_NORM); + self.attack_finished = time + 2; + } + T_Damage(other, self, self, self.currentammo); + + sprayDir = normalize(self.goalentity.origin - self.origin); + sprayDir = sprayDir * 200; + SpawnMeatSpray (self.origin, sprayDir); + + other.velocity = sprayDir; + other.velocity_z = 200; + } +}; + +void() buzzsaw_use = +{ + self.touch = buzzsaw_touch; + if(self.target != NULLSTR) + { + self.movetarget = find(world, targetname, self.target); + self.goalentity = self.movetarget; + self.th_stand = buzzsaw_fly1; + self.th_walk = buzzsaw_fly1; + self.th_run = buzzsaw_fly1; + self.think = buzzsaw_fly1; + self.nextthink = time + 0.1; + } + else + { + self.nextthink = time + 0.1; + self.think = buzzsaw_stand1; + } + self.use = SUB_Null; +}; + +/*QUAKED buzzsaw (0 .5 .8) (-18 -18 -18) (18 18 18) Vertical +The buzzsaw trap. + +currentammo: amount of damage for each contact. (default 10) +speed: speed that it will follow it's path. (default 10) + +Use the angle buttons to point the buzzsaw in the direction it +should face. + +Place on a monster path if you want it to move. + +If it is targeted, it will wait until triggered to activate. + +It will not damage players until activated. +*/ +void() buzzsaw = +{ + precache_model("progs/buzzsaw.mdl"); + + precache_sound("buzz/buzz.wav"); + precache_sound("buzz/buzz1.wav"); + + setmodel(self, "progs/buzzsaw.mdl"); + + self.takedamage = DAMAGE_NO; + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_FLY; + + if(self.angles_y == 0 || self.angles_y == 180) + setsize(self, '-18 0 -18', '18 0 18'); + else if(self.angles_y == 90 || self.angles_y == 270) + setsize(self, '0 -18 -18', '0 18 18'); + else + objerror ("Buzzsaw: Not at 90 degree angle!"); + + setorigin(self, self.origin); + + if(!self.speed) + self.speed = 10; + if(!self.currentammo) + self.currentammo = 10; + + self.pain_finished = time + random()*2; + + if(!self.targetname) + { + self.think = buzzsaw_use; + self.nextthink = time + 0.2; + } + else + { + self.use = buzzsaw_use; + } +}; + diff --git a/QC/rogue_combat.qc b/QC/rogue_combat.qc new file mode 100644 index 00000000..901675e3 --- /dev/null +++ b/QC/rogue_combat.qc @@ -0,0 +1,37 @@ +/* +============ +T_EELZap +============ +*/ +void(entity inflictor, entity attacker, float damage) T_EELZap = +{ + float points; + entity head; + vector org; + + head = findradius(inflictor.origin, damage+40); + + while (head) + { + if(head.takedamage) + { + org = head.origin + (head.mins + head.maxs)*0.5; + points = 0.5*vlen(inflictor.origin - org); + if(points < 0) + points = 0; + points = damage - points; + if(head == attacker) + points = points * 0.5; + if(points > 0) + { + if(CanDamage(head, inflictor)) + { // eels take no damage from this attack + if(head.classname != "monster_eel" && + (head.flags & FL_INWATER)) + T_Damage(head, inflictor, attacker, points); + } + } + } + head = head.chain; + } +}; diff --git a/QC/rogue_defs.qc b/QC/rogue_defs.qc new file mode 100644 index 00000000..3b6b307f --- /dev/null +++ b/QC/rogue_defs.qc @@ -0,0 +1,108 @@ +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Constants +// ---------------------------------------------------------------------------- + +float STAT_TOTALMONSTERS = 12; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Globals +// ---------------------------------------------------------------------------- + +float earthquake_active; +float earthquake_intensity; +float cutscene_running; +entity tag_token_owner; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields +// ---------------------------------------------------------------------------- + +.float rogue_items; // Renamed from `.items2`. +.float ammo_lava_nails; +.float ammo_multi_rockets; +.float ammo_plasma; +.float gravity; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields (player-only) +// ---------------------------------------------------------------------------- + +.float shield_finished, antigrav_finished; +.float shield_time, antigrav_time; +.entity shield_entity; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields (elevator) +// ---------------------------------------------------------------------------- + +.float elevatorLastUse; +.float elevatorOnFloor; +.float elevatorToFloor; +.vector elevatorDestination; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields (plat2) +// ---------------------------------------------------------------------------- + +.float plat2Called; +.float plat2LastMove; +.float plat2GoTime; +.float plat2GoTo; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields (AI) +// ---------------------------------------------------------------------------- + +.float orbitPosition; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields (dragon) +// ---------------------------------------------------------------------------- + +.float playerInRoom; +.float playerInTransit; +.float dragonInRoom; +.float dragonInTransit; +.float dragonAttacking; +.float dragonPainSequence; +.vector dragonLastVelocity; + +// +// +// +// ---------------------------------------------------------------------------- +// ROGUE Fields (other) +// ---------------------------------------------------------------------------- + +.float AGping; +.float childrenSpawned; +.float ltrailLastUsed; +.float shield_death_time; +.float shieldSoundTime; +.float dragonDeathState; +.float tag_frags; +.float tag_message_time; diff --git a/QC/rogue_dmatch.qc b/QC/rogue_dmatch.qc new file mode 100644 index 00000000..e7bc631a --- /dev/null +++ b/QC/rogue_dmatch.qc @@ -0,0 +1,185 @@ +// dmatch - general deathmatch additions + +// ======================================= +// ======================================= +void() tag_token_respawn = +{ + entity spawnPoint; + entity tagToken; + + tagToken = find(world, classname, "dmatch_tag_token"); + if(tagToken == world) + return; + + spawnPoint = SelectSpawnPoint(); + setorigin(tagToken, spawnPoint.origin); + tag_token_owner = world; + tagToken.solid = SOLID_TRIGGER; + tagToken.touch = tag_token_touch; + tagToken.think = SUB_Null; + tagToken.owner = world; + tagToken.tag_frags = 0; + droptofloor(); +}; + +// ======================================= +// ======================================= +void() tag_token_fall = +{ + self.tag_frags = 0; + self.think = tag_token_respawn; + self.nextthink = time + 30; + droptofloor(); +}; + +// ======================================= +// ======================================= +void() tag_token_drop = +{ + entity tagToken; + + tagToken = find(world, classname, "dmatch_tag_token"); + if(tagToken == world) + return; + + bprint(tagToken.owner.netname); + bprint(" lost the tag token!\n"); + tagToken.tag_frags = 0; + tagToken.solid = SOLID_TRIGGER; + tagToken.owner = world; + tagToken.touch = tag_token_touch; + tagToken.think = tag_token_fall; + tagToken.nextthink = time + 0.1; +}; + +// ======================================= +// ======================================= +void() tag_token_think = +{ + if(self.owner.health > 0) + { + if(self.tag_message_time < time) + { + bprint(self.owner.netname); + bprint(" has the tag token!\n"); + self.tag_message_time = time + 30; + } + + setorigin(self, self.owner.origin + '0 0 48'); + self.think = tag_token_think; + self.nextthink = time + 0.1; + } + else + { + tag_token_drop(); + } +}; + +// ======================================= +// ======================================= +void() tag_token_touch = +{ + if(other.classname != "player") + return; + + tag_token_owner = other; + self.tag_frags = 0; + + sound(self, CHAN_AUTO, "runes/end1.wav", 1, ATTN_NORM); + + bprint(other.netname); + bprint(" got the tag token!\n"); + self.tag_message_time = time + 30; + + self.owner = other; + self.solid = SOLID_NOT; + self.touch = SUB_Null; + self.think = tag_token_think; + self.nextthink = time + 0.1; +}; + +/*QUAKED dmatch_tag_token (1 1 0) (-16 -16 -16) (16 16 16) +The deathmatch tag token. +*/ +void() dmatch_tag_token = +{ + if(cvar_hget(cvarh_teamplay) != TEAM_DMATCH_TAG) + { + remove(self); + return; + } + + precache_model("progs/sphere.mdl"); + precache_sound("runes/end1.wav"); + setmodel(self, "progs/sphere.mdl"); + self.skin = 1; + setsize(self, '-16 -16 -16', '16 16 16'); + self.touch = tag_token_touch; + self.effects = self.effects | EF_DIMLIGHT; + StartItem(); +}; + +// ======================================= +// ======================================= +void(entity targ, entity attacker) dmatch_score = +{ + entity tagToken; + + if(teamplay == TEAM_DMATCH_TAG) + { + tagToken = find(world, classname, "dmatch_tag_token"); + if(tagToken == world) + { + attacker.frags = attacker.frags + 1; + return; + } + + if(attacker == tag_token_owner) + { + tagToken.tag_frags = tagToken.tag_frags + 1; + attacker.frags = attacker.frags + 3; + if(tagToken.tag_frags == 5) + { + sprint(attacker, "You got the Quad Damage\n"); + VR_ItemUtil_EntAddItem(attacker, IID_QUAD); + stuffcmd (attacker, "bf\n"); + sound(attacker,CHAN_VOICE,"items/damage.wav", 1, ATTN_NORM); + attacker.super_time = 1; + attacker.super_damage_finished = time + 30; + } + else if(tagToken.tag_frags == 10) + { + bprint(attacker.netname); + bprint(" lost the tag token\n"); + tagToken.solid = SOLID_TRIGGER; + tagToken.tag_frags = 0; + tagToken.touch = tag_token_touch; + tag_token_respawn(); + } + } + else + { + if(targ == tag_token_owner) + { + attacker.frags = attacker.frags + 5; + sound(self, CHAN_AUTO, "runes/end1.wav", 1, ATTN_NORM); + if(attacker.classname == "player") + { + tag_token_owner = attacker; + + tagToken.tag_frags = 0; + tagToken.tag_message_time = time + 0.5; + tagToken.owner = attacker; + tagToken.solid = SOLID_NOT; + tagToken.touch = SUB_Null; + tagToken.think = tag_token_think; + tagToken.nextthink = time + 0.1; + } + } + else + attacker.frags = attacker.frags + 1; + } + } +}; + + diff --git a/QC/rogue_dragon.qc b/QC/rogue_dragon.qc new file mode 100644 index 00000000..236dd492 --- /dev/null +++ b/QC/rogue_dragon.qc @@ -0,0 +1,836 @@ +// dragon.qc + +$base dragrest +$skin dragskin + +$frame dragon6 + +$frame drgfly01 drgfly02 drgfly03 drgfly04 +$frame drgfly05 drgfly06 drgfly07 drgfly08 +$frame drgfly09 drgfly10 drgfly11 drgfly12 drgfly13 + +$frame drgtrn01 drgtrn02 drgtrn03 drgtrn04 drgtrn05 drgtrn06 + +$frame drgslh01 drgslh02 drgslh03 drgslh04 drgslh05 drgslh06 +$frame drgslh07 drgslh08 drgslh09 drgslh10 drgslh11 drgslh12 drgslh13 + +$frame drgfir01 drgfir02 drgfir03 drgfir04 drgfir05 +$frame drgfir06 drgfir07 drgfir08 drgfir09 drgfir10 + +$frame drgfix1a drgfix1b drgfix1c +$frame drgfix2a drgfix2b drgfix2c +$frame drgfix3a drgfix3b drgfix3c +$frame drgfix4a drgfix4b drgfix4c +$frame drgfix5a drgfix5b drgfix5c +$frame drgfix6a drgfix6b drgfix6c drgfix6d + +$frame drgpan1a drgpan1b drgpan1c +$frame drgpan2a drgpan2b drgpan2c +$frame drgpan3a drgpan3b drgpan3c +$frame drgpan4a drgpan4b drgpan4c +$frame drgpan5a drgpan5b drgpan5c +$frame drgpan6a drgpan6b drgpan6c + +$frame drgdth01 drgdth02 drgdth03 drgdth04 drgdth05 drgdth06 +$frame drgdth07 drgdth08 drgdth09 drgdth10 drgdth11 drgdth12 +$frame drgdth13 drgdth14 drgdth15 drgdth16 drgdth17 drgdth18 +$frame drgdth19 drgdth20 drgdth21 + +void() dragon_fireball; +void() dragon_melee1; + +// =================================== +// global variables +// =================================== + +float DDIE_FALLING = 1; +float DDIE_STOPPED = 2; +float DDIE_EXPLODED = 3; + +float DT_ROOM_A = 1; +float DT_ROOM_B = 2; +float DT_ROOM_C = 4; + +float FIRE_PLASMA = 1; +float FIRE_FIREBALL = 2; + +// =================================== +// dragon_stop_attack +// =================================== +void() dragon_stop_attack = +{ + if(self.dragonAttacking == FALSE) + return; + +// skill ramp? + self.attack_finished = time + (random() * 2) + 4; + self.attack_finished = self.attack_finished - skill; + + self.dragonAttacking = FALSE; + traceline (self.origin, self.movetarget.origin, TRUE, world); + + if(trace_fraction == 1) + return; + else + bprint("Error: Dragon cannot get to next target!\n"); +}; + +// =================================== +// dragon_check_attack +// =================================== +void() dragon_check_attack = +{ + vector vec; + float dot; + + if(self.dragonAttacking == TRUE) + return; + if(self.th_missile == SUB_Null) + return; + if(self.attack_finished > time) + return; + if(self.enemy.health < 0) + self.enemy = world; + if(self.enemy.flags & FL_NOTARGET) + return; + + if(self.enemy == world) + FindTarget(); + else + { + makevectors(self.angles); + vec = normalize(self.enemy.origin - self.origin); + dot = vec * v_forward; +// if(dot > 0.55) + if(dot > 0.3) + { + traceline (self.origin, self.enemy.origin, TRUE, world); + if(trace_fraction == 1) + { + dot = vlen(self.enemy.origin - self.origin); + if(dot < 350) + { + self.dragonAttacking = TRUE; + self.think = dragon_melee1; + return; + } + else + { + self.dragonAttacking = TRUE; + self.think = self.th_missile; + } + } +// else +// bprint("can't see player!\n"); + } + } +}; + +// =================================== +// dragon_move +// =================================== +void(float dist) dragon_move = +{ + vector moveDir; + vector moveAngles; + float leftTurn, rightTurn, turnOffset; + entity oldEnemy; + + if(self.health < 1) + { + remove(self); + return; + } + + if(self.dragonAttacking == FALSE) // && self.dragonInTransit == FALSE) + dragon_check_attack(); + + oldEnemy = self.enemy; + if(self.dragonAttacking == FALSE) + { + moveDir = self.movetarget.origin - self.origin; + moveAngles = vectoangles (moveDir); + self.enemy = self.movetarget; + } + else + { + moveDir = self.enemy.origin - self.origin; + moveAngles = vectoangles (moveDir); + } + + turnOffset = self.angles_y - moveAngles_y; + if(turnOffset != 0) + { + turnOffset = 180 - self.angles_y; + leftTurn = anglemod (moveAngles_y + turnOffset) - 180; + rightTurn = 180 - anglemod (moveAngles_y + turnOffset); + + if(leftTurn < 0) + leftTurn = 360; + else if(rightTurn < 0) + rightTurn = 360; + + self.yaw_speed = 10; + if(rightTurn < 180) + { + if(self.yaw_speed < rightTurn) + self.angles_y = self.angles_y - self.yaw_speed; + else + self.angles_y = moveAngles_y; + + if(rightTurn > 5) + { + self.angles_z = self.angles_z + 5; + if(self.angles_z > 30) + self.angles_z = 30; + } + turnOffset = rightTurn; + } + else + { + if(self.yaw_speed < rightTurn) + self.angles_y = self.angles_y + self.yaw_speed; + else + self.angles_y = moveAngles_y; + + if(leftTurn > 5) + { + self.angles_z = self.angles_z - 5; + if(self.angles_z < -30) + self.angles_z = -30; + } + turnOffset = leftTurn; + } + } + else if(self.angles_z != 0) + { + if(self.angles_z < -5) + self.angles_z = self.angles_z + 5; + else if(self.angles_z < 5) + self.angles_z = 0; + else if(self.angles_z > 5) + self.angles_z = self.angles_z - 5; + } + + if(moveDir_z > 5) + setorigin(self, self.origin + '0 0 5'); + else if(moveDir_z < -5) + setorigin(self, self.origin - '0 0 5'); + + moveAngles = self.origin; + walkmove(self.angles_y, dist); + + if(moveAngles == self.origin) + { +// bprint("Cannot move smoothly. movetogoal..\n"); + movetogoal (dist); + } + self.enemy = oldEnemy; +}; + +// =================================== +// movement +// =================================== +void() dragon_stand1 = [ $drgfly01, dragon_walk1 ] + { +// bprint("dragon_stand1: ERROR - got to stand frame!\n"); + }; + +// attack A: start - walk1 stop - walk 5 +// ================ +void() dragon_atk_a1=[$drgfix1a, dragon_atk_a2 ] + { dragon_move(17); }; +void() dragon_atk_a2=[$drgfix1b, dragon_atk_a3 ] + { dragon_move(17);dragon_fireball();}; +void() dragon_atk_a3=[$drgfix1c, dragon_walk5 ] + { dragon_move(17);dragon_stop_attack();}; + +// attack B: start - walk3 stop - walk7 +// ================ +void() dragon_atk_b1=[$drgfix2a, dragon_atk_b2 ] + { dragon_move(17); }; +void() dragon_atk_b2=[$drgfix2b, dragon_atk_b3 ] + { dragon_move(17);dragon_fireball();}; +void() dragon_atk_b3=[$drgfix2c, dragon_walk7 ] + { dragon_move(17);dragon_stop_attack();}; + +// attack C: start - walk5 stop - walk9 +// ================ +void() dragon_atk_c1=[$drgfix3a, dragon_atk_c2 ] + {dragon_move(17); }; +void() dragon_atk_c2=[$drgfix3b, dragon_atk_c3 ] + { dragon_move(17);dragon_fireball();}; +void() dragon_atk_c3=[$drgfix3c, dragon_walk9 ] + { dragon_move(17);dragon_stop_attack();}; + +// attack d: start - walk7 stop - walk11 +// ================ +void() dragon_atk_d1=[$drgfix4a, dragon_atk_d2 ] + { dragon_move(17); }; +void() dragon_atk_d2=[$drgfix4b, dragon_atk_d3 ] + { dragon_move(17);dragon_fireball();}; +void() dragon_atk_d3=[$drgfix4c, dragon_walk11 ] + { dragon_move(17);dragon_stop_attack();}; + +// attack E: start - walk9 stop - walk13 +// ================ +void() dragon_atk_e1=[$drgfix5a, dragon_atk_e2 ] + { dragon_move(17); }; +void() dragon_atk_e2=[$drgfix5b, dragon_atk_e3 ] + { dragon_move(17);dragon_fireball();}; +void() dragon_atk_e3=[$drgfix5c, dragon_walk13 ] + { dragon_move(17);dragon_stop_attack();}; + +// attack F: start - walk11 stop - walk3 +// ================ +void() dragon_atk_f1=[$drgfix6a, dragon_atk_f2 ] + {dragon_move(17); }; +void() dragon_atk_f2=[$drgfix6b, dragon_atk_f3 ] + { dragon_move(17);dragon_fireball();}; +void() dragon_atk_f3=[$drgfix6c, dragon_atk_f4 ] + { dragon_move(17); }; +void() dragon_atk_f4=[$drgfix6c, dragon_walk3 ] + { dragon_move(17);dragon_stop_attack();}; + +// =================================== +// dragon walk frames +// =================================== +void() dragon_walk1 =[ $drgfly01, dragon_walk2 ] + { + if(self.dragonAttacking) + dragon_stop_attack(); + + self.th_missile=dragon_atk_a1; + self.dragonPainSequence = 1; + dragon_move(17); + if(random() < 0.2) + sound(self, CHAN_VOICE, "dragon/active.wav", 0.6, ATTN_IDLE); + }; +void() dragon_walk2 =[ $drgfly02, dragon_walk3 ] + { self.th_missile=SUB_Null; dragon_move(17);}; +void() dragon_walk3 =[ $drgfly03, dragon_walk4 ] + { + self.th_missile=dragon_atk_b1; dragon_move(17); + self.dragonPainSequence=2; + }; +void() dragon_walk4 =[ $drgfly04, dragon_walk5 ] + { self.th_missile=SUB_Null; dragon_move(17);}; +void() dragon_walk5 =[ $drgfly05, dragon_walk6 ] + { + self.th_missile=dragon_atk_c1; dragon_move(17); + self.dragonPainSequence=3; + }; +void() dragon_walk6 =[ $drgfly06, dragon_walk7 ] + { self.th_missile=SUB_Null; dragon_move(17); }; +void() dragon_walk7 =[ $drgfly07, dragon_walk8 ] + { + self.th_missile=dragon_atk_d1; dragon_move(17); + self.dragonPainSequence=4; + }; +void() dragon_walk8 =[ $drgfly08, dragon_walk9 ] + { self.th_missile=SUB_Null; dragon_move(17); }; +void() dragon_walk9 =[ $drgfly09, dragon_walk10 ] + { + self.th_missile=dragon_atk_e1; dragon_move(17); + self.dragonPainSequence=5; + }; +void() dragon_walk10 =[ $drgfly10, dragon_walk11 ] + { self.th_missile=SUB_Null; dragon_move(17); }; +void() dragon_walk11 =[ $drgfly11, dragon_walk12 ] + { + self.th_missile=dragon_atk_f1; dragon_move(17); + self.dragonPainSequence=6; + }; +void() dragon_walk12 =[ $drgfly12, dragon_walk13 ] + { self.th_missile=SUB_Null; dragon_move(17); }; +void() dragon_walk13 =[ $drgfly13, dragon_walk1 ] + { self.th_missile=SUB_Null; dragon_move(17); self.dragonPainSequence=1;}; + +// =================================== +// attack +// =================================== + +void() FireballTouch = +{ + if(other == self.owner) + return; // don't explode on owner + + if(self.owner.classname == "monster_dragon") + T_RadiusDamage(self, self.owner, 90, self.owner); + else + T_RadiusDamage(self, self.owner, 30, world); + + sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 228); // 247 + WriteByte(MSG_BROADCAST, 5); + + remove(self); +}; + +entity(vector org, vector dir) launch_fireball = +{ + entity fireball; + float fireSpeed; + + self.effects = self.effects | EF_MUZZLEFLASH; + fireball = spawn(); + fireball.owner = self; + fireball.movetype = MOVETYPE_FLYMISSILE; + fireball.solid = SOLID_BBOX; + fireball.classname = "fireball"; + setmodel(fireball, "progs/fireball.mdl"); + setorigin(fireball, org); + setsize(fireball, '0 0 0', '0 0 0'); + + fireSpeed = random() * 300 + 900; + fireball.velocity = dir * fireSpeed; + fireball.avelocity = '0 0 300'; + fireball.angles = vectoangles(fireball.velocity); + fireball.enemy = self.enemy; + + fireball.touch = FireballTouch; + fireball.nextthink = time + 6; + fireball.think = SUB_Remove; + + return fireball; +}; + +// =========================================== +// dragon_fireball +// =========================================== +void() dragon_fireball = +{ + float fireCount; + vector org, dir; + float distortion; + float fireType; + + sound(self, CHAN_VOICE, "dragon/attack.wav", 1, ATTN_NORM); + + makevectors(self.angles); + org = self.origin + v_forward*112 + v_up*32; + + if(random() > 0.66) + { + fireCount = 1; + if(skill > 1) + fireCount = 2; + fireType = FIRE_PLASMA; + } + else + { + fireType = FIRE_FIREBALL; + fireCount = random() * skill; // easy 0, med 0-1, hard 0-2 + fireCount = rint (fireCount) + 1; + // easy 1, med 1-2, hard 1-3 + } + + while (fireCount > 0) + { + distortion = (random() - 0.5) * 0.25; + dir = normalize(self.enemy.origin - org); + makevectors(dir); + dir = dir + v_right * distortion; + + if(fireType == FIRE_FIREBALL) + launch_fireball(org, dir); + else + launch_plasma(org, dir); + + fireCount = fireCount - 1; + } + +}; + +// =================================== +// melee attacks +// =================================== +void() dragon_tail_touch = +{ + vector delta; + float tailDamage; + + if(!self.enemy) + return; + if(!CanDamage(self.enemy, self)) + return; + + ai_charge(10); + + delta = self.enemy.origin - self.origin; + tailDamage = vlen(delta); + if(vlen(delta) > 150) + { + return; + } + + tailDamage = (random() * 30) + 30; + T_Damage(self.enemy, self, self, tailDamage); +}; + +void() dragon_tail = +{ + float dist; + vector dir; + + if(!self.enemy) + return; + if(!CanDamage(self.enemy, self)) + return; + + dragon_move(10); + + dir = self.enemy.origin - self.origin; + dist = vlen(dir); + if(dist < 250) + { + T_Damage(self.enemy, self, self, 30); + dir = normalize(dir); + self.enemy.velocity = dir * 500; + self.enemy.velocity_z = 350; + } + + dragon_stop_attack(); +}; + +void() dragon_melee1=[$drgslh01, dragon_melee2 ] { dragon_move(12);}; +void() dragon_melee2=[$drgslh02, dragon_melee3 ] { dragon_move(12);}; +void() dragon_melee3=[$drgslh03, dragon_melee4 ] { dragon_move(12);}; +void() dragon_melee4=[$drgslh04, dragon_melee5 ] { dragon_move(12);}; +void() dragon_melee5=[$drgslh05, dragon_melee6 ] { dragon_move(12);}; +void() dragon_melee6=[$drgslh06, dragon_melee7 ] { dragon_move(12);}; +void() dragon_melee7=[$drgslh07, dragon_melee8 ] { dragon_move(12);}; +void() dragon_melee8=[$drgslh08, dragon_melee9 ] { dragon_move(12);}; +void() dragon_melee9=[$drgslh09, dragon_melee10] { dragon_move(12);}; +void() dragon_melee10=[$drgslh10, dragon_melee11] { dragon_tail();}; +void() dragon_melee11=[$drgslh11, dragon_melee12] { dragon_move(10);}; +void() dragon_melee12=[$drgslh12, dragon_melee13] { dragon_move(10);}; +void() dragon_melee13=[$drgslh13, dragon_walk1 ] +{ dragon_move(10);}; + +// =================================== +// pain +// =================================== +void() dragon_painA1 = [ $drgpan1a, dragon_painA2 ] {dragon_move(12);}; +void() dragon_painA2 = [ $drgpan1b, dragon_painA3 ] {dragon_move(12);}; +void() dragon_painA3 = [ $drgpan1c, dragon_walk5 ] {dragon_move(12);}; + +void() dragon_painB1 = [ $drgpan2a, dragon_painB2 ] {dragon_move(12);}; +void() dragon_painB2 = [ $drgpan2b, dragon_painB3 ] {dragon_move(12);}; +void() dragon_painB3 = [ $drgpan2c, dragon_walk7 ] {dragon_move(12);}; + +void() dragon_painC1 = [ $drgpan3a, dragon_painC2 ] {dragon_move(12);}; +void() dragon_painC2 = [ $drgpan3b, dragon_painC3 ] {dragon_move(12);}; +void() dragon_painC3 = [ $drgpan3c, dragon_walk9 ] {dragon_move(12);}; + +void() dragon_painD1 = [ $drgpan4a, dragon_painD2 ] {dragon_move(12);}; +void() dragon_painD2 = [ $drgpan4b, dragon_painD3 ] {dragon_move(12);}; +void() dragon_painD3 = [ $drgpan4c, dragon_walk11 ] {dragon_move(12);}; + +void() dragon_painE1 = [ $drgpan5a, dragon_painE2 ] {dragon_move(12);}; +void() dragon_painE2 = [ $drgpan5b, dragon_painE3 ] {dragon_move(12);}; +void() dragon_painE3 = [ $drgpan5c, dragon_walk13 ] {dragon_move(12);}; + +void() dragon_painF1 = [ $drgpan6a, dragon_painF2 ] {dragon_move(12);}; +void() dragon_painF2 = [ $drgpan6b, dragon_painF3 ] {dragon_move(12);}; +void() dragon_painF3 = [ $drgpan6c, dragon_walk2 ] {dragon_move(12);}; + +void(entity attacker, float damage) dragon_pain = +{ + float r; + + if(self.pain_finished > time) + return; + + r = random(); + + if(r < 0.25) + { + dragon_stop_attack(); + + sound(self, CHAN_VOICE, "dragon/pain.wav", 1, ATTN_NORM); + self.pain_finished = time + 2; + + if(self.dragonPainSequence == 1) + self.think = dragon_painA1; + else if(self.dragonPainSequence == 2) + self.think = dragon_painF1; + else if(self.dragonPainSequence == 3) + self.think = dragon_painE1; + else if(self.dragonPainSequence == 4) + self.think = dragon_painD1; + else if(self.dragonPainSequence == 5) + self.think = dragon_painC1; + else if(self.dragonPainSequence == 6) + self.think = dragon_painB1; + } +}; + +// =================================== +// death +// =================================== +void() dragon_boom2 = +{ + self.velocity = self.dragonLastVelocity; + ViolentDeath(15); + self.target = "dragondoor"; + SUB_UseTargets(); + remove(self); +}; + +void() dragon_boom1 = +{ + if(self.dragonDeathState > DDIE_STOPPED) +// objerror ("dragon_boom1"); + return; + + self.dragonDeathState = DDIE_EXPLODED; + ThrowGib("progs/drggib01.mdl", -100); + ThrowGib("progs/drggib02.mdl", -100); + ThrowGib("progs/drggib03.mdl", -100); + sound(self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); + self.think = dragon_boom2; + self.nextthink = time + 0.1; +}; + +void() dragon_explode = +{ + if(self.dragonDeathState > DDIE_FALLING) +// objerror ("dragon_explode"); + return; + + if(vlen(self.velocity) < 100 || self.flags & FL_INWATER) + { + self.dragonDeathState = DDIE_STOPPED; + dragon_boom1(); + } + else + { + makevectors(self.angles); + self.velocity = self.velocity - 40 * v_up; + self.dragonLastVelocity = self.velocity; + } +}; + +void() dragon_squish = +{ + if(other.classname == "player") + { + self.classname = "monster_dragon_dead"; + T_Damage(other, self, self, 200); + } + if(other == world) + { + self.velocity = '0 0 0'; + dragon_explode(); + } +}; + +void() dragon_death1 = [ $drgdth01, dragon_death2 ] + { + if(self.dragonDeathState > 0) +// objerror ("dragon_death1"); + return; + + self.dragonDeathState = DDIE_FALLING; + self.use = SUB_Null; + makevectors(self.angles); + self.velocity = 300 * v_forward - 40 * v_up; + self.flags = self.flags - (self.flags & FL_ONGROUND); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.touch = dragon_squish; + + sound(self, CHAN_VOICE, "dragon/death.wav", 1, ATTN_NONE); + self.dragonAttacking = FALSE; + }; +void() dragon_death2 = [ $drgdth02, dragon_death3 ] {dragon_explode();}; +void() dragon_death3 = [ $drgdth03, dragon_death4 ] {dragon_explode();}; +void() dragon_death4 = [ $drgdth04, dragon_death5 ] {dragon_explode();}; +void() dragon_death5 = [ $drgdth05, dragon_death6 ] {dragon_explode();}; +void() dragon_death6 = [ $drgdth06, dragon_death7 ] {dragon_explode();}; +void() dragon_death7 = [ $drgdth07, dragon_death8 ] {dragon_explode();}; +void() dragon_death8 = [ $drgdth08, dragon_death9 ] {dragon_explode();}; +void() dragon_death9 = [ $drgdth09, dragon_death10 ] {dragon_explode();}; +void() dragon_death10 = [ $drgdth10, dragon_death11 ] {dragon_explode();}; +void() dragon_death11 = [ $drgdth11, dragon_death12 ] {dragon_explode();}; +void() dragon_death12 = [ $drgdth12, dragon_death13 ] {dragon_explode();}; +void() dragon_death13 = [ $drgdth13, dragon_death14 ] {dragon_explode();}; +void() dragon_death14 = [ $drgdth14, dragon_death15 ] {dragon_explode();}; +void() dragon_death15 = [ $drgdth15, dragon_death16 ] {dragon_explode();}; +void() dragon_death16 = [ $drgdth16, dragon_death17 ] {dragon_explode();}; +void() dragon_death17 = [ $drgdth17, dragon_death18 ] {dragon_explode();}; +void() dragon_death18 = [ $drgdth18, dragon_death19 ] {dragon_explode();}; +void() dragon_death19 = [ $drgdth19, dragon_death20 ] {dragon_explode();}; +void() dragon_death20 = [ $drgdth20, dragon_death21 ] {dragon_explode();}; +void() dragon_death21 = [ $drgdth21, dragon_death21 ] +{ + ViolentDeath(39); + self.target = "dragondoor"; + SUB_UseTargets(); + remove(self); +}; + +// =================================== +// Delayed Activation +// =================================== +void() dragon_use = +{ + if(self.health < 1) + { + self.use = SUB_Null; + return; + } + + self.th_stand = dragon_walk1; + self.th_walk = dragon_walk1; + self.think = dragon_walk1; + self.nextthink = time + 0.1; +}; + +// =================================== +// dragon activation code +// =================================== +void() dragon_activate = +{ + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + if(!self.yaw_speed) + self.yaw_speed = 10; + self.view_ofs = '0 0 25'; + + self.flags = self.flags | FL_FLY; + self.flags = self.flags | FL_MONSTER; + + if(!walkmove(0,0)) + { + dprint("flymonster in wall!\n"); + dprint(self.classname); + dprint(" at "); + dprint(vtos(self.origin)); + dprint("\n"); + } + + if(self.target != NULLSTR) + { + self.movetarget = find(world, targetname, self.target); + self.goalentity = self.movetarget; + if(!self.movetarget) + { + dprint("Monster can't find target at "); + dprint(vtos(self.origin)); + dprint("\n"); + } + } + + if(self.targetname != NULLSTR) + self.use = dragon_use; + else + dragon_use(); + +}; + +/*QUAKED monster_dragon (1 0 0) (-32 -32 -24) (32 32 64) Ambush +*/ +void() monster_dragon = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/dragon.mdl"); + precache_model("progs/fireball.mdl"); + precache_model("progs/drggib01.mdl"); + precache_model("progs/drggib02.mdl"); + precache_model("progs/drggib03.mdl"); + + precache_sound("dragon/see.wav"); + precache_sound("dragon/active.wav"); + precache_sound("dragon/attack.wav"); + precache_sound("dragon/pain.wav"); + precache_sound("dragon/death.wav"); + + self.dragonInRoom = DT_ROOM_A; + self.dragonInTransit = 0; + self.dragonAttacking = FALSE; + self.playerInRoom = DT_ROOM_A; + self.playerInTransit = 0; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/dragon.mdl"); + setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX); + self.health = 3000 + (1000 * cvar_hget(cvarh_skill)); + + self.th_run = dragon_walk1; + self.th_pain = dragon_pain; + self.th_die = dragon_death1; + + self.dragonPainSequence=1; + + total_monsters = total_monsters + 1; + self.nextthink = self.nextthink + 0.1; + self.think = dragon_activate; +}; + +// ================================================= +// dragon trigger +// -- OBSOLETE!! +// ================================================= + +/*QUAKED trigger_dragon (.5 .5 .5) ? A B C +Trigger to let dragon know what room you're in. + +Set the A,B,C to which room this trigger is at. + +Point the trigger towards the room. If the player is going +the direction the trigger points, he is entering the room. +If not, he is leaving. +*/ +void() trigger_dragon = +{ + remove(self); +}; + +// ================================================= +// dragon corners +// ================================================= +void() dragon_corner_touch = +{ + if(other.movetarget != self) + return; + + if(other.classname != "monster_dragon") + return; + + other.movetarget = find(world, targetname, self.target); + other.goalentity = other.movetarget; + other.target = self.target; + + if(!other.movetarget) + { + objerror ("dragon_corner: no target found"); + } +}; + +/*QUAKED dragon_corner (0.5 0.3 0) (-16 -16 -16) (16 16 16) +Only for use with monster_dragon. Use only as transitions +between rooms. +*/ +void() dragon_corner = +{ + if(!self.targetname) + objerror ("dragon_corner: no targetname"); + + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + self.touch = dragon_corner_touch; + self.modelindex = 0; + self.model = ""; + setsize(self, '-16 -16 -16', '16 16 16'); +}; + diff --git a/QC/rogue_earthq.qc b/QC/rogue_earthq.qc new file mode 100644 index 00000000..3bcc6b49 --- /dev/null +++ b/QC/rogue_earthq.qc @@ -0,0 +1,160 @@ +// earthquake + +// ============================================================ +// Level-Wide Earthquakes +// ============================================================ +float EQ_RANDOM = 1; + +void() earthquake_rumble = +{ + if(self.attack_finished < time) + stop_earthquake(); + else + { + sound(self, CHAN_VOICE, "equake/rumble.wav", 1, ATTN_NONE); + self.think = earthquake_rumble; + self.nextthink = time + 1; + } +}; + +void() start_earthquake = +{ + earthquake_active = 1; + if(self.spawnflags & EQ_RANDOM) + self.attack_finished = time + random() * self.delay; + else + self.attack_finished = time + self.delay; + earthquake_rumble(); +}; + +void() stop_earthquake = +{ + earthquake_active = 0; + self.think = start_earthquake; + if(self.spawnflags & EQ_RANDOM) + self.nextthink = time + random() * self.wait; + else + self.nextthink = time + self.wait; +}; + +/*QUAKED earthquake (0 1 0) (-8 -8 -8) (8 8 8) Random +The Earthquake generator. + +delay - duration of the tremor (default 20) +wait - time between tremors (default 60) +weapon - richter scale of movement (default 40) + +RANDOM affects the times only. It will change the randomly between +0-n where n is the duration or time between. + +weapon - if you give a weapon value of 40, the X and Y displacement +can vary between -20 and +20, a range of 40. +*/ +void() earthquake = +{ + if(!self.delay) + self.delay = 20; + if(!self.wait) + self.wait = 60; + if(!self.weapon) + self.weapon = 40; + + precache_sound("equake/rumble.wav"); + earthquake_active = 0; + earthquake_intensity = self.weapon * 0.5; + + setsize(self, '0 0 0', '0 0 0'); + self.think = stop_earthquake; + self.nextthink = time + 1; +}; + +// ============================================================ +// Earthquake trigger +// ============================================================ +void() earthquake_touch = +{ + if(self.delay) + { + if(self.attack_finished < time) + { + sound(self, CHAN_VOICE, "equake/rumble.wav", 1, ATTN_NORM); + self.attack_finished = time + 1; + } + + if(other.classname == "player") + { + if(other.flags & FL_ONGROUND) + { + other.velocity_x = other.velocity_x + + (random() * self.weapon * 2) - + self.weapon; + other.velocity_y = other.velocity_y + + (random() * self.weapon * 2) - + self.weapon; + other.velocity_z = other.velocity_z + + (random() * self.weapon * 2) - + self.weapon; + } + } + } +}; + +void() rogue_earthquake_use = +{ + self.delay = !self.delay; +}; + +/*QUAKED trigger_earthquake (.5 .5 .5) ? +The Earthquake generator. + +Anytime a person is in an active field, they shake. If the trigger is a target, it will be OFF until triggered. It will then toggle between ON and OFF. + +weapon - richter scale of movement (default 40) + +weapon - if you give a weapon value of 40, the X and Y displacement +can vary between -20 and +20, a range of 40. +*/ +void() trigger_earthquake = +{ + precache_sound("equake/rumble.wav"); + + if(!self.weapon) + self.weapon = 40; + + self.weapon = self.weapon * 0.5; + self.delay = 1; + self.touch = earthquake_touch; + + if(self.targetname != NULLSTR) + { + self.use = rogue_earthquake_use; + self.delay = 0; + } + + InitTrigger(); +}; + +void() kill_earthquake = +{ + entity eq; + + if(other.classname != "player") + return; + + eq = find(world, classname, "earthquake"); + if(eq != world) + { + earthquake_active = 0; + remove(eq); + } +}; + +/*QUAKED trigger_earthquake_kill (.5 .5 .5) ? +Trigger to kill the level-wide earthquake. +*/ +void() trigger_earthquake_kill = +{ + self.touch = kill_earthquake; + + InitTrigger(); +}; diff --git a/QC/rogue_eel.qc b/QC/rogue_eel.qc new file mode 100644 index 00000000..0ea6f362 --- /dev/null +++ b/QC/rogue_eel.qc @@ -0,0 +1,228 @@ +$cd /qwork/xpack/models/eel +$origin 0 0 0 +$scale .12 +$base eelrest3 +$skin eelfin +$frame eelswim1 eelswim2 eelswim3 eelswim4 eelswim5 eelswim6 +$frame eeldth1 eeldth2 eeldth3 eeldth4 eeldth5 +$frame eeldth6 eeldth7 eeldth8 eeldth9 eeldth10 + +void() eel_pitch_change = +{ + if(pointcontents(self.origin) != CONTENT_WATER) + { + droptofloor(); + T_Damage(self, world, world, 6); + return; + } + + if(time < self.delay) + return; + + if(self.weapon > 10) + self.weapon = -10; + + if(self.weapon < 0) + self.angles_x = self.angles_x - 1.5; + else if(self.weapon > 0) + self.angles_x = self.angles_x + 1.5; + + self.weapon = self.weapon + 1; +}; + +void() eel_stand1 =[ $eelswim1, eel_stand2 ] +{ ai_stand(); eel_pitch_change();} ; +void() eel_stand2 =[ $eelswim2, eel_stand3 ] +{ ai_stand(); eel_pitch_change();}; +void() eel_stand3 =[ $eelswim3, eel_stand4 ] +{ ai_stand(); eel_pitch_change();}; +void() eel_stand4 =[ $eelswim4, eel_stand5 ] +{ ai_stand(); eel_pitch_change();}; +void() eel_stand5 =[ $eelswim5, eel_stand6 ] +{ ai_stand(); eel_pitch_change();}; +void() eel_stand6 =[ $eelswim6, eel_stand1 ] +{ ai_stand(); eel_pitch_change();}; + +void() eel_walk1 =[ $eelswim1, eel_walk2 ] +{ + if(random() < 0.2) + sound(self, CHAN_VOICE, "eel/eactive1.wav", 1, ATTN_IDLE); + ai_walk(6); + eel_pitch_change(); +}; +void() eel_walk2 =[ $eelswim2, eel_walk3 ] {ai_walk(6);eel_pitch_change();}; +void() eel_walk3 =[ $eelswim3, eel_walk4 ] {ai_walk(6);eel_pitch_change();}; +void() eel_walk4 =[ $eelswim4, eel_walk5 ] {ai_walk(6);eel_pitch_change();}; +void() eel_walk5 =[ $eelswim5, eel_walk6 ] {ai_walk(6);eel_pitch_change();}; +void() eel_walk6 =[ $eelswim6, eel_walk1 ] {ai_walk(6);eel_pitch_change();}; + +void() eel_run1 =[ $eelswim1, eel_run2 ] +{ + if(random() < 0.4) + sound(self, CHAN_VOICE, "eel/eactive1.wav", 1, ATTN_IDLE); + ai_run(10); + eel_pitch_change(); +}; +void() eel_run2 =[ $eelswim2, eel_run3 ] {ai_run(10);eel_pitch_change();}; +void() eel_run3 =[ $eelswim3, eel_run4 ] {ai_run(10);eel_pitch_change();}; +void() eel_run4 =[ $eelswim4, eel_run5 ] {ai_run(10);eel_pitch_change();}; +void() eel_run5 =[ $eelswim5, eel_run6 ] {ai_run(10);eel_pitch_change();}; +void() eel_run6 =[ $eelswim6, eel_run1 ] {ai_run(10);eel_pitch_change();}; + +void() eel_melee = +{ + float attackOK; + + attackOK = 1; + + traceline (self.origin, self.enemy.origin, FALSE, self); + + if(trace_ent != self.enemy) + attackOK = FALSE; // don't have a clear shot + if(trace_inopen && trace_inwater) + attackOK = FALSE; // sight line crossed contents + + if(attackOK) + T_EELZap (self, self, 45); + self.skin=0; + self.effects=0; +}; + +void() eel_attack1 =[ $eelswim1, eel_attack2 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack2 =[ $eelswim2, eel_attack3 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack3 =[ $eelswim3, eel_attack4 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack4 =[ $eelswim4, eel_attack5 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack5 =[ $eelswim5, eel_attack6 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack6 =[ $eelswim6, eel_attack7 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack7 =[ $eelswim1, eel_attack8 ] + { ai_charge(8); eel_pitch_change();}; +void() eel_attack8 =[ $eelswim2, eel_attack9 ] +{ + self.effects = EF_DIMLIGHT; + self.skin=1; + ai_charge(8); + eel_pitch_change(); + sound(self, CHAN_WEAPON, "eel/eatt1.wav", 1, ATTN_NORM); +}; +void() eel_attack9 =[ $eelswim3, eel_attack10 ] + { self.skin=2;ai_charge(8);eel_pitch_change(); }; +void() eel_attack10=[ $eelswim4, eel_attack11 ] + { self.skin=3;ai_charge(8);eel_pitch_change(); }; +void() eel_attack11=[ $eelswim5, eel_attack12 ] + { self.effects = EF_BRIGHTLIGHT; self.skin=4;ai_charge(8);eel_pitch_change();}; +void() eel_attack12=[ $eelswim6, eel_run1 ] + { self.skin=5;eel_melee(); }; + +void() eel_death1 =[ $eeldth1, eel_death2 ] +{ + self.skin = 0; + self.effects = 0; + sound(self, CHAN_VOICE, "eel/edie3r.wav", 1, ATTN_NORM); +}; +void() eel_death2 =[ $eeldth2, eel_death3 ] {}; +void() eel_death3 =[ $eeldth3, eel_death4 ] {}; +void() eel_death4 =[ $eeldth4, eel_death5 ] {}; +void() eel_death5 =[ $eeldth3, eel_death6 ] {}; +void() eel_death6 =[ $eeldth2, eel_death7 ] {}; +void() eel_death7 =[ $eeldth1, eel_death8 ] {}; +void() eel_death8 =[ $eeldth2, eel_death9 ] {}; +void() eel_death9 =[ $eeldth3, eel_death10 ] {}; +void() eel_death10 =[ $eeldth4, eel_death11 ] {}; +void() eel_death11 =[ $eeldth5, eel_death12 ] { self.flags = self.flags - FL_SWIM; }; +void() eel_death12 =[ $eeldth6, eel_death13 ] {}; +void() eel_death13 =[ $eeldth7, eel_death14 ] {}; +void() eel_death14 =[ $eeldth8, eel_death15 ] {}; +void() eel_death15 =[ $eeldth9, eel_death16 ] {droptofloor();}; +void() eel_death16 =[ $eeldth10, eel_death16 ] {self.solid = SOLID_NOT;}; + +void() eel_death = +{ + self.flags = self.flags + FL_SWIM; + setsize(self, '0 0 0', '0 0 0'); + +// self.skin = 1; // change to bloody eel skin! + if(self.health < -12) + { + self.skin = 0; + self.effects = 0; + ThrowHead ("progs/eelgib.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + return; + } + else + { + eel_death1(); + } +}; + +void(entity attacker, float damage) eel_pain = +{ + eel_pain1(); +} + +void() eel_pain1 =[ $eeldth1, eel_pain2 ] +{ + if(self.pain_finished > time) + return; + + self.pain_finished = time + 1; + sound(self, CHAN_VOICE, "eel/epain3.wav", 1, ATTN_NORM); + self.skin=0; +}; +void() eel_pain2 =[ $eeldth2, eel_pain3 ] {}; +void() eel_pain3 =[ $eeldth3, eel_pain4 ] {}; +void() eel_pain4 =[ $eeldth4, eel_pain5 ] {}; +void() eel_pain5 =[ $eeldth3, eel_pain6 ] {}; +void() eel_pain6 =[ $eeldth2, eel_pain7 ] {}; +void() eel_pain7 =[ $eeldth1, eel_run1 ] {}; + +/*QUAKED monster_eel (1 0 0) (-16 -16 -24) (16 16 32) Ambush +*/ +void() monster_eel = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/eel2.mdl"); + precache_model("progs/eelgib.mdl"); + precache_model("progs/gib1.mdl"); + + precache_sound("eel/edie3r.wav"); + precache_sound("eel/epain3.wav"); + precache_sound("eel/eactive1.wav"); + precache_sound("eel/eatt1.wav"); + precache_sound("eel/eelc5.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/eel2.mdl"); + + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.health = 60; + + self.th_stand = eel_stand1; + self.th_walk = eel_walk1; + self.th_run = eel_run1; + self.th_die = eel_death; + self.th_pain = eel_pain; + self.th_melee = eel_attack1; + + self.delay = time + random() * 6; + self.weapon = 0; + + swimmonster_start(); +}; diff --git a/QC/rogue_elevatr.qc b/QC/rogue_elevatr.qc new file mode 100644 index 00000000..21aff6cc --- /dev/null +++ b/QC/rogue_elevatr.qc @@ -0,0 +1,151 @@ +// elevator button +// pmack +// sept 96 + +float ELVTR_DOWN = 1; + +void() elvtr_button_wait = +{ + ELV_BUTN_DIR = 0; + if(self.spawnflags & ELVTR_DOWN) + ELV_BUTN_DIR = -1; + else + ELV_BUTN_DIR = 1; + + self.state = STATE_TOP; + self.nextthink = self.ltime + self.wait; + self.think = elvtr_button_return; + activator = self.enemy; + SUB_UseTargets(); + self.frame = 1; // use alternate textures +}; + +void() elvtr_button_done = +{ + self.state = STATE_BOTTOM; +}; + +void() elvtr_button_return = +{ + self.state = STATE_DOWN; + SUB_CalcMove (self.pos1, self.speed, elvtr_button_done); + self.frame = 0; // use normal textures + if(self.health) + self.takedamage = DAMAGE_YES; // can be shot again +}; + + +void() elvtr_button_blocked = +{ // do nothing, just don't ome all the way back out +}; + + +void() elvtr_button_fire = +{ + if(self.state == STATE_UP || self.state == STATE_TOP) + return; + + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + self.state = STATE_UP; + SUB_CalcMove (self.pos2, self.speed, elvtr_button_wait); +}; + + +void() elvtr_button_use = +{ + self.enemy = activator; + elvtr_button_fire (); +}; + +void() elvtr_button_touch = +{ + if(other.classname != "player") + return; + self.enemy = other; + elvtr_button_fire (); +}; + +void() elvtr_button_killed = +{ + self.enemy = damage_attacker; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + elvtr_button_fire (); +}; + + +/*QUAKED func_elvtr_button (0 .5 .8) ? ELVTR_DOWN +ELEVATOR BUTTON ONLY! + +ELVTR_DOWN causes this to be a DOWN button. +Default is UP. + +When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. + +"angle" determines the opening direction +"target" all entities with a matching targetname will be used +"speed" override the default 40 speed +"wait" override the default 1 second wait (-1 = never return) +"lip" override the default 4 pixel lip remaining at end of move +"health" if set, the button must be killed instead of touched +"sounds" +0) steam metal +1) wooden clunk +2) metallic click +3) in-out +*/ +void() func_elvtr_button = +{ + if(self.sounds == 0) + { + precache_sound("buttons/airbut1.wav"); + self.noise = "buttons/airbut1.wav"; + } + if(self.sounds == 1) + { + precache_sound("buttons/switch21.wav"); + self.noise = "buttons/switch21.wav"; + } + if(self.sounds == 2) + { + precache_sound("buttons/switch02.wav"); + self.noise = "buttons/switch02.wav"; + } + if(self.sounds == 3) + { + precache_sound("buttons/switch04.wav"); + self.noise = "buttons/switch04.wav"; + } + + SetMovedir (); + + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel(self, self.model); + + self.blocked = elvtr_button_blocked; + self.use = elvtr_button_use; + + if(self.health) + { + self.max_health = self.health; + self.th_die = elvtr_button_killed; + self.takedamage = DAMAGE_YES; + } + else + self.touch = elvtr_button_touch; + + if(!self.speed) + self.speed = 40; + if(!self.wait) + self.wait = 1; + if(!self.lip) + self.lip = 4; + + self.state = STATE_BOTTOM; + + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); +}; + diff --git a/QC/rogue_ending.qc b/QC/rogue_ending.qc new file mode 100644 index 00000000..11e76a2c --- /dev/null +++ b/QC/rogue_ending.qc @@ -0,0 +1,349 @@ +// ending.qc +// code to handle big ending of Xpack. +// ------------------------------------------------ +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 +$frame stand1 stand2 stand3 stand4 stand5 +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 +$frame axdeth7 axdeth8 axdeth9 +$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 +$frame deatha9 deatha10 deatha11 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 +$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 +$frame deathd8 deathd9 +$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 +$frame deathe8 deathe9 +$frame nailatt1 nailatt2 +$frame light1 light2 +$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 +$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + +entity theActor; +entity theMachine; + +float actorStage; + +float STAGE_START = 0; +float STAGE_TO_POINT1 = 1; +float STAGE_AT_POINT1 = 2; +float STAGE_TO_POINT2 = 3; +float STAGE_AT_POINT2 = 4; +float STAGE_FIRING = 5; + +void() ending_for_coop = +{ + intermission_exittime = time + 10000000; // never allow exit + intermission_running = 1; + + self.model = ""; + self.yaw_speed = 20; + self.view_ofs = '0 0 0'; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.modelindex = 0; + setorigin(self, self.origin + '0 0 48'); + + WriteByte(MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "You have destroyed Quake's\nTemporal Teleporter. His assault\non Time has been defeated."); + + ending_remove_stuff(); + + theMachine.think = time_crash_think; + theMachine.nextthink = time + 0.1; +}; + +// ------------------------------------------------ +// Camera and control functions +// ------------------------------------------------ + +void() xpackEnding = +{ + entity cameraview; + + if(coop) + { + ending_for_coop(); + return; + } + + intermission_exittime = time + 10000000; // never allow exit + intermission_running = 1; + + WriteByte(MSG_ALL, SVC_CUTSCENE); + WriteString (MSG_ALL, ""); + + cameraview = find(world, targetname, "cameraview"); + if(cameraview == world) + { + ending_for_coop(); + return; + } + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + spawn_actor(self); + move_camera(self); +}; + +void() track_camera = +{ + vector cameraAngle; + + cameraAngle = theActor.origin - self.origin; + cameraAngle_z = 0 - cameraAngle_z; + self.angles = vectoangles (cameraAngle); + self.v_angle = self.angles; + + self.think = track_camera; + self.nextthink = time + 0.1; +}; + +void(entity playerEnt) move_camera = +{ + entity cameraPoint; + vector cameraAngle; + + cameraPoint = find(world, targetname, "cameraview"); + if(cameraPoint == world) + objerror ("Could not find camerapoint!"); + + self.model = ""; + self.yaw_speed = 20; + self.view_ofs = '0 0 0'; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.modelindex = 0; + setorigin(self, cameraPoint.origin); + + cameraAngle = theActor.origin - self.origin; + self.angles = vectoangles (cameraAngle); + self.v_angle = self.angles; + + self.think = track_camera; + self.nextthink = time + 0.05; +}; + +void() ending_remove_stuff = +{ + entity curEnt; + + curEnt = find(world, classname, "ltrail_start"); + while(curEnt) + { + remove(curEnt); + curEnt = find(world, classname, "ltrail_start"); + } + + curEnt = find(world, classname, "item_time_core"); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, curEnt.origin); + WriteByte(MSG_BROADCAST, 230); + WriteByte(MSG_BROADCAST, 5); + + curEnt.think = SUB_Remove; + curEnt.nextthink = time + 0.1; +}; + +// ------------------------------------------------ +// actor code +// ------------------------------------------------ +void() actor_run = +{ + vector dist; + entity pointOne; + + if(pointcontents(self.origin) == CONTENT_LAVA) + { + pointOne = find(world, targetname, "point1"); + if(pointOne != world) + setorigin(self, pointOne.origin); + } + + if(self.goalentity.targetname == "endpoint1") + { + actorStage = STAGE_AT_POINT1; + self.think = actor_control; + self.nextthink = time + 0.1; + return; + } + if(self.goalentity.targetname == "endpoint2") + { + actorStage = STAGE_AT_POINT2; + self.think = actor_control; + self.nextthink = time + 0.1; + return; + } + + self.frame = self.frame + 1; + if(self.frame > 11) + self.frame = 6; + + dist = self.goalentity.origin - self.origin; +// self.ideal_yaw = vectoyaw (dist); +// ChangeYaw(); + + movetogoal (15); + self.think = actor_run; + self.nextthink = time + 0.1; +}; + +void() actor_fire1 =[$rockatt1, actor_fire2 ] + { + self.goalentity = theMachine; + theMachine.th_pain = time_crash_pain; + theMachine.th_die = time_crash_die; + theMachine.health = 1; + + self.angles = vectoangles (self.goalentity.origin - self.origin); + self.v_angle = self.angles; + self.v_angle_x = 0 - self.angles_x; + self.effects = EF_MUZZLEFLASH; + W_FireRocket(cVR_MainHand); // TODO VR: (P2) wrong, this shouldn't be from player..? + + // start the end text + WriteByte(MSG_ALL, SVC_FINALE); + + WriteString (MSG_ALL, "\nFinally, Quake's Temporal Teleporter\nyields to your assault. A high\npitched scream emits from the\ndevastated device as stressed steel\nblasts outward to rock the cavern.\nThe machine is devoured by molten lava.\n\nThe ground shudders as reality shifts\nback to its predestined path.\n\nYou run to enter the charged time pod,\nscrambling in as the chamber closes.\nYour consciousness fades as you realize\nyou have halted Quake's plans for...\n\nThe Dissolution of Eternity."); + }; +void() actor_fire2 =[$rockatt2, actor_fire3 ] + {self.v_angle_x = 0; self.angles_x = 0; self.nextthink=time+0.15;}; +void() actor_fire3 =[$rockatt3, actor_fire4 ] {self.nextthink=time+0.15;}; +void() actor_fire4 =[$rockatt4, actor_fire5 ] {self.nextthink=time+0.15;}; +void() actor_fire5 =[$rockatt5, actor_fire6 ] + { + self.nextthink=time+0.15; + ending_remove_stuff(); + if(theMachine.health > 0) + { + theMachine.think = time_crash_think; + theMachine.nextthink = time + 0.1; + } + }; +void() actor_fire6 =[$rockatt6, actor_fire7 ] + { self.effects=0;self.nextthink=time+0.15;}; +void() actor_fire7 =[$stand1, actor_fire8 ] {self.nextthink=time+0.15;}; +void() actor_fire8 =[$stand2, actor_fire9 ] {self.nextthink=time+0.15;}; +void() actor_fire9 =[$stand3, actor_fire10 ] {self.nextthink=time+0.15;}; +void() actor_fire10 =[$stand4, actor_fire11 ] {self.nextthink=time+0.15;}; +void() actor_fire11 =[$stand5, actor_fire12 ] {self.nextthink=time+0.15;}; +void() actor_fire12 =[$stand1, actor_fire13 ] {self.nextthink=time+0.15;}; +void() actor_fire13 =[$stand2, actor_fire14 ] {self.nextthink=time+0.15;}; +void() actor_fire14 =[$stand3, actor_fire15 ] {self.nextthink=time+0.15;}; +void() actor_fire15 =[$stand4, actor_fire16 ] {self.nextthink=time+0.15;}; +void() actor_fire16 =[$stand5, actor_fire17 ] {self.nextthink=time+0.15;}; +void() actor_fire17 =[$stand1, actor_fire18 ] {self.nextthink=time+0.15;}; +void() actor_fire18 =[$stand2, actor_fire19 ] {self.nextthink=time+0.15;}; +void() actor_fire19 =[$stand3, actor_fire20 ] {self.nextthink=time+0.15;}; +void() actor_fire20 =[$stand4, actor_fire21 ] {self.nextthink=time+0.15;}; +void() actor_fire21 =[$stand5, actor_control ] + { + self.nextthink=time+0.15; + actorStage = STAGE_TO_POINT2; + }; + +void() actor_teleport = +{ + spawn_tfog(self.origin); + self.model = string_null; + self.think = SUB_Null; + self.nextthink = time + 999999; +}; + +void() actor_control = +{ + if(actorStage == STAGE_START) + { + self.target = "point1"; + self.movetarget = find(world, targetname, self.target); + self.goalentity = self.movetarget; + if(self.goalentity == world) + objerror ("End Sequence point1 placing screwed up!"); + self.frame = 6; + self.think = actor_run; + self.nextthink = time + 0.1; + actorStage = STAGE_TO_POINT1; + } + else if(actorStage == STAGE_AT_POINT1) + { + self.target = "machine"; + self.movetarget = find(world, targetname, self.target); + self.goalentity = self.movetarget; + if(self.goalentity == world) + objerror ("End Sequence machine placing screwed up!"); + actorStage = STAGE_FIRING; + self.think = actor_fire1; + self.nextthink = time + 0.1; + } + else if(actorStage == STAGE_AT_POINT2) + { + self.frame = $stand1; + self.think = actor_teleport; + self.nextthink = time + 2; + } + else if(actorStage == STAGE_TO_POINT2) + { + self.target = "timepod"; + SUB_UseTargets(); + + self.target = "point2"; + self.movetarget = find(world, targetname, self.target); + self.goalentity = self.movetarget; + if(self.goalentity == world) + objerror ("End Sequence point2 placing screwed up!"); + self.frame = 6; + self.think = actor_run; + self.nextthink = time + 0.1; + } +}; + +// ============== +// player actor spawn function +// ============== +void(entity thePlayer) spawn_actor = +{ + entity pointOne; + + theActor = spawn(); + theActor.owner = self; + theActor.classname = "actor"; + theActor.health = 100; + theActor.solid = SOLID_SLIDEBOX; + theActor.movetype = MOVETYPE_STEP; + theActor.frame = self.frame; + setmodel(theActor, "progs/player.mdl"); + setorigin(theActor, self.origin); + setsize(theActor, VEC_HULL_MIN, VEC_HULL_MAX); + theActor.view_ofs = '0 0 22'; + theActor.angles = self.angles; + theActor.ideal_yaw = theActor.angles * '0 1 0'; + if(!theActor.yaw_speed) + theActor.yaw_speed = 20; + theActor.view_ofs = '0 0 25'; + theActor.flags = theActor.flags | FL_MONSTER; + actorStage = STAGE_START; + + if(pointcontents(theActor.origin) == CONTENT_LAVA) + { + pointOne = find(world, targetname, "point1"); + if(pointOne != world) + setorigin(theActor, pointOne.origin); + } + + theActor.think = actor_control; + theActor.nextthink = time + 0.1; +}; + diff --git a/QC/rogue_invis_sw.qc b/QC/rogue_invis_sw.qc new file mode 100644 index 00000000..15b06ff4 --- /dev/null +++ b/QC/rogue_invis_sw.qc @@ -0,0 +1,187 @@ +/* +============================================================================== + +SWORD + +============================================================================== +*/ + +$cd /qwork/xpack/models/sword +$origin 0 0 24 +$base base +$skin badass3 + +$frame stand1 +//$stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8 + +//frame runc1 runc2 runc3 runc4 runc5 runc6 + +//$frame runattack1 runattack2 runattack3 runattack4 runattack5 +//$frame runattack6 runattack7 runattack8 runattack9 runattack10 +//$frame runattack11 + +//$frame pain1 pain2 pain3 + +//$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 +//$frame painb10 painb11 + +//frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 +//frame attack8 attack9 attack10 attack11 + +$frame attackb1 attackb2 attackb3 attackb4 attackb5 +$frame attackb6 attackb7 attackb8 attackb9 attackb10 + +//$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +//$frame walk10 walk11 walk12 walk13 walk14 + +//$frame kneel1 kneel2 kneel3 kneel4 kneel5 + +//$frame standing2 standing3 standing4 standing5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 + +void() sword_stand1 =[ $stand1, sword_stand1 ] {ai_stand();}; + +/* +void() sword_walk1 =[ $walk1, sword_walk2 ] {ai_walk(4);}; +void() sword_walk2 =[ $walk2, sword_walk3 ] {ai_walk(4);}; +void() sword_walk3 =[ $walk3, sword_walk4 ] {ai_walk(4);}; +void() sword_walk4 =[ $walk4, sword_walk5 ] {ai_walk(4);}; +void() sword_walk5 =[ $walk5, sword_walk6 ] {ai_walk(4);}; +void() sword_walk6 =[ $walk6, sword_walk7 ] {ai_walk(4);}; +void() sword_walk7 =[ $walk7, sword_walk8 ] {ai_walk(4);}; +void() sword_walk8 =[ $walk8, sword_walk9 ] {ai_walk(4);}; +void() sword_walk9 =[ $walk9, sword_walk10 ] {ai_walk(4);}; +void() sword_walk10 =[ $walk10, sword_walk11 ] {ai_walk(4);}; +void() sword_walk11 =[ $walk11, sword_walk12 ] {ai_walk(4);}; +void() sword_walk12 =[ $walk12, sword_walk13 ] {ai_walk(4);}; +void() sword_walk13 =[ $walk13, sword_walk14 ] {ai_walk(4);}; +void() sword_walk14 =[ $walk14, sword_walk1 ] {ai_walk(4);}; +*/ + +void() sword_run1 =[ $runb1, sword_run2 ] + {self.effects = EF_DIMLIGHT; ai_run(14);}; +void() sword_run2 =[ $runb2, sword_run3 ] {ai_run(14);}; +void() sword_run3 =[ $runb3, sword_run4 ] {ai_run(14);}; +void() sword_run4 =[ $runb4, sword_run5 ] {ai_run(14);}; +void() sword_run5 =[ $runb5, sword_run6 ] {ai_run(14);}; +void() sword_run6 =[ $runb6, sword_run7 ] {ai_run(14);}; +void() sword_run7 =[ $runb7, sword_run8 ] {ai_run(14);}; +void() sword_run8 =[ $runb8, sword_run1 ] {ai_run(14);}; + +void() sword_atk1 =[ $attackb1, sword_atk2 ] + {sound(self,0,"knight/sword1.wav", 1, 1);ai_charge(14);}; +void() sword_atk2 =[ $attackb2, sword_atk3 ] {ai_charge(14);}; +void() sword_atk3 =[ $attackb3, sword_atk4 ] {ai_charge(14);}; +void() sword_atk4 =[ $attackb4, sword_atk5 ] {ai_charge(14);}; +void() sword_atk5 =[ $attackb5, sword_atk6 ] {ai_melee();}; +void() sword_atk6 =[ $attackb6, sword_atk7 ] {ai_melee();}; +void() sword_atk7 =[ $attackb7, sword_atk8 ] {ai_melee();}; +void() sword_atk8 =[ $attackb8, sword_atk9 ] {ai_charge(14);}; +void() sword_atk9 =[ $attackb9, sword_atk10] {ai_charge(14);}; +void() sword_atk10=[ $attackb10, sword_run1 ] {ai_charge(14);}; + +//=========================================================================== + +void() sword_die1 =[ $death1, sword_die2 ] {}; +void() sword_die2 =[ $death2, sword_die3 ] {}; +void() sword_die3 =[ $death3, sword_die4 ] + {self.solid = SOLID_NOT;}; +void() sword_die4 =[ $death4, sword_die5 ] {}; +void() sword_die5 =[ $death5, sword_die6 ] {}; +void() sword_die6 =[ $death6, sword_die7 ] {}; +void() sword_die7 =[ $death7, sword_die8 ] + { sound(self, 1, "player/axhit2.wav", 0.5, ATTN_NORM);}; +void() sword_die8 =[ $death8, sword_die9 ] {}; +void() sword_die9 =[ $death9, sword_die10] {}; +void() sword_die10=[ $death10, sword_die10] {}; + +void() sword_dieb1 =[ $deathb1, sword_dieb2 ] {}; +void() sword_dieb2 =[ $deathb2, sword_dieb3 ] {}; +void() sword_dieb3 =[ $deathb3, sword_dieb4 ] + {self.solid = SOLID_NOT;}; +void() sword_dieb4 =[ $deathb4, sword_dieb5 ] {}; +void() sword_dieb5 =[ $deathb5, sword_dieb6 ] {}; +void() sword_dieb6 =[ $deathb6, sword_dieb7 ] {}; +void() sword_dieb7 =[ $deathb7, sword_dieb8 ] + { sound(self, 1, "player/axhit2.wav", 0.5, ATTN_NORM); }; +void() sword_dieb8 =[ $deathb8, sword_dieb9 ] {}; +void() sword_dieb9 =[ $deathb9, sword_dieb10] {}; +void() sword_dieb10 = [ $deathb10, sword_dieb11] {}; +void() sword_dieb11 = [ $deathb11, sword_dieb11] {}; + +void() sword_die = +{ +// regular death + self.effects=0; + if(random() < 0.5) + sword_die1(); + else + sword_dieb1(); +}; + +void() sword_pause = +{ + self.th_run = sword_run1; + self.think = sword_run1; + self.nextthink = time + self.delay; + self.delay = 0; +}; + +void(entity attacker, float damage) sword_pain = +{ + self.th_run = sword_run1; + self.think = sword_run1; + self.nextthink = time + 0.1; + self.delay = 0; + self.th_pain = SUB_NullPain; +}; + +/*QUAKED monster_sword (1 0 0) (-16 -16 -24) (16 16 40) Ambush +The Invisible Swordsman + +delay - seconds after first sighting before it attacks (default 10) +*/ +void() monster_sword = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model("progs/sword.mdl"); + + precache_sound("knight/sword1.wav"); + precache_sound("knight/ksight.wav"); + precache_sound("player/axhit2.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/sword.mdl"); + + setsize(self, '-16 -16 -24', '16 16 40'); + self.health = 150; // 75; + + if(!self.delay) + self.delay = 10; + + self.th_stand = sword_stand1; +// self.th_walk = sword_walk1; + self.th_walk = sword_stand1; + self.th_run = sword_pause; + self.th_melee = sword_atk1; + self.th_die = sword_die; + self.th_pain = sword_pain; + + walkmonster_start(); +}; diff --git a/QC/rogue_lava_wpn.qc b/QC/rogue_lava_wpn.qc new file mode 100644 index 00000000..3f3e97bc --- /dev/null +++ b/QC/rogue_lava_wpn.qc @@ -0,0 +1,226 @@ +// LAVA Weapon Routines + +/* +=============== +launch_lava_spike + +Used for both the player and the ogre +=============== +*/ +entity(vector org, vector dir) launch_lava_spike = +{ + entity newmis; + + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + + newmis.angles = vectoangles(dir); + + newmis.touch = lavaspike_touch; + newmis.classname = "lava_spike"; + + newmis.think = SUB_Remove; + newmis.nextthink = time + 6; + + newmis.effects = newmis.effects | EF_VERYDIMLIGHT; + newmis.effects = newmis.effects | EF_LAVATRAIL; + + setmodel(newmis, "progs/lspike.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin(newmis, org); + + newmis.velocity = dir * 1750; + + return newmis; +}; + +void(float xHand) W_FireSuperLavaSpikes = +{ + vector dir; + entity newmis; + + sound(self, VRGetGunChannel(xHand), "weapons/spike2.wav", 1, ATTN_NORM); + VRSetAttackFinished(xHand, time + 0.2); + delAmmoAndUpdateCounter(xHand, AID_LAVA_NAILS, 2); + + makeforward(VRGetWeaponFireRot(xHand)); + dir = v_forward; + + newmis = launch_lava_spike(VRGetMuzzlePos(xHand), dir); + newmis.velocity += vrProjectileVelocity(xHand, 1.0); + newmis.touch = superlavaspike_touch; + + setmodel(newmis, "progs/lspike.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + + self.punchangle_x = -2; + + VRGunHaptic(xHand, 0.05, 150, 1.0); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); +}; + +void(float xHand, float ox) W_FireLavaSpikes = +{ + vector dir; + entity newmis; + + makevectors(VRGetWeaponFireRot(xHand)); + + if(self.ammo_lava_nails >= 2 && VRGetWeapon(xHand) == WID_SUPER_NAILGUN) + { + W_FireSuperLavaSpikes(xHand); + return; + } + + if(self.ammo_lava_nails < 1) + { + return; + } + + sound(self, VRGetGunChannel(xHand), "weapons/rocket1i.wav", 1, ATTN_NORM); + VRSetAttackFinished(xHand, time + 0.2); + delAmmoAndUpdateCounter(xHand, AID_LAVA_NAILS, 1); + + dir = v_forward; + newmis = launch_lava_spike(VRGetMuzzlePos(xHand) + v_right*ox, dir); + newmis.velocity += vrProjectileVelocity(xHand, 1.0); + + self.punchangle_x = -2; + + VRGunHaptic(xHand, 0.05, 150, 1.0); + particle2(VRGetMuzzlePos(xHand) + v_right*ox, '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); +}; + +// =============== Lava Spike Touch Routines + +void() lavaspike_touch = +{ + // float old_armortype; + // float old_armorvalue; + // float old_armormask; + + if(other == self.owner) + return; + + if(other.solid == SOLID_TRIGGER) + return; // trigger field, do nothing + + if(pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + makeforward_mdl(self.angles); + traceline(self.origin - v_forward * 8, self.origin + v_forward * 8, FALSE, self); + + // hit something that bleeds + if(other.takedamage) + { + spawn_touchblood (9); + if(other.classname == "player") + { + // old_armortype = other.armortype; + // old_armorvalue = other.armorvalue; + // old_armormask = other.items2 & (IT2_ARMOR1|IT2_ARMOR2|IT2_ARMOR3); + // other.armortype = 0; + // other.armorvalue = 0; + + // TODO VR: (P1) pass a flag to `T_Damage` to ignore armor + T_Damage(other, self, self.owner, 9); + + // other.armortype = old_armortype; + // other.armorvalue = old_armorvalue; + // other.items2 = other.items2 | old_armormask; + } + else // is a monster + { + if(other.classname != "monster_lava_man") + { + T_Damage(other, self, self.owner, 15); + } + } + } + else + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + + if(self.classname == "wizspike") + WriteByte(MSG_BROADCAST, TE_WIZSPIKE); + else if(self.classname == "knightspike") + WriteByte(MSG_BROADCAST, TE_KNIGHTSPIKE); + else + { + spike_bullethole(); + WriteByte(MSG_BROADCAST, TE_SPIKE); + } + WriteVec3(MSG_BROADCAST, self.origin); + } + + remove(self); + +}; + +void() superlavaspike_touch = +{ + float old_armortype; + //float old_armorvalue; + + if(other == self.owner) + return; + + if(other.solid == SOLID_TRIGGER) + return; // trigger field, do nothing + + if(pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + makeforward_mdl(self.angles); + traceline(self.origin - v_forward * 8, self.origin + v_forward * 8, FALSE, self); + + // hit something that bleeds + if(other.takedamage) + { + spawn_touchblood (18); + + // halve the effectiveness of the armor for players.. + if(other.classname == "player") + { + // save the old armor values... + old_armortype = other.armortype; +// old_armorvalue = other.armorvalue; + other.armortype = other.armortype * 0.5; +// other.armorvalue = 0; + T_Damage(other, self, self.owner, 18); + + // if the damage didn't wipe out the armor, armortype + if(other.armortype != 0) + { + other.armortype = old_armortype; +// other.armorvalue = old_armorvalue; + } + } + else // is a monster, do 50% more damage + { + if(other.classname != "monster_lava_man") + { + T_Damage(other, self, self.owner, 30); + } + } + } + else + { + spike_bullethole(); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_SUPERSPIKE); + WriteVec3(MSG_BROADCAST, self.origin); + } + + remove(self); + +}; diff --git a/QC/rogue_lavaman.qc b/QC/rogue_lavaman.qc new file mode 100644 index 00000000..a5c0e4c5 --- /dev/null +++ b/QC/rogue_lavaman.qc @@ -0,0 +1,474 @@ +/* +============================================================================== + +LavaMan (Smaller version of Boss E1M7) + +============================================================================== +*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +//$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +//$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +//$frame shockc9 shockc10 + +/* +=========== +LavaManCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() LavaManCheckAttack = +{ + vector spot1; + entity targ; + + ai_face(); + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + '0 0 64'; + + traceline (spot1, targ.origin, FALSE, self); + + if(trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + if(trace_ent != targ) + return FALSE; // don't have a clear shot + +// missile attack + if(time < self.attack_finished) + return FALSE; + + self.th_missile (); + SUB_AttackFinished (1 + random()); + return TRUE; +}; + +// ============ +// ============ +void() lavaman_hunt = +{ + entity possibleEnemy; + vector viewPoint; + +// go for another player if multi player + if(self.enemy.health <= 0) + { + viewPoint = self.origin + '0 0 96'; + possibleEnemy = find(self.enemy, classname, "player"); + traceline (viewPoint, possibleEnemy.origin, TRUE, world); + if(trace_fraction == 1) + self.enemy = possibleEnemy; + } + if(self.enemy) + { + ai_face(); + self.movetarget = self.enemy; + self.goalentity = self.enemy; + } +}; +/* +void(float dist) lavaman_walk = +{ + lavaman_hunt(); + ai_walk(dist); +}; +*/ + +void() lavaman_rise1 =[ $rise1, lavaman_rise2 ] + { sound(self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM); +}; +void() lavaman_rise2 =[ $rise2, lavaman_rise3 ] + { +sound(self, CHAN_VOICE, "boss1/sight1.wav", 1, ATTN_NORM); }; +void() lavaman_rise3 =[ $rise3, lavaman_rise4 ] {}; +void() lavaman_rise4 =[ $rise4, lavaman_rise5 ] {}; +void() lavaman_rise5 =[ $rise5, lavaman_rise6 ] {}; +void() lavaman_rise6 =[ $rise6, lavaman_rise7 ] {}; +void() lavaman_rise7 =[ $rise7, lavaman_rise8 ] {}; +void() lavaman_rise8 =[ $rise8, lavaman_rise9 ] {}; +void() lavaman_rise9 =[ $rise9, lavaman_rise10 ] {}; +void() lavaman_rise10 =[ $rise10, lavaman_rise11 ] {}; +void() lavaman_rise11 =[ $rise11, lavaman_rise12 ] {}; +void() lavaman_rise12 =[ $rise12, lavaman_rise13 ] {}; +void() lavaman_rise13 =[ $rise13, lavaman_rise14 ] {}; +void() lavaman_rise14 =[ $rise14, lavaman_rise15 ] {}; +void() lavaman_rise15 =[ $rise15, lavaman_rise16 ] {}; +void() lavaman_rise16 =[ $rise16, lavaman_rise17 ] {}; +void() lavaman_rise17 =[ $rise17, lavaman_fire1 ] {}; + +// ============ +// ============ +void() lavaman_stand = +{ + if(self.enemy) + LavaManCheckAttack(); + else + lavaman_hunt(); + + ai_stand (); +}; + +void() lavaman_idle1 =[ $walk1, lavaman_idle2 ] +{ + if(random() < 0.2) + sound(self, CHAN_VOICE, "boss1/sight1.wav", 1, ATTN_NORM); +// look for other players +}; +void() lavaman_idle2 =[ $walk2, lavaman_idle3 ] {lavaman_stand();}; +void() lavaman_idle3 =[ $walk3, lavaman_idle4 ] {lavaman_stand();}; +void() lavaman_idle4 =[ $walk4, lavaman_idle5 ] {lavaman_stand();}; +void() lavaman_idle5 =[ $walk5, lavaman_idle6 ] {lavaman_stand();}; +void() lavaman_idle6 =[ $walk4, lavaman_idle7 ] {lavaman_stand();}; +void() lavaman_idle7 =[ $walk3, lavaman_idle8 ] {lavaman_stand();}; +void() lavaman_idle8 =[ $walk2, lavaman_idle9 ] {lavaman_stand();}; +void() lavaman_idle9 =[ $walk1, lavaman_idle1 ] {lavaman_stand();}; + +// ============ +// ============ +void() lavaman_walk = +{ + if(self.enemy) + LavaManCheckAttack(); + else + lavaman_hunt(); + ai_walk (2); +}; + +void() lavaman_walk1 =[ $walk1, lavaman_walk2 ] {lavaman_walk();}; +void() lavaman_walk2 =[ $walk2, lavaman_walk3 ] {lavaman_walk();}; +void() lavaman_walk3 =[ $walk3, lavaman_walk4 ] {lavaman_walk();}; +void() lavaman_walk4 =[ $walk4, lavaman_walk5 ] {lavaman_walk();}; +void() lavaman_walk5 =[ $walk5, lavaman_walk6 ] {lavaman_walk();}; +void() lavaman_walk6 =[ $walk6, lavaman_walk7 ] {lavaman_walk();}; +void() lavaman_walk7 =[ $walk7, lavaman_walk8 ] {lavaman_walk();}; +void() lavaman_walk8 =[ $walk8, lavaman_walk9 ] {lavaman_walk();}; +void() lavaman_walk9 =[ $walk9, lavaman_walk10 ] {lavaman_walk();}; +void() lavaman_walk10 =[ $walk10, lavaman_walk11 ] {lavaman_walk();}; +void() lavaman_walk11 =[ $walk11, lavaman_walk12 ] {lavaman_walk();}; +void() lavaman_walk12 =[ $walk12, lavaman_walk13 ] {lavaman_walk();}; +void() lavaman_walk13 =[ $walk13, lavaman_walk14 ] {lavaman_walk();}; +void() lavaman_walk14 =[ $walk14, lavaman_walk15 ] {lavaman_walk();}; +void() lavaman_walk15 =[ $walk15, lavaman_walk16 ] {lavaman_walk();}; +void() lavaman_walk16 =[ $walk16, lavaman_walk17 ] {lavaman_walk();}; +void() lavaman_walk17 =[ $walk17, lavaman_walk18 ] {lavaman_walk();}; +void() lavaman_walk18 =[ $walk18, lavaman_walk19 ] {lavaman_walk();}; +void() lavaman_walk19 =[ $walk19, lavaman_walk20 ] {lavaman_walk();}; +void() lavaman_walk20 =[ $walk20, lavaman_walk21 ] {lavaman_walk();}; +void() lavaman_walk21 =[ $walk21, lavaman_walk22 ] {lavaman_walk();}; +void() lavaman_walk22 =[ $walk22, lavaman_walk23 ] {lavaman_walk();}; +void() lavaman_walk23 =[ $walk23, lavaman_walk24 ] {lavaman_walk();}; +void() lavaman_walk24 =[ $walk24, lavaman_walk25 ] {lavaman_walk();}; +void() lavaman_walk25 =[ $walk25, lavaman_walk26 ] {lavaman_walk();}; +void() lavaman_walk26 =[ $walk26, lavaman_walk27 ] {lavaman_walk();}; +void() lavaman_walk27 =[ $walk27, lavaman_walk28 ] {lavaman_walk();}; +void() lavaman_walk28 =[ $walk28, lavaman_walk29 ] {lavaman_walk();}; +void() lavaman_walk29 =[ $walk29, lavaman_walk30 ] {lavaman_walk();}; +void() lavaman_walk30 =[ $walk30, lavaman_walk31 ] {lavaman_walk();}; +void() lavaman_walk31 =[ $walk31, lavaman_walk1 ] {}; + +void() lavaman_run = +{ + if(self.enemy) + LavaManCheckAttack(); + else + lavaman_hunt(); + ai_run (2); +}; + +void() lavaman_run1 =[ $walk1, lavaman_run2 ] {lavaman_run();}; +void() lavaman_run2 =[ $walk2, lavaman_run3 ] {lavaman_run();}; +void() lavaman_run3 =[ $walk3, lavaman_run4 ] {lavaman_run();}; +void() lavaman_run4 =[ $walk4, lavaman_run5 ] {lavaman_run();}; +void() lavaman_run5 =[ $walk5, lavaman_run6 ] {lavaman_run();}; +void() lavaman_run6 =[ $walk6, lavaman_run7 ] {lavaman_run();}; +void() lavaman_run7 =[ $walk7, lavaman_run8 ] {lavaman_run();}; +void() lavaman_run8 =[ $walk8, lavaman_run9 ] {lavaman_run();}; +void() lavaman_run9 =[ $walk9, lavaman_run10 ] {lavaman_run();}; +void() lavaman_run10 =[ $walk10, lavaman_run11 ] {lavaman_run ();}; +void() lavaman_run11 =[ $walk11, lavaman_run12 ] {lavaman_run ();}; +void() lavaman_run12 =[ $walk12, lavaman_run13 ] {lavaman_run ();}; +void() lavaman_run13 =[ $walk13, lavaman_run14 ] {lavaman_run ();}; +void() lavaman_run14 =[ $walk14, lavaman_run15 ] {lavaman_run ();}; +void() lavaman_run15 =[ $walk15, lavaman_run16 ] {lavaman_run ();}; +void() lavaman_run16 =[ $walk16, lavaman_run17 ] {lavaman_run ();}; +void() lavaman_run17 =[ $walk17, lavaman_run18 ] {lavaman_run ();}; +void() lavaman_run18 =[ $walk18, lavaman_run19 ] {lavaman_run ();}; +void() lavaman_run19 =[ $walk19, lavaman_run20 ] {lavaman_run ();}; +void() lavaman_run20 =[ $walk20, lavaman_run21 ] {lavaman_run ();}; +void() lavaman_run21 =[ $walk21, lavaman_run22 ] {lavaman_run ();}; +void() lavaman_run22 =[ $walk22, lavaman_run23 ] {lavaman_run ();}; +void() lavaman_run23 =[ $walk23, lavaman_run24 ] {lavaman_run ();}; +void() lavaman_run24 =[ $walk24, lavaman_run25 ] {lavaman_run ();}; +void() lavaman_run25 =[ $walk25, lavaman_run26 ] {lavaman_run ();}; +void() lavaman_run26 =[ $walk26, lavaman_run27 ] {lavaman_run ();}; +void() lavaman_run27 =[ $walk27, lavaman_run28 ] {lavaman_run ();}; +void() lavaman_run28 =[ $walk28, lavaman_run29 ] {lavaman_run ();}; +void() lavaman_run29 =[ $walk29, lavaman_run30 ] {lavaman_run ();}; +void() lavaman_run30 =[ $walk30, lavaman_run31 ] {lavaman_run ();}; +void() lavaman_run31 =[ $walk31, lavaman_run1 ] {}; + +void() lavaman_fire1 =[ $attack1, lavaman_fire2 ] { ai_face();}; +void() lavaman_fire2 =[ $attack2, lavaman_fire3 ] {ai_charge(1);}; +void() lavaman_fire3 =[ $attack3, lavaman_fire4 ] { ai_face();}; +void() lavaman_fire4 =[ $attack4, lavaman_fire5 ] {ai_face();}; +void() lavaman_fire5 =[ $attack5, lavaman_fire6 ] {ai_charge(1);}; +void() lavaman_fire6 =[ $attack6, lavaman_fire7 ] {ai_face();}; +void() lavaman_fire7 =[ $attack7, lavaman_fire8 ] {lavaman_missile(1);}; +void() lavaman_fire8 =[ $attack8, lavaman_fire9 ] {ai_face();}; +void() lavaman_fire9 =[ $attack9, lavaman_fire10 ] {ai_face();}; +void() lavaman_fire10 =[ $attack10, lavaman_fire11 ] {ai_charge(1);}; +void() lavaman_fire11 =[ $attack11, lavaman_fire12 ] {ai_face();}; +void() lavaman_fire12 =[ $attack12, lavaman_fire13 ] {ai_charge(1);}; +void() lavaman_fire13 =[ $attack13, lavaman_fire14 ] {ai_face();}; +void() lavaman_fire14 =[ $attack14, lavaman_fire15 ] {ai_face();}; +void() lavaman_fire15 =[ $attack15, lavaman_fire16 ] {ai_charge(1);}; +void() lavaman_fire16 =[ $attack16, lavaman_fire17 ] {ai_charge(1);}; +void() lavaman_fire17 =[ $attack17, lavaman_fire18 ] {ai_face();}; +void() lavaman_fire18 =[ $attack18, lavaman_fire19 ] {lavaman_missile(2);}; +void() lavaman_fire19 =[ $attack19, lavaman_fire20 ] {ai_face();}; +void() lavaman_fire20 =[ $attack20, lavaman_fire21 ] {ai_face();}; +void() lavaman_fire21 =[ $attack21, lavaman_fire22 ] {ai_face();}; +void() lavaman_fire22 =[ $attack22, lavaman_fire23 ] {ai_charge(1);}; +void() lavaman_fire23 =[ $attack23, lavaman_run1 ] {}; + +void() lavaman_shocka1 =[ $shocka1, lavaman_shocka2 ] {}; +void() lavaman_shocka2 =[ $shocka2, lavaman_shocka3 ] {}; +void() lavaman_shocka3 =[ $shocka3, lavaman_shocka4 ] {}; +void() lavaman_shocka4 =[ $shocka4, lavaman_shocka5 ] {}; +void() lavaman_shocka5 =[ $shocka5, lavaman_shocka6 ] {}; +void() lavaman_shocka6 =[ $shocka6, lavaman_shocka7 ] {}; +void() lavaman_shocka7 =[ $shocka7, lavaman_shocka8 ] {}; +void() lavaman_shocka8 =[ $shocka8, lavaman_shocka9 ] {}; +void() lavaman_shocka9 =[ $shocka9, lavaman_shocka10 ] {}; +void() lavaman_shocka10 =[ $shocka10, lavaman_run1 ] {}; + +void(entity attacker, float damage) lavaman_pain = +{ + if(self.pain_finished > time) + return; + + if(random() < 0.05) + { + self.pain_finished = time + 2; + lavaman_shocka1(); + } +}; + +void() lavaman_death1 = [$death1, lavaman_death2] + { +sound(self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM); +}; +void() lavaman_death2 = [$death2, lavaman_death3] {}; +void() lavaman_death3 = [$death3, lavaman_death4] {}; +void() lavaman_death4 = [$death4, lavaman_death5] {}; +void() lavaman_death5 = [$death5, lavaman_death6] {}; +void() lavaman_death6 = [$death6, lavaman_death7] {}; +void() lavaman_death7 = [$death7, lavaman_death8] {}; +void() lavaman_death8 = [$death8, lavaman_death9] {}; +void() lavaman_death9 = [$death9, lavaman_death10] +{ + sound(self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteVec3(MSG_BROADCAST, self.origin); +}; + +void() lavaman_death10 = [$death9, lavaman_death10] +{ + remove(self); +}; + +void() lavaman_touch = +{ + float damg; + + if(other == self.owner) + return; // don't explode on owner + + if(pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + damg = 40; + if(other.health) + { + if(other.classname == "monster_shambler") + damg = damg * 0.5; // mostly immune + T_Damage(other, self, self.owner, damg); + } + + // don't do radius damage to the other, because all the damage + // was done in the impact + T_RadiusDamage(self, self.owner, 40, other); + +// sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + +// Change to an explosion2!!! Ramp in the non-diminishing reds... + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + BecomeExplosion (); +}; + +void(float AttackNumber) lavaman_missile = +{ + entity fireball; + vector org, vec, d; + float t; + + makevectors(self.angles); + + // Right handed throw + if(AttackNumber == 1) + { + org = self.origin + v_forward*40 + v_right*65 + v_up*130; + } + // Left handed throw + else + { + ASSERT(AttackNumber == 2); + org = self.origin + v_forward*40 - v_right*75 + v_up*125; + } + + d = self.enemy.origin; + t = vlen(d - org); + t = t / 380; + if(t > 1.75) + t = 1.75; + if(t < 1) + t = 1; + + vec = normalize(d - org); + + fireball = spawn(); + fireball.owner = self; +// fireball.movetype = MOVETYPE_FLYMISSILE; + fireball.movetype = MOVETYPE_BOUNCE; + fireball.solid = SOLID_BBOX; + fireball.angles = vectoangles(vec); + fireball.touch = lavaman_touch; + fireball.classname = "lavaman_ball"; + setmodel(fireball, "progs/lavaball.mdl"); + setsize(fireball, '0 0 0', '0 0 0'); + setorigin(fireball, org); + +// fireball.velocity = vec * 600 + '0 0 200'; + fireball.velocity = vec * 600 * t; + fireball.velocity_z = fireball.velocity_z + (200 * t); + + fireball.avelocity = '200 100 300'; + fireball.think = SUB_Remove; + fireball.nextthink = time + 6; + + sound(self, CHAN_WEAPON, "boss1/throw.wav", 1, ATTN_NORM); + +// check for dead enemy + if(self.enemy.health <= 0) + lavaman_idle1(); +}; + +void() lavaman_awake = +{ + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_AIM; + self.flags = self.flags | FL_MONSTER; + self.ideal_yaw = self.angles * '0 1 0'; + if(!self.yaw_speed) + self.yaw_speed = 20; + + setmodel(self, "progs/lavaman.mdl"); +// setsize(self, '-64 -64 -12', '64 64 128'); +// setsize(self, '-32 -32 0', '32 32 120'); + setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX); + self.view_ofs = '0 0 48'; + +// self.health = 1500; + + self.health = 1250 + (250 * cvar_hget(cvarh_skill)); + + self.th_stand = lavaman_idle1; + self.th_walk = lavaman_walk1; + self.th_run = lavaman_walk1; + self.th_missile = lavaman_fire1; + self.th_pain = lavaman_pain; + self.th_die = lavaman_death1; + self.th_melee = lavaman_fire1; + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteVec3(MSG_BROADCAST, self.origin); + + if(!VR_ItemUtil_EntHasItem(activator, IID_INVISIBILITY)) + { + if(!(activator.flags & FL_NOTARGET)) + { + if(activator.classname == "player") + self.enemy = activator; + } + } + droptofloor(); + + lavaman_rise1(); +}; + +// (-64 -64 -12) (64 64 128) +/*QUAKED monster_lava_man (1 0 0) (-32 -32 -24) (32 32 64) Ambush Sleeping +*/ +void() monster_lava_man = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model("progs/lavaman.mdl"); + precache_model("progs/lavaball.mdl"); + + precache_sound("weapons/rocket1i.wav"); + precache_sound("boss1/out1.wav"); + precache_sound("boss1/sight1.wav"); + precache_sound("misc/power.wav"); + precache_sound("boss1/throw.wav"); + precache_sound("boss1/pain.wav"); + precache_sound("boss1/death.wav"); + + // HONEY + monster_add_to_counter(); + + // cause the lavaman to rise from the lava when triggered. + if(self.spawnflags & 2) + { + self.use = lavaman_awake; + return; + } + + lavaman_awake(); +}; + diff --git a/QC/rogue_lightnin.qc b/QC/rogue_lightnin.qc new file mode 100644 index 00000000..268b1dce --- /dev/null +++ b/QC/rogue_lightnin.qc @@ -0,0 +1,180 @@ +// lightning trail +// pmack +// sept 96 + +// float ltrailLastUsed; -- now an entity field. + +float LT_TOGGLE = 1; +float LT_ACTIVE = 2; + +void() ltrail_chain = +{ + SUB_UseTargets(); + + self.think = SUB_Null; +}; + +void() ltrail_fire = +{ + entity myTarget; + + if(self.classname != "ltrail_end") + { + sound(self, CHAN_VOICE, "weapons/lhit.wav", 1, ATTN_NORM); + myTarget = find(world, targetname, self.target); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, self.origin); + WriteVec3(MSG_BROADCAST, myTarget.origin); + LightningDamage(self.origin, myTarget.origin, self, self.currentammo); + } + + if(self.items < time) + { + self.think = ltrail_chain; + self.nextthink = time + self.frags; + } + else + { + self.think = ltrail_fire; + self.nextthink = time + 0.05; + } +}; + +void() ltrail_start_fire = +{ + // if it's a toggle ltrail, we ignore triggers from ltrail_end's + // when toggled off. + if(self.spawnflags & LT_TOGGLE) + { + // user is not a lightning trail - change activity state. + if(other.classname != "ltrail_end") + { + if(self.spawnflags & LT_ACTIVE) + // currently active + { + self.spawnflags = self.spawnflags - LT_ACTIVE; + return; + } + else + // not active + { + self.spawnflags = self.spawnflags + LT_ACTIVE; + } + } + // user is lightning trail, but trail has been turned off. + // ignore the message. + else if(!(self.spawnflags & LT_ACTIVE)) + return; + } + + if(self.classname == "ltrail_start") + { + self.items = time + self.weapon; + ltrail_fire(); + self.ltrailLastUsed = time; + } + else if(self.classname == "ltrail_relay") + { + self.items = time + self.weapon; + ltrail_fire(); + } + else + { + self.think = ltrail_chain; + self.nextthink = time + self.frags; + } +}; + +/*QUAKED ltrail_start (0 1 0) (-8 -8 -8) (8 8 8) LT_TOGGLE +Starting point of a lightning trail. +Set currentammo to amount of damage you want the lightning to do. +Default is 25. + +Set frags to amount of time before next item is triggered. +Default is 0.3 seconds. + +Set weapon to amount of time to be firing the lightning. +Default is 0.3 seconds. + +Set the LT_TOGGLE checkbox if you want the lightning shooter to continuously fire until triggered again. +*/ +void() ltrail_start = +{ + self.ltrailLastUsed = time; + + precache_sound("weapons/lhit.wav"); + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_BBOX; + self.use = ltrail_start_fire; + + if(self.currentammo == 0) + self.currentammo = 25; + + if(self.weapon == 0) + self.weapon = 0.3; + + if(self.frags == 0) + self.frags = 0.3; + + if(self.spawnflags & LT_ACTIVE) + { + self.items = time + 99999999; + self.think = ltrail_fire; + self.nextthink = time + 0.1; + } +}; + +/*QUAKED ltrail_relay (0 1 0) (-8 -8 -8) (8 8 8) +Relay point of a lightning trail. +Set currentammo to amount of damage you want the lightning to do. +Default is 25. + +Set frags to amount of time before next item is triggered. +Default is 0.3 seconds. + +Set weapon to amount of time to be firing the lightning. +Default is 0.3 seconds. +*/ +void() ltrail_relay = +{ + precache_sound("weapons/lhit.wav"); + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_BBOX; + self.use = ltrail_start_fire; + + if(self.currentammo == 0) + self.currentammo = 25; + + if(self.weapon == 0) + self.weapon = 0.3; + + if(self.frags == 0) + self.frags = 0.3; +}; + +/*QUAKED ltrail_end (0 1 0) (-8 -8 -8) (8 8 8) +Ending point of a lightning trail. +Does not fire any lightning. + +Set frags to amount of time before next item is triggered. +Default is 0.3 seconds. +*/ +void() ltrail_end = +{ + precache_sound("weapons/lhit.wav"); + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_BBOX; + self.use = ltrail_start_fire; + + if(self.currentammo == 0) + self.currentammo = 25; + + if(self.weapon == 0) + self.weapon = 0.3; + + if(self.frags == 0) + self.frags = 0.3; +}; diff --git a/QC/rogue_morph.qc b/QC/rogue_morph.qc new file mode 100644 index 00000000..03ac724d --- /dev/null +++ b/QC/rogue_morph.qc @@ -0,0 +1,577 @@ +// morph.qc + +$skin aztec +$skin pharoah +$skin roman +$skin florskin + +$frame mfstand1 +//$frame mfup01 mfup02 mfup03 mfup04 mfup05 mfup06 +//$frame mfup07 mfup08 mfup09 mfup10 mfup11 mfup12 + +$frame start01 start02 start03 start04 start05 start06 +$frame start07 start08 start09 start10 start11 start12 +$frame start13 start14 start15 start16 start17 start18 +$frame start19 start20 start21 start22 start23 start24 +$frame start25 start26 start27 start28 start29 start30 start31 + +$frame mfrun01 mfrun02 mfrun03 mfrun04 mfrun05 mfrun06 +$frame mfrun07 mfrun08 mfrun09 mfrun10 mfrun11 + +$frame mfwlk01 mfwlk02 mfwlk03 mfwlk04 mfwlk05 mfwlk06 mfwlk07 mfwlk08 +$frame mfwlk09 mfwlk10 mfwlk11 mfwlk12 mfwlk13 + +$frame mfata01 mfata02 mfata03 mfata04 mfata05 +$frame mfata06 mfata07 mfata08 mfata09 + +$frame mfatb01 mfatb02 mfatb03 mfatb04 mfatb05 mfatb06 +$frame mfatb07 mfatb08 mfatb09 mfatb10 mfatb11 + +$frame mfatc01 mfatc02 mfatc03 mfatc04 mfatc05 mfatc06 +$frame mfatc07 mfatc08 mfatc09 mfatc10 mfatc11 mfatc12 +$frame mfatc13 mfatc14 mfatc15 mfatc16 + +$frame mfknck01 mfknck02 mfknck03 mfknck04 mfknck05 mfknck06 +$frame mfknck07 mfknck08 mfknck09 mfknck10 mfknck11 mfknck12 + +$frame mfpain01 mfpain02 mfpain03 mfpain04 mfpain05 +$frame mfpain06 mfpain07 mfpain08 mfpain09 mfpain10 + +$frame mfpbin01 mfpbin02 mfpbin03 mfpbin04 mfpbin05 +$frame mfpbin06 mfpbin07 + +$frame mfdth01 mfdth02 mfdth03 mfdth04 mfdth05 +$frame mfdth06 mfdth07 mfdth08 mfdth09 mfdth10 +$frame mfdth11 mfdth12 mfdth13 mfdth14 mfdth15 +$frame mfdth16 mfdth17 mfdth18 mfdth19 mfdth20 +$frame mfdth21 + +float MORPH_AZTEC = 2; +float MORPH_EGYPT = 4; +float MORPH_GREEK = 8; + +// ======================== +// standing +// ======================== +void() morph_stand1 = [ $mfstand1, morph_stand1 ] { ai_stand(); }; + +// ======================== +// movement +// ======================== +// 3 2 1 1 0 1 2 3 4 5 4 2 1 0 +// 3 2 1 2 3 4 4 3 2 1 2 3 3 +// 2 4 4 4 3 3 2 2 4 4 3 2 1 +// 4 5 5 4 3 2 2 4 5 4 3 2 2 +void() morph_walk1 = [ $mfwlk01, morph_walk2 ] {ai_walk(3);}; +void() morph_walk2 = [ $mfwlk02, morph_walk3 ] {ai_walk(2);}; +void() morph_walk3 = [ $mfwlk03, morph_walk4 ] {ai_walk(4);}; +void() morph_walk4 = [ $mfwlk04, morph_walk5 ] {ai_walk(5);}; +void() morph_walk5 = [ $mfwlk05, morph_walk6 ] {ai_walk(5);}; +void() morph_walk6 = [ $mfwlk06, morph_walk7 ] {ai_walk(4);}; + //1 +void() morph_walk7 = [ $mfwlk07, morph_walk8 ] {ai_walk(2);}; + //1 +void() morph_walk8 = [ $mfwlk08, morph_walk9 ] {ai_walk(3);}; +void() morph_walk9 = [ $mfwlk09, morph_walk10 ] {ai_walk(4);}; +void() morph_walk10 = [ $mfwlk10, morph_walk11 ] {ai_walk(5);}; +void() morph_walk11 = [ $mfwlk11, morph_walk12 ] {ai_walk(5);}; +void() morph_walk12 = [ $mfwlk12, morph_walk13 ] {ai_walk(4);}; +void() morph_walk13 = [ $mfwlk13, morph_walk1 ] {ai_walk(3);}; + // 1 + +// 8 6 4 10 13 13 11 10 +// 11 15 10 10 8 15 10 8 8 8 8 +// 6 9 13 13 9 6 9 13 15 13 9 +void() morph_run1 = [ $mfrun01, morph_run2 ] { ai_run(7);}; + // 33 +void() morph_run2 = [ $mfrun02, morph_run3 ] { ai_run(11);}; +void() morph_run3 = [ $mfrun03, morph_run4 ] { ai_run(16);}; +void() morph_run4 = [ $mfrun04, morph_run5 ] { ai_run(16);}; + // 36 +void() morph_run5 = [ $mfrun05, morph_run6 ] { ai_run(11);}; +void() morph_run6 = [ $mfrun06, morph_run7 ] { ai_run(7);}; + // 38 +void() morph_run7 = [ $mfrun07, morph_run8 ] { ai_run(11);}; +void() morph_run8 = [ $mfrun08, morph_run9 ] { ai_run(15);}; + // 40 +void() morph_run9 = [ $mfrun09, morph_run10 ] {ai_run(19);}; +void() morph_run10 =[ $mfrun10, morph_run11 ] {ai_run(15);}; +void() morph_run11 =[ $mfrun11, morph_run1 ] { ai_run(11);}; + // 43 + +// ======================== +// new attack code +// ======================== +void() morph_stab2 = +{ + float dist; + float attackDamage; + vector org, dir; + + if(!self.enemy) + return; + if(!CanDamage(self.enemy, self)) + return; + + ai_face(); + + dir = self.enemy.origin - self.origin + self.enemy.view_ofs; + dist = vlen(dir); + dir = normalize(dir); + makevectors(self.angles); + + if(dist <= 90) + { + sound(self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + attackDamage = (random() * 10) + 20; + T_Damage(self.enemy, self, self, attackDamage); + SpawnBlood (self.enemy.origin, v_forward * 150, 14); + } + else + { + self.effects = self.effects | EF_MUZZLEFLASH; + org = self.origin + v_forward * 80 + v_right * 4 + '0 0 4'; + LaunchLaser(org, dir); + if(dist) + { + LaunchLaser(org, (dir + v_right * 0.04)); + LaunchLaser(org, (dir - v_right * 0.04)); + } + else + { + LaunchLaser(org, (dir + v_right * 0.10)); + LaunchLaser(org, (dir - v_right * 0.10)); + } + } +}; + +// ======================== +// hand to hand attack +// ======================== + +void() morph_attack01 = [ $mfatb01, morph_attack02 ] {ai_face();}; +void() morph_attack02 = [ $mfatb02, morph_attack03 ] {ai_face();}; +void() morph_attack03 = [ $mfatb03, morph_attack04 ] {ai_face();}; +void() morph_attack04 = [ $mfatb04, morph_attack05 ] {ai_face();}; +void() morph_attack05 = [ $mfatb05, morph_attack06 ] {ai_face();}; +void() morph_attack06 = [ $mfatb06, morph_attack07 ] {ai_face();}; +void() morph_attack07 = [ $mfatb07, morph_attack08 ] {morph_stab2();}; +void() morph_attack08 = [ $mfatb08, morph_attack09 ] {ai_face();}; +void() morph_attack09 = [ $mfatb09, morph_attack10 ] {ai_face();}; +void() morph_attack10 = [ $mfatb10, morph_attack11 ] {ai_face();}; +void() morph_attack11 = [ $mfatb11, morph_attack12 ] {ai_face();}; +void() morph_attack12 = [ $mfatb01, morph_run1 ] {ai_face();}; + +void() morph_bigattack01 = [ $mfatc01, morph_bigattack02 ] { ai_face(); }; +void() morph_bigattack02 = [ $mfatc02, morph_bigattack03 ] { ai_face(); }; +void() morph_bigattack03 = [ $mfatc03, morph_bigattack04 ] { ai_face(); }; +void() morph_bigattack04 = [ $mfatc04, morph_bigattack05 ] { ai_face(); }; +void() morph_bigattack05 = [ $mfatc05, morph_bigattack06 ] { ai_face(); }; +void() morph_bigattack06 = [ $mfatc06, morph_bigattack07 ] { ai_face(); }; +void() morph_bigattack07 = [ $mfatc07, morph_bigattack08 ] { ai_face(); }; +void() morph_bigattack08 = [ $mfatc08, morph_bigattack09 ] { ai_face(); }; +void() morph_bigattack09 = [ $mfatc09, morph_bigattack10 ] { ai_face(); }; +void() morph_bigattack10 = [ $mfatc10, morph_bigattack11 ] { morph_stab2();}; +void() morph_bigattack11 = [ $mfatc11, morph_bigattack12 ] { ai_face(); }; +void() morph_bigattack12 = [ $mfatc12, morph_bigattack13 ] { ai_face(); }; +void() morph_bigattack13 = [ $mfatc13, morph_bigattack14 ] { ai_face(); }; +void() morph_bigattack14 = [ $mfatc14, morph_bigattack15 ] { ai_face(); }; +void() morph_bigattack15 = [ $mfatc15, morph_bigattack16 ] { ai_face(); }; +void() morph_bigattack16 = [ $mfatc16, morph_bigattack17 ] { ai_face(); }; +void() morph_bigattack17 = [ $mfatc01, morph_run1 ] { ai_face(); }; + +void() morph_smack = +{ + vector delta; + float ldmg; + + if(!self.enemy) + return; + if(!CanDamage(self.enemy, self)) + return; + + ai_face(); + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + ldmg = (random() * 10) + 10; + T_Damage(self.enemy, self, self, ldmg); + + makevectors(self.angles); + self.enemy.velocity = v_forward * 100 + '0 0 100'; +}; + +void() morph_knockback01 = [ $mfknck01, morph_knockback02 ] { ai_face(); }; +void() morph_knockback02 = [ $mfknck02, morph_knockback03 ] { ai_face(); }; +void() morph_knockback03 = [ $mfknck03, morph_knockback04 ] { ai_face(); }; +void() morph_knockback04 = [ $mfknck04, morph_knockback05 ] { ai_face(); }; +void() morph_knockback05 = [ $mfknck05, morph_knockback06 ] { ai_face(); }; +void() morph_knockback06 = [ $mfknck06, morph_knockback07 ] { ai_face(); }; +void() morph_knockback07 = [ $mfknck07, morph_knockback08 ] { ai_face(); }; +void() morph_knockback08 = [ $mfknck08, morph_knockback09 ] { ai_face(); }; +void() morph_knockback09 = [ $mfknck09, morph_knockback10 ] { morph_smack(); }; +void() morph_knockback10 = [ $mfknck10, morph_knockback11 ] { ai_face(); }; +void() morph_knockback11 = [ $mfknck11, morph_knockback12 ] { ai_face(); }; +void() morph_knockback12 = [ $mfknck12, morph_run1 ] { ai_face(); }; + +void() morph_attack = +{ + float attackChoice; + + attackChoice = random(); + + if(attackChoice < 0.50) + morph_bigattack01(); + else if(attackChoice < 0.75) + morph_attack01(); + else + morph_knockback01(); +}; + +// ======================== +// ranged attack +// ======================== +void() morph_fire = +{ + vector org, dir; + + ai_face(); + + self.effects = self.effects | EF_MUZZLEFLASH; + + makevectors(self.angles); + org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16'; + dir = normalize(self.enemy.origin - self.origin) ; + LaunchLaser(org, dir); + if(vlen(self.enemy.origin - self.origin) > 400) + { + LaunchLaser(org, (dir + v_right * 0.04)); + LaunchLaser(org, (dir - v_right * 0.04)); + } + else + { + LaunchLaser(org, (dir + v_right * 0.10)); + LaunchLaser(org, (dir - v_right * 0.10)); + } + +}; + +void() morph_fire1 = [ $mfata01, morph_fire2 ] {ai_face();}; +void() morph_fire2 = [ $mfata02, morph_fire3 ] {ai_face();}; +void() morph_fire3 = [ $mfata03, morph_fire4 ] {ai_face();}; +void() morph_fire4 = [ $mfata04, morph_fire5 ] {morph_fire();}; +void() morph_fire5 = [ $mfata05, morph_fire6 ] {ai_face();}; +void() morph_fire6 = [ $mfata06, morph_fire7 ] {ai_face();}; +void() morph_fire7 = [ $mfata07, morph_fire8 ] {ai_face();}; +void() morph_fire8 = [ $mfata08, morph_fire9] {ai_face();}; +void() morph_fire9 = [ $mfata09, morph_run1 ] {ai_face();}; + +// ======================== +// pain +// ======================== +void() morph_painA1 = [ $mfpain01, morph_painA2 ] {}; +void() morph_painA2 = [ $mfpain02, morph_painA3 ] {}; +void() morph_painA3 = [ $mfpain03, morph_painA4 ] {}; +void() morph_painA4 = [ $mfpain04, morph_painA5 ] {}; +void() morph_painA5 = [ $mfpain05, morph_painA6 ] {}; +void() morph_painA6 = [ $mfpain06, morph_painA7 ] {}; +void() morph_painA7 = [ $mfpain07, morph_painA8 ] {}; +void() morph_painA8 = [ $mfpain08, morph_painA9 ] {}; +void() morph_painA9 = [ $mfpain09, morph_painA10 ] {}; +void() morph_painA10 = [ $mfpain10, morph_run1 ] {morph_teleport();}; + +void() morph_painB1 = [ $mfpbin01, morph_painB2 ] {}; +void() morph_painB2 = [ $mfpbin02, morph_painB3 ] {}; +void() morph_painB3 = [ $mfpbin03, morph_painB4 ] {}; +void() morph_painB4 = [ $mfpbin04, morph_painB5 ] {}; +void() morph_painB5 = [ $mfpbin05, morph_painB6 ] {}; +void() morph_painB6 = [ $mfpbin06, morph_painB7 ] {}; +void() morph_painB7 = [ $mfpbin07, morph_run1 ] {morph_teleport();}; + +void(entity attacker, float damage) morph_pain = +{ + float painChoice; + + if(skill == 3) + { + if(random() > 0.5) + morph_teleport(); + return; + } + + if(self.pain_finished > time) + return; + if(random() > 0.25) + return; + + painChoice = random(); + self.pain_finished = time + 2; + + sound(self, CHAN_VOICE, "guard/pain1.wav", 1, ATTN_NORM); + + if(painChoice > 0.6) + self.think = morph_painB1; + else + self.think = morph_painA1; + + self.nextthink = time + 0.1; +}; + +// ======================== +// die +// ======================== +void() morph_die1 = [ $mfdth01, morph_die2 ] {}; // 122 +void() morph_die2 = [ $mfdth02, morph_die3 ] {}; +void() morph_die3 = [ $mfdth03, morph_die4 ] {}; +void() morph_die4 = [ $mfdth04, morph_die5 ] {}; +void() morph_die5 = [ $mfdth05, morph_die6 ] {}; // 126 +void() morph_die6 = [ $mfdth06, morph_die7 ] {}; +void() morph_die7 = [ $mfdth07, morph_die8 ] {}; +void() morph_die8 = [ $mfdth08, morph_die9 ] {}; // 129 +void() morph_die9 = [ $mfdth09, morph_die10 ] { self.skin = self.skin + 1; }; +void() morph_die10 = [ $mfdth10, morph_die11 ] {}; +void() morph_die11 = [ $mfdth11, morph_die12 ] {}; +void() morph_die12 = [ $mfdth12, morph_die13 ] {}; // 132 +void() morph_die13 = [ $mfdth13, morph_die14 ] {}; +void() morph_die14 = [ $mfdth14, morph_die15 ] {}; +void() morph_die15 = [ $mfdth15, morph_die16 ] {}; +void() morph_die16 = [ $mfdth16, morph_die17 ] {}; // 136 +void() morph_die17 = [ $mfdth17, morph_die18 ] {}; +void() morph_die18 = [ $mfdth18, morph_die19 ] {}; +void() morph_die19 = [ $mfdth19, morph_die20 ] {}; +void() morph_die20 = [ $mfdth20, morph_die21 ] {}; // 140 +void() morph_die21 = [ $mfdth21, morph_die21 ] +{ + remove(self); +}; + +void() morph_die = +{ + sound(self, CHAN_VOICE, "guard/death.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; + self.think = morph_die1; + self.nextthink = time + 0.1; +}; + + +// ======================== +// hide in floor +// ======================== +void() morph_wake1 = [ $start01, morph_wake2 ] +{ + sound(self, CHAN_VOICE, "guard/see1.wav", 1, ATTN_NORM); + if(self.owner) + { +// self.solid = SOLID_SLIDEBOX; +// self.takedamage = DAMAGE_NO; + + total_monsters = total_monsters + 1; + self.owner.childrenSpawned = self.owner.childrenSpawned + 1; + + WriteByte(MSG_BROADCAST, SVC_UPDATESTAT); + WriteByte(MSG_BROADCAST, STAT_TOTALMONSTERS); + WriteLong (MSG_BROADCAST, total_monsters); + } +}; +void() morph_wake2 = [ $start02, morph_wake3 ] {}; +void() morph_wake3 = [ $start03, morph_wake4 ] {}; +void() morph_wake4 = [ $start04, morph_wake5 ] {}; +void() morph_wake5 = [ $start05, morph_wake6 ] {}; +void() morph_wake6 = [ $start06, morph_wake7 ] {}; +void() morph_wake7 = [ $start07, morph_wake8 ] {}; +void() morph_wake8 = [ $start08, morph_wake9 ] {}; +void() morph_wake9 = [ $start09, morph_wake10 ] {}; +void() morph_wake10 = [ $start10, morph_wake11 ] {}; +void() morph_wake11 = [ $start11, morph_wake12 ] {}; +void() morph_wake12 = [ $start12, morph_wake13 ] {}; +void() morph_wake13 = [ $start13, morph_wake14 ] {}; +void() morph_wake14 = [ $start14, morph_wake15 ] {}; +void() morph_wake15 = [ $start15, morph_wake16 ] + { self.skin = 1; }; +void() morph_wake16 = [ $start16, morph_wake17 ] {}; +void() morph_wake17 = [ $start17, morph_wake18 ] {}; +void() morph_wake18 = [ $start18, morph_wake20 ] {}; +//void() morph_wake18 = [ $start18, morph_wake19 ] {}; +//void() morph_wake19 = [ $start19, morph_wake20 ] {}; +void() morph_wake20 = [ $start20, morph_wake21 ] {}; +void() morph_wake21 = [ $start21, morph_wake22 ] {}; +void() morph_wake22 = [ $start22, morph_wake23 ] {}; +void() morph_wake23 = [ $start23, morph_wake24 ] {}; +void() morph_wake24 = [ $start24, morph_wake25 ] {}; +void() morph_wake25 = [ $start25, morph_wake26 ] {}; +void() morph_wake26 = [ $start26, morph_wake27 ] {}; +void() morph_wake27 = [ $start27, morph_wake28 ] {}; +void() morph_wake28 = [ $start28, morph_wake29 ] {}; +void() morph_wake29 = [ $start29, morph_wake30 ] {}; +void() morph_wake30 = [ $start30, morph_wake31 ] {}; +void() morph_wake31 = [ $start31, morph_stand1 ] +{ + self.solid = SOLID_SLIDEBOX; + self.takedamage = DAMAGE_AIM; + self.skin = self.skin - 1; + if(self.owner) + { + self.think = morph_run1; + self.nextthink = time + 0.1; + } +}; + +void(entity theMorph) morph_setup = +{ + theMorph.solid = SOLID_SLIDEBOX; + theMorph.movetype = MOVETYPE_STEP; + theMorph.takedamage = DAMAGE_NO; + theMorph.flags = theMorph.flags | FL_MONSTER; + theMorph.ideal_yaw = theMorph.angles * '0 1 0'; + if(!theMorph.yaw_speed) + theMorph.yaw_speed = 20; + theMorph.view_ofs = '0 0 25'; + theMorph.frame = $start01; + + + setmodel(theMorph, theMorph.model); + + setsize(theMorph, VEC_HULL_MIN, VEC_HULL_MAX); + + theMorph.th_stand = morph_stand1; + theMorph.th_walk = morph_walk1; + theMorph.th_run = morph_run1; + theMorph.th_missile = morph_fire1; + theMorph.th_melee = morph_attack; + theMorph.th_pain = morph_pain; + theMorph.th_die = morph_die; + + if(theMorph.owner) + { + theMorph.effects = 0; + theMorph.health = 200; + theMorph.spawnflags = theMorph.owner.spawnflags; + } + else + { + theMorph.effects = theMorph.effects | EF_DIMLIGHT; + theMorph.health = 2000; + } + +// theMorph.frame = $start01; + theMorph.skin = 2; +}; + +void() morph_wake = +{ + if(isSpawnPointEmpty(self)) + { + morph_setup(self); + self.think = morph_wake1; + } + else + { + self.think = morph_wake; + } + + self.nextthink = time + 0.1; +}; + +void() morph_use = +{ +// self.enemy = activator; + if(self.delay) + { + self.think = morph_wake; + self.nextthink = time + self.delay; + } + else + { + self.think = morph_wake; + self.nextthink = time + 0.1; + } +}; + + +void() morph_teleport = +{ + entity theDest; + entity theChild; + + if(self.owner) + return; + + if(self.childrenSpawned > (1+skill)) + return; + + theDest = overlord_find_dest3(); + if(theDest == world) + return; + + theChild = spawn(); + theChild.model = self.model; + theChild.angles = theDest.mangle; + theChild.owner = self; + theChild.enemy = self.enemy; + theChild.movetarget = self.movetarget; + theChild.goalentity = self.goalentity; + theChild.mangle = theDest.mangle; + theChild.classname = "monster_morph"; + morph_setup (theChild); + setorigin(theChild, theDest.origin); + droptofloor(); + + theChild.think = morph_wake1; + theChild.nextthink = time + 0.3; +}; + +/*QUAKED monster_morph (1 0 0) (-16 -16 -24) (16 16 32) Ambush Aztec Egyptian Greek +The morphing monster. + +Select the look of the monster (Aztec,Greek,Egyptian). +If the monster has a targetname (triggered by something) he will rise up out of the floor when triggered. +*/ +void() monster_morph = +{ + if(deathmatch) + { + remove(self); + return; + } + + if(self.spawnflags & MORPH_AZTEC) // Aztec + { + precache_model("progs/morph_az.mdl"); + self.model = "progs/morph_az.mdl"; + } + else if(self.spawnflags & MORPH_EGYPT) + // Egyptian + { + precache_model("progs/morph_eg.mdl"); + self.model = "progs/morph_eg.mdl"; + } + else if(self.spawnflags & MORPH_GREEK) // greek + { + precache_model("progs/morph_gr.mdl"); + self.model = "progs/morph_gr.mdl"; + } + else + objerror ("monster_morph: no skin selection!"); + + precache_model2("progs/laser.mdl"); + precache_sound2("enforcer/enfire.wav"); + precache_sound2("guard/death.wav"); + precache_sound2("guard/pain1.wav"); + precache_sound2("guard/see1.wav"); + + // HONEY + monster_add_to_counter(); + + if(self.targetname != NULLSTR) + { + self.use = morph_use; + } + else + { + morph_wake (); + } +}; + diff --git a/QC/rogue_motd.qc b/QC/rogue_motd.qc new file mode 100644 index 00000000..6674cfc2 --- /dev/null +++ b/QC/rogue_motd.qc @@ -0,0 +1,70 @@ +// Rogue Teamplay Variants Message of the Day function +// Feb'97 by ZOID <zoid@threewave.com> +// Under contract to id software for Rogue Entertainment + +.float motd_time; +.float motd_count; + +void() MOTD = +{ + string tp; + + if(self.motd_count < 5) { + if(teamplay > 3 && teamplay < 7) + { + tp = ftos(teamplay); + stuffcmd(self, "teamplay "); + stuffcmd(self, tp); + stuffcmd(self, "\n"); + } + self.motd_time = time + 1; + self.motd_count = self.motd_count + 1; +/* + if(teamplay == TEAM_NORMAL_NODAMAGE) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nTeam play: No Friendly Fire\n"); + else if(teamplay == TEAM_NORMAL_DAMAGE) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nTeam play: Friendly Fire\n"); +*/ + if(teamplay == TEAM_DMATCH_TAG) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nDeathmatch Tag!\n"); + else if(teamplay == TEAM_CTF) + if(self.steam == TEAM1) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n\nYou are ��� team!\n"); + else + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n\nYou are ���� team!\n"); + else if(teamplay == TEAM_CTF_ONEFLAG) + if(self.steam == TEAM1) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(One Flag Mode)\n\nYou are ��� team!\n"); + else + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(One Flag Mode)\n\nYou are ���� team!\n"); + else if(teamplay == TEAM_CTF_ALT) + if(self.steam == TEAM1) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(Three Team Mode)\n\nYou are ��� team!\n"); + else if(self.steam == TEAM2) + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(Three Team Mode)\n\nYou are ���� team!\n"); + else + centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(Three Team Mode)\n\nYou are ���� team!\n"); + return; + } + self.motd_time = 0; +}; + +void() CheckMOTD = +{ +// if(self.motd_time && self.motd_time < time) + if(self.motd_time) + { + if(self.motd_time < time) + MOTD(); + } +}; + +void() SetMOTD = +{ + self.motd_time = time + 3; + if(teamplay == 3) + self.motd_count = 2; + else + self.motd_count = 0; +}; + diff --git a/QC/rogue_mult_wpn.qc b/QC/rogue_mult_wpn.qc new file mode 100644 index 00000000..037d0877 --- /dev/null +++ b/QC/rogue_mult_wpn.qc @@ -0,0 +1,592 @@ +// multi_weapons.qc +// pmack +// sept 96 + +//============================================================================= +// Multi Grenade Code +//============================================================================= + +void() MiniGrenadeExplode = +{ + if(self.owner.classname == "player") + { + T_RadiusDamage(self, self.owner, 90, world); + } + else + { + T_RadiusDamage(self, self.owner, 60, world); + } + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 230); + WriteByte(MSG_BROADCAST, 5); + + BecomeExplosion(); +}; + +void(float offsetAngle) MiniGrenadeLaunch = +{ + entity missile; + float tempRand; + + missile = spawn(); + missile.owner = self.owner; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "MiniGrenade"; + + // set missile speed + missile.v_angle = self.v_angle; + missile.v_angle_y = missile.v_angle_y + offsetAngle; + makevectors(missile.v_angle); + + missile.velocity = v_forward*100 + v_up*400; + tempRand = (crandom()*60) - 30; + missile.velocity += tempRand * v_forward; + tempRand = (crandom()*40) - 20; + missile.velocity += tempRand * v_right; + tempRand = (crandom()*60) - 30; + missile.velocity += tempRand * v_up; + + missile.avelocity = '300 300 300'; + missile.angles = vectoangles(missile.velocity); + missile.touch = MultiGrenadeTouch; + + setmodel(missile, "progs/mervup.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin); + + // set missile duration + missile.nextthink = time + 1 + (crandom() * 0.5); + missile.think = MiniGrenadeExplode; +}; + +void() MultiGrenadeExplode = +{ + MiniGrenadeLaunch(0); + MiniGrenadeLaunch(72); + MiniGrenadeLaunch(144); + MiniGrenadeLaunch(216); + MiniGrenadeLaunch(288); + + remove(self); +}; + +void() MultiGrenadeTouch = +{ + if(other == self.owner) + { + // don't explode on owner + return; + } + + if(other.takedamage == DAMAGE_AIM) + { + if(self.classname == "MiniGrenade") + MiniGrenadeExplode(); + else + { + if(self.owner.classname == "player") + { + GrenadeExplode(); + } + else + { + MiniGrenadeExplode(); + } + } + + return; + } + + // bounce sound + sound(self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); + + if(self.velocity == '0 0 0') + { + self.avelocity = '0 0 0'; + } +}; + +void(float xHand) W_FireMultiGrenade = +{ + entity missile; + vector tmpAngles; + + delAmmoAndUpdateCounter(xHand, AID_MULTI_ROCKETS, 1); + + sound(self, VRGetGunChannel(xHand), "weapons/grenade.wav", 1, ATTN_NORM); + + self.punchangle_x = -2; + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "MultiGrenade"; + + // set missile speed + tmpAngles = VRGetWeaponFireRot(xHand); + makevectors(tmpAngles); + + if(cvar_hget(cvarh_vr_enabled) == 1) + { + if(tmpAngles_x) + { + missile.velocity = v_forward*600 + crandom()*v_right*10 + crandom()*v_up*10; + } + else + { + missile.velocity = v_forward * 600; + } + + missile.velocity += vrProjectileVelocity(xHand, 0.6); + } + else + { + if(tmpAngles_x) + { + missile.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; + } + else + { + missile.velocity = v_forward * 600; + missile.velocity_z = 200; + } + } + + missile.avelocity = '300 300 300'; + missile.angles = vectoangles(missile.velocity); + missile.touch = MultiGrenadeTouch; + + // set missile duration + missile.nextthink = time + 1; + missile.think = MultiGrenadeExplode; + + setmodel(missile, "progs/mervup.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, VRGetMuzzlePos(xHand)); + + VRGunHaptic(xHand, 0.4, 75, 1.0); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 2); +}; + +//============================================================================= +// Multi Rocket Code +//============================================================================= + +void() MultiRocketExplode = +{ + float damg; + +// Stock Single Rocket Damage... +// damg = 100 + random()*20; + + damg = 60 + random()*15; + + if(other.health) + { + if(other.classname == "monster_shambler") + damg = damg * 0.5; // mostly immune + if(other.classname == "monster_dragon") + damg = damg * 0.5; // mostly immune + T_Damage(other, self, self.owner, damg); + } + + // don't do radius damage to the other, because all the damage + // was done in the impact +// Stock single rocket damage. +// T_RadiusDamage(self, self.owner, 120, other); + + T_RadiusDamage(self, self.owner, 75, other); + +// sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + BecomeExplosion(); +}; + +void() MultiRocketTouch = +{ + if(other == self.owner) + return; // don't explode on owner + + if(other.owner == self.owner) + return; // don't explode on owner + + if(pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + MultiRocketExplode(); +}; + + +void() HomingMissileThink = +{ + vector dir; + + if(self.enemy.health < 1) + { + remove(self); + return; + } + + dir = normalize(self.enemy.origin - self.origin); + self.velocity = dir * 1000; + self.nextthink = time + 0.1; + self.think = HomingMissileThink; +}; + + +void() HomingMissileAcquire = +{ + vector oldVelocity; + vector aimangle; + + if(self.delay < time) + { + MultiRocketExplode(); + return; + } + + oldVelocity = self.velocity; + makevectors(self.v_angle); + self.velocity = aim(self, 1000); + self.velocity = self.velocity * 1000; + + aimangle = self.origin + self.velocity; + traceline(self.origin, aimangle, FALSE, self); + if(trace_fraction < 1) + { + if(trace_ent.flags & FL_MONSTER) + { + self.enemy = trace_ent; + HomingMissileThink(); + return; + } + } + + self.velocity = oldVelocity; + self.v_angle = vectoangles (self.velocity); + self.angles = self.v_angle; + self.think = HomingMissileAcquire; + self.nextthink = time + 0.2; +}; + +void(float xHand, float offset, float frameNum) MultiRocketLaunch = +{ + entity missile; + vector aimangle; + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "MultiRocket"; + missile.delay = time + 4; + missile.frame = frameNum; + missile.touch = MultiRocketTouch; + + // VR: The engine uses this to draw smaller rocket trails. + missile.effects = missile.effects | EF_MINIROCKET; + + if(deathmatch || coop) + { + setmodel(missile, "progs/rockup_d.mdl"); + } + else + { + setmodel(missile, "progs/rockup.mdl"); + } + + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, VRGetMuzzlePos(xHand)); + + if(coop || deathmatch) + { + aimangle = VRGetWeaponFireRot(xHand); + aimangle_y = aimangle_y + (offset * 0.66); + makevectors(aimangle); + missile.velocity = VRGetWeaponFireRotFwd(xHand) * 1000; + missile.velocity += vrProjectileVelocity(xHand, 0.4); + + missile.angles = vectoangles(missile.velocity); + + missile.think = MultiRocketExplode; + missile.nextthink = time + 4; + } + else + { + makevectors(VRGetWeaponFireRot(xHand)); + missile.velocity = v_forward * 1000 - v_right*offset*8; + missile.velocity += vrProjectileVelocity(xHand, 0.4); + + missile.angles = vectoangles(missile.velocity); + missile.v_angle = self.v_angle; + + aimangle = missile.origin + missile.velocity; + traceline(missile.origin, aimangle, FALSE, self); + + if(trace_fraction < 1) + { + if(trace_ent.flags & FL_MONSTER) + { + missile.enemy = trace_ent; + missile.think = HomingMissileThink; + return; + } + } + + missile.think = HomingMissileAcquire; + missile.nextthink = time + 0.1; + } +}; + +void(float xHand) W_FireMultiRocket = +{ + delAmmoAndUpdateCounter(xHand, AID_MULTI_ROCKETS, 1); + + sound(self, VRGetGunChannel(xHand), "weapons/sgun1.wav", 1, ATTN_NORM); + + self.punchangle_x = -2; + + MultiRocketLaunch(xHand, -10, 2); + MultiRocketLaunch(xHand, -5, 3); + MultiRocketLaunch(xHand, 5, 0); + MultiRocketLaunch(xHand, 10, 1); +}; + +//============================================================================= +// Plasma Gun Code +//============================================================================= +void(vector p1, vector p2, entity from, float damage) PlasmaDamage = +{ + entity e1, e2; + vector f; + + f = p2 - p1; + normalize(f); + f_x = 0 - f_y; + f_y = f_x; + f_z = 0; + f = f*16; + + e1 = e2 = world; + + // HONEY + self.damage_weapon = IT_LIGHTNING; + + traceline(p1, p2, FALSE, self); + if(trace_ent.takedamage) + { + SpawnBloodSplash (trace_endpos, damage*5); + T_Damage(trace_ent, from, from.owner, damage); + if(self.classname == "player") + { + if(other.classname == "player") + trace_ent.velocity_z = trace_ent.velocity_z + 400; + } + } + e1 = trace_ent; + + traceline(p1 + f, p2 + f, FALSE, self); + if(trace_ent != e1 && trace_ent.takedamage) + { + SpawnBloodSplash (trace_endpos, damage*5); + T_Damage(trace_ent, from, from.owner, damage); + } + e2 = trace_ent; + + traceline(p1 - f, p2 - f, FALSE, self); + if(trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage) + { + SpawnBloodSplash (trace_endpos, damage*5); + T_Damage(trace_ent, from, from.owner, damage); + } +}; + +void(entity current, float doDamage) PlasmaDischarge = +{ + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity(MSG_BROADCAST, current); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, current.origin); + WriteVec3(MSG_BROADCAST, self.origin); + + sound(self, CHAN_VOICE, "weapons/lhit.wav", 1, ATTN_NORM); + if(doDamage == 1) + PlasmaDamage(self.origin, current.origin, self, 50); +}; + +void() PlasmaGroundOut = +{ + entity current, start; + float monstersHit; + + monstersHit = 0; + current = findradius (self.origin, 420); + start = current; + while(monstersHit < 6) + { + if(current.flags & FL_MONSTER || current.classname == "player") + { + if(current != self.owner) + { + traceline(self.origin, current.origin, TRUE, world); + if(trace_fraction == 1) + { + monstersHit = monstersHit + 1; + PlasmaDischarge (current, 1); + + LightningParticles(self.origin, trace_endpos); + LightningParticles(self.origin, trace_endpos); + LightningParticles(self.origin, trace_endpos); + } + } + } + current = current.chain; + if(start == current || !current) + return; + } +}; + +void() PlasmaTouch = +{ + float damg; + + if(other == self.owner) + return; // don't explode on owner + + if(pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + damg = 80 + random()*20; + + // TODO VR: (P2) rogue (commented to avoid warnings) + sound(self, CHAN_WEAPON, "plasma/explode.wav", 1, ATTN_NORM); + + if(other.health) + { + if(other.classname == "monster_shambler") + damg = damg * 0.5; // mostly immune + T_Damage(other, self, self.owner, damg); + } + + // don't do radius damage to the other, because all the damage + // was done in the impact + T_RadiusDamage(self, self.owner, 70, other); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 244); + WriteByte(MSG_BROADCAST, 3); + + PlasmaGroundOut(); + remove(self); +}; + +void() PlasmaThink = +{ + self.nextthink = time + 0.01; + + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_LIGHTNING, 25); + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 3); + + if(time >= self.lip) + { + SUB_Remove(); + } +} + +void() PlasmaLaunch = +{ + self.velocity = normalize(self.velocity); + self.velocity = self.velocity * 1250; + + self.lip = time + 5; // deletion time + + self.think = PlasmaThink; + self.nextthink = time + 0.01; +}; + +void(vector org, vector dir) launch_plasma = +{ + entity missile; + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "plasma"; + + // set missile speed + missile.velocity = dir * 0.01; + missile.avelocity = '300 300 300'; + missile.angles = vectoangles(missile.velocity); + missile.touch = PlasmaTouch; + + // TODO VR: (P2) rogue (commented to avoid warnings) + setmodel(missile, "progs/plasma.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, org); + + // TODO VR: (P2) rogue (commented to avoid warnings) + sound(missile, CHAN_WEAPON, "plasma/flight.wav", 1, ATTN_NORM); + + missile.effects = EF_BRIGHTLIGHT; + + // set missile duration + missile.think = PlasmaLaunch; + missile.nextthink = time + 0.1; + + particle2(missile.origin, '0 0 0', QVR_PARTICLE_PRESET_LIGHTNING, 25); + particle2(missile.origin, '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 3); +}; + +void(float xHand) W_FirePlasma = +{ + float cells; + vector dir; + + if(self.ammo_plasma < 1) + { + return; + } + + // explode if under water + if(self.waterlevel > 1) + { + cells = self.ammo_plasma; + self.ammo_plasma = 0; + + discharged = 1; + T_RadiusDamage(self, self, 35*cells, world); + discharged = 0; + + W_SetCurrentAmmo(); + return; + } + + delAmmoAndUpdateCounter(xHand, AID_PLASMA, 1); + + sound(self, VRGetGunChannel(xHand), "plasma/fire.wav", 0.5, ATTN_NORM); + self.punchangle_x = -2; + + makevectors(VRGetWeaponFireRot(xHand)); + dir = v_forward; + launch_plasma(VRGetMuzzlePos(xHand), dir); +}; diff --git a/QC/rogue_mummy.qc b/QC/rogue_mummy.qc new file mode 100644 index 00000000..e3e042b9 --- /dev/null +++ b/QC/rogue_mummy.qc @@ -0,0 +1,509 @@ +/* +============================================================================== + +mummy + +============================================================================== +*/ +$cd /qwork/xpack/models/mummy + +$origin 0 0 24 + +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 +$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 +$frame run13 run14 run15 run16 run17 run18 + +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11 +$frame atta12 atta13 + +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11 +$frame attb12 attb13 attb14 + +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11 +$frame attc12 + +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10 +$frame paina11 paina12 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19 +$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19 +$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28 +$frame paine29 paine30 + +//============================================================================= + +.float inpain; + + +void() mummy_stand1 =[ $stand1, mummy_stand2 ] {ai_stand();}; +void() mummy_stand2 =[ $stand2, mummy_stand3 ] {ai_stand();}; +void() mummy_stand3 =[ $stand3, mummy_stand4 ] {ai_stand();}; +void() mummy_stand4 =[ $stand4, mummy_stand5 ] {ai_stand();}; +void() mummy_stand5 =[ $stand5, mummy_stand6 ] {ai_stand();}; +void() mummy_stand6 =[ $stand6, mummy_stand7 ] {ai_stand();}; +void() mummy_stand7 =[ $stand7, mummy_stand8 ] {ai_stand();}; +void() mummy_stand8 =[ $stand8, mummy_stand9 ] {ai_stand();}; +void() mummy_stand9 =[ $stand9, mummy_stand10 ] {ai_stand();}; +void() mummy_stand10 =[ $stand10, mummy_stand11 ] {ai_stand();}; +void() mummy_stand11 =[ $stand11, mummy_stand12 ] {ai_stand();}; +void() mummy_stand12 =[ $stand12, mummy_stand13 ] {ai_stand();}; +void() mummy_stand13 =[ $stand13, mummy_stand14 ] {ai_stand();}; +void() mummy_stand14 =[ $stand14, mummy_stand15 ] {ai_stand();}; +void() mummy_stand15 =[ $stand15, mummy_stand1 ] {ai_stand();}; + +void() mummy_walk1 =[ $walk1, mummy_walk2 ] {ai_walk(0);}; +void() mummy_walk2 =[ $walk2, mummy_walk3 ] {ai_walk(3);}; +void() mummy_walk3 =[ $walk3, mummy_walk4 ] {ai_walk(5);}; +void() mummy_walk4 =[ $walk4, mummy_walk5 ] {ai_walk(4);}; +void() mummy_walk5 =[ $walk5, mummy_walk6 ] {ai_walk(2);}; +void() mummy_walk6 =[ $walk6, mummy_walk7 ] {ai_walk(0);}; +void() mummy_walk7 =[ $walk7, mummy_walk8 ] {ai_walk(0);}; +void() mummy_walk8 =[ $walk8, mummy_walk9 ] {ai_walk(0);}; +void() mummy_walk9 =[ $walk9, mummy_walk10 ] {ai_walk(0);}; +void() mummy_walk10 =[ $walk10, mummy_walk11 ] {ai_walk(0);}; +void() mummy_walk11 =[ $walk11, mummy_walk12 ] {ai_walk(3);}; +void() mummy_walk12 =[ $walk12, mummy_walk13 ] {ai_walk(4);}; +void() mummy_walk13 =[ $walk13, mummy_walk14 ] {ai_walk(2);}; +void() mummy_walk14 =[ $walk14, mummy_walk15 ] {ai_walk(0);}; +void() mummy_walk15 =[ $walk15, mummy_walk16 ] {ai_walk(0);}; +void() mummy_walk16 =[ $walk16, mummy_walk17 ] {ai_walk(0);}; +void() mummy_walk17 =[ $walk17, mummy_walk18 ] {ai_walk(0);}; +void() mummy_walk18 =[ $walk18, mummy_walk19 ] {ai_walk(0);}; +void() mummy_walk19 =[ $walk19, mummy_walk1 ] + { + ai_walk(0); + if(random() < 0.2) + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + }; + +void() mummy_run1 =[ $run1, mummy_run2 ] {ai_run(2);self.inpain = 0;}; +void() mummy_run2 =[ $run2, mummy_run3 ] {ai_run(2);}; +void() mummy_run3 =[ $run3, mummy_run4 ] {ai_run(0);}; +void() mummy_run4 =[ $run4, mummy_run5 ] {ai_run(2);}; +void() mummy_run5 =[ $run5, mummy_run6 ] {ai_run(4);}; +void() mummy_run6 =[ $run6, mummy_run7 ] {ai_run(6);}; +void() mummy_run7 =[ $run7, mummy_run8 ] {ai_run(8);}; +void() mummy_run8 =[ $run8, mummy_run9 ] {ai_run(8);}; +void() mummy_run9 =[ $run9, mummy_run10 ] {ai_run(4);}; +void() mummy_run10 =[ $run10, mummy_run11 ] {ai_run(0);}; +void() mummy_run11 =[ $run11, mummy_run12 ] {ai_run(0);}; +void() mummy_run12 =[ $run12, mummy_run13 ] {ai_run(0);}; +void() mummy_run13 =[ $run13, mummy_run14 ] {ai_run(4);}; +void() mummy_run14 =[ $run14, mummy_run15 ] {ai_run(8);}; +void() mummy_run15 =[ $run15, mummy_run16 ] {ai_run(12);}; +void() mummy_run16 =[ $run16, mummy_run17 ] {ai_run(14);}; +void() mummy_run17 =[ $run17, mummy_run18 ] {ai_run(6);}; +void() mummy_run18 =[ $run18, mummy_run1 ] + { + ai_run(16); + if(random() < 0.2) + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + if(random() > 0.8) + sound(self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + }; + +/* +============================================================================= + +ATTACKS + +============================================================================= +*/ + +void() mummyGrenadeTouch = +{ + float mummyDamage; + + if(other == self.owner) + return; // don't explode on owner + if(other.takedamage) + { + mummyDamage = 15 + random() * 15; + + T_Damage(other, self, self.owner, mummyDamage); + sound(self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + remove(self); + return; + } + sound(self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound + self.velocity = '0 0 0'; + self.avelocity = '0 0 0'; + self.touch = SUB_Remove; +}; + +/* +================ +mummyFireGrenade +================ +*/ +void(vector st) mummyFireGrenade = +{ + entity missile; + vector org; + + sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + +// calc org + org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up; + +// set missile speed + + makevectors(self.angles); + + missile.velocity = normalize(self.enemy.origin - org); + missile.velocity = missile.velocity * 600; + missile.velocity_z = 200; + + missile.avelocity = '3000 1000 2000'; + + missile.touch = mummyGrenadeTouch; + +// set missile duration + missile.nextthink = time + 2.5; + missile.think = SUB_Remove; + + setmodel(missile, "progs/zom_gib.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, org); +}; + + +void() mummy_atta1 =[ $atta1, mummy_atta2 ] {ai_face();}; +void() mummy_atta2 =[ $atta2, mummy_atta3 ] {ai_face();}; +void() mummy_atta3 =[ $atta3, mummy_atta4 ] {ai_face();}; +void() mummy_atta4 =[ $atta4, mummy_atta5 ] {ai_face();}; +void() mummy_atta5 =[ $atta5, mummy_atta6 ] {ai_face();}; +void() mummy_atta6 =[ $atta6, mummy_atta7 ] {ai_face();}; +void() mummy_atta7 =[ $atta7, mummy_atta8 ] {ai_face();}; +void() mummy_atta8 =[ $atta8, mummy_atta9 ] {ai_face();}; +void() mummy_atta9 =[ $atta9, mummy_atta10 ] {ai_face();}; +void() mummy_atta10 =[ $atta10, mummy_atta11 ] {ai_face();}; +void() mummy_atta11 =[ $atta11, mummy_atta12 ] {ai_face();}; +void() mummy_atta12 =[ $atta12, mummy_atta13 ] {ai_face();}; +void() mummy_atta13 =[ $atta13, mummy_run1 ] + { ai_face(); mummyFireGrenade('-10 -22 30'); }; + +void() mummy_attb1 =[ $attb1, mummy_attb2 ] {ai_face();}; +void() mummy_attb2 =[ $attb2, mummy_attb3 ] {ai_face();}; +void() mummy_attb3 =[ $attb3, mummy_attb4 ] {ai_face();}; +void() mummy_attb4 =[ $attb4, mummy_attb5 ] {ai_face();}; +void() mummy_attb5 =[ $attb5, mummy_attb6 ] {ai_face();}; +void() mummy_attb6 =[ $attb6, mummy_attb7 ] {ai_face();}; +void() mummy_attb7 =[ $attb7, mummy_attb8 ] {ai_face();}; +void() mummy_attb8 =[ $attb8, mummy_attb9 ] {ai_face();}; +void() mummy_attb9 =[ $attb9, mummy_attb10 ] {ai_face();}; +void() mummy_attb10 =[ $attb10, mummy_attb11 ] {ai_face();}; +void() mummy_attb11 =[ $attb11, mummy_attb12 ] {ai_face();}; +void() mummy_attb12 =[ $attb12, mummy_attb13 ] {ai_face();}; +void() mummy_attb13 =[ $attb13, mummy_attb14 ] {ai_face();}; +void() mummy_attb14 =[ $attb13, mummy_run1 ] + { ai_face(); mummyFireGrenade('-10 -24 29'); }; + +void() mummy_attc1 =[ $attc1, mummy_attc2 ] {ai_face();}; +void() mummy_attc2 =[ $attc2, mummy_attc3 ] {ai_face();}; +void() mummy_attc3 =[ $attc3, mummy_attc4 ] {ai_face();}; +void() mummy_attc4 =[ $attc4, mummy_attc5 ] {ai_face();}; +void() mummy_attc5 =[ $attc5, mummy_attc6 ] {ai_face();}; +void() mummy_attc6 =[ $attc6, mummy_attc7 ] {ai_face();}; +void() mummy_attc7 =[ $attc7, mummy_attc8 ] {ai_face();}; +void() mummy_attc8 =[ $attc8, mummy_attc9 ] {ai_face();}; +void() mummy_attc9 =[ $attc9, mummy_attc10 ] {ai_face();}; +void() mummy_attc10 =[ $attc10, mummy_attc11 ] {ai_face();}; +void() mummy_attc11 =[ $attc11, mummy_attc12 ] {ai_face();}; +void() mummy_attc12 =[ $attc12, mummy_run1 ] + { ai_face(); mummyFireGrenade('-12 -19 29'); }; + +void() mummy_missile = +{ + float r; + + r = random(); + + if(r < 0.3) + mummy_atta1(); + else if(r < 0.6) + mummy_attb1(); + else + mummy_attc1(); +}; + + +/* +============================================================================= + +PAIN + +============================================================================= +*/ + +void() mummy_paina1 =[ $paina1, mummy_paina2 ] + {sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);}; +void() mummy_paina2 =[ $paina2, mummy_paina3 ] {ai_painforward(3);}; +void() mummy_paina3 =[ $paina3, mummy_paina4 ] {ai_painforward(1);}; +void() mummy_paina4 =[ $paina4, mummy_paina5 ] {ai_pain(1);}; +void() mummy_paina5 =[ $paina5, mummy_paina6 ] {ai_pain(3);}; +void() mummy_paina6 =[ $paina6, mummy_paina7 ] {ai_pain(1);}; +void() mummy_paina7 =[ $paina7, mummy_paina8 ] {}; +void() mummy_paina8 =[ $paina8, mummy_paina9 ] {}; +void() mummy_paina9 =[ $paina9, mummy_paina10 ] {}; +void() mummy_paina10 =[ $paina10, mummy_paina11 ] {}; +void() mummy_paina11 =[ $paina11, mummy_paina12 ] {}; +void() mummy_paina12 =[ $paina12, mummy_run1 ] {}; + +void() mummy_painb1 =[ $painb1, mummy_painb2 ] + {sound(self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);}; +void() mummy_painb2 =[ $painb2, mummy_painb3 ] {ai_pain(2);}; +void() mummy_painb3 =[ $painb3, mummy_painb4 ] {ai_pain(8);}; +void() mummy_painb4 =[ $painb4, mummy_painb5 ] {ai_pain(6);}; +void() mummy_painb5 =[ $painb5, mummy_painb6 ] {ai_pain(2);}; +void() mummy_painb6 =[ $painb6, mummy_painb7 ] {}; +void() mummy_painb7 =[ $painb7, mummy_painb8 ] {}; +void() mummy_painb8 =[ $painb8, mummy_painb9 ] {}; +void() mummy_painb9 =[ $painb9, mummy_painb10 ] + {sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);}; +void() mummy_painb10 =[ $painb10, mummy_painb11 ] {}; +void() mummy_painb11 =[ $painb11, mummy_painb12 ] {}; +void() mummy_painb12 =[ $painb12, mummy_painb13 ] {}; +void() mummy_painb13 =[ $painb13, mummy_painb14 ] {}; +void() mummy_painb14 =[ $painb14, mummy_painb15 ] {}; +void() mummy_painb15 =[ $painb15, mummy_painb16 ] {}; +void() mummy_painb16 =[ $painb16, mummy_painb17 ] {}; +void() mummy_painb17 =[ $painb17, mummy_painb18 ] {}; +void() mummy_painb18 =[ $painb18, mummy_painb19 ] {}; +void() mummy_painb19 =[ $painb19, mummy_painb20 ] {}; +void() mummy_painb20 =[ $painb20, mummy_painb21 ] {}; +void() mummy_painb21 =[ $painb21, mummy_painb22 ] {}; +void() mummy_painb22 =[ $painb22, mummy_painb23 ] {}; +void() mummy_painb23 =[ $painb23, mummy_painb24 ] {}; +void() mummy_painb24 =[ $painb24, mummy_painb25 ] {}; +void() mummy_painb25 =[ $painb25, mummy_painb26 ] {ai_painforward(1);}; +void() mummy_painb26 =[ $painb26, mummy_painb27 ] {}; +void() mummy_painb27 =[ $painb27, mummy_painb28 ] {}; +void() mummy_painb28 =[ $painb28, mummy_run1 ] {}; + +void() mummy_painc1 =[ $painc1, mummy_painc2 ] + {sound(self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);}; +void() mummy_painc2 =[ $painc2, mummy_painc3 ] {}; +void() mummy_painc3 =[ $painc3, mummy_painc4 ] {ai_pain(3);}; +void() mummy_painc4 =[ $painc4, mummy_painc5 ] {ai_pain(1);}; +void() mummy_painc5 =[ $painc5, mummy_painc6 ] {}; +void() mummy_painc6 =[ $painc6, mummy_painc7 ] {}; +void() mummy_painc7 =[ $painc7, mummy_painc8 ] {}; +void() mummy_painc8 =[ $painc8, mummy_painc9 ] {}; +void() mummy_painc9 =[ $painc9, mummy_painc10 ] {}; +void() mummy_painc10 =[ $painc10, mummy_painc11 ] {}; +void() mummy_painc11 =[ $painc11, mummy_painc12 ] {ai_painforward(1);}; +void() mummy_painc12 =[ $painc12, mummy_painc13 ] {ai_painforward(1);}; +void() mummy_painc13 =[ $painc13, mummy_painc14 ] {}; +void() mummy_painc14 =[ $painc14, mummy_painc15 ] {}; +void() mummy_painc15 =[ $painc15, mummy_painc16 ] {}; +void() mummy_painc16 =[ $painc16, mummy_painc17 ] {}; +void() mummy_painc17 =[ $painc17, mummy_painc18 ] {}; +void() mummy_painc18 =[ $painc18, mummy_run1 ] {}; + +void() mummy_paind1 =[ $paind1, mummy_paind2 ] + {sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);}; +void() mummy_paind2 =[ $paind2, mummy_paind3 ] {}; +void() mummy_paind3 =[ $paind3, mummy_paind4 ] {}; +void() mummy_paind4 =[ $paind4, mummy_paind5 ] {}; +void() mummy_paind5 =[ $paind5, mummy_paind6 ] {}; +void() mummy_paind6 =[ $paind6, mummy_paind7 ] {}; +void() mummy_paind7 =[ $paind7, mummy_paind8 ] {}; +void() mummy_paind8 =[ $paind8, mummy_paind9 ] {}; +void() mummy_paind9 =[ $paind9, mummy_paind10 ] {ai_pain(1);}; +void() mummy_paind10 =[ $paind10, mummy_paind11 ] {}; +void() mummy_paind11 =[ $paind11, mummy_paind12 ] {}; +void() mummy_paind12 =[ $paind12, mummy_paind13 ] {}; +void() mummy_paind13 =[ $paind13, mummy_run1 ] {}; + +void() mummy_paine1 =[ $paine1, mummy_paine2 ] + { sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); }; +void() mummy_paine2 =[ $paine2, mummy_paine3 ] {ai_pain(8);}; +void() mummy_paine3 =[ $paine3, mummy_paine4 ] {ai_pain(5);}; +void() mummy_paine4 =[ $paine4, mummy_paine5 ] {ai_pain(3);}; +void() mummy_paine5 =[ $paine5, mummy_paine6 ] {ai_pain(1);}; +void() mummy_paine6 =[ $paine6, mummy_paine7 ] {ai_pain(2);}; +void() mummy_paine7 =[ $paine7, mummy_paine8 ] {ai_pain(1);}; +void() mummy_paine8 =[ $paine8, mummy_paine9 ] {ai_pain(1);}; +void() mummy_paine9 =[ $paine9, mummy_paine10 ] {ai_pain(2);}; +void() mummy_paine10 =[ $paine10, mummy_paine11 ] + { + sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; + }; +void() mummy_paine11 =[ $paine11, mummy_paine12 ] + { self.nextthink = self.nextthink + 5; }; +void() mummy_paine12 =[ $paine12, mummy_paine13 ] + { + // see if ok to stand up + sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.solid = SOLID_SLIDEBOX; + if(!walkmove(0, 0)) + { + self.think = mummy_paine11; + self.solid = SOLID_NOT; + return; + } + }; +void() mummy_paine13 =[ $paine13, mummy_paine14 ] {}; +void() mummy_paine14 =[ $paine14, mummy_paine15 ] {}; +void() mummy_paine15 =[ $paine15, mummy_paine16 ] {}; +void() mummy_paine16 =[ $paine16, mummy_paine17 ] {}; +void() mummy_paine17 =[ $paine17, mummy_paine18 ] {}; +void() mummy_paine18 =[ $paine18, mummy_paine19 ] {}; +void() mummy_paine19 =[ $paine19, mummy_paine20 ] {}; +void() mummy_paine20 =[ $paine20, mummy_paine21 ] {}; +void() mummy_paine21 =[ $paine21, mummy_paine22 ] {}; +void() mummy_paine22 =[ $paine22, mummy_paine23 ] {}; +void() mummy_paine23 =[ $paine23, mummy_paine24 ] {}; +void() mummy_paine24 =[ $paine24, mummy_paine25 ] {}; +void() mummy_paine25 =[ $paine25, mummy_paine26 ] {ai_painforward(5);}; +void() mummy_paine26 =[ $paine26, mummy_paine27 ] {ai_painforward(3);}; +void() mummy_paine27 =[ $paine27, mummy_paine28 ] {ai_painforward(1);}; +void() mummy_paine28 =[ $paine28, mummy_paine29 ] {ai_pain(1);}; +void() mummy_paine29 =[ $paine29, mummy_paine30 ] {}; +void() mummy_paine30 =[ $paine30, mummy_run1 ] + { }; + +void() mummy_die = +{ + self.health = -35; + sound(self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_zombie.mdl", self.health); + ThrowGib("progs/gib1.mdl", self.health); + ThrowGib("progs/gib2.mdl", self.health); + ThrowGib("progs/gib3.mdl", self.health); +}; + +/* +================= +mummy_pain +================= +*/ +void(entity attacker, float take) mummy_pain = +{ + float r; + + if(self.pain_finished > time) + return; + + r = random(); + if(r > 0.24) + return; + + self.pain_finished = time + 2.5; + + if(r < 0.06) + mummy_paina1(); + else if(r < 0.12) + mummy_painb1(); + else if(r < 0.18) + mummy_painc1(); + else + mummy_paind1(); +}; + +void() mummy_sleep = [ $paine11, mummy_sleep ] { ai_stand(); }; + +void() mummy_wake = +{ + self.th_stand = mummy_stand1; + self.th_walk = mummy_walk1; + self.th_pain = mummy_pain; + self.th_run = mummy_run1; + self.th_missile = mummy_missile; + + mummy_paine12(); +}; + +//============================================================================ + +float MUMMY_STRONG = 4; + +/*QUAKED monster_mummy (1 0 0) (-16 -16 -24) (16 16 32) Ambush Lying Stronger + +Lying - mummy will start lying down, and stand when player spotted. +Stronger - mummy starts with 1000 hitpoints, rather than 500. +*/ +void() monster_mummy = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model("progs/mummy.mdl"); + precache_model("progs/h_zombie.mdl"); + precache_model("progs/zom_gib.mdl"); + + precache_sound("zombie/z_idle.wav"); + precache_sound("zombie/z_idle1.wav"); + precache_sound("zombie/z_shot1.wav"); + precache_sound("zombie/z_gib.wav"); + precache_sound("zombie/z_pain.wav"); + precache_sound("zombie/z_pain1.wav"); + precache_sound("zombie/z_fall.wav"); + precache_sound("zombie/z_miss.wav"); + precache_sound("zombie/z_hit.wav"); + precache_sound("zombie/idle_w2.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/mummy.mdl"); + + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + if(self.spawnflags & MUMMY_STRONG) + self.health = 1000; + else + self.health = 500; + + self.th_stand = mummy_stand1; + self.th_walk = mummy_walk1; + self.th_run = mummy_run1; + self.th_pain = mummy_pain; + self.th_die = mummy_die; + self.th_missile = mummy_missile; + + if(self.spawnflags & SPAWN_LYING) + { + setsize(self, '-16 -16 -24', '16 16 -16'); + self.solid = SOLID_NOT; + self.th_stand = mummy_sleep; + self.th_run = mummy_wake; + self.th_walk = mummy_wake; + self.th_pain = asPainFn(mummy_wake); + self.th_missile = mummy_wake; + walkmonster_start(); + } + else + walkmonster_start(); +}; diff --git a/QC/rogue_new_ai.qc b/QC/rogue_new_ai.qc new file mode 100644 index 00000000..885efae1 --- /dev/null +++ b/QC/rogue_new_ai.qc @@ -0,0 +1,152 @@ +// new ai functions +// +// pmack + +// ================================================================ +// ai_orbit - used to have an object orbit an entity. +// +// destEnt: the entity to orbit +// radius: how large a radius to orbit at (0 will just track) +// offset: center of the orbit. this is added to dest.origin. +// +// Uses self.orbitPosition to determine current destination. +// ================================================================ +void(entity destEnt, float radius, vector offset) ai_orbit = +{ + vector dir; + float dist; + + if(self.orbitPosition > 3) + self.orbitPosition = 0; + else if(self.orbitPosition < 0) + self.orbitPosition = 0; + + traceline (self.origin, destEnt.origin + offset, TRUE, world); + if(trace_fraction < 1) + { + setorigin(self, destEnt.origin + offset); + self.orbitPosition = self.orbitPosition + 1; + return; + } + + if(self.orbitPosition == 0) + { + dir = (destEnt.origin + offset) - self.origin; + dir_x = dir_x + radius; + } + else if(self.orbitPosition == 1) + { + dir = (destEnt.origin + offset) - self.origin; + dir_y = dir_y + radius; + } + else if(self.orbitPosition == 2) + { + dir = (destEnt.origin + offset) - self.origin; + dir_x = dir_x - radius; + } + else + { + dir = (destEnt.origin + offset) - self.origin; + dir_y = dir_y - radius; + } + + dist = vlen(dir); + + if(dist < 8) + { + self.orbitPosition = self.orbitPosition + 1; + } + else if(dist < 50) + { + self.velocity = normalize(dir); + self.velocity = self.velocity * 150; + } + else + { + self.velocity = normalize(dir); + self.velocity = self.velocity * 500; + } +}; + +// ================================================================ +// ai_track - used to have an object chase/track an enemy. the object +// flies directly at the destEnt's view_ofs point. +// +// destEnt: the entity to orbit +// trackSpeed: the velocity multiplier (speed) of the object +// ================================================================ +void(entity destEnt, float trackSpeed) ai_track = +{ + vector dir; + + dir = destEnt.origin + destEnt.view_ofs; + dir = normalize(dir - self.origin); + self.velocity = dir * trackSpeed; +}; + +// ================================================================ +// ViolentDeath +// ================================================================ + +void(string gibname, float dm) AccelerateGib = +{ + entity new; + + float offset1; + + new = spawn(); + new.origin = self.origin; + setmodel(new, gibname); + setsize(new, '-8 -8 -8', '8 8 8'); + + new.velocity = -1.25 * self.velocity; + makevectors(new.velocity); + offset1 = random() * 300 - 150; + new.velocity = new.velocity + v_right * offset1; + offset1 = random() * 300 - 150; + new.velocity = new.velocity + v_up * offset1; + + + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.frame = 0; + new.flags = 0; +}; + +void(float gibCount) ViolentDeath = +{ + while(gibCount > 0) + { + AccelerateGib ("progs/gib1.mdl", (-4 * gibCount)); + AccelerateGib ("progs/gib2.mdl", (-6 * gibCount)); + AccelerateGib ("progs/gib3.mdl", (-8 * gibCount)); + gibCount = gibCount - 3; + } +}; + +entity(string gibname) StartGib = +{ + entity new; + + new = spawn(); + new.origin = self.origin; + setmodel(new, gibname); + setsize(new, '0 0 0', '0 0 0'); + + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.frame = 0; + new.flags = 0; + + return new; +}; + diff --git a/QC/rogue_newitems.qc b/QC/rogue_newitems.qc new file mode 100644 index 00000000..4d2a5b27 --- /dev/null +++ b/QC/rogue_newitems.qc @@ -0,0 +1,122 @@ +// New Items +// +// Items added for the Rogue XPACK. + +void() newitems_touch = +{ + if(other.classname != "player") + return; + + if(other.health <= 0) + return; + + // only one per person, please. + if(self.classname == "item_sphere") + { + if(VR_ItemUtil_EntHasItem(other, IID_V_SPHERE)) + { + return; + } + } + + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other,"\n"); + + if(deathmatch) + { + if(self.classname == "item_random_powerup") + { + self.nextthink = time + 60; + self.think = random_regen; + } + else if(self.classname == "item_sphere") + { + self.mdl = self.model; + self.nextthink = time + 60*3; + self.think = SUB_regen; + } + else + { + self.mdl = self.model; + self.nextthink = time + 60; + self.think = SUB_regen; + } + } + + sound(other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + stuffcmd(other, "bf\n"); + self.solid = SOLID_NOT; + + if(self.classname != "item_sphere") + { + VR_ItemUtil_EntAddItem(other, self.vr_itemId); + } + + self.model = string_null; + + // do the apropriate action + if(self.netname == "Power Shield") + { + other.shield_time = 1; + other.shield_finished = time + 30; + } + else if(self.netname == "Anti-Grav Belt") + { + other.antigrav_time = 1; + other.antigrav_finished = time + 45; + other.gravity = 0.25; + } + else if(self.classname == "item_sphere") + { + VR_ItemUtil_EntAddItem(other, IID_V_SPHERE); + sphere_spawn(); + } + + activator = other; + SUB_UseTargets(); // fire all targets / killtargets +}; + + +/*QUAKED item_powerup_shield (0 .5 .8) (-16 -16 -24) (16 16 32) +The shield upgrade +*/ +void() item_powerup_shield = +{ + self.handtouch = newitems_touch; + + precache_model("progs/shield.mdl"); + precache_model("progs/p_shield.mdl"); + precache_sound("shield/pickup.wav"); + precache_sound("shield/hit.wav"); + precache_sound("shield/fadeout.wav"); + self.noise = "shield/pickup.wav"; + setmodel(self, "progs/shield.mdl"); + self.netname = "Power Shield"; + self.vr_itemId = IID_SHIELD; + setsize(self, '-16 -16 -24', '16 16 32'); + StartItem(); +}; + +/*QUAKED item_powerup_belt (0 .5 .8) (-16 -16 -24) (16 16 32) +The anti-grav belt +*/ +void() item_powerup_belt = +{ + self.handtouch = newitems_touch; + + precache_model("progs/beltup.mdl"); + precache_sound("belt/pickup.wav"); + precache_sound("belt/use.wav"); + precache_sound("belt/fadeout.wav"); + self.noise = "belt/pickup.wav"; + setmodel(self, "progs/beltup.mdl"); + self.netname = "Anti-Grav Belt"; + self.vr_itemId = IID_ANTIGRAV; + setsize(self, '-16 -16 -24', '16 16 32'); + StartItem(); +}; + + + + diff --git a/QC/rogue_newmisc.qc b/QC/rogue_newmisc.qc new file mode 100644 index 00000000..b461dfeb --- /dev/null +++ b/QC/rogue_newmisc.qc @@ -0,0 +1,144 @@ +// Miscellaneous items used in the Rogue XPACK + + +/*QUAKED light_lantern (0 .5 0) (-10 -10 -20) (10 10 20) +Light-emitting lantern. +Default light value is 200 +Default style is 0 +*/ +void() light_lantern = +{ + precache_model("progs/lantern.mdl"); + setmodel(self, "progs/lantern.mdl"); + makestatic (self); +}; + +/*QUAKED light_candle (0 .5 0) (-4 -4 -10) (4 4 10) +Candle +Default light value is 200 +Default style is 0 +*/ +void() light_candle = +{ + precache_model("progs/candle.mdl"); + setmodel(self, "progs/candle.mdl"); + makestatic (self); +}; + +// ========================================== +// rubble generator +// ========================================== +void() rubble_touch = +{ + if(other.classname == "player" || other.flags & FL_MONSTER) + { + if(vlen(self.velocity) > 0) + { + T_Damage(other, self, self, 10); + } + } +}; + +void() rubble_throw = +{ + vector throw; + entity rubble; + + rubble = find(world, targetname, self.target); + throw = normalize(rubble.origin - self.origin); + throw_x = throw_x + (random() * 0.2) - 0.1; + throw_y = throw_y + (random() * 0.2) - 0.1; + throw_z = throw_z + (random() * 0.2) - 0.1; + + rubble = spawn(); + rubble.owner = self; + rubble.classname = "rubble"; + rubble.movetype = MOVETYPE_BOUNCE; + rubble.solid = SOLID_BBOX; + rubble.velocity = throw * 300; + setmodel(rubble, "progs/rubble.mdl"); + setsize(rubble, '-16 -16 -16', '16 16 16'); + setorigin(rubble, self.origin); + rubble.touch = rubble_touch; + + rubble.think = SUB_Remove; + rubble.nextthink = time + 30; + + if(self.spawnflags & 1) + rubble.skin = 1; + else + rubble.skin = 0; + + self.think = rubble_throw; + self.nextthink = time + self.delay; +}; + +void() rogue_rubble_use = +{ + if(self.wait == 0) + { + self.think = rubble_throw; + self.nextthink = time + self.delay; + self.wait = 1; + } + else + { + self.nextthink = time - 1; + self.wait = 0; + } +}; + +/*QUAKED rubble_generator (1 1 0) (-8 -8 -8) (8 8 8) LavaRock Active +Rubble Generator - cave colored rock chunks flung at the target. Triggering the generator will turn it off and on. + +LavaRock - a lava rock texture, based on rich's pumice +Active - start the generator immediately. + +delay - time between rubble pieces (Default 5 sec) +*/ +void() rubble_generator = +{ + precache_model("progs/rubble.mdl"); + + if(!self.target) + objerror ("rubble_generator has no target!"); + + if(!self.delay) + self.delay = 5; + + self.solid = SOLID_NOT; + self.use = rogue_rubble_use; + + if(self.spawnflags & 2) + rogue_rubble_use(); +}; + + +void() trigEx_die = +{ + SUB_UseTargets(); + + self.touch = SUB_Null; + self.nextthink = time + 0.1; + self.think = SUB_Remove; +}; + +/*QUAKED trigger_explosion (.5 .5 .5) ? +Variable sized repeatable trigger. Must be targeted at one or more entities. Only set off when killed, and is only damaged by T_RadiusDamage. + +health: amount of damage needed to set off trigger. +*/ +void() trigger_explosion = +{ + InitTrigger (); + + if(!self.health) + self.health = 20; + + self.max_health = self.health; + self.th_die = trigEx_die; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + setorigin(self, self.origin); // make sure it links into the world +}; + diff --git a/QC/rogue_newplats.qc b/QC/rogue_newplats.qc new file mode 100644 index 00000000..36ad6910 --- /dev/null +++ b/QC/rogue_newplats.qc @@ -0,0 +1,598 @@ +// newplats.qc +// pmack +// september 1996 + +// TYPES + +float DN_N_WAIT = 1; +float PLT_TOGGLE = 2; +float ELEVATOR = 4; +float START_AT_TOP = 8; +float PLAT2 = 16; +float PLAT2_BOTTOM = 32; + +float ELV_BUTN_DIR; + +// ================================== +// down N and wait code +// ================================== + +void() dn_and_wait_hit_top = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; +}; + +void() dn_and_wait_hit_bottom = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + self.think = dn_and_wait_go_up; + self.nextthink = self.ltime + self.health; +}; + +void() dn_and_wait_go_down = +{ + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, dn_and_wait_hit_bottom); +}; + +void() dn_and_wait_go_up = +{ + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, dn_and_wait_hit_top); +}; + +void() dn_and_wait_crush = +{ + T_Damage(other, self, self, 1); + + if(self.state == STATE_UP) + dn_and_wait_go_down (); + else if(self.state == STATE_DOWN) + dn_and_wait_go_up (); + else + objerror ("plat_new_crush: bad self.state\n"); +}; + +void() dn_and_wait_use = +{ + if(self.state != STATE_TOP) + return; + + dn_and_wait_go_down (); +}; + +// ================================== +// toggle type code +// ================================== + +void() toggle_go_up; +void() toggle_go_down; +void() toggle_crush; + +void() toggle_hit_top = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; +}; + +void() toggle_hit_bottom = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; +}; + +void() toggle_go_down = +{ + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, toggle_hit_bottom); +}; + +void() toggle_go_up = +{ + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, toggle_hit_top); +}; + +void() toggle_crush = +{ + T_Damage(other, self, self, 1); + + if(self.state == STATE_UP) + toggle_go_down (); + else if(self.state == STATE_DOWN) + toggle_go_up (); + else + objerror ("plat_new_crush: bad self.state\n"); +}; + +void() toggle_use = +{ + if(self.state == STATE_TOP) + toggle_go_down (); + else if(self.state == STATE_BOTTOM) + toggle_go_up (); +}; + +// ================================== +// elvtr type code +// ================================== + +void() elvtr_crush; + +void() elvtr_stop = +{ + self.elevatorOnFloor = self.elevatorToFloor; + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + self.elevatorLastUse = time; +}; + +void() elvtr_go = +{ + self.elevatorDestination = self.pos2; + self.elevatorDestination_z = self.pos2_z + + (self.height * self.elevatorToFloor); + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.elevatorDestination, self.speed, elvtr_stop); + self.elevatorLastUse = time; +}; + +void() elvtr_crush = +{ +// T_Damage(other, self, self, 1); + self.elevatorToFloor = self.elevatorOnFloor; + + elvtr_go (); +}; + +// =============== +// elevator use function +// self = plat, other = elevator button, other.enemy = player +// =============== +void() elvtr_use = +{ + float tempDist, elvPos, btnPos; + + if((self.elevatorLastUse + 2) > time) + return; + + self.elevatorLastUse = time; + + if(ELV_BUTN_DIR == 0) + return; + + elvPos = (self.absmin_z + self.absmax_z) * 0.5; + btnPos = (other.absmin_z + other.absmax_z) * 0.5; + + if(elvPos > btnPos) + { + tempDist = (elvPos - btnPos) / self.height; + tempDist = ceil (tempDist); + self.elevatorToFloor = self.elevatorOnFloor - tempDist; + elvtr_go (); + return; + } + else + { + tempDist = btnPos - elvPos; + if(tempDist > self.height) + { + tempDist = tempDist / self.height; + tempDist = floor (tempDist); + self.elevatorToFloor = self.elevatorOnFloor + tempDist; + elvtr_go (); + return; + } + } + + if(ELV_BUTN_DIR == -1) + { + if(self.elevatorOnFloor > 0) + { + self.elevatorToFloor = self.elevatorOnFloor - 1; + elvtr_go (); + } + } + else if(ELV_BUTN_DIR == 1) + { + if(self.elevatorOnFloor < (self.cnt - 1)) + { + self.elevatorToFloor = self.elevatorOnFloor + 1; + elvtr_go (); + } + } +}; + +// ================================== +// PLAT2 type code +// ================================== + +void() plat2_center_touch; +void() plat2_go_up; +void() plat2_go_down; +void() plat2_crush; + +void() plat2_spawn_inside_trigger = +{ + entity trigger; + vector tmin, tmax; + +// +// middle trigger +// + trigger = spawn(); + trigger.touch = plat2_center_touch; + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + trigger.enemy = self; + + tmin = self.mins + '25 25 0'; + tmax = self.maxs - '25 25 -8'; + tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); + + if(self.spawnflags & PLAT_LOW_TRIGGER) + tmax_z = tmin_z + 8; + + if(self.size_x <= 50) + { + tmin_x = (self.mins_x + self.maxs_x) / 2; + tmax_x = tmin_x + 1; + } + if(self.size_y <= 50) + { + tmin_y = (self.mins_y + self.maxs_y) / 2; + tmax_y = tmin_y + 1; + } + + setsize(trigger, tmin, tmax); +}; + +void() plat2_hit_top = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; + + self.plat2LastMove = time; + if(self.plat2Called == 1) + { + self.think = plat2_go_down; + self.nextthink = self.ltime + 1.5; + self.plat2Called = 0; + self.plat2LastMove = 0; // allow immediate move + } + else if(!(self.spawnflags & START_AT_TOP)) + { + self.think = plat2_go_down; + self.nextthink = self.ltime + self.delay; + self.plat2Called = 0; + } +}; + +void() plat2_hit_bottom = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + + self.plat2LastMove = time; + if(self.plat2Called == 1) + { + self.think = plat2_go_up; + self.nextthink = self.ltime + 1.5; + self.plat2Called = 0; + self.plat2LastMove = 0; // allow immediate move + } + else if(self.spawnflags & START_AT_TOP) + { + self.think = plat2_go_up; + self.nextthink = self.ltime + self.delay; + self.plat2Called = 0; + } +}; + +void() plat2_go_down = +{ + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, plat2_hit_bottom); +}; + +void() plat2_go_up = +{ + sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, plat2_hit_top); +}; + +void() plat2_use = +{ + if(self.state > 4) + self.state = self.state - 10; + + self.use = SUB_Null; +}; + +void() plat2_center_touch = +{ + float otherState; + vector platPosition; + + if(other.classname != "player") + return; + + if(other.health <= 0) + return; + + // at this point, self is the trigger. self.enemy is the plat. + // this changes self to be the plat, other is the player. + self = self.enemy; + + if((self.plat2LastMove + 2) > time) + return; + + if(self.state > 4) // disabled. + return; + + if(self.plat2GoTo > STATE_BOTTOM) + { + if(self.plat2GoTime < time) + { + if(self.plat2GoTo == STATE_UP) + plat2_go_up(); + else + plat2_go_down(); + + self.plat2GoTo = 0; + } + return; + } + + if(self.state > STATE_BOTTOM) // STATE_UP or STATE_DOWN + return; + + platPosition = (self.absmax + self.absmin) * 0.5; + + if(self.state == STATE_TOP) + { + otherState = STATE_TOP; + if(platPosition_z > other.origin_z) + otherState = STATE_BOTTOM; + } + else + { + otherState = STATE_BOTTOM; + if((other.origin_z - platPosition_z) > self.height) + otherState = STATE_TOP; + } + + if(self.state == otherState) + { + self.plat2Called = 0; + self.plat2GoTime = time + 0.5; + } + else + { + self.plat2GoTime = time + 0.1; + self.plat2Called = 1; + } + + if(self.state == STATE_BOTTOM) + self.plat2GoTo = STATE_UP; + else if(self.state == STATE_TOP) + self.plat2GoTo = STATE_DOWN; +}; + +void() plat2_crush = +{ + T_Damage(other, self, self, 1); + + if(self.state == STATE_UP) + plat2_go_down (); + else if(self.state == STATE_DOWN) + plat2_go_up (); + else + objerror ("plat2_crush: bad self.state\n"); +}; + +// ================================== +// Common Plat Code +// ================================== + +/*QUAKED func_new_plat (0 .5 .8) ? DN_N_WAIT PLT_TOGGLE ELEVATOR START_AT_TOP PLAT2 P2_BOTTOM + +-------------- +DN_N_WAIT is a plat that starts at the top and when triggered, goes down, waits, then comes back up. +health - number of seconds to wait (default 5) + +-------------- +PLT_TOGGLE is a plat that will change between the top and bottom each time it is triggered. + +-------------- +ELEVATOR is an elevator plat. You can have as many levels as you want but they must be all the same distance away. Use elevator button entity as the trigger. + cnt is the number of floors + height is the distance between floors + +START_AT_TOP is an optional flag for elevators. It just tells the elevator that it's position is the top floor. (Default is the bottom floor) USE THIS ONLY WITH ELEVATORS! + +-------------- +PLAT2 is a fixed version of the original plat. If you want the plat to start at the bottom and move to the top on demand, use a negative height. That will tell Quake to lower the plat at spawn time. Always place this plat type in the top position when making the map. This will ensure correct lighting, hopefully. If a plat2 is the target of a trigger, it will be disabled until it has been triggered. Delay is the wait before the plat returns to original position. + +If you don't want to bother figuring out the height, don't put a +value in the height + +delay default 3 +speed default 150 +cnt default 2 + +P2_BOTTOM is an optional switch to have an auto-sized plat2 start at the bottom. +-------------- +Plats are always drawn in the extended position, so they will light correctly. + +If the plat is the target of another trigger or button, it will start out disabled in the extended position until it is trigger, when it will lower and become a normal plat. + +If the "height" key is set, that will determine the amount the plat moves, instead of being implicitly determined by the model's height. +Set "sounds" to one of the following: +1) base fast +2) chain slow +*/ + +void() func_new_plat = +{ +//entity t; +float negativeHeight; + + negativeHeight = 0; + + if(!self.t_length) + self.t_length = 80; + if(!self.t_width) + self.t_width = 10; + + if(self.sounds == 0) + self.sounds = 2; +// FIX THIS TO LOAD A GENERIC PLAT SOUND + + if(self.sounds == 1) + { + precache_sound("plats/plat1.wav"); + precache_sound("plats/plat2.wav"); + self.noise = "plats/plat1.wav"; + self.noise1 = "plats/plat2.wav"; + } + + if(self.sounds == 2) + { + precache_sound("plats/medplat1.wav"); + precache_sound("plats/medplat2.wav"); + self.noise = "plats/medplat1.wav"; + self.noise1 = "plats/medplat2.wav"; + } + + + self.mangle = self.angles; + self.angles = '0 0 0'; + + self.classname = "plat"; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin(self, self.origin); + setmodel(self, self.model); + setsize(self, self.mins , self.maxs); + + if(!self.speed) + self.speed = 150; + +// pos1 is the top position, pos2 is the bottom + self.pos1 = self.origin; + self.pos2 = self.origin; + + if(self.height < 0) + { + negativeHeight = 1; + self.height = 0 - self.height; + } + + if(self.height) + self.pos2_z = self.origin_z - self.height; + else + { + negativeHeight = 1; + self.height = self.size_z - 8; + self.pos2_z = self.origin_z - self.height; + } + + if(self.spawnflags & DN_N_WAIT) + { + self.use = dn_and_wait_use; + self.blocked = dn_and_wait_crush; + + if(negativeHeight == 1) + { + self.state = STATE_BOTTOM; + setorigin(self, self.pos2); + } + else + self.state = STATE_TOP; + + if(!self.health) + self.health = 5; + } + else if(self.spawnflags & PLT_TOGGLE) + { + self.use = toggle_use; + self.blocked = toggle_crush; + if(negativeHeight == 1) + { + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + } + else + { + self.state = STATE_TOP; + } + } + else if(self.spawnflags & ELEVATOR) + { + self.elevatorOnFloor = 0; + self.elevatorToFloor = 0; + self.elevatorLastUse = 0; + + if(self.spawnflags & START_AT_TOP) + { + self.pos1 = self.origin; + self.pos2 = self.origin; + self.pos2_z = self.origin_z - (self.height * (self.cnt - 1)); + self.elevatorOnFloor = self.cnt - 1; + } + else + { + self.pos1 = self.origin; + self.pos2 = self.origin; + self.pos1_z = self.origin_z + (self.height * (self.cnt - 1)); + self.elevatorOnFloor = 0; + } + + self.use = elvtr_use; + self.blocked = elvtr_crush; + } + else if(self.spawnflags & PLAT2) + { + plat2_spawn_inside_trigger (); // the "start moving" trigger + self.plat2Called = 0; + self.plat2LastMove = 0; + self.plat2GoTo = 0; + self.plat2GoTime = 0; + self.blocked = plat2_crush; + + if(!self.delay) + self.delay = 3; + + if(negativeHeight == 1) + { + self.state = STATE_BOTTOM; + // make sure START_AT_TOP isn't set. We need that... + self.spawnflags = PLAT2; + setorigin(self, self.pos2); + } + else + { + // default position is top. + self.spawnflags = self.spawnflags | START_AT_TOP; + self.state = STATE_TOP; + } + + if(self.targetname != NULLSTR) + { + self.use = plat2_use; + self.state = self.state + 10; + } + } + +}; + diff --git a/QC/rogue_pendulum.qc b/QC/rogue_pendulum.qc new file mode 100644 index 00000000..fc98a48f --- /dev/null +++ b/QC/rogue_pendulum.qc @@ -0,0 +1,389 @@ +// pendulum.qc + +$frame frame1 frame2 frame3 frame4 frame5 frame6 frame7 +$frame frame8 frame9 frame10 frame11 frame12 frame13 + +float impactVelocity; + +//float pend_frame; + +float PEND_X = 1; +float PEND_Y = 2; +float PEND_Z = 4; +float PEND_TRG = 8; + +/* +void() pend_stand =[ $frame4, pend_stand ] {}; +*/ + +void() pend_swing1 =[ $frame1, pend_swing2 ] +{ +//// pend_frame = 1; +// 0 -148 88 (center) W 56, H 80 (28,40) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -176 48', '8 -120 128'); + else if(self.spawnflags & PEND_X) + setsize(self, '-176 -8 48', '-120 8 128'); + self.nextthink = time + 0.17; + impactVelocity = 1; +}; +void() pend_swing2 =[ $frame2, pend_swing3 ] +{ +//// pend_frame = pend_frame + 1; +// 0 -142 50 (center) W 60, H 76 (30, 38) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -172 12', '8 -112 88'); + else if(self.spawnflags & PEND_X) + setsize(self, '-172 -8 12', '-112 8 88'); + self.nextthink = time + 0.15; +}; +void() pend_swing3 =[ $frame3, pend_swing4 ] +{ +//// pend_frame = pend_frame + 1; +// 0 -128 14 (center) W 64, H 72 (32, 36) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -160 -22', '8 -96 50'); + else if(self.spawnflags & PEND_X) + setsize(self, '-160 -8 -22', '-96 8 50'); + self.nextthink = time + 0.13; +}; +void() pend_swing4 =[ $frame4, pend_swing5 ] +{ + sound(self, CHAN_AUTO, "pendulum/swing.wav", 0.5, ATTN_NORM); + +//// pend_frame = pend_frame + 1; +// 0 -104 -17 (center) W 68, H 68 (34, 34) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -138 -51', '8 -70 17'); + else if(self.spawnflags & PEND_X) + setsize(self, '-138 -8 -51', '-70 8 17'); + self.nextthink = time + 0.11; +}; +void() pend_swing5 =[ $frame5, pend_swing6 ] +{ +// pend_frame = pend_frame + 1; +// 0 -74 40 (center) W 72, H 64 (36, 32) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -110 -72', '8 -38 -8'); + else if(self.spawnflags & PEND_X) + setsize(self, '-110 -8 -72', '-38 8 -8'); + self.nextthink = time + 0.09; +}; +void() pend_swing6 =[ $frame6, pend_swing7 ] +{ +// pend_frame = pend_frame + 1; +// 0 -38 53 (center) W 76, H 60 (38, 30) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -76 -83', '8 0 -23'); + else if(self.spawnflags & PEND_X) + setsize(self, '-76 -8 -83', '0 8 -23'); + self.nextthink = time + 0.07; +}; +void() pend_swing7 =[ $frame7, pend_swing8 ] +{ +// pend_frame = pend_frame + 1; +// 0 0 60 (center) W 80, H 56 (40, 28) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -40 -88', '8 40 -32'); + else if(self.spawnflags & PEND_X) + setsize(self, '-40 -8 -88', '40 8 -32'); + self.nextthink = time + 0.05; +}; +void() pend_swing8 =[ $frame8, pend_swing9 ] +{ +// pend_frame = pend_frame + 1; +// 0 38 53 (center) W 76, H 60 (38, 30) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 0 -83', '8 76 -23'); + else if(self.spawnflags & PEND_X) + setsize(self, '0 -8 -83', '76 8 -23'); + self.nextthink = time + 0.07; +}; +void() pend_swing9 =[ $frame9, pend_swing10 ] +{ +// pend_frame = pend_frame + 1; +// 0 74 40 (center) W 72, H 64 (36, 32) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 38 -72', '8 100 -8'); + else if(self.spawnflags & PEND_X) + setsize(self, '38 -8 -72', '100 8 -8'); + self.nextthink = time + 0.09; +}; +void() pend_swing10 =[ $frame10, pend_swing11 ] +{ +// pend_frame = pend_frame + 1; +// 0 104 17 (center) W 68, H 68 (34, 34) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 70 -51', '8 138 17'); + else if(self.spawnflags & PEND_X) + setsize(self, '70 -8 -51', '138 8 17'); + self.nextthink = time + 0.11; +}; +void() pend_swing11 =[ $frame11, pend_swing12 ] +{ +// pend_frame = pend_frame + 1; +// 0 128 -14 (center) W 64, H 72 (32, 36) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 96 -22', '8 160 50'); + else if(self.spawnflags & PEND_X) + setsize(self, '96 -8 -22', '160 8 50'); + self.nextthink = time + 0.13; +}; +void() pend_swing12 =[ $frame12, pend_swing13 ] +{ +// pend_frame = pend_frame + 1; +// 0 142 -50 (center) W 60, H 76 (30, 38) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 112 12', '8 172 88'); + else if(self.spawnflags & PEND_X) + setsize(self, '112 -8 12', '172 8 88'); + self.nextthink = time + 0.15; +}; +void() pend_swing13 =[ $frame13, pend_swing14 ] +{ +// pend_frame = pend_frame + 1; +// 0 148 -88 (center) W 56, H 80 (28, 40) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 120 48', '8 176 128'); + else if(self.spawnflags & PEND_X) + setsize(self, '120 -8 48', '176 8 128'); + self.nextthink = time + 0.17; +}; +void() pend_swing14 =[ $frame13, pend_swing15 ] +{ +// pend_frame = pend_frame + 1; + // same frame, same location. no change to bbox. + self.nextthink = time + 0.17; +}; + +void() pend_swing15 =[ $frame12, pend_swing16 ] +{ +// pend_frame = pend_frame + 1; +// 0 142 -50 (center) W 60, H 76 (30, 38) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 112 12', '8 172 88'); + else if(self.spawnflags & PEND_X) + setsize(self, '112 -8 12', '172 8 88'); + self.nextthink = time + 0.15; + impactVelocity = -1; +}; +void() pend_swing16 =[ $frame11, pend_swing17 ] +{ +// pend_frame = pend_frame + 1; +// 0 128 -14 (center) W 64, H 72 (32, 36) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 96 -22', '8 160 50'); + else if(self.spawnflags & PEND_X) + setsize(self, '96 -8 -22', '160 8 50'); + self.nextthink = time + 0.13; +}; +void() pend_swing17 =[ $frame10, pend_swing18 ] +{ + sound(self, CHAN_AUTO, "pendulum/swing.wav", 0.5, ATTN_NORM); + +// pend_frame = pend_frame + 1; +// 0 104 17 (center) W 68, H 68 (34, 34) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 70 -51', '8 138 17'); + else if(self.spawnflags & PEND_X) + setsize(self, '70 -8 -51', '138 8 17'); + self.nextthink = time + 0.11; +}; +void() pend_swing18 =[ $frame9, pend_swing19 ] +{ +// pend_frame = pend_frame + 1; +// 0 74 40 (center) W 72, H 64 (36, 32) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 38 -72', '8 100 -8'); + else if(self.spawnflags & PEND_X) + setsize(self, '38 -8 -72', '100 8 -8'); + self.nextthink = time + 0.09; +}; +void() pend_swing19 =[ $frame8, pend_swing20 ] +{ +// pend_frame = pend_frame + 1; +// 0 38 53 (center) W 76, H 60 (38, 30) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 0 -83', '8 76 -23'); + else if(self.spawnflags & PEND_X) + setsize(self, '0 -8 -83', '76 8 -23'); + self.nextthink = time + 0.07; +}; +void() pend_swing20 =[ $frame7, pend_swing21 ] +{ +// pend_frame = pend_frame + 1; +// 0 0 60 (center) W 80, H 56 (40, 28) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -40 -88', '8 40 -32'); + else if(self.spawnflags & PEND_X) + setsize(self, '-40 -8 -88', '40 8 -32'); + self.nextthink = time + 0.05; +}; +void() pend_swing21 =[ $frame6, pend_swing22 ] +{ +// pend_frame = pend_frame + 1; +// 0 -38 53 (center) W 76, H 60 (38, 30) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -76 -83', '8 0 -23'); + else if(self.spawnflags & PEND_X) + setsize(self, '-76 -8 -83', '0 8 -23'); + self.nextthink = time + 0.07; +}; +void() pend_swing22 =[ $frame5, pend_swing23 ] +{ +// pend_frame = pend_frame + 1; +// 0 -74 40 (center) W 72, H 64 (36, 32) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -110 -72', '8 -28 -8'); + else if(self.spawnflags & PEND_X) + setsize(self, '-110 -8 -72', '-28 8 -8'); + self.nextthink = time + 0.09; +}; +void() pend_swing23 =[ $frame4, pend_swing24 ] +{ +// pend_frame = pend_frame + 1; +// 0 -104 17 (center) W 68, H 68 (34, 34) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -172 -51', '8 -70 17'); + else if(self.spawnflags & PEND_X) + setsize(self, '-172 -8 -51', '-70 8 17'); + self.nextthink = time + 0.11; +}; +void() pend_swing24 =[ $frame3, pend_swing25 ] +{ +// pend_frame = pend_frame + 1; +// 0 -128 -14 (center) W 64, H 72 (32, 36) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -160 -22', '8 -96 50'); + else if(self.spawnflags & PEND_X) + setsize(self, '-160 -8 -22', '-96 8 50'); + self.nextthink = time + 0.13; +}; +void() pend_swing25 =[ $frame2, pend_swing26 ] +{ +// pend_frame = pend_frame + 1; +// 0 -142 -50 (center) W 60, H 76 (30, 38) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -172 12', '8 -112 88'); + else if(self.spawnflags & PEND_X) + setsize(self, '-172 -8 12', '-112 8 88'); + self.nextthink = time + 0.15; +}; +void() pend_swing26 =[ $frame1, pend_swing1 ] +{ +// pend_frame = pend_frame + 1; +// 0 -148 -88 (center) W 56, H 80 (28,40) + if(self.spawnflags & PEND_Y) + setsize(self, '-8 -176 48', '8 -120 128'); + else if(self.spawnflags & PEND_X) + setsize(self, '-176 -8 48', '-120 8 128'); + self.nextthink = time + 0.17; +}; + +void() pend_touch = +{ + if(other.health < 1 || other.takedamage == DAMAGE_NO) + return; + + if(self.attack_finished < time) + { + sound(self, CHAN_VOICE, "pendulum/hit.wav", 1, ATTN_NORM); + self.attack_finished = time + 1; + } + + T_Damage(other, self, self, self.currentammo); + + // Fling the impactee in the direction the blade was swinging. + if(self.spawnflags & PEND_Y) + { +// other.velocity_y = other.velocity_y - impactVelocity * 250; + other.velocity_y = impactVelocity * -250; + } + else if(self.spawnflags & PEND_X) + { +// other.velocity_x = other.velocity_x + impactVelocity * 250; + other.velocity_x = impactVelocity * 250; + } + + // Fling the impactee up a little bit. +// other.velocity_z = other.velocity_z + 200; + other.velocity_z = 200; + + SpawnMeatSpray (other.origin, other.velocity); +}; + +void() pend_use = +{ + self.nextthink = time + self.delay; + self.think = pend_swing1; +}; + + +/*QUAKED pendulum (0 .5 .8) (-8 -24 -100) (8 24 100) PEND_X PEND_Y PEND_TRG +The Pendulum + +Values: +delay - amount of time (in seconds) before starting swinging. default 1. +currentammo - amount of damage for each contact. default 5. + +Directional Flags: Pendulum swings perpendicular to it's angle. (eg. A pendulum facing east will swing north/south). + +Default: PEND_Y + +The pendulum angle is set automatically depending on the PEND_ choice. + +PEND_X - a pendulum hanging from the ceiling swinging parallel to the X axis. +PEND_Y - a pendulum hanging from the ceiling swinging parallel to the Y axis. + +PEND_TRG - the pendulum must be triggered to start swinging. The delay value still affects the pendulum. +*/ +void() pendulum = +{ + precache_model("progs/pendulum.mdl"); + precache_sound("pendulum/swing.wav"); + precache_sound("pendulum/hit.wav"); + + setmodel(self, "progs/pendulum.mdl"); + + if(!self.spawnflags) + self.spawnflags = self.spawnflags + PEND_Y; + + if(self.spawnflags & PEND_Y) + { + setsize(self, '-8 -24 -100', '8 24 100'); + self.angles = '0 0 0'; + self.v_angle = '0 0 0'; +// if(self.angles_y != 0) +// self.angles_y = 0; + } + else if(self.spawnflags & PEND_X) + { + setsize(self, '-24 -8 -100', '24 8 100'); + self.angles = '0 270 0'; + self.v_angle = '0 270 0'; +// if(self.angles_y != 270) +// self.angles_y = 270; + } + else + error ("ERROR: Unimplemented Pendulum Type (pendulum.qc)"); + + if(!self.currentammo) + self.currentammo = 5; + if(!self.delay) + self.delay = 1; + + impactVelocity = 0; + self.solid = SOLID_TRIGGER; + self.takedamage = DAMAGE_NO; + self.touch = pend_touch; + + if(self.spawnflags & PEND_TRG) + { + self.use = pend_use; + } + else + { + self.nextthink = time + self.delay; + self.think = pend_swing1; + } +}; diff --git a/QC/rogue_random.qc b/QC/rogue_random.qc new file mode 100644 index 00000000..aed2edac --- /dev/null +++ b/QC/rogue_random.qc @@ -0,0 +1,111 @@ +// Random.qc + +// ======================================================= +// Random Items! +// ======================================================= + +// equal divisions of 1: +// 5: 0.2, 0.4, 0.6, 0.8, 1 +// 6: 0.16, 0.33, 0.48, 0.66, 0.83, 1 +// 7: 0.14, 0.28, 0.43, 0.56, 0.71, 0.86, 1 +// 8: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 +void() random_pick_type = +{ + float randItem; + + randItem = random(); + + self.touch = powerup_touch; + setsize(self, '-16 -16 -24', '16 16 32'); + + if(randItem < 0.2) + { + self.handtouch = newitems_touch; + self.noise = "shield/pickup.wav"; + setmodel(self, "progs/shield.mdl"); + self.netname = "Power Shield"; + self.vr_itemId = IID_SHIELD; + } + else if(randItem < 0.4) + { + self.handtouch = newitems_touch; + self.noise = "belt/pickup.wav"; + setmodel(self, "progs/beltup.mdl"); + self.netname = "Anti-Grav Belt"; + self.vr_itemId = IID_ANTIGRAV; + } + else if(randItem < 0.6) + { + self.noise = "items/protect.wav"; + setmodel(self, "progs/invulner.mdl"); + self.classname = "item_artifact_invulnerability"; + self.netname = "Pentagram of Protection"; + self.vr_itemId = IID_INVULNERABILITY; + } + else if(randItem < 0.8) + { + self.noise = "items/inv1.wav"; + setmodel(self, "progs/invisibl.mdl"); + self.classname = "item_artifact_invisibility"; + self.netname = "Ring of Shadows"; + self.vr_itemId = IID_INVISIBILITY; + } + else + { + self.noise = "items/damage.wav"; + setmodel(self, "progs/quaddama.mdl"); + self.classname = "item_artifact_super_damage"; + self.netname = "Quad Damage"; + self.vr_itemId = IID_QUAD; + } +}; + +/*QUAKED item_random_powerup (0 .5 .8) (-16 -16 -24) (16 16 32) +The Random Box! + +Contains a random powerup. +*/ +void() item_random_powerup = +{ + if(!deathmatch) + { + remove(self); + return; + } + + // Precache the lot of it.... + precache_model("progs/shield.mdl"); + precache_model("progs/p_shield.mdl"); + precache_model("progs/beltup.mdl"); + precache_model("progs/invulner.mdl"); + precache_model("progs/invisibl.mdl"); + precache_model("progs/quaddama.mdl"); + + precache_sound("items/inv1.wav"); + precache_sound("items/inv2.wav"); + precache_sound("items/inv3.wav"); + precache_sound("items/protect.wav"); + precache_sound("items/protect2.wav"); + precache_sound("items/protect3.wav"); + precache_sound("items/damage.wav"); + precache_sound("items/damage2.wav"); + precache_sound("items/damage3.wav"); + + + precache_sound("belt/pickup.wav"); + precache_sound("belt/use.wav"); + precache_sound("belt/fadeout.wav"); + precache_sound("shield/pickup.wav"); + precache_sound("shield/hit.wav"); + precache_sound("shield/fadeout.wav"); + + random_pick_type(); + StartItem(); +}; + +void() random_regen = +{ + random_pick_type(); + SUB_regen(); +}; + diff --git a/QC/rogue_runes.qc b/QC/rogue_runes.qc new file mode 100644 index 00000000..4193b29c --- /dev/null +++ b/QC/rogue_runes.qc @@ -0,0 +1,222 @@ +// Rogue Runes +// Jan'97 by ZOID <zoid@threewave.com> +// Under contract to id software for Rogue Entertainment + +.float rune; // what rune does this guy have? +.float runetime; // last time we told him he's already got a rune + +.float rune1_last_noise_time; +.float rune2_last_noise_time; +.float rune3_last_noise_time; +.float rune4_last_regen_time; + +float runespawn; // have we spawned runes? +entity rune_spawn_spot; // spawn spot for runes + +float ITEM_RUNE1 = 1; // Rune of Earth Magic: Resistance +float ITEM_RUNE2 = 2; // Rune of Black Magic: Strength +float ITEM_RUNE3 = 4; // Rune of Hell Magic: Haste +float ITEM_RUNE4 = 8; // Rune of Edler Magic: Regeneration + +void() RuneTouch = +{ + if(other.classname != "player" || other.health <= 0) + return; + + if(other.rune) { + if(other.runetime < time) + centerprint(other, "You already have a rune\n"); + other.runetime = time + 5; + return; + } + + other.rune = other.rune | self.rune; + + sound(other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); + + if(self.rune & ITEM_RUNE1) + centerprint(other, "Earth Magic\n\nRESISTANCE"); + else if(self.rune & ITEM_RUNE2) + centerprint(other, "Black Magic\n\nSTRENGTH"); + else if(self.rune & ITEM_RUNE3) + centerprint(other, "Hell Magic\n\nHASTE"); + else if(self.rune & ITEM_RUNE4) + centerprint(other, "Edler Magic\n\nRegeneration"); + remove(self); +}; + +entity() RuneSpawnPoint = +{ + while (1) { + rune_spawn_spot = find(rune_spawn_spot, classname, + "info_player_deathmatch"); + + if(rune_spawn_spot != world) + return rune_spawn_spot; + } +}; + +void() RuneRespawn = +{ + entity spot; + + spot = RuneSpawnPoint(); + setorigin(self, spot.origin); + + self.velocity_z = 300; + self.velocity_x = -300 + (random() * 600); + self.velocity_y = -300 + (random() * 600); + + self.nextthink = time + 120; +}; + +void(float r, entity spot) SpawnRune = +{ + entity item; + + if(spot == world) + spot = RuneSpawnPoint(); + + item = spawn(); + + setorigin(item, spot.origin); + item.rune = r; + item.velocity_z = 300; + item.velocity_x = -300 + (random() * 600); + item.velocity_y = -300 + (random() * 600); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + + if(r & ITEM_RUNE1) + setmodel(item, "progs/end1.mdl"); + else if(r & ITEM_RUNE2) + setmodel(item, "progs/end2.mdl"); + else if(r & ITEM_RUNE3) + setmodel(item, "progs/end3.mdl"); + else if(r & ITEM_RUNE4) + setmodel(item, "progs/end4.mdl"); + + setsize(item, '-16 -16 0', '16 16 56'); + item.touch = RuneTouch; + + item.nextthink = time + 120; // remove after 2 minutes + item.think = RuneRespawn; +}; + +// self is player +void() DropRune = +{ + if(self.rune & ITEM_RUNE1) + SpawnRune(ITEM_RUNE1, self); + if(self.rune & ITEM_RUNE2) + SpawnRune(ITEM_RUNE2, self); + if(self.rune & ITEM_RUNE3) + SpawnRune(ITEM_RUNE3, self); + if(self.rune & ITEM_RUNE4) + SpawnRune(ITEM_RUNE4, self); + self.rune = 0; +}; + +void() DoSpawnRunes = +{ + remove(self); + + SpawnRune(ITEM_RUNE1, world); + SpawnRune(ITEM_RUNE2, world); + SpawnRune(ITEM_RUNE3, world); + SpawnRune(ITEM_RUNE4, world); +}; + +void() SpawnRunes = +{ + entity spawner; + + if(!deathmatch || !(cvar_hget(cvarh_gamecfg) & GAMECFG_ENABLE_RUNES) || runespawn) + return; + + runespawn = 1; + spawner = spawn(); + spawner.think = DoSpawnRunes; + spawner.nextthink = time + 0.1; +}; + +float(float damage, entity who) RuneApplyEarth = +{ + if(who.rune & ITEM_RUNE1) { + if(who.rune1_last_noise_time < time) { + sound(who, CHAN_ITEM, "runes/end1.wav", 1, ATTN_NORM); + // tune as needed + who.rune1_last_noise_time = time + 1.0; + } + return damage/2; + } + return damage; +}; + +void(entity who) RuneApplyBlackNoise = +{ + if(who.rune & ITEM_RUNE2) + if(who.rune2_last_noise_time < time) { + sound(who, CHAN_ITEM, "runes/end2.wav", 1, ATTN_NORM); + // tune as needed + who.rune2_last_noise_time = time + 1.0; + } +}; + +float(float damage, entity who) RuneApplyBlack = +{ + if(who.rune & ITEM_RUNE2) + return damage*2; + return damage; +}; + +float(float tvalue, entity who) RuneApplyHell = +{ + if(who.rune & ITEM_RUNE3) { + if(who.rune3_last_noise_time < time) { + sound(who, CHAN_ITEM, "runes/end3.wav", 1, ATTN_NORM); + // tune as needed + who.rune3_last_noise_time = time + 1.0; + } + return (tvalue * 2) / 3; + } + return tvalue; +}; + +void(entity who) RuneApplyElder = +{ + if(who.rune & ITEM_RUNE4) { + if(who.rune4_last_regen_time < time && who.health < 100) { + sound(who, CHAN_ITEM, "runes/end4.wav", 1, ATTN_NORM); + who.health = who.health + 5; + if(who.health > 100) + who.health = 100; + who.rune4_last_regen_time = time + 1.0; + } + } +}; + +float(entity who) RuneHasElder = +{ + if(who.rune & ITEM_RUNE4) + return TRUE; + return FALSE; +}; + +void() RunePrecache = +{ + if(cvar_hget(cvarh_deathmatch)) + if(cvar_hget(cvarh_gamecfg) & GAMECFG_ENABLE_RUNES) { + precache_model("progs/end1.mdl"); + precache_model("progs/end2.mdl"); + precache_model("progs/end3.mdl"); + precache_model("progs/end4.mdl"); + + precache_sound("runes/end1.wav"); + precache_sound("runes/end2.wav"); + precache_sound("runes/end3.wav"); + precache_sound("runes/end4.wav"); + } +}; diff --git a/QC/rogue_s_wrath.qc b/QC/rogue_s_wrath.qc new file mode 100644 index 00000000..95c63629 --- /dev/null +++ b/QC/rogue_s_wrath.qc @@ -0,0 +1,555 @@ +// overlord.qc + +$skin s_wrtrst +$frame s_wrtfrm + +// walk +$frame s_wtwk01 s_wtwk02 s_wtwk03 s_wtwk04 s_wtwk05 +$frame s_wtwk06 s_wtwk07 s_wtwk08 s_wtwk09 s_wtwk10 +$frame s_wtwk11 s_wtwk12 s_wtwk13 s_wtwk14 s_wtwk15 + +// hand to hand attacks +$frame s_wtaa01 s_wtaa02 s_wtaa03 s_wtaa04 s_wtaa05 +$frame s_wtaa06 s_wtaa07 s_wtaa08 s_wtaa09 s_wtaa10 + +$frame s_wtab01 s_wtab02 s_wtab03 s_wtab04 s_wtab05 +$frame s_wtab06 s_wtab07 s_wtab08 s_wtab09 s_wtab10 +$frame s_wtab11 s_wtab12 s_wtab13 s_wtab14 + +$frame s_wtac01 s_wtac02 s_wtac03 s_wtac04 s_wtac05 +$frame s_wtac06 s_wtac07 s_wtac08 s_wtac09 s_wtac10 +$frame s_wtac11 s_wtac12 s_wtac13 s_wtac14 + +// ranged attack +$frame s_wtba01 s_wtba02 s_wtba03 s_wtba04 s_wtba05 +$frame s_wtba06 s_wtba07 s_wtba08 s_wtba09 s_wtba10 s_wtba11 s_wtba12 + +// pain +$frame s_wtpa01 s_wtpa02 s_wtpa03 s_wtpa04 s_wtpa05 +$frame s_wtpa06 s_wtpa07 s_wtpa08 s_wtpa09 s_wtpa10 +$frame s_wtpa11 s_wtpa12 s_wtpa13 s_wtpa14 + +$frame s_wtpb01 s_wtpb02 s_wtpb03 s_wtpb04 s_wtpb05 +$frame s_wtpb06 s_wtpb07 s_wtpb08 s_wtpb09 s_wtpb10 +$frame s_wtpb11 + +// death +$frame s_wtdt01 s_wtdt02 s_wtdt03 s_wtdt04 s_wtdt05 +$frame s_wtdt06 s_wtdt07 s_wtdt08 s_wtdt09 s_wtdt10 +$frame s_wtdt11 s_wtdt12 s_wtdt13 s_wtdt14 s_wtdt15 +$frame s_wtdt16 s_wtdt17 + +float(entity thePoint) isSpawnPointEmpty = +{ + entity neighbors; + entity start; + + neighbors = findradius (thePoint.origin, 64); + if(neighbors == world) + return 1; + + start = neighbors; + while (neighbors) + { + if(neighbors != thePoint) + { + if(neighbors.flags & FL_MONSTER) + { + return 0; + } + else if(neighbors.classname == "player") + { + return 0; + } + else if(neighbors.think) + { + return 0; + } + } + + neighbors = neighbors.chain; + if(neighbors == start) + return 1; + } + return 1; +}; + +entity() overlord_find_dest3 = +{ + entity furthestDest; + entity bestDest; + entity curDest; + entity thePlayer; + float theDist; + float curDist; + float dot; + vector curVector; + + furthestDest = world; + bestDest = world; + theDist=0; + thePlayer=find(world, classname, "player"); + curDest=world; + + makevectors(thePlayer.angles); + + while (1) + { + curDest = find(curDest, classname, "info_overlord_destination"); + if(curDest == world) + { + if(bestDest != world) + return bestDest; + + return furthestDest; + } + + if(isSpawnPointEmpty(curDest)) + { + curVector = curDest.origin - thePlayer.origin; + curDist = vlen(curVector); + curVector = normalize(curVector); + dot = curVector * v_forward; + if(dot > 0.6) + { + if(curDist > 150) + { + bestDest = curDest; + } + } + + if(curDist > theDist) + { + furthestDest = curDest; + theDist = curDist; + } + } + } + + // just in case, return the world. + return world; +}; + +// ======================================================= + +entity() overlord_find_dest = +{ + entity curDest, lastDest; + float loopCount; + + curDest = find(world, classname, "info_overlord_destination"); + if(curDest != world) + { + lastDest = curDest; + loopCount = random()*5; + while (loopCount > 1) + { + curDest = nextent (curDest); + curDest = find(curDest, classname, "info_overlord_destination"); + if(curDest != world) + { + if(isSpawnPointEmpty(curDest)) + { + loopCount = loopCount - 1; + lastDest = curDest; + } + else + curDest = world; + } + else + { + return lastDest; + } + } + return curDest; + } + return curDest; +}; + + +void() overlord_teleport = +{ + float chance; + entity theDest; + vector org; + + if(!(self.spawnflags & 2)) + return; + + chance = random(); + if(chance > 0.75) + return; + +// theDest = overlord_find_dest(); + theDest = overlord_find_dest3(); + if(theDest == world) + return; + +// put a tfog where the player was + spawn_tfog (self.origin); + +// spawn a tfog flash in front of the destination + makevectors(self.angles); + org = theDest.origin + 32 * v_forward; + + spawn_tfog (org); + spawn_tdeath(theDest.origin, self); + + setorigin(self, theDest.origin); + self.flags = self.flags - self.flags & FL_ONGROUND; +}; +// ======================================================= + +void() overlord_stand1 =[ $s_wtwk01, overlord_stand1 ] { ai_stand();}; + +void() overlord_walk01 =[ $s_wtwk01, overlord_walk02 ] { ai_walk(8); }; +void() overlord_walk02 =[ $s_wtwk02, overlord_walk03 ] { ai_walk(8); }; +void() overlord_walk03 =[ $s_wtwk03, overlord_walk04 ] { ai_walk(8); }; +void() overlord_walk04 =[ $s_wtwk04, overlord_walk05 ] { ai_walk(8); }; +void() overlord_walk05 =[ $s_wtwk05, overlord_walk06 ] { ai_walk(8); }; +void() overlord_walk06 =[ $s_wtwk06, overlord_walk07 ] { ai_walk(8); }; +void() overlord_walk07 =[ $s_wtwk07, overlord_walk08 ] { ai_walk(8); }; +void() overlord_walk08 =[ $s_wtwk08, overlord_walk09 ] { ai_walk(8); }; +void() overlord_walk09 =[ $s_wtwk09, overlord_walk10 ] { ai_walk(8); }; +void() overlord_walk10 =[ $s_wtwk10, overlord_walk11 ] { ai_walk(8); }; +void() overlord_walk11 =[ $s_wtwk11, overlord_walk12 ] { ai_walk(8); }; +void() overlord_walk12 =[ $s_wtwk12, overlord_walk13 ] { ai_walk(8); }; +void() overlord_walk13 =[ $s_wtwk13, overlord_walk14 ] { ai_walk(8); }; +void() overlord_walk14 =[ $s_wtwk14, overlord_walk15 ] { ai_walk(8); }; +void() overlord_walk15 =[ $s_wtwk15, overlord_walk01 ] { ai_walk(8); }; + +void() overlord_run01 =[ $s_wtwk01, overlord_run02 ] { ai_run(12); }; +void() overlord_run02 =[ $s_wtwk02, overlord_run03 ] { ai_run(12); }; +void() overlord_run03 =[ $s_wtwk03, overlord_run04 ] { ai_run(12); }; +void() overlord_run04 =[ $s_wtwk04, overlord_run05 ] { ai_run(12); }; +void() overlord_run05 =[ $s_wtwk05, overlord_run06 ] { ai_run(12); }; +void() overlord_run06 =[ $s_wtwk06, overlord_run07 ] { ai_run(12); }; +void() overlord_run07 =[ $s_wtwk07, overlord_run08 ] { ai_run(12); }; +void() overlord_run08 =[ $s_wtwk08, overlord_run09 ] { ai_run(12); }; +void() overlord_run09 =[ $s_wtwk09, overlord_run10 ] { ai_run(12); }; +void() overlord_run10 =[ $s_wtwk10, overlord_run11 ] { ai_run(12); }; +void() overlord_run11 =[ $s_wtwk11, overlord_run12 ] { ai_run(12); }; +void() overlord_run12 =[ $s_wtwk12, overlord_run13 ] { ai_run(12); }; +void() overlord_run13 =[ $s_wtwk13, overlord_run14 ] { ai_run(12); }; +void() overlord_run14 =[ $s_wtwk14, overlord_run15 ] { ai_run(12); }; +void() overlord_run15 =[ $s_wtwk15, overlord_run01 ] { ai_run(12); }; + +// ================================================= +// overlord hand-to-hand attack +// ================================================= +void() overlord_smash; + +void() overlord_at_a01 =[ $s_wtaa01, overlord_at_a02 ] { ai_charge(12);}; +void() overlord_at_a02 =[ $s_wtaa02, overlord_at_a03 ] { ai_charge(12);}; +void() overlord_at_a03 =[ $s_wtaa03, overlord_at_a04 ] { ai_charge(12);}; +void() overlord_at_a04 =[ $s_wtaa04, overlord_at_a05 ] { ai_charge(12);}; +void() overlord_at_a05 =[ $s_wtaa05, overlord_at_a06 ] { ai_charge(12);}; +void() overlord_at_a06 =[ $s_wtaa06, overlord_at_a07 ] { ai_charge(12);}; +void() overlord_at_a07 =[ $s_wtaa07, overlord_at_a08 ] {overlord_smash();}; +void() overlord_at_a08 =[ $s_wtaa08, overlord_at_a09 ] { ai_charge(12);}; +void() overlord_at_a09 =[ $s_wtaa09, overlord_at_a10 ] { ai_charge(12);}; +void() overlord_at_a10 =[ $s_wtaa10, overlord_run01 ] { ai_charge(12);}; + +void() overlord_at_b01 =[ $s_wtab01, overlord_at_b02 ] { ai_charge(12);}; +void() overlord_at_b02 =[ $s_wtab02, overlord_at_b03 ] { ai_charge(12);}; +void() overlord_at_b03 =[ $s_wtab03, overlord_at_b04 ] { ai_charge(12);}; +void() overlord_at_b04 =[ $s_wtab04, overlord_at_b05 ] { ai_charge(12);}; +void() overlord_at_b05 =[ $s_wtab05, overlord_at_b06 ] { ai_charge(12);}; +void() overlord_at_b06 =[ $s_wtab06, overlord_at_b07 ] { ai_charge(12);}; +void() overlord_at_b07 =[ $s_wtab07, overlord_at_b08 ] { ai_charge(12);}; +void() overlord_at_b08 =[ $s_wtab08, overlord_at_b09 ] {overlord_smash();}; +void() overlord_at_b09 =[ $s_wtab09, overlord_at_b10 ] { ai_charge(12);}; +void() overlord_at_b10 =[ $s_wtab10, overlord_at_b11 ] { ai_charge(12);}; +void() overlord_at_b11 =[ $s_wtab11, overlord_at_b12 ] { ai_charge(12);}; +void() overlord_at_b12 =[ $s_wtab12, overlord_at_b13 ] { ai_charge(12);}; +void() overlord_at_b13 =[ $s_wtab13, overlord_at_b14 ] { ai_charge(12);}; +void() overlord_at_b14 =[ $s_wtab14, overlord_run01 ] { ai_charge(12);}; + +void() overlord_at_c01 =[ $s_wtac01, overlord_at_c02 ] { ai_charge(12);}; +void() overlord_at_c02 =[ $s_wtac02, overlord_at_c03 ] { ai_charge(12);}; +void() overlord_at_c03 =[ $s_wtac03, overlord_at_c04 ] { ai_charge(12);}; +void() overlord_at_c04 =[ $s_wtac04, overlord_at_c05 ] { ai_charge(12);}; +void() overlord_at_c05 =[ $s_wtac05, overlord_at_c06 ] { ai_charge(12);}; +void() overlord_at_c06 =[ $s_wtac06, overlord_at_c07 ] {overlord_smash();}; +void() overlord_at_c07 =[ $s_wtac07, overlord_at_c08 ] { ai_charge(12);}; +void() overlord_at_c08 =[ $s_wtac08, overlord_at_c09 ] { ai_charge(12);}; +void() overlord_at_c09 =[ $s_wtac09, overlord_at_c10 ] { ai_charge(12);}; +void() overlord_at_c10 =[ $s_wtac10, overlord_at_c11 ] { ai_charge(12);}; +void() overlord_at_c11 =[ $s_wtac11, overlord_at_c12 ] {overlord_smash();}; +void() overlord_at_c12 =[ $s_wtac12, overlord_at_c13 ] { ai_charge(12);}; +void() overlord_at_c13 =[ $s_wtac13, overlord_at_c14 ] { ai_charge(12);}; +void() overlord_at_c14 =[ $s_wtac14, overlord_run01 ] { ai_charge(12);}; + +void() overlord_smash = +{ + vector delta; + float smashDmg; + + if(!self.enemy) + return; + if(!CanDamage(self.enemy, self)) + return; + + ai_charge(10); + + delta = self.enemy.origin - self.origin; + + if(vlen(delta) > 100) + return; + + smashDmg = 20 + random () * 10; + + sound(self, CHAN_WEAPON, "s_wrath/smash.wav", 1, ATTN_NORM); + T_Damage(self.enemy, self, self, smashDmg); + delta = normalize(self.enemy.origin - self.origin + self.enemy.view_ofs); + SpawnBlood (self.enemy.origin - delta * 30, delta * -100, smashDmg); +}; + +void() overlord_melee = +{ + float r; + + r = random(); + + if(r < 0.33) + { + overlord_at_a01(); + } + else if(r < 0.66) + { + overlord_at_b01(); + } + else + { + overlord_at_c01(); + } +}; + +// ================================================== +// missile attacks +// ================================================== +void(float AttackNumber) WrathMissile; + +void() overlord_msl_a01 =[ $s_wtba01, overlord_msl_a02 ] { ai_charge(12);}; +void() overlord_msl_a02 =[ $s_wtba02, overlord_msl_a03 ] { ai_charge(12);}; +void() overlord_msl_a03 =[ $s_wtba03, overlord_msl_a04 ] { ai_charge(12);}; +void() overlord_msl_a04 =[ $s_wtba04, overlord_msl_a05 ] { ai_charge(12);}; +void() overlord_msl_a05 =[ $s_wtba05, overlord_msl_a06 ] { ai_charge(12);}; +void() overlord_msl_a06 =[ $s_wtba06, overlord_msl_a07 ] {WrathMissile(4);}; +void() overlord_msl_a07 =[ $s_wtba07, overlord_msl_a08 ] { ai_charge(12);}; +void() overlord_msl_a08 =[ $s_wtba08, overlord_msl_a09 ] { ai_charge(12);}; +void() overlord_msl_a09 =[ $s_wtba09, overlord_msl_a10 ] { ai_charge(12);}; +void() overlord_msl_a10 =[ $s_wtba10, overlord_msl_a11 ] { ai_charge(12);}; +void() overlord_msl_a11 =[ $s_wtba11, overlord_msl_a12 ] { ai_charge(12);}; +void() overlord_msl_a12 =[ $s_wtba12, overlord_run01 ] {overlord_teleport();}; + +void() overlord_missile = +{ + float r; + r = random(); + + overlord_msl_a01(); +}; + +// ================================================== +// pain +// ================================================== +void() overlord_pn_a01 =[ $s_wtpa01, overlord_pn_a02 ] {}; +void() overlord_pn_a02 =[ $s_wtpa02, overlord_pn_a03 ] {}; +void() overlord_pn_a03 =[ $s_wtpa03, overlord_pn_a04 ] {overlord_teleport();}; +void() overlord_pn_a04 =[ $s_wtpa04, overlord_pn_a05 ] {}; +void() overlord_pn_a05 =[ $s_wtpa05, overlord_pn_a06 ] {}; +void() overlord_pn_a06 =[ $s_wtpa06, overlord_pn_a07 ] {}; +void() overlord_pn_a07 =[ $s_wtpa07, overlord_run01 ] {}; + +void() overlord_pn_b01 =[ $s_wtpb01, overlord_pn_b02 ] {}; +void() overlord_pn_b02 =[ $s_wtpb02, overlord_pn_b03 ] {}; +void() overlord_pn_b03 =[ $s_wtpb03, overlord_pn_b04 ] {overlord_teleport();}; +void() overlord_pn_b04 =[ $s_wtpb04, overlord_pn_b05 ] {}; +void() overlord_pn_b05 =[ $s_wtpb05, overlord_pn_b06 ] {}; +void() overlord_pn_b06 =[ $s_wtpb06, overlord_pn_b07 ] {}; +void() overlord_pn_b07 =[ $s_wtpb07, overlord_run01 ] {}; + + +void(entity attacker, float damage) overlord_pain = +{ + float r; + + if(self.pain_finished > time) + return; + + r = random(); + + if(r > 0.2) + return; + + if(r < 0.15) + overlord_pn_a01(); + else + overlord_pn_b01(); + + self.pain_finished = time + 2; + sound(self, CHAN_VOICE, "wrath/wpain.wav", 1, ATTN_NORM); +}; + +void(string gibName) ol_toss = +{ + vector flingVelocity; + entity myGib; + + makevectors(self.angles); + flingVelocity = v_forward*250 + v_up*300; + flingVelocity = flingVelocity + v_up * (random() * 100 - 50); + flingVelocity = flingVelocity + v_right * (random() * 200 - 100); + + myGib = StartGib (gibName); + myGib.velocity = flingVelocity; +}; + +// note - death frame 9 is intentionally done twice. +void() overlord_die01 =[ $s_wtdt01, overlord_die02 ] {self.nextthink = time +0.05;}; +void() overlord_die02 =[ $s_wtdt02, overlord_die03 ] + { self.flags = self.flags | FL_FLY; self.nextthink = time +0.05;}; +void() overlord_die03 =[ $s_wtdt03, overlord_die04 ] {self.nextthink = time +0.05;}; +void() overlord_die04 =[ $s_wtdt04, overlord_die05 ] {self.nextthink = time +0.05;}; +void() overlord_die05 =[ $s_wtdt05, overlord_die06 ] {self.nextthink = time +0.05;}; +void() overlord_die06 =[ $s_wtdt06, overlord_die07 ] {self.nextthink = time +0.05;}; +void() overlord_die07 =[ $s_wtdt07, overlord_die08 ] {self.nextthink = time +0.05;}; +void() overlord_die08 =[ $s_wtdt08, overlord_die09 ] {self.nextthink = time +0.05;}; +void() overlord_die09 =[ $s_wtdt09, overlord_die10 ] {self.nextthink = time +0.05;}; +void() overlord_die10 =[ $s_wtdt09, overlord_die11 ] {self.nextthink = time +0.05;}; +void() overlord_die11 =[ $s_wtdt10, overlord_die12 ] {self.nextthink = time +0.05;}; +void() overlord_die12 =[ $s_wtdt11, overlord_die13 ] {self.nextthink = time +0.05;}; +void() overlord_die13 =[ $s_wtdt12, overlord_die14 ] {self.nextthink = time +0.05;}; +void() overlord_die14 =[ $s_wtdt13, overlord_die15 ] {self.nextthink = time +0.05;}; +void() overlord_die15 =[ $s_wtdt14, overlord_die16 ] {self.nextthink = time +0.05;}; +void() overlord_die16 =[ $s_wtdt15, overlord_die17 ] {self.nextthink = time +0.05;}; +void() overlord_die17 =[ $s_wtdt16, overlord_die18 ] +{ + self.model = ""; + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 0); + WriteByte(MSG_BROADCAST, 4); + + ol_toss("progs/s_wrtgb2.mdl"); + ol_toss("progs/s_wrtgb3.mdl"); + ol_toss("progs/wrthgib1.mdl"); + ol_toss("progs/wrthgib2.mdl"); + ol_toss("progs/wrthgib3.mdl"); + self.nextthink = time + 0.1; +}; +void() overlord_die18 =[ $s_wtdt17, overlord_die19 ] +{ + float counter; + + counter = 2; + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 0); + WriteByte(MSG_BROADCAST, 4); + + while(counter>0) + { + ol_toss("progs/gib1.mdl"); + ol_toss("progs/gib2.mdl"); + ol_toss("progs/gib3.mdl"); + counter = counter - 1; + } + self.nextthink = time + 0.1; +}; +void() overlord_die19 = [ $s_wtdt17, overlord_die19 ] +{ + float counter; + + counter = 2; + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 0); + WriteByte(MSG_BROADCAST, 4); + + while(counter>0) + { + ol_toss("progs/gib1.mdl"); + ol_toss("progs/gib2.mdl"); + ol_toss("progs/gib3.mdl"); + counter = counter - 1; + } + + remove(self); +}; + +/*QUAKED monster_super_wrath (1 0 0) (-16 -16 -24) (16 16 32) Ambush BossMode +The super wrath (Overlord). + +BossMode enables the superwrath's powershield and the random teleporting. +*/ +void() monster_super_wrath = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/s_wrath.mdl"); +// + precache_model("progs/s_wrtgb1.mdl"); + + precache_model("progs/s_wrtgb2.mdl"); + + precache_model("progs/s_wrtgb3.mdl"); + precache_model("progs/wrthgib1.mdl"); + precache_model("progs/wrthgib2.mdl"); + precache_model("progs/wrthgib3.mdl"); + + precache_model("progs/w_ball.mdl"); + precache_sound("wrath/wsee.wav"); + precache_sound("wrath/watt.wav"); + precache_sound("wrath/wpain.wav"); + precache_sound("wrath/wdthc.wav"); + precache_sound("s_wrath/smash.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/s_wrath.mdl"); + + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + + self.health = 1000; + self.pain_finished = 0; + + self.th_stand = overlord_stand1; + self.th_walk = overlord_walk01; + self.th_run = overlord_run01; + self.th_missile = overlord_missile; + self.th_melee = overlord_melee; + self.th_pain = overlord_pain; + self.th_die = overlord_die02; + + flymonster_start(); +}; + +/*QUAKED info_overlord_destination (.5 .5 .5) (-8 -8 -8) (8 8 32) +This is the destination marker for the overlord. + +It does not require any other fields filled in. +*/ +void() info_overlord_destination = +{ +// this does nothing, just serves as a target spot + self.mangle = self.angles; + self.angles = '0 0 0'; + self.model = ""; + self.origin = self.origin + '0 0 27'; +}; + diff --git a/QC/rogue_shield.qc b/QC/rogue_shield.qc new file mode 100644 index 00000000..368d9f40 --- /dev/null +++ b/QC/rogue_shield.qc @@ -0,0 +1,103 @@ +// Shield +// + +// =================== +// shield_think +// =================== +void() shield_think = +{ + if(self.owner.shield_death_time < time) + { + self.owner.shield_entity = world; + remove(self); + return; + } + + if((self.owner.shield_death_time - 0.25) <= time) + { + self.model = string_null; + } + else + { + setorigin(self, self.owner.origin); + self.v_angle = self.owner.v_angle; + self.angles = self.owner.angles; + } + + self.think = shield_think; + self.nextthink = time + 0.05; +}; + +// =================== +// shield_spawn +// =================== +void(entity shieldOwner, vector dir) shield_spawn = +{ + entity newShield; + + if(shieldOwner.shield_death_time > time) + { + return; + } + + newShield = spawn(); + newShield.owner = shieldOwner; + newShield.solid = SOLID_NOT; + newShield.takedamage = DAMAGE_NO; + newShield.movetype = MOVETYPE_NONE; + newShield.classname = "power_shield"; + + // time for shield to live +// shieldOwner.shield_death_time = time + 0.5; + shieldOwner.shield_death_time = time + 0.3; + shieldOwner.shield_entity = newShield; + + newShield.v_angle = shieldOwner.v_angle; + newShield.angles = shieldOwner.angles; + setorigin(newShield, shieldOwner.origin); + setmodel(newShield, "progs/p_shield.mdl"); + setsize(newShield, '0 0 0', '0 0 0'); + + newShield.nextthink = time + 0.1; + newShield.think = shield_think; +}; + + +// =================== +// shield_hit +// =================== +float(entity targ, entity inflictor, entity attacker, float damage) shield_hit= +{ + vector dir; + float save; + float hitAngle; + + dir = inflictor.origin - targ.origin; + save = vectoyaw (dir); + makevectors(targ.angles); + hitAngle = save - vectoyaw (v_forward); + + if(hitAngle > 90 && hitAngle < 270) + { + return damage; + } + else if(hitAngle < -90 && hitAngle > -270) + { + return damage; + } + + shield_spawn (targ, dir); + + if(targ.shieldSoundTime < time) + { + sound(targ, CHAN_ITEM, "shield/hit.wav", 1, ATTN_NORM); + targ.shieldSoundTime = time + 0.5; + } + + if(inflictor.classname == "lava_spike") + save = damage * 0.70; + else + save = damage * 0.30; + + return save; +}; diff --git a/QC/rogue_sphere.qc b/QC/rogue_sphere.qc new file mode 100644 index 00000000..aa306f98 --- /dev/null +++ b/QC/rogue_sphere.qc @@ -0,0 +1,158 @@ +// vengeance sphere + +// ============================== +// sphere_impact +// ============================== +void() sphere_impact = +{ + if(other.health) + { + T_Damage(other, self, self, 1000); + } + + // don't do radius damage to the other, because all the damage + // was done in the impact + T_RadiusDamage(self, self, 300, other); + +// sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + BecomeExplosion (); +}; + +void(entity ownerEntity) sphere_remove = +{ + entity theSphere; + + theSphere = find(world, classname, "Vengeance"); + while(theSphere != world) + { + if(theSphere.owner == self) + { + bprint(theSphere.owner.netname); + bprint(" is denied Vengeance.\n"); + remove(theSphere); + theSphere = find(world, classname, "Vengeance"); + } + else + theSphere = find(theSphere, classname, "Vengeance"); + } +}; + +// ============================== +// sphere_attack +// ============================== +void() sphere_attack = +{ + self.solid = SOLID_TRIGGER; + self.touch = sphere_impact; + + if(self.enemy.health < 1) + { + sprint(self.owner, "You are denied Vengeance"); + remove(self); + return; + } + + ai_track(self.enemy, 650); + self.nextthink = time + 0.1; + self.think = sphere_attack; +}; + +// ============================== +// sphere_think +// ============================== +void() sphere_think = +{ + if(self.shieldSoundTime < time) + { + sound(self, CHAN_VOICE, "sphere/sphere.wav", 1, ATTN_NORM); + self.shieldSoundTime = time + 4; + } + + if(time > self.delay) + { + VR_ItemUtil_EntDelItem(self.owner, IID_V_SPHERE); + + sprint(self.owner, "Vengeance Sphere Lost\n"); + remove(self); + return; + } + + if(self.owner.health < 1) + { + VR_ItemUtil_EntDelItem(self.owner, IID_V_SPHERE); + + if(self.owner.enemy.classname == "player") + { + self.enemy = self.owner.enemy; + sphere_attack(); + return; + } + if(self.owner.enemy.owner.classname == "player") + { + self.enemy = self.owner.enemy.owner; + sphere_attack(); + return; + } + remove(self); + return; + } + + ai_orbit(self.owner, 16, '0 0 48'); + + self.think = sphere_think; + self.nextthink = time + 0.1; +}; + +// ============================== +// sphere_spawn +// ============================== +void() sphere_spawn = +{ + entity missile; + + missile = spawn(); + missile.movetype = MOVETYPE_FLYMISSILE; +// missile.solid = SOLID_BBOX; + missile.solid = SOLID_NOT; + missile.classname = "Vengeance"; + missile.owner = other; + missile.weapon = 0; + missile.delay = time + 30; + setmodel(missile, "progs/sphere.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, self.origin); + missile.avelocity = '40 40 40'; + missile.think = sphere_think; + missile.nextthink = time + 0.1; +}; + +/*QUAKED item_sphere (0 0 1) (-8 -8 -8) (8 8 8) ? +The Vengeance Sphere. DEATHMATCH ONLY. +*/ +void() item_sphere = +{ + if(!deathmatch) + { + remove(self); + return; + } + + precache_model("progs/sphere.mdl"); + precache_sound("sphere/sphere.wav"); + + self.noise = "sphere/sphere.wav"; + self.netname = "Vengeance Sphere"; + self.classname = "item_sphere"; + self.handtouch = newitems_touch; + + setmodel(self, "progs/sphere.mdl"); + setsize(self, '-8 -8 -8', '8 8 8'); + self.avelocity = '40 40 40'; + StartItem(); +}; diff --git a/QC/rogue_teamplay.qc b/QC/rogue_teamplay.qc new file mode 100644 index 00000000..4d02c59f --- /dev/null +++ b/QC/rogue_teamplay.qc @@ -0,0 +1,1895 @@ +// TODO VR: (P1) most of the item management and weapon management here needs to +// be rewritten for VR + +// Rogue Teamplay Variants +// Jan'97 by ZOID <zoid@threewave.com> +// Under contract to id software for Rogue Entertainment + + +// New entity fields + +.float steam; // selected team +.float suicide_count; // how many times has this player done something silly? +.float ctf_flags; // various flags for CTF +.float ctf_killed; // used for base spawning +.float ctf_flagsince; // when we picked up the flag +.float ctf_lasthurtcarrier; // when we last hurt the carrier +.float ctf_lastreturnedflag; // when we returned the flag +.float ctf_lastfraggedcarrier; // when we last fragged the carrier + +float TEAM1 = 5; // color of team1 (red), note that this is self.team which + //is one more than the color setting, so 'color 4' is red. +float TEAM2 = 14; // color of team2 (blue), note that this is self.team which + //is one more than the color setting, so 'color 13' is blue. +float TEAM3 = 1; // color of team3 (grey) in alt CTF + +entity team1_lastspawn; // last spawn spot for team1 +entity team2_lastspawn; // last spawn spot for team2 +float nextteamupdtime; // next time for a broadcast update + +// TEAMPLAY VALUES + +float TEAM_NORMAL_NODAMAGE = 1; // id's normal teamplay, can't hurt self +float TEAM_NORMAL_DAMAGE = 2; // id's alt teamplay, can hurt self/team +float TEAM_DMATCH_TAG = 3; // deathmatch tag, no 'team' stuff +float TEAM_CTF = 4; // regular CTF, locked colors +float TEAM_CTF_ONEFLAG = 5; // one flag CTF +float TEAM_CTF_ALT = 6; // alternate CTF (three teams) + +// gamecfg cvar fields + +float GAMECFG_ENABLE_RUNES = 1; // enable runes (default is disabled) +float GAMECFG_TEAM_ARMOR_DMG = 2; // 2 team damage affects armor (default is not) +float GAMECFG_TEAM_HEALTH_DMG = 4; // 4 team damage affects health (default is not) +float GAMECFG_USE_COLOR = 8; // use color player joins as (if you join and start with blue, you will go +// to blue team, same with red/green. If you are an illegal color, you'll +// get assigned). +float GAMECFG_ALLOW_CHG = 16; // allow people to change teams + +float CTF_CAPTURE_BONUS = 15; // what you get for capture +float CTF_TEAM_BONUS = 10; // what your team gets for capture +float CTF_ALT_CAPTURE_BONUS = 8; // what you get for capture +float CTF_ALT_TEAM_BONUS = 4; // what your team gets for capture +float CTF_RECOVERY_BONUS = 1; // what you get for recovery +float CTF_FLAG_BONUS = 0; // what you get for picking up enemy flag +float CTF_FRAG_CARRIER_BONUS = 2; // what you get for fragging enemy flag carrier +float CTF_FLAG_RETURN_TIME = 40; // seconds until auto return +float CTF_CARRIER_DANGER_PROTECT_BONUS = 2; // bonus for fraggin someone + // who has recently hurt your flag carrier +float CTF_CARRIER_PROTECT_BONUS = 1; // bonus for fraggin someone while + // either you or your target are near your flag carrier +float CTF_FLAG_DEFENSE_BONUS = 1; // bonus for fraggin someone while + // either you or your target are near your flag +float CTF_RETURN_FLAG_ASSIST_BONUS = 1; // awarded for returning a flag that causes a + // capture to happen almost immediately +float CTF_FRAG_CARRIER_ASSIST_BONUS = 2; // award for fragging a flag carrier if a + // capture happens almost immediately +float CTF_TARGET_PROTECT_RADIUS = 400; // the radius around an object being + // defended where a target will be worth extra frags +float CTF_ATTACKER_PROTECT_RADIUS = 400; // the radius around an object being + // defended where an attacker will get extra frags when making kills +float CTF_CARRIER_DANGER_PROTECT_TIMEOUT = 4; +float CTF_CARRIER_FLAG_SINCE_TIMEOUT = 2; +float CTF_FRAG_CARRIER_ASSIST_TIMEOUT = 6; +float CTF_RETURN_FLAG_ASSIST_TIMEOUT = 4; +float CTF_UPDATE_TIME = 120; + +// CTF flags +float CTF_FLAG_FLAG = 1; // palyer has flag in one flag mode +float CTF_FLAG_TEAM1 = 1; // player has team1's flag +float CTF_FLAG_TEAM2 = 2; // player has team2's flag +float CTF_FLAG_STUFF_COLOR = 4; // gotta stuff his color + +// flag status used in cnt field of flag +float FLAG_AT_BASE = 0; +float FLAG_CARRIED = 1; +float FLAG_DROPPED = 2; + +// Return a name for the color of a team +string(float Team) GetTeamColor = +{ + if(Team == 1) return("White"); + else if(Team == 2) return("Brown"); + else if(Team == 3) return("Light blue"); + else if(Team == 4) return("Green"); + else if(Team == 5) return("Red"); + else if(Team == 6) return("Olive"); + else if(Team == 7) return("Orange"); + else if(Team == 8) return("Peech"); + else if(Team == 9) return("Purple"); + else if(Team == 10) return("Majenta"); + else if(Team == 11) return("Grey"); + else if(Team == 12) return("Aqua"); + else if(Team == 13) return("Yellow"); + else if(Team == 14) return("Blue"); + return "Unknown"; +}; + +string(float Team) GetCTFTeam = +{ + if(Team == TEAM1) return "���"; + else if(Team == TEAM2) return "����"; + else if(Team == TEAM3) return "����"; + return "UNKNOWN"; + +}; + +/* +================ +TeamArmorDam + +Return TRUE if the target's armor can take damage from this attacker. +================ +*/ + +float(entity targ, entity inflictor, entity attacker, float damage) TeamArmorDam = +{ + if(teamplay <= 0) + return TRUE; // PGM bug? fix + + // teamplay modes 4,5,6 protect armor + if((teamplay == TEAM_CTF || + teamplay == TEAM_CTF_ONEFLAG || + teamplay == TEAM_CTF_ALT) && + attacker.steam == targ.steam && + attacker != targ && + !(cvar_hget(cvarh_gamecfg) & GAMECFG_TEAM_ARMOR_DMG)) { + // Armor is protected + return FALSE; + } + return TRUE; +}; + +/* +================ +TeamHealthDam + +Return TRUE if the target can take health damage from this attacker. +================ +*/ + +float(entity targ, entity inflictor, entity attacker, float damage) TeamHealthDam = +{ + if(teamplay <= 0) + return TRUE; + + if(teamplay == TEAM_NORMAL_NODAMAGE && attacker.steam == targ.steam) + return FALSE; + + // teamplay modes 4,5,6 protect health + if((teamplay == TEAM_CTF || + teamplay == TEAM_CTF_ONEFLAG || + teamplay == TEAM_CTF_ALT) && + attacker.steam == targ.steam && + attacker != targ && + !(cvar_hget(cvarh_gamecfg) & GAMECFG_TEAM_HEALTH_DMG)) { + // Health is protected + return FALSE; + } + return TRUE; +}; + +void(entity who) TeamResetCarrier = +{ + entity head; + + // When the flag carrier dies, reset the last_hurt_carrier field in + // all players on the opposite team from the flag carrier. The carrier + // has been killed, so there is no longer a reason to award points for + // killing off his assailants + if(teamplay >= TEAM_CTF && + (who.ctf_flags & (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2))) { + + head = find(world, classname, "player"); + + while (head != world) { + if(teamplay == TEAM_CTF_ONEFLAG || + ((who.ctf_flags & CTF_FLAG_TEAM1) && head.steam == TEAM1) || + ((who.ctf_flags & CTF_FLAG_TEAM2) && head.steam == TEAM2)) + head.ctf_lasthurtcarrier = -10; + head = find(head, classname, "player"); + } + } +}; + +void(entity targ, entity attacker) TeamAssists = +{ + float flag_radius; + float flag_carrier_radius; + string s; + entity head; + + if((targ.ctf_flags & (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)) && + targ.steam != attacker.steam) { + //ZOID: one team fragged the other team's flag carrier + + // Mark the attacker with the time at which he killed the flag + // carrier, for awarding assist points + attacker.ctf_lastfraggedcarrier = time; + + // give player only the normal amount of frags + // if the carrier has only had the flag for a few seconds, to + // prevent ppl intentionally allowing enemies to grab the flag, + // then immediately fragging them + if(targ.ctf_flagsince + CTF_CARRIER_FLAG_SINCE_TIMEOUT > time) { + sprint(attacker, "Enemy flag carrier killed, no bonus\n"); + } else { + attacker.frags = attacker.frags + CTF_FRAG_CARRIER_BONUS; + sprint(attacker, "Enemy flag carrier killed: "); + s = ftos(CTF_FRAG_CARRIER_BONUS); + sprint(attacker, s); + sprint(attacker, " bonus frags\n"); + } + } + + // This code checks for all game-critical kills OTHER THAN fragging the enemy + // flag carrier, like killing players who are trying to kill your flag carrier + // or trying to grab your flag, and hands out bonus frags. + + // The two variables below track whether special bonus frags have already + // been awarded for the attacker or target being near the flag or flag carrier. + + flag_radius = 0; + flag_carrier_radius = 0; + + // get a string for the attacker's team now, for later announcements + s = GetCTFTeam(attacker.steam); + + if((targ.ctf_lasthurtcarrier + CTF_CARRIER_DANGER_PROTECT_TIMEOUT > time) && + !(attacker.ctf_flags & (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2))) { + // a player on the same team as the flag carrier killed + // someone who recently shot the flag carrier + attacker.frags = attacker.frags + CTF_CARRIER_DANGER_PROTECT_BONUS; + flag_carrier_radius = 1; + // NOTE: getting CARRIER_DANGER_PROTECT_BONUS precludes getting + // other kinds of bonuses for defending the flag carrier, since + // it's worth more points + bprint(attacker.netname); + bprint(" defends "); + bprint(s); + bprint("'s flag carrier against an agressive enemy\n"); + } + + // Bonusus for defending the flag carrier or the flag itself. + // Extra frags are awarded if either the attacker or the target are + // 1. within 40 feet of a flag carrier on the same team as the attacker + // 2. within 40 feet of the attacker's flag + // These bonuses are cumulative with respect to defending both the + // flag and the flag carrier at the same time, but not cumulative with + // respect to both the target and attacker being near the object being defended + + // find flags or flag carriers within a radius of the attacker + head = findradius(attacker.origin, CTF_ATTACKER_PROTECT_RADIUS); + + while (head) { + if(head.classname == "player") { + if((head.steam == attacker.steam) && + (head.ctf_flags & (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)) && + (head != attacker) && // self defense + (!flag_carrier_radius)) { + // attacker was near his own flag carrier + attacker.frags = attacker.frags + CTF_CARRIER_PROTECT_BONUS; + flag_carrier_radius = 1; + bprint(attacker.netname); + bprint(" defends "); + bprint(s); + bprint("'s flag carrier\n"); + } + } + if((attacker.steam == TEAM1 && head.classname == "item_flag_team1") || + (attacker.steam == TEAM2 && head.classname == "item_flag_team2") || + head.classname == "item_flag") { // one flag mode + // attacker was near his own flag + attacker.frags = attacker.frags + CTF_FLAG_DEFENSE_BONUS; + flag_radius = 1; + bprint(attacker.netname); + bprint(" defends the"); + if(teamplay != TEAM_CTF_ONEFLAG) { + bprint(" "); + bprint(s); + } + bprint(" flag\n"); + } + head = head.chain; + } + + // find flags or flag carriers within a radius from the target + head = findradius(targ.origin, CTF_TARGET_PROTECT_RADIUS); + while (head) { + if(head.classname == "player") { + if((head.steam == attacker.steam) && + (head.ctf_flags & (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)) && + (head != attacker) && + (!flag_carrier_radius)) { // prevents redundant points awarded + // target was near attacker's flag carrier + attacker.frags = attacker.frags + CTF_CARRIER_PROTECT_BONUS; + flag_carrier_radius = 1; + bprint(attacker.netname); + bprint(" defends "); + bprint(s); + bprint("'s flag carrier\n"); + } + } + if((attacker.steam == TEAM1 && head.classname == "item_flag_team1") || + (attacker.steam == TEAM2 && head.classname == "item_flag_team2") || + head.classname == "item_flag" && // one flag mode + (!flag_radius)) { // prevents redundant points awarded + // target was near attacker's flag + attacker.frags = attacker.frags + CTF_FLAG_DEFENSE_BONUS; + flag_radius = 1; + bprint(attacker.netname); + bprint(" defends the"); + if(teamplay != TEAM_CTF_ONEFLAG) { + bprint(" "); + bprint(s); + } + bprint(" flag\n"); + } + head = head.chain; + } +}; + +/* +================== +TeamColorIsLegal + +Return TRUE if the indicated color is legal +================== +*/ +float(float color) TeamColorIsLegal = +{ + // All colors are legal if teamplay is not CTF + if(teamplay < TEAM_CTF) { + if(color > 0) + return TRUE; + return FALSE; + } + + // In regular CTF and CTF_ONEFLAG, only two colors are legal + if(teamplay == TEAM_CTF || teamplay == TEAM_CTF_ONEFLAG) + if(color == TEAM1 || color == TEAM2) + return TRUE; + else + return FALSE; + + // In ALT CTF, three colors are legal + if(teamplay == TEAM_CTF_ALT) + if(color == TEAM1 || color == TEAM2 || color == TEAM3) + return TRUE; + else + return FALSE; + + // dunno what teamplay we're in, let'em all be ok + return TRUE; +}; + +/* TeamSetSkin - set the skin of the player model to the + apropriate skin based on team and teamplay settings. +*/ +void() TeamSetSkin = +{ + self.skin = 0; + if(deathmatch) + { + if(teamplay >= TEAM_CTF) + self.skin = 1; + } +/* + if(deathmatch) + { + if(teamplay >= TEAM_CTF) + { +// if(self.team == TEAM3) +// self.skin = 2; +// else + self.skin = 1; + } + if(teamplay < TEAM_CTF) + self.skin = 1; + else + { + if(self.team == TEAM1) + self.skin = 2; + else if(self.team == TEAM2) + self.skin = 3; + else if(self.team == TEAM3) + self.skin = 4; + } + } +*/ +}; + +/* +================== +TeamCheckTeam + +Check if the team self is on is legal, and put self in a legal team if not. +================== +*/ +void() TeamCheckTeam = +{ + float team1count; + float team2count; + float team3count; + float newcolor; + float t; + entity p; + string n; + + if(self.steam >= 0 || teamplay < TEAM_CTF) { + if(TeamColorIsLegal(self.team)) { + self.steam = self.team; + TeamSetSkin(); + return; + } + } + + // Assign the player to a team. + + // Sum the players on all the teams. + team1count = 0; + team2count = 0; + team3count = 0; + + p = find(world, classname, "player"); + + while(p) { + if(p != self) { + if(p.steam == TEAM1) + team1count = team1count + 1; + else if(p.steam == TEAM2) + team2count = team2count + 1; + else if(p.steam == TEAM3) + team3count = team3count + 1; + } + p = find(p, classname, "player"); + } + + // Find the team with the least players. + newcolor = TEAM1; + t = team1count; + + if(team2count < t || (team2count == t && random() < 0.5)) { + newcolor = TEAM2; + t = team2count; + } + + // in CTF_ALT, there's three teams + team3count = team3count * 2; // grey team only gets half as many players + if(teamplay == TEAM_CTF_ALT && team3count < t) { + newcolor = TEAM3; + t = team3count; + } + + // Put the player on a the new team. + self.ctf_flags = self.ctf_flags | CTF_FLAG_STUFF_COLOR; + + n = GetCTFTeam(newcolor); + sprint(self, "You have been assigned to "); + sprint(self, n); + sprint(self, " team.\n"); + + self.steam = newcolor; // Remember what team we're on + self.team = newcolor; + TeamSetSkin(); +}; + +/* Check for team changing and perform whatever actions are neccessary. */ +void() TeamCheckLock = +{ + float n; + string s; + + if(!deathmatch || teamplay < TEAM_CTF) { + // all colors are legal, no force + self.steam = self.team; + return; + } + + if(self.ctf_flags & CTF_FLAG_STUFF_COLOR) { + self.ctf_flags = self.ctf_flags - CTF_FLAG_STUFF_COLOR; + stuffcmd(self, "color "); + n = self.steam - 1; + s = ftos(n); + stuffcmd(self, s); + stuffcmd(self, "\n"); + TeamSetSkin(); + return; + } + + if(!TeamColorIsLegal(self.team) && self.team == self.steam) + self.steam = -1; // full reset + + // Check to see if the player has changed colors + if(self.team != self.steam) { + if(self.steam >= 0) { + if(TeamColorIsLegal(self.steam)) { + + if(!(cvar_hget(cvarh_gamecfg) & GAMECFG_ALLOW_CHG)) { + // changing teams sucks, kill him + + // if he has tried to change teams several + // times, kick him off the server. + if(self.suicide_count > 3) { + sprint(self, "You were told you can't change teams.\nGo play color games somewhere else.\n"); + stuffcmd(self, "disconnect\n"); + bprint(self.netname); + bprint(" has bad color sense\n"); + } + // case base respawn + if(self.ctf_killed != 1) + self.ctf_killed = 2; + T_Damage(self,self,self,1000); // Kill the player + // trying to change teams counts as a suicide + self.suicide_count = self.suicide_count + 1; + + sprint(self, "You cannot change teams.\n"); + stuffcmd(self, "color "); + n = self.steam - 1; + s = ftos(n); + stuffcmd(self, s); + stuffcmd(self, "\n"); + self.team = self.steam; + return; + } + } else { + // If we're on an illegal team, force a change. + self.steam = -50; + } + } + + if(self.steam > 0) { + // case base respawn + if(self.ctf_killed != 1) + self.ctf_killed = 2; + T_Damage(self,self,self,1000); // Kill the player + } + self.frags = 0; // Zero out frags + TeamCheckTeam(); // re-assignment + } +}; + +/* Toss out a backpack containing some ammo from your current weapon, +and any weapons you don't have. +*/ +void() TossBackpack = +{ + entity item; + + // If we don't have any ammo, return + if(self.currentammo <= 0) + return; + + // only valid in teamplay modes + if(teamplay < 1) + return; + + item = spawn(); + + // TODO VR: (P2) rewrite for VR + /* + + // See if you have the Shotgun or Super Shotgun on + if((self.weapon == IT_SHOTGUN) || (self.weapon == IT_SUPER_SHOTGUN)) { + if(self.ammo_shells >= 20) { + item.ammo_shells = 20; + self.ammo_shells = self.ammo_shells - 20; + } + else + { + item.ammo_shells = self.ammo_shells; + self.ammo_shells = 0; + } + } + + // See if you have neither the Shotgun or Super Shotgun + if(!(self.items & IT_SHOTGUN) && !(self.items & IT_SUPER_SHOTGUN)) { + if(self.ammo_shells >= 20) { + item.ammo_shells = 20; + self.ammo_shells = self.ammo_shells - 20; + } else { + item.ammo_shells = self.ammo_shells; + self.ammo_shells = 0; + } + } + + // See if we are using a nailgun + if((self.weapon == IT_NAILGUN) || (self.weapon == IT_SUPER_NAILGUN)) { + if(self.ammo_nails >= 20) { + item.ammo_nails = 20; + self.ammo_nails = self.ammo_nails - 20; + } else { + item.ammo_nails = self.ammo_nails; + self.ammo_nails = 0; + } + } + + // See if we are using the lava nailguns + if((self.weapon == IT_LAVA_NAILGUN) || (self.weapon == IT_LAVA_SUPER_NAILGUN)) { + if(self.ammo_lava_nails >= 20) { + item.ammo_lava_nails = 20; + self.ammo_lava_nails = self.ammo_lava_nails - 20; + } else { + item.ammo_lava_nails = self.ammo_lava_nails; + self.ammo_lava_nails = 0; + } + } + + // Check to see if we have neither nailgun + if(!(self.items & IT_NAILGUN) && !(self.items & IT_SUPER_NAILGUN)) { + // put both regular and lava nails in + if(self.ammo_nails >= 20) { + item.ammo_nails = 20; + self.ammo_nails = self.ammo_nails - 20; + } else { + item.ammo_nails = self.ammo_nails; + self.ammo_nails = 0; + } + if(self.ammo_lava_nails >= 20) { + item.ammo_lava_nails = 20; + self.ammo_lava_nails = self.ammo_lava_nails - 20; + } else { + item.ammo_lava_nails = self.ammo_lava_nails; + self.ammo_lava_nails = 0; + } + } + + // See if we are using a grenade or rocket launcher + if((self.weapon == IT_GRENADE_LAUNCHER) || (self.weapon == IT_ROCKET_LAUNCHER)) { + if(self.ammo_rockets >= 10) { + item.ammo_rockets = 10; + self.ammo_rockets = self.ammo_rockets - 10; + } else { + item.ammo_rockets = self.ammo_rockets; + self.ammo_rockets = 0; + } + } + + // See if we are using the multi grenade or rocket launcher + if((self.weapon == IT_MULTI_GRENADE) || (self.weapon == IT_MULTI_ROCKET)) { + if(self.ammo_multi_rockets >= 10) { + item.ammo_multi_rockets = 10; + self.ammo_multi_rockets = self.ammo_multi_rockets - 10; + } else { + item.ammo_multi_rockets = self.ammo_multi_rockets; + self.ammo_multi_rockets = 0; + } + } + + // See if we have neither the Grenade or rocket launcher + if(!(self.items & IT_GRENADE_LAUNCHER) && !(self.items & IT_ROCKET_LAUNCHER)) { + if(self.ammo_rockets >= 10) { + item.ammo_rockets = 10; + self.ammo_rockets = self.ammo_rockets - 10; + } else { + item.ammo_rockets = self.ammo_rockets; + self.ammo_rockets = 0; + } + if(self.ammo_multi_rockets >= 10) { + item.ammo_multi_rockets = 10; + self.ammo_multi_rockets = self.ammo_multi_rockets - 10; + } else { + item.ammo_multi_rockets = self.ammo_multi_rockets; + self.ammo_multi_rockets = 0; + } + } + + // See if we're using the lightning gun + if(self.weapon == IT_LIGHTNING) { + if(self.ammo_cells >= 20) { + item.ammo_cells = 20; + self.ammo_cells = self.ammo_cells - 20; + } else { + item.ammo_cells = self.ammo_cells; + self.ammo_cells = 0; + } + } + + // see if we are using the plasma gun + if(self.weapon == IT_PLASMA_GUN) { + if(self.ammo_plasma >= 10) { + item.ammo_plasma = 10; + self.ammo_plasma = self.ammo_plasma - 10; + } else { + item.ammo_plasma = self.ammo_plasma; + self.ammo_plasma = 0; + } + } + + // see if we don't have the lightning gun + if(!(self.items & IT_LIGHTNING)) { + if(self.ammo_cells >= 20) { + item.ammo_cells = 20; + self.ammo_cells = self.ammo_cells - 20; + } else { + item.ammo_cells = self.ammo_cells; + self.ammo_cells = 0; + } + if(self.ammo_plasma >= 10) { + item.ammo_plasma = 10; + self.ammo_plasma = self.ammo_plasma - 10; + } else { + item.ammo_plasma = self.ammo_plasma; + self.ammo_plasma = 0; + } + } + + if(item.ammo_shells + item.ammo_nails + item.ammo_lava_nails + + item.ammo_rockets + item.ammo_multi_rockets + item.ammo_cells + + item.ammo_plasma == 0) { + sprint(self, "No ammo available!\n"); + remove(item); + return; + } + + */ + + item.owner = self; + makevectors(self.v_angle); + + setorigin(item, self.origin + '0 0 16'); + item.velocity = aim(self, 1000); + item.velocity = item.velocity * 500; + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_BOUNCE; + + setmodel(item, "progs/backpack.mdl"); + setsize(item, '-16 -16 0', '16 16 56'); + item.touch = BackpackTouch; + item.nextthink = time + 120; // remove after 2 minutes + item.think = SUB_Remove; + + W_SetCurrentAmmo(); +}; + +void() Team_weapon_touch = +{ + // TODO VR: (P2) rewrite for VR + /* + + float hadammo, best, new, old; + entity stemp; + + if(!(other.flags & FL_CLIENT)) + return; + // Don't let the owner pick up his own weapon for a second. + if((other == self.owner) && ((self.nextthink - time) > 119)) + return; + +// if the player was using his best weapon, change up to the new one if better + stemp = self; + self = other; + best = W_BestWeapon(); + self = stemp; + + if(self.classname == "weapon_nailgun") + new = IT_NAILGUN; + else if(self.classname == "weapon_supernailgun") + new = IT_SUPER_NAILGUN; + else if(self.classname == "weapon_supershotgun") + new = IT_SUPER_SHOTGUN; + else if(self.classname == "weapon_rocketlauncher") + new = IT_ROCKET_LAUNCHER; + else if(self.classname == "weapon_grenadelauncher") + new = IT_GRENADE_LAUNCHER; + else if(self.classname == "weapon_lightning") + new = IT_LIGHTNING; + else + objerror ("Team_weapon_touch: unknown classname"); + + sprint(other, "You got the "); + sprint(other, self.netname); + sprint(other, "\n"); +// weapon touch sound + sound(other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + bound_other_ammo (); + +// change to the weapon + old = other.items; + other.items = other.items | new; + + remove(self); + self = other; + + if(!deathmatch) + self.weapon = new; + else + Deathmatch_Weapon (old, new); + + EnableComboWeapons(self); + + W_SetCurrentAmmo(); + + // dropped weapon doesn't target, so no need to call UseTargets + + */ +}; + +void() TossWeapon = +{ + // TODO VR: (P2) rewrite for VR + + /* + + entity item; + + if(deathmatch != 1) + return; // only in deathmatch 1 + + // only valid in teamplay modes + if(teamplay < 1) + return; + + if((self.weapon == IT_AXE) || (self.weapon == IT_SHOTGUN) || + (self.weapon == IT_GRAPPLE)) + return; + + item = spawn(); + item.owner = self; + makevectors(self.v_angle); + item.weapon = 0; + + setorigin(item, self.origin + '0 0 16'); + item.velocity = aim(self, 1000); + item.velocity = item.velocity * 500; + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_BOUNCE; + + if(self.weapon == IT_SUPER_SHOTGUN) + { + setmodel(item, "progs/g_shot.mdl"); + item.weapon = IT_SUPER_SHOTGUN; + item.netname = "Double-barrelled Shotgun"; + item.classname = "weapon_supershotgun"; + self.items = self.items - IT_SUPER_SHOTGUN; + } + + if(self.weapon == IT_NAILGUN || self.weapon == IT_LAVA_NAILGUN) + { + setmodel(item, "progs/g_nail.mdl"); + item.weapon = IT_NAILGUN; + item.netname = "nailgun"; + item.classname = "weapon_nailgun"; + self.items = self.items - (self.items & (IT_NAILGUN | IT_LAVA_NAILGUN)); + } + + if(self.weapon == IT_SUPER_NAILGUN || self.weapon == IT_LAVA_SUPER_NAILGUN) + { + setmodel(item, "progs/g_nail2.mdl"); + item.weapon = IT_SUPER_NAILGUN; + item.netname = "Super Nailgun"; + item.classname = "weapon_supernailgun"; + self.items = self.items - (self.items & (IT_SUPER_NAILGUN | IT_LAVA_SUPER_NAILGUN)); + } + + if(self.weapon == IT_GRENADE_LAUNCHER || self.weapon == IT_MULTI_GRENADE) + { + setmodel(item, "progs/g_rock.mdl"); + item.weapon = IT_GRENADE_LAUNCHER; + item.netname = "Grenade Launcher"; + item.classname = "weapon_grenadelauncher"; + self.items = self.items - (self.items & (IT_GRENADE_LAUNCHER | IT_MULTI_GRENADE)); + } + + if(self.weapon == IT_ROCKET_LAUNCHER || self.weapon == IT_MULTI_ROCKET) + { + setmodel(item, "progs/g_rock2.mdl"); + item.weapon = IT_ROCKET_LAUNCHER; + item.netname = "Rocket Launcher"; + item.classname = "weapon_rocketlauncher"; + self.items = self.items - (self.items & (IT_ROCKET_LAUNCHER | IT_MULTI_ROCKET)); + } + + if(self.weapon == IT_LIGHTNING || self.weapon == IT_PLASMA_GUN) + { + setmodel(item, "progs/g_light.mdl"); + item.weapon = IT_LIGHTNING; + item.netname = "Thunderbolt"; + item.classname = "weapon_lightning"; + self.items = self.items - (self.items & (IT_LIGHTNING | IT_PLASMA_GUN)); + } + setsize(item, '-16 -16 0', '16 16 56'); + item.touch = Team_weapon_touch; + item.think = SUB_Remove; + item.nextthink = time + 120; + + self.weapon = W_BestWeapon(); + W_SetCurrentAmmo(); + + */ +}; + +void(entity flg) RegenFlag = +{ + flg.movetype = MOVETYPE_TOSS; + flg.solid = SOLID_TRIGGER; + sound(flg, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); // play respawn sound + setorigin(flg, flg.oldorigin); + flg.angles = flg.mangle; + flg.cnt = FLAG_AT_BASE; // it's at home base + flg.owner = world; +}; + +void(entity flg) TeamReturnFlag = +{ + entity p; + + RegenFlag(flg); + + p = find(world, classname, "player"); + while (p != world) { + if(teamplay == TEAM_CTF_ONEFLAG) // one flag mode? + centerprint(p, "The flag has been returned!\n"); + else { + if(teamplay == TEAM_CTF_ALT) { + if(flg.team == TEAM1) + centerprint(p, "��� flag has been returned to base!\n"); + else if(flg.team == TEAM2) + centerprint(p, "���� flag has been returned to base!\n"); + else + centerprint(p, "Some flag has been returned to base!\n"); + } else { + if(p.steam != flg.team) + centerprint(p, "Enemy flag has been returned to base!\n"); + else if(p.steam == flg.team) + centerprint(p, "Your flag has been returned to base!\n"); + } + } + p = find(p, classname, "player"); + } +}; + +void () TeamRegenFlags = +{ + entity f; + + if(teamplay == TEAM_CTF_ONEFLAG) { + f = find(world, classname, "item_flag"); + if(f != world) + RegenFlag(f); + return; + } + + f = find(world, classname, "item_flag_team1"); + if(f != world) + RegenFlag(f); + f = find(world, classname, "item_flag_team2"); + if(f != world) + RegenFlag(f); +}; + +void(entity flg) TeamDropFlag = +{ + entity p; + p = flg.owner; + + bprint(p.netname); + if(teamplay == TEAM_CTF_ONEFLAG) + bprint(" ���� the flag!\n"); + else { + if(flg.team == TEAM1) + bprint(" ���� the ��� flag!\n"); // red + else + bprint(" ���� the ���� flag!\n"); // blue + } + + setorigin(flg, p.origin - '0 0 24'); + flg.cnt = FLAG_DROPPED; + flg.velocity_z = 300; + flg.velocity_x = 0; + flg.velocity_y = 0; + flg.flags = FL_ITEM; + flg.solid = SOLID_TRIGGER; + flg.movetype = MOVETYPE_TOSS; + setsize(flg, '-16 -16 0', '16 16 74'); + + // return it after so long + flg.super_time = time + CTF_FLAG_RETURN_TIME; +}; + +void(entity player) TeamDropFlagOfPlayer = +{ + string kn; + entity e; + + if(teamplay == TEAM_CTF_ONEFLAG && (player.ctf_flags & CTF_FLAG_FLAG)) + kn = "item_flag"; + else if(player.ctf_flags & CTF_FLAG_TEAM1) + kn = "item_flag_team1"; + else if(player.ctf_flags & CTF_FLAG_TEAM2) + kn = "item_flag_team2"; + else + return; // doesn't have a flg + player.ctf_flags = player.ctf_flags - + (player.ctf_flags & (CTF_FLAG_FLAG | CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)); + e = find(world, classname, kn); + if(e != world) + TeamDropFlag(e); +}; + +// A flag was touched. In one flag mode, the player always just picks it up +// (the flagbase models at each base will cause the score). In two flag mode, +// it could be the guy returning his flag, or the guy getting the enemy flag +// Three team mode gets more complicated as the third team touches the +// flagbase to score +void() TeamFlagTouch = +{ + entity p; + + if(other.classname != "player") + return; + + if(other.health <= 0) + return; + + if(other.team != other.steam) + return; // something is fishy, somebody is playing with colors + + if(self.cnt == FLAG_CARRIED) + return; // huh? + + // Ok, first up, let's do it for one flag mode + if(teamplay == TEAM_CTF_ONEFLAG) { + // in one flag mode, we always pick up the flag. The touch of the + // flagbase entities does the scoring + bprint(other.netname); + bprint(" ��� the flag!\n"); + if(CTF_FLAG_BONUS) + other.frags = other.frags + CTF_FLAG_BONUS; + //centerprint(other, "YOU GOT THE FLAG\n\nTAKE IT TO ENEMY BASE\n"); + centerprint(other, "��� ��� ��� ����\n\n���� �� �� ����� ����\n"); + + sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + + other.ctf_flags = other.ctf_flags | CTF_FLAG_FLAG; + other.items = other.items | self.items; + other.ctf_flagsince = time; + + // pick up the flag + self.cnt = FLAG_CARRIED; + self.movetype = MOVETYPE_NOCLIP; + self.solid = SOLID_NOT; + self.owner = other; + + p = find(world, classname, "player"); + while (p != world) { + if(p != other) + centerprint(p, "The flag has been taken!\n"); + p = find(p, classname, "player"); + } + return; + } + + // Regular and Alt CTF mode + if(teamplay != TEAM_CTF && teamplay != TEAM_CTF_ALT) + return; // odd, but ignore it + + if(self.team == other.steam) { + // same team, if the flag is *not* at the base, return + // it to base. we overload the 'cnt' field for this + if(self.cnt == FLAG_AT_BASE) { + // the flag is at home base. if the player has the enemy + // flag, he's just won! + if((self.team == TEAM1 && (other.ctf_flags & CTF_FLAG_TEAM2)) || + (self.team == TEAM2 && (other.ctf_flags & CTF_FLAG_TEAM1))) { + bprint(other.netname); + if(other.team == TEAM1) + bprint(" �������� the ���� flag!\n"); // blue + else + bprint(" �������� the ��� flag!\n"); // red + other.items = other.items - (other.items & (IT_KEY1 | IT_KEY2)); + + sound(other, CHAN_VOICE, "misc/flagcap.wav", 1, ATTN_NONE); + + // other gets another 10 frag bonus + other.frags = other.frags + CTF_CAPTURE_BONUS; + + // Ok, let's do the player loop, hand out the bonuses + p = find(world, classname, "player"); + while (p != world) { + self = p; + if(self.team == other.team && self != other) + self.frags = self.frags + CTF_TEAM_BONUS; + if(self.team != other.team) { + if(self.team == TEAM3) + if(other.team == TEAM1) + centerprint(self, "���� flag was captured!\n"); + else + centerprint(self, "��� flag was captured!\n"); + else + centerprint(self, "Your flag was captured!\n"); + // reset the last_hurt_carrier variable in all enemy players, so that you don't get + // bonuses for defending the flag carrier if the flag carrier has already + // completed a capture + self.ctf_lasthurtcarrier = -5; + } else if(self.team == other.team) { + // done to all players on the capturing team + centerprint(self, "Your team captured the flag!\n"); + // award extra points for capture assists + if(self.ctf_lastreturnedflag + CTF_RETURN_FLAG_ASSIST_TIMEOUT > time) { + bprint(self.netname); + if(self.team == TEAM1) + bprint(" gets an assist for returning the ��� flag!\n"); + else + bprint(" gets an assist for returning the ���� flag!\n"); + self.frags = self.frags + CTF_RETURN_FLAG_ASSIST_BONUS; + } + if(self.ctf_lastfraggedcarrier + CTF_FRAG_CARRIER_ASSIST_TIMEOUT > time) { + bprint(self.netname); + bprint(" gets an assist for fragging the flag carrier!\n"); + self.frags = self.frags + CTF_FRAG_CARRIER_ASSIST_BONUS; + } + } + self.ctf_flags = self.ctf_flags - (self.ctf_flags & + (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)); + p = find(p, classname, "player"); + } + // respawn flags + TeamRegenFlags(); + return; + } + return; // its at home base already + } + // hey, its not home. return it by teleporting it back + bprint(other.netname); + if(other.team == TEAM1) + bprint(" �������� the ��� flag!\n"); // red + else + bprint(" �������� the ���� flag!\n"); // blue + other.frags = other.frags + CTF_RECOVERY_BONUS; + other.ctf_lastreturnedflag = time; + sound(other, CHAN_ITEM, self.noise1, 1, ATTN_NORM); + TeamReturnFlag(self); + return; + } + + // if we have any flags, leave now + if(other.ctf_flags & (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)) + return; + + // hey, its not our flag, pick it up + bprint(other.netname); + if(self.team == TEAM1) + bprint(" ��� the ��� flag!\n"); // red + else + bprint(" ��� the ���� flag!\n"); // blue + other.frags = other.frags + CTF_FLAG_BONUS; + + // if in three team, messages are a little different + if(other.team == TEAM3) { +// centerprint(other, "YOU GOT THE ENEMY FLAG\n\nRETURN IT TO THE OTHER BASE!\n"); + centerprint(other, "��� ��� ��� ����� ����\n\n������ �� �� ��� ����� ����\n"); + } else { +// centerprint(other, "YOU GOT THE ENEMY FLAG!\n\nRETURN TO BASE!\n"); + centerprint(other, "��� ��� ��� ����� ����\n\n������ �� ����\n"); + } + sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + + if(self.team == TEAM1) + other.ctf_flags = other.ctf_flags | CTF_FLAG_TEAM1; + else + other.ctf_flags = other.ctf_flags | CTF_FLAG_TEAM2; + other.items = other.items | self.items; + + other.ctf_flagsince = time; + + // pick up the flag + self.cnt = FLAG_CARRIED; + self.movetype = MOVETYPE_NOCLIP; + self.solid = SOLID_NOT; + self.owner = other; + + // PGM Fix - 03/06/97 Made it work right in three team. + p = find(world, classname, "player"); + while (p != world) + { + if(p != other) + { + if(p.steam == self.team) + { + centerprint(p, "Your flag has been taken!\n"); + } + else if(p.steam == other.team) + { + if(self.team == TEAM1) + centerprint(p, "Your team has the ��� flag!\n"); // Red Flag + else + centerprint(p, "Your team has the ���� flag!\n"); // Blue Flag + } + else + { + if(self.team == TEAM1) + if(other.steam == TEAM2) + centerprint(p, "���� team has the ��� flag!\n"); // Blue has red + else // must be team3 + centerprint(p, "���� team has the ��� flag!\n"); // grey has red + else + if(other.steam == TEAM1) + centerprint(p, "��� team has the ���� flag!\n"); // red has blue + else // must be team3 + centerprint(p, "���� team has the ���� flag!\n");// grey has blue + } + } + p = find(p, classname, "player"); + } +}; + +// A flagbase was touched. In one flag mode, this is how a capture is made. +// in three team mode, only team3 touches this. In regular CTF, this is +// ignored +void() TeamFlagBaseTouch = +{ + entity p, f; + + if(other.classname != "player") + return; + if(other.health <= 0) + return; + if(other.team != other.steam) + return; // something is fishy, somebody is playing with colors + + // Ok, first up, let's do it for one flag mode + if(teamplay == TEAM_CTF_ONEFLAG) { + // ok, if they guy touching it has the flag and this is his + // base, capture! + if(((self.team == TEAM1 && other.steam == TEAM2) || + (self.team == TEAM2 && other.steam == TEAM1)) && + (other.ctf_flags & CTF_FLAG_FLAG)) { + // he just touched enemy base, capture it + bprint(other.netname); + bprint(" �������� the flag!\n"); // blue + other.items = other.items - (other.items & (IT_KEY1 | IT_KEY2)); + sound(other, CHAN_VOICE, "misc/flagcap.wav", 1, ATTN_NONE); + + // other gets another 10 frag bonus + other.frags = other.frags + CTF_CAPTURE_BONUS; + + // Ok, let's do the player loop, hand out the bonuses + p = find(world, classname, "player"); + while (p != world) { + self = p; + if(self.team == other.team && self != other) + self.frags = self.frags + CTF_TEAM_BONUS; + if(self.team != other.team) { + self.ctf_lasthurtcarrier = -5; + } else if(self.team == other.team) { + // award extra points for capture assists + if(self.ctf_lastfraggedcarrier + CTF_FRAG_CARRIER_ASSIST_TIMEOUT > time) { + bprint(self.netname); + bprint(" gets an assist for fragging the flag carrier!\n"); + self.frags = self.frags + CTF_FRAG_CARRIER_ASSIST_BONUS; + } + } + self.ctf_flags = self.ctf_flags - (self.ctf_flags & CTF_FLAG_FLAG); + p = find(p, classname, "player"); + } + // respawn flags + TeamRegenFlags(); + return; + } + } + + // in three team mode (TEAM_CTF_ALT) and we're on team3, see if we capture + if(teamplay != TEAM_CTF_ALT || other.steam != TEAM3) + return; + + if(((other.ctf_flags & CTF_FLAG_TEAM1) && (self.team == TEAM2)) || + ((other.ctf_flags & CTF_FLAG_TEAM2) && (self.team == TEAM1))) { + // third team captured + + bprint(other.netname); + if(self.team == TEAM1) + bprint(" �������� the ���� flag!\n"); // blue + else + bprint(" �������� the ��� flag!\n"); // red + other.items = other.items - (other.items & (IT_KEY1 | IT_KEY2)); + + sound(other, CHAN_VOICE, "misc/flagcap.wav", 1, ATTN_NONE); + + // other gets another 10 frag bonus + other.frags = other.frags + CTF_ALT_CAPTURE_BONUS; + + // Ok, let's do the player loop, hand out the bonuses + p = find(world, classname, "player"); + while (p != world) { + self = p; + if(self.team == other.team && self != other) + self.frags = self.frags + CTF_ALT_TEAM_BONUS; + if(self.team != other.team) { + if((other.ctf_flags & CTF_FLAG_TEAM1) && self.team == TEAM1) + centerprint(self, "Your flag was captured!\n"); + else if((other.ctf_flags & CTF_FLAG_TEAM2) && self.team == TEAM2) + centerprint(self, "The enemy flag was captured!\n"); + // reset the last_hurt_carrier variable in all enemy players, so that you don't get + // bonuses for defending the flag carrier if the flag carrier has already + // completed a capture + self.ctf_lasthurtcarrier = -5; + } else if(self.team == other.team) { + // done to all players on the capturing team + centerprint(self, "Your team captured the flag!\n"); + } + p = find(p, classname, "player"); + } + // respawn flags + if(other.ctf_flags & CTF_FLAG_TEAM1) { + f = find(world, classname, "item_flag_team1"); + if(f != world) + RegenFlag(f); + } else { // must be flag2 + f = find(world, classname, "item_flag_team2"); + if(f != world) + RegenFlag(f); + } + other.ctf_flags = other.ctf_flags - (other.ctf_flags & + (CTF_FLAG_TEAM1 | CTF_FLAG_TEAM2)); + return; + } +}; + + +void() TeamFlagThink = +{ + entity e; + vector v; + float f; + + self.nextthink = time + 0.1; + + if(self.cnt == FLAG_AT_BASE) + return; // just sitting around waiting to be picked up + + if(self.cnt == FLAG_DROPPED) { + if(time - self.super_time > CTF_FLAG_RETURN_TIME) + TeamReturnFlag(self); + return; + } + + if(self.cnt != FLAG_CARRIED) + objerror("Flag in invalid state\n"); + + e = self.owner; + if(e.classname != "player" || e.deadflag) { + TeamDropFlag(self); + return; + } + + if(teamplay == TEAM_CTF_ONEFLAG && !(e.ctf_flags & CTF_FLAG_FLAG)) { + TeamDropFlag(self); + return; + } + // must be TEAM_CTF or TEAM_CTF_ALT + if((!(e.ctf_flags & CTF_FLAG_TEAM1) && self.team == TEAM1) || + (!(e.ctf_flags & CTF_FLAG_TEAM2) && self.team == TEAM2)) { + TeamDropFlag(self); + return; + } + + makevectors(e.angles); + v = v_forward; + v_z = (-1) * v_z; // reverse z component + + f = 14; + if(self.owner.frame >= 29 && self.owner.frame <= 40) { + if(self.owner.frame >= 29 && self.owner.frame <= 34) { //axpain + if (self.owner.frame == 29) f = f + 2; + else if(self.owner.frame == 30) f = f + 8; + else if(self.owner.frame == 31) f = f + 12; + else if(self.owner.frame == 32) f = f + 11; + else if(self.owner.frame == 33) f = f + 10; + else if(self.owner.frame == 34) f = f + 4; + } else if(self.owner.frame >= 35 && self.owner.frame <= 40) { // pain + if (self.owner.frame == 35) f = f + 2; + else if(self.owner.frame == 36) f = f + 10; + else if(self.owner.frame == 37) f = f + 10; + else if(self.owner.frame == 38) f = f + 8; + else if(self.owner.frame == 39) f = f + 4; + else if(self.owner.frame == 40) f = f + 2; + } + } else if(self.owner.frame >= 103 && self.owner.frame <= 118) { + if (self.owner.frame >= 103 && self.owner.frame <= 104) f = f + 6; //nailattack + else if(self.owner.frame >= 105 && self.owner.frame <= 106) f = f + 6; //light + else if(self.owner.frame >= 107 && self.owner.frame <= 112) f = f + 7; //rocketattack + else if(self.owner.frame >= 112 && self.owner.frame <= 118) f = f + 7; //shotattack + } + self.origin = e.origin + '0 0 -16' - f*v + v_right * 22; + self.angles = e.angles + '0 0 -45'; + setorigin(self, self.origin); + self.nextthink = time + 0.01; +}; + +void() TeamFlagStatusReport = +{ + entity flag1, flag2, p; + string n; + + if(!deathmatch) + return; + + if(teamplay != TEAM_CTF && teamplay != TEAM_CTF_ONEFLAG && + teamplay != TEAM_CTF_ALT) { + sprint(self, "Capture the Flag is not enabled.\n"); + return; + } + + if(teamplay == TEAM_CTF_ONEFLAG) { + flag1 = find(world, classname, "item_flag"); + if(flag1 == world) + sprint(self, "The flag is missing!\n"); + else if(flag1.cnt == FLAG_AT_BASE) + sprint(self, "The flag is at base!\n"); + else if(flag1.cnt == FLAG_DROPPED) + sprint(self, "The flag is lying about!\n"); + else if(flag1.cnt == FLAG_CARRIED) { + if(flag1.owner == self) + sprint(self, "You have the flag!\n"); + else { + sprint(self, flag1.owner.netname); + n = GetCTFTeam(flag1.owner.steam); + sprint(self, " of the "); + sprint(self, n); + sprint(self, " team has the flag!\n"); + } + } else + sprint(self, "The flag is screwed up!\n"); + return; + } + + // normal CTF + if(teamplay == TEAM_CTF) { + // Find the flags at home base + flag1 = find(world,classname, "item_flag_team1"); + flag2 = find(world,classname, "item_flag_team2"); + + // If on team 2 switch meanings of flags + if(self.team != TEAM1) { + p = flag1; + flag1 = flag2; + flag2 = p; + } + + if(flag1 != world && flag1.cnt == FLAG_CARRIED) { + sprint(self, flag1.owner.netname); + sprint(self, " has your flag. "); + } else { + sprint(self, "Your flag is "); + if(flag1 == world) + sprint(self, "missing!\n"); + if(flag1.cnt == FLAG_AT_BASE) + sprint(self, "in your base.\n"); + else if(flag1.cnt == FLAG_DROPPED) + sprint(self, "lying about.\n"); + else + sprint(self, " corrupt.\n"); + } + + if(flag2 != world && flag2.cnt == FLAG_CARRIED) { + if(self == flag2.owner) + sprint(self, "You have the enemy flag.\n"); + else { + sprint(self, flag2.owner.netname); + sprint(self, " has the enemy flag.\n"); + } + } else { + sprint(self, "The enemy flag is "); + if(flag2 == world) + sprint(self, "missing!\n"); + if(flag2.cnt == FLAG_AT_BASE) + sprint(self, "in their base.\n"); + else if(flag2.cnt == FLAG_DROPPED) + sprint(self, "lying about.\n"); + else + sprint(self, " corrupt.\n"); + } + } + + // three team CTF + if(teamplay == TEAM_CTF_ALT) { + // Find the flags at home base + flag1 = find(world,classname, "item_flag_team1"); + flag2 = find(world,classname, "item_flag_team2"); + + if(flag1 != world && flag1.cnt == FLAG_CARRIED) { + if(flag1.owner == self) + sprint(self, "You have the ��� flag!\n"); + else { + sprint(self, flag1.owner.netname); + n = GetCTFTeam(flag1.owner.steam); + sprint(self, " of the "); + sprint(self, n); + sprint(self, " team has the ��� flag.\n"); + } + } else { + if(self.steam == flag1.team) + sprint(self, "Your flag is "); + else + sprint(self, "��� flag is "); + if(flag1 == world) + sprint(self, "missing!\n"); + if(flag1.cnt == FLAG_AT_BASE) + sprint(self, "at base.\n"); + else if(flag1.cnt == FLAG_DROPPED) + sprint(self, "lying about.\n"); + else + sprint(self, " corrupt.\n"); + } + + if(flag2 != world && flag2.cnt == FLAG_CARRIED) { + if(flag2.owner == self) + sprint(self, "You have the ���� flag.\n"); + else { + sprint(self, flag2.owner.netname); + n = GetCTFTeam(flag2.owner.steam); + sprint(self, " of the "); + sprint(self, n); + sprint(self, " team has the ���� flag.\n"); + } + } else { + if(self.steam == flag1.team) + sprint(self, "Your flag is "); + else + sprint(self, "���� flag is "); + if(flag2 == world) + sprint(self, "missing!\n"); + if(flag2.cnt == FLAG_AT_BASE) + sprint(self, "at base.\n"); + else if(flag2.cnt == FLAG_DROPPED) + sprint(self, "lying about.\n"); + else + sprint(self, " corrupt.\n"); + } + } +}; + +///////////////////////////////////////////////////////////////////////// + +$cd id1/models/flag +$base base +$skin skin + +void() place_flag = { + self.mdl = self.model; // so it can be restored on respawn + self.flags = FL_ITEM; // make extra wide + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_TOSS; + self.velocity = '0 0 0'; + self.origin_z = self.origin_z + 6; + self.think = TeamFlagThink; + self.touch = TeamFlagTouch; + self.nextthink = time + 0.1; + self.cnt = FLAG_AT_BASE; + self.mangle = self.angles; + self.effects = self.effects | EF_DIMLIGHT; + if(!droptofloor()) { + dprint("Flag fell out of level at "); + dprint(vtos(self.origin)); + dprint("\n"); + remove(self); + return; + } + self.oldorigin = self.origin; // save for flag return +}; + +void(entity flg, string cname) place_flagbase = +{ + entity oself; + + teamplay = cvar_hget(cvarh_teamplay); + + oself = self; + self = spawn(); + self.classname = cname; + setorigin(self, flg.origin); + self.angles = flg.angles; + precache_model("progs/ctfbase.mdl"); + setmodel(self, "progs/ctfbase.mdl"); + self.skin = flg.skin; + self.team = flg.team; +// setsize(self, '-8 -8 -4', '8 8 4'); + setsize(self, '-8 -8 0', '8 8 8'); + self.flags = FL_ITEM; // make extra wide + self.movetype = MOVETYPE_TOSS; + self.velocity = '0 0 0'; + self.origin_z = self.origin_z + 6; + if(teamplay == TEAM_CTF_ONEFLAG || teamplay == TEAM_CTF_ALT) { + self.solid = SOLID_TRIGGER; + self.touch = TeamFlagBaseTouch; + } else + self.solid = SOLID_NOT; + if(!droptofloor()) { + dprint("Flagbase fell out of level at "); + dprint(vtos(self.origin)); + dprint("\n"); + remove(self); + self = oself; + return; + } + self = oself; +}; + +// ZOID Capture the flag +/*QUAKED item_flag_team1 (0 .5 .8) (-8 -8 -32) (8 8 24) +red team flag +Only appears in CTF teamplay + +The flag waves 90 degrees off from the entity angle. If +you want the flag to point at 180, set then entity angle +to 90. +*/ +void() item_flag_team1 = +{ + if(!deathmatch) { + remove(self); + return; + } + + teamplay = cvar_hget(cvarh_teamplay); + + if(teamplay == TEAM_CTF_ONEFLAG) { + precache_sound("misc/flagtk.wav"); // flag taken + precache_sound("misc/flagcap.wav"); // flag capture + self.skin = 0; + self.team = TEAM1; + place_flagbase(self, "item_flagbase_team1"); + remove(self); + return; + } + + if(teamplay == TEAM_CTF || teamplay == TEAM_CTF_ALT) { + self.team = TEAM1; + self.items = IT_KEY2; + precache_model("progs/ctfmodel.mdl"); + setmodel(self, "progs/ctfmodel.mdl"); + self.skin = 0; + precache_sound("misc/flagtk.wav"); // flag taken + precache_sound("misc/flagcap.wav"); // flag capture + precache_sound("misc/flagret.wav"); // flag return + self.noise = "misc/flagtk.wav"; + self.noise1 = "misc/flagret.wav"; + setsize(self, '-16 -16 0', '16 16 74'); + self.nextthink = time + 0.2; // items start after other solids + self.think = place_flag; + place_flagbase(self, "item_flagbase_team1"); + } else { + remove(self); // not teamplay or deathmatch + } +}; + +/*QUAKED item_flag_team2 (0 .5 .8) (-8 -8 -32) (8 8 24) +blue team flag +Only appears in CTF teamplay + +The flag waves 90 degrees off from the entity angle. If +you want the flag to point at 180, set then entity angle +to 90. +*/ +void() item_flag_team2 = +{ + if(!deathmatch) { + remove(self); + return; + } + + teamplay = cvar_hget(cvarh_teamplay); + + if(teamplay == TEAM_CTF_ONEFLAG) { + precache_sound("misc/flagtk.wav"); // flag taken + precache_sound("misc/flagcap.wav"); // flag capture + self.team = TEAM2; + self.skin = 1; + place_flagbase(self, "item_flagbase_team2"); + remove(self); + return; + } + + if(teamplay == TEAM_CTF || teamplay == TEAM_CTF_ALT) { + self.team = TEAM2; + self.items = IT_KEY1; + precache_model("progs/ctfmodel.mdl"); + setmodel(self, "progs/ctfmodel.mdl"); + self.skin = 1; + precache_sound("misc/flagtk.wav"); // flag taken + precache_sound("misc/flagcap.wav"); // flag capture + precache_sound("misc/flagret.wav"); // flag return + self.noise = "misc/flagtk.wav"; + self.noise1 = "misc/flagret.wav"; + setsize(self, '-16 -16 0', '16 16 74'); + self.nextthink = time + 0.2; // items start after other solids + self.think = place_flag; + place_flagbase(self, "item_flagbase_team2"); + } else { + remove(self); // not teamplay or deathmatch + } +}; + +/*QUAKED item_flag (0 .5 .8) (-8 -8 -32) (8 8 24) +flag for OneTeam play. +Only appears in CTF teamplay + +The flag waves 90 degrees off from the entity angle. If +you want the flag to point at 180, set then entity angle +to 90. +*/ +void() item_flag = +{ + if(cvar_hget(cvarh_teamplay) != TEAM_CTF_ONEFLAG) { + remove(self); + return; + } + self.team = 0; // no team + self.items = IT_KEY1 | IT_KEY2; +// precache_model("progs/flag.mdl"); +// setmodel(self, "progs/flag.mdl"); + precache_model("progs/ctfmodel.mdl"); // PGM 01/18/97 + setmodel(self, "progs/ctfmodel.mdl"); // PGM 01/18/97 + self.skin = 2; + precache_sound("misc/flagtk.wav"); // flag taken + precache_sound("misc/flagcap.wav"); // flag capture + precache_sound("misc/flagret.wav"); // flag return + self.noise = "misc/flagtk.wav"; + self.noise1 = "misc/flagret.wav"; + setsize(self, '-16 -16 0', '16 16 74'); + self.nextthink = time + 0.2; // items start after other solids + self.think = place_flag; + place_flagbase(self, "item_flagbase"); +}; + +/*QUAKED info_player_team1 (1 0 1) (-16 -16 -24) (16 16 24) +potential spawning position for CTF games team 1. +*/ +void() info_player_team1 = +{ +}; + +/*QUAKED info_player_team2 (1 0 1) (-16 -16 -24) (16 16 24) +potential spawning position for CTF games team 2. +*/ +void() info_player_team2 = +{ +}; + +void() TeamSetUpdate = +{ + nextteamupdtime = time + CTF_UPDATE_TIME; +}; + +void() TeamCheckUpdate = +{ + float total1, total2, total3; + entity p; + string s; + string ts1, ts2, ts3; + + if(nextteamupdtime > time || teamplay < 1 || !deathmatch) + return; + + TeamSetUpdate(); + + // count up total + total1 = total2 = total3 = 0; + + ts1 = GetCTFTeam(TEAM1); + ts2 = GetCTFTeam(TEAM2); + ts3 = GetCTFTeam(TEAM3); + + if(teamplay == TEAM_CTF || teamplay == TEAM_CTF_ALT || teamplay == TEAM_CTF_ONEFLAG) { + p = find(world, classname, "player"); + while (p != world) { + if(p.steam == TEAM1) + total1 = total1 + p.frags; + else if(p.steam == TEAM2) + total2 = total2 + p.frags; + else if(p.steam == TEAM3) + total3 = total3 + p.frags; + p = find(p, classname, "player"); + } + + if(teamplay == TEAM_CTF || teamplay == TEAM_CTF_ONEFLAG) { + if(total1 > total2) { + bprint(ts1); + bprint(" team is leading by "); + s = ftos(total1 - total2); + bprint(s); + bprint(" points!\n"); + } else if(total1 < total2) { + bprint(ts2); + bprint(" team is leading by "); + s = ftos(total2 - total1); + bprint(s); + bprint(" points!\n"); + } else { + bprint(ts1); + bprint(" and "); + bprint(ts2); + bprint(" teams are tied with "); + s = ftos(total1); + bprint(s); + bprint(" points!\n"); + } + } else if(teamplay == TEAM_CTF_ALT) { + if(total1 > total2 && total1 > total3) { + bprint(ts1); + bprint(" team is leading by "); + if(total2 > total3) + s = ftos(total1 - total2); + else + s = ftos(total1 - total3); + bprint(s); + bprint(" points!\n"); + } else if(total2 > total1 && total2 > total3) { + bprint(ts2); + bprint(" team is leading by "); + if(total1 > total3) + s = ftos(total2 - total1); + else + s = ftos(total2 - total3); + bprint(s); + bprint(" points!\n"); + } else if(total3 > total1 && total3 > total2) { + bprint(ts3); + bprint(" team is leading by "); + if(total1 > total2) + s = ftos(total3 - total1); + else + s = ftos(total3 - total2); + bprint(s); + bprint(" points!\n"); + } else if(total1 == total2) { + bprint(ts1); + bprint(" and "); + bprint(ts2); + bprint(" teams are tied with "); + s = ftos(total1); + bprint(s); + bprint(" points!\n"); + } else if(total3 == total2) { + bprint(ts2); + bprint(" and "); + bprint(ts3); + bprint(" teams are tied with "); + s = ftos(total3); + bprint(s); + bprint(" points!\n"); + } else if(total3 == total1) { + bprint(ts1); + bprint(" and "); + bprint(ts3); + bprint(" teams are tied with "); + s = ftos(total1); + bprint(s); + bprint(" points!\n"); + } else { + bprint(ts1); + bprint(", "); + bprint(ts2); + bprint(" and "); + bprint(ts3); + bprint(" teams are tied with "); + s = ftos(total1); + bprint(s); + bprint(" points!\n"); + } + } + } +}; + +/*QUAKED func_ctf_wall (0 .5 .8) ? +This is just a solid wall if not inhibitted +Only appears in CTF teamplay +*/ +void() func_ctf_wall = +{ + teamplay = cvar_hget(cvarh_teamplay); + if(teamplay == TEAM_CTF || teamplay == TEAM_CTF_ONEFLAG || + teamplay == TEAM_CTF_ALT) { + self.angles = '0 0 0'; + self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + self.solid = SOLID_BSP; + setmodel(self, self.model); + } else + remove(self); +}; + diff --git a/QC/rogue_timemach.qc b/QC/rogue_timemach.qc new file mode 100644 index 00000000..9f102785 --- /dev/null +++ b/QC/rogue_timemach.qc @@ -0,0 +1,239 @@ +// timemach.qc +// pmack +// jan97 + +// ------------------------------------------------ +// time machine and related parts +// ------------------------------------------------ +void() time_chunk = +{ + entity timeChunk; + + timeChunk = spawn(); + setmodel(timeChunk, "progs/timegib.mdl"); + timeChunk.solid = SOLID_NOT; + timeChunk.movetype = MOVETYPE_TOSS; + makevectors(self.owner.angles); + setorigin(timeChunk, self.owner.origin + v_forward*84 - v_up * 136); + timeChunk.velocity = v_up * -50; + timeChunk.avelocity = '300 300 300'; + timeChunk.angles = self.owner.angles; + + sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NONE); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, timeChunk.origin); + + self.owner.frame = 1; + + timeChunk.think = SUB_Remove; + timeChunk.nextthink = time + 5; +}; + +void() time_stop_shake = +{ + SUB_UseTargets(); + remove(self); +}; + +void() time_boom = +{ + entity stopShakeEnt; + + SUB_UseTargets(); + + if(self.owner.health < 1250 && self.owner.frame > 0) + { + if(self.owner.skin < 2) + { + self.owner.frame = 2; + self.owner.skin = 2; + } + } + else if(self.owner.health < 1500) + { + if(self.owner.frame == 0) + { + time_chunk(); + self.owner.frame = 1; + self.owner.skin = 1; + } + } + + sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NONE); + + if(random() < 0.5) + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + } + else + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 244); + WriteByte(MSG_BROADCAST, 3); + } + + BecomeExplosion(); + stopShakeEnt = spawn(); + stopShakeEnt.target = self.target; + stopShakeEnt.think = time_stop_shake; + stopShakeEnt.nextthink = time + 0.7; +}; + +void() time_fall = +{ + if(!self.pain_finished) + { + if(self.origin_z < -20) + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z - 80); + self.pain_finished = 1; + } + else if(random() < 0.3) + { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + } + } + + self.velocity_z = self.velocity_z - 5; + self.nextthink = time + 0.1; + self.think = time_fall; +}; + +void() time_crash_impl = +{ + self.takedamage = DAMAGE_NO; + self.movetype = MOVETYPE_FLY; + self.solid = SOLID_NOT; + self.velocity = '0 0 -50'; + self.avelocity = '15 0 5'; + setsize(self, '0 0 0', '0 0 0'); + self.think = time_fall; + self.nextthink = time + 0.1; + + self.target = "timeramp"; + SUB_UseTargets(); +}; + +void() time_crash_think = +{ + time_crash_impl(); +} + +void() time_crash_die = +{ + time_crash_impl(); +} + +void(entity attacker, float damage) time_crash_pain = +{ + time_crash_impl(); +} + +void() time_pain_impl = +{ + entity painEnt; + float painRnd; + + if(self.health > 1100) + if(self.pain_finished > time) + return; + + painRnd = random(); + if(painRnd < 0.4) + { + self.pain_finished = time + 2; + painRnd = random(); + makevectors(self.angles); + painEnt = spawn(); + if(painRnd < 0.33) + painEnt.origin = self.origin + v_forward*80 - v_up*64; + else if(painRnd < 0.66) + painEnt.origin = self.origin + v_right*80 - v_up*24; + else + painEnt.origin = self.origin + v_forward*64 - v_up*48 - v_right*48; + painEnt.target = self.target; + painEnt.owner = self; + painEnt.think = time_boom; + painEnt.nextthink = time + 0.2 + random() * 0.3; + } + if(self.health < 1000) + { + self.pain_finished = 0; + self.th_pain = SUB_NullPain; + self.th_die = SUB_Null; + cutscene_running = 1; + return; + } +} + +void(entity attacker, float take) time_pain = +{ + time_pain_impl(); +}; + +void() time_pain_die = +{ + time_pain_impl(); +}; + +//(-16 -16 -32) (16 16 0) +/*QUAKED item_time_machine (1 1 0) (-64 -64 -144) (64 64 0) +*/ +void() item_time_machine = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model("progs/timemach.mdl"); + precache_model("progs/timegib.mdl"); + setmodel(self, "progs/timemach.mdl"); + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.health = 1600; + self.takedamage = DAMAGE_YES; + self.view_ofs = '0 0 25'; + self.movetype = MOVETYPE_FLY; + setsize(self, '-64 -64 -144', '64 64 0'); + self.avelocity = '0 60 0'; + self.flags = self.flags | FL_MONSTER; + + self.th_stand = SUB_Null; + self.th_walk = SUB_Null; + self.th_run = SUB_Null; + self.th_die = time_pain_die; + self.th_missile = SUB_Null; + self.th_pain = time_pain; + + theMachine = self; +}; + +/*QUAKED item_time_core (1 0 0) (-8 -8 -8) (8 8 8) +*/ +void() item_time_core = +{ + if(deathmatch) + { + remove(self); + return; + } + + precache_model("progs/timecore.mdl"); + setmodel(self, "progs/timecore.mdl"); + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_FLY; + self.avelocity = '60 60 60'; +}; diff --git a/QC/rogue_wrath.qc b/QC/rogue_wrath.qc new file mode 100644 index 00000000..c81237ea --- /dev/null +++ b/QC/rogue_wrath.qc @@ -0,0 +1,339 @@ +// wrath.qc + +$skin wrthskin + +$frame wrthfrme + +$frame wrthwk01 wrthwk02 wrthwk03 wrthwk04 wrthwk05 wrthwk06 +$frame wrthwk07 wrthwk08 wrthwk09 wrthwk10 wrthwk11 wrthwk12 + +$frame wrthaa01 wrthaa02 wrthaa03 wrthaa04 wrthaa05 wrthaa06 wrthaa07 +$frame wrthaa08 wrthaa09 wrthaa10 wrthaa11 wrthaa12 wrthaa13 wrthaa14 + +$frame wrthab01 wrthab02 wrthab03 wrthab04 wrthab05 wrthab06 wrthab07 +$frame wrthab08 wrthab09 wrthab10 wrthab11 wrthab12 wrthab13 + +$frame wrthac01 wrthac02 wrthac03 wrthac04 wrthac05 +$frame wrthac06 wrthac07 wrthac08 wrthac09 wrthac10 +$frame wrthac11 wrthac12 wrthac13 wrthac14 wrthac15 + +$frame wrthpa01 wrthpa02 wrthpa03 wrthpa04 wrthpa05 wrthpa06 + +$frame wrthpb01 wrthpb02 wrthpb03 wrthpb04 wrthpb05 wrthpb06 +$frame wrthpb07 wrthpb08 wrthpb09 wrthpb10 wrthpb11 + +$frame wrthdt01 wrthdt02 wrthdt03 wrthdt04 wrthdt05 +$frame wrthdt06 wrthdt07 wrthdt08 wrthdt09 wrthdt10 +$frame wrthdt11 wrthdt12 wrthdt13 wrthdt14 wrthdt15 + +void() wrath_stand1 =[ $wrthwk01, wrath_stand1 ] { ai_stand();}; + +void() wrath_walk01 =[ $wrthwk01, wrath_walk02 ] { ai_walk(8); }; +void() wrath_walk02 =[ $wrthwk02, wrath_walk03 ] { ai_walk(8); }; +void() wrath_walk03 =[ $wrthwk03, wrath_walk04 ] { ai_walk(8); }; +void() wrath_walk04 =[ $wrthwk04, wrath_walk05 ] { ai_walk(8); }; +void() wrath_walk05 =[ $wrthwk05, wrath_walk06 ] { ai_walk(8); }; +void() wrath_walk06 =[ $wrthwk06, wrath_walk07 ] { ai_walk(8); }; +void() wrath_walk07 =[ $wrthwk07, wrath_walk08 ] { ai_walk(8); }; +void() wrath_walk08 =[ $wrthwk08, wrath_walk09 ] { ai_walk(8); }; +void() wrath_walk09 =[ $wrthwk09, wrath_walk10 ] { ai_walk(8); }; +void() wrath_walk10 =[ $wrthwk10, wrath_walk11 ] { ai_walk(8); }; +void() wrath_walk11 =[ $wrthwk11, wrath_walk12 ] { ai_walk(8); }; +void() wrath_walk12 =[ $wrthwk12, wrath_walk01 ] { ai_walk(8); }; + +void() wrath_run01 =[ $wrthwk01, wrath_run02 ] { ai_run(12); }; +void() wrath_run02 =[ $wrthwk02, wrath_run03 ] { ai_run(12); }; +void() wrath_run03 =[ $wrthwk03, wrath_run04 ] { ai_run(12); }; +void() wrath_run04 =[ $wrthwk04, wrath_run05 ] { ai_run(12); }; +void() wrath_run05 =[ $wrthwk05, wrath_run06 ] { ai_run(12); }; +void() wrath_run06 =[ $wrthwk06, wrath_run07 ] { ai_run(12); }; +void() wrath_run07 =[ $wrthwk07, wrath_run08 ] { ai_run(12); }; +void() wrath_run08 =[ $wrthwk08, wrath_run09 ] { ai_run(12); }; +void() wrath_run09 =[ $wrthwk09, wrath_run10 ] { ai_run(12); }; +void() wrath_run10 =[ $wrthwk10, wrath_run11 ] { ai_run(12); }; +void() wrath_run11 =[ $wrthwk11, wrath_run12 ] { ai_run(12); }; +void() wrath_run12 =[ $wrthwk12, wrath_run01 ] { ai_run(12); }; + +void() wrath_at_a01 =[ $wrthaa01, wrath_at_a02 ] {ai_charge(12);}; +void() wrath_at_a02 =[ $wrthaa02, wrath_at_a03 ] {ai_charge(12);}; +void() wrath_at_a03 =[ $wrthaa03, wrath_at_a04 ] {ai_charge(12);}; +void() wrath_at_a04 =[ $wrthaa04, wrath_at_a05 ] {ai_charge(12);}; +void() wrath_at_a05 =[ $wrthaa05, wrath_at_a06 ] {ai_charge(12);}; +void() wrath_at_a06 =[ $wrthaa06, wrath_at_a07 ] {ai_charge(12);}; +void() wrath_at_a07 =[ $wrthaa07, wrath_at_a08 ] {ai_charge(12);}; +void() wrath_at_a08 =[ $wrthaa08, wrath_at_a09 ] {ai_charge(12);}; +void() wrath_at_a09 =[ $wrthaa09, wrath_at_a10 ] {ai_charge(12);}; +void() wrath_at_a10 =[ $wrthaa10, wrath_at_a11 ] {ai_charge(12);}; +void() wrath_at_a11 =[ $wrthaa11, wrath_at_a12 ] {WrathMissile(1);}; +void() wrath_at_a12 =[ $wrthaa12, wrath_at_a13 ] {ai_charge(12);}; +void() wrath_at_a13 =[ $wrthaa13, wrath_at_a14 ] {ai_charge(12);}; +void() wrath_at_a14 =[ $wrthaa14, wrath_run01 ] {ai_charge(12);}; + +void() wrath_at_b01 =[ $wrthab01, wrath_at_b02 ] {ai_charge(12);}; +void() wrath_at_b02 =[ $wrthab02, wrath_at_b03 ] {ai_charge(12);}; +void() wrath_at_b03 =[ $wrthab03, wrath_at_b04 ] {ai_charge(12);}; +void() wrath_at_b04 =[ $wrthab04, wrath_at_b05 ] {ai_charge(12);}; +void() wrath_at_b05 =[ $wrthab05, wrath_at_b06 ] {ai_charge(12);}; +void() wrath_at_b06 =[ $wrthab06, wrath_at_b07 ] {WrathMissile(2);}; +void() wrath_at_b07 =[ $wrthab07, wrath_at_b08 ] {ai_charge(12);}; +void() wrath_at_b08 =[ $wrthab08, wrath_at_b09 ] {ai_charge(12);}; +void() wrath_at_b09 =[ $wrthab09, wrath_at_b10 ] {ai_charge(12);}; +void() wrath_at_b10 =[ $wrthab10, wrath_at_b11 ] {ai_charge(12);}; +void() wrath_at_b11 =[ $wrthab11, wrath_at_b12 ] {ai_charge(12);}; +void() wrath_at_b12 =[ $wrthab12, wrath_at_b13 ] {ai_charge(12);}; +void() wrath_at_b13 =[ $wrthab13, wrath_run01 ] {ai_charge(12);}; + +void() wrath_at_c01 =[ $wrthac01, wrath_at_c02 ] {ai_charge(12);}; +void() wrath_at_c02 =[ $wrthac02, wrath_at_c03 ] {ai_charge(12);}; +void() wrath_at_c03 =[ $wrthac03, wrath_at_c04 ] {ai_charge(12);}; +void() wrath_at_c04 =[ $wrthac04, wrath_at_c05 ] {ai_charge(12);}; +void() wrath_at_c05 =[ $wrthac05, wrath_at_c06 ] {ai_charge(12);}; +void() wrath_at_c06 =[ $wrthac06, wrath_at_c07 ] {ai_charge(12);}; +void() wrath_at_c07 =[ $wrthac07, wrath_at_c08 ] {WrathMissile(3);}; +void() wrath_at_c08 =[ $wrthac08, wrath_at_c09 ] {ai_charge(12);}; +void() wrath_at_c09 =[ $wrthac09, wrath_at_c10 ] {ai_charge(12);}; +void() wrath_at_c10 =[ $wrthac10, wrath_at_c11 ] {ai_charge(12);}; +void() wrath_at_c11 =[ $wrthac11, wrath_at_c12 ] {ai_charge(12);}; +void() wrath_at_c12 =[ $wrthac12, wrath_at_c13 ] {ai_charge(12);}; +void() wrath_at_c13 =[ $wrthac13, wrath_at_c14 ] {ai_charge(12);}; +void() wrath_at_c14 =[ $wrthac14, wrath_at_c15 ] {ai_charge(12);}; +void() wrath_at_c15 =[ $wrthac15, wrath_run01 ] {ai_charge(12);}; + +void() wrath_attack = +{ + float r; + + r = random(); + + if(r < 0.25) + { + wrath_at_a01(); + } + else if(r < 0.65) + { + wrath_at_b01(); + } + else + { + wrath_at_c01(); + } + sound(self, CHAN_VOICE, "wrath/watt.wav", 1, ATTN_NORM); +}; + +void() wrath_pn_a01 =[ $wrthpa01, wrath_pn_a02 ] {}; +void() wrath_pn_a02 =[ $wrthpa02, wrath_pn_a03 ] {}; +void() wrath_pn_a03 =[ $wrthpa03, wrath_pn_a04 ] {}; +void() wrath_pn_a04 =[ $wrthpa04, wrath_pn_a05 ] {}; +void() wrath_pn_a05 =[ $wrthpa05, wrath_pn_a06 ] {}; +void() wrath_pn_a06 =[ $wrthpa06, wrath_run01 ] {}; + +void() wrath_pn_b01 =[ $wrthpb01, wrath_pn_b02 ] {}; +void() wrath_pn_b02 =[ $wrthpb02, wrath_pn_b03 ] {}; +void() wrath_pn_b03 =[ $wrthpb03, wrath_pn_b04 ] {}; +void() wrath_pn_b04 =[ $wrthpb04, wrath_pn_b05 ] {}; +void() wrath_pn_b05 =[ $wrthpb05, wrath_pn_b06 ] {}; +void() wrath_pn_b06 =[ $wrthpb06, wrath_pn_b07 ] {}; +void() wrath_pn_b07 =[ $wrthpb07, wrath_pn_b08 ] {}; +void() wrath_pn_b08 =[ $wrthpb08, wrath_pn_b09 ] {}; +void() wrath_pn_b09 =[ $wrthpb09, wrath_pn_b10 ] {}; +void() wrath_pn_b10 =[ $wrthpb10, wrath_pn_b11 ] {}; +void() wrath_pn_b11 =[ $wrthpb11, wrath_run01 ] {}; + + +void(entity attacker, float damage) wrath_pain = +{ + float r; + + if(self.pain_finished > time) + return; + + r = random(); + + if(r > 0.1) + { + self.pain_finished = time + 0.5; + return; + } + + if(r < 0.07) + wrath_pn_a01(); + else + wrath_pn_b01(); + + self.pain_finished = time + 3; + sound(self, CHAN_VOICE, "wrath/wpain.wav", 1, ATTN_NORM); +}; + +void() wrath_die02 =[ $wrthdt02, wrath_die03 ] + { sound(self, CHAN_VOICE, "wrath/wdthc.wav", 1, ATTN_NORM); }; +void() wrath_die03 =[ $wrthdt03, wrath_die04 ] {}; +void() wrath_die04 =[ $wrthdt04, wrath_die05 ] {}; +void() wrath_die05 =[ $wrthdt05, wrath_die07 ] {}; +void() wrath_die07 =[ $wrthdt07, wrath_die09 ] {}; +void() wrath_die09 =[ $wrthdt09, wrath_die11 ] {}; +void() wrath_die11 =[ $wrthdt11, wrath_die13 ] {}; +void() wrath_die13 =[ $wrthdt13, wrath_die15 ] {}; +void() wrath_die15 =[ $wrthdt15, wrath_die15 ] +{ + ThrowGib("progs/wrthgib1.mdl", self.health); + ThrowGib("progs/wrthgib2.mdl", self.health); + ThrowGib("progs/wrthgib3.mdl", self.health); + T_RadiusDamage(self, self, 80, world); + + self.origin = self.origin + '0 0 24'; + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION2); + WriteVec3(MSG_BROADCAST, self.origin); + WriteByte(MSG_BROADCAST, 0); + WriteByte(MSG_BROADCAST, 4); + + remove(self); +}; + +/*QUAKED monster_wrath (1 0 0) (-16 -16 -24) (16 16 32) Ambush +*/ +void() monster_wrath = +{ + if(deathmatch) + { + remove(self); + return; + } + precache_model("progs/wrath.mdl"); + precache_model("progs/w_ball.mdl"); + precache_model("progs/wrthgib1.mdl"); + precache_model("progs/wrthgib2.mdl"); + precache_model("progs/wrthgib3.mdl"); + + precache_sound("wrath/wsee.wav"); + precache_sound("wrath/watt.wav"); + precache_sound("wrath/wpain.wav"); + precache_sound("wrath/wdthc.wav"); + + // HONEY + monster_add_to_counter(); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel(self, "progs/wrath.mdl"); + + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + + self.health = 400; + self.yaw_speed = 35; + + self.th_stand = wrath_stand1; + self.th_walk = wrath_walk01; + self.th_run = wrath_run01; + self.th_missile = wrath_attack; + self.th_pain = wrath_pain; + self.th_die = wrath_die02; + + flymonster_start(); +}; + +/* +================ +WrathMissile +================ +*/ +void(float AttackNumber) WrathMissile = +{ + entity missile; + vector dir, org; + float dist, flytime; + + dir = normalize((self.enemy.origin + '0 0 10') - self.origin); + dist = vlen(self.enemy.origin - self.origin); + flytime = dist * 0.002; + if(flytime < 0.1) + flytime = 0.1; + + self.effects = self.effects | EF_MUZZLEFLASH; + + makevectors(self.angles); + + missile = spawn(); + missile.owner = self; + missile.solid = SOLID_BBOX; + missile.movetype = MOVETYPE_FLYMISSILE; + setmodel(missile, "progs/w_ball.mdl"); + + setsize(missile, '0 0 0', '0 0 0'); + + if(AttackNumber == 1) + { + org = self.origin + v_forward*20 + v_up*12; // 20 // 44; + } + else if(AttackNumber == 2) + { + org = self.origin + v_forward*18 + v_up*10; // 18 // 42; + } + else if(AttackNumber == 3) + { + org = self.origin + v_forward*12 + v_up*12 + v_right*20; +// up20 + } + else + { + ASSERT(AttackNumber == 4); + org = self.origin + v_forward*20 + v_up*16; + } + + setorigin(missile, org); + missile.velocity = dir * 400; + missile.avelocity = '300 300 300'; + missile.enemy = self.enemy; + missile.touch = WrathMissileTouch; + missile.nextthink = time + 0.1; + missile.think = WrathHome; + + self.attack_finished = time + 2; +}; + +void() WrathHome = +{ + if(self.enemy.health < 1) + { + remove(self); + return; + } + + if(skill == 3) + ai_track(self.enemy, 550); + else + ai_track(self.enemy, 400); + + self.nextthink = time + 0.1; + self.think = WrathHome; +}; + +void() WrathMissileTouch = +{ + if(other == self.owner || + other.classname == "monster_wrath" || + other.classname == "monster_super_wrath") + { + remove(self); + return; // don't explode on any wraths + + } + + if(other.classname == "monster_zombie") + T_Damage(other, self, self, 110); + + T_RadiusDamage(self, self.owner, 20, world); + sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteVec3(MSG_BROADCAST, self.origin); + + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel(self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1(); +}; diff --git a/QC/shalrath.qc b/QC/shalrath.qc deleted file mode 100644 index 32425a56..00000000 --- a/QC/shalrath.qc +++ /dev/null @@ -1,239 +0,0 @@ -/* -============================================================================== - -SHAL-RATH - -============================================================================== -*/ -$cd id1/models/shalrath -$origin 0 0 24 -$base base -$skin skin -$scale 0.7 - -$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 -$frame attack9 attack10 attack11 - -$frame pain1 pain2 pain3 pain4 pain5 - -$frame death1 death2 death3 death4 death5 death6 death7 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 -$frame walk11 walk12 - -void(entity attacker, float damage) shalrath_pain; -void() ShalMissile; -void() shal_stand =[ $walk1, shal_stand ] {ai_stand();}; - -void() shal_walk1 =[ $walk2, shal_walk2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE); -ai_walk(6);}; -void() shal_walk2 =[ $walk3, shal_walk3 ] {ai_walk(4);}; -void() shal_walk3 =[ $walk4, shal_walk4 ] {ai_walk(0);}; -void() shal_walk4 =[ $walk5, shal_walk5 ] {ai_walk(0);}; -void() shal_walk5 =[ $walk6, shal_walk6 ] {ai_walk(0);}; -void() shal_walk6 =[ $walk7, shal_walk7 ] {ai_walk(0);}; -void() shal_walk7 =[ $walk8, shal_walk8 ] {ai_walk(5);}; -void() shal_walk8 =[ $walk9, shal_walk9 ] {ai_walk(6);}; -void() shal_walk9 =[ $walk10, shal_walk10 ] {ai_walk(5);}; -void() shal_walk10 =[ $walk11, shal_walk11 ] {ai_walk(0);}; -void() shal_walk11 =[ $walk12, shal_walk12 ] {ai_walk(4);}; -void() shal_walk12 =[ $walk1, shal_walk1 ] {ai_walk(5);}; - -void() shal_run1 =[ $walk2, shal_run2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE); -ai_run(6);}; -void() shal_run2 =[ $walk3, shal_run3 ] {ai_run(4);}; -void() shal_run3 =[ $walk4, shal_run4 ] {ai_run(0);}; -void() shal_run4 =[ $walk5, shal_run5 ] {ai_run(0);}; -void() shal_run5 =[ $walk6, shal_run6 ] {ai_run(0);}; -void() shal_run6 =[ $walk7, shal_run7 ] {ai_run(0);}; -void() shal_run7 =[ $walk8, shal_run8 ] {ai_run(5);}; -void() shal_run8 =[ $walk9, shal_run9 ] {ai_run(6);}; -void() shal_run9 =[ $walk10, shal_run10 ] {ai_run(5);}; -void() shal_run10 =[ $walk11, shal_run11 ] {ai_run(0);}; -void() shal_run11 =[ $walk12, shal_run12 ] {ai_run(4);}; -void() shal_run12 =[ $walk1, shal_run1 ] {ai_run(5);}; - -void() shal_attack1 =[ $attack1, shal_attack2 ] { -sound(self, CHAN_VOICE, "shalrath/attack.wav", 1, ATTN_NORM); -ai_face(); -}; -void() shal_attack2 =[ $attack2, shal_attack3 ] {ai_face();}; -void() shal_attack3 =[ $attack3, shal_attack4 ] {ai_face();}; -void() shal_attack4 =[ $attack4, shal_attack5 ] {ai_face();}; -void() shal_attack5 =[ $attack5, shal_attack6 ] {ai_face();}; -void() shal_attack6 =[ $attack6, shal_attack7 ] {ai_face();}; -void() shal_attack7 =[ $attack7, shal_attack8 ] {ai_face();}; -void() shal_attack8 =[ $attack8, shal_attack9 ] {ai_face();}; -void() shal_attack9 =[ $attack9, shal_attack10 ] {ShalMissile();}; -void() shal_attack10 =[ $attack10, shal_attack11 ] {ai_face();}; -void() shal_attack11 =[ $attack11, shal_run1 ] {}; - -void() shal_pain1 =[ $pain1, shal_pain2 ] {}; -void() shal_pain2 =[ $pain2, shal_pain3 ] {}; -void() shal_pain3 =[ $pain3, shal_pain4 ] {}; -void() shal_pain4 =[ $pain4, shal_pain5 ] {}; -void() shal_pain5 =[ $pain5, shal_run1 ] {}; - -void() shal_death1 =[ $death1, shal_death2 ] {}; -void() shal_death2 =[ $death2, shal_death3 ] {}; -void() shal_death3 =[ $death3, shal_death4 ] {}; -void() shal_death4 =[ $death4, shal_death5 ] {}; -void() shal_death5 =[ $death5, shal_death6 ] {}; -void() shal_death6 =[ $death6, shal_death7 ] {}; -void() shal_death7 =[ $death7, shal_death7 ] {}; - - -void(entity attacker, float damage) shalrath_pain = -{ - if(self.pain_finished > time) - return; - - sound(self, CHAN_VOICE, "shalrath/pain.wav", 1, ATTN_NORM); - shal_pain1(); - self.pain_finished = time + 3; -}; - -void() shalrath_die = -{ -// check for gib - if(self.health < -90) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_shal.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - return; - } - - sound(self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM); - shal_death1(); - self.solid = SOLID_NOT; - // insert death sounds here -}; - -/* -================ -ShalMissile -================ -*/ -void() ShalMissileTouch; -void() ShalHome; -void() ShalMissile = -{ - local entity missile; - local vector dir; - local float dist, flytime; - - dir = normalize((self.enemy.origin + '0 0 10') - self.origin); - dist = vlen (self.enemy.origin - self.origin); - flytime = dist * 0.002; - if(flytime < 0.1) - flytime = 0.1; - - self.effects = self.effects | EF_MUZZLEFLASH; - sound(self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM); - - missile = spawn(); - missile.owner = self; - - missile.solid = SOLID_BBOX; - missile.movetype = MOVETYPE_FLYMISSILE; - setmodel (missile, "progs/v_spike.mdl"); - - setsize (missile, '0 0 0', '0 0 0'); - - missile.origin = self.origin + '0 0 10'; - missile.velocity = dir * 400; - missile.avelocity = '300 300 300'; - missile.nextthink = flytime + time; - missile.think = ShalHome; - missile.enemy = self.enemy; - missile.touch = ShalMissileTouch; -}; - -void() ShalHome = -{ - local vector dir, vtemp; - vtemp = self.enemy.origin + '0 0 10'; - if(self.enemy.health < 1) - { - remove(self); - return; - } - dir = normalize(vtemp - self.origin); - if(skill == 3) - self.velocity = dir * 350; - else - self.velocity = dir * 250; - self.nextthink = time + 0.2; - self.think = ShalHome; -}; - -void() ShalMissileTouch = -{ - if(other == self.owner) - return; // don't explode on owner - - if(other.classname == "monster_zombie") - T_Damage (other, self, self, 110); - T_RadiusDamage (self, self.owner, 40, world); - sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - self.velocity = '0 0 0'; - self.touch = SUB_Null; - setmodel (self, "progs/s_explod.spr"); - self.solid = SOLID_NOT; - s_explode1(); -}; - -//================================================================= - -/*QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) Ambush -*/ -void() monster_shalrath = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model2 ("progs/shalrath.mdl"); - precache_model2 ("progs/h_shal.mdl"); - precache_model2 ("progs/v_spike.mdl"); - - precache_sound2 ("shalrath/attack.wav"); - precache_sound2 ("shalrath/attack2.wav"); - precache_sound2 ("shalrath/death.wav"); - precache_sound2 ("shalrath/idle.wav"); - precache_sound2 ("shalrath/pain.wav"); - precache_sound2 ("shalrath/sight.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/shalrath.mdl"); - setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 400; - - self.th_stand = shal_stand; - self.th_walk = shal_walk1; - self.th_run = shal_run1; - self.th_die = shalrath_die; - self.th_pain = shalrath_pain; - self.th_missile = shal_attack1; - - self.think = walkmonster_start; - self.nextthink = time + 0.1 + random ()*0.1; - -}; diff --git a/QC/shambler.qc b/QC/shambler.qc deleted file mode 100644 index 9f65210a..00000000 --- a/QC/shambler.qc +++ /dev/null @@ -1,398 +0,0 @@ -/* -============================================================================== - -SHAMBLER - -============================================================================== -*/ - -$cd id1/models/shams -$origin 0 0 24 -$base base -$skin base - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 -$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 -$frame walk8 walk9 walk10 walk11 walk12 - -$frame run1 run2 run3 run4 run5 run6 - -$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 -$frame smash8 smash9 smash10 smash11 smash12 - -$frame swingr1 swingr2 swingr3 swingr4 swingr5 -$frame swingr6 swingr7 swingr8 swingr9 - -$frame swingl1 swingl2 swingl3 swingl4 swingl5 -$frame swingl6 swingl7 swingl8 swingl9 - -$frame magic1 magic2 magic3 magic4 magic5 -$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 - -$frame pain1 pain2 pain3 pain4 pain5 pain6 - -$frame death1 death2 death3 death4 death5 death6 -$frame death7 death8 death9 death10 death11 - -void() sham_stand1 =[ $stand1, sham_stand2 ] {ai_stand();}; -void() sham_stand2 =[ $stand2, sham_stand3 ] {ai_stand();}; -void() sham_stand3 =[ $stand3, sham_stand4 ] {ai_stand();}; -void() sham_stand4 =[ $stand4, sham_stand5 ] {ai_stand();}; -void() sham_stand5 =[ $stand5, sham_stand6 ] {ai_stand();}; -void() sham_stand6 =[ $stand6, sham_stand7 ] {ai_stand();}; -void() sham_stand7 =[ $stand7, sham_stand8 ] {ai_stand();}; -void() sham_stand8 =[ $stand8, sham_stand9 ] {ai_stand();}; -void() sham_stand9 =[ $stand9, sham_stand10] {ai_stand();}; -void() sham_stand10 =[ $stand10, sham_stand11] {ai_stand();}; -void() sham_stand11 =[ $stand11, sham_stand12] {ai_stand();}; -void() sham_stand12 =[ $stand12, sham_stand13] {ai_stand();}; -void() sham_stand13 =[ $stand13, sham_stand14] {ai_stand();}; -void() sham_stand14 =[ $stand14, sham_stand15] {ai_stand();}; -void() sham_stand15 =[ $stand15, sham_stand16] {ai_stand();}; -void() sham_stand16 =[ $stand16, sham_stand17] {ai_stand();}; -void() sham_stand17 =[ $stand17, sham_stand1 ] {ai_stand();}; - -void() sham_walk1 =[ $walk1, sham_walk2 ] {ai_walk(10);}; -void() sham_walk2 =[ $walk2, sham_walk3 ] {ai_walk(9);}; -void() sham_walk3 =[ $walk3, sham_walk4 ] {ai_walk(9);}; -void() sham_walk4 =[ $walk4, sham_walk5 ] {ai_walk(5);}; -void() sham_walk5 =[ $walk5, sham_walk6 ] {ai_walk(6);}; -void() sham_walk6 =[ $walk6, sham_walk7 ] {ai_walk(12);}; -void() sham_walk7 =[ $walk7, sham_walk8 ] {ai_walk(8);}; -void() sham_walk8 =[ $walk8, sham_walk9 ] {ai_walk(3);}; -void() sham_walk9 =[ $walk9, sham_walk10] {ai_walk(13);}; -void() sham_walk10 =[ $walk10, sham_walk11] {ai_walk(9);}; -void() sham_walk11 =[ $walk11, sham_walk12] {ai_walk(7);}; -void() sham_walk12 =[ $walk12, sham_walk1 ] {ai_walk(7); -if(random() > 0.8) - sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);}; - -void() sham_run1 =[ $run1, sham_run2 ] {ai_run(20);}; -void() sham_run2 =[ $run2, sham_run3 ] {ai_run(24);}; -void() sham_run3 =[ $run3, sham_run4 ] {ai_run(20);}; -void() sham_run4 =[ $run4, sham_run5 ] {ai_run(20);}; -void() sham_run5 =[ $run5, sham_run6 ] {ai_run(24);}; -void() sham_run6 =[ $run6, sham_run1 ] {ai_run(20); -if(random() > 0.8) - sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE); -}; - -void() sham_smash1 =[ $smash1, sham_smash2 ] { -sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); -ai_charge(2);}; -void() sham_smash2 =[ $smash2, sham_smash3 ] {ai_charge(6);}; -void() sham_smash3 =[ $smash3, sham_smash4 ] {ai_charge(6);}; -void() sham_smash4 =[ $smash4, sham_smash5 ] {ai_charge(5);}; -void() sham_smash5 =[ $smash5, sham_smash6 ] {ai_charge(4);}; -void() sham_smash6 =[ $smash6, sham_smash7 ] {ai_charge(1);}; -void() sham_smash7 =[ $smash7, sham_smash8 ] {ai_charge(0);}; -void() sham_smash8 =[ $smash8, sham_smash9 ] {ai_charge(0);}; -void() sham_smash9 =[ $smash9, sham_smash10 ] {ai_charge(0);}; -void() sham_smash10 =[ $smash10, sham_smash11 ] { -local vector delta; -local float ldmg; - - if(!self.enemy) - return; - ai_charge(0); - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - if(!CanDamage (self.enemy, self)) - return; - - ldmg = (random() + random() + random()) * 40; - T_Damage (self.enemy, self, self, ldmg); - sound(self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); - - SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); - SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); -}; -void() sham_smash11 =[ $smash11, sham_smash12 ] {ai_charge(5);}; -void() sham_smash12 =[ $smash12, sham_run1 ] {ai_charge(4);}; - -void() sham_swingr1; - -void(float side) ShamClaw = -{ -local vector delta; -local float ldmg; - - if(!self.enemy) - return; - ai_charge(10); - - delta = self.enemy.origin - self.origin; - - if(vlen(delta) > 100) - return; - - ldmg = (random() + random() + random()) * 20; - T_Damage (self.enemy, self, self, ldmg); - sound(self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); - - if(side) - { - makevectors (self.angles); - SpawnMeatSpray (self.origin + v_forward*16, side * v_right); - } -}; - -void() sham_swingl1 =[ $swingl1, sham_swingl2 ] { -sound(self, CHAN_VOICE, "shambler/melee2.wav", 1, ATTN_NORM); -ai_charge(5);}; -void() sham_swingl2 =[ $swingl2, sham_swingl3 ] {ai_charge(3);}; -void() sham_swingl3 =[ $swingl3, sham_swingl4 ] {ai_charge(7);}; -void() sham_swingl4 =[ $swingl4, sham_swingl5 ] {ai_charge(3);}; -void() sham_swingl5 =[ $swingl5, sham_swingl6 ] {ai_charge(7);}; -void() sham_swingl6 =[ $swingl6, sham_swingl7 ] {ai_charge(9);}; -void() sham_swingl7 =[ $swingl7, sham_swingl8 ] {ai_charge(5); ShamClaw(250);}; -void() sham_swingl8 =[ $swingl8, sham_swingl9 ] {ai_charge(4);}; -void() sham_swingl9 =[ $swingl9, sham_run1 ] { -ai_charge(8); -if(random()<0.5) - self.think = sham_swingr1; -}; - -void() sham_swingr1 =[ $swingr1, sham_swingr2 ] { -sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); -ai_charge(1);}; -void() sham_swingr2 =[ $swingr2, sham_swingr3 ] {ai_charge(8);}; -void() sham_swingr3 =[ $swingr3, sham_swingr4 ] {ai_charge(14);}; -void() sham_swingr4 =[ $swingr4, sham_swingr5 ] {ai_charge(7);}; -void() sham_swingr5 =[ $swingr5, sham_swingr6 ] {ai_charge(3);}; -void() sham_swingr6 =[ $swingr6, sham_swingr7 ] {ai_charge(6);}; -void() sham_swingr7 =[ $swingr7, sham_swingr8 ] {ai_charge(6); ShamClaw(-250);}; -void() sham_swingr8 =[ $swingr8, sham_swingr9 ] {ai_charge(3);}; -void() sham_swingr9 =[ $swingr9, sham_run1 ] {ai_charge(1); -ai_charge(10); -if(random()<0.5) - self.think = sham_swingl1; -}; - -void() sham_melee = -{ - local float chance; - - chance = random(); - if(chance > 0.6 || self.health == 600) - sham_smash1(); - else if(chance > 0.3) - sham_swingr1(); - else - sham_swingl1(); -}; - - -//============================================================================ - -void() CastLightning = -{ - local vector org, dir; - - self.effects = self.effects | EF_MUZZLEFLASH; - - ai_face(); - - org = self.origin + '0 0 40'; - - dir = self.enemy.origin + '0 0 16' - org; - dir = normalize (dir); - - traceline(org, self.origin + dir*600, TRUE, self); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_LIGHTNING1); - WriteEntity(MSG_BROADCAST, self); - WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); - WriteCoord(MSG_BROADCAST, trace_endpos_x); - WriteCoord(MSG_BROADCAST, trace_endpos_y); - WriteCoord(MSG_BROADCAST, trace_endpos_z); - - LightningDamage (org, trace_endpos, self, 10); -}; - -void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face(); - sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM); -}; -void() sham_magic2 =[ $magic2, sham_magic3 ] {ai_face();}; -void() sham_magic3 =[ $magic3, sham_magic4 ] {ai_face();self.nextthink = self.nextthink + 0.2; -local entity o; - -self.effects = self.effects | EF_MUZZLEFLASH; -ai_face(); -self.owner = spawn(); -o = self.owner; -setmodel (o, "progs/s_light.mdl"); -setorigin (o, self.origin); -o.angles = self.angles; -o.nextthink = time + 0.7; -o.think = SUB_Remove; -}; -void() sham_magic4 =[ $magic4, sham_magic5 ] -{ -self.effects = self.effects | EF_MUZZLEFLASH; -self.owner.frame = 1; -}; -void() sham_magic5 =[ $magic5, sham_magic6 ] -{ -self.effects = self.effects | EF_MUZZLEFLASH; -self.owner.frame = 2; -}; -void() sham_magic6 =[ $magic6, sham_magic9 ] -{ -remove (self.owner); -CastLightning(); -sound(self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM); -}; -void() sham_magic9 =[ $magic9, sham_magic10 ] -{CastLightning();}; -void() sham_magic10 =[ $magic10, sham_magic11 ] -{CastLightning();}; -void() sham_magic11 =[ $magic11, sham_magic12 ] -{ -if(skill == 3) - CastLightning(); -}; -void() sham_magic12 =[ $magic12, sham_run1 ] {}; - - - -void() sham_pain1 =[ $pain1, sham_pain2 ] {}; -void() sham_pain2 =[ $pain2, sham_pain3 ] {}; -void() sham_pain3 =[ $pain3, sham_pain4 ] {}; -void() sham_pain4 =[ $pain4, sham_pain5 ] {}; -void() sham_pain5 =[ $pain5, sham_pain6 ] {}; -void() sham_pain6 =[ $pain6, sham_run1 ] {}; - -void(entity attacker, float damage) sham_pain = -{ - sound(self, CHAN_VOICE, "shambler/shurt2.wav", 1, ATTN_NORM); - - if(self.health <= 0) - return; // allready dying, don't go into pain frame - - if(random()*400 > damage) - return; // didn't flinch - - if(self.pain_finished > time) - return; - self.pain_finished = time + 2; - - sham_pain1(); -}; - - -//============================================================================ - -void(entity entPlayer) ShamblerDropImpl = -{ - if(!TryEnemyDrop(entPlayer, WID_LIGHTNING, 0.5)) - if(!TryEnemyDrop(entPlayer, WID_PROXIMITY_GUN, 0.4)) - if(!TryEnemyDrop(entPlayer, WID_ROCKET_LAUNCHER, 0.4)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_NAILGUN, 0.2)) - if(!TryEnemyDrop(entPlayer, WID_NAILGUN, 0.2)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_SHOTGUN, 0.1)) - if(!TryEnemyDrop(entPlayer, WID_SHOTGUN, 0.1)) - if(!TryEnemyDrop(entPlayer, WID_AXE, 0.1)) - if(!TryEnemyDrop(entPlayer, WID_MJOLNIR, 0.1)) - { /* Intentionally empty. */ } -} - -void() ShamblerDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - - if(entPlayer != world) - { - if(random() > 0.65) { ShamblerDropImpl(entPlayer); } - if(random() > 0.65) { ShamblerDropImpl(entPlayer); } - } -} - - -void() sham_death1 =[ $death1, sham_death2 ] {}; -void() sham_death2 =[ $death2, sham_death3 ] {}; -void() sham_death3 =[ $death3, sham_death4 ] {ShamblerDrop();}; -void() sham_death4 =[ $death4, sham_death5 ] {}; -void() sham_death5 =[ $death5, sham_death6 ] {}; -void() sham_death6 =[ $death6, sham_death7 ] {}; -void() sham_death7 =[ $death7, sham_death8 ] {}; -void() sham_death8 =[ $death8, sham_death9 ] {}; -void() sham_death9 =[ $death9, sham_death10 ] {}; -void() sham_death10 =[ $death10, sham_death11 ] {}; -void() sham_death11 =[ $death11, sham_death11 ] {}; - -void() sham_die = -{ -// check for gib - if(self.health < -60) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_shams.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ShamblerDrop(); - return; - } - -// regular death - sound(self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM); - sham_death1(); -}; - -//============================================================================ - - -/*QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush -*/ -void() monster_shambler = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/shambler.mdl"); - precache_model ("progs/s_light.mdl"); - precache_model ("progs/h_shams.mdl"); - precache_model ("progs/bolt.mdl"); - - precache_sound("shambler/sattck1.wav"); - precache_sound("shambler/sboom.wav"); - precache_sound("shambler/sdeath.wav"); - precache_sound("shambler/shurt2.wav"); - precache_sound("shambler/sidle.wav"); - precache_sound("shambler/ssight.wav"); - precache_sound("shambler/melee1.wav"); - precache_sound("shambler/melee2.wav"); - precache_sound("shambler/smack.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - setmodel (self, "progs/shambler.mdl"); - - setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 600; - - self.th_stand = sham_stand1; - self.th_walk = sham_walk1; - self.th_run = sham_run1; - self.th_die = sham_die; - self.th_melee = sham_melee; - self.th_missile = sham_magic1; - self.th_pain = sham_pain; - - walkmonster_start(); -}; diff --git a/QC/soldier.qc b/QC/soldier.qc deleted file mode 100644 index d596f479..00000000 --- a/QC/soldier.qc +++ /dev/null @@ -1,323 +0,0 @@ -/* -============================================================================== - -SOLDIER / PLAYER - -============================================================================== -*/ - -$cd id1/models/soldier3 -$origin 0 -6 24 -$base base -$skin skin - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 -$frame death9 death10 - -$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 -$frame deathc9 deathc10 deathc11 - -$frame load1 load2 load3 load4 load5 load6 load7 load8 load9 load10 load11 - -$frame pain1 pain2 pain3 pain4 pain5 pain6 - -$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 -$frame painb11 painb12 painb13 painb14 - -$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 -$frame painc11 painc12 painc13 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 - -$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 shoot9 - -$frame prowl_1 prowl_2 prowl_3 prowl_4 prowl_5 prowl_6 prowl_7 prowl_8 -$frame prowl_9 prowl_10 prowl_11 prowl_12 prowl_13 prowl_14 prowl_15 prowl_16 -$frame prowl_17 prowl_18 prowl_19 prowl_20 prowl_21 prowl_22 prowl_23 prowl_24 - -/* -============================================================================== -SOLDIER CODE -============================================================================== -*/ - -void() army_fire; - -void() army_stand1 =[ $stand1, army_stand2 ] {ai_stand();}; -void() army_stand2 =[ $stand2, army_stand3 ] {ai_stand();}; -void() army_stand3 =[ $stand3, army_stand4 ] {ai_stand();}; -void() army_stand4 =[ $stand4, army_stand5 ] {ai_stand();}; -void() army_stand5 =[ $stand5, army_stand6 ] {ai_stand();}; -void() army_stand6 =[ $stand6, army_stand7 ] {ai_stand();}; -void() army_stand7 =[ $stand7, army_stand8 ] {ai_stand();}; -void() army_stand8 =[ $stand8, army_stand1 ] {ai_stand();}; - -void() army_walk1 =[ $prowl_1, army_walk2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); -ai_walk(1);}; -void() army_walk2 =[ $prowl_2, army_walk3 ] {ai_walk(1);}; -void() army_walk3 =[ $prowl_3, army_walk4 ] {ai_walk(1);}; -void() army_walk4 =[ $prowl_4, army_walk5 ] {ai_walk(1);}; -void() army_walk5 =[ $prowl_5, army_walk6 ] {ai_walk(2);}; -void() army_walk6 =[ $prowl_6, army_walk7 ] {ai_walk(3);}; -void() army_walk7 =[ $prowl_7, army_walk8 ] {ai_walk(4);}; -void() army_walk8 =[ $prowl_8, army_walk9 ] {ai_walk(4);}; -void() army_walk9 =[ $prowl_9, army_walk10 ] {ai_walk(2);}; -void() army_walk10 =[ $prowl_10, army_walk11 ] {ai_walk(2);}; -void() army_walk11 =[ $prowl_11, army_walk12 ] {ai_walk(2);}; -void() army_walk12 =[ $prowl_12, army_walk13 ] {ai_walk(1);}; -void() army_walk13 =[ $prowl_13, army_walk14 ] {ai_walk(0);}; -void() army_walk14 =[ $prowl_14, army_walk15 ] {ai_walk(1);}; -void() army_walk15 =[ $prowl_15, army_walk16 ] {ai_walk(1);}; -void() army_walk16 =[ $prowl_16, army_walk17 ] {ai_walk(1);}; -void() army_walk17 =[ $prowl_17, army_walk18 ] {ai_walk(3);}; -void() army_walk18 =[ $prowl_18, army_walk19 ] {ai_walk(3);}; -void() army_walk19 =[ $prowl_19, army_walk20 ] {ai_walk(3);}; -void() army_walk20 =[ $prowl_20, army_walk21 ] {ai_walk(3);}; -void() army_walk21 =[ $prowl_21, army_walk22 ] {ai_walk(2);}; -void() army_walk22 =[ $prowl_22, army_walk23 ] {ai_walk(1);}; -void() army_walk23 =[ $prowl_23, army_walk24 ] {ai_walk(1);}; -void() army_walk24 =[ $prowl_24, army_walk1 ] {ai_walk(1);}; - -void() army_run1 =[ $run1, army_run2 ] { -if(random() < 0.2) - sound(self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); -ai_run(11);}; -void() army_run2 =[ $run2, army_run3 ] {ai_run(15);}; -void() army_run3 =[ $run3, army_run4 ] {ai_run(10);}; -void() army_run4 =[ $run4, army_run5 ] {ai_run(10);}; -void() army_run5 =[ $run5, army_run6 ] {ai_run(8);}; -void() army_run6 =[ $run6, army_run7 ] {ai_run(15);}; -void() army_run7 =[ $run7, army_run8 ] {ai_run(10);}; -void() army_run8 =[ $run8, army_run1 ] {ai_run(8);}; - -void() army_atk1 =[ $shoot1, army_atk2 ] {ai_face();}; -void() army_atk2 =[ $shoot2, army_atk3 ] {ai_face();}; -void() army_atk3 =[ $shoot3, army_atk4 ] {ai_face();}; -void() army_atk4 =[ $shoot4, army_atk5 ] {ai_face();}; -void() army_atk5 =[ $shoot5, army_atk6 ] {ai_face();army_fire(); -self.effects = self.effects | EF_MUZZLEFLASH;}; -void() army_atk6 =[ $shoot6, army_atk7 ] {ai_face();}; -void() army_atk7 =[ $shoot7, army_atk8 ] {ai_face();SUB_CheckRefire (army_atk1);}; -void() army_atk8 =[ $shoot8, army_atk9 ] {ai_face();}; -void() army_atk9 =[ $shoot9, army_run1 ] {ai_face();}; - - -void() army_pain1 =[ $pain1, army_pain2 ] {}; -void() army_pain2 =[ $pain2, army_pain3 ] {}; -void() army_pain3 =[ $pain3, army_pain4 ] {}; -void() army_pain4 =[ $pain4, army_pain5 ] {}; -void() army_pain5 =[ $pain5, army_pain6 ] {}; -void() army_pain6 =[ $pain6, army_run1 ] {ai_pain(1);}; - -void() army_painb1 =[ $painb1, army_painb2 ] {}; -void() army_painb2 =[ $painb2, army_painb3 ] {ai_painforward(13);}; -void() army_painb3 =[ $painb3, army_painb4 ] {ai_painforward(9);}; -void() army_painb4 =[ $painb4, army_painb5 ] {}; -void() army_painb5 =[ $painb5, army_painb6 ] {}; -void() army_painb6 =[ $painb6, army_painb7 ] {}; -void() army_painb7 =[ $painb7, army_painb8 ] {}; -void() army_painb8 =[ $painb8, army_painb9 ] {}; -void() army_painb9 =[ $painb9, army_painb10] {}; -void() army_painb10=[ $painb10, army_painb11] {}; -void() army_painb11=[ $painb11, army_painb12] {}; -void() army_painb12=[ $painb12, army_painb13] {ai_pain(2);}; -void() army_painb13=[ $painb13, army_painb14] {}; -void() army_painb14=[ $painb14, army_run1 ] {}; - -void() army_painc1 =[ $painc1, army_painc2 ] {}; -void() army_painc2 =[ $painc2, army_painc3 ] {ai_pain(1);}; -void() army_painc3 =[ $painc3, army_painc4 ] {}; -void() army_painc4 =[ $painc4, army_painc5 ] {}; -void() army_painc5 =[ $painc5, army_painc6 ] {ai_painforward(1);}; -void() army_painc6 =[ $painc6, army_painc7 ] {ai_painforward(1);}; -void() army_painc7 =[ $painc7, army_painc8 ] {}; -void() army_painc8 =[ $painc8, army_painc9 ] {ai_pain(1);}; -void() army_painc9 =[ $painc9, army_painc10] {ai_painforward(4);}; -void() army_painc10=[ $painc10, army_painc11] {ai_painforward(3);}; -void() army_painc11=[ $painc11, army_painc12] {ai_painforward(6);}; -void() army_painc12=[ $painc12, army_painc13] {ai_painforward(8);}; -void() army_painc13=[ $painc13, army_run1] {}; - -void(entity attacker, float damage) army_pain = -{ - local float r; - - if(self.pain_finished > time) - return; - - r = random(); - - if(r < 0.2) - { - self.pain_finished = time + 0.6; - army_pain1(); - sound(self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); - } - else if(r < 0.6) - { - self.pain_finished = time + 1.1; - army_painb1(); - sound(self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); - } - else - { - self.pain_finished = time + 1.1; - army_painc1(); - sound(self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); - } -}; - - -void() army_fire = -{ - // local vector src, vec; - local vector dir; - local entity en; - - ai_face(); - - sound(self, CHAN_WEAPON, "soldier/sattck1.wav", 1, ATTN_NORM); - - // TODO VR: (P2) opportunity for extra difficulty - // fire somewhat behind the player, so a dodging player is harder to hit - en = self.enemy; - - // TODO VR: (P2) this works - // self.scale = ((self.scale + '1 1 1') * 1.1) - '1 1 1'; - - dir = en.origin - en.velocity*0.2; - dir = normalize (dir - self.origin); - - EnemyFireBullets (4, dir, '0.1 0.1 0'); - - // TODO VR: (P2) nail shooting variant? - // makevectors(self.angles); - // src = self.origin - '0 0 19' + v_forward*14; - // vec = (self.enemy.origin + (200*v_forward)) - src; - // vec = normalize(vec); - // sound(self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); - // launch_spike (src, vec); -}; - -void() SoldierDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - self.ammo_shells = 5; - DropBackpack(); - - if(entPlayer != world && random() > 0.65) - { - if(!TryEnemyDrop(entPlayer, WID_AXE, 0.2)) - if(!TryEnemyDrop(entPlayer, WID_SHOTGUN, 0.4)) - if(!TryEnemyDrop(entPlayer, WID_SUPER_SHOTGUN, 0.6)) - { /* Intentionally empty. */ } - } -} - -void() army_die1 =[ $death1, army_die2 ] {}; -void() army_die2 =[ $death2, army_die3 ] {}; -void() army_die3 =[ $death3, army_die4 ] -{ - SoldierDrop(); -}; -void() army_die4 =[ $death4, army_die5 ] {}; -void() army_die5 =[ $death5, army_die6 ] {}; -void() army_die6 =[ $death6, army_die7 ] {}; -void() army_die7 =[ $death7, army_die8 ] {}; -void() army_die8 =[ $death8, army_die9 ] {}; -void() army_die9 =[ $death9, army_die10 ] {}; -void() army_die10 =[ $death10, army_die10 ] {}; - -void() army_cdie1 =[ $deathc1, army_cdie2 ] {}; -void() army_cdie2 =[ $deathc2, army_cdie3 ] {ai_back(5);}; -void() army_cdie3 =[ $deathc3, army_cdie4 ] -{ - SoldierDrop(); - ai_back(4); -}; -void() army_cdie4 =[ $deathc4, army_cdie5 ] {ai_back(13);}; -void() army_cdie5 =[ $deathc5, army_cdie6 ] {ai_back(3);}; -void() army_cdie6 =[ $deathc6, army_cdie7 ] {ai_back(4);}; -void() army_cdie7 =[ $deathc7, army_cdie8 ] {}; -void() army_cdie8 =[ $deathc8, army_cdie9 ] {}; -void() army_cdie9 =[ $deathc9, army_cdie10 ] {}; -void() army_cdie10 =[ $deathc10, army_cdie11 ] {}; -void() army_cdie11 =[ $deathc11, army_cdie11 ] {}; - - -void() army_die = -{ -// check for gib - if(self.health < -35) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_guard.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - SoldierDrop(); - return; - } - -// regular death - sound(self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); - if(random() < 0.5) - army_die1(); - else - army_cdie1(); -}; - - -/*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush -*/ -void() monster_army = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/soldier.mdl"); - precache_model ("progs/h_guard.mdl"); - precache_model ("progs/gib1.mdl"); - precache_model ("progs/gib2.mdl"); - precache_model ("progs/gib3.mdl"); - - precache_sound("soldier/death1.wav"); - precache_sound("soldier/idle.wav"); - precache_sound("soldier/pain1.wav"); - precache_sound("soldier/pain2.wav"); - precache_sound("soldier/sattck1.wav"); - precache_sound("soldier/sight1.wav"); - - precache_sound("player/udeath.wav"); // gib death - - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/soldier.mdl"); - - setsize (self, '-12 -12 -24', '12 12 26'); - - // TODO VR: (P2) this works - // self.scale_origin = '0 0 25'; - - self.health = 30; - - self.th_stand = army_stand1; - self.th_walk = army_walk1; - self.th_run = army_run1; - self.th_missile = army_atk1; - self.th_pain = army_pain; - self.th_die = army_die; - - walkmonster_start(); -}; diff --git a/QC/subs.qc b/QC/subs.qc index 08bedcc2..541130d4 100644 --- a/QC/subs.qc +++ b/QC/subs.qc @@ -18,7 +18,7 @@ void() SetMovedir = self.movedir = '0 0 -1'; else { - makevectors (self.angles); + makevectors(self.angles); self.movedir = v_forward; } @@ -37,7 +37,7 @@ void() InitTrigger = if(self.angles != '0 0 0') SetMovedir(); self.solid = SOLID_TRIGGER; - setmodel (self, self.model); // set size and link into world + setmodel(self, self.model); // set size and link into world self.movetype = MOVETYPE_NONE; self.modelindex = 0; self.model = ""; @@ -53,7 +53,7 @@ self.origin traveling at speed */ void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = { -local entity stemp; +entity stemp; stemp = self; self = ent; @@ -63,8 +63,8 @@ local entity stemp; void(vector tdest, float tspeed, void() func) SUB_CalcMove = { -local vector vdestdelta; -local float len, traveltime; +vector vdestdelta; +float len, traveltime; if(!tspeed) objerror("No speed is defined!"); @@ -84,7 +84,7 @@ local float len, traveltime; vdestdelta = tdest - self.origin; // calculate length of vector - len = vlen (vdestdelta); + len = vlen(vdestdelta); // divide by speed to get time to reach dest traveltime = len / tspeed; @@ -130,7 +130,7 @@ The calling function should make sure self.think is valid */ void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = { -local entity stemp; +entity stemp; stemp = self; self = ent; SUB_CalcAngleMove (destangle, tspeed, func); @@ -139,8 +139,8 @@ local entity stemp; void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = { -local vector destdelta; -local float len, traveltime; +vector destdelta; +float len, traveltime; if(!tspeed) objerror("No speed is defined!"); @@ -149,7 +149,7 @@ local float len, traveltime; destdelta = destangle - self.angles; // calculate length of vector - len = vlen (destdelta); + len = vlen(destdelta); // divide by speed to get time to reach dest traveltime = len / tspeed; @@ -182,10 +182,17 @@ void() SUB_CalcAngleMoveDone = //============================================================================= +// HONEY +.entity delayedThink; + void() DelayThink = { activator = self.enemy; SUB_UseTargets(); + + // HONEY + self.owner.delayedThink = world; + remove(self); }; @@ -210,7 +217,7 @@ match (string)self.target and call their .use function */ void() SUB_UseTargets = { - local entity t, stemp, otemp, act; + entity t, stemp, otemp, act; // // check for a delay @@ -226,6 +233,11 @@ void() SUB_UseTargets = t.message = self.message; t.killtarget = self.killtarget; t.target = self.target; + + // HONEY + t.owner = self; + self.delayedThink = t; + return; } @@ -235,7 +247,7 @@ void() SUB_UseTargets = // if(activator.classname == "player" && self.message != "") { - centerprint (activator, self.message); + centerprint(activator, self.message); if(!self.noise) sound(activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); } @@ -243,31 +255,47 @@ void() SUB_UseTargets = // // kill the killtagets // - if(self.killtarget) + if(self.killtarget != NULLSTR) { - t = world; - do + t = find(world, targetname, self.killtarget); + while(t) { - t = find (t, targetname, self.killtarget); - if(!t) - return; - remove (t); - } while( 1 ); + // HONEY + if(t.delayedThink) remove(t.delayedThink); + if(t.classname == "func_button"){ + if(t.spawnflags & 1){ //Disableable button spawnflag + button_disable(t); + }else{ + remove(t); + } + }else if(t.classname == "func_door_secret"){ + //Honey hack to stop a secret door killed mid-move to play its noise endlessly + //dprint("killed func_door_secret\n"); + if(t.velocity != '0 0 0') + sound(t, CHAN_VOICE, t.noise3, 1, ATTN_NORM); + remove(t); + }else if(t.flags & FL_MONSTER && t.health > 0){ + Killed (t, activator); + }else{ + remove (t); + } + t = find(t, targetname, self.killtarget); + } } // // fire targets // - if(self.target) + if(self.target != NULLSTR) { act = activator; t = world; do { - t = find (t, targetname, self.target); + t = find(t, targetname, self.target); if(!t) { - return; + break; } stemp = self; otemp = other; @@ -281,7 +309,7 @@ void() SUB_UseTargets = self = stemp; other = otemp; activator = act; - } while( 1 ); + } while(1); } diff --git a/QC/tarbaby.qc b/QC/tarbaby.qc deleted file mode 100644 index afa0af1c..00000000 --- a/QC/tarbaby.qc +++ /dev/null @@ -1,222 +0,0 @@ -/* -============================================================================== - -BLOB - -============================================================================== -*/ - -$cd id1/models/tarbaby -$origin 0 0 24 -$base base - -$skin skin - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 -$frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 -$frame walk20 walk21 walk22 walk23 walk24 walk25 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13 -$frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23 -$frame run24 run25 - -$frame jump1 jump2 jump3 jump4 jump5 jump6 - -$frame fly1 fly2 fly3 fly4 - -$frame exp - -void() tbaby_stand1 =[ $walk1, tbaby_stand1 ] {ai_stand();}; - -void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();}; - -void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();}; -void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();}; -void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();}; -void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();}; -void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();}; -void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_turn();}; -void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_turn();}; -void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_turn();}; -void() tbaby_walk9 =[ $walk9, tbaby_walk10 ] {ai_turn();}; -void() tbaby_walk10 =[ $walk10, tbaby_walk11 ] {ai_turn();}; -void() tbaby_walk11 =[ $walk11, tbaby_walk12 ] {ai_walk(2);}; -void() tbaby_walk12 =[ $walk12, tbaby_walk13 ] {ai_walk(2);}; -void() tbaby_walk13 =[ $walk13, tbaby_walk14 ] {ai_walk(2);}; -void() tbaby_walk14 =[ $walk14, tbaby_walk15 ] {ai_walk(2);}; -void() tbaby_walk15 =[ $walk15, tbaby_walk16 ] {ai_walk(2);}; -void() tbaby_walk16 =[ $walk16, tbaby_walk17 ] {ai_walk(2);}; -void() tbaby_walk17 =[ $walk17, tbaby_walk18 ] {ai_walk(2);}; -void() tbaby_walk18 =[ $walk18, tbaby_walk19 ] {ai_walk(2);}; -void() tbaby_walk19 =[ $walk19, tbaby_walk20 ] {ai_walk(2);}; -void() tbaby_walk20 =[ $walk20, tbaby_walk21 ] {ai_walk(2);}; -void() tbaby_walk21 =[ $walk21, tbaby_walk22 ] {ai_walk(2);}; -void() tbaby_walk22 =[ $walk22, tbaby_walk23 ] {ai_walk(2);}; -void() tbaby_walk23 =[ $walk23, tbaby_walk24 ] {ai_walk(2);}; -void() tbaby_walk24 =[ $walk24, tbaby_walk25 ] {ai_walk(2);}; -void() tbaby_walk25 =[ $walk25, tbaby_walk1 ] {ai_walk(2);}; - -void() tbaby_run1 =[ $run1, tbaby_run2 ] {ai_face();}; -void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();}; -void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();}; -void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();}; -void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();}; -void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();}; -void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_face();}; -void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_face();}; -void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_face();}; -void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_face();}; -void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);}; -void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(2);}; -void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(2);}; -void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(2);}; -void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_run(2);}; -void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_run(2);}; -void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);}; -void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(2);}; -void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(2);}; -void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(2);}; -void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(2);}; -void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);}; -void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);}; -void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(2);}; -void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(2);}; - - -//============================================================================ - - -void() tbaby_jump1; - -void() Tar_JumpTouch = -{ - local float ldmg; - - if(other.takedamage && other.classname != self.classname) - { - if( vlen(self.velocity) > 400 ) - { - ldmg = 10 + 10*random(); - T_Damage (other, self, self, ldmg); - sound(self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM); - } - } - else - sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); - - - if(!checkbottom(self)) - { - if(self.flags & FL_ONGROUND) - { // jump randomly to not get hung up -//dprint ("popjump\n"); - self.touch = SUB_Null; - self.think = tbaby_run1; - self.movetype = MOVETYPE_STEP; - self.nextthink = time + 0.1; - -// self.velocity_x = (random() - 0.5) * 600; -// self.velocity_y = (random() - 0.5) * 600; -// self.velocity_z = 200; -// self.flags = self.flags - FL_ONGROUND; - } - return; // not on ground yet - } - - self.touch = SUB_Null; - self.think = tbaby_jump1; - self.nextthink = time + 0.1; -}; - -void() tbaby_jump5; - -void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {}; -void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {}; -void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {}; -void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] { -self.cnt = self.cnt + 1; -if(self.cnt == 4) -{ -//dprint ("spawn hop\n"); -tbaby_jump5(); -} -}; - -void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();}; -void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();}; -void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();}; -void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();}; -void() tbaby_jump5 =[ $jump5, tbaby_jump6 ] -{ - self.movetype = MOVETYPE_BOUNCE; - self.touch = Tar_JumpTouch; - makevectors (self.angles); - self.origin_z = self.origin_z + 1; - self.velocity = v_forward * 600 + '0 0 200'; - self.velocity_z = self.velocity_z + random()*150; - if(self.flags & FL_ONGROUND) - self.flags = self.flags - FL_ONGROUND; - self.cnt = 0; -}; -void() tbaby_jump6 =[ $jump6,tbaby_fly1 ] {}; - - - -//============================================================================= - -void() tbaby_die1 =[ $exp, tbaby_die2 ] { -self.takedamage = DAMAGE_NO; -}; -void() tbaby_die2 =[ $exp, tbaby_run1 ] -{ - T_RadiusDamage (self, self, 120, world); - - sound(self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM); - self.origin = self.origin - 8*normalize(self.velocity); - - WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_TAREXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); - - BecomeExplosion(); -}; - -//============================================================================= - - -/*QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush -*/ -void() monster_tarbaby = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model2 ("progs/tarbaby.mdl"); - - precache_sound2 ("blob/death1.wav"); - precache_sound2 ("blob/hit1.wav"); - precache_sound2 ("blob/land1.wav"); - precache_sound2 ("blob/sight1.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/tarbaby.mdl"); - - setsize (self, '-12 -12 -24', '12 12 24'); - self.health = 80; - - self.th_stand = tbaby_stand1; - self.th_walk = tbaby_walk1; - self.th_run = tbaby_run1; - self.th_missile = tbaby_jump1; - self.th_melee = tbaby_jump1; - self.th_die = tbaby_die1; - - walkmonster_start(); -}; - diff --git a/QC/triggers.qc b/QC/triggers.qc index 267548b2..c43d0abb 100644 --- a/QC/triggers.qc +++ b/QC/triggers.qc @@ -1,7 +1,3 @@ - -entity s; - - void() trigger_reactivate = { self.solid = SOLID_TRIGGER; @@ -40,9 +36,16 @@ void() multi_trigger = return; found_secrets = found_secrets + 1; WriteByte(MSG_ALL, SVC_FOUNDSECRET); + + // HONEY + self.think = SUB_Null; + if(skill == 0){ + + remove(self.oldenemy); + } } - if(self.noise) + if(self.noise != NULLSTR) sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM); // don't trigger again until reset @@ -58,8 +61,8 @@ void() multi_trigger = self.nextthink = time + self.wait; } else - { // we can't just remove (self) here, because this is a touch function - // called wheil C code is looping through area links... + { // we can't just remove(self) here, because this is a touch function + // called while C code is looping through area links... self.touch = SUB_Null; self.nextthink = time + 0.1; self.think = SUB_Remove; @@ -99,7 +102,7 @@ void() multi_touch = // if the trigger has an angles field, check player's facing direction if(self.movedir != '0 0 0') { - makevectors (other.angles); + makevectors(other.angles); if(v_forward * self.movedir < 0) return; // not facing the right way } @@ -155,11 +158,11 @@ void() trigger_multiple = self.th_die = multi_killed; self.takedamage = DAMAGE_YES; self.solid = SOLID_BBOX; - setorigin (self, self.origin); // make sure it links into the world + setorigin(self, self.origin); // make sure it links into the world } else { - if( !(self.spawnflags & SPAWNFLAG_NOTOUCH) ) + if(!(self.spawnflags & SPAWNFLAG_NOTOUCH)) { self.touch = multi_touch; } @@ -167,8 +170,20 @@ void() trigger_multiple = // HIPNOTIC //MED 12/01/96 added cnt stuff - if(self.cnt == 0) - self.cnt = -1; + if(self.cnt == 0) + { + self.cnt = -1; + } + + // HONEY + // Stupid hack + if(VR_GameUtil_EnableHoneyExtensions()) + { + if(self.target == "" && self.message != "" && self.wait != 2) + { + self.wait = 2; + } + } }; @@ -215,10 +230,16 @@ set "message" to text string */ void() trigger_secret = { - total_secrets = total_secrets + 1; + vector o; + entity secamb; + float sk; + + total_secrets += 1; self.wait = -1; + if(!self.message) self.message = "You found a secret area!"; + if(!self.sounds) self.sounds = 1; @@ -234,6 +255,16 @@ void() trigger_secret = } trigger_multiple(); + + // HONEY + sk = cvar_hget(cvarh_skill); // Stupid hack because the skill global isn't set + // until in the first StartFrame call + if(sk == 0) + { + o = (self.mins + self.maxs) * 0.5; + secamb = ambient_secret_spawn(o); + self.oldenemy = secamb; + } }; //============================================================================= @@ -251,13 +282,13 @@ void() counter_use = && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) { if(self.count >= 4) - centerprint (activator, "There are more to go..."); + centerprint(activator, "There are more to go..."); else if(self.count == 3) - centerprint (activator, "Only 3 more to go..."); + centerprint(activator, "Only 3 more to go..."); else if(self.count == 2) - centerprint (activator, "Only 2 more to go..."); + centerprint(activator, "Only 2 more to go..."); else - centerprint (activator, "Only 1 more to go..."); + centerprint(activator, "Only 1 more to go..."); } return; } @@ -296,11 +327,13 @@ TELEPORT TRIGGERS float PLAYER_ONLY = 1; float SILENT = 2; +float CTF_ONLY = 4; +float IGNORE_TARGETNAME = 8; // HONEY void() play_teleport = { - local float v; - local string tmpstr; + float v; + string tmpstr; v = random() * 5; if(v < 1) @@ -315,11 +348,12 @@ void() play_teleport = tmpstr = "misc/r_tele5.wav"; sound(self, CHAN_VOICE, tmpstr, 1, ATTN_NORM); - remove (self); + remove(self); }; void(vector org) spawn_tfog = { + entity s; s = spawn(); s.origin = org; s.nextthink = time + 0.2; @@ -327,9 +361,7 @@ void(vector org) spawn_tfog = WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_TELEPORT); - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); + WriteVec3(MSG_BROADCAST, org); }; @@ -345,7 +377,7 @@ void() tdeath_touch = self.classname = "teledeath2"; if(self.owner.classname != "player") { // other monsters explode themselves - T_Damage (self.owner, self, self, 50000); + T_Damage(self.owner, self, self, 50000); return; } @@ -353,22 +385,22 @@ void() tdeath_touch = if(other.health) { - T_Damage (other, self, self, 50000); + T_Damage(other, self, self, 50000); } }; void(vector org, entity death_owner) spawn_tdeath = { -local entity death; +entity death; death = spawn(); death.classname = "teledeath"; death.movetype = MOVETYPE_NONE; death.solid = SOLID_TRIGGER; death.angles = '0 0 0'; - setsize (death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1'); - setorigin (death, org); + setsize(death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1'); + setorigin(death, org); death.touch = tdeath_touch; death.nextthink = time + 0.2; death.think = SUB_Remove; @@ -379,12 +411,12 @@ local entity death; void() teleport_touch = { -local entity t; -local vector org; +entity t; +vector org; - if(self.targetname) + if(self.targetname != NULLSTR) { - if(self.nextthink < time) + if(/* HONEY */ !(self.spawnflags & IGNORE_TARGETNAME) && self.nextthink < time) { return; // not fired yet } @@ -405,12 +437,12 @@ local vector org; // put a tfog where the player was spawn_tfog (other.origin); - t = find (world, targetname, self.target); + t = find(world, targetname, self.target); if(!t) objerror ("couldn't find target"); // spawn a tfog flash in front of the destination - makevectors (t.mangle); + makevectors(t.mangle); org = t.origin + 32 * v_forward; spawn_tfog (org); @@ -424,7 +456,7 @@ local vector org; return; } - setorigin (other, t.origin); + setorigin(other, t.origin); other.angles = t.mangle; if(other.classname == "player") { @@ -458,14 +490,30 @@ void() teleport_use = self.think = SUB_Null; }; -/*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT +/*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT CTF_ONLY Any object touching this will be transported to the corresponding info_teleport_destination entity. You must set the "target" field, and create an object with a "targetname" field that matches. If the trigger_teleport has a targetname, it will only teleport entities when it has been fired. */ void() trigger_teleport = { - local vector o; + vector o; + + // HONEY + if(self.spawnflags & SPAWNFLAG_TRIGGER_SPAWN){ + self.use = trigger_teleport; + self.spawnflags = (self.spawnflags & PLAYER_ONLY) | SILENT | IGNORE_TARGETNAME; + return; + } + + if(self.spawnflags & CTF_ONLY) + { + if(teamplay < TEAM_CTF || teamplay > TEAM_CTF_ALT) + { + remove(self); + return; + } + } InitTrigger(); self.touch = teleport_touch; @@ -525,17 +573,17 @@ void() trigger_onlyregistered_touch = return; self.attack_finished = time + 2; - if(cvar("registered")) + if(cvar_hget(cvarh_registered)) { self.message = ""; SUB_UseTargets(); - remove (self); + remove(self); } else { if(self.message != "") { - centerprint (other, self.message); + centerprint(other, self.message); sound(other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); } } @@ -555,10 +603,10 @@ void() trigger_onlyregistered = // HIPNOTIC //JIM -void( entity ent, float amount ) hurt_setdamage = +void(entity ent, float amount) hurt_setdamage = { ent.dmg = amount; - if( !amount ) + if(!amount) { ent.solid = SOLID_NOT; } @@ -573,6 +621,9 @@ void() hurt_on = { self.solid = SOLID_TRIGGER; self.nextthink = -1; + + // HONEY + force_retouch = 2; }; void() hurt_touch = @@ -580,7 +631,7 @@ void() hurt_touch = if(other.takedamage) { self.solid = SOLID_NOT; - T_Damage (other, self, self, self.dmg); + T_Damage(other, self, self, self.dmg); self.think = hurt_on; self.nextthink = time + 1; @@ -623,12 +674,22 @@ void() trigger_hurt = //============================================================================ -float PUSH_ONCE = 1; +float PUSH_ONCE = 1; +float PUSH_TOGL = 2; +float PUSH_ACTIVE = 4; void() trigger_push_touch = { + if(!(self.spawnflags & PUSH_ACTIVE)) + return; + if(other.classname == "grenade") other.velocity = self.speed * self.movedir * 10; + else if(other.classname == "MiniGrenade") + other.velocity = self.speed * self.movedir * 10; + else if(other.classname == "MultiGrenade") + other.velocity = self.speed * self.movedir * 10; + else if(other.health > 0) { other.velocity = self.speed * self.movedir * 10; @@ -645,12 +706,27 @@ void() trigger_push_touch = remove(self); }; +void() trigger_push_use = +{ + if(self.spawnflags & PUSH_ACTIVE) + self.spawnflags = self.spawnflags - PUSH_ACTIVE; + else + self.spawnflags = self.spawnflags + PUSH_ACTIVE; +}; + + +/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE PUSH_TOGL PUSH_ACTIVE +Pushes the player. -/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE -Pushes the player +speed: velocity of push. (default 1000) */ void() trigger_push = { + if(self.spawnflags & PUSH_TOGL) + self.use = trigger_push_use; + else + self.spawnflags = self.spawnflags + PUSH_ACTIVE; + InitTrigger(); precache_sound("ambience/windfly.wav"); self.touch = trigger_push_touch; @@ -660,22 +736,41 @@ void() trigger_push = //============================================================================ +// HONEY +float ALWAYS_JUMP = 2; +float NO_VELOCITY = 4; + + void() trigger_monsterjump_touch = { - if( other.flags & (FL_MONSTER | FL_FLY | FL_SWIM) != FL_MONSTER ) + if(other.flags & (FL_MONSTER | FL_FLY | FL_SWIM) != FL_MONSTER) + return; + + // HONEY + if(self.message != "" && other.classname != self.message) return; // set XY even if not on ground, so the jump will clear lips other.velocity_x = self.movedir_x * self.speed; other.velocity_y = self.movedir_y * self.speed; - if( !(other.flags & FL_ONGROUND) ) + if(!(other.flags & FL_ONGROUND)){ return; + } other.flags = other.flags - FL_ONGROUND; other.velocity_z = self.height; + // HONEY + if(self.spawnflags & PUSH_ONCE){ + if(self.delay){ + SUB_DoLater(SUB_Remove, self.delay); + }else{ + SUB_Remove(); + } + } + // HIPNOTIC //MED 12/01/96 added count stuff if(self.cnt>0) @@ -710,6 +805,7 @@ void() trigger_monsterjump = //MED 12/01/96 added count stuff if(self.cnt == 0) self.cnt = -1; + InitTrigger(); self.touch = trigger_monsterjump_touch; }; diff --git a/QC/vr_ammoutil.qc b/QC/vr_ammoutil.qc new file mode 100644 index 00000000..ac86a591 --- /dev/null +++ b/QC/vr_ammoutil.qc @@ -0,0 +1,93 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +float(float xAid) VR_AmmoUtil_AmmoIdToItemId = +{ + if(xAid == AID_SHELLS) { return IID_SHELLS; } + if(xAid == AID_NAILS) { return IID_NAILS; } + if(xAid == AID_ROCKETS) { return IID_ROCKETS; } + if(xAid == AID_CELLS) { return IID_CELLS; } + if(xAid == AID_LAVA_NAILS) { return IID_LAVA_NAILS; } + if(xAid == AID_MULTI_ROCKETS) { return IID_MULTI_ROCKETS; } + if(xAid == AID_PLASMA) { return IID_PLASMA_AMMO; } + + ASSERT(FALSE); + return 0; +} + +float(entity xEnt, float xAid) VR_AmmoUtil_GetAmmoCountByAmmoId = +{ + if(xAid == AID_SHELLS) { return xEnt.ammo_shells; } + if(xAid == AID_NAILS) { return xEnt.ammo_nails; } + if(xAid == AID_ROCKETS) { return xEnt.ammo_rockets; } + if(xAid == AID_CELLS) { return xEnt.ammo_cells; } + if(xAid == AID_LAVA_NAILS) { return xEnt.ammo_lava_nails; } + if(xAid == AID_MULTI_ROCKETS) { return xEnt.ammo_multi_rockets; } + if(xAid == AID_PLASMA) { return xEnt.ammo_plasma; } + + ASSERT(FALSE); + return 0; +} + +void(entity xEnt, float xAid, float xValue) VR_AmmoUtil_SetAmmoCountByAmmoId = +{ + if(xAid == AID_SHELLS) { xEnt.ammo_shells = xValue; return; } + if(xAid == AID_NAILS) { xEnt.ammo_nails = xValue; return; } + if(xAid == AID_ROCKETS) { xEnt.ammo_rockets = xValue; return; } + if(xAid == AID_CELLS) { xEnt.ammo_cells = xValue; return; } + if(xAid == AID_LAVA_NAILS) { xEnt.ammo_lava_nails = xValue; return; } + if(xAid == AID_MULTI_ROCKETS) { xEnt.ammo_multi_rockets = xValue; return; } + if(xAid == AID_PLASMA) { xEnt.ammo_plasma = xValue; return; } + + ASSERT(FALSE); +} + +void(entity xEnt, float xAid, float xValue) VR_AmmoUtil_AddAmmoCountByAmmoId = +{ + if(xAid == AID_SHELLS) { xEnt.ammo_shells = xEnt.ammo_shells + xValue; return; } + if(xAid == AID_NAILS) { xEnt.ammo_nails = xEnt.ammo_nails + xValue; return; } + if(xAid == AID_ROCKETS) { xEnt.ammo_rockets = xEnt.ammo_rockets + xValue; return; } + if(xAid == AID_CELLS) { xEnt.ammo_cells = xEnt.ammo_cells + xValue; return; } + if(xAid == AID_LAVA_NAILS) { xEnt.ammo_lava_nails = xEnt.ammo_lava_nails + xValue; return; } + if(xAid == AID_MULTI_ROCKETS) { xEnt.ammo_multi_rockets = xEnt.ammo_multi_rockets + xValue; return; } + if(xAid == AID_PLASMA) { xEnt.ammo_plasma = xEnt.ammo_plasma + xValue; return; } + + ASSERT(FALSE); +} + +string(float xAid) VR_AmmoUtil_AmmoIdToItemName = +{ + if(xAid == AID_SHELLS) { return ITEM_NAME_SHELLS; } + if(xAid == AID_NAILS) { return ITEM_NAME_SPIKES; } + if(xAid == AID_ROCKETS) { return ITEM_NAME_ROCKETS; } + if(xAid == AID_CELLS) { return ITEM_NAME_CELLS; } + if(xAid == AID_LAVA_NAILS) { return ITEM_NAME_LAVA_NAILS; } + if(xAid == AID_MULTI_ROCKETS) { return ITEM_NAME_MULTI_ROCKETS; } + if(xAid == AID_PLASMA) { return ITEM_NAME_PLASMA; } + + ASSERT(FALSE); + return NULLSTR; +} + +string(float xAid) VR_AmmoUtil_AmmoIdToNetname = +{ + if(xAid == AID_SHELLS) { return "shells"; } + if(xAid == AID_NAILS) { return "nails"; } + if(xAid == AID_ROCKETS) { return "rockets"; } + if(xAid == AID_CELLS) { return "cells"; } + if(xAid == AID_LAVA_NAILS) { return "lava nails"; } + if(xAid == AID_MULTI_ROCKETS) { return "multi rockets"; } + if(xAid == AID_PLASMA) { return "plasma"; } + + ASSERT(FALSE); + return NULLSTR; +} + +void(entity xEnt, float xAid, float xValue) VR_AmmoUtil_DelAmmoCountByAmmoId = +{ + VR_AmmoUtil_AddAmmoCountByAmmoId(xEnt, xAid, -xValue); +} diff --git a/QC/vr_cvars.qc b/QC/vr_cvars.qc new file mode 100644 index 00000000..3ae90f2d --- /dev/null +++ b/QC/vr_cvars.qc @@ -0,0 +1,149 @@ +// +// +// +// ---------------------------------------------------------------------------- +// CVar Handle Variables +// ---------------------------------------------------------------------------- + +float cvarh_deathmatch; +float cvarh_fraglimit; +float cvarh_gamecfg; +float cvarh_noexit; +float cvarh_registered; +float cvarh_samelevel; +float cvarh_saved1; +float cvarh_saved2; +float cvarh_saved3; +float cvarh_saved4; +float cvarh_scratch1; +float cvarh_scratch2; +float cvarh_scratch3; +float cvarh_scratch4; +float cvarh_skill; +float cvarh_sv_accelerate; +float cvarh_sv_aim; +float cvarh_sv_friction; +float cvarh_sv_gravity; +float cvarh_sv_maxspeed; +float cvarh_sv_stopspeed; +float cvarh_teamplay; +float cvarh_temp1; +float cvarh_timelimit; +float cvarh_v_ipitch_level; +float cvarh_v_iroll_level; +float cvarh_v_iyaw_level; +float cvarh_vr_ammobox_drops_chance_mult; +float cvarh_vr_ammobox_drops; +float cvarh_vr_body_interactions; +float cvarh_vr_enabled; +float cvarh_vr_enemy_drops_chance_mult; +float cvarh_vr_enemy_drops; +float cvarh_vr_fakevr; +float cvarh_vr_forcegrab_eligible_haptics; +float cvarh_vr_forcegrab_eligible_particles; +float cvarh_vr_forcegrab_mode; +float cvarh_vr_forcegrab_powermult; +float cvarh_vr_forcegrab_radius; +float cvarh_vr_forcegrab_range; +float cvarh_vr_holster_haptics; +float cvarh_vr_holster_mode; +float cvarh_vr_melee_bloodlust; +float cvarh_vr_melee_bloodlust_mult; +float cvarh_vr_melee_dmg_multiplier; +float cvarh_vr_melee_range_multiplier; +float cvarh_vr_melee_threshold; +float cvarh_vr_positional_damage; +float cvarh_vr_weapon_cycle_mode; +float cvarh_vr_weapon_throw_damage_mult; +float cvarh_vr_weapon_throw_mode; +float cvarh_vr_weapon_throw_velocity_mult; +float cvarh_vr_weapondrop_particles; +float cvarh_vr_2h_spread_reduction; +float cvarh_vr_2h_throw_velocity_mult; +float cvarh_vr_headbutt_velocity_threshold; +float cvarh_vr_headbutt_damage_mult; +float cvarh_vr_verbosebots; +float cvarh_vr_forcegrabbable_ammo_boxes; +float cvarh_vr_forcegrabbable_health_boxes; +float cvarh_vr_forcegrabbable_return_time_deathmatch; +float cvarh_vr_forcegrabbable_return_time_singleplayer; + +// +// +// +// ---------------------------------------------------------------------------- +// CVar Handle Initialization +// ---------------------------------------------------------------------------- + +void() VR_CVars_InitAllHandles = +{ + cvar_hclear(); + +#define VR_CVAR_HMAKE(xName) \ + cvarh_ ## xName = cvar_hmake(#xName) + + VR_CVAR_HMAKE(deathmatch); + VR_CVAR_HMAKE(fraglimit); + VR_CVAR_HMAKE(gamecfg); + VR_CVAR_HMAKE(noexit); + VR_CVAR_HMAKE(registered); + VR_CVAR_HMAKE(samelevel); + VR_CVAR_HMAKE(saved1); + VR_CVAR_HMAKE(saved2); + VR_CVAR_HMAKE(saved3); + VR_CVAR_HMAKE(saved4); + VR_CVAR_HMAKE(scratch1); + VR_CVAR_HMAKE(scratch2); + VR_CVAR_HMAKE(scratch3); + VR_CVAR_HMAKE(scratch4); + VR_CVAR_HMAKE(skill); + VR_CVAR_HMAKE(sv_accelerate); + VR_CVAR_HMAKE(sv_aim); + VR_CVAR_HMAKE(sv_friction); + VR_CVAR_HMAKE(sv_gravity); + VR_CVAR_HMAKE(sv_maxspeed); + VR_CVAR_HMAKE(sv_stopspeed); + VR_CVAR_HMAKE(teamplay); + VR_CVAR_HMAKE(temp1); + VR_CVAR_HMAKE(timelimit); + VR_CVAR_HMAKE(v_ipitch_level); + VR_CVAR_HMAKE(v_iroll_level); + VR_CVAR_HMAKE(v_iyaw_level); + VR_CVAR_HMAKE(vr_ammobox_drops); + VR_CVAR_HMAKE(vr_ammobox_drops_chance_mult); + VR_CVAR_HMAKE(vr_body_interactions); + VR_CVAR_HMAKE(vr_enabled); + VR_CVAR_HMAKE(vr_enemy_drops); + VR_CVAR_HMAKE(vr_enemy_drops_chance_mult); + VR_CVAR_HMAKE(vr_fakevr); + VR_CVAR_HMAKE(vr_forcegrab_eligible_haptics); + VR_CVAR_HMAKE(vr_forcegrab_eligible_particles); + VR_CVAR_HMAKE(vr_forcegrab_mode); + VR_CVAR_HMAKE(vr_forcegrab_powermult); + VR_CVAR_HMAKE(vr_forcegrab_radius); + VR_CVAR_HMAKE(vr_forcegrab_range); + VR_CVAR_HMAKE(vr_holster_haptics); + VR_CVAR_HMAKE(vr_holster_mode); + VR_CVAR_HMAKE(vr_melee_bloodlust); + VR_CVAR_HMAKE(vr_melee_bloodlust_mult); + VR_CVAR_HMAKE(vr_melee_dmg_multiplier); + VR_CVAR_HMAKE(vr_melee_range_multiplier); + VR_CVAR_HMAKE(vr_melee_threshold); + VR_CVAR_HMAKE(vr_positional_damage); + VR_CVAR_HMAKE(vr_weapon_cycle_mode); + VR_CVAR_HMAKE(vr_weapon_throw_damage_mult); + VR_CVAR_HMAKE(vr_weapon_throw_mode); + VR_CVAR_HMAKE(vr_weapon_throw_velocity_mult); + VR_CVAR_HMAKE(vr_weapondrop_particles); + VR_CVAR_HMAKE(vr_2h_spread_reduction); + VR_CVAR_HMAKE(vr_2h_throw_velocity_mult); + VR_CVAR_HMAKE(vr_headbutt_velocity_threshold); + VR_CVAR_HMAKE(vr_headbutt_damage_mult); + VR_CVAR_HMAKE(vr_verbosebots); + VR_CVAR_HMAKE(vr_forcegrabbable_ammo_boxes); + VR_CVAR_HMAKE(vr_forcegrabbable_health_boxes); + VR_CVAR_HMAKE(vr_forcegrabbable_return_time_deathmatch); + VR_CVAR_HMAKE(vr_forcegrabbable_return_time_singleplayer); + +#undef VR_CVAR_HMAKE +} diff --git a/QC/vr_defs.qc b/QC/vr_defs.qc new file mode 100644 index 00000000..a991049c --- /dev/null +++ b/QC/vr_defs.qc @@ -0,0 +1,315 @@ +#include "vr_macros.qc" + +// +// +// +// ---------------------------------------------------------------------------- +// Weapon flags +// ---------------------------------------------------------------------------- + +float QVR_WPNFLAG_USE_SECONDARY_AMMO = VRUTIL_POWER_OF_TWO(0); + +// +// +// +// ---------------------------------------------------------------------------- +// Hand constants +// ---------------------------------------------------------------------------- + +float cVR_OffHand = 0; +float cVR_MainHand = 1; +float cVR_FakeHand = 2; + +// +// +// +// ---------------------------------------------------------------------------- +// Item ID categories +// ---------------------------------------------------------------------------- + +float IID_CATEGORY_INVALID = 0; +float IID_CATEGORY_ITEMS = 1; +float IID_CATEGORY_HIPNOTIC_ITEMS = 2; +float IID_CATEGORY_ROGUE_ITEMS = 3; + +// +// +// +// ---------------------------------------------------------------------------- +// Item IDs +// ---------------------------------------------------------------------------- + +float IID_NONE = 0; +float IID_ARMOR1 = 1; +float IID_ARMOR2 = 2; +float IID_ARMOR3 = 3; +float IID_SUPERHEALTH = 4; +float IID_KEY1 = 5; +float IID_KEY2 = 6; +float IID_INVISIBILITY = 7; +float IID_INVULNERABILITY = 8; +float IID_SUIT = 9; +float IID_QUAD = 10; +float IID_WETSUIT = 11; // HIPNOTIC +float IID_EMPATHY_SHIELDS = 12; // HIPNOTIC +float IID_HORN_OF_CONJURING = 13; // HIPNOTIC +float IID_FIST = 14; +float IID_SHOTGUN = 15; +float IID_SUPER_SHOTGUN = 16; +float IID_NAILGUN = 17; +float IID_SUPER_NAILGUN = 18; +float IID_GRENADE_LAUNCHER = 19; +float IID_ROCKET_LAUNCHER = 20; +float IID_LIGHTNING = 21; +float IID_MJOLNIR = 22; +float IID_SHELLS = 23; +float IID_NAILS = 24; +float IID_ROCKETS = 25; +float IID_CELLS = 26; +float IID_AXE = 27; +float IID_PROXIMITY_GUN = 28; +float IID_LASER_CANNON = 29; +float IID_LAVA_NAILGUN = 30; // ROGUE. +float IID_LAVA_SUPER_NAILGUN = 31; // ROGUE. +float IID_MULTI_GRENADE = 32; // ROGUE. +float IID_MULTI_ROCKET = 33; // ROGUE. +float IID_PLASMA_GUN = 34; // ROGUE. +float IID_GRAPPLE = 35; // ROGUE. +float IID_LAVA_NAILS = 36; // ROGUE. +float IID_PLASMA_AMMO = 37; // ROGUE. +float IID_MULTI_ROCKETS = 38; // ROGUE. +float IID_SHIELD = 39; // ROGUE. +float IID_ANTIGRAV = 40; // ROGUE. +float IID_EARTHQUAKE = 41; // ROGUE. +float IID_V_SPHERE = 42; // ROGUE. + +// +// +// +// ---------------------------------------------------------------------------- +// Weapon IDs +// ---------------------------------------------------------------------------- + +float WID_FIST = 0; +float WID_GRAPPLE = 1; +float WID_AXE = 2; +float WID_MJOLNIR = 3; // HIPNOTIC. +float WID_SHOTGUN = 4; +float WID_SUPER_SHOTGUN = 5; +float WID_NAILGUN = 6; +float WID_SUPER_NAILGUN = 7; +float WID_GRENADE_LAUNCHER = 8; +float WID_PROXIMITY_GUN = 9; // HIPNOTIC. +float WID_ROCKET_LAUNCHER = 10; +float WID_LIGHTNING = 11; +float WID_LASER_CANNON = 12; // HIPNOTIC. + +// +// +// +// ---------------------------------------------------------------------------- +// Ammo IDs +// ---------------------------------------------------------------------------- + +float AID_NONE = 0; +float AID_SHELLS = 1; +float AID_NAILS = 2; +float AID_ROCKETS = 3; +float AID_CELLS = 4; +float AID_LAVA_NAILS = 5; // ROGUE. +float AID_MULTI_ROCKETS = 6; // ROGUE. +float AID_PLASMA = 7; // ROGUE. + +// +// +// +// ---------------------------------------------------------------------------- +// Spawnflags +// ---------------------------------------------------------------------------- + +float SPAWNFLAG_SUPERSPIKE = VRUTIL_POWER_OF_TWO(0); // HIPNOTIC. +float SPAWNFLAG_LASER = VRUTIL_POWER_OF_TWO(1); // HIPNOTIC. +float SPAWNFLAG_LAVABALL = VRUTIL_POWER_OF_TWO(2); // HIPNOTIC. +float SPAWNFLAG_ROCKET = VRUTIL_POWER_OF_TWO(3); // HIPNOTIC. +float SPAWNFLAG_SILENT = VRUTIL_POWER_OF_TWO(4); // HIPNOTIC. +float SPAWNFLAG_LAVASPIKE = VRUTIL_POWER_OF_TWO(5); // ROGUE. +float SPAWNFLAG_SUPERLAVA = VRUTIL_POWER_OF_TWO(6); // ROGUE. +float SPAWNFLAG_LAVASKILL = VRUTIL_POWER_OF_TWO(7); // ROGUE. +float SPAWNFLAG_FIREBALL = VRUTIL_POWER_OF_TWO(8); // ROGUE. +float SPAWNFLAG_TBABY_HIPHOP = VRUTIL_POWER_OF_TWO(9); // HONEY. +float SPAWNFLAG_TBABY_LIVID = VRUTIL_POWER_OF_TWO(10); // HONEY. +float SPAWNFLAG_TRIGGER_SPAWN_TFOG = VRUTIL_POWER_OF_TWO(11); // HONEY. +float SPAWNFLAG_REMOVE_CORPSE = VRUTIL_POWER_OF_TWO(12); // HONEY. +float SPAWNFLAG_TRIGGER_SPAWN_ANGRY = VRUTIL_POWER_OF_TWO(13); // HONEY. +float SPAWNFLAG_TRIGGER_SPAWN = VRUTIL_POWER_OF_TWO(14); // HONEY. +float SPAWNFLAG_TRIGGER_SPAWN_MULTIPLE = VRUTIL_POWER_OF_TWO(15); // HONEY. +float SPAWNFLAG_SF_SILENT_WAKEUP = VRUTIL_POWER_OF_TWO(16); // HONEY. +float SPAWNFLAG_SF_AI_BBOX_CHECK = VRUTIL_POWER_OF_TWO(17); // HONEY. + +// +// +// +// ---------------------------------------------------------------------------- +// Hotspots +// ---------------------------------------------------------------------------- + +float QVR_HS_NONE = 0; +float QVR_HS_OFFHAND_2H_GRAB = 1; // 2H grab - helper offhand +float QVR_HS_MAINHAND_2H_GRAB = 2; // 2H grab - helper mainhand +float QVR_HS_LEFT_SHOULDER_HOLSTER = 3; +float QVR_HS_RIGHT_SHOULDER_HOLSTER = 4; +float QVR_HS_LEFT_HIP_HOLSTER = 5; +float QVR_HS_RIGHT_HIP_HOLSTER = 6; +float QVR_HS_HAND_SWITCH = 7; +float QVR_HS_LEFT_UPPER_HOLSTER = 8; +float QVR_HS_RIGHT_UPPER_HOLSTER = 9; + +// +// +// +// ---------------------------------------------------------------------------- +// `.throwhit` values for thrown weapons +// ---------------------------------------------------------------------------- + +float QVR_THROWHIT_NEVER_HIT = 0; +float QVR_THROWHIT_HIT = 1; +float QVR_THROWHIT_FORCEGRAB = 2; +float QVR_THROWHIT_FORCEGRAB_PARABOLA = 3; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrHolsterMode' +// ---------------------------------------------------------------------------- + +float QVR_WEAPONMODE_IMMERSIVE = 0; +float QVR_WEAPONMODE_CYCLEQUICKSLOT = 1; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrWeaponThrowMode' +// ---------------------------------------------------------------------------- + +float QVR_WEAPONTHROWMODE_IMMERSIVE = 0; +float QVR_WEAPONTHROWMODE_DISAPPEARONHIT = 1; +float QVR_WEAPONTHROWMODE_DISCARD = 2; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrWeaponCycleMode' +// ---------------------------------------------------------------------------- + +float QVR_WEAPONCYCLEMODE_DISABLED = 0; +float QVR_WEAPONCYCLEMODE_ALLOWED = 1; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrMeleeBloodlust' +// ---------------------------------------------------------------------------- + +float QVR_MELEEBLOODLUST_ENABLED = 0; +float QVR_MELEEBLOODLUST_DISABLED = 1; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrEnemyDrops` +// ---------------------------------------------------------------------------- + +float QVR_ENEMYDROPS_WHENELIGIBLE = 0; +float QVR_ENEMYDROPS_ALWAYS = 1; +float QVR_ENEMYDROPS_DISABLE = 2; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrAmmoBoxDrops` +// ---------------------------------------------------------------------------- + +float QVR_AMMOBOXDROPS_WHENELIGIBLE = 0; +float QVR_AMMOBOXDROPS_ALWAYS = 1; +float QVR_AMMOBOXDROPS_DISABLE = 2; + +// +// +// +// ---------------------------------------------------------------------------- +// Enum values for `VrForceGrabMode` +// ---------------------------------------------------------------------------- + +float QVR_VRFORCEGRABMODE_DISABLED = 0; +float QVR_VRFORCEGRABMODE_LINEAR = 1; +float QVR_VRFORCEGRABMODE_PARABOLA = 2; +float QVR_VRFORCEGRABMODE_INSTANT = 3; + +// +// +// +// ---------------------------------------------------------------------------- +// Flags for VR bits: `vrbits0` +// ---------------------------------------------------------------------------- + +float QVR_VRBITS0_TELEPORTING = VRUTIL_POWER_OF_TWO(0); +float QVR_VRBITS0_OFFHAND_GRABBING = VRUTIL_POWER_OF_TWO(1); +float QVR_VRBITS0_OFFHAND_PREVGRABBING = VRUTIL_POWER_OF_TWO(2); +float QVR_VRBITS0_MAINHAND_GRABBING = VRUTIL_POWER_OF_TWO(3); +float QVR_VRBITS0_MAINHAND_PREVGRABBING = VRUTIL_POWER_OF_TWO(4); +float QVR_VRBITS0_2H_AIMING = VRUTIL_POWER_OF_TWO(5); + +// +// +// +// ---------------------------------------------------------------------------- +// Globals +// ---------------------------------------------------------------------------- + +float readytime; // Time after loading when the player is considered ready. + // Prevents shooting, grabbing/dropping weapons. + // TODO VR: (P1): this should be per-client! + +// +// +// +// ---------------------------------------------------------------------------- +// Particle Presets +// ---------------------------------------------------------------------------- + +float QVR_PARTICLE_PRESET_BULLETPUFF = 0; +float QVR_PARTICLE_PRESET_BLOOD = 1; +float QVR_PARTICLE_PRESET_EXPLOSION = 2; +float QVR_PARTICLE_PRESET_LIGHTNING = 3; +float QVR_PARTICLE_PRESET_SMOKE = 4; +float QVR_PARTICLE_PRESET_SPARKS = 5; +float QVR_PARTICLE_PRESET_GUNSMOKE = 6; +float QVR_PARTICLE_PRESET_TELEPORT = 7; +float QVR_PARTICLE_PRESET_GUNPICKUP = 8; +float QVR_PARTICLE_PRESET_GUNFORCEGRAB = 9; +float QVR_PARTICLE_PRESET_LAVASPIKE = 10; +float QVR_PARTICLE_PRESET_BIGSMOKE = 11; + +// +// +// +// ---------------------------------------------------------------------------- +// Item Names +// ---------------------------------------------------------------------------- + +string ITEM_NAME_SHELLS = "item_shells"; +string ITEM_NAME_SPIKES = "item_spikes"; +string ITEM_NAME_ROCKETS = "item_rockets"; +string ITEM_NAME_LAVA_NAILS = "item_lava_nails"; +string ITEM_NAME_MULTI_ROCKETS = "item_multi_rockets"; +string ITEM_NAME_PLASMA = "item_plasma"; +string ITEM_NAME_CELLS = "item_cells"; +string ITEM_NAME_ARMOR1 = "item_armor1"; +string ITEM_NAME_ARMOR2 = "item_armor2"; +string ITEM_NAME_ARMORINV = "item_armorInv"; diff --git a/QC/vr_fields.qc b/QC/vr_fields.qc new file mode 100644 index 00000000..cd19beaa --- /dev/null +++ b/QC/vr_fields.qc @@ -0,0 +1,137 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Think closures +// ---------------------------------------------------------------------------- + +.void(float) thinkArgFn; +.void(float) think2ArgFn; +.float thinkArg; +.float think2Arg; + +// +// +// +// ---------------------------------------------------------------------------- +// Hand-grabbing fields +// ---------------------------------------------------------------------------- + +.float offhand_lastgrabtime; +.float mainhand_lastgrabtime; +.float offhand_lastreleasetime; +.float mainhand_lastreleasetime; + + +// +// +// +// ---------------------------------------------------------------------------- +// Force-grabbing fields +// ---------------------------------------------------------------------------- + +.float offhand_forcegrabbing; +.float mainhand_forcegrabbing; + +// +// +// +// ---------------------------------------------------------------------------- +// Thrown weapon fields +// ---------------------------------------------------------------------------- + +.float throwhit; +.float throwstabilize; +.float throwstabilizedim; + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand attack fields +// ---------------------------------------------------------------------------- + +.float offhand_attack_finished; + +// +// +// +// ---------------------------------------------------------------------------- +// Main hand melee fields +// ---------------------------------------------------------------------------- + +.float mainhand_melee_attack_finished; +.float in_melee; +.float melee_hit_sound_played; + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand melee fields +// ---------------------------------------------------------------------------- + +.float offhand_melee_attack_finished; +.float offhand_in_melee; +.float offhand_melee_hit_sound_played; + +// +// +// +// ---------------------------------------------------------------------------- +// 2H-related fields +// ---------------------------------------------------------------------------- + +.float last_2h_time; + +// +// +// +// ---------------------------------------------------------------------------- +// Headbutt-related fields +// ---------------------------------------------------------------------------- + +.float headbutt_start_time; +.float in_headbutt; +.vector headbutt_max_vec; + +// +// +// +// ---------------------------------------------------------------------------- +// Lava weapon fields +// ---------------------------------------------------------------------------- + +.float mainHandLavaGunFired; +.float offHandLavaGunFired; + +// +// +// +// ---------------------------------------------------------------------------- +// Holster fields +// ---------------------------------------------------------------------------- + +// Used to trigger haptics when hovering holsters. +.float holsterhover[6]; +.float holsterprevhover[6]; + +// +// +// +// ---------------------------------------------------------------------------- +// World text fields +// ---------------------------------------------------------------------------- + +.string worldtext; +.float worldtext_halign; +.float angle; + +// +// +// +// ---------------------------------------------------------------------------- +// Button fields +// ---------------------------------------------------------------------------- + +.float buttonEffect; diff --git a/QC/vr_gameutil.qc b/QC/vr_gameutil.qc new file mode 100644 index 00000000..54a1f3e1 --- /dev/null +++ b/QC/vr_gameutil.qc @@ -0,0 +1,139 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +float() VR_GameUtil_InTutorialMap = +{ + return (mapname == "vrtutorial"); +} + +float() VR_GameUtil_InStartMap = +{ + return (mapname == "start"); +} + +float() VR_GameUtil_InVanillaMap = +{ + return (mapname == "e1m1") || + (mapname == "e1m2") || + (mapname == "e1m3") || + (mapname == "e1m4") || + (mapname == "e1m5") || + (mapname == "e1m6") || + (mapname == "e1m7") || + (mapname == "e1m8") || + (mapname == "e2m1") || + (mapname == "e2m2") || + (mapname == "e2m3") || + (mapname == "e2m4") || + (mapname == "e2m5") || + (mapname == "e2m6") || + (mapname == "e2m7") || + (mapname == "e3m1") || + (mapname == "e3m2") || + (mapname == "e3m3") || + (mapname == "e3m4") || + (mapname == "e3m5") || + (mapname == "e3m6") || + (mapname == "e3m7") || + (mapname == "e4m1") || + (mapname == "e4m2") || + (mapname == "e4m3") || + (mapname == "e4m4") || + (mapname == "e4m5") || + (mapname == "e4m6") || + (mapname == "e4m7") || + (mapname == "e4m8") || + (mapname == "end"); +} + +float() VR_GameUtil_InHipnoticMap = +{ + return (mapname == "hip1m1") || + (mapname == "hip1m2") || + (mapname == "hip1m3") || + (mapname == "hip1m4") || + (mapname == "hip1m5") || + (mapname == "hip2m1") || + (mapname == "hip2m2") || + (mapname == "hip2m3") || + (mapname == "hip2m4") || + (mapname == "hip2m5") || + (mapname == "hip2m6") || + (mapname == "hip3m1") || + (mapname == "hip3m2") || + (mapname == "hip3m3") || + (mapname == "hip3m4") || + (mapname == "hipdm1") || + (mapname == "hipend"); +} + +float() VR_GameUtil_InRogueMap = +{ +return (mapname == "r1m1") || + (mapname == "r1m2") || + (mapname == "r1m3") || + (mapname == "r1m4") || + (mapname == "r1m5") || + (mapname == "r1m6") || + (mapname == "r1m7") || + (mapname == "r2m1") || + (mapname == "r2m2") || + (mapname == "r2m3") || + (mapname == "r2m4") || + (mapname == "r2m5") || + (mapname == "r2m6") || + (mapname == "r2m7") || + (mapname == "r2m8") || + (mapname == "ctf1"); +} + +float() VR_GameUtil_InDopaMap = +{ + return (mapname == "e5m1") || + (mapname == "e5m2") || + (mapname == "e5m3") || + (mapname == "e5m4") || + (mapname == "e5m5") || + (mapname == "e5m6") || + (mapname == "e5m7") || + (mapname == "e5m8") || + (mapname == "e5end") || + (mapname == "e5dm"); +} + +float() VR_GameUtil_InHoneyMap = +{ + return (mapname == "saint") || + (mapname == "honey") || + (mapname == "h_hub1") || + (mapname == "h_hub2") || + (mapname == "h_end") || + (mapname == "credits"); +} + +float() VR_GameUtil_InUnknownMap = +{ + return !VR_GameUtil_InVanillaMap() && + !VR_GameUtil_InHipnoticMap() && + !VR_GameUtil_InRogueMap() && + !VR_GameUtil_InDopaMap() && + !VR_GameUtil_InHoneyMap(); +} + +float() VR_GameUtil_EnableHoneyExtensions = +{ + // TODO VR: (P2) also add cvar override + + if(VR_GameUtil_InStartMap() || VR_GameUtil_InHoneyMap()) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/QC/vr_grapple.qc b/QC/vr_grapple.qc new file mode 100644 index 00000000..1e8345e7 --- /dev/null +++ b/QC/vr_grapple.qc @@ -0,0 +1,327 @@ +// Rogue Grapple Implementation +// Jan'97 by ZOID <zoid@threewave.com> +// Under contract to id software for Rogue Entertainment + +// New entity fields +.entity hook; // this is my hook +.float on_hook; // we're on it +.float hook_out; // it's out + +.entity hook2; // (off-hand) this is my hook +.float on_hook2; // (off-hand) we're on it +.float hook_out2; // (off-hand) it's out + +.float handParm; + +void(float xHand, entity v) setHook = +{ + if(xHand == cVR_OffHand) self.hook2 = v; + else self.hook = v; +} + +void(float xHand, float v) setOnHook = +{ + if(xHand == cVR_OffHand) self.on_hook2 = v; + else self.on_hook = v; +} + +void(float xHand, float v) setHookOut = +{ + if(xHand == cVR_OffHand) self.hook_out2 = v; + else self.hook_out = v; +} + +entity(float xHand) getHook = +{ + if(xHand == cVR_OffHand) return self.hook2; + else return self.hook; +} + +float(float xHand) getOnHook = +{ + if(xHand == cVR_OffHand) return self.on_hook2; + else return self.on_hook; +} + +float(float xHand) getHookOut = +{ + if(xHand == cVR_OffHand) return self.hook_out2; + else return self.hook_out; +} + +void(float xHand, float v) setOwnerOnHook = +{ + if(xHand == cVR_OffHand) self.owner.on_hook2 = v; + else self.owner.on_hook = v; +} + +void(float xHand, float v) setOwnerHookOut = +{ + if(xHand == cVR_OffHand) self.owner.hook_out2 = v; + else self.owner.hook_out = v; +} + +float(float xHand) getOwnerOnHook = +{ + if(xHand == cVR_OffHand) return self.owner.on_hook2; + else return self.owner.on_hook; +} + +float(float xHand) getOwnerHookOut = +{ + if(xHand == cVR_OffHand) return self.owner.hook_out2; + else return self.owner.hook_out; +} + +// prototypes for WEAPONS.QC functions +float() crandom; +void(vector org, vector vel, float damage) SpawnBlood; + +void(entity h, vector startPos, vector endPos) GrappleTrail = +{ + // draw a line to the hook + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_BEAM); + WriteEntity(MSG_BROADCAST, h); + WriteByte(MSG_BROADCAST, 0); /* disambiguator */ + WriteVec3(MSG_BROADCAST, startPos); + WriteVec3(MSG_BROADCAST, endPos); +}; + +void() GrappleResetFromHook = +{ + float xHand; + xHand = self.handParm; + + setOwnerOnHook(xHand, FALSE); + setOwnerHookOut(xHand, FALSE); + VRSetWeaponFrame(xHand, 0); + VRSetAttackFinished(xHand, time + 0.25); + + remove(self); +}; + +void(float xHand) GrappleResetFromPlayer = +{ + setOwnerOnHook(xHand, FALSE); + setOwnerHookOut(xHand, FALSE); + VRSetWeaponFrame(xHand, 0); + VRSetAttackFinished(xHand, time + 0.25); + + remove(self); +}; + +void() GrappleTrack = +{ + vector spray; + float xHand; + + xHand = self.handParm; + + // Release dead targets + if(self.enemy.classname == "player" && self.enemy.health <= 0) + { + setOwnerOnHook(xHand, FALSE); + } + + // drop the hook if owner is dead or has released the button + if(!getOwnerOnHook(xHand) || self.owner.health <= 0) + { + GrappleResetFromHook(); + return; + } + + if(self.enemy.classname == "player") + { + if(self.enemy.teleport_time > time) + { + GrappleResetFromHook(); + return; + } + + // move the hook along with the player. It's invisible, but + // we need this to make the sound come from the right spot + setorigin(self, self.enemy.origin); + +// sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); + sound(self, CHAN_WEAPON, "pendulum/hit.wav", 1, ATTN_NORM); + T_Damage(self.enemy, self, self.owner, 1); + makevectors(self.v_angle); + spray_x = 100 * crandom(); + spray_y = 100 * crandom(); + spray_z = 100 * crandom() + 50; + SpawnBlood(self.origin, spray, 20); + } + if(self.enemy.solid == SOLID_SLIDEBOX) { + self.velocity = '0 0 0'; + setorigin(self, self.enemy.origin + self.enemy.mins + + self.enemy.size * 0.5); + } else + self.velocity = self.enemy.velocity; + + self.nextthink = time + 0.1; +}; + +// Tries to anchor the grapple to whatever it touches +void () GrappleAnchor = +{ + float xHand; + + xHand = self.handParm; + + if(other == self.owner) // don't hook the guy that fired it + return; + + if(pointcontents(self.origin) == CONTENT_SKY) + { + // TODO VR: (P2) see below + // This does happen, but only in certain maps. Not sure if the problem + // is map support, or something with `pointcontents`. + GrappleResetFromHook(); + return; + } + + if(other.classname == "player") + { + // glance off of teammates + if(other.steam == self.owner.steam) + { + GrappleResetFromHook(); // PGM - fix drift after teammate hit 01/20/97 + return; + } + + sound(self, CHAN_WEAPON, "player/axhit1.wav", 1, ATTN_NORM); + T_Damage(other, self, self.owner, 10); + } else { + sound(self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); + + // One point of damage inflicted upon impact. Subsequent + // damage will only be done to PLAYERS... this way secret + // doors and triggers will only be damaged once. + if(other.takedamage) + { + T_Damage(other, self, self.owner, 1); + } + + self.velocity = '0 0 0'; + self.avelocity = '0 0 0'; + } + + self.frame = 2; // anchored + + sound(self.owner, CHAN_WEAPON, "weapons/tink1.wav", 1, ATTN_NORM); + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_BULLETPUFF, 48); + + if(!VRGetEntFireButtonPressed(self.owner, xHand)) { + GrappleResetFromHook(); + return; + } + + setOwnerOnHook(xHand, TRUE); + if(self.owner.flags & FL_ONGROUND) + self.owner.flags = self.owner.flags - FL_ONGROUND; + + self.enemy = other;// remember this guy! + self.think = GrappleTrack; + self.nextthink = time; + self.solid = SOLID_NOT; + self.touch = SUB_Null; +}; + +void (float xHand) W_FireGrapple = +{ + entity newmis; + + if(getHookOut(xHand))// reject subsequent calls from player.qc + return; + + VRGunHaptic(xHand, 0.55, 75, 1.0); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 8); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); + + self.punchangle_x = -2; // bump him + + // chain out sound(loops) + sound(self, CHAN_WEAPON, "weapons/chain1.wav", 1, ATTN_NORM); + + newmis = spawn(); + newmis.handParm = xHand; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.owner = self; // newmis belongs to me + setHook(xHand, newmis); // This is my newmis + newmis.classname = "hook"; + + makevectors(VRGetWeaponFireRot(xHand)); + newmis.velocity = v_forward * 1500; + newmis.velocity += vrProjectileVelocity(xHand, 0.6); +// newmis.avelocity = '0 0 -500'; + newmis.angles = vectoangles(v_forward); + + newmis.touch = GrappleAnchor; + newmis.think = GrappleResetFromHook; + // grapple only lives for two seconds, this gives max range on it + newmis.nextthink = time + 1.8; + newmis.frame = 1; // hook spread + + setmodel(newmis,"progs/hook.mdl"); + setorigin(newmis, VRGetMuzzlePos(xHand) + v_forward * 6); + setsize(newmis, '0 0 0' , '0 0 0 '); + + setHookOut(xHand, TRUE); +}; + +// called each frame by CLIENT.QC if client has hook_out +void(float xHand) GrappleService = +{ + vector vel, hookfwd; + float v, dot; + entity xHook; + + xHook = getHook(xHand); + + makevectors_mdl(xHook.angles); + hookfwd = v_forward; + + makevectors(VRGetHandRot(xHand)); + + if(!getOnHook(xHand)) + { + GrappleTrail(xHook, xHook.origin - hookfwd * 6.5, VRGetMuzzlePos(xHand) + v_forward * 1.5); + return; + } + + // drop the hook if player lets go of button + if((!VRGetFireButtonPressed(xHand)) || + self.teleport_time > time || + VRGetWeapon(xHand) != WID_GRAPPLE) + { // release when we get 'ported + self = xHook; + GrappleResetFromPlayer(xHand); + return; + } + + vel = xHook.origin - VRGetMuzzlePos(xHand); + v = vlen(vel); + + // if(v <= 250) + // { + // vel = normalize(vel) * 250; + // } + + if(v >= 350) + { + vel = normalize(vel) * 350; + } + + dot = vel * self.velocity; + + if(dot < 0 || vlen(self.velocity) < 800) + { + self.velocity = self.velocity + (vel * 8 * frametime); + } + + GrappleTrail(xHook, xHook.origin - hookfwd * 6.5, VRGetMuzzlePos(xHand) + v_forward * 1.5); +}; + + diff --git a/QC/vr_handgrabutil.qc b/QC/vr_handgrabutil.qc new file mode 100644 index 00000000..3384bc9c --- /dev/null +++ b/QC/vr_handgrabutil.qc @@ -0,0 +1,113 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Implementation details +// ---------------------------------------------------------------------------- + +void(entity xEntPlayer, + float xHand, + float xCurrBit, + float xPrevBit, + float xLastGrabTime, + float* xOutLastGrabTime, + float xLastReleaseTime, + float* xOutLastReleaseTime) +VR_HandGrabUtil_Impl_UpdateStateForHand = +{ + if(!xPrevBit && xCurrBit) // Rising edge (grab) + { + *xOutLastGrabTime = time; + } + + if(xPrevBit && !xCurrBit) // Falling edge (release) + { + *xOutLastReleaseTime = time; + } +} + +float(entity xEntPlayer, float xHand) VR_HandGrabUtil_Impl_GetLastGrabTime = +{ + if(xHand == cVR_OffHand) { return xEntPlayer.offhand_lastgrabtime; } + if(xHand == cVR_MainHand) { return xEntPlayer.mainhand_lastgrabtime; } + + ASSERT(FALSE); + return 0; +} + +float(entity xEntPlayer, float xHand) VR_HandGrabUtil_Impl_GetLastReleaseTime = +{ + if(xHand == cVR_OffHand) { return xEntPlayer.offhand_lastreleasetime; } + if(xHand == cVR_MainHand) { return xEntPlayer.mainhand_lastreleasetime; } + + ASSERT(FALSE); + return 0; +} + +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +void(entity xEntPlayer) VR_HandGrabUtil_UpdateState = +{ + if(!xEntPlayer.ishuman) + { + return; + } + + VR_HandGrabUtil_Impl_UpdateStateForHand( + xEntPlayer, + cVR_OffHand, + VRGetOffHandGrabbingBit(xEntPlayer), + VRGetOffHandPrevGrabbingBit(xEntPlayer), + xEntPlayer.offhand_lastgrabtime, + &xEntPlayer.offhand_lastgrabtime, + xEntPlayer.offhand_lastreleasetime, + &xEntPlayer.offhand_lastreleasetime + ); + + VR_HandGrabUtil_Impl_UpdateStateForHand( + xEntPlayer, + cVR_MainHand, + VRGetMainHandGrabbingBit(xEntPlayer), + VRGetMainHandPrevGrabbingBit(xEntPlayer), + xEntPlayer.mainhand_lastgrabtime, + &xEntPlayer.mainhand_lastgrabtime, + xEntPlayer.mainhand_lastreleasetime, + &xEntPlayer.mainhand_lastreleasetime + ); +} + + +float(entity xEntPlayer, float xHand) VR_HandGrabUtil_IsHandGrabbing = +{ + return VRIsEntHandGrabbingBit(xEntPlayer, xHand); +} + +float(entity xEntPlayer, float xHand) VR_HandGrabUtil_IsHandPrevGrabbing = +{ + return VRIsEntHandPrevGrabbingBit(xEntPlayer, xHand); +} + +float(entity xEntPlayer, float xHand) VR_HandGrabUtil_StartedHandGrabbing = +{ + float lastGrabTime = VR_HandGrabUtil_Impl_GetLastGrabTime(xEntPlayer, xHand); + float lastReleaseTime = VR_HandGrabUtil_Impl_GetLastReleaseTime(xEntPlayer, xHand); + + if(lastReleaseTime + 0.125 > lastGrabTime) + { + return FALSE; + } + + return time < lastGrabTime + 0.125 + && time > lastReleaseTime; +} + +float(entity xEntPlayer, float xHand) VR_HandGrabUtil_StoppedHandGrabbing = +{ + return VRIsEntHandPrevGrabbingBit(xEntPlayer, xHand) && + !VRIsEntHandGrabbingBit(xEntPlayer, xHand); +} diff --git a/QC/vr_itemutil.qc b/QC/vr_itemutil.qc new file mode 100644 index 00000000..b5d0c8af --- /dev/null +++ b/QC/vr_itemutil.qc @@ -0,0 +1,222 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Implementation utilities +// ---------------------------------------------------------------------------- + +void(string xFnName, float xItemId) VR_ItemUtil_Impl_PrintInvalidItemId = +{ + bprint("`"); + bprint(xFnName); + bprint("`: invalid item id '"); + bprint(ftos(xItemId)); + bprint("'\n"); +} + +void(string xFnName, float xItemId) VR_ItemUtil_Impl_PrintInvalidItemCategory = +{ + bprint("`"); + bprint(xFnName); + bprint("`: invalid item category for item '"); + bprint(ftos(xItemId)); + bprint("'\n"); +} + +float(float xItemId) VR_ItemUtil_Impl_ItemIdToFlag = +{ + // `IID_CATEGORY_ITEMS` + if(xItemId == IID_FIST) { return IT_FIST; } + if(xItemId == IID_SHOTGUN) { return IT_SHOTGUN; } + if(xItemId == IID_SUPER_SHOTGUN) { return IT_SUPER_SHOTGUN; } + if(xItemId == IID_NAILGUN) { return IT_NAILGUN; } + if(xItemId == IID_SUPER_NAILGUN) { return IT_SUPER_NAILGUN; } + if(xItemId == IID_GRENADE_LAUNCHER) { return IT_GRENADE_LAUNCHER; } + if(xItemId == IID_ROCKET_LAUNCHER) { return IT_ROCKET_LAUNCHER; } + if(xItemId == IID_LIGHTNING) { return IT_LIGHTNING; } + if(xItemId == IID_MJOLNIR) { return IT_MJOLNIR; } + if(xItemId == IID_SHELLS) { return IT_SHELLS; } + if(xItemId == IID_NAILS) { return IT_NAILS; } + if(xItemId == IID_ROCKETS) { return IT_ROCKETS; } + if(xItemId == IID_CELLS) { return IT_CELLS; } + if(xItemId == IID_AXE) { return IT_AXE; } + if(xItemId == IID_ARMOR1) { return IT_ARMOR1; } + if(xItemId == IID_ARMOR2) { return IT_ARMOR2; } + if(xItemId == IID_ARMOR3) { return IT_ARMOR3; } + if(xItemId == IID_SUPERHEALTH) { return IT_SUPERHEALTH; } + if(xItemId == IID_KEY1) { return IT_KEY1; } + if(xItemId == IID_KEY2) { return IT_KEY2; } + if(xItemId == IID_INVISIBILITY) { return IT_INVISIBILITY; } + if(xItemId == IID_INVULNERABILITY) { return IT_INVULNERABILITY; } + if(xItemId == IID_SUIT) { return IT_SUIT; } + if(xItemId == IID_QUAD) { return IT_QUAD; } + if(xItemId == IID_LASER_CANNON) { return IT_LASER_CANNON; } + + // `IID_CATEGORY_HIPNOTIC_ITEMS` + if(xItemId == IID_WETSUIT) { return HIP_IT_WETSUIT; } + if(xItemId == IID_EMPATHY_SHIELDS) { return HIP_IT_EMPATHY_SHIELDS; } + if(xItemId == IID_HORN_OF_CONJURING) { return HIP_IT_HORN_OF_CONJURING; } + if(xItemId == IID_PROXIMITY_GUN) { return HIP_IT_PROXIMITY_GUN; } + + // `IID_CATEGORY_ROGUE_ITEMS` + if(xItemId == IID_LAVA_NAILGUN) { return ROGUE_IT_LAVA_NAILGUN; } + if(xItemId == IID_LAVA_SUPER_NAILGUN) { return ROGUE_IT_LAVA_SUPER_NAILGUN; } + if(xItemId == IID_MULTI_GRENADE) { return ROGUE_IT_MULTI_GRENADE; } + if(xItemId == IID_MULTI_ROCKET) { return ROGUE_IT_MULTI_ROCKET; } + if(xItemId == IID_PLASMA_GUN) { return ROGUE_IT_PLASMA_GUN; } + if(xItemId == IID_GRAPPLE) { return ROGUE_IT_GRAPPLE; } + if(xItemId == IID_LAVA_NAILS) { return ROGUE_IT_LAVA_NAILS; } + if(xItemId == IID_PLASMA_AMMO) { return ROGUE_IT_PLASMA_AMMO; } + if(xItemId == IID_MULTI_ROCKETS) { return ROGUE_IT_MULTI_ROCKETS; } + if(xItemId == IID_SHIELD) { return ROGUE_IT_SHIELD; } + if(xItemId == IID_ANTIGRAV) { return ROGUE_IT_ANTIGRAV; } + if(xItemId == IID_EARTHQUAKE) { return ROGUE_IT_EARTHQUAKE; } + if(xItemId == IID_V_SPHERE) { return ROGUE_IT_V_SPHERE; } + + VR_ItemUtil_Impl_PrintInvalidItemId("VR_ItemUtil_Impl_ItemIdToFlag", + xItemId); + + return 0; +} + +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +float(float xItemId) VR_ItemUtil_IsValidItemId = +{ + return (xItemId >= IID_ARMOR1) + && (xItemId <= IID_V_SPHERE); +} + +float(float xItemId) VR_ItemUtil_ItemIdToItemCategory = +{ + // `IID_CATEGORY_ITEMS` + if(xItemId == IID_FIST) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_SHOTGUN) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_SUPER_SHOTGUN) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_NAILGUN) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_SUPER_NAILGUN) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_GRENADE_LAUNCHER) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_ROCKET_LAUNCHER) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_LIGHTNING) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_MJOLNIR) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_SHELLS) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_NAILS) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_ROCKETS) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_CELLS) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_AXE) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_ARMOR1) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_ARMOR2) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_ARMOR3) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_SUPERHEALTH) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_KEY1) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_KEY2) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_INVISIBILITY) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_INVULNERABILITY) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_SUIT) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_QUAD) { return IID_CATEGORY_ITEMS; } + if(xItemId == IID_LASER_CANNON) { return IID_CATEGORY_ITEMS; } + + // `IID_CATEGORY_HIPNOTIC_ITEMS` + if(xItemId == IID_WETSUIT) { return IID_CATEGORY_HIPNOTIC_ITEMS; } + if(xItemId == IID_EMPATHY_SHIELDS) { return IID_CATEGORY_HIPNOTIC_ITEMS; } + if(xItemId == IID_HORN_OF_CONJURING) { return IID_CATEGORY_HIPNOTIC_ITEMS; } + if(xItemId == IID_PROXIMITY_GUN) { return IID_CATEGORY_HIPNOTIC_ITEMS; } + + // `IID_CATEGORY_ROGUE_ITEMS` + if(xItemId == IID_LAVA_NAILGUN) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_LAVA_SUPER_NAILGUN) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_MULTI_GRENADE) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_MULTI_ROCKET) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_PLASMA_GUN) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_GRAPPLE) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_LAVA_NAILS) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_PLASMA_AMMO) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_MULTI_ROCKETS) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_SHIELD) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_ANTIGRAV) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_EARTHQUAKE) { return IID_CATEGORY_ROGUE_ITEMS; } + if(xItemId == IID_V_SPHERE) { return IID_CATEGORY_ROGUE_ITEMS; } + + VR_ItemUtil_Impl_PrintInvalidItemId("VR_ItemUtil_ItemIdToItemCategory", + xItemId); + + return IID_CATEGORY_INVALID; +} + +float(entity xEnt, float xItemId) VR_ItemUtil_EntHasItem = +{ + float itemCategory, itemFlag; + itemCategory = VR_ItemUtil_ItemIdToItemCategory(xItemId); + itemFlag = VR_ItemUtil_Impl_ItemIdToFlag(xItemId); + + + if(itemCategory == IID_CATEGORY_ITEMS) + { + return VRHasBit(xEnt.items, itemFlag); + } + + if(itemCategory == IID_CATEGORY_HIPNOTIC_ITEMS) + { + return VRHasBit(xEnt.hipnotic_items, itemFlag); + } + + if(itemCategory == IID_CATEGORY_ROGUE_ITEMS) + { + return VRHasBit(xEnt.rogue_items, itemFlag); + } + + VR_ItemUtil_Impl_PrintInvalidItemCategory("VR_ItemUtil_EntHasItem", + xItemId); + + return FALSE; +} + +void(entity xEnt, float xItemId, float xOwned) VR_ItemUtil_EntSetItem = +{ + float itemCategory, itemFlag; + itemCategory = VR_ItemUtil_ItemIdToItemCategory(xItemId); + itemFlag = VR_ItemUtil_Impl_ItemIdToFlag(xItemId); + + if(itemCategory == IID_CATEGORY_ITEMS) + { + xEnt.items = VRSetBit(xEnt.items, itemFlag, xOwned); + return; + } + + if(itemCategory == IID_CATEGORY_HIPNOTIC_ITEMS) + { + xEnt.hipnotic_items = VRSetBit(xEnt.hipnotic_items, itemFlag, xOwned); + return; + } + + if(itemCategory == IID_CATEGORY_ROGUE_ITEMS) + { + xEnt.rogue_items = VRSetBit(xEnt.rogue_items, itemFlag, xOwned); + return; + } + + VR_ItemUtil_Impl_PrintInvalidItemCategory("VR_ItemUtil_EntSetItem", + xItemId); +} + +void(entity xEnt, float xItemId) VR_ItemUtil_EntAddItem = +{ + VR_ItemUtil_EntSetItem(xEnt, xItemId, TRUE); +} + +void(entity xEnt, float xItemId) VR_ItemUtil_EntDelItem = +{ + VR_ItemUtil_EntSetItem(xEnt, xItemId, FALSE); +} + +void(entity xEnt) VR_ItemUtil_EntClearItems = +{ + xEnt.items = 0; + xEnt.hipnotic_items = 0; + xEnt.rogue_items = 0; +} diff --git a/QC/vr_macros.qc b/QC/vr_macros.qc new file mode 100644 index 00000000..ed35cc88 --- /dev/null +++ b/QC/vr_macros.qc @@ -0,0 +1,36 @@ +#pragma once + +#define VRUTIL_POWER_OF_TWO(xExponent) (1 << xExponent) + +#define NULLSTR 0 +#define NULLENT world + +#ifndef NDEBUG + +#define ASSERT(x) \ + do { \ + if(!(x)) \ + { \ + bprint("Assertion failure!\n'" __FUNC__ "' at " __LINESTR__ "\nExpression is false: '" #x "'\n"); \ + } \ + } while(FALSE) + +#else + +#define ASSERT(x) + +#endif + +#define BPRINT_FVAR(x) \ + bprint(#x ": '"); \ + bprint(ftos(x)); \ + bprint("'\n") + +#define BRPINT_VVAR(x) \ + bprint(#x ": '{"); \ + bprint(ftos(x ## _x)); \ + bprint("; "); \ + bprint(ftos(x ## _y)); \ + bprint("; "); \ + bprint(ftos(x ## _z)); \ + bprint("}'\n") diff --git a/QC/vr_scaleutil.qc b/QC/vr_scaleutil.qc new file mode 100644 index 00000000..4d974c34 --- /dev/null +++ b/QC/vr_scaleutil.qc @@ -0,0 +1,16 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +vector(entity xEnt) VR_ScaleUtil_GetScale = +{ + return xEnt.scale + '1 1 1'; +} + +void(entity xEnt, vector xScale) VR_ScaleUtil_SetScale = +{ + xEnt.scale = xScale - '1 1 1'; +} diff --git a/QC/vr_sys_fields.qc b/QC/vr_sys_fields.qc new file mode 100644 index 00000000..80248dbd --- /dev/null +++ b/QC/vr_sys_fields.qc @@ -0,0 +1,235 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Entity (visual) scale fields +// ---------------------------------------------------------------------------- + +.vector scale; +.vector scale_origin; + +// +// +// +// ---------------------------------------------------------------------------- +// New item management fields +// ---------------------------------------------------------------------------- + +.float vr_itemId; + +// +// +// +// ---------------------------------------------------------------------------- +// Hand and weapon touching callback fields +// ---------------------------------------------------------------------------- + +.void() handtouch; // touched by VR hand +.void() vr_wpntouch; // touched by VR weapon + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand think callback fields +// ---------------------------------------------------------------------------- + +.void() think2; +.float nextthink2; + +// +// +// +// ---------------------------------------------------------------------------- +// Main hand weapon fields +// ---------------------------------------------------------------------------- + +.float weaponflags; + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand weapon fields +// ---------------------------------------------------------------------------- + +.float weapon2; // WID +.string weaponmodel2; +.float weaponframe2; +.float weaponflags2; + +// +// +// +// ---------------------------------------------------------------------------- +// Holster weapon ID fields +// ---------------------------------------------------------------------------- + +.float holsterweapon0; // Hotspot: `QVR_HS_LEFT_SHOULDER_HOLSTER`. +.float holsterweapon1; // Hotspot: `QVR_HS_RIGHT_SHOULDER_HOLSTER`. +.float holsterweapon2; // Hotspot: `QVR_HS_LEFT_HIP_HOLSTER`. +.float holsterweapon3; // Hotspot: `QVR_HS_RIGHT_HIP_HOLSTER`. +.float holsterweapon4; // Hotspot: `QVR_HS_LEFT_UPPER_HOLSTER`. +.float holsterweapon5; // Hotspot: `QVR_HS_RIGHT_UPPER_HOLSTER`. + +// +// +// +// ---------------------------------------------------------------------------- +// Holster weapon model fields +// ---------------------------------------------------------------------------- + +// TODO VR: (P2) these are needed because they are read in C++ as 'STAT_XXX' +// variables to determine the weapon. This should be changed to use WIDs. +.string holsterweaponmodel0; +.string holsterweaponmodel1; +.string holsterweaponmodel2; +.string holsterweaponmodel3; +.string holsterweaponmodel4; +.string holsterweaponmodel5; + +// +// +// +// ---------------------------------------------------------------------------- +// Holster weapon flags fields +// ---------------------------------------------------------------------------- + +.float holsterweaponflags0; // Hotspot: `QVR_HS_LEFT_SHOULDER_HOLSTER`. +.float holsterweaponflags1; // Hotspot: `QVR_HS_RIGHT_SHOULDER_HOLSTER`. +.float holsterweaponflags2; // Hotspot: `QVR_HS_LEFT_HIP_HOLSTER`. +.float holsterweaponflags3; // Hotspot: `QVR_HS_RIGHT_HIP_HOLSTER`. +.float holsterweaponflags4; // Hotspot: `QVR_HS_LEFT_UPPER_HOLSTER`. +.float holsterweaponflags5; // Hotspot: `QVR_HS_RIGHT_UPPER_HOLSTER`. + +// +// +// +// ---------------------------------------------------------------------------- +// Hotspot fields +// ---------------------------------------------------------------------------- + +.float offhand_hotspot; +.float mainhand_hotspot; + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand ammunition fields +// ---------------------------------------------------------------------------- + +.float currentammo2; // off-hand +.float ammocounter2; // off-hand + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand firing button field +// ---------------------------------------------------------------------------- + +.float button3; // off-hand fire + +// +// +// +// ---------------------------------------------------------------------------- +// VR Yaw Angle (Thumbstick-Controlled Turn Angle) +// ---------------------------------------------------------------------------- + +.float vryaw; + +// +// +// +// ---------------------------------------------------------------------------- +// Main hand physics fields +// ---------------------------------------------------------------------------- + +.vector handpos; +.vector handrot; +.vector handvel; +.vector handthrowvel; +.float handvelmag; +.vector handavel; + +// +// +// +// ---------------------------------------------------------------------------- +// Off-hand physics fields +// ---------------------------------------------------------------------------- + +.vector offhandpos; +.vector offhandrot; +.vector offhandvel; +.vector offhandthrowvel; +.float offhandvelmag; +.vector offhandavel; + +// +// +// +// ---------------------------------------------------------------------------- +// Head physics fields +// ---------------------------------------------------------------------------- + +.vector headvel; + +// +// +// +// ---------------------------------------------------------------------------- +// Weapon muzzle fields +// ---------------------------------------------------------------------------- + +.vector muzzlepos; +.vector offmuzzlepos; + +// +// +// +// ---------------------------------------------------------------------------- +// VR-related bits +// ---------------------------------------------------------------------------- + +.float vrbits0; + +// +// +// +// ---------------------------------------------------------------------------- +// Teleportation fields +// ---------------------------------------------------------------------------- + +.vector teleport_target; + +// +// +// +// ---------------------------------------------------------------------------- +// Roomscale movement fields +// ---------------------------------------------------------------------------- + +.vector roomscalemove; + +// +// +// +// ---------------------------------------------------------------------------- +// Handtouch-related fields +// ---------------------------------------------------------------------------- + +.float touchinghand; +.float handtouch_hand; +.entity handtouch_ent; + +// +// +// +// ---------------------------------------------------------------------------- +// Bot-related fields +// ---------------------------------------------------------------------------- + +.float ishuman; diff --git a/QC/vr_util.qc b/QC/vr_util.qc new file mode 100644 index 00000000..383ac120 --- /dev/null +++ b/QC/vr_util.qc @@ -0,0 +1,426 @@ +// +// +// +// ---------------------------------------------------------------------------- +// VR Utilities Implementation Details +// ---------------------------------------------------------------------------- + +void(string fnName, float xHand) VRImpl_InvalidHandIdMessage = +{ + bprint("`"); + bprint(fnName); + bprint("`: invalid hand id '"); + bprint(ftos(xHand)); + bprint("'\n"); +} + +vector(string fnName, float xHand, vector xOff, vector xMain) VRImpl_VectorGetter = +{ + if(xHand == cVR_OffHand) return xOff; + if(xHand == cVR_MainHand) return xMain; + + VRImpl_InvalidHandIdMessage(fnName, xHand); + return '0 0 0'; +} + +float(string fnName, float xHand, float xOff, float xMain) VRImpl_FloatGetter = +{ + if(xHand == cVR_OffHand) return xOff; + if(xHand == cVR_MainHand) return xMain; + + VRImpl_InvalidHandIdMessage(fnName, xHand); + return 0.f; +} + +void(string fnName, float xHand, + float* xOutOff, float* xOutMain, float xValue) VRImpl_FloatSetter = +{ + if(xHand == cVR_OffHand) { *xOutOff = xValue; return; } + if(xHand == cVR_MainHand) { *xOutMain = xValue; return; } + + VRImpl_InvalidHandIdMessage(fnName, xHand); +} + +#define VR_IMPL_MAKE_VECTOR_GETTER(xFnName, xOff, xMain) \ + vector(float xHand) xFnName = \ + { \ + return VRImpl_VectorGetter(#xFnName, xHand, xOff, xMain); \ + } + +#define VR_IMPL_MAKE_FLOAT_GETTER(xFnName, xOff, xMain) \ + float(float xHand) xFnName = \ + { \ + return VRImpl_FloatGetter(#xFnName, xHand, xOff, xMain); \ + } + +#define VR_IMPL_MAKE_FLOAT_SETTER(xFnName, xOff, xMain) \ + void(float xHand, float xValue) xFnName = \ + { \ + VRImpl_FloatSetter(#xFnName, xHand, xOff, xMain, xValue); \ + } + +// +// +// +// ---------------------------------------------------------------------------- +// VR Getters +// ---------------------------------------------------------------------------- + +VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandPos, + self.offhandpos, + self.handpos); + +VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandRot, + self.offhandrot, + self.handrot); + +VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandVel, + self.offhandvel, + self.handvel); + +VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandThrowVel, + self.offhandthrowvel, + self.handthrowvel); + +VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandAVel, + self.offhandavel, + self.handavel); + +VR_IMPL_MAKE_VECTOR_GETTER(VRGetMuzzlePos, + self.offmuzzlepos, + self.muzzlepos); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetHandVelMag, + self.offhandvelmag, + self.handvelmag); + +vector(float xHand) VRGetWeaponFireRot = +{ + return VRGetHandRot(xHand); +} + +vector(float xHand) VRGetWeaponFireRotFwd = +{ + makeforward(VRGetWeaponFireRot(xHand)); + return v_forward; +} + +// TODO VR: (P2) move: + +typedef void() NullaryFn; +typedef void(entity, float) PainFn; + +PainFn(NullaryFn fn) asPainFn = +{ + return fn; +} + +NullaryFn(PainFn fn) fromPainToTouchFn = +{ + return fn; +} + +void(vector v) bprintVec = +{ + bprint("{"); + bprint(ftos(v_x)); + bprint("; "); + bprint(ftos(v_y)); + bprint("; "); + bprint(ftos(v_z)); + bprint("}"); + +} + +// +// +// +// ---------------------------------------------------------------------------- +// TODO VR: (P2) refactor like above +// ---------------------------------------------------------------------------- + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetMeleeHitSoundPlayed, + self.offhand_melee_hit_sound_played, + self.melee_hit_sound_played); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetMeleeHitSoundPlayed, + &self.offhand_melee_hit_sound_played, + &self.melee_hit_sound_played); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetGunChannel, + CHAN_WEAPON2, + CHAN_WEAPON); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetFireButtonPressed, + self.button3, + self.button0); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetCurrentAmmo, + self.currentammo2, + self.currentammo); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetCurrentAmmo, + &self.currentammo2, + &self.currentammo); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetAttackFinished, + self.offhand_attack_finished, + self.attack_finished); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetAttackFinished, + &self.offhand_attack_finished, + &self.attack_finished); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetWeaponFrame, + self.weaponframe2, + self.weaponframe); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetWeaponFrame, + &self.weaponframe2, + &self.weaponframe); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetForceGrabbing, + self.offhand_forcegrabbing, + self.mainhand_forcegrabbing); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetForceGrabbing, + &self.offhand_forcegrabbing, + &self.mainhand_forcegrabbing); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetAmmoCounter, + self.ammocounter2, + self.ammocounter); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetAmmoCounter, + &self.ammocounter2, + &self.ammocounter); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetWeaponFlags, + self.weaponflags2, + self.weaponflags); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetWeaponFlags, + &self.weaponflags2, + &self.weaponflags); + +VR_IMPL_MAKE_FLOAT_GETTER(VRGetLavaGunFired, + self.offHandLavaGunFired, + self.mainHandLavaGunFired); + +VR_IMPL_MAKE_FLOAT_SETTER(VRSetLavaGunFired, + &self.offHandLavaGunFired, + &self.mainHandLavaGunFired); + +float(entity e, float xHand) VRGetEntFireButtonPressed = +{ + if(xHand == cVR_OffHand) return e.button3; + else return e.button0; +} + +vector(entity e, float xHand) VRGetEntHandPos = +{ + if(xHand == cVR_OffHand) return e.offhandpos; + else return e.handpos; +} + +float(float xHand) VRIsAmmolessWeapon = +{ + return VRGetCurrentAmmo(xHand) == AID_NONE; +} + +float(float xHand) VRGetOtherHand = +{ + if(xHand == cVR_OffHand) return cVR_MainHand; + else return cVR_OffHand; +} + +void(entity e, float xHand, float v) VRSetEntWeapon = +{ + if(xHand == cVR_OffHand) e.weapon2 = v; + else e.weapon = v; +} + +void(entity e, float xHand, float v) VRSetEntWeaponFlags = +{ + if(xHand == cVR_OffHand) e.weaponflags2 = v; + else e.weaponflags = v; +} + +void(float xHand, float v) VRSetWeapon = +{ + VRSetEntWeapon(self, xHand, v); +} + +float(entity e, float xHand) VRGetEntWeapon = +{ + if(xHand == cVR_OffHand) return e.weapon2; + else return e.weapon; +} + +float(entity e, float xHand) VRGetEntWeaponFlags = +{ + if(xHand == cVR_OffHand) return e.weaponflags2; + else return e.weaponflags; +} + +float*(entity e, float xHand) VRGetEntWeaponPtr = +{ + if(xHand == cVR_OffHand) return &e.weapon2; + else return &e.weapon; +} + +float*(entity e, float xHand) VRGetEntWeaponFlagsPtr = +{ + if(xHand == cVR_OffHand) return &e.weaponflags2; + else return &e.weaponflags; +} + +float(entity e, float xHand) VRIsHandEmpty = +{ + return VRGetEntWeapon(e, xHand) == WID_FIST; +} + +void(entity e, float xHand) VRSetHandEmpty = +{ + VRSetEntWeapon(e, xHand, WID_FIST); + VRSetEntWeaponFlags(e, xHand, 0); +} + +float(float xHand) VRGetWeapon = +{ + return VRGetEntWeapon(self, xHand); +} + +float(entity e, float xHand) VRIsEntHandGrabbingBit = +{ + if(xHand == cVR_OffHand) return VRGetOffHandGrabbingBit(e); + else return VRGetMainHandGrabbingBit(e); +} + +float(entity e, float xHand) VRIsEntHandPrevGrabbingBit = +{ + if(xHand == cVR_OffHand) return VRGetOffHandPrevGrabbingBit(e); + else return VRGetMainHandPrevGrabbingBit(e); +} + +float(entity e, float xHand) VRGetEntForceGrabbing = +{ + if(xHand == cVR_OffHand) return e.offhand_forcegrabbing; + else return e.mainhand_forcegrabbing; +} + + +void(entity e, float xHand, float v) VRSetEntForceGrabbing = +{ + if(xHand == cVR_OffHand) e.offhand_forcegrabbing = v; + else e.mainhand_forcegrabbing = v; +} + +float(entity entPlayer) VRIsTouchingHandFake = +{ + return entPlayer.touchinghand == cVR_FakeHand; +} + +float(entity entPlayer) VRGetTouchingHand = +{ + if(VRIsTouchingHandFake(entPlayer)) + { + return cVR_MainHand; + } + + return entPlayer.touchinghand; +} + +float(entity entTarget) VRIsHandtouchHandFake = +{ + return entTarget.handtouch_hand == cVR_FakeHand; +} + +float(entity entTarget) VRGetHandtouchHand = +{ + if(VRIsHandtouchHandFake(entTarget)) + { + return cVR_MainHand; + } + + return entTarget.handtouch_hand; +} + +// TODO VR: (P2) organize bits + +float(float flags, float bit) VRHasBit = +{ + return !!(flags & bit); +} + +float(float flags, float bit, float value) VRSetBit = +{ + if(value) + { + return flags | bit; + } + else + { + return flags & ~bit; + } +} + +float(entity ent) VRGetTeleporting = +{ + return VRHasBit(ent.vrbits0, QVR_VRBITS0_TELEPORTING); +} + +float(entity ent) VRGetOffHandGrabbingBit = +{ + return VRHasBit(ent.vrbits0, QVR_VRBITS0_OFFHAND_GRABBING); +} + +float(entity ent) VRGetOffHandPrevGrabbingBit = +{ + return VRHasBit(ent.vrbits0, QVR_VRBITS0_OFFHAND_PREVGRABBING); +} + +float(entity ent) VRGetMainHandGrabbingBit = +{ + return VRHasBit(ent.vrbits0, QVR_VRBITS0_MAINHAND_GRABBING); +} + +float(entity ent) VRGetMainHandPrevGrabbingBit = +{ + return VRHasBit(ent.vrbits0, QVR_VRBITS0_MAINHAND_PREVGRABBING); +} + +float(entity ent) VRGet2HAiming = +{ + return VRHasBit(ent.vrbits0, QVR_VRBITS0_2H_AIMING); +} + +void(entity ent, float value) VRSetTeleporting = +{ + ent.vrbits0 = VRSetBit(ent.vrbits0, QVR_VRBITS0_TELEPORTING, value); +} + +void(entity ent, float value) VRSetOffHandGrabbingBit = +{ + ent.vrbits0 = VRSetBit(ent.vrbits0, QVR_VRBITS0_OFFHAND_GRABBING, value); +} + +void(entity ent, float value) VRSetOffHandPrevGrabbingBit = +{ + ent.vrbits0 = VRSetBit(ent.vrbits0, QVR_VRBITS0_OFFHAND_PREVGRABBING, value); +} + +void(entity ent, float value) VRSetMainHandGrabbingBit = +{ + ent.vrbits0 = VRSetBit(ent.vrbits0, QVR_VRBITS0_MAINHAND_GRABBING, value); +} + +void(entity ent, float value) VRSetMainHandPrevGrabbingBit = +{ + ent.vrbits0 = VRSetBit(ent.vrbits0, QVR_VRBITS0_MAINHAND_PREVGRABBING, value); +} + +void(entity ent, float value) VRSet2HAiming = +{ + ent.vrbits0 = VRSetBit(ent.vrbits0, QVR_VRBITS0_2H_AIMING, value); +} diff --git a/QC/vr_weaponutil.qc b/QC/vr_weaponutil.qc new file mode 100644 index 00000000..ff6488b7 --- /dev/null +++ b/QC/vr_weaponutil.qc @@ -0,0 +1,391 @@ +// +// +// +// ---------------------------------------------------------------------------- +// Implementation utilities +// ---------------------------------------------------------------------------- + +float() VR_WeaponUtil_Impl_GetEnemyDrops = +{ + return cvar_hget(cvarh_vr_enemy_drops); +} + +float() VR_WeaponUtil_Impl_GetAmmoBoxDrops = +{ + return cvar_hget(cvarh_vr_ammobox_drops); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +float(float xWeaponId) VR_WeaponUtil_IsValidWeaponId = +{ + return (xWeaponId >= WID_FIST) + && (xWeaponId <= WID_LASER_CANNON); +} + +float(entity xEnt, float xWeaponId) VR_WeaponUtil_EntHasWeapon = +{ + ASSERT(VR_WeaponUtil_IsValidWeaponId(xWeaponId)); + + if(xWeaponId == WID_FIST) + { + return TRUE; + } + + return VR_ItemUtil_EntHasItem(xEnt, WeaponIdToItemId(xWeaponId)); +} + +float(entity xEnt, float xWeaponId) VR_WeaponUtil_EntIsEligibleForWeapon = +{ + if(xWeaponId == WID_FIST) { return TRUE; } + if(xWeaponId == WID_AXE) { return TRUE; } + if(xWeaponId == WID_SHOTGUN) { return TRUE; } + + return VR_WeaponUtil_EntHasWeapon(xEnt, xWeaponId); +} + +void(entity xEnt, float xWeaponId) VR_WeaponUtil_EntAddWeapon = +{ + VR_ItemUtil_EntAddItem(xEnt, WeaponIdToItemId(xWeaponId)); +} + +void(entity xEnt, float xWeaponId) VR_WeaponUtil_EntDelWeapon = +{ + VR_ItemUtil_EntDelItem(xEnt, WeaponIdToItemId(xWeaponId)); +} + +// +// +// +// ---------------------------------------------------------------------------- +// TODO: cleanup +// ---------------------------------------------------------------------------- + +entity() FindEntPlayerForDrop = +{ + if(VR_WeaponUtil_Impl_GetEnemyDrops() == QVR_ENEMYDROPS_DISABLE) + { + return world; + } + + return find(world, classname, "player"); +} + +float(entity entEnemy, entity entPlayer, float xWeapon, float xChance) TryEnemyDrop = +{ + if(VR_WeaponUtil_Impl_GetEnemyDrops() == QVR_ENEMYDROPS_DISABLE) + { + return FALSE; + } + + // TODO VR: (P2) bitwise or is the only one that works here, || does not work. Why? + float eligible = (VR_WeaponUtil_Impl_GetEnemyDrops() == QVR_ENEMYDROPS_ALWAYS) | + (VR_WeaponUtil_EntIsEligibleForWeapon(entPlayer, xWeapon)); + + float chance = xChance * cvar_hget(cvarh_vr_enemy_drops_chance_mult); + + float roll = random(); + + if(eligible && (roll < chance)) + { + CreateWeaponDrop(entEnemy, xWeapon, entEnemy.origin); + return TRUE; + } + + return FALSE; +} + +// TODO VR: (P2) code repetition, but create ammo box uses player ent +float(entity entAmmoBox, entity entPlayer, float xWeapon, float xChance) TryAmmoBoxDrop = +{ + if(VR_WeaponUtil_Impl_GetAmmoBoxDrops() == QVR_AMMOBOXDROPS_DISABLE) + { + return FALSE; + } + + // TODO VR: (P2) bitwise or is the only one that works here, || does not work. Why? + float eligible = (VR_WeaponUtil_Impl_GetAmmoBoxDrops() == QVR_AMMOBOXDROPS_ALWAYS) | + (VR_WeaponUtil_EntIsEligibleForWeapon(entPlayer, xWeapon)); + + float chance = xChance * cvar_hget(cvarh_vr_ammobox_drops_chance_mult); + + float roll = random(); + + if(eligible && (roll < chance)) + { + CreateAmmoBoxWeaponDrop(entPlayer, xWeapon, entAmmoBox.origin); + return TRUE; + } + + return FALSE; +} + +float(float wid) WeaponIdToItemId = +{ + if(wid == WID_FIST) { return IID_FIST; } + if(wid == WID_GRAPPLE) { return IID_GRAPPLE; } + if(wid == WID_AXE) { return IID_AXE; } + if(wid == WID_MJOLNIR) { return IID_MJOLNIR; } + if(wid == WID_SHOTGUN) { return IID_SHOTGUN; } + if(wid == WID_SUPER_SHOTGUN) { return IID_SUPER_SHOTGUN; } + if(wid == WID_NAILGUN) { return IID_NAILGUN; } + if(wid == WID_SUPER_NAILGUN) { return IID_SUPER_NAILGUN; } + if(wid == WID_GRENADE_LAUNCHER) { return IID_GRENADE_LAUNCHER; } + if(wid == WID_PROXIMITY_GUN) { return IID_PROXIMITY_GUN; } + if(wid == WID_ROCKET_LAUNCHER) { return IID_ROCKET_LAUNCHER; } + if(wid == WID_LIGHTNING) { return IID_LIGHTNING; } + if(wid == WID_LASER_CANNON) { return IID_LASER_CANNON; } + + ASSERT(FALSE); + return -1; +} + +float(float it) ItemIdToWeaponId = +{ + if(it == IID_FIST) { return WID_FIST; } + if(it == IID_GRAPPLE) { return WID_GRAPPLE; } + if(it == IID_AXE) { return WID_AXE; } + if(it == IID_MJOLNIR) { return WID_MJOLNIR; } + if(it == IID_SHOTGUN) { return WID_SHOTGUN; } + if(it == IID_SUPER_SHOTGUN) { return WID_SUPER_SHOTGUN; } + if(it == IID_NAILGUN) { return WID_NAILGUN; } + if(it == IID_SUPER_NAILGUN) { return WID_SUPER_NAILGUN; } + if(it == IID_GRENADE_LAUNCHER) { return WID_GRENADE_LAUNCHER; } + if(it == IID_PROXIMITY_GUN) { return WID_PROXIMITY_GUN; } + if(it == IID_ROCKET_LAUNCHER) { return WID_ROCKET_LAUNCHER; } + if(it == IID_LIGHTNING) { return WID_LIGHTNING; } + if(it == IID_LASER_CANNON) { return WID_LASER_CANNON; } + + ASSERT(FALSE); + return -1; +} + +string(float xWeaponFlags, string xPrimaryModel, string xSecondaryModel) SelectModelByFlags = +{ + if(VRHasBit(xWeaponFlags, QVR_WPNFLAG_USE_SECONDARY_AMMO)) + { + return xSecondaryModel; + } + + return xPrimaryModel; +} + +string(float wid, float xWeaponFlags) WeaponIdToModel = +{ + if(wid == WID_FIST) { return "progs/hand.mdl"; } + if(wid == WID_GRAPPLE) { return "progs/v_grpple.mdl"; } + if(wid == WID_AXE) { return "progs/v_axe.mdl"; } + if(wid == WID_MJOLNIR) { return "progs/v_hammer.mdl"; } + if(wid == WID_SHOTGUN) { return "progs/v_shot.mdl"; } + if(wid == WID_SUPER_SHOTGUN) { return "progs/v_shot2.mdl"; } + if(wid == WID_NAILGUN) { return SelectModelByFlags(xWeaponFlags, "progs/v_nail.mdl", "progs/v_lava.mdl"); } + if(wid == WID_SUPER_NAILGUN) { return SelectModelByFlags(xWeaponFlags, "progs/v_nail2.mdl", "progs/v_lava2.mdl"); } + if(wid == WID_GRENADE_LAUNCHER) { return SelectModelByFlags(xWeaponFlags, "progs/v_rock.mdl", "progs/v_multi.mdl"); } + if(wid == WID_PROXIMITY_GUN) { return "progs/v_prox.mdl"; } + if(wid == WID_ROCKET_LAUNCHER) { return SelectModelByFlags(xWeaponFlags, "progs/v_rock2.mdl", "progs/v_multi2.mdl"); } + if(wid == WID_LIGHTNING) { return SelectModelByFlags(xWeaponFlags, "progs/v_light.mdl", "progs/v_plasma.mdl"); } + if(wid == WID_LASER_CANNON) { return "progs/v_laserg.mdl"; } + + ASSERT(FALSE); + return ""; +} + +float(float xWeaponFlags, float xPrimaryAid, float xSecondaryAid) SelectAmmoByFlags = +{ + if(VRHasBit(xWeaponFlags, QVR_WPNFLAG_USE_SECONDARY_AMMO)) + { + return xSecondaryAid; + } + + return xPrimaryAid; +} + +float(float wid, float xWeaponFlags) WeaponIdToAmmoId = +{ + if(wid == WID_FIST) { return AID_NONE; } + if(wid == WID_GRAPPLE) { return AID_NONE; } + if(wid == WID_AXE) { return AID_NONE; } + if(wid == WID_MJOLNIR) { return AID_CELLS; } + if(wid == WID_SHOTGUN) { return AID_SHELLS; } + if(wid == WID_SUPER_SHOTGUN) { return AID_SHELLS; } + if(wid == WID_NAILGUN) { return SelectAmmoByFlags(xWeaponFlags, AID_NAILS, AID_LAVA_NAILS); } + if(wid == WID_SUPER_NAILGUN) { return SelectAmmoByFlags(xWeaponFlags, AID_NAILS, AID_LAVA_NAILS); } + if(wid == WID_GRENADE_LAUNCHER) { return SelectAmmoByFlags(xWeaponFlags, AID_ROCKETS, AID_MULTI_ROCKETS); } + if(wid == WID_PROXIMITY_GUN) { return AID_ROCKETS; } + if(wid == WID_ROCKET_LAUNCHER) { return SelectAmmoByFlags(xWeaponFlags, AID_ROCKETS, AID_MULTI_ROCKETS); } + if(wid == WID_LIGHTNING) { return SelectAmmoByFlags(xWeaponFlags, AID_CELLS, AID_PLASMA); } + if(wid == WID_LASER_CANNON) { return AID_CELLS; } + + ASSERT(FALSE); + return AID_NONE; +} + +float(entity xPlayer, float wid, float xWeaponFlags) PlayerHasAmmoForWeapon = +{ + float ammoId; + ammoId = WeaponIdToAmmoId(wid, xWeaponFlags); + + if(ammoId == AID_NONE) + { + return TRUE; + } + + return VR_AmmoUtil_GetAmmoCountByAmmoId(xPlayer, ammoId) > 0; +} + +float(float wid) WeaponIdToThrowMult = +{ + // TODO VR: (P2) used for velocity, but weight is used on the calculations + // on the C++ side of things + + if(wid == WID_FIST) { return 1; } + if(wid == WID_GRAPPLE) { return 0.9; } + if(wid == WID_AXE) { return 0.9; } + if(wid == WID_MJOLNIR) { return 0.7; } + if(wid == WID_SHOTGUN) { return 0.8; } + if(wid == WID_SUPER_SHOTGUN) { return 0.8; } + if(wid == WID_NAILGUN) { return 0.8; } + if(wid == WID_SUPER_NAILGUN) { return 0.6; } + if(wid == WID_GRENADE_LAUNCHER) { return 0.6; } + if(wid == WID_PROXIMITY_GUN) { return 0.6; } + if(wid == WID_ROCKET_LAUNCHER) { return 0.6; } + if(wid == WID_LIGHTNING) { return 0.6; } + if(wid == WID_LASER_CANNON) { return 0.4; } + + ASSERT(FALSE); + return 1; +} + +float(float wid) WeaponIdToThrowStabilizeDim = +{ + if(wid == WID_FIST) { return 0; } + if(wid == WID_GRAPPLE) { return 0; } + if(wid == WID_AXE) { return 2; } + if(wid == WID_MJOLNIR) { return 2; } + if(wid == WID_SHOTGUN) { return 0; } + if(wid == WID_SUPER_SHOTGUN) { return 0; } + if(wid == WID_NAILGUN) { return 0; } + if(wid == WID_SUPER_NAILGUN) { return 0; } + if(wid == WID_GRENADE_LAUNCHER) { return 0; } + if(wid == WID_PROXIMITY_GUN) { return 0; } + if(wid == WID_ROCKET_LAUNCHER) { return 0; } + if(wid == WID_LIGHTNING) { return 0; } + if(wid == WID_LASER_CANNON) { return 0; } + + ASSERT(FALSE); + return 0; +} + +float(float wid) WeaponIdToThrowDamage = +{ + if(wid == WID_FIST) { return 20; } + if(wid == WID_GRAPPLE) { return 20; } + if(wid == WID_AXE) { return 35; } + if(wid == WID_MJOLNIR) { return 30; } + if(wid == WID_SHOTGUN) { return 20; } + if(wid == WID_SUPER_SHOTGUN) { return 20; } + if(wid == WID_NAILGUN) { return 20; } + if(wid == WID_SUPER_NAILGUN) { return 25; } + if(wid == WID_GRENADE_LAUNCHER) { return 30; } + if(wid == WID_PROXIMITY_GUN) { return 30; } + if(wid == WID_ROCKET_LAUNCHER) { return 30; } + if(wid == WID_LIGHTNING) { return 25; } + if(wid == WID_LASER_CANNON) { return 45; } + + ASSERT(FALSE); + return 0; +} + +float(float wid) WeaponIdToThrowBounds = +{ + if(wid == WID_FIST) { return 1; } + if(wid == WID_GRAPPLE) { return 1; } + if(wid == WID_AXE) { return 1; } + if(wid == WID_MJOLNIR) { return 1.1; } + if(wid == WID_SHOTGUN) { return 1.25; } + if(wid == WID_SUPER_SHOTGUN) { return 1.25; } + if(wid == WID_NAILGUN) { return 1.25; } + if(wid == WID_SUPER_NAILGUN) { return 1.5; } + if(wid == WID_GRENADE_LAUNCHER) { return 1.5; } + if(wid == WID_PROXIMITY_GUN) { return 1.5; } + if(wid == WID_ROCKET_LAUNCHER) { return 1.7; } + if(wid == WID_LIGHTNING) { return 1.5; } + if(wid == WID_LASER_CANNON) { return 2.4; } + + ASSERT(FALSE); + return 0; +} + +float(string wpnClassname) WeaponClassNameToWeaponId = +{ + if(wpnClassname == "weapon_shotgun") { return WID_SHOTGUN; } + if(wpnClassname == "weapon_nailgun") { return WID_NAILGUN; } + if(wpnClassname == "weapon_supernailgun") { return WID_SUPER_NAILGUN; } + if(wpnClassname == "weapon_supershotgun") { return WID_SUPER_SHOTGUN; } + if(wpnClassname == "weapon_rocketlauncher") { return WID_ROCKET_LAUNCHER; } + if(wpnClassname == "weapon_grenadelauncher") { return WID_GRENADE_LAUNCHER; } + if(wpnClassname == "weapon_lightning") { return WID_LIGHTNING; } + if(wpnClassname == "weapon_laser_gun") { return WID_LASER_CANNON; } + if(wpnClassname == "weapon_mjolnir") { return WID_MJOLNIR; } + if(wpnClassname == "weapon_proximity_gun") { return WID_PROXIMITY_GUN; } + + ASSERT(FALSE); + return WID_FIST; +} + +float(float wid) WeaponIdToInitialAmmoCount = +{ + if(wid == WID_FIST) { return 0; } + if(wid == WID_GRAPPLE) { return 0; } + if(wid == WID_AXE) { return 0; } + if(wid == WID_MJOLNIR) { return 30; } + if(wid == WID_SHOTGUN) { return 5; } + if(wid == WID_SUPER_SHOTGUN) { return 5; } + if(wid == WID_NAILGUN) { return 30; } + if(wid == WID_SUPER_NAILGUN) { return 30; } + if(wid == WID_GRENADE_LAUNCHER) { return 5; } + if(wid == WID_PROXIMITY_GUN) { return 6; } + if(wid == WID_ROCKET_LAUNCHER) { return 5; } + if(wid == WID_LIGHTNING) { return 15; } + if(wid == WID_LASER_CANNON) { return 30; } + + ASSERT(FALSE); + return -1; +} + +// TODO VR: (P2) use for DropBackpack, GremlinDropBackpack, netname, etc +string(float wid) WeaponIdToWeaponName = +{ + if(wid == WID_FIST) { return "Fist"; } + if(wid == WID_GRAPPLE) { return "Grapple"; } + if(wid == WID_AXE) { return "Axe"; } + if(wid == WID_MJOLNIR) { return "Mjolnir"; } + if(wid == WID_SHOTGUN) { return "Shotgun"; } + if(wid == WID_SUPER_SHOTGUN) { return "Double-barrelled Shotgun"; } + if(wid == WID_NAILGUN) { return "Nailgun"; } + if(wid == WID_SUPER_NAILGUN) { return "Super Nailgun"; } + if(wid == WID_GRENADE_LAUNCHER) { return "Grenade Launcher"; } + if(wid == WID_PROXIMITY_GUN) { return "Proximity Gun"; } + if(wid == WID_ROCKET_LAUNCHER) { return "Rocket Launcher"; } + if(wid == WID_LIGHTNING) { return "Thunderbolt"; } + if(wid == WID_LASER_CANNON) { return "Laser Cannon"; } + + ASSERT(FALSE); + return ""; +} + +float(float wid) WeaponSupportsSecondaryAmmoFlag = +{ + if(wid == WID_NAILGUN) { return TRUE; } + if(wid == WID_SUPER_NAILGUN) { return TRUE; } + if(wid == WID_GRENADE_LAUNCHER) { return TRUE; } + if(wid == WID_ROCKET_LAUNCHER) { return TRUE; } + if(wid == WID_LIGHTNING) { return TRUE; } + + return FALSE; +} diff --git a/QC/vr_wpnforcegrab.qc b/QC/vr_wpnforcegrab.qc new file mode 100644 index 00000000..498a6059 --- /dev/null +++ b/QC/vr_wpnforcegrab.qc @@ -0,0 +1,369 @@ +// +// +// +// ---------------------------------------------------------------------------- +// CVar Getters +// ---------------------------------------------------------------------------- + +float() VR_ForcegrabUtil_GetForcegrabMode = +{ + return cvar_hget(cvarh_vr_forcegrab_mode); +} + +float() VR_ForcegrabUtil_GetForcegrabRange = +{ + return cvar_hget(cvarh_vr_forcegrab_range); +} + +float() VR_ForcegrabUtil_GetForcegrabRadius = +{ + return cvar_hget(cvarh_vr_forcegrab_radius); +} + +float() VR_ForcegrabUtil_GetForcegrabPowermult = +{ + return cvar_hget(cvarh_vr_forcegrab_powermult); +} + +float() VR_ForcegrabUtil_GetForcegrabEligibleParticles = +{ + return cvar_hget(cvarh_vr_forcegrab_eligible_particles); +} + +float() VR_ForcegrabUtil_GetForcegrabEligibleHaptics = +{ + return cvar_hget(cvarh_vr_forcegrab_eligible_haptics); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Force Grab Utilities +// ---------------------------------------------------------------------------- + +float(float xHand, vector handPos, vector handRot, + float(vector xPos, float xHand, vector handPos, vector handRot) logicFn) + VR_ForcegrabUtil_Impl_PerformForcegrab = +{ + float nTraces = ceil(VR_ForcegrabUtil_GetForcegrabRange() / + VR_ForcegrabUtil_GetForcegrabRadius()); + + if(nTraces > 15) + { + nTraces = 15; + } + + makeforward(handRot); + + traceline(handPos, + handPos + v_forward * VR_ForcegrabUtil_GetForcegrabRange(), + FALSE, self); + + if(logicFn(trace_endpos, xHand, handPos, handRot)) + { + return TRUE; + } + + for(float i = 0; i <= nTraces * 2; ++i) + { + traceline(handPos, + handPos + v_forward * ((VR_ForcegrabUtil_GetForcegrabRadius() / 2.0) * i), + TRUE, self); + + if(logicFn(trace_endpos, xHand, handPos, handRot)) + { + return TRUE; + } + } + + return FALSE; +} + +float(entity xEntThrownWeapon) VR_ForcegrabUtil_Impl_IsEligibleForForcegrab +{ + if(xEntThrownWeapon.classname != "thrown_weapon" && + !(xEntThrownWeapon.flags & FL_FORCEGRABBABLE)) + { + return FALSE; + } + + if((xEntThrownWeapon.flags & FL_ONGROUND) && + vlen(xEntThrownWeapon.velocity) <= 10.f) + { + return TRUE; + } + + if((xEntThrownWeapon.flags & FL_INWATER)) + { + return TRUE; + } + + return FALSE; +} + +void(float xHand) VR_ForcegrabUtil_Impl_ForcegrabEligibleHaptic = +{ + if(!self.ishuman) + { + return; + } + + haptic(xHand, 0.0, 0.12, 75, 0.2); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Force Grab State +// ---------------------------------------------------------------------------- + +float(entity entPlayer, float xHand) +VR_ForceGrabUtil_IsEntForceGrabbing = +{ + return time < VRGetEntForceGrabbing(entPlayer, xHand) + 0.1; +} + +void(entity entPlayer, float xHand) +VR_ForceGrabUtil_EntStartForceGrabbing = +{ + VRSetEntForceGrabbing(entPlayer, xHand, time); +} + +void(entity entPlayer, float xHand) +VR_ForceGrabUtil_EntStopForceGrabbing = +{ + VRSetEntForceGrabbing(entPlayer, xHand, 0); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Force Grab Implementations +// ---------------------------------------------------------------------------- + +float(vector xPos, float xHand, vector handPos, vector handRot) +VR_ForcegrabUtil_Impl_DoForcegrabParabola_Logic = +{ + for(entity e = findradius(xPos, VR_ForcegrabUtil_GetForcegrabRadius()); e; e = e.chain) + { + if(!VR_ForcegrabUtil_Impl_IsEligibleForForcegrab(e)) + { + continue; + } + + vector startPos = e.origin; + + makevectors(handRot); + vector endPos = handPos - v_forward * 3.0; + + vector diff = endPos - startPos; + float distFactor = vlen(diff) / 130; + + float initialSpeed = 180 + 275 * distFactor; + float grav = -cvar("sv_gravity"); + + vector diffXY = diff; + diffXY.z = 0; + + float groundFactor = 1; + /* + if(startPos.z < endPos.z) + { + float gf = fabs(startPos.z - endPos.z) / 70; + if(gf > 1) + { + groundFactor = pow(gf, 0.7); + } + } + */ + + float groundDist = vlen(diffXY); + + float speed2 = initialSpeed * initialSpeed; + float speed4 = initialSpeed * initialSpeed * initialSpeed * initialSpeed; + float z = diff.z; + float x = groundDist; + float gx = grav * x; + + float root = speed4 - grav*(grav*x*x + 2*z*speed2); + + if (root < 0) + { + bprint("could not solve equation"); + return FALSE; + } + + root = sqrt(root); + + float highAng = atan2(speed2 + root, gx); + + vector groundDir = normalize(diffXY); + + e.velocity = -groundDir*cos(highAng)*initialSpeed + '0 0 1'*sin(highAng)*initialSpeed; + e.velocity *= 1.05; + e.velocity *= groundFactor; + + e.throwhit = QVR_THROWHIT_FORCEGRAB_PARABOLA; + SetThrownWeaponForcegrabTime(e, time); + e.enemy = self; + e.thinkArg = xHand; + + sound(e, CHAN_AUTO, "knight/sword2.wav", 0.7, ATTN_NORM); + sound(self, CHAN_AUTO, "forcegrab.wav", 0.65, ATTN_NORM); + + VR_ForceGrabUtil_EntStartForceGrabbing(self, xHand); + return TRUE; + } + + return FALSE; +} + +float(float xHand, vector handPos, vector handRot) VR_ForcegrabUtil_Impl_DoForcegrabParabola = +{ + if(VR_ForceGrabUtil_IsEntForceGrabbing(self, xHand)) + { + return FALSE; + } + + return VR_ForcegrabUtil_Impl_PerformForcegrab(xHand, handPos, handRot, + VR_ForcegrabUtil_Impl_DoForcegrabParabola_Logic); +} + +// --- + +float(vector xPos, float xHand, vector handPos, vector handRot) +VR_ForcegrabUtil_Impl_DoForcegrabLinear_Logic = +{ + for(entity e = findradius(xPos, VR_ForcegrabUtil_GetForcegrabRadius()); e; e = e.chain) + { + if(!VR_ForcegrabUtil_Impl_IsEligibleForForcegrab(e)) + { + continue; + } + + if(e.throwhit != QVR_THROWHIT_FORCEGRAB) + { + e.throwhit = QVR_THROWHIT_FORCEGRAB; + SetThrownWeaponForcegrabTime(e, time); + SetThrownWeaponForcegrabHand(e, xHand); + + vector dir = normalize(handPos - e.origin); + e.origin += dir * 0.25f; + + sound(e, CHAN_AUTO, "knight/sword2.wav", 0.7, ATTN_NORM); + sound(self, CHAN_AUTO, "forcegrab.wav", 0.65, ATTN_NORM); + } + + if(e.throwhit == QVR_THROWHIT_FORCEGRAB) + { + e.movetype = MOVETYPE_FLYMISSILE; + + vector dir = normalize(handPos - e.origin); + + e.velocity = dir * 700; + e.velocity *= VR_ForcegrabUtil_GetForcegrabPowermult(); + + VR_ForceGrabUtil_EntStartForceGrabbing(self, xHand); + return TRUE; + } + } + + return FALSE; +} + +float(float xHand, vector handPos, vector handRot) VR_ForcegrabUtil_Impl_DoForcegrabLinear = +{ + if(VR_ForceGrabUtil_IsEntForceGrabbing(self, xHand)) + { + return FALSE; + } + + return VR_ForcegrabUtil_Impl_PerformForcegrab(xHand, handPos, handRot, + VR_ForcegrabUtil_Impl_DoForcegrabLinear_Logic); +} + +// --- + +float(vector xPos, float xHand, vector handPos, vector handRot) +VR_ForcegrabUtil_Impl_DoForcegrabInstant_Logic = +{ + for(entity e = findradius(xPos, VR_ForcegrabUtil_GetForcegrabRadius()); e; e = e.chain) + { + if(!VR_ForcegrabUtil_Impl_IsEligibleForForcegrab(e)) + { + continue; + } + + wpnthrow_forcegrab_instant_ent(e, self, xHand); + + sound(e, CHAN_AUTO, "knight/sword2.wav", 0.7, ATTN_NORM); + sound(self, CHAN_AUTO, "forcegrab.wav", 0.65, ATTN_NORM); + + VR_ForceGrabUtil_EntStartForceGrabbing(self, xHand); + return TRUE; + } + + return FALSE; +} + +float(float xHand, vector handPos, vector handRot) +VR_ForcegrabUtil_Impl_DoForcegrabInstant = +{ + if(VR_ForceGrabUtil_IsEntForceGrabbing(self, xHand)) + { + return FALSE; + } + + return VR_ForcegrabUtil_Impl_PerformForcegrab(xHand, handPos, handRot, + VR_ForcegrabUtil_Impl_DoForcegrabInstant_Logic); +} + +// --- + +float(vector xPos, float xHand, vector handPos, vector handRot) +ParticlesAndHapticsForEligibleForceGrabWeapon_Logic = +{ + float doParticles = VR_ForcegrabUtil_GetForcegrabEligibleParticles(); + float doHaptics = VR_ForcegrabUtil_GetForcegrabEligibleHaptics(); + + for(entity e = findradius(xPos, VR_ForcegrabUtil_GetForcegrabRadius()); e; e = e.chain) + { + if(!VR_ForcegrabUtil_Impl_IsEligibleForForcegrab(e)) + { + continue; + } + + if(doParticles) + { + if(random() < 0.35) + { + particle2(realorigin(e), '0 0 0', QVR_PARTICLE_PRESET_GUNFORCEGRAB, 1); + } + } + + if(doHaptics) + { + VR_ForcegrabUtil_Impl_ForcegrabEligibleHaptic(xHand); + } + + return TRUE; + } + + return FALSE; +} + +float(float xHand, vector handPos, vector handRot) +ParticlesAndHapticsForEligibleForceGrabWeapons = +{ + if(!VR_ForcegrabUtil_GetForcegrabEligibleParticles() && + !VR_ForcegrabUtil_GetForcegrabEligibleHaptics()) + { + return FALSE; + } + + return VR_ForcegrabUtil_Impl_PerformForcegrab(xHand, handPos, handRot, + ParticlesAndHapticsForEligibleForceGrabWeapon_Logic); +} diff --git a/QC/vrprogs.dat b/QC/vrprogs.dat new file mode 100644 index 00000000..f936bc43 Binary files /dev/null and b/QC/vrprogs.dat differ diff --git a/QC/vrprogs.lno b/QC/vrprogs.lno new file mode 100644 index 00000000..132bad1a Binary files /dev/null and b/QC/vrprogs.lno differ diff --git a/QC/vrutil.qc b/QC/vrutil.qc deleted file mode 100644 index 68acdcc8..00000000 --- a/QC/vrutil.qc +++ /dev/null @@ -1,274 +0,0 @@ -// -// -// -// ---------------------------------------------------------------------------- -// VR Utilities Implementation Details -// ---------------------------------------------------------------------------- - -void(string fnName, float xHand) VRImpl_InvalidHandIdMessage = -{ - bprint("`"); - bprint(fnName); - bprint("`: invalid hand id '"); - bprint(ftos(xHand)); - bprint("'\n"); -} - -vector(string fnName, float xHand, vector xOff, vector xMain) VRImpl_VectorGetter = -{ - if(xHand == cVR_OffHand) return xOff; - if(xHand == cVR_MainHand) return xMain; - - VRImpl_InvalidHandIdMessage(fnName, xHand); - return '0 0 0'; -} - -float(string fnName, float xHand, float xOff, float xMain) VRImpl_FloatGetter = -{ - if(xHand == cVR_OffHand) return xOff; - if(xHand == cVR_MainHand) return xMain; - - VRImpl_InvalidHandIdMessage(fnName, xHand); - return 0.f; -} - -void(string fnName, float xHand, - float* xOutOff, float* xOutMain, float xValue) VRImpl_FloatSetter = -{ - if(xHand == cVR_OffHand) { *xOutOff = xValue; return; } - if(xHand == cVR_MainHand) { *xOutMain = xValue; return; } - - VRImpl_InvalidHandIdMessage(fnName, xHand); -} - -#define VR_IMPL_MAKE_VECTOR_GETTER(xFnName, xOff, xMain) \ - vector(float xHand) xFnName = \ - { \ - return VRImpl_VectorGetter(#xFnName, xHand, xOff, xMain); \ - } - -#define VR_IMPL_MAKE_FLOAT_GETTER(xFnName, xOff, xMain) \ - float(float xHand) xFnName = \ - { \ - return VRImpl_FloatGetter(#xFnName, xHand, xOff, xMain); \ - } - -#define VR_IMPL_MAKE_FLOAT_SETTER(xFnName, xOff, xMain) \ - void(float xHand, float xValue) xFnName = \ - { \ - VRImpl_FloatSetter(#xFnName, xHand, xOff, xMain, xValue); \ - } - -// -// -// -// ---------------------------------------------------------------------------- -// VR Getters -// ---------------------------------------------------------------------------- - -VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandPos, - self.offhandpos, - self.handpos); - -VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandRot, - self.offhandrot, - self.handrot); - -VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandVel, - self.offhandvel, - self.handvel); - -VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandThrowVel, - self.offhandthrowvel, - self.handthrowvel); - -VR_IMPL_MAKE_VECTOR_GETTER(VRGetHandAVel, - self.offhandavel, - self.handavel); - -VR_IMPL_MAKE_VECTOR_GETTER(VRGetMuzzlePos, - self.offmuzzlepos, - self.muzzlepos); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetHandVelMag, - self.offhandvelmag, - self.handvelmag); - -vector(float xHand) VRGetWeaponFireRot = -{ - return VRGetHandRot(xHand); -} - -vector(float xHand) VRGetWeaponFireRotFwd = -{ - makeforward (VRGetWeaponFireRot(xHand)); - return v_forward; -} - -// -// -// -// ---------------------------------------------------------------------------- -// TODO VR: (P2) refactor like above -// ---------------------------------------------------------------------------- - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetMeleeHitSoundPlayed, - self.offhand_melee_hit_sound_played, - self.melee_hit_sound_played); - -VR_IMPL_MAKE_FLOAT_SETTER(VRSetMeleeHitSoundPlayed, - &self.offhand_melee_hit_sound_played, - &self.melee_hit_sound_played); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetGunChannel, - CHAN_WEAPON2, - CHAN_WEAPON); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetCurrentAmmo, - self.currentammo2, - self.currentammo); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetFireButtonPressed, - self.button3, - self.button0); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetAttackFinished, - self.offhand_attack_finished, - self.attack_finished); - -VR_IMPL_MAKE_FLOAT_SETTER(VRSetAttackFinished, - &self.offhand_attack_finished, - &self.attack_finished); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetWeaponFrame, - self.weaponframe2, - self.weaponframe); - -VR_IMPL_MAKE_FLOAT_SETTER(VRSetWeaponFrame, - &self.weaponframe2, - &self.weaponframe); - -VR_IMPL_MAKE_FLOAT_GETTER(VRGetForceGrabbing, - self.offhand_forcegrabbing, - self.mainhand_forcegrabbing); - -VR_IMPL_MAKE_FLOAT_SETTER(VRSetForceGrabbing, - &self.offhand_forcegrabbing, - &self.mainhand_forcegrabbing); - -float(float xHand) VRIsAmmolessWeapon = -{ - return VRGetCurrentAmmo(xHand) == AID_NONE; -} - -float(float xHand) VRGetOtherHand = -{ - if(xHand == cVR_OffHand) return cVR_MainHand; - else return cVR_OffHand; -} - -void(entity e, float xHand, float v) VRSetEntWeapon = -{ - if(xHand == cVR_OffHand) e.weapon2 = v; - else e.weapon = v; -} - -void(float xHand, float v) VRSetWeapon = -{ - VRSetEntWeapon(self, xHand, v); -} - -float(entity e, float xHand) VRGetEntWeapon = -{ - if(xHand == cVR_OffHand) return e.weapon2; - else return e.weapon; -} - -float(entity e, float xHand) VRIsHandEmpty = -{ - return VRGetEntWeapon(e, xHand) == WID_FIST; -} - -void(entity e, float xHand) VRSetHandEmpty = -{ - VRSetEntWeapon(e, xHand, WID_FIST); -} - -float(float xHand) VRGetWeapon = -{ - return VRGetEntWeapon(self, xHand); -} - -float(entity e, float xHand) VRIsEntHandGrabbing = -{ - if(xHand == cVR_OffHand) return e.offhand_grabbing; - else return e.mainhand_grabbing; -} - -float(entity e, float xHand) VRIsEntHandPrevGrabbing = -{ - if(xHand == cVR_OffHand) return e.offhand_prevgrabbing; - else return e.mainhand_prevgrabbing; -} - -float(entity e, float xHand) VREntStartedHandGrabbing = -{ - return VRIsEntHandPrevGrabbing(e, xHand) == FALSE && - VRIsEntHandGrabbing(e, xHand) == TRUE; -} - -float(entity e, float xHand) VREntStoppedHandGrabbing = -{ - return VRIsEntHandPrevGrabbing(e, xHand) == TRUE && - VRIsEntHandGrabbing(e, xHand) == FALSE; -} - -float(float xHand) VRIsHandGrabbing = -{ - return VRIsEntHandGrabbing(self, xHand); -} - -float(float xHand) VRIsHandPrevGrabbing = -{ - return VRIsEntHandPrevGrabbing(self, xHand); -} - -float(float xHand) VRStartedHandGrabbing = -{ - return VREntStartedHandGrabbing(self, xHand); -} - -float(float xHand) VRStoppedHandGrabbing = -{ - return VREntStoppedHandGrabbing(self, xHand); -} - -float(entity entPlayer) VRIsTouchingHandFake = -{ - return entPlayer.touchinghand == cVR_FakeHand; -} - -float(entity entPlayer) VRGetTouchingHand = -{ - if(VRIsTouchingHandFake(entPlayer)) - { - return cVR_MainHand; - } - - return entPlayer.touchinghand; -} - -float(entity entTarget) VRIsHandtouchHandFake = -{ - return entTarget.handtouch_hand == cVR_FakeHand; -} - -float(entity entTarget) VRGetHandtouchHand = -{ - if(VRIsHandtouchHandFake(entTarget)) - { - return cVR_MainHand; - } - - return entTarget.handtouch_hand; -} diff --git a/QC/waypoints/map_dm1.qc b/QC/waypoints/map_dm1.qc new file mode 100644 index 00000000..a330eac0 --- /dev/null +++ b/QC/waypoints/map_dm1.qc @@ -0,0 +1,62 @@ +/* QC Waypoint Dump - src/frikbot/map_dm1.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm1 = +{ + make_way('640.0 716.0 46.0', '2 20 0', 0, 0); + make_way('1066.0 733.0 94.0', '1 3 40', 0, 0); + make_way('1054.0 1321.0 94.0', '2 4 0', 0, 0); + make_way('783.0 1313.0 46.0', '6 37 3', 5, 0); + make_way('585.0 883.0 46.0', '4 6 37', 0, 0); + make_way('901.0 1060.0 46.0', '4 5 37', 0, 0); + make_way('448.0 1313.0 42.0', '37 27 8', 0, 0); + make_way('436.0 1562.0 46.0', '7 9 0', 0, 0); + make_way('238.0 1593.0 46.0', '8 10 44', 0, 0); + make_way('-122.0 1583.0 -98.0', '9 11 0', 0, 0); + make_way('-127.0 1414.0 -98.0', '10 12 0', 0, 0); + make_way('113.0 1416.0 -98.0', '11 13 43', 0, 0); + make_way('109.0 1287.0 -98.0', '12 14 41', 31, 0); + make_way('417.0 1258.0 -98.0', '13 35 31', 15, 0); + make_way('157.0 916.0 -98.0', '46 16 31', 14, 0); + make_way('-292.0 866.0 -98.0', '46 38 41', 15, 0); + make_way('397.0 1595.0 -98.0', '35 7 0', 0, 2); + make_way('-143.0 1418.0 46.0', '44 19 0', 0, 32784); + make_way('-385.0 1407.0 46.0', '36 18 0', 0, 65536); + make_way('607.0 608.0 46.0', '1 51 0', 0, 0); + make_way(' 77.0 614.0 46.0', '51 48 0', 0, 0); + make_way('-501.0 770.0 46.0', '47 23 0', 0, 0); + make_way('-534.0 988.0 46.0', '22 24 0', 0, 0); + make_way('-655.0 992.0 46.0', '23 25 0', 0, 0); + make_way('-651.0 1227.0 46.0', '24 26 32', 45, 0); + make_way('-524.0 1592.0 46.0', '25 10 39', 45, 128); + make_way('443.0 1145.0 46.0', '7 28 29', 0, 0); + make_way('220.0 1236.0 46.0', '27 30 31', 0, 0); + make_way('178.0 1027.0 46.0', '27 30 31', 0, 0); + make_way(' 28.0 1157.0 46.0', '29 28 31', 0, 128); + make_way('153.0 1154.0 -98.0', '13 15 41', 14, 0); + make_way('-307.0 1219.0 94.0', '25 33 39', 0, 0); + make_way('-292.0 1100.0 94.0', '32 16 38', 0, 0); + make_way('464.0 823.0 46.0', '52 0 0', 0, 128); + make_way('435.0 1451.0 -98.0', '17 0 0', 0, 128); + make_way('-300.0 1432.0 46.0', '10 0 0', 0, 128); + make_way('600.0 1309.0 46.0', '4 5 7', 6, 0); + make_way('-322.0 1007.0 -98.0', '16 41 0', 0, 0); + make_way('-543.0 1222.0 46.0', '26 32 45', 0, 0); + make_way('1000.0 941.0 94.0', '6 0 0', 0, 0); + make_way('-156.0 1049.0 -98.0', '38 31 16', 13, 0); + make_way('104.0 1392.0 46.0', '44 11 0', 0, 128); + make_way('280.0 1416.0 -98.0', '12 0 0', 0, 0); + make_way('280.0 1416.0 46.0', '18 9 42', 0, 128); + make_way('-656.0 1417.0 46.0', '25 26 39', 0, 0); + make_way('-263.0 723.0 -98.0', '15 16 0', 0, 0); + make_way('-203.0 769.0 46.0', '48 22 38', 0, 0); + make_way(' 82.0 763.0 46.0', '21 47 50', 15, 0); + make_way('348.0 758.0 46.0', '34 0 0', 0, 256); + make_way('141.0 764.0 46.0', '49 0 0', 0, 256); + make_way('488.0 607.0 46.0', '52 20 21', 0, 0); + make_way('482.0 683.0 54.0', '51 34 0', 0, 0); +}; diff --git a/QC/waypoints/map_dm2.qc b/QC/waypoints/map_dm2.qc new file mode 100644 index 00000000..73f74c5d --- /dev/null +++ b/QC/waypoints/map_dm2.qc @@ -0,0 +1,98 @@ +/* QC Waypoint Dump - src/frikbot/map_dm2.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by Frika C + +void() map_dm2 = +{ + make_way('2441.0 -189.1 46.0', '2 72 0', 0, 0); + make_way('2036.7 -141.6 46.0', '26 1 41', 46, 0); + make_way('2126.7 238.6 46.0', '0 43 41', 0, 0); + make_way('2615.4 -7.7 142.0', '68 41 0', 0, 0); + make_way('2614.6 -781.7 142.0', '73 6 62', 0, 0); + make_way('2455.8 -830.3 142.0', '5 7 48', 62, 0); + make_way('2511.8 -1395.2 46.0', '8 11 62', 0, 0); + make_way('2481.5 -1681.3 46.0', '28 9 7', 0, 0); + make_way('2391.6 -1861.9 46.0', '10 8 0', 0, 0); + make_way('2184.0 -1867.0 46.0', '53 9 0', 0, 0); + make_way('2741.6 -1424.7 46.0', '7 12 0', 0, 0); + make_way('2735.0 -1693.3 142.0', '11 47 0', 0, 0); + make_way('2927.9 -1852.4 142.0', '47 14 0', 0, 16); + make_way('2946.4 -1993.7 142.0', '13 37 0', 0, 16); + make_way('2254.5 -185.3 -114.0', '16 0 0', 0, 0); + make_way('2249.8 -27.2 -114.0', '15 17 0', 0, 0); + make_way('2611.8 -8.2 -50.0', '44 16 45', 0, 0); + make_way('1347.5 -1024.0 366.0', '59 58 0', 0, 0); + make_way('2002.3 -1024.0 366.0', '35 0 0', 0, 0); + make_way('1330.1 -714.6 366.0', '18 0 59', 0, 1024); + make_way('1323.0 -381.6 206.0', '22 24 0', 0, 0); + make_way('1328.2 -487.0 206.0', '21 20 61', 0, 0); + make_way('1559.7 -654.4 206.0', '0 60 0', 0, 0); + make_way('1837.4 -363.6 206.0', '21 25 0', 0, 0); + make_way('1877.0 -652.0 206.0', '24 26 0', 0, 0); + make_way('2038.3 -473.0 126.0', '2 27 50', 0, 0); + make_way('1683.4 -506.8 46.0', '26 64 63', 71, 0); + make_way('1699.3 -1694.6 46.0', '65 8 0', 0, 65536); + make_way('1697.9 -1336.4 42.0', '35 31 30', 65, 32784); + make_way('2058.4 -1354.2 158.0', '29 33 0', 0, 0); + make_way('1307.4 -1338.4 166.0', '29 32 0', 0, 0); + make_way('1315.8 -1034.8 222.0', '31 36 0', 0, 0); + make_way('2043.6 -1030.7 222.0', '30 34 0', 0, 0); + make_way('2043.6 -904.3 54.0', '35 0 0', 0, 1); + make_way('1696.0 -1037.4 42.0', '64 29 55', 56, 32784); + make_way('1307.4 -872.6 54.0', '35 0 0', 0, 1); + make_way('2733.5 -2008.2 142.0', '38 0 0', 0, 0); + make_way('2731.0 -2283.1 142.0', '37 39 0', 0, 0); + make_way('2425.1 -2305.7 142.0', '38 40 0', 0, 0); + make_way('2423.1 -2444.5 142.0', '39 67 31', 0, 4); + make_way('2175.6 -55.9 46.0', '4 2 0', 3, 0); + make_way('2181.9 -2388.8 222.0', '67 70 0', 0, 0); + make_way('2347.3 317.0 30.0', '3 74 0', 0, 0); + make_way('2644.7 235.2 -50.0', '74 17 0', 0, 0); + make_way('2806.9 -27.3 -50.0', '18 0 0', 0, 1); + make_way('2408.5 -401.3 30.0', '2 0 0', 0, 0); + make_way('2742.7 -1857.6 142.0', '12 13 0', 0, 0); + make_way('2352.0 -858.9 78.0', '49 0 0', 0, 0); + make_way('2375.9 -685.3 78.0', '48 46 0', 0, 0); + make_way('1971.3 -556.1 126.0', '25 0 0', 0, 4096); + make_way('2429.1 -1968.0 142.0', '52 66 0', 0, 128); + make_way('2280.0 -1968.0 142.0', '51 53 0', 0, 160); + make_way('2170.1 -1977.8 94.0', '10 69 0', 0, 160); + make_way('2189.7 -2258.8 106.0', '42 0 0', 0, 4096); + make_way('1424.0 -944.4 42.0', '35 0 0', 0, 32768); + make_way('1908.5 -928.4 42.0', '35 0 0', 0, 32768); + make_way('1825.4 -1029.8 366.0', '19 0 0', 0, 2048); + make_way('1512.9 -1015.2 366.0', '18 57 0', 0, 2048); + make_way('1264.0 -721.5 366.0', '20 22 18', 0, 0); + make_way('1440.6 -673.6 206.0', '23 61 0', 0, 32); + make_way('1449.1 -566.9 206.0', '60 22 63', 0, 32); + make_way('2525.9 -867.2 142.0', '6 0 5', 0, 1024); + make_way('1545.7 -488.4 46.0', '27 0 0', 0, 128); + make_way('1687.9 -744.0 42.0', '27 35 0', 0, 32784); + make_way('1700.6 -1513.2 46.0', '29 28 0', 0, 0); + make_way('2553.9 -1971.9 142.0', '51 0 0', 0, 160); + make_way('2160.2 -2469.1 222.0', '42 40 0', 0, 0); + make_way('2601.2 -176.0 142.0', '4 73 0', 0, 0); + make_way('2178.2 -2134.2 106.0', '53 54 70', 0, 0); + make_way('2172.0 -2347.6 110.0', '69 75 0', 0, 0); + make_way('1622.4 -528.7 46.0', '61 0 0', 0, 4096); + make_way('2576.0 -192.1 54.0', '1 0 0', 0, 0); + make_way('2611.3 -441.3 142.0', '5 68 0', 0, 0); + make_way('2456.5 297.3 -34.0', '43 44 0', 0, 0); + make_way('2168.4 -2336.3 110.0', '76 0 0', 0, 16); + make_way('2165.7 -1808.0 46.0', '77 0 0', 0, 0); + make_way('2529.4 -1844.5 46.0', '78 0 0', 0, 0); + make_way('2585.1 -1394.2 46.0', '79 0 0', 0, 0); + make_way('2752.6 -1389.0 46.0', '80 0 0', 0, 0); + make_way('2734.7 -1822.2 142.0', '81 0 0', 0, 0); + make_way('2980.3 -1832.3 142.0', '82 0 0', 0, 16); + make_way('2957.0 -2032.2 142.0', '83 0 0', 0, 16); + make_way('2720.9 -2057.8 150.0', '84 0 0', 0, 0); + make_way('2693.6 -2275.7 142.0', '85 0 0', 0, 0); + make_way('2429.9 -2295.8 142.0', '86 0 0', 0, 0); + make_way('2431.5 -2115.8 142.0', '51 0 0', 0, 32784); +}; + +// End dump \ No newline at end of file diff --git a/QC/waypoints/map_dm3.qc b/QC/waypoints/map_dm3.qc new file mode 100644 index 00000000..56637c3f --- /dev/null +++ b/QC/waypoints/map_dm3.qc @@ -0,0 +1,149 @@ +/* QC Waypoint Dump - src/frikbot/map_dm3.qc +For instructions please read the +wayedit.txt that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by Frika C + +void() map_dm3 = +{ + make_way('-888.8 -71.0 6.0', '44 3 2', 0, 0); + make_way('-937.4 19.2 6.0', '3 1 45', 0, 0); + make_way('-827.2 26.1 6.0', '1 2 4', 0, 0); + make_way('-801.5 366.8 6.0', '3 5 0', 0, 0); + make_way('-783.8 774.2 6.0', '4 6 0', 0, 0); + make_way('-550.2 759.6 6.0', '5 7 0', 0, 0); + make_way('-574.0 368.0 6.0', '6 8 0', 0, 0); + make_way('-430.2 378.3 6.0', '7 9 0', 0, 0); + make_way('-406.9 784.0 6.0', '8 10 0', 0, 0); + make_way('-259.9 772.3 6.0', '9 11 12', 0, 0); + make_way('-243.7 250.5 14.0', '10 12 0', 0, 0); + make_way('-35.8 581.6 62.0', '10 11 13', 14, 0); + make_way(' 29.5 647.5 62.0', '12 15 49', 0, 0); + make_way('521.9 603.4 78.0', '12 15 0', 0, 0); + make_way('507.6 514.3 78.0', '14 13 16', 0, 0); + make_way('504.3 308.4 78.0', '15 20 17', 0, 0); + make_way('175.2 -34.7 78.0', '16 19 20', 18, 0); + make_way('485.8 -387.2 78.0', '17 21 19', 0, 0); + make_way('368.0 -201.7 78.0', '17 18 51', 0, 0); + make_way('397.0 124.9 78.0', '16 17 51', 0, 0); + make_way('496.0 -558.1 78.0', '18 22 58', 31, 0); + make_way('147.5 -528.0 174.0', '21 23 0', 0, 128); + make_way('-213.3 -528.0 174.0', '22 24 0', 0, 128); + make_way('-229.6 -865.0 174.0', '23 25 0', 0, 128); + make_way('339.0 -873.6 286.0', '24 26 0', 0, 128); + make_way('341.2 -538.2 286.0', '25 27 0', 0, 128); + make_way('-143.0 -535.0 350.0', '26 28 0', 0, 128); + make_way('-143.3 -696.6 350.0', '27 29 0', 0, 128); + make_way('283.6 -703.7 350.0', '28 30 0', 0, 128); + make_way('371.0 -699.8 286.0', '31 0 0', 0, 128); + make_way('416.0 -691.3 6.0', '33 32 0', 0, 0); + make_way('253.9 -794.9 6.0', '31 57 34', 0, 0); + make_way('253.7 -610.4 6.0', '57 31 0', 0, 0); + make_way('-64.0 -727.5 6.0', '32 35 36', 37, 0); + make_way('-40.6 -874.3 6.0', '34 37 58', 0, 128); + make_way(' 43.7 -535.1 6.0', '37 57 34', 56, 0); + make_way('-172.1 -560.9 6.0', '38 36 35', 34, 0); + make_way('-298.6 -563.7 6.0', '39 37 0', 0, 0); + make_way('-318.6 -710.5 6.0', '38 40 0', 0, 0); + make_way('-629.4 -683.2 6.0', '39 41 0', 0, 0); + make_way('-626.9 -449.0 6.0', '40 42 43', 0, 0); + make_way('-565.7 -449.0 6.0', '41 19 0', 0, 2); + make_way('-654.9 -271.1 6.0', '41 44 0', 0, 0); + make_way('-873.3 -247.0 6.0', '43 1 0', 0, 0); + make_way('-939.9 347.7 142.0', '46 2 0', 0, 0); + make_way('-912.7 821.5 142.0', '47 45 5', 0, 0); + make_way('-577.0 859.7 142.0', '50 46 48', 0, 0); + make_way('-556.0 784.6 142.0', '47 6 59', 0, 256); + make_way('-98.5 799.3 142.0', '13 50 0', 0, 0); + make_way('-198.8 861.0 142.0', '49 47 10', 0, 0); + make_way('584.5 -30.1 -146.0', '52 69 71', 0, 0); + make_way('288.5 -27.4 -154.0', '53 51 0', 0, 0); + make_way('126.7 -188.8 -154.0', '54 52 0', 0, 0); + make_way('-164.4 -210.3 -154.0', '55 53 0', 0, 0); + make_way('-177.9 -425.6 -90.0', '56 54 0', 0, 0); + make_way(' 52.6 -443.0 -10.0', '36 55 0', 0, 0); + make_way(' 71.4 -634.1 6.0', '36 33 32', 0, 0); + make_way('496.0 -880.0 78.0', '35 21 31', 0, 128); + make_way('-528.0 664.4 142.0', '60 6 0', 0, 65536); + make_way('-496.8 461.0 142.0', '59 8 7', 61, 65792); + make_way('-466.9 320.2 142.0', '62 11 7', 60, 65824); + make_way('-459.7 277.2 166.0', '63 0 0', 0, 65824); + make_way('-467.3 208.0 198.0', '11 64 0', 0, 65536); + make_way('-719.9 208.0 206.0', '63 68 0', 0, 65664); + make_way('-825.0 251.2 206.0', '68 66 3', 0, 65792); + make_way('-799.7 108.2 206.0', '67 2 0', 0, 65568); + make_way('-688.0 99.6 206.0', '66 0 0', 0, 65536); + make_way('-797.7 318.5 206.0', '65 64 45', 0, 65664); + make_way('822.8 -265.4 -162.0', '51 70 0', 0, 0); + make_way('1000.0 -29.9 -162.0', '71 69 122', 0, 0); + make_way('827.2 198.1 -162.0', '51 70 0', 0, 0); + make_way('1970.0 -31.5 -146.0', '123 78 73', 0, 0); + make_way('1982.6 197.3 -66.0', '72 74 0', 0, 0); + make_way('1964.1 437.3 -66.0', '73 75 76', 0, 0); + make_way('1544.8 491.8 -66.0', '74 76 0', 0, 0); + make_way('1693.0 400.0 -66.0', '75 74 77', 0, 256); + make_way('1695.4 362.0 -42.0', '132 131 0', 0, 0); + make_way('1963.1 -436.8 -2.0', '72 79 0', 0, 0); + make_way('1380.4 -427.4 -2.0', '78 102 80', 0, 0); + make_way('1186.5 -681.2 -2.0', '81 79 121', 0, 0); + make_way('1322.4 -745.5 -2.0', '82 80 0', 0, 0); + make_way('1461.8 -756.2 -2.0', '85 83 81', 0, 0); + make_way('1432.7 -944.0 -2.0', '82 84 0', 0, 0); + make_way('1248.5 -926.6 -2.0', '83 101 0', 0, 2); + make_way('1707.9 -715.7 -2.0', '86 82 0', 0, 0); + make_way('1821.0 -850.6 -2.0', '87 85 0', 0, 0); + make_way('1531.5 -899.7 110.0', '88 86 82', 85, 0); + make_way('1125.5 -896.2 110.0', '89 87 0', 0, 0); + make_way('986.5 -799.6 110.0', '90 88 80', 121, 0); + make_way('811.1 -657.7 110.0', '91 89 0', 0, 0); + make_way('658.1 -638.4 110.0', '92 90 0', 0, 0); + make_way('656.0 -356.4 78.0', '93 91 0', 0, 0); + make_way('824.9 -256.7 78.0', '94 92 51', 0, 0); + make_way('952.1 -32.8 78.0', '95 93 0', 0, 0); + make_way('817.3 175.9 78.0', '96 94 51', 0, 0); + make_way('633.2 323.0 78.0', '97 95 0', 0, 0); + make_way('631.7 415.3 78.0', '98 96 0', 0, 0); + make_way('822.9 444.2 78.0', '99 101 97', 0, 0); + make_way('1111.5 624.0 78.0', '101 100 98', 0, 256); + make_way('1114.6 651.3 102.0', '111 0 0', 0, 768); + make_way('1338.2 383.4 78.0', '102 99 98', 0, 0); + make_way('1366.0 -48.8 -2.0', '79 101 123', 122, 0); + make_way('1355.8 65.9 -370.0', '128 125 132', 104, 65600); + make_way('1362.6 635.0 -334.0', '103 135 0', 0, 65792); + make_way('1366.7 875.6 -274.0', '135 111 0', 0, 0); + make_way('841.8 1105.2 -242.0', '111 112 107', 0, 0); + make_way('1439.7 1113.7 -213.0', '106 108 0', 0, 0); + make_way('1871.4 990.6 -191.0', '107 109 0', 0, 0); + make_way('1851.0 655.5 -158.0', '108 110 0', 0, 0); + make_way('1542.3 802.5 -274.0', '105 104 0', 0, 0); + make_way('1074.9 805.1 -274.0', '105 112 106', 135, 0); + make_way('703.5 681.7 -242.0', '111 106 113', 0, 1024); + make_way('608.0 681.2 -82.0', '114 0 0', 0, 0); + make_way('612.4 789.1 -82.0', '115 111 0', 0, 1024); + make_way('614.1 858.3 46.0', '116 0 0', 0, 0); + make_way('618.9 1020.4 46.0', '115 117 0', 0, 0); + make_way('539.7 1025.0 62.0', '116 118 0', 0, 0); + make_way('516.6 923.8 62.0', '117 119 0', 0, 1024); + make_way('511.4 848.0 238.0', '120 0 0', 0, 0); + make_way('504.8 654.8 238.0', '119 14 0', 0, 0); + make_way('1112.4 -706.8 -2.0', '89 80 0', 0, 4096); + make_way('1124.4 -31.4 -146.0', '138 70 124', 126, 0); + make_way('1654.0 -38.6 -146.0', '137 72 131', 129, 0); + make_way('1160.0 78.5 -147.2', '125 122 0', 0, 512); + make_way('1137.3 45.9 -370.0', '124 103 127', 0, 65536); + make_way('1161.1 -144.4 -148.3', '122 127 0', 0, 66048); + make_way('1159.7 -167.3 -370.0', '126 125 128', 134, 65536); + make_way('1468.4 -211.2 -370.0', '129 103 133', 130, 65536); + make_way('1654.8 -127.0 -162.2', '123 128 134', 0, 65600); + make_way('1798.0 -355.0 -370.0', '128 133 0', 0, 65536); + make_way('1660.2 51.5 -152.0', '132 123 0', 0, 64); + make_way('1657.1 71.4 -370.0', '103 131 133', 0, 65536); + make_way('1621.6 -110.8 -370.0', '128 132 130', 0, 65536); + make_way('1344.8 -141.7 -370.0', '127 103 128', 129, 65536); + make_way('1368.7 785.3 -271.1', '105 104 0', 0, 0); + make_way('1365.6 -34.1 -146.0', '138 137 0', 0, 0); + make_way('1536.2 -35.6 -146.0', '136 123 0', 0, 0); + make_way('1197.9 -32.8 -146.0', '122 136 0', 0, 0); + make_way('1537.0 8.8 -146.0', '123 102 0', 0, 4096); +}; diff --git a/QC/waypoints/map_dm4.qc b/QC/waypoints/map_dm4.qc new file mode 100644 index 00000000..3a150d8d --- /dev/null +++ b/QC/waypoints/map_dm4.qc @@ -0,0 +1,69 @@ +/* QC Waypoint Dump - src/frikbot/map_dm4.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm4 = +{ + make_way('776.0 -808.0 -210.0', '33 34 47', 0, 2); + make_way('272.0 -952.0 46.0', '18 17 0', 0, 0); + make_way('112.0 -1136.0 -82.0', '57 16 8', 0, 0); + make_way('784.0 -176.0 46.0', '22 0 28', 0, 0); + make_way('-64.0 -232.0 -50.0', '24 27 0', 0, 0); + make_way('-64.0 512.0 -274.0', '46 59 0', 0, 0); + make_way('428.0 -966.0 -82.0', '57 9 8', 58, 0); + make_way('134.0 -820.0 -82.0', '3 57 58', 7, 0); + make_way('426.0 -790.0 -82.0', '58 57 7', 3, 0); + make_way('336.0 -732.0 -82.0', '58 54 0', 11, 0); + make_way('354.0 -471.0 -86.0', '55 0 0', 0, 0); + make_way('188.0 -408.0 -82.0', '54 11 0', 0, 0); + make_way('505.0 -318.0 -82.0', '54 15 14', 0, 0); + make_way('512.0 -97.0 -82.0', '13 15 53', 35, 0); + make_way('631.0 -386.0 -82.0', '13 14 35', 0, 4); + make_way('337.0 -1206.0 -2.0', '3 17 0', 0, 0); + make_way('334.0 -1016.0 46.0', '16 18 0', 0, 0); + make_way('337.0 -863.0 42.0', '17 19 43', 0, 4); + make_way('337.0 -737.0 46.0', '18 20 0', 0, 0); + make_way('337.0 -508.0 46.0', '19 21 23', 13, 0); + make_way('516.0 -468.0 46.0', '20 54 13', 22, 0); + make_way('610.0 -180.0 46.0', '21 4 51', 14, 0); + make_way('120.0 -478.0 46.0', '20 24 54', 0, 0); + make_way('143.0 -303.0 -34.0', '23 25 5', 0, 0); + make_way('160.0 -183.0 -50.0', '24 52 0', 0, 384); + make_way('199.0 76.0 -82.0', '52 0 0', 0, 0); + make_way('-120.0 -518.0 -50.0', '5 28 56', 0, 2); + make_way('868.0 -176.0 46.0', '48 4 0', 0, 0); + make_way('847.0 -578.0 46.0', '48 30 31', 1, 0); + make_way('1121.0 -593.0 46.0', '29 0 0', 0, 0); + make_way('983.0 -457.0 -82.0', '32 33 0', 0, 0); + make_way('993.0 -594.0 -82.0', '31 33 0', 0, 0); + make_way('772.0 -471.0 -82.0', '32 31 1', 0, 0); + make_way('368.0 -92.0 -274.0', '35 44 0', 0, 0); + make_way('375.0 -239.0 -274.0', '34 41 36', 0, 128); + make_way('-49.0 -234.0 -274.0', '35 37 42', 0, 0); + make_way('-56.0 75.0 -274.0', '36 38 46', 0, 0); + make_way(' 69.0 70.0 -274.0', '37 0 0', 0, 0); + make_way('620.0 -242.0 -274.0', '41 40 0', 0, 0); + make_way('624.0 -42.0 -274.0', '39 45 49', 43, 0); + make_way('514.0 -240.0 -274.0', '35 39 0', 0, 0); + make_way('206.0 -245.0 -274.0', '14 0 0', 0, 4096); + make_way('626.0 58.0 -274.0', '49 18 45', 0, 2); + make_way('369.0 65.0 -266.0', '34 0 0', 0, 0); + make_way('701.0 66.0 -274.0', '40 49 43', 0, 0); + make_way('-60.0 334.0 -274.0', '37 6 0', 0, 128); + make_way('752.0 -502.0 -82.0', '48 0 0', 0, 4096); + make_way('856.0 -391.0 46.0', '28 29 33', 31, 0); + make_way('553.0 66.0 -274.0', '43 45 40', 0, 0); + make_way('557.0 -45.0 46.0', '51 14 0', 0, 0); + make_way('605.0 -113.0 46.0', '22 50 0', 0, 4096); + make_way('173.0 -60.0 -82.0', '25 26 0', 0, 384); + make_way('224.0 -59.0 -82.0', '26 0 0', 0, 0); + make_way('335.0 -431.0 -82.0', '35 13 12', 10, 0); + make_way('434.0 -390.0 -82.0', '22 0 0', 0, 4096); + make_way('-183.0 -472.0 -50.0', '27 0 0', 0, 0); + make_way('314.0 -1027.0 -82.0', '58 3 7', 9, 0); + make_way('336.0 -801.0 -82.0', '10 9 8', 57, 0); + make_way('-61.0 573.0 -274.0', '6 0 0', 0, 0); +}; diff --git a/QC/waypoints/map_dm5.qc b/QC/waypoints/map_dm5.qc new file mode 100644 index 00000000..d2e92745 --- /dev/null +++ b/QC/waypoints/map_dm5.qc @@ -0,0 +1,58 @@ +/* QC Waypoint Dump - src/frikbot/map_dm5.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm5 = +{ + make_way(' 90.0 -380.0 62.0', '2 10 17', 0, 0); + make_way('-89.0 -373.0 62.0', '3 1 26', 0, 0); + make_way('-71.0 321.0 62.0', '11 5 2', 0, 0); + make_way('504.0 348.0 14.0', '0 5 0', 0, 0); + make_way('287.0 374.0 -10.0', '4 43 3', 0, 0); + make_way('296.0 -97.0 -90.0', '0 7 43', 0, 0); + make_way('657.0 -50.0 14.0', '6 41 0', 0, 0); + make_way('281.0 -315.0 -90.0', '6 41 39', 0, 65536); + make_way('225.0 -587.0 -90.0', '0 39 10', 0, 0); + make_way(' 54.0 -601.0 -90.0', '9 0 0', 0, 0); + make_way('-72.0 512.0 62.0', '3 12 0', 0, 0); + make_way('107.0 694.0 142.0', '11 46 0', 0, 0); + make_way('816.0 371.0 238.0', '16 44 25', 0, 4); + make_way('287.0 208.0 142.0', '33 0 0', 0, 32768); + make_way('259.0 939.0 142.0', '35 0 0', 0, 0); + make_way('451.0 686.0 142.0', '46 13 0', 0, 0); + make_way('144.0 -344.0 62.0', '1 0 0', 0, 0); + make_way('271.0 368.0 238.0', '44 19 14', 33, 0); + make_way('-97.0 373.0 238.0', '18 20 32', 11, 0); + make_way('-98.0 -227.0 238.0', '19 31 30', 21, 0); + make_way('-96.0 -776.0 238.0', '22 20 34', 10, 0); + make_way('363.0 -768.0 238.0', '21 42 38', 0, 0); + make_way('160.0 -224.0 238.0', '20 30 0', 0, 0); + make_way('893.0 -768.0 238.0', '29 48 25', 0, 0); + make_way('1003.0 -767.0 238.0', '24 13 0', 0, 2); + make_way('-81.0 -767.0 62.0', '2 27 0', 0, 0); + make_way('397.0 -766.0 142.0', '0 26 38', 0, 0); + make_way('338.0 -389.0 142.0', '0 8 0', 38, 0); + make_way('880.0 -256.0 238.0', '45 24 0', 0, 0); + make_way('321.0 -224.0 238.0', '20 45 28', 23, 0); + make_way('-180.0 -201.0 190.0', '2 0 0', 0, 0); + make_way('-178.0 376.0 185.0', '3 0 0', 0, 0); + make_way('288.0 448.0 142.0', '14 4 3', 47, 0); + make_way('-169.0 -825.0 188.0', '26 0 0', 0, 0); + make_way('288.0 1007.0 142.0', '15 46 0', 0, 32768); + make_way('621.0 -544.0 190.0', '37 0 38', 48, 0); + make_way('663.0 -326.0 142.0', '36 38 0', 0, 0); + make_way('499.0 -498.0 174.0', '27 28 36', 37, 0); + make_way('407.0 -392.0 -90.0', '40 9 8', 0, 0); + make_way('548.0 -309.0 -90.0', '41 39 0', 0, 0); + make_way('544.0 -53.0 -90.0', '8 7 40', 6, 0); + make_way('489.0 -769.0 238.0', '23 22 48', 0, 0); + make_way('294.0 134.0 -90.0', '6 5 0', 0, 0); + make_way('599.0 369.0 238.0', '18 13 0', 0, 0); + make_way('664.0 -226.0 238.0', '29 30 37', 0, 0); + make_way('290.0 744.0 142.0', '47 12 16', 15, 0); + make_way('288.0 619.0 142.0', '46 33 0', 0, 0); + make_way('640.0 -776.0 238.0', '24 42 36', 0, 0); +}; diff --git a/QC/waypoints/map_dm6.qc b/QC/waypoints/map_dm6.qc new file mode 100644 index 00000000..fd1fe5a3 --- /dev/null +++ b/QC/waypoints/map_dm6.qc @@ -0,0 +1,79 @@ +/* QC Waypoint Dump - src/frikbot/map_dm6.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm6 = +{ + make_way('760.0 -1080.0 278.0', '2 8 47', 0, 0); + make_way('830.0 -880.0 278.0', '1 3 0', 0, 0); + make_way('994.0 -852.0 278.0', '2 4 0', 0, 0); + make_way('1213.0 -878.0 278.0', '3 5 0', 0, 0); + make_way('1226.0 -1088.0 278.0', '4 6 0', 10, 0); + make_way('1199.0 -1302.0 278.0', '5 7 0', 0, 0); + make_way('1040.0 -1349.0 278.0', '6 8 0', 0, 0); + make_way('856.0 -1313.0 278.0', '7 1 0', 0, 0); + make_way('1033.0 -1466.0 278.0', '7 0 0', 0, 0); + make_way('1519.0 -1087.0 231.0', '11 5 0', 0, 0); + make_way('1761.0 -1087.0 190.0', '10 12 0', 0, 0); + make_way('1763.0 -908.0 190.0', '11 13 54', 0, 0); + make_way('1764.0 -706.0 190.0', '12 14 53', 0, 0); + make_way('1766.0 -418.0 190.0', '13 18 15', 23, 0); + make_way('1883.0 -420.0 190.0', '14 16 0', 0, 0); + make_way('1891.0 -157.0 190.0', '15 17 0', 0, 0); + make_way('1628.0 -158.0 190.0', '16 18 0', 0, 0); + make_way('1629.0 -278.0 190.0', '17 19 14', 23, 0); + make_way('1318.0 -319.0 190.0', '18 21 23', 0, 0); + make_way(' 87.0 -1522.0 62.0', '41 0 0', 0, 0); + make_way('1293.0 -555.0 190.0', '19 22 0', 0, 0); + make_way('1670.0 -535.0 62.0', '23 31 21', 0, 0); + make_way('1556.0 -438.0 62.0', '22 24 52', 0, 0); + make_way('1381.0 -429.0 62.0', '23 25 58', 0, 0); + make_way('1016.0 -416.0 62.0', '24 0 0', 0, 0); + make_way('852.0 -1085.0 -22.0', '27 33 65', 69, 0); + make_way('832.0 -1085.0 -258.0', '28 0 0', 0, 0); + make_way('513.0 -1091.0 -258.0', '27 68 0', 0, 2); + make_way('1380.0 -1096.0 14.0', '32 30 0', 0, 0); + make_way('1730.0 -1099.0 62.0', '29 31 0', 0, 0); + make_way('1720.0 -824.0 62.0', '30 22 0', 0, 0); + make_way('1226.0 -1087.0 -18.0', '29 68 67', 66, 0); + make_way('1020.0 -1257.0 -2.0', '69 34 26', 68, 0); + make_way('1020.0 -1665.0 62.0', '33 35 0', 0, 0); + make_way('685.0 -1662.0 62.0', '34 36 0', 0, 0); + make_way('517.0 -1660.0 62.0', '48 57 40', 35, 0); + make_way('576.0 -1088.0 131.0', '59 38 0', 0, 0); + make_way('703.0 -1090.0 81.0', '26 37 33', 65, 0); + make_way('201.0 -895.0 158.0', '63 57 59', 0, 2); + make_way('247.0 -1654.0 62.0', '36 41 57', 56, 0); + make_way(' 87.0 -1612.0 62.0', '40 42 56', 0, 0); + make_way(' 80.0 -1758.0 62.0', '56 41 43', 51, 0); + make_way(' 72.0 -2008.0 110.0', '42 44 0', 0, 0); + make_way('426.0 -2007.0 190.0', '43 45 0', 0, 0); + make_way('446.0 -1681.0 254.0', '44 62 40', 57, 0); + make_way('464.0 -1366.0 278.0', '62 47 0', 0, 0); + make_way('408.0 -1088.0 278.0', '46 1 0', 0, 0); + make_way('512.0 -1901.0 62.0', '36 49 51', 0, 0); + make_way('507.0 -2037.0 62.0', '48 50 0', 0, 0); + make_way('355.0 -2040.0 62.0', '49 51 57', 0, 0); + make_way('298.0 -1906.0 62.0', '42 50 48', 0, 0); + make_way('1613.0 -426.0 62.0', '14 18 0', 0, 4096); + make_way('1648.0 -702.0 137.0', '31 22 0', 0, 0); + make_way('1648.0 -911.0 128.0', '30 31 0', 0, 0); + make_way('211.0 -1225.0 134.0', '63 59 0', 0, 0); + make_way('151.0 -1785.0 70.0', '42 41 51', 39, 8); + make_way('323.0 -1785.0 78.0', '40 50 36', 39, 8); + make_way('1379.0 -589.0 62.0', '24 0 0', 0, 0); + make_way('305.0 -1088.0 150.0', '63 55 39', 37, 0); + make_way('896.0 -1464.0 278.0', '9 0 0', 0, 0); + make_way('232.0 -1512.0 62.0', '20 0 0', 0, 0); + make_way('456.0 -1504.0 278.0', '46 45 0', 0, 0); + make_way('202.0 -1109.0 134.0', '59 39 55', 0, 0); + make_way('1051.0 -529.0 62.0', '25 66 0', 0, 0); + make_way('921.0 -961.0 -18.0', '66 26 69', 0, 0); + make_way('1028.0 -812.0 30.0', '65 64 68', 32, 0); + make_way('1262.0 -1248.0 -18.0', '32 0 0', 0, 0); + make_way('1088.0 -1094.0 -10.0', '66 32 33', 57, 8); + make_way('951.0 -1095.0 -10.0', '65 33 26', 57, 8); +}; diff --git a/QC/weapons.qc b/QC/weapons.qc index f9878cec..8226b8be 100644 --- a/QC/weapons.qc +++ b/QC/weapons.qc @@ -1,23 +1,3 @@ -/* -*/ - -// HIPNOTIC -//JIM -void( vector pos ) placebullethole -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage_VRMelee; -void (float xHand) player_run; -void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage; -void(vector org, vector vel, float damage) SpawnBlood; -void() SuperDamageSound; - -// QUAKE VR -void(vector org, float damage) SpawnBloodSplash; -void() PainSound; - -float(float it) ItemIdToWeaponId; -float(float wid) WeaponIdToItemId; -float(float wid, float wpnFlags) PlayerHasWeapon; float() crandom = { @@ -27,6 +7,11 @@ float() crandom = // QUAKE VR void(float xHand, float xduration, float frequency, float amplitude) VRGunHaptic = { + if(!self.ishuman) + { + return; + } + haptic(xHand, 0.0, xduration, frequency, amplitude); } @@ -34,89 +19,53 @@ void(vector org) BroadcastGunshotEffect = { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_GUNSHOT); - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); + WriteVec3(MSG_BROADCAST, org); } -vector() vrProjectileVelocity = +vector(float xHand, float factor) vrProjectileVelocity = { - local vector handv; - - return VEC_ORIGIN; - - // TODO VR: (P2) this only works when facing forwards. It needs to be revisited - // the hand velocity vector is absolute and doesn't take the world into - // account. It probably needs to be multiplied with the direction vector - // of where the player is facing...? - - if(cvar("vr_enabled") == 1) + if(cvar_hget(cvarh_vr_enabled) == 1) { - // VR: add hand velocity and player velocity to the final projectile + // VR: Add hand velocity and player velocity to the final projectile // velocity, in order to carry momentum - handv_x = self.handvel_x; - handv_y = self.handvel_z * -1; - handv_z = self.handvel_y; - return (handv * 50) + (self.velocity); + return (VRGetHandVel(xHand) * (110 * factor)) + + ((self.velocity * 0.8) * pow(factor, 0.4)); } return VEC_ORIGIN; -}; - +} -void() updateAmmoCounters = +void(float xHand, float xAid) updateAmmoCounter = { - if(self.currentammo != AID_NONE) - { - self.ammocounter = getCurrentAmmo(cVR_MainHand); - } - else - { - self.ammocounter = 0; - } - - if(self.currentammo2 != AID_NONE) + if(xAid == AID_NONE) { - self.ammocounter2 = getCurrentAmmo(cVR_OffHand); + VRSetAmmoCounter(xHand, 0); } else { - self.ammocounter2 = 0; + VRSetAmmoCounter(xHand, VR_AmmoUtil_GetAmmoCountByAmmoId(self, xAid)); } } -void(float xHand, float v) setCurrentAmmo = +float(float xHand) getCurrentAmmoCount = { - local float idx; - - if(xHand == cVR_OffHand) { idx = self.currentammo2; } - else { idx = self.currentammo; } - - if(idx == AID_SHELLS) { self.ammo_shells = v; } - else if(idx == AID_NAILS) { self.ammo_nails = v; } - else if(idx == AID_ROCKETS) { self.ammo_rockets = v; } - else if(idx == AID_CELLS) { self.ammo_cells = v; } - else - { - bprint("Attempting to set ammo of invalid type '"); - bprint(ftos(idx)); - bprint("', value '"); - bprint(ftos(v)); - bprint("'\n"); - } + return VR_AmmoUtil_GetAmmoCountByAmmoId(self, VRGetCurrentAmmo(xHand)); +} - updateAmmoCounters(); +void() updateAmmoCounters = +{ + updateAmmoCounter(cVR_OffHand, VRGetCurrentAmmo(cVR_OffHand)); + updateAmmoCounter(cVR_MainHand, VRGetCurrentAmmo(cVR_MainHand)); } -float(float xHand) getCurrentAmmo = +void(float xHand, float xAid, float xValue) delAmmoAndUpdateCounter = { - local float idx; + VR_AmmoUtil_DelAmmoCountByAmmoId(self, xAid, xValue); + updateAmmoCounters(); + // updateAmmoCounter(xHand, xAid); +} - if(xHand == cVR_OffHand) { idx = self.currentammo2; } - else { idx = self.currentammo; } - return GetAmmoCountByAmmoId(self, idx); -} float() VRMeleeDmgQuadMult = { @@ -130,8 +79,8 @@ float() VRMeleeDmgQuadMult = float(float velmag) VRMeleeStrengthMult = { - local float strength; - strength = velmag - cvar("vr_melee_threshold"); + float strength; + strength = velmag - cvar_hget(cvarh_vr_melee_threshold); if(strength > 1.0) { @@ -143,22 +92,22 @@ float(float velmag) VRMeleeStrengthMult = float(float xHand, float v, float xBase) VRMeleeDmg = { - local float tmp; + float tmp; - if(cvar("vr_fakevr") == 1) + if(cvar_hget(cvarh_vr_fakevr) == 1 || !self.ishuman) { return 20; } if(xHand == cVR_OffHand) tmp = self.offhandvelmag; - else tmp = self.handvelmag; + else tmp = self.handvelmag; - return xBase + (v * VRMeleeStrengthMult(tmp)) * cvar("vr_melee_dmg_multiplier") * VRMeleeDmgQuadMult(); + return xBase + (v * VRMeleeStrengthMult(tmp)) * cvar_hget(cvarh_vr_melee_dmg_multiplier) * VRMeleeDmgQuadMult(); } float(float v) VRMeleeRange = { - local float mult; + float mult; if(self.super_damage_finished > time) { @@ -169,28 +118,33 @@ float(float v) VRMeleeRange = mult = 1.10; } - if(cvar("vr_fakevr") == 1) + if(cvar_hget(cvarh_vr_fakevr) == 1 || !self.ishuman) { mult = mult * 3.5; } - return v * cvar("vr_melee_range_multiplier") * mult; + return v * cvar_hget(cvarh_vr_melee_range_multiplier) * mult; } void(float hand, float velmag) VRMeleeHaptic = { - local float power, amplitude, xduration; + if(!self.ishuman) + { + return; + } + + float power, amplitude, xduration; power = VRMeleeStrengthMult(velmag); amplitude = power / 10.0; - if(amplitude > 1.0) { amplitude = 1.0; } + if(amplitude > 1.0) { amplitude = 1.0; } else if(amplitude < 0.45) { amplitude = 0.45; } xduration = 0.35 + power / 18.0; - if(xduration < 0.35) { xduration = 0.35; } + if(xduration < 0.35) { xduration = 0.35; } else if(xduration > 0.9) { xduration = 0.9; } - haptic(hand, 0.0, xduration, 75.0, amplitude); + VRGunHaptic(hand, xduration, 75.0, amplitude); } void (float xHand) VRMeleeHapticByHand = @@ -225,18 +179,18 @@ float PositionalDamageFactor(float positionalDamageType) float PositionalDamage(entity xTarget, vector xEndpos, vector xDirection) = { - local float supportHS; // Target supports headshots. - local float supportCD; // Target supports core distance. - local float maxh; // Max horizontal dimension. - local float diagonality; // How "diagonal" the hit was. - local float headsize; // Size of target head. - local float head_hdepth; // Depth of head center in the model (horizontal). - local float head_vdepth; // Depth of head center in the model (vertical). - local vector headpos; // Position of target head. - local vector hitpos; // Tweaked hit position. - local vector hitdiff; // Temp vector for hit differences. - - if(cvar("vr_positional_damage") == 0) + float supportHS; // Target supports headshots. + float supportCD; // Target supports core distance. + float maxh; // Max horizontal dimension. + float diagonality; // How "diagonal" the hit was. + float headsize; // Size of target head. + float head_hdepth; // Depth of head center in the model (horizontal). + float head_vdepth; // Depth of head center in the model (vertical). + vector headpos; // Position of target head. + vector hitpos; // Tweaked hit position. + vector hitdiff; // Temp vector for hit differences. + + if(cvar_hget(cvarh_vr_positional_damage) == 0) { return 0; } @@ -251,7 +205,7 @@ float PositionalDamage(entity xTarget, vector xEndpos, vector xDirection) = if(xTarget.classname == "monster_army") { headpos_z = xTarget.origin_z + 25; - headsize = 3.4; + headsize = 3.6; head_hdepth = 12; supportHS = 1; supportCD = 1; @@ -267,7 +221,7 @@ float PositionalDamage(entity xTarget, vector xEndpos, vector xDirection) = else if(xTarget.classname == "monster_enforcer") { headpos_z = xTarget.origin_z + 26; - headsize = 3.6; + headsize = 3.7; head_hdepth = 14; supportHS = 1; supportCD = 1; @@ -312,6 +266,18 @@ float PositionalDamage(entity xTarget, vector xEndpos, vector xDirection) = supportHS = 1; supportCD = 1; } + else if(xTarget.classname == "player") + { + headpos_z = xTarget.origin_z + 25; + headsize = 3.6; + head_hdepth = 12; + supportHS = 1; + supportCD = 1; + } + else + { + return 0; + } // Since `xEndpos` is from a trace, it always hits one of the AABB planes, // so to compensate we check how "diagonal" the hit was and move the hit @@ -354,7 +320,6 @@ float PositionalDamage(entity xTarget, vector xEndpos, vector xDirection) = // HIPNOTIC //MED 10/18/96 -void(float damage) spawn_touchblood; /* ================ HIPNOTIC WEAPONS @@ -362,12 +327,12 @@ HIPNOTIC WEAPONS */ void() HIP_LaserTouch = { - local vector org; - local vector spot1,spot2; - local vector oldvel; - local float r; - local float adjDmg; - local float posDmgType; + vector org; + vector spot1,spot2; + vector oldvel; + float r; + float adjDmg; + float posDmgType; self.owner = world; self.cnt = self.cnt + 1; @@ -391,21 +356,19 @@ void() HIP_LaserTouch = self.dmg = self.dmg / 2; } - spawn_touchblood (self.dmg); + spawn_touchblood(self.dmg); - makeforward (self.angles); + makeforward(self.angles); posDmgType = PositionalDamage(trace_ent, trace_endpos, v_forward); adjDmg = self.dmg * PositionalDamageFactor(posDmgType); - T_Damage (other, self, self.lastvictim, adjDmg); + T_Damage(other, self, self.lastvictim, adjDmg); } else if((self.cnt == 3) || (random()<0.15)) { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_GUNSHOT); - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); + WriteVec3(MSG_BROADCAST, org); } else { @@ -443,12 +406,13 @@ void() HIP_LaserThink = self.nextthink = time + 0.1; }; -void(vector org, vector vec, float light) HIP_LaunchLaser = +entity(vector org, vector vec, vector extraVel, float light) HIP_LaunchLaser = { - sound(self ,CHAN_WEAPON, "hipweap/laserg.wav", 1, ATTN_NORM); + sound(self, CHAN_WEAPON, "hipweap/laserg.wav", 1, ATTN_NORM); vec = normalize(vec); + entity newmis; newmis = spawn(); newmis.owner = self; newmis.classname = "hiplaser"; @@ -458,14 +422,14 @@ void(vector org, vector vec, float light) HIP_LaunchLaser = if(light) newmis.effects = EF_DIMLIGHT; - setmodel (newmis, "progs/lasrspik.mdl"); - setsize (newmis, '0 0 0', '0 0 0'); + setmodel(newmis, "progs/lasrspik.mdl"); + setsize(newmis, '0 0 0', '0 0 0'); - setorigin (newmis, org); + setorigin(newmis, org); newmis.speed = 1750; newmis.dmg = 18; - newmis.velocity = vec * newmis.speed; + newmis.velocity = vec * newmis.speed + extraVel; newmis.old_velocity = newmis.velocity; newmis.angles = vectoangles(newmis.velocity); newmis.avelocity = '0 0 400'; @@ -475,6 +439,8 @@ void(vector org, vector vec, float light) HIP_LaunchLaser = newmis.think = HIP_LaserThink; newmis.touch = HIP_LaserTouch; newmis.count = 0; + + return newmis; }; /* @@ -484,11 +450,11 @@ HIP_FireLaser */ void(float xHand, float stat) HIP_FireLaser = { - local vector org; - local vector dir; - local vector out; - local float ofs; - local float aofs; + vector org; + vector dir; + vector out; + float ofs; + float aofs; if(!VRGetFireButtonPressed(xHand)) { @@ -503,41 +469,50 @@ void(float xHand, float stat) HIP_FireLaser = SuperDamageSound(); self.effects = self.effects | EF_MUZZLEFLASH; - makevectors (VRGetWeaponFireRot(xHand)); + makevectors(VRGetWeaponFireRot(xHand)); ofs = 6; out = v_forward; out_z = 0; out = normalize(out); org = VRGetMuzzlePos(xHand) + ((-1) * v_up) + (2*out); - dir = aim (self, 1000); + dir = VRGetWeaponFireRotFwd(xHand); aofs = ofs * 0.15; + + entity newmis; + vector extraVel; + + extraVel = vrProjectileVelocity(xHand, 0.9); + if(stat == 0) { - setCurrentAmmo(xHand, self.ammo_cells = self.ammo_cells - 1); + delAmmoAndUpdateCounter(xHand, AID_CELLS, 1); + org = org + (aofs*v_right); - HIP_LaunchLaser(org, dir, 0); + newmis = HIP_LaunchLaser(org, dir, extraVel, 0); org = org - (2*aofs*v_right); - HIP_LaunchLaser(org, dir, 0); + newmis = HIP_LaunchLaser(org, dir, extraVel, 0); } else if(stat == 1) { - setCurrentAmmo(xHand, self.ammo_cells = self.ammo_cells - 1); + delAmmoAndUpdateCounter(xHand, AID_CELLS, 1); + org = org + (ofs*(v_up * 0.4)); - if(random()<0.1) + + if(random() < 0.1) { - HIP_LaunchLaser(org, dir, 1); + newmis = HIP_LaunchLaser(org, dir, extraVel, 1); newmis.dmg = 25; } else { - HIP_LaunchLaser(org, dir, 0); + newmis = HIP_LaunchLaser(org, dir, extraVel, 0); } } self.punchangle_x = -1; VRGunHaptic(xHand, 0.05, 150, 1.0); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 1); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); }; /* @@ -547,11 +522,11 @@ HIP_HammerDamage */ void(vector p1, vector p2, entity from, float damage) HIP_HammerDamage = { - local entity e1, e2; - local vector f; + entity e1, e2; + vector f; f = p2 - p1; - normalize (f); + normalize(f); f_x = 0 - f_y; f_y = f_x; f_z = 0; @@ -561,10 +536,10 @@ void(vector p1, vector p2, entity from, float damage) HIP_HammerDamage = traceline(p1, p2, FALSE, self); //JIM - if(trace_ent.takedamage && !trace_ent.wetsuit_finished ) + if(trace_ent.takedamage && !trace_ent.wetsuit_finished) { particle (trace_endpos, '0 0 100', 225, damage*4); - T_Damage (trace_ent, from, from, damage); + T_Damage(trace_ent, from, from, damage); if(self.classname == "player") { if(other.classname == "player") @@ -576,47 +551,47 @@ void(vector p1, vector p2, entity from, float damage) HIP_HammerDamage = traceline(p1 + f, p2 + f, FALSE, self); //JIM if(trace_ent != e1 && trace_ent.takedamage && - !trace_ent.wetsuit_finished ) + !trace_ent.wetsuit_finished) { particle (trace_endpos, '0 0 100', 225, damage*4); - T_Damage (trace_ent, from, from, damage); + T_Damage(trace_ent, from, from, damage); } e2 = trace_ent; traceline(p1 - f, p2 - f, FALSE, self); //JIM if(trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage && - !trace_ent.wetsuit_finished ) + !trace_ent.wetsuit_finished) { particle (trace_endpos, '0 0 100', 225, damage*4); - T_Damage (trace_ent, from, from, damage); + T_Damage(trace_ent, from, from, damage); } }; void(vector vStart, vector vEnd) LightningParticles = { - particle2(vStart, '0 0 0', 3 /* lightning preset */, 20); - particle2(vStart, '0 0 0', 4 /* smoke preset */, 1); - particle2(vStart, '0 0 0', 5 /* sparks preset */, 4); + particle2(vStart, '0 0 0', QVR_PARTICLE_PRESET_LIGHTNING, 20); + particle2(vStart, '0 0 0', QVR_PARTICLE_PRESET_SMOKE, 1); + particle2(vStart, '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 4); - particle2(vEnd, '0 0 0', 3 /* lightning preset */, 60); - particle2(vEnd, '0 0 0', 4 /* smoke preset */, 1); - particle2(vEnd, '0 0 0', 5 /* sparks preset */, 12); + particle2(vEnd, '0 0 0', QVR_PARTICLE_PRESET_LIGHTNING, 60); + particle2(vEnd, '0 0 0', QVR_PARTICLE_PRESET_SMOKE, 1); + particle2(vEnd, '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 12); } void() HIP_LightningThink = { - local vector org; - local vector dst; - local entity head; - local entity selected; - local float cur_dist; - local float head_dist; - local vector vec; - local float dot; - local float oldstate; - local float dam; + vector org; + vector dst; + entity head; + entity selected; + float cur_dist; + float head_dist; + vector vec; + float dot; + float oldstate; + float dam; if(time > self.delay) @@ -659,7 +634,7 @@ void() HIP_LightningThink = } else { - local vector end; + vector end; makevectors(self.v_angle); org = self.owner.origin; @@ -672,12 +647,8 @@ void() HIP_LightningThink = WriteByte(MSG_BROADCAST, TE_LIGHTNING2); WriteEntity(MSG_BROADCAST, self); WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); - WriteCoord(MSG_BROADCAST, trace_endpos_x); - WriteCoord(MSG_BROADCAST, trace_endpos_y); - WriteCoord(MSG_BROADCAST, trace_endpos_z); + WriteVec3(MSG_BROADCAST, org); + WriteVec3(MSG_BROADCAST, trace_endpos); LightningParticles(org, trace_endpos); @@ -701,12 +672,8 @@ void() HIP_LightningThink = WriteByte(MSG_BROADCAST, TE_LIGHTNING2); WriteEntity(MSG_BROADCAST, self); WriteByte(MSG_BROADCAST, 0); /* disambiguator */ - WriteCoord(MSG_BROADCAST, org_x); - WriteCoord(MSG_BROADCAST, org_y); - WriteCoord(MSG_BROADCAST, org_z); - WriteCoord(MSG_BROADCAST, trace_endpos_x); - WriteCoord(MSG_BROADCAST, trace_endpos_y); - WriteCoord(MSG_BROADCAST, trace_endpos_z); + WriteVec3(MSG_BROADCAST, org); + WriteVec3(MSG_BROADCAST, trace_endpos); LightningParticles(org, trace_endpos); @@ -719,9 +686,9 @@ void() HIP_LightningThink = else dam = 30; if(dot>0.3) - HIP_HammerDamage (org, trace_endpos, self, dam); + HIP_HammerDamage(org, trace_endpos, self, dam); else - HIP_HammerDamage (org, trace_endpos, self, dam*0.5); + HIP_HammerDamage(org, trace_endpos, self, dam*0.5); self = head; self.nextthink = time + 0.2; @@ -729,7 +696,7 @@ void() HIP_LightningThink = void(entity prev, entity own, float dst) HIP_SpawnMjolnirLightning = { - local entity light; + entity light; // spawn actual lightning light = spawn(); light.delay = time + 0.8; @@ -747,7 +714,7 @@ void(entity prev, entity own, float dst) HIP_SpawnMjolnirLightning = void() HIP_SpawnMjolnirBase = { - local entity light; + entity light; // spawn lightning base light = spawn(); // light.origin = self.origin - '0 0 24' + (32*v_forward); @@ -761,15 +728,15 @@ void() HIP_SpawnMjolnirBase = sound(light, CHAN_WEAPON, "hipweap/mjolhit.wav", 1, ATTN_NORM); makevectors(self.v_angle); light.movedir = v_forward; - HIP_SpawnMjolnirLightning( light, light, 350 ); - HIP_SpawnMjolnirLightning( light, light, 350 ); - HIP_SpawnMjolnirLightning( light, light, 350 ); - HIP_SpawnMjolnirLightning( light, light, 350 ); + HIP_SpawnMjolnirLightning(light, light, 350); + HIP_SpawnMjolnirLightning(light, light, 350); + HIP_SpawnMjolnirLightning(light, light, 350); + HIP_SpawnMjolnirLightning(light, light, 350); }; void(float xHand) HIP_FireMjolnirLightning = { - local float cells; + float cells; // explode if under water if(self.waterlevel > 1) @@ -777,23 +744,22 @@ void(float xHand) HIP_FireMjolnirLightning = cells = self.ammo_cells; self.ammo_cells = 0; discharged = 1; - T_RadiusDamage (self, self, 35*cells, world); + T_RadiusDamage(self, self, 35*cells, world); discharged = 0; W_SetCurrentAmmo(); return; } - setCurrentAmmo(xHand, self.ammo_cells = self.ammo_cells - 15); + delAmmoAndUpdateCounter(xHand, AID_CELLS, 15); HIP_SpawnMjolnirBase(); }; -float(vector xHandRot, vector xHandPos, vector xMuzzlePos, float xRange, float xMuzzleRange) VRDoMeleeAttackTraceline = +float(vector xHandRot, vector xHandPos, vector xMuzzlePos, + float xRange, float xMuzzleRange) VRDoMeleeAttackTraceline = { - local float range, muzzleRange; - - range = VRMeleeRange(xRange); - muzzleRange = VRMeleeRange(xMuzzleRange); + float range = VRMeleeRange(xRange); + float muzzleRange = VRMeleeRange(xRange + xMuzzleRange); makevectors(xHandRot); @@ -846,18 +812,14 @@ float(float xHand, float xRange, float xMuzzleRange) VRDoMeleeAttackTracelineFor void(float xHand) HIP_FireMjolnir = { - local vector source; - local vector org; - local float xdmg; - - xdmg = VRMeleeDmg(xHand, 1.10, 5); + float xdmg = VRMeleeDmg(xHand, 1.10, 5); - if(!VRDoMeleeAttackTracelineFor(xHand, 28, 10)) + if(!VRDoMeleeAttackTracelineFor(xHand, 22, 12)) { return; } - org = trace_endpos - v_forward*4; + vector org = trace_endpos - v_forward*4; if(trace_ent.takedamage) { @@ -943,6 +905,7 @@ void() W_Precache = // grapple precache_sound("weapons/chain1.wav"); precache_sound("pendulum/hit.wav"); + precache_sound("lavagun/snail.wav"); // lava nail gun cooldown //--ZOID // QUAKE VR @@ -959,13 +922,48 @@ W_FireAxe */ void(float xHand) W_FireAxe = { - local vector source; - local vector org; - local float xdmg; + vector org; + float xdmg; + + // HONEY + entity zombie; + float zombie_dist; + float bleed; // TODO VR: (P2) apply bleed mechanic to other attacks + bleed = FALSE; xdmg = VRMeleeDmg(xHand, 1.00, 7); - if(!VRDoMeleeAttackTracelineFor(xHand, 28, 10)) + // HONEY + // Check if we maybe should gib some zombies for fun! + if(VR_GameUtil_EnableHoneyExtensions()) + { + // Why on earth did I choose .wad? + zombie = find(world, wad, ZOMBIE_ONGROUND); + + while(zombie) + { + if(zombie.classname == "monster_zombie") + { + zombie_dist = vlen(self.origin - zombie.origin); + + if(zombie_dist <= 64) + { + if(infront(zombie)) + { + zombie.wad = ""; + SpawnBloodSplash(zombie.origin, 20); + zombie.health = 0; + Killed(zombie, self); + bleed = TRUE; + } + } + } + + zombie = find(zombie, wad, ZOMBIE_ONGROUND); + } + } + + if(!VRDoMeleeAttackTracelineFor(xHand, 22, 13)) { return; } @@ -975,8 +973,15 @@ void(float xHand) W_FireAxe = if(trace_ent.takedamage) { trace_ent.axhitme = 1; - SpawnBloodSplash (org, xdmg); - T_Damage_VRMelee (trace_ent, self, self, xdmg); + + // HONEY + self.damage_weapon = IT_AXE; + + if(T_Damage_VRMelee(trace_ent, self, self, xdmg)) + { + SpawnBloodSplash(org, xdmg); + bleed = TRUE; + } if(VRGetMeleeHitSoundPlayed(xHand) == FALSE) { @@ -985,7 +990,8 @@ void(float xHand) W_FireAxe = VRSetMeleeHitSoundPlayed(xHand, TRUE); } } - else + + if(!bleed) { // hit wall if(VRGetMeleeHitSoundPlayed(xHand) == FALSE) @@ -1009,13 +1015,12 @@ W_GunMelee */ void(float xHand) W_GunMelee = { - local vector source; - local vector org; - local float xdmg; + vector org; + float xdmg; xdmg = VRMeleeDmg(xHand, 0.75, 3); - if(!VRDoMeleeAttackTracelineFor(xHand, 26, 8)) + if(!VRDoMeleeAttackTracelineFor(xHand, 22, 12)) { return; } @@ -1060,14 +1065,11 @@ W_FistMelee */ void(float xHand) W_FistMelee = { - local vector source; - local vector org; - local float xdmg; - local float playedsound; - - xdmg = VRMeleeDmg(xHand, 0.75, 3); + vector org; + float xdmg = VRMeleeDmg(xHand, 0.75, 3); + float playedsound = FALSE; - if(!VRDoMeleeAttackTracelineFor(xHand, 26, 8)) + if(!VRDoMeleeAttackTracelineFor(xHand, 16, 8)) { return; } @@ -1114,9 +1116,9 @@ void(float xHand) W_FistMelee = vector() wall_velocity = { - local vector vel; + vector vel; - vel = normalize (self.velocity); + vel = normalize(self.velocity); vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5)); vel = vel + 2*trace_plane_normal; vel = vel * 200; @@ -1132,14 +1134,14 @@ SpawnMeatSpray */ void(vector org, vector vel) SpawnMeatSpray = { - local entity missile; + entity missile; missile = spawn(); missile.owner = self; missile.movetype = MOVETYPE_BOUNCE; missile.solid = SOLID_NOT; - makevectors (self.angles); + makevectors(self.angles); missile.velocity = vel; missile.velocity_z = missile.velocity_z + 250 + 50*random(); @@ -1150,9 +1152,9 @@ void(vector org, vector vel) SpawnMeatSpray = missile.nextthink = time + 1; missile.think = SUB_Remove; - setmodel (missile, "progs/zom_gib.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, org); + setmodel(missile, "progs/zom_gib.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, org); }; /* @@ -1162,7 +1164,7 @@ SpawnBlood */ void(vector org, vector vel, float damage) SpawnBlood = { - particle2(org, vel * 0.2, 1 /* blood preset */, damage); + particle2(org, vel * 0.2, QVR_PARTICLE_PRESET_BLOOD, damage); }; // QUAKE VR @@ -1173,7 +1175,7 @@ SpawnBloodSplash */ void(vector org, float damage) SpawnBloodSplash = { - local vector pvel; + vector pvel; pvel_x = crandom() * 240; pvel_y = crandom() * 240; @@ -1192,7 +1194,7 @@ spawn_touchblood */ void(float damage) spawn_touchblood = { - local vector vel; + vector vel; vel = wall_velocity () * 0.2; SpawnBlood (self.origin + vel * 0.01, vel, damage); @@ -1232,13 +1234,13 @@ void() ApplyMultiDamage = { if(!multi_ent) return; - T_Damage (multi_ent, self, self, multi_damage); + T_Damage(multi_ent, self, self, multi_damage); }; -void(entity hit, float damage) AddMultiDamage = +float(entity hit, float damage) AddMultiDamage = { if(!hit) - return; + return FALSE; if(hit != multi_ent) { @@ -1248,6 +1250,9 @@ void(entity hit, float damage) AddMultiDamage = } else multi_damage = multi_damage + damage; + + // HONEY + return !((hit.flags & FL_SPECIFICDAMAGE) && !(hit.items & self.damage_weapon)); }; /* @@ -1265,7 +1270,11 @@ TraceAttack */ void(float damage, vector dir) TraceAttack = { - local vector vel, org; + vector vel, org; + + // HONEY + float bleed; + bleed = FALSE; vel = normalize(dir + v_up*crandom() + v_right*crandom()); vel = vel + 2*trace_plane_normal; @@ -1275,10 +1284,14 @@ void(float damage, vector dir) TraceAttack = if(trace_ent.takedamage) { - SpawnBlood (org, vel*0.2, damage); - AddMultiDamage (trace_ent, damage); + if(AddMultiDamage(trace_ent, damage)) + { + SpawnBlood (org, vel*0.2, damage); + bleed = TRUE; + } } - else + + if(!bleed) { BroadcastGunshotEffect(org); } @@ -1295,9 +1308,9 @@ Go to the trouble of combining multiple pellets into a single damage call. */ void(float shotcount, vector dir, vector spread, vector src) FireBulletsImpl = { - local vector direction; - local float adjDmg; - local float posDmgType; + vector direction; + float adjDmg; + float posDmgType; makevectors(vectoangles(dir)); @@ -1318,7 +1331,7 @@ void(float shotcount, vector dir, vector spread, vector src) FireBulletsImpl = // HIPNOTIC if(trace_ent == world) { - placebullethole( trace_endpos ); + placebullethole(trace_endpos); } } @@ -1329,12 +1342,17 @@ void(float shotcount, vector dir, vector spread, vector src) FireBulletsImpl = void(float xHand, float shotcount, vector dir, vector spread) FireBullets = { + if(VRGet2HAiming(self)) + { + spread *= cvar_hget(cvarh_vr_2h_spread_reduction); + } + FireBulletsImpl(shotcount, dir, spread, VRGetMuzzlePos(xHand)); } void(float shotcount, vector dir, vector spread) EnemyFireBullets = { - local vector src; + vector src; src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -1349,21 +1367,24 @@ W_FireShotgun */ void(float xHand) W_FireShotgun = { - local vector dir; + vector dir; sound(self, VRGetGunChannel(xHand), "weapons/guncock.wav", 1, ATTN_NORM); self.punchangle_x = -2; - setCurrentAmmo(xHand, self.ammo_shells = self.ammo_shells - 1); + delAmmoAndUpdateCounter(xHand, AID_SHELLS, 1); dir = VRGetWeaponFireRotFwd(xHand); - FireBullets (xHand, 6, dir, '0.01 0.01 0'); + FireBullets(xHand, 6, dir, '0.01 0.01 0'); VRGunHaptic(xHand, 0.25, 70, 0.75); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 1); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); + + // HONEY + self.damage_weapon = IT_SHOTGUN; }; @@ -1374,11 +1395,11 @@ W_FireSuperShotgun */ void(float xHand) W_FireSuperShotgun = { - local vector dir; + vector dir; - if(getCurrentAmmo(xHand) == 1) + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) == 1) { - W_FireShotgun (xHand); + W_FireShotgun(xHand); return; } @@ -1386,14 +1407,17 @@ void(float xHand) W_FireSuperShotgun = self.punchangle_x = -4; - setCurrentAmmo(xHand, self.ammo_shells = self.ammo_shells - 2); + delAmmoAndUpdateCounter(xHand, AID_SHELLS, 2); dir = VRGetWeaponFireRotFwd(xHand); - FireBullets (xHand, 14, dir, '0.035 0.025 0'); + FireBullets(xHand, 14, dir, '0.035 0.025 0'); VRGunHaptic(xHand, 0.55, 75, 1.0); - particle2(VRGetMuzzlePos(xHand) - '0 2 0', '0 0 0', 6 /* gun smoke preset */, 1); - particle2(VRGetMuzzlePos(xHand) + '0 2 0', '0 0 0', 6 /* gun smoke preset */, 1); + particle2(VRGetMuzzlePos(xHand) - '0 2 0', '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); + particle2(VRGetMuzzlePos(xHand) + '0 2 0', '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); + + // HONEY + self.damage_weapon = IT_SUPER_SHOTGUN; }; @@ -1405,26 +1429,26 @@ ROCKETS ============================================================================== */ -void() s_explode1 = [0, s_explode2] {}; -void() s_explode2 = [1, s_explode3] {}; -void() s_explode3 = [2, s_explode4] {}; -void() s_explode4 = [3, s_explode5] {}; -void() s_explode5 = [4, s_explode6] {}; -void() s_explode6 = [5, SUB_Remove] {}; +void() s_explode1 = [0, s_explode2] { } +void() s_explode2 = [1, s_explode3] { } +void() s_explode3 = [2, s_explode4] { } +void() s_explode4 = [3, s_explode5] { } +void() s_explode5 = [4, s_explode6] { } +void() s_explode6 = [5, SUB_Remove] { } void() BecomeExplosion = { self.movetype = MOVETYPE_NONE; self.velocity = '0 0 0'; self.touch = SUB_Null; - setmodel (self, "progs/s_explod.spr"); + setmodel(self, "progs/s_explod.spr"); self.solid = SOLID_NOT; s_explode1(); }; void() T_MissileTouch = { - local float damg; + float damg; if(other == self.owner) return; // don't explode on owner @@ -1437,25 +1461,26 @@ void() T_MissileTouch = damg = 100 + random()*20; + // HONEY + self.owner.damage_weapon = IT_ROCKET_LAUNCHER; + if(other.health) { if(other.classname == "monster_shambler") damg = damg * 0.5; // mostly immune - T_Damage (other, self, self.owner, damg ); + T_Damage(other, self, self.owner, damg); } // don't do radius damage to the other, because all the damage // was done in the impact - T_RadiusDamage (self, self.owner, 120, other); + T_RadiusDamage(self, self.owner, 120, other); // sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); self.origin = self.origin - 8*normalize(self.velocity); WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); + WriteVec3(MSG_BROADCAST, self.origin); BecomeExplosion(); }; @@ -1467,11 +1492,11 @@ void() T_MissileTouch = W_FireRocket ================ */ -void(float xHand) W_FireRocket = +entity(float xHand) W_FireRocket = { - local entity missile; + entity missile; - setCurrentAmmo(xHand, self.ammo_rockets = self.ammo_rockets - 1); + delAmmoAndUpdateCounter(xHand, AID_ROCKETS, 1); sound(self, VRGetGunChannel(xHand), "weapons/sgun1.wav", 1, ATTN_NORM); @@ -1488,23 +1513,24 @@ void(float xHand) W_FireRocket = missile.angles = vectoangles(missile.velocity); missile.touch = T_MissileTouch; - missile.velocity = missile.velocity + vrProjectileVelocity(); + missile.velocity += vrProjectileVelocity(xHand, 0.4); // set missile duration missile.nextthink = time + 5; missile.think = SUB_Remove; - setmodel (missile, "progs/missile.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, VRGetMuzzlePos(xHand)); + setmodel(missile, "progs/missile.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, VRGetMuzzlePos(xHand)); // HIPNOTIC //MED 11/09/96 - newmis = missile; VRGunHaptic(xHand, 0.5, 75, 1.0); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 3); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 3); + + return missile; }; /* @@ -1522,11 +1548,11 @@ LightningDamage */ void(vector p1, vector p2, entity from, float damage) LightningDamage = { - local entity e1, e2; - local vector f; + entity e1, e2; + vector f; f = p2 - p1; - normalize (f); + normalize(f); f_x = 0 - f_y; f_y = f_x; f_z = 0; @@ -1534,12 +1560,18 @@ void(vector p1, vector p2, entity from, float damage) LightningDamage = e1 = e2 = world; + // HONEY + self.damage_weapon = IT_LIGHTNING; + traceline(p1, p2, FALSE, self); //JIM - if(trace_ent.takedamage && !trace_ent.wetsuit_finished ) + if(trace_ent.takedamage && !trace_ent.wetsuit_finished) { - SpawnBloodSplash (trace_endpos, damage*5); - T_Damage (trace_ent, from, from, damage); + if(T_Damage(trace_ent, from, from, damage)) + { + SpawnBloodSplash (trace_endpos, damage*5); + } + if(self.classname == "player") { if(other.classname == "player") @@ -1551,45 +1583,54 @@ void(vector p1, vector p2, entity from, float damage) LightningDamage = traceline(p1 + f, p2 + f, FALSE, self); //JIM if(trace_ent != e1 && trace_ent.takedamage && - !trace_ent.wetsuit_finished ) + !trace_ent.wetsuit_finished) { - SpawnBloodSplash (trace_endpos, damage*5); - T_Damage (trace_ent, from, from, damage); + if(T_Damage(trace_ent, from, from, damage)) + { + SpawnBloodSplash (trace_endpos, damage*5); + } } e2 = trace_ent; traceline(p1 - f, p2 - f, FALSE, self); //JIM if(trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage && - !trace_ent.wetsuit_finished ) + !trace_ent.wetsuit_finished) { - SpawnBloodSplash (trace_endpos, damage*5); - T_Damage (trace_ent, from, from, damage); + if(T_Damage(trace_ent, from, from, damage)) + { + SpawnBloodSplash (trace_endpos, damage*5); + } } }; void(float xHand) W_FireLightning = { - local vector org; - local float cells; + vector org; + float cells; if(self.ammo_cells < 1) { return; } -// explode if under water + + // explode if under water if(self.waterlevel > 1) { cells = self.ammo_cells; self.ammo_cells = 0; - // HIPNOTIC -//MED 01/05/97 added discharge flag + // HIPNOTIC + //MED 01/05/97 added discharge flag discharged = 1; - T_RadiusDamage (self, self, 35*cells, world); + T_RadiusDamage(self, self, 35*cells, world); discharged = 0; W_SetCurrentAmmo(); + + // HONEY + self.damage_weapon = IT_LIGHTNING; + return; } @@ -1600,19 +1641,19 @@ void(float xHand) W_FireLightning = } self.punchangle_x = -2; - setCurrentAmmo(xHand, self.ammo_cells = self.ammo_cells - 1); + delAmmoAndUpdateCounter(xHand, AID_CELLS, 1); org = VRGetMuzzlePos(xHand); - makeforward (VRGetHandRot(xHand)); + makeforward(VRGetHandRot(xHand)); traceline(org, org + v_forward*600, TRUE, self); - particle2(trace_endpos, '0 0 0', 3 /* lightning preset */, 60); - particle2(trace_endpos, '0 0 0', 4 /* smoke preset */, 1); - particle2(trace_endpos, '0 0 0', 5 /* sparks preset */, 12); - LightningDamage (org, trace_endpos + v_forward*4, self, 30); + particle2(trace_endpos, '0 0 0', QVR_PARTICLE_PRESET_LIGHTNING, 60); + particle2(trace_endpos, '0 0 0', QVR_PARTICLE_PRESET_SMOKE, 1); + particle2(trace_endpos, '0 0 0', QVR_PARTICLE_PRESET_SPARKS, 12); + LightningDamage(org, trace_endpos + v_forward*4, self, 30); VRGunHaptic(xHand, 0.4, 175, 1.0); - particle2(org, '0 0 0', 6 /* gun smoke preset */, 1); + particle2(org, '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); }; @@ -1621,13 +1662,11 @@ void(float xHand) W_FireLightning = void() GrenadeExplode = { - T_RadiusDamage (self, self.owner, 120, world); + T_RadiusDamage(self, self.owner, 120, world); WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); + WriteVec3(MSG_BROADCAST, self.origin); BecomeExplosion(); }; @@ -1637,9 +1676,16 @@ void() GrenadeTouch = if(other == self.owner) return; // don't explode on owner + // HONEY + self.owner.damage_weapon = IT_GRENADE_LAUNCHER; + if(other.takedamage == DAMAGE_AIM) { - GrenadeExplode(); + if(!((other.flags & FL_SPECIFICDAMAGE) && !(other.items & IT_GRENADE_LAUNCHER))) // HONEY + { + GrenadeExplode(); + } + return; } @@ -1659,10 +1705,10 @@ W_FireGrenade */ void(float xHand) W_FireGrenade = { - local entity missile; - local vector tmpAngles; + entity missile; + vector tmpAngles; - setCurrentAmmo(xHand, self.ammo_rockets = self.ammo_rockets - 1); + delAmmoAndUpdateCounter(xHand, AID_ROCKETS, 1); sound(self, VRGetGunChannel(xHand), "weapons/grenade.wav", 1, ATTN_NORM); @@ -1676,9 +1722,9 @@ void(float xHand) W_FireGrenade = // set missile speed tmpAngles = VRGetWeaponFireRot(xHand); - makevectors (tmpAngles); + makevectors(tmpAngles); - if(cvar("vr_enabled") == 1) + if(cvar_hget(cvarh_vr_enabled) == 1) { if(tmpAngles_x) { @@ -1689,7 +1735,7 @@ void(float xHand) W_FireGrenade = missile.velocity = v_forward * 600; } - missile.velocity = missile.velocity + vrProjectileVelocity(); + missile.velocity += vrProjectileVelocity(xHand, 0.6); } else { @@ -1705,33 +1751,28 @@ void(float xHand) W_FireGrenade = } missile.avelocity = '300 300 300'; - missile.angles = vectoangles(missile.velocity); - missile.touch = GrenadeTouch; -// set missile duration + // set missile duration missile.nextthink = time + 2.5; missile.think = GrenadeExplode; - setmodel (missile, "progs/grenade.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, VRGetMuzzlePos(xHand)); + setmodel(missile, "progs/grenade.mdl"); + setsize(missile, '0 0 0', '0 0 0'); + setorigin(missile, VRGetMuzzlePos(xHand)); VRGunHaptic(xHand, 0.4, 75, 1.0); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 2); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 2); }; - void() ProximityExplode = { - T_RadiusDamage (self, self.owner, 95, world); + T_RadiusDamage(self, self.owner, 95, world); WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_EXPLOSION); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); + WriteVec3(MSG_BROADCAST, self.origin); BecomeExplosion(); }; @@ -1783,7 +1824,7 @@ void() ProximityGrenadeTouch = sound(self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound self.movetype = MOVETYPE_NONE; - setsize (self, '-8 -8 -8', '8 8 8'); + setsize(self, '-8 -8 -8', '8 8 8'); self.state = 1; self.spawnmaster = other; }; @@ -1795,10 +1836,10 @@ ProximityBomb */ void() ProximityBomb = { - local entity head; - local float blowup; + entity head; + float blowup; - if((time > self.delay) || (NumProximityGrenades > 15) || (vlen(self.spawnmaster.velocity)>0) ) + if((time > self.delay) || (NumProximityGrenades > 15) || (vlen(self.spawnmaster.velocity)>0)) { ProximityGrenadeExplode(); self.think(); @@ -1837,11 +1878,11 @@ W_FireProximityGrenade */ void(float xHand) W_FireProximityGrenade = { - local entity missile; - local vector tmpAngles; + entity missile; + vector tmpAngles; NumProximityGrenades = NumProximityGrenades + 1; - setCurrentAmmo(xHand, self.ammo_rockets = self.ammo_rockets - 1); + delAmmoAndUpdateCounter(xHand, AID_ROCKETS, 1); sound(self, VRGetGunChannel(xHand), "hipweap/proxbomb.wav", 1, ATTN_NORM); @@ -1859,9 +1900,9 @@ void(float xHand) W_FireProximityGrenade = // set missile speed tmpAngles = VRGetWeaponFireRot(xHand); - makevectors (tmpAngles); + makevectors(tmpAngles); - if(cvar("vr_enabled") == 1) + if(cvar_hget(cvarh_vr_enabled) == 1) { if(tmpAngles_x) { @@ -1872,7 +1913,7 @@ void(float xHand) W_FireProximityGrenade = missile.velocity = v_forward * 600; } - missile.velocity = missile.velocity + vrProjectileVelocity(); + missile.velocity += vrProjectileVelocity(xHand, 0.4); } else { @@ -1899,20 +1940,16 @@ void(float xHand) W_FireProximityGrenade = missile.think = ProximityBomb; missile.th_die = ProximityGrenadeExplode; - setmodel (missile, "progs/proxbomb.mdl"); - setorigin (missile, VRGetMuzzlePos(xHand)); - setsize (missile, '-1 -1 -1', '1 1 1'); + setmodel(missile, "progs/proxbomb.mdl"); + setorigin(missile, VRGetMuzzlePos(xHand)); + setsize(missile, '-1 -1 -1', '1 1 1'); VRGunHaptic(xHand, 0.4, 75, 1.0); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 2); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 2); }; //============================================================================= -void() spike_touch; -void() superspike_touch; - - /* =============== launch_spike @@ -1920,8 +1957,10 @@ launch_spike Used for both the player and the ogre =============== */ -void(vector org, vector dir) launch_spike = +entity(vector org, vector dir) launch_spike = { + entity newmis; + newmis = spawn(); newmis.owner = self; newmis.movetype = MOVETYPE_FLYMISSILE; @@ -1933,46 +1972,49 @@ void(vector org, vector dir) launch_spike = newmis.classname = "spike"; newmis.think = SUB_Remove; newmis.nextthink = time + 6; - setmodel (newmis, "progs/spike.mdl"); - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - setorigin (newmis, org); + setmodel(newmis, "progs/spike.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin(newmis, org); newmis.velocity = dir * 1750; + return newmis; }; void(float xHand) W_FireSuperSpikes = { - local vector dir; + vector dir; + entity newmis; sound(self, VRGetGunChannel(xHand), "weapons/spike2.wav", 1, ATTN_NORM); VRSetAttackFinished(xHand, time + 0.2); - setCurrentAmmo(xHand, self.ammo_nails = self.ammo_nails - 2); + delAmmoAndUpdateCounter(xHand, AID_NAILS, 2); - makeforward (VRGetWeaponFireRot(xHand)); + makeforward(VRGetWeaponFireRot(xHand)); dir = v_forward; - launch_spike (VRGetMuzzlePos(xHand), dir); + newmis = launch_spike(VRGetMuzzlePos(xHand), dir); newmis.touch = superspike_touch; - setmodel (newmis, "progs/s_spike.mdl"); - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setmodel(newmis, "progs/s_spike.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); - newmis.velocity = newmis.velocity + vrProjectileVelocity(); + newmis.velocity += vrProjectileVelocity(xHand, 1.0); self.punchangle_x = -2; VRGunHaptic(xHand, 0.05, 150, 1.0); - particle2(VRGetMuzzlePos(xHand), '0 0 0', 6 /* gun smoke preset */, 1); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); }; void(float xHand, float ox) W_FireSpikes = { - local vector dir; + vector dir; + entity newmis; - makevectors (VRGetWeaponFireRot(xHand)); + makevectors(VRGetWeaponFireRot(xHand)); if(self.ammo_nails >= 2 && VRGetWeapon(xHand) == WID_SUPER_NAILGUN) { - W_FireSuperSpikes (xHand); + W_FireSuperSpikes(xHand); return; } @@ -1983,16 +2025,16 @@ void(float xHand, float ox) W_FireSpikes = sound(self, VRGetGunChannel(xHand), "weapons/rocket1i.wav", 1, ATTN_NORM); VRSetAttackFinished(xHand, time + 0.2); - setCurrentAmmo(xHand, self.ammo_nails = self.ammo_nails - 1); + delAmmoAndUpdateCounter(xHand, AID_NAILS, 1); dir = v_forward; - launch_spike (VRGetMuzzlePos(xHand) + v_right*ox, dir); + newmis = launch_spike(VRGetMuzzlePos(xHand) + v_right*ox, dir); - newmis.velocity = newmis.velocity + vrProjectileVelocity(); + newmis.velocity += vrProjectileVelocity(xHand, 1.0); self.punchangle_x = -2; VRGunHaptic(xHand, 0.05, 150, 1.0); - particle2(VRGetMuzzlePos(xHand) + v_right*ox, '0 0 0', 6 /* gun smoke preset */, 1); + particle2(VRGetMuzzlePos(xHand) + v_right*ox, '0 0 0', QVR_PARTICLE_PRESET_GUNSMOKE, 1); }; void() spike_bullethole = @@ -2020,8 +2062,12 @@ void(vector ang) makeforward_mdl = .float hit_z; void() spike_touch = { - local float posDmgType; - local float adjDmg; + float posDmgType; + float adjDmg; + + // HONEY + float bleed; + bleed = FALSE; if(other == self.owner) return; @@ -2038,16 +2084,20 @@ void() spike_touch = makeforward_mdl(self.angles); traceline(self.origin - v_forward * 8, self.origin + v_forward * 8, FALSE, self); -// hit something that bleeds + // hit something that maybe bleeds if(other.takedamage) { posDmgType = PositionalDamage(trace_ent, trace_endpos, v_forward); adjDmg = 9 * PositionalDamageFactor(posDmgType); - spawn_touchblood (adjDmg); - T_Damage (other, self, self.owner, adjDmg); + if(T_Damage(other, self, self.owner, adjDmg)) + { + spawn_touchblood (adjDmg); + bleed = TRUE; + } } - else + + if(!bleed) { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); @@ -2061,9 +2111,7 @@ void() spike_touch = WriteByte(MSG_BROADCAST, TE_SPIKE); } - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); + WriteVec3(MSG_BROADCAST, self.origin); } remove(self); @@ -2071,8 +2119,12 @@ void() spike_touch = void() superspike_touch = { - local float posDmgType; - local float adjDmg; + float posDmgType; + float adjDmg; + + // HONEY + float bleed; + bleed = FALSE; if(other == self.owner) return; @@ -2089,23 +2141,24 @@ void() superspike_touch = makeforward_mdl(self.angles); traceline(self.origin - v_forward * 8, self.origin + v_forward * 8, FALSE, self); -// hit something that bleeds + // hit something that maybe bleeds if(other.takedamage) { posDmgType = PositionalDamage(trace_ent, trace_endpos, v_forward); adjDmg = 18 * PositionalDamageFactor(posDmgType); - spawn_touchblood (adjDmg); - T_Damage (other, self, self.owner, adjDmg); + if(T_Damage(other, self, self.owner, adjDmg)) + { + spawn_touchblood (adjDmg); + } } - else + + if(!bleed) { spike_bullethole(); WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_SUPERSPIKE); - WriteCoord(MSG_BROADCAST, self.origin_x); - WriteCoord(MSG_BROADCAST, self.origin_y); - WriteCoord(MSG_BROADCAST, self.origin_z); + WriteVec3(MSG_BROADCAST, self.origin); } remove(self); @@ -2121,84 +2174,59 @@ PLAYER WEAPON USE =============================================================================== */ -void(float xWeapon, float* xCurrentAmmo, string* xModel, float* xFrame) W_SetCurrentAmmoImpl = +void(float xWeapon, float xWeaponFlags, + float* xCurrentAmmo, string* xModel, float* xFrame) W_SetCurrentAmmoImpl = { - *xCurrentAmmo = WeaponIdToAmmoId(xWeapon); - *xModel = WeaponIdToModel(xWeapon); + *xCurrentAmmo = WeaponIdToAmmoId(xWeapon, xWeaponFlags); + *xModel = WeaponIdToModel(xWeapon, xWeaponFlags); *xFrame = 0; }; -void() W_SetCurrentAmmo = +void(float xHand, float xWeapon, float xWeaponFlags, + float* xOutCurrentAmmo, string* xOutWeaponModel, float* xOutWeaponFrame) + W_SetCurrentAmmoForImpl = { - W_SetCurrentAmmoFor(cVR_MainHand); - W_SetCurrentAmmoFor(cVR_OffHand); -}; + player_run(xHand); // get out of any weapon firing states + VRSetWeaponFrame(xHand, 0); + + W_SetCurrentAmmoImpl(xWeapon, xWeaponFlags, + xOutCurrentAmmo, xOutWeaponModel, xOutWeaponFrame); +} void(float xHand) W_SetCurrentAmmoFor = { - // TODO VR: (P2) code repetition between branches if(xHand == cVR_MainHand) { - player_run(cVR_MainHand); // get out of any weapon firing states - VRSetWeaponFrame(cVR_MainHand, 0); - - W_SetCurrentAmmoImpl(self.weapon, + W_SetCurrentAmmoForImpl(xHand, self.weapon, self.weaponflags, &self.currentammo, &self.weaponmodel, &self.weaponframe); } - - if(xHand == cVR_OffHand) + else if(xHand == cVR_OffHand) { - player_run(cVR_OffHand); // get out of any weapon firing states - VRSetWeaponFrame(cVR_OffHand, 0); - - W_SetCurrentAmmoImpl(self.weapon2, + W_SetCurrentAmmoForImpl(xHand, self.weapon2, self.weaponflags2, &self.currentammo2, &self.weaponmodel2, &self.weaponframe2); } updateAmmoCounters(); }; -float() W_BestWeapon = +void() W_SetCurrentAmmo = { - local float it; - - it = self.items; - - if(self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & IT_LIGHTNING) ) - return WID_LIGHTNING; -//MED - if(self.ammo_cells >= 1 && (it & IT_LASER_CANNON) ) - return WID_LASER_CANNON; - if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) ) - return WID_SUPER_NAILGUN; - if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) ) - return WID_SUPER_SHOTGUN; - if(self.ammo_nails >= 1 && (it & IT_NAILGUN) ) - return WID_NAILGUN; - if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) ) - return WID_SHOTGUN; -//MED - if( it & IT_MJOLNIR ) - return WID_MJOLNIR; - - return WID_AXE; + W_SetCurrentAmmoFor(cVR_MainHand); + W_SetCurrentAmmoFor(cVR_OffHand); }; -float(float xHand, float xWeapon, float* xOutWeapon) W_CheckNoAmmo = +float(float xHand) W_CheckNoAmmo = { if(VRIsAmmolessWeapon(xHand)) { return TRUE; } - if(getCurrentAmmo(xHand) > 0) + if(getCurrentAmmoCount(xHand) > 0) { return TRUE; } - // *xOutWeapon = W_BestWeapon(); - // W_SetCurrentAmmo(); - // drop the weapon down return FALSE; }; @@ -2210,36 +2238,15 @@ W_Attack An attack impulse can be triggered now ============ */ -void(float xHand) player_axe1; -void(float xHand) player_axeb1; -void(float xHand) player_axec1; -void(float xHand) player_axed1; -void(float xHand) player_shot1; -void(float xHand) player_nail1; -void(float xHand) player_light1; -void(float xHand) player_rocket1; -// HIPNOTIC -//MED -void(float xHand) player_laser1; -void(float xHand) player_hammer1; -void(float xHand) player_mjolnir1; -// ROGUE -//ZOID-- -void(float xHand) player_grapple1; -void(float xHand) player_grapple3; -//--ZOID - -void(float xHand, float xWeapon, float xAttackFinished, +void(float xHand, float xWeapon, float xWeaponFlags, float xAttackFinished, float* xOutWeapon, float* xOutAttackFinished) W_AttackImpl = { - local float r; - - if(!W_CheckNoAmmo (xHand, xWeapon, xOutWeapon)) + if(!W_CheckNoAmmo(xHand)) { if(time > xAttackFinished) { - sound(self, VRGetGunChannel(xHand), "gunclick.wav", 1, ATTN_NORM); + sound(self, CHAN_AUTO, "gunclick.wav", 1, ATTN_NORM); *xOutAttackFinished = time + 0.5; } @@ -2249,59 +2256,96 @@ void(float xHand, float xWeapon, float xAttackFinished, makevectors(VRGetWeaponFireRot(xHand)); // calculate forward angle for velocity self.show_hostile = time + 1; // wake monsters up + // ZOID-- + RuneApplyBlackNoise(self); // make rune noise + //--ZOID + if(xWeapon == WID_AXE) { - if(cvar("vr_enabled") == 0 || cvar("vr_fakevr") == 1) + if(cvar_hget(cvarh_vr_enabled) == 0 || + cvar_hget(cvarh_vr_fakevr) == 1 || + !self.ishuman) { sound(self, VRGetGunChannel(xHand), "weapons/ax1.wav", 1, ATTN_NORM); - r = random(); + float r = random(); if(r < 0.25) - player_axe1 (xHand); + player_axe1(xHand); else if(r<0.5) - player_axeb1 (xHand); + player_axeb1(xHand); else if(r<0.75) - player_axec1 (xHand); + player_axec1(xHand); else - player_axed1 (xHand); - *xOutAttackFinished = time + 0.5; + player_axed1(xHand); + *xOutAttackFinished = time + RuneApplyHell(0.5, self); } } else if(xWeapon == WID_SHOTGUN) { - player_shot1 (xHand); - W_FireShotgun (xHand); - *xOutAttackFinished = time + 0.5; + player_shot1(xHand); + W_FireShotgun(xHand); + *xOutAttackFinished = time + RuneApplyHell(0.5, self); } else if(xWeapon == WID_SUPER_SHOTGUN) { - player_shot1 (xHand); - W_FireSuperShotgun (xHand); - *xOutAttackFinished = time + 0.7; - } - else if(xWeapon == WID_NAILGUN) - { - player_nail1 (xHand); + player_shot1(xHand); + W_FireSuperShotgun(xHand); + *xOutAttackFinished = time + RuneApplyHell(0.7, self); } - else if(xWeapon == WID_SUPER_NAILGUN) + else if(xWeapon == WID_NAILGUN || xWeapon == WID_SUPER_NAILGUN) { - player_nail1 (xHand); + if(xWeaponFlags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + VRSetLavaGunFired(xHand, 1); + player_lava_nail1(xHand); + } + else + { + player_nail1(xHand); + } } else if(xWeapon == WID_GRENADE_LAUNCHER) { player_rocket1(xHand); - W_FireGrenade(xHand); - *xOutAttackFinished = time + 0.6; + + if(xWeaponFlags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + W_FireMultiGrenade(xHand); + } + else + { + W_FireGrenade(xHand); + } + + *xOutAttackFinished = time + RuneApplyHell(0.6, self); } else if(xWeapon == WID_ROCKET_LAUNCHER) { player_rocket1(xHand); - W_FireRocket(xHand); - *xOutAttackFinished = time + 0.8; + + if(xWeaponFlags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + W_FireMultiRocket(xHand); + } + else + { + W_FireRocket(xHand); + } + + *xOutAttackFinished = time + RuneApplyHell(0.8, self); } else if(xWeapon == WID_LIGHTNING) { player_light1(xHand); - *xOutAttackFinished = time + 0.1; + + if(xWeaponFlags & QVR_WPNFLAG_USE_SECONDARY_AMMO) + { + *xOutAttackFinished = time + RuneApplyHell(1.0, self); + } + else + { + *xOutAttackFinished = time + 0.1; + } + sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); } // HYPNOTIC @@ -2313,7 +2357,9 @@ void(float xHand, float xWeapon, float xAttackFinished, //MED else if(xWeapon == WID_MJOLNIR) { - if(cvar("vr_enabled") == 0 || cvar("vr_fakevr") == 1) + if(cvar_hget(cvarh_vr_enabled) == 0 || + cvar_hget(cvarh_vr_fakevr) == 1 || + !self.ishuman) { if(self.ammo_cells < 30) player_hammer1(xHand); @@ -2343,13 +2389,13 @@ void(float xHand, float xWeapon, float xAttackFinished, void() W_Attack = { - W_AttackImpl(cVR_MainHand, self.weapon, self.attack_finished, + W_AttackImpl(cVR_MainHand, self.weapon, self.weaponflags, self.attack_finished, &self.weapon, &self.attack_finished); }; void() W_OffHandAttack = { - W_AttackImpl(cVR_OffHand, self.weapon2, self.offhand_attack_finished, + W_AttackImpl(cVR_OffHand, self.weapon2, self.weaponflags2, self.offhand_attack_finished, &self.weapon2, &self.offhand_attack_finished); }; @@ -2360,120 +2406,108 @@ W_ChangeWeapon ============ */ //MED 10/18/96 added hipweapons +// TODO VR: (P1) rewrite to use new item system or remove, check if bots use this void() W_ChangeWeapon = { - local float it, am, fl; - local float oldimpulse; - - it = self.items; - am = 0; + float am = 0; + float wid = WID_FIST; -//MED if(self.impulse == 1) { - fl = IT_AXE; + wid = WID_AXE; } else if(self.impulse == 2) { - fl = IT_SHOTGUN; - if(self.ammo_shells < 1) - am = 1; + wid = WID_SHOTGUN; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) < 1) { am = 1; } } else if(self.impulse == 3) { - fl = IT_SUPER_SHOTGUN; - if(self.ammo_shells < 2) - am = 1; + wid = WID_SUPER_SHOTGUN; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) < 2) { am = 1; } } else if(self.impulse == 4) { - fl = IT_NAILGUN; - if(self.ammo_nails < 1) - am = 1; + wid = WID_NAILGUN; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_NAILS) < 1) { am = 1; } } -//MED else if(self.impulse == 5) { - fl = IT_SUPER_NAILGUN; - if(self.ammo_nails < 2) - am = 1; - + wid = WID_SUPER_NAILGUN; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_NAILS) < 2) { am = 1; } } -//MED else if(self.impulse == 6) { - if(self.weapon == WID_GRENADE_LAUNCHER) - { - fl = IT_PROXIMITY_GUN; - } - else - { - fl = IT_GRENADE_LAUNCHER; - } - if(self.ammo_rockets < 1) - am = 1; + if(self.weapon == WID_GRENADE_LAUNCHER) + { + wid = WID_PROXIMITY_GUN; + } + else + { + wid = WID_GRENADE_LAUNCHER; + } + + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) < 1) { am = 1; } } else if(self.impulse == 7) { - fl = IT_ROCKET_LAUNCHER; - if(self.ammo_rockets < 1) - am = 1; + wid = WID_ROCKET_LAUNCHER; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) < 1) { am = 1; } } -//MED else if(self.impulse == 8) { - fl = IT_LIGHTNING; - if(self.ammo_cells < 1) - am = 1; + wid = WID_LIGHTNING; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_CELLS) < 1) { am = 1; } } else if(self.impulse == 225) { - fl = IT_LASER_CANNON; - if(self.ammo_cells < 1) - am = 1; + wid = WID_LASER_CANNON; + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_CELLS) < 1) { am = 1; } } else if(self.impulse == 226) { - fl = IT_MJOLNIR; + wid = WID_MJOLNIR; } -//MED - oldimpulse = self.impulse; self.impulse = 0; - if(!(self.items & fl)) + if(!VR_ItemUtil_EntHasItem(self, WeaponIdToItemId(wid))) { -//MED - if(fl == IT_GRENADE_LAUNCHER) + if(wid == WID_GRENADE_LAUNCHER) { - fl = IT_PROXIMITY_GUN; - if(!(self.items & fl)) + wid = WID_PROXIMITY_GUN; + + if(!VR_ItemUtil_EntHasItem(self, WeaponIdToItemId(wid))) { - sprint (self, "no weapon.\n"); + sprint(self, "no weapon.\n"); return; } - if(self.ammo_rockets < 1) + + if(VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) < 1) + { am = 1; + } else + { am = 0; + } } else { - sprint (self, "no weapon.\n"); + sprint(self, "no weapon.\n"); return; } } if(am) - { // don't have the ammo - sprint (self, "not enough ammo.\n"); + { + // don't have the ammo + sprint(self, "not enough ammo.\n"); return; } -// -// set weapon, set ammo -// - self.weapon = ItemIdToWeaponId(fl); + // set weapon, set ammo + self.weapon = wid; W_SetCurrentAmmo(); }; @@ -2490,50 +2524,54 @@ void() CheatCommand = self.ammo_rockets = 100; self.ammo_nails = 200; self.ammo_shells = 100; - self.items = self.items | - IT_AXE | - IT_SHOTGUN | - IT_SUPER_SHOTGUN | - IT_NAILGUN | - IT_SUPER_NAILGUN | - IT_GRENADE_LAUNCHER | - IT_ROCKET_LAUNCHER | - IT_KEY1 | IT_KEY2; - self.ammo_cells = 200; - self.items = self.items | IT_LIGHTNING; -//MED - self.items = self.items | IT_LASER_CANNON; - self.items = self.items | IT_MJOLNIR; - self.items = self.items | IT_PROXIMITY_GUN; + // ROGUE + self.ammo_lava_nails = 200; + self.ammo_multi_rockets = 100; + self.ammo_plasma = 100; + + VR_WeaponUtil_EntAddWeapon(self, WID_GRAPPLE); + VR_WeaponUtil_EntAddWeapon(self, WID_AXE); + VR_WeaponUtil_EntAddWeapon(self, WID_SHOTGUN); + VR_WeaponUtil_EntAddWeapon(self, WID_SUPER_SHOTGUN); + VR_WeaponUtil_EntAddWeapon(self, WID_NAILGUN); + VR_WeaponUtil_EntAddWeapon(self, WID_SUPER_NAILGUN); + VR_WeaponUtil_EntAddWeapon(self, WID_GRENADE_LAUNCHER); + VR_WeaponUtil_EntAddWeapon(self, WID_ROCKET_LAUNCHER); + VR_WeaponUtil_EntAddWeapon(self, WID_LIGHTNING); + VR_WeaponUtil_EntAddWeapon(self, WID_LASER_CANNON); + VR_WeaponUtil_EntAddWeapon(self, WID_MJOLNIR); + VR_WeaponUtil_EntAddWeapon(self, WID_PROXIMITY_GUN); + + VR_ItemUtil_EntAddItem(self, IID_KEY1); + VR_ItemUtil_EntAddItem(self, IID_KEY2); - // self.weapon = WID_ROCKET_LAUNCHER; self.impulse = 0; W_SetCurrentAmmo(); }; -float(entity xPlayer, float xDir, float xWeapon) GetCycledWeapon +float(entity xPlayer, float xDir, float xWeapon, + float xWeaponFlags, float* xOutWeaponFlags) GetCycledWeapon { - local float minWeapon, maxWeapon; - local float skipEmptyWeapons; - local float originalWeapon; - // Inclusive boundaries of cyclable weapon ids. - minWeapon = WID_GRAPPLE; - maxWeapon = WID_LASER_CANNON; + float minWeapon = WID_GRAPPLE; + float maxWeapon = WID_LASER_CANNON; + + // Just for safety. + float maxIterations = maxWeapon + 1; // TODO VR: (P1) set this via cvar depending on weapon mode? - skipEmptyWeapons = FALSE; + float skipEmptyWeapons = FALSE; // Used to avoid infinite loops. - originalWeapon = xWeapon; - if(originalWeapon > maxWeapon) { originalWeapon = minWeapon; } - else if(originalWeapon < minWeapon) { originalWeapon = maxWeapon; } + float originalWeapon = xWeapon; // Find the next suitable weapon. - while(TRUE) + float resultWeapon = originalWeapon; + for(float iterations = 0; iterations < maxIterations; ++iterations) { + xWeapon = xWeapon + xDir; if(xWeapon > maxWeapon) { xWeapon = minWeapon; } @@ -2546,47 +2584,52 @@ float(entity xPlayer, float xDir, float xWeapon) GetCycledWeapon } // Do not select unavailable weapons. - if(!PlayerHasWeapon(xWeapon, xPlayer.items)) + if(!VR_WeaponUtil_EntHasWeapon(xPlayer, xWeapon)) { continue; } // Skip weapons without ammo if desired. - if(skipEmptyWeapons && !PlayerHasAmmoForWeapon(xPlayer, xWeapon)) + if(skipEmptyWeapons && + !PlayerHasAmmoForWeapon(xPlayer, xWeapon, 0 /* weaponflags */)) { continue; } // At this point, we have a suitable weapon. + resultWeapon = xWeapon; break; } - return xWeapon; + *xOutWeaponFlags = 0; + return resultWeapon; } float() getWeaponCycleMode = { - if(cvar("vr_fakevr") == 1) + if(cvar_hget(cvarh_vr_fakevr) == 1 || !self.ishuman) { return QVR_WEAPONCYCLEMODE_ALLOWED; } - return cvar("vr_weapon_cycle_mode"); + return cvar_hget(cvarh_vr_weapon_cycle_mode); } -void(float xWeapon, float* xOutWeapon, float* xOutPrevWeapon, float xDir) CycleWeaponCommandImpl = +void(float xHand, + float xWeapon, float* xOutWeapon, + float xWeaponFlags, float* xOutWeaponFlags, + float xDir) CycleWeaponCommandImpl = { - local float newWeapon; + float newWeapon; self.impulse = 0; - newWeapon = GetCycledWeapon(self, xDir, xWeapon); + newWeapon = GetCycledWeapon(self, xDir, xWeapon, xWeaponFlags, xOutWeaponFlags); if(newWeapon != xWeapon) { *xOutWeapon = newWeapon; - *xOutPrevWeapon = newWeapon; - W_SetCurrentAmmo(); + W_SetCurrentAmmoFor(xHand); } }; @@ -2597,9 +2640,14 @@ CycleWeaponCommand Go to the next weapon with ammo ============ */ -void(float xWeapon, float* xOutWeapon, float* xOutPrevWeapon) CycleWeaponCommand = +void(float xHand, + float xWeapon, float* xOutWeapon, + float xWeaponFlags, float *xOutWeaponFlags) CycleWeaponCommand = { - CycleWeaponCommandImpl(xWeapon, xOutWeapon, xOutPrevWeapon, 1); + CycleWeaponCommandImpl(xHand, + xWeapon, xOutWeapon, + xWeaponFlags, xOutWeaponFlags, + 1); }; /* @@ -2609,9 +2657,14 @@ CycleWeaponReverseCommand Go to the prev weapon with ammo ============ */ -void(float xWeapon, float* xOutWeapon, float* xOutPrevWeapon) CycleWeaponReverseCommand = +void(float xHand, + float xWeapon, float* xOutWeapon, + float xWeaponFlags, float *xOutWeaponFlags) CycleWeaponReverseCommand = { - CycleWeaponCommandImpl(xWeapon, xOutWeapon, xOutPrevWeapon, -1); + CycleWeaponCommandImpl(xHand, + xWeapon, xOutWeapon, + xWeaponFlags, xOutWeaponFlags, + -1); }; /* @@ -2632,10 +2685,20 @@ void() QuadCheat = { if(deathmatch) return; + self.super_time = 1; self.super_damage_finished = time + 30; - self.items = self.items | IT_QUAD; - dprint ("quad cheat\n"); + VR_ItemUtil_EntAddItem(self, IID_QUAD); +}; + +void() InvisibilityCheat = +{ + if(deathmatch) + return; + + self.invisible_time = 1; + self.invisible_finished = time + 30; + VR_ItemUtil_EntAddItem(self, IID_INVISIBILITY); }; // HYPNOTIC @@ -2644,10 +2707,11 @@ void() WetsuitCheat = { if(deathmatch || coop) return; - self.hipnotic_items = self.hipnotic_items | HIP_IT_WETSUIT; + VR_ItemUtil_EntAddItem(self, IID_WETSUIT); + self.wetsuit_time = 1; self.wetsuit_finished = time + 30; - bprint( "wetsuit cheat\n" ); + bprint("wetsuit cheat\n"); }; //MED @@ -2655,16 +2719,16 @@ void() EmpathyShieldsCheat = { if(deathmatch || coop) return; - self.hipnotic_items = self.hipnotic_items | HIP_IT_EMPATHY_SHIELDS; + VR_ItemUtil_EntAddItem(self, IID_EMPATHY_SHIELDS); self.empathy_time = 1; self.empathy_finished = time + 30; - bprint( "empathy shields cheat\n" ); + bprint("empathy shields cheat\n"); }; void() DumpEntities = { - local entity head; - local float i; + entity head; + float i; i = 1; head = nextent(world); @@ -2681,8 +2745,8 @@ void() DumpEntities = void() DumpLiveEntities = { - local entity head; - local float i; + entity head; + float i; i = 1; head = nextent(world); @@ -2705,7 +2769,7 @@ void() DumpLiveEntities = void() Genocide = { - local entity head; + entity head; if(deathmatch || coop) return; @@ -2730,7 +2794,7 @@ void () ToggleDump = }; void () DumpCoordinates = { - local entity pl; + entity pl; pl = checkclient(); if(pl) { @@ -2759,12 +2823,31 @@ void() CheatSpawnAllWeaponDrops = CreateWeaponDrop(self, WID_LASER_CANNON, self.origin); } +void(float wid) CheatSpawnWeaponDrop = +{ + CreateWeaponDrop(self, wid, self.origin); +} + /* ============ ImpulseCommands ============ */ +void(float xHand) ToggleSecondaryAmmo = +{ + if(!WeaponSupportsSecondaryAmmoFlag(VRGetWeapon(xHand))) + { + return; + } + + VRGunHaptic(VRGetOtherHand(xHand), 0.3, 75, 1.0); + sound(self, VRGetGunChannel(xHand), "buttons/switch02.wav", 0.5, ATTN_NORM); + + VRSetWeaponFlags(xHand, VRGetWeaponFlags(xHand) ^ QVR_WPNFLAG_USE_SECONDARY_AMMO); + W_SetCurrentAmmoFor(xHand); +} + void() ImpulseCommands = { if(self.impulse >= 1 && self.impulse <= 8) @@ -2775,6 +2858,16 @@ void() ImpulseCommands = } } + if(self.impulse == 42) + { + ToggleSecondaryAmmo(cVR_OffHand); + } + + if(self.impulse == 43) + { + ToggleSecondaryAmmo(cVR_MainHand); + } + if(self.impulse >= 225 && self.impulse <= 226) { if(getWeaponCycleMode() == QVR_WEAPONCYCLEMODE_ALLOWED) @@ -2798,13 +2891,21 @@ void() ImpulseCommands = CheatSpawnAllWeaponDrops(); } + if(self.impulse == 17) + { + CheatSpawnWeaponDrop(WID_GRAPPLE); + } + + if(self.impulse == 10 && time >= self.attack_finished) { if(getWeaponCycleMode() == QVR_WEAPONCYCLEMODE_ALLOWED) { - CycleWeaponCommand (self.weapon, &self.weapon, &self.prevweapon); + CycleWeaponCommand(cVR_MainHand, + self.weapon, &self.weapon, + self.weaponflags, &self.weaponflags); } } @@ -2812,7 +2913,9 @@ void() ImpulseCommands = { if(getWeaponCycleMode() == QVR_WEAPONCYCLEMODE_ALLOWED) { - CycleWeaponCommand (self.weapon2, &self.weapon2, &self.prevweapon2); + CycleWeaponCommand(cVR_OffHand, + self.weapon2, &self.weapon2, + self.weaponflags2, &self.weaponflags2); } } @@ -2820,7 +2923,9 @@ void() ImpulseCommands = { if(getWeaponCycleMode() == QVR_WEAPONCYCLEMODE_ALLOWED) { - CycleWeaponReverseCommand (self.weapon, &self.weapon, &self.prevweapon); + CycleWeaponReverseCommand(cVR_MainHand, + self.weapon, &self.weapon, + self.weaponflags, &self.weaponflags); } } @@ -2828,24 +2933,47 @@ void() ImpulseCommands = { if(getWeaponCycleMode() == QVR_WEAPONCYCLEMODE_ALLOWED) { - CycleWeaponReverseCommand (self.weapon2, &self.weapon2, &self.prevweapon2); + CycleWeaponReverseCommand(cVR_OffHand, + self.weapon2, &self.weapon2, + self.weaponflags2, &self.weaponflags2); } } + // TODO VR: (P2) rogue teamplay impulses + /* + // ROGUE + //ZOID-- + //teamplay stuff + else if(self.impulse == 20) + TossBackpack(); + else if(self.impulse == 21) + TossWeapon(); + else if(self.impulse == 22) + { + if(deathmatch && teamplay >= TEAM_CTF) + W_ChangeWeapon(); + } + else if(self.impulse == 23) + TeamFlagStatusReport(); + //--ZOID + */ + //JIM - if( self.impulse == 200 ) + if(self.impulse == 200) WetsuitCheat(); //MED - if( self.impulse == 201 ) + if(self.impulse == 201) EmpathyShieldsCheat(); - if( self.impulse == 205 ) + if(self.impulse == 205) Genocide(); - if( self.impulse == 206 ) + if(self.impulse == 206) ToggleDump(); - if( self.impulse == 202 ) + if(self.impulse == 202) DumpEntities(); - if( self.impulse == 203 ) + if(self.impulse == 203) DumpLiveEntities(); + if(self.impulse == 254) + InvisibilityCheat(); if(self.impulse == 255) QuadCheat(); if(dump_coord == 1) @@ -2862,18 +2990,17 @@ void(vector xOrigin, float xHand) PlayerLightningGunEffect = WriteByte(MSG_BROADCAST, TE_LIGHTNING2); WriteEntity(MSG_BROADCAST, self); WriteByte(MSG_BROADCAST, xHand); /* disambiguator */ - WriteCoord(MSG_BROADCAST, xOrigin_x); - WriteCoord(MSG_BROADCAST, xOrigin_y); - WriteCoord(MSG_BROADCAST, xOrigin_z); - WriteCoord(MSG_BROADCAST, trace_endpos_x); - WriteCoord(MSG_BROADCAST, trace_endpos_y); - WriteCoord(MSG_BROADCAST, trace_endpos_z); + WriteVec3(MSG_BROADCAST, xOrigin); + WriteVec3(MSG_BROADCAST, trace_endpos); } void(float xHand, float xButton) FrameDrawLightningTrail = { // Lightning effect (per-frame) - if(xButton && VRGetWeapon(xHand) == WID_LIGHTNING && self.ammo_cells > 0) + if(xButton && + VRGetWeapon(xHand) == WID_LIGHTNING && + (!(VRGetWeaponFlags(xHand) & QVR_WPNFLAG_USE_SECONDARY_AMMO)) && + self.ammo_cells > 0) { PlayerLightningGunEffect(VRGetMuzzlePos(xHand), xHand); } @@ -2883,7 +3010,7 @@ void(float xHand) W_WeaponFrameImpl = { FrameDrawLightningTrail(xHand, VRGetFireButtonPressed(xHand)); - if(time < readytime) + if(!deathmatch && time < readytime) { // Do not do anything if the player is not "ready" yet, after spawning. return; @@ -2894,8 +3021,20 @@ void(float xHand) W_WeaponFrameImpl = return; } + if(VRGetLavaGunFired(xHand)) + { + if(!VRGetFireButtonPressed(xHand) && + (VRGetWeapon(xHand) == WID_NAILGUN || VRGetWeapon(xHand) == WID_SUPER_NAILGUN)) + { + sound(self, CHAN_AUTO, "lavagun/snail.wav", 1, ATTN_NORM); + particle2(VRGetMuzzlePos(xHand), '0 0 0', QVR_PARTICLE_PRESET_SMOKE, 6); + VRSetLavaGunFired(xHand, 0); + } + } + // check for attack - if(VRGetFireButtonPressed(xHand) && !VRGetForceGrabbing(xHand)) + if(VRGetFireButtonPressed(xHand) && + !VR_ForceGrabUtil_IsEntForceGrabbing(self, xHand)) { // TODO VR: (P2) what about when we don't have any weapon equipped? Or // when we have axe equipped? @@ -2912,6 +3051,8 @@ void(float xHand) W_WeaponFrameImpl = } } +// --- + float(float xHolster) getHolsterWeapon = { if(xHolster == QVR_HS_LEFT_SHOULDER_HOLSTER) return self.holsterweapon0; @@ -2943,6 +3084,8 @@ void(float xHolster, float v) setHolsterWeapon = bprint("\n"); } +// --- + string(float xHolster) getHolsterWeaponModel = { if(xHolster == QVR_HS_LEFT_SHOULDER_HOLSTER) return self.holsterweaponmodel0; @@ -2974,6 +3117,39 @@ void(float xHolster, string v) setHolsterWeaponModel = bprint("\n"); } +// --- + +float(float xHolster) getHolsterWeaponFlags = +{ + if(xHolster == QVR_HS_LEFT_SHOULDER_HOLSTER) return self.holsterweaponflags0; + if(xHolster == QVR_HS_RIGHT_SHOULDER_HOLSTER) return self.holsterweaponflags1; + if(xHolster == QVR_HS_LEFT_HIP_HOLSTER) return self.holsterweaponflags2; + if(xHolster == QVR_HS_RIGHT_HIP_HOLSTER) return self.holsterweaponflags3; + if(xHolster == QVR_HS_LEFT_UPPER_HOLSTER) return self.holsterweaponflags4; + if(xHolster == QVR_HS_RIGHT_UPPER_HOLSTER) return self.holsterweaponflags5; + + bprint("`getHolsterWeaponFlags`: invalid holster ID: "); + bprint(ftos(xHolster)); + bprint("\n"); + + // Bogus, should never happen. + return self.holsterweaponflags0; +} + +void(float xHolster, float v) setHolsterWeaponFlags = +{ + if(xHolster == QVR_HS_LEFT_SHOULDER_HOLSTER) { self.holsterweaponflags0 = v; return; } + if(xHolster == QVR_HS_RIGHT_SHOULDER_HOLSTER) { self.holsterweaponflags1 = v; return; } + if(xHolster == QVR_HS_LEFT_HIP_HOLSTER) { self.holsterweaponflags2 = v; return; } + if(xHolster == QVR_HS_RIGHT_HIP_HOLSTER) { self.holsterweaponflags3 = v; return; } + if(xHolster == QVR_HS_LEFT_UPPER_HOLSTER) { self.holsterweaponflags4 = v; return; } + if(xHolster == QVR_HS_RIGHT_UPPER_HOLSTER) { self.holsterweaponflags5 = v; return; } + + bprint("`setHolsterWeaponFlags`: invalid holster ID: "); + bprint(ftos(xHolster)); + bprint("\n"); +} + float(float xHotspot) isHolsterHotspot = { return xHotspot == QVR_HS_LEFT_SHOULDER_HOLSTER || @@ -2986,7 +3162,7 @@ float(float xHotspot) isHolsterHotspot = void(float xOffset, float xAngle, float* xOutAngle) wpnthrow_impl_stabilize = { - local float angle; + float angle; angle = xAngle - xOffset; // Bring angle in range [-360, 0] @@ -3039,9 +3215,9 @@ void(float xOffset, float xAngle, float* xOutAngle) wpnthrow_impl_stabilize = else { // TODO VR: (P1) still triggers sometimes - // bprint("`wpnthrow_impl_stabilize`: Uncovered angle case: '"); - // bprint(ftos(angle)); - // bprint("'\n"); + bprint("`wpnthrow_impl_stabilize`: Uncovered angle case: '"); + bprint(ftos(angle)); + bprint("'\n"); } if(self.throwstabilize > 0) @@ -3055,8 +3231,23 @@ void(float xOffset, float xAngle, float* xOutAngle) wpnthrow_impl_stabilize = } } -void() wpnthrow_think = +void() forcegrabbable_think_impl = { + if(self.throwhit == QVR_THROWHIT_FORCEGRAB && + time > GetThrownWeaponForcegrabTime(self) + 0.4) + { + // After a long linear forcegrab, restore the movement type to "toss". + + self.throwhit = QVR_THROWHIT_NEVER_HIT; + self.movetype = MOVETYPE_TOSS; + } + + if(self.throwhit == QVR_THROWHIT_FORCEGRAB_PARABOLA) + { + vector handDiff = VRGetEntHandPos(self.enemy, self.thinkArg) - self.origin; + self.velocity += normalize(handDiff); + } + if(self.waterlevel == 1) { if(fabs(self.velocity_x) > 10) @@ -3088,17 +3279,21 @@ void() wpnthrow_think = self.flags = self.flags & ~FL_INWATER; } - if(cvar("vr_weapondrop_particles") && (self.flags & (FL_ONGROUND | FL_INWATER))) + if(cvar_hget(cvarh_vr_weapondrop_particles) && (self.flags & (FL_ONGROUND | FL_INWATER))) { - if(random() < 0.2) + if(random() < 0.2 && self.model != string_null) { - particle2(self.origin, '0 0 0', 8 /* gunpickup preset */, 1); + particle2(realorigin(self), '0 0 0', QVR_PARTICLE_PRESET_GUNPICKUP, 1); } } if(self.throwhit == QVR_THROWHIT_HIT) { - if(self.throwstabilizedim == 0) + if(self.throwstabilizedim == -1) + { + // Intentionally empty. + } + else if(self.throwstabilizedim == 0) { wpnthrow_impl_stabilize(90, self.angles_x, &self.angles_x); } @@ -3111,47 +3306,62 @@ void() wpnthrow_think = wpnthrow_impl_stabilize(0, self.angles_z, &self.angles_z); } } +} +void() forcegrabbable_think = +{ + forcegrabbable_think_impl(); self.nextthink = time + 0.02; } -void() wpnthrow_touch = +void() wpnthrow_think = { - local float posDmgType; - local float adjDmg; - local float finalDmg; - local vector dir; + if(deathmatch && time > GetThrownWeaponTimeout(self)) + { + SUB_Remove(); + return; + } - if(other == self.owner) + forcegrabbable_think_impl(); + self.nextthink = time + 0.02; +} + +void() forcegrabbable_touch = +{ + if(self.owner != world && other == self.owner) return; if(other.solid == SOLID_TRIGGER) return; // trigger field, do nothing - if(pointcontents(self.origin) == CONTENT_SKY) - return; + // if(pointcontents(self.origin) == CONTENT_SKY) + // return; if(self.throwhit == QVR_THROWHIT_NEVER_HIT) { - finalDmg = ((vlen(self.velocity) / 700) * GetThrownWeaponBaseDamage(self)) * - cvar("vr_weapon_throw_damage_mult"); + float finalDmg = ((vlen(self.velocity) / 700) * GetThrownWeaponBaseDamage(self)) * + cvar_hget(cvarh_vr_weapon_throw_damage_mult); // hit something that bleeds if(GetThrownWeaponDealDamage(self) && other.takedamage) { - sound(self, CHAN_OTHER, "fisthit.wav", 1, ATTN_NORM); + sound(self, CHAN_AUTO, "fisthit.wav", 1, ATTN_NORM); - posDmgType = PositionalDamage(trace_ent, trace_endpos, v_forward); - adjDmg = finalDmg * PositionalDamageFactor(posDmgType); + float posDmgType = PositionalDamage(trace_ent, trace_endpos, v_forward); + float adjDmg = finalDmg * PositionalDamageFactor(posDmgType); - spawn_touchblood (adjDmg); - T_Damage (other, self, self.owner, adjDmg); + spawn_touchblood(adjDmg); + T_Damage(other, self, self.owner, adjDmg); } // hit wall else { - sound(self, CHAN_OTHER, "player/axhit2.wav", 1, ATTN_NORM); - particle2(self.origin, '0 0 0', 0 /* bullet puff preset */, 24); + if(GetThrownWeaponMetalNoiseOnTouch(self)) + { + sound(self, CHAN_AUTO, "player/axhit2.wav", 0.65, ATTN_NORM); + } + + particle2(self.origin, '0 0 0', QVR_PARTICLE_PRESET_BULLETPUFF, 24); } @@ -3163,18 +3373,27 @@ void() wpnthrow_touch = self.solid = SOLID_NOT_BUT_TOUCHABLE; self.throwhit = QVR_THROWHIT_HIT; } - else if(self.throwhit == QVR_THROWHIT_FORCEGRAB) + else if(self.throwhit == QVR_THROWHIT_FORCEGRAB && + time > GetThrownWeaponForcegrabTime(self) + 0.1) { // After a linear forcegrab, restore the movement type to "toss". self.throwhit = QVR_THROWHIT_HIT; self.movetype = MOVETYPE_TOSS; } + else if(self.throwhit == QVR_THROWHIT_FORCEGRAB_PARABOLA || + time > GetThrownWeaponForcegrabTime(self) + 1.0) + { + // After a parabola forcegrab, restore the movement type to "toss". + + self.throwhit = QVR_THROWHIT_HIT; + self.movetype = MOVETYPE_TOSS; + } // ghetto collision detection/resolution if(!(self.flags & FL_ONGROUND) && vlen(self.velocity) > 2.0) { - dir = normalize(self.velocity); + vector dir = normalize(self.velocity); dir_z = 0; traceline(self.origin - dir * 2, self.origin + dir * 8, FALSE, self); @@ -3195,14 +3414,21 @@ void() wpnthrow_touch = self.avelocity = '0 0 0'; } } -}; +} + +void() wpnthrow_touch = +{ + forcegrabbable_touch(); +} -void(float xHand, entity ent, entity entPlayer, float* xOutEntWeapon) wpnthrow_handtouch_impl = +void(float xHand, entity ent, entity entPlayer, + float* xOutEntWeapon, float* xOutEntWeaponFlags) wpnthrow_handtouch_impl = { - sound(ent, CHAN_OTHER, "weapons/pkup.wav", 1, ATTN_NORM); - haptic(xHand, 0.0, 0.3, 75, 1.0); + sound(ent, CHAN_AUTO, "weapons/pkup.wav", 1, ATTN_NORM); + VRGunHaptic(xHand, 0.3, 75, 1.0); *xOutEntWeapon = ent.weapon; + *xOutEntWeaponFlags = ent.weaponflags; remove(ent); self = entPlayer; @@ -3213,38 +3439,73 @@ void(entity ent, entity entPlayer, float xHand) wpnthrow_forcegrab_instant_ent = { if(xHand == cVR_OffHand && VRIsHandEmpty(entPlayer, cVR_OffHand)) { - wpnthrow_handtouch_impl(cVR_OffHand, ent, entPlayer, &entPlayer.weapon2); + wpnthrow_handtouch_impl(cVR_OffHand, ent, entPlayer, + &entPlayer.weapon2, &entPlayer.weaponflags2); } else if(xHand == cVR_MainHand && VRIsHandEmpty(entPlayer, cVR_MainHand)) { - wpnthrow_handtouch_impl(cVR_MainHand, ent, entPlayer, &entPlayer.weapon); + wpnthrow_handtouch_impl(cVR_MainHand, ent, entPlayer, + &entPlayer.weapon, &entPlayer.weaponflags); } } -void(entity ent) wpnthrow_handtouch_ent = +float(entity ent, float xHand) wpnthrow_handtouch_ent_hand = { - if(VRIsHandtouchHandFake(ent)) + entity entPlayer = ent.handtouch_ent; + + if(!VRIsHandEmpty(entPlayer, xHand)) { - // Happens with VR Body Interactions enabled. + return FALSE; + } - // TODO VR: (P2) cvar to choose what happens? - return; + float pForceGrabbing = VR_ForceGrabUtil_IsEntForceGrabbing(entPlayer, xHand); + float pStartedGrabbing = VR_HandGrabUtil_StartedHandGrabbing(entPlayer, xHand); + float* pWeaponPtr = VRGetEntWeaponPtr(entPlayer, xHand); + float* pWeaponFlagsPtr = VRGetEntWeaponFlagsPtr(entPlayer, xHand); + + float performWeaponSwitch = FALSE; + + // Guaranteed grab (linear force grab) + if(ent.throwhit == QVR_THROWHIT_FORCEGRAB) + { + if(VRGetHandtouchHand(ent) == xHand || pForceGrabbing && + (GetThrownWeaponForcegrabHand(ent) == xHand)) + { + performWeaponSwitch = TRUE; + } + } + else // Must catch it + { + if(VRGetHandtouchHand(ent) == xHand && pStartedGrabbing) + { + performWeaponSwitch = TRUE; + } } - if(VRGetHandtouchHand(ent) == cVR_OffHand && - (VREntStartedHandGrabbing(ent.handtouch_ent, cVR_OffHand) - || ent.throwhit == QVR_THROWHIT_FORCEGRAB) && - VRIsHandEmpty(ent.handtouch_ent, cVR_OffHand)) + if(performWeaponSwitch) { - wpnthrow_handtouch_impl(cVR_OffHand, ent, ent.handtouch_ent, &ent.handtouch_ent.weapon2); + wpnthrow_handtouch_impl(xHand, ent, entPlayer, pWeaponPtr, pWeaponFlagsPtr); + return TRUE; } - else if(VRGetHandtouchHand(ent) == cVR_MainHand && - (VREntStartedHandGrabbing(ent.handtouch_ent, cVR_MainHand) - || ent.throwhit == QVR_THROWHIT_FORCEGRAB) && - VRIsHandEmpty(ent.handtouch_ent, cVR_MainHand)) + + return FALSE; +} + +void(entity entWpn) wpnthrow_handtouch_ent = +{ + if(VRIsHandtouchHandFake(entWpn)) { - wpnthrow_handtouch_impl(cVR_MainHand, ent, ent.handtouch_ent, &ent.handtouch_ent.weapon); + // Happens with VR Body Interactions enabled. + + // TODO VR: (P0) test interactions between force grabs and VR body + // interactions! + + // TODO VR: (P2) cvar to choose what happens? + // return; } + + if(wpnthrow_handtouch_ent_hand(entWpn, cVR_OffHand)) { return; } + if(wpnthrow_handtouch_ent_hand(entWpn, cVR_MainHand)) { return; } } void() wpnthrow_handtouch = @@ -3252,10 +3513,6 @@ void() wpnthrow_handtouch = wpnthrow_handtouch_ent(self); } -// Used to trigger haptics when hovering holsters. -float holsterhover[6]; -float holsterprevhover[6]; - float(float xHolster) VRHolsterToIndex = { if(xHolster == QVR_HS_LEFT_SHOULDER_HOLSTER) { return 0; } @@ -3272,29 +3529,45 @@ float(float xHolster) VRHolsterToIndex = return 0; } -float(float xHolster) VRIsHolsterHovered = +string(float xHolster) VRGetHolsterName = { - return holsterhover[VRHolsterToIndex(xHolster)]; + if(xHolster == QVR_HS_LEFT_SHOULDER_HOLSTER) { return "Left shoulder"; } + if(xHolster == QVR_HS_RIGHT_SHOULDER_HOLSTER) { return "Right shoulder"; } + if(xHolster == QVR_HS_LEFT_HIP_HOLSTER) { return "Left thigh"; } + if(xHolster == QVR_HS_RIGHT_HIP_HOLSTER) { return "Right thigh"; } + if(xHolster == QVR_HS_LEFT_UPPER_HOLSTER) { return "Left waist"; } + if(xHolster == QVR_HS_RIGHT_UPPER_HOLSTER) { return "Right waist"; } + + bprint("`VRGetHolsterName`: invalid holster ID: "); + bprint(ftos(xHolster)); + bprint("\n"); + + return 0; } -void(float xHolster, float xValue) VRSetHolsterHovered = +float(entity xEntPlayer, float xHolster) VRIsHolsterHovered = { - holsterhover[VRHolsterToIndex(xHolster)] = xValue; + return xEntPlayer.holsterhover[VRHolsterToIndex(xHolster)]; } -float(float xHolster) VRIsHolsterPrevHovered = +void(entity xEntPlayer, float xHolster, float xValue) VRSetHolsterHovered = { - return holsterprevhover[VRHolsterToIndex(xHolster)]; + xEntPlayer.holsterhover[VRHolsterToIndex(xHolster)] = xValue; } -void(float xHolster, float xValue) VRSetHolsterPrevHovered = +float(entity xEntPlayer, float xHolster) VRIsHolsterPrevHovered = { - holsterprevhover[VRHolsterToIndex(xHolster)] = xValue; + return xEntPlayer.holsterprevhover[VRHolsterToIndex(xHolster)]; } -void() UpdateHolsterHover = +void(entity xEntPlayer, float xHolster, float xValue) VRSetHolsterPrevHovered = { - local float i; + xEntPlayer.holsterprevhover[VRHolsterToIndex(xHolster)] = xValue; +} + +void(entity xEntPlayer) UpdateHolsterHover = +{ + float i; for(i = QVR_HS_LEFT_SHOULDER_HOLSTER; i <= QVR_HS_RIGHT_UPPER_HOLSTER; ++i) { @@ -3303,26 +3576,53 @@ void() UpdateHolsterHover = continue; } - VRSetHolsterPrevHovered(i, VRIsHolsterHovered(i)); - VRSetHolsterHovered(i, FALSE); + VRSetHolsterPrevHovered(xEntPlayer, i, VRIsHolsterHovered(xEntPlayer, i)); + VRSetHolsterHovered(xEntPlayer, i, FALSE); } } -void(float xHand, float xHolster) VRHolsterHaptic = +void(entity xEntPlayer, float xHand, float xHolster) VRHolsterHaptic = { - local float holsterHapticsMode; - holsterHapticsMode = cvar("vr_holster_haptics"); + if(!xEntPlayer.ishuman) + { + return; + } + + float holsterHapticsMode; + holsterHapticsMode = cvar_hget(cvarh_vr_holster_haptics); if(holsterHapticsMode == 1 /* continuous */) { VRGunHaptic(xHand, 0.1, 75, 0.02); } - else if(!VRIsHolsterPrevHovered(xHolster) && VRIsHolsterHovered(xHolster) && holsterHapticsMode == 2 /* once */) + else if(!VRIsHolsterPrevHovered(xEntPlayer, xHolster) && + VRIsHolsterHovered(xEntPlayer, xHolster) && + holsterHapticsMode == 2 /* once */) { VRGunHaptic(xHand, 0.2, 75, 0.2); } } +void(entity xEntPlayer, float xHand, float xHolster) VRHolsterHapticBuzz = +{ + if(!xEntPlayer.ishuman) + { + return; + } + + VRGunHaptic(xHand, 0.1, 75, 0.5); +} + +void(entity ent, float xValue) SetThrownWeaponMetalNoiseOnTouch = +{ + ent.fixangle = xValue; +} + +float(entity ent) GetThrownWeaponMetalNoiseOnTouch = +{ + return ent.fixangle; +} + void(entity ent, float xValue) SetThrownWeaponDisappearOnHit = { ent.lip = xValue; @@ -3333,6 +3633,26 @@ float(entity ent) GetThrownWeaponDisappearOnHit = return ent.lip; } +void(entity ent, float xValue) SetThrownWeaponForcegrabTime = +{ + ent.lefty = xValue; +} + +float(entity ent) GetThrownWeaponForcegrabTime = +{ + return ent.lefty; +} + +void(entity ent, float xValue) SetThrownWeaponForcegrabHand = +{ + ent.deadflag = xValue; +} + +float(entity ent) GetThrownWeaponForcegrabHand = +{ + return ent.deadflag; +} + void(entity ent, float xValue) SetThrownWeaponDealDamage = { ent.health = xValue; @@ -3353,28 +3673,46 @@ float(entity ent) GetThrownWeaponBaseDamage = return ent.frags; } -void(entity thrower, float xWeapon, +void(entity ent, float xValue) SetThrownWeaponTimeout = +{ + ent.health = xValue; +} + +float(entity ent) GetThrownWeaponTimeout = +{ + return ent.health; +} + +void MakeGrabbable(entity newmis) +{ + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_BBOX; + + newmis.throwhit = QVR_THROWHIT_NEVER_HIT; + newmis.throwstabilizedim = -1; + + newmis.flags = newmis.flags | FL_EASYHANDTOUCH; + + SetThrownWeaponMetalNoiseOnTouch(newmis, FALSE); +} + +void MakeThrown(entity newmis, + entity thrower, float xWeapon, float xWeaponFlags, vector xOrigin, vector xRotation, vector xThrowVel, vector xAVel, float xDisappearOnHit, float xDealDamage, - float xBaseDamage) CreateThrownWeapon = + float xBaseDamage) { - local float tmp; - local vector tmp_handavel; - local vector tmp_bounds; - - newmis = spawn(); + MakeGrabbable(newmis); SetThrownWeaponDisappearOnHit(newmis, xDisappearOnHit); SetThrownWeaponDealDamage(newmis, xDealDamage); SetThrownWeaponBaseDamage(newmis, xBaseDamage); + SetThrownWeaponMetalNoiseOnTouch(newmis, TRUE); newmis.owner = thrower; - newmis.movetype = MOVETYPE_TOSS; - newmis.solid = SOLID_BBOX; - newmis.throwhit = QVR_THROWHIT_NEVER_HIT; newmis.throwstabilize = 8; newmis.throwstabilizedim = WeaponIdToThrowStabilizeDim(xWeapon); @@ -3385,36 +3723,61 @@ void(entity thrower, float xWeapon, newmis.handtouch = wpnthrow_handtouch; newmis.classname = "thrown_weapon"; - - newmis.flags = newmis.flags | FL_EASYHANDTOUCH; + newmis.netname = WeaponIdToWeaponName(xWeapon); makevectors(xThrowVel); - tmp_handavel = xAVel; + vector tmp_handavel = xAVel; newmis.avelocity = tmp_handavel_x * v_forward * 30 + tmp_handavel_y * v_right * -30 + tmp_handavel_z * v_up * -30; newmis.think = wpnthrow_think; newmis.nextthink = time + 0.02; + + SetThrownWeaponTimeout(newmis, time + 10); // removal time (timeout) in deathmatch + newmis.weapon = xWeapon; + newmis.weaponflags = xWeaponFlags; + + // TODO VR: (P1) fix laser cannon bounds + float tmp = WeaponIdToThrowBounds(xWeapon); - // TODO VR: (P0) fix laser cannon bounds - tmp = WeaponIdToThrowBounds(xWeapon); + vector tmp_bounds; tmp_bounds_x = tmp; tmp_bounds_y = tmp; tmp_bounds_z = tmp; - setmodel (newmis, WeaponIdToModel(xWeapon)); - setsize (newmis, -tmp_bounds, tmp_bounds); - setorigin (newmis, xOrigin); + setmodel(newmis, WeaponIdToModel(xWeapon, xWeaponFlags)); + setsize(newmis, -tmp_bounds, tmp_bounds); + setorigin(newmis, xOrigin); - newmis.velocity = (xThrowVel * 120 * WeaponIdToThrowMult(xWeapon)) * cvar("vr_weapon_throw_velocity_mult") + newmis.velocity = (xThrowVel * 120 * WeaponIdToThrowMult(xWeapon)) * cvar_hget(cvarh_vr_weapon_throw_velocity_mult) + thrower.velocity; } +entity(entity thrower, float xWeapon, float xWeaponFlags, + vector xOrigin, vector xRotation, + vector xThrowVel, vector xAVel, + float xDisappearOnHit, + float xDealDamage, + float xBaseDamage) CreateThrownWeapon = +{ + entity newmis = spawn(); + + MakeThrown(newmis, + thrower, xWeapon, xWeaponFlags, + xOrigin, xRotation, + xThrowVel, xAVel, + xDisappearOnHit, + xDealDamage, + xBaseDamage); + + return newmis; +} + vector randomVec(float range) { - local vector res; + vector res; res_x = crandom() * range; res_y = crandom() * range; @@ -3425,12 +3788,12 @@ vector randomVec(float range) void(entity thrower, float xWeapon, vector xOrigin) CreateWeaponDrop = { - local vector throwVel; + vector throwVel; throwVel = randomVec(0.9); throwVel_z = 1.1 + random() * 1.1; - CreateThrownWeapon(thrower, xWeapon, + CreateThrownWeapon(thrower, xWeapon, 0 /* weaponflags */, xOrigin, randomVec(180), throwVel, randomVec(20), FALSE /* disappear on hit */, @@ -3439,15 +3802,15 @@ void(entity thrower, float xWeapon, vector xOrigin) CreateWeaponDrop = ); } -// TODO VR: (P1) improve +// TODO VR: (P2) improve? void(entity thrower, float xWeapon, vector xOrigin) CreateAmmoBoxWeaponDrop = { - local vector throwVel; + vector throwVel; throwVel = randomVec(0.1); throwVel_z = 0.2 + random() * 0.1; - CreateThrownWeapon(thrower, xWeapon, + CreateThrownWeapon(thrower, xWeapon, 0 /* weaponflags */, xOrigin, randomVec(180), throwVel, randomVec(20), FALSE /* disappear on hit */, @@ -3458,30 +3821,51 @@ void(entity thrower, float xWeapon, vector xOrigin) CreateAmmoBoxWeaponDrop = float() getWeaponMode = { - return cvar("vr_holster_mode"); + return cvar_hget(cvarh_vr_holster_mode); } float() getWeaponThrowMode = { - return cvar("vr_weapon_throw_mode"); + return cvar_hget(cvarh_vr_weapon_throw_mode); } -void(entity ent, float xHand, float xWeapon) DropWeaponInHand = +void(entity ent, float xHand, float xWeapon, float xWeaponFlags) DropWeaponInHand = { + if(VRIsHandEmpty(ent, xHand)) + { + return; + } + + float twoHThrowVelMult; + vector throwVel; + if(time - self.last_2h_time < 0.3) + { + twoHThrowVelMult = cvar_hget(cvarh_vr_2h_throw_velocity_mult); + throwVel = VRGetHandThrowVel(xHand) + VRGetHandThrowVel(VRGetOtherHand(xHand)); + throwVel /= 2.0; + throwVel *= twoHThrowVelMult; + } + else + { + twoHThrowVelMult = 1.0; + throwVel = VRGetHandThrowVel(xHand); + } + + if(getWeaponThrowMode() == QVR_WEAPONTHROWMODE_IMMERSIVE) { - CreateThrownWeapon(ent, xWeapon, + CreateThrownWeapon(ent, xWeapon, xWeaponFlags, VRGetHandPos(xHand), VRGetHandRot(xHand), - VRGetHandThrowVel(xHand), VRGetHandAVel(xHand), + throwVel, VRGetHandAVel(xHand), FALSE /* disappear on hit */, TRUE /* deal damage */, WeaponIdToThrowDamage(xWeapon)); } else if(getWeaponThrowMode() == QVR_WEAPONTHROWMODE_DISAPPEARONHIT) { - CreateThrownWeapon(ent, xWeapon, + CreateThrownWeapon(ent, xWeapon, xWeaponFlags, VRGetHandPos(xHand), VRGetHandRot(xHand), - VRGetHandThrowVel(xHand), VRGetHandAVel(xHand), + throwVel, VRGetHandAVel(xHand), TRUE /* disappear on hit */, TRUE /* deal damage */, WeaponIdToThrowDamage(xWeapon)); @@ -3496,27 +3880,35 @@ void(entity ent, float xHand, float xWeapon) DropWeaponInHand = W_SetCurrentAmmoFor(xHand); } +void(entity entPlayer, float xHotspot, float xWeapon, float xWeaponFlags) VRPutWeaponInHolster = +{ + sound(entPlayer, CHAN_BODY, "weapons/holster1.wav", 1, ATTN_NORM); + + setHolsterWeapon(xHotspot, xWeapon); + setHolsterWeaponModel(xHotspot, WeaponIdToModel(xWeapon, xWeaponFlags)); + setHolsterWeaponFlags(xHotspot, xWeaponFlags); +} + void(entity ent, float xHand, float xWeapon, float* xOutWeapon, + float xWeaponFlags, float* xOutWeaponFlags, float xAttackFinished, float xHotspot, - float xOtherWeapon, float* xOutOtherWeapon, float xOtherAttackFinished) DoHandImpl = + float xOtherWeapon, float* xOutOtherWeapon, + float xOtherWeaponFlags, float* xOutOtherWeaponFlags, + float xOtherAttackFinished) DoHandImpl = { - local float handGrabbing, handPrevGrabbing, otherHandGrabbing, - handEmpty, otherHandEmpty, triggerPressed; - - handGrabbing = VRIsEntHandGrabbing(ent, xHand); - handPrevGrabbing = VRIsEntHandPrevGrabbing(ent, xHand); - otherHandGrabbing = VRIsEntHandGrabbing(ent, VRGetOtherHand(xHand)); - handEmpty = VRIsHandEmpty(ent, xHand); - otherHandEmpty = VRIsHandEmpty(ent, VRGetOtherHand(xHand)); - triggerPressed = VRGetFireButtonPressed(xHand); - - local vector handPos, handRot; + float handGrabbing = VR_HandGrabUtil_IsHandGrabbing(ent, xHand); + float handPrevGrabbing = VR_HandGrabUtil_IsHandPrevGrabbing(ent, xHand); + float otherHandGrabbing = VR_HandGrabUtil_IsHandGrabbing(ent, VRGetOtherHand(xHand)); + float handEmpty = VRIsHandEmpty(ent, xHand); + float otherHandEmpty = VRIsHandEmpty(ent, VRGetOtherHand(xHand)); + float triggerPressed = VRGetEntFireButtonPressed(ent, xHand); + float startedHandGrabbing = VR_HandGrabUtil_StartedHandGrabbing(ent, xHand); - handPos = VRGetHandPos(xHand); - handRot = VRGetHandRot(xHand); + vector handPos = VRGetHandPos(xHand); + vector handRot = VRGetHandRot(xHand); - if(time < readytime) + if(!deathmatch && time < readytime) { // Do not do anything if the player is not "ready" yet, after spawning. return; @@ -3524,7 +3916,7 @@ void(entity ent, float xHand, if(isHolsterHotspot(xHotspot)) { - VRSetHolsterHovered(xHotspot, TRUE); + VRSetHolsterHovered(ent, xHotspot, TRUE); } // Holding a weapon, but not grabbing the controller. @@ -3536,7 +3928,7 @@ void(entity ent, float xHand, xHotspot == QVR_HS_OFFHAND_2H_GRAB || xHotspot == QVR_HS_MAINHAND_2H_GRAB) { - DropWeaponInHand(ent, xHand, xWeapon); + DropWeaponInHand(ent, xHand, xWeapon, xWeaponFlags); } // Put a weapon in a holster. else if(isHolsterHotspot(xHotspot)) @@ -3547,13 +3939,18 @@ void(entity ent, float xHand, { if(getHolsterWeapon(xHotspot) == WID_FIST) { - sound(ent, CHAN_BODY, "weapons/holster1.wav", 1, ATTN_NORM); + VRPutWeaponInHolster(ent, xHotspot, xWeapon, xWeaponFlags); - setHolsterWeapon(xHotspot, xWeapon); - setHolsterWeaponModel(xHotspot, WeaponIdToModel(xWeapon)); VRSetHandEmpty(ent, xHand); W_SetCurrentAmmoFor(xHand); } + else if(handPrevGrabbing) + { + sprint(ent, VRGetHolsterName(xHotspot)); + sprint(ent, " holster is not empty.\n"); + + VRHolsterHapticBuzz(ent, xHand, xHotspot); + } } // In "quick slot" mode, weapons can be placed in any holster. // Holstering a weapon does not free your hand up. @@ -3563,8 +3960,7 @@ void(entity ent, float xHand, { sound(ent, CHAN_BODY, "weapons/holster1.wav", 1, ATTN_NORM); - setHolsterWeapon(xHotspot, xWeapon); - setHolsterWeaponModel(xHotspot, WeaponIdToModel(xWeapon)); + VRPutWeaponInHolster(ent, xHotspot, xWeapon, xWeaponFlags); } } } @@ -3576,6 +3972,7 @@ void(entity ent, float xHand, sound(ent, CHAN_BODY, "knight/sword2.wav", 0.7, ATTN_NORM); *xOutOtherWeapon = xWeapon; + *xOutOtherWeaponFlags = xWeaponFlags; VRSetHandEmpty(ent, xHand); W_SetCurrentAmmo(); @@ -3589,12 +3986,43 @@ void(entity ent, float xHand, { if(getHolsterWeapon(xHotspot) == WID_FIST) { - VRHolsterHaptic(xHand, xHotspot); + VRHolsterHaptic(ent, xHand, xHotspot); + } + } + } + // Not holding a weapon, grabbing the controller, and pressing the trigger. + else if(handEmpty && triggerPressed) + { + if(VR_ForcegrabUtil_GetForcegrabMode() == QVR_VRFORCEGRABMODE_DISABLED) + { + // Intentionally left empty. + } + else if(VR_ForcegrabUtil_GetForcegrabMode() == QVR_VRFORCEGRABMODE_PARABOLA) + { + VR_ForcegrabUtil_Impl_DoForcegrabParabola(xHand, handPos, handRot); + } + else if(handGrabbing && VR_ForcegrabUtil_GetForcegrabMode() == QVR_VRFORCEGRABMODE_LINEAR) + { + VR_ForcegrabUtil_Impl_DoForcegrabLinear(xHand, handPos, handRot); + } + else if(handGrabbing && VR_ForcegrabUtil_GetForcegrabMode() == QVR_VRFORCEGRABMODE_INSTANT) + { + VR_ForcegrabUtil_Impl_DoForcegrabInstant(xHand, handPos, handRot); + } + } + // Not holding a weapon and hovering an holster. Possible intention to unholster. + else if(handEmpty && !handGrabbing) + { + if(isHolsterHotspot(xHotspot)) + { + if(getHolsterWeapon(xHotspot) != WID_FIST) + { + VRHolsterHaptic(ent, xHand, xHotspot); } } } // Not holding a weapon and started grabbing the controller. - else if(handEmpty && VREntStartedHandGrabbing(ent, xHand)) + else if(handEmpty && startedHandGrabbing) { // Not a holster. Do nothing. if(xHotspot == QVR_HS_NONE || @@ -3611,12 +4039,14 @@ void(entity ent, float xHand, { sound(ent, CHAN_BODY, "weapons/holster0.wav", 1, ATTN_NORM); *xOutWeapon = getHolsterWeapon(xHotspot); + *xOutWeaponFlags = getHolsterWeaponFlags(xHotspot); // In "immersive" mode, unholstering removes a weapon from a holster. if(getWeaponMode() == QVR_WEAPONMODE_IMMERSIVE) { setHolsterWeapon(xHotspot, WID_FIST); - setHolsterWeaponModel(xHotspot, WeaponIdToModel(WID_FIST)); + setHolsterWeaponModel(xHotspot, WeaponIdToModel(WID_FIST, 0 /* weaponflags */)); + setHolsterWeaponFlags(xHotspot, 0); } // In "quick slot" mode, unholstering does not remove a weapon from a holster. else if(getWeaponMode() == QVR_WEAPONMODE_CYCLEQUICKSLOT) @@ -3628,59 +4058,30 @@ void(entity ent, float xHand, } } } - // Not holding a weapon, grabbing the controller, and pressing the trigger. - else if(handEmpty && handGrabbing && triggerPressed) - { - if(getForcegrabMode() == QVR_VRFORCEGRABMODE_DISABLED) - { - // Intentionally left empty. - } - else if(getForcegrabMode() == QVR_VRFORCEGRABMODE_PARABOLA) - { - DoForceGrabImplParabola(xHand, handPos, handRot); - } - else if(getForcegrabMode() == QVR_VRFORCEGRABMODE_LINEAR) - { - DoForceGrabImplLinear(xHand, handPos, handRot); - } - else if(getForcegrabMode() == QVR_VRFORCEGRABMODE_INSTANT) - { - DoForceGrabImplInstant(xHand, handPos, handRot); - } - } - // Not holding a weapon and hovering an holster. Possible intention to unholster. - else if(handEmpty && !handGrabbing) - { - if(isHolsterHotspot(xHotspot)) - { - if(getHolsterWeapon(xHotspot) != WID_FIST) - { - VRHolsterHaptic(xHand, xHotspot); - } - } - } } void(float xHand) W_Frame_Forcegrab_Impl = { - if(!VRGetForceGrabbing(xHand)) + if(!VR_ForceGrabUtil_IsEntForceGrabbing(self, xHand)) { ParticlesAndHapticsForEligibleForceGrabWeapons( xHand, VRGetHandPos(xHand), VRGetHandRot(xHand)); } - if(!VRGetFireButtonPressed(xHand)) + // Refresh force grab until trigger is released + if(VRGetFireButtonPressed(xHand) && + VR_ForceGrabUtil_IsEntForceGrabbing(self, xHand)) { - VRSetForceGrabbing(xHand, FALSE); + VR_ForceGrabUtil_EntStartForceGrabbing(self, xHand); } } void() W_Frame_Forcegrab = { - if(getForcegrabMode() == QVR_VRFORCEGRABMODE_DISABLED) + if(VR_ForcegrabUtil_GetForcegrabMode() == QVR_VRFORCEGRABMODE_DISABLED) { - VRSetForceGrabbing(cVR_MainHand, FALSE); - VRSetForceGrabbing(cVR_OffHand, FALSE); + VR_ForceGrabUtil_EntStopForceGrabbing(self, cVR_MainHand); + VR_ForceGrabUtil_EntStopForceGrabbing(self, cVR_OffHand); return; } @@ -3695,17 +4096,29 @@ void() W_Frame = ImpulseCommands(); } - UpdateHolsterHover(); + UpdateHolsterHover(self); + + if(VRGet2HAiming(self)) + { + // Used for 2H throws. + self.last_2h_time = time; + } DoHandImpl(self, cVR_OffHand, self.weapon2, &self.weapon2, + self.weaponflags2, &self.weaponflags2, self.offhand_attack_finished, self.offhand_hotspot, - self.weapon, &self.weapon, self.attack_finished); + self.weapon, &self.weapon, + self.weaponflags, &self.weaponflags, + self.attack_finished); DoHandImpl(self, cVR_MainHand, self.weapon, &self.weapon, + self.weaponflags, &self.weaponflags, self.attack_finished, self.mainhand_hotspot, - self.weapon2, &self.weapon2, self.offhand_attack_finished); + self.weapon2, &self.weapon2, + self.weaponflags2, &self.weaponflags2, + self.offhand_attack_finished); W_Frame_Forcegrab(); } @@ -3729,5 +4142,5 @@ void() SuperDamageSound = } }; -// TODO VR: (P1) remove backpack spinning animation. +// TODO VR: (P2) remove backpack spinning animation. diff --git a/QC/weaponutil.qc b/QC/weaponutil.qc deleted file mode 100644 index bb9d77e9..00000000 --- a/QC/weaponutil.qc +++ /dev/null @@ -1,358 +0,0 @@ -float(float wid) IsValidWeaponId = -{ - return wid >= WID_FIST && wid <= WID_LASER_CANNON; -} - -float(float wid, float wpnFlags) PlayerHasWeapon = -{ - if(!IsValidWeaponId(wid)) - { - bprint("`PlayerHasWeapon`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return FALSE; - } - - if(wid == WID_FIST) return TRUE; - if(wid == WID_GRAPPLE) return cvar("vr_enable_grapple"); - - return wpnFlags & WeaponIdToItemId(wid); -} - -float(entity ent, float wid) PlayerEligibleForWeapon = -{ - if(wid == WID_FIST) { return TRUE; } - if(wid == WID_AXE) { return TRUE; } - if(wid == WID_SHOTGUN) { return TRUE; } - - return PlayerHasWeapon(wid, ent.items); -} - -float() getEnemyDrops = -{ - return cvar("vr_enemy_drops"); -} - -float() getAmmoBoxDrops = -{ - return cvar("vr_ammobox_drops"); -} - -entity() FindEntPlayerForDrop = -{ - if(getEnemyDrops() == QVR_ENEMYDROPS_DISABLE) - { - return world; - } - - return find(world, classname, "player"); -} - -float(entity entPlayer, float xWeapon, float xChance) TryEnemyDrop = -{ - local float eligible, chance, roll; - - if(getEnemyDrops() == QVR_ENEMYDROPS_DISABLE) - { - return FALSE; - } - - // TODO VR: (P2) bitwise or is the only one that works here, || does not work. Why? - eligible = (getEnemyDrops() == QVR_ENEMYDROPS_ALWAYS) | - PlayerEligibleForWeapon(entPlayer, xWeapon); - - chance = xChance * cvar("vr_enemy_drops_chance_mult"); - - roll = random(); - - // bprint("weapon: "); - // bprint(ftos(xWeapon)); - // bprint(" | eligible ps: "); - // bprint(ftos(getEnemyDrops() == QVR_ENEMYDROPS_ALWAYS)); - // bprint(" or "); - // bprint(ftos(PlayerEligibleForWeapon(entPlayer, xWeapon))); - // bprint(" | chance: "); - // bprint(ftos(chance)); - // bprint(" | roll: "); - // bprint(ftos(roll)); - // bprint(" | eligible: "); - // bprint(ftos(eligible)); - // bprint(" | rollpass: "); - // bprint(ftos(roll < chance)); - // bprint(" | cond: "); - // bprint(ftos(eligible && (roll < chance))); - // bprint("\n"); - - if(eligible && (roll < chance)) - { - CreateWeaponDrop(self, xWeapon, self.origin); - return TRUE; - } - - return FALSE; -} - -// TODO VR: (P2) code repetition, but create ammo box uses player ent -float(entity entAmmoBox, entity entPlayer, float xWeapon, float xChance) TryAmmoBoxDrop = -{ - local float eligible, chance, roll; - - if(getAmmoBoxDrops() == QVR_AMMOBOXDROPS_DISABLE) - { - return FALSE; - } - - // TODO VR: (P2) bitwise or is the only one that works here, || does not work. Why? - eligible = (getAmmoBoxDrops() == QVR_AMMOBOXDROPS_ALWAYS) | - PlayerEligibleForWeapon(entPlayer, xWeapon); - - chance = xChance * cvar("vr_ammobox_drops_chance_mult"); - - roll = random(); - - if(eligible && (roll < chance)) - { - CreateAmmoBoxWeaponDrop(entPlayer, xWeapon, entAmmoBox.origin); - return TRUE; - } - - return FALSE; -} - -float(float wid) WeaponIdToItemId = -{ - if(wid == WID_FIST) { return IT_FIST; } - if(wid == WID_AXE) { return IT_AXE; } - if(wid == WID_MJOLNIR) { return IT_MJOLNIR; } - if(wid == WID_SHOTGUN) { return IT_SHOTGUN; } - if(wid == WID_SUPER_SHOTGUN) { return IT_SUPER_SHOTGUN; } - if(wid == WID_NAILGUN) { return IT_NAILGUN; } - if(wid == WID_SUPER_NAILGUN) { return IT_SUPER_NAILGUN; } - if(wid == WID_GRENADE_LAUNCHER) { return IT_GRENADE_LAUNCHER; } - if(wid == WID_PROXIMITY_GUN) { return IT_PROXIMITY_GUN; } - if(wid == WID_ROCKET_LAUNCHER) { return IT_ROCKET_LAUNCHER; } - if(wid == WID_LIGHTNING) { return IT_LIGHTNING; } - if(wid == WID_LASER_CANNON) { return IT_LASER_CANNON; } - // TODO VR: (P1) fist and grapple - - bprint("`WeaponIdToItemId`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return -1; -} - -float(float it) ItemIdToWeaponId = -{ - if(it == IT_FIST) { return WID_FIST; } - if(it == IT_AXE) { return WID_AXE; } - if(it == IT_MJOLNIR) { return WID_MJOLNIR; } - if(it == IT_SHOTGUN) { return WID_SHOTGUN; } - if(it == IT_SUPER_SHOTGUN) { return WID_SUPER_SHOTGUN; } - if(it == IT_NAILGUN) { return WID_NAILGUN; } - if(it == IT_SUPER_NAILGUN) { return WID_SUPER_NAILGUN; } - if(it == IT_GRENADE_LAUNCHER) { return WID_GRENADE_LAUNCHER; } - if(it == IT_PROXIMITY_GUN) { return WID_PROXIMITY_GUN; } - if(it == IT_ROCKET_LAUNCHER) { return WID_ROCKET_LAUNCHER; } - if(it == IT_LIGHTNING) { return WID_LIGHTNING; } - if(it == IT_LASER_CANNON) { return WID_LASER_CANNON; } - // TODO VR: (P1) fist and grapple - - bprint("`ItemIdToWeaponId`: invalid item id '"); - bprint(ftos(it)); - bprint("'\n"); - - return -1; -} - -string(float wid) WeaponIdToModel = -{ - if(wid == WID_FIST) { return "progs/hand.mdl"; } - if(wid == WID_GRAPPLE) { return "progs/v_grpple.mdl"; } - if(wid == WID_AXE) { return "progs/v_axe.mdl"; } - if(wid == WID_MJOLNIR) { return "progs/v_hammer.mdl"; } - if(wid == WID_SHOTGUN) { return "progs/v_shot.mdl"; } - if(wid == WID_SUPER_SHOTGUN) { return "progs/v_shot2.mdl"; } - if(wid == WID_NAILGUN) { return "progs/v_nail.mdl"; } - if(wid == WID_SUPER_NAILGUN) { return "progs/v_nail2.mdl"; } - if(wid == WID_GRENADE_LAUNCHER) { return "progs/v_rock.mdl"; } - if(wid == WID_PROXIMITY_GUN) { return "progs/v_prox.mdl"; } - if(wid == WID_ROCKET_LAUNCHER) { return "progs/v_rock2.mdl"; } - if(wid == WID_LIGHTNING) { return "progs/v_light.mdl"; } - if(wid == WID_LASER_CANNON) { return "progs/v_laserg.mdl"; } - - bprint("`WeaponIdToModel`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return ""; -} - -float(float wid) WeaponIdToAmmoId = -{ - if(wid == WID_FIST) { return AID_NONE; } - if(wid == WID_GRAPPLE) { return AID_NONE; } - if(wid == WID_AXE) { return AID_NONE; } - if(wid == WID_MJOLNIR) { return AID_CELLS; } - if(wid == WID_SHOTGUN) { return AID_SHELLS; } - if(wid == WID_SUPER_SHOTGUN) { return AID_SHELLS; } - if(wid == WID_NAILGUN) { return AID_NAILS; } - if(wid == WID_SUPER_NAILGUN) { return AID_NAILS; } - if(wid == WID_GRENADE_LAUNCHER) { return AID_ROCKETS; } - if(wid == WID_PROXIMITY_GUN) { return AID_ROCKETS; } - if(wid == WID_ROCKET_LAUNCHER) { return AID_ROCKETS; } - if(wid == WID_LIGHTNING) { return AID_CELLS; } - if(wid == WID_LASER_CANNON) { return AID_CELLS; } - - bprint("`WeaponIdToAmmoId`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return AID_NONE; -} - -float(entity xPlayer, float xAid) GetAmmoCountByAmmoId = -{ - if(xAid == AID_SHELLS) { return xPlayer.ammo_shells; } - if(xAid == AID_NAILS) { return xPlayer.ammo_nails; } - if(xAid == AID_ROCKETS) { return xPlayer.ammo_rockets; } - if(xAid == AID_CELLS) { return xPlayer.ammo_cells; } - - bprint("`GetAmmoCountByAmmoId`: invalid ammo id '"); - bprint(ftos(xAid)); - bprint("'\n"); - - return 0; -} - -float(entity xPlayer, float wid) PlayerHasAmmoForWeapon = -{ - local float ammoId; - - ammoId = WeaponIdToAmmoId(wid); - - if(ammoId == AID_NONE) - { - return TRUE; - } - - return GetAmmoCountByAmmoId(xPlayer, ammoId) > 0; -} - -float(float wid) WeaponIdToThrowMult = -{ - // TODO VR: (P2) used for velocity, but weight is used on the calculations - // on the C++ side of things - - if(wid == WID_FIST) { return 1; } - if(wid == WID_GRAPPLE) { return 0.9; } - if(wid == WID_AXE) { return 0.9; } - if(wid == WID_MJOLNIR) { return 0.7; } - if(wid == WID_SHOTGUN) { return 0.8; } - if(wid == WID_SUPER_SHOTGUN) { return 0.8; } - if(wid == WID_NAILGUN) { return 0.8; } - if(wid == WID_SUPER_NAILGUN) { return 0.6; } - if(wid == WID_GRENADE_LAUNCHER) { return 0.6; } - if(wid == WID_PROXIMITY_GUN) { return 0.6; } - if(wid == WID_ROCKET_LAUNCHER) { return 0.6; } - if(wid == WID_LIGHTNING) { return 0.6; } - if(wid == WID_LASER_CANNON) { return 0.4; } - - bprint("`WeaponIdToThrowMult`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return 1; -} - -float(float wid) WeaponIdToThrowStabilizeDim = -{ - if(wid == WID_FIST) { return 0; } - if(wid == WID_GRAPPLE) { return 0; } - if(wid == WID_AXE) { return 2; } - if(wid == WID_MJOLNIR) { return 2; } - if(wid == WID_SHOTGUN) { return 0; } - if(wid == WID_SUPER_SHOTGUN) { return 0; } - if(wid == WID_NAILGUN) { return 0; } - if(wid == WID_SUPER_NAILGUN) { return 0; } - if(wid == WID_GRENADE_LAUNCHER) { return 0; } - if(wid == WID_PROXIMITY_GUN) { return 0; } - if(wid == WID_ROCKET_LAUNCHER) { return 0; } - if(wid == WID_LIGHTNING) { return 0; } - if(wid == WID_LASER_CANNON) { return 0; } - - bprint("`WeaponIdToThrowStabilizeDim`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return 0; -} - -float(float wid) WeaponIdToThrowDamage = -{ - if(wid == WID_FIST) { return 20; } - if(wid == WID_GRAPPLE) { return 20; } - if(wid == WID_AXE) { return 35; } - if(wid == WID_MJOLNIR) { return 30; } - if(wid == WID_SHOTGUN) { return 20; } - if(wid == WID_SUPER_SHOTGUN) { return 20; } - if(wid == WID_NAILGUN) { return 20; } - if(wid == WID_SUPER_NAILGUN) { return 25; } - if(wid == WID_GRENADE_LAUNCHER) { return 30; } - if(wid == WID_PROXIMITY_GUN) { return 30; } - if(wid == WID_ROCKET_LAUNCHER) { return 30; } - if(wid == WID_LIGHTNING) { return 25; } - if(wid == WID_LASER_CANNON) { return 45; } - - bprint("`WeaponIdToThrowDamage`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return 0; -} - -float(float wid) WeaponIdToThrowBounds = -{ - if(wid == WID_FIST) { return 1; } - if(wid == WID_GRAPPLE) { return 1; } - if(wid == WID_AXE) { return 1; } - if(wid == WID_MJOLNIR) { return 1.1; } - if(wid == WID_SHOTGUN) { return 1.25; } - if(wid == WID_SUPER_SHOTGUN) { return 1.25; } - if(wid == WID_NAILGUN) { return 1.25; } - if(wid == WID_SUPER_NAILGUN) { return 1.5; } - if(wid == WID_GRENADE_LAUNCHER) { return 1.5; } - if(wid == WID_PROXIMITY_GUN) { return 1.5; } - if(wid == WID_ROCKET_LAUNCHER) { return 1.7; } - if(wid == WID_LIGHTNING) { return 1.5; } - if(wid == WID_LASER_CANNON) { return 2.4; } - - bprint("`WeaponIdToThrowBounds`: invalid weapon id '"); - bprint(ftos(wid)); - bprint("'\n"); - - return 0; -} - -// TODO VR: (P1) use for DropBackpack, GremlinDropBackpack, netname, etc -string(float it) ItemIdToWeaponName = -{ - if(it == IT_AXE) { return "Axe"; } - if(it == IT_SHOTGUN) { return "Shotgun"; } - if(it == IT_SUPER_SHOTGUN) { return "Double-barrelled Shotgun"; } - if(it == IT_NAILGUN) { return "Nailgun"; } - if(it == IT_SUPER_NAILGUN) { return "Super Nailgun"; } - if(it == IT_GRENADE_LAUNCHER) { return "Grenade Launcher"; } - if(it == IT_ROCKET_LAUNCHER) { return "Rocket Launcher"; } - if(it == IT_LIGHTNING) { return "Thunderbolt"; } - if(it == IT_LASER_CANNON) { return "Laser Cannon"; } - if(it == IT_PROXIMITY_GUN) { return "Proximity Gun"; } - if(it == IT_MJOLNIR) { return "Mjolnir"; } - - bprint("`ItemIdToWeaponName`: invalid item id '"); - bprint(ftos(it)); - bprint("'\n"); - - return ""; -} diff --git a/QC/wizard.qc b/QC/wizard.qc deleted file mode 100644 index 9d9dc842..00000000 --- a/QC/wizard.qc +++ /dev/null @@ -1,410 +0,0 @@ -/* -============================================================================== - -WIZARD - -============================================================================== -*/ - -$cd id1/models/a_wizard -$origin 0 0 24 -$base wizbase -$skin wizbase - -$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 -$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 - -$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 fly9 fly10 -$frame fly11 fly12 fly13 fly14 - -$frame magatt1 magatt2 magatt3 magatt4 magatt5 magatt6 magatt7 -$frame magatt8 magatt9 magatt10 magatt11 magatt12 magatt13 - -$frame pain1 pain2 pain3 pain4 - -$frame death1 death2 death3 death4 death5 death6 death7 death8 - -/* -============================================================================== - -WIZARD - -If the player moves behind cover before the missile is launched, launch it -at the last visible spot with no velocity leading, in hopes that the player -will duck back out and catch it. -============================================================================== -*/ - -/* -============= -LaunchMissile - -Sets the given entities velocity and angles so that it will hit self.enemy -if self.enemy maintains it's current velocity -0.1 is moderately accurate, 0.0 is totally accurate -============= -*/ -void(entity missile, float mspeed, float accuracy) LaunchMissile = -{ - local vector vec, move; - local float fly; - - makevectors (self.angles); - -// set missile speed - vec = self.enemy.origin + self.enemy.mins + self.enemy.size * 0.7 - missile.origin; - -// calc aproximate time for missile to reach vec - fly = vlen (vec) / mspeed; - -// get the entities xy velocity - move = self.enemy.velocity; - move_z = 0; - -// project the target forward in time - vec = vec + move * fly; - - vec = normalize(vec); - vec = vec + accuracy*v_up*(random()- 0.5) + accuracy*v_right*(random()- 0.5); - - missile.velocity = vec * mspeed; - - missile.angles = '0 0 0'; - missile.angles_y = vectoyaw(missile.velocity); - -// set missile duration - missile.nextthink = time + 5; - missile.think = SUB_Remove; -}; - - -void() wiz_run1; -void() wiz_side1; - -/* -================= -WizardCheckAttack -================= -*/ -float() WizardCheckAttack = -{ - local vector spot1, spot2; - local entity targ; - local float chance; - - if(time < self.attack_finished) - return FALSE; - if(!enemy_vis) - return FALSE; - - if(enemy_range == RANGE_FAR) - { - if(self.attack_state != AS_STRAIGHT) - { - self.attack_state = AS_STRAIGHT; - wiz_run1(); - } - return FALSE; - } - - targ = self.enemy; - -// see if any entities are in the way of the shot - spot1 = self.origin + self.view_ofs; - spot2 = targ.origin + targ.view_ofs; - - traceline(spot1, spot2, FALSE, self); - - if(trace_ent != targ) - { // don't have a clear shot, so move to a side - if(self.attack_state != AS_STRAIGHT) - { - self.attack_state = AS_STRAIGHT; - wiz_run1(); - } - return FALSE; - } - - if(enemy_range == RANGE_MELEE) - chance = 0.9; - else if(enemy_range == RANGE_NEAR) - chance = 0.6; - else if(enemy_range == RANGE_MID) - chance = 0.2; - else - chance = 0; - - if(random () < chance) - { - self.attack_state = AS_MISSILE; - return TRUE; - } - - if(enemy_range == RANGE_MID) - { - if(self.attack_state != AS_STRAIGHT) - { - self.attack_state = AS_STRAIGHT; - wiz_run1(); - } - } - else - { - if(self.attack_state != AS_SLIDING) - { - self.attack_state = AS_SLIDING; - wiz_side1(); - } - } - - return FALSE; -}; - -/* -================= -WizardAttackFinished -================= -*/ -void() WizardAttackFinished = -{ - if(enemy_range >= RANGE_MID || !enemy_vis) - { - self.attack_state = AS_STRAIGHT; - self.think = wiz_run1; - } - else - { - self.attack_state = AS_SLIDING; - self.think = wiz_side1; - } -}; - -/* -============================================================================== - -FAST ATTACKS - -============================================================================== -*/ - -void() Wiz_FastFire = -{ - local vector vec; - local vector dst; - - if(self.owner.health > 0) - { - self.owner.effects = self.owner.effects | EF_MUZZLEFLASH; - - makevectors (self.enemy.angles); - dst = self.enemy.origin - 13*self.movedir; - - vec = normalize(dst - self.origin); - sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); - launch_spike (self.origin, vec); - newmis.velocity = vec*600; - newmis.owner = self.owner; - newmis.classname = "wizspike"; - setmodel (newmis, "progs/w_spike.mdl"); - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - } - - remove (self); -}; - - -void() Wiz_StartFast = -{ - local entity missile; - - sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); - self.v_angle = self.angles; - makevectors (self.angles); - - missile = spawn(); - missile.owner = self; - missile.nextthink = time + 0.6; - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin + '0 0 30' + v_forward*14 + v_right*14); - missile.enemy = self.enemy; - missile.nextthink = time + 0.8; - missile.think = Wiz_FastFire; - missile.movedir = v_right; - - missile = spawn(); - missile.owner = self; - missile.nextthink = time + 1; - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin + '0 0 30' + v_forward*14 + v_right* -14); - missile.enemy = self.enemy; - missile.nextthink = time + 0.3; - missile.think = Wiz_FastFire; - missile.movedir = VEC_ORIGIN - v_right; -}; - - - -void() Wiz_idlesound = -{ -local float wr; - wr = random() * 5; - - if(self.waitmin < time) - { - self.waitmin = time + 2; - if(wr > 4.5) - sound(self, CHAN_VOICE, "wizard/widle1.wav", 1, ATTN_IDLE); - if(wr < 1.5) - sound(self, CHAN_VOICE, "wizard/widle2.wav", 1, ATTN_IDLE); - } - return; -}; - -void() wiz_stand1 =[ $hover1, wiz_stand2 ] {ai_stand();}; -void() wiz_stand2 =[ $hover2, wiz_stand3 ] {ai_stand();}; -void() wiz_stand3 =[ $hover3, wiz_stand4 ] {ai_stand();}; -void() wiz_stand4 =[ $hover4, wiz_stand5 ] {ai_stand();}; -void() wiz_stand5 =[ $hover5, wiz_stand6 ] {ai_stand();}; -void() wiz_stand6 =[ $hover6, wiz_stand7 ] {ai_stand();}; -void() wiz_stand7 =[ $hover7, wiz_stand8 ] {ai_stand();}; -void() wiz_stand8 =[ $hover8, wiz_stand1 ] {ai_stand();}; - -void() wiz_walk1 =[ $hover1, wiz_walk2 ] {ai_walk(8); -Wiz_idlesound();}; -void() wiz_walk2 =[ $hover2, wiz_walk3 ] {ai_walk(8);}; -void() wiz_walk3 =[ $hover3, wiz_walk4 ] {ai_walk(8);}; -void() wiz_walk4 =[ $hover4, wiz_walk5 ] {ai_walk(8);}; -void() wiz_walk5 =[ $hover5, wiz_walk6 ] {ai_walk(8);}; -void() wiz_walk6 =[ $hover6, wiz_walk7 ] {ai_walk(8);}; -void() wiz_walk7 =[ $hover7, wiz_walk8 ] {ai_walk(8);}; -void() wiz_walk8 =[ $hover8, wiz_walk1 ] {ai_walk(8);}; - -void() wiz_side1 =[ $hover1, wiz_side2 ] {ai_run(8); -Wiz_idlesound();}; -void() wiz_side2 =[ $hover2, wiz_side3 ] {ai_run(8);}; -void() wiz_side3 =[ $hover3, wiz_side4 ] {ai_run(8);}; -void() wiz_side4 =[ $hover4, wiz_side5 ] {ai_run(8);}; -void() wiz_side5 =[ $hover5, wiz_side6 ] {ai_run(8);}; -void() wiz_side6 =[ $hover6, wiz_side7 ] {ai_run(8);}; -void() wiz_side7 =[ $hover7, wiz_side8 ] {ai_run(8);}; -void() wiz_side8 =[ $hover8, wiz_side1 ] {ai_run(8);}; - -void() wiz_run1 =[ $fly1, wiz_run2 ] {ai_run(16); -Wiz_idlesound(); -}; -void() wiz_run2 =[ $fly2, wiz_run3 ] {ai_run(16);}; -void() wiz_run3 =[ $fly3, wiz_run4 ] {ai_run(16);}; -void() wiz_run4 =[ $fly4, wiz_run5 ] {ai_run(16);}; -void() wiz_run5 =[ $fly5, wiz_run6 ] {ai_run(16);}; -void() wiz_run6 =[ $fly6, wiz_run7 ] {ai_run(16);}; -void() wiz_run7 =[ $fly7, wiz_run8 ] {ai_run(16);}; -void() wiz_run8 =[ $fly8, wiz_run9 ] {ai_run(16);}; -void() wiz_run9 =[ $fly9, wiz_run10 ] {ai_run(16);}; -void() wiz_run10 =[ $fly10, wiz_run11 ] {ai_run(16);}; -void() wiz_run11 =[ $fly11, wiz_run12 ] {ai_run(16);}; -void() wiz_run12 =[ $fly12, wiz_run13 ] {ai_run(16);}; -void() wiz_run13 =[ $fly13, wiz_run14 ] {ai_run(16);}; -void() wiz_run14 =[ $fly14, wiz_run1 ] {ai_run(16);}; - -void() wiz_fast1 =[ $magatt1, wiz_fast2 ] {ai_face();Wiz_StartFast();}; -void() wiz_fast2 =[ $magatt2, wiz_fast3 ] {ai_face();}; -void() wiz_fast3 =[ $magatt3, wiz_fast4 ] {ai_face();}; -void() wiz_fast4 =[ $magatt4, wiz_fast5 ] {ai_face();}; -void() wiz_fast5 =[ $magatt5, wiz_fast6 ] {ai_face();}; -void() wiz_fast6 =[ $magatt6, wiz_fast7 ] {ai_face();}; -void() wiz_fast7 =[ $magatt5, wiz_fast8 ] {ai_face();}; -void() wiz_fast8 =[ $magatt4, wiz_fast9 ] {ai_face();}; -void() wiz_fast9 =[ $magatt3, wiz_fast10 ] {ai_face();}; -void() wiz_fast10 =[ $magatt2, wiz_run1 ] {ai_face();SUB_AttackFinished(2);WizardAttackFinished();}; - -void() wiz_pain1 =[ $pain1, wiz_pain2 ] {}; -void() wiz_pain2 =[ $pain2, wiz_pain3 ] {}; -void() wiz_pain3 =[ $pain3, wiz_pain4 ] {}; -void() wiz_pain4 =[ $pain4, wiz_run1 ] {}; - -void() wiz_death1 =[ $death1, wiz_death2 ] { - -self.velocity_x = -200 + 400*random(); -self.velocity_y = -200 + 400*random(); -self.velocity_z = 100 + 100*random(); -self.flags = self.flags - (self.flags & FL_ONGROUND); -sound(self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM); -}; -void() wiz_death2 =[ $death2, wiz_death3 ] {}; -void() wiz_death3 =[ $death3, wiz_death4 ]{self.solid = SOLID_NOT;}; -void() wiz_death4 =[ $death4, wiz_death5 ] {}; -void() wiz_death5 =[ $death5, wiz_death6 ] {}; -void() wiz_death6 =[ $death6, wiz_death7 ] {}; -void() wiz_death7 =[ $death7, wiz_death8 ] {}; -void() wiz_death8 =[ $death8, wiz_death8 ] {}; - -void() wiz_die = -{ -// check for gib - if(self.health < -40) - { - sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_wizard.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - return; - } - - wiz_death1(); -}; - - -void(entity attacker, float damage) Wiz_Pain = -{ - sound(self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM); - if(random()*70 > damage) - return; // didn't flinch - - wiz_pain1(); -}; - - -void() Wiz_Missile = -{ - wiz_fast1(); -}; - -/*QUAKED monster_wizard (1 0 0) (-16 -16 -24) (16 16 40) Ambush -*/ -void() monster_wizard = -{ - if(deathmatch) - { - remove(self); - return; - } - precache_model ("progs/wizard.mdl"); - precache_model ("progs/h_wizard.mdl"); - precache_model ("progs/w_spike.mdl"); - - precache_sound("wizard/hit.wav"); // used by c code - precache_sound("wizard/wattack.wav"); - precache_sound("wizard/wdeath.wav"); - precache_sound("wizard/widle1.wav"); - precache_sound("wizard/widle2.wav"); - precache_sound("wizard/wpain.wav"); - precache_sound("wizard/wsight.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/wizard.mdl"); - - setsize (self, '-12 -12 -24', '12 12 40'); - self.health = 80; - - self.th_stand = wiz_stand1; - self.th_walk = wiz_walk1; - self.th_run = wiz_run1; - self.th_missile = Wiz_Missile; - self.th_pain = Wiz_Pain; - self.th_die = wiz_die; - - flymonster_start(); -}; diff --git a/QC/world.qc b/QC/world.qc index 69737369..76c86256 100644 --- a/QC/world.qc +++ b/QC/world.qc @@ -1,184 +1,175 @@ - -void() InitBodyQue; - -// HIPNOTIC -//JIM -void() InitBulletHoles; - - void() main = { - dprint ("main function\n"); - -// these are just commands the the prog compiler to copy these files - - precache_file ("progs.dat"); - precache_file ("gfx.wad"); - precache_file ("quake.rc"); - precache_file ("default.cfg"); - - precache_file ("end1.bin"); - precache_file2 ("end2.bin"); - - precache_file ("demo1.dem"); - precache_file ("demo2.dem"); - precache_file ("demo3.dem"); - -// -// these are all of the lumps from the cached.ls files -// - precache_file ("gfx/palette.lmp"); - precache_file ("gfx/colormap.lmp"); - - precache_file2 ("gfx/pop.lmp"); - - precache_file ("gfx/complete.lmp"); - precache_file ("gfx/inter.lmp"); - - precache_file ("gfx/ranking.lmp"); - precache_file ("gfx/vidmodes.lmp"); - precache_file ("gfx/finale.lmp"); - precache_file ("gfx/conback.lmp"); - precache_file ("gfx/qplaque.lmp"); - - precache_file ("gfx/menudot1.lmp"); - precache_file ("gfx/menudot2.lmp"); - precache_file ("gfx/menudot3.lmp"); - precache_file ("gfx/menudot4.lmp"); - precache_file ("gfx/menudot5.lmp"); - precache_file ("gfx/menudot6.lmp"); - - precache_file ("gfx/menuplyr.lmp"); - precache_file ("gfx/bigbox.lmp"); - precache_file ("gfx/dim_modm.lmp"); - precache_file ("gfx/dim_drct.lmp"); - precache_file ("gfx/dim_ipx.lmp"); - precache_file ("gfx/dim_tcp.lmp"); - precache_file ("gfx/dim_mult.lmp"); - precache_file ("gfx/mainmenu.lmp"); - - precache_file ("gfx/box_tl.lmp"); - precache_file ("gfx/box_tm.lmp"); - precache_file ("gfx/box_tr.lmp"); - - precache_file ("gfx/box_ml.lmp"); - precache_file ("gfx/box_mm.lmp"); - precache_file ("gfx/box_mm2.lmp"); - precache_file ("gfx/box_mr.lmp"); - - precache_file ("gfx/box_bl.lmp"); - precache_file ("gfx/box_bm.lmp"); - precache_file ("gfx/box_br.lmp"); - - precache_file ("gfx/sp_menu.lmp"); - precache_file ("gfx/ttl_sgl.lmp"); - precache_file ("gfx/ttl_main.lmp"); - precache_file ("gfx/ttl_cstm.lmp"); - - precache_file ("gfx/mp_menu.lmp"); - - precache_file ("gfx/netmen1.lmp"); - precache_file ("gfx/netmen2.lmp"); - precache_file ("gfx/netmen3.lmp"); - precache_file ("gfx/netmen4.lmp"); - precache_file ("gfx/netmen5.lmp"); - - precache_file ("gfx/sell.lmp"); - - precache_file ("gfx/help0.lmp"); - precache_file ("gfx/help1.lmp"); - precache_file ("gfx/help2.lmp"); - precache_file ("gfx/help3.lmp"); - precache_file ("gfx/help4.lmp"); - precache_file ("gfx/help5.lmp"); - - precache_file ("gfx/pause.lmp"); - precache_file ("gfx/loading.lmp"); - - precache_file ("gfx/p_option.lmp"); - precache_file ("gfx/p_load.lmp"); - precache_file ("gfx/p_save.lmp"); - precache_file ("gfx/p_multi.lmp"); - -// sounds loaded by C code + dprint("main function\n"); + + // these are just commands the the prog compiler to copy these files + precache_file("vrprogs.dat"); + precache_file("gfx.wad"); + precache_file("quake.rc"); + precache_file("default.cfg"); + + precache_file("end1.bin"); + precache_file2("end2.bin"); + + precache_file("demo1.dem"); + precache_file("demo2.dem"); + precache_file("demo3.dem"); + + // these are all of the lumps from the cached.ls files + precache_file("gfx/palette.lmp"); + precache_file("gfx/colormap.lmp"); + + precache_file2("gfx/pop.lmp"); + + precache_file("gfx/complete.lmp"); + precache_file("gfx/inter.lmp"); + + precache_file("gfx/ranking.lmp"); + precache_file("gfx/vidmodes.lmp"); + precache_file("gfx/finale.lmp"); + precache_file("gfx/conback.lmp"); + precache_file("gfx/qplaque.lmp"); + + precache_file("gfx/menudot1.lmp"); + precache_file("gfx/menudot2.lmp"); + precache_file("gfx/menudot3.lmp"); + precache_file("gfx/menudot4.lmp"); + precache_file("gfx/menudot5.lmp"); + precache_file("gfx/menudot6.lmp"); + + precache_file("gfx/menuplyr.lmp"); + precache_file("gfx/bigbox.lmp"); + precache_file("gfx/dim_modm.lmp"); + precache_file("gfx/dim_drct.lmp"); + precache_file("gfx/dim_ipx.lmp"); + precache_file("gfx/dim_tcp.lmp"); + precache_file("gfx/dim_mult.lmp"); + precache_file("gfx/mainmenu.lmp"); + + precache_file("gfx/box_tl.lmp"); + precache_file("gfx/box_tm.lmp"); + precache_file("gfx/box_tr.lmp"); + + precache_file("gfx/box_ml.lmp"); + precache_file("gfx/box_mm.lmp"); + precache_file("gfx/box_mm2.lmp"); + precache_file("gfx/box_mr.lmp"); + + precache_file("gfx/box_bl.lmp"); + precache_file("gfx/box_bm.lmp"); + precache_file("gfx/box_br.lmp"); + + precache_file("gfx/sp_menu.lmp"); + precache_file("gfx/ttl_sgl.lmp"); + precache_file("gfx/ttl_main.lmp"); + precache_file("gfx/ttl_cstm.lmp"); + + precache_file("gfx/mp_menu.lmp"); + + precache_file("gfx/netmen1.lmp"); + precache_file("gfx/netmen2.lmp"); + precache_file("gfx/netmen3.lmp"); + precache_file("gfx/netmen4.lmp"); + precache_file("gfx/netmen5.lmp"); + + precache_file("gfx/sell.lmp"); + + precache_file("gfx/help0.lmp"); + precache_file("gfx/help1.lmp"); + precache_file("gfx/help2.lmp"); + precache_file("gfx/help3.lmp"); + precache_file("gfx/help4.lmp"); + precache_file("gfx/help5.lmp"); + + precache_file("gfx/pause.lmp"); + precache_file("gfx/loading.lmp"); + + precache_file("gfx/p_option.lmp"); + precache_file("gfx/p_load.lmp"); + precache_file("gfx/p_save.lmp"); + precache_file("gfx/p_multi.lmp"); + + // sounds loaded by C code precache_sound("misc/menu1.wav"); precache_sound("misc/menu2.wav"); precache_sound("misc/menu3.wav"); + precache_sound("ambience/water1.wav"); precache_sound("ambience/wind2.wav"); -// shareware - precache_file ("maps/orig_start.bsp"); - precache_file ("maps/start.bsp"); - - precache_file ("maps/e1m1.bsp"); - precache_file ("maps/e1m2.bsp"); - precache_file ("maps/e1m3.bsp"); - precache_file ("maps/e1m4.bsp"); - precache_file ("maps/e1m5.bsp"); - precache_file ("maps/e1m6.bsp"); - precache_file ("maps/e1m7.bsp"); - precache_file ("maps/e1m8.bsp"); - -// registered - precache_file2 ("gfx/pop.lmp"); - - precache_file2 ("maps/e2m1.bsp"); - precache_file2 ("maps/e2m2.bsp"); - precache_file2 ("maps/e2m3.bsp"); - precache_file2 ("maps/e2m4.bsp"); - precache_file2 ("maps/e2m5.bsp"); - precache_file2 ("maps/e2m6.bsp"); - precache_file2 ("maps/e2m7.bsp"); - - precache_file2 ("maps/e3m1.bsp"); - precache_file2 ("maps/e3m2.bsp"); - precache_file2 ("maps/e3m3.bsp"); - precache_file2 ("maps/e3m4.bsp"); - precache_file2 ("maps/e3m5.bsp"); - precache_file2 ("maps/e3m6.bsp"); - precache_file2 ("maps/e3m7.bsp"); - - precache_file2 ("maps/e4m1.bsp"); - precache_file2 ("maps/e4m2.bsp"); - precache_file2 ("maps/e4m3.bsp"); - precache_file2 ("maps/e4m4.bsp"); - precache_file2 ("maps/e4m5.bsp"); - precache_file2 ("maps/e4m6.bsp"); - precache_file2 ("maps/e4m7.bsp"); - precache_file2 ("maps/e4m8.bsp"); - - precache_file2 ("maps/end.bsp"); - - precache_file2 ("maps/dm1.bsp"); - precache_file2 ("maps/dm2.bsp"); - precache_file2 ("maps/dm3.bsp"); - precache_file2 ("maps/dm4.bsp"); - precache_file2 ("maps/dm5.bsp"); - precache_file2 ("maps/dm6.bsp"); - - precache_file ("maps/hip1m1.bsp"); - precache_file ("maps/hip1m2.bsp"); - precache_file ("maps/hip1m3.bsp"); - precache_file ("maps/hip1m4.bsp"); - precache_file ("maps/hip1m5.bsp"); - precache_file ("maps/hip2m1.bsp"); - precache_file ("maps/hip2m2.bsp"); - precache_file ("maps/hip2m3.bsp"); - precache_file ("maps/hip2m4.bsp"); - precache_file ("maps/hip2m5.bsp"); - precache_file ("maps/hip2m6.bsp"); - precache_file ("maps/hip3m1.bsp"); - precache_file ("maps/hip3m2.bsp"); - precache_file ("maps/hip3m3.bsp"); - precache_file ("maps/hip3m4.bsp"); - precache_file ("maps/hipdm1.bsp"); - precache_file ("maps/hipend.bsp"); -}; + precache_sound("items/inv3.wav"); + + // shareware + precache_file("maps/start.bsp"); + + precache_file("maps/e1m1.bsp"); + precache_file("maps/e1m2.bsp"); + precache_file("maps/e1m3.bsp"); + precache_file("maps/e1m4.bsp"); + precache_file("maps/e1m5.bsp"); + precache_file("maps/e1m6.bsp"); + precache_file("maps/e1m7.bsp"); + precache_file("maps/e1m8.bsp"); + + // registered + precache_file2("gfx/pop.lmp"); + + precache_file2("maps/e2m1.bsp"); + precache_file2("maps/e2m2.bsp"); + precache_file2("maps/e2m3.bsp"); + precache_file2("maps/e2m4.bsp"); + precache_file2("maps/e2m5.bsp"); + precache_file2("maps/e2m6.bsp"); + precache_file2("maps/e2m7.bsp"); + + precache_file2("maps/e3m1.bsp"); + precache_file2("maps/e3m2.bsp"); + precache_file2("maps/e3m3.bsp"); + precache_file2("maps/e3m4.bsp"); + precache_file2("maps/e3m5.bsp"); + precache_file2("maps/e3m6.bsp"); + precache_file2("maps/e3m7.bsp"); + + precache_file2("maps/e4m1.bsp"); + precache_file2("maps/e4m2.bsp"); + precache_file2("maps/e4m3.bsp"); + precache_file2("maps/e4m4.bsp"); + precache_file2("maps/e4m5.bsp"); + precache_file2("maps/e4m6.bsp"); + precache_file2("maps/e4m7.bsp"); + precache_file2("maps/e4m8.bsp"); + + precache_file2("maps/end.bsp"); + + precache_file2("maps/dm1.bsp"); + precache_file2("maps/dm2.bsp"); + precache_file2("maps/dm3.bsp"); + precache_file2("maps/dm4.bsp"); + precache_file2("maps/dm5.bsp"); + precache_file2("maps/dm6.bsp"); + // HIPNOTIC + precache_file("maps/hip1m1.bsp"); + precache_file("maps/hip1m2.bsp"); + precache_file("maps/hip1m3.bsp"); + precache_file("maps/hip1m4.bsp"); + precache_file("maps/hip1m5.bsp"); + precache_file("maps/hip2m1.bsp"); + precache_file("maps/hip2m2.bsp"); + precache_file("maps/hip2m3.bsp"); + precache_file("maps/hip2m4.bsp"); + precache_file("maps/hip2m5.bsp"); + precache_file("maps/hip2m6.bsp"); + precache_file("maps/hip3m1.bsp"); + precache_file("maps/hip3m2.bsp"); + precache_file("maps/hip3m3.bsp"); + precache_file("maps/hip3m4.bsp"); + precache_file("maps/hipdm1.bsp"); + precache_file("maps/hipend.bsp"); +}; -entity lastspawn; +entity lastspawn; //======================= /*QUAKED worldspawn (0 0 0) ? @@ -196,28 +187,41 @@ World Types: void() worldspawn = { lastspawn = world; + + // FRIKBOT + BotInit(); + InitBodyQue(); -// HIPNOTIC -//JIM - InitBulletHoles(); + // HIPNOTIC + //JIM + InitBulletHoles(); -// custom map attributes + // custom map attributes if(self.model == "maps/e1m8.bsp") - cvar_set ("sv_gravity", "100"); + { + cvar_set("sv_gravity", "100"); + } else - cvar_set ("sv_gravity", "800"); + { + cvar_set("sv_gravity", "800"); + } + + // HONEY + fog_global_density = world.ideal_yaw; + fog_global_color = world.view_ofs; -// the area based ambient sounds MUST be the first precache_sounds + // the area based ambient sounds MUST be the first precache_sounds -// player precaches - W_Precache(); // get weapon precaches + // player precaches + W_Precache(); // get weapon precaches + RunePrecache(); // precache the runes -// sounds used from C physics code + // sounds used from C physics code precache_sound("demon/dland2.wav"); // landing thud precache_sound("misc/h2ohit1.wav"); // landing splash -// setup precaches allways needed + // setup precaches allways needed precache_sound("items/itembk2.wav"); // item respawn sound precache_sound("player/plyrjmp8.wav"); // player jump precache_sound("player/land.wav"); // player landing @@ -242,15 +246,24 @@ void() worldspawn = precache_sound("weapons/lstart.wav"); //lightning start precache_sound("items/damage3.wav"); + // HONEY + precache_sound("misc/secret.wav"); + precache_sound("honey/ting1.wav"); + precache_sound("honey/ting2.wav"); + precache_sound("honey/ting3.wav"); + precache_sound("honey/ting4.wav"); + + // VR: For weapon buttons + precache_sound("buttons/switch02.wav"); + precache_sound("misc/power.wav"); //lightning for boss -// player gib sounds + // player gib sounds precache_sound("player/gib.wav"); // player gib sound precache_sound("player/udeath.wav"); // player gib sound precache_sound("player/tornoff2.wav"); // gib sound -// player pain sounds - + // player pain sounds precache_sound("player/pain1.wav"); precache_sound("player/pain2.wav"); precache_sound("player/pain3.wav"); @@ -258,14 +271,14 @@ void() worldspawn = precache_sound("player/pain5.wav"); precache_sound("player/pain6.wav"); -// player death sounds + // player death sounds precache_sound("player/death1.wav"); precache_sound("player/death2.wav"); precache_sound("player/death3.wav"); precache_sound("player/death4.wav"); precache_sound("player/death5.wav"); -// ax sounds + // ax sounds precache_sound("weapons/ax1.wav"); // ax swoosh precache_sound("player/axhit1.wav"); // ax hit meat precache_sound("player/axhit2.wav"); // ax hit world @@ -282,10 +295,10 @@ void() worldspawn = precache_sound("misc/water1.wav"); // swimming precache_sound("misc/water2.wav"); // swimming -// HIPNOTIC -//MED 10/21/96 added flies sound + // HIPNOTIC + //MED 10/21/96 added flies sound precache_sound("misc/flys.wav"); -//MED 01/13/97 added explosion sounds + //MED 01/13/97 added explosion sounds precache_sound("misc/shortexp.wav"); precache_sound("misc/longexpl.wav"); precache_sound("misc/foot1.wav"); @@ -296,79 +309,102 @@ void() worldspawn = precache_sound("misc/foot6.wav"); precache_sound("misc/foot7.wav"); - precache_model ("progs/player.mdl"); - precache_model ("progs/eyes.mdl"); - precache_model ("progs/h_player.mdl"); + precache_model("progs/player.mdl"); + precache_model("progs/eyes.mdl"); + precache_model("progs/h_player.mdl"); //HIPNOTIC //MED 12/03/96 added player with hammer - precache_model ("progs/playham.mdl"); + precache_model("progs/playham.mdl"); - precache_model ("progs/gib1.mdl"); - precache_model ("progs/gib2.mdl"); - precache_model ("progs/gib3.mdl"); + precache_model("progs/gib1.mdl"); + precache_model("progs/gib2.mdl"); + precache_model("progs/gib3.mdl"); - precache_model ("progs/s_bubble.spr"); // drowning bubbles - precache_model ("progs/s_explod.spr"); // sprite explosion + precache_model("progs/s_bubble.spr"); // drowning bubbles + precache_model("progs/s_explod.spr"); // sprite explosion - precache_model ("progs/v_axe.mdl"); - precache_model ("progs/v_shot.mdl"); - precache_model ("progs/v_nail.mdl"); - precache_model ("progs/v_rock.mdl"); - precache_model ("progs/v_shot2.mdl"); - precache_model ("progs/v_nail2.mdl"); - precache_model ("progs/v_rock2.mdl"); + precache_model("progs/v_axe.mdl"); + precache_model("progs/v_shot.mdl"); + precache_model("progs/v_nail.mdl"); + precache_model("progs/v_rock.mdl"); + precache_model("progs/v_shot2.mdl"); + precache_model("progs/v_nail2.mdl"); + precache_model("progs/v_rock2.mdl"); // HIPNOTIC //MED 10/31/96 added precache for hip view models - precache_model ("progs/v_laserg.mdl"); - precache_model ("progs/v_hammer.mdl"); - precache_model ("progs/v_prox.mdl"); - precache_model ("progs/proxbomb.mdl"); + precache_model("progs/v_laserg.mdl"); + precache_model("progs/v_hammer.mdl"); + precache_model("progs/v_prox.mdl"); + precache_model("progs/proxbomb.mdl"); - precache_model ("progs/bolt.mdl"); // for lightning gun - precache_model ("progs/bolt2.mdl"); // for lightning gun - precache_model ("progs/bolt3.mdl"); // for boss shock - precache_model ("progs/lavaball.mdl"); // for testing + precache_model("progs/bolt.mdl"); // for lightning gun + precache_model("progs/bolt2.mdl"); // for lightning gun + precache_model("progs/bolt3.mdl"); // for boss shock + precache_model("progs/lavaball.mdl"); // for testing // HIPNOTIC //MED 10/18/96 added precache for laser cannon - precache_model ("progs/lasrspik.mdl"); + precache_model("progs/lasrspik.mdl"); + + precache_model("progs/missile.mdl"); + precache_model("progs/grenade.mdl"); + precache_model("progs/spike.mdl"); + precache_model("progs/s_spike.mdl"); - precache_model ("progs/missile.mdl"); - precache_model ("progs/grenade.mdl"); - precache_model ("progs/spike.mdl"); - precache_model ("progs/s_spike.mdl"); + precache_model("progs/backpack.mdl"); - precache_model ("progs/backpack.mdl"); + precache_model("progs/zom_gib.mdl"); - precache_model ("progs/zom_gib.mdl"); + precache_model("progs/v_light.mdl"); - precache_model ("progs/v_light.mdl"); + precache_model("progs/hand.mdl"); + precache_model("progs/wpnbutton.mdl"); - precache_model ("progs/hand.mdl"); precache_sound("fisthit.wav"); // fist hit world precache_sound("gunclick.wav"); // out of ammo precache_sound("forcegrab.wav"); // force grab + // ROGUE + // PGM Addition Sounds + precache_sound("enforcer/enfstop.wav"); // shield impact + precache_sound("plasma/explode.wav"); + precache_sound("plasma/flight.wav"); + precache_sound("plasma/fire.wav"); + precache_sound("shield/hit.wav"); + precache_sound("belt/use.wav"); + precache_sound("items/damage2.wav"); + + // ROGUE + // Lava Gun models - pgm change + precache_model("progs/v_lava.mdl"); + precache_model("progs/v_lava2.mdl"); + precache_model("progs/v_multi.mdl"); + precache_model("progs/v_multi2.mdl"); // ROGUE // PGM addition - precache_model ("progs/mervup.mdl"); - // TODO VR: (P2) rogue... + precache_model("progs/mervup.mdl"); // ROGUE -//ZOID-- + precache_model("progs/rockup.mdl"); + precache_model("progs/rockup_d.mdl"); + precache_model("progs/lspike.mdl"); + precache_model("progs/shield.mdl"); + precache_model("progs/p_shield.mdl"); + precache_model("progs/plasma.mdl"); + precache_model("progs/v_plasma.mdl"); + + // ROGUE + //ZOID-- // hook for CTF - precache_model ("progs/hook.mdl"); - precache_model ("progs/v_grpple.mdl"); -// precache_model ("progs/bit.mdl"); -//--ZOID + precache_model("progs/hook.mdl"); + precache_model("progs/v_grpple.mdl"); + //--ZOID -// -// Setup light animation tables. 'a' is total darkness, 'z' is maxbright. -// + // Setup light animation tables. 'a' is total darkness, 'z' is maxbright. // 0 normal lightstyle(0, "m"); @@ -413,19 +449,20 @@ void() worldspawn = // HIPNOTIC -//JIM + //JIM StopEarthQuake(); -//MED - // if(cvar("crosshair") == 2) - footsteps = 1; - // else - // footsteps = 0; + + //MED + footsteps = 1; }; void() StartFrame = { - teamplay = cvar("teamplay"); - skill = cvar("skill"); + // FRIKBOT + BotFrame(); + + teamplay = cvar_hget(cvarh_teamplay); + skill = cvar_hget(cvarh_skill); framecount = framecount + 1; }; @@ -462,6 +499,10 @@ void() InitBodyQue = // respawned elsewhere void(entity ent) CopyToBodyQue = { + // ROGUE + // PGM - support for new deathmatch skins on corpses too! + bodyque_head.skin = ent.skin; + bodyque_head.angles = ent.angles; bodyque_head.model = ent.model; bodyque_head.modelindex = ent.modelindex; @@ -470,11 +511,11 @@ void(entity ent) CopyToBodyQue = bodyque_head.movetype = ent.movetype; bodyque_head.velocity = ent.velocity; bodyque_head.flags = 0; - setorigin (bodyque_head, ent.origin); - setsize (bodyque_head, ent.mins, ent.maxs); + setorigin(bodyque_head, ent.origin); + setsize(bodyque_head, ent.mins, ent.maxs); bodyque_head = bodyque_head.owner; }; // TODO VR: (P2) ideas: // * monster variants -// * chance to spawn hipnotic monsters in normal quake +// * chance to spawn hipnotic/rogue monsters in normal quake diff --git a/QC/wpnforcegrab.qc b/QC/wpnforcegrab.qc deleted file mode 100644 index 9c8a41c7..00000000 --- a/QC/wpnforcegrab.qc +++ /dev/null @@ -1,335 +0,0 @@ - -// -// -// -// ---------------------------------------------------------------------------- -// CVar Getters -// ---------------------------------------------------------------------------- - -float() getForcegrabMode = -{ - return cvar("vr_forcegrab_mode"); -} - -float() getForcegrabRange = -{ - return cvar("vr_forcegrab_range"); -} - -float() getForcegrabRadius = -{ - return cvar("vr_forcegrab_radius"); -} - -float() getForcegrabPowermult = -{ - return cvar("vr_forcegrab_powermult"); -} - -float() getForcegrabEligibleParticles = -{ - return cvar("vr_forcegrab_eligible_particles"); -} - -float() getForcegrabEligibleHaptics = -{ - return cvar("vr_forcegrab_eligible_haptics"); -} - -// -// -// -// ---------------------------------------------------------------------------- -// Force Grab Utilities -// ---------------------------------------------------------------------------- - -float(float xHand, vector handPos, vector handRot, - float(vector xPos, float xHand, vector handPos, vector handRot) logicFn) PerformForceGrab = -{ - local float nTraces; - nTraces = ceil(getForcegrabRange() / getForcegrabRadius()); - - if(nTraces > 15) - { - nTraces = 15; - } - - makeforward(handRot); - - traceline(handPos, handPos + v_forward * getForcegrabRange(), FALSE, self); - if(logicFn(trace_endpos, xHand, handPos, handRot)) - { - return TRUE; - } - - local float i; - for(i = 0; i <= nTraces * 2; ++i) - { - traceline(handPos, handPos + v_forward * ((getForcegrabRadius() / 2.0) * i), TRUE, self); - if(logicFn(trace_endpos, xHand, handPos, handRot)) - { - return TRUE; - } - } - - return FALSE; -} - -float(float dist, float zmult) getForcegrabParabolaPower = -{ - local float power; - - power = (-0.00231424 * pow(dist, 2.0)) - + (2.01 * dist) - + 172.0; - - power *= zmult; - power *= getForcegrabPowermult(); - - return power; -} - -float(entity e) isEligibleForForceGrab -{ - if(e.classname != "thrown_weapon") - { - return FALSE; - } - - if((e.flags & FL_ONGROUND) && vlen(e.velocity) <= 10.f) - { - return TRUE; - } - - if((e.flags & FL_INWATER)) - { - return TRUE; - } - - return FALSE; -} - -void(float xHand) VRForceGrabEligibleHaptic = -{ - haptic(xHand, 0.0, 0.12, 75, 0.2); -} - -// -// -// -// ---------------------------------------------------------------------------- -// Force Grab Implementations -// ---------------------------------------------------------------------------- - -float(vector xPos, float xHand, vector handPos, vector handRot) -DoForceGrabImplParabola_Logic = -{ - local entity e; - for(e = findradius(xPos, getForcegrabRadius()); e; e = e.chain) - { - if(!isEligibleForForceGrab(e)) - { - continue; - } - - local vector tmpVec; - tmpVec = normalize(handPos - e.origin); - - e.origin += tmpVec * 0.1f; - - tmpVec = handPos - e.origin; - - local float zdist; - zdist = tmpVec_z; - - local float zmult; - - if(zdist >= 30.0) - { - zmult = pow(fabs(zdist) / 40.0, 0.2); - } - else - { - zmult = pow((10 + fabs(zdist)) / 40.0, 0.13); - } - - tmpVec_x = tmpVec_x / 2.0; - tmpVec_y = tmpVec_y / 2.0; - tmpVec_z = tmpVec_z * 2.0; - - if(tmpVec_z < 80) - { - tmpVec_z = 80; - } - - tmpVec = normalize(tmpVec); - - local float dist; - dist = vlen(handPos - e.origin); - - e.velocity = tmpVec * getForcegrabParabolaPower(dist, zmult); - - sound(e, CHAN_OTHER, "knight/sword2.wav", 0.7, ATTN_NORM); - sound(self, VRGetGunChannel(xHand), "forcegrab.wav", 0.65, ATTN_NORM); - - VRSetForceGrabbing(xHand, TRUE); - return TRUE; - } - - return FALSE; -} - -float(float xHand, vector handPos, vector handRot) DoForceGrabImplParabola = -{ - if(VRGetForceGrabbing(xHand)) - { - return FALSE; - } - - return PerformForceGrab(xHand, handPos, handRot, - DoForceGrabImplParabola_Logic); -} - -// --- - -float(vector xPos, float xHand, vector handPos, vector handRot) -DoForceGrabImplLinear_Logic = -{ - local entity e; - for(e = findradius(xPos, getForcegrabRadius()); e; e = e.chain) - { - if(!isEligibleForForceGrab(e)) - { - continue; - } - - if(e.throwhit == QVR_THROWHIT_HIT) - { - // TODO VR: (P2) remove this if condition? - if(e.flags & (FL_ONGROUND | FL_INWATER)) - { - e.throwhit = QVR_THROWHIT_FORCEGRAB; - e.movetype = MOVETYPE_FLYMISSILE; - - local vector tmpVec; - tmpVec = normalize(handPos - e.origin); - e.origin += tmpVec * 0.1f; - - sound(e, CHAN_OTHER, "knight/sword2.wav", 0.7, ATTN_NORM); - sound(self, VRGetGunChannel(xHand), "forcegrab.wav", 0.65, ATTN_NORM); - } - } - - if(e.throwhit == QVR_THROWHIT_FORCEGRAB) - { - local vector dir; - dir = normalize(handPos - e.origin); - - e.velocity = dir * 700; - e.velocity *= getForcegrabPowermult(); - - VRSetForceGrabbing(xHand, TRUE); - return TRUE; - } - } - - return FALSE; -} - -float(float xHand, vector handPos, vector handRot) DoForceGrabImplLinear = -{ - if(VRGetForceGrabbing(xHand)) - { - return FALSE; - } - - return PerformForceGrab(xHand, handPos, handRot, - DoForceGrabImplLinear_Logic); -} - -// --- - -float(vector xPos, float xHand, vector handPos, vector handRot) -DoForceGrabImplInstant_Logic = -{ - local entity e; - for(e = findradius(xPos, getForcegrabRadius()); e; e = e.chain) - { - if(!isEligibleForForceGrab(e)) - { - continue; - } - - wpnthrow_forcegrab_instant_ent(e, self, xHand); - - sound(e, CHAN_OTHER, "knight/sword2.wav", 0.7, ATTN_NORM); - sound(self, VRGetGunChannel(xHand), "forcegrab.wav", 0.65, ATTN_NORM); - - VRSetForceGrabbing(xHand, TRUE); - return TRUE; - } - - return FALSE; -} - -float(float xHand, vector handPos, vector handRot) DoForceGrabImplInstant = -{ - if(VRGetForceGrabbing(xHand)) - { - return FALSE; - } - - return PerformForceGrab(xHand, handPos, handRot, - DoForceGrabImplInstant_Logic); -} - -// --- - -float(vector xPos, float xHand, vector handPos, vector handRot) -ParticlesAndHapticsForEligibleForceGrabWeapon_Logic = -{ - local float doParticles, doHaptics; - doParticles = getForcegrabEligibleParticles(); - doHaptics = getForcegrabEligibleHaptics(); - - local entity e; - for(e = findradius(xPos, getForcegrabRadius()); e; e = e.chain) - { - if(!isEligibleForForceGrab(e)) - { - continue; - } - - if(doParticles) - { - if(random() < 0.4) - { - particle2(e.origin, '0 0 0', 9 /* gunforcegrab preset */, 1); - } - } - - if(doHaptics) - { - VRForceGrabEligibleHaptic(xHand); - } - - return TRUE; - } - - return FALSE; -} - -float(float xHand, vector handPos, vector handRot) ParticlesAndHapticsForEligibleForceGrabWeapons = -{ - local float doParticles, doHaptics; - doParticles = getForcegrabEligibleParticles(); - doHaptics = getForcegrabEligibleHaptics(); - - if(doParticles == FALSE && doHaptics == FALSE) - { - return FALSE; - } - - return PerformForceGrab(xHand, handPos, handRot, - ParticlesAndHapticsForEligibleForceGrabWeapon_Logic); -} diff --git a/QC/zombie.qc b/QC/zombie.qc deleted file mode 100644 index 0156520a..00000000 --- a/QC/zombie.qc +++ /dev/null @@ -1,550 +0,0 @@ -/* -============================================================================== - -ZOMBIE - -============================================================================== -*/ -$cd id1/models/zombie - -$origin 0 0 24 - -$base base -$skin skin - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 -$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 -$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 -$frame run13 run14 run15 run16 run17 run18 - -$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11 -$frame atta12 atta13 - -$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11 -$frame attb12 attb13 attb14 - -$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11 -$frame attc12 - -$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10 -$frame paina11 paina12 - -$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 -$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19 -$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28 - -$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 -$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18 - -$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 -$frame paind11 paind12 paind13 - -$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 -$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19 -$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28 -$frame paine29 paine30 - -$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6 - -float SPAWN_CRUCIFIED = 1; -//HIPNOTIC -float SPAWN_LYINGDOWN = 4; - -//============================================================================= - -.float inpain; - -void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand();}; -void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();}; -void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();}; -void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();}; -void() zombie_stand5 =[ $stand5, zombie_stand6 ] {ai_stand();}; -void() zombie_stand6 =[ $stand6, zombie_stand7 ] {ai_stand();}; -void() zombie_stand7 =[ $stand7, zombie_stand8 ] {ai_stand();}; -void() zombie_stand8 =[ $stand8, zombie_stand9 ] {ai_stand();}; -void() zombie_stand9 =[ $stand9, zombie_stand10 ] {ai_stand();}; -void() zombie_stand10 =[ $stand10, zombie_stand11 ] {ai_stand();}; -void() zombie_stand11 =[ $stand11, zombie_stand12 ] {ai_stand();}; -void() zombie_stand12 =[ $stand12, zombie_stand13 ] {ai_stand();}; -void() zombie_stand13 =[ $stand13, zombie_stand14 ] {ai_stand();}; -void() zombie_stand14 =[ $stand14, zombie_stand15 ] {ai_stand();}; -void() zombie_stand15 =[ $stand15, zombie_stand1 ] {ai_stand();}; - -void() zombie_cruc1 = [ $cruc_1, zombie_cruc2 ] { -if(random() < 0.1) - sound(self, CHAN_VOICE, "zombie/idle_w2.wav", 1, ATTN_STATIC);}; -void() zombie_cruc2 = [ $cruc_2, zombie_cruc3 ] {self.nextthink = time + 0.1 + random()*0.1;}; -void() zombie_cruc3 = [ $cruc_3, zombie_cruc4 ] {self.nextthink = time + 0.1 + random()*0.1;}; -void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] {self.nextthink = time + 0.1 + random()*0.1;}; -void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] {self.nextthink = time + 0.1 + random()*0.1;}; -void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] {self.nextthink = time + 0.1 + random()*0.1;}; - -void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(0);}; -void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(2);}; -void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);}; -void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);}; -void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);}; -void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);}; -void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);}; -void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);}; -void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);}; -void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);}; -void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);}; -void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(2);}; -void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);}; -void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);}; -void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);}; -void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);}; -void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);}; -void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);}; -void() zombie_walk19 =[ $walk19, zombie_walk1 ] { -ai_walk(0); -if(random() < 0.2) - sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);}; - -void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(1);self.inpain = 0;}; -void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);}; -void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);}; -void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);}; -void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);}; -void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);}; -void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);}; -void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);}; -void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(2);}; -void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(0);}; -void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(0);}; -void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(0);}; -void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(2);}; -void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);}; -void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(6);}; -void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(7);}; -void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(3);}; -void() zombie_run18 =[ $run18, zombie_run1 ] { -ai_run(8); -if(random() < 0.2) - sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); -if(random() > 0.8) - sound(self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); -}; - -/* -============================================================================= - -ATTACKS - -============================================================================= -*/ - -void() ZombieGrenadeTouch = -{ - if(other == self.owner) - return; // don't explode on owner - if(other.takedamage) - { - T_Damage (other, self, self.owner, 10 ); - sound(self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); - remove (self); - return; - } - sound(self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound - self.velocity = '0 0 0'; - self.avelocity = '0 0 0'; - self.touch = SUB_Remove; -}; - -/* -================ -ZombieFireGrenade -================ -*/ -void(vector st) ZombieFireGrenade = -{ - local entity missile; - local vector org; - - sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); - - missile = spawn(); - missile.owner = self; - missile.movetype = MOVETYPE_BOUNCE; - missile.solid = SOLID_BBOX; - -// calc org - org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up; - -// set missile speed - - makevectors (self.angles); - - missile.velocity = normalize(self.enemy.origin - org); - missile.velocity = missile.velocity * 600; - missile.velocity_z = 200; - - missile.avelocity = '3000 1000 2000'; - - missile.touch = ZombieGrenadeTouch; - -// set missile duration - missile.nextthink = time + 2.5; - missile.think = SUB_Remove; - - setmodel (missile, "progs/zom_gib.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, org); -}; - - -void() zombie_atta1 =[ $atta1, zombie_atta2 ] {ai_face();}; -void() zombie_atta2 =[ $atta2, zombie_atta3 ] {ai_face();}; -void() zombie_atta3 =[ $atta3, zombie_atta4 ] {ai_face();}; -void() zombie_atta4 =[ $atta4, zombie_atta5 ] {ai_face();}; -void() zombie_atta5 =[ $atta5, zombie_atta6 ] {ai_face();}; -void() zombie_atta6 =[ $atta6, zombie_atta7 ] {ai_face();}; -void() zombie_atta7 =[ $atta7, zombie_atta8 ] {ai_face();}; -void() zombie_atta8 =[ $atta8, zombie_atta9 ] {ai_face();}; -void() zombie_atta9 =[ $atta9, zombie_atta10 ] {ai_face();}; -void() zombie_atta10 =[ $atta10, zombie_atta11 ] {ai_face();}; -void() zombie_atta11 =[ $atta11, zombie_atta12 ] {ai_face();}; -void() zombie_atta12 =[ $atta12, zombie_atta13 ] {ai_face();}; -void() zombie_atta13 =[ $atta13, zombie_run1 ] {ai_face();ZombieFireGrenade('-10 -22 30');}; - -void() zombie_attb1 =[ $attb1, zombie_attb2 ] {ai_face();}; -void() zombie_attb2 =[ $attb2, zombie_attb3 ] {ai_face();}; -void() zombie_attb3 =[ $attb3, zombie_attb4 ] {ai_face();}; -void() zombie_attb4 =[ $attb4, zombie_attb5 ] {ai_face();}; -void() zombie_attb5 =[ $attb5, zombie_attb6 ] {ai_face();}; -void() zombie_attb6 =[ $attb6, zombie_attb7 ] {ai_face();}; -void() zombie_attb7 =[ $attb7, zombie_attb8 ] {ai_face();}; -void() zombie_attb8 =[ $attb8, zombie_attb9 ] {ai_face();}; -void() zombie_attb9 =[ $attb9, zombie_attb10 ] {ai_face();}; -void() zombie_attb10 =[ $attb10, zombie_attb11 ] {ai_face();}; -void() zombie_attb11 =[ $attb11, zombie_attb12 ] {ai_face();}; -void() zombie_attb12 =[ $attb12, zombie_attb13 ] {ai_face();}; -void() zombie_attb13 =[ $attb13, zombie_attb14 ] {ai_face();}; -void() zombie_attb14 =[ $attb13, zombie_run1 ] {ai_face();ZombieFireGrenade('-10 -24 29');}; - -void() zombie_attc1 =[ $attc1, zombie_attc2 ] {ai_face();}; -void() zombie_attc2 =[ $attc2, zombie_attc3 ] {ai_face();}; -void() zombie_attc3 =[ $attc3, zombie_attc4 ] {ai_face();}; -void() zombie_attc4 =[ $attc4, zombie_attc5 ] {ai_face();}; -void() zombie_attc5 =[ $attc5, zombie_attc6 ] {ai_face();}; -void() zombie_attc6 =[ $attc6, zombie_attc7 ] {ai_face();}; -void() zombie_attc7 =[ $attc7, zombie_attc8 ] {ai_face();}; -void() zombie_attc8 =[ $attc8, zombie_attc9 ] {ai_face();}; -void() zombie_attc9 =[ $attc9, zombie_attc10 ] {ai_face();}; -void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face();}; -void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face();}; -void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('-12 -19 29');}; - -void() zombie_missile = -{ - local float r; - - r = random(); - - if(r < 0.3) - zombie_atta1(); - else if(r < 0.6) - zombie_attb1(); - else - zombie_attc1(); -}; - - -/* -============================================================================= - -PAIN - -============================================================================= -*/ - -void() zombie_paina1 =[ $paina1, zombie_paina2 ] {sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);}; -void() zombie_paina2 =[ $paina2, zombie_paina3 ] {ai_painforward(3);}; -void() zombie_paina3 =[ $paina3, zombie_paina4 ] {ai_painforward(1);}; -void() zombie_paina4 =[ $paina4, zombie_paina5 ] {ai_pain(1);}; -void() zombie_paina5 =[ $paina5, zombie_paina6 ] {ai_pain(3);}; -void() zombie_paina6 =[ $paina6, zombie_paina7 ] {ai_pain(1);}; -void() zombie_paina7 =[ $paina7, zombie_paina8 ] {}; -void() zombie_paina8 =[ $paina8, zombie_paina9 ] {}; -void() zombie_paina9 =[ $paina9, zombie_paina10 ] {}; -void() zombie_paina10 =[ $paina10, zombie_paina11 ] {}; -void() zombie_paina11 =[ $paina11, zombie_paina12 ] {}; -void() zombie_paina12 =[ $paina12, zombie_run1 ] {}; - -void() zombie_painb1 =[ $painb1, zombie_painb2 ] {sound(self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);}; -void() zombie_painb2 =[ $painb2, zombie_painb3 ] {ai_pain(2);}; -void() zombie_painb3 =[ $painb3, zombie_painb4 ] {ai_pain(8);}; -void() zombie_painb4 =[ $painb4, zombie_painb5 ] {ai_pain(6);}; -void() zombie_painb5 =[ $painb5, zombie_painb6 ] {ai_pain(2);}; -void() zombie_painb6 =[ $painb6, zombie_painb7 ] {}; -void() zombie_painb7 =[ $painb7, zombie_painb8 ] {}; -void() zombie_painb8 =[ $painb8, zombie_painb9 ] {}; -void() zombie_painb9 =[ $painb9, zombie_painb10 ] {sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);}; -void() zombie_painb10 =[ $painb10, zombie_painb11 ] {}; -void() zombie_painb11 =[ $painb11, zombie_painb12 ] {}; -void() zombie_painb12 =[ $painb12, zombie_painb13 ] {}; -void() zombie_painb13 =[ $painb13, zombie_painb14 ] {}; -void() zombie_painb14 =[ $painb14, zombie_painb15 ] {}; -void() zombie_painb15 =[ $painb15, zombie_painb16 ] {}; -void() zombie_painb16 =[ $painb16, zombie_painb17 ] {}; -void() zombie_painb17 =[ $painb17, zombie_painb18 ] {}; -void() zombie_painb18 =[ $painb18, zombie_painb19 ] {}; -void() zombie_painb19 =[ $painb19, zombie_painb20 ] {}; -void() zombie_painb20 =[ $painb20, zombie_painb21 ] {}; -void() zombie_painb21 =[ $painb21, zombie_painb22 ] {}; -void() zombie_painb22 =[ $painb22, zombie_painb23 ] {}; -void() zombie_painb23 =[ $painb23, zombie_painb24 ] {}; -void() zombie_painb24 =[ $painb24, zombie_painb25 ] {}; -void() zombie_painb25 =[ $painb25, zombie_painb26 ] {ai_painforward(1);}; -void() zombie_painb26 =[ $painb26, zombie_painb27 ] {}; -void() zombie_painb27 =[ $painb27, zombie_painb28 ] {}; -void() zombie_painb28 =[ $painb28, zombie_run1 ] {}; - -void() zombie_painc1 =[ $painc1, zombie_painc2 ] {sound(self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);}; -void() zombie_painc2 =[ $painc2, zombie_painc3 ] {}; -void() zombie_painc3 =[ $painc3, zombie_painc4 ] {ai_pain(3);}; -void() zombie_painc4 =[ $painc4, zombie_painc5 ] {ai_pain(1);}; -void() zombie_painc5 =[ $painc5, zombie_painc6 ] {}; -void() zombie_painc6 =[ $painc6, zombie_painc7 ] {}; -void() zombie_painc7 =[ $painc7, zombie_painc8 ] {}; -void() zombie_painc8 =[ $painc8, zombie_painc9 ] {}; -void() zombie_painc9 =[ $painc9, zombie_painc10 ] {}; -void() zombie_painc10 =[ $painc10, zombie_painc11 ] {}; -void() zombie_painc11 =[ $painc11, zombie_painc12 ] {ai_painforward(1);}; -void() zombie_painc12 =[ $painc12, zombie_painc13 ] {ai_painforward(1);}; -void() zombie_painc13 =[ $painc13, zombie_painc14 ] {}; -void() zombie_painc14 =[ $painc14, zombie_painc15 ] {}; -void() zombie_painc15 =[ $painc15, zombie_painc16 ] {}; -void() zombie_painc16 =[ $painc16, zombie_painc17 ] {}; -void() zombie_painc17 =[ $painc17, zombie_painc18 ] {}; -void() zombie_painc18 =[ $painc18, zombie_run1 ] {}; - -void() zombie_paind1 =[ $paind1, zombie_paind2 ] {sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);}; -void() zombie_paind2 =[ $paind2, zombie_paind3 ] {}; -void() zombie_paind3 =[ $paind3, zombie_paind4 ] {}; -void() zombie_paind4 =[ $paind4, zombie_paind5 ] {}; -void() zombie_paind5 =[ $paind5, zombie_paind6 ] {}; -void() zombie_paind6 =[ $paind6, zombie_paind7 ] {}; -void() zombie_paind7 =[ $paind7, zombie_paind8 ] {}; -void() zombie_paind8 =[ $paind8, zombie_paind9 ] {}; -void() zombie_paind9 =[ $paind9, zombie_paind10 ] {ai_pain(1);}; -void() zombie_paind10 =[ $paind10, zombie_paind11 ] {}; -void() zombie_paind11 =[ $paind11, zombie_paind12 ] {}; -void() zombie_paind12 =[ $paind12, zombie_paind13 ] {}; -void() zombie_paind13 =[ $paind13, zombie_run1 ] {}; - -void() zombie_paine1 =[ $paine1, zombie_paine2 ] { -sound(self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); -self.health = 60; -}; -void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);}; -void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);}; -void() zombie_paine4 =[ $paine4, zombie_paine5 ] {ai_pain(3);}; -void() zombie_paine5 =[ $paine5, zombie_paine6 ] {ai_pain(1);}; -void() zombie_paine6 =[ $paine6, zombie_paine7 ] {ai_pain(2);}; -void() zombie_paine7 =[ $paine7, zombie_paine8 ] {ai_pain(1);}; -void() zombie_paine8 =[ $paine8, zombie_paine9 ] {ai_pain(1);}; -void() zombie_paine9 =[ $paine9, zombie_paine10 ] {ai_pain(2);}; -void() zombie_paine10 =[ $paine10, zombie_paine11 ] { -sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); -self.solid = SOLID_NOT; -}; -void() zombie_paine11 =[ $paine11, zombie_paine12 ] {self.nextthink = self.nextthink + 5;self.health = 60;}; -void() zombie_paine12 =[ $paine12, zombie_paine13 ]{ -// see if ok to stand up -self.health = 60; -sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); -self.solid = SOLID_SLIDEBOX; -if(!walkmove (0, 0)) -{ - self.think = zombie_paine11; - self.solid = SOLID_NOT; - return; -} -}; -void() zombie_paine13 =[ $paine13, zombie_paine14 ] {}; -void() zombie_paine14 =[ $paine14, zombie_paine15 ] {}; -void() zombie_paine15 =[ $paine15, zombie_paine16 ] {}; -void() zombie_paine16 =[ $paine16, zombie_paine17 ] {}; -void() zombie_paine17 =[ $paine17, zombie_paine18 ] {}; -void() zombie_paine18 =[ $paine18, zombie_paine19 ] {}; -void() zombie_paine19 =[ $paine19, zombie_paine20 ] {}; -void() zombie_paine20 =[ $paine20, zombie_paine21 ] {}; -void() zombie_paine21 =[ $paine21, zombie_paine22 ] {}; -void() zombie_paine22 =[ $paine22, zombie_paine23 ] {}; -void() zombie_paine23 =[ $paine23, zombie_paine24 ] {}; -void() zombie_paine24 =[ $paine24, zombie_paine25 ] {}; -void() zombie_paine25 =[ $paine25, zombie_paine26 ] {ai_painforward(5);}; -void() zombie_paine26 =[ $paine26, zombie_paine27 ] {ai_painforward(3);}; -void() zombie_paine27 =[ $paine27, zombie_paine28 ] {ai_painforward(1);}; -void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);}; -void() zombie_paine29 =[ $paine29, zombie_paine30 ] {}; -void() zombie_paine30 =[ $paine30, zombie_run1 ] {}; - -void() zombie_die = -{ - sound(self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_zombie.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); -}; - -/* -================= -zombie_pain - -Zombies can only be killed (gibbed) by doing 60 hit points of damage -in a single frame (rockets, grenades, quad shotgun, quad nailgun). - -A hit of 25 points or more (super shotgun, quad nailgun) will allways put it -down to the ground. - -A hit of from 10 to 40 points in one frame will cause it to go down if it -has been twice in two seconds, otherwise it goes into one of the four -fast pain frames. - -A hit of less than 10 points of damage (winged by a shotgun) will be ignored. - -FIXME: don't use pain_finished because of nightmare hack -================= -*/ -void(entity attacker, float take) zombie_pain = -{ - local float r; - - self.health = 60; // allways reset health - - if(take < 9) - return; // totally ignore - - if(self.inpain == 2) - return; // down on ground, so don't reset any counters - -// go down immediately if a big enough hit - if(take >= 25) - { - self.inpain = 2; - zombie_paine1(); - return; - } - - if(self.inpain) - { -// if hit again in next gre seconds while not in pain frames, definately drop - self.pain_finished = time + 3; - return; // currently going through an animation, don't change - } - - if(self.pain_finished > time) - { -// hit again, so drop down - self.inpain = 2; - zombie_paine1(); - return; - } - -// gp into one of the fast pain animations - self.inpain = 1; - - r = random(); - if(r < 0.25) - zombie_paina1(); - else if(r < 0.5) - zombie_painb1(); - else if(r < 0.75) - zombie_painc1(); - else - zombie_paind1(); -}; - -//HIPNOTIC -void() zombie_lay12 =[ $paine12, zombie_paine13 ] - {self.th_pain = zombie_pain;}; - -void(entity attacker, float damage) zombie_lay12_pain = -{ - zombie_lay12(); -} - -void() zombie_lay =[ $paine11, zombie_lay ] - { - self.th_stand = zombie_stand1; - self.th_pain = zombie_lay12_pain; - - self.nextthink = self.nextthink + 0.1; - self.health = 60; - - if(FindTarget ()) - { - zombie_lay12(); - return; - } - }; - -//HIPNOTIC -//============================================================================ - -/*QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) Crucified ambush lying_down - -If crucified, stick the bounding box 12 pixels back into a wall to look right. -If lying_down, the zombie will be lying down when spawned and will rise up -when awakened by the player. -*/ -void() monster_zombie = -{ - if(deathmatch) - { - remove(self); - return; - } - - precache_model ("progs/zombie.mdl"); - precache_model ("progs/h_zombie.mdl"); - precache_model ("progs/zom_gib.mdl"); - - precache_sound("zombie/z_idle.wav"); - precache_sound("zombie/z_idle1.wav"); - precache_sound("zombie/z_shot1.wav"); - precache_sound("zombie/z_gib.wav"); - precache_sound("zombie/z_pain.wav"); - precache_sound("zombie/z_pain1.wav"); - precache_sound("zombie/z_fall.wav"); - precache_sound("zombie/z_miss.wav"); - precache_sound("zombie/z_hit.wav"); - precache_sound("zombie/idle_w2.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/zombie.mdl"); - - setsize (self, '-12 -12 -24', '12 12 24'); - self.health = 60; - - self.th_stand = zombie_stand1; - self.th_walk = zombie_walk1; - self.th_run = zombie_run1; - self.th_pain = zombie_pain; - self.th_die = zombie_die; - self.th_missile = zombie_missile; - - if(self.spawnflags & SPAWN_CRUCIFIED) - { - self.movetype = MOVETYPE_NONE; - zombie_cruc1(); - } - else - walkmonster_start(); - - //HIPNOTIC - if(self.spawnflags & SPAWN_LYINGDOWN) - { - self.th_stand = zombie_lay; - } -}; diff --git a/QC_original/ogre.qc b/QC_original/ogre.qc deleted file mode 100644 index f0f6d50b..00000000 --- a/QC_original/ogre.qc +++ /dev/null @@ -1,481 +0,0 @@ -/* -============================================================================== - -OGRE - -============================================================================== -*/ - -$cd id1/models/ogre_c -$origin 0 0 24 -$base base -$skin base - -$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 - -$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 -$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 - -$frame run1 run2 run3 run4 run5 run6 run7 run8 - -$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 -$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 - -$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 -$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 - -$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 - -$frame pain1 pain2 pain3 pain4 pain5 - -$frame painb1 painb2 painb3 - -$frame painc1 painc2 painc3 painc4 painc5 painc6 - -$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 -$frame paind11 paind12 paind13 paind14 paind15 paind16 - -$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 -$frame paine11 paine12 paine13 paine14 paine15 - -$frame death1 death2 death3 death4 death5 death6 -$frame death7 death8 death9 death10 death11 death12 -$frame death13 death14 - -$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 -$frame bdeath7 bdeath8 bdeath9 bdeath10 - -$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 - -//============================================================================= - - -void() OgreGrenadeExplode = -{ - T_RadiusDamage (self, self.owner, 40, world); - sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); - - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_EXPLOSION); - WriteCoord (MSG_BROADCAST, self.origin_x); - WriteCoord (MSG_BROADCAST, self.origin_y); - WriteCoord (MSG_BROADCAST, self.origin_z); - - self.velocity = '0 0 0'; - self.touch = SUB_Null; - setmodel (self, "progs/s_explod.spr"); - self.solid = SOLID_NOT; - s_explode1 (); -}; - -void() OgreGrenadeTouch = -{ - if (other == self.owner) - return; // don't explode on owner - if (other.takedamage == DAMAGE_AIM) - { - OgreGrenadeExplode(); - return; - } - sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound - if (self.velocity == '0 0 0') - self.avelocity = '0 0 0'; -}; - -/* -================ -OgreFireGrenade -================ -*/ -void() OgreFireGrenade = -{ - local entity missile, mpuff; - - self.effects = self.effects | EF_MUZZLEFLASH; - - sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); - - missile = spawn (); - missile.owner = self; - missile.movetype = MOVETYPE_BOUNCE; - missile.solid = SOLID_BBOX; - -// set missile speed - - makevectors (self.angles); - - missile.velocity = normalize(self.enemy.origin - self.origin); - missile.velocity = missile.velocity * 600; - missile.velocity_z = 200; - - missile.avelocity = '300 300 300'; - - missile.angles = vectoangles(missile.velocity); - - missile.touch = OgreGrenadeTouch; - -// set missile duration - missile.nextthink = time + 2.5; - missile.think = OgreGrenadeExplode; - - setmodel (missile, "progs/grenade.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, self.origin); -}; - - -//============================================================================= - -/* -================ -chainsaw - -FIXME -================ -*/ -void(float side) chainsaw = -{ -local vector delta; -local float ldmg; - - if (!self.enemy) - return; - if (!CanDamage (self.enemy, self)) - return; - - ai_charge(10); - - delta = self.enemy.origin - self.origin; - - if (vlen(delta) > 100) - return; - - ldmg = (random() + random() + random()) * 4; - T_Damage (self.enemy, self, self, ldmg); - - if (side) - { - makevectors (self.angles); - if (side == 1) - SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); - else - SpawnMeatSpray (self.origin + v_forward*16, side * v_right); - } -}; - - -void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();}; -void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();}; -void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();}; -void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();}; -void() ogre_stand5 =[ $stand5, ogre_stand6 ] { -if (random() < 0.2) - sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); -ai_stand(); -}; -void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();}; -void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();}; -void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();}; -void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();}; - -void() ogre_walk1 =[ $walk1, ogre_walk2 ] {ai_walk(3);}; -void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);}; -void() ogre_walk3 =[ $walk3, ogre_walk4 ] { -ai_walk(2); -if (random() < 0.2) - sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); -}; -void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);}; -void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);}; -void() ogre_walk6 =[ $walk6, ogre_walk7 ] { -ai_walk(5); -if (random() < 0.1) - sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); -}; -void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);}; -void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);}; -void() ogre_walk9 =[ $walk9, ogre_walk10 ] {ai_walk(3);}; -void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);}; -void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);}; -void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);}; -void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);}; -void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);}; -void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);}; -void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);}; - -void() ogre_run1 =[ $run1, ogre_run2 ] {ai_run(9); -if (random() < 0.2) - sound (self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE); -}; -void() ogre_run2 =[ $run2, ogre_run3 ] {ai_run(12);}; -void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);}; -void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);}; -void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);}; -void() ogre_run6 =[ $run6, ogre_run7 ] {ai_run(4);}; -void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);}; -void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);}; - -void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11); -sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); -}; -void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);}; -void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);}; -void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);}; -void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);self.angles_y = self.angles_y + random()*25;}; -void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; -void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);}; -void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);}; -void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);}; - -void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6); -sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); -}; -void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);}; -void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);}; -void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);}; -void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);}; -void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0);}; -void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);}; -void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);}; -void() ogre_smash9 =[ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);}; -void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1);}; -void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0); -self.nextthink = self.nextthink + random()*0.2;}; // slight variation -void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge();}; -void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);}; -void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);}; - -void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();}; -void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();}; -void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();}; -void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireGrenade();}; -void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();}; -void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();}; -void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();}; - -void() ogre_pain1 =[ $pain1, ogre_pain2 ] {}; -void() ogre_pain2 =[ $pain2, ogre_pain3 ] {}; -void() ogre_pain3 =[ $pain3, ogre_pain4 ] {}; -void() ogre_pain4 =[ $pain4, ogre_pain5 ] {}; -void() ogre_pain5 =[ $pain5, ogre_run1 ] {}; - - -void() ogre_painb1 =[ $painb1, ogre_painb2 ] {}; -void() ogre_painb2 =[ $painb2, ogre_painb3 ] {}; -void() ogre_painb3 =[ $painb3, ogre_run1 ] {}; - - -void() ogre_painc1 =[ $painc1, ogre_painc2 ] {}; -void() ogre_painc2 =[ $painc2, ogre_painc3 ] {}; -void() ogre_painc3 =[ $painc3, ogre_painc4 ] {}; -void() ogre_painc4 =[ $painc4, ogre_painc5 ] {}; -void() ogre_painc5 =[ $painc5, ogre_painc6 ] {}; -void() ogre_painc6 =[ $painc6, ogre_run1 ] {}; - - -void() ogre_paind1 =[ $paind1, ogre_paind2 ] {}; -void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);}; -void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);}; -void() ogre_paind4 =[ $paind4, ogre_paind5 ] {ai_pain(4);}; -void() ogre_paind5 =[ $paind5, ogre_paind6 ] {}; -void() ogre_paind6 =[ $paind6, ogre_paind7 ] {}; -void() ogre_paind7 =[ $paind7, ogre_paind8 ] {}; -void() ogre_paind8 =[ $paind8, ogre_paind9 ] {}; -void() ogre_paind9 =[ $paind9, ogre_paind10 ] {}; -void() ogre_paind10=[ $paind10, ogre_paind11 ] {}; -void() ogre_paind11=[ $paind11, ogre_paind12 ] {}; -void() ogre_paind12=[ $paind12, ogre_paind13 ] {}; -void() ogre_paind13=[ $paind13, ogre_paind14 ] {}; -void() ogre_paind14=[ $paind14, ogre_paind15 ] {}; -void() ogre_paind15=[ $paind15, ogre_paind16 ] {}; -void() ogre_paind16=[ $paind16, ogre_run1 ] {}; - -void() ogre_paine1 =[ $paine1, ogre_paine2 ] {}; -void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);}; -void() ogre_paine3 =[ $paine3, ogre_paine4 ] {ai_pain(9);}; -void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);}; -void() ogre_paine5 =[ $paine5, ogre_paine6 ] {}; -void() ogre_paine6 =[ $paine6, ogre_paine7 ] {}; -void() ogre_paine7 =[ $paine7, ogre_paine8 ] {}; -void() ogre_paine8 =[ $paine8, ogre_paine9 ] {}; -void() ogre_paine9 =[ $paine9, ogre_paine10 ] {}; -void() ogre_paine10=[ $paine10, ogre_paine11 ] {}; -void() ogre_paine11=[ $paine11, ogre_paine12 ] {}; -void() ogre_paine12=[ $paine12, ogre_paine13 ] {}; -void() ogre_paine13=[ $paine13, ogre_paine14 ] {}; -void() ogre_paine14=[ $paine14, ogre_paine15 ] {}; -void() ogre_paine15=[ $paine15, ogre_run1 ] {}; - - -void(entity attacker, float damage) ogre_pain = -{ - local float r; - -// don't make multiple pain sounds right after each other - if (self.pain_finished > time) - return; - - sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); - - r = random(); - - if (r < 0.25) - { - ogre_pain1 (); - self.pain_finished = time + 1; - } - else if (r < 0.5) - { - ogre_painb1 (); - self.pain_finished = time + 1; - } - else if (r < 0.75) - { - ogre_painc1 (); - self.pain_finished = time + 1; - } - else if (r < 0.88) - { - ogre_paind1 (); - self.pain_finished = time + 2; - } - else - { - ogre_paine1 (); - self.pain_finished = time + 2; - } -}; - -void() OgreDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - self.ammo_rockets = 2; - DropBackpack(); - - if(entPlayer != world && random() > 0.65) - { - if(!TryDrop(entPlayer, WID_GRENADE_LAUNCHER, 0.5)) - if(!TryDrop(entPlayer, WID_PROIXIMITY_GUN, 0.4)) - if(!TryDrop(entPlayer, WID_ROCKET_LAUNCHER, 0.4)) - if(!TryDrop(entPlayer, WID_SUPER_NAILGUN, 0.2)) - if(!TryDrop(entPlayer, WID_NAILGUN, 0.2)) - if(!TryDrop(entPlayer, WID_SUPER_SHOTGUN, 0.1)) - if(!TryDrop(entPlayer, WID_SHOTGUN, 0.1)) - if(!TryDrop(entPlayer, WID_AXE, 0.1)) - { /* Intentionally empty. */ } - } -} - -void() ogre_die1 =[ $death1, ogre_die2 ] {}; -void() ogre_die2 =[ $death2, ogre_die3 ] {}; -void() ogre_die3 =[ $death3, ogre_die4 ] -{ OgreDrop(); }; -void() ogre_die4 =[ $death4, ogre_die5 ] {}; -void() ogre_die5 =[ $death5, ogre_die6 ] {}; -void() ogre_die6 =[ $death6, ogre_die7 ] {}; -void() ogre_die7 =[ $death7, ogre_die8 ] {}; -void() ogre_die8 =[ $death8, ogre_die9 ] {}; -void() ogre_die9 =[ $death9, ogre_die10 ] {}; -void() ogre_die10 =[ $death10, ogre_die11 ] {}; -void() ogre_die11 =[ $death11, ogre_die12 ] {}; -void() ogre_die12 =[ $death12, ogre_die13 ] {}; -void() ogre_die13 =[ $death13, ogre_die14 ] {}; -void() ogre_die14 =[ $death14, ogre_die14 ] {}; - -void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {}; -void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {ai_forward(5);}; -void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] -{ OgreDrop(); }; -void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);}; -void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);}; -void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);}; -void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);}; -void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {}; -void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {}; -void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {}; - -void() ogre_die = -{ -// check for gib - if (self.health < -80) - { - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_ogre.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); - return; - } - - sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); - - if (random() < 0.5) - ogre_die1 (); - else - ogre_bdie1 (); -}; - -void() ogre_melee = -{ - if (random() > 0.5) - ogre_smash1 (); - else - ogre_swing1 (); -}; - - -/*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush - -*/ -void() monster_ogre = -{ - if (deathmatch) - { - remove(self); - return; - } - precache_model ("progs/ogre.mdl"); - precache_model ("progs/h_ogre.mdl"); - precache_model ("progs/grenade.mdl"); - - precache_sound ("ogre/ogdrag.wav"); - precache_sound ("ogre/ogdth.wav"); - precache_sound ("ogre/ogidle.wav"); - precache_sound ("ogre/ogidle2.wav"); - precache_sound ("ogre/ogpain1.wav"); - precache_sound ("ogre/ogsawatk.wav"); - precache_sound ("ogre/ogwake.wav"); - - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/ogre.mdl"); - - setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 200; - - self.th_stand = ogre_stand1; - self.th_walk = ogre_walk1; - self.th_run = ogre_run1; - self.th_die = ogre_die; - self.th_melee = ogre_melee; - self.th_missile = ogre_nail1; - self.th_pain = ogre_pain; - - walkmonster_start(); -}; - -void() monster_ogre_marksman = -{ - monster_ogre (); -}; - - diff --git a/QC_other/QC_arcane/ai_ammoresist.qc b/QC_other/QC_arcane/ai_ammoresist.qc new file mode 100644 index 00000000..5e089b6e --- /dev/null +++ b/QC_other/QC_arcane/ai_ammoresist.qc @@ -0,0 +1,166 @@ +/*====================================================================== + MONSTER AMMO RESISTANCE SYSTEM + +======================================================================*/ + +float(entity targ, float resist_type, float damage) Resist_Damage = +{ + local float ret_damage; + + if (resist_type == IT_SHELLS) ret_damage = damage * (1 - targ.resist_shells); + else if (resist_type == IT_NAILS) ret_damage = damage * (1 - targ.resist_nails); + else if (resist_type == IT_ROCKETS) ret_damage = damage * (1 - targ.resist_rockets); + else if (resist_type == IT_CELLS) ret_damage = damage * (1 - targ.resist_cells); + + return ret_damage; +}; + +//---------------------------------------------------------------------- +// Double check that all ammo resistance are within range +//---------------------------------------------------------------------- +void(entity targ) Resist_CheckRange = +{ + // Check Ammo resistance is within range + if (targ.resist_shells < 0) targ.resist_shells = 0; + else if (targ.resist_shells > 1) targ.resist_shells = 1; + if (targ.resist_nails < 0) targ.resist_nails = 0; + else if (targ.resist_nails > 1) targ.resist_nails = 1; + if (targ.resist_rockets < 0) targ.resist_rockets = 0; + else if (targ.resist_rockets > 1) targ.resist_rockets = 1; + if (targ.resist_cells < 0) targ.resist_cells = 0; + else if (targ.resist_cells > 1) targ.resist_cells = 1; +}; + +//---------------------------------------------------------------------- +// Save current ammo resistance to ammo variables +// ** Ammo variables are used for backpack, use with caution +//---------------------------------------------------------------------- +void(entity targ) Resist_Save = +{ + // Store the ammo resistance for switching later + targ.ammo_shells = targ.resist_shells; + targ.ammo_nails = targ.resist_nails; + targ.ammo_rockets = targ.resist_rockets; + targ.ammo_cells = targ.resist_cells; +}; + +//---------------------------------------------------------------------- +// Switch resistance from FULL to monster default +// This works with Resist_Save system, use with caution +// Designed for bosses which don't drop things on death +//---------------------------------------------------------------------- +void(entity targ, float artype) Resist_ChangeType = +{ + if (artype == TRUE) { + // Complete resistance to everything + targ.resist_shells = targ.resist_nails = 1; + targ.resist_rockets = targ.resist_cells = 1; + targ.pain_finished = LARGE_TIMER; + } + else { + // Default ammo resist, rocket/cell immunnity + targ.resist_shells = targ.ammo_shells; + targ.resist_nails = targ.ammo_nails; + targ.resist_rockets = targ.ammo_rockets; + targ.resist_cells = targ.ammo_cells; + targ.pain_finished = time + 1; + } + dprint("\b[AMMO RESIST]\b"); + dprint(" S="); dprint(ftos(targ.resist_shells)); + dprint(" N="); dprint(ftos(targ.resist_nails)); + dprint(" R="); dprint(ftos(targ.resist_rockets)); + dprint(" C="); dprint(ftos(targ.resist_cells)); + dprint("\n"); +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org, vector vel, float damage) Resist_Shells = +{ + if (targ.health > 0 && targ.pain_finished < time) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + + // Drastically reduce blood particles + if (targ.resist_shells < 1) { + SpawnBlood (targ, org, vel*0.2, rint(DAMAGE_SHELL*targ.resist_shells)); + } + if (random() < 0.3) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + if (random() < 0.5) WriteByte (MSG_BROADCAST, TE_SPIKE); + else WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + if (random() < 0.5) SpawnProjectileSmoke(org, 200, 50, 150); + } +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Nails = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_nails < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + if (random() < 0.5) WriteByte (MSG_BROADCAST, TE_SPIKE); + else WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + if (random() < 0.5) SpawnProjectileSmoke(org, 200, 50, 150); +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Rockets = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_rockets < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + SpawnExplosion(EXPLODE_BURST_SMOKE,org,SOUND_RESIST_ROCKET); + SpawnProjectileSmoke(org, 200, 50, 150); + SpawnProjectileSmoke(org, 200, 50, 250); + SpawnProjectileSmoke(org, 300, 50, 150); + // Can the target bleed? + if (targ.resist_rockets < 1) { + SpawnProjectileMeat(targ, org, 200, 50, 150); + SpawnProjectileMeat(targ, org, 300, 50, 150); + } +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Lightning = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_cells < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + // Don't spawn smoke constantly (let the sprite finish) + if (self.lightning_timer < time) { + self.lightning_timer = time + 0.3; + SpawnExplosion(EXPLODE_BURST_SMOKE, org, ""); + } + // Spawn a random smoke particle and chance of blood + SpawnProjectileSmoke(org, 200, 50, 150); + if (targ.resist_cells < 1 && random() < 0.4) + SpawnProjectileMeat(targ, org, 200, 50, 150); +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Plasma = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_cells < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + SpawnExplosion(EXPLODE_BURST_SMOKE, org, SOUND_PLASMA_HIT); + SpawnProjectileSmoke(org, 200, 50, 150); + SpawnProjectileSmoke(org, 200, 50, 250); + SpawnProjectileSmoke(org, 300, 50, 150); + // Can the target bleed? + if (targ.resist_cells < 1 && random() < 0.3) + SpawnProjectileMeat(targ,org, 200, 50, 150); +}; + diff --git a/QC_other/QC_arcane/ai_checkattack.qc b/QC_other/QC_arcane/ai_checkattack.qc new file mode 100644 index 00000000..2eca4d47 --- /dev/null +++ b/QC_other/QC_arcane/ai_checkattack.qc @@ -0,0 +1,2307 @@ +/*====================================================================== + SPECIFIC AI LOGIC ROUTINES + + * Specific routines for certain monster types to determine if + they can melee or missile (range) attack + * Always working 1 frame behind the ai_run function + * Moved demon/wizard checkattack routines here (split locations) + + CheckAttack (generic) +======================================================================*/ +void() CheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT) && self.th_melee) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0 && self.th_missile) { + if (time < self.attack_finished) return; + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + return; + } + + //---------------------------------------------------------------------- + // Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (!self.th_missile) return; + if (time < self.attack_finished) return; + if (enemy_range == RANGE_FAR) return; + + // range < 120 map units + if (enemy_range == RANGE_MELEE) { + self.attack_chance = 0.9; + self.attack_finished = 0; + } + // range < 500 map units + else if (enemy_range == RANGE_NEAR) { + if (self.th_melee) self.attack_chance = 0.2; + else self.attack_chance = 0.4; + } + // range < 1000 map units + else if (enemy_range == RANGE_MID) { + if (self.th_melee) self.attack_chance = 0.05; + else self.attack_chance = 0.1; + } + else self.attack_chance = 0; + + if (random () < self.attack_chance) { + SUB_AttackFinished (2*random()); + self.th_missile (); + } +}; + +/*====================================================================== + SoldierCheckAttack (Rocket version has melee) +======================================================================*/ +void() SoldierCheckAttack = +{ + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // If enemy is within melee range, just keep on attacking! + // Original ID behaviour is 10% chance to not attack in melee range + // This has changed so that the soldier is more agressive up close + // The army rocket has a special behaviour for melee range + //---------------------------------------------------------------------- + if (self.classtype != CT_MONARMYROCKET && enemy_range == RANGE_MELEE) { + self.attack_state = AS_MISSILE; + return; + } + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + + if (self.classtype == CT_MONARMYROCKET) { + if (ai_checkmelee(MONAI_RANGEARMYR)) { + self.oldorigin = self.origin; + // If move backward works, run back animation + if (walkmove(self.angles_y+180, 16)) { + setorigin(self, self.oldorigin); + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + else setorigin(self, self.oldorigin); + } + } + + //---------------------------------------------------------------------- + // Range attack (bullets) + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + if (enemy_range == RANGE_FAR) return; + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.4; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.05; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + self.attack_state = AS_MISSILE; + if (self.classtype == CT_MONARMYROCKET) SUB_AttackFinished (2 + random()); + else SUB_AttackFinished (1 + random()); + if (random() < 0.3) self.lefty = !self.lefty; + } +}; + +/*====================================================================== + PyrpCheckAttack (Melee=FIRE!) +======================================================================*/ +void() PyroCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + if (ai_checkmelee(MONAI_RANGEPYRO)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } +}; + +/*====================================================================== + ShamCheckAttack +======================================================================*/ +void() ShamCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(claws/overhead smash) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESHAM)) { + self.attack_state = AS_MELEE; + // Don't wait for next frame, melee attack straight away + // (different id behaviour) + self.th_melee (); + return; + } + + //---------------------------------------------------------------------- + // Range attack (lightning) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + if (self.enemydist > MONAI_SHAMRANGE && !self.attack_sniper) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + SUB_AttackFinished (2 + (2*random())); + self.attack_state = AS_MISSILE; +}; + +/*====================================================================== + GugCheckAttack +======================================================================*/ +void() GugCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(left/right smack) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEGUG)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + + //---------------------------------------------------------------------- + // Range attack (Bile Bombs) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; +}; + +/*====================================================================== + BogLordCheckAttack (Shambler model) +======================================================================*/ +void() BogLordCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(overhead slime balls) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_BOGLORDMELEE)) { + // Easy to dodge ball attack, bolts are more difficult + if (self.spawnflags & MON_BOGL_STRONG) + self.attack_chance = random(); + else { + // Easy = 10%, Normal = 20%, Hard = 30%, NM = 40% + self.attack_chance = 0.1 + (skill * 0.1); + } + if (random() < self.attack_chance) self.attack_state = AS_MISSILE; + else { self.attack_state = AS_MELEE; self.th_melee (); } + return; + } + + //---------------------------------------------------------------------- + // Range attack (Fast volley of bolts) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Setup attack chance of using fast bolt attack more often + // easy=0.0, norm=0.2, hard=0.4, nm=0.6 + // The stronger version is just pure random 50/50 + if (self.spawnflags & MON_BOGL_STRONG) self.attack_chance = random(); + else self.attack_chance = 0.0 + (skill * 0.2); + + // Give the monster a chance to move if not tethered + if (!self.tethered) SUB_AttackFinished (1 + 2*random()); + + // Check for random chance to keep doing overhead smash + if (random() > self.attack_chance) { + self.attack_state = AS_MELEE; + self.th_melee (); + } + // Range attack harder to dodge at higher projectile speed + else self.attack_state = AS_MISSILE; +}; + +/*====================================================================== + SeekerCheckAttack +======================================================================*/ +void() SeekerCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee punch + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELRAGESEEKER)) { + // Need both arms for melee animation + if (self.state == 0) { + self.attack_state = AS_MELEE; + self.th_melee (); + } + // Instantly go to rocket range attack + // If the player is too close + else { + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + random()); + } + return; + } + + //---------------------------------------------------------------------- + // Range attack (rockets or lasers) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + SantaCheckAttack +======================================================================*/ +void() SantaCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Antlers) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESANTA)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Let sightsound play out before machine gun attack + //---------------------------------------------------------------------- + if (self.attack_rage) { + self.attack_finished = time + 3; + self.attack_rage = FALSE; + } + //---------------------------------------------------------------------- + // Range attack (snowball machine gun) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Check if gun is being blocked (extra wide check) + if ( visblocked_wide(self.enemy, self.attack_offset, '0 0 0') ) return; + + // Straight to snow machine gun! + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + RaindeerCheckAttack +======================================================================*/ +void() RaindeerCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Antlers) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEERAINDEER)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (rockets) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + SnowmanCheckAttack +======================================================================*/ +void() SnowmanCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Antlers) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESNOWMAN)) { + self.attack_state = AS_MELEE; + // As soon as out of melee, range attack! + self.attack_finished = 0; + return; + } + //---------------------------------------------------------------------- + // Range attack (rockets) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + GolemCheckAttack +======================================================================*/ +void() GolemCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(Punch/Pound) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (self.enemydist < MONAI_MELEEGOLEM) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Floor stomp attack + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_GOLEMRANGE && random() < 0.3) { + SUB_AttackFinished (1 + 2*random()); + self.th_slide (); + return; + } + //---------------------------------------------------------------------- + // Range attack (Rock Attack) + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + if (!self.th_missile) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 24')) { + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); + } +}; + +/*====================================================================== + ShalCheckAttack +======================================================================*/ +void() ShalCheckAttack = +{ + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // Slower spawnrate for minion eggs than voreballs + if (!(self.spawnflags & MON_SHALRATH_MINIONS)) { + if (visblocked(self.enemy)) return; + SUB_AttackFinished (2*random()); + } + else SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + // Minion spawning shalraths should maintain distance + // Use the new turn and side walk function to stay mid range + if (self.spawnflags & MON_SHALRATH_MINIONS && self.enemy.flags & FL_CLIENT) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // If too far away from enemy, move in a straight line + if (self.enemydist > MONAI_RANGESHAL) { + self.attack_state = AS_STRAIGHT; + } + else { + // If range attack still blocked, move sideway/backwards + if (time < self.attack_finished) { + // If too close, move backwards and sideways so that + // there is plenty of room to spawn more minions + if (self.enemydist < MONAI_RANGESHAL2) + self.attack_state = AS_BACKWARD; + else self.attack_state = AS_SIDESTEP; + // straight away move + return; + } + } + } + + // Does the monster have a clear shot to the enemy? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (enemy_range == RANGE_FAR) return; + if (time < self.attack_finished) return; + + // random chance based on distance to enemy + if (enemy_range == RANGE_MELEE) { + self.attack_chance = 0.9; // < 120 + self.attack_finished = 0; // If enemy really close, constantly fire! + } + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.4; // < 500 + else if (enemy_range == RANGE_MID) self.attack_chance = 0.1; // < 1000 + else self.attack_chance = 0; + + // Random chance of range attack? + if (random () < self.attack_chance) { + // Slower spawnrate for minion eggs than voreballs + if (self.spawnflags & MON_SHALRATH_MINIONS) SUB_AttackFinished (1 + 2*random()); + else SUB_AttackFinished (2*random()); + self.attack_state = AS_MISSILE; + } +}; + +/*====================================================================== + EliminatorCheckAttack (Range=Plasma) +======================================================================*/ +void() EliminatorCheckAttack = +{ + //---------------------------------------------------------------------- + // Range attack (Plasma) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // This is a range check for firing plasma bolts + // Could easily work with massive range and attack_sniper + if (enemy_range == RANGE_FAR && !self.attack_sniper) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Aggressive range attack, no % chances + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); +}; + +/*====================================================================== + DefenderCheckAttack (Melee=SSG / Range=GL) +======================================================================*/ +void() DefenderCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Super Shotgun to face) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_RANGEDEFSSG)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // Range attack (Grenades) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // This is a range check for firing grenades + // It need to be less than 600 units, otherwise likely to miss + // No point having attack_sniper versions firing early + if (enemy_range == RANGE_FAR) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Check enemy for grenade resistance? + if (self.enemy.bouncegrenade) { + self.attack_state = AS_MELEE; + self.th_melee (); + } + else { + // Aggressive range attack, no % chances + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + } +}; + +/*====================================================================== + OgreCheckAttack + Vanilla, Hunter, Fishing and Mace versions +======================================================================*/ +void() OgreCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (chainsaw) + //---------------------------------------------------------------------- + if (self.enemydist < self.meleerange) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (grenades) + // strangely enough the chance attack percentages are not used + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Check enemy for grenade resistance? + // Move closer to enemy instead for melee range + if (!self.enemy.bouncegrenade) { + self.attack_state = AS_MISSILE; + // Fishing ogre fires much faster than standard + if (self.classtype == CT_MONOGREFISH) + SUB_AttackFinished (1 + random()); + else SUB_AttackFinished (1 + 2*random()); + } +}; + +/*====================================================================== + OgreHamCheckAttack (Hammer only, much faster) +======================================================================*/ +void() OgreHamCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Special hammer attack) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_HOGRE_METAL) { + if (self.enemydist < MONAI_MELEEOGREHAM) { + self.attack_state = AS_MELEE; + return; + } + } + else { + // Default melee attack, just a simple hammer + if (self.enemydist < self.meleerange) { + self.attack_state = AS_MELEE; + return; + } + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (grenades) + // strangely enough the chance attack percentages are not used + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + random()); +}; + +/*====================================================================== + FreddieCheckAttack +======================================================================*/ +void() FreddieCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (chainsaw) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFREDDIE)) { + // Hard/Nightmare skill have chance to ignore melee attacks + if (skill < SKILL_HARD || (skill > SKILL_NORMAL && random() < 0.7)) { + self.attack_state = AS_MELEE; + return; + } + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (spikes/laser) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // If Freddie too far away for stationary attack? + if (self.enemydist > MONAI_RANGEFREDDIE && skill > SKILL_EASY) { + // Work out vector angle of enemy infront + makevectors (self.angles); + self.pos1 = normalize (self.enemy.origin - self.origin); + self.lip = self.pos1 * v_forward; + // Is the enemy infront of freddie? + if (self.lip > 0.8) { + self.cnt = 0; + self.attack_timer = TRUE; + SUB_AttackFinished (1 + random()); + } + else { + // Small random chance of stop+fire + if (random() < 0.2) { + self.attack_timer = FALSE; + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + } + } + } + else { + // Close to enemy, stop+fire + self.attack_timer = FALSE; + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + } +}; + +/*====================================================================== + WizardCheckAttack (No melee attack) +======================================================================*/ +void() WizardCheckAttack = +{ + //---------------------------------------------------------------------- + // Range attack (spit) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (visblocked(self.enemy)) return; + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + // The original id behaviour is wizards run until within range + //---------------------------------------------------------------------- + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + self.attack_state = AS_MISSILE; + } + //---------------------------------------------------------------------- + // If turret, then do not move sideways + // otherwise keep moving forward to enemy target + //---------------------------------------------------------------------- + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } +}; + +/*====================================================================== + SkullWizardCheckAttack (No melee attack) +======================================================================*/ +void() SkullWizCheckAttack = +{ + //---------------------------------------------------------------------- + // Teleport away if player too close + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEESKULLW && !self.bodystatic) { + self.attack_state = AS_MELEE; + return; + } + // make sure enemy is stationary (turret) + else self.attack_state = AS_TURRET; + + //---------------------------------------------------------------------- + // Range / missile attack (skull attack) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); +}; + +/*====================================================================== + LostCheckAttack +======================================================================*/ +void() LostCheckAttack = +{ + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + + //---------------------------------------------------------------------- + // Melee attack (bite) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEELOSTSOUL)) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // If too close, move sideways until can ram again + // If too far, move closer + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_RANGELOSTNEAR) { + self.attack_state = AS_SLIDING; + return; + } + else if (self.enemydist > MONAI_RANGELOSTFAR) { + self.attack_state = AS_STRAIGHT; + return; + } + + //---------------------------------------------------------------------- + // Cannot see enemy? go into guard mode + //---------------------------------------------------------------------- + if (!enemy_vis && self.lostsearch == FALSE) { + SUB_switchEnemyTarget(); + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.lostsearch = TRUE; + self.lostenemy = self.enemy; + self.losttimer = time + MONAI_LOSTTIMER + random()*5; + self.enemy = self.goalentity = self.movetarget = world; + self.th_altstand(); + return; + } + + //---------------------------------------------------------------------- + // Range attack (Ramming Speed) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.view_ofs, '0 0 24')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + // No space for raming speed, strafe side to side + else self.attack_state = AS_SLIDING; + } + // Wait for attack timer, better to face the player + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + JimCheckAttack (No melee attack) + This is essentially the monster_centarion check +======================================================================*/ +void() JimCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Lasers) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + //---------------------------------------------------------------------- + // Make sure jim maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + SentinelCheckAttack (No melee attack) +======================================================================*/ +void() SentinelCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Laser/Nail) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(1); + self.attack_state = AS_MISSILE; + return; + } + } +}; + +/*====================================================================== + CenturionCheckAttack (No melee attack) +======================================================================*/ +void() CenturionCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Plasma) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + //---------------------------------------------------------------------- + // Make sure the centurion maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + GargoyleCheckAttack (No melee attack) +======================================================================*/ +void() GargoyleCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Fireball) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + + //---------------------------------------------------------------------- + // Make sure the gargoyle maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + GauntCheckAttack (No melee attack) +======================================================================*/ +void() GauntCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Plasma volley) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + + //---------------------------------------------------------------------- + // Make sure the Gaunt maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + FishCheckAttack (melee only) +======================================================================*/ +void() FishCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Bite) + // Uses larger knight distance and closer bite check afterward + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } +}; + +/*====================================================================== + EelCheckAttack (No melee attack) +======================================================================*/ +void() EelCheckAttack = +{ + //---------------------------------------------------------------------- + // Range attack (Plasma bolt) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + + //---------------------------------------------------------------------- + // Make sure the Eel maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID || !enemy_vis) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + WraithCheckAttack (No melee attack) +======================================================================*/ +void() WraithCheckAttack = +{ + //---------------------------------------------------------------------- + // Cannot see enemy? stop chasing enemytarget + //---------------------------------------------------------------------- + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one os not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (burning and creature summons) + // Much more aggressive decision on range attacks (ogre style) + // No random chance percentages, logic with wraith magic function + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + + //---------------------------------------------------------------------- + // If turret, then do not move sideways + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + return; + } + //---------------------------------------------------------------------- + // Make sure the wraith maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + MinotaurCheckAttack +======================================================================*/ +void() MinotaurCheckAttack = +{ + //---------------------------------------------------------------------- + // If health is low enough, switch to rage mode + // This does not affect the minion spawning version + if ( !(self.spawnflags & MON_MINOTAUR_MINIONS) && self.movespeed >= 0) { + if (self.health < self.max_health*0.5 && !self.attack_rage) { + self.attack_rage = TRUE; + self.th_charge(); // Short howl at the sky + return; + } + } + //---------------------------------------------------------------------- + // Melee attack (claws) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEMINOTAUR)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + // Keep firing rockets when at range + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // RAGE mode (keep running at player) + //---------------------------------------------------------------------- + if (self.attack_rage) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + // Check range and sight for a low chance range attack + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // If enemy not infront or random chance, stop and range attack + if (!infront(self.enemy) || random() < 0.1) { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Plasma bolt attack + SUB_AttackFinished (2 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + //---------------------------------------------------------------------- + // PASSIVE mode (keep at distance) + //---------------------------------------------------------------------- + else { + // Is the player NOT visible? Keep getting closer + if (!enemy_vis) { + if (self.attack_state != AS_STRAIGHT) + self.attack_state = AS_STRAIGHT; + } + else { + //---------------------------------------------------------------------- + // Mid Range attack (JUMP) Not spawning dark version + //---------------------------------------------------------------------- + if ( !(self.spawnflags & MON_MINOTAUR_MINIONS) && random() < 0.35) { + // Jumped recently, facing right direction and not blocked? + if ( self.jump_flag < time && infront(self.enemy)) { + if (!visblocked_wide(self.enemy, self.view_ofs, self.enemy.view_ofs) ) { + // Check for enemy above? (z axis) + if (self.enemy.origin_z <= self.origin_z) { + // Is the minotaur within the right range? + if (self.enemydist > MONAI_JUMPMINONEAR && + self.enemydist < MONAI_JUMPMINOFAR) { + // Block any range attacks for a while + SUB_AttackFinished (random()); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.th_jump (); + return; + } + } + } + } + } + //---------------------------------------------------------------------- + // Range / missile attack (plasma bolts) + //---------------------------------------------------------------------- + // Any chance of a range attack? + if (time < self.attack_finished) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // Don't always stay at absolute range, move closer + if (random() < 0.15 && self.enemydist > MONAI_RANGEMINOTAUR) { + self.attack_sidedeny = time + 1 + random(); + self.attack_state = AS_STRAIGHT; + } + else { + // If not blocked, turn and move sideways + if (self.attack_sidedeny < time) + self.attack_state = AS_SIDESTEP; + } + } + else { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Keep firing plasma when at range + SUB_AttackFinished (2 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + } +}; + +/*====================================================================== + DroleCheckAttack +======================================================================*/ +void() DroleCheckAttack = +{ + //---------------------------------------------------------------------- + // Quoth setup - 500HP, with rage at 350HP + // Converted it to a % so mappers can change health + //---------------------------------------------------------------------- + if (self.movespeed >= 0) { + if (self.health < self.max_health*0.7 && !self.attack_rage) { + self.attack_rage = TRUE; + } + } + //---------------------------------------------------------------------- + // Melee attack (claws) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEDROLE2)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + // Keep firing rockets when at range + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // RAGE mode (keep running at player) + //---------------------------------------------------------------------- + if (self.attack_rage) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + // Check range and sight for a low chance range attack + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Calculate a flat vector to ignore Z axis difference + // Not convinced a flat vector is good for a melee only state + // Switched to 3D distance chance so its not so dumb + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist > MONAI_RANGEDROLE && random() < 0.3) { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Standard rocket attack + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + //---------------------------------------------------------------------- + // PASSIVE mode (keep at distance) + //---------------------------------------------------------------------- + else { + // Is the player visible? Keep getting closer + if (!enemy_vis) { + if (self.attack_state != AS_STRAIGHT) + self.attack_state = AS_STRAIGHT; + } + // Player in sight, fireball or loiter? + else { + // Any chance of a range attack? + if (time < self.attack_finished) { + // Calculate a flat vector to ignore Z axis difference + // Not convinced a flat vector is good for a melee only state + // Switched to 3D distance chance so its not so dumb + self.enemydist = range_distance(self.enemy, FALSE); + // Don't always stay at absolute range, move closer + if (random() < 0.15 && self.enemydist > MONAI_RANGEDROLE) { + self.attack_sidedeny = time + 1 + random(); + self.attack_state = AS_STRAIGHT; + } + else { + // If not blocked, turn and move sideways + if (self.attack_sidedeny < time) + self.attack_state = AS_SIDESTEP; + } + } + else { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Keep firing rockets when at range + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + } +}; + +/*====================================================================== + Death Guard (Quoth) CheckAttack +======================================================================*/ +void() DGuardQCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + if (enemy_range == RANGE_FAR) return; + + //---------------------------------------------------------------------- + // Melee attack (Over head smash attack) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEDGUARDQ)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed > 0) { + if (time < self.attack_finished) return; + SUB_AttackFinished ((1.4 * random()) + 0.8); + self.attack_state = AS_MISSILE; + return; + } + + //---------------------------------------------------------------------- + // Charge attack (Just outside of melee and before range) + //---------------------------------------------------------------------- + if (self.enemydist > MONAI_CHARGEDGARDQ1 && + self.enemydist < MONAI_CHARGEDGARDQ2) { + // Check for a random chance to break out from charging + // and do a quick range attack instead + if (time > self.attack_finished && random() < 0.2) { + SUB_AttackFinished ((1.4 * random()) + 0.8); + self.th_missile (); + } + else self.th_charge (); + return; + } + + //---------------------------------------------------------------------- + // Range attack - Fireball + //---------------------------------------------------------------------- + if (self.enemydist > MONAI_RANGEDGARDQ) { + if (time < self.attack_finished) return; + if (random() < 0.5) { + SUB_AttackFinished ((1.4 * random()) + 0.8); + self.th_missile (); + } + } +}; + +/*====================================================================== + DSergeantCheckAttack +======================================================================*/ +void() DSergeantCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 10', FALSE)) return; + self.attack_state = AS_MISSILE; + return; + } + + // If range blocked do charging instead + if (time < self.attack_finished) { + //---------------------------------------------------------------------- + // Charge attack + // Player within certain range, height and charging not blocked? + //---------------------------------------------------------------------- + self.height = fabs(self.origin_z - self.enemy.origin_z); + if (ai_checkmelee(MONAI_CHARGEFLAIL) && self.height < MONAI_CHARGEZAXIS + && self.attack_timer < time) { + // If attack timer not active, bump up with a random amount + if (self.attack_finished < time) SUB_AttackFinished (random()); + self.th_charge (); + return; + } + } + else { + //---------------------------------------------------------------------- + // Range attack - Homing missile + //---------------------------------------------------------------------- + // If the sightline between self and player blocked + // Allow for monsters to be hit (infighting rules!) + if (!visxray(self.enemy, self.attack_offset, '0 0 10', FALSE)) return; + self.attack_state = AS_MISSILE; + } +}; + +/*====================================================================== + DLordCheckAttack +======================================================================*/ +void() DLordCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + self.attack_state = AS_MISSILE; + return; + } + + //---------------------------------------------------------------------- + // Range attack + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + + // Strong lightning attack (melee again) + if (self.enemydist < MONAI_RANGEDLORD && random() < 0.4) { + SUB_AttackFinished (3 + random()*2); + self.attack_state = AS_MELEE; + return; + } + + // Long volley of spike balls (NG damage) + if (self.enemydist >= MONAI_RANGEDLORD && random() < 0.6) { + SUB_AttackFinished (5 + random()); + self.attack_state = AS_MISSILE; + return; + } +}; + +/*====================================================================== + DFuryCheckAttack +======================================================================*/ +void() DFuryCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // is the enemy close enough for a double sword slice attack? + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_JUMPFURYNEAR) { + self.attack_state = AS_MELEE; + self.th_slide (); + return; + } + //---------------------------------------------------------------------- + // Mid Range attack (JUMP) + //---------------------------------------------------------------------- + // Jumped recently, facing right direction and not blocked? + if ( self.jump_flag < time && infront(self.enemy) && !visblocked(self.enemy) ) { + // Check for enemy above? (z axis) + if (self.enemy.origin_z <= self.origin_z) { + // Is the fury knight within the right range? + if (self.enemydist > MONAI_JUMPFURYNEAR && + self.enemydist < MONAI_JUMPFURYFAR) { + // Block any range attacks for a while + SUB_AttackFinished (random()); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + if (random() < 0.65) self.th_jump (); + else self.th_charge (); + return; + } + } + } + //---------------------------------------------------------------------- + // Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.4; // range < 500 map units + // If jump ability blocked, be more aggressive with range + else if (enemy_range > RANGE_NEAR && self.jump_flag == LARGE_TIMER) self.attack_chance = 0.4; + else if (enemy_range == RANGE_MID) self.attack_chance = 0.05; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) self.attack_state = AS_MISSILE; +}; + +/*====================================================================== + DCrossCheckAttack +======================================================================*/ +void() DCrossCheckAttack = +{ + if (!enemy_vis) return; + //---------------------------------------------------------------------- + // Melee attack (blunt end of crossbow) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If sight blocked by another monster, do nothing + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) return; + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range / missile attack (slow bolts) + // The range logic is done via two set of animations (hold/slide) + // Once within a certain range, stay there and snipe at the enemy + //---------------------------------------------------------------------- + // range < 500 map units + if (enemy_range == RANGE_NEAR || self.enemymaxdist) { + // If sight blocked by another monster, slide to the side + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + else { + // No monster in the way, hold still and start aiming + self.attack_state = AS_MISSILE; + self.th_missile (); + } + } + else self.attack_state = AS_STRAIGHT; +}; + +/*====================================================================== + ZombiekCheckAttack (Has no range attack) + The player is in view, so decide to jump or melee +======================================================================*/ +void() ZombiekCheckAttack = +{ + if (!enemy_vis) return; + //---------------------------------------------------------------------- + // Melee attack (rusty sword) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range / missile attack (jumping) + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + self.attack_chance = 0.3 + skill*0.1; + if (random() < self.attack_chance) { + // Is the enemy the right distance away and the random chance is correct? + if (self.enemydist > MONAI_JUMPZKNEAR && self.enemydist < MONAI_JUMPZKFAR) { + SUB_AttackFinished (2 + random()*2); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; // JUMP JUMP JUMP! + } + } +}; + +/*====================================================================== + BoilCheckAttack (Has no range attack) + The player is in view, so blow up! +======================================================================*/ +void() BoilCheckAttack = +{ + if (!enemy_vis) return; + // Only has one attack, run at player and explode + // Does one simple range check regardless if turret + if (self.enemydist < MONAI_MELEEBOIL) self.attack_state = AS_MELEE; +}; + +/*====================================================================== + SpawnCheckAttack +======================================================================*/ +void() SpawnCheckAttack = +{ + // Spawns don't start jumping straight away unless they can directly + // see the player. // They slowly crawl around which can make them + // tricky to plan for an ambush. + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // JUMP Melee attack + // This pretty much a close quarter jump in the face attack! + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESPAWN)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // JUMP Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + + // range < 120 map units + if (enemy_range == RANGE_MELEE) { + self.attack_chance = 0.9; + self.attack_finished = 0; + } + // range < 500 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.2; + // range < 1000 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.05; + else self.attack_chance = 0; + + if (random () < self.attack_chance) { + SUB_AttackFinished (2*random()); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; // JUMP JUMP JUMP! + } +}; + +/*====================================================================== + DemonCheckAttack +======================================================================*/ +void() DemonCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (CLAWS) + //---------------------------------------------------------------------- + // Check that within range of a claw attack + if (ai_checkmelee(MONAI_MELEEDEMON)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (JUMP) + //---------------------------------------------------------------------- + // Time for another jump? + if (self.jump_flag < time) { + // Stop the demon over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + // Check for closeness, but not long range! + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPDEMONNEAR) return; + + // Check for low ceilings directly above the demon + traceline(self.origin, self.origin + '0 0 256', TRUE, self); + self.height = fabs(vlen(trace_endpos - self.origin)); + // Ceiling is too low (looks dumb hitting ceilings) + if (self.height < MONAI_JUMPDEMONCHECK) return; + + // ** QC code from necros ** + // Move the demon forward 16 units and check if blocked + self.pos1 = self.origin; + self.ideal_yaw = vectoyaw(self.enemy.origin - self.pos1); + // If move forward fails, move back and indicate no jump + if (!walkmove(self.ideal_yaw, 16)) { + setorigin(self, self.pos1); + return; + } + + setorigin(self, self.pos1); // walkmove successful, move demon back + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; // JUMP JUMP JUMP! + } +}; + +/*====================================================================== + ScorpionCheckAttack (high damage pincher) +======================================================================*/ +void() ScorpionCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (CLAWS) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESCORPION)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, do range attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + return; + } + + //---------------------------------------------------------------------- + // Range attack (JUMP/TAIL) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + if (self.spawnflags & MON_SCORPION_STINGER) { + // check for extra wide space to jump + if (!visblocked_wide(self, self.attack_offset, self.enemy.view_ofs)) return; + + // Time for another jump? + if (self.jump_flag < time) { + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPSCORPNEAR) return; + if (self.enemydist > MONAI_JUMPSCORPFAR) return; + + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } + else { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + } +}; + +/*====================================================================== + DogCheckAttack +======================================================================*/ +void() DogCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEEDOG)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (JUMP) + //---------------------------------------------------------------------- + // Has the dog jumped less than 2 seconds ago? + if (self.jump_flag < time) { + // Stop the dog over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPDOGNEAR) return; + if (self.enemydist > MONAI_JUMPDOGFAR) return; + + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } +}; + +/*====================================================================== + SpiderCheckAttack +======================================================================*/ +void() SpiderCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEESPIDER)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Large Green Spider = SPIT) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SPIDER_LARGE) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Small Brown Spider = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the spider over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPSPIDERNEAR) return; + if (self.enemydist > MONAI_JUMPSPIDERFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + ElfCheckAttack +======================================================================*/ +void() ElfCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (CANE) + //---------------------------------------------------------------------- + // Check that within range of a cane attack + if (ai_checkmelee(MONAI_MELEEELF)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Elf 2 (Black pants) = Magic) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_ELF_MAGIC) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Elf 1 (green/red pants) = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the elf over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPELFNEAR) return; + if (self.enemydist > MONAI_JUMPELFFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + VorelingCheckAttack +======================================================================*/ +void() VorelingCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEEVORELING)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Large Purple Voreling = SPIT) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_VORELING_LARGE) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Small White Voreling = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the voreling over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + // Too close/far? + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPVORELINGNEAR) return; + if (self.enemydist > MONAI_JUMPVORELINGFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + SwamplingCheckAttack +======================================================================*/ +void() SwamplingCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEESWAMPLING)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Large Green Swampling = SPIT) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SWAMPLING_LARGE) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Small Light Green Swampling = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the swampling over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + // Too close/far? + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPSWAMPLINGNEAR) return; + if (self.enemydist > MONAI_JUMPSWAMPLINGFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + Check if the AI is blocked by a breakable object in the way +======================================================================*/ +void() CheckBlockedBreakable = +{ + local vector spot1, spot2, brkorg; + local float brklen; + + // Still busy attacking? do nothing + if (time < self.attack_finished) return; + + // FIXME : there needs to be check on the breakable health + // otherwise the monster will be stuck constantly attacking the breakable + + // Check for breakables from middle of models (not head height) + spot1 = self.origin; + spot2 = self.enemy.origin; + traceline (spot1, spot2, TRUE, self); // see through other monsters + + if (trace_ent.classtype != CT_FUNCBREAK) { + // Check for breakables from top of models + spot1 = self.origin + self.view_ofs; + spot2 = self.enemy.origin + self.enemy.view_ofs; + traceline (spot1, spot2, TRUE, self); // see through other monsters + } + + if (ai_foundbreakable(self, trace_ent,FALSE)) { + // Find origin of breakable, check for bmodel 0,0,0 origins + if (trace_ent.bsporigin) brkorg = bmodel_origin(trace_ent); + else brkorg = trace_ent.origin; + brklen = fabs(vlen(self.origin - brkorg)); + SUB_AttackFinished (1+random()); + + // Double check a melee range has been setup + if (self.th_melee && !self.meleerange) + self.meleerange = MONAI_MELEEKNIGHT; + + // Check breakable within melee/missile range? + if (brklen < self.meleerange && self.th_melee) self.attack_state = AS_MELEE; + else if (self.th_missile) self.attack_state = AS_MISSILE; + } +}; diff --git a/QC_other/QC_arcane/ai_combat.qc b/QC_other/QC_arcane/ai_combat.qc new file mode 100644 index 00000000..1c2b4d24 --- /dev/null +++ b/QC_other/QC_arcane/ai_combat.qc @@ -0,0 +1,512 @@ +/*====================================================================== + COMBAT FUNCTIONS + + Returns true if the inflictor can directly damage the target. + Used for explosions and melee attacks. +======================================================================*/ +void(entity targ, entity attacker) ClientObituary; + +//----------------------------------------------------------- +float(entity targ, entity inflictor) CanDamage = +{ + // Any entity marked with no damage is automatically excluded + if (targ.takedamage == DAMAGE_NO) return FALSE; + + // bmodels need special checking because their origin is 0,0,0 + // Not all bmodels use push movetype, use bsporigin instead + // if (targ.movetype == MOVETYPE_PUSH) { + if (targ.bsporigin == TRUE) { + traceline(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + if (trace_ent == targ) return TRUE; + return FALSE; + } + + // Trace around the target to see if it can hit + traceline(inflictor.origin, targ.origin, TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '15 15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '-15 -15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '-15 15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + + return FALSE; +}; + +//----------------------------------------------------------- +void(entity targ, entity attacker) Killed = +{ + local entity oself; + + // Switch self for death functions + oself = self; self = targ; + self.activate = attacker; // Always keep track of what did damage + + // func bmodels, triggers, breakables etc + // Horrible hack for pushables; They switch movetype, hard to catch + if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE || + self.classtype == CT_FUNCPUSHABLE) { + self.th_die (); + } + else { + if (!self.deadflag && (self.flags & FL_MONSTER || self.flags & FL_CLIENT) ) { + // Object is dying, stop re-triggering + self.deadflag = DEAD_DYING; + self.enemy = attacker; // Enemy dealing final blow + if (self.enemy.classtype == CT_WORLD) self.enemy = self; + + // bump the monster counter + if (self.flags & FL_MONSTER) { + // If a monster marked with no monster count dies + // update HUD totals to reflect death properly + if (self.nomonstercount) { + total_monsters = total_monsters + 1; + update_hud_totals(HUD_MONSTERS); + } + // Update global monster death totals + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + } + + ClientObituary(self, attacker); + self.touch = SUB_Null; + + if (self.flags & FL_MONSTER) monster_death_use(); + self.th_die (); + } + // Completely fuckup setup for the oldone boss with a weird target + // field and mess of triggers around it! This elseif is just an + // exception so it works, anyway no one fights the oldone! + else if (!self.deadflag && self.classtype == CT_MONIDSHUB) { + self.deadflag = DEAD_DEAD; + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + self.th_die (); + } + } + // Restore self + self = oself; +}; + +/*====================================================================== + T_Damage + The damage is coming from inflictor, but get mad at attacker + This should be the only function that ever reduces health. + Parameters: + targ = entity receiving damage (monster) + inflictor = entity causing damage (bullets) + attacker = parent entity of inflictor (player firing bullets) + damage = quantity (before modifiers, quad etc) + checkarmor = can bypass armour (DAMARMOR, NOARMOR) +======================================================================*/ +void(entity targ, entity inflictor, entity attacker, float damage, float checkarmor) T_Damage = +{ + local vector dir; + local entity oldself; + local float save, take, flinch; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (targ.classtype == CT_WORLD) return; + if (targ.classtype == CT_ENEMYTARGET) return; + + // Is the monster dying and going through death animation? + if (targ.flags & FL_MONSTER && targ.health < 1) { + if (targ.health > targ.gibhealth) { + // SSG projectiles need to do more damage (higher chance of gib) + if (inflictor.classtype == CT_PROJ_SSG) take = 1 + random()*0.25; + // Lowered the chance of extra gibs from other weapons + // way to much gibbing was happening to all monsters + else take = 1; + + // Keep taking health off after death + targ.health = targ.health - (damage*take); + } + return; + } + + // If target cannot take damage, no point doing damage + if (targ.takedamage == DAMAGE_NO) return; + + // Check for breakable/pushables being immune to monster damage + // This check is present in all projectiles functions instead + // Its not really necessary here because its about monsters + // if (ai_immunedamage(attacker, targ)) return; + + // used by buttons and triggers to set activator for target firing + damage_attacker = attacker; + + // check for quad damage powerup on the attacker + if (attacker.super_damage_finished > 0) damage = damage * 4; + + // co-op team play damage avoidance + if ( (teamplay == 1) && (targ.team > 0) && (targ.team == attacker.team) ) return; + + // Poor zombies, they have so many exceptional ways to die! + if (targ.classgroup == CG_ZOMBIE) { + // If a zombie falls into slime or lava, instant death + if (targ.watertype == CONTENT_SLIME || targ.watertype == CONTENT_LAVA) { + damage = fabs(targ.gibhealth * 4); + //dprint("\b[T_DAMAGE]\b Instant death, in slime or lava\n"); + } + // Exploding boils always destroy zombies + if (attacker.classtype == CT_MONBOIL) damage = fabs(targ.gibhealth * 2); + } + + // Are monsters infighting and is there a damage modifier active? + if (attacker.infightextra && targ.flags & FL_MONSTER) + damage = damage * attacker.infightextra; + + //---------------------------------------------------------------------- + // Check for plasma burn/explosion on fatal hit + if (inflictor.classtype == CT_PROJ_PLASMA && attacker.flags & FL_CLIENT) { + if ((targ.health-damage < 0) && attacker.plasma_burn < time && random() < 0.2) { + // Stop the plasma burn effect not happening alot at once + attacker.plasma_burn = time + 4 + random()*4; + // Don't add anymore damage if quad active + if (attacker.super_damage_finished == 0) + damage = (targ.health - targ.gibhealth); + // Big blue sprite explosion + particles + particle_explode(targ.origin-'0 0 16', 50+random()*50, 2, PARTICLE_BURST_BLUE, PARTICLE_BURST_UPWARD); + SpawnExplosion(EXPLODE_PLASMA_BIG, inflictor.origin+'0 0 8', SOUND_REXP3); + } + } + + //---------------------------------------------------------------------- + // Check for monster/breakable extra damage key condition + // The key is usually checked with ai_damagebreakable function + // Needs to be checked with projectiles as well + if (targ.classgroup == CG_BREAKABLE && attacker.flags & FL_MONSTER) { + if (targ.brkmondmg > 0) damage = damage + targ.brkmondmg; + } + + //---------------------------------------------------------------------- + // save damage based on the target's armor level + //---------------------------------------------------------------------- + save = 0; + if (checkarmor == DAMARMOR) { + save = ceil(targ.armortype*damage); + if (save >= targ.armorvalue) { + save = targ.armorvalue; + targ.armortype = 0; // lost all armor + targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); + } + // Reduce armour based on save forumla above + targ.armorvalue = targ.armorvalue - save; + // CEIL function will round up any fractional damage + // TBH it is better to round up than round down + take = ceil(damage-save); + } + else take = damage; + + //---------------------------------------------------------------------- + // add to the damage total for clients, which will be sent as a single + // message at the end of the frame + // FIXME: remove after combining shotgun blasts? + //---------------------------------------------------------------------- + if (targ.flags & FL_CLIENT) { + targ.dmg_take = targ.dmg_take + take; + targ.dmg_save = targ.dmg_save + save; + targ.dmg_inflictor = inflictor; + } + + // figure momentum add + if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) { + dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; + dir = normalize(dir); + targ.velocity = targ.velocity + dir*damage*8; + } + + // check for godmode or invincibility + if (targ.flags & FL_GODMODE || targ.invincible_finished >= time) { + if (targ.invincible_sound < time) { + sound (targ, CHAN_ITEM, SOUND_ARTPENT3, 1, ATTN_NORM); + targ.invincible_sound = time + 2; + } + return; + } + + //---------------------------------------------------------------------- + // do the damage + //---------------------------------------------------------------------- + targ.health = targ.health - take; + + //---------------------------------------------------------------------- + // Check monster turret is to be released based on % health + // Fire any targets (once only) when this condition is met + //---------------------------------------------------------------------- + if (targ.turrethealth > 0 && targ.movespeed < 0) { + if (targ.health < (targ.max_health * targ.turrethealth)) { + if (targ.turrettarget != "") { + // Fire all targets and remove trigger string + trigger_strs(targ.turrettarget, attacker); + targ.turrettarget = ""; + } + // Release turret, free movement + targ.movespeed = 1; + } + } + + //---------------------------------------------------------------------- + // When the SG projectile system is active each monster needs to keep + //track of cumulative damage so that pain flinches work correctly + // AmmoShells classgroup is only active when SG projectiles are fired + //---------------------------------------------------------------------- + // Is the Shotguns projectile system active? + if (inflictor.classgroup == CG_PROJSHELLS) { + // Does the frame damage acculator need to be reset? + if (targ.dmgtimeframe <= time) { + targ.dmgtimeframe = time + 0.1; + targ.dmgcombined = 0; + } + // Accumulate damage until next fromae + targ.dmgcombined = targ.dmgcombined + take; + } + + //---------------------------------------------------------------------- + // When the SG projectile system is active ZOMBIES need to know if + // there has been enough damage over a single frame to die or not + // AmmoShells classgroup is only active when SG projectiles are fired + //---------------------------------------------------------------------- + if (targ.classgroup == CG_ZOMBIE) { + // Zombies MUST ALWAYS RUN their pain function!?! + self.pain_finished = 0; + // Horrible Hack - Launch_Bullet sets the weapon flag on projectiles + // Only register damage against zombies if SSG upgrade or Quad! + if (inflictor.classgroup == CG_PROJSHELLS && inflictor.weapon) { + // Has the accumulator gone over the max health? + if (targ.dmgcombined > targ.max_health) { + targ.health = targ.gibhealth; + } + } + } + + /*---------------------------------------------------------------------- + // Axe upgrade will gib enemies if they are killed with the axe + // A bit excessive on the gibbing, disabled for the moment + if (attacker.moditems & IT_SHADAXE && attacker.weapon == IT_AXE) { + if (targ.health < 1 && targ.gibhealth) targ.health = targ.gibhealth; + } */ + + //---------------------------------------------------------------------- + // Has the monster died? + //---------------------------------------------------------------------- + if (targ.health < 1) { + Killed (targ, attacker); + return; + } + + //---------------------------------------------------------------------- + // Switch self (foundtarget and pain function need self correct) + // self restored before end of function + oldself = self; + self = targ; + //---------------------------------------------------------------------- + // react to the damage - only if a monster + // No reaction if attacker is world (env trap, door, etc) + //---------------------------------------------------------------------- + if ( (self.flags & FL_MONSTER) && attacker != world) { + // Is the current attacker not self and not current enemy target? + if (self != attacker && attacker != SUB_entEnemyTarget()) { + if ( self.noinfighting == TRUE && attacker.flags & FL_MONSTER + || attacker.noinfighting == TRUE) { + // Prevent monsters from infighting + // but let them react to the player + } + else { + // If previous switch target dead, focus on new target + if (self.switchattacker.health < 1) self.switchtimer = 0; + // Is the attacker a different classgroup and switching target available? + if ( self.classgroup != attacker.classgroup && self.switchtimer < time) { + // Prevent the monster from rapidily switching targets + if (self.switchattacker != attacker) self.switchtimer = time + self.switchoverride; + else self.switchtimer = time + ( (self.switchoverride + random()) * 0.5); + // Switch to new target + self.switchattacker = attacker; + + // Shift previous enemy to old enemy ready for new target + // Only switch if the new enemy is the player! (id logic) + // Check for new enemy target system before switching + if (SUB_flagsEnemyTarget(FL_CLIENT)) self.oldenemy = SUB_entEnemyTarget(); + if (self.enemy.classtype == CT_ENEMYTARGET) SUB_switchEnemyTarget(); + self.enemy = attacker; // attack the attacker! + FoundTarget (); // Run+turn towards new enemy + } + } + } + } + self = oldself; + + //---------------------------------------------------------------------- + // Check for ammo type resistance and immunity to pain + // Targetdummies rely on the pain function to display stats + if (targ.classtype != CT_TARGETDUMMY) { + if (targ.resist_shells > 0 && inflictor.classgroup == CG_PROJSHELLS) return; + else if (targ.resist_nails > 0 && inflictor.classgroup == CG_PROJNAILS) return; + else if (targ.resist_rockets > 0 && inflictor.classgroup == CG_PROJROCKETS) return; + else if (targ.resist_cells > 0 && inflictor.classgroup == CG_PROJCELLS) return; + } + + //---------------------------------------------------------------------- + // Switch self (foundtarget and pain function need self correct) + // self restored before end of function + oldself = self; + self = targ; + //---------------------------------------------------------------------- + + if (self.th_pain && self.pain_finished < time) { + // Save pain finished state for later + self.pain_finstate = self.pain_finished; + + // The damage from projectile shotguns trinkle at the monster + // which means it cannot trigger the flinch function + // Let the combined damage over 1 frame accumulate first + // Exception - Zombies don't flinch, they must run pain function + if (inflictor.classgroup == CG_PROJSHELLS && targ.classgroup != CG_ZOMBIE) { + // Demon, Shambler, Shalrath and Wizard all have high flinch values + if (self.pain_flinch > 40) flinch = 40; + else flinch = self.pain_flinch + 1; + if (self.dmgcombined < flinch) {self = oldself; return;} + } + + // Block pain re-trigger event + self.pain_finished = time + self.pain_timeout; + + // Ignoring pain from other monsters? (infighting) + if (self.pain_ignore && attacker.flags & FL_MONSTER) + self.pain_finished = self.pain_finished + 1 + random(); + else { + // If accumulated pain is higher, use that instead + // Added classgroup exception otherwise damage qty is wrong + if (inflictor.classgroup == CG_PROJSHELLS && take < self.dmgcombined) + self.th_pain (inflictor, attacker, self.dmgcombined); + else self.th_pain (inflictor, attacker, take); + + // nightmare mode monsters don't go into pain frames often + if (skill == SKILL_NIGHTMARE && targ.classgroup != CG_ZOMBIE) self.pain_finished = time + 5; + + // Exceptions to pain not being blocked (even nightmare!) + // If the monster is in slime or lava always go into pain + if (self.watertype == CONTENT_SLIME || self.watertype == CONTENT_LAVA) + self.pain_finished = time + 0.3; + } + } + self = oldself; +}; + +/*====================================================================== + T_RadiusDamage + + inflictor -(self) = projectile + attacker - (self.owner) = monster/player OR (self) = direct attack + ignore - (other) = Original target OR (world) = no exceptions +======================================================================*/ +void(entity inflictor, entity attacker, float damage, entity ignore, float checkclass) T_RadiusDamage = +{ + local float points; + local entity head; + local vector org, imporg; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (attacker.noradiusdmg) return; + if (attacker.classtype == CT_WORLD) return; + if (attacker.classtype == CT_ENEMYTARGET) return; + + // check if inflictor is a bmodel (different origin location) + if (inflictor.bsporigin) imporg = bmodel_origin(inflictor); + else imporg = inflictor.origin; + + head = findradius(imporg, damage+40); + + while (head) { + if (head != ignore) { + // This is used mostly for wraiths so when they die they don't + // kill each other, can't get the code logic to work so its + // setup as a dead exception path + if (checkclass == IGNORECLASS && head.classtype == ignore.classtype) { } + else { + // Check for breakable/pushable monster immunity + // Do nothing, radius damage has no miss effect + if (ai_immunedamage(attacker, head)) { + } + // Check for any breakables which are prone to explosive damage + else if (ai_foundbreakable(attacker, head,TRUE) && head.brktrigmissile !=0) { + trigger_ent(head, attacker); + } + else { + // Can be damaged and NOT immune to radius (splash) damage + if (head.takedamage > 0 && head.noradiusdmg == 0) { + // This formula is using bounding box size which means + // the damage amount is lower if the monster is larger + // It should really be based on bounding box edge + // not monster origin + org = head.origin + (head.mins + head.maxs)*0.5; + points = 0.5*vlen (imporg - org); + if (points < 0) points = 0; + points = damage - points; + + // Half damage if caught by own explosion + if (head == attacker) points = points * 0.5; + + if (points > 0 && head.health > 0) { + // Need CanDamage to check for anything blocking LoS + // It will do several traces (source->target) to check + // for any blocking entities (lifts, doors, walls etc) + if (CanDamage (head, inflictor)) { + // Splash damage is part of rocket resistance + if (head.resist_rockets > 0) + points = Resist_Damage(head, IT_ROCKETS, points); + + // Zombies should really be blown from explosives + // especially from ogre grenades right under their feet + // Check for glancing damage or if too far away + if (head.classgroup == CG_ZOMBIE && points > (head.health*0.25)) + points = DAMAGE_ZOMBIECLASS; + // Any damage left? Check for poison as well + if (points > 0) T_Damage (head, inflictor, attacker, points, DAMARMOR); + if (attacker.poisonous) PoisonDeBuff(head); + } + } + } + } + } + } + head = head.chain; + } +}; + +/*====================================================================== + T_BeamDamage (never used, leftover dev crap!) +====================================================================== +void(entity attacker, float damage) T_BeamDamage = +{ + local float points; + local entity head; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (attacker.classtype == CT_WORLD) return; + if (attacker.classtype == CT_ENEMYTARGET) return; + + head = findradius(attacker.origin, damage+40); + + while (head) { + if (head.takedamage) { + points = 0.5*vlen (attacker.origin - head.origin); + if (points < 0) points = 0; + points = damage - points; + if (head == attacker) points = points * 0.5; + if (points > 0) { + if (CanDamage (head, attacker)) { + if (head.resist_rockets > 0) + points = points * head.resist_rockets; + T_Damage (head, attacker, attacker, points,DAMARMOR); + } + } + } + head = head.chain; + } +}; */ + diff --git a/QC_other/QC_arcane/ai_enemytarget.qc b/QC_other/QC_arcane/ai_enemytarget.qc new file mode 100644 index 00000000..c6b5baaf --- /dev/null +++ b/QC_other/QC_arcane/ai_enemytarget.qc @@ -0,0 +1,186 @@ +/*====================================================================== + Flying units maintain the same Z axis as their enemy targets + This makes it impossible to have flying units above the player + because the engine is constantly moving the monster downwards + + This system replaces the enemy target with a fake one which + floats above the real enemy target. This fake marker can be + seen if developer 1 is active, otherwise hidden + + The engine will track the fake enemytarget and gameplay functions + can carry on using the real enemy target for calculations + + All the gameplay functions should use these self.enemy wrappers + defined below to make sure they return the correct enemy! + +======================================================================*/ +// Detects enemytarget and returns real ENEMY angles +// Returns the correct takedamage flag, useful for function tests +float() SUB_takedEnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return (self.enemy.enemy.takedamage); + else return (self.enemy.takedamage); +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns for flags bitwise operation +// Returns the correct entity flags, useful for function tests +float(float bitflag) SUB_flagsEnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return (self.enemy.enemy.flags & bitflag); + else return (self.enemy.flags & bitflag); +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns real ENEMY angles +// Returns the correct entity angles, useful for function tests +vector() SUB_angEnemyTarget = +{ + if (!self.enemy) return VEC_ORIGIN; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy.angles; + else return self.enemy.angles; +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns real ENEMY health +// Returns the correct entity health, useful for function tests +float() SUB_healthEnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy.health; + else return self.enemy.health; +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns real ENEMY origin +// Returns the correct entity origin, useful for function tests +vector() SUB_orgEnemyTarget = +{ + if (!self.enemy) return VEC_ORIGIN; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy.origin; + else return self.enemy.origin; +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns the real ENEMY entity +// Returns the correct entity, useful for function tests +entity() SUB_entEnemyTarget = +{ + if (!self.enemy) return world; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy; + else return self.enemy; +}; + +//---------------------------------------------------------------------- +// Returns TRUE if enemytarget system active +// A simple test to see if enemytarget system is active +float() SUB_EnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Self = monster; Will switch enemy and enemytarget around (restore) +// Its a good idea to do this when the enemytarget is out of sight +// Will restore the enemy to the ground height (useful for doorways) +void() SUB_switchEnemyTarget = +{ + if (self.enemytarget.classtype != CT_ENEMYTARGET) return; + self.enemytarget.state = STATE_OFF; + self.enemy = self.enemytarget.enemy; +}; + +//---------------------------------------------------------------------- +// Self = monster; Will remove enemytarget function safely (delete) +// The enemytarget system should take care of itself and safely delete +// This is a brute force version that will make sure, "its dead jim!" +void() SUB_removeEnemyTarget = +{ + if (self.enemytarget.classtype != CT_ENEMYTARGET) return; + self.enemytarget.state = STATE_OFF; + self.enemytarget.think = SUB_Remove; + self.enemytarget.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Function called all the time when the enemytarget is active +void() SUB_updateEnemyTarget = +{ + // OWNER DIED - Safely remove this entity + if (self.owner.health < 1) { + self.state = STATE_OFF; + self.think = SUB_Remove; + self.nextthink = time + 0.1; + } + // TARGET DIED - Stop tracking, wait for another enemy + else if (self.enemy.health < 1) { + self.state = STATE_OFF; + } + // ENEMY ACTIVE - Update position and check for height change + else if (self.state == STATE_ON) { + // Is there any random variance to the Z location? + if (self.waitmin < time && self.wait > 0) { + self.waitmin = time + self.wait + random()*self.wait; + // Check if the enemy is close? Go to maximum height if inside melee range + self.enemydist = range_distance(SUB_entEnemyTarget(), FALSE); + if (self.enemydist < MONAI_ABOVEMELEE) self.view_ofs_z = self.height; + else self.view_ofs_z = (self.height*0.25) + ((self.height*0.75) * random()); + } + + // Check for solid/sky origin content + self.lip = pointcontents(self.enemy.origin + self.view_ofs); + if (self.lip == CONTENT_SOLID || self.lip == CONTENT_SKY) { + // Traceline upwards to nearest point + traceline(self.enemy.origin, self.enemy.origin + self.view_ofs, TRUE, self); + setorigin(self,trace_endpos); + } + else setorigin(self, self.enemy.origin + self.view_ofs); + + // Next update time tick (def=0.1s) + self.think = SUB_updateEnemyTarget; + self.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void(entity targ, float zoffset, float rndtimer) SUB_setupEnemyTarget = +{ + // Don't try to get higher than other flying units + // Two monsters with the same abilty will constantly rise up + if (targ.movetype == MOVETYPE_FLY) return; + + // Create the enemytarget if one does not exist + if (!self.enemytarget) { + self.enemytarget = spawn(); + self.enemytarget.owner = self; + self.enemytarget.classtype = CT_ENEMYTARGET; + + // Show enemytarget system in devmode ONLY (dev helper) + if (developer > 0 && !query_configflag(SVR_DEVHELPER)) { + self.enemytarget.mdl = MODEL_BROKEN; + setmodel(self.enemytarget, self.enemytarget.mdl); + } + setsize (self.enemytarget, VEC_ORIGIN, VEC_ORIGIN); + self.enemytarget.movetype = MOVETYPE_NONE; + self.enemytarget.solid = SOLID_NOT; + // Plenty of functions test for health and damage + self.enemytarget.health = LARGE_TIMER; + self.enemytarget.takedamage = DAMAGE_YES; + } + + // If attacking a monster stay up high out its way, else move up and down + if (targ.flags & FL_MONSTER) self.enemytarget.wait = 0; + else if (self.bossflag) self.enemytarget.wait = 0; + else self.enemytarget.wait = rndtimer; + + // Setup parameters and enable update routine + self.enemytarget.state = STATE_ON; + self.enemytarget.height = self.enemytarget.view_ofs_z = zoffset; + self.enemytarget.enemy = targ; + self.enemytarget.think = SUB_updateEnemyTarget; + self.enemytarget.nextthink = time + 0.1; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/ai_explosion.qc b/QC_other/QC_arcane/ai_explosion.qc new file mode 100644 index 00000000..f75947c2 --- /dev/null +++ b/QC_other/QC_arcane/ai_explosion.qc @@ -0,0 +1,350 @@ +/*====================================================================== + PROJECTILE Explosion and Blood functions + +======================================================================*/ +// Classic ID rocket/grenade explosion +// Not used anymore, left for map hackers! +void() s_explode1 = [0, s_explode2] {}; +void() s_explode2 = [1, s_explode3] {}; +void() s_explode3 = [2, s_explode4] {}; +void() s_explode4 = [3, s_explode5] {}; +void() s_explode5 = [4, s_explode6] {}; +void() s_explode6 = [5, SUB_Remove] {}; + +//---------------------------------------------------------------------- +// General purpose animated spite function +// Types: Small, medium, big, plasma, puffpuff! +//---------------------------------------------------------------------- +void() SpawnExplosion_think = +{ + self.frame = self.frame + 1; + if (self.frame > self.count) SUB_Remove(); + else self.nextthink = time + self.speed; +}; + +//---------------------------------------------------------------------- +void(float sprite_type, vector org, string expl_sound) SpawnExplosion = +{ + local string spr_name; + local float spr_count, spr_speed; + + spr_count = -1; + if (sprite_type == EXPLODE_SMALL) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEEXPLODE), org, '0 0 0', 1); + else { + spr_name = SEXP_SMALL; + spr_count = 5; + spr_speed = 0.1; + } + } + else if (sprite_type == EXPLODE_MED) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEEXPLODE), org, '0 0 0', 1); + else { + spr_name = SEXP_MED; + spr_count = 13; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEEXPLODE), org, '0 0 0', 1); + else { + spr_name = SEXP_BIG; + spr_count = 16; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_PLASMA_SMALL) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMA), org, '0 0 0', 1); + else { + spr_name = SEXP_PLASMA_SMALL; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_PLASMA_MED || sprite_type == EXPLODE_PLASMA_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMABIG), org, '0 0 0', 1); + else { + spr_name = SEXP_PLASMA_BIG; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_POISON_SMALL) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPOISON), org, '0 0 0', 1); + else { + spr_name = SEXP_POISON_SMALL; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_POISON_MED || sprite_type == EXPLODE_POISON_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPOISONMED), org, '0 0 0', 1); + else { + spr_name = SEXP_POISON_MED; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_ELECT_SMALL || sprite_type == EXPLODE_ELECT_MED + || sprite_type == EXPLODE_ELECT_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMA), org, '0 0 0', 1); + else { + spr_name = SEXP_ELECTRIC; + spr_count = 4; + spr_speed = 0.1; + } + } + // This must be pre-cached by entity using it! + // This is not cached in worldspawn as its rarely used + else if (sprite_type == EXPLODE_ICE_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMA), org, '0 0 0', 1); + else { + spr_name = SEXP_ICE_BIG; + spr_count = 9; + spr_speed = 0.1; + } + } + else if (sprite_type == EXPLODE_BURST_SMOKE) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEBSMOKE), org, '0 0 0', 1); + else { + spr_name = SBURST_SMOKE; + spr_count = 6; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_BURST_FLAME) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEBFLAME), org, '0 0 0', 1); + else { + spr_name = SBURST_FLAME; + spr_count = 6; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_BURST_POISON) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEBPOISON), org, '0 0 0', 1); + else { + spr_name = SBURST_POISON; + spr_count = 6; + spr_speed = 0.05; + } + } + else return; + + // Always spawn a temporary entity + // Need one for sprite and/or explosion sound + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_NONE; + newmis.solid = SOLID_NOT; + setorigin(newmis, org); + + // Any sprite requirements? (Fitz engine) + if (spr_count > 0) { + setmodel(newmis, spr_name); // Setup sprite + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.alpha = 0.85; // Slightly transparent + newmis.effects = 32; // Additive blending + newmis.count = spr_count; // Total frames + newmis.speed = spr_speed; // Frame speed + + newmis.think = SpawnExplosion_think; + newmis.nextthink = time + newmis.speed; + } + else { + // No sprite required but need entity for sound to play + // Allow for sound to finish and just remove + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.think = SUB_Remove; + newmis.nextthink = time + 4; + } + + // Play any explosion sounds on temporary entity + if (expl_sound != "") { + sound(newmis, CHAN_WEAPON, expl_sound, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +// Should not be used anymore, this is the old ID system +// Use SpawnExplosion instead, copes with DP effects better +//---------------------------------------------------------------------- +void() BecomeExplosion = +{ + self.touch = SUB_Null; + self.velocity = '0 0 0'; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, ""); + SpawnExplosion(EXPLODE_SMALL, self.origin, ""); + self.nextthink = time + 0.6; + self.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +void(vector org, float velrnd, float upbase, float uprnd) SpawnProjectileSmoke = +{ + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_PROJ_SMOKE); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + if (velrnd > 0) newmis.velocity = vecrand(0,velrnd,TRUE); + else newmis.velocity = '0 0 0'; + newmis.velocity_z = upbase + random()*uprnd; + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +void(entity source, entity targ) ProjectileType = +{ + // Projectile types (Poison/Robot/Stone/Blood) + if (source.poisonous) { + setmodel (targ, MODEL_PROJ_FLESHP); + targ.gibtype = GIBTYPE_POISON; + } + else if (source.classgroup == CG_ROBOT || source.classgroup == CG_STONE) { + setmodel (targ, MODEL_PROJ_SMOKE); + targ.gibtype = GIBTYPE_STONE; + } + else { + setmodel (targ, MODEL_PROJ_FLESH); + targ.gibtype = GIBTYPE_BLOOD; + } + // Finally add DP particle trails + if (ext_dppart) DPP_blood_trail(targ); +}; + +//---------------------------------------------------------------------- +// Mainly used to show resistance to an ammo type +// Also used by boils for their idle gibs +//---------------------------------------------------------------------- +void(entity source, vector org, float velrnd, float upbase, float uprnd) SpawnProjectileMeat = +{ + newmis = spawn (); + newmis.classtype = CT_TEMPGIB; + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_NOT; + // Projectile types (Poison/Robot/Stone/Blood) + ProjectileType(source, newmis); + setorigin (newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vecrand(0,velrnd,TRUE); + newmis.velocity_z = upbase, random()*uprnd; + newmis.avelocity = vecrand(100,velrnd,FALSE); + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +// SpawnBlood (All blood particles through this function) +//---------------------------------------------------------------------- +void(entity targ, vector org, vector vel, float part_qty) SpawnBlood = +{ + local float loop_count, part_col; + loop_count = 0; + vel = vel * 0.1; + // monsters show 2 x blood particles (default), it seems pointless + // to reduce that back down here. When a monster has a high ammo + // resistance it needs to be obviously less, the default needs to + // be higher to make a greater visual impact. + // part_qty = part_qty / 2; + + // Exception - breakables don't really bleed red blood + if (targ.classgroup == CG_BREAKABLE) part_col = targ.bleedcolour; + else { + if (targ.poisonous) part_col = MON_BCOLOR_GREEN; + else if (targ.classgroup == CG_ROBOT) part_col = MON_BCOLOR_YELLOW; + else part_col = MON_BCOLOR_RED; + } + + // Loop through particle count creating bursts of particles + while(loop_count < 4) { + if (loop_count == 2 && targ.bleedcolour > 0) part_col = targ.bleedcolour; + particle (org, vel, part_col + rint(random()*7), part_qty); + loop_count = loop_count + 1; + } +}; + +//---------------------------------------------------------------------- +// spawn_touchblood +// Triggered by Touch_Bullet, Touch_PlasmaProjectile, Touch_Projectile +// Used by monsters - DFURY, DOG, FISH, SCORPION, SPIDER, VORELING, ZOMBIEK +//---------------------------------------------------------------------- +void(entity source, entity targ, float damage) spawn_touchblood = +{ + local vector org, vel; + + // The vel calculation uses v_up/right, make sure vectors is setup + makevectors(source.angles); + vel = normalize (source.velocity); + vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5)); + vel = vel + 2*trace_plane_normal; + // Originally vel = ((vel * 200) * 0.2) * 0.01 + vel = vel * 0.4; + + // Check for an origin blood offset (monsters) + if (CheckZeroVector(source.meleeoffset)) org = '0 0 0'; + else org = attack_vector(source.meleeoffset); + + SpawnBlood (targ, source.origin + org, vel, damage); +}; + +//====================================================================== +// SpawnMeatSpray +// Changed to remove dependance on 'self' for missile origin +// Changed parameters to add source and destination of attack +// Changed velocity to side so it is calculated correctly from angles +//====================================================================== +void(entity source, entity targ, float side) SpawnMeatSpray = +{ + local vector org; + + makevectors(source.angles); + + // Check for a melee offset? - Special vector offset + if (CheckZeroVector(source.meleeoffset)) org = v_forward * 16; + else org = attack_vector(source.meleeoffset); + + // Create starting point to spawn + org = org + source.origin; + + if (targ.bleedcolour) SpawnBlood(targ, org, v_up*2, 100); + else { + newmis = spawn (); + newmis.classtype = CT_TEMPGIB; + newmis.classgroup = CG_TEMPENT; + newmis.owner = source; + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_NOT; + + // Projectile types (Poison/Robot/Stone/Blood) + ProjectileType(targ, newmis); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); + + // Use side velocity to determine which direction to throw + newmis.velocity = ((crandom()*16) * v_forward) + (side * v_right); + newmis.velocity_z = newmis.velocity_z + 150 + 50*random(); + + newmis.avelocity = vecrand(100,200,FALSE); + // set newmis duration + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; + } +}; diff --git a/QC_other/QC_arcane/ai_gibs.qc b/QC_other/QC_arcane/ai_gibs.qc new file mode 100644 index 00000000..05668cfd --- /dev/null +++ b/QC_other/QC_arcane/ai_gibs.qc @@ -0,0 +1,751 @@ +/*====================================================================== + AI GIB FUNCTIONS +======================================================================*/ +.float gibondeath; // true/false always gib on death +.vector gib_ofs; // Vertical gib origin offset (override) + +.string gib1mdl; // Gib 1 unique weapon/body part +.string gib2mdl; // Gib 2 unique weapon/body part +.string gib3mdl; // Gib 3 unique weapon/body part +.string gib4mdl; // Gib 4 unique weapon/body part +.string gib5mdl; // Gib 5 unique weapon/body part +.float gib1skin; // Special gib model unique skin no +.float gib2skin; // Special gib model unique skin no +.float gib3skin; // Special gib model unique skin no +.float gib4skin; // Special gib model unique skin no +.float gib5skin; // Special gib model unique skin no +.float gib1frame; // Frame range to randomly pick from +.float gib2frame; // Frame range to randomly pick from +.float gib3frame; // Frame range to randomly pick from +.float gib1sound; // Gib 1 - impact sound type +.float gib2sound; // Gib 2 - impact sound type +.float gib3sound; // Gib 3 - impact sound type +.vector gib1origin; // Gib 1 - Exact origin to spawn +.vector gib2origin; // Gib 2 - Exact origin to spawn +.vector gib3origin; // Gib 3 - Exact origin to spawn +.string gib1soundx; // Gib custom impact sound +.string gib2soundx; // Gib custom impact sound +.string gib3soundx; // Gib custom impact sound +.float gibtype; // What type of gibs (blood, stone, etc) +.float blockudeath; // ID udeath.wav sounds human, block it for non-humanoids +.float gib1dmg; // Special damage from touching +.float gib1exp; // Special damage particle explosion +.float gibAnimTimer; // Starting time for animation +.float gibAnimstart; // Starting frame no for animation +.float gibAnimfinal; // Final frame no for animation + +.float gibpartbase; // Base quantity of particle from gibs +.float gibpartrnd; // Random quantity of particles from gibs +.float gibpartlife; // Lifetime of particles from gibs +.float gibpartchance; // The % percentage chance of particles +.float gibpartstyle; // Particle style + +float GIB_IMPACT_LIGHT = 0; // Light fleshy impact (default) +float GIB_IMPACT_HEAVY = 1; // Heavy fleshy impact +float GIB_IMPACT_ACID = 5; // Fleshy acid burning sound (dangerous) +float GIB_IMPACT_STONE = 10; // Light stones dropping +float GIB_IMPACT_STONE2 = 11; // Dropping pebbles +float GIB_IMPACT_STONE3 = 12; // Dropping pebbles +float GIB_IMPACT_WOOD = 20; // Heavy crossbow/chainsaw +float GIB_IMPACT_METALA = 40; // Short metal impact +float GIB_IMPACT_METALB = 41; // Long metal impact +float GIB_IMPACT_CHAIN = 42; // Blue metal flail + +float GIBTYPE_BLOOD = 0; // Blood (default) +float GIBTYPE_STONE = 1; // Stone/rubble +float GIBTYPE_WOOD = 2; // Woodchip +float GIBTYPE_GLASS = 3; // Glass impact sounds +float GIBTYPE_METAL = 4; // Metal scraps +float GIBTYPE_POISON = 10; // Poisoned flesh + +float MON_BCOLOR_RED = 68; // Red index colour +float MON_BCOLOR_GREEN = 52; // Green index +float MON_BCOLOR_YELLOW = 192; // Bright yellow, not gold +float MON_BCOLOR_SILVER = 36; // Silver/Ice +float MON_BCOLOR_WHITE = 4; // Grey/white + +string GIB_SOUND_HEAVY = "gibs/gibheavy1.wav"; +string GIB_SOUND_HEAVY2 = "gibs/gibheavy2.wav"; +string GIB_SOUND_METALA = "gibs/gibmetala.wav"; +string GIB_SOUND_METALB = "gibs/gibmetalb.wav"; +string GIB_SOUND_CHAIN = "gibs/gibchain.wav"; +string GIB_SOUND_WOOD = "gibs/gibwood.wav"; +string GIB_SOUND_UDEATH = "player/udeath.wav"; +string GIB_SOUND_ACID = "gibs/gibacid.wav"; +string GIB_SOUND_SDEATH = "gibs/stonedeath.wav"; + +string GIB1_BLOOD = "progs/gib_1.mdl"; +string GIB2_BLOOD = "progs/gib_2.mdl"; +string GIB3_BLOOD = "progs/gib_3.mdl"; +string GIB4_BLOOD = "progs/gib_4.mdl"; +string GIB5_BLOOD = "progs/gib_5.mdl"; + +string GIB1_STONE = "progs/gib_s1.mdl"; +string GIB2_STONE = "progs/gib_s2.mdl"; +string GIB3_STONE = "progs/gib_s3.mdl"; +string GIB4_STONE = "progs/gib_s4.mdl"; +string GIB5_STONE = "progs/gib_s5.mdl"; + +string GIB1_POISON = "progs/gib_p1.mdl"; +string GIB2_POISON = "progs/gib_p2.mdl"; +string GIB3_POISON = "progs/gib_p3.mdl"; +string GIB4_POISON = "progs/gib_p4.mdl"; +string GIB5_POISON = "progs/gib_p5.mdl"; + +string GIB1_SOUND = "gibs/gib1.wav"; +string GIB3_SOUND = "gibs/gib3.wav"; +string GIB5_SOUND = "gibs/gib5.wav"; +string GIBHIT1_SOUND = "gibs/gibhit1.wav"; +string GIBHIT2_SOUND = "gibs/gibhit2.wav"; +string GIBHIT3_SOUND = "gibs/gibhit3.wav"; +string GIBHIT4_SOUND = "gibs/gibhit4.wav"; +string GIBHIT5_SOUND = "gibs/gibhit5.wav"; +string GIBHIT1_STONESOUND = "gibs/gibstone1.wav"; +string GIBHIT3_STONESOUND = "gibs/gibstone3.wav"; +string GIBHIT5_STONESOUND = "gibs/gibstone5.wav"; +string GIBHIT1_METALSOUND = "gibs/gibmetal1.wav"; +string GIBHIT3_METALSOUND = "gibs/gibmetal3.wav"; +string GIBHIT5_METALSOUND = "gibs/gibmetal5.wav"; + +float GIB_FADETIME = 10; + +/*====================================================================== + precache_stonegibs, precache_poisongibs + Only load extra gibs when there is a monster requiring them + There are separate gib models because of particle trail colours + These functions have to be called from monster spawn functions + The gib system tests for the global variables defined below + If the extra gibs are not active then default blood vers are used +======================================================================*/ +void() precache_stonegibs = +{ + gibstone = TRUE; + precache_model (GIB1_STONE); // New gib - arm/leg + precache_model (GIB2_STONE); // New gib - body + precache_model (GIB3_STONE); // New gib - slice + precache_model (GIB4_STONE); // New gib - small chunk/ball + precache_model (GIB5_STONE); // New gib - large chunk/ball +}; + +//---------------------------------------------------------------------- +void() precache_poisongibs = +{ + gibpoison = TRUE; + precache_model (GIB1_POISON); // New gib - arm/leg + precache_model (GIB2_POISON); // New gib - body + precache_model (GIB3_POISON); // New gib - slice + precache_model (GIB4_POISON); // New gib - small chunk/ball + precache_model (GIB5_POISON); // New gib - large chunk/ball +}; + +//---------------------------------------------------------------------- +void(entity gibent) DPP_blood_trail = +{ + // Cannot add particle trails to the player! + if (gibent.flags & FL_CLIENT) { + dprint("\b[GIB]\b Cannot add particle trail to player!\n"); + return; + } + + // Stone = dark black dust on the floor + if (gibent.gibtype == GIBTYPE_STONE) { + gibent.traileffectnum = particleeffectnum(DPP_TRSBLOOD); + } + // Glowing green blobs splashed about + else if (gibent.gibtype == GIBTYPE_POISON) { + gibent.traileffectnum = particleeffectnum(DPP_TRPBLOOD); + } + else { + // DISABLED - Excessive blood trails can be bad for large maps + // Typical blood stains (20% chance of more blood) + //if (random() < 0.2) gibent.traileffectnum = particleeffectnum(DPP_ITSBLOOD); + //else gibent.traileffectnum = particleeffectnum(DPP_TRBLOOD); + gibent.traileffectnum = particleeffectnum(DPP_TRBLOOD); + } +}; + +/*====================================================================== + DirectionForDamage + Takes the angle between self and enemy and projects backwards +======================================================================*/ +vector(float gibforce) DirectionForDamage = +{ + local vector gvel; + + // Gentle fountain, not much upward motion + if (self.max_health == MON_GIBFOUNTAIN) { + gvel_x = crandom()*100; + gvel_y = crandom()*100; + gvel_z = 100 + (100 * random()); + return gvel; + } + // Party popper version (large explosion) + else if (self.max_health == MON_GIBEXPLOSION) { + gvel_x = crandom()*250; + gvel_y = crandom()*250; + gvel_z = 400 + (100 * random()); + return gvel; + } + else if (self.max_health == MON_XYGIBVELOCITY) { + // Back to front vector so gib will travel away from enemy + gvel = vectoangles(self.origin - self.enemy.origin); + makevectors(gvel); + gvel = v_forward * (50 + (100 * random())); + gvel = gvel + (v_right * (200 * crandom())); + gvel_z = 100 + (100 * random()); + } + else if (self.max_health == MON_NOGIBVELOCITY) { + // Back to front vector so gib will travel away from enemy + gvel = vectoangles(self.origin - self.enemy.origin); + makevectors(gvel); + gvel = v_forward * (50 + (100 * random())); + gvel = gvel + (v_right * (100 * crandom())); + gvel_z = 30; + } + else { + // Back to front vector so gib will travel away from enemy + gvel = vectoangles(self.origin - self.enemy.origin); + makevectors(gvel); + gvel = v_forward * (50 + (100 * random())); + gvel = gvel + (v_right * (100 * crandom())); + gvel_z = 100 + (100 * random()); + } + + if (gibforce > -50) gvel = gvel * 1.25; + return gvel; +}; + +//====================================================================== +void() RemoveGib = +{ + // Stop any touch functions + self.waitmin = LARGE_TIMER; + // Fade away model + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() CheckFloorGib = +{ + // Is it time for the gib to fade away? + if (self.pain_finished > time) { + // Check for particles from gib + if (self.gibpartstyle > 0) { + if (random() < self.gibpartchance) { + particle_explode(self.origin, self.gibpartbase+random()*self.gibpartrnd, self.gibpartlife+random(), self.gibpartstyle, 0); + } + } + // Check floor below gib (global function) + // Origin at base of model + 16 (typical step height) + ent_floorcheck(self, FLOOR_TRACE_GIBS); + + // Check for final impact animation + if (self.gibAnimfinal > 0 && self.gibAnimTimer < time) { + if (self.walkframe > self.gibAnimfinal) { + self.gibAnimfinal = 0; + RemoveGib(); + return; + } + else { + self.frame = self.gibAnimstart + self.walkframe; + self.walkframe = self.walkframe + 1; + } + } + + // Keep checking + self.think = CheckFloorGib; + self.nextthink = time + 0.1; + } + else RemoveGib(); +}; + +//---------------------------------------------------------------------- +void() TouchGib = +{ + // Always check for sky and void functions first + if (self.touchedvoid) return; // Marked for removal + + //if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + // Disabled - will cause extreme slowdowns with DP/FTE engines + // This function will check the whole surface list which can be + // crazy for extremely large maps + + // Check if the gib can damage (only players) on touch + if (self.gib1dmg > 0 && other.flags & FL_CLIENT) { + T_Damage (other, self, self, self.gib1dmg, DAMARMOR); + self.gib1dmg = 0; + SpawnExplosion(self.gib1exp,self.origin,""); + entity_remove(self, 0.1); + return; + } + + // Check rest of touch restrictions + if (self.waitmin > time) return; // Touch function disabled + if (other == self.owner) return; // Ignore original monster + if (other.classgroup == CG_TEMPENT) return; // Ignore other temp entities + + // Block multiple touch of impact sound + self.waitmin = time + 2 + random() * 2; + + // Is there any time left to setup floor checks + if (self.pain_finished > time + 0.1) { + self.think = CheckFloorGib; + self.nextthink = time + 0.1; + } + + // stop gibs constantly touching moving func bmodels + // let the impact sound work once and then stop + if (other.classgroup == CG_FUNCMOVER) { + if (self.waitmin2 > time) return; + self.waitmin2 = LARGE_TIMER; + } + + //---------------------------------------------------------------------- + // Only need to pick the impact sound once + // No point to keep randomly picking + //---------------------------------------------------------------------- + if (self.noise == "") { + // Setup defaults for gib impact sound + self.volume = ATTN_GIB; + self.noise = SOUND_EMPTY; + + // Check first for unique impact sound + if (self.weapon > 0) { + self.volume = ATTN_NORM; + if (self.weapon == GIB_IMPACT_HEAVY) self.noise = GIB_SOUND_HEAVY; + else if (self.weapon == GIB_IMPACT_METALA) self.noise = GIB_SOUND_METALA; + else if (self.weapon == GIB_IMPACT_METALB) self.noise = GIB_SOUND_METALB; + else if (self.weapon == GIB_IMPACT_CHAIN) self.noise = GIB_SOUND_CHAIN; + else if (self.weapon == GIB_IMPACT_WOOD) self.noise = GIB_SOUND_WOOD; + else if (self.weapon == GIB_IMPACT_ACID) self.noise = GIB_SOUND_ACID; + } + // Check default gib impact types (stone, metal, blood) + else { + if (self.gibtype == GIBTYPE_STONE) { + self.lip = random() * 3; + if (self.lip < 1) self.noise = GIBHIT1_STONESOUND; + else if (self.lip < 2) self.noise = GIBHIT3_STONESOUND; + else self.noise = GIBHIT5_STONESOUND; + } + else if (self.gibtype == GIBTYPE_METAL) { + self.lip = random() * 3; + if (self.lip < 1) self.noise = GIBHIT1_METALSOUND; + else if (self.lip < 2) self.noise = GIBHIT3_METALSOUND; + else self.noise = GIBHIT5_METALSOUND; + } + else { + self.lip = random() * 5; + if (self.lip < 1) self.noise = GIBHIT1_SOUND; + else if (self.lip < 2) self.noise = GIBHIT2_SOUND; + else if (self.lip < 3) self.noise = GIBHIT3_SOUND; + else if (self.lip < 4) self.noise = GIBHIT4_SOUND; + else self.noise = GIBHIT5_SOUND; + } + } + } + + // Has any impact sounds been defined? + if (self.noise != "") sound(self, CHAN_VOICE, self.noise, 1, self.volume); +}; + +//====================================================================== +// ThrowGib was originally in player.qc (moved here instead) +// Spawns a gib model and throws it up into the air to bounce around +//====================================================================== +void(float gib_no, float gib_qty) ThrowGib = +{ + + while (gib_qty > 0) { + gibitem = spawn(); + gibitem.owner = self; + gibitem.classname = "item_gib"; + gibitem.classtype = CT_TEMPGIB; + gibitem.classgroup = CG_TEMPENT; + gibitem.frame = gibitem.skin = 0; + + // Check for any touch/contact damage / explosions + if (self.gib1dmg > 0) gibitem.gib1dmg = self.gib1dmg; + if (self.gib1exp > 0) gibitem.gib1exp = self.gib1exp; + + // Setup gib type (particle trail) + if (self.gibtype) gibitem.gibtype = self.gibtype; + + // Create extra blood particles for DP engine + if (ext_dppart) DPP_blood_trail(gibitem); + + // Arm/leg joint (small) + if (gib_no == 1) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB1_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB1_POISON; + else gibitem.mdl = GIB1_BLOOD; + } + // Torso (large lump) + else if (gib_no == 2) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB2_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB2_POISON; + else gibitem.mdl = GIB2_BLOOD; + } + // Slice (large and wedge like) + else if (gib_no == 3) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB3_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB3_POISON; + else gibitem.mdl = GIB3_BLOOD; + } + // Blob (small and round) + else if (gib_no == 4) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB4_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB4_POISON; + else gibitem.mdl = GIB4_BLOOD; + } + // Blob (large and round) + else if (gib_no == 5) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB5_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB5_POISON; + else gibitem.mdl = GIB5_BLOOD; + } + // Custom Gib (defined by monster) + else if (gib_no == 11) { + // Check for custom model, skin and frame + gibitem.mdl = self.gib1mdl; + gibitem.weapon = self.gib1sound; + if (self.gib1skin > 0) gibitem.skin = self.gib1skin; + if (self.gib1frame) gibitem.frame = rint(random()*self.gib1frame); + if (self.gib1origin) gibitem.oldorigin = self.gib1origin; + + // Check for any particles setup on gib + if (self.gibpartstyle > 0) { + if (self.gibpartbase > 0) gibitem.gibpartbase = self.gibpartbase; + else gibitem.gibpartbase = 1; + if (self.gibpartrnd > 0) gibitem.gibpartrnd = self.gibpartrnd; + else gibitem.gibpartrnd = 1; + if (self.gibpartlife > 0) gibitem.gibpartlife = self.gibpartlife; + else gibitem.gibpartlife = 0.5; + if (self.gibpartchance > 0) gibitem.gibpartchance = self.gibpartchance; + else gibitem.gibpartchance = 0.5; + gibitem.gibpartstyle = self.gibpartstyle; + } + } + // Custom Gib (defined by monster) + else if (gib_no == 12) { + // Check for custom model, skin and frame + gibitem.mdl = self.gib2mdl; + gibitem.weapon = self.gib2sound; + if (self.gib2skin > 0) gibitem.skin = self.gib2skin; + if (self.gib2frame) gibitem.frame = rint(random()*self.gib2frame); + if (self.gib2origin) gibitem.oldorigin = self.gib2origin; + } + // Custom Gib (defined by monster) + else if (gib_no == 13) { + // Check for custom model, skin and frame + gibitem.mdl = self.gib3mdl; + gibitem.weapon = self.gib3sound; + if (self.gib3skin > 0) gibitem.skin = self.gib3skin; + if (self.gib3frame) gibitem.frame = rint(random()*self.gib3frame); + if (self.gib3origin) gibitem.oldorigin = self.gib3origin; + } + // Extra Custom Gib (just models, minimal paramters) + else if (gib_no == 14) { + gibitem.mdl = self.gib4mdl; + if (self.gib4skin > 0) gibitem.skin = self.gib4skin; + } + // Extra Custom Gib (just models, minimal paramters) + else if (gib_no == 15) { + gibitem.mdl = self.gib5mdl; + if (self.gib5skin > 0) gibitem.skin = self.gib5skin; + } + // Special head gib (based on headmdl and skin no) + else if (gib_no == 25) { + gibitem.mdl = self.headmdl; + gibitem.skin = self.skin; + } + + // Check for any animations on impact + if (self.gibAnimfinal > 0) { + gibitem.walkframe = 0; + gibitem.gibAnimstart = self.gibAnimstart; + gibitem.gibAnimfinal = self.gibAnimfinal; + gibitem.gibAnimTimer = time + self.gibAnimTimer + random()*(self.gibAnimTimer*2); + } + + // Bounce like a grenade have trigger/touch impact + gibitem.movetype = MOVETYPE_BOUNCE; + gibitem.solid = SOLID_TRIGGER; + + setmodel (gibitem, gibitem.mdl); + setsize (gibitem, VEC_ORIGIN, VEC_ORIGIN); + + // 10 frames of different pose/sizes for regular gibs + if (gib_no < 10) gibitem.frame = rint(random()*9); + + // Special head gib (plenty of upward motion) + if (gib_no == 25) { + gibitem.oldorigin = self.origin; + setorigin(gibitem, gibitem.oldorigin); + + gibitem.velocity_x = 50 * crandom(); + gibitem.velocity_y = 50 * crandom(); + gibitem.velocity_z = 200 + 100 * random(); + + gibitem.avelocity = '0 0 0'; + gibitem.avelocity_y = 200 + random() * 200; + gibitem.angles_y = gibitem.ideal_yaw = random() * 360; + } + else { + //---------------------------------------------------------------------- + // Spawn gib inside of owner model volume instead of from a single point + // Not used anymore, does not cope very well with larger bound boxes + //gibitem.oldorigin_x = self.absmin_x + random()*(self.maxs_x - self.mins_x); + //gibitem.oldorigin_y = self.absmin_y + random()*(self.maxs_y - self.mins_y); + //gibitem.oldorigin_z = 16 + (random()*12) + self.origin_z; + + //---------------------------------------------------------------------- + // This version copes with taller enemies by using all of the bounding box + if (CheckZeroVector(gibitem.oldorigin)) { + gibitem.oldorigin_x = crandom()*(self.bbmaxs_x*0.75); + gibitem.oldorigin_y = crandom()*(self.bbmaxs_y*0.75); + gibitem.oldorigin_z = (random()*self.bbmaxs_z)-12; + gibitem.oldorigin = gibitem.oldorigin + self.origin + self.gib_ofs; + } + setorigin(gibitem, gibitem.oldorigin); + + //---------------------------------------------------------------------- + // NEW Directional gib velocity with modifier + gibitem.velocity = DirectionForDamage(self.health); + gibitem.angles_y = gibitem.ideal_yaw = random() * 360; + if (gib_no < 10) gibitem.avelocity = vecrand(100,200,FALSE); + else gibitem.avelocity = crandom() * '0 300 0'; + } + + //---------------------------------------------------------------------- + // Check for water content, adjust for water friction + if (pointcontents(gibitem.oldorigin) == CONTENT_WATER) { + gibitem.gravity = 0.35; + gibitem.velocity_z = 0; + } + + gibitem.touch = TouchGib; + gibitem.nextthink = time + GIB_FADETIME + random() * GIB_FADETIME; + gibitem.pain_finished = gibitem.nextthink; + gibitem.think = RemoveGib; + + gib_qty = gib_qty - 1; + } +}; + +//====================================================================== +// Explode monster into a shower of gibs (throw head as well) +//====================================================================== +void() monster_ThrowGib = +{ + self.gibbed = TRUE; // Monster has offical gone to pieces ;) + + //---------------------------------------------------------------------- + // New set of gib sounds - gib1, gib3, gib5 + // FIXME - Sadly the source for these files is UT :( + // Zombies have special gib sound because they always go that way! + // Stone enemies are just a pile of rubble and dust! + //---------------------------------------------------------------------- + if (self.classgroup == CG_ZOMBIE) + sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); + else if (self.gibtype == GIBTYPE_STONE) + sound(self, CHAN_VOICE, GIB_SOUND_SDEATH, 1, ATTN_NORM); + else { + self.lip = random() * 4; + if (self.lip < 1) sound (self, CHAN_VOICE, GIB1_SOUND, 1, ATTN_NORM); + else if (self.lip < 2) sound (self, CHAN_VOICE, GIB3_SOUND, 1, ATTN_NORM); + else { + // Is the monster humanoid? (udeath is the original id gib sound) + if (self.blockudeath) sound (self, CHAN_VOICE, GIB5_SOUND, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, GIB_SOUND_UDEATH, 1, ATTN_NORM); + } + } + + // Some monsters have special death setups + //---------------------------------------------------------------------- + if (self.th_gibdie) { self.th_gibdie(); return; } + + //---------------------------------------------------------------------- + // If any special gib models defined, throw them + //---------------------------------------------------------------------- + if (self.gib1mdl != "") ThrowGib(11, 1); + if (self.gib2mdl != "") ThrowGib(12, 1); + if (self.gib3mdl != "") ThrowGib(13, 1); + if (self.gib4mdl != "") ThrowGib(14, 1); + + //---------------------------------------------------------------------- + // Work through each monster type (default = humanoid) + // GIB 1 - arm/leg (small) + // GIB 2 - torso (large) + // GIB 3 - slice (medium) + // GIB 4 - blob (small) + // GIB 5 - blob (medium) + //---------------------------------------------------------------------- + if (self.classtype == CT_MONDEMON) { + ThrowGib(4, 1 + rint(random()*2)); + ThrowGib(5, 3 + rint(random()*2)); + } + else if (self.classtype == CT_MONDROLE) { + ThrowGib(4, 2 + rint(random()*2)); + ThrowGib(5, 4 + rint(random()*2)); + } + else if (self.classtype == CT_MONDOG) { + ThrowGib(4, 1 + rint(random()*3)); + ThrowGib(5, 1 + rint(random()*2)); + } + else if (self.classtype == CT_MONWRAITH) { + ThrowGib(4, 3 + rint(random()*2)); + } + else if (self.classtype == CT_MONSHAL) { + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classtype == CT_MONGOLEM) { + ThrowGib(11, 4 + rint(random()*2)); + ThrowGib(12, 8 + rint(random()*2)); + } + else if (self.classtype == CT_MONSCORPION) { + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*2)); + } + // Includes brown/green spiders and vorelings + else if (self.classgroup == CG_SPIDER) { + ThrowGib(4, rint(random()*3)); + ThrowGib(11, rint(random()*2)); + } + else if (self.classtype == CT_MONELF) { + ThrowGib(4, 3 + rint(random()*3)); + } + else if (self.classtype == CT_MONSANTA) { + ThrowGib(3, 1); + ThrowGib(4, 8 + rint(random()*4)); + ThrowGib(5, 4 + rint(random()*2)); + ThrowGib(13, 8 + rint(random()*4)); + } + else if (self.classgroup == CG_FISH) { + ThrowGib(4, 3 + rint(random()*3)); + ThrowGib(5, 1); + } + else if (self.classtype == CT_MONBOIL) { + ThrowGib(3, 1 + rint(random()*2)); + ThrowGib(4, 4 + rint(random()*2)); + ThrowGib(4, 5 + rint(random()*3)); + } + else if (self.classgroup == CG_ZOMBIE) { + ThrowGib(4, 3 + rint(random()*3)); + ThrowGib(5, 1 + rint(random()*2)); + } + // Includes vanilla and new hunter ogres + else if (self.classgroup == CG_OGRE) { + ThrowGib(4, 1 + rint(random()*3)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classgroup == CG_DCAPTAIN) { + ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classtype == CT_MONGARGOYLE) { + ThrowGib(4, 2 + rint(random()*3)); + ThrowGib(5, 1 + rint(random()*2)); + } + else if (self.classtype == CT_MONGAUNT) { + ThrowGib(4, 3 + rint(random()*2)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classtype == CT_MONWIZARD) { + ThrowGib(4, 3 + rint(random()*3)); + } + else if (self.classtype == CT_MONSHAM) { + ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + } + else if (self.classtype == CT_MONBOGLORD) { + ThrowGib(4, 5 + rint(random()*5)); + ThrowGib(5, 10 + rint(random()*10)); + } + else if (self.classtype == CT_MONMINOTAUR) { + ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + } + // Default gib setup + else { + // Is humanoid sound blocked? + if (self.blockudeath) { + // Throw large slice gib + ThrowGib(3, rint(random()*2)); + } + // Throw humanoid torso gib + else if (random()<0.5) ThrowGib(2, 1); + // Regular gibs (4=small, 5=large) + ThrowGib(4, 3 + rint(random()*3)); + ThrowGib(5, 1 + rint(random()*1)); + } + + //---------------------------------------------------------------------- + // Throw head last because all previous gibs rely on the origin + //---------------------------------------------------------------------- + if (self.headmdl != "") { + // If monster set for low velocity throw extra gibs instead + if (self.max_health == MON_NOGIBVELOCITY) + ThrowGib(4, rint(random()*4)); + // Throw a head gib instead of switching to one + else ThrowGib(25, 1); + } + // Finally hide monster + entity_hide (self); +}; + +//====================================================================== +// Check health for gib condition +//====================================================================== +void() monster_check_gib = +{ + // There are always exceptions to the every rule! + // Spawns=Explode, Wraith=Explode, Jim=Explode + // SkullWiz=Fade away, Lost Souls=Explode + if (self.gibhealth == MON_NEVERGIB) return; + if (self.touchedvoid) { entity_hide(self); return; } + + // Can only gib a monster once! + if (self.gibbed) return; + + // Make sure gibondeath has gib velocity (health value) + if (self.gibondeath) self.health = self.gibhealth; + // Is it time to throw a gib party? + if ( self.health < (self.gibhealth + 1) || self.gibondeath) + monster_ThrowGib(); +}; + +//====================================================================== +// Forward compiler reference +void(entity targ, entity attacker) Killed; + +//====================================================================== +// Gib a body on the floor (special setup) +//====================================================================== +void(entity onflr, float impactdmg) monster_flrbody_gib = +{ + local entity tself, tother; + + onflr.bodyonflr = string_null; // no more body gibbing + tself = self; tother = other; // save self/other + self = onflr; other = tself; // switch around + if (onflr.classgroup == CG_ZOMBIE) { + self.health = 0; + Killed(onflr, tself); + } + else { + self.max_health = MON_NOGIBVELOCITY; // use minimal velocity + monster_ThrowGib(); // throw parts + } + + self = tself; other = tother; // switch back + SpawnBlood (onflr, onflr.origin, '0 0 50', impactdmg*4); + if (onflr.bodyonflrtrig) trigger_strs(onflr.bodyonflrtrig,self); + // Hide/Remove original body/shadow + entity_hide(onflr); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/ai_minions.qc b/QC_other/QC_arcane/ai_minions.qc new file mode 100644 index 00000000..7b1c28e0 --- /dev/null +++ b/QC_other/QC_arcane/ai_minions.qc @@ -0,0 +1,267 @@ +/*====================================================================== + MINIONS FUNCTIONS + + Minion Support functions + Setup and update minion counters centralized to reduce errors + monster_death_precheck remove from the counter (dying event) + minion_voreling, minion_spider add to the counter (spawn event) + +======================================================================*/ + +.float minion_baseattack; // Block base attack within melee range +.float minion_count; // Current active amount of minions +.float minion_maxcount; // Maximum amount of active minions +.float minion_trigger; // Spawn counter for trigger event +.float minion_maxtrigger; // Spawn total for trigger event +.string miniontarget; // targetname string for trigger event +.float minion_throwspeed; // Starting forward speed of ball +.float minion_throwextra; // Extra random forward speed of ball +.float minion_throwside; // Extra sideways momentum (+/-) +.entity minion_test; // Test entity for minion collision +float MIN_MAXACTIVE = 5; // Maximum amount active at once +float MIN_MAXTRIGGER = 5; // How many spawns before triggering +float MIN_THROWSPD = 200; // Monster jump speed +float MIN_THROWRND = 50; // Some randomness +float MIN_THROWSIDE = 50; // Sideways movement (+/-) + +void(vector org, vector dir, vector avel, float proj_type) Launch_Grenade; + +//---------------------------------------------------------------------- +void() setup_minionsupport = +{ + // Reset all counters + self.minion_active = TRUE; + self.minion_count = 0; + self.minion_trigger = 0; + + // Setup default max counters (check for existing values) + if (!self.minion_maxcount) self.minion_maxcount = MIN_MAXACTIVE; + if (!self.minion_maxtrigger) self.minion_maxtrigger = MIN_MAXTRIGGER; + + // Chance to fire original (base) attack of monster + if (!self.minion_baseattack) self.minion_baseattack = TRUE; + + // Throw speed of minion ball/egg + if (!self.minion_throwspeed) self.minion_throwspeed = MIN_THROWSPD; + if (!self.minion_throwextra) self.minion_throwextra = MIN_THROWRND; + if (!self.minion_throwside) self.minion_throwside = MIN_THROWSIDE; +}; + +//---------------------------------------------------------------------- +void(entity msource, float countupd) update_minioncount = +{ + if (!msource.minion_active) return; + // Add to the active minion counters (check range limits) + msource.minion_count = msource.minion_count + countupd; + if (msource.minion_count < 0) msource.minion_count = 0; + if (msource.minion_count > msource.minion_maxcount) + msource.minion_count = msource.minion_maxcount; + + // Check for trigger events (ignore death triggers) + if (countupd > 0) { + msource.minion_trigger = msource.minion_trigger + countupd; + if (msource.minion_trigger >= msource.minion_maxtrigger) { + msource.minion_trigger = 0; + // Check for trigger event string? + if (msource.miniontarget != "") { + trigger_strs(msource.miniontarget, msource); + } + } + } +}; + +//---------------------------------------------------------------------- +// Check if anymore minions can be spawned at the moment +//---------------------------------------------------------------------- +float(entity msource) query_minionactive = +{ + if (!msource.minion_active) return NEGATIVE; + if (msource.minion_count < msource.minion_maxcount) return TRUE; + else return FALSE; +}; + +//====================================================================== +// Check if there is space to spawn a minion +// +// Version 1 - use a touch trigger to detect players +// Version 2 - use a findradius command to find players +//====================================================================== +void() delete_minionspace = { if (self.minion_test) entity_remove(self.minion_test,0.1); } +void() touch_minionspace = { if (other.flags & FL_CLIENT) self.aflag = TRUE; }; + +//---------------------------------------------------------------------- +// Touch trigger version for detecting client/players too close +//---------------------------------------------------------------------- +void(vector org, vector minspace, vector maxspace) setup_minionspace = +{ + // Create a touch trigger if one does not exist + if (!self.minion_test) self.minion_test = spawn(); + // reset all parameters + self.minion_test.movetype = MOVETYPE_NONE; + self.minion_test.solid = SOLID_TRIGGER; + setmodel(self.minion_test, MODEL_EMPTY); + self.minion_test.skin = self.minion_test.frame = 0; + self.minion_test.flags = 0; + + // Move touch trigger to correct location + setorigin(self.minion_test, org); + setsize (self.minion_test, minspace, maxspace); + // Enable touch function and reset collision flag + self.minion_test.touch = touch_minionspace; + self.minion_test.aflag = FALSE; +}; + +float() test_minionspace = +{ + // Quick exit if no touch entity exists + if (!self.minion_test) return FALSE; + + // Basic world collision test for origin/min/max of spawn + if (pointcontents(self.minion_test.origin) != CONTENT_EMPTY) return FALSE; + if (pointcontents(self.minion_test.origin+'-16 -16 -24') != CONTENT_EMPTY) return FALSE; + if (pointcontents(self.minion_test.origin+'16 16 40') != CONTENT_EMPTY) return FALSE; + + // Switch off touch function and check for collision + self.minion_test.touch = SUB_Null; + if (self.minion_test.aflag == TRUE) return FALSE; + else return TRUE; +}; + +//---------------------------------------------------------------------- +// Findradius version for detecting client/players too close +//---------------------------------------------------------------------- +float(vector org) find_minionspace = +{ + local entity minstuff; + local float foundclient; + + // Basic world collision test for origin/min/max of spawn + if (pointcontents(org) != CONTENT_EMPTY) return FALSE; + if (pointcontents(org+'-16 -16 -24') != CONTENT_EMPTY) return FALSE; + if (pointcontents(org+'16 16 40') != CONTENT_EMPTY) return FALSE; + + foundclient = TRUE; + // The player can cover crazy amount of distance very fast + // Extend radius out further to catch running players + minstuff = findradius(org, MONAI_RANGESUMMON); + while (minstuff) { + if (minstuff.flags & FL_CLIENT) { + foundclient = FALSE; + minstuff = world; + } + minstuff = minstuff.chain; + } + return foundclient; +}; + +/*====================================================================== + MINION EGGS + * Spawns a projecile (egg) at the player + * Wait for egg to bounce and settle + * Spawn (rotating) minion inside egg and then explode +======================================================================*/ +void(vector minion_org, entity minion_targ) minion_spider; +void(vector minion_org, entity minion_targ) minion_scorpion; +void(vector minion_org, entity minion_targ) minion_voreling; + +//---------------------------------------------------------------------------- +void() Explode_Egg = +{ + // Remove egg and throw gibs up as minion grows + setmodel (self, ""); + if (self.classgroup == CT_MONWRAITH) self.gib1mdl = MODEL_PROJ_WSHELL; + else if (self.classgroup == CT_MONSHAL) self.gib1mdl = MODEL_PROJ_SSHELL; + self.gib1frame = 9; + self.max_health = MON_GIBFOUNTAIN; + ThrowGib(11,rint(2+random()*4)); + + // Safely remove egg + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Once the egg has landed via Grenade Touch function +// The minion is spawned and the egg is set to explode +//---------------------------------------------------------------------- +void() Hatch_Egg = +{ + // Block this functions + if (self.state == STATE_DISABLED) return; + // Has the egg been marked for removal? + if (self.touchedvoid) return; + + // Its possible for the egg to get stuck, setup death timer + if (!self.gibbed) { + self.gibbed = TRUE; + self.attack_finished = time + 6; + } + // Egg has been stuck for too long, destroy it + if (self.attack_finished < time) { + self.state = STATE_DISABLED; + self.think = Explode_Egg; + self.nextthink = time + 0.1; + return; + } + + // Turn off touch function and any movement + self.touch = SUB_Null; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + self.velocity = '0 0 0'; + + // Check if the egg can hatch? turn on collision + // setup new bounds and extend upwards for testing + setsize (self, VEC_HULLT_MIN, VEC_HULLT_MAX); + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_TOSS; + self.oldorigin = self.origin; + self.origin_z = self.origin_z + 8; + droptofloor(); + + // Can the egg hatch yet? Solid content? + if (!walkmove(0,0) || pointcontents(self.origin) == CONTENT_SOLID) { + self.origin = self.oldorigin; + self.think = Hatch_Egg; + self.nextthink = time + 1 + random(); + self.solid = SOLID_NOT; // turn off again + return; + } + + // Setup egg ready for minion + self.state = STATE_DISABLED; + + // Setup spawn location for minion + traceline (self.origin+'0 0 128', self.origin-'0 0 256', TRUE, world); + self.oldorigin = trace_endpos + '0 0 32'; + + // Spawn minion inside of egg model + // self.owner is re-assigned to minion to avoid shell gibs interacting + if (self.owner.classtype == CT_MONWRAITH) { + if (self.owner.spawnflags & MON_WRAITH_SCORPIONS) minion_scorpion(self.oldorigin, self.enemy); + else minion_spider(self.oldorigin, self.enemy); + } + else if (self.owner.classtype == CT_MONSHAL) minion_voreling(self.oldorigin, self.enemy); + + // Skip a couple of frames + self.think = Explode_Egg; + self.nextthink = time + 0.4; +}; + +//---------------------------------------------------------------------- +// Work out direction speed of egg and then launch it! +//---------------------------------------------------------------------- +void(vector eggofs) Create_Egg = +{ + local vector org, dir; + local float egg_speed; + if (self.health < 1) return; + + // Turn towards player and drop the egg! + makevectors(self.angles); + org = self.origin + attack_vector(eggofs); + egg_speed = self.minion_throwspeed + (random() * self.minion_throwextra); + dir = (v_forward * egg_speed) + (v_right * (crandom()*self.minion_throwside)); + Launch_Grenade(org,dir,'0 0 0',CT_PROJ_MEGG); + SUB_AttackFinished (2 + random()); +}; diff --git a/QC_other/QC_arcane/ai_pathcorner.qc b/QC_other/QC_arcane/ai_pathcorner.qc new file mode 100644 index 00000000..4cc71e02 --- /dev/null +++ b/QC_other/QC_arcane/ai_pathcorner.qc @@ -0,0 +1,478 @@ +/*====================================================================== + Path_Corner FUNCTIONS +======================================================================*/ +float PATHC_EXACT = 1; // Exact route logic instead of random (def) +float PATHC_INSTANT = 2; // Instantly move to this path_corner +float PATHC_REVERSE = 4; // Train direction is reversed at this corner +float PATHC_NOPAUSE = 8; // Train does not pause on this corner + +float PATHC_RESET = 15; // Use to reset spawnflags + +float PATHC_TARGET1 = 16; // Has target been found +float PATHC_TARGET2 = 32; // Has target2 been found +float PATHC_BACKLINK = 64; // Backward path route +float PATHC_DEADEND = 128; // no targets found + +float STATE_ROUTE1 = 1; // Route 1 is the priority (forward) +float STATE_ROUTE2 = 2; // Route 2 is the priority (forward) +float STATE_ROUTE3 = 3; // Route 3 is the priority (backward) +float STATE_EXACT = 4; // Switch to exact route selection +float STATE_RANDOM = 5; // Switch to random route selection + +/*====================================================================== +/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -24) (8 8 48) EXACT INSTANT REVERSE NOPAUSE +Node based path routing system +-------- KEYS -------- +targetname : Name of current path corner +corner_event : Name of target(s) to trigger when used/touched +corner_route : Change path_corner route (1-3 routes, 4=exact, 5=random) +corner_switch: Change spawnflags REVERSE (-1=NO, 1=YES, 2=Toggle) +corner_pause : Change spawnflags NOPAUSE (-1=NO, 1=YES, 2=Toggle) +state : Starting route (1=forward, 2=alt forward, 3=backward) +target : Targetname of FORWARD route +target2 : Alternative FORWARD route +targetback : Override default BACKWARD route +wait : fixed amount of time to pause at corner (=-1 stop) +delay : random amount of time to pause at corner +alpha : Override default for visual arrows (def=0.35) +speed : Override default speed of func_train (def=100) +-------- SPAWNFLAGS -------- +EXACT : Exact route logic (def=random route choices) +INSTANT : Move instantly to this corner if next destination +REVERSE : Train direction is reversed for next corner +NOPAUSE : Train does not pause on this path corner +-------- NOTES -------- +Node based path routing system + +======================================================================*/ +entity(string arrowmdl, vector arroworg) path_corner_spawnarrow = +{ + local entity arrow; + arrow = spawn(); + arrow.classtype = CT_ATTACHMENT; + arrow.movetype = MOVETYPE_NONE; + arrow.solid = SOLID_NOT; + setmodel(arrow, arrowmdl); + setorigin(arrow, arroworg); + setsize(arrow, VEC_ORIGIN, VEC_ORIGIN); + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) arrow.effects = arrow.effects + EF_NOSHADOW; + + if (!self.alpha) arrow.alpha = 0.35; + else arrow.alpha = self.alpha; + return arrow; +}; + +//---------------------------------------------------------------------- +void() path_corner_updatearrow = +{ + // Visual AI pathing only active in dev mode + if (developer == 0) return; + if (query_configflag(SVR_DEVHELPER)) return; + if ( !(self.spawnflags & PATHC_TARGET2) ) return; + + // Switch colour of arrow based on route logic + if (self.spawnflags & PATHC_TARGET1 && self.state == STATE_ROUTE1) { + if (self.attachment) self.attachment.skin = 3; + if (self.attachment2) self.attachment2.skin = 2; + if (self.attachment3) self.attachment3.skin = 0; + } + else if (self.spawnflags & PATHC_TARGET2 && self.state == STATE_ROUTE2) { + if (self.attachment) self.attachment.skin = 0; + if (self.attachment2) self.attachment2.skin = 3; + if (self.attachment3) self.attachment3.skin = 0; + } + else if (self.spawnflags & PATHC_BACKLINK && self.state == STATE_ROUTE3) { + if (self.attachment) self.attachment.skin = 0; + if (self.attachment2) self.attachment2.skin = 2; + if (self.attachment3) self.attachment3.skin = 3; + } + else { + // Default - Random logic has no route highlight + if (self.attachment) self.attachment.skin = 0; + if (self.attachment2) self.attachment2.skin = 2; + if (self.attachment3) self.attachment3.skin = 0; + } +}; + +//---------------------------------------------------------------------- +void() path_corner_setuparrow = +{ + // Visual AI pathing only active in dev mode + if (developer == 0) return; + if (query_configflag(SVR_DEVHELPER)) return; + + // Draw back link arrow + if (self.spawnflags & PATHC_BACKLINK) { + self.attachment3 = path_corner_spawnarrow( self.mdl, self.oldorigin); + self.movedir = normalize(self.movetarget3.oldorigin - self.oldorigin); + self.attachment3.angles = vectoangles(self.movedir); + } + // Missing backlink, this is a bad situation! + // Highlight this problem with a pointing up RED arrow + else { + // There is no back link, so use forward target instead + if (self.spawnflags & PATHC_TARGET1) self.oldenemy = self.movetarget; + else self.oldenemy = self; + self.attachment3 = path_corner_spawnarrow( self.mdl, self.oldorigin); + self.movedir = normalize(self.oldenemy.oldorigin - self.oldorigin); + self.attachment3.angles = vectoangles(self.movedir); + self.attachment3.skin = 4; + makevectors(self.movedir); + self.attachment3.angles = self.attachment3.angles + vectoangles(v_up); + } + + // Draw route choice 1 (target) + if (self.spawnflags & PATHC_TARGET1) { + self.attachment = path_corner_spawnarrow( self.headmdl, self.oldorigin); + self.movedir = normalize(self.movetarget.oldorigin - self.oldorigin); + self.attachment.angles = vectoangles(self.movedir); + } + // Missing forward link (deadend) + // Highlight this issue with a pointing up RED arrow + else { + // There is no forward link, so use back link instead + if (self.spawnflags & PATHC_BACKLINK) self.oldenemy = self.movetarget3; + else self.oldenemy = self; + self.attachment = path_corner_spawnarrow( self.headmdl, self.oldorigin); + self.movedir = normalize(self.oldenemy.oldorigin - self.oldorigin); + self.attachment.angles = vectoangles(self.movedir); + self.attachment.skin = 4; + makevectors(self.movedir); + self.attachment.angles = self.attachment.angles + vectoangles(v_up); + } + + // Draw route choice 2 (target2) + if (self.spawnflags & PATHC_TARGET2) { + self.attachment2 = path_corner_spawnarrow( self.headmdl, self.oldorigin); + self.movedir = normalize(self.movetarget2.oldorigin - self.oldorigin); + self.attachment2.angles = vectoangles(self.movedir); + self.attachment2.skin = 2; + } + + // Update arrows if route logic active + path_corner_updatearrow(); +}; + +//---------------------------------------------------------------------- +void() path_corner_setuptargets = +{ + local entity fdest; + + // Cycle through list for TARGET path_corner + if (self.target != "") { + fdest = find (world, targetname, self.target); + while(fdest) { + if (fdest.classtype == CT_PATHCORNER) { + // Update (spawnflags) path_corner and save entity + self.spawnflags = self.spawnflags | PATHC_TARGET1; + self.movetarget = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.target); + } + } + // Cycle through list for TARGET2 path_corner + if (self.target2 != "") { + fdest = find (world, targetname, self.target2); + while(fdest) { + if (fdest.classtype == CT_PATHCORNER) { + // Update (spawnflags) path_corner and save entity + self.spawnflags = self.spawnflags | PATHC_TARGET2; + self.movetarget2 = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.target2); + } + } + + // Has the path corner back link override key been used? + // If this override string does not exist, weird things will happen + if (self.targetback != "") { + fdest = find (world, targetname, self.targetback); + while(fdest) { + // Update (spawnflags) path_corner and save entity + if (fdest.classtype == CT_PATHCORNER) { + self.spawnflags = self.spawnflags | PATHC_BACKLINK; + self.movetarget3 = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.targetback); + } + } + else { + // Setup back link name, if none exist use targetname + self.targetback = self.targetname; + + // Cycle through list for BACKLINK path_corner + fdest = find (world, target, self.targetback); + while(fdest) { + // Update (spawnflags) path_corner and save entity + if (fdest.classtype == CT_PATHCORNER) { + self.spawnflags = self.spawnflags | PATHC_BACKLINK; + self.movetarget3 = fdest; + fdest = world; + } + else fdest = find(fdest, target, self.targetback); + } + } + + // Double check TARGET2 before declaring a deadend + if ( !(self.spawnflags & PATHC_BACKLINK) ) { + fdest = find (world, target2, self.targetback); + while(fdest) { + if (fdest.classtype == CT_PATHCORNER) { + self.spawnflags = self.spawnflags | PATHC_BACKLINK; + self.movetarget3 = fdest; + fdest = world; + } + else fdest = find(fdest, target2, self.targetback); + } + } + + // Bad situation : Found a path corner with no back-link + // label as deadend (direction reverse) and circular link + if ( !(self.spawnflags & PATHC_BACKLINK) ) { + dprint("\b[PATH_CORNER]\b ("); dprint(self.targetname); + dprint(") - Deadend found\n"); + if (self.movetarget) self.movetarget3 = self.movetarget; + else self.movetarget3 = self; + self.spawnflags = self.spawnflags | PATHC_DEADEND; + } + + // Random time interval as this is not important + // Generate developer arrow models on path_corner + if (developer > 0) { + self.nextthink = time + 0.5 + random(); + self.think = path_corner_setuparrow; + } + +}; + +//---------------------------------------------------------------------- +void() path_corner_use = +{ + // Change spawnflags NOPAUSE (-1=NO, 1=YES, 2=Toggle) + if (other.corner_pause) { + // Store the parameter locally so it can modified + self.corner_pause = other.corner_pause; + if (self.corner_pause == 2) { + if (self.spawnflags & PATHC_NOPAUSE) self.corner_pause = 1; + else self.corner_pause = -1; + } + // The toggle state uses the on/off code by storing the value + // locally and modifying it beforehand + if (self.corner_pause > 0) { + if (self.spawnflags & PATHC_NOPAUSE) + self.spawnflags = self.spawnflags - PATHC_NOPAUSE; + self.wait = -1; + } + else if (self.corner_pause < 0) { + self.spawnflags = self.spawnflags | PATHC_NOPAUSE; + self.wait = 0; + } + } + + // Change spawnflags REVERSE (-1=NO, 1=YES, 2=Toggle) + if (other.corner_switch) { + // Store the parameter locally so it can modified + self.corner_switch = other.corner_switch; + if (self.corner_switch == 2) { + if (self.spawnflags & PATHC_REVERSE) self.corner_switch = -1; + else self.corner_switch = 1; + } + // The toggle state uses the on/off code by storing the value + // locally and modifying it beforehand + if (self.corner_switch > 0) { + self.spawnflags = self.spawnflags | PATHC_REVERSE; + } + else if (self.corner_switch < 0) { + if (self.spawnflags & PATHC_REVERSE) + self.spawnflags = self.spawnflags - PATHC_REVERSE; + } + } + + // Change speed of train moving towards path_corner (default=100) + if (other.corner_speed > 0) self.speed = other.corner_speed; + + // Changing routes? + if (other.corner_route) { + // Double check that the routes exist before setting them + if (other.corner_route == STATE_ROUTE1 && + self.spawnflags & PATHC_TARGET1) self.state = STATE_ROUTE1; + else if (other.corner_route == STATE_ROUTE2 && + self.spawnflags & PATHC_TARGET2) self.state = STATE_ROUTE2; + else if (other.corner_route == STATE_ROUTE3 && + self.spawnflags & PATHC_BACKLINK) self.state = STATE_ROUTE3; + // If changing routing logic, make sure spawnflag is updated + else if (other.corner_route == STATE_EXACT) { + self.spawnflags = self.spawnflags | PATHC_EXACT; + self.state = STATE_ROUTE1; + } + // When routing logic is changed, need to reset state + else if (other.corner_route == STATE_RANDOM) { + if (self.spawnflags & PATHC_EXACT) + self.spawnflags = self.spawnflags - PATHC_EXACT; + self.state = STATE_ROUTE1; + } + dprint("Corner ("); dprint(self.targetname); + dprint(") Route ("); dprint(ftos(self.state)); + dprint(")\n"); + } + else { + // Toggle route selection if EXACT routing logic is active + // and the path corner has multiple routes available + if (self.spawnflags & PATHC_EXACT && self.spawnflags & PATHC_TARGET2) { + if (self.state == STATE_ROUTE1) self.state = STATE_ROUTE2; + else if (self.state == STATE_ROUTE2) self.state = STATE_ROUTE3; + else self.state = STATE_ROUTE1; + } + } + + // Update arrows if route logic active + path_corner_updatearrow(); +}; + +//---------------------------------------------------------------------- +void() path_corner_stop = +{ + other.goalentity = other.movetarget = world; + other.pausetime = time + LARGE_TIMER; + other.think = other.th_stand; + other.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() path_corner_touch = +{ + if (!(other.flags & FL_MONSTER)) return; // ONLY Monsters can use path corners + if (other.health < 1) return; // Dead things don't need path guidance + if (other.enemy) return; // In combat, no time to follow paths + if (other.movetarget != self) return; // Suppose to follow this corner? + + // If ogre, play chainsaw drag sound (50% of the time) + if (other.classtype == CT_MONOGRE || other.classtype == CT_MONHOGRE) + if (random() > 0.5) sound (other, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + + // Fire any event targets (activator = monster) + if (self.corner_event) trigger_strs(self.corner_event,other); + // Check if this path_corner is a dead end? (no target) + if (self.spawnflags & PATHC_DEADEND) path_corner_stop(); + // Has this path corner been linked yet? Try again? + if ( !(self.spawnflags & PATHC_TARGET1) ) path_corner_setuptargets(); + + // Is there a target to move towards? + if (self.spawnflags & PATHC_TARGET1) { + // Check for a second random path? + if (self.spawnflags & PATHC_TARGET2) { + // Check route logic (only use forward routes) + if (self.spawnflags & PATHC_EXACT) { + if (self.state == STATE_ROUTE1) other.goalentity = self.movetarget; + else other.goalentity = self.movetarget2; + } + else { + // Default = random routes + if (random() < 0.5) other.goalentity = self.movetarget; + else other.goalentity = self.movetarget2; + } + } + // Default, 1 path = 1 choice + else other.goalentity = self.movetarget; + // Setup goal for monster to move toward + other.movetarget = other.goalentity; + + // Does the monster need to pause at current path_corner? + if (self.wait < 0) path_corner_stop(); + else if (self.wait > 0) { + other.pausetime = time + self.wait + random()*self.delay; + other.think = other.th_stand; + other.nextthink = time + 0.05; + } + // no pause, turn and keep walking towards next goal + else { + other.ideal_yaw = vectoyaw(other.goalentity.origin - other.origin); + other.pausetime = 0; + } + } + // No new target to follow, stand around + else path_corner_stop(); +}; + +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +void() path_corner = +{ + // Really need to prevent path corners with no targetname + // otherwise it will cause problems with linking later + if (self.targetname == "") { + dprint("\b[PATH_CORNER]\b Missing targetname!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Cache arrow models if devmode active + if (developer > 0) { + self.headmdl = MODEL_CORNER1; // Top of Arrow (forward) + self.mdl = MODEL_CORNER2; // Bottom of Arrow (backward) + precache_model(self.headmdl); + precache_model(self.mdl); + } + + // Setup time delay at corner ( wait + delay*random() ) + if (self.wait == 0) self.wait = 0; + if (self.delay <= 0) self.delay = 0; + + // Reset all path targets/entities, spawnflags (low 4 bits only) + self.spawnflags = self.spawnflags & PATHC_RESET; + self.movetarget = self.movetarget2 = self.movetarget3 = world; + + self.solid = SOLID_TRIGGER; // always touchable + self.movetype = MOVETYPE_NONE; // Does not move + self.classtype = CT_PATHCORNER; // Self identification + setsize (self, '-8 -8 -16', '8 8 16'); // Size of trigger + self.touch = path_corner_touch; // Useable by monsters + self.use = path_corner_use; // Used by trigger events + + // Work out which (random/toggle) route logic is active + if (self.spawnflags & PATHC_EXACT) { + // If state is specified and outside range, reset + if (self.state < STATE_ROUTE1 || self.state > STATE_ROUTE3) + self.state = STATE_ROUTE1; + } + else self.state = STATE_ROUTE1; + // Cannot start with route 2 (alt forward) if target2 is empty!?! + if (self.state == STATE_ROUTE2 && self.target2 == "") self.state = STATE_ROUTE1; + + // Many of the ID maps have path_corners buried in solid architecture + // which makes it difficult to see where they are and impossible to draw + // visual arrows on them. + // + // This code checks for solid content and keeps nudging the + // temporary origin upwards 8 units at a time (max 64 units) + // If it cannot find any empty space above, it will give up and + // use the original origin point instead + // + self.oldorigin = self.origin; + if (pointcontents(self.oldorigin) == CONTENT_SOLID) { + self.lip = 8; + while (self.lip > 0) { + self.lip = self.lip - 1; + self.oldorigin = self.oldorigin + '0 0 8'; + if (pointcontents(self.oldorigin) != CONTENT_SOLID) + self.lip = -1; + } + } + // Origin is still in something solid, reset + if (self.lip != -1) self.oldorigin = self.origin; + + // Check for dead end path_corner + if (self.target == "") self.spawnflags = self.spawnflags | PATHC_DEADEND; + + // Allow 1 frame for path_corners to spawn + // Got to start linking before func_train (2nd frame) + self.think = path_corner_setuptargets; + self.nextthink = time + 0.1; + +}; diff --git a/QC_other/QC_arcane/ai_states.qc b/QC_other/QC_arcane/ai_states.qc new file mode 100644 index 00000000..d570d0c8 --- /dev/null +++ b/QC_other/QC_arcane/ai_states.qc @@ -0,0 +1,175 @@ +/*====================================================================== + Three basic types of behaviour is Quake, stand, walk and run +======================================================================*/ + +//---------------------------------------------------------------------- +// ai_stand +//---------------------------------------------------------------------- +void() ai_stand = +{ + if (self.health < 1) return; // Health < 0, no more standing + monster_liquid_check(); // Check for liquid damage + check_tethertimer(); // Check for tethering system + if (FindTarget ()) return; // Found a player? + // Double check there is a goalentity, no pause and no turret + if (self.goalentity && time > self.pausetime && self.movespeed >= 0) { + // Make sure AI is turning towards new path corner direction + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + ChangeYaw (); + self.th_walk (); + } + else { + // Only test ground walking monsters (no fly/swim) + // Check global map variable first (default = off) + if (map_bodyflrcheck == TRUE && self.classmove == MON_MOVEWALK) + ent_floorcheck(self, FLOOR_TRACE_MONSTER); + } +}; + +//---------------------------------------------------------------------- +// ai_walk +//---------------------------------------------------------------------- +void(float dist) ai_walk = +{ + local vector vertdiff; + + if (self.health < 1) return; // Health < 0, no more walking + // Turret monsters don't walk, they stand around + if (self.movespeed < 0) { self.th_stand(); return; } + monster_liquid_check(); // Check for liquid damage + movedist = dist; + if (FindTarget ()) return; // Found a player? + + // Allow for flying units to move up/down between path corners + if (self.classmove == MON_MOVEFLY) { + // Allow for some Z axis tolerance + if (fabs(self.origin_z - self.goalentity.origin_z) > MON_ZTOL) { + if (self.move_elev == 0) self.move_elev = MON_ZMOVEMENT; + if (self.origin_z < self.goalentity.origin_z) + self.origin_z = self.origin_z + self.move_elev; + else self.origin_z = self.origin_z - self.move_elev; + + vertdiff = '0 0 0'; + vertdiff_x = fabs(self.goalentity.origin_x - self.origin_x); + vertdiff_y = fabs(self.goalentity.origin_y - self.origin_y); + // Are the path corners stacked on top of each other? + if (vertdiff_x < MON_ZTOL && vertdiff_y < MON_ZTOL) dist = 0; + } + } + + // Move to goal (code function) + movetogoal (dist); +}; + +//---------------------------------------------------------------------- +// ai_run +//---------------------------------------------------------------------- +void(float dist) ai_run = +{ + if (self.health < 1) return; // Health < 0, no more running + monster_liquid_check(); // Check for liquid damage + movedist = dist; + + // Is the enemy dead or no longer taking damage? + if (SUB_healthEnemyTarget() < 1 || SUB_takedEnemyTarget() == DAMAGE_NO) { + // Switch around any enemytarget for enemy + SUB_switchEnemyTarget(); + self.enemy = self.goalentity = world; + // Is the old enemy still alive and can it be damaged? + if (self.oldenemy.health > 0 && self.oldenemy.takedamage > 0) { + self.enemy = self.oldenemy; + HuntTarget (); + } + else { + // Nothing left to fight, stand around and wait for something + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.think = self.th_walk; + } + else self.think = self.th_stand; + return; + } + } + + // Wake up any monsters in visual range + self.show_hostile = time + 1; + + // check visibility of enemy + enemy_vis = visible(SUB_entEnemyTarget()); + if (enemy_vis) self.search_time = time + 5; + + // look for other coop players + if (coop && self.search_time < time) { + if (FindTarget ()) return; + } + + // Calculate if goal/enemy is infront, the range and direction + enemy_infront = infront(SUB_entEnemyTarget()); + enemy_range = range(SUB_entEnemyTarget()); + enemy_yaw = vectoyaw(SUB_orgEnemyTarget() - self.origin); + self.enemydist = range_distance(SUB_entEnemyTarget(), FALSE); + + //---------------------------------------------------------------------- + // Check for temporary turret mode via trigger_monsterturret + //---------------------------------------------------------------------- + if (self.turretactive.classtype == CT_TRIGMONTURRET && enemy_vis && self.th_missile) { + if (self.turrettimer < time) { + // Is there a chance to pause? + if (random() < self.turretactive.count) + self.turrettimer = time + 1 + random()*2; + + self.attack_state = AS_TURRET; + ai_run_missile (); + return; + } + } + + //---------------------------------------------------------------------- + // Check if tether system is active + //---------------------------------------------------------------------- + if (check_tethersystem() && self.health > 0) { + self.tetherlock = TRUE; + if (self.th_tether) self.think = self.th_tether; + return; + } + + //---------------------------------------------------------------------- + // Check if blocked by breakables + CheckBlockedBreakable(); + + //---------------------------------------------------------------------- + if (self.attack_state == AS_MISSILE) { + ai_run_missile (); return; + } + else if (self.attack_state == AS_JUMP) { + ai_run_jump (); return; + } + else if (self.attack_state == AS_MELEE) { + ai_run_melee (); return; + } + //---------------------------------------------------------------------- + // This has to go after range/melee attack state checks + // otherwise the AI will not do anything + // These checks are for the next frame, not this one + // Exception : wizards need to strafe quickly + //---------------------------------------------------------------------- + // Some monsters don't have distance checks, like wizards + // All monsters have checkattack defined, no need for ifs and buts! + if (self.enemymaxdist || self.enemydist < MON_MAX_RANGE) + self.th_checkattack (); + + //---------------------------------------------------------------------- + if (self.attack_state == AS_SLIDING) { + ai_run_slide (dist); return; + } + else if (self.attack_state == AS_SIDESTEP) { + ai_run_sidestep (dist); return; + } + else if (self.attack_state == AS_BACKWARD) { + ai_run_backward (dist); return; + } + + // head straight towards the enemy + // unless of course I am a turret! + movetogoal (dist); +}; diff --git a/QC_other/QC_arcane/ai_subs.qc b/QC_other/QC_arcane/ai_subs.qc new file mode 100644 index 00000000..8ffd5b3c --- /dev/null +++ b/QC_other/QC_arcane/ai_subs.qc @@ -0,0 +1,1234 @@ +/*====================================================================== + AI (monster) FUNCTIONALITY + + Visibility checks + - float(entity targ) visible + - float(entity targ, vector s_offset, vector t_offset, float nomonsters) visxray + - float(entity targ) visblocked + - float (entity targ, vector s_ofset, vector t_ofset) visblocked_wide + - float(entity targ) infront + - float(vector org_source, vector org_targ) check_liquidblock + + Distance checks + - float(entity targ) range + - float(entity targ, float flat2d) range_distance + - float (entity source, entity targ) rangeattack_check + + Angle checks + - float(entity source, entity targ, float offset, float reverse) targangle + - float(entity source, entity targ) targzone + + Hunt & Target Enemies + - void() HuntTarget + - void() FoundTarget + - void(float wakeupothers) FoundHuntTarget + - float() FindTarget + + AI animation movement (used mostly in monsters QC file) + - void(float dist) ai_forward + - void(float dist) ai_back + - void(float dist) ai_pain + - void(float dist) ai_painforward + - void() ai_turn + - float() FacingIdeal + - void() ai_face + - void() ai_resetangles + - void(float dist) ai_charge + - void(float dist) ai_chargenoturn + - void() ai_charge_side + - void() ai_charge_front + + AI ATTACK states + - void() ai_run_melee + - void() ai_run_missile + - void() ai_run_jump + - void(float dist) ai_run_slide + - void(float dist) ai_run_sidestep + - void(float dist) ai_run_backward + + AI interactions with Breakable System + - float(entity source, entity targ, float ignorenoshoot) ai_foundbreakable + - void(float brkdmg) ai_damagebreakable + - void(float brkdmg) ai_jumpbreakable + + AI melee checks and damage + - float(float attackdist) ai_checkmelee + - void() ai_melee + - void(float dmg_multiplier) ai_meleesmash + - void() ai_melee_side + +======================================================================*/ + +/*====================================================================== + check_liquidblock + - Checks pointcontents of source+target because traceline parms + are not 100% reliable for flagging water/air content + - One function check for all the different visibility functions + - Designed to work with the new liquidblock entity flag +======================================================================*/ +float(vector org_source, vector org_targ) check_liquidblock = +{ + local float pc_source, pc_targ; + + // Is r_wateralpha set or monsters forced to check liquid surfaces? + if (liquid_alpha == 1 || self.liquidblock) { + // Check point contents first + pc_source = pointcontents(org_source); + pc_targ = pointcontents(org_targ); + // Are point content different? (like water/air) + if (pc_source != pc_targ) return TRUE; + + // Standard traceline check (not 100% reliable) + if (trace_inopen && trace_inwater) return TRUE; + } + + // No liquid check required + return FALSE; +}; + +/*====================================================================== + visible (target entity) + Conditions added to water surface check + - most maps are compiled with transparent water nowadays +======================================================================*/ +float(entity targ) visible = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, TRUE, self); // see through other monsters + + // Debug system (enabled via axe) uses funcs from subs_soc.qc + // This will draw a diamond model where the AI is looking + if (self.debuglvl) { + if (!debugent1) debugent1 = spawn_devmarker(self.origin); + spot1 = vectoangles(self.origin - trace_endpos); + makevectors(spot1); + spot2 = trace_endpos + (v_up * -16) + (v_forward * 50); + setorigin(debugent1,'0 0 0'); + setorigin(debugent1, spot2); + } + + // Check for liquid surface block condition + if (check_liquidblock(spot1, spot2) == TRUE) return FALSE; + + if (trace_fraction == 1) return TRUE; + return FALSE; +}; + +/*====================================================================== + visxray (variable options) + Returns TRUE if there is no blocking, FALSE if something in the way + Custom options for variable source/target offsets and monster blocking + (nomonsters) TRUE = no block, FALSE = blocked + self is excluded from any trace starting points +======================================================================*/ +float(entity targ, vector s_offset, vector t_offset, float nomonsters) visxray = +{ + local vector spot1, spot2; + + // Bmodels don't have proper origins + if (self.bsporigin) spot1 = bmodel_origin(self) + s_offset; + else spot1 = self.origin + s_offset; + + spot2 = targ.origin + t_offset; + traceline (spot1, spot2, nomonsters, self); // custom options + + // Check for liquid surface block condition + if (check_liquidblock(spot1, spot2) == TRUE) return FALSE; + + // monster blocking changes which test to use + if (nomonsters) { + // Has the traceline gone from source>target without anything blocking? + if (trace_fraction == 1) return TRUE; + return FALSE; + } + else { + // Is the entity hit by the traceline the targ destination? + if (trace_ent == targ) return TRUE; + return FALSE; + } +}; + +/*====================================================================== + visblocked (target entity) + check to see if sightline is blocked by other monsters + Really only used in CheckAttack functions (was in org ID code) +======================================================================*/ +float(entity targ) visblocked = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, FALSE, self); // blocked by monsters + + // Check for liquid surface block condition + if (check_liquidblock(spot1, spot2) == TRUE) return FALSE; + + // Original ID behaviour for this type of function + // Traceline entity hit = enemy? + if (trace_ent == targ) return FALSE; + return TRUE; +}; + +/*====================================================================== + viswide (target entity) + check to see if sightline is blocked by other monsters + extra wide check using 3 traces, +/- 16 left/right and origin + All three traces have to complete for a positive result +======================================================================*/ +float (entity targ, vector s_ofset, vector t_ofset) visblocked_wide = +{ + local vector spot1, spot2, spot3, tr_line; + local float tr_leftmon, tr_rightmon, tr_result; + + tr_line = '0 0 0'; + tr_leftmon = tr_rightmon = 0; + makevectors(self.angles); + + //------------------------------------------------------------------ + // Traceline 1 - MIDDLE + spot1 = self.origin + s_ofset_x * v_forward + s_ofset_y * v_right + s_ofset_z * v_up; + spot2 = targ.origin + t_ofset; + traceline (spot1, spot2, FALSE, self); + + // Is trace entity the same as the target entity? + if (trace_ent == targ) tr_line_x = 1; + // Check for liquid surface block condition + // Only need to do this once for the central traceline + // If this fails then the left/right should as well + if (check_liquidblock(spot1, spot2) == TRUE) tr_line_x = 0; + + //------------------------------------------------------------------ + // Traceline 2 - 32 units LEFT + spot3 = spot1 - (v_right * 16); + traceline (spot3, spot2, FALSE, self); + // Work out if clear shot, hit world or another entity + if (trace_ent == targ) tr_line_y = 1; + else if (trace_ent != world) tr_leftmon = 1; + + if (self.debuglvl) { + if (!debugent2) debugent2 = spawn_devmarker(self.origin); + setorigin(debugent2, trace_endpos); + } + + //------------------------------------------------------------------ + // Traceline 3 - 32 units RIGHT + spot3 = spot1 + (v_right * 16); + traceline (spot3, spot2, FALSE, self); + // Work out if clear shot, hit world or another entity + if (trace_ent == targ) tr_line_z = 1; + else if (trace_ent != world) tr_rightmon = 1; + + if (self.debuglvl) { + if (!debugent3) debugent3 = spawn_devmarker(self.origin); + setorigin(debugent3, trace_endpos); + } + + //------------------------------------------------------------------ + // Default = no clear shot (keep aim/moving) + tr_result = TRUE; + // SIMPLE 3 complete traces = nothing blocking visibility + if (tr_line_x + tr_line_y + tr_line_z == 3) tr_result = FALSE; + // Central trace is good but either side has hit something? + else if (tr_line_x) { + // Hit a monster on either side = always fail! + if (tr_leftmon || tr_rightmon) tr_result = TRUE; + // The crssbow bolt is fired from the LEFT side, only right can be clear + else if (self.classtype == CT_MONDCROSS) { + if (tr_line_y == 0 && tr_line_z == 1) tr_result = FALSE; + } + // Default - space available on either side + else if (tr_line_y + tr_line_z == 1) tr_result = FALSE; + } + + //------------------------------------------------------------------ + if (self.debuglvl) { + dprint("Trace ("); dprint(ftos(tr_line_x)); + dprint(" "); dprint(ftos(tr_line_y)); + dprint(" "); dprint(ftos(tr_line_z)); + dprint(") Ent ("); dprint(ftos(tr_leftmon)); + dprint(" "); dprint(ftos(tr_rightmon)); + dprint(") = ("); dprint(ftos(tr_result)); + dprint(")\n"); + } + return tr_result; +}; + +/*====================================================================== + infront (target entity) + - relies on self being set correctly before entering this function + - returns 1 if the entity is in front (in sight) of self +======================================================================*/ +float(entity targ) infront = +{ + local vector vec; + local float dot; + + makevectors (self.angles); // sets v_forward, etc globals + vec = normalize (targ.origin - self.origin); + dot = vec * v_forward; + + if ( dot > 0.3) return TRUE; + else return FALSE; +}; + +/*====================================================================== + range (target entity) + returns the range catagorization of an entity reletive to self + uses constants defined in defs.qc +======================================================================*/ +float(entity targ) range = +{ + local vector spot1, spot2; + local float r; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + r = vlen (spot1 - spot2); + + if (r < MON_RANGE_MELEE) return RANGE_MELEE; // <120 = MELEE + else if (r < MON_RANGE_NEAR) return RANGE_NEAR; // <500 = NEAR + else if (r < MON_RANGE_MID) return RANGE_MID; // <1000 = MID + return RANGE_FAR; // >1000 = FAR +}; + +/*====================================================================== + range_distance (target entity) + returns the vector distance between two points +======================================================================*/ +float(entity targ, float flat2d) range_distance = +{ + local vector spot1, spot2; + local float r; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + if (flat2d) { spot1_z = spot2_z = 0; } + r = vlen (spot1 - spot2); + + return r; +}; + +/*====================================================================== + rangeattack_check + check to see if (source) can get a clear shot at (targ) + Ignores any water/air content checks +======================================================================*/ +float (entity source, entity targ) rangeattack_check = +{ + local vector spot1, spot2; + local float r; + + // origin+offset, otherwise cannot see player up/down slopes + spot1 = source.origin + source.view_ofs; + spot2 = targ.origin + targ.view_ofs; + r = vlen(spot1 - spot2); + + // Maximum range attack (was 600 taken from shambler, changed to 1000) + if (r > MON_RANGE_MID) return FALSE; + + // Monsters without melee should always range anything really close + if (!source.th_melee && r < MON_RANGE_MELEE) return TRUE; + + traceline (spot1, spot2, FALSE, source); // trace hits monsters (infighting) + if (trace_ent != targ) return FALSE; // don't have a clear shot + + // Does the world define any water transparency + if (liquid_alpha == 1 || source.liquidblock) { + // sight line crossed contents + if (trace_inopen && trace_inwater) return FALSE; + } + + return TRUE; +}; + +/*====================================================================== + targangle + Returns what angle the target entity is relative to the source entity + Useful for checking where the player is located. + source, targ = entity origins to create vector angle + reverse = the creation of the vector can be reversed + offset = shift the final angle clockwise. (frontal sight cone 315-45) +======================================================================*/ +float(entity source, entity targ, float offset, float reverse) targangle = +{ + local float targ_dir, targ_ang; + + // Calculate vector angle between two points (source, target) + if (reverse) targ_dir = vectoyaw(source.origin - targ.origin); + else targ_dir = vectoyaw(targ.origin - source.origin); + + targ_ang = anglemod( (source.angles_y - targ_dir) + offset ); + return targ_ang; +}; + +// Modified version of targangle not using entities but supplied origins +// Targets Y angles needs to be supplied as no entity reference available +float(vector source, vector targ, float offset, float reverse, float dst_ang) viewangle = +{ + local float targ_dir, targ_ang; + + // Calculate vector angle between two points (source, target) + if (reverse) targ_dir = vectoyaw(source - targ); + else targ_dir = vectoyaw(targ - source); + + targ_ang = anglemod( (dst_ang - targ_dir) + offset ); + return targ_ang; +}; + +/*====================================================================== + targzone (source entity, target entity) + - Checks which zone the target enemy is located in relation to source (self) + 0 = Behind (315-45), 1 = Left (45-135), 2 = Front (135-225), Right = (225-315) +======================================================================*/ +float(entity source, entity targ) targzone = +{ + local float target_ang; + + // Work out angle the angle of the player based on the monster (source) + // Add 45 degree offset to shift clockwise the frontal sight cone + target_ang = targangle(source, targ, 45, TRUE); + + if (target_ang > 270) return TARGET_RIGHT; + else if (target_ang > 180) return TARGET_FRONT; + else if (target_ang > 90) return TARGET_LEFT; + else return TARGET_BACK; +}; + + +/*====================================================================== + HuntTarget + Main routine - constantly running/turning towards the enemy +======================================================================*/ +void() HuntTarget = +{ + if (self.health < 1) return; // Dead monsters don't hunt! + + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // Some monsters have special wakeup animations before attacking + self.nextthink = time + 0.1; + self.think = self.th_run; + // Default 1s wait (NM adjusted) before attacking + if (!self.attack_instant) SUB_AttackFinished (1); +}; + +/*====================================================================== + FoundTarget + - An enemy target has been found, wakeup and hunt target + - Used by FindTarget once an enemy target has been found + - used by T_Damage (combat.qc) for infighting +======================================================================*/ +void() FoundTarget = +{ + if (self.health < 1) return FALSE; // Dead monsters don't hunt! + + // Check for Liquid surface block entity key + // if the monster has range attack, can NOW see through liquid surface + if (self.liquidblock == TRUE && self.th_missile) + self.liquidblock = FALSE; + + if (self.enemy.flags & FL_CLIENT) { + sight_entity = self; // Highlight an angry monster for others + sight_entity_time = time; // reset wakeup timer + } + + //---------------------------------------------------------------------- + // This will cause a group of monsters to all attack the same target + // Using the global sight enemy system which works with FindTarget() + // Always check for an empty sighttarget first because the + // the global sight entity could have an empty targetname + //---------------------------------------------------------------------- + if (self.sighttarget != "") { + if (self.enemy.targetname == self.sighttarget) { + // Make sure the sight target is alive before chasing it + self.oldenemy = find(world, targetname, self.sighttarget); + if (self.oldenemy.health > 0) { + if (self.oldenemy.takedamage > DAMAGE_NO) { + sight_entity = self.enemy; // Highlight target for others + sight_entity_time = time; // reset wakeup timer + monster_sightsound(); // Always make wakeup noise! + } + } + self.oldenemy = world; + } + } + + self.show_hostile = time + 1; // wake up other monsters + // Only play wakeup sound if player, not for other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + HuntTarget (); // Keep running after enemy +}; + +/*====================================================================== + FoundHuntTarget + - This is a combination of FoundTarget and HuntTarget + - Does not do any sight sound, needs to be done outside this func + - Does not pause or wait for any monster, straight to combat + - Has no end funtion state, can decide this afterwards +======================================================================*/ +void(float wakeupothers) FoundHuntTarget = +{ + if (self.health < 1) return; // Dead monsters don't hunt! + if (!self.enemy) return; + + // Check for Liquid surface block entity key + // if the monster has range attack, can NOW see through liquid surface + if (self.liquidblock == TRUE && self.th_missile) + self.liquidblock = FALSE; + + if (self.enemy.flags & FL_CLIENT && wakeupothers == TRUE) { + sight_entity = self; // Highlight an angry monster for others + sight_entity_time = time; // reset wakeup timer + } + + self.show_hostile = time + 1; // wake up other monsters + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + SUB_AttackFinished (1); // wait a while before first attack +}; + +/*====================================================================== + FindTarget + - Main routine for finding a PLAYER target + - Returns TRUE if an enemy was sighted +======================================================================*/ +float() FindTarget = +{ + local entity client, playtarg; + + if (self.health < 1) return FALSE; // Dead monsters don't hunt! + + //---------------------------------------------------------------------- + // Does the global sight entity match the enemy sight group? + // Always check for an empty sighttarget first because the + // the global sight entity could have an empty targetname + //---------------------------------------------------------------------- + if (self.sighttarget != "") { + if (sight_entity.targetname == self.sighttarget) { + // Make sure the sight target is alive before chasing it + if (sight_entity.health < 0) self.sighttarget = ""; + else { + // If using enerytarget system, switch off tracking entity first + if (self.enemy.classtype == CT_ENEMYTARGET) SUB_switchEnemyTarget(); + self.enemy = sight_entity; // Switch to new enemy + FoundTarget (); // Run+turn towards new enemy + return TRUE; + } + } + } + //---------------------------------------------------------------------- + // if the first spawnflag bit is set, the monster will only wake up on + // really seeing the player, not another monster getting angry + // Zombies have their ambush/crucified spawnflag mix up fixed + //---------------------------------------------------------------------- + if (sight_entity_time >= time - 0.1 && !(self.spawnflags & MON_AMBUSH) ) { + client = sight_entity; // Global variable + if (client.enemy == self.enemy) return TRUE; + } + else { + client = checkclient (); // Find a client in current PVS + if (!client) return FALSE; // If no client found, return + } + + //---------------------------------------------------------------------- + // Checkclient is *suppose* to find ONLY players in the current PVS + // but it seems the code does something slightly different + // Checkclient will return other 'objects' (monsters) who are mad + // at the player, which is suppose to be caught with sight_enemy + // Find the player entity (client,.enemy,world) for specific checks + //---------------------------------------------------------------------- + if (client.flags & FL_CLIENT) playtarg = client; + else { + if (client.enemy) playtarg = client; + else playtarg = find(world,targetname,"player"); + } + + //---------------------------------------------------------------------- + // If current enemy = client (player), already got *that* target + //---------------------------------------------------------------------- + if (client == self.enemy) return FALSE; + + //---------------------------------------------------------------------- + // Check for debug mode, invis artifact, menu system active + //---------------------------------------------------------------------- + if (playtarg.flags & FL_NOTARGET) return FALSE; + // Boss monsters can see invisible players! + if (playtarg.items & IT_INVISIBILITY && self.bossflag == FALSE) return FALSE; + if (intermission_running) return FALSE; + + //---------------------------------------------------------------------- + // Is the client/player >1000 = FAR do nothing, too far away + //---------------------------------------------------------------------- + enemy_range = range (client); + if (enemy_range == RANGE_FAR && !self.attack_sniper) return FALSE; + + //---------------------------------------------------------------------- + // Do not wake up unless the client (player/monster) is visible + //---------------------------------------------------------------------- + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + + //---------------------------------------------------------------------- + // (Distance >128 && < 500) Is client infront+side and hostile? + // show_hostile flag is set when the player fires a weapon + //---------------------------------------------------------------------- + if (enemy_range == RANGE_NEAR) { + if (client.show_hostile < time) { + if (self.sight_nofront == FALSE && !infront (client)) + return FALSE; + } + } + //---------------------------------------------------------------------- + // (Distance 500+) Is client infront? + //---------------------------------------------------------------------- + else if (enemy_range > RANGE_NEAR) { + if (self.sight_nofront == FALSE && !infront (client)) + return FALSE; + } + + // At this point if the enemy is <120 (melee range) the enemy + // will always wake up and turn around towards the player + + //---------------------------------------------------------------------- + // Finally got a target, check if its a player + // This is an odd sitation because at this point client *should* be + // the player/client and this code tries to fix the problem by + // searching through enemy of enemy chains + //---------------------------------------------------------------------- + self.enemy = client; + if ( !(client.flags & FL_CLIENT) ) { + // Is the enemy of the enemy a player? + self.enemy = self.enemy.enemy; + if ( !(client.enemy.flags & FL_CLIENT) ) { + self.enemy = world; + return FALSE; + } + } + FoundTarget (); // Run+turn towards new enemy + return TRUE; // stop previous routine got a target + +}; + + +//====================================================================== +// ai_face (generic) +//---------------------------------------------------------------------- +void() ai_face = +{ + if (self.health < 1) return;// Unusual check, caught elsewhere + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); // Done in code +}; + +//---------------------------------------------------------------------- +// ai_forward +//---------------------------------------------------------------------- +void(float dist) ai_forward = +{ + walkmove (self.angles_y, dist); +}; + +//---------------------------------------------------------------------- +// ai_forward + ai_face +//---------------------------------------------------------------------- +void(float dist) ai_faceforward = +{ + ai_face(); + walkmove (self.angles_y, dist); +}; + +//---------------------------------------------------------------------- +// ai_back + backface +//---------------------------------------------------------------------- +void(float dist) ai_back = +{ + walkmove ( (self.angles_y+180), dist); +}; + +void(float dist) ai_backface = +{ + ai_face(); + ai_back(dist); +}; + +//---------------------------------------------------------------------- +// ai_pain (does nothing, just uses ai_back instead) +//---------------------------------------------------------------------- +void(float dist) ai_pain = +{ + ai_back (dist); +}; + +//---------------------------------------------------------------------- +// ai_painforward +//---------------------------------------------------------------------- +void(float dist) ai_painforward = +{ + walkmove (self.angles_y, dist); + // Not sure why Id used ideal_yaw when other functions use angles_y +// walkmove (self.ideal_yaw, dist); +}; + +//---------------------------------------------------------------------- +// ai_turn (Very costly function, re-using FindTarget again) +//---------------------------------------------------------------------- +void() ai_turn = +{ + if (FindTarget ()) return; + ChangeYaw (); // Code function +}; + + +//---------------------------------------------------------------------- +// FacingIdeal +//---------------------------------------------------------------------- +float() FacingIdeal = +{ + local float delta; + + delta = anglemod(self.angles_y - self.ideal_yaw); + if (delta > 45 && delta < 315) return FALSE; + else return TRUE; +}; + +//---------------------------------------------------------------------- +// ai_trackenemy +//---------------------------------------------------------------------- +float() ai_trackenemy = +{ + if (visible(self.enemy)) { + self.attack_track = SUB_orgEnemyTarget(); + ai_face(); + return TRUE; + } + else return FALSE; +}; + +//---------------------------------------------------------------------- +// ai_resetangles +//---------------------------------------------------------------------- +void() ai_resetangles = +{ + // There is a chance when finished a monster jump that some + // of the angles (X/Z) values are wrong and need resetting + // Should only be used after jump functions + self.angles_x = self.angles_z = 0; +}; + +//---------------------------------------------------------------------- +// ai_charge (generic) +// - The monster is in a melee attack, +// so get as close as possible to .enemy +//---------------------------------------------------------------------- +void(float dist) ai_charge = +{ + ai_face (); + movetogoal (dist); +}; + +//---------------------------------------------------------------------- +// ai_chargenoturn (generic) +//---------------------------------------------------------------------- +void(float dist) ai_chargenoturn = +{ + movetogoal (dist); +}; + +//---------------------------------------------------------------------- +// ai_charge_side (generic) +//---------------------------------------------------------------------- +void() ai_charge_side = +{ + local vector dtemp; + local float heading; + + // aim to the left of the enemy for a flyby + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); + + makevectors (self.angles); + dtemp = self.enemy.origin - (30 * v_right); + heading = vectoyaw(dtemp - self.origin); + + walkmove(heading, 20); +}; + +//---------------------------------------------------------------------- +// ai_charge_front (generic) +//---------------------------------------------------------------------- +void() ai_charge_front = +{ + local float heading; + + ai_face(); // Turn towards enemy first + + makevectors (self.angles); + heading = vectoyaw(self.enemy.origin - self.origin); + + walkmove(heading, 10); +}; + +/*====================================================================== + ai_run_melee + - Turn and close until within an angle to launch a melee attack +======================================================================*/ +void() ai_run_melee = +{ + self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + + //---------------------------------------------------------------------- + // Facing towards the ENEMY target? (ideal_yaw) + //---------------------------------------------------------------------- + if (FacingIdeal()) { + self.th_melee (); + self.attack_state = AS_STRAIGHT; + } +}; + +/*====================================================================== + ai_run_missile + - Turn in place until within an angle to launch a missile attack +======================================================================*/ +void() ai_run_missile = +{ + self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + + //---------------------------------------------------------------------- + // Facing towards the ENEMY target? (ideal_yaw) + //---------------------------------------------------------------------- + if (FacingIdeal()) { + self.th_missile (); + self.attack_state = AS_STRAIGHT; + } +}; + +/*====================================================================== + ai_run_jump + - Turn in place until within an angle to jump attack +======================================================================*/ +void() ai_run_jump = +{ + self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + + //---------------------------------------------------------------------- + // Facing towards the ENEMY target? (ideal_yaw) + //---------------------------------------------------------------------- + if (FacingIdeal()) { + self.th_jump (); + self.attack_state = AS_STRAIGHT; + } +}; + +/*====================================================================== + ai_run_slide + - Strafe sideways, but stay at aproximately the same range +======================================================================*/ +void(float dist) ai_run_slide = +{ + local float ofs; + + // It is better to re-calcuate this than wait for ai_run to update + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + // self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + if (self.lefty > 0) ofs = 90; + else ofs = -90; + + // Tests if monsters can strafe or not by moving the monster + if (walkmove (self.ideal_yaw + ofs, dist)) return; + + // Switch strafe sides for later use + self.lefty = rint(1 - self.lefty); + if (walkmove (self.ideal_yaw - ofs, dist)) return; + + // Try moving backwards if both sides are blocked + walkmove (self.ideal_yaw - 180, dist); +}; + +/*====================================================================== + ai_run_sidestep + - Turn 90 degrees and move to the side +======================================================================*/ +void(float dist) ai_run_sidestep = +{ + local float ofs; + + if (self.attack_sidestep < time) { + self.attack_sidestep = time + 4 + random()*4; + self.lefty = rint(1 - self.lefty); + } + if (self.lefty > 0) ofs = 85; + else ofs = -85; + + // Work out angle to face for enemy and then turn +/- 90 degrees + // so that the monster is moving sideways to the enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin) + ofs; + ChangeYaw (); + + // Tests if monsters can move sideways + if (walkmove (self.ideal_yaw, dist)) return; + // Switch strafe sides for later use + self.attack_sidestep = -1; +}; + +/*====================================================================== + ai_run_backwards + - Turn 180 degrees and move backwards +======================================================================*/ +void(float dist) ai_run_backward = +{ + // Work out angle to face for enemy and then turn +/- 90 degrees + // so that the monster is moving sideways to the enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin) + 180; + ChangeYaw (); + + // Tests if monsters can move backwards + if (walkmove (self.ideal_yaw, dist)) return; + // Cannot walk backwards, move sideways instead + self.attack_state = AS_SIDESTEP; +}; + +/*====================================================================== + ai_foundbreakable + Check if the monster is allowed to break the breakable!?! +======================================================================*/ +float(entity source, entity targ, float ignorenoshoot) ai_foundbreakable = +{ + // Found a breakable in the way? + if (targ.classtype == CT_FUNCBREAK) { + // Check if a monster and nomonster damage/trigger allowed? + if (source.flags & FL_MONSTER && targ.spawnflags & BREAK_NOMONSTER) + return FALSE; + // Ignoring noshoot spawnflag? (designed for jump/missile events) + else if (ignorenoshoot == TRUE) return TRUE; + // Can the breakable be damaged? + else if (targ.spawnflags & BREAK_NOSHOOT) return FALSE; + // Its a breakable that breaks! + else return TRUE; + } + return FALSE; +}; + +/*====================================================================== + ai_immunedamage + Check if a breakable/pushable is immune to damage from monsters +======================================================================*/ +float(entity source, entity targ) ai_immunedamage = +{ + // Found a breakable? + if (targ.classtype == CT_FUNCBREAK) { + // Check no damage spawnflag? + if (source.flags & FL_MONSTER && targ.spawnflags & BREAK_NOMONSTER) + return TRUE; + } + // Found a pushable? + else if (targ.classtype == CT_FUNCPUSHABLE) { + // Check no damage spawnflag? + if (source.flags & FL_MONSTER && targ.spawnflags & PUSH_NOMONSTER) + return TRUE; + } + return FALSE; +}; + +/*====================================================================== + ai_damagebreakable + Check if the monster (self) can hit any breakables infront (target) + Triple trace infront (self.angles) up,middle,down + If any breakables found, damage them to see if they will break +======================================================================*/ +void(float brkdmg) ai_damagebreakable = +{ + local vector spot1, spot2; + local float ldmg; + + // Setup damage, forward facing vector and initial trace origin + ldmg = (random() + random() + random()) * brkdmg; + makevectors(self.angles); + spot1 = self.origin; + + // Trace directly infront of entity using angles + spot2 = spot1 + v_forward * 100; + traceline (spot1, spot2, TRUE, self); + if (ai_foundbreakable(self, trace_ent, FALSE)) { + // Check for any monster damage modifier on breakable + if (trace_ent.brkmondmg>0) ldmg = ldmg * trace_ent.brkmondmg; + T_Damage (trace_ent, self, self, ldmg, DAMARMOR); + } + else { + // Trace upwards + spot2 = spot1 + v_forward * 100 + v_up * 64; + traceline (spot1, spot2, TRUE, self); + if (ai_foundbreakable(self, trace_ent, FALSE)) { + // Check for any monster damage modifier on breakable + if (trace_ent.brkmondmg>0) ldmg = ldmg * trace_ent.brkmondmg; + T_Damage (trace_ent, self, self, ldmg, DAMARMOR); + } + else { + // Trace downwards + spot2 = spot1 + v_forward * 100 - v_up * 64; + traceline (spot1, spot2, TRUE, self); + if (ai_foundbreakable(self, trace_ent, FALSE)) { + // Check for any monster damage modifier on breakable + if (trace_ent.brkmondmg>0) ldmg = ldmg * trace_ent.brkmondmg; + T_Damage (trace_ent, self, self, ldmg, DAMARMOR); + } + } + } +}; + +/*====================================================================== + ai_jumpbreakable + Check if the monster can trigger a breakable from jump attack +======================================================================*/ +void(float brkdmg) ai_jumpbreakable = +{ + if (ai_foundbreakable(self, other,TRUE) && other.brktrigjump != 0) { + // Found a breakable which is prone to jump damage + trigger_ent(other, self); + } + else ai_damagebreakable(brkdmg); // Damage any breakables +}; + +/*====================================================================== + ai_checkmelee + Check if the monster (self) can attack enemy (target) + and returns TRUE if the monster is within XYZ range +======================================================================*/ +float(float attackdist) ai_checkmelee = +{ + local vector spot1, spot2; + local float delta, zdiff; + + // Calculate distance and z axis difference seperate + spot1 = SUB_orgEnemyTarget(); + spot2 = self.origin; + zdiff = fabs(spot1_z - spot2_z); + spot1_z = spot2_z = 0; // Flatten Z axis before vector length + delta = vlen(spot1 - spot2); // Calculate vector distance + + // Is the enemy too far away and the zaxis is wrong (too low/high) + if (delta < attackdist && zdiff < MONAI_MELEEZAXIS) return TRUE; + else return FALSE; +}; + +/*====================================================================== + ai_melee (generic) + - slashing type of damage facing forward + really assuming the monster is stationary while attacking +======================================================================*/ +void() ai_melee = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEFRONT)) return; // Too far away + + // Can the target bleed? - no blood/damage, quick exit + // This candamage test not in origina id code (sync'd to melee_side) + if (!CanDamage (self.enemy, self)) return; + + // 1-9 damage + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Only spawn blood/gore/sound every second + if (self.meleetimer < time) { + self.meleetimer = time + 1; + SpawnMeatSpray (self, self.enemy, random() * 100); + } + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Some melee weapons have swing and hit as separate sounds + // This is trigger_once per melee combat swing + // No check if meleehitsound is defined or not + if (self.meleecontact) { + self.meleecontact = FALSE; + sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + ai_meleesmash (generic) + - large smashing damage overhead attack, usually a single strike + really assuming the monster is stationary while attacking +======================================================================*/ +void(float dmg_multiplier) ai_meleesmash = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(3*dmg_multiplier); // Damage any breakables + if (!ai_checkmelee(self.meleerange)) return; // Too far away + + // Can the target bleed? - no blood/damage, quick exit + // This candamage test not in origina id code (sync'd to melee_side) + if (!CanDamage (self.enemy, self)) return; + + // This function is designed for monsters attacking players or infighting + // If this is infighting do more damage as it will look more impressive + // Also if this damage is enough to kill in a single blow, gib for effect + if (self.enemy.flags & FL_MONSTER) dmg_multiplier = dmg_multiplier * 2; + + // 1-9 damage + ldmg = (random() + random() + random()) * dmg_multiplier; + if (ldmg < 1) ldmg = 1; + if (self.enemy.health < ldmg) ldmg = ldmg*3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Some melee weapons have swing and hit as separate sounds + // This is trigger_once per melee combat swing + if (self.meleecontact) { + self.meleecontact = FALSE; + if (self.meleehitsound) sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + ai_melee_side (generic) + - move forward/side and attack (can cause animation sliding errors) + this is really designed for glancing blows and monsters which are + moving fast like they are charging at the player +======================================================================*/ +void() ai_melee_side = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(10); // Damage any breakables + ai_charge_side(); // move (20 units) to the side of enemy + if (!ai_checkmelee(MONAI_MELEESIDE)) return; // Too far away + + // Can the target bleed? - no blood/damage, quick exit + if (!CanDamage (self.enemy, self)) return; + + // 1-9 damage + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, random() * 50); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Some melee weapons have swing and hit as separate sounds + // This is trigger_once per melee combat swing + // No check if meleehitsound is defined or not + if (self.meleecontact) { + self.meleecontact = FALSE; + sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + ai_shockwave + - produce a large ground slam/shockwave effect + - Used by hammer ogres and golems +======================================================================*/ +void() ai_shockwave_think = +{ + self.wait = rint((time - self.ltime)*10); + if (self.wait > 6) SUB_Remove(); + else { + self.frame = self.wait; + if (self.wait > 4) { + if (!self.delay) {self.delay = time;} + self.alpha = 1-((time - self.delay)*5); + } + self.angles_y = anglemod(self.angles_y + rint(random()*20)); + self.nextthink = time + TIME_MINTICK; + } +}; + +//---------------------------------------------------------------------- +void(vector imp_vec, float imp_damage, float imp_radius, float imp_forward, float imp_up) ai_shockwave = +{ + local entity swave, sjump; + local vector impact, fvel; + local float vdist, vpercent, vpart; + local float impzdiff; + + self.effects = self.effects | EF_MUZZLEFLASH; + // Check if the player is close enough for damage? + self.meleecontact = TRUE; + ai_meleesmash(imp_damage); + self.meleecontact = FALSE; + + // Play impact sound and work out where the impact is going to happen + sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_IDLE); + makevectors (self.angles); +// impact = self.origin + v_forward*imp_vec_x + v_right*imp_vec_y + v_up*imp_vec_z; + impact = self.origin + attack_vector(imp_vec); + + // Push all entities within a certain radius outwards + // Do this find search before spawning ring and particles + // findradius will find ALL entities regardless of type + sjump = findradius(impact, imp_radius); + while(sjump) { + // Ignore monster (self) + if (sjump != self) { + // Only affect players and other monsters + if (sjump.flags & FL_CLIENT || sjump.flags & FL_MONSTER) { + // Exclude statues, stone/heavy monsters and bosses! + if (sjump.classgroup != CG_STONE && sjump.bossflag == FALSE) { + // Is the entity on the ground? + if (sjump.flags & FL_ONGROUND) { + // Is the entity too far above or below the impact? + impzdiff = fabs(sjump.origin_z - impact_z); + if (impzdiff < MONAI_IMPACTZAXIS) { + // Distance between impact and enemy + vdist = vlen(sjump.origin - impact); + // Percentage of impact force + vpercent = 1 - (vdist / imp_radius); + // Monsters have less impact + if (sjump.flags & FL_MONSTER) vpercent = vpercent * 0.75; + // Ogre facing angle (easier to understand) + makevectors(self.angles); + // Combine forward/up force with existing velocity + fvel = (v_forward * (imp_forward * vpercent)) + (v_up * (imp_up * vpercent)); + sjump.velocity = sjump.velocity + fvel; + sjump.flags = sjump.flags - (sjump.flags & FL_ONGROUND); + } + } + } + } + } + sjump = sjump.chain; + } + + // Spawn impact model ring on the ground + swave = spawn(); + swave.mdl = MODEL_PROJ_RINGSHOCK; + setmodel(swave,swave.mdl); + setsize(swave, VEC_ORIGIN, VEC_ORIGIN); + setorigin(swave, impact); // on floor, slight up (2 pixels) + swave.solid = SOLID_NOT; // No interaction with world + swave.movetype = MOVETYPE_NONE; // Static item, no movement + swave.think = ai_shockwave_think; + swave.nextthink = time + TIME_MINTICK; // High time loop + swave.ltime = swave.nextthink; + + // Spawn particle explosion where impact is located + vpart = 64 + rint(random()*64); + particle_explode(impact, vpart, 0.5, PARTICLE_BURST_FIRE, PARTICLE_BURST_SHOCKWAVE); +}; diff --git a/QC_other/QC_arcane/ai_tether.qc b/QC_other/QC_arcane/ai_tether.qc new file mode 100644 index 00000000..f9ae25c9 --- /dev/null +++ b/QC_other/QC_arcane/ai_tether.qc @@ -0,0 +1,136 @@ +/*====================================================================== + MONSTER TETHER SYSTEM + +======================================================================*/ +// new entity keys + +.string tethertarget; // String name to link tethering too +.entity tethertarg; // Entity to track for tether system +.void() th_tether; // Function to call when at max range +.float tethered; // is the monster tethered during combat +.float tetherrange; // The circular range around tether point +.float tetherdist; // Distance from nonster to tether point +.float tetherenemy; // Distance from enemy to tether point +.float tetherwait; // Amount of time to wait before returning +.float tethertimer; // Time before returning to tether point +.float tetherturn; // Make sure monster turns towards enemy +.float tetherpause; // % to not pause attack at max range +.entity tetherfocus; // Enemy to turn towards while waiting + +float TETHER_RADIUS = 300; // Default tether radius +float TETHER_WAIT = 30; // Default timer to wait before reset + +// Defined under defs.qc +//.float tetherlock; // Is the monster locked from movement + +//---------------------------------------------------------------------- +// Check for tether point (find and setup entity) +//---------------------------------------------------------------------- +void() setup_tethersystem = +{ + // Check if the tether system be setup already + if (self.tethertarget != "") { + // Check for range attack, cannot tether if no range + if (!self.th_missile) { + dprint("\b[TETHER]\b No range attack for "); + dprint(self.tethertarget); + dprint("\n"); + self.tethertarget = ""; + return; + } + + // Find the tether point (has to be path corner) + self.tethertarg = find(world, targetname, self.tethertarget); + if (self.tethertarg != world) { + // Tether system is active (reset lock) + self.tethered = TRUE; + self.tetherlock = FALSE; + // Setup default tether range + if (self.tetherrange < 32) self.tetherrange = TETHER_RADIUS; + if (self.tetherwait <= 0) self.tetherwait = TETHER_WAIT; + // Reset distances (updated in check function) + self.tetherdist = self.tetherenemy = 0; + // No stand/walk timer active yet + self.tethertimer = LARGE_TIMER; + // Check for tether function (def=missile) + if (!self.th_tether) self.th_tether = self.th_missile; + // Don't need tethertarget anymore + self.tethertarget = ""; + } + } +}; + +//---------------------------------------------------------------------- +// Check for tether range and return TRUE if at radius limit +//---------------------------------------------------------------------- +float() check_tethersystem = +{ + local vector org; + + // Is the system active on the monster? + if (self.tethered == FALSE) return FALSE; + + // Read tether target for BSP/Ent origin + if (self.tethertarg.bsporigin) org = bmodel_origin(self.tethertarg); + else org = self.tethertarg.origin; + + // Setup tether distance for monster and enemy + self.tetherdist = vlen(self.origin - org); + // Check for enemy entity first before distance check + if (self.enemy) self.tetherenemy = vlen(self.enemy.origin - org); + else self.tetherenemy = 0; + + // Reset lock + self.tetherlock = FALSE; + + // If inside tether range, keep moving + if (self.tetherdist < self.tetherrange) return FALSE; + else { + // If enemy behind tether point, move closer + if (infront(self.tethertarg) && infront(self.enemy)) + return FALSE; + // Reach tether limit + else { + // Can monster see the enemy? + if (enemy_vis) return TRUE; + else { + // Check for no pause override + if (self.tetherpause > 0) { + if (random() <= self.tetherpause) return TRUE; + } + // At max range + cannot see enemy, exit combat + self.tetherfocus = self.enemy; // Save for later + self.enemy = self.goalentity = self.movetarget = world; + self.attack_state = AS_STRAIGHT; + self.think = self.th_stand; // Wait for enemy + self.tethertimer = time + self.tetherwait; + } + } + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check tether timer for stand function +//---------------------------------------------------------------------- +void() check_tethertimer = +{ + if (self.tethered == FALSE) return; // System active? + if (!self.tethertarg) return; // No target active + if (self.enemy) return; // In combat? + + // Has the timer been reached? + if (self.tethertimer < time) { + self.tetherlock = FALSE; // Make sure not set + self.goalentity = self.movetarget = self.tethertarg; + self.tethertimer = LARGE_TIMER; // Timer no longer needed + self.pausetime = 0; // Start walking + } + else { + // Check to see if facing enemy is active? + if (self.tetherturn && self.tetherfocus) { + self.ideal_yaw = vectoyaw(self.tetherfocus.origin - self.origin); + ChangeYaw (); + } + } +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/breakable.qc b/QC_other/QC_arcane/breakable.qc new file mode 100644 index 00000000..5124588a --- /dev/null +++ b/QC_other/QC_arcane/breakable.qc @@ -0,0 +1,1420 @@ +/*====================================================================== + Breakable functions +======================================================================*/ +float BREAK_STARTOFF = 1; // Will wait for trigger to spawn +float BREAK_NOSHOOT = 2; // Cannot be damaged/shot, trigger only +float BREAK_EXPLOSION = 4; // Spawn sprite/particle explosion +float BREAK_SILENT = 8; // No initial break sound +float BREAK_DAMAGE = 16; // Rubble does damage on touch +float BREAK_NOMONSTER = 32; // No damage from monsters +float BREAK_NOSOUND = 64; // No impact sound for rubble +float BREAK_NOROTATE = 128; // No Y rotation for rubble +float BREAK_MOVEDIR = 4096; // Set by entity, movedir/angles active + +float MONTRIG_NODELAY = 1; // No delay between monster and breakable trigger +float MONTRIG_WAKEUPANIM = 2; // Monster trigger does special wakeup animation + +float BREAKWALL_START_ON = 1; // Switchable bmodel for breakable setups +float BREAKWALL_SOLID = 2; // Solid player collision when active +float BREAKWALL_FADEOUT = 4; // Will fade out after a certain amount of time + +float BTYPE_ROCK = 1; // Default rock/brick +float BTYPE_WOOD = 2; +float BTYPE_GLASS = 3; +float BTYPE_METAL = 4; +float BTYPE_BRICK = 5; +float BTYPE_CERAMIC = 6; +float BTYPE_MAX = 6; +float BTYPE_CUSTOM = 10; + +float BMODTYPE_SELF = 1; // Single self models +float BMODTYPE_CUSTOM = 5; // Custom models +float BMODTYPE_ROCK1 = 10; // ID rock4_1 (dark large bricks) +float BMODTYPE_ROCK2 = 11; // ID rock4_2 (light stone) +float BMODTYPE_ROCK3 = 12; // ID rock3_8 (light vertical) +float BMODTYPE_ROCK4 = 13; // ID city5_3 (white plaster) +float BMODTYPE_ROCK5 = 14; // ID stone1_7b (dark blue ver) +float BMODTYPE_ROCK6 = 15; // ID cliff4 (black rock) +float BMODTYPE_WOOD1 = 20; // ID dung01_3 (dark) +float BMODTYPE_WOOD2 = 21; // ID dung01_2 (light) +float BMODTYPE_WOOD3 = 22; // ID wizwood1_7 (mouldy) +float BMODTYPE_GLASS1 = 30; // ID window1_2 (blue sqr) +float BMODTYPE_GLASS2 = 31; // ID window01_4 (red stain) +float BMODTYPE_GLASS3 = 32; // ID window02_1 (yellow stain) +float BMODTYPE_GLASS4 = 33; // ID window01_3 (purple stain) +float BMODTYPE_METAL1 = 40; // ID metal1_2 (brown generic) +float BMODTYPE_METAL2 = 41; // ID metal4_5 (metal4_4 generic) +float BMODTYPE_METAL3 = 42; // ID metal4_7 (rivet metal panels) +float BMODTYPE_METAL4 = 43; // ID cop1_1 (green generic) +float BMODTYPE_METAL5 = 44; // ID metal2_8 (blue generic) +float BMODTYPE_BRICK1 = 50; // ID wbrick1_5 (large brown) +float BMODTYPE_BRICK2 = 51; // ID city2_3 (small sewer green) +float BMODTYPE_BRICK3 = 52; // ID city6_8 (small drywall greyish) +float BMODTYPE_BRICK4 = 53; // ID wiz1_4 (large white) +float BMODTYPE_BRICK5 = 54; // ID city2_1 (small red brick) +float BMODTYPE_BRICK6 = 55; // ID city1_6 (small brown brick) +float BMODTYPE_BRICK7 = 56; // ID city4_5 (small blue brick) +float BMODTYPE_CERAMIC1 = 60; // Blank atm + +//---------------------------------------------------------------------- +// Breakable objects explosion/impact sounds +string SOUND_BRK_ROCK = "break/rock_impact.wav"; +string SOUND_BRK_WOOD = "break/wood_impact.wav"; +string SOUND_BRK_GLASS = "break/glass_impact.wav"; +string SOUND_BRK_METAL = "break/metal_impact.wav"; +string SOUND_BRK_CERAMIC = "break/ceramic_impact.wav"; + +string SOUND_IMP_ROCK1 = "break/rock_i1.wav"; +string SOUND_IMP_ROCK2 = "break/rock_i2.wav"; +string SOUND_IMP_ROCK3 = "break/rock_i3.wav"; +string SOUND_IMP_ROCK4 = "break/rock_i4.wav"; +string SOUND_IMP_WOOD1 = "break/wood_i1.wav"; +string SOUND_IMP_WOOD2 = "break/wood_i2.wav"; +string SOUND_IMP_WOOD3 = "break/wood_i3.wav"; +string SOUND_IMP_WOOD4 = "break/wood_i4.wav"; +string SOUND_IMP_GLASS1 = "break/glass_i1.wav"; +string SOUND_IMP_GLASS2 = "break/glass_i2.wav"; +string SOUND_IMP_GLASS3 = "break/glass_i3.wav"; +string SOUND_IMP_GLASS4 = "break/glass_i4.wav"; +string SOUND_IMP_METAL1 = "break/metal_i1.wav"; +string SOUND_IMP_METAL2 = "break/metal_i2.wav"; +string SOUND_IMP_METAL3 = "break/metal_i3.wav"; +string SOUND_IMP_METAL4 = "break/metal_i4.wav"; +string SOUND_IMP_CERAMIC1 = "break/ceramic_i1.wav"; +string SOUND_IMP_CERAMIC2 = "break/ceramic_i2.wav"; +string SOUND_IMP_CERAMIC3 = "break/ceramic_i3.wav"; +string SOUND_IMP_CERAMIC4 = "break/ceramic_i4.wav"; + +//---------------------------------------------------------------------- +// Breakable objects explosion/impact models +// ID rock4_1, rock4_2, rock3_8, city5_3, stone1_7b, cliff4 +string MODEL_BRK_ROCK1A = "maps/ad_brk/rock01.bsp"; +string MODEL_BRK_ROCK1B = "maps/ad_brk/rock02.bsp"; +string MODEL_BRK_ROCK1C = "maps/ad_brk/rock03.bsp"; +string MODEL_BRK_ROCK1D = "maps/ad_brk/rock04.bsp"; +string MODEL_BRK_ROCK2A = "maps/ad_brk/rock05.bsp"; +string MODEL_BRK_ROCK2B = "maps/ad_brk/rock06.bsp"; +string MODEL_BRK_ROCK2C = "maps/ad_brk/rock07.bsp"; +string MODEL_BRK_ROCK2D = "maps/ad_brk/rock08.bsp"; +string MODEL_BRK_ROCK3A = "maps/ad_brk/rock09.bsp"; +string MODEL_BRK_ROCK3B = "maps/ad_brk/rock10.bsp"; +string MODEL_BRK_ROCK3C = "maps/ad_brk/rock11.bsp"; +string MODEL_BRK_ROCK3D = "maps/ad_brk/rock12.bsp"; +string MODEL_BRK_ROCK4A = "maps/ad_brk/rock13.bsp"; +string MODEL_BRK_ROCK4B = "maps/ad_brk/rock14.bsp"; +string MODEL_BRK_ROCK4C = "maps/ad_brk/rock15.bsp"; +string MODEL_BRK_ROCK4D = "maps/ad_brk/rock16.bsp"; +string MODEL_BRK_ROCK5A = "maps/ad_brk/rock17.bsp"; +string MODEL_BRK_ROCK5B = "maps/ad_brk/rock18.bsp"; +string MODEL_BRK_ROCK5C = "maps/ad_brk/rock19.bsp"; +string MODEL_BRK_ROCK5D = "maps/ad_brk/rock20.bsp"; +string MODEL_BRK_ROCK6A = "maps/ad_brk/rock21.bsp"; +string MODEL_BRK_ROCK6B = "maps/ad_brk/rock22.bsp"; +string MODEL_BRK_ROCK6C = "maps/ad_brk/rock23.bsp"; +string MODEL_BRK_ROCK6D = "maps/ad_brk/rock24.bsp"; +// ID dung01_3 (dark), dung01_2 (light), wizwood1_7 (mouldy) +string MODEL_BRK_WOOD1A = "maps/ad_brk/wood01.bsp"; +string MODEL_BRK_WOOD1B = "maps/ad_brk/wood02.bsp"; +string MODEL_BRK_WOOD1C = "maps/ad_brk/wood03.bsp"; +string MODEL_BRK_WOOD1D = "maps/ad_brk/wood04.bsp"; +string MODEL_BRK_WOOD2A = "maps/ad_brk/wood05.bsp"; +string MODEL_BRK_WOOD2B = "maps/ad_brk/wood06.bsp"; +string MODEL_BRK_WOOD2C = "maps/ad_brk/wood07.bsp"; +string MODEL_BRK_WOOD2D = "maps/ad_brk/wood08.bsp"; +string MODEL_BRK_WOOD3A = "maps/ad_brk/wood09.bsp"; +string MODEL_BRK_WOOD3B = "maps/ad_brk/wood10.bsp"; +string MODEL_BRK_WOOD3C = "maps/ad_brk/wood11.bsp"; +string MODEL_BRK_WOOD3D = "maps/ad_brk/wood12.bsp"; +// ID window1_2 (blue sqr), window01_4 (red stain), +// window02_1 (yellow stain), window01_3 (purple dragon) +string MODEL_BRK_GLASS1A = "maps/ad_brk/glass01.bsp"; +string MODEL_BRK_GLASS1B = "maps/ad_brk/glass02.bsp"; +string MODEL_BRK_GLASS1C = "maps/ad_brk/glass03.bsp"; +string MODEL_BRK_GLASS1D = "maps/ad_brk/glass04.bsp"; +string MODEL_BRK_GLASS2A = "maps/ad_brk/glass05.bsp"; +string MODEL_BRK_GLASS2B = "maps/ad_brk/glass06.bsp"; +string MODEL_BRK_GLASS2C = "maps/ad_brk/glass07.bsp"; +string MODEL_BRK_GLASS2D = "maps/ad_brk/glass08.bsp"; +string MODEL_BRK_GLASS3A = "maps/ad_brk/glass09.bsp"; +string MODEL_BRK_GLASS3B = "maps/ad_brk/glass10.bsp"; +string MODEL_BRK_GLASS3C = "maps/ad_brk/glass11.bsp"; +string MODEL_BRK_GLASS3D = "maps/ad_brk/glass12.bsp"; +string MODEL_BRK_GLASS4A = "maps/ad_brk/glass13.bsp"; +string MODEL_BRK_GLASS4B = "maps/ad_brk/glass14.bsp"; +string MODEL_BRK_GLASS4C = "maps/ad_brk/glass15.bsp"; +string MODEL_BRK_GLASS4D = "maps/ad_brk/glass16.bsp"; +// ID metal1_2 (brown generic), metal4_5 (metal4_4 generic), +// metal4_7 (rivet metal panels), cop1_1 (green generic) +string MODEL_BRK_METAL1A = "maps/ad_brk/metal01.bsp"; +string MODEL_BRK_METAL1B = "maps/ad_brk/metal02.bsp"; +string MODEL_BRK_METAL1C = "maps/ad_brk/metal03.bsp"; +string MODEL_BRK_METAL1D = "maps/ad_brk/metal04.bsp"; +string MODEL_BRK_METAL2A = "maps/ad_brk/metal05.bsp"; +string MODEL_BRK_METAL2B = "maps/ad_brk/metal06.bsp"; +string MODEL_BRK_METAL2C = "maps/ad_brk/metal07.bsp"; +string MODEL_BRK_METAL2D = "maps/ad_brk/metal08.bsp"; +string MODEL_BRK_METAL3A = "maps/ad_brk/metal09.bsp"; +string MODEL_BRK_METAL3B = "maps/ad_brk/metal10.bsp"; +string MODEL_BRK_METAL3C = "maps/ad_brk/metal11.bsp"; +string MODEL_BRK_METAL3D = "maps/ad_brk/metal12.bsp"; +string MODEL_BRK_METAL4A = "maps/ad_brk/metal13.bsp"; +string MODEL_BRK_METAL4B = "maps/ad_brk/metal14.bsp"; +string MODEL_BRK_METAL4C = "maps/ad_brk/metal15.bsp"; +string MODEL_BRK_METAL4D = "maps/ad_brk/metal16.bsp"; +string MODEL_BRK_METAL5A = "maps/ad_brk/metal17.bsp"; +string MODEL_BRK_METAL5B = "maps/ad_brk/metal18.bsp"; +string MODEL_BRK_METAL5C = "maps/ad_brk/metal19.bsp"; +string MODEL_BRK_METAL5D = "maps/ad_brk/metal20.bsp"; +// ID wbrick1_5 (large brown), city2_3 (small sewer green), +// city6_8 (small drywall greyish), wiz1_4 (large white) +// city2_1 (small red brick), city1_6 (small brown) +string MODEL_BRK_BRICK1A = "maps/ad_brk/brick01.bsp"; +string MODEL_BRK_BRICK1B = "maps/ad_brk/brick02.bsp"; +string MODEL_BRK_BRICK1C = "maps/ad_brk/brick03.bsp"; +string MODEL_BRK_BRICK1D = "maps/ad_brk/brick04.bsp"; +string MODEL_BRK_BRICK2A = "maps/ad_brk/brick05.bsp"; +string MODEL_BRK_BRICK2B = "maps/ad_brk/brick06.bsp"; +string MODEL_BRK_BRICK2C = "maps/ad_brk/brick07.bsp"; +string MODEL_BRK_BRICK2D = "maps/ad_brk/brick08.bsp"; +string MODEL_BRK_BRICK3A = "maps/ad_brk/brick09.bsp"; +string MODEL_BRK_BRICK3B = "maps/ad_brk/brick10.bsp"; +string MODEL_BRK_BRICK3C = "maps/ad_brk/brick11.bsp"; +string MODEL_BRK_BRICK3D = "maps/ad_brk/brick12.bsp"; +string MODEL_BRK_BRICK4A = "maps/ad_brk/brick13.bsp"; +string MODEL_BRK_BRICK4B = "maps/ad_brk/brick14.bsp"; +string MODEL_BRK_BRICK4C = "maps/ad_brk/brick15.bsp"; +string MODEL_BRK_BRICK4D = "maps/ad_brk/brick16.bsp"; +string MODEL_BRK_BRICK5A = "maps/ad_brk/brick17.bsp"; +string MODEL_BRK_BRICK5B = "maps/ad_brk/brick18.bsp"; +string MODEL_BRK_BRICK5C = "maps/ad_brk/brick19.bsp"; +string MODEL_BRK_BRICK5D = "maps/ad_brk/brick20.bsp"; +string MODEL_BRK_BRICK6A = "maps/ad_brk/brick21.bsp"; +string MODEL_BRK_BRICK6B = "maps/ad_brk/brick22.bsp"; +string MODEL_BRK_BRICK6C = "maps/ad_brk/brick23.bsp"; +string MODEL_BRK_BRICK6D = "maps/ad_brk/brick24.bsp"; +string MODEL_BRK_BRICK7A = "maps/ad_brk/brick25.bsp"; +string MODEL_BRK_BRICK7B = "maps/ad_brk/brick26.bsp"; +string MODEL_BRK_BRICK7C = "maps/ad_brk/brick27.bsp"; +string MODEL_BRK_BRICK7D = "maps/ad_brk/brick28.bsp"; + +//---------------------------------------------------------------------- +// Axe impact/swipe/miss sounds +string SOUND_AXE_SWIPE1 = "weapons/axe_swoosh1.wav"; // Fast swipe +string SOUND_AXE_SWIPE2 = "weapons/axe_swoosh2.wav"; // Faster swipe +string SOUND_AXE_WOOD = "weapons/axe_wood.wav"; // wood impact +string SOUND_AXE_GLASS = "weapons/axe_glass.wav"; // glass impact +string SOUND_AXE_METAL = "weapons/axe_metal.wav"; // metal impact +string SOUND_AXE_CERAMIC = "weapons/axe_ceramic.wav"; // ceramic impact +string SOUND_AXE_PLAYER = "player/axhit1.wav"; // ax hit meat (another player) +string SOUND_AXE_STONE = "player/axhit2.wav"; // stone impact + +//============================================================================= +/*QUAKED func_breakable (0 .5 .8) ? STARTOFF NODAMAGE EXPLOSION SILENT DAMAGE NOMOSTER NOSOUND NOROTATE Not_Easy Not_Normal Not_Hard Not_DM +Spawn breakable objects from a bmodel +-------- KEYS -------- +target : targets to fire when breakable is dead/used (only used once) +target2 : Additional trigger function (need target to be defined as well) +style : pre-defined sound/model types - 1=rock, 2=wood, 3=glass, 4=metal, 5=brick, 6=ceramic, 10=custom +brksound : Initial breaking sound type (override style default) +brkimpsound : Impact sound type (override style default) +brkobjects : Breakable object model type (10-15=rocks, 20-22=woods, 30-32=glass, 40-42=metals, 50-54=brick, 60=ceramic) +noise : Initial breaking sound (unique sound file) +noise1 : Custom Rubble Impact sounds (unique sound files, must have 1 defined) +noise2 : Custom Rubble Impact sound 2 +noise3 : Custom Rubble Impact sound 3 +noise4 : Custom Rubble Impact sound 4 +brkobj1 : Custom Rubble bmodel objects (unique models, must have 1 defined) +brkobj2 : Custom Rubble bmodel objects 2 +brkobj3 : Custom Rubble bmodel objects 3 +brkobj4 : Custom Rubble bmodel objects 4 +health : amount of damage to take before breaking (def 1) +count : minimum quantity to spawn (def 4) +cnt : random quantity to spawn (def 4) =-1 no random qty +dmg : explosive radius damage (emits from center of func object) +pos1 : x=start particle colour, y=random range, z=quantity +brkvelbase : Base amount for velocity of broken parts (def "50 50 100") +brkveladd : Random additions for velocity of broken parts (def "100 100 150") +brkavel : Amount of breaking object angle velocity (def 200) +brkfade : Fade time before rubble fades away (def 4+random()x4) +brkmondmg : Damage multiplier for monster damage against breakable +angles : direction to throw rubble (override default = impact direction) +brkgravity : Change the gravity for rubble, useful for underwater (Value = 0-1) +brktrigjump : Trigger if damaged by jumping monster attack +brktrigmissile : Trigger if damaged by rocket/grenade/shalball/radiusdmg +brktrignoplayer: No player/clients can damage this breakable +brkdelaydamage : Time pause before enabling damage on this breakable +-------- SPAWNFLAGS -------- +STARTOFF : Will wait for trigger to spawn +NODAMAGE : Cannot be damaged or shot, trigger only +EXPLOSION : trigger sprite/particle explosion +SILENT : No initial breakage sound +DAMAGE : Spawning rubble can damage (def = 2, use dmg key for touch damage) +NOMONSTER : Monsters cannot damage this breakable and/or spawning rubble will not damage monsters +NOSOUND : Spawning rubble has no impact sounds +NOROTATE : Spawning rubble has No Y rotation +-------- NOTES -------- +Spawn breakable ojects from a bmodel +*/ + +//============================================================================= +/*QUAKED func_breakable_spawner (0.5 .5 .8) (-8 -8 -8) (8 8 8) x x EXPLOSION SILENT DAMAGE NOMOSTER NOSOUND NOROTATE Not_Easy Not_Normal Not_Hard Not_DM +Spawn breakable objects from a single point +-------- KEYS -------- +target : targets to fire when breakable is dead/used (only used once) +target2 : Additional trigger function (need target to be defined as well) +style : pre-defined sound/model types - 1=rock, 2=wood, 3=glass, 4=metal, 5=brick, 6=ceramic, 10=custom +brksound : Initial breaking sound type (override style default) +brkimpsound : Impact sound type (override style default) +brkobjects : Breakable object model type (10-15=rocks, 20-22=woods, 30-32=glass, 40-42=metals, 50-54=brick, 60=ceramic) +noise : Initial breaking sound (unique sound file) +noise1 : Custom Rubble Impact sounds (unique sound files, must have 1 defined) +noise2 : Custom Rubble Impact sound 2 +noise3 : Custom Rubble Impact sound 3 +noise4 : Custom Rubble Impact sound 4 +brkobj1 : Custom Rubble bmodel objects (unique models, must have 1 defined) +brkobj2 : Custom Rubble bmodel objects 2 +brkobj3 : Custom Rubble bmodel objects 3 +brkobj4 : Custom Rubble bmodel objects 4 +health : amount of damage to take before breaking (def 1) +count : minimum quantity to spawn (def 4) +cnt : random quantity to spawn (def 4) =-1 no random qty +dmg : explosive radius damage (emits from center of func object) +pos1 : x=start particle colour, y=random range, z=quantity +brkvelbase : Base amount for velocity of broken parts (def "50 50 100") +brkveladd : Random additions for velocity of broken parts (def "100 100 150") +brkavel : Amount of breaking object angle velocity (def 200) +brkfade : Fade time before rubble fades away (def 4+random()x4) +angles : direction to throw rubble (override default = impact direction) +brktrigjump : Trigger if damaged by jumping monster attack +brktrigmissile : Trigger if damaged by rocket/grenade/shalball/radiusdmg +brkgravity : Change the gravity for rubble, useful for underwater (Value = 0-1) +brkvol : Spawning volume vector for breakable point entity +-------- SPAWNFLAGS -------- +EXPLOSION : trigger sprite/particle explosion +SILENT : No initial breakage sound +DAMAGE : Spawning rubble can damage (def = 2, use dmg key for touch damage) +NOMONSTER : Spawning rubble will not damage monsters +NOSOUND : Spawning rubble has no impact sounds +NOROTATE : Spawning rubble has No Y rotation +-------- NOTES -------- +Spawn breakable ojects from a single point +*/ + +//---------------------------------------------------------------------- +void() breakable_remove = +{ + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() breakable_checkfloor = +{ + // Is it time for the breakable to fade away? + if (self.pain_finished > time) { + // Check floor below breakable (global function) + // Origin at base of model + 16 (typical step height) + ent_floorcheck(self, FLOOR_TRACE_BREAK); + + // Keep checking + self.think = breakable_checkfloor; + self.nextthink = time + 0.1; + } + else breakable_remove(); +}; + +//---------------------------------------------------------------------- +void() breakable_particle = +{ + // Are particles disabled? has the model touched something? + if (self.wait) { + // Is there any time left to setup floor checks + if (self.pain_finished > time + 0.1) { + self.think = breakable_checkfloor; + } + else self.think = breakable_remove; + self.nextthink = time + 0.1; + } + else { + // Add a bit of randomness to the particles generated + if (random() < 0.5) self.nextthink = time + 0.01; + else self.nextthink = time + 0.02; + particle (self.origin, self.oldorigin, rint(self.pos1_x + random()*self.pos1_y), self.pos1_z); + // Check for removal timer + if (self.pain_finished < time) self.think = breakable_remove; + } +}; + +//---------------------------------------------------------------------- +void() breakable_touch = +{ + if (self.touchedvoid) { entity_remove(self,0.1); return; } + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other.classtype == CT_FUNCBREAKOBJ) return; // Ignore other breakables + if (other.solid == SOLID_TRIGGER) return; // Ignore trigger fields + self.wait = TRUE; // No more particles + + if (self.count < 1) { + self.touch = SUB_Null; // no more touching + self.solid = SOLID_NOT; // Turn off world interaction + self.avelocity = '0 0 0'; // Stop any velocity rotation + } + else { + // Does the spawning rubble hurt? + if (self.owner.spawnflags & BREAK_DAMAGE) { + if (other.takedamage) { + // Spawnflag BREAK_NOMONSTER = 32; (No damage to monsters from rubble) + // Was originally about monsters being immune to spawning rubble + // This has changed over time to mean NO monster damage to breakable + // The original intention is still active and really meant for + // breakable spawners which don't have a bmodel component. + // The ability for breakable rubble to injure monsters is not a major + // feature and the no monster damage is more important. + // + if ( other.flags & FL_MONSTER && self.owner.spawnflags & BREAK_NOMONSTER ) {} + else T_Damage(other, self, self, self.owner.dmg, DAMARMOR); + } + } + self.count = self.count - 1; + if (!(self.owner.spawnflags & BREAK_NOSOUND)) { + // Randomize impact sound + self.lip = random()*self.owner.brkimpqty; + if (self.lip < 1) sound(self, CHAN_VOICE, self.owner.noise1, 1, ATTN_BREAK); + else if (self.lip < 2) sound(self, CHAN_VOICE, self.owner.noise2, 1, ATTN_BREAK); + else if (self.lip < 3) sound(self, CHAN_VOICE, self.owner.noise3, 1, ATTN_BREAK); + else sound(self, CHAN_VOICE, self.owner.noise4, 1, ATTN_BREAK); + } + } +}; + +//---------------------------------------------------------------------- +// Can't have multiple radius explosion on same frame +// Always delay them to prevent endless loops +//---------------------------------------------------------------------- +void() funcbreakable_delayexplode = +{ + T_RadiusDamage (self.attachment, self.attachment, self.dmg, self.attachment, DAMAGEALL); +}; + +//====================================================================== +// Main function for generating rubble +//====================================================================== +void() funcbreakable_use = +{ + local vector dirvec, rorg, gvel, dirorg; + local float content_loop, content_flag; + + if (self.waitmin == TRUE) return; // Trigger once block + if (self.waitmin2 > time) return; // Spawn damage block + + //---------------------------------------------------------------------- + // Play initial breaking sound (exception - silent spawnflag) + if (!(self.spawnflags & BREAK_SILENT)) + sound (self.attachment, CHAN_BODY, self.noise, 1, ATTN_NORM); + + //---------------------------------------------------------------------- + // Hide breakable func model (ignore if point entity) + if (self.classtype == CT_FUNCBREAK) { + self.waitmin = TRUE; // Only fire breakable ONCE + self.use = SUB_Null; // No more triggers + self.takedamage = DAMAGE_NO; // No more pain/damage + self.model = ""; // hide model + self.modelindex = 0; // Make sure no model + self.solid = SOLID_NOT; // no world interaction + self.movetype = MOVETYPE_NONE; + // Work out bottom corner of min/max bounding box + self.oldorigin = self.attachment.origin - (self.size*0.5); + } + else if (self.classtype == CT_FUNCBREAKMDL) { + self.waitmin = TRUE; // Only fire breakable ONCE + self.use = SUB_Null; // No more triggers + self.takedamage = DAMAGE_NO; // No more pain/damage + self.modelindex = 0; // Make sure no model + self.model = ""; // hide model + self.solid = SOLID_NOT; // no world interaction + self.movetype = MOVETYPE_NONE; + } + // Breakable point entities just keep on spawning rubble + else self.oldorigin = self.origin; + + //---------------------------------------------------------------------- + // Fire all targets (usually the target is the broken remains) + // Only fire this target once and check based on target field only + // Targets are fired before rubble so pointcontent check can + // take into account any ruined sections and not spawn inside brushwork + if (self.target != "") { + // Check death entity (set in Killed in ai_combat.qc) + if (self.activate.flags & FL_CLIENT) activator = self.activate; + SUB_UseTargets(); + } + // Only fire targets once, remove any further triggering + clear_trigstrs(self); + + //---------------------------------------------------------------------- + // By default all breakables use direction force for rubble + // If angles (movedir) set on breakable use that instead + // Work out direction of impact (using activate passed from combat.qc or trigger.qc) + // All bmodels are labelled with .bsporigin flag (origin = 0,0,0) + // attachment points to self if funcbreakable_wall active + if (self.spawnflags & BREAK_MOVEDIR) dirvec = self.movedir; + else if (!self.activate) dirvec = '0 0 1'; + else { + if (self.activate.bsporigin) dirorg = bmodel_origin(self.activate); + else dirorg = self.activate.origin; + dirvec = vectoangles(self.attachment.origin - dirorg); + } + + //---------------------------------------------------------------------- + // Main rubble loop + while(self.count > 0 && self.brkobjqty > 0) { + //---------------------------------------------------------------------- + // Work out position inside bounding box of breakable bmodel + // Just in case no space to spawn anywhere, dont do an infinite loop + content_loop = 4; + + while (content_loop > 0) { + // Setup broken object inside area (min/max) of parent breakable object + if (self.classtype == CT_FUNCBREAK) { + rorg_x = self.oldorigin_x + random()*self.size_x; + rorg_y = self.oldorigin_y + random()*self.size_y; + rorg_z = self.oldorigin_z + random()*self.size_z; + } + else { + // trigger version is a single origin point with slight wobble + rorg_x = self.origin_x + crandom()*self.brkvol_x; + rorg_y = self.origin_y + crandom()*self.brkvol_y; + rorg_z = self.origin_z + crandom()*self.brkvol_z; + } + // Check point content and keep checking (limited loop cycles) + content_flag = pointcontents(rorg); + if (content_flag != CONTENT_SOLID && content_flag != CONTENT_SKY) content_loop = -1; + else content_loop = content_loop - 1; + } + + //---------------------------------------------------------------------- + // Was there any space to spawn rubble? + if (content_loop < 0) { + // Create new piece of rubble + newmis = spawn(); + newmis.classname = "rubble"; + newmis.classtype = CT_FUNCBREAKOBJ; + newmis.classgroup = CG_TEMPENT; + newmis.owner = self; + + // Setup broken model/bsp (random selection if possible) + self.lip = random()*self.brkobjqty; + if (self.lip < 1) setmodel (newmis, self.brkobj1); + else if (self.lip < 2) setmodel (newmis, self.brkobj2); + else if (self.lip < 3) setmodel (newmis, self.brkobj3); + else setmodel (newmis, self.brkobj4); + + // Setup origin based on previous content checks + setorigin (newmis, rorg); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + //---------------------------------------------------------------------- + // Setup movement and spin parameters + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_BBOX; + if (!(self.spawnflags & BREAK_NOROTATE)) newmis.angles_y = random() * 360; + newmis.avelocity = vecrand(0,self.brkavel,TRUE); + + //---------------------------------------------------------------------- + if (self.spawnflags & BREAK_MOVEDIR && self.movedir_y < 0) { + // Up/down direction with slight X/Y wobble + newmis.velocity_x = crandom() * (self.brkveladd_x/2); + newmis.velocity_y = crandom() * (self.brkveladd_y/2); + if (self.movedir_y == -2) newmis.velocity_z = 0 - random()*50; + else newmis.velocity_z = self.brkvelbase_z + (random()*self.brkveladd_z); + } + else { + // Directional velocity based on angle_y or activator entity + makevectors(dirvec); + gvel = v_forward * (self.brkvelbase_x + random() * self.brkveladd_x); + gvel = gvel + v_right * (crandom() * self.brkveladd_y); + gvel = gvel + v_up * (self.brkvelbase_z + random() * self.brkveladd_z); + newmis.velocity = gvel; + } + //---------------------------------------------------------------------- + // How many bounce sounds - randomly pick 1-2 + if (random() < 0.2) newmis.count = 2; + else newmis.count = 1; + + //---------------------------------------------------------------------- + // Touch and eventual fade functions + newmis.touch = breakable_touch; + newmis.pain_finished = time + self.brkfade + random()*self.brkfade; + newmis.nextthink = time + 0.01; + newmis.think = breakable_particle; + + //---------------------------------------------------------------------- + // Setup particle colour and particle dirction (forward) + newmis.pos1 = self.pos1; + gvel = vectoangles(newmis.velocity); + makevectors(gvel); + newmis.oldorigin = v_forward; + if (self.brkgravity) newmis.gravity = self.brkgravity; + } + + //---------------------------------------------------------------------- + // Keep on spawning rubble! + self.count = self.count - 1; + } + + //---------------------------------------------------------------------- + // breakable trigger entities can spawn debris multiple times + if (self.wait != -1) { + self.count = self.height; + } + else { + // Don't need to be active in the world anymore + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + // Produce explosion sprite/particle effect using attachment entity + if (self.spawnflags & BREAK_EXPLOSION) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.attachment.origin_x); + WriteCoord (MSG_BROADCAST, self.attachment.origin_y); + WriteCoord (MSG_BROADCAST, self.attachment.origin_z); + + SpawnExplosion(EXPLODE_SMALL, self.attachment.origin, SOUND_REXP3); + // Do no remove breakable, the rumble is still using + // the noise keys for impact sounds + entity_hide(self); + } + //---------------------------------------------------------------------- + // create any explosive damage (do this last!) + // setup the radius explosion as a delay to prevent endless loops + if (self.dmg) { + self.think = funcbreakable_delayexplode; + self.nextthink = time + 0.05; + } + } +}; + +//---------------------------------------------------------------------- +void() funcbreakable_touch = +{ + // This only works for monster and special jumping break impacts + if (!(other.flags & FL_MONSTER)) return; + if (other.flags & FL_ONGROUND) return; + if (!self.brktrigjump) return; + self.touch = SUB_Null; + self.use(); +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) funcbreakable_pain = +{ + local float loop_count; + local vector vel; + // As always there are exceptions + // Grenades bounce and don't impact breakables, cannot tell impact point + // If inflictor the same as attacker then particle impact done already + if (inflictor.classtype == CT_PROJ_GL) return; + if (inflictor == attacker) return; + // Check for player exception on damage to breakable + if (inflictor.flags & FL_CLIENT && self.brktrignoplayer) return; + if (attacker.flags & FL_CLIENT && self.brktrignoplayer) return; + + // Something is trying to wear down the breakable with damage + // work out facing angle and project particles upward + makevectors(inflictor.angles); + vel = -v_up*2; + while(loop_count < 4) { + particle (inflictor.origin, vel*0.1, self.bleedcolour + rint(random()*7), damage); + loop_count = loop_count + 1; + } +}; + +//---------------------------------------------------------------------- +void() funcbreakable_death = +{ + if (self.spawnflags & BREAK_NOSHOOT) return; + // Check for player exception on damage to breakable + else if (self.activate.flags & FL_CLIENT && self.brktrignoplayer) return; + else funcbreakable_use(); +}; + +//====================================================================== +// Setup all model/sound pre-cache +//---------------------------------------------------------------------- +void() breakable_cache = +{ + //---------------------------------------------------------------------- + // If a breakable style key setup, update all undefined sounds/model keys + if (self.style > 0 && self.style < BTYPE_CUSTOM) { + if (!self.brksound) self.brksound = self.style; + if (!self.brkimpsound) self.brkimpsound = self.style; + if (!self.brkobjects) self.brkobjects = self.style*10; + } + else return; + + //---------------------------------------------------------------------- + // make sure initial break sound is within range types (def=rock) + if (self.brksound < BTYPE_ROCK || self.brksound > BTYPE_CUSTOM) + self.brksound = BTYPE_ROCK; + + if (self.brksound == BTYPE_ROCK || self.brksound == BTYPE_BRICK) { + self.noise = SOUND_BRK_ROCK; + // Heavy rocks don't move around too much + if (!self.brkvelbase) self.brkvelbase = '0 0 50'; + if (!self.brkveladd) self.brkveladd = '100 100 100'; + } + else if (self.brksound == BTYPE_WOOD) { + self.noise = SOUND_BRK_WOOD; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 50'; + } + else if (self.brksound == BTYPE_GLASS) { + self.noise = SOUND_BRK_GLASS; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + else if (self.brksound == BTYPE_METAL) { + self.noise = SOUND_BRK_METAL; + if (!self.brkvelbase) self.brkvelbase = '50 50 100'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + else if (self.brksound == BTYPE_CERAMIC) { + self.noise = SOUND_BRK_CERAMIC; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + else if (self.noise == "") { + self.noise = SOUND_EMPTY; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + precache_sound(self.noise); + + //---------------------------------------------------------------------- + // make sure impack sounds are within range types (def=rock) + if (self.brkimpsound < BTYPE_ROCK || self.brkimpsound > BTYPE_CUSTOM) + self.brkimpsound = BTYPE_ROCK; + // All the impact sounds come in sets of 4 for random variety + self.brkimpqty = 4; + + if (self.brkimpsound == BTYPE_ROCK || self.brkimpsound == BTYPE_BRICK) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_ROCK1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_ROCK2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_ROCK3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_ROCK4; + } + else if (self.brkimpsound == BTYPE_WOOD) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_WOOD1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_WOOD2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_WOOD3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_WOOD4; + } + else if (self.brkimpsound == BTYPE_GLASS) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_GLASS1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_GLASS2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_GLASS3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_GLASS4; + } + else if (self.brkimpsound == BTYPE_METAL) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_METAL1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_METAL2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_METAL3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_METAL4; + } + else if (self.brkimpsound == BTYPE_CERAMIC) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_CERAMIC1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_CERAMIC2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_CERAMIC3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_CERAMIC4; + } + else { + // Workout total amount of active impact sounds (custom can have <4) + // empty slots are filled up with empty sounds for precache reasons + if (self.noise2 != "") { + if (self.noise3 != "") { + if (self.noise4 != "") self.brkimpqty = 4; + else self.brkimpqty = 3; + } + else self.brkimpqty = 2; + } + else self.brkimpqty = 1; + // Cannot have no impact sounds, always setup one sound by default + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.noise1 == "") self.noise1 = SOUND_IMP_ROCK1; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + if (self.noise4 == "") self.noise4 = SOUND_EMPTY; + } + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + precache_sound (self.noise4); + + //---------------------------------------------------------------------- + // make sure breakable objects are within range types (def=rock) + //---------------------------------------------------------------------- + if (self.brkobjects < BMODTYPE_SELF) self.brkobjects = BMODTYPE_ROCK1; + + // Two ways the models can be defined, using the default bmodel types + // or specifying the models via the brkobjs strings + // If the first string is empty, then the default = 4 (pre-defined) + // If first string defined, then count the model strings + + // If the first string is not empty then the mapper has to specify + // exactly what rubble models to choose from (randomly) + // The auto fill option (style/brkobjects) only if brkobj1 = empty + + if (self.brkobj1 == "") self.brkobjqty = 4; // Default + else { + // Need to check for custom breakable quantity first + if (self.brkobj2 != "") { + if (self.brkobj3 != "") { + if (self.brkobj4 != "") self.brkobjqty = 4; + else self.brkobjqty = 3; + } + else self.brkobjqty = 2; + } + else self.brkobjqty = 1; + } + + // All the broken models come in sets of 4 for random variety + // if brkobjects is set to a custom value then model strings will be filled in + // with a blank string and the brkobjqty will be adjusted to actual quanity + if (self.brkobjects == BMODTYPE_ROCK1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK1D; + } + else if (self.brkobjects == BMODTYPE_ROCK2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK2D; + } + else if (self.brkobjects == BMODTYPE_ROCK3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '20 8 1'; // Light Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK3D; + } + else if (self.brkobjects == BMODTYPE_ROCK4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '168 8 1'; // Whiteish + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK4D; + } + else if (self.brkobjects == BMODTYPE_ROCK5) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK5A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK5B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK5C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK5D; + } + else if (self.brkobjects == BMODTYPE_ROCK6) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '1 8 1'; // Black + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK6A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK6B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK6C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK6D; + } + else if (self.brkobjects == BMODTYPE_WOOD1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Dark Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_WOOD1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_WOOD1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_WOOD1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_WOOD1D; + } + else if (self.brkobjects == BMODTYPE_WOOD2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '112 8 1'; // Light Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_WOOD2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_WOOD2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_WOOD2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_WOOD2D; + } + else if (self.brkobjects == BMODTYPE_WOOD3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_WOOD3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_WOOD3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_WOOD3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_WOOD3D; + } + else if (self.brkobjects == BMODTYPE_GLASS1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS1D; + } + else if (self.brkobjects == BMODTYPE_GLASS2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '64 8 1'; // Red + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS2D; + } + else if (self.brkobjects == BMODTYPE_GLASS3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '96 8 1'; // Pink/Yellow + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS3D; + } + else if (self.brkobjects == BMODTYPE_GLASS4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '128 4 1'; // Purple + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS4D; + } + else if (self.brkobjects == BMODTYPE_METAL1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL1D; + } + else if (self.brkobjects == BMODTYPE_METAL2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL2D; + } + else if (self.brkobjects == BMODTYPE_METAL3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL3D; + } + else if (self.brkobjects == BMODTYPE_METAL4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL4D; + } + else if (self.brkobjects == BMODTYPE_METAL5) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL5A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL5B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL5C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL5D; + } + else if (self.brkobjects == BMODTYPE_BRICK1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK1D; + } + else if (self.brkobjects == BMODTYPE_BRICK2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK2D; + } + else if (self.brkobjects == BMODTYPE_BRICK3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK3D; + } + else if (self.brkobjects == BMODTYPE_BRICK4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '0 8 1'; // Grey/White + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK4D; + } + else if (self.brkobjects == BMODTYPE_BRICK5) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK5A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK5B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK5C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK5D; + } + else if (self.brkobjects == BMODTYPE_BRICK6) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK6A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK6B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK6C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK6D; + } + else if (self.brkobjects == BMODTYPE_BRICK7) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK7A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK7B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK7C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK7D; + } + else if (self.brkobjects == BMODTYPE_CERAMIC1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '96 8 1'; // Pink/Yellow + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS3D; + } + else { + // Cannot have no breakable models, always setup one model by default + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_EMPTY; + if (self.brkobj3 == "") self.brkobj3 = MODEL_EMPTY; + if (self.brkobj4 == "") self.brkobj4 = MODEL_EMPTY; + } + + precache_model(self.brkobj1); + precache_model(self.brkobj2); + precache_model(self.brkobj3); + precache_model(self.brkobj4); +}; + +//---------------------------------------------------------------------- +// Setup defaults +//---------------------------------------------------------------------- +void() breakable_defaults = +{ + // Setup breakable use blockers (trig once, delay damage) + self.waitmin = self.waitmin2 = FALSE; + + // Setup rubble counter = count + random*cnt + if (self.count <= 0) self.count = 4; + if (self.cnt == 0) self.cnt = 4; + + // If cnt = -1 then don't do any random factor, just exact amount + if (self.cnt < 0) self.height = self.count; + else self.height = self.count + rint(random()*self.cnt); + + // Backup rubble count for later (point entity) + self.count = self.height; + + // Special conditions - jump only, missile only, no health + if (self.brktrigjump < 0 || self.brktrigmissile < 0 || self.health < 0) + self.spawnflags = self.spawnflags | BREAK_NOSHOOT; + + // Setup default health + if (self.health == 0) self.health = 1; + + // Rubble damage overrides any explosion damage + if (self.spawnflags & BREAK_DAMAGE) { + if (self.dmg <= 0) self.dmg = 2; + } + else if (self.spawnflags & BREAK_EXPLOSION) { + if (self.dmg <= 0) self.dmg = DAMAGE_MONROCKET; + } + + // Setup default base + additional velocity and angle spin + if (!self.brkvelbase) self.brkvelbase = '50 50 100'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + if (self.brkavel <= 0) self.brkavel = 200; + if (self.brkfade <= 0) self.brkfade = 4; + + // angles has to be 0 0 0 otherwise brush model is twisted + // Is there any angle direction defined for impact force direction + if (self.angles_y) { + self.movedir_y = self.angles_y; + self.spawnflags = self.spawnflags | BREAK_MOVEDIR; + } + self.mangle = self.angles = '0 0 0'; + + // reset velocity / avelocity just in case of rogue key fields + self.velocity = self.avelocity = '0 0 0'; + + // Can fire other triggers, make sure no delay on breakable function + self.delay = 0; +}; + +//---------------------------------------------------------------------- +void() funcbreakable_damageon = +{ + self.takedamage = DAMAGE_YES; + self.th_pain = funcbreakable_pain; + self.th_die = funcbreakable_death; +}; + +//---------------------------------------------------------------------- +void() breakable_on = +{ + // Make sure use function reset + self.use = SUB_Null; + + // Setup collision based on bmodel type + if (self.bsporigin) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.model); + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + + // Used for sound, radius damage and explosion + self.attachment = spawn(); + self.attachment.origin = bmodel_origin(self); + setorigin(self.attachment, self.attachment.origin); + } + else { + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.mdl); + setorigin (self, self.origin); + setsize (self, self.bbmins , self.bbmaxs); + self.angles = self.pos2; + + // Used for sound, radius damage and explosion + self.attachment = self; + } + + if (self.spawnflags & BREAK_NOSHOOT) { + self.takedamage = DAMAGE_NO; + self.th_pain = SUB_Null_pain; + self.th_die = SUB_Null; + } + else { + // Check for any damage pause before spawning new breakable + // This is to prevent any breakables from spawning and + // instantly being destroyed by radius damage from explosions + // Really designed for multiple break stages + if (self.brkdelaydamage > 0) { + self.takedamage = DAMAGE_NO; + self.th_pain = SUB_Null_pain; + self.th_die = SUB_Null; + self.think = funcbreakable_damageon; + self.nextthink = self.waitmin2 = time + self.brkdelaydamage; + } + else { + self.takedamage = DAMAGE_YES; + self.th_pain = funcbreakable_pain; + self.th_die = funcbreakable_death; + } + + self.bleedcolour = self.pos1_x; + // Setup location (origin) to spawn particles + if (self.bsporigin) self.oldorigin = bmodel_origin(self); + else self.oldorigin = self.origin; + } + + // Originally had this as a targetname condition because + // if the breakable is used then it needs a referenced name + // Since adding brktrigjump, brktrigmissile ent keys there are + // external trigger events which need breakable entities to react + self.use = funcbreakable_use; + // Jumping monsters don't often hit the breakable object easily + // Easier to trap jump impact triggering with a touch function + if (self.brktrigjump) self.touch = funcbreakable_touch; +}; + +//====================================================================== +// Basic workhorse of breakable system (bmodel) +//====================================================================== +void() func_breakable = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // reset out of range styles and setup default = BTYPE_ROCK (1) + if (self.style < BTYPE_ROCK || self.style > BTYPE_MAX) self.style = BTYPE_ROCK; + // precache all sound/model stuff + breakable_cache(); + breakable_defaults(); + + // No point setting up a breakable if it cannot be triggered or shoot + if (self.targetname == "" && self.spawnflags & BREAK_NOSHOOT) { + dprint("\b[BRKMDL]\b Cannot be triggered or shoot, removed\n"); + setmodel (self, self.model); // set size and link into world + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + dprint("\b[BRKMDL]\b Origin - "); + dprint(vtos(self.oldorigin)); + dprint("\n"); + remove(self); + return; + } + + self.classtype = CT_FUNCBREAK; + self.classgroup = CG_BREAKABLE; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + self.wait = -1; // Always work once, cannot unbreak + + if (self.spawnflags & BREAK_STARTOFF) self.use = breakable_on; + else breakable_on(); +}; + +//---------------------------------------------------------------------- +// Point entity version of breakbles +// Good for producing rubble from areas unreachable players +// Earthquake and rubble and dust from ceilings +//---------------------------------------------------------------------- +void() func_breakable_spawner = +{ + // Check for targetname + if (self.targetname == "") { + dprint("\b[BRKTRIG]\b Missing targetname\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // reset out of range styles and setup default = BTYPE_ROCK (1) + if (self.style < BTYPE_ROCK || self.style > BTYPE_MAX) self.style = BTYPE_ROCK; + // precache all sound/model stuff + breakable_cache(); + breakable_defaults(); + + self.classtype = CT_FUNCBREAKSPN; + self.classgroup = CG_BREAKABLE; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.brkvol_x < 8) self.brkvol_x = 8; + if (self.brkvol_y < 8) self.brkvol_y = 8; + if (self.brkvol_z < 8) self.brkvol_z = 8; + + // Already a point entity, don't need to generate anything else + self.attachment = self; + self.use = funcbreakable_use; +}; + +//====================================================================== +// General purpose bmodel with toggle states and solid/fade functions +// Could be used for all sorts of situations not involving breakables +//====================================================================== +/*QUAKED func_breakable_wall (0 .5 .8) ? START_ON SOLID FADEOUT +Switchable bmodel for breakable setups with optional collision +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : set to -1 for trigger once condition (def=0) +waitmin : random time to wait before fading out +-------- SPAWNFLAGS -------- +START_ON : Will spawn visible and wait for trigger +SOLID : Will block player/monster movement +FADEOUT : Will fade out after a certain amount of time if visible! +-------- NOTES -------- +Switchable bmodel for breakable setups with optional collision + +=============================================================================*/ +void() breakable_wall_state = +{ + // Show model and setup collision state + if (self.state == STATE_ENABLED) { + // Does the bmodel require any solid collision? + if (self.spawnflags & BREAKWALL_SOLID) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + } + else { + // Bmodel visiable, no collision + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + } + // Add bmodel to the world + setmodel (self, self.mdl); + } + // hide model + else { + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.modelindex = 0; + self.model = ""; + } +}; + +//---------------------------------------------------------------------- +void() breakable_wall_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + + // Toggle bmodel visible state + if (self.state == STATE_ENABLED) self.state = STATE_DISABLED; + else self.state = STATE_ENABLED; + + // make sure model state is correct + breakable_wall_state(); + + // Is the breakable wall visible and designed to fade away? + if (self.spawnflags & BREAKWALL_FADEOUT && self.state == STATE_ENABLED) { + // Setup random timer and fade away! + self.nextthink = time + self.waitmin + random()*self.waitmin; + self.think = breakable_remove; + // Change the model type and state otherwise will not alpah fade + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_BBOX; + } +}; + +//---------------------------------------------------------------------- +void() func_breakable_wall = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCBREAKWALL; + self.classgroup = CG_BREAKABLE; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + self.angles = '0 0 0'; // Stop model twisting + self.mdl = self.model; // Save for later + + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Make sure the bmodel is active in the world before changing state + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.mdl); + + // Something that fades away does it only once + if (self.spawnflags & BREAKWALL_FADEOUT) self.wait = -1; + // Default fade time = time+fade+random()*fade + if (!self.waitmin) self.waitmin = 4; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = breakable_wall_use; + self.estate = ESTATE_ON; + + if (self.spawnflags & BREAKWALL_START_ON) self.state = STATE_ENABLED; + else self.state = STATE_DISABLED; + breakable_wall_state(); +}; + +//====================================================================== +// A point entity which triggers a breakable and monster together +//====================================================================== +/*QUAKED trigger_monsterbreak (.8 .5 .8) (-8 -8 -8) (8 8 8) NODELAY WAKEANIM +Trigger (once) breakable and monster together +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : points to func_breakable (single target) +target2 : points to a monster (single target) +wait : time before breakable is triggered (def 0.2) +-------- SPAWNFLAGS -------- +NODELAY : No delay between monster and breakable trigger +WAKEANIM : Will do special wakeup animation when triggered +-------- NOTES -------- +Trigger (once) breakable and monster together + +======================================================================*/ +void() trig_monbreak_delay = +{ + // Check for breakable targetname first + if (self.target != "") { + // Find breakable (single target only) + self.owner = find(world,targetname,self.target); + if (self.owner.classtype == CT_FUNCBREAK) { + self.owner.activate = self; + self = self.owner; + self.use(); + } + } +}; + +//---------------------------------------------------------------------- +void() trig_monbreak_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Trigger once + self.attack_finished = LARGE_TIMER; + + // Any monster defined to wakeup? + if (self.target2 != "") { + // Find monster (single target only) + self.enemy = find(world,targetname,self.target2); + if (self.enemy.flags & FL_MONSTER) { + if (self.spawnflags & MONTRIG_WAKEUPANIM) self.enemy.wakeuptrigger = TRUE; + trigger_ent(self.enemy, other); + } + } + + // Time to explode breakable? + if (self.spawnflags & MONTRIG_NODELAY) trig_monbreak_delay(); + else { + // setup delay to trigger breakable wall + self.nextthink = time + self.wait; + self.think = trig_monbreak_delay; + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterbreak = +{ + self.classtype = CT_TRIGMONBREAK; + self.classgroup = CG_BREAKABLE; + if (self.wait <= 0) self.wait = 0.2; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trig_monbreak_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED misc_breakable_pot1 (1 .5 .25) (-24 -24 -32) (24 24 32) STARTOFF NODAMAGE EXPLOSION SILENT DAMAGE NOMOSTER NOSOUND NOROTATE +{ model(":progs/misc_pot1.mdl"); } +Breakable ceramic Pot 1 with handles +-------- KEYS -------- +target : Additional targets to fire when model breaks +mangle : Override model orientation (Pitch Yaw Roll) +exactskin : 0=Default, 1=pattern 2, 2=pattern 3, 3= pattern 4 +health : amount of damage to take before breaking (def 1) +count : minimum quantity to spawn (def 4) +cnt : random quantity to spawn (def 4) final qty = count + random(cnt) +dmg : explosive radius damage (emits from center of func object) +pos1 : x=start particle colour, y=random range, z=quantity +brkvelbase : Base amount for velocity of broken parts (def "50 50 100") +brkveladd : Random additions for velocity of broken parts (def "100 100 150") +brkavel : Amount of breaking object angle velocity (def 200) +brkfade : Fade time before rubble fades away (def 4+random()x4) +angles : direction to throw rubble (override default = impact direction) +brkgravity : will change the gravity for rubble, useful for underwater +-------- SPAWNFLAGS -------- +STARTOFF : Will wait for trigger to spawn +NODAMAGE : Cannot be damaged or shot, trigger only +EXPLOSION : trigger sprite/particle explosion +SILENT : No initial breakage sound +DAMAGE : Spawning rubble can damage (def = 2, use dmg key for touch damage) +NOMONSTER : monsters cannot damage this breakable and/or spawning rubble will not damage monsters +NOSOUND : Spawning rubble has no impact sounds +NOROTATE : Spawning rubble has No Y rotation +-------- NOTES -------- +Breakable ceramic Pot 1 with handles +======================================================================*/ +void() misc_breakable_pot1 = +{ + self.classtype = CT_FUNCBREAKMDL; + self.classgroup = CG_BREAKABLE; + self.bbmins = '-16 -16 -24'; + self.bbmaxs = '16 16 24'; + self.brkvol = '32 32 48'; + self.mdl = "progs/misc_pot1.mdl"; + precache_model(self.mdl); + self.skin = self.exactskin; + + self.style = BTYPE_CERAMIC; + self.brkobjects = BMODTYPE_CUSTOM; + self.brkobj1 = "progs/misc_potshard1.mdl"; + self.brkobj2 = "progs/misc_potshard2.mdl"; + self.brkobj3 = "progs/misc_potshard3.mdl"; + self.brkobj4 = "progs/misc_potshard4.mdl"; + self.pos1 = '16 8 1'; // Brown + self.wait = -1; // Only break once + + // Save any custom angles, otherwise random Y rotation + self.pos2 = '0 0 0'; + if (CheckZeroVector(self.mangle) == FALSE) self.pos2 = self.mangle; + else self.pos2_y = rint(random()*359); + + // precache all sound/model stuff + breakable_cache(); + breakable_defaults(); + + if (self.spawnflags & BREAK_STARTOFF) self.use = breakable_on; + else breakable_on(); +}; diff --git a/QC_other/QC_arcane/client.qc b/QC_other/QC_arcane/client.qc new file mode 100644 index 00000000..6380ad58 --- /dev/null +++ b/QC_other/QC_arcane/client.qc @@ -0,0 +1,1268 @@ +/*====================================================================== + CLIENT FUNCTIONS +======================================================================*/ +// Vanilla Quake Inventory reset combined flag +// IT_SUPERHEALTH, IT_KEY1, IT_KEY2 +// IT_INVISIBILITY, IT_INVULNERABILITY, IT_SUIT, IT_QUAD +float IT_ITEMRESET = 8323072; // 65536++ +float IT_MODRESET = 8380416; // 8192++ +float ALL_WEAPONS = 255; + +// client_camera.qc +void() SetupIntermissionCamera; +void() CycleIntermissionCamera; + +// client_debuff.qc AND client_power.qc +void() ClientDeBuff; +void() ClientPowerups; + +// player.qc +void(entity inflictor, entity attacker, float damage) player_pain; +void() player_death; +void() player_stand1; + +// triggers.qc +void() trigger_changelevel_finish; +void() trigger_cdtrack_change; +void(entity targ) trigger_skybox_change; + +/*====================================================================== + USED : Load (map command) NEW MAP or NEW GAME + This is a function called via the engine for new games + Resets all parm data back to default values, followed by Decode +======================================================================*/ +void() SetNewParms = +{ + dprint("\b[CLIENT]\b SetNewParms\n"); + + // Brand new game/map, reset start position settings + update_configflag(SVR_SPAWN_BIT1, FALSE); + update_configflag(SVR_SPAWN_BIT2, FALSE); + update_configflag(SVR_SPAWN_BIT3, FALSE); + fog_active = FALSE; + + parm1 = IT_SHOTGUN | IT_AXE; // Default ID weapon start + parm2 = 100; // Starting Health + parm3 = 0; parm9 = 0; // Armourtype and value + parm4 = 25; parm5 = 0; // Ammo qty (shell/nail/rocket/cells) + parm6 = 0; parm7 = 0; + parm8 = 1; // Current selected weapon + parm10 = 0; // New MOD items + + // Update new player inventory based on config flag + if (query_configflag(SVR_UPDAXE)) parm10 = parm10 | IT_UPGRADE_AXE; + if (query_configflag(SVR_UPDSSG)) parm10 = parm10 | IT_UPGRADE_SSG; + if (query_configflag(SVR_UPDLG)) parm10 = parm10 | IT_UPGRADE_LG; + + // Are map variables live? + if (mapvar_cvar) dprint("\b[CLIENT]\b LIVE Map Variables Detected\n"); + else { + dprint("\b[CLIENT]\b RESETTING Map Variables\n"); + // Reset map variables ready for use + parm11 = parm12 = parm13 = parm14 = parm15 = parm16 = 0; + mapvar_reset(); + } +}; + +/*====================================================================== +// USED : trigger CHANGE LEVEL +// Stores a copy of the parm data ready for death/level reset +======================================================================*/ +void() SetChangeParms = +{ + dprint("\n\b[CLIENT]\b SetChangeParms\n"); + if (self.health < 1) { SetNewParms (); return; } + + // remove temporary items (keys and powerups) + self.items = self.items - (self.items & IT_ITEMRESET); + parm1 = self.items; + self.moditems = self.moditems - (self.moditems & IT_MODRESET); + parm10 = self.moditems; + dprint("\b[CLIENT]\b MOD weapons ("); dprint(ftos(parm10)); dprint(")\n"); + + // cap super health + if (self.health > HEAL_PLAYMAX) self.health = HEAL_PLAYMAX; + if (self.health < 50) self.health = 50; + parm2 = self.health; + + parm3 = self.armorvalue; + parm9 = self.armortype * 100; + + // Always make sure the player has 25 shells + if (self.ammo_shells < DEF_SHELLS) parm4 = DEF_SHELLS; + else parm4 = self.ammo_shells; + parm5 = self.ammo_nails; + parm6 = self.ammo_rockets; + parm7 = self.ammo_cells; + + parm8 = self.weapon; + + dprint("\b[CLIENT]\b SAVING Map Variables\n"); + // Save map variables (22 bits per parm, 132 total) + parm11 = mapvar[0]; parm12 = mapvar[1]; parm13 = mapvar[2]; + parm14 = mapvar[3]; parm15 = mapvar[4]; parm16 = mapvar[5]; +}; + +/*====================================================================== + USED : Load NEW MAP or trigger CHANGE LEVEL + Not used when loading a saved file or quickload +======================================================================*/ +void() DecodeWorldParms = +{ + local float parm_items; + parm_items = parm1; + + dprint("\b[CLIENT]\b Decode Worldspawn Inv Parms\n"); + //---------------------------------------------------------------------- + // Show developer feedback on player inventory update + if (world.give_weapons) { + dprint("\b[CLIENT]\b Weapon Give ( "); + if (world.give_weapons & IT_SHOTGUN) dprint("SG "); + if (world.give_weapons & IT_SUPER_SHOTGUN) dprint("SSG "); + if (world.give_weapons & IT_NAILGUN) dprint("NG "); + if (world.give_weapons & IT_SUPER_NAILGUN) dprint("SNG "); + if (world.give_weapons & IT_GRENADE_LAUNCHER) dprint("GL "); + if (world.give_weapons & IT_ROCKET_LAUNCHER) dprint("RL "); + if (world.give_weapons & IT_LIGHTNING) dprint("LG "); + dprint(")\n"); + } + if (world.take_weapons) { + dprint("\b[CLIENT]\b Weapon Take ( "); + if (world.take_weapons & IT_SHOTGUN) dprint("SG "); + if (world.take_weapons & IT_SUPER_SHOTGUN) dprint("SSG "); + if (world.take_weapons & IT_NAILGUN) dprint("NG "); + if (world.take_weapons & IT_SUPER_NAILGUN) dprint("SNG "); + if (world.take_weapons & IT_GRENADE_LAUNCHER) dprint("GL "); + if (world.take_weapons & IT_ROCKET_LAUNCHER) dprint("RL "); + if (world.take_weapons & IT_LIGHTNING) dprint("LG "); + dprint(")\n"); + } + + //---------------------------------------------------------------------- + // Adding weapons to existing inventory + if (world.give_weapons) { + parm_items = parm_items | (world.give_weapons & ALL_WEAPONS); + } + //---------------------------------------------------------------------- + // Player always has the axe, it cannot be removed! + if (world.take_weapons > 0) { + if (world.take_weapons & IT_SHOTGUN && parm_items & IT_SHOTGUN) + parm_items = parm_items - IT_SHOTGUN; + if (world.take_weapons & IT_SUPER_SHOTGUN && parm_items & IT_SUPER_SHOTGUN) { + parm_items = parm_items - IT_SUPER_SHOTGUN; + // Player cannot have upgrades without base item + parm10 = parm10 - (parm10 & IT_UPGRADE_SSG); + } + if (world.take_weapons & IT_NAILGUN && parm_items & IT_NAILGUN) + parm_items = parm_items - IT_NAILGUN; + if (world.take_weapons & IT_SUPER_NAILGUN && parm_items & IT_SUPER_NAILGUN) + parm_items = parm_items - IT_SUPER_NAILGUN; + if (world.take_weapons & IT_GRENADE_LAUNCHER && parm_items & IT_GRENADE_LAUNCHER) + parm_items = parm_items - IT_GRENADE_LAUNCHER; + if (world.take_weapons & IT_ROCKET_LAUNCHER && parm_items & IT_ROCKET_LAUNCHER) + parm_items = parm_items - IT_ROCKET_LAUNCHER; + if (world.take_weapons & IT_LIGHTNING && parm_items & IT_LIGHTNING) { + parm_items = parm_items - IT_LIGHTNING; + // Player cannot have upgrades without base item + parm10 = parm10 - (parm10 & IT_UPGRADE_LG); + } + } + + // Store result back to global variable + parm1 = parm_items; + + //---------------------------------------------------------------------- + // Update player health (reset or minimum value) + if (world.reset_health > 0 && world.reset_health <= HEAL_PLAYMAX) { + dprint("\b[CLIENT]\b Health ("); dprint(ftos(parm2)); dprint(") To ("); + parm2 = world.reset_health; + dprint(ftos(parm2)); dprint(")\n"); + } + else if (world.max_health && (parm2 < world.max_health) ) { + dprint("\b[CLIENT]\b Health ("); dprint(ftos(parm2)); dprint(") To ("); + if (parm2 < world.max_health) parm2 = world.max_health; + dprint(ftos(parm2)); dprint(")\n"); + } + + //---------------------------------------------------------------------- + // Update the inventory ammo quantities + // currentammo = 1 to reset the inventory to worldspawn values + // currentammo = 0 to use the worldspawn values as a minimum quantity + if (world.ammo_shells || (world.currentammo && parm4 > 0)) { + dprint("\b[CLIENT]\b Ammo Shells ("); dprint(ftos(parm4)); dprint(") To ("); + if (world.currentammo) parm4 = world.ammo_shells; + else if (parm4 < world.ammo_shells) parm4 = world.ammo_shells; + if (parm4 > AMMO_MAXSHELLS) parm4 = AMMO_MAXSHELLS; + else if (parm4 < 0) parm4 = 0; + dprint(ftos(parm4)); dprint(")\n"); + } + if (world.ammo_nails || (world.currentammo && parm5 > 0)) { + dprint("\b[CLIENT]\b Ammo Spikes ("); dprint(ftos(parm5)); dprint(") To ("); + if (world.currentammo) parm5 = world.ammo_nails; + else if (parm5 < world.ammo_nails) parm5 = world.ammo_nails; + if (parm5 > AMMO_MAXNAILS) parm5 = AMMO_MAXNAILS; + else if (parm5 < 0) parm5 = 0; + dprint(ftos(parm5)); dprint(")\n"); + } + if (world.ammo_rockets || (world.currentammo && parm6 > 0)) { + dprint("\b[CLIENT]\b Ammo Rockets ("); dprint(ftos(parm6)); dprint(") To ("); + if (world.currentammo) parm6 = world.ammo_rockets; + else if (parm6 < world.ammo_rockets) parm6 = world.ammo_rockets; + if (parm6 > AMMO_MAXROCKETS) parm6 = AMMO_MAXROCKETS; + else if (parm6 < 0) parm6 = 0; + dprint(ftos(parm6)); dprint(")\n"); + } + if (world.ammo_cells || (world.currentammo && parm7 > 0)) { + dprint("\b[CLIENT]\b Ammo Cells ("); dprint(ftos(parm7)); dprint(") To ("); + if (world.currentammo) parm7 = world.ammo_cells; + else if (parm7 < world.ammo_cells) parm7 = world.ammo_cells; + if (parm7 > AMMO_MAXROCKETS) parm7 = AMMO_MAXROCKETS; + else if (parm7 < 0) parm7 = 0; + dprint(ftos(parm7)); dprint(")\n"); + } + + //---------------------------------------------------------------------- + // Update player armour type and quantity + if (world.armortype > 0) { + // Remove any previous armour types from the HUD + parm1 = parm1 - (parm1 & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); + // Setup any armour quantity first, limit check with armour type + if (world.armorvalue > 0) parm3 = world.armorvalue; + + // Work through the different armour types, resetting armour quantity + if (world.armortype == 1) { + parm1 = parm1 | IT_ARMOR1; + parm9 = ARMOR_GRN_TYPE * 100; + if (!world.armorvalue || parm3 > ARMOR_GRN_VALUE) parm3 = ARMOR_GRN_VALUE; + dprint("\b[CLIENT]\b Green Armor ("); dprint(ftos(parm3)); dprint(")\n"); + } + else if (world.armortype == 2) { + parm1 = parm1 | IT_ARMOR2; + parm9 = ARMOR_YEL_TYPE * 100; + if (!world.armorvalue || parm3 > ARMOR_YEL_VALUE) parm3 = ARMOR_YEL_VALUE; + dprint("\b[CLIENT]\b Yellow Armor ("); dprint(ftos(parm3)); dprint(")\n"); + } + else if (world.armortype == 3) { + parm1 = parm1 | IT_ARMOR3; + parm9 = ARMOR_RED_TYPE * 100; + if (!world.armorvalue || parm3 > ARMOR_RED_VALUE) parm3 = ARMOR_RED_VALUE; + dprint("\b[CLIENT]\b Red Armor ("); dprint(ftos(parm3)); dprint(")\n"); + } + // Default is no armour + else parm3 = 0; + } +}; + +/*====================================================================== + USED : Load NEW MAP or trigger CHANGE LEVEL + Double check the player inventory matches the server/config flags + Check worldspawn for add/removal of upgrade items +======================================================================*/ +void() SyncModInventory = +{ + //---------------------------------------------------------------------- + // Shadow Axe + //---------------------------------------------------------------------- + // Check worldspawn for upgrade_axe first, add/deny inventory + if (world.upgrade_axe < 0) { + dprint("\b[MODINV]\b Worldspawn removing Axe Upgrade\n"); + parm10 = parm10 - (parm10 & IT_UPGRADE_AXE); + update_configflag(SVR_UPDAXE, FALSE); + } + else if (world.upgrade_axe > 0) { + dprint("\b[MODINV]\b Worldspawn adding Axe Upgrade\n"); + parm10 = parm10 | IT_UPGRADE_AXE; + parm1 = parm1 | IT_AXE; + update_configflag(SVR_UPDAXE, TRUE); + } + // Finally syncing the player inventory to serverflags + else if (parm10 & IT_UPGRADE_AXE) { + dprint("\b[MODINV]\b Inventory adding Axe Upgrade\n"); + update_configflag(SVR_UPDAXE, TRUE); + } + + //---------------------------------------------------------------------- + // Widowmaker Shotgun + //---------------------------------------------------------------------- + // Check worldspawn for upgrade_ssg first, add/deny inventory + if (world.upgrade_ssg < 0) { + dprint("\b[MODINV]\b Worldspawn removing SSG Upgrade\n"); + parm10 = parm10 - (parm10 & IT_UPGRADE_SSG); + update_configflag(SVR_UPDSSG, FALSE); + } + else if (world.upgrade_ssg > 0) { + dprint("\b[MODINV]\b Worldspawn adding SSG Upgrade\n"); + parm10 = parm10 | IT_UPGRADE_SSG; + parm1 = parm1 | IT_SUPER_SHOTGUN; + update_configflag(SVR_UPDSSG, TRUE); + } + // Syncing the player inventory to serverflags + else if (parm10 & IT_UPGRADE_SSG) { + dprint("\b[MODINV]\b Inventory adding SSG Upgrade\n"); + update_configflag(SVR_UPDSSG, TRUE); + } + + //---------------------------------------------------------------------- + // Projectile Shotgun + //---------------------------------------------------------------------- + // Check for worldspawn feature to turn off projectiles + casing + if (world.no_sgprojectile > 0) + update_configflag(SVR_SHOTGPROJ, TRUE); + if (world.no_sgcasing > 0) + update_configflag(SVR_SHOTGCASE, TRUE); + + //---------------------------------------------------------------------- + // Plasma Gun + //---------------------------------------------------------------------- + // Check worldspawn for upgrade_lg first, add/deny inventory + if (world.upgrade_lg < 0) { + dprint("\b[MODINV]\b Worldspawn removing LG Upgrade\n"); + parm10 = parm10 - (parm10 & IT_UPGRADE_LG); + update_configflag(SVR_UPDLG, FALSE); + } + else if (world.upgrade_lg > 0) { + dprint("\b[MODINV]\b Worldspawn adding LG Upgrade\n"); + parm10 = parm10 | IT_UPGRADE_LG; + parm1 = parm1 | IT_LIGHTNING; + update_configflag(SVR_UPDLG, TRUE); + } + // Finally syncing the player inventory to serverflags + else if (parm10 & IT_UPGRADE_LG) { + dprint("\b[MODINV]\b Inventory adding LG Upgrade\n"); + update_configflag(SVR_UPDLG, TRUE); + } +}; + +/*====================================================================== + USED : Load NEW MAP or trigger CHANGE LEVEL + Not used when loading a saved file or quickload +======================================================================*/ +void() DecodeLevelParms = +{ + dprint("\b[CLIENT]\b Decode (Level) Parms\n"); + // Map Variables are active (do not reset) + mapvar_cvar = TRUE; + // Found any runes? going back to start map? reset inventory + if (serverflags & SVR_RUNE_ALL) { + // take away all stuff on starting new episode + if (world.model == "maps/start.bsp") SetNewParms (); + } + + DecodeWorldParms(); // Decode worldspawn client inv updates + sync_serverflags(); // update/sync serverflags to worldspawn + SyncModInventory(); // update/sync mod inventory items + + // Read all current params into client variables + self.items = parm1; + self.moditems = parm10; + self.health = parm2; + self.ammo_shells = parm4; + self.ammo_nails = parm5; + self.ammo_rockets = parm6; + self.ammo_cells = parm7; + self.weapon = parm8; + self.armortype = parm9 * 0.01; + self.armorvalue = parm3; + + dprint("\b[CLIENT]\b Reading Map Variables\n"); + // Read/Setup map variables (22 bits per parm, 132 total) + mapvar[0] = parm11; mapvar[1] = parm12; mapvar[2] = parm13; + mapvar[3] = parm14; mapvar[4] = parm15; mapvar[5] = parm16; + + // Check for any worldspawn map variable settings + if (CheckZeroVector(world.mapvar_update) == FALSE) + mapvar_range(world.mapvar_update); +}; + +//---------------------------------------------------------------------- +void() GotoNextMap = +{ + // if samelevel is set, stay on same level + if (cvar("samelevel")) changelevel (mapname); + else changelevel (nextmap); +}; + +/*====================================================================== + NextLevel (DM ONLY) + - A special function designed for MP only, will cycle around + the first map of each episode until someone quits + gives the player runes as well to tell which to load +======================================================================*/ +void() NextLevel = +{ + local entity o; + + if (mapname == "start") { + if (!cvar("registered")) mapname = "e1m1"; + else if (query_configflag(SVR_RUNE_KEY1) == FALSE) { + mapname = "e1m1"; + update_configflag(SVR_RUNE_KEY1, TRUE); + } + else if (query_configflag(SVR_RUNE_KEY2) == FALSE) { + mapname = "e2m1"; + update_configflag(SVR_RUNE_KEY1, TRUE); + } + else if (query_configflag(SVR_RUNE_KEY3) == FALSE) { + mapname = "e3m1"; + update_configflag(SVR_RUNE_KEY1, TRUE); + } + else if (query_configflag(SVR_RUNE_KEY4) == FALSE) { + mapname = "e4m1"; + update_configflag(SVR_RUNE_KEY1, FALSE); + update_configflag(SVR_RUNE_KEY2, FALSE); + update_configflag(SVR_RUNE_KEY3, FALSE); + } + + o = spawn(); + o.map = mapname; + } + else { + // find a trigger changelevel + o = find(world, classname, "trigger_changelevel"); + + // go back to start if no trigger_changelevel + if (!o) { + mapname = "start"; + o = spawn(); + o.map = mapname; + } + } + + nextmap = o.map; + gameover = TRUE; + + if (o.nextthink < time) { + o.think = trigger_changelevel_finish; + o.nextthink = time + 0.1; + } +}; + +/*====================================================================== + CheckRules (DM ONLY) + - Check death timers (time/frag limits) + and decide if to load a new map or not +======================================================================*/ +void() CheckRules = +{ + local float timelimit, fraglimit; + + if (deathmatch == 0) return; // Playing SP? + if (gameover) return; // someone else quit the game already + + timelimit = cvar("timelimit") * 60; + fraglimit = cvar("fraglimit"); + + if (timelimit && time >= timelimit) NextLevel(); + else if (fraglimit && self.frags >= fraglimit) NextLevel(); +}; + +//---------------------------------------------------------------------- +void() SetupSpawnCoopLocations = +{ + local entity cooploc, prevloc; + + // The first spawn for coop is always the SP start location + cooploc = find (world, classname, "info_player_coop"); + prevloc = world; + + // Any coop spawns exist? + if (cooploc) { + // Create a list + while(cooploc) { + // first spawn in chain? setup first and previous spawns + if (!prevloc) { + coop_ent = cooploc; + coop_ent.count = 0; + } + else prevloc.owner = cooploc; + + // Save current spawn location to previous ready for loop + prevloc = cooploc; + coop_ent.count = coop_ent.count + 1; + + cooploc = find(cooploc, classname, "info_player_coop"); + } + // Close the chain + prevloc.owner = coop_ent; + dprint("\b[COOP]\b Spawn locations found ("); + dprint(ftos(coop_ent.count)); dprint(")\n"); + } + else { + // No coop spawns, use start location + dprint("\b[COOP]\b Spawn locations Missing!\n"); + coop_ent = find (world, classname, "info_player_start"); + // no start location, WTF!?! + if (!coop_ent) coop_ent = client_ent; + coop_ent.owner = coop_ent; + } +}; + +//---------------------------------------------------------------------- +// Find a location for the player to spawn at +//---------------------------------------------------------------------- +entity() SelectSpawnPoint = +{ + local entity spot, thing; + local float pcount, start2, runeactive; + + // Always use a player start as default position + if (!lastspawn) lastspawn = find (world, classname, "info_player_start"); + + // Cycle through list of info_player_coop location + if (coop > 0) { + // Check for coop spawn list + if (!coop_ent) return lastspawn; + // If first entry of coop list start player then its broken + else if (coop_ent.classtype == CT_SPAWNSP) return lastspawn; + else { + // Setup coop list if last location isstart player + if (lastspawn.classtype == CT_SPAWNSP) lastspawn = coop_ent; + // Move forward in coop spawn location list + lastspawn = lastspawn.owner; + // Check if spawn location is active? + if (lastspawn.estate & ESTATE_BLOCK) { + pcount = coop_ent.count; + while(pcount > 0) { + lastspawn = lastspawn.owner; + if (lastspawn.estate == ESTATE_ON) pcount = -1; + else pcount = pcount - 1; + } + } + // Double check if spawn location free? + if (lastspawn.estate & ESTATE_BLOCK) { + // Default back to player start if not available + lastspawn = find (world, classname, "info_player_start"); + } + return lastspawn; + } + } + // choose a info_player_deathmatch point + else if (deathmatch > 0) { + spot = lastspawn; + while (1) { + spot = find(spot, classname, "info_player_deathmatch"); + if (spot == world) spot = find (world, classname, "info_player_start"); + if (spot != world) { + if (spot == lastspawn) return lastspawn; + pcount = 0; + thing = findradius(spot.origin, 32); + while(thing) { + if (thing.flags & FL_CLIENT) pcount = pcount + 1; + thing = thing.chain; + } + if (pcount == 0) { + lastspawn = spot; + return spot; + } + } + } + } + + // Check for any info_player_start2 special spawn locations + if (query_configflag(SVR_SPAWN_BIT1) > 0) start2 = 1; + else start2 = 0; + if (query_configflag(SVR_SPAWN_BIT2) > 0) start2 = start2 + 2; + if (query_configflag(SVR_SPAWN_BIT3) > 0) start2 = start2 + 4; + if (start2 > 0) dprint("\b[CLIENT]\b Unique Info_Player_Start2 Active\n"); + + // Check for any runes active + runeactive = query_configflag(SVR_RUNE_ALL); + + // have a rune or new spawnflag option? + if ( runeactive > 0 || start2 > 0 ) { + // Find second spawn locations (can have several) + spot = find (world, classname, "info_player_start2"); + while (spot) { + // Check for rune only start 2 setup + if (runeactive > 0 && spot.startspawn2 == 0) + return spot; + // Check for special spawn2 location + else if (spot.startspawn2 == start2) + return spot; + // Keep searching for start2 positions + spot = find(spot, classname, "info_player_start2"); + } + } + + // Last chance to find a spawn location before giving up! + spot = find (world, classname, "info_player_start"); + if (!spot) dprint ("\b[CLIENT_SPAWN]\b missing info_player_start!"); + + return spot; +}; + +//---------------------------------------------------------------------- +// PutClientInServer - called each time a player is spawned +//---------------------------------------------------------------------- +void() PutClientInServer = +{ + local entity spot; + + client_ent = self; + self.classname = "player"; + self.classtype = CT_PLAYER; + self.classgroup = CG_PLAYERS; + // This entity can never be switched off + self.estate = ESTATE_ON; + self.estate_off = SUB_Null; + + // Setup entity chains for coop, dm and intermission + SetupSpawnCoopLocations(); + SetupIntermissionCamera(); + + // Find a spawn location in the map + spot = SelectSpawnPoint (); + // Fire any targets on spawn location + if (spot.target) self.target2 = spot.target; + else self.target2 = ""; + + self.headmdl = MODEL_PLAYER_HEAD; + self.health = self.max_health = HEAL_PLAYMAX; + self.takedamage = DAMAGE_AIM; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_WALK; + self.classmove = MON_MOVEWALK; + self.show_hostile = 0; + self.gibhealth = -40; + self.gibbed = FALSE; + self.flags = FL_CLIENT; + self.air_finished = time + WATER_AIR; + self.dmg = WATER_DAMAGE; + self.effects = 0; + self.steplast = 1; + + self.super_damage_finished = self.super_time = 0; + self.radsuit_finished = self.rad_time = 0; + self.invisible_finished = self.invisible_time = 0; + self.invincible_finished = self.invincible_time = 0; + + self.sharpshoot_finished = self.sharpshoot_time = 0; + self.nailpiercer_finished = self.nailpiercer_time = 0; + self.wetsuit_finished = self.wetsuit_time = 0; + + self.steptype = FS_TYPEMEDIUM; // Standard boots + self.suppressCenterPrint = FALSE; // No centerprint active + + ResetDebuffSystem(self); // Reset/initialize debuff system + + self.enemy = world; + DecodeLevelParms (); + self.weapon = W_BestWeapon (self); // Pick best weapon from inventory + W_SetCurrentAmmo (self); // Update hud icons and v_model + + self.attack_finished = time; + self.th_pain = player_pain; + self.th_die = player_death; + + self.deadflag = DEAD_NO; // The player is alive! + self.pausetime = 0; // make sure player has 0 velocity when spawning + + update_hud_totals(HUD_MONSTERS); // Make screen total is correct + update_hud_totals(HUD_SECRETS); // Update monsters and secrets + + // spot = SelectSpawnPoint (); + self.origin = spot.origin + '0 0 1'; + if (spot.mangle) self.angles = spot.mangle; + else self.angles = spot.angles; + self.v_angle = self.angles; + self.fixangle = TRUE; // turn this way immediately + + // oh, this is a hack! + setmodel (self, MODEL_PLAYER_EYES); + modelindex_eyes = self.modelindex; + + setmodel (self, MODEL_PLAYER); + modelindex_player = self.modelindex; + + self.bbmins = VEC_HULLSHORT_MIN; // -16 -16 -24, 16 16 32 + self.bbmaxs = VEC_HULLSHORT_MAX; + setsize (self, self.bbmins, self.bbmaxs); + self.view_ofs = '0 0 22'; + player_stand1 (); + + if (deathmatch || coop) { + makevectors(self.angles); + spawn_tfog (self.origin + v_forward*20); + } + + spawn_tdeath (self.origin, self); +}; + +// Forward compiler links +void() PlayerJump; +void() WaterMove; +void() CheckWaterJump; +void() ClientDeath; + +//---------------------------------------------------------------------- +// PlayerPreThink - Called every frame before physics are run +//---------------------------------------------------------------------- +void() PlayerPreThink = +{ + // Once the map has loaded (prethink) set loadflag (never saved) + if (!prethink) { + prethink = TRUE; // prethink flag complete + postthink = FALSE; // postthink flag reset + sync_configflag(); // Setup and sync serverflag + // Some clients load faster, prevent player gasping for air + self.air_finished = time + WATER_AIR; + + // Double check which engine is active? + // A DP/FTE Quickload could be happening and the + // Particle system needs to cope with the change + ext_active = cvar("pr_checkextension"); + if (!ext_active) { + // Revert to default = Fitz engine setup + engine = ENG_FITZ; + ext_dppart = ext_dpfog = ext_dpsurf = FALSE; + ext_dprain = ext_dpsnow = FALSE; + } + + // Check for trigger CD track/Skybox change + // Load/Quickload does not keep track of these changes + // Use a new global variable instead + if (trig_cdtrack > 0) trigger_cdtrack_change(); + if (trig_skybox != "") trigger_skybox_change(self); + } + + // If Intermission system active check for button0-2 keys + if (intermission_running > 0) { CycleIntermissionCamera(); return; } + + makevectors (self.v_angle); + CheckRules (); + WaterMove (); + + if (self.waterlevel == 2) CheckWaterJump (); + + if (self.deadflag >= DEAD_DEAD) { + ClientDeath (); + return; + } + + if (self.deadflag == DEAD_DYING) return; // dying, so do nothing + + //---------------------------------------------------------------------- + // Rubicon Ladder Code - johnfitz + // Modified by me to support diff climb sounds and on/off/toggle states + //---------------------------------------------------------------------- + if (self.onladder) { + self.onladder = 0; // Reset ladder touch function + if (self.button2) { // Is jump key being pressed? + // Reset velocity upwards and all sideways movement + // so that the player stays on the ladder and climbs + // straight up with very little sidways movement + self.velocity = '0 0 0'; + self.velocity_z = self.entladder.speed; + self.gravity = 0.0000001; + + if (self.timeladder < time) { + // Reset timer for next sound to play + self.timeladder = time + self.entladder.waitmin; + // Check for any sounds and query if footsteps are active + if (self.entladder.sounds != 4 && query_configflag(SVR_FOOTSTEP) == FALSE) { + self.lip = random(); + if (self.lip < 0.25 && self.entladder.noise1) + sound (self, CHAN_BODY, self.entladder.noise1, 1, ATTN_NORM); + else if (self.lip < 0.5 && self.entladder.noise2) + sound (self, CHAN_BODY, self.entladder.noise2, 1, ATTN_NORM); + else if (self.lip < 0.75 && self.entladder.noise3) + sound (self, CHAN_BODY, self.entladder.noise3, 1, ATTN_NORM); + else if (self.entladder.noise4) + sound (self, CHAN_BODY, self.entladder.noise4, 1, ATTN_NORM); + } + } + } + else { + // Jump key released, stay floating on the ladder + self.flags = self.flags | FL_JUMPRELEASED; + self.velocity = 0.9 * self.velocity; + self.velocity_z = 0; + } + } + else { + // Reset any ladder gravity settings + self.gravity = 1; + // Original jump conditions + if (self.button2) PlayerJump (); + else self.flags = self.flags | FL_JUMPRELEASED; + } + + // When the player/client starts in the map they don't want any velocity + if (time < self.pausetime) self.velocity = '0 0 0'; +}; + +//---------------------------------------------------------------------- +// PlayerPostThink - Called every frame after physics are run +//---------------------------------------------------------------------- +void() PlayerPostThink = +{ + if (prethink && !postthink) { + // Check for the player? + // - first couple of frames the player is not setup correctly + if (self.flags & FL_CLIENT) { + postthink = TRUE; // postthink flag complete + mapvar_cvar = TRUE; // Map Variable are live + // Reset any screen cshift parameters, eng often leaves them + if (!self.cshift_upd) self.cshift_time = -1; + + // Check worldspawn water alpha parameters? + // liquid alpha is used by the monster visible system + if (world.water_alpha) { + liquid_alpha = world.water_alpha; + stuffcmd(self, "\nr_wateralpha "); + lftos(self, liquid_alpha ,1,3, BUFFER_STUFFCMD); + stuffcmd(self, "\n"); + dprint("\b[CLIENT]\b Water Alpha ("); + lftos(self, liquid_alpha ,1,3, BUFFER_DPRINT); + dprint(")\n"); + + } + else liquid_alpha = cvar("r_wateralpha"); + + // Check engine for actual autoaim setting + // Always reset with newgame and quickload + autoaim_cvar = cvar("sv_aim"); + + // Setup/change global fog if enabled (default) + if (!(query_configflag(SVR_NOFOGCMDS))) { + // Create fog controller and/or update engine fog + if (fog_active) change_fog(self); + else setup_fog_controller(); + } + + // Update console with MOD settings + display_configflag(); + display_version(); + update_weather(); + } + } + if (intermission_running > 0) return; // intermission or finale + if (self.deadflag) return; // Dead + + // Any spawn targets to update? + if (self.target2 != "") { + trigger_strs(self.target2, self); self.target2 = ""; + } + W_WeaponFrame (); // Impulse commands and Quad updates + + // check to see if player landed and play landing sound + if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0)) { + if (self.watertype == CONTENT_WATER) + sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM); + else if (self.jump_flag < -650) { + T_Damage (self, world, world, 5, DAMARMOR); + sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); + self.deathtype = "falling"; + } + else + sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); + + self.jump_flag = 0; + } + + // Check for any fake water exit sounds + if (self.touchedliquid < time && self.touchedsound != "") { + sound (self, CHAN_BODY, self.touchedsound, 1, ATTN_NORM); + self.touchedsound = ""; + } + + // If flying through the air, store player Z velocity in jump flag + if (!(self.flags & FL_ONGROUND)) self.jump_flag = self.velocity_z; + ClientPowerups (); + ClientDeBuff (); +}; + +//---------------------------------------------------------------------- +void() PlayerJump = +{ + if (self.flags & FL_WATERJUMP) return; + + if (self.waterlevel >= 2) { + if (self.watertype == CONTENT_WATER) self.velocity_z = 100; + else if (self.watertype == CONTENT_SLIME) self.velocity_z = 80; + else self.velocity_z = 50; + + // play swiming sound + if (self.swim_flag < time) { + self.swim_flag = time + 1; + if (random() < 0.5) sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); + } + return; + } + + if (!(self.flags & FL_ONGROUND)) return; + if ( !(self.flags & FL_JUMPRELEASED) ) return; // don't pogo stick + + self.flags = self.flags - (self.flags & FL_JUMPRELEASED); + self.flags = self.flags - FL_ONGROUND; // don't stairwalk + + self.button2 = 0; + // player jumping sound + sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM); + self.velocity_z = self.velocity_z + 270; +}; + +//---------------------------------------------------------------------- +// Deals with water, slime and lava +//---------------------------------------------------------------------- +void() WaterMove = +{ + //dprint (ftos(self.waterlevel)); + // Fix noclip water gasping bug by giving air to the player + if (self.movetype == MOVETYPE_NOCLIP) { + if (self.air_finished < time + 2) self.air_finished = time + 2; + return; + } + if (self.health < 0) return; + + if (self.waterlevel != 3) { + if (self.air_finished < time) + sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM); + else if (self.air_finished < time + (WATER_AIR-3)) + sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM); + self.air_finished = time + WATER_AIR; + self.dmg = 2; + } + else if (self.air_finished < time) { // drown! + if (self.pain_finished < time) { + self.dmg = self.dmg + 2; + if (self.dmg > 15) self.dmg = 10; + T_Damage (self, world, world, self.dmg, DAMARMOR); + self.pain_finished = time + 1; + } + } + + if (!self.waterlevel) { + if (self.flags & FL_INWATER) { + // play leave water sound + sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM); + self.flags = self.flags - FL_INWATER; + } + return; + } + + if (self.watertype == CONTENT_LAVA) { // do damage + if (self.dmgtime < time) { + if (self.radsuit_finished > time) self.dmgtime = time + 1; + else self.dmgtime = time + 0.2; + T_Damage (self, world, world, 10*self.waterlevel, DAMARMOR); + } + } + else if (self.watertype == CONTENT_SLIME) { // do damage + if (self.dmgtime < time && self.radsuit_finished < time) { + self.dmgtime = time + 1; + T_Damage (self, world, world, 4*self.waterlevel, DAMARMOR); + } + } + + if ( !(self.flags & FL_INWATER) ) { // player enter water sound + if (self.watertype == CONTENT_LAVA) + sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); + if (self.watertype == CONTENT_WATER) + sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM); + if (self.watertype == CONTENT_SLIME) + sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); + + self.flags = self.flags + FL_INWATER; + self.dmgtime = 0; + } + + if (! (self.flags & FL_WATERJUMP) ) + self.velocity = self.velocity - 0.8*self.waterlevel*frametime*self.velocity; +}; + +//---------------------------------------------------------------------- +void() CheckWaterJump = +{ + local vector start, end; + + // check for a jump-out-of-water + makevectors (self.angles); + start = self.origin; + start_z = start_z + 8; + v_forward_z = 0; + normalize(v_forward); + end = start + v_forward*24; + traceline (start, end, TRUE, self); + + if (trace_fraction < 1) { // solid at waist + start_z = start_z + self.maxs_z - 8; + end = start + v_forward*24; + self.movedir = trace_plane_normal * -50; + traceline (start, end, TRUE, self); + if (trace_fraction == 1) { // open at eye level + self.flags = self.flags | FL_WATERJUMP; + self.velocity_z = 225; + self.flags = self.flags - (self.flags & FL_JUMPRELEASED); + self.teleport_time = time + 2; // safety net + return; + } + } +}; + +/*====================================================================== + CLIENT GAME EDGE FUNCTIONS +======================================================================*/ +// This function cannot be move, ref an exact frame in players model +void() set_suicide_frame; // In player.qc + +//---------------------------------------------------------------------- +void() ClientRespawn = +{ + if (coop) { + CopyToBodyQue (self); // make a copy of the dead body for appearances sake + setspawnparms (self); // get the spawn parms as they were at level start + PutClientInServer (); // respawn + } + else if (deathmatch) { + CopyToBodyQue (self); // make a copy of the dead body for appearances sake + SetNewParms (); // set default spawn parms + PutClientInServer (); // respawn + } + // restart the entire server + else localcmd ("restart\n"); +}; + +//---------------------------------------------------------------------- +void() ClientDeath = +{ + local float forward; + + if ((self.flags & FL_ONGROUND)) { + forward = vlen (self.velocity); + forward = forward - 20; + if (forward <= 0) + self.velocity = '0 0 0'; + else + self.velocity = forward * normalize(self.velocity); + } + + // wait for all buttons released + if (self.deadflag == DEAD_DEAD) { + if (self.button2 || self.button1 || self.button0) return; + self.deadflag = DEAD_RESPAWNABLE; + return; + } + + // wait for any button down + if (!self.button2 && !self.button1 && !self.button0) return; + self.button0 = self.button1 = self.button2 = 0; + ClientRespawn(); +}; + +//---------------------------------------------------------------------- +// Player entered the suicide command +//---------------------------------------------------------------------- +void() ClientKill = +{ + bprint (self.netname); + bprint (" suicides\n"); + set_suicide_frame (); + self.modelindex = modelindex_player; + self.frags = self.frags - 2; // extra penalty + ClientRespawn (); +}; + +//---------------------------------------------------------------------- +// Called when a player connects to a server +//---------------------------------------------------------------------- +void() ClientConnect = +{ + bprint (self.netname); + bprint (" entered the game\n"); + + // a client connecting during an intermission can cause problems + if (intermission_running > 0) GotoNextMap (); +}; + +//---------------------------------------------------------------------- +// Called when a player disconnects from a server +//---------------------------------------------------------------------- +void() ClientDisconnect = +{ + if (gameover) return; + // if the level end trigger has been activated, just return + // since they aren't *really* leaving + + // let everyone else know + bprint (self.netname); + bprint (" left the game with "); + bprint (ftos(self.frags)); + bprint (" frags\n"); + sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); + set_suicide_frame (); +}; + +//---------------------------------------------------------------------- +// Called when a player dies, deals with all death messages +//---------------------------------------------------------------------- +void(entity targ, entity attacker) ClientObituary = +{ + local float rnum; + local string clientstring, clientstring2; + rnum = random(); + + if (targ.flags & FL_CLIENT) { + if (attacker.classname == "teledeath") { + bprint (targ.netname); + bprint (" was telefragged by "); + bprint (attacker.owner.netname); + bprint ("\n"); + + attacker.owner.frags = attacker.owner.frags + 1; + return; + } + + if (attacker.classname == "teledeath2") { + bprint ("Satan's power deflects "); + bprint (targ.netname); + bprint ("'s telefrag\n"); + + targ.frags = targ.frags - 1; + return; + } + + if (attacker.flags & FL_CLIENT) { + if (targ == attacker) { + // killed self + attacker.frags = attacker.frags - 1; + bprint (targ.netname); + + if (targ.weapon == 64 && targ.waterlevel > 1) { + bprint (" discharges into the water.\n"); + return; + } + if (targ.weapon == IT_GRENADE_LAUNCHER) + bprint (" tries to put the pin back in\n"); + else + bprint (" becomes bored with life\n"); + return; + } + else if ( (teamplay == 2) && (targ.team > 0)&&(targ.team == attacker.team) ) { + if (rnum < 0.25) clientstring = " mows down a teammate\n"; + else if (rnum < 0.50) clientstring = " checks his glasses\n"; + else if (rnum < 0.75) clientstring = " gets a frag for the other team\n"; + else clientstring = " loses another friend\n"; + bprint (attacker.netname); + bprint (clientstring); + attacker.frags = attacker.frags - 1; + return; + } + else { + attacker.frags = attacker.frags + 1; + + rnum = attacker.weapon; + if (rnum == IT_AXE) { + clientstring = " was ax-murdered by "; + clientstring2 = "\n"; + } + if (rnum == IT_SHOTGUN) { + clientstring = " chewed on "; + clientstring2 = "'s boomstick\n"; + } + if (rnum == IT_SUPER_SHOTGUN) { + clientstring = " ate 2 loads of "; + clientstring2 = "'s buckshot\n"; + } + if (rnum == IT_NAILGUN) { + clientstring = " was nailed by "; + clientstring2 = "\n"; + } + if (rnum == IT_SUPER_NAILGUN) { + clientstring = " was punctured by "; + clientstring2 = "\n"; + } + if (rnum == IT_GRENADE_LAUNCHER) { + clientstring = " eats "; + clientstring2 = "'s pineapple\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s grenade\n"; + } + } + if (rnum == IT_ROCKET_LAUNCHER) { + clientstring = " rides "; + clientstring2 = "'s rocket\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s rocket\n" ; + } + } + if (rnum == IT_LIGHTNING) { + clientstring = " accepts "; + if (attacker.waterlevel > 1) clientstring2 = "'s discharge\n"; + else clientstring2 = "'s shaft\n"; + } + bprint (targ.netname); + bprint (clientstring); + bprint (attacker.netname); + bprint (clientstring2); + } + return; + } + else { + targ.frags = targ.frags - 1; + bprint (targ.netname); + + //----------------------------------------------------------------- + // All the monster death messages are now defined in the monster QC + // It is much easier to remember to add these with creating the + // QC for each new monster than find/edit them here! + //----------------------------------------------------------------- + + // Check for boss or monster flags + if (attacker.bossflag > 0 || attacker.flags & FL_MONSTER) { + if (attacker.deathstring != "") bprint (attacker.deathstring); + else bprint(" was killed by Quake!\n"); + return; + } + + // tricks and traps + if (attacker.solid == SOLID_BSP && attacker != world) bprint (" was squished\n"); + else if (attacker.classtype == CT_EXPLO_BOX) bprint (" blew up\n"); + else if (attacker.classtype == CT_SPIKESHOOTER) bprint (" did not stick around\n"); + else if (attacker.classtype == CT_GRENADESHOOTER) bprint (" was pineappled\n"); + else if (attacker.classtype == CT_ROCKETSHOOTER) bprint (" was blasted\n"); + else if (attacker.classtype == CT_LIGHTSHOOTER) bprint (" was struck down\n"); + else if (attacker.classtype == CT_GASSHOOTER) bprint (" was burnt to a crisp\n"); + else if (attacker.classtype == CT_PENDULUM) bprint (" was cleaved in two\n"); + else if (attacker.classtype == CT_SAWBLADE) bprint (" was sliced to pieces\n"); + else if (attacker.classtype == CT_FIREBALL) bprint (" ate a lavaball\n"); + else if (attacker.classtype == CT_TRIGLEVEL) bprint (" tried to leave\n"); + + // in-water deaths + else if (targ.watertype == -3) { + if (random() < 0.5) bprint (" sleeps with the fishes\n"); + else bprint (" sucks it down\n"); + } + else if (targ.watertype == -4) { + if (random() < 0.5) bprint (" gulped a load of slime\n"); + else bprint (" can't exist on slime alone\n"); + } + else if (targ.watertype == -5) { + if (targ.health < -15) bprint (" burst into flames\n"); + else if (random() < 0.5) bprint (" turned into hot slag\n"); + else bprint (" visits the Volcano God\n"); + } + + // Debuff deaths + else if (targ.burning) bprint (" was burnt to a crisp\n"); + else if (targ.poisoned) bprint (" was poisoned\n"); + else if (targ.bleeding) bprint (" bled to death\n"); + + // fell to their death? + else if (targ.deathtype == "falling") { + targ.deathtype = string_null; + bprint (" fell to his death\n"); + } + else if (targ.touchedvoid) { + targ.deathtype = string_null; + bprint (" touched the void\n"); + } + else + // hell if I know; he's just dead!!! + bprint (" is dead Jim!\n"); + } + } +}; diff --git a/QC_other/QC_arcane/client_camera.qc b/QC_other/QC_arcane/client_camera.qc new file mode 100644 index 00000000..9bedb785 --- /dev/null +++ b/QC_other/QC_arcane/client_camera.qc @@ -0,0 +1,278 @@ +/*====================================================================== +Intermission Camera System + + SetupIntermissionCamera - Find/setup all camera(s) + StartIntermissionCamera - Setup player ready for viewing + NextIntermissionCamera - Move player to first/next camera + CycleIntermissionCamera - wait for player input + FinishIntermissionCamera - No more viewing +======================================================================*/ +float CAMERA_NOINTERMIS = 1; // Will not work if intermission active +float CAMERA_SOLID = 2; // Intermission camera interacts with world +float INTERMISSION_ACTIVE = 2; // Regular Intermission active +float INTERMISSION_RUNE = 3; // Check for end of episode +float INTERMISSION_ENDGAME = 4; // End of game!?! (set in oldone.qc) +float INTERMISSION_CAMERA = 10; // Special Camera only mode + +//---------------------------------------------------------------------- +void() SetupIntermissionCamera = +{ + local entity intercam, prevcam; + + // Is the infomission camera chain been setup already? + if (camera_ent) return; + + // Try to find the first intermission camera + intercam = find (world, classname, "info_intermission"); + prevcam = world; + + if (intercam) { + // Cycle through all intermission cameras and link them together + while(intercam) { + // first camera in chain? setup first and previous camera + if (!prevcam) { camera_ent = intercam; camera_ent.count = 0;} + else prevcam.owner = intercam; + + // Save current camera to previous ready for loop + prevcam = intercam; + camera_ent.count = camera_ent.count + 1; + //dprint("[CAM] ("); dprint(ftos(camera_ent.count)); + //dprint(") Org ("); dprint(vtos(intercam.origin)); dprint(")\n"); + + intercam = find(intercam, classname, "info_intermission"); + } + // Close the camera chain + prevcam.owner = camera_ent; + dprint("\b[CAMERA]\b Intermissions found ("); + dprint(ftos(camera_ent.count)); dprint(")\n"); + } + else { + dprint("\b[CAMERA]\b Intermissions missing!\n"); + // Cannot find any info_intermission cameras, so use player start + // If there is no player start then use player's last location! + if (deathmatch) intercam = find (world, classname, "info_player_deathmatch"); + else intercam = find (world, classname, "info_player_start"); + if (!intercam) intercam = client_ent; + + // Spawn a new camera entity + camera_ent = spawn(); + camera_ent.classtype = CT_CAMERA; + setsize (camera_ent, VEC_ORIGIN, VEC_ORIGIN); + camera_ent.movetype = MOVETYPE_NONE; + camera_ent.solid = SOLID_NOT; + setorigin(camera_ent, intercam.origin); + setmodel(camera_ent, MODEL_EMPTY); + camera_ent.mangle = intercam.angles; + camera_ent.count = 1; + camera_ent.owner = camera_ent; + } +}; + +//---------------------------------------------------------------------- +void() FinishIntermissionCamera = +{ + // skip any text in deathmatch + if (deathmatch) { GotoNextMap (); return; } + + intermission_exittime = time + 1; + intermission_running = intermission_running + 1; + + //---------------------------------------------------------------------- + // run some text if at the end of an each episode + //---------------------------------------------------------------------- + if (intermission_running == INTERMISSION_RUNE) { + if (world.model == "maps/e1m7.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + if (!cvar("registered")) { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!"); + } + else { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!"); + } + return; + } + else if (world.model == "maps/e2m6.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral."); + return; + } + else if (world.model == "maps/e3m6.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth."); + return; + } + else if (world.model == "maps/e4m7.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person."); + return; + } + // No special end text? go straight to next map + GotoNextMap(); + } + //---------------------------------------------------------------------- + // If the player has all four runes, print more text!?! + //---------------------------------------------------------------------- + else if (intermission_running == INTERMISSION_ENDGAME) { + if (!cvar("registered")) { + // shareware episode has been completed, go to sell screen + WriteByte (MSG_ALL, SVC_SELLSCREEN); + return; + } + + if ( (serverflags & SVR_RUNE_ALL) == SVR_RUNE_ALL) { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born."); + return; + } + } + // Finished episode text and shub waking up text, then finally next map! + else GotoNextMap(); +}; + +//---------------------------------------------------------------------- +void() NextIntermissionCamera = +{ + // This method is unreliable, it is better to move the players + // origin like the orginal method used by the id QC + //msg_entity = self; + //WriteByte(MSG_ALL, SVC_SETVIEW); + //WriteEntity(MSG_ALL, self.goalentity); + + // Exclude the special intermission cameras (special impulse) + if (camera_ent.count > 1 && intermission_running > 0 + && intermission_running < INTERMISSION_CAMERA) { + // Cycle through list trying to find a camera + // designed for the intermission at the end of a map + // Can have special cameras designed for impulse 145! + while(self.goalentity.spawnflags & CAMERA_NOINTERMIS) { + self.goalentity = self.goalentity.owner; + } + } + + // Switch player view to intermission camera + self.view_ofs = '0 0 0'; + setorigin(self, self.goalentity.origin); + self.angles = self.v_angle = self.goalentity.mangle; + self.fixangle = TRUE; + + // Change the camera to allow for environment interaction + if (self.goalentity.spawnflags & CAMERA_SOLID) { + self.solid = SOLID_TRIGGER; + setsize(self, VEC_HULLE_MIN, VEC_HULLE_MAX); + } + // no interaction, static + else { + self.solid = SOLID_NOT; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + } + + // If target exists on camera fire triggers (once) + if (self.goalentity.target != "") { + trigger_strs(self.goalentity.target, self); + self.goalentity.target = ""; + } + + // Test for any fog changes on intermission entity + if (fog_active && self.goalentity.fog_density > 0) { + // Double check for quake.rc parameter + if (query_configflag(SVR_NOFOGCMDS)) self.goalentity.fog_density = 0; + else fade_fog(self.goalentity.fog_density, self.goalentity.fog_colour, self.goalentity.speed); + } +}; + +//---------------------------------------------------------------------- +void() CycleIntermissionCamera = +{ + // Is the intermission camera still being setup? + if (intermission_running < INTERMISSION_ACTIVE) return; + if (self.waitmin > time) return; // delay input from keyboard + + // check for jump button to exit + if (self.button1 || self.button2 || (self.button0 && camera_ent.count == 1) ) { + self.button0 = self.button1 = self.button2 = 0; + if (intermission_running != INTERMISSION_CAMERA) { + self.waitmin = time + 1; + if (time > intermission_exittime) FinishIntermissionCamera (); + } + } + // check for attack button to switch cameras + else if (self.button0) { + self.button0 = self.button1 = self.button2 = 0; + self.waitmin = time + 0.5; + + // Shift forward to next camera + self.goalentity = self.goalentity.owner; + NextIntermissionCamera(); + } +}; + +//---------------------------------------------------------------------- +void() StartIntermissionCamera = +{ + if (camera_ent) { + // Switch self to client (stored when client is setup) + self = client_ent; + + // Switch on notarget so monsters don't attack player + // Add god mode to prevent any damage, is reset on map change + self.flags = self.flags + (FL_NOTARGET || FL_GODMODE); + self.flags = self.flags - (self.flags & FL_ONGROUND); + + // reset player model to nothing and no world interaction + self.view_ofs = self.velocity = self.avelocity = '0 0 0'; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; // no more movement + self.takedamage = DAMAGE_NO; // no more damage + setmodel(self, MODEL_EMPTY); // Hide player model + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + self.weaponmodel = string_null; // No vmodel updates + self.frame = self.weaponframe = 0; // reset all frames + self.waitmin = time + 0.5; // Delay before start + self.think = SUB_Null; // Stop player.qc + + // Finish all other artifacts - stop all the timers + self.radsuit_finished = self.invisible_finished = 0; + self.invincible_finished = self.super_damage_finished = 0; + self.sharpshoot_finished = self.nailpiercer_finished = 0; + self.wetsuit_finished = 0; + + // Setup default - first camera to look through + self.goalentity = camera_ent; + // Is there more than 1 camera and intermission time? + // Always start at the first camera if using camera test mode + if (camera_ent.count > 1 && intermission_running > 0) { + // Randomly pick a camera to cycle forward to + self.lip = rint(random() * camera_ent.count); + while (self.lip > 0) { + self.goalentity = self.goalentity.owner;// Cycle through list + self.lip = self.lip - 1; // Keep looping + } + } + + // Switch player to the currently selected camera + NextIntermissionCamera(); + + // Check if end of map intermission is really running? + // Can enter this function via camera test mode (impulse xxx) + if (intermission_running == 0) intermission_running = INTERMISSION_CAMERA; + else intermission_running = INTERMISSION_ACTIVE; + } + // If camera entity not setup, go straight to next map + else FinishIntermissionCamera (); +}; diff --git a/QC_other/QC_arcane/client_debuff.qc b/QC_other/QC_arcane/client_debuff.qc new file mode 100644 index 00000000..36b5fea1 --- /dev/null +++ b/QC_other/QC_arcane/client_debuff.qc @@ -0,0 +1,357 @@ +/*====================================================================== + CheckDeBuff - Check for negative buffs affecting the player +======================================================================*/ + +.float cshift_upd; // Screen updates (v_cshift) are active +.float cshift_time; // Timer (0.1s tick) for screen updates +.vector cshift_col; // RGB / XYZ values for screen colour +.float cshift_den; // Screen colour density +.float cshift_step; // Quantity to reduce density by per tick + +.float debuff_sound; // Heartbeat sound when tick happens +.float debuff_qty; // Quantity to do something with (temp) + +.float bleeding; // Bleeding debuff status +.float bleeding_time; // Timer (1s tick) for screen/sound update +.float bleeding_qty; // Total amount of health stored (HoT) + +.float burning; // Burning debuff status +.float burning_time; // Timer (1s tick) for screen/sound update +.float burning_qty; // Total amount of damage stored (DoT) + +.float poisoned; // Poison debuff status +.float poisoned_time; // Timer (1s tick) for screen/sound update +.float poisoned_qty; // Total amount of damage stored (DoT) + +// IT_INVISIBILITY + IT_INVULNERABILITY + IT_SUIT + IT_QUAD +// 524288 + 1048576 + 2097152 + 4194304 +float ALL_ITARTIFACTS = 7864320; + +// Wraith Health drain +vector DEBUFF_BLEED_COL = '200 0 0'; // Strong red +float DEBUFF_BLEED_DEN = 120; +float DEBUFF_BLEED_STEP = 10; +float DEBUFF_BLEED_HEAL = 5; +float DEBUFF_BLEED_MIN = 5; + +// Pyro flame burn +vector DEBUFF_BURN_COL = '200 100 0'; // Orange +float DEBUFF_BURN_DEN = 120; +float DEBUFF_BURN_STEP = 10; +float DEBUFF_BURN_DMG = 1; +float DEBUFF_BURN_MAX = 10; + +// Mummy poisoned gibs +vector DEBUFF_POISON_COL = '0 200 0'; // Strong Green +float DEBUFF_POISON_DEN = 84; +float DEBUFF_POISON_STEP = 7; +float DEBUFF_POISON_DMG = 1; + +//---------------------------------------------------------------------- +// Various debuff reset functions, used all over the place +//---------------------------------------------------------------------- +void(entity targ) ResetDebuffScreen = +{ + targ.cshift_upd = FALSE; + targ.cshift_time = LARGE_TIMER; + stuffcmd(targ, "v_cshift 0 0 0 0\n"); + targ.cshift_col = '0 0 0'; + targ.cshift_den = 0; +}; + +void(entity targ) ResetDebuffBurning = +{ targ.burning = targ.burning_qty = 0; }; + +void(entity targ) ResetDebuffPoisoned = +{ targ.poisoned = targ.poisoned_qty = 0; }; + +void(entity targ) ResetDebuffBleeding = +{ targ.bleeding = targ.bleeding_qty = 0; }; + +void(entity targ) ResetDebuffSystem = +{ + ResetDebuffScreen(targ); + ResetDebuffBurning(targ); + ResetDebuffPoisoned(targ); + ResetDebuffBleeding(targ); +}; + +//---------------------------------------------------------------------- +// Core debuff function, run every frame from client.qc +//---------------------------------------------------------------------- +void() ClientDeBuff = +{ + // If player is dead or intermission running, turn everything off + if (intermission_running > 0 || self.health < 1) { + ResetDebuffSystem(self); + return; + } + + // Check for burning debuff (DoT) + if (self.burning) { + // Is it time for a debuff update + if (self.burning_time < time) { + if (self.burning_qty > 0) { + // Reset burning tick timer + self.burning_time = time + 1; + + // Give priority to bleeding(heal) and poisoned + if (!self.bleeding && !self.poisoned) { + if (self.debuff_sound < time) self.debuff_sound = time + 1; + self.cshift_upd = TRUE; // Update screen colour + self.cshift_time = -1; // Update striaght away + self.cshift_col = DEBUFF_BURN_COL; + self.cshift_den = DEBUFF_BURN_DEN; + self.cshift_step = DEBUFF_BURN_STEP; + } + + // Setup default burning damage + self.debuff_qty = DEBUFF_BURN_DMG; + // Check burning does not exceed stored damage + if (self.burning_qty < self.debuff_qty) self.debuff_qty = self.burning_qty; + // Subtract burning damage from counters + self.burning_qty = self.burning_qty - self.debuff_qty; + + // Use global damage function (has death checks) + T_Damage (self, world, world, self.debuff_qty, NOARMOR); + } + } + // Check if player is in water up to waist? + // 0 = not in, 1 = feet, 2 = waist, 3 = eyes + if (self.waterlevel >= 2 || self.burning_qty < 1) { + ResetDebuffBurning(self); + } + } + + // Check for poisoned debuff (DoT) + if (self.poisoned) { + // Is it time for a debuff update + if (self.poisoned_time < time) { + if (self.poisoned_qty > 0) { + // Reset poisoned tick timer + self.poisoned_time = time + 1; + + // Give priority to bleeding(heal) + if (!self.bleeding) { + if (self.debuff_sound < time) self.debuff_sound = time + 1; + self.cshift_upd = TRUE; // Update screen colour + self.cshift_time = -1; // Update striaght away + self.cshift_col = DEBUFF_POISON_COL; + self.cshift_den = DEBUFF_POISON_DEN; + self.cshift_step = DEBUFF_POISON_STEP; + } + + // Setup default poison damage + self.debuff_qty = DEBUFF_POISON_DMG; + // Check poison does not exceed damage left + if (self.poisoned_qty < self.debuff_qty) self.debuff_qty = self.poisoned_qty; + // Subtract poison damage from counters + self.poisoned_qty = self.poisoned_qty - self.debuff_qty; + + // Use global damage function (has death checks) + T_Damage (self, world, world, self.debuff_qty, NOARMOR); + } + } + // Check if poison has finished? + if (self.poisoned_qty < 1) ResetDebuffPoisoned(self); + } + + // Check for bleeding debuff (HoT) + if (self.bleeding) { + // Is it time for a debuff update + if (self.bleeding_time < time) { + if (self.bleeding_qty > 0) { + // Reset bleeding(healing) tick timer + self.bleeding_time = time + 1; + if (self.debuff_sound < time) self.debuff_sound = time + 1; + self.cshift_upd = TRUE; // Update screen colour + self.cshift_time = -1; // Update striaght away + self.cshift_col = DEBUFF_BLEED_COL; + self.cshift_den = DEBUFF_BLEED_DEN; + self.cshift_step = DEBUFF_BLEED_STEP; + + // Setup default healing + self.debuff_qty = DEBUFF_BLEED_HEAL; + // Check healing does not exceed current reserve + if (self.bleeding_qty < self.debuff_qty) self.debuff_qty = self.bleeding_qty; + // Subtract bleeding heals from counters + self.bleeding_qty = self.bleeding_qty - self.debuff_qty; + // Check healing does not go over max player limit + if (self.health + self.debuff_qty > self.max_health) + self.debuff_qty = self.max_health - self.health; + + // Directly add health back to player + self.health = self.health + self.debuff_qty; + } + } + // Check if player is over max health or run out of healing + if (self.health >= self.max_health || self.bleeding_qty < 1) { + ResetDebuffBleeding(self); + } + } + + // Check for any debuff screen updates? + if (self.cshift_upd) { + // Play different debuff sounds (pressure is on!) + if (self.debuff_sound > time) { + self.debuff_sound = -1; // Reset + + // Sound exception for god/pentagram mode + if (self.flags & FL_GODMODE || self.invincible_finished >= time) { + if (self.invincible_sound < time) { + sound (self, CHAN_VOICE, SOUND_ARTPENT3, 1, ATTN_NORM); + self.invincible_sound = time + 2; + } + } + else { + // Play heartbeat only for bleeding/healing + if (self.bleeding) + sound (self, CHAN_VOICE, SOUND_HEARTBEAT, 1, ATTN_IDLE); + // Re-use player pain sounds + else if (self.poisoned) { + if (random() < 0.5) sound (self, CHAN_VOICE, "player/pain2.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "player/pain3.wav", 1, ATTN_IDLE); + } + // Play on the same channel as player pain + else if (self.burning) { + if (random() < 0.5) sound (self, CHAN_VOICE, "player/pain1.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "player/pain4.wav", 1, ATTN_IDLE); + } + } + } + // Check for screen update? 0.1s tick interval + if (self.cshift_time < time) { + // Generate some particles based on debuff + // Priority is bleeding > poisoned > burning + if (self.bleeding) particle_debuff(self.origin, 16, rint(1+random()*4), PARTICLE_BURST_RED); + else if (self.poisoned) particle_debuff(self.origin, 16, rint(1+random()*4), PARTICLE_BURST_GREEN); + else if (self.burning) particle_debuff(self.origin, 16, rint(1+random()*4), PARTICLE_BURST_YELLOW); + + // Count down density and check for reset condition + self.cshift_den = self.cshift_den - self.cshift_step; + if (self.cshift_den < 1) ResetDebuffScreen(self); + else { + // Update screen using stuffcmds! + self.cshift_time = time + 0.1; + + // Don't update the screen if an artifact is active + // The engine will be updating at the same time + if (self.items & ALL_ITARTIFACTS == 0) { + stuffcmd(self, "v_cshift "); + stuffcmd(self, ftos(rint(self.cshift_col_x))); + stuffcmd(self, " "); + stuffcmd(self, ftos(rint(self.cshift_col_y))); + stuffcmd(self, " "); + stuffcmd(self, ftos(rint(self.cshift_col_z))); + stuffcmd(self, " "); + stuffcmd(self, ftos(rint(self.cshift_den))); + stuffcmd(self, "\n"); + } + } + } + } + // Reset cshift if nothing is active (engine does not reset) + // This is to catch new games or quickload resets + else if (self.cshift_time < time) ResetDebuffScreen(self); +}; + +//---------------------------------------------------------------------- +void(entity targ) BleedDeBuff = +{ + local float debuffqty; + + // Check for minimum amount of health for debuff + // Immune to debuff if using Pent of Protection or BioSuit + if (targ.health < DEBUFF_BLEED_MIN) return; + if (targ.flags & FL_CLIENT == FALSE) return; + if (targ.items & (IT_INVULNERABILITY | IT_SUIT)) { + T_Damage (targ, self, self, DAMGE_WRAITHBOLT, DAMARMOR); + return; + } + + // if debuff not active, starting bleeding! + if (!targ.bleeding) { + targ.bleeding = TRUE; + targ.bleeding_time = -1; + } + + // Take health from player and store it + debuffqty = rint(targ.health * 0.5); + T_Damage (targ, self, self, debuffqty, NOARMOR); + targ.bleeding_qty = targ.bleeding_qty + debuffqty; +}; + +//---------------------------------------------------------------------- +void(entity targ) BurnDeBuff = +{ + local float debuffqty; + + // Do not stack burning time beyond a certain limit + // Cannot be burning if knee deep in water + // Immune to debuff if using Pent of Protection or BioSuit + if (targ.burning_qty > DEBUFF_BURN_MAX) return; + if (targ.flags & FL_CLIENT == FALSE) return; + if (targ.waterlevel >= 3) return; + if (targ.items & (IT_INVULNERABILITY | IT_SUIT)) return; + + // if debuff not active, starting burning! + if (!targ.burning) { + targ.burning = TRUE; + targ.burning_time = -1; + } + + // work out time remaining on debuff + debuffqty = rint(5*skill + 3 + 2*random()); + targ.burning_qty = targ.burning_qty + debuffqty; + if (targ.burning_qty > DEBUFF_BURN_MAX) targ.burning_qty = DEBUFF_BURN_MAX; + + targ.cshift_upd = TRUE; // Update screen colour + targ.cshift_time = -1; // Update striaght away + targ.cshift_col = DEBUFF_BURN_COL; + targ.cshift_den = DEBUFF_BURN_DEN; + targ.cshift_step = DEBUFF_BURN_STEP; +}; + +//---------------------------------------------------------------------- +void(entity targ) PoisonDeBuff = +{ + local float debuffqty; + + // Immune to debuff if using Pent of Protection or BioSuit + if (targ.flags & FL_CLIENT == FALSE) return; + if (targ.items & (IT_INVULNERABILITY | IT_SUIT)) return; + if (targ.poisoned) return; // Only poison once + + // if debuff not active, start poison! + targ.poisoned = TRUE; + targ.poisoned_time = -1; + // work out time remaining on debuff + debuffqty = rint(skill + 3 + 2*random()); + targ.poisoned_qty = targ.poisoned_qty + debuffqty; + + targ.cshift_upd = TRUE; // Update screen colour + targ.cshift_time = -1; // Update striaght away + targ.cshift_col = DEBUFF_POISON_COL; + targ.cshift_den = DEBUFF_POISON_DEN; + targ.cshift_step = DEBUFF_POISON_STEP; +}; + +//---------------------------------------------------------------------- +// Used by Pyro and Wraith; consistent damage from both monsters +//---------------------------------------------------------------------- +void(entity targ, float playdmg, float mondmg) ApplyFireDmg = +{ + local float reduction, firedamage; + + // Bio suit reduction - easy=80%, normal=70%, hard=60%, nm=50% + reduction = 0.2 + skill * 0.1; + + // Damage is different for monsters/players + if (targ.flags & FL_MONSTER) firedamage = mondmg; + else if (targ.items & IT_SUIT) firedamage = rint(playdmg * reduction); + else firedamage = playdmg; + + // Final damage (no armour save) + T_Damage (targ, self, self.owner, firedamage, NOARMOR); + BurnDeBuff(targ); +}; diff --git a/QC_other/QC_arcane/client_info.qc b/QC_other/QC_arcane/client_info.qc new file mode 100644 index 00000000..011cca97 --- /dev/null +++ b/QC_other/QC_arcane/client_info.qc @@ -0,0 +1,145 @@ +/*====================================================================== + INFO ENTITIES +======================================================================*/ +void() info_null = { remove(self); }; +void() info_notnull = {}; +void() info_target = {}; + +/*====================================================================== +/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24) x x x x x x x x Not_Easy Not_Normal Not_Hard Not_DM Dyn_Easy Dyn_Normal Dyn_Hard Dyn_Night +{ model(":progs/player.mdl"); } +DEFAULT starting point for a player +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +-------- SPAWNFLAGS -------- +-------- NOTES -------- +DEFAULT starting point for a player + +======================================================================*/ +void() info_player_start = { + self.classtype = CT_SPAWNSP; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED info_player_start2 (0.9 0 0) (-16 -16 -24) (16 16 24) x x x x x x x x Not_Easy Not_Normal Not_Hard Not_DM Dyn_Easy Dyn_Normal Dyn_Hard Dyn_Night +{ model(":progs/player.mdl"); } +Starting point for players with runes or startspawn2 system +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +startspawn2 : Unique spawn location number matching a trigger_changelevel +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Starting point for players with runes or using the startspawn2 system +The startspawn2 system lets players move between maps using exact location + +======================================================================*/ +void() info_player_start2 = { + self.classtype = CT_SPAWNSP; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/player.mdl"); } +Starting position for coop games +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +-------- SPAWNFLAGS -------- +STARTOFF : Starts off +-------- NOTES -------- +Starting position for coop games + +======================================================================*/ +void() info_player_coop = { + self.classtype = CT_SPAWNCOOP; + if (self.spawnflags & MON_SPAWN_DELAY) self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; +}; + +/*====================================================================== +/*QUAKED info_player_deathmatch (0 1 1) (-16 -16 -24) (16 16 24) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/player.mdl"); } +Starting position for deathmatch games +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +-------- SPAWNFLAGS -------- +STARTOFF : Starts off +-------- NOTES -------- +Starting position for deathmatch games + +======================================================================*/ +void() info_player_deathmatch = { + self.classtype = CT_SPAWNDM; + if (self.spawnflags & MON_SPAWN_DELAY) self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; +}; + +/*====================================================================== +/*QUAKED info_teleport_destination (1 0.5 0.5) (-8 -8 -8) (8 8 32) x +Destination marker for a teleporter +-------- KEYS -------- +targetname : link to trigger_teleport +target : fires when the entities is used as a destination +angles : Pitch Yaw Roll (viewing angle after teleporting) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Destination marker for a teleporter + +======================================================================*/ +void() info_teleport_destination = +{ + self.classtype = CT_MISCTELEPORT; + self.estate = ESTATE_ON; + self.mangle = self.angles; + self.angles = '0 0 0'; + self.origin = self.origin + '0 0 27'; +}; + +/*====================================================================== +/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16) NO_INTERMIS SOLID x x x x x x Not_Easy Not_Normal Not_Hard Not_DM +This is the camera point for the intermission +-------- KEYS -------- +target : triggered target(s) when used as a viewing camera +mangle : Pitch Yaw Roll +fog_density : fog density (Must be >0 to activate feature) +fog_colour : fog colours (def=0.1 0.1 0.1) +speed : fog time to change (def=2s) +-------- SPAWNFLAGS -------- +NO_INTERMIS : Will not display when proper intermission active +SOLID : Intermission camera interacts with world +-------- NOTES -------- +mangle = up/down, angle, tilt left/right 'pitch roll yaw' +up/left = negative value, down/right = positive value + +======================================================================*/ +void() info_intermission = +{ + self.classtype = CT_CAMERA; + self.estate = ESTATE_ON; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, MODEL_EMPTY); + self.view_ofs = '0 0 0'; + self.owner = self; + + // Check for any trigger fog parameters + if (self.fog_density > 0) { + if (!self.speed) self.speed = 2; + // Double check its within range + if (self.fog_density > 1) self.fog_density = 1; + if (CheckZeroVector(self.fog_colour)) self.fog_colour = '0.1 0.1 0.1'; + } + // Disable fog trigger if density not setup + else self.fog_density = 0; + +}; diff --git a/QC_other/QC_arcane/client_mapvar.qc b/QC_other/QC_arcane/client_mapvar.qc new file mode 100644 index 00000000..1fb190f7 --- /dev/null +++ b/QC_other/QC_arcane/client_mapvar.qc @@ -0,0 +1,407 @@ +/*====================================================================== +Client Map Variables +-------------------- + +Allows for binary (0/1) map variables to be stored with the map save +system (parm1-16) by the engine. The top 6 parm variables are never used +and can easily be turned into variables for the map to use. + +======================================================================*/ +float MAPV_BITS = 22; // Bits used in each parm block +float MAPV_BLCK = 6; // Blocks used (total parm's) +float MAPV_TOTAL = 132; // Maximum amount of variables + +float MAPV_QUERY = 1; // Point entity - Query value +float MAPV_UPDATE = 2; // Point entity - Update value +float MAPV_TOGGLE = 4; // Point entity - Toggle value +float MAPV_MONSTERS = 32; // Monsters can use bmodel trigger + +float bitflags[24]; // Bitflag values +float mapvar[6]; // Map variables stored in savefile + +//====================================================================== +/*QUAKED trigger_mapvar_query (.5 .7 1) (-8 -8 -16) (8 8 16) x +Trigger target(s) based on mapvar +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +target : Map variable == 0 fire these target(s) +target2 : Map variable == 1 fire these target(s) +noise : aframe switchable object +wait : -1 = trigger once +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Trigger target(s) based on mapvar +//----------------------------------------------------------------------------- +/*QUAKED trigger_mapvar_update (.5 .7 1) (-8 -8 -16) (8 8 16) x +Update the value of mapvar +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +cnt : Value (0/1) +target : Map variable == 0 fire these target(s) +target2 : Map variable == 1 fire these target(s) +noise : aframe switchable object +wait : -1 = trigger once +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Update the value of mapvar +//----------------------------------------------------------------------------- +/*QUAKED trigger_mapvar_toggle (.5 .7 1) (-8 -8 -16) (8 8 16) x +Toggle the value of mapvar +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +target : Map variable == 0 fire these target(s) +target2 : Map variable == 1 fire these target(s) +noise : aframe switchable object +wait : -1 = trigger once +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Toggle the value of mapvar +======================================================================*/ + +// Setup the bitflag array (used in world.qc) +void() mapvar_setuparray = +{ + local float bitindex, bitpow; + + // Setup loop and first bit + bitindex = 0; bitpow = 1; + while (bitindex < 24) { + bitflags[bitindex] = bitpow; + bitpow = bitpow * 2; + bitindex = bitindex + 1; + } +}; + +//---------------------------------------------------------------------- +// Reset all map variable banks to zero (used in client.qc) +void() mapvar_reset = +{ + local float mapv_bank; + + mapv_bank = 0; + while (mapv_bank < MAPV_BLCK) { + mapvar[mapv_bank] = 0; + mapv_bank = mapv_bank + 1; + } +}; + +//---------------------------------------------------------------------- +// Read map variable from block/bits parms and return value +float(float mapv_indx) query_mapvar = +{ + local float mapv_bank, mapv_cell, mapv_bit; + + // Work out parm and bitflag index + mapv_bank = floor(mapv_indx/MAPV_BITS); + mapv_cell = mapv_indx - (mapv_bank*MAPV_BITS); + // Error check return value + if (mapv_bank < 0 || mapv_bank >= MAPV_BLCK) mapv_bank = 0; + if (mapv_cell < 0 || mapv_cell >= MAPV_BITS) mapv_cell = 0; + // Find bitflag mask value + mapv_bit = mapvar[mapv_bank] & bitflags[mapv_cell]; + + /* Debug info (not used anymore) + dprint("Number ("); dprint(ftos(mapv_indx)); + dprint(") B/C ("); dprint(ftos(mapv_bank)); + dprint(" "); dprint(ftos(mapv_cell)); + dprint(") = ("); dprint(ftos(mapv_bit)); + dprint(")\n"); */ + + if (mapv_bit > 0) return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Update map variable from block/bits parms +void(float mapv_indx, float mapv_val) update_mapvar = +{ + local float mapv_bank, mapv_cell; + + // Work out parm and bitflag index + mapv_bank = floor(mapv_indx/MAPV_BITS); + mapv_cell = mapv_indx - (mapv_bank*MAPV_BITS); + // Error check return value + if (mapv_bank < 0 || mapv_bank >= MAPV_BLCK) mapv_bank = 0; + if (mapv_cell < 0 || mapv_cell >= MAPV_BITS) mapv_cell = 0; + + // Remove any existing bitflag value + mapvar[mapv_bank] = mapvar[mapv_bank] - (mapvar[mapv_bank] & bitflags[mapv_cell]); + + // Is the bit value TRUE? + if (mapv_val == TRUE) { + mapvar[mapv_bank] = mapvar[mapv_bank] | bitflags[mapv_cell]; + } +}; + +//---------------------------------------------------------------------- +// Set a range of map variables (used in triggers.qc) +void(vector mapv_range) mapvar_range = +{ + local vector mapv_dest; + local float mapv_swap, mapv_loop; + + // Remove any negative or fractions + mapv_dest_x = fabs(rint(mapv_range_x)); + mapv_dest_y = fabs(rint(mapv_range_y)); + mapv_dest_z = fabs(rint(mapv_range_z)); + + // Check for upper variable range + if (mapv_dest_x >= (MAPV_BLCK*MAPV_BITS)) + mapv_dest_x = (MAPV_BLCK*MAPV_BITS) - 1; + if (mapv_dest_y >= (MAPV_BLCK*MAPV_BITS)) + mapv_dest_y = (MAPV_BLCK*MAPV_BITS) - 1; + if (mapv_dest_z > 1) mapv_dest_z = 1; + + // Check for reverse order on range + if (mapv_dest_x > mapv_dest_y) { + mapv_swap = mapv_dest_x; + mapv_dest_x = mapv_dest_y; + mapv_dest_y = mapv_swap; + } + + // Count through range + mapv_loop = mapv_dest_x; + while (mapv_loop <= mapv_dest_y) { + // Change map variable + update_mapvar(mapv_loop, mapv_dest_z); + mapv_loop = mapv_loop + 1; + } +}; + +//---------------------------------------------------------------------- +// Display the value of all map variable parm blocks +void() display_mapvar = +{ + local float loopbank, loopcell, loopspace, loopval; + + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + // Has the map variable system been setup? + if (!mapvar_cvar) { + sprint(self,"\b[MAPVAR]\b System has not been setup yet!\n"); + return; + } + + // Reset impulse and initialize variables + self.impulse = 0; + loopbank = loopcell = 0; + + dprint("\n\b[MAPVAR]\b Current System Values\n"); + dprint("--------------------------------------\n"); + while (loopbank < MAPV_BLCK) { + dprint("Bank "); dprint(ftos(loopbank)); dprint(" - "); + loopcell = 0; loopspace = 4; + while (loopcell < MAPV_BITS) { + loopval = query_mapvar((loopbank*MAPV_BITS)+loopcell); + dprint(ftos(loopval)); + + loopcell = loopcell+1; + if (loopcell == loopspace) { + dprint(" "); + loopspace = loopspace+4; + } + } + dprint("\n"); + loopbank = loopbank+1; + } + dprint("--------------------------------------\n"); +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_base_use = +{ + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + + // UPDATE : Map Variable + if (self.style == MAPV_UPDATE) { + self.lefty = self.cnt; + update_mapvar(self.count, self.cnt); + } + // TOGGLE : map variable + else if (self.style == MAPV_TOGGLE) { + self.lefty = query_mapvar(self.count); + self.lefty = 1 - self.lefty; + update_mapvar(self.count, self.lefty); + } + // QUERY : map variable + else { + self.lefty = query_mapvar(self.count); + } + + // Check for On/Off target(s) + if (self.lefty == FALSE) { + if (self.target != "") trigger_strs(self.target, activator); + } + else { + if (self.target2 != "") trigger_strs(self.target2, activator); + } + + // Check for switchable bmodel + if (self.noise != "") { + // Check if entity exists first + if (!self.oldenemy) + self.oldenemy = find(world, targetname, self.noise); + // Only work with Bmodel entities (usually aframes) + if (self.oldenemy.bsporigin) { + // Flashing (ON) is +0frame ; Static (OFF) is +aframe + if (self.lefty == TRUE) self.oldenemy.frame = 0; + else self.oldenemy.frame = 1; + } + } + + // Check for fire once condition and wait timer + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + else self.attack_finished = time + self.wait; +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_base = +{ + // Check for any missing keys + if (self.targetname == "") dprint("\b[MAPVAR]\b Missing targetname!\n"); + // Remove any negative or fractions + self.count = fabs(rint(self.count)); + + // Check for upper variable range + if (self.count >= (MAPV_BLCK*MAPV_BITS)) + self.count = (MAPV_BLCK*MAPV_BITS) - 1; + + // Check for bitflag value range + if (self.cnt < FALSE || self.cnt > TRUE) self.cnt = FALSE; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_mapvar_base_use; + self.estate = ESTATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_query = +{ + self.classtype = CT_MAPVAR; + self.style = MAPV_QUERY; + trigger_mapvar_base(); +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_update = +{ + self.classtype = CT_MAPVAR; + self.style = MAPV_UPDATE; + trigger_mapvar_base(); +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_toggle = +{ + self.classtype = CT_MAPVAR; + self.style = MAPV_TOGGLE; + trigger_mapvar_base(); +}; + +//====================================================================== +/*QUAKED trigger_mapvar_multiple (0.5 0 0.5) ? x x x x x MONSTERS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Touch trigger target(s) based on mapvar +------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +target : Map variable == 0 fire these target(s) +message : Map variable == 0 message to display +target2 : Map variable == 1 fire these target(s) +message2: Map variable == 1 message to display +health : Can be damaged instead of touched +wait : time between re-triggering +delay : delay before firing (after being triggered) +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +-------- SPAWNFLAGS -------- +MONSTER : can be touched/triggered by monsters +STARTOFF : Requires trigger to activate +------- NOTES -------- +Touch trigger target(s) based on mapvar +======================================================================*/ +void() trigger_mapvar_multiple_fire = +{ + if (self.attack_finished > time) return; // Trigger once? + + // Find out map variable value + self.lefty = query_mapvar(self.count); + // Switch around target/message strings + if (self.lefty == FALSE) { + self.target = self.idle_sound; + self.message = self.idle_soundcom; + } + else { + self.target = self.idle_sound2; + self.message = self.idle_soundcom2; + } + + // Play the sound ON the trigger, NOT the activator + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Original trigger_multiple activator behaviour + activator = self.bmodel_act; + SUB_UseTargets(); + + // Is the trigger repeatable? + if (self.wait > 0) { + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + else { + // TRIGGER_ONCE functionality + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_multiple = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Remove excessive spawnflags not used + self.lefty = 0; + if (self.spawnflags & MAPV_MONSTERS) self.lefty = self.lefty | MAPV_MONSTERS; + if (self.spawnflags & ENT_STARTOFF) self.lefty = self.lefty | ENT_STARTOFF; + self.spawnflags = self.lefty; + + // Remove any negative or fractions + self.count = fabs(rint(self.count)); + + // Check for upper variable range + if (self.count >= (MAPV_BLCK*MAPV_BITS)) + self.count = (MAPV_BLCK*MAPV_BITS) - 1; + + // Typical bmodel trigger setup + trigger_bmodel_sounds(); + self.classtype = CT_MAPVAR; + InitTrigger (); + if (!self.wait) self.wait = 0.2; + + // Save all entity for later + self.idle_sound = self.target; + self.idle_sound2 = self.target2; + self.idle_soundcom = self.message; + self.idle_soundcom2 = self.message2; + + // Reset all strings to prevent SUB_UseTargets errors + self.target = ""; self.target2 = ""; + self.message = ""; self.message2 = ""; + + // Setup Entity State functionality + self.estate_fire = trigger_mapvar_multiple_fire; + trigger_bmodel_setup(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/client_power.qc b/QC_other/QC_arcane/client_power.qc new file mode 100644 index 00000000..dc0988f0 --- /dev/null +++ b/QC_other/QC_arcane/client_power.qc @@ -0,0 +1,298 @@ +/*====================================================================== + CheckPowerups + - Check for turning off powerups +======================================================================*/ +void(entity targ) ResetPowerInvRing = +{ + targ.items = targ.items - (self.items & IT_INVISIBILITY); + targ.invisible_finished = targ.invisible_time = 0; + targ.modelindex = modelindex_player; + targ.frame = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerEnvSuit = +{ + targ.items = targ.items - (targ.items & IT_SUIT); + targ.radsuit_finished = targ.rad_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerPent = +{ + targ.items = targ.items - (targ.items & IT_INVULNERABILITY); + targ.invincible_finished = targ.invincible_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerQuad = { + targ.super_damage_finished = targ.super_time = 0;}; +void(entity targ) ResetPowerQuadItem = { + targ.items = targ.items - (targ.items & IT_QUAD);}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerSharp = +{ + targ.moditems = targ.moditems - (targ.moditems & IT_ARTSHARP); + targ.sharpshoot_finished = targ.sharpshoot_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerPiercer = +{ + targ.moditems = targ.moditems - (targ.moditems & IT_ARTPIERCE); + targ.nailpiercer_finished = targ.nailpiercer_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerWetSuit = +{ + targ.moditems = targ.moditems - (targ.moditems & IT_ARTWETSUIT); + targ.wetsuit_finished = targ.wetsuit_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerSystem = +{ + ResetPowerInvRing(targ); + ResetPowerEnvSuit(targ); + ResetPowerPent(targ); + ResetPowerQuad(targ); + ResetPowerQuadItem(targ); + ResetPowerSharp(targ); + ResetPowerPiercer(targ); + ResetPowerWetSuit(targ); +}; + +//============================================================================ +void() ClientPowerups = +{ + if (intermission_running > 0) return; + if (self.health < 1) return; + + //---------------------------------------------------------------------- + // Invisibility (Gold Ring) + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.invisible_finished > 0) { + // sound and screen flash when items starts to run out + if (self.invisible_sound < time) { + sound (self, CHAN_AUTO, SOUND_ARTINV3, 0.5, ATTN_IDLE); + self.invisible_sound = time + ((random() * 3) + 1); + } + + if (self.invisible_finished < time + 3) { + if (self.invisible_time == 1) { + sprint (self, "Ring of Shadows magic is fading\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTINV2, 1, ATTN_NORM); + self.invisible_time = time + 1; + } + + if (self.invisible_time < time) { + self.invisible_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.invisible_finished < time) ResetPowerInvRing(self); + else { + // keep using the eyes + self.modelindex = modelindex_eyes; + self.frame = 0; + } + } + + //---------------------------------------------------------------------- + // Env Suit + // - Flash screen 3s before running out + // - Give player 12s of air after suit finishes + //---------------------------------------------------------------------- + if (self.radsuit_finished > 0) { + self.air_finished = time + WATER_AIR; // don't drown + + // sound and screen flash when items starts to run out + if (self.radsuit_finished < time + 3) { + if (self.rad_time == 1) { + sprint (self, "Air supply in Biosuit expiring\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTSUIT2, 1, ATTN_NORM); + self.rad_time = time + 1; + } + if (self.rad_time < time) { + self.rad_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.radsuit_finished < time) ResetPowerEnvSuit(self); + } + + //---------------------------------------------------------------------- + // Wet Suit + // - Flash screen 3s before running out + // - Give player 12s of air after suit finishes + //---------------------------------------------------------------------- + if (self.wetsuit_finished > 0) { + self.air_finished = time + 12; // don't drown + + // Produce particle bubbles + if (self.waterlevel == 3) { + if (self.wetsuit_bubbles < time) { + self.wetsuit_bubbles = time + 0.5 + random(); + particle_debuff(self.origin, 16, rint(10+random()*40), PARTICLE_BURST_BLUE); + } + } + + // Check to see if the water level has changed + if (self.wetsuit_level != self.waterlevel) { + // Is the player coming out of the water? + if (self.wetsuit_level > 2 && self.waterlevel < 3) + self.wetsuit_sound = 0; + // Is the player going into the water? (above head) + else if (self.wetsuit_level < 3 && self.waterlevel > 2) + self.wetsuit_sound = 0; + self.wetsuit_level = self.waterlevel; + } + + // Play active sound based on water level + if (self.wetsuit_sound < time) { + if (self.waterlevel == 3) { + // Under water sound with bubbbles + self.volume = 0.5 + random() * 0.5; + sound (self, CHAN_ITEM, SOUND_ARTWETS3, self.volume, ATTN_IDLE); + self.wetsuit_sound = time + 4; + } + else { + // Different sound when not in the water (faster) + self.volume = 0.4 + random() * 0.4; + sound (self, CHAN_ITEM, SOUND_ARTWETS3B, self.volume, ATTN_IDLE); + self.wetsuit_sound = time + 3 + random(); + } + } + + // sound and screen flash when items starts to run out + if (self.wetsuit_finished < time + 3) { + self.wetsuit_sound = time + 4; // Stop breathing sound + if (self.wetsuit_time == 1) { + sprint (self, "Air supply in Wet suit expiring\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTWETS2, 1, ATTN_NORM); + self.wetsuit_time = time + 1; + } + if (self.wetsuit_time < time) { + self.wetsuit_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.wetsuit_finished < time) ResetPowerWetSuit(self); + } + + //---------------------------------------------------------------------- + // Invincibility (Pentagram) + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.invincible_finished > 0) { + // sound and screen flash when items starts to run out + if (self.invincible_finished < time + 3) { + if (self.invincible_time == 1) { + sprint (self, "Protection is almost burned out\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTPENT2, 1, ATTN_NORM); + self.invincible_time = time + 1; + } + if (self.invincible_time < time) { + self.invincible_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.invincible_finished < time) ResetPowerPent(self); + } + + //---------------------------------------------------------------------- + // Super Damage (Quad) + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.super_damage_finished > 0) { + // sound and screen flash when items starts to run out + if (self.super_damage_finished < time + 3) { + if (self.super_time == 1) { + sprint (self, "Quad Damage is wearing off\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTQUAD2, 1, ATTN_NORM); + self.super_time = time + 1; + } + if (self.super_time < time) { + self.super_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.super_damage_finished < time) ResetPowerQuad(self); + } + + //---------------------------------------------------------------------- + // SharpShooter + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.sharpshoot_finished > 0) { + // sound and screen flash when items starts to run out + if (self.sharpshoot_finished < time + 3) { + if (self.sharpshoot_time == 1) { + sprint (self, "Sharpshooter has almost gone\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTSHARP2, 1, ATTN_NORM); + self.sharpshoot_time = time + 1; + } + if (self.sharpshoot_time < time) { + self.sharpshoot_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.sharpshoot_finished < time) ResetPowerSharp(self); + } + + //---------------------------------------------------------------------- + // Nail Piercer + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.nailpiercer_finished > 0) { + // sound and screen flash when items starts to run out + if (self.nailpiercer_finished < time + 3) { + if (self.nailpiercer_time == 1) { + sprint (self, "Nail Piercer is wearing off\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTNAILP2, 1, ATTN_NORM); + self.nailpiercer_time = time + 1; + } + if (self.nailpiercer_time < time) { + self.nailpiercer_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.nailpiercer_finished < time) ResetPowerPiercer(self); + } + + //------------------------------------------------------------------ + // Only remove the quad effect (status bar update) + // if all extra mod artifacts have expired as well + //------------------------------------------------------------------ + if (self.super_damage_finished == 0 && self.sharpshoot_finished == 0 + && self.nailpiercer_finished == 0) + ResetPowerQuadItem(self); + + //------------------------------------------------------------------ + // This check for setting the client effect needs to be separate + // because its setup by several different artifacts! + //------------------------------------------------------------------ + if (self.super_damage_finished > 0 || self.invincible_finished > 0 || + self.sharpshoot_finished > 0 || self.nailpiercer_finished > 0) { + self.effects = self.effects | EF_DIMLIGHT; + } + else self.effects = self.effects - (self.effects & EF_DIMLIGHT); +}; + diff --git a/QC_other/QC_arcane/defs.qc b/QC_other/QC_arcane/defs.qc new file mode 100644 index 00000000..cbe60b60 --- /dev/null +++ b/QC_other/QC_arcane/defs.qc @@ -0,0 +1,854 @@ +/*============================================================================== + + SOURCE FOR GLOBALVARS_T C STRUCTURE + +==============================================================================*/ + +// +// system globals +// +entity self; +entity other; +entity world; +float time; +float frametime; + +float force_retouch; // force all entities to touch triggers + // next frame. this is needed because + // non-moving things don't normally scan + // for triggers, and when a trigger is + // created (like a teleport trigger), it + // needs to catch everything. + // decremented each frame, so set to 2 + // to guarantee everything is touched +string mapname; + +float deathmatch; +float coop; +float teamplay; + +float serverflags; // propagated from level to level, used to + // keep track of completed episodes + +float total_secrets; +float total_monsters; + +float found_secrets; // number of secrets found +float killed_monsters; // number of monsters killed + + +// spawnparms are used to encode information about clients across server +// level changes +float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; + +// +// global variables set by built in functions +// +vector v_forward, v_up, v_right; // set by makevectors() + +// set by traceline / tracebox +float trace_allsolid; // both start and end vectors were in a solid (in the void) +float trace_startsolid; // the start point was in a solid +float trace_fraction; // how much of the vector (% from 0 to 1) was traced before it hit something +vector trace_endpos; // the final position (if it didn't hit anything, then this is the same as vec2, otherwise it's the impact point +vector trace_plane_normal; // the normal of the surface it hit +float trace_plane_dist; // used for angled surfaces +entity trace_ent; // the entity it hit (or world if it hit nothing) +float trace_inopen; // if some portion of the trace is in the air +float trace_inwater; // if some portion of the trace is in water (if it's in both air and water, both are set) + +entity msg_entity; // destination of single entity writes + +// +// required prog functions +// +void() main; // only for testing + +void() StartFrame; + +void() PlayerPreThink; +void() PlayerPostThink; + +void() ClientKill; +void() ClientConnect; +void() PutClientInServer; // call after setting the parm1... parms +void() ClientDisconnect; + +void() SetNewParms; // called when a client first connects to + // a server. sets parms so they can be + // saved off for restarts + +void() SetChangeParms; // call to set parms for self so they can + // be saved for a level transition + + +//================================================ +void end_sys_globals; // flag for structure dumping +//================================================ + +/*============================================================================== + SOURCE FOR ENTVARS_T C STRUCTURE +==============================================================================*/ +// +// system fields (*** = do not set in prog code, maintained by C code) +// +.float modelindex; // *** model index in the precached list +.vector absmin, absmax; // *** origin + mins / maxs + +.float ltime; // local time for entity +.float movetype; +.float solid; + +.vector origin; // *** +.vector oldorigin; // *** +.vector velocity; +.vector angles; +.vector avelocity; + +.vector punchangle; // temp angle adjust from damage or recoil + +.string classname; // spawn function +.string model; +.float frame; +.float skin; +.float effects; + +.vector mins, maxs; // bounding box extents reletive to origin +.vector size; // maxs - mins + +.void() touch; +.void() use; +.void() think; // Next function to execute +.void() blocked; // for doors or plats, called when can't push other + +.float nextthink; +.entity groundentity; // Do not re-use, engine resets value all the time + +// stats +.float health; +.float frags; // Used mostly for MP +.float weapon; // one of the IT_SHOTGUN, etc flags +.string weaponmodel; +.float weaponframe; +.float currentammo; +.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; + +.float items; // bit flags + +.float takedamage; // Check by many functions for damage +.entity chain; // Can be overwritten by find command +.float deadflag; // Used by client functions + +.vector view_ofs; // add to origin to get eye point + + +.float button0; // fire +.float button1; // use +.float button2; // jump + +.float impulse; // weapon changes + +.float fixangle; // Make an entity instantly turn +.vector v_angle; // view / targeting angle for players +.float idealpitch; // calculated pitch angle for lookup up slopes + + +.string netname; // Used mostly for MP + +.entity enemy; // Pointer to current entity enemy + +.float flags; // FL bitflag operations + +.float colormap; +.float team; // Used mostly for Coop + +.float max_health; // players maximum health is stored here + +.float teleport_time; // don't back up + +.float armortype; // save this fraction of incoming damage +.float armorvalue; + +.float waterlevel; // 0 = not in, 1 = feet, 2 = waist, 3 = eyes +.float watertype; // a contents value + +.float ideal_yaw; // Ideal direction for entity to face +.float yaw_speed; // Speed (in degrees) turning towards ideal + +.entity aiment; + +.entity goalentity; // a movetarget or an enemy + +.float spawnflags; // Mostly custom options for each entity + +.string target; +.string targetname; + +// damage is accumulated through a frame. and sent as one single +// message, so the super shotgun doesn't generate huge messages +.float dmg_take; +.float dmg_save; +.entity dmg_inflictor; + +.entity owner; // who launched a missile +.vector movedir; // mostly for doors, but also used for waterjump + +.string message; // trigger messages + +.float sounds; // either a cd track number or sound number + +.string noise, noise1, noise2, noise3; // contains names of wavs to play + +//================================================ +void end_sys_fields; // flag for structure dumping +//================================================ + +/*============================================================================== + VARS NOT REFERENCED BY C CODE +==============================================================================*/ +float FALSE = 0; +float TRUE = 1; +float NEGATIVE = -1; + +// edict.flags +float FL_FLY = 1; +float FL_SWIM = 2; +float FL_CLIENT = 8; // set for all client edicts +float FL_INWATER = 16; // for enter / leave water splash +float FL_MONSTER = 32; +float FL_GODMODE = 64; // player cheat +float FL_NOTARGET = 128; // player cheat +float FL_ITEM = 256; // extra wide size for bonus items +float FL_ONGROUND = 512; // standing on something +float FL_PARTIALGROUND = 1024; // not all corners are valid +float FL_WATERJUMP = 2048; // player jumping out of water +float FL_JUMPRELEASED = 4096; // for jump debouncing + +// edict.movetype values +float MOVETYPE_NONE = 0; // never moves +//float MOVETYPE_ANGLENOCLIP = 1; +//float MOVETYPE_ANGLECLIP = 2; +float MOVETYPE_WALK = 3; // players only +float MOVETYPE_STEP = 4; // discrete, not real time unless fall +float MOVETYPE_FLY = 5; +float MOVETYPE_TOSS = 6; // gravity +float MOVETYPE_PUSH = 7; // no clip to world, push and crush +float MOVETYPE_NOCLIP = 8; +float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters +float MOVETYPE_BOUNCE = 10; +float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size + +// edict.solid values +float SOLID_NOT = 0; // no interaction with other objects +float SOLID_TRIGGER = 1; // touch on edge, but not blocking +float SOLID_BBOX = 2; // touch on edge, block +float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground +float SOLID_BSP = 4; // bsp clip, touch on edge, block + +// range values +float RANGE_MELEE = 0; +float RANGE_NEAR = 1; +float RANGE_MID = 2; +float RANGE_FAR = 3; + +// deadflag values +float DEAD_NO = 0; +float DEAD_DYING = 1; +float DEAD_DEAD = 2; +float DEAD_RESPAWNABLE = 3; +float DEAD_REMOVE = 4; +float DEAD_EXPLODE = 5; +float DEAD_FINISHED = 6; + +// takedamage values +float DAMAGE_NO = 0; +float DAMAGE_YES = 1; +float DAMAGE_AIM = 2; + +// items +float IT_AXE = 4096; +float IT_SHOTGUN = 1; +float IT_SUPER_SHOTGUN = 2; +float IT_NAILGUN = 4; +float IT_SUPER_NAILGUN = 8; +float IT_GRENADE_LAUNCHER = 16; +float IT_ROCKET_LAUNCHER = 32; +float IT_LIGHTNING = 64; +//float IT_EXTRA_WEAPON = 128; + +// Used by the engine to update the Sbar with gfx type +float IT_SHELLS = 256; +float IT_NAILS = 512; +float IT_ROCKETS = 1024; +float IT_CELLS = 2048; + +float IT_ARMOR1 = 8192; +float IT_ARMOR2 = 16384; +float IT_ARMOR3 = 32768; +float IT_SUPERHEALTH = 65536; + +float IT_KEY1 = 131072; +float IT_KEY2 = 262144; + +float IT_INVISIBILITY = 524288; +float IT_INVULNERABILITY = 1048576; +float IT_SUIT = 2097152; +float IT_QUAD = 4194304; + +// point content values + +float CONTENT_EMPTY = -1; +float CONTENT_SOLID = -2; +float CONTENT_WATER = -3; +float CONTENT_SLIME = -4; +float CONTENT_LAVA = -5; +float CONTENT_SKY = -6; + +float STATE_TOP = 0; +float STATE_BOTTOM = 1; +float STATE_UP = 2; +float STATE_DOWN = 3; +float STATE_DISABLED = 4; +float STATE_ENABLED = 5; +float STATE_DELETE = 6; +float STATE_MOVING = 7; +float STATE_ONE = 1; +float STATE_TWO = 2; + +vector VEC_ORIGIN = '0 0 0'; + +// Minion Eggs = Scorpions, Spiders and Voreling +vector VEC_HULLE_MIN = '-2 -2 -2'; +vector VEC_HULLE_MAX = '2 2 2'; +vector VEC_HULLT_MIN = '-24 -24 0'; +vector VEC_HULLT_MAX = '24 24 40'; + +// Player +vector VEC_HULLSHORT_MIN = '-16 -16 -24'; +vector VEC_HULLSHORT_MAX = '16 16 32'; + +// Original ID Ogre, Shalrath, Demon, Shambler +vector VEC_HULL2_MIN = '-32 -32 -24'; +vector VEC_HULL2_MAX = '32 32 64'; + +// protocol bytes +//---------------------------------------------------------------------- +float SVC_DISCONNECT = 2; // Mainly used in client.qc +float SVC_UPDATESTAT = 3; // Force update of stats +float SVC_SETVIEW = 5; // Set camera viewpoint entity +float STAT_TOTALSECRETS = 11; //added total monster message +float STAT_TOTALMONSTERS = 12; +float SVC_TEMPENTITY = 23; +float SVC_SETPAUSE = 24; +float SVC_CENTERPRINT = 26; +float SVC_KILLEDMONSTER = 27; +float SVC_FOUNDSECRET = 28; +float SVC_SPAWNSTATICSOUND= 29; +float SVC_INTERMISSION = 30; +float SVC_FINALE = 31; +float SVC_CDTRACK = 32; +float SVC_SELLSCREEN = 33; +float SVC_CUTSCENE = 34; + +float TE_SPIKE = 0; +float TE_SUPERSPIKE = 1; +float TE_GUNSHOT = 2; +float TE_EXPLOSION = 3; +float TE_TAREXPLOSION = 4; +float TE_LIGHTNING1 = 5; +float TE_LIGHTNING2 = 6; +float TE_WIZSPIKE = 7; +float TE_KNIGHTSPIKE = 8; +float TE_LIGHTNING3 = 9; +float TE_LAVASPLASH = 10; +float TE_TELEPORT = 11; +float TE_EXPLOSION2 = 12; +float TE_BEAM = 13; + +/*------------------------------------------------------------------ +New particle types added by (rogue software) + +TE_EXPLOSION2 (coloured version of TE_EXPLOSION) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 228); // 247 + WriteByte (MSG_BROADCAST, 5); + + TE_BEAM used to draw a line between two points (grapple hook) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_BEAM); + WriteEntity (MSG_BROADCAST, h); + WriteCoord (MSG_BROADCAST, h.origin_x); + WriteCoord (MSG_BROADCAST, h.origin_y); + WriteCoord (MSG_BROADCAST, h.origin_z); + WriteCoord (MSG_BROADCAST, player.origin_x); + WriteCoord (MSG_BROADCAST, player.origin_y); + WriteCoord (MSG_BROADCAST, player.origin_z + 16); +------------------------------------------------------------------*/ + +// sound channels +// channel 0 never willingly overrides +// other channels (1-7) allways override a playing sound on that channel +float CHAN_AUTO = 0; +float CHAN_WEAPON = 1; +float CHAN_VOICE = 2; +float CHAN_ITEM = 3; +float CHAN_BODY = 4; +float CHAN_FEET = 5; +float CHAN_EXTRA1 = 6; +float CHAN_EXTRA2 = 7; + +float ATTN_NONE = 0; +float ATTN_NORM = 1; +float ATTN_FEETL = 1.5; +float ATTN_FEET = 2; +float ATTN_IDLE = 2; +float ATTN_ARMOUR = 2; +float ATTN_GIB = 2; +float ATTN_BREAK = 2; +float ATTN_WEAPON = 2.3; +float ATTN_LOW = 3; +float ATTN_STATIC = 3; +float ATTN_QUIET = 3.99; + +// update types +float UPDATE_GENERAL = 0; +float UPDATE_STATIC = 1; +float UPDATE_BINARY = 2; +float UPDATE_TEMP = 3; + +// entity effects +float EF_BRIGHTFIELD = 1; +float EF_MUZZLEFLASH = 2; +float EF_BRIGHTLIGHT = 4; +float EF_DIMLIGHT = 8; + +/* Stuff added by DP/community +// Fitz/QS protocol only supports effects up 256 +// defined in dpextensions.qc (here for quick reference) +float EF_NODRAW = 16; +float EF_ADDITIVE = 32; +float EF_BLUE = 64; +float EF_RED = 128; +float EF_NOGUNBOB = 256; +float EF_FULLBRIGHT = 512; +float EF_FLAME = 1024; +float EF_STARDUST = 2048; +float EF_NOSHADOW = 4096; +float EF_NODEPTHTEST = 8192; +float EF_DOUBLESIDED = 32768; +float EF_RESTARTANIM_BIT = 1048576; +float EF_TELEPORT_BIT = 2097152; +*/ + +// messages +float MSG_BROADCAST = 0; // unreliable to all +float MSG_ONE = 1; // reliable to one (msg_entity) +float MSG_ALL = 2; // reliable to all +float MSG_INIT = 3; // write to the init string + +//====================================================================== +// globals +//====================================================================== +float movedist; +float gameover; // set when a rule exits + +// make sure string_null remains NULL even after save/loading +// #define string_null __NULL__ +string string_null; // null string, nothing should be held here +//float empty_float; + +entity newmis; // launch_spike sets this after spawning it +entity activator; // the entity that activated a trigger or brush +entity damage_attacker; // set by T_Damage +float framecount; + +float skill; +float developer; + +//====================================================================== +// world fields (FIXME: make globals) +//====================================================================== +.string wad; +.string map; +.float worldtype; // 0=medieval 1=metal 2=base + +.string killtarget; + +//====================================================================== +// quakeed fields +//====================================================================== +.float light_lev; // not used by game, but parsed by light util +.float style; + +//====================================================================== +// monster ai +//====================================================================== +.void() th_stand; +.void() th_walk; +.void() th_run; +.void() th_missile; +.void() th_melee; +.void(entity inflictor, entity attacker, float damage) th_pain; +.void() th_die; + +.entity oldenemy; // mad at this player before taking damage +.float speed; + +.float lefty; + +.float search_time; +.float attack_state; + +float AS_RUNNING = 0; // Hunt mode (find player) +float AS_STRAIGHT = 1; // Running at player +float AS_SLIDING = 2; // Straft attack +float AS_MELEE = 3; // Melee attack +float AS_MISSILE = 4; // Range attack +float AS_JUMP = 5; // Jumping attack +float AS_TURRET = 6; // Turret Range attack +float AS_SIDESTEP = 7; // Turn 90 degrees and move to the side +float AS_BACKWARD = 8; // Turn 180 degrees and move backwards + +//====================================================================== +// player only fields +//====================================================================== +.float walkframe; + +.float attack_finished; +.float pain_finished; + +.float invincible_finished; +.float invisible_finished; +.float super_damage_finished; +.float radsuit_finished; + +.float invincible_time, invincible_sound; +.float invisible_time, invisible_sound; +.float super_time, super_sound; +.float rad_time; +.float fly_sound; + +.float axhitme; + +.float show_hostile; // set to time+0.2 whenever a client fires a + // weapon or takes damage. Used to alert + // monsters that otherwise would let the player go +.float jump_flag; // player jump flag +.float swim_flag; // player swimming sound flag +.float air_finished; // when time > air_finished, start drowning +.float bubble_count; // keeps track of the number of bubbles +.string deathtype; // keeps track of how the player died + +//====================================================================== +// object stuff +.string mdl; +.vector mangle; // angle at start +.float t_length, t_width; + +//====================================================================== +// doors, etc +.vector dest0, dest1, dest2; +.float wait; // time from firing to restarting +.float delay; // time from activation to firing +.entity trigger_field; // door's trigger entity +.string noise4; +.float dmg; // damage done by door when hit + +//====================================================================== +// monsters +.float pausetime; +.entity movetarget; +.float inpain; // Originally defined in zombie.qc + +//====================================================================== +// items +.float aflag; // Ammo quantity stored on items + +//====================================================================== +// misc +.float cnt; // misc flag + +//====================================================================== +// subs +.void() think1; +.vector finaldest, finalangle; + +//====================================================================== +// triggers +.float count; // for counting triggers + +//====================================================================== +// plats / doors / buttons +.float lip; +.float state; +.vector pos1, pos2, pos3; // top and bottom positions +.float height; + +//====================================================================== +// sounds +.float waitmin, waitmin2; /*, waitmax*/ +.float distance; +.float volume; + +//====================================================================== +// builtin functions +//====================================================================== +void(vector ang) makevectors = #1; // sets v_forward, etc globals +void(entity e, vector o) setorigin = #2; +void(entity e, string m) setmodel = #3; // set movetype and solid first +void(entity e, vector min, vector max) setsize = #4; +// #5 was removed +void() break = #6; +float() random = #7; // returns 0 - 1 +void(string s) dprint; +void(entity e, float chan, string samp, float vol, float atten) sound = #8; + +/*------------------------------------------------------------------------- +// A wrapper for the sound command, to help track down precache errors +//--------------------------------------------------------------------- +void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8; +void(entity e, float chan, string samp, float vol, float atten) sound = { + if (samp == "") { + dprint("\b[SOUND]\b Entity ("); dprint(e.classname); + dprint(") missing sound!\n"); + } + else sound_builtin (e, chan, samp, vol, atten); +}; */ + +vector(vector v) normalize = #9; +void(string e) error = #10; +void(string e) objerror = #11; +float(vector v) vlen = #12; +float(vector v) vectoyaw = #13; +entity() spawn = #14; +void(entity e) remove = #15; +//---------------------------------------------------------------------- +// sets trace_* globals +// nomonsters can be: +// An entity will also be ignored for testing if forent == test, +// forent->owner == test, or test->owner == forent +// a forent of world is ignored +//---------------------------------------------------------------------- +void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16; +entity() checkclient = #17; // returns a client to look for +entity(entity start, .string fld, string match) find = #18; +string(string s) precache_sound = #19; +string(string s) precache_model = #20; +void(entity client, string s)stuffcmd = #21; +entity(vector org, float rad) findradius = #22; +void(string s) bprint = #23; +void(entity client, string s) sprint = #24; +void(string s) dprint = #25; +string(float f) ftos = #26; +string(vector v) vtos = #27; +void() coredump = #28; // prints all edicts +void() traceon = #29; // turns statment trace on +void() traceoff = #30; +void(entity e) eprint = #31; // prints an entire edict +//---------------------------------------------------------------------- +.float movespeed; // Movement speed (linked to skill) +.float tetherlock; // Is the monster locked from movement +float(float yaw, float dist) walkmove_builtin = #32; // returns TRUE or FALSE +float(float yaw, float dist) walkmove = { + if (self.attack_state == AS_TURRET) return FALSE; + if (self.movespeed < 0) return FALSE; + if (self.tetherlock == TRUE) return FALSE; + return walkmove_builtin(yaw,dist); +}; +//---------------------------------------------------------------------- +// #33 was removed +float() droptofloor= #34; // TRUE if landed on floor +void(float style, string value) lightstyle = #35; +float(float v) rint = #36; // round to nearest int +float(float v) floor = #37; // largest integer <= v +float(float v) ceil = #38; // smallest integer >= v +// #39 was removed +float(entity e) checkbottom = #40; // true if self is on ground +float(vector v) pointcontents = #41; // returns a CONTENT_* +// #42 was removed +float(float f) fabs = #43; +vector(entity e, float speed) aim = #44; // returns the shooting vector +float(string s) cvar = #45; // return cvar.value +void(string s) localcmd = #46; // put string into local que +entity(entity e) nextent = #47; // for looping through all ents +void(vector o, vector d, float color, float count) particle = #48;// start a particle effect +void() ChangeYaw = #49; // turn towards self.ideal_yaw at self.yaw_speed +// #50 was removed +vector(vector v) vectoangles = #51; +//---------------------------------------------------------------------- +// direct client message generation +void(float to, float f) WriteByte = #52; +void(float to, float f) WriteChar = #53; +void(float to, float f) WriteShort = #54; +void(float to, float f) WriteLong = #55; +void(float to, float f) WriteCoord = #56; +void(float to, float f) WriteAngle = #57; +void(float to, string s) WriteString = #58; +void(float to, entity s) WriteEntity = #59; +//---------------------------------------------------------------------- +// broadcast client message generation +// void(float f) bWriteByte = #59; +// void(float f) bWriteChar = #60; +// void(float f) bWriteShort = #61; +// void(float f) bWriteLong = #62; +// void(float f) bWriteCoord = #63; +// void(float f) bWriteAngle = #64; +// void(string s) bWriteString = #65; +// void(entity e) bWriteEntity = #66; +//---------------------------------------------------------------------- +void(float step) movetogoal_builtin = #67; +void(float step) movetogoal = { + if (self.attack_state == AS_TURRET) return; + if (self.movespeed < 0) return; + if (self.tetherlock == TRUE) return; + movetogoal_builtin(step); +}; +//---------------------------------------------------------------------- +string(string s) precache_file = #68; // no effect except for -copy +void(entity e) makestatic = #69; +void(string s) changelevel = #70; +//#71 was removed +void(string var, string val) cvar_set = #72; // sets cvar.value +void(string var, string s, string s) cvar_setlong = #72; // sets cvar.value +//---------------------------------------------------------------------- +.float suppressCenterPrint; +void(entity client, string s1) centerprint_builtin = #73; +void(entity client, string s1, string s2) centerprint_msg = #73; +void(entity client, string s1) centerprint = { + // Is the centerprint message being used by something else? + if (!client.suppressCenterPrint) + centerprint_builtin(client, s1); + else { + // Send message to client console instead + sprint(client, "(centerprint) "); + sprint(client, s1); + sprint(client, "\n"); + } +} +void(entity client, string s1, string s2, string s3) centerprint_msg3 = #73; +void(entity client, string s1, string s2, string s3) centerprint3 = { + // Is the centerprint message being used by something else? + if (!client.suppressCenterPrint) + centerprint_msg3(client, s1, s2, s3); + else { + // Send message to client console instead + sprint(client, "(centerprint) "); + sprint(client, s1); + sprint(client, s2); + sprint(client, s3); + sprint(client, "\n"); + } +} +void(entity client, string s1, string s2, string s3, string s4) centerprint_msg4 = #73; +void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) centerprint_msg7 = #73; +void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) centerprint7 = { + // Is the centerprint message being used by something else? + if (!client.suppressCenterPrint) + centerprint_msg7(client, s1, s2, s3, s4, s5, s6, s7); + else { + // Send message to client console instead + sprint(client, "(centerprint) "); + sprint(client, s1); + sprint(client, s2); + sprint(client, s3); + sprint(client, s4); + sprint(client, s5); + sprint(client, s6); + sprint(client, s7); + sprint(client, "\n"); + } +} +//---------------------------------------------------------------------- +void(vector pos, string samp, float vol, float atten) ambientsound = #74; +string(string s) precache_model2 = #75; // not used anymore +string(string s) precache_sound2 = #76; // registered version only +string(string s) precache_file2 = #77; // not used anymore +void(entity e) setspawnparms = #78; // set parm1... to the values at level start for coop respawn + +/*====================================================================== + All global variables and func definitions from all other QC files +======================================================================*/ +// ai.qc +entity sight_entity; // Highlight an angry monster +float sight_entity_time; // Time got angry + +float(entity targ) infront; +float (entity targ) visible; +float(entity targ, float flat2d) range_distance; +float(float attackdist) ai_checkmelee; +float(entity targ) visblocked; +float(entity targ, vector s_offset, vector t_offset, float nomonsters) visxray; +float (entity targ, vector s_ofset, vector t_ofset) visblocked_wide; +float() FacingIdeal; +float(entity source, entity targ, float ignorenoshoot) ai_foundbreakable; + +// client.qc +float modelindex_eyes, modelindex_player; +float intermission_running; +float intermission_exittime; +string nextmap; // Used by GotoNextMap() +.float dmgtime; // Used by WaterMove() +.float poisonous; // A monster with poisonous attack +void(entity targ) BleedDeBuff; +void(entity targ) BurnDeBuff; +void(entity targ) PoisonDeBuff; + +// combat.qc +float DAMARMOR = 1; +float NOARMOR = 2; +float DAMAGEALL = 4; +float IGNORECLASS = 8; +void(entity targ, entity inflictor, entity attacker, float damage, float checkarmor) T_Damage; +void(entity inflictor, entity attacker, float damage, entity ignore, float checkclass) T_RadiusDamage; +float(entity targ, entity inflictor) CanDamage; + +// fight.qc +float enemy_vis, enemy_infront, enemy_range; +float enemy_yaw; + +// items.qc +.float healamount, healtype; +float (entity e, float healamount, float ignore) T_Heal; + +// monsters.qc +void() monster_sightsound; +void() monster_liquid_check; +void() monster_death_use; +void(float gib_no, float gib_qty) ThrowGib; +void() monster_ThrowGib; + +// subs.qc +void() SUB_Null; +void() SUB_UseTargets; +void() SUB_Remove; + +// triggers_state.qc +void() trigger_bmodel_sounds; +void() trigger_bmodel_setup; + +// weapon.qc +entity multi_ent; +float multi_damage; +void(entity targ) W_ChangeWeapon; +void(entity targ) W_SetCurrentAmmo; +float(entity targ) W_BestWeapon; +void() W_WeaponFrame; + +// ai_explosion.qc +void(float sprite_type, vector org, string expl_sound) SpawnExplosion; +void(vector org, float velrnd, float upbase, float uprnd) SpawnProjectileSmoke; +void(entity source, entity targ, float side) SpawnMeatSpray; +void(entity targ, vector org, vector vel, float part_qty) SpawnBlood; + +//====================================================================== +void() DummyFunction = //gets rid of the last compiler warnings ; - ) +{ + local string w; + local float l; + w = self.wad; + l = self.light_lev; +} diff --git a/QC_other/QC_arcane/defscustom.qc b/QC_other/QC_arcane/defscustom.qc new file mode 100644 index 00000000..324bb5f7 --- /dev/null +++ b/QC_other/QC_arcane/defscustom.qc @@ -0,0 +1,1714 @@ +//====================================================================== +// Author : Simon "Sock" OCallaghan +// Website: www.simonoc.com +//====================================================================== +nosave float configflag; // Temp cvar used to hold serverflags until live +nosave float temp1flag; // Temp cvar used to hold temp1 console flag +nosave float prethink; // always runs everytime the map is start/load/quickload +nosave float postthink; // Used once after map load +nosave float coop_cvar; // Has the coop cvar been read from console +nosave float skill_cvar; // Has the skill cvar been read from console +nosave float autoaim_cvar; // What is the current state of autoaim +nosave float mapvar_cvar; // Detects if map variables have been loaded + +// Client related features +entity client_ent; // Client entity that started server +entity camera_ent; // Start of the info_intermission camera chain +entity coop_ent; // Start of the info_coop spawn locations +float coop_artifacts; // Do artifacts drop from backpacks for coop +float coop_ammoboxes; // Toggle ammo boxes respawning in coop +float coop_weapons; // Toggle weapons respawning in coop +float coop_health; // Toggle health packs respawning in coop +float coop_powerups; // Toggle powerups respawning in coop +float trig_cdtrack; // Trigger changed CD track +string trig_skybox; // Trigger changed Skybox +float engine; // Type of engine active 0=Fitz, 1=DP/FTE/QSS +float ext_active; // PR extenstions active (DP/FTE) +float ext_dpfog; // Extra DP fog parameters +float ext_dppart; // Extra DP particle system +float ext_dpsurf; // Extra DP query surface information +float ext_dprain; // Extra DP particle rain system +float ext_dpsnow; // Extra DP particle snow system +//float ext_dprot; // Extra DP rotating bmodel system +float pixelmode; // Change texture pixel mode (linear/nearest) +float playerprojsize; // Player projectiles 0=Large or 1=Small +entity gibitem; // Latest gib to be generated +float gibstone; // Has stone gibs been precached +float gibpoison; // Has poison gibs been precached +float liquid_alpha; // Stores water alpha, used for monster sight checks +float map_gravity; // Current map gravity setting +float map_bodyflrcheck; // Check floor for monster dead bodies +float map_bodyfadeaway; // Fade all dead monster bodies (time in secs) +entity debugent1, debugent2, debugent3; // Used on wide visibility tests + +// Worldspawn features +.float alpha; // Alpha value (requires modern engine) +.float gravity; // per-entity gravity (support added in engines after hipnotic xpac) +.float water_alpha; // Map specific alpha value for water surfaces +.float proj_shotgun; // Enable/Disable projectile shotgun +.float upgrade_axe; // Upgrade the axe with new weapon +.float upgrade_ssg; // Upgrade Super Shotgun with new weapon +.float upgrade_lg; // Upgrade Lightning Gun with new weapon +.float no_item_offset; // All ammo + heal items to use central rotation +.float no_item_rotate; // Not used anymore, kept for compatibility +.float no_zaware; // Switches OFF ALL zaware monsters +.float no_sgprojectile; // Switches OFF ALL shotgun projectiles +.float no_sgcasing; // Switches OFF ALL shotgun casings +.float no_bigprojectiles; // Switches OFF large player projectiles size +.float no_liquiddmg; // Blocks liquid damage checks for monsters +.float no_surfacecheck; // Stops surface checks for large maps +.float sprite_particles; // Forces all particles to be dots/sprites +.float knight_defskin; // Default skin (0-3) type for new knight model +.float give_weapons; // Which weapons the player always starts with +.float take_weapons; // Which weapons the player never starts with +.float reset_health; // Reset health to this value upon spawning +.float bodyflrcheck; // Check floor for monster dead bodies +.float bodyfadeaway; // Time in seconds before body/head fades away +.vector mapvar_update; // Update map variables (Range X->Y=Z) + +// Global fog system +float fog_active; // Global fog values are active +entity fog_control; // Global fog controller (unique to map) +.float fog_density; // Global fog density when map loads +.vector fog_colour; // Global fog colour when map loads +.string fog_dpextra; // Extra parameters for DP engine +.float fog_currden; // Current fog density +.float fog_targden; // Target fog density +.float fog_diffden; // Difference between current and target +.vector fog_currcol; // Current fog colour (RGB) +.vector fog_targcol; // Target fog colour (RBG) +.vector fog_diffcol; // Difference between current and target +.float fog_difftime; // Amount of time to fade fog (seconds) +.float fog_steptime; // Amount of steps to fade (20 per second) + +// Eric Compiler - Switchable Style Shadows +.float switchshadstyle; // Switchable style for bmodels (shadows) +.entity switchfader; // Controller for fading shadows on bmodels + +// General features +.float moditems; // New items flag for new stuff in the mod +.float customkey; // Bit flag for custom keys (func_door) +.float bsporigin; // All bmodel origins are 0,0,0 check this first +.float savedeffects; // Saved effects to apply after spawn +.float nightmare; // Only spawn entity if nightmare skill active +.float cooponly; // Only spawn entity if coop gameplay active +.float startspawn2; // player_start2 unique spawn location number +.entity activate; // When something is triggered, this is the culprit! +.entity bmodel_act; // Trigger bmodel generic touch/kill/use functions +.float bboxtype; // Different types of bounding box setups +.vector bbmins; // Saved bounding box size (minimum) +.vector bbmaxs; // Saved bounding box size (maximum) +.vector idmins; // Original ID bounding box (min) +.vector idmaxs; // Used for stuck issues in original id maps +.entity touching; // The trigger entity that is touching +.string startmsg; // Start message for trigger_counter entity +.string message2; // Additional messages for all entities +.string message3; // Used by misc_books for addtional text +.string message4; // Used by misc_books for addtional text +.string target2; // Secondary target field (additional fires) +.void() touch2; // Used by items for final touch function +.float classtype; // Class type - used for quick reference +.float classgroup; // Class group - used for quick reference +.float classmove; // 1=Walk, 2=Fly, 4=Swim +.float classproj; // Projectile used by entity class +.float projeffect; // Special effects and states active +.float gibhealth; // The negative health value for gibbing +.float gibbed; // true/false flag on body state +.float touchedvoid; // true/false flag if touched void bmodel +.float touchedliquid; // true/false flag if touched fake liquid +.string touchedsound; // Sound string for fake liquid exit +.string headmdl; // Head model for gib routine +.float bleedcolour; // Alternative colour for 'bleeding' objects +.float locksounds; // Locked sound for doors etc +.float skin_override; // Override skin selection based on world theme +.float frame_override; // Override frame number (ammo_boxes) +.float frame_box; // Set frame number for model animation (-1=random) +.float item_flrcheck; // Check the floor surface under items +.float item_expired; // Removal timer for item in item_thinkloop +.float item_skinanim; // Does the skin require animating? +.float item_skincycle; // Skin animations are usually 0.3s (health packs) +.float item_skinanim_no; // Skin no for animation groups +.float noradiusdmg; // Block all T_RadiusDamage, stops grenade spam +.float nodebuginfo; // Blocks certain debug info for entities +.float onladder; // Update state from ladder entity to client +.entity entladder; // Ladder entity for reference (time, sounds etc) +.float timeladder; // Amount of time before playing climb sound +.entity attachment; // 1st Entity attachment (additional model) +.entity attachment2; // 2nd entity attachment (additional model) +.entity attachment3; // 3rd entity attachment (additional model) +.entity sound_emitter; // Used by various entities for add sound +.float check_weather; // Checks for weather system on sound emitters +.float entno_unique; // Unique number for linking entities +.string str_unique; // Unique string name for testing +.string ckeyname1, ckeyname2, ckeyname3, ckeyname4; // Custom key netnames +.float ckeyhint; // Hint to the player about inventory key + +// Pressure switch/ volume trigger parameters +.float presstype; // 0/1 if touching entity type is valid +.float presstimersound; // Timer for sound FX (stops repeating) +.float no_deadbody; // Monster dead bodies don't work with trigger + +// Item respawning parameter +.float respawn_time; // Amount of time to spend respawning item +.float respawn_count; // Total amount of times to respawn an item +.float respawn_trig; // Wait for a trigger before respawning +.float respawn_effect; // Show particle effect for respawning items +.float respawn_style; // Which particle colour and pattern to use +.vector respawn_ofs; // Z axis height for respawn burst +.entity respawn_part; // Respawn particle emiiter link on items + +// AI Pathing (corners/trains) +.float direction; // Travel direction for func_trains +.float corner_route; // Change path_corner route (1-3 routes, 4=exact, 5=random) +.float corner_switch; // Change spawnflags REVERSE (-1=NO, 1=YES, 2=Toggle) +.float corner_pause; // Change spawnflags NOPAUSE (-1=NO, 1=YES, 2=Toggle) +.float corner_speed; // Change path_corner speed (def=100) +.string corner_event; // Special target event on path_corners +.string targetback; // Override backwards pathing route on path_corners +.entity movetarget2; // Additional move target for AI pathing +.entity movetarget3; // Additional move target for AI pathing +.entity movelast; // The last AI pathing corner been at + +// Ingame number displays +.float targetnumber; // Float number to pass to misc_targetnumber +.entity tno1, tno2, tno3, tno4, tno5, tno6, tno7, tno8; // Entity digits + +// Entity state system +.float estate_trigger; // Entity state to be applied to target +.float estate; // Entity state (off,on and disable) +.void() estate_on; // Entity state ON function +.void() estate_off; // Entity state OFF function +.void() estate_disable; // Entity state DISABLE function +.void() estate_use; // Entity state USE function +.void() estate_fire; // Entity state USE++ function +.void() estate_reset; // Entity state RESET function +.void() estate_aframe; // Entity state AFRAME function + +// Breakable system +.float brksound; // Initial sound type +.float brkimpsound; // Impact sound type +.float brkimpqty; // Total impact sounds setup +.float brkobjects; // Breakable sub object type +.string brkobj1; // Breakable object 1 (bsp/mdl) +.string brkobj2; // Breakable object 2 (bsp/mdl) +.string brkobj3; // Breakable object 3 (bsp/mdl) +.string brkobj4; // Breakable object 4 (bsp/mdl) +.float brkobjqty; // Total breakable sub objects setup +.vector brkvelbase; // Base amount for velocity of broken parts +.vector brkveladd; // Random additions for velocity of broken parts +.float brkavel; // Amount of breaking object angle velocity +.float brkfade; // Fade time before rumble fades away +.vector brkvol; // Spawning volume for breakable point entity +.float brkgravity; // Change the gravity for rumble, useful for underwater +.float brkmondmg; // Damage multipler for monster attacks +.float brktrigmissile; // Trigger breakable if hit by - rocket/grenade/shalball +.float brktrigjump; // Trigger breakable if hit by jumping monster attack +.float brktrignoplayer; // Players cannot damage this breakable +.float brkdelaydamage; // Pause from damage when triggered on + +// Monster features +.float bossflag; // Flag set on all bosses +.entity enemytarget; // flying monsters enemy target +.float debuglvl; // Used to debug monsters behaviour +.float randomskin; // 0=nothing, x=random number of skins +.float exactskin; // 1-x exact skin number to choose + +.void() th_checkattack; // Which check attack function to use +.void() th_slide; // Mainly used by wizard monster +.void() th_charge; // Mainly used by Hell/Death Knight monsters +.void() th_altstand; // Alternative stand animation (Knights only) +.void() th_wakeup; // Special wakeup animations before combat +.void() th_jump; // Special jump animation for jumpers! +.void() th_jumpexit; // Exit animation to stop flying (stuck) +.void() th_updmissile; // Update monster missiles while flying +.void() th_gibdie; // Special function for gib death + +.float liquidbase; // Liquid content at base of model (feet) +.float liquidcheck; // Timer to prevent over checking of liqdmg +.float liquidblock; // Cannot see through liquids for wakeup +.float distmin; // Minimum amount of distance to teleport +.float distmax; // Maximum amount of distance to teleport + +.float attack_elev; // Iternative attack angle for zaware monsters +.float move_elev; // Z movement adjustment for flying units +.vector move_state; // AI state movement; Stand, Walk & Run +.float bouncegrenade; // All grenades bounce off monster body +.float reflectlightning; // All Lightning strikes are reflected +.float reflectplasma; // All plasma projectiles are reflected +.float reflectnails; // All NG/SNG projectiles are reflected +.entity reflectent; // Entity to generate lightning from + +.vector attack_track; // Iternative tracking for range attacks +.float attack_chance; // The percentage chance the monster will attack +.float attack_speed; // Skill based adjusted projectile speed +.float attack_timer; // Blocking of certain attack types (charging) +.float attack_count; // Total amount of consecutive attacks +.vector attack_offset; // Vector where AI fires projectiles from +.float attack_rage; // Is the monster in a rage mode +.float attack_sidestep; // Timer to switch sides for movement +.float attack_sidedeny; // Timer to block side movement +.float attack_instant; // No pause when waking up to attack +.float attack_sniper; // Will wake up at any range (def=1000) + +.float meleeattack; // Which type of melee attack is happening +.float meleerange; // Distance used for checking melee contact +.float meleetimer; // Blood and gore sound/effect timer +.string meleehitsound; // Sound to play when melee impacts on enemy +.float meleecontact; // Flag set if monster has melee contact sound +.vector meleeoffset; // Offset for melee contact (spawning blood) + +.float plasma_burn; // Timer to stop constant plasma explosions +.float weaponstate; // State of the weapon (up/down etc) +.float weaponswitch; // Switch timer for different weapons +.string weaponglow; // Special glowing model for magic attacks +.float bodyphased; // Used for teleporter monsters +.float bodystatic; // Used to prevent teleporting monsters +.float spawnstatue; // Start/spawn as a statue (cannot be move) +.float spawnnosight; // Spawn when not in sight of player +.float spawnnosighttime; // Time to wait for sight condition +.float spawnnotelefrag; // Spawn when nothing is blocking location +.float nospawndamage; // Will not do any telefrag damage on spawn +.float wakeuptrigger; // Trigger flag to use special wakeup animation +.entity turretactive; // Set when a monster touches a triggerturret +.float turrettimer; // Timer used to prevent constant spamming +.float turrethealth; // % HP at which a turret monster is released +.string turrettarget; // Target to fire when turret % HP is released + +.float pain_flinch; // Random chance to ignore this much damage +.float pain_longanim; // Force monster into long pain animations +.float pain_finstate; // Store the current pain finished state +.float pain_check; // Pain condition results +.float pain_timeout; // Time block to pain function +.float pain_ignore; // Ignore pain when hit by other monsters +.string pain_sound; // Pain sound wav file +.string pain_sound2; // Alternative Pain sound wav file +.string death_sound; // Death sound wav file +.string death_sound2; // Alternative death sound wav file +.float death_dmg; // Used by tarbaby for explosive damage on death +.string deathstring; // Used by client for player death messages + +.float idlebusy; // Busy with an alternative idle animation +.float idlereverse; // Reverse direction for idle animation +.float idletimer; // Idle sound timer (next time to check) +.float idlemoreoften; // Chance of more idle sound (def=random) +.string idle_sound; // Idle sound wav file +.string idle_sound2; // Alternative Idle sound wav file +.string idle_soundcom; // Combat Idle sound wav file +.string idle_soundcom2; // Alternative Combat Idle sound wav file +.float sight_timeout; // Time block for sight sound +.string sight_sound; // Sight sound wav file 1 +.string sight_sound2; // Sight sound wav file 2 +.string sight_sound3; // Sight sound wav file 3 +.string sight_sound4; // Sight sound wav file 4 +.float sight_count; // Total amount of sight sounds defined +.float sight_nofront; // Monster has no infront check + +.float enemydist; // Distance the enemy is from the monster +.float enemymaxdist; // Maximum distance enemy is out of range +.entity lostenemy; // Lost soul enemy before losing sight +.float losttimer; // Lost soul idle timer after losing sight +.float lostsearch; // Lost soul searching for previous enemy + +.string angrytarget; // Alternative target to attack upon spawn +.string deathtarget; // Alternative target to fire when dying +.string sighttarget; // Will always attack this target if sighted +.entity switchattacker; // Last entity to attack and cause damage +.float switchtimer; // Cooldown before switching targets (infighting) +.float switchoverride; // Cooldown override timer to stop rapid switch +.float infightextra; // Damage multiplier for infighting damage +.float noinfighting; // Will ignore/start any infighting +.float nomonstercount; // excluded from map monster count +.float delaymonstercount; // Monster added to count when spawned +.entity jumptouch; // Last entity a jumping monster touched + +.float steptype; // Primary footstep type +.float altsteptype; // Secondary footstep type +.float steplast; // Last footstep sound +.float altsteplast; // Last club foot sound +.string stepc1, stepc2, stepc3, stepc4, stepc5; // Custom feet sounds +.float zombieflr; // Get up frame for zombie on floor +.string bodyonflr; // String used for find function +.string bodyonflrtrig; // Trigger to fire when body is axed! +.float dmgtimeframe; // Time before damage frame can be reset +.float dmgcombined; // combined damage over 1 frame (0.1 time) + +.float bosswave; // Current wave of the boss (backwards) +.float bosswavetotal; // Total amount of boss waves +.float bosswaveqty; // Total HP for each boss wave +.float bosswavetrig; // Current HP trigger for wave + +// Minions (rest of the parameters in ai_minions.qc) +.float minion_active; // is the minion system active + +// Projectile resistance (% protection) for monsters +.float resist_shells, resist_nails, resist_rockets, resist_cells; +.float lightning_timer; // Cool down for LG resist effect + +//---------------------------------------------------------------------- +float ENG_UNKNOWN = 0; // Default engine type +float ENG_FITZ = 1; // Fitz clone engines +float ENG_DPEXT = 2; // Engine with Darkplaces extensions + +float DEF_GRAVITY = 800; // Default gravity for maps +float DEF_FOGDEN = 0.1; // Default fog parameter +vector DEF_FOGCOL = '0.1 0.1 0.1'; // Wispy white +string DEF_FOGEXT = "1 0 8192 1024 32"; // DP only extra +float TELE_SPEED = 300; // Default teleport velocity +float LARGE_TIMER = 999999; // Don't run out of time! +float MEGADEATH = 50000; // Time to die! +float TIME_MINTICK = 0.01; // Smallest amount of time to tick functions +float FADEMODEL_TIME = 0.01; // Small amount of time +float FADEFOG_TIME = 0.05; // 20 updates per second +float PARTICLE_DEBUGMAX = 2; // Maximum debug level +float part_debug; // Particle debug level (visual details) +float POWERUP_TIMER = 30; // Default timer for powerups +float DEF_SHELLS = 25; // Default ammo given to new players +float FLOOR_TRACE_DIST = 256; // Default distance for floor trace checks +float FLOOR_TRACE_MONSTER = 40; // Distance for monster/body checks +float FLOOR_TRACE_GIBS = 16; // Distance for gib/head checks +float FLOOR_TRACE_BREAK = 16; // Distance for breakable checks + +//---------------------------------------------------------------------- +// Server flags (only way to carry items over between maps) +// bits 1-4 Runes, 5-8 Additional keys/items +float SVR_RUNE_KEY1 = 1; // Rune 1 +float SVR_RUNE_KEY2 = 2; // Rune 2 +float SVR_RUNE_KEY3 = 4; // Rune 3 +float SVR_RUNE_KEY4 = 8; // Rune 4 +float SVR_RUNE_ALL = 15; // Runes 1-4 (together) + +float SVR_SPAWN_BIT1 = 16; // 3 bit spawn location +float SVR_SPAWN_BIT2 = 32; // Supports 7 locations 001-111 +float SVR_SPAWN_BIT3 = 64; // Set via trigger_change_level + +float SVR_LIVE = 128; // Bit 8 - Serverflag has active data +float SVR_RUNEFLAG = 255; // Bits 1- 8 - Runes and Keys +float SVR_LOWFLAG = 65535; // Bits 1-16 - rune keys and spawn settings +float SVR_WORLDFLAG = 65280; // Bits 9-16 - default/worldspawn options +float SVR_HIGHFLAG = 8323072; // Bits 17-23 - these options carry over + +// MOD Options that can only be changed via temp1 console variable +// These affect the spawning functions of monster / items +float SVR_ITEMOFFSET = 256; // Toggle item offset (corner/center) +float SVR_SPRPARTON = 512; // Always use sprite particles (default OFF) +float SVR_PARTICLES = 1024; // Turn ON particle system (default OFF) +float SVR_NOFOGCMDS = 2048; // Disables all fog commands (winquake) +float SVR_DEVHELPER = 4096; // Turn OFF Dev helpers (marks+arrows) + +float SVR_UPDAXE = 8192; // Upgrade Axe, +75% dmg, gib zombies +float SVR_UPDSSG = 16384; // Upgrade Super Shotgun, +50% dmg, uses 3 shells +float SVR_UPDLG = 32768; // Upgrade Lightning Gun, Direct+Splashdamage + +// MOD Options that can be changed via impulse commands (need a map loaded) +// These options will override the temp1 console variable +float SVR_WEATHER = 65536; // Turn OFF All weather systems +float SVR_SHOTGPROJ = 131072; // Turn OFF Shotgun projectiles +float SVR_SHOTGCASE = 262144; // Turn OFF Shotgun casings +float SVR_ZAWARE = 524288; // Turn OFF Z aware monsters +float SVR_FOOTSTEP = 1048576; // Turn OFF Enemy/player footsteps +//float SVR_ = 2097152; // Not used atm +float SVR_LIQDAM = 4194304; // Turn OFF Monster Liquid damage + +//---------------------------------------------------------------------- +float IT_UPGRADE_AXE = 4096; // Shadow Axe, +75% dmg, +gib bodies +float IT_UPGRADE_SSG = 2; // The Widowmaker, +50 dmg, +3 shells +float IT_UPGRADE_LG = 64; // Plasma Gun, direct + splashdamage +float IT_ALLARMOR = 57344;// Test for player grn/yel/red armour + +float IT_CKEY1 = 8192; // Custom Key 1 +float IT_CKEY2 = 16384; // Custom Key 2 +float IT_CKEY3 = 32768; // Custom Key 3 +float IT_CKEY4 = 65536; // Custom Key 4 +float IT_CKEYALL = 122880; // All Custom keys + +float IT_ARTTOME = 524288; // Tome of Power (event trigger) +float IT_ARTSHARP = 1048576; // Reduce SG/SSG/RG spread pattern +float IT_ARTWETSUIT = 2097152; // Underwater Wetsuit + tank 5mins Oxygen +float IT_ARTPIERCE = 4194304; // NG/SNG Nails travel through enemy bodies + +.float powerup_sound; +.float sharpshoot_finished, sharpshoot_time, sharpshooter_sound; +.float nailpiercer_finished, nailpiercer_time, nailpiercer_sound; +.float wetsuit_finished, wetsuit_time, wetsuit_sound; +.float wetsuit_level, wetsuit_bubbles; + +//---------------------------------------------------------------------- +float SKILL_EASY = 0; // Skill level constants +float SKILL_NORMAL = 1; +float SKILL_HARD = 2; +float SKILL_NIGHTMARE = 3; + +float HUD_SECRETS = 2; // Update secrets screen counter +float HUD_MONSTERS = 4; // Update monster screen counter + +float BUFFER_STUFFCMD = 1; // Long float print function (lftos) +float BUFFER_SPRINT = 2; // Defined in subs.soc.qc +float BUFFER_DPRINT = 4; + +//---------------------------------------------------------------------- +float STATE_SETUP = -1; // Setup state (on/off functions) +float STATE_ON = 1; // Stupid idea to have on states as 0 +float STATE_OFF = 2; // Impossible to test for 0 as 'not setup' is 0 + +float ENT_SPNSTATIC = 32; // Will convert entity to static on spawn +float ENT_STARTOFF = 64; // Global spawnflags setting +float ESTATE_BLOCK = 6; // Blocked OFF+DISABLE +float ESTATE_LOWER = 7; // ON+OFF+DISABLE +float ESTATE_ON = 1; // Switch ON +float ESTATE_OFF = 2; // Switch OFF +float ESTATE_DISABLE = 4; // Disabled (blocks toggle) +float ESTATE_RESET = 8; // Reset parameters +float ESTATE_AFRAME = 16; // Changes Aframe only + +float TARGET_BACK = 0; // Behind - 315-45 +float TARGET_LEFT = 1; // Side - 45-135 +float TARGET_FRONT = 2; // Front - 135-225 +float TARGET_RIGHT = 3; // Right - 225-315 + +float SPNMARK_YELLOW = 0; // Error something is broken +float SPNMARK_BLUE = 1; // Delay spawn monster/item +float SPNMARK_GREEN = 2; // Delay spawn mosnter with no counter +float SPNMARK_RED = 3; // Nightmare only spawn +float SPNMARK_PURPLE = 4; // Coop only spawn +float SPNMARK_WHITE = 5; // Not used atm + +//---------------------------------------------------------------------- +// Environmental damage +float LIQUID_TIMER = 1; // Amount of time to check for liquid damage +float MON_MULTIPLIER = 10; // Multiplier for liquid damage against monsters +float WATER_DAMAGE = 2; // water drowning +float WATER_AIR = 12; // time before damage +float LIQUID_DMG = 1; // Base damage from liquid damage +float SLIME_DAMAGE = 4; // Acid burning +float LAVA_DAMAGE = 10; // Getting crispy + +//---------------------------------------------------------------------- +// Footstep types (slow, drag, light, medium, heavy, large, giant) +float FS_TYPESLOW = 1; // Demon, Dogs, Ogres, Zombies +float FS_TYPEDRAG = 2; // Alt Zombie foot +float FS_TYPELIGHT = 3; +float FS_TYPEMEDIUM = 4; +float FS_TYPEHEAVY = 5; // Death/Hell Knight, Drole, Player, Enforcer +float FS_TYPELARGE = 6; // Minotaur, Shambler +float FS_TYPEGIANT = 7; // Golem +float FS_TYPECUSTOM = 9; // Defined/precached by monster +float FS_FLYING = 10; // Exclusion, no happy feet! + +//---------------------------------------------------------------------- +// Monster constant values +float MON_MOVEWALK = 1; // Walking Monster +float MON_MOVEFLY = 2; // Flying Monster +float MON_MOVESWIM = 4; // Swiming Monster +float MON_SIGHTSOUND = 10; // Stop repeating sightsounds +float PAIN_ALWAY = 5; // Always go into a pain animation after this time +float MON_VIEWOFS = 24; // Default view ofset for monsters +float MON_ZMOVEMENT = 8; // Z Movement for flying monsters +float MON_ZTOL = 16; // Z movement tolerance for adjustment +string MON_ONFLR = "TRUE"; // Search string for bodies on the floor +float MON_NOGIBVELOCITY = -1; // Gib system will use minimal velocity +float MON_XYGIBVELOCITY = -2; // Gib system will add more XY velocity +float MON_GIBFOUNTAIN = -3; // Gibs fly up and outwards (fountain) +float MON_GIBEXPLOSION = -4; // Gibs fly upwards with force +float MON_NEVERGIB = -300; // Monster can never be gibbed + +// Used in AI.QC routine for AI distance checks +float MON_RANGE_MELEE = 120; // Melee range +float MON_RANGE_CLOSE = 192; // Close melee range +float MON_RANGE_WAKEUP = 256; // Sight Wakeup range +float MON_RANGE_NEAR = 500; // Near range +float MON_RANGE_MID = 1000; // Mid range +float MON_MAX_RANGE = 1000; // Max range (realistic) +float MON_STEPRANGE = 100; // Step points for range chance +float MONAI_MDLHEIGHT = 24; // Offset height of monsters from floor +float MONAI_STEPHEIGHT = 16; // Maximum step height +float MONAI_STEPLARGE = 32; // large height distance, flight of steps? +float MONAI_ABOVEMELEE = 120; // Always be high above enemies inside this distance +float MONAI_ABOVEDIST = 128; // Distance to maintain above enemytarget +float MONAI_ABOVETIMER = 2; // Amount of time before changing Z +float MONAI_TURRETMODE = 0.3; // Percentage change of attack in turret mode + +float MON_IDLE_SOUND = 0.2; // random chance of idle sound +float MON_IDLE_ANIMATION = 0.2; // random chance of idle animation + +//---------------------------------------------------------------------- +// Generic options +float MON_AMBUSH = 1; // Ambush (will only wakeup if see the player) +float MON_SPAWN_NOSIGHT = 8; // No wakeup sight sound +float MON_SPAWN_NOIDLE = 16; // no idle sounds (cupboard monster) +float MON_SPAWN_NOGFX = 32; // no spawn effect or sound +float MON_SPAWN_DELAY = 64; // Trigger spawn DELAY +float MON_SPAWN_ANGRY = 128; // Trigger spawn ANGRY +float MON_GHOST_ONLY = 4096; // Design for any ghost like monster +float MON_POINT_KNIGHT = 8192; // Pointy Electricity Knight + +//---------------------------------------------------------------------- +// Unique options +float MON_HOGRE_METAL = 4; // Metal Skin version +HP +float MON_HOGRE_METUPG = 50; // Extra health for metal upgrade +float MON_OGRE_NAIL = 2; // Fires Nails instead of grenades +float MON_OGRE_GREEN = 4; // Green Skin version +HP +float MON_OGRE_GRNUPG = 50; // Extra health for green upgrade +float MON_FREDDIE_LASER = 2; // Fires laser instead of nails +float MON_SPIDER_LARGE = 2; // Large green spitting version +float MON_SPIDER_CEILING = 4; // Spider starts on the ceiling +float MON_VORELING_LARGE = 2; // Large purple spitting version +float MON_VORELING_CEILING = 4; // Voreling starts on the ceiling +float MON_SWAMPLING_LARGE = 2; // Large Green spitting version +float MON_SWAMPLING_CEILING = 4; // Swampling starts on the ceiling +float MON_GARGOYLE_PERCH = 4; // Start in perched position +float MON_GAUNT_PERCH = 4; // Start in perched position +float MON_BOIL_HANGING = 2; // Hanging on wall upside down by spikes +float MON_BOIL_HOBBLED = 4; // Hobbled on the floor, random A/B position +float MON_SEEK_SHIELD = 4; // Shield mode until triggered +float MON_SENTINEL_NAIL = 4; // Red nail firing sentinels (quoth) +float MON_CHTHON_RED = 2; // New red skin + fire balls +float MON_CHTHON_GREEN = 4; // Green skin + Slime balls +float MON_SHUB_DMGTRIG = 2; // Can be triggered with damage +float MON_SHUB_UPSIDE = 4; // Setup upside (ceiling pose) +float MON_NOUR_BOSS = 2; // Boss version (with waves+minions) +float MON_BOGL_STRONG = 2; // Stronger +HP and skin 2 +float MON_DCROSSSNIPER = 2; // No max range limitations for enemies +float MON_DCROSSTRACK = 4; // Enable tracking for crossbow knights +float MON_ELF_MAGIC = 2; // Magic range attack (+HP) +float MON_RAINDEER_DEAD = 2; // Dead body sacrifice +float MON_SANTA_GOOD = 2; // Good Santa with touch trigger + +// Underwater enemies (liquid block option for all of them) +float MON_LIQUIDBLOCK = 4; // Liquids block sightlines (fish/eel) +float MON_FISH_SMALL = 2; // Smaller and faster fish! + +// Minion spawner options +float MON_MINOTAUR_MINIONS = 4; // Allow the Minotaur to spawn gargoyles +float MON_SHALRATH_MINIONS = 4; // Allow the Shalrath to spawn vorlings +float MON_SKULLWIZ_GUARDIAN = 2; // Special version guarding the runes +float MON_SKULLWIZ_MINIONS = 4; // Allow the Skull Wizard to spawn skulls +float MON_WRAITH_SCORPIONS = 2; // Allow the wraith to spawn scorpions +float MON_WRAITH_SPIDERS = 4; // Allow the wraith to spawn spiders + +float MON_JIM_ROCKET = 4; // Rocket version of Jim the Robot +float MON_SCORPION_STINGER = 4; // Black stinger scorpion (debuff) +float MON_TARBYLESSJUMP = 4; // Will not constantly jump around +float MON_WIZARD_ABOVE = 4; // Wizard will float above enemy +float MON_GOLEM_MELEEONLY = 4; // Golems only do melee + stomp + +// Statue/Zombie options +float MON_CRUCIFIED = 2; // Zombies - start in crucified position +float MON_STATUE = 2; // Will start frozen with stone skin +float MON_NOTFROZEN = 4; // Will not start frozen (works with statues) +float MON_ONFLOOR = 4; // Zombies - start lying on the floor + +// Zombie hacks +float MON_ZOMCRUCIFIED = 1; // Zombies - crucified +float MON_ZOMBAMBUSH = 2; // Zombies - Ambush (ID hack) +float MON_ZOMIDHACK = 3; // Used to switch ID hack around + +//---------------------------------------------------------------------- +// Player +float RANGE_PLAYAXE = 72; // Distance for fire axe (player) +float RANGE_CHOPAXE = 64; // Player distance to chop up bodies +float DAMAGE_PLAYAXE1 = 20; // Default axe damage +float DAMAGE_PLAYAXE2 = 35; // Enhanced axe damage + +//---------------------------------------------------------------------- +// Weapon damage and parameters +float SPEED_PLAYAIM = 10000; // Player auto aim distance +float SPEED_PLAYERSG = 2000; // Player speed for SG +float SPEED_PLAYERSSG = 1500; // Player speed for SSG/Upgrade +float SPEED_MONSG = 800; // Monster speed for SG +float SPEED_MONSGMULT = 150; // 800=easy, 950=normal, 1100=hard, 1250=nm +float QUANTITY_SG = 6; // SG - Shotgun +float QUANTITY_SSG = 14; // SSG - Super Shotgun +float QUANTITY_WM = 21; // WM - Widow Maker +float QUANTITY_GRUNT = 4; // Soldier +float QUANTITY_DEFENDER = 10; // Defender +vector SPREAD_SG = '0.04 0.04 0'; // Narrow and square spread +vector SPREAD_SG2 = '0.01 0.01 0'; // Sharpshooter version +vector SPREAD_SSG = '0.14 0.08 0'; // Wide and short SSG spread +vector SPREAD_SSG2 = '0.04 0.04 0'; // Sharpshooter version +vector SPREAD_GRUNT = '0.1 0.1 0'; // Solider version (very narrow) +vector SPREAD_DEF = '0.18 0.1 0'; // Defender version (really wide) +float DAMAGE_SHELL = 4; // Single Shotgun Shell (hitscan) +float DAMAGE_PSHELL = 4; // Single Shotgun Shell (projectile) +float DAMAGE_PTSHELL = 4; // Dead center tracer shell (proj only) +float LIFE_SHELLS = 6; // Lifetime before being removed + +float SPEED_PLAYSPIKE = 1000; // Player speed for Spikes +float SPEED_TRAPSPIKE = 500; // Trap shooters +float SPEED_HKSPIKE = 200; // Hell Knight (def=300) +float SPEED_HKSKILL = 50; // 200=easy, 250=normal, 300=hard, 350=nm +float SPEED_WIZSPIKE = 500; // Wizards (def=600) +float SPEED_WIZSKILL = 50; // 500=easy, 550=normal, 600=hard, 650=nm +float SPEED_SPIDER = 600; // Large Spiders (acid spit) +float SPEED_VORELING = 600; // Large Voreling (purple spit) +float SPEED_SWAMPLING = 600; // Large Swamping (poison spit) +float SPEED_BLORD = 600; // Boglord (acid spit) +float SPEED_ELF = 600; // Dark Elf (snowballs) +float SPEED_LAVABALL = 250; // Boss Lava balls +float SPEED_LAVASKILL = 50; // Lava ball skill upgrade + +float SPEED_RLPLAYER = 1000; // Player rocket speed +float SPEED_PLAYGRENADE = 600; // Player speed for Grenades +float SPEED_MONGRENADE = 500; // Ogre grenade speed (org 600) +float SPEED_MONGLSKILL = 50; // 500=easy, 550=normal, 600=hard, 650=nm +float SPEED_ZOMBFLESH = 550; // Zombie flesh speed (org 600) +float SPEED_ZOMBIESKILL = 25; // 550=easy, 575=normal, 600=hard, 625=nm + +float SPEED_PLAYPLASMA = 900; // Player speed for Plasma +float SPEED_REFLECTION = 600; // Reflection speed for Plasma/Lightning +float SPEED_LASER = 600; // Enforcer laser speed +float SPEED_PLASMA = 600; // Eliminator plasma speed +float SPEED_JIMPROJ = 575; // Crazy flying jim robot laz0r/rockets!? +float SPEED_JIMPROJSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 +float SPEED_SENTPROJ = 575; // Crazy flying jim robot laz0r/rockets!? +float SPEED_SENTPROJSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 + +float SPEED_DGQFB = 700; // Chainmail Hell Knight from Quoth +float SPEED_DGQFBSKILL = 100; // 700=easy, 800=normal, 900=hard, nm=1000 + +float SPEED_SEEKROCK = 575; // Large UV ugly robot from rrp +float SPEED_SEEKROCKSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 +float SPEED_SEEKLAZ = 400; // Base speed of Laser attacks +float SPEED_SEEKLAZSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_RAINDROCK = 575; // Mobile xmas meat wagaon +float SPEED_RAINDROCKSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 + +float SPEED_DFURYSPIKE = 400; // Base speed of Fury attack A/B +float SPEED_DFURYSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_DLORDMISSILE = 650; // Death lord ball attack +float SPEED_DLORDSKILL = 100; // 550=easy, 650=normal, 750=hard, 850=nm +float MONAI_DLORDMAX = 30; // Maximum amount of projectiles to fire + +float SPEED_NOURSPIKE = 600; // Base speed of Nour attack A/B +float SPEED_NOURSKILL = 200; // 600=easy, 800=normal, 1000=hard, 1200=nm +float SPEED_NOURBOMB = 600; // Grenade bounce speed (no skill change) + +float SPEED_GARGMISSILE = 500; // Gargoyle fireball attack +float SPEED_GARGSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_SWIZMISSILE = 525; // Skull wizard SKULL attack +float SPEED_SWIZSKILL = 75; // 525=easy, 600=normal, 675=hard, 750=nm +float DAMAGE_SWIZPOISON = 30; // Direct damage from Poison Rocket + +float SPEED_MINOBOLT = 500; // Minotaur plasma bolt speed +float SPEED_MINOSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_GAUNTBOLT = 500; // Gaunt plasma bolt speed +float SPEED_GAUNTSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm +float SPEED_EELBOLT = 300; // Eel plasma bolt speed +float SPEED_EELSKILL = 100; // 300=easy, 400=normal, 500=hard, 600=nm + +float SPEED_SANTAPROJ = 600; // Santa snowball attack +float SPEED_SANTASKILL = 200; // 600=easy, 800=normal, 1000=hard, 1200=nm +float MONAI_SANTAMAX = 30; // Maximum amount of projectiles to fire + +float SPEED_FREDDIEPROJ = 500; // Freddie spike/laser bolt speed +float SPEED_FREDDIESKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_NAILOGREPROJ = 500; // Nail Ogre spike speed +float SPEED_NAILOGRESKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_NAILSNOWMPROJ = 500; // Snowman Nail spike speed +float SPEED_NAILSNOWMSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_SHALMISSILE = 200; // Shalrath intial speed of homing missile +float SPEED_SHALSKILL = 25; // 200=easy, 225=normal, 250=hard, 275=nm +float SPEED_SERGMISSILE = 200; // Death Sergeant homing missile initial speed +float SPEED_SERGSKILL = 20; // 200=easy, 220=normal, 240=hard, 260=nm + +float SPEED_SCORPTAIL = 400; // Scorpion Tail Swipe (large arc infront) +float SPEED_SCORPSKILL = 100; // 400=easy, 500=normal, 600=hard, 700=nm + +float SPEED_GOLEMSPIKE = 400; // Base speed of Golem Rock storm attacks +float SPEED_GOLEMSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_EIDOROCK = 400; // Base speed of Eidolon boulder attack +float SPEED_EIDOSKILL = 150; // 400=easy, 550=normal, 700=hard, 850=nm +float SPEED_EIDOSPIKE = 400; // Base speed of Eidolon rock storm attacks +float SPEED_EIDOSKILLSP = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_ICEGSHARD = 600; // Base speed for Ice Golem Shard attack +float SPEED_ICEGSKILL = 200; // 600=easy, 800=normal, 1000=hard, 1200=nm + +float SPEED_BLORDBALL = 400; // Base speed of Bog Lord melee balls +float SPEED_BLORDSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm +float SPEED_BLORDBOLT = 600; // Base speed of Bog Lord bolts + // 600=easy, 825=normal, 1025=hard, 1275=nm + +float LIFE_PROJECTILE = 6; // Lifetime before being removed +float LIFE_ROCKET = 5; // Disappear in a puff of smoke! +float LIFE_GRENADE = 2.5; // Bounce, bounce, explode +float LIFE_EGG = 1.5; // Very quick egg hatch! +float LIFE_FLESH = 2.5; // Life of zombie flesh + +float DAMAGE_NGREFSPIKE = 4; // Reflected Spike for NG +float DAMAGE_NGSPIKE = 9; // Single Spike for NG +float DAMAGE_SNGSPIKE = 18; // Single Spike for SNG +float DAMAGE_PLAYGRENADE = 120; // Direct damage from player grenade +float DAMAGE_MONGRENADE = 40; // Toned down grenade damage +float DAMAGE_MONROCKET = 40; // Toned down rocket damage + +float ELEV_ZAXIS = 200; // Standard default Z axis adjustment +float ELEV_DEFAULT = 30; // Zaware default elevation if range too far +vector ELEV_VIEW_OFS = '0 0 12'; // Zaware target adjustment +vector ELEV_SPID_OFS = '0 0 -16'; // Hit low + +vector DAMAGE_RLPLAYER = '100 20 120'; // Base + Random, Splash +vector DAMAGE_RLFURY = '20 0 20'; // Fury rockets - Equal Direct/Radius +vector DAMAGE_RLGARG = '20 10 30'; // Gargoyle rocket, very weak dmg +vector DAMAGE_RLSKULLW = '30 10 20'; // Skull wizard, high direct, low splash +vector DAMAGE_RLWRAITH = '100 20 0'; // Wraith hitscan bolt against monsters +vector DAMAGE_RLDROLE = '40 10 80'; // High splash damage, low direct +vector DAMAGE_RLARMY = '25 5 45'; // Weak direct, high splash +vector DAMAGE_RLJIM2 = '25 15 25'; // Weak direct, med splash +vector DAMAGE_RLDGUARDQ = '25 0 40'; // Weak direct, high splash +vector DAMAGE_RLSEEKER = '25 15 25'; // Weak direct, med splash +vector DAMAGE_RLRAINDEER = '20 0 20'; // Weak direct, low splash +vector DAMAGE_RLFIRETOP = '70 0 20'; // High direct, low splash +vector DAMAGE_RLEIDO = '25 15 25'; // Eidolon Rock - med damage +vector DAMAGE_RLICEG = '20 0 20'; // Ice Golem shard - fury damage +vector DAMAGE_RLBLORD = '20 10 30'; // Bog Lord Slime - High Splashdamage +vector DAMAGE_RLKILLZOM = '120 0 0'; // Direct Damage to kill zombie + +vector DAMAGE_PLASMA = '15 5 20'; // Default plasma (very high) +vector DAMAGE_PGPLAYER = '45 0 20'; // Player plasma (very high) +vector DAMAGE_PGREFLECT = '15 0 0'; // Plasma reflection (very low) +vector DAMAGE_PGMINOTAUR = '10 5 10'; // Lower damage for minotaur +vector DAMAGE_PGGAUNT = '10 5 10'; // Lower damage for gaunt +vector DAMAGE_PGNOUR = '10 0 0'; // Direct damage only + +float DAMAGE_LGPLAYER = 30; // Player Lightning gun (per 0.1s) +float DAMAGE_LASER = 15; // Lasers! (traps AND enforcers) +float DAMAGE_BOGLORD = 20; // Very high and fast damage +float DAMAGE_BOBLASER = 5; // Weak laser (x + random()*x) 5-10dmg +float DAMAGE_FLESH = 10; // Flesh from zombies +float DAMAGE_ZOMBIECLASS = 120; // Instant death to any zombie class + +float SPEED_WRAITHBONE = 400; // Wraith Nail Storm (large arc infront) +float SPEED_WBONESKILL = 100; // 400=easy, 500=normal, 600=hard, 700=nm +float DAMGE_WRAITHBOLT = 10; // Biosuit protection from debuff, base dmg +float DAMAGE_PYROWRAITH = 20; // Damage from Wraith flame bolt +float DAMAGE_WRAITH = 120; // Explosive damage from wraiths (org=80) + +float SPEED_PYROFLAME = 250; // Base speed of flames +float SPEED_PYROSKILL = 50; // 250=easy, 300=normal, 350=hard, 400=nm +float DAMAGE_PYROFLAME = 4; // Damage from each pyro flame +float DAMAGE_MONFLAME = 20; // Damage to any monster +float DAMAGE_FUMPOISON = 2; // Damage from each fumigator burst + +// Both crossbow and fury projectiles need to cap at 1100 for NM skill +// Otherwise they are close to impossible to avoid due to spread pattern +float SPEED_DCROSS = 500; // Base speed of projectile bolts +float SPEED_BOLTSKILL = 200; // 500=easy, 700=normal, 900=hard, 1100=nm +float DAMAGE_BOLT0 = 5; // Bolt damge against crossbow knights only +float DAMAGE_BOLT1 = 15; // High damage hot red bolts! + +float DAMAGE_TARBABY = 120; // Explosive damage from tarbies +float DAMAGE_BOIL = 75; // Explosive damage from boil +float DAMAGE_NOUR = 50; // Explosive damage from Nouronihar +float DAMAGE_SEEKER = 50; // Explosive damage from seeker +float DAMAGE_FREDDIE = 40; // Explosive damage from Freddie +float DAMAGE_RAINDEER = 20; // Explosive damage from raindeer +float DAMAGE_SNOWMAN = 40; // Explosive damage from Snowman + +float SPEED_LOSTSTART = 400; // Initial charging speed +float SPEED_LOSTCHARGE = 50; // Charging speed multiplier +float SPEED_LOSTMAX = 800; // Charging Maximum speed +float DAMAGE_LOSTSOUL = 40; // Explosive damage from lost soul +float DAMAGE_LOSTCHARGE = 10; // Charging damage for lost soul + +//---------------------------------------------------------------------- +// Generic melee/jump attack distances +float MONAI_MELEEFRONT = 70; // Front attacks reach further (original = 60) +float MONAI_MELEESIDE = 60; // Side attacks less distance +float MONAI_MELEEZAXIS = 48; // Z axis range for melee attack +float MONAI_CHARGEZAXIS = 20; // Maximum height for knight charge attack +float MONAI_RANGESUMMON = 128; // High close to block summoning minion + +// Various monsters +float MONAI_MELEEKNIGHT = 80; // Knight and DKnight sword range +float MONAI_MELEEOGRE = 100; // Ogre chainsaw got a long range +float MONAI_MELEEBLUNTOGRE = 120; // Ogre hammer/mace very long range +float MONAI_MELEEOGREHAM = 250; // Ogre Special Hammer with knockback +float MONAI_MELEESHAM = 100; // Shambler smash claw attack range +float MONAI_SHAMRANGE = 600; // Range of Shambler lightning +float MONAI_MELEEGUG = 170; // Really long arm reach attack range +float MONAI_BOGLORDMELEE = 200; // over arm slime ball attack +float MONAI_BOGLORDRANGE = 400; // Inside range for intense melee +float MONAI_MELEESPAWN = 80; // Jump in-the-face range +float MONAI_MELEEFISH = 60; // Distance for fish bite +float MONAI_RANGEARMYR = 64; // Too close range for army rocket +float MONAI_RANGEDEFSSG = 100; // Close range for SSG Defender +float MONAI_RANGEPYRO = 80; // Pyro flame melee range +float MONAI_RANGEDEFGL = 256; // Far range for GL Defender +float MONAI_GARGHEIGHT = 96; // Try to maintain this height above enemies +float MONAI_MELEEDROLE1 = 90; // Long arm reach on drole claws +float MONAI_MELEEDROLE2 = 150; // Inside range for a second claw swipe +float MONAI_RANGEDROLE = 300; // pre-rage distance to maintain +float MONAI_MELEEFREDDIE = 100; // Ogre Freddie blade got a long range +float MONAI_RANGEFREDDIE = 300; // Inside range for stand and fire +float MONAI_MELEEMINOTAUR = 100; // Large long range minotaur claws +float MONAI_RANGEMINOTAUR = 300; // pre-rage distance to maintain +float MONAI_RANGESHAL = 400; // Distance to keep minion spawners at +float MONAI_RANGESHAL2 = 300; // Too close, move away from enemy +float MONAI_MELEESKULLW = 192; // Too close, teleport away +float MONAI_RANGESKULLW = 256; // Distance to be after teleport +float MONAI_MELEEGOLEM = 100; // Golem punch/pound attack range +float MONAI_GOLEMRANGE = 200; // How close for golem stomp attack +float MONAI_LOSTTIMER = 15; // How long a lost soul will stay lost +float MONAI_MELEEBOIL = 80; // Exploding boil trigger range +float MONAI_HOBBLEBOIL = 120; // Exploding range for hobble version +float MONAI_MELEEDGUARDQ = 100; // Long range for Death Guard swing +float MONAI_CHARGEDGARDQ1 = 140; // Min range for charge attack +float MONAI_CHARGEDGARDQ2 = 190; // Max range for charge attack +float MONAI_RANGEDGARDQ = 300; // Max range for fireball attack +float MONAI_RANGEDLORD = 200; // Range for switching magic attacks + +float MONAI_JUMPTIMEOUT = 2; // Time between jumps +float MONAI_RUNPAUSE = 128; // If enemy this close, stop pause and run! + +// Dog +float MONAI_MELEEDOG = 80; // Distance for dog bite +float MONAI_JUMPDOGNEAR = 80; // DOG Jump attack distance ranges +float MONAI_JUMPDOGFAR = 150; + +// Spider / Voreling / Swampling / Scorpion / Lost Soul +float MONAI_MELEESPIDER = 60; // Distance for spider bite +float MONAI_JUMPSPIDERNEAR = 80; // SPIDER Jump attack ranges +float MONAI_JUMPSPIDERFAR = 200; +float MONAI_JUMPSPIDERDIST = 400; // Forward distance modifier +float MONAI_MELEEVORELING = 60; // Distance for voreling bite +float MONAI_JUMPVORELINGNEAR = 80; // VORELING Jump attack ranges +float MONAI_JUMPVORELINGFAR = 200; +float MONAI_JUMPVORELINGDIST = 500; // Forward distance modifier +float MONAI_MELEESWAMPLING = 60; // Distance for swampling bite +float MONAI_JUMPSWAMPLINGNEAR = 80; // SWAMPLING Jump attack ranges +float MONAI_JUMPSWAMPLINGFAR = 200; +float MONAI_JUMPSWAMPLINGDIST = 500;// Forward distance modifier +float MONAI_MELEELOSTSOUL = 80; // Distance for Lost Soul bite +float MONAI_RANGELOSTNEAR = 200; // Too close for charge attack +float MONAI_RANGELOSTFAR = 400; // Too far for charge attack + +// Scorpions +float MONAI_JUMPSCORPTIME = 1; // Special timer for scorpion +float MONAI_MELEESCORPION = 80; // Distance for scorpion claws +float MONAI_JUMPSCORPNEAR = 80; // SCORPION Jump attack ranges +float MONAI_JUMPSCORPFAR = 300; // long jump distance! + +// Demon1 +float MONAI_MELEEDEMON = 80; // Distance for demon claws +float MONAI_JUMPDEMONNEAR = 100; // DEMON Jump attack distance ranges +float MONAI_JUMPDEMONFAR = 200; +float MONAI_JUMPDEMONCHECK = 128; // Ceiling height check for jumping demons + +// Zombie Knight +float MONAI_JUMPZOMBTIME = 2; // Time before next jump attack +float MONAI_JUMPZKNEAR = 100; // Near range for a zombie knight jump +float MONAI_JUMPZKFAR = 160; // Far range for zombie knight + +// Sergeant +float MONAI_JUMPSERGTIME = 2; // Time before next jump attack +float MONAI_JUMPSERGNEAR = 100; // SERG jump attack distance +float MONAI_JUMPSERGFAR = 250; +float MONAI_CHARGEFLAIL = 350; // Flail Knight charging distance + +// Fury Knight +float MONAI_JUMPFURYTIME = 2; // Time before next jump attack +float MONAI_JUMPFURYNEAR = 150; // FURY jump attack distance +float MONAI_JUMPFURYFAR = 350; + +// Minotaur +float MONAI_JUMPMINOTIME = 2; // Time before next jump attack +float MONAI_JUMPMINONEAR = 150; // MINOTAUR jump attack distance +float MONAI_JUMPMINOFAR = 300; + +// Seeker +float MONAI_MELEESEEKER = 80; // Long arm reach on Seeker +float MONAI_MELRAGESEEKER = 150; // Range for melee attack +float MONAI_RANGESWSEEKER = 300; // Switch between rockets and lasers + +// Skull wizard starting state +float MONAI_SKULLWSOLID = 1; // Regular spawn state +float MONAI_SKULLWINVIS = 2; // Invisible + +// Hunter Ogre - Chainsaw +float MONAI_JUMPHOGRETIME = 5; // Time before next jump attack +float MONAI_JUMPHOGRENEAR = 200; // Hunter Ogre jump attack distance +float MONAI_JUMPHOGREFAR = 300; + +// Xmas monsters +float MONAI_MELEERAINDEER = 80; // Medium range attack +float MONAI_MELEEELF = 60; // Distance for elf melee +float MONAI_JUMPELFNEAR = 80; // ELF Jump attack ranges +float MONAI_JUMPELFFAR = 200; // (Based on spiders) +float MONAI_JUMPELFDIST = 400; // Forward distance modifier +float MONAI_MELEESNOWMAN = 80; // Standing still attack +float MONAI_MELEESANTA = 100; // Large Sack attack + +// Shockwave floor attacks +vector MONAI_STOMPIMPACT = '12 8 -22'; +float MONAI_STOMPDAMAGE = 30; // Impact damage +float MONAI_STOMPRADIUS = 512; // Radius of foot stomp attack +float MONAI_STOMPFORWARD = 300; // Forward momentum +float MONAI_STOMPUP = 600; // Vertical momentum + +vector MONAI_HAMMERIMPACT = '56 0 -22'; +float MONAI_HAMMERDAMAGE = 30; // Impaxct damage +float MONAI_HAMMERRADIUS = 512; // Radius of hammer slam attack +float MONAI_HAMMERFORWARD = 300; // Forward momentum +float MONAI_HAMMERUP = 500; // Vertical momentum + +float MONAI_IMPACTZAXIS = 128; // Above/below limit on affect + +// Boss Nour +float MONAI_MELEENOUR = 192; // Always attack player +float MONAI_CLOSENOUR = 400; // Close distance spit/bomb +float MONAI_MAXNOUR = 325; // Maximum tether range + +// Boss Eidolon +float MONAI_SPAWNEIDO = 80; // Close to spawn location +float MONAI_CLOSEEIDO = 192; // Always attack player +float MONAI_MEDIUMEIDO = 384; // Good distance for boulder +float MONAI_MAXEIDO = 448; // Maximum tether range + +// Boss Ice Golem +float MONAI_MELEEICEG = 128; // Always attack with melee +float MONAI_MAXICEG = 400; // Maximum tether range +float MONAI_STOMPICEG = 400; // How close for stomp attack +float MONAI_STOMPICERADIUS = 640; // Radius of foot stomp attack + +//====================================================================== +// Unique Class Groups for quicker searches (mostly items) +// Previous system used classname (slow string search) +//====================================================================== +float CG_PLAYERS = 50; // All player/clients +float CG_HEALTH = 100; // All health pack types (15/25/+100) +float CG_AMMOITEM = 200; // All ammo items/packs +float CG_PROJALL = 205; // All monster projectiles +float CG_PROJSHELLS = 210; // To help with combining shell damage +float CG_PROJNAILS = 220; // Testing ammo resistance in t_damage +float CG_PROJROCKETS = 230; +float CG_PROJCELLS = 240; +float CG_MINIONEGG = 245; // Special minion eggs +float CG_WEAPON = 250; // All weapon items +float CG_ARMOR = 275; // All armor types +float CG_KEY = 300; // All keys (gold/silver/custom) +float CG_RUNE = 310; // All runes 1-4 +float CG_ARTIFACT = 350; // All powerups +float CG_TRAPS = 400; // Endless supply of traps! +float CG_MISCENT = 410; // All misc entity types +float CG_TEMPENT = 420; // All temporary types (gibs, smoke, sparks) +float CG_BREAKABLE = 430; // All breakable types +float CG_FUNCMOVER = 450; // All FUNC movers +float CG_MONSTERS = 500; // Default + +//---------------------------------------------------------------------- +// Useful for infighting grouping checks +//---------------------------------------------------------------------- +float CG_ARMY = 600; // (4) Shotgun, Rocket Launcher and Plasma +float CG_ENFORCER = 610; // (5) Standard, Grenade and Flame, Pyro, Centurion +float CG_DEMON = 615; // (3) Demon, Drole, Minotaur, Boglord +float CG_DOG = 620; // (1) Dog +float CG_FISH = 625; // (2) Fish +float CG_ROBOT = 630; // (2) Jim, Laser/Rocket, Seeker +float CG_KNIGHT = 635; // (3) Knight, Death Guard and Crossbow +float CG_DKNIGHT = 637; // (2) Hell and Death Knight +float CG_DCAPTAIN = 640; // (2) Fury, Sergeant Captains +float CG_STONE = 645; // (4) Boss Eidolon, Statues and Golem +float CG_OGRE = 650; // (4) Vanilla and Hunter (Chainsaw, Mace, Hammer), Freddie +float CG_SPIDER = 660; // (4) Shalrath, Vorling, Wraith, Spider +float CG_SHAM = 666; // (1) Shambler +float CG_SPAWN = 670; // (2) Blue/Green, Boil +float CG_WIZARD = 675; // (6) Wizard, Gargoyle, Gaunt, Skull Wizard, Skull, Nour +float CG_XMAS = 680; // (3) Elf, Raindeer, Snowman, Santa +float CG_ZOMBIE = 685; // (3) Zombie, Knight, Mummy +float CG_BOSS = 690; // (3) Cthon, Old one + +//====================================================================== +// Unique Class Types for quicker entity searches +// Previous system used classname (slow string search) +//====================================================================== +float CT_WORLD = 1; // World entity +float CT_PLAYER = 7; // Player (007) + +float CT_SPAWNSP = 10; // Spawn location - Single Player +float CT_SPAWNCOOP = 11; // Spawn location - Coop +float CT_SPAWNDM = 12; // Spawn location - Deathmatch +float CT_CONTROL = 15; // Controller entity +float CT_CAMERA = 16; // Camera entity (info_intermission) + +float CT_LIGHT = 20; // Light entity +float CT_SOUNDEMITTER = 22; // Sound emitter +float CT_DEVMARKER = 24; // Developer model marker +float CT_PATHCORNER = 26; // Standard path nodes + +float CT_ENEMYTARGET = 30; // Target enemy for flying enemies +float CT_ATTACHMENT = 32; // Attachment for entities +float CT_ESTATE = 34; // Entity state modifier +float CT_MAPVAR = 35; // Map Variable logic + +float CT_PARTICLE = 40; // A particle +float CT_PARTICLEEMIT = 41; // A particle emitter +float CT_PARTICLECONT = 42; // Particle controller (setup particle banks) +float CT_PARTICLETEMP = 45; // Particle emitter template + +float CT_TEMPGIB = 50; // Temporary entity (gib) +float CT_TEMPSPARK = 52; // Temporary entity (spark) +float CT_TEMPSTREAM = 54; // Temporary entity (stream) + +float CT_REFLECTLIGHT = 55; // Reflection entity (Lightning) +float CT_REFLECTPLASMA = 56; // Reflection entity (Plasma) + +float CT_STORYCONTROL = 60; // Controller for story system +float CT_STORYBOOK = 62; // Story book for the player +float CT_STORYCHAPTER = 64; // Story chapter for story system + +float CT_TARGETDUMMY = 90; // Misc target dummy +float CT_TARGETNUMBER = 95; // Misc number drawn ingame + +//---------------------------------------------------------------------- +// Class Types for all monsters +//---------------------------------------------------------------------- +float CT_MONARMY = 100; // Army Soldier +float CT_MONENFORCER = 110; // Enforcer +float CT_MONDEMON = 115; // 2 clawed fiend +float CT_MONDOG = 120; // 4 legged friend +float CT_MONFISH = 125; // Fish fish fishy +float CT_MONHELLK = 130; // Strong spikey Knights +float CT_MONKNIGHT = 140; // Small metal Knights +float CT_MONOGRE = 150; // Chainsaw wielding manics +float CT_MONOGREFISH = 155; // Madfox fishing ogre +float CT_MONSHAL = 160; // Shalrath / Vore +float CT_MONSHAM = 165; // Shambler +float CT_MONBOGLORD = 166; // Lord of the Bog! (Big shammy) +float CT_MONSPAWN = 170; // Bouncing annoying shit! +float CT_MONWIZARD = 180; // Wizard / Scrags +float CT_CACHEWIZARD = 181; // Special entity for precache of assets +float CT_MINIONWIZARD = 182; // Minion Spawning version for Nour Boss +float CT_MONZOMBIE = 185; // Rotten flesh + +float CT_MONIDCHTHON = 190; // ID Software Chthon +float CT_MONXXCHTHON = 191; // Mapper Custom Chthon +float CT_MONFIRETOP = 192; // Firetop Mountain Chthon +float CT_MONIDSHUB = 195; // ID Software Shub-Niggurath +float CT_MONXXSHUB = 196; // Mapper Custom Shub-Niggurath + +// New Medieval series (lunaran) +float CT_MONZOMBIEK = 186; // Undead Knights +float CT_MONNOUR = 197; // Nour Boss + +// New (death) Knight series (sock/necros) +float CT_MONDGUARD = 200; // HD Knight (Guard) +float CT_MONDCROSS = 205; // HD Knight (Crossbow) +float CT_MONDFURY = 210; // HD Knight (Fury) +float CT_MONDBLOOD = 215; // HD Hell Knight (Blood) +float CT_MONDKNIGHT = 220; // HD Hell Knight (Death) +float CT_MONDSERG = 225; // HD Hell Knight (Sergeant) +float CT_MONCOMM = 230; // HD Hell Knight (Commander) + +// New (hunter) Ogre series (sock/necros) +float CT_MONHOGRE = 250; // HD Ogre (Chainsaw) +float CT_MONHOGREMAC = 255; // HD Ogre (Mace) +float CT_MONHOGREHAM = 260; // HD Ogre (Hammer) + +// New base monster series (Inspired by lunaran/Quoth) +float CT_MONARMYROCKET = 270; // Army Soldier (Rocket) +float CT_MONARMYGRENADE = 272; // Army Soldier (Grenade) +float CT_MONARMYPLASMA = 275; // Army Soldier (Plasma) +float CT_MONDEFENDER = 280; // Enforcer SSG/GL (Defender) +float CT_MONELIMATOR = 285; // Enforcer Plasma (Eliminator) + +// Hexen 2 series (Raven Software) +float CT_MONSPIDER = 300; // Spiders (brown/green versions) +float CT_CACHESPIDER = 302; // Special entity for precache of assets +float CT_MINIONSPIDER = 304; // Minion Spawning version from wraith +float CT_MONSCORPION = 310; // Deadly Scorpion (HL Black Crab!) +float CT_CACHESCORPION = 312; // Special entity for precache of assets +float CT_MINIONSCORPION = 314; // Minion Spawning version from wraith +float CT_MONLOSTSOUL = 315; // The Original Doom flying lost soul +float CT_CACHELOSTSOUL = 317; // Special entity for precache of assets +float CT_MINIONLOSTSOUL = 319; // Minion Spawning version from skullwizard +float CT_MONSKULLW = 320; // Creepy Skull Wizard (Teleport) +float CT_MONGARGOYLE = 325; // Flying Gargoyle (Flying fireball) +float CT_CACHEGARGOYLE = 327; // Special entity for precache of assets +float CT_MINIONGARGOYLE = 329; // Minion Spawning version from minotaur +float CT_MONGOLEM = 330; // Giant stone Golem (ground slam) +float CT_MONICEGOLEM = 335; // Giant Ice Golem (shards+ground slam) +float CT_MONICEGOLEMWAVE = 337; // Wave targets for boss Ice Golem +float CT_MONMINOTAUR = 340; // Large tank like bull (magic/charge) +float CT_MONEIDOLON = 345; // Large demon boss Eidolon +float CT_MONEIDOLONWAVE = 347; // Wave targets for boss Eidolon + +// Quake Expansion Packs (Rogue Software) +float CT_MONWRAITH = 350; // Undead wraith (Burning debuff) +float CT_MONMUMMY = 355; // Undead mummy (Poison debuff) +float CT_MONEEL = 357; // Plasma bolt spewing eel + +// RMQ MOD(Ijed/?) +float CT_MONBOIL = 360; // Slow moving zombie bomb +float CT_MONSEEKER = 362; // Robot replacement for Shambler + +// Twisted Xmas MOD (Twisted Matrix) +float CT_MONELF = 365; // Little melee (knight) +float CT_MONRAINDEER = 366; // Rocket wielding stag (ogre) +float CT_MONSNOWMAN = 367; // Quick firing turret +float CT_MONSANTA = 369; // Good/bad santa (boss) + +// Quoth MOD (Kell/Necros/Preach) +float CT_MONVORELING = 370; // Little baby vorelings! ahh so cute! +float CT_CACHEVORELING = 372; // Special entity for precache of assets +float CT_MINIONVORELING = 374; // Minion Spawning version from shalrath +float CT_MONSWAMPLING = 375; // Tiny swamplings! ahh so cute! +float CT_MONDGUARDQ = 376; // Special Hell Knight with fireball +float CT_MONDLORD = 377; // Special Hell Knight with shield +float CT_MONDROLE = 380; // Fast moving tentacle tank with rockets +float CT_MONGUG = 381; // Large hulking bile spewing nightmare +float CT_MONFREDDIE = 383; // Slow moving mechanical ogre mutant +float CT_MONGAUNT = 384; // Flying harpy thing with plasma bolts! +float CT_MONJIM = 385; // Jim the flying robot of doom! +float CT_MONJIMROCKET = 386; // Jim has a rocket launcher! +float CT_MONSENTINEL = 387; // Fleshy robot Sentry + +// Rubicon series (metlslime) +float CT_MONPYRO = 390; // Enforcer Flame (Pyro) +float CT_MONFUMIGATOR = 392; // Poison version of the Pyro +float CT_MONCENTURION = 395; // Enforcer hoverboard (Plasma) + +//---------------------------------------------------------------------- +// Class Types for all projectiles in game (there is a lot!) +//---------------------------------------------------------------------- +float CT_PROJ_TRACE = 400; // Tracer shot (true aim) +float CT_PROJ_TRACEPART = 402; // Tracer shot (extra particles) +float CT_PROJ_SHELLC = 405; // Shellcase projectile + +float CT_PROJ_SG = 410; // SG projectile +float CT_PROJ_SSG = 412; // SSG projectile + +float CT_PROJ_NG = 415; // NG projectile +float CT_PROJ_SNG = 416; // SNG projectile +float CT_PROJ_MONNG = 417; // NG monster projectile (glowing red) +float CT_PROJ_REFNG = 418; // Reflected (glowing red) +float CT_PROJ_HKN = 419; // Hell Knight Spike + +float CT_PROJ_WBONE = 420; // Wraith Bone Bolt (nail) +float CT_PROJ_GROCK = 421; // Golem rock debris (pebble) +float CT_PROJ_SCORP = 422; // Scorpion Tail (nail) +float CT_PROJ_DLORD = 423; // Death Lord spike ball +float CT_PROJ_SANTA = 424; // Santa Snowball shotgun! + +float CT_PROJ_WIZ = 425; // Wizard Spit +float CT_PROJ_NOUR1 = 426; // Nour Spit +float CT_PROJ_MPOISON = 427; // Minotaur Poison Bolt (nail) +float CT_PROJ_FURY2 = 429; // Fury Spit with grenade trail + +float CT_PROJ_PLASMA = 430; // Generic Plasma (blue laser version) + +float CT_PROJ_WBOLT = 440; // Wraith Hitscan Bolt +float CT_PROJ_BOLT1 = 442; // Crossbow Knight Bolt +hknight trail +float CT_PROJ_LASER = 445; // Enforcer/Traps/Bob Laser +float CT_PROJ_BLBOLT = 448; // Boglord fast bolt (green) +float CT_PROJ_BLBOLT2 = 449; // Boglord fast bolt (red) + +float CT_PROJ_GL = 450; // Grenade projectile +float CT_PROJ_GLMON = 452; // Monster grenades +float CT_PROJ_MEGG = 455; // Minion Egg (grenade arc+bounce) +float CT_PROJ_FLESH = 460; // Zombie Flesh (grenade arc) +float CT_PROJ_SPID = 461; // Spider Spit (grenade arc) +float CT_PROJ_VORE = 462; // Voreling Spit (grenade arc) +float CT_PROJ_SWAMP = 463; // Swampling Spit (grenade arc) +float CT_PROJ_ELF = 464; // Elf snowball (grenade arc) +float CT_PROJ_NOUR2 = 467; // Nour Spit bomb! (grenade arc+bounce) +float CT_PROJ_CHTHON2 = 468; // Chthon Frenzy (grenade arc) +float CT_PROJ_SHUB2 = 469; // Shub Frenzy (grenade arc) + +float CT_PROJ_ROCKET = 470; // Rocket projectile +float CT_PROJ_LAVA = 471; // Chthon Lavaball +float CT_PROJ_FIRETOP = 472; // Chthon Lavaball (less splash dmg) +float CT_PROJ_CHTHON = 473; // Custom Chthon Lava/Slime ball +float CT_PROJ_GARG = 475; // Gargoyle fireball +float CT_PROJ_SKULLW = 477; // Skull Wizard Skull (rocket) +float CT_PROJ_FURY1 = 480; // Fury Knight spike ball +rocket trail +float CT_PROJ_ARMY = 482; // Army rocket +float CT_PROJ_JIM2 = 483; // Jim robot rocket +float CT_PROJ_SEEKER = 484; // Seeker robot rocket +float CT_PROJ_DROLE = 485; // Drole fireball +float CT_PROJ_DGUARDQ = 486; // Death Guard (Quoth) fireball +float CT_PROJ_BLORD = 487; // Bog Lord Green Slime bomb +float CT_PROJ_BLORD2 = 488; // Bog Lord Red Slime bomb +float CT_PROJ_EIDO1 = 490; // Eidolon boulder +float CT_PROJ_ICEG1 = 492; // Ice Golem ice shard +float CT_PROJ_RAINDEER = 494; // Raindeer rocket + +float CT_PROJ_SHAL = 495; // Shalrath spike ball +purple trail +float CT_PROJ_SERG = 496; // Death Sergeant spike ball +hknight trail +float CT_PROJ_SHUB1 = 497; // Custom Shub homing spike attack + +//---------------------------------------------------------------------- +float CT_UPGRADE_AXE = 500; // Shadow Axe +float CT_SHOTGUN = 505; // Shotgun +float CT_SUPER_SHOTGUN = 510; // Super Shotgun +float CT_UPGRADE_SSG = 515; // The Widowmaker Shotgun +float CT_NAILGUN = 520; // Nailgun +float CT_SUPER_NAILGUN = 525; // Super Nailgun +float CT_GRENADE_LAUNCHER = 530;// Grenade Launcher +float CT_ROCKET_LAUNCHER = 535; // Rocket Launcher +float CT_LIGHTNING = 540; // Lightning Gun +float CT_UPGRADE_LG = 545; // Plasma Gun + +float CT_ARTSUIT = 550; // Environment suit +float CT_ARTPENT = 555; // Pentagram - Invulnerability +float CT_ARTINVS = 560; // Ring of Shadows +float CT_ARTQUAD = 565; // Quad Damage +float CT_ARTSHARP = 570; // Sharp Shooter +float CT_ARTPIERCE = 575; // Nail Piercer +float CT_ARTWETSUIT = 580; // Wet Suit +float CT_ARTTOME = 590; // Tome of Power + +float CT_SILVERKEY = 600; // Silver key +float CT_GOLDKEY = 605; // Gold key +float CT_CUSTOMKEY = 610; // Custom key +float CT_CUSTOMITEM = 615; // Custom pickup item +float CT_RUNEKEY = 620; // End of Level rune keys 1-4 + +float CT_SPIKESHOOTER = 650; // Trap SPIKE shooter +float CT_GRENADESHOOTER = 652; // Trap GRENADE shooter +float CT_ROCKETSHOOTER = 654; // Trap ROCKET shooter +float CT_LIGHTSHOOTER = 656; // Trap LIGHTNING shooter +float CT_GASSHOOTER = 658; // Trap GAS shooter +float CT_EXPLO_BOX = 660; // Exploding box +float CT_PENDULUM = 662; // Swing Pendulum +float CT_SAWBLADE = 666; // Saw Blade + +float CT_FIREBALL = 670; // Misc Fireball +float CT_MISCSPARK = 672; // Misc Spark +float CT_MISCSHAKE = 676; // Misc Shake of screen/player +float CT_MISCDRIP = 680; // Misc Drip (water) +float CT_BUBBLE = 682; // Bubbles +float CT_MISCMODEL = 690; // Misc Model +float CT_MISCSMOKE = 692; // Misc Smoke + +//---------------------------------------------------------------------- +float CT_AMMOPACK = 700; // Ammo Backpacks +float CT_AMMORANDOM = 702; // Random Ammo Backpack +float CT_AMMOSHELLS = 710; // Different ammo types +float CT_AMMONAILS = 720; +float CT_AMMOROCKETS = 730; +float CT_AMMOCELLS = 740; + +float CT_HEALROT = 750; // Different Health packs +float CT_HEALNORM = 755; +float CT_HEALMEGA = 760; + +float CT_ARMOR1 = 770; // Green armour +float CT_ARMOR2 = 775; // Yellow armour +float CT_ARMORINV = 790; // Red armour +float ARMOR_BLUE = 2; // Display a blue armour + +//---------------------------------------------------------------------- +float CT_FUNCDOOR = 800; // Func door +float CT_FUNCDOORTRIG = 801; // Generated touch trigger around door +float CT_FUNCSECDOOR = 805; // Func SECRET door +float CT_FUNCBUTTON = 810; // Func button +float CT_FUNCPSWITCH = 812; // Func Pressure Switch +float CT_FUNCINSVOLUME = 813; // Func to detect inside volume +float CT_FUNCBOB = 815; // Func bobbing bmodels +float CT_FUNCTRAIN = 820; // Func train +float CT_FUNCWALL = 830; // Func wall +float CT_FUNCILLUSIONARY = 832; // Func illusionary +float CT_FUNCLASER = 834; // Func laser +float CT_FUNCSKILL = 836; // Func_skill pillars + +float CT_FUNCBREAK = 840; // Func breakable (parent) +float CT_FUNCBREAKWALL = 842; // Bmodel to activate after breakage +float CT_FUNCBREAKMDL = 845; // Func breakable (model) +float CT_FUNCBREAKSPN = 846; // Func breakable (spawner) +float CT_FUNCBREAKOBJ = 847; // Func breakable (rubble)) +float CT_FUNCPUSHABLE = 850; // Func pushable + +float CT_FUNCEPISODEGATE = 875; // Episode gates (not used anymore) +float CT_FUNCBOSSGATE = 880; // Final boss gate (not used anymore) +float CT_FUNCPLAT = 890; // Old platform system +float CT_FUNCLIFT = 895; // New platform system + +//---------------------------------------------------------------------- +float CT_TRIGONCE = 900; // Once, volume +float CT_TRIGMULTI = 905; // Multiple, volume +float CT_TRIGRELAY = 910; // Relay, point entity no touch +float CT_TRIGRELAYDELAY = 912; // Relay, used in SUBS for delays +float CT_TRIGDOORSTATE = 914; // Set func_door to specific state +float CT_TRIGCOUNT = 920; // Count, point entity no touch +float CR_TRIGENG = 922; // Engine, point entity no touch +float CT_TRIGRUNES = 925; // Rune, volume +float CT_TRIGSKILLS = 927; // Skill, volume +float CT_TRIGTELEPORT = 930; // Trigger teleport +float CT_MISCTELEPORT = 932; // info_teleport_destination +float CT_SKULLTELEPORT = 934; // info_skullwiz_destination +float CT_TRIGEXPLODE = 945; // Trigger sprite explosion +float CT_TRIGSECRET = 950; // Secret, volume +float CT_TRIGLADDER = 955; // Ladder, volume +float CT_TRIGFOG = 957; // Fog, volume +float CT_TRIGHURT = 960; // Hurt, volume +float CT_TRIGHEAL = 962; // Heal, volume +float CT_TRIGGIVEITEM = 964; // Give items, volume +float CT_TRIGTSOUND = 968; // Touch sounds, volume +float CT_TRIGPUSH = 970; // Push, volume +float CT_TRIGCONVEYOR = 972; // Conveyor, volume +float CT_TRIGLEVEL = 975; // Change level +float CT_TRIGSKYBOX = 976; // Change/Load Skybox console command +float CT_TRIGITEMFLAG = 977; // Change item spawnflags +float CT_TRIGCLMSG = 978; // Message to all clients +float CT_TRIGCDTRACK = 979; // Change CD track + +float CT_TRIGMONJUMP = 980; // Triger monster to jump forward +float CT_TRIGNOJUMP = 981; // Trigger monster to NOT jump! +float CT_TRIGMONDROP = 982; // Trigger monster to fall naturally +float CT_TRIGMONTURRET = 985; // Trigger monster to turn into turret +float CT_TRIGMONMOVE = 987; // Trigger monster movement state +float CT_TRIGMONBREAK = 990; // Trigger monster/breakable together +float CT_TRIGMONKILL = 992; // Trigger monster to be killed +float CT_TRIGMONATT = 996; // Trigger monster to attack something + +float CT_TRIGVOID = 999; // Skybox garbage collector! +//---------------------------------------------------------------------- +float AMMO_MAXSHELLS = 200; // Maximum ammo the player can carry +float AMMO_MAXNAILS = 200; // Shells use to be 100 +float AMMO_MAXROCKETS = 100; +float AMMO_MAXCELLS = 100; + +float AMMO_SHELLS_SML = 20; // Ammo quantities for small / large boxes +float AMMO_SHELLS_LGR = 40; // and from weapon pickups +float AMMO_SHELLS_WPN = 5; +float AMMO_NAILS_SML = 25; +float AMMO_NAILS_LGR = 50; +float AMMO_NAILS_WPN = 30; // Both Nailgun and Super +float AMMO_ROCKETS_SML = 5; +float AMMO_ROCKETS_LGR = 10; +float AMMO_ROCKETS_WPN = 5; // Both Rocket and Grenade launcher +float AMMO_CELLS_SML = 6; +float AMMO_CELLS_LGR = 12; +float AMMO_CELLS_WPN = 15; + +//---------------------------------------------------------------------- +float ARMOR_GRN_TYPE = 0.3; // Armour damage reduction and quantity +float ARMOR_GRN_VALUE = 100; +float ARMOR_YEL_TYPE = 0.6; +float ARMOR_YEL_VALUE = 150; +float ARMOR_RED_TYPE = 0.8; +float ARMOR_RED_VALUE = 200; + +//---------------------------------------------------------------------- +float HEAL_ROT = 15; // Health packs +float HEAL_NORM = 25; +float HEAL_MEGA = 100; // How much extra health to add +float HEAL_PLAYMAX = 100; // Maximum player health (default) +float HEAL_MEGAMAX = 250; // Maximum health (several megahealths) + +//---------------------------------------------------------------------- +// Required here because of link to particle emitters +float MISCBOOK_GREEN = 1; // Green Cover +float MISCBOOK_BLUE = 2; // Blue Cover +float MISCBOOK_RED = 3; // Red Cover + +//---------------------------------------------------------------------- +string SOUND_EMPTY = "misc/null.wav"; // No sound +string MODEL_EMPTY = "progs/misc_empty.mdl"; // Empty Model (1 point) +string MODEL_BROKEN = "progs/misc_broken.mdl"; // Model error +string MODEL_IMPACT = "progs/misc_impact.mdl"; // Impact Model Marker +string MODEL_CORNER1 = "progs/misc_corner1.mdl";// Path corner helper (Forward) +string MODEL_CORNER2 = "progs/misc_corner2.mdl";// Path corner helper (Backward) +string MODEL_BACKPACK = "progs/w_backpack.mdl"; // HD backpack + +string MODEL_PLAYER = "progs/player.mdl"; +string MODEL_PLAYER_HEAD = "progs/h_player.mdl"; +string MODEL_PLAYER_EYES = "progs/eyes.mdl"; + +string SOUND_HEAL15 = "items/r_item1.wav"; // pickup sound for rotten health +string SOUND_HEAL25 = "items/health1.wav"; // large health +string SOUND_HEAL100 = "items/r_item2.wav"; // mega health +string SOUND_RESPAWN = "items/itembk2.wav"; // item respawn sound +string SOUND_TALK = "misc/talk.wav"; // Activate/message sound + +string SOUND_REXP3 = "weapons/r_exp3b.wav"; // Original explode sound +string SOUND_PLASMA_FIRE = "weapons/plasma_fire.wav"; // Plasma Fire +string SOUND_PLASMA_HIT = "weapons/plasma_hit.wav"; // Plasma Impact + +// Resist ammo damage +string SOUND_RESIST_ROCKET = "weapons/resist_rocket.wav"; + +//---------------------------------------------------------------------- +// Projectile models +string MODEL_PROJ_DIAM1 = "progs/proj_diam1.mdl"; // Not used atm +string MODEL_PROJ_DIAM2 = "progs/proj_diam2.mdl"; +string MODEL_PROJ_SMOKE = "progs/proj_smoke.mdl"; +string MODEL_PROJ_SHELLC = "progs/proj_shellcase.mdl"; +string MODEL_PROJ_NG = "progs/proj_ng.mdl"; +string MODEL_PROJ_NGRED = "progs/proj_ngred.mdl"; +string MODEL_PROJ_SNG = "progs/proj_sng.mdl"; +string MODEL_PROJ_GRENADE = "progs/proj_grenade.mdl"; +string MODEL_PROJ_GRENADEGRN = "progs/proj_grenadegrn.mdl"; +string MODEL_PROJ_RINGSHOCK = "progs/proj_ringshock.mdl"; +string MODEL_PROJ_RINGBLAST = "progs/proj_ringblast.mdl"; +string MODEL_PROJ_ROCKET = "progs/proj_rocket.mdl"; +string MODEL_PROJ_ROCKETGRN = "progs/proj_rocketgrn.mdl"; +string MODEL_PROJ_FLESH = "progs/proj_flesh.mdl"; +string MODEL_PROJ_FLESHP = "progs/proj_fleshp.mdl"; +string MODEL_PROJ_HKN = "progs/proj_dk.mdl"; +string MODEL_PROJ_HKNGRN = "progs/proj_dkgrn.mdl"; +string MODEL_PROJ_DGUARDQ = "progs/proj_dguardq.mdl"; +string MODEL_PROJ_SERG = "progs/proj_serg.mdl"; +string MODEL_PROJ_FURY1 = "progs/proj_fury1.mdl"; +string MODEL_PROJ_FURY2 = "progs/proj_fury2.mdl"; +string MODEL_PROJ_DLORD1 = "progs/proj_dlord1.mdl"; +string MODEL_PROJ_NOUR1 = "progs/proj_nour1.mdl"; +string MODEL_PROJ_NOUR2B = "progs/proj_nour2b.mdl"; +string MODEL_PROJ_NOUR2P = "progs/proj_nour2p.mdl"; +string MODEL_PROJ_NOUR2S = "progs/proj_nour2s.mdl"; +string MODEL_PROJ_NOUR3 = "progs/proj_nour3.mdl"; +string MODEL_PROJ_BLORD1B = "progs/proj_blord1b.mdl"; +string MODEL_PROJ_BLORD1S = "progs/proj_blord1s.mdl"; +string MODEL_PROJ_BLORDBOLT1 = "progs/proj_blordbolt1.mdl"; +string MODEL_PROJ_BLORDBEAM1 = "progs/proj_blordbeam1.mdl"; +string MODEL_PROJ_BLORD2B = "progs/proj_blord2b.mdl"; +string MODEL_PROJ_BLORD2S = "progs/proj_blord2s.mdl"; +string MODEL_PROJ_BLORDBOLT2 = "progs/proj_blordbolt2.mdl"; +string MODEL_PROJ_BLORDBEAM2 = "progs/proj_blordbeam2.mdl"; +string MODEL_PROJ_SHAMLIT = "progs/proj_shamlit.mdl"; +string MODEL_PROJ_WIZ = "progs/proj_wiz.mdl"; +string MODEL_PROJ_SPID = "progs/proj_spider.mdl"; +string MODEL_PROJ_VORE = "progs/proj_voreling.mdl"; +string MODEL_PROJ_SWAMP = "progs/proj_swampling.mdl"; +string MODEL_PROJ_SHAL = "progs/proj_shal.mdl"; +string MODEL_PROJ_SHALGRN = "progs/proj_shalgrn.mdl"; +string MODEL_PROJ_SHOME = "progs/proj_shalhome.mdl"; +string MODEL_PROJ_SHOMEGRN = "progs/proj_shalhomegrn.mdl"; +string MODEL_PROJ_SBALL = "progs/proj_shalball.mdl"; +string MODEL_PROJ_SEGG = "progs/proj_shalegg.mdl"; +string MODEL_PROJ_SSHELL = "progs/proj_shalshell.mdl"; +string MODEL_PROJ_LAVA = "progs/proj_balllava.mdl"; +string MODEL_PROJ_SLIME = "progs/proj_ballslime.mdl"; +string MODEL_PROJ_DROLE = "progs/proj_drole.mdl"; +string MODEL_PROJ_DROLEGRN = "progs/proj_drolegrn.mdl"; +string MODEL_PROJ_GUGBOMB = "progs/proj_gugbomb.mdl"; +string MODEL_PROJ_GUGFRAG = "progs/proj_gugfrag.mdl"; +string MODEL_PROJ_GUGEXPL = "progs/proj_gugexp.spr"; +string MODEL_PROJ_LASER = "progs/proj_laz.mdl"; +string MODEL_PROJ_LASERGRN = "progs/proj_lazgrn.mdl"; +string MODEL_PROJ_LIGHTNING2 = "progs/proj_lightning2.mdl"; +string MODEL_PROJ_PLASMA = "progs/proj_plasma.mdl"; +string MODEL_PROJ_PLASMAGRN = "progs/proj_plasmagrn.mdl"; +string MODEL_PROJ_PGPLASMA = "progs/proj_pgplasma.mdl"; +string MODEL_PROJ_GAPLASMA = "progs/proj_gaplasma.mdl"; +string MODEL_PROJ_GAPLASMAGRN = "progs/proj_gaplasmagrn.mdl"; +string MODEL_PROJ_BOLT1 = "progs/proj_bolt1.mdl"; +string MODEL_PROJ_BOLT2 = "progs/proj_bolt2.mdl"; +string MODEL_PROJ_BOLT3 = "progs/proj_bolt3.mdl"; +string MODEL_PROJ_SWSKULL = "progs/proj_skullwiz.mdl"; +string MODEL_PROJ_SWSKULLP = "progs/proj_skullwizp.mdl"; +string MODEL_PROJ_SWBALL = "progs/proj_skullball.mdl"; +string MODEL_PROJ_GARGBALL = "progs/proj_gargball.mdl"; +string MODEL_PROJ_GARGOYLE = "progs/proj_gargoyle.mdl"; +string MODEL_PROJ_GARGBALLGRN = "progs/proj_gargballgrn.mdl"; +string MODEL_PROJ_GARGOYLEGRN = "progs/proj_gargoylegrn.mdl"; +string MODEL_PROJ_WTRAIL = "progs/proj_wraithtrail.mdl"; +string MODEL_PROJ_WBALL = "progs/proj_wraithball.mdl"; +string MODEL_PROJ_WBONE = "progs/proj_wraithbone.mdl"; +string MODEL_PROJ_WPOISON = "progs/proj_wraithpoison.mdl"; +string MODEL_PROJ_WEGG = "progs/proj_wraithegg.mdl"; +string MODEL_PROJ_WSHELL = "progs/proj_wraithshell.mdl"; +string MODEL_PROJ_SCORP = "progs/proj_scorpion.mdl"; +string MODEL_PROJ_MBALL = "progs/proj_minoball.mdl"; +string MODEL_PROJ_MPLASMA = "progs/proj_minoplasma.mdl"; +string MODEL_PROJ_MPOISON = "progs/proj_minopoison.mdl"; +string MODEL_PROJ_GROCK1 = "progs/proj_golemrock1.mdl"; +string MODEL_PROJ_GROCK2 = "progs/proj_golemrock2.mdl"; +string MODEL_PROJ_EIDO1 = "progs/proj_eidolonrock1.mdl"; +string MODEL_PROJ_GSHARD = "progs/proj_golemshard.mdl"; +string MODEL_PROJ_RAIND = "progs/xmas/proj_rdrocket.mdl"; +string MODEL_PROJ_ELF = "progs/xmas/proj_elfsnow.mdl"; +string MODEL_PROJ_SNOWBALL = "progs/xmas/proj_snowball.mdl"; +string MODEL_PROJ_CHTHON1 = "progs/proj_chthon1.mdl"; +string MODEL_PROJ_SHUB1 = "progs/proj_shub1.mdl"; +string MODEL_PROJ_SHUB2 = "progs/proj_shub2.mdl"; + +//---------------------------------------------------------------------- +// Sprites +string SEXP_SMALL = "progs/s_exp_small.spr"; // Original ID one +string SEXP_MED = "progs/s_exp_med.spr"; // From Quoth +string SEXP_BIG = "progs/s_exp_big.spr"; // From Quoth +string SEXP_PLASMA_SMALL = "progs/s_exp_plasma_small.spr"; // Kinn/Marcher +string SEXP_PLASMA_BIG = "progs/s_exp_plasma_big.spr"; // Kinn/Marcher +string SEXP_POISON_SMALL = "progs/s_exp_poison_small.spr"; // Kinn/Marcher +string SEXP_POISON_MED = "progs/s_exp_poison_med.spr"; // From Quoth +string SEXP_ELECTRIC = "progs/s_exp_electric.spr"; // From Quoth +string SEXP_ICE_BIG = "progs/s_exp_ice_big.spr"; // From Ne_ruins +string SBURST_FLAME = "progs/s_burst_flame.spr"; // From Rubicon2 +string SBURST_FLAMEDP = "progs/s_burst_flamedp.spr"; // DP collision +string SBURST_POISON = "progs/s_burst_poison.spr"; // From Rubicon2 +string SBURST_POISONDP = "progs/s_burst_poisondp.spr"; // DP collision +string SBURST_SMOKE = "progs/s_burst_smoke.spr"; // From Rubicon2 +string SBURST_STEAM = "progs/s_burst_steam.spr"; // From Rubicon2 +string SBUBBLE_DROWN = "progs/s_bubble.spr"; // Original ID one +string SWATER_DRIP = "progs/s_dripblue.spr"; // From RRP/RMQ +string SWATER_SPLASH = "progs/s_dripsplblue.spr"; // From RRP/RMQ +string SBLOOD_DRIP = "progs/s_dripred.spr"; // Re-painted +string SBLOOD_SPLASH = "progs/s_dripsplred.spr"; +string SSLIME_DRIP = "progs/s_dripgreen.spr"; // Re-painted +string SSLIME_SPLASH = "progs/s_dripsplgreen.spr"; + +//---------------------------------------------------------------------- +// Sprite types +float EXPLODE_SMALL = 1; +float EXPLODE_MED = 2; +float EXPLODE_BIG = 3; +float EXPLODE_PLASMA_SMALL = 11; +float EXPLODE_PLASMA_MED = 12; +float EXPLODE_PLASMA_BIG = 13; +float EXPLODE_POISON_SMALL = 21; +float EXPLODE_POISON_MED = 22; +float EXPLODE_POISON_BIG = 23; +float EXPLODE_ELECT_SMALL = 31; +float EXPLODE_ELECT_MED = 32; +float EXPLODE_ELECT_BIG = 33; +float EXPLODE_ICE_BIG = 38; +float EXPLODE_BURST_SMOKE = 41; +float EXPLODE_BURST_FLAME = 42; +float EXPLODE_BURST_POISON = 43; + +//---------------------------------------------------------------------- +// WORLD weapon models (player) +string MODEL_GWEAP_UPAXE = "progs/g_shadaxe.mdl"; // Has all 6 skins +string MODEL_GWEAP_SG = "progs/g_shot1.mdl"; // From Rubicon +string MODEL_GWEAP_SSG = "progs/g_shot2.mdl"; // New Model update +string MODEL_GWEAP_UPSSG = "progs/g_shot3.mdl"; // SSG Upgrade +string MODEL_GWEAP_NG = "progs/g_nail.mdl"; // Remake from me +string MODEL_GWEAP_SNG = "progs/g_nail2.mdl"; +string MODEL_GWEAP_GL = "progs/g_rock.mdl"; +string MODEL_GWEAP_RL = "progs/g_rock2.mdl"; +string MODEL_GWEAP_LG = "progs/g_light.mdl"; +string MODEL_GWEAP_UPLG = "progs/g_plasma.mdl"; // LG Upgrade +//string MODEL_GWEAP_ZSSG = "progs/g_zershot.mdl"; + +// VIEW weapon models (player) +string MODEL_VWEAP_AXE = "progs/v_shadaxe0.mdl"; // Default, no glow +string MODEL_VWEAP_UPAXE = "progs/v_shadaxe3.mdl"; // Axe Upgrade +string MODEL_VWEAP_SG = "progs/v_shot.mdl"; +string MODEL_VWEAP_SSG = "progs/v_shot2.mdl"; +string MODEL_VWEAP_UPSSG = "progs/v_shot3.mdl"; // SSG Upgrade +string MODEL_VWEAP_NG = "progs/v_nail.mdl"; +string MODEL_VWEAP_SNG = "progs/v_nail2.mdl"; +string MODEL_VWEAP_GL = "progs/v_rock.mdl"; +string MODEL_VWEAP_RL = "progs/v_rock2.mdl"; +string MODEL_VWEAP_LG = "progs/v_light.mdl"; +string MODEL_VWEAP_UPLG = "progs/v_plasma.mdl"; // LG Upgrade +//string MODEL_VWEAP_ZSSG = "progs/v_zershot.mdl"; + +//---------------------------------------------------------------------- +// Standard ID artifact sounds +string SOUND_ARTSUIT1 = "items/suit.wav"; // Pick up +string SOUND_ARTSUIT2 = "items/suit2.wav"; // Fading +string SOUND_ARTWETS1 = "items/wetsuit.wav"; // Pick up +string SOUND_ARTWETS2 = "items/wetsuit2.wav"; // Fading +string SOUND_ARTWETS3 = "items/wetsuit3.wav"; // In Water +string SOUND_ARTWETS3B = "items/wetsuit3out.wav"; // Out Water +string SOUND_ARTPENT1 = "items/protect.wav"; // Pick up +string SOUND_ARTPENT2 = "items/protect2.wav"; // Fading +string SOUND_ARTPENT3 = "items/protect3.wav"; // Active +string SOUND_ARTINV1 = "items/inv1.wav"; // Pick up +string SOUND_ARTINV2 = "items/inv2.wav"; // Fading +string SOUND_ARTINV3 = "items/inv3.wav"; // Active +string SOUND_ARTQUAD1 = "items/damage.wav"; // Pick up +string SOUND_ARTQUAD2 = "items/damage2.wav"; // Fading +string SOUND_ARTQUAD3 = "items/damage3.wav"; // Active +string SOUND_ARTSHARP1 = "items/sharp.wav"; // Pick up +string SOUND_ARTSHARP2 = "items/sharp2.wav"; // Fading +string SOUND_ARTSHARP3 = "items/sharp3.wav"; // Active +string SOUND_ARTNAILP1 = "items/nailp.wav"; // Pick up +string SOUND_ARTNAILP2 = "items/nailp2.wav"; // Fading +string SOUND_ARTNAILP3 = "items/nailp3.wav"; // Active + +//---------------------------------------------------------------------- +// DeBuff sounds +string SOUND_HEARTBEAT = "player/heartbeat.wav"; // Fast heartbeat (1s) + +//---------------------------------------------------------------------- +// Footstep sounds +string SOUND_FS_SLOW1 = "steps/slow1.wav"; +string SOUND_FS_SLOW2 = "steps/slow2.wav"; +string SOUND_FS_SLOW3 = "steps/slow3.wav"; +string SOUND_FS_SLOW4 = "steps/slow4.wav"; +string SOUND_FS_SLOW5 = "steps/slow5.wav"; + +string SOUND_FS_DRAG1 = "steps/drag1.wav"; +string SOUND_FS_DRAG2 = "steps/drag2.wav"; +string SOUND_FS_DRAG3 = "steps/drag3.wav"; +string SOUND_FS_DRAG4 = "steps/drag4.wav"; +string SOUND_FS_DRAG5 = "steps/drag5.wav"; + +string SOUND_FS_LIGHT1 = "steps/light1.wav"; +string SOUND_FS_LIGHT2 = "steps/light2.wav"; +string SOUND_FS_LIGHT3 = "steps/light3.wav"; +string SOUND_FS_LIGHT4 = "steps/light4.wav"; +string SOUND_FS_LIGHT5 = "steps/light5.wav"; + +string SOUND_FS_MEDIUM1 = "steps/medium1.wav"; +string SOUND_FS_MEDIUM2 = "steps/medium2.wav"; +string SOUND_FS_MEDIUM3 = "steps/medium3.wav"; +string SOUND_FS_MEDIUM4 = "steps/medium4.wav"; +string SOUND_FS_MEDIUM5 = "steps/medium5.wav"; + +string SOUND_FS_HEAVY1 = "steps/heavy1.wav"; +string SOUND_FS_HEAVY2 = "steps/heavy2.wav"; +string SOUND_FS_HEAVY3 = "steps/heavy3.wav"; +string SOUND_FS_HEAVY4 = "steps/heavy4.wav"; +string SOUND_FS_HEAVY5 = "steps/heavy5.wav"; + +string SOUND_FS_LARGE1 = "steps/large1.wav"; +string SOUND_FS_LARGE2 = "steps/large2.wav"; +string SOUND_FS_LARGE3 = "steps/large3.wav"; +string SOUND_FS_LARGE4 = "steps/large4.wav"; +string SOUND_FS_LARGE5 = "steps/large5.wav"; + +string SOUND_FS_GIANT1 = "steps/giant1.wav"; +string SOUND_FS_GIANT2 = "steps/giant2.wav"; +string SOUND_FS_GIANT3 = "steps/giant3.wav"; +string SOUND_FS_GIANT4 = "steps/giant4.wav"; +string SOUND_FS_GIANT5 = "steps/giant5.wav"; + +/* For reference only +float SVC_BAD = 0; +float SVC_NOP = 1; +float SVC_DISCONNECT = 2; +float SVC_UPDATESTAT = 3; +float SVC_VERSION = 4; +float SVC_SETVIEW = 5; +float SVC_SOUND = 6; +float SVC_TIME = 7; +float SVC_PRINT = 8; +float SVC_STUFFTEXT = 9; +float SVC_SETANGLE = 10; +float SVC_SERVERINFO = 11; +float SVC_LIGHTSTYLE = 12; +float SVC_UPDATENAME = 13; +float SVC_UPDATEFRAGS = 14; +float SVC_CLIENTDATA = 15; +float SVC_STOPSOUND = 16; +float SVC_UPDATECOLORS = 17; +float SVC_PARTICLE = 18; +float SVC_DAMAGE = 19; +float SVC_SPAWNSTATIC = 20; +float SVC_SPAWNBINARY = 21; +float SVC_SPAWNBASELINE = 22; +float SVC_TEMPENTITY = 23; +float SVC_SETPAUSE = 24; +float SVC_SIGNONNUM = 25; +float SVC_CENTERPRINT = 26; +float SVC_KILLEDMONSTER = 27; +float SVC_FOUNDSECRET = 28; +float SVC_SPAWNSTATICSOUND= 29; +float SVC_INTERMISSION = 30; +float SVC_FINALE = 31; +float SVC_CDTRACK = 32; +float SVC_SELLSCREEN = 33; +float SVC_CUTSCENE = 34; +*/ \ No newline at end of file diff --git a/QC_other/QC_arcane/dpextensions.qc b/QC_other/QC_arcane/dpextensions.qc new file mode 100644 index 00000000..859b58d0 --- /dev/null +++ b/QC_other/QC_arcane/dpextensions.qc @@ -0,0 +1,2450 @@ +//DarkPlaces supported extension list, draft version 1.04 +//things that don't have extensions yet: +.float disableclientprediction; + +//definitions that id Software left out: +//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed) +float MOVE_NORMAL = 0; // same as FALSE +float MOVE_NOMONSTERS = 1; // same as TRUE +float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE + +//checkextension function +//idea: expected by almost everyone +//darkplaces implementation: LordHavoc +float(string s) checkextension = #99; +//description: +//check if (cvar("pr_checkextension")) before calling this, this is the only +//guaranteed extension to be present in the extension system, it allows you +//to check if an extension is available, by name, to check for an extension +//use code like this: +//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere) +//if (cvar("pr_checkextension")) +//if (checkextension("DP_SV_SETCOLOR")) +// ext_setcolor = TRUE; +//from then on you can check ext_setcolor to know if that extension is available + +//BX_WAL_SUPPORT +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//indicates the engine supports .wal textures for filenames in the textures/ directory +//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly) + +//DP_BUTTONCHAT +//idea: Vermeulen +//darkplaces implementation: LordHavoc +//field definitions: +.float buttonchat; +//description: +//true if the player is currently chatting (in messagemode, menus or console) + +//DP_BUTTONUSE +//idea: id Software +//darkplaces implementation: LordHavoc +//field definitions: +.float buttonuse; +//client console commands: +//+use +//-use +//description: +//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes). + +//DP_CL_LOADSKY +//idea: Nehahra, LordHavoc +//darkplaces implementation: LordHavoc +//client console commands: +//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming) +//description: +//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX). + +//DP_CON_SET +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars. + +//DP_CON_SETA +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars. + +//DP_CON_ALIASPARAMETERS +//idea: many +//darkplaces implementation: Black +//description: +//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward). + +//DP_CON_EXPANDCVAR +//idea: many, PHP +//darkplaces implementation: Black +//description: +//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar. + +//DP_CON_STARTMAP +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start". + +//DP_EF_ADDITIVE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_ADDITIVE = 32; +//description: +//additive blending when this object is rendered + +//DP_EF_BLUE +//idea: id Software +//darkplaces implementation: LordHavoc +//effects bit: +float EF_BLUE = 64; +//description: +//entity emits blue light (used for quad) + +//DP_EF_DOUBLESIDED +//idea: LordHavoc +//darkplaces implementation: [515] and LordHavoc +//effects bit: +float EF_DOUBLESIDED = 32768; +//description: +//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff. + +//DP_EF_FLAME +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_FLAME = 1024; +//description: +//entity is on fire + +//DP_EF_FULLBRIGHT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_FULLBRIGHT = 512; +//description: +//entity is always brightly lit + +//DP_EF_NODEPTHTEST +//idea: Supa +//darkplaces implementation: LordHavoc +//effects bit: +float EF_NODEPTHTEST = 8192; +//description: +//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost + +//DP_EF_NODRAW +//idea: id Software +//darkplaces implementation: LordHavoc +//effects bit: +float EF_NODRAW = 16; +//description: +//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things) + +//DP_EF_NOGUNBOB +//idea: Chris Page, Dresk +//darkplaces implementation: LordHAvoc +//effects bit: +float EF_NOGUNBOB = 256; +//description: +//this has different meanings depending on the entity it is used on: +//player entity - prevents gun bobbing on player.viewmodel +//viewmodelforclient entity - prevents gun bobbing on an entity attached to the player's view +//other entities - no effect +//uses: +//disabling gun bobbing on a diving mask or other model used as a .viewmodel. +//disabling gun bobbing on view-relative models meant to be part of the heads up display. (note: if fov is changed these entities may be off-screen, or too near the center of the screen, so use fov 90 in this case) + +//DP_EF_NOSHADOW +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_NOSHADOW = 4096; +//description: +//realtime lights will not cast shadows from this entity (but can still illuminate it) + +//DP_EF_RED +//idea: id Software +//darkplaces implementation: LordHavoc +//effects bit: +float EF_RED = 128; +//description: +//entity emits red light (used for invulnerability) + +//DP_EF_RESTARTANIM_BIT +//idea: id software +//darkplaces implementation: divVerent +//effects bit: +float EF_RESTARTANIM_BIT = 1048576; +//description: +//when toggled, the current animation is restarted. Useful for weapon animation. +//to toggle this bit in QC, you can do: +// self.effects += (EF_RESTARTANIM_BIT - 2 * (self.effects & EF_RESTARTANIM_BIT)); + +//DP_EF_STARDUST +//idea: MythWorks Inc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_STARDUST = 2048; +//description: +//entity emits bouncing sparkles in every direction + +//DP_EF_TELEPORT_BIT +//idea: id software +//darkplaces implementation: divVerent +//effects bit: +float EF_TELEPORT_BIT = 2097152; +//description: +//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting. +//to toggle this bit in QC, you can do: +// self.effects += (EF_TELEPORT_BIT - 2 * (self.effects & EF_TELEPORT_BIT)); + +//DP_ENT_ALPHA +//idea: Nehahra +//darkplaces implementation: LordHavoc +//fields: +//.float alpha; +//description: +//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal). + +//DP_ENT_COLORMOD +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definition: +.vector colormod; +//description: +//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal). + +//DP_ENT_CUSTOMCOLORMAP +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number. + +/* +//NOTE: no longer supported by darkplaces because all entities are delta compressed now +//DP_ENT_DELTACOMPRESS // no longer supported +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_DELTA = 8388608; +//description: +//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc). +*/ + +//DP_ENT_EXTERIORMODELTOCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//fields: +.entity exteriormodeltoclient; +//description: +//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown. Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person. + +//DP_ENT_GLOW +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float glow_color; +.float glow_size; +.float glow_trail; +//description: +//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light. + +//DP_ENT_GLOWMOD +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definition: +.vector glowmod; +//description: +//controls color of the entity's glow texture (fullbrights), '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, see colormod (same color restrictions apply). + +//DP_ENT_LOWPRECISION +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_LOWPRECISION = 4194304; +//description: +//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc). + +//DP_ENT_SCALE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float scale; +//description: +//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller. + +//DP_ENT_TRAILEFFECTNUM +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float traileffectnum; +//description: +//use a custom effectinfo.txt effect on this entity, assign it like this: +//self.traileffectnum = particleeffectnum("mycustomeffect"); +//this will do both the dlight and particle trail as described in the effect, basically equivalent to trailparticles() in CSQC but performed on a server entity. + +//DP_ENT_VIEWMODEL +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.entity viewmodelforclient; +//description: +//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)... the entity is not visible to any other client. + +//DP_GFX_EXTERNALTEXTURES +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//loads external textures found in various directories (tenebrae compatible)... +/* +in all examples .tga is merely the base texture, it can be any of these: +.tga (base texture) +_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha) +_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend) +_shirt.tga (same idea as pants, but for shirt color) +_diffuse.tga (this may be used instead of base texture for per pixel lighting) +_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale)) +_norm.tga (normalmap texture for per pixel lighting) +_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility) +_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility) + +due to glquake's incomplete Targa(r) loader, this section describes +required Targa(r) features support: +types: +type 1 (uncompressed 8bit paletted with 24bit/32bit palette) +type 2 (uncompressed 24bit/32bit true color, glquake supported this) +type 3 (uncompressed 8bit greyscale) +type 9 (RLE compressed 8bit paletted with 24bit/32bit palette) +type 10 (RLE compressed 24bit/32bit true color, glquake supported this) +type 11 (RLE compressed 8bit greyscale) +attribute bit 0x20 (Origin At Top Left, top to bottom, left to right) + +image formats guaranteed to be supported: tga, pcx, lmp +image formats that are optional: png, jpg + +mdl/spr/spr32 examples: +skins are named _A (A being a number) and skingroups are named like _A_B +these act as suffixes on the model name... +example names for skin _2_1 of model "progs/armor.mdl": +game/override/progs/armor.mdl_2_1.tga +game/textures/progs/armor.mdl_2_1.tga +game/progs/armor.mdl_2_1.tga +example names for skin _0 of the model "progs/armor.mdl": +game/override/progs/armor.mdl_0.tga +game/textures/progs/armor.mdl_0.tga +game/progs/armor.mdl_0.tga +note that there can be more skins files (of the _0 naming) than the mdl +contains, this is only useful to save space in the .mdl file if classic quake +compatibility is not a concern. + +bsp/md2/md3 examples: +example names for the texture "quake" of model "maps/start.bsp": +game/override/quake.tga +game/textures/quake.tga +game/quake.tga + +sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad +game/override/gfx/conchars.tga +game/textures/gfx/conchars.tga +game/gfx/conchars.tga +*/ + +//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES +//idea: Fuh? +//darkplaces implementation: LordHavoc +//description: +//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/. +//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed) +//example: +//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/ +//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/ +//as a more extreme example: +//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/ + +//DP_GFX_FOG +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//worldspawn fields: +//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3") +//description: +//global fog for the map, can not be changed by QC + +//DP_GFX_QUAKE3MODELTAGS +//idea: id Software +//darkplaces implementation: LordHavoc +//field definitions: +.entity tag_entity; // entity this is attached to (call setattachment to set this) +.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this) +//builtin definitions: +void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag) +//description: +//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior). +//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity) +//note 3: attaching to world turns off attachment +//note 4: the entity that this is attached to must be visible for this to work +//note 5: if an entity is attached to the player entity it will not be drawn in first person. + +//DP_GFX_SKINFILES +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as: +//progs/test.md3_0.skin +//progs/test.md3_1.skin +//... +// +//these files contain replace commands (replace meshname shadername), example: +//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement +//replace "teamstripes" "progs/test/redstripes.tga" +//replace "visor" "common/nodraw" // this makes the visor mesh invisible +////it is not possible to rename tags using this format +// +//Or the Quake3 syntax (100% compatible with Quake3's .skin files): +//helmet,progs/test/helmet1.tga // this is a mesh shader replacement +//teamstripes,progs/test/redstripes.tga +//visor,common/nodraw // this makes the visor mesh invisible +//tag_camera, // this defines that the first tag in the model is called tag_camera +//tag_test, // this defines that the second tag in the model is called tag_test +// +//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible. +//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set). +//other commands might be added someday but it is not expected. + +//DP_GFX_SKYBOX +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//worldspawn fields: +//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2) +//description: +//global skybox for the map, can not be changed by QC + +//DP_UTF8 +//idea: Blub\0, divVerent +//darkplaces implementation: Blub\0 +//cvar definitions: +// utf8_enable: enable utf8 encoding +//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., +//and count as 1 char for string functions like strlen, substring, etc. +// note: utf8_enable is run-time cvar, could be changed during execution +// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled + +//DP_HALFLIFE_MAP +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30). + +//DP_HALFLIFE_MAP_CVAR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//cvars: +//halflifebsp 0/1 +//description: +//engine sets this cvar when loading a map to indicate if it is halflife format or not. + +//DP_HALFLIFE_SPRITE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//simply indicates that the engine supports HalfLife sprites. + +//DP_INPUTBUTTONS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float button3; +.float button4; +.float button5; +.float button6; +.float button7; +.float button8; +.float button9; +.float button10; +.float button11; +.float button12; +.float button13; +.float button14; +.float button15; +.float button16; +//description: +//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used). +//the exact mapping of protocol button bits on the server is: +//self.button0 = (bits & 1) != 0; +///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */ +//self.button2 = (bits & 2) != 0; +//self.button3 = (bits & 4) != 0; +//self.button4 = (bits & 8) != 0; +//self.button5 = (bits & 16) != 0; +//self.button6 = (bits & 32) != 0; +//self.button7 = (bits & 64) != 0; +//self.button8 = (bits & 128) != 0; + +// DP_LIGHTSTYLE_STATICVALUE +// idea: VorteX +// darkplaces implementation: VorteX +// description: allows alternative 'static' lightstyle syntax : "=value" +// examples: "=0.5", "=2.0", "=2.75" +// could be used to control switchable lights or making styled lights with brightness > 2 +// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact +// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax + +//DP_LITSPRITES +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit). + +//DP_LITSUPPORT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting. +//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course... see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information. + +//DP_MONSTERWALK +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player. + +//DP_MOVETYPEBOUNCEMISSILE +//idea: id Software +//darkplaces implementation: id Software +//movetype definitions: +//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc +//description: +//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts. + +//DP_MOVETYPEFLYWORLDONLY +//idea: Samual +//darkplaces implementation: Samual +//movetype definitions: +float MOVETYPE_FLY_WORLDONLY = 33; +//description: +//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER. + +//DP_NULL_MODEL +//idea: Chris +//darkplaces implementation: divVerent +//definitions: +//string dp_null_model = "null"; +//description: +//setmodel(e, "null"); makes an entity invisible, have a zero bbox, but +//networked. useful for shared CSQC entities. + +//DP_MOVETYPEFOLLOW +//idea: id Software, LordHavoc (redesigned) +//darkplaces implementation: LordHavoc +//movetype definitions: +float MOVETYPE_FOLLOW = 12; +//description: +//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways: +//aiment - the entity this is attached to. +//punchangle - the original angles when the follow began. +//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle). +//v_angle - the relative angles. +//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates: +//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow +//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid +//hole.aiment = bmodel; // make the hole follow bmodel +//hole.punchangle = bmodel.angles; // the original angles of bmodel +//hole.view_ofs = hole.origin - bmodel.origin; // relative origin +//hole.v_angle = hole.angles - bmodel.angles; // relative angles + +//DP_QC_ASINACOSATANATAN2TAN +//idea: Urre +//darkplaces implementation: LordHavoc +//constant definitions: +float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144; +float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612; +float PI = 3.1415926535897932384626433832795028841971693993751058209749445923; +//builtin definitions: +float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5 +float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI +float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5 +float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees) +float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity +//description: +//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed). +//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v) + +//DP_QC_AUTOCVARS +//idea: divVerent +//darkplaces implementation: divVerent +//description: +//allows QC variables to be bound to cvars +//(works for float, string, vector types) +//example: +// float autocvar_developer; +// float autocvar_registered; +// string autocvar__cl_name; +//NOTE: copying a string-typed autocvar to another variable/field, and then +//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar +//globals is UNDEFINED. Accessing autocvar globals after cvar_set()ing that +//cvar in the same frame is IMPLEMENTATION DEFINED (an implementation may +//either yield the previous, or the current, value). Whether autocvar globals, +//after restoring a savegame, have the cvar's current value, or the original +//value at time of saving, is UNDEFINED. Restoring a savegame however must not +//restore the cvar values themselves. +//In case the cvar does NOT exist, then it is automatically created with the +//value of the autocvar initializer, if given. This is possible with e.g. +//frikqcc and fteqcc the following way: +// var float autocvar_whatever = 42; +//If no initializer is given, the cvar will be initialized to a string +//equivalent to the NULL value of the given data type, that is, the empty +//string, 0, or '0 0 0'. However, when automatic cvar creation took place, a +//warning is printed to the game console. +//NOTE: to prevent an ambiguity with float names for vector types, autocvar +//names MUST NOT end with _x, _y or _z! + +//DP_QC_CHANGEPITCH +//idea: id Software +//darkplaces implementation: id Software +//field definitions: +.float idealpitch; +.float pitch_speed; +//builtin definitions: +void(entity ent) changepitch = #63; +//description: +//equivalent to changeyaw, ent is normally self. (this was a Q2 builtin) + +//DP_QC_COPYENTITY +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(entity from, entity to) copyentity = #400; +//description: +//copies all data in the entity to another entity. + +//DP_QC_CVAR_DEFSTRING +//idea: id Software (Doom3), LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +string(string s) cvar_defstring = #482; +//description: +//returns the default value of a cvar, as a tempstring. + +//DP_QC_CVAR_DESCRIPTION +//idea: divVerent +//DarkPlaces implementation: divVerent +//builtin definitions: +string(string name) cvar_description = #518; +//description: +//returns the description of a cvar + +//DP_QC_CVAR_STRING +//idea: VorteX +//DarkPlaces implementation: VorteX, LordHavoc +//builtin definitions: +string(string s) cvar_string = #448; +//description: +//returns the value of a cvar, as a tempstring. + +//DP_QC_CVAR_TYPE +//idea: divVerent +//DarkPlaces implementation: divVerent +//builtin definitions: +float(string name) cvar_type = #495; +float CVAR_TYPEFLAG_EXISTS = 1; +float CVAR_TYPEFLAG_SAVED = 2; +float CVAR_TYPEFLAG_PRIVATE = 4; +float CVAR_TYPEFLAG_ENGINE = 8; +float CVAR_TYPEFLAG_HASDESCRIPTION = 16; +float CVAR_TYPEFLAG_READONLY = 32; + +//DP_QC_EDICT_NUM +//idea: 515 +//DarkPlaces implementation: LordHavoc +//builtin definitions: +entity(float entnum) edict_num = #459; +float(entity ent) wasfreed = #353; // same as in EXT_CSQC extension +//description: +//edict_num returns the entity corresponding to a given number, this works even for freed entities, but you should call wasfreed(ent) to see if is currently active. +//wasfreed returns whether an entity slot is currently free (entities that have never spawned are free, entities that have had remove called on them are also free). + +//DP_QC_ENTITYDATA +//idea: KrimZon +//darkplaces implementation: KrimZon +//builtin definitions: +float() numentityfields = #496; +string(float fieldnum) entityfieldname = #497; +float(float fieldnum) entityfieldtype = #498; +string(float fieldnum, entity ent) getentityfieldstring = #499; +float(float fieldnum, entity ent, string s) putentityfieldstring = #500; +//constants: +//Returned by entityfieldtype +float FIELD_STRING = 1; +float FIELD_FLOAT = 2; +float FIELD_VECTOR = 3; +float FIELD_ENTITY = 4; +float FIELD_FUNCTION = 6; +//description: +//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame. +//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers. +//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z. +//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever. +//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers. +//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned. +//putentityfieldstring puts the data returned by getentityfieldstring back into the entity. + +//DP_QC_ENTITYSTRING +void(string s) loadfromdata = #529; +void(string s) loadfromfile = #530; +void(string s) callfunction = #605; +void(float fh, entity e) writetofile = #606; +float(string s) isfunction = #607; +void(entity e, string s) parseentitydata = #608; + +//DP_QC_ETOS +//idea: id Software +//darkplaces implementation: id Software +//builtin definitions: +string(entity ent) etos = #65; +//description: +//prints "entity 1" or similar into a string. (this was a Q2 builtin) + +//DP_QC_EXTRESPONSEPACKET +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +string(void) getextresponse = #624; +//description: +//returns a string of the form "\"ipaddress:port\" data...", or the NULL string +//if no packet was found. Packets can be queued into the client/server by +//sending a packet starting with "\xFF\xFF\xFF\xFFextResponse " to the +//listening port. + +//DP_QC_FINDCHAIN +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(.string fld, string match) findchain = #402; +//description: +//similar to find() but returns a chain of entities like findradius. + +//DP_QC_FINDCHAIN_TOFIELD +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +entity(.string fld, float match, .entity tofield) findradius_tofield = #22; +entity(.string fld, string match, .entity tofield) findchain_tofield = #402; +entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450; +entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403; +//description: +//similar to findchain() etc, but stores the chain into .tofield instead of .chain +//actually, the .entity tofield is an optional field of the the existing findchain* functions + +//DP_QC_FINDCHAINFLAGS +//idea: Sajt +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(.float fld, float match) findchainflags = #450; +//description: +//similar to findflags() but returns a chain of entities like findradius. + +//DP_QC_FINDCHAINFLOAT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(.entity fld, entity match) findchainentity = #403; +entity(.float fld, float match) findchainfloat = #403; +//description: +//similar to findentity()/findfloat() but returns a chain of entities like findradius. + +//DP_QC_FINDFLAGS +//idea: Sajt +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(entity start, .float fld, float match) findflags = #449; +//description: +//finds an entity with the specified flag set in the field, similar to find() + +//DP_QC_FINDFLOAT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(entity start, .entity fld, entity match) findentity = #98; +entity(entity start, .float fld, float match) findfloat = #98; +//description: +//finds an entity or float field value, similar to find(), but for entity and float fields. + +//DP_QC_FS_SEARCH +//idea: Black +//darkplaces implementation: Black +//builtin definitions: +float(string pattern, float caseinsensitive, float quiet) search_begin = #444; +void(float handle) search_end = #445; +float(float handle) search_getsize = #446; +string(float handle, float num) search_getfilename = #447; +//description: +//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload). +//search_end frees a search slot (also done at progs reload). +//search_getsize returns how many filenames were found. +//search_getfilename returns a filename from the search. + +//DP_QC_GETLIGHT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +vector(vector org) getlight = #92; +//description: +//returns the lighting at the requested location (in color), 0-255 range (can exceed 255). + +//DP_QC_GETSURFACE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(entity e, float s) getsurfacenumpoints = #434; +vector(entity e, float s, float n) getsurfacepoint = #435; +vector(entity e, float s) getsurfacenormal = #436; +string(entity e, float s) getsurfacetexture = #437; +float(entity e, vector p) getsurfacenearpoint = #438; +vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; +//description: +//functions to query surface information. + +//DP_QC_GETSURFACEPOINTATTRIBUTE +//idea: BlackHC +//darkplaces implementation: BlackHC +// constants +float SPA_POSITION = 0; +float SPA_S_AXIS = 1; +float SPA_T_AXIS = 2; +float SPA_R_AXIS = 3; // same as SPA_NORMAL +float SPA_TEXCOORDS0 = 4; +float SPA_LIGHTMAP0_TEXCOORDS = 5; +float SPA_LIGHTMAP0_COLOR = 6; +//builtin definitions: +vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; + +//description: +//function to query extended information about a point on a certain surface + +//DP_QC_GETSURFACETRIANGLE +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +float(entity e, float s) getsurfacenumtriangles = #628; +vector(entity e, float s, float n) getsurfacetriangle = #629; +//description: +//function to query triangles of a surface + +//DP_QC_GETTAGINFO +//idea: VorteX, LordHavoc +//DarkPlaces implementation: VorteX +//builtin definitions: +float(entity ent, string tagname) gettagindex = #451; +vector(entity ent, float tagindex) gettaginfo = #452; +//description: +//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index). +//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example. + +//DP_QC_GETTAGINFO_BONEPROPERTIES +//idea: daemon +//DarkPlaces implementation: divVerent +//global definitions: +float gettaginfo_parent; +string gettaginfo_name; +vector gettaginfo_offset; +vector gettaginfo_forward; +vector gettaginfo_right; +vector gettaginfo_up; +//description: +//when this extension is present, gettaginfo fills in some globals with info about the bone that had been queried +//gettaginfo_parent is set to the number of the parent bone, or 0 if it is a root bone +//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo +//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component. + +//DP_QC_GETTIME +//idea: tZork +//darkplaces implementation: tZork, divVerent +//constant definitions: +float GETTIME_FRAMESTART = 0; // time of start of frame +float GETTIME_REALTIME = 1; // current time (may be OS specific) +float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision +float GETTIME_UPTIME = 3; // time since start of the engine +//builtin definitions: +float(float tmr) gettime = #519; +//description: +//some timers to query... + +//DP_QC_GETTIME_CDTRACK +//idea: divVerent +//darkplaces implementation: divVerent +//constant definitions: +float GETTIME_CDTRACK = 4; +//description: +//returns the playing time of the current cdtrack when passed to gettime() +//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels + +//DP_QC_LOG +//darkplaces implementation: divVerent +//builtin definitions: +float log(float f) = #532; +//description: +//logarithm + +//DP_QC_MINMAXBOUND +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(float a, float b) min = #94; +float(float a, float b, float c) min3 = #94; +float(float a, float b, float c, float d) min4 = #94; +float(float a, float b, float c, float d, float e) min5 = #94; +float(float a, float b, float c, float d, float e, float f) min6 = #94; +float(float a, float b, float c, float d, float e, float f, float g) min7 = #94; +float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94; +float(float a, float b) max = #95; +float(float a, float b, float c) max3 = #95; +float(float a, float b, float c, float d) max4 = #95; +float(float a, float b, float c, float d, float e) max5 = #95; +float(float a, float b, float c, float d, float e, float f) max6 = #95; +float(float a, float b, float c, float d, float e, float f, float g) max7 = #95; +float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95; +float(float minimum, float val, float maximum) bound = #96; +//description: +//min returns the lowest of all the supplied numbers. +//max returns the highest of all the supplied numbers. +//bound clamps the value to the range and returns it. + +//DP_QC_MULTIPLETEMPSTRINGS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//this extension makes all builtins returning tempstrings (ftos for example) +//cycle through a pool of multiple tempstrings (at least 16), allowing +//multiple ftos results to be gathered before putting them to use, normal +//quake only had 1 tempstring, causing many headaches. +// +//Note that for longer term storage (or compatibility on engines having +//FRIK_FILE but not this extension) the FRIK_FILE extension's +//strzone/strunzone builtins provide similar functionality (slower though). +// +//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS + +//DP_QC_NUM_FOR_EDICT +//idea: Blub\0 +//darkplaces implementation: Blub\0 +//Function to get the number of an entity - a clean way. +float(entity num) num_for_edict = #512; + +//DP_QC_RANDOMVEC +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +vector() randomvec = #91; +//description: +//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1) + +//DP_QC_SINCOSSQRTPOW +//idea: id Software, LordHavoc +//darkplaces implementation: id Software, LordHavoc +//builtin definitions: +float(float val) sin = #60; +float(float val) cos = #61; +float(float val) sqrt = #62; +float(float a, float b) pow = #97; +//description: +//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively. + +//DP_QC_SPRINTF +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +string(string format, ...) sprintf = #627; +//description: +//you know sprintf :P +//supported stuff: +// % +// optional: <argpos>$ for the argument to format +// flags: #0- + +// optional: <width>, *, or *<argpos>$ for the field width +// optional: .<precision>, .*, or .*<argpos>$ for the precision +// length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int) +// conversions: +// d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int +// i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int +// ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int +// eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double +// s takes a string +// vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space +// For conversions s and c, the flag # makes precision and width interpreted +// as byte count, by default it is interpreted as character count in UTF-8 +// enabled engines. No other conversions can create wide characters, and # +// has another meaning in these. + +//DP_QC_STRFTIME +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +string(float uselocaltime, string format, ...) strftime = #478; +//description: +//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice: +//example: "%Y-%m-%d %H:%M:%S" (result looks like: 2007-02-08 01:03:15) +//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time) +//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function. +// +//practical uses: +//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(TRUE, "%H");hour = stof(s); +//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time. +//activating eastereggs in singleplayer games on certain dates. +// +//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries. +//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)". +//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!). +//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing. + +//DP_QC_STRINGCOLORFUNCTIONS +//idea: Dresk +//darkplaces implementation: Dresk +//builtin definitions: +float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes +string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided +//description: +//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes + +//DP_QC_STRING_CASE_FUNCTIONS +//idea: Dresk +//darkplaces implementation: LordHavoc / Dresk +//builtin definitions: +string(string s) strtolower = #480; // returns the passed in string in pure lowercase form +string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form +//description: +//provides simple string uppercase and lowercase functions + +//DP_QC_TOKENIZEBYSEPARATOR +//idea: Electro, SavageX, LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(string s, string separator1, ...) tokenizebyseparator = #479; +//description: +//this function returns tokens separated by any of the supplied separator strings, example: +//numnumbers = tokenizebyseparator("10.2.3.4", "."); +//returns 4 and the tokens are "10" "2" "3" "4" +//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000") + +//DP_QC_TOKENIZE_CONSOLE +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +float(string s) tokenize_console = #514; +float(float i) argv_start_index = #515; +float(float i) argv_end_index = #516; +//description: +//this function returns tokens separated just like the console does +//also, functions are provided to get the index of the first and last character of each token in the original string +//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token. + +//DP_QC_TRACEBOX +//idea: id Software +//darkplaces implementation: id Software +//builtin definitions: +void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90; +//description: +//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well). + +//DP_QC_TRACETOSS +//idea: id Software +//darkplaces implementation: id Software +//builtin definitions: +void(entity ent, entity ignore) tracetoss = #64; +//description: +//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity. + +//DP_QC_TRACE_MOVETYPE_HITMODEL +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constant definitions: +float MOVE_HITMODEL = 4; +//description: +//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex) + +//DP_QC_TRACE_MOVETYPE_WORLDONLY +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constant definitions: +float MOVE_WORLDONLY = 3; +//description: +//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions + +//DP_QC_UNLIMITEDTEMPSTRINGS +//idea: divVerent +//darkplaces implementation: LordHavoc +//description: +//this extension alters Quake behavior such that instead of reusing a single +//tempstring (or multiple) there are an unlimited number of tempstrings, which +//are removed only when a QC function invoked by the engine returns, +//eliminating almost all imaginable concerns with string handling in QuakeC. +// +//in short: +//you can now use and abuse tempstrings as much as you like, you still have to +//use strzone (FRIK_FILE) for permanent storage however. +// +// +// +//implementation notes for other engine coders: +//these tempstrings are expected to be stored in a contiguous buffer in memory +//which may be fixed size or controlled by a cvar, or automatically grown on +//demand (in the case of DarkPlaces). +// +//this concept is similar to quake's Zone system, however these are all freed +//when the QC interpreter returns. +// +//this is basically a poor man's garbage collection system for strings. + +//DP_QC_VECTOANGLES_WITH_ROLL +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +vector(vector forward, vector up) vectoangles2 = #51; // same number as vectoangles +//description: +//variant of vectoangles that takes an up vector to calculate roll angle (also uses this to calculate yaw correctly if the forward is straight up or straight down) +//note: just like normal vectoangles you need to negate the pitch of the returned angles if you want to feed them to makevectors or assign to self.v_angle + +//DP_QC_VECTORVECTORS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector dir) vectorvectors = #432; +//description: +//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles. + +//DP_QC_WHICHPACK +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +string(string filename) whichpack = #503; +//description: +//returns the name of the pak/pk3/whatever containing the given file, in the same path space as FRIK_FILE functions use (that is, possibly with a path name prefix) + +//DP_QC_URI_ESCAPE +//idea: divVerent +//darkplaces implementation: divVerent +//URI::Escape's functionality +string(string in) uri_escape = #510; +string(string in) uri_unescape = #511; + +//DP_QC_URI_GET +//idea: divVerent +//darkplaces implementation: divVerent +//loads text from an URL into a string +//returns 1 on success of initiation, 0 if there are too many concurrent +//connections already or if the URL is invalid +//the following callback will receive the data and MUST exist! +// void(float id, float status, string data) URI_Get_Callback; +//status is either +// negative for an internal error, +// 0 for success, or +// the HTTP response code on server error (e.g. 404) +//if 1 is returned by uri_get, the callback will be called in the future +float(string url, float id) uri_get = #513; + +//DP_QC_URI_POST +//idea: divVerent +//darkplaces implementation: divVerent +//loads text from an URL into a string after POSTing via HTTP +//works like uri_get, but uri_post sends data with Content-Type: content_type to the server +//and uri_post sends the string buffer buf, joined using the delimiter delim +float(string url, float id, string content_type, string data) uri_post = #513; +float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513; + +//DP_SKELETONOBJECTS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//this extension indicates that FTE_CSQC_SKELETONOBJECTS functionality is available in server QC (as well as CSQC). + +//DP_SV_SPAWNFUNC_PREFIX +//idea: divVerent +//darkplaces implementation: divVerent +//Make functions whose name start with spawnfunc_ take precedence as spawn function for loading entities. +//Useful if you have a field ammo_shells (required in any Quake mod) but want to support spawn functions called ammo_shells (like in Q3A). +//Optionally, you can declare a global "float require_spawnfunc_prefix;" which will require ANY spawn function to start with that prefix. + + +//DP_QUAKE2_MODEL +//idea: quake community +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports Quake2 .md2 files. + +//DP_QUAKE2_SPRITE +//idea: LordHavoc +//darkplaces implementation: Elric +//description: +//shows that the engine supports Quake2 .sp2 files. + +//DP_QUAKE3_MAP +//idea: quake community +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports Quake3 .bsp files. + +//DP_QUAKE3_MODEL +//idea: quake community +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports Quake3 .md3 files. + +//DP_REGISTERCVAR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(string name, string value) registercvar = #93; +//description: +//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits. +//NOTE: DP_CON_SET is much better. + +//DP_SND_DIRECTIONLESSATTNNONE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources). + +//DP_SND_FAKETRACKS +//idea: requested +//darkplaces implementation: Elric +//description: +//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound. +//Note: also plays .ogg with DP_SND_OGGVORBIS extension. + +//DP_SND_SOUND7_WIP1 +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8; +float SOUNDFLAG_RELIABLE = 1; +//description: +//plays a sound, with some more flags +//extensions to sound(): +//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto", +// i.e. support multiple sounds at once, but cannot be stopped/restarted +//- a speed parameter has been reserved for later addition of pitch shifting. +// it MUST be set to 0 for now, meaning "no pitch change" +//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send +// to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default); +// similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE +//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by +// snd_channel1volume, etc. (so, a channel shares the cvar with its respective +// auto-channel); however, the mod MUST define snd_channel8volume and upwards +// in default.cfg if they are to be used, as the engine does not create them +// to not litter the cvar list +//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and +// flags as extra 7th and 8th argument +//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP +//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support +// the finished extension once done + +//DP_SND_OGGVORBIS +//idea: Transfusion +//darkplaces implementation: Elric +//description: +//the engine supports loading Ogg Vorbis sound files. Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg). + +//DP_SND_STEREOWAV +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//the engine supports stereo WAV files. (useful with DP_SND_DIRECTIONLESSATTNNONE for music) + +//DP_SND_GETSOUNDTIME +//idea: VorteX +//darkplaces implementation: VorteX +//constant definitions: +float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error +float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.) +//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK) +//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs +//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities +//examples of use: +// - QC-driven looped sounds +// - QC events when sound playing is finished +// - toggleable ambientsounds +// - subtitles + +//DP_VIDEO_DPV +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//console commands: +// playvideo <videoname> - start playing video +// stopvideo - stops current video +//description: indicated that engine support playing videos in DPV format + +//DP_VIDEO_SUBTITLES +//idea: VorteX +//darkplaces implementation: VorteX +//cvars: +// cl_video_subtitles - toggles subtitles showing +// cl_video_subtitles_lines - how many lines to reserve for subtitles +// cl_video_subtitles_textsize - font size +//console commands: +// playvideo <videoname> <custom_subtitles_file> - start playing video +// stopvideo - stops current video +//description: indicates that engine support subtitles on videos +//subtitles stored in external text files, each video file has it's default subtitles file ( <videoname>.dpsubs ) +//example: for video/act1.dpv default subtitles file will be video/act1.dpsubs +//also video could be played with custom subtitles file by utilizing second parm of playvideo command +//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens: +// <start> <end> "string" +// start: subtitle start time in seconds +// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, +// if below 0 - show until next subtitles minus this number of seconds +// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed +//example of subtitle file: +// 3 0 "Vengeance! Vengeance for my eternity of suffering!" +// 9 0 "Whelp! As if you knew what eternity was!" +// 13 0 "Grovel before your true master." +// 17 0 "Never!" +// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..." + +//DP_SOLIDCORPSE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//solid definitions: +float SOLID_CORPSE = 5; +//description: +//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline. + +//DP_SPRITE32 +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//the engine supports .spr32 sprites. + +//DP_SV_BOTCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constants: +float CLIENTTYPE_DISCONNECTED = 0; +float CLIENTTYPE_REAL = 1; +float CLIENTTYPE_BOT = 2; +float CLIENTTYPE_NOTACLIENT = 3; +//builtin definitions: +entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available +float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants +//description: +//spawns a client with no network connection, to allow bots to use client slots with no hacks. +//How to use: +/* + // to spawn a bot + local entity oldself; + oldself = self; + self = spawnclient(); + if (!self) + { + bprint("Can not add bot, server full.\n"); + self = oldself; + return; + } + self.netname = "Yoyobot"; + self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants + ClientConnect(); + PutClientInServer(); + self = oldself; + + // to remove all bots + local entity head; + head = find(world, classname, "player"); + while (head) + { + if (clienttype(head) == CLIENTTYPE_BOT) + dropclient(head); + head = find(head, classname, "player"); + } + + // to identify if a client is a bot (for example in PlayerPreThink) + if (clienttype(self) == CLIENTTYPE_BOT) + botthink(); +*/ +//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT +//How it works: +//creates a new client, calls SetNewParms and stores the parms, and returns the client. +//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually +//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is). +//parms work the same on bot clients as they do on real clients, and do carry from level to level + +//DP_SV_BOUNCEFACTOR +//idea: divVerent +//darkplaces implementation: divVerent +//field definitions: +.float bouncefactor; // velocity multiplier after a bounce +.float bouncestop; // bounce stops if velocity to bounce plane is < bouncestop * gravity AFTER the bounce +//description: +//allows qc to customize MOVETYPE_BOUNCE a bit + +//DP_SV_CLIENTCAMERA +//idea: LordHavoc, others +//darkplaces implementation: Black +//field definitions: +.entity clientcamera; // override camera entity +//description: +//allows another entity to be the camera for a client, for example a remote camera, this is similar to sending svc_setview manually except that it also changes the network culling appropriately. + +//DP_SV_CLIENTCOLORS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float clientcolors; // colors of the client (format: pants + shirt * 16) +//description: +//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed + +//DP_SV_CLIENTNAME +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed + +//DP_SV_CUSTOMIZEENTITYFORCLIENT +//idea: LordHavoc +//darkplaces implementation: [515] and LordHavoc +//field definitions: +.float() customizeentityforclient; // self = this entity, other = client entity +//description: +//allows qc to modify an entity before it is sent to each client, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc +//tips on writing customize functions: +//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server. +//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent). +//example ideas for use of this extension: +//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;}; +//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;}; +//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;}; +//implementation notes: +//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis). + +//DP_SV_DISCARDABLEDEMO +//idea: parasti +//darkplaces implementation: parasti +//field definitions: +.float discardabledemo; +//description: +//when this field is set to a non-zero value on a player entity, a possibly recorded server-side demo for the player is discarded +//Note that this extension only works if: +// auto demos are enabled (the cvar sv_autodemo_perclient is set) +// discarding demos is enabled (the cvar sv_autodemo_perclient_discardable is set) + +//DP_SV_DRAWONLYTOCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.entity drawonlytoclient; +//description: +//the entity is only visible to the specified client. + +//DP_SV_DROPCLIENT +//idea: FrikaC +//darkplaces implementation: LordHavoc +//builtin definitions: +void(entity clent) dropclient = #453; +//description: +//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine + +//DP_SV_EFFECT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; +//SVC definitions: +//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate +//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate +//description: +//clientside playback of simple custom sprite effects (explosion sprites, etc). + +//DP_SV_ENTITYCONTENTSTRANSITION +//idea: Dresk +//darkplaces implementation: Dresk +//field definitions: +.void(float nOriginalContents, float nNewContents) contentstransition; +//description: +//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed. +//The first parameter provides the entities original contents, prior to the transition. The second parameter provides the new contents. +//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds. + +//DP_SV_MOVETYPESTEP_LANDEVENT +//idea: Dresk +//darkplaces implementation: Dresk +//field definitions: +.void(vector vImpactVelocity) movetypesteplandevent; +//description: +//This field function, when provided, is triggered on a MOVETYPE_STEP entity when it experiences "land event". +// The standard engine behavior for this event is to play the sv_sound_land CVar sound. +//The parameter provides the velocity of the entity at the time of the impact. The z value may therefore be used to calculate how "hard" the entity struck the surface. +//NOTE: If this field function is provided on a MOVETYPE_STEP entity, the standard sv_sound_land sound IS SUPPRESSED to allow for authors to create their own feedback. + +//DP_SV_POINTSOUND +//idea: Dresk +//darkplaces implementation: Dresk +//builtin definitions: +void(vector origin, string sample, float volume, float attenuation) pointsound = #483; +//description: +//Similar to the standard QC sound function, this function takes an origin instead of an entity and omits the channel parameter. +// This allows sounds to be played at arbitrary origins without spawning entities. + +//DP_SV_ONENTITYNOSPAWNFUNCTION +//idea: Dresk +//darkplaces implementation: Dresk +//engine-called QC prototypes: +//void() SV_OnEntityNoSpawnFunction; +//description: +// This function is called whenever an entity on the server has no spawn function, and therefore has no defined QC behavior. +// You may as such dictate the behavior as to what happens to the entity. +// To mimic the engine's default behavior, simply call remove(self). + +//DP_SV_ONENTITYPREPOSTSPAWNFUNCTION +//idea: divVerent +//darkplaces implementation: divVerent +//engine-called QC prototypes: +//void() SV_OnEntityPreSpawnFunction; +//void() SV_OnEntityPostSpawnFunction; +//description: +// These functions are called BEFORE or AFTER an entity is spawned the regular way. +// You may as such dictate the behavior as to what happens to the entity. +// SV_OnEntityPreSpawnFunction is called before even looking for the spawn function, so you can even change its classname in there. If it remove()s the entity, the spawn function will not be looked for. +// SV_OnEntityPostSpawnFunction is called ONLY after its spawn function or SV_OnEntityNoSpawnFunction was called, and skipped if the entity got removed by either. + +//DP_SV_MODELFLAGS_AS_EFFECTS +//idea: LordHavoc, Dresk +//darkplaces implementation: LordHavoc +//field definitions: +.float modelflags; +//constant definitions: +float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own +float MF_ROCKET = 1; // leave a trail +float MF_GRENADE = 2; // leave a trail +float MF_GIB = 4; // leave a trail +float MF_ROTATE = 8; // rotate (bonus items) +float MF_TRACER = 16; // green split trail +float MF_ZOMGIB = 32; // small blood trail +float MF_TRACER2 = 64; // orange split trail +float MF_TRACER3 = 128; // purple trail +//description: +//this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc. +//setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS. +// +//silly example modification #1 to W_FireRocket in weapons.qc: +//missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail +//silly example modification #2 to W_FireRocket in weapons.qc: +//missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail +// +//note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm. +// +//note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values. + +//DP_SV_NETADDRESS +//idea: Dresk +//darkplaces implementation: Dresk +//field definitions: +.string netaddress; +//description: +// provides the netaddress of the associated entity (ie. 127.0.0.1) and "null/botclient" if the netconnection of the entity is invalid + +//DP_SV_NODRAWTOCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.entity nodrawtoclient; +//description: +//the entity is not visible to the specified client. + +//DP_SV_PING +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float ping; +//description: +//continuously updated field indicating client's ping (based on average of last 16 packet time differences). + +//DP_SV_PING_PACKETLOSS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float ping_packetloss; +.float ping_movementloss; +//description: +//continuously updated field indicating client's packet loss, and movement loss (i.e. packet loss affecting player movement). + +//DP_SV_POINTPARTICLES +//idea: Spike +//darkplaces implementation: LordHavoc +//function definitions: +float(string effectname) particleeffectnum = #335; // same as in CSQC +void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC +void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC +//SVC definitions: +//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end +//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count +//float svc_pointparticles1 = 62; // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1 +//description: +//provides the ability to spawn non-standard particle effects, typically these are defined in a particle effect information file such as effectinfo.txt in darkplaces. +//this is a port of particle effect features from clientside QC (EXT_CSQC) to server QC, as these effects are potentially useful to all games even if they do not make use of EXT_CSQC. +//warning: server must have same order of effects in effectinfo.txt as client does or the numbers would not match up, except for standard quake effects which are always the same numbers. + +//DP_SV_PUNCHVECTOR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.vector punchvector; +//description: +//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS). + +//DP_SV_PLAYERPHYSICS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.vector movement; +//cvar definitions: +//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics) +//engine-called QC prototypes: +//void() SV_PlayerPhysics; +//description: +//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit) + +//DP_PHYSICS_ODE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//globals: +//new movetypes: +const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builtins applied +//new solid types: +const float SOLID_PHYSICS_BOX = 32; +const float SOLID_PHYSICS_SPHERE = 33; +const float SOLID_PHYSICS_CAPSULE = 34; +const float SOLID_PHYSICS_TRIMESH = 35; +//SOLID_BSP; +//joint types: +const float JOINTTYPE_POINT = 1; +const float JOINTTYPE_HINGE = 2; +const float JOINTTYPE_SLIDER = 3; +const float JOINTTYPE_UNIVERSAL = 4; +const float JOINTTYPE_HINGE2 = 5; +const float JOINTTYPE_FIXED = -1; +// common joint properties: +// .entity aiment, enemy; // connected objects +// .vector movedir; +// for a spring: +// movedir_x = spring constant (force multiplier, must be > 0) +// movedir_y = spring dampening constant to prevent oscillation (must be > 0) +// movedir_z = spring stop position (+/-) +// for a motor: +// movedir_x = desired motor velocity +// movedir_y = -1 * max motor force to use +// movedir_z = stop position (+/-), set to 0 for no stop +// note that ODE does not support both in one anyway +//field definitions: +.float mass; // ODE mass, standart value is 1 +.float bouncefactor; +.float bouncestop; +.float jointtype; +//builtin definitions: +void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object +void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force +void(entity e, vector torque) physics_addtorque = #542; // add relative torque +//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option +//be sure to checkextension for it to know if library is loaded and ready, also to enable physics set "physics_ode" cvar to 1 +//note: this extension is highly experimental and may be unstable +//note: use SOLID_BSP on entities to get a trimesh collision models on them + +//DP_SV_PRINT +//idea: id Software (QuakeWorld Server) +//darkplaces implementation: Black, LordHavoc +void(string s, ...) print = #339; // same number as in EXT_CSQC +//description: +//this is identical to dprint except that it always prints regardless of the developer cvar. + +//DP_SV_PRECACHEANYTIME +//idea: id Software (Quake2) +//darkplaces implementation: LordHavoc +//description: +//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache). + +//DP_SV_QCSTATUS +//idea: divVerent +//darkplaces implementation: divVerent +//1. A global variable +string worldstatus; +//Its content is set as "qcstatus" field in the rules. +//It may be at most 255 characters, and must not contain newlines or backslashes. +//2. A per-client field +.string clientstatus; +//It is sent instead of the "frags" in status responses. +//It should always be set in a way so that stof(player.clientstatus) is a meaningful score value. Other info may be appended. If used this way, the cvar sv_status_use_qcstatus may be set to 1, and then this value will replace the frags in "status". +//Currently, qstat does not support this and will not show player info if used and set to anything other than ftos(some integer). + +//DP_SV_ROTATINGBMODEL +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however). +//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate) + +//DP_SV_SETCOLOR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(entity ent, float colors) setcolor = #401; +//engine called QC functions (optional): +//void(float color) SV_ChangeTeam; +//description: +//setcolor sets the color on a client and updates internal color information accordingly (equivalent to stuffing a "color" command but immediate) +//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this. +//the color format is pants + shirt * 16 (0-255 potentially) + +//DP_SV_SLOWMO +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//cvars: +//"slowmo" (0+, default 1) +//description: +//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it. +//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed). + +//DP_SV_WRITEPICTURE +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +void(float to, string s, float sz) WritePicture = #501; +//description: +//writes a picture to the data stream so CSQC can read it using ReadPicture, which has the definition +// string(void) ReadPicture = #501; +//The picture data is sent as at most sz bytes, by compressing to low quality +//JPEG. The data being sent will be equivalent to: +// WriteString(to, s); +// WriteShort(to, imagesize); +// for(i = 0; i < imagesize; ++i) +// WriteByte(to, [the i-th byte of the compressed JPEG image]); + +//DP_SV_WRITEUNTERMINATEDSTRING +//idea: FrikaC +//darkplaces implementation: Sajt +//builtin definitions: +void(float to, string s) WriteUnterminatedString = #456; +//description: +//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself. +//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivalent of it in his FrikBot mod years ago involving WriteByte calls on each character. + +//DP_TE_BLOOD +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector velocity, float howmany) te_blood = #405; +//temp entity definitions: +float TE_BLOOD = 50; +//protocol: +//vector origin +//byte xvelocity (-128 to +127) +//byte yvelocity (-128 to +127) +//byte zvelocity (-128 to +127) +//byte count (0 to 255, how much blood) +//description: +//creates a blood effect. + +//DP_TE_BLOODSHOWER +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; +//temp entity definitions: +//float TE_BLOODSHOWER = 52; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//coord explosionspeed (velocity of blood particles flying out of the center) +//short count (number of blood particles) +//description: +//creates an exploding shower of blood, for making gibbings more convincing. + +//DP_TE_CUSTOMFLASH +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, float radius, float lifetime, vector color) te_customflash = #417; +//temp entity definitions: +//float TE_CUSTOMFLASH = 73; +//protocol: +//vector origin +//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius) +//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime) +//byte red (0.0 to 1.0 converted to 0-255) +//byte green (0.0 to 1.0 converted to 0-255) +//byte blue (0.0 to 1.0 converted to 0-255) +//description: +//creates a customized light flash. + +//DP_TE_EXPLOSIONRGB +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector color) te_explosionrgb = #407; +//temp entity definitions: +//float TE_EXPLOSIONRGB = 53; +//protocol: +//vector origin +//byte red (0.0 to 1.0 converted to 0 to 255) +//byte green (0.0 to 1.0 converted to 0 to 255) +//byte blue (0.0 to 1.0 converted to 0 to 255) +//description: +//creates a colored explosion effect. + +//DP_TE_FLAMEJET +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector vel, float howmany) te_flamejet = #457; +//temp entity definitions: +//float TE_FLAMEJET = 74; +//protocol: +//vector origin +//vector velocity +//byte count (0 to 255, how many flame particles) +//description: +//creates a single puff of flame particles. (not very useful really) + +//DP_TE_PARTICLECUBE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; +//temp entity definitions: +//float TE_PARTICLECUBE = 54; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//vector velocity +//short count +//byte color (palette color) +//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?) +//coord randomvel (how much to jitter the velocity) +//description: +//creates a cloud of particles, useful for forcefields but quite customizable. + +//DP_TE_PARTICLERAIN +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; +//temp entity definitions: +//float TE_PARTICLERAIN = 55; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//vector velocity (velocity of particles) +//short count (number of particles) +//byte color (8bit palette color) +//description: +//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube. + +//DP_TE_PARTICLESNOW +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; +//temp entity definitions: +//float TE_PARTICLERAIN = 56; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//vector velocity (velocity of particles) +//short count (number of particles) +//byte color (8bit palette color) +//description: +//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow. + +//DP_TE_PLASMABURN +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_plasmaburn = #433; +//temp entity definitions: +//float TE_PLASMABURN = 75; +//protocol: +//vector origin +//description: +//creates a small light flash (radius 200, time 0.2) and marks the walls. + +//DP_TE_QUADEFFECTS1 +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_gunshotquad = #412; +void(vector org) te_spikequad = #413; +void(vector org) te_superspikequad = #414; +void(vector org) te_explosionquad = #415; +//temp entity definitions: +//float TE_GUNSHOTQUAD = 57; // [vector] origin +//float TE_SPIKEQUAD = 58; // [vector] origin +//float TE_SUPERSPIKEQUAD = 59; // [vector] origin +//float TE_EXPLOSIONQUAD = 70; // [vector] origin +//protocol: +//vector origin +//description: +//all of these just take a location, and are equivalent in function (but not appearance :) to the original TE_GUNSHOT, etc. + +//DP_TE_SMALLFLASH +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_smallflash = #416; +//temp entity definitions: +//float TE_SMALLFLASH = 72; +//protocol: +//vector origin +//description: +//creates a small light flash (radius 200, time 0.2). + +//DP_TE_SPARK +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector vel, float howmany) te_spark = #411; +//temp entity definitions: +//float TE_SPARK = 51; +//protocol: +//vector origin +//byte xvelocity (-128 to 127) +//byte yvelocity (-128 to 127) +//byte zvelocity (-128 to 127) +//byte count (number of sparks) +//description: +//creates a shower of sparks and a smoke puff. + +//DP_TE_STANDARDEFFECTBUILTINS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_gunshot = #418; +void(vector org) te_spike = #419; +void(vector org) te_superspike = #420; +void(vector org) te_explosion = #421; +void(vector org) te_tarexplosion = #422; +void(vector org) te_wizspike = #423; +void(vector org) te_knightspike = #424; +void(vector org) te_lavasplash = #425; +void(vector org) te_teleport = #426; +void(vector org, float color, float colorlength) te_explosion2 = #427; +void(entity own, vector start, vector end) te_lightning1 = #428; +void(entity own, vector start, vector end) te_lightning2 = #429; +void(entity own, vector start, vector end) te_lightning3 = #430; +void(entity own, vector start, vector end) te_beam = #431; +//description: +//to make life easier on mod coders. + +//DP_TRACE_HITCONTENTSMASK_SURFACEINFO +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//globals: +.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls +float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace +float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit) +float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface +string trace_dphittexturename; // texture name of impacted surface +//constants: +float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box +float DPCONTENTS_WATER = 2; +float DPCONTENTS_SLIME = 4; +float DPCONTENTS_LAVA = 8; +float DPCONTENTS_SKY = 16; +float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel +float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity +float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn +float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement +float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement +float DPCONTENTS_DONOTENTER = 1024; // AI hint brush +float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA +float DPCONTENTS_BOTCLIP = 2048; // AI hint brush +float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks) +float Q3SURFACEFLAG_NODAMAGE = 1; +float Q3SURFACEFLAG_SLICK = 2; // low friction surface +float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set) +float Q3SURFACEFLAG_LADDER = 8; // climbable surface +float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky) +float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky) +float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact +float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc) +float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds +float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds +float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc) +//description: +//adds additional information after a traceline/tracebox/tracetoss call. +//also (very important) sets trace_* globals before calling .touch functions, +//this allows them to inspect the nature of the collision (for example +//determining if a projectile hit sky), clears trace_* variables for the other +//object in a touch event (that is to say, a projectile moving will see the +//trace results in its .touch function, but the player it hit will see very +//little information in the trace_ variables as it was not moving at the time) + +//DP_VIEWZOOM +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float viewzoom; +//description: +//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such) + +//EXT_BITSHIFT +//idea: Spike +//darkplaces implementation: [515] +//builtin definitions: +float(float number, float quantity) bitshift = #218; +//description: +//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like). +//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you. + +//FRIK_FILE +//idea: FrikaC +//darkplaces implementation: LordHavoc +//builtin definitions: +float(string s) stof = #81; // get numerical value from a string +float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason +void(float fhandle) fclose = #111; // closes a file +string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring +void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file +float(string s) strlen = #114; // returns how many characters are in a string +string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring +string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version +vector(string s) stov = #117; // returns vector value from a string +string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often) +void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!) +//constants: +float FILE_READ = 0; +float FILE_APPEND = 1; +float FILE_WRITE = 2; +//cvars: +//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb) +//description: +//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space. +// +//NOTE: strzone functionality is partially superseded by +//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed +//NOTE: substring is upgraded by FTE_STRINGS extension with negative start/length handling identical to php 5.2.0 + +//FTE_CSQC_SKELETONOBJECTS +//idea: Spike, LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +// all skeleton numbers are 1-based (0 being no skeleton) +// all bone numbers are 1-based (0 being invalid) +float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model. +float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure +float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist +string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist +float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this) +float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity +vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone) +vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity) +void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone) +void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone) +void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones) +void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse +void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work) +float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found +float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0. +//fields: +.float skeletonindex; // active skeleton overriding standard animation on model +.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4) +.float frame2; // secondary framegroup animation (strength = lerpfrac) +.float frame3; // tertiary framegroup animation (strength = lerpfrac3) +.float frame4; // quaternary framegroup animation (strength = lerpfrac4) +.float lerpfrac; // strength of framegroup blend +.float lerpfrac3; // strength of framegroup blend +.float lerpfrac4; // strength of framegroup blend +.float frame1time; // start time of framegroup animation +.float frame2time; // start time of framegroup animation +.float frame3time; // start time of framegroup animation +.float frame4time; // start time of framegroup animation +//description: +//this extension provides a way to do complex skeletal animation on an entity. +// +//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client) +// +//notes: +//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render). +//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files). +//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton. +//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose. +// +//features include: +//multiple animations blended together. +//animating a model with animations from another model with a compatible skeleton. +//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head. +//custom bone controllers - for example making eyes track a target location. +// +// +// +//example code follows... +// +//this helper function lets you identify (by parentage) what group a bone +//belongs to - for example "torso", "leftarm", would return 1 ("torso") for +//all children of the bone named "torso", unless they are children of +//"leftarm" (which is a child of "torso") which would return 2 instead... +float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup = +{ + local string bonename; + while (bonenum >= 0) + { + bonename = skel_get_bonename(skel, bonenum); + if (bonename == g1) return 1; + if (bonename == g2) return 2; + if (bonename == g3) return 3; + if (bonename == g4) return 4; + if (bonename == g5) return 5; + if (bonename == g6) return 6; + bonenum = skel_get_boneparent(skel, bonenum); + } + return 0; +}; +// create a skeletonindex for our player using current modelindex +void() example_skel_player_setup = +{ + self.skeletonindex = skel_create(self.modelindex); +}; +// setup bones of skeleton based on an animation +// note: animmodelindex can be a different model than self.modelindex +void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin = +{ + // start with our standard animation + self.frame = framegroup; + self.frame2 = 0; + self.frame3 = 0; + self.frame4 = 0; + self.frame1time = framegroupstarttime; + self.frame2time = 0; + self.frame3time = 0; + self.frame4time = 0; + self.lerpfrac = 0; + self.lerpfrac3 = 0; + self.lerpfrac4 = 0; + skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000); +}; +// apply a different framegroup animation to bones with a specified parent +void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride = +{ + local float bonenum; + local float numbones; + self.frame = framegroup; + self.frame2 = 0; + self.frame3 = 0; + self.frame4 = 0; + self.frame1time = framegroupstarttime; + self.frame2time = 0; + self.frame3time = 0; + self.frame4time = 0; + self.lerpfrac = 0; + self.lerpfrac3 = 0; + self.lerpfrac4 = 0; + bonenum = 0; + numbones = skel_get_numbones(self.skeletonindex); + while (bonenum < numbones) + { + if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1) + skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1); + bonenum = bonenum + 1; + } +}; +// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling +void(vector eyetarget, string bonename) example_skel_player_update_eyetarget = +{ + local float bonenum; + local vector ang; + local vector oldforward, oldright, oldup; + local vector relforward, relright, relup, relorg; + local vector boneforward, boneright, boneup, boneorg; + local vector parentforward, parentright, parentup, parentorg; + local vector u, v; + local vector modeleyetarget; + bonenum = skel_find_bone(self.skeletonindex, bonename) - 1; + if (bonenum < 0) + return; + oldforward = v_forward; + oldright = v_right; + oldup = v_up; + v = eyetarget - self.origin; + modeleyetarget_x = v * v_forward; + modeleyetarget_y = 0-v * v_right; + modeleyetarget_z = v * v_up; + // this is an eyeball, make it point at the target location + // first get all the data we can... + relorg = skel_get_bonerel(self.skeletonindex, bonenum); + relforward = v_forward; + relright = v_right; + relup = v_up; + boneorg = skel_get_boneabs(self.skeletonindex, bonenum); + boneforward = v_forward; + boneright = v_right; + boneup = v_up; + parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum)); + parentforward = v_forward; + parentright = v_right; + parentup = v_up; + // get the vector from the eyeball to the target + u = modeleyetarget - boneorg; + // now transform it inversely by the parent matrix to produce new rel vectors + v_x = u * parentforward; + v_y = u * parentright; + v_z = u * parentup; + ang = vectoangles2(v, relup); + ang_x = 0 - ang_x; + makevectors(ang); + // set the relative bone matrix + skel_set_bone(self.skeletonindex, bonenum, relorg); + // restore caller's v_ vectors + v_forward = oldforward; + v_right = oldright; + v_up = oldup; +}; +// delete skeleton when we're done with it +// note: skeleton remains valid until next frame when it is really deleted +void() example_skel_player_delete = +{ + skel_delete(self.skeletonindex); + self.skeletonindex = 0; +}; +// +// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS +// + +//KRIMZON_SV_PARSECLIENTCOMMAND +//idea: KrimZon +//darkplaces implementation: KrimZon, LordHavoc +//engine-called QC prototypes: +//void(string s) SV_ParseClientCommand; +//builtin definitions: +void(entity e, string s) clientcommand = #440; +float(string s) tokenize = #441; +string(float n) argv = #442; +//description: +//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it + +//NEH_CMD_PLAY2 +//idea: Nehahra +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports the "play2" console command (plays a sound without spatialization). + +//NEH_RESTOREGAME +//idea: Nehahra +//darkplaces implementation: LordHavoc +//engine-called QC prototypes: +//void() RestoreGame; +//description: +//when a savegame is loaded, this function is called + +//NEXUIZ_PLAYERMODEL +//idea: Nexuiz +//darkplaces implementation: Black +//console commands: +//playermodel <name> - FIXME: EXAMPLE NEEDED +//playerskin <name> - FIXME: EXAMPLE NEEDED +//field definitions: +.string playermodel; // name of player model sent by client +.string playerskin; // name of player skin sent by client +//description: +//these client properties are used by Nexuiz. + +//NXQ_GFX_LETTERBOX +//idea: nxQuake +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view + +//PRYDON_CLIENTCURSOR +//idea: FrikaC +//darkplaces implementation: LordHavoc +//effects bit: +float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten) +//field definitions: +.float cursor_active; // true if cl_prydoncursor mode is on +.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused) +.vector cursor_trace_start; // position of camera +.vector cursor_trace_endpos; // position of cursor in world (as traced from camera) +.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt) +//cvar definitions: +//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented) +//description: +//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit. +//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen. +//the clientside trace skips transparent entities (except those marked EF_SELECTABLE). +//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2). +//intended to be used by Prydon Gate. + +//TENEBRAE_GFX_DLIGHTS +//idea: Tenebrae +//darkplaces implementation: LordHavoc +//fields: +.float light_lev; // radius (does not affect brightness), typical value 350 +.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast) +.float style; // light style (like normal light entities, flickering torches or switchable, etc) +.float pflags; // flags (see PFLAGS_ constants) +.vector angles; // orientation of the light +.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped +//constants: +float PFLAGS_NOSHADOW = 1; // light does not cast shadows +float PFLAGS_CORONA = 2; // light has a corona flare +float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!) +//description: +//more powerful dynamic light settings +//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them) +//changes compared to tenebrae (because they're too 'leet' for standards): +//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they) +//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW) + +//TW_SV_STEPCONTROL +//idea: Transfusion +//darkplaces implementation: LordHavoc +//cvars: +//sv_jumpstep (0/1, default 1) +//sv_stepheight (default 18) +//description: +//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be. + +//FTE_QC_CHECKPVS +//idea: Urre +//darkplaces implementation: divVerent +//builtin definitions: +float checkpvs(vector viewpos, entity viewee) = #240; +//description: +//returns true if viewee can be seen from viewpos according to PVS data + +//FTE_STRINGS +//idea: many +//darkplaces implementation: KrimZon +//builtin definitions: +float(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive +float(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character +string(float c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127. +string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum. +string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding +string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and " +string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found +float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character. +float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar +float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp +//string(string s, float start, float length) substring = #116; // see note below +//description: +//various string manipulation functions +//note: substring also exists in FRIK_FILE but this extension adds negative start and length as valid cases (see note above), substring is consistent with the php 5.2.0 substr function (not 5.2.3 behavior) +//substring returns a section of a string as a tempstring, if given negative +// start the start is measured back from the end of the string, if given a +// negative length the length is the offset back from the end of the string to +// stop at, rather than being relative to start, if start is negative and +// larger than length it is treated as 0. +// examples of substring: +// substring("blah", -3, 3) returns "lah" +// substring("blah", 3, 3) returns "h" +// substring("blah", -10, 3) returns "bla" +// substring("blah", -10, -3) returns "b" + +//DP_CON_BESTWEAPON +//idea: many +//darkplaces implementation: divVerent +//description: +//allows QC to register weapon properties for use by the bestweapon command, for mods that change required ammo count or type for the weapons +//it is done using console commands sent via stuffcmd: +// register_bestweapon quake +// register_bestweapon clear +// register_bestweapon <shortname> <impulse> <itemcode> <activeweaponcode> <ammostat> <ammomin> +//for example, this is what Quake uses: +// register_bestweapon 1 1 4096 4096 6 0 // STAT_SHELLS is 6 +// register_bestweapon 2 2 1 1 6 1 +// register_bestweapon 3 3 2 2 6 1 +// register_bestweapon 4 4 4 4 7 1 // STAT_NAILS is 7 +// register_bestweapon 5 5 8 8 7 1 +// register_bestweapon 6 6 16 16 8 1 // STAT_ROCKETS is 8 +// register_bestweapon 7 7 32 32 8 1 +// register_bestweapon 8 8 64 64 9 1 // STAT_CELLS is 9 +//after each map client initialization, this is reset back to Quake settings. So you should send these data in ClientConnect. +//also, this extension introduces a new "cycleweapon" command to the user. + +//DP_QC_STRINGBUFFERS +//idea: ?? +//darkplaces implementation: LordHavoc +//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine +float() buf_create = #460; +void(float bufhandle) buf_del = #461; +float(float bufhandle) buf_getsize = #462; +void(float bufhandle_from, float bufhandle_to) buf_copy = #463; +void(float bufhandle, float sortpower, float backward) buf_sort = #464; +string(float bufhandle, string glue) buf_implode = #465; +string(float bufhandle, float string_index) bufstr_get = #466; +void(float bufhandle, float string_index, string str) bufstr_set = #467; +float(float bufhandle, string str, float order) bufstr_add = #468; +void(float bufhandle, float string_index) bufstr_free = #469; + +//DP_QC_STRINGBUFFERS_CVARLIST +//idea: divVerent +//darkplaces implementation: divVerent +//functions to list cvars and store their names into a stringbuffer +//cvars that start with pattern but not with antipattern will be stored into the buffer +void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517; + +//DP_QC_STRREPLACE +//idea: Sajt +//darkplaces implementation: Sajt +//builtin definitions: +string(string search, string replace, string subject) strreplace = #484; +string(string search, string replace, string subject) strireplace = #485; +//description: +//strreplace replaces all occurrences of 'search' with 'replace' in the string 'subject', and returns the result as a tempstring. +//strireplace does the same but uses case-insensitive matching of the 'search' term +// +//DP_QC_CRC16 +//idea: divVerent +//darkplaces implementation: divVerent +//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol. +//When caseinsensitive is set, the CRC is calculated of the lower cased string. +float(float caseinsensitive, string s, ...) crc16 = #494; + +//DP_SV_SHUTDOWN +//idea: divVerent +//darkplaces implementation: divVerent +//A function that gets called just before progs exit. To save persistent data from. +//It is not called on a crash or error. +//void SV_Shutdown(); + +//EXT_CSQC +// #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC) +void(float index, float type, ...) addstat = #232; + +//ZQ_PAUSE +//idea: ZQuake +//darkplaces implementation: GreEn`mArine +//builtin definitions: +void(float pause) setpause = #531; +//function definitions: +//void(float elapsedtime) SV_PausedTic; +//description: +//during pause the world is not updated (time does not advance), SV_PausedTic is the only function you can be sure will be called at regular intervals during the pause, elapsedtime is the current system time in seconds since the pause started (not affected by slowmo or anything else). +// +//calling setpause(0) will end a pause immediately. +// +//Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause. In other words, the only things that are not called are think and other time-related functions. + + + + +// EXPERIMENTAL (not finalized) EXTENSIONS: + +//DP_CRYPTO +//idea: divVerent +//darkplaces implementation: divVerent +//field definitions: (SVQC) +.string crypto_keyfp; // fingerprint of CA key the player used to authenticate, or string_null if not verified +.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player, or string_null if not verified +.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified +.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext +.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext +// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for +//builtin definitions: (SVQC) +float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513; +//description: +//use -1 as buffer handle to justs end delim as postdata diff --git a/QC_other/QC_arcane/estate.qc b/QC_other/QC_arcane/estate.qc new file mode 100644 index 00000000..6efbb67f --- /dev/null +++ b/QC_other/QC_arcane/estate.qc @@ -0,0 +1,172 @@ +/*====================================================================== +Entity State System +------------------- + +When Quake first came out there were strict limitations on how many entities +could exist and be active at the same time. The quick fix solution to this +problem was to use the killtargets key so that entities could be removed. +This was a very powerful feature with very few restrictions on what it +could affect or destroy at the same time. + +The idea of the entity state system is to create a way to safely switch +entities on, off or have then temporarily disabled. This will help prevent +situations where entity chains are broken or strange errors occur because +the touch function does not have an entity anymore. + +The entity state is a new key on entities which is designed to work in a +passive mode until it is activated. All the entities listed below have a +default value so that any existing map will still work as before. + +There are two methods for changing the entity state and the first method +is an extra key on triggers entities (trigger _once, _multi, _relay etc) + +The ON state (default) will allow the entity to work as designed, be +toggled and physically exist as per its setup. + +The OFF state will block all of the designed functionality and hide +the entity from interaction with the player. + +The DISABLE state blocks any toggle ability or entity functionality +and turns off any visual aids like animated textures. + +The second method is via a brand new set of entities which can affect +multiple targets at once and are much easier (visually) to see what is +going on because most editors draw target lines. + +======================================================================*/ + +//---------------------------------------------------------------------- +// These entity states are monitored and updated by the entity +void() entity_state_on = { + if (self.estate_on) self.estate_on(); + else self.estate = ESTATE_ON; +}; +void() entity_state_off = { + if (self.estate_off) self.estate_off(); + else self.estate = ESTATE_OFF; +}; +void() entity_state_disable = { + if (self.estate_disable) self.estate_disable(); + self.estate = ESTATE_DISABLE; +}; +void() entity_state_reset = { + if (self.estate_reset) self.estate_reset(); +}; +void() entity_state_aframe = { + // Only switch frames if the entity has a function defintion + // This will restrict to entities designed for this change + if (self.estate_aframe) { + if (other.state == 0) self.frame = 0; + else self.frame = 1; + } +}; + +//---------------------------------------------------------------------- +void() entity_state_use = +{ + // Does the firing entity have specific state requests? + if (other.estate_trigger) { + if (other.estate_trigger & ESTATE_ON) entity_state_on(); + else if (other.estate_trigger & ESTATE_OFF) entity_state_off(); + else if (other.estate_trigger & ESTATE_DISABLE) entity_state_disable(); + else if (other.estate_trigger & ESTATE_RESET) entity_state_reset(); + else if (other.estate_trigger & ESTATE_AFRAME) entity_state_aframe(); + } + else { + // Check if disabled first + if (self.estate == ESTATE_DISABLE) return; + + // Check for USE function + if (self.estate_use) self.estate_use(); + // entity has a TOGGLE function + else if (self.estate == ESTATE_OFF) entity_state_on(); + else entity_state_off(); + } +}; + +//====================================================================== +/*QUAKED trigger_entitystate_x (.7 .5 1) (-8 -8 -16) (8 8 16) x +Switch the target(s) entity state X +-------- KEYS -------- +target : target entities to switch x +target2 : more target(s) to affect +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Switch the target(s) entity state X +======================================================================*/ +void(string targstr) trigger_entitystate_target = +{ + local entity t, stemp, otemp; + + // Start looking for targets to update + t = find(world, targetname, targstr); + stemp = self; otemp = other; // Store self/other + while(t) { + // Entity states cannot be applied to players or monsters + if ( !(t.flags & FL_CLIENT) && !(t.flags & FL_MONSTER)) { + // Only change the state to ON/OFF/DISABLE + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp; // Switch self/other + entity_state_use(); // Update entity state + self = stemp; other = otemp; // Restore self/other + } + } + } + // Are there anymore targets left in the list? + t = find(t, targetname, targstr); + } +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_use = +{ + // Check for multiple target commands + if (self.target != "") trigger_entitystate_target(self.target); + if (self.target2 != "") trigger_entitystate_target(self.target2); +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_off = +{ + self.classtype = CT_ESTATE; + if (self.target == "") dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_on = +{ + self.classtype = CT_ESTATE; + if (self.target == "") dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_disable = +{ + self.classtype = CT_ESTATE; + if (self.target == "") dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_DISABLE; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_reset = +{ + self.classtype = CT_ESTATE; + if (self.target == "") dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_RESET; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_aframe = +{ + self.classtype = CT_ESTATE; + if (self.target == "") dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_AFRAME; +}; diff --git a/QC_other/QC_arcane/func.qc b/QC_other/QC_arcane/func.qc new file mode 100644 index 00000000..b87bb44e --- /dev/null +++ b/QC_other/QC_arcane/func.qc @@ -0,0 +1,902 @@ +/*====================================================================== +SIMPLE BMODELS +======================================================================*/ + +float FUNC_AFRAME = 2; // Start with A frame (animated textures) +float FUNC_MODCHECK = 16; // Will remove this entity if THIS mod is active + +float FUNC_LASERSOLID = 2; // Func bmodel blocks on all sides +float FUNC_LASERNODMG = 4; // Func bmodel does no touch damage + +float FUNC_SKILLSTARTOPEN = 1; // Reverse setup for lighting issues + +float BOB_COLLISION = 2; // Collision for misc_bob +float BOB_NONSOLID = 4; // Non solid for func_bob + +/*====================================================================== +/*QUAKED func_wall (0 .5 .8) ? x AFRAME x x MODCHECK STATIC STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A SOLID bmodel with toggled animated texture +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +AFRAME : Start with the A frame animated texture +MODCHECK : Will remove this entity if THIS mod is active +STATIC : Turn entity into static upon spawn (frame 0) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +A SOLID bmodel with toggled animated texture + +======================================================================*/ +void() func_wall_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // toggle alternate textures + else self.frame = 1 - self.frame; + } +}; + +//---------------------------------------------------------------------- +void() func_wall_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + if (self.switchshadstyle != 0) lightstyle(self.switchshadstyle, "a"); +}; + +//---------------------------------------------------------------------- +void() func_wall_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + if (self.switchshadstyle != 0) lightstyle(self.switchshadstyle, "m"); +}; + +//---------------------------------------------------------------------- +void() func_wall_aframe = { }; + +//---------------------------------------------------------------------- +void() func_wall = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCWALL; + self.bsporigin = TRUE; + self.angles = '0 0 0'; + self.mdl = self.model; + if (self.spawnflags & FUNC_AFRAME) self.frame = 1; + if (self.spawnflags & FUNC_MODCHECK) remove(self); + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) { + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + makestatic(self); + } + else { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_wall_on; + self.estate_off = func_wall_off; + self.estate_use = func_wall_use; + self.estate_aframe = func_wall_aframe; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + +/*====================================================================== +/*QUAKED func_illusionary (0 .5 .8) ? x AFRAME x x x STATIC STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A NON SOLID bmodel with texture toggle +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +AFRAME : Start with the A frame animated texture +STATIC : Turn entity into static upon spawn (frame 0) +STARTOFF : Requires trigger to activate +-------- NOTES -------- +A NON SOLID bmodel with texture toggle + +======================================================================*/ +void() func_illusionary_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, self.mdl); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() func_illusionary_aframe = { }; + +//---------------------------------------------------------------------- +void() func_illusionary = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCILLUSIONARY; + self.bsporigin = TRUE; + self.angles = '0 0 0'; + self.mdl = self.model; + if (self.spawnflags & FUNC_AFRAME) self.frame = 1; + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) { + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, self.mdl); + makestatic(self); + } + else { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_illusionary_on; + self.estate_off = func_wall_off; + self.estate_use = func_wall_use; + self.estate_aframe = func_illusionary_aframe; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + +/*====================================================================== +/*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 x x x x Not_Easy Not_Normal Not_Hard Not_DM +SOLID bmodel when player has SELECTED rune(s) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +E1 : Episode 1 +E2 : Episode 2 +E3 : Episode 3 +E4 : Episode 4 +-------- NOTES -------- +SOLID bmodel when player has SELECTED rune(s) + +======================================================================*/ +void() func_episodegate_use = +{ + // The RUNE condition has to be active + if (query_configflag(self.customkey) == self.customkey) self.estate_on(); + else self.estate_off(); +}; + +//---------------------------------------------------------------------- +void() func_episodegate_aframe = { }; + +//---------------------------------------------------------------------- +void() func_episodegate = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCEPISODEGATE; + self.bsporigin = TRUE; + self.angles = '0 0 0'; + self.mdl = self.model; + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Remove any extra spawnkey stuff like skill restrictions + self.customkey = self.spawnflags & SVR_RUNE_ALL; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_wall_on; + self.estate_off = func_wall_off; + self.estate_use = func_episodegate_use; + self.estate_aframe = func_episodegate_aframe; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // Wait 1 frame before checking for rune keys + self.think = func_episodegate_use; + self.nextthink = time + 0.1; + } +}; + +/*====================================================================== +/*QUAKED func_bossgate (0 .5 .8) ? x x x x x x x x Not_Easy Not_Normal Not_Hard Not_DM +A NON SOLID bmodel when player has ALL runes +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +-------- NOTES -------- +A NON SOLID bmodel when player has ALL runes + +======================================================================*/ +void() func_bossgate_use = +{ + // The RUNE condition has to be active + if (query_configflag(SVR_RUNE_ALL) == SVR_RUNE_ALL) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() func_bossgate_aframe = { }; + +//---------------------------------------------------------------------- +void() func_bossgate = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCBOSSGATE; + self.bsporigin = TRUE; + self.angles = '0 0 0'; + self.mdl = self.model; + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_wall_on; + self.estate_off = func_wall_off; + self.estate_use = func_bossgate_use; + self.estate_aframe = func_bossgate_aframe; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // Wait 1 frame before checking for rune keys + self.think = func_bossgate_use; + self.nextthink = time + 0.1; + } +}; + +/*====================================================================== + BModel laser (originally from Rubicon2 codebase by JohnFitz) + - Extended code to have different states and toggle function + - Added custom/silent sounds for lasers on/off + - Added on/off message once function + - Added collision and nodmg spawnflags + +/*====================================================================== +/*QUAKED func_laser (0 .5 .8) ? x SOLID NODMG x x x STARTOFF x +A togglable laser, hurts to touch, can be used to block players +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +message : message to display when switched ON +message2 : message to display when switched OFF +wait : -1 = will display the switching state messages only once +dmg : damage to do on touch. default 1 per 0.1s +alpha : alpha value will vary +/- 20% (def=0.5) +sounds : 1=laser, 2=power, 4=silent, 5=custom +noise1 : switched ON sound +noise2 : switched OFF sound +spr_frame : 1=Yellow, 2=Green, 4=Red, 8=Blue, 16=Purple, 32=Fire, 64=White +angle : Direction of particles to move (def=-2 down) +part_limit : Maximum active quantity of particles (def=25) +part_life : Lifetime of particle (def=2s) +part_velrand: Random movement of particles (def='4 4 4') +part_vol : Size of area to spawn particles in (def=bmodel) +wakeup_dist : Distance to wakeup particle emitter (def=768) +spawn_base : Minimum time frame to spawn particles (def=0.1s) +spawn_rand : Random time amount to add to spawning times (def=0.1s) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +SOLID : Will block anything +NODMG : Touch damage disabled +STARTOFF : Requires trigger to activate +-------- NOTES -------- +A togglable laser, hurts to touch, can be used to block players + +======================================================================*/ +void() func_laser_touch = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.spawnflags & FUNC_LASERNODMG) return; + if (other.takedamage == DAMAGE_NO) return; + if (self.attack_finished < time) { + T_Damage (other, self, self, self.dmg, DAMARMOR); + self.attack_finished = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() func_laser_think = +{ + if (self.estate == ESTATE_BLOCK) return; + // Change the density of the alpha to make laser beam flicker + self.alpha = self.height*0.8 + (self.alpha * (random()*0.4)); + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() func_laser_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Switch laser to active + self.estate = ESTATE_ON; + + // Only play the ON sound and display message when not spawning + if (self.waitmin == TRUE) { + // Play sound on extra emitter if sounds been defined + if (self.sound_emitter && self.noise1 != "") + sound (self.sound_emitter, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + if (activator.flags & FL_CLIENT && self.message != "") + centerprint(activator,self.message); + if (self.wait == TRUE) self.message = ""; + } + else self.waitmin = TRUE; + + // Got to set solid/movetype before model + // Otherwise trigger state does not register properly + if (self.spawnflags & FUNC_LASERSOLID) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + } + else { + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + } + + // Add bmodel back to world (visually) + setmodel (self, self.mdl); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Switch ON any particle emitter + if (self.part_emitter) misc_particle_on(self.part_emitter); + + // Reset touch and laser blink effect + self.touch = func_laser_touch; + self.think = func_laser_think; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() func_laser_off = +{ + // Switch laser to active + self.estate = ESTATE_OFF; + + // Only play the OFF sound and display message when not spawning + if (self.waitmin == TRUE) { + // Play sound on extra emitter if sounds been defined + if (self.sound_emitter && self.noise2 != "") + sound (self.sound_emitter, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + if (activator.flags & FL_CLIENT && self.message2 != "") + centerprint(activator,self.message2); + if (self.wait == TRUE) self.message2 = ""; + } + else self.waitmin = TRUE; + + // Switch OFF any particle emitter + if (self.part_emitter) misc_particle_off(self.part_emitter); + + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, ""); +}; + + +//---------------------------------------------------------------------- +void() func_laser = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCLASER; // Classtype + self.mdl = self.model; // Save for later (on function) + if (self.spr_frame > 0 && CheckZeroVector(self.angles)) self.angles = '0 -2 0'; + InitTrigger(); // Add to work and initialize + + if (!self.alpha) self.alpha = 0.5; // Lasers always transparent + self.height = self.alpha; // Used for think function + if (!self.dmg) self.dmg = 1; // Default tickle + if (self.wait < 0) self.wait = TRUE;// Display message once? + else self.wait = FALSE; + self.waitmin = FALSE; // Spawning no message check + + // Pre-cache sounds and setup sound emitter + if (self.sounds > 0 && self.sounds < 3) { + if (self.sounds == 1) { + self.noise1 = "misc/laseron.wav"; + self.noise2 = "misc/laseroff.wav"; + } + else if (self.sounds == 2) { + self.noise1 = "ambience/power_on.wav"; + self.noise2 = "ambience/power_off.wav"; + } + precache_sound(self.noise1); + precache_sound(self.noise2); + + // Setup sound emitter where bmodel is correctly located + self.sound_emitter = spawn(); + self.sound_emitter.origin = bmodel_origin(self); + setorigin(self.sound_emitter, self.sound_emitter.origin); + self.classtype = CT_SOUNDEMITTER; + } + + // Check for particles emitter type + if (self.spr_frame > 0) { + self.part_active = PARTICLE_STYLE_FFIELD; + // Volume/direction need to be set early, just in case + // the entity starts off and then it has no volume! + self.part_vol = self.size * 0.5; + self.part_vel = self.movedir * 4; + if (self.spawnflags & ENT_STARTOFF) self.lip = PARTICLE_START_OFF; + else self.lip = PARTICLE_START_ON; + self.part_emitter = spawn_pemitter(self, self, self.part_active, self.lip); + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_laser_on; + self.estate_off = func_laser_off; + + if (self.spawnflags & ENT_STARTOFF) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +/*QUAKED func_skill (0 .5 .8) ? STARTOPEN x x x x START_OFF x +This is a special bmodel that changes texture based on current skill level +Will keep checking skill level until triggered (based on door QC code) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +style : Skill Level - 0 = easy, 1 = normal, 2 = hard, 3 = nightmare +message2 : Override message to display when bmodel is touched/damaged +target : Particle emitters to switch on/off +target2 : target(s) to fire when touched/damaged +health : Can be damaged instead of touched +angle : movement direction for trigger event +speed : movement speed (100 default) +lip : lip remaining at end of move (8 default) +noise1 : Custom sound - Stop moving (doors/drclos4.wav) +noise2 : Custom sound - Start/Loop moving (doors/stndr1.wav) +noise3 : Custom sound - Touching (plats/medplat2.wav) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOPEN : bmodel works in reverse state (moved to dest at spawn) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Visual skill selection/update function + +======================================================================*/ +void() func_skill_check = +{ + // If blocked by entity state system do nothing + if (self.estate & ESTATE_BLOCK) return; + + // Has the skill level been changed? + if (self.attack_finished != skill) { + // Stop this entity constantly changing + self.attack_finished = skill; + + if (self.target != "") { + self.enemy = find(world,targetname,self.target); + while (self.enemy) { + // Found a particle emitter? + if (self.enemy.classtype == CT_PARTICLEEMIT) { + if (self.style == skill) misc_particle_on(self.enemy); + else misc_particle_off(self.enemy); + } + + // Keep searching for more targets in chain + self.enemy = find(self.enemy,targetname,self.target); + } + } + + // Is the current skill level active? + if (self.style == skill) self.frame = 0; + else self.frame = 1; // Blank texture (off) + } + self.nextthink = time + 0.1; + self.think = func_skill_check; +}; + +//---------------------------------------------------------------------- +void() func_skill_touch = +{ + // If blocked by entity state system do nothing + if (self.estate & ESTATE_BLOCK) return; + if (self.spawnflags & ENT_STARTOFF) return; + if ( !(other.flags & FL_CLIENT) ) return; + if ( other.health < 1 ) return; + + // If skill level is changing, say so on console + if (skill != self.style) { + if (self.message2 != "") sprint(other, self.message2); + else { + sprint(other,"Skill level "); + if (self.style == SKILL_EASY) sprint(other,"EASY"); + else if (self.style == SKILL_NORMAL) sprint(other,"NORMAL"); + else if (self.style == SKILL_HARD) sprint(other,"HARD"); + else sprint(other,"NIGHTMARE"); + sprint(other," has been selected!"); + } + sprint(other,"\n"); + stuffcmd (other, "bf\n"); + + // Change skill level + cvar_set ("skill", ftos(self.style)); + skill = self.style; + + // Force quick update + func_skill_check(); + + // Any other targets to fire when touch/damaged + if (self.target2 != "") trigger_strs(self.target2, other); + } + + // Play touch sound regardless of skill change + if (self.pausetime < time) { + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + self.pausetime = time + 1; // No constant sound + } +}; + +//---------------------------------------------------------------------- +void() func_skill_killed = +{ + other = damage_attacker; // The attacker + self.health = self.max_health; // Reset health to original value + + // All other exceptions are in the touch function + func_skill_touch(); +}; + +//---------------------------------------------------------------------- +void() func_skill_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + func_skill_check(); +}; + +//---------------------------------------------------------------------- +void() func_skill_stop = +{ + // Stop sound, ON and particles! + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + // Need to reset local entity time, otherwise timer is broken + // it because of the SUB_CalcMove function changes it + self.ltime = time; + func_skill_on(); +}; + +//---------------------------------------------------------------------- +void() func_skill_use = +{ + // Trigger once functionality + self.estate_use = SUB_Null; + self.estate = ESTATE_OFF; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove (self.pos2, self.speed, func_skill_stop); +}; + +//---------------------------------------------------------------------- +void() func_skill_off = +{ + self.estate = ESTATE_OFF; + self.frame = 1; + + // Switch off any particle emitters + if (self.target != "") { + self.enemy = find(world,targetname,self.target); + while (self.enemy) { + // Found a particle emitter? + if (self.enemy.classtype == CT_PARTICLEEMIT) + misc_particle_off(self.enemy); + + // Keep searching for more targets in chain + self.enemy = find(self.enemy,targetname,self.target); + } + } +}; + +//---------------------------------------------------------------------- +void() func_skill = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup default sounds if no custom sounds exist + if (self.noise1 == "") self.noise1 = "doors/drclos4.wav"; + if (self.noise2 == "") self.noise2 = "doors/stndr1.wav"; + if (self.noise3 == "") self.noise3 = "plats/medplat2.wav"; + + //Pre-cache all sounds + precache_sound(self.noise1); // stop sound (big clunk sound) + precache_sound(self.noise2); // moving sound (door moving) + precache_sound(self.noise3); // Touch sound + + self.classtype = CT_FUNCSKILL; // Type + self.bsporigin = TRUE; // Bmodel (0,0,0 origin) + self.mdl = self.model; + SetMovedir (); + + if (!self.speed) self.speed = 100; // Default movement speed + if (!self.lip) self.lip = 8; // End movement distance + + //---------------------------------------------------------------------- + // Is the skill level within proper range? + if (self.style < SKILL_EASY || self.style > SKILL_NIGHTMARE) + self.style = 0; // Default skill = EASY + self.attack_finished = -1; // Always check first time + self.lefty = cvar("skill"); // Read current setting + if (self.style != self.lefty) self.frame = 1; + + //---------------------------------------------------------------------- + // Add bmodel to world and work out movement positions + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.mdl); + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + //---------------------------------------------------------------------- + // FUNC_SKILL_START_OPEN is design is hide a skill pillar + // until it is triggered (nightmare skill) + if (self.spawnflags & FUNC_SKILLSTARTOPEN) { + setorigin (self, self.pos2); + self.pos2 = self.pos1; + self.pos1 = self.origin; + } + + // If the skill pillar is setup with a targetname then wait for + // a trigger event before becoming active (updates+particles) + if (self.targetname != "") { + self.spawnflags = self.spawnflags | ENT_STARTOFF; + self.estate_use = func_skill_use; + self.frame = 1; // Always starts off + } + + // Setup Entity State functionality + self.use = entity_state_use; + self.estate_on = func_skill_on; + self.estate_off = func_skill_off; + self.estate = ESTATE_OFF; + + // Can either be touched or damaged, never both! + if (self.health != 0) { + self.health = self.max_health = 1; + self.th_die = func_skill_killed; + self.takedamage = DAMAGE_YES; + self.touch = SUB_Null; + } + else { + self.touch = func_skill_touch; + self.takedamage = DAMAGE_NO; + } + + // Wait random amount for all entities to spawn + self.nextthink = time + 0.1 + random()*0.5; + if (self.spawnflags & ENT_STARTOFF) self.think = self.estate_off; + else self.think = self.estate_on; +}; + +/*====================================================================== +/*QUAKED func_bob (0 .5 .8) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A SOLID bmodel that gently moves back and forth +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +angle : direction movement, use "360" for angle 0 +height : direction intensity (def=4) +count : direction cycle timer (def=2s, minimum=1s) +waitmin : Speed up scale (def=1) 1+=non linear +waitmin2 : Slow down scale (def=0.75) +delay : Starting time delay (def=0, -1=random) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +A SOLID bmodel that gently moves back and forth + +======================================================================*/ +void() func_bob_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Toggle state (switch on or disable) + if (self.estate & ESTATE_BLOCK) self.estate = ESTATE_ON; + else self.estate = ESTATE_DISABLE; + } +}; + +//---------------------------------------------------------------------- +void() func_bob_timer = +{ + // Keep ticking in background, use local timer (faster) + self.think = func_bob_timer; + if (self.bsporigin) self.nextthink = self.ltime + 0.1; + else self.nextthink = time + 0.1; + + // Do nothing if entity state is off + if (self.estate & ESTATE_OFF) return; + + // Has the cycle completed? + if (self.attack_timer < time) { + // Don't reset bmodel if disabled + if (self.estate & ESTATE_DISABLE) { + self.attack_timer = LARGE_TIMER; + self.lefty = -1; + } + else { + // Setup bob cycle and half way point for slowdown + self.attack_timer = time + self.count; + self.distance = time + (self.count * 0.5); + // Flip direction of bmodel bob + self.lefty = 1 - self.lefty; + if (self.lefty < 1) self.t_length = self.height; + else self.t_length = -self.height; + } + // Always reset velocity and flags + self.velocity = '0 0 0'; + self.flags = 0; + } + + // Is the direction set? + // This is a block condition to prevent the bmodel moving + if (self.lefty != -1) { + // Slow down velocity (gradually) + if (self.distance < time) + self.velocity = self.velocity * self.waitmin2; + else { + // Speed up velocity (linear/exponentially) + self.t_length = self.t_length * self.waitmin; + self.velocity = self.velocity + (self.movedir * self.t_length); + } + } +}; + +//---------------------------------------------------------------------- +void() func_bob_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + if (self.bsporigin) { + // Check for solid spawnflag + if (self.spawnflags & BOB_NONSOLID) { + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_NOT; + } + else { + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + } + } + else { + self.movetype = MOVETYPE_FLY; + if (self.spawnflags & BOB_COLLISION) self.solid = SOLID_BBOX; + else self.solid = SOLID_NOT; + self.flags = 0; // Reset any onground flags + } + setmodel (self, self.mdl); + setsize (self, self.mins , self.maxs); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() func_bob_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.velocity = '0 0 0'; +}; + +//---------------------------------------------------------------------- +void() func_bob = +{ + self.classtype = CT_FUNCBOB; + // Using a custom model? + if (self.mdl == "") { + self.bsporigin = TRUE; + self.mdl = self.model; + } + else { + self.bsporigin = FALSE; + self.modelindex = 0; + self.model = ""; + } + + SetMovedir (); + self.movedir = normalize(self.movedir); + + if (self.height <=0) self.height = 8; // Direction intensity + if (self.count <1) self.count = 2; // Direction switch timer + if (self.waitmin <=0) self.waitmin = 1; // Speed up + if (self.waitmin2 <=0) self.waitmin2 = 0.75; // Slow down + if (self.delay < 0) self.delay = random() + random() + random(); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_bob_on; + self.estate_off = func_bob_off; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + + self.think = func_bob_timer; + self.nextthink = time + 0.1 + self.delay; +}; + +//---------------------------------------------------------------------- +void() misc_bob = +{ + if (self.mdl == "") self.mdl = MODEL_BROKEN; + precache_model(self.mdl); + + func_bob(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/func_buttons.qc b/QC_other/QC_arcane/func_buttons.qc new file mode 100644 index 00000000..7fa1578c --- /dev/null +++ b/QC_other/QC_arcane/func_buttons.qc @@ -0,0 +1,270 @@ +/*====================================================================== + BUTTON FUNCTIONS +======================================================================*/ +float BUTTON_STARTDIS = 32; // Button starts in disabled state +//---------------------------------------------------------------------- + +/*QUAKED func_button (0 .5 .8) ? x x x x x STARTDIS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Button (bmodel) with two states +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger at the start of the wait phase +angle : determines the move direction, use "360" for angle 0 +speed : Move Speed (def=40) +wait : wait before returning (def=1, -1 = never return) +delay : delay before button triggers +lip : lip remaining at end of move. (def=4) +health : Can be damaged instead of touched +sounds : 0=steam metal, 1=wooden, 2=metallic, 3=in-out, 4=Silent, 5=Custom +noise : custom sound - 1st movement +noise1 : custom sound - 2nd movement ('buttons/switch21.wav') +message: Centerprint Message to display when triggered +estate : Override starting entity state 1=ON, 2=OFF, 4=DISABLE +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTDIS : Starts disabled and waits for trigger +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Button (bmodel) with two states +*/ + +void() func_button_return; +//---------------------------------------------------------------------- +void() func_button_wait = +{ + self.state = STATE_TOP; + if (self.estate & ESTATE_BLOCK) return; + self.nextthink = self.ltime + self.wait; + self.think = func_button_return; + activator = self.enemy; + SUB_UseTargets(); + self.frame = 1; // use alternate textures +}; + +//---------------------------------------------------------------------- +void() func_button_done = +{ + self.frame = 0; // use normal textures + self.state = STATE_BOTTOM; + if (self.health) self.takedamage = DAMAGE_YES; +}; + +//---------------------------------------------------------------------- +void() func_button_return = +{ + self.state = STATE_DOWN; + if (self.estate & ESTATE_BLOCK) return; + if (self.noise1) sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + SUB_CalcMove (self.pos1, self.speed, func_button_done); +}; + +//---------------------------------------------------------------------- +void() func_button_fire = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.state == STATE_UP || self.state == STATE_TOP) return; + + self.state = STATE_UP; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + SUB_CalcMove (self.pos2, self.speed, func_button_wait); +}; + +//---------------------------------------------------------------------- +void() func_button_use = +{ + // Deal with DELAY functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + self.enemy = other; + func_button_fire(); + } +}; + +//---------------------------------------------------------------------- +// Default state for buttons, touch trigger +//---------------------------------------------------------------------- +void() func_button_touch = +{ + if ( !(other.flags & FL_CLIENT) ) return; + self.enemy = other; + func_button_fire(); +}; + +//---------------------------------------------------------------------- +// Only active if health set on trigger, touch function disabled +//---------------------------------------------------------------------- +void() func_button_killed = +{ + self.enemy = damage_attacker; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + func_button_fire(); +}; + +//---------------------------------------------------------------------- +// do nothing, just don't come all the way back out +//---------------------------------------------------------------------- +void() func_button_blocked = { }; + +//---------------------------------------------------------------------- +void() func_button_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + // Reset health, state and frame back to default + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + self.frame = 0; + + // reset health and damage trigger + if (self.max_health) { + self.health = self.max_health; + self.th_die = func_button_killed; + self.takedamage = DAMAGE_YES; + } +}; + +//---------------------------------------------------------------------- +void() func_button_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Reset health, position and frame back to default + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.takedamage = DAMAGE_NO; + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + self.frame = 0; +}; + +//---------------------------------------------------------------------- +void() func_button_disable = +{ + // Block damage function and show alternative texture + self.estate = ESTATE_DISABLE; + self.takedamage = DAMAGE_NO; + self.frame = 1; + // Make sure the button is moved to finished state + SUB_CalcMove (self.pos2, self.speed, func_button_wait); +}; + +//============================================================================= +void() func_button = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise == "") self.noise = SOUND_EMPTY; + + // Default 0 = air button + if (self.sounds == 0) self.noise = "buttons/airbut1.wav"; + else if (self.sounds == 1) self.noise = "buttons/switch21.wav"; + else if (self.sounds == 2) self.noise = "buttons/switch02.wav"; + else if (self.sounds == 3) self.noise = "buttons/switch04.wav"; + else if (self.sounds == 4) self.noise = SOUND_EMPTY; + precache_sound (self.noise); + + if (self.noise1 != "") precache_sound (self.noise1); + + self.classtype = CT_FUNCBUTTON; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + SetMovedir (); // Setup move direction base on angles + + // Default parameters and states + if (!self.speed) self.speed = 40; + if (!self.wait) self.wait = 1; + if (!self.lip) self.lip = 4; + self.state = STATE_BOTTOM; + + // Setup the buttons two different state positions + // Got to add button to world for bmodel size parameter + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Cannot have a button start off or disabled + // with no targetname, how can it be actived!?! + if (self.spawnflags & BUTTON_STARTDIS && self.targetname == "") { + dprint("\b[BUTTON]\b Starting DISABLED with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + if (self.spawnflags & ENT_STARTOFF && self.targetname == "") { + dprint("\b[BUTTON]\b Starting OFF with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Can either shoot a button or touch it, never both + if (self.health) { + self.max_health = self.health; + self.th_die = func_button_killed; + self.takedamage = DAMAGE_YES; + } + // Important OR condition (touching only) + else self.touch = func_button_touch; + self.blocked = func_button_blocked; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_button_on; + self.estate_off = func_button_off; + self.estate_use = func_button_use; + self.estate_disable = func_button_disable; + + // Check for the easy way to start a button disabled + if (self.spawnflags & BUTTON_STARTDIS) self.estate_disable(); + // Check for starting override for entity state + else if (self.estate & ESTATE_LOWER) { + if (self.estate == 1) self.estate_on(); + else if (self.estate == 2) { + // Make sure off function works, start with on state + self.estate = ESTATE_ON; + self.estate_off(); + } + else if (self.estate == 4) self.estate_disable(); + } + else { + // Check for starting off or default=on + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + diff --git a/QC_other/QC_arcane/func_doors.qc b/QC_other/QC_arcane/func_doors.qc new file mode 100644 index 00000000..cceeb8d6 --- /dev/null +++ b/QC_other/QC_arcane/func_doors.qc @@ -0,0 +1,818 @@ +/*====================================================================== + STANDARD DOOR FUNCTIONS +======================================================================*/ +float DOOR_START_OPEN = 1; // Work the opposite way around +float DOOR_SPAWN_TRIGGER = 2; // Spawn open trigger regardless of targetname +float DOOR_DONT_LINK = 4; // never link this door with anything +float DOOR_GOLD_KEY = 8; // Gold Key +float DOOR_SILVER_KEY = 16; // Silver Key +float DOOR_TOGGLE = 32; // Need trigger to open AND close + +/*====================================================================== +/*QUAKED func_door (0 .5 .8) ? STARTOPEN SPAWNTRIG DONTLINK GOLD SILVER TOGGLE STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Door (bmodel) with 2 states +-------- KEYS -------- +targetname : = "" door automatically opens, != "" requires trigger to open +if using entity state system set SPAWN_TRIG spawnflags to fix this problem +target : name of target(s) to trigger at the start opening sequence +angle : determines the opening direction, use "360" for angle 0 +speed : movement speed (def=100) +yaw_speed: return movement speed (def=self.speed) +wait : wait before returning (def=3, -1 = never return) +lip : lip remaining at end of move. (def=8) +health : Can be damaged instead of touched +dmg : damage to inflict when blocked. (def=2) +message : centerprint message when touched (removed when opened) +sounds : 0 = silent 1 = stone 2 = base 3 = stone chain 4 = screechy metal 5 = custom +locksounds : 0 = talktalk 1 = short rattle, 2 = medium rattle, 3 = long rattle +noise : custom sound - door locked sound (targetname+message) +noise1 : custom sound - Moving/Open door (looping) +noise2 : custom sound - Stop/Close door +noise3 : custom sound - Silver/Gold key try lock +noise4 : custom sound - Silver/Gold key OPEN +customkey: custom key required to open door (1-4 supported values) +message2 : custom key message (You need the custom key) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOPEN : door opens in reverse state (moved to dest at spawn) +SPAWNTRIG : Will spawn trigger around door even if targetname SETUP +DONTLINK : Touching doors will not link into a single entity +GOLD : Requires gold key to open +SILVER : Requires silver key to open +TOGGLE : Door waits for trigger between states (if wait=-1 cannot be blocked) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Door (bmodel) with 2 states + +======================================================================*/ + +// Check for overlapping bound boxes +float (entity e1, entity e2) EntitiesTouching = +{ + if (e1.mins_x > e2.maxs_x) return FALSE; + if (e1.mins_y > e2.maxs_y) return FALSE; + if (e1.mins_z > e2.maxs_z) return FALSE; + if (e1.maxs_x < e2.mins_x) return FALSE; + if (e1.maxs_y < e2.mins_y) return FALSE; + if (e1.maxs_z < e2.mins_z) return FALSE; + return TRUE; +}; + +//---------------------------------------------------------------------- +void() func_door_trigger_touch = +{ + if (self.owner.estate == ESTATE_BLOCK) return; + if (self.owner.spawnflags & ENT_STARTOFF) return; + if (other.health < 1) return; + if (other.classtype == CT_FUNCBREAK) return; + if (other.flags & FL_ITEM) return; + if (time < self.attack_finished) return; + self.attack_finished = time + 1; + + // Switch to parent (self) of trigger + activator = other; + self = self.owner; + + self.estate_use(); // func_door_use +}; + +//---------------------------------------------------------------------- +entity(vector fmins, vector fmaxs) func_door_spawn_field = +{ + local entity trigger; + local vector t1, t2; + + // Create trigger entity and link to parent (self) + trigger = spawn(); + trigger.classtype = CT_FUNCDOORTRIG; + trigger.bsporigin = TRUE; + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + trigger.owner = self; + trigger.touch = func_door_trigger_touch; + + t1 = fmins; + t2 = fmaxs; + // Extend the X/Y size of the trigger +/- 60 units + // Return the trigger entity to the previous function + setsize (trigger, t1 - '60 60 8', t2 + '60 60 8'); + return (trigger); +}; + +//---------------------------------------------------------------------- +// Link touching func_door entities +//---------------------------------------------------------------------- +void() func_door_link = +{ + local entity linkdoor, master; + local vector cmins, cmaxs; + local float loopcondition; + + // Switch off the entity once the door linking has been done + if (self.spawnflags & ENT_STARTOFF) { + self.think = self.estate_off; + self.nextthink = self.ltime + 0.1; + } + + // Door linking exceptions (self.enemy = already linked) + if (self.enemy) return; + + // Setup bounding box for first door (master) + cmins = self.mins; cmaxs = self.maxs; + + // lets give the do/while a proper exit condition + loopcondition = TRUE; + + // Really important step, defining the master door + master = self; + linkdoor = self; + + while (loopcondition) + { + // Always point all doors in the list to the master door + // which is setup outside of the do/while loop + self.owner = master; + + // Make sure all linked doors have the same health/targetname/message + if (self.health) master.health = self.health; + if (self.targetname != "") master.targetname = self.targetname; + if (self.message != "") master.message = self.message; + + // For some reason the original ID code renamed doors and secret doors + // to the same classname string and then created a list of both together + // Not sure why anyone would want the two door types linked and it is + // certainly not in any of the original ID maps. + // Feature disabled - causes no end of state problems + linkdoor = find (linkdoor, classname, self.classname); + + // reached end of list? + if (!linkdoor) { + self.enemy = master; // make the chain a loop + loopcondition = FALSE; + + // no more doors left to search, switch to the master door + // It is always defined as the .owner field + self = self.owner; + + // This is the conditions for a door getting automatic open trigger + // Door CANNOT be damaged (shoot trigger) and NO key item required + if (self.health == 0 && self.items == 0) { + // Damn annoying that the targetname is being used like this because + // there could have been a better way to do this type of functionality + // == "" door has special trigger around to open door + // != "" door requires trigger event to open + if (self.targetname == "") + self.spawnflags = self.spawnflags | DOOR_SPAWN_TRIGGER; + + if (self.spawnflags & DOOR_SPAWN_TRIGGER) + self.owner.trigger_field = func_door_spawn_field(cmins, cmaxs); + } + } + else { + // Check if the bounding boxes are touching + if (EntitiesTouching(self,linkdoor)) { + // The .enemy field should be empty, otherwise its linked already + // which is a bad situation because the chains will be corrupt + // This will break the lots of later functions on + // Solution - ignore the crosslink entity and carry on + if (linkdoor.enemy) { + // Exception: No link doors are setup to be linked to themselves! + if ( !(linkdoor.spawnflags & DOOR_DONT_LINK)) { + dprint("\b[CROSSLINK]\b really bad situation, must fix!\n"); + dprint("-----------------------------------------------\n"); + eprint(linkdoor.enemy); + dprint("-----------------------------------------------\n\n"); + } + } + else { + // Setup the next entity (linkdoor) in the list (self.enemy) + // and move self forward to the new entity (linkdoor) + self.enemy = linkdoor; + self = linkdoor; + + // Expand touch trigger to include new door + if (linkdoor.mins_x < cmins_x) cmins_x = linkdoor.mins_x; + if (linkdoor.mins_y < cmins_y) cmins_y = linkdoor.mins_y; + if (linkdoor.mins_z < cmins_z) cmins_z = linkdoor.mins_z; + if (linkdoor.maxs_x > cmaxs_x) cmaxs_x = linkdoor.maxs_x; + if (linkdoor.maxs_y > cmaxs_y) cmaxs_y = linkdoor.maxs_y; + if (linkdoor.maxs_z > cmaxs_z) cmaxs_z = linkdoor.maxs_z; + } + } + } + } +}; + +//---------------------------------------------------------------------- +// Phase 4 - Door CLOSED +//---------------------------------------------------------------------- +void() func_door_hit_bottom = +{ + if (self.estate == ESTATE_OFF) return; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + self.frame = 1 - self.frame; //switch textures +}; + +//---------------------------------------------------------------------- +// Phase 3 - Door closing +//---------------------------------------------------------------------- +void() func_door_go_down = +{ + if (self.estate == ESTATE_OFF) return; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + if (self.max_health) { + self.takedamage = DAMAGE_YES; + self.health = self.max_health; + } + + self.state = STATE_DOWN; + // Add - return speed can now be different, + // yaw_speed = speed if nothing defined + SUB_CalcMove (self.pos1, self.yaw_speed, func_door_hit_bottom); +}; + +//---------------------------------------------------------------------- +// Phase 2 - Door OPEN +//---------------------------------------------------------------------- +void() func_door_hit_top = +{ + if (self.estate == ESTATE_OFF) return; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; + // don't come down automatically + if (self.spawnflags & DOOR_TOGGLE) return; + self.think = func_door_go_down; + self.nextthink = self.ltime + self.wait; +}; + +//---------------------------------------------------------------------- +// Phase 1 - Door opening +//---------------------------------------------------------------------- +void() func_door_go_up = +{ + if (self.estate == ESTATE_OFF) return; + if (self.state == STATE_UP) return; // already going up + + if (self.state == STATE_TOP) { // reset top wait time + self.nextthink = self.ltime + self.wait; + return; + } + + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos2, self.speed, func_door_hit_top); + + SUB_UseTargets(); + self.frame = 1 - self.frame; //switch textures +}; + +//---------------------------------------------------------------------- +void() func_door_fire = +{ + local entity oself, starte; + + if (self.estate == ESTATE_BLOCK) return; + if (self.owner != self) dprint ("\b[door_fire]\b self.owner != self\n"); + + // Check for exact state requests + if (other.classtype == CT_TRIGDOORSTATE) { + if (other.state == 0) { + // Is the door closing (DOWN) or closed (BOTTOM)? + if (self.state == STATE_DOWN || self.state == STATE_BOTTOM) return; + } + else { + // Is the door opening (UP) or open (TOP)? + if (self.state == STATE_UP || self.state == STATE_TOP) return; + } + } + + // play use key sound + if (self.items) sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); + + self.message = string_null; // no more message + oself = self; + + if (self.spawnflags & DOOR_TOGGLE) { + if (self.state == STATE_UP || self.state == STATE_TOP) { + starte = self; + do { + func_door_go_down (); + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; + return; + } + } + + // trigger all paired doors + starte = self; + do { + func_door_go_up (); + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; +}; + +//---------------------------------------------------------------------- +void() func_door_use = +{ + local entity oself; + + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + // Door messages are for touch functionality ONLY + self.message = string_null; + self.owner.message = string_null; + self.enemy.message = string_null; + // Switch to master door + oself = self; + self = self.owner; + func_door_fire (); + self = oself; + } +}; + +//---------------------------------------------------------------------- +void() func_door_killed = +{ + local entity oself; + if (self.estate & ESTATE_BLOCK) return; + + oself = self; + self = self.owner; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + func_door_use (); + self = oself; +}; + +//---------------------------------------------------------------------- +// Only used for keys and messages +//---------------------------------------------------------------------- +void() func_door_touch = +{ + if (self.estate & ESTATE_BLOCK) return; + if ( !(other.flags & FL_CLIENT) ) return; + if (self.owner.attack_finished > time) return; + + // Block touch trigger for 2 seconds + self.owner.attack_finished = time + 2; + + // Does the door require any keys? + if (self.items == 0) { + // Any touch message to display? + if (self.owner.message != "") { + centerprint (other, self.owner.message); + // Use custom lock sound (default = talktalk) + sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + } + // Check door for keys (silver/gold/custom) + else { + // Is this a custom locked door? + if (self.moditems > 0) { + if ( (self.moditems & other.moditems) != self.moditems ) { + // Tell the player that a custom key is required + // Use the message2 string instead of message1 + centerprint (other, self.message2); + // Play door locked sound (based on worldspawn) + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + return; + } + else { + // Remove custom key from player/client + other.moditems = other.moditems - self.moditems; + // Tell the player that the custom key has been removed + // Use the key item netname to reference the custom key + // These netnames are updated when picking up the key + sprint(other, "You used the "); + if (self.moditems & IT_CKEY1 && other.ckeyname1 != "") sprint(other, other.ckeyname1); + else if (self.moditems & IT_CKEY2 && other.ckeyname2 != "") sprint(other, other.ckeyname2); + else if (self.moditems & IT_CKEY3 && other.ckeyname3 != "") sprint(other, other.ckeyname3); + else if (self.moditems & IT_CKEY4 && other.ckeyname4 != "") sprint(other, other.ckeyname4); + sprint(other, "\n"); + } + } + else { + // Does the player have the correct key? (silver/gold) + if ( (self.items & other.items) != self.items ) { + if (self.owner.items == IT_KEY1) { + if (self.message2 != "") centerprint (other, self.message2); + else if (self.worldtype == 1) centerprint (other, "You need the silver runekey"); + else if (self.worldtype == 2) centerprint (other, "You need the silver keycard"); + else centerprint (other, "You need the silver key"); + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + } + else { + if (self.message2 != "") centerprint (other, self.message2); + else if (self.worldtype == 1) centerprint (other, "You need the gold runekey"); + else if (self.worldtype == 2) centerprint (other, "You need the gold keycard"); + else centerprint (other, "You need the gold key"); + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + } + return; + } + else { + // Tell the player that the key has been removed + sprint(other, "You used the "); + if (other.items & IT_KEY1) sprint(other, "Silver key\n"); + else sprint(other, "Gold key\n"); + // Take key from player inventory + other.items = other.items - self.items; + // Check for a custom unlock sound + if (self.locksounds > 0) + sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + } + } + + // Turn off touch function + self.touch = SUB_Null; + // turn off touch on pair/master door + if (self.enemy) self.enemy.touch = SUB_Null; + func_door_use (); + } +}; + +//---------------------------------------------------------------------- +void() func_door_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.velocity = '0 0 0'; + self.frame = self.frame_override; // Reset to default + + // Reset Door position if NOT key or working once + if (self.items == 0 && self.wait != -1) { + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } + // reset health and damage trigger + if (self.max_health > 0) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + } +}; + +//---------------------------------------------------------------------- +void() func_door_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.velocity = '0 0 0'; + self.takedamage = DAMAGE_NO; + self.think = SUB_Null; + + // Stop all movement sounds + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + + // Reset Door position if NOT key or working once + if (self.items == 0 && self.wait != -1) { + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + } +}; + +//---------------------------------------------------------------------- +void() func_door_disable = +{ + // Block damage function and show alternative texture + self.takedamage = DAMAGE_NO; + self.frame = 1 - self.frame_override; // Turn off alt textures +}; + +//---------------------------------------------------------------------- +void() func_door_reset = +{ + // If the door is still OFF then leave it + if (self.spawnflags & ENT_STARTOFF) return; + + // Restore key functionality + if (self.items > 0 ) { + self.touch = func_door_touch; + // switch on master door as well + if (self.enemy) self.enemy.touch = func_door_touch; + } + + // reset to original position + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.attack_finished = 0; + self.frame = self.frame_override; // Reset Alt textures + + // Restore door to ON state + self.estate = ESTATE_OFF; + self.estate_on(); + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() func_door_blocked = +{ + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // if a door has a negative wait, it would never come back if blocked, + // so let it just squash the object to death real fast + if (self.wait != -1) { + if (self.state == STATE_DOWN) func_door_go_up (); + else func_door_go_down (); + } +}; + +//---------------------------------------------------------------------- +void() func_door = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + + if (self.sounds == 1) { + self.noise1 = "doors/drclos4.wav"; + self.noise2 = "doors/doormv1.wav"; + } + else if (self.sounds == 2) { + self.noise2 = "doors/hydro1.wav"; + self.noise1 = "doors/hydro2.wav"; + } + else if (self.sounds == 3) { + self.noise2 = "doors/stndr1.wav"; + self.noise1 = "doors/stndr2.wav"; + } + else if (self.sounds == 4) { + self.noise1 = "doors/ddoor2.wav"; + self.noise2 = "doors/ddoor1.wav"; + } + + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + // Allow for custom sounds by checking noise3/4 string content first + // Locked door sounds (silver, gold and custom keys) + if (self.noise3 == "") { + if (self.worldtype == 1) self.noise3 = "doors/runetry.wav"; + else if (self.worldtype == 2) self.noise3 = "doors/basetry.wav"; + else self.noise3 = "doors/medtry.wav"; + } + if (self.noise4 == "") { + if (self.worldtype == 1) self.noise4 = "doors/runeuse.wav"; + else if (self.worldtype == 2) self.noise4 = "doors/baseuse.wav"; + else self.noise4 = "doors/meduse.wav"; + } + + // locked sound (targetname + message) + if (self.noise == "") self.noise = SOUND_TALK; + if (self.locksounds == 1) self.noise = "doors/rattle1.wav"; + else if (self.locksounds == 2) self.noise = "doors/rattle2.wav"; + else if (self.locksounds == 3) self.noise = "doors/rattle6.wav"; + else if (self.locksounds == 13) self.noise = "misc/trigger1.wav"; + else if (self.locksounds == 14) self.noise = SOUND_EMPTY; + else if (self.locksounds == 16) self.noise = "misc/secret3.wav"; + + //Pre-cache all sounds + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + precache_sound (self.noise4); + + // Setup classtype and flag as BSP origin + self.classtype = CT_FUNCDOOR; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + SetMovedir (); // Work out movedir based on angles + + if (!self.speed) self.speed = 100; + // Second movement speed can be different, yaw_speed + if (!self.yaw_speed) self.yaw_speed = self.speed; + if (!self.wait) self.wait = 3; + if (!self.lip) self.lip = 8; + if (!self.dmg) self.dmg = 2; + self.state = STATE_BOTTOM; + self.attack_finished = 0; + + // Default/Setup alternative texture frame + if (!self.frame_override) self.frame_override = 0; + self.frame = self.frame_override; + + //---------------------------------------------------------------------- + // Is the door locked via special keys (silver/gold) + // Make sure any rogue entity keys are removed + self.items = self.moditems = 0; + if (self.spawnflags & DOOR_SILVER_KEY) self.items = IT_KEY1; + else if (self.spawnflags & DOOR_GOLD_KEY) self.items = IT_KEY2; + // Check for custom key requirement (only supports 1-4 types) + else if (self.customkey > 0) { + self.items = IT_KEY1 | IT_KEY2; + if (self.message2 == "") self.message2 = "You need the custom key"; + if (self.customkey == 1) self.moditems = IT_CKEY1; + else if (self.customkey == 2) self.moditems = IT_CKEY2; + else if (self.customkey == 3) self.moditems = IT_CKEY3; + else if (self.customkey == 4) self.moditems = IT_CKEY4; + else { + dprint("\b[FUNC_DOOR]\b Custom key value not supported\n"); + self.moditems = self.items = 0; + } + } + + // key doors ONLY work once and have touch function + if (self.items > 0) { + self.wait = -1; // Work once + self.health = 0; // no shoot/damage + } + + //---------------------------------------------------------------------- + // Add bmodel to world and work out movement positions + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.mdl); + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Only need door functionality if require keys or centerprint messages + if (self.items > 0 || self.message != "") self.touch = func_door_touch; + self.blocked = func_door_blocked; + + //---------------------------------------------------------------------- + // DOOR_START_OPEN is design for an entity to be lit in the closed position + // but spawn in the open position, also reversed door functions + if (self.spawnflags & DOOR_START_OPEN) { + setorigin (self, self.pos2); + self.pos2 = self.pos1; + self.pos1 = self.origin; + } + + // Only enable damage trigger (die) if health set + if (self.health) { + self.max_health = self.health; + self.takedamage = DAMAGE_YES; + self.th_die = func_door_killed; + } + + // Setup Entity State functionality + // The 'USE' wrapper has to be setup, because after + // the doors are linked they will all have targetnames! + self.use = entity_state_use; + self.estate_on = func_door_on; + self.estate_off = func_door_off; + self.estate_use = func_door_use; + self.estate_disable = func_door_disable; + self.estate_reset = func_door_reset; + self.estate = ESTATE_ON; + + //---------------------------------------------------------------------- + // Doors cannot be linked until all bmodels have spawned and + // bounding box sizes established, check for exceptions first + if (self.spawnflags & DOOR_DONT_LINK) { + self.owner = self.enemy = self; + // Its safe to switch this entity off, no linking required + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + } + else { + self.think = func_door_link; + self.nextthink = self.ltime + 0.1; + } +}; + +/*====================================================================== +/*QUAKED trigger_doorstate (0.5 0 0.5) (-8 -8 -16) (8 8 16) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard +Trigger func_door(s) to exact state (open/close) +-------- KEYS -------- +targetname : trigger this entity +target : ALL target(s) must be func_door entities with toggle spawnflag! +state : 0 or 1 func_door state (0=closed, 1=open) +wait : -1 = will only fire targets once +-------- SPAWNFLAGS -------- +STARTOFF : Requires trigger to activate +-------- NOTES -------- +Trigger func_door(s) to exact state (open/close) + +======================================================================*/ +void() trigger_doorstate_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Fire target(s) + trigger_strs(self.target, self); + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; +}; + +//---------------------------------------------------------------------- +void() trigger_doorstate_delay = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Remove the trigger delay function + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Re-route use function to actual counter + self.estate_use = trigger_counter_use; +}; + +//---------------------------------------------------------------------- +void() trigger_doorstate_setup = +{ + // entity check condition + self.lefty = FALSE; + + // Search for func_door targets + self.enemy = find(world, targetname, self.target); + // Found any yet? + while (self.enemy) { + // Found a func_door? + if (self.enemy.classtype == CT_FUNCDOOR) { + // All func_door(s) require toggle spawnflag enabled + if (self.enemy.spawnflags & DOOR_TOGGLE) self.lefty = TRUE; + else { + dprint("\b[TRIG_DOORSTATE]\b "); + dprint(self.enemy.targetname); + dprint(" missing toggle spawnflag!\n"); + } + } + // The whole list needs to be door entities + else { + dprint("\b[TRIG_DOORSTATE]\b Target ("); dprint(self.target); + dprint(") ("); dprint(self.enemy.classname); + dprint(") Wrong!\n"); + self.lefty = FALSE; + } + + // Keep looping through the find list + self.enemy = find(self.enemy, targetname, self.target); + } + + // Found any errors with setup? + if (self.lefty == FALSE) { + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Finally setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + // The delay function is not switched off, its activate to use + if (self.spawnflags & ENT_STARTOFF) self.estate_use = trigger_doorstate_delay; + else self.estate_use = trigger_doorstate_use; +}; + +//---------------------------------------------------------------------- +void() trigger_doorstate = +{ + self.classtype = CT_TRIGDOORSTATE; + if (self.state < 0 || self.state > 1) self.state = 0; + self.delay = self.sounds = 0; + self.message = self.noise = ""; + self.nodebuginfo = TRUE; + + // This entity is called a lot from pressure plate entities + // so it really needs to be setup right before use! + // No target = hard error and warning message + if (self.target == "") { + dprint("\b[TRIG_DOORSTATE]\b Missing target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Double check targets are right type + self.think = trigger_doorstate_setup; + self.nextthink = time + 0.2; +}; diff --git a/QC_other/QC_arcane/func_doorsecret.qc b/QC_other/QC_arcane/func_doorsecret.qc new file mode 100644 index 00000000..88ab822b --- /dev/null +++ b/QC_other/QC_arcane/func_doorsecret.qc @@ -0,0 +1,384 @@ +/*====================================================================== + SECRET DOOR FUNCTIONS +======================================================================*/ +float SECRET_OPEN_ONCE = 1; // stays open +float SECRET_1ST_LEFT = 2; // 1st move is left of arrow +float SECRET_1ST_DOWN = 4; // 1st move is down from arrow +float SECRET_NO_SHOOT = 8; // only opened by trigger +float SECRET_ALWAYS_SHOOT = 16; // shootable even if targeted + +/*====================================================================== +/*QUAKED func_door_secret (0 .5 .8) ? OPEN_ONCE 1ST_LEFT 1ST_DOWN NO_SHOOT ALWAYS_SHOOT x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A Door (bmodel) with 2 states and multiple stages +-------- KEYS -------- +targetname : = "" door opens with damage, != "" requires trigger to open +if using entity state system set ALWAYS_SHOOT spawnflags to fix this problem +target : name of target(s) to trigger at the start opening sequence +angle : determines the opening direction, use "360" for angle 0 +speed : movement speed (default = 50) +yaw_speed : 2nd movement speed (default = speed) +t_width : First Distance, override Width to move back (or height if going down) +t_length : Second Distance, override Length to move sideways +wait : wait before returning (default = 5) +dmg : damage to inflict when blocked. (default = 2) +message : centerprint message when touched (removed when opened) +sounds : 1 = medieval 2 = metal 3 = base(def) 4 = Silent 5 = custom +locksounds: 0 = talktalk 1 = short rattle, 2 = medium rattle, 3 = long rattle +noise : custom sound - door locked sound (targetname+message) +noise1 : custom sound - Open +noise2 : custom sound - Opening (looping) +noise3 : custom sound - Closed +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +ONCE_ONLY : Stays Open +1ST_LEFT : 1st move is left of arrow +1ST_DOWN : 1st move is down from arrow +NO_SHOOT : only opened by trigger +ALWAYS_SHOOT : Always Shootable, even if targeted +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +A Door (bmodel) with 2 states and multiple stages + +======================================================================*/ + +//---------------------------------------------------------------------- +// Touch message ONLY! (every 2s repeat) +//---------------------------------------------------------------------- +void() func_door_secret_touch = +{ + if (self.estate & ESTATE_BLOCK) return; + if ( !(other.flags & FL_CLIENT) ) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 2; + + if (self.message) { + centerprint (other, self.message); + sound (other, CHAN_BODY, self.noise, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +// FINAL move back (reset door ready for use again) +//---------------------------------------------------------------------- +void () func_door_secret_done = +{ + self.state = STATE_BOTTOM; + if (self.estate == ESTATE_OFF) return; + // Add back takedamage if door is suppose to be shootable! + if (self.spawnflags & SECRET_ALWAYS_SHOOT) self.takedamage = DAMAGE_YES; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void () func_door_secret_move6 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest0, self.yaw_speed, func_door_secret_done); +}; + +//---------------------------------------------------------------------- +// Wait 1 second... +void () func_door_secret_move5 = +{ + if (self.estate == ESTATE_OFF) return; + self.nextthink = self.ltime + 1.0; + self.think = func_door_secret_move6; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +// Move backward... +void () func_door_secret_move4 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest1, self.yaw_speed, func_door_secret_move5); +}; + +//---------------------------------------------------------------------- +// Wait here until time to go back... +void () func_door_secret_move3 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + if (!(self.spawnflags & SECRET_OPEN_ONCE)) { + self.nextthink = self.ltime + self.wait; + self.think = func_door_secret_move4; + } +}; + +//---------------------------------------------------------------------- +// Start moving sideways w/sound... +void () func_door_secret_move2 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest2, self.speed, func_door_secret_move3); +}; + +//---------------------------------------------------------------------- +// Wait after first movement... +void () func_door_secret_move1 = +{ + if (self.estate == ESTATE_OFF) return; + self.nextthink = self.ltime + 1.0; + self.think = func_door_secret_move2; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void () func_door_secret_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong or door moving + if (self.estate & ESTATE_BLOCK) return; + if (self.state != STATE_BOTTOM) return; + + self.state = STATE_UP; + self.takedamage = DAMAGE_NO; + self.velocity = '0 0 0'; + + // no more touch message and fire targets + self.message = string_null; + SUB_UseTargets(); + + // Make a sound, wait a little... + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.nextthink = self.ltime + 0.1; + + // Start FIRST move (t_width) + SUB_CalcMove(self.dest1, self.speed, func_door_secret_move1); + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +void() func_door_secret_killed = +{ + self.health = self.max_health; + func_door_secret_use (); +}; + +//---------------------------------------------------------------------- +void() func_door_secret_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.velocity = '0 0 0'; + + // trigger once doors? + if ( self.spawnflags & SECRET_OPEN_ONCE ) { + // if the door is open, do nothing + if (self.state == STATE_TOP) self.max_health = 0; + } + else { + // Reset health, state and frame back to default + setorigin(self, self.dest0); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } + + // reset health and damage trigger + if (self.max_health > 0) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + } +}; + +//---------------------------------------------------------------------- +void() func_door_secret_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.velocity = '0 0 0'; + + // Reset health, position and frame back to default + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.takedamage = DAMAGE_NO; + self.think = SUB_Null; + + // trigger once door? + if ( self.spawnflags & SECRET_OPEN_ONCE ) { + // if the door is moving, go to final position + if (self.state == STATE_TOP) setorigin(self, self.dest2); + } + else { + // Reset back to the beginning + setorigin(self, self.dest0); + self.state = STATE_BOTTOM; + } +}; + +//---------------------------------------------------------------------- +void() func_door_secret_disable = +{ + // Block damage function + self.takedamage = DAMAGE_NO; +}; + +//---------------------------------------------------------------------- +void() func_door_secret_reset = +{ + // If the door is still OFF then leave it + if (self.spawnflags & ENT_STARTOFF) return; + + // reset to original position + setorigin(self, self.dest0); + self.state = STATE_BOTTOM; + self.attack_finished = 0; + + // Restore door to ON state + self.estate = ESTATE_OFF; + self.estate_on(); + self.think = SUB_Null; + +}; + +//---------------------------------------------------------------------- +void () func_door_secret_blocked = +{ + if (self.estate == ESTATE_OFF) return; + if (time < self.attack_finished) return; + self.attack_finished = time + 0.5; + T_Damage (other, self, self, self.dmg, DAMARMOR); +}; + +//---------------------------------------------------------------------- +void () func_door_secret = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + + // Default = 3 - Medieval + if (self.sounds == 0 || self.sounds == 3) { + self.noise1 = "doors/basesec2.wav"; + self.noise2 = "doors/basesec1.wav"; + self.noise3 = "doors/basesec2.wav"; + } + else if (self.sounds == 1) { + self.noise1 = "doors/latch2.wav"; + self.noise2 = "doors/winch2.wav"; + self.noise3 = "doors/drclos4.wav"; + } + else if (self.sounds == 2) { + self.noise1 = "doors/airdoor2.wav"; + self.noise2 = "doors/airdoor1.wav"; + self.noise3 = "doors/airdoor2.wav"; + } + + // locked sound (targetname + message) + if (self.noise == "") self.noise = SOUND_TALK; + if (self.locksounds == 1) self.noise = "doors/rattle1.wav"; + else if (self.locksounds == 2) self.noise = "doors/rattle2.wav"; + else if (self.locksounds == 3) self.noise = "doors/rattle6.wav"; + + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + self.classtype = CT_FUNCSECDOOR; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + // Save any angle value first (original behaviour) + self.mangle = self.angles; + + // Allow for angles up/down by using movedir instead + if (CheckZeroVector(self.angles)) self.angles = '0 360 0'; + SetMovedir (); // Setup move direction base on angles + + if(!self.speed) self.speed = 50; // Movement speed (per phase) + if(!self.yaw_speed) self.yaw_speed = self.speed; + if (!self.wait) self.wait = 5; // 5 seconds before closing + if (!self.dmg) self.dmg = 2; + self.state = STATE_BOTTOM; + + // Add sec door to world to work out movement + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.dest0 = self.origin; + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + if (self.message != "") self.touch = func_door_secret_touch; + self.blocked = func_door_secret_blocked; + + // Damn annoying that the targetname is being used like this because + // there could have been a better way of doing this functionality + // == "" Secret_door can be damaged to be opened + // != "" Secret door cannot be damaged and requires trigger to work + // + if (self.targetname == "" && !(self.spawnflags & SECRET_NO_SHOOT)) { + self.spawnflags = self.spawnflags | SECRET_ALWAYS_SHOOT; + } + + // Finally if the spawnflag is set, then let the shooting begin! + if (self.spawnflags & SECRET_ALWAYS_SHOOT) { + self.health = self.max_health = 1; + self.takedamage = DAMAGE_YES; + self.th_die = func_door_secret_killed; + } + + // Calculate the sec door movement during spawn stage + // This was originally done when the sec door was used + self.lip = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 + // Original worked out v_forward based on angle/mangle + // Using movedir instead so up/down directions can be used + // makevectors(self.mangle); + + // Work out FIRST (t_width) direction to move + if (!self.t_width) { + if (self.spawnflags & SECRET_1ST_DOWN) self. t_width = fabs(v_up * self.size); + else self. t_width = fabs(v_right * self.size); + } + if (self.spawnflags & SECRET_1ST_DOWN) self.dest1 = self.origin - v_up * self.t_width; + else self.dest1 = self.origin + v_right * (self.t_width * self.lip); + + // Work out SECOND (t_length) direction to move + // using pre-defined movedir instead of v_forward + if (!self.t_length) self.t_length = fabs(self.movedir * self.size); + self.dest2 = self.dest1 + self.movedir * self.t_length; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_door_secret_on; + self.estate_off = func_door_secret_off; + self.estate_use = func_door_secret_use; + self.estate_reset = func_door_secret_reset; + self.estate_disable = func_door_secret_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; diff --git a/QC_other/QC_arcane/func_insvolume.qc b/QC_other/QC_arcane/func_insvolume.qc new file mode 100644 index 00000000..38fc6f61 --- /dev/null +++ b/QC_other/QC_arcane/func_insvolume.qc @@ -0,0 +1,303 @@ +/*====================================================================== +/*QUAKED func_insidevolume (0 .5 .8) ? PLAYER MONSTER ITEM PUSHABLE x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Function to test if an entity bounding box is inside of this volume +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : Name of target(s) to trigger when fully INSIDE (fires every 0.1s) +target2 : Name of target(s) to trigger when partial INSIDE (fires every 0.1s) +message : Name of target(s) to trigger when exit VOLUME (fires on exit only) +wait : -1 = Fire the fully/exit volume target(s) once +delay : Delay time before volume controller becomes active +message2: Name of the only entity that can interact with this volume +no_deadbody : 1 = Monster dead bodies don't work with volume test +-------- SPAWNFLAGS -------- +PLAYER : Will react to player(s) +MONSTER : Will react to monster(s) +ITEM : Will react to item(s) +PUSHABLE : Will react to pushable(s) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Function to test if an entity bounding box is inside of this volume + +======================================================================*/ + +float FUNC_INSVOLPLAYER = 1; +float FUNC_INSVOLMONSTER = 2; +float FUNC_INSVOLITEM = 4; +float FUNC_INSVOLPUSHABLE = 8; + +//---------------------------------------------------------------------- +float(entity targ) func_insvolume_check = +{ + local vector targ_mins, targ_maxs; + + // Is the touching entity linked to anthing? + if (targ.touching == world) return TRUE; + + // Is the touching entity linked to this inside volume? + // Don't reset the touching entity, its being tested by something else + if (targ.touching != self.owner) return TRUE; + + // Has the touching entity been switch off/disabled + if (targ.estate & ESTATE_BLOCK) { targ.touching = world; return TRUE; } + + // Check for dead monsters and removed them from entity list + if (targ.flags & FL_MONSTER) { + if (self.owner.no_deadbody == 1 && targ.health < 1) { + targ.touching = world; + return TRUE; + } + } + + // Find entity origin + if (targ.bsporigin) { + // Bmodel origin is stored differently + self.owner.pos3 = bmodel_origin(targ); + // Min/max are only updated when spawned, use size instead + targ_mins = self.owner.pos3 - (targ.size*0.5); + targ_maxs = self.owner.pos3 + (targ.size*0.5); + } + else { + // Point entity uses origin key + self.owner.pos3 = targ.origin; + // Min/max are created when spawned + targ_mins = self.owner.pos3 + targ.mins; + targ_maxs = self.owner.pos3 + targ.maxs; + } + + // Test OUTSIDE space (targ max < trigger min) + if (targ_maxs_x < self.owner.dest1_x || targ_maxs_y < self.owner.dest1_y || + targ_maxs_z < self.owner.dest1_z) { + //dprint("ENT outside MINS\n"); + targ.touching = world; + self.owner.targetnumber = NEGATIVE; + return TRUE; + } + // Test OUTSIDE space (targ min > trigger max) + if (targ_mins_x > self.owner.dest2_x || targ_mins_y > self.owner.dest2_y || + targ_mins_z > self.owner.dest2_z) { + //dprint("ENT outside MAXS\n"); + targ.touching = world; + self.owner.targetnumber = NEGATIVE; + return TRUE; + } + + // Test INSIDE space (targ min < trigger min) + if (targ_mins_x < self.owner.dest1_x) return FALSE; + if (targ_mins_y < self.owner.dest1_y) return FALSE; + if (targ_mins_z < self.owner.dest1_z) return FALSE; + + // Test INSIDE space (targ max > trigger max) + if (targ_maxs_x > self.owner.dest2_x) return FALSE; + if (targ_maxs_y > self.owner.dest2_y) return FALSE; + if (targ_maxs_z > self.owner.dest2_z) return FALSE; + + // Finally something INSIDE the volume! + self.owner.targetnumber = TRUE; + return FALSE; +}; + +//---------------------------------------------------------------------- +void(entity targ) func_insvolume_add = +{ + if (self.tno1 == world) { self.tno1 = targ; targ.touching = self; } + else if (self.tno2 == world) { self.tno2 = targ; targ.touching = self; } + else if (self.tno3 == world) { self.tno3 = targ; targ.touching = self; } + else if (self.tno4 == world) { self.tno4 = targ; targ.touching = self; } + else if (self.tno5 == world) { self.tno5 = targ; targ.touching = self; } + else { + // A warning message for mappers to ignore! :P + if (self.pain_finished < time) { + self.pain_finished = time + 3; + dprint("\b[INSVOL]\b More than 5 entities touching!\n"); + } + } +}; + +//---------------------------------------------------------------------- +void() func_insvolume_touch = +{ + // Block functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // Already checking this (other) entity? + if (other.touching == self) return; + + // Check for an exact entity condition + if (self.message2 != "") { + // Is the touching entity the correct entity? + if (self.message2 != other.targetname) return; + } + + // Default = no touch + self.lefty = FALSE; + + // Test for all the different entity types + if (self.spawnflags & FUNC_INSVOLPLAYER && other.flags & FL_CLIENT) + self.lefty = TRUE; + else if (self.spawnflags & FUNC_INSVOLMONSTER && other.flags & FL_MONSTER) { + // Test for dead/living monsters? + if (self.no_deadbody == 0) self.lefty = TRUE; + else if (self.no_deadbody == 1 && other.health > 0) + self.lefty = TRUE; + } + else if (self.spawnflags & FUNC_INSVOLITEM && other.flags & FL_ITEM) + self.lefty = TRUE; + else if (self.spawnflags & FUNC_INSVOLPUSHABLE && other.classtype == CT_FUNCPUSHABLE) + self.lefty = TRUE; + + // If wrong type touching volume? + if (self.lefty == FALSE) return; + + // Add entity to volume list to keep checking + if (other.touching == world) + func_insvolume_add(other); +}; + +//---------------------------------------------------------------------- +void() func_insvolume_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + setsize (self, self.bbmins, self.bbmaxs); +}; + +//---------------------------------------------------------------------- +void() func_insvolume_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); +}; + +//---------------------------------------------------------------------- +void() func_insvolume_controller_think = +{ + // Keep the controller looping + self.think = func_insvolume_controller_think; + self.nextthink = time + 0.1; + self.owner.targetnumber = FALSE; + + // If switched off/disabled + if (self.owner.estate & ESTATE_BLOCK) return; + + // If no entities touching volume, do nothing + // This is a way to slow down the constant triggering + if (self.owner.tno1 != world || self.owner.tno2 != world || + self.owner.tno3 != world || self.owner.tno4 != world || + self.owner.tno5 != world) { + + // Go through the entities touching this volume + if (func_insvolume_check(self.owner.tno1) == TRUE) self.owner.tno1 = world; + if (func_insvolume_check(self.owner.tno2) == TRUE) self.owner.tno2 = world; + if (func_insvolume_check(self.owner.tno3) == TRUE) self.owner.tno3 = world; + if (func_insvolume_check(self.owner.tno4) == TRUE) self.owner.tno4 = world; + if (func_insvolume_check(self.owner.tno5) == TRUE) self.owner.tno5 = world; + + // Any entities pass the volume test? (FULL, PARTIAL and EXIT) + if (self.owner.targetnumber == TRUE) { + // FULLY inside the volume + if (self.owner.target != "") { + trigger_strs(self.owner.target, self.owner); + if (self.owner.wait < 0) self.owner.target = ""; + } + } + else if (self.owner.targetnumber == NEGATIVE) { + // Just EXIT the volume + if (self.owner.message != "") { + trigger_strs(self.owner.message, self.owner); + if (self.owner.wait < 0) self.owner.message = ""; + } + } + else { + // PARTIALLY inside the volume + if (self.owner.target2 != "") { + trigger_strs(self.owner.target2, self.owner); + } + } + } +}; + +//---------------------------------------------------------------------- +void() func_insvolume_controller_setup = +{ + // Check if controller entity been setup + if (!self.attachment) self.attachment = spawn(); + + // Setup link back to inside volume + self.attachment.owner = self; + self.attachment.classtype = CT_CONTROL; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + // Setup controller above model origin location + self.oldorigin = bmodel_origin(self); + setorigin(self.attachment, self.oldorigin + '0 0 32'); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Start controller think loop + self.attachment.think = func_insvolume_controller_think; + self.attachment.nextthink = time + 0.1 + self.delay; +}; + +//====================================================================== +void() func_insidevolume = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // No trigger/movement angles + self.angles = '0 0 0'; self.movedir = '0 0 0'; + + self.classtype = CT_FUNCINSVOLUME; + self.nodebuginfo = TRUE; + + // Setup like a trigger in the map + InitTrigger (); + setsize (self, self.bbmins, self.bbmaxs); + + // Work out actual world origin coordinates + self.pos1 = self.size * 0.5; + self.pos2 = bmodel_origin(self); + + // Setup trigger boundary edges + self.dest1 = self.pos2 - self.pos1; + self.dest2 = self.pos2 + self.pos1; + + // Block all trigger extra parameters (not needed) + self.health = self.max_health = 0; + self.takedamage = DAMAGE_NO; + if (self.delay < 0) self.delay = 0; + + // Reset all touch entities to monitor + self.tno1 = self.tno2 = self.tno3 = self.tno4 = self.tno5 = world; + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_insvolume_on; + self.estate_off = func_insvolume_off; + self.touch = func_insvolume_touch; + + // Check for starting off or default=on + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + + // Setup volume controller (tests volumes) + self.think = func_insvolume_controller_setup; + self.nextthink = time + 0.2; +}; diff --git a/QC_other/QC_arcane/func_plats.qc b/QC_other/QC_arcane/func_plats.qc new file mode 100644 index 00000000..be953138 --- /dev/null +++ b/QC_other/QC_arcane/func_plats.qc @@ -0,0 +1,318 @@ +/*====================================================================== + PLATFORM FUNCTIONS +======================================================================*/ +float PLAT_LOW_TRIGGER = 1; +float PLAT_MIN_TRIGGER = 4; +float PLAT_START_LOWER = 8; +float PLAT_START_OPEN = 16; +float PLAT_STARTDIS = 32; // Platform starts in disabled state + +/*====================================================================== +/*QUAKED func_plat (0 .5 .8) ? LOW_TRIGGER x MIN_TRIGGER START_LOWER START_OPEN x STARTOFF x +A Platform (bmodel) with 2 states +-------- KEYS -------- +targetname : = "" plat start low, != "" plat starts high and reqs trigger to work +if using entity state system set START_LOWER spawnflags to fix this problem +speed : moving speed (def=150) +height : determines the distance to move, instead of bmodel bounds +sounds : 1=Base, 0 or 2=Medieval (def), 4=Silent, 5=Custom sounds +noise : custom sound - moving (looping) +noise1 : custom sound - Stopped +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +LOW_TRIGGER : touch trigger will not keep the platform at the top, will reset +MIN_TRIGGER : uses the min bounding box (instead of max) to calculate trigger +START_LOWER : will start the platform lower regardless of targetname +START_OPEN : Used for lighting issues, place at bottom position +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Platforms are always created in the upper position, so they can be lit better. +If targetname is defined the func_plat starts high and is locked until triggered +Once the func_plat has been triggered, it will become a normal platform. + +======================================================================*/ + +void() func_plat_hit_bottom = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_BOTTOM; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void() func_plat_go_down = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_DOWN; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + SUB_CalcMove (self.pos2, self.speed, func_plat_hit_bottom); +}; + +//---------------------------------------------------------------------- +void() func_plat_hit_top = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_TOP; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.think = func_plat_go_down; + self.nextthink = self.ltime + 3; +}; + +//---------------------------------------------------------------------- +void() func_plat_go_up = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_UP; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + SUB_CalcMove (self.pos1, self.speed, func_plat_hit_top); +}; + +//---------------------------------------------------------------------- +void() func_plat_trigger_touch = +{ + if (self.owner.estate & ESTATE_BLOCK) return; + if (self.owner.state == STATE_DISABLED) return; + if (!(other.flags & FL_CLIENT)) return; + if (other.health <= 0) return; + + // Switch the platform entity + self = self.owner; + if (self.state == STATE_BOTTOM) func_plat_go_up (); + else if (self.state == STATE_TOP) + self.nextthink = self.ltime + 1; // delay going down +}; + +//---------------------------------------------------------------------- +void() func_plat_trigger_spawn = +{ + local entity trigger; + local vector tmin, tmax; + + trigger = spawn(); + trigger.owner = self; + trigger.touch = func_plat_trigger_touch; + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + + tmin = self.mins + '25 25 0'; + tmax = self.maxs - '25 25 -8'; + + // The ID method is to take the maximum size of the platform + // and subtract the height. This fails if the platform + // is moving around a central height point. The Alternative + // method uses the min bounding box value instead of max + // This is not 100% capatible with id maps, so hence extra option! + if (self.spawnflags & PLAT_MIN_TRIGGER) tmin_z = tmin_z - (self.height + 8); + else tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); + + if (self.spawnflags & PLAT_LOW_TRIGGER) tmax_z = tmin_z + 8; + + + if (self.size_x <= 50) { + tmin_x = (self.mins_x + self.maxs_x) / 2; + tmax_x = tmin_x + 1; + } + if (self.size_y <= 50) { + tmin_y = (self.mins_y + self.maxs_y) / 2; + tmax_y = tmin_y + 1; + } + + setsize (trigger, tmin, tmax); +}; + +//---------------------------------------------------------------------- +void() func_plat_use = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + if (self.state == STATE_DISABLED) func_plat_go_down(); + } +}; + +//---------------------------------------------------------------------- +void() func_plat_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + if (self.state != STATE_DISABLED) { + // Reset health, state and frame back to default + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } + + // If platform started disable, release to lower position + if (self.spawnflags & PLAT_STARTDIS) { + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & PLAT_STARTDIS); + if (self.state == STATE_DISABLED) func_plat_go_down(); + } +}; + +//---------------------------------------------------------------------- +void() func_plat_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Stop all movement sounds + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + + if (self.state != STATE_DISABLED) { + // Reset health, position and frame back to default + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } +}; + +//---------------------------------------------------------------------- +void() func_plat_disable = +{ + // Lock platform in current location + self.estate = ESTATE_DISABLE; +}; + +//---------------------------------------------------------------------- +void() func_plat_blocked = +{ + T_Damage (other, self, self, 1, DAMARMOR); + + if (self.state == STATE_UP) func_plat_go_down (); + else if (self.state == STATE_DOWN) func_plat_go_up (); +}; + +//---------------------------------------------------------------------- +void() func_plat = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // default sound = medieval + if (self.sounds == 0) self.sounds = 2; + + if (self.sounds == 1) { + self.noise = "plats/plat1.wav"; + self.noise1 = "plats/plat2.wav"; + } + else if (self.sounds == 2) { + self.noise = "plats/medplat1.wav"; + self.noise1 = "plats/medplat2.wav"; + } + else { + // sounds 4 = silent, sounds 5 = custom + if (self.noise == "" || self.sounds == 4) self.noise = SOUND_EMPTY; + if (self.noise1 == "" || self.sounds == 4) self.noise1 = SOUND_EMPTY; + } + precache_sound (self.noise); + precache_sound (self.noise1); + + self.classtype = CT_FUNCPLAT; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + // angles has to be 0 0 0 otherwise brush model is twisted + // save angles to mangle for use later by movement code + self.mangle = self.angles; + self.angles = '0 0 0'; + + // This is not used anywhere, old code ideas from ID + if (!self.t_length) self.t_length = 80; + if (!self.t_width) self.t_width = 10; + if (!self.speed) self.speed = 150; + self.state = STATE_BOTTOM; // Default state (lower) + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + setmodel (self, self.mdl); + setsize (self, self.mins , self.maxs); + + // Cannot have a platform start off or disabled + // with no targetname, how can it be actived!?! + if (self.spawnflags & PLAT_STARTDIS && self.targetname == "") { + dprint("\b[PLAT]\b Starting DISABLED with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + if (self.spawnflags & ENT_STARTOFF && self.targetname == "") { + dprint("\b[PLAT]\b Starting OFF with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Move the platform up to open position (lighting issues) + // Need to update mins/maxs so that spawn trigger is correct + // otherwise it will be in original position and spawn low + if (self.spawnflags & PLAT_START_OPEN) { + self.origin_z = self.origin_z + self.height; + self.mins_z = self.mins_z + self.height; + self.maxs_z = self.maxs_z + self.height; + } + + // pos1 is the top position, pos2 is the bottom + self.pos1 = self.pos2 = self.origin; + // self.height cannot be a negative, min/maxs will be back-to-front + if (self.height) self.pos2_z = self.origin_z - fabs(self.height); + else self.pos2_z = self.origin_z - self.size_z + 8; + + // Setup touch trigger and block function + func_plat_trigger_spawn (); + self.blocked = func_plat_blocked; + + // Damn annoying that the targetname is being used like this because + // there could have been a better way to do this type of functionality + // == "" Platform starts in lower position (default) + // != "" Platform starts in upper position and requires trigger to work + // + if (self.targetname != "" && !(self.spawnflags & PLAT_START_LOWER) ) + self.state = STATE_DISABLED; + else setorigin (self, self.pos2); // Start in lower position + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_plat_on; + self.estate_off = func_plat_off; + self.estate_use = func_plat_use; + self.estate_disable = func_plat_disable; + + // Check for the easy way to start a platform disabled + if (self.spawnflags & PLAT_STARTDIS) self.estate_disable(); + // Check for starting override for entity state + else if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() plat_hit_bottom = { func_plat_hit_bottom(); }; diff --git a/QC_other/QC_arcane/func_pswitch.qc b/QC_other/QC_arcane/func_pswitch.qc new file mode 100644 index 00000000..6877a566 --- /dev/null +++ b/QC_other/QC_arcane/func_pswitch.qc @@ -0,0 +1,245 @@ +/*====================================================================== + PRESSURE SWITCH FUNCTIONS + + * Originally started as an extension of the func_button entity + * Had too many spawning/setup conditions and was made into own entity + * Having the trigger, touch and movement on one entity did not work + * Split the trigger/touch into a separate spawn function, not v flexible + * Entity Detection has to be volume, only players have floor touch bbox + * Added a separate trigger/touch entity to detect diff entity types + * Trigger needed to keep track of multiple touching entities at once + * Detecting intersection volumes without a touch function is cpu intense + +======================================================================*/ +float PSWITCH_STARTDIS = 32; // Switch starts in disabled state +//---------------------------------------------------------------------- + +/*QUAKED func_pressureswitch (0 .5 .8) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Pressure switch (bmodel) with touch state only +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger (only works with pressure relays) +angle : Always moves downward (needs to reflect gravity pressure) +speed : Move Speed (def=40) +lip : lip remaining at end of move. (def=4) +sounds : 0=steam metal, 1=wooden, 2=metallic, 3=in-out, 4=Silent, 5=Custom +noise : custom sound - 1st movement +noise1 : custom sound - 2nd movement ('buttons/switch21.wav') +message: Centerprint Message to display when triggered +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Pressure switch (bmodel) with touch state only +*/ + +//---------------------------------------------------------------------- +void() func_pswitch_ready = +{ + // Check for entity state changes + if (self.estate & ESTATE_BLOCK) return; + + self.frame = 0; + self.state = STATE_UP; +}; + +//---------------------------------------------------------------------- +void() func_pswitch_return = +{ + // Check for entity state changes + // Do not block disable (let it move up) + if (self.estate == ESTATE_OFF) return; + + if (self.state == STATE_DOWN) { + if (self.presstimersound < time) { + self.presstimersound = time + 1; + // 2nd movement sound - going up + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + } + self.ltime = time; + self.state = STATE_MOVING; + SUB_CalcMove (self.pos1, self.speed, func_pswitch_ready); + } +}; + +//---------------------------------------------------------------------- +void() func_pswitch_finished = +{ + // Check for any completed message + if (self.message != "") { + // Write message to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CENTERPRINT); + WriteString (MSG_ALL, self.message); + if (self.wait < 0) self.message = ""; + } + + // Check for any completed trigger(s) + if (self.target != "") { + trigger_strs(self.target, world); + if (self.wait < 0) self.target = ""; + } + + self.frame = 1; + self.state = STATE_DOWN; + + // Check for entity state changes + if (self.estate & ESTATE_BLOCK) return; + + self.think = func_pswitch_return; + self.nextthink = time + 0.2; +}; + +//---------------------------------------------------------------------- +void() func_pswitch_use = +{ + // Check for entity state changes + if (self.estate & ESTATE_BLOCK) return; + // Block trigger events if moving pressure plate + if (self.state == STATE_MOVING) return; + + // Is the pressure plate UP? + if (self.state == STATE_UP) { + if (self.presstimersound < time) { + self.presstimersound = time + 1; + // 1st movement sound - going down + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + // Move pressure pad into down position + self.ltime = time; + self.state = STATE_MOVING; + SUB_CalcMove (self.pos2, self.speed, func_pswitch_finished); + } + // Is the pressure plate DOWN? + else if (self.state == STATE_DOWN) { + // Keep waiting in the down position + self.think = func_pswitch_return; + self.nextthink = time + 0.2; + } +}; + +//---------------------------------------------------------------------- +void() func_pswitch_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Add to world pressure plate + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + // Reset state and frame back to default + setorigin(self, self.pos1); + self.state = STATE_UP; + self.think = SUB_Null; + self.frame = 0; +}; + +//---------------------------------------------------------------------- +void() func_pswitch_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Reset position and frame back to default + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + setorigin(self, self.pos1); + self.state = STATE_UP; + self.think = SUB_Null; + self.frame = 0; +}; + +//---------------------------------------------------------------------- +void() func_pressureswitch = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise == "") self.noise = SOUND_EMPTY; + + // Default 0 = air (base style) button + if (self.sounds == 0) self.noise = "buttons/airbut1.wav"; + else if (self.sounds == 1) self.noise = "buttons/switch21.wav"; + else if (self.sounds == 2) self.noise = "buttons/switch02.wav"; + else if (self.sounds == 3) self.noise = "buttons/switch04.wav"; + else if (self.sounds == 4) self.noise = SOUND_EMPTY; + precache_sound (self.noise); + + if (self.noise1 == "") self.noise1 = self.noise; + precache_sound (self.noise1); + + self.classtype = CT_FUNCPSWITCH; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + + // Pressure switches always move up/down + self.movedir = '0 0 -1'; + self.angles = '0 0 0'; + + // Default parameters and states + if (!self.speed) self.speed = 40; + if (!self.lip) self.lip = 4; + self.state = STATE_UP; + + self.health = self.max_health = 0; + self.takedamage = DAMAGE_NO; + self.wait = -1; + + // Reset all pressure switch variables + self.presstype = self.presstimersound = 0; + + // Setup the pressure switch two different state positions + // Got to add switch to world for bmodel size parameter + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Cannot have a pressure switch start off or disabled + // with no targetname, how can it be actived!?! + if (self.spawnflags & BUTTON_STARTDIS && self.targetname == "") { + dprint("\b[PSWITCH]\b Starting DISABLED with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + if (self.spawnflags & ENT_STARTOFF && self.targetname == "") { + dprint("\b[PSWITCH]\b Starting OFF with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_pswitch_on; + self.estate_off = func_pswitch_off; + self.estate_use = func_pswitch_use; + + // Check for starting off or default=on + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; diff --git a/QC_other/QC_arcane/func_trains.qc b/QC_other/QC_arcane/func_trains.qc new file mode 100644 index 00000000..38ba7682 --- /dev/null +++ b/QC_other/QC_arcane/func_trains.qc @@ -0,0 +1,556 @@ +/*====================================================================== + Train FUNCTIONS +======================================================================*/ +float TRAIN_STARTON = 1; +float TRAIN_NONSOLID = 2; +float TRAIN_MODEL = 4; +float TRAIN_TOUCH = 8; +float TRAIN_REVERSE = 32; + +/*====================================================================== +/*QUAKED func_train (0 .5 .8) ? STARTON NONSOLID MODEL TOUCH x REVERSE STARTOFF x +Bmodel platform moving around entity chain +-------- KEYS -------- +targetname : = "" start moving straight away != "" wait for trigger +target : Name of first path_corner to start at (instant move) +mdl : Specify a model for MODEL mode only (progs/object.mdl) +speed : moving speed (def=100) +dmg : block damage (def=2) +sounds : 0=Silent, 1=Ratchet Metal, 5=Custom sounds +noise : custom sound - stopped +noise1 : custom sound - moving (looping) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTON : Start moving straight away if targetname is used +NONSOLID : No collision or blocking functionality (uses bmodel) +MODEL : Model with no collision (use mdl key, def=empty model) +TOUCH : Nonsolid or model trains have touch damage (dmg) +REVERSE : Start going backward through path_corner chain +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +The target's origin specifies the min point of the train at each corner. +The train spawns at the first target it is pointing at. +Use a chain of path_corners to specify which direction to travel + +======================================================================*/ +void() func_train_stop = +{ + // Play stop sound and switch state OFF + if ( self.sounds > 0 ) sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + self.velocity = self.avelocity = '0 0 0'; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +vector(entity targ) func_train_origin = +{ + local vector org; + if (self.bsporigin) org = targ.origin - self.mins; + else org = targ.origin; + return org; +}; + +//---------------------------------------------------------------------- +void() func_train_pause = +{ + // Block entity state OFF, DISABLE reqs stop sound and trigger event + if (self.estate == ESTATE_OFF) return; + + // Reset velocity and rotation (stationary object) + self.velocity = '0 0 0'; + + // Copy CURRENT path corner wait/delay setup + self.wait = self.movetarget.wait; + self.delay = self.movetarget.delay; + + // Fire any event targets on path_corner + if (self.movetarget.corner_event) + trigger_strs(self.movetarget.corner_event, self); + + // Deadend logic, setup ready for backwards route + // Check for any path corner instant switch direction logic + if (self.movetarget.spawnflags & PATHC_DEADEND || + self.movetarget.spawnflags & PATHC_REVERSE) { + self.direction = 1 - self.direction; + } + + // func_trains that are nonsolid need to reset ltime + // otherwise they will never pause at path_corner + if (!self.bsporigin) self.ltime = time; + + // If the train has been disabled, stop and make sound + // Need to check wait logic at arriving path_corner and not before + // Some ID maps used wait = -1 and some did path corner stacking + if (self.state == STATE_OFF || self.wait < 0) func_train_stop(); + + // nopause spawnflag ALWAYS overrides any wait state + else if (self.movetarget.spawnflags & PATHC_NOPAUSE) self.estate_fire(); + else { + // Is wait setup to pause the train? + if (self.wait > 0 ) { + self.nextthink = self.ltime + self.wait + (self.delay * random()); + // Play stop sound if setup + if ( self.sounds > 0 ) sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + // Stop any movement or rotation + self.velocity = self.avelocity = '0 0 0'; + } + // ID logic - 1 frame pause at each path_corner + else self.nextthink = self.ltime + 0.1; + + // Keep going to next path corner + self.think = self.estate_fire; + } +}; + +//---------------------------------------------------------------------- +void() func_train_next = +{ + // Block entity state OFF, DISABLE needs to stop properly + if (self.estate & ESTATE_DISABLE) func_train_stop(); + else if (self.estate & ESTATE_OFF) return; + else if (self.state == STATE_OFF) return; + + //---------------------------------------------------------------------- + // I suppose this is where the train logic goes off the rails! + // Two types of routing logic exists, random or exact path choices + // + // Only do extra logic routing if alternative route exists + //---------------------------------------------------------------------- + if ( self.movetarget.spawnflags & PATHC_TARGET2) { + //---------------------------------------------------------------------- + // Exact logic paths ALWAYS overriding any choice or defaults + // This will even send a train back the way it came if selected + // This route logic mode will always change direction flow + //---------------------------------------------------------------------- + if (self.movetarget.spawnflags & PATHC_EXACT) { + if (self.movetarget.state == STATE_ROUTE2) { + // Alternative forward route + self.goalentity = self.movetarget.movetarget2; + self.direction = 0; + } + else if (self.movetarget.state == STATE_ROUTE3) { + // Backward route + self.goalentity = self.movetarget.movetarget3; + self.direction = 1; + } + else { + // Default forward route + self.goalentity = self.movetarget.movetarget; + self.direction = 0; + } + } + //---------------------------------------------------------------------- + // Random logic paths behave differently based on current direction + // FORWARD : randomly pick between two forward routes, ignore back route + // BACKWARD : ignore last travelled route and randomly pick from two remaining + //---------------------------------------------------------------------- + else { + // direction : forward = 0, backward = 1 + if (self.direction) { + // Setup default route following backward flow + self.goalentity = self.movetarget.movetarget3; + // random chance to pick another route? + if (random() < 0.5) { + // Switch direction to forward and pick fresh route + self.direction = 0; + if (self.movelast == self.movetarget.movetarget) + self.goalentity = self.movetarget.movetarget2; + else if (self.movelast == self.movetarget.movetarget2) + self.goalentity = self.movetarget.movetarget; + } + } + else { + // Randomly pick from two forward routes, easy logic + self.goalentity = self.movetarget.movetarget; + if (random() < 0.5) self.goalentity = self.movetarget.movetarget2; + } + } + } + //---------------------------------------------------------------------- + // Standard path corner, one forward, one backward route + // Check if the route entities exist first + // path corners can take a while to be fully setup + //---------------------------------------------------------------------- + else { + // Backward route + if (self.direction) { + // Spawnflag setup when path_corner has found a link + if (self.movetarget.spawnflags & PATHC_BACKLINK) + self.goalentity = self.movetarget.movetarget3; + else { + // Slowly search world entity list for backlink target + self.oldenemy = find (world, target, self.movetarget.targetname); + while(self.oldenemy) { + if (self.oldenemy.classtype == CT_PATHCORNER) { + self.goalentity = self.oldenemy; + self.oldenemy = world; + } + else self.oldenemy = find(self.oldenemy, target, self.movetarget.targetname); + } + } + } + // Forward route + else { + // Spawnflag setup when path_corner has found a link + if (self.movetarget.spawnflags & PATHC_TARGET1) + self.goalentity = self.movetarget.movetarget; + else { + // Slowly search world entity list for forward target + self.oldenemy = find (world, targetname, self.movetarget.target); + while(self.oldenemy) { + if (self.oldenemy.classtype == CT_PATHCORNER) { + self.goalentity = self.oldenemy; + self.oldenemy = world; + } + else self.oldenemy = find(self.oldenemy, targetname, self.movetarget.target); + } + } + } + } + + //---------------------------------------------------------------------- + // This is the last check before moving towards the next corner + // If no route entity has been found then stop and do nothing + // If route found, setup final details and move towards next corner + //---------------------------------------------------------------------- + if (!self.goalentity) func_train_stop(); + else { + // Play moving sound if active (sounds = 1 or 5) + if ( self.sounds > 0) sound (self, CHAN_VOICE, self.noise1, self.volume, ATTN_NORM); + // Work out NEXT path_corner origin + self.finaldest = func_train_origin(self.goalentity); + // Check if CURRENT path_corner for a different speed + if (self.movetarget.speed > 0) self.distance = self.movetarget.speed; + else self.distance = self.speed; + + // Move forward to next target + self.movelast = self.movetarget; + self.movetarget = self.goalentity; + + // Horrible hack for sawblades to make sure avelocity + // matches direction of path_corners + if (self.classtype == CT_SAWBLADE) { + // Workout movement direction between path corners + self.movedir = normalize(self.movetarget.origin - self.movelast.origin); + // Only interested in 1/0/-1 values + self.movedir_x = rint(self.movedir_x); + self.movedir_y = rint(self.movedir_y); + self.movedir_z = rint(self.movedir_z); + // Check for any positive values? + if (self.movedir_x > 0 || self.movedir_y > 0 || self.movedir_z > 0) + self.avelocity = -self.v_angle; + else self.avelocity = self.v_angle; + } + + // func_trains that are nonsolid need to reset ltime + // otherwise they will instantly warp to next corner + if (!self.bsporigin) self.ltime = time; + + // Is the next path_corner an instant move? + if (self.movetarget.spawnflags & PATHC_INSTANT) { + setorigin (self, self.finaldest); + func_train_pause(); + } + else { + // Finally workout movement (finaldest) and speed (distance) + SUB_CalcMove (self.finaldest, self.distance, func_train_pause); + } + } +}; + +//---------------------------------------------------------------------- +void() func_train_resume = +{ + local float pc_dist; + + // Final destionation not setup correctly, move on + if (self.goalentity.classtype != CT_PATHCORNER) self.estate_fire(); + + pc_dist = fabs(vlen(self.finaldest - self.origin)); + if (pc_dist > 0) { + // Play moving sound if active (sounds = 1 or 5) + if ( self.sounds > 0) sound (self, CHAN_VOICE, self.noise1, self.volume, ATTN_NORM); + // Setup sawblades to keep spinning + if (self.classtype == CT_SAWBLADE) { + if (self.movedir_x > 0 || self.movedir_y > 0 || self.movedir_z > 0) + self.avelocity = -self.v_angle; + else self.avelocity = self.v_angle; + } + // Double check distance is setup correctly + if (self.distance < 1) self.distance = self.speed; + if (!self.bsporigin) self.ltime = time; + SUB_CalcMove (self.finaldest, self.distance, func_train_pause); + } + // Too close to final destination, just move on + else self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() func_train_use = +{ + // Block entity state OFF + DISABLE + if (self.estate & ESTATE_BLOCK) return; + + // Original ID logic - No toggle, a triggered train stays ON + // Stop any re-trigger events from reset movement + if (self.state == STATE_OFF) { + self.state = STATE_ON; + self.estate_fire(); + } +}; + +//---------------------------------------------------------------------- +void() func_train_touch = +{ + // Train can still hurt if touched, except when OFF = not visible + if (self.estate & ESTATE_OFF) return; + if (other.health < 1 || other.takedamage == DAMAGE_NO) return; + if (time < self.attack_finished) return; + + self.attack_finished = time + 0.5; + // Instant death for monsters + if (other.flags & FL_MONSTER) + T_Damage (other, self, self, other.max_health + 100, DAMARMOR); + else + // Small damage but can be lethal because of how often touch runs + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // Blood and gore at object location not train + SpawnMeatSpray ( other, other, 250); +}; + +//---------------------------------------------------------------------- +void() func_train_startcorner = +{ + // Find first corner (after spawning) + if (!self.owner) self.owner = find(world, targetname, self.target); + + // Has the first path corner been found? + if (self.owner) { + // Move to first path corner (instantly) + self.finaldest = func_train_origin(self.owner); + setorigin (self, self.finaldest); + self.movetarget = self.owner; + + // Setup last path corner location based on direction + if (self.direction) self.movelast = self.owner.movetarget; + else self.movelast = self.owner.movetarget3; + // Double check movelast is valid, if not reset + if (!self.movelast) self.movelast = self.owner; + + // Fire any event targets on path_corner + if (self.movetarget.corner_event) + trigger_strs(self.movetarget.corner_event, self); + } + // Cannot find first corner (bad situation) + // Go back to spawn location! + else { + setorigin (self, self.dest0); + self.movetarget = self.movelast = self; + } +}; + +//---------------------------------------------------------------------- +void() func_train_setup = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + + func_train_startcorner(); // Reset train to first corner + self.estate_use = func_train_use; // Switch ON train only, no toggle + self.estate_fire = func_train_next; // Move train to next path corner + self.state = STATE_OFF; // Train is OFF, waiting + + // Check for any touch damage trigger (nonsolid + model only) + if (self.solid == SOLID_TRIGGER && self.spawnflags & TRAIN_TOUCH) + self.touch = func_train_touch; + + // Did the first corner (owner) exist? + if (self.owner) { + // no trigger name? = start immediately + // Extra spawnflag to bypass original ID train logic + if (self.targetname == "" || self.spawnflags & TRAIN_STARTON) { + self.nextthink = self.ltime + 0.1; + self.think = self.estate_use; + } + } +}; + +//---------------------------------------------------------------------- +void() func_train_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Setup train in different collision/visual states + if (self.spawnflags & TRAIN_NONSOLID) { + self.movetype = MOVETYPE_PUSH; // Bmodel interaction + self.solid = SOLID_TRIGGER; // No blocking collision + } + // Useful for targetting systems + else if (self.spawnflags & TRAIN_MODEL) { + self.movetype = MOVETYPE_NOCLIP; // Free movement + if (self.spawnflags & TRAIN_TOUCH) // Check for touch damage + self.solid = SOLID_TRIGGER; + else self.solid = SOLID_NOT; // No world interaction + } + else { + // default state - push/collision + self.movetype = MOVETYPE_PUSH; // Bmodel interaction + self.solid = SOLID_BSP; // blocking collision + } + + self.estate = ESTATE_ON; // Switch on entity + setmodel (self, self.mdl); // Show bmodel/model + setsize (self, self.mins , self.maxs); // Use defined size above + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); // Stop any sound + self.velocity = self.avelocity = '0 0 0'; // reset velocity/rotation +}; + +//---------------------------------------------------------------------- +void() func_train_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; // Switch off entity + self.state = STATE_OFF; // Stop train functions + self.movetype = MOVETYPE_NONE; // Switch off movement + self.solid = SOLID_NOT; // No world interaction + setmodel (self, ""); // Remove any bmodel/model + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); // Stop any sound + setorigin(self, self.finaldest); // Instantly move to final destionation + self.velocity = self.avelocity = '0 0 0'; // reset velocity/rotation + self.think = SUB_Null; // Stop any future thinking +}; + +//---------------------------------------------------------------------- +void() func_train_disable = +{ + // Wait for entity to finish what it was doing + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() func_train_reset = +{ + // If the train is still STARTING OFF? then leave it + if (self.spawnflags & ENT_STARTOFF) return; + + func_train_startcorner(); // Reset train back to first corner + self.estate = ESTATE_OFF; // Switch off entity (make sure on func works) + self.state = STATE_OFF; // Stop train functions + self.estate_on(); // Switch train back on (reset location) + self.think = SUB_Null; // Stop any future thinking +}; + +//---------------------------------------------------------------------- +void() func_train_blocked = +{ + // This is constant crushing or instant death collision + if (time < self.attack_finished) return; + self.attack_finished = time + 0.5; + T_Damage (other, self, self, self.dmg, DAMARMOR); +}; + +//---------------------------------------------------------------------- +void() func_train = +{ + // 0 = No sound, 1 = train, 5 = custom + if (self.sounds == 0) { + self.noise = SOUND_EMPTY; + self.noise1 = SOUND_EMPTY; + } + else if (self.sounds == 1) { + self.noise = ("plats/train2.wav"); + self.noise1 = ("plats/train1.wav"); + } + else { + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + } + precache_sound (self.noise); + precache_sound (self.noise1); + + self.classtype = CT_FUNCTRAIN; + self.classgroup = CG_FUNCMOVER; + self.state = STATE_OFF; + self.angles = '0 0 0'; + + if (self.speed < 1) self.speed = 100; + if (!self.dmg) self.dmg = 2; + self.volume = 1; + + // Cannot have nonsolid and nodraw together, they are different entity types + // nonsolid = bmodel with no collision, nodraw = point entity with empty model + if (self.spawnflags & TRAIN_NONSOLID && self.spawnflags & TRAIN_MODEL) { + dprint("\b[FUNC_TRAIN]\b Cannot be bmodel AND model!\n"); + self.spawnflags = self.spawnflags - TRAIN_MODEL; + } + + // There are two types of func_trains (bmodel or point entities) + // Setup train collision / block damage + if ( self.spawnflags & TRAIN_MODEL ) { + setmodel (self, self.model); // Setup bmodel for origin + self.dest0 = bmodel_origin(self); // Calculate reset location + self.finaldest = self.dest0; // Save reset location + setmodel(self, ""); // no longer need bmodel + setorigin(self, self.finaldest); // Move entity to world origin + if (self.mdl) precache_model(self.mdl); // Any custom model defined? + else self.mdl = MODEL_BROKEN; // Use default empty model + self.bsporigin = FALSE; // Not bmodel anymore + self.ltime = time; // Start local timer + } + else { + self.mdl = self.model; // Save bmodel for later + self.bsporigin = TRUE; // bmodel origin active + self.finaldest = self.dest0 = '0 0 0'; // reset/current origin + self.blocked = func_train_blocked; // bmodel collision/block + } + + // Cannot have start ON and OFF together, remove OFF state! + if (self.spawnflags & TRAIN_STARTON && self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Setup train direction (switchable via path corners) + if (self.spawnflags & TRAIN_REVERSE) self.direction = 1; + else self.direction = 0; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_train_on; + self.estate_off = func_train_off; + + // Check for a target to move towards? + if (self.target == "") { + dprint("\b[FUNC_TRAIN]\b without a target!?!\n"); + func_train_on(); + return; + } + + // Train has a target, finish setup + self.estate_use = func_train_setup; + self.estate_reset = func_train_reset; + self.estate_disable = func_train_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // Start ON to catch anything (droptofloor) + self.estate_on(); + // start trains on the second frame, to make sure their + // targets have had a chance to spawn + self.nextthink = self.ltime + 0.1; + self.think = self.estate_use; + } +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() train_wait = {}; \ No newline at end of file diff --git a/QC_other/QC_arcane/globalfog.qc b/QC_other/QC_arcane/globalfog.qc new file mode 100644 index 00000000..85a179d3 --- /dev/null +++ b/QC_other/QC_arcane/globalfog.qc @@ -0,0 +1,325 @@ +/*====================================================================== + GLOBAL FADING FOG SYSTEM + + * Original idea from Honey mod by CZG + * Written from scratch as Honey implementation is weird + * Created special long float function for better accuracy + * Fog functionality has to be active before controller can be setup + * Creates a special entity (controller) to work in background + * Controller is setup from client.qc / PlayerPostThink function + +======================================================================*/ + +//---------------------------------------------------------------------- +// Returns power of 10 for string format function below +//---------------------------------------------------------------------- +float(float pow_loop) pow10 = +{ + local float pow_num, pow_counter; + pow_num = 10; + pow_counter = 1; + if (pow_loop < 1) pow_loop = 1; + + while (pow_counter < pow_loop) { + pow_num = pow_num * 10; + pow_counter = pow_counter + 1; + } + return pow_num; +}; + +//---------------------------------------------------------------------- +// (Long Float TO String) Format and print a number to the console +// - str_player : needs to be a client for various buffer commands +// - buffer : BUFFER_STUFFCMD, BUFFER_SPRINT, BUFFER_DPRINT +void(entity str_player, float str_num, float topbit, float botbit, float buffer) lftos = +{ + local float str_counter, str_pow, str_result, str_remain, str_first; + + str_counter = topbit; // Upper number length + str_pow = pow10(topbit); // Setup initial base 10 power for checking + str_remain = FALSE; // Decimal point been done yet + str_first = FALSE; // First non-zero digit printed + + // Deal with negative state first + if (str_num < 0) { + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, "-"); + else if (buffer & BUFFER_SPRINT) sprint(str_player, "-"); + else if (buffer & BUFFER_DPRINT) dprint("-"); + } + // Get rid of negative state + str_num = fabs(str_num); + + // If number larger than fixed length? - truncate number + if (str_num > str_pow) + str_num = str_num - (floor(str_num / str_pow) * str_pow); + + // Loop through upper part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + // Floor can produce rounding errors (fix it with 0.01) + str_result = floor((str_num / str_pow)+0.01); + // Result must be 0-9 digits + if (str_result > 9) str_result = 0; + if (str_result < 1) str_result = 0; + + if (str_result > 0 || str_first) { + str_first = TRUE; + // Print digit to buffer type + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, ftos(str_result)); + else if (buffer & BUFFER_SPRINT) sprint(str_player, ftos(str_result)); + else if (buffer & BUFFER_DPRINT) dprint(ftos(str_result)); + } + + // remove top part of number, decrease str length counter + str_num = str_num - (str_result * str_pow); + str_counter = str_counter - 1; + } + + // Is there any remainder? + if (str_counter < 1) { + // Print decimal point to buffer type + if (!str_first) { + str_first = TRUE; + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, "0."); + else if (buffer & BUFFER_SPRINT) sprint(str_player, "0."); + else if (buffer & BUFFER_DPRINT) dprint("0."); + } + else { + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, "."); + else if (buffer & BUFFER_SPRINT) sprint(str_player, "."); + else if (buffer & BUFFER_DPRINT) dprint("."); + } + if (botbit <1) botbit=1; + str_counter = botbit; + while (botbit > 0) { + str_num = str_num * 10; + botbit = botbit -1; + } + str_pow = pow10(str_counter); + } + + // Loop through lower part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + // Floor can produce rounding errors (fix it with 0.01) + str_result = floor((str_num / str_pow)+0.01); + // Result must be 0-9 digits + if (str_result > 9) str_result = 0; + if (str_result < 1) str_result = 0; + + if (str_result > 0 || str_first) { + str_first = TRUE; + // Print digit to buffer type + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, ftos(str_result)); + else if (buffer & BUFFER_SPRINT) sprint(str_player, ftos(str_result)); + else if (buffer & BUFFER_DPRINT) dprint(ftos(str_result)); + } + + // remove top part of number, decrease str length counter + str_num = str_num - (str_result * str_pow); + str_counter = str_counter - 1; + } +}; + +//---------------------------------------------------------------------- +void(entity client) change_fog = +{ + if (!fog_control) return; + + // Update fog parameters to console buffer + stuffcmd(client, "\n\n\nfog "); + if (ext_dpfog) lftos(client, fog_control.fog_currden+0.05, 1,3, BUFFER_STUFFCMD); + else lftos(client, fog_control.fog_currden, 1,3, BUFFER_STUFFCMD); + + stuffcmd(client, " "); + lftos(client, fog_control.fog_currcol_x, 1,3, BUFFER_STUFFCMD); + stuffcmd(client, " "); + lftos(client, fog_control.fog_currcol_y, 1,3, BUFFER_STUFFCMD); + stuffcmd(client, " "); + lftos(client, fog_control.fog_currcol_z, 1,3, BUFFER_STUFFCMD); + // Extra fog parameters for DarkPlaces extended engines + if (ext_dpfog) { + stuffcmd(client, " "); + stuffcmd(client, fog_control.fog_dpextra); + } + stuffcmd(client, "\n"); +}; + +//---------------------------------------------------------------------- +// Make value is not below or above limits and or negative! +//---------------------------------------------------------------------- +float(float fogrange) fog_check_range = +{ + if (fogrange < 0.01) return 0.01; + if (fogrange > 1) return 1; + return fabs(fogrange); +}; + +//---------------------------------------------------------------------- +void() fog_controller_think = +{ + // Has there been a change detected? + if (self.state == STATE_SETUP) { + // If fog fade time too low, instantly switch + if (self.fog_difftime <= FADEFOG_TIME) { + self.state = STATE_OFF; + self.fog_currden = self.fog_targden; + self.fog_currcol = self.fog_targcol; + change_fog(self.owner); + } + else { + // Setup gradual fade of fog over time + self.state = STATE_ON; + // divide the fade time into segments (minimum 0.05) + // Multiple the time by segments so diff is correct + // Time segements less than 0.05 does not work v well + self.fog_steptime = self.fog_difftime / FADEFOG_TIME; + self.fog_difftime = self.fog_steptime * FADEFOG_TIME; + + // Work out fade directions for density/colour + self.fog_diffden = self.fog_targden - self.fog_currden; + self.fog_diffcol = self.fog_targcol - self.fog_currcol; + + // Debug info only + /*---------------------------------------------------------------------- + dprint("Curr ("); + lftos(self.owner, self.fog_currden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self.owner, self.fog_currcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_currcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_currcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + dprint("Targ ("); + lftos(self.owner, self.fog_targden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self.owner, self.fog_targcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_targcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_targcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + dprint("Diff ("); + lftos(self.owner, self.fog_diffden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self.owner, self.fog_diffcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_diffcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_diffcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + //----------------------------------------------------------------------*/ + + // Work out step ammount to fade smoothly over time + self.fog_diffden = self.fog_diffden / self.fog_steptime; + self.fog_diffcol_x = self.fog_diffcol_x / self.fog_steptime; + self.fog_diffcol_y = self.fog_diffcol_y / self.fog_steptime; + self.fog_diffcol_z = self.fog_diffcol_z / self.fog_steptime; + } + } + // Is the fog fade over? Finite amount of steps + else if (self.fog_steptime < 0 && self.state != STATE_OFF) { + self.state = STATE_OFF; + self.fog_currden = self.fog_targden; + self.fog_currcol = self.fog_targcol; + + // Check density and colour values are within range + self.fog_currden = fog_check_range(self.fog_currden); + self.fog_currcol_x = fog_check_range(self.fog_currcol_x); + self.fog_currcol_y = fog_check_range(self.fog_currcol_y); + self.fog_currcol_z = fog_check_range(self.fog_currcol_z); + + change_fog(self.owner); + } + // If the fade is active, keep adding steps + else if (self.state == STATE_ON) { + self.fog_steptime = self.fog_steptime - 1; + self.fog_currden = self.fog_currden + self.fog_diffden; + self.fog_currcol = self.fog_currcol + self.fog_diffcol; + change_fog(self.owner); + } + + // Keep on looping around using min time step + self.think = fog_controller_think; + self.nextthink = time + FADEFOG_TIME; +}; + +//---------------------------------------------------------------------- +void(float gf_den, vector gf_col, float gf_time) fade_fog = +{ + // No controller active? + if (!fog_control) return; + + // Check density and colour values are within range + gf_den = fog_check_range(gf_den); + gf_col_x = fog_check_range(gf_col_x); + gf_col_y = fog_check_range(gf_col_y); + gf_col_z = fog_check_range(gf_col_z); + + // Setup fog controller with new fog values + fog_control.fog_targden = gf_den; + fog_control.fog_targcol = gf_col; + fog_control.fog_difftime = gf_time; + + // Force fog controller to calculate difference + fog_control.state = STATE_SETUP; +}; + +//---------------------------------------------------------------------- +void() setup_fog_controller = +{ + if (!fog_control) { + // Start off with the fog controller disabled + // if the worldspawn setup correctly then enable + // the controller and allow fog changes + fog_active = FALSE; + + fog_control = spawn(); + fog_control.owner = self; // Link back to client + fog_control.classtype = CT_CONTROL; + fog_control.solid = SOLID_NOT; // No world interaction + fog_control.movetype = MOVETYPE_NONE; // Static item, no movement + setorigin(fog_control, '0 0 0'); + setsize(fog_control, VEC_ORIGIN, VEC_ORIGIN); + + if (world.fog_density == 0) { + fog_active = FALSE; // out of sync + fog_control.fog_currden = DEF_FOGDEN; // Bad default + fog_control.fog_targden = DEF_FOGDEN; // Target + } + else { + fog_active = TRUE; // engine and QC insync + fog_control.fog_currden = world.fog_density; + fog_control.fog_targden = world.fog_density; + } + fog_control.fog_diffden = 0; // Difference + + if (CheckZeroVector(world.fog_colour)) { + fog_active = FALSE; // out of sync + fog_control.fog_currcol = DEF_FOGCOL; // Bad Default + fog_control.fog_targcol = DEF_FOGCOL; // Target + } + else { + fog_active = TRUE; // engine and QC insync + fog_control.fog_currcol = world.fog_colour; + fog_control.fog_targcol = world.fog_colour; + } + fog_control.fog_diffcol = '0 0 0'; // Difference + + // Bat shit crazy DP extra fog parameters that no other engine uses + // dpextra = alpha mindist maxdist top fadedepth (def=1 0 8192 1024 32) + if (world.fog_dpextra == "") fog_control.fog_dpextra = DEF_FOGEXT; + else fog_control.fog_dpextra = world.fog_dpextra; + + // This is a horrible hack, it should not be here + // This parameter should be in the map file worldspawn + //if (world.model == "maps/ad_end.bsp") + // fog_control.fog_dpextra = "1 0 2048 8192 32"; + + fog_control.state = STATE_OFF; // Not fading atm + fog_control.fog_difftime = 0; // fading fog time (seconds) + fog_control.fog_steptime = 0; // How many steps to fade + + // Setup think process to monitor for fog changes + // If this entity already exists, then its thinking! + fog_control.think = fog_controller_think; + fog_control.nextthink = time + FADEFOG_TIME; + + if (fog_active) change_fog(self); + } +}; diff --git a/QC_other/QC_arcane/hiprot.qc b/QC_other/QC_arcane/hiprot.qc new file mode 100644 index 00000000..0cf00dac --- /dev/null +++ b/QC_other/QC_arcane/hiprot.qc @@ -0,0 +1,1100 @@ +/*====================================================================== + Rotate QuickC program by Jim Dose' 10/17/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + + * All the functions and defs are self contained in this file + * Should make it easier to distribute as no other qc file required + * Collapsed and condensed this QC file as much as possible + * Renamed all the constants so they don't conflict + * It was a cool idea for its time (1996) but a horrible solution nowadays + It would be much better to do this in the engine (rotation collision) + Unfortunately most popular quake clients (QS/Fitz) refuse to add it + * Added target2 to func_rotate_door to allow alternative start positions + +------------------------------------------------------------------------ +/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) +Used as the point of rotation for rotatable objects. + +/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON +Creates an entity that continually rotates. Can be toggled on and +off if targeted. + +/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE + Path for rotate_train. + +/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) x +Trains are moving platforms that players can ride. +If the train is the target of a button or trigger, it will not begin +moving until activated. +The func_rotate_train entity is the center of rotation of all objects +targeted by it. + +/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING +Used to emulate collision on rotating objects. + +/*QUAKED rotate_object (0 .5 .8) ? +This defines an object to be rotated. +Used as the target of func_rotate_door. + +/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN +Creates a door that rotates between two positions around a point of +rotation each time it's triggered. + +------------------------------------------------------------------------ +Most modern compilers will expect the rotate_object to always +target a info_rotate (entity) so that it can sort out texture offset +All func_rotating objects DO NOT start at 0,0,0 like other bmodels + +------------------------------------------------------------------------ +Explaination of func_rotating objects (by Mechtech) + +func_rotating_train (controller for rotation) +targetname -> trigger to start/activate train +target -> rotate_object (bmodel) AND rotate_movewall (bmodel) +path-> path_rotate (entity chain) + +rotate_object (train brushwork) +target -> info_rotate (entity, center point for rotation) + +rotate_movewall (pretends to do collision) + +path_rotate (entity chain for train to follow) +targetname -> Used for reference +target -> next entity in chain to follow + +------------------------------------------------------------------------ +Func rotating doors cannot be moved on start so extra key added + +func_rotate_door (controller for rotation) +targetname -> trigger to start/activate two state door +target -> rotate_object (bmodel) AND rotate_movewall (bmodel) +target2 -> info_rotate (entity) starting location for bmodel + +======================================================================*/ + +// from hipdefs.qc in hipnotic/ritual source qc files +.vector neworigin; +.vector rotate; +.float endtime; +.float rotate_type; +.string path; +.string group; +.string event; +.float duration; +.vector dest; // Could not find this in the source, added + +//---------------------------------------------------------------------- +// from hipsubs.qc in hipnotic/ritual source qc files +vector ( vector ang ) SUB_NormalizeAngles = +{ + while( ang_x > 360 ) ang_x = ang_x - 360; + while( ang_x < 0 ) ang_x = ang_x + 360; + while( ang_y > 360 ) ang_y = ang_y - 360; + while( ang_y < 0 ) ang_y = ang_y + 360; + while( ang_z > 360 ) ang_z = ang_z - 360; + while( ang_z < 0 ) ang_z = ang_z + 360; + return ang; +}; + +//---------------------------------------------------------------------- +// from triggers.qc in hipnotic/ritual source qc files +void( entity ent, float amount ) hurt_setdamage = +{ + ent.dmg = amount; + if ( !amount ) ent.solid = SOLID_NOT; + else ent.solid = SOLID_TRIGGER; + ent.nextthink = -1; +}; + +//====================================================================== +// Renamed all the constants so they don't conflict with anything else +// They were mostly setup as single words (which is not a good idea) +//====================================================================== +float RSTATE_ACTIVE = 0; +float RSTATE_INACTIVE = 1; +float RSTATE_SPEEDINGUP = 2; +float RSTATE_SLOWINGDOWN = 3; + +float RSTATE_CLOSED = 4; +float RSTATE_OPEN = 5; +float RSTATE_OPENING = 6; +float RSTATE_CLOSING = 7; + +float RSTATE_WAIT = 0; +float RSTATE_MOVE = 1; +float RSTATE_STOP = 2; +float RSTATE_FIND = 3; +float RSTATE_NEXT = 4; + +float OBJECT_ROTATE = 0; +float OBJECT_MOVEWALL = 1; +float OBJECT_SETORIGIN = 2; + +float ROTENTITY_TOGGLE = 1; +float ROTENTITY_START_ON = 2; + +float TRAIN_ROTATION = 1; +float TRAIN_ANGLES = 2; +float TRAIN_STOP = 4; +float TRAIN_NO_ROTATE = 8; +float TRAIN_DAMAGE = 16; +float TRAIN_MOVETIME = 32; +float TRAIN_SET_DAMAGE = 64; + +float MOVEWALL_VISIBLE = 1; +float MOVEWALL_TOUCH = 2; +float MOVEWALL_NONBLOCKING = 4; + +float DOOR_STAYOPEN = 1; + +//====================================================================== +/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) x +center point for rotatable objects +-------- KEYS -------- +-------- SPAWNFLAGS -------- +-------- NOTES -------- +center point for rotatable objects +Removes self 5s after spawning +*/ +//====================================================================== + +void() info_rotate = +{ + // remove self after a little while, to make sure that entities that + // have targeted it have had a chance to spawn + // Not sure why this entity is removed, maybe there was entity + // limits in the old days, but that is long gone! + // Leaving entity in map, no advantage to removal anymore + //self.nextthink = time + 5; + //self.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +void() RotateTargets = +{ + local entity ent; + local vector vx; + local vector vy; + local vector vz; + local vector org; + + makevectors (self.angles); + + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.rotate_type == OBJECT_SETORIGIN ) { + org = ent.oldorigin; + vx = ( v_forward * org_x ); + vy = ( v_right * org_y ); + vy = vy * -1; + vz = ( v_up * org_z ); + ent.neworigin = vx + vy + vz; + setorigin( ent, ent.neworigin + self.origin ); + } + else if ( ent.rotate_type == OBJECT_ROTATE ) { + ent.angles = self.angles; + org = ent.oldorigin; + vx = ( v_forward * org_x ); + vy = ( v_right * org_y ); + vy = vy * -1; + vz = ( v_up * org_z ); + ent.neworigin = vx + vy + vz; + setorigin( ent, ent.neworigin + self.origin ); + } + else { + org = ent.oldorigin; + vx = ( v_forward * org_x ); + vy = ( v_right * org_y ); + vy = vy * -1; + vz = ( v_up * org_z ); + ent.neworigin = vx + vy + vz; + ent.neworigin = self.origin - self.oldorigin + (ent.neworigin - ent.oldorigin); + ent.velocity = (ent.neworigin-ent.origin)*25; + } + ent = find( ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() RotateTargetsFinal = +{ + local entity ent; + + ent = find( world, targetname, self.target); + while( ent ) { + ent.velocity = '0 0 0'; + if ( ent.rotate_type == OBJECT_ROTATE ) ent.angles = self.angles; + ent = find( ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() SetTargetOrigin = +{ + local entity ent; + + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.rotate_type == OBJECT_MOVEWALL ) { + setorigin( ent, self.origin - self.oldorigin + + (ent.neworigin - ent.oldorigin) ); + } + else { + setorigin( ent, ent.neworigin + self.origin ); + } + ent = find( ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() LinkRotateTargets = +{ + local entity ent; + local vector tempvec; + + self.oldorigin = self.origin; + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.classname == "rotate_object" ) { + ent.rotate_type = OBJECT_ROTATE; + ent.oldorigin = ent.origin - self.oldorigin; + ent.neworigin = ent.origin - self.oldorigin; + ent.owner = self; + } + else if ( ent.classname == "func_movewall" ) { + ent.rotate_type = OBJECT_MOVEWALL; + tempvec = ( ent.absmin + ent.absmax ) * 0.5; + ent.oldorigin = tempvec - self.oldorigin; + ent.neworigin = ent.oldorigin; + ent.owner = self; + } + else { + ent.rotate_type = OBJECT_SETORIGIN; + ent.oldorigin = ent.origin - self.oldorigin; + ent.neworigin = ent.origin - self.oldorigin; + } + ent = find (ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void( float amount ) SetDamageOnTargets = +{ + local entity ent; + + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.classname == "trigger_hurt" ) hurt_setdamage( ent, amount ); + else if ( ent.classname == "func_movewall" ) ent.dmg = amount; + ent = find( ent, targetname, self.target); + } +}; + + +//---------------------------------------------------------------------- +// Simple continual rotatation +//---------------------------------------------------------------------- +void() rotate_entity_think = +{ + local float t; + + t = time - self.ltime; + self.ltime = time; + + if ( self.state == RSTATE_SPEEDINGUP ) { + self.count = self.count + self.cnt * t; + if ( self.count > 1 ) self.count = 1; + + // get rate of rotation + t = t * self.count; + } + else if ( self.state == RSTATE_SLOWINGDOWN ) { + self.count = self.count - self.cnt * t; + if ( self.count < 0 ) { + RotateTargetsFinal(); + self.state = RSTATE_INACTIVE; + self.think = SUB_Null; + return; + } + + // get rate of rotation + t = t * self.count; + } + + self.angles = self.angles + ( self.rotate * t ); + self.angles = SUB_NormalizeAngles( self.angles ); + RotateTargets(); + self.nextthink = time + 0.02; +}; + +//---------------------------------------------------------------------- +void() rotate_entity_use = +{ + // change to alternate textures + self.frame = 1 - self.frame; + + if ( self.state == RSTATE_ACTIVE ) { + if ( self.spawnflags & ROTENTITY_TOGGLE ) { + if ( self.speed ) { + self.count = 1; + self.state = RSTATE_SLOWINGDOWN; + } + else { + self.state = RSTATE_INACTIVE; + self.think = SUB_Null; + } + } + } + else if ( self.state == RSTATE_INACTIVE ) { + self.think = rotate_entity_think; + self.nextthink = time + 0.02; + self.ltime = time; + if ( self.speed ) { + self.count = 0; + self.state = RSTATE_SPEEDINGUP; + } + else { + self.state = RSTATE_ACTIVE; + } + } + else if ( self.state == RSTATE_SPEEDINGUP ) { + if ( self.spawnflags & ROTENTITY_TOGGLE ) { + self.state = RSTATE_SLOWINGDOWN; + } + } + else { + self.state = RSTATE_SPEEDINGUP; + } +}; + +//---------------------------------------------------------------------- +void() rotate_entity_firstthink = +{ + LinkRotateTargets(); + if ( self.spawnflags & ROTENTITY_START_ON ) { + self.state = RSTATE_ACTIVE; + self.think = rotate_entity_think; + self.nextthink = time + 0.02; + self.ltime = time; + } + else { + self.state = RSTATE_INACTIVE; + self.think = SUB_Null; + } + self.use = rotate_entity_use; +}; + +//====================================================================== +/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE STARTON +Basic rotating object +-------- KEYS -------- +target : points to center of rotation entity +rotate : The rate of rotation in degrees +speed : time taken to go from zero to full speed and vice-versa +-------- SPAWNFLAGS -------- +TOGGLE : allows the rotation to be toggled on/off +STARTON : whether the entity is spinning when spawned. +If TOGGLE is 0, entity can be turned on, but not off. +-------- NOTES -------- +Basic rotating object +*/ +//====================================================================== +void() func_rotate_entity = +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + setmodel (self, self.model); + setsize( self, self.mins, self.maxs ); + + if ( self.speed != 0 ) self.cnt = 1 / self.speed; + + self.think = rotate_entity_firstthink; + self.nextthink = time + 0.1; + self.ltime = time; +}; + +//====================================================================== +/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE +Corner Path for rotate_train +-------- KEYS -------- +event : is a target to trigger when train arrives at path_rotate +noise : contains the name of the sound to play when train stops +noise1 : contains the name of the sound to play when train moves +speed : set speed to be the new speed of the train after it reaches + the path change. If speed is -1, the train will warp directly to the next + path change after the specified wait time. If MOVETIME is set on the + path_rotate, the train to interprets "speed" as the length of time to + take moving from one corner to another. +-------- SPAWNFLAGS -------- +ROTATION : Rotate train at rate specified by 'rotate', use '0 0 0' to stop +ANGLES : Rotate to the angles specified by 'angles' + while traveling to this path_rotate. Use values < 0 or > 360 to + guarantee that it turns in a certain direction. Having this flag + set automatically clears any rotation +STOP : stop train and wait to be retriggered +NO_ROTATE : stop train rotating when waiting to be triggered +DAMAGE : Cause damage based on 'dmg' +MOVETIME : Interpret 'speed' as the length of time to take moving +SET_DAMAGE: Set all targets damage to 'dmg' +-------- NOTES -------- +Corner Path for rotate_train +*/ +//====================================================================== +void() rotate_train; +void() rotate_train_next; +void() rotate_train_find; + +//---------------------------------------------------------------------- +void() path_rotate = +{ + if ( self.noise ) precache_sound( self.noise ); + if ( self.noise1 ) precache_sound( self.noise1 ); +}; + +//---------------------------------------------------------------------- +void() rotate_train_think = +{ + local float t; + local float timeelapsed; + + t = time - self.ltime; + self.ltime = time; + + if ( ( self.endtime ) && ( time >= self.endtime ) ) { + self.endtime = 0; + if ( self.state == RSTATE_MOVE ) { + setorigin(self, self.finaldest); + self.velocity = '0 0 0'; + } + + if (self.think1) self.think1(); + } + else { + timeelapsed = (time - self.cnt) * self.duration; + if ( timeelapsed > 1 ) timeelapsed = 1; + setorigin( self, self.dest1 + ( self.dest2 * timeelapsed ) ); + } + + self.angles = self.angles + ( self.rotate * t ); + self.angles = SUB_NormalizeAngles( self.angles ); + RotateTargets(); + + self.nextthink = time + 0.02; +}; + +//---------------------------------------------------------------------- +void() rotate_train_use = +{ + if (self.think1 != rotate_train_find) { + if ( self.velocity != '0 0 0' ) return; // already activated + if ( self.think1 ) self.think1(); + } +}; + +//---------------------------------------------------------------------- +void() rotate_train_wait = +{ + self.state = RSTATE_WAIT; + + if ( self.goalentity.noise ) { + sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + if ( self.goalentity.spawnflags & TRAIN_ANGLES ) { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + + if ( self.goalentity.spawnflags & TRAIN_NO_ROTATE ) self.rotate = '0 0 0'; + + self.endtime = self.ltime + self.goalentity.wait; + self.think1 = rotate_train_next; +}; + +//---------------------------------------------------------------------- +void() rotate_train_stop = +{ + self.state = RSTATE_STOP; + + if ( self.goalentity.noise ) { + sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + if ( self.goalentity.spawnflags & TRAIN_ANGLES ) { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + if ( self.goalentity.spawnflags & TRAIN_NO_ROTATE ) self.rotate = '0 0 0'; + + self.dmg = 0; + self.think1 = rotate_train_next; +}; + +//---------------------------------------------------------------------- +void() rotate_train_next = +{ + local entity targ; + local entity current; + local vector vdestdelta; + local float len, traveltime, div; + local string temp; + + self.state = RSTATE_NEXT; + + current = self.goalentity; + targ = find (world, targetname, self.path ); + if ( targ.classname != "path_rotate" ) + dprint("\b[ROT TRAIN]\b Next target is not path_rotate\n"); + + if ( self.goalentity.noise1 ) self.noise1 = self.goalentity.noise1; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + + self.goalentity = targ; + self.path = targ.target; + if (!self.path ) dprint("\b[ROT TRAIN]\b No next target\n"); + + if ( targ.spawnflags & TRAIN_STOP ) self.think1 = rotate_train_stop; + else if (targ.wait) self.think1 = rotate_train_wait; + else self.think1 = rotate_train_next; + + if ( current.event ) { + // Trigger any events that should happen at the corner. + temp = self.target; + self.target = current.event; + self.message = current.message; + SUB_UseTargets(); + self.target = temp; + self.message = string_null; + } + + if ( current.spawnflags & TRAIN_ANGLES ) { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + + if ( current.spawnflags & TRAIN_ROTATION ) self.rotate = current.rotate; + if ( current.spawnflags & TRAIN_DAMAGE ) self.dmg = current.dmg; + if ( current.spawnflags & TRAIN_SET_DAMAGE ) SetDamageOnTargets( current.dmg ); + + if ( current.speed == -1 ) { + // Warp to the next path_corner + setorigin( self, targ.origin ); + self.endtime = self.ltime + 0.01; + SetTargetOrigin(); + + if ( targ.spawnflags & TRAIN_ANGLES ) self.angles = targ.angles; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + self.finaldest = self.origin; + } + else { + self.state = RSTATE_MOVE; + + self.finaldest = targ.origin; + if (self.finaldest == self.origin) { + self.velocity = '0 0 0'; + self.endtime = self.ltime + 0.1; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + self.finaldest = self.origin; + return; + } + // set destdelta to the vector needed to move + vdestdelta = self.finaldest - self.origin; + + // calculate length of vector + len = vlen (vdestdelta); + + if ( current.spawnflags & TRAIN_MOVETIME ) traveltime = current.speed; + else { + // check if there's a speed change + if (current.speed>0) self.speed = current.speed; + if (!self.speed) dprint("\b[ROT TRAIN]\b No speed is defined!\n"); + + // divide by speed to get time to reach dest + traveltime = len / self.speed; + } + + if (traveltime < 0.1) { + self.velocity = '0 0 0'; + self.endtime = self.ltime + 0.1; + if ( targ.spawnflags & TRAIN_ANGLES ) self.angles = targ.angles; + return; + } + + // qcc won't take vec/float + div = 1 / traveltime; + + if ( targ.spawnflags & TRAIN_ANGLES ) { + self.finalangle = SUB_NormalizeAngles( targ.angles ); + self.rotate = ( targ.angles - self.angles ) * div; + } + + // set endtime to trigger a think when dest is reached + self.endtime = self.ltime + traveltime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * div; + + self.duration = div; // 1 / duration + self.cnt = time; // start time + self.dest2 = vdestdelta; // delta + self.dest1 = self.origin; // original position + } +}; + +//---------------------------------------------------------------------- +void() rotate_train_find = +{ + local entity targ; + + self.state = RSTATE_FIND; + LinkRotateTargets(); + + // the first target is the point of rotation. + // the second target is the path. + targ = find ( world, targetname, self.path); + if ( targ.classname != "path_rotate" ) + dprint("\b[ROT TRAIN]\b Next target is not path_rotate\n"); + + // Save the current entity + self.goalentity = targ; + + if ( targ.spawnflags & TRAIN_ANGLES ) { + self.angles = targ.angles; + self.finalangle = SUB_NormalizeAngles( targ.angles ); + } + + self.path = targ.target; + setorigin (self, targ.origin ); + SetTargetOrigin(); + RotateTargetsFinal(); + self.think1 = rotate_train_next; + if (!self.targetname) { + // not triggered, so start immediately + self.endtime = self.ltime + 0.1; + } + else self.endtime = 0; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position +}; + +//====================================================================== +/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) x +Trains are moving platforms that players can ride +-------- KEYS -------- +path : Starts at'path_rotate' position +speed : travel speed (def=100) +dmg : blocking damage (def=0) +sounds : 0=Silent, 1=ratchet metal +noise : sound to play when train stops +noise1 : sound to play when train moves +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Trains are moving platforms that players can ride +If the train is the target of a button or trigger, it will for trigger +The func_rotate_train entity is the center of rotation of all objects +targeted by it. + +*/ +//====================================================================== +void() rotate_train = +{ + dprint("\b[ROTATE]\b rotate_train not supported anymore!\n"); +}; + +//---------------------------------------------------------------------- +void() func_rotate_train = +{ + if (!self.speed) self.speed = 100; + if (!self.target) dprint("\b[ROT TRAIN]\b missing target!\n"); + + if ( !self.noise ) { + if (self.sounds == 0) self.noise = SOUND_EMPTY; + if (self.sounds == 1) self.noise = "plats/train2.wav"; + } + if ( !self.noise1 ) { + if (self.sounds == 0) self.noise1 = SOUND_EMPTY; + if (self.sounds == 1) self.noise1 = "plats/train1.wav"; + } + + precache_sound( self.noise ); + precache_sound( self.noise1 ); + + self.cnt = 1; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_STEP; + self.use = rotate_train_use; + + setmodel (self, self.model); + setsize (self, self.mins, self.maxs); + setorigin (self, self.origin); + + // start trains on the second frame, to make sure their + // targets have had a chance to spawn + self.ltime = time; + self.nextthink = self.ltime + 0.1; + self.endtime = self.ltime + 0.1; + self.think = rotate_train_think; + self.think1 = rotate_train_find; + self.state = RSTATE_FIND; + + self.duration = 1; // 1 / duration + self.cnt = 0.1; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + + self.flags = self.flags | FL_ONGROUND; +}; + +//---------------------------------------------------------------------- +// Moving clip walls +//---------------------------------------------------------------------- +void() rotate_door_reversedirection; +void() rotate_door_group_reversedirection; + +void() movewall_touch = +{ + if (time < self.owner.attack_finished) return; + + if ( self.dmg ) { + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } + else if ( self.owner.dmg ) { + T_Damage (other, self, self.owner, self.owner.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } +}; + +//---------------------------------------------------------------------- +void() movewall_blocked = +{ + local entity temp; + + if (time < self.owner.attack_finished) return; + + self.owner.attack_finished = time + 0.5; + + if ( self.owner.classname == "func_rotate_door" ) { + temp = self; + self = self.owner; + rotate_door_group_reversedirection(); + self = temp; + } + + if ( self.dmg ) { + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } + else if ( self.owner.dmg ) { + T_Damage (other, self, self.owner, self.owner.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } +}; + +//---------------------------------------------------------------------- +void() movewall_think = +{ + self.ltime = time; + self.nextthink = time + 0.02; +}; + +//====================================================================== +/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING +Emulate collision on rotating objects +-------- KEYS -------- +dmg : damage to cause when touched or blocked +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +VISIBLE : Causes brush to be displayed +TOUCH : Cause damage when touched by player +NONBLOCKING : makes the brush non-solid, This is useless if VISIBLE is set +-------- NOTES -------- +Emulate collision on rotating objects +*/ +//====================================================================== +void() func_movewall = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.angles = '0 0 0'; + self.movetype = MOVETYPE_PUSH; + + if ( self.spawnflags & MOVEWALL_NONBLOCKING ) self.solid = SOLID_NOT; + else { + self.solid = SOLID_BSP; + self.blocked = movewall_blocked; + } + + if ( self.spawnflags & MOVEWALL_TOUCH ) { + self.touch = movewall_touch; + } + + setmodel (self,self.model); + if ( !( self.spawnflags & MOVEWALL_VISIBLE ) ) self.model = string_null; + + self.think = movewall_think; + self.nextthink = time + 0.02; + self.ltime = time; +}; + +//====================================================================== +/*QUAKED rotate_object (0 .5 .8) ? +Defines a bmodel object to be rotated +-------- KEYS -------- +targetname : name of bmodel object +target : rotating point entities to link too +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Defines a bmodel object to be rotated +Used as the target of func_rotate_door +*/ +//====================================================================== +void() rotate_object_move = +{ + local entity ent; + + ent = find( world, targetname, self.target2); + if (ent.classname == "info_rotate") { + // Move origin to new location + self.oldorigin = ent.origin; + setorigin( self, self.oldorigin ); + } +}; + +//---------------------------------------------------------------------- +void() rotate_object = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classname = "rotate_object"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + setmodel (self,self.model); + setsize( self, self.mins, self.maxs ); + + // Check for a target (info_rotate) to move the object + if (self.target2 != "") { + self.think = rotate_object_move; + self.nextthink = time + 1; + } + else self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() rotate_door_think2 = +{ + local float t; + + t = time - self.ltime; + self.ltime = time; + + // change to alternate textures + self.frame = 1 - self.frame; + self.angles = self.dest; + + if ( self.state == RSTATE_OPENING ) self.state = RSTATE_OPEN; + else { + if ( self.spawnflags & DOOR_STAYOPEN ) { + rotate_door_group_reversedirection(); + return; + } + self.state = RSTATE_CLOSED; + } + + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + self.think = SUB_Null; + + RotateTargetsFinal(); +}; + +//---------------------------------------------------------------------- +void() rotate_door_think = +{ + local float t; + + t = time - self.ltime; + self.ltime = time; + + if ( time < self.endtime ) { + self.angles = self.angles + ( self.rotate * t ); + RotateTargets(); + } + else { + self.angles = self.dest; + RotateTargets(); + self.think = rotate_door_think2; + } + + self.nextthink = time + 0.01; +}; + +//---------------------------------------------------------------------- +void() rotate_door_reversedirection = +{ + local vector start; + + // change to alternate textures + self.frame = 1 - self.frame; + + if ( self.state == RSTATE_CLOSING ) { + start = self.dest1; + self.dest = self.dest2; + self.state = RSTATE_OPENING; + } + else { + start = self.dest2; + self.dest = self.dest1; + self.state = RSTATE_CLOSING; + } + + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + + self.rotate = ( self.dest - start ) * ( 1 / self.speed ); + self.think = rotate_door_think; + self.nextthink = time + 0.02; + self.endtime = time + self.speed - ( self.endtime - time ); + self.ltime = time; +}; + +//---------------------------------------------------------------------- +void() rotate_door_group_reversedirection = +{ + local string name; + + // tell all associated rotaters to reverse direction + if ( self.group ) { + name = self.group; + self = find( world, group, name); + while( self ) { + rotate_door_reversedirection(); + self = find( self, group, name); + } + } + else rotate_door_reversedirection(); +}; + +//---------------------------------------------------------------------- +void() rotate_door_use = +{ + // local entity t; + local vector start; + + if ( ( self.state != RSTATE_OPEN ) && ( self.state != RSTATE_CLOSED ) ) return; + + if ( !self.cnt ) { + self.cnt = 1; + LinkRotateTargets(); + } + + // change to alternate textures + self.frame = 1 - self.frame; + + if ( self.state == RSTATE_CLOSED ) { + start = self.dest1; + self.dest = self.dest2; + self.state = RSTATE_OPENING; + } + else { + start = self.dest2; + self.dest = self.dest1; + self.state = RSTATE_CLOSING; + } + + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + + self.rotate = ( self.dest - start ) * ( 1 / self.speed ); + self.think = rotate_door_think; + self.nextthink = time + 0.01; + self.endtime = time + self.speed; + self.ltime = time; +}; + +//====================================================================== +/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN +Rotating door moving around a point of rotation +-------- KEYS -------- +target : Points to the rotate_object bmodel entity +target2 : Move on spawn to this entity (info_rotate) location +dmg : Damage caused when blocked (def=2) negative numbers =no damage +speed : Time taken to rotate open/close +sounds : 1=medieval 2=metal 3=base 4=Silent (def=1) +-------- SPAWNFLAGS -------- +STAYOPEN : Reopen after closing, stops a once only door from closing if blocked +-------- NOTES -------- +Rotating door moving around a point of rotation +*/ +//====================================================================== +void() func_rotate_door = +{ + if (!self.target) dprint("\b[ROT DOOR]\b missing target!\n"); + + self.dest1 = '0 0 0'; + self.dest2 = self.angles; + self.angles = self.dest1; + + // default to 2 seconds + if ( !self.speed ) self.speed = 2; + self.cnt = 0; + + if (!self.dmg) self.dmg = 2; + else if ( self.dmg < 0 ) self.dmg = 0; + + if (self.sounds == 0) self.sounds = 1; + if (self.sounds == 1) { + self.noise1 = "doors/latch2.wav"; + self.noise2 = "doors/winch2.wav"; + self.noise3 = "doors/drclos4.wav"; + } + if (self.sounds == 2) { + self.noise2 = "doors/airdoor1.wav"; + self.noise1 = "doors/airdoor2.wav"; + self.noise3 = "doors/airdoor2.wav"; + } + if (self.sounds == 3) { + self.noise2 = "doors/basesec1.wav"; + self.noise1 = "doors/basesec2.wav"; + self.noise3 = "doors/basesec2.wav"; + } + if (self.sounds == 4) { + self.noise1 = SOUND_EMPTY; + self.noise2 = SOUND_EMPTY; + self.noise3 = SOUND_EMPTY; + } + + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.model); + setorigin( self, self.origin ); + setsize( self, self.mins, self.maxs ); + self.state = RSTATE_CLOSED; + self.use = rotate_door_use; + self.think = SUB_Null; +}; diff --git a/QC_other/QC_arcane/items.qc b/QC_other/QC_arcane/items.qc new file mode 100644 index 00000000..06e0ba35 --- /dev/null +++ b/QC_other/QC_arcane/items.qc @@ -0,0 +1,3380 @@ +/*====================================================================== + ITEM FUNCTIONS +======================================================================*/ +float ITEM_RESPAWN = 16; // Item will respawn +float ITEM_FLOATING = 32; // Spawn floating +float ITEM_NOEFFECTS = 128; // Disable particles and effects + +float H_ROTTEN = 1; // Rotten +float H_MEGA = 2; // Mega Health + +float A_LARGE = 1; // Used by ammo boxes +float A_LID = 2; // Display Lid + +float ITEM_CKEY1 = 1; // Arcane Key 1 +float ITEM_CKEY2 = 2; // Arcane Key 2 +float ITEM_CKEY3 = 4; // Arcane Key 3 +float ITEM_CKEY4 = 8; // Arcane Key 4 + +float BACKPACK_SHELLS = 1; +float BACKPACK_NAILS = 2; +float BACKPACK_ROCKETS = 4; +float BACKPACK_CELLS = 8; +float BACKPACK_GRNTYPE = 1; +float BACKPACK_YELTYPE = 2; +float BACKPACK_REDTYPE = 4; + +// Various bounding boxes for items +// vector VEC_ORID_MIN = '0 0 0'; +// vector VEC_ORID_MAX = '32 32 56'; +vector VEC_HEAL_MIN = '-16 -16 0'; +vector VEC_HEAL_MAX = '16 16 56'; +vector VEC_WPNS_MIN = '-16 -16 0'; +vector VEC_WPNS_MAX = '16 16 56'; +vector VEC_AMMO_MIN = '-16 -16 0'; +vector VEC_AMMO_MAX = '16 16 56'; +vector VEC_KEYS_MIN = '-16 -16 -24'; +vector VEC_KEYS_MAX = '16 16 32'; +vector VEC_POWR_MIN = '-16 -16 -24'; +vector VEC_POWR_MAX = '16 16 32'; + +// Default respawn timers for items +float RESPAWN_HEALTH = 20; // 15,25,100+ +float RESPAWN_ARMOR = 20; // Green, Yellow, Red +float RESPAWN_WEAPON = 30; // SG -> LG +float RESPAWN_AMMO = 30; // Shells,Nails,Rockets,Cells +float RESPAWN_KEY = 60; // Gold,Silver,Custom +float RESPAWN_RUNE = 60; // Sigil/runes +float RESPAWN_ARTIFACT1 = 60; // Quad + Suit +float RESPAWN_ARTIFACT2 = 300; // Pent + Invisibilty +float RESPAWN_BACKPACK = 30; // Random Ammo Drop +float RESPAWN_COOP = 5; // Default timer for coop + +float RESPAWN_PARTICLES = 32; // Particle burst for ring/center +float RESPAWN_EXPTIME = 1; // Particles burst lifetime +float RESPAWN_EXPRADIUS = 12; // Particle ring radius + +float MODEL_ANIM_SPEED = 3; +float MODEL_ANIM_RANGE = 3; + +//---------------------------------------------------------------------- +// Some items have pickup conditions which prevent targets +// from firing when coop mode is active, show console warning +//---------------------------------------------------------------------- +void() item_coopcheck = +{ + if (self.target != "" || self.target2 != "") { + dprint("\b[Coop]\b ("); + dprint(self.classname); + dprint(") unreliable target(s) in coop!\n"); + } +}; + +//---------------------------------------------------------------------- +// Check floor under item and animated skin for new BASE health boxes +//---------------------------------------------------------------------- +void() item_thinkloop = +{ + // Check for entity states + if (self.estate & ESTATE_BLOCK) return; + // Has the item been turned off? + if (self.attack_finished > time) return; + // Has the item removal timer been reached? + if (self.item_expired > 0 && self.item_expired < time) remove(self); + + if (self.item_skinanim > 0) { + self.item_skincycle = self.item_skincycle + 1; + if (self.item_skincycle > MODEL_ANIM_SPEED) { + self.item_skincycle = 0; + self.item_skinanim_no = self.item_skinanim_no + 1; + if (self.item_skinanim_no > MODEL_ANIM_RANGE) { + self.item_skinanim_no = 0; + } + } + // Update skin + self.skin = self.item_skinanim_no; + } + + // Check floor below item (global function) + if (self.item_flrcheck > 0) { + ent_floorcheck(self, self.item_flrcheck); + // Record any movement for respawn function + self.oldorigin = self.origin; + } + + // Keep checking + self.think = item_thinkloop; + self.nextthink = time + 0.1; +}; + +void() item_estate_setup; +//---------------------------------------------------------------------- +void() item_reset = +{ + // Reset trigger_once conditions + self.attack_finished = 0; + if (!self.estate_on) item_estate_setup(); + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() item_finished = +{ + // Check for coop respawn options + if (coop > 0) { + if (self.classgroup == CG_WEAPON) { + if (coop_weapons == TRUE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_weapons == FALSE && self.respawn_time > 0) { + self.respawn_time = RESPAWN_COOP; + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + } + else if (self.classgroup == CG_HEALTH) { + if (coop_health == FALSE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_health == TRUE && self.respawn_time > 0) + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + else if (self.classgroup == CG_AMMOITEM) { + if (coop_ammoboxes == FALSE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_ammoboxes == TRUE && self.respawn_time > 0) + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + else if (self.classgroup == CG_ARTIFACT) { + if (coop_powerups == FALSE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_powerups == TRUE && self.respawn_time > 0) + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + } + + self.attack_finished = LARGE_TIMER; + if (!self.estate_off) item_estate_setup(); + self.estate_off(); +}; + +//---------------------------------------------------------------------- +void() item_respawn = +{ + // Classic quake re-spawn sound + sound (self, CHAN_VOICE, SOUND_RESPAWN, 1, ATTN_NORM); + + // Are particles enabled? + if (query_configflag(SVR_PARTICLES)) { + // Switch off any respawn emitter + if (self.respawn_part.classtype == CT_PARTICLEEMIT) + misc_particle_off(self.respawn_part); + + if (self.respawn_style & PARTICLE_BURST_RING) + particle_ring(self.origin + self.respawn_ofs, '0 0 4', '4 4 16', RESPAWN_EXPRADIUS, RESPAWN_PARTICLES, RESPAWN_EXPTIME, self.respawn_style ); + else if (self.respawn_style & PARTICLE_BURST_CENTER) + particle_explode(self.origin + self.respawn_ofs, RESPAWN_PARTICLES*2, RESPAWN_EXPTIME, self.respawn_style, self.respawn_style); + } + + self.alpha = 1; + self.estate_reset(); +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() SUB_regen = { +// self.model = self.mdl; +// self.solid = SOLID_TRIGGER; + sound (self, CHAN_VOICE, SOUND_RESPAWN, 1, ATTN_NORM); +// setorigin (self, self.origin); + item_reset(); +}; + +//---------------------------------------------------------------------- +void() alphafade_item_respawn = +{ + if (self.waitmin > time) { + self.speed = 1 - ((self.waitmin - time) / self.respawn_time); + self.alpha = 0.1 + ((self.speed*0.4)*random()); + + // If respawn effect active, modify total particles + if (self.respawn_part.part_style == PARTICLE_STYLE_RESPAWN) { + self.respawn_part.part_limit = rint(RESPAWN_PARTICLES * self.speed); + } + self.think = alphafade_item_respawn; + self.nextthink = time + 0.1; + } + else item_respawn(); +}; + +//---------------------------------------------------------------------- +void() start_item_respawn = +{ + // Is the item being respawned at the moment? + if (self.waitmin > time) return; + // Is the item setup to instantly respawn? + if (self.respawn_trig == TRUE && self.spawnflags & ITEM_RESPAWN) { + // Check for any respawn quantity counts + if (self.respawn_count > 0) { + self.respawn_count = self.respawn_count - 1; + if (self.respawn_count == 0) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + } + // Instantly spawn item + item_respawn(); + } + else { + // deathmatch 2 is the silly old rules + if (deathmatch == 1 || self.spawnflags & ITEM_RESPAWN) { + setmodel(self,self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + self.waitmin = time + self.respawn_time; + self.alpha = 0.1; + + // Check for any respawn quantity counts + if (self.respawn_count > 0) { + self.respawn_count = self.respawn_count - 1; + if (self.respawn_count == 0) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + } + + // Are particles enabled? + if (query_configflag(SVR_PARTICLES)) { + // Switch off any particle emitters + if (self.part_emitter) misc_particle_off(self.part_emitter); + // Is there any need for respawn effect? + if (self.respawn_effect) { + // If emitter does not exist? create one, else switch on + if (self.respawn_part.classtype == CT_PARTICLEEMIT) + misc_particle_on(self.respawn_part); + else self.respawn_part = spawn_pemitter(self, self, PARTICLE_STYLE_RESPAWN, PARTICLE_START_ON); + } + } + // Switch on gradual alpha fade + alphafade_item_respawn(); + } + } +}; + +//---------------------------------------------------------------------- +void() check_item_respawn = +{ + // Respawn feature is waiting for trigger + if (!self.respawn_trig) start_item_respawn(); +}; + +//---------------------------------------------------------------------- +void() item_use = +{ + // Check for any trigger respawn conditions first + // Respawn spawnflag, trigger condition and not trigger once + if (self.spawnflags & ITEM_RESPAWN && self.respawn_trig && + self.estate == ESTATE_OFF) start_item_respawn(); + else { + // usual trigger blocks, OFF, DISABLE and trigger_ONCE + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Was item setup to be floating? + if(self.spawnflags & ITEM_FLOATING){ + // Removed checkbottom check, it often fails and leaves + // items floating in midair when they should fall + // if (!checkbottom(self)) - left for comment only + // A quick toss of the item + self.movetype = MOVETYPE_TOSS; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + } + } +}; + +//---------------------------------------------------------------------- +void() item_touch = +{ + if (self.touchedvoid) {entity_hide(self); return;} + if (self.estate & ESTATE_BLOCK) return; + + if ( !(other.flags & FL_CLIENT) ) return; + if ( other.health < 1 ) return; + if ( other.flags & FL_NOTARGET ) return; + if (self.attack_finished > time) return; + + self.touch2(); // defined by item function +}; + +//---------------------------------------------------------------------- +void() item_restore = +{ + // Ammo boxes can have special animation frames or lids! + if (self.classgroup == CG_AMMOITEM) { + // Any LID (shells/spikes) defined? + if (self.spawnflags & A_LID && self.attachment) { + // Setup LID attachment entity (match angles/origin) + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = self.movetype; + setmodel(self.attachment, self.headmdl); + // Give the lid the same bbox setup so it can move + setsize (self.attachment, self.mins, self.maxs); + // Start lid off the ground and remove ground flag + // This will let the lid naturally settle on the surface + setorigin(self.attachment, self.origin + '0 0 1'); + self.attachment.flags = self.attachment.flags - (self.attachment.flags & FL_ONGROUND); + // Match angle and stored frame setup from ammo box + self.attachment.angles = self.angles; + + // lid frame options 0=random, 1-7=exact + // Always generate a new lid position for respawning items + if (self.frame_box == 0) self.attachment.frame = rint(1 + random()*6); + else if (self.frame_box > 7) self.frame_box = 1; + if (self.frame_box > 0) self.attachment.frame = self.frame_box; + + // LID has different skins for shells and spikes + if (self.classtype == CT_AMMOSHELLS) self.attachment.skin = self.skin; + else self.attachment.skin = 2 + self.skin; + } + // Any special frames (rockets/plasma) defined? + else if (self.frame_override) { + // frame options -1=random 0=nothing, 1-7=exact + // Always generate a new frame number for respawning items + if (self.frame_box == -1) self.frame = rint(1 + random()*6); + else if (self.frame_box > 7) self.frame_box = 1; + if (self.frame_box > 0) self.frame = self.frame_box; + } + } + + // Setup animated textures for old style ID health boxes + // Check floor under item for any changes + if (self.item_flrcheck > 0 || self.item_skinanim > 0) { + self.nextthink = time + random()*0.5; + self.think = item_thinkloop; + } +}; + +//---------------------------------------------------------------------- +void() item_delay = +{ + if (self.touchedvoid) {entity_hide(self); return;} + if (self.estate == ESTATE_DISABLE) return; + + //---------------------------------------------------------------------- + // Check for Axe / Shotgun / LG upgrade monster spawn exceptions? + if (self.upgrade_axe || self.upgrade_ssg || self.upgrade_lg) { + // Has ANY player (server test not individual) + // picked up the relevant upgrade weapons? + if (self.upgrade_axe && !query_configflag(SVR_UPDAXE) ) return; + if (self.upgrade_ssg && !query_configflag(SVR_UPDSSG) ) return; + if (self.upgrade_lg && !query_configflag(SVR_UPDLG) ) return; + } + + // Reset use function and any touch/skin triggers + self.estate_use = item_use; + self.touch = item_touch; + self.attack_finished = 0; + self.estate = ESTATE_ON; + // Setup enough parameters to test drop to floor + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + setmodel(self,self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + setorigin(self, self.oldorigin); + self.velocity = '0 0 0'; + + // Finalize item location (check drop to floor) + if(self.spawnflags & ITEM_FLOATING) { + // Cannot check the floor of an item if its floating!?! + if (self.item_flrcheck > 0) self.item_flrcheck = 0; + } + else { + self.movetype = MOVETYPE_TOSS; + self.velocity = '0 0 0'; + self.origin_z = self.origin_z + 6; + // ID originally use a droptofloor test for space check + // Tried a pointcontents check but it can allows things + // to fall through the floor and just keep going +// if (pointcontents(self.origin) == CONTENT_SOLID) { + if (!droptofloor()) { + dprint ("\n\b[Item]\b "); dprint (self.classname); + dprint (" stuck at ("); dprint (vtos(self.origin)); dprint (")\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + // If check floor under item enabled, workout distance check + // The bottom of the bounding box + 16 for large step + if (self.item_flrcheck > 0) { + self.item_flrcheck = fabs(self.mins_z) + 16; + } + + // Spawn particle emitter if particles active and not blocked + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) { + if (!(self.spawnflags & ITEM_NOEFFECTS) && self.part_active > 0) { + self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_ON); + } + } + + // Finally setup entity ready for use + self.oldorigin = self.origin; + + // Remove the START OFF functionality + if (self.spawnflags & ENT_STARTOFF) { + self.spawnflags = self.spawnflags - ENT_STARTOFF; + // Check for respawn effect? + if (self.spawnflags & ITEM_RESPAWN) start_item_respawn(); + else item_restore(); + } + else item_restore(); +}; + +//---------------------------------------------------------------------- +void() item_on = +{ + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + + // Restore any effect flags settings (various dlight glows) + if (self.savedeffects > 0) self.effects = self.savedeffects; + + // Check for delayed/trigger_once functionality? + if (self.spawnflags & ENT_STARTOFF || self.attack_finished > time) + self.solid = SOLID_NOT; + else { + // Restore movement, solid and model parameters + if(self.spawnflags & ITEM_FLOATING) self.movetype = MOVETYPE_NONE; + else self.movetype = MOVETYPE_TOSS; + self.solid = SOLID_TRIGGER; + setmodel(self,self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + self.velocity = '0 0 0'; + // Restore particle emitter + if (self.part_emitter) misc_particle_on(self.part_emitter); + // Setup touch/damage/bounding box functionality + self.think = SUB_Null; + item_restore(); + } +}; + +//---------------------------------------------------------------------- +void() item_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self,""); + self.effects = 0; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + // If item was setup to float then it will be trigger item + // Don't reset origin as it might have fallen somewhere better + if( !(self.spawnflags & ITEM_FLOATING) ) setorigin(self, self.oldorigin); + + if (self.attachment) { + setmodel(self.attachment,""); + setsize(self.attachment, VEC_ORIGIN, VEC_ORIGIN); + } +}; + +//---------------------------------------------------------------------- +void() item_estate_setup = +{ + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = item_on; + self.estate_off = item_off; + self.estate_use = item_delay; + self.estate_reset = item_reset; +}; + +//---------------------------------------------------------------------- +void() item_start = +{ + self.oldorigin = self.origin; // Save origin + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.flags = self.flags | FL_ITEM; + + // Warning if effects flag is active before spawning + if (self.effects) { + dprint("\b[ITEM]\b Effects flag active\n"); + self.savedeffects = self.effects; + } + // Reset effects flag because some engines will show effects + // This is especially obvious for delay spawned items + self.effects = 0; + + // Check for spawning conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Cannot have multiple upgrade restrictions on items + remove_duplicate_upgrades(); + + // Check for Axe / Shotgun item exceptions? + if (self.upgrade_axe || self.upgrade_ssg) { + if ( !(self.spawnflags & ENT_STARTOFF) ) { + dprint("\b[ITEM]\b need spawn delay for axe/shotgun\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + // If respawn timer negative then wait for a trigger + if (self.respawn_time < 0) self.respawn_trig = TRUE; + // Respawn times < 1 break sound and particle spawners + if (self.respawn_time > 0 && self.respawn_time < 1) self.respawn_time = 1; + // Cannot start with a negative number for counting down + if (self.respawn_count < 0) self.respawn_count = 1; + + // Override default item pickup sound with silence? + // It would have been good to offer the other sounds (1-6) + // on all items, but there is a good chance that a mapper + // has left a rogue sounds key on some item somewhere! + if (self.sounds == 4) self.noise = SOUND_EMPTY; + + // Setup Entity State functionality + item_estate_setup(); + + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // delay drop to floor to make sure all doors have been spawned + // spread think times so they don't all happen at same time + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.estate_use; + } +}; + +/*====================================================================== + HEALTH FLASK/BOX + + targ - entity to receive healing + t_healamount - the quanity to heal entity with + ignore - whether to ignore max health amount + returns FALSE if cannot heal entity by healamount + returns TRUE if healamount applied +======================================================================*/ +float (entity targ, float t_healamount, float ignore) T_Heal = +{ + if (targ.health <= 0) return FALSE; + if ((!ignore) && (targ.health >= other.max_health)) return FALSE; + t_healamount = ceil(t_healamount); + + targ.health = targ.health + t_healamount; + if ((!ignore) && (targ.health >= other.max_health)) + targ.health = other.max_health; + + if (targ.health > HEAL_MEGAMAX) targ.health = HEAL_MEGAMAX; + + // Healing the player negates some debuffs + ResetDebuffBurning(targ); + ResetDebuffPoisoned(targ); + return TRUE; +}; + +//---------------------------------------------------------------------- +void() item_megahealth_rot = +{ + // Check for maximum health limit + if (self.owner.health > self.owner.max_health) { + self.owner.health = self.owner.health - 1; + self.nextthink = time + 1; + } + else { + // it is possible for a player to die and respawn between rots + // Double check player has megahealth before removing it + if (self.owner.items & IT_SUPERHEALTH) + self.owner.items = self.owner.items - IT_SUPERHEALTH; + + // Check to see if item can respawn + self.alpha = 0.1; + check_item_respawn(); + } +}; + +//---------------------------------------------------------------------- +void() health_touch = +{ + local string s; + + // Megahealth? Ignore max_health... + if (self.classtype == CT_HEALMEGA) { + if (other.health >= HEAL_MEGAMAX) return; + if (!T_Heal(other, self.healamount, 1)) return; + } + else { + if (!T_Heal(other, self.healamount, 0)) return; + } + + sprint(other, "You receive "); + s = ftos(self.healamount); + sprint(other, s); + sprint(other, " health\n"); + if (self.noise != SOUND_EMPTY) + sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + item_finished(); + + // Megahealth = rot down the player's super health + // Need to wait for megahealth to finish before respawn + if (self.classtype == CT_HEALMEGA) { + other.items = other.items | IT_SUPERHEALTH; + self.nextthink = time + 5; + self.think = item_megahealth_rot; + self.owner = other; + } + else check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +/*====================================================================== +/*QUAKED item_health (0.3 0.3 1) (-16 -16 0) (16 16 32) ROTTEN MEGA x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/health_25.mdl"); } +15, 25 or 100 Health +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : = -1 Random rotation everytime spawned (default) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +ROTTEN : 15 health +MEGA : MegaHealth +100 health, rot down to 100 +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Health box gives 15, 25 or 100 points depending on spawnflags. + +======================================================================*/ +void() item_health = +{ + if (self.spawnflags & H_ROTTEN) { + // worldtype 0 = medieval, 1 = metal, 2 = base + if ((world.worldtype < 2 && !self.skin_override) || self.skin_override == 1) { + // New Medieval style red flask + self.mdl = "progs/health_15.mdl"; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + } + else { + // Original ID pickup model + self.mdl = "progs/health_15b.mdl"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + } + self.noise = SOUND_HEAL15; + self.healamount = HEAL_ROT; + self.classtype = CT_HEALROT; + self.respawn_effect = TRUE; + self.respawn_ofs = '0 0 16'; + } + else if (self.spawnflags & H_MEGA) { + // worldtype 0 = medieval, 1 = metal, 2 = base + if ((world.worldtype < 2 && !self.skin_override) || self.skin_override == 1) { + // New Medieval style red flask + self.mdl = "progs/health_100.mdl"; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + } + else { + // Original ID pickup model + self.mdl = "progs/health_100b.mdl"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.item_skinanim = TRUE; + } + self.noise = SOUND_HEAL100; + self.healamount = HEAL_MEGA; + self.classtype = CT_HEALMEGA; + self.part_active = PARTICLE_STYLE_MEGAH; + self.respawn_effect = TRUE; + self.respawn_ofs = '0 0 28'; + } + else { + // worldtype 0 = medieval, 1 = metal, 2 = base + if ((world.worldtype < 2 && !self.skin_override) || self.skin_override == 1) + { + // New Medieval style red flask + self.mdl = "progs/health_25.mdl"; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + } + else { + // Original ID pickup model + self.mdl = "progs/health_25b.mdl"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 16'; + self.item_skinanim = TRUE; + } + self.noise = SOUND_HEAL25; + self.healamount = HEAL_NORM; + self.classtype = CT_HEALNORM; + self.respawn_effect = TRUE; + } + + precache_model(self.mdl); + precache_sound(self.noise); + + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + // Move the new centered ammo models to match old ammo origin + // The default is to move all ammo items to suit original id maps + if (query_configflag(SVR_ITEMOFFSET) == FALSE) { + self.oldorigin = self.origin + '16 16 0'; + setorigin(self, self.oldorigin); + } + + // Setting the angle key in the editor to UP/DOWN/0 = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + self.touch2 = health_touch; + self.classgroup = CG_HEALTH; + self.bbmins = VEC_HEAL_MIN; + self.bbmaxs = VEC_HEAL_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_HEALTH; + + // Check for coop errors + item_coopcheck(); + item_start (); +}; + +//====================================================================== +// armor_touch +//====================================================================== +void() armor_touch = +{ + if (other.armortype*other.armorvalue >= self.armortype*self.armorvalue) return; + + other.armortype = self.armortype; + other.armorvalue = self.armorvalue; + other.items = other.items - (other.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + self.items; + + sprint(other, "You got armor\n"); + if (self.noise != SOUND_EMPTY) + sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_armor_setup = +{ + self.classgroup = CG_ARMOR; + self.part_active = PARTICLE_STYLE_ARMOR; + self.touch2 = armor_touch; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 56'; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_ARMOR; + self.noise = "items/armor1.wav"; + + // Check for coop errors + item_coopcheck(); + item_start (); +}; + +/*====================================================================== +/*QUAKED item_armor1 (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/armour.mdl"); } +Green Armour with 100 points of protection +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Green Armour with 100 points of protection + +======================================================================*/ +void() item_armor1 = +{ + self.mdl = "progs/armour.mdl"; + precache_model (self.mdl); + self.skin = 0; + self.classtype = CT_ARMOR1; + self.items = IT_ARMOR1; + self.armortype = ARMOR_GRN_TYPE; + self.armorvalue = ARMOR_GRN_VALUE; + self.respawn_effect = TRUE; + self.respawn_style = PARTICLE_BURST_GREEN + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + item_armor_setup(); +}; + +/*====================================================================== +/*QUAKED item_armor2 (0 0.5 0.8) (-16 -16 0) (16 16 56) x BLUESKIN x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/armour.mdl"); } +Yellow Armour with 150 points of protection +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BLUESKIN : Display a blue skin instead +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Yellow Armour with 150 points of protection + +======================================================================*/ +void() item_armor2 = +{ + self.mdl = "progs/armour.mdl"; + precache_model (self.mdl); + self.classtype = CT_ARMOR2; + self.items = IT_ARMOR2; + self.armortype = ARMOR_YEL_TYPE; + self.armorvalue = ARMOR_YEL_VALUE; + self.respawn_effect = TRUE; + self.respawn_ofs = '0 0 24'; + + // Setup alternative colour + if (self.spawnflags & ARMOR_BLUE) { + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_RING; + self.skin = 3; + } + else { + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_RING; + self.skin = 1; + } + + item_armor_setup(); +}; + +/*====================================================================== +/*QUAKED item_armorInv (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/armour.mdl"); } +Red Armour with 200 points of protection +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Red Armour with 200 points of protection + +======================================================================*/ +void() item_armorInv = +{ + self.mdl = "progs/armour.mdl"; + precache_model (self.mdl); + self.skin = 2; + self.classtype = CT_ARMORINV; + self.items = IT_ARMOR3; + self.armortype = ARMOR_RED_TYPE; + self.armorvalue = ARMOR_RED_VALUE; + self.respawn_effect = TRUE; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + item_armor_setup(); +}; + +/*====================================================================== + Deathmatch Weapon Rules +======================================================================*/ +float(float w) DM_RankForWeapon = +{ + if (w == IT_LIGHTNING) return 1; + if (w == IT_ROCKET_LAUNCHER) return 2; + if (w == IT_SUPER_NAILGUN) return 3; + if (w == IT_GRENADE_LAUNCHER) return 4; + if (w == IT_SUPER_SHOTGUN) return 5; + if (w == IT_NAILGUN) return 6; + return 7; // Axe +}; + +//---------------------------------------------------------------------- +void(float old, float new) DM_Weapon = +{ + local float oldrank, newrank; + +// change self.weapon if desired + oldrank = DM_RankForWeapon (self.weapon); + newrank = DM_RankForWeapon (new); + if ( newrank < oldrank ) self.weapon = new; +}; + +//---------------------------------------------------------------------- +void(entity targ) bound_other_ammo = +{ + if (targ.ammo_shells > AMMO_MAXSHELLS) targ.ammo_shells = AMMO_MAXSHELLS; + if (targ.ammo_nails > AMMO_MAXNAILS) targ.ammo_nails = AMMO_MAXNAILS; + if (targ.ammo_rockets > AMMO_MAXROCKETS) targ.ammo_rockets = AMMO_MAXROCKETS; + if (targ.ammo_cells > AMMO_MAXCELLS) targ.ammo_cells = AMMO_MAXCELLS; +}; + +//---------------------------------------------------------------------- +void() weapon_touch = +{ + local float pickupweapon, pickupammo, moditem; + + //---------------------------------------------------------------------- + if (self.classtype == CT_UPGRADE_AXE) { + pickupweapon = IT_UPGRADE_AXE; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.moditems & pickupweapon) return; + // Update serverflag and highlight as MOD weapon + update_configflag(SVR_UPDAXE, TRUE); + moditem = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SHOTGUN) { + pickupweapon = IT_SHOTGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_shells > AMMO_MAXSHELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_SHELLS_WPN; + } + else pickupammo = AMMO_SHELLS_WPN; + other.ammo_shells = other.ammo_shells + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_UPGRADE_SSG) { + pickupweapon = IT_UPGRADE_SSG; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.moditems & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.moditems & pickupweapon) { + if (other.ammo_shells > AMMO_MAXSHELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_SHELLS_WPN; + } + else pickupammo = AMMO_SHELLS_WPN; + other.ammo_shells = other.ammo_shells + pickupammo; + // Update serverflag and highlight as MOD weapon + update_configflag(SVR_UPDSSG, TRUE); + moditem = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SUPER_SHOTGUN) { + pickupweapon = IT_SUPER_SHOTGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_shells > AMMO_MAXSHELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_SHELLS_WPN; + } + else pickupammo = AMMO_SHELLS_WPN; + other.ammo_shells = other.ammo_shells + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_NAILGUN) { + pickupweapon = IT_NAILGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_nails > AMMO_MAXNAILS*0.5) pickupammo = 0; + else pickupammo = AMMO_NAILS_WPN; + } + else pickupammo = AMMO_NAILS_WPN; + other.ammo_nails = other.ammo_nails + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SUPER_NAILGUN) { + pickupweapon = IT_SUPER_NAILGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_nails > AMMO_MAXNAILS*0.5) pickupammo = 0; + else pickupammo = AMMO_NAILS_WPN; + } + else pickupammo = AMMO_NAILS_WPN; + other.ammo_nails = other.ammo_nails + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_GRENADE_LAUNCHER) { + pickupweapon = IT_GRENADE_LAUNCHER; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_rockets > AMMO_MAXROCKETS*0.5) pickupammo = 0; + else pickupammo = AMMO_ROCKETS_WPN; + } + else pickupammo = AMMO_ROCKETS_WPN; + other.ammo_rockets = other.ammo_rockets + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_ROCKET_LAUNCHER) { + pickupweapon = IT_ROCKET_LAUNCHER; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_rockets > AMMO_MAXROCKETS*0.5) pickupammo = 0; + else pickupammo = AMMO_ROCKETS_WPN; + } + else pickupammo = AMMO_ROCKETS_WPN; + other.ammo_rockets = other.ammo_rockets + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_UPGRADE_LG) { + pickupweapon = IT_UPGRADE_LG; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.moditems & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.moditems & pickupweapon) { + if (other.ammo_cells > AMMO_MAXCELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_CELLS_WPN; + } + else pickupammo = AMMO_CELLS_WPN; + other.ammo_cells = other.ammo_cells + pickupammo; + // Update serverflag and highlight as MOD weapon + update_configflag(SVR_UPDLG, TRUE); + moditem = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_LIGHTNING) { + pickupweapon = IT_LIGHTNING; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_cells > AMMO_MAXCELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_CELLS_WPN; + } + else pickupammo = AMMO_CELLS_WPN; + other.ammo_cells = other.ammo_cells + pickupammo; + } + //---------------------------------------------------------------------- + else return; + + if (self.classtype == CT_UPGRADE_AXE && other.moditems & IT_UPGRADE_AXE) + sprint (other, "You got another axe to grind\n"); + else if (self.classtype == CT_SUPER_SHOTGUN && other.moditems & IT_UPGRADE_SSG) + sprint (other, "You got a handful of Shells\n"); + else if (self.classtype == CT_UPGRADE_SSG && other.moditems & IT_UPGRADE_SSG) + sprint (other, "You got triple barrel boomstick\n"); + else if (self.classtype == CT_LIGHTNING && other.moditems & IT_UPGRADE_LG) + sprint (other, "You got some AAA batteries\n"); + else if (self.classtype == CT_UPGRADE_LG && other.moditems & IT_UPGRADE_LG) + sprint (other, "You got another burst of plasma\n"); + else { + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + } + // weapon touch sound + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Make sure no ammo is over limits + bound_other_ammo (other); + + // Stop the player switching to weapons already got + if (deathmatch > 0) { + // Check for new shadow axe and SG and skip weapon switch + if (moditem && pickupweapon == IT_UPGRADE_AXE && other.moditems & pickupweapon) pickupweapon = FALSE; + else if (pickupweapon == IT_SHOTGUN && other.items & pickupweapon) pickupweapon = FALSE; + // Stop switching to a lower tier weapon (DM Rules) + // if (DM_RankForWeapon(other.weapon) < DM_RankForWeapon(new)) new = FALSE; + } + + // Skip any weapon switch if no new weapon + if (pickupweapon != FALSE) { + // change to the weapon and add to inventory + other.items = other.items | pickupweapon; + if (moditem) other.moditems = other.moditems | pickupweapon; + + // Check for best weapon (DM only) and switch to it! + if (deathmatch) DM_Weapon (other.weapon, pickupweapon); + else other.weapon = pickupweapon; + W_SetCurrentAmmo(other); + } + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); + // Triggers events work once in co-op + if (coop > 0) { self.target = ""; self.target2 = ""; } +}; + +/*====================================================================== + WEAPONS +======================================================================*/ +void() weapon_start = +{ + self.classgroup = CG_WEAPON; + self.touch2 = weapon_touch; + self.bbmins = VEC_WPNS_MIN; + self.bbmaxs = VEC_WPNS_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_WEAPON; + self.noise = "weapons/pkup.wav"; + + item_start (); +}; + +/*====================================================================== +/*QUAKED weapon_upgrade_axe (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shadaxe.mdl"); } +Shadow Axe, extra dmg and gib zombies +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Shadow Axe, extra dmg and gib zombies + +======================================================================*/ +void() weapon_upgrade_axe = +{ + self.mdl = MODEL_GWEAP_UPAXE; + precache_model (self.mdl); + self.weapon = IT_UPGRADE_AXE; + self.skin = 4; + self.classtype = CT_UPGRADE_AXE; + self.netname = "Shadow Axe"; + if (self.upgrade_axe != 0) self.upgrade_axe = FALSE; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_upgrade_ssg (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shot3.mdl"); } +The Widowmaker Shotgun, extra dmg, triple shot +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +The Widowmaker Shotgun, extra dmg, triple shot + +======================================================================*/ +void() weapon_upgrade_ssg = +{ + self.mdl = MODEL_GWEAP_UPSSG; + precache_model (self.mdl); + self.weapon = IT_UPGRADE_SSG; + self.classtype = CT_UPGRADE_SSG; + self.netname = "Widowmaker Shotgun"; + if (self.upgrade_ssg != 0) self.upgrade_ssg = FALSE; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_upgrade_lg (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_plasma.mdl"); } +The Plasma Gun, direct & splashdamage +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +The Plasma Gun, direct & splashdamage + +======================================================================*/ +void() weapon_upgrade_lg = +{ + self.mdl = MODEL_GWEAP_UPLG; + precache_model (self.mdl); + self.weapon = IT_UPGRADE_LG; + self.classtype = CT_UPGRADE_LG; + self.netname = "Plasma Gun"; + if (self.upgrade_lg != 0) self.upgrade_lg = FALSE; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_shotgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shotgun.mdl"); } +Single barrel Shotgun +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Single barrel Shotgun + +======================================================================*/ +void() weapon_shotgun = +{ + self.mdl = MODEL_GWEAP_SG; + precache_model (self.mdl); + self.weapon = IT_SHOTGUN; + self.classtype = CT_SHOTGUN; + self.netname = "Sawn-off Shotgun"; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_supershotgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shot.mdl"); } +Super Shotgun +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Super Shotgun + +======================================================================*/ +void() weapon_supershotgun = +{ + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + if (query_configflag(SVR_UPDSSG)) { weapon_upgrade_ssg(); return; } + + self.mdl = MODEL_GWEAP_SSG; + precache_model (self.mdl); + precache_model (MODEL_GWEAP_UPSSG); // New Shotgun (pre-cache) + self.weapon = IT_SUPER_SHOTGUN; + self.classtype = CT_SUPER_SHOTGUN; + self.netname = "Double-barrelled Shotgun"; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_nailgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_nail.mdl"); } +Perforator (Nailgun) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Perforator (Nailgun) + +======================================================================*/ +void() weapon_nailgun = +{ + self.mdl = MODEL_GWEAP_NG; + precache_model (self.mdl); + self.weapon = IT_NAILGUN; + self.classtype = CT_NAILGUN; + self.netname = "Nailgun"; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_supernailgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_nail2.mdl"); } +Super Perforator (Super Nailgun) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Super Perforator (Super Nailgun) + +======================================================================*/ +void() weapon_supernailgun = +{ + self.mdl = MODEL_GWEAP_SNG; + precache_model (self.mdl); + self.weapon = IT_SUPER_NAILGUN; + self.classtype = CT_SUPER_NAILGUN; + self.netname = "Super Nailgun"; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_grenadelauncher (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_rock.mdl"); } +Grenade Launcher +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Grenade Launcher + +======================================================================*/ +void() weapon_grenadelauncher = +{ + self.mdl = MODEL_GWEAP_GL; + precache_model (self.mdl); + self.weapon = IT_GRENADE_LAUNCHER; + self.classtype = CT_GRENADE_LAUNCHER; + self.netname = "Grenade Launcher"; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_rocketlauncher (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_rock2.mdl"); } +Rocket Launcher +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Rocket Launcher + +======================================================================*/ +void() weapon_rocketlauncher = +{ + self.mdl = MODEL_GWEAP_RL; + precache_model (self.mdl); + self.weapon = IT_ROCKET_LAUNCHER; + self.classtype = CT_ROCKET_LAUNCHER; + self.netname = "Rocket Launcher"; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_lightning (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_light.mdl"); } +Thunderbolt Cannon +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Thunderbolt Cannon + +======================================================================*/ +void() weapon_lightning = +{ + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + if (query_configflag(SVR_UPDLG)) { weapon_upgrade_lg(); return; } + + self.mdl = MODEL_GWEAP_LG; + precache_model (self.mdl); + self.weapon = IT_LIGHTNING; + self.classtype = CT_LIGHTNING; + self.netname = "Thunderbolt"; + weapon_start(); +}; + +/*====================================================================== + AMMO +======================================================================*/ +void() ammo_touch = +{ + local float best; + + //---------------------------------------------------------------------- + if (self.classtype == CT_AMMOSHELLS) { + if (other.ammo_shells >= AMMO_MAXSHELLS) return; + other.ammo_shells = other.ammo_shells + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMONAILS) { + if (other.ammo_nails >= AMMO_MAXNAILS) return; + other.ammo_nails = other.ammo_nails + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOROCKETS) { + if (other.ammo_rockets >= AMMO_MAXROCKETS) return; + other.ammo_rockets = other.ammo_rockets + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOCELLS) { + if (other.ammo_cells >= AMMO_MAXCELLS) return; + other.ammo_cells = other.ammo_cells + self.aflag; + } + + // Check/cap ammo limits + bound_other_ammo (other); + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // if the player was using his best weapon, + // change up to the new one if better + best = W_BestWeapon(other); + + // change to a better weapon if appropriate + if ( other.weapon == best ) { + other.weapon = W_BestWeapon(other); + W_SetCurrentAmmo (other); + } + + // if changed current ammo, update it + W_SetCurrentAmmo(other); + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +/*====================================================================== + Setup all Ammo with global parameters +======================================================================*/ +void() item_ammo_setup = +{ + self.frame = 0; + self.touch2 = ammo_touch; + self.classgroup = CG_AMMOITEM; + self.bbmins = VEC_AMMO_MIN; + self.bbmaxs = VEC_AMMO_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_AMMO; + self.noise = "weapons/lock4.wav"; + + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + // Move the new centered ammo models to match old ammo origin + // The default is to move all ammo items to suit original id maps + if (!query_configflag(SVR_ITEMOFFSET)) { + self.oldorigin = self.origin + '16 16 0'; + setorigin(self, self.oldorigin); + } + + // Override the world theme skin type + if (self.skin_override > 0 && self.skin_override < 3) + self.skin = self.skin_override - 1; + // Switch to medieval (wood) skin for medieval/metal theme maps + else if (world.worldtype < 2) self.skin = 1; + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + // Setup lid attachment entity (defined in item setup) + if (self.spawnflags & A_LID) { + self.attachment = spawn(); + self.attachment.owner = self; + setorigin(self.attachment, self.origin); + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + } + + // Check for coop errors + item_coopcheck(); + item_start (); +}; + +/*====================================================================== +/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_shells (0 .5 .8) (-16 -16 0) (16 16 32) BIG LID x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ammo_shells0.mdl"); } +20 or 40 Shells +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for LID (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +LID : Extra LID model positioned with box +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +20 or 40 Shells for the Shotgun (SG), SuperShotgun (SSG) and Upgrade + +======================================================================*/ +void() item_shells = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_shells1.mdl"; + self.headmdl = "progs/ammo_lidlarge.mdl"; + if (self.aflag < 1) self.aflag = AMMO_SHELLS_LGR; + } + else { + self.mdl = "progs/ammo_shells0.mdl"; + self.headmdl = "progs/ammo_lidsmall.mdl"; + if (self.aflag < 1) self.aflag = AMMO_SHELLS_SML; + } + + precache_model (self.mdl); + precache_model (self.headmdl); + self.classtype = CT_AMMOSHELLS; + self.netname = "box of shells"; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = FALSE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_spikes (0 .5 .8) (-16 -16 0) (16 16 32) BIG LID x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ammo_nails0.mdl"); } +25 or 50 Spikes +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for LID (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +LID : Extra LID model positioned with box +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +25 or 50 Spikes for the Perforator (NG) and Super Perforator (SNG) + +======================================================================*/ +void() item_spikes = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_nails1.mdl"; + self.headmdl = "progs/ammo_lidlarge.mdl"; + if (self.aflag < 1) self.aflag = AMMO_NAILS_LGR; + } + else { + self.mdl = "progs/ammo_nails0.mdl"; + self.headmdl = "progs/ammo_lidsmall.mdl"; + if (self.aflag < 1) self.aflag = AMMO_NAILS_SML; + } + + precache_model (self.mdl); + precache_model (self.headmdl); + self.classtype = CT_AMMONAILS; + self.netname = "box of nails"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = FALSE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_rockets (0 .5 .8) (-16 -16 0) (16 16 32) BIG x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ammo_rockets0.mdl"); } +5 or 10 Rockets +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for box of ammo (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +5 or 10 Rockets for the Grenade (GL) or Rocket Launcher (RL) + +======================================================================*/ +void() item_rockets = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_rockets1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_ROCKETS_LGR; + } + else { + self.mdl = "progs/ammo_rockets0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_ROCKETS_SML; + } + + precache_model (self.mdl); + self.classtype = CT_AMMOROCKETS; + self.netname = "box of rockets"; + self.spawnflags = self.spawnflags - (self.spawnflags & A_LID); + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = TRUE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_cells (0 .5 .8) (-16 -16 0) (16 16 32) BIG x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ammo_battery0.mdl"); } +6 or 12 Medieval Battery +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +6 or 12 Medieval Battery (cells) for the Thunderbolt (LG) + +======================================================================*/ +void() item_cells = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_battery1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_LGR; + } + else { + self.mdl = "progs/ammo_battery0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_SML; + } + + precache_model (self.mdl); + self.classtype = CT_AMMOCELLS; + self.netname = "battery"; + self.spawnflags = self.spawnflags - (self.spawnflags & A_LID); + self.respawn_style = PARTICLE_BURST_GREEN + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = FALSE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_plasma (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_plasma (0 .5 .8) (-16 -16 0) (16 16 32) BIG x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ammo_cells0.mdl"); } +6 or 12 Cells +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for box of ammo (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +6 or 12 Cells for the Thunderbolt (LG) + +======================================================================*/ +void() item_plasma = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_cells1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_LGR; + } + else { + self.mdl = "progs/ammo_cells0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_SML; + } + + precache_model (self.mdl); + self.classtype = CT_AMMOCELLS; + self.netname = "box of cells"; + self.spawnflags = self.spawnflags - (self.spawnflags & A_LID); + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = TRUE; + item_ammo_setup(); +}; + +/*====================================================================== + KEYS (Silver, Gold and Custom) +======================================================================*/ +void() key_touchbindmsg = +{ + sound (self.enemy, CHAN_VOICE, SOUND_TALK, 1, ATTN_NORM); + centerprint(self.enemy, "Press 'i' Key to open Inventory\nTo see what \bArcane keys\b you have!\n"); +}; + +//---------------------------------------------------------------------- +void() key_touch = +{ + // Check if the player has the custom key already? + if (self.classtype == CT_CUSTOMKEY) { + if (other.moditems & self.moditems) return; + } + else { + // Check if the player has the silver/gold key already? + if ( other.items & self.items ) return; + } + + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Add key to player inventory (items / customkey) + if (self.moditems > 0) { + other.moditems = other.moditems | self.moditems; + // Store the key netname on the player/client for door ref later + if (self.moditems & IT_CKEY1) other.ckeyname1 = self.netname; + else if (self.moditems & IT_CKEY2) other.ckeyname2 = self.netname; + else if (self.moditems & IT_CKEY3) other.ckeyname3 = self.netname; + else other.ckeyname4 = self.netname; + } + // Add silver/gold key to player inventory + else other.items = other.items | self.items; + + // Setup respawn for co-op + if (coop > 0 && self.respawn_time > 0) { + self.respawn_time = RESPAWN_COOP; + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); + // Triggers events work once in co-op + if (coop > 0) self.target = ""; + + // Warn player about new key binding for inventory (first time only) + if (self.moditems > 0 && other.ckeyhint == FALSE) { + self.enemy = other; // Store for later + other.ckeyhint = TRUE; // Only works once + self.think = key_touchbindmsg; + self.nextthink = time + 3; + } +}; + +//---------------------------------------------------------------------- +void() key_setup = +{ + if (self.noise == "") { + if (self.worldtype == 1) self.noise = "misc/runekey.wav"; + else if (self.worldtype == 2) self.noise = "misc/basekey.wav"; + else self.noise = "misc/medkey.wav"; + } + precache_sound (self.noise); + + self.touch2 = key_touch; + self.classgroup = CG_KEY; + self.bbmins = VEC_KEYS_MIN; + self.bbmaxs = VEC_KEYS_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_KEY; + + // Check for coop errors + item_coopcheck(); + item_start(); +}; + +/*====================================================================== +/*QUAKED item_key1 (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/key_silver.mdl"); } +SILVER key, changes based on worldtype on worldspawn +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +SILVER key, changes based on worldtype on worldspawn + +======================================================================*/ +void() item_key1 = +{ + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + if (self.worldtype == 0) { + self.mdl = "progs/key_medieval.mdl"; // progs/w_s_key.mdl + self.netname = "silver key"; + } + else if (self.worldtype == 1) { + self.mdl = "progs/key_runic.mdl"; // progs/m_s_key.mdl + self.netname = "silver runekey"; + } + else if (self.worldtype == 2) { + self.mdl = "progs/key_base.mdl"; // progs/b_s_key.mdl + self.netname = "silver keycard"; + } + + precache_model (self.mdl); + self.skin = 2; + self.items = IT_KEY1; + self.classtype = CT_SILVERKEY; + self.part_active = PARTICLE_STYLE_KEYSILVER; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 20'; + key_setup(); +}; + +/*====================================================================== +/*QUAKED item_key2 (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/key_gold.mdl"); } +GOLD key, changes based on worldtype on worldspawn +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +GOLD key, changes based on worldtype on worldspawn + +======================================================================*/ +void() item_key2 = +{ + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + if (self.worldtype == 0) { + self.mdl = "progs/key_medieval.mdl"; // progs/w_g_key.mdl + self.netname = "gold key"; + } + if (self.worldtype == 1) { + self.mdl = "progs/key_runic.mdl"; // progs/m_g_key.mdl + self.netname = "gold runekey"; + } + if (self.worldtype == 2) { + self.mdl = "progs/key_base.mdl"; // progs/b_g_key.mdl + self.netname = "gold keycard"; + } + + precache_model (self.mdl); + self.skin = 6; + self.items = IT_KEY2; + self.classtype = CT_GOLDKEY; + self.part_active = PARTICLE_STYLE_KEYGOLD; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 20'; + key_setup(); +}; + +/*====================================================================== +/*QUAKED item_keyx (0 .5 .8) (-16 -16 -24) (16 16 32) CKEY1 CKEY2 CKEY3 CKEY4 RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/key_medieval.mdl"); } +Custom key +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +mdl : model name to load/display (progs/model.mdl) +netname : XXX Part of pickup string "You got the XXX" +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +Ckey1 : Custom Key type 1 +Ckey2 : Custom Key type 2 +Ckey3 : Custom Key type 3 +Ckey4 : Custom Key type 4 +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Custom key + +======================================================================*/ +void() item_keyx = +{ + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + // Can't have a custom key without a custom model!?! + if (self.mdl == "") { + dprint("\b[CUSTOM KEY]\b Missing model\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + precache_model (self.mdl); + + // Setup custom key reference number (must exist) + if (self.spawnflags & ITEM_CKEY1) { + self.moditems = IT_CKEY1; + if (self.netname == "") self.netname = "Arcane Key 1"; + } + else if (self.spawnflags & ITEM_CKEY2) { + self.moditems = IT_CKEY2; + if (self.netname == "") self.netname = "Arcane Key 2"; + } + else if (self.spawnflags & ITEM_CKEY3) { + self.moditems = IT_CKEY3; + if (self.netname == "") self.netname = "Arcane Key 3"; + } + else if (self.spawnflags & ITEM_CKEY4) { + self.moditems = IT_CKEY4; + if (self.netname == "") self.netname = "Arcane Key 4"; + } + else { + dprint("\b[CUSTOM KEY]\b Missing spawnflag key number!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + self.classtype = CT_CUSTOMKEY; + self.items = IT_KEY1 | IT_KEY2; + if (self.exactskin > 0) self.skin = self.exactskin; + + // Check for any AD defined particle effects + if (self.message2 == "KEYGOLD") self.part_active = PARTICLE_STYLE_KEYGOLD; + else if (self.message2 == "KEYSILVER") self.part_active = PARTICLE_STYLE_KEYSILVER; + else if (self.message2 == "KEYRED") self.part_active = PARTICLE_STYLE_KEYRED; + else if (self.message2 == "KEYGREEN") self.part_active = PARTICLE_STYLE_KEYGREEN; + else if (self.message2 == "KEYPURPLE") self.part_active = PARTICLE_STYLE_KEYPURPLE; + else if (self.message2 == "KEYWHITE") self.part_active = PARTICLE_STYLE_KEYWHITE; + else self.part_active = 0; + + // Default respawn parameters, clear message2 just in case + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_CENTER; + if (!self.respawn_ofs) self.respawn_ofs = '0 0 20'; + self.message2 = ""; + + key_setup(); +}; + +/*====================================================================== +/*QUAKED item_custom (0 .5 .8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/key_base.mdl"); } +Custom Pickup Item +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +mdl : model name to load/display (progs/model.mdl) +netname : XXX Part of pickup string "You got the XXX" +noise1 : Custom pickup sound (def=weapons/lock4.wav) +pos1 : Pickup bounding box minimum (def=-16 -16 -24) +pos2 : Pickup bounding box maximum (def=16 16 32) +bodyfadeaway : Model will fade away on pickup +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +part_active : = 1 Enable particle burst on pickup +part_ofs : Particle Origin Offset (def='0 0 0') +part_tcount : Particle Quantity (def=20) +part_life : Particle Life Time (def=2s) +part_style : 1=yellow, 2=green, 3=red, 4=blue, 5=purple, 6=fire, 7=white +part_movetype : 2=center, 3=up, 4=shockwave, 5=skull, 6=lost, 7=minotaur +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Custom Pickup Item + +======================================================================*/ +void() item_custom_touch = +{ + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Check for a particle pickup burst (can be blocked) + if (self.part_style > 0 && !(self.spawnflags & ITEM_NOEFFECTS)) + misc_particle_burst_use(); + + // Once only, fade away function + if (self.bodyfadeaway == TRUE) { + self.use = self.touch = SUB_Null; + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; + self.wait = self.delay = 0; + } + else { + // Do not remove/respawn in co-op + if (!coop) { + item_finished(); + check_item_respawn(); + } + } + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_custom = +{ + if (self.mdl == "") self.mdl = MODEL_BROKEN; + if (self.noise == "") self.noise = "weapons/lock4.wav"; + precache_model (self.mdl); + precache_sound (self.noise); + + self.classtype = CT_CUSTOMITEM; + // Essentially this item is used like a key + // pickup, collect and trigger an event + self.classgroup = CG_KEY; + if (self.netname == "") self.netname = "Custom Item"; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_KEY; + + // Check for a particle burst setup + if (self.part_active == TRUE) misc_particle_burst_setup(); + self.part_active = 0; // Must clear this afterward + + // Setup random rotation, will be ignored if spinning model + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + // Setup different skin options + if (self.exactskin > 0) self.skin = self.exactskin; + else if (self.randomskin > 1) self.skin = rint(random()*(self.randomskin-1)); + if (self.skin < 0) self.skin = 0; // Double check no negatives + + self.touch2 = item_custom_touch; + if (CheckZeroVector(self.pos1)) self.bbmins = VEC_KEYS_MIN; + else self.bbmins = self.pos1; + if (CheckZeroVector(self.pos2)) self.bbmaxs = VEC_KEYS_MAX; + else self.bbmaxs = self.pos2; + + item_start(); +}; + +/*====================================================================== +/*QUAKED item_sigil (0 0.5 0.8) (-16 -16 -24) (16 16 32) Ep1 Ep2 Ep3 Ep4 RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/key_rune1.mdl"); } +End of episode sigil / rune +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +EP1 : Episode 1 Rune +EP2 : Episode 2 Rune +EP3 : Episode 3 Rune +EP4 : Episode 4 Rune +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +End of episode sigil. If the player is in possession of a sigil, then the next time +the player changes levels, all func_episodegate entities for that episode will appear. +This is used to block access to slipgates that lead to episodes that the player has +already completed. If the player is in possession of the item_sigil for all four +episodes, then the func_bossgate entity will NOT appear. This is used to grant +access to the final boss once the player has completed all episodes. + +======================================================================*/ +void() sigil_touch = +{ + if (query_configflag(self.customkey)) return; + + centerprint (other, "You got the rune!"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Add rune to server! not player + update_configflag(self.customkey, TRUE); + + // DP has special effect for sigil being picked up + if (ext_dppart) pointparticles(particleeffectnum(DPP_SIGILPICKUP), self.origin, '0 0 0', 1); + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + // This odd classname assignment does nothing, old code + //self.classname = string_null; + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_sigil = +{ + if (!self.spawnflags) { + dprint("\b[SIGIL]\b No Rune type selected!?!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Based on what spawn key is selected, update model/spawnflag + // This will make sure only one rune is selected at once + // Also allow for the spawnflags to have other parameters + if (self.spawnflags & SVR_RUNE_KEY1) { + self.mdl = "progs/key_rune1.mdl"; + self.customkey = SVR_RUNE_KEY1; + } + else if (self.spawnflags & SVR_RUNE_KEY2) { + self.mdl = "progs/key_rune2.mdl"; + self.customkey = SVR_RUNE_KEY2; + } + else if (self.spawnflags & SVR_RUNE_KEY3) { + self.mdl = "progs/key_rune3.mdl"; + self.customkey = SVR_RUNE_KEY3; + } + else if (self.spawnflags & SVR_RUNE_KEY4) { + self.mdl = "progs/key_rune4.mdl"; + self.customkey = SVR_RUNE_KEY4; + } + + precache_model (self.mdl); + if (self.noise == "") self.noise = "misc/runekey.wav"; + precache_sound (self.noise); + + self.touch2 = sigil_touch; + self.classtype = CT_RUNEKEY; + self.classgroup = CG_RUNE; + self.part_active = PARTICLE_STYLE_SIGIL; + self.bbmins = VEC_KEYS_MIN; + self.bbmaxs = VEC_KEYS_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_RUNE; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + + // Check for coop errors + item_coopcheck(); + item_start(); +}; + +/*====================================================================== +/*QUAKED item_artifact_tomeofpower (0 .5 .8) (-16 -16 -24) (16 16 32) x x x x x FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/key_tome.mdl"); } +Custom event trigger +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : trigger targets to fire when item touched +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +noise : Custom pickup sound +-------- SPAWNFLAGS -------- +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Custom event trigger + +======================================================================*/ +void() tomeofpower_touch = +{ + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // This is a trigger once condition (regardless of coop) + item_finished(); + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_artifact_tomeofpower = +{ + self.mdl = "progs/artifact_tome.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "misc/medkey.wav"; + precache_sound (self.noise); + + self.classtype = CT_ARTTOME; + self.classgroup = CG_ARTIFACT; + self.moditems = IT_ARTTOME; + self.netname = "Tome of Power"; + + self.touch2 = tomeofpower_touch; + self.bbmins = VEC_POWR_MIN; + self.bbmaxs = VEC_POWR_MAX; + self.part_active = PARTICLE_STYLE_TOMEOFP; + item_start(); +}; + +/*====================================================================== + ARTIFACTS - suit, pent, invis, quad, sharpshooter, nailpiercer, westsuit +======================================================================*/ +void() artifact_touch = +{ + //---------------------------------------------------------------------- + // Existing artifacts + //---------------------------------------------------------------------- + if (self.classtype == CT_ARTSUIT) { + other.rad_time = TRUE; + other.radsuit_finished = time + self.cnt; + ResetDebuffBurning(other); + ResetDebuffPoisoned(other); + // Remove any wetsuit artifact + other.moditems = other.moditems - (other.moditems & IT_ARTWETSUIT); + other.wetsuit_finished = 0; + other.wetsuit_time = 0; + } + else if (self.classtype == CT_ARTPENT) { + other.invincible_time = TRUE; + other.invincible_finished = time + self.cnt; + ResetDebuffSystem(other); + } + else if (self.classtype == CT_ARTINVS) { + other.invisible_time = TRUE; + other.invisible_finished = time + self.cnt; + other.invisible_sound = time + 1; + } + else if (self.classtype == CT_ARTQUAD) { + other.super_time = TRUE; + other.super_damage_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTSHARP) { + other.sharpshoot_time = TRUE; + other.sharpshoot_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTPIERCE) { + other.nailpiercer_time = TRUE; + other.nailpiercer_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTWETSUIT) { + other.wetsuit_time = TRUE; + other.wetsuit_finished = time + self.cnt; + other.wetsuit_sound = time + 2; + // Remove any envsuit artifact + other.items = other.items - (other.items & IT_SUIT); + other.radsuit_finished = 0; + other.rad_time = 0; + } + else return; + + //---------------------------------------------------------------------- + // Pickup sound and initial screen flash + //---------------------------------------------------------------------- + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Update player item flags (regular + mod) + other.items = other.items | self.items; + other.moditems = other.moditems | self.moditems; + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +/*====================================================================== + setup all artifacts with similiar configurations +======================================================================*/ +void() artifact_setup = +{ + self.touch2 = artifact_touch; + self.classgroup = CG_ARTIFACT; + self.bbmins = VEC_POWR_MIN; + self.bbmaxs = VEC_POWR_MAX; + + // Allow for custom artifact timer + if (self.cnt < 1) self.cnt = POWERUP_TIMER; + + // Setup skin override + if (self.exactskin < 1) self.exactskin = 0; + self.skin = self.exactskin; + + // Setup artifact default respawn timers + if (self.respawn_time == 0) { + if (self.classtype == CT_ARTPENT || self.classtype == CT_ARTINVS) + self.respawn_time = RESPAWN_ARTIFACT2; + else self.respawn_time = RESPAWN_ARTIFACT1; + } + + item_start (); +}; + +/*====================================================================== +/*QUAKED item_artifact_envirosuit (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_envsuit.mdl"); } +Player takes no damage from water or slime for 30 seconds +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +exactskin : 0=Original, 1=Green, 2=Brown, 3=Aqua, 4=Blue +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player takes no damage from water or slime for 30 seconds +Immume from Wraith Healing Debuff but take small damage instead + +======================================================================*/ +void() item_artifact_envirosuit = +{ + // cshifts 0,255,0,20 + self.mdl = "progs/artifact_envsuit.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTSUIT1; + self.noise1 = SOUND_ARTSUIT2; + precache_sound (self.noise); + precache_sound (self.noise1); + self.netname = "Environment Suit"; + self.items = IT_SUIT; + self.classtype = CT_ARTSUIT; + self.part_active = PARTICLE_STYLE_SUIT; + self.respawn_style = PARTICLE_BURST_GREEN + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 28'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_wetsuit (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_wetsuit.mdl"); } +Player takes no damage from water for 5 mins (300s) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +exactskin : 0=Original, 1=Green, 2=Brown, 3=Aqua, 4=Blue +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 300s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player takes no damage from water for 5 mins (300s) +Immume from Wraith Healing Debuff but take small damage instead + +======================================================================*/ +void() item_artifact_wetsuit = +{ + // cshifts 0,255,0,20 + self.mdl = "progs/artifact_wetsuit.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTWETS1; + self.noise1 = SOUND_ARTWETS2; + self.noise2 = SOUND_ARTWETS3; + self.noise3 = SOUND_ARTWETS3B; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + self.netname = "Wet Suit"; + self.items = 0; + self.moditems = IT_ARTWETSUIT; + self.classtype = CT_ARTWETSUIT; + self.part_active = PARTICLE_STYLE_WETSUIT; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 28'; + if (self.cnt < 1) self.cnt = 300; + if (self.exactskin < 1) self.exactskin = 4; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_invulnerability (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_pent.mdl"); } +Player is invulnerable for 30 seconds +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player is invulnerable for 30 seconds +Immume from Wraith Healing Debuff + +======================================================================*/ +void() item_artifact_invulnerability = +{ + // cshifts 255,255,0,30 + self.mdl = "progs/artifact_pent.mdl"; // Originally - progs/invulner.mdl + precache_model (self.mdl); + self.noise = SOUND_ARTPENT1; + self.noise1 = SOUND_ARTPENT2; + self.noise2 = SOUND_ARTPENT3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Pentagram of Protection"; + self.items = IT_INVULNERABILITY; + self.classtype = CT_ARTPENT; + self.part_active = PARTICLE_STYLE_PENT; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_invisibility (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_invis.mdl"); } +Player is invisible for 30 seconds +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player is invisible for 30 seconds + +======================================================================*/ +void() item_artifact_invisibility = +{ + // cshifts 100,100,100,100 + self.mdl = "progs/artifact_invis.mdl"; // Originally - progs/invisibl.mdl + precache_model (self.mdl); + self.noise = SOUND_ARTINV1; + self.noise1 = SOUND_ARTINV2; + self.noise2 = SOUND_ARTINV3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Ring of Shadows"; + self.items = IT_INVISIBILITY; + self.classtype = CT_ARTINVS; + self.part_active = PARTICLE_STYLE_SRING; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 6'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_super_damage (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_quad.mdl"); } +The next attack from the player will do 4x damage +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +The next attack from the player will do 4x damage + +======================================================================*/ +void() item_artifact_super_damage = +{ + // cshifts 0,0,255,30 + self.mdl = "progs/artifact_quad.mdl"; // Originally - progs/quaddama.mdl + precache_model (self.mdl); + self.noise = SOUND_ARTQUAD1; + self.noise1 = SOUND_ARTQUAD2; + self.noise2 = SOUND_ARTQUAD3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Quad Damage"; + self.items = IT_QUAD; + self.classtype = CT_ARTQUAD; + self.part_active = PARTICLE_STYLE_QUAD; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_sharp_shooter (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_sharp.mdl"); } +Reduces the bullet spread of all Shotguns +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Reduces the bullet spread of all Shotguns + +======================================================================*/ +void() item_artifact_sharp_shooter = +{ + self.mdl = "progs/artifact_sharp.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTSHARP1; + self.noise1 = SOUND_ARTSHARP2; + self.noise2 = SOUND_ARTSHARP3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Sharp Shooter"; + self.items = IT_QUAD; + self.moditems = IT_ARTSHARP; + self.classtype = CT_ARTSHARP; + self.part_active = PARTICLE_STYLE_SHARP; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_nail_piercer (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/artifact_piercer.mdl"); } +All nail attacks will travel through monsters +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +All nail attacks will travel through monsters + +======================================================================*/ +void() item_artifact_nail_piercer = +{ + self.mdl = "progs/artifact_piercer.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTNAILP1; + self.noise1 = SOUND_ARTNAILP2; + self.noise2 = SOUND_ARTNAILP3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Nail Piercer"; + self.items = IT_QUAD; + self.moditems = IT_ARTPIERCE; + self.classtype = CT_ARTPIERCE; + self.part_active = PARTICLE_STYLE_PIERCE; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +//====================================================================== +// ITEM BACKPACKS +// * Dropped from monsters and players +// * Can be setup as an item with random ammo/armour +// * Will monitor ground below so can fall further +// +//====================================================================== +float(entity backent, string backtext1, string backtext2, float backcomma) BackpackText = +{ + if (backcomma > 0) sprint (backent, ", "); + if (backtext1 != "") sprint (backent, backtext1); + if (backtext2 != "") sprint (backent, backtext2); + return 1; +}; + +//---------------------------------------------------------------------- +void() BackpackTouch = +{ + local string s; + local float pickupweapon, acount; + + acount = 0; + sprint (other, "You get "); + + //---------------------------------------------------------------------- + // A Coop player can pickup all of the weapons + // dropped by previous player (go through list) + //---------------------------------------------------------------------- + if (coop > 0) { + if (self.moditems & IT_UPGRADE_AXE && !(other.moditems & IT_UPGRADE_AXE)) { + pickupweapon = IT_UPGRADE_AXE; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "ShadowAxe", "", acount); + other.moditems = other.moditems | pickupweapon; + update_configflag(SVR_UPDAXE, TRUE); + } + + if (self.items & IT_SHOTGUN && !(other.items & IT_SHOTGUN)) { + pickupweapon = IT_SHOTGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "SG", "", acount); + } + + if (self.moditems & IT_UPGRADE_SSG && !(other.moditems & IT_UPGRADE_SSG)) { + pickupweapon = IT_UPGRADE_SSG; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "WidowMaker", "", acount); + other.moditems = other.moditems | pickupweapon; + update_configflag(SVR_UPDSSG, TRUE); + } + else if (self.items & IT_SUPER_SHOTGUN && !(other.items & IT_SUPER_SHOTGUN)) { + pickupweapon = IT_SUPER_SHOTGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "SSG", "", acount); + } + + if (self.items & IT_NAILGUN && !(other.items & IT_NAILGUN)) { + pickupweapon = IT_NAILGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "NG", "", acount); + } + if (self.items & IT_SUPER_NAILGUN && !(other.items & IT_SUPER_NAILGUN)) { + pickupweapon = IT_SUPER_NAILGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "SNG", "", acount); + } + if (self.items & IT_GRENADE_LAUNCHER && !(other.items & IT_GRENADE_LAUNCHER)) { + pickupweapon = IT_GRENADE_LAUNCHER; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "GL", "", acount); + } + if (self.items & IT_ROCKET_LAUNCHER && !(other.items & IT_ROCKET_LAUNCHER)) { + pickupweapon = IT_ROCKET_LAUNCHER; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "RL", "", acount); + } + + if (self.moditems & IT_UPGRADE_LG && !(other.moditems & IT_UPGRADE_LG)) { + pickupweapon = IT_UPGRADE_LG; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "PlasmaGun", "", acount); + other.moditems = other.moditems | pickupweapon; + update_configflag(SVR_UPDLG, TRUE); + } + else if (self.items & IT_LIGHTNING && !(other.items & IT_LIGHTNING)) { + pickupweapon = IT_LIGHTNING; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "LG", "", acount); + } + } + // DM backpacks have only one weapon + else { + // Setup name of weapon first + if (self.items & IT_LIGHTNING && self.moditems & IT_UPGRADE_LG) + self.netname = "Plasma Gun"; + else if (self.items & IT_LIGHTNING) self.netname = "Thunderbolt"; + else if (self.items & IT_ROCKET_LAUNCHER) self.netname = "Rocket Launcher"; + else if (self.items & IT_GRENADE_LAUNCHER) self.netname = "Grenade Launcher"; + else if (self.items & IT_SUPER_NAILGUN) self.netname = "Super Nailgun"; + else if (self.items & IT_NAILGUN) self.netname = "Nailgun"; + else if (self.items & IT_SUPER_SHOTGUN && self.moditems & IT_UPGRADE_SSG) + self.netname = "Widow Maker Shotgun"; + else if (self.items & IT_SUPER_SHOTGUN) self.netname = "Double-barrelled Shotgun"; + else if (self.items & IT_SHOTGUN) self.netname = "Shotgun"; + else if (self.items & IT_AXE && self.moditems & IT_UPGRADE_AXE) + self.netname = "Shadow Axe"; + else if (self.items & IT_AXE) self.netname = "Axe"; + else self.netname = ""; + + // Check if the player has the weapon already? + if ((other.items & self.items) == 0 && self.netname != "") { + other.items = other.items | self.items; + other.moditems = other.moditems | self.moditems; + acount = BackpackText(other, "the", self.netname, acount); + } + } + + //---------------------------------------------------------------------- + // Calculate random amounts of ammo + //---------------------------------------------------------------------- + if (self.count > 0) { + if (self.spawnflags & BACKPACK_SHELLS) self.ammo_shells = rint(1 + random()*self.count); + if (self.spawnflags & BACKPACK_NAILS) self.ammo_nails = rint(1 + random()*self.count); + if (self.spawnflags & BACKPACK_ROCKETS) self.ammo_rockets = rint(1 + random()*self.count); + if (self.spawnflags & BACKPACK_CELLS) self.ammo_cells = rint(1 + random()*self.count); + if (self.armortype == 1) self.armorvalue = rint(1 + random()*self.count); + } + + //---------------------------------------------------------------------- + // Give ammo to player + //---------------------------------------------------------------------- + if (self.ammo_shells > 0) { + other.ammo_shells = other.ammo_shells + self.ammo_shells; + other.items = other.items | IT_SHELLS; + s = ftos(self.ammo_shells); + acount = BackpackText(other, s, " shells", acount); + } + if (self.ammo_nails > 0) { + other.ammo_nails = other.ammo_nails + self.ammo_nails; + other.items = other.items | IT_NAILS; + s = ftos(self.ammo_nails); + acount = BackpackText(other, s, " nails", acount); + } + if (self.ammo_rockets > 0) { + other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; + other.items = other.items | IT_ROCKETS; + s = ftos(self.ammo_rockets); + acount = BackpackText(other, s, " rockets", acount); + } + if (self.ammo_cells > 0) { + other.ammo_cells = other.ammo_cells + self.ammo_cells; + other.items = other.items | IT_CELLS; + s = ftos(self.ammo_cells); + acount = BackpackText(other, s, " cells", acount); + } + + //---------------------------------------------------------------------- + // Check for armor in backpack + //---------------------------------------------------------------------- + if (self.armorvalue > 0 && deathmatch == 0) { + // For coop backpacks can be dropped from players + // These can contain huge amounts of armour and needed + // to be treated as upgrade/replace, not the shard system + if (coop > 0 && self.items & IT_ALLARMOR) { + if (other.armortype*other.armorvalue < self.armortype*self.armorvalue) { + other.armortype = self.armortype; + other.armorvalue = self.armorvalue; + other.items = other.items - (other.items & IT_ALLARMOR); + other.items = other.items + (self.items & IT_ALLARMOR); + acount = BackpackText(other, "armor upgraded", "", acount); + } + } + else { + // For Singleplayer backpack items can contain shards + // Shards add to the armour value and can go above limit + // If no armour present (add a green jacket) + other.armorvalue = other.armorvalue + self.armorvalue; + + // Yellow armour upgrade + // Only update armour type if green armour present + if (self.armortype == ARMOR_YEL_TYPE) { + if (other.items & IT_ARMOR1 || other.armortype == 0) { + other.items = other.items - (other.items & IT_ARMOR1); + other.items = other.items | IT_ARMOR2; + other.armortype = ARMOR_YEL_TYPE; + } + } + // Red armour upgrade + // Remove previous armour type (hud display flag) + else if (self.armortype == ARMOR_RED_TYPE) { + other.items = other.items - (other.items & IT_ARMOR1); + other.items = other.items - (other.items & IT_ARMOR2); + other.items = other.items | IT_ARMOR3; + other.armortype = ARMOR_RED_TYPE; + } + // Does the player have any armor already? + else if (other.armortype == 0 ) { + // No armor present, give green with armor shards + other.items = other.items | IT_ARMOR1; + other.armortype = ARMOR_GRN_TYPE; + } + + if (self.armorvalue > 0) { + s = ftos(self.armorvalue); + acount = BackpackText(other, s, " armor shards", acount); + } + } + } + + //---------------------------------------------------------------------- + // Check for Silver/Gold/Custom keys if coop active + //---------------------------------------------------------------------- + if (coop > 0) { + if (self.items & IT_KEY1) { + other.items = other.items | IT_KEY1; + acount = BackpackText(other, "Silver Key", "", acount); + } + if (self.items & IT_KEY2) { + other.items = other.items | IT_KEY2; + acount = BackpackText(other, "Gold Key", "", acount); + } + if (self.moditems & IT_CKEY1) { + other.moditems = other.moditems | IT_CKEY1; + other.ckeyname1 = self.ckeyname1; + acount = BackpackText(other, self.ckeyname1, "", acount); + } + if (self.moditems & IT_CKEY2) { + other.moditems = other.moditems | IT_CKEY2; + other.ckeyname2 = self.ckeyname2; + acount = BackpackText(other, self.ckeyname2, "", acount); + } + if (self.moditems & IT_CKEY3) { + other.moditems = other.moditems | IT_CKEY3; + other.ckeyname3 = self.ckeyname3; + acount = BackpackText(other, self.ckeyname3, "", acount); + } + if (self.moditems & IT_CKEY4) { + other.moditems = other.moditems | IT_CKEY4; + other.ckeyname4 = self.ckeyname4; + acount = BackpackText(other, self.ckeyname4, "", acount); + } + } + + //---------------------------------------------------------------------- + // Check for Powerups if coop active + //---------------------------------------------------------------------- + if (coop > 0) { + if (self.items & IT_INVISIBILITY) { + other.items = other.items | IT_INVISIBILITY; + acount = BackpackText(other, "InvRing", "", acount); + other.invisible_finished = self.invisible_finished; + other.invisible_time = self.invisible_time; + other.invisible_sound = self.invisible_sound; + } + if (self.items & IT_SUIT) { + other.items = other.items | IT_SUIT; + acount = BackpackText(other, "EnvSuit", "", acount); + other.radsuit_finished = self.radsuit_finished; + other.rad_time = self.rad_time; + } + if (self.items & IT_QUAD) { + other.items = other.items | IT_QUAD; + acount = BackpackText(other, "QuadDam", "", acount); + other.super_damage_finished = self.super_damage_finished; + other.super_time = self.super_time; + other.super_sound = self.super_sound; + } + if (self.moditems & IT_ARTSHARP) { + other.moditems = other.moditems | IT_ARTSHARP; + acount = BackpackText(other, "ShpShoot", "", acount); + other.sharpshoot_finished = self.sharpshoot_finished; + other.sharpshoot_time = self.sharpshoot_time; + other.sharpshooter_sound = self.sharpshooter_sound; + } + if (self.moditems & IT_ARTWETSUIT) { + other.moditems = other.moditems | IT_ARTWETSUIT; + acount = BackpackText(other, "WetSuit", "", acount); + other.wetsuit_finished = self.wetsuit_finished; + other.wetsuit_time = self.wetsuit_time; + other.wetsuit_sound = self.wetsuit_sound; + } + if (self.moditems & IT_ARTPIERCE) { + other.moditems = other.moditems | IT_ARTPIERCE; + acount = BackpackText(other, "Piercer", "", acount); + other.nailpiercer_finished = self.nailpiercer_finished; + other.nailpiercer_time = self.nailpiercer_time; + other.nailpiercer_sound = self.nailpiercer_sound; + } + } + + sprint (other, " from a backpack\n"); + if (self.noise != SOUND_EMPTY) + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Check ammo limts, change to best weapon and set ammo type + bound_other_ammo (other); + if (deathmatch) other.weapon = W_BestWeapon(other); + W_SetCurrentAmmo (other); + + // Random ammo backpacks are actual items + if (self.classtype == CT_AMMORANDOM) { + // hide item and check for respawn + item_finished(); + check_item_respawn(); + } + // Temporary backpack + else remove(self); +}; + +//---------------------------------------------------------------------- +void() DropBackpack = +{ + local entity item; + + //---------------------------------------------------------------------- + // Check for player because of other items + if (self.classtype != CT_PLAYER) { + if (!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells)) + return; // nothing in it + } + + item = spawn(); + item.classtype = CT_AMMOPACK; + item.classgroup = CG_AMMOITEM; + item.classname = "item_backpack"; + item.origin = self.origin - '0 0 20'; + // No way to cache something different without adding to world.qc + // Default quake sound for backpacks dropped from monsters + item.noise = "weapons/lock4.wav"; + + //---------------------------------------------------------------------- + // Pyro Enforcers drop armor shards instead!!! + //---------------------------------------------------------------------- + if (self.classtype == CT_MONPYRO || self.classtype == CT_MONFUMIGATOR) + item.armorvalue = rint(1 + random() * self.ammo_shells); + else { + // Everything else drops ammo + item.ammo_shells = self.ammo_shells; + item.ammo_nails = self.ammo_nails; + item.ammo_rockets = self.ammo_rockets; + item.ammo_cells = self.ammo_cells; + } + + //---------------------------------------------------------------------- + // Reset backpack inventory before any test + item.items = item.moditems = item.customkey = 0; + + //---------------------------------------------------------------------- + // If player dropping backpack check for extra stuff + if (self.classtype == CT_PLAYER) { + // Copy over items for coop players to pickup + if (coop > 0) { + // Copy all items + keys + item.items = self.items; + item.moditems = self.moditems; + item.customkey = self.customkey; + // Copy current armour type + value + item.armortype = self.armortype; + item.armorvalue = self.armorvalue; + + // Copy over custom key netnames + if (self.moditems & IT_CKEY1) item.ckeyname1 = self.ckeyname1; + if (self.moditems & IT_CKEY2) item.ckeyname2 = self.ckeyname2; + if (self.moditems & IT_CKEY3) item.ckeyname3 = self.ckeyname3; + if (self.moditems & IT_CKEY4) item.ckeyname4 = self.ckeyname4; + + //---------------------------------------------------------------------- + // Copy over any powerup timers + // Cannot die with invulnerability so not checked! + if (coop_artifacts == TRUE) { + if (self.items & IT_INVISIBILITY) { + item.invisible_finished = self.invisible_finished; + item.invisible_time = self.invisible_time; + item.invisible_sound = self.invisible_sound; + } + if (self.items & IT_SUIT) { + item.radsuit_finished = self.radsuit_finished; + item.rad_time = self.rad_time; + } + if (self.items & IT_QUAD) { + item.super_damage_finished = self.super_damage_finished; + item.super_time = self.super_time; + item.super_sound = self.super_sound; + } + if (self.moditems & IT_ARTSHARP) { + item.sharpshoot_finished = self.sharpshoot_finished; + item.sharpshoot_time = self.sharpshoot_time; + item.sharpshooter_sound = self.sharpshooter_sound; + } + if (self.moditems & IT_ARTWETSUIT) { + item.wetsuit_finished = self.wetsuit_finished; + item.wetsuit_time = self.wetsuit_time; + item.wetsuit_sound = self.wetsuit_sound; + } + if (self.moditems & IT_ARTPIERCE) { + item.nailpiercer_finished = self.nailpiercer_finished; + item.nailpiercer_time = self.nailpiercer_time; + item.nailpiercer_sound = self.nailpiercer_sound; + } + } + } + //---------------------------------------------------------------------- + // Default is DM only, current weapon only + else { + // Check for any special MOD weapons + if (self.weapon == IT_AXE && self.moditems & IT_UPGRADE_AXE) + item.moditems = IT_UPGRADE_AXE; + else if (self.weapon == IT_SUPER_SHOTGUN && self.moditems & IT_UPGRADE_SSG) + item.moditems = IT_UPGRADE_SSG; + else if (self.weapon == IT_LIGHTNING && self.moditems & IT_UPGRADE_LG) + item.moditems = IT_UPGRADE_LG; + // Copy over current weapon ONLY to backpack + item.items = self.weapon; + } + } + + // Give the backpack some random toss! + item.velocity_z = 300; + item.velocity_x = -100 + (random() * 200); + item.velocity_y = -100 + (random() * 200); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + setmodel (item, MODEL_BACKPACK); + setsize (item, '-16 -16 0', '16 16 56'); + item.touch = item_touch; + item.touch2 = BackpackTouch; + + //---------------------------------------------------------------------- + // 1=green, 2=blue, 3=red, 4=golden, 5=swampy, 6=white, 7=flesh + // green=shells, blue=cells, red=rockets + //---------------------------------------------------------------------- + if (self.classtype == CT_MONDEFENDER) item.skin = 1; + else if (self.classtype == CT_MONARMYGRENADE) item.skin = 1; + else if (self.classtype == CT_MONARMYPLASMA) item.skin = 2; + else if (self.classtype == CT_MONELIMATOR) item.skin = 2; + else if (self.classtype == CT_MONCENTURION) item.skin = 2; + else if (self.classtype == CT_MONARMYROCKET) item.skin = 3; + else if (self.classtype == CT_MONPYRO) item.skin = 4; + else if (self.classtype == CT_MONFUMIGATOR) item.skin = 5; + else if (self.classtype == CT_MONENFORCER) item.skin = 7; + + // Default = remove after 2 minutes, stay if coop active + if (coop == 0) item.item_expired = time + 120; + else item.item_expired = 0; + + item.item_flrcheck = fabs(item.mins_z) + 16; + item.think = item_thinkloop; // Check floor + item.nextthink = time + 0.3; // Let backpack drop first +}; + +/*====================================================================== +/*QUAKED item_backpack (0 .5 .8) (-16 -16 0) (16 16 56) SHELLS NAILS ROCKETS CELLS RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/w_backpack.mdl"); } +Backpack with random/exact amount of ammo +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +count : random amount of ammo to give (works with spawnflags) +ammo_shells : exact amount of shells +ammo_nails : exact amount of spikes +ammo_rockets : exact amount of rockets +ammo_cells : exact amount of cells +armorvalue : armor shards (gives green armor if none present) +armortype : 1 = random amount of armor shards (uses count) +exactskin : 0=Original, 1=green, 2=blue, 3=red, 4=yellow, 5=swamp, 6=white, 7=pale +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +noise : pickup sound (def=items/backpack_ammo.wav) +respawn_time : time to wait before respawning (1-x seconds, default varies) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +SHELLS : ammo for SG / SSG / RG +NAILS : ammo for NG / SNG +ROCKETS : ammo for GL / RL +CELLS : ammo for LG +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Backpack with random/exact amount of ammo +Cannot be used to drop weapons or armour! + +======================================================================*/ +void() item_backpack_setup = +{ + // Empty netname for backpack routine + self.netname = ""; + self.origin = self.origin + '0 0 12'; + + // reset frame, weapon and armour type, but not value + self.frame = self.weapon = self.items = 0; + self.frame_override = self.frame_box = 0; + + // Make sure the ammo/armor quantites are NOT negative! + if (self.ammo_shells < 0) self.ammo_shells = 0; + if (self.ammo_nails < 0) self.ammo_nails = 0; + if (self.ammo_rockets < 0) self.ammo_rockets = 0; + if (self.ammo_cells < 0) self.ammo_cells = 0; + if (self.armorvalue < 0) self.armorvalue = 0; + + // Check if exact skin is within range + if(self.exactskin < 0 || self.exactskin > 7) self.exactskin = 0; + self.skin = self.exactskin; + + // Check for random ammo setup (uses spawnflags) + if (self.spawnflags & BACKPACK_SHELLS) self.ammo_shells = -1; + if (self.spawnflags & BACKPACK_NAILS) self.ammo_nails = -1; + if (self.spawnflags & BACKPACK_ROCKETS) self.ammo_rockets = -1; + if (self.spawnflags & BACKPACK_CELLS) self.ammo_cells = -1; + if (self.armortype == 1) self.armorvalue = -1; + + // setup random quantity (default = 5) + if (self.ammo_shells < 0 || self.ammo_nails < 0 || + self.ammo_rockets < 0 || self.ammo_cells < 0 || + self.armorvalue < 0) { + if (!self.count) self.count = 5; + } + // No random ammo required, reset count + else self.count = 0; + + // Check backpack has ammo to pickup + if (self.ammo_shells == 0 && self.ammo_nails == 0 && + self.ammo_rockets == 0 && self.ammo_cells == 0 && + self.armorvalue == 0) { + dprint("\b[BACKPACK]\b is empty, removing\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + item_start (); +}; + +//---------------------------------------------------------------------- +void() item_backpack = +{ + self.mdl = MODEL_BACKPACK; + precache_model (self.mdl); + + if (self.noise == "") self.noise = "items/backpack_ammo.wav"; + precache_sound(self.noise); + + self.classtype = CT_AMMORANDOM; + self.classgroup = CG_AMMOITEM; + self.bbmins = '-16 -16 -12'; + self.bbmaxs = '16 16 32'; + self.part_active = PARTICLE_STYLE_BACKPACK; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_BACKPACK; + self.respawn_ofs = '0 0 12'; + self.touch2 = BackpackTouch; + + // Match particle effect to skin colour + if (self.exactskin == 1) self.respawn_style = PARTICLE_BURST_GREEN; + else if (self.exactskin == 2) self.respawn_style = PARTICLE_BURST_BLUE; + else if (self.exactskin == 3) self.respawn_style = PARTICLE_BURST_RED; + else if (self.exactskin == 4) self.respawn_style = PARTICLE_BURST_YELLOW; + else if (self.exactskin == 5) self.respawn_style = PARTICLE_BURST_GREEN; + else self.respawn_style = PARTICLE_BURST_WHITE; + self.respawn_style = self.respawn_style | PARTICLE_BURST_CENTER; + + // Double checking all the different ammo combinations can be + // time consuming, delay spawn the backpack instead + self.think = item_backpack_setup; + self.nextthink = time + 0.1 + random(); +}; + +//---------------------------------------------------------------------- +void() item_backpack_armour = +{ + // Default armour amount is 15 + + if (self.noise == "") self.noise = "items/backpack_armour.wav"; + precache_sound(self.noise); + + // Check for different armour types + if (self.spawnflags & BACKPACK_GRNTYPE) { + self.armortype = ARMOR_GRN_TYPE; self.exactskin = 1; + if (self.armorvalue < 1) self.armorvalue = 15; + } + else if (self.spawnflags & BACKPACK_YELTYPE) { + self.armortype = ARMOR_YEL_TYPE; self.exactskin = 4; + if (self.armorvalue < 1) self.armorvalue = 30; + } + else if (self.spawnflags & BACKPACK_REDTYPE) { + self.armortype = ARMOR_RED_TYPE; self.exactskin = 3; + if (self.armorvalue < 1) self.armorvalue = 45; + } + // default = shards, no armour type + else { + self.armortype = 0; self.exactskin = 4; + if (self.armorvalue < 1) self.armorvalue = 15; + } + + // make sure all ammo is removed from backpack + if (self.spawnflags & BACKPACK_SHELLS) self.spawnflags = self.spawnflags - BACKPACK_SHELLS; + if (self.spawnflags & BACKPACK_NAILS) self.spawnflags = self.spawnflags - BACKPACK_NAILS; + if (self.spawnflags & BACKPACK_ROCKETS) self.spawnflags = self.spawnflags - BACKPACK_ROCKETS; + if (self.spawnflags & BACKPACK_CELLS) self.spawnflags = self.spawnflags - BACKPACK_CELLS; + + // Feed back into backpack function + item_backpack(); +}; diff --git a/QC_other/QC_arcane/lights.qc b/QC_other/QC_arcane/lights.qc new file mode 100644 index 00000000..6a2096af --- /dev/null +++ b/QC_other/QC_arcane/lights.qc @@ -0,0 +1,596 @@ +/*====================================================================== + LIGHT ENTITIES (used by compiler) +======================================================================*/ +float LIGHT_STARTOFF = 1; +float LIGHT_NOSOUND = 2; +float LIGHT_NOSTATIC = 4; +float LIGHT_FLAMEOFF = 2; +float LIGHT_CANDLESHADOW = 8; +float LIGHT_SWITCHFADE = 16; +float LIGHT_NOEFFECTS = 128; + +// To help reduce signon buffer size, allow for light entities +// to be delay spawned (especially light models like candles) +// Cannot use target key because compiler uses it for light styles +.string lighttarget; + +//---------------------------------------------------------------------- +void() play_light_sound = +{ + if (!self.owner) return; + if (self.owner.estate & ESTATE_BLOCK) return; + + self.think = play_light_sound; + self.nextthink = time + self.owner.waitmin; + sound (self, CHAN_VOICE, self.owner.noise, self.owner.volume, ATTN_STATIC); +}; + +//---------------------------------------------------------------------- +void() setup_light_sound = +{ + if (!self.volume) self.volume = 0.5; + if ( !(self.spawnflags & LIGHT_NOSOUND) && self.noise != "" ) { + if (self.targetname) { + self.attachment = spawn(); + self.attachment.owner = self; + setorigin(self.attachment, self.origin); + self.attachment.nextthink = time + 1; + self.attachment.think = play_light_sound; + } + else { + ambientsound (self.origin, self.noise, self.volume, ATTN_QUIET); + } + } +}; + +//---------------------------------------------------------------------- +void() setup_light_static = +{ + // Cannot have static entities and particle emitters! + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) return; + if ( !(self.spawnflags & LIGHT_NOSTATIC) ) makestatic (self); +}; + +//---------------------------------------------------------------------- +void(float pe_style) setup_light_particle = +{ + if (self.spawnflags & LIGHT_NOEFFECTS) return; + // Spawn particle emitter if particles active and not blocked + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES ) { + self.part_active = pe_style; + if (self.spawnflags & LIGHT_STARTOFF) self.lip = PARTICLE_START_OFF; + else self.lip = PARTICLE_START_ON; + self.part_emitter = spawn_pemitter(self, self, self.part_active, self.lip); + } +}; + +//---------------------------------------------------------------------- +void() light_part_emitter_on = +{ + if (self.part_emitter) { + if (ext_dppart && self.part_emitter.state == STATE_OFF) + pointparticles(particleeffectnum(DPP_BURSTFLAME), self.origin, '0 0 0', 1); + misc_particle_on(self.part_emitter); + } + if (self.attachment) { + self.attachment.think = play_light_sound; + self.attachment.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() light_on = +{ + self.estate = ESTATE_ON; + if (self.mdl) setmodel (self, self.mdl); + lightstyle(self.style, "m"); + light_part_emitter_on(); +}; + +//---------------------------------------------------------------------- +void() light_off = +{ + self.estate = ESTATE_OFF; + if (self.mdl) { + self.modelindex = 0; + self.model = ""; + } + lightstyle(self.style, "a"); + if (self.attachment) + sound (self.attachment, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_STATIC); +}; + +/*====================================================================== +/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF x x x x x x x +Non-displayed light +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +style : 0 = normal +1 = flicker (first variety) +2 = slow strong pulse +3 = candle (first variety) +4 = fast strobe +5 = gentle pulse +6 = flicker (second variety) +7 = candle (second variety) +8 = candle (third variety) +9 = slow strobe +10 = flourescent flicker +11 = slow pulse, not fading to black +styles 32-62 are assigned by the light program for switchable lights + +_color : Light color - R/G/B (def='1 1 1') +wait : Fade distance multiplier (def=1) +delay : Attenuation 0=Linear, 1=inverse, 2=Squared, 3=NoFalloff, 4=Minlight, 5=Good Ambient + +mangle : Spotlight direction +angle : Spotlight cone angle (def=40) + +_dirt : Dirt map (override) +_dirtscale : Dirt scale (override) +_deviance : Deviance +_samples : No. of Deviance lights (def=16) +_surface : Surface light texture name +_surface_offset : Surface light offset (def=2) +_softangle : Spotlight soft angle (def=0) +_anglescale : Light angle scale (def=0.5) +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +Non-displayed light. If targeted, it will toggle between on or off + +======================================================================*/ +void() light = +{ + // If no targetname then inert light, safe to remove + if (self.targetname == "") { + remove(self); + return; + } + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + +/*====================================================================== +/*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF NO_SOUND x x x x x x +Non-displayed light. Makes steady fluorescent humming sound +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +-------- NOTES -------- +Non-displayed light. Makes steady fluorescent humming sound + +======================================================================*/ +void() light_fluoro = +{ + self.noise = "ambience/fl_hum1.wav"; + precache_sound (self.noise); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + + setup_light_sound(); +}; + +/*====================================================================== +/*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8) x NO_SOUND x x x x x x +Non-displayed light. Makes sparking, broken fluorescent sound +-------- KEYS -------- +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +NO_SOUND : No ambient sound +-------- NOTES -------- +Non-displayed light. Makes sparking, broken fluorescent sound + +======================================================================*/ +void() light_fluorospark = +{ + self.noise = "ambience/buzz1.wav"; + precache_sound (self.noise); + + if (!self.style) self.style = 10; + setup_light_sound(); +}; + +/*====================================================================== +/*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF x NO_STATIC x x x X x +Sphere globe light (sprite) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Sphere globe light (sprite) + +======================================================================*/ +void() light_globe = +{ + self.mdl = "progs/s_light.spr"; + precache_model (self.mdl); + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +/*====================================================================== +/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF NO_SOUND NO_STATIC x x x x x +Short wall torch +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Short wall torch + +======================================================================*/ +void() light_torch_on = +{ + self.frame = 0; + self.estate = ESTATE_ON; + lightstyle(self.style, "m"); + light_part_emitter_on(); +}; + +//---------------------------------------------------------------------- +void() light_torch_off = +{ + self.frame = 1; + self.estate = ESTATE_OFF; + lightstyle(self.style, "a"); + if (self.attachment) + sound (self.attachment, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_STATIC); +}; + +//---------------------------------------------------------------------- +void() light_torch_small_walltorch = +{ + self.mdl = "progs/flame.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMET); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_torch_on; + self.estate_off = light_torch_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +/*====================================================================== +/*QUAKED light_flame_large_yellow (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF NO_SOUND NO_STATIC x x x x x +Large yellow flame +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Large yellow flame + +======================================================================*/ +void() light_flame_large_yellow = +{ + self.mdl = "progs/flame2.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + // The default length of the ambient sound used + if (!self.waitmin) self.waitmin = 2.165; + + // If DP engine active remove candle model shadow + if (engine == ENG_DPEXT) self.effects = self.effects + EF_NOSHADOW; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.frame = 1; // Switch to frame group 2 (larger flame) + if (!self.alpha) self.alpha = 0.8; + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMEL); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +/*====================================================================== +/*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF NO_SOUND NO_STATIC x x x X x +Small yellow flames +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Small yellow flames. + +======================================================================*/ +void() light_flame_small_yellow = +{ + self.mdl = "progs/flame2.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + self.part_active = PARTICLE_STYLE_FLAMES; + if (!self.waitmin) self.waitmin = 2.165; + + // If DP engine active remove candle model shadow + if (engine == ENG_DPEXT) self.effects = self.effects + EF_NOSHADOW; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + if (!self.alpha) self.alpha = 0.8; + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMES); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; +//Duplicate (small yellow flame) +void() light_flame_small_white = { light_flame_small_yellow(); }; + +/*====================================================================== +/*QUAKED light_postlight (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF x x x x x x x +light post (from Quoth) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +light post (from Quoth) +======================================================================*/ +void() light_postlight = +{ + self.mdl = "progs/misc_lightpost.mdl"; + precache_model (self.mdl); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +/*====================================================================== +/*QUAKED light_tubelight (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF x x x x x x x +light Tube (from Quoth) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +light Tube (from Quoth) +======================================================================*/ +void() light_tubelight = +{ + self.mdl = "progs/misc_lighttube.mdl"; + precache_model (self.mdl); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +/*====================================================================== +/*QUAKED light_fixture1 (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF x x x x x x x +light Fixture (from Rubicon) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +fixangle : angle the model should be facing; set it to face away from the wall +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +light Fixture (from Rubicon) +======================================================================*/ +void() light_fixture1 = +{ + self.mdl = "progs/misc_fixture1.mdl"; + precache_model (self.mdl); + self.angles_y = self.fixangle; + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +/*====================================================================== +/*QUAKED light_candle (0 1 0) (-4 -4 -16) (4 4 16) LIGHTOFF FLAMEOFF x SHADOWS x STATIC x x +Wide variety of Candles (from Rogue Software) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : 0=random angle, 1-360=specific +height : size of candle 1=short, 2=medium, 3=regular, -1=random +t_width : width of candle 1=regular, 2=fat, 3=thin, -1=random +lip : Moves model down to ground plane (default = 16) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +FLAMEOFF : The candle is displayed off (no light/flame) +SHADOW : Turn on shadows in DP engine +STATIC : Turn entity into static upon spawn (frame 0) +-------- NOTES -------- +Wide variety of Candles (from Rogue Software) + +======================================================================*/ +void() light_candle_on = +{ + self.estate = ESTATE_ON; + self.frame = 1 + (self.t_width-1)*2; + lightstyle(self.style, "m"); +}; + +//---------------------------------------------------------------------- +void() light_candle_off = +{ + self.estate = ESTATE_OFF; + self.frame = (self.t_width-1)*2; + lightstyle(self.style, "a"); +}; + +//---------------------------------------------------------------------- +void() light_candle_setup = +{ + // Setup model and no world interaction + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + // If DP engine active remove candle model shadow + if (engine == ENG_DPEXT && !(self.spawnflags & LIGHT_CANDLESHADOW)) + self.effects = self.effects + EF_NOSHADOW; + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + // Setup light + if (self.spawnflags & LIGHT_FLAMEOFF) { + self.estate = ESTATE_OFF; + self.frame = (self.t_width-1)*2; + } + + // Is switchable light style defined? + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_candle_on; + self.estate_off = light_candle_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + // Check for static option, after switchable lights + else if (self.spawnflags & ENT_SPNSTATIC) makestatic(self); +}; + +//---------------------------------------------------------------------- +void() light_candle = +{ + // Cannot have randomly selected models for prechache + // Quickload will re-run all spawn functions and try to select + // a different candle model which is not precached + precache_model ("progs/misc_candle1.mdl"); + precache_model ("progs/misc_candle2.mdl"); + precache_model ("progs/misc_candle3.mdl"); + + // Check for size 1=small, 2=medium, 3=regular (def), -1=random + if (self.height < 0) self.height = 1 + rint(random()*2); + if (self.height == 1) self.mdl = "progs/misc_candle1.mdl"; + else if (self.height == 2) self.mdl = "progs/misc_candle2.mdl"; + else self.mdl = "progs/misc_candle3.mdl"; + + // Check for width 1=regular (def), 2=fat, 3=thin, -1=random + // The models are split up into three groups of off/on + if (self.t_width < 0) self.t_width = 1 + rint(random()*2); + else if (self.t_width == 0 || self.t_width > 3) self.t_width = 1; + + self.modelindex = 0; + self.model = string_null; // hide bmodel surface + self.frame = 1 + (self.t_width-1)*2; // Def = on state + self.movetype = MOVETYPE_NONE; // Create baseline + self.solid = SOLID_NOT; + self.nextthink = 0; + + // The model should not be setup flush to floor because it is a light + // source and will look really odd, setup entity 16 units above floor + // and the "lip" key will move it back down again + if (!self.lip) self.lip = 16; + self.origin_z = self.origin_z - self.lip; + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) light_candle_setup(); + else { + // Check for spawn delay on model (signon buffer issues) + // Code left so light_candles can be switched on/off + if (self.lighttarget != "" && !self.style) { + self.targetname = self.lighttarget; + // Use the entity state system for max compatibility + self.estate = ESTATE_OFF; + self.use = entity_state_use; + self.estate_on = light_candle_setup; + } + else light_candle_setup(); + } +}; diff --git a/QC_other/QC_arcane/mathlib.qc b/QC_other/QC_arcane/mathlib.qc new file mode 100644 index 00000000..4793685f --- /dev/null +++ b/QC_other/QC_arcane/mathlib.qc @@ -0,0 +1,551 @@ +/*====================================================================== + MATHLIB STUFF + + Originally created by FrikaC + Some functions provided by Kashua & LordHavoc & Preach + +======================================================================*/ + +// for speed... +float pi = 3.14159265; +float OneEightyOverPi = 57.29577; +float PiOverOneEighty = 0.017453; + +float() crandom = { return 2*(random() - 0.5); }; + +// You can set the accuracy of mathlib by changing this value. +// If unset, it defaults to 0.001 +float mathlib_accuracy; //accuracy of sqrt & pow + +// Definition/list of all math functions +float(float num) mathlib_sqrt; +float(float num) mathlib_sin; +float(float num) mathlib_cos; +float(float a, float b) mathlib_fast_pow; +float (float number, float exp) mathlib_bitshift; +float(float a, float b) mod; +float(float v) anglemod; +float (float y1, float y2) angcomp; +float (float a, float b) mathlib_min; +float (float a, float b) mathlib_max; +float(float minimum, float val, float maximum) mathlib_bound; +vector() mathlib_randomvec; +float (float num) rad2deg; +float (float num) deg2rad; +float(float theta) mathlib_tan; +float(float y, float x) mathlib_atan2; + +/*---------------------------------------------------------------------- +Will return 0/1 if bitflag is present in bitvalue +----------------------------------------------------------------------*/ +float(float bitvalue, float bitflag) mathlib_bitvalue = +{ + return floor( (bitvalue & bitflag) / bitflag); +}; + +/*---------------------------------------------------------------------- +square root +----------------------------------------------------------------------*/ +float(float num) mathlib_sqrt = +{ + local float apr; + + //this sets a level of accuracy, it's a global float + if(mathlib_accuracy <= 0) mathlib_accuracy = 0.001; + + if (num < mathlib_accuracy) return 0; + if (num>1) apr = num; + else apr = 1; + do { + apr = (num + (apr * apr)) / (2 * apr); + } + while (fabs((apr * apr) - num) > (num * mathlib_accuracy)); + return apr; +}; + +/*---------------------------------------------------------------------- +sine +----------------------------------------------------------------------*/ +float(float num) mathlib_sin = +{ + local vector ang,vf,vu,vr; + + vf = v_forward; + vu = v_up; + vr = v_right; + + ang = '0 1 0' * num; + makevectors(ang); + num = v_forward_y; + + v_forward = vf; + v_up = vu; + v_right = vr; + + return num; +}; + +/*---------------------------------------------------------------------- +cosine +----------------------------------------------------------------------*/ +float(float num) mathlib_cos = +{ + local vector ang,vf,vu,vr; + + vf = v_forward; + vu = v_up; + vr = v_right; + + ang = '0 1 0' * num; + makevectors(ang); + num = v_forward_x; + + v_forward = vf; + v_up = vu; + v_right = vr; + + return num; +}; + +/*---------------------------------------------------------------------- +pow + +raise to a power + +you ought not use this if the power you're raising to is constant +ie, just use r * r * r for cubing, it's a lot faster +----------------------------------------------------------------------*/ +float(float a, float b) mathlib_fast_pow = +{ + local float fb, n, bit, factor; + + fb = fabs(b); + bit = 1; + n = 1; + factor = a; + while (bit <= fb) + { + if (fb&bit) + n = n * factor; + factor = factor * factor; + bit = bit * 2; + } + if (b < 0) + return 1/n; + else + return n; +}; + +float(float a, float b) mathlib_pow = +{ + local float e1,e2,f,i; + + if (mathlib_accuracy <= 0) + mathlib_accuracy = 0.001; + if (fabs(rint(b) - b) <= mathlib_accuracy) + return mathlib_fast_pow(a, rint(b)); + + f = (a - 1) / (a + 1); + //this is the first trick + //we're essentially doing exp(b*log(a)) + //but the power series for log (1+x) is only defined for small x + //however log x = 2 * arctanh((x-1)/(x+1)) which will converge for any x we choose + + e1 = 0; + e2 = 2 * f; + i = 1; + f = f * f; + + // this calculates successive terms of arctanh + //when the absolute value of a term drops + //below accuracy we call it a day + //note that this doesn't actually mean + //the output is accurate to 0.001, there's no + //direct bound on accuracy + while(fabs(e2) > mathlib_accuracy) + { + e1 = e1 + e2; + e2 = e2 * f * ((2 * i) - 1) / ((2 * i) + 1); + i = i + 1; + } + + f = e2 = e1 * b; + e1 = 1; + i = 1; + //same idea, this is the exponential function + //which has a nice power series + //same comments about accuracy apply, except + //the rapid decay of terms mean it's probably + //close to the true value of exp f, if not pow(a,b) + while(fabs(e2) > mathlib_accuracy) + { + e1 = e1 + e2; + i = i + 1; + e2 = e2 * f / i; + } + return e1; +} ; + +/*---------------------------------------------------------------------- +Bitshift +----------------------------------------------------------------------*/ +float (float number, float exp) mathlib_bitshift = +{ + local float bit, fexp; + bit = 1; + fexp = fabs(exp); + number = rint(number); + + while (bit <= fexp) { + if (fexp & bit) { + if (exp > 0) number = number * bit * 2; + else number = floor(number / (bit * 2)); + } + bit = bit * 2; + } + return number; +}; +/*---------------------------------------------------------------------- +Remainder + +Similar to C's % operator, but deals with +negative numbers differently. +----------------------------------------------------------------------*/ +float(float a, float b) mod = +{ + return a - (floor(a / b) * b); +}; + +/*---------------------------------------------------------------------- +mathlib_anglemod + +faster version of id's anglemod +----------------------------------------------------------------------*/ +float(float v) anglemod = +{ + return v - floor(v/360) * 360; +}; + +//---------------------------------------------------------------------- +// Original version from ai.qc +/*float(float v) anglemod = +{ + while (v >= 360) + v = v - 360; + while (v < 0) + v = v + 360; + return v; +}; +*/ + +/*---------------------------------------------------------------------- +angcomp (part of FrikBot) + +subtracts one angle from another +----------------------------------------------------------------------*/ +float (float y1, float y2) angcomp = +{ + y1 = anglemod(y1); + y2 = anglemod(y2); + + local float answer; + answer = y1 - y2; + if (answer > 180) + answer = answer - 360; + else if (answer < -180) + answer = answer + 360; + return answer; +}; + +/*---------------------------------------------------------------------- +min +Returns the lesser of two (or more) numbers +----------------------------------------------------------------------*/ +float (float a, float b) mathlib_min = +{ + if (a<b) + return a; + else + return b; +}; + +float (float a, float b, float c) mathlib_min3 = +{ + if (a<b) + { + if (c<a) + return c; + else + return a; + } + else + { + if (c<b) + return c; + else + return b; + } +}; + +float (float a, float b, float c, float d) mathlib_min4 = +{ + return mathlib_min(mathlib_min3(a,b,c),d); +}; +float (float a, float b, float c, float d, float e) mathlib_min5 = +{ + return mathlib_min3(mathlib_min3(a,b,c),d,e); +}; +float (float a, float b, float c, float d, float e, float f) mathlib_min6 = +{ + return mathlib_min(mathlib_min3(a,b,c), mathlib_min3(d,e,f)); +}; +float (float a, float b, float c, float d, float e, float f, float g) mathlib_min7 = +{ + return mathlib_min3(mathlib_min3(a,b,c), mathlib_min3(d,e,f), g); +}; +float (float a, float b, float c, float d, float e, float f, float g, float h) mathlib_min8 = +{ + return mathlib_min3(mathlib_min3(a,b,c), mathlib_min3(d,e,f), mathlib_min(g, h)); +}; + +/*---------------------------------------------------------------------- +max +Returns the greater of two (or more) numbers +----------------------------------------------------------------------*/ +float (float a, float b) mathlib_max = +{ + if (a>b) + return a; + else + return b; +}; +float (float a, float b, float c) mathlib_max3 = +{ + if (a>b) + { + if (c>a) + return c; + else + return a; + } + else + { + if (c>b) + return c; + else + return b; + } +}; +float (float a, float b, float c, float d) mathlib_max4 = +{ + return mathlib_max(mathlib_max3(a,b,c),d); +}; +float (float a, float b, float c, float d, float e) mathlib_max5 = +{ + return mathlib_max3(mathlib_max3(a,b,c),d,e); +}; +float (float a, float b, float c, float d, float e, float f) mathlib_max6 = +{ + return mathlib_max(mathlib_max3(a,b,c), mathlib_max3(d,e,f)); +}; +float (float a, float b, float c, float d, float e, float f, float g) mathlib_max7 = +{ + return mathlib_max3(mathlib_max3(a,b,c), mathlib_max3(d,e,f), g); +}; +float (float a, float b, float c, float d, float e, float f, float g, float h) mathlib_max8 = +{ + return mathlib_max3(mathlib_max3(a,b,c), mathlib_max3(d,e,f), mathlib_max(g, h)); +}; + +/*---------------------------------------------------------------------- +bound +Returns a number bound to certain limits +----------------------------------------------------------------------*/ +float(float minimum, float val, float maximum) mathlib_bound = +{ + if (val<minimum) + val=minimum; + else if (val>minimum) + val=maximum; + return val; +}; + +/*---------------------------------------------------------------------- +randomvec +Returns a random vector of length < 1 +----------------------------------------------------------------------*/ +vector () mathlib_randomvec = +{ + local vector v; + do + { + v_x = random() * 2 - 1; + v_y = random() * 2 - 1; + v_z = random() * 2 - 1; + } + while(vlen(v) > 1); + return v; +}; + +/*---------------------------------------------------------------------- +Radians <--> Degrees + +Simple functions that convert radians to +degrees. +----------------------------------------------------------------------*/ +float (float num) rad2deg = { return num*OneEightyOverPi; }; +float (float num) deg2rad = { return num*PiOverOneEighty; }; + +/*---------------------------------------------------------------------- +TAN +Changes v_forward, v_right, v_up +----------------------------------------------------------------------*/ +float(float theta) mathlib_tan = +{ + local vector ang; //temporary used to calculate trig values + ang = '0 0 0'; + ang_y = theta; //assign theta to the yaw to simplify reasoning + makevectors(ang); + return v_forward_y / v_forward_x; +}; + +/*---------------------------------------------------------------------- +Inverse TAN +----------------------------------------------------------------------*/ +float(float y, float x) mathlib_atan2 = +{ + local vector ang; //temporary used to calculate trig values + ang = '0 0 0'; + ang_x = x; + ang_y = y; + return vectoyaw(ang); +}; + +/* ********************************************************* + +!!!FTEQCC or FrikQCC only code follows !!! + +This code allows the engine to accelerate math functions + +If not needed, you can simply delete the rest of the file +and call the mathlib functions above directly. + +It checks for the extensions DP_QC_MINMAXBOUND, +DP_QC_RANDOMVEC, DP_QC_SINCOSSQRTPOW, EXT_BITSHIFT + +********************************************************* */ +/* +var float (float num) sqrt; +var float (float num) sin; +var float (float num) cos; +var float (float num, float exp) pow; +var float (float number, float exp) bitshift; +var float (float a, float b) min; +var float (float a, float b, float c) min3; +var float (float a, float b, float c, float d) min4; +var float (float a, float b, float c, float d, float e) min5; +var float (float a, float b, float c, float d, float e, float f) min6; +var float (float a, float b, float c, float d, float e, float f, float g) min7; +var float (float a, float b, float c, float d, float e, float f, float g, float h) min8; +var float (float a, float b) max; +var float (float a, float b, float c) max3; +var float (float a, float b, float c, float d) max4; +var float (float a, float b, float c, float d, float e) max5; +var float (float a, float b, float c, float d, float e, float f) max6; +var float (float a, float b, float c, float d, float e, float f, float g) max7; +var float (float a, float b, float c, float d, float e, float f, float g, float h) max8; +var float (float minimum, float val, float maximum) bound; +var vector() randomvec; + +float(float val) ext_sin = #60; +float(float val) ext_cos = #61; +float(float val) ext_sqrt = #62; +vector() ext_randomvec = #91; +float(float a, float b) ext_min = #94; +float(float a, float b, float c) ext_min3 = #94; +float(float a, float b, float c, float d) ext_min4 = #94; +float(float a, float b, float c, float d, float e) ext_min5 = #94; +float(float a, float b, float c, float d, float e, float f) ext_min6 = #94; +float(float a, float b, float c, float d, float e, float f, float g) ext_min7 = #94; +float(float a, float b, float c, float d, float e, float f, float g, float h) ext_min8 = #94; +float(float a, float b) ext_max = #95; +float(float a, float b, float c) ext_max3 = #95; +float(float a, float b, float c, float d) ext_max4 = #95; +float(float a, float b, float c, float d, float e) ext_max5 = #95; +float(float a, float b, float c, float d, float e, float f) ext_max6 = #95; +float(float a, float b, float c, float d, float e, float f, float g) ext_max7 = #95; +float(float a, float b, float c, float d, float e, float f, float g, float h) ext_max8 = #95; +float(float minimum, float val, float maximum) ext_bound = #96; +float(float a, float b) ext_pow = #97; +float(float number, float quantity) ext_bitshift = #218; + +// This is DP extension, may need to comment out if already defined. +float(string s) checkextension = #99; + +// The engine sin/cos builtins use radians rather than degrees. This is less useful, so convert +float(float val) wrap_sin = { return ext_sin(val*PiOverOneEighty); }; +float(float val) wrap_cos = { return ext_cos(val*PiOverOneEighty); }; + +// this must be called in worldspawn before using any above functions +void () MathlibCheckBuiltins = +{ + local float checkext; + + sqrt = mathlib_sqrt; + cos = mathlib_cos; + sin = mathlib_sin; + pow = mathlib_pow; + randomvec = mathlib_randomvec; + min = mathlib_min; + min3 = mathlib_min3; + min4 = mathlib_min4; + min5 = mathlib_min5; + min6 = mathlib_min6; + min7 = mathlib_min7; + min8 = mathlib_min8; + max = mathlib_max; + max3 = mathlib_max3; + max4 = mathlib_max4; + max5 = mathlib_max5; + max6 = mathlib_max6; + max7 = mathlib_max7; + max8 = mathlib_max8; + bound = mathlib_bound; + bitshift = mathlib_bitshift; + checkext = cvar("pr_checkextension"); + if (checkext) + { + if (checkextension("DP_QC_SINCOSSQRTPOW")) + { + sqrt = ext_sqrt; + cos = wrap_cos; + sin = wrap_sin; + pow = ext_pow; + } + + if (checkextension("DP_QC_RANDOMVEC")) + randomvec = ext_randomvec; + if (checkextension("DP_QC_MINMAXBOUND")) + { + min = ext_min; + min3 = ext_min3; + min4 = ext_min4; + min5 = ext_min5; + min6 = ext_min6; + min7 = ext_min7; + min8 = ext_min8; + max = ext_max; + max3 = ext_max3; + max4 = ext_max4; + max5 = ext_max5; + max6 = ext_max6; + max7 = ext_max7; + max8 = ext_max8; + bound = ext_bound; + } + if (checkextension("EXT_BITSHIFT")) + bitshift = ext_bitshift; + } +}; +*/ + diff --git a/QC_other/QC_arcane/misc.qc b/QC_other/QC_arcane/misc.qc new file mode 100644 index 00000000..513131d6 --- /dev/null +++ b/QC_other/QC_arcane/misc.qc @@ -0,0 +1,1747 @@ +/*====================================================================== + MISC ENTITIES +======================================================================*/ +float MISC_STARTOFF = 1; // Start OFF (use DELAY instead!) + +float MISC_FBALLSLIME = 32; // Slime green fire ball +float MISC_DRIPSILENT = 2; // misc_drip has no sound on splash +float MISC_DRIPBLOOD = 16; // blood red drips +float MISC_DRIPSLIME = 32; // slime green drips +float MISC_SMOKENODPMDL = 2; // Do not draw smoke model in DP +float MISC_SMOKENODPFX = 4; // Do not produce any DP smoke effects +float MISC_SMOKENOQSMDL = 8; // Do not draw smoke model in QS +float MISC_SPARKBLUE = 2; // misc_spark produces Blue sparks +float MISC_SPARKPALE = 4; // misc_spark produces Pale Yellow sparks +float MISC_SPARKRED = 8; // misc_spark produces Red sparks +float MISC_COLLISION = 2; // misc_model has collision enabled +float MISC_MOVEMENT = 4; // misc_model can be moved around +float MISC_SHAKEVIEWONLY = 2; // No velocity movement + +float MISC_EXPLBOX_MAX = 5; // Maximum amount of skins available + +/*====================================================================== +/*QUAKED misc_explobox (0 0.5 0.8) (-16 -16 0) (16 16 64) x x x x x FLOAT STARTOFF +{ model(":progs/explode_box1.mdl"); } +Large exploding box +-------- KEYS -------- +target : trigger events when box explodes +skin_override : 0=original, 1=rubicon2, 3=plasma, 4=toxic, 5-6=wood +noise : Explosion sound (def=weapons/r_exp3.wav) +health : Amount of health before exploding (def=15) +dmg : Override radius damage (def=160) +-------- SPAWNFLAGS -------- +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Large exploding box + +/*QUAKED misc_explobox2 (0 0.5 0.8) (-16 -16 0) (16 16 32) x x x x x FLOAT STARTOFF +{ model(":progs/explode_box2.mdl"); } +Small exploding box +-------- KEYS -------- +target : trigger events when box explodes +skin_override : 0=original, 1=rubicon2, 3=plasma, 4=toxic, 5-6=wood +noise : Explosion sound (def=weapons/r_exp3.wav) +health : Amount of health before exploding (def=15) +dmg : Override radius damage (def=160) +-------- SPAWNFLAGS -------- +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Small exploding box + +/*QUAKED func_explobox (0 0.5 0.8) ? x x x x x x STARTOFF x +Exploding box (bmodel) +-------- KEYS -------- +target : trigger events when box explodes +noise : Explosion sound (def=weapons/r_exp3.wav) +health : Amount of health before exploding (def=15) +dmg : Override radius damage (def=160) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Exploding box (bmodel) + +======================================================================*/ + +// Animate model skin slowly = 0.3s +//---------------------------------------------------------------------- +void() misc_ebox_0 = [0, misc_ebox_0] { + if (self.attack_finished < time) { + self.lefty = 1 - self.lefty; + self.skin = self.lefty + (self.skin_override * 2); + self.nextthink = time + MODEL_ANIM_SPEED; + } +}; + +//---------------------------------------------------------------------- +void() misc_explod_delay = +{ + // Explosive damage and sound+fx + T_RadiusDamage (self, self, self.dmg, world, DAMAGEALL); + + // Particle explosion drifting upward + particle_explode(self.origin, 50+random()*50, 1, self.part_style, PARTICLE_BURST_UPWARD); + + // Play original explosion sound + sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + // Special type (hard-coded) of particle explosion + // that only works if particle count=255 :) + particle (self.origin, '0 0 0', 0, 255); + + // Check for any explosion triggers + if (self.target != "") trigger_strs(self.target, other); + + self.origin = self.origin + '0 0 32'; + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + entity_hide(self); +}; + +// Blow up the box +//---------------------------------------------------------------------- +void() misc_explod_fire = +{ + local entity ent_explode; + + if (self.attack_finished > time) return; + self.attack_finished = time + LARGE_TIMER; + + // Save origin for later + if (self.bsporigin) self.oldorigin = bmodel_origin(self); + else self.oldorigin = self.origin; + + // Switch off everything + self.estate_off(); + + // Stop recursive loops with T_RadiusDamage + // Delay each explosion so its not all at once + // Spawn the explosion/dmg/fx as a new entity + // func_explode does not want to set correct origin + ent_explode = spawn(); + setorigin(ent_explode, self.oldorigin); + ent_explode.noise = self.noise; + ent_explode.dmg = self.dmg; + ent_explode.think = misc_explod_delay; + ent_explode.nextthink = 0.01 + random()*0.1; +}; + +//---------------------------------------------------------------------- +void() misc_explobox_use = +{ + // If box is setup off, switch on first + if (self.spawnflags & ENT_STARTOFF) { + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.estate_on(); + } + // No toggle function, just blow it up! + else misc_explod_fire(); +}; + +//---------------------------------------------------------------------- +void() misc_explobox_on = +{ + // If the box has exploded, do nothing + if (self.attack_finished > time) return; + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + self.estate = ESTATE_ON; + if (self.bsporigin) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + } + else { + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_NONE; + } + setmodel (self, self.mdl); + self.skin = self.skin_override*2; + setsize(self, self.bbmins, self.bbmaxs); + + self.th_die = misc_explod_fire; + self.takedamage = DAMAGE_AIM; + + self.nextthink = time + 0.1; + self.think = misc_ebox_0; +}; + +//---------------------------------------------------------------------- +void() misc_explobox_off = +{ + self.estate = ESTATE_OFF; + self.solid = SOLID_NOT; + self.modelindex = 0; // Make sure no model + self.model = ""; // hide model + self.takedamage = DAMAGE_NO; + self.th_die = SUB_Null; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() misc_explobox_setup = +{ + if (self.noise == "") self.noise = SOUND_REXP3; + precache_sound (self.noise); + + self.classtype = CT_EXPLO_BOX; + self.classgroup = CG_MISCENT; + if (self.health < 1) self.health = 15; // ID def = 20 + if (!self.dmg) self.dmg = 160; + // Check and setup default box skin + // 0=Original, 1=rubicon2, 3=plasma, 4=toxic + if (self.skin_override < 1 || self.skin_override > MISC_EXPLBOX_MAX) + self.skin_override = 0; + + // Setup particle explosion colour + if (self.skin_override == 2) self.part_style = PARTICLE_BURST_BLUE; + else if (self.skin_override == 3) self.part_style = PARTICLE_BURST_GREEN; + else self.part_style = PARTICLE_BURST_WHITE; + + // Setup exploding model + if (self.bsporigin) { + self.mdl = self.model; // Save model for later + setmodel (self, self.mdl); // set size and link into world + self.bbmins = self.mins; // Save bmodel bounds for later + self.bbmaxs = self.maxs; + } + else { + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + // Move the new centered exploding models to match old box origin + // The default is to move all boxes to suit original id maps + if (!query_configflag(SVR_ITEMOFFSET)) { + self.oldorigin = self.origin + '16 16 0'; + setorigin(self, self.oldorigin); + } + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + // Temporarily enable model/bbox for collision test + // Finalize box location (check drop to floor) + if( !(self.spawnflags & ITEM_FLOATING) ) { + setmodel (self, self.mdl); + setsize(self, self.bbmins, self.bbmaxs); + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_TOSS; + self.origin_z = self.origin_z + 6; + droptofloor(); + if (pointcontents(self.origin) == CONTENT_SOLID) { + dprint ("\n\b[ExplBox]\b "); dprint (self.classname); + dprint (" stuck at ("); dprint (vtos(self.origin)); dprint (")\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_explobox_on; + self.estate_off = misc_explobox_off; + self.estate_use = misc_explobox_use; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() misc_explobox = +{ + self.mdl = "progs/explode_box1.mdl"; // maps/b_explob.bsp + precache_model (self.mdl); + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 64'; + misc_explobox_setup(); +}; + +void() misc_explobox2 = +{ + self.mdl = "progs/explode_box2.mdl"; // maps/b_explob2.bsp + precache_model (self.mdl); + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 32'; + misc_explobox_setup(); +}; + +//---------------------------------------------------------------------- +void () func_explobox = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.mdl = self.model; // Brushwork version + self.bsporigin = TRUE; // bmodel object + self.angles = '0 0 0'; // Make sure no angle twist + // Cannot be setup floating (always remove flag) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_FLOATING); + misc_explobox_setup(); +}; + +//====================================================================== +/*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8) x x x x x SLIME STARTOFF x +Lava Balls, with damage on impact +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +speed : vertical speed (default 1000) +dmg : impact damage (default 5) +delay : base time between spawning fireballs (default 3) +wait : random time default 5 (= time + self.delay + (random() x self.wait) ) +-------- SPAWNFLAGS -------- +SLIME : Green slime version (smoke trail) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Lava Balls, with damage on impact +*/ +//====================================================================== +void() misc_lavaball_fly; +void() misc_lavaball_reset = +{ + self.touch = SUB_Null; + self.flags = 0; + self.modelindex = 0; // Make sure no model + self.model = ""; // Hide model + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity = self.avelocity = '0 0 0'; + self.nextthink = time + self.delay + (random() * self.wait); + self.think = misc_lavaball_fly; +}; + +//---------------------------------------------------------------------- +void() misc_lavaball_touch = +{ + self.touch = SUB_Null; + if (other.takedamage) T_Damage (other, self, self, self.dmg, DAMARMOR); + misc_lavaball_reset(); +}; + +//---------------------------------------------------------------------- +void() misc_lavaball_fly = +{ + if (self.estate & ESTATE_BLOCK) return; + + setmodel (self, self.mdl); + setorigin (self, self.oldorigin); + // Remove all fly/onground flags + self.flags = 0; + + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_TOSS; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + self.velocity_x = (random() * 100) - 50; + self.velocity_y = (random() * 100) - 50; + self.velocity_z = self.speed + (random() * 200); + + self.nextthink = time + 5; + self.think = misc_lavaball_reset; + self.touch = misc_lavaball_touch; +}; + +//---------------------------------------------------------------------- +void() misc_lavaball_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + self.delay + (random() * self.wait); + self.think = misc_lavaball_fly; +}; + +//---------------------------------------------------------------------- +void() misc_fireball = +{ + if (self.spawnflags & MISC_FBALLSLIME) self.mdl = MODEL_PROJ_SLIME; + else self.mdl = MODEL_PROJ_LAVA; + precache_model (self.mdl); + self.classtype = CT_FIREBALL; + self.classgroup = CG_MISCENT; + self.oldorigin = self.origin; + if (self.speed <= 0) self.speed = 1000; + if (self.dmg <= 0) self.dmg = 20; + if (self.wait <= 0) self.wait = 5; + if (self.delay <= 0) self.delay = 3; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_lavaball_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +/*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x +sprite based bubble that floats upward +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +style : 1-15 (grey,brown1,blue1,green1,red1,brown2,pinkyel,brown3,purp1,purp2,brown4,green2,yellow,blue2,red2) +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +sprite based bubble that floats upward + +======================================================================*/ +void() misc_bubble_bob; +void() misc_bubble_remove = +{ + if (other.classtype == self.classtype) return; + remove(self); +}; + +//---------------------------------------------------------------------- +void() misc_bubble_split = +{ + local entity bubble; + + bubble = spawn(); + bubble.classname = self.classname; + bubble.classtype = CT_BUBBLE; + bubble.classgroup = CG_TEMPENT; + setmodel (bubble, self.mdl); + setorigin (bubble, self.origin); + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_NOT; + bubble.velocity = self.velocity; + bubble.nextthink = time + 0.5; + bubble.think = misc_bubble_bob; + bubble.touch = misc_bubble_remove; + + bubble.frame = 1; + bubble.cnt = 10; + setsize (bubble, '-8 -8 -8', '8 8 8'); + + self.frame = 1; // Smaller bubble + self.cnt = 10; + if (self.waterlevel != 3) remove (self); +}; + +//---------------------------------------------------------------------- +void() misc_bubble_bob = +{ + local float rnd1, rnd2, rnd3; + + self.cnt = self.cnt + 1; + if (self.cnt == 4) misc_bubble_split(); + if (self.cnt == 20) { remove(self); return; } + + rnd1 = self.velocity_x + (-10 + (random() * 20)); + rnd2 = self.velocity_y + (-10 + (random() * 20)); + rnd3 = self.velocity_z + 10 + random() * 10; + + if (rnd1 > 10) rnd1 = 5; + if (rnd1 < -10) rnd1 = -5; + + if (rnd2 > 10) rnd2 = 5; + if (rnd2 < -10) rnd2 = -5; + + if (rnd3 < 10) rnd3 = 15; + if (rnd3 > 30) rnd3 = 25; + + self.velocity_x = rnd1; + self.velocity_y = rnd2; + self.velocity_z = rnd3; + + self.nextthink = time + 0.5; + self.think = misc_bubble_bob; +}; + +//---------------------------------------------------------------------- +void() misc_bubble_spawn = +{ + local entity bubble; + if (self.estate & ESTATE_BLOCK) return; + + bubble = spawn(); + bubble.classname = self.classname; + bubble.classtype = CT_BUBBLE; + bubble.classgroup = CG_TEMPENT; + bubble.owner = self; + setmodel (bubble, self.mdl); + setorigin (bubble, self.origin); + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_NOT; + bubble.velocity = '0 0 15'; + bubble.nextthink = time + 0.5; + bubble.think = misc_bubble_bob; + bubble.touch = misc_bubble_remove; + + bubble.frame = bubble.cnt = 0; + setsize (bubble, '-8 -8 -8', '8 8 8'); + self.nextthink = time + random() + 0.5; + self.think = misc_bubble_spawn; +}; + +// Map hack entry point +void() make_bubbles = { + self.mdl = SBUBBLE_DROWN; + misc_bubble_spawn(); +}; + +//---------------------------------------------------------------------- +void() misc_bubble_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + 1 + random(); + self.think = misc_bubble_spawn; +}; + +//---------------------------------------------------------------------- +void() air_bubbles = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = SBUBBLE_DROWN; + precache_model (self.mdl); + + // Allow for custom bubble sprites + if (self.style > 0) trigger_setup_bubbles(); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_bubble_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +/*============================================================================= + FX drips (based on code from RRP by ijed) + - Rewritten to not keep spawning endless entities + - Modified to have on/off/toggle state + +/*QUAKED misc_drip (0 .5 .8) (-8 -8 -8) (8 8 8) x SILENT x x BLOOD SLIME STARTOFF x +Falling water drip with splash and sound +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +wait : random time between drips (=random() + self.wait) +-------- SPAWNFLAGS -------- +BLOOD : Blood red drips +SLIME : Slime green drips +SILENT : Don't make any drip sound (good for multiple drips) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Falling water drip with splash and sound + +=============================================================================*/ +void() misc_drip_spawn; +void() misc_drip_reset = +{ + self.touch = SUB_Null; + self.frame = self.flags = 0; + setmodel (self, ""); + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity = self.avelocity = '0 0 0'; + self.nextthink = time + random() + self.wait; + self.think = misc_drip_spawn; +}; + +//---------------------------------------------------------------------- +// splash animation (runs at 20fps) +void() s_splash1 = [0, s_splash2] {self.nextthink = time+0.05;}; +void() s_splash2 = [1, s_splash3] {self.nextthink = time+0.05;}; +void() s_splash3 = [2, s_splash4] {self.nextthink = time+0.05;}; +void() s_splash4 = [3, s_splash5] {self.nextthink = time+0.05;}; +void() s_splash5 = [4, s_splash6] {self.nextthink = time+0.05;}; +void() s_splash6 = [5, misc_drip_reset] {self.nextthink = time+0.05;}; + +//---------------------------------------------------------------------- +void() misc_drip_touch = +{ + self.touch = SUB_Null; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + // If water below, shift origin to water surface + if (self.cnt) self.origin = self.pos1; + setorigin(self, self.origin + '0 0 12'); + + // play a random drip sound + if (!(self.spawnflags & MISC_DRIPSILENT)) { + self.lip = random() * 3; + if (self.lip < 1) sound (self, CHAN_AUTO, self.noise1, 1, ATTN_STATIC); + else if (self.lip < 2) sound (self, CHAN_AUTO, self.noise2, 1, ATTN_STATIC); + else sound (self, CHAN_AUTO, self.noise3, 1, ATTN_STATIC); + } + + // small particle effect when hitting something + particle (self.origin+'0 0 1', '0 0 0.5', self.aflag+random()*4, 5+random()*5); + // Switch to splash sprite and animate for 5 frames + setmodel (self, self.headmdl); + s_splash1(); +}; + +//---------------------------------------------------------------------- +// Keep checking while falling for liquid impact +//---------------------------------------------------------------------- +void() misc_drip_water = +{ + if (self.attack_finished < time) misc_drip_reset(); + // Extremely simplified water surface check (pre-calculated) + if (self.origin_z < self.pos1_z) misc_drip_touch(); + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Setup new drip and wait for touch/death/water +//---------------------------------------------------------------------- +void() misc_drip_spawn = +{ + // Is the entity OFF or BLOCKED? + if (self.estate & ESTATE_BLOCK) return; + + // make sure player distance check is available + if (!self.enemy) self.enemy = find(world, classname, "player"); + if ( !(self.enemy.flags & FL_CLIENT) ) { + self.nextthink = time + 0.1; + self.think = misc_drip_spawn; + return; + } + + // Is the misc_drip close to the player? + if (range_distance(self.enemy, TRUE) > self.wakeup_dist) { + self.nextthink = time + random() + self.wait; + self.think = misc_drip_spawn; + return; + } + + // Move drip to start position and setup sprite + setorigin (self, self.oldorigin); + setmodel (self, self.mdl); + self.solid = SOLID_TRIGGER; + if (self.cnt) self.movetype = MOVETYPE_NOCLIP; + else self.movetype = MOVETYPE_FLY; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity_z = -map_gravity; + + // Drip only lasts 3s, don't want to travel forever + self.think = misc_drip_reset; + self.nextthink = time + 3; + self.touch = misc_drip_touch; + + // Is there any water underneath drip? + if (self.cnt) { + self.attack_finished = self.nextthink; + self.nextthink = time + 0.1; + self.think = misc_drip_water; + } +}; + +//---------------------------------------------------------------------- +void() misc_drip_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + random() + self.wait; + self.think = misc_drip_spawn; +}; + +//---------------------------------------------------------------------- +void() misc_drip = +{ + // Pick type of drip sprite based on spawnflags + if (self.spawnflags & MISC_DRIPBLOOD) { + self.mdl = SBLOOD_DRIP; + self.headmdl = SBLOOD_SPLASH; + self.aflag = 64; + } + else if (self.spawnflags & MISC_DRIPSLIME) { + self.mdl = SSLIME_DRIP; + self.headmdl = SSLIME_SPLASH; + self.aflag = 48; + } + else { + self.mdl = SWATER_DRIP; + self.headmdl = SWATER_SPLASH; + self.aflag = 0; + } + // Default cache - water + precache_model (self.mdl); + precache_model (self.headmdl); + + self.noise1 = "misc/drip1.wav"; + self.noise2 = "misc/drip2.wav"; + self.noise3 = "misc/drip3.wav"; + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + // default frequency to 3 seconds + if (self.wait <= 0) self.wait = 3; + // No point dripping if no drippy player around! + if (self.wakeup_dist <= 0) self.wakeup_dist = 1024; + + self.classtype = CT_MISCDRIP; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + + // Check point content for wierd setups (inside liquids/solids) + self.height = pointcontents(self.origin); + if (self.height < CONTENT_SOLID) { + dprint ("\b[MISCDRIP]\b Spawned inside liquid!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // If flush against a ceiling, move slightly down + else if (self.height == CONTENT_SOLID) { + self.origin_z = self.origin_z - 2; + } + + // Setup drip particle in the correct start location + self.oldorigin = self.origin; + setorigin(self, self.origin); + + // Find out bottom (world) position first + self.pos1 = self.origin; + traceline (self.pos1, self.pos1 + '0 0 -4096', TRUE, self); + self.pos2 = trace_endpos; + + // Only do loop test if water exists below + self.count = 8; + if (trace_inwater) self.cnt = TRUE; + else self.count = 0; + + // Binary divide the distance to find water surface + while (self.count > 0) { + // Break out early from loop if <8 from water surface + if (fabs(self.pos2_z-self.pos1_z) < 8) self.count = 0; + // Calculate midway point between origin and endtrace + self.pos3 = self.pos1; + self.pos3_z = self.pos1_z + ((self.pos2_z - self.pos1_z)*0.5); + + // Test which half has water and shift top/bottom positions + traceline (self.pos1, self.pos3, TRUE, self); + if (trace_inwater) self.pos2 = self.pos3; + else self.pos1 = self.pos3; + // Only loop a limited amount of times + self.count = self.count - 1; + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_drip_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +// Re-direct to correct entity name +void() fx_drip = { misc_drip(); }; + +//====================================================================== +/*QUAKED misc_steam (.5 .5 .75) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x +Steam/Smoke particles +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angles : 'pitch roll yaw' up/down, angle, tilt left/right +wait : time between generation of smoke particles (def=0.1, min=0.01) +delay : random amount of time delay ( time = wait + delay x random() ) +height : Percentage of velocity distance travelled (def=1, range=0-1+) +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Steam/Smoke particles + +======================================================================*/ + + + +//====================================================================== +/*QUAKED misc_smoke (.5 .5 .75) (-8 -8 -8) (8 8 192) x NODPMDL NODPFX NOQSMDL x x STARTOFF x +Smoke model (+DP only smoke effect) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angles : 'pitch roll yaw' up/down, angle, tilt left/right +exactskin : 0=Gunsmoke, 1=Soot, 2=Steam, 3=Toxin, 4=Plague, 5=Incense, 6=Lithium, 7=Flames +alpha : alpha value for model (def=0.65) +wait : time between generation of smoke particles (def=0.1, min=0.01) +delay : random amount of time delay ( time = wait + delay x random() ) +height : Percentage of velocity distance travelled (def=1, range=0-1+) +-------- SPAWNFLAGS -------- +NODPMDL : Do not draw smoke model in DP engine +NODPFX : Do not draw DP smoke particle effect +NOQSMDL : Do not draw smoke model in QS/Fitz engines +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Smoke model, +DP only smoke effect (wait/delay/height DP only) + +======================================================================*/ +void() misc_smoke_model = +{ + self.count = self.count + 1; + if (self.count > 59) self.count = 0; + self.frame = self.count; + self.think = misc_smoke_model; + self.nextthink = time + 0.1; +}; + +void() misc_smoke_on = +{ + self.estate = ESTATE_ON; + + // Switch on particle emitter if was setup + if (self.part_emitter) misc_particle_on(self.part_emitter); + + // Restore model/size/skin + if (self.mdl != "") { + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.skin = self.exactskin; + self.count = rint(random()*59); + misc_smoke_model(); + } +}; + +//---------------------------------------------------------------------- +void() misc_smoke_off = +{ + self.estate = ESTATE_OFF; + // Turn off model if setup + if (self.mdl != "") { + self.modelindex = 0; // Make sure no model + self.model = ""; // Hide model + } +}; + +//---------------------------------------------------------------------- +void() misc_smoke_setup = +{ + // If target is setup, calculate new facing angle + if (self.target != "") { + if (!self.movetarget) + self.movetarget = find(world, targetname, self.target); + + if (self.movetarget) { + // Check for a Bmodel object (special origin) + if (self.movetarget.bsporigin) self.dest1 = bmodel_origin(self.movetarget); + else self.dest1 = self.movetarget.origin; + // Calculate facing angle towards target + self.movedir = normalize(self.dest1 - self.origin); + self.angles = vectoangles(self.movedir); + self.angles_y = self.angles_y + 180; + // Update velocity direction for DP effect + if (self.part_emitter) self.part_emitter.dpp_vel = self.movedir*self.height; + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_smoke_on; + self.estate_off = misc_smoke_off; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +//---------------------------------------------------------------------- +void() misc_smoke = +{ + self.mdl = "progs/misc_smoke.mdl"; + precache_model (self.mdl); + + self.classtype = CT_MISCSMOKE; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (!self.exactskin) self.exactskin = 0; // Default = 0 + if (self.wait < 0.1) self.wait = 0.1; + if (self.delay <= 0) self.delay = 0.1; + if (self.height <= 0) self.height = 0.5 + random()*0.5; + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) { + // Originally had ef_additive but produced sorting errors + self.effects = self.effects + EF_NOSHADOW; + } + else { + // Setup alpha for non DP engines + if (!self.alpha) self.alpha = 0.5+random()*0.25; + } + + // Calculate smoke particle movedir from angles + makevectors(self.angles); + self.movedir = v_up; + + // Setup some random Y axis rotation if nothing set + if (CheckZeroVector(self.angles)) self.angles_y = rint(random()*360); + + // DP particle effects active? + if (ext_dppart) { + // Remove the model if spawnflag set + if (self.spawnflags & MISC_SMOKENODPMDL) self.mdl = ""; + + // Spawn particle emitter if particles active and not blocked + if (query_configflag(SVR_PARTICLES) && !(self.spawnflags & MISC_SMOKENODPFX) ) { + self.part_active = PARTICLE_STYLE_SMOKE; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) + self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_OFF); + else self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_ON); + } + } + else { + // Check for QS model exception + if (self.spawnflags & MISC_SMOKENOQSMDL) self.mdl = ""; + } + + // Setup target and delay starting model animation + self.nextthink = time + 0.1 + (rint(random()*10) * 0.1); + self.think = misc_smoke_setup; +}; + +/*====================================================================== + spark effect (based on code from Rubicon2 by JohnFitz) + - Modified to have on/off/toggle state via triggers + - extended parameters for angle/speed/custom sounds + +/*QUAKED misc_spark (.5 .75 .5) (-8 -8 -8) (8 8 8) x BLUE PALE RED x x STARTOFF x +Produces a burst of sparks at random intervals +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : If target is a light, will be switched on/off in sync +wait : time delay between bursts Def=2, spark once=-1 +cnt : number of sparks in burst (0.5 + random() x 0.5) Def=16 +angle : direction of sparks to follow, use "360" for 0 +fixangle: 1 = Random Y axis direction of sparks +speed : velocity speed of sparks (def=40) +height : random velocity modifier (def=+/-20) +sounds : 1=sparks, 4=silent, 5=custom +noise : custom sound for sparks +-------- SPAWNFLAGS -------- +BLUE : sparks are blue in colour (def=yellow) +PALE : sparks are pale yellow in colour (def=yellow) +RED : sparks are red in colour (def=yellow) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Produces a burst of sparks at random intervals +If targeting a light, it must start switched off (lights spawnflag=1) + +======================================================================*/ + +void() misc_sparks_fade1 = [0, misc_sparks_fade2] {self.alpha = 0.8; self.nextthink = time + 0.05;}; +void() misc_sparks_fade2 = [0, misc_sparks_fade3] {self.alpha = 0.6; self.nextthink = time + 0.05;}; +void() misc_sparks_fade3 = [0, misc_sparks_fade4] {self.alpha = 0.4; self.nextthink = time + 0.05;}; +void() misc_sparks_fade4 = [0, SUB_Remove] {self.alpha = 0.2; self.nextthink = time + 0.05;}; + +//---------------------------------------------------------------------- +void() misc_spark_spawn; +void() misc_spark_switchoff = +{ + // Always switch off trigger (lights) + SUB_UseTargets(); + + // Is the entity OFF or BLOCKED? + if (self.estate & ESTATE_BLOCK) return; + // Only spark once (wait for trigger) + if (self.wait > 0) { + self.think = misc_spark_spawn; + self.nextthink = time + self.wait + (random()*self.wait); + } +} + +//---------------------------------------------------------------------- +void() misc_spark_spawn = +{ + local float loopvar; + local entity spark; + + // Is the entity OFF or BLOCKED? + if (self.estate & ESTATE_BLOCK) return; + + // Check for random rotation, most be set for whole batch + // otherwise the sparks will all go in different directions + if (self.fixangle > 0) { + self.angles = '0 0 0'; + self.angles_y = rint(random()*360); + makevectors (self.angles); + self.movedir = v_forward; + } + + // Work out how many sparks to spawn + loopvar = (0.5 + random()*0.5)*self.cnt; + while (loopvar > 0) { + spark = spawn(); + spark.classtype = CT_TEMPSPARK; + spark.classgroup = CG_TEMPENT; + spark.owner = self; + spark.movetype = MOVETYPE_BOUNCE; + spark.solid = SOLID_TRIGGER; + setmodel (spark, self.mdl); + setorigin (spark, self.origin); + setsize (spark, VEC_ORIGIN, VEC_ORIGIN); + spark.gravity = 0.3; + spark.velocity = vecrand(0,self.height,TRUE); + spark.velocity = spark.velocity + (self.movedir * self.speed); + spark.avelocity = '300 300 300'; + spark.nextthink = time + 0.5 + 1.5*random(); + spark.think = misc_sparks_fade1; + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) spark.effects = spark.effects + EF_NOSHADOW; + + // Some brightness variety + if (random() < 0.33) spark.skin = 0; + else if (random() < 0.5) spark.skin = 1; + else spark.skin = 2; + + // Alternative colours (blue, pale yellow & red) + if (self.spawnflags & MISC_SPARKBLUE) spark.skin = spark.skin + 3; + else if (self.spawnflags & MISC_SPARKPALE) spark.skin = spark.skin + 6; + else if (self.spawnflags & MISC_SPARKRED) spark.skin = spark.skin + 9; + + loopvar = loopvar - 1; + } + // Play any spark sound and switch ON any target lights + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, self.volume, self.distance); + + // Is there any target(s) to switch on + if (self.target) { + SUB_UseTargets(); + // Setup timer to switch off + self.nextthink = time + 0.1 + random() * 0.2; + self.think = misc_spark_switchoff; + } + else { + // Only spark once (wait for trigger) + if (self.wait > 0) { + self.nextthink = time + 0.2 + self.wait + (random()*self.wait); + self.think = misc_spark_spawn; + } + } +}; + +//---------------------------------------------------------------------- +void() misc_spark_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + 0.1 + random(); + self.think = misc_spark_spawn; +}; + +//---------------------------------------------------------------------- +void() misc_spark = +{ + self.mdl = "progs/misc_spark.mdl"; + precache_model (self.mdl); + if (self.sounds == 1) self.noise = "misc/spark.wav"; + if (self.noise != "") precache_sound (self.noise); + + // Allow for volume/atten to be customized + if (self.distance < 0.1 || self.distance > ATTN_STATIC) self.distance = ATTN_STATIC; + if (self.volume < 0.1 || self.volume > 1) self.volume = 1; + + self.classtype = CT_MISCSPARK; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (!self.wait) self.wait = 2; // -1 = spark once and turn off + if (!self.cnt) self.cnt = 16; + if (!self.speed) self.speed = 40; + if (!self.height) self.height = 20; + self.estate = ESTATE_OFF; + + // Always convert 0 angle to 360 for setmovedir function + if (CheckZeroVector(self.angles)) self.angles = '0 360 0'; + self.mangle = self.angles; + SetMovedir(); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_spark_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +Screen Shake (based on code from RRP by ijed/supa) + - Modified to have on/off/toggle state + - added extra sound options + +/*QUAKED misc_shake (.5 .5 .9) (-16 -16 -8) (16 16 8) x VIEWONLY x x x x x x +Shake players view and/or velocity around center of entity +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +count : radius of shake (def = 200) +wait : duration of shake (def = 2s) +dmg : strength at center (def = 200) +sounds : 1=loud rumble (no default) +noise1 : noise to play when starting to shake +noise2 : noise to play when stopping +-------- SPAWNFLAGS -------- +VIEWONLY : Shakes the view, but player movement is not affected +-------- NOTES -------- +Shake players view and/or velocity around center of entity. +Always starts off, requires triggers to activate + +======================================================================*/ +void() misc_shake_think = +{ + local entity plyr; + local float d; + + // Is the shaking over? + if (self.attack_finished < time || self.estate & ESTATE_BLOCK) { + if (self.noise2) sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + // Check state before changing it, entity may be disabled + if (self.estate == ESTATE_ON) self.estate = ESTATE_OFF; + return; + } + + // Create a list of entities to check for players + plyr = findradius(self.origin, self.count); + while(plyr) { + // Only shake players (clients) + if (plyr.flags & FL_CLIENT) { + // Scale effect by distance + d = vlen(self.origin - plyr.origin); + d = (self.count - d)/self.count; + + if (d > 0) { + // shake up the view + plyr.punchangle_x = -1 * (random() + (0.025*self.dmg*d)); + + // push the player around + if (plyr.flags & FL_ONGROUND && !(self.spawnflags & MISC_SHAKEVIEWONLY)) { + d = self.dmg*d; + plyr.velocity_x = plyr.velocity_x + (random()*d*2 - d); + plyr.velocity_y = plyr.velocity_y + (random()*d*2 - d); + plyr.velocity_z = plyr.velocity_z + (random()*d); + } + } + } + // Find next entity in chain + plyr = plyr.chain; + } + + // keep shaking! + self.nextthink = time + 0.1; + self.think = misc_shake_think; +}; + +//---------------------------------------------------------------------- +void() misc_shake_on = +{ + self.estate = ESTATE_ON; + + // Play earthquake LOOP sound + if (self.noise1) sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.attack_finished = time + self.wait; + + // keep checking for players to shake! + self.nextthink = time + 0.1; + self.think = misc_shake_think; +}; + +//---------------------------------------------------------------------- +void() misc_shake = +{ + if (self.sounds == 1) { + self.noise1 = "misc/rumbleloop.wav"; + self.noise2 = "misc/rumbleoff.wav"; + } + else { + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + } + precache_sound (self.noise1); + precache_sound (self.noise2); + + self.classtype = CT_MISCSHAKE; + self.classgroup = CG_MISCENT; + if (!self.dmg) self.dmg = 120; + if (self.count <= 0) self.count = 200; + if (self.wait <= 0) self.wait = 2; + self.attack_finished = 0; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_shake_on; + self.estate = ESTATE_OFF; +}; + +/*====================================================================== +/*QUAKED misc_model (1 .5 .25) (-16 -16 -16) (16 16 16) x COLLISION MOVEMENT x x STATIC STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +MDL files that can be setup with specific frame/skin and animate groups +-------- KEYS -------- +mdl : specify model to load, full path (progs/candle.mdl) +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +angles : 'pitch yaw roll' up/down, angle, tilt left/right +ideal_yaw : = 1 Setup model with random Y axis rotation +pos1 : used for selection of frame(s) has several setups + X=0, Y=0, Z=exact frame number + X->Y, Z=0 Randomly pick a frame from the X,Y range + X->Y, Z=-1 Animate between the X,Y range, can forward or backward setup +pos2 : used for the selection of skin(s) has several setups + X=0, Y=0, Z=exact skin number + X->Y, Z=0 Randomly pick a skin from the X,Y range +-------- SPAWNFLAGS -------- +COLLISION : model bbox collision enabled +MOVEMENT : model can be moved around like an item +STATIC : Turn entity into static upon spawn (frame 0) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +MDL files that can be setup with specific frame/skin and animate groups + +======================================================================*/ +void() misc_model_loop = +{ + if (self.estate & ESTATE_BLOCK) return; + + self.height = self.height + self.lip; + if (self.lip > 0 && self.height > self.pos1_y) self.height = self.pos1_x; + else if (self.lip < 0 && self.height < self.pos1_y) self.height = self.pos1_x; + + self.frame = self.height; + self.think = misc_model_loop; + self.nextthink = time + self.speed; +}; + +//---------------------------------------------------------------------- +void() misc_model_on = +{ + // Check if there is any spawn/on delay setup + // Useful for delay spawning models on to platform/doors + if (self.delay > 0) { + // Feed back into this function + self.think = misc_model_on; + self.nextthink = time + self.delay; + // The delay only works once + self.delay = 0; + return; + } + + self.estate = ESTATE_ON; + + setmodel (self, self.mdl); + // Restore model/size and check if collision needed + if (self.spawnflags & MISC_COLLISION) { + self.solid = SOLID_BBOX; + setsize (self, self.mins , self.maxs); + } + else setsize (self, VEC_ORIGIN, VEC_ORIGIN); + setorigin(self, self.oldorigin + self.view_ofs); + + if (self.spawnflags & MISC_MOVEMENT) { + // Turn misc model into an item (can work with plats/doors) + self.movetype = MOVETYPE_TOSS; + self.solid = SOLID_TRIGGER; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity = '0 0 0'; + // Make sure the misc model starts on the ground + self.origin_z = self.origin_z + 6; + if (!droptofloor()) { + dprint ("\n\b[Model]\b "); dprint (self.mdl); + dprint (" stuck at ("); dprint (vtos(self.origin)); dprint (")\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // Make sure no touch function is active + self.touch = SUB_Null; + } + + // Setup skin number (range or exact) + self.skin = self.pos2_z; + // Exact frame number + self.frame = self.pos1_z; + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) makestatic(self); + else { + // Check for manual animation loops + if (self.pos1_z == -1) { + self.height = self.pos1_x; + if (self.pos1_x < self.pos1_y) self.lip = 1; + else self.lip = -1; + // Manually animate model + misc_model_loop(); + } + } +}; + +//---------------------------------------------------------------------- +void() misc_model_off = +{ + // Turn off model/world interaction + self.estate = ESTATE_OFF; + self.model = string_null; // hide bmodel surface + self.movetype = MOVETYPE_NONE; // Create baseline + self.solid = SOLID_NOT; + self.nextthink = 0; +}; + +//---------------------------------------------------------------------- +void() misc_model = +{ + // Is the model defined using the noise key? + if (!self.mdl) { + dprint("\b[MISCMDL]\b Missing model to load\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + precache_model (self.mdl); + self.classtype = CT_MISCMODEL; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.oldorigin = self.origin; // Store for later + + // Random Rotation : UP/DOWN angle or use the ideal_yaw key + if (self.angles_y < 0 || self.ideal_yaw > 0) + self.angles_y = rint(random()*360); + self.mangle = self.angles; // Save for later + if (!self.speed) self.speed = 0.1; // Manual animation tick speed + + // Has a frame range been defined? + if (self.pos1_x != self.pos1_y) { + // Make sure the range is the right way around + // X has to be the lowest number of the two (X/Y) + if (self.pos1_x > self.pos1_y) { + self.frame_box = self.pos1_x; + self.pos1_x = self.pos1_y; + self.pos1_y = self.frame_box; + } + // Randomly pick frame number from a range? + // Work out random different and add to X base + if (self.pos1_z == 0) { + // Double check lower limit is not negative + if (self.pos1_x < 0) self.pos1_x = 0; + // Work out random range first and then add to base + self.frame_box = fabs(self.pos1_y - self.pos1_x); + self.pos1_z = self.pos1_x + rint(random()*self.frame_box); + // Double check the frame is within the specified range + if (self.pos1_z < self.pos1_x) self.pos1_z = self.pos1_x; + if (self.pos1_z > self.pos1_y) self.pos1_z = self.pos1_y; + } + // Manual frame animation required + else self.pos1_z = -1; + } + else { + // If no exact frame bas specified, reset frame to default = 0 + if (self.pos1_z < 1) self.pos1 = '0 0 0'; + } + + // Has a skin range been defined? + if (self.pos2_x != self.pos2_y) { + self.pos2_z = rint( random() * fabs(self.pos2_y - self.pos2_x) ); + } + else { + // If no exact frame bas specified, reset frame to default = 0 + if (self.pos2_z < 1) self.pos2 = '0 0 0'; + } + + // Cannot have static and movement at the same time! + if (self.spawnflags & MISC_MOVEMENT) { + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_SPNSTATIC); + } + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) misc_model_on(); + else { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_model_on; + self.estate_off = misc_model_off; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); + } +}; + +//---------------------------------------------------------------------- +// Allows GTK editors to work with Q1 assets easier +void() misc_gtkmodel = { misc_model(); }; + +//====================================================================== +// All dead bodies use the same on/off states +//====================================================================== +void() misc_deadbody_on = +{ + if (self.gibbed == TRUE) return; + + self.estate = ESTATE_ON; // Show entity + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + setmodel(self,self.mdl); // Show model + setsize (self, self.bbmins, self.bbmaxs); + self.bodyonflr = MON_ONFLR; // Let Shadow Axe interact +}; + +//---------------------------------------------------------------------- +void() misc_deadbody_off = +{ + if (self.gibbed == TRUE) return; + + self.estate = ESTATE_OFF; // Hide entity + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + setmodel(self,""); // Show model + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.bodyonflr = ""; // No Shadows Axe interaction +}; + +//---------------------------------------------------------------------- +void() misc_deadbody_setup = +{ + self.classtype = CT_MISCMODEL; + self.classgroup = CG_MISCENT; + self.oldorigin = self.origin; // Store for later + + self.takedamage = DAMAGE_NO; // No projectile interaction + self.deadflag = DEAD_DEAD; // Body is really dead! + self.health = self.max_health = -1; + self.blockudeath = TRUE; // Body is dead, no human death noise + self.gibbed = FALSE; // Still in one piece! + + // Random Rotation : UP/DOWN angle or use the ideal_yaw key + if (self.angles_y < 0 || self.ideal_yaw > 0) + self.angles_y = rint(random()*360); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_deadbody_on; + self.estate_off = misc_deadbody_off; + if (self.spawnflags & ENT_STARTOFF) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +/*QUAKED misc_player (1 .5 .25) (-16 -16 -24) (16 16 32) BACK DOWN1 WALL DOWN2 DOWN3 SIDE STARTOFF x +Dead Player MDL for poses +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +ideal_yaw : = 1 Setup model with random Y axis rotation +fixangle : 1 = Use misc_player.mdl instead (less hassle) +frame : body pose (49=on back, 67-69=against wall, 60/84/93=face down, 102=on side) +exactskin : -1= Random, 0-1 Original, 2-3 Green, 4-5 Yellow, 6-7 Red +-------- SPAWNFLAGS -------- +BACK : 49=On back +DOWN1 : 60=Face Down +WALL : 69=Against wall +DOWN2 : 84=Face Down +DOWN3 : 93=Face Down +SIDE : 102=On Side +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Dead Player MDL for poses +*/ +/*====================================================================== +/*QUAKED misc_demon (1 .5 .25) (-32 -32 -24) (32 32 64) x x x x x x STARTOFF x +Dead demon/fiend for poses +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +ideal_yaw : = 1 Setup model with random Y axis rotation +frame : body pose (53=on back - def) +exactskin : -1= Random, 0= Original, 1= Green +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Dead demon/fiend for poses +*/ +/*====================================================================== +/*QUAKED misc_dknight (0.75 0.25 0) (-16 -16 -24) (16 16 40) x x x x x x STARTOFF x +Dead Death Knight for poses +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +ideal_yaw : = 1 Setup model with random Y axis rotation +frame : body pose (223=on front, 237-243=on back - def) +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Dead Death Knight for poses +*/ + +//---------------------------------------------------------------------- +void() misc_player = +{ + self.mdl = "progs/player.mdl"; // Standard player model + self.headmdl = "progs/h_soldier.mdl"; // Ugly monster mug + self.gib1mdl = "progs/gib_soldfoot1.mdl"; // Upright foot + self.gib2mdl = "progs/gib_soldfoot2.mdl"; // Fallen down foot + + // Special player model? + if (self.fixangle) { + self.mdl = "progs/misc_player.mdl"; // Custom model + self.gib3mdl = "progs/gib_5.mdl"; // Gib for precache + // using special model, simple frame setup + if (self.spawnflags & 2) self.frame = 1; + else if (self.spawnflags & 4) self.frame = 2; + else if (self.spawnflags & 8) self.frame = 3; + else if (self.spawnflags & 16) self.frame = 4; + else if (self.spawnflags & 32) self.frame = 5; + // Must always reset frame + else self.frame = 0; + } + // Normal player model + else { + self.mdl = "progs/player.mdl"; // Standard player model + self.gib3mdl = "progs/w_soldiergun.mdl";// Unique weapon + self.gib3sound = GIB_IMPACT_WOOD; + // Using original model, skip to correct frames + if (self.spawnflags & 1) self.frame = 49; + else if (self.spawnflags & 2) self.frame = 60; + else if (self.spawnflags & 4) self.frame = 69; + else if (self.spawnflags & 8) self.frame = 84; + else if (self.spawnflags & 16) self.frame = 93; + else if (self.spawnflags & 32) self.frame = 102; + } + + // Make sure stuff is cached + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + // uses short red knight bounding box + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + monster_bbox(); + + // Setup random/exact skin choices + if (self.exactskin < 0) self.exactskin = rint(0.5 + random()*7); + if (self.exactskin > 7) self.exactskin = 7; + self.skin = self.exactskin; + + misc_deadbody_setup(); +}; + +//---------------------------------------------------------------------- +void() misc_demon = +{ + self.mdl = "progs/mon_demon.mdl"; + self.headmdl = "progs/h_demon.mdl"; + self.gib1mdl = "progs/gib_dmleg1.mdl"; // Left leg + self.gib2mdl = "progs/gib_dmleg2.mdl"; // Right leg + self.gib3mdl = "progs/gib_dmtail.mdl"; // Tail + self.gib4mdl = "progs/gib_dmclaw1.mdl"; // Claw 1 + self.gib5mdl = "progs/gib_dmclaw2.mdl"; // Claw 2 + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); // Always precache extra models + precache_model (self.gib5mdl); // regardless if picked or not + + // Randomly swap in demon claws instead of legs + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + if (random() < 0.5) self.gib2mdl = self.gib5mdl; + self.gib4mdl = ""; self.gib5mdl = ""; + + // Setup bounding box based on presets + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + monster_bbox(); + + // Default pose for dead demons + if (self.frame < 0) self.frame = 0; + if (self.frame == 0) self.frame = 53; + + // Setup random/exact skin choices + if (self.exactskin < 0) { + if (random() < 0.5) self.exactskin = 0; + else self.exactskin = 1; + } + if (self.exactskin > 1) self.exactskin = 1; + self.skin = self.exactskin; + // Sync gib model skin to demon skin + self.gib1skin = self.gib2skin = self.gib3skin = self.exactskin; + + misc_deadbody_setup(); +}; + +//---------------------------------------------------------------------- +void() misc_dknight = +{ + self.mdl = "progs/mon_dknight.mdl"; // New Hell Knight + self.headmdl = "progs/h_dknight.mdl"; + self.gib1mdl = "progs/w_dknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib1mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + // Setup bounding box based on presets + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + monster_bbox(); + + // Default pose for dead death knights + if (self.frame < 0) self.frame = 0; + if (self.frame == 0) self.frame = 243; + if (self.exactskin > 0) self.skin = self.exactskin; + + misc_deadbody_setup(); +}; + +/*====================================================================== +/*QUAKED misc_builtineffect (0 .5 .8) (-8 -8 -8) (8 8 8) x +Spawns a builtin particle effect, will toggle if active +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : destination of effect (self -> target) +wait : time between firing of effect (def=0) +delay : random time between firing of effect (def=0s) +sounds : = 4 silent (no default additional sounds) +count : type of effect to fire + 0=TE_SPIKE (def), 1=TE_SUPERSPIKE, 2=TE_GUNSHOT, + 3=TE_EXPLOSION (sprites), 4=TE_TAREXPLOSION (purple ver) + 5=TE_LIGHTNING1 (Shambler ver), 6=TE_LIGHTNING2 (Player ver) + 7=TE_WIZSPIKE, 8=TE_KNIGHTSPIKE, 9=TE_LIGHTNING3 (boss ver) + 10=TE_LAVASPLASH (boss wakeup), 11=TE_TELEPORT (sparkles) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Spawns a builtin particle effect, will toggle if active +Always starts off, requires triggers to activate + +======================================================================*/ +void() misc_builtineffects_fire = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) self.state = STATE_OFF; + if (self.state == STATE_OFF) return; + + // Play builtin effects at target/self location + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, self.count); + + self.pos2 = self.origin; + + // If lightning effect (self -> target) + if (self.count == TE_LIGHTNING1 || self.count == TE_LIGHTNING2 || + self.count == TE_LIGHTNING3) { + + // Check if target is a Bmodel? (different origin location) + if (self.movetarget.bsporigin) self.pos1 = bmodel_origin(self.movetarget); + else self.pos1 = self.movetarget.origin; + + // The lightning model is made from 30 unit sections stitched together + // reduce the vector length down to 30 unit chunks so it does not + // poke through the destination object + self.pos2 = self.pos1 - self.origin; + self.t_width = vlen(self.pos2); + if (self.t_width > 30) self.t_length = floor(self.t_width / 30) * 30; + else self.t_length = self.t_width; + self.pos2 = normalize(self.pos2); + self.pos2 = self.origin + (self.pos2 * self.t_length); + + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + WriteCoord (MSG_BROADCAST, self.pos2_x); + WriteCoord (MSG_BROADCAST, self.pos2_y); + WriteCoord (MSG_BROADCAST, self.pos2_z); + + // Using the standard for triggers (4 == no extra sound) + if (self.sounds != 4) { + // The effect sounds have to come after the write commands + // otherwise the engine will get confused and think the protocol + // has changed, there is an exact format for effects + if (self.count == TE_TELEPORT) { + self.lip = rint(random()*5); + if (self.lip == 0) sound (self.movetarget, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + else if (self.lip == 1) sound (self.movetarget, CHAN_VOICE, "misc/r_tele2.wav", 1, ATTN_NORM); + else if (self.lip == 2) sound (self.movetarget, CHAN_VOICE, "misc/r_tele3.wav", 1, ATTN_NORM); + else if (self.lip == 3) sound (self.movetarget, CHAN_VOICE, "misc/r_tele4.wav", 1, ATTN_NORM); + else sound (self.movetarget, CHAN_VOICE, "misc/r_tele5.wav", 1, ATTN_NORM); + } + else if (self.count == TE_LIGHTNING1 || self.count == TE_LIGHTNING2 || + self.count == TE_LIGHTNING3) { + // Play lightning sound (LG weapon hit) + // Stop the sound constantly playing + if (self.waitmin < time) { + sound (self.movetarget, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.waitmin = time + 0.6; + } + } + else if (self.count == TE_LAVASPLASH) + sound (self.movetarget, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + else if (self.count == TE_EXPLOSION || self.count == TE_TAREXPLOSION) + // Play original explosion sound + sound(self.movetarget, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + } + + // Continuous mode? + if (self.wait > 0) { + self.think = misc_builtineffects_fire; + self.nextthink = time + self.wait + random()*self.delay; + } + // Fire once and switch off + else self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects_use = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) return; + + // Toggle shooter on/off + if (self.state == STATE_OFF) self.state = STATE_ON; + else self.state = STATE_OFF; + + misc_builtineffects_fire(); +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects_reset = +{ + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects_setup = +{ + // Find any target destinations + if (self.target != "") self.movetarget = find(world, targetname, self.target); + else self.movetarget = self; + + // Lightning effects need source and target to work + // Check target is valid before trying to setup this effect + if (self.count == TE_LIGHTNING1 || self.count == TE_LIGHTNING2 || + self.count == TE_LIGHTNING3 && !self.movetarget) { + dprint("\b[MISC_EFFECTS]\b Missing target for lightning\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = misc_builtineffects_use; + self.estate_reset = misc_builtineffects_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects = +{ + // Precache sounds for effects + if (self.count == TE_LAVASPLASH) precache_sound ("boss1/out1.wav"); + + self.classtype = CT_PARTICLEEMIT; + if (self.wait < 0) self.wait = 0; + if (self.delay < 0) self.delay = 0; + if (!self.count) self.count = 0; // def=TE_SPIKE + + self.think = misc_builtineffects_setup; + self.nextthink = time + 0.1 + random(); +}; diff --git a/QC_other/QC_arcane/misc_targetdummy.qc b/QC_other/QC_arcane/misc_targetdummy.qc new file mode 100644 index 00000000..b02f9ec6 --- /dev/null +++ b/QC_other/QC_arcane/misc_targetdummy.qc @@ -0,0 +1,411 @@ +/*====================================================================== +/*QUAKED misc_targetdummy (0 .5 .5) (-32 -32 -24) (32 32 64) KNIGHT WIZARD OGRE HELL_KNIGHT ZOMBIE DEMON SHALRATH SHAMBLER +Target practice dummy +------- KEYS -------- +noise1 : Targetnumber tracking weapon used +noise2 : Targetnumber tracking enemy distance +noise3 : Targetnumber tracking damage +noise4 : Targetnumber tracking % efficency +wait : Impact marker removal time (def=2) +-------- SPAWNFLAGS -------- +KNIGHT : Knight model +WIZARD : Wizard model +OGRE : Ogre model +HELL_KNIGHT : Hell Knight model +ZOMBIE : Zombie model +DEMON : Demon model +SHALRATH : Shalrath model +SHAMBLER : Shambler model +------- NOTES -------- +Target practice dummy + +======================================================================*/ +float MISC_TARGKNIGHT = 1; +float MISC_TARGWIZARD = 2; +float MISC_TARGOGRE = 4; +float MISC_TARGHELLKNIGHT = 8; +float MISC_TARGZOMBIE = 16; +float MISC_TARGDEMON = 32; +float MISC_TARGSHALRATH = 64; +float MISC_TARGSHAMBLER = 128; + +//---------------------------------------------------------------------- +void(float tvalue, string tdstr) misc_targetdummy_trigger = +{ + local entity tdfind, tself, tother; + if (tdstr == "") return; + + self.targetnumber = tvalue; + tdfind = find(world, targetname, tdstr); + if (tdfind.classtype == CT_TARGETNUMBER) { + tself = self; tother = other; + self = tdfind; other = tself; + self.use(); + self = tself; other = tother; + } +}; + +//---------------------------------------------------------------------- +void() misc_targetdummy_stand = +{ + // Cycle around standing animation + self.frame = self.frame + 1; + if (self.frame == self.pos1_y) self.frame = self.pos1_x; + self.nextthink = time + 0.1; + + // Check for any accumulating damage totals + if (self.attack_finished < time) { + dprint("Wpn ("); + if (self.weapon & IT_SHOTGUN) dprint("Shotgun"); + else if (self.weapon & IT_SUPER_SHOTGUN && self.moditems & IT_UPGRADE_SSG) + dprint("Shotgun Upgrade"); + else if (self.weapon & IT_SUPER_SHOTGUN) dprint("Super Shotgun"); + else if (self.weapon & IT_NAILGUN) dprint("Nail Gun"); + else if (self.weapon & IT_SUPER_NAILGUN) dprint("Super Nail Gun"); + else if (self.weapon & IT_GRENADE_LAUNCHER) dprint("Grenade Launcher"); + else if (self.weapon & IT_ROCKET_LAUNCHER) dprint("Rocket Launcher"); + else if (self.weapon & IT_LIGHTNING && self.moditems & IT_UPGRADE_LG) + dprint("Lightning Upgrade"); + else if (self.weapon & IT_LIGHTNING) dprint("Lightning Gun"); + else dprint("Unknown"); + dprint(") Dist ("); dprint(ftos(self.enemydist)); + dprint(") Dmg ("); dprint(ftos(self.dmg)); + dprint(") % ("); + if (self.weapon & IT_SHOTGUN || self.weapon & IT_SUPER_SHOTGUN) { + if (self.weapon & IT_SHOTGUN) self.cnt = self.dmg / 28; + else if (self.moditems & IT_UPGRADE_SSG) self.cnt = self.dmg / 84; + else self.cnt = self.dmg / 56; + self.cnt = self.cnt * 100; + } + else self.cnt = 100; + dprint(ftos(self.cnt)); + dprint(")\n"); + + misc_targetdummy_trigger(self.weapon, self.noise1); + misc_targetdummy_trigger(self.enemydist, self.noise2); + misc_targetdummy_trigger(self.dmg, self.noise3); + misc_targetdummy_trigger(self.cnt, self.noise4); + + // Reset health, damage timer and total + self.health = self.max_health; + self.attack_finished = LARGE_TIMER; + self.dmg = 0; + } +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) misc_targetdummy_pain = +{ + // want all damage to go through pain function, reset timer + self.pain_finished = 0; + + // Play a pain sound every second + if (self.pain_check < time) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_check = time + 1; + } + + // If the attacker is a player, record details + if (attacker.flags & FL_CLIENT) { + self.weapon = attacker.weapon; + self.items = attacker.items; + self.moditems = attacker.moditems; + self.enemydist = range_distance(attacker, TRUE); + } + else self.weapon = self.enemydist = 0; + + // The damage value is different depending on projectile type + if (inflictor.classgroup == CG_PROJSHELLS) self.dmg = damage; + else self.dmg = self.dmg + damage; + // reset timer for accumulating damage over time + self.attack_finished = time + 0.5; + + // Spawn a marker to show impact location + // Will remove self after certain amount of time + newmis = spawn(); + newmis.classtype = CT_DEVMARKER; + newmis.movetype = MOVETYPE_NONE; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_IMPACT); + // Randomize between 8 yellow skins + newmis.skin = rint(random()*7); + // Take projectile impact location + setorigin(newmis, inflictor.origin); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.think = SUB_Remove; + newmis.nextthink = time + self.wait; +}; + +//---------------------------------------------------------------------- +void() misc_targetdummy = +{ + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.spawnflags & MISC_TARGKNIGHT) { + self.mdl = "progs/mon_knight.mdl"; + self.headmdl = "progs/targd_short.mdl"; + self.pain_sound = "knight/khurt.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_SHORT; + self.pos1 = '0 9 0'; // stand1-9 + } + else if (self.spawnflags & MISC_TARGWIZARD) { + self.mdl = "progs/mon_wizard.mdl"; + self.headmdl = "progs/targd_tall.mdl"; + self.pain_sound = "wizard/wpain.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_TALL; + self.pos1 = '0 8 0'; // hover1-8 + } + else if (self.spawnflags & MISC_TARGOGRE) { + self.mdl = "progs/ogre.mdl"; + self.headmdl = "progs/targd_wide.mdl"; + self.pain_sound = "ogre/ogpain1.wav"; + self.t_width = TRUE; + self.bboxtype = BBOX_WIDE; + self.pos1 = '0 9 0'; // stand1-9 + } + else if (self.spawnflags & MISC_TARGHELLKNIGHT) { + self.mdl = "progs/mon_hknight.mdl"; + self.headmdl = "progs/targd_tall.mdl"; + self.pain_sound = "hknight/pain1.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_TALL; + self.pos1 = '0 9 0'; // stand1-9 + } + else if (self.spawnflags & MISC_TARGZOMBIE) { + self.mdl = "progs/mon_zombie.mdl"; + self.headmdl = "progs/targd_short.mdl"; + self.pain_sound = "zombie/z_pain.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_SHORT; + self.pos1 = '0 15 0'; // stand 1-15 + } + else if (self.spawnflags & MISC_TARGDEMON) { + self.mdl = "progs/demon.mdl"; + self.headmdl = "progs/targd_wide.mdl"; + self.pain_sound = "demon/dpain1.wav"; + self.t_width = TRUE; + self.bboxtype = BBOX_WIDE; + self.pos1 = '0 13 0'; // stand 1-13 + } + else if (self.spawnflags & MISC_TARGSHALRATH) { + self.mdl = "progs/mon_shalrath.mdl"; + self.headmdl = "progs/targd_wide.mdl"; + self.pain_sound = "shalrath/pain.wav"; + self.t_width = TRUE; + self.bboxtype = BBOX_WIDE; + self.pos1 = '0 1 0'; // stand 1 + } + else if (self.spawnflags & MISC_TARGSHAMBLER) { + self.mdl = "progs/shambler.mdl"; + self.headmdl = "progs/targd_massive.mdl"; + self.pain_sound = "shambler/shurt2.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_MASSIVE; + self.pos1 = '0 17 0'; // stand1-17 + self.resist_rockets = 0.5; + } + else { remove(self); return; } + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_sound (self.pain_sound); + precache_model (MODEL_IMPACT); // Impact model marker + + self.classtype = CT_TARGETDUMMY; + self.classgroup = CG_MONSTERS; + self.health = self.max_health = 100000; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_NONE; + self.movespeed = 0; // Never move monster + if (self.wait < 1) self.wait = 2; // impact marker removal time + self.pain_finished = 0; // Always reset this + self.pain_flinch = 1; // Always pass flinch test + self.dmg = 0; // Accumulated damage per frame + self.attack_finished = LARGE_TIMER; // Reset timer for checks + self.view_ofs = '0 0 24'; // Default monster offset + self.takedamage = DAMAGE_AIM; // Always take damage + + monster_bbox(); // Setup bounding box + setmodel(self, self.mdl); // Display model + setsize (self, self.bbmins, self.bbmaxs); // Update bbox + + // Spawn projectile bounding box visual marker + self.attachment = spawn(); + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + setmodel(self.attachment, self.headmdl); + setorigin(self.attachment, self.origin-self.view_ofs); + self.attachment.alpha = 0.3; + + // Spawn Hull2 bounding box visual marker + if (self.t_width) { + self.noise = "progs/targd_hull2.mdl"; + precache_model(self.noise); + self.attachment2 = spawn(); + self.attachment2.solid = SOLID_NOT; + self.attachment2.movetype = MOVETYPE_NONE; + setmodel(self.attachment2, self.noise); + setorigin(self.attachment2, self.origin-self.view_ofs); + self.attachment2.alpha = 0.15; + } + + // Intercept all AI states + self.th_pain = misc_targetdummy_pain; + self.th_stand = misc_targetdummy_stand; + self.th_walk = misc_targetdummy_stand; + self.th_run = misc_targetdummy_stand; + self.th_melee = misc_targetdummy_stand; + + // Stand around and wait for the pain! + self.think = self.th_stand; + self.nextthink = time + 0.5 + random(); +}; + +/*====================================================================== +/*QUAKED misc_targetnumber (.5 .5 0) (-4 -4 -8) (4 4 8) x +target number to display ingame +------- KEYS -------- +targetname : required for numbers to updated +pos1 : X= top digit quantity, Y=Lower digit quantity +-------- SPAWNFLAGS -------- +------- NOTES -------- +target number to display ingame + +======================================================================*/ +void() misc_targetnumber_dispno = +{ + local float str_counter, str_pow, str_result, str_low; + + str_counter = self.pos1_x; // Upper number length + str_pow = pow10(self.pos1_x); // Setup initial base 10 power for checking + + // If number larger than fixed length? - truncate number + if (self.count > str_pow) + self.count = self.count - (floor(self.count / str_pow) * str_pow); + + // Loop through lower part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + str_result = floor(self.count / str_pow); + + if (str_counter == 4) self.tno8.skin = str_result; + else if (str_counter == 3) self.tno7.skin = str_result; + else if (str_counter == 2) self.tno6.skin = str_result; + else if (str_counter == 1) self.tno5.skin = str_result; + + // remove top part of number, decrease str length counter + self.count = self.count - (str_result * str_pow); + str_counter = str_counter - 1; + } + + // Shift the lower part of the number upwards + str_low = str_counter = self.pos1_y; + str_pow = pow10(self.pos1_y); + while (str_low > 0) { + self.count = self.count * 10; + str_low = str_low - 1; + } + + // Loop through lower part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + str_result = floor(self.count / str_pow); + + if (str_counter == 3) self.tno3.skin = str_result; + else if (str_counter == 2) self.tno2.skin = str_result; + else if (str_counter == 1) self.tno1.skin = str_result; + + // remove top part of number, decrease str length counter + self.count = self.count - (str_result * str_pow); + str_counter = str_counter - 1; + } +}; + +//---------------------------------------------------------------------- +void() misc_targetnumber_use = +{ + self.count = fabs(other.targetnumber); + misc_targetnumber_dispno(); +}; + +//---------------------------------------------------------------------- +entity(float offset, float startno) misc_targetnumber_spawn = +{ + local entity tnoent; + tnoent = spawn(); + tnoent.classtype = CT_TARGETNUMBER; + tnoent.solid = SOLID_NOT; + tnoent.movetype = MOVETYPE_NONE; + makevectors(self.angles); + setmodel(tnoent, self.mdl); + setorigin(tnoent, self.origin + v_right*(8*offset)); + setsize(tnoent, VEC_ORIGIN, VEC_ORIGIN); + tnoent.skin = startno; + tnoent.angles = self.angles; + return tnoent; +}; + +//---------------------------------------------------------------------- +void() misc_targetnumber = +{ + self.mdl = "progs/misc_digit.mdl"; + precache_model (self.mdl); + + self.classtype = CT_TARGETNUMBER; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + // Setup lower part of number (1-3 decimal places, 4=dot always) + if (self.pos1_y > 0) { + if (self.pos1_y == 1) + self.tno1 = misc_targetnumber_spawn(0, 0); + else if (self.pos1_y == 2) { + self.tno1 = misc_targetnumber_spawn(0, 0); + self.tno2 = misc_targetnumber_spawn(1, 0); + } + else { + self.pos1_y = 3; + self.tno1 = misc_targetnumber_spawn(0, 0); + self.tno2 = misc_targetnumber_spawn(1, 0); + self.tno3 = misc_targetnumber_spawn(2, 0); + } + // Decimal place is always tno4 + self.tno4 = misc_targetnumber_spawn(self.pos1_y, 10); + self.pos1_z = self.pos1_y +1; + } + else self.pos1_z = 0; + + // Setup upper part of number (1-4 digits only, min 1 digit) + if (self.pos1_x < 1) self.pos1_x = 1; + if (self.pos1_x == 1) + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + else if (self.pos1_x == 2) { + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + self.tno6 = misc_targetnumber_spawn(self.pos1_z+1, 0); + } + else if (self.pos1_x == 3) { + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + self.tno6 = misc_targetnumber_spawn(self.pos1_z+1, 0); + self.tno7 = misc_targetnumber_spawn(self.pos1_z+2, 0); + } + else { + self.pos1_x = 4; + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + self.tno6 = misc_targetnumber_spawn(self.pos1_z+1, 0); + self.tno7 = misc_targetnumber_spawn(self.pos1_z+2, 0); + self.tno8 = misc_targetnumber_spawn(self.pos1_z+3, 0); + } + + // Setup trigger function for number update + if (self.targetname != "") self.use = misc_targetnumber_use; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/misc_textbook.qc b/QC_other/QC_arcane/misc_textbook.qc new file mode 100644 index 00000000..8ad62f35 --- /dev/null +++ b/QC_other/QC_arcane/misc_textbook.qc @@ -0,0 +1,665 @@ +/*====================================================================== + Story books +======================================================================*/ +// Closed +$frame closed1 closed2 closed3 closed4 closed5 closed6 closed7 closed8 closed9 closed10 + +// Idle B - looking around turning left and then right (based on closed) +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 idleb9 idleb10 +$frame idleb11 idleb12 idleb13 idleb14 idleb15 idleb16 idleb17 idleb18 idleb19 idleb20 + +// Idle C - spin around 360 degrees (based on closed) +$frame idlec1 idlec2 idlec3 idlec4 idlec5 idlec6 idlec7 idlec8 idlec9 idlec10 +$frame idlec11 idlec12 idlec13 idlec14 idlec15 idlec16 idlec17 idlec18 idlec19 idlec20 + +// Opening (closed -> open) +$frame opening1 opening2 opening3 opening4 opening5 opening6 opening7 opening8 opening9 opening10 + +// Open +$frame open1 open2 open3 open4 open5 open6 open7 open8 open9 open10 + +void() book_closed1; +void(float fadedir) info_book_fadesetup; + +//---------------------------------------------------------------------- +float MISCBOOK_NOMODEL = 1; // Will not use any model and particles +float MISCBOOK_PLINTH1 = 2; // setup and spawn on plinth1 +float MISCBOOK_PLINTH2 = 4; // setup and spawn on plinth2 +float MISCBOOK_STORY = 8; // setup book as part of story +float MISCBOOK_COLLISION = 16; // Use bounding box collision for plinth +float MISCBOOK_ANGLEONLY = 32; // Will only work when standing infront of entity +float MISCBOOK_NOEFFECTS = 128; // Disable particles and effects + +float MISCBOOK_FADEOUT = 192; // Background density while reading books +float MISCBOOK_LOOPADVANCE = 0.01; + +float MISCBOOK_CLOSED = 1; +float MISCBOOK_OPENING = 2; +float MISCBOOK_CLOSING = 4; +float MISCBOOK_OPEN = 8; +float MISCBOOK_STAYOPEN = 16; + +//---------------------------------------------------------------------- +// Idle B - looking around turning left and then right (based on closed) +//---------------------------------------------------------------------- +void() book_idleb1 = [$idleb1, book_idleb2 ] {}; +void() book_idleb2 = [$idleb2, book_idleb3 ] {}; +void() book_idleb3 = [$idleb3, book_idleb4 ] {}; +void() book_idleb4 = [$idleb4, book_idleb5 ] {}; +void() book_idleb5 = [$idleb5, book_idleb6 ] {}; +void() book_idleb6 = [$idleb6, book_idleb7 ] {}; +void() book_idleb7 = [$idleb7, book_idleb8 ] {}; +void() book_idleb8 = [$idleb8, book_idleb9 ] {}; +void() book_idleb9 = [$idleb9, book_idleb10 ] {}; +void() book_idleb10 = [$idleb10, book_idleb11 ] {}; +void() book_idleb11 = [$idleb11, book_idleb12 ] {}; +void() book_idleb12 = [$idleb12, book_idleb13 ] {}; +void() book_idleb13 = [$idleb13, book_idleb14 ] {}; +void() book_idleb14 = [$idleb14, book_idleb15 ] {}; +void() book_idleb15 = [$idleb15, book_idleb16 ] {}; +void() book_idleb16 = [$idleb16, book_idleb17 ] {}; +void() book_idleb17 = [$idleb17, book_idleb18 ] {}; +void() book_idleb18 = [$idleb18, book_idleb19 ] {}; +void() book_idleb19 = [$idleb19, book_idleb20 ] {}; +void() book_idleb20 = [$idleb20, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Idle C - spin around 360 degrees (based on closed) +//---------------------------------------------------------------------- +void() book_idlec1 = [$idlec1, book_idlec2 ] {}; +void() book_idlec2 = [$idlec2, book_idlec3 ] {}; +void() book_idlec3 = [$idlec3, book_idlec4 ] {}; +void() book_idlec4 = [$idlec4, book_idlec5 ] {}; +void() book_idlec5 = [$idlec5, book_idlec6 ] {}; +void() book_idlec6 = [$idlec6, book_idlec7 ] {}; +void() book_idlec7 = [$idlec7, book_idlec8 ] {}; +void() book_idlec8 = [$idlec8, book_idlec9 ] {}; +void() book_idlec9 = [$idlec9, book_idlec10 ] {}; +void() book_idlec10 = [$idlec10, book_idlec11 ] {}; +void() book_idlec11 = [$idlec11, book_idlec12 ] {}; +void() book_idlec12 = [$idlec12, book_idlec13 ] {}; +void() book_idlec13 = [$idlec13, book_idlec14 ] {}; +void() book_idlec14 = [$idlec14, book_idlec15 ] {}; +void() book_idlec15 = [$idlec15, book_idlec16 ] {}; +void() book_idlec16 = [$idlec16, book_idlec17 ] {}; +void() book_idlec17 = [$idlec17, book_idlec18 ] {}; +void() book_idlec18 = [$idlec18, book_idlec19 ] {}; +void() book_idlec19 = [$idlec19, book_idlec20 ] {}; +void() book_idlec20 = [$idlec20, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Book closed +//---------------------------------------------------------------------- +void() book_closed1 = [$closed1, book_closed2 ] {self.state = MISCBOOK_CLOSED; + if (random() < 0.1 && self.search_time < time) { + self.search_time = time + 2 + (random()*5); + self.lefty = 1 - self.lefty; + if (self.lefty > 0) book_idleb1(); // Turn left and right + else book_idlec1(); // spin around + } +}; +void() book_closed2 = [$closed2, book_closed3 ] {}; +void() book_closed3 = [$closed3, book_closed4 ] {}; +void() book_closed4 = [$closed4, book_closed5 ] {}; +void() book_closed5 = [$closed5, book_closed6 ] {}; +void() book_closed6 = [$closed6, book_closed7 ] {}; +void() book_closed7 = [$closed7, book_closed8 ] {}; +void() book_closed8 = [$closed8, book_closed9 ] {}; +void() book_closed9 = [$closed9, book_closed10 ] {}; +void() book_closed10 = [$closed10, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Book closing (open -> close) +//---------------------------------------------------------------------- +void() book_closing1 = [$opening10, book_closing2 ] { + self.state = MISCBOOK_CLOSING; + // make sure book idles don't start straight away + self.search_time = time + 2 + (random()*5); +}; +void() book_closing2 = [$opening9, book_closing3 ] {}; +void() book_closing3 = [$opening8, book_closing4 ] {}; +void() book_closing4 = [$opening7, book_closing5 ] {}; +void() book_closing5 = [$opening6, book_closing6 ] {}; +void() book_closing6 = [$opening5, book_closing7 ] {}; +void() book_closing7 = [$opening4, book_closing8 ] {}; +void() book_closing8 = [$opening3, book_closing9 ] {}; +void() book_closing9 = [$opening2, book_closing10 ] {}; +void() book_closing10= [$opening1, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Book always open (final stage of book) +//---------------------------------------------------------------------- +void() book_stayopen1 = [$open1, book_stayopen2 ] {self.state = MISCBOOK_STAYOPEN;}; +void() book_stayopen2 = [$open2, book_stayopen3 ] {}; +void() book_stayopen3 = [$open3, book_stayopen4 ] {}; +void() book_stayopen4 = [$open4, book_stayopen5 ] {}; +void() book_stayopen5 = [$open5, book_stayopen6 ] {}; +void() book_stayopen6 = [$open6, book_stayopen7 ] {}; +void() book_stayopen7 = [$open7, book_stayopen8 ] {}; +void() book_stayopen8 = [$open8, book_stayopen9 ] {}; +void() book_stayopen9 = [$open9, book_stayopen10 ] {}; +void() book_stayopen10 = [$open10, book_stayopen1 ] {}; + +//---------------------------------------------------------------------- +// Players has walked away, decide what to do with the book +//---------------------------------------------------------------------- +void() book_finish = +{ + info_book_fadesetup(-1); + // Clear client centerprint suppression + if (self.enemy.flags & FL_CLIENT) { + self.enemy.suppressCenterPrint = FALSE; + centerprint(self.enemy, ""); + } + if (self.pain_finished > 0) book_stayopen1(); + else book_closing1(); +}; + +//---------------------------------------------------------------------- +// Book is open (waiting to close) +//---------------------------------------------------------------------- +void() book_open1 = [$open1, book_open2 ] {self.state = MISCBOOK_OPEN;}; +void() book_open2 = [$open2, book_open3 ] {if (self.wait < time) book_finish();}; +void() book_open3 = [$open3, book_open4 ] {}; +void() book_open4 = [$open4, book_open5 ] {if (self.wait < time) book_finish();}; +void() book_open5 = [$open5, book_open6 ] {}; +void() book_open6 = [$open6, book_open7 ] {if (self.wait < time) book_finish();}; +void() book_open7 = [$open7, book_open8 ] {}; +void() book_open8 = [$open8, book_open9 ] {if (self.wait < time) book_finish();}; +void() book_open9 = [$open9, book_open10 ] {}; +void() book_open10= [$open10, book_open1 ] {if (self.wait < time) book_finish();}; + +//---------------------------------------------------------------------- +// Book opening (closed -> open) +//---------------------------------------------------------------------- +void() book_opening1 = [$opening1, book_opening2 ] {self.state = MISCBOOK_OPENING;}; +void() book_opening2 = [$opening2, book_opening3 ] {}; +void() book_opening3 = [$opening3, book_opening4 ] {}; +void() book_opening4 = [$opening4, book_opening5 ] {}; +void() book_opening5 = [$opening5, book_opening6 ] {}; +void() book_opening6 = [$opening6, book_opening7 ] {}; +void() book_opening7 = [$opening7, book_opening8 ] {}; +void() book_opening8 = [$opening8, book_opening9 ] {}; +void() book_opening9 = [$opening9, book_opening10 ] {}; +void() book_opening10 = [$opening10, book_open1 ] {}; + +//---------------------------------------------------------------------- +void() info_book_fade = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Fade direction needs to be -1 or +1 (0.48s fade time) + self.lip = self.lip + (self.height * 4); + // Check if fade has reached 0 or max screen fade value + if (self.lip <= 0) self.lip = 0; + else if (self.lip >= MISCBOOK_FADEOUT) self.lip = MISCBOOK_FADEOUT; + else self.nextthink = time + MISCBOOK_LOOPADVANCE; + + // Only update the screen if the debuff system is NOT active + // and the client does NOT have any powerups active + if (!self.enemy.cshift_upd && self.enemy.items & ALL_ITARTIFACTS == 0) { + // Change screen background density (makes text easier to read) + stuffcmd(self.enemy, "v_cshift 0 0 0 "); + stuffcmd(self.enemy, ftos(self.lip)); + stuffcmd(self.enemy, "\n"); + } +}; + +//---------------------------------------------------------------------- +void(float fadedir) info_book_fadesetup = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Is the fade controller setup? + if (self.attachment) { + // Double check if screen fade is setup already + if (fadedir > 0 && self.attachment.lip == MISCBOOK_FADEOUT) return; + if (fadedir < 0 && self.attachment.lip == 0) return; + + // Copy over client and fadedir to controller + self.attachment.enemy = self.enemy; + self.attachment.height = fadedir; + self.attachment.think = info_book_fade; + self.attachment.nextthink = time + MISCBOOK_LOOPADVANCE; + self.attachment.ltime = self.attachment.nextthink; + } +}; + +//---------------------------------------------------------------------- +void() info_book_displaystory = +{ + // is this book part of a storyline? + // The controller has been setup/validated already + if (self.spawnflags & MISCBOOK_STORY) { + // Check controller once! + self.spawnflags = self.spawnflags - (self.spawnflags & MISCBOOK_STORY); + + if (self.attachment.estate == ESTATE_OFF) { + self.message = "Story controller broken!\n\n"; + } + else { + // Copy over story chapter + self.message = self.attachment.oldenemy.message; + self.message2 = self.attachment.oldenemy.message2; + self.message3 = self.attachment.oldenemy.message3; + self.message4 = self.attachment.oldenemy.message4; + } + + // Work out which centerprint to use + if (self.message3 != "" && self.message4 != "") self.cnt = 2; + else if (self.message3 != "") self.cnt = 1; + else self.cnt = 0; + + // Move controller on to next story chapter + if (self.attachment.height < self.attachment.count) { + self.attachment.count = self.attachment.count + 1; + self.attachment.oldenemy = self.attachment.oldenemy.oldenemy; + } + } + + // Suppress any other centerprint messages and show story + self.enemy.suppressCenterPrint = TRUE; + // Check for any additional strings and use correct centerprint + // The engine function will merge several strings together + if (self.cnt == 1) centerprint_msg3(self.enemy, self.message, self.message2, self.message3); + else if (self.cnt == 2) centerprint_msg4(self.enemy, self.message, self.message2, self.message3, self.message4); + else centerprint_msg(self.enemy, self.message, self.message2); + + // Check for any additional trigger events + if (self.target != "") { + trigger_strs(self.target, self.enemy); + self.target = ""; + } +}; + +//---------------------------------------------------------------------- +void() info_book_touch = +{ + local float book_yaw, book_angle1, book_angle2, play_yaw, play_angle; + + if (self.estate & ESTATE_BLOCK) return; + if (intermission_running) return; // intermission or finale + if ( !(other.flags & FL_CLIENT) ) return; + if (other.health < 1) return; + + // Store player entity for later use + self.enemy = other; + + if (self.spawnflags & MISCBOOK_ANGLEONLY) { + // Check the players facing direction against book angle direction + // make sure the player angle is never negative, + 360 just in case + play_angle = anglemod(self.enemy.v_angle_y+360); + // Work out angle cone based on book angle direction + // Use previously defined angles for viewing angle of book + book_yaw = fabs(self.v_angle_y - self.v_angle_x); + book_angle1 = anglemod(self.angles_y + 180 + (360-book_yaw)); + book_angle2 = anglemod(self.angles_y + 180 + book_yaw); + // Is the players angle outside the book's viewing range? + if (play_angle < book_angle1 || play_angle > book_angle2) return; + } + + // The angle at the which the book is facing the player + // book_yaw = vectoyaw(self.enemy.origin - self.origin); + // book_angle = anglemod((self.angles_y - book_yaw) + 0); + // The angle the player is facing towards the book (45 = forward) + play_yaw = vectoyaw(self.origin - self.enemy.origin); + play_angle = anglemod((self.enemy.v_angle_y - play_yaw) + 45); + + // Is the player looking at the book? + if (play_angle > self.v_angle_x && play_angle < self.v_angle_y) { + // Is the book closed? + if (self.state == MISCBOOK_CLOSED) { + self.wait = time + 1.3; + book_opening1(); + } + // Is the book currently open and been read before? + else if (self.state == MISCBOOK_STAYOPEN) { + info_book_fadesetup(1); + self.wait = time + 0.3; + self.attack_finished = time + 0.2; + book_open1(); + } + // Has the book just opened and never been read before? + else if (self.state == MISCBOOK_OPEN && self.pain_finished == FALSE) { + self.pain_finished = TRUE; + info_book_fadesetup(1); + self.wait = time + 0.3; + self.attack_finished = time + 0.2; + if (self.part_emitter) misc_particle_update(self.part_emitter, PARTICLE_STYLE_OPENBOOK); + info_book_displaystory(); + } + // Is the book open and ready for a story? + else if (self.state == MISCBOOK_OPEN) { + info_book_fadesetup(1); + self.wait = time + 0.3; + if (self.attack_finished < time) { + self.attack_finished = time + 0.2; + info_book_displaystory(); + } + } + } +}; + +//---------------------------------------------------------------------- +void() info_book_on = +{ + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + if ( !(self.spawnflags & MISCBOOK_NOMODEL) ) { + setmodel (self, self.mdl); + self.skin = self.exactskin; + } + + // Make sure particle emitter is turned on + if (self.part_emitter) misc_particle_on(self.part_emitter); + + // Setup touch trigger and function + self.touch = info_book_touch; + setsize (self, self.pos1, self.pos2); + + // If no model, don't need book animations + attachment models + if ( !(self.spawnflags & MISCBOOK_NOMODEL) ) { + // Check for any plinth models + if (self.attachment2) { + // Use bounding box coillsion? + if (self.spawnflags & MISCBOOK_COLLISION) self.attachment2.solid = SOLID_BBOX; + else self.attachment2.solid = SOLID_NOT; + setmodel (self.attachment2, self.noise1); + } + + // Setup book in correct animation state + self.search_time = time + 5 + (random()*5); // delay idle animation + if (self.state == MISCBOOK_CLOSED) book_closed1(); + else book_stayopen1(); + } +}; + +//---------------------------------------------------------------------- +void() info_book_off = +{ + self.estate = ESTATE_OFF; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Stop any touch/animations + self.touch = self.think = SUB_Null; + + // Check if the screen is faded? + if (self.attachment) { + if (self.attachment.lip != 0) { + self.attachment.lip = 0; + if (!self.enemy.cshift_upd && self.enemy.items & ALL_ITARTIFACTS == 0) { + stuffcmd(self.enemy, "v_cshift 0 0 0 0\n"); + } + } + } + + // If any plinth exists, turn that off as well + if (self.attachment2) { + setmodel(self.attachment2, ""); + self.attachment2.solid = SOLID_NOT; + } +}; + +//---------------------------------------------------------------------- +void() info_book_setup = +{ + // Setup book fade controller + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_CONTROL; + self.attachment.movetype = MOVETYPE_NONE; + setorigin(self.attachment,self.origin + '0 0 32'); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Check for plinth and spawn/setup + if (self.mdl != "" && self.noise1 != "") { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_MISCMODEL; + self.attachment2.movetype = MOVETYPE_NONE; + + // Trace downward to find the ground and place plinth + traceline (self.origin, self.origin + '0 0 -512', TRUE, self); + self.origin = trace_endpos + '0 0 32'; + setorigin(self.attachment2, self.origin); + self.attachment2.angles = self.angles; + + // Plinth2 has flat surface which conflicts with book angle + if (self.spawnflags & MISCBOOK_PLINTH2) self.origin = self.origin + '0 0 4'; + } + + // Check for random skin options + if (self.randomskin > 1) + self.exactskin = rint(random()*(self.randomskin-1)); + // The particle colours are based on the book skin + if (self.exactskin < 1) self.exactskin = 0; + if (self.exactskin >= 6) self.style = MISCBOOK_RED; + else if (self.exactskin >= 4) self.style = MISCBOOK_BLUE; + else self.style = MISCBOOK_GREEN; + + // Default viewing angle is min 30 and max 60 looking at origin + if (CheckZeroVector(self.v_angle)) self.v_angle = '30 60 0'; + if (self.angles_y == 0) self.angles_y = 360; + + // Check for story book setup first + // Story is supplied from story system when book is opened + if (self.spawnflags & MISCBOOK_STORY) { + // Reset all storybook message strings + self.message = "Waiting for story!"; + self.message2 = ""; + self.message3 = ""; self.message4 = ""; + self.cnt = 0; + self.attachment = find(world, targetname, self.target2); + // Is this entity a storybook controller? + if (!self.attachment || self.attachment.classtype != CT_STORYCONTROL) + { + dprint("\b[STORYBOOK]\b Missing controller!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + } + else { + // setup default message for testing + if (self.message == "") self.message = "\b--[ Dark Elder Magic ]--\b\n\n"; + if (self.message2 == "") self.message2 = "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import.\n"; + + // Check for additional strings to display + // This is to fix quark editor limit of 128 characters per string + if (self.message3 != "" && self.message4 != "") self.cnt = 2; + else if (self.message3 != "") self.cnt = 1; + else self.cnt = 0; + } + + // Spawn particle emitter if particles active and not blocked + if ( !(self.spawnflags & MISCBOOK_NOMODEL) ) { + self.part_active = PARTICLE_STYLE_BOOK; + if (self.spawnflags & ENT_STARTOFF) self.count = PARTICLE_START_OFF; + else self.count = PARTICLE_START_ON; + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) { + if (!(self.spawnflags & MISCBOOK_NOEFFECTS) && self.part_active > 0) + self.part_emitter = spawn_pemitter(self, self, self.part_active, self.count); + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = info_book_on; + self.estate_off = info_book_off; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +/*====================================================================== +/*QUAKED misc_textbook (0 0.5 0.5) (-16 -16 -8) (16 16 8) NOMODEL PLINTH1 PLINTH2 STORY COLLISION ANGLEONLY STARTOFF NOEFFECTS +Display custom text messages +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : trigger event when book is opened (only works once) +target2 : name of story controller (only works with spawnflag) +angle : facing angle for model or direction player must be standing +v_angle : The viewing angle the book is active (def=30,60,0) +exactskin : skin number for book (1-8, Brown1/2,Green1/2,Blue1/2,Red1/2) +pos1 : Touch trigger minimin size (def=-48 -48 -32) +pos2 : Touch trigger maximum size (def=48 48 32) +message : header message +message2 : Body Text 1 (need to add linefeeds) +message3 : Body Text 2 (displayed after message2) +message4 : Body Text 3 (displayed after message3) +-------- SPAWNFLAGS -------- +NOMODEL : Will not use book model + particles +PLINTH1 : Setup book on top of plinth1 model +PLINTH2 : Setup book on top of plinth2 model +STORY : Book is part of a story (use target2) +COLLISION : Use bounding box collision for plinth +ANGLEONLY : Will only work when standing infront of entity (angle key) +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Display custom text messages +Maximum size of message is 1024 characters, 256 is the original limit + +======================================================================*/ +void() misc_textbook = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.classtype = CT_STORYBOOK; + + // Setup large bounding box for touch trigger + if (CheckZeroVector(self.pos1)) self.pos1 = '-48 -48 -32'; + if (CheckZeroVector(self.pos2)) self.pos2 = '48 48 32'; + self.takedamage = DAMAGE_NO; // No damage from anything + + if (self.spawnflags & MISCBOOK_NOMODEL) { + self.mdl = ""; + self.state = MISCBOOK_STAYOPEN; // no book animation + self.pain_finished = TRUE; // No read delay + } + else { + self.state = MISCBOOK_CLOSED; // Current state + self.pain_finished = FALSE; // Book not read yet + // Default medieval book + self.mdl = "progs/misc_textbook.mdl"; + precache_model (self.mdl); + self.noise1 = ""; + // Check for any predefined plinth model setups + if (self.spawnflags & MISCBOOK_PLINTH1) { + self.noise1 = "progs/misc_plinth1.mdl"; + precache_model(self.noise1); + } + else if (self.spawnflags & MISCBOOK_PLINTH2) { + self.noise1 = "progs/misc_plinth2.mdl"; + precache_model(self.noise1); + } + } + + // Don't spawn straight away + self.nextthink = time + 0.1 + random()*0.4; + self.think = info_book_setup; +}; + +/*====================================================================== +/*QUAKED misc_textstory (0 0.5 1.0) (-16 -16 -8) (16 16 8) x +Text Book Story Chapters +-------- KEYS -------- +targetname : name of current chapter +target : name of next chapter +message : header message +message2 : Body Text 1 (need to add linefeeds) +message3 : Body Text 2 (displayed after message2) +message4 : Body Text 3 (displayed after message3) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Text Book Story Chapters + +/*QUAKED misc_textstoryctrl (0 0.1 1.0) (-16 -16 -8) (16 16 8) x +Text Book Story Controller +-------- KEYS -------- +targetname : name of controller for story +target : name of first chapter +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Text Book Story Controller + +======================================================================*/ +void() info_bookcont_setup = +{ + local entity storychap, prevchap; + + // Is there any story chapters? + storychap = find(world, targetname, self.target); + if (!storychap) { + dprint("\b[STORYCTRL]\b Missing start chapter!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Can only link to story chapter entities + if (storychap.classtype != CT_STORYCHAPTER) { + dprint("\b[STORYCTRL]\b First chapter wrong entity!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Setup controller + prevchap = self; // Start controller at chapter 1 + self.count = 0; // Total chapters in story + self.height = 1; // Current chapter in story + + // Work through list + while (storychap) { + // Visual debug for chapters + spawn_marker(storychap.origin, SPNMARK_BLUE); + + // Link chapters and move forward + prevchap.oldenemy = storychap; + prevchap = storychap; + self.count = self.count + 1; + + // Check for next target in chain + if (prevchap.target == "") storychap = world; + else storychap = find(world, targetname, prevchap.target); + } + // Point final chapter at itself + prevchap.oldenemy = prevchap; + + // Controller finally active + self.estate = ESTATE_ON; + // Visual debug for controller + spawn_marker(self.origin, SPNMARK_GREEN); + // Console message for chapters found + dprint("\b[STORYCTRL]\b Chapters found ("); + dprint(ftos(self.count)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +void() misc_textstoryctrl = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.classtype = CT_STORYCONTROL; + // Start in disabled state until chapters setup + self.estate = ESTATE_OFF; + + if (self.target == "") { + dprint("\b[STORYCTRL]\b Missing story start!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Wait for chapter and books to spawn first + self.nextthink = time + 1 + random(); + self.think = info_bookcont_setup; +}; + +//---------------------------------------------------------------------- +void() misc_textstory = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.classtype = CT_STORYCHAPTER; +}; diff --git a/QC_other/QC_arcane/mon_boil.qc b/QC_other/QC_arcane/mon_boil.qc new file mode 100644 index 00000000..61af3b36 --- /dev/null +++ b/QC_other/QC_arcane/mon_boil.qc @@ -0,0 +1,458 @@ +/*============================================================================== +BOIL/BOMB model by Ijed, QC/Gameplay by Sock +==============================================================================*/ + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame explode1 explode2 explode3 explode4 explode5 explode6 +$frame explode7 explode8 explode9 + +$frame hobA1 hobA2 hobA3 hobA4 hobA5 hobA6 hobA7 hobA8 hobA9 hobA10 + +$frame hobB1 hobB2 hobB3 hobB4 hobB5 hobB6 hobB7 hobB8 hobB9 hobB10 + +//============================================================================= +void() boil_stand1 = [ $stand1, boil_stand2 ] {monster_idle_sound(); ai_stand();} +void() boil_stand2 = [ $stand2, boil_stand3 ] {ai_stand();}; +void() boil_stand3 = [ $stand3, boil_stand4 ] {ai_stand();}; +void() boil_stand4 = [ $stand4, boil_stand5 ] {ai_stand();}; +void() boil_stand5 = [ $stand5, boil_stand6 ] {ai_stand();}; +void() boil_stand6 = [ $stand6, boil_stand7 ] {ai_stand();}; +void() boil_stand7 = [ $stand7, boil_stand8 ] {ai_stand();}; +void() boil_stand8 = [ $stand8, boil_stand9 ] {ai_stand();}; +void() boil_stand9 = [ $stand9, boil_stand10 ] {ai_stand();}; +void() boil_stand10 = [ $stand10, boil_stand11 ] {ai_stand();}; +void() boil_stand11 = [ $stand11, boil_stand12 ] {ai_stand();}; +void() boil_stand12 = [ $stand12, boil_stand13 ] {ai_stand();}; +void() boil_stand13 = [ $stand13, boil_stand14 ] {ai_stand();}; +void() boil_stand14 = [ $stand14, boil_stand15 ] {ai_stand();}; +void() boil_stand15 = [ $stand15, boil_stand16 ] {ai_stand();}; +void() boil_stand16 = [ $stand16, boil_stand1 ] {ai_stand();}; + +//============================================================================= +void() boil_walk1 = [ $walk1, boil_walk2 ] { + monster_idle_sound(); ai_walk(0);}; +void() boil_walk2 = [ $walk2, boil_walk3 ] {monster_footstep(TRUE);ai_walk(3);}; +void() boil_walk3 = [ $walk3, boil_walk4 ] {ai_walk(4);}; +void() boil_walk4 = [ $walk4, boil_walk5 ] {ai_walk(3);}; +void() boil_walk5 = [ $walk5, boil_walk6 ] {ai_walk(3);}; +void() boil_walk6 = [ $walk6, boil_walk7 ] {ai_walk(2);}; +void() boil_walk7 = [ $walk7, boil_walk8 ] {ai_walk(1);}; +void() boil_walk8 = [ $walk8, boil_walk9 ] {ai_walk(2);}; + +void() boil_walk9 = [ $walk9, boil_walk10 ] {ai_walk(0);}; +void() boil_walk10 = [ $walk10, boil_walk11 ] {monster_footstep(TRUE);ai_walk(3);}; +void() boil_walk11 = [ $walk11, boil_walk12 ] {ai_walk(1);}; +void() boil_walk12 = [ $walk12, boil_walk13 ] {ai_walk(2);}; +void() boil_walk13 = [ $walk13, boil_walk14 ] {ai_walk(3);}; +void() boil_walk14 = [ $walk14, boil_walk15 ] {ai_walk(3);}; +void() boil_walk15 = [ $walk15, boil_walk16 ] {ai_walk(2);}; +void() boil_walk16 = [ $walk16, boil_walk1 ] {ai_walk(2);}; + +//---------------------------------------------------------------------- +// Used for testing run animation speed and sliding feet problems +//---------------------------------------------------------------------- +/*void() boil_walk1 = [ $run1, boil_walk2 ] {monster_footstep(TRUE);ai_walk(4);}; +void() boil_walk2 = [ $run2, boil_walk3 ] {monster_idle_sound(); ai_walk(16);}; +void() boil_walk3 = [ $run3, boil_walk4 ] {ai_walk(8);}; +void() boil_walk4 = [ $run4, boil_walk5 ] {ai_walk(4);}; +void() boil_walk5 = [ $run5, boil_walk6 ] {monster_footstep(TRUE);ai_walk(4);}; +void() boil_walk6 = [ $run6, boil_walk7 ] {ai_walk(16);}; +void() boil_walk7 = [ $run7, boil_walk8 ] {ai_walk(8);}; +void() boil_walk8 = [ $run8, boil_walk1 ] {ai_walk(4);};*/ + +//============================================================================ +void() boil_run1 = [ $run1, boil_run2 ] {monster_footstep(TRUE);ai_run(4);}; +void() boil_run2 = [ $run2, boil_run3 ] {monster_idle_sound(); ai_run(16);}; +void() boil_run3 = [ $run3, boil_run4 ] {ai_run(8);}; +void() boil_run4 = [ $run4, boil_run5 ] {ai_run(4);}; +void() boil_run5 = [ $run5, boil_run6 ] {monster_footstep(TRUE);ai_run(4);}; +void() boil_run6 = [ $run6, boil_run7 ] {ai_run(16);}; +void() boil_run7 = [ $run7, boil_run8 ] {ai_run(8);}; +void() boil_run8 = [ $run8, boil_run1 ] {ai_run(4);}; + +//====================================================================== +// Running Boil Explosive Attack +//====================================================================== +void() boil_expl1 = [ $explode1, boil_expl2 ] {ai_face(); + sound (self, CHAN_VOICE, "zombie/boil_windup.wav", 1, ATTN_NORM);}; +void() boil_expl2 = [ $explode2, boil_expl3 ] {ai_face();}; +void() boil_expl3 = [ $explode3, boil_expl4 ] {ai_face();}; +void() boil_expl4 = [ $explode4, boil_expl5 ] {ai_face();}; +void() boil_expl5 = [ $explode5, boil_expl6 ] {ai_face();}; +void() boil_expl6 = [ $explode6, boil_expl7 ] {ai_face();}; +void() boil_expl7 = [ $explode7, boil_expl8 ] {ai_face();}; +void() boil_expl8 = [ $explode8, boil_expl9 ] {ai_face();}; +void() boil_expl9 = [ $explode9, boil_expl9 ] { + T_Damage (self, self, self, self.health+1, NOARMOR); +}; + +//====================================================================== +// Stationary Boil - Nailed to the floor or wall +//====================================================================== +void() boil_suicide = +{ + if (self.health < 1) return; + self.use = SUB_Null; + // Make sure current enemy is the cause of the damage + T_Damage (self, self, self.enemy, self.health+1, NOARMOR); +}; + +//---------------------------------------------------------------------- +void() boil_checktarget = +{ + local entity client; + + // Should never have an active enemy + self.enemy = self.goalentity = world; + + // Get the obvious exception(s) done first + if (self.health < 1) return; + if (intermission_running) return; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return; + if (client.flags & FL_NOTARGET) return; + if (client.items & IT_INVISIBILITY) return; + + // Check if the player is visible? + enemy_vis = visible(client); + if (!enemy_vis) return; + + // Store client/player for later damage + self.enemy = client; + + // Is the player within range to blow up? + self.enemydist = range_distance(client, FALSE); + if (self.enemydist < self.t_width) self.th_melee(); +}; + +//---------------------------------------------------------------------- +void() boil_squirtblood = +{ + if (self.waitmin < time) { + self.waitmin = time + self.wait + random() * self.wait; + sound (self, CHAN_WEAPON, "zombie/boil_squirt.wav", 1, ATTN_IDLE); + + SpawnProjectileMeat(self,self.origin,self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + // Randomly spawn an extra gib of flesh + if (random() < 0.25) SpawnProjectileMeat(self,self.origin,self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + } +}; + +//---------------------------------------------------------------------- +void() boil_hoba1 = [ $hobA1, boil_hoba2 ] { + self.nextthink = self.nextthink + random()*0.2; + monster_idle_sound();boil_squirtblood();boil_checktarget(); +}; +void() boil_hoba2 = [ $hobA2, boil_hoba3 ] {boil_checktarget();}; +void() boil_hoba3 = [ $hobA3, boil_hoba4 ] { + self.nextthink = self.nextthink + random()*0.2; + boil_checktarget();}; +void() boil_hoba4 = [ $hobA2, boil_hoba1 ] {boil_checktarget();}; + +//---------------------------------------------------------------------- +void() boil_HexpA1 = [ $hobA2, boil_HexpA2 ] { + sound (self, CHAN_VOICE, "zombie/boil_windup.wav", 1, ATTN_NORM);}; +void() boil_HexpA2 = [ $hobA3, boil_HexpA3 ] {}; +void() boil_HexpA3 = [ $hobA4, boil_HexpA4 ] {}; +void() boil_HexpA4 = [ $hobA5, boil_HexpA5 ] {}; +void() boil_HexpA5 = [ $hobA6, boil_HexpA6 ] {}; +void() boil_HexpA6 = [ $hobA7, boil_HexpA7 ] {}; +void() boil_HexpA7 = [ $hobA8, boil_HexpA8 ] {}; +void() boil_HexpA8 = [ $hobA9, boil_HexpA9 ] {}; +void() boil_HexpA9 = [ $hobA10, boil_HexpA9 ] {boil_suicide();}; + +//---------------------------------------------------------------------- +void() boil_hobb1 = [ $hobB1, boil_hobb2 ] { + self.nextthink = self.nextthink + random()*0.2; + monster_idle_sound();boil_squirtblood();boil_checktarget(); +}; +void() boil_hobb2 = [ $hobB2, boil_hobb3 ] {boil_checktarget();}; +void() boil_hobb3 = [ $hobB3, boil_hobb4 ] { + self.nextthink = self.nextthink + random()*0.2; + boil_checktarget();}; +void() boil_hobb4 = [ $hobB2, boil_hobb1 ] {boil_checktarget();}; + +//---------------------------------------------------------------------- +void() boil_HexpB1 = [ $hobB2, boil_HexpB2 ] { + sound (self, CHAN_VOICE, "zombie/boil_windup.wav", 1, ATTN_NORM);}; +void() boil_HexpB2 = [ $hobB3, boil_HexpB3 ] {}; +void() boil_HexpB3 = [ $hobB4, boil_HexpB4 ] {}; +void() boil_HexpB4 = [ $hobB5, boil_HexpB5 ] {}; +void() boil_HexpB5 = [ $hobB6, boil_HexpB6 ] {}; +void() boil_HexpB6 = [ $hobB7, boil_HexpB7 ] {}; +void() boil_HexpB7 = [ $hobB8, boil_HexpB8 ] {}; +void() boil_HexpB8 = [ $hobB9, boil_HexpB9 ] {}; +void() boil_HexpB9 = [ $hobB10, boil_HexpB9 ] {boil_suicide();}; + +//====================================================================== +// NO PAIN +//====================================================================== +void(entity inflictor, entity attacker, float take) boil_pain = +{ + // Spawn some grey particles and chunk of meat + SpawnProjectileSmoke(self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + SpawnProjectileMeat(self,self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + // Random chance of more smokey meat + if (random() < 0.5) { + SpawnProjectileSmoke(self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + SpawnProjectileMeat(self,self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + } + + // No special animation + return; +}; + +//============================================================================ +void() boil_explode = { + // Needs special version of radius damage function (T_RadiusDamage) + // Boss monsters are always immune to this kind of damage + // Needs to do infighting damage before T_Damage function + // There is no rocket resistance to this kind damage! + // Must pass on self.enemy so that any death triggers work properly + // + self.enemytarget = findradius(self.origin, self.death_dmg+40); + // Loop through chain list + while(self.enemytarget) { + // Ignore self and world and can never damage bosses + if (self.enemytarget != world && self.enemytarget != self && self.enemytarget.bossflag == 0) { + // Check for any breakables which are prone to explosive damage + if (ai_foundbreakable(self.enemy, self.enemytarget,TRUE) && + self.enemytarget.brktrigmissile != 0) { + trigger_ent(self.enemytarget, self.enemy); + } + else { + // Can be damaged and NOT immune to radius (splash) damage + if (self.enemytarget.takedamage > 0 && self.enemytarget.noradiusdmg == 0) { + // Make sure monsters take more damage + if (self.enemytarget.flags & FL_MONSTER) + self.dmg = self.death_dmg * self.infightextra; + else { + // Use original radius formula for non monsters + self.pos1 = self.enemytarget.origin + (self.enemytarget.mins + self.enemytarget.maxs)*0.5; + self.dmg = 0.5*vlen (self.origin - self.pos1); + if (self.dmg < 0) self.dmg = 0; + self.dmg = self.death_dmg - self.dmg; + } + + if (self.dmg > 0 && self.enemytarget.health > 0) { + // Need CanDamage to check for anything blocking LoS + if (CanDamage (self.enemytarget, self)) + // Pass on self.enemy so death triggers fire correctly + T_Damage (self.enemytarget, self, self.enemy, self.dmg, DAMARMOR); + // make sure to check for poisonous and apply debuff + if (self.dmg > 0 && self.poisonous == TRUE) PoisonDeBuff(self.enemytarget); + } + } + } + } + // Move forward in chain to next entity + self.enemytarget = self.enemytarget.chain; + } + + /*---------------------------------------------------------------------- + // I really liked this idea of the boil destroying any monster + // bodies lying closeby, BUT this is a serious processor drain + // on maps with a huge amount of monsters. + // Every monster that dies is marked and left on the floor and + // this function would search them all everytime a boil explodes! + // + // The code below works fine, BUT it should only be enabled + // for maps with small amount of available monsters + //---------------------------------------------------------------------- + + // Check for any nearby dead/lying bodies + self.enemytarget = find(world, bodyonflr, MON_ONFLR); + self.dmg = self.death_dmg * self.infightextra; + // restrict size of dead body search list + self.count = 64; + + // Cycle through list of "marked" dead bodies + // These entities cannot be found by a findradius command + // They are setup nonsolid and have to be checked manually + while (self.enemytarget) { + // Work out how close the body is to the boil + self.enemydist = vlen(self.origin - self.enemytarget.origin); + if (self.enemydist < self.death_dmg+40) { + // Use shadow axe gib function (moved to ai_gib) + monster_flrbody_gib(self.enemytarget, self.dmg); + } + // Only check the first xx dead bodies in the list + self.count = self.count - 1; + if (self.count < 1) self.enemytarget = world; + else self.enemytarget = find(self.enemytarget, bodyonflr, MON_ONFLR); + } + */ + + // Switch explosions effect based on poison flag + if (self.poisonous) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 51); + WriteByte (MSG_BROADCAST, 8); + } + else { + // Show classic grenade explosion effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } +}; + +//---------------------------------------------------------------------- +void() boil_die = +{ + // Upward fountain of gibs + self.max_health = MON_GIBFOUNTAIN; + monster_death_precheck(); + // New gib + loud explosion sound + sound (self, CHAN_AUTO, "zombie/boil_explode.wav", 1, ATTN_NORM); + // Delay the t_radius explosion for one frame + // Just in case several are standing next to each other + // otherwise there will be a runaway crash loop + self.think = boil_explode; + self.nextthink = time + 0.1; +}; + + +/*====================================================================== + QUAKED monster_boil (1 0 0) (-16 -16 -24) (16 16 32) +======================================================================*/ +void() monster_boil = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_boil.mdl"; + precache_model (self.mdl); + + self.idle_sound = "zombie/boil_idle1.wav"; + self.idle_sound2 = "zombie/boil_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.sight_sound = "zombie/boil_sight.wav"; + precache_sound (self.sight_sound); + self.pain_sound = SOUND_EMPTY; + precache_sound ("zombie/boil_squirt.wav"); + precache_sound ("zombie/boil_windup.wav"); + precache_sound ("zombie/boil_explode.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 40; + self.gibhealth = -60; // Never used + self.gibbed = FALSE; // In one piece + self.pain_flinch = 10; // Has gib splash + self.steptype = FS_TYPESLOW; // Tiny feet + self.gibondeath = TRUE; // Always blow up! + self.blockudeath = TRUE; // No humanoid death sound + if (self.death_dmg < 1) self.death_dmg = DAMAGE_BOIL; + if (self.infightextra < 1) self.infightextra = 16; + self.attack_instant = 1; // Start moving right away + self.deathstring = " was blown away by a Boil\n"; + + // Setup timer for flesh gib squirting from body + if (self.wait < 1) self.wait = 4; + self.waitmin = time + self.wait + random() * self.wait; + // Randomly pick one from the first four skins + // 0=flesh, 1=brown, 2=green1, 3=green2, 4=flesh + if (!self.exactskin) self.randomskin = 4; + self.brkvelbase = '200 50 150'; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // All boils die the same way + self.th_checkattack = BoilCheckAttack; + self.th_pain = boil_pain; + self.th_die = boil_die; + + self.classtype = CT_MONBOIL; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEWALK; + + // Setup random hobble animation + if (self.spawnflags & ( MON_BOIL_HOBBLED | MON_BOIL_HANGING)) { + // A = Crossed legs, B = Straight legs + if (random() < 0.5) { + self.th_stand = self.th_walk = self.th_run = boil_hoba1; + self.th_melee = boil_HexpA1; + } + else { + self.th_stand = self.th_walk = self.th_run = boil_hobb1; + self.th_melee = boil_HexpB1; + } + // No movement, turret mode + self.movespeed = -1; + // The stationary boil cannot start angry at anything + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SPAWN_ANGRY); + self.angrytarget = ""; + // Instantly blow up when triggered + self.think1 = boil_suicide; + // Cannot have sight sound, its nailed to wall/floor! + self.sight_sound = SOUND_EMPTY; + // Allow for override on exploding trigger radius + if (self.t_width < 1) self.t_width = MONAI_HOBBLEBOIL; + } + + // Hobbled hanging upside down on wall? + if (self.spawnflags & MON_BOIL_HANGING) { + // Make sure angle is within range (0-360) + if (self.angles_y < 0) self.angles_y = 360; + // Calculate opposite facing direction + self.movedir = '0 0 0'; + self.movedir_y = anglemod(self.angles_y + 180); + // Calculate upward vector and rotate monster + makevectors(self.angles); + self.angles = self.movedir + vectoangles(v_up); + // Pull monster away from wall + self.origin = self.origin + v_forward*10; + // Allow monster to float and no ground check + self.classmove = MON_MOVEFLY; + self.flags = self.flags | FL_FLY; + // Setup squirt distance for blood + self.brkvelbase = '100 50 150'; + } + // Hobbled legs with spikes (ground pose) + else if (self.spawnflags & MON_BOIL_HOBBLED) { + // Check for random floor rotation and setup no movment + if (self.angles_y < 0) self.angles_y = rint(random()*360); + // Setup squirt distance for blood + self.brkvelbase = '100 300 100'; + } + else { + // Allow for override on exploding trigger radius + if (self.t_width < 1) self.t_width = MONAI_MELEEBOIL; + // Default stand, walk & run + self.th_stand = boil_stand1; + self.th_walk = boil_walk1; + self.th_run = boil_run1; + self.th_melee = boil_expl1; + } + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_bossboglord.qc b/QC_other/QC_arcane/mon_bossboglord.qc new file mode 100644 index 00000000..1c2d41be --- /dev/null +++ b/QC_other/QC_arcane/mon_bossboglord.qc @@ -0,0 +1,576 @@ +/*============================================================================== +BOG LORD (Based on Shambler) +==============================================================================*/ + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 + +$frame run1 run2 run3 run4 run5 run6 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 + +$frame swingr1 swingr2 swingr3 swingr4 swingr5 +$frame swingr6 swingr7 swingr8 swingr9 + +$frame swingl1 swingl2 swingl3 swingl4 swingl5 +$frame swingl6 swingl7 swingl8 swingl9 + +$frame magic1 magic2 magic3 magic4 magic5 +$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 + +//====================================================================== +void() bogl_stand1 =[ $stand1, bogl_stand2 ] {monster_idle_sound();ai_stand();}; +void() bogl_stand2 =[ $stand2, bogl_stand3 ] {ai_stand();}; +void() bogl_stand3 =[ $stand3, bogl_stand4 ] {ai_stand();}; +void() bogl_stand4 =[ $stand4, bogl_stand5 ] {ai_stand();}; +void() bogl_stand5 =[ $stand5, bogl_stand6 ] {ai_stand();}; +void() bogl_stand6 =[ $stand6, bogl_stand7 ] {ai_stand();}; +void() bogl_stand7 =[ $stand7, bogl_stand8 ] {ai_stand();}; +void() bogl_stand8 =[ $stand8, bogl_stand9 ] {ai_stand();}; +void() bogl_stand9 =[ $stand9, bogl_stand10] {ai_stand();}; +void() bogl_stand10 =[ $stand10, bogl_stand11] {ai_stand();}; +void() bogl_stand11 =[ $stand11, bogl_stand12] {ai_stand();}; +void() bogl_stand12 =[ $stand12, bogl_stand13] {ai_stand();}; +void() bogl_stand13 =[ $stand13, bogl_stand14] {ai_stand();}; +void() bogl_stand14 =[ $stand14, bogl_stand15] {ai_stand();}; +void() bogl_stand15 =[ $stand15, bogl_stand16] {ai_stand();}; +void() bogl_stand16 =[ $stand16, bogl_stand17] {ai_stand();}; +void() bogl_stand17 =[ $stand17, bogl_stand1 ] {ai_stand();}; + +//====================================================================== +void() bogl_walk1 =[ $walk1, bogl_walk2 ] {monster_idle_sound(); ai_walk(10);}; +void() bogl_walk2 =[ $walk2, bogl_walk3 ] {monster_footstep(FALSE); ai_walk(9);}; +void() bogl_walk3 =[ $walk3, bogl_walk4 ] {ai_walk(9);}; +void() bogl_walk4 =[ $walk4, bogl_walk5 ] {ai_walk(5);}; +void() bogl_walk5 =[ $walk5, bogl_walk6 ] {ai_walk(6);}; +void() bogl_walk6 =[ $walk6, bogl_walk7 ] {ai_walk(12);}; +void() bogl_walk7 =[ $walk7, bogl_walk8 ] {monster_footstep(FALSE); ai_walk(8);}; +void() bogl_walk8 =[ $walk8, bogl_walk9 ] {ai_walk(3);}; +void() bogl_walk9 =[ $walk9, bogl_walk10] {ai_walk(13);}; +void() bogl_walk10 =[ $walk10, bogl_walk11] {ai_walk(9);}; +void() bogl_walk11 =[ $walk11, bogl_walk12] {ai_walk(7);}; +void() bogl_walk12 =[ $walk12, bogl_walk1 ] {ai_walk(7);}; + +//====================================================================== +void() bogl_run1 =[ $run1, bogl_run2 ] {monster_idle_sound(); ai_run(20);}; +void() bogl_run2 =[ $run2, bogl_run3 ] {monster_footstep(FALSE); ai_run(24);}; +void() bogl_run3 =[ $run3, bogl_run4 ] {ai_run(20);}; +void() bogl_run4 =[ $run4, bogl_run5 ] {ai_run(20);}; +void() bogl_run5 =[ $run5, bogl_run6 ] {monster_footstep(FALSE); ai_run(24);}; +void() bogl_run6 =[ $run6, bogl_run1 ] {ai_run(20);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() bogl_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.alpha = 0.85; + } + if (!self.attachment2) { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_ATTACHMENT; + self.attachment2.alpha = 0.85; + } + + if (!self.attachment3) { + self.attachment3 = spawn(); + self.attachment3.owner = self; + self.attachment3.classtype = CT_ATTACHMENT; + self.attachment3.alpha = 1.0; + } +}; + +//---------------------------------------------------------------------- +void() bogl_finish_attachment = +{ + if (self.attachment) setmodel(self.attachment, ""); + if (self.attachment2) setmodel(self.attachment2, ""); + if (self.attachment3) setmodel(self.attachment3, ""); +}; + +//---------------------------------------------------------------------- +void() bogl_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } + if (self.attachment2) { + self.attachment2.think = SUB_Remove; + self.attachment2.nextthink = time + 0.1; + } + if (self.attachment3) { + self.attachment3.think = SUB_Remove; + self.attachment3.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - overhead SMASH/slime +//====================================================================== +void(vector leftofs, vector rightofs) bogl_throwslime = +{ + local vector org, btarg, dir, avel; + + // Finished with growing balls of slime + bogl_finish_attachment(); + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + makevectors(self.angles); + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_BLORDBALL + (skill * SPEED_BLORDSKILL); + + // Fire left hand off center and at players feet + org = self.origin + attack_vector(leftofs); + btarg =self.enemy.origin + v_right*8 - v_up*8; + dir = normalize(btarg - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_BLORD, self.attack_speed); + + // Fire right hand off center and at players feet + org = self.origin + attack_vector(rightofs); + btarg =self.enemy.origin - v_right*8 - v_up*8; + dir = normalize(btarg - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_BLORD, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float sbframe, float chfeet) bogl_slimeball = +{ + local vector org; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) bogl_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (sbframe == 0) { + setorigin(self.attachment, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment, MODEL_PROJ_BLORD2B); + else setmodel(self.attachment, MODEL_PROJ_BLORD1B); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + setorigin(self.attachment2, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment2, MODEL_PROJ_BLORD2B); + else setmodel(self.attachment2, MODEL_PROJ_BLORD1B); + setsize (self.attachment2, VEC_ORIGIN, VEC_ORIGIN); + self.attachment2.movetype = MOVETYPE_NONE; + self.attachment2.solid = SOLID_NOT; + } + + // Move+Turn towards enemy and make vector + ai_charge(chfeet); + makevectors(self.angles); + + // Generate attachment in hand (left) + org = self.origin + attack_vector(leftofs); + setorigin(self.attachment, org); + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = sbframe; + + // Generate attachment in hand (right) + org = self.origin + attack_vector(rightofs); + setorigin(self.attachment2, org); + self.attachment2.angles_y = rint(random()*359); + self.attachment2.frame = sbframe; +}; + +//---------------------------------------------------------------------- +void() bogl_smash1 =[ $smash1, bogl_smash2 ] { ai_charge(2); + // Cycle around the melee sounds + self.meleeattack = self.meleeattack + 1; + if (self.meleeattack > 2) self.meleeattack = 0; + // Never play the same melee sound twice + if (self.meleeattack == 0) { + sound (self, CHAN_VOICE, "boglord/melee1.wav", 1, ATTN_NORM);} + else if (self.meleeattack == 1) { + sound (self, CHAN_VOICE, "boglord/melee2.wav", 1, ATTN_NORM);} + else {sound (self, CHAN_VOICE, "boglord/melee3.wav", 1, ATTN_NORM);} +}; +void() bogl_smash2 =[ $smash2, bogl_smash3 ] {monster_footstep(FALSE); + bogl_slimeball('21 70 60','32 -53 64',0,6);}; +void() bogl_smash3 =[ $smash3, bogl_smash4 ] { + bogl_slimeball('-5 66 102','2 -58 104',1,6);}; +void() bogl_smash4 =[ $smash4, bogl_smash5 ] { + bogl_slimeball('-34 48 122','-34 -48 124',2,5);}; +void() bogl_smash5 =[ $smash5, bogl_smash6 ] { + bogl_slimeball('-58 30 114','-60 -30 114',3,4);}; +void() bogl_smash6 =[ $smash6, bogl_smash7 ] { + bogl_slimeball('-58 20 109','-62 -17 110',4,1);}; +void() bogl_smash7 =[ $smash7, bogl_smash8 ] { + bogl_slimeball('-24 20 114','-26 -14 124',5,0);}; +void() bogl_smash8 =[ $smash8, bogl_smash9 ] { + bogl_slimeball('32 24 108','42 -18 108',6,0);}; +void() bogl_smash9 =[ $smash9, bogl_smash10] { + bogl_throwslime('32 24 108','42 -18 108');}; +void() bogl_smash10 =[ $smash10, bogl_smash11] {ai_charge(0);}; +void() bogl_smash11 =[ $smash11, bogl_smash12] {ai_charge(5);}; +void() bogl_smash12 =[ $smash12, bogl_run1 ] {ai_charge(4);}; + +//====================================================================== +// RANGE ATTACK 2 - Projectile Lightning attack +//====================================================================== +void() bogl_lightning = +{ + local vector org, dir, vec; + if (self.health < 1) return; + + ai_face (); + self.effects = self.effects | EF_MUZZLEFLASH; + + // Setup skill based attack speed + self.attack_speed = SPEED_BLORDBOLT + (skill * SPEED_BLORDSKILL); + sound (self, CHAN_WEAPON, "boglord/bolt_fire.wav", 1, ATTN_NORM); + + // Aim around player + makevectors (self.angles); + org = self.pos3 + vecrand(10,10,1); + vec = v_right*(crandom()*(20+random()*50)); + dir = normalize((self.enemy.origin + vec) - org); + launch_projectile(org, dir, CT_PROJ_BLBOLT, self.attack_speed); + + org = self.pos3 + vecrand(10,10,1); + vec = v_right*(crandom()*(20+random()*50)); + dir = normalize((self.enemy.origin + vec) - org); + launch_projectile(org, dir, CT_PROJ_BLBOLT, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float sbframe) bogl_casting = +{ + local vector org, dir, tang; + local float midpoint; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) bogl_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (sbframe == 0) { + setorigin(self.attachment, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment, MODEL_PROJ_BLORDBEAM2); + else setmodel(self.attachment, MODEL_PROJ_BLORDBEAM1); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.frame = 1; + + setorigin(self.attachment2, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment2, MODEL_PROJ_BLORDBEAM2); + else setmodel(self.attachment2, MODEL_PROJ_BLORDBEAM1); + setsize (self.attachment2, VEC_ORIGIN, VEC_ORIGIN); + self.attachment2.movetype = MOVETYPE_NONE; + self.attachment2.solid = SOLID_NOT; + self.attachment2.frame = 1; + + setorigin(self.attachment3, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment3, MODEL_PROJ_BLORD2B); + else setmodel(self.attachment3, MODEL_PROJ_BLORD1B); + setsize (self.attachment3, VEC_ORIGIN, VEC_ORIGIN); + self.attachment3.movetype = MOVETYPE_NONE; + self.attachment3.solid = SOLID_NOT; + } + + // Turn toward enemy + ai_face(); + makevectors(self.angles); + + // Work out each hand position + self.pos1 = self.origin + attack_vector(leftofs); + self.pos2 = self.origin + attack_vector(rightofs); + dir = normalize(self.pos2 - self.pos1); + tang = vectoangles(dir); + // Calculate the mid point between the hands for the orb + midpoint = vlen(self.pos2 - self.pos1) * 0.5; + self.pos3 = self.pos1 + (dir*midpoint); + + // Move beam sections into place along vector + setorigin(self.attachment, self.pos1+(dir*16)); + setorigin(self.attachment2, self.pos2-(dir*16)); + self.attachment.angles = self.attachment2.angles = tang; + + // Place orb in the center of the electricity + setorigin(self.attachment3, self.pos3); + self.attachment3.angles_y = rint(random()*359); + self.attachment3.frame = sbframe+8; + + particle_explode(self.pos1, 5+random()*5, 1, self.part_style, PARTICLE_BURST_LOSTUP); + particle_explode(self.pos2, 5+random()*5, 1, self.part_style, PARTICLE_BURST_LOSTUP); +}; + +//---------------------------------------------------------------------- +void() bogl_magic1 =[ $magic1, bogl_magic2 ] {ai_face(); + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "boglord/attack2.wav", 1, ATTN_NORM);}; +void() bogl_magic2 =[ $magic2, bogl_magic3 ] { + bogl_casting('0 53 86','21 -10 102',0);}; +void() bogl_magic3 =[ $magic3, bogl_magic4 ] { + bogl_casting('-16 50 95','11 0 108',1);}; +void() bogl_magic4 =[ $magic4, bogl_magic5 ] {monster_footstep(FALSE); + bogl_casting('-28 48 100','6 3 110',2);}; +void() bogl_magic5 =[ $magic5, bogl_magic6 ] { + bogl_casting('-3 34 119','19 -15 110',3);}; +void() bogl_magic6 =[ $magic6, bogl_magic9 ] {bogl_lightning(); + // Finished with growing ball of energy + bogl_finish_attachment(); + SpawnExplosion(self.part_life, self.pos3, "boglord/slime_explode.wav"); +}; +void() bogl_magic9 =[ $magic9, bogl_magic10 ] {bogl_lightning();}; +void() bogl_magic10 =[ $magic10, bogl_magic11 ] {bogl_lightning();monster_footstep(FALSE);}; +void() bogl_magic11 =[ $magic11, bogl_magic12 ] { + if (skill == SKILL_NIGHTMARE) bogl_lightning();}; +void() bogl_magic12 =[ $magic12, bogl_run1 ] {}; + +//============================================================================ +void() bogl_tetherattack = +{ + // Completely randomize tether attack chance 50/50 + // Both attacks have different advantages with different + // skill levels, might as well make it equal chance + if (random() > 0.5) self.th_melee(); + else self.th_missile(); +}; + +//============================================================================ +void() bogl_pain1 =[ $pain1, bogl_pain2 ] {}; +void() bogl_pain2 =[ $pain2, bogl_pain3 ] {}; +void() bogl_pain3 =[ $pain3, bogl_pain4 ] {}; +void() bogl_pain4 =[ $pain4, bogl_pain5 ] {}; +void() bogl_pain5 =[ $pain5, bogl_pain6 ] {}; +void() bogl_pain6 =[ $pain6, bogl_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) bogl_pain = +{ + // Finish with all attachments + bogl_finish_attachment(); + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) bogl_pain1 (); + } +}; + +//============================================================================ +// Classic death pose! Dead Boggy! +//============================================================================ +void() bogl_death1 =[ $death1, bogl_death2 ] {}; +void() bogl_death2 =[ $death2, bogl_death3 ] {monster_check_gib();}; +void() bogl_death3 =[ $death3, bogl_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() bogl_death4 =[ $death4, bogl_death5 ] {}; +void() bogl_death5 =[ $death5, bogl_death6 ] {}; +void() bogl_death6 =[ $death6, bogl_death7 ] {}; +void() bogl_death7 =[ $death7, bogl_death8 ] {}; +void() bogl_death8 =[ $death8, bogl_death9 ] {}; +void() bogl_death9 =[ $death9, bogl_death10 ] {}; +void() bogl_death10 =[ $death10, bogl_death11 ] {monster_death_postcheck();}; +void() bogl_death11 =[ $death11, bogl_death11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() bogl_die = +{ + // Finish and remove all attachments + bogl_finish_attachment(); + bogl_remove_attachment(); + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "boglord/death1.wav", 1, ATTN_NORM); + bogl_death1 (); + } + else { + //Explosion for gib death! + T_RadiusDamage (self, self, self.dmg, world, DAMAGEALL); + // Sprite/Particle based explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + // Play original explosion sound or replacement + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + } +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() bogl_wakeup1 =[ $smash7, bogl_wakeup2 ] {}; +void() bogl_wakeup2 =[ $smash8, bogl_wakeup3 ] { + sound (self, CHAN_VOICE, "boglord/melee3.wav", 1, ATTN_NORM);}; +void() bogl_wakeup3 =[ $smash9, bogl_wakeup4 ] {}; +void() bogl_wakeup4 =[ $smash10, bogl_wakeup5 ] {}; +void() bogl_wakeup5 =[ $smash11, bogl_wakeup6 ] {}; +void() bogl_wakeup6 =[ $smash12, bogl_run1 ] {}; + +/*====================================================================== +QUAKED monster_boglord (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_boglord = +{ + if (deathmatch) { remove(self); return; } + + // One model, two different skins + self.mdl = "progs/mon_bossboglord.mdl"; + + // Detect version types + if (self.spawnflags & MON_BOGL_STRONG) { + // Unique models for blood trail on model flag + self.headmdl = "progs/h_boglordb.mdl"; // +2 skins + self.gib1mdl = "progs/gib_blclaw1b.mdl"; // Left claw + self.gib2mdl = "progs/gib_blclaw2b.mdl"; // Right claw + self.gib3mdl = "progs/gib_blfoot1b.mdl"; // foot + self.gib4mdl = "progs/gib_blfoot2b.mdl"; // foot + self.part_style = PARTICLE_BURST_RED; + self.part_life = EXPLODE_MED; + if (self.health < 1) self.health = 2000; + self.exactskin = 1; // Dark red/purple + self.poisonous = FALSE; // Cannot be poisonous + self.deathstring = " was toasted by a Fire Shambler\n"; + } + else { + // Unique models for wizard trail on model flags + self.headmdl = "progs/h_boglord.mdl"; // +2 skins + self.gib1mdl = "progs/gib_blclaw1.mdl"; // Left claw + self.gib2mdl = "progs/gib_blclaw2.mdl"; // Right claw + self.gib3mdl = "progs/gib_blfoot1.mdl"; // foot + self.gib4mdl = "progs/gib_blfoot2.mdl"; // foot + self.part_style = PARTICLE_BURST_YELLOW; + self.part_life = EXPLODE_POISON_MED; + if (self.health < 1) self.health = 1200; + self.exactskin = 0; // Swampy green + + precache_poisongibs(); // precache gibs + self.poisonous = TRUE; // Green vulcan blood! + self.gibtype = GIBTYPE_POISON; // Liquid Poison + self.deathstring = " was obliterated by The Bog Lord\n"; + } + + // Precache model + unique particle trail + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // All extra/projectiles (both types) + precache_model (MODEL_PROJ_BLORD1B); // Slime ball + precache_model (MODEL_PROJ_BLORD2B); // Fire ball + precache_model (MODEL_PROJ_BLORD1S); // Floor blobs + precache_model (MODEL_PROJ_BLORDBEAM1); // Lightning between hands + precache_model (MODEL_PROJ_BLORDBEAM2); + precache_model (MODEL_PROJ_BLORDBOLT1); // Large Bolt Projectile + precache_model (MODEL_PROJ_BLORDBOLT2); + + self.idle_sound = "boglord/idle1.wav"; + self.idle_sound2 = "boglord/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("boglord/death1.wav"); + self.pain_sound = "boglord/pain1.wav"; + self.pain_sound2 = "boglord/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("boglord/melee1.wav"); + precache_sound ("boglord/melee2.wav"); + precache_sound ("boglord/melee3.wav"); + precache_sound ("boglord/bolt_fire.wav"); + + // Slime arc attack (not used anymore) + precache_sound ("boglord/attack2.wav"); + precache_sound ("boglord/slime_explode.wav"); + precache_sound ("boglord/slime_miss.wav"); + + // Melee attacks no longer used anymore + //self.meleehitsound = "boglord/smack.wav"; + //precache_sound (self.meleehitsound); + + self.sight_sound = "boglord/sight.wav"; + precache_sound (self.sight_sound); + precache_sound ("boglord/thud.wav"); + precache_sound ("boglord/bangdoor1.wav"); + precache_sound ("boglord/bangdoor2.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 80'; + self.bboxtype = BBOX_CUSTOM; // Custom size + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.gibhealth = -60; // Shambler gibness! + self.gibbed = FALSE; // Starts complete + self.pain_flinch = 400; // Really low chance of pain + self.pain_timeout = 2; // long pause on pain + self.infightextra = 8; // Does not like infighting + self.steptype = FS_TYPELARGE; // Large stomping feet + self.blockudeath = TRUE; // No player gib sound + self.pain_longanim = FALSE; // cannot be chopped with shadow axe + self.no_liquiddmg = TRUE; // no slime/lava damage + self.tetherturn = TRUE; // Always turn towards enemy + self.tetherpause = 0.9; // Rarely pauses to attacks + self.dmg = 40; // Radius dmg for gibondeath + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0.75; + self.reflectlightning = TRUE; // Reflect lightning strikes + self.reflectplasma = TRUE; // Reflect plasma projectiles + + self.th_checkattack = BogLordCheckAttack; + self.th_stand = bogl_stand1; + self.th_walk = bogl_walk1; + self.th_run = bogl_run1; + self.th_melee = bogl_smash1; + self.th_missile = bogl_magic1; + self.th_pain = bogl_pain; + self.th_die = bogl_die; + self.th_wakeup = bogl_wakeup1; + self.th_tether = bogl_tetherattack; + + self.classtype = CT_MONBOGLORD; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_bosseidolon.qc b/QC_other/QC_arcane/mon_bosseidolon.qc new file mode 100644 index 00000000..3fb25ea2 --- /dev/null +++ b/QC_other/QC_arcane/mon_bosseidolon.qc @@ -0,0 +1,1110 @@ +/*============================================================================== +Eidolon Demon from Hexen2 / Altar of Storms MOD +==============================================================================*/ +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 + +$frame spell1 spell2 spell3 spell4 spell5 spell6 spell7 spell8 +$frame spell9 spell10 spell11 spell12 spell13 spell14 spell15 spell16 +$frame spell17 spell18 spell19 spell20 + +$frame howl1 howl2 howl3 howl4 howl5 howl6 howl7 howl8 +$frame howl9 howl10 howl11 howl12 howl13 howl14 howl15 howl16 +$frame howl17 howl18 howl19 howl20 howl21 howl22 howl23 howl24 +$frame howl25 howl26 howl27 howl28 + +$frame crouch1 crouch2 crouch3 crouch4 crouch5 crouch6 crouch7 crouch8 +$frame crouch9 crouch10 crouch11 crouch12 crouch13 crouch14 crouch15 crouch16 +$frame crouch17 crouch18 crouch19 crouch20 crouch21 crouch22 crouch23 crouch24 +$frame crouch25 crouch26 crouch27 crouch28 crouch29 crouch30 + +$frame crWait1 crWait2 crWait3 crWait4 crWait5 crWait6 crWait7 crWait8 +$frame crWait9 crWait10 crWait11 crWait12 crWait13 crWait14 crWait15 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 +$frame grow9 grow10 grow11 grow12 grow13 grow14 grow15 grow16 +$frame grow17 grow18 grow19 grow20 grow21 grow22 grow23 grow24 + +$frame breath1 breath2 breath3 breath4 breath5 breath6 breath7 breath8 +$frame breath9 breath10 breath11 breath12 breath13 breath14 breath15 breath16 +$frame breath17 breath18 breath19 breath20 breath21 breath22 breath23 breath24 +$frame breath25 breath26 breath27 breath28 breath29 breath30 breath31 breath32 +$frame breath33 breath34 breath35 breath36 breath37 breath38 breath39 breath40 +$frame breath41 breath42 breath43 + +$frame power1 power2 power3 power4 power5 power6 power7 power8 +$frame power9 power10 power11 power12 power13 power14 power15 power16 +$frame power17 power18 power19 power20 + +$frame painA1 painA2 painA3 painA4 painA5 painA6 painA7 painA8 painA9 +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 painB14 painB15 painB16 +$frame painB17 painB18 painB19 painB20 + +float EIDOLON_PHASE1 = 1; // Trapped in cage +float EIDOLON_PHASE2 = 2; // Fighting + +//====================================================================== +// Global functions +//====================================================================== +// Work out angle difference between player and boss +//---------------------------------------------------------------------- +float(vector targorg, float angdiff) eidolon_angcheck = +{ + self.ideal_yaw = vectoyaw(targorg - self.origin); + if ((self.ideal_yaw - angdiff) > self.angles_y) return TRUE; + else if ((self.ideal_yaw + angdiff)<self.angles_y) return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Need own find player function because of arena size +// Also setup all parameters ready to start combat quicker +//---------------------------------------------------------------------- +float() eidolon_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // Stage 1 is trapped, boss cannot attack or run + if (self.style == EIDOLON_PHASE1) return FALSE; + + // Move straight into run+attack + self.nextthink = time + 0.1; + self.think = self.th_run; // Start running + SUB_AttackFinished (1); // wait a while before first attack + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() eidolon_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP reached next wave, walk to center and fire targets +//---------------------------------------------------------------------- +float() eidolon_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") { + self.attachment2 = find(world, targetname, self.noise); + if (self.attachment2.classtype == CT_MONEIDOLONWAVE) { + // Spawn any adds to keep player busy + if (self.attachment2.target != "") + trigger_strs(self.attachment2.target, self); + + // Turn around and fire at crystal + self.th_jump(); + } + } + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + eidolon_WaveSetupHP(); // Reset trigger/hp + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Eidolon game play logic +//---------------------------------------------------------------------- +void() EidolonCheckAttack = +{ + // Check for boss wave trigger events + if (eidolon_WaveCheck() == TRUE) return; + + //---------------------------------------------------------------------- + // Check the tether system + //---------------------------------------------------------------------- + self.t_length = vlen(self.origin - self.movelast.origin); + self.t_width = vlen(self.enemy.origin - self.movelast.origin); + // Is the boss at maximum range? + if (self.t_length > MONAI_MAXEIDO) { + // Can the boss see the player? + if (enemy_vis) self.attack_state = AS_MELEE; + else { + // At max range + cannot see player, exit combat + self.enemytarget = self.enemy; + self.enemy = world; + self.goalentity = self.movetarget = self.movelast; + self.attack_state = AS_STRAIGHT; + self.think = self.th_walk; + } + return; + } + + //---------------------------------------------------------------------- + // Check Melee range and constantly fire + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_CLOSEEIDO) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // Range attacks (Boulder + Rock Storm) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + // Intense rock storm attack + if (self.enemydist < MONAI_MEDIUMEIDO && random() < 0.75) { + // Skill 0=3s, 1=2.25s, 2=1.5s, 3=0.75s + self.attack_speed = (4 - skill) * 0.75; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MELEE; + return; + } + // Large boulder attack + else { + // Skill 0=4s, 1=3s, 2=2s, 3=1s + self.attack_speed = (4 - skill) * 1; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MISSILE; + return; + } + } +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() eidolon_idle = +{ + // Do nothing if dead + if (self.health < 1) return; + if (self.walkframe == 1) monster_idle_sound(); + self.nextthink = time + 0.05; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 14) self.walkframe = 0; + self.frame = $stand1 + self.walkframe; + + // Keep looking for a player + eidolon_FindTarget (); + + if (self.style == EIDOLON_PHASE1) { + // Slow animation speed, trapped inside cage + self.nextthink = time + 0.1; + // Found a player, now track them around the room + if (self.enemy.flags & FL_CLIENT) { + if (eidolon_angcheck(self.enemy.origin, 60)) + self.think = self.th_walk; + } + } +}; + +//---------------------------------------------------------------------- +void() eidolon_stand1 = [ $stand1, eidolon_idle ] {self.walkframe = 0;}; + +//====================================================================== +// There is only one set of animations for walk and run and +// the only different is the final AI state (walk/run) +// This is a hexen2 model so it should run at 20fps not 10fps +//---------------------------------------------------------------------- +float EIDOLON_WALK = 2; +float EIDOLON_RUN = 4; + +//---------------------------------------------------------------------- +void(float fstate) eidolon_move = +{ + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.05; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 23) self.walkframe = 0; + self.frame = $walk1 + self.walkframe; + + // Check for any special frame events + if (self.frame == $walk1) monster_idle_sound(); + if (self.frame == $walk2 || self.frame == $walk14) + monster_footstep(FALSE); + + // Phase 1 (caged) uses walk to turn around + if (self.style == EIDOLON_PHASE1) { + // Wrong angle difference? keep turning + if (eidolon_angcheck(self.enemy.origin, 10)) ChangeYaw(); + else { + // Close the beginning or the end of the animation? + if (self.walkframe < 4 || self.walkframe > 20) + self.think = self.th_stand; + } + } + // Phase 2 (free) walking back to center + else if (self.style == EIDOLON_PHASE2 && fstate == EIDOLON_WALK) { + // Check for player + if (eidolon_FindTarget ()) return; + + // Calculate distance to origin location (notouch function) + self.enemydist = vlen(self.movelast.origin - self.origin); + // Reached origin point yet? + if (self.enemydist < MONAI_SPAWNEIDO) { + // Still remember the old player? + if (self.enemytarget.flags & FL_CLIENT) { + self.enemy = self.enemytarget; + self.enemytarget = world; + } + // Keep turning towards old player + if (eidolon_angcheck(self.enemy.origin, 10)) ChangeYaw(); + else self.think = self.th_stand; + } + // Still not reached center + else movetogoal(6); + } + // Time to walk or run? + else if (fstate == EIDOLON_RUN && self.enemy) ai_run(6); +}; + +//---------------------------------------------------------------------- +void() eidolon_walk1 = [ $walk1, eidolon_walk1 ] {eidolon_move(EIDOLON_WALK);}; +void() eidolon_run1 = [ $walk1, eidolon_run1 ] {eidolon_move(EIDOLON_RUN);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() eidolon_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_EIDO1; + } +}; + +//---------------------------------------------------------------------- +void() eidolon_setup_attachment = +{ + // Is monster dead or dying? + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) eidolon_create_attachment(); + + // Move attachment into place ready for use + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setmodel(self.attachment, MODEL_EMPTY); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + setorigin(self.attachment, self.origin); + // Using empty model, so reset angle, frame and skin. + self.attachment.angles = self.angles; + self.attachment.frame = self.attachment.skin = 0; +}; + +//---------------------------------------------------------------------- +void() eidolon_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() eidolon_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//====================================================================== +// ATTACK A - Fire large explosive rock (grenade) +// Animation - Spell, put right hand up and infront +//====================================================================== +void(vector rockofs) Fire_attackA = +{ + local float foffset, offset, shotcount; + local vector org, sorg, dir, offang, avel; + + // Finished with growing rock + eidolon_finish_attachment(); + + if (!self.enemy) return; + if (self.health < 1) return; + + makevectors(self.angles); + org = self.origin + attack_vector(rockofs); + self.effects = self.effects | EF_MUZZLEFLASH; + + // create an arc of rockets fanning outwards from source + foffset = 8; + offset = -foffset; shotcount = 3; + while (shotcount > 0) { + // based angle of projectiles on straight line between source and target + offang = vectoangles ((self.enemy.origin-'0 0 24') - org); + offang_y = offang_y + offset; + makevectors (offang); + + // Randomly spawn projectiles around central point + sorg = org + v_up * (5 + random() * 10); + + // Straight line velocity from source to target + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; // Slight wiggle up/down + avel = vecrand(100,200,FALSE); + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_EIDOROCK + (skill * SPEED_EIDOSKILL) + random()*10; + Launch_Missile (sorg, dir, avel, CT_PROJ_EIDO1, self.attack_speed ); + offset = offset + foffset; + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +void(vector rockofs, float rockframe) Setup_attackA = +{ + local vector org; + + // Check if attachment has been setup yet + if (!self.attachment) eidolon_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (rockframe == 0) { + self.attachment.state = STATE_ON; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Start throwing rock sound + sound (self, CHAN_WEAPON, "eidolon/attacka.wav", 1, ATTN_NORM); + } + + // Turn towards enemy and update model attachment + // The offset is based on the Eidolon facing forward + makevectors(self.angles); + org = self.origin + attack_vector(rockofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = rockframe; + // Random explosion like particles from ball as it grows + particle_explode(self.attachment.origin, 10+random()*10, 0.5+random(), PARTICLE_BURST_WHITE, 0); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackA2 = { + // Do nothing if dead + if (self.health < 0) return; + + self.nextthink = time + 0.05; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 19) self.think = self.th_run; + self.frame = $spell1 + self.walkframe; + + // Keep turning towards the player + if (self.frame < $spell14) ai_face(); + + // Check the state of the projectile (grow/fire) + if (self.frame == $spell3) eidolon_setup_attachment(); + else if (self.frame == $spell4) Setup_attackA('60 18 64',0); + else if (self.frame == $spell5) Setup_attackA('62 18 68',1); + else if (self.frame == $spell6) Setup_attackA('64 18 72',2); + else if (self.frame == $spell7) Setup_attackA('68 18 78',3); + else if (self.frame == $spell8) Setup_attackA('72 18 86',4); + else if (self.frame == $spell9) Setup_attackA('74 18 96',5); + else if (self.frame == $spell10) Setup_attackA('70 18 104',6); + else if (self.frame == $spell11) Setup_attackA('72 18 112',7); + else if (self.frame == $spell12) Setup_attackA('73 18 112',7); + else if (self.frame == $spell13) Fire_attackA('73 18 112'); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackA1 = [ $spell1, eidolon_attackA2 ] {ai_face(); + self.pain_finished = time + 1.5; + self.walkframe = 0; +}; + +//====================================================================== +// ATTACK B - Drops rocks randomly from above player +// Animation - Howl, raise arms up and then pull down +//====================================================================== +void() eidolon_attackB1 = +{ +}; + +//====================================================================== +// ATTACK C - Projectile vomit rocks and dust at the player +// Animation - breathe, swings arms back and push head forward +//====================================================================== +void(vector rockofs) Fire_attackC = +{ + local vector org, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + makevectors(self.angles); + // Spawn a mist of particles where projectiles came from + org = self.origin + attack_vector(rockofs) + v_right*(crandom()*8) + v_up*(crandom()*16); + + dir = normalize(self.enemy.origin - org); + particle_explode(org, 5 + rint(random()*5), 2, PARTICLE_BURST_WHITE, PARTICLE_BURST_UPWARD); + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_EIDOSPIKE + (skill * SPEED_EIDOSKILLSP); + + launch_projectile (org, dir, CT_PROJ_GROCK, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackC2 = { + // Do nothing if dead + if (self.health < 0) return; + + self.nextthink = time + 0.05; + // Keep turning towards the player + ai_face(); + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 43) self.think = self.th_run; + self.frame = $breath1 + self.walkframe; + + // Start demon roar and then rocks!?! + if (self.frame == $breath4) + sound (self, CHAN_WEAPON, "eidolon/attackc.wav", 1, ATTN_NORM); + + // Rock breath!?! + if (self.frame > $breath17 && self.frame < $breath35) + Fire_attackC('56 0 44'); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackC1 = [ $breath1, eidolon_attackC2 ] {ai_face(); + self.pain_finished = time + 2; + self.walkframe = 0; +}; + +//====================================================================== +// ATTACK D - Throw a bunch of rocks upward towards the player +// Animation - death/grow, crouch down and swing arms upward +//====================================================================== +void() eidolon_attackD1 = +{ +}; + +//====================================================================== +// ATTACK E - Summon monsters from blocks of stone +// Animation - power, lean head back, put hands up right infront +//====================================================================== +void(vector rockofs, float rockframe) Setup_attackE = +{ + local vector org; + + // Check if attachment has been setup yet + if (!self.attachment) eidolon_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (rockframe == 0) { + self.attachment.state = STATE_ON; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.skin = 1; + + // Start long growl + sound (self, CHAN_VOICE, "eidolon/attacke.wav", 1, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + } + + if (rockframe == 7) { + // Goodbye little rock! + eidolon_finish_attachment(); + // Wakeup crystal and golems + if (self.attachment2.target2 != "") + trigger_strs(self.attachment2.target2, self); + } + else { + // Turn towards enemy and update model attachment + // The offset is based on the Eidolon facing forward + makevectors(self.angles); + org = self.origin + attack_vector(rockofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = rockframe; + // Random explosion like particles from ball as it grows + particle_explode(self.attachment.origin, 10+random()*10, 0.5+random(), PARTICLE_BURST_BLUE, 0); + + // Generate the lightning effect + self.effects = self.effects | EF_MUZZLEFLASH; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.attachment.origin_x); + WriteCoord (MSG_BROADCAST, self.attachment.origin_y); + WriteCoord (MSG_BROADCAST, self.attachment.origin_z); + WriteCoord (MSG_BROADCAST, self.attachment2.origin_x); + WriteCoord (MSG_BROADCAST, self.attachment2.origin_y); + WriteCoord (MSG_BROADCAST, self.attachment2.origin_z); + } +}; + +//---------------------------------------------------------------------- +void() eidolon_attackE_firing = { + self.nextthink = time + 0.1; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + // is the lightning spell finished? + if (self.walkframe > 19) { + self.think = self.th_run; + self.walkframe = 0; + Resist_ChangeType(self, FALSE); + self.takedamage = DAMAGE_YES; + self.goalentity = self.enemy; + } + self.frame = $power1 + self.walkframe; + + // Check the state of the projectile (grow/fire) + if (self.frame == $power7) Setup_attackE('68 16 84',0); + else if (self.frame == $power8) Setup_attackE('72 16 92',1); + else if (self.frame == $power9) Setup_attackE('74 16 94',2); + else if (self.frame == $power10) Setup_attackE('76 16 98',3); + else if (self.frame == $power11) Setup_attackE('76 16 102',4); + else if (self.frame == $power12) Setup_attackE('78 16 104',5); + else if (self.frame == $power13) Setup_attackE('80 16 104',7); +} + +//---------------------------------------------------------------------- +void() eidolon_attackE2 = [ $power1, eidolon_attackE_firing ] { + self.walkframe = 0; +}; + +//---------------------------------------------------------------------- +void() eidolon_attackE_turning = { + self.nextthink = time + 0.05; + + // Turn towards the power crystal + if (eidolon_angcheck(self.attachment2.origin,5)) ChangeYaw(); + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 23) { + self.think = eidolon_attackE2; + self.walkframe = 0; + } + self.frame = $walk1 + self.walkframe; + + // Check for any special frame events + if (self.frame == $walk2 || self.frame == $walk14) + monster_footstep(FALSE); + + // Move slowly closer to crystal or backward! + self.enemydist = range_distance(self.attachment2, FALSE); + if (self.enemydist > MONAI_CLOSEEIDO) movetogoal(6); + else walkmove (self.ideal_yaw - 180, 3); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackE1 = [ $walk1, eidolon_attackE_turning ] { + Resist_ChangeType(self, TRUE); + self.takedamage = DAMAGE_NO; + self.goalentity = self.attachment2; + self.yaw_speed = 6; // Turning slowly + self.walkframe = 0; // Reset animation counter + + // Check angle difference betweem boss and crystal + // If within 5 degree's tolerance, skip turning + if (!eidolon_angcheck(self.attachment2.origin,5)) + self.think = eidolon_attackE2; +}; + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void() eidolon_painA2 = +{ + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.1; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 8) { + self.frame = $painA8; + self.think = eidolon_run1; + } + else self.frame = $painA1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() eidolon_painB2 = +{ + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.05; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 19) { + self.frame = $painB20; + self.think = eidolon_run1; + } + else self.frame = $painB1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() eidolon_painA1 = [ $painA1, eidolon_painA2 ] {self.walkframe = 0;}; +void() eidolon_painB1 = [ $painB1, eidolon_painB2 ] {self.walkframe = 0;}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) eidolon_pain = +{ + // Finish with all attachments + eidolon_finish_attachment(); + + // Check for boss wave trigger events + if (eidolon_WaveCheck() == TRUE) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.7) eidolon_painA1 (); // Short recoil + else { + eidolon_painB1 (); // Long recoil + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +// Oh no rocky has died!?! +//============================================================================ +void() eidolon_explode = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // No more Boss! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_PLASMA_BIG, self.origin, "eidolon/explode_death.wav"); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(11, 10 + rint(random()*10)); // Small Golem rock + ThrowGib(12, 10 + rint(random()*10)); // Large Golem rock + ThrowGib(4, 5 + rint(random()*3)); // Some flesh bits + ThrowGib(5, 5 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() eidolon_die2 = +{ + self.nextthink = time + 0.1; + if (self.frame == $crouch3) self.solid = SOLID_NOT; + + // Keep moveing the animation frame forward + if (self.walkframe < 30) { + self.walkframe = self.walkframe + 1; + self.frame = $crouch1 + self.walkframe; + } + else { + // Make sure final frame is set + self.frame = $crouch30; + + // Spawn implosion effect + if (random() < 0.5) + particle_implode(self.origin, 20+random()*20, 100, 100, PARTICLE_BURST_WHITE); + // Spawn particle smoke and explosive smoke + else { + SpawnProjectileSmoke(self.origin, 150, 100, 300); + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_WHITE); + } + + // Check for any random lightning strikes outward + if (random() < 0.5) { + self.pos1 = self.origin - '0 0 16'; + self.pos2 = vecrand(0,50,TRUE); + self.pos2_z = 25 + random()*25; // Always up! + self.pos3 = normalize(self.pos2); + traceline(self.pos1, self.pos1 + self.pos3 * 600, FALSE, self); + + // Create lightning bolt + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Play some arching lightning sounds + if (random() < 0.5) { + if (random() < 0.5) sound (self, CHAN_BODY, "eidolon/elec_arch1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "eidolon/elec_arch2.wav", 1, ATTN_NORM); + } + } + + // Cycle through end phase + self.lip = self.lip + 1; + self.nextthink = time + 0.1; // Slow down to regular time + if (self.lip == 26) sound (self, CHAN_AUTO, "eidolon/implode_death.wav", 1, ATTN_NONE); + if (self.lip > 40) eidolon_explode(); + } +}; + +//---------------------------------------------------------------------- +void() eidolon_die1 = [ $crouch1, eidolon_die2 ] { + self.walkframe = self.lip = 0; +}; + +//---------------------------------------------------------------------- +void() eidolon_die = +{ + self.deadflag = DEAD_DEAD; // the rock finally crashed + self.effects = 0; // Remove effects on death + eidolon_finish_attachment(); // Remove any attachments + eidolon_remove_attachment(); + + sound (self, CHAN_VOICE, "eidolon/death.wav", 1, ATTN_NORM); + eidolon_die1 (); +}; + +//====================================================================== +// Roar and break free from cage! +//====================================================================== +void() eidolon_free2 = +{ + // Do nothing if dead + if (self.health < 0) return; + + self.nextthink = time + 0.1; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 27) { + self.yaw_speed = 20; // Average Speed + Resist_ChangeType(self, FALSE); // Default resistance + self.think = self.th_run; // Start running! + } + self.frame = $howl1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() eidolon_free1 = [ $howl1, eidolon_free2 ] { + self.takedamage = DAMAGE_YES; // Enable resistance effects + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + self.walkframe = 0; +}; + +//====================================================================== +// Setup Eidolon after trigger event +//====================================================================== +void() eidolon_wakeup = +{ + self.use = SUB_Null; // No more triggers + self.style = EIDOLON_PHASE2; // Free to fight + + // Restore all think functions + self.th_stand = eidolon_stand1; + self.th_walk = eidolon_walk1; + self.th_run = eidolon_run1; + self.th_melee = eidolon_attackC1; + self.th_missile = eidolon_attackA1; + self.th_jump = eidolon_attackE1; + self.th_pain = eidolon_pain; + self.th_die = eidolon_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + + // Time for Eidolon to break free! + self.think = eidolon_free1; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() eidolon_start = +{ + self.use = SUB_Null; // Suppress trigger events + self.style = EIDOLON_PHASE1; // Trapped in cage + self.flags = FL_MONSTER; // Reset flag (no user settings) + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + setorigin(self, self.origin); + + self.yaw_speed = 6; // Really slow while in cage + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.pain_longanim = FALSE; // No axe advantage + self.takedamage = DAMAGE_NO; // Immune to damage + + self.gibhealth = -1000; // Special death sequence + self.pain_finished = self.attack_finished = 0; + + // Setup Ammo Resistance + self.resist_shells = self.resist_cells = 0; + self.resist_nails = self.resist_rockets = 0.75; + self.reflectnails = TRUE; // Reflect nail projectiles + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 5; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + eidolon_WaveSetupHP(); + + // default = No think functions + self.th_checkattack = EidolonCheckAttack; + self.th_stand = self.th_walk = self.th_run = SUB_Null; + self.th_missile = self.th_die = SUB_Null; + self.th_pain = SUB_Null_pain; + + // Check there is space for Eidolon to spawn + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Tether point, save for later + self.movelast = spawn(); + self.movelast.owner = self; + self.movelast.classtype = CT_MONEIDOLON; + self.movelast.movetype = MOVETYPE_NONE; + self.movelast.solid = SOLID_NOT; + self.movelast.origin = self.origin; + setsize (self.movelast, VEC_ORIGIN, VEC_ORIGIN); + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; + + // Can only stand around and walk on the spot + self.th_stand = eidolon_stand1; + self.th_walk = self.th_run = eidolon_walk1; + + // Wait for trigger event to be free from cage + self.think = self.th_stand; + self.nextthink = time + 0.1; + self.use = eidolon_wakeup; +}; + +/*====================================================================== + QUAKED monster_eidolon (1 0 0) (-32 -32 -24) (32 32 128) +======================================================================*/ +void() monster_eidolon = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_bosseidolon.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_EIDO1); + precache_model (MODEL_PROJ_GROCK1); + precache_model (MODEL_PROJ_GROCK2); + + self.gib1mdl = MODEL_PROJ_GROCK1; // small golem rock + self.gib2mdl = MODEL_PROJ_GROCK2; // medium golem rock + self.gib1frame = self.gib2frame = 9; + + // sight/pain/death sounds + self.idle_sound = "eidolon/idle1.wav"; + self.idle_sound2 = "eidolon/idle2.wav"; + self.pain_sound = "eidolon/pain.wav"; + self.sight_sound = "eidolon/sight.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.pain_sound); + precache_sound (self.sight_sound); + + // Final death sequence + precache_sound ("eidolon/death.wav"); + precache_sound ("eidolon/explode_death.wav"); + precache_sound ("eidolon/implode_death.wav"); + precache_sound ("eidolon/elec_arch1.wav"); + precache_sound ("eidolon/elec_arch2.wav"); + + // Attack A - Throw Boulder - range attack + precache_sound ("eidolon/attacka.wav"); + precache_sound ("eidolon/rock_hit1.wav"); + precache_sound ("eidolon/rock_hit2.wav"); + + // Attack C - Rockstorm - range attack + precache_sound ("eidolon/attackc.wav"); + precache_sound (SOUND_IMP_ROCK1); + precache_sound (SOUND_IMP_ROCK2); + precache_sound (SOUND_IMP_ROCK3); + precache_sound (SOUND_IMP_ROCK4); + + // Attack E - Lightning at summoning crystal - range attack + precache_sound ("eidolon/attacke.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 128'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.poisonous = FALSE; // Cannot be poisonous + self.deathstring = " was pulverized by the Sculptor\n"; + + self.health = self.max_health = MEGADEATH; + self.pain_finished = time + LARGE_TIMER; + self.takedamage = DAMAGE_NO; // Immune to damage + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // 1/2 Shambler level + self.pain_timeout = 2; // Stop constant pain + self.infightextra = 3; // Crazy damage, noinfighting + self.skin = 1; // New rocky skin + + // Custom feet sounds + self.stepc1 = "eidolon/footstep1.wav"; + self.stepc2 = "eidolon/footstep2.wav"; + self.stepc3 = "eidolon/footstep3.wav"; + self.stepc4 = "eidolon/footstep4.wav"; + self.stepc5 = "eidolon/footstep1.wav"; + precache_sound (self.stepc1); + precache_sound (self.stepc2); + precache_sound (self.stepc3); + precache_sound (self.stepc4); + precache_sound (self.stepc5); + self.steptype = FS_TYPECUSTOM; + + self.classtype = CT_MONEIDOLON; + self.classgroup = CG_STONE; + self.classmove = MON_MOVEWALK; + self.style = 0; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[EIDO_BOSS]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + total_monsters = total_monsters + 1; + self.use = eidolon_start; +}; + +/*====================================================================== +/*QUAKED monster_eidolon_wavetrig (0.75 0.25 1) (-32 -32 -4) (32 32 4) x +Target for boss lightning wave event +-------- KEYS -------- +targetname : name of wave event (links to noise key on boss) +target : trigger name of adds to spawn +target2 : trigger name of crystal event +noise : targetname of collision entity +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Target for boss lightning wave event + +======================================================================*/ +void() monster_eidolon_wavetrig = +{ + self.classtype = CT_MONEIDOLONWAVE; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); +}; + diff --git a/QC_other/QC_arcane/mon_bossfiretop.qc b/QC_other/QC_arcane/mon_bossfiretop.qc new file mode 100644 index 00000000..d65c95d7 --- /dev/null +++ b/QC_other/QC_arcane/mon_bossfiretop.qc @@ -0,0 +1,379 @@ +/*============================================================================== +Chthon (Firetop Mountain Version) +==============================================================================*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +float FTOP_IDLE = 1; +float FTOP_ATTACK = 2; + +void(vector orgofs) ftop_fire; +//=========================================================================== +void() ftop_track = +{ + // Find a player + if (self.enemy == world) { + self.enemy = find(world, classname, "player"); + // reset enemy if no player found! + if (!self.enemy) self.enemy = world; + } + + // Check for any no combat conditions + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.health < 1) self.enemy = world; + + // Update particle effect around base of Chthon + makevectors(self.angles); + particle_debuff(self.origin+v_forward*32, 96, rint(10+random()*40), PARTICLE_BURST_FIRE); + + // Make sure function keeps going + self.nextthink = time + 0.1; + // Check for enemy + if (self.enemy == world) { + // Check for animation frame reset + if (self.state == FTOP_ATTACK) self.walkframe = 0; + self.think = self.th_stand; + } + else { + // Check for animation frame reset + if (self.state == FTOP_IDLE) self.walkframe = 0; + self.think = self.th_run; + } +}; + +//---------------------------------------------------------------------- +void() ftop_idleframe = +{ + // If dead, no more updates + if (self.deadflag > DEAD_NO) return; + + // Always reset HP (super high) + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.state = FTOP_IDLE; + + // Update frame + self.frame = $walk1 + self.walkframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 30) self.walkframe = 0; + + // Check for enemies + ftop_track(); +}; + +//---------------------------------------------------------------------- +void() ftop_attackframe = +{ + // If dead, no more updates + if (self.deadflag > DEAD_NO) return; + + // Always reset HP (super high) + self.health = self.max_health; + // Slow down damage/pain functionality + if (self.pain_finished < time) self.takedamage = DAMAGE_YES; + self.state = FTOP_ATTACK; + + // Update frame + self.frame = $attack1 + self.walkframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 22) self.walkframe = 0; + + // Check for any frame conditions + if (self.walkframe == 8) ftop_fire('100 50 250'); + else if (self.walkframe == 19) ftop_fire('100 -50 250'); + + // Check for enemies + ftop_track(); + if (self.enemy) ai_face(); +}; + +//=========================================================================== +void(vector orgofs) ftop_fire = +{ + local vector offang, org, vec, dir, mdest, avel; + local float projlen; + + // No enemy or dead? + if (!self.enemy) return; + if (self.deadflag > DEAD_NO) return; + + sound (self, CHAN_WEAPON, "chthon/attack1.wav", 1, ATTN_NORM); + offang = vectoangles (self.enemy.origin - self.origin); + makevectors (offang); + org = self.origin + attack_vector(orgofs); + + // Skill level adjustment (easy=250, normal=300, hard=350, nm=400) + self.attack_speed = SPEED_LAVABALL + (skill*SPEED_LAVASKILL); + + // Lead the missile on hard mode (This formula is not perfect) + // There are plenty of missiles that go in strange directions, + // especially if the player strafes a lot from side to side. + if (skill > SKILL_NORMAL) { + projlen = vlen(self.enemy.origin - org) / self.attack_speed; + vec = self.enemy.velocity; + vec_z = 0; + mdest = self.enemy.origin + projlen * vec; + } + else mdest = self.enemy.origin; + + dir = normalize (mdest - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_FIRETOP, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() ftop_lightning = +{ + if (!self.movetarget2) return; + if (!self.movetarget3) return; + + self.pos1 = self.movetarget2.origin; + self.pos2 = self.movetarget3.origin; + + // compensate for length of bolt + self.pos2 = self.pos2 - normalize(self.pos2 - self.pos1) * 100; + + // Generate the lightning effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING3); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.pos1_x); + WriteCoord (MSG_BROADCAST, self.pos1_y); + WriteCoord (MSG_BROADCAST, self.pos1_z); + WriteCoord (MSG_BROADCAST, self.pos2_x); + WriteCoord (MSG_BROADCAST, self.pos2_y); + WriteCoord (MSG_BROADCAST, self.pos2_z); +}; + +//=========================================================================== +void(entity inflictor, entity attacker, float damage) ftop_pain = { + // Stop pain reaction and prevent damage + self.pain_finished = time + 3; + self.takedamage = DAMAGE_NO; +}; + +//---------------------------------------------------------------------- +void() ftop_death1 = [$death1, ftop_death2] { + ftop_lightning(); + sound (self, CHAN_VOICE, "chthon/death1.wav", 1, ATTN_NORM); + if (self.noise3 != "") trigger_strs(self.noise3, self); +}; +void() ftop_death2 = [$death2, ftop_death3] {ftop_lightning();}; +void() ftop_death3 = [$death3, ftop_death4] {ftop_lightning();}; +void() ftop_death4 = [$death4, ftop_death5] {}; +void() ftop_death5 = [$death5, ftop_death6] {}; +void() ftop_death6 = [$death6, ftop_death7] {}; +void() ftop_death7 = [$death7, ftop_death8] {}; +void() ftop_death8 = [$death8, ftop_death9] {}; +void() ftop_death9 = [$death9, ftop_death10] { + sound (self, CHAN_BODY, "chthon/lavasplash.wav", 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +}; +void() ftop_death10 = [$death9, ftop_death11] { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + self.health = -1; + entity_hide(self); +}; +void() ftop_death11 = { remove(self); }; + +//=========================================================================== +void() ftop_shocka1 =[ $shocka1, ftop_shocka2 ] {ftop_lightning();}; +void() ftop_shocka2 =[ $shocka2, ftop_shocka3 ] {ftop_lightning();}; +void() ftop_shocka3 =[ $shocka3, ftop_shocka4 ] {ftop_lightning();}; +void() ftop_shocka4 =[ $shocka4, ftop_shocka5 ] {ftop_lightning();}; +void() ftop_shocka5 =[ $shocka5, ftop_shocka6 ] {ftop_lightning();}; +void() ftop_shocka6 =[ $shocka6, ftop_shocka7 ] {ftop_lightning();}; +void() ftop_shocka7 =[ $shocka7, ftop_shocka8 ] {ftop_lightning();}; +void() ftop_shocka8 =[ $shocka8, ftop_shocka9 ] {ftop_lightning();}; +void() ftop_shocka9 =[ $shocka9, ftop_shocka10 ] {ftop_lightning();}; +void() ftop_shocka10 =[ $shocka10, ftop_death1 ] {ftop_lightning(); + if (self.attack_finished > time) self.think = ftop_shocka1;}; + +//---------------------------------------------------------------------- +void() ftop_shockb1 =[ $shockb1, ftop_shockb2 ] {ftop_lightning();}; +void() ftop_shockb2 =[ $shockb2, ftop_shockb3 ] {ftop_lightning();}; +void() ftop_shockb3 =[ $shockb3, ftop_shockb4 ] {ftop_lightning();}; +void() ftop_shockb4 =[ $shockb4, ftop_shockb5 ] {ftop_lightning();}; +void() ftop_shockb5 =[ $shockb5, ftop_shockb6 ] {ftop_lightning();}; +void() ftop_shockb6 =[ $shockb6, ftop_shockb7 ] {ftop_lightning();}; +void() ftop_shockb7 =[ $shockb1, ftop_shockb8 ] {ftop_lightning();}; +void() ftop_shockb8 =[ $shockb2, ftop_shockb9 ] {ftop_lightning();}; +void() ftop_shockb9 =[ $shockb3, ftop_shockb10 ] {ftop_lightning();}; +void() ftop_shockb10 =[ $shockb4, ftop_death1 ] {ftop_lightning(); + if (self.attack_finished > time) self.think = ftop_shockb1;}; + +//---------------------------------------------------------------------- +void() ftop_shockc1 =[ $shockc1, ftop_shockc2 ] {ftop_lightning();}; +void() ftop_shockc2 =[ $shockc2, ftop_shockc3 ] {ftop_lightning();}; +void() ftop_shockc3 =[ $shockc3, ftop_shockc4 ] {ftop_lightning();}; +void() ftop_shockc4 =[ $shockc4, ftop_shockc5 ] {ftop_lightning();}; +void() ftop_shockc5 =[ $shockc5, ftop_shockc6 ] {ftop_lightning();}; +void() ftop_shockc6 =[ $shockc6, ftop_shockc7 ] {ftop_lightning();}; +void() ftop_shockc7 =[ $shockc7, ftop_shockc8 ] {ftop_lightning();}; +void() ftop_shockc8 =[ $shockc8, ftop_shockc9 ] {ftop_lightning();}; +void() ftop_shockc9 =[ $shockc9, ftop_shockc10 ] {ftop_lightning();}; +void() ftop_shockc10 =[ $shockc10, ftop_death1 ] {ftop_lightning(); + if (self.attack_finished > time) self.think = ftop_shockc1;}; + +//---------------------------------------------------------------------- +void() ftop_deathsequence = +{ + self.use = SUB_Null; + self.enemy = world; + self.takedamage = DAMAGE_NO; + self.deadflag = DEAD_DEAD; + + // Find electrode start/end points + if (self.noise1 != "") + self.movetarget2 = find(world, targetname, self.noise1); + if (self.noise2 != "") + self.movetarget3 = find(world, targetname, self.noise2); + + sound (self, CHAN_WEAPON, "misc/power.wav", 1, ATTN_NORM); + sound (self, CHAN_VOICE, "chthon/pain1.wav", 1, ATTN_NORM); + + self.attack_finished = time + 1.5; + self.lip = random(); + if (self.lip < 0.3) ftop_shocka1(); + else if (self.lip < 0.6) ftop_shockb1(); + else ftop_shockc1(); +}; + +//=========================================================================== +void() ftop_rise1 =[ $rise1, ftop_rise2 ] { + sound (self, CHAN_WEAPON, "chthon/lavasplash.wav", 1, ATTN_NORM);}; +void() ftop_rise2 =[ $rise2, ftop_rise3 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM);}; +void() ftop_rise3 =[ $rise3, ftop_rise4 ] {}; +void() ftop_rise4 =[ $rise4, ftop_rise5 ] {}; +void() ftop_rise5 =[ $rise5, ftop_rise6 ] {}; +void() ftop_rise6 =[ $rise6, ftop_rise7 ] {}; +void() ftop_rise7 =[ $rise7, ftop_rise8 ] {}; +void() ftop_rise8 =[ $rise8, ftop_rise9 ] {}; +void() ftop_rise9 =[ $rise9, ftop_rise10 ] {}; +void() ftop_rise10 =[ $rise10, ftop_rise11 ] {}; +void() ftop_rise11 =[ $rise11, ftop_rise12 ] {}; +void() ftop_rise12 =[ $rise12, ftop_rise13 ] {}; +void() ftop_rise13 =[ $rise13, ftop_rise14 ] {}; +void() ftop_rise14 =[ $rise14, ftop_rise15 ] {}; +void() ftop_rise15 =[ $rise15, ftop_rise16 ] {}; +void() ftop_rise16 =[ $rise16, ftop_rise17 ] {}; +void() ftop_rise17 =[ $rise17, ftop_idleframe ] { + self.state = FTOP_IDLE; + self.takedamage = DAMAGE_YES; + self.th_stand = ftop_idleframe; + self.th_run = ftop_attackframe; + self.th_pain = ftop_pain; + self.th_die = ftop_deathsequence; +}; + +//---------------------------------------------------------------------- +void() ftop_wakeup = +{ + self.skin = 1; // Dark lava skin + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.velocity = '0 0 0'; + self.flags = FL_MONSTER; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.enemy = activator; // Setup trigger enemy + self.use = ftop_deathsequence; // Final death trigger event + + // DP particle spark and smoke effect to Chthon, originally done by Seven + if (ext_dppart) self.traileffectnum = particleeffectnum("TR_BOSSCHTHON"); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + ftop_rise1 (); +}; + +/*====================================================================== + QUAKED monster_firetopboss (1 0.25 0.25) (-128 -128 -24) (128 128 256) +======================================================================*/ +void() monster_firetopboss = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_bosschthon.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_LAVA); + + precache_sound ("chthon/attack1.wav"); + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("misc/power.wav"); + + self.pain_sound = "chthon/pain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("chthon/death1.wav"); + + // Rise from lava roar + splash + self.sight_sound = "chthon/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("chthon/lavasplash.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-128 -128 -24'; // has own entity setup + self.bbmaxs = '128 128 256'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.poisonous = FALSE; // Cannot be poisonous + self.deathstring = " was destroyed by the Firetop Guardian\n"; + + self.health = self.max_health = MEGADEATH; + self.takedamage = DAMAGE_NO; + self.classtype = CT_MONFIRETOP; + self.classgroup = CG_BOSS; + self.infightextra = 8; + self.pain_ignore = 1; + self.yaw_speed = 20; // Fast turner + self.deadflag = DEAD_NO; + + // Always reset Ammo Resistance to be consistent + // The shamblers infront of the boss are suppose to be killed + // by the boss and they fire lightning (cell damage) + // If the boss is 100% ammo resist == no infighting + // The health is reset everytime pain is received + self.resist_shells = self.resist_nails = 1; + self.resist_rockets = self.resist_cells = 0.9; + self.reflectnails = self.bouncegrenade = TRUE; + + total_monsters = total_monsters + 1; + self.use = ftop_wakeup; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_bossicegolem.qc b/QC_other/QC_arcane/mon_bossicegolem.qc new file mode 100644 index 00000000..c51df302 --- /dev/null +++ b/QC_other/QC_arcane/mon_bossicegolem.qc @@ -0,0 +1,1172 @@ +/*============================================================================== +ICE GOLEM (Heavily Inspired by Ne_Ruins MOD) (Hexen2 Model) +==============================================================================*/ + +// (000) standing still with heavy breathing +$frame wait1 wait2 wait3 wait4 wait5 wait6 wait7 wait8 +$frame wait9 wait10 wait11 wait12 wait13 wait14 wait15 wait16 +$frame wait17 wait18 wait19 wait20 wait21 wait22 + +// (022) Transfer B +$frame tranB1 tranB2 tranB3 tranB4 tranB5 tranB6 tranB7 tranB8 +$frame tranB9 tranB10 tranB11 tranB12 tranB13 + +// (035) statue to walking +$frame birth1 birth2 birth3 birth4 birth5 birth6 birth7 birth8 +$frame birth9 birth10 birth11 birth12 birth13 birth14 birth15 birth16 + +// (051) Really slow walk +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 +$frame walk25 walk26 walk27 walk28 walk29 walk30 walk31 walk32 +$frame walk33 walk34 + +// (085) Running +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 +$frame run17 run18 run19 run20 run21 run22 run23 run24 + +// (109) Right Fist Punch +$frame punch1 punch2 punch3 punch4 punch5 punch6 punch7 punch8 +$frame punch9 punch10 punch11 punch12 punch13 punch14 punch15 punch16 +$frame punch17 punch18 punch19 punch20 punch21 punch22 punch23 punch24 + +// (133) Right Fist Pound ground +$frame pound1 pound2 pound3 pound4 pound5 pound6 pound7 pound8 +$frame pound9 pound10 pound11 pound12 pound13 pound14 pound15 pound16 +$frame pound17 pound18 pound19 pound20 pound21 pound22 pound23 pound24 + +// (157) Death Forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 + +// (179) Magic attack from torso +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 magic13 magic14 magic15 magic16 +$frame magic17 magic18 magic19 magic20 magic21 magic22 magic23 magic24 + +// (203) Stomp Foot on ground +$frame stomp1 stomp2 stomp3 stomp4 stomp5 stomp6 stomp7 stomp8 +$frame stomp9 stomp10 stomp11 stomp12 stomp13 stomp14 stomp15 stomp16 +$frame stomp17 stomp18 stomp19 stomp20 stomp21 stomp22 stomp23 stomp24 + +// (227) Rush forward and knock player away +$frame knock1 knock2 knock3 knock4 knock5 knock6 knock7 knock8 +$frame knock9 knock10 knock11 knock12 knock13 knock14 knock15 knock16 +$frame knock17 knock18 knock19 knock20 knock21 knock22 knock23 knock24 + +float ICEG_PHASE1 = 1; // Frozen in Ice +float ICEG_PHASE2 = 2; // Fighting +float ICEG_PHASE3 = 3; // Busting Columns +float ICEG_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() iceg_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() iceg_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP reached next wave, turn and fire at targets +//---------------------------------------------------------------------- +float() iceg_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") { + self.attachment2 = find(world, targetname, self.noise); + if (self.attachment2.classtype == CT_MONICEGOLEMWAVE) { + // Spawn any adds to keep player busy + if (self.attachment2.target != "") + trigger_strs(self.attachment2.target, self); + + // Turn around and blow up breakables + self.th_jump(); + } + } + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + iceg_WaveSetupHP(); // Reset trigger/hp + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check the tether system +//---------------------------------------------------------------------- +float() iceg_CheckTether = +{ + self.t_length = vlen(self.origin - self.movelast.origin); + // Check the most obvious first, inside tether range? + if (self.t_length < self.tetherrange) return FALSE; + else { + // If player or tether close to each other? + if (infront(self.movelast) && infront(self.enemy) ) + return FALSE; + // Stop moving around + else return TRUE; + } +}; + +//---------------------------------------------------------------------- +// Quick check for stomp/melee + fast range attack +//---------------------------------------------------------------------- +void() iceg_CheckCombo = +{ + if (self.health < 1) return; + if (self.enemy.health < 1) return; + if (skill < SKILL_NORMAL) return; + + // If the enemy is visible, quickly go for range attack + if (visxray(self.enemy, self.attack_offset, self.enemy.view_ofs, TRUE)) { + self.attack_finished = time + ((4-skill)*0.5) + random(); + // Skip forward in magic attack + self.think = self.th_charge; + } +}; + +//---------------------------------------------------------------------- +// Ice Golem game play logic +//---------------------------------------------------------------------- +void() IcegCheckAttack = +{ + //---------------------------------------------------------------------- + // Check Melee range and constantly fire + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEEICEG) { + self.attack_finished = time + 1; + self.attack_state = AS_MELEE; + return; + } + // Walk around a bit + if (time < self.attack_finished) return; + + //---------------------------------------------------------------------- + // Floor stomp attack + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_STOMPICEG && random() < 0.5) { + self.attack_finished = time + ((4-skill)*0.5) + random() + random(); + self.th_slide (); + return; + } + + //---------------------------------------------------------------------- + // Range attacks (O Rings + Ceiling Rubble) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (!visblocked_wide(self.enemy, self.attack_offset, self.enemy.view_ofs)) { + self.attack_finished = time + ((4-skill)*0.6) + random() + random(); + self.attack_state = AS_MISSILE; + } +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() iceg_idleframe = +{ + // Do nothing if dead + if (self.health < 1) return; + if (self.walkframe == 0) monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 20) self.walkframe = 0; + self.frame = $wait1 + self.walkframe; + self.think = iceg_idleframe; + // Tick slower for idle + self.nextthink = time + 0.1; + + // Keep looking for a player + iceg_FindTarget (); +}; + +//---------------------------------------------------------------------- +void() iceg_stand1 = {self.walkframe = 0; iceg_idleframe();}; + +//============================================================================ +void() iceg_walkframe = +{ + // Do nothing if dead + if (self.health < 1) return; + + // Default walk speed (very slow) + self.lip = 5; + // Check for any special frame events + if (self.walkframe == 0 || self.walkframe == 16) { + self.lip = 0; + monster_footstep(FALSE); + } + else if (self.walkframe == 1 || self.walkframe == 17) self.lip = 4; + else if (self.walkframe == 7 || self.walkframe == 24) + monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 33) self.walkframe = 0; + self.frame = $walk1 + self.walkframe; + self.think = iceg_walkframe; + // Hexen 2 models are designed for lower time cycle + self.nextthink = time + 0.05; + + // Keep looking for a player + iceg_FindTarget (); + + // Any feet movement? + if (self.lip > 0) { + // Check for tether system (cutom version) + if (self.movelast) { + if (iceg_CheckTether()) movetogoal(self.lip); + } + else movetogoal(self.lip); + } +}; + +//---------------------------------------------------------------------- +void() iceg_walk1 = { self.walkframe = 0; iceg_walkframe(); }; + +//============================================================================ +void() iceg_runframe = +{ + if (self.style != ICEG_PHASE2) return; + if (self.health < 1) return; + + // Check for boss wave trigger events + if (iceg_WaveCheck() == TRUE) {self.th_jump(); return;} + + // Default run speed (very slow) + self.lip = 8; + // Check for any special frame events + if (self.walkframe == 0 || self.walkframe == 12) { + self.lip = 0; + monster_footstep(FALSE); + } + else if (self.walkframe == 1 || self.walkframe == 13) self.lip = 6; + else if (self.walkframe == 6 || self.walkframe == 17) + monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 23) self.walkframe = 0; + self.frame = $run1 + self.walkframe; + self.think = iceg_runframe; + // Hexen 2 models are designed for lower time cycle + self.nextthink = time + 0.05; + + // Check for tether system (cutom version) + if (self.movelast) { + if (iceg_CheckTether()) ai_run(0); + else ai_run(self.lip); + } + else ai_run(self.lip); +}; + +//---------------------------------------------------------------------- +void() iceg_run1 = { self.walkframe = 0; iceg_runframe(); }; + +//============================================================================ +// MELEE - knockback the player with swipe +//============================================================================ +void(float dist) iceg_mcharge = { + ai_charge(dist); + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() iceg_knock1 = [ $knock1, iceg_knock2 ] {iceg_mcharge(5);}; +void() iceg_knock2 = [ $knock2, iceg_knock3 ] {iceg_mcharge(6);}; +void() iceg_knock3 = [ $knock3, iceg_knock4 ] {iceg_mcharge(7);}; +void() iceg_knock4 = [ $knock4, iceg_knock5 ] {iceg_mcharge(8);}; +void() iceg_knock5 = [ $knock5, iceg_knock6 ] {iceg_mcharge(9);}; +void() iceg_knock6 = [ $knock7, iceg_knock7 ] {iceg_mcharge(10);}; +void() iceg_knock7 = [ $knock6, iceg_knock8 ] {iceg_mcharge(9);}; +void() iceg_knock8 = [ $knock8, iceg_knock9 ] {iceg_mcharge(8);}; +void() iceg_knock9 = [ $knock9, iceg_knock10 ] {iceg_mcharge(7);}; +void() iceg_knock10 = [ $knock10, iceg_knock11 ] {iceg_mcharge(6);}; +void() iceg_knock11 = [ $knock11, iceg_knock12 ] {iceg_mcharge(5);monster_footstep(FALSE);}; +void() iceg_knock12 = [ $knock12, iceg_knock13 ] {iceg_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() iceg_knock13 = [ $knock13, iceg_knock14 ] {iceg_mcharge(4);}; +void() iceg_knock14 = [ $knock14, iceg_knock15 ] {iceg_mcharge(3);}; +void() iceg_knock15 = [ $knock15, iceg_knock16 ] {iceg_mcharge(2);}; +void() iceg_knock16 = [ $knock16, iceg_knock17 ] {iceg_mcharge(1); + self.meleehitsound = "golem/melee_punch.wav"; + self.meleecontact = TRUE;ai_meleesmash(30); + // If punch made contact, lift the enemy off ground + if (self.meleecontact == FALSE) { + self.pos1 = self.enemy.origin - self.origin; + self.pos1_z = 0; + self.pos1 = normalize(self.pos1); + self.enemy.velocity = self.enemy.velocity + self.pos1 * 400; + self.enemy.velocity_z = self.enemy.velocity_z + 250; + self.enemy.flags = self.enemy.flags - (self.enemy.flags & FL_ONGROUND); + } + self.meleecontact = FALSE; +}; +void() iceg_knock17 = [ $knock17, iceg_knock18 ] {iceg_mcharge(1);}; +void() iceg_knock18 = [ $knock18, iceg_knock19 ] {iceg_mcharge(2);}; +void() iceg_knock19 = [ $knock19, iceg_knock20 ] {iceg_mcharge(3);}; +void() iceg_knock20 = [ $knock20, iceg_knock21 ] {iceg_mcharge(4);}; +void() iceg_knock21 = [ $knock21, iceg_knock22 ] {iceg_mcharge(5);}; +void() iceg_knock22 = [ $knock22, iceg_knock23 ] {iceg_mcharge(5);}; +void() iceg_knock23 = [ $knock23, iceg_knock24 ] {iceg_mcharge(5);}; +void() iceg_knock24 = [ $knock24, iceg_run1 ] {iceg_mcharge(5); + // Check for combo Melee+quick range + iceg_CheckCombo(); +}; + +//============================================================================ +// RANGE ATTACK (ICE SHARDS == rockets) +// Total shards to fire is based on skill level +// easy=3, normal=3, hard=4, nm=5 +//============================================================================ +void() iceg_shardanimate = +{ + // manually animate + self.frame = self.frame + 1; + self.lip = 1 - (self.frame / 11); + self.lip = self.lip * 0.5; + // Gradualy fade out + self.alpha = self.lip; + // Hit animaton frame boundary? + if (self.frame > 10) entity_remove(self, 0.1); + else self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() iceg_shardtrail = +{ + local entity oring; + + // Spawn a temporary entity + oring = spawn(); + oring.owner = self; + oring.solid = SOLID_NOT; // No interaction with world + oring.movetype = MOVETYPE_NONE; // Static item, no movement + + // move to current projectile location + setmodel(oring, MODEL_PROJ_RINGBLAST); + setsize(oring, VEC_ORIGIN, VEC_ORIGIN); + setorigin(oring, self.origin); + oring.alpha = 0.5; + oring.skin = 3; + + // Match orientiation and start Oring animation + self.pos2 = normalize(self.velocity); + oring.angles = vectoangles(self.pos2); + oring.think = iceg_shardanimate; + oring.nextthink = time + 0.1; + + // Has the DP particle trail been setup yet? + if (!self.pain_finished) { + // only run this once + self.pain_finished = TRUE; + // Re-use plasma trail + if (ext_dppart) { + self.traileffectnum = particleeffectnum(DPP_TRPLASMA); + self.effects = 0; + } + } + else { + // Classic (fitz/qs) engine particles only + if (!ext_dppart) { + self.oldorigin = crandom() * '1 1 1'; + // Silver colour + self.lip = 40 + rint(random()*8); + particle (self.origin, self.oldorigin, self.lip, 8 + rint(random()*8)); + // Yellow colour + self.lip = 198 + rint(random()*4); + particle (self.origin, self.oldorigin, self.lip, 4 + rint(random()*4)); + } + } + + // Keep looping for O rings trails + self.think = iceg_shardtrail; + self.nextthink = time + 0.05 + random()*0.05; +}; + +//---------------------------------------------------------------------- +void(entity targ) iceg_icestorm = +{ + local float zpart; + local vector org, targ_org, dir, yrand, zrand; + + // No enemy or dead? stop firing + if (!targ) return; + if (self.health < 1) return; + + // Play random firing sound + self.lip = random(); + if (self.lip < 0.3) + sound (self, CHAN_WEAPON, "golem/iceshard1.wav", 1, ATTN_IDLE); + else if (self.lip < 0.6) + sound (self, CHAN_WEAPON, "golem/iceshard2.wav", 1, ATTN_IDLE); + else + sound (self, CHAN_WEAPON, "golem/iceshard3.wav", 1, ATTN_IDLE); + + // Make sure facing the right direction + ai_face(); + makevectors(self.angles); + + // Check if enemy is bmodel or point entity + if (targ.bsporigin) targ_org = bmodel_origin(targ); + else targ_org = targ.origin; + + // Spawn a mist of particles where projectiles came from + org = self.origin + attack_vector('20 0 64'); + zpart = 20 + rint(random()*20); + particle_explode(org, zpart, 1+random(), PARTICLE_BURST_BLUE, PARTICLE_BURST_UPWARD); + + // Randomly spawn projectiles from golems chest + yrand = (crandom()*10)*v_right; + zrand = (crandom()*10)*v_up; + org = self.origin + attack_vector(self.attack_offset) + yrand + zrand; + + // Add some right/left bias to the final destination + dir = (targ_org - org) + (v_right*(crandom()*50)); + dir = normalize (dir); + + // Variable speed based on skill level + self.attack_speed = SPEED_ICEGSHARD + (skill * SPEED_ICEGSKILL); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_ICEG1, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() iceg_magtime = {self.nextthink = time + 0.05;}; + +void() iceg_magic1 = [ $magic1, iceg_magic2 ] {iceg_magtime();ai_face(); + self.pain_finished = time + 1.5; + sound (self, CHAN_WEAPON, "golem/icestorm.wav", 1, ATTN_NORM); +}; +void() iceg_magic2 = [ $magic2, iceg_magic3 ] {iceg_magtime();}; +void() iceg_magic3 = [ $magic3, iceg_magic4 ] {iceg_magtime();ai_face();}; +void() iceg_magic4 = [ $magic4, iceg_magic5 ] {iceg_magtime();}; +void() iceg_magic5 = [ $magic5, iceg_magic6 ] {iceg_magtime();ai_face();}; +void() iceg_magic6 = [ $magic6, iceg_magic7 ] {iceg_magtime();ai_face();}; +void() iceg_magic7 = [ $magic7, iceg_magic8 ] {iceg_magtime();ai_face();}; +void() iceg_magic8 = [ $magic8, iceg_magic9 ] {iceg_magtime();}; +void() iceg_magic9 = [ $magic9, iceg_magic10 ] {iceg_magtime();ai_face();}; +void() iceg_magic10 = [ $magic10, iceg_magic11 ] {iceg_magtime();ai_face();}; +void() iceg_magic11 = [ $magic11, iceg_magic12 ] {iceg_magtime();ai_face();}; +void() iceg_magic12 = [ $magic12, iceg_magic13 ] {iceg_magtime();ai_face();}; +void() iceg_magic13 = [ $magic13, iceg_magic14 ] {iceg_magtime();iceg_icestorm(self.enemy);}; +void() iceg_magic14 = [ $magic14, iceg_magic15 ] {iceg_magtime();ai_face();}; +void() iceg_magic15 = [ $magic15, iceg_magic16 ] {iceg_magtime();iceg_icestorm(self.enemy);}; +void() iceg_magic16 = [ $magic16, iceg_magic17 ] {iceg_magtime();ai_face();}; +void() iceg_magic17 = [ $magic17, iceg_magic18 ] {iceg_magtime();iceg_icestorm(self.enemy);}; +void() iceg_magic18 = [ $magic18, iceg_magic19 ] {iceg_magtime();ai_face();}; +void() iceg_magic19 = [ $magic19, iceg_magic20 ] {iceg_magtime();ai_face(); + if (skill > SKILL_NORMAL) iceg_icestorm(self.enemy); +}; +void() iceg_magic20 = [ $magic20, iceg_magic21 ] {iceg_magtime();ai_face();}; +void() iceg_magic21 = [ $magic21, iceg_magic22 ] {iceg_magtime();ai_face(); + if (skill > SKILL_HARD) iceg_icestorm(self.enemy); +}; +void() iceg_magic22 = [ $magic22, iceg_magic23 ] {iceg_magtime();}; +void() iceg_magic23 = [ $magic23, iceg_magic24 ] {iceg_magtime();}; +void() iceg_magic24 = [ $magic24, iceg_run1 ] {iceg_magtime();}; + +//============================================================================ +// RANGE ATTACK (Stomp ground and drop debris from ceiling) +//============================================================================ +void() iceg_ceilingrubble = +{ + // No enemy or dead? + if (!self.enemy) return; + if (self.health < 1) return; + + // Trace a line up from the enemy/player + traceline(self.enemy.origin, self.enemy.origin+'0 0 1024', TRUE, self.enemy); + self.pos2 = trace_endpos; + // is there any space for rubble? + if (vlen(self.enemy.origin - self.pos2) < 64) return; + + // Spawn a func_breakable_spawner entity + // Manually setup all parameters + // All sounds/models pre-cached with ice golem + self.attachment = spawn(); + // Move the emitter slightly down from ceiling + self.attachment.origin = trace_endpos - self.dest2; + + self.attachment.owner = self; + self.attachment.style = BTYPE_ROCK; + self.attachment.brkimpsound = BTYPE_ROCK; + self.attachment.brkobjects = BTYPE_ROCK; + self.attachment.brkvelbase = self.brkvelbase; + self.attachment.brkveladd = self.brkveladd; + self.attachment.brkavel = 200; + self.attachment.brkfade = self.brkfade; + self.attachment.noise = SOUND_BRK_ROCK; + self.attachment.noise1 = SOUND_IMP_ROCK1; + self.attachment.noise2 = SOUND_IMP_ROCK2; + self.attachment.brkimpqty = 2; + + // Allow for custom rubble bmodels + self.attachment.brkobj1 = self.brkobj1; + self.attachment.brkobj2 = self.brkobj2; + self.attachment.brkobjqty = 2; + self.attachment.pos1 = self.dest1; + self.attachment.cnt = 5 + random() * 5; + self.attachment.count = 5 + random() * 5; + self.attachment.movedir = '0 -2 0'; + self.attachment.angles = '0 0 0'; + + // Check if the boss has dmg key set for rubble damage + if (self.dmg > 0) self.attachment.spawnflags = BREAK_MOVEDIR | BREAK_DAMAGE; + else self.attachment.spawnflags = BREAK_MOVEDIR; + if (self.dmg > 0) self.attachment.dmg = self.dmg; + else self.attachment.dmg = 2; + + // Default entity stuff (type/movement etc) + self.attachment.classtype = CT_FUNCBREAKSPN; + self.attachment.classgroup = CG_BREAKABLE; + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.brkvol = self.brkvol; + self.attachment.think = funcbreakable_use; + self.attachment.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() iceg_footstomp = {self.nextthink = time + 0.05;}; + +//---------------------------------------------------------------------- +void() iceg_stomp1 = [ $stomp1, iceg_stomp2 ] {iceg_footstomp(); + self.pain_finished = time + self.pain_timeout;}; +void() iceg_stomp2 = [ $stomp2, iceg_stomp3 ] {iceg_footstomp(); + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_IDLE);}; +void() iceg_stomp3 = [ $stomp3, iceg_stomp4 ] {iceg_footstomp();}; +void() iceg_stomp4 = [ $stomp4, iceg_stomp5 ] {iceg_footstomp();}; +void() iceg_stomp5 = [ $stomp5, iceg_stomp6 ] {iceg_footstomp();monster_idle_sound();}; +void() iceg_stomp6 = [ $stomp6, iceg_stomp7 ] {iceg_footstomp();}; +void() iceg_stomp7 = [ $stomp7, iceg_stomp8 ] {iceg_footstomp();}; +void() iceg_stomp8 = [ $stomp8, iceg_stomp9 ] {iceg_footstomp();}; +void() iceg_stomp9 = [ $stomp9, iceg_stomp10 ] {iceg_footstomp();}; +void() iceg_stomp10 = [ $stomp10, iceg_stomp11 ] {iceg_footstomp();}; +void() iceg_stomp11 = [ $stomp11, iceg_stomp12 ] {iceg_footstomp();}; +void() iceg_stomp12 = [ $stomp12, iceg_stomp13 ] {iceg_footstomp();}; +void() iceg_stomp13 = [ $stomp13, iceg_stomp14 ] { + iceg_footstomp(); self.meleehitsound = "golem/groundslam.wav"; + ai_shockwave(MONAI_STOMPIMPACT, MONAI_STOMPDAMAGE, MONAI_STOMPICERADIUS, MONAI_STOMPFORWARD, MONAI_STOMPUP); + // spawn ceiling rubble above player/enemy + iceg_ceilingrubble(); +}; +void() iceg_stomp14 = [ $stomp14, iceg_stomp15 ] {iceg_footstomp();}; +void() iceg_stomp15 = [ $stomp15, iceg_stomp16 ] {iceg_footstomp();}; +void() iceg_stomp16 = [ $stomp16, iceg_stomp17 ] {iceg_footstomp();monster_idle_sound();}; +void() iceg_stomp17 = [ $stomp17, iceg_stomp18 ] {iceg_footstomp();}; +void() iceg_stomp18 = [ $stomp18, iceg_stomp19 ] {iceg_footstomp();}; +void() iceg_stomp19 = [ $stomp19, iceg_stomp20 ] {iceg_footstomp();}; +void() iceg_stomp20 = [ $stomp20, iceg_stomp21 ] {iceg_footstomp();}; +void() iceg_stomp21 = [ $stomp21, iceg_stomp22 ] {iceg_footstomp();}; +void() iceg_stomp22 = [ $stomp22, iceg_stomp23 ] {iceg_footstomp();}; +void() iceg_stomp23 = [ $stomp23, iceg_stomp24 ] {iceg_footstomp();}; +void() iceg_stomp24 = [ $stomp24, iceg_run1 ] {iceg_footstomp(); + monster_footstep(FALSE); + // Check for combo Stomp+quick range + iceg_CheckCombo(); +}; + +//============================================================================ +// WAVE BOUNDARY - destroy some objects and spawn adds +//============================================================================ +void() iceg_aiturn = +{ + // turn towards a target if one exists + if (self.enemytarget) { + // Check if enemy target is bmodel or point entity + if (self.enemytarget.bsporigin) + self.pos1 = bmodel_origin(self.enemytarget); + else self.pos1 = self.enemytarget.origin; + // Force turn towards new target + self.ideal_yaw = vectoyaw(self.pos1 - self.origin); + ChangeYaw (); + + // Check angle difference + if ((self.ideal_yaw - 10) > self.angles_y) self.attack_elev = TRUE; + else if ((self.ideal_yaw + 10)<self.angles_y) self.attack_elev = TRUE; + else self.attack_elev = FALSE; + } +}; + +//---------------------------------------------------------------------- +void() iceg_waveface = { + // Hexen 2 quicktime! + self.nextthink = time + 0.05; + iceg_aiturn(); +}; + +//---------------------------------------------------------------------- +void() iceg_waveb1 = [ $magic1, iceg_waveb2 ] {iceg_waveface();}; +void() iceg_waveb2 = [ $magic2, iceg_waveb3 ] {iceg_waveface();}; +void() iceg_waveb3 = [ $magic3, iceg_waveb4 ] {iceg_waveface();}; +void() iceg_waveb4 = [ $magic4, iceg_waveb5 ] {iceg_waveface();}; +void() iceg_waveb5 = [ $magic5, iceg_waveb6 ] {iceg_waveface();}; +void() iceg_waveb6 = [ $magic6, iceg_waveb7 ] {iceg_waveface();}; +void() iceg_waveb7 = [ $magic7, iceg_waveb8 ] {iceg_waveface();}; +void() iceg_waveb8 = [ $magic8, iceg_waveb9 ] {iceg_waveface();}; +void() iceg_waveb9 = [ $magic9, iceg_waveb10 ] {iceg_waveface();}; + +// Fire at first target +void() iceg_waveb10 = [ $magic10, iceg_waveb11 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb11 = [ $magic11, iceg_waveb12 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb12 = [ $magic12, iceg_waveb13 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb13 = [ $magic13, iceg_waveb14 ] {iceg_waveface(); + if (self.enemytarget) { + iceg_icestorm(self.enemytarget); + // Trigger the target entity + trigger_ent(self.enemytarget, self); + // Find next target and turn towards it + self.enemytarget = find(world, targetname, self.attachment2.noise2); + } +}; + +// Start turning towards next target +void() iceg_waveb14 = [ $magic14, iceg_waveb15 ] {iceg_waveface();}; +void() iceg_waveb15 = [ $magic15, iceg_waveb16 ] {iceg_waveface();}; +void() iceg_waveb16 = [ $magic16, iceg_waveb17 ] {iceg_waveface();}; + +// Fire at second target +void() iceg_waveb17 = [ $magic17, iceg_waveb18 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb18 = [ $magic18, iceg_waveb19 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb19 = [ $magic19, iceg_waveb20 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb20 = [ $magic20, iceg_waveb21 ] {iceg_waveface(); + if (self.enemytarget) { + iceg_icestorm(self.enemytarget); + // Trigger the target entity + trigger_ent(self.enemytarget, self); + } +}; + +// Stop turning +void() iceg_waveb21 = [ $magic21, iceg_waveb22 ] {iceg_waveface();}; +void() iceg_waveb22 = [ $magic22, iceg_waveb23 ] {iceg_waveface();}; +void() iceg_waveb23 = [ $magic23, iceg_waveb24 ] {iceg_waveface();}; +void() iceg_waveb24 = [ $magic24, iceg_run1 ] { + self.style = ICEG_PHASE2; + Resist_ChangeType(self, FALSE); + iceg_waveface(); + // Pause before next attack + self.pain_finished = self.attack_finished = time + 2; +}; + +//---------------------------------------------------------------------- +void() iceg_turnframe = +{ + // Do nothing if dead + if (self.health < 1) return; + + // Check for any special frame events + if (self.walkframe == 0 || self.walkframe == 16) monster_footstep(FALSE); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 33) self.walkframe = 0; + self.frame = $walk1 + self.walkframe; + // Hexen 2 models are designed for lower time cycle + self.nextthink = time + 0.05; + + // Facing the first target? + iceg_aiturn(); + if (self.attack_elev == FALSE) self.think = iceg_waveb1; + else self.think = iceg_turnframe; +}; + +//---------------------------------------------------------------------- +void() iceg_waveboundary = +{ + // Find a target to aim at (columns to blow up) + self.enemytarget = find(world, targetname, self.attachment2.noise1); + // First target seems to be dead + if (!self.enemytarget) { + self.enemytarget = find(world, targetname, self.attachment2.noise2); + // Second target is missing, try current enemy + if (!self.enemytarget) self.enemytarget = self.enemy; + } + + // If nothing to shoot at, back to running! + if (!self.enemytarget) { + // Back to running! + self.think = self.th_run; + self.nextthink = time + 0.1; + } + else { + // Time to blow stuff up, switch on resistance and roar! + self.style = ICEG_PHASE3; + Resist_ChangeType(self, TRUE); + sound (self, CHAN_WEAPON, "golem/icestorm.wav", 1, ATTN_NORM); + // Start turning towards target (using walk animation) + self.walkframe = 0; + iceg_turnframe(); + } +}; + +//============================================================================ +// PAIN (no pain animations) +//============================================================================ +void(entity inflictor, entity attacker, float damage) iceg_pain = +{ + // Check for boss wave trigger events + if (iceg_WaveCheck() == TRUE) {self.th_jump(); return;} + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } +}; + +//============================================================================ +// DEATH : Time to melt the heavy water GOLEM! +//============================================================================ +void() iceg_fadeout = +{ + self.origin_z = self.origin_z - 0.2; // Slowly sink into the ground (melting) + self.alpha = 1 - ((time - self.ltime) / 1); + if (random() < 0.1) SpawnProjectileSmoke(self.origin, 200, 100, 100); + if (self.alpha <= 0) entity_hide(self); + else self.nextthink = time + FADEMODEL_TIME; +}; + +//---------------------------------------------------------------------- +void() iceg_startfade = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // Setup ready for fade away ice->water + self.frame = $death22; + self.alpha = 0.99; + self.ltime = time + 2; + self.think = iceg_fadeout; + iceg_fadeout(); +}; + +//---------------------------------------------------------------------- +void(float fdist) iceg_brk = +{ + if (fdist > 0) ai_forward(fdist); + if (random() < 0.2) SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (random() < 0.4) SpawnProjectileSmoke(self.origin, 300, 50, 150); + if (random() < 0.6) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.3) ThrowGib(11, 1); // Small Golem rock +}; + +//---------------------------------------------------------------------- +void() iceg_death1 = [ $death1, iceg_death2 ] {iceg_brk(0);}; +void() iceg_death2 = [ $death2, iceg_death3 ] {iceg_brk(0);}; +void() iceg_death3 = [ $death3, iceg_death4 ] {iceg_brk(2);}; +void() iceg_death4 = [ $death4, iceg_death5 ] {iceg_brk(5);}; +void() iceg_death5 = [ $death5, iceg_death6 ] {iceg_brk(5);}; +void() iceg_death6 = [ $death6, iceg_death7 ] {iceg_brk(10);}; +void() iceg_death7 = [ $death7, iceg_death8 ] {iceg_brk(12);monster_footstep(FALSE);}; +void() iceg_death8 = [ $death8, iceg_death9 ] {iceg_brk(10);}; +void() iceg_death9 = [ $death9, iceg_death10] {iceg_brk(0);}; +void() iceg_death10 = [ $death10, iceg_death11] {iceg_brk(0);}; +void() iceg_death11 = [ $death11, iceg_death12] {iceg_brk(0);}; +void() iceg_death12 = [ $death12, iceg_death13] {iceg_brk(0);}; +void() iceg_death13 = [ $death13, iceg_death14] {iceg_brk(0);}; +void() iceg_death14 = [ $death14, iceg_death15] {iceg_brk(0);}; +void() iceg_death15 = [ $death15, iceg_death16] {iceg_brk(4);}; +void() iceg_death16 = [ $death16, iceg_death17] {iceg_brk(4);}; +void() iceg_death17 = [ $death17, iceg_death18] {iceg_brk(4);}; +void() iceg_death18 = [ $death18, iceg_death19] {iceg_brk(4);}; +void() iceg_death19 = [ $death19, iceg_death20] {iceg_brk(4);}; +void() iceg_death20 = [ $death20, iceg_death21] {iceg_brk(4);}; +void() iceg_death21 = [ $death21, iceg_death22] {iceg_brk(4);}; +void() iceg_death22 = [ $death22, iceg_startfade] { + self.nextthink = time + 4 + random()*4; + self.velocity = '0 0 0'; + self.movetype = MOVETYPE_NONE; +}; + +//---------------------------------------------------------------------- +void() iceg_die = +{ + self.deadflag = DEAD_DEAD; // Nour bites the dust + self.effects = 0; // Remove effects on death + self.style = ICEG_PHASE4; // Heavy Water + self.max_health = MON_GIBEXPLOSION; + + sound (self, CHAN_BODY, "golem/death.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; + iceg_death1 (); +}; + +//============================================================================ +// Wakeup From Statue form +//============================================================================ +void() iceg_birth = { + if (random() < 0.4) SpawnProjectileSmoke(self.origin, 200, 100, 100); + if (random() < 0.8) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.1) ThrowGib(11, 1); // Small Golem rock + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() iceg_wake1 =[ $birth1, iceg_wake2 ] { + self.use = SUB_Null; // No more triggers + self.style = ICEG_PHASE2; // Free to fight + self.yaw_speed = 20 + (skill * 4); // Really Fast Speed + + // Setup player focus + if (activator.flags & FL_CLIENT) { + self.goalentity = self.enemy = activator; + } + else self.enemy = world; + + // Restore all think functions + self.th_stand = iceg_stand1; + self.th_walk = iceg_walk1; + self.th_run = iceg_run1; + self.th_melee = iceg_knock1; + self.th_missile = iceg_magic1; + self.th_updmissile = iceg_shardtrail; + self.th_charge = iceg_magic7; + self.th_slide = iceg_stomp1; + self.th_jump = iceg_waveboundary; + self.th_pain = iceg_pain; + self.th_die = iceg_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + + iceg_birth(); + sound (self, CHAN_BODY, "golem/wakestatue.wav", 1, ATTN_NORM); +}; +void() iceg_wake2 =[ $birth2, iceg_wake3 ] {iceg_birth();ai_forward(2);}; +void() iceg_wake3 =[ $birth3, iceg_wake4 ] {iceg_birth();ai_forward(3);}; +void() iceg_wake4 =[ $birth4, iceg_wake5 ] {iceg_birth();ai_forward(4);}; +void() iceg_wake5 =[ $birth5, iceg_wake6 ] {iceg_birth();ai_forward(3);}; +void() iceg_wake6 =[ $birth6, iceg_wake7 ] {iceg_birth();ai_forward(3);}; +void() iceg_wake7 =[ $birth7, iceg_wake8 ] {iceg_birth();ai_forward(1);}; +void() iceg_wake8 =[ $birth8, iceg_wake9 ] {iceg_birth();monster_footstep(FALSE);}; +void() iceg_wake9 =[ $birth9, iceg_wake10 ] {iceg_birth();}; +void() iceg_wake10 =[ $birth10, iceg_wake11 ] {iceg_birth();}; +void() iceg_wake11 =[ $birth11, iceg_wake12 ] {iceg_birth();monster_idle_sound();}; +void() iceg_wake12 =[ $birth12, iceg_wake13 ] {iceg_birth();}; +void() iceg_wake13 =[ $birth13, iceg_wake14 ] {iceg_birth();}; +void() iceg_wake14 =[ $birth14, iceg_wake15 ] {iceg_birth();}; +void() iceg_wake15 =[ $birth15, iceg_wake16 ] {iceg_birth();}; +void() iceg_wake16 =[ $birth16, iceg_tranB1 ] {iceg_birth();}; + +void() iceg_tranB1 = [ $tranB1, iceg_tranB2 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + iceg_birth(); + ai_forward(8); +}; +void() iceg_tranB2 = [ $tranB2, iceg_tranB3 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB3 = [ $tranB3, iceg_tranB4 ] {iceg_birth();ai_forward(5);monster_idle_sound();}; +void() iceg_tranB4 = [ $tranB4, iceg_tranB5 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB5 = [ $tranB5, iceg_tranB6 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB6 = [ $tranB6, iceg_tranB7 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB7 = [ $tranB7, iceg_tranB8 ] {iceg_birth();ai_forward(5);monster_idle_sound();}; +void() iceg_tranB8 = [ $tranB8, iceg_tranB9 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB9 = [ $tranB9, iceg_tranB10 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB10 = [ $tranB10, iceg_tranB11 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB11 = [ $tranB11, iceg_tranB12 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB12 = [ $tranB12, iceg_tranB13 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB13 = [ $tranB13, iceg_run1 ] { + monster_footstep(FALSE); + self.takedamage = DAMAGE_YES; // Can take damage + self.style = ICEG_PHASE2; // Time to fight! + Resist_ChangeType(self,FALSE); // restore resistance + self.walkframe = 13; // Mid way through set + iceg_runframe(); +}; + +//====================================================================== +// Setup Ice Golem after trigger event +//====================================================================== +void() iceg_setup = +{ + self.use = SUB_Null; // No more triggers + self.style = ICEG_PHASE1; // Bursting intro sequence + self.flags = FL_MONSTER; // Reset flag + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.no_liquiddmg = TRUE; // no slime/lava damage + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.pain_longanim = FALSE; // No axe advantage + self.takedamage = DAMAGE_NO; // No damage, statue time + self.noinfighting = TRUE; // No infighting + self.skin = 1; // Frozen skin + + self.blockudeath = TRUE; // No humanoid death + self.bleedcolour = 16; // Brown dust/dirt + self.meleerange = MONAI_MELEEGOLEM; + self.attack_offset = '10 0 112'; // Ice storm + + self.gibhealth = -1000; // Special death sequence + self.gibbed = FALSE; // Still in one piece + self.pain_finished = self.attack_finished = LARGE_TIMER; + + // Setup Ammo Resistance + self.resist_shells = self.resist_cells = 0; + self.resist_nails = self.resist_rockets = 0.75; + self.reflectnails = TRUE; // Reflect nail projectiles + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 5; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + iceg_WaveSetupHP(); + + // default = No think functions + self.th_checkattack = IcegCheckAttack; + self.th_stand = self.th_walk = self.th_run = SUB_Null; + self.th_missile = self.th_die = SUB_Null; + self.th_pain = SUB_Null_pain; + + // Check there is space for Ice Golem to spawn + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Find the tether marker (must be path_corner) + if (self.tethertarget != "") { + self.movelast = find(world,targetname,self.tethertarget); + if (self.movelast.classtype != CT_PATHCORNER) { + dprint("\b[ICEG]\b Tether marker not path_corner!\n"); + spawn_marker(self.movelast.origin, SPNMARK_YELLOW); + self.movelast = world; + } + else spawn_marker(self.movelast.origin, SPNMARK_GREEN); + // Setup default tetherrange + if (!self.tetherrange) self.tetherrange = MONAI_MAXICEG; + } + // Make sure tethertarget is blank + self.tethertarget = ""; + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; + + // Wait for trigger event to be wakeup + self.use = iceg_wake1; +}; + +/*====================================================================== +QUAKED monster_icegolem (1 0.2 0) (-32 -32 -24) (32 32 128) +======================================================================*/ +void() monster_icegolem = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_bossicegolem.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_RINGSHOCK); // Ground shockwave + precache_model (MODEL_PROJ_RINGBLAST); // Ice ring shockwave + precache_model (MODEL_PROJ_GROCK1); // Golem rocks + precache_model (MODEL_PROJ_GROCK2); + precache_model (MODEL_PROJ_GSHARD); // Ice shards + + self.gib1mdl = MODEL_PROJ_GROCK1; // small golem rock + self.gib2mdl = MODEL_PROJ_GROCK2; // medium golem rock + self.gib1frame = self.gib2frame = 9; + + // Idle1a-1b (long sound) idle2a-2b (short sound) + self.idle_sound = "golem/idle1a.wav"; + self.idle_sound2 = "golem/idle1b.wav"; + self.idle_soundcom = "golem/idle2a.wav"; + self.idle_soundcom2 = "golem/idle2b.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + // Break free of statue pose + precache_sound ("golem/wakestatue.wav"); + + // Several melee smack sounds and giant ground slam + precache_sound ("golem/melee_swipe.wav"); + precache_sound ("golem/melee_punch.wav"); + precache_sound ("golem/melee_pound.wav"); + precache_sound ("golem/groundslam.wav"); + + // Used for ceiling rubble breakables + precache_sound (SOUND_BRK_ROCK); + precache_sound (SOUND_IMP_ROCK1); + precache_sound (SOUND_IMP_ROCK2); + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK1A; + precache_model (self.brkobj1); + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK1B; + precache_model (self.brkobj2); + + // Additional rubble emitter parameters + if (CheckZeroVector(self.dest1)) self.dest1 = '80 8 1'; + if (CheckZeroVector(self.dest2)) self.dest2 = '0 0 16'; + if (CheckZeroVector(self.brkvol)) self.brkvol = '160 160 8'; + if (CheckZeroVector(self.brkvelbase)) self.brkvelbase = '0 0 50'; + if (CheckZeroVector(self.brkveladd)) self.brkveladd = '100 100 100'; + if (self.brkfade <= 0) self.brkfade = 4; + + // Ice Storm - range attack + precache_sound ("golem/icestorm.wav"); + precache_sound ("golem/iceshard1.wav"); + precache_sound ("golem/iceshard2.wav"); + precache_sound ("golem/iceshard3.wav"); + precache_sound ("golem/iceshard_impact.wav"); + precache_model (SEXP_ICE_BIG); // Shard impact (ne_ruin) + + self.pain_sound = "golem/pain1.wav"; + self.pain_sound2 = "golem/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("golem/death.wav"); + + // Roar! + self.sight_sound = "golem/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 128'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.poisonous = FALSE; // Cannot be poisonous + self.deathstring = " was shattered by the Ice Golem\n"; + + self.steptype = FS_TYPEGIANT; // Giant sound + self.health = self.max_health = MEGADEATH; + + self.classtype = CT_MONICEGOLEM; + self.classgroup = CG_STONE; + self.classmove = MON_MOVEWALK; + self.style = 0; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[ICEGOLEM]\b Missing targetname name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + total_monsters = total_monsters + 1; + self.use = iceg_setup; +}; + +/*====================================================================== +/*QUAKED monster_icegolem_wavetrig (0.75 0.25 1) (-32 -32 -8) (32 32 8) x +Target for boss column smash wave event +-------- KEYS -------- +targetname : name of wave event (links to noise key on boss) +target : trigger name of adds to spawn +noise1 : trigger name of column 1 +noise2 : trigger name of column 2 +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Target for boss column smash wave event + +======================================================================*/ +void() monster_icegolem_wavetrig = +{ + self.classtype = CT_MONICEGOLEMWAVE; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); +}; diff --git a/QC_other/QC_arcane/mon_bossidchthon.qc b/QC_other/QC_arcane/mon_bossidchthon.qc new file mode 100644 index 00000000..e94feef4 --- /dev/null +++ b/QC_other/QC_arcane/mon_bossidchthon.qc @@ -0,0 +1,492 @@ +/*============================================================================== +Chthon (ID software Version) +==============================================================================*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +entity le1, le2; +float lightning_end; + +//=========================================================================== +void() idchthon_tracking = +{ + // Find a player + if (!self.enemy) { + self.enemy = find(world, classname, "player"); + if (!self.enemy) self.enemy = world; + } + + // Check for any no combat conditions + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.health < 1) self.enemy = world; + if (self.enemy) self.th_missile(); +}; + +//---------------------------------------------------------------------- +void() idchthon_idle1 =[ $walk1, idchthon_idle2 ] {idchthon_tracking();}; +void() idchthon_idle2 =[ $walk2, idchthon_idle3 ] {}; +void() idchthon_idle3 =[ $walk3, idchthon_idle4 ] {}; +void() idchthon_idle4 =[ $walk4, idchthon_idle5 ] {}; +void() idchthon_idle5 =[ $walk5, idchthon_idle6 ] {}; +void() idchthon_idle6 =[ $walk6, idchthon_idle7 ] {}; +void() idchthon_idle7 =[ $walk7, idchthon_idle8 ] {}; +void() idchthon_idle8 =[ $walk8, idchthon_idle9 ] {}; +void() idchthon_idle9 =[ $walk9, idchthon_idle10 ] {}; +void() idchthon_idle10 =[ $walk10, idchthon_idle11 ] {idchthon_tracking();}; +void() idchthon_idle11 =[ $walk11, idchthon_idle12 ] {}; +void() idchthon_idle12 =[ $walk12, idchthon_idle13 ] {}; +void() idchthon_idle13 =[ $walk13, idchthon_idle14 ] {}; +void() idchthon_idle14 =[ $walk14, idchthon_idle15 ] {}; +void() idchthon_idle15 =[ $walk15, idchthon_idle16 ] {}; +void() idchthon_idle16 =[ $walk16, idchthon_idle17 ] {}; +void() idchthon_idle17 =[ $walk17, idchthon_idle18 ] {}; +void() idchthon_idle18 =[ $walk18, idchthon_idle19 ] {}; +void() idchthon_idle19 =[ $walk19, idchthon_idle20 ] {}; +void() idchthon_idle20 =[ $walk20, idchthon_idle21 ] {}; +void() idchthon_idle21 =[ $walk21, idchthon_idle22 ] {idchthon_tracking();}; +void() idchthon_idle22 =[ $walk22, idchthon_idle23 ] {}; +void() idchthon_idle23 =[ $walk23, idchthon_idle24 ] {}; +void() idchthon_idle24 =[ $walk24, idchthon_idle25 ] {}; +void() idchthon_idle25 =[ $walk25, idchthon_idle26 ] {}; +void() idchthon_idle26 =[ $walk26, idchthon_idle27 ] {}; +void() idchthon_idle27 =[ $walk27, idchthon_idle28 ] {}; +void() idchthon_idle28 =[ $walk28, idchthon_idle29 ] {}; +void() idchthon_idle29 =[ $walk29, idchthon_idle30 ] {}; +void() idchthon_idle30 =[ $walk30, idchthon_idle31 ] {}; +void() idchthon_idle31 =[ $walk31, idchthon_idle1 ] {idchthon_tracking();}; + +//=========================================================================== +void(vector orgofs) idchthon_missile = +{ + local vector offang, org, vec, dir, mdest, avel; + local float projlen; + + // No enemy, player dead or intermission? + if (!self.enemy || self.enemy.health < 1 || intermission_running > 0) { + self.th_stand(); + return; + } + + sound (self, CHAN_WEAPON, "chthon/attack1.wav", 1, ATTN_NORM); + offang = vectoangles (self.enemy.origin - self.origin); + makevectors (offang); + org = self.origin + attack_vector(orgofs); + + // Skill level adjustment (easy=250, normal=300, hard=350, nm=400) + self.attack_speed = SPEED_LAVABALL + (skill*SPEED_LAVASKILL); + + // Lead the missile on hard mode (This formula is not perfect) + // There are plenty of missiles that go in strange directions, + // especially if the player strafes a lot from side to side. + if (skill > SKILL_NORMAL) { + projlen = vlen(self.enemy.origin - org) / self.attack_speed; + vec = self.enemy.velocity; + vec_z = 0; + mdest = self.enemy.origin + projlen * vec; + } + else mdest = self.enemy.origin; + + dir = normalize (mdest - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_LAVA, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() idchthon_face = +{ + // Find a player + if (!self.enemy) { + self.enemy = find(world, classname, "player"); + if (!self.enemy) self.enemy = world; + } + + // Check for any no combat conditions + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.health < 1) self.enemy = world; + if (self.enemy) ai_face(); +}; + +//---------------------------------------------------------------------- +void() idchthon_missile1 =[ $attack1, idchthon_missile2 ] {idchthon_face();}; +void() idchthon_missile2 =[ $attack2, idchthon_missile3 ] {idchthon_face();}; +void() idchthon_missile3 =[ $attack3, idchthon_missile4 ] {idchthon_face();}; +void() idchthon_missile4 =[ $attack4, idchthon_missile5 ] {idchthon_face();}; +void() idchthon_missile5 =[ $attack5, idchthon_missile6 ] {idchthon_face();}; +void() idchthon_missile6 =[ $attack6, idchthon_missile7 ] {idchthon_face();}; +void() idchthon_missile7 =[ $attack7, idchthon_missile8 ] {idchthon_face();}; +void() idchthon_missile8 =[ $attack8, idchthon_missile9 ] {idchthon_face();}; +void() idchthon_missile9 =[ $attack9, idchthon_missile10 ] {idchthon_missile('100 100 200');}; +void() idchthon_missile10 =[ $attack10, idchthon_missile11 ] {idchthon_face();}; +void() idchthon_missile11 =[ $attack11, idchthon_missile12 ] {idchthon_face();}; +void() idchthon_missile12 =[ $attack12, idchthon_missile13 ] {idchthon_face();}; +void() idchthon_missile13 =[ $attack13, idchthon_missile14 ] {idchthon_face();}; +void() idchthon_missile14 =[ $attack14, idchthon_missile15 ] {idchthon_face();}; +void() idchthon_missile15 =[ $attack15, idchthon_missile16 ] {idchthon_face();}; +void() idchthon_missile16 =[ $attack16, idchthon_missile17 ] {idchthon_face();}; +void() idchthon_missile17 =[ $attack17, idchthon_missile18 ] {idchthon_face();}; +void() idchthon_missile18 =[ $attack18, idchthon_missile19 ] {idchthon_face();}; +void() idchthon_missile19 =[ $attack19, idchthon_missile20 ] {idchthon_face();}; +void() idchthon_missile20 =[ $attack20, idchthon_missile21 ] {idchthon_missile('100 -100 200');}; +void() idchthon_missile21 =[ $attack21, idchthon_missile22 ] {idchthon_face();}; +void() idchthon_missile22 =[ $attack22, idchthon_missile23 ] {idchthon_face();}; +void() idchthon_missile23 =[ $attack23, idchthon_missile1 ] {idchthon_face();}; + +//---------------------------------------------------------------------- +void() idchthon_rise1 =[ $rise1, idchthon_rise2 ] {}; +void() idchthon_rise2 =[ $rise2, idchthon_rise3 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM);}; +void() idchthon_rise3 =[ $rise3, idchthon_rise4 ] {}; +void() idchthon_rise4 =[ $rise4, idchthon_rise5 ] {ai_face();}; +void() idchthon_rise5 =[ $rise5, idchthon_rise6 ] {}; +void() idchthon_rise6 =[ $rise6, idchthon_rise7 ] {ai_face();}; +void() idchthon_rise7 =[ $rise7, idchthon_rise8 ] {}; +void() idchthon_rise8 =[ $rise8, idchthon_rise9 ] {ai_face();}; +void() idchthon_rise9 =[ $rise9, idchthon_rise10 ] {}; +void() idchthon_rise10 =[ $rise10, idchthon_rise11 ] {ai_face();}; +void() idchthon_rise11 =[ $rise11, idchthon_rise12 ] {}; +void() idchthon_rise12 =[ $rise12, idchthon_rise13 ] {ai_face();}; +void() idchthon_rise13 =[ $rise13, idchthon_rise14 ] {}; +void() idchthon_rise14 =[ $rise14, idchthon_rise15 ] {ai_face();}; +void() idchthon_rise15 =[ $rise15, idchthon_rise16 ] {}; +void() idchthon_rise16 =[ $rise16, idchthon_rise17 ] {ai_face();}; +void() idchthon_rise17 =[ $rise17, idchthon_missile1 ] {}; + +//---------------------------------------------------------------------- +void() idchthon_awake = +{ + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_NO; + self.velocity = '0 0 0'; + + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + if (skill == SKILL_EASY) self.health = 1; + else self.health = 3; + self.enemy = activator; + + // DP particle spark and smoke effect to Chthon + // original idea by Seven, green version added later by me + if (ext_dppart) self.traileffectnum = particleeffectnum(self.dpp_name); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + sound (self, CHAN_WEAPON, "chthon/lavasplash.wav", 1, ATTN_NORM); + idchthon_rise1 (); +}; + +//=========================================================================== +void() idchthon_shocka1 =[ $shocka1, idchthon_shocka2 ] {}; +void() idchthon_shocka2 =[ $shocka2, idchthon_shocka3 ] {}; +void() idchthon_shocka3 =[ $shocka3, idchthon_shocka4 ] {}; +void() idchthon_shocka4 =[ $shocka4, idchthon_shocka5 ] {}; +void() idchthon_shocka5 =[ $shocka5, idchthon_shocka6 ] {}; +void() idchthon_shocka6 =[ $shocka6, idchthon_shocka7 ] {}; +void() idchthon_shocka7 =[ $shocka7, idchthon_shocka8 ] {}; +void() idchthon_shocka8 =[ $shocka8, idchthon_shocka9 ] {}; +void() idchthon_shocka9 =[ $shocka9, idchthon_shocka10 ] {}; +void() idchthon_shocka10 =[ $shocka10, idchthon_missile1 ] {}; + +//---------------------------------------------------------------------- +void() idchthon_shockb1 =[ $shockb1, idchthon_shockb2 ] {}; +void() idchthon_shockb2 =[ $shockb2, idchthon_shockb3 ] {}; +void() idchthon_shockb3 =[ $shockb3, idchthon_shockb4 ] {}; +void() idchthon_shockb4 =[ $shockb4, idchthon_shockb5 ] {}; +void() idchthon_shockb5 =[ $shockb5, idchthon_shockb6 ] {}; +void() idchthon_shockb6 =[ $shockb6, idchthon_shockb7 ] {}; +void() idchthon_shockb7 =[ $shockb1, idchthon_shockb8 ] {}; +void() idchthon_shockb8 =[ $shockb2, idchthon_shockb9 ] {}; +void() idchthon_shockb9 =[ $shockb3, idchthon_shockb10 ] {}; +void() idchthon_shockb10 =[ $shockb4, idchthon_missile1 ] {}; + +//---------------------------------------------------------------------- +void() idchthon_shockc1 =[ $shockc1, idchthon_shockc2 ] {}; +void() idchthon_shockc2 =[ $shockc2, idchthon_shockc3 ] {}; +void() idchthon_shockc3 =[ $shockc3, idchthon_shockc4 ] {}; +void() idchthon_shockc4 =[ $shockc4, idchthon_shockc5 ] {}; +void() idchthon_shockc5 =[ $shockc5, idchthon_shockc6 ] {}; +void() idchthon_shockc6 =[ $shockc6, idchthon_shockc7 ] {}; +void() idchthon_shockc7 =[ $shockc7, idchthon_shockc8 ] {}; +void() idchthon_shockc8 =[ $shockc8, idchthon_shockc9 ] {}; +void() idchthon_shockc9 =[ $shockc9, idchthon_shockc10 ] {}; +void() idchthon_shockc10 =[ $shockc10, idchthon_death1 ] {}; + +//---------------------------------------------------------------------- +void() lightning_fire = +{ + local vector p1, p2; + + // done here, put the terminals back up + if (time >= lightning_end) { + self = le1; + func_door_go_down (); + self = le2; + func_door_go_down (); + return; + } + + p1 = (le1.mins + le1.maxs) * 0.5; + p1_z = le1.absmin_z - 16; + + p2 = (le2.mins + le2.maxs) * 0.5; + p2_z = le2.absmin_z - 16; + + // compensate for length of bolt + p2 = p2 - normalize(p2-p1)*100; + + self.nextthink = time + 0.1; + self.think = lightning_fire; + + WriteByte (MSG_ALL, SVC_TEMPENTITY); + WriteByte (MSG_ALL, TE_LIGHTNING3); + WriteEntity (MSG_ALL, world); + WriteCoord (MSG_ALL, p1_x); + WriteCoord (MSG_ALL, p1_y); + WriteCoord (MSG_ALL, p1_z); + WriteCoord (MSG_ALL, p2_x); + WriteCoord (MSG_ALL, p2_y); + WriteCoord (MSG_ALL, p2_z); +}; + +//---------------------------------------------------------------------- +void() lightning_use = +{ + if (lightning_end >= time + 1) return; + + le1 = find( world, target, "lightning"); + le2 = find( le1, target, "lightning"); + if (!le1 || !le2) { + dprint ("\b[CHTHON]\b missing lightning targets\n"); + return; + } + + // Check for lightning block alignment + if ( + (le1.state != STATE_TOP && le1.state != STATE_BOTTOM) + || (le2.state != STATE_TOP && le2.state != STATE_BOTTOM) + || (le1.state != le2.state) ) + { return; } + + // don't let the electrodes go back up until the bolt is done + le1.nextthink = -1; + le2.nextthink = -1; + lightning_end = time + 1; + + sound (self, CHAN_VOICE, "misc/power.wav", 1, ATTN_NORM); + lightning_fire (); + + // advance the boss pain if down + self = find (world, classname, "monster_boss"); + if (!self) return; + self.enemy = activator; + if (le1.state == STATE_TOP && self.health > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.health = self.health - 1; + if (self.health >= 2) idchthon_shocka1(); + else if (self.health == 1) idchthon_shockb1(); + else if (self.health == 0) idchthon_shockc1(); + } +}; + +//=========================================================================== +void() idchthon_death1 = [$death1, idchthon_death2] { +sound (self, CHAN_VOICE, "chthon/death.wav", 1, ATTN_NORM);}; +void() idchthon_death2 = [$death2, idchthon_death3] {}; +void() idchthon_death3 = [$death3, idchthon_death4] {}; +void() idchthon_death4 = [$death4, idchthon_death5] {}; +void() idchthon_death5 = [$death5, idchthon_death6] {}; +void() idchthon_death6 = [$death6, idchthon_death7] {}; +void() idchthon_death7 = [$death7, idchthon_death8] {}; +void() idchthon_death8 = [$death8, idchthon_death9] {}; +void() idchthon_death9 = [$death9, idchthon_death10] { + sound (self, CHAN_BODY, "chthon/lavasplash.wav", 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +}; +// No plans to support map hacks anymore, function name changed +void() idchthon_death10 = [$death9, idchthon_death10] { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + SUB_UseTargets (); + entity_hide(self); +}; + +/*====================================================================== + QUAKED monster_boss (1 0 0) (-128 -128 -24) (128 128 256) +======================================================================*/ +void() monster_boss = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_bosschthon.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_LAVA); + + // Attack/throw/electric sound + precache_sound ("chthon/attack1.wav"); + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("misc/power.wav"); + + self.pain_sound = "chthon/pain.wav"; + precache_sound (self.pain_sound); + precache_sound ("chthon/death.wav"); + + // Rise from lava roar + splash + self.sight_sound = "chthon/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("chthon/lavasplash.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-80 -80 -24'; // has own entity setup + self.bbmaxs = '80 80 256'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.poisonous = FALSE; // Cannot be poisonous + + self.health = 3; + self.takedamage = DAMAGE_NO; // Cannot be damaged + self.bouncegrenade = TRUE; // Grenades bounce off! + self.dpp_name = "TR_BOSSCHTHON";// Lava smoke and sparks + self.yaw_speed = 20; // Fast turner + self.deathstring = " was blown apart by Chthon\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 1; + self.resist_rockets = self.resist_cells = 1; + + self.th_stand = idchthon_idle1; + self.th_walk = idchthon_idle1; + self.th_run = idchthon_idle1; + self.th_missile = idchthon_missile1; + + self.classtype = CT_MONIDCHTHON; + self.classgroup = CG_BOSS; + // Does not go through monster spawn functions + total_monsters = total_monsters + 1; + self.use = idchthon_awake; +}; + +/*====================================================================== +/*QUAKED event_lightning (0 1 1) (-16 -16 -16) (16 16 16) x +Just for boss level. Used for killing Cthon. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Just for boss level. Used for killing Cthon. +======================================================================*/ +void() event_lightning = +{ + self.use = lightning_use; +}; + +/*====================================================================== +/*QUAKED misc_teleporttrain (0 0.5 0.8) (-8 -8 -8) (8 8 8) x +This is used for the final boss ONLY +Flying ball needed to teleport kill Shub-Niggurath +-------- KEYS -------- +-------- SPAWNFLAGS -------- +-------- NOTES -------- +This is used for the final boss ONLY +Flying ball needed to teleport kill Shub-Niggurath +Originallu used bmodel train functions, setup to work like +the shalrath homing missile + +======================================================================*/ +void() teleporttrain_next; +void() teleporttrain_target = +{ + local vector dir; + + if (self.target != "") { + // Find next target entity + self.enemy = find (world, targetname, self.target); + if (self.enemy) { + // Work out distance and angle to turn towards + dir = normalize(self.enemy.origin - self.origin); + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.velocity = dir * self.speed; + + // Shift target to next target in the entity chain + self.target = self.enemy.target; + self.nextthink = time + 0.1; + self.think = teleporttrain_next; + return; + } + } + // No target or entity to follow, full stop + self.velocity = '0 0 0'; + self.enemy = world; +}; + +//---------------------------------------------------------------------- +void() teleporttrain_next = +{ + if (!self.enemy) return; + + // Work out how close to the next target (self.enemy) + self.t_length = vlen(self.enemy.origin - self.origin); + if (self.t_length < 64) teleporttrain_target(); + else { + // Keep checking + self.nextthink = time + 0.1; + self.think = teleporttrain_next; + } +}; + +//---------------------------------------------------------------------- +void() misc_teleporttrain = +{ + self.mdl = "progs/teleport.mdl"; + precache_model (self.mdl); + + self.solid = SOLID_TRIGGER; + // Push movetype cannot rotate, fly can + // self.movetype = MOVETYPE_PUSH; + self.movetype = MOVETYPE_FLY; + self.use = teleporttrain_target; + self.avelocity = vecrand(50,250,FALSE); + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN , VEC_ORIGIN); + + if (!self.speed) self.speed = 100; + if (self.target == "") { + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } +}; diff --git a/QC_other/QC_arcane/mon_bossidshub.qc b/QC_other/QC_arcane/mon_bossidshub.qc new file mode 100644 index 00000000..599989eb --- /dev/null +++ b/QC_other/QC_arcane/mon_bossidshub.qc @@ -0,0 +1,279 @@ +/*============================================================================== +OLD ONE / Shub-Niggurath (ID software Version) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 idle14 idle15 idle16 +$frame idle17 idle18 idle19 idle20 idle21 idle22 idle23 idle24 +$frame idle25 idle26 idle27 idle28 idle29 idle30 idle31 idle32 +$frame idle33 idle34 idle35 idle36 idle37 idle38 idle39 idle40 +$frame idle41 idle42 idle43 idle44 idle45 idle46 + +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 +$frame shake16 shake17 shake18 shake19 shake20 + +void() finale_1; +void() finale_2; +void() finale_3; +void() finale_4; +entity shub; + +//=========================================================================== +void() idshub_idle1 =[ $idle1, idshub_idle2 ] {}; +void() idshub_idle2 =[ $idle2, idshub_idle3 ] {}; +void() idshub_idle3 =[ $idle3, idshub_idle4 ] {}; +void() idshub_idle4 =[ $idle4, idshub_idle5 ] {}; +void() idshub_idle5 =[ $idle5, idshub_idle6 ] {}; +void() idshub_idle6 =[ $idle6, idshub_idle7 ] {}; +void() idshub_idle7 =[ $idle7, idshub_idle8 ] {}; +void() idshub_idle8 =[ $idle8, idshub_idle9 ] {}; +void() idshub_idle9 =[ $idle9, idshub_idle10 ] {}; +void() idshub_idle10 =[ $idle10, idshub_idle11 ] {}; +void() idshub_idle11 =[ $idle11, idshub_idle12 ] {}; +void() idshub_idle12 =[ $idle12, idshub_idle13 ] {}; +void() idshub_idle13 =[ $idle13, idshub_idle14 ] {}; +void() idshub_idle14 =[ $idle14, idshub_idle15 ] {}; +void() idshub_idle15 =[ $idle15, idshub_idle16 ] {}; +void() idshub_idle16 =[ $idle16, idshub_idle17 ] {}; +void() idshub_idle17 =[ $idle17, idshub_idle18 ] {}; +void() idshub_idle18 =[ $idle18, idshub_idle19 ] {}; +void() idshub_idle19 =[ $idle19, idshub_idle20 ] {}; +void() idshub_idle20 =[ $idle20, idshub_idle21 ] {}; +void() idshub_idle21 =[ $idle21, idshub_idle22 ] {}; +void() idshub_idle22 =[ $idle22, idshub_idle23 ] {}; +void() idshub_idle23 =[ $idle23, idshub_idle24 ] {}; +void() idshub_idle24 =[ $idle24, idshub_idle25 ] {}; +void() idshub_idle25 =[ $idle25, idshub_idle26 ] {}; +void() idshub_idle26 =[ $idle26, idshub_idle27 ] {}; +void() idshub_idle27 =[ $idle27, idshub_idle28 ] {}; +void() idshub_idle28 =[ $idle28, idshub_idle29 ] {}; +void() idshub_idle29 =[ $idle29, idshub_idle30 ] {}; +void() idshub_idle30 =[ $idle30, idshub_idle31 ] {}; +void() idshub_idle31 =[ $idle31, idshub_idle32 ] {}; +void() idshub_idle32 =[ $idle32, idshub_idle33 ] {}; +void() idshub_idle33 =[ $idle33, idshub_idle34 ] {}; +void() idshub_idle34 =[ $idle34, idshub_idle35 ] {}; +void() idshub_idle35 =[ $idle35, idshub_idle36 ] {}; +void() idshub_idle36 =[ $idle36, idshub_idle37 ] {}; +void() idshub_idle37 =[ $idle37, idshub_idle38 ] {}; +void() idshub_idle38 =[ $idle38, idshub_idle39 ] {}; +void() idshub_idle39 =[ $idle39, idshub_idle40 ] {}; +void() idshub_idle40 =[ $idle40, idshub_idle41 ] {}; +void() idshub_idle41 =[ $idle41, idshub_idle42 ] {}; +void() idshub_idle42 =[ $idle42, idshub_idle43 ] {}; +void() idshub_idle43 =[ $idle43, idshub_idle44 ] {}; +void() idshub_idle44 =[ $idle44, idshub_idle45 ] {}; +void() idshub_idle45 =[ $idle45, idshub_idle46 ] {}; +void() idshub_idle46 =[ $idle46, idshub_idle1 ] {}; + +//=========================================================================== +void() idshub_pain1 = [ $shake1, idshub_pain2 ] { lightstyle(0, "m");}; +void() idshub_pain2 = [ $shake2, idshub_pain3 ] { lightstyle(0, "k");}; +void() idshub_pain3 = [ $shake3, idshub_pain4 ] { lightstyle(0, "k");}; +void() idshub_pain4 = [ $shake4, idshub_pain5 ] { lightstyle(0, "i");}; +void() idshub_pain5 = [ $shake5, idshub_pain6 ] { lightstyle(0, "g");}; +void() idshub_pain6 = [ $shake6, idshub_pain7 ] { lightstyle(0, "e");}; +void() idshub_pain7 = [ $shake7, idshub_pain8 ] { lightstyle(0, "c");}; +void() idshub_pain8 = [ $shake8, idshub_pain9 ] { lightstyle(0, "a");}; +void() idshub_pain9 = [ $shake9, idshub_pain10 ] {lightstyle(0, "c");}; +void() idshub_pain10 =[ $shake10, idshub_pain11 ] {lightstyle(0, "e");}; + +void() idshub_pain11 =[ $shake11, idshub_pain12 ] {lightstyle(0, "g");}; +void() idshub_pain12 =[ $shake12, idshub_pain13 ] {lightstyle(0, "i");}; +void() idshub_pain13 =[ $shake13, idshub_pain14 ] {lightstyle(0, "k");}; +void() idshub_pain14 =[ $shake14, idshub_pain15 ] {lightstyle(0, "m");}; +void() idshub_pain15 =[ $shake15, idshub_pain16 ] {lightstyle(0, "m"); +self.cnt = self.cnt + 1; if (self.cnt < 3) self.think = idshub_pain1; }; + +void() idshub_pain16 =[ $shake16, idshub_pain17 ] {lightstyle(0, "g");}; +void() idshub_pain17 =[ $shake17, idshub_pain18 ] {lightstyle(0, "c");}; +void() idshub_pain18 =[ $shake18, idshub_pain19 ] {lightstyle(0, "b");}; +void() idshub_pain19 =[ $shake19, idshub_pain20 ] {lightstyle(0, "a");}; +void() idshub_pain20 =[ $shake20, idshub_pain20 ] {finale_4();}; + +//============================================================================ +// Final thrash, explosion and on screen text waffle +//============================================================================ +void() finale_1 = +{ + intermission_running = INTERMISSION_ENDGAME; //End of the game! + intermission_exittime = time + 100000; // never allow exit + + // find the intermission spot + self.owner = find (world, classname, "info_intermission"); + if (!self.owner) dprint("Cannot find info_intermission"); + + // Find misc teleport thing and remove it + self.enemy = find (world, classname, "misc_teleporttrain"); + if (!self.enemy) dprint("Cannot find teleporttrain"); + else remove (self.enemy); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, ""); + + // Cycle through all players and reset them as below + self.enemy = find (world, classname, "player"); + while (self.enemy != world) { + self.enemy.view_ofs = '0 0 0'; + self.enemy.angles = self.enemy.v_angle = self.owner.mangle; + self.enemy.fixangle = TRUE; // turn this way immediately + self.enemy.map = self.map; + self.enemy.nextthink = time + 0.5; + self.enemy.takedamage = DAMAGE_NO; + self.enemy.solid = SOLID_NOT; + self.enemy.movetype = MOVETYPE_NONE; + self.enemy.modelindex = 0; + setorigin (self.enemy, self.owner.origin); + self.enemy = find (self.enemy, classname, "player"); + } + + self.nextthink = time + 0.3; + self.think = finale_2; + self.count = 10; +}; + +//---------------------------------------------------------------------- +// Randomnly spawn 10 teleporter sparkle effects +//---------------------------------------------------------------------- +void() finale_2 = +{ + if (self.count < 0) finale_3(); + else { + sound (self, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + + // start a teleport splash inside shub + self.view_ofs_x = crandom()*50; + self.view_ofs_y = -100; + self.view_ofs_z = random()*100; + self.oldorigin = self.origin + self.view_ofs; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, self.oldorigin_x); + WriteCoord (MSG_BROADCAST, self.oldorigin_y); + WriteCoord (MSG_BROADCAST, self.oldorigin_z); + + self.count = self.count - 1; + self.nextthink = time + random()*0.5; + self.think = finale_2; + } +}; + +//---------------------------------------------------------------------- +void() finale_3 = +{ + // start shub thrashing wildly + sound (self, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NORM); + lightstyle(0, "abcdefghijklmlkjihgfedcb"); + idshub_pain1(); +}; + +//---------------------------------------------------------------------- +// Called after thrash animation (last frame) +//---------------------------------------------------------------------- +void() finale_4 = +{ + // Play exploding sound + sound (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM); + self.oldorigin = self.origin; + + // Setup temp entity for directional force for gibs + self.movelast = spawn(); + self.movelast.oldorigin = self.origin - '0 0 -300'; + setorigin (self.movelast, self.movelast.oldorigin); + setmodel (self.movelast, MODEL_BROKEN); + self.enemy = self.movelast; + + // loop through old one x/y/z space and throw tons of meat chunks + self.count = 16; + while (self.count > 0) { + self.view_ofs = vecrand(0,64,TRUE); // random xyz volume loc + self.view_ofs_z = 50 + random()*200; // Extra lift up + self.origin = self.oldorigin + self.view_ofs; // Move origin around + self.health = 0 - random()*200; // Velocity boast + + self.lip = random(); + if (self.lip < 0.1) ThrowGib(1, 1); + else if (self.lip < 0.3) ThrowGib(2, 1); + else if (self.lip < 0.5) ThrowGib(4, 1+random()*3); + else ThrowGib(5, 1+random()*3); + + self.count = self.count - 1; + } + // start the end text + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Congratulations and well done! You have\nbeaten the hideous Shub-Niggurath, and\nher hundreds of ugly changelings and\nmonsters. You have proven that your\nskill and your cunning are greater than\nall the powers of Quake. You are the\nmaster now. Id Software salutes you."); + + // put a player model down + self.oldorigin = self.oldorigin - '32 264 0'; + setorigin (self.movelast, self.oldorigin); + setmodel (self.movelast, MODEL_PLAYER); + self.movelast.angles = '0 290 0'; + self.movelast.frame = 1; + + remove(self); + + // switch cd track + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 3); + lightstyle(0, "m"); +}; + +//============================================================================ +void (entity inflictor, entity attacker, float damage) idshub_nopain = +{ + self.health = self.max_health; +}; + +/*============================================================================ + QUAKED monster_oldone (1 0 0) (-16 -16 -24) (16 16 32) +============================================================================*/ +void() monster_oldone = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/oldone.mdl"; + precache_model (self.mdl); + + // idle/sight not used + precache_sound ("boss2/idle.wav"); + precache_sound ("boss2/sight.wav"); + + // finale_3/finale_4 stages + precache_sound ("boss2/death.wav"); + precache_sound ("boss2/pop2.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-96 -96 -24'; // has own entity setup + self.bbmaxs = '96 96 192'; + self.bboxtype = BBOX_CUSTOM; // Custom BBox size + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.poisonous = FALSE; // Cannot be poisonous + self.deathstring = " became one with Shub-Niggurath\n"; + + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.no_liquiddmg = TRUE; // no slime/lava damage + self.gibbed = FALSE; // Still in one piece + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 1; + self.resist_rockets = self.resist_cells = 1; + + self.classtype = CT_MONIDSHUB; + self.classgroup = CG_BOSS; + self.health = self.max_health = 40000; // kill by telefrag + self.think = idshub_idle1; + self.nextthink = time + 0.1; + self.takedamage = DAMAGE_YES; + self.th_pain = idshub_nopain; + self.th_die = finale_1; + shub = self; + + total_monsters = total_monsters + 1; +}; + diff --git a/QC_other/QC_arcane/mon_bossnour.qc b/QC_other/QC_arcane/mon_bossnour.qc new file mode 100644 index 00000000..8e294bc7 --- /dev/null +++ b/QC_other/QC_arcane/mon_bossnour.qc @@ -0,0 +1,1153 @@ +/*============================================================================== +Nouronihar (Based on a monster by Lunaran) +==============================================================================*/ +// Original wizard idle +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 + +// Leaning forward flying pose +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 +$frame fly9 fly10 fly11 fly12 fly13 + +// A = Short recoil to right, B = Long recoil to left +$frame paina1 paina2 paina3 paina4 paina5 paina6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 + +// Very quick fall down backward death +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +// A - Typical spit/spike firing from all arms +$frame shota1 shota2 shota3 shota4 shota5 shota6 shota7 shota8 +$frame shota9 shota10 shota11 + +// B - Long spit/spike firing from all arms +$frame shotb1 shotb2 shotb3 shotb4 shotb5 shotb6 shotb7 shotb8 +$frame shotb9 shotb10 shotb11 shotb12 shotb13 shotb14 shotb15 shotb16 shotb17 + +// C - Slowly flick all arms upward (big attack) +$frame shotc1 shotc2 shotc3 shotc4 shotc5 shotc6 shotc7 shotc8 +$frame shotc9 shotc10 shotc11 shotc12 shotc13 shotc14 shotc15 shotc16 +$frame shotc17 shotc18 shotc19 shotc20 shotc21 shotc22 shotc23 + +// Rise upward and flee from the scene +$frame flee1 flee2 flee3 flee4 flee5 flee6 flee7 flee8 +$frame flee9 flee10 flee11 flee12 flee13 flee14 flee15 flee16 +$frame flee17 flee18 + +// Long reveal of extra arms, pretending to be wizard at first +$frame reveal1 reveal2 reveal3 reveal4 reveal5 reveal6 reveal7 reveal8 +$frame reveal9 reveal10 reveal11 reveal12 reveal13 reveal14 reveal15 reveal16 +$frame reveal17 reveal18 reveal19 reveal20 reveal21 reveal22 reveal23 reveal24 +$frame reveal25 reveal26 reveal27 reveal28 reveal29 reveal30 reveal31 reveal32 +$frame reveal33 reveal34 reveal35 reveal36 + +float NOUR_PHASE0 = -1; // No waves +float NOUR_PHASE1 = 1; // Burst through floor +float NOUR_PHASE2 = 2; // Fighting +float NOUR_PHASE3 = 3; // Frenzy mode +float NOUR_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() nour_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() nour_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP has reached next boss wave trigger event +//---------------------------------------------------------------------- +float() nour_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + nour_WaveSetupHP(); + self.style = NOUR_PHASE3; // Frenzy mode + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check the tether system +//---------------------------------------------------------------------- +float() nour_CheckTether = +{ + // Check for boss mode + if (!(self.spawnflags & MON_NOUR_BOSS)) return FALSE; + + self.t_length = vlen(self.origin - self.movelast.origin); + // Check the most obvious first, inside tether range? + if (self.t_length < MONAI_MAXNOUR) return FALSE; + else { + // If player or tether close to each other? + if (infront(self.movelast) && infront(SUB_entEnemyTarget()) ) + return FALSE; + // Stop moving around + else return TRUE; + } +}; + +//---------------------------------------------------------------------- +// Nour game play logic +//---------------------------------------------------------------------- +void() NourCheckAttack = +{ + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + + //---------------------------------------------------------------------- + // Check Melee range and constantly fire + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEENOUR) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // Range attacks (Spit and Bomb) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + // Fast/intense nail/spit attack + if (self.enemydist < MONAI_CLOSENOUR) { + // Skill 0=3s, 1=2.25s, 2=1.5s, 3=0.75s + self.attack_speed = (4 - skill) * 0.75; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MELEE; + return; + } + // Large rocket bomb attack with floor damage + else { + // Skill 0=4s, 1=3s, 2=2s, 3=1s + self.attack_speed = (4 - skill) * 1; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MISSILE; + return; + } + } + + //---------------------------------------------------------------------- + // Maintain distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID || !enemy_vis) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() nour_stand1 =[ $idle1, nour_stand2] {monster_idle_sound();ai_stand();}; +void() nour_stand2 =[ $idle2, nour_stand3] {ai_stand();}; +void() nour_stand3 =[ $idle3, nour_stand4] {ai_stand();}; +void() nour_stand4 =[ $idle4, nour_stand5] {ai_stand();}; +void() nour_stand5 =[ $idle5, nour_stand6] {ai_stand();}; +void() nour_stand6 =[ $idle6, nour_stand7] {ai_stand();}; +void() nour_stand7 =[ $idle7, nour_stand8] {ai_stand();}; +void() nour_stand8 =[ $idle8, nour_stand9] {ai_stand();}; +void() nour_stand9 =[ $idle9, nour_stand10] {ai_stand();}; +void() nour_stand10 =[ $idle10, nour_stand11] {ai_stand();}; +void() nour_stand11 =[ $idle11, nour_stand1] {ai_stand();}; + +//====================================================================== +void() nour_walk1 =[ $idle1, nour_walk2] {monster_idle_sound();ai_walk(8);}; +void() nour_walk2 =[ $idle2, nour_walk3] {ai_walk(8);}; +void() nour_walk3 =[ $idle3, nour_walk4] {ai_walk(8);}; +void() nour_walk4 =[ $idle4, nour_walk5] {ai_walk(8);}; +void() nour_walk5 =[ $idle5, nour_walk6] {ai_walk(8);}; +void() nour_walk6 =[ $idle6, nour_walk7] {ai_walk(8);}; +void() nour_walk7 =[ $idle7, nour_walk8] {ai_walk(8);}; +void() nour_walk8 =[ $idle8, nour_walk9] {ai_walk(8);}; +void() nour_walk9 =[ $idle9, nour_walk10] {ai_walk(8);}; +void() nour_walk10 =[ $idle10, nour_walk11] {ai_walk(8);}; +void() nour_walk11 =[ $idle11, nour_walk1] {ai_walk(8);}; + +//====================================================================== +void() nour_slideframe = +{ + // Check for boss mode (phase and wave check) + if (self.spawnflags & MON_NOUR_BOSS) { + if (self.style != NOUR_PHASE2) return; + + // Check for boss wave trigger events + if (nour_WaveCheck() == TRUE) {self.th_jump(); return;} + } + + // Dead monster? + if (self.health < 1) return; + if (self.walkframe == 0) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 10) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = nour_slideframe; + + // Setup current animation frame + self.frame = $idle1 + self.walkframe; + self.ideal_yaw = vectoyaw(SUB_orgEnemyTarget() - self.origin); + + // Check the BOSS tether system + if (nour_CheckTether()) ai_run(0); + else ai_run(8); +}; + +//---------------------------------------------------------------------- +void() nour_slide1 = {self.walkframe = 0; nour_slideframe();}; + +//====================================================================== +// RUN state - chasing the player +//====================================================================== +void() nour_runframe = +{ + // Check for boss mode (phase and wave check) + if (self.spawnflags & MON_NOUR_BOSS) { + if (self.style != NOUR_PHASE2) return; + + // Check for boss wave trigger events + if (nour_WaveCheck() == TRUE) {self.th_jump(); return;} + } + + if (self.health < 1) return; + if (self.walkframe == 0) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 12) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = nour_runframe; + + // Setup current animation frame + self.frame = $fly1 + self.walkframe; + self.ideal_yaw = vectoyaw(SUB_orgEnemyTarget() - self.origin); + + // Check the BOSS tether system + if (nour_CheckTether()) ai_run(0); + else ai_run(16); +}; + +//---------------------------------------------------------------------- +void() nour_run1 = {self.walkframe = 0; nour_runframe();}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() nour_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_NOUR2B; + self.attachment.alpha = 0.85; + } +}; + +//---------------------------------------------------------------------- +void() nour_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() nour_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//====================================================================== +// ATTACK A - Fire multiple spit/spikes +// Block pain function from interrupting magic attack +//====================================================================== +void(vector offset) nour_spike = +{ + local vector dtarget, starget, ftarget, sorg, forg, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_NOURSPIKE + (skill * SPEED_NOURSKILL); + + ai_face(); + // Work out direction line from self to enemy + dtarget = SUB_orgEnemyTarget() - self.origin; + dtarget = vectoangles(dtarget); + makevectors (dtarget); + + // Work out correct source/target origins + starget = self.origin + v_forward * 16 + v_up * offset_z; + ftarget = SUB_orgEnemyTarget() + '0 0 16'; + + // Add left/right offset + sorg = starget + v_right * offset_x; + forg = ftarget + v_right * offset_x; + dir = normalize(forg - sorg); + launch_projectile (sorg, dir, CT_PROJ_NOUR1, self.attack_speed); + + sorg = starget - v_right * offset_x; + forg = ftarget - v_right * offset_x; + dir = normalize(forg - sorg); + launch_projectile (sorg, dir, CT_PROJ_NOUR1, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() nour_atta1 =[ $shota1, nour_atta2] {ai_face(); + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "nour/attack1.wav", 1, ATTN_NORM); +}; +void() nour_atta2 =[ $shota2, nour_atta3] {ai_face();}; +void() nour_atta3 =[ $shota3, nour_atta4] {ai_face();}; +void() nour_atta4 =[ $shota4, nour_atta5] {nour_spike('24,0,16');}; +void() nour_atta5 =[ $shota5, nour_atta6] {nour_spike('20 0 8');}; +void() nour_atta6 =[ $shota6, nour_atta7] {nour_spike('16 0 0');}; +void() nour_atta7 =[ $shota7, nour_atta8] {nour_spike('12 0 -8');}; +void() nour_atta8 =[ $shota8, nour_atta9] {nour_spike('8 0 -16');}; +void() nour_atta9 =[ $shota9, nour_atta10] {}; +void() nour_atta10 =[ $shota10, nour_atta11] {}; +void() nour_atta11 =[ $shota11, nour_run1] {}; + +//====================================================================== +// ATTACK B - Fire one large blob (grenade) of spit +//====================================================================== +void(vector bombofs) Fire_NourBomb = +{ + local vector org, torg, ang, dir, avel; + + // Finished with bomb effect + nour_finish_attachment(); + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "nour/attack1.wav", 1, ATTN_NORM); + + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(bombofs); + torg = SUB_orgEnemyTarget(); + + self.attack_speed = SPEED_NOURBOMB; + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, org, torg, self.attack_speed); + ang = vectoangles(torg - org); + ang_x = -self.attack_elev; + makevectors (ang); + dir = v_forward * self.attack_speed; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_NOUR2); +}; + +//---------------------------------------------------------------------- +void(vector bombofs, float bombframe) Setup_NourBomb = +{ + local vector org; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) nour_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (bombframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 0; + + // Start growing bomb sound + sound (self, CHAN_WEAPON, "nour/attack2.wav", 1, ATTN_NORM); + } + + // Turn towards enemy and update model attachment + // The offset is based on the nour facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(bombofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = bombframe; + // Random explosion like particles from ball as it grows + particle_explode(self.attachment.origin, 10+random()*10, 0.5+random(), PARTICLE_BURST_YELLOW, 0); +}; + +//---------------------------------------------------------------------- +void() nour_attb1 =[ $shotb1, nour_attb2] {ai_face(); + self.pain_finished = time + 1.5; +}; +void() nour_attb2 =[ $shotb2, nour_attb3] {ai_face();}; +void() nour_attb3 =[ $shotb3, nour_attb4] {ai_face();}; +void() nour_attb4 =[ $shotb4, nour_attb5] {ai_face();}; +void() nour_attb5 =[ $shotb5, nour_attb6] {Setup_NourBomb('24 0 0',0);}; +void() nour_attb6 =[ $shotb6, nour_attb7] {Setup_NourBomb('24 0 -2',1);}; +void() nour_attb7 =[ $shotb7, nour_attb8] {Setup_NourBomb('24 0 -4',2);}; +void() nour_attb8 =[ $shotb8, nour_attb9] {Setup_NourBomb('24 0 -8',3);}; +void() nour_attb9 =[ $shotb9, nour_attb10] {Setup_NourBomb('24 0 -12',4);}; +void() nour_attb10 =[ $shotb10, nour_attb11] {Setup_NourBomb('24 0 -16',5);}; +void() nour_attb11 =[ $shotb11, nour_attb12] {Setup_NourBomb('24 0 -12',6);}; +void() nour_attb12 =[ $shotb12, nour_attb13] {Fire_NourBomb('24 0 -12');}; +void() nour_attb13 =[ $shotb13, nour_attb14] {}; +void() nour_attb14 =[ $shotb14, nour_attb15] {}; +void() nour_attb15 =[ $shotb15, nour_attb16] {}; +void() nour_attb16 =[ $shotb16, nour_attb17] {ai_face();}; +void() nour_attb17 =[ $shotb17, nour_run1] {ai_face();}; + +//====================================================================== +// ATTACK C - Summon wizards around boss +//====================================================================== +void() Spawn_NourFog = +{ + // Randomly pick from teleport sounds + self.lip = random() * 5; + if (self.lip < 1) self.noise = "misc/r_tele1.wav"; + else if (self.lip < 2) self.noise = "misc/r_tele2.wav"; + else if (self.lip < 3) self.noise = "misc/r_tele3.wav"; + else if (self.lip < 4) self.noise = "misc/r_tele4.wav"; + else self.noise = "misc/r_tele5.wav"; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Show ID teleport particle effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +}; + +//---------------------------------------------------------------------- +// Fire random plasma spikes while summoning wizard minions +//---------------------------------------------------------------------- +void(vector minofs) Fire_NourPlasma = +{ + local vector org; + + makevectors(self.angles); + org = self.origin + attack_vector(minofs); + self.pos2 = vecrand(0,50,TRUE); + self.pos3 = normalize(self.pos2); + self.attack_speed = SPEED_NOURSPIKE + (random() * SPEED_NOURSKILL); + launch_plasma(org, self.pos3, CT_MONNOUR, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector minofs) Spawn_NourMin = +{ + // Finished with bomb effect + nour_finish_attachment(); + Fire_NourPlasma(minofs); + + if (!self.enemy) return; + if (self.health < 1) return; + + // Cycle through spawn targets and spawn Tfog + Wizard + self.lip = self.count; + while(self.lip > 0) { + self.attachment3.think = Spawn_NourFog; + self.attachment3.nextthink = time + 0.01 + random()*0.3; + + // If the spawn locaiton all clear, spawn something! + self.pos1 = self.attachment3.origin; + self.aflag = find_minionspace(self.pos1); + if (self.aflag == TRUE) { + // Check for any spawnflags on spawn point + if (random() < 0.5) + minion_wizard(self.pos1, self.enemy, MON_WIZARD_ABOVE); + else minion_wizard(self.pos1, self.enemy, 0); + } + + // Next spawn point + self.attachment3 = self.attachment3.entchain; + self.lip = self.lip - 1; + } +}; + +//---------------------------------------------------------------------- +void(vector minofs, float minframe) Setup_NourMin = +{ + local vector org; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) nour_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (minframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 1; + + // Start Spawning sound + sound (self, CHAN_WEAPON, "nour/attack2.wav", 1, ATTN_NORM); + } + + // The offset is based on the nour facing forward + makevectors(self.angles); + org = self.origin + attack_vector(minofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = minframe; + // Slowly suck in particles to energy ball + particle_implode(org, 20+random()*20, 75, 75, PARTICLE_BURST_BLUE); + + // Cycle through spawn targets and fire Lightning per frame + self.lip = self.count; + while(self.lip > 0) { + // Traceline from spawn point to random direction + self.pos1 = self.attachment3.origin - org; + self.pos2 = vecrand(0,50,TRUE); + self.pos3 = normalize(self.pos1 + self.pos2); + traceline(org, org + self.pos3 * 600, FALSE, self); + + // Create lightning bolt from source to target + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self.attachment3); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Play some arching lightning sounds + if (random() < 0.5) { + if (random() < 0.5) sound (self.attachment3, CHAN_BODY, "nour/elec_arch1.wav", 1, ATTN_NORM); + else sound (self.attachment3, CHAN_BODY, "nour/elec_arch2.wav", 1, ATTN_NORM); + } + + // Next spawn point + self.attachment3 = self.attachment3.entchain; + self.lip = self.lip - 1; + } + + // Generate a random bolt of electricity + Fire_NourPlasma(minofs); +}; + +//---------------------------------------------------------------------- +void() nour_attc1 =[ $shotc1, nour_attc2] {ai_face(); + // Make sure boss mode active for this attack + if (!(self.spawnflags & MON_NOUR_BOSS)) self.think = self.th_run; + + // Block all damage while summoning stuff + Resist_ChangeType(self, TRUE); + + // Reset attack state so it does not keep spawning + self.attack_state = AS_STRAIGHT; + self.lip = self.count; + while (self.lip > 0) { + self.cnt = 4; // Try 4 times, no infinite loops + while (self.cnt > 0) { + // Work out 2 empty spaces around Nour for minions + self.pos2 = vecrand(0,200,TRUE); + self.pos2_z = 16; // Spawn higher than boss + self.pos1 = self.origin + self.pos2; + // Check for available space for mininon + self.aflag = find_minionspace(self.pos1); + self.cnt = self.cnt - 1; + // Space is right, save origin + if (self.aflag == TRUE) self.cnt = -10; + } + // Found space, store origin for later + if (self.cnt == -10) self.attachment3.origin = self.pos1; + else self.attachment3.origin = self.origin; + + // Next spawn point + self.attachment3 = self.attachment3.entchain; + self.lip = self.lip - 1; + } +}; +void() nour_attc2 =[ $shotc2, nour_attc3] {ai_face();}; +void() nour_attc3 =[ $shotc3, nour_attc4] {ai_face();}; +void() nour_attc4 =[ $shotc4, nour_attc5] {Setup_NourMin('24 0 -24',0);}; +void() nour_attc5 =[ $shotc5, nour_attc6] {Setup_NourMin('24 0 -24',1);}; +void() nour_attc6 =[ $shotc6, nour_attc7] {Setup_NourMin('24 0 -22',2);}; +void() nour_attc7 =[ $shotc7, nour_attc8] {Setup_NourMin('24 0 -20',3);}; +void() nour_attc8 =[ $shotc8, nour_attc9] {Setup_NourMin('24 0 -16',4);}; +void() nour_attc9 =[ $shotc9, nour_attc10] {Setup_NourMin('24 0 -16',5);}; +void() nour_attc10 =[ $shotc10, nour_attc11] {Setup_NourMin('24 0 -12',6);}; +void() nour_attc11 =[ $shotc11, nour_attc12] {Setup_NourMin('24 0 -8',6);}; +void() nour_attc12 =[ $shotc12, nour_attc13] {Setup_NourMin('24 0 -4',7);}; +void() nour_attc13 =[ $shotc13, nour_attc14] {Setup_NourMin('24 0 -2',7);}; +void() nour_attc14 =[ $shotc14, nour_attc15] {Spawn_NourMin('24 0 0');}; +void() nour_attc15 =[ $shotc15, nour_attc16] {Fire_NourPlasma('24 0 0');}; +void() nour_attc16 =[ $shotc16, nour_attc17] {}; +void() nour_attc17 =[ $shotc17, nour_attc18] {}; +void() nour_attc18 =[ $shotc18, nour_attc19] {}; +void() nour_attc19 =[ $shotc19, nour_attc20] {}; +void() nour_attc20 =[ $shotc20, nour_attc21] {}; +void() nour_attc21 =[ $shotc21, nour_attc22] {}; +void() nour_attc22 =[ $shotc22, nour_attc23] {ai_face();}; +void() nour_attc23 =[ $shotc23, nour_run1] {ai_face(); + // Restore ammo resistance to default + Resist_ChangeType(self, FALSE); + self.style = NOUR_PHASE2; // Fight mode +}; + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void() nour_paina1 = [ $paina1, nour_paina2 ] {}; +void() nour_paina2 = [ $paina2, nour_paina3 ] {}; +void() nour_paina3 = [ $paina3, nour_paina4 ] {}; +void() nour_paina4 = [ $paina4, nour_paina5 ] {}; +void() nour_paina5 = [ $paina5, nour_paina6 ] {}; +void() nour_paina6 = [ $paina6, nour_run1 ] {}; + +//---------------------------------------------------------------------- +void() nour_painb1 = [ $painb1, nour_painb2 ] {}; +void() nour_painb2 = [ $painb2, nour_painb3 ] {}; +void() nour_painb3 = [ $painb3, nour_painb4 ] {}; +void() nour_painb4 = [ $painb4, nour_painb5 ] {}; +void() nour_painb5 = [ $painb5, nour_painb6 ] {}; +void() nour_painb6 = [ $painb6, nour_painb7 ] {}; +void() nour_painb7 = [ $painb7, nour_painb8 ] {}; +void() nour_painb8 = [ $painb8, nour_painb9 ] {}; +void() nour_painb9 = [ $painb9, nour_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) nour_pain = +{ + // Finish with all attachments + nour_finish_attachment(); + + if (self.spawnflags & MON_NOUR_BOSS) { + // Check for boss wave trigger events + if (nour_WaveCheck() == TRUE) {self.th_jump(); return;} + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.8) nour_paina1 (); // Short recoil right + else { + nour_painb1 (); // Long recoil left + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +// Death comes to us all, even Nour! +//============================================================================ +void() nour_explode = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // No more Nour! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + // Check for any death radius damage + if (self.death_dmg > 0) + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_PLASMA_BIG, self.origin, "nour/explode_death.wav"); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(11, 2); // Left Arm + ThrowGib(12, 2); // Right Arm + ThrowGib(13, 1); // Tail + ThrowGib(4, 10 + rint(random()*3)); + ThrowGib(5, 10 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() nour_die1 = [ $death1, nour_die2 ] {}; +void() nour_die2 = [ $death2, nour_die3 ] {}; +void() nour_die3 = [ $death3, nour_die4 ] {self.solid = SOLID_NOT;}; +void() nour_die4 = [ $death4, nour_die5 ] {}; +void() nour_die5 = [ $death5, nour_die6 ] {}; +void() nour_die6 = [ $death6, nour_die7 ] {}; +void() nour_die7 = [ $death7, nour_die8 ] {}; +void() nour_die8 = [ $death8, nour_die9 ] {self.lip = 0;}; +void() nour_die9 = [ $death9, nour_die9 ] { + // Spawn implosion effect + if (random() < 0.5) + particle_implode(self.origin, 20+random()*20, 100, 100, PARTICLE_BURST_BLUE); + // Spawn particle smoke and explosive smoke + else { + SpawnProjectileSmoke(self.origin, 150, 100, 300); + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_BLUE); + } + + // Check for any random lightning strikes outward + if (random() < 0.5) { + self.pos1 = self.origin - '0 0 16'; + self.pos2 = vecrand(0,50,TRUE); + self.pos2_z = 25 + random()*25; // Always up! + self.pos3 = normalize(self.pos2); + traceline(self.pos1, self.pos1 + self.pos3 * 600, FALSE, self); + + // Create lightning bolt + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Play some arching lightning sounds + if (random() < 0.5) { + if (random() < 0.5) sound (self, CHAN_BODY, "nour/elec_arch1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "nour/elec_arch2.wav", 1, ATTN_NORM); + } + } + // Check for a random bolt of plasma + if (random() < 0.2) Fire_NourPlasma('0 0 -16'); + + // Cycle through end phase + self.lip = self.lip + 1; + if (self.lip == 26) sound (self, CHAN_AUTO, "nour/implode_death.wav", 1, ATTN_NONE); + if (self.lip == 40) nour_explode(); +}; + +//---------------------------------------------------------------------- +void() nour_die = +{ + self.deadflag = DEAD_DEAD; // Nour bites the dust + self.effects = 0; // Remove effects on death + nour_finish_attachment(); // Remove any attachments + nour_remove_attachment(); + + sound (self, CHAN_VOICE, "nour/death.wav", 1, ATTN_NORM); + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + nour_die1 (); +}; + +//====================================================================== +// REVEAL PHASE (coming out of the ground) +//====================================================================== +void() nour_revealframe = +{ + // Beginning of animation block + if (self.walkframe == 3) + sound (self, CHAN_BODY, "nour/reveal.wav", 1, ATTN_NORM); + else if (self.walkframe == 23) + sound (self, CHAN_VOICE, "nour/idle1.wav", 1, ATTN_NORM); + + // Work out remaining distance to go + self.movedir = self.movetarget2.origin - self.origin; + self.t_length = vlen(self.movedir); + // Calc initial velocity boast (burst action) + self.lip = (self.pausetime - time) / 3.6; + self.t_width = 1 + (self.lip/2); + + // If time or distance too small, stop moving + if (self.lip < 0.1 || self.t_length < 2) { + self.velocity = '0 0 0'; + } + // Update velocity every frame + else self.velocity = self.movedir * self.t_width; + + // Turn towards player + if (self.enemy) ai_face(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + self.nextthink = time + 0.1; + // Time to exit reveal? + if (self.walkframe > 35) { + self.walkframe = 0; // Reset just in case + self.height = MONAI_ABOVEDIST; // Enemytarget distance above + self.movetype = MOVETYPE_STEP; // back to regular movement + self.takedamage = DAMAGE_AIM; // Can take damage + self.style = NOUR_PHASE2; // Time to fight! + Resist_ChangeType(self,FALSE); // restore resistance + self.think = nour_run1; // Straight to running + self.frame = $fly1; + FoundHuntTarget(FALSE); // make sure tracking player + } + else { + self.think = nour_revealframe; + // Setup current animation frame + self.frame = $reveal1 + self.walkframe; + } +}; + +//---------------------------------------------------------------------- +void() nour_reveal1 = { + self.pausetime = time + 3.6; + self.walkframe = 0; + nour_revealframe(); +}; + +//====================================================================== +// Create wizard minion entity chain +// Entities are created so that the spawning space can be tested +// before spawning the minions for possible collisions +//====================================================================== +float() nour_minionsetup = +{ + local entity min_prev, min_first; + + self.lip = self.count; + min_prev = min_first = world; + + // Cycle through minion list + while(self.lip > 0) { + newmis = spawn(); + newmis.origin = self.origin; + newmis.owner = self; + // Is this the first pass through loop? + if (!min_first) min_first = newmis; + // Any previous entities created? + if (!min_prev) min_prev = newmis; + else { + // Link previous to current entity + // and move previous forward in chain + min_prev.entchain = newmis; + min_prev = newmis; + } + // Keep on looping + self.lip = self.lip - 1; + } + // Close loop + if (min_first) { + newmis.entchain = min_first; + self.attachment3 = min_first; + return FALSE; + } + else return TRUE; +}; + +//====================================================================== +// Setup Nour after trigger event +//====================================================================== +void() nour_awake = +{ + // make sure boss mode selected + if (!(self.spawnflags & MON_NOUR_BOSS)) return; + + self.use = SUB_Null; // No more triggers + self.style = NOUR_PHASE1; // Bursting intro sequence + self.flags = FL_MONSTER | FL_FLY; // Reset flag + monster_bbox(); // Setup bounding box + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_FLY; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.takedamage = DAMAGE_NO; // Still immune to damage + self.yaw_speed = 20; // Average Speed + self.velocity = '0 0 0'; // Make sure stationary + self.pain_longanim = FALSE; // No axe advantage + self.noinfighting = TRUE; // No infighting + self.count = skill+1; // Total amount of minions + // skill modifier : Easy = 1, Normal = 2, Hard/NM = 3 + if (self.count > 3) self.count = 3; + // Setup minion chain entity system + if (nour_minionsetup()) { + dprint("\b[NOUR]\b Cannot create minion chain!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Reset all combat flags and counters + self.deadflag = DEAD_NO; + self.liquidbase = self.liquidcheck = 0; + self.dmgcombined = self.dmgtimeframe = 0; + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 4; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + nour_WaveSetupHP(); + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + + // Setup player focus + if (activator.flags & FL_CLIENT) { + self.goalentity = self.enemy = activator; + } + else self.enemy = world; + + // Trigger all spawning events + trigger_strs(self.message, self); + self.message = ""; + + // Find spawning (move) destination + self.movetarget2 = find(world,targetname,self.message2); + if (!self.movetarget2) { + dprint("\b[NOUR]\b Missing spawn destination!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; + + // Check for tether system (special target field) + if (self.tethertarget == "") { + dprint("\b[NOUR]\b Missing tether marker!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + // Find the tether marker (must be path_corner) + self.movelast = find(world,targetname,self.tethertarget); + if (self.movelast.classtype != CT_PATHCORNER) { + dprint("\b[NOUR]\b Tether marker not path_corner!\n"); + spawn_marker(self.movelast.origin, SPNMARK_YELLOW); + self.movelast = world; + } + // Make sure tethertarget is blank + self.tethertarget = ""; + + // Time to rise from the ground + nour_reveal1(); +}; + +/*====================================================================== + QUAKED monster_nouronihar (1 0 0) (-16 -16 -24) (16 16 40) +======================================================================*/ +void() monster_nour = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_bossnour.mdl"; + self.headmdl = "progs/h_wizard.mdl"; + self.gib1mdl = "progs/gib_wzarm1.mdl"; // Left arm/stump + self.gib2mdl = "progs/gib_wzarm2.mdl"; // Right arm/stump + self.gib3mdl = "progs/gib_wztail.mdl"; // Tail section + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_WIZ); // Originally progs/w_spike.mdl + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (MODEL_PROJ_NOUR1); // Spit + precache_model (MODEL_PROJ_NOUR2B); // Growing ball + precache_model (MODEL_PROJ_NOUR2P); // Warping projectile + precache_model (MODEL_PROJ_NOUR2S); // Explosive pieces + precache_model (MODEL_PROJ_NOUR3); // Lightning bolt + precache_model (SBURST_POISON); // Poison Burst + + // sight/pain/death sounds + self.idle_sound = "nour/idle1.wav"; + self.pain_sound = "nour/pain.wav"; + self.sight_sound = "nour/sight.wav"; + precache_sound (self.idle_sound); + precache_sound (self.pain_sound); + precache_sound (self.sight_sound); + precache_sound ("nour/reveal.wav"); + + // Final death sequence + precache_sound ("nour/death.wav"); + precache_sound ("nour/explode_death.wav"); + precache_sound ("nour/elec_arch1.wav"); + precache_sound ("nour/elec_arch2.wav"); + precache_sound ("nour/implode_death.wav"); + + // Attack A - Wizard style spit + // Attack B - Large explosive ball + precache_sound ("nour/attack1.wav"); + precache_sound ("nour/attack2.wav"); + precache_sound ("nour/explode2.wav"); + precache_sound ("nour/bounce.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bboxtype = BBOX_WIDE; // Wraith Body + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Starts complete + self.pain_flinch = 200; // Strong Wizard level + self.pain_timeout = 2; // Stop constant pain + self.infightextra = 8; // Does not like infighting + self.steptype = FS_FLYING; // No foot sound + self.blockudeath = TRUE; // No player gib sound + self.pain_longanim = FALSE; // cannot be chopped with shadow axe + self.no_liquiddmg = TRUE; // no slime/lava damage + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + if (self.death_dmg < 1) self.death_dmg = DAMAGE_NOUR; + self.poisonous = FALSE; // Cannot be poisonous + self.style = NOUR_PHASE0; // No waves setup + self.deathstring = " was picked apart by the Scragmother\n"; + + // Setup Ammo Resistance + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 1; + self.reflectlightning = TRUE; // Reflect lightning strikes + self.reflectplasma = TRUE; // Reflect plasma projectiles + + // Restore all think functions + self.th_checkattack = NourCheckAttack; + self.th_stand = nour_stand1; + self.th_walk = nour_walk1; + self.th_run = nour_run1; + self.th_slide = nour_slide1; + self.th_melee = nour_atta1; + self.th_missile = nour_attb1; + self.th_jump = nour_attc1; + self.th_pain = nour_pain; + self.th_die = nour_die; + + self.classtype = CT_MONNOUR; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + // Check for boss version of Nouronihar? + if (self.spawnflags & MON_NOUR_BOSS) { + // Reset spawnflag, other values not required + self.spawnflags = MON_NOUR_BOSS; + self.health = self.max_health = MEGADEATH; + self.pain_finished = LARGE_TIMER; + self.takedamage = DAMAGE_NO; // Immune to damage + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[NOUR]\b Missing targetname name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + // Missing spawn trigger + if (self.message == "") { + dprint("\b[NOUR]\b Missing spawn (message) trigger!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + // Missing rise path corner + if (self.message2 == "") { + dprint("\b[NOUR]\b Missing spawn (message2) path corner!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + total_monsters = total_monsters + 1; + self.use = nour_awake; + } + else { + // Regular monster with large HP + if (self.health < 1) self.health = 1200; + // Regular Nour is not 100% resistant + self.resist_cells = 0.75; + monster_start(); + } +}; diff --git a/QC_other/QC_arcane/mon_bossxxchthon.qc b/QC_other/QC_arcane/mon_bossxxchthon.qc new file mode 100644 index 00000000..aa3c2f5e --- /dev/null +++ b/QC_other/QC_arcane/mon_bossxxchthon.qc @@ -0,0 +1,562 @@ +/*============================================================================== +Chthon (Custom Version) +==============================================================================*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +float CHTHON_PHASE1 = 1; // Rising from Lava +float CHTHON_PHASE2 = 2; // Fighting +float CHTHON_PHASE3 = 3; // Frenzy mode +float CHTHON_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() xxchthon_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() xxchthon_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP has reached next boss wave trigger event +//---------------------------------------------------------------------- +float() xxchthon_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + xxchthon_WaveSetupHP(); + self.style = CHTHON_PHASE3; // Frenzy mode + return TRUE; + } + return FALSE; +}; + +//=========================================================================== +// IDLE state - waiting for player +//=========================================================================== +void() xxchthon_idleframe = +{ + // Get the obvious exception(s) done first + if (self.health < 1) return; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 30) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = xxchthon_idleframe; + + // Setup current animation frame + self.frame = $walk1 + self.walkframe; + + // Check for HP trigger event + if (xxchthon_WaveCheck() == TRUE) self.th_jump(); + // Keep checking for players + else if (xxchthon_FindTarget()) self.th_missile(); +}; + +//---------------------------------------------------------------------- +void() xxchthon_idle ={ self.walkframe = 0; xxchthon_idleframe(); }; + +//=========================================================================== +// ATTACK 1 - Constant fireballs +//=========================================================================== +void(vector orgofs) xxchthon_missile = +{ + local vector offang, org, vec, dir, mdest, avel; + local float projlen; + + // No enemy or player dead? + if (!self.enemy) return; + + sound (self, CHAN_WEAPON, "chthon/attack1.wav", 1, ATTN_NORM); + offang = vectoangles (self.enemy.origin - self.origin); + makevectors (offang); + org = self.origin + attack_vector(orgofs); + + // Skill level adjustment + self.attack_speed = self.pos1_x + (skill*self.pos1_y); + + // Lead the missile on hard mode (This formula is not perfect) + // There are plenty of missiles that go in strange directions, + // especially if the player strafes a lot from side to side. + if (skill > SKILL_HARD) { + projlen = vlen(self.enemy.origin - org) / self.attack_speed; + vec = self.enemy.velocity; + vec_z = 0; + mdest = self.enemy.origin + projlen * vec; + } + else mdest = self.enemy.origin; + + dir = normalize (mdest - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_CHTHON, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() xxchthon_attackframe = +{ + // Get the obvious exception(s) done first + if (self.health < 1) return; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 7) xxchthon_missile('100 100 200'); + else if (self.walkframe == 18) xxchthon_missile('100 -100 200'); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 22) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = xxchthon_attackframe; + + // Setup current animation frame + self.frame = $attack1 + self.walkframe; + + // Check for HP trigger event + if (xxchthon_WaveCheck() == TRUE) self.th_jump(); + // Keep checking for players + else { + // Keep checking for player and turning towards them + // Check for any no combat conditions + if (self.enemy.health < 1) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + + // No enemy? back to idle, else keep turning + if (!self.enemy) self.th_stand(); + else ai_face(); + } +}; + +//---------------------------------------------------------------------- +void() xxchthon_attack ={ self.walkframe = 0; xxchthon_attackframe(); }; + +//============================================================================ +// Re-using the original shock animations for end of wave event +//============================================================================ +void() xxchthon_shakeattack = +{ + local vector org, ang, dir, avel; + + // Custom grenade firing speed + self.attack_speed = self.pos3_x; + + // Shoot grenades from top of shub + makevectors(self.angles); + org = self.origin + attack_vector(self.dest2); + + // Randomly shoot grenades in any directions + ang = '0 0 0'; + ang_y = rint(random()*360); + makevectors(ang); + // Use classic grenade angle system, not Z aware + dir = v_forward * self.attack_speed; + dir_z = self.pos3_y; + + // A bit of random spin and fire! + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_CHTHON2); +}; + +//---------------------------------------------------------------------- +void() xxchthon_shakeframe = +{ + // Randomnly fire grenades outward + if (random() < 0.75) xxchthon_shakeattack(); + + // Keep on looping around + self.nextthink = time + 0.1; + self.think = xxchthon_shakeframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 9) { + self.walkframe = 0; + self.count = self.count + 1; + self.inpain = self.inpain + 1; + + // has chthon looped around 3 times? + if (self.count > 1) { + Resist_ChangeType(self, FALSE); + self.style = CHTHON_PHASE2; + // Straight back to throwing fireballs! + self.think = self.th_missile; + } + } + + // Update current frames (2 sets of animations) + if (self.inpain == 0) self.frame = $shocka1 + self.walkframe; + else self.frame = $shockc1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() xxchthon_shake = +{ + // Start roaring and shaking + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + Resist_ChangeType(self, TRUE); + self.walkframe = self.count = self.inpain = 0; + xxchthon_shakeframe(); +}; + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void(entity inflictor, entity attacker, float damage) xxchthon_pain = +{ + + // Check for boss wave trigger events + if (xxchthon_WaveCheck() == TRUE) {self.th_jump(); return;} + self.pain_finished = time + 2 + random()*2; + + // Spawn particle/smoke damage + SpawnProjectileSmoke(inflictor.origin, 200, 50, 150); + if (damage > 30) SpawnProjectileSmoke(inflictor.origin, 200, 50, 250); + // The pain sound not linked to animation, so less useful + if (random() < 0.2 && damage > 30) + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); +}; + +//============================================================================ +// DEATH - Fall down and explode +//============================================================================ +void() xxchthon_lavasplash = +{ + sound (self, CHAN_BODY, "chthon/lavasplash.wav", 1, ATTN_NORM); + if (ext_dppart) { + // Two different types of liquid splash (only DP) + if (self.spawnflags & MON_CHTHON_GREEN) + pointparticles(particleeffectnum("TE_SLIMESPLASH"), self.origin, '0 0 0', 1); + else + pointparticles(particleeffectnum("TE_LAVASPLASH"), self.origin, '0 0 0', 1); + } + else { + // Classic Fitz/QS engine effects (hard coded) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } +}; + +//---------------------------------------------------------------------- +void() xxchthon_explode = +{ + // No more Boss! + entity_hide(self); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(11, 15 + rint(random()*10)); // lava explosions +}; + +//---------------------------------------------------------------------- +void() xxchthon_explosion = +{ + // Pick random location above/center of chthin + self.oldorigin = self.origin + vecrand(0,100,TRUE); + self.oldorigin_z = self.origin_z + 50 + random()*100; + + // Spawn smoke, explosion and lava gib! + SpawnProjectileSmoke(self.oldorigin, 100, 400, 100); + if (random() < 0.5) self.lip = EXPLODE_MED; + else self.lip = EXPLODE_BIG; + SpawnExplosion(self.lip, self.oldorigin, ""); + ThrowGib(11, 1); +}; + +//---------------------------------------------------------------------- +void() xxchthon_death1 = [$death1, xxchthon_death2] {}; +void() xxchthon_death2 = [$death2, xxchthon_death3] {xxchthon_explosion();}; +void() xxchthon_death3 = [$death3, xxchthon_death4] {xxchthon_explosion();}; +void() xxchthon_death4 = [$death4, xxchthon_death5] {xxchthon_explosion();}; +void() xxchthon_death5 = [$death5, xxchthon_death6] {xxchthon_explosion();}; +void() xxchthon_death6 = [$death6, xxchthon_death7] {xxchthon_explosion();}; +void() xxchthon_death7 = [$death7, xxchthon_death8] {xxchthon_explosion();}; +void() xxchthon_death8 = [$death8, xxchthon_death9] {xxchthon_explosion();}; +void() xxchthon_death9 = [$death9, xxchthon_explode] {xxchthon_lavasplash();}; + +//---------------------------------------------------------------------- +void() xxchthon_die = +{ + self.style = CHTHON_PHASE4; // Game Over for Chthon! + self.deadflag = DEAD_DEAD; // the rock finally crashed + self.effects = 0; // Remove effects on death + self.solid = SOLID_NOT; // no longer need to block + self.max_health = MON_GIBEXPLOSION; + + sound (self, CHAN_VOICE, "chthon/death1.wav", 1, ATTN_NORM); + xxchthon_death1 (); +}; + +//============================================================================ +// RISE up from the swirling liquid +//============================================================================ +void() xxchthon_rise1 =[ $rise1, xxchthon_rise2 ] {xxchthon_lavasplash();}; +void() xxchthon_rise2 =[ $rise2, xxchthon_rise3 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM);}; +void() xxchthon_rise3 =[ $rise3, xxchthon_rise4 ] {}; +void() xxchthon_rise4 =[ $rise4, xxchthon_rise5 ] {ai_face();}; +void() xxchthon_rise5 =[ $rise5, xxchthon_rise6 ] {}; +void() xxchthon_rise6 =[ $rise6, xxchthon_rise7 ] {ai_face();}; +void() xxchthon_rise7 =[ $rise7, xxchthon_rise8 ] {}; +void() xxchthon_rise8 =[ $rise8, xxchthon_rise9 ] {ai_face();}; +void() xxchthon_rise9 =[ $rise9, xxchthon_rise10 ] {}; +void() xxchthon_rise10 =[ $rise10, xxchthon_rise11 ] {ai_face();}; +void() xxchthon_rise11 =[ $rise11, xxchthon_rise12 ] {}; +void() xxchthon_rise12 =[ $rise12, xxchthon_rise13 ] {ai_face();}; +void() xxchthon_rise13 =[ $rise13, xxchthon_rise14 ] {}; +void() xxchthon_rise14 =[ $rise14, xxchthon_rise15 ] {ai_face();}; +void() xxchthon_rise15 =[ $rise15, xxchthon_rise16 ] {}; +void() xxchthon_rise16 =[ $rise16, xxchthon_rise17 ] {ai_face();}; +void() xxchthon_rise17 =[ $rise17, xxchthon_attack ] { + self.style = CHTHON_PHASE2; // Start fighting + self.takedamage = DAMAGE_AIM; +}; + +//====================================================================== +// Setup Chthon after trigger event +//====================================================================== +void() xxchthon_awake = +{ + self.use = SUB_Null; // No more triggers + self.style = CHTHON_PHASE1; // Rising from Lava + self.flags = FL_MONSTER; // Reset flag (no user settings) + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.takedamage = DAMAGE_NO; // Still immune to damage + self.yaw_speed = 20; // Average Speed + self.velocity = '0 0 0'; // Make sure stationary + self.pain_longanim = FALSE; // No axe advantage + self.noinfighting = TRUE; // No infighting + + Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + + // Setup boss waves and overall health + if (self.bosswave < 1) self.bosswavetotal = 5; + else self.bosswavetotal = self.bosswave; + + // Always start bosswave at 1 + self.bosswave = 1; + if (self.bosswaveqty < 1) self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + xxchthon_WaveSetupHP(); + + // Restore all think functions + self.th_stand = xxchthon_idle; + self.th_walk = xxchthon_idle; + self.th_run = xxchthon_idle; + self.th_missile = xxchthon_attack; + self.th_jump = xxchthon_shake; + self.th_pain = xxchthon_pain; + self.th_die = xxchthon_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + self.gibhealth = -1000; // Special death sequence + self.enemy = activator; + + // DP particle spark and smoke effect to Chthon + // original idea by Seven, green version added later by me + if (ext_dppart) self.traileffectnum = particleeffectnum(self.dpp_name); + + // Time to rise from lava + xxchthon_rise1 (); +}; + +/*====================================================================== + QUAKED monster_chthon (1 0 0) (-128 -128 -24) (128 128 256) +======================================================================*/ +void() monster_chthon = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_bosschthon.mdl"; + precache_model (self.mdl); + precache_model(MODEL_PROJ_CHTHON1); + + // Final explosion (10 distorted balls of lava/slime) + self.gib1mdl = MODEL_PROJ_CHTHON1; + self.gib1frame = 9; + + // Load up slime version and switch gibs + if (self.spawnflags & MON_CHTHON_GREEN) { + self.skin = self.gib1skin = 2; + precache_model (MODEL_PROJ_SLIME); + self.dpp_name = "TR_BOSSCHTHONGRN"; + self.gibtype = GIBTYPE_POISON; + self.poisonous = TRUE; + } + else { + // Check for new red/fire skin + if (self.spawnflags & MON_CHTHON_RED) { + self.skin = self.gib1skin = 1; + } + precache_model (MODEL_PROJ_LAVA); + self.dpp_name = "TR_BOSSCHTHON"; + self.poisonous = FALSE; + } + + self.idle_sound = "chthon/idle1.wav"; + precache_sound (self.idle_sound); + + // Attack/throw/electric sound + precache_sound ("chthon/attack1.wav"); + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("chthon/bounce.wav"); + + self.pain_sound = "chthon/pain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("chthon/death1.wav"); + + // Rise from lava roar + splash + self.sight_sound = "chthon/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("chthon/lavasplash.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-80 -80 -24'; // has own entity setup + self.bbmaxs = '80 80 256'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.health = self.max_health = MEGADEATH; + self.pain_finished = LARGE_TIMER; + self.no_liquiddmg = TRUE; // no slime/lava damage + self.gibbed = FALSE; // Still in one piece + self.deathstring = " was blown apart by Chthon\n"; + + self.pain_flinch = 400; // Shambler level + self.pain_timeout = 2; // Stop constant pain + + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.takedamage = DAMAGE_NO; // Immune to damage + + // Setup projectile speed (250 + 50*skill) + if (CheckZeroVector(self.pos1)) self.pos1 = '250 50 0'; + // Setup projectile damage (Base + Random, Splash) + if (CheckZeroVector(self.pos2)) self.pos2 = DAMAGE_RLPLAYER; + // Attack 2 - Setup projectile speed, splash damage + if (CheckZeroVector(self.pos3)) self.pos3 = '300 500 40'; + // Attack 2 - Spawn location (offset from origin) + if (CheckZeroVector(self.dest2)) self.dest2 = '0 0 96'; + + self.classtype = CT_MONXXCHTHON; + self.classgroup = CG_BOSS; + self.style = 0; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[CHTHON]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Does not go through monster spawn functions + total_monsters = total_monsters + 1; + self.use = xxchthon_awake; +}; diff --git a/QC_other/QC_arcane/mon_bossxxshub.qc b/QC_other/QC_arcane/mon_bossxxshub.qc new file mode 100644 index 00000000..578f26c1 --- /dev/null +++ b/QC_other/QC_arcane/mon_bossxxshub.qc @@ -0,0 +1,531 @@ +/*============================================================================== +OLD ONE / Shub-Niggurath (ID software Version) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 idle14 idle15 idle16 +$frame idle17 idle18 idle19 idle20 idle21 idle22 idle23 idle24 +$frame idle25 idle26 idle27 idle28 idle29 idle30 idle31 idle32 +$frame idle33 idle34 idle35 idle36 idle37 idle38 idle39 idle40 +$frame idle41 idle42 idle43 idle44 idle45 idle46 + +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 +$frame shake16 shake17 shake18 shake19 shake20 + +float SHUB_PHASE1 = 1; // Waiting for a trigger event +float SHUB_PHASE2 = 2; // Fighting +float SHUB_PHASE3 = 3; // Frenzy mode +float SHUB_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() xxshub_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + + // Finally found something + self.enemy = client; + self.goalentity = self.enemy; + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries (one function to be consistent) +//---------------------------------------------------------------------- +void() xxshub_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP has reached next boss wave trigger event +//---------------------------------------------------------------------- +float() xxshub_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + xxshub_WaveSetupHP(); // Reset trigger/hp + self.style = SHUB_PHASE3; // Frenzy mode + return TRUE; + } + return FALSE; +}; + +//=========================================================================== +// IDLE state - flailing arms (only state really) +//=========================================================================== +void() xxshub_idleframe = +{ + // Get the obvious exception(s) done first + if (self.health < 1) return; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 12) monster_idle_sound(); + else if (self.walkframe == 24) monster_idle_sound(); + else if (self.walkframe == 36) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 45) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = xxshub_idleframe; + + // Setup current animation frame + self.frame = $idle1 + self.walkframe; + + // Check for HP trigger event + if (xxshub_WaveCheck() == TRUE) self.th_missile(); + + // Check for combat event + if (self.style == SHUB_PHASE2) { + // Check for any no combat conditions + if (self.enemy.health < 1) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + + // If no enemy, keep looking + if (!self.enemy) xxshub_FindTarget(); + // Check for attack 1 - Homing Missile + if (self.enemy) self.th_melee(); + } +}; + +//---------------------------------------------------------------------- +void() xxshub_idle ={ self.walkframe = 0; xxshub_idleframe(); }; + +//============================================================================ +// Attack 1 : Fire Shub Homing Missile +//============================================================================ +void() xxshub_attack1 = +{ + // Check sightline to player + if (visblocked(self.enemy)) return; + if (time < self.attack_finished) return; + + SUB_AttackFinished (2 + 2*random()); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "shub/attack1.wav", 1, ATTN_NORM); + + // Skill level adjustment + self.attack_speed = self.pos1_x + (skill*self.pos1_y); + // Spawn from front of Shub + Launch_HomingMissile (self.dest1, '0 0 10', CT_PROJ_SHUB1, self.attack_speed); +}; + +//============================================================================ +// Attack 2 : shake and spam grenades (end of wave event) +//============================================================================ +void() xxshub_shakeattack = +{ + local vector org, dir, ang, avel; + + // Custom grenade firing speed + self.attack_speed = self.pos3_x; + + // Shoot grenades from top of shub + makevectors(self.angles); + org = self.origin + attack_vector(self.dest2); + + // Randomly shoot grenades in any directions + ang = '0 0 0'; + ang_y = rint(random()*360); + makevectors(ang); + dir = v_forward * self.attack_speed; + dir_z = self.pos3_y; + + // Bit of random spin and fire grenade + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_SHUB2); +}; + +//---------------------------------------------------------------------- +void() xxshub_shakeframe = +{ + // Randomnly fire grenades outward + if (random() < 0.5) xxshub_shakeattack(); + + if (self.walkframe == 0) { + sound (self, CHAN_WEAPON, "shub/attack2.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + } + + // Keep on looping around + self.nextthink = time + 0.1; + self.think = xxshub_shakeframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 14) { + self.walkframe = 0; + self.count = self.count + 1; + + // has shub looped around 3 times? + if (self.count > 2) { + // Slight attack pause after the shake + self.attack_finished = time + 2 + 2*random(); + Resist_ChangeType(self, FALSE); + self.style = SHUB_PHASE2; + self.think = self.th_stand; + } + } + + // Update frame and keep on shaking! + else self.frame = $shake1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() xxshub_attack2 = +{ + Resist_ChangeType(self, TRUE); + self.walkframe = self.count = 0; + xxshub_shakeframe(); +}; + +//============================================================================ +// PAIN (ignored, just keeps on firing) +//============================================================================ +void(entity inflictor, entity attacker, float damage) xxshub_pain = +{ + // Shub been hit, wakeup and start attacking + if (self.style == SHUB_PHASE1) {self.use(); return;} + self.pain_finished = time + 2 + random()*2; + + // Check for boss wave trigger events + if (xxshub_WaveCheck() == TRUE) {self.th_missile(); return;} + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + // Spawn particle/smoke damage + SpawnProjectileSmoke(inflictor.origin, 200, 50, 150); + if (damage > 30) SpawnProjectileSmoke(inflictor.origin, 200, 50, 250); + // random pick sound + if (random() < 0.5) + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } +}; + +//=========================================================================== +// FINAL DEATH - shake it baby and explode +//=========================================================================== +void() xxshub_explode = +{ + // No more Boss! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_BIG, self.origin, "shub/explode_death.wav"); + + // Gib explosive fountain!?! + ThrowGib(11, 10 + rint(random()*10)); // large blobs + ThrowGib(4, 5 + rint(random()*3)); // Some flesh bits + ThrowGib(5, 10 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() xxshub_deathframe = +{ + // Throw debris out from top of shub + self.pos3 = vecrand(100,100,TRUE); + self.pos3_z = 128 + random()*128; + SpawnProjectileSmoke(self.origin+self.pos3, 200, 50, 150); + // Random chance of gib + explosion + if (random() < 0.25) + SpawnExplosion(EXPLODE_MED, self.origin+self.pos3, SOUND_REXP3); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 15 && self.count < 3) { + self.walkframe = 0; + self.count = self.count + 1; + } + + if (self.walkframe > 19) xxshub_explode(); + // Update frame and keep on shaking! + else { + self.frame = $shake1 + self.walkframe; + // Keep on looping around + self.nextthink = time + 0.1; + self.think = xxshub_deathframe; + } +}; + +//---------------------------------------------------------------------- +void() xxshub_die = +{ + self.style = SHUB_PHASE4; // Game Over for Shub! + self.deadflag = DEAD_DEAD; // the rock finally crashed + self.effects = 0; // Remove effects on death + self.solid = SOLID_NOT; // no longer need to block + self.max_health = MON_GIBEXPLOSION; + + sound (self, CHAN_VOICE, "shub/death1.wav", 1, ATTN_NORM); + self.walkframe = self.count = 0; + xxshub_deathframe(); +}; + +//---------------------------------------------------------------------- +// Switch Shub into a fighting stance +//---------------------------------------------------------------------- +void() xxshub_wakeup = +{ + // Time to fight! + self.use = SUB_Null; // No more triggers + self.style = SHUB_PHASE2; // Start fighting + + Resist_ChangeType(self, FALSE); // Default resistance + + // Wakeup sound + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + + // Restore pain thresholds and timers + self.pain_flinch = 400; // Shambler level + self.pain_timeout = 2; // Stop constant pain + + // Wait for wakeup sound to finish before combat + self.pain_finished = time + 2 + random()*2; + self.attack_finished = time + 2; + + // Check for player (use activator) + if (activator.flags & FL_CLIENT) self.enemy = activator; +}; + +//---------------------------------------------------------------------- +// Setup Shub after trigger event +//---------------------------------------------------------------------- +void() xxshub_start = +{ + self.use = SUB_Null; // Suppress trigger events + self.style = SHUB_PHASE1; // Waiting for combat trigger + self.flags = FL_MONSTER; // Reset flag (no user settings) + if (self.spawnflags & MON_SHUB_UPSIDE) self.flags = self.flags | FL_FLY; + else self.flags = self.flags | FL_ONGROUND; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.yaw_speed = 0; // No turning speed + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.pain_longanim = FALSE; // No axe advantage + self.takedamage = DAMAGE_AIM; // Can receive damage + self.pain_flinch = 1; // Pain is a start trigger + + self.movespeed = 1; // Shub does not move! + self.noinfighting = TRUE; // No infighting + self.gibhealth = -1000; // Special death sequence + self.pain_finished = self.attack_finished = 0; + + Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + // Allow for a damage trigger (spawnflag option only) + if (!(self.spawnflags & MON_SHUB_DMGTRIG)) + Resist_ChangeType(self, TRUE); + + // Setup boss waves and overall health + if (self.bosswave < 1) self.bosswavetotal = 5; + else self.bosswavetotal = self.bosswave; + + // Always start bosswave at 1 + self.bosswave = 1; + if (self.bosswaveqty < 1) self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + xxshub_WaveSetupHP(); + + // Restore all think functions + self.th_stand = xxshub_idle; + self.th_walk = xxshub_idle; + self.th_run = xxshub_idle; + self.th_melee = xxshub_attack1; + self.th_missile = xxshub_attack2; + self.th_pain = xxshub_pain; + self.th_die = xxshub_die; + + // Wait for trigger to start attacking + self.use = xxshub_wakeup; + self.th_stand(); +}; + +/*============================================================================ + QUAKED monster_shub (1 0 0) (-128 -128 -24) (128 128 512) +============================================================================*/ +void() monster_shub = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/oldone.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_SHUB1); // Large Homing Missile + precache_model (MODEL_PROJ_SHUB2); // Large blob of blood + + // Final explosionm and grenades for attack 2 + self.gib1mdl = MODEL_PROJ_SHUB2; + self.gib1frame = 9; + + self.idle_sound = "shub/idle1.wav"; + self.idle_sound2 = "shub/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Att1 : Homing missile + // Att2 : Grenade spam + precache_sound ("shub/attack1.wav"); + precache_sound ("shub/attack2.wav"); + precache_sound ("shub/bounce.wav"); + + self.pain_sound = "shub/pain1.wav"; + self.pain_sound2 = "shub/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("shub/death1.wav"); + precache_sound ("shub/explode_death.wav"); + + self.sight_sound = "shub/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-96 -96 -24'; // has own entity setup + self.bbmaxs = '96 96 192'; + self.bboxtype = BBOX_CUSTOM; // Custom BBox size + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.health = self.max_health = MEGADEATH; + self.pain_finished = LARGE_TIMER; + self.no_liquiddmg = TRUE; // no slime/lava damage + self.idlemoreoften = TRUE; // More frequent idle sounds + self.gibbed = FALSE; // Still in one piece + self.poisonous = FALSE; // Cannot be poisonous + self.deathstring = " became one with Shub-Niggurath\n"; + + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.takedamage = DAMAGE_NO; // Immune to damage + + // Attack 1 - Setup projectile speed (200 + 20*skill) + if (CheckZeroVector(self.pos1)) self.pos1 = '200 20 0'; + // Attack 1 - Setup projectile damage (Base + Random, Splash) + if (CheckZeroVector(self.pos2)) self.pos2 = '0 0 40'; + // Attack 2 - Setup projectile speed, splash damage + if (CheckZeroVector(self.pos3)) self.pos3 = '300 500 40'; + + // Attack 1 - Spawn location (offset from origin) + if (CheckZeroVector(self.dest1)) self.dest1 = '0 0 128'; + // Attack 2 - Spawn location (offset from origin) + if (CheckZeroVector(self.dest2)) self.dest2 = '0 0 128'; + + if (self.spawnflags & MON_SHUB_UPSIDE) { + self.bbmins = '-96 -96 -192'; // up side down version + self.bbmaxs = '96 96 24'; + } + + self.classtype = CT_MONXXSHUB; + self.classgroup = CG_BOSS; + self.style = 0; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[SHUB]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Does not go through monster spawn functions + total_monsters = total_monsters + 1; + + // Default is no spawn delay, wait for trigger + if (!(self.spawnflags & MON_SPAWN_DELAY)) { + self.nextthink = time + 0.1 + random()*0.4; + self.think = xxshub_start; + } + else self.use = xxshub_start; +}; + +/*============================================================================ + QUAKED monster_shubupsd (1 0 0) (-128 -128 -24) (128 128 512) +============================================================================*/ +void() monster_shubupsd = +{ + if (deathmatch) { remove(self); return; } + + // Attack 2 - Setup projectile speed, splash damage + if (CheckZeroVector(self.pos3)) self.pos3 = '600 0 40'; + self.angles_x = 180; + self.angles_y = anglemod(self.angles_y + 180); + self.spawnflags = self.spawnflags | MON_SHUB_UPSIDE; + + monster_shub(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_centurion.qc b/QC_other/QC_arcane/mon_centurion.qc new file mode 100644 index 00000000..5bd7e3f8 --- /dev/null +++ b/QC_other/QC_arcane/mon_centurion.qc @@ -0,0 +1,328 @@ +/*============================================================================= +CENTURION - Originally from Rubicon2 by John Fitzgibbons +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 + +void() centurionhover = +{ + if (self.waitmin < time) { + self.waitmin = time + 4 + random()*4; + sound(self, CHAN_ITEM, "enforcer/cent_hover.wav", 1, ATTN_IDLE); + } +}; + +//============================================================================ +void() cent_stand1 =[ $stand1, cent_stand2 ] { + centurionhover();monster_idle_sound();ai_stand();}; +void() cent_stand2 =[ $stand2, cent_stand3 ] {ai_stand();}; +void() cent_stand3 =[ $stand3, cent_stand4 ] {ai_stand();}; +void() cent_stand4 =[ $stand4, cent_stand5 ] {ai_stand();}; +void() cent_stand5 =[ $stand5, cent_stand6 ] {ai_stand();}; +void() cent_stand6 =[ $stand6, cent_stand7 ] {ai_stand();}; +void() cent_stand7 =[ $stand7, cent_stand8 ] {ai_stand();}; +void() cent_stand8 =[ $stand8, cent_stand1 ] {ai_stand();}; + +//============================================================================ +void() cent_walk1 =[ $stand1, cent_walk2 ] { + centurionhover();monster_idle_sound();ai_walk(4);}; +void() cent_walk2 =[ $stand2, cent_walk3 ] {ai_walk(4);}; +void() cent_walk3 =[ $stand3, cent_walk4 ] {ai_walk(4);}; +void() cent_walk4 =[ $stand4, cent_walk5 ] {ai_walk(4);}; +void() cent_walk5 =[ $stand5, cent_walk6 ] {ai_walk(4);}; +void() cent_walk6 =[ $stand6, cent_walk7 ] {ai_walk(4);}; +void() cent_walk7 =[ $stand7, cent_walk8 ] {ai_walk(4);}; +void() cent_walk8 =[ $stand8, cent_walk1 ] {ai_walk(4);}; + +//============================================================================ +void() cent_run1 =[ $stand1, cent_run2 ] { + centurionhover();monster_idle_sound(); + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(8);}; +void() cent_run2 =[ $stand2, cent_run3 ] {ai_run(8);}; +void() cent_run3 =[ $stand3, cent_run4 ] {ai_run(8);}; +void() cent_run4 =[ $stand4, cent_run5 ] {ai_run(8);}; +void() cent_run5 =[ $stand5, cent_run6 ] {ai_run(8);}; +void() cent_run6 =[ $stand6, cent_run7 ] {ai_run(8);}; +void() cent_run7 =[ $stand7, cent_run8 ] {ai_run(8);}; +void() cent_run8 =[ $stand8, cent_run1 ] {ai_run(8);}; + +//============================================================================ +void() cent_fire = +{ + local vector org, vec; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, SOUND_PLASMA_FIRE, 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + // Fire plasma projectile at players feet + vec = SUB_orgEnemyTarget() - '0 0 12'; + vec = normalize(vec - self.origin); + + launch_plasma(org, vec, CT_MONCENTURION, SPEED_PLASMA); +}; + +//---------------------------------------------------------------------- +void() cent_atk1 =[ $attack1, cent_atk2 ] { + sound (self, CHAN_WEAPON, "enforcer/elim_pg_load.wav", 1, ATTN_NORM);}; +void() cent_atk2 =[ $attack2, cent_atk3 ] {ai_face();}; +void() cent_atk3 =[ $attack3, cent_atk4 ] {ai_face();}; +void() cent_atk4 =[ $attack4, cent_atk5 ] {ai_face();}; +void() cent_atk5 =[ $attack5, cent_atk6 ] {ai_face();}; +void() cent_atk6 =[ $attack6, cent_atk7 ] {ai_face(); + if (self.health > 1) cent_fire();}; +void() cent_atk7 =[ $attack7, cent_atk8 ] {}; +void() cent_atk8 =[ $attack8, cent_atk9 ] {}; +void() cent_atk9 =[ $attack5, cent_atk10 ] {ai_face();}; +void() cent_atk10 =[ $attack6, cent_atk11 ] {ai_face(); + if (self.health > 1) cent_fire();}; +void() cent_atk11 =[ $attack7, cent_atk12 ] {}; +void() cent_atk12 =[ $attack8, cent_atk13 ] {}; +void() cent_atk13 =[ $attack9, cent_atk14 ] {ai_face();}; +void() cent_atk14 =[ $attack10, cent_run1 ] {ai_face();SUB_CheckRefire (cent_atk1);}; + +//============================================================================ +void() cent_paina1 =[ $paina1, cent_paina2 ] {}; +void() cent_paina2 =[ $paina2, cent_paina3 ] {}; +void() cent_paina3 =[ $paina3, cent_paina4 ] {}; +void() cent_paina4 =[ $paina4, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void() cent_painb1 =[ $painb1, cent_painb2 ] {}; +void() cent_painb2 =[ $painb2, cent_painb3 ] {}; +void() cent_painb3 =[ $painb3, cent_painb4 ] {}; +void() cent_painb4 =[ $painb4, cent_painb5 ] {}; +void() cent_painb5 =[ $painb5, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void() cent_painc1 =[ $painc1, cent_painc2 ] {}; +void() cent_painc2 =[ $painc2, cent_painc3 ] {}; +void() cent_painc3 =[ $painc3, cent_painc4 ] {}; +void() cent_painc4 =[ $painc4, cent_painc5 ] {}; +void() cent_painc5 =[ $painc5, cent_painc6 ] {}; +void() cent_painc6 =[ $painc6, cent_painc7 ] {}; +void() cent_painc7 =[ $painc7, cent_painc8 ] {}; +void() cent_painc8 =[ $painc8, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void() cent_paind1 =[ $paind1, cent_paind2 ] {}; +void() cent_paind2 =[ $paind2, cent_paind3 ] {}; +void() cent_paind3 =[ $paind3, cent_paind4 ] {}; +void() cent_paind4 =[ $paind4, cent_paind5 ] {ai_painforward(2);}; +void() cent_paind5 =[ $paind5, cent_paind6 ] {ai_painforward(1);}; +void() cent_paind6 =[ $paind6, cent_paind7 ] {}; +void() cent_paind7 =[ $paind7, cent_paind8 ] {}; +void() cent_paind8 =[ $paind8, cent_paind9 ] {}; +void() cent_paind9 =[ $paind9, cent_paind10 ] {}; +void() cent_paind10=[ $paind10, cent_paind11 ] {}; +void() cent_paind11=[ $paind11, cent_paind12 ] {ai_painforward(1);}; +void() cent_paind12=[ $paind12, cent_paind13 ] {ai_painforward(1);}; +void() cent_paind13=[ $paind13, cent_paind14 ] {ai_painforward(1);}; +void() cent_paind14=[ $paind14, cent_paind15 ] {}; +void() cent_paind15=[ $paind15, cent_paind16 ] {}; +void() cent_paind16=[ $paind16, cent_paind17 ] {ai_pain(1);}; +void() cent_paind17=[ $paind17, cent_paind18 ] {ai_pain(1);}; +void() cent_paind18=[ $paind18, cent_paind19 ] {}; +void() cent_paind19=[ $paind19, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) cent_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random (); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + // Not using long pain animation (need to be agile) + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (self.lip < 0.3) cent_paina1 (); + else if (self.lip < 0.6) cent_painb1 (); + else cent_painc1 (); + } + } +}; + +//============================================================================ +// Every death frame spawn some smoke and detect impact! +void() cent_crash = +{ + if (self.state) { + // Spawn projectile smoke trails or smoke sprites + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 150, 50, 150); + else { + self.oldorigin = self.origin + vecrand(0,32,TRUE); + SpawnExplosion(EXPLODE_BURST_SMOKE, self.oldorigin, ""); + } + // Once on ground, thud sound and no more smoke + if (self.flags & FL_ONGROUND) { + sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + self.state = FALSE; + } + } +}; + +//---------------------------------------------------------------------- +void() cent_die1 =[ $death1, cent_die2 ] {cent_crash();}; +void() cent_die2 =[ $death2, cent_die3 ] {monster_check_gib();cent_crash();}; +void() cent_die3 =[ $death3, cent_die4 ] {monster_check_gib(); +self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();cent_crash();}; +void() cent_die4 =[ $death4, cent_die5 ] {cent_crash();}; +void() cent_die5 =[ $death5, cent_die6 ] {cent_crash();}; +void() cent_die6 =[ $death6, cent_die7 ] {cent_crash();}; +void() cent_die7 =[ $death7, cent_die8 ] {cent_crash();}; +void() cent_die8 =[ $death8, cent_die9 ] {cent_crash();}; +void() cent_die9 =[ $death9, cent_die10 ] {cent_crash();}; +void() cent_die10 =[ $death10, cent_die11 ] {cent_crash();}; +void() cent_die11 =[ $death11, cent_die12 ] {cent_crash();}; +void() cent_die12 =[ $death12, cent_die13 ] {cent_crash();}; +void() cent_die13 =[ $death13, cent_die14 ] {monster_death_postcheck();cent_crash();}; +void() cent_die14 =[ $death14, cent_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() cent_fdie1 =[ $fdeath1, cent_fdie2 ] {cent_crash();}; +void() cent_fdie2 =[ $fdeath2, cent_fdie3 ] {monster_check_gib();cent_crash();}; +void() cent_fdie3 =[ $fdeath3, cent_fdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();cent_crash();}; +void() cent_fdie4 =[ $fdeath4, cent_fdie5 ] {cent_crash();}; +void() cent_fdie5 =[ $fdeath5, cent_fdie6 ] {cent_crash();}; +void() cent_fdie6 =[ $fdeath6, cent_fdie7 ] {cent_crash();}; +void() cent_fdie7 =[ $fdeath7, cent_fdie8 ] {cent_crash();}; +void() cent_fdie8 =[ $fdeath8, cent_fdie9 ] {cent_crash();}; +void() cent_fdie9 =[ $fdeath9, cent_fdie10 ] {cent_crash();}; +void() cent_fdie10 =[ $fdeath10, cent_fdie11 ] {monster_death_postcheck();cent_crash();}; +void() cent_fdie11 =[ $fdeath11, cent_fdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() cent_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Kill hoverboard sound + sound(self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_IDLE); + + // regular death + if (!self.gibbed) { + self.state = TRUE; + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + // Make sure Centurion falls to the ground (like wizards) + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + // Spawn a big sprite explosion + sound + SpawnExplosion(EXPLODE_BIG, self.origin, SOUND_REXP3); + if (random() > 0.5) cent_die1 (); + else cent_fdie1 (); + } +}; + +/*====================================================================== + QUAKED monster_centurion (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_centurion = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_centurion.mdl"; + self.headmdl = "progs/h_centurion.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_PLASMA); + + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/elim_pg_load.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + // Originally from rubicon2 (re-processed) + precache_sound ("enforcer/cent_hover.wav"); + precache_sound (GIB_SOUND_WOOD); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_PLASMAGRN); + } + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = -35; + self.gibbed = FALSE; + self.yaw_speed = 35; // Can turn really fast + self.pain_flinch = 60; // high pain tolerance + self.pain_longanim = FALSE; // Not using D pain, too slow + self.steptype = FS_FLYING; // Silent feet + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + if (!self.exactskin) self.randomskin = 6; + self.ammo_cells = rint(random()*3); + self.attack_offset = '28 8.5 24'; + self.deathstring = " was vaporized by a Centurion\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = CenturionCheckAttack; + self.th_stand = cent_stand1; + self.th_walk = cent_walk1; + self.th_run = cent_run1; + self.th_pain = cent_pain; + self.th_die = cent_die; + self.th_missile = cent_atk1; + + self.classtype = CT_MONCENTURION; + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEFLY; + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_dcrossbow.qc b/QC_other/QC_arcane/mon_dcrossbow.qc new file mode 100644 index 00000000..a07d9e1b --- /dev/null +++ b/QC_other/QC_arcane/mon_dcrossbow.qc @@ -0,0 +1,727 @@ +/*============================================================================== +CROSSBOW KNIGHT (low health, good range attack) +==============================================================================*/ +$cd id1/models/dcrossbow +$origin 0 0 24 +$base base +$skin skin + +// (001 - 010) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 + +// (011 - 032) Stand idle - Look left and right checking for the player +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 standA13 standA14 standA15 standA16 +$frame standA17 standA18 standA19 standA20 standA21 standA22 + +// (033 - 052) Stand idle - lift crossbow up and look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 + +// (053 - 082) Stand idle - check out crossbow up close +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 standD21 standD22 standD23 standD24 +$frame standD25 standD26 standD27 standD28 standD29 standD30 + +// (083 - 103) Stand idle - Lower crossbow and scratch back +$frame standE1 standE2 standE3 standE4 standE5 standE6 standE7 standE8 +$frame standE9 standE10 standE11 standE12 standE13 standE14 standE15 standE16 +$frame standE17 standE18 standE19 standE20 standE21 + +// (104 - 114) Stand idle - Dust off the crossbow +$frame standF1 standF2 standF3 standF4 standF5 standF6 standF7 standF8 +$frame standF9 standF10 standF11 + +// (115 - 128) Default walk - strong walk with crossbow infront +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (129 - 134) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (135 - 146) Slice (stationary one hand slashing attack) (file=SWING) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 + +// (147 - 161) Smash (chop overhead to ground) (file=CHOP) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (162 - 168) Turret ready (brings crossbow up to shoulder height) +$frame tready1 tready2 tready3 tready4 tready5 tready6 tready7 + +// (169 - 174) Turret hold (keeps crossbow up high) +$frame thold1 thold2 thold3 thold4 thold5 thold6 + +// (175 - 193) Turret fire (fires crossbow and reload) (19 frames now) +// Removed - 4,6,8,10, 17,19,21,23, 25,27,29,31 +$frame tfire1 tfire2 tfire3 tfire5 tfire7 +$frame tfire9 tfire11 tfire12 tfire13 tfire14 tfire15 tfire16 +$frame tfire18 tfire20 tfire22 tfire24 +$frame tfire26 tfire28 tfire30 + +// (194 - 201) Turret stop (lower crossbow to relaxed position) +$frame tstop1 tstop2 tstop3 tstop4 tstop5 tstop6 tstop7 tstop8 + +// (202 - 209) Turret slide (strafe side to side movement, crossbow up high) +$frame tslide1 tslide2 tslide3 tslide4 tslide5 tslide6 tslide7 tslide8 + +// Pain animations A = Slow (210 - 214), D = Stagger (215 - 225) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (226 - 236) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 + +// (237 - 256) Death backwards with cool crossbow wobble +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 deathb15 deathb16 +$frame deathb17 deathb18 deathb19 deathb20 + +void() dcrossbow_hold1; +void() dcrossbow_slide1; +void() dcrossbow_checkmelee; +void() dcrossbow_crossbow_sound; +float CROSS_DOWN = 1; +float CROSS_UP = 2; +float CROSS_TIMEOUT = 1; + +//=========================================================================== +void() dcrossbow_standA1 =[ $standA1, dcrossbow_standA2 ] {ai_stand();}; +void() dcrossbow_standA2 =[ $standA2, dcrossbow_standA3 ] {ai_stand();}; +void() dcrossbow_standA3 =[ $standA3, dcrossbow_standA4 ] {ai_stand();}; +void() dcrossbow_standA4 =[ $standA4, dcrossbow_standA5 ] {ai_stand();}; +void() dcrossbow_standA5 =[ $standA5, dcrossbow_standA6 ] {ai_stand();}; +void() dcrossbow_standA6 =[ $standA6, dcrossbow_standA7 ] {ai_stand();}; +void() dcrossbow_standA7 =[ $standA7, dcrossbow_standA8 ] {ai_stand();}; +void() dcrossbow_standA8 =[ $standA8, dcrossbow_standA9 ] {ai_stand();}; +void() dcrossbow_standA9 =[ $standA9, dcrossbow_standA10 ] {ai_stand();}; +void() dcrossbow_standA10 =[ $standA10, dcrossbow_standA11 ] {ai_stand();}; +void() dcrossbow_standA11 =[ $standA11, dcrossbow_standA12 ] {ai_stand();}; +void() dcrossbow_standA12 =[ $standA12, dcrossbow_standA13 ] {ai_stand();}; +void() dcrossbow_standA13 =[ $standA13, dcrossbow_standA14 ] {ai_stand();}; +void() dcrossbow_standA14 =[ $standA14, dcrossbow_standA15 ] {ai_stand();}; +void() dcrossbow_standA15 =[ $standA15, dcrossbow_standA16 ] {ai_stand();}; +void() dcrossbow_standA16 =[ $standA16, dcrossbow_standA17 ] {ai_stand();}; +void() dcrossbow_standA17 =[ $standA17, dcrossbow_standA18 ] {ai_stand();}; +void() dcrossbow_standA18 =[ $standA18, dcrossbow_standA19 ] {ai_stand();}; +void() dcrossbow_standA19 =[ $standA19, dcrossbow_standA20 ] {ai_stand();}; +void() dcrossbow_standA20 =[ $standA20, dcrossbow_standA21 ] {ai_stand();}; +void() dcrossbow_standA21 =[ $standA21, dcrossbow_standA22 ] {ai_stand();}; +void() dcrossbow_standA22 =[ $standA22, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standB1 =[ $standB1, dcrossbow_standB2 ] {ai_stand();}; +void() dcrossbow_standB2 =[ $standB2, dcrossbow_standB3 ] {ai_stand();}; +void() dcrossbow_standB3 =[ $standB3, dcrossbow_standB4 ] {ai_stand();}; +void() dcrossbow_standB4 =[ $standB4, dcrossbow_standB5 ] {ai_stand();}; +void() dcrossbow_standB5 =[ $standB5, dcrossbow_standB6 ] {ai_stand();}; +void() dcrossbow_standB6 =[ $standB6, dcrossbow_standB7 ] {ai_stand();}; +void() dcrossbow_standB7 =[ $standB7, dcrossbow_standB8 ] {ai_stand();}; +void() dcrossbow_standB8 =[ $standB8, dcrossbow_standB9 ] {ai_stand();}; +void() dcrossbow_standB9 =[ $standB9, dcrossbow_standB10 ] {ai_stand();}; +void() dcrossbow_standB10 =[ $standB10, dcrossbow_standB11 ] {ai_stand();}; +void() dcrossbow_standB11 =[ $standB11, dcrossbow_standB12 ] {ai_stand();}; +void() dcrossbow_standB12 =[ $standB12, dcrossbow_standB13 ] {ai_stand();}; +void() dcrossbow_standB13 =[ $standB13, dcrossbow_standB14 ] {ai_stand();}; +void() dcrossbow_standB14 =[ $standB14, dcrossbow_standB15 ] {ai_stand();}; +void() dcrossbow_standB15 =[ $standB15, dcrossbow_standB16 ] {ai_stand();}; +void() dcrossbow_standB16 =[ $standB16, dcrossbow_standB17 ] {ai_stand();}; +void() dcrossbow_standB17 =[ $standB17, dcrossbow_standB18 ] {ai_stand();}; +void() dcrossbow_standB18 =[ $standB18, dcrossbow_standB19 ] {ai_stand();}; +void() dcrossbow_standB19 =[ $standB19, dcrossbow_standB20 ] {ai_stand();}; +void() dcrossbow_standB20 =[ $standB20, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standC1 =[ $tready1, dcrossbow_standC2 ] {ai_stand();}; +void() dcrossbow_standC2 =[ $tready2, dcrossbow_standC3 ] {ai_stand();}; +void() dcrossbow_standC3 =[ $tready3, dcrossbow_standC4 ] {ai_stand();}; +void() dcrossbow_standC4 =[ $tready4, dcrossbow_standC5 ] {ai_stand();}; +void() dcrossbow_standC5 =[ $tready5, dcrossbow_standC6 ] {ai_stand();}; +void() dcrossbow_standC6 =[ $tready6, dcrossbow_standC7 ] {ai_stand();}; +void() dcrossbow_standC7 =[ $tready7, dcrossbow_standC8 ] {ai_stand();}; +void() dcrossbow_standC8 =[ $thold1, dcrossbow_standC9 ] {ai_stand();}; +void() dcrossbow_standC9 =[ $thold2, dcrossbow_standC10 ] {ai_stand();}; +void() dcrossbow_standC10 =[ $thold3, dcrossbow_standC11 ] {ai_stand();}; +void() dcrossbow_standC11 =[ $thold4, dcrossbow_standC12 ] {ai_stand();}; +void() dcrossbow_standC12 =[ $thold5, dcrossbow_standC13 ] {ai_stand();}; +void() dcrossbow_standC13 =[ $thold6, dcrossbow_standC14 ] {ai_stand();}; +void() dcrossbow_standC14 =[ $tstop1, dcrossbow_standC15 ] {ai_stand();}; +void() dcrossbow_standC15 =[ $tstop2, dcrossbow_standC16 ] {ai_stand();}; +void() dcrossbow_standC16 =[ $tstop3, dcrossbow_standC17 ] {ai_stand();}; +void() dcrossbow_standC17 =[ $tstop4, dcrossbow_standC18 ] {ai_stand();}; +void() dcrossbow_standC18 =[ $tstop5, dcrossbow_standC19 ] {ai_stand();}; +void() dcrossbow_standC19 =[ $tstop6, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standD1 =[ $standD1, dcrossbow_standD2 ] {ai_stand();}; +void() dcrossbow_standD2 =[ $standD2, dcrossbow_standD3 ] {ai_stand();}; +void() dcrossbow_standD3 =[ $standD3, dcrossbow_standD4 ] {ai_stand();}; +void() dcrossbow_standD4 =[ $standD4, dcrossbow_standD5 ] {ai_stand();}; +void() dcrossbow_standD5 =[ $standD5, dcrossbow_standD6 ] {ai_stand();}; +void() dcrossbow_standD6 =[ $standD6, dcrossbow_standD7 ] {ai_stand();}; +void() dcrossbow_standD7 =[ $standD7, dcrossbow_standD8 ] {ai_stand();}; +void() dcrossbow_standD8 =[ $standD8, dcrossbow_standD9 ] {ai_stand();}; +void() dcrossbow_standD9 =[ $standD9, dcrossbow_standD10 ] {ai_stand();}; +void() dcrossbow_standD10 =[ $standD10, dcrossbow_standD11 ] {ai_stand();}; +void() dcrossbow_standD11 =[ $standD11, dcrossbow_standD12 ] {ai_stand();}; +void() dcrossbow_standD12 =[ $standD12, dcrossbow_standD13 ] {ai_stand();}; +void() dcrossbow_standD13 =[ $standD13, dcrossbow_standD14 ] {ai_stand();}; +void() dcrossbow_standD14 =[ $standD14, dcrossbow_standD15 ] {ai_stand();}; +void() dcrossbow_standD15 =[ $standD15, dcrossbow_standD16 ] {ai_stand();}; +void() dcrossbow_standD16 =[ $standD16, dcrossbow_standD17 ] {ai_stand();}; +void() dcrossbow_standD17 =[ $standD17, dcrossbow_standD18 ] {ai_stand();}; +void() dcrossbow_standD18 =[ $standD18, dcrossbow_standD19 ] {ai_stand();}; +void() dcrossbow_standD19 =[ $standD19, dcrossbow_standD20 ] {ai_stand();}; +void() dcrossbow_standD20 =[ $standD20, dcrossbow_standD21 ] {ai_stand();}; +void() dcrossbow_standD21 =[ $standD21, dcrossbow_standD22 ] {ai_stand();}; +void() dcrossbow_standD22 =[ $standD22, dcrossbow_standD23 ] {ai_stand();}; +void() dcrossbow_standD23 =[ $standD23, dcrossbow_standD24 ] {ai_stand();}; +void() dcrossbow_standD24 =[ $standD24, dcrossbow_standD25 ] {ai_stand();}; +void() dcrossbow_standD25 =[ $standD25, dcrossbow_standD26 ] {ai_stand();}; +void() dcrossbow_standD26 =[ $standD26, dcrossbow_standD27 ] {ai_stand();}; +void() dcrossbow_standD27 =[ $standD27, dcrossbow_standD28 ] {ai_stand();}; +void() dcrossbow_standD28 =[ $standD28, dcrossbow_standD29 ] {ai_stand();}; +void() dcrossbow_standD29 =[ $standD29, dcrossbow_standD30 ] {ai_stand();}; +void() dcrossbow_standD30 =[ $standD30, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standE1 =[ $standE1, dcrossbow_standE2 ] {ai_stand();}; +void() dcrossbow_standE2 =[ $standE2, dcrossbow_standE3 ] {ai_stand();}; +void() dcrossbow_standE3 =[ $standE3, dcrossbow_standE4 ] {ai_stand();}; +void() dcrossbow_standE4 =[ $standE4, dcrossbow_standE5 ] {ai_stand();}; +void() dcrossbow_standE5 =[ $standE5, dcrossbow_standE6 ] {ai_stand();}; +void() dcrossbow_standE6 =[ $standE6, dcrossbow_standE7 ] {ai_stand();}; +void() dcrossbow_standE7 =[ $standE7, dcrossbow_standE8 ] {ai_stand();}; +void() dcrossbow_standE8 =[ $standE8, dcrossbow_standE9 ] {ai_stand();}; +void() dcrossbow_standE9 =[ $standE9, dcrossbow_standE10 ] {ai_stand();}; +void() dcrossbow_standE10 =[ $standE10, dcrossbow_standE11 ] {ai_stand();}; +void() dcrossbow_standE11 =[ $standE11, dcrossbow_standE12 ] {ai_stand();}; +void() dcrossbow_standE12 =[ $standE12, dcrossbow_standE13 ] {ai_stand();}; +void() dcrossbow_standE13 =[ $standE13, dcrossbow_standE14 ] {ai_stand();}; +void() dcrossbow_standE14 =[ $standE14, dcrossbow_standE15 ] {ai_stand();}; +void() dcrossbow_standE15 =[ $standE15, dcrossbow_standE16 ] {ai_stand();}; +void() dcrossbow_standE16 =[ $standE16, dcrossbow_standE17 ] {ai_stand();}; +void() dcrossbow_standE17 =[ $standE17, dcrossbow_standE18 ] {ai_stand();}; +void() dcrossbow_standE18 =[ $standE18, dcrossbow_standE19 ] {ai_stand();}; +void() dcrossbow_standE19 =[ $standE19, dcrossbow_standE20 ] {ai_stand();}; +void() dcrossbow_standE20 =[ $standE20, dcrossbow_standE21 ] {ai_stand();}; +void() dcrossbow_standE21 =[ $standE21, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standF1 =[ $standF1, dcrossbow_standF2 ] {ai_stand();}; +void() dcrossbow_standF2 =[ $standF2, dcrossbow_standF3 ] {ai_stand();}; +void() dcrossbow_standF3 =[ $standF3, dcrossbow_standF4 ] {ai_stand();}; +void() dcrossbow_standF4 =[ $standF4, dcrossbow_standF5 ] {ai_stand();}; +void() dcrossbow_standF5 =[ $standF5, dcrossbow_standF6 ] {ai_stand();}; +void() dcrossbow_standF6 =[ $standF6, dcrossbow_standF7 ] {ai_stand();}; +void() dcrossbow_standF7 =[ $standF7, dcrossbow_standF8 ] {ai_stand();}; +void() dcrossbow_standF8 =[ $standF8, dcrossbow_standF9 ] {ai_stand();}; +void() dcrossbow_standF9 =[ $standF9, dcrossbow_standF10 ] {ai_stand();}; +void() dcrossbow_standF10 =[ $standF10, dcrossbow_standF11 ] {ai_stand();}; +void() dcrossbow_standF11 =[ $standF11, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_stand1 =[ $stand1, dcrossbow_stand2 ] {monster_idle_sound();ai_stand();}; +void() dcrossbow_stand2 =[ $stand2, dcrossbow_stand3 ] {ai_stand();}; +void() dcrossbow_stand3 =[ $stand3, dcrossbow_stand4 ] {ai_stand();}; +void() dcrossbow_stand4 =[ $stand4, dcrossbow_stand5 ] {ai_stand();}; +void() dcrossbow_stand5 =[ $stand5, dcrossbow_stand6 ] {ai_stand();}; +void() dcrossbow_stand6 =[ $stand6, dcrossbow_stand7 ] {ai_stand();}; +void() dcrossbow_stand7 =[ $stand7, dcrossbow_stand8 ] {ai_stand();}; +void() dcrossbow_stand8 =[ $stand8, dcrossbow_stand9 ] {ai_stand();}; +void() dcrossbow_stand9 =[ $stand9, dcrossbow_stand10 ] {ai_stand();}; +void() dcrossbow_stand10 =[ $stand10, dcrossbow_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*6);} + self.lip = self.lefty; + if (self.lip < 1) self.think = dcrossbow_standE1; // Scratch back + else if (self.lip < 2) self.think = dcrossbow_standD1; // Look at weapon + else if (self.lip < 3) self.think = dcrossbow_standC1; // Ready, steady, hold! + else if (self.lip < 4) self.think = dcrossbow_standF1; // Dust off crossbow + else if (self.lip < 5) self.think = dcrossbow_standA1; // Look around + else self.think = dcrossbow_standB1; // Hold crossbow up + } + ai_stand(); +}; + +//=========================================================================== +void() dcrossbow_walk1 =[ $walk1, dcrossbow_walk2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_walk(2);}; +void() dcrossbow_walk2 =[ $walk2, dcrossbow_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dcrossbow_walk3 =[ $walk3, dcrossbow_walk4 ] {ai_walk(5);}; +void() dcrossbow_walk4 =[ $walk4, dcrossbow_walk5 ] {ai_walk(4);}; +void() dcrossbow_walk5 =[ $walk5, dcrossbow_walk6 ] {ai_walk(4);}; +void() dcrossbow_walk6 =[ $walk6, dcrossbow_walk7 ] {ai_walk(2);}; +void() dcrossbow_walk7 =[ $walk7, dcrossbow_walk8 ] {ai_walk(2);}; +void() dcrossbow_walk8 =[ $walk8, dcrossbow_walk9 ] {ai_walk(3); monster_footstep(FALSE);}; +void() dcrossbow_walk9 =[ $walk9, dcrossbow_walk10] {ai_walk(3);}; +void() dcrossbow_walk10 =[ $walk10, dcrossbow_walk11] {ai_walk(4);}; +void() dcrossbow_walk11 =[ $walk11, dcrossbow_walk12 ] {ai_walk(3);}; +void() dcrossbow_walk12 =[ $walk12, dcrossbow_walk13 ] {ai_walk(4);}; +void() dcrossbow_walk13 =[ $walk13, dcrossbow_walk14 ] {ai_walk(6);}; +void() dcrossbow_walk14 =[ $walk14, dcrossbow_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// 6 frames instead of 8 frames (skipping 3rd/7th timing of original) + +void() dcrossbow_run1 =[ $run1, dcrossbow_run2 ] { monster_idle_sound(); + self.idlebusy = FALSE; ai_run (16);}; +void() dcrossbow_run2 =[ $run2, dcrossbow_run3 ] {ai_run(20);}; +void() dcrossbow_run3 =[ $run3, dcrossbow_run4 ] {ai_run(7);}; +void() dcrossbow_run4 =[ $run4, dcrossbow_run5 ] {ai_run(16);}; +void() dcrossbow_run5 =[ $run5, dcrossbow_run6 ] {ai_run(20);}; +void() dcrossbow_run6 =[ $run6, dcrossbow_run1 ] {ai_run(6);}; + +//=========================================================================== +// FINISHING (STOP) - exit point for the range attack logic +// STOP - lower crossbow and then run / hunt player +void() dcrossbow_stop1 =[ $tstop1, dcrossbow_stop2 ] {self.weaponstate = CROSS_UP;}; +void() dcrossbow_stop2 =[ $tstop2, dcrossbow_stop3 ] {}; +void() dcrossbow_stop3 =[ $tstop3, dcrossbow_stop4 ] {}; +void() dcrossbow_stop4 =[ $tstop4, dcrossbow_stop5 ] {}; +void() dcrossbow_stop5 =[ $tstop5, dcrossbow_stop6 ] {}; +void() dcrossbow_stop6 =[ $tstop6, dcrossbow_stop7 ] {}; +void() dcrossbow_stop7 =[ $tstop7, dcrossbow_run1 ] {self.weaponstate = CROSS_DOWN;}; + +//=========================================================================== +void() dcrossbow_shot = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/crossbow_fire.wav", 1, ATTN_NORM); + + // Skill level adjustment + self.attack_speed = SPEED_DCROSS + (skill*SPEED_BOLTSKILL); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + //It certainly was really cool to write the code for tracking and + //lots of fun to watch how the AI adapts to the player movement, + //but as a player it just feels cheap and unfair! + //- The tracking feature is now just a spawnflag option + if (self.spawnflags & MON_DCROSSTRACK) dir = normalize(self.attack_track - org); + else dir = normalize(self.enemy.origin - org); + + // Fire projectile at player + launch_projectile (org, dir, CT_PROJ_BOLT1, self.attack_speed); +}; + +//---------------------------------------------------------------------------- +// FIRE - fires crossbow and reload +// Trimmed down from 32 frames to 20 (now 2s reload time) +// Removed - 4,6,8,10, 17,19,21,23, 25,27,29,31 +//---------------------------------------------------------------------------- +void() dcrossbow_fire1 =[ $tfire1, dcrossbow_fire2 ] {dcrossbow_shot();}; +void() dcrossbow_fire2 =[ $tfire2, dcrossbow_fire3 ] {ai_face();}; +void() dcrossbow_fire3 =[ $tfire3, dcrossbow_fire5 ] {ai_face();}; +void() dcrossbow_fire5 =[ $tfire5, dcrossbow_fire7 ] {}; +void() dcrossbow_fire7 =[ $tfire7, dcrossbow_fire9 ] {}; +void() dcrossbow_fire9 =[ $tfire9, dcrossbow_fire11] {}; +void() dcrossbow_fire11 =[ $tfire11, dcrossbow_fire12] {}; +void() dcrossbow_fire12 =[ $tfire12, dcrossbow_fire13] {}; +void() dcrossbow_fire13 =[ $tfire13, dcrossbow_fire14] {}; +void() dcrossbow_fire14 =[ $tfire14, dcrossbow_fire15] {}; +void() dcrossbow_fire15 =[ $tfire15, dcrossbow_fire16] { + sound (self, CHAN_WEAPON, "weapons/crossbow_rdy.wav", 1, ATTN_NORM);}; +void() dcrossbow_fire16 =[ $tfire16, dcrossbow_fire18] {}; +void() dcrossbow_fire18 =[ $tfire18, dcrossbow_fire20] {}; +void() dcrossbow_fire20 =[ $tfire20, dcrossbow_fire22] {}; +void() dcrossbow_fire22 =[ $tfire22, dcrossbow_fire24] {}; +void() dcrossbow_fire24 =[ $tfire24, dcrossbow_fire26] {}; +void() dcrossbow_fire26 =[ $tfire26, dcrossbow_fire28] {ai_face();}; +void() dcrossbow_fire28 =[ $tfire28, dcrossbow_fire30] {ai_face();}; +void() dcrossbow_fire30 =[ $tfire30, dcrossbow_hold1] {ai_face(); + self.weaponswitch = time + CROSS_TIMEOUT; // Don't exit straight away +}; + +//=========================================================================== +void() dcrossbow_checkattack = +{ + local float boltspeed; + + // Always return if monster is dead! + if (self.health < 1) return; + + // Check to see if enemy is dead? back to run/hunt cycle + if (self.enemy.health < 1) dcrossbow_stop1(); + else { + // is the enemy visible? (liquid check) + if (visible(self.enemy)) { + self.weaponswitch = time + CROSS_TIMEOUT; + // Is the enemy blocked by another enemy? + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) { + // Is the enemy within melee range? + if (ai_checkmelee(MONAI_MELEEKNIGHT)) self.th_melee(); + else { + // Skill level adjustment for bolt speed + boltspeed = SPEED_DCROSS + (skill*SPEED_BOLTSKILL); + self.attack_track = SUB_Tracking(self.attack_track, self.attack_offset, self.enemy, boltspeed); + + // Chance of attack? start out low and get better chance+tracking over time + self.attack_chance = self.attack_chance + 0.2; + if (random() < self.attack_chance) dcrossbow_fire1(); + } + } + } + else { + // Have not see player for a while, stop wating and hunt for them + if (self.weaponswitch < time+0.1) dcrossbow_stop1(); + else { + // If cannot see player try strafe side to side first before hunt mode + if (self.attack_state == AS_MISSILE) self.think = dcrossbow_slide1; + } + } + } +}; + +//---------------------------------------------------------------------------- +// SLIDE - strafe side to side movement, crossbow up high +void() dcrossbow_slide1 =[ $tslide1, dcrossbow_slide2 ] {ai_run_slide(4); + self.attack_state = AS_SLIDING; // Update type of attack + self.attack_chance = 0.5; // higher chance to attack because moving + self.attack_track = self.enemy.origin; // reset enemy origin ready for tracking + dcrossbow_checkattack(); // Start tracking the player +}; +void() dcrossbow_slide2 =[ $tslide2, dcrossbow_slide3 ] {ai_run_slide(6);dcrossbow_checkattack();}; +void() dcrossbow_slide3 =[ $tslide3, dcrossbow_slide4 ] {ai_run_slide(4);dcrossbow_checkattack();}; +void() dcrossbow_slide4 =[ $tslide4, dcrossbow_slide5 ] {ai_run_slide(2);dcrossbow_checkattack();monster_footstep(FALSE);}; +void() dcrossbow_slide5 =[ $tslide5, dcrossbow_slide6 ] {ai_run_slide(4);dcrossbow_checkattack();}; +void() dcrossbow_slide6 =[ $tslide6, dcrossbow_slide7 ] {ai_run_slide(6);dcrossbow_checkattack();}; +void() dcrossbow_slide7 =[ $tslide7, dcrossbow_slide8 ] {ai_run_slide(4);dcrossbow_checkattack();}; +void() dcrossbow_slide8 =[ $tslide8, dcrossbow_slide1 ] {ai_run_slide(2); + if (!visblocked_wide(self.enemy, '0 0 28', '0 0 0')) self.think = dcrossbow_hold1; + else dcrossbow_checkattack(); +}; + +//---------------------------------------------------------------------------- +// STARTING (SLIDE) - brings crossbow up to shoulder height +void() dcrossbow_slideup1 =[ $tready1, dcrossbow_slideup2 ] {ai_face(); + self.weaponstate = CROSS_DOWN; // Crossbow animation state + self.lefty = rint(random()); // Randomize strafe direction +}; +void() dcrossbow_slideup2 =[ $tready2, dcrossbow_slideup3 ] {}; +void() dcrossbow_slideup3 =[ $tready3, dcrossbow_slideup4 ] {ai_face();}; +void() dcrossbow_slideup4 =[ $tready4, dcrossbow_slideup5 ] {}; +void() dcrossbow_slideup5 =[ $tready5, dcrossbow_slideup6 ] {ai_face();}; +void() dcrossbow_slideup6 =[ $tready6, dcrossbow_slideup7 ] {monster_footstep(FALSE);}; +void() dcrossbow_slideup7 =[ $tready7, dcrossbow_slide1 ] {ai_face(); + self.weaponswitch = time + CROSS_TIMEOUT; // Don't exit straight away + self.weaponstate = CROSS_UP; // Crossbow animation in correct state for slide/hold +}; + +//---------------------------------------------------------------------------- +void() dcrossbow_checkslide = +{ + if (self.weaponstate == CROSS_DOWN) dcrossbow_slideup1(); + else dcrossbow_slide1(); +}; + +//---------------------------------------------------------------------------- +// HOLD - keeps crossbow up high and wait to fire at player +// Random chance to slide to the side instead of being a stationary target +void() dcrossbow_hold1 =[ $thold1, dcrossbow_hold2 ] {ai_face(); + self.attack_state = AS_MISSILE; // Update type of attack + // Quick fire coming from melee attack, otherwise slow build up + if (self.attack_chance < 0) self.attack_chance = 0.5; + else self.attack_chance = 0; // Initial chance of attack is low + self.attack_track = self.enemy.origin; // reset enemy origin ready for tracking + dcrossbow_checkattack(); +}; +void() dcrossbow_hold2 =[ $thold2, dcrossbow_hold3 ] {dcrossbow_checkattack();}; +void() dcrossbow_hold3 =[ $thold3, dcrossbow_hold4 ] {ai_face();dcrossbow_checkattack();}; +void() dcrossbow_hold4 =[ $thold4, dcrossbow_hold5 ] {dcrossbow_checkattack();}; +void() dcrossbow_hold5 =[ $thold5, dcrossbow_hold6 ] {ai_face();dcrossbow_checkattack();}; +void() dcrossbow_hold6 =[ $thold6, dcrossbow_hold1 ] { + if (random() < 0.5) self.think = dcrossbow_slide1; + else dcrossbow_checkattack(); +}; + +//---------------------------------------------------------------------------- +// STARTING (HOLD) - brings crossbow up to shoulder height +void() dcrossbow_ready1 =[ $tready1, dcrossbow_ready2 ] {ai_face(); + self.weaponstate = CROSS_DOWN; // Crossbow animation state + self.lefty = rint(random()); // Randomize strafe direction +}; +void() dcrossbow_ready2 =[ $tready2, dcrossbow_ready3 ] {}; +void() dcrossbow_ready3 =[ $tready3, dcrossbow_ready4 ] {ai_face();}; +void() dcrossbow_ready4 =[ $tready4, dcrossbow_ready5 ] {}; +void() dcrossbow_ready5 =[ $tready5, dcrossbow_ready6 ] {ai_face();}; +void() dcrossbow_ready6 =[ $tready6, dcrossbow_ready7 ] {monster_footstep(FALSE);}; +void() dcrossbow_ready7 =[ $tready7, dcrossbow_hold1 ] {ai_face(); + self.weaponswitch = time + CROSS_TIMEOUT; // Don't exit straight away + self.weaponstate = CROSS_UP; // Crossbow animation in correct state for slide/hold +}; + +//=========================================================================== +// Cycle between melee attacks +// Attack 1 - Slice (stationary one hand slashing attack) +// Attack 2 - Smash (chop overhead to ground) +//---------------------------------------------------------------------- +void() dcrossbow_slice1 =[ $slice2, dcrossbow_slice2 ] {self.weaponstate = CROSS_DOWN;ai_face();}; +void() dcrossbow_slice2 =[ $slice3, dcrossbow_slice3 ] {ai_face(); dcrossbow_crossbow_sound();}; +void() dcrossbow_slice3 =[ $slice4, dcrossbow_slice4 ] {ai_face();}; +void() dcrossbow_slice4 =[ $slice5, dcrossbow_slice5 ] {ai_melee();}; +void() dcrossbow_slice5 =[ $slice6, dcrossbow_slice6 ] {self.meleecontact=TRUE;ai_meleesmash(15);}; +void() dcrossbow_slice6 =[ $slice7, dcrossbow_slice7 ] {ai_melee();self.meleecontact=FALSE;}; +void() dcrossbow_slice7 =[ $slice8, dcrossbow_slice8 ] {}; +void() dcrossbow_slice8 =[ $slice9, dcrossbow_slice9 ] {}; +void() dcrossbow_slice9 =[ $slice10, dcrossbow_slice10 ] {}; +void() dcrossbow_slice10 =[ $slice11, dcrossbow_slice11 ] {ai_face();}; +void() dcrossbow_slice11 =[ $slice12, dcrossbow_slice1 ] {dcrossbow_checkmelee();}; + +//---------------------------------------------------------------------- +// Knight - 11 frames (skipped (1, 11, 14, 15) +void() dcrossbow_smash1 =[ $smash2, dcrossbow_smash2 ] {self.weaponstate = CROSS_DOWN;ai_charge(1);}; +void() dcrossbow_smash2 =[ $smash3, dcrossbow_smash3 ] {ai_charge(7);}; +void() dcrossbow_smash3 =[ $smash4, dcrossbow_smash4 ] {monster_footstep(FALSE); ai_charge(4);}; +void() dcrossbow_smash4 =[ $smash5, dcrossbow_smash5 ] {ai_face();}; +void() dcrossbow_smash5 =[ $smash6, dcrossbow_smash6 ] {dcrossbow_crossbow_sound(); ai_charge(3);}; +void() dcrossbow_smash6 =[ $smash7, dcrossbow_smash7 ] {ai_charge(4);ai_melee();}; +void() dcrossbow_smash7 =[ $smash8, dcrossbow_smash8 ] {monster_footstep(FALSE);self.meleecontact=TRUE;ai_meleesmash(15);}; +void() dcrossbow_smash8 =[ $smash9, dcrossbow_smash9 ] {ai_charge(3);ai_melee();self.meleecontact=FALSE;}; +void() dcrossbow_smash9 =[ $smash10, dcrossbow_smash10 ] {ai_charge(1);}; +void() dcrossbow_smash10 =[ $smash12, dcrossbow_smash11 ] {ai_charge(1);}; +void() dcrossbow_smash11 =[ $smash13, dcrossbow_smash1 ] {dcrossbow_checkmelee();}; + +//---------------------------------------------------------------------- +void() dcrossbow_melee = +{ + // Cycle between different melee attacks + self.meleeattack = self.meleeattack + 1; + if (self.meleeattack == 1) dcrossbow_slice1(); + else { dcrossbow_smash1(); self.meleeattack = 0; } +}; + +//---------------------------------------------------------------------- +void() dcrossbow_checkmelee = +{ + // Always return if monster is dead! + if (self.health < 1) return; + + // Check to see if enemy is dead? back to run/hunt cycle + if (self.enemy.health < 1) ai_run(0); + else { + // Is the enemy within melee range? + // If not then do a quick hipshot at the player + if (!ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_chance = -1; // Start with higher percentage + dcrossbow_ready1(); // Raise up crossbow ready + } + else dcrossbow_melee(); + } +}; + +//============================================================================ +void() dcrossbow_painA1 =[ $painA1, dcrossbow_painA2 ] {self.weaponstate = CROSS_DOWN;}; +void() dcrossbow_painA2 =[ $painA2, dcrossbow_painA3 ] {}; +void() dcrossbow_painA3 =[ $painA3, dcrossbow_painA4 ] {}; +void() dcrossbow_painA4 =[ $painA4, dcrossbow_painA5 ] {}; +void() dcrossbow_painA5 =[ $painA5, dcrossbow_run1 ] {}; +//---------------------------------------------------------------------- +void() dcrossbow_painD1 =[ $painD1, dcrossbow_painD2 ] {self.weaponstate = CROSS_DOWN;}; +void() dcrossbow_painD2 =[ $painD2, dcrossbow_painD3 ] {}; +void() dcrossbow_painD3 =[ $painD3, dcrossbow_painD4 ] {}; +void() dcrossbow_painD4 =[ $painD4, dcrossbow_painD5 ] {monster_footstep(FALSE);}; +void() dcrossbow_painD5 =[ $painD5, dcrossbow_painD6 ] {}; +void() dcrossbow_painD6 =[ $painD6, dcrossbow_painD7 ] {}; +void() dcrossbow_painD7 =[ $painD7, dcrossbow_painD8 ] {}; +void() dcrossbow_painD8 =[ $painD8, dcrossbow_painD9 ] {monster_footstep(FALSE);}; +void() dcrossbow_painD9 =[ $painD9, dcrossbow_painD10 ] {}; +void() dcrossbow_painD10=[ $painD10, dcrossbow_painD11 ] {}; +void() dcrossbow_painD11=[ $painD11, dcrossbow_run1 ] {}; +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dcrossbow_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) dcrossbow_painA1 (); // classic, body recoil + else { + dcrossbow_painD1 (); // Cool stumble, hand over mouth + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dcrossbow_painD1 (); + } + } +}; + +//============================================================================ +void() dcrossbow_die1 =[ $death1, dcrossbow_die2 ] {ai_forward(10);}; +void() dcrossbow_die2 =[ $death2, dcrossbow_die3 ] {monster_check_gib();ai_forward(8);}; +void() dcrossbow_die3 =[ $death3, dcrossbow_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dcrossbow_die4 =[ $death4, dcrossbow_die5 ] {}; +void() dcrossbow_die5 =[ $death5, dcrossbow_die6 ] {}; +void() dcrossbow_die6 =[ $death6, dcrossbow_die7 ] {}; +void() dcrossbow_die7 =[ $death7, dcrossbow_die8 ] {}; +void() dcrossbow_die8 =[ $death8, dcrossbow_die9 ] {ai_forward(10); + sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM);}; +void() dcrossbow_die9 =[ $death9, dcrossbow_die10 ] {ai_forward(11);}; +void() dcrossbow_die10 =[ $death10, dcrossbow_die11 ] {monster_death_postcheck();}; +void() dcrossbow_die11 =[ $death11, dcrossbow_die11 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dcrossbow_dieb1 =[ $deathb1, dcrossbow_dieb2 ] {}; +void() dcrossbow_dieb2 =[ $deathb2, dcrossbow_dieb3 ] {monster_check_gib();}; +void() dcrossbow_dieb3 =[ $deathb3, dcrossbow_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dcrossbow_dieb4 =[ $deathb4, dcrossbow_dieb5 ] {}; +void() dcrossbow_dieb5 =[ $deathb5, dcrossbow_dieb6 ] {}; +void() dcrossbow_dieb6 =[ $deathb6, dcrossbow_dieb7 ] {}; +void() dcrossbow_dieb7 =[ $deathb7, dcrossbow_dieb8 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM);}; +void() dcrossbow_dieb8 =[ $deathb8, dcrossbow_dieb9 ] {}; +void() dcrossbow_dieb9 =[ $deathb9, dcrossbow_dieb10 ] {}; +void() dcrossbow_dieb10 =[ $deathb10, dcrossbow_dieb11 ] {}; +void() dcrossbow_dieb11 =[ $deathb11, dcrossbow_dieb12 ] {}; +void() dcrossbow_dieb12 =[ $deathb12, dcrossbow_dieb13 ] {}; +void() dcrossbow_dieb13 =[ $deathb13, dcrossbow_dieb14 ] {}; +void() dcrossbow_dieb14 =[ $deathb14, dcrossbow_dieb15 ] {}; +void() dcrossbow_dieb15 =[ $deathb15, dcrossbow_dieb16 ] {}; +void() dcrossbow_dieb16 =[ $deathb16, dcrossbow_dieb17 ] {}; +void() dcrossbow_dieb17 =[ $deathb17, dcrossbow_dieb18 ] {}; +void() dcrossbow_dieb18 =[ $deathb18, dcrossbow_dieb19 ] {}; +void() dcrossbow_dieb19 =[ $deathb19, dcrossbow_dieb20 ] {monster_death_postcheck();}; +void() dcrossbow_dieb20 =[ $deathb20, dcrossbow_dieb20 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dcrossbow_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Clear weapon sound + sound (self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + if (random() > 0.5) dcrossbow_die1 (); + else dcrossbow_dieb1 (); + } +}; + +//============================================================================ +void() dcrossbow_crossbow_sound = +{ + sound (self, CHAN_WEAPON, "weapons/crossbow_swipe.wav", 1, ATTN_NORM); +}; + +/*====================================================================== +QUAKED monster_dcrossbow (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dcrossbow = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dcrossbow.mdl"; // crossbow guy + self.headmdl = "progs/h_dcrossbow.mdl"; + self.gib1mdl = "progs/w_dcrossbow.mdl"; // Unique weapon + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_BOLT1); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "dknight/dcross_idle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "dknight/dcross_idlecom.wav"; + precache_sound (self.idle_soundcom); + + self.pain_sound = "knight/khurt.wav"; + precache_sound (self.pain_sound); + precache_sound ("knight/kdeath.wav"); + + // Crossbow and bolt sounds + precache_sound ("weapons/bolt_hit1.wav"); + precache_sound ("weapons/bolt_hit2.wav"); + precache_sound ("weapons/bolt_hit3.wav"); + precache_sound ("weapons/bolt_hit4.wav"); + precache_sound ("weapons/crossbow_fire.wav"); + precache_sound ("weapons/crossbow_swipe.wav"); + + // Heavy wood sound + self.meleehitsound = "weapons/crossbow_hit1.wav"; + precache_sound (self.meleehitsound); + + self.sight_sound = "weapons/crossbow_rdy.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_BOLT2); // Green poison bolt + self.skin = self.exactskin = 1; // Greener Green+++ Skin!?! + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 75; + self.gibhealth = -25; // Can be gib from a rocket/grenade + self.gibbed = FALSE; + self.pain_flinch = 40; + self.pain_longanim = TRUE; + self.steptype = FS_TYPEMEDIUM; + self.weaponstate = CROSS_DOWN; // Maintain crossbow state + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEFRONT; // Smash attack + self.attack_offset = '20 12 28'; // Where to fire bolt from + self.deathstring = " was skewered by a Crossbow Knight\n"; + + // check for sniper mode, no distance checks for attacks + if (self.spawnflags & MON_DCROSSSNIPER) + self.enemymaxdist = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DCrossCheckAttack; + self.th_stand = dcrossbow_stand1; + self.th_walk = dcrossbow_walk1; + self.th_run = dcrossbow_run1; + self.th_melee = dcrossbow_melee; + self.th_missile = dcrossbow_ready1; + self.th_slide = dcrossbow_checkslide; + self.th_pain = dcrossbow_pain; + self.th_die = dcrossbow_die; + + self.classtype = CT_MONDCROSS; + self.classgroup = CG_KNIGHT; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_demon.qc b/QC_other/QC_arcane/mon_demon.qc new file mode 100644 index 00000000..52eba787 --- /dev/null +++ b/QC_other/QC_arcane/mon_demon.qc @@ -0,0 +1,339 @@ +/*============================================================================== +DEMON +==============================================================================*/ +$cd id1/models/demon3 +$scale 0.8 +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +$frame run1 run2 run3 run4 run5 run6 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 +$frame leap11 leap12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 +$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 + +//============================================================================ +void() demon1_stand1 =[ $stand1, demon1_stand2 ] {monster_idle_sound(); ai_stand();}; +void() demon1_stand2 =[ $stand2, demon1_stand3 ] {ai_stand();}; +void() demon1_stand3 =[ $stand3, demon1_stand4 ] {ai_stand();}; +void() demon1_stand4 =[ $stand4, demon1_stand5 ] {ai_stand();}; +void() demon1_stand5 =[ $stand5, demon1_stand6 ] {ai_stand();}; +void() demon1_stand6 =[ $stand6, demon1_stand7 ] {ai_stand();}; +void() demon1_stand7 =[ $stand7, demon1_stand8 ] {ai_stand();}; +void() demon1_stand8 =[ $stand8, demon1_stand9 ] {ai_stand();}; +void() demon1_stand9 =[ $stand9, demon1_stand10 ] {ai_stand();}; +void() demon1_stand10 =[ $stand10, demon1_stand11 ] {ai_stand();}; +void() demon1_stand11 =[ $stand11, demon1_stand12 ] {ai_stand();}; +void() demon1_stand12 =[ $stand12, demon1_stand13 ] {ai_stand();}; +void() demon1_stand13 =[ $stand13, demon1_stand1 ] {ai_stand();}; + +//============================================================================ +void() demon1_walk1 =[ $walk1, demon1_walk2 ] { + monster_footstep(FALSE); monster_idle_sound(); ai_walk(8);}; +void() demon1_walk2 =[ $walk2, demon1_walk3 ] {ai_walk(6);}; +void() demon1_walk3 =[ $walk3, demon1_walk4 ] {ai_walk(6);}; +void() demon1_walk4 =[ $walk4, demon1_walk5 ] {ai_walk(7);}; +void() demon1_walk5 =[ $walk5, demon1_walk6 ] {monster_footstep(FALSE); ai_walk(4);}; +void() demon1_walk6 =[ $walk6, demon1_walk7 ] {ai_walk(6);}; +void() demon1_walk7 =[ $walk7, demon1_walk8 ] {ai_walk(10);}; +void() demon1_walk8 =[ $walk8, demon1_walk1 ] {ai_walk(10);}; + +//============================================================================ +void() demon1_run1 =[ $run1, demon1_run2 ] {monster_idle_sound(); ai_run(20);}; +void() demon1_run2 =[ $run2, demon1_run3 ] {monster_footstep(FALSE); ai_run(15);}; +void() demon1_run3 =[ $run3, demon1_run4 ] {ai_run(36);}; +void() demon1_run4 =[ $run4, demon1_run5 ] {ai_run(20);}; +void() demon1_run5 =[ $run5, demon1_run6 ] {monster_footstep(FALSE); ai_run(15);}; +void() demon1_run6 =[ $run6, demon1_run1 ] {ai_run(36);}; + +//=========================================================================== +// Melee damage function, called from animation frame set +// Standardized layout (matching ai_melee (ai.qc) +// Added each claw attack checks enemy distance (before no check) +// Added z depth check on attacks +/- 64 units +// Added claw miss sound (borrowed HK slash sound) +// Changed some explicit values to constant variables +//=========================================================================== +void(float side) Demon_Claw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + walkmove (self.ideal_yaw, 12); // Get extra close to enemy target + ai_damagebreakable(20); // Damage any breakables + + // Moved the check for melee distance to here with takedamage + // If the demon is outside of melee range then need miss swipe sound + // same goes for enemies that cannot be damaged (world geo mostly) + if (!ai_checkmelee(MONAI_MELEEDEMON) || !self.enemy.takedamage) { + // Melee claw miss sound + if (random() < 0.5) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + } + else { + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Melee claw hit sound + sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); + ldmg = 10 + 5*random(); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +void() demon1_atta1 =[ $attacka1, demon1_atta2 ] {ai_charge(4);}; +void() demon1_atta2 =[ $attacka2, demon1_atta3 ] {monster_footstep(FALSE); ai_charge(0);}; +void() demon1_atta3 =[ $attacka3, demon1_atta4 ] {ai_charge(0);}; +void() demon1_atta4 =[ $attacka4, demon1_atta5 ] {ai_charge(1);}; +void() demon1_atta5 =[ $attacka5, demon1_atta6 ] {ai_charge(2); Demon_Claw(150);}; +void() demon1_atta6 =[ $attacka6, demon1_atta7 ] {ai_charge(1);}; +void() demon1_atta7 =[ $attacka7, demon1_atta8 ] {ai_charge(6);}; +void() demon1_atta8 =[ $attacka8, demon1_atta9 ] {ai_charge(8);}; +void() demon1_atta9 =[ $attacka9, demon1_atta10] {ai_charge(4);}; +void() demon1_atta10 =[ $attacka10, demon1_atta11] {monster_footstep(FALSE); ai_charge(2);}; +void() demon1_atta11 =[ $attacka11, demon1_atta12] {Demon_Claw(-150);}; +void() demon1_atta12 =[ $attacka12, demon1_atta13] {ai_charge(5);}; +void() demon1_atta13 =[ $attacka13, demon1_atta14] {ai_charge(8);}; +void() demon1_atta14 =[ $attacka14, demon1_atta15] {ai_charge(4);}; +void() demon1_atta15 =[ $attacka15, demon1_run1] {ai_charge(4);}; + +//=========================================================================== +// JumpTouch setup from animation frame set +// Changed so that it does not keep going in a loop +// * Demon will jump again if stuck (only 2 jumps) +//=========================================================================== +void() Demon_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(50); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + + // Keep track of how many times touched the same object + if (self.jumptouch == other) self.jump_flag = time + MONAI_JUMPTIMEOUT; + self.jumptouch = other; // Keep track of touch target + + // Do not damage other demons with jump attacks + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 40 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + SpawnMeatSpray(self, other, FALSE); + SpawnMeatSpray(self, other, FALSE); + SpawnMeatSpray(self, other, FALSE); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + } + } + + // Is the demon floating in the air? + if (!checkbottom(self)) { + // Is the demon standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() demon1_jump1 =[ $leap1, demon1_jump2 ] {ai_face(); + self.jump_flag = time; // No jump time limits + sound (self, CHAN_VOICE, "demon/djump.wav", 1, ATTN_NORM); +}; +void() demon1_jump2 =[ $leap2, demon1_jump3 ] {ai_face();}; +void() demon1_jump3 =[ $leap3, demon1_jump4 ] {ai_face();}; +void() demon1_jump4 =[ $leap4, demon1_jump5 ] { + ai_face(); + self.jump_flag = time; // No jump time limits + self.touch = Demon_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 600 + '0 0 250'; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() demon1_jump5 =[ $leap5, demon1_jump6 ] {}; +void() demon1_jump6 =[ $leap6, demon1_jump7 ] {}; +void() demon1_jump7 =[ $leap7, demon1_jump8 ] {}; +void() demon1_jump8 =[ $leap8, demon1_jump9 ] {}; +void() demon1_jump9 =[ $leap9, demon1_jump10 ] {}; +void() demon1_jump10 =[ $leap10, demon1_jump1 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = demon1_jump3; + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() demon1_jump11 =[ $leap11, demon1_jump12] {monster_footstep(FALSE); }; +void() demon1_jump12 =[ $leap12, demon1_run1 ] {ai_resetangles();}; + +/*====================================================================== + PAIN +========================================================================*/ +void() demon1_pain1 =[ $pain1, demon1_pain2 ] {}; +void() demon1_pain2 =[ $pain2, demon1_pain3 ] {}; +void() demon1_pain3 =[ $pain3, demon1_pain4 ] {}; +void() demon1_pain4 =[ $pain4, demon1_pain5 ] {}; +void() demon1_pain5 =[ $pain5, demon1_pain6 ] {}; +void() demon1_pain6 =[ $pain6, demon1_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) demon1_pain = +{ + if (self.touch == Demon_JumpTouch) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) demon1_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + demon1_pain1 (); + } + } +}; + +//============================================================================ +void() demon1_death1 =[ $death1, demon1_death2 ] {}; +void() demon1_death2 =[ $death2, demon1_death3 ] {monster_check_gib();}; +void() demon1_death3 =[ $death3, demon1_death4 ] {monster_check_gib(); +self.solid = SOLID_NOT;}; +void() demon1_death4 =[ $death4, demon1_death5 ] {}; +void() demon1_death5 =[ $death5, demon1_death6 ] {}; +void() demon1_death6 =[ $death6, demon1_death7 ] {}; +void() demon1_death7 =[ $death7, demon1_death8 ] {}; +void() demon1_death8 =[ $death8, demon1_death9 ] {monster_death_postcheck();}; +void() demon1_death9 =[ $death9, demon1_death9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() demon1_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "demon/ddeath.wav", 1, ATTN_NORM); + demon1_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_demon1 = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_demon.mdl"; + self.headmdl = "progs/h_demon.mdl"; + self.gib1mdl = "progs/gib_dmleg1.mdl"; // Left leg + self.gib2mdl = "progs/gib_dmleg2.mdl"; // Right leg + self.gib3mdl = "progs/gib_dmtail.mdl"; // Tail + self.gib4mdl = "progs/gib_dmclaw1.mdl"; // Claw 1 + self.gib5mdl = "progs/gib_dmclaw2.mdl"; // Claw 2 + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); // Always precache extra models + precache_model (self.gib5mdl); // regardless if picked or not + + // Randomly swap in demon claws instead of legs + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + if (random() < 0.5) self.gib2mdl = self.gib5mdl; + self.gib4mdl = ""; self.gib5mdl = ""; + + self.idle_sound = "demon/idle1.wav"; + precache_sound (self.idle_sound); + + self.pain_sound = "demon/dpain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("demon/ddeath.wav"); + + precache_sound ("demon/dhit2.wav"); + precache_sound ("demon/djump.wav"); + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + + self.sight_sound = "demon/sight2.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + self.exactskin = 1; + self.gib1skin = self.gib2skin = self.gib3skin = 1; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 300; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 200; // takes alot to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // High pain threshold + self.steptype = FS_TYPESLOW; // Tiny feet/nails + self.blockudeath = TRUE; // no humanoid death sound + self.meleeoffset = '32 0 10'; // Claw attack offset + self.deathstring = " was eviscerated by a Fiend\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DemonCheckAttack; + self.th_stand = demon1_stand1; + self.th_walk = demon1_walk1; + self.th_run = demon1_run1; + self.th_melee = demon1_atta1; // one of two attacks + self.th_jump = demon1_jump1; // jump attack + self.th_jumpexit = demon1_jump11; + self.th_pain = demon1_pain; + self.th_die = demon1_die; + + self.classtype = CT_MONDEMON; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_dfury.qc b/QC_other/QC_arcane/mon_dfury.qc new file mode 100644 index 00000000..cb4ff84f --- /dev/null +++ b/QC_other/QC_arcane/mon_dfury.qc @@ -0,0 +1,829 @@ +/*============================================================================== +FURY KNIGHT (one more night) +==============================================================================*/ +$cd id1/models/dfury +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default Stand - LEFT Sword forward +$frame standL1 standL2 standL3 standL4 standL5 standL6 standL7 standL8 +$frame standL9 standL10 standL11 standL12 + +// (013 - 019) Switch dual swords LEFT -> RIGHT +$frame standLR1 standLR2 standLR3 standLR4 standLR5 standLR6 standLR7 + +// (020 - 031) Default Stand - RIGHT Sword forward +$frame standR1 standR2 standR3 standR4 standR5 standR6 standR7 standR8 +$frame standR9 standR10 standR11 standR12 + +// (032 - 038) Switch dual swords RIGHT -> LEFT +$frame standRL1 standRL2 standRL3 standRL4 standRL5 standRL6 standRL7 + +// (039 - 050) Stand idle - Quick look around (MUST following left sword idle) +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 + +// (051 - 070) Stand idle - checking sword (MUST following left sword idle) +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 + +// (071 - 084) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (085 - 090) Default run +$frame run1 run2 run3 run4 run5 run6 + +// Pain animations A = Slow D = Stagger +// (091 - 095) (096 - 111) +$frame painA1 painA2 painA3 painA4 painA5 + +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 +$frame painD9 painD10 painD11 painD12 painD13 painD14 painD15 painD16 + +// (112 - 125) Forward dual sword Slice +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 + +// (126 - 140) Forward dual sword Lunge +$frame lunge1 lunge2 lunge3 lunge4 lunge5 lunge6 lunge7 lunge8 +$frame lunge9 lunge10 lunge11 lunge12 lunge13 lunge14 lunge15 + +// (141 - 164) Charging attack A - swinging swords left to right infront +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 w_attack23 w_attack24 + +// (165 - 172) Right Swing +$frame rswing1 rswing2 rswing3 rswing4 rswing5 rswing6 rswing7 rswing8 + +// (173 - 180) Left Swing +$frame lswing1 lswing2 lswing3 lswing4 lswing5 lswing6 lswing7 lswing8 + +// (181 - 195) Smash (chop overhead to ground) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (196 - 211) MagicA - Swords lock together infront (missile attack) +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 magica15 magica16 + +// (212 - 224) MagicB - Swords Swipe downwards infront (enable bullet shield) +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// (225 - 241) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 death17 + +// (242 - 255) Death back +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 + +void() dfury_standL1; +void() dfury_magic; +void() dfury_sword_sound; // Sword swipe sounds +void(float soundtype) dfury_grunt_sound; // Grunting while attacking + +// Different types of grunting sounds +float DFURY_SOUND_PULLAPART = 1; +float DFURY_SOUND_OVERSMASH = 2; +float DFURY_SOUND_JUMP = 3; +float DFURY_SOUND_LRFURY = 4; +float DFURY_SOUND_RUNSWING = 5; +float DFURY_SOUND_OPTIONAL = 6; + +//---------------------------------------------------------------------- +void() dfury_standB1 =[ $standB1, dfury_standB2 ] {ai_stand();}; +void() dfury_standB2 =[ $standB2, dfury_standB3 ] {ai_stand();}; +void() dfury_standB3 =[ $standB3, dfury_standB4 ] {ai_stand();}; +void() dfury_standB4 =[ $standB4, dfury_standB5 ] {ai_stand();}; +void() dfury_standB5 =[ $standB5, dfury_standB6 ] {ai_stand();}; +void() dfury_standB6 =[ $standB6, dfury_standB7 ] {ai_stand();}; +void() dfury_standB7 =[ $standB7, dfury_standB8 ] {ai_stand();}; +void() dfury_standB8 =[ $standB8, dfury_standB9 ] {ai_stand();self.nextthink = self.nextthink + random()*0.2;}; +void() dfury_standB9 =[ $standB9, dfury_standB10 ] {ai_stand();self.nextthink = self.nextthink + random()*0.2;}; +void() dfury_standB10 =[ $standB10, dfury_standB11 ] {ai_stand();self.nextthink = self.nextthink + random()*0.2;}; +void() dfury_standB11 =[ $standB11, dfury_standB12 ] {ai_stand();}; +void() dfury_standB12 =[ $standB12, dfury_standL1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standC1 =[ $standC1, dfury_standC2 ] {ai_stand();}; +void() dfury_standC2 =[ $standC2, dfury_standC3 ] {ai_stand();}; +void() dfury_standC3 =[ $standC3, dfury_standC4 ] {ai_stand();}; +void() dfury_standC4 =[ $standC4, dfury_standC5 ] {ai_stand();}; +void() dfury_standC5 =[ $standC5, dfury_standC6 ] {ai_stand();}; +void() dfury_standC6 =[ $standC6, dfury_standC7 ] {ai_stand();}; +void() dfury_standC7 =[ $standC7, dfury_standC8 ] {ai_stand();}; +void() dfury_standC8 =[ $standC8, dfury_standC9 ] {ai_stand();}; +void() dfury_standC9 =[ $standC9, dfury_standC10 ] {ai_stand();}; +void() dfury_standC10 =[ $standC10, dfury_standC11 ] {ai_stand();}; +void() dfury_standC11 =[ $standC11, dfury_standC12 ] {ai_stand();}; +void() dfury_standC12 =[ $standC12, dfury_standC13 ] {ai_stand();}; +void() dfury_standC13 =[ $standC13, dfury_standC14 ] {ai_stand();}; +void() dfury_standC14 =[ $standC14, dfury_standC15 ] {ai_stand();}; +void() dfury_standC15 =[ $standC15, dfury_standC16 ] {ai_stand();}; +void() dfury_standC16 =[ $standC16, dfury_standC17 ] {ai_stand();}; +void() dfury_standC17 =[ $standC17, dfury_standC18 ] {ai_stand();}; +void() dfury_standC18 =[ $standC18, dfury_standC19 ] {ai_stand();}; +void() dfury_standC19 =[ $standC19, dfury_standC20 ] {ai_stand();}; +void() dfury_standC20 =[ $standC20, dfury_standL1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standRL1 =[ $standRL1, dfury_standRL2 ] {ai_stand();}; +void() dfury_standRL2 =[ $standRL2, dfury_standRL3 ] {ai_stand();}; +void() dfury_standRL3 =[ $standRL3, dfury_standRL4 ] {ai_stand();}; +void() dfury_standRL4 =[ $standRL4, dfury_standRL5 ] {ai_stand();}; +void() dfury_standRL5 =[ $standRL5, dfury_standRL6 ] {ai_stand();}; +void() dfury_standRL6 =[ $standRL6, dfury_standRL7 ] {ai_stand();}; +void() dfury_standRL7 =[ $standRL7, dfury_standL1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standR1 =[ $standR1, dfury_standR2 ] {monster_idle_sound(); + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) + self.think = dfury_standRL1; // Switch weapon stance + ai_stand(); +}; +void() dfury_standR2 =[ $standR2, dfury_standR3 ] {ai_stand();}; +void() dfury_standR3 =[ $standR3, dfury_standR4 ] {ai_stand();}; +void() dfury_standR4 =[ $standR4, dfury_standR5 ] {ai_stand();}; +void() dfury_standR5 =[ $standR5, dfury_standR6 ] {ai_stand();}; +void() dfury_standR6 =[ $standR6, dfury_standR7 ] {monster_idle_sound(); ai_stand();}; +void() dfury_standR7 =[ $standR7, dfury_standR8 ] {ai_stand();}; +void() dfury_standR8 =[ $standR8, dfury_standR9 ] {ai_stand();}; +void() dfury_standR9 =[ $standR9, dfury_standR10 ] {ai_stand();}; +void() dfury_standR10=[ $standR10, dfury_standR11 ] {ai_stand();}; +void() dfury_standR11=[ $standR11, dfury_standR12 ] {ai_stand();}; +void() dfury_standR12=[ $standR12, dfury_standR1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standLR1 =[ $standLR1, dfury_standLR2 ] {ai_stand();}; +void() dfury_standLR2 =[ $standLR2, dfury_standLR3 ] {ai_stand();}; +void() dfury_standLR3 =[ $standLR3, dfury_standLR4 ] {ai_stand();}; +void() dfury_standLR4 =[ $standLR4, dfury_standLR5 ] {ai_stand();}; +void() dfury_standLR5 =[ $standLR5, dfury_standLR6 ] {ai_stand();}; +void() dfury_standLR6 =[ $standLR6, dfury_standLR7 ] {ai_stand();}; +void() dfury_standLR7 =[ $standLR7, dfury_standR1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standL1 =[ $standL1, dfury_standL2 ] {monster_idle_sound(); + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) { + // Slow down the repeating of idle animations + self.weaponswitch = time + 1 + random()*3; + self.idlebusy = TRUE; + + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + + if (self.lip < 2) self.think = dfury_standC1; // Look at weapon + else if (self.lip == 2) self.think = dfury_standB1; // Look around + else self.think = dfury_standLR1; // Switch weapon stance + } + ai_stand(); +}; +void() dfury_standL2 =[ $standL2, dfury_standL3 ] {ai_stand();}; +void() dfury_standL3 =[ $standL3, dfury_standL4 ] {ai_stand();}; +void() dfury_standL4 =[ $standL4, dfury_standL5 ] {ai_stand();}; +void() dfury_standL5 =[ $standL5, dfury_standL6 ] {ai_stand();}; +void() dfury_standL6 =[ $standL6, dfury_standL7 ] {ai_stand();}; +void() dfury_standL7 =[ $standL7, dfury_standL8 ] {ai_stand();}; +void() dfury_standL8 =[ $standL8, dfury_standL9 ] {ai_stand();}; +void() dfury_standL9 =[ $standL9, dfury_standL10 ] {ai_stand();}; +void() dfury_standL10=[ $standL10, dfury_standL11 ] {ai_stand();}; +void() dfury_standL11=[ $standL11, dfury_standL12 ] {ai_stand();}; +void() dfury_standL12=[ $standL12, dfury_standL1 ] {ai_stand();}; + +//=========================================================================== +void() dfury_walk1 =[ $walk1, dfury_walk2 ] { monster_idle_sound(); + self.idlebusy = FALSE; ai_walk(2);}; +void() dfury_walk2 =[ $walk2, dfury_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dfury_walk3 =[ $walk3, dfury_walk4 ] {ai_walk(5);}; +void() dfury_walk4 =[ $walk4, dfury_walk5 ] {ai_walk(4);}; +void() dfury_walk5 =[ $walk5, dfury_walk6 ] {ai_walk(4);}; +void() dfury_walk6 =[ $walk6, dfury_walk7 ] {ai_walk(2);}; +void() dfury_walk7 =[ $walk7, dfury_walk8 ] {ai_walk(2);}; +void() dfury_walk8 =[ $walk8, dfury_walk9 ] {monster_footstep(FALSE); ai_walk(3);}; +void() dfury_walk9 =[ $walk9, dfury_walk10] {ai_walk(3);}; +void() dfury_walk10=[ $walk10, dfury_walk11] {ai_walk(4);}; +void() dfury_walk11=[ $walk11, dfury_walk12] {ai_walk(3);}; +void() dfury_walk12=[ $walk12, dfury_walk13] {ai_walk(4);}; +void() dfury_walk13=[ $walk13, dfury_walk14] {ai_walk(6);}; +void() dfury_walk14=[ $walk14, dfury_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// 6 frames instead of 8 frames (skipping 3rd/7th timing of original) +void() dfury_run1 =[ $run1, dfury_run2 ] {monster_idle_sound(); + self.idlebusy = FALSE;ai_run (22); }; +void() dfury_run2 =[ $run2, dfury_run3 ] {monster_footstep(FALSE); ai_run(27);}; +void() dfury_run3 =[ $run3, dfury_run4 ] {ai_run(18);}; +void() dfury_run4 =[ $run4, dfury_run5 ] {ai_run(16);}; +void() dfury_run5 =[ $run5, dfury_run6 ] {monster_footstep(FALSE); ai_run(27);}; +void() dfury_run6 =[ $run6, dfury_run1 ] {ai_run(15);}; + +//=========================================================================== +// Melee Attack 1 - Slice (bring swords together and pull apart) +void() dfury_slice1 =[ $slice2, dfury_slice2 ] {dfury_grunt_sound(DFURY_SOUND_PULLAPART);ai_charge(9);}; +void() dfury_slice2 =[ $slice3, dfury_slice3 ] {ai_charge(10); dfury_sword_sound();}; +void() dfury_slice3 =[ $slice4, dfury_slice4 ] {ai_charge(17);}; +void() dfury_slice4 =[ $slice5, dfury_slice5 ] {monster_footstep(FALSE); ai_charge(4);}; +void() dfury_slice5 =[ $slice6, dfury_slice6 ] {ai_charge(11); dfury_sword_sound(); ai_melee();}; +void() dfury_slice6 =[ $slice7, dfury_slice7 ] {ai_charge(19); ai_melee();}; +void() dfury_slice7 =[ $slice8, dfury_slice8 ] {ai_charge(12); ai_melee();}; +void() dfury_slice8 =[ $slice9, dfury_slice9 ] {ai_charge(6); ai_melee();}; +void() dfury_slice9 =[ $slice11, dfury_slice10 ] {monster_footstep(FALSE); ai_melee();}; +void() dfury_slice10 =[ $slice13, dfury_slice11 ] {ai_charge(0);}; +void() dfury_slice11 =[ $slice14, dfury_run1 ] {monster_footstep(FALSE); ai_charge(7);}; + +//---------------------------------------------------------------------- +// Melee Attack 2 - Smash (both swords chop overhead to ground) +void() dfury_smash1 =[ $smash2, dfury_smash2 ] {ai_charge(1);}; +void() dfury_smash2 =[ $smash3, dfury_smash3 ] {ai_charge(13);}; +void() dfury_smash3 =[ $smash4, dfury_smash4 ] {ai_charge(9); monster_footstep(FALSE);}; +void() dfury_smash4 =[ $smash5, dfury_smash5 ] {ai_charge(11);}; +void() dfury_smash5 =[ $smash6, dfury_smash6 ] {dfury_grunt_sound(DFURY_SOUND_OVERSMASH);ai_charge(10);}; +void() dfury_smash6 =[ $smash7, dfury_smash7 ] {ai_charge(7); dfury_sword_sound();}; +void() dfury_smash7 =[ $smash8, dfury_smash8 ] {ai_charge(12); monster_footstep(FALSE);}; +void() dfury_smash8 =[ $smash9, dfury_smash9 ] {ai_charge(2);self.meleecontact = TRUE; ai_meleesmash(40);}; +void() dfury_smash9 =[ $smash10, dfury_smash10 ] {ai_charge(3); ai_melee();self.meleecontact = FALSE;}; +void() dfury_smash10 =[ $smash12, dfury_smash11 ] {ai_charge(0);}; +void() dfury_smash11 =[ $smash13, dfury_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +// Melee Attack 4a - Single Right Swing (fast attack) +void() dfury_lswing3; +void() dfury_rswing1 =[ $rswing2, dfury_rswing3 ] {ai_charge(2);}; +void() dfury_rswing3 =[ $rswing3, dfury_rswing4 ] {dfury_grunt_sound(DFURY_SOUND_LRFURY);ai_charge(5);}; +void() dfury_rswing4 =[ $rswing4, dfury_rswing5 ] {ai_charge(8);ai_melee();monster_footstep(FALSE);}; +void() dfury_rswing5 =[ $rswing5, dfury_rswing6 ] {ai_charge(7);ai_melee();}; +void() dfury_rswing6 =[ $rswing6, dfury_rswing7 ] {ai_charge(5);ai_melee(); dfury_sword_sound();}; +void() dfury_rswing7 =[ $rswing7, dfury_rswing8 ] {ai_charge(2);monster_footstep(FALSE);}; +void() dfury_rswing8 =[ $rswing8, dfury_run1 ] {ai_charge(1); + if (ai_checkmelee(MONAI_MELEEFRONT) && self.enemy.health > 0) self.think = dfury_lswing3; +}; + +//---------------------------------------------------------------------- +// Melee Attack 4a - Single Right Swing (fast attack) +void() dfury_lswing1 =[ $lswing2, dfury_lswing3 ] {ai_charge(2);}; +void() dfury_lswing3 =[ $lswing3, dfury_lswing4 ] {dfury_grunt_sound(DFURY_SOUND_OPTIONAL);ai_charge(5);}; +void() dfury_lswing4 =[ $lswing4, dfury_lswing5 ] {ai_charge(8);ai_melee();monster_footstep(FALSE);}; +void() dfury_lswing5 =[ $lswing5, dfury_lswing6 ] {ai_charge(7);ai_melee();}; +void() dfury_lswing6 =[ $lswing6, dfury_lswing7 ] {ai_charge(5);ai_melee(); dfury_sword_sound();}; +void() dfury_lswing7 =[ $lswing7, dfury_lswing8 ] {ai_charge(2);monster_footstep(FALSE);}; +void() dfury_lswing8 =[ $lswing8, dfury_run1 ] {ai_charge(1); + if (ai_checkmelee(MONAI_MELEEFRONT) && self.enemy.health > 0) self.think = dfury_rswing3; +}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - Lunge forward (leaving ground) and do heavy damage +void() dfury_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(30); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the fury knight floating in the air? + if (!checkbottom(self)) { + // Is the fury knight standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() dfury_lunge1 =[ $lunge1, dfury_lunge2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPFURYTIME; + dfury_grunt_sound(DFURY_SOUND_JUMP); +}; +void() dfury_lunge2 =[ $lunge2, dfury_lunge3 ] {ai_face();}; +void() dfury_lunge3 =[ $lunge3, dfury_lunge4 ] {ai_face();}; +void() dfury_lunge4 =[ $lunge4, dfury_lunge5 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPFURYTIME; + self.touch = dfury_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 500 + '0 0 250'; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +void() dfury_lunge5 =[ $lunge5, dfury_lunge6 ] {}; +void() dfury_lunge6 =[ $lunge6, dfury_lunge7 ] {}; +void() dfury_lunge7 =[ $lunge7, dfury_lunge8 ] {}; +void() dfury_lunge8 =[ $lunge8, dfury_lunge8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = dfury_lunge4; // Keep jumping + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +// Landed with thrush attack +void() dfury_lunge9 =[ $lunge9, dfury_lunge10 ] {ai_melee();}; +void() dfury_lunge10 =[ $lunge10, dfury_lunge11 ] {ai_charge(5);ai_melee();}; +void() dfury_lunge11 =[ $lunge11, dfury_lunge12 ] {ai_charge(4);ai_melee();dfury_sword_sound();}; +void() dfury_lunge12 =[ $lunge12, dfury_lunge13 ] {ai_charge(1);ai_melee();}; +void() dfury_lunge13 =[ $lunge13, dfury_lunge14 ] {ai_charge(1);ai_melee();monster_footstep(FALSE);}; +void() dfury_lunge14 =[ $lunge14, dfury_lunge15 ] {ai_charge(1);}; +void() dfury_lunge15 =[ $lunge15, dfury_run1 ] {ai_resetangles(); + // If close enough starting swinging left+right ELSE return to run cycle + if (ai_checkmelee(MONAI_MELEEFRONT) && self.enemy.health > 0) self.think = dfury_rswing3; +}; + +//---------------------------------------------------------------------- +// Melee Attack 5 - W_Attack (two handed slashing attack) +// Identical frame set (Hell Knight / Death Knight) +// Speed boost (+16 charge) to all frames, fast charging attack! + +void() dfury_watk1 =[ $w_attack2, dfury_watk3 ] {ai_charge(18);monster_footstep(FALSE);}; +void() dfury_watk3 =[ $w_attack3, dfury_watk4 ] {ai_charge(18);}; +void() dfury_watk4 =[ $w_attack4, dfury_watk5 ] {ai_charge(18);}; +void() dfury_watk5 =[ $w_attack5, dfury_watk6 ] {ai_charge(18);dfury_grunt_sound(DFURY_SOUND_RUNSWING);}; +void() dfury_watk6 =[ $w_attack6, dfury_watk7 ] {ai_charge(18);}; +void() dfury_watk7 =[ $w_attack7, dfury_watk8 ] {ai_charge(19);monster_footstep(FALSE);}; +void() dfury_watk8 =[ $w_attack8, dfury_watk9 ] {ai_charge(22);dfury_sword_sound();ai_melee();}; +void() dfury_watk9 =[ $w_attack9, dfury_watk10] {ai_charge(23);ai_melee(); }; +void() dfury_watk10=[ $w_attack10,dfury_watk11] {ai_charge(21); ai_melee();}; +void() dfury_watk11=[ $w_attack11,dfury_watk12] {ai_charge(19);}; +void() dfury_watk12=[ $w_attack12,dfury_watk13] {ai_charge(19);}; +void() dfury_watk13=[ $w_attack13,dfury_watk14] {ai_charge(18);}; +void() dfury_watk14=[ $w_attack14,dfury_watk15] {ai_charge(18);dfury_grunt_sound(DFURY_SOUND_OPTIONAL);}; +void() dfury_watk15=[ $w_attack15,dfury_watk16] {ai_charge(18);}; +void() dfury_watk16=[ $w_attack16,dfury_watk17] {ai_charge(19);dfury_sword_sound();ai_melee();}; +void() dfury_watk17=[ $w_attack17,dfury_watk18] {ai_charge(19); monster_footstep(FALSE); ai_melee();}; +void() dfury_watk18=[ $w_attack18,dfury_watk19] {ai_charge(21); ai_melee();}; +void() dfury_watk19=[ $w_attack19,dfury_watk20] {ai_charge(22);}; +void() dfury_watk20=[ $w_attack20,dfury_watk21] {ai_charge(24);}; +void() dfury_watk21=[ $w_attack21,dfury_watk22] {ai_charge(25);}; +void() dfury_watk22=[ $w_attack22,dfury_run1 ] {ai_charge(21); + // this is a long animations set for chasing the player + // Quick check if within melee range, close melee range or random magic attack! + if (self.enemy.health > 0) { + if (ai_checkmelee(MONAI_MELEEFRONT)) self.think = dfury_rswing3; + else if (ai_checkmelee(MONAI_JUMPFURYNEAR)) self.think = dfury_slice1; + else if (random() < 0.3) self.think = dfury_magic; + } +}; + +//---------------------------------------------------------------------- +void() dfury_melee = +{ + // Use heavy overhead smash for monsters + if (self.enemy.flags & FL_MONSTER) dfury_smash1(); + else { + // Make sure next attack is different to previous (randomly while loop) + self.lip = self.meleeattack; + while (self.lip == self.meleeattack) { self.lip = rint(random()*2); } + self.meleeattack = self.lip; + if (self.meleeattack == 0) dfury_lswing1(); // Quick left + else if (self.meleeattack == 1) dfury_rswing1(); // Quick right + else dfury_smash1(); // Overhead smash + } +}; + +//=========================================================================== +// Magic attacks (glowing swords) +//=========================================================================== +// Magic Attack A - Spray of spikes from raised up swords +//---------------------------------------------------------------------- +void(float offset) dfury_magica_shot = +{ + local float shotcount; + local vector soffset, dir, offang; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Single sound per volley of bullets + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + // Randomize quantity each time called + if (random() < 0.5) shotcount = 2; + else shotcount = 3; + + // based angle of projectiles on straight line between source and target + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 6; // Arc offset + makevectors (offang); + + while (shotcount > 0) { + // Randomly spawn projectiles up and down sword length + soffset = v_forward * 20 + v_up * random() * 20; + + // Double check that missile is not blocked by any world geo + if (!visxray(self.enemy, soffset, '0 0 0', TRUE)) soffset = soffset + '0 0 24'; + soffset = self.origin + soffset; + + // Straight line velocity from source to target + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; // Slight wiggle up/down + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_DFURYSPIKE + (skill * SPEED_DFURYSKILL) + random()*10; + launch_projectile (soffset, dir, CT_PROJ_FURY2, self.attack_speed); + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +// Magic Attack B - 3 x rockets launched in an arc +//---------------------------------------------------------------------- +void() dfury_magicb_shot = +{ + local float offset, shotcount; + local vector soffset, dir, offang, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Single sound for all rockets fired + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + // create an arc of rockets fanning outwards from source + offset = -4; shotcount = 3; + while (shotcount > 0) { + // based angle of projectiles on straight line between source and target + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset; + makevectors (offang); + + // Randomly spawn projectiles around central point + soffset = v_forward * 20 + v_up * (5 + random() * 10); + + // Double check that missile is not blocked by any world geo + if (!visxray(self.enemy, soffset, '0 0 0', TRUE)) soffset = soffset + '0 0 24'; + soffset = self.origin + soffset; + + // Straight line velocity from source to target + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; // Slight wiggle up/down + avel = vecrand(100,200,FALSE); + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_DFURYSPIKE + (skill * SPEED_DFURYSKILL) + random()*10; + Launch_Missile (soffset, dir, avel, CT_PROJ_FURY1, self.attack_speed ); + offset = offset + 4; + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +void() dfury_attachment_finish = +{ + if (self.state) { + self.state = FALSE; + self.alpha = 0.1; + setmodel(self, ""); + } +}; + +//---------------------------------------------------------------------- +void(float skincolor) dfury_attachment_setup = +{ + if (self.attachment && !self.attachment.state) { + self.attachment.state = TRUE; + setmodel(self.attachment, self.weaponglow); + self.attachment.alpha = 0.1; + self.attachment.skin = skincolor; + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.nextthink = time + 0.15; + self.attachment.think = dfury_attachment_finish; + } +}; + +//---------------------------------------------------------------------- +void() dfury_attachment_update = +{ + if (self.attachment && self.attachment.state) { + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = self.frame; + self.attachment.alpha = 0.3 + random()*0.7; + self.attachment.nextthink = time + 0.15; + self.attachment.think = dfury_attachment_finish; + } +}; + +//---------------------------------------------------------------------- +// Magic Attack A - Spray of spikes from raised up swords +// Block pain function from interrupting magic attack +void() dfury_magica1 =[ $magica2, dfury_magica2 ] {ai_face();self.pain_finished = time + 2;}; +void() dfury_magica2 =[ $magica3, dfury_magica3 ] {ai_face();}; +void() dfury_magica3 =[ $magica4, dfury_magica4 ] {ai_face();}; +void() dfury_magica4 =[ $magica5, dfury_magica5 ] {ai_face();}; +void() dfury_magica5 =[ $magica6, dfury_magica6 ] {ai_charge(2);dfury_attachment_setup(0);}; +void() dfury_magica6 =[ $magica7, dfury_magica7 ] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica7 =[ $magica8, dfury_magica8 ] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica8 =[ $magica9, dfury_magica9 ] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica9 =[ $magica10, dfury_magica10] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica10 =[ $magica11, dfury_magica11] {dfury_attachment_update();dfury_magica_shot(-3);}; +void() dfury_magica11 =[ $magica12, dfury_magica12] {dfury_attachment_update();dfury_magica_shot(-1);}; +void() dfury_magica12 =[ $magica13, dfury_magica13] {dfury_attachment_update();dfury_magica_shot(0);}; +void() dfury_magica13 =[ $magica14, dfury_magica14] {dfury_attachment_update();dfury_magica_shot(1);}; +void() dfury_magica14 =[ $magica15, dfury_magica15] {dfury_attachment_update();dfury_magica_shot(2);}; +void() dfury_magica15 =[ $magica16, dfury_run1] {}; + +//---------------------------------------------------------------------- +// Magic Attack B - 3 x rockets launched in an arc +// Block pain function from interrupting magic attack +void() dfury_magicb1 =[ $magicb1, dfury_magicb2 ] {self.pain_finished = time + 2;}; +void() dfury_magicb2 =[ $magicb2, dfury_magicb3 ] {ai_face();dfury_attachment_setup(1);}; +void() dfury_magicb3 =[ $magicb3, dfury_magicb4 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb4 =[ $magicb4, dfury_magicb5 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb5 =[ $magicb5, dfury_magicb6 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb6 =[ $magicb6, dfury_magicb7 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb7 =[ $magicb7, dfury_magicb8 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb8 =[ $magicb8, dfury_magicb9 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb9 =[ $magicb9, dfury_magicb10] {ai_face();dfury_attachment_update();dfury_magicb_shot();}; +void() dfury_magicb10 =[ $magicb10, dfury_magicb11] {dfury_attachment_update();}; +void() dfury_magicb11 =[ $magicb11, dfury_magicb12] {}; +void() dfury_magicb12 =[ $magicb12, dfury_magicb13] {}; +void() dfury_magicb13 =[ $magica13, dfury_run1] {}; + +//---------------------------------------------------------------------- +// MagicB is explosive so only use if there is range available +// Otherwise randomly pick between the two types (spikes/rockets) +//---------------------------------------------------------------------- +void() dfury_magic = +{ + SUB_AttackFinished (2 + random()); + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_JUMPFURYNEAR) dfury_magica1(); + else { + if (random() < 0.2) dfury_magica1(); + else dfury_magicb1(); + } +}; + +//============================================================================ +void() dfury_painA1 =[ $painA1, dfury_painA2 ] {}; +void() dfury_painA2 =[ $painA2, dfury_painA3 ] {}; +void() dfury_painA3 =[ $painA3, dfury_painA4 ] {}; +void() dfury_painA4 =[ $painA4, dfury_painA5 ] {}; +void() dfury_painA5 =[ $painA5, dfury_run1 ] {}; + +//---------------------------------------------------------------------- +void() dfury_painD1 =[ $painD1, dfury_painD2 ] {}; +void() dfury_painD2 =[ $painD2, dfury_painD3 ] {}; +void() dfury_painD3 =[ $painD3, dfury_painD4 ] {}; +void() dfury_painD4 =[ $painD4, dfury_painD5 ] {monster_footstep(FALSE); }; +void() dfury_painD5 =[ $painD5, dfury_painD6 ] {}; +void() dfury_painD6 =[ $painD6, dfury_painD7 ] {}; +void() dfury_painD7 =[ $painD7, dfury_painD8 ] {}; +void() dfury_painD8 =[ $painD8, dfury_painD9 ] {monster_footstep(FALSE); }; +void() dfury_painD9 =[ $painD9, dfury_painD10 ] {}; +void() dfury_painD10 =[ $painD10, dfury_painD11 ] {}; +void() dfury_painD11 =[ $painD11, dfury_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dfury_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.9) dfury_painA1 (); // classic, body recoil + else { + dfury_painD1 (); // Cool stumble + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dfury_painD1 (); + } + } +}; + +//============================================================================ +void() dfury_die1 =[ $death2, dfury_die2 ] {ai_forward(10);}; +void() dfury_die2 =[ $death3, dfury_die3 ] {monster_check_gib();ai_forward(8);}; +void() dfury_die3 =[ $death4, dfury_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dfury_die4 =[ $death5, dfury_die5 ] {}; +void() dfury_die5 =[ $death6, dfury_die6 ] {}; +void() dfury_die6 =[ $death7, dfury_die7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dfury_die7 =[ $death8, dfury_die8 ] {}; +void() dfury_die8 =[ $death9, dfury_die9 ] {ai_forward(10);}; +void() dfury_die9 =[ $death10, dfury_die10 ] {ai_forward(11);}; +void() dfury_die10 =[ $death11, dfury_die11 ] {}; +void() dfury_die11 =[ $death12, dfury_die12 ] {}; +void() dfury_die12 =[ $death13, dfury_die13 ] {}; +void() dfury_die13 =[ $death14, dfury_die14 ] {}; +void() dfury_die14 =[ $death15, dfury_die15 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dfury_die15 =[ $death16, dfury_die16 ] {monster_death_postcheck();}; +void() dfury_die16 =[ $death17, dfury_die16 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dfury_dieb1 =[ $deathb1, dfury_dieb2 ] {}; +void() dfury_dieb2 =[ $deathb2, dfury_dieb3 ] {monster_check_gib();}; +void() dfury_dieb3 =[ $deathb3, dfury_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dfury_dieb4 =[ $deathb4, dfury_dieb5 ] {}; +void() dfury_dieb5 =[ $deathb5, dfury_dieb6 ] {}; +void() dfury_dieb6 =[ $deathb6, dfury_dieb7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dfury_dieb7 =[ $deathb7, dfury_dieb8 ] {}; +void() dfury_dieb8 =[ $deathb8, dfury_dieb9 ] {}; +void() dfury_dieb9 =[ $deathb9, dfury_dieb10] {}; +void() dfury_dieb10=[ $deathb10, dfury_dieb11] {}; +void() dfury_dieb11=[ $deathb11, dfury_dieb12] {}; +void() dfury_dieb12=[ $deathb12, dfury_dieb13] {}; +void() dfury_dieb13=[ $deathb13, dfury_dieb14] {monster_death_postcheck();}; +void() dfury_dieb14=[ $deathb14, dfury_dieb14] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dfury_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) dfury_die1 (); + else dfury_dieb1 (); + } +}; + +//============================================================================ +void() dfury_sword_sound = +{ + self.weaponstate = random(); + if (self.weaponstate < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.weaponstate < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.weaponstate < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +//============================================================================ +void(float soundtype) dfury_grunt_sound = +{ + if (soundtype == DFURY_SOUND_PULLAPART) + sound (self, CHAN_WEAPON, "dknight/dfury_grunt3.wav", 1, ATTN_NORM); + else if (soundtype == DFURY_SOUND_OVERSMASH) + sound (self, CHAN_WEAPON, "dknight/dfury_grunt4.wav", 1, ATTN_NORM); + else if (soundtype == DFURY_SOUND_JUMP) + sound (self, CHAN_WEAPON, "dknight/dfury_leap.wav", 1, ATTN_NORM); + else { + if (soundtype == DFURY_SOUND_OPTIONAL && random() < 0.8) return; + self.weaponstate = random(); + self.weaponswitch = 0.6 + random()*0.4; + if (self.weaponstate < 0.25) sound (self, CHAN_WEAPON, "dknight/dfury_grunt1.wav", self.weaponswitch, ATTN_NORM); + else if (self.weaponstate < 0.5) sound (self, CHAN_WEAPON, "dknight/dfury_grunt2.wav", self.weaponswitch, ATTN_NORM); + else if (self.weaponstate < 0.75) sound (self, CHAN_WEAPON, "dknight/dfury_grunt3.wav", self.weaponswitch, ATTN_NORM); + else sound (self, CHAN_WEAPON, "dknight/dfury_grunt4.wav", self.weaponswitch, ATTN_NORM); + } +}; + +/*====================================================================== +QUAKED monster_dfury (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dfury = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dfury.mdl"; + self.headmdl = "progs/h_dfury.mdl"; + self.weaponglow = "progs/mon_dfury_glow.mdl"; + self.gib1mdl = "progs/w_dfurysword1.mdl"; // Unique sword L + self.gib2mdl = "progs/w_dfurysword2.mdl"; // Unique sword R + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.weaponglow); // Glowing magical swords + precache_model (MODEL_PROJ_FURY1); // Vore spike ball with smoke trail + precache_model (MODEL_PROJ_FURY2); // Wizard spit with smoke trail + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib3skin = 2; + self.gib1sound = self.gib2sound = GIB_IMPACT_METALA; + + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + precache_sound ("hknight/death1.wav"); + self.pain_sound = "hknight/pain1.wav"; + precache_sound (self.pain_sound); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + // Double sword swipe (like death knight++) + self.sight_sound = "dknight/dfury_sight.wav"; + precache_sound (self.sight_sound); + + // Heavy thud sound + self.meleehitsound = GIB_SOUND_HEAVY2; + precache_sound (self.meleehitsound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // New grunt sounds during combat + precache_sound ("dknight/dfury_grunt1.wav"); + precache_sound ("dknight/dfury_grunt2.wav"); + precache_sound ("dknight/dfury_grunt3.wav"); + precache_sound ("dknight/dfury_grunt4.wav"); + precache_sound ("dknight/dfury_leap.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_SHALGRN); // Green voreball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 400; + self.gibhealth = -50; + self.gibbed = FALSE; + self.pain_flinch = 80; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // High pain level + if (!self.infightextra) self.infightextra = 2; // 2x infighting dmg + self.steptype = FS_TYPEMEDIUM; + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEFRONT; // Smash attack + self.meleeoffset = '24 0 16'; // Jump attack offset + self.attack_offset = '20 0 10'; // Average of both attacks + self.deathstring = " was sliced by a Fury Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DFuryCheckAttack; + self.th_stand = dfury_standL1; + self.th_walk = dfury_walk1; + self.th_run = dfury_run1; + self.th_melee = dfury_melee; + self.th_missile = dfury_magic; + self.th_pain = dfury_pain; + self.th_die = dfury_die; + self.th_jump = dfury_lunge1; + self.th_jumpexit = dfury_lunge9; + self.th_charge = dfury_watk1; + self.th_slide = dfury_slice1; + + self.meleeattack = rint(random()*5); + self.weaponswitch = time + 5; + + self.classtype = CT_MONDFURY; + self.classgroup = CG_DCAPTAIN; + self.classmove = MON_MOVEWALK; + + // Setup magic glowing sword effect + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setorigin(self.attachment, self.origin); + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_dguard.qc b/QC_other/QC_arcane/mon_dguard.qc new file mode 100644 index 00000000..67eb83f3 --- /dev/null +++ b/QC_other/QC_arcane/mon_dguard.qc @@ -0,0 +1,536 @@ +/*============================================================================== +DEATH GUARD (low health) +==============================================================================*/ +$cd id1/models/dguard +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// (013 - 024) Stand idle - Shoulder hunch +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 + +// (025 - 048) Stand idle - Quick look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 + +// (049 - 072) Stand idle - checking sword +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 + +// (073 - 095) Stand idle - poke sword at the ground +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 standD21 standD22 standD23 + +// (096 - 109) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (110 - 115) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (116 - 130) Slice (one hand slashing run attack) (file=swing) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 slice15 + +// (131 - 145) Smash (chop overhead to ground) (file=chop) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (146 - 167) W_Attack (two handed slashing attack) (file=slash) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 + +// Pain animations A = Slow (168 - 172), D = Stagger (173 - 183) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (184 - 195) Charging attack A - swinging sword left to right infront (file=char) +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 + +// (196 - 207) Death FORWARD +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 deathA11 deathA12 + +// (208 - 227) Death BACKWARD - with cool sword wobble +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 deathB15 deathB16 +$frame deathB17 deathB18 deathB19 deathB20 + +// (228 - 241) Death FORWARD - more dramatic, platoon like +$frame deathC1 deathC2 deathC3 deathC4 deathC5 deathC6 deathC7 deathC8 +$frame deathC9 deathC10 deathC11 deathC12 deathC13 deathC14 + +// (242 - 256) Death SIDEWAYS - Similiar to original knights +$frame deathD1 deathD2 deathD3 deathD4 deathD5 deathD6 deathD7 deathD8 +$frame deathD9 deathD10 deathD11 deathD12 deathD13 deathD14 deathD15 + +void() dguard_sword_sound; + +//=========================================================================== +void() dguard_standA1 =[ $standA1, dguard_standA2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standA2 =[ $standA2, dguard_standA3 ] {ai_stand();}; +void() dguard_standA3 =[ $standA3, dguard_standA4 ] {ai_stand();}; +void() dguard_standA4 =[ $standA4, dguard_standA5 ] {ai_stand();}; +void() dguard_standA5 =[ $standA5, dguard_standA6 ] {ai_stand();}; +void() dguard_standA6 =[ $standA6, dguard_standA7 ] {ai_stand();}; +void() dguard_standA7 =[ $standA7, dguard_standA8 ] {ai_stand();}; +void() dguard_standA8 =[ $standA8, dguard_standA9 ] {ai_stand();}; +void() dguard_standA9 =[ $standA9, dguard_standA10 ] {ai_stand();}; +void() dguard_standA10 =[ $standA10, dguard_standA11 ] {ai_stand();}; +void() dguard_standA11 =[ $standA11, dguard_standA12 ] {ai_stand();}; +void() dguard_standA12 =[ $standA12, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_standB1 =[ $standB1, dguard_standB2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standB2 =[ $standB2, dguard_standB3 ] {ai_stand();}; +void() dguard_standB3 =[ $standB3, dguard_standB4 ] {ai_stand();}; +void() dguard_standB4 =[ $standB4, dguard_standB5 ] {ai_stand();}; +void() dguard_standB5 =[ $standB5, dguard_standB6 ] {ai_stand();}; +void() dguard_standB6 =[ $standB6, dguard_standB7 ] {ai_stand();}; +void() dguard_standB7 =[ $standB7, dguard_standB8 ] {ai_stand();}; +void() dguard_standB8 =[ $standB8, dguard_standB9 ] {ai_stand();}; +void() dguard_standB9 =[ $standB9, dguard_standB10 ] {ai_stand();}; +void() dguard_standB10 =[ $standB10, dguard_standB11 ] {ai_stand();}; +void() dguard_standB11 =[ $standB11, dguard_standB12 ] {ai_stand();}; +void() dguard_standB12 =[ $standB12, dguard_standB13 ] {ai_stand();}; +void() dguard_standB13 =[ $standB13, dguard_standB14 ] {ai_stand();}; +void() dguard_standB14 =[ $standB14, dguard_standB15 ] {ai_stand();}; +void() dguard_standB15 =[ $standB15, dguard_standB16 ] {ai_stand();}; +void() dguard_standB16 =[ $standB16, dguard_standB17 ] {ai_stand();}; +void() dguard_standB17 =[ $standB17, dguard_standB18 ] {ai_stand();}; +void() dguard_standB18 =[ $standB18, dguard_standB19 ] {ai_stand();}; +void() dguard_standB19 =[ $standB19, dguard_standB20 ] {ai_stand();}; +void() dguard_standB20 =[ $standB20, dguard_standB21 ] {ai_stand();}; +void() dguard_standB21 =[ $standB21, dguard_standB22 ] {ai_stand();}; +void() dguard_standB22 =[ $standB22, dguard_standB23 ] {ai_stand();}; +void() dguard_standB23 =[ $standB23, dguard_standB24 ] {ai_stand();}; +void() dguard_standB24 =[ $standB24, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_standC1 =[ $standC1, dguard_standC2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standC2 =[ $standC2, dguard_standC3 ] {ai_stand();}; +void() dguard_standC3 =[ $standC3, dguard_standC4 ] {ai_stand();}; +void() dguard_standC4 =[ $standC4, dguard_standC5 ] {ai_stand();}; +void() dguard_standC5 =[ $standC5, dguard_standC6 ] {ai_stand();}; +void() dguard_standC6 =[ $standC6, dguard_standC7 ] {ai_stand();}; +void() dguard_standC7 =[ $standC7, dguard_standC8 ] {ai_stand();}; +void() dguard_standC8 =[ $standC8, dguard_standC9 ] {ai_stand();}; +void() dguard_standC9 =[ $standC9, dguard_standC10 ] {ai_stand();}; +void() dguard_standC10 =[ $standC10, dguard_standC11 ] {ai_stand();}; +void() dguard_standC11 =[ $standC11, dguard_standC12 ] {ai_stand();}; +void() dguard_standC12 =[ $standC12, dguard_standC13 ] {ai_stand();}; +void() dguard_standC13 =[ $standC13, dguard_standC14 ] {ai_stand();}; +void() dguard_standC14 =[ $standC14, dguard_standC15 ] {ai_stand();}; +void() dguard_standC15 =[ $standC15, dguard_standC16 ] {ai_stand();}; +void() dguard_standC16 =[ $standC16, dguard_standC17 ] {ai_stand();}; +void() dguard_standC17 =[ $standC17, dguard_standC18 ] {ai_stand();}; +void() dguard_standC18 =[ $standC18, dguard_standC19 ] {ai_stand();}; +void() dguard_standC19 =[ $standC19, dguard_standC20 ] {ai_stand();}; +void() dguard_standC20 =[ $standC20, dguard_standC21 ] {ai_stand();}; +void() dguard_standC21 =[ $standC21, dguard_standC22 ] {ai_stand();}; +void() dguard_standC22 =[ $standC22, dguard_standC23 ] {ai_stand();}; +void() dguard_standC23 =[ $standC23, dguard_standC24 ] {ai_stand();}; +void() dguard_standC24 =[ $standC24, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_standD1 =[ $standD1, dguard_standD2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standD2 =[ $standD2, dguard_standD3 ] {ai_stand();}; +void() dguard_standD3 =[ $standD3, dguard_standD4 ] {ai_stand();}; +void() dguard_standD4 =[ $standD4, dguard_standD5 ] {ai_stand();}; +void() dguard_standD5 =[ $standD5, dguard_standD6 ] {ai_stand();}; +void() dguard_standD6 =[ $standD6, dguard_standD7 ] {ai_stand();}; +void() dguard_standD7 =[ $standD7, dguard_standD8 ] {ai_stand();}; +void() dguard_standD8 =[ $standD8, dguard_standD9 ] {ai_stand();}; +void() dguard_standD9 =[ $standD9, dguard_standD10 ] {ai_stand();}; +void() dguard_standD10 =[ $standD10, dguard_standD11 ] {ai_stand();}; +void() dguard_standD11 =[ $standD11, dguard_standD12 ] {ai_stand();}; +void() dguard_standD12 =[ $standD12, dguard_standD13 ] {ai_stand();}; +void() dguard_standD13 =[ $standD13, dguard_standD14 ] {ai_stand();}; +void() dguard_standD14 =[ $standD14, dguard_standD15 ] {ai_stand();}; +void() dguard_standD15 =[ $standD15, dguard_standD16 ] {ai_stand();}; +void() dguard_standD16 =[ $standD16, dguard_standD17 ] {ai_stand();}; +void() dguard_standD17 =[ $standD17, dguard_standD18 ] {ai_stand();}; +void() dguard_standD18 =[ $standD18, dguard_standD19 ] {ai_stand();}; +void() dguard_standD19 =[ $standD19, dguard_standD20 ] {ai_stand();}; +void() dguard_standD20 =[ $standD20, dguard_standD21 ] {ai_stand();}; +void() dguard_standD21 =[ $standD21, dguard_standD22 ] {ai_stand();}; +void() dguard_standD22 =[ $standD22, dguard_standD23 ] {ai_stand();}; +void() dguard_standD23 =[ $standD23, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_stand1 =[ $stand1, dguard_stand2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_stand();}; +void() dguard_stand2 =[ $stand2, dguard_stand3 ] {ai_stand();}; +void() dguard_stand3 =[ $stand3, dguard_stand4 ] {ai_stand();}; +void() dguard_stand4 =[ $stand4, dguard_stand5 ] {ai_stand();}; +void() dguard_stand5 =[ $stand5, dguard_stand6 ] {ai_stand();}; +void() dguard_stand6 =[ $stand6, dguard_stand7 ] {ai_stand();}; +void() dguard_stand7 =[ $stand7, dguard_stand8 ] {ai_stand();}; +void() dguard_stand8 =[ $stand8, dguard_stand9 ] {ai_stand();}; +void() dguard_stand9 =[ $stand9, dguard_stand10 ] {ai_stand();}; +void() dguard_stand10 =[ $stand10, dguard_stand11 ] {ai_stand();}; +void() dguard_stand11 =[ $stand11, dguard_stand12 ] {ai_stand();}; +void() dguard_stand12 =[ $stand12, dguard_stand1 ] { + if (random() < MON_IDLE_ANIMATION) { + self.lip = random(); + if (self.lip < 0.2) self.think = dguard_standD1; // Poke the ground + else if (self.lip < 0.4) self.think = dguard_standC1; // Look at weapon + else if (self.lip < 0.7) self.think = dguard_standA1; // Shoulder hunch + else self.think = dguard_standB1; // Look around + } + ai_stand(); +}; + +//=========================================================================== +void() dguard_walk1 =[ $walk1, dguard_walk2 ] { monster_footstep(FALSE); +self.idlebusy = FALSE; monster_idle_sound(); ai_walk(2);}; +void() dguard_walk2 =[ $walk2, dguard_walk3 ] {ai_walk(5);}; +void() dguard_walk3 =[ $walk3, dguard_walk4 ] {ai_walk(5);}; +void() dguard_walk4 =[ $walk4, dguard_walk5 ] {ai_walk(4);}; +void() dguard_walk5 =[ $walk5, dguard_walk6 ] {ai_walk(4);}; +void() dguard_walk6 =[ $walk6, dguard_walk7 ] {ai_walk(2);}; +void() dguard_walk7 =[ $walk7, dguard_walk8 ] {ai_walk(2);}; +void() dguard_walk8 =[ $walk8, dguard_walk9 ] {ai_walk(3); monster_footstep(FALSE);}; +void() dguard_walk9 =[ $walk9, dguard_walk10 ] {ai_walk(3);}; +void() dguard_walk10 =[ $walk10, dguard_walk11 ] {ai_walk(4);}; +void() dguard_walk11 =[ $walk11, dguard_walk12 ] {ai_walk(3);}; +void() dguard_walk12 =[ $walk12, dguard_walk13 ] {ai_walk(4);}; +void() dguard_walk13 =[ $walk13, dguard_walk14 ] {ai_walk(6);}; +void() dguard_walk14 =[ $walk14, dguard_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// 6 frames instead of 8 frames (16, 20, 7, 16, 20, 6) Missing 13+14 +// Added timing of 3rd/7th back to other frames + +void() dguard_run1 =[ $run1, dguard_run2 ] { + self.idlebusy = FALSE; monster_idle_sound(); ai_run (20); }; +void() dguard_run2 =[ $run2, dguard_run3 ] {monster_footstep(FALSE); ai_run(24);}; +void() dguard_run3 =[ $run3, dguard_run4 ] {ai_run(12);}; +void() dguard_run4 =[ $run4, dguard_run5 ] {ai_run(20);}; +void() dguard_run5 =[ $run5, dguard_run6 ] {monster_footstep(FALSE); ai_run(24);}; +void() dguard_run6 =[ $run6, dguard_run1 ] {ai_run(12);}; + +//=========================================================================== +// Melee Attack 1a - Slice (one hand slashing run attack) +// Knight - 11 frames (skipped 1, 6, 12, 15) + +void() dguard_runatk1 =[ $slice2, dguard_runatk2 ] {ai_charge(20);}; +void() dguard_runatk2 =[ $slice3, dguard_runatk3 ] {ai_charge_side();}; +void() dguard_runatk3 =[ $slice4, dguard_runatk4 ] {monster_footstep(FALSE); ai_charge_side();}; +void() dguard_runatk4 =[ $slice5, dguard_runatk5 ] {ai_charge_side(); dguard_sword_sound();}; +void() dguard_runatk5 =[ $slice7, dguard_runatk6 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatk6 =[ $slice8, dguard_runatk7 ] {ai_melee_side();}; +void() dguard_runatk7 =[ $slice9, dguard_runatk8 ] {ai_melee_side();}; +void() dguard_runatk8 =[ $slice10, dguard_runatk9 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatk9 =[ $slice11, dguard_runatk10 ] {ai_melee_side();}; +void() dguard_runatk10 =[ $slice13, dguard_runatk11 ] {monster_footstep(FALSE); ai_charge_side();}; +void() dguard_runatk11 =[ $slice14, dguard_run1 ] {ai_charge(10);}; + +//=========================================================================== +// Melee Attack 1b - Charging attack A - swinging sword left to right infront +// Knight - 11 frames (skipped 1) + +void() dguard_runatkB1 =[ $char_a2, dguard_runatkB2 ] {monster_footstep(FALSE); ai_charge(20); dguard_sword_sound();}; +void() dguard_runatkB2 =[ $char_a3, dguard_runatkB3 ] {ai_charge_side();}; +void() dguard_runatkB3 =[ $char_a4, dguard_runatkB4 ] {ai_charge_side();}; +void() dguard_runatkB4 =[ $char_a5, dguard_runatkB5 ] {monster_footstep(FALSE); ai_charge_side();}; +void() dguard_runatkB5 =[ $char_a6, dguard_runatkB6 ] {ai_melee_side();}; +void() dguard_runatkB6 =[ $char_a7, dguard_runatkB7 ] {ai_melee_side(); dguard_sword_sound();}; +void() dguard_runatkB7 =[ $char_a8, dguard_runatkB8 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatkB8 =[ $char_a9, dguard_runatkB9 ] {ai_melee_side();}; +void() dguard_runatkB9 =[ $char_a10, dguard_runatkB10 ] {ai_melee_side();}; +void() dguard_runatkB10=[ $char_a11, dguard_runatkB11 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatkB11=[ $char_a12, dguard_run1 ] {ai_charge(10);}; + +//=========================================================================== +// Melee Attack 2a - Smash (chop overhead to ground) +// Knight - 11 frames (skipped (1, 11, 14, 15) + +void() dguard_atk1 =[ $smash2, dguard_atk2 ] {ai_charge(0);}; +void() dguard_atk2 =[ $smash3, dguard_atk3 ] {ai_charge(7);}; +void() dguard_atk3 =[ $smash4, dguard_atk4 ] {monster_footstep(FALSE); ai_charge(4);}; +void() dguard_atk4 =[ $smash5, dguard_atk5 ] {ai_charge(0);}; +void() dguard_atk5 =[ $smash6, dguard_atk6 ] {ai_charge(3);}; +void() dguard_atk6 =[ $smash7, dguard_atk7 ] {ai_charge(4); ai_melee(); dguard_sword_sound();}; +void() dguard_atk7 =[ $smash8, dguard_atk8 ] {monster_footstep(FALSE); ai_charge(1); ai_melee();}; +void() dguard_atk8 =[ $smash9, dguard_atk9 ] {ai_charge(3); ai_melee();}; +void() dguard_atk9 =[ $smash10, dguard_atk10] {ai_charge(1);}; +void() dguard_atk10=[ $smash12, dguard_atk11] {ai_charge(1);}; +void() dguard_atk11=[ $smash13, dguard_run1 ] {ai_charge(5);}; + +//============================================================================ +// Melee Attack 2b - W_Attack (two handed slashing attack) + +void() dguard_atkB1 =[ $w_attack2, dguard_atkB2 ] {monster_footstep(FALSE); ai_charge(0);}; +void() dguard_atkB2 =[ $w_attack3, dguard_atkB3 ] {ai_charge(7);}; +void() dguard_atkB3 =[ $w_attack4, dguard_atkB4 ] {ai_charge(4);}; +void() dguard_atkB4 =[ $w_attack5, dguard_atkB5 ] {ai_charge(0);}; +void() dguard_atkB5 =[ $w_attack6, dguard_atkB6 ] {ai_charge(3); dguard_sword_sound();}; +void() dguard_atkB6 =[ $w_attack7, dguard_atkB7 ] {monster_footstep(FALSE); ai_charge(4); ai_melee();}; +void() dguard_atkB7 =[ $w_attack8, dguard_atkB8 ] {ai_charge(1); ai_melee();}; +void() dguard_atkB8 =[ $w_attack9, dguard_atkB9 ] {ai_charge(3); ai_melee();}; +void() dguard_atkB9 =[ $w_attack10, dguard_atkB10] {ai_charge(1);}; +void() dguard_atkB10= [ $w_attack11, dguard_atkB11] {ai_charge(1);}; +void() dguard_atkB11 =[ $w_attack12, dguard_atkB12 ] {ai_charge(0);}; +void() dguard_atkB12 =[ $w_attack13, dguard_atkB13 ] {ai_charge(7);}; +void() dguard_atkB13 =[ $w_attack14, dguard_atkB14 ] {ai_charge(4);}; +void() dguard_atkB14 =[ $w_attack15, dguard_atkB15 ] {ai_charge(0); dguard_sword_sound();}; +void() dguard_atkB15 =[ $w_attack16, dguard_atkB16 ] {ai_charge(3);}; +void() dguard_atkB16 =[ $w_attack17, dguard_atkB17 ] {monster_footstep(FALSE); ai_charge(4); ai_melee();}; +void() dguard_atkB17 =[ $w_attack18, dguard_atkB18 ] {ai_charge(1); ai_melee();}; +void() dguard_atkB18 =[ $w_attack19, dguard_atkB19 ] {ai_charge(3); ai_melee();}; +void() dguard_atkB19 =[ $w_attack20, dguard_atkB20] {ai_charge(1);}; +void() dguard_atkB20=[ $w_attack21, dguard_atkB21] {ai_charge(1);}; +void() dguard_atkB21=[ $w_attack22, dguard_run1 ] {ai_charge(5);}; + +//============================================================================ +// Cycle between melee attacks +// Attack 1a - Slice (one hand slashing run attack) +// Attack 1b - Char_A (swinging sword left to right infront) +// Attack 2a - Smash (chop overhead to ground) +// Attack 2b - W_Attack (two handed slashing attack) + +void() dguard_melee = +{ + local float len; + + // decide if now is a good swing time + len = vlen(self.enemy.origin + self.enemy.view_ofs - (self.origin + self.view_ofs)); + + // Close melee attack 1a, 1b (slice and char_a) + if ( len < MONAI_MELEEKNIGHT ) { + // Randomly pick between attacks + if (random() > 0.5) dguard_atk1(); + else dguard_atkB1(); + } + // Running attack 2a, 2b (smash, w_attack (2x attacks in one)) + else { + if (random() > 0.5) dguard_runatk1(); + else dguard_runatkB1(); + } +}; + +//============================================================================ +void() dguard_painA1 =[ $painA1, dguard_painA2 ] {}; +void() dguard_painA2 =[ $painA2, dguard_painA3 ] {}; +void() dguard_painA3 =[ $painA3, dguard_painA4 ] {}; +void() dguard_painA4 =[ $painA4, dguard_painA5 ] {}; +void() dguard_painA5 =[ $painA5, dguard_run1 ] {}; +//---------------------------------------------------------------------- +void() dguard_painD1 =[ $painD1, dguard_painD2 ] {}; +void() dguard_painD2 =[ $painD2, dguard_painD3 ] {}; +void() dguard_painD3 =[ $painD3, dguard_painD4 ] {}; +void() dguard_painD4 =[ $painD4, dguard_painD5 ] {monster_footstep(FALSE);}; +void() dguard_painD5 =[ $painD5, dguard_painD6 ] {}; +void() dguard_painD6 =[ $painD6, dguard_painD7 ] {}; +void() dguard_painD7 =[ $painD7, dguard_painD8 ] {}; +void() dguard_painD8 =[ $painD8, dguard_painD9 ] {monster_footstep(FALSE);}; +void() dguard_painD9 =[ $painD9, dguard_painD10 ] {}; +void() dguard_painD10=[ $painD10, dguard_painD11 ] {}; +void() dguard_painD11=[ $painD11, dguard_run1 ] {}; +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dguard_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.85) dguard_painA1 (); // classic, body recoil + else { + dguard_painD1 (); // Cool stumble, hand over mouth + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +void() dguard_dieA1 =[ $deathA1, dguard_dieA2 ] {ai_forward(5);}; +void() dguard_dieA2 =[ $deathA2, dguard_dieA3 ] {monster_check_gib();ai_forward(8);}; +void() dguard_dieA3 =[ $deathA3, dguard_dieA4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dguard_dieA4 =[ $deathA4, dguard_dieA5 ] {}; +void() dguard_dieA5 =[ $deathA5, dguard_dieA6 ] {}; +void() dguard_dieA6 =[ $deathA6, dguard_dieA7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dguard_dieA7 =[ $deathA7, dguard_dieA8 ] {}; +void() dguard_dieA8 =[ $deathA8, dguard_dieA9 ] {ai_forward(10);}; +void() dguard_dieA9 =[ $deathA9, dguard_dieA10 ] {ai_forward(11);}; +void() dguard_dieA10 =[ $deathA10, dguard_dieA11 ] {}; +void() dguard_dieA11 =[ $deathA11, dguard_dieA12 ] {monster_death_postcheck();}; +void() dguard_dieA12 =[ $deathA12, dguard_dieA12 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dguard_dieB1 =[ $deathB1, dguard_dieB2 ] {}; +void() dguard_dieB2 =[ $deathB2, dguard_dieB3 ] {monster_check_gib();}; +void() dguard_dieB3 =[ $deathB3, dguard_dieB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dguard_dieB4 =[ $deathB4, dguard_dieB5 ] {}; +void() dguard_dieB5 =[ $deathB5, dguard_dieB6 ] {}; +void() dguard_dieB6 =[ $deathB6, dguard_dieB7 ] {}; +void() dguard_dieB7 =[ $deathB7, dguard_dieB8 ] {}; +void() dguard_dieB8 =[ $deathB8, dguard_dieB9 ] {}; +void() dguard_dieB9 =[ $deathB9, dguard_dieB10 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dguard_dieB10 =[ $deathB10, dguard_dieB11 ] {}; +void() dguard_dieB11 =[ $deathB11, dguard_dieB12 ] {}; +void() dguard_dieB12 =[ $deathB12, dguard_dieB13 ] {}; +void() dguard_dieB13 =[ $deathB13, dguard_dieB14 ] {}; +void() dguard_dieB14 =[ $deathB14, dguard_dieB15 ] {}; +void() dguard_dieB15 =[ $deathB15, dguard_dieB16 ] {}; +void() dguard_dieB16 =[ $deathB16, dguard_dieB17 ] {}; +void() dguard_dieB17 =[ $deathB17, dguard_dieB18 ] {}; +void() dguard_dieB18 =[ $deathB18, dguard_dieB19 ] {}; +void() dguard_dieB19 =[ $deathB19, dguard_dieB20 ] {monster_death_postcheck();}; +void() dguard_dieB20 =[ $deathB20, dguard_dieB20 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dguard_dieC1 =[ $deathC1, dguard_dieC2 ] {ai_forward(5);}; +void() dguard_dieC2 =[ $deathC2, dguard_dieC3 ] {monster_check_gib();ai_forward(8);}; +void() dguard_dieC3 =[ $deathC3, dguard_dieC4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dguard_dieC4 =[ $deathC4, dguard_dieC5 ] {}; +void() dguard_dieC5 =[ $deathC5, dguard_dieC6 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dguard_dieC6 =[ $deathC6, dguard_dieC7 ] {}; +void() dguard_dieC7 =[ $deathC7, dguard_dieC8 ] {}; +void() dguard_dieC8 =[ $deathC8, dguard_dieC9 ] {ai_forward(10);}; +void() dguard_dieC9 =[ $deathC9, dguard_dieC10 ] {ai_forward(11);}; +void() dguard_dieC10 =[ $deathC10, dguard_dieC11 ] {}; +void() dguard_dieC11 =[ $deathC11, dguard_dieC12 ] {}; +void() dguard_dieC12 =[ $deathC12, dguard_dieC13 ] {}; +void() dguard_dieC13 =[ $deathC13, dguard_dieC14 ] {monster_death_postcheck();}; +void() dguard_dieC14 =[ $deathC14, dguard_dieC14 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +// The sideways death happens to quick and looks odd when finished +// Skipping this death sequence +void() dguard_dieD1 =[ $deathD1, dguard_dieD2 ] {}; +void() dguard_dieD2 =[ $deathD2, dguard_dieD3 ] {monster_check_gib();}; +void() dguard_dieD3 =[ $deathD3, dguard_dieD4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dguard_dieD4 =[ $deathD4, dguard_dieD5 ] {}; +void() dguard_dieD5 =[ $deathD5, dguard_dieD6 ] {}; +void() dguard_dieD6 =[ $deathD6, dguard_dieD7 ] {}; +void() dguard_dieD7 =[ $deathD7, dguard_dieD8 ] {}; +void() dguard_dieD8 =[ $deathD8, dguard_dieD9 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dguard_dieD9 =[ $deathD9, dguard_dieD10 ] {}; +void() dguard_dieD10 =[ $deathD10, dguard_dieD11 ] {}; +void() dguard_dieD11 =[ $deathD11, dguard_dieD12 ] {}; +void() dguard_dieD12 =[ $deathD12, dguard_dieD13 ] {}; +void() dguard_dieD13 =[ $deathD13, dguard_dieD14 ] {}; +void() dguard_dieD14 =[ $deathD14, dguard_dieD15 ] {monster_death_postcheck();}; +void() dguard_dieD15 =[ $deathD15, dguard_dieD15 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dguard_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + if (random() > 0.75) dguard_dieC1 (); // Forward - platoon like + else if (random() > 0.5) dguard_dieA1 (); // Forward - standard + else dguard_dieB1 (); // Backward - standard + } +}; + +//============================================================================ +void() dguard_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +/*====================================================================== +QUAKED monster_dguard (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dguard = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dguard.mdl"; + self.headmdl = "progs/h_dguard.mdl"; // Large head + self.gib1mdl = "progs/w_dguardsword.mdl"; // Unique sword + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = ""; + if (random() < 0.5) self.gib3mdl = ""; + + self.idle_sound = "knight/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("knight/kdeath.wav"); + self.pain_sound = "knight/khurt.wav"; + precache_sound (self.pain_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.sight_sound = "knight/ksight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 30; + self.gibhealth = -35; + self.gibbed = FALSE; + self.pain_flinch = 20; + self.steptype = FS_TYPEMEDIUM; + self.deathstring = " was chopped up by a Death Guard\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = dguard_stand1; + self.th_walk = dguard_walk1; + self.th_run = dguard_run1; + self.th_melee = dguard_melee; + self.th_pain = dguard_pain; + self.th_die = dguard_die; + + self.classtype = CT_MONDGUARD; + self.classgroup = CG_KNIGHT; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_dguardquoth.qc b/QC_other/QC_arcane/mon_dguardquoth.qc new file mode 100644 index 00000000..6f8ed4eb --- /dev/null +++ b/QC_other/QC_arcane/mon_dguardquoth.qc @@ -0,0 +1,419 @@ +/*============================================================================== + DEATH GUARD (Originally from Quoth - Kell/Necros/Preach) + * QC was created for AD mappers to play with in their own projects + * Original Quoth model/sounds not included with main MOD + + Interesting QC traits + * Uses the Char B animation to get closer to enemies quicker + * Melee/Range attacks are dis-used magic animations + * Range attack does not track enemies when not in sight + * Melee attack is single high damage animation frame + * Has large amount of sight sounds like enforcers + + QUOTH assets required to get this monster working in AD + (model's in 'progs' and wav's in 'sound' sub directories) + * dguard.mdl -> mon_dguardq.mdl (rename file) + * h_dguard.mdl -> h_dguardq.mdl (rename file) + * fireball.mdl -> proj_dguardq.mdl (rename file) + * dguard/idle.wav, dguard/fire.wav, dguard/hit.wav, dguard/slash.wav + * dguard/slhit.wav, dguard/slmiss1.wav, dguard/slmiss2.wav + * dguard/sight1.wav, dguard/sight2.wav, dguard/sight3.wav, dguard/sight4.wav + * dguard/pain1.wav, dguard/pain2.wav, dguard/death1.wav, dguard/death2.wav + +==============================================================================*/ +// 000-008 +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +// 009-028 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +// 029-036 +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// 037-041 +$frame pain1 pain2 pain3 pain4 pain5 + +// 042-053 +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// 054-062 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +// 063-078 (not used) +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +// 079-092 (Melee swing over head attack) +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +// 093-105 (Magic Fireball attack) +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// 106-111 (Movement between range and melee) +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// 112-121 (not used) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +// 122-132 (not used) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +// 133-154 (not used) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +// 155-165 (not used) +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +void() dguardq_sword_sound; + +//=========================================================================== +void() dguardq_stand1 =[ $stand1, dguardq_stand2 ] {monster_idle_sound(); ai_stand();}; +void() dguardq_stand2 =[ $stand2, dguardq_stand3 ] {ai_stand();}; +void() dguardq_stand3 =[ $stand3, dguardq_stand4 ] {ai_stand();}; +void() dguardq_stand4 =[ $stand4, dguardq_stand5 ] {ai_stand();}; +void() dguardq_stand5 =[ $stand5, dguardq_stand6 ] {ai_stand();}; +void() dguardq_stand6 =[ $stand6, dguardq_stand7 ] {ai_stand();}; +void() dguardq_stand7 =[ $stand7, dguardq_stand8 ] {ai_stand();}; +void() dguardq_stand8 =[ $stand8, dguardq_stand9 ] {ai_stand();}; +void() dguardq_stand9 =[ $stand9, dguardq_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguardq_walk1 =[ $walk1, dguardq_walk2 ] {monster_idle_sound(); ai_walk(2);}; +void() dguardq_walk2 =[ $walk2, dguardq_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dguardq_walk3 =[ $walk3, dguardq_walk4 ] {ai_walk(5);}; +void() dguardq_walk4 =[ $walk4, dguardq_walk5 ] {ai_walk(4);}; +void() dguardq_walk5 =[ $walk5, dguardq_walk6 ] {ai_walk(4);}; +void() dguardq_walk6 =[ $walk6, dguardq_walk7 ] {ai_walk(2);}; +void() dguardq_walk7 =[ $walk7, dguardq_walk8 ] {ai_walk(2);}; +void() dguardq_walk8 =[ $walk8, dguardq_walk9 ] {ai_walk(3);}; +void() dguardq_walk9 =[ $walk9, dguardq_walk10 ] {ai_walk(3);}; +void() dguardq_walk10 =[ $walk10, dguardq_walk11 ] {ai_walk(4);}; +void() dguardq_walk11 =[ $walk11, dguardq_walk12 ] {monster_footstep(FALSE); ai_walk(3);}; +void() dguardq_walk12 =[ $walk12, dguardq_walk13 ] {ai_walk(4);}; +void() dguardq_walk13 =[ $walk13, dguardq_walk14 ] {ai_walk(6);}; +void() dguardq_walk14 =[ $walk14, dguardq_walk15 ] {ai_walk(2);}; +void() dguardq_walk15 =[ $walk15, dguardq_walk16 ] {ai_walk(2);}; +void() dguardq_walk16 =[ $walk16, dguardq_walk17 ] {ai_walk(4);}; +void() dguardq_walk17 =[ $walk17, dguardq_walk18 ] {ai_walk(3);}; +void() dguardq_walk18 =[ $walk18, dguardq_walk19 ] {ai_walk(3);}; +void() dguardq_walk19 =[ $walk19, dguardq_walk20 ] {ai_walk(3);}; +void() dguardq_walk20 =[ $walk20, dguardq_walk1 ] {ai_walk(2);}; + +//---------------------------------------------------------------------- +void() dguardq_run1 =[ $run1, dguardq_run2 ] {monster_idle_sound();ai_run(20);}; +void() dguardq_run2 =[ $run2, dguardq_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() dguardq_run3 =[ $run3, dguardq_run4 ] {ai_run(18);}; +void() dguardq_run4 =[ $run4, dguardq_run5 ] {ai_run(16);}; +void() dguardq_run5 =[ $run5, dguardq_run6 ] {ai_run(14);}; +void() dguardq_run6 =[ $run6, dguardq_run7 ] {monster_footstep(FALSE); ai_run(25);}; +void() dguardq_run7 =[ $run7, dguardq_run8 ] {ai_run(21);}; +void() dguardq_run8 =[ $run8, dguardq_run1 ] {ai_run(13);}; + +//============================================================================ +// Melee attack (over head attack) +//---------------------------------------------------------------------- +void() dguardq_smashforward = { ai_face(); ai_forward(1); }; + +//---------------------------------------------------------------------- +void() dguardq_meleesmash = +{ + local float melee_dmg; + + melee_dmg = 30; + // Always Damage any breakables + ai_damagebreakable(melee_dmg * 3); + + // Check range and can damage? (bleed) + if (ai_checkmelee(MONAI_MELEEDGUARDQ) && CanDamage (self.enemy, self)) { + // If the enemy health is less than the melee damage, gib them + if (self.enemy.health < melee_dmg) melee_dmg = melee_dmg * 3; + T_Damage (self.enemy, self, self, melee_dmg, DAMARMOR); + + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Hit something, impact noise + sound(self, CHAN_WEAPON, "dguard/slhit.wav", 1, ATTN_NORM); + } + else { + // Missed enemy - clang! + if (random() < 0.5) + sound(self, CHAN_WEAPON, "dguard/slmiss1.wav", 1, ATTN_NORM); + else sound(self, CHAN_WEAPON, "dguard/slmiss2.wav", 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +void() dguardq_smash1 =[ $magica1, dguardq_smash2 ] { + // Always reset state (prevents double melee attack) + self.attack_state = AS_STRAIGHT; + sound(self, CHAN_VOICE, "dguard/slash.wav", 1, ATTN_NORM); + dguardq_smashforward(); +}; +void() dguardq_smash2 =[ $magica2, dguardq_smash3 ] {dguardq_smashforward();}; +void() dguardq_smash3 =[ $magica3, dguardq_smash4 ] {dguardq_smashforward();}; +void() dguardq_smash4 =[ $magica4, dguardq_smash5 ] {dguardq_smashforward();}; +void() dguardq_smash5 =[ $magica5, dguardq_smash6 ] {dguardq_smashforward();}; +void() dguardq_smash6 =[ $magica6, dguardq_smash7 ] {dguardq_smashforward();}; +void() dguardq_smash7 =[ $magica7, dguardq_smash8 ] {dguardq_smashforward();}; +void() dguardq_smash8 =[ $magica8, dguardq_smash9 ] {dguardq_smashforward();}; +void() dguardq_smash9 =[ $magica9, dguardq_smash10 ] {dguardq_smashforward();}; +void() dguardq_smash10 =[ $magica10, dguardq_smash11 ] { + dguardq_smashforward(); + dguardq_meleesmash(); +}; +void() dguardq_smash11 =[ $magica11, dguardq_smash12 ] {}; +void() dguardq_smash12 =[ $magica12, dguardq_smash13 ] {}; +void() dguardq_smash13 =[ $magica13, dguardq_smash14 ] {}; +void() dguardq_smash14 =[ $magica14, dguardq_run1 ] {ai_face();}; + +//============================================================================ +// Melee charging attack (only uses B) +//============================================================================ +void() dguardq_char_b1 = [ $char_b1, dguardq_char_b2 ] {ai_charge(24); ai_melee();}; +void() dguardq_char_b2 = [ $char_b2, dguardq_char_b3 ] {dguardq_sword_sound(); ai_charge(29); ai_melee();}; +void() dguardq_char_b3 = [ $char_b3, dguardq_char_b4 ] {ai_charge(22); ai_melee();}; +void() dguardq_char_b4 = [ $char_b4, dguardq_char_b5 ] {monster_footstep(FALSE); ai_charge(20); ai_melee();}; +void() dguardq_char_b5 = [ $char_b5, dguardq_char_b6 ] {ai_charge(18); ai_melee();}; +void() dguardq_char_b6 = [ $char_b6, dguardq_run1 ] {ai_charge(20); ai_melee();}; + +//============================================================================ +// RANGE - FIREBALL (Slow and high damage) +//============================================================================ +void() dguardq_fireball = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + // If cannot see enemy, instantly go back to run animation + if ( !visxray(SUB_entEnemyTarget(), self.attack_offset, '0 0 -16', FALSE) ) { + self.think = self.th_run; + } + + // Light up knight and work out attack angle + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Aim low to catch players with splash damage + dir = self.attack_track - '0 0 16'; + vec = normalize(dir - org); + + // Variable rocket speed ( hard = baseline ) + self.attack_speed = SPEED_DGQFB + (skill * SPEED_DGQFBSKILL); + Launch_Missile (org, vec, '0 0 0', CT_PROJ_DGUARDQ, self.attack_speed); +}; +//---------------------------------------------------------------------- +// Magic attack B (pointing sword) - Fireball +void() dguardq_magicb1 =[ $magicb1, dguardq_magicb2 ] { + self.attack_track = self.enemy.origin; + sound(self, CHAN_WEAPON, "dguard/fire.wav", 1, ATTN_NORM); +}; +void() dguardq_magicb2 =[ $magicb2, dguardq_magicb3 ] {ai_trackenemy();}; +void() dguardq_magicb3 =[ $magicb3, dguardq_magicb4 ] {ai_trackenemy();}; +void() dguardq_magicb4 =[ $magicb4, dguardq_magicb5 ] {ai_trackenemy();}; +void() dguardq_magicb5 =[ $magicb5, dguardq_magicb6 ] {ai_trackenemy();}; +void() dguardq_magicb6 =[ $magicb6, dguardq_magicb7 ] {ai_trackenemy();}; +void() dguardq_magicb7 =[ $magicb7, dguardq_magicb8 ] {ai_trackenemy();}; +void() dguardq_magicb8 =[ $magicb8, dguardq_magicb9 ] {ai_trackenemy();}; +void() dguardq_magicb9 =[ $magicb9, dguardq_magicb10] { + ai_trackenemy();dguardq_fireball();}; +void() dguardq_magicb10 =[ $magicb10, dguardq_magicb11] {}; +void() dguardq_magicb11 =[ $magicb11, dguardq_magicb12] {}; +void() dguardq_magicb12 =[ $magicb12, dguardq_magicb13] {}; +void() dguardq_magicb13 =[ $magicb13, dguardq_run1] {ai_face();}; + +//============================================================================ +void() dguardq_pain1 =[ $pain1, dguardq_pain2 ] {}; +void() dguardq_pain2 =[ $pain2, dguardq_pain3 ] {}; +void() dguardq_pain3 =[ $pain3, dguardq_pain4 ] {}; +void() dguardq_pain4 =[ $pain4, dguardq_pain5 ] {}; +void() dguardq_pain5 =[ $pain5, dguardq_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dguardq_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1) dguardq_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.5; + self.axhitme = 0; + dguardq_pain1 (); + } + } +}; + +//============================================================================ +void() dguardq_die1 =[ $death1, dguardq_die2 ] {ai_forward(10);}; +void() dguardq_die2 =[ $death2, dguardq_die3 ] {monster_check_gib();ai_forward(8);}; +void() dguardq_die3 =[ $death3, dguardq_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dguardq_die4 =[ $death4, dguardq_die5 ] {}; +void() dguardq_die5 =[ $death5, dguardq_die6 ] {}; +void() dguardq_die6 =[ $death6, dguardq_die7 ] {}; +void() dguardq_die7 =[ $death7, dguardq_die8 ] {}; +void() dguardq_die8 =[ $death8, dguardq_die9 ] {ai_forward(10);}; +void() dguardq_die9 =[ $death9, dguardq_die10 ] {ai_forward(11);}; +void() dguardq_die10 =[ $death10, dguardq_die11 ] {}; +void() dguardq_die11 =[ $death11, dguardq_die12 ] {monster_death_postcheck();}; +void() dguardq_die12 =[ $death12, dguardq_die12 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dguardq_dieb1 =[ $deathb1, dguardq_dieb2 ] {}; +void() dguardq_dieb2 =[ $deathb2, dguardq_dieb3 ] {monster_check_gib();}; +void() dguardq_dieb3 =[ $deathb3, dguardq_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dguardq_dieb4 =[ $deathb4, dguardq_dieb5 ] {}; +void() dguardq_dieb5 =[ $deathb5, dguardq_dieb6 ] {}; +void() dguardq_dieb6 =[ $deathb6, dguardq_dieb7 ] {}; +void() dguardq_dieb7 =[ $deathb7, dguardq_dieb8 ] {}; +void() dguardq_dieb8 =[ $deathb8, dguardq_dieb9 ] {monster_death_postcheck();}; +void() dguardq_dieb9 =[ $deathb9, dguardq_dieb9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dguardq_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) dguardq_die1 (); // Forward - standard + else dguardq_dieb1 (); // Backward - standard + } +}; + +//============================================================================ +void() dguardq_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +/*====================================================================== + QUAKED monster_death_guard (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_death_guard = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dguardq.mdl"; // dguard.mdl (quoth) + self.headmdl = "progs/h_dguardq.mdl"; // h_dguard.mdl (quoth) + self.gib1mdl = "progs/w_hknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_DGUARDQ); // fireball.mdl (quoth) + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "dguard/idle.wav"; + precache_sound (self.idle_sound); + + // precache sight, pain and death (changes on type) + self.sight_count = 4; + self.sight_sound = "dguard/sight1.wav"; + self.sight_sound2 = "dguard/sight2.wav"; + self.sight_sound3 = "dguard/sight3.wav"; + self.sight_sound4 = "dguard/sight4.wav"; + precache_sound (self.sight_sound); + precache_sound (self.sight_sound2); + precache_sound (self.sight_sound3); + precache_sound (self.sight_sound4); + + // Pain and Death and Taxes! + self.pain_sound = "dguard/pain1.wav"; + self.pain_sound2 = "dguard/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + self.death_sound = "dguard/death1.wav"; + self.death_sound2 = "dguard/death2.wav"; + precache_sound (self.death_sound); + precache_sound (self.death_sound2); + + // New fireball fire/impact sound + precache_sound ("dguard/fire.wav"); + precache_sound ("dguard/hit.wav"); + + // New sword sweep/slash sounds + precache_sound ("dguard/slash.wav"); + precache_sound ("dguard/slhit.wav"); + precache_sound ("dguard/slmiss1.wav"); + precache_sound ("dguard/slmiss2.wav"); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 125; + self.gibhealth = -40; // Not easy to gib + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 40; // Medium pain threshold + self.pain_timeout = 1.25; // Higher than a knight + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEMEDIUM; // Lighter than Hell Knight + self.attack_offset = '20 0 24'; // End of sword + self.poisonous = FALSE; // No support for this + self.deathstring = " was slaughtered by a Death Guard\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Using alt magic and charge attacks + self.th_checkattack = DGuardQCheckAttack; + self.th_stand = dguardq_stand1; // Idling on feet + self.th_walk = dguardq_walk1; // Walking + self.th_run = dguardq_run1; // Running + self.th_melee = dguardq_smash1; // Sword attack + self.th_charge = dguardq_char_b1; // Charge attack + self.th_missile = dguardq_magicb1; // Fireball + self.th_pain = dguardq_pain; // Stumble and pain + self.th_die = dguardq_die; // Face meets floor + + self.classtype = CT_MONDGUARDQ; + self.classgroup = CG_DKNIGHT; // Classic tincan! + self.classmove = MON_MOVEWALK; + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_dknight.qc b/QC_other/QC_arcane/mon_dknight.qc new file mode 100644 index 00000000..62cfc7a5 --- /dev/null +++ b/QC_other/QC_arcane/mon_dknight.qc @@ -0,0 +1,765 @@ +/*============================================================================== +DEATH KNIGHT +==============================================================================*/ +$cd id1/models/dknight +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// (013 - 024) Stand idle - Shoulder hunch +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 + +// (025 - 048) Stand idle - Quick look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 + +// (049 - 072) Stand idle - checking sword +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 + +// (073 - 092) Stand idle - scratching chin +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 + +// (093 - 106) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (107 - 112) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (113 - 127) Slice (one hand slashing run attack) (file=SWING) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 slice15 + +// (128 - 142) Smash (chop overhead to ground) (file=CHOP) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (143 - 164) W_Attack (two handed slashing attack) (file=SLASH) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 + +// (165 - 178) MagicC - Typical magic range attack (file=SWEEPCAST) +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 magicc12 magicc13 magicc14 + +// Pain animations A = Slow (179 - 183), D = Stagger (184 - 194) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (194 - 206) Charging attack A - swinging sword left to right infront +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 + +// (207 - 212) Charging attack B - rotating sword left to right infront +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// (212 - 224) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// (225 - 244) Death backwards with cool sword wobble +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 deathb15 deathb16 +$frame deathb17 deathb18 deathb19 deathb20 + +// magica and magicb missing + +void() dknight_sword_sound; // Sword swipe sounds +void() dknight_ghost_particle; // Ghost particles +void() dknight_ghost_glow; // Secondary ghost glow + +//=========================================================================== +void() dk_stand = { + if (self.spawnflags & MON_GHOST_ONLY) { + if (self.movetype != MOVETYPE_NONE) self.movetype = MOVETYPE_NONE; + dknight_ghost_particle(); + dknight_ghost_glow(); + } + else ai_stand(); +}; + +//---------------------------------------------------------------------- +void() dknight_standA1 =[ $standA1, dknight_standA2 ] {dk_stand();}; +void() dknight_standA2 =[ $standA2, dknight_standA3 ] {dk_stand();}; +void() dknight_standA3 =[ $standA3, dknight_standA4 ] {dk_stand();}; +void() dknight_standA4 =[ $standA4, dknight_standA5 ] {dk_stand();}; +void() dknight_standA5 =[ $standA5, dknight_standA6 ] {dk_stand();}; +void() dknight_standA6 =[ $standA6, dknight_standA7 ] {dk_stand();}; +void() dknight_standA7 =[ $standA7, dknight_standA8 ] {dk_stand();}; +void() dknight_standA8 =[ $standA8, dknight_standA9 ] {dk_stand();}; +void() dknight_standA9 =[ $standA9, dknight_standA10] {dk_stand();}; +void() dknight_standA10=[ $standA10, dknight_standA11] {dk_stand();}; +void() dknight_standA11=[ $standA11, dknight_standA12] {dk_stand();}; +void() dknight_standA12=[ $standA12, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_standB1 =[ $standB1, dknight_standB2 ] {dk_stand();}; +void() dknight_standB2 =[ $standB2, dknight_standB3 ] {dk_stand();}; +void() dknight_standB3 =[ $standB3, dknight_standB4 ] {dk_stand();}; +void() dknight_standB4 =[ $standB4, dknight_standB5 ] {dk_stand();}; +void() dknight_standB5 =[ $standB5, dknight_standB6 ] {dk_stand();}; +void() dknight_standB6 =[ $standB6, dknight_standB7 ] {dk_stand();}; +void() dknight_standB7 =[ $standB7, dknight_standB8 ] {dk_stand();}; +void() dknight_standB8 =[ $standB8, dknight_standB9 ] {dk_stand();}; +void() dknight_standB9 =[ $standB9, dknight_standB10] {dk_stand();}; +void() dknight_standB10=[ $standB10, dknight_standB11] {dk_stand();}; +void() dknight_standB11=[ $standB11, dknight_standB12] {dk_stand();}; +void() dknight_standB12=[ $standB12, dknight_standB13] {dk_stand();}; +void() dknight_standB13=[ $standB13, dknight_standB14] {dk_stand();}; +void() dknight_standB14=[ $standB14, dknight_standB15] {dk_stand();}; +void() dknight_standB15=[ $standB15, dknight_standB16] {dk_stand();}; +void() dknight_standB16=[ $standB16, dknight_standB17] {dk_stand();}; +void() dknight_standB17=[ $standB17, dknight_standB18] {dk_stand();}; +void() dknight_standB18=[ $standB18, dknight_standB19] {dk_stand();}; +void() dknight_standB19=[ $standB19, dknight_standB20] {dk_stand();}; +void() dknight_standB20=[ $standB20, dknight_standB21] {dk_stand();}; +void() dknight_standB21=[ $standB21, dknight_standB22] {dk_stand();}; +void() dknight_standB22=[ $standB22, dknight_standB23] {dk_stand();}; +void() dknight_standB23=[ $standB23, dknight_standB24] {dk_stand();}; +void() dknight_standB24=[ $standB24, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_standC1 =[ $standC1, dknight_standC2 ] {dk_stand();}; +void() dknight_standC2 =[ $standC2, dknight_standC3 ] {dk_stand();}; +void() dknight_standC3 =[ $standC3, dknight_standC4 ] {dk_stand();}; +void() dknight_standC4 =[ $standC4, dknight_standC5 ] {dk_stand();}; +void() dknight_standC5 =[ $standC5, dknight_standC6 ] {dk_stand();}; +void() dknight_standC6 =[ $standC6, dknight_standC7 ] {dk_stand();}; +void() dknight_standC7 =[ $standC7, dknight_standC8 ] {dk_stand();}; +void() dknight_standC8 =[ $standC8, dknight_standC9 ] {dk_stand();}; +void() dknight_standC9 =[ $standC9, dknight_standC10] {dk_stand();}; +void() dknight_standC10=[ $standC10, dknight_standC11] {dk_stand();}; +void() dknight_standC11=[ $standC11, dknight_standC12] {dk_stand();}; +void() dknight_standC12=[ $standC12, dknight_standC13] {dk_stand();}; +void() dknight_standC13=[ $standC13, dknight_standC14] {dk_stand();}; +void() dknight_standC14=[ $standC14, dknight_standC15] {dk_stand();}; +void() dknight_standC15=[ $standC15, dknight_standC16] {dk_stand();}; +void() dknight_standC16=[ $standC16, dknight_standC17] {dk_stand();}; +void() dknight_standC17=[ $standC17, dknight_standC18] {dk_stand();}; +void() dknight_standC18=[ $standC18, dknight_standC19] {dk_stand();}; +void() dknight_standC19=[ $standC19, dknight_standC20] {dk_stand();}; +void() dknight_standC20=[ $standC20, dknight_standC21] {dk_stand();}; +void() dknight_standC21=[ $standC21, dknight_standC22] {dk_stand();}; +void() dknight_standC22=[ $standC22, dknight_standC23] {dk_stand();}; +void() dknight_standC23=[ $standC23, dknight_standC24] {dk_stand();}; +void() dknight_standC24=[ $standC24, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_standD1 =[ $standD1, dknight_standD2 ] {dk_stand();}; +void() dknight_standD2 =[ $standD2, dknight_standD3 ] {dk_stand();}; +void() dknight_standD3 =[ $standD3, dknight_standD4 ] {dk_stand();}; +void() dknight_standD4 =[ $standD4, dknight_standD5 ] {dk_stand();}; +void() dknight_standD5 =[ $standD5, dknight_standD6 ] {dk_stand();}; +void() dknight_standD6 =[ $standD6, dknight_standD7 ] {dk_stand();}; +void() dknight_standD7 =[ $standD7, dknight_standD8 ] {dk_stand();}; +void() dknight_standD8 =[ $standD8, dknight_standD9 ] {dk_stand();}; +void() dknight_standD9 =[ $standD9, dknight_standD10] {dk_stand();}; +void() dknight_standD10=[ $standD10, dknight_standD11] {dk_stand();}; +void() dknight_standD11=[ $standD11, dknight_standD12] {dk_stand();}; +void() dknight_standD12=[ $standD12, dknight_standD13] {dk_stand();}; +void() dknight_standD13=[ $standD13, dknight_standD14] {dk_stand();}; +void() dknight_standD14=[ $standD14, dknight_standD15] {dk_stand();}; +void() dknight_standD15=[ $standD15, dknight_standD16] {dk_stand();}; +void() dknight_standD16=[ $standD16, dknight_standD17] {dk_stand();}; +void() dknight_standD17=[ $standD17, dknight_standD18] {dk_stand();}; +void() dknight_standD18=[ $standD18, dknight_standD19] {dk_stand();}; +void() dknight_standD19=[ $standD19, dknight_standD20] {dk_stand();}; +void() dknight_standD20=[ $standD20, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_stand1 =[ $stand1, dknight_stand2 ] {monster_idle_sound();dk_stand();}; +void() dknight_stand2 =[ $stand2, dknight_stand3 ] {dk_stand();}; +void() dknight_stand3 =[ $stand3, dknight_stand4 ] {dk_stand();}; +void() dknight_stand4 =[ $stand4, dknight_stand5 ] {dk_stand();}; +void() dknight_stand5 =[ $stand5, dknight_stand6 ] {dk_stand();}; +void() dknight_stand6 =[ $stand6, dknight_stand7 ] {dk_stand();}; +void() dknight_stand7 =[ $stand7, dknight_stand8 ] {dk_stand();}; +void() dknight_stand8 =[ $stand8, dknight_stand9 ] {dk_stand();}; +void() dknight_stand9 =[ $stand9, dknight_stand10 ] {dk_stand();}; +void() dknight_stand10 =[ $stand10, dknight_stand11 ] {dk_stand();}; +void() dknight_stand11 =[ $stand11, dknight_stand12 ] {dk_stand();}; +void() dknight_stand12 =[ $stand12, dknight_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + if (self.lip < 1) self.think = dknight_standD1; // Scratch chin + else if (self.lip < 2) self.think = dknight_standC1; // Look at weapon + else if (self.lip < 3) self.think = dknight_standA1; // Shoulder hunch + else self.think = dknight_standB1; // Look around + } +}; + +//=========================================================================== +void(float dist) dk_walk = { + if (self.spawnflags & MON_GHOST_ONLY) { + if (self.movetype != MOVETYPE_STEP) self.movetype = MOVETYPE_STEP; + movetogoal (dist); + dknight_ghost_particle(); + dknight_ghost_glow(); + + // Find out if the ghost is close enough to next path corner + // The ghost is not a monster, negative health and no body! + // The path_corner touch function won't work with ghosts + self.enemydist = range_distance(self.goalentity, FALSE); + if (self.enemydist < 64) { + // Check for any new targets to walk toward + if (self.goalentity.target != "") { + self.movetarget = find(world, targetname, self.goalentity.target); + if (self.movetarget) { + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + return; + } + } + } + // It seems its time to stand around! + self.th_stand(); + // Check for any path corner event triggers + if (self.goalentity.corner_event) + trigger_strs(self.goalentity.corner_event, self); + } + } + // Default walk for regular knights + else ai_walk(dist); +}; + +//---------------------------------------------------------------------- +void() dknight_walk1 =[ $walk1, dknight_walk2 ] {self.idlebusy = FALSE; + monster_idle_sound(); dk_walk(2);}; +void() dknight_walk2 =[ $walk2, dknight_walk3 ] {monster_footstep(FALSE);dk_walk(5);}; +void() dknight_walk3 =[ $walk3, dknight_walk4 ] {dk_walk(5);}; +void() dknight_walk4 =[ $walk4, dknight_walk5 ] {dk_walk(4);}; +void() dknight_walk5 =[ $walk5, dknight_walk6 ] {dk_walk(4);}; +void() dknight_walk6 =[ $walk6, dknight_walk7 ] {dk_walk(2);}; +void() dknight_walk7 =[ $walk7, dknight_walk8 ] {dk_walk(2);}; +void() dknight_walk8 =[ $walk8, dknight_walk9 ] {monster_footstep(FALSE); dk_walk(3);}; +void() dknight_walk9 =[ $walk9, dknight_walk10 ] {dk_walk(3);}; +void() dknight_walk10 =[ $walk10, dknight_walk11 ] {dk_walk(4);}; +void() dknight_walk11 =[ $walk11, dknight_walk12 ] {dk_walk(3);}; +void() dknight_walk12 =[ $walk12, dknight_walk13 ] {dk_walk(4);}; +void() dknight_walk13 =[ $walk13, dknight_walk14 ] {dk_walk(6);}; +void() dknight_walk14 =[ $walk14, dknight_walk1 ] {dk_walk(2);}; + +//=========================================================================== +void() dknight_run1 =[ $run1, dknight_run2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_run (20); CheckForCharge(); }; +void() dknight_run2 =[ $run2, dknight_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() dknight_run3 =[ $run3, dknight_run4 ] {ai_run(16);}; +void() dknight_run4 =[ $run4, dknight_run5 ] {ai_run(14);}; +void() dknight_run5 =[ $run5, dknight_run6 ] {monster_footstep(FALSE); ai_run(25);}; +void() dknight_run6 =[ $run6, dknight_run1 ] {ai_run(13);}; + +//=========================================================================== +// Charging attack A - swinging sword left to right infront +// Hell Knight - 16 frames / Death Knight - 12 frames +// Death Knight is faster (-4 frames will cycle damage frames quicker) +// Damage Frames - Hell Knight (6-11, Total 6) Death Knight (6-10, Total 5) + +void() dknight_char_a1 =[ $char_a1, dknight_char_a2 ] {ai_charge(20); dknight_sword_sound();}; +void() dknight_char_a2 =[ $char_a2, dknight_char_a3 ] {monster_footstep(FALSE); ai_charge(25);ai_melee(); }; +void() dknight_char_a3 =[ $char_a3, dknight_char_a4 ] {ai_charge(18);ai_melee(); }; +void() dknight_char_a4 =[ $char_a4, dknight_char_a5 ] {ai_charge(16);}; +void() dknight_char_a5 =[ $char_a5, dknight_char_a6 ] {monster_footstep(FALSE); ai_charge(14);}; +void() dknight_char_a6 =[ $char_a6, dknight_char_a7 ] {ai_charge(20); ai_melee();}; +void() dknight_char_a7 =[ $char_a7, dknight_char_a8 ] {ai_charge(21); ai_melee(); dknight_sword_sound();}; +void() dknight_char_a8 =[ $char_a8, dknight_char_a9 ] {monster_footstep(FALSE); ai_charge(13); ai_melee();}; +void() dknight_char_a9 =[ $char_a9, dknight_char_a10 ] {ai_charge(20); ai_melee();}; +void() dknight_char_a10=[ $char_a10, dknight_char_a11 ] {ai_charge(20); ai_melee();}; +void() dknight_char_a11=[ $char_a11, dknight_char_a12 ] {monster_footstep(FALSE); ai_charge(18);}; +void() dknight_char_a12=[ $char_a12, dknight_run1 ] {ai_charge(16);}; + +//---------------------------------------------------------------------- +// Identical frame set (Hell Knight / Death Knight) + +void() dknight_char_b1 =[ $char_b1, dknight_char_b2 ] { + CheckContinueCharge (); ai_charge(23); ai_melee(); dknight_sword_sound();}; +void() dknight_char_b2 =[ $char_b2, dknight_char_b3 ] {monster_footstep(FALSE); ai_charge(17); ai_melee();}; +void() dknight_char_b3 =[ $char_b3, dknight_char_b4 ] {ai_charge(12); ai_melee();}; +void() dknight_char_b4 =[ $char_b4, dknight_char_b5 ] {ai_charge(22); ai_melee();}; +void() dknight_char_b5 =[ $char_b5, dknight_char_b6 ] {monster_footstep(FALSE); ai_charge(18); ai_melee();}; +void() dknight_char_b6 =[ $char_b6, dknight_char_b1 ] {ai_charge(8); ai_melee();}; + +//=========================================================================== +// Melee Attack 1 - Slice (one hand slashing run attack) +// Hell Knight - 10 frames / Death Knight - 15 frames (skipped 1, 3, 12, 15) +// Death Knight - trimmed frames so melee attack 1 and 2 the same + +void() dknight_slice1 =[ $slice2, dknight_slice2 ] {ai_charge(9);}; +void() dknight_slice2 =[ $slice4, dknight_slice3 ] {monster_footstep(FALSE); ai_charge(6);}; +void() dknight_slice3 =[ $slice5, dknight_slice4 ] {ai_charge(13);}; +void() dknight_slice4 =[ $slice6, dknight_slice5 ] {ai_charge(4); dknight_sword_sound();}; +void() dknight_slice5 =[ $slice7, dknight_slice6 ] {monster_footstep(FALSE); ai_charge(7); ai_melee();}; +void() dknight_slice6 =[ $slice8, dknight_slice7 ] {ai_charge(15); ai_melee();}; +void() dknight_slice7 =[ $slice9, dknight_slice8 ] {ai_charge(8); ai_melee();}; +void() dknight_slice8 =[ $slice10, dknight_slice9 ] {monster_footstep(FALSE); ai_charge(2); ai_melee();}; +void() dknight_slice9 =[ $slice11, dknight_slice10 ] {ai_melee();}; +void() dknight_slice10 =[ $slice13, dknight_slice11 ] {monster_footstep(FALSE); ai_charge(0);}; +void() dknight_slice11 =[ $slice14, dknight_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +// Melee Attack 2 - Smash (chop overhead to ground) +// Hell Knight - 11 frames / Death Knight - 15 frames (skipped (1, 11, 14, 15) +// Death Knight frames trimmed down to match Hell Knight (damage ratio) + +void() dknight_smash1 =[ $smash2, dknight_smash2 ] {ai_charge(1);}; +void() dknight_smash2 =[ $smash3, dknight_smash3 ] {ai_charge(13);}; +void() dknight_smash3 =[ $smash4, dknight_smash4 ] {monster_footstep(FALSE); ai_charge(9);}; +void() dknight_smash4 =[ $smash5, dknight_smash5 ] {ai_charge(11);dknight_sword_sound();}; +void() dknight_smash5 =[ $smash6, dknight_smash6 ] {ai_charge(10);}; +void() dknight_smash6 =[ $smash7, dknight_smash7 ] {ai_charge(7); ai_melee();}; +void() dknight_smash7 =[ $smash8, dknight_smash8 ] {monster_footstep(FALSE); ai_charge(12); ai_melee();}; +void() dknight_smash8 =[ $smash9, dknight_smash9 ] {ai_charge(2); ai_melee();}; +void() dknight_smash9 =[ $smash10, dknight_smash10 ] {ai_charge(3); ai_melee();}; +void() dknight_smash10 =[ $smash12, dknight_smash11 ] {ai_charge(0);ai_melee();}; +void() dknight_smash11 =[ $smash13, dknight_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - W_Attack (two handed slashing attack) +// Identical frame set (Hell Knight / Death Knight) + +void() dknight_watk1 =[ $w_attack1, dknight_watk2 ] {ai_charge(2);}; +void() dknight_watk2 =[ $w_attack2, dknight_watk3 ] {monster_footstep(FALSE); ai_charge(0);}; +void() dknight_watk3 =[ $w_attack3, dknight_watk4 ] {ai_charge(0);}; +void() dknight_watk4 =[ $w_attack4, dknight_watk5 ] {ai_charge(0); dknight_sword_sound();}; +void() dknight_watk5 =[ $w_attack5, dknight_watk6 ] {ai_melee();}; +void() dknight_watk6 =[ $w_attack6, dknight_watk7 ] {ai_melee();}; +void() dknight_watk7 =[ $w_attack7, dknight_watk8 ] {monster_footstep(FALSE); ai_charge(1);}; +void() dknight_watk8 =[ $w_attack8, dknight_watk9 ] {ai_charge(4);}; +void() dknight_watk9 =[ $w_attack9, dknight_watk10 ] {ai_charge(5);}; +void() dknight_watk10 =[ $w_attack10, dknight_watk11 ] {ai_charge(3); ai_melee();}; +void() dknight_watk11 =[ $w_attack11, dknight_watk12 ] {ai_charge(2); ai_melee();}; +void() dknight_watk12 =[ $w_attack12, dknight_watk13 ] {ai_charge(2); ai_melee();}; +void() dknight_watk13 =[ $w_attack13, dknight_watk14 ] {ai_charge(0);}; +void() dknight_watk14 =[ $w_attack14, dknight_watk15 ] {ai_charge(0);}; +void() dknight_watk15 =[ $w_attack15, dknight_watk16 ] {ai_charge(0); dknight_sword_sound();}; +void() dknight_watk16 =[ $w_attack16, dknight_watk17 ] {ai_charge(1);}; +void() dknight_watk17 =[ $w_attack17, dknight_watk18 ] {monster_footstep(FALSE); ai_charge(1); ai_melee();}; +void() dknight_watk18 =[ $w_attack18, dknight_watk19 ] {ai_charge(3); ai_melee();}; +void() dknight_watk19 =[ $w_attack19, dknight_watk20 ] {ai_charge(4); ai_melee();}; +void() dknight_watk20 =[ $w_attack20, dknight_watk21 ] {ai_charge(6);}; +void() dknight_watk21 =[ $w_attack21, dknight_watk22 ] {ai_charge(7);}; +void() dknight_watk22 =[ $w_attack22, dknight_run1 ] {ai_charge(3);}; + +//============================================================================ +// Cycle between 3 melee attacks +// Attack 1 - Slice (one hand slashing run attack) +// Attack 2 - Smash (chop overhead to ground) +// Attack 3 - W_Attack (two handed slashing attack) + +//---------------------------------------------------------------------- +void() dknight_melee = +{ + self.meleeattack = self.meleeattack + 1; + + if (self.meleeattack == 1) dknight_slice1 (); + else if (self.meleeattack == 2) dknight_smash1 (); + else { + dknight_watk1 (); + self.meleeattack = 0; + } +}; + +//=========================================================================== +// Hell Knight - 11 frames / Death Knight - 14 frames (skipped 1, 10,14) +// Death Knight frames trimmed down to match Hell Knight (damage ratio) + +void() dknight_magicc1 =[ $magicc2, dknight_magicc2 ] {ai_face();}; +void() dknight_magicc2 =[ $magicc3, dknight_magicc3 ] {ai_face();}; +void() dknight_magicc3 =[ $magicc4, dknight_magicc4 ] {ai_face();}; +void() dknight_magicc4 =[ $magicc5, dknight_magicc5 ] {ai_face();}; +void() dknight_magicc5 =[ $magicc6, dknight_magicc6 ] {ai_face();}; +void() dknight_magicc6 =[ $magicc7, dknight_magicc7 ] {hknight_shot(-2);}; +void() dknight_magicc7 =[ $magicc8, dknight_magicc8 ] {hknight_shot(-1);}; +void() dknight_magicc8 =[ $magicc9, dknight_magicc9 ] {hknight_shot(0);}; +void() dknight_magicc9 =[ $magicc11, dknight_magicc10] {hknight_shot(1);}; +void() dknight_magicc10 =[ $magicc12, dknight_magicc11] {hknight_shot(2);}; +void() dknight_magicc11 =[ $magicc13, dknight_run1] {hknight_shot(3);}; + +//============================================================================ +void() dknight_painA1 =[ $painA1, dknight_painA2 ] {}; +void() dknight_painA2 =[ $painA2, dknight_painA3 ] {}; +void() dknight_painA3 =[ $painA3, dknight_painA4 ] {}; +void() dknight_painA4 =[ $painA4, dknight_painA5 ] {}; +void() dknight_painA5 =[ $painA5, dknight_run1 ] {}; + +//---------------------------------------------------------------------- +void() dknight_painD1 =[ $painD1, dknight_painD2 ] {}; +void() dknight_painD2 =[ $painD2, dknight_painD3 ] {}; +void() dknight_painD3 =[ $painD3, dknight_painD4 ] {}; +void() dknight_painD4 =[ $painD4, dknight_painD5 ] {monster_footstep(FALSE); }; +void() dknight_painD5 =[ $painD5, dknight_painD6 ] {}; +void() dknight_painD6 =[ $painD6, dknight_painD7 ] {}; +void() dknight_painD7 =[ $painD7, dknight_painD8 ] {}; +void() dknight_painD8 =[ $painD8, dknight_painD9 ] {monster_footstep(FALSE); }; +void() dknight_painD9 =[ $painD9, dknight_painD10 ] {}; +void() dknight_painD10 =[ $painD10, dknight_painD11 ] {}; +void() dknight_painD11 =[ $painD11, dknight_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dknight_pain = +{ + if (self.spawnflags & MON_GHOST_ONLY) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) dknight_painA1 (); // classic, body recoil + else { + dknight_painD1 (); // Cool stumble, hand over mouth + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dknight_painD1 (); + } + } +}; + +//============================================================================ +void() dknight_die1 =[ $death1, dknight_die2 ] {ai_forward(10);}; +void() dknight_die2 =[ $death2, dknight_die3 ] {monster_check_gib();ai_forward(8);}; +void() dknight_die3 =[ $death3, dknight_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dknight_die4 =[ $death4, dknight_die5 ] {}; +void() dknight_die5 =[ $death5, dknight_die6 ] {}; +void() dknight_die6 =[ $death6, dknight_die7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dknight_die7 =[ $death7, dknight_die8 ] {}; +void() dknight_die8 =[ $death8, dknight_die9 ] {ai_forward(10);}; +void() dknight_die9 =[ $death9, dknight_die10 ] {ai_forward(11);}; +void() dknight_die10 =[ $death10, dknight_die11 ] {}; +void() dknight_die11 =[ $death11, dknight_die12 ] {monster_death_postcheck();}; +void() dknight_die12 =[ $death12, dknight_die12 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dknight_dieb1 =[ $deathb1, dknight_dieb2 ] {}; +void() dknight_dieb2 =[ $deathb2, dknight_dieb3 ] {monster_check_gib();}; +void() dknight_dieb3 =[ $deathb3, dknight_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dknight_dieb4 =[ $deathb4, dknight_dieb5 ] {}; +void() dknight_dieb5 =[ $deathb5, dknight_dieb6 ] {}; +void() dknight_dieb6 =[ $deathb6, dknight_dieb7 ] {}; +void() dknight_dieb7 =[ $deathb7, dknight_dieb8 ] {}; +void() dknight_dieb8 =[ $deathb8, dknight_dieb9 ] {}; +void() dknight_dieb9 =[ $deathb9, dknight_dieb10 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dknight_dieb10 =[ $deathb10, dknight_dieb11 ] {}; +void() dknight_dieb11 =[ $deathb11, dknight_dieb12 ] {}; +void() dknight_dieb12 =[ $deathb12, dknight_dieb13 ] {}; +void() dknight_dieb13 =[ $deathb13, dknight_dieb14 ] {}; +void() dknight_dieb14 =[ $deathb14, dknight_dieb15 ] {}; +void() dknight_dieb15 =[ $deathb15, dknight_dieb16 ] {}; +void() dknight_dieb16 =[ $deathb16, dknight_dieb17 ] {}; +void() dknight_dieb17 =[ $deathb17, dknight_dieb18 ] {}; +void() dknight_dieb18 =[ $deathb18, dknight_dieb19 ] {}; +void() dknight_dieb19 =[ $deathb19, dknight_dieb20 ] {monster_death_postcheck();}; +void() dknight_dieb20 =[ $deathb20, dknight_dieb20 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dknight_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) dknight_die1 (); + else dknight_dieb1 (); + } +}; + + +//============================================================================ +// The Death Knight ghost system (this is not a monster) +//============================================================================ +void() dknight_ghostnull = {}; +//---------------------------------------------------------------------- +void() dknight_ghost_glow = +{ + if (self.attachment) { + self.attachment.frame = self.frame; + setorigin(self.attachment, self.origin); + if (random() < 0.5) self.attachment.alpha = 0.02; + else self.attachment.alpha = 0.05; + self.attachment.angles = self.angles; + self.attachment.velocity = self.velocity; + } +}; +//---------------------------------------------------------------------- +void() dknight_ghost_particle = +{ + self.alpha = 0.5 + (0.1*random()); + self.pos1 = '0 0 0'; + self.pos1_x = crandom()*16; + self.pos1_y = crandom()*16; + self.pos1_z = crandom()*24; + if (random() < 0.5) + particle_explode(self.origin+self.pos1, 2, 1, PARTICLE_BURST_WHITE, PARTICLE_BURST_LOSTUP); + if (self.idletimer < time) { + self.idletimer = time + 7 + (random() * 3); + self.lefty = 1 - self.lefty; + if (self.lefty) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_sound2, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +// The use function is for triggering the ghost to move +void() dknight_ghost_use = { + // Check for a delay target route (using target2) + if (self.estate == ESTATE_ON && self.target2 != "") { + self.target = self.target2; + self.target2 = ""; + self.estate = ESTATE_OFF; + } + // Always go to an on state + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() dknight_ghost_fade = +{ + if (self.estate == ESTATE_ON) return; + self.alpha = self.alpha - FADEMODEL_TIME; + + if (self.alpha <= 0) setmodel (self, ""); + else self.nextthink = time + FADEMODEL_TIME; +}; +//---------------------------------------------------------------------- +void() dknight_ghost_off = { + // Block if already off + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + particle_explode(self.origin+'0 0 -20', 75, 2, PARTICLE_BURST_FIRE, PARTICLE_BURST_UPWARD); + self.flags = self.effects = 0; // Always reset + self.takedamage = DAMAGE_NO; // No pain/death triggers + self.movetype = MOVETYPE_NONE; // Stationary + self.solid = SOLID_NOT; // no world interaction + setsize (self, VEC_ORIGIN, VEC_ORIGIN); // No size, no impact + self.velocity = self.avelocity = '0 0 0'; // Reset velocity + if (self.attachment) { + self.attachment.movetype = MOVETYPE_NONE; // Stationary + self.attachment.solid = SOLID_NOT; // no world interaction + setmodel(self.attachment,""); + self.attachment.velocity = '0 0 0'; + } + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.think = dknight_ghost_fade; + self.nextthink = time + FADEMODEL_TIME; +} + +//---------------------------------------------------------------------- +void() dknight_ghost_on = { + // Block if already ON + if (self.estate == ESTATE_ON) return; + + self.estate = ESTATE_ON; + particle_explode(self.origin, 30, 2, PARTICLE_BURST_WHITE, PARTICLE_BURST_SKULLUP); + self.flags = self.effects = 0; // Always reset + self.takedamage = DAMAGE_NO; // No pain/death triggers + self.movetype = MOVETYPE_NONE; // Regular walking + self.solid = SOLID_NOT; // no world interaction + setmodel(self, self.mdl); // Setup model + if (self.exactskin) self.skin = self.exactskin; + if (CheckZeroVector(self.bbmins)) monster_bbox(); + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + self.velocity = self.avelocity = '0 0 0'; // Reset velocity + + // Setup ghost glow effect + if (!self.attachment) self.attachment = spawn(); + self.attachment.movetype = MOVETYPE_NOCLIP; // No movement + self.attachment.solid = SOLID_NOT; // no world interaction + setmodel(self.attachment, self.headmdl); + setsize(self.attachment,VEC_ORIGIN, VEC_ORIGIN); + setorigin(self.attachment, self.origin); + + // Check for any targets to walk toward + if (self.target != "") { + self.movetarget = find(world, targetname, self.target); + if (self.movetarget) { + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + self.th_walk(); + return; + } + } + } + // No valid target, just stand around + self.movetarget = self.goalentity = world; + self.th_stand(); +} + +//============================================================================ +void() dknight_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +/*====================================================================== +QUAKED monster_dknight (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dknight = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dknight.mdl"; // New Hell Knight + self.headmdl = "progs/h_dknight.mdl"; + self.gib1mdl = "progs/w_dknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_HKN); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib1mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = ""; + if (random() < 0.5) self.gib3mdl = ""; + + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the + // filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + self.sight_sound = "hknight/sight1.wav"; + precache_sound (self.sight_sound); + + self.pain_sound = "hknight/pain1.wav"; + self.death_sound = "hknight/death1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_HKNGRN); + } + + // dknight model does not support stone skins + //precache_stonegibs(); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 250; + self.gibhealth = -40; + self.gibbed = FALSE; + self.pain_flinch = 40; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 1.5; // Higher than a knight + self.steptype = FS_TYPEHEAVY; + self.deathstring = " was cleaved by a Death Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // randomize last melee attack + self.meleeattack = rint(random()*3); + + self.classtype = CT_MONDKNIGHT; + self.classgroup = CG_DKNIGHT; + self.classmove = MON_MOVEWALK; + + // Special ghost prop, stands around or walks + if (self.spawnflags & MON_GHOST_ONLY) { + self.headmdl = "progs/mon_dknight_glow.mdl"; + precache_model (self.headmdl); + + self.idle_sound = "dknight/ghost_idle1.wav"; + self.idle_sound2 = "dknight/ghost_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.steptype = FS_FLYING; + self.exactskin = 2; + self.alpha = 0.1; + self.nomonstercount = TRUE; + self.gibhealth = MON_NEVERGIB; + self.health = LARGE_TIMER; + self.yaw_speed = 20; + + self.th_stand = dknight_stand1; + self.th_walk = dknight_walk1; + self.th_run = dknight_walk1; + + // The ghost is a scenery prop, not a monster + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = dknight_ghost_on; + self.estate_off = dknight_ghost_off; + self.estate_use = dknight_ghost_use; + + // Always start off and wait for a trigger + self.estate = ESTATE_OFF; + self.takedamage = DAMAGE_NO; // No pain/death triggers + self.movetype = MOVETYPE_NONE; // Stationary + self.solid = SOLID_NOT; // no world interaction + setmodel (self, ""); // invisible + } + else { + self.th_stand = dknight_stand1; + self.th_walk = dknight_walk1; + self.th_run = dknight_run1; + self.th_melee = dknight_melee; + self.th_charge = dknight_char_a1; + self.th_missile = dknight_magicc1; + self.th_pain = dknight_pain; + self.th_die = dknight_die; + // Start monster (default) + monster_start(); + } +}; + +//---------------------------------------------------------------------- +void() monster_dknightghost = +{ + self.spawnflags = MON_GHOST_ONLY; + monster_dknight(); +}; diff --git a/QC_other/QC_arcane/mon_dlord.qc b/QC_other/QC_arcane/mon_dlord.qc new file mode 100644 index 00000000..84d78d7d --- /dev/null +++ b/QC_other/QC_arcane/mon_dlord.qc @@ -0,0 +1,535 @@ +/*============================================================================== + DEATH LORD (Originally from Quoth - Kell/Necros/Preach) + * QC was created for AD mappers to play with in their own projects + * Original Quoth model/sounds not included with main MOD + + Interesting QC traits + * WALKS when insight of enemy and RUNS when out of sight + * Lightning bolts reflect off body when shield active + * When shield is active all damage is reduced by 50% + * Melee attack is a shambler (half damage) like lightning attack + * Melee attack is dis-used magic animation in original HK model + * Range attack works like the rocketeer, except constant speed + * Range attack is far from perfect tracking to allowing strafing + + QUOTH assets required to get this monster working in AD + (model's in 'progs' and wav's in 'sound' sub directories) + * hknight.mdl -> mon_dlord.mdl (rename file, skin 1 = dlord) + * h_dlord.mdl -> h_dlord.mdl (only has 1 skin, thrown as custom gib) + * dlord/idle.wav, dlord/sight.wav, dlord/pain.wav, dlord/death.wav + +==============================================================================*/ +// 000-008 +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +// 009-028 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +// 029-036 +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// 037-041 +$frame pain1 pain2 pain3 pain4 pain5 + +// 042-053 +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// 054-062 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +// 063-078 (not used) +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +// 079-092 Melee attack - lightning +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +// 093-105 Range attack - spike balls +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// 106-111 (not used) +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// 112-121 (not used) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +// 122-132 (not used) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +// 133-154 (not used) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +// 155-165 (not used) +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +void() dlord_sword_sound; + +//=========================================================================== +void() dlord_shieldon = +{ + self.effects = EF_BRIGHTFIELD; // Glowing yellow particle effect + self.takedamage = DAMAGE_YES; // Grenades bounce off + self.bouncegrenade = TRUE; // Warning to other monsters + self.reflectlightning = TRUE; // Reflect lightning strikes + self.reflectplasma = TRUE; // Reflect plasma projectiles + self.reflectnails = TRUE; // Reflect nail projectiles + // Visually show resistance and reduce damage taken + self.resist_shells = self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0.5; +}; + +void() dlord_shieldoff = +{ + self.effects = FALSE; // No engine particle effects active + self.takedamage = DAMAGE_AIM; // Grenades make contact + self.bouncegrenade = FALSE; // Reset to default + self.reflectlightning = FALSE; // Reflect lightning strikes + self.reflectplasma = FALSE; // Reflect plasma projectiles + self.reflectnails = FALSE; // Reflect nail projectiles + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; +}; + +//=========================================================================== +void() dlord_stand1=[ $stand1, dlord_stand2] {monster_idle_sound(); ai_stand();}; +void() dlord_stand2=[ $stand2, dlord_stand3] {ai_stand();}; +void() dlord_stand3=[ $stand3, dlord_stand4] {ai_stand();}; +void() dlord_stand4=[ $stand4, dlord_stand5] {ai_stand();}; +void() dlord_stand5=[ $stand5, dlord_stand6] {ai_stand();}; +void() dlord_stand6=[ $stand6, dlord_stand7] {ai_stand();}; +void() dlord_stand7=[ $stand7, dlord_stand8] {ai_stand();}; +void() dlord_stand8=[ $stand8, dlord_stand9] {ai_stand();}; +void() dlord_stand9=[ $stand9, dlord_stand1] {ai_stand();}; + +//=========================================================================== +void() dlord_walk1 =[ $walk1, dlord_walk2 ] {monster_idle_sound(); ai_walk(2);}; +void() dlord_walk2 =[ $walk2, dlord_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dlord_walk3 =[ $walk3, dlord_walk4 ] {ai_walk(5);}; +void() dlord_walk4 =[ $walk4, dlord_walk5 ] {ai_walk(4);}; +void() dlord_walk5 =[ $walk5, dlord_walk6 ] {ai_walk(4);}; +void() dlord_walk6 =[ $walk6, dlord_walk7 ] {ai_walk(2);}; +void() dlord_walk7 =[ $walk7, dlord_walk8 ] {ai_walk(2);}; +void() dlord_walk8 =[ $walk8, dlord_walk9 ] {ai_walk(3);}; +void() dlord_walk9 =[ $walk9, dlord_walk10] {ai_walk(3);}; +void() dlord_walk10=[ $walk10, dlord_walk11] {ai_walk(4);}; +void() dlord_walk11=[ $walk11, dlord_walk12] {monster_footstep(FALSE); ai_walk(3);}; +void() dlord_walk12=[ $walk12, dlord_walk13] {ai_walk(4);}; +void() dlord_walk13=[ $walk13, dlord_walk14] {ai_walk(6);}; +void() dlord_walk14=[ $walk14, dlord_walk15] {ai_walk(2);}; +void() dlord_walk15=[ $walk15, dlord_walk16] {ai_walk(2);}; +void() dlord_walk16=[ $walk16, dlord_walk17] {ai_walk(4);}; +void() dlord_walk17=[ $walk17, dlord_walk18] {ai_walk(3);}; +void() dlord_walk18=[ $walk18, dlord_walk19] {ai_walk(3);}; +void() dlord_walk19=[ $walk19, dlord_walk20] {ai_walk(3);}; +void() dlord_walk20=[ $walk20, dlord_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// Two speed run animation based on enemy visibility +//=========================================================================== +void() dlord_slow1; +void() dlord_fast1; + +// run state has two animation speeds (single function required) +void(float movespd) dlord_run = +{ + // Block all checks if dead + if (self.health < 1) return; + // idle/shield functions work for both animation sets + if (self.walkframe == 0) monster_idle_sound(); + if (self.walkframe == 1) dlord_shieldon(); + + // Change animation set based on enemy visibilty + // Ignore frame 0 for checks (endless loop) + // Make sure animations don't switch too rapid (timer) + if (self.enemy) { + if (self.walkframe > 0 && self.attack_timer < time) { + // Prevent rapid switching (attack_timer) + self.attack_timer = time + 1 + random(); + enemy_vis = visible(self.enemy); + if (!enemy_vis) self.think = dlord_fast1; + else self.think = dlord_slow1; + } + } + + // Check run/attack functions + ai_run(movespd); + // Walk through animation sets (reset on frame 0) + self.walkframe = self.walkframe + 1; +}; + +// Walk animation with 150% movement speed +//---------------------------------------------------------------------- +void() dlord_slow1 =[ $walk1, dlord_slow2 ] {self.walkframe=0;dlord_run(3);}; +void() dlord_slow2 =[ $walk2, dlord_slow3 ] {monster_footstep(FALSE);dlord_run(7.5);}; +void() dlord_slow3 =[ $walk3, dlord_slow4 ] {dlord_run(7.5);}; +void() dlord_slow4 =[ $walk4, dlord_slow5 ] {dlord_run(6);}; +void() dlord_slow5 =[ $walk5, dlord_slow6 ] {dlord_run(6);}; +void() dlord_slow6 =[ $walk6, dlord_slow7 ] {dlord_run(3);}; +void() dlord_slow7 =[ $walk7, dlord_slow8 ] {dlord_run(3);}; +void() dlord_slow8 =[ $walk8, dlord_slow9 ] {dlord_run(4.6);}; +void() dlord_slow9 =[ $walk9, dlord_slow10] {dlord_run(4.5);}; +void() dlord_slow10=[ $walk10, dlord_slow11] {dlord_run(6);}; +void() dlord_slow11=[ $walk11, dlord_slow12] {monster_footstep(FALSE); dlord_run(4.5);}; +void() dlord_slow12=[ $walk12, dlord_slow13] {dlord_run(6);}; +void() dlord_slow13=[ $walk13, dlord_slow14] {dlord_run(9);}; +void() dlord_slow14=[ $walk14, dlord_slow15] {dlord_run(3);}; +void() dlord_slow15=[ $walk15, dlord_slow16] {dlord_run(3);}; +void() dlord_slow16=[ $walk16, dlord_slow17] {dlord_run(6);}; +void() dlord_slow17=[ $walk17, dlord_slow18] {dlord_run(4.5);}; +void() dlord_slow18=[ $walk18, dlord_slow19] {dlord_run(4.5);}; +void() dlord_slow19=[ $walk19, dlord_slow20] {dlord_run(4.5);}; +void() dlord_slow20=[ $walk20, dlord_slow1 ] {dlord_run(3);}; + +// Typical run animation (used when enemy out of sight) +//---------------------------------------------------------------------- +void() dlord_fast1 =[ $run1, dlord_fast2 ] {self.walkframe=0;dlord_run(20);}; +void() dlord_fast2 =[ $run2, dlord_fast3 ] {monster_footstep(FALSE); dlord_run(25);}; +void() dlord_fast3 =[ $run3, dlord_fast4 ] {dlord_run(18);}; +void() dlord_fast4 =[ $run4, dlord_fast5 ] {dlord_run(16);}; +void() dlord_fast5 =[ $run5, dlord_fast6 ] {dlord_run(14);}; +void() dlord_fast6 =[ $run6, dlord_fast7 ] {monster_footstep(FALSE); dlord_run(25);}; +void() dlord_fast7 =[ $run7, dlord_fast8 ] {dlord_run(21);}; +void() dlord_fast8 =[ $run8, dlord_fast1 ] {dlord_run(13);}; + +//============================================================================ +// Melee attack (over head attack) +//---------------------------------------------------------------------- +void(float zoffset) dlord_lightning = +{ + local vector org, dir, sword_offset; + + if (self.health < 1) return; // Alive? + if (!self.enemy) return; // Something to fight? + ai_damagebreakable(30); // Damage any breakables + + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + + makevectors(self.angles); + sword_offset = self.attack_offset; sword_offset_z = zoffset; + org = self.origin + attack_vector(sword_offset); + dir = self.enemy.origin + '0 0 16' - org; + dir = normalize (dir); + + // Trace direct line of lightning infront + self.enemydist = range_distance(self.enemy, FALSE); + traceline (org, self.origin + dir*self.enemydist, TRUE, self); + + // Display lightning model segments + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Check for any breakables first + if (ai_foundbreakable(self, trace_ent, FALSE)) { + T_Damage (trace_ent, self, self, 80, DAMARMOR); + } + // Half Shambler lightning damage + else LightningDamage (org, trace_endpos, self, 5); +}; + +//---------------------------------------------------------------------- +void() dlord_magica1 =[ $magica1, dlord_magica2 ] {ai_face();dlord_shieldoff();}; +void() dlord_magica2 =[ $magica2, dlord_magica3 ] {ai_face();}; +void() dlord_magica3 =[ $magica3, dlord_magica4 ] {ai_face();}; +void() dlord_magica4 =[ $magica4, dlord_magica5 ] {ai_face();}; +void() dlord_magica5 =[ $magica5, dlord_magica6 ] {ai_face();}; +void() dlord_magica6 =[ $magica6, dlord_magica7 ] {ai_face();}; +void() dlord_magica7 =[ $magica7, dlord_magica8 ] { + sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + dlord_lightning(40);}; +void() dlord_magica8 =[ $magica8, dlord_magica9 ] {dlord_lightning(25);}; +void() dlord_magica9 =[ $magica9, dlord_magica10 ] {dlord_lightning(0);}; +void() dlord_magica10 =[ $magica10, dlord_magica11 ] {dlord_lightning(-20);}; +void() dlord_magica11 =[ $magica11, dlord_magica12 ] {dlord_lightning(-24);}; +void() dlord_magica12 =[ $magica12, dlord_magica13 ] {if (skill == SKILL_NIGHTMARE) dlord_lightning(-14);}; +void() dlord_magica13 =[ $magica13, dlord_magica14 ] {ai_face();}; +void() dlord_magica14 =[ $magica14, dlord_slow1 ] {ai_face();}; + +//============================================================================ +// RANGE - SPIKEBALL (Fast spike damage) +//============================================================================ +void() dlord_spike_think = +{ + // Only track enemies with a pulse! + if (self.enemy.health < 1) return; + + // Only do a limited amount of updates + self.count = self.count + 1; + if (self.count < (5+skill)) { + // Keep ticking (slowly) + self.nextthink = time + 0.1; + + // Steer towards enemy (not very precise) + self.pos1 = (self.enemy.origin - (self.origin + '0 0 -12')) * 0.6; + self.pos2 = self.pos1 + self.velocity * 0.4; + self.pos3 = normalize(self.pos2); + self.velocity = self.pos3 * self.attack_speed; + + // Perfect angle correction, very frustrating + // self.attack_track = normalize(self.enemy.origin - self.origin); + // self.velocity = self.attack_track * self.attack_speed; + // self.angles = vectoangles(self.velocity); + } + else { + // Remove spikeball after a long while + self.nextthink = time + LIFE_PROJECTILE; + self.think = SUB_Remove; + } +}; + +//---------------------------------------------------------------------- +void() dlord_attackb = +{ + local vector org, dir, offang; + + // Keep adding up projectile counter + self.attack_chance = self.attack_chance + 1; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + // Randomize projectile offset (similar to HK) + if (random() < 0.4) self.weaponstate = 0; + else { + if (random() <= 0.7) self.weaponstate = -1; + else self.weaponstate = 1; + } + + // Keep tracking enemy origin (similar to wizards) + ai_trackenemy(); + + // Shift the firing angle 6 degree's left/right + offang = vectoangles(self.attack_track - self.origin); + offang_y = offang_y + (self.weaponstate * 6); + makevectors (offang); + + // Calculate the origin (end of sword) + org = self.origin + attack_vector(self.attack_offset); + // Use previous firing angle to calculate firing direction + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5) * 0.2; + + // Add skill level to firing speed calculation + self.attack_speed = SPEED_DLORDMISSILE + (skill * SPEED_DLORDSKILL); + launch_projectile (org, dir, CT_PROJ_DLORD, self.attack_speed); +} + +//---------------------------------------------------------------------- +void() dlord_magicb1 = [ $magicb1, dlord_magicb2 ] { + self.attack_track = self.enemy.origin; + self.attack_chance = self.attack_timer = 0; + dlord_shieldoff(); +}; +void() dlord_magicb2 = [ $magicb2, dlord_magicb3 ] {ai_trackenemy();}; +void() dlord_magicb3 = [ $magicb3, dlord_magicb4 ] {ai_trackenemy();}; +void() dlord_magicb4 = [ $magicb4, dlord_magicb5 ] {ai_trackenemy();}; +void() dlord_magicb5 = [ $magicb5, dlord_magicb6 ] {ai_trackenemy();}; +void() dlord_magicb6 = [ $magicb6, dlord_magicb7 ] {ai_trackenemy();}; +void() dlord_magicb7 = [ $magicb7, dlord_magicb8 ] {ai_trackenemy();}; +void() dlord_magicb8 = [ $magicb8, dlord_magicb9 ] {ai_trackenemy();}; +void() dlord_magicb9 = [ $magicb9, dlord_magicb10] { + // Is the enemy active and self alive? + if (self.enemy && self.health > 0) { + dlord_attackb(); // Fire projectile + + // Anymore projectiles to fire? + if (self.attack_chance < MONAI_DLORDMAX) { + // Is the player still visible? + if ( visxray(self.enemy, self.attack_offset, '0 0 0', FALSE) ) { + self.attack_timer = time + 0.8; + } + // Is the enemy in view timer still active? + if (self.attack_timer > time) self.think = dlord_magicb8; + } + } +}; +void() dlord_magicb10 = [ $magicb10, dlord_magicb11 ] {}; +void() dlord_magicb11 = [ $magicb11, dlord_magicb12 ] {}; +void() dlord_magicb12 = [ $magicb12, dlord_magicb13 ] {}; +void() dlord_magicb13 = [ $magicb13, dlord_slow1 ] {ai_face();}; + +//============================================================================ +void() dlord_pain1 =[ $pain1, dlord_pain2 ] {}; +void() dlord_pain2 =[ $pain2, dlord_pain3 ] {}; +void() dlord_pain3 =[ $pain3, dlord_pain4 ] {}; +void() dlord_pain4 =[ $pain4, dlord_pain5 ] {}; +void() dlord_pain5 =[ $pain5, dlord_slow1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dlord_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) dlord_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.5; + self.axhitme = 0; + dlord_pain1 (); + } + } +}; + +//============================================================================ +void() dlord_die1 =[ $death1, dlord_die2 ] {ai_forward(10);}; +void() dlord_die2 =[ $death2, dlord_die3 ] {monster_check_gib();ai_forward(8);}; +void() dlord_die3 =[ $death3, dlord_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dlord_die4 =[ $death4, dlord_die5 ] {}; +void() dlord_die5 =[ $death5, dlord_die6 ] {}; +void() dlord_die6 =[ $death6, dlord_die7 ] {}; +void() dlord_die7 =[ $death7, dlord_die8 ] {}; +void() dlord_die8 =[ $death8, dlord_die9 ] {ai_forward(10);}; +void() dlord_die9 =[ $death9, dlord_die10 ] {ai_forward(11);}; +void() dlord_die10 =[ $death10, dlord_die11 ] {}; +void() dlord_die11 =[ $death11, dlord_die12 ] {monster_death_postcheck();}; +void() dlord_die12 =[ $death12, dlord_die12 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dlord_dieb1 =[ $deathb1, dlord_dieb2 ] {}; +void() dlord_dieb2 =[ $deathb2, dlord_dieb3 ] {monster_check_gib();}; +void() dlord_dieb3 =[ $deathb3, dlord_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dlord_dieb4 =[ $deathb4, dlord_dieb5 ] {}; +void() dlord_dieb5 =[ $deathb5, dlord_dieb6 ] {}; +void() dlord_dieb6 =[ $deathb6, dlord_dieb7 ] {}; +void() dlord_dieb7 =[ $deathb7, dlord_dieb8 ] {}; +void() dlord_dieb8 =[ $deathb8, dlord_dieb9 ] {monster_death_postcheck();}; +void() dlord_dieb9 =[ $deathb9, dlord_dieb9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dlord_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) dlord_die1 (); // Forward - standard + else dlord_dieb1 (); // Backward - standard + } +}; + +//============================================================================ +void() dlord_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +/*====================================================================== + QUAKED monster_death_lord (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_death_lord = +{ + if (deathmatch) { remove(self); return; } + + // No head model defined + self.mdl = "progs/mon_dlord.mdl"; // hknight.mdl (quoth) + self.gib1mdl = "progs/h_dlord.mdl"; // h_dlord.mdl (quoth) + self.gib2mdl = "progs/w_hknightsword.mdl"; // Unique sword + self.gib3mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib4mdl = "progs/gib_knfoot_r.mdl"; // right foot + + // The Quoth head model only has 1 skin which does not match the + // dlord model which has 2, so throw the head as a custom gib instead + precache_model (self.mdl); + precache_model (MODEL_PROJ_DLORD1); // Copy of proj_serg.mdl + precache_model (self.gib1mdl); // Head gib (skin probs) + precache_model (self.gib2mdl); // Old HK Sword + precache_model (self.gib3mdl); // HK foot + precache_model (self.gib4mdl); + precache_model (MODEL_PROJ_NOUR3); // Lightning bolt + + self.gib2sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib3mdl = string_null; + if (random() < 0.5) self.gib4mdl = string_null; + + self.idle_sound = "dlord/idle.wav"; + precache_sound (self.idle_sound); + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the + // filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + // precache sight, pain and death (changes on type) + self.sight_sound = "dlord/sight.wav"; + precache_sound (self.sight_sound); + + // Pain and Death and Taxes! + self.pain_sound = "dlord/pain.wav"; + precache_sound (self.pain_sound); + self.death_sound = "dlord/death.wav"; + precache_sound (self.death_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 400; + self.gibhealth = -50; // Not easy to gib + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 60; // Medium pain threshold + self.pain_timeout = 2; // High pain threshold + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEHEAVY; // Heavy Hell Knight + self.attack_offset = '20 0 24'; // End of sword + self.exactskin = 1; // Rotting Lord skin + self.poisonous = FALSE; // No support for this + self.deathstring = " was executed by a Death Lord\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Using alt magic and charge attacks + self.th_checkattack = DLordCheckAttack; + self.th_stand = dlord_stand1; // Idling on feet + self.th_walk = dlord_walk1; // Walking + self.th_run = dlord_slow1; // Running + self.th_melee = dlord_magica1; // Sword attack + self.th_missile = dlord_magicb1; // Spike ball attack + self.th_updmissile = dlord_spike_think; // Update flying spikeball + self.th_pain = dlord_pain; // Stumble and pain + self.th_die = dlord_die; // Face meets floor + + self.classtype = CT_MONDLORD; + self.classgroup = CG_DCAPTAIN; // Classic tincan! + self.classmove = MON_MOVEWALK; + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_dog.qc b/QC_other/QC_arcane/mon_dog.qc new file mode 100644 index 00000000..bf74d2ac --- /dev/null +++ b/QC_other/QC_arcane/mon_dog.qc @@ -0,0 +1,423 @@ +/*============================================================================== +DOG +==============================================================================*/ +$cd id1/models/dog +$origin 0 0 24 +$base base +$skin skin + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 deathb9 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 +$frame painb9 painb10 painb11 painb12 painb13 painb14 painb15 painb16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +// Idle 1 - Growling +$frame idlea1 idlea2 idlea3 idlea4 idlea5 idlea6 idlea7 idlea8 +$frame idlea9 idlea10 idlea11 idlea12 idlea13 idlea14 idlea15 idlea16 +$frame idlea17 idlea18 + +// Idle 2 - Sniffing ground +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 +$frame idleb9 idleb10 idleb11 idleb12 idleb13 idleb14 + +// Walk B - walking and sniffing +$frame walkb1 walkb2 walkb3 walkb4 walkb5 walkb6 walkb7 walkb8 + +// Idle 3 - Howling at the moon +$frame idlec1 idlec2 idlec3 idlec4 idlec5 idlec6 idlec7 idlec8 +$frame idlec9 idlec10 idlec11 idlec12 idlec13 idlec14 + +void() dog_walkb1; + +//============================================================================ +void() dog_idlea1 =[ $idlea1, dog_idlea2 ] {self.idlebusy = TRUE; + monster_idle_sound(); ai_stand();}; +void() dog_idlea2 =[ $idlea2, dog_idlea3 ] {ai_stand();}; +void() dog_idlea3 =[ $idlea3, dog_idlea4 ] {ai_stand();}; +void() dog_idlea4 =[ $idlea4, dog_idlea5 ] {ai_stand();}; +void() dog_idlea5 =[ $idlea5, dog_idlea6 ] {ai_stand();}; +void() dog_idlea6 =[ $idlea6, dog_idlea7 ] {ai_stand();}; +void() dog_idlea7 =[ $idlea7, dog_idlea8 ] {ai_stand();}; +void() dog_idlea8 =[ $idlea8, dog_idlea9 ] {ai_stand();}; +void() dog_idlea9 =[ $idlea9, dog_idlea10 ] {ai_stand();}; +void() dog_idlea10=[ $idlea10, dog_idlea11 ] {ai_stand();}; +void() dog_idlea11=[ $idlea11, dog_idlea12 ] {ai_stand();}; +void() dog_idlea12=[ $idlea12, dog_idlea13 ] {ai_stand();}; +void() dog_idlea13=[ $idlea13, dog_idlea14 ] {ai_stand();}; +void() dog_idlea14=[ $idlea14, dog_idlea15 ] {ai_stand();}; +void() dog_idlea15=[ $idlea15, dog_idlea16 ] {ai_stand();}; +void() dog_idlea16=[ $idlea16, dog_idlea17 ] {ai_stand();}; +void() dog_idlea17=[ $idlea17, dog_idlea18 ] {ai_stand();}; +void() dog_idlea18=[ $idlea18, dog_stand1 ] {ai_stand();}; + +//============================================================================ +void() dog_idleb1 =[ $idleb1, dog_idleb2 ] {self.idlebusy = TRUE; + monster_idle_sound(); ai_stand();}; +void() dog_idleb2 =[ $idleb2, dog_idleb3 ] {ai_stand();}; +void() dog_idleb3 =[ $idleb3, dog_idleb4 ] {ai_stand();}; +void() dog_idleb4 =[ $idleb4, dog_idleb5 ] {ai_stand();}; +void() dog_idleb5 =[ $idleb5, dog_idleb6 ] {ai_stand();}; +void() dog_idleb6 =[ $idleb6, dog_idleb7 ] {ai_stand();}; +void() dog_idleb7 =[ $idleb7, dog_idleb8 ] {ai_stand();}; +void() dog_idleb8 =[ $idleb8, dog_idleb9 ] {ai_stand();}; +void() dog_idleb9 =[ $idleb9, dog_idleb10 ] {ai_stand();}; +void() dog_idleb10=[ $idleb10, dog_idleb11 ] {ai_stand();}; +void() dog_idleb11=[ $idleb11, dog_idleb12 ] {ai_stand();}; +void() dog_idleb12=[ $idleb12, dog_idleb13 ] {ai_stand();}; +void() dog_idleb13=[ $idleb13, dog_idleb14 ] {ai_stand();}; +void() dog_idleb14=[ $idleb14, dog_stand1 ] {ai_stand();}; + +//============================================================================ +void() dog_idlec1 =[ $idlec1, dog_idlec2 ] {self.idlebusy = TRUE; + monster_idle_sound(); ai_stand();}; +void() dog_idlec2 =[ $idlec2, dog_idlec3 ] {ai_stand();}; +void() dog_idlec3 =[ $idlec3, dog_idlec4 ] {ai_stand();}; +void() dog_idlec4 =[ $idlec4, dog_idlec5 ] {ai_stand();}; +void() dog_idlec5 =[ $idlec5, dog_idlec6 ] {ai_stand();}; +void() dog_idlec6 =[ $idlec6, dog_idlec7 ] {ai_stand();}; +void() dog_idlec7 =[ $idlec7, dog_idlec8 ] {ai_stand();}; +void() dog_idlec8 =[ $idlec8, dog_idlec9 ] {ai_stand();}; +void() dog_idlec9 =[ $idlec9, dog_idlec10 ] {ai_stand();}; +void() dog_idlec10=[ $idlec10, dog_idlec11 ] {ai_stand();}; +void() dog_idlec11=[ $idlec11, dog_idlec12 ] {ai_stand();}; +void() dog_idlec12=[ $idlec12, dog_idlec13 ] {ai_stand();}; +void() dog_idlec13=[ $idlec13, dog_idlec14 ] {ai_stand();}; +void() dog_idlec14=[ $idlec14, dog_stand1 ] {ai_stand();}; + +//============================================================================ +void() dog_stand1 =[ $stand1, dog_stand2 ] {self.idlebusy = FALSE; ai_stand();}; +void() dog_stand2 =[ $stand2, dog_stand3 ] {ai_stand();}; +void() dog_stand3 =[ $stand3, dog_stand4 ] {ai_stand();}; +void() dog_stand4 =[ $stand4, dog_stand5 ] {ai_stand();}; +void() dog_stand5 =[ $stand5, dog_stand6 ] {ai_stand();}; +void() dog_stand6 =[ $stand6, dog_stand7 ] {ai_stand();}; +void() dog_stand7 =[ $stand7, dog_stand8 ] {ai_stand();}; +void() dog_stand8 =[ $stand8, dog_stand9 ] {ai_stand();}; +void() dog_stand9 =[ $stand9, dog_stand1 ] { + if (random() < MON_IDLE_ANIMATION) { + self.lip = random(); + if (self.lip < 0.2) self.think = dog_idlec1; // Howling at moon + else if (self.lip < 0.4) self.think = dog_idleb1; // sniff ground + else self.think = dog_idlea1; // Growling + } + ai_stand(); +}; + +//============================================================================ +void() dog_walk1 =[ $walk1 , dog_walk2 ] {monster_idle_sound(); ai_walk(8);}; +void() dog_walk2 =[ $walk2 , dog_walk3 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walk3 =[ $walk3 , dog_walk4 ] {ai_walk(8);}; +void() dog_walk4 =[ $walk4 , dog_walk5 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walk5 =[ $walk5 , dog_walk6 ] {ai_walk(8);}; +void() dog_walk6 =[ $walk6 , dog_walk7 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walk7 =[ $walk7 , dog_walk8 ] {ai_walk(8);}; +void() dog_walk8 =[ $walk8 , dog_walk1 ] { + // Random chance the dog will sniff the ground when walking/patrolling + if (random() < MON_IDLE_ANIMATION) self.think = dog_walkb1; + monster_footstep(FALSE); ai_walk(8); +}; + +//---------------------------------------------------------------------- +void() dog_walkb1 =[ $walkb1 , dog_walkb2 ] {self.idlebusy = TRUE; monster_idle_sound();ai_walk(8);}; +void() dog_walkb2 =[ $walkb2 , dog_walkb3 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walkb3 =[ $walkb3 , dog_walkb4 ] {ai_walk(8);}; +void() dog_walkb4 =[ $walkb4 , dog_walkb5 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walkb5 =[ $walkb5 , dog_walkb6 ] {ai_walk(8);}; +void() dog_walkb6 =[ $walkb6 , dog_walkb7 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walkb7 =[ $walkb7 , dog_walkb8 ] {ai_walk(8);}; +void() dog_walkb8 =[ $walkb8 , dog_walk1 ] {monster_footstep(FALSE); ai_walk(8);}; + +//============================================================================ +void() dog_run1 =[ $run1 , dog_run2 ] {monster_idle_sound(); ai_run(16);}; +void() dog_run2 =[ $run2 , dog_run3 ] {monster_footstep(FALSE); ai_run(32);}; +void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);}; +void() dog_run4 =[ $run4 , dog_run5 ] {monster_footstep(FALSE); ai_run(20);}; +void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);}; +void() dog_run6 =[ $run6 , dog_run7 ] {ai_run(32);}; +void() dog_run7 =[ $run7 , dog_run8 ] {monster_footstep(FALSE); ai_run(16);}; +void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);}; +void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);}; +void() dog_run10 =[ $run10 , dog_run11 ] {monster_footstep(FALSE); ai_run(20);}; +void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);}; +void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);}; + +//=========================================================================== +// melee - dog_bite +// Standardized layout (matching ai_melee (aisubs.qc) +// Added z depth check on attacks +/- 64 units +// Added extra blood (touch version, no arc) +// Changed some explicit values to constant variables +//=========================================================================== +void() dog_bite = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEDOG)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + // Dog bite is nasty damage (1-24) + ldmg = (random() + random() + random()) * 8; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Spawn some blood from mouth + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() dog_atta1 =[ $attack1, dog_atta2 ] {ai_charge(10);}; +void() dog_atta2 =[ $attack2, dog_atta3 ] {ai_charge(10);}; +void() dog_atta3 =[ $attack3, dog_atta4 ] {ai_charge(10);}; +void() dog_atta4 =[ $attack4, dog_atta5 ] { +sound (self, CHAN_VOICE, "dog/dattack1.wav", 1, ATTN_NORM); +dog_bite();}; +void() dog_atta5 =[ $attack5, dog_atta6 ] {ai_charge(10);}; +void() dog_atta6 =[ $attack6, dog_atta7 ] {ai_charge(10);}; +void() dog_atta7 =[ $attack7, dog_atta8 ] {monster_footstep(FALSE);ai_charge(10);}; +void() dog_atta8 =[ $attack8, dog_run1 ] {ai_charge(10);}; + +//============================================================================ +// range - springy feet +//============================================================================ +void() Dog_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + + // Keep track of how many times touched the same object + if (self.jumptouch == other) self.jump_flag = time + MONAI_JUMPTIMEOUT; + self.jumptouch = other; // Keep track of touch target + + // Do not damage other dogs with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 10 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self.enemy, self.enemy, ldmg*3); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + } + } + + // Is the dog floating in the air? + if (!checkbottom(self)) { + // Is the dog standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() dog_leap1 =[ $leap1, dog_leap2 ] {ai_face();}; +void() dog_leap2 =[ $leap2, dog_leap3 ] { + ai_face(); + self.jump_flag = time; // No jump time limits + self.touch = Dog_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 300 + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() dog_leap3 =[ $leap3, dog_leap4 ] {}; +void() dog_leap4 =[ $leap4, dog_leap5 ] {}; +void() dog_leap5 =[ $leap5, dog_leap6 ] {}; +void() dog_leap6 =[ $leap6, dog_leap6 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = dog_leap2; + } + self.oldorigin = self.origin; +}; +void() dog_leap7 =[ $leap7, dog_leap8 ] {monster_footstep(FALSE);}; +void() dog_leap8 =[ $leap8, dog_leap9 ] {monster_footstep(FALSE);}; +void() dog_leap9 =[ $leap9, dog_run1 ] {ai_resetangles();}; + +/*====================================================================== + PAIN +========================================================================*/ +void() dog_pain1 =[ $pain1 , dog_pain2 ] {}; +void() dog_pain2 =[ $pain2 , dog_pain3 ] {}; +void() dog_pain3 =[ $pain3 , dog_pain4 ] {}; +void() dog_pain4 =[ $pain4 , dog_pain5 ] {}; +void() dog_pain5 =[ $pain5 , dog_pain6 ] {}; +void() dog_pain6 =[ $pain6 , dog_run1 ] {monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() dog_painb1 =[ $painb1 , dog_painb2 ] {}; +void() dog_painb2 =[ $painb2 , dog_painb3 ] {}; +void() dog_painb3 =[ $painb3 , dog_painb4 ] {ai_pain(4);}; +void() dog_painb4 =[ $painb4 , dog_painb5 ] {ai_pain(12);}; +void() dog_painb5 =[ $painb5 , dog_painb6 ] {ai_pain(12);}; +void() dog_painb6 =[ $painb6 , dog_painb7 ] {ai_pain(2);}; +void() dog_painb7 =[ $painb7 , dog_painb8 ] {}; +void() dog_painb8 =[ $painb8 , dog_painb9 ] {ai_pain(4);}; +void() dog_painb9 =[ $painb9 , dog_painb10 ] {}; +void() dog_painb10 =[ $painb10 , dog_painb11 ] {ai_pain(10);}; +void() dog_painb11 =[ $painb11 , dog_painb12 ] {monster_footstep(FALSE);}; +void() dog_painb12 =[ $painb12 , dog_painb13 ] {monster_footstep(FALSE);}; +void() dog_painb13 =[ $painb13 , dog_painb14 ] {}; +void() dog_painb14 =[ $painb14 , dog_painb15 ] {}; +void() dog_painb15 =[ $painb15 , dog_painb16 ] {}; +void() dog_painb16 =[ $painb16 , dog_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dog_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() > 0.5) dog_pain1 (); + else { + dog_painb1 (); // roll over + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +void() dog_die1 =[ $death1, dog_die2 ] {}; +void() dog_die2 =[ $death2, dog_die3 ] {monster_check_gib();}; +void() dog_die3 =[ $death3, dog_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dog_die4 =[ $death4, dog_die5 ] {}; +void() dog_die5 =[ $death5, dog_die6 ] {}; +void() dog_die6 =[ $death6, dog_die7 ] {}; +void() dog_die7 =[ $death7, dog_die8 ] {}; +void() dog_die8 =[ $death8, dog_die9 ] {monster_death_postcheck();}; +void() dog_die9 =[ $death9, dog_die9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {}; +void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {monster_check_gib();}; +void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {}; +void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {}; +void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {}; +void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {}; +void() dog_dieb8 =[ $deathb8, dog_dieb9 ] {monster_death_postcheck();}; +void() dog_dieb9 =[ $deathb9, dog_dieb9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dog_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); + + if (random() > 0.5) dog_die1 (); + else dog_dieb1 (); + } +}; + +/*====================================================================== +/*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush +======================================================================*/ +void() monster_dog = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dog.mdl"; + self.headmdl = "progs/h_dog.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + + self.idle_sound = "dog/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("dog/dattack1.wav"); + precache_sound ("dog/ddeath.wav"); + self.pain_sound = "dog/dpain1.wav"; + precache_sound (self.pain_sound); + + self.sight_sound = "dog/dsight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = '-32 -32 -24'; // Original mega large bbox + self.idmaxs = '32 32 40'; + if (self.bboxtype < 1) self.bboxtype = BBOX_DOG; + if (self.health < 1) self.health = 25; + self.gibhealth = -35; + self.gibbed = FALSE; + self.pain_flinch = 10; // Easy response to pain + self.steptype = FS_TYPESLOW; // Tiny feet + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '24 0 10'; // Bite attack offset + self.deathstring = " was mauled by a Rottweiler\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DogCheckAttack; + self.th_stand = dog_stand1; + self.th_walk = dog_walk1; + self.th_run = dog_run1; + self.th_pain = dog_pain; + self.th_die = dog_die; + self.th_melee = dog_atta1; + self.th_jump = dog_leap1; + self.th_jumpexit = dog_leap8; + + self.classtype = CT_MONDOG; + self.classgroup = CG_DOG; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_drole.qc b/QC_other/QC_arcane/mon_drole.qc new file mode 100644 index 00000000..522e1d80 --- /dev/null +++ b/QC_other/QC_arcane/mon_drole.qc @@ -0,0 +1,511 @@ +/*============================================================================== +DROLE (Heavily inspired by Drole from Quoth - Kell/Necros/Preach) + + Interesting QC traits + * Two state monster which switches when HP percentage (70%) changes + * Will keep distance by moving sideways when in first state (passive) + * Has large amount of idle animations with long frame sets + * Runs fast enough in second state to catch most players + * Has two different run animation blocks for each state (diff speed) + * The range projectile attack starts slow and speeds up over time + * Melee claw attacks can be chained together into frenzy mode + * Has a really long death animation, can be misleading for players + +==============================================================================*/ +// Stand idle - Tentacle eye looks left +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 standA13 standA14 standA15 standA16 +$frame standA17 standA18 standA19 standA20 standA21 standA22 standA23 standA24 +$frame standA25 standA26 standA27 standA28 standA29 standA30 + +// Stand idle - Tentacle eye looks around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 +$frame standB25 standB26 standB27 standB28 standB29 standB30 standB31 standB32 +$frame standB33 standB34 standB35 standB36 standB37 standB38 standB39 standB40 + +// Stand idle - Swings arms back and forth +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 +$frame standC25 standC26 standC27 standC28 standC29 standC30 + +// Fireball attack +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 magic9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +// Jump up 1-5, 6=flying +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame clawR1 clawR2 clawR3 clawR4 clawR5 clawR6 clawR7 clawR8 +$frame clawR9 clawR10 clawR11 clawR12 clawR13 clawR14 clawR15 clawR16 + +$frame clawL1 clawL2 clawL3 clawL4 clawL5 clawL6 clawL7 clawL8 +$frame clawL9 clawL10 clawL11 clawL12 clawL13 clawL14 clawL15 clawL16 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 death23 death24 +$frame death25 death26 + +$frame base1 base2 base3 + +//============================================================================ +void() drole_standA1 =[ $standA1, drole_standA2 ] {monster_idle_sound(); ai_stand();}; +void() drole_standA2 =[ $standA2, drole_standA3 ] {ai_stand();}; +void() drole_standA3 =[ $standA3, drole_standA4 ] {ai_stand();}; +void() drole_standA4 =[ $standA4, drole_standA5 ] {ai_stand();}; +void() drole_standA5 =[ $standA5, drole_standA6 ] {ai_stand();}; +void() drole_standA6 =[ $standA6, drole_standA7 ] {ai_stand();}; +void() drole_standA7 =[ $standA7, drole_standA8 ] {ai_stand();}; +void() drole_standA8 =[ $standA8, drole_standA9 ] {ai_stand();}; +void() drole_standA9 =[ $standA9, drole_standA10 ] {ai_stand();}; +void() drole_standA10 =[ $standA10, drole_standA11 ] {ai_stand();}; +void() drole_standA11 =[ $standA11, drole_standA12 ] {ai_stand();}; +void() drole_standA12 =[ $standA12, drole_standA13 ] {ai_stand();}; +void() drole_standA13 =[ $standA13, drole_standA14 ] {ai_stand();}; +void() drole_standA14 =[ $standA14, drole_standA15 ] {ai_stand();}; +void() drole_standA15 =[ $standA15, drole_standA16 ] {ai_stand();}; +void() drole_standA16 =[ $standA16, drole_standA17 ] {ai_stand();}; +void() drole_standA17 =[ $standA17, drole_standA18 ] {ai_stand();}; +void() drole_standA18 =[ $standA18, drole_standA19 ] {ai_stand();}; +void() drole_standA19 =[ $standA19, drole_standA20 ] {ai_stand();}; +void() drole_standA20 =[ $standA20, drole_standA21 ] {ai_stand();}; +void() drole_standA21 =[ $standA21, drole_standA22 ] {ai_stand();}; +void() drole_standA22 =[ $standA22, drole_standA23 ] {ai_stand();}; +void() drole_standA23 =[ $standA23, drole_standA24 ] {ai_stand();}; +void() drole_standA24 =[ $standA24, drole_standA25 ] {ai_stand();}; +void() drole_standA25 =[ $standA25, drole_standA26 ] {ai_stand();}; +void() drole_standA26 =[ $standA26, drole_standA27 ] {ai_stand();}; +void() drole_standA27 =[ $standA27, drole_standA28 ] {ai_stand();}; +void() drole_standA28 =[ $standA28, drole_standA29 ] {ai_stand();}; +void() drole_standA29 =[ $standA29, drole_standA30 ] {ai_stand();}; +void() drole_standA30 =[ $standA30, drole_standC1 ] {ai_stand();}; + +//============================================================================ +void() drole_standB1 =[ $standB1, drole_standB2 ] {monster_idle_sound(); ai_stand();}; +void() drole_standB2 =[ $standB2, drole_standB3 ] {ai_stand();}; +void() drole_standB3 =[ $standB3, drole_standB4 ] {ai_stand();}; +void() drole_standB4 =[ $standB4, drole_standB5 ] {ai_stand();}; +void() drole_standB5 =[ $standB5, drole_standB6 ] {ai_stand();}; +void() drole_standB6 =[ $standB6, drole_standB7 ] {ai_stand();}; +void() drole_standB7 =[ $standB7, drole_standB8 ] {ai_stand();}; +void() drole_standB8 =[ $standB8, drole_standB9 ] {ai_stand();}; +void() drole_standB9 =[ $standB9, drole_standB10 ] {ai_stand();}; +void() drole_standB10 =[ $standB10, drole_standB11 ] {ai_stand();}; +void() drole_standB11 =[ $standB11, drole_standB12 ] {ai_stand();}; +void() drole_standB12 =[ $standB12, drole_standB13 ] {ai_stand();}; +void() drole_standB13 =[ $standB13, drole_standB14 ] {ai_stand();}; +void() drole_standB14 =[ $standB14, drole_standB15 ] {ai_stand();}; +void() drole_standB15 =[ $standB15, drole_standB16 ] {ai_stand();}; +void() drole_standB16 =[ $standB16, drole_standB17 ] {ai_stand();}; +void() drole_standB17 =[ $standB17, drole_standB18 ] {ai_stand();}; +void() drole_standB18 =[ $standB18, drole_standB19 ] {ai_stand();}; +void() drole_standB19 =[ $standB19, drole_standB20 ] {ai_stand();}; +void() drole_standB20 =[ $standB20, drole_standB21 ] {ai_stand();}; +void() drole_standB21 =[ $standB21, drole_standB22 ] {ai_stand();}; +void() drole_standB22 =[ $standB22, drole_standB23 ] {ai_stand();}; +void() drole_standB23 =[ $standB23, drole_standB24 ] {ai_stand();}; +void() drole_standB24 =[ $standB24, drole_standB25 ] {ai_stand();}; +void() drole_standB25 =[ $standB25, drole_standB26 ] {ai_stand();}; +void() drole_standB26 =[ $standB26, drole_standB27 ] {ai_stand();}; +void() drole_standB27 =[ $standB27, drole_standB28 ] {ai_stand();}; +void() drole_standB28 =[ $standB28, drole_standB29 ] {ai_stand();}; +void() drole_standB29 =[ $standB29, drole_standB30 ] {ai_stand();}; +void() drole_standB30 =[ $standB30, drole_standB31 ] {ai_stand();}; +void() drole_standB31 =[ $standB31, drole_standB32 ] {ai_stand();}; +void() drole_standB32 =[ $standB32, drole_standB33 ] {ai_stand();}; +void() drole_standB33 =[ $standB33, drole_standB34 ] {ai_stand();}; +void() drole_standB34 =[ $standB34, drole_standB35 ] {ai_stand();}; +void() drole_standB35 =[ $standB35, drole_standB36 ] {ai_stand();}; +void() drole_standB36 =[ $standB36, drole_standB37 ] {ai_stand();}; +void() drole_standB37 =[ $standB37, drole_standB38 ] {ai_stand();}; +void() drole_standB38 =[ $standB38, drole_standB39 ] {ai_stand();}; +void() drole_standB39 =[ $standB39, drole_standB40 ] {ai_stand();}; +void() drole_standB40 =[ $standB40, drole_standC1 ] {ai_stand();}; + +//============================================================================ +void() drole_standC1 =[ $standC1, drole_standC2 ] {monster_idle_sound(); ai_stand();}; +void() drole_standC2 =[ $standC2, drole_standC3 ] {ai_stand();}; +void() drole_standC3 =[ $standC3, drole_standC4 ] {ai_stand();}; +void() drole_standC4 =[ $standC4, drole_standC5 ] {ai_stand();}; +void() drole_standC5 =[ $standC5, drole_standC6 ] {ai_stand();}; +void() drole_standC6 =[ $standC6, drole_standC7 ] {ai_stand();}; +void() drole_standC7 =[ $standC7, drole_standC8 ] {ai_stand();}; +void() drole_standC8 =[ $standC8, drole_standC9 ] {ai_stand();}; +void() drole_standC9 =[ $standC9, drole_standC10 ] {ai_stand();}; +void() drole_standC10 =[ $standC10, drole_standC11 ] {ai_stand();}; +void() drole_standC11 =[ $standC11, drole_standC12 ] {ai_stand();}; +void() drole_standC12 =[ $standC12, drole_standC13 ] {ai_stand();}; +void() drole_standC13 =[ $standC13, drole_standC14 ] {ai_stand();}; +void() drole_standC14 =[ $standC14, drole_standC15 ] {ai_stand();}; +void() drole_standC15 =[ $standC15, drole_standC16 ] {ai_stand();}; +void() drole_standC16 =[ $standC16, drole_standC17 ] {ai_stand();}; +void() drole_standC17 =[ $standC17, drole_standC18 ] {ai_stand();}; +void() drole_standC18 =[ $standC18, drole_standC19 ] {ai_stand();}; +void() drole_standC19 =[ $standC19, drole_standC20 ] {ai_stand();}; +void() drole_standC20 =[ $standC20, drole_standC21 ] {ai_stand();}; +void() drole_standC21 =[ $standC21, drole_standC22 ] {ai_stand();}; +void() drole_standC22 =[ $standC22, drole_standC23 ] {ai_stand();}; +void() drole_standC23 =[ $standC23, drole_standC24 ] {ai_stand();}; +void() drole_standC24 =[ $standC24, drole_standC25 ] {ai_stand();}; +void() drole_standC25 =[ $standC25, drole_standC26 ] {ai_stand();}; +void() drole_standC26 =[ $standC26, drole_standC27 ] {ai_stand();}; +void() drole_standC27 =[ $standC27, drole_standC28 ] {ai_stand();}; +void() drole_standC28 =[ $standC28, drole_standC29 ] {ai_stand();}; +void() drole_standC29 =[ $standC29, drole_standC30 ] {ai_stand();}; +void() drole_standC30 =[ $standC30, drole_standC1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + self.lefty = random(); + if (self.lefty < 0.3) self.think = drole_standA1; + else if (self.lefty < 0.6) self.think = drole_standB1; + else self.think = drole_standC1; + } + ai_stand(); +}; + +//============================================================================ +void() drole_walk1 =[ $walk1, drole_walk2 ] {monster_footstep(FALSE); +monster_idle_sound(); ai_walk(10);}; +void() drole_walk2 =[ $walk2, drole_walk3 ] {ai_walk(9);}; +void() drole_walk3 =[ $walk3, drole_walk4 ] {ai_walk(9);}; +void() drole_walk4 =[ $walk4, drole_walk5 ] {ai_walk(5);}; +void() drole_walk5 =[ $walk5, drole_walk6 ] {monster_footstep(FALSE); ai_walk(6);}; +void() drole_walk6 =[ $walk6, drole_walk7 ] {ai_walk(12);}; +void() drole_walk7 =[ $walk7, drole_walk8 ] {ai_walk(8);}; +void() drole_walk8 =[ $walk8, drole_walk1 ] {ai_walk(3);}; + +//============================================================================ +// Drole's have two run speeds, regular and rage +// * each run type uses different animation sets +// * once the drole is enraged there is no going back +// * moved the health trigger to a percentage (custom HP) +//============================================================================ +void() drole_run; + +void() drole_rage1 = [ $run1, drole_rage2 ] {monster_idle_sound();ai_run(27);}; +void() drole_rage2 = [ $run2, drole_rage3 ] {ai_run(26);}; +void() drole_rage3 = [ $run3, drole_rage4 ] {ai_run(30);}; +void() drole_rage4 = [ $run4, drole_rage5 ] {monster_footstep(FALSE); ai_run(28);}; +void() drole_rage5 = [ $run5, drole_rage6 ] {ai_run(27);}; +void() drole_rage6 = [ $run6, drole_rage7 ] {ai_run(26);}; +void() drole_rage7 = [ $run7, drole_rage8 ] {ai_run(30);}; +void() drole_rage8 = [ $run8, drole_run ] {monster_footstep(FALSE); ai_run(28);}; + +//---------------------------------------------------------------------- +void() drole_run1 = [ $walk1, drole_run2 ] {monster_footstep(FALSE); ai_run(15);}; +void() drole_run2 = [ $walk2, drole_run3 ] {monster_idle_sound();ai_run(14);}; +void() drole_run3 = [ $walk3, drole_run4 ] {ai_run(14);}; +void() drole_run4 = [ $walk4, drole_run5 ] {ai_run(10);}; +void() drole_run5 = [ $walk5, drole_run6 ] {monster_footstep(FALSE); ai_run(11);}; +void() drole_run6 = [ $walk6, drole_run7 ] {ai_run(17);}; +void() drole_run7 = [ $walk7, drole_run8 ] {ai_run(13);}; +void() drole_run8 = [ $walk8, drole_run ] {ai_run(8);}; + +//---------------------------------------------------------------------- +void() drole_run = +{ + if (self.attack_rage) drole_rage1(); + else drole_run1(); +}; + +//=========================================================================== +// MELEE ATTACK - Double claws +//=========================================================================== +void(float side) drole_claw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + ai_damagebreakable(50); // Damage any breakables + + if (!ai_checkmelee(MONAI_MELEEDROLE1) || !self.enemy.takedamage) { + // Melee claw miss sound + sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM); + } + else { + // Melee claw hit sound + if (random() < 0.5) sound (self, CHAN_WEAPON, "drole/strike1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "drole/strike2.wav", 1, ATTN_NORM); + ldmg = 12 + 6*random(); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + } +}; + +//---------------------------------------------------------------------- +void(float ragespd) drole_charge = +{ + if (self.attack_rage) ai_charge(ragespd); + else ai_charge(rint(ragespd*0.7)); +} + +//---------------------------------------------------------------------- +void() drole_clawL1; +//---------------------------------------------------------------------- +void() drole_clawR1 = [ $clawR1, drole_clawR2 ] {drole_charge(27);}; +void() drole_clawR2 = [ $clawR2, drole_clawR3 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawR3 = [ $clawR3, drole_clawR4 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawR4 = [ $clawR4, drole_clawR5 ] {drole_charge(28);}; +void() drole_clawR5 = [ $clawR5, drole_clawR6 ] {drole_charge(27); +drole_claw(-250);}; +void() drole_clawR6 = [ $clawR6, drole_clawR7 ] {drole_charge(26);}; +void() drole_clawR7 = [ $clawR7, drole_clawR8 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawR8 = [ $clawR8, drole_clawR9 ] {drole_charge(28);}; +void() drole_clawR9 = [ $clawR9, drole_clawR10 ] {drole_charge(27);}; +void() drole_clawR10 = [ $clawR10, drole_clawR11 ] {drole_charge(26);}; +void() drole_clawR11 = [ $clawR11, drole_clawR12 ] {monster_footstep(FALSE);drole_charge(30); +drole_claw(-250);}; +void() drole_clawR12 = [ $clawR12, drole_clawR13 ] {drole_charge(28);}; +void() drole_clawR13 = [ $clawR13, drole_clawR14 ] {drole_charge(27);}; +void() drole_clawR14 = [ $clawR14, drole_clawR15 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawR15 = [ $clawR15, drole_clawR16 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawR16 = [ $clawR16, drole_run ] {drole_charge(28); + if (random() < 0.5 && ai_checkmelee(MONAI_MELEEDROLE2) && + self.enemy.health > 0 && visible(self.enemy)) drole_clawL1(); +}; + +//---------------------------------------------------------------------- +void() drole_clawL1 = [ $clawL1, drole_clawL2 ] {drole_charge(27);}; +void() drole_clawL2 = [ $clawL2, drole_clawL3 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawL3 = [ $clawL3, drole_clawL4 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawL4 = [ $clawL4, drole_clawL5 ] {drole_charge(28);}; +void() drole_clawL5 = [ $clawL5, drole_clawL6 ] {drole_charge(27); +drole_claw(250);}; +void() drole_clawL6 = [ $clawL6, drole_clawL7 ] {drole_charge(26);}; +void() drole_clawL7 = [ $clawL7, drole_clawL8 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawL8 = [ $clawL8, drole_clawL9 ] {drole_charge(28);}; +void() drole_clawL9 = [ $clawL9, drole_clawL10 ] {drole_charge(27);}; +void() drole_clawL10 = [ $clawL10, drole_clawL11 ] {drole_charge(26);}; +void() drole_clawL11 = [ $clawL11, drole_clawL12 ] {monster_footstep(FALSE);drole_charge(30); +drole_claw(250);}; +void() drole_clawL12 = [ $clawL12, drole_clawL13 ] {drole_charge(28);}; +void() drole_clawL13 = [ $clawL13, drole_clawL14 ] {drole_charge(27);}; +void() drole_clawL14 = [ $clawL14, drole_clawL15 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawL15 = [ $clawL15, drole_clawL16 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawL16 = [ $clawL16, drole_run ] {drole_charge(28); + if (random() < 0.5 && ai_checkmelee(MONAI_MELEEDROLE2) && + self.enemy.health > 0 && visible(self.enemy)) drole_clawR1(); +}; + +//---------------------------------------------------------------------- +void() drole_melee = +{ + if (random() < 0.5) drole_clawR1(); + else drole_clawL1(); +}; + +//============================================================================ +// RANGE ATTACK - Fireball (rocket) +// * The trick to drole rockets is that they start really slow +// * Over time (4 frames) the rocket speeds up (linked to animation) +// * requires special projectile and new th_updmissile function +// * Has a different explosion sound (does not play rocket default) +// +//============================================================================ +void() drole_rocket1 = [ 1, drole_rocket2 ] {self.nextthink = time + 0.2;}; +void() drole_rocket2 = [ 2, drole_rocket3 ] {self.velocity = self.velocity * 1.5;}; +void() drole_rocket3 = [ 3, drole_rocket4 ] {self.velocity = self.velocity * 1.5;}; +void() drole_rocket4 = [ 3, SUB_Remove ] { + self.nextthink = time + 5; + if (skill == SKILL_EASY) self.velocity = self.velocity * 3.5; + else self.velocity = self.velocity * 4.5; +}; + +//---------------------------------------------------------------------- +void() drole_fire = +{ + local vector org, dir, avel; + if (!self.enemy) return; + if (self.health < 1) return; + + self.attack_speed = 80; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize((self.attack_track + '0 0 -8') - org); + avel = avel = vecrand(100,200,FALSE); + + Launch_Missile (org, dir, avel, CT_PROJ_DROLE, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() drole_magic1 = [ $magic1, drole_magic2 ] { + self.attack_track = self.enemy.origin; + sound(self, CHAN_WEAPON, "drole/fire.wav", 1, ATTN_NORM); +}; +void() drole_magic2 = [ $magic2, drole_magic3 ] {ai_trackenemy();}; +void() drole_magic3 = [ $magic3, drole_magic4 ] {ai_trackenemy();}; +void() drole_magic4 = [ $magic4, drole_magic5 ] {ai_trackenemy();drole_fire();}; +void() drole_magic5 = [ $magic5, drole_magic6 ] {ai_face();}; +void() drole_magic6 = [ $magic6, drole_magic7 ] {ai_face();}; +void() drole_magic7 = [ $magic7, drole_magic8 ] {ai_face();}; +void() drole_magic8 = [ $magic8, drole_magic9 ] {ai_face();}; +void() drole_magic9 = [ $magic9, drole_run ] {ai_face();}; + +//============================================================================ +void() drole_pain1 = [ $pain1, drole_pain2 ] {ai_back(8);}; +void() drole_pain2 = [ $pain2, drole_pain3 ] {ai_back(10);}; +void() drole_pain3 = [ $pain3, drole_pain4 ] {ai_back(10);}; +void() drole_pain4 = [ $pain4, drole_pain5 ] {ai_back(8);}; +void() drole_pain5 = [ $pain5, drole_pain6 ] {ai_back(6);}; +void() drole_pain6 = [ $pain6, drole_run ] {ai_back(4);}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) drole_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (self.attack_rage) sound (self, CHAN_VOICE, "drole/enrage.wav", 0.5, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) drole_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + drole_pain1 (); + } + } +}; + +//============================================================================ +void() drole_death1 = [ $death1, drole_death2 ] {}; +void() drole_death2 = [ $death2, drole_death3 ] {monster_check_gib();}; +void() drole_death3 = [ $death3, drole_death4 ] {monster_check_gib(); +self.solid = SOLID_NOT;}; +void() drole_death4 = [ $death4, drole_death5 ] {}; +void() drole_death5 = [ $death5, drole_death6 ] {}; +void() drole_death6 = [ $death6, drole_death7 ] {}; +void() drole_death7 = [ $death7, drole_death8 ] {}; +void() drole_death8 = [ $death8, drole_death9 ] {}; +void() drole_death9 = [ $death9, drole_death10 ] {}; +void() drole_death10 = [ $death10, drole_death11 ] {}; +void() drole_death11 = [ $death11, drole_death12 ] {}; +void() drole_death12 = [ $death12, drole_death13 ] {}; +void() drole_death13 = [ $death13, drole_death14 ] {}; +void() drole_death14 = [ $death14, drole_death15 ] {}; +void() drole_death15 = [ $death15, drole_death16 ] {}; +void() drole_death16 = [ $death16, drole_death17 ] {}; +void() drole_death17 = [ $death17, drole_death18 ] {}; +void() drole_death18 = [ $death18, drole_death19 ] {}; +void() drole_death19 = [ $death19, drole_death20 ] {}; +void() drole_death20 = [ $death20, drole_death21 ] {}; +void() drole_death21 = [ $death21, drole_death22 ] {}; +void() drole_death22 = [ $death22, drole_death23 ] {}; +void() drole_death23 = [ $death23, drole_death24 ] {}; +void() drole_death24 = [ $death24, drole_death25 ] {}; +void() drole_death25 = [ $death25, drole_death26 ] {monster_death_postcheck();}; +void() drole_death26 = [ $death26, drole_death26 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() drole_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "drole/death.wav", 1, ATTN_NORM); + drole_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_drole (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_drole = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_drole.mdl"; + self.headmdl = "progs/h_drole.mdl"; + self.gib1mdl = "progs/gib_drolearm1.mdl"; // Top arm (pose 1) + self.gib2mdl = "progs/gib_drolearm2.mdl"; // Top arm (pose 2) + self.gib3mdl = "progs/gib_droleleg1.mdl"; // stretched out leg + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (MODEL_PROJ_DROLE); // growing fireball + + self.idle_sound = "drole/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("drole/enrage.wav"); // sight2.wav + precache_sound ("drole/death.wav"); + self.pain_sound = "drole/pain.wav"; + precache_sound (self.pain_sound); + + precache_sound ("drole/fire.wav"); // Launch rockets + precache_sound ("drole/r_explode.wav"); // unique explosion sound + precache_sound ("drole/strike1.wav"); // melee impacts + precache_sound ("drole/strike2.wav"); + precache_sound ("drole/swipe.wav"); // Missed melee + + self.sight_sound = "drole/sight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_DROLEGRN); // growing poisonball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 500; + self.gibhealth = -60; // Hard to gib + self.gibbed = FALSE; + self.pain_flinch = 200; // takes alot to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // High pain threshold + self.steptype = FS_TYPEHEAVY; // heavy feet + self.blockudeath = TRUE; // no humanoid death sound + self.attack_offset = '0 0 34'; // Middle of chest + self.deathstring = " was decimated by a Drole\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DroleCheckAttack; + self.th_stand = drole_standC1; + self.th_walk = drole_walk1; + self.th_run = drole_run; + self.th_melee = drole_melee; // Claw attack + self.th_missile = drole_magic1; // Fireball incoming! + self.th_updmissile = drole_rocket1; // Update flying rocket + self.th_pain = drole_pain; + self.th_die = drole_die; + + self.classtype = CT_MONDROLE; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_dsergeant.qc b/QC_other/QC_arcane/mon_dsergeant.qc new file mode 100644 index 00000000..28b1cd71 --- /dev/null +++ b/QC_other/QC_arcane/mon_dsergeant.qc @@ -0,0 +1,628 @@ +/*============================================================================== +DEATH SERGEANT (hell knights ++) +==============================================================================*/ +$cd id1/models/dsergeant +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// (013 - 024) Stand idle - Shoulder hunch +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 + +// (025 - 048) Stand idle - Quick look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 + +// (049 - 072) Stand idle - checking flail +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 + +// (073 - 103) Stand idle - big sigh +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 standD21 standD22 standD23 standD24 +$frame standD25 standD26 standD27 standD28 standD29 standD30 standD31 + +// (104 - 117) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (118 - 123) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (124 - 138) Slice (one hand slashing run attack) (file=SWING) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 slice15 + +// (139 - 153) Smash (chop overhead to ground) (file=CHOP) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (154 - 175) W_Attack (two handed slashing attack) (file=SLASH) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 + +// (176 - 189) MagicC - Typical magic range attack (file=SWEEPCAST) +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 magicc12 magicc13 magicc14 + +// Pain animations A = Slow (190 - 194), D = Stagger (195 - 205) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (206 - 217) Charging attack A - swinging sword left to right infront +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 + +// (218 - 223) Charging attack B - rotating sword left to right infront +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// (224 - 235) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// (236 - 255) Death backwards with cool sword wobble +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 deathb15 deathb16 +$frame deathb17 deathb18 deathb19 deathb20 + +void() dsergeant_sword_sound; // Sword swipe sounds +void(float soundtype) dsergeant_grunt_sound; + +// Different types of grunting sounds +float DSERG_SOUND_SIDESWING = 1; +float DSERG_SOUND_OVERSMASH = 2; +float DSERG_SOUND_RUNSWING = 3; + +//=========================================================================== + +void() dsergeant_standA1 =[ $standA1, dsergeant_standA2 ] {ai_stand();}; +void() dsergeant_standA2 =[ $standA2, dsergeant_standA3 ] {ai_stand();}; +void() dsergeant_standA3 =[ $standA3, dsergeant_standA4 ] {ai_stand();}; +void() dsergeant_standA4 =[ $standA4, dsergeant_standA5 ] {ai_stand();}; +void() dsergeant_standA5 =[ $standA5, dsergeant_standA6 ] {ai_stand();}; +void() dsergeant_standA6 =[ $standA6, dsergeant_standA7 ] {ai_stand();}; +void() dsergeant_standA7 =[ $standA7, dsergeant_standA8 ] {ai_stand();}; +void() dsergeant_standA8 =[ $standA8, dsergeant_standA9 ] {ai_stand();}; +void() dsergeant_standA9 =[ $standA9, dsergeant_standA10 ] {ai_stand();}; +void() dsergeant_standA10 =[ $standA10, dsergeant_standA11 ] {ai_stand();}; +void() dsergeant_standA11 =[ $standA11, dsergeant_standA12 ] {ai_stand();}; +void() dsergeant_standA12 =[ $standA12, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dsergeant_standB1 =[ $standB1, dsergeant_standB2 ] {ai_stand();}; +void() dsergeant_standB2 =[ $standB2, dsergeant_standB3 ] {ai_stand();}; +void() dsergeant_standB3 =[ $standB3, dsergeant_standB4 ] {ai_stand();}; +void() dsergeant_standB4 =[ $standB4, dsergeant_standB5 ] {ai_stand();}; +void() dsergeant_standB5 =[ $standB5, dsergeant_standB6 ] {ai_stand();}; +void() dsergeant_standB6 =[ $standB6, dsergeant_standB7 ] {ai_stand();}; +void() dsergeant_standB7 =[ $standB7, dsergeant_standB8 ] {ai_stand();}; +void() dsergeant_standB8 =[ $standB8, dsergeant_standB9 ] {ai_stand();}; +void() dsergeant_standB9 =[ $standB9, dsergeant_standB10 ] {ai_stand();}; +void() dsergeant_standB10 =[ $standB10, dsergeant_standB11 ] {ai_stand();}; +void() dsergeant_standB11 =[ $standB11, dsergeant_standB12 ] {ai_stand();}; +void() dsergeant_standB12 =[ $standB12, dsergeant_standB13 ] {ai_stand();}; +void() dsergeant_standB13 =[ $standB13, dsergeant_standB14 ] {ai_stand();}; +void() dsergeant_standB14 =[ $standB14, dsergeant_standB15 ] {ai_stand();}; +void() dsergeant_standB15 =[ $standB15, dsergeant_standB16 ] {ai_stand();}; +void() dsergeant_standB16 =[ $standB16, dsergeant_standB17 ] {ai_stand();}; +void() dsergeant_standB17 =[ $standB17, dsergeant_standB18 ] {ai_stand();}; +void() dsergeant_standB18 =[ $standB18, dsergeant_standB19 ] {ai_stand();}; +void() dsergeant_standB19 =[ $standB19, dsergeant_standB20 ] {ai_stand();}; +void() dsergeant_standB20 =[ $standB20, dsergeant_standB21 ] {ai_stand();}; +void() dsergeant_standB21 =[ $standB21, dsergeant_standB22 ] {ai_stand();}; +void() dsergeant_standB22 =[ $standB22, dsergeant_standB23 ] {ai_stand();}; +void() dsergeant_standB23 =[ $standB23, dsergeant_standB24 ] {ai_stand();}; +void() dsergeant_standB24 =[ $standB24, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dsergeant_standC1 =[ $standC1, dsergeant_standC2 ] {ai_stand();}; +void() dsergeant_standC2 =[ $standC2, dsergeant_standC3 ] {ai_stand();}; +void() dsergeant_standC3 =[ $standC3, dsergeant_standC4 ] {ai_stand();}; +void() dsergeant_standC4 =[ $standC4, dsergeant_standC5 ] {ai_stand();}; +void() dsergeant_standC5 =[ $standC5, dsergeant_standC6 ] {ai_stand();}; +void() dsergeant_standC6 =[ $standC6, dsergeant_standC7 ] {ai_stand();}; +void() dsergeant_standC7 =[ $standC7, dsergeant_standC8 ] {ai_stand();}; +void() dsergeant_standC8 =[ $standC8, dsergeant_standC9 ] {ai_stand();}; +void() dsergeant_standC9 =[ $standC9, dsergeant_standC10 ] {ai_stand();}; +void() dsergeant_standC10 =[ $standC10, dsergeant_standC11 ] {ai_stand();}; +void() dsergeant_standC11 =[ $standC11, dsergeant_standC12 ] {ai_stand();}; +void() dsergeant_standC12 =[ $standC12, dsergeant_standC13 ] {ai_stand();}; +void() dsergeant_standC13 =[ $standC13, dsergeant_standC14 ] {ai_stand();}; +void() dsergeant_standC14 =[ $standC14, dsergeant_standC15 ] {ai_stand();}; +void() dsergeant_standC15 =[ $standC15, dsergeant_standC16 ] {ai_stand();}; +void() dsergeant_standC16 =[ $standC16, dsergeant_standC17 ] {ai_stand();}; +void() dsergeant_standC17 =[ $standC17, dsergeant_standC18 ] {ai_stand();}; +void() dsergeant_standC18 =[ $standC18, dsergeant_standC19 ] {ai_stand();}; +void() dsergeant_standC19 =[ $standC19, dsergeant_standC20 ] {ai_stand();}; +void() dsergeant_standC20 =[ $standC20, dsergeant_standC21 ] {ai_stand();}; +void() dsergeant_standC21 =[ $standC21, dsergeant_standC22 ] {ai_stand();}; +void() dsergeant_standC22 =[ $standC22, dsergeant_standC23 ] {ai_stand();}; +void() dsergeant_standC23 =[ $standC23, dsergeant_standC24 ] {ai_stand();}; +void() dsergeant_standC24 =[ $standC24, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +// skipped 7 frames to reduce the animation down to 2.4s (10fps) +void() dsergeant_standD1 =[ $standD1, dsergeant_standD2 ] {ai_stand(); + sound (self, CHAN_VOICE, "dknight/dserg_hbreath.wav", 1, ATTN_IDLE);}; +void() dsergeant_standD2 =[ $standD2, dsergeant_standD3 ] {ai_stand();}; +void() dsergeant_standD3 =[ $standD4, dsergeant_standD4 ] {ai_stand();}; +void() dsergeant_standD4 =[ $standD6, dsergeant_standD5 ] {ai_stand();}; +void() dsergeant_standD5 =[ $standD8, dsergeant_standD6 ] {ai_stand();}; +void() dsergeant_standD6 =[ $standD9, dsergeant_standD7 ] {ai_stand();}; +void() dsergeant_standD7 =[ $standD10, dsergeant_standD8 ] {ai_stand();}; +void() dsergeant_standD8 =[ $standD11, dsergeant_standD9 ] {ai_stand();}; +void() dsergeant_standD9 =[ $standD12, dsergeant_standD10 ] {ai_stand();}; +void() dsergeant_standD10 =[ $standD13, dsergeant_standD11 ] {ai_stand();}; +void() dsergeant_standD11 =[ $standD14, dsergeant_standD12 ] {ai_stand();}; +void() dsergeant_standD12 =[ $standD15, dsergeant_standD13 ] {ai_stand();}; +void() dsergeant_standD13 =[ $standD16, dsergeant_standD14 ] {ai_stand();}; +void() dsergeant_standD14 =[ $standD17, dsergeant_standD15 ] {ai_stand();}; +void() dsergeant_standD15 =[ $standD19, dsergeant_standD16 ] {ai_stand();}; +void() dsergeant_standD16 =[ $standD21, dsergeant_standD17 ] {ai_stand();}; +void() dsergeant_standD17 =[ $standD23, dsergeant_standD18 ] {ai_stand();}; +void() dsergeant_standD18 =[ $standD24, dsergeant_standD19 ] {ai_stand();}; +void() dsergeant_standD19 =[ $standD25, dsergeant_standD20 ] {ai_stand();}; +void() dsergeant_standD20 =[ $standD26, dsergeant_standD21 ] {ai_stand();}; +void() dsergeant_standD21 =[ $standD27, dsergeant_standD22 ] {ai_stand();}; +void() dsergeant_standD22 =[ $standD28, dsergeant_standD23 ] {ai_stand();}; +void() dsergeant_standD23 =[ $standD29, dsergeant_standD24 ] {ai_stand();}; +void() dsergeant_standD24 =[ $standD30, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dsergeant_stand1 =[ $stand1, dsergeant_stand2 ] {monster_idle_sound();ai_stand();}; +void() dsergeant_stand2 =[ $stand2, dsergeant_stand3 ] {ai_stand();}; +void() dsergeant_stand3 =[ $stand3, dsergeant_stand4 ] {ai_stand();}; +void() dsergeant_stand4 =[ $stand4, dsergeant_stand5 ] {ai_stand();}; +void() dsergeant_stand5 =[ $stand5, dsergeant_stand6 ] {ai_stand();}; +void() dsergeant_stand6 =[ $stand6, dsergeant_stand7 ] {ai_stand();}; +void() dsergeant_stand7 =[ $stand7, dsergeant_stand8 ] {ai_stand();}; +void() dsergeant_stand8 =[ $stand8, dsergeant_stand9 ] {ai_stand();}; +void() dsergeant_stand9 =[ $stand9, dsergeant_stand10 ] {ai_stand();}; +void() dsergeant_stand10 =[ $stand10, dsergeant_stand11 ] {ai_stand();}; +void() dsergeant_stand11 =[ $stand11, dsergeant_stand12 ] {ai_stand();}; +void() dsergeant_stand12 =[ $stand12, dsergeant_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + if (self.lip < 1) self.think = dsergeant_standD1; // Big Sigh + else if (self.lip < 2) self.think = dsergeant_standC1; // Look at weapon + else if (self.lip < 3) self.think = dsergeant_standA1; // Shoulder hunch + else self.think = dsergeant_standB1; // Look around + } + ai_stand();}; + +//=========================================================================== +void() dsergeant_walk1 =[ $walk1, dsergeant_walk2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_walk(2);}; +void() dsergeant_walk2 =[ $walk2, dsergeant_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dsergeant_walk3 =[ $walk3, dsergeant_walk4 ] {ai_walk(5);}; +void() dsergeant_walk4 =[ $walk4, dsergeant_walk5 ] {ai_walk(4);}; +void() dsergeant_walk5 =[ $walk5, dsergeant_walk6 ] {ai_walk(4);}; +void() dsergeant_walk6 =[ $walk6, dsergeant_walk7 ] {ai_walk(2);}; +void() dsergeant_walk7 =[ $walk7, dsergeant_walk8 ] {ai_walk(2);}; +void() dsergeant_walk8 =[ $walk8, dsergeant_walk9 ] {monster_footstep(FALSE); ai_walk(3);}; +void() dsergeant_walk9 =[ $walk9, dsergeant_walk10] {ai_walk(3);}; +void() dsergeant_walk10=[ $walk10, dsergeant_walk11] {ai_walk(4);}; +void() dsergeant_walk11=[ $walk11, dsergeant_walk12] {ai_walk(3);}; +void() dsergeant_walk12=[ $walk12, dsergeant_walk13] {ai_walk(4);}; +void() dsergeant_walk13=[ $walk13, dsergeant_walk14] {ai_walk(6);}; +void() dsergeant_walk14=[ $walk14, dsergeant_walk1 ] {ai_walk(2);}; + +//---------------------------------------------------------------------- +void() dsergeant_run1 =[ $run1, dsergeant_run2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_run (20); CheckForCharge(); }; +void() dsergeant_run2 =[ $run2, dsergeant_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() dsergeant_run3 =[ $run3, dsergeant_run4 ] {ai_run(16);}; +void() dsergeant_run4 =[ $run4, dsergeant_run5 ] {ai_run(14);}; +void() dsergeant_run5 =[ $run5, dsergeant_run6 ] {monster_footstep(FALSE); ai_run(25);}; +void() dsergeant_run6 =[ $run6, dsergeant_run1 ] {ai_run(13);}; + +//=========================================================================== +void() CheckForSergeantCharge = +{ + self.attack_timer = time + 0.3; + self.height = fabs(self.origin_z - self.enemy.origin_z); + + // If within melee range, go straight to melee + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.think = self.th_melee; + } + // Is the player visible or there is a large height difference? + else if (visblocked(self.enemy) || self.height > MONAI_CHARGEZAXIS) { + self.attack_state = AS_STRAIGHT; + self.think = dsergeant_run1; + } +}; + +//---------------------------------------------------------------------- +// Charging attack B - single swing of flail +void() dsergeant_char_b1 =[ $char_b1, dsergeant_char_b2 ] {ai_charge(23); + dsergeant_sword_sound();CheckForSergeantCharge();}; +void() dsergeant_char_b2 =[ $char_b2, dsergeant_char_b3 ] {ai_charge(17); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_b3 =[ $char_b3, dsergeant_char_b4 ] {ai_charge(12); + CheckForSergeantCharge();}; +void() dsergeant_char_b4 =[ $char_b4, dsergeant_char_b5 ] {ai_charge(22); + self.meleecontact = TRUE;ai_meleesmash(20);CheckForSergeantCharge();}; +void() dsergeant_char_b5 =[ $char_b5, dsergeant_char_b6 ] {ai_charge(18); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_b6 =[ $char_b6, dsergeant_char_b1 ] {ai_charge(8); + CheckForSergeantCharge();}; + +//---------------------------------------------------------------------- +// Charging attack A - swinging flail left to right infront +void() dsergeant_char_a1 =[ $char_a1, dsergeant_char_a2 ] {ai_charge(20); + dsergeant_sword_sound();CheckForSergeantCharge();}; +void() dsergeant_char_a2 =[ $char_a2, dsergeant_char_a3 ] {ai_charge(25); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a3 =[ $char_a3, dsergeant_char_a4 ] {ai_charge(18); + self.meleecontact = TRUE;ai_meleesmash(20);CheckForSergeantCharge();}; +void() dsergeant_char_a4 =[ $char_a4, dsergeant_char_a5 ] {ai_charge(16); + CheckForSergeantCharge();}; +void() dsergeant_char_a5 =[ $char_a5, dsergeant_char_a6 ] {ai_charge(14); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a6 =[ $char_a6, dsergeant_char_a7 ] {ai_charge(20); + CheckForSergeantCharge();}; +void() dsergeant_char_a7 =[ $char_a7, dsergeant_char_a8 ] {ai_charge(21); + dsergeant_sword_sound();CheckForSergeantCharge();}; +void() dsergeant_char_a8 =[ $char_a8, dsergeant_char_a9 ] {ai_charge(13); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a9 =[ $char_a9, dsergeant_char_a10] { ai_charge(20); + self.meleecontact = TRUE;ai_meleesmash(20);CheckForSergeantCharge();}; +void() dsergeant_char_a10=[ $char_a10,dsergeant_char_a11] {ai_charge(20); + CheckForSergeantCharge();}; +void() dsergeant_char_a11=[ $char_a11,dsergeant_char_a12] {ai_charge(18); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a12=[ $char_a12,dsergeant_char_b1 ] {ai_charge(16); + CheckForSergeantCharge();}; + +//---------------------------------------------------------------------- +void() dsergeant_charging = +{ + if (random() < 0.35) dsergeant_char_a1 (); // Slow left+right swing + else dsergeant_char_b1 (); // fast spin around head +}; + +//=========================================================================== +// Melee Attack 1 - Slice (one hand swinging run attack) +void() dsergeant_slice1 =[ $slice2, dsergeant_slice2 ] {ai_charge(9);}; +void() dsergeant_slice2 =[ $slice4, dsergeant_slice3 ] {ai_charge(6);monster_footstep(FALSE);}; +void() dsergeant_slice3 =[ $slice5, dsergeant_slice4 ] {ai_charge(13);}; +void() dsergeant_slice4 =[ $slice6, dsergeant_slice5 ] {ai_charge(4); + dsergeant_grunt_sound(DSERG_SOUND_SIDESWING);}; +void() dsergeant_slice5 =[ $slice7, dsergeant_slice6 ] {ai_charge(7);monster_footstep(FALSE);}; +void() dsergeant_slice6 =[ $slice8, dsergeant_slice7 ] {ai_charge(15);dsergeant_sword_sound();}; +void() dsergeant_slice7 =[ $slice9, dsergeant_slice8 ] {ai_charge(8); + self.meleecontact = TRUE;ai_meleesmash(30);}; +void() dsergeant_slice8 =[ $slice10, dsergeant_slice9 ] {ai_charge(2);monster_footstep(FALSE);}; +void() dsergeant_slice9 =[ $slice11, dsergeant_slice10 ] {ai_charge(0);}; +void() dsergeant_slice10 =[ $slice13, dsergeant_slice11 ] {ai_charge(0);monster_footstep(FALSE);}; +void() dsergeant_slice11 =[ $slice14, dsergeant_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +// Melee Attack 2 - Smash (chop overhead to ground) +void() dsergeant_smash1 =[ $smash2, dsergeant_smash3 ] {ai_charge(1);}; +void() dsergeant_smash3 =[ $smash3, dsergeant_smash4 ] {ai_charge(13);}; +void() dsergeant_smash4 =[ $smash4, dsergeant_smash5 ] {ai_charge(9);monster_footstep(FALSE);}; +void() dsergeant_smash5 =[ $smash5, dsergeant_smash6 ] {ai_charge(11); + dsergeant_grunt_sound(DSERG_SOUND_OVERSMASH);}; +void() dsergeant_smash6 =[ $smash6, dsergeant_smash7 ] {ai_charge(10);dsergeant_sword_sound();}; +void() dsergeant_smash7 =[ $smash7, dsergeant_smash8 ] {ai_charge(7);}; +void() dsergeant_smash8 =[ $smash8, dsergeant_smash9 ] {ai_charge(12); +self.meleecontact = TRUE;ai_meleesmash(30);monster_footstep(FALSE);}; +void() dsergeant_smash9 =[ $smash9, dsergeant_smash10 ] {ai_charge(2);}; +void() dsergeant_smash10 =[ $smash10, dsergeant_smash11 ] {ai_charge(3);}; +void() dsergeant_smash11 =[ $smash11, dsergeant_smash12 ] {ai_charge(0);}; +void() dsergeant_smash12 =[ $smash12, dsergeant_smash13 ] {ai_charge(0);}; +void() dsergeant_smash13 =[ $smash13, dsergeant_smash14 ] {ai_charge(0);}; +void() dsergeant_smash14 =[ $smash14, dsergeant_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - W_Attack (two handed swinging attack) +void() dsergeant_watk1 =[ $w_attack1, dsergeant_watk2 ] {ai_charge(2);}; +void() dsergeant_watk2 =[ $w_attack2, dsergeant_watk3 ] {ai_charge(0);monster_footstep(FALSE);}; +void() dsergeant_watk3 =[ $w_attack3, dsergeant_watk4 ] {ai_charge(0);}; +void() dsergeant_watk4 =[ $w_attack4, dsergeant_watk5 ] {ai_charge(0);dsergeant_sword_sound();}; +void() dsergeant_watk5 =[ $w_attack5, dsergeant_watk6 ] {ai_charge(0); + dsergeant_grunt_sound(DSERG_SOUND_RUNSWING);}; +void() dsergeant_watk6 =[ $w_attack6, dsergeant_watk7 ] {ai_charge(0);}; +void() dsergeant_watk7 =[ $w_attack7, dsergeant_watk8 ] {ai_charge(1); + self.meleecontact = TRUE;ai_meleesmash(20);monster_footstep(FALSE);}; +void() dsergeant_watk8 =[ $w_attack8, dsergeant_watk9 ] {ai_charge(4);}; +void() dsergeant_watk9 =[ $w_attack9, dsergeant_watk10] {ai_charge(5);}; +void() dsergeant_watk10=[ $w_attack10,dsergeant_watk11] {ai_charge(3);}; +void() dsergeant_watk11=[ $w_attack11,dsergeant_watk12] {ai_charge(2);}; +void() dsergeant_watk12=[ $w_attack12,dsergeant_watk13] {ai_charge(2);}; +void() dsergeant_watk13=[ $w_attack13,dsergeant_watk14] {ai_charge(0);}; +void() dsergeant_watk14=[ $w_attack14,dsergeant_watk15] {ai_charge(0); + dsergeant_grunt_sound(DSERG_SOUND_RUNSWING);}; +void() dsergeant_watk15=[ $w_attack15,dsergeant_watk16] {ai_charge(0);dsergeant_sword_sound();}; +void() dsergeant_watk16=[ $w_attack16,dsergeant_watk17] {ai_charge(1);monster_footstep(FALSE);}; +void() dsergeant_watk17=[ $w_attack17,dsergeant_watk18] {ai_charge(1); + self.meleecontact = TRUE;ai_meleesmash(20);}; +void() dsergeant_watk18=[ $w_attack18,dsergeant_watk19] {ai_charge(3);}; +void() dsergeant_watk19=[ $w_attack19,dsergeant_watk20] {ai_charge(4);}; +void() dsergeant_watk20=[ $w_attack20,dsergeant_watk21] {ai_charge(6);}; +void() dsergeant_watk21=[ $w_attack21,dsergeant_watk22] {ai_charge(7);}; +void() dsergeant_watk22=[ $w_attack22,dsergeant_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +void() dsergeant_melee = +{ + self.meleeattack = random(); + if (self.meleeattack < 0.4) dsergeant_slice1 (); + else if (self.meleeattack < 0.9) dsergeant_smash1 (); + else dsergeant_watk1 (); +}; + +//=========================================================================== +// Death Sergeant Homing Missile Attack +//=========================================================================== +void() SergMissile = +{ + if (!self.enemy) return; + if (self.health < 1) return; + // Removing a fired homing missiles looks weird + //if (!visxray(self.enemy, self.attack_offset, '0 0 10', FALSE)) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "dknight/dserg_magic.wav", 1, ATTN_NORM); + self.attack_speed = SPEED_SERGMISSILE + (skill * SPEED_SERGSKILL); + Launch_HomingMissile (self.attack_offset, '0 0 10', CT_PROJ_SERG, self.attack_speed); +}; + +//---------------------------------------------------------------------- +// Hell Knight - 11 frames / Death Knight - 14 frames (skipped 1, 10,14) +// Death Knight frames trimmed down to match Hell Knight (damage ratio) +// Block pain function from interrupting magic attack +void() dsergeant_magicc1 =[ $magicc2, dsergeant_magicc2 ] {ai_face(); + SUB_AttackFinished (2 + random()*2); + self.pain_finished = time + 1; +}; +void() dsergeant_magicc2 =[ $magicc3, dsergeant_magicc3 ] {ai_face();}; +void() dsergeant_magicc3 =[ $magicc4, dsergeant_magicc4 ] {ai_face();}; +void() dsergeant_magicc4 =[ $magicc5, dsergeant_magicc5 ] {ai_face();}; +void() dsergeant_magicc5 =[ $magicc6, dsergeant_magicc6 ] {ai_face();}; +void() dsergeant_magicc6 =[ $magicc7, dsergeant_magicc7 ] {ai_face();}; +void() dsergeant_magicc7 =[ $magicc8, dsergeant_magicc8 ] {ai_face();}; +void() dsergeant_magicc8 =[ $magicc9, dsergeant_magicc9 ] {SergMissile();}; +void() dsergeant_magicc9 =[ $magicc11, dsergeant_magicc10] {ai_face();}; +void() dsergeant_magicc10 =[ $magicc12, dsergeant_magicc11] {ai_face();}; +void() dsergeant_magicc11 =[ $magicc13, dsergeant_run1] {ai_face();}; + +//============================================================================ + +void() dsergeant_painA1 =[ $painA1, dsergeant_painA2 ] {}; +void() dsergeant_painA2 =[ $painA2, dsergeant_painA3 ] {}; +void() dsergeant_painA3 =[ $painA3, dsergeant_painA4 ] {}; +void() dsergeant_painA4 =[ $painA4, dsergeant_painA5 ] {}; +void() dsergeant_painA5 =[ $painA5, dsergeant_run1 ] {}; +//---------------------------------------------------------------------- +// Not used, too slow for the segeant +void() dsergeant_painD1 =[ $painD1, dsergeant_painD2 ] {}; +void() dsergeant_painD2 =[ $painD2, dsergeant_painD3 ] {}; +void() dsergeant_painD3 =[ $painD3, dsergeant_painD4 ] {}; +void() dsergeant_painD4 =[ $painD4, dsergeant_painD5 ] {monster_footstep(FALSE);}; +void() dsergeant_painD5 =[ $painD5, dsergeant_painD6 ] {}; +void() dsergeant_painD6 =[ $painD6, dsergeant_painD7 ] {}; +void() dsergeant_painD7 =[ $painD7, dsergeant_painD8 ] {}; +void() dsergeant_painD8 =[ $painD8, dsergeant_painD9 ] {monster_footstep(FALSE);}; +void() dsergeant_painD9 =[ $painD9, dsergeant_painD10 ] {}; +void() dsergeant_painD10 =[ $painD10, dsergeant_painD11 ] {}; +void() dsergeant_painD11 =[ $painD11, dsergeant_run1 ] {}; +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dsergeant_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) dsergeant_painA1 (); // classic, body recoil + else { + dsergeant_painD1 (); // Cool stumble + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dsergeant_painD1 (); + } + } +}; + +//============================================================================ + +void() dsergeant_die1 =[ $death1, dsergeant_die2 ] {ai_forward(10);}; +void() dsergeant_die2 =[ $death2, dsergeant_die3 ] {monster_check_gib();ai_forward(8);}; +void() dsergeant_die3 =[ $death3, dsergeant_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dsergeant_die4 =[ $death4, dsergeant_die5 ] {}; +void() dsergeant_die5 =[ $death5, dsergeant_die6 ] {}; +void() dsergeant_die6 =[ $death6, dsergeant_die7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_CHAIN, 1, ATTN_NORM);}; +void() dsergeant_die7 =[ $death7, dsergeant_die8 ] {}; +void() dsergeant_die8 =[ $death8, dsergeant_die9 ] {ai_forward(10);}; +void() dsergeant_die9 =[ $death9, dsergeant_die10 ] {ai_forward(11);}; +void() dsergeant_die10 =[ $death10, dsergeant_die11 ] {}; +void() dsergeant_die11 =[ $death11, dsergeant_die12 ] {monster_death_postcheck();}; +void() dsergeant_die12 =[ $death12, dsergeant_die12 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dsergeant_dieb1 =[ $deathb1, dsergeant_dieb2 ] {}; +void() dsergeant_dieb2 =[ $deathb2, dsergeant_dieb3 ] {monster_check_gib();}; +void() dsergeant_dieb3 =[ $deathb3, dsergeant_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dsergeant_dieb4 =[ $deathb4, dsergeant_dieb5 ] {}; +void() dsergeant_dieb5 =[ $deathb5, dsergeant_dieb6 ] {}; +void() dsergeant_dieb6 =[ $deathb6, dsergeant_dieb7 ] {}; +void() dsergeant_dieb7 =[ $deathb7, dsergeant_dieb8 ] {}; +void() dsergeant_dieb8 =[ $deathb8, dsergeant_dieb9 ] {}; +void() dsergeant_dieb9 =[ $deathb9, dsergeant_dieb10 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_CHAIN, 1, ATTN_NORM);}; +void() dsergeant_dieb10 =[ $deathb10, dsergeant_dieb11 ] {}; +void() dsergeant_dieb11 =[ $deathb11, dsergeant_dieb12 ] {}; +void() dsergeant_dieb12 =[ $deathb12, dsergeant_dieb13 ] {}; +void() dsergeant_dieb13 =[ $deathb13, dsergeant_dieb14 ] {}; +void() dsergeant_dieb14 =[ $deathb14, dsergeant_dieb15 ] {}; +void() dsergeant_dieb15 =[ $deathb15, dsergeant_dieb16 ] {}; +void() dsergeant_dieb16 =[ $deathb16, dsergeant_dieb17 ] {}; +void() dsergeant_dieb17 =[ $deathb17, dsergeant_dieb18 ] {}; +void() dsergeant_dieb18 =[ $deathb18, dsergeant_dieb19 ] {}; +void() dsergeant_dieb19 =[ $deathb19, dsergeant_dieb20 ] {monster_death_postcheck();}; +void() dsergeant_dieb20 =[ $deathb20, dsergeant_dieb20 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dsergeant_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) dsergeant_die1 (); + else dsergeant_dieb1 (); + } +}; + +//============================================================================ +void() dsergeant_sword_sound = +{ + self.meleecontact = TRUE; + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +//============================================================================ +void(float soundtype) dsergeant_grunt_sound = +{ + if (soundtype == DSERG_SOUND_SIDESWING) + sound (self, CHAN_WEAPON, "dknight/dfury_grunt2.wav", 1, ATTN_NORM); + else if (soundtype == DSERG_SOUND_OVERSMASH) + sound (self, CHAN_WEAPON, "dknight/dfury_leap.wav", 1, ATTN_NORM); + else { + self.weaponswitch = 0.6 + random()*0.4; + if (random() < 0.5) sound (self, CHAN_WEAPON, "dknight/dfury_grunt3.wav", self.weaponswitch, ATTN_NORM); + else sound (self, CHAN_WEAPON, "dknight/dfury_grunt4.wav", self.weaponswitch, ATTN_NORM); + } +}; + +/*====================================================================== +QUAKED monster_dsergeant (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dsergeant = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dsergeant.mdl"; // Blue badass! + self.headmdl = "progs/h_dknight.mdl"; + self.gib1mdl = "progs/w_blueflail.mdl"; // Unique weapon + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_SERG); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib2skin = self.gib3skin = 3; // Sergeant skin + self.gib1sound = GIB_IMPACT_CHAIN; + + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + // Special extra sounds + precache_sound ("dknight/dserg_hbreath.wav"); // Special long sigh (idle animation) + precache_sound ("dknight/dserg_magic.wav"); // New Spike ball launch sound + precache_sound ("hknight/death1.wav"); + self.pain_sound = "hknight/pain1.wav"; + precache_sound (self.pain_sound); + + // Jingle, Jangle of the flail chain + self.sight_sound = "dknight/dserg_sight.wav"; + precache_sound (self.sight_sound); + + // Heavy thud sound + self.meleehitsound = GIB_SOUND_HEAVY2; + precache_sound (self.meleehitsound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // New grunt sounds during combat + precache_sound ("dknight/dfury_grunt2.wav"); + precache_sound ("dknight/dfury_grunt3.wav"); + precache_sound ("dknight/dfury_grunt4.wav"); + precache_sound ("dknight/dfury_leap.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_SHALGRN); // Green voreball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 400; // Shalrath level + self.gibhealth = -60; + self.gibbed = FALSE; + self.pain_flinch = 80; // Take a lot to go into pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // Shambler like pain level + self.infightextra = 2; // Double damage to other monsters + self.steptype = FS_TYPEHEAVY; // Heavy Player feet + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEFRONT; // Smash attack + self.attack_offset = '0 0 10'; + self.deathstring = " was crushed by a Blue Flail Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DSergeantCheckAttack; + self.th_stand = dsergeant_stand1; + self.th_walk = dsergeant_walk1; + self.th_run = dsergeant_run1; + self.th_melee = dsergeant_melee; + self.th_missile = dsergeant_magicc1; + self.th_pain = dsergeant_pain; + self.th_die = dsergeant_die; + self.th_charge = dsergeant_charging; + + self.meleeattack = rint(random()*3); // randomize last melee attack + + self.classtype = CT_MONDSERG; + self.classgroup = CG_DCAPTAIN; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_eel.qc b/QC_other/QC_arcane/mon_eel.qc new file mode 100644 index 00000000..9a7a1d15 --- /dev/null +++ b/QC_other/QC_arcane/mon_eel.qc @@ -0,0 +1,226 @@ +/*============================================================================== +EEL by Rogue Entertainment +==============================================================================*/ +$frame eswim1 eswim2 eswim3 eswim4 eswim5 eswim6 + +$frame edeath1 edeath2 edeath3 edeath4 edeath5 edeath6 edeath7 edeath8 +$frame edeath9 edeath10 edeath11 edeath12 edeath13 edeath14 edeath15 + +float EEL_STAND = 1; +float EEL_WALK = 2; +float EEL_RUN = 4; + +//============================================================================= +void() eel_swim = { + // Do nothing if dead + if (self.health < 1) return; + + self.skin = 0; // Reset skin if come from combat + self.nextthink = time + 0.1; + if (self.walkframe == 1) monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 5) self.walkframe = 0; + self.frame = $eswim1 + self.walkframe; + + if (self.state == EEL_STAND) ai_stand(); + else if (self.state == EEL_WALK) ai_walk(6); + else ai_run(10); +}; + +//---------------------------------------------------------------------- +void() eel_stand = [ $eswim1, eel_swim ] { + self.walkframe = 0; self.state = EEL_STAND; eel_swim();}; +void() eel_walk = [ $eswim1, eel_swim ] { + self.walkframe = 0; self.state = EEL_WALK; eel_swim();}; +void() eel_run = [ $eswim1, eel_swim ] { + self.walkframe = 0; self.state = EEL_RUN; eel_swim();}; + +//============================================================================ +// RANGE - Plasma from mouth +//============================================================================ +void() eel_plasma = +{ + local vector org, dir; + + // Check if can fire bolt of plasma + if (visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_EELBOLT + (skill * SPEED_EELSKILL); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(self.enemy.origin - self.origin); + + launch_plasma(org, dir, CT_MONEEL, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() eel_attack1 = [ $eswim1, eel_attack2 ] {self.skin = 1;ai_face(); + sound (self, CHAN_VOICE, "eel/attack1.wav", 1, ATTN_NORM);}; +void() eel_attack2 = [ $eswim2, eel_attack3 ] {self.skin = 2;ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH;}; +void() eel_attack3 = [ $eswim3, eel_attack4 ] {self.skin = 3;ai_face();}; +void() eel_attack4 = [ $eswim4, eel_attack5 ] {self.skin = 4;ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH;}; +void() eel_attack5 = [ $eswim5, eel_attack6 ] {self.skin = 5;ai_face();}; +void() eel_attack6 = [ $eswim6, eel_attack7 ] { + self.skin = 4; ai_face(); eel_plasma();}; +void() eel_attack7 = [ $eswim1, eel_attack8 ] {self.skin = 5;}; +void() eel_attack8 = [ $eswim2, eel_attack9 ] {self.skin = 4;}; +void() eel_attack9 = [ $eswim3, eel_attack10 ] {self.skin = 3;}; +void() eel_attack10 = [ $eswim4, eel_attack11 ] {self.skin = 2;}; +void() eel_attack11 = [ $eswim5, eel_attack12 ] {self.skin = 1;ai_face();}; +void() eel_attack12 = [ $eswim6, eel_run ] {self.skin = 0;ai_face();}; + +//============================================================================= +// Pain & Death +//============================================================================= +void() eel_pain1 = [ $edeath1, eel_pain2] {}; +void() eel_pain2 = [ $edeath2, eel_pain3] {}; +void() eel_pain3 = [ $edeath3, eel_pain4] {}; +void() eel_pain4 = [ $edeath4, eel_pain5] {}; +void() eel_pain5 = [ $edeath3, eel_pain6] {}; +void() eel_pain6 = [ $edeath2, eel_pain7] {}; +void() eel_pain7 = [ $edeath1, eel_run] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) eel_pain = +{ + // Reset combat skin + self.skin = 0; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + eel_pain1(); + } +}; + +//============================================================================= +void() eel_die1 = [ $edeath1, eel_die2 ] {}; +void() eel_die2 = [ $edeath2, eel_die3 ] {monster_check_gib();}; +void() eel_die3 = [ $edeath3, eel_die4 ] {monster_check_gib();self.solid = SOLID_NOT;}; +void() eel_die4 = [ $edeath4, eel_die5 ] { + // make sure the eel drops to the ground + self.movetype = MOVETYPE_TOSS; + self.velocity_z = 10 + random()*10; + self.flags = self.flags - (self.flags & FL_ONGROUND); +}; +void() eel_die5 = [ $edeath5, eel_die6 ] {}; +void() eel_die6 = [ $edeath6, eel_die7 ] {}; +void() eel_die7 = [ $edeath7, eel_die8 ] {}; +void() eel_die8 = [ $edeath8, eel_die9 ] {}; +void() eel_die9 = [ $edeath9, eel_die10 ] {}; +void() eel_die10 = [ $edeath10, eel_die11 ] {}; +void() eel_die11 = [ $edeath11, eel_die12 ] {}; +void() eel_die12 = [ $edeath12, eel_die13 ] {}; +void() eel_die13 = [ $edeath13, eel_die14 ] {}; +void() eel_die14 = [ $edeath14, eel_die15 ] {monster_death_postcheck();}; +void() eel_die15 = [ $edeath15, eel_die15 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() eel_die = +{ + // Reset combat skin + self.skin = 0; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + // reduce self gravity to pretend to slowly sink + if (pointcontents(self.origin) == CONTENT_WATER) self.gravity = 0.25; + + sound (self, CHAN_BODY, "eel/death1.wav", 1, ATTN_NORM); + + // Death animation not at bottom of bounding box + self.bbmins = '-12 -12 -1'; + self.bbmaxs = '12 12 12'; + setsize(self, self.bbmins, self.bbmaxs); + + // With the bounding box changed for the animation the + // gib system now needs an offset to cope! + self.max_health = MON_GIBFOUNTAIN; + self.gib_ofs = '0 0 32'; + // Wiggle and keel over + eel_die1 (); + } +}; + +/*====================================================================== +/*QUAKED monster_eel (1 0 0) (-16 -16 -16) (16 16 16) +======================================================================*/ +void() monster_eel = +{ + // ------------------------------------------------------------------ + // ** Removed from MOD ** + // Uses copyright content from Rogue Software & not fun to play with! + // This script works perfectly fine with Rogue Software assets + // Anyone can use this monster for their own MOD! + // ------------------------------------------------------------------ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_eel.mdl"; + self.headmdl = "progs/h_eel.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_PLASMA); // Plasma spike/bolt + + self.idle_sound = "eel/idle1.wav"; + precache_sound (self.idle_sound); + + precache_sound ("eel/attack1.wav"); + precache_sound ("eel/death1.wav"); + self.pain_sound = "eel/pain1.wav"; + precache_sound (self.pain_sound); + + self.sight_sound = "eel/sight1.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_PLASMAGRN); + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_EEL; + if (self.health < 1) self.health = 35; + self.gibhealth = -25; + self.gibbed = FALSE; + self.pain_flinch = 10; // Easy response to pain + self.steptype = FS_FLYING; // It has no sea legs! + self.blockudeath = TRUE; // No humanoid death sound + self.attack_offset = '20 0 -2'; // Plasma start location + self.deathstring = " was electrified by an Eel\n"; + + // Check for water sightline wakeup + if (self.spawnflags & MON_LIQUIDBLOCK) self.liquidblock = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = EelCheckAttack; + self.th_stand = eel_stand; + self.th_walk = eel_walk; + self.th_run = eel_run; + self.th_pain = eel_pain; + self.th_die = eel_die; + self.th_missile = eel_attack1; + + self.classtype = CT_MONEEL; + self.classgroup = CG_FISH; + self.classmove = MON_MOVESWIM; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_enforcer.qc b/QC_other/QC_arcane/mon_enforcer.qc new file mode 100644 index 00000000..4d095e57 --- /dev/null +++ b/QC_other/QC_arcane/mon_enforcer.qc @@ -0,0 +1,490 @@ +/*============================================================================== +ENFORCER +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 + +//============================================================================ +void() enf_stand1 =[ $stand1, enf_stand2 ] {monster_idle_sound(); ai_stand();}; +void() enf_stand2 =[ $stand2, enf_stand3 ] {ai_stand();}; +void() enf_stand3 =[ $stand3, enf_stand4 ] {ai_stand();}; +void() enf_stand4 =[ $stand4, enf_stand5 ] {ai_stand();}; +void() enf_stand5 =[ $stand5, enf_stand6 ] {ai_stand();}; +void() enf_stand6 =[ $stand6, enf_stand7 ] {ai_stand();}; +void() enf_stand7 =[ $stand7, enf_stand1 ] {ai_stand();}; + +//============================================================================ +void() enf_walk1 =[ $walk1, enf_walk2 ] {monster_idle_sound(); ai_walk(2);}; +void() enf_walk2 =[ $walk2, enf_walk3 ] {monster_footstep(FALSE); ai_walk(4);}; +void() enf_walk3 =[ $walk3, enf_walk4 ] {ai_walk(4);}; +void() enf_walk4 =[ $walk4, enf_walk5 ] {ai_walk(3);}; +void() enf_walk5 =[ $walk5, enf_walk6 ] {ai_walk(1);}; +void() enf_walk6 =[ $walk6, enf_walk7 ] {ai_walk(2);}; +void() enf_walk7 =[ $walk7, enf_walk8 ] {ai_walk(2);}; +void() enf_walk8 =[ $walk8, enf_walk9 ] {ai_walk(1);}; +void() enf_walk9 =[ $walk9, enf_walk10 ] {ai_walk(2);}; +void() enf_walk10 =[ $walk10, enf_walk11 ] {monster_footstep(FALSE); ai_walk(4);}; +void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);}; +void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);}; +void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);}; +void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);}; +void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);}; +void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);}; + +//============================================================================ +void() enf_run1 =[ $run1, enf_run2 ] {monster_idle_sound(); ai_run(18);}; +void() enf_run2 =[ $run2, enf_run3 ] {ai_run(14);}; +void() enf_run3 =[ $run3, enf_run4 ] {monster_footstep(FALSE); ai_run(7);}; +void() enf_run4 =[ $run4, enf_run5 ] {ai_run(12);}; +void() enf_run5 =[ $run5, enf_run6 ] {ai_run(14);}; +void() enf_run6 =[ $run6, enf_run7 ] {ai_run(14);}; +void() enf_run7 =[ $run7, enf_run8 ] {monster_footstep(FALSE); ai_run(7);}; +void() enf_run8 =[ $run8, enf_run1 ] {ai_run(11);}; + +//============================================================================ +// - Basic enforcer (laser attack) +//---------------------------------------------------------------------- +void() enforcer_fire = +{ + local vector org, vec; + + if (!self.enemy) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + launch_projectile(org, vec, CT_PROJ_LASER, SPEED_LASER); +}; + +//---------------------------------------------------------------------- +void() enf_atk1 =[ $attack1, enf_atk2 ] {}; +void() enf_atk2 =[ $attack2, enf_atk3 ] {monster_footstep(FALSE);ai_face();}; +void() enf_atk3 =[ $attack3, enf_atk4 ] {ai_face();}; +void() enf_atk4 =[ $attack4, enf_atk5 ] {ai_face();}; +void() enf_atk5 =[ $attack5, enf_atk6 ] {ai_face();}; +void() enf_atk6 =[ $attack6, enf_atk7 ] { + if (self.health > 1) enforcer_fire();}; +void() enf_atk7 =[ $attack7, enf_atk8 ] {}; +void() enf_atk8 =[ $attack8, enf_atk9 ] {}; +void() enf_atk9 =[ $attack5, enf_atk10 ] {ai_face();}; +void() enf_atk10 =[ $attack6, enf_atk11 ] {ai_face(); + if (self.health > 1) enforcer_fire();}; +void() enf_atk11 =[ $attack7, enf_atk12 ] {}; +void() enf_atk12 =[ $attack8, enf_atk13 ] {}; +void() enf_atk13 =[ $attack9, enf_atk14 ] {ai_face();}; +void() enf_atk14 =[ $attack10, enf_run1 ] {ai_face();SUB_CheckRefire (enf_atk1);}; + +//============================================================================ +// - Defender enforcer (ssg/gl attack) +//---------------------------------------------------------------------- +void() defender_ssg = +{ + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/def_ssg_fire.wav", 1, ATTN_NORM); + + // Choose between a projectile or hit-scan system + if (query_configflag(SVR_SHOTGPROJ)) + FireBullets (QUANTITY_DEFENDER, SPREAD_DEF); + else { + Launch_Shells(QUANTITY_DEFENDER, SPREAD_DEF, CT_PROJ_SG); + Launch_ShellCasing(2); + } +}; + +//---------------------------------------------------------------------- +void() def_atkssg1 =[ $attack1, def_atkssg2 ] { + sound (self, CHAN_WEAPON, "enforcer/def_ssg_load.wav", 1, ATTN_NORM);}; +void() def_atkssg2 =[ $attack2, def_atkssg3 ] {monster_footstep(FALSE);ai_face();}; +void() def_atkssg3 =[ $attack3, def_atkssg4 ] {ai_face();}; +void() def_atkssg4 =[ $attack4, def_atkssg5 ] {ai_face();}; +void() def_atkssg5 =[ $attack5, def_atkssg6 ] {ai_face();}; +void() def_atkssg6 =[ $attack6, def_atkssg7 ] {ai_face(); + if (self.health > 1) defender_ssg();}; +void() def_atkssg7 =[ $attack7, def_atkssg8 ] {}; +void() def_atkssg8 =[ $attack8, def_atkssg9 ] {}; +void() def_atkssg9 =[ $attack9, def_atkssg10] {ai_face();}; +void() def_atkssg10=[ $attack10, enf_run1 ] {SUB_CheckRefire (def_atkssg1);}; + +//---------------------------------------------------------------------- +void() def_atkgl1 =[ $attack1, def_atkgl2 ] {ai_face();}; +void() def_atkgl2 =[ $attack2, def_atkgl3 ] {monster_footstep(FALSE);ai_face();}; +void() def_atkgl3 =[ $attack3, def_atkgl4 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() def_atkgl4 =[ $attack4, def_atkgl5 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() def_atkgl5 =[ $attack5, def_atkgl6 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() def_atkgl6 =[ $attack6, def_atkgl7 ] {ai_face(); + makevectors(self.angles); + self.pos1 = self.origin + attack_vector(self.attack_offset); + MonsterFireGrenade(self.pos1, self.enemy.origin); +}; +void() def_atkgl7 =[ $attack7, def_atkgl8 ] {}; +void() def_atkgl8 =[ $attack8, def_atkgl9 ] {}; +void() def_atkgl9 =[ $attack9, def_atkgl10] {ai_face();}; +void() def_atkgl10=[ $attack10, enf_run1 ]{ai_face();}; + + +//============================================================================ +// - Eliminator enforcer (plasma attack) +//---------------------------------------------------------------------- +void() eliminator_fire = +{ + local vector org, vec; + + if (!self.enemy) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + launch_plasma(org, vec, CT_MONELIMATOR, SPEED_PLASMA); +}; + +//---------------------------------------------------------------------- +void() elim_atk1 =[ $attack1, elim_atk2 ] { + sound (self, CHAN_WEAPON, "enforcer/elim_pg_load.wav", 1, ATTN_NORM);}; +void() elim_atk2 =[ $attack2, elim_atk3 ] {monster_footstep(FALSE);ai_face();}; +void() elim_atk3 =[ $attack3, elim_atk4 ] {ai_face();}; +void() elim_atk4 =[ $attack4, elim_atk5 ] {ai_face();}; +void() elim_atk5 =[ $attack5, elim_atk6 ] {ai_face();}; +void() elim_atk6 =[ $attack6, elim_atk7 ] {ai_face(); + if (self.health > 1) eliminator_fire();}; +void() elim_atk7 =[ $attack7, elim_atk8 ] {}; +void() elim_atk8 =[ $attack8, elim_atk9 ] {}; +void() elim_atk9 =[ $attack5, elim_atk10 ] {ai_face();}; +void() elim_atk10 =[ $attack6, elim_atk11 ] {ai_face(); + if (self.health > 1) eliminator_fire();}; +void() elim_atk11 =[ $attack7, elim_atk12 ] {}; +void() elim_atk12 =[ $attack8, elim_atk13 ] {}; +void() elim_atk13 =[ $attack9, elim_atk14 ] {ai_face();}; +void() elim_atk14 =[ $attack10, enf_run1 ] {ai_face();SUB_CheckRefire (elim_atk1);}; + +//============================================================================ +void() enf_paina1 =[ $paina1, enf_paina2 ] {}; +void() enf_paina2 =[ $paina2, enf_paina3 ] {}; +void() enf_paina3 =[ $paina3, enf_paina4 ] {}; +void() enf_paina4 =[ $paina4, enf_run1 ] {}; + +//---------------------------------------------------------------------- +void() enf_painb1 =[ $painb1, enf_painb2 ] {}; +void() enf_painb2 =[ $painb2, enf_painb3 ] {}; +void() enf_painb3 =[ $painb3, enf_painb4 ] {}; +void() enf_painb4 =[ $painb4, enf_painb5 ] {}; +void() enf_painb5 =[ $painb5, enf_run1 ] {}; + +//---------------------------------------------------------------------- +void() enf_painc1 =[ $painc1, enf_painc2 ] {}; +void() enf_painc2 =[ $painc2, enf_painc3 ] {monster_footstep(FALSE);}; +void() enf_painc3 =[ $painc3, enf_painc4 ] {}; +void() enf_painc4 =[ $painc4, enf_painc5 ] {}; +void() enf_painc5 =[ $painc5, enf_painc6 ] {}; +void() enf_painc6 =[ $painc6, enf_painc7 ] {}; +void() enf_painc7 =[ $painc7, enf_painc8 ] {}; +void() enf_painc8 =[ $painc8, enf_run1 ] {}; + +//---------------------------------------------------------------------- +void() enf_paind1 =[ $paind1, enf_paind2 ] {}; +void() enf_paind2 =[ $paind2, enf_paind3 ] {}; +void() enf_paind3 =[ $paind3, enf_paind4 ] {monster_footstep(FALSE);}; +void() enf_paind4 =[ $paind4, enf_paind5 ] {ai_painforward(2);}; +void() enf_paind5 =[ $paind5, enf_paind6 ] {ai_painforward(1);}; +void() enf_paind6 =[ $paind6, enf_paind7 ] {}; +void() enf_paind7 =[ $paind7, enf_paind8 ] {}; +void() enf_paind8 =[ $paind8, enf_paind9 ] {}; +void() enf_paind9 =[ $paind9, enf_paind10 ] {}; +void() enf_paind10 =[ $paind10, enf_paind11 ] {}; +void() enf_paind11 =[ $paind11, enf_paind12 ] {ai_painforward(1);}; +void() enf_paind12 =[ $paind12, enf_paind13 ] {ai_painforward(1);}; +void() enf_paind13 =[ $paind13, enf_paind14 ] {ai_painforward(1);}; +void() enf_paind14 =[ $paind14, enf_paind15 ] {}; +void() enf_paind15 =[ $paind15, enf_paind16 ] {}; +void() enf_paind16 =[ $paind16, enf_paind17 ] {ai_pain(1);}; +void() enf_paind17 =[ $paind17, enf_paind18 ] {ai_pain(1);}; +void() enf_paind18 =[ $paind18, enf_paind19 ] {}; +void() enf_paind19 =[ $paind19, enf_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) enf_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random (); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (self.lip < 0.2) enf_paina1 (); + else if (self.lip < 0.4) enf_painb1 (); + else if (self.lip < 0.7) enf_painc1 (); + else { + self.pain_finished = time + 2; + enf_paind1 (); + } + } + // The new axe forces monsters into long pain animations + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.9; + self.axhitme = 0; + enf_paind1 (); + } + } +}; + +//============================================================================ +void() enf_die1 =[ $death1, enf_die2 ] {}; +void() enf_die2 =[ $death2, enf_die3 ] {monster_check_gib();}; +void() enf_die3 =[ $death3, enf_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);}; +void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);}; +void() enf_die6 =[ $death6, enf_die7 ] {}; +void() enf_die7 =[ $death7, enf_die8 ] {}; +void() enf_die8 =[ $death8, enf_die9 ] {}; +void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);}; +void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);}; +void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);}; +void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);}; +void() enf_die13 =[ $death13, enf_die14 ] {monster_death_postcheck();}; +void() enf_die14 =[ $death14, enf_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] {}; +void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {monster_check_gib();}; +void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {}; +void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {}; +void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {}; +void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {}; +void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {}; +void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {}; +void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {monster_death_postcheck();}; +void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() enf_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) enf_die1 (); + else enf_fdie1 (); + } +}; + +/*====================================================================== + QUAKED monster_enforcer (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_base_enforcer = +{ + self.mdl = "progs/mon_enforcer.mdl"; + self.headmdl = "progs/h_enforcer.mdl"; + self.gib1mdl = "progs/w_enforcergun.mdl"; // Unique weapon + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + self.gibhealth = -35; + self.gibbed = FALSE; + self.pain_flinch = 20; // low pain threshold + self.pain_longanim = TRUE; // Long pain animation for axe + self.steptype = FS_TYPEHEAVY; // heavy player + self.attack_offset = '28 8.5 16'; // End of Gun + if (self.deathstring == "") + self.deathstring = " was blasted by an Enforcer\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.classtype == CT_MONELIMATOR) self.resist_cells = 0.5; + else if (self.classtype == CT_MONDEFENDER) self.resist_rockets = 0.5; + + self.th_stand = enf_stand1; + self.th_walk = enf_walk1; + self.th_run = enf_run1; + self.th_pain = enf_pain; + self.th_die = enf_die; + + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEWALK; + monster_start(); +}; + +//---------------------------------------------------------------------- +void() monster_enforcer = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONENFORCER; + precache_model (MODEL_PROJ_LASER); // Originally - progs/laser.mdl + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_LASERGRN); + } + + if (self.health < 1) self.health = 80; + self.ammo_cells = rint(1 + random()*2); + self.exactskin = rint((random()*3)-0.5); + self.gib1skin = 0; + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_count = 4; + self.sight_sound = "enforcer/sight1.wav"; + self.sight_sound2 = "enforcer/sight2.wav"; + self.sight_sound3 = "enforcer/sight3.wav"; + self.sight_sound4 = "enforcer/sight4.wav"; + precache_sound (self.sight_sound); + precache_sound (self.sight_sound2); + precache_sound (self.sight_sound3); + precache_sound (self.sight_sound4); + + // Projectile fire and impact (used in projectiles) + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + + self.th_missile = enf_atk1; + + monster_base_enforcer(); +} + +//---------------------------------------------------------------------- +void() monster_defender = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONDEFENDER; + precache_model (MODEL_PROJ_GRENADE); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GRENADEGRN); + } + + if (self.health < 1) self.health = 100; + self.ammo_shells = rint(4 + random()*4); + self.exactskin = 3 + rint((random()*3)-0.5); + self.gib1skin = 1; + + self.idle_sound = "enforcer/def_idle1.wav"; + self.idle_sound2 = "enforcer/def_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + self.sight_sound = "enforcer/def_sight1.wav"; + precache_sound (self.sight_sound); + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/def_ssg_load.wav"); + precache_sound ("enforcer/def_ssg_fire.wav"); + + self.th_missile = def_atkgl1; + self.th_melee = def_atkssg1; + self.th_checkattack = DefenderCheckAttack; + // Grenade bounce off body + self.bouncegrenade = TRUE; + self.deathstring = " was destroyed by a Defender\n"; + + monster_base_enforcer(); +}; + +//---------------------------------------------------------------------- +void() monster_eliminator = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONELIMATOR; + precache_model (MODEL_PROJ_PLASMA); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_PLASMAGRN); + } + + if (self.health < 1) self.health = 120; + self.ammo_cells = rint(2 + random()*2); + self.exactskin = 6 + rint((random()*3)-0.5); + self.gib1skin = 2; + + self.idle_sound = "enforcer/elim_idle1.wav"; + self.idle_sound2 = "enforcer/elim_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + self.sight_sound = "enforcer/elim_sight1.wav"; + precache_sound (self.sight_sound); + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/elim_pg_load.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + self.th_missile = elim_atk1; + self.th_checkattack = EliminatorCheckAttack; + self.deathstring = " was assasinated by a Eliminator\n"; + + monster_base_enforcer(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_fish.qc b/QC_other/QC_arcane/mon_fish.qc new file mode 100644 index 00000000..14a5bd11 --- /dev/null +++ b/QC_other/QC_arcane/mon_fish.qc @@ -0,0 +1,281 @@ +/*============================================================================== +FISH FISH FISHY! (remade version by ijed) +==============================================================================*/ + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 +$frame attack8 attack9 attack10 attack11 attack12 attack13 attack14 +$frame attack15 attack16 attack17 attack18 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 + +$frame swim1 swim2 swim3 swim4 swim5 swim6 swim7 swim8 +$frame swim9 swim10 swim11 swim12 swim13 swim14 swim15 swim16 +$frame swim17 swim18 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 pain9 + +// Duplicate set of animations for a smaller scaled down version +$frame attackS1 attackS2 attackS3 attackS4 attackS5 attackS6 attackS7 +$frame attackS8 attackS9 attackS10 attackS11 attackS12 attackS13 attackS14 +$frame attackS15 attackS16 attackS17 attackS18 + +$frame deathS1 deathS2 deathS3 deathS4 deathS5 deathS6 deathS7 deathS8 +$frame deathS9 deathS10 deathS11 deathS12 deathS13 deathS14 deathS15 deathS16 +$frame deathS17 deathS18 deathS19 deathS20 deathS21 + +$frame swimS1 swimS2 swimS3 swimS4 swimS5 swimS6 swimS7 swimS8 +$frame swimS9 swimS10 swimS11 swimS12 swimS13 swimS14 swimS15 swimS16 +$frame swimS17 swimS18 + +$frame painS1 painS2 painS3 painS4 painS5 painS6 painS7 painS8 painS9 + +float FISH_STAND = 1; +float FISH_WALK = 2; +float FISH_RUN = 4; + +//============================================================================ +void() f_swim = { + // Do nothing if dead + if (self.health < 1) return; + + self.nextthink = time + 0.1; + if (self.walkframe == 1) monster_idle_sound(); + + // Keep moving the animation frame forward + if (self.state == FISH_RUN) self.walkframe = self.walkframe + 2; + else self.walkframe = self.walkframe + 1; + // Setup small/large frames + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $swimS1 + self.walkframe; + else self.frame = $swim1 + self.walkframe; + // Loop around animation block + if (self.walkframe > 17) self.walkframe = 0; + + if (self.state == FISH_STAND) ai_stand(); + else if (self.state == FISH_WALK) ai_walk(self.move_state_y); + else ai_run(self.move_state_z); +}; + +//---------------------------------------------------------------------- +void() f_stand1 = [ $swim1, f_swim ] { ai_stand();}; +void() f_standS1 = [ $swimS1, f_swim ] { ai_stand(); }; + +void() f_stand = { + self.walkframe = 0; self.state = FISH_STAND; + if (self.spawnflags & MON_FISH_SMALL) f_standS1(); + else f_stand1(); +}; + +//---------------------------------------------------------------------- +void() f_walk1 = [ $swim1, f_swim ] { ai_walk(self.move_state_y);}; +void() f_walkS1 = [ $swimS1, f_swim ] { ai_walk(self.move_state_y);}; + +void() f_walk = { + self.walkframe = 0; self.state = FISH_WALK; + if (self.spawnflags & MON_FISH_SMALL) f_walkS1(); + else f_walk1(); +}; + +//---------------------------------------------------------------------- +void() f_run1 = [ $swim1, f_swim ] { ai_run(self.move_state_z);}; +void() f_runS1 = [ $swimS1, f_swim ] { ai_run(self.move_state_z);}; + +void() f_run = { + self.walkframe = 0; self.state = FISH_RUN; + if (self.spawnflags & MON_FISH_SMALL) f_runS1(); + else f_run1(); +}; + +//============================================================================ +void() fish_melee = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(5); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEFISH)) return; // Too far away + + // Fish bites man! 1-6 Damage + ldmg = (random() + random() + random()) * 2; + if (ldmg < 1) ldmg = 1; + sound (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() f_attack2 = { + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.1; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $attackS1 + self.walkframe; + else self.frame = $attack1 + self.walkframe; + + // Setup special frame attacks + if (self.walkframe > 17) self.think = self.th_run; + if (self.walkframe == 2 || self.walkframe == 8 || self.walkframe == 14) + fish_melee(); + else ai_charge(self.move_state_y); +}; + +//---------------------------------------------------------------------- +void() f_attack1 = [ $attack1, f_attack2 ] {}; +void() f_attackS1 = [ $attackS1, f_attack2 ] {}; + +void() f_attack = { + self.walkframe = 0; + ai_charge(self.move_state_y); + if (self.spawnflags & MON_FISH_SMALL) f_attackS1(); + else f_attack1(); +}; + +//============================================================================ +void() f_pain2 = { + self.nextthink = time + 0.1; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $painS1 + self.walkframe; + else self.frame = $pain1 + self.walkframe; + + if (self.walkframe > 8) self.think = self.th_run; + if (self.walkframe > 1) ai_pain(self.move_state_y/2); +}; + +void() f_pain1 = [ $pain1, f_pain2 ] {}; +void() f_painS1 = [ $painS1, f_pain2 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) fish_pain = +{ + if (self.health < 1) return; + self.walkframe = 0; + if (self.spawnflags & MON_FISH_SMALL) f_painS1(); + else f_pain1(); +}; + +//============================================================================ +void() f_deathend = { monster_deadbody_check(); }; + +//---------------------------------------------------------------------- +void() f_death2 = { + self.nextthink = time + 0.1; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $deathS1 + self.walkframe; + else self.frame = $death1 + self.walkframe; + + // Keep moving the animation frame forward + if (self.walkframe < 3) monster_check_gib(); + if (self.walkframe > 2) self.solid = SOLID_NOT; + if (self.walkframe == 19) monster_death_postcheck(); + if (self.walkframe > 19) f_deathend(); +}; + +void() f_death1 = [ $death1, f_death2 ] {}; +void() f_deathS1 = [ $deathS1, f_death2 ] {}; + +//---------------------------------------------------------------------- +void() fish_die = +{ + // If fish in water, reduce self gravity to pretend to slowly sink + if (pointcontents(self.origin) == CONTENT_WATER) self.gravity = 0.25; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + self.walkframe = 0; + sound (self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM); + if (self.spawnflags & MON_FISH_SMALL) f_deathS1(); + else f_death1(); + } +}; + +/*====================================================================== +QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_fish = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_fish.mdl"; // Using new model + precache_model (self.mdl); + + self.idle_sound = "fish/idle.wav"; + self.sight_sound = self.idle_sound; + precache_sound (self.idle_sound); + + precache_sound ("fish/death.wav"); + precache_sound ("fish/bite.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.gibhealth = -10; + self.gibbed = FALSE; + self.pain_flinch = 1; // Always in pain + self.steptype = FS_FLYING; // It has fins!?! + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '24 0 -8'; // Bite attack offset + self.height = 0; // reset enemytarget tracking + if (!self.exactskin) self.randomskin = 4; + self.deathstring = " was fed to the Rotfish\n"; + + // Check for water sightline wakeup + if (self.spawnflags & MON_LIQUIDBLOCK) self.liquidblock = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Tiny fish are easier to kill + if (self.spawnflags & MON_FISH_SMALL) { + if (self.bboxtype < 1) self.bboxtype = BBOX_FISHS; + if (self.health < 1) self.health = 15; + // The small fish moving really fast looks odd + // reverted speed and movement back to original + //self.move_state = '0 12 16'; + self.move_state = '0 8 12'; + } + else { + if (self.bboxtype < 1) self.bboxtype = BBOX_FISH; + if (self.health < 1) self.health = 25; + self.move_state = '0 8 12'; + } + + self.th_checkattack = FishCheckAttack; + self.th_stand = f_stand; + self.th_walk = f_walk; + self.th_run = f_run; + self.th_die = fish_die; + self.th_pain = fish_pain; + self.th_melee = f_attack; + + self.classtype = CT_MONFISH; + self.classgroup = CG_FISH; + self.classmove = MON_MOVESWIM; + + monster_start(); +}; + diff --git a/QC_other/QC_arcane/mon_freddie.qc b/QC_other/QC_arcane/mon_freddie.qc new file mode 100644 index 00000000..f40da31e --- /dev/null +++ b/QC_other/QC_arcane/mon_freddie.qc @@ -0,0 +1,564 @@ +/*============================================================================== +FREDDIE (Edie from Quoth - Kell/Necros/Preach) +==============================================================================*/ +// Run/Walk same animation +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 + +// Run and fire nail/laser gun at same time +$frame rfire1 rfire2 rfire3 rfire4 rfire5 rfire6 rfire7 rfire8 +$frame rfire9 rfire10 rfire11 rfire12 rfire13 rfire14 rfire15 rfire16 + +// Stand and fire nail/laser gun +$frame sfire1 sfire2 sfire3 sfire4 sfire5 sfire6 sfire7 sfire8 +$frame sfire9 sfire10 sfire11 sfire12 sfire13 sfire14 sfire15 sfire16 +$frame sfire17 sfire18 sfire19 sfire20 sfire21 sfire22 sfire23 sfire24 +$frame sfire25 sfire26 sfire27 sfire28 + +// Pain forward +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 +$frame pain9 pain10 pain11 pain12 + +// Pain Backward (short) +$frame painb1 painb2 painb3 painb4 painb5 + +// Quick forward swing of chainsaw arm +$frame fswing1 fswing2 fswing3 fswing4 fswing5 fswing6 fswing7 fswing8 +$frame fswing9 fswing10 fswing11 + +// Quick smack with elbow of chainsaw arm +$frame fswinge1 fswinge2 fswinge3 fswinge4 fswinge5 fswinge6 fswinge7 +$frame fswinge8 fswinge9 fswinge10 + +// Slow back swing of chainsaw arm (left to right) +$frame bswing1 bswing2 bswing3 bswing4 bswing5 bswing6 bswing7 bswing8 +$frame bswing9 bswing10 bswing11 bswing12 bswing13 bswing14 + +// Extremely long death animation! +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 death23 death24 +$frame death25 death26 death27 death28 death29 death30 death31 death32 +$frame death33 death34 death35 + +// Export frames (ignored) +$frame base1 base2 + +// Standing / idle animation +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +//============================================================================ +void() fred_stand1 =[ $stand1, fred_stand2 ] {monster_idle_sound(); ai_stand();}; +void() fred_stand2 =[ $stand2, fred_stand3 ] {ai_stand();}; +void() fred_stand3 =[ $stand3, fred_stand4 ] {ai_stand();}; +void() fred_stand4 =[ $stand4, fred_stand5 ] {ai_stand();}; +void() fred_stand5 =[ $stand5, fred_stand6 ] {ai_stand();}; +void() fred_stand6 =[ $stand6, fred_stand7 ] {ai_stand();}; +void() fred_stand7 =[ $stand7, fred_stand8 ] {ai_stand();}; +void() fred_stand8 =[ $stand8, fred_stand1 ] {ai_stand();}; + +//============================================================================ +void() fred_walk1 = [ $run1, fred_walk2 ] {monster_idle_sound(); ai_walk(20);}; +void() fred_walk2 = [ $run2, fred_walk3 ] {monster_footstep(FALSE);ai_walk(16);}; +void() fred_walk3 = [ $run3, fred_walk4 ] {ai_walk(1);}; +void() fred_walk4 = [ $run4, fred_walk5 ] {ai_walk(2);}; +void() fred_walk5 = [ $run5, fred_walk6 ] {ai_walk(4);}; +void() fred_walk6 = [ $run6, fred_walk7 ] {ai_walk(8);}; +void() fred_walk7 = [ $run7, fred_walk8 ] {ai_walk(4);}; +void() fred_walk8 = [ $run8, fred_walk9 ] {ai_walk(16);}; +void() fred_walk9 = [ $run9, fred_walk10 ] {ai_walk(20);}; +void() fred_walk10 = [ $run10, fred_walk11 ] {monster_footstep(FALSE);ai_walk(16);}; +void() fred_walk11 = [ $run11, fred_walk12 ] {ai_walk(1);}; +void() fred_walk12 = [ $run12, fred_walk13 ] {ai_walk(2);}; +void() fred_walk13 = [ $run13, fred_walk14 ] {ai_walk(4);}; +void() fred_walk14 = [ $run14, fred_walk15 ] {ai_walk(8);}; +void() fred_walk15 = [ $run15, fred_walk16 ] {ai_walk(4);}; +void() fred_walk16 = [ $run16, fred_walk1 ] {ai_walk(16);}; + +//=========================================================================== +// RANGE ATTACK - Fires spikes or laser bolts +//=========================================================================== +void(vector weapofs) fred_fireweapon = +{ + local vector org, dir, vec; + + // Check for death? + if (self.health < 1) return; + + // Lit up that barrel + self.effects = self.effects | EF_MUZZLEFLASH; + // Nail and laser use the same firing speed + self.attack_speed = SPEED_FREDDIEPROJ + (skill * SPEED_FREDDIESKILL); + // turn and face your enemy! + makevectors (self.angles); + org = self.origin + attack_vector(weapofs); + + // The mini burst mode (run+fire) can do tracking + if (self.attack_timer && skill > SKILL_NORMAL) { + // More precise fire, track player velocity + // Reset the tracking on first shot, get better over time + if (self.cnt == 1) + self.attack_track = SUB_Tracking(self.enemy.origin, weapofs, self.enemy, self.attack_speed); + else self.attack_track = SUB_Tracking(self.attack_track, weapofs, self.enemy, self.attack_speed); + dir = normalize(self.attack_track - org); + } + else { + // Standard mode spray bullets at player + vec = v_right*(crandom()*(20+random()*50)); + dir = normalize((self.enemy.origin + vec) - org); + } + + // Switch projectile type based on spawnflag + if (self.spawnflags & MON_FREDDIE_LASER) { + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_LASER, self.attack_speed); + } + else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_MONNG, self.attack_speed); + } +}; + +// Start the initial wind up of the weapon first +//---------------------------------------------------------------------- +void() fred_sfire1 = [ $sfire1, fred_sfire2 ] {ai_face(); + self.pain_finished = time + 0.5 + (skill*0.5); + sound (self, CHAN_WEAPON, "freddie/stfire.wav", 1, ATTN_NORM);}; +void() fred_sfire2 = [ $sfire2, fred_sfire3 ] {ai_face();}; +void() fred_sfire3 = [ $sfire3, fred_sfire4 ] {ai_face();}; +void() fred_sfire4 = [ $sfire4, fred_sfire5 ] {ai_face();}; +void() fred_sfire5 = [ $sfire5, fred_sfire6 ] {ai_face();monster_footstep(FALSE);}; +void() fred_sfire6 = [ $sfire6, fred_sfire7 ] {ai_face();}; +void() fred_sfire7 = [ $sfire7, fred_sfire8 ] {ai_face();}; +void() fred_sfire8 = [ $sfire8, fred_sfire9 ] {ai_face(); + self.cnt = 0; + // Vary bullet burst based on skill + self.attack_chance = 4 + skill*2; +}; + +// Fire the weapon in bursts +//---------------------------------------------------------------------- +void(vector weapofs) fred_standfire = +{ + // Always check AI health before locking in function + if (self.health < 1) return; + + // Turn before offset check + ai_face(); + + // If no enemy or enemy dead then stop attack + if (!self.enemy || self.enemy.health < 1) self.cnt = 10; + // Check if can see enemy? (use weapon offset) + else if (visxray(self.enemy, weapofs, '0 0 0', FALSE)) + self.cnt = self.cnt + 1; + // Reset counter and keep firing + else self.cnt = 0; + + // If fired a burst of bullets at enemy, stop loop + if (self.cnt > self.attack_chance) self.think = self.th_charge; + else fred_fireweapon(weapofs); +}; + +// Cycle through barrel firing +// Easy = 7 shots, Normal = 11 shots, Hard/NM = 15 shots +//---------------------------------------------------------------------- +void() fred_sfire9 = [ $sfire9, fred_sfire10 ] {fred_standfire('45 -10 20');}; +void() fred_sfire10 = [ $sfire10, fred_sfire11 ] {fred_standfire('45 -10 20');}; +void() fred_sfire11 = [ $sfire11, fred_sfire12 ] {fred_standfire('45 -10 22');}; +void() fred_sfire12 = [ $sfire12, fred_sfire13 ] {fred_standfire('45 -10 22');}; +void() fred_sfire13 = [ $sfire13, fred_sfire14 ] {fred_standfire('45 -12 23');}; +void() fred_sfire14 = [ $sfire14, fred_sfire15 ] {fred_standfire('42 -12 25');}; +void() fred_sfire15 = [ $sfire15, fred_sfire16 ] {fred_standfire('42 -14 23'); + // Always double check health before changing think + if (self.health > 0 && skill == SKILL_EASY) self.think = self.th_charge;}; +void() fred_sfire16 = [ $sfire16, fred_sfire17 ] {fred_standfire('38 -14 27');}; +void() fred_sfire17 = [ $sfire17, fred_sfire18 ] {fred_standfire('38 -17 26');}; +void() fred_sfire18 = [ $sfire18, fred_sfire19 ] {fred_standfire('36 -17 28');}; +void() fred_sfire19 = [ $sfire19, fred_sfire20 ] {fred_standfire('36 -17 26'); + // Always double check health before changing think + if (self.health > 0 && skill == SKILL_NORMAL) self.think = self.th_charge;}; +void() fred_sfire20 = [ $sfire20, fred_sfire21 ] {fred_standfire('30 -17 28');}; +void() fred_sfire21 = [ $sfire21, fred_sfire22 ] {fred_standfire('30 -18 25');}; +void() fred_sfire22 = [ $sfire22, fred_sfire23 ] {fred_standfire('25 -18 27');}; +void() fred_sfire23 = [ $sfire23, fred_sfire24 ] {fred_standfire('25 -18 27');}; + +// Finish the wind down of weapon +void() fred_sfire24 = [ $sfire24, fred_sfire25 ] {}; +void() fred_sfire25 = [ $sfire25, fred_sfire26 ] {}; +void() fred_sfire26 = [ $sfire26, fred_sfire27 ] {}; +void() fred_sfire27 = [ $sfire27, fred_run ] {}; + +//============================================================================ +// freddie has a run while firing and can switch seamless +// between the two if the player is within sight +//============================================================================ +void() fred_runframe = +{ + // If dead, no more updates + if (self.health < 1) return; + // If enemy is dead or missing no firing + if (!self.enemy || self.enemy.health < 1) self.attack_timer = FALSE; + + if (self.attack_timer) self.frame = $rfire1 + self.walkframe; + else self.frame = $run1 + self.walkframe; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 1) monster_footstep(FALSE); + else if (self.walkframe == 10) monster_footstep(FALSE); + + if (self.walkframe == 0) {self.distance = 24;self.attack_offset = '50 -20 32';} + else if (self.walkframe == 1) {self.distance = 19;self.attack_offset = '43 -18 33';} + else if (self.walkframe == 2) {self.distance = 1;self.attack_offset = '53 -20 27';} + else if (self.walkframe == 3) {self.distance = 2;self.attack_offset = '47 -19 31';} + else if (self.walkframe == 4) {self.distance = 5;self.attack_offset = '54 -17 29';} + else if (self.walkframe == 5) {self.distance = 10;self.attack_offset = '47 -17 35';} + else if (self.walkframe == 6) {self.distance = 5;self.attack_offset = '53 -15 32';} + else if (self.walkframe == 7) {self.distance = 5;self.attack_offset = '47 -15 36';} + else if (self.walkframe == 8) {self.distance = 24;self.attack_offset = '50 -13 32';} + else if (self.walkframe == 9) {self.distance = 19;self.attack_offset = '46 -15 33';} + else if (self.walkframe == 10) {self.distance = 1;self.attack_offset = '51 -14 33';} + else if (self.walkframe == 11) {self.distance = 2;self.attack_offset = '47 -14 32';} + else if (self.walkframe == 12) {self.distance = 5;self.attack_offset = '52 -14 33';} + else if (self.walkframe == 13) {self.distance = 10;self.attack_offset = '47 -14 36';} + else if (self.walkframe == 14) {self.distance = 5;self.attack_offset = '49 -14 35';} + else if (self.walkframe == 15) {self.distance = 5;self.attack_offset = '45 -15 34';} + + // Run + Fire time? + if (self.attack_timer) { + // Keep turning towards the enemy + ai_face(); + // Fire a small burst at the enemy + self.cnt = self.cnt + 1; + if (self.cnt > 2) self.attack_timer = FALSE; + else fred_fireweapon(self.attack_offset); + } + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 15) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = fred_runframe; + + ai_run(self.distance); +}; + +//---------------------------------------------------------------------- +void() fred_run = { self.walkframe = 0; fred_runframe(); }; + +//=========================================================================== +// MELEE ATTACK - Various back and forth blade arm attacks +//=========================================================================== +void(float side) fred_blade = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_damagebreakable(20); // Damage any breakables + if (!ai_checkmelee(self.meleerange)) return; // Too far away + + // Can the target bleed? - generate blood + if (!CanDamage (self.enemy, self)) return; + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + sound (self, CHAN_WEAPON, "freddie/mangle.wav", 1, ATTN_NORM); + // 1-45 (3x15) damage + ldmg = (random() + random() + random()) * 15; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + SpawnMeatSpray (self, self.enemy, side); +}; + +// Alternative ending of melee attack (chance of extra damage) +//---------------------------------------------------------------------- +void() fred_bswing1 = [ $bswing1, fred_bswing2 ] {ai_faceforward(20); + sound (self, CHAN_WEAPON, "freddie/sawstart.wav", 1, ATTN_NORM);}; +void() fred_bswing2 = [ $bswing2, fred_bswing3 ] {ai_faceforward(12);}; +void() fred_bswing3 = [ $bswing3, fred_bswing4 ] {ai_faceforward(4);}; +void() fred_bswing4 = [ $bswing4, fred_bswing5 ] {ai_faceforward(2);monster_footstep(FALSE);}; +void() fred_bswing5 = [ $bswing5, fred_bswing6 ] {ai_faceforward(6);fred_blade(200);}; +void() fred_bswing6 = [ $bswing6, fred_bswing7 ] {ai_faceforward(4);}; +void() fred_bswing7 = [ $bswing7, fred_bswing8 ] {ai_faceforward(4);}; +void() fred_bswing8 = [ $bswing8, fred_bswing9 ] {ai_faceforward(8);}; +void() fred_bswing9 = [ $bswing9, fred_bswing10 ] {ai_faceforward(8);monster_footstep(FALSE);}; +void() fred_bswing10 = [ $bswing10, fred_bswing11 ] {ai_faceforward(8);}; +void() fred_bswing11 = [ $bswing11, fred_bswing12 ] {ai_faceforward(8);}; +void() fred_bswing12 = [ $bswing12, fred_bswing13 ] {ai_faceforward(12);}; +void() fred_bswing13 = [ $bswing13, fred_bswing14 ] {ai_faceforward(10);}; +void() fred_bswing14 = [ $bswing14, fred_run ] {ai_faceforward(10);}; + +// Start of melee attack +//---------------------------------------------------------------------- +void() fred_fswing1 = [ $fswing1, fred_fswing2 ] {ai_faceforward(8); + sound (self, CHAN_WEAPON, "freddie/sawstart.wav", 1, ATTN_NORM);}; +void() fred_fswing2 = [ $fswing2, fred_fswing3 ] {ai_faceforward(16); monster_footstep(FALSE);}; +void() fred_fswing3 = [ $fswing3, fred_fswing4 ] {ai_faceforward(10); + self.nextthink = time + 0.09;}; +void() fred_fswing4 = [ $fswing4, fred_fswing5 ] {ai_faceforward(4); + self.nextthink = time + 0.08; monster_footstep(FALSE);}; +void() fred_fswing5 = [ $fswing5, fred_fswing6 ] {ai_faceforward(2); + self.nextthink = time + 0.07;}; +void() fred_fswing6 = [ $fswing6, fred_fswing7 ] {ai_faceforward(1); + self.nextthink = time + 0.07;}; +void() fred_fswing7 = [ $fswing7, fred_fswing8 ] {ai_faceforward(1); + self.nextthink = time + 0.06;}; +void() fred_fswing8 = [ $fswing8, fred_fswing9 ] {ai_faceforward(2);fred_blade(-200); + self.nextthink = time + 0.05;}; +void() fred_fswing9 = [ $fswing9, fred_fswing10 ] {ai_faceforward(2);}; +void() fred_fswing10 = [ $fswing10, fred_fswing11 ] {ai_faceforward(2);}; +void() fred_fswing11 = [ $fswing11, fred_fswinge1 ] { + // Always check for enemy and health before changing think + if (self.enemy && self.enemy.health > 1 && self.health > 0) { + // Check if within range to do a second (back) swing attack + if (ai_checkmelee(self.meleerange)) self.think = fred_bswing1; + } +}; + +// End of melee attack +//---------------------------------------------------------------------- +void() fred_fswinge1 = [ $fswinge1, fred_fswinge2 ] {ai_faceforward(2);}; +void() fred_fswinge2 = [ $fswinge2, fred_fswinge3 ] {ai_faceforward(2);}; +void() fred_fswinge3 = [ $fswinge3, fred_fswinge4 ] {ai_faceforward(3);}; +void() fred_fswinge4 = [ $fswinge4, fred_fswinge5 ] {ai_faceforward(4);}; +void() fred_fswinge5 = [ $fswinge5, fred_fswinge6 ] {ai_faceforward(8);}; +void() fred_fswinge6 = [ $fswinge6, fred_fswinge7 ] {ai_faceforward(12);}; +void() fred_fswinge7 = [ $fswinge7, fred_fswinge8 ] {ai_faceforward(16);}; +void() fred_fswinge8 = [ $fswinge8, fred_fswinge9 ] {ai_faceforward(12);}; +void() fred_fswinge9 = [ $fswinge9, fred_fswinge10 ] {ai_faceforward(16);}; +void() fred_fswinge10 = [ $fswinge10, fred_run ] { + ai_faceforward(16);monster_footstep(FALSE);}; + +//============================================================================ +void() fred_pain1 = [ $pain1, fred_pain2 ] {}; +void() fred_pain2 = [ $pain2, fred_pain3 ] {ai_pain(10);}; +void() fred_pain3 = [ $pain3, fred_pain4 ] {ai_pain(9);}; +void() fred_pain4 = [ $pain4, fred_pain5 ] {ai_pain(4);}; +void() fred_pain5 = [ $pain5, fred_pain6 ] {}; +void() fred_pain6 = [ $pain6, fred_pain7 ] {}; +void() fred_pain7 = [ $pain7, fred_pain8 ] {}; +void() fred_pain8 = [ $pain8, fred_pain9 ] {}; +void() fred_pain9 = [ $pain9, fred_pain10 ] {}; +void() fred_pain10 = [ $pain10, fred_pain11 ] {}; +void() fred_pain11 = [ $pain11, fred_pain12 ] {}; +void() fred_pain12 = [ $pain12, fred_run ] {}; + +//---------------------------------------------------------------------- +void() fred_painb1 = [ $painb1, fred_painb2 ] {}; +void() fred_painb2 = [ $painb2, fred_painb3 ] {}; +void() fred_painb3 = [ $painb3, fred_painb4 ] {}; +void() fred_painb4 = [ $painb4, fred_painb5 ] {}; +void() fred_painb5 = [ $painb5, fred_run ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) fred_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.2) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_finished = time + 3 + random()*2; + fred_pain1(); + } + else { + sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.pain_finished = time + 2 + random()*2; + fred_painb1(); + } + } +}; + +//============================================================================ +void() fred_death1 = [ $death1, fred_death2 ] {}; +void() fred_death2 = [ $death2, fred_death3 ] {monster_check_gib();}; +void() fred_death3 = [ $death3, fred_death4 ] {monster_check_gib(); +self.solid = SOLID_NOT;}; +void() fred_death4 = [ $death4, fred_death5 ] {}; +void() fred_death5 = [ $death5, fred_death6 ] {}; +void() fred_death6 = [ $death6, fred_death7 ] {}; +void() fred_death7 = [ $death7, fred_death8 ] {}; +void() fred_death8 = [ $death8, fred_death9 ] {}; +void() fred_death9 = [ $death9, fred_death10 ] {}; +void() fred_death10 = [ $death10, fred_death11 ] {}; +void() fred_death11 = [ $death11, fred_death12 ] {}; +void() fred_death12 = [ $death12, fred_death13 ] {}; +void() fred_death13 = [ $death13, fred_death14 ] {}; +void() fred_death14 = [ $death14, fred_death15 ] {}; +void() fred_death15 = [ $death15, fred_death16 ] {}; +void() fred_death16 = [ $death16, fred_death17 ] {}; +void() fred_death17 = [ $death17, fred_death18 ] {}; +void() fred_death18 = [ $death18, fred_death19 ] {}; +void() fred_death19 = [ $death19, fred_death20 ] {}; +void() fred_death20 = [ $death20, fred_death21 ] {}; +void() fred_death21 = [ $death21, fred_death22 ] {}; +void() fred_death22 = [ $death22, fred_death23 ] {}; +void() fred_death23 = [ $death23, fred_death24 ] {}; +void() fred_death24 = [ $death24, fred_death25 ] {}; +void() fred_death25 = [ $death25, fred_death26 ] {}; +void() fred_death26 = [ $death26, fred_death27 ] {}; +void() fred_death27 = [ $death27, fred_death28 ] {}; +void() fred_death28 = [ $death28, fred_death29 ] {}; +void() fred_death29 = [ $death29, fred_death30 ] {}; +void() fred_death30 = [ $death30, fred_death31 ] {}; +void() fred_death31 = [ $death31, fred_death32 ] {}; +void() fred_death32 = [ $death32, fred_death33 ] {}; +void() fred_death33 = [ $death33, fred_death34 ] {}; +void() fred_death34 = [ $death34, fred_death35 ] {monster_death_postcheck();}; +void() fred_death35 = [ $death35, fred_death35 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() fred_explode = +{ + // no more FREDDIE! + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // ID style explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Sprite + Dust + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + + // Regular blood like gibs + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + ThrowGib(25, 1); + // Metal and custom body parts + self.gibtype = GIBTYPE_METAL; + ThrowGib(11, 1 + rint(random()*2)); + ThrowGib(12, 2 + rint(random()*2)); + ThrowGib(13, 2 + rint(random()*2)); +}; + +//---------------------------------------------------------------------- +void() fred_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "freddie/death.wav", 1, ATTN_NORM); + fred_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_freddie (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_freddie = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_freddie.mdl"; // was edie.mdl + self.headmdl = "progs/h_ogre.mdl"; // ID ogre + self.gib1mdl = "progs/gib_freddiejunk.mdl"; // wreckage.mdl + self.gib2mdl = "progs/gib_metal1.mdl"; // Breakable metal + self.gib3mdl = "progs/gib_metal3.mdl"; // Breakable metal + + precache_model (self.mdl); + precache_model (self.headmdl); // ID Ogre head + // Gib Junk - 0=Axle, 1=bolt, 2=chip, 3=wing + precache_model (self.gib1mdl); // Multiple chunks of junk + self.gib1frame = 3; // 4 frames choose from + precache_model (self.gib2mdl); // Generic metal1_2 + precache_model (self.gib3mdl); // Generic metal1_2 + + self.idle_sound = "freddie/idle1.wav"; + precache_sound (self.idle_sound); + + // Melee sounds, swing and impact + precache_sound("freddie/sawstart.wav"); + precache_sound("freddie/mangle.wav"); + + // Default attack - red glowing nails + precache_model (MODEL_PROJ_NGRED); + precache_sound("freddie/stfire.wav"); + + // Alternative attack - lasers!?! + if (self.spawnflags & MON_FREDDIE_LASER) { + precache_model (MODEL_PROJ_LASER); + precache_sound("seeker/range_laser.wav"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + } + + precache_sound ("freddie/death.wav"); + self.death_sound = "seeker/explode_major.wav"; + precache_sound (self.death_sound); + self.pain_sound = "freddie/pain.wav"; + self.pain_sound2 = "freddie/painshrt.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.sight_sound = "freddie/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 500; + self.gibhealth = -80; // Hard to gib + self.gibbed = FALSE; + self.pain_flinch = 200; // takes alot to pain + self.pain_longanim = FALSE; // cannot be chopped with shadow axe + if (!self.infightextra) self.infightextra = 2; // 2x infighting dmg + self.meleerange = MONAI_MELEEFREDDIE; // Blade range + if (self.death_dmg < 1) self.death_dmg = DAMAGE_FREDDIE; + self.pain_timeout = 2; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.attack_offset = '0 0 0'; // Run + Gun vector + self.poisonous = FALSE; // Robots are not poisonous + self.deathstring = " was exterminated by Freddie\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Custom feet sounds (specific order) + self.stepc1 = "freddie/step.wav"; + self.stepc2 = "freddie/step2.wav"; + self.stepc3 = "freddie/step.wav"; + self.stepc4 = "freddie/step2.wav"; + self.stepc5 = "freddie/step3.wav"; + precache_sound (self.stepc1); + precache_sound (self.stepc2); + precache_sound (self.stepc5); + self.steptype = FS_TYPECUSTOM; + + self.th_checkattack = FreddieCheckAttack; + self.th_stand = fred_stand1; + self.th_walk = fred_walk1; + self.th_run = fred_run; + self.th_melee = fred_fswing1; // Blade arm + self.th_missile = fred_sfire1; // Spike/Laser bolts + self.th_charge = fred_sfire24; // End of barrel weapon + self.th_pain = fred_pain; + self.th_die = fred_die; + self.th_gibdie = fred_explode; + + self.classtype = CT_MONFREDDIE; + self.classgroup = CG_OGRE; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +// Re-direct all Quoth Edie requests to Freddie! +void() monster_edie = { monster_freddie(); } diff --git a/QC_other/QC_arcane/mon_gargoyle.qc b/QC_other/QC_arcane/mon_gargoyle.qc new file mode 100644 index 00000000..a0bc8ab5 --- /dev/null +++ b/QC_other/QC_arcane/mon_gargoyle.qc @@ -0,0 +1,578 @@ +/*============================================================================== +GARGOYLE / IMP (Hexen2 Model) +==============================================================================*/ +// Fall on back to ground +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +// Single attack routine, fling fireball +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 attack16 +$frame attack17 attack18 attack19 attack20 attack21 + +// Classic idle +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 +$frame fly9 fly10 fly11 fly12 fly13 fly14 fly15 fly16 +$frame fly17 fly18 fly19 fly20 + +// Special minion grow animation +// Removed excessive frames (0.05 timing) +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +// Move from perch to flying (can be reversed) +$frame flyup1 flyup2 flyup3 flyup4 flyup5 flyup6 flyup7 flyup8 +$frame flyup9 flyup10 flyup11 flyup12 flyup13 flyup14 flyup15 flyup16 +$frame flyup17 flyup18 flyup19 flyup20 flyup21 flyup22 flyup23 + +// Idle animation for perching (sitting down) +$frame perch1 perch2 perch3 perch4 perch5 perch6 perch7 perch8 +$frame perch9 perch10 perch11 perch12 perch13 perch14 perch15 perch16 +$frame perch17 perch18 perch19 perch20 perch21 perch22 perch23 perch24 + +// Going into a nosedive +$frame swoop1 swoop2 swoop3 swoop4 swoop5 swoop6 swoop7 swoop8 +$frame swoop9 swoop10 swoop11 swoop12 swoop13 swoop14 swoop15 swoop16 +$frame swoop17 swoop18 swoop19 swoop20 + +// Swooshing through the air! +$frame swooploop1 swooploop2 swooploop3 swooploop4 + +// Nose up, back to fly idling +$frame swoopend1 swoopend2 swoopend3 swoopend4 swoopend5 swoopend6 swoopend7 swoopend8 +$frame swoopend9 swoopend10 swoopend11 swoopend12 swoopend13 swoopend14 swoopend15 + +// Alternative to stop swooping +$frame swoopout1 swoopout2 swoopout3 swoopout4 swoopout5 swoopout6 swoopout7 swoopout8 +$frame swoopout9 swoopout10 swoopout11 swoopout12 swoopout13 swoopout14 swoopout15 + +void() gargoylewings = +{ sound(self, CHAN_ITEM, "gargoyle/wings1.wav", 1, ATTN_IDLE); }; +void() garg_fbfinish; + +//====================================================================== +void() garg_idle1 =[ $fly2, garg_idle2 ] {monster_idle_sound();ai_stand();}; +void() garg_idle2 =[ $fly4, garg_idle3 ] {ai_stand();}; +void() garg_idle3 =[ $fly6, garg_idle4 ] {gargoylewings();ai_stand();}; +void() garg_idle4 =[ $fly8, garg_idle5 ] {ai_stand();}; +void() garg_idle5 =[ $fly10, garg_idle6 ] {ai_stand();}; +void() garg_idle6 =[ $fly12, garg_idle7 ] {ai_stand();}; +void() garg_idle7 =[ $fly14, garg_idle8 ] {ai_stand();}; +void() garg_idle8 =[ $fly16, garg_idle9 ] {ai_stand();}; +void() garg_idle9 =[ $fly18, garg_idle10 ] {ai_stand();}; +void() garg_idle10 =[ $fly20, garg_idle1 ] {ai_stand();}; + +//====================================================================== +void() garg_walk1 =[ $fly1, garg_walk2 ] {monster_idle_sound();ai_walk(8);}; +void() garg_walk2 =[ $fly3, garg_walk3 ] {ai_walk(8);}; +void() garg_walk3 =[ $fly5, garg_walk4 ] {gargoylewings();ai_walk(8);}; +void() garg_walk4 =[ $fly7, garg_walk5 ] {ai_walk(8);}; +void() garg_walk5 =[ $fly9, garg_walk6 ] {ai_walk(8);}; +void() garg_walk6 =[ $fly11, garg_walk7 ] {ai_walk(8);}; +void() garg_walk7 =[ $fly13, garg_walk8 ] {ai_walk(8);}; +void() garg_walk8 =[ $fly15, garg_walk9 ] {ai_walk(8);}; +void() garg_walk9 =[ $fly17, garg_walk10 ] {ai_walk(8);}; +void() garg_walk10 =[ $fly19, garg_walk1 ] {ai_walk(8);}; + +//====================================================================== +void() garg_run1 =[ $fly1, garg_run2 ] {monster_idle_sound(); + if (self.attachment && self.attachment.state == STATE_ON) garg_fbfinish(); + // Switch direction of strafing (random duration) + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(4); +}; +void() garg_run2 =[ $fly3, garg_run3 ] {ai_run(5);}; +void() garg_run3 =[ $fly5, garg_run4 ] {gargoylewings(); ai_run(6);}; +void() garg_run4 =[ $fly7, garg_run5 ] {ai_run(7);}; +void() garg_run5 =[ $fly9, garg_run6 ] {ai_run(8);}; +void() garg_run6 =[ $fly11, garg_run7 ] {ai_run(4);}; +void() garg_run7 =[ $fly13, garg_run8 ] {ai_run(5);}; +void() garg_run8 =[ $fly15, garg_run9 ] {ai_run(6);}; +void() garg_run9 =[ $fly17, garg_run10 ] {ai_run(7);}; +void() garg_run10 =[ $fly19, garg_run1 ] {ai_run(8);}; + +//============================================================================ +// Range attack +//============================================================================ +void() garg_fbthrow = +{ + local vector org, dir; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(SUB_orgEnemyTarget() - org); + self.attack_speed = SPEED_GARGMISSILE + (skill * SPEED_GARGSKILL); + + Launch_Missile (org, dir, '0 0 0', CT_PROJ_GARG, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() garg_fbfinish = +{ + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void(float fbframe, vector fbofs) garg_fbupdate = +{ + if (self.health < 1) return; + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + if (self.poisonous) self.attachment.mdl = MODEL_PROJ_GARGBALLGRN; + else self.attachment.mdl = MODEL_PROJ_GARGBALL; + self.attachment.alpha = 0.85; + } + + if (fbframe == 0) { + self.attachment.state = STATE_ON; + self.pain_finished = time + 1.5; //don't go into pain whilst firing + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + sound (self, CHAN_WEAPON, "gargoyle/attack1.wav", 1, ATTN_NORM); + } + + ai_face(); // Turn towards enemy + makevectors(self.angles); + self.attachment.origin = self.origin + v_forward*fbofs_x + v_right*fbofs_y; + self.attachment.origin_z = self.attachment.origin_z + fbofs_z; + setorigin(self.attachment, self.attachment.origin); + self.attachment.angles = self.angles; + self.attachment.frame = fbframe; +}; + +//---------------------------------------------------------------------- +// Original offset position for gargoyle fireball (designed for a sprite) +// 10 16 0, 4 24 2, -7 28 15, -25 26 28, -38 12 45, -38 9 45, -17 36 30, 24 16 10 +// Changed the offset to match the new model instead +// Positioned the fireball to match the hand orientation +//---------------------------------------------------------------------- +void() garg_fire1 =[ $attack2, garg_fire2 ] {garg_fbupdate(0,'10 16 -2');}; +void() garg_fire2 =[ $attack4, garg_fire3 ] {garg_fbupdate(2,'0 20 -2');}; +void() garg_fire3 =[ $attack6, garg_fire4 ] {garg_fbupdate(3,'-6 23 6');gargoylewings();}; +void() garg_fire4 =[ $attack8, garg_fire5 ] {garg_fbupdate(4,'-16 26 18');}; +void() garg_fire5 =[ $attack10, garg_fire6 ] {garg_fbupdate(5,'-29 18 38');}; +void() garg_fire6 =[ $attack12, garg_fire7 ] {garg_fbupdate(4,'-34 9 45');}; +void() garg_fire7 =[ $attack14, garg_fire8 ] {garg_fbupdate(3,'-32 22 38');}; +void() garg_fire8 =[ $attack16, garg_fire9 ] {garg_fbfinish();garg_fbthrow();}; +void() garg_fire9 =[ $attack18, garg_fire10 ] {ai_face();monster_idle_sound();}; +void() garg_fire10 =[ $attack20, garg_run1 ] {ai_face(); + // If enemy really close, goto into a frenzy of fireball attacks + self.enemydist = range_distance(SUB_entEnemyTarget(), FALSE); + if (SUB_healthEnemyTarget() > 0 && self.enemydist < MON_RANGE_CLOSE) self.think = garg_fire1; + else self.attack_state = AS_STRAIGHT; +}; + +//============================================================================ +// PERCH + WAKEUP +//============================================================================ +void() garg_perch1 =[ $perch2, garg_perch2 ] {monster_idle_sound();ai_stand();}; +void() garg_perch2 =[ $perch4, garg_perch3 ] {ai_stand();}; +void() garg_perch3 =[ $perch6, garg_perch4 ] {ai_stand();}; +void() garg_perch4 =[ $perch8, garg_perch5 ] {ai_stand();}; +void() garg_perch5 =[ $perch10, garg_perch6 ] {ai_stand();}; +void() garg_perch6 =[ $perch12, garg_perch7 ] {ai_stand();}; +void() garg_perch7 =[ $perch14, garg_perch8 ] {ai_stand();}; +void() garg_perch8 =[ $perch16, garg_perch9 ] {ai_stand();}; +void() garg_perch9 =[ $perch18, garg_perch10 ] {ai_stand();}; +void() garg_perch10=[ $perch20, garg_perch11 ] {ai_stand();}; +void() garg_perch11=[ $perch22, garg_perch12 ] {ai_stand();}; +void() garg_perch12=[ $perch24, garg_perch1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +// Sightsound and very quick animation while moving forward +void() garg_wakeup1 =[ $flyup2, garg_wakeup2 ] {ai_forward(1);}; +void() garg_wakeup2 =[ $flyup4, garg_wakeup3 ] {ai_forward(4);}; +void() garg_wakeup3 =[ $flyup6, garg_wakeup4 ] {ai_forward(8);}; +void() garg_wakeup4 =[ $flyup14, garg_wakeup5 ] {ai_forward(8);gargoylewings();}; +void() garg_wakeup5 =[ $flyup16, garg_wakeup6 ] {ai_forward(4);}; +void() garg_wakeup6 =[ $flyup20, garg_run1 ] { + monster_targets(); // Find target (angry/path_corner) + self.nextthink = time + 0.1;// Next frame +}; + +//---------------------------------------------------------------------- +void() gargoyle_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // No longer perched on the ground + self.spawnflags = self.spawnflags - (self.spawnflags & MON_GARGOYLE_PERCH); + self.spawnflags = self.spawnflags - (self.spawnflags & MON_STATUE); + self.spawnstatue = FALSE; // No longer stationary + + self.takedamage = DAMAGE_AIM; // Can receive damage + self.use = SUB_Null; // no re-trigger + + // Restore all think state functions + self.th_stand = garg_idle1; + self.th_walk = garg_walk1; + self.th_run = garg_run1; + self.th_missile = garg_fire1; + + // Allow gargoyle to fly up, no more ground checks + self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_STEP; + self.pain_finished = time + 1.5; // No pain + self.attack_finished = 1.5 + random(); // No skill adjustment + garg_wakeup1(); +}; + +//---------------------------------------------------------------------- +void() gargoyle_statue = +{ + if (random() < MON_IDLE_SOUND) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + + self.think = gargoyle_statue; + self.nextthink = time + 5 + random()*5; +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() gargoyle_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() gargoyle_grow1 = [ $grow1, gargoyle_grow2 ] {}; +void() gargoyle_grow2 = [ $grow2, gargoyle_grow3 ] {gargoyle_growangle();}; +void() gargoyle_grow3 = [ $grow3, gargoyle_grow4 ] {gargoyle_growangle();}; +void() gargoyle_grow4 = [ $grow4, gargoyle_grow5 ] {gargoyle_growangle();}; +void() gargoyle_grow5 = [ $grow5, gargoyle_grow6 ] {gargoyle_growangle();}; +void() gargoyle_grow6 = [ $grow6, gargoyle_grow7 ] {gargoyle_growangle();}; +void() gargoyle_grow7 = [ $grow7, gargoyle_grow8 ] {gargoyle_growangle();}; +void() gargoyle_grow8 = [ $grow8, gargoyle_grow9 ] {gargoyle_growangle();}; +void() gargoyle_grow9 = [ $grow9, gargoyle_grow10] {gargoyle_growangle();}; +void() gargoyle_grow10= [ $grow10, garg_run1 ] { + // Is the gargoyle stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = garg_idle1; + self.th_walk = garg_walk1; + self.th_run = garg_run1; + self.th_missile = garg_fire1; + } +}; +//---------------------------------------------------------------------------- +void() gargoyle_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + gargoyle_grow1(); +}; + +//============================================================================ +// The gargoyle does not have a specific pain animation +// - Kinn created one from the death animation (Marcher progs) +void() garg_pain1 =[ $death3, garg_pain2 ] {}; +void() garg_pain2 =[ $death4, garg_pain3 ] {}; +void() garg_pain3 =[ $death3, garg_pain4 ] {}; +void() garg_pain4 =[ $death2, garg_pain5 ] {}; +void() garg_pain5 =[ $death1, garg_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) garg_pain = +{ + // Check for perching gargoyles, need special wakeup + if (self.spawnflags & MON_GARGOYLE_PERCH) gargoyle_wakeup(); + // Statues don't feel pain! + else if (self.spawnflags & MON_STATUE) return; + else { + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // make sure any fireball is hidden + if (self.attachment) garg_fbfinish(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + garg_pain1 (); + } + } + } +}; + +//============================================================================ +void() garg_death1 =[ $death1, garg_death2 ] {}; +void() garg_death2 =[ $death3, garg_death3 ] {monster_check_gib();}; +void() garg_death3 =[ $death5, garg_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() garg_death4 =[ $death7, garg_death5 ] {}; +void() garg_death5 =[ $death9, garg_death6 ] {}; +void() garg_death6 =[ $death11, garg_death7 ] {}; +void() garg_death7 =[ $death13, garg_death8 ] {monster_death_postcheck();}; +void() garg_death8 =[ $death14, garg_death8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() garg_die = +{ + // Statues don't die! + if (self.spawnflags & MON_STATUE) return; + + // Make sure any wings sound is silenced + sound (self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_NORM); + + // Check for perching gargoyles, need to blow up in gibs + // In an awkward pose that does not go well into death animations + if (self.spawnflags & MON_GARGOYLE_PERCH) self.gibondeath = TRUE; + + // If creating a Fireball, make it explode! + if (self.attachment) { + if (self.attachment.state == STATE_ON) { + self.gibondeath = TRUE; + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (self.poisonous) self.lip = PARTICLE_BURST_GREEN; + else self.lip = PARTICLE_BURST_FIRE; + particle_explode(self.origin-'0 0 16', 50+random()*50, 2, self.lip, PARTICLE_BURST_UPWARD); + makevectors(self.angles); + self.oldorigin = self.origin + v_forward*8; + if (self.poisonous) self.lip = EXPLODE_POISON_BIG; + else self.lip = EXPLODE_BIG; + SpawnExplosion(self.lip, self.oldorigin, SOUND_REXP3); + } + // make sure any fireball is hidden + garg_fbfinish(); + } + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // If not gibbed, then drop to ground + if (!self.gibbed) { + sound (self, CHAN_VOICE, "gargoyle/death1.wav", 1, ATTN_NORM); + self.flags = FL_MONSTER; // reset all flag conditions + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + garg_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_gargoyle (0.8 0 0.2) (-16 -16 -24) (16 16 40) AMBUSH STATUE PERCH NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/mon_gargoyle.mdl"); } +Gargoyle, 120 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +STATUE : Stone statue until triggered (always starts in a perched position) +PERCH : Start in a sitting down, place 44 units out from perching edge, 4 units higher + +======================================================================*/ +void() setup_gargoyle; +void() monster_gargoyle = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_gargoyle.mdl"; + self.headmdl = "progs/h_gargoyle.mdl"; + self.gib1mdl = "progs/gib_gargwing1.mdl"; // Left wing + self.gib2mdl = "progs/gib_gargwing2.mdl"; // Right wing + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GARGBALL); // FB growing 8 frames + precache_model (MODEL_PROJ_GARGOYLE); // red/smoke wiz projectile + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + + self.idle_sound = "gargoyle/idle1.wav"; + self.idle_soundcom = "gargoyle/perch1.wav"; + self.idle_soundcom2 = "gargoyle/perch2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + precache_sound ("gargoyle/attack1.wav"); // Doom imp fireball! + precache_sound ("gargoyle/swoop1.wav"); + precache_sound ("gargoyle/swoop2.wav"); + precache_sound ("gargoyle/swoop1hit.wav"); + precache_sound ("gargoyle/wings1.wav"); + + self.pain_sound = "gargoyle/pain75.wav"; + self.pain_sound2 = "gargoyle/pain100.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("gargoyle/death1.wav"); + + self.sight_sound = "gargoyle/sight1.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GARGBALLGRN); // Ball growing 8 frames + precache_model (MODEL_PROJ_GARGOYLEGRN); // acid/smoke wiz projectile + } + + // Cache gargoyle is a special class used for precache only + if (self.classtype != CT_CACHEGARGOYLE) setup_gargoyle(); +}; + +//---------------------------------------------------------------------------- +void() monster_minotaurminion = { + self.classtype = CT_CACHEGARGOYLE; + self.poisonous = TRUE; // Cache poison stuff for minotaur spawns + monster_gargoyle(); +}; + +//---------------------------------------------------------------------------- +void() setup_gargoyle = +{ + // Randomize gib parts + if (random() < 0.5) self.gib1mdl = string_null; + else if (random() < 0.5) self.gib2mdl = string_null; + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = -70; // Need a powerful weapon to GIB + self.gibbed = FALSE; // no falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + self.attack_offset = '16 28 22'; // fireball start location + self.deathstring = " was burned by a Gargoyle\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = GargoyleCheckAttack; + self.th_pain = garg_pain; + self.th_die = garg_die; + + if(!self.classtype) self.classtype = CT_MONGARGOYLE; + if (!self.classgroup) self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + // Fix double spawnflags problem - default to statue + if (self.spawnflags & MON_STATUE && self.spawnflags & MON_GARGOYLE_PERCH) { + dprint("\b[GARGOYLE]\b Cannot be perch and statue!\n"); + self.spawnflags = self.spawnflags - MON_GARGOYLE_PERCH; + } + + //---------------------------------------------------------------------- + // Perched Gargoyles have special idle animation + idle sounds + // The AI needs to be setup 40 units forward and 24 units up + // to be positioned feet flat on perch surface + if (self.spawnflags & MON_GARGOYLE_PERCH) { + self.th_stand = self.th_walk = garg_perch1; + self.th_run = self.th_missile = gargoyle_wakeup; + } + //---------------------------------------------------------------------- + // Statue Gargoyles setup in perch position with statue idle sounds + // Randomly picks a frame position from perch animation set + else if (self.spawnflags & MON_STATUE) { + // Setup stone idle sounds + self.idle_sound = "statue/idle1.wav"; + self.idle_sound2 = "statue/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.spawnstatue = TRUE; // Start as a statue + self.poisonous = FALSE; // Cannot be status + poison + self.th_stand = gargoyle_statue; // Stone idle pose + self.think1 = gargoyle_wakeup; // Wakeup statue angry at player + self.skin = 1; // Stone like skin + self.gib1skin = self.gib2skin = 1; + //self.resist_nails = 0.5; // Stone resistance + // Work out random starting pose + self.pos1_x = $perch1; + self.pos1_y = $perch24; + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = rint(self.pos1_x + random() * self.pos1_z); + } + //---------------------------------------------------------------------- + // Special spawning minion need to start spinning + else if (self.classtype == CT_MINIONGARGOYLE) { + self.th_stand = self.th_walk = self.th_run = gargoyle_grow; + self.th_missile = SUB_Null; + } + //---------------------------------------------------------------------- + // Default gargoyle setup + else { + self.th_stand = garg_idle1; + self.th_walk = garg_walk1; + self.th_run = garg_run1; + self.th_missile = garg_fire1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn gargoyles (requires monster_minotaurminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_gargoyle = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + // Self = minotaur, there is no egg + update_minioncount(self, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_gargoyle"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self; // Spawner Parent Link + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONGARGOYLE; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = 0; + minion.classgroup = CG_DEMON; // Don't turn on master + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + // Check for poison gibs being cached first + if (gibpoison && self.poisonous == TRUE) { + minion.poisonous = self.poisonous; // carry over from host spawner + minion.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + // Adopt parameters from host spawner + minion.infightextra = self.infightextra; + + minion.mdl = "progs/mon_gargoyle.mdl"; + minion.headmdl = "progs/h_gargoyle.mdl"; + minion.gib1mdl = "progs/gib_gargwing1.mdl"; // Left wing + minion.gib2mdl = "progs/gib_gargwing2.mdl"; // Right wing + + minion.pain_sound = "gargoyle/pain75.wav"; + minion.pain_sound2 = "gargoyle/pain100.wav"; + minion.idle_sound = "gargoyle/idle1.wav"; + minion.idle_soundcom = "gargoyle/perch1.wav"; + minion.idle_soundcom2 = "gargoyle/perch2.wav"; + minion.sight_sound = "gargoyle/sight1.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_gargoyle; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_gaunt.qc b/QC_other/QC_arcane/mon_gaunt.qc new file mode 100644 index 00000000..d56857cb --- /dev/null +++ b/QC_other/QC_arcane/mon_gaunt.qc @@ -0,0 +1,450 @@ +/*============================================================================== + GAUNT (Originally from Quoth - Kell/Necros/Preach) + - Big thank you to necros for the his code base for this monster +==============================================================================*/ +// (000) Perched on a ledge (idling) +$frame perch1 perch2 perch3 perch4 perch5 perch6 perch7 perch8 +$frame perch9 perch10 perch11 perch12 perch13 perch14 perch15 perch16 + +// (016) Lift off from perch position +$frame launch1 launch2 launch3 launch4 launch5 launch6 launch7 launch8 + +// (024) Idling in mid air +$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 +$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 hover16 +$frame hover17 hover18 hover19 hover20 + +// (044) range attack (lightning/plasma) +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 attack16 +$frame attack17 attack18 attack19 attack20 + +// (064) Start of dive attack +$frame swoopStart1 swoopStart2 swoopStart3 swoopStart4 +$frame swoopStart5 swoopStart6 swoopStart7 swoopStart8 + +// (072) Looped version of dive attack +$frame swoop1 swoop2 swoop3 swoop4 swoop5 + +// (077) Something, not sure what +$frame drop1 drop2 drop3 drop4 drop5 + +// (082) Swing wing around infront +$frame painA1 painA2 painA3 painA4 painA5 painA6 + +// (088) Knock head backward +$frame painB1 painB2 painB3 painB4 painB5 + +// (093) Fall backwards +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 + +// (101) Fall forward +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 + +void() gauntwings = +{ sound(self, CHAN_ITEM, "gaunt/wings1.wav", 1, ATTN_IDLE); }; +void() gaunt_elecfinish; + +//============================================================================ +void() gaunt_idle1 = [ $hover1, gaunt_idle2 ] {monster_idle_sound();ai_stand();}; +void() gaunt_idle2 = [ $hover2, gaunt_idle3 ] {ai_stand();}; +void() gaunt_idle3 = [ $hover3, gaunt_idle4 ] {ai_stand();}; +void() gaunt_idle4 = [ $hover4, gaunt_idle5 ] {ai_stand();}; +void() gaunt_idle5 = [ $hover5, gaunt_idle6 ] {gauntwings();ai_stand();}; +void() gaunt_idle6 = [ $hover6, gaunt_idle7 ] {ai_stand();}; +void() gaunt_idle7 = [ $hover7, gaunt_idle8 ] {ai_stand();}; +void() gaunt_idle8 = [ $hover8, gaunt_idle9 ] {ai_stand();}; +void() gaunt_idle9 = [ $hover9, gaunt_idle10 ] {ai_stand();}; +void() gaunt_idle10 = [ $hover10, gaunt_idle11 ] {ai_stand();}; +void() gaunt_idle11 = [ $hover11, gaunt_idle12 ] {ai_stand();}; +void() gaunt_idle12 = [ $hover12, gaunt_idle13 ] {ai_stand();}; +void() gaunt_idle13 = [ $hover13, gaunt_idle14 ] {ai_stand();}; +void() gaunt_idle14 = [ $hover14, gaunt_idle15 ] {ai_stand();}; +void() gaunt_idle15 = [ $hover15, gaunt_idle16 ] {gauntwings();ai_stand();}; +void() gaunt_idle16 = [ $hover16, gaunt_idle17 ] {ai_stand();}; +void() gaunt_idle17 = [ $hover17, gaunt_idle18 ] {ai_stand();}; +void() gaunt_idle18 = [ $hover18, gaunt_idle19 ] {ai_stand();}; +void() gaunt_idle19 = [ $hover19, gaunt_idle20 ] {ai_stand();}; +void() gaunt_idle20 = [ $hover20, gaunt_idle1 ] {ai_stand();}; + +//============================================================================ +void() gaunt_walk1 = [ $hover1, gaunt_walk2 ] {monster_idle_sound();ai_walk(8);}; +void() gaunt_walk2 = [ $hover2, gaunt_walk3 ] {ai_walk(8);}; +void() gaunt_walk3 = [ $hover3, gaunt_walk4 ] {gauntwings();ai_walk(8);}; +void() gaunt_walk4 = [ $hover4, gaunt_walk5 ] {ai_walk(8);}; +void() gaunt_walk5 = [ $hover5, gaunt_walk6 ] {ai_walk(8);}; +void() gaunt_walk6 = [ $hover6, gaunt_walk7 ] {ai_walk(8);}; +void() gaunt_walk7 = [ $hover7, gaunt_walk8 ] {ai_walk(8);}; +void() gaunt_walk8 = [ $hover8, gaunt_walk9 ] {ai_walk(8);}; +void() gaunt_walk9 = [ $hover9, gaunt_walk10 ] {ai_walk(8);}; +void() gaunt_walk10 = [ $hover10, gaunt_walk11 ] {ai_walk(8);}; +void() gaunt_walk11 = [ $hover11, gaunt_walk12 ] {ai_walk(8);}; +void() gaunt_walk12 = [ $hover12, gaunt_walk13 ] {ai_walk(8);}; +void() gaunt_walk13 = [ $hover13, gaunt_walk14 ] {ai_walk(8);}; +void() gaunt_walk14 = [ $hover14, gaunt_walk15 ] {ai_walk(8);}; +void() gaunt_walk15 = [ $hover15, gaunt_walk16 ] {gauntwings();ai_walk(8);}; +void() gaunt_walk16 = [ $hover16, gaunt_walk17 ] {ai_walk(8);}; +void() gaunt_walk17 = [ $hover17, gaunt_walk18 ] {ai_walk(8);}; +void() gaunt_walk18 = [ $hover18, gaunt_walk19 ] {ai_walk(8);}; +void() gaunt_walk19 = [ $hover19, gaunt_walk20 ] {ai_walk(8);}; +void() gaunt_walk20 = [ $hover20, gaunt_walk1 ] {ai_walk(8);}; + +//============================================================================ +void() gaunt_run1 = [ $hover1, gaunt_run2 ] {monster_idle_sound(); + if (self.attachment && self.attachment.state == STATE_ON) gaunt_elecfinish(); + // Switch direction of strafing (random duration) + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(8); +}; +void() gaunt_run2 = [ $hover2, gaunt_run3 ] {ai_run(8);}; +void() gaunt_run3 = [ $hover3, gaunt_run4 ] {ai_run(8);}; +void() gaunt_run4 = [ $hover4, gaunt_run5 ] {ai_run(8);}; +void() gaunt_run5 = [ $hover5, gaunt_run6 ] {gauntwings();ai_run(8);}; +void() gaunt_run6 = [ $hover6, gaunt_run7 ] {ai_run(8);}; +void() gaunt_run7 = [ $hover7, gaunt_run8 ] {ai_run(8);}; +void() gaunt_run8 = [ $hover8, gaunt_run9 ] {ai_run(8);}; +void() gaunt_run9 = [ $hover9, gaunt_run10 ] {ai_run(8);}; +void() gaunt_run10 = [ $hover10, gaunt_run11 ] {ai_run(8);}; +void() gaunt_run11 = [ $hover11, gaunt_run12 ] {ai_run(8);}; +void() gaunt_run12 = [ $hover12, gaunt_run13 ] {ai_run(8);}; +void() gaunt_run13 = [ $hover13, gaunt_run14 ] {ai_run(8);}; +void() gaunt_run14 = [ $hover14, gaunt_run15 ] {ai_run(8);}; +void() gaunt_run15 = [ $hover15, gaunt_run16 ] {gauntwings();ai_run(8);}; +void() gaunt_run16 = [ $hover16, gaunt_run17 ] {ai_run(8);}; +void() gaunt_run17 = [ $hover17, gaunt_run18 ] {ai_run(8);}; +void() gaunt_run18 = [ $hover18, gaunt_run19 ] {ai_run(8);}; +void() gaunt_run19 = [ $hover19, gaunt_run20 ] {ai_run(8);}; +void() gaunt_run20 = [ $hover20, gaunt_run1 ] {ai_run(8);}; + +//============================================================================ +// RANGE - Plasma from arc infront +//============================================================================ +void() gaunt_plasma = +{ + local vector org, dir; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "gaunt/plasma_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(SUB_orgEnemyTarget() - self.origin); + self.attack_speed = SPEED_GAUNTBOLT + (skill * SPEED_GAUNTSKILL); + + launch_plasma(org, dir, CT_MONGAUNT, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() gaunt_elecfinish = +{ + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void(float elecframe) gaunt_elecupdate = +{ + if (self.health < 1) return; + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = self.weaponglow; + if (self.poisonous) self.attachment.skin = 1; + } + + if (elecframe == 0) { + self.attachment.state = STATE_ON; + self.pain_finished = time + 1.2; //don't go into pain whilst firing + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + sound (self, CHAN_WEAPON, "gaunt/plasma_start.wav", 1, ATTN_NORM); + } + + ai_face(); // Turn towards enemy + makevectors(self.angles); + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = elecframe; +}; + +//---------------------------------------------------------------------- +void() gaunt_fire1 = [ $attack1, gaunt_fire2 ] {gaunt_elecupdate(0);}; +void() gaunt_fire2 = [ $attack2, gaunt_fire3 ] {gaunt_elecupdate(1);}; +void() gaunt_fire3 = [ $attack3, gaunt_fire4 ] {gaunt_elecupdate(2);}; +void() gaunt_fire4 = [ $attack4, gaunt_fire5 ] {gaunt_elecupdate(3);}; +void() gaunt_fire5 = [ $attack5, gaunt_fire6 ] {gaunt_elecupdate(4);gauntwings();}; +void() gaunt_fire6 = [ $attack6, gaunt_fire7 ] {gaunt_elecupdate(5);gaunt_plasma();}; +void() gaunt_fire7 = [ $attack7, gaunt_fire8 ] {gaunt_elecupdate(6);}; +void() gaunt_fire8 = [ $attack8, gaunt_fire9 ] {gaunt_elecupdate(7);gaunt_plasma();}; +void() gaunt_fire9 = [ $attack9, gaunt_fire10 ] {gaunt_elecupdate(8);}; +void() gaunt_fire10 = [ $attack10, gaunt_fire11 ] {ai_face(); + if (skill > SKILL_NORMAL) gaunt_plasma(); + gaunt_elecfinish();}; +void() gaunt_fire11 = [ $attack11, gaunt_fire12 ] {}; +void() gaunt_fire12 = [ $attack12, gaunt_fire13 ] {}; +void() gaunt_fire13 = [ $attack13, gaunt_fire14 ] {}; +void() gaunt_fire14 = [ $attack14, gaunt_fire15 ] {}; +void() gaunt_fire15 = [ $attack15, gaunt_fire16 ] {gauntwings();}; +void() gaunt_fire16 = [ $attack16, gaunt_fire17 ] {}; +void() gaunt_fire17 = [ $attack17, gaunt_fire18 ] {}; +void() gaunt_fire18 = [ $attack18, gaunt_fire19 ] {ai_face();}; +void() gaunt_fire19 = [ $attack19, gaunt_fire20 ] {ai_face();}; +void() gaunt_fire20 = [ $attack20, gaunt_run1 ] {}; + +//============================================================================ +// PERCH + WAKEUP +//============================================================================ +void() gaunt_perch1 = [ $perch1, gaunt_perch2 ] {monster_idle_sound();ai_stand();}; +void() gaunt_perch2 = [ $perch2, gaunt_perch3 ] {ai_stand();}; +void() gaunt_perch3 = [ $perch3, gaunt_perch4 ] {ai_stand();}; +void() gaunt_perch4 = [ $perch4, gaunt_perch5 ] {ai_stand();}; +void() gaunt_perch5 = [ $perch5, gaunt_perch6 ] {ai_stand();}; +void() gaunt_perch6 = [ $perch6, gaunt_perch7 ] {ai_stand();}; +void() gaunt_perch7 = [ $perch7, gaunt_perch8 ] {ai_stand();}; +void() gaunt_perch8 = [ $perch8, gaunt_perch9 ] {ai_stand();}; +void() gaunt_perch9 = [ $perch9, gaunt_perch10 ] {ai_stand();}; +void() gaunt_perch10 = [ $perch10, gaunt_perch11 ] {ai_stand();}; +void() gaunt_perch11 = [ $perch11, gaunt_perch12 ] {ai_stand();}; +void() gaunt_perch12 = [ $perch12, gaunt_perch13 ] {ai_stand();}; +void() gaunt_perch13 = [ $perch13, gaunt_perch14 ] {ai_stand();}; +void() gaunt_perch14 = [ $perch14, gaunt_perch15 ] {ai_stand();}; +void() gaunt_perch15 = [ $perch15, gaunt_perch16 ] {ai_stand();}; +void() gaunt_perch16 = [ $perch16, gaunt_perch1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +// Sightsound and very quick animation while moving forward +void() gaunt_wakeup1 = [ $launch1, gaunt_wakeup2 ] {monster_sightsound();}; +void() gaunt_wakeup2 = [ $launch2, gaunt_wakeup3 ] {ai_forward(4);}; +void() gaunt_wakeup3 = [ $launch3, gaunt_wakeup4 ] {ai_forward(4);}; +void() gaunt_wakeup4 = [ $launch4, gaunt_wakeup5 ] {ai_forward(4);}; +void() gaunt_wakeup5 = [ $launch5, gaunt_wakeup6 ] {ai_forward(4);}; +void() gaunt_wakeup6 = [ $launch6, gaunt_wakeup7 ] {gauntwings();ai_forward(4);}; +void() gaunt_wakeup7 = [ $launch7, gaunt_wakeup8 ] {ai_forward(4);}; +void() gaunt_wakeup8 = [ $launch8, gaunt_run1 ] { + FoundHuntTarget(TRUE); // Setup goals and warn other monsters +}; + +//---------------------------------------------------------------------- +void() gaunt_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // No longer need perch spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_GAUNT_PERCH); + self.spawnstatue = FALSE; // No longer stationary + + self.takedamage = DAMAGE_AIM; // Can receive damage + self.use = SUB_Null; // no re-trigger + + // Restore all think state functions + self.th_stand = gaunt_idle1; + self.th_walk = gaunt_walk1; + self.th_run = gaunt_run1; + self.th_missile = gaunt_fire1; + + // Allow gaunt to fly up, no more ground checks + self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_STEP; + self.pain_finished = time + 1.5; // No pain + self.attack_finished = 1.5 + random(); // No skill adjustment + gaunt_wakeup1(); +}; + +//============================================================================ +// PAIN +//============================================================================ +// Long - Swing wing around infront +void() gaunt_painA1 =[ $painA1, gaunt_painA2 ] {}; +void() gaunt_painA2 =[ $painA2, gaunt_painA3 ] {}; +void() gaunt_painA3 =[ $painA3, gaunt_painA4 ] {}; +void() gaunt_painA4 =[ $painA4, gaunt_painA5 ] {}; +void() gaunt_painA5 =[ $painA5, gaunt_painA6 ] {}; +void() gaunt_painA6 =[ $painA6, gaunt_run1 ] {}; + +// Short - Knock head backward +void() gaunt_painB1 =[ $painB1, gaunt_painB2 ] {}; +void() gaunt_painB2 =[ $painB2, gaunt_painB3 ] {}; +void() gaunt_painB3 =[ $painB3, gaunt_painB4 ] {}; +void() gaunt_painB4 =[ $painB4, gaunt_painB5 ] {}; +void() gaunt_painB5 =[ $painB5, gaunt_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) gaunt_pain = +{ + // Check for perching gaunt, need special wakeup + if (self.spawnflags & MON_GARGOYLE_PERCH) gaunt_wakeup(); + else { + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // make sure any electricity is hidden + if (self.attachment) gaunt_elecfinish(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + if (self.lip < 0.4) gaunt_painB1(); // Long + else gaunt_painA1(); // Short + } + } + } +}; + +//============================================================================ +void() gaunt_deathA1 = [ $deathA1, gaunt_deathA2 ] {}; +void() gaunt_deathA2 = [ $deathA2, gaunt_deathA3 ] {monster_check_gib();}; +void() gaunt_deathA3 = [ $deathA3, gaunt_deathA4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() gaunt_deathA4 = [ $deathA4, gaunt_deathA5 ] {}; +void() gaunt_deathA5 = [ $deathA5, gaunt_deathA6 ] {}; +void() gaunt_deathA6 = [ $deathA6, gaunt_deathA7 ] {}; +void() gaunt_deathA7 = [ $deathA7, gaunt_deathA8 ] {monster_death_postcheck();}; +void() gaunt_deathA8 = [ $deathA8, gaunt_deathA8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() gaunt_deathB1 = [ $deathB1, gaunt_deathB2 ] {}; +void() gaunt_deathB2 = [ $deathB2, gaunt_deathB3 ] {monster_check_gib();}; +void() gaunt_deathB3 = [ $deathB3, gaunt_deathB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() gaunt_deathB4 = [ $deathB4, gaunt_deathB5 ] {}; +void() gaunt_deathB5 = [ $deathB5, gaunt_deathB6 ] {}; +void() gaunt_deathB6 = [ $deathB6, gaunt_deathB7 ] {}; +void() gaunt_deathB7 = [ $deathB7, gaunt_deathB8 ] {monster_death_postcheck();}; +void() gaunt_deathB8 = [ $deathB8, gaunt_deathB8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() gaunt_die = +{ + // Check for perching gaunt, need to blow up in gibs + // In an awkward pose that does not go well into death animations + if (self.spawnflags & MON_GAUNT_PERCH) self.gibondeath = TRUE; + + // Make sure any wings sound is silenced + sound (self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_NORM); + + // If casting electricity, make it explode! + if (self.attachment) { + if (self.attachment.state == STATE_ON) { + self.gibondeath = TRUE; + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (self.poisonous) self.lip = PARTICLE_BURST_GREEN; + else self.lip = PARTICLE_BURST_BLUE; + particle_explode(self.origin-'0 0 16', 50+random()*50, 2, self.lip, PARTICLE_BURST_UPWARD); + makevectors(self.angles); + self.oldorigin = self.origin + v_forward*8; + if (self.poisonous) self.lip = EXPLODE_POISON_BIG; + else self.lip = EXPLODE_PLASMA_BIG; + SpawnExplosion(self.lip, self.oldorigin, SOUND_REXP3); + } + // make sure any electricity is hidden + gaunt_elecfinish(); + } + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "gaunt/death.wav", 1, ATTN_NORM); + self.flags = FL_MONSTER; // reset all flag conditions + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + if (random() < 0.5) gaunt_deathA1(); + else gaunt_deathB1(); + } +}; + +/*====================================================================== +QUAKED monster_gaunt (1 0.2 0) (-16 -16 -24) (16 16 24) +======================================================================*/ +void() monster_gaunt = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_gaunt.mdl"; + self.headmdl = "progs/h_gaunt.mdl"; + self.weaponglow = "progs/mon_gaunt_elec.mdl"; + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.weaponglow); // Lightning effect (2 colour) + precache_model (MODEL_PROJ_GAPLASMA); // Plasma spike/bolt + + self.idle_sound = "gaunt/idle1.wav"; + self.idle_sound2 = "gaunt/idle3.wav"; + self.idle_soundcom = "gaunt/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + precache_sound ("gaunt/wings1.wav"); + precache_sound ("gaunt/plasma_start.wav"); + precache_sound ("gaunt/plasma_fire.wav"); + + self.pain_sound = "gaunt/pain.wav"; + precache_sound (self.pain_sound); + precache_sound ("gaunt/death.wav"); + + self.sight_sound = "gaunt/sight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GAPLASMAGRN); + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = -70; // Need a powerful weapon to GIB + self.gibbed = FALSE; // no falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.height = MONAI_ABOVEDIST; // Enemytarget distance above + self.attack_offset = '8 0 -4'; // Plasma start location + self.deathstring = " was blasted by a Gaunt\n"; + + self.th_checkattack = GauntCheckAttack; + self.th_pain = gaunt_pain; + self.th_die = gaunt_die; + + //---------------------------------------------------------------------- + // Perched Gaunt have special idle animation + idle sounds + if (self.spawnflags & MON_GAUNT_PERCH) { + self.th_stand = self.th_walk = gaunt_perch1; + self.th_run = self.th_missile = gaunt_wakeup; + } + //---------------------------------------------------------------------- + // Default gaunt setup + else { + self.th_stand = gaunt_idle1; + self.th_walk = gaunt_walk1; + self.th_run = gaunt_run1; + self.th_missile = gaunt_fire1; + } + + self.classtype = CT_MONGAUNT; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_golem.qc b/QC_other/QC_arcane/mon_golem.qc new file mode 100644 index 00000000..be25e68e --- /dev/null +++ b/QC_other/QC_arcane/mon_golem.qc @@ -0,0 +1,719 @@ +/*============================================================================== +GOLEM (From Ne_Ruins MOD) (Hexen2 Model) +==============================================================================*/ + +// (000) standing still with heavy breathing +$frame wait1 wait2 wait3 wait4 wait5 wait6 wait7 wait8 +$frame wait9 wait10 wait11 wait12 wait13 wait14 wait15 wait16 +$frame wait17 wait18 wait19 wait20 wait21 wait22 + +// (022) Transfer B +$frame tranB1 tranB2 tranB3 tranB4 tranB5 tranB6 tranB7 tranB8 +$frame tranB9 tranB10 tranB11 tranB12 tranB13 + +// (035) statue to walking +$frame birth1 birth2 birth3 birth4 birth5 birth6 birth7 birth8 +$frame birth9 birth10 birth11 birth12 birth13 birth14 birth15 birth16 + +// (051) Really slow walk +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 +$frame walk25 walk26 walk27 walk28 walk29 walk30 walk31 walk32 +$frame walk33 walk34 + +// (085) Running +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 +$frame run17 run18 run19 run20 run21 run22 run23 run24 + +// (109) Right Fist Punch +$frame punch1 punch2 punch3 punch4 punch5 punch6 punch7 punch8 +$frame punch9 punch10 punch11 punch12 punch13 punch14 punch15 punch16 +$frame punch17 punch18 punch19 punch20 punch21 punch22 punch23 punch24 + +// (133) Right Fist Pound ground +$frame pound1 pound2 pound3 pound4 pound5 pound6 pound7 pound8 +$frame pound9 pound10 pound11 pound12 pound13 pound14 pound15 pound16 +$frame pound17 pound18 pound19 pound20 pound21 pound22 pound23 pound24 + +// (157) Death Forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 + +// (179) Magic attack from torso +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 magic13 magic14 magic15 magic16 +$frame magic17 magic18 magic19 magic20 magic21 magic22 magic23 magic24 + +// (203) Stomp Foot on ground +$frame stomp1 stomp2 stomp3 stomp4 stomp5 stomp6 stomp7 stomp8 +$frame stomp9 stomp10 stomp11 stomp12 stomp13 stomp14 stomp15 stomp16 +$frame stomp17 stomp18 stomp19 stomp20 stomp21 stomp22 stomp23 stomp24 + +// (227) Rush forward and knock player away +$frame knock1 knock2 knock3 knock4 knock5 knock6 knock7 knock8 +$frame knock9 knock10 knock11 knock12 knock13 knock14 knock15 knock16 +$frame knock17 knock18 knock19 knock20 knock21 knock22 knock23 knock24 + +//============================================================================ +void() golem_stand1 =[ $wait1, golem_stand2 ] {monster_idle_sound();ai_stand();}; +void() golem_stand2 =[ $wait2, golem_stand3 ] {ai_stand();}; +void() golem_stand3 =[ $wait3, golem_stand4 ] {ai_stand();}; +void() golem_stand4 =[ $wait4, golem_stand5 ] {ai_stand();}; +void() golem_stand5 =[ $wait5, golem_stand6 ] {ai_stand();}; +void() golem_stand6 =[ $wait6, golem_stand7 ] {ai_stand();}; +void() golem_stand7 =[ $wait7, golem_stand8 ] {ai_stand();}; +void() golem_stand8 =[ $wait8, golem_stand9 ] {ai_stand();}; +void() golem_stand9 =[ $wait9, golem_stand10 ] {ai_stand();}; +void() golem_stand10 =[ $wait10, golem_stand11 ] {ai_stand();}; +void() golem_stand11 =[ $wait11, golem_stand12 ] {ai_stand();}; +void() golem_stand12 =[ $wait12, golem_stand13 ] {ai_stand();}; +void() golem_stand13 =[ $wait13, golem_stand14 ] {ai_stand();}; +void() golem_stand14 =[ $wait14, golem_stand15 ] {ai_stand();}; +void() golem_stand15 =[ $wait15, golem_stand16 ] {ai_stand();}; +void() golem_stand16 =[ $wait16, golem_stand17 ] {ai_stand();}; +void() golem_stand17 =[ $wait17, golem_stand18 ] {ai_stand();}; +void() golem_stand18 =[ $wait18, golem_stand19 ] {ai_stand();}; +void() golem_stand19 =[ $wait19, golem_stand20 ] {ai_stand();}; +void() golem_stand20 =[ $wait20, golem_stand21 ] {ai_stand();}; +void() golem_stand21 =[ $wait21, golem_stand1 ] {ai_stand();}; + +//============================================================================ +void() golem_ai_walk = { + if (self.frame == $walk1 || self.frame == $walk17) + { ai_walk(0); monster_footstep(FALSE); } + else if (self.frame == $walk2 || self.frame == $walk18) ai_walk(1); + else ai_walk(2); + self.nextthink = time + 0.05; + if (self.frame == $walk8 || self.frame == $walk25) monster_idle_sound(); +}; + +void() golem_walk1 =[ $walk1, golem_walk2 ] {golem_ai_walk();}; +void() golem_walk2 =[ $walk2, golem_walk3 ] {golem_ai_walk();}; +void() golem_walk3 =[ $walk3, golem_walk4 ] {golem_ai_walk();}; +void() golem_walk4 =[ $walk4, golem_walk5 ] {golem_ai_walk();}; +void() golem_walk5 =[ $walk5, golem_walk6 ] {golem_ai_walk();}; +void() golem_walk6 =[ $walk6, golem_walk7 ] {golem_ai_walk();}; +void() golem_walk7 =[ $walk7, golem_walk8 ] {golem_ai_walk();}; +void() golem_walk8 =[ $walk8, golem_walk9 ] {golem_ai_walk();}; +void() golem_walk9 =[ $walk9, golem_walk10 ] {golem_ai_walk();}; +void() golem_walk10 =[ $walk10, golem_walk11 ] {golem_ai_walk();}; +void() golem_walk11 =[ $walk11, golem_walk12 ] {golem_ai_walk();}; +void() golem_walk12 =[ $walk12, golem_walk13 ] {golem_ai_walk();}; +void() golem_walk13 =[ $walk13, golem_walk14 ] {golem_ai_walk();}; +void() golem_walk14 =[ $walk14, golem_walk15 ] {golem_ai_walk();}; +void() golem_walk15 =[ $walk15, golem_walk16 ] {golem_ai_walk();}; +void() golem_walk16 =[ $walk16, golem_walk17 ] {golem_ai_walk();}; +void() golem_walk17 =[ $walk17, golem_walk18 ] {golem_ai_walk();}; +void() golem_walk18 =[ $walk18, golem_walk19 ] {golem_ai_walk();}; +void() golem_walk19 =[ $walk19, golem_walk20 ] {golem_ai_walk();}; +void() golem_walk20 =[ $walk20, golem_walk21 ] {golem_ai_walk();}; +void() golem_walk21 =[ $walk21, golem_walk22 ] {golem_ai_walk();}; +void() golem_walk22 =[ $walk22, golem_walk23 ] {golem_ai_walk();}; +void() golem_walk23 =[ $walk23, golem_walk24 ] {golem_ai_walk();}; +void() golem_walk24 =[ $walk24, golem_walk25 ] {golem_ai_walk();}; +void() golem_walk25 =[ $walk25, golem_walk26 ] {golem_ai_walk();}; +void() golem_walk26 =[ $walk26, golem_walk27 ] {golem_ai_walk();}; +void() golem_walk27 =[ $walk27, golem_walk28 ] {golem_ai_walk();}; +void() golem_walk28 =[ $walk28, golem_walk29 ] {golem_ai_walk();}; +void() golem_walk29 =[ $walk29, golem_walk30 ] {golem_ai_walk();}; +void() golem_walk30 =[ $walk30, golem_walk31 ] {golem_ai_walk();}; +void() golem_walk31 =[ $walk31, golem_walk32 ] {golem_ai_walk();}; +void() golem_walk32 =[ $walk32, golem_walk33 ] {golem_ai_walk();}; +void() golem_walk33 =[ $walk33, golem_walk34 ] {golem_ai_walk();}; +void() golem_walk34 =[ $walk34, golem_walk1 ] {golem_ai_walk();}; + +//============================================================================ +void() golem_ai_run = { + if (self.frame == $run1 || self.frame == $run13) + { ai_run(0); monster_footstep(FALSE); } + else if (self.frame == $run2 || self.frame == $run14) ai_run(3); + else ai_run(5); + self.nextthink = time + 0.05; + if (self.frame == $run7 || self.frame == $run18) monster_idle_sound(); +}; + +void() golem_run1 =[ $run1, golem_run2 ] {golem_ai_run();}; +void() golem_run2 =[ $run2, golem_run3 ] {golem_ai_run();}; +void() golem_run3 =[ $run3, golem_run4 ] {golem_ai_run();}; +void() golem_run4 =[ $run4, golem_run5 ] {golem_ai_run();}; +void() golem_run5 =[ $run5, golem_run6 ] {golem_ai_run();}; +void() golem_run6 =[ $run6, golem_run7 ] {golem_ai_run();}; +void() golem_run7 =[ $run7, golem_run8 ] {golem_ai_run();}; +void() golem_run8 =[ $run8, golem_run9 ] {golem_ai_run();}; +void() golem_run9 =[ $run9, golem_run10 ] {golem_ai_run();}; +void() golem_run10 =[ $run10, golem_run11 ] {golem_ai_run();}; +void() golem_run11 =[ $run11, golem_run12 ] {golem_ai_run();}; +void() golem_run12 =[ $run12, golem_run13 ] {golem_ai_run();}; +void() golem_run13 =[ $run13, golem_run14 ] {golem_ai_run();}; +void() golem_run14 =[ $run14, golem_run15 ] {golem_ai_run();}; +void() golem_run15 =[ $run15, golem_run16 ] {golem_ai_run();}; +void() golem_run16 =[ $run16, golem_run17 ] {golem_ai_run();}; +void() golem_run17 =[ $run17, golem_run18 ] {golem_ai_run();}; +void() golem_run18 =[ $run18, golem_run19 ] {golem_ai_run();}; +void() golem_run19 =[ $run19, golem_run20 ] {golem_ai_run();}; +void() golem_run20 =[ $run20, golem_run21 ] {golem_ai_run();}; +void() golem_run21 =[ $run21, golem_run22 ] {golem_ai_run();}; +void() golem_run22 =[ $run22, golem_run23 ] {golem_ai_run();}; +void() golem_run23 =[ $run23, golem_run1 ] {golem_ai_run();}; + +//============================================================================ +// MELEE - Punch or Pound the ground with fist +//============================================================================ +void(float dist) golem_mcharge = { ai_charge(dist);self.nextthink = time + 0.05;}; + +//---------------------------------------------------------------------- +void() golem_punch1 = [ $punch1, golem_punch2 ] {golem_mcharge(5);}; +void() golem_punch2 = [ $punch2, golem_punch3 ] {golem_mcharge(5);}; +void() golem_punch3 = [ $punch3, golem_punch4 ] {golem_mcharge(5);}; +void() golem_punch4 = [ $punch4, golem_punch5 ] {golem_mcharge(5);}; +void() golem_punch5 = [ $punch5, golem_punch6 ] {golem_mcharge(5);}; +void() golem_punch6 = [ $punch6, golem_punch7 ] {golem_mcharge(5);}; +void() golem_punch7 = [ $punch7, golem_punch8 ] {golem_mcharge(5);}; +void() golem_punch8 = [ $punch8, golem_punch9 ] {golem_mcharge(5);}; +void() golem_punch9 = [ $punch9, golem_punch10 ] {golem_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() golem_punch10 = [ $punch10, golem_punch11 ] {golem_mcharge(4);}; +void() golem_punch11 = [ $punch11, golem_punch12 ] {golem_mcharge(3);monster_footstep(FALSE);}; +void() golem_punch12 = [ $punch12, golem_punch13 ] {golem_mcharge(2); + self.meleehitsound = "golem/melee_pound.wav"; + self.meleecontact = TRUE;ai_meleesmash(20); + self.meleecontact = FALSE; +}; +void() golem_punch13 = [ $punch13, golem_punch14 ] {golem_mcharge(1);}; +void() golem_punch14 = [ $punch14, golem_punch15 ] {golem_mcharge(1);}; +void() golem_punch15 = [ $punch15, golem_punch16 ] {golem_mcharge(1);}; +void() golem_punch16 = [ $punch16, golem_punch17 ] {golem_mcharge(1);}; +void() golem_punch17 = [ $punch17, golem_punch18 ] {golem_mcharge(2);}; +void() golem_punch18 = [ $punch18, golem_punch19 ] {golem_mcharge(3);}; +void() golem_punch19 = [ $punch19, golem_punch20 ] {golem_mcharge(4);}; +void() golem_punch20 = [ $punch20, golem_punch21 ] {golem_mcharge(5);}; +void() golem_punch21 = [ $punch21, golem_punch22 ] {golem_mcharge(5);}; +void() golem_punch22 = [ $punch22, golem_punch23 ] {golem_mcharge(5);}; +void() golem_punch23 = [ $punch23, golem_punch24 ] {golem_mcharge(5);}; +void() golem_punch24 = [ $punch24, golem_run1 ] {golem_mcharge(5);monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() golem_pound1 = [ $pound1, golem_pound2 ] {golem_mcharge(5);}; +void() golem_pound2 = [ $pound2, golem_pound3 ] {golem_mcharge(5);}; +void() golem_pound3 = [ $pound3, golem_pound4 ] {golem_mcharge(5);}; +void() golem_pound4 = [ $pound4, golem_pound5 ] {golem_mcharge(5);}; +void() golem_pound5 = [ $pound5, golem_pound6 ] {golem_mcharge(5);}; +void() golem_pound6 = [ $pound6, golem_pound7 ] {golem_mcharge(5);}; +void() golem_pound7 = [ $pound7, golem_pound8 ] {golem_mcharge(5);}; +void() golem_pound8 = [ $pound8, golem_pound9 ] {golem_mcharge(5);}; +void() golem_pound9 = [ $pound9, golem_pound10 ] {golem_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() golem_pound10 = [ $pound10, golem_pound11 ] {golem_mcharge(4);}; +void() golem_pound11 = [ $pound11, golem_pound12 ] {golem_mcharge(3);monster_footstep(FALSE);}; +void() golem_pound12 = [ $pound12, golem_pound13 ] {golem_mcharge(2); + self.meleehitsound = "golem/melee_pound.wav"; + self.meleecontact = TRUE;ai_meleesmash(40); + self.meleecontact = FALSE; +}; +void() golem_pound13 = [ $pound13, golem_pound14 ] {golem_mcharge(1);}; +void() golem_pound14 = [ $pound14, golem_pound15 ] {golem_mcharge(1);}; +void() golem_pound15 = [ $pound15, golem_pound16 ] {golem_mcharge(1);}; +void() golem_pound16 = [ $pound16, golem_pound17 ] {golem_mcharge(1);}; +void() golem_pound17 = [ $pound17, golem_pound18 ] {golem_mcharge(2);}; +void() golem_pound18 = [ $pound18, golem_pound19 ] {golem_mcharge(3);}; +void() golem_pound19 = [ $pound19, golem_pound20 ] {golem_mcharge(4);}; +void() golem_pound20 = [ $pound20, golem_pound21 ] {golem_mcharge(5);}; +void() golem_pound21 = [ $pound21, golem_pound22 ] {golem_mcharge(5);}; +void() golem_pound22 = [ $pound22, golem_pound23 ] {golem_mcharge(5);}; +void() golem_pound23 = [ $pound23, golem_pound24 ] {golem_mcharge(5);}; +void() golem_pound24 = [ $pound24, golem_run1 ] {golem_mcharge(5);monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() golem_knock1 = [ $knock1, golem_knock2 ] {golem_mcharge(5);}; +void() golem_knock2 = [ $knock2, golem_knock3 ] {golem_mcharge(6);}; +void() golem_knock3 = [ $knock3, golem_knock4 ] {golem_mcharge(7);}; +void() golem_knock4 = [ $knock4, golem_knock5 ] {golem_mcharge(8);}; +void() golem_knock5 = [ $knock5, golem_knock6 ] {golem_mcharge(9);}; +void() golem_knock6 = [ $knock7, golem_knock7 ] {golem_mcharge(10);}; +void() golem_knock7 = [ $knock6, golem_knock8 ] {golem_mcharge(9);}; +void() golem_knock8 = [ $knock8, golem_knock9 ] {golem_mcharge(8);}; +void() golem_knock9 = [ $knock9, golem_knock10 ] {golem_mcharge(7);}; +void() golem_knock10 = [ $knock10, golem_knock11 ] {golem_mcharge(6);}; +void() golem_knock11 = [ $knock11, golem_knock12 ] {golem_mcharge(5);monster_footstep(FALSE);}; +void() golem_knock12 = [ $knock12, golem_knock13 ] {golem_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() golem_knock13 = [ $knock13, golem_knock14 ] {golem_mcharge(4);}; +void() golem_knock14 = [ $knock14, golem_knock15 ] {golem_mcharge(3);}; +void() golem_knock15 = [ $knock15, golem_knock16 ] {golem_mcharge(2);}; +void() golem_knock16 = [ $knock16, golem_knock17 ] {golem_mcharge(1); + self.meleehitsound = "golem/melee_punch.wav"; + self.meleecontact = TRUE;ai_meleesmash(30); + // If punch made contact, lift the enemy off ground + if (self.meleecontact == FALSE) { + self.pos1 = self.enemy.origin - self.origin; + self.pos1_z = 0; + self.pos1 = normalize(self.pos1); + self.enemy.velocity = self.enemy.velocity + self.pos1 * 400; + self.enemy.velocity_z = self.enemy.velocity_z + 250; + self.enemy.flags = self.enemy.flags - (self.enemy.flags & FL_ONGROUND); + } + self.meleecontact = FALSE; +}; +void() golem_knock17 = [ $knock17, golem_knock18 ] {golem_mcharge(1);}; +void() golem_knock18 = [ $knock18, golem_knock19 ] {golem_mcharge(2);}; +void() golem_knock19 = [ $knock19, golem_knock20 ] {golem_mcharge(3);}; +void() golem_knock20 = [ $knock20, golem_knock21 ] {golem_mcharge(4);}; +void() golem_knock21 = [ $knock21, golem_knock22 ] {golem_mcharge(5);}; +void() golem_knock22 = [ $knock22, golem_knock23 ] {golem_mcharge(5);}; +void() golem_knock23 = [ $knock23, golem_knock24 ] {golem_mcharge(5);}; +void() golem_knock24 = [ $knock24, golem_run1 ] { + golem_mcharge(5); + // Make sure golem can do range attacks (melee only ver exists) + if (self.enemy.health > 1 && !(self.spawnflags & MON_GOLEM_MELEEONLY)) { + // If the enemy is visible, quickly go for range attack + if (!visblocked_wide(self.enemy, '0 0 34', '0 0 24')) { + SUB_AttackFinished (2 + 2*random()); + self.think = self.th_missile; + } + } +}; + +//---------------------------------------------------------------------- +void() golem_footstomp = {self.nextthink = time + 0.05;}; + +void() golem_stomp1 = [ $stomp1, golem_stomp2 ] {golem_footstomp(); + self.pain_finished = time + self.pain_timeout;}; +void() golem_stomp2 = [ $stomp2, golem_stomp3 ] {golem_footstomp(); + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_IDLE);}; +void() golem_stomp3 = [ $stomp3, golem_stomp4 ] {golem_footstomp();}; +void() golem_stomp4 = [ $stomp4, golem_stomp5 ] {golem_footstomp();}; +void() golem_stomp5 = [ $stomp5, golem_stomp6 ] {golem_footstomp();monster_idle_sound();}; +void() golem_stomp6 = [ $stomp6, golem_stomp7 ] {golem_footstomp();}; +void() golem_stomp7 = [ $stomp7, golem_stomp8 ] {golem_footstomp();}; +void() golem_stomp8 = [ $stomp8, golem_stomp9 ] {golem_footstomp();}; +void() golem_stomp9 = [ $stomp9, golem_stomp10 ] {golem_footstomp();}; +void() golem_stomp10 = [ $stomp10, golem_stomp11 ] {golem_footstomp();}; +void() golem_stomp11 = [ $stomp11, golem_stomp12 ] {golem_footstomp();}; +void() golem_stomp12 = [ $stomp12, golem_stomp13 ] {golem_footstomp();}; +void() golem_stomp13 = [ $stomp13, golem_stomp14 ] { + golem_footstomp(); self.meleehitsound = "golem/groundslam.wav"; + ai_shockwave(MONAI_STOMPIMPACT, MONAI_STOMPDAMAGE, MONAI_STOMPRADIUS, MONAI_STOMPFORWARD, MONAI_STOMPUP); +}; +void() golem_stomp14 = [ $stomp14, golem_stomp15 ] {golem_footstomp();}; +void() golem_stomp15 = [ $stomp15, golem_stomp16 ] {golem_footstomp();}; +void() golem_stomp16 = [ $stomp16, golem_stomp17 ] {golem_footstomp();monster_idle_sound();}; +void() golem_stomp17 = [ $stomp17, golem_stomp18 ] {golem_footstomp();}; +void() golem_stomp18 = [ $stomp18, golem_stomp19 ] {golem_footstomp();}; +void() golem_stomp19 = [ $stomp19, golem_stomp20 ] {golem_footstomp();}; +void() golem_stomp20 = [ $stomp20, golem_stomp21 ] {golem_footstomp();}; +void() golem_stomp21 = [ $stomp21, golem_stomp22 ] {golem_footstomp();}; +void() golem_stomp22 = [ $stomp22, golem_stomp23 ] {golem_footstomp();}; +void() golem_stomp23 = [ $stomp23, golem_stomp24 ] {golem_footstomp();}; +void() golem_stomp24 = [ $stomp24, golem_run1 ] { + golem_footstomp(); monster_footstep(FALSE); + // Double check enemy is still alive? + // Make sure golem can do range attacks (melee only ver exists) + if (self.enemy.health > 1 && !(self.spawnflags & MON_GOLEM_MELEEONLY)) { + // If the enemy is visible, quickly go for range attack + if (!visblocked_wide(self.enemy, '0 0 34', '0 0 24')) { + SUB_AttackFinished (2 + 2*random()); + self.think = self.th_missile; + } + } +}; + + +//---------------------------------------------------------------------- +void() golem_melee = +{ + if (self.enemy.flags & FL_MONSTER) golem_knock1(); + else { + self.meleeattack = random(); + if (self.meleeattack < 0.2) golem_knock1(); + else if (self.meleeattack < 0.6) golem_punch1(); + else golem_pound1(); + } +} + +//============================================================================ +// RANGE - ROCK STORM from Torso +//============================================================================ +void() golem_rockstorm = +{ + local float shotcount, zpart; + local vector org, dir, yrand, zrand; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Make sure facing the right direction + ai_face(); + makevectors(self.angles); + + // Spawn a mist of particles where projectiles came from + org = self.origin + v_forward*20; + zpart = 25 + rint(random()*25); + particle_explode(org, zpart, 2, PARTICLE_BURST_WHITE, PARTICLE_BURST_UPWARD); + + // Randomize quantity each time called + if (random() < 0.5) shotcount = 2; + else shotcount = 3; + + while (shotcount > 0) { + // Randomly spawn projectiles from golems chest + yrand = (crandom()*30)*v_right; + zrand = (crandom()*30)*v_up; + org = self.origin + attack_vector(self.attack_offset) + yrand + zrand; + + // Straight line velocity from source to target + dir = (self.enemy.origin - org) + (v_right*(crandom()*50)); + dir = normalize (dir); + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_GOLEMSPIKE + (skill * SPEED_GOLEMSKILL) + random()*10; + launch_projectile (org, dir, CT_PROJ_GROCK, self.attack_speed); + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +void() golem_magtime = {self.nextthink = time + 0.05;}; + +void() golem_magic1 = [ $magic1, golem_magic2 ] {golem_magtime();ai_face(); + self.pain_finished = time + 1.5; + sound (self, CHAN_WEAPON, "golem/rockstorm.wav", 1, ATTN_NORM); +}; +void() golem_magic2 = [ $magic2, golem_magic3 ] {golem_magtime();}; +void() golem_magic3 = [ $magic3, golem_magic4 ] {golem_magtime();ai_face();}; +void() golem_magic4 = [ $magic4, golem_magic5 ] {golem_magtime();}; +void() golem_magic5 = [ $magic5, golem_magic6 ] {golem_magtime();ai_face();}; +void() golem_magic6 = [ $magic6, golem_magic7 ] {golem_magtime();}; +void() golem_magic7 = [ $magic7, golem_magic8 ] {golem_magtime();ai_face();}; +void() golem_magic8 = [ $magic8, golem_magic9 ] {golem_magtime();}; +void() golem_magic9 = [ $magic9, golem_magic10 ] {golem_magtime();ai_face();}; +void() golem_magic10 = [ $magic10, golem_magic11 ] {golem_magtime();}; +void() golem_magic11 = [ $magic11, golem_magic12 ] {golem_magtime();ai_face();}; +void() golem_magic12 = [ $magic12, golem_magic13 ] {golem_magtime();}; +void() golem_magic13 = [ $magic13, golem_magic14 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic14 = [ $magic14, golem_magic15 ] {golem_magtime();}; +void() golem_magic15 = [ $magic15, golem_magic16 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic16 = [ $magic16, golem_magic17 ] {golem_magtime();}; +void() golem_magic17 = [ $magic17, golem_magic18 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic18 = [ $magic18, golem_magic19 ] {golem_magtime();}; +void() golem_magic19 = [ $magic19, golem_magic20 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic20 = [ $magic20, golem_magic21 ] {golem_magtime();}; +void() golem_magic21 = [ $magic21, golem_magic22 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic22 = [ $magic22, golem_magic23 ] {golem_magtime();}; +void() golem_magic23 = [ $magic23, golem_magic24 ] {golem_magtime();}; +void() golem_magic24 = [ $magic24, golem_run1 ] {golem_magtime();}; + +//============================================================================ +// PAIN +//============================================================================ +// Short & fast pain animation +void() golem_painA1 =[ $birth8, golem_painA2 ] {}; +void() golem_painA2 =[ $birth10, golem_painA3 ] {}; +void() golem_painA3 =[ $birth12, golem_painA4 ] {}; +void() golem_painA4 =[ $birth14, golem_painA5 ] {}; +void() golem_painA5 =[ $birth16, golem_run1 ] {}; + +// Long slow pain animation +void() golem_painB1 =[ $birth8, golem_painB2 ] {}; +void() golem_painB2 =[ $birth9, golem_painB3 ] {}; +void() golem_painB3 =[ $birth10, golem_painB4 ] {}; +void() golem_painB4 =[ $birth11, golem_painB5 ] {}; +void() golem_painB5 =[ $birth12, golem_painB6 ] {}; +void() golem_painB6 =[ $birth13, golem_painB7 ] {}; +void() golem_painB7 =[ $birth14, golem_painB8 ] {}; +void() golem_painB8 =[ $birth15, golem_painB9 ] {}; +void() golem_painB9 =[ $birth16, golem_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) golem_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1) { + if (self.lip < 0.4) golem_painB1(); // Long + else golem_painA1(); // Short + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + self.pain_finished = time + 0.9; + golem_painB1 (); + } + } +}; + +//============================================================================ +void() golem_death1 = [ $death1, golem_death2 ] {}; +void() golem_death2 = [ $death2, golem_death3 ] {}; +void() golem_death3 = [ $death3, golem_death4 ] {ai_forward(1);self.solid = SOLID_NOT;}; +void() golem_death4 = [ $death4, golem_death5 ] {ai_forward(3);}; +void() golem_death5 = [ $death5, golem_death6 ] {ai_forward(3);}; +void() golem_death6 = [ $death6, golem_death7 ] {ai_forward(6);}; +void() golem_death7 = [ $death7, golem_death8 ] {ai_forward(8);monster_footstep(FALSE);}; +void() golem_death8 = [ $death8, golem_death9 ] {ai_forward(6);}; +void() golem_death9 = [ $death9, golem_death10] {}; +void() golem_death10 = [ $death10, golem_death11] {}; +void() golem_death11 = [ $death11, golem_death12] {}; +void() golem_death12 = [ $death12, golem_death13] {}; +void() golem_death13 = [ $death13, golem_death14] {}; +void() golem_death14 = [ $death14, golem_death15] {}; +void() golem_death15 = [ $death15, golem_death16] {ai_forward(2);}; +void() golem_death16 = [ $death16, golem_death17] {ai_forward(2);}; +void() golem_death17 = [ $death17, golem_death18] {ai_forward(2);}; +void() golem_death18 = [ $death18, golem_death19] {ai_forward(2);}; +void() golem_death19 = [ $death19, golem_death20] {ai_forward(2);}; +void() golem_death20 = [ $death20, golem_death21] {ai_forward(2);}; +void() golem_death21 = [ $death21, golem_death22] {ai_forward(2);monster_death_postcheck();}; +void() golem_death22 = [ $death22, golem_death22] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() golem_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Spawn some extra rubble before dying + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 300, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 250); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "golem/death.wav", 1, ATTN_NORM); + golem_death1 (); + } +}; + +//============================================================================ +// Wakeup From Statue form +//============================================================================ +void() golem_birth = { + if (random() < 0.8) SpawnProjectileSmoke(self.origin, 200, 50, 250); + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() golem_wakefinished = +{ + // No longer need statue spawnflag, remove it + if (self.spawnflags & MON_STATUE) + self.spawnflags = self.spawnflags - MON_STATUE; + self.spawnstatue = FALSE; // No longer stationary + + self.th_stand = golem_stand1; // Idling on feet + self.th_walk = golem_walk1; // Walking + self.th_run = golem_run1; // Running + self.th_melee = golem_melee; // Fist attack + // Check for melee + stomp attack only version + if (!(self.spawnflags & MON_GOLEM_MELEEONLY)) + self.th_missile = golem_magic1; + self.th_slide = golem_stomp1; // Floor stomp + self.th_pain = golem_pain; // Stumble and pain + self.th_die = golem_die; // Face meets floor + self.takedamage = DAMAGE_AIM; // Can receive damage + monster_targets(); // Check for targets + golem_birth(); // more rubble +}; + +//---------------------------------------------------------------------- +void() golem_wake1 =[ $birth1, golem_wake2 ] {golem_birth(); + sound (self, CHAN_BODY, "golem/wakestatue.wav", 1, ATTN_NORM);}; +void() golem_wake2 =[ $birth2, golem_wake3 ] {golem_birth();ai_forward(2);}; +void() golem_wake3 =[ $birth3, golem_wake4 ] {golem_birth();ai_forward(3);}; +void() golem_wake4 =[ $birth4, golem_wake5 ] {golem_birth();ai_forward(4);}; +void() golem_wake5 =[ $birth5, golem_wake6 ] {golem_birth();ai_forward(3);}; +void() golem_wake6 =[ $birth6, golem_wake7 ] {golem_birth();ai_forward(3);}; +void() golem_wake7 =[ $birth7, golem_wake8 ] {golem_birth();ai_forward(1);}; +void() golem_wake8 =[ $birth8, golem_wake9 ] {golem_birth();monster_footstep(FALSE);}; +void() golem_wake9 =[ $birth9, golem_wake10 ] {golem_birth();}; +void() golem_wake10 =[ $birth10, golem_wake11 ] {golem_birth();}; +void() golem_wake11 =[ $birth11, golem_wake12 ] {golem_birth();monster_idle_sound();}; +void() golem_wake12 =[ $birth12, golem_wake13 ] {golem_birth();}; +void() golem_wake13 =[ $birth13, golem_wake14 ] {golem_birth();}; +void() golem_wake14 =[ $birth14, golem_wake15 ] {golem_birth();}; +void() golem_wake15 =[ $birth15, golem_wake16 ] {golem_birth();}; +void() golem_wake16 =[ $birth16, golem_tranB1 ] {golem_birth();}; + +void() golem_tranB1 = [ $tranB1, golem_tranB2 ] {golem_birth();ai_forward(5);}; +void() golem_tranB2 = [ $tranB2, golem_tranB3 ] {golem_birth();ai_forward(5);}; +void() golem_tranB3 = [ $tranB3, golem_tranB4 ] {golem_birth();ai_forward(5);monster_idle_sound();}; +void() golem_tranB4 = [ $tranB4, golem_tranB5 ] {golem_birth();ai_forward(5);}; +void() golem_tranB5 = [ $tranB5, golem_tranB6 ] {golem_birth();ai_forward(5);}; +void() golem_tranB6 = [ $tranB6, golem_tranB7 ] {golem_birth();ai_forward(5);}; +void() golem_tranB7 = [ $tranB7, golem_tranB8 ] {golem_birth();ai_forward(5);monster_idle_sound();}; +void() golem_tranB8 = [ $tranB8, golem_tranB9 ] {golem_birth();ai_forward(5);}; +void() golem_tranB9 = [ $tranB9, golem_tranB10 ] {golem_birth();ai_forward(5);}; +void() golem_tranB10 = [ $tranB10, golem_tranB11 ] {golem_birth();ai_forward(5);}; +void() golem_tranB11 = [ $tranB11, golem_tranB12 ] {golem_birth();ai_forward(5);}; +void() golem_tranB12 = [ $tranB12, golem_tranB13 ] {golem_birth();ai_forward(5);}; +void() golem_tranB13 = [ $tranB13, golem_run14 ] {golem_wakefinished(); monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() golem_wakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + + // Only call wakeup function once + self.use = SUB_Null; + self.th_stand = self.th_walk = self.th_run = SUB_Null; + self.skin = 0; // Glowing eyes! + golem_wake1(); +}; + +//---------------------------------------------------------------------- +void() golem_statue = +{ + local float targ_angle, new_frame; + + // Check for sudden death! + if (self.health < 0) return; + + if (random() < MON_IDLE_SOUND && self.pos1_z > 1) { + new_frame = TRUE; + self.oldenemy = checkclient(); + if (self.oldenemy.flags & FL_CLIENT) { + targ_angle = viewangle(self.origin, self.oldenemy.origin, 0, TRUE, self.oldenemy.v_angle_y); + if (targ_angle < 135 || targ_angle > 225) new_frame = FALSE; + } + self.lip = self.pos1_x + rint(random()*self.pos1_z); + if (new_frame) { + sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + self.frame = self.lip; + } + } + + self.think = golem_statue; + self.nextthink = time + 5 + random()*5; +}; + +/*====================================================================== +QUAKED monster_golem (1 0.2 0) (-16 -16 -24) (16 16 24) +======================================================================*/ +void() monster_golem = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_golem.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_RINGSHOCK); + precache_model (MODEL_PROJ_GROCK1); + precache_model (MODEL_PROJ_GROCK2); + + self.gibtype = GIBTYPE_STONE; // Stoney gibs! + self.gib1mdl = MODEL_PROJ_GROCK1; // small golem rock + self.gib2mdl = MODEL_PROJ_GROCK2; // medium golem rock + self.gib1frame = self.gib2frame = 9; + + // Idle1a-1b (long sound) idle2a-2b (short sound) + self.idle_sound = "golem/idle1a.wav"; + self.idle_sound2 = "golem/idle1b.wav"; + self.idle_soundcom = "golem/idle2a.wav"; + self.idle_soundcom2 = "golem/idle2b.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + // Break free of statue pose + precache_sound ("golem/wakestatue.wav"); + + // Several melee smack sounds and giant ground slam + precache_sound ("golem/melee_swipe.wav"); + precache_sound ("golem/melee_punch.wav"); + precache_sound ("golem/melee_pound.wav"); + precache_sound ("golem/groundslam.wav"); + + // Rockstorm - range attack + precache_sound ("golem/rockstorm.wav"); + precache_sound (SOUND_IMP_ROCK1); + precache_sound (SOUND_IMP_ROCK2); + precache_sound (SOUND_IMP_ROCK3); + precache_sound (SOUND_IMP_ROCK4); + + self.pain_sound = "golem/pain1.wav"; + self.pain_sound2 = "golem/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("golem/death.wav"); + + // Roar! + self.sight_sound = "golem/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GOLEM; + if (self.health < 1) self.health = 500; + self.gibhealth = -60; // Same as shambler + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // Demon level + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // Does not repeat pain + self.infightextra = 3; // Triple damage to other monsters + self.steptype = FS_TYPEGIANT; // Giant sound + self.blockudeath = TRUE; // No humanoid death + self.bleedcolour = 16; // Brown dust/dirt + self.no_liquiddmg = TRUE; // Immune to slime/lava + self.meleerange = MONAI_MELEEGOLEM; + self.attack_offset = '10 0 30'; // Rock storm + self.poisonous = FALSE; // Stone is not poisonous + self.deathstring = " was crushed by a Golem\n"; + + self.th_checkattack = GolemCheckAttack; + self.th_die = golem_die; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0; + self.reflectnails = TRUE; // Reflect nail projectiles + + //---------------------------------------------------------------------- + // Detect statues and setup different parameters + // Tougher skin, less pain, heavy feet etc + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + // statues can change position when the player is not looking + // Specify a start/finish frame using pos1 or use frame + if (!self.pos1_x) { + self.pos1_x = $magic1; // Default pose (wakeup) + self.pos1_y = $magic24; + } + // A frame has been specified, create a small range from that + if (self.frame > 0) { + self.pos1_x = self.pos1_y = self.frame; + } + // Work out range, make sure no negative values + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = self.pos1_x; // Setup frame / pose + + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = golem_statue; // Stone idle sound + self.think1 = golem_wakeup; // Wakeup statue angry at player + self.skin = 1; // Statue skin (+grey, no eyes) + } + else { + self.th_stand = golem_stand1; + self.th_walk = golem_walk1; + self.th_run = golem_run1; + self.th_melee = golem_melee; + // Check for melee + stomp attack only version + if (!(self.spawnflags & MON_GOLEM_MELEEONLY)) + self.th_missile = golem_magic1; + self.th_slide = golem_stomp1; + self.th_pain = golem_pain; + } + + self.classtype = CT_MONGOLEM; + self.classgroup = CG_STONE; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_hknight.qc b/QC_other/QC_arcane/mon_hknight.qc new file mode 100644 index 00000000..fd39f863 --- /dev/null +++ b/QC_other/QC_arcane/mon_hknight.qc @@ -0,0 +1,842 @@ +/*============================================================================== +KNIGHT +==============================================================================*/ +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +// 000-008 +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +// 009-028 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +// 029-036 +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// 037-041 +$frame pain1 pain2 pain3 pain4 pain5 + +// 042-053 +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// 054-062 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +// 063-078 +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +// 079-092 +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +// 093-105 +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// 106-111 +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// 112-121 +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +// 122-132 +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +// 133-154 +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +// 155-165 +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +void() hknight_sword_sound; +void() knight_statue; + +//=========================================================================== +void() hknight_stand1 =[ $stand1, hknight_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();}; +void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();}; +void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();}; +void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();}; +void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();}; +void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();}; +void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();}; +void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();}; + +//=========================================================================== +void() hknight_walk1 =[ $walk1, hknight_walk2 ] {monster_idle_sound(); ai_walk(2);}; +void() hknight_walk2 =[ $walk2, hknight_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);}; +void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);}; +void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);}; +void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);}; +void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);}; +void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);}; +void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);}; +void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);}; +void() hknight_walk11 =[ $walk11, hknight_walk12 ] {monster_footstep(FALSE); ai_walk(3);}; +void() hknight_walk12 =[ $walk12, hknight_walk13 ] {ai_walk(4);}; +void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);}; +void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);}; +void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);}; +void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);}; +void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);}; +void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);}; +void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);}; +void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);}; + +//=========================================================================== +void() CheckForCharge = +{ + // There are 4 conditions to keep charging + // Can see player, no attack timer, similar Z axis and outside melee range + // Nightmare skill level can lock HK in constant charging (no attack timer) + enemy_vis = visible(self.enemy); + if (!enemy_vis) return; + if (time < self.attack_finished) return; + if (self.movespeed < 0) return; + if (self.tetherlock) return; + // Only charge at player if ground height < 20 + if ( fabs(self.origin_z - self.enemy.origin_z) > MONAI_CHARGEZAXIS) return; + if (ai_checkmelee(MONAI_MELEEKNIGHT)) return; + + SUB_AttackFinished (2); + + // Used a pre-defined charge routine (th_charge) so that + // hell and death knights can share the same function + if (self.th_charge) self.th_charge(); + else self.th_run(); +}; + +//---------------------------------------------------------------------- +void() hknight_run1 =[ $run1, hknight_run2 ] {monster_idle_sound(); + ai_run (20); CheckForCharge(); }; +void() hknight_run2 =[ $run2, hknight_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() hknight_run3 =[ $run3, hknight_run4 ] {ai_run(18);}; +void() hknight_run4 =[ $run4, hknight_run5 ] {ai_run(16);}; +void() hknight_run5 =[ $run5, hknight_run6 ] {ai_run(14);}; +void() hknight_run6 =[ $run6, hknight_run7 ] {monster_footstep(FALSE); ai_run(25);}; +void() hknight_run7 =[ $run7, hknight_run8 ] {ai_run(21);}; +void() hknight_run8 =[ $run8, hknight_run1 ] {ai_run(13);}; + +//---------------------------------------------------------------------- +void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] {ai_charge(20);}; +void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {monster_footstep(FALSE); ai_charge(25);}; +void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {ai_charge(18);}; +void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] {ai_charge(16);hknight_sword_sound();}; +void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {ai_charge(14);}; +void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {monster_footstep(FALSE); ai_charge(20); ai_melee();}; +void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {ai_charge(21); ai_melee();}; +void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {ai_charge(13); ai_melee();}; +void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {ai_charge(20); ai_melee();}; +void() hknight_char_a10=[ $char_a10, hknight_char_a11 ] {monster_footstep(FALSE); ai_charge(20); ai_melee();}; +void() hknight_char_a11=[ $char_a11, hknight_char_a12 ] {ai_charge(18); ai_melee();}; +void() hknight_char_a12=[ $char_a12, hknight_char_a13 ] {ai_charge(16);}; +void() hknight_char_a13=[ $char_a13, hknight_char_a14 ] {ai_charge(14);}; +void() hknight_char_a14=[ $char_a14, hknight_char_a15 ] {monster_footstep(FALSE);ai_charge(25);}; +void() hknight_char_a15=[ $char_a15, hknight_char_a16 ] {ai_charge(21);}; +void() hknight_char_a16=[ $char_a16, hknight_run1 ] {ai_charge(13);}; + +//---------------------------------------------------------------------- +// Never used, only called from hknight_char_b +//---------------------------------------------------------------------- +void() CheckContinueCharge = +{ + if (time > self.attack_finished) { + SUB_AttackFinished (3); + self.th_run(); + return; // done charging + } +}; + +void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] +{CheckContinueCharge (); ai_charge(23); ai_melee();}; +void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {hknight_sword_sound(); ai_charge(17); ai_melee();}; +void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {ai_charge(12); ai_melee();}; +void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {monster_footstep(FALSE); ai_charge(22); ai_melee();}; +void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {ai_charge(18); ai_melee();}; +void() hknight_char_b6 =[ $char_b6, hknight_char_b1 ] {ai_charge(8); ai_melee();}; + +//=========================================================================== +void() hknight_slice1 =[ $slice1, hknight_slice2 ] {ai_charge(9);}; +void() hknight_slice2 =[ $slice2, hknight_slice3 ] {ai_charge(6);}; +void() hknight_slice3 =[ $slice3, hknight_slice4 ] {monster_footstep(FALSE); ai_charge(13);}; +void() hknight_slice4 =[ $slice4, hknight_slice5 ] {hknight_sword_sound(); ai_charge(4);}; +void() hknight_slice5 =[ $slice5, hknight_slice6 ] {ai_charge(7); ai_melee();}; +void() hknight_slice6 =[ $slice6, hknight_slice7 ] {ai_charge(15); ai_melee();}; +void() hknight_slice7 =[ $slice7, hknight_slice8 ] {monster_footstep(FALSE); ai_charge(8); ai_melee();}; +void() hknight_slice8 =[ $slice8, hknight_slice9 ] {ai_charge(2); ai_melee();}; +void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();}; +void() hknight_slice10 =[ $slice10, hknight_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +void() hknight_smash1 =[ $smash1, hknight_smash2 ] {ai_charge(1);}; +void() hknight_smash2 =[ $smash2, hknight_smash3 ] {ai_charge(13);}; +void() hknight_smash3 =[ $smash3, hknight_smash4 ] {hknight_sword_sound(); ai_charge(9);}; +void() hknight_smash4 =[ $smash4, hknight_smash5 ] {monster_footstep(FALSE); ai_charge(11);}; +void() hknight_smash5 =[ $smash5, hknight_smash6 ] {ai_charge(10); ai_melee();}; +void() hknight_smash6 =[ $smash6, hknight_smash7 ] {ai_charge(7); ai_melee();}; +void() hknight_smash7 =[ $smash7, hknight_smash8 ] {ai_charge(12); ai_melee();}; +void() hknight_smash8 =[ $smash8, hknight_smash9 ] {ai_charge(2); ai_melee();}; +void() hknight_smash9 =[ $smash9, hknight_smash10 ] {monster_footstep(FALSE); ai_charge(3); ai_melee();}; +void() hknight_smash10 =[ $smash10, hknight_smash11 ] {ai_charge(0);}; +void() hknight_smash11 =[ $smash11, hknight_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {ai_charge(2);}; +void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {ai_charge(0);}; +void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {ai_charge(0);}; +void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {hknight_sword_sound(); ai_melee();}; +void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_melee();}; +void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_melee();}; +void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {ai_charge(1);}; +void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {ai_charge(4);}; +void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {ai_charge(5);}; +void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {ai_charge(3); ai_melee();}; +void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {monster_footstep(FALSE); ai_charge(2); ai_melee();}; +void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {ai_charge(2); ai_melee();}; +void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {ai_charge(0);}; +void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {hknight_sword_sound(); ai_charge(0);}; +void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {ai_charge(0);}; +void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {ai_charge(1);}; +void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {ai_charge(1); ai_melee();}; +void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {ai_charge(3); ai_melee();}; +void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {ai_charge(4); ai_melee();}; +void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {ai_charge(6);}; +void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {ai_charge(7);}; +void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {monster_footstep(FALSE); ai_charge(3);}; + +//============================================================================ +// Cycle between 3 melee attacks +// Attack 1 - Slice (one hand slashing run attack) +// Attack 2 - Smash (chop overhead to ground) +// Attack 3 - W_Attack (two handed slashing attack) + +//---------------------------------------------------------------------- +void() hknight_melee = +{ + self.meleeattack = self.meleeattack + 1; + + if (self.meleeattack == 1) hknight_slice1 (); + else if (self.meleeattack == 2) hknight_smash1 (); + else { + hknight_watk1 (); + self.meleeattack = 0; + } +}; + +//============================================================================ +void(float offset) hknight_shot = +{ + local vector offang; + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + self.attack_speed = SPEED_HKSPIKE + ( skill * SPEED_HKSKILL); + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 6; + makevectors (offang); + + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; + + launch_projectile (org, dir, CT_PROJ_HKN, self.attack_speed); +}; +//---------------------------------------------------------------------- +// Magic attack A (over head attack) - not used +void() hknight_magica1 =[ $magica1, hknight_magica2 ] {ai_face();}; +void() hknight_magica2 =[ $magica2, hknight_magica3 ] {ai_face();}; +void() hknight_magica3 =[ $magica3, hknight_magica4 ] {ai_face();}; +void() hknight_magica4 =[ $magica4, hknight_magica5 ] {ai_face();}; +void() hknight_magica5 =[ $magica5, hknight_magica6 ] {ai_face();}; +void() hknight_magica6 =[ $magica6, hknight_magica7 ] {ai_face();}; +void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);}; +void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);}; +void() hknight_magica9 =[ $magica9, hknight_magica10] {hknight_shot(0);}; +void() hknight_magica10 =[ $magica10, hknight_magica11] {hknight_shot(1);}; +void() hknight_magica11 =[ $magica11, hknight_magica12] {hknight_shot(2);}; +void() hknight_magica12 =[ $magica12, hknight_magica13] {hknight_shot(3);}; +void() hknight_magica13 =[ $magica13, hknight_magica14] {ai_face();}; +void() hknight_magica14 =[ $magica14, hknight_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +// Magic attack B (pointing sword) - not used +void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {ai_face();}; +void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {ai_face();}; +void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {ai_face();}; +void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {ai_face();}; +void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {ai_face();}; +void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {ai_face();}; +void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);}; +void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);}; +void() hknight_magicb9 =[ $magicb9, hknight_magicb10] {hknight_shot(0);}; +void() hknight_magicb10 =[ $magicb10, hknight_magicb11] {hknight_shot(1);}; +void() hknight_magicb11 =[ $magicb11, hknight_magicb12] {hknight_shot(2);}; +void() hknight_magicb12 =[ $magicb12, hknight_magicb13] {hknight_shot(3);}; +void() hknight_magicb13 =[ $magicb13, hknight_run1] {ai_face();}; + +//---------------------------------------------------------------------- +// Magic attack C (swing sword in arc) +void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {ai_face();}; +void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {ai_face();}; +void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {ai_face();}; +void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {ai_face();}; +void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {ai_face();}; +void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2);}; +void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1);}; +void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0);}; +void() hknight_magicc9 =[ $magicc9, hknight_magicc10] {hknight_shot(1);}; +void() hknight_magicc10 =[ $magicc10, hknight_magicc11] {hknight_shot(2);}; +void() hknight_magicc11 =[ $magicc11, hknight_run1] {hknight_shot(3);}; + +//============================================================================ +// Special setup - Hell Knight firing electricity at target +//---------------------------------------------------------------------- +void() hknight_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = self.weaponglow; + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + } +}; + +//---------------------------------------------------------------------- +void() hknight_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//---------------------------------------------------------------------- +void() hknight_pointfire = +{ + local vector hkp_start, hkp_rand, hkp_end; + + // Make sure the knight is alive + if (self.health < 1) return; + + // Time for a new LG hit sound? + if (self.t_width < time) { + // Lower volume and attenuation just in case of several together + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 0.75, ATTN_IDLE); + self.t_width = time + 0.6; + } + + // Update animation frames (default = MagicB6-11) + self.frame = self.frame + self.pos3_z; + if (self.frame < self.pos3_x) self.frame = self.pos3_y; + if (self.frame > self.pos3_y) self.frame = self.pos3_x; + + // Turn the Knight towards lightning target + self.ideal_yaw = vectoyaw(self.movetarget.origin - self.origin); + ChangeYaw (); + // Work out start point of lightning bolt + makevectors(self.angles); + + // Work out starting point for lightning on sword + hkp_start = v_forward*self.pos1_x + v_right*self.pos1_y + v_up*self.pos1_z; + hkp_rand = v_forward * (self.pos2_x * random()); + hkp_rand = hkp_rand + v_right * (self.pos2_y * random()); + hkp_rand = hkp_rand + v_up * (self.pos2_z * random()); + hkp_start = hkp_start + self.origin + hkp_rand; + + // Check for any random target origin variance + if (self.t_length > 0) { + hkp_end = vecrand(0,self.t_length,1); + hkp_end = hkp_end + self.movetarget.origin; + } + // Default (0) = exact target position + else hkp_end = self.movetarget.origin; + + // Update sword with lightning visuals + if (self.attachment) { + setorigin(self.attachment, self.origin); + self.attachment.frame = self.frame; + self.attachment.angles = self.angles; + // Allow for no sword effect by going over max and reset + self.attachment.alpha = self.attachment.alpha + random(); + if (self.attachment.alpha > 1) self.attachment.alpha = 0.01; + // The four skins are randomly setup already + self.lip = self.attachment.skin + 1; + if (self.lip > 3) self.lip = 0; + self.attachment.skin = self.lip; + // Draw paticles on sword where lightning starts + particle_explode(hkp_start, 2, 1, PARTICLE_BURST_BLUE, PARTICLE_BURST_LOSTUP); + } + + // Create lightning bolt + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, hkp_start_x); + WriteCoord (MSG_BROADCAST, hkp_start_y); + WriteCoord (MSG_BROADCAST, hkp_start_z); + WriteCoord (MSG_BROADCAST, hkp_end_x); + WriteCoord (MSG_BROADCAST, hkp_end_y); + WriteCoord (MSG_BROADCAST, hkp_end_z); + + // Can the lightning damage things? + if (self.dmg > 0) + LightningDamage (hkp_start, hkp_end, self, self.dmg); + + // Keep Looping + self.think = self.th_run; + self.nextthink = time + 0.1; + +}; + +//---------------------------------------------------------------------- +void() hknight_pointsetup = +{ + // Find Lightning bolt target + self.movetarget = find(world, targetname, self.target); + if (!self.movetarget) { + dprint("\b[HKNIGHT]\b Pointing knight invalid target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // Start pointing lightning sword! + else { + // Save pain threshold and timeout for later + self.finaldest_x = self.pain_flinch; + self.finaldest_y = self.pain_timeout; + // Reset all pain parameters so it always happens + self.pain_flinch = self.pain_timeout = 0; + self.pain_finished = self.pain_ignore = 0; + self.infightextra = self.noinfighting = 0; + // Stop other monsters attacking pointy knights + self.flags = self.flags - (self.flags & FL_MONSTER); + self.enemy = world; + // Create glowing sword and start pointing + hknight_create_attachment(); + self.th_run(); + } +}; + +//============================================================================ +void() hknight_pain1 =[ $pain1, hknight_pain2 ] {}; +void() hknight_pain2 =[ $pain2, hknight_pain3 ] {}; +void() hknight_pain3 =[ $pain3, hknight_pain4 ] {}; +void() hknight_pain4 =[ $pain4, hknight_pain5 ] {}; +void() hknight_pain5 =[ $pain5, hknight_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) hknight_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) hknight_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.5; + self.axhitme = 0; + hknight_pain1 (); + } + } +}; + +//============================================================================ +void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);}; +void() hknight_die2 =[ $death2, hknight_die3 ] {monster_check_gib();ai_forward(8);}; +void() hknight_die3 =[ $death3, hknight_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() hknight_die4 =[ $death4, hknight_die5 ] {}; +void() hknight_die5 =[ $death5, hknight_die6 ] {}; +void() hknight_die6 =[ $death6, hknight_die7 ] {}; +void() hknight_die7 =[ $death7, hknight_die8 ] {}; +void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);}; +void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);}; +void() hknight_die10 =[ $death10, hknight_die11 ] {}; +void() hknight_die11 =[ $death11, hknight_die12 ] {monster_death_postcheck();}; +void() hknight_die12 =[ $death12, hknight_die12 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {}; +void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {monster_check_gib();}; +void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {}; +void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {}; +void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {}; +void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {}; +void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {monster_death_postcheck();}; +void() hknight_dieb9 =[ $deathb9, hknight_dieb9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() hknight_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + // Make sure attachments are removed + hknight_remove_attachment(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) hknight_die1 (); // Forward - standard + else hknight_dieb1 (); // Backward - standard + } +}; + +//============================================================================ +void() hknight_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +//============================================================================ +// Used by stone knights to wakup and attack the player +//---------------------------------------------------------------------- +void() hknight_aistates = +{ + self.th_stand = hknight_stand1; // Idling on feet + self.th_walk = hknight_walk1; // Walking + self.th_run = hknight_run1; // Running + self.th_melee = hknight_melee; // Sword attack + self.th_missile = hknight_magicc1; // Fire spikes + self.th_charge = hknight_char_a1; // Run + melee + self.th_pain = hknight_pain; // Stumble and pain + self.th_die = hknight_die; // Face meets floor +}; + +//---------------------------------------------------------------------- +void() hknight_wakeup = +{ + if (self.health < 0) return; // Check for sudden death! + + self.use = SUB_Null; // no re-trigger + self.takedamage = DAMAGE_AIM; // Can receive damage + self.spawnstatue = FALSE; // No longer stationary + + hknight_aistates(); // Restore AI state functions + monster_targets(); // Check for targets +}; + +//---------------------------------------------------------------------- +// Restore pointy lightning knights to normal hell knights +//---------------------------------------------------------------------- +void() hknight_pointwakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + // Always reset health+max back to default + self.health = self.max_health = self.reset_health; + // Fire any trigger event when breaking pointy pose + if (self.target2 != "") { + trigger_strs(self.target2, self.enemy); + self.target2 = ""; // Trigger once + } + + // Restore pain threshold and timeout + self.pain_flinch = self.finaldest_x; + self.pain_timeout = self.finaldest_y; + self.pain_finished = time + 2; + self.flags = self.flags | FL_MONSTER; + + // Restore the nail resistance if setup to be a statue skin + if (self.spawnflags & MON_STATUE) self.resist_nails = 0.2; + + hknight_remove_attachment(); // Remove glowing sword + hknight_aistates(); // Restore AI state functions + // Check for any enemy target? + if (self.enemy) { + monster_sightsound(); // Sword sounds! + FoundHuntTarget(TRUE); // Setup goals and targets + self.think = self.th_run; // Move to running + } + else self.think = self.th_stand; // Stand around + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Special pain function for pointy lightning knights +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) hknight_pointpain = +{ + self.pain_finished = 0; + if (!(attacker.flags & FL_CLIENT)) return; + self.enemy = attacker; + hknight_pointwakeup(); +}; + +//---------------------------------------------------------------------- +// Special use/trigger function for pointy lightning knights +//---------------------------------------------------------------------- +void() hknight_pointuse = +{ + // Check for enemy/health/player exceptions + if (self.enemy) return; + if (self.health < 1) return; + if (activator.items & IT_INVISIBILITY) return; + if (activator.flags & FL_NOTARGET) return; + + // Trigger once + self.use = SUB_Null; + // Is the trigger the player? + if (activator.flags & FL_CLIENT) self.enemy = activator; + else self.enemy = world; + hknight_pointwakeup(); +}; + +/*====================================================================== + QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_hell_knight = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_hknight.mdl"; // Original ID Knight + extra skins + self.headmdl = "progs/h_hellkn.mdl"; + self.gib1mdl = "progs/w_hknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_HKN); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the + // filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + self.idle_sound = "statue/idle1.wav"; + self.idle_sound2 = "statue/idle2.wav"; + self.idle_soundcom = "statue/comidle.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + self.sight_sound = "statue/sight.wav"; + self.pain_sound = "statue/hurt.wav"; + self.death_sound = "statue/death.wav"; + self.gib1skin = 1; // Stoney sword + precache_stonegibs(); // Cache gib models + self.gibtype = GIBTYPE_STONE; // Stoney gibs! + self.gib2mdl = self.gib3mdl = string_null; + } + else { + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + self.sight_sound = "hknight/sight1.wav"; + self.pain_sound = "hknight/pain1.wav"; + self.death_sound = "hknight/death1.wav"; + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_HKNGRN); + } + } + // precache sight, pain and death (changes on type) + precache_sound (self.sight_sound); + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 250; + self.gibhealth = -40; // Not easy to gib + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 40; // Medium pain threshold + self.pain_timeout = 1.5; // Higher than a knight + self.steptype = FS_TYPEHEAVY; // Heavy player + self.meleeattack = rint(random()*3); // randomize last melee attack + self.th_die = hknight_die; // Face meets floor + self.deathstring = " was slain by a Hell Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + //---------------------------------------------------------------------- + // Special lightning point knight (metal/stone skins) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_POINT_KNIGHT) { + self.weaponglow = "progs/mon_hknight_glow.mdl"; + precache_model (self.weaponglow); // Glowing magical swords + if (self.spawnflags & MON_STATUE) { + self.classgroup = CG_STONE; // Stone hates metal! + self.skin = self.exactskin = 1; // Stone skin + self.pain_flinch = 60; // Higher resistance + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // high pain threshold + self.no_liquiddmg = TRUE; // Immune to slime/lava + } + self.th_stand = hknight_pointsetup; // Find target before shoot + self.th_run = hknight_pointfire; // Keep Looping + self.th_pain = hknight_pointpain; // Release from pointing + self.think1 = hknight_pointuse; // Special trigger event + self.reset_health = self.health; // Save for later + self.health = MEGADEATH; // Should be impossible to kill + if (self.t_length < 0) self.t_length = 5; // Random target factor + if (self.dmg < 0) self.dmg = 5; // Contact damage + + // Setup default pose start pos + random modifier + if (CheckZeroVector(self.pos1)) self.pos1 = '20 0 24'; + if (CheckZeroVector(self.pos2)) self.pos2 = '30 0 2'; + // Setup default animation pose (magicB6 - magicB11) + if (CheckZeroVector(self.pos3)) self.pos3 = '98 103 1'; + } + //---------------------------------------------------------------------- + // Detect statues and setup different parameters + // Tougher skin, less pain, heavy feet etc + //---------------------------------------------------------------------- + else if (self.spawnflags & MON_STATUE) { + self.classgroup = CG_STONE; // Stone hates metal! + self.poisonous = FALSE; // Cannot be poisonous and stone! + self.resist_nails = 0.5; // Tough skin for nails + self.reflectnails = TRUE; // Reflect nail projectiles + self.skin = self.exactskin = 1; // Stone skin + self.pain_flinch = 60; // Higher resistance + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // high pain threshold + self.no_liquiddmg = TRUE; // Immune to slime/lava + self.deathstring = " was smashed by a Stone Hell Knight\n"; + + // Allow knights to start with a stone skin, but not be frozen! + if (self.spawnflags & MON_NOTFROZEN) { + self.spawnflags = self.spawnflags - MON_STATUE; + hknight_aistates(); // setup AI state functions + } + else { + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = knight_statue; // Stone idle sound + self.think1 = hknight_wakeup; // Wakeup function when triggered + + // statues can change position when the player is not looking + // Specify a start/finish frame using pos1 or use frame + if (!self.pos1_x) { + self.pos1_x = $w_attack1; // Default pose (attacking) + self.pos1_y = $w_attack15; + } + // A frame has been specified, create a small range from that + if (self.frame > 0) { + self.pos1_x = self.pos1_y = self.frame; + } + // Work out range, make sure no negative values + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = self.pos1_x; // Setup frame / pose + } + } + else { + // Default Hell knight (like a death knight really) + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.classgroup = CG_DKNIGHT; // Classic tincan! + hknight_aistates(); // setup AI state functions + } + + self.classtype = CT_MONHELLK; + self.classmove = MON_MOVEWALK; + monster_start(); +}; + +//====================================================================== +/*QUAKED monster_hell_pointknight (0.75 0.5 0) (-16 -16 -24) (16 16 40) AMBUSH STATUE x NOSIGHT NOIDLE NOGFX STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/mon_hknight.mdl"); } +Special Electricity Pointing Hell Knight +-------- KEYS -------- +targetname : monster/trigger name +target : target for electricity +target2 : trigger to fire when electricity stopped +pos1 : XYZ offset to start lightning (uses v_forward/v_right/v_up) +pos2 : XYZ random offset to start lightning (uses v_forward/v_right/v_up) +pos3 : Animation lightning frame set (Start/Finish/Direction) +t_length : random wobble to electricity target origin (0=def 5) +dmg : amount of contact damage with electricity (0=def 5) +deathtarget : entity to trigger upon death (useful if target field already in use) +health : Override default health settings +upgrade_ssg : 1 = will only spawn if shotgun upgrade active on server +upgrade_axe : 1 = will only spawn if axe upgrade active on server +upgrade_lg : 1 = will only spawn if lightning gun upgrade active on server +nomonstercount : will not be included in any monster count functionality +no_zaware : All Z Aware projectiles will be disabled +bboxtype : Change bbox 1=Tiny,4=Short,5=Tall,7=Wide,8=Giant,10=Massive +gibondeath : 1 = always explode in a shower of gibs on death +bodyfadeaway : Time (secs) before body/head will fade away (default=0) +-------- SPAWNFLAGS -------- +AMBUSH : the monster will only wake up on seeing the player, not by another monster +STATUE : Stone statue skin +NOSIGHT : No sight sound +NOIDLE : No idle sound +NOGFX : No spawn effect or sound when triggered +STARTOFF : Trigger Spawn +-------- NOTES -------- +Special Electricity Pointing Hell Knight*/ +//====================================================================== +void() monster_hell_pointknight = +{ + // Setup with new special spawnflag (not mapper controlled) + self.spawnflags = self.spawnflags | MON_POINT_KNIGHT; + // remove notfrozen and angry, always start/spawn firing lightning + self.spawnflags = self.spawnflags - (self.spawnflags & MON_NOTFROZEN); + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SPAWN_ANGRY); + + // Override early to prevent unnecesaary cache of assets + self.poisonous = FALSE; // Never poisonous + + // If not target setup then stop! + if (self.target == "") { + dprint("\b[HKNIGHT]\b Pointing knight needs target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // Loop back through existing hell knight function + else monster_hell_knight(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_hogre.qc b/QC_other/QC_arcane/mon_hogre.qc new file mode 100644 index 00000000..ff17e01a --- /dev/null +++ b/QC_other/QC_arcane/mon_hogre.qc @@ -0,0 +1,492 @@ +/*============================================================================== +HUNTER OGRE +==============================================================================*/ +$cd id1/models/hogre_c +$origin 0 0 24 +$base base +$skin base + +// (000) Default stand +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// (008) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// (020) Walking (alternative) +$frame walkB1 walkB2 walkB3 walkB4 walkB5 walkB6 walkB7 walkB8 +$frame walkB9 walkB10 walkB11 walkB12 + +// (032) Running (classic pose) +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// (040) Swing (sideways attack) +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +// (054) Smash (Overarm attack) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +// (068) Thrust (Forward attack) +$frame thrust1 thrust2 thrust3 thrust4 thrust5 thrust6 thrust7 thrust8 +$frame thrust9 thrust10 thrust11 thrust12 thrust13 thrust14 + +// (082) Turret idle (Turret mode) +$frame turidle1 turidle2 turidle3 turidle4 +$frame turidle5 turidle6 turidle7 turidle8 + +// (090) Shoot (GL attack - chainsaw down) +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// (098) Shootpain (turret mode) +$frame turpainA1 turpainA2 turpainA3 turpainA4 turpainA5 + +// (103) Shoot (GL attack - chainsaw up) +$frame shootB1 shootB2 shootB3 shootB4 shootB5 shootB6 shootB7 shootB8 + +// (111) painA - Quick backwards flex +$frame painA1 painA2 painA3 painA4 painA5 + +// (116) painB - Stagger backwards +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 + +// (129) painC - Fall down +$frame painC1 painC2 painC3 painC4 painC5 painC6 painC7 painC8 +$frame painC9 painC10 painC11 painC12 painC13 painC14 painC15 painC16 painC17 + +// (146) TurretWake (Turret mode) +$frame turwake1 turwake2 turwake3 turwake4 + +// (150) TurretRelease (Turret mode) +$frame turrel1 turrel2 turrel3 turrel4 + +// (154) deathSilly (comedy death) +$frame deathS1 deathS2 deathS3 deathS4 deathS5 deathS6 deathS7 deathS8 +$frame deathS9 deathS10 + +// (164) deathA (Forward) +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 + +// (174) deathB (Backward) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 + +void(float soundtype) hogre_sound; + +//====================================================================== +void() hogre_stand1 =[ $stand1, hogre_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hogre_stand2 =[ $stand2, hogre_stand3 ] {ai_stand();}; +void() hogre_stand3 =[ $stand3, hogre_stand4 ] {ai_stand();}; +void() hogre_stand4 =[ $stand4, hogre_stand5 ] {ai_stand();}; +void() hogre_stand5 =[ $stand5, hogre_stand6 ] {ai_stand();}; +void() hogre_stand6 =[ $stand6, hogre_stand7 ] {ai_stand();}; +void() hogre_stand7 =[ $stand7, hogre_stand8 ] {ai_stand();}; +void() hogre_stand8 =[ $stand8, hogre_stand1 ] {ai_stand();}; + +//====================================================================== +void() hogre_walkB1 =[ $walkB1, hogre_walkB2 ] {ai_walk(4);}; +void() hogre_walkB2 =[ $walkB2, hogre_walkB3 ] {ai_walk(6);}; +void() hogre_walkB3 =[ $walkB3, hogre_walkB4 ] {monster_idle_sound(); ai_walk(6);}; +void() hogre_walkB4 =[ $walkB4, hogre_walkB5 ] {ai_walk(4);}; +void() hogre_walkB5 =[ $walkB5, hogre_walkB6 ] {monster_footstep(FALSE); ai_walk(0);}; +void() hogre_walkB6 =[ $walkB6, hogre_walkB7 ] {ai_walk(0);}; +void() hogre_walkB7 =[ $walkB7, hogre_walkB8 ] {ai_walk(6);}; +void() hogre_walkB8 =[ $walkB8, hogre_walkB9 ] {ai_walk(7); hogre_sound(1);}; +void() hogre_walkB9 =[ $walkB9, hogre_walkB10 ] {ai_walk(6);}; +void() hogre_walkB10=[ $walkB10, hogre_walkB11 ] {ai_walk(2);}; +void() hogre_walkB11=[ $walkB11, hogre_walkB12 ] {monster_footstep(FALSE);ai_walk(0);}; +void() hogre_walkB12=[ $walkB12, hogre_walk1 ] {ai_walk(4);}; + +//====================================================================== +void() hogre_walk1 =[ $walk1, hogre_walk2 ] {ai_walk(4);}; +void() hogre_walk2 =[ $walk2, hogre_walk3 ] {ai_walk(4);}; +void() hogre_walk3 =[ $walk3, hogre_walk4 ] {monster_idle_sound(); ai_walk(4);}; +void() hogre_walk4 =[ $walk4, hogre_walk5 ] {ai_walk(4);}; +void() hogre_walk5 =[ $walk5, hogre_walk6 ] {ai_walk(4);}; +void() hogre_walk6 =[ $walk6, hogre_walk7 ] {monster_footstep(FALSE); ai_walk(4);}; +void() hogre_walk7 =[ $walk7, hogre_walk8 ] {ai_walk(4);}; +void() hogre_walk8 =[ $walk8, hogre_walk9 ] {ai_walk(4);}; +void() hogre_walk9 =[ $walk9, hogre_walk10] {ai_walk(4); if (random() < 0.1) hogre_sound(1);}; +void() hogre_walk10 =[ $walk10, hogre_walk11] {ai_walk(4);}; +void() hogre_walk11 =[ $walk11, hogre_walk12] {ai_walk(3);}; +void() hogre_walk12 =[ $walk12, hogre_walk1 ] {monster_footstep(FALSE); + if (random() < 0.05) self.think = hogre_walkB1; // Alternative walk + ai_walk(4);}; + +//====================================================================== +void() hogre_run1 =[ $run1, hogre_run2 ] {monster_idle_sound(); ai_run(8);}; +void() hogre_run2 =[ $run2, hogre_run3 ] {monster_footstep(FALSE); ai_run(13);}; +void() hogre_run3 =[ $run3, hogre_run4 ] {ai_run(13);}; +void() hogre_run4 =[ $run4, hogre_run5 ] {ai_run(13);}; +void() hogre_run5 =[ $run5, hogre_run6 ] {ai_run(8);}; +void() hogre_run6 =[ $run6, hogre_run7 ] {monster_footstep(FALSE); ai_run(16);}; +void() hogre_run7 =[ $run7, hogre_run8 ] {ai_run(18);}; +void() hogre_run8 =[ $run8, hogre_run1 ] {ai_run(13);}; + +/*====================================================================== + chainsaw (use version in mon_ogre.qc) +======================================================================*/ +void() hogre_swing1 =[ $swing1, hogre_swing2 ] {ai_charge(10);hogre_sound(2);}; +void() hogre_swing2 =[ $swing2, hogre_swing3 ] {ai_charge(10);}; +void() hogre_swing3 =[ $swing3, hogre_swing4 ] {ai_charge(6);}; +void() hogre_swing4 =[ $swing4, hogre_swing5 ] {ai_charge(6);}; +void() hogre_swing5 =[ $swing5, hogre_swing6 ] {ai_charge(7); chainsaw(0,1);self.angles_y = self.angles_y + random()*25;}; +void() hogre_swing6 =[ $swing6, hogre_swing7 ] {ai_forward(7); chainsaw(200,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing7 =[ $swing7, hogre_swing8 ] {ai_forward(4); chainsaw(0,1);monster_footstep(FALSE); self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing8 =[ $swing8, hogre_swing9 ] {ai_forward(4); chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing9 =[ $swing9, hogre_swing10 ] {ai_forward(4); chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing10=[ $swing10, hogre_swing11 ] {ai_forward(4); chainsaw(-200,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing11=[ $swing11, hogre_swing12 ] {ai_forward(4); chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing12=[ $swing12, hogre_swing13 ] {ai_face();}; +void() hogre_swing13=[ $swing13, hogre_swing14 ] {ai_face();}; +void() hogre_swing14=[ $swing14, hogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_smash1 =[ $smash1, hogre_smash2 ] {ai_charge(9);hogre_sound(2);}; +void() hogre_smash2 =[ $smash2, hogre_smash3 ] {ai_charge(9);}; +void() hogre_smash3 =[ $smash3, hogre_smash4 ] {monster_footstep(FALSE); ai_charge(9);}; +void() hogre_smash4 =[ $smash4, hogre_smash5 ] {ai_charge(12);}; +void() hogre_smash5 =[ $smash5, hogre_smash6 ] {ai_charge(12);}; +void() hogre_smash6 =[ $smash6, hogre_smash7 ] {ai_charge(5); chainsaw(0,1); monster_footstep(FALSE);}; +void() hogre_smash7 =[ $smash7, hogre_smash8 ] {ai_charge(5); chainsaw(0,1);}; +void() hogre_smash8 =[ $smash8, hogre_smash9 ] {ai_face(); chainsaw(0,1);}; +void() hogre_smash9 =[ $smash9, hogre_smash10 ] {ai_face(); chainsaw(0,1);}; +void() hogre_smash10=[ $smash10, hogre_smash11 ] {ai_face(); chainsaw(0,1);}; +void() hogre_smash11=[ $smash11, hogre_smash12 ] {ai_face(); chainsaw(0,1); +self.nextthink = self.nextthink + random()*0.2;}; // slight variation +void() hogre_smash12=[ $smash12, hogre_smash13 ] {ai_face();}; +void() hogre_smash13=[ $smash13, hogre_smash14 ] {ai_face();}; +void() hogre_smash14=[ $smash14, hogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_thrust1 =[ $thrust1, hogre_thrust2 ] {ai_charge(12);hogre_sound(2);}; +void() hogre_thrust2 =[ $thrust2, hogre_thrust3 ] {ai_charge(12);}; +void() hogre_thrust3 =[ $thrust3, hogre_thrust4 ] {ai_charge(15);}; +void() hogre_thrust4 =[ $thrust4, hogre_thrust5 ] {ai_charge(7);}; +void() hogre_thrust5 =[ $thrust5, hogre_thrust6 ] {ai_charge(14);monster_footstep(FALSE);}; +void() hogre_thrust6 =[ $thrust6, hogre_thrust7 ] {ai_charge(13);chainsaw(0,2);}; +void() hogre_thrust7 =[ $thrust7, hogre_thrust8 ] {ai_charge(15);chainsaw(0,1.75);}; +void() hogre_thrust8 =[ $thrust8, hogre_thrust9 ] {ai_charge(11);chainsaw(0,1.5);}; +void() hogre_thrust9 =[ $thrust9, hogre_thrust10 ] {ai_charge(11);chainsaw(0,1.25);}; +void() hogre_thrust10 =[ $thrust10, hogre_thrust11 ] {ai_face();chainsaw(0,1);}; +void() hogre_thrust11 =[ $thrust11, hogre_thrust12 ] {ai_face();chainsaw(0,1);}; +void() hogre_thrust12 =[ $thrust12, hogre_thrust13 ] {ai_face();}; +void() hogre_thrust13 =[ $thrust13, hogre_thrust14 ] {ai_face();}; +void() hogre_thrust14 =[ $thrust14, hogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_melee = +{ + self.lip = random(); + if (self.lip < 0.2 && skill > SKILL_NORMAL) hogre_thrust1(); + else if (self.lip < 0.4) hogre_smash1(); + else hogre_swing1(); +}; + +/*====================================================================== + OgreFireGrenade (use version in mon_ogre.qc) +======================================================================*/ +void() hogre_shoot1 =[ $shootB1, hogre_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogre_shoot2 =[ $shootB2, hogre_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogre_shoot3 =[ $shootB3, hogre_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogre_shoot4 =[ $shootB4, hogre_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() hogre_shoot5 =[ $shootB5, hogre_shoot6 ] {ai_face();}; +void() hogre_shoot6 =[ $shootB6, hogre_shoot7 ] {ai_face();}; +void() hogre_shoot7 =[ $shootB7, hogre_run1 ] {ai_face();}; + +//====================================================================== +// painA - Quick backwards flex +//---------------------------------------------------------------------- +void() hogre_painA1 =[ $painA1, hogre_painA2 ] {}; +void() hogre_painA2 =[ $painA2, hogre_painA3 ] {}; +void() hogre_painA3 =[ $painA3, hogre_painA4 ] {}; +void() hogre_painA4 =[ $painA4, hogre_painA5 ] {}; +void() hogre_painA5 =[ $painA5, hogre_run1 ] {}; + +//---------------------------------------------------------------------- +// painB - Stagger backwards +//---------------------------------------------------------------------- +void() hogre_painB1 =[ $painB1, hogre_painB2 ] {ai_pain(7);}; +void() hogre_painB2 =[ $painB2, hogre_painB3 ] {ai_pain(5);}; +void() hogre_painB3 =[ $painB3, hogre_painB4 ] {}; +void() hogre_painB4 =[ $painB4, hogre_painB5 ] {monster_footstep(FALSE); }; +void() hogre_painB5 =[ $painB5, hogre_painB6 ] {}; +void() hogre_painB6 =[ $painB6, hogre_painB7 ] {ai_forward(2);}; +void() hogre_painB7 =[ $painB7, hogre_painB8 ] {ai_forward(2);}; +void() hogre_painB8 =[ $painB8, hogre_painB9 ] {ai_forward(2);}; +void() hogre_painB9 =[ $painB9, hogre_painB10 ] {ai_forward(2);}; +void() hogre_painB10 =[ $painB10, hogre_painB11 ] {ai_forward(2);}; +void() hogre_painB11 =[ $painB11, hogre_painB12 ] {ai_forward(2);}; +void() hogre_painB12 =[ $painB12, hogre_painB13 ] {ai_forward(2);}; +void() hogre_painB13 =[ $painB13, hogre_run1 ] {monster_footstep(FALSE); ai_forward(2);}; + +//---------------------------------------------------------------------- +// painC - Fall down +//---------------------------------------------------------------------- +void() hogre_painC1 =[ $painC1, hogre_painC2 ] {ai_pain(5);}; +void() hogre_painC2 =[ $painC2, hogre_painC3 ] {ai_pain(2);}; +void() hogre_painC3 =[ $painC3, hogre_painC4 ] {}; +void() hogre_painC4 =[ $painC4, hogre_painC5 ] {}; +void() hogre_painC5 =[ $painC5, hogre_painC6 ] {hogre_sound(3);}; // Ogre hits floor +void() hogre_painC6 =[ $painC6, hogre_painC7 ] {}; +void() hogre_painC7 =[ $painC7, hogre_painC8 ] {}; +void() hogre_painC8 =[ $painC8, hogre_painC9 ] {}; +void() hogre_painC9 =[ $painC9, hogre_painC10 ] {}; +void() hogre_painC10=[ $painC10, hogre_painC11 ] {monster_footstep(FALSE);}; +void() hogre_painC11=[ $painC11, hogre_painC12 ] {}; +void() hogre_painC12=[ $painC12, hogre_painC13 ] {}; +void() hogre_painC13=[ $painC13, hogre_painC14 ] {monster_footstep(FALSE);ai_forward(3);}; +void() hogre_painC14=[ $painC14, hogre_painC15 ] {ai_forward(4);}; +void() hogre_painC15=[ $painC15, hogre_painC16 ] {ai_forward(4);}; +void() hogre_painC16=[ $painC16, hogre_painC17 ] {ai_forward(5);}; +void() hogre_painC17=[ $painC17, hogre_run1 ] {ai_forward(4);}; + +//====================================================================== +void(entity inflictor, entity attacker, float damage) hogre_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.65) hogre_painA1 (); + else if (self.lip < 0.85) { + self.pain_finished = time + 2; + // Stagger backwards + hogre_painB1 (); + } + else { + self.pain_finished = time + 2; + // Fall on the floor + hogre_painC1 (); + } + } + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.3; + hogre_painC1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.7; + hogre_painB1 (); // Stagger backwards + } + } + } +}; + +//---------------------------------------------------------------------- +// (146 - 155) deathSilly (comedy death) +//---------------------------------------------------------------------- +void() hogre_dieS1 =[ $deathS1, hogre_dieS2 ] {ai_forward(14);}; +void() hogre_dieS2 =[ $deathS2, hogre_dieS3 ] {monster_check_gib();ai_forward(14);}; +void() hogre_dieS3 =[ $deathS3, hogre_dieS4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogre_dieS4 =[ $deathS4, hogre_dieS5 ] {ai_forward(1);}; +void() hogre_dieS5 =[ $deathS5, hogre_dieS6 ] {ai_forward(1);}; +void() hogre_dieS6 =[ $deathS6, hogre_dieS7 ] {ai_forward(1);}; +void() hogre_dieS7 =[ $deathS7, hogre_dieS8 ] {}; +void() hogre_dieS8 =[ $deathS8, hogre_dieS9 ] {hogre_sound(3);}; // Chainsaw hits floor +void() hogre_dieS9 =[ $deathS9, hogre_dieS10] {monster_death_postcheck();}; +void() hogre_dieS10=[ $deathS10, hogre_dieS10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +// (156 - 165) deathA (Forward) +//---------------------------------------------------------------------- +void() hogre_dieA1 =[ $deathA1, hogre_dieA2 ] {ai_forward(14);}; +void() hogre_dieA2 =[ $deathA2, hogre_dieA3 ] {monster_check_gib();ai_forward(14);}; +void() hogre_dieA3 =[ $deathA3, hogre_dieA4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogre_dieA4 =[ $deathA4, hogre_dieA5 ] {ai_forward(1);}; +void() hogre_dieA5 =[ $deathA5, hogre_dieA6 ] {ai_forward(1);}; +void() hogre_dieA6 =[ $deathA6, hogre_dieA7 ] {ai_forward(1);}; +void() hogre_dieA7 =[ $deathA7, hogre_dieA8 ] {}; +void() hogre_dieA8 =[ $deathA8, hogre_dieA9 ] {hogre_sound(3);}; // Chainsaw hits floor +void() hogre_dieA9 =[ $deathA9, hogre_dieA10] {monster_death_postcheck();}; +void() hogre_dieA10=[ $deathA10, hogre_dieA10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +// (166 - 179) deathB (Backward) +//---------------------------------------------------------------------- +void() hogre_dieB1 =[ $deathB1, hogre_dieB2 ] {ai_back(4);}; +void() hogre_dieB2 =[ $deathB2, hogre_dieB3 ] {monster_check_gib();ai_back(10);}; +void() hogre_dieB3 =[ $deathB3, hogre_dieB4 ] {monster_check_gib();ai_back(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogre_dieB4 =[ $deathB4, hogre_dieB5 ] {ai_back(1);}; +void() hogre_dieB5 =[ $deathB5, hogre_dieB6 ] {}; +void() hogre_dieB6 =[ $deathB6, hogre_dieB7 ] {}; +void() hogre_dieB7 =[ $deathB7, hogre_dieB8 ] {ai_back(1);}; +void() hogre_dieB8 =[ $deathB8, hogre_dieB9 ] {ai_back(1);}; +void() hogre_dieB9 =[ $deathB9, hogre_dieB10] {hogre_sound(3);}; // Chainsaw +void() hogre_dieB10=[ $deathB10, hogre_dieB11] {}; +void() hogre_dieB11=[ $deathB11, hogre_dieB12] {}; +void() hogre_dieB12=[ $deathB12, hogre_dieB13] {}; +void() hogre_dieB13=[ $deathB13, hogre_dieB14] {monster_death_postcheck();}; +void() hogre_dieB14=[ $deathB14, hogre_dieB14] {monster_deadbody_check();}; + +//====================================================================== +void() hogre_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + self.lip = random(); + if (self.lip < 0.05) hogre_dieS1(); + else if (self.lip < 0.5) hogre_dieA1(); + else hogre_dieB1(); + } +}; + +//============================================================================ +void(float soundtype) hogre_sound = +{ + if (soundtype == 1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + else if (soundtype == 2) sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + else if (soundtype == 3) sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + else if (soundtype == 4) sound (self, CHAN_WEAPON, "ogre/ogleap.wav", 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() hogre_wakeup1a =[ $smash7, hogre_wakeup2a ] {monster_sightsound();}; +void() hogre_wakeup2a =[ $smash6, hogre_wakeup3a ] {}; +void() hogre_wakeup3a =[ $smash8, hogre_wakeup4a ] {}; +void() hogre_wakeup4a =[ $smash9, hogre_wakeup5a ] {}; +void() hogre_wakeup5a =[ $smash10, hogre_wakeup6a ] {}; +void() hogre_wakeup6a =[ $smash11, hogre_wakeup7a ] {}; +void() hogre_wakeup7a =[ $smash12, hogre_wakeup8a ] {}; +void() hogre_wakeup8a =[ $smash13, hogre_wakeup9a ] {}; +void() hogre_wakeup9a =[ $smash14, hogre_run1 ] {}; + +void() hogre_wakeup1b =[ $thrust7, hogre_wakeup2b ] {monster_sightsound();}; +void() hogre_wakeup2b =[ $thrust6, hogre_wakeup3b ] {}; +void() hogre_wakeup3b =[ $thrust8, hogre_wakeup4b ] {}; +void() hogre_wakeup4b =[ $thrust9, hogre_wakeup5b ] {}; +void() hogre_wakeup5b =[ $thrust10, hogre_wakeup6b ] {}; +void() hogre_wakeup6b =[ $thrust11, hogre_wakeup7b ] {}; +void() hogre_wakeup7b =[ $thrust12, hogre_wakeup8b ] {}; +void() hogre_wakeup8b =[ $thrust13, hogre_wakeup9b ] {}; +void() hogre_wakeup9b =[ $thrust14, hogre_run1 ] {}; + +void() hogre_wakeup1 = { + if (random() < 0.7) hogre_wakeup1a(); // More over head swing than thrust + else hogre_wakeup1b(); +}; + +/*====================================================================== +/*QUAKED monster_hogre (0.5 0.75 0) (-32 -32 -24) (32 32 64) AMBUSH x METAL NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/mon_hogre.mdl"); } +Ogre, 200 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +METAL : Chain mail metal armour and +100HP +-------- NOTES -------- + +======================================================================*/ +void() monster_hogre = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_hogre.mdl"; // New Ogre Model + self.headmdl = "progs/h_hogre.mdl"; + self.gib1mdl = "progs/w_chainsaw.mdl"; // Chainsaw + self.gib2mdl = "progs/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/w_ogregl.mdl"; // Grenade Launcher + + precache_model ("progs/ogre.mdl"); // Precache for upgrade + precache_model ("progs/h_ogre.mdl"); // Load/Quickload need this + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + // Random chance to switch GL for chainsaw + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + self.gib4mdl = ""; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdrag.wav"); // Chainsaw scrap on floor sound + precache_sound ("ogre/ogdth.wav"); // Death sound + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); // Pain + + precache_sound ("ogre/ogsawatk.wav"); // Attack + precache_sound ("ogre/ogleap.wav"); // Leap Attack + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; + self.pain_longanim = TRUE; + self.steptype = FS_TYPESLOW; + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + self.deathstring = " was blown up by an Ogre Hunter\n"; + + // Standard ogre health 200 with metal+ option + if (self.health < 1) self.health = 200; + if (self.spawnflags & MON_HOGRE_METAL) { + self.health = self.health + MON_HOGRE_METUPG; + self.skin = 1; + } + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GRENADEGRN); + } + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = hogre_stand1; + self.th_walk = hogre_walk1; + self.th_run = hogre_run1; + self.th_die = hogre_die; + self.th_melee = hogre_melee; + self.th_missile = hogre_shoot1; + self.th_pain = hogre_pain; + self.th_wakeup = hogre_wakeup1; + + self.ammo_rockets = 2; + self.classtype = CT_MONHOGRE; // new style hunter ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_hogreham.qc b/QC_other/QC_arcane/mon_hogreham.qc new file mode 100644 index 00000000..8cdaece5 --- /dev/null +++ b/QC_other/QC_arcane/mon_hogreham.qc @@ -0,0 +1,478 @@ +/*============================================================================== +HUNTER OGRE - Hammer Time +==============================================================================*/ +$cd id1/models/hogre_ham +$origin 0 0 24 +$base base +$skin base + +// Default stand +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// Running (classic pose) +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// Swing (sideways attack) +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +// Smash (Overarm attack) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +// Thrust (Forward attack) +$frame slam1 slam2 slam3 slam4 slam5 slam6 slam7 slam8 +$frame slam9 slam10 slam11 slam12 slam13 slam14 slam15 slam16 slam17 + +// turretidle (turret mode) +$frame turidle1 turidle2 turidle3 turidle4 +$frame turidle5 turidle6 turidle7 turidle8 + +// Shoot (GL attack) +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// Shootpain (turret mode) +$frame turpainA1 turpainA2 turpainA3 turpainA4 turpainA5 + +// painA - Quick backwards flex +$frame painA1 painA2 painA3 painA4 painA5 + +// painB - Stagger backwards +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 + +// painC - Fall down +$frame painC1 painC2 painC3 painC4 painC5 painC6 painC7 painC8 +$frame painC9 painC10 painC11 painC12 painC13 painC14 painC15 painC16 painC17 + +// turretWake (turret mode) +$frame turwake1 turwake2 turwake3 turwake4 + +// turretRelease (turret mode) +$frame turrel1 turrel2 turrel3 turrel4 + +// deathA (Forward) +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 + +// deathB (Backward) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 + +void(float soundtype) hogreham_sound; + +//============================================================================ +void() hogreham_stand1 =[ $stand1, hogreham_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hogreham_stand2 =[ $stand2, hogreham_stand3 ] {ai_stand();}; +void() hogreham_stand3 =[ $stand3, hogreham_stand4 ] {ai_stand();}; +void() hogreham_stand4 =[ $stand4, hogreham_stand5 ] {ai_stand();}; +void() hogreham_stand5 =[ $stand5, hogreham_stand6 ] {ai_stand();}; +void() hogreham_stand6 =[ $stand6, hogreham_stand7 ] {ai_stand();}; +void() hogreham_stand7 =[ $stand7, hogreham_stand8 ] {ai_stand();}; +void() hogreham_stand8 =[ $stand8, hogreham_stand1 ] {ai_stand();}; + +//============================================================================ +void() hogreham_walk1 =[ $walk1, hogreham_walk2 ] {ai_walk(4);}; +void() hogreham_walk2 =[ $walk2, hogreham_walk3 ] {ai_walk(4);}; +void() hogreham_walk3 =[ $walk3, hogreham_walk4 ] {monster_idle_sound(); ai_walk(4);}; +void() hogreham_walk4 =[ $walk4, hogreham_walk5 ] {ai_walk(4);}; +void() hogreham_walk5 =[ $walk5, hogreham_walk6 ] {ai_walk(4);}; +void() hogreham_walk6 =[ $walk6, hogreham_walk7 ] {monster_footstep(FALSE); ai_walk(4);}; +void() hogreham_walk7 =[ $walk7, hogreham_walk8 ] {ai_walk(4);}; +void() hogreham_walk8 =[ $walk8, hogreham_walk9 ] {ai_walk(4);}; +void() hogreham_walk9 =[ $walk9, hogreham_walk10 ] {ai_walk(4);}; +void() hogreham_walk10 =[ $walk10, hogreham_walk11 ] {ai_walk(4);}; +void() hogreham_walk11 =[ $walk11, hogreham_walk12 ] {ai_walk(4);}; +void() hogreham_walk12 =[ $walk12, hogreham_walk1 ] {monster_footstep(FALSE);ai_walk(3);}; + +//============================================================================ +void() hogreham_run1 =[ $run1, hogreham_run2 ] {monster_idle_sound(); ai_run(8);}; +void() hogreham_run2 =[ $run2, hogreham_run3 ] {monster_footstep(FALSE); ai_run(13);}; +void() hogreham_run3 =[ $run3, hogreham_run4 ] {ai_run(13);}; +void() hogreham_run4 =[ $run4, hogreham_run5 ] {ai_run(13);}; +void() hogreham_run5 =[ $run5, hogreham_run6 ] {ai_run(8);}; +void() hogreham_run6 =[ $run6, hogreham_run7 ] {monster_footstep(FALSE); ai_run(16);}; +void() hogreham_run7 =[ $run7, hogreham_run8 ] {ai_run(18);}; +void() hogreham_run8 =[ $run8, hogreham_run1 ] {ai_run(13);}; + +//============================================================================ +// ogreham_melee(float melee_attack, float side) - defined in aisubs.qc +//---------------------------------------------------------------------- +void() hogreham_swing1 =[ $swing1, hogreham_swing2 ] {ai_charge(4);}; +void() hogreham_swing2 =[ $swing2, hogreham_swing3 ] {ai_charge(8);hogreham_sound(4);}; +void() hogreham_swing3 =[ $swing3, hogreham_swing4 ] {ai_charge(8);}; +void() hogreham_swing4 =[ $swing4, hogreham_swing5 ] {ai_charge(8);}; +void() hogreham_swing5 =[ $swing5, hogreham_swing6 ] {ai_charge(12);}; +void() hogreham_swing6 =[ $swing6, hogreham_swing7 ] {ai_forward(14); + self.meleehitsound = GIB_SOUND_HEAVY; + self.meleecontact = TRUE;ai_meleesmash(20);self.meleecontact = FALSE; +}; +void() hogreham_swing7 =[ $swing7, hogreham_swing8 ] {ai_forward(7);monster_footstep(FALSE);}; +void() hogreham_swing8 =[ $swing8, hogreham_swing9 ] {ai_forward(3);}; +void() hogreham_swing9 =[ $swing9, hogreham_swing10 ] {ai_forward(3);}; +void() hogreham_swing10 =[ $swing10, hogreham_swing11 ] {ai_forward(3);}; +void() hogreham_swing11 =[ $swing11, hogreham_swing12 ] {ai_forward(3);}; +void() hogreham_swing12 =[ $swing12, hogreham_swing13 ] {ai_face();monster_footstep(FALSE);}; +void() hogreham_swing13 =[ $swing13, hogreham_swing14 ] {ai_face();}; +void() hogreham_swing14 =[ $swing14, hogreham_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogreham_smash1 =[ $smash1, hogreham_smash2 ] {ai_charge(10);}; +void() hogreham_smash2 =[ $smash2, hogreham_smash3 ] {ai_charge(10);hogreham_sound(4);}; +void() hogreham_smash3 =[ $smash3, hogreham_smash4 ] {ai_charge(10);}; +void() hogreham_smash4 =[ $smash4, hogreham_smash5 ] {ai_charge(8);}; +void() hogreham_smash5 =[ $smash5, hogreham_smash6 ] {ai_charge(6);}; +void() hogreham_smash6 =[ $smash6, hogreham_smash7 ] {ai_face();}; +void() hogreham_smash7 =[ $smash7, hogreham_smash8 ] {ai_face();}; +void() hogreham_smash8 =[ $smash8, hogreham_smash9 ] {ai_face();monster_footstep(FALSE);}; +void() hogreham_smash9 =[ $smash9, hogreham_smash10 ] {ai_face();}; +void() hogreham_smash10 =[ $smash10, hogreham_smash11 ] {ai_face(); + self.meleehitsound = GIB_SOUND_HEAVY; + self.meleecontact = TRUE;ai_meleesmash(30);self.meleecontact = FALSE; + makevectors (self.angles); // Put impact infront of ogre + self.finalangle = self.origin + (v_forward * 56) + (-v_up * 22); + particle_explode(self.finalangle, 24, 0.5, PARTICLE_BURST_FIRE, PARTICLE_BURST_SHOCKWAVE); + sound (self, CHAN_WEAPON, "ogre/ham_hit.wav", 1, ATTN_IDLE); +}; +void() hogreham_smash11 =[ $smash11, hogreham_smash12 ] {}; +void() hogreham_smash12 =[ $smash12, hogreham_smash13 ] {}; +void() hogreham_smash13 =[ $smash13, hogreham_smash14 ] {ai_face();}; +void() hogreham_smash14 =[ $smash14, hogreham_run1 ] {ai_face();}; + +/*============================================================================ + Special new ground slam attack - knockback shockwave +============================================================================*/ +//---------------------------------------------------------------------- +// Slow wind up animation (impact frame - 13) so it is easier to spot +// Pain animations are suppressed so that the attack always happens +//---------------------------------------------------------------------- +void() hogreham_slam1 =[ $slam1, hogreham_slam2 ] {ai_charge(2);}; +void() hogreham_slam2 =[ $slam2, hogreham_slam3 ] {ai_charge(2);}; +void() hogreham_slam3 =[ $slam3, hogreham_slam4 ] {ai_charge(2);}; +void() hogreham_slam4 =[ $slam4, hogreham_slam5 ] {ai_charge(2);}; +void() hogreham_slam5 =[ $slam5, hogreham_slam6 ] {ai_charge(3);}; +void() hogreham_slam6 =[ $slam6, hogreham_slam7 ] {ai_charge(3);}; +void() hogreham_slam7 =[ $slam7, hogreham_slam8 ] {ai_face();}; +void() hogreham_slam8 =[ $slam8, hogreham_slam9 ] {ai_face();}; +void() hogreham_slam9 =[ $slam9, hogreham_slam10 ] {ai_charge(6); + // Chance of ogre roar (sightsight) instead of weapon swipe + if (random() < 0.2) sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_IDLE); + else hogreham_sound(4); +}; +void() hogreham_slam10 =[ $slam10, hogreham_slam11 ] {ai_charge(8);}; +void() hogreham_slam11 =[ $slam11, hogreham_slam12 ] {ai_charge(8);}; +void() hogreham_slam12 =[ $slam12, hogreham_slam13 ] {ai_charge(4);}; +void() hogreham_slam13 =[ $slam13, hogreham_slam14 ] { + ai_chargenoturn(4); self.meleehitsound = "ogre/ham_wave.wav"; + ai_shockwave(MONAI_HAMMERIMPACT, MONAI_HAMMERDAMAGE, MONAI_HAMMERRADIUS, MONAI_HAMMERFORWARD, MONAI_HAMMERUP); +}; +void() hogreham_slam14 =[ $slam14, hogreham_slam15 ] {ai_chargenoturn(3);}; +void() hogreham_slam15 =[ $slam15, hogreham_slam16 ] {}; +void() hogreham_slam16 =[ $slam16, hogreham_slam17 ] {}; +void() hogreham_slam17 =[ $slam17, hogreham_run1 ] { + // Double check enemy is still alive? + if (self.enemy.health > 1) { + // If the enemy is visible, quickly fire a grenade at them + if (visxray(self.enemy, self.view_ofs, self.enemy.view_ofs, FALSE)) { + self.attack_state = AS_MISSILE; + self.think = self.th_missile; + } + } +}; + +//---------------------------------------------------------------------- +void() hogreham_melee = +{ + // Hammer ogres don't get interrupted with pain for melee + self.pain_finished = time + 2; + if (self.spawnflags & MON_HOGRE_METAL) hogreham_slam1(); + else { + self.lip = random(); + if (self.lip < 0.5) hogreham_smash1(); + else hogreham_swing1(); + } +}; + +/*============================================================================ + OgreFireGrenade (use version in mon_ogre.qc) +============================================================================*/ +void() hogreham_shoot1 =[ $shoot1, hogreham_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogreham_shoot2 =[ $shoot2, hogreham_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogreham_shoot3 =[ $shoot3, hogreham_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogreham_shoot4 =[ $shoot4, hogreham_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() hogreham_shoot5 =[ $shoot5, hogreham_shoot6 ] {ai_face();}; +void() hogreham_shoot6 =[ $shoot6, hogreham_shoot7 ] {ai_face();}; +void() hogreham_shoot7 =[ $shoot7, hogreham_run1 ] {ai_face();}; + +//============================================================================ +// painA - Quick backwards flex +//---------------------------------------------------------------------- +void() hogreham_painA1 =[ $painA1, hogreham_painA2 ] {}; +void() hogreham_painA2 =[ $painA2, hogreham_painA3 ] {}; +void() hogreham_painA3 =[ $painA3, hogreham_painA4 ] {}; +void() hogreham_painA4 =[ $painA4, hogreham_painA5 ] {}; +void() hogreham_painA5 =[ $painA5, hogreham_run1 ] {}; + +//---------------------------------------------------------------------- +// painB - Stagger backwards +//---------------------------------------------------------------------- +void() hogreham_painB1 =[ $painB1, hogreham_painB2 ] {ai_pain(7);}; +void() hogreham_painB2 =[ $painB2, hogreham_painB3 ] {ai_pain(5);}; +void() hogreham_painB3 =[ $painB3, hogreham_painB4 ] {}; +void() hogreham_painB4 =[ $painB4, hogreham_painB5 ] {monster_footstep(FALSE); }; +void() hogreham_painB5 =[ $painB5, hogreham_painB6 ] {}; +void() hogreham_painB6 =[ $painB6, hogreham_painB7 ] {ai_forward(2);}; +void() hogreham_painB7 =[ $painB7, hogreham_painB8 ] {ai_forward(2);}; +void() hogreham_painB8 =[ $painB8, hogreham_painB9 ] {ai_forward(2);}; +void() hogreham_painB9 =[ $painB9, hogreham_painB10] {ai_forward(2);}; +void() hogreham_painB10=[ $painB10, hogreham_painB11] {ai_forward(2);}; +void() hogreham_painB11=[ $painB11, hogreham_painB12] {ai_forward(2);}; +void() hogreham_painB12=[ $painB12, hogreham_painB13] {ai_forward(2);}; +void() hogreham_painB13=[ $painB13, hogreham_run1 ] {monster_footstep(FALSE); ai_forward(2);}; + +//---------------------------------------------------------------------- +// painC - Fall down +//---------------------------------------------------------------------- +void() hogreham_painC1 =[ $painC1, hogreham_painC2 ] {ai_pain(5);}; +void() hogreham_painC2 =[ $painC2, hogreham_painC3 ] {ai_pain(2);}; +void() hogreham_painC3 =[ $painC3, hogreham_painC4 ] {}; +void() hogreham_painC4 =[ $painC4, hogreham_painC5 ] {}; +void() hogreham_painC5 =[ $painC5, hogreham_painC6 ] {hogreham_sound(3);}; // Ogre hits floor +void() hogreham_painC6 =[ $painC6, hogreham_painC7 ] {}; +void() hogreham_painC7 =[ $painC7, hogreham_painC8 ] {}; +void() hogreham_painC8 =[ $painC8, hogreham_painC9 ] {}; +void() hogreham_painC9 =[ $painC9, hogreham_painC10 ] {}; +void() hogreham_painC10=[ $painC10, hogreham_painC11 ] {monster_footstep(FALSE);}; +void() hogreham_painC11=[ $painC11, hogreham_painC12 ] {}; +void() hogreham_painC12=[ $painC12, hogreham_painC13 ] {}; +void() hogreham_painC13=[ $painC13, hogreham_painC14 ] {monster_footstep(FALSE);ai_forward(3);}; +void() hogreham_painC14=[ $painC14, hogreham_painC15 ] {ai_forward(4);}; +void() hogreham_painC15=[ $painC15, hogreham_painC16 ] {ai_forward(4);}; +void() hogreham_painC16=[ $painC16, hogreham_painC17 ] {ai_forward(5);}; +void() hogreham_painC17=[ $painC17, hogreham_run1 ] {ai_forward(4);}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) hogreham_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.65) hogreham_painA1 (); + else if (self.lip < 0.85) { + self.pain_finished = time + 2; + // Stagger backwards + hogreham_painB1 (); + } + else { + self.pain_finished = time + 2; + // Fall on the floor + hogreham_painC1 (); + } + } + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.3; + hogre_painC1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.7; + hogre_painB1 (); // Stagger backwards + } + } + } +}; + +//============================================================================ +void() hogreham_dieA1 =[ $deathA1, hogreham_dieA2 ] {ai_forward(14);}; +void() hogreham_dieA2 =[ $deathA2, hogreham_dieA3 ] {monster_check_gib();ai_forward(14);}; +void() hogreham_dieA3 =[ $deathA3, hogreham_dieA4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogreham_dieA4 =[ $deathA4, hogreham_dieA5 ] {ai_forward(1);}; +void() hogreham_dieA5 =[ $deathA5, hogreham_dieA6 ] {ai_forward(1);}; +void() hogreham_dieA6 =[ $deathA6, hogreham_dieA7 ] {ai_forward(1);}; +void() hogreham_dieA7 =[ $deathA7, hogreham_dieA8 ] {hogreham_sound(3);}; // Hammer hits floor +void() hogreham_dieA8 =[ $deathA8, hogreham_dieA9 ] {}; +void() hogreham_dieA9 =[ $deathA9, hogreham_dieA10 ] {monster_death_postcheck();}; +void() hogreham_dieA10 =[ $deathA10, hogreham_dieA10 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() hogreham_dieB1 =[ $deathB1, hogreham_dieB2 ] {ai_back(4);}; +void() hogreham_dieB2 =[ $deathB2, hogreham_dieB3 ] {monster_check_gib();ai_back(10);}; +void() hogreham_dieB3 =[ $deathB3, hogreham_dieB4 ] {monster_check_gib();ai_back(3);}; +void() hogreham_dieB4 =[ $deathB4, hogreham_dieB5 ] {ai_back(1); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogreham_dieB5 =[ $deathB5, hogreham_dieB6 ] {}; +void() hogreham_dieB6 =[ $deathB6, hogreham_dieB7 ] {}; +void() hogreham_dieB7 =[ $deathB7, hogreham_dieB8 ] {ai_back(1);}; +void() hogreham_dieB8 =[ $deathB8, hogreham_dieB9 ] {ai_back(1);}; +void() hogreham_dieB9 =[ $deathB9, hogreham_dieB10 ] {hogreham_sound(3);}; // Hammer hits floor +void() hogreham_dieB10 =[ $deathB10, hogreham_dieB11 ] {}; +void() hogreham_dieB11 =[ $deathB11, hogreham_dieB12 ] {}; +void() hogreham_dieB12 =[ $deathB12, hogreham_dieB13 ] {}; +void() hogreham_dieB13 =[ $deathB13, hogreham_dieB14 ] {monster_death_postcheck();}; +void() hogreham_dieB14 =[ $deathB14, hogreham_dieB14 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() hogreham_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + self.lip = random(); + if (self.lip < 0.5) hogreham_dieA1(); + else hogreham_dieB1(); + } +}; + +//============================================================================ +void(float soundtype) hogreham_sound = +{ + if (soundtype == 1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + else if (soundtype == 2) sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + else if (soundtype == 3) sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + else if (soundtype == 4) sound (self, CHAN_VOICE, "ogre/ham_swipe.wav", 1, ATTN_IDLE); +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() hogreham_wakeup1a =[ $smash7, hogreham_wakeup2a ] {monster_sightsound();}; +void() hogreham_wakeup2a =[ $smash6, hogreham_wakeup3a ] {}; +void() hogreham_wakeup3a =[ $smash8, hogreham_wakeup4a ] {}; +void() hogreham_wakeup4a =[ $smash9, hogreham_wakeup5a ] {}; +void() hogreham_wakeup5a =[ $smash10, hogreham_wakeup6a ] {}; +void() hogreham_wakeup6a =[ $smash11, hogreham_wakeup7a ] {}; +void() hogreham_wakeup7a =[ $smash12, hogreham_wakeup8a ] {}; +void() hogreham_wakeup8a =[ $smash13, hogreham_wakeup9a ] {}; +void() hogreham_wakeup9a =[ $smash14, hogreham_run1 ] {}; + +/*====================================================================== +/*QUAKED monster_hogreham (0.5 0.75 0) (-32 -32 -24) (32 32 64) AMBUSH x METAL NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/mon_hogreham.mdl"); } +Ogre, 300 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +METAL : Full plate metal armour and +100HP +-------- NOTES -------- + +======================================================================*/ +void() monster_hogreham = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_hogreham.mdl"; // New Ogre Model + self.headmdl = "progs/h_hogreham.mdl"; // Large head + self.gib1mdl = "progs/w_ogreham.mdl"; // Ogre Hammer (3 skins) + self.gib2mdl = "progs/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (MODEL_PROJ_RINGSHOCK); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + self.gib1sound = GIB_IMPACT_WOOD; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdrag.wav"); // Chainsaw scrap on floor sound + precache_sound ("ogre/ogdth.wav"); // Death sound + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); // Pain + + precache_sound ("ogre/ogsawatk.wav"); // Attack + precache_sound ("ogre/ham_swipe.wav"); // hammer swipe + precache_sound ("ogre/ham_hit.wav"); // hammer hit ground + precache_sound ("ogre/ham_wave.wav"); // hammer shockwave + + self.meleehitsound = GIB_SOUND_HEAVY; + precache_sound (self.meleehitsound); // hammer hit + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + + // Upgraded ogre health 300 with metal+ option + if (self.health < 1) self.health = 300; + if (self.spawnflags & MON_HOGRE_METAL) { + self.health = self.health + MON_HOGRE_METUPG; + // make sure correct skin for hammer + self.gib1skin = 1; + self.skin = 1; + } + else { + // Random chance to switch GL for hammer + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + } + self.gib4mdl = ""; + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GRENADEGRN); + } + + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 100; + self.pain_timeout = 2; // High pain resistance + self.pain_longanim = FALSE; + self.steptype = FS_TYPEHEAVY; + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEBLUNTOGRE; // Hammer range + self.movespeed = 0; // Cannot be turret + self.deathstring = " was pulverized by a Hammer Ogre\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreHamCheckAttack; + self.th_stand = hogreham_stand1; + self.th_walk = hogreham_walk1; + self.th_run = hogreham_run1; + self.th_die = hogreham_die; + self.th_melee = hogreham_melee; + self.th_missile = hogreham_shoot1; + self.th_pain = hogreham_pain; + self.th_wakeup = hogreham_wakeup1a; + + self.ammo_rockets = 4; + self.classtype = CT_MONHOGREHAM; // new style hunter ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_hogremac.qc b/QC_other/QC_arcane/mon_hogremac.qc new file mode 100644 index 00000000..3eb0964b --- /dev/null +++ b/QC_other/QC_arcane/mon_hogremac.qc @@ -0,0 +1,504 @@ +/*============================================================================== +HUNTER OGRE - Mace variant +==============================================================================*/ +$cd id1/models/hogremac_c +$origin 0 0 24 +$base base +$skin base + +// (000) Default stand +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// (008) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// (020) Walking (alternative) +$frame walkB1 walkB2 walkB3 walkB4 walkB5 walkB6 walkB7 walkB8 +$frame walkB9 walkB10 walkB11 walkB12 + +// (032) Running (classic pose) +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// (040) Swing (sideways attack) +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +// (054) Smash (Overarm attack) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +// (082) Leap (swing arm over and leap forward) +//$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 +//$frame leap9 leap10 leap11 leap12 leap13 leap14 leap15 + +// () Turret idle (Turret mode) +$frame turidle1 turidle2 turidle3 turidle4 +$frame turidle5 turidle6 turidle7 turidle8 + +// () Shoot (GL attack - chainsaw down) +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// () Shootpain (turret mode) +$frame turpainA1 turpainA2 turpainA3 turpainA4 turpainA5 + +// () painA - Quick backwards flex +$frame painA1 painA2 painA3 painA4 painA5 + +// () painB - Stagger backwards +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 + +// () painC - Fall down +$frame painC1 painC2 painC3 painC4 painC5 painC6 painC7 painC8 +$frame painC9 painC10 painC11 painC12 painC13 painC14 painC15 painC16 painC17 + +// () turretWake (turret mode) +$frame turwake1 turwake2 turwake3 turwake4 + +// () turretRelease (turret mode) +$frame turrel1 turrel2 turrel3 turrel4 + +// () deathA (Forward) +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 + +// () deathB (Backward) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 + +void(float soundtype) hogremac_sound; + +//====================================================================== +void() hogremac_stand1 =[ $stand1, hogremac_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hogremac_stand2 =[ $stand2, hogremac_stand3 ] {ai_stand();}; +void() hogremac_stand3 =[ $stand3, hogremac_stand4 ] {ai_stand();}; +void() hogremac_stand4 =[ $stand4, hogremac_stand5 ] {ai_stand();}; +void() hogremac_stand5 =[ $stand5, hogremac_stand6 ] {ai_stand();}; +void() hogremac_stand6 =[ $stand6, hogremac_stand7 ] {ai_stand();}; +void() hogremac_stand7 =[ $stand7, hogremac_stand8 ] {ai_stand();}; +void() hogremac_stand8 =[ $stand8, hogremac_stand1 ] {ai_stand();}; + +//====================================================================== +void() hogremac_walkB1 =[ $walkB1, hogremac_walkB2 ] {ai_walk(4);}; +void() hogremac_walkB2 =[ $walkB2, hogremac_walkB3 ] {ai_walk(6);}; +void() hogremac_walkB3 =[ $walkB3, hogremac_walkB4 ] {monster_idle_sound(); ai_walk(6);}; +void() hogremac_walkB4 =[ $walkB4, hogremac_walkB5 ] {ai_walk(4);}; +void() hogremac_walkB5 =[ $walkB5, hogremac_walkB6 ] {monster_footstep(FALSE); ai_walk(0);}; +void() hogremac_walkB6 =[ $walkB6, hogremac_walkB7 ] {ai_walk(0);}; +void() hogremac_walkB7 =[ $walkB7, hogremac_walkB8 ] {ai_walk(6);}; +void() hogremac_walkB8 =[ $walkB8, hogremac_walkB9 ] {ai_walk(7); + if (random() < 0.1) hogremac_sound(1);}; +void() hogremac_walkB9 =[ $walkB9, hogremac_walkB10] {ai_walk(6);}; +void() hogremac_walkB10 =[ $walkB10, hogremac_walkB11] {ai_walk(2);}; +void() hogremac_walkB11 =[ $walkB11, hogremac_walkB12] {monster_footstep(FALSE);ai_walk(0);}; +void() hogremac_walkB12 =[ $walkB12, hogremac_walk1 ] {ai_walk(0);}; + +//====================================================================== +void() hogremac_walk1 =[ $walk1, hogremac_walk2 ] {ai_walk(4);}; +void() hogremac_walk2 =[ $walk2, hogremac_walk3 ] {ai_walk(4);}; +void() hogremac_walk3 =[ $walk3, hogremac_walk4 ] {monster_idle_sound(); ai_walk(4);}; +void() hogremac_walk4 =[ $walk4, hogremac_walk5 ] {ai_walk(4);}; +void() hogremac_walk5 =[ $walk5, hogremac_walk6 ] {ai_walk(4);}; +void() hogremac_walk6 =[ $walk6, hogremac_walk7 ] {monster_footstep(FALSE); ai_walk(4);}; +void() hogremac_walk7 =[ $walk7, hogremac_walk8 ] {ai_walk(4);}; +void() hogremac_walk8 =[ $walk8, hogremac_walk9 ] {ai_walk(4);}; +void() hogremac_walk9 =[ $walk9, hogremac_walk10] {ai_walk(4); + if (random() < 0.1) hogremac_sound(1);}; +void() hogremac_walk10 =[ $walk10, hogremac_walk11] {ai_walk(4);}; +void() hogremac_walk11 =[ $walk11, hogremac_walk12] {ai_walk(3);}; +void() hogremac_walk12 =[ $walk12, hogremac_walk1 ] {monster_footstep(FALSE); + if (random() < 0.05) self.think = hogremac_walkB1; + ai_walk(4);}; + +//====================================================================== +void() hogremac_run1 =[ $run1, hogremac_run2 ] {monster_idle_sound(); ai_run(8);}; +void() hogremac_run2 =[ $run2, hogremac_run3 ] {monster_footstep(FALSE); ai_run(13);}; +void() hogremac_run3 =[ $run3, hogremac_run4 ] {ai_run(13);}; +void() hogremac_run4 =[ $run4, hogremac_run5 ] {ai_run(13);}; +void() hogremac_run5 =[ $run5, hogremac_run6 ] {ai_run(8);}; +void() hogremac_run6 =[ $run6, hogremac_run7 ] {monster_footstep(FALSE); ai_run(16);}; +void() hogremac_run7 =[ $run7, hogremac_run8 ] {ai_run(18);}; +void() hogremac_run8 =[ $run8, hogremac_run1 ] {ai_run(13);}; + +/*====================================================================== + New Mace attack +======================================================================*/ +void() hogremac_swing1 =[ $swing1, hogremac_swing2 ] {ai_charge(10);}; +void() hogremac_swing2 =[ $swing2, hogremac_swing3 ] {ai_charge(10);hogremac_sound(4);}; +void() hogremac_swing3 =[ $swing3, hogremac_swing4 ] {ai_charge(6);}; +void() hogremac_swing4 =[ $swing4, hogremac_swing5 ] {ai_charge(6);}; +void() hogremac_swing5 =[ $swing5, hogremac_swing6 ] {ai_charge(7);}; +void() hogremac_swing6 =[ $swing6, hogremac_swing7 ] {ai_forward(7); + self.meleecontact = TRUE;ai_meleesmash(20);self.meleecontact = FALSE;}; +void() hogremac_swing7 =[ $swing7, hogremac_swing8 ] {ai_forward(4);monster_footstep(FALSE);}; +void() hogremac_swing8 =[ $swing8, hogremac_swing9 ] {ai_forward(4);}; +void() hogremac_swing9 =[ $swing9, hogremac_swing10 ] {ai_forward(4);}; +void() hogremac_swing10=[ $swing10, hogremac_swing11 ] {ai_forward(4);}; +void() hogremac_swing11=[ $swing11, hogremac_swing12 ] {ai_forward(4);}; +void() hogremac_swing12=[ $swing12, hogremac_swing13 ] {ai_face();monster_footstep(FALSE);}; +void() hogremac_swing13=[ $swing13, hogremac_swing14 ] {ai_face();}; +void() hogremac_swing14=[ $swing14, hogremac_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogremac_smash1 =[ $smash1, hogremac_smash2 ] {ai_charge(9);}; +void() hogremac_smash2 =[ $smash2, hogremac_smash3 ] {ai_charge(9);hogreham_sound(1);}; +void() hogremac_smash3 =[ $smash3, hogremac_smash4 ] {ai_charge(9);}; +void() hogremac_smash4 =[ $smash4, hogremac_smash5 ] {ai_charge(12);}; +void() hogremac_smash5 =[ $smash5, hogremac_smash6 ] {ai_charge(12);}; +void() hogremac_smash6 =[ $smash6, hogremac_smash7 ] {ai_charge(5);}; +void() hogremac_smash7 =[ $smash7, hogremac_smash8 ] {ai_charge(5);}; +void() hogremac_smash8 =[ $smash8, hogremac_smash9 ] {ai_face();monster_footstep(FALSE);}; +void() hogremac_smash9 =[ $smash9, hogremac_smash10 ] {ai_face();}; +void() hogremac_smash10=[ $smash10, hogremac_smash11 ] {ai_face(); + self.meleecontact = TRUE;ai_meleesmash(30);self.meleecontact = FALSE; + makevectors (self.angles); // Put impact infront of ogre + self.finalangle = self.origin + (v_forward * 56) + (-v_up * 22); + particle_explode(self.finalangle, 24, 0.5, PARTICLE_BURST_FIRE, PARTICLE_BURST_SHOCKWAVE); + sound (self, CHAN_WEAPON, "ogre/ham_hit.wav", 1, ATTN_IDLE); +}; +void() hogremac_smash11=[ $smash11, hogremac_smash12 ] {}; +void() hogremac_smash12=[ $smash12, hogremac_smash13 ] {}; +void() hogremac_smash13=[ $smash13, hogremac_smash14 ] {ai_face();}; +void() hogremac_smash14=[ $smash14, hogremac_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogremac_melee = +{ + // Mace ogres don't get interrupted with pain for melee + self.pain_finished = time + 2; + self.lip = random(); + if (self.lip < 0.5) hogremac_smash1(); + else hogremac_swing1(); +}; + +/*====================================================================== + Jump forward (leaving ground) and do heavy damage +====================================================================== +void() hogre_leap11; +void() hogre_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(30); // Damage any breakables + + self.touch = SUB_Null; // No more touching + self.think = hogre_leap11; // Exit frame + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() hogre_leap1 =[ $leap1, hogre_leap2 ] {ai_charge(5);hogre_sound(4); + self.jump_flag = time + MONAI_JUMPHOGRETIME; + self.pain_finished = time + 1;}; +void() hogre_leap2 =[ $leap2, hogre_leap3 ] {ai_charge(12);}; +void() hogre_leap3 =[ $leap3, hogre_leap4 ] {ai_charge(12);}; +void() hogre_leap4 =[ $leap4, hogre_leap5 ] {ai_charge(15);}; +void() hogre_leap5 =[ $leap5, hogre_leap6 ] {ai_charge(7);}; +void() hogre_leap6 =[ $leap6, hogre_leap7 ] {ai_charge(14);}; +void() hogre_leap7 =[ $leap7, hogre_leap8 ] {ai_charge(13); + self.touch = hogre_JumpTouch; + makevectors (self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 350 + '0 0 200'; + if (self.flags & FL_ONGROUND) self.flags = self.flags - FL_ONGROUND; +}; +void() hogre_leap8 =[ $leap8, hogre_leap9 ] {ai_face();}; // Inflight frames +void() hogre_leap9 =[ $leap9, hogre_leap10] {ai_face();}; +void() hogre_leap10=[ $leap10,hogre_leap10] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_leap11 =[ $leap11, hogre_leap12 ] {chainsaw(0,2);}; +void() hogre_leap12 =[ $leap12, hogre_leap13 ] {chainsaw(0,1.75);}; +void() hogre_leap13 =[ $leap13, hogre_leap14 ] {chainsaw(0,1.5);}; +void() hogre_leap14 =[ $leap14, hogre_leap15 ] {}; +void() hogre_leap15 =[ $leap15, hogre_run1 ] {}; +*/ + +/*====================================================================== + OgreFireGrenade (use version in mon_ogre.qc) +======================================================================*/ +void() hogremac_shoot1 =[ $shoot1, hogremac_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogremac_shoot2 =[ $shoot2, hogremac_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogremac_shoot3 =[ $shoot3, hogremac_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogremac_shoot4 =[ $shoot4, hogremac_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() hogremac_shoot5 =[ $shoot5, hogremac_shoot6 ] {ai_face();}; +void() hogremac_shoot6 =[ $shoot6, hogremac_shoot7 ] {ai_face();}; +void() hogremac_shoot7 =[ $shoot7, hogremac_run1 ] {ai_face();}; + +//====================================================================== +// painA - Quick backwards flex +//---------------------------------------------------------------------- +void() hogremac_painA1 =[ $painA1, hogremac_painA2 ] {}; +void() hogremac_painA2 =[ $painA2, hogremac_painA3 ] {}; +void() hogremac_painA3 =[ $painA3, hogremac_painA4 ] {}; +void() hogremac_painA4 =[ $painA4, hogremac_painA5 ] {}; +void() hogremac_painA5 =[ $painA5, hogremac_run1 ] {}; + +//---------------------------------------------------------------------- +// painB - Stagger backwards +//---------------------------------------------------------------------- +void() hogremac_painB1 =[ $painB1, hogremac_painB2 ] {ai_pain(7);}; +void() hogremac_painB2 =[ $painB2, hogremac_painB3 ] {ai_pain(5);}; +void() hogremac_painB3 =[ $painB3, hogremac_painB4 ] {}; +void() hogremac_painB4 =[ $painB4, hogremac_painB5 ] {monster_footstep(FALSE); }; +void() hogremac_painB5 =[ $painB5, hogremac_painB6 ] {}; +void() hogremac_painB6 =[ $painB6, hogremac_painB7 ] {ai_forward(2);}; +void() hogremac_painB7 =[ $painB7, hogremac_painB8 ] {ai_forward(2);}; +void() hogremac_painB8 =[ $painB8, hogremac_painB9 ] {ai_forward(2);}; +void() hogremac_painB9 =[ $painB9, hogremac_painB10 ] {ai_forward(2);}; +void() hogremac_painB10=[ $painB10, hogremac_painB11 ] {ai_forward(2);}; +void() hogremac_painB11=[ $painB11, hogremac_painB12 ] {ai_forward(2);}; +void() hogremac_painB12=[ $painB12, hogremac_painB13 ] {ai_forward(2);}; +void() hogremac_painB13=[ $painB13, hogremac_run1 ] {monster_footstep(FALSE); ai_forward(2);}; + +//---------------------------------------------------------------------- +// painC - Fall down +//---------------------------------------------------------------------- +void() hogremac_painC1 =[ $painC1, hogremac_painC2 ] {ai_pain(5);}; +void() hogremac_painC2 =[ $painC2, hogremac_painC3 ] {ai_pain(2);}; +void() hogremac_painC3 =[ $painC3, hogremac_painC4 ] {}; +void() hogremac_painC4 =[ $painC4, hogremac_painC5 ] {}; +void() hogremac_painC5 =[ $painC5, hogremac_painC6 ] {hogremac_sound(3);}; // Ogre hits floor +void() hogremac_painC6 =[ $painC6, hogremac_painC7 ] {}; +void() hogremac_painC7 =[ $painC7, hogremac_painC8 ] {}; +void() hogremac_painC8 =[ $painC8, hogremac_painC9 ] {}; +void() hogremac_painC9 =[ $painC9, hogremac_painC10] {}; +void() hogremac_painC10=[ $painC10, hogremac_painC11] {monster_footstep(FALSE);}; +void() hogremac_painC11=[ $painC11, hogremac_painC12] {}; +void() hogremac_painC12=[ $painC12, hogremac_painC13] {}; +void() hogremac_painC13=[ $painC13, hogremac_painC14] {monster_footstep(FALSE);ai_forward(3);}; +void() hogremac_painC14=[ $painC14, hogremac_painC15] {ai_forward(4);}; +void() hogremac_painC15=[ $painC15, hogremac_painC16] {ai_forward(4);}; +void() hogremac_painC16=[ $painC16, hogremac_painC17] {ai_forward(5);}; +void() hogremac_painC17=[ $painC17, hogremac_run1 ] {ai_forward(4);}; + +//====================================================================== +void(entity inflictor, entity attacker, float damage) hogremac_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.65) hogremac_painA1 (); + else if (self.lip < 0.85) { + self.pain_finished = time + 2; + // Stagger backwards + hogremac_painB1 (); + } + else { + self.pain_finished = time + 2; + // Fall on the floor + hogremac_painC1 (); + } + } + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.3; + hogremac_painC1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.7; + hogremac_painB1 (); // Stagger backwards + } + } + } +}; + +//---------------------------------------------------------------------- +// deathA (Forward) +//---------------------------------------------------------------------- +void() hogremac_dieA1 =[ $deathA1, hogremac_dieA2 ] {ai_forward(14);}; +void() hogremac_dieA2 =[ $deathA2, hogremac_dieA3 ] {monster_check_gib();ai_forward(14);}; +void() hogremac_dieA3 =[ $deathA3, hogremac_dieA4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogremac_dieA4 =[ $deathA4, hogremac_dieA5 ] {ai_forward(1);}; +void() hogremac_dieA5 =[ $deathA5, hogremac_dieA6 ] {ai_forward(1);}; +void() hogremac_dieA6 =[ $deathA6, hogremac_dieA7 ] {ai_forward(1);}; +void() hogremac_dieA7 =[ $deathA7, hogremac_dieA8 ] {}; +void() hogremac_dieA8 =[ $deathA8, hogremac_dieA9 ] {hogremac_sound(3);}; // Chainsaw hits floor +void() hogremac_dieA9 =[ $deathA9, hogremac_dieA10 ] {monster_death_postcheck();}; +void() hogremac_dieA10 =[ $deathA10, hogremac_dieA10 ] {}; + +//---------------------------------------------------------------------- +// deathB (Backward) +//---------------------------------------------------------------------- +void() hogremac_dieB1 =[ $deathB1, hogremac_dieB2 ] {ai_back(4);}; +void() hogremac_dieB2 =[ $deathB2, hogremac_dieB3 ] {monster_check_gib();ai_back(10);}; +void() hogremac_dieB3 =[ $deathB3, hogremac_dieB4 ] {monster_check_gib();ai_back(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogremac_dieB4 =[ $deathB4, hogremac_dieB5 ] {ai_back(1);}; +void() hogremac_dieB5 =[ $deathB5, hogremac_dieB6 ] {}; +void() hogremac_dieB6 =[ $deathB6, hogremac_dieB7 ] {}; +void() hogremac_dieB7 =[ $deathB7, hogremac_dieB8 ] {ai_back(1);}; +void() hogremac_dieB8 =[ $deathB8, hogremac_dieB9 ] {ai_back(1);}; +void() hogremac_dieB9 =[ $deathB9, hogremac_dieB10] {hogremac_sound(3);}; // Chainsaw hits floor +void() hogremac_dieB10=[ $deathB10, hogremac_dieB11] {}; +void() hogremac_dieB11=[ $deathB11, hogremac_dieB12] {}; +void() hogremac_dieB12=[ $deathB12, hogremac_dieB13] {}; +void() hogremac_dieB13=[ $deathB13, hogremac_dieB14] {monster_death_postcheck();}; +void() hogremac_dieB14=[ $deathB14, hogremac_dieB14] {}; + +//====================================================================== +void() hogremac_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + if (self.lip < 0.5) hogremac_dieA1(); + else hogremac_dieB1(); + } +}; + +//============================================================================ +void(float soundtype) hogremac_sound = +{ + if (soundtype == 1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + else if (soundtype == 2) sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + else if (soundtype == 3) sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + else if (soundtype == 4) sound (self, CHAN_VOICE, "ogre/ham_swipe.wav", 1, ATTN_IDLE); +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() hogremac_wakeup1a =[ $smash7, hogremac_wakeup2a ] {monster_sightsound();}; +void() hogremac_wakeup2a =[ $smash6, hogremac_wakeup3a ] {}; +void() hogremac_wakeup3a =[ $smash8, hogremac_wakeup4a ] {}; +void() hogremac_wakeup4a =[ $smash9, hogremac_wakeup5a ] {}; +void() hogremac_wakeup5a =[ $smash10, hogremac_wakeup6a ] {}; +void() hogremac_wakeup6a =[ $smash11, hogremac_wakeup7a ] {}; +void() hogremac_wakeup7a =[ $smash12, hogremac_wakeup8a ] {}; +void() hogremac_wakeup8a =[ $smash13, hogremac_wakeup9a ] {}; +void() hogremac_wakeup9a =[ $smash14, hogremac_run1 ] {}; + +/*====================================================================== +/*QUAKED monster_hogremac (0.5 0.75 0) (-32 -32 -24) (32 32 64) AMBUSH x METAL NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/mon_hogremac.mdl"); } +Ogre, 200 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +METAL : Chain mail metal armour and +100HP +-------- NOTES -------- + +======================================================================*/ +void() monster_hogremac = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_hogremac.mdl"; // New Ogre Model + self.headmdl = "progs/h_hogre.mdl"; // Large Head + self.gib1mdl = "progs/w_ogremac.mdl"; // Heavy Mace + self.gib2mdl = "progs/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + // Random chance to switch GL for mace + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + self.gib4mdl = ""; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdrag.wav"); // Chainsaw scrap on floor sound + precache_sound ("ogre/ogdth.wav"); // Death sound + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); // Pain + + precache_sound ("ogre/ogsawatk.wav"); // Attack + precache_sound ("ogre/ham_swipe.wav"); // mace swipe + precache_sound ("ogre/ham_hit.wav"); // mace hit ground + + self.meleehitsound = GIB_SOUND_HEAVY; + precache_sound (self.meleehitsound); // mace hit + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + + // Standard ogre health 200 with metal+ option + if (self.health < 1) self.health = 200; + if (self.spawnflags & MON_HOGRE_METAL) { + self.health = self.health + MON_HOGRE_METUPG; + self.skin = 1; + } + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GRENADEGRN); + } + + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; + self.pain_longanim = TRUE; + self.steptype = FS_TYPEMEDIUM; + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEBLUNTOGRE; // Blunt mace attack + self.deathstring = " was smashed by a Mace Ogre\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = hogremac_stand1; + self.th_walk = hogremac_walk1; + self.th_run = hogremac_run1; + self.th_die = hogremac_die; + self.th_melee = hogremac_melee; + self.th_missile = hogremac_shoot1; +// self.th_jump = hogre_leap1; + self.th_pain = hogremac_pain; + self.th_wakeup = hogremac_wakeup1a; + + self.ammo_rockets = 2; + self.classtype = CT_MONHOGREMAC; // new style hunter ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_jim.qc b/QC_other/QC_arcane/mon_jim.qc new file mode 100644 index 00000000..c0d4685e --- /dev/null +++ b/QC_other/QC_arcane/mon_jim.qc @@ -0,0 +1,586 @@ +/*============================================================================== +Jim (Heavily inspired by bob from Quoth - Kell/Necros/Preach) +New models, skins and animations, code +==============================================================================*/ +// Slight movement of wings +$frame idle1 idle2 idle3 idle4 idle5 idle6 + +// Twist wings backward and evil eyes +$frame idle7 idle8 idle9 idle10 idle11 idle12 + +// Wobble gun (+/- 5 degrees) and evil eyes +$frame idle13 idle14 idle15 idle16 idle17 idle18 + +// Idle while gun is point left or right +$frame idleleft1 idleleft2 idleleft3 idleleft4 idleleft5 idleleft6 +$frame idleright1 idleright2 idleright3 idleright4 idleright5 idleright6 + +// Idle and turn gun left or right 30 degrees +$frame idleturnl1 idleturnl2 idleturnl3 idleturnl4 idleturnl5 idleturnl6 +$frame idleturnr1 idleturnr2 idleturnr3 idleturnr4 idleturnr5 idleturnr6 + +// Custom wing movements for combat +$frame movedn1 movedn2 movedn3 movedn4 movedn5 movedn6 +$frame moveup1 moveup2 moveup3 moveup4 moveup5 moveup6 + +// Flap wings and get angry eyes +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +// Downward spiral with twisted wings +$frame zdeath1 zdeath2 zdeath3 zdeath4 zdeath5 zdeath6 + +float JS_IDLE = 0; // Default state +float JS_IDLE2 = 1; // Special idle (stationary) +float JS_IDLE3 = 2; // Special idle (stationary) +float JS_IDLELEFT = 3; // Looking left +float JS_IDLERIGHT = 4; // Looking right +float JS_TURNLEFT = 5; // Turning left (not looped) +float JS_TURNRIGHT = 6; // Turning right (not looped) +float JS_DOWN = 7; // Combat move +float JS_UP = 8; // Combat move +float JS_PAIN = 9; // Resets current animation +float JS_DYING = 10; // Final animation + +// Size of each animation block +float JS_ANIMBLOCK = 6; + +//====================================================================== +// Update Jim every frame with skin/sound updates +// fstate (see above for animation block details) +//====================================================================== +void(float fstate) jim_update = +{ + // If jim is dead, no more updates + if (self.health < 1) return; + + // Update ther gun idle (buzzing) sound + if (self.t_width < time) { + self.t_width = time + 0.9; + // Play on auto channel so it overlaps with existing sound + sound (self, CHAN_AUTO, "jim/gunidle2.wav", 0.3, ATTN_WEAPON); + } + + // Time for an idle sound? + if (self.idletimer < time) monster_idle_sound(); + + // Jim has a glowing gun and eye skin feature! + if (self.t_length < time) { + self.t_length = time + 0.2; + self.exactskin = self.exactskin + 1; + if (self.exactskin > 2) self.exactskin = 0; + self.skin = self.exactskin; + } + + // In combat? + if (self.enemy) { + self.idlebusy = FALSE; + if (fstate == JS_IDLE) { + if (self.origin_z > self.oldorigin_z) fstate = JS_UP; + else if (self.origin_z < self.oldorigin_z) fstate = JS_DOWN; + } + } + else { + // At beginning of frame block and reversing? + if (self.count == 0 && self.idlereverse) { + if (self.idlebusy == JS_TURNLEFT || self.idlebusy == JS_TURNRIGHT) { + self.idlebusy = JS_IDLE; + self.idlereverse = FALSE; + self.waitmin = time + 2 + random() * 4; + } + } + // At end of frame block and going forward? + else if (self.count == JS_ANIMBLOCK-1 && !self.idlereverse) { + // Staring forward, doing nothing + if (self.idlebusy == JS_IDLE && self.waitmin < time) { + // Only start idle animations if stationary + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.idletimer < time) monster_idle_sound(); + self.lip = random(); + if (self.lip < 0.3) self.idlebusy = JS_TURNLEFT; + else if (self.lip < 0.6) self.idlebusy = JS_TURNRIGHT; + else if (self.lip < 0.8) self.idlebusy = JS_IDLE2; + else self.idlebusy = JS_IDLE3; + } + } + // Return from wing flex, gun swing idle animations + else if (self.idlebusy == JS_IDLE2 || self.idlebusy == JS_IDLE3) { + self.idlebusy = JS_IDLE; + self.waitmin = time + 2 + random() * 4; + } + // Turning eyes/gun in left direction + else if (self.idlebusy == JS_TURNLEFT) { + self.idlebusy = JS_IDLELEFT; + self.waitmin = time + 2 + random() * 4; + } + // Turning eyes/gun to right direction + else if (self.idlebusy == JS_TURNRIGHT) { + self.idlebusy = JS_IDLERIGHT; + self.waitmin = time + 2 + random() * 4; + } + // Looking left and randomly think about returning + else if (self.idlebusy == JS_IDLELEFT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = JS_TURNLEFT; + self.idlereverse = TRUE; + } + } + // Looking right and randomly think about returning + else if (self.idlebusy == JS_IDLERIGHT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = JS_TURNRIGHT; + self.idlereverse = TRUE; + } + } + } + + // Change the movement type so that jim can easily move up/down + // using velocity, forced origin movement is really jerky! + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.attack_timer < time) { + self.attack_timer = time + 1; + if (self.lip < 1) self.lip = 1; + else self.lip = -1; + self.velocity_z = 2 * self.lip; + } + } + } + + // Check frame direction and update counter + if (self.idlereverse) self.count = self.count - 1; + else self.count = self.count + 1; + if (self.count >= JS_ANIMBLOCK) self.count = 0; + if (self.count < 0) self.count = JS_ANIMBLOCK-1; + + // Busy with an idle animation? + if (self.idlebusy > 0) fstate = self.idlebusy; + // Update frame animation block with frame counter + self.frame = fstate * JS_ANIMBLOCK + self.count; + // Store current origin position + self.oldorigin = self.origin; +}; + +//====================================================================== +// All stand, walk and run functions are condensed down to one entry +// because the robot has a constant skin/sound update that has to +// happen at specific intervals +// +void() jim_stand1 =[ $idle1, jim_stand1 ] { + // Standing idle has gentle bobbing up and down + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_FLY; + jim_update(JS_IDLE); ai_stand(); +}; +void() jim_walk1 =[ $idle1, jim_walk1 ] { + // Movement is steps, not velocity + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + jim_update(JS_IDLE); ai_walk(8); +}; +void() jim_run1 =[ $idle1, jim_run1 ] { + // Movement is steps, only velocity when firing weapon + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + jim_update(JS_IDLE); + ai_run(16); + if (self.movespeed != 0) ai_face(); +}; + +//====================================================================== +// Range (LASERS or ROCKETS) +//====================================================================== +void() jim_laser = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Always make sure there is no monster or obstacle in the way + // Cannot use enemy entity direct, enemytarget will be active + if ( !visxray(SUB_entEnemyTarget(), self.attack_offset, '0 0 12', FALSE) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Aim high to catch jumping players + dir = SUB_orgEnemyTarget() + '0 0 12'; + vec = normalize(dir - org); + // Variable laser speed, original unit was just 800 every skill + self.attack_speed = SPEED_JIMPROJ + (skill * SPEED_JIMPROJSKILL); + launch_projectile(org, vec, CT_PROJ_LASER, self.attack_speed); +}; + +//---------------------------------------------------------------------- +// Straight aim rocket, no pre-calculation or steering (skill based speed) +//---------------------------------------------------------------------- +void() jim_rocket = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Always make sure there is no monster or obstacle in the way + // Cannot use enemy entity direct, enemytarget will be active + if ( !visxray(SUB_entEnemyTarget(), self.attack_offset, '0 0 -12', FALSE) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "jim/rocket_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Aim low to catch players with splash damage + dir = SUB_orgEnemyTarget() - '0 0 12'; + vec = normalize(dir - org); + + // Variable rocket speed, matching laser (very nasty) + self.attack_speed = SPEED_JIMPROJ + (skill * SPEED_JIMPROJSKILL); + Launch_Missile (org, vec, '0 0 0', CT_PROJ_JIM2, self.attack_speed); +}; + +//---------------------------------------------------------------------------- +void(float vspeed) jim_vel = { + // Turn and face enemy and update attack velocity + ai_face(); + if (self.movespeed == 0) + self.velocity = self.attack_track * vspeed; +}; + +//---------------------------------------------------------------------------- +// Calculate new attack vector for firing lasers at the player +//---------------------------------------------------------------------------- +void() jim_attack = +{ + self.solid = SOLID_SLIDEBOX; + if (self.movespeed == 0) self.movetype = MOVETYPE_FLY; + makevectors(self.angles); + // Always fly upwards away from the player + self.pos1 = v_up * (50 + random() * 100); + // Randomly pick a left or right strafe direction + self.pos2 = v_right * (crandom() * 200); + // Always try to back away from the player + self.pos3 = v_forward * (random() * 100); + + // Merge all the randomness together + self.attack_track = self.pos1 + self.pos2 + self.pos3; + // Check nothing is in the way, estimate vector of attack + traceline(self.origin, self.origin+self.attack_track, FALSE, self); +}; + +//---------------------------------------------------------------------------- +void() jim_fire1 =[ $idle1, jim_fire2 ] {jim_update(JS_IDLE); + if (self.classtype == CT_MONJIM) + sound (self, CHAN_WEAPON, "jim/laser_load.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "jim/rocket_load.wav", 1, ATTN_NORM); +}; +void() jim_fire2 =[ $idle1, jim_fire3 ] {jim_update(JS_IDLE);jim_attack(); + if (skill < SKILL_HARD) jim_vel(0.4); + else jim_vel(1.5); +}; +void() jim_fire3 =[ $idle1, jim_fire4 ] { + jim_update(JS_IDLE); if (skill < SKILL_HARD) jim_vel(0.6);}; +void() jim_fire4 =[ $idle1, jim_fire5 ] { jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(0.8);}; +void() jim_fire5 =[ $idle1, jim_fire6 ] {jim_update(JS_IDLE);jim_vel(1.0);}; +void() jim_fire6 =[ $idle1, jim_fire7 ] { + jim_update(JS_IDLE); if (skill < SKILL_HARD) jim_vel(1.2); + if (self.classtype == CT_MONJIM) jim_laser(); + else jim_rocket(); +}; +void() jim_fire7 =[ $idle1, jim_fire8 ] {jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(1.4); + if (self.classtype == CT_MONJIM) jim_laser(); +}; +void() jim_fire8 =[ $idle1, jim_fire9 ] {jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(1.3); + if (self.classtype == CT_MONJIM && skill >= SKILL_NORMAL) jim_laser(); +}; +void() jim_fire9 =[ $idle1, jim_fire10] {jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(1.1); + if (self.classtype == CT_MONJIM && skill >= SKILL_HARD) jim_laser(); +}; +void() jim_fire10 =[ $idle1, jim_fire11]{jim_update(JS_IDLE);jim_vel(0.5);}; +void() jim_fire11 =[ $idle1, jim_run1 ] {jim_update(JS_IDLE); + // Chance of bob instantly firing again + if (random() < 0.8) SUB_AttackFinished( 1 + random() ); + else SUB_AttackFinished( 1 + random()*0.5 ); +}; + +//============================================================================ +// ROBOT PAIN!?! +//============================================================================ +void() jim_inpain = +{ + // Keep cycling the pain animation + self.think = jim_inpain; + self.nextthink = time + 0.1; + + // Start of pain cycle + if (self.inpain == 0) { + // Spawn a pile of sparks and dust falling down + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + self.pos1 = '0 0 0'; + self.pos1_x = random() * self.lefty; // Pitch away from dmg + self.pos1_z = crandom() * -10; // Roll left / right + } + // Finished, back to combat + else if (self.inpain >= 5) { + // reset pitch/roll + self.angles_x = self.angles_z = 0; + self.think = self.th_run; + } + else { + // Keep moving in the pitch/roll direction + self.pos1 = self.pos1 * 1.2; + self.angles = self.angles + self.pos1; + } + + // Update pain frame + jim_update(JS_PAIN); + // Next pain animation + self.inpain = self.inpain + 1; +}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) jim_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Stop any ai_run velocity and reset movetype + self.velocity = '0 0 0'; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.inpain = 0; + + // Work out which direction the damage came from (enemy) + if (infront(attacker)) self.lefty = 10; // Hit from infront + else self.lefty = -10; // Hit from behind + + jim_inpain(); +}; + +//============================================================================ +// SLOW DYING ROBOT!?! +//============================================================================ +void() jim_dying2; +void() jim_is_dead; + +//---------------------------------------------------------------------------- +void() jim_dying1 = +{ + // Setup correct death frame + self.frame = JS_DYING + self.cnt; + self.cnt = self.cnt + 1; + + // Start spinning the robot out of control + // This update works with avelocity to create spiral effect + makevectors(self.angles); + self.velocity = (v_forward * 300) + (v_up * -30); + // Keep spinning out of control (constant direction) + if (self.lefty == 1) self.angles_y = (self.angles_y + 10); + else self.angles_y = (self.angles_y - 10); + + // Spawn some extra smoke trails + if (random() < 0.3) SpawnProjectileSmoke(self.origin, 150, 50, 150); + + // Keep looping round + self.think = jim_dying1; + self.nextthink = time + 0.1; + + // Next frame/function? + if (self.cnt > 3) { + self.think = jim_dying2; // Next function + self.waitmin = time + 1; // Setup timer for next part + self.cnt = 0; // Reset death animation + } +}; + +//---------------------------------------------------------------------------- +void() jim_dying2 = +{ + // Setup correct death frame + self.frame = JS_DYING + self.cnt; + self.cnt = self.cnt + 1; + if (self.cnt > 5) self.cnt = 0; + + // Medium explosion + sound OR smoke projectile trail + if (random() > 0.7) SpawnExplosion(EXPLODE_MED, self.origin, "jim/explode_minor.wav"); + else if (random() < 0.3) SpawnProjectileSmoke(self.origin, 150, 50, 150); + + // Turn down towards the ground + makevectors(self.angles); + self.solid = SOLID_BBOX; // Collision + touch + // Slow down the velocity to accent the spinning + self.velocity = (self.velocity * 0.2) + ((v_forward * 100) * 0.8); + self.velocity = normalize(self.velocity) * 300; + self.velocity_z = self.velocity_z - 200; + // Keep spinning out of control (constant direction) + if (self.lefty == 1) self.angles_y = (self.angles_y + 10); + else self.angles_y = (self.angles_y - 10); + + // Keep looping round + self.nextthink = time + 0.1; + if (self.waitmin < time) self.think = jim_is_dead; + else self.think = jim_dying2; +}; + +//---------------------------------------------------------------------------- +void() jim_is_dead = +{ + self.think = self.touch = SUB_Null; + + // Final fireworks! + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnExplosion(EXPLODE_BIG, self.origin, "jim/explode_major.wav"); + + // Goto final resting place + entity_hide(self); +}; + + +//---------------------------------------------------------------------------- +void() jim_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Flush every sound channel to kill gun buzzing sound + sound(self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_FEET, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_EXTRA1, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_EXTRA2, SOUND_EMPTY, 1, ATTN_NORM); + + // Special explosive death event + // First function creates the upward spiral (negative avelocity) + // Second function accents the spiral (1s forward movement) + // Third final impact (touch function goes here as well) + // + sound (self, CHAN_VOICE, "jim/death1.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; // No world colision + self.movetype = MOVETYPE_FLY; // Free velocity movement + self.touch = jim_is_dead; // still can touch stuff + self.cnt = 0; // Death frame 0 + self.movespeed = 0; // Make sure turret mode off + // The avelocity works better when negative (twisting upward) + self.avelocity_x = (random() * 50) - 100; + self.avelocity_y = (random() * 50) - 100; + self.avelocity_z = (random() * 50) - 100; + + // Decide which direction to spin + if (random() < 0.5) self.lefty = 1; + else self.lefty = 0; + + // Spawn dust and sprite explosion + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.origin, "jim/explode_minor.wav"); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + + jim_dying1(); +}; + +/*====================================================================== +/*QUAKED monster_jim (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_jim = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_JIM_ROCKET) self.mdl = "progs/mon_jimrock.mdl"; + else self.mdl = "progs/mon_jim.mdl"; + precache_model (self.mdl); + + // death/pain/attack sounds + precache_sound("jim/death1.wav"); + self.pain_sound = "jim/pain1.wav"; + self.pain_sound2 = "jim/pain2.wav"; + precache_sound(self.pain_sound); + precache_sound(self.pain_sound2); + + precache_sound("jim/explode_minor.wav"); + precache_sound("jim/explode_major.wav"); + precache_sound("jim/gunidle2.wav"); // Long buzzing sound + + self.sight_sound = "jim/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 30; // Sometimes flinch + self.steptype = FS_FLYING; // Silent feet + self.pain_longanim = FALSE; // No long pain animation + self.blockudeath = TRUE; // No humanoid death sound + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + self.oldorigin = self.origin; // Used for wing angles + self.idlebusy = 0; // Rotate gun idle states + self.idlereverse = FALSE; // Reverse direction for idle + self.attack_offset = '20 0 -10'; // front of laser/rocket + self.poisonous = FALSE; // Robots are not poisonous + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = JimCheckAttack; + self.th_stand = jim_stand1; + self.th_walk = jim_walk1; + self.th_run = jim_run1; + self.th_pain = jim_pain; + self.th_die = jim_die; + self.th_missile = jim_fire1; + + self.classgroup = CG_ROBOT; + self.classmove = MON_MOVEFLY; + + if (self.spawnflags & MON_JIM_ROCKET) { + self.classtype = CT_MONJIMROCKET; + if (self.health < 1) self.health = 50; + self.deathstring = " was blown away by Jim\n"; + + // Classic idle sound + new variant + self.idle_sound = "jim/idle1.wav"; + self.idle_sound2 = "jim/idle3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Projectile fire and impact (used in projectiles) + precache_sound("jim/rocket_load.wav"); // Wind up + precache_sound("jim/rocket_fire.wav"); // Fire + precache_sound("jim/rocket_hit.wav"); // Impact + } + else { + self.classtype = CT_MONJIM; + if (self.health < 1) self.health = 100; + self.deathstring = " was cauterized by Jim\n"; + + // Classic idle sound + new variant + self.idle_sound = "jim/idle1.wav"; + self.idle_sound2 = "jim/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Projectile fire and impact (used in projectiles) + precache_model (MODEL_PROJ_LASER); // Enforcer laser model + precache_sound("jim/laser_load.wav"); // Wind up + precache_sound ("enforcer/enfire.wav"); // Fire + precache_sound ("enforcer/enfstop.wav"); // Impact + } + + monster_start(); +}; + +// Re-direct all Quoth Bob requests to Jim! +void() monster_bob = { monster_jim(); } diff --git a/QC_other/QC_arcane/mon_knight.qc b/QC_other/QC_arcane/mon_knight.qc new file mode 100644 index 00000000..6ef5ab6b --- /dev/null +++ b/QC_other/QC_arcane/mon_knight.qc @@ -0,0 +1,509 @@ +/*============================================================================== +KNIGHT +==============================================================================*/ +$cd id1/models/knight +$origin 0 0 24 +$base base +$skin badass3 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8 + +$frame runattack1 runattack2 runattack3 runattack4 runattack5 +$frame runattack6 runattack7 runattack8 runattack9 runattack10 +$frame runattack11 + +$frame pain1 pain2 pain3 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 +$frame painb10 painb11 + +//$frame attackdummy +$frame attackb1 attackb2 attackb3 attackb4 attackb5 +$frame attackb6 attackb7 attackb8 attackb9 attackb10 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 + +// New - standing idleA - look left +$frame idlea1 idlea2 idlea3 idlea4 idlea5 idlea6 idlea7 idlea8 +$frame idlea9 idlea10 idlea11 idlea12 idlea13 idlea14 idlea15 idlea16 + +// New - standing idleB - look right +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 +$frame idleb9 idleb10 idleb11 idleb12 idleb13 idleb14 + +// New - Standing to standing upright +$frame attnin1 attnin2 attnin3 attnin4 + +// Standing upright +$frame attn1 attn2 attn3 attn4 + +// New - Standing upright to standing +$frame attnout1 attnout2 attnout3 attnout4 + +// Standing to Knee down +$frame kneeldn1 kneeldn2 kneeldn3 kneeldn4 kneeldn5 kneeldn6 +$frame kneeldn7 kneeldn8 kneeldn9 + +// New - Kneeling idle +$frame kneel1 kneel2 kneel3 kneel4 kneel5 kneel6 + +// New - Kneeling down to Standing up +$frame kneelup1 kneelup2 kneelup3 kneelup4 kneelup5 kneelup6 +$frame kneelup7 kneelup8 kneelup9 kneelup10 kneelup11 + +// New - Kneeling down to running +$frame kneelrun1 kneelrun2 kneelrun3 kneelrun4 kneelrun5 +$frame kneelrun6 kneelrun7 kneelrun8 + +void() knight_sword_sound; +void() knight_walk1; +void() knight_run1; + +//=========================================================================== +void() knight_idlea1 =[ $idlea1, knight_idlea2 ] {ai_stand();}; +void() knight_idlea2 =[ $idlea2, knight_idlea3 ] {ai_stand();}; +void() knight_idlea3 =[ $idlea3, knight_idlea4 ] {ai_stand();}; +void() knight_idlea4 =[ $idlea4, knight_idlea5 ] {ai_stand();}; +void() knight_idlea5 =[ $idlea5, knight_idlea6 ] {ai_stand();}; +void() knight_idlea6 =[ $idlea6, knight_idlea7 ] {ai_stand();}; +void() knight_idlea7 =[ $idlea7, knight_idlea8 ] {ai_stand();}; +void() knight_idlea8 =[ $idlea8, knight_idlea9 ] {ai_stand();}; +void() knight_idlea9 =[ $idlea9, knight_idlea10 ] {ai_stand();}; +void() knight_idlea10 =[ $idlea10, knight_idlea11 ] {ai_stand();}; +void() knight_idlea11 =[ $idlea11, knight_idlea12 ] {ai_stand();}; +void() knight_idlea12 =[ $idlea12, knight_idlea13 ] {ai_stand();}; +void() knight_idlea13 =[ $idlea13, knight_idlea14 ] {ai_stand();}; +void() knight_idlea14 =[ $idlea14, knight_idlea15 ] {ai_stand();}; +void() knight_idlea15 =[ $idlea15, knight_idlea16 ] {ai_stand();}; +void() knight_idlea16 =[ $idlea16, knight_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_idleb1 =[ $idleb1, knight_idleb2 ] {ai_stand();}; +void() knight_idleb2 =[ $idleb2, knight_idleb3 ] {ai_stand();}; +void() knight_idleb3 =[ $idleb3, knight_idleb4 ] {ai_stand();}; +void() knight_idleb4 =[ $idleb4, knight_idleb5 ] {ai_stand();}; +void() knight_idleb5 =[ $idleb5, knight_idleb6 ] {ai_stand();}; +void() knight_idleb6 =[ $idleb6, knight_idleb7 ] {ai_stand();}; +void() knight_idleb7 =[ $idleb7, knight_idleb8 ] {ai_stand();}; +void() knight_idleb8 =[ $idleb8, knight_idleb9 ] {ai_stand();}; +void() knight_idleb9 =[ $idleb9, knight_idleb10 ] {ai_stand();}; +void() knight_idleb10 =[ $idleb10, knight_idleb11 ] {ai_stand();}; +void() knight_idleb11 =[ $idleb11, knight_idleb12 ] {ai_stand();}; +void() knight_idleb12 =[ $idleb12, knight_idleb13 ] {ai_stand();}; +void() knight_idleb13 =[ $idleb13, knight_idleb14 ] {ai_stand();}; +void() knight_idleb14 =[ $idleb14, knight_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_kneelup1 =[ $kneelup1, knight_kneelup2 ] {ai_stand();}; +void() knight_kneelup2 =[ $kneelup2, knight_kneelup3 ] {ai_stand();}; +void() knight_kneelup3 =[ $kneelup3, knight_kneelup4 ] {ai_stand();}; +void() knight_kneelup4 =[ $kneelup4, knight_kneelup5 ] {ai_stand();}; +void() knight_kneelup5 =[ $kneelup5, knight_kneelup6 ] {ai_stand();}; +void() knight_kneelup6 =[ $kneelup6, knight_kneelup7 ] {ai_stand();}; +void() knight_kneelup7 =[ $kneelup7, knight_kneelup8 ] {ai_stand();}; +void() knight_kneelup8 =[ $kneelup8, knight_kneelup9 ] {ai_stand();}; +void() knight_kneelup9 =[ $kneelup9, knight_kneelup10] {ai_stand();}; +void() knight_kneelup10=[ $kneelup10, knight_kneelup11] {ai_stand();}; +void() knight_kneelup11=[ $kneelup11, knight_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_kneel1 =[ $kneel1, knight_kneel2 ] {ai_stand();monster_idle_sound();}; +void() knight_kneel2 =[ $kneel2, knight_kneel3 ] {ai_stand();}; +void() knight_kneel3 =[ $kneel3, knight_kneel4 ] {ai_stand();}; +void() knight_kneel4 =[ $kneel4, knight_kneel5 ] {ai_stand();}; +void() knight_kneel5 =[ $kneel5, knight_kneel6 ] {ai_stand();}; +void() knight_kneel6 =[ $kneel6, knight_kneel1 ] {ai_stand(); + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) + self.think = knight_kneelup1; // Start standing up +}; + +//---------------------------------------------------------------------- +void() knight_kneeldn1 =[ $kneeldn1, knight_kneeldn2 ] {ai_stand();}; +void() knight_kneeldn2 =[ $kneeldn2, knight_kneeldn3 ] {ai_stand();}; +void() knight_kneeldn3 =[ $kneeldn3, knight_kneeldn4 ] {ai_stand();}; +void() knight_kneeldn4 =[ $kneeldn4, knight_kneeldn5 ] {ai_stand();}; +void() knight_kneeldn5 =[ $kneeldn5, knight_kneeldn6 ] {ai_stand();}; +void() knight_kneeldn6 =[ $kneeldn6, knight_kneeldn7 ] {ai_stand();}; +void() knight_kneeldn7 =[ $kneeldn7, knight_kneeldn8 ] {ai_stand();}; +void() knight_kneeldn8 =[ $kneeldn8, knight_kneeldn9 ] {ai_stand();}; +void() knight_kneeldn9 =[ $kneeldn9, knight_kneel1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_attn1 =[ $attn1, knight_attn2 ] {ai_stand();monster_idle_sound();}; +void() knight_attn2 =[ $attn2, knight_attn3 ] {ai_stand();}; +void() knight_attn3 =[ $attn3, knight_attn4 ] {ai_stand();}; +void() knight_attn4 =[ $attn4, knight_attn1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();monster_idle_sound();}; +void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();}; +void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();}; +void() knight_stand4 =[ $stand4, knight_stand5 ] {ai_stand();}; +void() knight_stand5 =[ $stand5, knight_stand6 ] {ai_stand();}; +void() knight_stand6 =[ $stand6, knight_stand7 ] {ai_stand();}; +void() knight_stand7 =[ $stand7, knight_stand8 ] {ai_stand();}; +void() knight_stand8 =[ $stand8, knight_stand9 ] {ai_stand();}; +void() knight_stand9 =[ $stand9, knight_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) { + // Slow down the repeating of idle animations + self.weaponswitch = time + 1 + random()*3; + self.idlebusy = TRUE; + + self.lefty = 1 - self.lefty; + if (self.lefty == 1) self.think = knight_idlea1; // Look left + else self.think = knight_idleb1; // Look right + } +}; + +//=========================================================================== +void() knight_walk1 =[ $walk1, knight_walk2 ] { + monster_footstep(FALSE); monster_idle_sound(); ai_walk(3);}; +void() knight_walk2 =[ $walk2, knight_walk3 ] {ai_walk(2);}; +void() knight_walk3 =[ $walk3, knight_walk4 ] {ai_walk(3);}; +void() knight_walk4 =[ $walk4, knight_walk5 ] {ai_walk(4);}; +void() knight_walk5 =[ $walk5, knight_walk6 ] {ai_walk(3);}; +void() knight_walk6 =[ $walk6, knight_walk7 ] {ai_walk(3);}; +void() knight_walk7 =[ $walk7, knight_walk8 ] {ai_walk(3);}; +void() knight_walk8 =[ $walk8, knight_walk9 ] {monster_footstep(FALSE); ai_walk(4);}; +void() knight_walk9 =[ $walk9, knight_walk10 ] {ai_walk(3);}; +void() knight_walk10 =[ $walk10, knight_walk11 ] {ai_walk(3);}; +void() knight_walk11 =[ $walk11, knight_walk12 ] {ai_walk(2);}; +void() knight_walk12 =[ $walk12, knight_walk13 ] {ai_walk(3);}; +void() knight_walk13 =[ $walk13, knight_walk14 ] {ai_walk(4);}; +void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);}; + +//=========================================================================== +void() knight_run1 =[ $runb1, knight_run2 ] {monster_idle_sound(); ai_run(16);}; +void() knight_run2 =[ $runb2, knight_run3 ] {monster_footstep(FALSE); ai_run(20);}; +void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);}; +void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);}; +void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);}; +void() knight_run6 =[ $runb6, knight_run7 ] {monster_footstep(FALSE); ai_run(20);}; +void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);}; +void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);}; + +//============================================================================ +void() knight_runatk1 =[ $runattack1, knight_runatk2 ] { ai_charge(20); }; +void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side();}; +void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side();}; +void() knight_runatk4 =[ $runattack4, knight_runatk5 ] {knight_sword_sound(); ai_charge_side();}; +void() knight_runatk5 =[ $runattack5, knight_runatk6 ] {ai_melee_side();}; +void() knight_runatk6 =[ $runattack6, knight_runatk7 ] {monster_footstep(FALSE); ai_melee_side();}; +void() knight_runatk7 =[ $runattack7, knight_runatk8 ] {ai_melee_side();}; +void() knight_runatk8 =[ $runattack8, knight_runatk9 ] {ai_melee_side();}; +void() knight_runatk9 =[ $runattack9, knight_runatk10 ] {ai_melee_side();}; +void() knight_runatk10 =[ $runattack10, knight_runatk11 ] {monster_footstep(FALSE); ai_charge_side();}; +void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10);}; + +//---------------------------------------------------------------------- +void() knight_atk1 =[ $attackb1, knight_atk2 ] {ai_charge(0);}; +void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);}; +void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4);}; +void() knight_atk4 =[ $attackb4, knight_atk5 ] {knight_sword_sound(); ai_charge(0);}; +void() knight_atk5 =[ $attackb5, knight_atk6 ] {monster_footstep(FALSE); ai_charge(3);}; +void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();}; +void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();}; +void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3); ai_melee();}; +void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1);}; +void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);}; + +//============================================================================= +void() knight_melee = +{ + if (ai_checkmelee(MONAI_MELEEKNIGHT)) knight_atk1 (); + else knight_runatk1 (); +}; + +//=========================================================================== +void() knight_pain1 =[ $pain1, knight_pain2 ] {}; +void() knight_pain2 =[ $pain2, knight_pain3 ] {}; +void() knight_pain3 =[ $pain3, knight_run1 ] {}; + +void() knight_painb1 =[ $painb1, knight_painb2 ] {ai_painforward(0);}; +void() knight_painb2 =[ $painb2, knight_painb3 ] {ai_painforward(3);}; +void() knight_painb3 =[ $painb3, knight_painb4 ] {}; +void() knight_painb4 =[ $painb4, knight_painb5 ] {monster_footstep(FALSE);}; +void() knight_painb5 =[ $painb5, knight_painb6 ] {ai_painforward(2);}; +void() knight_painb6 =[ $painb6, knight_painb7 ] {ai_painforward(4);}; +void() knight_painb7 =[ $painb7, knight_painb8 ] {ai_painforward(2);}; +void() knight_painb8 =[ $painb8, knight_painb9 ] {ai_painforward(5);monster_footstep(FALSE);}; +void() knight_painb9 =[ $painb9, knight_painb10 ] {ai_painforward(5);}; +void() knight_painb10 =[ $painb10, knight_painb11 ] {ai_painforward(0);}; +void() knight_painb11 =[ $painb11, knight_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) knight_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) knight_pain1 (); // classic, body recoil + else { + self.pain_finished = time + 2; // long animation + knight_painb1 (); // Cool stumble, hand over mouth + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + self.pain_finished = time + 1.1; + knight_painb1 (); + } + } +}; + +//============================================================================ +void() knight_die1 =[ $death1, knight_die2] {}; +void() knight_die2 =[ $death2, knight_die3] {monster_check_gib();}; +void() knight_die3 =[ $death3, knight_die4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() knight_die4 =[ $death4, knight_die5] {}; +void() knight_die5 =[ $death5, knight_die6] {}; +void() knight_die6 =[ $death6, knight_die7] {}; +void() knight_die7 =[ $death7, knight_die8] {}; +void() knight_die8 =[ $death8, knight_die9] {}; +void() knight_die9 =[ $death9, knight_die10] {monster_death_postcheck();}; +void() knight_die10 =[ $death10, knight_die10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() knight_dieb1 =[ $deathb1, knight_dieb2] {}; +void() knight_dieb2 =[ $deathb2, knight_dieb3] {monster_check_gib();}; +void() knight_dieb3 =[ $deathb3, knight_dieb4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() knight_dieb4 =[ $deathb4, knight_dieb5] {}; +void() knight_dieb5 =[ $deathb5, knight_dieb6] {}; +void() knight_dieb6 =[ $deathb6, knight_dieb7] {}; +void() knight_dieb7 =[ $deathb7, knight_dieb8] {}; +void() knight_dieb8 =[ $deathb8, knight_dieb9] {}; +void() knight_dieb9 =[ $deathb9, knight_dieb10] {}; +void() knight_dieb10 =[ $deathb10, knight_dieb11] {monster_death_postcheck();}; +void() knight_dieb11 =[ $deathb11, knight_dieb11] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() knight_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) knight_die1 (); // Forward + else knight_dieb1 (); // Backward + } +}; + +//============================================================================ +void() knight_sword_sound = +{ + if (random() > 0.5) sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +}; + +//============================================================================ +void() knight_aistates = +{ + self.th_stand = knight_stand1; // Idling on feet + self.th_walk = knight_walk1; // Walking + self.th_run = knight_run1; // Running + self.th_melee = knight_melee; // Sword attack + self.th_pain = knight_pain; // Stumble and pain + self.th_die = knight_die; // Face meets floor +}; + +//---------------------------------------------------------------------- +void() knight_wakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + + self.use = SUB_Null; // no re-trigger + self.takedamage = DAMAGE_AIM; // Can receive damage + self.spawnstatue = FALSE; // No longer stationary + + knight_aistates(); // Restore AI state functions + monster_targets(); // Check for targets +}; + +//---------------------------------------------------------------------- +void() knight_statue = +{ + local float targ_angle, new_frame; + + // Check for sudden death! + if (self.health < 0) return; + + if (random() < MON_IDLE_SOUND && self.pos1_z > 1) { + new_frame = TRUE; + self.oldenemy = checkclient(); + if (self.oldenemy.flags & FL_CLIENT) { + targ_angle = viewangle(self.origin, self.oldenemy.origin, 0, TRUE, self.oldenemy.v_angle_y); + if (targ_angle < 135 || targ_angle > 225) new_frame = FALSE; + } + self.lip = self.pos1_x + rint(random()*self.pos1_z); + if (new_frame) { + sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + self.frame = self.lip; + } + } + + self.think = knight_statue; + self.nextthink = time + 5 + random()*5; +}; + +/*====================================================================== + QUAKED monster_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_knight = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_knight.mdl"; + self.headmdl = "progs/h_knight.mdl"; // Large head + self.gib1mdl = "progs/w_knightsword.mdl"; // Unique sword + self.gib2mdl = "progs/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = ""; + if (random() < 0.5) self.gib3mdl = ""; + + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + self.idle_sound = "statue/idle1.wav"; + self.idle_sound2 = "statue/idle2.wav"; + self.idle_soundcom = "statue/comidle.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + self.sight_sound = "statue/sight.wav"; + self.pain_sound = "statue/hurt.wav"; + self.death_sound = "statue/death.wav"; + self.gib1skin = 1; // Stoney sword + precache_stonegibs(); // Cache gib models + self.gibtype = GIBTYPE_STONE; // Stoney gibs! + self.gib2mdl = self.gib3mdl = string_null; + } + else { + self.idle_sound = "knight/idle.wav"; + precache_sound (self.idle_sound); + + self.sight_sound = "knight/ksight.wav"; + self.pain_sound = "knight/khurt.wav"; + self.death_sound = "knight/kdeath.wav"; + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + if (!self.exactskin) self.exactskin = 3; // Swampy skin + } + } + + // precache sight, pain and death (changes on type) + precache_sound (self.sight_sound); + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 75; + self.gibhealth = -40; // Not easy to gib + self.gibbed = FALSE; // Still in one peice + self.pain_flinch = 20; // Light pain threshold + self.pain_longanim = TRUE; // Can do long stagger animation + self.steptype = FS_TYPEMEDIUM; // Light soldier feet + self.skin = 0; // Always reset (use exactskin) + self.th_die = knight_die; // Face meets floor + self.deathstring = " was slashed by a Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + //---------------------------------------------------------------------- + // Detect statues and setup different parameters + // Tougher skin, less pain, heavy feet etc + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + self.classgroup = CG_STONE; // Stone hates metal! + self.poisonous = FALSE; // Cannot be poisonous and stone! + self.resist_nails = 0.5; // Tough skin for nails + self.reflectnails = TRUE; // Reflect nail projectiles + if (!self.exactskin) self.exactskin = 4; // Stone skin + self.pain_flinch = 40; // Doubled + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // HK pain threshold + self.steptype = FS_TYPEHEAVY; // heavy stone feet! + self.no_liquiddmg = TRUE; // Immune to slime/lava + self.deathstring = " was smashed by a Stone Knight\n"; + + // Allow knights to start with a stone skin, but not be frozen! + if (self.spawnflags & MON_NOTFROZEN) { + self.spawnflags = self.spawnflags - MON_STATUE; + knight_aistates(); // setup AI state functions + } + else { + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = knight_statue; // Stone idle sound + self.think1 = knight_wakeup; // Wakeup function when triggered + + // statues can change position when the player is not looking + // Specify a start/finish frame using pos1 or use frame + if (!self.pos1_x) { + self.pos1_x = $attackb1; // Default pose (attacking) + self.pos1_y = $attackb10; + } + // A frame has been specified, create a small range from that + if (self.frame > 0) { + self.pos1_x = self.pos1_y = self.frame; + } + // Work out range, make sure no negative values + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = self.pos1_x; // Setup frame / pose + } + } + else { + // The new knight model by Lunaran has 4 available skins to + // choose from. The local option will always override the + // worldspawn option. + // Added -1 option which will randomly pick a skin + if (self.exactskin < 0) self.randomskin = 4; + if (!self.exactskin && world.knight_defskin > 0) + self.exactskin = world.knight_defskin; + + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.classgroup = CG_KNIGHT; // Classic tincan! + knight_aistates(); // setup AI state functions + } + + self.classtype = CT_MONKNIGHT; + self.classmove = MON_MOVEWALK; + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_lostsoul.qc b/QC_other/QC_arcane/mon_lostsoul.qc new file mode 100644 index 00000000..8cf78801 --- /dev/null +++ b/QC_other/QC_arcane/mon_lostsoul.qc @@ -0,0 +1,647 @@ +/*============================================================================== +LOST SOUL +==============================================================================*/ + +// moving jaw up and down (talking) +$frame idle1 idle2 idle3 idle4 idle5 idle6 + +// Tilt head backwards to look up +$frame idleB1 idleB2 idleB3 idleB4 idleB5 idleB6 + +// Tilt head downwards to look below +$frame idleF1 idleF2 idleF3 idleF4 idleF5 idleF6 + +// Keep looking left or right +$frame idleleft1 idleleft2 idleleft3 idleleft4 idleleft5 idleleft6 +$frame idleright1 idleright2 idleright3 idleright4 idleright5 idleright6 + +// Turn head left or right 30 degrees +$frame idleturnl1 idleturnl2 idleturnl3 idleturnl4 idleturnl5 idleturnl6 +$frame idleturnr1 idleturnr2 idleturnr3 idleturnr4 idleturnr5 idleturnr6 + +// mouth wide open and head tilted back +$frame charge1 charge2 charge3 charge4 charge5 charge6 + +// obvious chewing motion +$frame chew1 chew2 chew3 chew4 chew5 chew6 + +// mouth open and rotated Backward or Forward +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame pain7 pain8 pain9 pain10 pain11 pain12 + +// Spawning from nothing +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +float LOST_IDLE = 0; // Default state +float LOST_IDLEB = 1; // Looking UP +float LOST_IDLEF = 2; // Looking DOWN +float LOST_IDLELEFT = 3; // Looking left +float LOST_IDLERIGHT = 4; // Looking right +float LOST_TURNLEFT = 5; // Turning left (not looped) +float LOST_TURNRIGHT = 6; // Turning right (not looped) +float LOST_CHARGE = 7; // Mouth wide open and charging +float LOST_MELEE = 8; // Mouth chomping open/close +float LOST_PAINB = 9; // Roll backwards +float LOST_PAINF = 10; // Roll forward + +// Size of each animation block +float LOST_ANIMBLOCK = 6; + +// Different states and fire particle quantity +float LOST_STATE_STAND = 2; +float LOST_STATE_WALK = 4; +float LOST_STATE_GUARD = 3; +float LOST_STATE_RUN = 5; +float LOST_STATE_PAIN = 6; + +//====================================================================== +// Update Lost Souls every frame with velocity movements and glow eyes! +// fstate (see above for animation block details) +//====================================================================== +void(float fstate) lost_update = +{ + // If Lost is dead, no more updates + if (self.health < 1) return; + + // Time for an idle sound? (run only) + if (self.idletimer < time && self.state == LOST_STATE_RUN) + monster_idle_sound(); + + // Update glowing eyes! (skin types = 0,1,2,3,2,1) + if (self.t_length < time) { + // fire particle quantity linked to AI state + particle_explode(self.origin+'0 0 12', self.state, 1, PARTICLE_BURST_YELLOW, PARTICLE_BURST_LOSTUP); + self.t_length = time + 0.2; + self.exactskin = self.exactskin + 1; + if (self.exactskin > 5) self.exactskin = 0; + self.skin = self.exactskin; + } + + // While standing still or guarding, gently float up and down + if (self.state == LOST_STATE_STAND || self.state == LOST_STATE_GUARD) { + // While standing around idle, gently move up and down + // using velocity, forced origin movement is really jerky! + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.attack_timer < time) { + self.attack_timer = time + 1; + if (self.lip < 1) self.lip = 1; + else self.lip = -1; + self.velocity_z = 2 * self.lip; + } + } + } + + // Lost sight of enemy during combat, wait and look around + if (self.state == LOST_STATE_GUARD) { + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + if (random() < 0.5) self.lefty = 1; + else self.lefty = -1; + self.avelocity = '0 0 0'; + self.avelocity_y = self.lefty*50; + self.attack_sidestep = 0; + self.attack_sidedeny = rint(4 + random()*4); + } + + // Keep increasing rotation angle velocity + self.attack_sidestep = self.attack_sidestep + 1; + if (self.attack_sidestep > self.attack_sidedeny) self.avelocity = '0 0 0'; + else self.avelocity_y = self.avelocity_y * 1.25; + + // Check lost idle timer after combat + if (self.lostenemy && self.losttimer < time) { + self.losttimer = LARGE_TIMER; + if (self.lostenemy.health < 0) self.lostenemy = world; + else { + // Restore previous enemy and start hunting + self.enemy = self.lostenemy; + self.think = self.th_run; + self.state = LOST_STATE_RUN; + // Setup goals and DO NOT warn other monsters + FoundHuntTarget(FALSE); + } + } + } + + // Work through all the different AI states + if (self.state == LOST_STATE_STAND || self.state == LOST_STATE_WALK) { + // At beginning of frame block and reversing? + if (self.count == 0 && self.idlereverse) { + if (self.idlebusy == LOST_TURNLEFT || self.idlebusy == LOST_TURNRIGHT) { + self.idlebusy = LOST_IDLE; + self.idlereverse = FALSE; + self.waitmin = time + 2 + random() * 4; + } + } + // At end of frame block and going forward? + else if (self.count == LOST_ANIMBLOCK-1 && !self.idlereverse) { + // Always reset turn left/right animation while walking + if (self.state == LOST_STATE_WALK) { + if (self.idlebusy == LOST_IDLELEFT) { + self.idlebusy = LOST_TURNLEFT; + self.idlereverse = TRUE; + } + else if (self.idlebusy == LOST_IDLERIGHT) { + self.idlebusy = LOST_TURNRIGHT; + self.idlereverse = TRUE; + } + // Return from all other idle animations + else { + self.idlebusy = LOST_IDLE; + self.waitmin = time + 2 + random() * 4; + } + } + // Idle animation designed for standing around + else { + if (self.idlebusy == LOST_IDLE && self.waitmin < time) { + // Randonly pick an idle animation (difference stand/walk) + self.lip = random(); + if (self.lip < 0.4) self.idlebusy = LOST_TURNLEFT; + else if (self.lip < 0.6) self.idlebusy = LOST_TURNRIGHT; + else if (self.lip < 0.8) self.idlebusy = LOST_IDLEB; + else self.idlebusy = LOST_IDLEF; + } + // Return from opening/closing mouth idle animations + else if (self.idlebusy == LOST_IDLEB || self.idlebusy == LOST_IDLEF) { + self.idlebusy = LOST_IDLE; + self.waitmin = time + 2 + random() * 4; + } + // Turning head left direction + else if (self.idlebusy == LOST_TURNLEFT) { + self.idlebusy = LOST_IDLELEFT; + self.waitmin = time + 2 + random() * 4; + } + // Turning head right direction + else if (self.idlebusy == LOST_TURNRIGHT) { + self.idlebusy = LOST_IDLERIGHT; + self.waitmin = time + 2 + random() * 4; + } + // Looking left and randomly think about returning + else if (self.idlebusy == LOST_IDLELEFT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = LOST_TURNLEFT; + self.idlereverse = TRUE; + } + } + // Looking right and randomly think about returning + else if (self.idlebusy == LOST_IDLERIGHT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = LOST_TURNRIGHT; + self.idlereverse = TRUE; + } + } + } + } + } + else { + // All other states (RUN, PAIN, GUARD) + // Reset any previous idle animations + self.idlereverse = FALSE; + self.idlebusy = FALSE; + } + + // Check frame direction and update counter + if (self.idlereverse) self.count = self.count - 1; + else self.count = self.count + 1; + if (self.count >= LOST_ANIMBLOCK) self.count = 0; + if (self.count < 0) self.count = LOST_ANIMBLOCK-1; + + // Busy with an idle animation? + if (self.idlebusy > 0) fstate = self.idlebusy; + // Update frame animation block with frame counter + self.frame = fstate * LOST_ANIMBLOCK + self.count; + // Store current origin position + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------------- +void() lost_flymode = +{ + self.solid = SOLID_SLIDEBOX; // Reset just in case + self.movetype = MOVETYPE_FLY; // Turn body into projectile + // make sure onground is not set, cannot use velocity otherwise + self.flags = self.flags - (self.flags & FL_ONGROUND); +}; + +//---------------------------------------------------------------------------- +void() lost_stepmode = +{ + self.velocity = '0 0 0'; // Back to regular movement + self.avelocity = '0 0 0'; // Cancel any rotation velocity + self.angles_x = self.angles_z = 0; // Reset any X/Y angles + self.solid = SOLID_SLIDEBOX; // Always reset + self.movetype = MOVETYPE_STEP; // Back to discreet movement +}; + +//====================================================================== +// All stand, walk and run functions are condensed down to one entry +// so that the lost souls can move dynamic and have skin updates +// +void() lost_stand1 = [ $idle1, lost_stand1 ] { + if (self.state != LOST_STATE_GUARD) self.state = LOST_STATE_STAND; + lost_flymode(); // allow velocity updates + lost_update(LOST_IDLE); // Update skin + velocity + ai_stand(); +}; +void() lost_guard1 = { self.state = LOST_STATE_GUARD; lost_stand1(); }; + +void() lost_walk1 = [ $idle1, lost_walk1 ] { + self.state = LOST_STATE_WALK; + lost_stepmode(); // back to discreet step mode + lost_update(LOST_IDLE); // Update skin + ai_walk(8); +}; +void() lost_run1 = [ $idle1, lost_run1 ] { + self.state = LOST_STATE_RUN; + lost_stepmode(); // back to discreet step mode + lost_update(LOST_IDLE); // Update skin + ai_run(8); +}; + +//============================================================================ +// Range Charge attack +//============================================================================ +void() lost_charge_touch = +{ + // Stop anymore touching + self.touch = SUB_Null; + self.think = self.th_run; + + // Do not damage other souls with charge attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + T_Damage (other, self, self, DAMAGE_LOSTCHARGE, DAMARMOR); + spawn_touchblood (self, other, DAMAGE_LOSTCHARGE*3); + + // If touched a player, nudge them backwards + if (other.flags & FL_CLIENT) { + self.lostsearch = FALSE; + makevectors (self.angles); + other.velocity = other.velocity + (v_forward * 200 + '0 0 50'); + } + } +}; + +//---------------------------------------------------------------------------- +void() lost_charge1 = +{ + // Play hiss sound, sighted enemy, charging + sound (self, CHAN_WEAPON, "lostsoul/charge.wav", 1, ATTN_NORM); + + self.count = 0; // reset start of animation block + lost_flymode(); // allow velocity updates + lost_update(LOST_CHARGE); // Update skin + // Stop tracking if easy/normal skill + if (skill < SKILL_HARD) self.lostsearch = FALSE; + + self.cnt = 0; // reset speed updates + self.attack_speed = SPEED_LOSTSTART; // Initial speed + self.pos1 = SUB_orgEnemyTarget() + '0 0 12'; // Aim towards head + self.pos2 = normalize(self.pos1 - self.origin); // Vector direction + self.touch = lost_charge_touch; // Damage/end function + self.velocity = self.pos2 * self.attack_speed; // Launch body missile! + self.angles = vectoangles(self.velocity); // Turn straight away + + self.think = self.th_charge; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() lost_charge2 = +{ + if (self.health < 1) return; + lost_update(LOST_CHARGE); + self.nextthink = time + 0.1; + + self.cnt = self.cnt + 1; // speed updates + if (self.cnt > 12) self.think = self.th_run; // End of charge attack + // Keep travelling forward regardless of enemy + else { + // Keep increasing speed every 0.1s (check for max speed) + if (self.attack_speed < SPEED_LOSTMAX) + self.attack_speed = self.attack_speed + SPEED_LOSTCHARGE; + self.velocity = self.pos2 * self.attack_speed; + self.think = self.th_charge; + } +}; + +//====================================================================== +// MELEE ATTACK - Biting +//====================================================================== +void() lost_bite = +{ + local float ldmg; + local entity enemy_targ; + + enemy_targ = SUB_entEnemyTarget(); + + if (!enemy_targ) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEELOSTSOUL)) return; // Too far away + + // Can the target bleed? + if (enemy_targ.takedamage < 1) return; + + sound (self, CHAN_WEAPON, "lostsoul/bite.wav", 1, ATTN_NORM); + + // Lost Soul bite is very weak + ldmg = (random() + random() + random()) * 3; + T_Damage (enemy_targ, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Spawn blood at mouth of Lost Soul + spawn_touchblood (self, enemy_targ, ldmg*3); +}; + +//---------------------------------------------------------------------------- +void() lost_melee2 = +{ + if (self.health < 1) return; + lost_update(LOST_MELEE); // Update skin + self.cnt = self.cnt + 1; // Next frame + + // Check for bite attack + if (self.cnt == 3) lost_bite(); + + // End of melee attack? + if (self.cnt >= 5) { + // One chop of the jaws and then fly away time + self.think = self.th_run; + + // Check if enemy is still within range for another chop! +// if (ai_checkmelee(MONAI_MELEELOSTSOUL) && SUB_healthEnemyTarget() > 0) +// self.think = self.th_melee; +// else self.think = self.th_run; + } + else self.think = lost_melee2; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() lost_melee1 = +{ + self.count = 0; // reset start of animation block + self.cnt = 0; // Reset bite frame counter + lost_flymode(); // stay in flymode just in case collison probs + lost_update(LOST_MELEE); // Update skin + + self.think = lost_melee2; + self.nextthink = time + 0.1; +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() lost_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() lost_grow1 = [ $grow1, lost_grow2 ] {}; +void() lost_grow2 = [ $grow2, lost_grow3 ] {lost_growangle();}; +void() lost_grow3 = [ $grow3, lost_grow4 ] {lost_growangle();}; +void() lost_grow4 = [ $grow4, lost_grow5 ] {lost_growangle();}; +void() lost_grow5 = [ $grow5, lost_grow6 ] {lost_growangle();}; +void() lost_grow6 = [ $grow6, lost_grow7 ] {lost_growangle();}; +void() lost_grow7 = [ $grow7, lost_grow8 ] {lost_growangle();}; +void() lost_grow8 = [ $grow8, lost_grow9 ] {lost_growangle();}; +void() lost_grow9 = [ $grow9, lost_grow10] {lost_growangle();}; +void() lost_grow10= [ $grow10, lost_run1 ] { + // Is the lost stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + self.state = LOST_STATE_RUN; + self.count = 0; + lost_update(LOST_IDLE); // Update skin + + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = lost_stand1; + self.th_altstand = lost_guard1; + self.th_walk = lost_walk1; + self.th_run = lost_run1; + self.th_melee = lost_melee1; + self.th_missile = lost_charge1; + self.th_charge = lost_charge2; + + // Start charging at player if not dead and got an enemy + if (self.health > 0 && self.enemy) { + ai_face(); + self.think = self.th_missile; + } + } +}; + +//---------------------------------------------------------------------------- +void() lost_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + lost_stepmode(); + lost_grow1(); +}; + +//============================================================================ +// PAIN in the head! +//============================================================================ +void() lost_inpain = +{ + // Update pain frame + lost_update(self.attack_rage); + + // Next pain animation + self.inpain = self.inpain + 1; + if (self.inpain >= 5) self.think = self.th_run; + else self.think = lost_inpain; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) lost_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + if (self.state != LOST_STATE_PAIN) { + // Stop all velocity and reset movetype + lost_stepmode(); + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + } + + // Work out which direction the damage came from (enemy) + if (infront(attacker)) self.attack_rage = LOST_PAINB; // Hit from infront + else self.attack_rage = LOST_PAINF; // Hit from behind + + self.state = LOST_STATE_PAIN; + // Reset pain and current frame counter + self.inpain = self.count = 0; + lost_inpain(); +}; + +//============================================================================ +void() lost_die1 = [ $pain1, lost_die2 ] {}; +void() lost_die2 = [ $pain2, lost_die2 ] { + // Lost souls explode when they die + T_RadiusDamage (self, self, DAMAGE_LOSTSOUL, world, DAMAGEALL); + if (random() < 0.5) self.lip = EXPLODE_SMALL; + else if (random() < 0.9) self.lip = EXPLODE_MED; + else self.lip = EXPLODE_BIG; + SpawnExplosion(self.lip, self.origin, "lostsoul/death.wav"); + // Goto final resting place + entity_remove(self, 0.1); +}; + +//---------------------------------------------------------------------- +void() lost_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Make sure body does not drop to the ground + self.flags = self.flags | FL_FLY; + self.takedamage = DAMAGE_NO; + lost_die1(); +}; + +/*====================================================================== +QUAKED monster_lostsoul (1 0.2 0) (-16 -16 -24) (16 16 24) +======================================================================*/ +void() setup_lostsoul; +void() monster_lostsoul = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_lostsoul.mdl"; + precache_model (self.mdl); + + self.idle_sound = "lostsoul/idle1.wav"; + self.idle_sound2 = "lostsoul/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("lostsoul/charge.wav"); // charge hiss/scream + precache_sound ("lostsoul/bite.wav"); // chomp with teeth + + self.pain_sound = "lostsoul/pain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("lostsoul/death.wav"); + + // Cache lost soul is a special class used for precache only + if (self.classtype != CT_CACHELOSTSOUL) setup_lostsoul(); +}; + +//---------------------------------------------------------------------------- +void() monster_skullwizminion = { + self.classtype = CT_CACHELOSTSOUL; + monster_lostsoul(); +}; + +//---------------------------------------------------------------------------- +void() setup_lostsoul = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + if (self.health < 1) self.health = 30; + self.yaw_speed = 35; // Really fast at turning + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 10; // Always go into pain + self.blockudeath = TRUE; // no humanoid death sound + self.steptype = FS_FLYING; // Silent feet + self.pain_longanim = FALSE; // No long pain animation + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + self.meleeattack = time + 4; // no rotation at spawn + self.mangle = self.angles; // idle rotate left/right + self.idlebusy = 0; // Tilt/turn head animations + self.idlereverse = FALSE; // Reverse direction for idle + self.exactskin = rint(random()*5); // Randomize eye glow + self.lostenemy = world; // Setup old enemy + self.losttimer = LARGE_TIMER; // Stop lost timer + self.lostsearch = FALSE; // Not searching for an enemy + self.deathstring = " was found by a Lost Soul\n"; + + // I can understand lost souls would be the perfect candidate for + // poison attacks, but they are tricky already! default = disabled. + self.poisonous = FALSE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = LostCheckAttack; + self.th_pain = lost_pain; + self.th_die = lost_die; + + //---------------------------------------------------------------------- + // Special spawning minion need to start spinning + if (self.classtype == CT_MINIONLOSTSOUL) { + self.th_stand = self.th_walk = self.th_run = lost_grow; + self.th_missile = SUB_Null; + } + //---------------------------------------------------------------------- + // Default lost soul setup + else { + self.th_stand = lost_stand1; + self.th_altstand = lost_guard1; + self.th_walk = lost_walk1; + self.th_run = lost_run1; + self.th_melee = lost_melee1; + self.th_missile = lost_charge1; + self.th_charge = lost_charge2; + } + + self.classtype = CT_MONLOSTSOUL; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn lost souls (requires monster_skullwizminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_lostsoul = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + // Self = skull wizard, there is no egg + update_minioncount(self, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_lostsoul"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self; // Spawner Parent Link + + minion.effects = minion.flags = 0; // make sure are blank + minion.classtype = CT_MINIONLOSTSOUL; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = 0; + minion.classgroup = CG_WIZARD; // Don't turn on master + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + minion.mdl = "progs/mon_lostsoul.mdl"; + + minion.pain_sound = "lostsoul/pain1.wav"; + minion.idle_sound = "lostsoul/idle1.wav"; + minion.idle_sound2 = "lostsoul/idle2.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_lostsoul; +}; diff --git a/QC_other/QC_arcane/mon_minotaur.qc b/QC_other/QC_arcane/mon_minotaur.qc new file mode 100644 index 00000000..e27c3cf9 --- /dev/null +++ b/QC_other/QC_arcane/mon_minotaur.qc @@ -0,0 +1,791 @@ +/*============================================================================== +MINOTAUR (Hexen2 model by Raven Software) (The Shuffler from Marcher MOD) +also known as "The Nethergoat: Spawnmaster of the Elder World" +==============================================================================*/ + +// Slap RIGHT - 7, 9, 11, 13, 15, 17 +// Slap LEFT - 19, 21, 23, 1, 3, 5 +$frame bwalk1 bwalk2 bwalk3 bwalk4 bwalk5 bwalk6 bwalk7 bwalk8 +$frame bwalk9 bwalk10 bwalk11 bwalk12 bwalk13 bwalk14 bwalk15 bwalk16 +$frame bwalk17 bwalk18 bwalk19 bwalk20 bwalk21 bwalk22 bwalk23 bwalk24 + +// (024) Charging - Head down +$frame charge1 charge2 charge3 charge4 charge5 charge6 charge7 charge8 +$frame charge9 charge10 charge11 charge12 + +// (036) Fall forward onto knees +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 death23 death24 +$frame death25 + +// (061) Charging - swiping arm and biting +$frame gore1 gore2 gore3 gore4 gore5 gore6 gore7 gore8 +$frame gore9 gore10 gore11 gore12 + +// (073) Stationary - howl at the moon +$frame howl1 howl2 howl3 howl4 howl5 howl6 howl7 howl8 +$frame howl9 howl10 howl11 howl12 howl13 howl14 howl15 howl16 +$frame howl17 howl18 howl19 howl20 howl21 howl22 howl23 howl24 +$frame howl25 howl26 howl27 howl28 howl29 howl30 howl31 howl32 +$frame howl33 howl34 howl35 howl36 + +// (109) Small leap/jump +$frame jump1 jump2 jump3 jump4 jump5 jump6 jump7 jump8 +$frame jump9 jump10 jump11 jump12 jump13 jump14 jump15 jump16 +$frame jump17 jump18 jump19 jump20 jump21 jump22 jump23 jump24 + +// (133) Quick pain flinch backward +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 + +// (141) Stationary - shake head/arms +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 shake16 +$frame shake17 shake18 shake19 shake20 + +// (161) Stationary - fire projectile +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 magic13 magic14 magic15 magic16 +$frame magic17 magic18 magic19 magic20 magic21 magic22 magic23 magic24 +$frame magic25 magic26 magic27 magic28 magic29 magic30 magic31 magic32 + +// Looks terrible, not used +// (193) Slide sideways (LEFT) +// (198) Slide sideways (RIGHT) +$frame slideL1 slideL2 slideL3 slideL4 slideL5 +$frame slideR1 slideR2 slideR3 slideR4 slideR5 + +// (203) Idle/wait +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 stand20 stand21 stand22 stand23 stand24 + +// (227) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 + +//============================================================================ +void() mino_stand1 =[ $stand1, mino_stand2 ] {monster_idle_sound();ai_stand();}; +void() mino_stand2 =[ $stand3, mino_stand3 ] {ai_stand();}; +void() mino_stand3 =[ $stand5, mino_stand4 ] {ai_stand();}; +void() mino_stand4 =[ $stand7, mino_stand5 ] {ai_stand();}; +void() mino_stand5 =[ $stand9, mino_stand6 ] {ai_stand();}; +void() mino_stand6 =[ $stand11, mino_stand7 ] {ai_stand();}; +void() mino_stand7 =[ $stand13, mino_stand8 ] {ai_stand();}; +void() mino_stand8 =[ $stand15, mino_stand9 ] {ai_stand();}; +void() mino_stand9 =[ $stand17, mino_stand10 ] {ai_stand();}; +void() mino_stand10 =[ $stand19, mino_stand11 ] {ai_stand();}; +void() mino_stand11 =[ $stand21, mino_stand12 ] {ai_stand();}; +void() mino_stand12 =[ $stand23, mino_stand1 ] {ai_stand();}; + +//============================================================================ +void() mino_walk1 =[ $walk1, mino_walk2 ] {monster_idle_sound();ai_walk(12);}; +void() mino_walk2 =[ $walk3, mino_walk3 ] {ai_walk(12);}; +void() mino_walk3 =[ $walk5, mino_walk4 ] {ai_walk(9);}; +void() mino_walk4 =[ $walk7, mino_walk5 ] {ai_walk(10);monster_footstep(FALSE);}; +void() mino_walk5 =[ $walk9, mino_walk6 ] {ai_walk(4);}; +void() mino_walk6 =[ $walk11, mino_walk7 ] {ai_walk(9);}; +void() mino_walk7 =[ $walk13, mino_walk8 ] {ai_walk(12);}; +void() mino_walk8 =[ $walk15, mino_walk9 ] {ai_walk(12);}; +void() mino_walk9 =[ $walk17, mino_walk10 ] {ai_walk(9);}; +void() mino_walk10 =[ $walk19, mino_walk11 ] {ai_walk(10);monster_footstep(FALSE);}; +void() mino_walk11 =[ $walk21, mino_walk12 ] {ai_walk(4);}; +void() mino_walk12 =[ $walk23, mino_walk1 ] {ai_walk(9);}; + +//============================================================================ +// Charge/run/gore! +//============================================================================ +void() mino_run; + +void() mino_rage1 =[ $charge2, mino_rage2 ] {monster_idle_sound();ai_run(34);}; +void() mino_rage2 =[ $charge4, mino_rage3 ] {ai_run(28);monster_footstep(FALSE);}; +void() mino_rage3 =[ $charge6, mino_rage4 ] {ai_run(26);}; +void() mino_rage4 =[ $charge8, mino_rage5 ] {ai_run(34);}; +void() mino_rage5 =[ $charge10, mino_rage6 ] {ai_run(28);monster_footstep(FALSE);}; +void() mino_rage6 =[ $charge12, mino_run ] {ai_run(26);}; + +//---------------------------------------------------------------------- +void() mino_run1 =[ $walk1, mino_run2 ] {monster_idle_sound();ai_run(12);}; +void() mino_run2 =[ $walk3, mino_run3 ] {ai_run(12);}; +void() mino_run3 =[ $walk5, mino_run4 ] {ai_run(9);}; +void() mino_run4 =[ $walk7, mino_run5 ] {ai_run(10);monster_footstep(FALSE);}; +void() mino_run5 =[ $walk9, mino_run6 ] {ai_run(4);}; +void() mino_run6 =[ $walk11, mino_run7 ] {ai_run(9);}; +void() mino_run7 =[ $walk13, mino_run8 ] {ai_run(12);}; +void() mino_run8 =[ $walk15, mino_run9 ] {ai_run(12);}; +void() mino_run9 =[ $walk17, mino_run10 ] {ai_run(9);}; +void() mino_run10 =[ $walk19, mino_run11 ] {ai_run(10);monster_footstep(FALSE);}; +void() mino_run11 =[ $walk21, mino_run12 ] {ai_run(4);}; +void() mino_run12 =[ $walk23, mino_run ] {ai_run(9);}; + +//---------------------------------------------------------------------- +void() mino_run = +{ + if (self.attack_rage) mino_rage1(); + else mino_run1(); +}; + +//---------------------------------------------------------------------- +// Short howl animation to switch to rage mode +//---------------------------------------------------------------------- +void() mino_howl1 =[ $howl1, mino_howl2 ] { + sound (self, CHAN_WEAPON, "minotaur/attack1long.wav", 1, ATTN_NORM);}; +void() mino_howl2 =[ $howl3, mino_howl3 ] {}; +void() mino_howl3 =[ $howl5, mino_howl4 ] {}; +void() mino_howl4 =[ $howl7, mino_howl5 ] {}; +void() mino_howl5 =[ $howl9, mino_howl6 ] {}; +void() mino_howl6 =[ $howl19, mino_howl7 ] {}; +void() mino_howl7 =[ $howl21, mino_howl8 ] {}; +void() mino_howl8 =[ $howl23, mino_howl9 ] {}; +void() mino_howl9 =[ $howl25, mino_howl10 ] {}; +void() mino_howl10 =[ $howl27, mino_howl11 ] {}; +void() mino_howl11 =[ $howl29, mino_howl12 ] {}; +void() mino_howl12 =[ $howl31, mino_run ] {}; + +//============================================================================ +// MELEE ATTACK (claws) +//============================================================================ +void(float side) mino_claw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + ai_damagebreakable(50); // Damage any breakables + + if (!ai_checkmelee(MONAI_MELEEMINOTAUR) || !self.enemy.takedamage) { + // Melee claw miss sound + sound (self, CHAN_WEAPON, "minotaur/swipe.wav", 1, ATTN_NORM); + } + else { + // Melee claw hit sound + if (self.lefty) sound (self, CHAN_WEAPON, "minotaur/strike1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "minotaur/strike2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; + ldmg = 12 + 6*random(); + // Rage attack is once per animation frame, more deadly + if (self.attack_rage) ldmg = ldmg*2; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +// Slap LEFT - 19, 21, 23, 1, 3, 5 +// Slap RIGHT - 7, 9, 11, 13, 15, 17 +void() mino_slapL1 =[ $bwalk19, mino_slapL2 ] {ai_charge(10);monster_footstep(FALSE);}; +void() mino_slapL2 =[ $bwalk21, mino_slapL3 ] {ai_charge(4);}; +void() mino_slapL3 =[ $bwalk23, mino_slapL4 ] {ai_charge(9);}; +void() mino_slapL4 =[ $bwalk1, mino_slapL5 ] {ai_charge(12);mino_claw(-250);}; +void() mino_slapL5 =[ $bwalk3, mino_slapL6 ] {ai_charge(12);}; +void() mino_slapL6 =[ $bwalk5, mino_slapR1 ] {ai_charge(9);}; + +void() mino_slapR1 =[ $bwalk7, mino_slapR2 ] {ai_charge(10);monster_footstep(FALSE);}; +void() mino_slapR2 =[ $bwalk9, mino_slapR3 ] {ai_charge(4);}; +void() mino_slapR3 =[ $bwalk11, mino_slapR4 ] {ai_charge(9);}; +void() mino_slapR4 =[ $bwalk13, mino_slapR5 ] {ai_charge(12);mino_claw(250);}; +void() mino_slapR5 =[ $bwalk15, mino_slapR6 ] {ai_charge(12);}; +void() mino_slapR6 =[ $bwalk17, mino_run ] {ai_charge(9); + // Check if enemy is close, alive and visible before doing more melee + if (random() < 0.5 && ai_checkmelee(MONAI_MELEEMINOTAUR) && + self.enemy.health > 0 && visible(self.enemy)) self.think = mino_slapL1; +}; + +//---------------------------------------------------------------------- +// Rage melee attack +void() mino_gore1 =[ $gore2, mino_gore2 ] {ai_charge(34);}; +void() mino_gore2 =[ $gore4, mino_gore3 ] {ai_charge(28);monster_footstep(FALSE);}; +void() mino_gore3 =[ $gore6, mino_gore4 ] {ai_charge(26);mino_claw(-250);}; +void() mino_gore4 =[ $gore8, mino_gore5 ] {ai_charge(34);}; +void() mino_gore5 =[ $gore10, mino_gore6 ] {ai_charge(28);monster_footstep(FALSE);}; +void() mino_gore6 =[ $gore12, mino_run ] {ai_charge(26);}; + +//---------------------------------------------------------------------- +void() mino_melee = +{ + // Switch to a faster more deadly melee attack if in rage mode + if (self.attack_rage) mino_gore1(); + else { + // Randomly start left or right and then loop + if (random() < 0.5) mino_slapR1(); + else mino_slapL1(); + } +}; + +//============================================================================ +// JUMP ATTACK - pre-rage only +//============================================================================ +void() mino_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(30); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + + // Keep track of how many times touched the same object + if (self.jumptouch == other) self.jump_flag = time + MONAI_JUMPTIMEOUT; + self.jumptouch = other; // Keep track of touch target + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the minotaur floating in the air? + if (!checkbottom(self)) { + // Is the minotaur standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() mino_jump1 =[ $jump1, mino_jump2 ] { + self.jump_flag = time + MONAI_JUMPMINOTIME; + // Use combat idle grunt sounds (can get annoying otherwise) + if (random() < 0.5) sound (self, CHAN_VOICE, self.idle_soundcom, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_soundcom2, 1, ATTN_NORM); +}; +void() mino_jump2 =[ $jump3, mino_jump3 ] {ai_face();}; +void() mino_jump3 =[ $jump5, mino_jump4 ] {ai_face();}; +void() mino_jump4 =[ $jump7, mino_jump5 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPMINOTIME; + self.touch = mino_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 450 + '0 0 250'; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() mino_jump5 =[ $jump9, mino_jump6 ] {ai_face();}; +void() mino_jump6 =[ $jump11, mino_jump7 ] {}; +void() mino_jump7 =[ $jump13, mino_jump8 ] {ai_face();}; +void() mino_jump8 =[ $jump15, mino_jump8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = mino_jump4; // Keep jumping + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() mino_jump10 =[ $jump19, mino_jump12 ] {ai_charge(8);monster_footstep(FALSE);}; +void() mino_jump12 =[ $jump23, mino_run ] {ai_charge(10);ai_resetangles(); + // If close enough start melee ELSE return to run cycle + if (ai_checkmelee(MONAI_MELEEMINOTAUR) && self.enemy.health > 0) + self.think = mino_melee; +}; + +//============================================================================ +// RANGE ATTACK - Plasma Bolts (rocket) +//============================================================================ +void() minotaur_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_MBALL; + } + if (!self.attachment2) { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_ATTACHMENT; + self.attachment2.mdl = MODEL_PROJ_MBALL; + } +}; + +//---------------------------------------------------------------------- +void() minotaur_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } + if (self.attachment2) { + setmodel(self.attachment2, ""); + self.attachment2.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() minotaur_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } + if (self.attachment2) { + self.attachment2.think = SUB_Remove; + self.attachment2.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void(entity handent, vector orgofs, float dbframe) minotaur_handball = +{ + local vector org; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + handent.state = STATE_ON; + setorigin(handent, self.origin); + setmodel(handent, handent.mdl); + setsize (handent, VEC_ORIGIN, VEC_ORIGIN); + handent.movetype = MOVETYPE_NONE; + handent.solid = SOLID_NOT; + handent.skin = self.exactskin; + handent.alpha = 0.85; + } + + // Generate attachment in hand (left) + // makevectors set in previous function (minotaur_hands) + org = self.origin + attack_vector(orgofs); + setorigin(handent, org); + handent.angles_y = rint(random()*359); + handent.frame = dbframe; +}; + +//---------------------------------------------------------------------- +// There is a ball for each hand with different origins +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float dbframe) minotaur_hands = +{ + if (self.health < 1) return; + + // Keep turning towards enemy + ai_face(); + makevectors(self.angles); + + // Generate a ball in each hand + minotaur_handball(self.attachment, leftofs, dbframe); + minotaur_handball(self.attachment2, rightofs, dbframe); +}; + +//---------------------------------------------------------------------- +// Fire a volley of plasma/poison bolts at the enemy +//---------------------------------------------------------------------- +void(vector orgofs, float angofs) minotaur_fire = +{ + local vector org, angvec, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_MINOBOLT + (skill * SPEED_MINOSKILL); + makevectors(self.angles); + org = self.origin + attack_vector(orgofs); + dir = (self.enemy.origin - org) + (v_right*(angofs*30)); + dir = normalize (dir); + + // The spawning minotaur has poison spikes instead + if (self.spawnflags & MON_MINOTAUR_MINIONS) + launch_projectile(org, dir, CT_PROJ_MPOISON, self.attack_speed); + else { + // Projectile behaves like plasma (light/trail/impact effects) + // The correct projectile model is switched in launch function + launch_plasma(org, dir, CT_MONMINOTAUR, self.attack_speed); + } +}; + +//---------------------------------------------------------------------- +// Main projectile plasma/poison attack of both types of minotaur +//---------------------------------------------------------------------- +void() mino_magic1 =[ $magic1, mino_magic2 ] {ai_face(); + if (random() < 3) sound (self, CHAN_BODY, "minotaur/attack1start.wav", 1, ATTN_NORM);}; +void() mino_magic2 =[ $magic3, mino_magic3 ] {minotaur_hands('34 0 44','-20 30 20',0);}; +void() mino_magic3 =[ $magic5, mino_magic4 ] {minotaur_hands('30 -12 64','-20 44 28',1);}; +void() mino_magic4 =[ $magic7, mino_magic5 ] {minotaur_hands('15 -16 88','-10 56 48',2);}; +void() mino_magic5 =[ $magic9, mino_magic6 ] {minotaur_hands('0 -40 80','-10 48 76',3);}; +void() mino_magic6 =[ $magic11, mino_magic7 ] {minotaur_hands('16 -36 72','-12 44 80',4);}; +void() mino_magic7 =[ $magic13, mino_magic8 ] {minotaur_hands('36 -20 56','24 32 68',5);}; + +void() mino_magic8 =[ $magic15, mino_magic9 ] { + sound (self, CHAN_WEAPON, "minotaur/bolt_fire.wav", 1, ATTN_NORM); + minotaur_hands('40 -3 46','40 1 44',6);minotaur_fire('40 0 45',-2);}; +void() mino_magic9 =[ $magic17, mino_magic10 ] {ai_back(8); + minotaur_hands('32 -2 44','32 2 44',5);minotaur_fire('32 0 44',-1);}; +void() mino_magic10 =[ $magic19, mino_magic11 ] {ai_back(4); + minotaur_hands('20 0 48','20 2 46',4);minotaur_fire('20 0 47',0);}; +void() mino_magic11 =[ $magic21, mino_magic12 ] {ai_forward(4);monster_footstep(FALSE); + minotaur_hands('28 0 50','28 2 48',3);minotaur_fire('28 0 49',1);}; +void() mino_magic12 =[ $magic23, mino_magic13 ] {ai_forward(8); + minotaur_hands('44 0 46','44 2 44',2);minotaur_fire('44 0 45',2);}; + +void() mino_magic13 =[ $magic25, mino_magic14 ] { + // Remove hand attachments and setup particle explosion + // Create a cloud of particles which slowly raise upwards + minotaur_finish_attachment(); + ai_face(); + makevectors(self.angles); + self.finalangle = self.origin + (v_forward * 44) + (v_up * 32); + // Spawn a mist of blue/green particles where projectiles came from + particle_explode(self.finalangle, 50, 3, self.part_style, PARTICLE_BURST_MINOTAUR); + // Random chance of final growl at player + if (random() < 0.3) sound (self, CHAN_BODY, "minotaur/attack1end.wav", 1, ATTN_NORM); +}; +void() mino_magic14 =[ $magic27, mino_magic15 ] {}; +void() mino_magic15 =[ $magic29, mino_magic16 ] {ai_face();}; +void() mino_magic16 =[ $magic31, mino_run ] {ai_face();}; + +//---------------------------------------------------------------------- +// Spawn particles from body that float upwards during summons +//---------------------------------------------------------------------- +void() mino_sumeffect = +{ particle_debuff(self.origin+'0 0 64', 16, rint(4+random()*4), PARTICLE_BURST_GREEN);}; + +//---------------------------------------------------------------------- +// Display a green ball where the gargoyle is spawning +//---------------------------------------------------------------------- +void(float dbframe) mino_sumball = +{ + // Double check the space checks worked + if (self.aflag == FALSE) return; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.pos2); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = self.exactskin; + } + + // rotate and fade the ball as it grows + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = dbframe; + self.attachment.lip = 0.3 + ((7-dbframe) * 0.1); + self.attachment.alpha = self.attachment.lip; + particle_explode(self.pos2, 5+random()*10, 3, self.part_style, PARTICLE_BURST_MINOTAUR); +}; + +//---------------------------------------------------------------------- +// Raise up head and howl at the sky and spawn green particles from body +// Always check if there is space to spawn a gargoyle first +// Block monster pain function so that the summons is completed +//---------------------------------------------------------------------- +void() mino_summon1 =[ $howl1, mino_summon2 ] {ai_face();self.pain_finished = time + 2;}; +void() mino_summon2 =[ $howl3, mino_summon3 ] {ai_face();}; +void() mino_summon3 =[ $howl5, mino_summon4 ] {ai_face();mino_sumeffect(); + sound (self, CHAN_BODY, "minotaur/attack1long.wav", 1, ATTN_NORM);}; +void() mino_summon4 =[ $howl7, mino_summon5 ] {mino_sumeffect();}; +void() mino_summon5 =[ $howl9, mino_summon6 ] {mino_sumeffect();}; +void() mino_summon6 =[ $howl11, mino_summon7 ] {mino_sumeffect();}; +void() mino_summon7 =[ $howl13, mino_summon8 ] {mino_sumeffect(); + // Find out if there is enough space to spawn a gargoyle + // Findradius version + makevectors(self.angles); + self.pos1 = self.origin + self.view_ofs + v_forward*64 + v_up*32; + self.aflag = find_minionspace(self.pos1); + + // If the spawn locaiton all clear, spawn something! + if (self.aflag == TRUE) { + minion_gargoyle(self.pos1, self.enemy); + self.pos2 = self.pos1 - '0 0 16'; // Origin of gargoyle + mino_sumball(0); + } +}; +void() mino_summon8 =[ $howl15, mino_summon9 ] {mino_sumeffect();mino_sumball(1);}; +void() mino_summon9 =[ $howl17, mino_summon10 ] {mino_sumeffect();mino_sumball(2);}; +void() mino_summon10 =[ $howl19, mino_summon11 ] {mino_sumeffect();mino_sumball(3);}; +void() mino_summon11 =[ $howl21, mino_summon12 ] {mino_sumeffect();mino_sumball(4);}; +void() mino_summon12 =[ $howl23, mino_summon13 ] {mino_sumeffect();mino_sumball(5);}; +void() mino_summon13 =[ $howl25, mino_summon14 ] {mino_sumeffect();mino_sumball(6);}; +void() mino_summon14 =[ $howl27, mino_summon15 ] {mino_sumeffect();mino_sumball(7);}; +void() mino_summon15 =[ $howl29, mino_summon16 ] {minotaur_finish_attachment(); + if (self.aflag == TRUE) particle_explode(self.pos1, 50, 3, self.part_style, PARTICLE_BURST_MINOTAUR);}; +void() mino_summon16 =[ $howl31, mino_summon17 ] {}; +void() mino_summon17 =[ $howl33, mino_summon18 ] {ai_face();}; +void() mino_summon18 =[ $howl35, mino_run ] {ai_face();SUB_AttackFinished (1 + 2*random());}; + +//---------------------------------------------------------------------- +// Both type of minotaurs go through the same magic function +//---------------------------------------------------------------------- +void() mino_magic = +{ + local entity miniondef; + + // Make sure the attachments are setup ready + minotaur_create_attachment(); + + if (self.spawnflags & MON_MINOTAUR_MINIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_minotaurminion"); + if (miniondef.classtype == CT_CACHEGARGOYLE) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[MINOTAUR]\b Cannot find minion template!\n"); + self.spawnflags = self.spawnflags - MON_MINOTAUR_MINIONS; + } + } + + // Is the target the player or monster? + if (self.enemy.flags & FL_CLIENT) { + if (self.spawnflags & MON_MINOTAUR_MINIONS) { + // has the gargoyle limit been reached? + if (query_minionactive(self) == TRUE) mino_summon1(); + else { + if (self.minion_baseattack > 0 ) mino_magic1(); + else mino_run(); + } + } + // White Minotaur attacks with plasma + else mino_magic1(); + + } + // Always attack monsters with plasma/poison projectiles + else mino_magic1(); +}; + +//============================================================================ +// CHARGE ATTACK - just been hit with a long pain animation (pre-rage only) +//============================================================================ +void(float dist) mino_chargecheck = +{ + // turn, face and pursue enemy + ai_charge(dist); + // Close enough for melee combat? + if (ai_checkmelee(MONAI_MELEEMINOTAUR)) self.th_melee(); + // Enemy dead? run out of stamina or enemy not infront? + if (self.enemy.health < 1) self.think = mino_run; + else if (self.attack_finished < time) self.think = mino_run; + else if (!infront(self.enemy)) self.think = mino_run; +}; + +//---------------------------------------------------------------------- +void() mino_charge1 =[ $charge1, mino_charge2 ] {mino_chargecheck(34);}; +void() mino_charge2 =[ $charge3, mino_charge3 ] {mino_chargecheck(28);monster_footstep(FALSE);}; +void() mino_charge3 =[ $charge5, mino_charge4 ] {mino_chargecheck(26);}; +void() mino_charge4 =[ $charge7, mino_charge5 ] {mino_chargecheck(34);}; +void() mino_charge5 =[ $charge9, mino_charge6 ] {mino_chargecheck(28);monster_footstep(FALSE);}; +void() mino_charge6 =[ $charge11, mino_charge1 ] {mino_chargecheck(26);}; + +//---------------------------------------------------------------------- +void() mino_charge = +{ + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.attack_finished = time + 2 + random(); + mino_charge1(); +}; + +//============================================================================ +// (133) Quick pain flinch backward +void() mino_pain1 = [ $pain1, mino_pain2 ] {}; +void() mino_pain2 = [ $pain2, mino_pain3 ] {}; +void() mino_pain3 = [ $pain3, mino_pain4 ] {}; +void() mino_pain4 = [ $pain4, mino_pain5 ] {}; +void() mino_pain5 = [ $pain5, mino_pain6 ] {}; +void() mino_pain6 = [ $pain6, mino_pain7 ] {}; +void() mino_pain7 = [ $pain7, mino_pain8 ] {}; +void() mino_pain8 = [ $pain8, mino_run ] {}; + +//---------------------------------------------------------------------- +// (141) Stationary - shake head/arms +// Block the pain and then start charging like crazy +void() mino_shake1 = [ $shake1, mino_shake2 ] {self.pain_finished = time + 2;}; +void() mino_shake2 = [ $shake3, mino_shake3 ] {}; +void() mino_shake3 = [ $shake5, mino_shake4 ] {}; +void() mino_shake4 = [ $shake7, mino_shake5 ] {}; +void() mino_shake5 = [ $shake9, mino_shake6 ] {}; +void() mino_shake6 = [ $shake11, mino_shake7 ] {}; +void() mino_shake7 = [ $shake13, mino_shake8 ] {}; +void() mino_shake8 = [ $shake15, mino_shake9 ] {}; +void() mino_shake9 = [ $shake17, mino_shake10 ] {}; +void() mino_shake10 = [ $shake19, mino_run ] { + // If pre-rage and can see enemy, start chasing + if (self.attack_rage == FALSE && infront(self.enemy)) self.think = mino_charge; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) mino_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + minotaur_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random(); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Minion spawning minotaur always goes short pain cycle + if (self.spawnflags & MON_MINOTAUR_MINIONS) mino_pain1(); + else { + if (self.lip < 0.4) mino_pain1(); + else mino_shake1(); + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.8; + self.axhitme = 0; + mino_pain1(); + } + } +}; + +//============================================================================ +void() mino_death1 = [ $death1, mino_death2 ] {}; +void() mino_death2 = [ $death3, mino_death3 ] {ai_forward(2);monster_check_gib();}; +void() mino_death3 = [ $death5, mino_death4 ] {ai_forward(4);monster_check_gib(); +self.solid = SOLID_NOT;}; +void() mino_death4 = [ $death7, mino_death5 ] {ai_forward(8);}; +void() mino_death5 = [ $death9, mino_death6 ] {ai_forward(10);}; +void() mino_death6 = [ $death11, mino_death7 ] {ai_forward(11);}; +void() mino_death7 = [ $death13, mino_death8 ] {ai_forward(11);}; +void() mino_death8 = [ $death15, mino_death9 ] {ai_forward(10);}; +void() mino_death9 = [ $death17, mino_death10 ] {ai_forward(8);}; +void() mino_death10 = [ $death19, mino_death11 ] {ai_forward(4);}; +void() mino_death11 = [ $death21, mino_death12 ] {ai_forward(7);}; +void() mino_death12 = [ $death23, mino_death13 ] {ai_forward(4);}; +void() mino_death13 = [ $death25, mino_death14 ] {monster_death_postcheck();}; +void() mino_death14 = [ $death25, mino_death14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() mino_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + minotaur_remove_attachment(); + //delete_minionspace(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "minotaur/death.wav", 1, ATTN_NORM); + mino_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_minotaur (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_minotaur = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_minotaur.mdl"; + self.headmdl = "progs/h_minotaur.mdl"; // Large head + self.gib1mdl = "progs/gib_minoclaw1.mdl"; // Left claw + self.gib2mdl = "progs/gib_minoclaw2.mdl"; // Right claw + self.gib3mdl = "progs/gib_minoleg1.mdl"; // foot + self.gib4mdl = "progs/gib_minoleg2.mdl"; // foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_MBALL); // Creating attachment + precache_model (MODEL_PROJ_MPLASMA); // Plasma bolt + precache_model (MODEL_PROJ_MPOISON); // Poison bolt + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // Randomly swap claws and legs around + self.lip = random(); + if (self.lip < 0.25) self.gib1mdl = self.gib4mdl; + else if (self.lip < 0.5) self.gib2mdl = self.gib4mdl; + else if (self.lip < 0.75) self.gib3mdl = self.gib4mdl; + + self.idle_sound = "minotaur/idle1.wav"; + self.idle_sound2 = "minotaur/idle2.wav"; + self.idle_soundcom = "minotaur/idle1com.wav"; + self.idle_soundcom2 = "minotaur/idle2com.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + precache_sound ("minotaur/swipe.wav"); // claw misses + precache_sound ("minotaur/strike1.wav"); // claw hit1 + precache_sound ("minotaur/strike2.wav"); // claw hit2 + + precache_sound ("minotaur/attack1start.wav"); // Short roar + precache_sound ("minotaur/attack1end.wav"); // Short roar + precache_sound ("minotaur/attack1long.wav"); // Enter rage mode + precache_sound ("minotaur/bolt_fire.wav"); // fire projectile + precache_sound (SOUND_PLASMA_HIT); // impact sounds + + precache_sound ("minotaur/death.wav"); + self.pain_sound = "minotaur/pain1.wav"; + self.pain_sound2 = "minotaur/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.sight_sound = "minotaur/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 500; + self.gibhealth = -60; // Same as Shambler + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // Demon level + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // Does not repeat pain + // Double damage to other monsters + if (!self.infightextra) self.infightextra = 2; + self.steptype = FS_TYPELARGE; // Giant sound + self.blockudeath = TRUE; // No humanoid death + self.part_style = PARTICLE_BURST_BLUE; + self.poisonous = FALSE; // blue ver = Always poison free + self.deathstring = " was gored by a Minotaur\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 0.5; + self.reflectlightning = TRUE; // Reflect lightning strikes + self.reflectplasma = TRUE; // Reflect plasma projectiles + + self.th_checkattack = MinotaurCheckAttack; + self.th_stand = mino_stand1; + self.th_walk = mino_walk1; + self.th_run = mino_run; + self.th_melee = mino_melee; + self.th_missile = mino_magic; + self.th_pain = mino_pain; + self.th_die = mino_die; + self.th_jump = mino_jump1; + self.th_jumpexit = mino_jump10; + self.th_charge = mino_howl1; + + self.classtype = CT_MONMINOTAUR; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + // Special darker version for gargoyle spawner + // Update all gib models and set poison debuff + if (self.spawnflags & MON_MINOTAUR_MINIONS) { + self.poisonous = TRUE; // darker ver = Always poisonous + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + self.exactskin = 1; // Black skin + yellow eyes + self.gib1skin = self.gib2skin = self.gib3skin = 1; + self.part_style = PARTICLE_BURST_GREEN; + // Reduce minions down to 3, gargoyles are tougher to kill + if (!self.minion_maxcount) self.minion_maxcount = 3; + } + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_ogre.qc b/QC_other/QC_arcane/mon_ogre.qc new file mode 100644 index 00000000..02d2ac29 --- /dev/null +++ b/QC_other/QC_arcane/mon_ogre.qc @@ -0,0 +1,831 @@ +/*============================================================================== +OGRE +==============================================================================*/ + +$cd id1/models/ogre_c +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame painb1 painb2 painb3 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 paind14 paind15 paind16 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 death12 +$frame death13 death14 + +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 + + +//====================================================================== +void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();}; +void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();}; +void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();}; +void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();}; +void() ogre_stand5 =[ $stand5, ogre_stand6 ] {monster_idle_sound(); ai_stand();}; +void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();}; +void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();}; +void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();}; +void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();}; + +//====================================================================== +void() ogre_walk1 =[ $walk1, ogre_walk2 ] {monster_footstep(FALSE); ai_walk(3);}; +void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);}; +void() ogre_walk3 =[ $walk3, ogre_walk4 ] {monster_idle_sound(); ai_walk(2);}; +void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);}; +void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);}; +void() ogre_walk6 =[ $walk6, ogre_walk7 ] {ai_walk(5); +if (random() < 0.1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);}; +void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);}; +void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);}; +void() ogre_walk9 =[ $walk9, ogre_walk10 ] {monster_footstep(FALSE); ai_walk(3);}; +void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);}; +void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);}; +void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);}; +void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);}; +void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);}; +void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);}; +void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);}; + +//====================================================================== +void() ogre_run1 =[ $run1, ogre_run2 ] {monster_idle_sound(); ai_run(9);}; +void() ogre_run2 =[ $run2, ogre_run3 ] {monster_footstep(FALSE);ai_run(12);}; +void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);}; +void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);}; +void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);}; +void() ogre_run6 =[ $run6, ogre_run7 ] {monster_footstep(FALSE);ai_run(4);}; +void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);}; +void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);}; + +/*====================================================================== + MELEE - Chainsaw +======================================================================*/ +void(float side, float dmgmultipler) chainsaw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_damagebreakable(20); // Damage any breakables + if (!ai_checkmelee(self.meleerange)) return; // Too far away + + // Can the target bleed? - generate blood + if (!CanDamage (self.enemy, self)) return; + + // Damage 1-12 + ldmg = (random() + random() + random()) * (4*dmgmultipler); + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + SpawnMeatSpray (self, self.enemy, side); +}; + +//---------------------------------------------------------------------- +void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11);}; +void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);}; +void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);}; +void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);}; +void() ogre_swing5 =[ $swing5, ogre_swing6 ] {monster_footstep(FALSE); + ai_charge(9); chainsaw(0,1);self.angles_y = self.angles_y + random()*25;}; +void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);}; +void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);}; +void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);}; + +//---------------------------------------------------------------------- +void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6);}; +void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);}; +void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);}; +void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);}; +void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);}; +void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0,1);}; +void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0,1);}; +void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0,1);}; +void() ogre_smash9 =[ $smash9, ogre_smash10 ] {monster_footstep(FALSE); ai_charge(13); chainsaw(0,1);}; +void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1,1);}; +void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0,1); +self.nextthink = self.nextthink + random()*0.2;}; // slight variation +void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge(0);}; +void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);}; +void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);}; + +//---------------------------------------------------------------------- +void() ogre_melee = +{ + sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + if (random() > 0.5) ogre_smash1 (); + else ogre_swing1 (); +}; + +/*====================================================================== + Range - Grenades (uses generic attack function in projectiles.qc) + Nail - Alternative firemode (based on nail ogre from Marcher Fortress) +======================================================================*/ +void() OgreFireNails = +{ + local vector org, dir, vec; + local float loopvar; + + // Check for death? + if (self.health < 1) return; + loopvar = 0; + + // Light up face, setup projectile speed and play fire sound + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_NAILOGREPROJ + (skill * SPEED_NAILOGRESKILL); + sound(self, CHAN_WEAPON, "ogre/nail_fire.wav", 1, ATTN_NORM); + + // turn and face your enemy! + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Loop through the nail burst (all at once) + while (loopvar < self.attack_count) { + // Random circle spread pattern + vec = (crandom()*20)*v_right + (crandom()*20)*v_up; + dir = normalize((self.enemy.origin + vec) - org); + // Generate a red hot nail projectile + launch_projectile(org, dir, CT_PROJ_MONNG, self.attack_speed); + loopvar = loopvar + 1; + } +}; + +//---------------------------------------------------------------------- +void() ogre_shoot1 =[ $shoot1, ogre_shoot2 ] { + ai_face(); + MonsterGrenadeSound(); + self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); +}; +void() ogre_shoot2 =[ $shoot2, ogre_shoot3 ] { + ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); +}; +void() ogre_shoot3 =[ $shoot2, ogre_shoot4 ] { + ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); +}; +void() ogre_shoot4 =[ $shoot3, ogre_shoot5 ] { + ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin); +}; +void() ogre_shoot5 =[ $shoot4, ogre_shoot6 ] {}; +void() ogre_shoot6 =[ $shoot5, ogre_shoot7 ] {}; +void() ogre_shoot7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();}; +void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();}; +void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();}; +void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireNails();}; +void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {}; +void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {}; +void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +//====================================================================== +// Lots of different pain animations (falling over is a classic +//====================================================================== +void() ogre_pain1 =[ $pain1, ogre_pain2 ] {}; +void() ogre_pain2 =[ $pain2, ogre_pain3 ] {}; +void() ogre_pain3 =[ $pain3, ogre_pain4 ] {}; +void() ogre_pain4 =[ $pain4, ogre_pain5 ] {}; +void() ogre_pain5 =[ $pain5, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_painb1 =[ $painb1, ogre_painb2 ] {}; +void() ogre_painb2 =[ $painb2, ogre_painb3 ] {}; +void() ogre_painb3 =[ $painb3, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_painc1 =[ $painc1, ogre_painc2 ] {}; +void() ogre_painc2 =[ $painc2, ogre_painc3 ] {}; +void() ogre_painc3 =[ $painc3, ogre_painc4 ] {}; +void() ogre_painc4 =[ $painc4, ogre_painc5 ] {}; +void() ogre_painc5 =[ $painc5, ogre_painc6 ] {}; +void() ogre_painc6 =[ $painc6, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_paind1 =[ $paind1, ogre_paind2 ] {}; +void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);}; +void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);}; +void() ogre_paind4 =[ $paind4, ogre_paind5 ] {monster_footstep(FALSE);ai_pain(4);}; +void() ogre_paind5 =[ $paind5, ogre_paind6 ] {}; +void() ogre_paind6 =[ $paind6, ogre_paind7 ] {}; +void() ogre_paind7 =[ $paind7, ogre_paind8 ] {}; +void() ogre_paind8 =[ $paind8, ogre_paind9 ] {}; +void() ogre_paind9 =[ $paind9, ogre_paind10 ] {}; +void() ogre_paind10=[ $paind10, ogre_paind11 ] {monster_footstep(FALSE);}; +void() ogre_paind11=[ $paind11, ogre_paind12 ] {}; +void() ogre_paind12=[ $paind12, ogre_paind13 ] {monster_footstep(FALSE);}; +void() ogre_paind13=[ $paind13, ogre_paind14 ] {}; +void() ogre_paind14=[ $paind14, ogre_paind15 ] {}; +void() ogre_paind15=[ $paind15, ogre_paind16 ] {}; +void() ogre_paind16=[ $paind16, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_paine1 =[ $paine1, ogre_paine2 ] {}; +void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);}; +void() ogre_paine3 =[ $paine3, ogre_paine4 ] {monster_footstep(FALSE);ai_pain(9);}; +void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);}; +void() ogre_paine5 =[ $paine5, ogre_paine6 ] {}; +void() ogre_paine6 =[ $paine6, ogre_paine7 ] {}; +void() ogre_paine7 =[ $paine7, ogre_paine8 ] {}; +void() ogre_paine8 =[ $paine8, ogre_paine9 ] {}; +void() ogre_paine9 =[ $paine9, ogre_paine10 ] {}; +void() ogre_paine10=[ $paine10, ogre_paine11 ] {}; +void() ogre_paine11=[ $paine11, ogre_paine12 ] {}; +void() ogre_paine12=[ $paine12, ogre_paine13 ] {}; +void() ogre_paine13=[ $paine13, ogre_paine14 ] {}; +void() ogre_paine14=[ $paine14, ogre_paine15 ] {}; +void() ogre_paine15=[ $paine15, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) ogre_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.25) ogre_pain1 (); + else if (self.lip < 0.5) ogre_painb1 (); + else if (self.lip < 0.75) ogre_painc1 (); + else if (self.lip < 0.88) { + // Fall down to the ground + ogre_paind1 (); + self.pain_finished = time + 2; + } + else { + // Stagger backwards + ogre_paine1 (); + self.pain_finished = time + 2; + } + } + if (self.pain_check == 2) { + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.6; + ogre_paind1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.5; + ogre_paine1 (); // Stagger backwards + } + } + } +}; + +//====================================================================== +// DIE Ogre DIE!?! +//====================================================================== +void() ogre_die1 =[ $death1, ogre_die2 ] {}; +void() ogre_die2 =[ $death2, ogre_die3 ] {monster_check_gib();}; +void() ogre_die3 =[ $death3, ogre_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() ogre_die4 =[ $death4, ogre_die5 ] {}; +void() ogre_die5 =[ $death5, ogre_die6 ] {}; +void() ogre_die6 =[ $death6, ogre_die7 ] {}; +void() ogre_die7 =[ $death7, ogre_die8 ] {}; +void() ogre_die8 =[ $death8, ogre_die9 ] {}; +void() ogre_die9 =[ $death9, ogre_die10 ] {}; +void() ogre_die10 =[ $death10, ogre_die11 ] {}; +void() ogre_die11 =[ $death11, ogre_die12 ] {}; +void() ogre_die12 =[ $death12, ogre_die13 ] {}; +void() ogre_die13 =[ $death13, ogre_die14 ] {monster_death_postcheck();}; +void() ogre_die14 =[ $death14, ogre_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {}; +void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {monster_check_gib();ai_forward(5);}; +void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);}; +void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);}; +void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);}; +void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);}; +void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {}; +void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {monster_death_postcheck();}; +void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() ogre_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + self.lip = random(); + if (self.lip < 0.5) ogre_die1(); + else ogre_bdie1(); + } +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() ogre_wakeup1 =[ $smash7, ogre_wakeup2] {monster_sightsound();}; +void() ogre_wakeup2 =[ $smash6, ogre_wakeup3] {}; +void() ogre_wakeup3 =[ $smash8, ogre_wakeup4] {}; +void() ogre_wakeup4 =[ $smash9, ogre_wakeup5 ] {}; +void() ogre_wakeup5 =[ $smash10, ogre_wakeup6 ] {}; +void() ogre_wakeup6 =[ $smash11, ogre_wakeup7 ] {}; +void() ogre_wakeup7 =[ $smash12, ogre_wakeup8 ] {}; +void() ogre_wakeup8 =[ $smash13, ogre_wakeup9 ] {}; +void() ogre_wakeup9 =[ $smash14, ogre_run1 ] {}; + +//====================================================================== +// From the crazy mind of Madfox, comes fishing ogre!?! +//====================================================================== +float OGREFISH_FISHY = 0; +float OGREFISH_FISHING = 19; +float OGREFISH_CATCH = 79; +float ANIMATION_OGREFLAP = 18; +float ANIMATION_OGREFISH = 59; +float ANIMATION_OGRECATCH = 25; + +//---------------------------------------------------------------------- +// Special idle animation - Flappy the fish waggles tail +//---------------------------------------------------------------------- +void() ogre_flappyfish = +{ + // If dead, no more updates + if (self.health < 1) return; + + self.nextthink = time + 0.1; + self.frame = OGREFISH_FISHY + self.walkframe; + + // Check for special frame conditions + if (self.walkframe == 0) + sound (self, CHAN_VOICE, "ogre/ogrefish_flappy.wav", 1, ATTN_NORM); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > ANIMATION_OGREFLAP) { + self.walkframe = 0; + self.think = self.th_altstand; + } + else self.think = ogre_flappyfish; +}; + +//---------------------------------------------------------------------- +// Special idle animation - Ogre finally catches something! +//---------------------------------------------------------------------- +void() ogre_catchfish = +{ + // If dead, no more updates + if (self.health < 1) return; + + self.nextthink = time + 0.1; + self.frame = OGREFISH_CATCH + self.walkframe; + + // Check for special frame conditions + if (self.walkframe == 6) + sound (self, CHAN_VOICE, "ogre/ogrefish_out.wav", 1, ATTN_NORM); + if (self.walkframe == 24) + sound (self, CHAN_VOICE, "ogre/ogrefish_in.wav", 1, ATTN_NORM); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > ANIMATION_OGRECATCH) { + self.walkframe = 0; + self.think = self.th_altstand; + } + else self.think = ogre_catchfish; +}; + +//---------------------------------------------------------------------- +void() ogre_fishing = +{ + // If dead, no more updates + if (self.health < 1) return; + + self.idlebusy = FALSE; + self.nextthink = time + 0.1; + self.frame = OGREFISH_FISHING + self.walkframe; + + // Check for fishing idle animations + if (self.walkframe == 0) { + self.lip = random(); + // Finally caught a fish? + if (self.lip < 0.1) { + self.think = ogre_catchfish; + self.idlebusy = TRUE; + } + // Flappy the fish gasping for air + else if (self.lip < 0.2) { + self.think = ogre_flappyfish; + self.idlebusy = TRUE; + } + // Classic ogre idle + water + else if (self.lip < 0.3) + sound (self, CHAN_VOICE, "ogre/ogrefish_idle.wav", 1, ATTN_NORM); + } + + // Ghost version updates alpha and spawns particles + if (self.spawnflags & MON_GHOST_ONLY) { + // Is ogre setup invisible? + if (self.alpha < 1) { + // Wait for the ogre to get into position + if (self.respawn_time < time) { + // exponential fade in model alpha + self.alpha = self.alpha + self.lefty; + self.lefty = self.lefty + self.lefty; + if (self.alpha >= 1) self.alpha = 1; + } + } + else { + // Model is all screwed up, with loads of extra surfaces + // cannot do alpha sparkle because of back surface problem + //self.alpha = 0.5 + (0.1*random()); + self.pos1 = '0 0 0'; + self.pos1_x = crandom()*16; + self.pos1_y = crandom()*16; + self.pos1_z = crandom()*24; + if (random() < 0.5) + particle_explode(self.origin+self.pos1, 2, 1, PARTICLE_BURST_WHITE, PARTICLE_BURST_LOSTUP); + } + } + + if (self.idlebusy == FALSE) { + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > ANIMATION_OGREFISH) self.walkframe = 0; + self.think = ogre_fishing; + } +}; + +//---------------------------------------------------------------------- +// Re-using fall down pain animation +//---------------------------------------------------------------------- +void() ogre_fishd6 =[ $paind6, ogre_fishd7 ] {}; +void() ogre_fishd7 =[ $paind7, ogre_fishd8 ] {}; +void() ogre_fishd8 =[ $paind8, ogre_fishd9 ] {}; +void() ogre_fishd9 =[ $paind9, ogre_fishd10 ] {}; +void() ogre_fishd10=[ $paind10, ogre_fishd11 ] {monster_footstep(FALSE);}; +void() ogre_fishd11=[ $paind11, ogre_fishd12 ] {}; +void() ogre_fishd12=[ $paind12, ogre_fishd13 ] {monster_footstep(FALSE);}; +void() ogre_fishd13=[ $paind13, ogre_fishd14 ] {}; +void() ogre_fishd14=[ $paind14, ogre_fishd15 ] {}; +void() ogre_fishd15=[ $paind15, ogre_fishd16 ] {}; +void() ogre_fishd16=[ $paind16, ogre_run1 ] { + // Restore pain/damage functionality + self.flags = self.flags | FL_MONSTER; + self.health = self.max_health; + + // Fishing ogre is wearing a grenade bounce shirt! + self.takedamage = DAMAGE_YES; + self.noradiusdmg = FALSE; + self.use = monster_use; + + // Does not feel much pain and attacks more often + self.pain_flinch = 200; + self.pain_timeout = 3; + + // Restore animation/game logic + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_melee = ogre_melee; + self.th_missile = ogre_shoot1; + self.th_pain = ogre_pain; + self.th_die = ogre_die; +}; + +//---------------------------------------------------------------------- +void() ogre_fishwakeup = { + self.use = SUB_Null; // Stop re-triggering + monster_sightsound(); // Classic wakeup sound + + // Make sure no more pain or damage + self.takedamage = DAMAGE_NO; + self.pain_finished = time + 2; + + // Check for model in original ogre position + // This is to save the space for the returning ogre + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + } + + // Check for any wakeup triggers + if (self.target2 != "") { + trigger_strs(self.target2, self); + self.target2 = ""; + } + + // Shift ogre into pain (on floor) state + setmodel(self, self.mdl); + self.frame = $paind6; // Has to be set after model change + setorigin(self, self.pos1); + setsize (self, self.bbmins, self.bbmaxs); + ogre_fishd6(); +}; + +//---------------------------------------------------------------------- +void(entity inf, entity att, float dam) ogre_fishpain = {ogre_fishwakeup();}; +void() ogre_fishdie = {}; + +//---------------------------------------------------------------------- +void() ogre_fishsetup = +{ + // Setup ghost version (no pain or death) + if (self.spawnflags & MON_GHOST_ONLY) { + self.respawn_time = time + 0.3; // Wait to get into position + self.lefty = 0.01; // Exponential increase + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.takedamage = DAMAGE_NO; + self.noradiusdmg = TRUE; + self.gibhealth = MON_NEVERGIB; + self.health = LARGE_TIMER; + self.use = SUB_Null; + } + else { + // Take direct damage only and grenades bounce! + self.takedamage = DAMAGE_YES; + self.noradiusdmg = TRUE; + self.health = MEGADEATH; + self.use = ogre_fishwakeup; + + // Create a temporary entity to fill up space behind ogre + // Prevent anthing getting in the way when ogre wakes up + if (!self.attachment) { + self.attachment = spawn(); + setmodel(self.attachment, MODEL_EMPTY); + setorigin(self.attachment, self.origin); + setsize (self.attachment, self.bbmins, self.bbmaxs); + self.attachment.solid = SOLID_BBOX; + self.attachment.movetype = MOVETYPE_STEP; + } + } + + setmodel(self, self.weaponglow); // Setup fishing model pose + self.pos1 = self.origin; // Save current origin for later + if (self.spawnflags & MON_GHOST_ONLY) self.skin = 2; + + // Move ogre into fishing animation position + makevectors(self.angles); + self.pos2 = self.origin + attack_vector('36 0 -24'); + setorigin(self, self.pos2); + // Got to reset bounding box after model change + setsize (self, self.bbmins, self.bbmaxs); + self.walkframe = 0; + ogre_fishing(); +}; + +/*====================================================================== + QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_ogre_precache = +{ + self.mdl = "progs/mon_ogre.mdl"; // Rogue Ogre + self.headmdl = "progs/h_ogre.mdl"; + self.gib1mdl = "progs/w_chainsaw.mdl"; // Chainsaw + self.gib2mdl = "progs/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // Randomly swap in GL instead of Chainsaw + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + self.gib4mdl = ""; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdth.wav"); + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); + + precache_sound ("ogre/ogdrag.wav"); + precache_sound ("ogre/ogsawatk.wav"); + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + // Load additional models/sounds for nail ogre + if (self.spawnflags & MON_OGRE_NAIL) { + // Default attack - red glowing nails + precache_model (MODEL_PROJ_NGRED); + precache_sound("ogre/nail_fire.wav"); + // Default amount of nails to burst fire (5x9=45dmg) + if (self.attack_count < 1) self.attack_count = 5; + } + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_GRENADEGRN); + } +}; + +//---------------------------------------------------------------------- +void() monster_ogre = +{ + if (deathmatch) { remove(self); return; } + + // Precache basic ogre models and sounds + monster_ogre_precache(); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; // Low pain flinch + self.pain_longanim = TRUE; // Can be chopped with shadow axe + self.steptype = FS_TYPESLOW; // Small sounding feet + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + self.no_zaware = TRUE; // Always NOT zware + self.attack_offset = '24 0 20'; // Run + Gun vector + if (!self.ammo_rockets) self.ammo_rockets = 2; // Default ammo drop + self.deathstring = " was destroyed by an Ogre\n"; + + // Standard ogre health 200 with green+ option + if (self.health < 1) self.health = 200; + if (self.spawnflags & MON_OGRE_GREEN) { + self.health = self.health + MON_OGRE_GRNUPG; + self.skin = 1; + } + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_melee = ogre_melee; + self.th_missile = ogre_shoot1; + self.th_pain = ogre_pain; + self.th_die = ogre_die; + self.th_wakeup = ogre_wakeup1; + + // Switch attack types + if (self.spawnflags & MON_OGRE_NAIL) self.th_missile = ogre_nail1; + else self.th_missile = ogre_shoot1; + + self.classtype = CT_MONOGRE; // Old style ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +//---------------------------------------------------------------------- +void() monster_ogre_marksman = { monster_ogre (); }; + +//---------------------------------------------------------------------- +void() monster_ogre_fishing = +{ + if (deathmatch) { remove(self); return; } + + // Precache basic ogre models and sounds + monster_ogre_precache(); + + // Extra fishing ogre precache stuff + self.weaponglow = "progs/mon_ogrefish.mdl"; + precache_model (self.weaponglow); + precache_sound ("ogre/ogrefish_out.wav"); + precache_sound ("ogre/ogrefish_in.wav"); + precache_sound ("ogre/ogrefish_idle.wav"); + precache_sound ("ogre/ogrefish_flappy.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 1; // Pain is the wakeup trigger + self.pain_longanim = FALSE; // Cannot be chopped with shadow axe + self.steptype = FS_TYPESLOW; // Small sounding feet + self.no_zaware = FALSE; // Fishing ogre has perfect aim! + self.bouncegrenade = TRUE; // Grenades bounce off! + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + self.exactskin = 0; // Skin defined by spawnflag + self.noinfighting = TRUE; // No infighting + self.pain_ignore = TRUE; // Will not wake up from monsters + self.movespeed = 0; // This is not a turret + self.frame = OGREFISH_FISHING; // Start in fishing frame + self.deathstring = " was reeled in by a Fishing Ogre\n"; + + // Remove spawnflag options not needed for this monster + self.lip = 0; + // Ghost version has unique skin, cannot have green version as well + if (self.spawnflags & MON_GHOST_ONLY) self.lip = self.lip | MON_GHOST_ONLY; + else if (self.spawnflags & MON_OGRE_GREEN) self.lip = self.lip | MON_OGRE_GREEN; + // Classic check for fx/spawn options + if (self.spawnflags & MON_SPAWN_NOGFX) self.lip = self.lip | MON_SPAWN_NOGFX; + if (self.spawnflags & MON_SPAWN_DELAY) self.lip = self.lip | MON_SPAWN_DELAY; + self.spawnflags = self.lip; + + // Special event monster has unique HP setup + if (self.spawnflags & MON_OGRE_GREEN) { + self.ammo_rockets = 6; // Tons of rockets! + self.health = 350; // Much stronger + self.skin = 1; // Green (Rogue) skin + } + else { + self.ammo_rockets = 4; // More rockets than fish! + self.health = 150; // Lower HP than regular + } + + // Fishing ogre can never uses nails, grenades only + self.spawnflags = self.spawnflags - (self.spawnflags & MON_OGRE_NAIL); + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 1; // Rocket resistance + self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = self.th_walk = self.th_run = ogre_fishsetup; + self.th_altstand = ogre_fishing; + // Setup ghost version (no pain or death) + if (self.spawnflags & MON_GHOST_ONLY) { + self.th_pain = SUB_Null_pain; + self.th_die = SUB_Null; + self.headmdl = ""; + } + else { + self.th_pain = ogre_fishpain; + self.th_die = ogre_fishdie; + } + + self.classtype = CT_MONOGREFISH; + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +} + +//---------------------------------------------------------------------- +void() monster_ogre_fishing_ghost = +{ + // Special spawnflag (code only) + self.spawnflags = self.spawnflags | MON_GHOST_ONLY; + // Always no monster count + self.nomonstercount = TRUE; + // Start model invisible (to prevent snapping) + self.alpha = 0.01; + monster_ogre_fishing(); +}; diff --git a/QC_other/QC_arcane/mon_pyro.qc b/QC_other/QC_arcane/mon_pyro.qc new file mode 100644 index 00000000..2c431f36 --- /dev/null +++ b/QC_other/QC_arcane/mon_pyro.qc @@ -0,0 +1,483 @@ +/*============================================================================= +PYRO - Originally from Rubicon2 by John Fitzgibbons +FUMIGATOR - Green/Poison version of the Pyro +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +//---------------------------------------------------------------------- +void() pyro_soundreset = +{ + //turn off flame sound + if (self.attack_finished > time) + sound (self, CHAN_WEAPON, self.noise4, 1, ATTN_NORM); + //play sound anyway to be sure the channel is silent + else sound (self, CHAN_WEAPON, SOUND_EMPTY, 0, ATTN_NORM); +}; + +//============================================================================ +void() pyro_stand1 =[ $stand1, pyro_stand2 ] {monster_idle_sound(); ai_stand();}; +void() pyro_stand2 =[ $stand2, pyro_stand3 ] {ai_stand();}; +void() pyro_stand3 =[ $stand3, pyro_stand4 ] {ai_stand();}; +void() pyro_stand4 =[ $stand4, pyro_stand5 ] {ai_stand();}; +void() pyro_stand5 =[ $stand5, pyro_stand6 ] {ai_stand();}; +void() pyro_stand6 =[ $stand6, pyro_stand7 ] {ai_stand();}; +void() pyro_stand7 =[ $stand7, pyro_stand1 ] {ai_stand();}; + +//============================================================================ +void() pyro_walk1 =[ $walk1, pyro_walk2 ] {monster_idle_sound();ai_walk(2);}; +void() pyro_walk2 =[ $walk2, pyro_walk3 ] {monster_footstep(FALSE); ai_walk(4);}; +void() pyro_walk3 =[ $walk3, pyro_walk4 ] {ai_walk(4);}; +void() pyro_walk4 =[ $walk4, pyro_walk5 ] {ai_walk(3);}; +void() pyro_walk5 =[ $walk5, pyro_walk6 ] {ai_walk(1);}; +void() pyro_walk6 =[ $walk6, pyro_walk7 ] {ai_walk(2);}; +void() pyro_walk7 =[ $walk7, pyro_walk8 ] {ai_walk(2);}; +void() pyro_walk8 =[ $walk8, pyro_walk9 ] {ai_walk(1);}; +void() pyro_walk9 =[ $walk9, pyro_walk10 ] {ai_walk(2);}; +void() pyro_walk10 =[ $walk10, pyro_walk11 ] {monster_footstep(FALSE); ai_walk(4);}; +void() pyro_walk11 =[ $walk11, pyro_walk12 ] {ai_walk(4);}; +void() pyro_walk12 =[ $walk12, pyro_walk13 ] {ai_walk(1);}; +void() pyro_walk13 =[ $walk13, pyro_walk14 ] {ai_walk(2);}; +void() pyro_walk14 =[ $walk14, pyro_walk15 ] {ai_walk(3);}; +void() pyro_walk15 =[ $walk15, pyro_walk16 ] {ai_walk(4);}; +void() pyro_walk16 =[ $walk16, pyro_walk1 ] {ai_walk(2);}; + +//============================================================================ +float pyro_RUN_SPEED = 1.5; +void() pyro_run1 =[ $run1, pyro_run2 ] {monster_idle_sound(); ai_run(18 * pyro_RUN_SPEED);}; +void() pyro_run2 =[ $run2, pyro_run3 ] {ai_run(14 * pyro_RUN_SPEED);}; +void() pyro_run3 =[ $run3, pyro_run4 ] {ai_run(7 * pyro_RUN_SPEED);}; +void() pyro_run4 =[ $run4, pyro_run5 ] {ai_run(12 * pyro_RUN_SPEED);}; +void() pyro_run5 =[ $run5, pyro_run6 ] {ai_run(14 * pyro_RUN_SPEED);}; +void() pyro_run6 =[ $run6, pyro_run7 ] {ai_run(14 * pyro_RUN_SPEED);}; +void() pyro_run7 =[ $run7, pyro_run8 ] {ai_run(7 * pyro_RUN_SPEED);}; +void() pyro_run8 =[ $run8, pyro_run1 ] {ai_run(11 * pyro_RUN_SPEED);}; + +//============================================================================ +// - Pyro enforcer (FIRE FIRE FIRE!) +//---------------------------------------------------------------------- +void() pyroflame_touch = +{ + if (other == self.owner) return; + if (other.solid == SOLID_TRIGGER) return; + if (other.health < 1) return; + if (other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + if (other.classtype == self.owner.classtype) return; // Pyro proof! + + // Stop still if hit world, carry on if burning something + if (other != world) self.velocity = self.movedir; + else self.velocity = '0 0 0'; + + // Block sprite burst from damage again + self.attack_finished = time + 1; + + // Check owner is a Pyro? + if (self.owner.classtype == CT_MONPYRO) { + // damage and debuff are same function + ApplyFireDmg(other, DAMAGE_PYROFLAME, DAMAGE_MONFLAME); + } + else { + // Can only poison the player + if (other.flags & FL_CLIENT) { + // Check if player is posioned already? + if (other.poisoned) T_Damage (other, self, self, DAMAGE_FUMPOISON, DAMARMOR); + // Make sure player is posioned + else PoisonDeBuff(other); + } + // Poison anything else (very quick death, high damage) + else T_Damage (other, self, self, DAMAGE_MONFLAME, DAMARMOR); + } +}; + +//---------------------------------------------------------------------- +void() pyroflame_think = +{ + self.cnt = self.cnt + 1; + if (self.cnt > 6) remove(self); + else { + self.frame = self.cnt; + // Randomly drift upwards and slow down forward movement + self.velocity_z = self.velocity_z + 10 + (random() * 20); + self.velocity = self.velocity - (self.movedir * 0.125); + self.nextthink = time + 0.1; + } +} + +//---------------------------------------------------------------------- +void(vector org, vector dir) pyroflame_spawn = +{ + local vector variance; + local float roll, pointc; + + newmis = spawn(); + newmis.classtype = CT_TEMPSTREAM; + newmis.classname = "PBurst"; + newmis.owner = self; + newmis.frame = newmis.cnt = 0; + + // Extra wide flame contact if fighting a monster + if (self.enemy.flags & FL_MONSTER) newmis.movetype = MOVETYPE_FLYMISSILE; + else newmis.movetype = MOVETYPE_FLY; // Standard flame size + newmis.solid = SOLID_TRIGGER; // collision, touch required + + // The Pyro and Fumigator have different flame types + // Pyro = fire, Fum = Poison + //----------------------------------------------- + if (self.classtype == CT_MONPYRO) { + // Switch particles between fire and smoke based on contents + pointc = pointcontents(self.origin); + if (pointc <= CONTENT_WATER) { + if (ext_dppart) { + // Use special DP smoke and empty sprite for collision + pointparticles(particleeffectnum(DPP_PYROFLAME2), org, dir, 1); + setmodel (newmis, SBURST_FLAMEDP); + } + else setmodel (newmis, SBURST_SMOKE); + } + else { + if (ext_dppart) { + // Use special DP flames and empty sprite for collision + pointparticles(particleeffectnum(DPP_PYROFLAME1), org, dir, 1); + setmodel (newmis, SBURST_FLAMEDP); + } + else setmodel (newmis, SBURST_FLAME); + } + } + else { + if (ext_dppart) { + // Use special DP flames and empty sprite for collision + pointparticles(particleeffectnum(DPP_PYROFLAME3), org, dir, 1); + setmodel (newmis, SBURST_POISONDP); + } + else setmodel (newmis, SBURST_POISON); + } + + setorigin (newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + // Work out forward speed (tweak based on skill level) + variance = vecrand(0,10,TRUE); // +/- 10 on all axis + newmis.attack_speed = SPEED_PYROFLAME + skill * SPEED_PYROSKILL; + newmis.movedir = (dir * newmis.attack_speed) + '0 0 -50' + variance; + newmis.velocity = newmis.movedir; + + // Roll the flames from side to side towards the target + roll = 350 + random() * 20; + newmis.angles_z = anglemod(roll); + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) newmis.effects = newmis.effects + EF_NOSHADOW; + + newmis.nextthink = time + 0.1; + newmis.think = pyroflame_think; + newmis.touch = pyroflame_touch; +}; + +//---------------------------------------------------------------------- +void() pyro_fire = +{ + local vector org, dir, targ_org; + + if (self.health < 1) return; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + // point the flames at the feet of the player + if (self.enemy.flags & FL_CLIENT) targ_org = self.enemy.origin - '0 0 20'; + else targ_org = self.enemy.origin - self.enemy.view_ofs; + dir = normalize(targ_org - self.origin); + pyroflame_spawn(org, dir); +}; + +//---------------------------------------------------------------------- +void() pyro_atk1 =[ $attack1, pyro_atk2 ] {ai_face();}; +void() pyro_atk2 =[ $attack3, pyro_atk3 ] {ai_face();}; +void() pyro_atk3 =[ $attack5, pyro_atk4 ] {ai_face(); + sound (self, CHAN_WEAPON, self.noise3, 1, ATTN_NORM); // ON + pyro_fire(); + self.attack_finished = time + 0.3; +}; +void() pyro_atk4 =[ $attack5, pyro_atk5 ] {ai_face(); + pyro_fire(); + if (self.attack_finished > time || + (range(self.enemy) == RANGE_MELEE && self.enemy.health > 0) ) + self.think = pyro_atk4; +}; +void() pyro_atk5 =[ $attack10, pyro_run1 ] {ai_face(); + sound (self, CHAN_WEAPON, self.noise4, 1, ATTN_NORM); // OFF + SUB_CheckRefire (pyro_atk1); +}; + +//============================================================================ +void() pyro_paina1 =[ $paina1, pyro_paina2 ] {}; +void() pyro_paina2 =[ $paina2, pyro_paina3 ] {}; +void() pyro_paina3 =[ $paina3, pyro_paina4 ] {}; +void() pyro_paina4 =[ $paina4, pyro_run1 ] {}; + +//---------------------------------------------------------------------- +void() pyro_painb1 =[ $painb1, pyro_painb2 ] {}; +void() pyro_painb2 =[ $painb2, pyro_painb3 ] {}; +void() pyro_painb3 =[ $painb3, pyro_painb4 ] {}; +void() pyro_painb4 =[ $painb4, pyro_painb5 ] {}; +void() pyro_painb5 =[ $painb5, pyro_run1 ] {}; + +//---------------------------------------------------------------------- +void() pyro_painc1 =[ $painc1, pyro_painc2 ] {}; +void() pyro_painc2 =[ $painc2, pyro_painc3 ] {}; +void() pyro_painc3 =[ $painc3, pyro_painc4 ] {}; +void() pyro_painc4 =[ $painc4, pyro_painc5 ] {}; +void() pyro_painc5 =[ $painc5, pyro_painc6 ] {}; +void() pyro_painc6 =[ $painc6, pyro_painc7 ] {}; +void() pyro_painc7 =[ $painc7, pyro_painc8 ] {}; +void() pyro_painc8 =[ $painc8, pyro_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) pyro_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + pyro_soundreset(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random (); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + // Not using long pain animation (need to be agile) + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (self.lip < 0.3) pyro_paina1 (); + else if (self.lip < 0.6) pyro_painb1 (); + else pyro_painc1 (); + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.8; + self.axhitme = 0; + pyro_painc1 (); + } + } +}; + +//============================================================================ +void() pyro_die1 =[ $death1, pyro_die2 ] {}; +void() pyro_die2 =[ $death2, pyro_die3 ] {monster_check_gib();}; +void() pyro_die3 =[ $death3, pyro_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() pyro_die4 =[ $death4, pyro_die5 ] {ai_forward(14);}; +void() pyro_die5 =[ $death5, pyro_die6 ] {ai_forward(2);}; +void() pyro_die6 =[ $death6, pyro_die7 ] {}; +void() pyro_die7 =[ $death7, pyro_die8 ] {}; +void() pyro_die8 =[ $death8, pyro_die9 ] {}; +void() pyro_die9 =[ $death9, pyro_die10 ] {ai_forward(3);}; +void() pyro_die10 =[ $death10, pyro_die11 ] {ai_forward(5);}; +void() pyro_die11 =[ $death11, pyro_die12 ] {ai_forward(5);}; +void() pyro_die12 =[ $death12, pyro_die13 ] {ai_forward(5);}; +void() pyro_die13 =[ $death13, pyro_die14 ] {monster_death_postcheck();}; +void() pyro_die14 =[ $death14, pyro_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() pyro_fdie1 =[ $fdeath1, pyro_fdie2 ] {}; +void() pyro_fdie2 =[ $fdeath2, pyro_fdie3 ] {monster_check_gib();}; +void() pyro_fdie3 =[ $fdeath3, pyro_fdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() pyro_fdie4 =[ $fdeath4, pyro_fdie5 ] {}; +void() pyro_fdie5 =[ $fdeath5, pyro_fdie6 ] {}; +void() pyro_fdie6 =[ $fdeath6, pyro_fdie7 ] {}; +void() pyro_fdie7 =[ $fdeath7, pyro_fdie8 ] {}; +void() pyro_fdie8 =[ $fdeath8, pyro_fdie9 ] {}; +void() pyro_fdie9 =[ $fdeath9, pyro_fdie10 ] {}; +void() pyro_fdie10 =[ $fdeath10, pyro_fdie11 ] {monster_death_postcheck();}; +void() pyro_fdie11 =[ $fdeath11, pyro_fdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() pyro_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + pyro_soundreset(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) pyro_die1 (); + else pyro_fdie1 (); + } +}; + +/*====================================================================== + QUAKED monster_pyro (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_pyro = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_pyro.mdl"; + self.headmdl = "progs/h_pyro.mdl"; + self.gib1mdl = "progs/w_enforcergun.mdl"; // Unique weapon + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + self.gib1skin = 3; + + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Extra sound/sprite assets (from Rubicon2 MOD) + self.noise3 = "enforcer/pyro_flameon.wav"; + self.noise4 = "enforcer/pyro_flameoff.wav"; + precache_sound (self.noise3); + precache_sound (self.noise4); + precache_model (SBURST_FLAME); // Flame on + precache_model (SBURST_SMOKE); // Underwater + precache_model (SBURST_FLAMEDP); // DP Collision + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 100; + self.gibhealth = -35; + self.gibbed = FALSE; + self.yaw_speed = 35; // Can turn really fast + self.pain_flinch = 100; // extremely high pain tolerance + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEHEAVY; // heavy feet + self.attack_offset = '24 8.5 16'; // End of Gun + self.ammo_shells = 4; // drops armor shards instead + if (!self.exactskin) self.randomskin = 4; + self.poisonous = FALSE; // Use Fumigator instead + self.deathstring = " was toasted by a Pyro\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = PyroCheckAttack; + self.th_stand = pyro_stand1; + self.th_walk = pyro_walk1; + self.th_run = pyro_run1; + self.th_pain = pyro_pain; + self.th_die = pyro_die; + self.th_melee = pyro_atk1; + self.th_missile = pyro_atk1; // For monster_turret function + + self.classtype = CT_MONPYRO; + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEWALK; + monster_start(); +}; + +/*====================================================================== + QUAKED monster_fumigator (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_fumigator = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_fumigator.mdl"; + self.headmdl = "progs/h_pyro.mdl"; + self.gib1mdl = "progs/w_enforcergun.mdl"; // Unique weapon + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + self.gib1sound = GIB_IMPACT_WOOD; + self.gib1skin = 4; + + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Extra sound/sprite assets (from Rubicon2 MOD) + self.noise3 = "enforcer/fum_poisonon.wav"; + self.noise4 = "enforcer/fum_poisonoff.wav"; + precache_sound (self.noise3); + precache_sound (self.noise4); + precache_model (SBURST_POISON); // Poison on + precache_model (SBURST_POISONDP); // DP Collision + + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poison gibs! + self.poisonous = TRUE; // Oh yeah! Always! + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 100; + self.gibhealth = -35; + self.gibbed = FALSE; + self.yaw_speed = 35; // Can turn really fast + self.pain_flinch = 100; // extremely high pain tolerance + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEHEAVY; // heavy feet + self.attack_offset = '24 8.5 16'; // End of Gun + self.ammo_shells = 4; // drops armor shards instead + self.no_liquiddmg = TRUE; // Immune to slime/lava + if (!self.exactskin) self.randomskin = 4; + self.deathstring = " was choked by a Fumigator\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0; + self.reflectnails = TRUE; // Reflect nail projectiles + + self.th_checkattack = PyroCheckAttack; + self.th_stand = pyro_stand1; + self.th_walk = pyro_walk1; + self.th_run = pyro_run1; + self.th_pain = pyro_pain; + self.th_die = pyro_die; + self.th_melee = pyro_atk1; + self.th_missile = pyro_atk1; // For monster_turret function + + self.classtype = CT_MONFUMIGATOR; + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEWALK; + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_scorpion.qc b/QC_other/QC_arcane/mon_scorpion.qc new file mode 100644 index 00000000..e4345b03 --- /dev/null +++ b/QC_other/QC_arcane/mon_scorpion.qc @@ -0,0 +1,534 @@ +/*============================================================================== +Scorpion (Hexen2 model by Raven Software) +==============================================================================*/ +$frame attackA1 attackA2 attackA3 attackA4 attackA5 attackA6 attackA7 +$frame attackA8 attackA9 attackA10 attackA11 attackA12 attackA13 attackA14 +$frame attackA15 attackA16 attackA17 attackA18 attackA19 attackA20 attackA21 +$frame attackA22 attackA23 attackA24 attackA25 + +$frame attackB1 attackB2 attackB3 attackB4 attackB5 attackB6 attackB7 +$frame attackB8 attackB9 attackB10 attackB11 attackB12 attackB13 attackB14 +$frame attackB15 attackB16 attackB17 attackB18 attackB19 attackB20 attackB21 +$frame attackB22 attackB23 attackB24 attackB25 attackB26 attackB27 + +$frame attackC1 attackC2 attackC3 attackC4 attackC5 attackC6 attackC7 +$frame attackC8 attackC9 attackC10 attackC11 attackC12 attackC13 attackC14 +$frame attackC15 attackC16 attackC17 attackC18 attackC19 attackC20 attackC21 +$frame attackC22 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 +$frame pain9 pain10 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame ready1 ready2 ready3 ready4 ready5 ready6 ready7 ready8 +$frame ready9 ready10 ready11 + +$frame step1 step2 step3 step4 + +$frame stop1 stop2 stop3 stop4 stop5 stop6 stop7 stop8 stop9 + +$frame wake1 wake2 wake3 wake4 wake5 wake6 wake7 wake8 +$frame wake9 wake10 wake11 wake12 wake13 wake14 wake15 wake16 +$frame wake17 wake18 wake19 wake20 wake21 wake22 wake23 wake24 +$frame wake25 wake26 wake27 wake28 wake29 wake30 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +//====================================================================== +void() pinch_idle1 =[ $ready6, pinch_idle2 ] {monster_idle_sound();ai_stand();}; +void() pinch_idle2 =[ $ready7, pinch_idle3 ] {ai_stand();}; +void() pinch_idle3 =[ $ready8, pinch_idle4 ] {ai_stand();}; +void() pinch_idle4 =[ $ready9, pinch_idle5 ] {ai_stand();}; +void() pinch_idle5 =[ $ready10, pinch_idle6 ] {ai_stand();}; +void() pinch_idle6 =[ $ready11, pinch_idle7 ] {ai_stand();}; +void() pinch_idle7 =[ $ready10, pinch_idle8 ] {ai_stand();}; +void() pinch_idle8 =[ $ready9, pinch_idle9 ] {ai_stand();}; +void() pinch_idle9 =[ $ready8, pinch_idle10 ] {ai_stand();}; +void() pinch_idle10=[ $ready7, pinch_idle1 ] {ai_stand();}; + +//====================================================================== +void() pinch_walk1 =[ $walk2, pinch_walk2 ] {monster_idle_sound();ai_walk(3);}; +void() pinch_walk2 =[ $walk4, pinch_walk3 ] {monster_footstep(FALSE); ai_walk(2);}; +void() pinch_walk3 =[ $walk6, pinch_walk4 ] {ai_walk(3);}; +void() pinch_walk4 =[ $walk8, pinch_walk5 ] {ai_walk(4);}; +void() pinch_walk5 =[ $walk10, pinch_walk6 ] {ai_walk(3);}; +void() pinch_walk6 =[ $walk12, pinch_walk7 ] {monster_footstep(FALSE); ai_walk(2);}; +void() pinch_walk7 =[ $walk14, pinch_walk8 ] {ai_walk(3);}; +void() pinch_walk8 =[ $walk16, pinch_walk1 ] {ai_walk(4);}; + +//====================================================================== +void() pinch_run1 =[ $walk1, pinch_run2 ] {monster_idle_sound();ai_run(5);}; +void() pinch_run2 =[ $walk3, pinch_run3 ] {monster_footstep(FALSE); ai_run(4);}; +void() pinch_run3 =[ $walk5, pinch_run4 ] {ai_run(5);}; +void() pinch_run4 =[ $walk7, pinch_run5 ] {ai_run(6);}; +void() pinch_run5 =[ $walk9, pinch_run6 ] {ai_run(5);}; +void() pinch_run6 =[ $walk11, pinch_run7 ] {monster_footstep(FALSE); ai_run(4);}; +void() pinch_run7 =[ $walk13, pinch_run8 ] {ai_run(5);}; +void() pinch_run8 =[ $walk15, pinch_run1 ] {ai_run(6);}; + +//====================================================================== +// BITE Melee Range +//====================================================================== +void(float side) pinch_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESCORPION)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (self.meleeattack < 1) sound(self, CHAN_WEAPON, "scorpion/clawattack1.wav", TRUE, TRUE); + else sound(self, CHAN_WEAPON, "scorpion/clawattack2.wav", TRUE, TRUE); + self.meleeattack = 1 - self.meleeattack; + + // Scorpion claw = 1-12 Damage + ldmg = (random() + random() + random()) * 4; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); +}; + +//---------------------------------------------------------------------- +void() pinch_claw1 =[ $attackB2, pinch_claw2 ] {ai_face();}; +void() pinch_claw2 =[ $attackB4, pinch_claw3 ] {ai_face();}; +void() pinch_claw3 =[ $attackB6, pinch_claw4 ] {ai_face();}; +void() pinch_claw4 =[ $attackB8, pinch_claw5 ] {pinch_melee(-100);}; +void() pinch_claw5 =[ $attackB10, pinch_claw6 ] {ai_face();}; +void() pinch_claw6 =[ $attackB12, pinch_claw7 ] {ai_face();}; +void() pinch_claw7 =[ $attackB14, pinch_claw8 ] {pinch_melee(100);}; +void() pinch_claw8 = [ $attackB16, pinch_claw9 ] {}; +void() pinch_claw9 = [ $attackB18, pinch_claw10 ] {}; +void() pinch_claw10 =[ $attackB20, pinch_run1 ] {}; + +//============================================================================ +// TAIL FUNCTION (range) +//============================================================================ +float TAILOFFSET = 8; + +//---------------------------------------------------------------------- +void() pinch_tailsound = +{ + if (self.meleeattack < 1) sound(self, CHAN_WEAPON, "scorpion/tailfire1.wav", TRUE, TRUE); + else sound(self, CHAN_WEAPON, "scorpion/tailfire2.wav", TRUE, TRUE); + self.meleeattack = 1 - self.meleeattack; +}; + +//---------------------------------------------------------------------- +void(vector tailofs) pinch_tailspike = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + pinch_tailsound(); + self.attack_speed = SPEED_SCORPTAIL + (skill * SPEED_SCORPSKILL); + makevectors(self.angles); + + // Generate spike at final animation position + org = self.origin + attack_vector(tailofs); + dir = self.enemy.origin + v_right*(TAILOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_SCORP, self.attack_speed+random()*25); + + dir = self.enemy.origin; + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_SCORP, self.attack_speed+random()*25); + + dir = self.enemy.origin - v_right*(TAILOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_SCORP, self.attack_speed+random()*25); +} + +//---------------------------------------------------------------------- +void() pinch_tail1 =[ $attackA2, pinch_tail2 ] {ai_face(); + if (self.lefty < 1) sound (self, CHAN_VOICE, "scorpion/tailattack1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "scorpion/tailattack2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; +}; +void() pinch_tail2 =[ $attackA4, pinch_tail3 ] {ai_face();}; +void() pinch_tail3 =[ $attackA6, pinch_tail4 ] {ai_face();}; +void() pinch_tail4 =[ $attackA8, pinch_tail5 ] {ai_face();}; +void() pinch_tail5 =[ $attackA10, pinch_tail6 ] {ai_face();}; +void() pinch_tail6 =[ $attackA12, pinch_tail7 ] {ai_face();pinch_tailsound();}; +void() pinch_tail7 =[ $attackA14, pinch_tail8 ] {pinch_tailspike('32 8 14');}; +void() pinch_tail8 = [ $attackA16, pinch_tail9 ] {pinch_tailsound();}; +void() pinch_tail9 = [ $attackA18, pinch_tail10 ] {ai_face();}; +void() pinch_tail10 =[ $attackA20, pinch_tail11 ] {}; +void() pinch_tail11 =[ $attackA22, pinch_run1 ] {ai_face();}; + +//============================================================================ +// JUMP FUNCTION (range) +//============================================================================ +void() pinch_jumptouch = +{ + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; //Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other scorpions with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + sound (self, CHAN_VOICE, "scorpion/jumphit.wav", 1, ATTN_NORM); + BleedDeBuff(other); + spawn_touchblood (self, self.enemy, 100); + } + + // Is the scorpion floating in the air? + if (!checkbottom(self)) { + // Is the scorpion standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() pinch_leap1 =[ $attackC1, pinch_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPSCORPTIME; + if (self.lefty < 1) sound (self, CHAN_VOICE, "scorpion/jumpattack1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "scorpion/jumpattack2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; +}; +void() pinch_leap2 =[ $attackC3, pinch_leap3 ] {ai_face(); }; +void() pinch_leap3 =[ $attackC5, pinch_leap4 ] {ai_face(); + // This is a crazy idea, throw the scorpion like a grenade! + // Using the same logic as the ogre grenade zware system + self.attack_speed = 575 + random()*50; + // Aiming the scorpion at the players head (+24 z axis) + self.pos2 = self.enemy.origin + '0 0 24'; + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.pos2, self.attack_speed); + self.pos1 = vectoangles(self.pos2 - self.origin); + self.pos1_x = -self.attack_elev; + makevectors (self.pos1); + self.velocity = v_forward * self.attack_speed; + self.jump_flag = time + MONAI_JUMPSCORPTIME; + self.touch = pinch_jumptouch; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() pinch_leap4 =[ $attackC7, pinch_leap5 ] {ai_face();}; +void() pinch_leap5 =[ $attackC8, pinch_leap6 ] {ai_face();}; +void() pinch_leap6 =[ $attackC9, pinch_leap8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = pinch_leap3; + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() pinch_leap8 =[ $attackC10, pinch_leap9 ] {ai_charge(4);}; +void() pinch_leap9 =[ $attackC11, pinch_leap10] {ai_charge(4);}; +void() pinch_leap10 =[ $attackC12, pinch_leap11] {ai_charge(4);}; +void() pinch_leap11 =[ $attackC14, pinch_leap12] {ai_charge(4);}; +void() pinch_leap12 =[ $attackC16, pinch_leap13] {ai_charge(4);}; +void() pinch_leap13 =[ $attackC18, pinch_leap14] { + if (ai_checkmelee(MONAI_MELEESCORPION) && self.enemy.health > 0) + self.think = pinch_claw2; +}; +void() pinch_leap14 =[ $attackC20, pinch_run1 ] {}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() pinch_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() pinch_grow1 = [ $grow1, pinch_grow2 ] {}; +void() pinch_grow2 = [ $grow2, pinch_grow3 ] {pinch_growangle();}; +void() pinch_grow3 = [ $grow3, pinch_grow4 ] {pinch_growangle();}; +void() pinch_grow4 = [ $grow4, pinch_grow5 ] {pinch_growangle();}; +void() pinch_grow5 = [ $grow5, pinch_grow6 ] {pinch_growangle();}; +void() pinch_grow6 = [ $grow6, pinch_grow7 ] {pinch_growangle();}; +void() pinch_grow7 = [ $grow7, pinch_grow8 ] {pinch_growangle();}; +void() pinch_grow8 = [ $grow8, pinch_grow9 ] {pinch_growangle();}; +void() pinch_grow9 = [ $grow9, pinch_grow10] {pinch_growangle();}; +void() pinch_grow10= [ $grow10, pinch_run1 ] { + // Is the scorpion stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = pinch_idle1; + self.th_walk = pinch_walk1; + self.th_run = pinch_run1; + self.th_melee = pinch_claw1; + self.th_missile = pinch_tail1; + } +}; + +//---------------------------------------------------------------------------- +void() pinch_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + pinch_grow1(); +}; + +//============================================================================ +void() pinch_painA1 =[ $pain1, pinch_painA2 ] {}; +void() pinch_painA2 =[ $pain3, pinch_painA3 ] {}; +void() pinch_painA3 =[ $pain5, pinch_painA4 ] {}; +void() pinch_painA4 =[ $pain7, pinch_painA5 ] {}; +void() pinch_painA5 =[ $pain9, pinch_run1 ] {}; + +void() pinch_painB1 =[ $pain2, pinch_painB2 ] {}; +void() pinch_painB2 =[ $pain4, pinch_painB3 ] {}; +void() pinch_painB3 =[ $pain6, pinch_painB4 ] {}; +void() pinch_painB4 =[ $pain8, pinch_painB5 ] {}; +void() pinch_painB5 =[ $pain10,pinch_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) pinch_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1 || self.pain_check == 2) { + // Different types of pain animations based on current attack + if (random() < 0.5) pinch_painA1(); + else pinch_painB1(); + } + } +}; + +//============================================================================ +void() pinch_die1 =[ $death1, pinch_die2 ] {}; +void() pinch_die2 =[ $death3, pinch_die3 ] {monster_check_gib();}; +void() pinch_die3 =[ $death5, pinch_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() pinch_die4 =[ $death7, pinch_die5 ] {}; +void() pinch_die5 =[ $death9, pinch_die6 ] {}; +void() pinch_die6 =[ $death11, pinch_die7 ] {}; +void() pinch_die7 =[ $death13, pinch_die8 ] {}; +void() pinch_die8 =[ $death15, pinch_die9 ] {}; +void() pinch_die9 =[ $death17, pinch_die10] {}; +void() pinch_die10 =[ $death19, pinch_die11] {monster_death_postcheck();}; +void() pinch_die11 =[ $death21, pinch_die11] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() pinch_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "scorpion/death1.wav", 1, ATTN_NORM); + pinch_die1(); + } +}; + +/*====================================================================== +/*QUAKED monster_scorpion (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() setup_scorpion; +void() monster_scorpion = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_scorpion.mdl"; + self.headmdl = "progs/h_scorpion.mdl"; // Front Jaws + self.gib1mdl = "progs/gib_scorpleg.mdl"; // Single Leg + self.gib2mdl = "progs/gib_scorptail.mdl"; // Tail + Sting + self.gib3mdl = "progs/gib_scorpclaw.mdl"; // Claw + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + // Random chance of 2 claws, or 2 legs + if (random() < 0.5) self.gib2mdl = self.gib3mdl; + else if (random() < 0.5) self.gib2mdl = self.gib1mdl; + + // IDLE/COMBAT and SIGHT sounds + if (self.spawnflags & MON_SCORPION_STINGER) { + self.idle_sound = "scorpion/idle1.wav"; + self.idle_sound2 = "scorpion/idle2.wav"; + self.sight_sound = "scorpion/sight1.wav"; + + precache_sound("scorpion/jumpattack1.wav"); + precache_sound("scorpion/jumpattack2.wav"); + precache_sound("scorpion/jumphit.wav"); + if (self.health < 1) self.health = 120; + self.gibhealth = -25; + self.idlemoreoften = TRUE; // More creepy idle sounds + self.exactskin = 3; // Black skin + } + else { + precache_model (MODEL_PROJ_SCORP); // Large green spike + self.idle_sound = "scorpion/warning1.wav"; + self.idle_sound2 = "scorpion/warning2.wav"; + self.sight_sound = "scorpion/hiss.wav"; + + precache_sound("scorpion/tailfire1.wav"); + precache_sound("scorpion/tailfire2.wav"); + precache_sound("scorpion/tailattack1.wav"); + precache_sound("scorpion/tailattack2.wav"); + if (self.health < 1) self.health = 80; + self.gibhealth = -20; + if (!self.exactskin) self.exactskin = rint((random()*3)-0.5); + } + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.sight_sound); + + // death/pain/attack sounds + precache_sound("scorpion/death1.wav"); + self.pain_sound = "scorpion/pain1.wav"; + self.pain_sound2 = "scorpion/pain2.wav"; + precache_sound(self.pain_sound); + precache_sound(self.pain_sound2); + + precache_sound("scorpion/clawattack1.wav"); + precache_sound("scorpion/clawattack2.wav"); + + // Cache scorpion is a special class used for precache only + if (self.classtype != CT_CACHESCORPION) setup_scorpion(); +}; + +//---------------------------------------------------------------------------- +void() monster_wraithminion2 = { + self.classtype = CT_CACHESCORPION; + monster_scorpion(); +}; + +//---------------------------------------------------------------------------- +void() setup_scorpion = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.yaw_speed = 30; // Very fast turning (def=20) + self.steptype = FS_TYPELIGHT; + self.pain_longanim = FALSE; // No long pain animation + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '32 0 10'; // Claw attack offset + self.attack_offset = '32 8 14'; // Nail attack offset + self.poisonous = FALSE; // Scorpions have bleeding debuff + self.deathstring = " was stung by a Scorpion\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = ScorpionCheckAttack; + self.th_pain = pinch_pain; + self.th_die = pinch_die; + + // Special spawning minion need to start spinning + if (self.classtype == CT_MINIONSCORPION) { + self.th_stand = self.th_walk = self.th_run = pinch_grow; + self.th_melee = self.th_missile = SUB_Null; + } + else { + self.th_stand = pinch_idle1; + self.th_walk = pinch_walk1; + self.th_run = pinch_run1; + self.th_melee = pinch_claw1; + // Black stinger jumps and regulars range attack + if (self.spawnflags & MON_SCORPION_STINGER) { + self.th_jump = pinch_leap1; + self.th_jumpexit = pinch_leap8; + } + else self.th_missile = pinch_tail1; + + } + + self.gib1skin = self.gib2skin = self.gib3skin = self.exactskin; + if(!self.classtype) self.classtype = CT_MONSCORPION; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn scorpion (requires monster_scorpionspawn entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_scorpion = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + update_minioncount(self.owner, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_scorpion"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self.owner; // Spawner Parent Link + self.owner = minion; // Stop gibs interacting with minion + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONSCORPION; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + minion.spawnflags = 0; + + minion.mdl = "progs/mon_scorpion.mdl"; + minion.headmdl = "progs/h_scorpion.mdl"; // Front Jaws + minion.gib1mdl = "progs/gib_scorpleg.mdl"; // Single Leg + minion.gib2mdl = "progs/gib_scorptail.mdl"; // Tail + Sting + minion.gib3mdl = "progs/gib_scorpclaw.mdl"; // Claw + minion.exactskin = rint((random()*3)-0.5); + minion.gibhealth = -20; + minion.health = 80; + + minion.idle_sound = "scorpion/warning1.wav"; + minion.idle_sound2 = "scorpion/warning2.wav"; + minion.sight_sound = "scorpion/hiss.wav"; + + minion.pain_sound = "spider/pain1.wav"; + minion.pain_sound2 = "spider/pain2.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_scorpion; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_seeker.qc b/QC_other/QC_arcane/mon_seeker.qc new file mode 100644 index 00000000..6377def0 --- /dev/null +++ b/QC_other/QC_arcane/mon_seeker.qc @@ -0,0 +1,804 @@ +/*============================================================================== +Seeker (Heavily inspired by Hunter from RRP - ijed) +==============================================================================*/ +// Slow moving run/walk animation +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 run17 run18 run19 + +// stationary fire range attack (Not used) +$frame fire1 fire2 fire3 fire4 fire5 fire6 fire7 fire8 +$frame fire9 fire10 fire11 fire12 fire13 fire14 fire15 fire16 +$frame fire17 fire18 fire19 fire20 fire21 fire22 fire23 fire24 +$frame fire25 fire26 fire27 fire28 fire29 fire30 + +// right arm punch +$frame punch1 punch2 punch3 punch4 punch5 punch6 punch7 punch8 +$frame punch9 punch10 + +// fall backwards and die +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// Stationary classic idle +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 + +// Run with LEFT arm missing +$frame runL1 runL2 runL3 runL4 runL5 runL6 runL7 runL8 +$frame runL9 runL10 runL11 runL12 runL13 runL14 runL15 runL16 +$frame runL17 runL18 runL19 + +// Run with RIGHT arm missing +$frame runR1 runR2 runR3 runR4 runR5 runR6 runR7 runR8 +$frame runR9 runR10 runR11 runR12 runR13 runR14 runR15 runR16 +$frame runR17 runR18 runR19 + +// Attack with LEFT arm missing +$frame fireL1 fireL2 fireL3 fireL4 fireL5 fireL6 fireL7 fireL8 +$frame fireL9 fireL10 fireL11 + +// Attack with RIGHT arm missing +$frame fireR1 fireR2 fireR3 fireR4 fireR5 fireR6 fireR7 fireR8 +$frame fireR9 fireR10 fireR11 + +// Attack with BOTH arms active (NEW) +$frame fireB1 fireB2 fireB3 fireB4 fireB5 fireB6 fireB7 fireB8 +$frame fireB9 fireB10 fireB11 + +// Death with LEFT arm missing +$frame deathL1 deathL2 deathL3 deathL4 deathL5 deathL6 deathL7 deathL8 +$frame deathL9 deathL10 deathL11 deathL12 + +// Death with RIGHT arm missing +$frame deathR1 deathR2 deathR3 deathR4 deathR5 deathR6 deathR7 deathR8 +$frame deathR9 deathR10 deathR11 deathR12 + +// Death with BOTH arm missing (special event) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 + +// Death with HEAD missing (special event) +$frame deathH1 deathH2 deathH3 deathH4 deathH5 deathH6 deathH7 deathH8 +$frame deathH9 deathH10 deathH11 deathH12 + +// Idle with LEFT arm missing +$frame standL1 standL2 standL3 standL4 standL5 standL6 standL7 standL8 +$frame standL9 standL10 standL11 standL12 standL13 standL14 standL15 standL16 +$frame standL17 standL18 standL19 + +// Idle with RIGHT arm missing +$frame standR1 standR2 standR3 standR4 standR5 standR6 standR7 standR8 +$frame standR9 standR10 standR11 standR12 standR13 standR14 standR15 standR16 +$frame standR17 standR18 standR19 + +float SEEKER_ARMS_BOTH = 0; +float SEEKER_ARMS_LEFT = 1; +float SEEKER_ARMS_RIGHT = 2; +float SEEKER_ARMSLESS = 3; +float SEEKER_HEADLESS = 4; + +float SEEKER_IDLE = 0; +float SEEKER_WALK = 1; +float SEEKER_FIRE = 2; +float SEEKER_DIE = 3; + +//============================================================================ +// Spark effect from missing arm joint +// Low chance out of combat (idle state) +//============================================================================ +void() seek_sparks_fade1 = [0, seek_sparks_fade2] {self.alpha = 0.8; self.nextthink = time + 0.05;}; +void() seek_sparks_fade2 = [0, seek_sparks_fade3] {self.alpha = 0.6; self.nextthink = time + 0.05;}; +void() seek_sparks_fade3 = [0, seek_sparks_fade4] {self.alpha = 0.4; self.nextthink = time + 0.05;}; +void() seek_sparks_fade4 = [0, SUB_Remove] {self.alpha = 0.2; self.nextthink = time + 0.05;}; + +void() seek_spark = +{ + local float loopvar; + local entity spark; + + if (self.state == SEEKER_ARMS_BOTH) return; + // Less chance of sparks when not in combat + if (random() > 0.1 && !self.enemy) return; + if (random() > 0.4 && self.enemy) return; + + // Light flash and sparky sound + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_BODY, self.noise3, 1, ATTN_STATIC); + makevectors (self.angles); + + // Change origin and spark direction for each arm + if (self.state == SEEKER_ARMS_LEFT) { + self.pos1 = self.origin + attack_vector('-4 -30 48'); + self.pos2 = -v_right*25; + } + else { + self.pos1 = self.origin + attack_vector('-4 30 48'); + self.pos2 = v_right*25; + } + + // Work out how many sparks to spawn + loopvar = rint(5 + random()*5); + while (loopvar > 0) { + spark = spawn(); + spark.classtype = CT_TEMPSPARK; + spark.classgroup = CG_TEMPENT; + spark.owner = self; + spark.movetype = MOVETYPE_BOUNCE; + spark.solid = SOLID_TRIGGER; + setmodel (spark, self.noise2); + setorigin (spark, self.pos1); + setsize (spark, VEC_ORIGIN, VEC_ORIGIN); + spark.skin = rint(random()*3); + spark.gravity = 0.3; + spark.velocity = vecrand(0,25,TRUE); + spark.velocity = spark.velocity + self.pos2; + spark.avelocity = '300 300 300'; + spark.nextthink = time + 0.5 + 1.5*random(); + spark.think = seek_sparks_fade1; + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) spark.effects = spark.effects + EF_NOSHADOW; + + // Keep looping for more sparks + loopvar = loopvar - 1; + } +}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() seek_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + } +}; + +//---------------------------------------------------------------------- +void() seek_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() seek_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//---------------------------------------------------------------------- +void() seek_setup_attachment = +{ + // Check if attachment has been setup yet + if (!self.attachment) seek_create_attachment(); + self.attachment.state = STATE_ON; + setmodel(self.attachment, self.weaponglow); + self.attachment.skin = 0; +} + +//---------------------------------------------------------------------- +void() seek_update_attachment = +{ + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = self.frame; + self.attachment.alpha = 0.3 + random()*0.7; +}; + +//============================================================================ +void() seek_standframe = +{ + // type of animation state + self.attack_timer = SEEKER_IDLE; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $standL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $standR1 + self.walkframe; + else self.frame = $stand1 + self.walkframe; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 4) seek_spark(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 18) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = seek_standframe; + + if (self.spawnflags & MON_SEEK_SHIELD) seek_update_attachment(); + else ai_stand(); +}; + +//---------------------------------------------------------------------- +void() seek_stand = { + self.walkframe = 0; + if (self.spawnflags & MON_SEEK_SHIELD) seek_setup_attachment(); + seek_standframe(); +}; + +//============================================================================ +void() seek_walkframe = +{ + // If dead, no more updates + if (self.health < 1) return; + + // type of animation state + self.attack_timer = SEEKER_WALK; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $runL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $runR1 + self.walkframe; + else self.frame = $run1 + self.walkframe; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + if (self.walkframe == 2 || self.walkframe == 12) monster_footstep(FALSE); + if (self.walkframe == 4) seek_spark(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 18) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = seek_walkframe; + + if (self.walkframe == 1) self.distance = 0; + else if (self.walkframe == 2) self.distance = 5; + else if (self.walkframe == 3) self.distance = 5; + else if (self.walkframe == 4) self.distance = 15; + else if (self.walkframe == 5) self.distance = 5; + + else if (self.walkframe == 6) self.distance = 7; + else if (self.walkframe == 7) self.distance = 12; + else if (self.walkframe == 8) self.distance = 7; + else if (self.walkframe == 9) self.distance = 5; + else if (self.walkframe == 10) self.distance = 3; + + else if (self.walkframe == 11) self.distance = 0; + else if (self.walkframe == 12) self.distance = 5; + else if (self.walkframe == 13) self.distance = 5; + else if (self.walkframe == 14) self.distance = 15; + else if (self.walkframe == 15) self.distance = 3; + + else if (self.walkframe == 16) self.distance = 7; + else if (self.walkframe == 17) self.distance = 12; + else if (self.walkframe == 18) self.distance = 7; + else if (self.walkframe == 0) self.distance = 8; + + if (self.lefty == FALSE) ai_walk(self.distance); + else ai_run(self.distance*2); +}; + +//---------------------------------------------------------------------- +void() seek_walk = { self.walkframe = 0; self.lefty = FALSE; seek_walkframe(); }; +void() seek_run = { self.walkframe = 0; self.lefty = TRUE; seek_walkframe(); }; + +//============================================================================ +// Melee attack +//============================================================================ +void() seek_punch = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + ai_damagebreakable(50); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESEEKER)) return;// Too far away + + // Melee hit sound + sound (self, CHAN_WEAPON, "seeker/punch1.wav", 1, ATTN_NORM); + // Damage 1-60 + ldmg = (random() + random() + random()) * 20; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, -150); + SpawnMeatSpray (self, self.enemy, -150); +}; + +//---------------------------------------------------------------------- +void() seek_melee1 = [ $punch1, seek_melee2 ] {ai_face(); + self.pain_finished = time + 1; // Block pain animation + sound (self, CHAN_VOICE, "seeker/melee1.wav", 1, ATTN_NORM);}; +void() seek_melee2 = [ $punch2, seek_melee3 ] {ai_charge(15);}; +void() seek_melee3 = [ $punch3, seek_melee4 ] {ai_charge(20);}; +void() seek_melee4 = [ $punch4, seek_melee5 ] {ai_charge(25);}; +void() seek_melee5 = [ $punch5, seek_melee6 ] {ai_charge(30);}; +void() seek_melee6 = [ $punch6, seek_melee7 ] {ai_charge(30);}; +void() seek_melee7 = [ $punch7, seek_melee8 ] {ai_charge(30);seek_punch();}; +void() seek_melee8 = [ $punch8, seek_melee9 ] {}; +void() seek_melee9 = [ $punch9, seek_melee10 ] {}; +void() seek_melee10 = [ $punch10, seek_run ] {}; + +//============================================================================ +// Range attack - 3 rockets from each arm +//============================================================================ +void(vector leftofs, vector rightofs) seek_attack = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + // Setup different speeds for projectiles (rockets/laz0rs) + if (self.weaponstate == TRUE) + self.attack_speed = SPEED_SEEKLAZ + (skill * SPEED_SEEKLAZSKILL); + else + self.attack_speed = SPEED_SEEKROCK + (skill * SPEED_SEEKROCKSKILL); + + // turn and face your enemy! + ai_face(); + makevectors (self.angles); + + // Does the LEFT arm exist? + if (self.state == SEEKER_ARMS_BOTH || self.state == SEEKER_ARMS_LEFT) { + // Fire left arm rocket + org = self.origin + attack_vector(leftofs); + // Fire rocket slightly to the LEFT of player + vec = v_right*(10+random()*10); + dir = normalize((self.enemy.origin + vec) - org); + // Double check nothing (world/monsters) is blocking the rocket + if (visxray(self.enemy, leftofs, '0 0 0', FALSE)) { + if (self.weaponstate == TRUE) { + if (skill > SKILL_NORMAL) { + sound (self, CHAN_WEAPON, SOUND_PLASMA_FIRE, 1, ATTN_NORM); + launch_plasma(org, dir, CT_MONSEEKER, self.attack_speed); + } + else { + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_LASER, self.attack_speed); + } + } + else { + sound (self, CHAN_WEAPON, "seeker/rocket_fire.wav", 1, ATTN_NORM); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_SEEKER, self.attack_speed); + } + } + } + + // Does the RIGHT arm exist? + if (self.state == SEEKER_ARMS_BOTH || self.state == SEEKER_ARMS_RIGHT) { + org = self.origin + attack_vector(rightofs); + // Fire rocket slightly to the RIGHT of player + vec = v_right*(10+random()*10); + dir = normalize((self.enemy.origin - vec) - org); + // Double check nothing (world/monsters) is blocking the rocket + if (visxray(self.enemy, rightofs, '0 0 0', FALSE)) { + if (self.weaponstate == TRUE) { + if (skill > SKILL_NORMAL) { + sound (self, CHAN_WEAPON, SOUND_PLASMA_FIRE, 1, ATTN_NORM); + launch_plasma(org, dir, CT_PROJ_PLASMA, self.attack_speed); + } + else { + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_LASER, self.attack_speed); + } + } + else { + sound (self, CHAN_WEAPON, "seeker/rocket_fire.wav", 1, ATTN_NORM); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_SEEKER, self.attack_speed); + } + } + } +}; + +//---------------------------------------------------------------------- +void() seek_fireframe = +{ + // If dead, no more updates + if (self.health < 1) return; + + // type of animation state + self.attack_timer = SEEKER_FIRE; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $fireL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $fireR1 + self.walkframe; + else self.frame = $fireB1 + self.walkframe; + + // Animation trigger events + if (self.walkframe == 0) { + // Work out which attack to do? lasers or rockets + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_RANGESWSEEKER) { + // Upgrade lasers to plasma with hard skill+ + if (skill > SKILL_NORMAL) + sound (self, CHAN_VOICE, "seeker/range_plasma.wav", 1, ATTN_NORM); + // Lasers at close range ONLY + else sound (self, CHAN_VOICE, "seeker/range_laser.wav", 1, ATTN_NORM); + self.weaponstate = TRUE; + } + else { + sound (self, CHAN_VOICE, "seeker/range_rocket.wav", 1, ATTN_NORM); + self.weaponstate = FALSE; + } + } + else if (self.walkframe == 5) seek_attack('40 33 30','25 -23 25'); + else if (self.walkframe == 7) seek_attack('33 30 28','23 -30 25'); + else if (self.walkframe == 9) seek_attack('33 36 27','35 -26 26'); + else ai_face(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + self.nextthink = time + 0.1; + if (self.walkframe > 10) self.think = seek_run; + else self.think = seek_fireframe; +}; + +//---------------------------------------------------------------------- +void() seek_fire = { self.walkframe = 0; seek_fireframe(); }; + +//============================================================================ +// This robot does not feel pain, just exploding debris +//============================================================================ +void() seek_arm_explode = +{ + particle_dust(self.pos2, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.pos2, "seeker/explode_major.wav"); + SpawnProjectileSmoke(self.pos2, 150, 50, 150); + SpawnProjectileSmoke(self.pos2, 150, 50, 150); + SpawnProjectileSmoke(self.pos2, 150, 50, 150); + // Throw 2 small metal blob + arm + self.gib1origin = self.gib2origin = self.pos2; + ThrowGib(11, 2); + ThrowGib(12, 1); + + // Make sure previous function is restored so correct + // arm animation is setup after one has been destroyed + if (self.attack_timer == SEEKER_WALK) self.think = seek_walkframe; + else if (self.attack_timer == SEEKER_FIRE) self.think = seek_fireframe; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) seek_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + // There are no checks for shadow axe damage (pain_check = 1/2) + if (self.state == SEEKER_ARMS_BOTH) { + // Check for the chance to blow one of the arms off + self.pos1_x = self.health / self.max_health; + self.pos1_y = skill / 10; + self.pos1_z = self.pos1_x + self.pos1_y; +// dprint("Damage ("); dprint(ftos(damage)); +// dprint(") Chance ("); dprint(ftos(self.pos1_z)); +// dprint(")\n"); + + // Check for body damage and total damage done + // Is there a chance one of the arms will fall off? + if (damage > 25 && random() > self.pos1_z) { + if (random() > 0.5) { + self.state = SEEKER_ARMS_LEFT; + makevectors (self.angles); + self.pos2 = self.origin + attack_vector('0 -35 44'); + seek_arm_explode(); + } + else { + self.state = SEEKER_ARMS_RIGHT; + makevectors (self.angles); + self.pos2 = self.origin + attack_vector('0 35 44'); + seek_arm_explode(); + } + } + else { + // Spawn dust and sprite explosion + particle_dust(inflictor.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + } + } + else { + // Once down to one arm, just sparks and dust + particle_dust(inflictor.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + } + } +}; + +//============================================================================ +void() seek_explode = +{ + // Hide and Seek + entity_hide(self); + + // Regular ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_BIG, self.origin, "seeker/explode_major.wav"); + SpawnProjectileSmoke(self.origin, 150, 150, 150); + SpawnProjectileSmoke(self.origin, 150, 150, 150); + SpawnProjectileSmoke(self.origin, 150, 150, 150); + + // Throw a couple of random body pieces + if (random() < 0.5) ThrowGib(11, 1); + else ThrowGib(11, 2); + // Lets throw our arms in the air like we don't care! + if (self.state != SEEKER_ARMSLESS) ThrowGib(12, 1); + // Spew random metal1_2 rubble up + ThrowGib(13, 5 + rint(random()*5)); + ThrowGib(14, 5 + rint(random()*5)); + // If head still on shoulders, throw that as well! + if (self.state != SEEKER_HEADLESS) ThrowGib(25, 1); +}; + +//---------------------------------------------------------------------- +void() seek_dieframe = +{ + // type of animation state + self.attack_timer = SEEKER_DIE; + + if (self.walkframe == 2) self.solid = SOLID_NOT; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $deathL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $deathR1 + self.walkframe; + else if (self.state == SEEKER_ARMSLESS) self.frame = $deathB1 + self.walkframe; + else if (self.state == SEEKER_HEADLESS) self.frame = $deathH1 + self.walkframe; + else self.frame = $death1 + self.walkframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe < 12) { + self.nextthink = time + 0.1; + self.think = seek_dieframe; + } + else { + // Explode after a while + self.nextthink = time + 3 + random()*2; + self.think = seek_explode; + } + + // Spawn some extra smoke trails + if (self.walkframe > 1 && random() < 0.5) { + // make sure the origin is coming out of the mech body + self.pos1 = self.origin + (crandom()*'16 16 0') + (random()*'0 0 24'); + SpawnProjectileSmoke(self.pos1, 200, 250, 100); + SpawnProjectileSmoke(self.pos1, 200, 250, 100); + if (random() < 0.5) + SpawnExplosion(EXPLODE_MED, self.pos1, "seeker/explode_minor.wav"); + } +}; + +//---------------------------------------------------------------------- +void() seek_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Long death sound with comedy bing at the end! + sound (self, CHAN_VOICE, "seeker/death1.wav", 1, ATTN_NORM); + // reset custom origins for body/arm gib parts + self.gib1origin = self.gib2origin = '0 0 0'; + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // Spawn dust and sprite explosion from chest area + makevectors(self.angles); + self.pos1 = self.origin + attack_vector('8 0 24'); + particle_dust(self.pos1, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.pos1, "seeker/explode_major.wav"); + SpawnProjectileSmoke(self.pos1, 200, 250, 100); + + // Random chance of head flying off body with both arms! + if (self.state == SEEKER_ARMS_BOTH && random() > 0.6) { + self.state = SEEKER_HEADLESS; + ThrowGib(25, 1); + } + // Random chance that remaining left/right arm falls off + else if (self.state < SEEKER_ARMSLESS && random() > 0.9) { + self.state = SEEKER_ARMSLESS; + ThrowGib(12, 1); + } + + // Start death sequence + self.walkframe = 0; + seek_dieframe (); +}; + +//============================================================================ +void() seek_shield = +{ + // Setup particle emitter for shield effect + self.part_active = PARTICLE_STYLE_FFIELD; + self.spr_frame = PARTICLE_BURST_BLUE; + self.part_vol = '24 24 32'; // Bounding box volume + self.part_limit = 100; // Large amount of particles + self.part_life = 4; // Longer lifetime + self.part_ofs = '0 0 32'; // Move up from monster origin + self.part_vel = '0 0 4'; // Move up from monster origin + self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_ON); + seek_stand(); +}; + +//---------------------------------------------------------------------- +void() seek_wakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + + self.use = SUB_Null; // no re-trigger + seek_finish_attachment(); // Remove shield + spawnflag + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SEEK_SHIELD); + + // Switch off shield sound + sound (self, CHAN_WEAPON, "ambience/power_off.wav", 1, ATTN_NORM); + // Switch OFF any particle emitter + if (self.part_emitter) misc_particle_off(self.part_emitter); + + // Check for any trigger off events (trigger_once) + if (self.target2 != "") trigger_strs(self.target2, self); + self.target2 = ""; + + // Restore all think functions + self.th_stand = seek_stand; + self.th_walk = seek_walk; + self.th_run = seek_run; + self.th_melee = seek_melee1; // Punch attack + self.th_missile = seek_fire; // Rockets incoming! + self.th_pain = seek_pain; + self.th_die = seek_die; + self.takedamage = DAMAGE_YES; // Can receive damage + monster_targets(); // Check for targets +}; + +/*====================================================================== +QUAKED monster_seeker (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_seeker = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_seeker.mdl"; + self.headmdl = "progs/h_seeker.mdl"; + self.weaponglow = "progs/mon_seeker_glow.mdl"; + // 4 poses 0=generic blob, 1=generic square, 2=generic blob2, 3=arm + self.gib1mdl = "progs/gib_seekchunk.mdl"; // types 0-2 + self.gib2mdl = "progs/gib_seekarm.mdl"; // arm only + self.gib3mdl = "progs/gib_metal1.mdl"; // Breakable metal + self.gib4mdl = "progs/gib_metal3.mdl"; // Breakable metal + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.weaponglow); // Glowing blue shield + precache_model (self.gib1mdl); // gib chunks + precache_model (self.gib2mdl); // Arms + precache_model (self.gib3mdl); // Generic metal1_2 + precache_model (self.gib4mdl); // Generic metal1_2 + self.gib1frame = 2; // 3 frames choose from + self.gibtype = GIBTYPE_METAL; // Metal impact sounds + + self.idle_sound = "seeker/idle1.wav"; + self.idle_sound2 = "seeker/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.pain_sound = "seeker/pain1.wav"; + self.pain_sound2 = "seeker/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("seeker/death1.wav"); + precache_sound ("seeker/explode_minor.wav"); + precache_sound ("seeker/explode_major.wav"); + // Power off sound for shield setup + precache_sound ("ambience/power_off.wav"); + + // Range attack 1 - rockets + precache_sound("seeker/range_rocket.wav"); + precache_sound("seeker/rocket_fire.wav"); + precache_sound("seeker/rocket_hit.wav"); + // Range attack 2 - lasers + precache_model (MODEL_PROJ_LASER); + precache_sound("seeker/range_laser.wav"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + // Range attack 3 - plasma + precache_model (MODEL_PROJ_PLASMA); + precache_sound ("seeker/range_plasma.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + // Melee attack - giant punch + precache_sound ("seeker/melee1.wav"); + precache_sound ("seeker/punch1.wav"); + + // Sparking from broken arm + self.noise2 = "progs/misc_spark.mdl"; + self.noise3 = "misc/spark.wav"; + precache_model (self.noise2); + precache_sound (self.noise3); + + self.sight_sound = "seeker/sight1.wav"; + precache_sound (self.sight_sound); + + // Check for any custom arm setups + if (self.state < SEEKER_ARMS_LEFT || self.state > SEEKER_ARMS_RIGHT) + self.state = SEEKER_ARMS_BOTH; // Both arms are active + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) { + // if spawns with one arm, start with less HP + if (self.state == SEEKER_ARMS_BOTH) self.health = 500; + else self.health = 400; + } + + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Starts in one piece + self.pain_flinch = 400; // takes alot to pain + self.pain_timeout = 2; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.pain_longanim = FALSE; // cannot be chopped with shadow axe + if (self.death_dmg < 1) self.death_dmg = DAMAGE_SEEKER; + self.bouncegrenade = TRUE; // Grenades bounce + self.bleedcolour = MON_BCOLOR_WHITE; // Grey dust + self.poisonous = FALSE; // Robots are not poisonous + self.deathstring = " was destroyed by a Seeker\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0.5; self.resist_cells = 0; + + // Custom feet sounds (specific order) + self.stepc1 = "seeker/footstep1.wav"; + self.stepc2 = "seeker/footstep2.wav"; + self.stepc3 = "seeker/footstep1.wav"; + self.stepc4 = "seeker/footstep2.wav"; + self.stepc5 = "seeker/footstep3.wav"; + precache_sound (self.stepc1); + precache_sound (self.stepc2); + precache_sound (self.stepc3); + precache_sound (self.stepc4); + precache_sound (self.stepc5); + self.steptype = FS_TYPECUSTOM; + + if (self.spawnflags & MON_SEEK_SHIELD) { + self.th_stand = seek_shield; // Setup Shield + self.think1 = seek_wakeup; // Wakeup function when triggered + } + else { + self.th_stand = seek_stand; + self.th_walk = seek_walk; + self.th_run = seek_run; + self.th_melee = seek_melee1; // Punch attack + self.th_missile = seek_fire; // Rockets incoming! + self.th_pain = seek_pain; + self.th_die = seek_die; + } + + self.th_checkattack = SeekerCheckAttack; + self.classtype = CT_MONSEEKER; + self.classgroup = CG_ROBOT; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_sentinel.qc b/QC_other/QC_arcane/mon_sentinel.qc new file mode 100644 index 00000000..8fee5d85 --- /dev/null +++ b/QC_other/QC_arcane/mon_sentinel.qc @@ -0,0 +1,292 @@ +/*============================================================================== +SENTINEL (Originally from Quoth - Kell/Necros/Preach) + * QC was created for AD mappers to play with in their own projects + * Original Quoth model/sounds not included with main MOD + + Interesting QC traits + * All stand/walk/run go through single function, easier setup + * Has no front section to model, wakeup event is 360 FOV + * Does not move when attacking so can maintain original height + * Will move very fast when out of sight of enemy + * No head model or body on death, just a pile of gibs + + QUOTH assets required to get this monster working in AD + (model's in 'progs' and wav's in 'sound' sub directories) + * sentinel.mdl -> mon_sentinel.mdl (rename file) + * sentinel/widle1.wav, sentinel/widle2.wav, sentinel/wsight.wav + * sentinel/laser.wav, sentinel/nail.wav, sentinel/wpain.wav + + ==============================================================================*/ +// Writhe (move tentacles) animation +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 idle9 idle10 + +// Pain (move tentacles) animation +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +// Export frames (ignored) +$frame base1 + +float SENT_STAND = 0; // Default state +float SENT_WALK = 1; // Patrolling +float SENT_RUN = 2; // Attacking - Sentry mode + +//====================================================================== +// Update Sentinel every frame +// Its a great shame the quoth model has no idle animations +// - could have been body attachments or different tentacle movements +//====================================================================== +void() sent_update = +{ + // If Sentinel is dead, no more updates + if (self.health < 1) return; + + // Time for an idle sound? + if (self.idletimer < time) monster_idle_sound(); + + // Update animation frame + self.frame = $idle1 + self.walkframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 9) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = sent_update; + + // Check sentinel states + if (self.attack_timer == SENT_STAND) { + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_FLY; + + // Change the movement type so that can easily move up/down + // using velocity, forced origin movement is really jerky! + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.attack_finished < time) { + self.attack_finished = time + 2; + if (self.lip < 1) self.lip = 1; + else self.lip = -1; + self.velocity_z = 2 * self.lip; + } + } + + ai_stand(); + } + else if (self.attack_timer == SENT_WALK) { + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + ai_walk(8); + } + else if (self.attack_timer == SENT_RUN) { + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + // If can see enemy, don't move, just fire + if (visible(self.enemy)) { + self.movespeed = -1; + ai_run(0); + } + // Cannot see enemy, track them down + else { + self.movespeed = 1; + ai_run(8); + } + } +}; + +//====================================================================== +// All stand, walk and run functions are condensed down to one entry +// Might as well be one loop as there is only one animation set +// +void() sent_stand = { self.attack_timer = SENT_STAND; sent_update(); }; +void() sent_walk = { self.attack_timer = SENT_WALK; sent_update(); }; +void() sent_run = { self.attack_timer = SENT_RUN; sent_update(); }; + +//=========================================================================== +// RANGE ATTACK - Fires spikes or laser bolts +//=========================================================================== +void() sent_attack = +{ + local vector org, dir, vec; + + // Keep cycling the pain animation + self.think = sent_run; + self.nextthink = time + 0.1; + + if (self.enemy && self.health > 0) { + + // Always make sure there is no monster or obstacle in the way + // Cannot use enemy entity direct, enemytarget will be active + if ( !visxray(SUB_entEnemyTarget(), self.attack_offset, '0 0 12', FALSE) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Aim high to catch jumping players + dir = SUB_orgEnemyTarget() + '0 0 12'; + vec = normalize(dir - org); + // Laser/nail speed : 575=easy, 650=normal, 725=hard, nm=800 + self.attack_speed = SPEED_SENTPROJ + (skill * SPEED_SENTPROJSKILL); + + // Switch projectile type + if (self.spawnflags & MON_SENTINEL_NAIL) { + if (random() < 0.2) sound (self, CHAN_WEAPON, "sentinel/nail.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + launch_projectile(org, vec, CT_PROJ_MONNG, self.attack_speed); + } + else { + if (random() < 0.2) sound (self, CHAN_WEAPON, "sentinel/laser.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, vec, CT_PROJ_LASER, self.attack_speed); + } + } +}; + +//============================================================================ +// ROBOT PAIN!?! +//============================================================================ +void() sent_inpain = +{ + // Update animation frame + self.frame = $pain1 + self.inpain; + // Move backwards away from damage + ai_backface(5-self.inpain); + + // Keep cycling the pain animation + self.think = sent_inpain; + self.nextthink = time + 0.1; + + // Start of pain cycle + if (self.inpain == 0) { + // Spawn a pile of sparks and dust falling down + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + } + // Finished, back to combat + else if (self.inpain >= 5) { + self.think = self.th_run; + } + + // Next pain animation + self.inpain = self.inpain + 1; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) sent_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Stop any ai_run velocity and reset movetype + self.velocity = '0 0 0'; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.inpain = 0; + + sent_inpain(); +}; + +//============================================================================ +void() sent_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Final fireworks! + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + + // no more sentinel + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // Regular blood like gibs + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 1); + // Metal and custom body parts + self.gibtype = GIBTYPE_METAL; + ThrowGib(11, 2 + rint(random()*2)); + ThrowGib(12, 2 + rint(random()*2)); +}; + +/*====================================================================== +QUAKED monster_sentinel (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_sentinel = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_sentinel.mdl"; // AD naming + self.gib1mdl = "progs/gib_metal1.mdl"; // Breakable metal + self.gib2mdl = "progs/gib_metal3.mdl"; // Breakable metal + + precache_model (self.mdl); + precache_model (self.gib1mdl); // Generic metal1_2 + precache_model (self.gib2mdl); // Generic metal1_2 + + self.idle_sound = "sentinel/widle1.wav"; + self.idle_sound2 = "sentinel/widle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Default attack - lasers! + precache_model (MODEL_PROJ_LASER); // Copy of enforcer laser + precache_sound("sentinel/laser.wav"); // Unique laser fire + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + + // Alternative attack - red hot nails!?! + if (self.spawnflags & MON_SENTINEL_NAIL) { + self.exactskin = 1; // Nail version + precache_model (MODEL_PROJ_NGRED); // Copy of freddie nails + precache_sound("weapons/rocket1i.wav"); + precache_sound("sentinel/nail.wav"); // Unique nail fire + } + + self.pain_sound = "sentinel/wpain.wav"; + precache_sound (self.pain_sound); + self.death_sound = "jim/explode_major.wav"; + precache_sound (self.death_sound); + + self.sight_sound = "sentinel/wsight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 75; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 30; // Sometimes flinch + self.steptype = FS_FLYING; // Silent feet + self.pain_longanim = FALSE; // No long pain animation + self.blockudeath = TRUE; // No humanoid death sound + self.idlemoreoften = TRUE; // More creepy idle sounds + self.poisonous = FALSE; // Robots are not poisonous + if (self.height == 0) self.height = 32; // Custom height + self.walkframe = 0; // Reset frame counter + self.attack_offset = '0 0 14'; // front/middle of body + self.sight_nofront = TRUE; // Has no front facing + self.deathstring = " was scorched by a Sentinel\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SentinelCheckAttack; + self.th_stand = sent_stand; + self.th_walk = sent_walk; + self.th_run = sent_run; + self.th_missile = sent_attack; + self.th_pain = sent_pain; + self.th_die = sent_die; + + self.classtype = CT_MONSENTINEL; + self.classgroup = CG_ROBOT; + self.classmove = MON_MOVEFLY; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_shalrath.qc b/QC_other/QC_arcane/mon_shalrath.qc new file mode 100644 index 00000000..d4e4e97b --- /dev/null +++ b/QC_other/QC_arcane/mon_shalrath.qc @@ -0,0 +1,400 @@ +/*============================================================================== +SHAL-RATH (VORE) +==============================================================================*/ +$cd id1/models/shalrath +$origin 0 0 24 +$base base +$skin skin +$scale 0.7 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 + +//============================================================================ +// This is no stand idle! just uses frame 1 of walk +//============================================================================ +void() shal_stand =[ $walk1, shal_stand ] {ai_stand();}; + +//============================================================================ +void() shal_walk1 =[ $walk2, shal_walk2 ] {monster_idle_sound(); ai_walk(6);}; +void() shal_walk2 =[ $walk3, shal_walk3 ] {ai_walk(4);}; +void() shal_walk3 =[ $walk4, shal_walk4 ] {monster_footstep(FALSE); ai_walk(0);}; +void() shal_walk4 =[ $walk5, shal_walk5 ] {ai_walk(0);}; +void() shal_walk5 =[ $walk6, shal_walk6 ] {ai_walk(0);}; +void() shal_walk6 =[ $walk7, shal_walk7 ] {monster_footstep(FALSE); ai_walk(0);}; +void() shal_walk7 =[ $walk8, shal_walk8 ] {ai_walk(5);}; +void() shal_walk8 =[ $walk9, shal_walk9 ] {ai_walk(6);}; +void() shal_walk9 =[ $walk10, shal_walk10 ] {ai_walk(5);}; +void() shal_walk10 =[ $walk11, shal_walk11 ] {monster_footstep(FALSE); ai_walk(0);}; +void() shal_walk11 =[ $walk12, shal_walk12 ] {ai_walk(4);}; +void() shal_walk12 =[ $walk1, shal_walk1 ] {ai_walk(5);}; + +//============================================================================ +// run = walk (identical frames and movement speed!) +void() shal_run1 =[ $walk2, shal_run2 ] {monster_idle_sound(); ai_run(6);}; +void() shal_run2 =[ $walk3, shal_run3 ] {ai_run(4);}; +void() shal_run3 =[ $walk4, shal_run4 ] {monster_footstep(FALSE); ai_run(0);}; +void() shal_run4 =[ $walk5, shal_run5 ] {ai_run(0);}; +void() shal_run5 =[ $walk6, shal_run6 ] {ai_run(0);}; +void() shal_run6 =[ $walk7, shal_run7 ] {monster_footstep(FALSE); ai_run(0);}; +void() shal_run7 =[ $walk8, shal_run8 ] {ai_run(5);}; +void() shal_run8 =[ $walk9, shal_run9 ] {ai_run(6);}; +void() shal_run9 =[ $walk10, shal_run10 ] {monster_footstep(FALSE); ai_run(5);}; +void() shal_run10 =[ $walk11, shal_run11 ] {ai_run(0);}; +void() shal_run11 =[ $walk12, shal_run12 ] {ai_run(4);}; +void() shal_run12 =[ $walk1, shal_run1 ] {ai_run(5);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() shalrath_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.alpha = 0.85; + } +}; + +//---------------------------------------------------------------------- +void() shalrath_setup_attachment = +{ + // Is monster dead or dying? + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) shalrath_create_attachment(); + + // Move attachment into place ready for use + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setmodel(self.attachment, MODEL_EMPTY); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + setorigin(self.attachment, self.origin); + // Using empty model, so reset angle, frame and skin. + self.attachment.angles = self.angles; + self.attachment.frame = self.attachment.skin = 0; +}; + +//---------------------------------------------------------------------- +void() shalrath_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() shalrath_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - Homing Missile Attack +//====================================================================== +void() ShalMissile = +{ + // Check if there is a clear line of sight + // The original behaviour is ruined by this final check + // Baiting shalraths to fire will generate more voreballs flying + // around and projectiles to dodge, best leave this working + //if ( !(visxray(self.enemy, '0 8 20', '0 0 10', FALSE)) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM); + self.attack_speed = SPEED_SHALMISSILE + (skill * SPEED_SHALSKILL); + // Original vector location 0 0 10, new 0 8 36 + Launch_HomingMissile ('0 8 20', '0 0 10', CT_PROJ_SHAL, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector hmofs, float hmframe) Setup_ShalHome = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (hmframe == 0) { + self.attachment.state = STATE_ON; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + // Switch models if poisonous + if (self.poisonous) setmodel(self.attachment, MODEL_PROJ_SHOMEGRN); + else setmodel(self.attachment, MODEL_PROJ_SHOME); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + } + // Double check for pain interruption + else if (self.attachment.state == STATE_OFF) return; + + // Turn towards enemy and update model attachment + // The offset is based on the shalrath facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(hmofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.frame = hmframe; +}; + +//---------------------------------------------------------------------- +// it would have been cool to have the homing missile form slowing in the +// shalrath hand but the animation is just weird, the arm bends backward +// into a really strange position which makes the forming missile look +// terrible, restricted the grow function to later frames only +// 2 24 18, -8 24 18, -18 22 17, -28 18 16 (arm swings round and back) +// -26 12 20, -18 10 30, 12 8 36 ( arms swings up and forward) +// +void() shal_attack1 =[ $attack1, shal_attack2 ] {ai_face(); + sound (self, CHAN_WEAPON, "shalrath/attack.wav", 1, ATTN_NORM);}; +void() shal_attack2 =[ $attack2, shal_attack3 ] {ai_face();}; +void() shal_attack3 =[ $attack3, shal_attack4 ] {ai_face();}; +void() shal_attack4 =[ $attack4, shal_attack5 ] {ai_face();}; +void() shal_attack5 =[ $attack5, shal_attack6 ] {ai_face();}; +void() shal_attack6 =[ $attack6, shal_attack7 ] {Setup_ShalHome('-26 12 20',0);}; +void() shal_attack7 =[ $attack7, shal_attack8 ] {Setup_ShalHome('-18 10 30',2);}; +void() shal_attack8 =[ $attack8, shal_attack9 ] {Setup_ShalHome('12 8 36',7);}; +void() shal_attack9 =[ $attack9, shal_attack10] {shalrath_finish_attachment();ShalMissile();}; +void() shal_attack10 =[ $attack10, shal_attack11] {}; +void() shal_attack11 =[ $attack11, shal_run1 ] {}; + +//====================================================================== +// RANGE ATTACK 2 - spawn voreling minion (optional) +// +// Creates a ball of green goo and throws it towards the player +// Once the ball has landed, hatch/explode and create baby voreling +//====================================================================== +void(vector eggofs, float eggframe) Setup_ShalrathEgg = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (eggframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, MODEL_PROJ_SBALL); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "shalrath/attack3.wav", 1, ATTN_NORM); + } + // Double check for pain interruption + else if (self.attachment.state == STATE_OFF) return; + + // Turn towards enemy and update model attachment + // The offset is based on the shalrath facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(eggofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.frame = eggframe; +}; + +//---------------------------------------------------------------------- +void() shal_minion1 =[ $attack1, shal_minion2 ] {ai_face();}; +void() shal_minion2 =[ $attack2, shal_minion3 ] {Setup_ShalrathEgg('2 24 18',0);}; +void() shal_minion3 =[ $attack3, shal_minion4 ] {Setup_ShalrathEgg('-8 24 18',1);}; +void() shal_minion4 =[ $attack4, shal_minion5 ] {Setup_ShalrathEgg('-18 22 17',1);}; +void() shal_minion5 =[ $attack5, shal_minion6 ] {Setup_ShalrathEgg('-28 18 16',2);}; +void() shal_minion6 =[ $attack6, shal_minion7 ] {Setup_ShalrathEgg('-26 12 20',3);}; +void() shal_minion7 =[ $attack7, shal_minion8 ] {Setup_ShalrathEgg('-18 10 30',4);}; +void() shal_minion8 =[ $attack8, shal_minion9 ] {Setup_ShalrathEgg('12 8 36',5);}; +void() shal_minion9 =[ $attack9, shal_minion10] {shalrath_finish_attachment();Create_Egg('12 8 36');}; +void() shal_minion10 =[ $attack10, shal_minion11] {}; +void() shal_minion11 =[ $attack11, shal_run1 ] {}; + +//---------------------------------------------------------------------- +void() shal_magic = +{ + local entity miniondef; + + // Make sure the attachments are setup ready + shalrath_create_attachment(); + + if (self.spawnflags & MON_SHALRATH_MINIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_shalrathminion"); + if (miniondef.classtype == CT_CACHEVORELING) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[SHALRATH]\b Cannot find minion template!\n"); + self.spawnflags = self.spawnflags - MON_SHALRATH_MINIONS; + } + } + + // Is the target the player or monster? + if (self.enemy.flags & FL_CLIENT) { + if (self.spawnflags & MON_SHALRATH_MINIONS) { + // This is an odd location for an melee check but the shalrath has + // no melee function and any check (ShalCheckAttack) done is for + // long range and moving backwards if attacking is blocked + // If the shalrath is a minion spawner and the player is too close + // then use the old base attack (voreballs) this can be switched off + // + self.enemydist = range_distance(self.enemy, TRUE); + // If the player is too close (melee distance) try old base attack + if (self.minion_baseattack > 0 && self.enemydist < MON_RANGE_MELEE) shal_attack1(); + else { + // has the voreling limit been reached? + if (query_minionactive(self) == TRUE) shal_minion1(); + else self.think = self.th_run; + } + } + // Only has one type of attack, homing missiles + else shal_attack1(); + + } + // Attack monsters with Homing Missiles + else shal_attack1(); +}; + +//============================================================================ +void() shal_pain1 =[ $pain1, shal_pain2 ] {}; +void() shal_pain2 =[ $pain2, shal_pain3 ] {shalrath_finish_attachment();}; +void() shal_pain3 =[ $pain3, shal_pain4 ] {}; +void() shal_pain4 =[ $pain4, shal_pain5 ] {}; +void() shal_pain5 =[ $pain5, shal_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) shal_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Hide any attachments + shalrath_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) shal_pain1(); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.5; + self.axhitme = 0; + shal_pain1(); + } + } +}; + +//============================================================================ +void() shal_death1 =[ $death1, shal_death2 ] {}; +void() shal_death2 =[ $death2, shal_death3 ] {monster_check_gib();}; +void() shal_death3 =[ $death3, shal_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() shal_death4 =[ $death4, shal_death5 ] {}; +void() shal_death5 =[ $death5, shal_death6 ] {}; +void() shal_death6 =[ $death6, shal_death7 ] {monster_death_postcheck();}; +void() shal_death7 =[ $death7, shal_death7 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() shal_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Make sure any attachments are removed + shalrath_remove_attachment(); + + // Normal death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM); + shal_death1(); + } +}; + +/*====================================================================== + QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) Ambush +======================================================================*/ +void() monster_shalrath = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_shalrath.mdl"; // Extra skin + self.headmdl = "progs/h_shalrath.mdl"; // Matching new skin + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_SHAL); // Original - progs/v_spike.mdl + precache_model (MODEL_PROJ_SHOME); // Homing missile growing 8 frames + precache_model (MODEL_PROJ_SBALL); // ball growing 8 frames + precache_model (MODEL_PROJ_SEGG); // ball turned into egg + precache_model (MODEL_PROJ_SSHELL); // Gibs from Egg + + self.idle_sound = "shalrath/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("shalrath/death.wav"); + self.pain_sound = "shalrath/pain.wav"; + precache_sound (self.pain_sound); + + precache_sound ("shalrath/attack.wav"); // Start of attack + precache_sound ("shalrath/attack2.wav"); // Firing missile + precache_sound ("shalrath/attack3.wav"); // Minions + precache_sound ("shalrath/bounce.wav"); // Egg bounce + + self.sight_sound = "shalrath/sight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_SHALGRN); // Green voreball + precache_model (MODEL_PROJ_SHOMEGRN); // Expanding voreball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 400; + self.gibhealth = -90; // Rarely gib (explosives required) + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 70; // take a lot of damage before pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 3; // Really high pain tolerance + self.steptype = FS_TYPELIGHT; // Light tap feet + self.blockudeath = TRUE; // no humanoid death sound + self.deathstring = " was exploded by a Vore\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = ShalCheckAttack; + self.th_stand = shal_stand; + self.th_walk = shal_walk1; + self.th_run = shal_run1; + self.th_missile = shal_magic; + self.th_pain = shal_pain; + self.th_die = shal_die; + + // Special green skin for spider wraiths + if (self.spawnflags & MON_SHALRATH_MINIONS) self.exactskin = 2; + + self.classtype = CT_MONSHAL; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_shambler.qc b/QC_other/QC_arcane/mon_shambler.qc new file mode 100644 index 00000000..7fe51885 --- /dev/null +++ b/QC_other/QC_arcane/mon_shambler.qc @@ -0,0 +1,557 @@ +/*============================================================================== +SHAMBLER +==============================================================================*/ +$cd id1/models/shams +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 + +$frame run1 run2 run3 run4 run5 run6 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 + +$frame swingr1 swingr2 swingr3 swingr4 swingr5 +$frame swingr6 swingr7 swingr8 swingr9 + +$frame swingl1 swingl2 swingl3 swingl4 swingl5 +$frame swingl6 swingl7 swingl8 swingl9 + +$frame magic1 magic2 magic3 magic4 magic5 +$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 + +void() sham_swingr1; +void() sham_reset_attachment; + +//====================================================================== +void() sham_stand1 =[ $stand1, sham_stand2 ] {ai_stand();}; +void() sham_stand2 =[ $stand2, sham_stand3 ] {ai_stand();}; +void() sham_stand3 =[ $stand3, sham_stand4 ] {ai_stand();}; +void() sham_stand4 =[ $stand4, sham_stand5 ] {ai_stand();}; +void() sham_stand5 =[ $stand5, sham_stand6 ] {ai_stand();}; +void() sham_stand6 =[ $stand6, sham_stand7 ] {ai_stand();}; +void() sham_stand7 =[ $stand7, sham_stand8 ] {ai_stand();}; +void() sham_stand8 =[ $stand8, sham_stand9 ] {ai_stand();}; +void() sham_stand9 =[ $stand9, sham_stand10] {ai_stand();}; +void() sham_stand10 =[ $stand10, sham_stand11] {ai_stand();}; +void() sham_stand11 =[ $stand11, sham_stand12] {ai_stand();}; +void() sham_stand12 =[ $stand12, sham_stand13] {ai_stand();}; +void() sham_stand13 =[ $stand13, sham_stand14] {ai_stand();}; +void() sham_stand14 =[ $stand14, sham_stand15] {ai_stand();}; +void() sham_stand15 =[ $stand15, sham_stand16] {ai_stand();}; +void() sham_stand16 =[ $stand16, sham_stand17] {ai_stand();}; +void() sham_stand17 =[ $stand17, sham_stand1 ] {ai_stand();}; + +//====================================================================== +void() sham_walk1 =[ $walk1, sham_walk2 ] {monster_idle_sound(); ai_walk(10);}; +void() sham_walk2 =[ $walk2, sham_walk3 ] {monster_footstep(FALSE); ai_walk(9);}; +void() sham_walk3 =[ $walk3, sham_walk4 ] {ai_walk(9);}; +void() sham_walk4 =[ $walk4, sham_walk5 ] {ai_walk(5);}; +void() sham_walk5 =[ $walk5, sham_walk6 ] {ai_walk(6);}; +void() sham_walk6 =[ $walk6, sham_walk7 ] {ai_walk(12);}; +void() sham_walk7 =[ $walk7, sham_walk8 ] {monster_footstep(FALSE); ai_walk(8);}; +void() sham_walk8 =[ $walk8, sham_walk9 ] {ai_walk(3);}; +void() sham_walk9 =[ $walk9, sham_walk10] {ai_walk(13);}; +void() sham_walk10 =[ $walk10, sham_walk11] {ai_walk(9);}; +void() sham_walk11 =[ $walk11, sham_walk12] {ai_walk(7);}; +void() sham_walk12 =[ $walk12, sham_walk1 ] {ai_walk(7);}; + +//====================================================================== +void() sham_run1 =[ $run1, sham_run2 ] { + // This attachment reset should not be here!?! + // Animation states (like range) can be interrupted + // and everything always comes back to the run loop + sham_reset_attachment(); + monster_idle_sound(); + ai_run(20); +}; +void() sham_run2 =[ $run2, sham_run3 ] {monster_footstep(FALSE); ai_run(24);}; +void() sham_run3 =[ $run3, sham_run4 ] {ai_run(20);}; +void() sham_run4 =[ $run4, sham_run5 ] {ai_run(20);}; +void() sham_run5 =[ $run5, sham_run6 ] {monster_footstep(FALSE); ai_run(24);}; +void() sham_run6 =[ $run6, sham_run1 ] {ai_run(20);}; + +//====================================================================== +// MELEE ATTACK 1 - Claw and Smash +// Merged shambler melee attacks (over head smash and side claw) +// Standardized to test vlen and zaxis height difference better +//====================================================================== +float SHAM_MSMASH = 1; +float SHAM_MCLAW = 2; + +//---------------------------------------------------------------------- +void(float melee_attack, float side) sham_meleeattack = +{ + local float ldmg, dmg_multiplier; + + if (!self.enemy) return; // Something to fight? + if (self.health < 1) return; // Shambler alive? + ai_damagebreakable(40); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESHAM)) return;// Too far away + dmg_multiplier = 1; + + // Get closer to enemy + if (melee_attack == SHAM_MSMASH) ai_charge(0); // Stationary attack + else if (melee_attack == SHAM_MCLAW) ai_charge(10); // Swing forward + + // Can the target bleed? - generate red/green blood + if (!CanDamage (self.enemy, self)) return; + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Shambler over head claw smash to ground (slow and high damage) + // If this is infighting do more damage as it will look more impressive + // Also if this damage is enough to kill in a single blow, gib for effect + if (melee_attack == SHAM_MSMASH) { + sound (self, CHAN_VOICE, self.meleehitsound, 1, ATTN_NORM); + // Do double damage to other monsters (overhead smash attack only) + if (self.enemy.flags & FL_MONSTER) dmg_multiplier = dmg_multiplier * 2; + // Damage 1-120 + ldmg = (random() + random() + random()) * (40*dmg_multiplier); + if (ldmg < 1) ldmg = 1; + // Make sure of impressive gib death + if (self.enemy.health < ldmg) ldmg = ldmg*3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); + } + // Shambler side swipe (left/right and half damage) + else if (melee_attack == SHAM_MCLAW) { + sound (self, CHAN_VOICE, self.meleehitsound, 1, ATTN_NORM); + // Damage 1-60 + ldmg = (random() + random() + random()) * 20; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +void() sham_smash1 =[ $smash1, sham_smash2 ] { +sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); ai_charge(2);}; +void() sham_smash2 =[ $smash2, sham_smash3 ] {monster_footstep(FALSE); ai_charge(6);}; +void() sham_smash3 =[ $smash3, sham_smash4 ] {ai_charge(6);}; +void() sham_smash4 =[ $smash4, sham_smash5 ] {ai_charge(5);}; +void() sham_smash5 =[ $smash5, sham_smash6 ] {ai_charge(4);}; +void() sham_smash6 =[ $smash6, sham_smash7 ] {ai_charge(1);}; +void() sham_smash7 =[ $smash7, sham_smash8 ] {ai_charge(0);}; +void() sham_smash8 =[ $smash8, sham_smash9 ] {ai_charge(0);}; +void() sham_smash9 =[ $smash9, sham_smash10 ] {ai_charge(0);}; +void() sham_smash10 =[ $smash10, sham_smash11 ] {sham_meleeattack(SHAM_MSMASH,0);}; +void() sham_smash11 =[ $smash11, sham_smash12 ] {ai_charge(5);}; +void() sham_smash12 =[ $smash12, sham_run1 ] {ai_charge(4);}; + +//---------------------------------------------------------------------- +void() sham_swingl1 =[ $swingl1, sham_swingl2 ] { +sound (self, CHAN_VOICE, "shambler/melee2.wav", 1, ATTN_NORM); ai_charge(5);}; +void() sham_swingl2 =[ $swingl2, sham_swingl3 ] {monster_footstep(FALSE); ai_charge(3);}; +void() sham_swingl3 =[ $swingl3, sham_swingl4 ] {ai_charge(7);}; +void() sham_swingl4 =[ $swingl4, sham_swingl5 ] {ai_charge(3);}; +void() sham_swingl5 =[ $swingl5, sham_swingl6 ] {ai_charge(7);}; +void() sham_swingl6 =[ $swingl6, sham_swingl7 ] {ai_charge(9);}; +void() sham_swingl7 =[ $swingl7, sham_swingl8 ] {ai_charge(5); sham_meleeattack(SHAM_MCLAW,250);}; +void() sham_swingl8 =[ $swingl8, sham_swingl9 ] {ai_charge(4);}; +void() sham_swingl9 =[ $swingl9, sham_run1 ] { ai_charge(8); + if (ai_checkmelee(MONAI_MELEESHAM)) { + if (self.enemy && self.enemy.health > 1) { + // Done one claw swing, go for the smash if a zombie + if (self.enemy.classgroup == CG_ZOMBIE) self.think = sham_smash1; + else self.think = sham_swingr1; + } + } +}; + +//---------------------------------------------------------------------- +void() sham_swingr1 =[ $swingr1, sham_swingr2 ] { +sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); ai_charge(1);}; +void() sham_swingr2 =[ $swingr2, sham_swingr3 ] {monster_footstep(FALSE); ai_charge(8);}; +void() sham_swingr3 =[ $swingr3, sham_swingr4 ] {ai_charge(14);}; +void() sham_swingr4 =[ $swingr4, sham_swingr5 ] {ai_charge(7);}; +void() sham_swingr5 =[ $swingr5, sham_swingr6 ] {ai_charge(3);}; +void() sham_swingr6 =[ $swingr6, sham_swingr7 ] {ai_charge(6);}; +void() sham_swingr7 =[ $swingr7, sham_swingr8 ] {ai_charge(6); sham_meleeattack(SHAM_MCLAW,-250);}; +void() sham_swingr8 =[ $swingr8, sham_swingr9 ] {ai_charge(3);}; +void() sham_swingr9 =[ $swingr9, sham_run1 ] { ai_charge(10); + if (ai_checkmelee(MONAI_MELEESHAM)) { + if (self.enemy && self.enemy.health > 1) { + // Done one claw swing, go for the smash if a zombie + if (self.enemy.classgroup == CG_ZOMBIE) self.think = sham_smash1; + else self.think = sham_swingl1; + } + } +}; + +//---------------------------------------------------------------------- +void() sham_melee = +{ + // Make sure lightning attachment is hidden + sham_reset_attachment(); + // If infighting and enemy is low on health, go for smash! + if (self.enemy.flags & FL_MONSTER && self.enemy.health < 40) sham_smash1 (); + else { + self.meleeattack = random(); + // Try to start with a smash + if (self.meleeattack > 0.6 || self.health == self.max_health) sham_smash1 (); + else if (self.meleeattack > 0.3) sham_swingr1 (); + else sham_swingl1 (); + } +}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() sham_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + //self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.alpha = 0.85; + self.attachment.state = FALSE; + } +}; + +//---------------------------------------------------------------------- +void() sham_reset_attachment = +{ + if (self.attachment) { + if (self.attachment.state) { + // Move attachment into place ready for use + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.frame = 0; + self.attachment.skin = 0; + setmodel(self.attachment, ""); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + setorigin(self.attachment, self.origin); + // Using empty model, so reset angle, frame and skin. + self.attachment.angles = self.angles; + self.attachment.state = FALSE; + } + } +}; + +//---------------------------------------------------------------------- +void() sham_setup_attachment = +{ + if (self.attachment) { + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setmodel(self.attachment, MODEL_PROJ_SHAMLIT); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.state = TRUE; + } +}; + +//---------------------------------------------------------------------- +void() sham_remove_attachment = +{ + if (self.attachment) { + self.attachment.state = FALSE; + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - classic hitscan lightning +//====================================================================== +void() sham_lightning = +{ + local vector org, dir; + if (self.health < 1) return; + + ai_face (); + self.effects = self.effects | EF_MUZZLEFLASH; + sham_reset_attachment(); + + makevectors(self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = self.enemy.origin + '0 0 16' - org; + dir = normalize (dir); + + // Check if the shambler can fire further than default + if (self.attack_sniper == TRUE) + self.enemydist = range_distance(self.enemy, FALSE); + else self.enemydist = MONAI_SHAMRANGE; + // Trace direct line of lightning infront of shambler + traceline (org, self.origin + dir*self.enemydist, TRUE, self); + + // Display lightning model segments + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Check for any breakables first + if (ai_foundbreakable(self, trace_ent, FALSE)) { + T_Damage (trace_ent, self, self, 80, DAMARMOR); + } + // Standard player lightning damage function + else LightningDamage (org, trace_endpos, self, 10); +}; + +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float litframe) sham_casting = +{ + local vector org, dir; + local float litpoint; + + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) sham_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (litframe == 0) sham_setup_attachment(); + + // Turn toward enemy + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + + // Place orb in the center of the electricity + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = litframe; + + // Work out each hand position + makevectors(self.angles); + self.pos1 = self.origin + attack_vector(leftofs); + self.pos2 = self.origin + attack_vector(rightofs); + + // Spawn some particles randomly along the lighting beam + dir = normalize(self.pos2 - self.pos1); + litpoint = vlen(self.pos2 - self.pos1) * random(); + self.pos3 = self.pos1 + (dir*litpoint); + particle_explode(self.pos3, 5+random()*5, 0.2+random(), PARTICLE_BURST_BLUE, PARTICLE_BURST_SKULLUP); +}; + +//---------------------------------------------------------------------- +void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face();sham_reset_attachment(); + sound (self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);}; +void() sham_magic2 =[ $magic2, sham_magic3 ] { + sham_casting('0 43 61','16 -4 75',0);}; +void() sham_magic3 =[ $magic3, sham_magic3b ] {ai_face(); + sham_casting('-16 42 69','7 0 80',1);}; +void() sham_magic3b =[ $magic3, sham_magic4 ] {ai_face(); + sham_casting('-14 38 68','8 6 78',2);}; +void() sham_magic4 =[ $magic4, sham_magic5 ] {monster_footstep(FALSE); + sham_casting('-22 35 75','6 3 80',3);}; +void() sham_magic5 =[ $magic5, sham_magic6 ] { + sham_casting('-3 26 88','19 -9 81',4);}; +void() sham_magic6 =[ $magic6, sham_magic9 ] {sham_lightning(); +sound (self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM);}; +void() sham_magic9 =[ $magic9, sham_magic10 ] {sham_lightning();}; +void() sham_magic10=[ $magic10,sham_magic11 ] {sham_lightning();monster_footstep(FALSE);}; +void() sham_magic11=[ $magic11,sham_magic12 ] { + if (skill == SKILL_NIGHTMARE) sham_lightning();}; +void() sham_magic12 =[ $magic12, sham_run1] {}; + +//============================================================================ +void() sham_pain1 =[$pain1, sham_pain2] {}; +void() sham_pain2 =[$pain2, sham_pain3] {}; +void() sham_pain3 =[$pain3, sham_pain4] {}; +void() sham_pain4 =[$pain4, sham_pain5] {}; +void() sham_pain5 =[$pain5, sham_pain6] {}; +void() sham_pain6 =[$pain6, sham_run1] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) sham_pain = +{ + // Reset lightning attachment + sham_reset_attachment(); + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) sham_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + sham_pain1 (); + } + } +}; + +//============================================================================ +void() sham_death1 =[ $death1, sham_death2 ] {}; +void() sham_death2 =[ $death2, sham_death3 ] {monster_check_gib();}; +void() sham_death3 =[ $death3, sham_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() sham_death4 =[ $death4, sham_death5 ] {}; +void() sham_death5 =[ $death5, sham_death6 ] {}; +void() sham_death6 =[ $death6, sham_death7 ] {}; +void() sham_death7 =[ $death7, sham_death8 ] {}; +void() sham_death8 =[ $death8, sham_death9 ] {}; +void() sham_death9 =[ $death9, sham_death10 ] {}; +void() sham_death10 =[ $death10, sham_death11 ] {monster_death_postcheck();}; +void() sham_death11 =[ $death11, sham_death11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() sham_die = +{ + // Finish and remove all attachments + sham_reset_attachment(); + sham_remove_attachment(); + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM); + sham_death1 (); + } + // Added feature for a Shambler marked with gibondeath + // would explode, but it looks confusing + // ** Feature removed ** + /* + else { + //Explosion for gib death! + T_RadiusDamage (self, self, 20, world, DAMAGEALL); + // Sprite/Particle based explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + // Play original explosion sound or replacement + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + } */ +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() sham_wakeup1 =[ $smash7, sham_wakeup2 ] { + sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM);}; +void() sham_wakeup2 =[ $smash9, sham_wakeup3 ] {}; +void() sham_wakeup3 =[ $smash10, sham_wakeup4 ] {}; +void() sham_wakeup4 =[ $smash11, sham_wakeup5 ] {}; +void() sham_wakeup5 =[ $smash12, sham_run1 ] {}; + +/*====================================================================== +QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_shambler = +{ + if (deathmatch) { remove(self); return; } + + if (self.poisonous) { + self.mdl = "progs/mon_shambler.mdl"; + self.headmdl = "progs/h_shambler.mdl"; // Large head + self.gib1mdl = "progs/gib_blclaw1.mdl"; // Left claw + self.gib2mdl = "progs/gib_blclaw2.mdl"; // Right claw + self.gib3mdl = "progs/gib_blfoot1.mdl"; // foot + self.gib4mdl = "progs/gib_blfoot2.mdl"; // foot + } + else { + self.mdl = "progs/mon_shambler.mdl"; + self.headmdl = "progs/h_shambler.mdl"; // Large head + self.gib1mdl = "progs/gib_shclaw1.mdl"; // Left claw + self.gib2mdl = "progs/gib_shclaw2.mdl"; // Right claw + self.gib3mdl = "progs/gib_shfoot1.mdl"; // foot + self.gib4mdl = "progs/gib_shfoot2.mdl"; // foot + } + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_SHAMLIT); + precache_model ("progs/s_light.mdl"); + precache_model ("progs/bolt.mdl"); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // Randomly swap claws and feet around + self.lip = random(); + if (self.lip < 0.25) self.gib1mdl = self.gib4mdl; + else if (self.lip < 0.5) self.gib2mdl = self.gib4mdl; + else if (self.lip < 0.75) self.gib3mdl = self.gib4mdl; + + self.idle_sound = "shambler/sidle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("shambler/sdeath.wav"); + self.pain_sound = "shambler/shurt2.wav"; + precache_sound (self.pain_sound); + + precache_sound ("shambler/sattck1.wav"); + precache_sound ("shambler/sboom.wav"); + precache_sound ("shambler/melee1.wav"); + precache_sound ("shambler/melee2.wav"); + + self.meleehitsound = "shambler/smack.wav"; + precache_sound (self.meleehitsound); + + self.sight_sound = "shambler/ssight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + self.exactskin = 1; // New green skin + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_MASSIVE; + if (self.health < 1) self.health = 600; + self.gibhealth = -60; + self.gibbed = FALSE; // In one peice + self.pain_flinch = 400; // Really low chance of pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // Long pause on pain + self.steptype = FS_TYPELARGE; // Large stomping feet + self.blockudeath = TRUE; // No player gib sound + self.attack_offset = '0 0 40'; // Between hands + self.deathstring = " was smashed by a Shambler\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0.5; self.resist_cells = 0; + + self.th_checkattack = ShamCheckAttack; + self.th_stand = sham_stand1; + self.th_walk = sham_walk1; + self.th_run = sham_run1; + self.th_die = sham_die; + self.th_melee = sham_melee; + self.th_missile = sham_magic1; + self.th_pain = sham_pain; + self.th_wakeup = sham_wakeup1; + + self.classtype = CT_MONSHAM; + self.classgroup = CG_SHAM; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_skullwiz.qc b/QC_other/QC_arcane/mon_skullwiz.qc new file mode 100644 index 00000000..27016a85 --- /dev/null +++ b/QC_other/QC_arcane/mon_skullwiz.qc @@ -0,0 +1,924 @@ +/*============================================================================== +SKULL WIZARD (Hexen2 model by Raven Software) +==============================================================================*/ + +// Fall backwards, vanish and robes fall down +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 + +// Summon minion +$frame summon1 summon2 summon3 summon4 summon5 summon6 summon7 summon8 +$frame summon9 summon10 summon11 summon12 summon13 summon14 summon15 summon16 +$frame summon17 summon18 summon19 summon20 summon21 summon22 summon23 summon24 +$frame summon25 summon26 summon27 summon28 summon29 summon30 + +// Pain A +$frame painA1 painA2 painA3 painA4 painA5 painA6 painA7 painA8 +$frame painA9 painA10 painA11 painA12 + +// Transition - Move from upright to crouch +$frame transA1 transA2 transA3 transA4 transA5 transA6 transA7 transA8 +$frame transA9 transA10 transA11 transA12 + +// Cast fireball spell (frame 12 - fire) +$frame spellA1 spellA2 spellA3 spellA4 spellA5 spellA6 spellA7 spellA8 +$frame spellA9 spellA10 spellA11 spellA12 spellA13 spellA14 spellA15 + +// Cast teleport spell (touching book) +$frame spellB1 spellB2 spellB3 spellB4 spellB5 spellB6 spellB7 spellB8 +$frame spellB9 spellB10 spellB11 spellB12 spellB13 spellB14 spellB15 + +// Transition - Move from crouch to upright +$frame transB1 transB2 transB3 transB4 transB5 transB6 transB7 + +// Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 + +// Default walk - very slow +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 + +// Teleport +$frame tele1 tele2 tele3 tele4 tele5 tele6 tele7 tele8 tele9 + +float SKULLW_STAND = 1; +float SKULLW_WALK = 2; +float SKULLW_HEIGHT = 96; +float SKULLW_DISTMIN = 256; +float SKULLW_DISTMAX = 512; + +//============================================================================ +void() skullw_stand1 =[ $stand1, skullw_stand2 ] { +self.idlebusy=SKULLW_STAND; monster_idle_sound();ai_stand();}; +void() skullw_stand2 =[ $stand18, skullw_stand3 ] {ai_stand();}; +void() skullw_stand3 =[ $stand16, skullw_stand4 ] {ai_stand();}; +void() skullw_stand4 =[ $stand14, skullw_stand5 ] {ai_stand();}; +void() skullw_stand5 =[ $stand12, skullw_stand6 ] {ai_stand();}; +void() skullw_stand6 =[ $stand3, skullw_stand7 ] {ai_stand();}; +void() skullw_stand7 =[ $stand5, skullw_stand8 ] {ai_stand();}; +void() skullw_stand8 =[ $stand7, skullw_stand9 ] {ai_stand();}; +void() skullw_stand9 =[ $stand9, skullw_stand10 ] {ai_stand();}; +void() skullw_stand10 =[ $stand11, skullw_stand11 ] {ai_stand();}; +void() skullw_stand11 =[ $stand13, skullw_stand12 ] {ai_stand();}; +void() skullw_stand12 =[ $stand15, skullw_stand13 ] {ai_stand();}; +void() skullw_stand13 =[ $stand17, skullw_stand14 ] {ai_stand();}; +void() skullw_stand14 =[ $stand19, skullw_stand1 ] {ai_stand();}; + +//============================================================================ +void() skullw_walk1 =[ $walk1, skullw_walk2 ] {monster_footstep(FALSE); +self.idlebusy=SKULLW_WALK; monster_idle_sound();ai_walk(2);}; +void() skullw_walk2 =[ $walk3, skullw_walk3 ] {ai_walk(5);}; +void() skullw_walk3 =[ $walk4, skullw_walk4 ] {ai_walk(5);}; +void() skullw_walk4 =[ $walk5, skullw_walk5 ] {ai_walk(4);}; +void() skullw_walk5 =[ $walk7, skullw_walk6 ] {ai_walk(4);}; +void() skullw_walk6 =[ $walk8, skullw_walk7 ] {ai_walk(2);}; +void() skullw_walk7 =[ $walk9, skullw_walk8 ] {ai_walk(2);}; +void() skullw_walk8 =[ $walk11, skullw_walk9 ] {ai_walk(2);}; +void() skullw_walk9 =[ $walk12, skullw_walk10 ] {monster_footstep(FALSE); ai_walk(2);}; +void() skullw_walk10 =[ $walk13, skullw_walk11 ] {ai_walk(5);}; +void() skullw_walk11 =[ $walk15, skullw_walk12 ] {ai_walk(5);}; +void() skullw_walk12 =[ $walk16, skullw_walk13 ] {ai_walk(4);}; +void() skullw_walk13 =[ $walk17, skullw_walk14 ] {ai_walk(4);}; +void() skullw_walk14 =[ $walk19, skullw_walk15 ] {ai_walk(2);}; +void() skullw_walk15 =[ $walk20, skullw_walk16 ] {ai_walk(2);}; +void() skullw_walk16 =[ $walk22, skullw_walk1 ] {ai_walk(3);}; + +//============================================================================ +// WALK -> STAND +void() skullw_transA1 =[ $transA5, skullw_transA2 ] {}; +void() skullw_transA2 =[ $transA7, skullw_transA3 ] {}; +void() skullw_transA3 =[ $transA9, skullw_transA4 ] {}; +void() skullw_transA4 =[ $transA11, skullw_stand1 ] {}; + +// STAND -> WALK +void() skullw_transB1 =[ $transB3, skullw_transB2 ] {}; +void() skullw_transB2 =[ $transB5, skullw_transB3 ] {}; +void() skullw_transB3 =[ $transB7, skullw_walk1 ] {}; + +//---------------------------------------------------------------------- +void() skullw_stand = +{ + if (self.idlebusy == SKULLW_WALK) skullw_transA1(); + else skullw_stand1(); +}; + +//---------------------------------------------------------------------- +void() skullw_walk = +{ + if (self.idlebusy == SKULLW_STAND) skullw_transB1(); + else skullw_walk1(); +}; + +//============================================================================ +void() skullw_run1 =[ $stand1, skullw_run2 ] {ai_face(); + monster_idle_sound();ai_run(0);}; +void() skullw_run2 =[ $stand18, skullw_run3 ] {ai_face();ai_run(0);}; +void() skullw_run3 =[ $stand16, skullw_run4 ] {ai_run(0);}; +void() skullw_run4 =[ $stand14, skullw_run5 ] {ai_run(0);}; +void() skullw_run5 =[ $stand12, skullw_run6 ] {ai_face();ai_run(0);}; +void() skullw_run6 =[ $stand3, skullw_run7 ] {ai_face();ai_run(0);}; +void() skullw_run7 =[ $stand5, skullw_run8 ] {ai_run(0);}; +void() skullw_run8 =[ $stand7, skullw_run9 ] {ai_run(0);}; +void() skullw_run9 =[ $stand9, skullw_run10] {ai_face();ai_run(0);}; +void() skullw_run10=[ $stand11, skullw_run11] {ai_face();ai_run(0);}; +void() skullw_run11=[ $stand13, skullw_run12] {ai_run(0);}; +void() skullw_run12=[ $stand15, skullw_run13] {ai_run(0);}; +void() skullw_run13=[ $stand17, skullw_run14] {ai_run(0);}; +void() skullw_run14=[ $stand19, skullw_run1 ] {ai_run(0);}; + +//============================================================================ +// MELEE - Teleportation +//============================================================================ +void() skullw_tfin1 =[ $tele9, skullw_tfin2 ] { + self.velocity = '0 0 0'; + // Always phase in facing the enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.angles_y = self.ideal_yaw; + sound (self, CHAN_AUTO, "skullwiz/blinkin.wav", 1, ATTN_NORM); +}; +void() skullw_tfin2 =[ $tele7, skullw_tfin3 ] {ai_face();}; +void() skullw_tfin3 =[ $tele5, skullw_tfin4 ] {ai_face();}; +void() skullw_tfin4 =[ $tele3, skullw_tfin5 ] {ai_face();}; +void() skullw_tfin5 =[ $tele1, skullw_run1 ] {ai_face(); + self.bodyphased = MONAI_SKULLWSOLID; + self.takedamage = DAMAGE_AIM; +}; + +//---------------------------------------------------------------------- +// Find new teleport location +//---------------------------------------------------------------------- +void() skullw_blink = { + local float dist, edist, blinkfinished, blinkcount; + local vector org, org_ofs, angle_vec; + + blinkfinished = TRUE; blinkcount = 0; + org = angle_vec = org_ofs = '0 0 0'; + org_ofs_z = self.height; + self.oldorigin = self.origin; + + // Trace upwards to find ceiling or maximum teleport height + traceline(self.origin, self.origin+org_ofs, TRUE, self); + org_ofs = trace_endpos; + + // Loop around for possible locations + while(blinkfinished) { + blinkcount = blinkcount + 1; // next loop + angle_vec_y = random() * 360; // Random direction + makevectors(angle_vec); // make vector + + // Generate random angle and trace teleport direction + dist = self.distmin + (random() * self.distmax); + org = org_ofs + (v_forward * dist); + traceline(org_ofs, org, TRUE, self); + + // Check distance is far enough away from enemy + // Move away from any walls (traceline is surface contact) + dist = vlen(trace_endpos - org_ofs) - 32; + org = org_ofs + (v_forward * dist); + edist = vlen(self.enemy.origin - org); + + // Is the enemy far enough away? + if (edist > MONAI_MELEESKULLW) { + // Trace down to floor below new point + traceline(org, org - '0 0 512', TRUE, self); + org = trace_endpos + self.view_ofs; + + // The teleport fuction is working with a radius command + // and this will ignore walls and just find any position + // in all directions. This can lead to the skull wizard + // teleporting behind walls or other parts of the map! + // This can be prevent in two ways: + // 1) linesight between skull wizard and player + // - can leads to less interesting locations (always insight) + // 2) linesight between new location and old + // - This allows skull wizard to teleport around corner + // and still be within the same area! + // + // Trace through monsters and check trace fraction + traceline(org, self.origin, TRUE, self); + if (trace_fraction == 1) blinkfinished = FALSE; + } + + // Been looping too long, back to original location + if (blinkcount > 10) { + blinkfinished = FALSE; + org = self.origin; + } + } + + // Move to new location + self.solid = SOLID_SLIDEBOX; // Standard monster movement + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + setorigin(self, org); // move to new location + + // Test if new location is solid? + if (!walkmove (0, 0)) { + self.solid = SOLID_NOT; // No world interaction yet + setmodel(self,""); // Turn off model + setorigin(self, self.oldorigin); // restore original location + self.nextthink = time + 1; // Keep checking + self.think = skullw_blink; + } + else skullw_tfin1(); +}; + +//---------------------------------------------------------------------- +// Cycle around teleport chain lists instead +//---------------------------------------------------------------------- +void() skullw_waitforlink = +{ + self.nextthink = time + 0.5 + random(); + self.think = skullw_waitforlink; + setorigin(self, self.movelast.origin); // move to new location + self.enemydist = range_distance(self.enemy, FALSE); + + // Is the enemy too close or dead? + if (self.enemydist > self.movelast.distance || self.enemy.health < 1) { + // Move to new location + self.solid = SOLID_SLIDEBOX; // Standard monster movement + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + // Test if new location is solid? + if (!walkmove (0, 0)) { + self.solid = SOLID_NOT; // No world interaction yet + setmodel(self,""); // Turn off model + } + else skullw_tfin1(); + } +}; + +//---------------------------------------------------------------------- +void() skullw_checkblinklist = { + // Does the blink list exist already? + if (self.movelast.classtype != CT_SKULLTELEPORT) { + self.movelast = find(world,targetname,self.target2); + // Does the entity chain exist? + if (self.movelast.classtype == CT_SKULLTELEPORT) + skullw_waitforlink(); + else { + // target2 is not valid, do regular teleport + self.target2 = ""; + skullw_blink(); + } + } + else { + // Move forward in chain and try next spawn location + self.movelast = self.movelast.enemy; + skullw_waitforlink(); + } +}; + +//---------------------------------------------------------------------- +// touch book and phase out +//---------------------------------------------------------------------- +void() skullw_tele1 =[ $spellB3, skullw_tele2 ] { + self.pain_finished = time + 1; // no pain during teleportation + if (random() < 0.5) sound (self, CHAN_VOICE, "skullwiz/blinkspk1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "skullwiz/blinkspk2.wav", 1, ATTN_NORM); +}; +void() skullw_tele2 =[ $spellB5, skullw_tele3 ] {}; +void() skullw_tele3 =[ $spellB7, skullw_tele4 ] {}; +void() skullw_tele4 =[ $spellB9, skullw_tele6 ] {}; +void() skullw_tele6 =[ $spellB13, skullw_tele8 ] {}; +void() skullw_tele8 =[ $tele1, skullw_tele9 ] { + self.takedamage = DAMAGE_NO; // No damage or impact, phasing out + self.solid = SOLID_NOT; + self.bodyphased = MONAI_SKULLWINVIS; + particle_explode(self.origin, 100, 1, self.part_style, PARTICLE_BURST_SKULLUP); + sound (self, CHAN_VOICE, "skullwiz/blinkout.wav", 1, ATTN_NORM); +}; +void() skullw_tele9 =[ $tele3, skullw_tele10 ] {}; +void() skullw_tele10=[ $tele5, skullw_tele11 ] {}; +void() skullw_tele11=[ $tele7, skullw_tele12 ] {}; +void() skullw_tele12=[ $tele9, skullw_tele13 ] {}; +void() skullw_tele13 = { + setmodel(self,""); + // Check if a chain list has been defined + if (self.target2 != "") skullw_checkblinklist(); + else skullw_blink(); +}; + +//============================================================================ +// Rocket Skull Attack (Regular) +//============================================================================ +void(vector orgofs) skullw_fire = +{ + local vector org, dir; + + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + if (random() < 0.5) sound (self, CHAN_WEAPON, "skullwiz/skull1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "skullwiz/skull2.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(orgofs); + dir = normalize(self.enemy.origin - org); + + self.attack_speed = SPEED_SWIZMISSILE + (skill * SPEED_SWIZSKILL); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_SKULLW, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() skullw_attack1 =[ $spellA3, skullw_attack2 ] { +sound (self, CHAN_VOICE, "skullwiz/attack.wav", 1, ATTN_NORM);}; +void() skullw_attack2 =[ $spellA5, skullw_attack3 ] {ai_face();}; +void() skullw_attack3 =[ $spellA7, skullw_attack4 ] {ai_face();}; +void() skullw_attack4 =[ $spellA10, skullw_attack5 ] {ai_face();}; +void() skullw_attack5 =[ $spellA11, skullw_attack6 ] {ai_face();}; +void() skullw_attack6 =[ $spellA12, skullw_attack7 ] {skullw_fire('30 0 16');}; +void() skullw_attack7 =[ $spellA13, skullw_attack8 ] {}; +void() skullw_attack8 =[ $spellA15, skullw_run1 ] {}; + +//============================================================================ +// Poison Skull Attack (Guardians) +//============================================================================ +void() skullw_poison_touch = +{ + if (other.solid == SOLID_TRIGGER) return; + if (other.classtype == CT_TEMPSTREAM) return; + if (other.health > 0) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 1; + self.modelindex = 0; // Make sure no model + self.model = ""; + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() skullw_poison_think = +{ + // Randomly drift upwards and slow down forward movement + self.velocity_z = self.velocity_z + 10 + (random() * 20); + self.velocity = self.velocity - (self.velocity * 0.125); + + self.frame = self.frame + 1; + if (self.frame > self.count) SUB_Remove(); + else self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() skullw_guardian = +{ + local float poison_loop; + local vector poison_angles, org, dir; + + // Double check the skull wizard has poisonous flag set + if (!self.poisonous) return; + + // Remove projectile + entity_remove(self, 1); + // Play explosion sound + sound (self, CHAN_WEAPON, "skullwiz/poison_hit.wav", 1, ATTN_NORM); + + // Apply any direct damage and poison effect + if (other.takedamage) { + T_Damage (other, self, self.owner, DAMAGE_SWIZPOISON, DAMARMOR); + if (other.flags & FL_CLIENT) PoisonDeBuff(other); + } + + poison_loop = 0; + poison_angles = '0 0 0'; + + while (poison_loop < 360) { + newmis = spawn(); + newmis.classtype = CT_TEMPSTREAM; + newmis.movetype = MOVETYPE_FLY; // Fly, no gravity + newmis.solid = SOLID_TRIGGER; + setmodel(newmis, SBURST_POISON); + + org = self.origin; + org_z = org_z + (crandom() * 24); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + poison_angles_y = poison_loop; + makevectors(poison_angles); + dir = vecrand(0,50,FALSE); + dir = dir + (v_forward * (400 + random() * 50)); + newmis.velocity = dir; + newmis.count = 6; + newmis.frame = rint(random()*2); + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) newmis.effects = newmis.effects + EF_NOSHADOW; + + newmis.think = skullw_poison_think; + newmis.touch = skullw_poison_touch; + newmis.nextthink = time + 0.1; + + poison_loop = poison_loop + rint(random()*15); + } +}; + +//============================================================================ +// SUMMON MINION - Purple magic ball +//============================================================================ +void() skullw_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_SWBALL; + } +}; + +//---------------------------------------------------------------------- +void() skullw_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() skullw_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +// Display a purple ball in the hand of the skull wizard +//---------------------------------------------------------------------- +void(vector orgofs, float dbframe) skullw_sumball = +{ + local vector org; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.pos2); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 0; + self.attachment.alpha = 0.85; + } + + // Generate attachment in hand (left) + makevectors(self.angles); + org = self.origin + attack_vector(orgofs); + setorigin(self.attachment, org); + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = dbframe; + + // Create particles inside of skull wizard robes floating up + // once lost soul is spawning, then switch particle location + if (self.aflag == TRUE) particle_explode(self.pos2, 3, 1, self.part_style, PARTICLE_BURST_MINOTAUR); + // Need to cut down on particles, too much visual noise + // else particle_debuff(self.origin, 16, rint(4+random()*4), self.part_style); +}; + +//---------------------------------------------------------------------- +// Raise hand up to the sky and spawn purple particles from body +// Always check if there is space to spawn a lost soul first +// Block monster pain function so that the summons is completed +//---------------------------------------------------------------------- +void() skullw_summon1 =[ $summon1, skullw_summon2 ] { + ai_face();self.pain_finished = time + 2;}; +void() skullw_summon2 =[ $summon3, skullw_summon3 ] { + ai_face();skullw_sumball('22 -2 6',0);}; +void() skullw_summon3 =[ $summon5, skullw_summon4 ] { + ai_face(); skullw_sumball('23 -3 7',1); + sound (self, CHAN_BODY, "skullwiz/summon.wav", 1, ATTN_NORM); + /* The touch trigger is created early (4 frames) so its gets + // a chance for a client to touch its bounding box + // This is a giant trigger area to catch speedy players + makevectors(self.angles); + self.pos1 = self.origin + self.view_ofs + v_forward*64 + v_up*16; + setup_minionspace(self.pos1, '-32 -32 -32', '32 32 32'); */ +}; +void() skullw_summon4 =[ $summon7, skullw_summon5 ] {skullw_sumball('24 -4 9',2);}; +void() skullw_summon5 =[ $summon9, skullw_summon6 ] {skullw_sumball('26 -4 10',3);}; +void() skullw_summon6 =[ $summon11, skullw_summon7 ] {skullw_sumball('26 -4 12',3);}; +void() skullw_summon7 =[ $summon13, skullw_summon8 ] { + // Find out if there is enough space to spawn a lost soul + // This is really a tricky thing to test for ... + // * pointcontents only checks against world space + // * walkmove does not work properly on the lower plane face + // * touch triggers only work when something touches not inside + // * findradius will find a lot of entities depending on radius + + // Touch trigger version + //self.aflag = test_minionspace(); + + // Findradius version + makevectors(self.angles); + self.pos1 = self.origin + self.view_ofs + v_forward*64 + v_up*16; + self.aflag = find_minionspace(self.pos1); + + // If the spawn locaiton all clear, spawn something! + if (self.aflag == TRUE) { + minion_lostsoul(self.pos1, self.enemy); + self.pos2 = self.pos1 - '0 0 16'; // Where to spawn particles + skullw_sumball('26 -4 14',4); + } +}; +void() skullw_summon8 =[ $summon15, skullw_summon9 ] {skullw_sumball('26 -4 16',4);}; +void() skullw_summon9 =[ $summon17, skullw_summon10 ] {skullw_sumball('26 -4 19',4);}; +void() skullw_summon10 =[ $summon19, skullw_summon11 ] {skullw_sumball('26 -5 23',4);}; +void() skullw_summon11 =[ $summon21, skullw_summon12 ] {skullw_sumball('26 -6 30',3);}; +void() skullw_summon12 =[ $summon23, skullw_summon13 ] {skullw_sumball('19 -7 32',1);}; +void() skullw_summon13 =[ $summon25, skullw_summon14 ] {skullw_finish_attachment(); + if (self.aflag == TRUE) particle_explode(self.pos1, 15, 2, self.part_style, PARTICLE_BURST_MINOTAUR);}; +void() skullw_summon14 =[ $summon27, skullw_summon15 ] {ai_face();}; +void() skullw_summon15 =[ $summon29, skullw_run1 ] { + ai_face();SUB_AttackFinished (1 + 2*random());}; + +//---------------------------------------------------------------------- +// Both type of skull wizards go through the same magic function +//---------------------------------------------------------------------- +void() skullw_magic = +{ + local entity miniondef; + + // Make sure the attachments are setup ready + skullw_create_attachment(); + + if (self.spawnflags & MON_SKULLWIZ_MINIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_skullwizminion"); + if (miniondef.classtype == CT_CACHELOSTSOUL) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[SKULLWIZ]\b Cannot find minion template!\n"); + self.spawnflags = self.spawnflags - MON_SKULLWIZ_MINIONS; + } + } + + // Is the target the player or monster? + if (self.enemy.flags & FL_CLIENT) { + if (self.spawnflags & MON_SKULLWIZ_MINIONS) { + // has the lost soul limit been reached? + if (query_minionactive(self) == TRUE) skullw_summon1(); + else { + if (self.minion_baseattack > 0 ) skullw_attack1(); + else skullw_run1(); + } + } + // Red Skull wizards attacks with skull rockets + else skullw_attack1(); + + } + // Always attack monsters with skull rockets + else skullw_attack1(); +}; + +//============================================================================ +void() skullw_phased = { + self.nextthink = time + 0.1; // Keep looking for player + self.think = skullw_phased; // Keep looping + if (random() < 0.02) + particle_explode(self.origin, rint(10+random()*10), 1, self.part_style, PARTICLE_BURST_SKULLUP); + monster_idle_sound(); // High chance of idle sound + ai_stand(); // Keep looking +}; + +//---------------------------------------------------------------------- +void() skullw_wakeup = +{ + // Reset all monster state functions back to default + self.th_stand = skullw_stand; + self.th_walk = skullw_walk; + self.th_run = skullw_run1; + self.th_missile = skullw_magic; + self.th_melee = skullw_tele1; + self.th_updmissile = skullw_guardian; + + // Temporarily restore model/bound box + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + + // Can the skull wizard move? + if (!walkmove (0, 0)) { + // Something blocking, teleport elsewhere + self.solid = SOLID_NOT; + setmodel(self,""); + self.nextthink = time + 0.1; + self.think = skullw_blink; + } + else skullw_tfin1(); +}; + +//============================================================================ +// Short body recoil (6 frames) +void() skullw_painA1 =[ $painA2, skullw_painA2 ] {}; +void() skullw_painA2 =[ $painA4, skullw_painA3 ] {}; +void() skullw_painA3 =[ $painA6, skullw_painA4 ] {}; +void() skullw_painA4 =[ $painA8, skullw_painA5 ] {}; +void() skullw_painA5 =[ $painA10, skullw_painA6 ] {}; +void() skullw_painA6 =[ $painA12, skullw_run1 ] {}; + +// Long expanded out version (10 frames) +void() skullw_painB1 =[ $painA2, skullw_painB3 ] {}; +void() skullw_painB3 =[ $painA3, skullw_painB4 ] {}; +void() skullw_painB4 =[ $painA4, skullw_painB5 ] {}; +void() skullw_painB5 =[ $painA5, skullw_painB6 ] {}; +void() skullw_painB6 =[ $painA6, skullw_painB7 ] {}; +void() skullw_painB7 =[ $painA7, skullw_painB8 ] {}; +void() skullw_painB8 =[ $painA8, skullw_painB9 ] {}; +void() skullw_painB9 =[ $painA9, skullw_painB10 ] {}; +void() skullw_painB10 =[ $painA10, skullw_painB11 ] {}; +void() skullw_painB11 =[ $painA11, skullw_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) skullw_pain = +{ + // Cannot feel pain when phased out + if (self.bodyphased == MONAI_SKULLWINVIS) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + skullw_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + if (random() < 0.85) skullw_painA1(); // classic, body recoil + else skullw_painB1(); // Really long version + } + } +}; + +//============================================================================ +void() skullw_fadeaway = +{ + // sound (self, CHAN_BODY, "skullwiz/fadeaway.wav", 1, ATTN_NORM); + // Particle burst upwards as robes fade away + particle_explode(self.origin, 100, 3, self.part_style, PARTICLE_BURST_SKULLUP); + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() skullw_explode = +{ + self.health = MON_NOGIBVELOCITY; // Low gib directional modifier + particle_explode(self.origin, 100, 3, PARTICLE_BURST_WHITE, PARTICLE_BURST_SKULLUP); + self.gib2skin = self.exactskin; // Update book skin + ThrowGib(11,1); ThrowGib(12,1); // Throw head and book +}; + +//---------------------------------------------------------------------- +void() skullw_death1 =[ $death2, skullw_death2 ] {ai_face();}; +void() skullw_death2 =[ $death3, skullw_death3 ] {ai_face();}; +void() skullw_death3 =[ $death4, skullw_death4 ] {ai_face();self.solid = SOLID_NOT;}; +void() skullw_death4 =[ $death5, skullw_death5 ] {ai_face();}; +void() skullw_death5 =[ $death6, skullw_death6 ] {skullw_explode();}; +void() skullw_death6 =[ $death7, skullw_death7 ] {}; +void() skullw_death7 =[ $death8, skullw_death8 ] {}; +void() skullw_death8 =[ $death9, skullw_death9 ] {}; +void() skullw_death9 =[ $death10, skullw_death10 ] {}; +void() skullw_death10 =[ $death11, skullw_death11 ] {}; +void() skullw_death11 =[ $death12, skullw_death12 ] {}; +void() skullw_death12 =[ $death13, skullw_death13 ] {}; +void() skullw_death13 =[ $death14, skullw_death14 ] {}; +void() skullw_death14 =[ $death15, skullw_death14] { + // Random timer for robes to fade away + self.think = skullw_fadeaway; + self.nextthink = time + 8 + random() * 8; +}; + +//---------------------------------------------------------------------- +void() skullw_die = +{ + // Play fade away/death sound + sound (self, CHAN_VOICE, "skullwiz/death.wav", 1, ATTN_NORM); + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + skullw_remove_attachment(); + + // Special death, Instantly vaporize cloak + // This is really a gib death without the gibs! + if (self.health < -40) { + // Typical Grenade explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + SpawnExplosion(EXPLODE_MED, self.origin, SOUND_REXP3); + + self.health = MON_NOGIBVELOCITY; // Low gib directional modifier + self.gib2skin = self.exactskin; // Update book skin + ThrowGib(11,1); ThrowGib(12,1); // Throw head and book + entity_hide(self); + } + // Regular death, collapse and fade away + else { + // Large particle explosion upwards + particle_explode(self.origin, 100, 3, self.part_style, PARTICLE_BURST_SKULLUP); + skullw_death1(); + } +}; + +/*====================================================================== +QUAKED monster_skullwiz (0.5 0 1) (-16 -16 -24) (16 16 40) +======================================================================*/ +void() monster_skullwiz = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_skullwiz.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_SWSKULL); // explosive flaming skull + precache_model (MODEL_PROJ_SWSKULLP); // explosive poison skull + precache_model (MODEL_PROJ_SWBALL); // Purple minion ball + precache_model (SBURST_POISON); // Poison explosion + + self.gib1mdl = "progs/h_skullwiz.mdl"; // Skull head + self.gib2mdl = "progs/w_skullbook.mdl"; // Unique book item + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + + self.idle_sound = "skullwiz/idle1.wav"; + self.idle_sound2 = "skullwiz/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("skullwiz/death.wav"); + self.pain_sound = "skullwiz/pain1.wav"; + self.pain_sound2 = "skullwiz/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("skullwiz/attack.wav"); // fire spell + precache_sound ("skullwiz/skull1.wav"); // Screaming skull attack + precache_sound ("skullwiz/skull2.wav"); + precache_sound ("skullwiz/summon.wav"); + precache_sound ("skullwiz/poison_hit.wav"); // Guardian Explosion + + precache_sound ("skullwiz/blinkspk1.wav"); // Talk casting blink spell + precache_sound ("skullwiz/blinkspk2.wav"); + precache_sound ("skullwiz/blinkout.wav"); // Sound of blink animation + precache_sound ("skullwiz/blinkin.wav"); + + self.sight_sound = "skullwiz/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 50; // Armour strength robes! + self.steptype = FS_TYPEMEDIUM; // Humanoid footsteps + self.pain_longanim = FALSE; // No long pain animation + self.poisonous = FALSE; // Only Guardians can be poisonous + self.deathstring = " was blown apart by a Skull Wizard\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Skull wizards have special animation movement sets + // Need extra parameters for their teleporting ability + // Can be setup to start phased out and surprise the player + self.idlebusy = SKULLW_STAND; + if (self.height == 0) self.height = SKULLW_HEIGHT; + if (self.distmin == 0) self.distmin = SKULLW_DISTMIN; + if (self.distmax == 0) self.distmax = SKULLW_DISTMAX; + if (!self.bodyphased) self.bodyphased = MONAI_SKULLWSOLID; + else self.bodyphased = MONAI_SKULLWINVIS; + + self.th_checkattack = SkullWizCheckAttack; + self.th_updmissile = skullw_guardian; + self.th_pain = skullw_pain; + self.th_die = skullw_die; + + // Does the skull wizard start phased out? + // Need to intercept idle/combat functions + if (self.bodyphased == MONAI_SKULLWINVIS) { + self.th_stand = skullw_phased; + self.th_walk = skullw_phased; + self.th_run = skullw_wakeup; + self.th_missile = skullw_wakeup; + self.th_melee = skullw_wakeup; + } + else { + self.th_stand = skullw_stand; + self.th_walk = skullw_walk; + self.th_run = skullw_run1; + self.th_missile = skullw_magic; + self.th_melee = skullw_tele1; + } + + self.classtype = CT_MONSKULLW; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEWALK; + + // Special black robes for skull spawner + if (self.spawnflags & MON_SKULLWIZ_MINIONS) { + self.health = self.health * 1.5; // 150% HP + if (!self.exactskin) self.exactskin = 2; // Black robes + } + // Special green robes for rune guardians + else if (self.spawnflags & MON_SKULLWIZ_GUARDIAN) { + self.health = self.health * 2; // 200% HP + if (!self.exactskin) self.exactskin = 3; // Green robes + self.poisonous = TRUE; // Explosive Poison + } + + // Make sure the particles match the skin + if (self.exactskin == 1) self.part_style = PARTICLE_BURST_GREEN; + else if (self.exactskin == 2) self.part_style = PARTICLE_BURST_PURPLE; + else if (self.exactskin == 3) self.part_style = PARTICLE_BURST_GREEN; + else if (self.exactskin == 4) self.part_style = PARTICLE_BURST_WHITE; + else self.part_style = PARTICLE_BURST_RED; + + monster_start(); +}; + +/*====================================================================== +/*QUAKED info_skullwiz_destination (0.6 0 0.8) (-16 -16 -24) (16 16 40) x +Teleport destination for skull wizard ONLY +-------- KEYS -------- +targetname : part of a chain group (required) +target : next destination in the chain +distance : Minimum distance enemy needs to be before spawning +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Teleport destination for skull wizard ONLY + +======================================================================*/ +void() info_skullwiz_link = +{ + local entity currlink, master; + local float loopcondition; + + // Teleport destination already been linked + if (self.enemy) return; + + // The master entity is the start of the chain + // the currlink is a link in the chain + master = self; + loopcondition = TRUE; + + while (loopcondition) + { + // Setup next link to master and find next link + self.enemy = master; + currlink = find(world, targetname, self.target); + // reached end of list? + if (!currlink || currlink == master) + loopcondition = FALSE; + else { + // Move forward in the chain + self.enemy = currlink; + self = currlink; + } + } +}; + +//---------------------------------------------------------------------- +void() info_skullwiz_destination = +{ + // All teleportation points need to be part of a chain + // Otherwise the skull Wizard would have to use findradius + // which is expensive if lots of entities are around + if (self.targetname == "" || self.target == "") { + dprint("\b[SKULLWIZ_DEST]\b missing target or targetname\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + self.classtype = CT_SKULLTELEPORT; + self.mangle = self.angles; + // Setup minimum player spawn distance + if (self.distance <=0) self.distance = MONAI_MELEESKULLW; + // Setup if the destination is active or not + self.state = FALSE; + + // Check for targetname->target loops + if (self.targetname == self.target) { + self.enemy = self; + self.owner = self; + } + else { + // Wait for all targets to spawn + self.think = info_skullwiz_link; + self.nextthink = time + 0.2 + random(); + } +}; + diff --git a/QC_other/QC_arcane/mon_soldier.qc b/QC_other/QC_arcane/mon_soldier.qc new file mode 100644 index 00000000..891d3236 --- /dev/null +++ b/QC_other/QC_arcane/mon_soldier.qc @@ -0,0 +1,527 @@ +/*============================================================================== +SOLDIER / PLAYER +==============================================================================*/ +$cd id1/models/soldier3 +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 + +$frame load1 load2 load3 load4 load5 load6 load7 load8 load9 load10 load11 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 shoot9 + +$frame walk_1 walk_2 walk_3 walk_4 walk_5 walk_6 walk_7 walk_8 +$frame walk_9 walk_10 walk_11 walk_12 walk_13 walk_14 walk_15 walk_16 +$frame walk_17 walk_18 walk_19 walk_20 walk_21 walk_22 walk_23 walk_24 + +void() army_fire; + +//====================================================================== +void() army_stand1 =[ $stand1, army_stand2 ] {monster_idle_sound(); ai_stand();}; +void() army_stand2 =[ $stand2, army_stand3 ] {ai_stand();}; +void() army_stand3 =[ $stand3, army_stand4 ] {ai_stand();}; +void() army_stand4 =[ $stand4, army_stand5 ] {ai_stand();}; +void() army_stand5 =[ $stand5, army_stand6 ] {ai_stand();}; +void() army_stand6 =[ $stand6, army_stand7 ] {ai_stand();}; +void() army_stand7 =[ $stand7, army_stand8 ] {ai_stand();}; +void() army_stand8 =[ $stand8, army_stand1 ] {ai_stand();}; + +//====================================================================== +void() army_walk1 =[ $walk_1, army_walk2 ] {monster_footstep(FALSE);ai_walk(1);}; +void() army_walk2 =[ $walk_2, army_walk3 ] {monster_idle_sound();ai_walk(1);}; +void() army_walk3 =[ $walk_3, army_walk4 ] {ai_walk(1);}; +void() army_walk4 =[ $walk_4, army_walk5 ] {ai_walk(1);}; +void() army_walk5 =[ $walk_5, army_walk6 ] {ai_walk(2);}; +void() army_walk6 =[ $walk_6, army_walk7 ] {ai_walk(3);}; +void() army_walk7 =[ $walk_7, army_walk8 ] {ai_walk(4);}; +void() army_walk8 =[ $walk_8, army_walk9 ] {ai_walk(4);}; +void() army_walk9 =[ $walk_9, army_walk10 ] {ai_walk(2);}; +void() army_walk10 =[ $walk_10, army_walk11 ] {ai_walk(2);}; +void() army_walk11 =[ $walk_11, army_walk12 ] {ai_walk(2);}; +void() army_walk12 =[ $walk_12, army_walk13 ] {monster_footstep(FALSE);ai_walk(1);}; +void() army_walk13 =[ $walk_13, army_walk14 ] {ai_walk(0);}; +void() army_walk14 =[ $walk_14, army_walk15 ] {ai_walk(1);}; +void() army_walk15 =[ $walk_15, army_walk16 ] {ai_walk(1);}; +void() army_walk16 =[ $walk_16, army_walk17 ] {ai_walk(1);}; +void() army_walk17 =[ $walk_17, army_walk18 ] {ai_walk(3);}; +void() army_walk18 =[ $walk_18, army_walk19 ] {ai_walk(3);}; +void() army_walk19 =[ $walk_19, army_walk20 ] {ai_walk(3);}; +void() army_walk20 =[ $walk_20, army_walk21 ] {ai_walk(3);}; +void() army_walk21 =[ $walk_21, army_walk22 ] {ai_walk(2);}; +void() army_walk22 =[ $walk_22, army_walk23 ] {ai_walk(1);}; +void() army_walk23 =[ $walk_23, army_walk24 ] {ai_walk(1);}; +void() army_walk24 =[ $walk_24, army_walk1 ] {ai_walk(1);}; + +//====================================================================== +void() army_run1 =[ $run1, army_run2 ] {monster_idle_sound();ai_run(11);}; +void() army_run2 =[ $run2, army_run3 ] {monster_footstep(FALSE);ai_run(15);}; +void() army_run3 =[ $run3, army_run4 ] {ai_run(10);}; +void() army_run4 =[ $run4, army_run5 ] {ai_run(10);}; +void() army_run5 =[ $run5, army_run6 ] {ai_run(8);}; +void() army_run6 =[ $run6, army_run7 ] {monster_footstep(FALSE);ai_run(15);}; +void() army_run7 =[ $run7, army_run8 ] {ai_run(10);}; +void() army_run8 =[ $run8, army_run1 ] {ai_run(8);}; + +// Move backwards to create some space to fire a rocket +void() army_runback1 =[ $run8, army_runback2 ] {ai_backface(8);}; +void() army_runback2 =[ $run7, army_runback3 ] {ai_backface(10);}; +void() army_runback3 =[ $run6, army_runback4 ] {monster_footstep(FALSE);ai_backface(15);}; +void() army_runback4 =[ $run5, army_runback5 ] {ai_backface(8);}; +void() army_runback5 =[ $run4, army_runback6 ] {ai_backface(10);}; +void() army_runback6 =[ $run3, army_runback7 ] {ai_backface(10);}; +void() army_runback7 =[ $run2, army_runback8 ] {monster_footstep(FALSE);ai_backface(15);}; +void() army_runback8 =[ $run1, army_run1 ] {ai_backface(11);}; + +//====================================================================== +void() army_fire = +{ + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "soldier/sattck1.wav", 1, ATTN_NORM); + + // Choose between a projectile or hit-scan system + if (query_configflag(SVR_SHOTGPROJ)) + FireBullets (QUANTITY_GRUNT, SPREAD_GRUNT); + else { + Launch_Shells(QUANTITY_GRUNT, SPREAD_GRUNT, CT_PROJ_SG); + Launch_ShellCasing(1); + } +}; + +//---------------------------------------------------------------------- +void() army_atk1 =[ $shoot1, army_atk2 ] {ai_face();}; +void() army_atk2 =[ $shoot2, army_atk3 ] {ai_face();}; +void() army_atk3 =[ $shoot3, army_atk4 ] {ai_face();}; +void() army_atk4 =[ $shoot4, army_atk5 ] {ai_face();}; +void() army_atk5 =[ $shoot5, army_atk6 ] {ai_face();army_fire();}; +void() army_atk6 =[ $shoot6, army_atk7 ] {}; +void() army_atk7 =[ $shoot7, army_atk8 ] {ai_face();SUB_CheckRefire (army_atk1);}; +void() army_atk8 =[ $shoot8, army_atk9 ] {}; +void() army_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +//====================================================================== +void() army_fire_rocket = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + // check for enemy origin (based on sight test) + // if cannot see enemy fire at last known location + ai_trackenemy(); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "soldier/rocket_fire.wav", 1, ATTN_NORM); + + self.attack_speed = 250; + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(self.attack_track - org); + + Launch_Missile (org, dir, '0 0 0', CT_PROJ_ARMY, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() army_rocket_think = +{ + // Only do a limited amount of updates to the missile + self.count = self.count + 1; + if (self.count < (5+skill)) { + // Keep ticking (slowly) + self.nextthink = time + 0.1; + // If enemy active, track them down (slow turn) + if (self.enemy && self.count < 5) { + // Speed up and steer towards enemy + self.attack_speed = self.attack_speed + 100; + self.attack_track = normalize(self.enemy.origin - self.origin); + self.velocity = self.attack_track * self.attack_speed; + self.angles = vectoangles(self.velocity); + } + // Fire at original location + else self.velocity = self.velocity * 1.15; + } + else { + // Remove missile after a while + self.nextthink = time + LIFE_ROCKET; + self.think = SUB_Remove; + } +}; + +//---------------------------------------------------------------------- +void() army_rocket_atk1 =[ $load1, army_load2 ] {ai_face(); + self.pain_finished = time + 1.3; + self.attack_track = self.enemy.origin; + sound (self, CHAN_WEAPON, "soldier/rocket_load.wav", 1, ATTN_NORM); +}; +void() army_load2 =[ $load2, army_load3 ] {ai_trackenemy();}; +void() army_load3 =[ $load3, army_load4 ] {ai_trackenemy();}; +void() army_load4 =[ $load4, army_load5 ] {ai_trackenemy();}; +void() army_load5 =[ $load5, army_load6 ] {ai_trackenemy();}; +void() army_load6 =[ $load6, army_load7 ] {ai_trackenemy();}; +void() army_load7 =[ $load7, army_load8 ] {ai_trackenemy();}; +void() army_load8 =[ $load8, army_load9 ] {ai_trackenemy();}; +void() army_load9 =[ $load9, army_load10 ] {ai_trackenemy();}; +void() army_load10 =[ $load10,army_load11 ] {ai_trackenemy();}; +void() army_load11 =[ $load11,army_atkr5 ] {ai_trackenemy();}; +void() army_atkr5 =[ $shoot5,army_atkr6 ] {army_fire_rocket();}; +void() army_atkr6 =[ $shoot6,army_atkr7 ] {}; +void() army_atkr7 =[ $shoot7,army_atkr8 ] {SUB_CheckRefire (army_rocket_atk1);}; +void() army_atkr8 =[ $shoot8,army_atkr9 ] {}; +void() army_atkr9 =[ $shoot9,army_run1 ] {ai_face();}; + +//====================================================================== +void() army_grenade_atk1 =[ $shoot1, army_grenade_atk2 ] { + ai_face(); + // Check enemy for grenade resistance? + if (self.enemy.bouncegrenade) army_atk1(); +}; +void() army_grenade_atk2 =[ $shoot2, army_grenade_atk3 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void() army_grenade_atk3 =[ $shoot3, army_grenade_atk4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed);}; +void() army_grenade_atk4 =[ $shoot4, army_grenade_atk5 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed);}; +void() army_grenade_atk5 =[ $shoot5, army_grenade_atk6 ] {ai_face(); + makevectors(self.angles); + self.pos1 = self.origin + attack_vector(self.attack_offset); + MonsterFireGrenade(self.pos1, self.enemy.origin); +}; +void() army_grenade_atk6 =[ $shoot6, army_grenade_atk7 ] {}; +void() army_grenade_atk7 =[ $shoot7, army_grenade_atk8 ] {ai_face();}; +void() army_grenade_atk8 =[ $shoot8, army_grenade_atk9 ] {}; +void() army_grenade_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +//====================================================================== +void() army_plasma_fire = +{ + local vector org, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + launch_plasma(org, vec, CT_MONARMYPLASMA, SPEED_PLASMA); +}; + +//---------------------------------------------------------------------- +void() army_plasma_atk1 =[ $shoot1, army_plasma_atk2 ] { + self.pain_finished = time + 1.3; + sound (self, CHAN_WEAPON, "enforcer/elim_pg_load.wav", 1, ATTN_NORM);}; +void() army_plasma_atk2 =[ $shoot2, army_plasma_atk3 ] {ai_face();}; +void() army_plasma_atk3 =[ $shoot3, army_plasma_atk4 ] {ai_face();}; +void() army_plasma_atk4 =[ $shoot4, army_plasma_atk5 ] {ai_face();}; +void() army_plasma_atk5 =[ $shoot5, army_plasma_atk6 ] {ai_face();army_plasma_fire();}; +void() army_plasma_atk6 =[ $shoot6, army_plasma_atk7 ] {}; +void() army_plasma_atk7 =[ $shoot7, army_plasma_atk8 ] {ai_face();SUB_CheckRefire (army_plasma_atk1);}; +void() army_plasma_atk8 =[ $shoot8, army_plasma_atk9 ] {}; +void() army_plasma_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +//====================================================================== +void() army_pain1 =[ $pain1, army_pain2 ] {}; +void() army_pain2 =[ $pain2, army_pain3 ] {}; +void() army_pain3 =[ $pain3, army_pain4 ] {}; +void() army_pain4 =[ $pain4, army_pain5 ] {}; +void() army_pain5 =[ $pain5, army_pain6 ] {}; +void() army_pain6 =[ $pain6, army_run1 ] {ai_pain(1);}; + +//---------------------------------------------------------------------- +void() army_painb1 =[ $painb1, army_painb2 ] {}; +void() army_painb2 =[ $painb2, army_painb3 ] {ai_painforward(13);}; +void() army_painb3 =[ $painb3, army_painb4 ] {ai_painforward(9);}; +void() army_painb4 =[ $painb4, army_painb5 ] {}; +void() army_painb5 =[ $painb5, army_painb6 ] {}; +void() army_painb6 =[ $painb6, army_painb7 ] {}; +void() army_painb7 =[ $painb7, army_painb8 ] {}; +void() army_painb8 =[ $painb8, army_painb9 ] {}; +void() army_painb9 =[ $painb9, army_painb10] {}; +void() army_painb10=[ $painb10, army_painb11] {}; +void() army_painb11=[ $painb11, army_painb12] {monster_footstep(FALSE);}; +void() army_painb12=[ $painb12, army_painb13] {ai_pain(2);}; +void() army_painb13=[ $painb13, army_painb14] {}; +void() army_painb14=[ $painb14, army_run1 ] {}; + +//---------------------------------------------------------------------- +void() army_painc1 =[ $painc1, army_painc2 ] {}; +void() army_painc2 =[ $painc2, army_painc3 ] {ai_pain(1);}; +void() army_painc3 =[ $painc3, army_painc4 ] {}; +void() army_painc4 =[ $painc4, army_painc5 ] {}; +void() army_painc5 =[ $painc5, army_painc6 ] {ai_painforward(1);}; +void() army_painc6 =[ $painc6, army_painc7 ] {ai_painforward(1);}; +void() army_painc7 =[ $painc7, army_painc8 ] {}; +void() army_painc8 =[ $painc8, army_painc9 ] {ai_pain(1);}; +void() army_painc9 =[ $painc9, army_painc10] {monster_footstep(FALSE); ai_painforward(4);}; +void() army_painc10=[ $painc10, army_painc11] {ai_painforward(3);}; +void() army_painc11=[ $painc11, army_painc12] {ai_painforward(6);}; +void() army_painc12=[ $painc12, army_painc13] {ai_painforward(8);}; +void() army_painc13=[ $painc13, army_run1] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) army_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.2) { + self.pain_finished = time + 0.6; + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + army_pain1(); + } + else if (self.lip < 0.6) { + self.pain_finished = time + 1.1; + sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + army_painb1(); + } + else { + self.pain_finished = time + 1.1; + sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + army_painc1(); + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.3; + self.axhitme = 0; + // Pick a random pain sound + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + // Pick a random long pain animation + if (random() < 0.5) army_painb1(); + else army_painc1(); + } + } +}; + +//====================================================================== +void() army_die1 =[ $death1, army_die2 ] {}; +void() army_die2 =[ $death2, army_die3 ] {monster_check_gib();}; +void() army_die3 =[ $death3, army_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() army_die4 =[ $death4, army_die5 ] {}; +void() army_die5 =[ $death5, army_die6 ] {}; +void() army_die6 =[ $death6, army_die7 ] {}; +void() army_die7 =[ $death7, army_die8 ] {}; +void() army_die8 =[ $death8, army_die9 ] {}; +void() army_die9 =[ $death9, army_die10 ] {monster_death_postcheck();}; +void() army_die10 =[ $death10, army_die10 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() army_cdie1 =[ $deathc1, army_cdie2 ] {}; +void() army_cdie2 =[ $deathc2, army_cdie3 ] {monster_check_gib();ai_back(5);}; +void() army_cdie3 =[ $deathc3, army_cdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); ai_back(4);}; +void() army_cdie4 =[ $deathc4, army_cdie5 ] {ai_back(13);}; +void() army_cdie5 =[ $deathc5, army_cdie6 ] {ai_back(3);}; +void() army_cdie6 =[ $deathc6, army_cdie7 ] {ai_back(4);}; +void() army_cdie7 =[ $deathc7, army_cdie8 ] {}; +void() army_cdie8 =[ $deathc8, army_cdie9 ] {}; +void() army_cdie9 =[ $deathc9, army_cdie10 ] {}; +void() army_cdie10 =[ $deathc10, army_cdie11 ] {monster_death_postcheck();}; +void() army_cdie11 =[ $deathc11, army_cdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() army_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); + if (random() < 0.5) army_die1 (); // Forward + else army_cdie1 (); // Backward/side + } +}; + +/*====================================================================== +/*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_army = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_soldier.mdl"; + self.headmdl = "progs/h_soldier.mdl"; + self.gib1mdl = "progs/w_soldiergun.mdl"; // Unique weapon + self.gib2mdl = "progs/gib_soldfoot1.mdl"; // Upright foot + self.gib3mdl = "progs/gib_soldfoot2.mdl"; // Fallen down foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1skin = 1; // Bloody weapon + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "soldier/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("soldier/death1.wav"); + self.pain_sound = "soldier/pain1.wav"; + self.pain_sound2 = "soldier/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("player/udeath.wav"); // gib death + precache_sound ("soldier/sattck1.wav"); // Shotgun sound + + self.sight_sound = "soldier/sight1.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + // This is just a gib/blood update, the SG is not poisonous + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 30; + self.gibhealth = -35; // Easy to gib + self.gibbed = FALSE; // Still together + self.pain_flinch = 20; // Easy to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEMEDIUM; // Average feet + self.attack_offset = '12 8 12'; // End of Gun + if (self.deathstring == "") + self.deathstring = " was shot by a Grunt\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SoldierCheckAttack; + self.th_stand = army_stand1; + self.th_walk = army_walk1; + self.th_run = army_run1; + if (!self.th_missile) self.th_missile = army_atk1; + self.th_pain = army_pain; + self.th_die = army_die; + + if (!self.classtype) { + self.classtype = CT_MONARMY; + if (self.ammo_shells < 1) self.ammo_shells = rint(2 + random()*4); + // If no skin override is defined, pick a random one instead + if (!self.exactskin) self.randomskin = 4; + } + self.classgroup = CG_ARMY; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +//---------------------------------------------------------------------- +void() monster_army_rocket = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONARMYROCKET; + precache_model (MODEL_PROJ_ROCKET); + if (self.poisonous) precache_model (MODEL_PROJ_ROCKETGRN); + + if (self.health < 1) self.health = 45; + // There are two red jacket skins to pick from + if (random() < 0.5) self.exactskin = 4; + else self.exactskin = 5; + if (random() < 0.35 && self.ammo_rockets < 1) self.ammo_rockets = 1; + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("soldier/rocket_load.wav"); + precache_sound ("soldier/rocket_fire.wav"); + precache_sound ("soldier/rocket_hit.wav"); + + self.th_missile = army_rocket_atk1; + self.th_updmissile = army_rocket_think; // Update flying rocket + self.th_melee = army_runback1; + self.deathstring = " was blown up by a Rocketeer\n"; + + monster_army(); +}; + +//---------------------------------------------------------------------- +void() monster_army_grenade = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONARMYGRENADE; + precache_model (MODEL_PROJ_GRENADE); + if (self.poisonous) precache_model (MODEL_PROJ_GRENADEGRN); + + if (self.health < 1) self.health = 60; + // There are two green jacket skins to pick from + if (random() < 0.5) self.exactskin = 6; + else self.exactskin = 7; + if (random() < 0.35 && self.ammo_rockets < 1) self.ammo_rockets = 1; + + self.th_missile = army_grenade_atk1; + self.th_melee = army_runback1; + // Grenade bounce off body + self.bouncegrenade = TRUE; + self.deathstring = " was pineappled by a Grenader\n"; + + monster_army(); +}; + +//---------------------------------------------------------------------- +void() monster_army_plasma = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONARMYPLASMA; + precache_model (MODEL_PROJ_PLASMA); + if (self.poisonous) precache_model (MODEL_PROJ_PLASMAGRN); + + if (self.health < 1) self.health = 75; + // There are two blue jacket skins to pick from + if (random() < 0.5) self.exactskin = 8; + else self.exactskin = 9; + if (random() < 0.35 && self.ammo_cells < 1) self.ammo_cells = 1; + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/elim_pg_load.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + self.th_missile = army_plasma_atk1; + self.deathstring = " was fried by an Electrocutioner\n"; + + monster_army(); +}; diff --git a/QC_other/QC_arcane/mon_spider.qc b/QC_other/QC_arcane/mon_spider.qc new file mode 100644 index 00000000..7e5596c4 --- /dev/null +++ b/QC_other/QC_arcane/mon_spider.qc @@ -0,0 +1,738 @@ +/*============================================================================== +SPIDER (Hexen2 model by Raven Software) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 + +$frame idleup1 idleup2 idleup3 idleup4 idleup5 idleup6 idleup7 idleup8 +$frame idleup9 idleup10 idleup11 idleup12 idleup13 + +$frame drop1 drop2 drop3 drop4 drop5 drop6 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +// Lift spider up on to back legs +$frame atkup1 atkup2 atkup3 atkup4 atkup5 atkup6 atkup7 atkup8 +$frame atkup9 atkup10 atkup11 atkup12 + +// Forward attacking (looping) +$frame atkloop1 atkloop2 atkloop3 atkloop4 atkloop5 atkloop6 atkloop7 atkloop8 +$frame atkloop9 atkloop10 + +// Jumping up +$frame jump1 jump2 jump3 jump4 jump5 jump6 jump7 jump8 +$frame jump9 jump10 jump11 jump12 jump13 jump14 jump15 jump16 + +// on all legs (pain backwards) +$frame paindown1 paindown2 paindown3 paindown4 paindown5 paindown6 paindown7 paindown8 +$frame paindown9 paindown10 + +// On back legs (pain backwards) +$frame painup1 painup2 painup3 painup4 painup5 painup6 painup7 painup8 + +// roll over death on back (looks odd) +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 + +//====================================================================== +void() spider_idle1 =[ $idle1, spider_idle2] {monster_idle_sound();ai_stand();}; +void() spider_idle2 =[ $idle2, spider_idle3] {ai_stand();}; +void() spider_idle3 =[ $idle3, spider_idle4] {ai_stand();}; +void() spider_idle4 =[ $idle4, spider_idle5] {ai_stand();}; +void() spider_idle5 =[ $idle5, spider_idle6] {ai_stand();}; +void() spider_idle6 =[ $idle6, spider_idle7] {ai_stand();}; +void() spider_idle7 =[ $idle7, spider_idle8] {ai_stand();}; +void() spider_idle8 =[ $idle8, spider_idle9] {ai_stand();}; +void() spider_idle9 =[ $idle9, spider_idle10] {ai_stand();}; +void() spider_idle10 =[ $idle10, spider_idle11] {ai_stand();}; +void() spider_idle11 =[ $idle11, spider_idle12] {ai_stand();}; +void() spider_idle12 =[ $idle12, spider_idle13] {ai_stand();}; +void() spider_idle13 =[ $idle13, spider_idle1] {ai_stand();}; + +//====================================================================== +void() spider_walk1 =[ $walk1, spider_walk2] {monster_idle_sound();ai_walk(4);}; +void() spider_walk2 =[ $walk3, spider_walk3] {monster_footstep(FALSE); ai_walk(3);}; +void() spider_walk3 =[ $walk5, spider_walk4] {ai_walk(4);}; +void() spider_walk4 =[ $walk7, spider_walk5] {ai_walk(5);}; +void() spider_walk5 =[ $walk9, spider_walk6] {ai_walk(4);}; +void() spider_walk6 =[ $walk11, spider_walk7] {monster_footstep(FALSE); ai_walk(3);}; +void() spider_walk7 =[ $walk13, spider_walk8] {ai_walk(4);}; +void() spider_walk8 =[ $walk15, spider_walk1] {ai_walk(5);}; + +//====================================================================== +void() spider_runpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + if (self.jump_flag < time) self.th_run(); + // Is the enemy too close? no more pausing, fight! + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_RUNPAUSE) self.th_run(); +}; + +//---------------------------------------------------------------------- +void() spider_runp1 =[ $idle1, spider_runp2 ] {spider_runpause();}; +void() spider_runp2 =[ $idle2, spider_runp3 ] {spider_runpause();}; +void() spider_runp3 =[ $idle3, spider_runp4 ] {spider_runpause();}; +void() spider_runp4 =[ $idle4, spider_runp5 ] {spider_runpause();}; +void() spider_runp5 =[ $idle5, spider_runp6 ] {spider_runpause();}; +void() spider_runp6 =[ $idle6, spider_runp7 ] {spider_runpause();}; +void() spider_runp7 =[ $idle7, spider_runp8 ] {spider_runpause();}; +void() spider_runp8 =[ $idle8, spider_runp9 ] {spider_runpause();}; +void() spider_runp9 =[ $idle9, spider_runp10 ] {spider_runpause();}; +void() spider_runp10 =[ $idle10,spider_runp11 ] {spider_runpause();}; +void() spider_runp11 =[ $idle11,spider_runp12 ] {spider_runpause();}; +void() spider_runp12 =[ $idle12,spider_runp13 ] {spider_runpause();}; +void() spider_runp13 =[ $idle13,spider_runp1 ] {spider_runpause();}; + +//---------------------------------------------------------------------- +void(float dist) spider_checkpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + // make spider run in bursts of speed (reset every run animation cycle) + self.movespeed = self.movespeed + 1; + // Do run code to check for enemies + ai_run(dist + self.movespeed); + + // Check if target is too close? + if (self.enemydist < MONAI_RUNPAUSE) return; + // Random chance to stop and pause running + if (self.movespeed > 7 && random() < 0.2) { + self.jump_flag = time + random(); + self.think = spider_runp1; + } +}; + +//---------------------------------------------------------------------- +void() spider_run1 =[ $walk1, spider_run2 ] {self.movespeed = 0; monster_idle_sound();spider_checkpause(8);}; +void() spider_run2 =[ $walk3, spider_run3 ] {monster_footstep(FALSE); spider_checkpause(6);}; +void() spider_run3 =[ $walk5, spider_run4 ] {spider_checkpause(8);}; +void() spider_run4 =[ $walk7, spider_run5 ] {spider_checkpause(10);}; +void() spider_run5 =[ $walk9, spider_run6 ] {spider_checkpause(8);}; +void() spider_run6 =[ $walk11, spider_run7 ] {monster_footstep(FALSE); spider_checkpause(6);}; +void() spider_run7 =[ $walk13, spider_run8 ] {spider_checkpause(8);}; +void() spider_run8 =[ $walk15, spider_run1 ] {spider_checkpause(10);}; + +//====================================================================== +void() spider_slide1 =[ $walk1, spider_slide2 ] {ai_run_slide(6); monster_idle_sound();}; +void() spider_slide2 =[ $walk3, spider_slide3 ] {ai_run_slide(4);}; +void() spider_slide3 =[ $walk5, spider_slide4 ] {ai_run_slide(6);}; +void() spider_slide4 =[ $walk7, spider_slide5 ] {ai_run_slide(4);}; +void() spider_slide5 =[ $walk9, spider_slide6 ] {ai_run_slide(6);}; +void() spider_slide6 =[ $walk11, spider_slide7 ] {ai_run_slide(4);}; +void() spider_slide7 =[ $walk13, spider_slide8 ] {ai_run_slide(6);}; +void() spider_slide8 =[ $walk15, spider_run1 ] {ai_run(4);}; + +//====================================================================== +// SPIDER 2 - ACID SPIT FUNCTIONS (range) +//====================================================================== +void(float sideang) spider_spitacid = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "spider/hiss2.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire spit in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_SPIDER; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_SPID); +}; + +//---------------------------------------------------------------------- +void() spider_spit1 =[ $atkup1, spider_spit2 ] {ai_face();}; +void() spider_spit2 =[ $atkup5, spider_spit3 ] {ai_face();}; +void() spider_spit3 =[ $atkup7, spider_spit4 ] {ai_face();}; +void() spider_spit4 =[ $atkup9, spider_spit5 ] {ai_face();}; +void() spider_spit5 =[ $atkup11, spider_spit6 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_SPIDER); }; +void() spider_spit6 =[ $atkloop1, spider_spit7 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SPIDER); }; +void() spider_spit7 =[ $atkloop3, spider_spit8 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SPIDER); }; +void() spider_spit8 = [ $atkloop5, spider_spit9 ] {spider_spitacid(-0.1);}; +void() spider_spit9 = [ $atkloop7, spider_spit10 ] {spider_spitacid(0);}; +void() spider_spit10 =[ $atkloop9, spider_spit11 ] {spider_spitacid(0.1);}; +void() spider_spit11 =[ $atkup7, spider_spit12] {}; +void() spider_spit12 =[ $atkup5, spider_run1 ] {}; + +//====================================================================== +// BITE - Both spider types can bite if within range +//====================================================================== +void() spider_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESPIDER)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_WEAPON, "spider/attackmunch.wav", TRUE, TRUE); + else sound(self, CHAN_WEAPON, "spider/attacktear.wav", TRUE, TRUE); + + // Spider bite (damage 1-9) is very weak + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (generally green spider) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Spawn blood at mouth of spider + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() spider_bite1 = [ $atkup1, spider_bite2 ] {ai_face();}; +void() spider_bite2 = [ $atkup5, spider_bite3 ] {ai_face();}; +void() spider_bite3 = [ $atkup7, spider_bite4 ] {ai_face();}; +void() spider_bite4 = [ $atkup9, spider_bite5 ] {ai_face();}; +void() spider_bite5 = [ $atkup11, spider_bite6 ] {ai_face();}; +// Start bite attack loop +void() spider_bite6 = [ $atkloop1, spider_bite7 ] {ai_face();}; +void() spider_bite7=[ $atkloop3, spider_bite8 ] {ai_face();}; +void() spider_bite8 = [ $atkloop5, spider_bite9 ] {spider_melee();}; +void() spider_bite9 = [ $atkloop7, spider_bite10 ] {}; +void() spider_bite10 = [ $atkloop9, spider_bite11 ] { + if (ai_checkmelee(MONAI_MELEESPIDER) && self.enemy.health > 0 && self.health > 0) + self.think = spider_bite6;}; +// Exit bite attack loop +void() spider_bite11 = [ $atkup7, spider_bite12 ] {}; +void() spider_bite12 = [ $atkup5, spider_run1 ] {}; + +//============================================================================ +// SPIDER 1 - JUMP FUNCTION (range) +//============================================================================ +void() Spider_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other spiders with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self.enemy, self.enemy, ldmg*3); + } + } + + // Is the spider floating in the air? + if (!checkbottom(self)) { + // Is the spider standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() spider_leap1 =[ $jump1, spider_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + monster_idle_sound(); +}; +void() spider_leap2 =[ $jump3, spider_leap3 ] {ai_face();}; +void() spider_leap3 =[ $jump5, spider_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = Spider_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPSPIDERDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; +void() spider_leap4 =[ $jump7, spider_leap5 ] {}; +void() spider_leap5 =[ $jump8, spider_leap6 ] {}; +void() spider_leap6 =[ $jump9, spider_leap7 ] {}; +void() spider_leap7 =[ $jump10, spider_leap8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = spider_leap3; + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() spider_leap8 =[ $jump11, spider_leap9] {monster_footstep(FALSE);}; +void() spider_leap9 =[ $jump13, spider_leap10] {monster_footstep(FALSE);}; +void() spider_leap10 =[ $jump15, spider_run1] {ai_resetangles();}; + +//====================================================================== +// CEILING SPIDERS - Idle/Drop/Touch/Land functions +//====================================================================== +void() spider_idleup1 =[ $idleup1, spider_idleup2 ] {monster_idle_sound();ai_stand();}; +void() spider_idleup2 =[ $idleup2, spider_idleup3 ] {ai_stand();}; +void() spider_idleup3 =[ $idleup3, spider_idleup4 ] {ai_stand();}; +void() spider_idleup4 =[ $idleup4, spider_idleup5 ] {ai_stand();}; +void() spider_idleup5 =[ $idleup5, spider_idleup6 ] {ai_stand();}; +void() spider_idleup6 =[ $idleup6, spider_idleup7 ] {ai_stand();}; +void() spider_idleup7 =[ $idleup7, spider_idleup8 ] {ai_stand();}; +void() spider_idleup8 =[ $idleup8, spider_idleup9 ] {ai_stand();}; +void() spider_idleup9 =[ $idleup9, spider_idleup10 ] {ai_stand();}; +void() spider_idleup10 =[ $idleup10, spider_idleup11 ] {ai_stand();}; +void() spider_idleup11 =[ $idleup11, spider_idleup12 ] {ai_stand();}; +void() spider_idleup12 =[ $idleup12, spider_idleup13 ] {ai_stand();}; +void() spider_idleup13 =[ $idleup13, spider_idleup1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() spider_droptouch = +{ + // Check if landed on something that is not the ground? + if (!checkbottom(self)) { + // Is the spider standing on something? + if (self.flags & FL_ONGROUND) { + self.flags = self.flags - FL_ONGROUND; + self.origin_z = self.origin_z + 8; + setorigin(self, self.origin); // raise up + self.attack_timer = time + 1; // reset timer + + makevectors (self.angles); + self.velocity = v_forward * 100 + '0 0 200'; + } + return; + } + + // No more flying, back to running + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setsize(self, self.bbmins, self.bbmaxs); + + // Reset view offset (based on bbox height) + self.view_ofs = '0 0 0'; + self.view_ofs_z = self.maxs_z*0.5; + + self.touch = SUB_Null; // No more jump touching + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + + // Restore all think state functions (spider is off the ceiling) + self.th_stand = spider_idle1; + self.th_walk = spider_walk1; + self.th_run = spider_run1; + self.th_slide = spider_slide1; + self.th_melee = spider_bite1; + + // Spider 1 and 2 have different range attacks + if (self.spawnflags & MON_SPIDER_LARGE) self.th_missile = spider_spit1; + else self.th_jump = spider_leap1; + + // Back to running or standing around! + if (!self.enemy) self.think = self.th_stand; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() spider_drop1 =[ $drop1, spider_drop2 ] {}; +void() spider_drop2 =[ $drop2, spider_drop3 ] {}; +void() spider_drop3 =[ $drop3, spider_drop4 ] {}; +void() spider_drop4 =[ $drop4, spider_drop5 ] {}; +void() spider_drop5 =[ $drop5, spider_drop6 ] {}; +void() spider_drop6 =[ $drop6, spider_drop6 ] { + if (self.attack_timer < time || self.velocity_z == 0) spider_droptouch(); +}; + +//---------------------------------------------------------------------------- +void() spider_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // Only call wakeup function once + self.th_walk = self.th_run = self.th_slide = SUB_Null; + + // No longer need cling to ceiling spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SPIDER_CEILING); + + self.flags = FL_MONSTER; // reset flags + + if (engine == ENG_FITZ) self.origin_z = self.origin_z - 8; + else self.origin_z = self.origin_z - 32; // Unstick from ceiling + setorigin(self, self.origin); // Move down slightly + + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.solid = SOLID_SLIDEBOX; + self.attack_timer = time + 1; // Stuck timer + + self.classmove = MON_MOVEWALK; // Back to walking/running + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + + makevectors (self.angles); // Move towards face direction + self.velocity = v_forward * 50; // Slight nudge forward + + self.touch = spider_droptouch; // Touch something? + if (!self.jump_flag) + self.jump_flag = time + 1 + random()*2; // Don't jump straight away + spider_drop1(); // Turn around, cat tricks! +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() spider_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() spider_grow1 = [ $grow1, spider_grow2 ] {}; +void() spider_grow2 = [ $grow2, spider_grow3 ] {spider_growangle();}; +void() spider_grow3 = [ $grow3, spider_grow4 ] {spider_growangle();}; +void() spider_grow4 = [ $grow4, spider_grow5 ] {spider_growangle();}; +void() spider_grow5 = [ $grow5, spider_grow6 ] {spider_growangle();}; +void() spider_grow6 = [ $grow6, spider_grow7 ] {spider_growangle();}; +void() spider_grow7 = [ $grow7, spider_grow8 ] {spider_growangle();}; +void() spider_grow8 = [ $grow8, spider_grow9 ] {spider_growangle();}; +void() spider_grow9 = [ $grow9, spider_grow10] {spider_growangle();}; +void() spider_grow10= [ $grow10, spider_run1 ] { + // Is the spider stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = spider_idle1; + self.th_walk = spider_walk1; + self.th_run = spider_run1; + self.th_slide = spider_slide1; + self.th_melee = spider_bite1; + // Spider 1 and 2 have different range attacks + if (self.spawnflags & MON_SPIDER_LARGE) self.th_missile = spider_spit1; + else { + self.th_jump = spider_leap1; + self.th_jumpexit = spider_leap9; + } + } +}; + +//---------------------------------------------------------------------------- +void() spider_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + spider_grow1(); +}; + +//============================================================================ +void() spider_paind1 =[ $paindown1, spider_paind2 ] {}; +void() spider_paind2 =[ $paindown3, spider_paind3 ] {}; +void() spider_paind3 =[ $paindown5, spider_paind4 ] {}; +void() spider_paind4 =[ $paindown7, spider_paind5 ] {}; +void() spider_paind5 =[ $paindown9, spider_run1 ] {}; + +//---------------------------------------------------------------------------- +// Front legs up (in melee or missile attack) +void() spider_painu1 =[ $painup1, spider_painu2 ] {}; +void() spider_painu2 =[ $painup3, spider_painu3 ] {}; +void() spider_painu3 =[ $painup5, spider_painu4 ] {}; +void() spider_painu4 =[ $painup6, spider_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) spider_pain = +{ + // Has the spider been hit while on the ceiling? + if (self.spawnflags & MON_SPIDER_CEILING) { + self.pain_finished = time + 1; + spider_wakeup(); + return; + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1 || self.pain_check == 2) { + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.4; + self.axhitme = 0; + } + // Different types of pain animations based on current attack + if ( self.frame > $atkup8 && self.frame < $atkloop10 ) spider_painu1(); + else spider_paind1(); + } + } +}; + +//============================================================================ +void() spider_die1 =[ $death1, spider_die2 ] {}; +void() spider_die2 =[ $death3, spider_die3 ] {monster_check_gib();}; +void() spider_die3 =[ $death5, spider_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() spider_die4 =[ $death7, spider_die5 ] {}; +void() spider_die5 =[ $death9, spider_die6 ] {}; +void() spider_die6 =[ $death11, spider_die7 ] {}; +void() spider_die7 =[ $death13, spider_die8 ] {}; +void() spider_die8 =[ $death15, spider_die9 ] {}; +void() spider_die9 =[ $death17, spider_die10] {monster_death_postcheck();}; +void() spider_die10 =[ $death19, spider_die10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() spider_die = +{ + // Spiders are small, gibs don't bounce far + self.max_health = MON_NOGIBVELOCITY; + + // Has the spider died while on the ceiling? + if (self.spawnflags & MON_SPIDER_CEILING) + self.gibondeath = TRUE; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "spider/death1.wav", 1, ATTN_NORM); + spider_die1(); + } +}; + +/*====================================================================== +/*QUAKED monster_spider (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() setup_spider; +void() monster_spider = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_SPIDER_LARGE) { + self.mdl = "progs/mon_spiderg.mdl"; + self.headmdl = "progs/h_spiderg.mdl"; // Front Jaws + self.gib1mdl = "progs/gib_spidlegg.mdl"; // Single Leg + self.gib2mdl = "progs/gib_spidbodyg.mdl"; // Back Body + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (MODEL_PROJ_SPID); // Spit Projectile + } + if (!(self.spawnflags & MON_SPIDER_LARGE) || + self.classtype == CT_CACHESPIDER) { + self.mdl = "progs/mon_spiderb.mdl"; + self.headmdl = "progs/h_spiderb.mdl"; // Front Jaws + self.gib1mdl = "progs/gib_spidlegb.mdl"; // Single Leg + self.gib2mdl = "progs/gib_spidbodyb.mdl"; // Back Body + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + } + + // Head/Body and Special GIB models + self.gib1frame = 9; + + // IDLE/COMBAT and SIGHT sounds + self.idle_sound = "spider/idle1.wav"; + self.idle_sound2 = "spider/hiss2.wav"; + self.idle_soundcom = "spider/idle1.wav"; + self.idle_soundcom2 = "spider/hiss3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + // death/pain/attack sounds + precache_sound("spider/death1.wav"); + self.pain_sound = "spider/pain1.wav"; + self.pain_sound2 = "spider/pain2.wav"; + precache_sound(self.pain_sound); + precache_sound(self.pain_sound2); + + precache_sound("spider/miss.wav"); + precache_sound("spider/attackmunch.wav"); + precache_sound("spider/attacktear.wav"); + precache_sound("spider/jumpland.wav"); + + self.sight_sound = "spider/hiss1.wav"; + precache_sound (self.sight_sound); + + // Cache spider is a special class sed for precache only + if (self.classtype != CT_CACHESPIDER) setup_spider(); +}; + +//---------------------------------------------------------------------------- +void() monster_wraithminion = { + self.classtype = CT_CACHESPIDER; + self.spawnflags = MON_SPIDER_LARGE; // Precache both spiders + monster_spider(); +}; + +//---------------------------------------------------------------------------- +void() setup_spider = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.steptype = FS_TYPELIGHT; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '24 0 20'; // Bite attack offset + self.attack_offset = '14 0 8'; // Used by green spider, at jaws + self.movespeed = 1; // Can never be a turret + self.deathstring = " was bitten by a Spider\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SpiderCheckAttack; + self.th_pain = spider_pain; + self.th_die = spider_die; + + if(!self.classtype) self.classtype = CT_MONSPIDER; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + // Setup green/brown spider difference + if (self.spawnflags & MON_SPIDER_LARGE) { + if (self.health < 1) self.health = 75; + self.gibhealth = -25; + self.poisonous = TRUE; // Always poisonous + self.th_missile = spider_spit1; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.poisonous = FALSE; // Large only are poisonous + self.th_jump = spider_leap1; + self.th_jumpexit = spider_leap9; + } + + //---------------------------------------------------------------------- + // Ceiling spiders have special idle animation (rotated) + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SPIDER_CEILING) { + self.th_stand = self.th_walk = spider_idleup1; + self.th_run = self.th_slide = spider_wakeup; + self.th_melee = self.th_missile = self.th_jump = spider_wakeup; + // th_pain and th_die functions understand ceiling spiders + } + // Special spawning minion need to start spinning + else if (self.classtype == CT_MINIONSPIDER) { + self.th_stand = self.th_walk = self.th_run = spider_grow; + self.th_melee = self.th_slide = SUB_Null; + self.th_missile = self.th_jump = SUB_Null; + } + // Default spider behaviour functions + else { + self.th_stand = spider_idle1; + self.th_walk = spider_walk1; + self.th_run = spider_run1; + self.th_melee = spider_bite1; + self.th_slide = spider_slide1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn spiders (requires monster_spiderspawn entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_spider = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + update_minioncount(self.owner, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_spider"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self.owner; // Spawner Parent Link + self.owner = minion; // Stop gibs interacting with minion + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONSPIDER; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + if (random() < 0.2) minion.spawnflags = MON_SPIDER_LARGE; + else minion.spawnflags = 0; + + if (minion.spawnflags & MON_SPIDER_LARGE) { + minion.mdl = "progs/mon_spiderg.mdl"; + minion.headmdl = "progs/h_spiderg.mdl"; // Front Jaws + minion.gib1mdl = "progs/gib_spidlegg.mdl"; // Single Leg + minion.gib2mdl = "progs/gib_spidbodyg.mdl"; // Back Body + } + else { + minion.mdl = "progs/mon_spiderb.mdl"; + minion.headmdl = "progs/h_spiderb.mdl"; // Front Jaws + minion.gib1mdl = "progs/gib_spidlegb.mdl"; // Single Leg + minion.gib2mdl = "progs/gib_spidbodyb.mdl"; // Back Body + } + + minion.gib1frame = 9; + minion.idle_sound = "spider/idle1.wav"; + minion.idle_sound2 = "spider/hiss2.wav"; + minion.idle_soundcom = "spider/idle1.wav"; + minion.idle_soundcom2 = "spider/hiss3.wav"; + minion.sight_sound = "spider/hiss1.wav"; + minion.pain_sound = "spider/pain1.wav"; + minion.pain_sound2 = "spider/pain2.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_spider; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_swampling.qc b/QC_other/QC_arcane/mon_swampling.qc new file mode 100644 index 00000000..87b55ea6 --- /dev/null +++ b/QC_other/QC_arcane/mon_swampling.qc @@ -0,0 +1,612 @@ +/*============================================================================== +SWAMPLINGS (Based on Voreling from Quoth - Kell/Necros/Preach) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 + +$frame idleup1 idleup2 idleup3 idleup4 idleup5 idleup6 + +$frame drop1 drop2 drop3 drop4 drop5 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame walk1 walk2 walk3 walk4 walk5 + +$frame run1 run2 run3 run4 + +// Jumping up +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +// Bite attack +$frame bite1 bite2 bite3 bite4 bite5 bite6 bite7 + +// Extremely short pain set +$frame pain1 pain2 + +// fall over and die +$frame death1 death2 death3 death4 death5 death6 + +// body flies up and then back to the ground +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 + +// Not used, modelling templates +$frame base1 base2 + +//====================================================================== +void() swampling_idle1 =[ $idle1, swampling_idle2 ] {monster_idle_sound();ai_stand();}; +void() swampling_idle2 =[ $idle2, swampling_idle3 ] {ai_stand();}; +void() swampling_idle3 =[ $idle3, swampling_idle4 ] {ai_stand();}; +void() swampling_idle4 =[ $idle4, swampling_idle5 ] {ai_stand();}; +void() swampling_idle5 =[ $idle5, swampling_idle6 ] {ai_stand();}; +void() swampling_idle6 =[ $idle6, swampling_idle7 ] {ai_stand();}; +void() swampling_idle7 =[ $idle7, swampling_idle8 ] {ai_stand();}; +void() swampling_idle8 =[ $idle8, swampling_idle9 ] {ai_stand();}; +void() swampling_idle9 =[ $idle9, swampling_idle10] {ai_stand();}; +void() swampling_idle10=[ $idle10,swampling_idle11] {ai_stand();}; +void() swampling_idle11=[ $idle11,swampling_idle12] {ai_stand();}; +void() swampling_idle12=[ $idle12,swampling_idle13] {ai_stand();}; +void() swampling_idle13=[ $idle13,swampling_idle1 ] {ai_stand();}; + +//====================================================================== +void() swampling_walk1 =[ $walk1, swampling_walk2 ] {monster_idle_sound();ai_walk(4);}; +void() swampling_walk2 =[ $walk2, swampling_walk3 ] {monster_footstep(FALSE); ai_walk(3);}; +void() swampling_walk3 =[ $walk3, swampling_walk4 ] {ai_walk(4);}; +void() swampling_walk4 =[ $walk4, swampling_walk5 ] {ai_walk(5);}; +void() swampling_walk5 =[ $walk5, swampling_walk1 ] {ai_walk(5);}; + +//====================================================================== +void() swampling_runpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + if (self.jump_flag < time) self.th_run(); + // Is the enemy too close? no more pausing, fight! + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_RUNPAUSE) self.th_run(); +}; + +//---------------------------------------------------------------------- +void() swampling_runp1 =[ $idle1, swampling_runp2 ] {swampling_runpause();}; +void() swampling_runp2 =[ $idle2, swampling_runp3 ] {swampling_runpause();}; +void() swampling_runp3 =[ $idle3, swampling_runp4 ] {swampling_runpause();}; +void() swampling_runp4 =[ $idle4, swampling_runp5 ] {swampling_runpause();}; +void() swampling_runp5 =[ $idle5, swampling_runp6 ] {swampling_runpause();}; +void() swampling_runp6 =[ $idle6, swampling_runp7 ] {swampling_runpause();}; +void() swampling_runp7 =[ $idle7, swampling_runp8 ] {swampling_runpause();}; +void() swampling_runp8 =[ $idle8, swampling_runp9 ] {swampling_runpause();}; +void() swampling_runp9 =[ $idle9, swampling_runp10 ] {swampling_runpause();}; +void() swampling_runp10 =[ $idle10,swampling_runp11 ] {swampling_runpause();}; +void() swampling_runp11 =[ $idle11,swampling_runp12 ] {swampling_runpause();}; +void() swampling_runp12 =[ $idle12,swampling_runp13 ] {swampling_runpause();}; +void() swampling_runp13 =[ $idle13,swampling_runp1 ] {swampling_runpause();}; + +//---------------------------------------------------------------------- +void(float dist) swampling_checkpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + // make swamplings run in bursts of speed (reset every run animation cycle) + self.movespeed = self.movespeed + 1; + // Do run code to check for enemies + ai_run(dist + self.movespeed); + if (self.enemydist < MONAI_RUNPAUSE) return; // Too close + + // Random chance to stop and pause running + if (self.movespeed > 7 && random() < 0.2) { + self.jump_flag = time + random(); + self.think = swampling_runp1; + } +}; + +//---------------------------------------------------------------------- +void() swampling_run1 =[ $run1, swampling_run2 ] {self.movespeed = 0; + monster_idle_sound(); + swampling_checkpause(8); + // swamplings have constant problems with weird angles (X/Z) + // Just keep resetting them so they move normally + ai_resetangles(); +}; +void() swampling_run2 =[ $run2, swampling_run3 ] {monster_footstep(FALSE); swampling_checkpause(6);}; +void() swampling_run3 =[ $run3, swampling_run4 ] {swampling_checkpause(8);}; +void() swampling_run4 =[ $run4, swampling_run5 ] {swampling_checkpause(10);}; +void() swampling_run5 =[ $run1, swampling_run6 ] {swampling_checkpause(8);}; +void() swampling_run6 =[ $run2, swampling_run7 ] {monster_footstep(FALSE); swampling_checkpause(6);}; +void() swampling_run7 =[ $run3, swampling_run8 ] {swampling_checkpause(8);}; +void() swampling_run8 =[ $run4, swampling_run1 ] {swampling_checkpause(10);}; + +//====================================================================== +void() swampling_slide1 =[ $walk1, swampling_slide2 ] {ai_run_slide(6); monster_idle_sound();}; +void() swampling_slide2 =[ $walk2, swampling_slide3 ] {ai_run_slide(4);}; +void() swampling_slide3 =[ $walk3, swampling_slide4 ] {ai_run_slide(6);}; +void() swampling_slide4 =[ $walk4, swampling_slide5 ] {ai_run_slide(4);}; +void() swampling_slide5 =[ $walk5, swampling_run1 ] {ai_run(4);}; + +//====================================================================== +// swampling 2 - POISON SPIT FUNCTIONS (range) +//====================================================================== +void(float sideang) swampling_spitacid = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "swampling/spit4.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire spit in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_SWAMPLING; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_SWAMP); +}; + +//---------------------------------------------------------------------- +void() swampling_spit1 = [ $pain1, swampling_spit2 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_SWAMPLING); }; +void() swampling_spit2 = [ $pain2, swampling_spit3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SWAMPLING); }; +void() swampling_spit3 = [ $bite1, swampling_spit4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SWAMPLING); }; +void() swampling_spit4 = [ $bite2, swampling_spit5 ] {swampling_spitacid(-0.1);}; +void() swampling_spit5 = [ $bite3, swampling_spit6 ] {swampling_spitacid(0);}; +void() swampling_spit6 = [ $bite4, swampling_spit7 ] {swampling_spitacid(0.1);}; +void() swampling_spit7 = [ $bite5, swampling_spit8 ] {}; +void() swampling_spit8 = [ $bite6, swampling_spit9 ] {}; +void() swampling_spit9 = [ $bite7, swampling_run1 ] {}; + +//====================================================================== +// BITE +//====================================================================== +void() swampling_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESWAMPLING)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_VOICE, "swampling/attackmunch.wav", TRUE, TRUE); + else sound(self, CHAN_VOICE, "swampling/attacktear.wav", TRUE, TRUE); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // swampling bite (damage 1-9) is very weak + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn some touch blood + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() swampling_bite1 =[ $bite1, swampling_bite2 ] {ai_face();}; +// Start bite attack loop +void() swampling_bite2 =[ $bite2, swampling_bite3 ] {ai_face();}; +void() swampling_bite3 =[ $bite3, swampling_bite4 ] {ai_face();}; +void() swampling_bite4 = [ $bite4, swampling_bite5 ] {swampling_melee();}; +void() swampling_bite5 = [ $bite5, swampling_bite6 ] {}; +void() swampling_bite6 =[ $bite6, swampling_bite7 ] { + if (ai_checkmelee(MONAI_MELEESWAMPLING) && self.enemy.health > 0) self.think = swampling_bite2;}; +// Exit bite attack loop +void() swampling_bite7 =[ $bite7, swampling_run1 ] {}; + +//============================================================================ +// JUMP FUNCTION (range) +//============================================================================ +void() swampling_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other swamplings with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the swampling floating in the air? + if (!checkbottom(self)) { + // Is the swampling standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() swampling_leap1 =[ $jump1, swampling_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + monster_idle_sound(); +}; +void() swampling_leap2 =[ $jump2, swampling_leap3 ] {ai_face();}; +void() swampling_leap3 =[ $jump3, swampling_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = swampling_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPSWAMPLINGDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() swampling_leap4 =[ $jump4, swampling_leap5 ] {}; +void() swampling_leap5 =[ $jump5, swampling_leap6 ] {}; +void() swampling_leap6 =[ $jump6, swampling_leap7 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = swampling_leap3; + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() swampling_leap7 =[ $jump3, swampling_leap8 ] {monster_footstep(FALSE);}; +void() swampling_leap8 =[ $jump2, swampling_leap9 ] {monster_footstep(FALSE);}; +void() swampling_leap9 =[ $jump1, swampling_run1 ] {ai_resetangles();}; + +//====================================================================== +// CEILING swamplingS - Idle/Drop/Touch/Land functions +//====================================================================== +void() swampling_idleup1 =[ $idleup1, swampling_idleup2] {monster_idle_sound();ai_stand();}; +void() swampling_idleup2 =[ $idleup2, swampling_idleup3] {ai_stand();}; +void() swampling_idleup3 =[ $idleup3, swampling_idleup4] {ai_stand();}; +void() swampling_idleup4 =[ $idleup4, swampling_idleup5] {ai_stand();}; +void() swampling_idleup5 =[ $idleup5, swampling_idleup6] {ai_stand();}; +void() swampling_idleup6 =[ $idleup6, swampling_idleup1] {ai_stand();}; + +//---------------------------------------------------------------------- +void() swampling_droptouch = +{ + // Check if landed on something that is not the ground? + if (!checkbottom(self)) { + // Is the swampling standing on something? + if (self.flags & FL_ONGROUND) { + self.flags = self.flags - FL_ONGROUND; + self.origin_z = self.origin_z + 8; + setorigin(self, self.origin); // raise up + self.attack_timer = time + 1; // reset timer + + makevectors (self.angles); + self.velocity = v_forward * 100 + '0 0 200'; + } + return; + } + + // No more flying, back to running + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setsize(self, self.bbmins, self.bbmaxs); + + // Reset view offset (based on bbox height) + self.view_ofs = '0 0 0'; + self.view_ofs_z = self.maxs_z*0.5; + + self.touch = SUB_Null; // No more jump touching + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + + // Restore all think state functions (swampling is off the ceiling) + self.th_stand = swampling_idle1; + self.th_walk = swampling_walk1; + self.th_run = swampling_run1; + self.th_slide = swampling_slide1; + self.th_melee = swampling_bite1; + + // swampling 1 and 2 have different range attacks + if (self.spawnflags & MON_SWAMPLING_LARGE) self.th_missile = swampling_spit1; + else self.th_jump = swampling_leap1; + + // Back to running or standing around! + if (!self.enemy) self.think = self.th_stand; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() swampling_drop1 =[ $drop1, swampling_drop2 ] {}; +void() swampling_drop2 =[ $drop2, swampling_drop3 ] {}; +void() swampling_drop3 =[ $drop3, swampling_drop4 ] {}; +void() swampling_drop4 =[ $drop4, swampling_drop5 ] {}; +void() swampling_drop5 =[ $drop5, swampling_drop5 ] { + if (self.attack_timer < time || self.velocity_z == 0) swampling_droptouch(); +}; + +//---------------------------------------------------------------------------- +void() swampling_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // Only call wakeup function once + self.th_walk = self.th_run = self.th_slide = SUB_Null; + + // No longer need cling to ceiling spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SWAMPLING_CEILING); + + self.flags = FL_MONSTER; // reset flags + + if (engine == ENG_FITZ) self.origin_z = self.origin_z - 8; + else self.origin_z = self.origin_z - 32; // Unstick from ceiling + setorigin(self, self.origin); // Move down slightly + + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.solid = SOLID_SLIDEBOX; + self.attack_timer = time + 1; // Stuck timer + + self.classmove = MON_MOVEWALK; // Back to walking/running + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + + makevectors (self.angles); // Move towards face direction + self.velocity = v_forward * 50; // Slight nudge forward + + self.touch = swampling_droptouch; // Touch something? + if (!self.jump_flag) + self.jump_flag = time + 1 + random()*2; // Don't jump straight away + swampling_drop1(); // Turn around, cat tricks! +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() swampling_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() swampling_grow1 = [ $grow1, swampling_grow2 ] {}; +void() swampling_grow2 = [ $grow2, swampling_grow3 ] {swampling_growangle();}; +void() swampling_grow3 = [ $grow3, swampling_grow4 ] {swampling_growangle();}; +void() swampling_grow4 = [ $grow4, swampling_grow5 ] {swampling_growangle();}; +void() swampling_grow5 = [ $grow5, swampling_grow6 ] {swampling_growangle();}; +void() swampling_grow6 = [ $grow6, swampling_grow7 ] {swampling_growangle();}; +void() swampling_grow7 = [ $grow7, swampling_grow8 ] {swampling_growangle();}; +void() swampling_grow8 = [ $grow8, swampling_grow9 ] {swampling_growangle();}; +void() swampling_grow9 = [ $grow9, swampling_grow10] {swampling_growangle();}; +void() swampling_grow10= [ $grow10, swampling_run1 ] { + // Is the swampling stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = swampling_idle1; + self.th_walk = swampling_walk1; + self.th_run = swampling_run1; + self.th_slide = swampling_slide1; + self.th_melee = swampling_bite1; + // swampling 1 and 2 have different range attacks + if (self.spawnflags & MON_SWAMPLING_LARGE) self.th_missile = swampling_spit1; + else { + self.th_jump = swampling_leap1; + self.th_jumpexit = swampling_leap7; + } + } +}; +//---------------------------------------------------------------------------- +void() swampling_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + swampling_grow1(); +}; + +//============================================================================ +void() swampling_pain1 =[ $pain1, swampling_pain2 ] {}; +void() swampling_pain2 =[ $pain2, swampling_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) swampling_pain = +{ + // Has the swampling been hit while on the ceiling? + if (self.spawnflags & MON_SWAMPLING_CEILING) { + self.pain_finished = time + 1; + swampling_wakeup(); + return; + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1) swampling_pain1(); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.2; + self.axhitme = 0; + swampling_pain1(); + } + } +}; + +//============================================================================ +void() swampling_die1 =[ $death1, swampling_die2 ] {}; +void() swampling_die2 =[ $death2, swampling_die3 ] {monster_check_gib();}; +void() swampling_die3 =[ $death3, swampling_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() swampling_die4 =[ $death4, swampling_die5 ] {}; +void() swampling_die5 =[ $death5, swampling_die6 ] {monster_death_postcheck();}; +void() swampling_die6 =[ $death6, swampling_die6 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() swampling_dieB1 =[ $deathB1, swampling_dieB2 ] {}; +void() swampling_dieB2 =[ $deathB2, swampling_dieB3 ] {monster_check_gib();}; +void() swampling_dieB3 =[ $deathB3, swampling_dieB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() swampling_dieB4 =[ $deathB4, swampling_dieB5 ] {}; +void() swampling_dieB5 =[ $deathB5, swampling_dieB6 ] {}; +void() swampling_dieB6 =[ $deathB6, swampling_dieB7 ] {monster_death_postcheck();}; +void() swampling_dieB7 =[ $deathB7, swampling_dieB7 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() swampling_die = +{ + // swamplings are small, gibs don't bounce far + self.max_health = MON_NOGIBVELOCITY; + + // Has the swampling died while on the ceiling? + if (self.spawnflags & MON_SWAMPLING_CEILING) + self.gibondeath = TRUE; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "swampling/death.wav", 1, ATTN_NORM); + if (random() < 0.6) swampling_die1(); + else swampling_dieB1(); + } +}; + +/*====================================================================== +/*QUAKED monster_swampling (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_swampling = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_SWAMPLING_LARGE) { + self.mdl = "progs/mon_swamplingp.mdl"; + self.gib1mdl = "progs/gib_swamplegp.mdl"; // Single Leg + } + else { + self.mdl = "progs/mon_swampling.mdl"; + self.gib1mdl = "progs/gib_swampleg.mdl"; // Single Leg + } + + precache_model (self.mdl); + precache_model (self.gib1mdl); + precache_model (MODEL_PROJ_SWAMP); // Spit Projectile + + // IDLE/COMBAT and SIGHT sounds + self.idle_sound = "swampling/idle1.wav"; + self.idle_sound2 = "swampling/idle3.wav"; + self.idle_soundcom = "swampling/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + // death/pain/attack sounds + precache_sound("swampling/death.wav"); + self.pain_sound = "swampling/pain3.wav"; + precache_sound(self.pain_sound); + + precache_sound("swampling/miss.wav"); // Spit misses + precache_sound("swampling/spit4.wav"); // Spit attack + precache_sound("swampling/attackmunch.wav"); + precache_sound("swampling/attacktear.wav"); + precache_sound("swampling/jumpland.wav"); + + self.sight_sound = "swampling/sight2.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.steptype = FS_TYPELIGHT; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '20 0 0'; // Bite attack offset + self.attack_offset = '14 0 8'; // Used by large swampling, at jaws + self.movespeed = 1; // Can never be a turret + self.poisonous = TRUE; // Always poisonous + self.deathstring = " was bitten by a Swampling\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SwamplingCheckAttack; + self.th_pain = swampling_pain; + self.th_die = swampling_die; + + self.classtype = CT_MONSWAMPLING; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + // Setup light/dark green swampling difference + if (self.spawnflags & MON_SWAMPLING_LARGE) { + if (self.health < 1) self.health = 60; + self.gibhealth = -25; + self.th_missile = swampling_spit1; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = swampling_leap1; + self.th_jumpexit = swampling_leap7; + } + + //---------------------------------------------------------------------- + // Ceiling swamplings have special idle animation + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SWAMPLING_CEILING) { + self.th_stand = self.th_walk = swampling_idleup1; + self.th_run = self.th_slide = swampling_wakeup; + self.th_melee = self.th_missile = self.th_jump = swampling_wakeup; + // th_pain and th_die functions understand ceiling swamplings + } + // Default swampling behaviour functions + else { + self.th_stand = swampling_idle1; + self.th_walk = swampling_walk1; + self.th_run = swampling_run1; + self.th_melee = swampling_bite1; + self.th_slide = swampling_slide1; + } + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_tarbaby.qc b/QC_other/QC_arcane/mon_tarbaby.qc new file mode 100644 index 00000000..e662fe85 --- /dev/null +++ b/QC_other/QC_arcane/mon_tarbaby.qc @@ -0,0 +1,272 @@ +/*============================================================================== +BLOB (annoying) +==============================================================================*/ +$cd id1/models/tarbaby +$origin 0 0 24 +$base base + +$skin skin + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 +$frame walk20 walk21 walk22 walk23 walk24 walk25 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13 +$frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23 +$frame run24 run25 + +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +$frame fly1 fly2 fly3 fly4 + +$frame exp + +void() tbaby_jump1; +void() tbaby_jump5; + +//============================================================================ +void() tbaby_stand1 =[ $walk1, tbaby_stand2 ] {ai_stand();}; +void() tbaby_stand2 =[ $walk2, tbaby_stand3 ] {ai_stand();}; +void() tbaby_stand3 =[ $walk3, tbaby_stand4 ] {ai_stand();}; +void() tbaby_stand4 =[ $walk4, tbaby_stand5 ] {ai_stand();}; +void() tbaby_stand5 =[ $walk5, tbaby_stand6 ] {ai_stand(); +self.nextthink = 0.1 + random()*0.3;}; +void() tbaby_stand6 =[ $walk4, tbaby_stand7 ] {ai_stand();}; +void() tbaby_stand7 =[ $walk3, tbaby_stand8 ] {ai_stand();}; +void() tbaby_stand8 =[ $walk2, tbaby_stand1 ] {ai_stand(); +self.nextthink = 0.1 + random()*0.3;}; + +void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();}; + +//============================================================================ +void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();monster_idle_sound();}; +void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();}; +void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();}; +void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();}; +void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();}; +void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_turn();}; +void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_turn();}; +void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_turn();}; +void() tbaby_walk9 =[ $walk9, tbaby_walk10] {ai_turn();}; +void() tbaby_walk10=[ $walk10, tbaby_walk11] {ai_turn();}; +void() tbaby_walk11=[ $walk11, tbaby_walk12] {ai_walk(2);}; +void() tbaby_walk12=[ $walk12, tbaby_walk13] {ai_walk(2);}; +void() tbaby_walk13=[ $walk13, tbaby_walk14] {ai_walk(2);}; +void() tbaby_walk14=[ $walk14, tbaby_walk15] {ai_walk(2);}; +void() tbaby_walk15=[ $walk15, tbaby_walk16] {ai_walk(2);}; +void() tbaby_walk16=[ $walk16, tbaby_walk17] {ai_walk(2);}; +void() tbaby_walk17=[ $walk17, tbaby_walk18] {ai_walk(2);}; +void() tbaby_walk18=[ $walk18, tbaby_walk19] {ai_walk(2);}; +void() tbaby_walk19=[ $walk19, tbaby_walk20] {ai_walk(2);}; +void() tbaby_walk20=[ $walk20, tbaby_walk21] {ai_walk(2);}; +void() tbaby_walk21=[ $walk21, tbaby_walk22] {ai_walk(2);}; +void() tbaby_walk22=[ $walk22, tbaby_walk23] {ai_walk(2);}; +void() tbaby_walk23=[ $walk23, tbaby_walk24] {ai_walk(2);}; +void() tbaby_walk24=[ $walk24, tbaby_walk25] {ai_walk(2);}; +void() tbaby_walk25=[ $walk25, tbaby_walk1 ] {ai_walk(2);}; + +//============================================================================ +void() tbaby_run1 =[ $run1, tbaby_run2 ] {ai_face();}; +void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();}; +void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();}; +void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();}; +void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();}; +void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();}; +void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_face();}; +void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_face();}; +void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_face();}; +void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_face();}; +void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);}; +void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(2);}; +void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(2);}; +void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(2);}; +void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_run(2);}; +void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_run(2);}; +void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);}; +void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(2);}; +void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(2);}; +void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(2);}; +void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(2);}; +void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);}; +void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);}; +void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(2);}; +void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(2);}; + +//============================================================================ +void() Tar_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + + if (other.takedamage && other.classname != self.classname) { + if ( vlen(self.velocity) > 400 ) { + ldmg = 10 + 10*random(); + // Can only poison the player + if (other.flags & FL_CLIENT && self.poisonous) { + // Check if player is posioned already? + if (other.poisoned) T_Damage (other, self, self, ldmg * 0.25, DAMARMOR); + // Make sure player is posioned + else PoisonDeBuff(other); + } + // Everything else gets the usual tarbaby thump! + else T_Damage (other, self, self, ldmg, DAMARMOR); + sound (self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM); + } + } + else + sound (self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); + + // Is the tarbaby floating in the air? + if (!checkbottom(self)) { + // Is the tarbaby standing on something? + if (self.flags & FL_ONGROUND) { + self.touch = SUB_Null; + self.think = tbaby_run1; + self.movetype = MOVETYPE_STEP; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + if (self.spawnflags & MON_TARBYLESSJUMP) { + // RRP - Ijed (reduce constant jumping around like id version) + // Skill percentage Easy 0% = never jump, Nightmare 60% = good chance + if (random() > skill / 5) self.think = tbaby_run1; + else self.think = tbaby_jump1; + } + // Original ID behaviour, constantly jump around like crazy + else self.think = self.th_jump; + self.nextthink = time + 0.1; +}; + +//============================================================================ +void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {}; +void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {}; +void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {}; +void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] { + self.cnt = self.cnt + 1; + if (self.cnt == 4) { + tbaby_jump5 (); + } +}; + +//============================================================================ +void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();}; +void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();}; +void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();}; +void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();}; +void() tbaby_jump5 =[ $jump5, tbaby_jump6 ] +{ + self.movetype = MOVETYPE_BOUNCE; + self.touch = Tar_JumpTouch; + makevectors (self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 600 + '0 0 200'; + self.velocity_z = self.velocity_z + random()*150; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.cnt = 0; +}; +void() tbaby_jump6 =[ $jump6, tbaby_fly1 ] {}; + +//============================================================================ +void(entity inflictor, entity attacker, float damage) tbaby_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + } +}; + +//============================================================================= +void() tbaby_die1 =[ $exp, tbaby_die2 ] {}; +void() tbaby_die2 =[ $exp, tbaby_run1 ] { + // Tarbabies explode when they die + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + sound (self, CHAN_BODY, "blob/death1.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); // Hard coded explosion + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + // Sprite explosion for Fitz engines + // Check for DP particle system as visuals is done with TE_TAREXPLOSION + if (!ext_dppart) SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + else sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + // Hide monster, do not remove, still playing sound + entity_hide(self); +}; + +//---------------------------------------------------------------------- +void() tbaby_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + self.takedamage = DAMAGE_NO; + tbaby_die1(); +}; + +//============================================================================= +//QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush x Lessjump +//============================================================================= +void() monster_tarbaby = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_tarbaby.mdl"; + self.headmdl = string_null; + precache_model (self.mdl); + + self.idle_sound = "blob/sight1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = self.idle_sound; + self.pain_sound = self.idle_sound; + + precache_sound ("blob/death1.wav"); + + precache_sound ("blob/hit1.wav"); + precache_sound ("blob/land1.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 80; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 20; + self.deathstring = " was slimed by a Spawn\n"; + + // Allow for extra functionality (death damage and poison) + if (self.death_dmg < 1) self.death_dmg = DAMAGE_TARBABY; + if (self.poisonous < 1) self.poisonous = FALSE; + else self.poisonous = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SpawnCheckAttack; + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + self.th_jump = tbaby_jump1; + self.th_melee = tbaby_jump1; + self.th_pain = tbaby_pain; + self.th_die = tbaby_die; + + self.classtype = CT_MONSPAWN; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_test.qc b/QC_other/QC_arcane/mon_test.qc new file mode 100644 index 00000000..018df895 Binary files /dev/null and b/QC_other/QC_arcane/mon_test.qc differ diff --git a/QC_other/QC_arcane/mon_voreling.qc b/QC_other/QC_arcane/mon_voreling.qc new file mode 100644 index 00000000..7240ac6a --- /dev/null +++ b/QC_other/QC_arcane/mon_voreling.qc @@ -0,0 +1,676 @@ +/*============================================================================== +VORELINGS (Originally from Quoth - Kell/Necros/Preach) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 + +$frame idleup1 idleup2 idleup3 idleup4 idleup5 idleup6 + +$frame drop1 drop2 drop3 drop4 drop5 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame walk1 walk2 walk3 walk4 walk5 + +$frame run1 run2 run3 run4 + +// Jumping up +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +// Bite attack +$frame bite1 bite2 bite3 bite4 bite5 bite6 bite7 + +// Extremely short pain set +$frame pain1 pain2 + +// fall over and die +$frame death1 death2 death3 death4 death5 death6 + +// body flies up and then back to the ground +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 + +// Not used, modelling templates +$frame base1 base2 + +//====================================================================== +void() voreling_idle1 =[ $idle1, voreling_idle2 ] {monster_idle_sound();ai_stand();}; +void() voreling_idle2 =[ $idle2, voreling_idle3 ] {ai_stand();}; +void() voreling_idle3 =[ $idle3, voreling_idle4 ] {ai_stand();}; +void() voreling_idle4 =[ $idle4, voreling_idle5 ] {ai_stand();}; +void() voreling_idle5 =[ $idle5, voreling_idle6 ] {ai_stand();}; +void() voreling_idle6 =[ $idle6, voreling_idle7 ] {ai_stand();}; +void() voreling_idle7 =[ $idle7, voreling_idle8 ] {ai_stand();}; +void() voreling_idle8 =[ $idle8, voreling_idle9 ] {ai_stand();}; +void() voreling_idle9 =[ $idle9, voreling_idle10 ] {ai_stand();}; +void() voreling_idle10 =[ $idle10,voreling_idle11 ] {ai_stand();}; +void() voreling_idle11 =[ $idle11,voreling_idle12 ] {ai_stand();}; +void() voreling_idle12 =[ $idle12,voreling_idle13 ] {ai_stand();}; +void() voreling_idle13 =[ $idle13,voreling_idle1 ] {ai_stand();}; + +//====================================================================== +void() voreling_walk1 =[ $walk1, voreling_walk2 ] {monster_idle_sound();ai_walk(4);}; +void() voreling_walk2 =[ $walk2, voreling_walk3 ] {monster_footstep(FALSE); ai_walk(3);}; +void() voreling_walk3 =[ $walk3, voreling_walk4 ] {ai_walk(4);}; +void() voreling_walk4 =[ $walk4, voreling_walk5 ] {ai_walk(5);}; +void() voreling_walk5 =[ $walk5, voreling_walk1 ] {ai_walk(5);}; + +//====================================================================== +void() voreling_runpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + if (self.jump_flag < time) self.th_run(); + // Is the enemy too close? no more pausing, fight! + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_RUNPAUSE) self.th_run(); +}; + +//---------------------------------------------------------------------- +void() voreling_runp1 =[ $idle1, voreling_runp2 ] {voreling_runpause();}; +void() voreling_runp2 =[ $idle2, voreling_runp3 ] {voreling_runpause();}; +void() voreling_runp3 =[ $idle3, voreling_runp4 ] {voreling_runpause();}; +void() voreling_runp4 =[ $idle4, voreling_runp5 ] {voreling_runpause();}; +void() voreling_runp5 =[ $idle5, voreling_runp6 ] {voreling_runpause();}; +void() voreling_runp6 =[ $idle6, voreling_runp7 ] {voreling_runpause();}; +void() voreling_runp7 =[ $idle7, voreling_runp8 ] {voreling_runpause();}; +void() voreling_runp8 =[ $idle8, voreling_runp9 ] {voreling_runpause();}; +void() voreling_runp9 =[ $idle9, voreling_runp10 ] {voreling_runpause();}; +void() voreling_runp10 =[ $idle10,voreling_runp11 ] {voreling_runpause();}; +void() voreling_runp11 =[ $idle11,voreling_runp12 ] {voreling_runpause();}; +void() voreling_runp12 =[ $idle12,voreling_runp13 ] {voreling_runpause();}; +void() voreling_runp13 =[ $idle13,voreling_runp1 ] {voreling_runpause();}; + +//---------------------------------------------------------------------- +void(float dist) voreling_checkpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + // make vorelings run in bursts of speed (reset every run animation cycle) + self.movespeed = self.movespeed + 1; + // Do run code to check for enemies + ai_run(dist + self.movespeed); + if (self.enemydist < MONAI_RUNPAUSE) return; // Too close + + // Random chance to stop and pause running + if (self.movespeed > 7 && random() < 0.2) { + self.jump_flag = time + random(); + self.think = voreling_runp1; + } +}; + +//---------------------------------------------------------------------- +void() voreling_run1 =[ $run1, voreling_run2 ] {self.movespeed = 0; + monster_idle_sound(); + voreling_checkpause(8); + // Vorelings have constant problems with weird angles (X/Z) + // Just keep resetting them so they move normally + ai_resetangles(); +}; +void() voreling_run2 =[ $run2, voreling_run3 ] {monster_footstep(FALSE); voreling_checkpause(6);}; +void() voreling_run3 =[ $run3, voreling_run4 ] {voreling_checkpause(8);}; +void() voreling_run4 =[ $run4, voreling_run5 ] {voreling_checkpause(10);}; +void() voreling_run5 =[ $run1, voreling_run6 ] {voreling_checkpause(8);}; +void() voreling_run6 =[ $run2, voreling_run7 ] {monster_footstep(FALSE); voreling_checkpause(6);}; +void() voreling_run7 =[ $run3, voreling_run8 ] {voreling_checkpause(8);}; +void() voreling_run8 =[ $run4, voreling_run1 ] {voreling_checkpause(10);}; + +//====================================================================== +void() voreling_slide1 =[ $walk1, voreling_slide2 ] {ai_run_slide(6); monster_idle_sound();}; +void() voreling_slide2 =[ $walk2, voreling_slide3 ] {ai_run_slide(4);}; +void() voreling_slide3 =[ $walk3, voreling_slide4 ] {ai_run_slide(6);}; +void() voreling_slide4 =[ $walk4, voreling_slide5 ] {ai_run_slide(4);}; +void() voreling_slide5 =[ $walk5, voreling_run1 ] {ai_run(4);}; + +//====================================================================== +// VORELING 2 - PURPLE SPIT FUNCTIONS (range) +//====================================================================== +void(float sideang) voreling_spitacid = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "voreling/hiss2.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire spit in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_VORELING; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_VORE); +}; + +//---------------------------------------------------------------------- +void() voreling_spit1 = [ $pain1, voreling_spit2 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_VORELING); }; +void() voreling_spit2 = [ $pain2, voreling_spit3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_VORELING); }; +void() voreling_spit3 = [ $bite1, voreling_spit4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_VORELING); }; +void() voreling_spit4 = [ $bite2, voreling_spit5 ] {voreling_spitacid(-0.1);}; +void() voreling_spit5 = [ $bite3, voreling_spit6 ] {voreling_spitacid(0);}; +void() voreling_spit6 = [ $bite4, voreling_spit7 ] {voreling_spitacid(0.1);}; +void() voreling_spit7 = [ $bite5, voreling_spit8 ] {}; +void() voreling_spit8 = [ $bite6, voreling_spit9 ] {}; +void() voreling_spit9 = [ $bite7, voreling_run1 ] {}; + +//====================================================================== +// BITE +//====================================================================== +void() voreling_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEVORELING)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_VOICE, "voreling/attackmunch.wav", TRUE, TRUE); + else sound(self, CHAN_VOICE, "voreling/attacktear.wav", TRUE, TRUE); + + // Voreling bite (damage 1-9) is very weak + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn some touch blood + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() voreling_bite1 =[ $bite1, voreling_bite2 ] {ai_face();}; +// Start bite attack loop +void() voreling_bite2 =[ $bite2, voreling_bite3 ] {ai_face();}; +void() voreling_bite3 =[ $bite3, voreling_bite4 ] {ai_face();}; +void() voreling_bite4 = [ $bite4, voreling_bite5 ] {voreling_melee();}; +void() voreling_bite5 = [ $bite5, voreling_bite6 ] {}; +void() voreling_bite6 =[ $bite6, voreling_bite7 ] { + if (ai_checkmelee(MONAI_MELEEVORELING) && self.enemy.health > 0) self.think = voreling_bite2;}; +// Exit bite attack loop +void() voreling_bite7 =[ $bite7, voreling_run1 ] {}; + +//============================================================================ +// JUMP FUNCTION (range) +//============================================================================ +void() Voreling_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other vorelings with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the voreling floating in the air? + if (!checkbottom(self)) { + // Is the voreling standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() voreling_leap1 =[ $jump1, voreling_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + monster_idle_sound(); +}; +void() voreling_leap2 =[ $jump2, voreling_leap3 ] {ai_face();}; +void() voreling_leap3 =[ $jump3, voreling_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = Voreling_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPVORELINGDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() voreling_leap4 =[ $jump4, voreling_leap5 ] {}; +void() voreling_leap5 =[ $jump5, voreling_leap6 ] {}; +void() voreling_leap6 =[ $jump6, voreling_leap7 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = voreling_leap3; + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() voreling_leap7 =[ $jump3, voreling_leap8 ] {monster_footstep(FALSE);}; +void() voreling_leap8 =[ $jump2, voreling_leap9 ] {monster_footstep(FALSE);}; +void() voreling_leap9 =[ $jump1, voreling_run1 ] {ai_resetangles();}; + +//====================================================================== +// CEILING VORELINGS - Idle/Drop/Touch/Land functions +//====================================================================== +void() voreling_idleup1 =[ $idleup1, voreling_idleup2] {monster_idle_sound();ai_stand();}; +void() voreling_idleup2 =[ $idleup2, voreling_idleup3] {ai_stand();}; +void() voreling_idleup3 =[ $idleup3, voreling_idleup4] {ai_stand();}; +void() voreling_idleup4 =[ $idleup4, voreling_idleup5] {ai_stand();}; +void() voreling_idleup5 =[ $idleup5, voreling_idleup6] {ai_stand();}; +void() voreling_idleup6 =[ $idleup6, voreling_idleup1] {ai_stand();}; + +//---------------------------------------------------------------------- +void() voreling_droptouch = +{ + // Check if landed on something that is not the ground? + if (!checkbottom(self)) { + // Is the voreling standing on something? + if (self.flags & FL_ONGROUND) { + self.flags = self.flags - FL_ONGROUND; + self.origin_z = self.origin_z + 8; + setorigin(self, self.origin); // raise up + self.attack_timer = time + 1; // reset timer + + makevectors (self.angles); + self.velocity = v_forward * 100 + '0 0 200'; + } + return; + } + + // No more flying, back to running + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setsize(self, self.bbmins, self.bbmaxs); + + // Reset view offset (based on bbox height) + self.view_ofs = '0 0 0'; + self.view_ofs_z = self.maxs_z*0.5; + + self.touch = SUB_Null; // No more jump touching + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + + // Restore all think state functions (voreling is off the ceiling) + self.th_stand = voreling_idle1; + self.th_walk = voreling_walk1; + self.th_run = voreling_run1; + self.th_slide = voreling_slide1; + self.th_melee = voreling_bite1; + + // Voreling 1 and 2 have different range attacks + if (self.spawnflags & MON_VORELING_LARGE) self.th_missile = voreling_spit1; + else self.th_jump = voreling_leap1; + + // Back to running or standing around! + if (!self.enemy) self.think = self.th_stand; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() voreling_drop1 =[ $drop1, voreling_drop2 ] {}; +void() voreling_drop2 =[ $drop2, voreling_drop3 ] {}; +void() voreling_drop3 =[ $drop3, voreling_drop4 ] {}; +void() voreling_drop4 =[ $drop4, voreling_drop5 ] {}; +void() voreling_drop5 =[ $drop5, voreling_drop5 ] { + if (self.attack_timer < time || self.velocity_z == 0) voreling_droptouch(); +}; + +//---------------------------------------------------------------------------- +void() voreling_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // Only call wakeup function once + self.th_walk = self.th_run = self.th_slide = SUB_Null; + + // No longer need cling to ceiling spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_VORELING_CEILING); + + self.flags = FL_MONSTER; // reset flags + + if (engine == ENG_FITZ) self.origin_z = self.origin_z - 8; + else self.origin_z = self.origin_z - 32; // Unstick from ceiling + setorigin(self, self.origin); // Move down slightly + + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.solid = SOLID_SLIDEBOX; + self.attack_timer = time + 1; // Stuck timer + + self.classmove = MON_MOVEWALK; // Back to walking/running + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + + makevectors (self.angles); // Move towards face direction + self.velocity = v_forward * 50; // Slight nudge forward + + self.touch = voreling_droptouch; // Touch something? + if (!self.jump_flag) + self.jump_flag = time + 1 + random()*2; // Don't jump straight away + voreling_drop1(); // Turn around, cat tricks! +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() voreling_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() voreling_grow1 = [ $grow1, voreling_grow2 ] {}; +void() voreling_grow2 = [ $grow2, voreling_grow3 ] {voreling_growangle();}; +void() voreling_grow3 = [ $grow3, voreling_grow4 ] {voreling_growangle();}; +void() voreling_grow4 = [ $grow4, voreling_grow5 ] {voreling_growangle();}; +void() voreling_grow5 = [ $grow5, voreling_grow6 ] {voreling_growangle();}; +void() voreling_grow6 = [ $grow6, voreling_grow7 ] {voreling_growangle();}; +void() voreling_grow7 = [ $grow7, voreling_grow8 ] {voreling_growangle();}; +void() voreling_grow8 = [ $grow8, voreling_grow9 ] {voreling_growangle();}; +void() voreling_grow9 = [ $grow9, voreling_grow10] {voreling_growangle();}; +void() voreling_grow10= [ $grow10, voreling_run1 ] { + // Is the voreling stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = voreling_idle1; + self.th_walk = voreling_walk1; + self.th_run = voreling_run1; + self.th_slide = voreling_slide1; + self.th_melee = voreling_bite1; + // Voreling 1 and 2 have different range attacks + if (self.spawnflags & MON_VORELING_LARGE) self.th_missile = voreling_spit1; + else { + self.th_jump = voreling_leap1; + self.th_jumpexit = voreling_leap7; + } + } +}; +//---------------------------------------------------------------------------- +void() voreling_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + voreling_grow1(); +}; + +//============================================================================ +void() voreling_pain1 =[ $pain1, voreling_pain2 ] {}; +void() voreling_pain2 =[ $pain2, voreling_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) voreling_pain = +{ + // Has the voreling been hit while on the ceiling? + if (self.spawnflags & MON_VORELING_CEILING) { + self.pain_finished = time + 1; + voreling_wakeup(); + return; + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1) voreling_pain1(); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.2; + self.axhitme = 0; + voreling_pain1(); + } + } +}; + +//============================================================================ +void() voreling_die1 =[ $death1, voreling_die2 ] {}; +void() voreling_die2 =[ $death2, voreling_die3 ] {monster_check_gib();}; +void() voreling_die3 =[ $death3, voreling_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() voreling_die4 =[ $death4, voreling_die5 ] {}; +void() voreling_die5 =[ $death5, voreling_die6 ] {monster_death_postcheck();}; +void() voreling_die6 =[ $death6, voreling_die6 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() voreling_dieB1 =[ $deathB1, voreling_dieB2 ] {}; +void() voreling_dieB2 =[ $deathB2, voreling_dieB3 ] {monster_check_gib();}; +void() voreling_dieB3 =[ $deathB3, voreling_dieB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() voreling_dieB4 =[ $deathB4, voreling_dieB5 ] {}; +void() voreling_dieB5 =[ $deathB5, voreling_dieB6 ] {}; +void() voreling_dieB6 =[ $deathB6, voreling_dieB7 ] {monster_death_postcheck();}; +void() voreling_dieB7 =[ $deathB7, voreling_dieB7 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() voreling_die = +{ + // Vorelings are small, gibs don't bounce far + self.max_health = MON_NOGIBVELOCITY; + + // Has the voreling died while on the ceiling? + if (self.spawnflags & MON_VORELING_CEILING) + self.gibondeath = TRUE; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "voreling/death.wav", 1, ATTN_NORM); + if (random() < 0.6) voreling_die1(); + else voreling_dieB1(); + } +}; + +/*====================================================================== +/*QUAKED monster_voreling (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() setup_voreling; +void() monster_voreling = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_VORELING_LARGE) { + self.mdl = "progs/mon_vorelingp.mdl"; + self.gib1mdl = "progs/gib_vorelegp.mdl"; // Single Leg + + precache_model (self.mdl); + precache_model (self.gib1mdl); + precache_model (MODEL_PROJ_VORE); // Spit Projectile + } + if (!(self.spawnflags & MON_VORELING_LARGE) || + self.classtype == CT_CACHEVORELING) { + self.mdl = "progs/mon_voreling.mdl"; + self.gib1mdl = "progs/gib_voreleg.mdl"; // Single Leg + + precache_model (self.mdl); + precache_model (self.gib1mdl); + } + + // IDLE/COMBAT and SIGHT sounds + self.idle_sound = "voreling/idle.wav"; + precache_sound (self.idle_sound); + + // death/pain/attack sounds + precache_sound("voreling/death.wav"); + self.pain_sound = "voreling/pain.wav"; + precache_sound(self.pain_sound); + + precache_sound("voreling/miss.wav"); // Spit misses + precache_sound("voreling/hiss2.wav"); // Spit attack + precache_sound("voreling/attackmunch.wav"); + precache_sound("voreling/attacktear.wav"); + precache_sound("voreling/jumpland.wav"); + + self.sight_sound = "voreling/sight.wav"; + precache_sound (self.sight_sound); + + // Cache voreling is a special class used for precache only + if (self.classtype != CT_CACHEVORELING) setup_voreling(); +}; + +//---------------------------------------------------------------------------- +void() monster_shalrathminion = { + self.classtype = CT_CACHEVORELING; + self.spawnflags = MON_VORELING_LARGE; // Precache both vorelings + monster_voreling(); +}; + +//---------------------------------------------------------------------------- +void() setup_voreling = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.steptype = FS_TYPELIGHT; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '20 0 0'; // Bite attack offset + self.attack_offset = '14 0 8'; // Used by purple voreling, at jaws + self.movespeed = 1; // Can never be a turret + self.poisonous = FALSE; // Use swamplings if wanting poison + self.deathstring = " was nibbled by a Voreling\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = VorelingCheckAttack; + self.th_pain = voreling_pain; + self.th_die = voreling_die; + + if(!self.classtype) self.classtype = CT_MONVORELING; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + // Setup white/purple voreling difference + if (self.spawnflags & MON_VORELING_LARGE) { + if (self.health < 1) self.health = 60; + self.gibhealth = -25; + self.th_missile = voreling_spit1; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = voreling_leap1; + self.th_jumpexit = voreling_leap7; + } + + //---------------------------------------------------------------------- + // Ceiling vorelings have special idle animation + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_VORELING_CEILING) { + self.th_stand = self.th_walk = voreling_idleup1; + self.th_run = self.th_slide = voreling_wakeup; + self.th_melee = self.th_missile = self.th_jump = voreling_wakeup; + // th_pain and th_die functions understand ceiling vorelings + } + // Special spawning minion need to start spinning + else if (self.classtype == CT_MINIONVORELING) { + self.th_stand = self.th_walk = self.th_run = voreling_grow; + self.th_melee = self.th_slide = SUB_Null; + self.th_missile = self.th_jump = SUB_Null; + } + // Default voreling behaviour functions + else { + self.th_stand = voreling_idle1; + self.th_walk = voreling_walk1; + self.th_run = voreling_run1; + self.th_melee = voreling_bite1; + self.th_slide = voreling_slide1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn vorelings (requires monster_shalrathminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_voreling = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + update_minioncount(self.owner, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_voreling"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self.owner; // Spawner Parent Link + self.owner = minion; // Stop gibs interacting with minion + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONVORELING; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = 0; + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + if (random() < 0.2) minion.spawnflags = MON_VORELING_LARGE; + else minion.spawnflags = 0; + + if (minion.spawnflags & MON_VORELING_LARGE) { + minion.mdl = "progs/mon_vorelingp.mdl"; // Purpler horror + minion.gib1mdl = "progs/gib_vorelegp.mdl"; // Single Leg + } + else { + minion.mdl = "progs/mon_voreling.mdl"; // Creamy delight + minion.gib1mdl = "progs/gib_voreleg.mdl"; // Single Leg + } + + minion.idle_sound = "voreling/idle.wav"; + minion.sight_sound = "voreling/sight.wav"; + minion.pain_sound = "voreling/pain.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_voreling; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_wizard.qc b/QC_other/QC_arcane/mon_wizard.qc new file mode 100644 index 00000000..edd93893 --- /dev/null +++ b/QC_other/QC_arcane/mon_wizard.qc @@ -0,0 +1,392 @@ +/*============================================================================== +WIZARD +==============================================================================*/ + +$cd id1/models/a_wizard +$origin 0 0 24 +$base wizbase +$skin wizbase + +$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 +$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 + +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 fly9 fly10 +$frame fly11 fly12 fly13 fly14 + +$frame magatt1 magatt2 magatt3 magatt4 magatt5 magatt6 magatt7 +$frame magatt8 magatt9 magatt10 magatt11 magatt12 magatt13 + +$frame pain1 pain2 pain3 pain4 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 + +//============================================================================ +void() wiz_stand1 =[ $hover1, wiz_stand2 ] {monster_idle_sound(); ai_stand();}; +void() wiz_stand2 =[ $hover2, wiz_stand3 ] {ai_stand();}; +void() wiz_stand3 =[ $hover3, wiz_stand4 ] {ai_stand();}; +void() wiz_stand4 =[ $hover4, wiz_stand5 ] {ai_stand();}; +void() wiz_stand5 =[ $hover5, wiz_stand6 ] {ai_stand();}; +void() wiz_stand6 =[ $hover6, wiz_stand7 ] {ai_stand();}; +void() wiz_stand7 =[ $hover7, wiz_stand8 ] {ai_stand();}; +void() wiz_stand8 =[ $hover8, wiz_stand1 ] {ai_stand();}; + +//============================================================================ +void() wiz_walk1 =[ $hover1, wiz_walk2 ] {monster_idle_sound(); ai_walk(8);}; +void() wiz_walk2 =[ $hover2, wiz_walk3 ] {ai_walk(8);}; +void() wiz_walk3 =[ $hover3, wiz_walk4 ] {ai_walk(8);}; +void() wiz_walk4 =[ $hover4, wiz_walk5 ] {ai_walk(8);}; +void() wiz_walk5 =[ $hover5, wiz_walk6 ] {ai_walk(8);}; +void() wiz_walk6 =[ $hover6, wiz_walk7 ] {ai_walk(8);}; +void() wiz_walk7 =[ $hover7, wiz_walk8 ] {ai_walk(8);}; +void() wiz_walk8 =[ $hover8, wiz_walk1 ] {ai_walk(8);}; + +//============================================================================ +void() wiz_side1 =[ $hover1, wiz_side2 ] {monster_idle_sound(); ai_run(8);}; +void() wiz_side2 =[ $hover2, wiz_side3 ] {ai_run(8);}; +void() wiz_side3 =[ $hover3, wiz_side4 ] {ai_run(8);}; +void() wiz_side4 =[ $hover4, wiz_side5 ] {ai_run(8);}; +void() wiz_side5 =[ $hover5, wiz_side6 ] {ai_run(8);}; +void() wiz_side6 =[ $hover6, wiz_side7 ] {ai_run(8);}; +void() wiz_side7 =[ $hover7, wiz_side8 ] {ai_run(8);}; +void() wiz_side8 =[ $hover8, wiz_side1 ] {ai_run(8);}; + +//============================================================================ +void() wiz_run1 =[ $fly1, wiz_run2 ] {monster_idle_sound(); ai_run(16);}; +void() wiz_run2 =[ $fly2, wiz_run3 ] {ai_run(16);}; +void() wiz_run3 =[ $fly3, wiz_run4 ] {ai_run(16);}; +void() wiz_run4 =[ $fly4, wiz_run5 ] {ai_run(16);}; +void() wiz_run5 =[ $fly5, wiz_run6 ] {ai_run(16);}; +void() wiz_run6 =[ $fly6, wiz_run7 ] {ai_run(16);}; +void() wiz_run7 =[ $fly7, wiz_run8 ] {ai_run(16);}; +void() wiz_run8 =[ $fly8, wiz_run9 ] {ai_run(16);}; +void() wiz_run9 =[ $fly9, wiz_run10 ] {ai_run(16);}; +void() wiz_run10 =[ $fly10, wiz_run11 ] {ai_run(16);}; +void() wiz_run11 =[ $fly11, wiz_run12 ] {ai_run(16);}; +void() wiz_run12 =[ $fly12, wiz_run13 ] {ai_run(16);}; +void() wiz_run13 =[ $fly13, wiz_run14 ] {ai_run(16);}; +void() wiz_run14 =[ $fly14, wiz_run1 ] {ai_run(16);}; + +//============================================================================ +// Range attack +//============================================================================ +void() WizardAttackFinished = +{ + SUB_AttackFinished(2); + if (enemy_range >= RANGE_MID || !enemy_vis) { + self.attack_state = AS_STRAIGHT; + self.think = wiz_run1; + } + else { + self.attack_state = AS_SLIDING; + self.think = wiz_side1; + } +}; + +//---------------------------------------------------------------------- +// Fire spit missile towards player position +// The missile is setup and defined beforehand +//---------------------------------------------------------------------- +void() Wiz_FastFire = +{ + local vector vec, dst; + local entity twizard, tmissile; + + // Is the wizard still alive? + if (self.owner.health > 0) { + // Setup correct entities + tmissile = self; + twizard = self.owner; + // Switch to the actual wizard + self = twizard; + + // Add glow effect to wizard while firing + self.effects = self.effects | EF_MUZZLEFLASH; + + // Check for any enemytarget setup (above spawnflag) + makevectors (SUB_angEnemyTarget()); + // Work out origin and offset from missile, not wizard + dst = SUB_orgEnemyTarget() - 13 * tmissile.movedir; + vec = normalize(dst - tmissile.origin); + + self.attack_speed = SPEED_WIZSPIKE + (skill * SPEED_WIZSKILL); + // make sure sound is played on the wizard, not the missile + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + // Launch projectile expects self = firing monster + launch_projectile (tmissile.origin, vec, CT_PROJ_WIZ, self.attack_speed); + // Switch back to missile entity for removal + self = tmissile; + } + + remove (self); +}; + +//---------------------------------------------------------------------- +// Create two spit missiles ready for firing later (delay 0.6, 1.0) +// This code is hoping the player will strafe into the second shot +//---------------------------------------------------------------------- +void() Wiz_StartFast = +{ + local entity missile; + + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + self.v_angle = self.angles; + makevectors (self.angles); + + missile = spawn (); + missile.owner = self; + missile.nextthink = time + 0.6; + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + self.attack_offset + v_forward*14 + v_right*14); + missile.enemy = SUB_entEnemyTarget(); + missile.nextthink = time + 0.8; + missile.think = Wiz_FastFire; + missile.movedir = v_right; + + missile = spawn (); + missile.owner = self; + missile.nextthink = time + 1; + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + self.attack_offset + v_forward*14 + v_right* -14); + missile.enemy = SUB_entEnemyTarget(); + missile.nextthink = time + 0.3; + missile.think = Wiz_FastFire; + missile.movedir = VEC_ORIGIN - v_right; +}; + +//---------------------------------------------------------------------- +void() wiz_fast1 =[ $magatt1, wiz_fast2 ] {ai_face();Wiz_StartFast();}; +void() wiz_fast2 =[ $magatt2, wiz_fast3 ] {ai_face();}; +void() wiz_fast3 =[ $magatt3, wiz_fast4 ] {ai_face();}; +void() wiz_fast4 =[ $magatt4, wiz_fast5 ] {ai_face();}; +void() wiz_fast5 =[ $magatt5, wiz_fast6 ] {ai_face();}; +void() wiz_fast6 =[ $magatt6, wiz_fast7 ] {ai_face();}; +void() wiz_fast7 =[ $magatt5, wiz_fast8 ] {ai_face();}; +void() wiz_fast8 =[ $magatt4, wiz_fast9 ] {ai_face();}; +void() wiz_fast9 =[ $magatt3, wiz_fast10] {ai_face();}; +void() wiz_fast10 =[ $magatt2, wiz_run1 ] {WizardAttackFinished (); ai_face();}; + +//============================================================================ +void() wiz_wakeup =[ $hover1, wiz_run1 ] { + // Is the wizard stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + monster_sightsound(); + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + // Restore all think state functions + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = wiz_fast1; + self.th_slide = wiz_side1; + } +}; + +//============================================================================ +void() wiz_pain1 =[ $pain1, wiz_pain2] {}; +void() wiz_pain2 =[ $pain2, wiz_pain3] {}; +void() wiz_pain3 =[ $pain3, wiz_pain4] {}; +void() wiz_pain4 =[ $pain4, wiz_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) wiz_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) wiz_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.4; + self.axhitme = 0; + wiz_pain1 (); + } + } +}; + +//============================================================================ +void() wiz_death1 =[ $death1, wiz_death2 ] {}; +void() wiz_death2 =[ $death2, wiz_death3 ] {monster_check_gib();}; +void() wiz_death3 =[ $death3, wiz_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() wiz_death4 =[ $death4, wiz_death5 ] {}; +void() wiz_death5 =[ $death5, wiz_death6 ] {}; +void() wiz_death6 =[ $death6, wiz_death7 ] {}; +void() wiz_death7 =[ $death7, wiz_death8 ] {monster_death_postcheck();}; +void() wiz_death8 =[ $death8, wiz_death8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() wiz_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM); + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + wiz_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_wizard (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() setup_wizard; +void() monster_wizard = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_wizard.mdl"; + self.headmdl = "progs/h_wizard.mdl"; + self.gib1mdl = "progs/gib_wzarm1.mdl"; // Left arm/stump + self.gib2mdl = "progs/gib_wzarm2.mdl"; // Right arm/stump + self.gib3mdl = "progs/gib_wztail.mdl"; // Tail section + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_WIZ); // Originally progs/w_spike.mdl + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.idle_sound = "wizard/widle1.wav"; + self.idle_sound2 = "wizard/widle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("wizard/wdeath.wav"); + self.pain_sound = "wizard/wpain.wav"; + precache_sound (self.pain_sound); + + precache_sound ("wizard/hit.wav"); // used by c code + precache_sound ("wizard/wattack.wav"); + + self.sight_sound = "wizard/wsight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + self.exactskin = 1; // Greener version + self.gib1skin = self.gib2skin = self.gib3skin = 1; + } + + // Cache gargoyle is a special class used for precache only + if (self.classtype != CT_CACHEWIZARD) setup_wizard(); +}; + +//---------------------------------------------------------------------------- +void() monster_nourminion = { + self.classtype = CT_CACHEWIZARD; + self.poisonous = TRUE; // Cache poison stuff (just in case) + monster_wizard(); +}; + +//---------------------------------------------------------------------------- +void() setup_wizard = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 80; + self.gibhealth = -30; + self.pain_flinch = 70; // high pain threshold + self.pain_longanim = TRUE; // Has long pain animation for Shadow Axe + self.blockudeath = TRUE; // no humanoid death sound + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + self.attack_offset = '0 0 30'; // Acid spit start location + self.deathstring = " was wrecked by a Wizard\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Allow wizards to keep a certain distance above the enemy + if (self.spawnflags & MON_WIZARD_ABOVE) { + self.th_checkattack = GargoyleCheckAttack; + } + else { + // Default behaviour, really high distance checks + self.th_checkattack = WizardCheckAttack; + self.enemymaxdist = TRUE; + } + self.th_pain = wiz_pain; + self.th_die = wiz_die; + + if(!self.classtype) self.classtype = CT_MONWIZARD; + if (!self.classgroup) self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + if (self.classtype == CT_MINIONWIZARD) { + self.th_stand = self.th_walk = self.th_run = wiz_wakeup; + self.th_missile = self.th_slide = wiz_wakeup; + } + else { + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = wiz_fast1; + self.th_slide = wiz_side1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn wizards (requires monster_nourminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ, float minion_sflag) minion_wizard = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + // Self = minotaur, there is no egg + update_minioncount(self, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_wizard"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self; // Spawner Parent Link + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONWIZARD; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = minion_sflag; // Spawnflags + minion.classgroup = CG_WIZARD; // Don't turn on master + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + // Check for poison gibs being cached first + if (gibpoison && self.poisonous == TRUE) { + minion.poisonous = self.poisonous; // carry over from host spawner + minion.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + minion.mdl = "progs/mon_wizard.mdl"; + minion.headmdl = "progs/h_wizard.mdl"; + minion.gib1mdl = "progs/gib_wzarm1.mdl"; // Left arm/stump + minion.gib2mdl = "progs/gib_wzarm2.mdl"; // Right arm/stump + minion.gib3mdl = "progs/gib_wztail.mdl"; // Tail section + + minion.pain_sound = "wizard/wpain.wav"; + minion.idle_sound = "wizard/widle1.wav"; + minion.idle_sound2 = "wizard/widle2.wav"; + minion.sight_sound = "wizard/wsight.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_wizard; +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_wraith.qc b/QC_other/QC_arcane/mon_wraith.qc new file mode 100644 index 00000000..f4d78780 --- /dev/null +++ b/QC_other/QC_arcane/mon_wraith.qc @@ -0,0 +1,907 @@ +/*============================================================================== +WRAITH from Rogue Expansion Pack +==============================================================================*/ +$skin wrthskin + +// Base animation pose +$frame basepose + +// Walk/Idle pose (strange lerp at the end of frame set) +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// Magic Attack A - Swing arms forward with hand meeting together +$frame magicA1 magicA2 magicA3 magicA4 magicA5 magicA6 magicA7 magicA8 +$frame magicA9 magicA10 magicA11 magicA12 magicA13 magicA14 + +// Magic Attack B - Cup hands around a missile object infront and fire +$frame magicB1 magicB2 magicB3 magicB4 magicB5 magicB6 magicB7 magicB8 +$frame magicB9 magicB10 magicB11 magicB12 magicB13 + +// Magic Attack C - Swing right arm forward firing a projectile +$frame magicC1 magicC2 magicC3 magicC4 magicC5 magicC6 magicC7 magicC8 +$frame magicC9 magicC10 magicC11 magicC12 magicC13 magicC14 magicC15 + +// Pain A - Short flinch backwards +$frame painA1 painA2 painA3 painA4 painA5 painA6 + +// Pain B - Long motion of being hit several times +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 + +// Death - Shrink down and explode +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 + +float BONEOFFSET = 8; +float WRAITH_ALPHA = 0.7; +float WRAITH_ALPHAFIRE = 1; +float BALL_NAIL_COL1 = 0; // Red +float BALL_NAIL_COL2 = 1; // Sickly yellow +float BALL_SPIDER_COL1 = 1; // Sickly yellow +float BALL_DEBUFF_COL1 = 3; // Glowing yellow/red +float BALL_DEBUFF_COL2 = 3; // Glowing yellow/red +float FADEDEBUFF_TIME = 0.01; // Small amount of time +float WRAITH_SKINBLUE = 0; // Fire wraith +float WRAITH_SKINGREEN = 2; // Spider version +float WRAITH_SKINPURPLE = 4; // Scorpion version + +//====================================================================== +void() wraith_stand1 =[ $stand4, wraith_stand2 ] { monster_idle_sound();ai_stand();}; +void() wraith_stand2 =[ $stand5, wraith_stand3 ] { ai_stand();}; +void() wraith_stand3 =[ $stand6, wraith_stand4 ] { ai_stand();}; +void() wraith_stand4 =[ $stand7, wraith_stand5 ] { ai_stand();}; +void() wraith_stand5 =[ $stand8, wraith_stand6 ] { ai_stand();}; +void() wraith_stand6 =[ $stand9, wraith_stand7 ] { ai_stand();}; +void() wraith_stand7 =[ $stand9, wraith_stand8 ] { ai_stand();}; +void() wraith_stand8 =[ $stand8, wraith_stand9 ] { ai_stand();}; +void() wraith_stand9 =[ $stand7, wraith_stand10 ] { ai_stand();}; +void() wraith_stand10 =[ $stand6, wraith_stand11 ] { ai_stand();}; +void() wraith_stand11 =[ $stand5, wraith_stand12 ] { ai_stand();}; +void() wraith_stand12 =[ $stand4, wraith_stand1 ] { ai_stand();}; + +//====================================================================== +void() wraith_walk1 =[ $stand3, wraith_walk2 ] { monster_idle_sound();ai_walk(8);}; +void() wraith_walk2 =[ $stand4, wraith_walk3 ] { ai_walk(7);}; +void() wraith_walk3 =[ $stand5, wraith_walk4 ] { ai_walk(7);}; +void() wraith_walk4 =[ $stand6, wraith_walk5 ] { ai_walk(6);}; +void() wraith_walk5 =[ $stand7, wraith_walk6 ] { ai_walk(6);}; +void() wraith_walk6 =[ $stand8, wraith_walk7 ] { ai_walk(5);}; +void() wraith_walk7 =[ $stand9, wraith_walk8 ] { ai_walk(5);}; +void() wraith_walk8 =[ $stand10, wraith_walk9 ] { ai_walk(4);}; +void() wraith_walk9 =[ $stand11, wraith_walk10 ] { ai_walk(8);}; +void() wraith_walk10 =[ $stand12, wraith_walk1 ] { ai_walk(8);}; + +//====================================================================== +void() wraith_run1 =[ $stand3, wraith_run2 ] {monster_idle_sound(); + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(8); +}; +void() wraith_run2 =[ $stand4, wraith_run3 ] {ai_run(7);}; +void() wraith_run3 =[ $stand5, wraith_run3 ] {ai_run(7);}; +void() wraith_run4 =[ $stand6, wraith_run3 ] {ai_run(6);}; +void() wraith_run5 =[ $stand7, wraith_run3 ] {ai_run(6);}; +void() wraith_run6 =[ $stand8, wraith_run3 ] {ai_run(5);}; +void() wraith_run7 =[ $stand9, wraith_run3 ] {ai_run(5);}; +void() wraith_run8 =[ $stand10, wraith_run3 ] {ai_run(4);}; +void() wraith_run9 =[ $stand11, wraith_run3 ] {ai_run(8);}; +void() wraith_run10 =[ $stand12, wraith_run3 ] {ai_run(8);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() wraith_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_WBALL; + self.attachment.alpha = 0.85; + } + if (!self.attachment2) { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_ATTACHMENT; + self.attachment2.mdl = MODEL_PROJ_WBALL; + self.attachment2.alpha = 0.85; + } + if (!self.attachment3) { + self.attachment3 = spawn(); + self.attachment3.owner = self; + self.attachment3.classtype = CT_ATTACHMENT; + self.attachment3.mdl = self.weaponglow; + self.attachment3.alpha = 0.5; + } +}; + +//---------------------------------------------------------------------- +void() wraith_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } + if (self.attachment2) { + setmodel(self.attachment2, ""); + self.attachment2.state = STATE_OFF; + } + if (self.attachment3) { + setmodel(self.attachment3, ""); + self.attachment3.state = STATE_OFF; + self.attachment3.velocity = '0 0 0'; + } +}; + +//---------------------------------------------------------------------- +void() wraith_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } + if (self.attachment2) { + self.attachment2.think = SUB_Remove; + self.attachment2.nextthink = time + 0.1; + } + if (self.attachment3) { + self.attachment3.think = SUB_Remove; + self.attachment3.nextthink = time + 0.1; + } +}; + +//====================================================================== +// FADE OUT TEMPORARY MODELS +// Very quick fade (0.5s) - modified version of model_fade +//====================================================================== +void() debuff_fade = +{ + self.alpha = 0.5 - ((time - self.ltime) / 0.5); + + if (self.alpha < 0.2) { + self.alpha = 0; + self.modelindex = 0; // Make sure no model + self.model = ""; // hide model + self.think = SUB_Remove; + self.nextthink = time + 0.1; + return; + } + self.nextthink = time + FADEDEBUFF_TIME; +}; + +//---------------------------------------------------------------------- +// Start fading out (very quick, over 0.5s) +//---------------------------------------------------------------------- +void() wraith_debuff_chunk = +{ + self.think = debuff_fade; + self.nextthink = time + FADEDEBUFF_TIME; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +// Manual animation of ball at end of the debuff particle trail +//---------------------------------------------------------------------- +void() wraith_debuff_shrink = +{ + // Count downwards getting smaller + self.lip = self.frame - 1; + if (self.lip < 0) wraith_debuff_chunk(); + else { + // Check frame number before assigning + // Cannot set models with negative frame numbers + self.frame = self.lip; + self.think = wraith_debuff_shrink; + self.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - Apply debuff to player (hitscan!) +// +// Generate an animated particle trail from 32 unit segments +// Slowly remove segments from source to target +// Generate a ball at target location slowly shrinking +//====================================================================== +void() wraith_fire_touch = +{ + if (other.solid == SOLID_TRIGGER) return; + if (other.classtype == CT_TEMPSTREAM) return; + if (other.health > 0) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 1; + self.modelindex = 0; // Make sure no model + self.model = ""; // hide model + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() wraith_fire_think = +{ + // Randomly drift upwards and slow down forward movement + self.velocity_z = self.velocity_z + 10 + (random() * 20); + self.velocity = self.velocity - (self.velocity * 0.125); + + self.frame = self.frame + 1; + if (self.frame > self.count) SUB_Remove(); + else self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void(vector start_org) wraith_debuff_explode = +{ + local float fire_loop; + local vector fire_angles, org, dir; + + fire_loop = 0; + fire_angles = '0 0 0'; + + while (fire_loop < 360) { + newmis = spawn(); + newmis.classtype = CT_TEMPSTREAM; + newmis.movetype = MOVETYPE_FLY; // Fly, no gravity + newmis.solid = SOLID_TRIGGER; + setmodel(newmis, SBURST_FLAME); + + org = start_org; + org_z = org_z + (crandom() * 24); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + fire_angles_y = fire_loop; + makevectors(fire_angles); + dir = vecrand(0,50,FALSE); + dir = dir + (v_forward * (400 + random() * 50)); + newmis.velocity = dir; + newmis.count = 6; + newmis.frame = rint(random()*2); + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) newmis.effects = newmis.effects + EF_NOSHADOW; + + newmis.think = wraith_fire_think; + newmis.touch = wraith_fire_touch; + newmis.nextthink = time + 0.1; + + fire_loop = fire_loop + rint(random()*15); + } +}; + +//---------------------------------------------------------------------- +void() wraith_debuff_trail = +{ + local vector org, orgofs, dir, tvec, tang; + local float tdist, tloop, tcount, tpc; + local entity tent; + + // Starting point of beam matched to wraith animation + makevectors (self.angles); + orgofs = '52 4 6'; + + // Calculate starting point and beam and vector direction + org = self.origin + attack_vector(orgofs); + tvec = SUB_orgEnemyTarget() - org; + // Create facing angle for segments + dir = normalize(tvec); + tang = vectoangles(dir); + + // Check for solid wall very close + tpc = pointcontents(org); + if (tpc == CONTENT_SOLID || tpc == CONTENT_SKY) return; + tpc = pointcontents(org+(dir*16)); + if (tpc == CONTENT_SOLID || tpc == CONTENT_SKY) return; + + // Check for obstacles (geo and monsters) + traceline(org, SUB_orgEnemyTarget(), FALSE, self); + tdist = trace_fraction * vlen(tvec); + if (tdist < 32) return; + tloop = tdist / 32; + tcount = 0; + + //---------------------------------------------------------------------- + // Originally - BleedDeBuff(SUB_entEnemyTarget()); + // New version - Fire explosion + burning + if (trace_ent.flags & FL_CLIENT) { + self.owner = self; // Fix for T_damage inside ApplyFireDmg + ApplyFireDmg(SUB_entEnemyTarget(), DAMAGE_PYROWRAITH, DAMAGE_PYROWRAITH); + } + else if (ai_foundbreakable(self, trace_ent, FALSE)) + T_Damage (trace_ent, self, self, 100, DAMARMOR); + + //---------------------------------------------------------------------- + // Generate particle beam in segments + while(tcount < tloop) { + // Create segment in the middle of 32 segment + tvec = org + (dir* (16 + tcount*32) ); + + // Spawn temporary entity + tent = spawn(); + tent.owner = self; + tent.classtype = CT_PROJ_WBOLT; + setsize (tent, VEC_ORIGIN, VEC_ORIGIN); + tent.movetype = MOVETYPE_FLYMISSILE; // Needs to float up + tent.solid = SOLID_NOT; + + // Special animated particle model (still, slow rotate, fast rotate) + setmodel(tent, MODEL_PROJ_WTRAIL); + setorigin(tent, tvec); + + tent.velocity = -v_up*5; // Slowly drift up to create trail particles + tent.angles = tang; // Rotate segment into place + tent.frame = 2; // Fast rotate animation group + tent.skin = 3; // Flame yellow/red + tcount = tcount + 1; // Next segment + + // Wait around for a while before fading out + tent.think = wraith_debuff_chunk; + tent.nextthink = time + (tcount *0.05); + } + + // Workout final destination of explosion and effects + self.finaldest = tvec+(dir *16); + + //---------------------------------------------------------------------- + // Spawn a ball of plasma at the final destionation + // Shrinking downwards in size over 0.1s frames + tent = spawn(); + tent.owner = self; + tent.classtype = CT_PROJ_WBOLT; + setsize (tent, VEC_ORIGIN, VEC_ORIGIN); + tent.movetype = MOVETYPE_FLYMISSILE;// Needs to float upward + tent.solid = SOLID_NOT; + setmodel(tent, MODEL_PROJ_WBALL); // Initial ball + setorigin(tent, self.finaldest); // Move ball to end of final segment + tent.velocity = -v_up*5; // Slowly drift upwards + tent.avelocity = '100 100 100'; // Slight rotation on all axis + tent.frame = 6; // Start really large + tent.skin = BALL_DEBUFF_COL2; + tent.think = wraith_debuff_shrink; // Animate manually + tent.nextthink = time + 0.1; + + //---------------------------------------------------------------------- + // Generate particle explosion (+ sound effect) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); // hard coded explosion + WriteCoord (MSG_BROADCAST, self.finaldest_x); + WriteCoord (MSG_BROADCAST, self.finaldest_y); + WriteCoord (MSG_BROADCAST, self.finaldest_z); + // Play original explosion sound + sound(tent, CHAN_WEAPON, "drole/r_explode.wav", 1, ATTN_NORM); + + //---------------------------------------------------------------------- + // Large circular flame explosion + wraith_debuff_explode(self.finaldest); +}; + +//---------------------------------------------------------------------- +void(entity handent, vector orgofs, vector orgside, float dbframe) wraith_debuffball = +{ + local vector org; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + handent.state = STATE_ON; + setorigin(handent, self.origin); + setmodel(handent, handent.mdl); + setsize (handent, VEC_ORIGIN, VEC_ORIGIN); + handent.movetype = MOVETYPE_NONE; + handent.solid = SOLID_NOT; + handent.skin = BALL_DEBUFF_COL1; + } + + // Generate attachment in hand (left) + org = self.origin + v_forward*orgofs_x + orgside*orgofs_y + v_up*orgofs_z; + setorigin(handent, org); + handent.angles_y = rint(random()*359); + handent.frame = dbframe; +}; + +//---------------------------------------------------------------------- +void(vector orgofs, float dbframe) wraith_debuff = +{ + if (self.health < 1) return; + + if (dbframe == 0) { + self.pain_finished = time + 1.1; + sound (self, CHAN_WEAPON, "wraith/attack1.wav", 1, ATTN_NORM); + + // Setup halo/glow models around wraith (5% larger) + setorigin(self.attachment3, self.origin); + setmodel(self.attachment3, self.attachment3.mdl); + setsize (self.attachment3, VEC_ORIGIN, VEC_ORIGIN); + self.attachment3.movetype = MOVETYPE_NONE; + self.attachment3.solid = SOLID_NOT; + } + + // Should be visible during attack cycle + self.skin = self.exactskin + 1; + self.alpha = WRAITH_ALPHAFIRE; + // Particles drifting up slowly from body + particle_explode(self.origin, 20, 2, self.part_style, PARTICLE_BURST_UPWARD); + // Update halo/glow model + self.attachment3.angles = self.angles; + self.attachment3.frame = self.frame; + self.attachment3.velocity = self.velocity; + // Randomly change alpha to make glow flicker + self.attachment3.alpha = 0.1 + random()*0.5; + + + // Keep turning towards enemy + ai_face(); + makevectors(self.angles); + + // Generate a ball in each hand + wraith_debuffball(self.attachment, orgofs, v_right, dbframe); + wraith_debuffball(self.attachment2, orgofs, -v_right, dbframe); +}; + +//---------------------------------------------------------------------- +// RANGE ATTACK 1 - Swing arms forward with hand meeting together +// +// The debuff attack is a hitscan attack but it does have 1s animation +// (backward frames) 30 32 8, 14 46 20, -6 46 28, -12 40 28 +// (forward frames) 0 46 30, 16 42 24, 32 38 20, 48 26 10, 52 14 6, 52 4 6 +void() wraith_debuff1 =[ $magicA1, wraith_magicA2 ] {ai_face();}; +void() wraith_magicA2 =[ $magicA2, wraith_magicA3 ] {ai_face();}; +void() wraith_magicA3 =[ $magicA3, wraith_magicA4 ] {wraith_debuff('30 32 8',0);}; +void() wraith_magicA4 =[ $magicA4, wraith_magicA5 ] {wraith_debuff('14 46 20',1);}; +void() wraith_magicA5 =[ $magicA5, wraith_magicA6 ] {wraith_debuff('-6 46 28',2);}; +void() wraith_magicA6 =[ $magicA6, wraith_magicA7 ] {wraith_debuff('-12 40 28',3);}; +void() wraith_magicA7 =[ $magicA7, wraith_magicA8 ] {wraith_debuff('0 46 30',3);}; +void() wraith_magicA8 =[ $magicA8, wraith_magicA9 ] {wraith_debuff('16 42 24',4);}; +void() wraith_magicA9 =[ $magicA9, wraith_magicA10 ] {wraith_debuff('32 38 20',4);}; +void() wraith_magicA10 =[ $magicA10, wraith_magicA11 ] {wraith_debuff('48 26 10',5);}; +void() wraith_magicA11 =[ $magicA11, wraith_magicA12 ] {wraith_debuff('52 14 6',5);}; +void() wraith_magicA12 =[ $magicA12, wraith_magicA13 ] { + wraith_debuff('52 4 6',6); + wraith_debuff_trail(); + self.skin = self.exactskin; + self.alpha = WRAITH_ALPHA; +}; +void() wraith_magicA13 =[ $magicA13, wraith_magicA14 ] {wraith_finish_attachment();}; +void() wraith_magicA14 =[ $magicA14, wraith_run1 ] {}; + +//====================================================================== +// RANGE ATTACK 2 - Small bone/nail attack (low damage) +// +// Create a ball of blood and throw it towards the player +// Turning the ball into a pile of bones/nails +//====================================================================== +void(vector orgofs, float nbframe) wraith_nailball = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (nbframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + // Setup regular/poison projectile + if (self.spawnflags & MON_WRAITH_SPIDERS) self.attachment.skin = BALL_NAIL_COL2; + else self.attachment.skin = BALL_NAIL_COL1; + + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "wraith/attack2.wav", 1, ATTN_NORM); + } + + // Turn towards enemy and make vector + ai_face(); + makevectors(self.angles); + + // Generate attachment in hand (left) + org = self.origin + attack_vector(orgofs); + setorigin(self.attachment, org); + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = nbframe; +}; + +//---------------------------------------------------------------------- +void(vector boneofs) wraith_firenails = +{ + local vector org, dir; + if (self.health < 1) return; + + self.attack_speed = SPEED_WRAITHBONE + (skill * SPEED_WBONESKILL); + makevectors(self.angles); + + // Generate spike/bone at final animation position + org = self.origin + attack_vector(boneofs); + dir = SUB_orgEnemyTarget() + v_right*(BONEOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_WBONE, self.attack_speed+random()*25); + dir = SUB_orgEnemyTarget() - v_right*(BONEOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_WBONE, self.attack_speed+random()*25); + dir = SUB_orgEnemyTarget() + v_up*BONEOFFSET; + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_WBONE, self.attack_speed+random()*25); + dir = SUB_orgEnemyTarget() - v_up*BONEOFFSET; + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_WBONE, self.attack_speed+random()*25); +}; + +//---------------------------------------------------------------------- +// RANGE ATTACK 2 - Small bone/nail attack (low damage) +// +// 32 22 0, 29 29 6, 15 33 16, 4 28 24, -6 20 24, -10 16 20, 6 16 14, +// 14 16 10, 54 5 6, 60 4 14 +void() wraith_nails1 =[ $magicC1, wraith_magicC2 ] {ai_face(); + SUB_AttackFinished(1 + random()); // Fire more frequent +}; +void() wraith_magicC2 =[ $magicC2, wraith_magicC3 ] {ai_face();}; +void() wraith_magicC3 =[ $magicC3, wraith_magicC4 ] {wraith_nailball('15 33 16',0);}; +void() wraith_magicC4 =[ $magicC4, wraith_magicC5 ] {wraith_nailball('4 28 24',1);}; +void() wraith_magicC5 =[ $magicC5, wraith_magicC6 ] {wraith_nailball('-6 20 24',2);}; +void() wraith_magicC6 =[ $magicC6, wraith_magicC7 ] {wraith_nailball('-10 16 20',3);}; +void() wraith_magicC7 =[ $magicC7, wraith_magicC8 ] {wraith_nailball('6 16 14',4);}; +void() wraith_magicC8 =[ $magicC8, wraith_magicC9 ] {wraith_nailball('14 16 10',5);}; +void() wraith_magicC9 =[ $magicC9, wraith_magicC10 ] {wraith_nailball('54 5 6',6);}; +void() wraith_magicC10 =[ $magicC10, wraith_magicC11 ] { + wraith_finish_attachment(); + wraith_firenails('60 4 14'); +}; +void() wraith_magicC11 =[ $magicC11, wraith_magicC12 ] {monster_idle_sound();}; +void() wraith_magicC12 =[ $magicC12, wraith_magicC13 ] {}; +void() wraith_magicC13 =[ $magicC13, wraith_magicC14 ] {}; +void() wraith_magicC14 =[ $magicC14, wraith_magicC15 ] {ai_face();}; +void() wraith_magicC15 =[ $magicC15, wraith_run1 ] {ai_face();}; + +//====================================================================== +// RANGE ATTACK 3 - spawn spider minion (optional) +// +// Create a ball of green goo and throw it towards the player +// Once ball has landed, hatch/explode and create spider (brown/green) +//====================================================================== +void(vector eggofs, float eggframe) Setup_WraithEgg = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (eggframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = BALL_SPIDER_COL1; + + // Present wraith from going into pain during egg cycle + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "wraith/attack3.wav", 1, ATTN_NORM); + // Should be visible during spawn minion cycle + self.skin = self.exactskin + 1; + self.alpha = WRAITH_ALPHAFIRE; + } + + // Turn towards enemy and update model attachment + // The offset is based on the wraith facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(eggofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.frame = eggframe; +}; + +//====================================================================== +// RANGE ATTACK 3 - Cup hands around a spider egg infront and fire +// +// Spawn a yellow/green egg ball shape and then drop it towards the player +// The egg is spawned in the middle and moved up/down to generate particles +// 20 2 12, 18 2 12 +void() wraith_minion1 =[ $magicB1, wraith_magicB2 ] {ai_face();}; +void() wraith_magicB2 =[ $magicB2, wraith_magicB3 ] {Setup_WraithEgg('20 2 12',0);}; +void() wraith_magicB3 =[ $magicB3, wraith_magicB4 ] {Setup_WraithEgg('18 2 12',1);}; +void() wraith_magicB4 =[ $magicB4, wraith_magicB5 ] {Setup_WraithEgg('20 2 12',2);}; +void() wraith_magicB5 =[ $magicB5, wraith_magicB6 ] {Setup_WraithEgg('18 2 12',3);}; +void() wraith_magicB6 =[ $magicB6, wraith_magicB7 ] {Setup_WraithEgg('20 2 12',4);}; +void() wraith_magicB7 =[ $magicB7, wraith_magicB8 ] {Setup_WraithEgg('18 2 12',5);}; +void() wraith_magicB8 =[ $magicB8, wraith_magicB9 ] {Setup_WraithEgg('20 2 12',6);}; +void() wraith_magicB9 =[ $magicB9, wraith_magicB10 ] { + self.skin = self.exactskin; // Not glowing anymore + self.alpha = WRAITH_ALPHA; // Fade out + wraith_finish_attachment(); + Create_Egg('20 2 12'); + // Particles drifting up slowly from body + particle_explode(self.origin, 30, 2, self.part_style, PARTICLE_BURST_UPWARD); + +}; +void() wraith_magicB10 =[ $magicB10, wraith_magicB11 ] {}; +void() wraith_magicB11 =[ $magicB11, wraith_magicB12 ] {}; +void() wraith_magicB12 =[ $magicB12, wraith_magicB13 ] {ai_face();}; +void() wraith_magicB13 =[ $magicB13, wraith_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() wraith_magic = +{ + local entity truetarg, miniondef; + + // Make sure the attachments are setup ready + wraith_create_attachment(); + truetarg = SUB_entEnemyTarget(); + + if (self.spawnflags & MON_WRAITH_SPIDERS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_wraithminion"); + if (miniondef.classtype == CT_CACHESPIDER) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[WRAITH]\b Cannot find spider template!\n"); + self.spawnflags = self.spawnflags - MON_WRAITH_SPIDERS; + self.poisonous = FALSE; + } + } + if (self.spawnflags & MON_WRAITH_SCORPIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_wraithminion2"); + if (miniondef.classtype == CT_CACHESCORPION) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[WRAITH]\b Cannot find scorpion template!\n"); + self.spawnflags = self.spawnflags - MON_WRAITH_SCORPIONS; + } + } + + // Is the target the player or monster? + if (truetarg.flags & FL_CLIENT) { + if (self.spawnflags & (MON_WRAITH_SPIDERS | MON_WRAITH_SCORPIONS)) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // If the player is too close (melee distance) try old base attack + if (self.minion_baseattack > 0 && self.enemydist < MON_RANGE_MELEE) wraith_nails1(); + else { + // has the minion limit been reached? + if (query_minionactive(self) == TRUE) wraith_minion1(); + else wraith_nails1(); + } + } + // First ever attack is the fire debuff + else if (self.attack_speed < time) wraith_debuff1(); + // Does the player have the debuff already? + else if (truetarg.burning) wraith_nails1(); + else { + // Greater chance of debuff attack first + if (random() < 0.7) wraith_debuff1(); + else wraith_nails1(); + } + self.attack_speed = LARGE_TIMER; + } + // Always attack monsters with nails + else wraith_nails1(); +}; + +//============================================================================ +// Pain A - Short flinch backwards +void() wraith_painA1 = [ $painA1, wraith_painA2 ] {}; +void() wraith_painA2 = [ $painA2, wraith_painA3 ] {}; +void() wraith_painA3 = [ $painA3, wraith_painA4 ] {}; +void() wraith_painA4 = [ $painA4, wraith_painA5 ] {}; +void() wraith_painA5 = [ $painA5, wraith_painA6 ] {}; +void() wraith_painA6 = [ $painA6, wraith_run1 ] {}; + +//---------------------------------------------------------------------- +// Pain B - Long motion of being hit several times +void() wraith_painB1 = [ $painB1, wraith_painB2 ] {}; +void() wraith_painB2 = [ $painB2, wraith_painB3 ] {}; +void() wraith_painB3 = [ $painB3, wraith_painB4 ] {}; +void() wraith_painB4 = [ $painB4, wraith_painB5 ] {}; +void() wraith_painB5 = [ $painB5, wraith_painB6 ] {}; +void() wraith_painB6 = [ $painB6, wraith_painB7 ] {}; +void() wraith_painB7 = [ $painB7, wraith_painB8 ] {}; +void() wraith_painB8 = [ $painB8, wraith_painB9 ] {}; +void() wraith_painB9 = [ $painB9, wraith_painB10 ] {}; +void() wraith_painB10 = [ $painB10, wraith_painB11 ] {}; +void() wraith_painB11 = [ $painB11, wraith_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) wraith_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Make sure fire wraith skin/alpha is reset on pain/death + self.skin = self.exactskin; + self.alpha = WRAITH_ALPHA; + + // Hide any attachments + wraith_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) wraith_painA1 (); + else { + self.pain_finished = time + 2; + wraith_painB1 (); + } + } + // The new axe forces monsters into long pain animations + else if (self.pain_check == 2) { + self.axhitme = 0; + self.pain_finished = time + 2; + wraith_painB1 (); + } + } +}; + +//============================================================================ +void() wraith_death2 =[ $death2, wraith_death3] {}; +void() wraith_death3 =[ $death3, wraith_death4] {}; +void() wraith_death4 =[ $death4, wraith_death5] {}; +void() wraith_death5 =[ $death5, wraith_death7] {}; +void() wraith_death7 =[ $death7, wraith_death9] {}; +void() wraith_death9 =[ $death9, wraith_death11] {}; +void() wraith_death11 =[ $death11, wraith_death13] {}; +void() wraith_death13 =[ $death13, wraith_death15] {}; +void() wraith_death15 =[ $death15, wraith_death15] +{ + // Throw gibs, but create more XY outward velocity + self.max_health = MON_XYGIBVELOCITY; + monster_ThrowGib(); + // Move the explosion up to the middle/top of the body + // Use to be a regular explosion, switched to tarbaby instead + self.origin = self.origin + '0 0 24'; + T_RadiusDamage (self, self, DAMAGE_WRAITH, world, IGNORECLASS); + + // Big purple explosion + if (ext_dppart) + pointparticles(particleeffectnum(DPP_WRAITHEXPLODE), self.origin, '0 0 0', 1); + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); // Hard coded explosion + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + // Play original explosion sound or replacement + sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + // Stop thinking and hide entity (prevent wraith_death15 loop) + self.nextthink = LARGE_TIMER; + self.think = SUB_Null; + entity_hide(self); +}; + +//---------------------------------------------------------------------- +void() wraith_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + self.solid = SOLID_NOT; + sound (self, CHAN_VOICE, "wraith/death1.wav", 1, ATTN_NORM); + + // Make sure fire wraith skin/alpha is reset on pain/death + self.skin = self.exactskin; + self.alpha = WRAITH_ALPHA; + + // Make sure any attachments are removed + wraith_remove_attachment(); + + // Make sure body stays floating up where it finally dies + // and do not drop to the ground (reset by monster_death_use func) + self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_FLY; + wraith_death2(); +}; + +/*====================================================================== +/*QUAKED monster_wraith (1 0 0) (-16 -16 -24) (16 16 32) Ambush +======================================================================*/ +void() monster_wraith = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_wraith.mdl"; + self.weaponglow = "progs/mon_wraith_glow.mdl"; + self.gib1mdl = "progs/gib_wraith1.mdl"; // Forearm + self.gib2mdl = "progs/gib_wraith2.mdl"; // Hand/Claw + self.gib3mdl = "progs/gib_wraith3.mdl"; // stump? + + precache_model (self.mdl); + precache_model (self.weaponglow); // Glowing halo effect + precache_model (MODEL_PROJ_WTRAIL); // Hitscan blood bolt + precache_model (MODEL_PROJ_WBALL); // ball growing 8 frames + precache_model (MODEL_PROJ_WEGG); // ball turned into egg + precache_model (MODEL_PROJ_WSHELL); // Gibs from Egg + + precache_model (MODEL_PROJ_WBONE); // Bone nails (fire/scorpion) + precache_model (MODEL_PROJ_WPOISON); // Poison nails (spider) + + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.idle_sound = "wraith/idle1.wav"; + self.idle_sound2 = "wraith/idle2.wav"; + self.idle_soundcom = "wraith/idle3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + precache_sound ("wraith/death1.wav"); + self.pain_sound = "wraith/pain1.wav"; + precache_sound (self.pain_sound); + + precache_sound ("wraith/attack1.wav"); // HITSCAN bolt + precache_sound ("drole/r_explode.wav"); + precache_model (SBURST_FLAME); // Flames + + precache_sound ("wraith/attack2.wav"); // Nail/Bones + precache_sound ("wraith/attack3.wav"); // Minions + precache_sound ("wraith/bounce.wav"); // Egg bounce + + self.sight_sound = "wraith/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 350; + self.alpha = WRAITH_ALPHA; // Semi transparent + self.yaw_speed = 35; // Can turn really fast + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // not falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + if (self.height < 1) self.height = MONAI_ABOVEDIST; // Custom height + self.frame = 1; // First frame is never used! + self.deathstring = " was shattered by a Wraith\n"; + + // Hitscan = 52 4 6; Nails = 60 4 14; Egg = 20 2 12; + self.attack_offset = '30 2 8'; // Half way point + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = WraithCheckAttack; + self.th_stand = wraith_stand1; + self.th_walk = wraith_walk1; + self.th_run = wraith_run1; + self.th_missile = wraith_magic; + self.th_pain = wraith_pain; + self.th_die = wraith_die; + + // Cannot be both scorpion and spider minion spawner, def=spider + if (self.spawnflags & MON_WRAITH_SCORPIONS && self.spawnflags & MON_WRAITH_SPIDERS) + self.spawnflags = self.spawnflags - MON_WRAITH_SCORPIONS; + + // Setup each wraith type with different skins/particles + if (self.spawnflags & MON_WRAITH_SCORPIONS) { + // Check for override first, default should be 3 not 5 (spiders) + if (self.minion_maxcount < 1) self.minion_maxcount = 3; + self.exactskin = WRAITH_SKINPURPLE; // Purple/Blood skin + self.poisonous = FALSE; // Must be off for scorpion wraith + self.part_style = PARTICLE_BURST_PURPLE; // Purple cloud + } + else if (self.spawnflags & MON_WRAITH_SPIDERS) { + self.exactskin = WRAITH_SKINGREEN; // Poison/Green skin + self.poisonous = TRUE; // Fires Poison needles + self.part_style = PARTICLE_BURST_GREEN; // Poison cloud + } + else { + self.exactskin = WRAITH_SKINBLUE; // Blue/Red skin + self.poisonous = FALSE; // Must be off for fire wraith + self.part_style = PARTICLE_BURST_FIRE; + } + + self.classtype = CT_MONWRAITH; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEFLY; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/mon_xmas_elf.qc b/QC_other/QC_arcane/mon_xmas_elf.qc new file mode 100644 index 00000000..44dc0ff9 --- /dev/null +++ b/QC_other/QC_arcane/mon_xmas_elf.qc @@ -0,0 +1,432 @@ +/*============================================================================== +XMAS Elf - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000 - 007) Rocking back and forth on feet +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// (008 - 017) Skipping! (Running) +$frame skip1 skip2 skip3 skip4 skip5 skip6 skip7 skip8 +$frame skip9 skip10 + +// (018 - 029) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// (030 - 036) Suprise, jump up into the air with legs wide apart +$frame surprise1 surprise2 surprise3 surprise4 surprise5 surprise6 surprise7 + +// (037 - 048) ATTACK - Swing cane around (long version) +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 + +// (049 - 056) ATTACK - Jump up and smash cane into ground +$frame jump1 jump2 jump3 jump4 jump5 jump6 jump7 jump8 + +// (057 - 061) ATTACK - Swing cane around (short version) +$frame attack1 attack2 attack3 attack4 attack5 + +// (062 - 066) PAIN - Recoil backward +$frame pain1 pain2 pain3 pain4 pain5 + +// (067 - 078) ATTACK - Fall downward with cane infront +$frame ambush1 ambush2 ambush3 ambush4 ambush5 ambush6 ambush7 ambush8 +$frame ambush9 ambush10 ambush11 ambush12 + +// (079 - 093) DEATH - Backward +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 bdeath7 bdeath8 +$frame bdeath9 bdeath10 bdeath11 bdeath12 bdeath13 bdeath14 bdeath15 + +// (094 - 107) DEATH - Forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +// (108 - 109) Misc modelling stuff +$frame base1 base2 + +//====================================================================== +void() elf_stand1 = [ $stand1, elf_stand2 ] {monster_idle_sound();ai_stand();}; +void() elf_stand2 = [ $stand2, elf_stand3 ] {ai_stand();}; +void() elf_stand3 = [ $stand3, elf_stand4 ] {ai_stand();}; +void() elf_stand4 = [ $stand4, elf_stand5 ] {ai_stand();}; +void() elf_stand5 = [ $stand5, elf_stand6 ] {ai_stand();}; +void() elf_stand6 = [ $stand6, elf_stand7 ] {ai_stand();}; +void() elf_stand7 = [ $stand7, elf_stand8 ] {ai_stand();}; +void() elf_stand8 = [ $stand8, elf_stand1 ] {ai_stand();}; + +//====================================================================== +void() elf_walk1 = [ $walk1, elf_walk2 ] {monster_idle_sound();ai_walk(10);}; +void() elf_walk2 = [ $walk2, elf_walk3 ] {ai_walk(6);}; +void() elf_walk3 = [ $walk3, elf_walk4 ] {monster_footstep(FALSE);ai_walk(4);}; +void() elf_walk4 = [ $walk4, elf_walk5 ] {ai_walk(0);}; +void() elf_walk5 = [ $walk5, elf_walk6 ] {ai_walk(2);}; +void() elf_walk6 = [ $walk6, elf_walk7 ] {ai_walk(3);}; + +void() elf_walk7 = [ $walk7, elf_walk8 ] {ai_walk(10);}; +void() elf_walk8 = [ $walk8, elf_walk9 ] {ai_walk(6);}; +void() elf_walk9 = [ $walk9, elf_walk10 ] {monster_footstep(FALSE);ai_walk(4);}; +void() elf_walk10 = [ $walk10, elf_walk11 ] {ai_walk(0);}; +void() elf_walk11 = [ $walk11, elf_walk12 ] {ai_walk(2);}; +void() elf_walk12 = [ $walk12, elf_walk1 ] {ai_walk(3);}; + +//====================================================================== +void() elf_run1 = [ $skip1, elf_run2 ] {monster_idle_sound();ai_run(1);}; +void() elf_run2 = [ $skip2, elf_run3 ] {ai_run(6);}; +void() elf_run3 = [ $skip3, elf_run4 ] {ai_run(20);}; +void() elf_run4 = [ $skip4, elf_run5 ] {monster_footstep(FALSE);ai_run(12);}; +void() elf_run5 = [ $skip5, elf_run6 ] {ai_run(8);}; + +void() elf_run6 = [ $skip6, elf_run7 ] {ai_run(1);}; +void() elf_run7 = [ $skip7, elf_run8 ] {ai_run(6);}; +void() elf_run8 = [ $skip8, elf_run9 ] {ai_run(20);}; +void() elf_run9 = [ $skip9, elf_run10 ] {monster_footstep(FALSE);ai_run(12);}; +void() elf_run10 = [ $skip10, elf_run1 ] {ai_run(8);}; + +//====================================================================== +void() elf_slide1 = [ $surprise1, elf_slide2 ] {ai_run_slide(2);monster_idle_sound();}; +void() elf_slide2 = [ $surprise2, elf_slide3 ] {ai_run_slide(4);}; +void() elf_slide3 = [ $surprise3, elf_slide4 ] {ai_run_slide(6);}; +void() elf_slide4 = [ $surprise4, elf_slide5 ] {ai_run_slide(6);}; +void() elf_slide5 = [ $surprise5, elf_slide6 ] {ai_run_slide(4);}; +void() elf_slide6 = [ $surprise6, elf_slide7 ] {ai_run_slide(3);}; +void() elf_slide7 = [ $surprise7, elf_run1 ] {ai_run(2);}; + +//====================================================================== +// ELF 2 - SPRAY MAGIC (Range) +//====================================================================== +void(float sideang) elf_shot = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where projectile is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "xmas/elf/attack1.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire magic in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_ELF; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_ELF); +}; + +//---------------------------------------------------------------------- +void() elf_magic1 = [ $magic12, elf_magic2 ] { + sound(self, CHAN_WEAPON, "xmas/elf/magic.wav", 1, ATTN_NORM);}; +void() elf_magic2 = [ $magic11, elf_magic3 ] {ai_face();}; +void() elf_magic3 = [ $magic10, elf_magic4 ] {ai_face();}; +void() elf_magic4 = [ $magic9, elf_magic5 ] {ai_face();}; +void() elf_magic5 = [ $magic8, elf_magic6 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_ELF); }; +void() elf_magic6 = [ $magic7, elf_magic7 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ELF); }; +void() elf_magic7 = [ $magic6, elf_magic8 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ELF); }; +void() elf_magic8 = [ $magic5, elf_magic9 ] {elf_shot(-0.1);}; +void() elf_magic9 = [ $magic4, elf_magic10 ] {elf_shot(0);}; +void() elf_magic10 = [ $magic3, elf_magic11 ] {elf_shot(0.1);}; +void() elf_magic11 = [ $magic2, elf_magic12 ] {}; +void() elf_magic12 = [ $magic1, elf_run1 ] {}; + +//====================================================================== +// ELF 1 - SWING CANE - Both elf types can swing cane if within range +//====================================================================== +void() elf_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); + ai_damagebreakable(10); + if (!ai_checkmelee(MONAI_MELEEELF)) return; + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_VOICE, "xmas/elf/cane_hit1.wav", 1, ATTN_NORM); + else sound(self, CHAN_VOICE, "xmas/elf/cane_hit2.wav", 1, ATTN_NORM); + + // Cane Impact (damage 1-9) is very weak + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at cane of elf + spawn_touchblood (self, self.enemy, ldmg*3); +} + +//---------------------------------------------------------------------- +void() elf_cane1 = [ $attack1, elf_cane2 ] {ai_charge(5); + if (random() < 0.5) sound(self, CHAN_WEAPON, "xmas/elf/cane_swipe1.wav", 1, ATTN_NORM); + else sound(self, CHAN_WEAPON, "xmas/elf/cane_swipe2.wav", 1, ATTN_NORM); +}; +void() elf_cane2 = [ $attack2, elf_cane3 ] {ai_charge(5);}; +void() elf_cane3 = [ $attack3, elf_cane4 ] {elf_melee();}; +void() elf_cane4 = [ $attack4, elf_cane5 ] {}; +void() elf_cane5 = [ $attack5, elf_run1 ] { + if (ai_checkmelee(MONAI_MELEEELF) && self.enemy.health > 0) { + if (self.health > 0) self.think = elf_cane1; + } +}; + +//====================================================================== +// ELF 1 - JUMP FUNCTION (range) +//====================================================================== +void() Elf_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other elves with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self.enemy, self.enemy, ldmg*3); + } + } + + // Is the elf floating in the air? + if (!checkbottom(self)) { + // Is the elf standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() elf_leap1 =[ $jump1, elf_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + if (random() < 0.5) sound(self, CHAN_WEAPON, "xmas/elf/jump1.wav", 1, ATTN_NORM); + else sound(self, CHAN_WEAPON, "xmas/elf/jump2.wav", 1, ATTN_NORM); +}; +void() elf_leap2 =[ $jump2, elf_leap3 ] {ai_face();}; +void() elf_leap3 =[ $jump3, elf_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = Elf_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPELFDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; +void() elf_leap4 =[ $jump4, elf_leap5 ] {}; +void() elf_leap5 =[ $jump5, elf_leap6 ] {}; +void() elf_leap6 =[ $jump6, elf_leap7 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = elf_leap3; + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() elf_leap7 =[ $jump7, elf_leap8] {monster_footstep(FALSE);}; +void() elf_leap8 =[ $jump8, elf_run1] {ai_resetangles();}; + +//====================================================================== +// Elven Pain! +//====================================================================== +void() elf_pain1 = [ $pain1, elf_pain2 ] {}; +void() elf_pain2 = [ $pain2, elf_pain3 ] {}; +void() elf_pain3 = [ $pain3, elf_pain4 ] {}; +void() elf_pain4 = [ $pain4, elf_pain5 ] {}; +void() elf_pain5 = [ $pain5, elf_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) elf_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) elf_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + self.pain_finished = time + 1; + elf_pain1 (); + } + } +}; + +//====================================================================== +// Typical forward/backward death animation +//====================================================================== +void() elf_die1 =[ $death1, elf_die2] {}; +void() elf_die2 =[ $death2, elf_die3] {monster_check_gib();}; +void() elf_die3 =[ $death3, elf_die4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() elf_die4 =[ $death4, elf_die5] {}; +void() elf_die5 =[ $death5, elf_die6] {}; +void() elf_die6 =[ $death6, elf_die7] { + // Drop metal cane sound + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM); +}; +void() elf_die7 =[ $death7, elf_die8] {}; +void() elf_die8 =[ $death8, elf_die9] {monster_death_postcheck();}; +void() elf_die9 =[ $death9, elf_die9] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() elf_dieb1 =[ $bdeath1, elf_dieb2] {}; +void() elf_dieb2 =[ $bdeath2, elf_dieb3] {monster_check_gib();}; +void() elf_dieb3 =[ $bdeath3, elf_dieb4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() elf_dieb4 =[ $bdeath4, elf_dieb5] {}; +void() elf_dieb5 =[ $bdeath5, elf_dieb6] {}; +void() elf_dieb6 =[ $bdeath6, elf_dieb7] {}; +void() elf_dieb7 =[ $bdeath7, elf_dieb8] {}; +void() elf_dieb8 =[ $bdeath8, elf_dieb9] {ai_back(4);monster_death_postcheck();}; +void() elf_dieb9 =[ $bdeath9, elf_dieb9] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() elf_die = +{ + // Sync cane to elf skin + self.gib1skin = self.exactskin; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + // Pick a random death sound + if (random() > 0.5) + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, self.death_sound2, 1, ATTN_NORM); + + // Pick a random fall direction + if (random() > 0.5) elf_die1 (); + else elf_dieb1 (); + } +}; + +/*====================================================================== +QUAKED monster_xmas_elf (1 0 0) (-16 -16 -24) (16 16 16) Ambush +======================================================================*/ +void() monster_xmas_elf = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_elf.mdl"; // Crazy Grinning Fool + self.headmdl = "progs/xmas/h_elf.mdl"; // Shrunken Head + self.gib1mdl = "progs/xmas/gib_elfcane.mdl";// Candy Cane + self.gib1sound = GIB_IMPACT_METALA; + + precache_model (self.mdl); + precache_model (self.headmdl); // Grinning Pointy Hat + precache_model (self.gib1mdl); // Sugar Cane + precache_model (MODEL_PROJ_ELF); // Magic ice + + // Idle calm/angry + self.idle_sound = "xmas/elf/idle.wav"; // Lots of giggling + precache_sound (self.idle_sound); + + // Many different sight sounds (2 is very annoying) + self.sight_sound = "xmas/elf/sight1.wav"; // Snarling sound + self.sight_sound2 = "xmas/elf/sight2.wav"; // DIE HUMAN!?! + self.sight_sound3 = "xmas/elf/sight3.wav"; // Screams + self.sight_sound4 = "xmas/elf/sight4.wav"; // Screams + precache_sound (self.sight_sound); + precache_sound (self.sight_sound2); + precache_sound (self.sight_sound3); + precache_sound (self.sight_sound4); + self.sight_count = 4; + + // Elf 1 - Melee/Jump attacks - cane impacts + precache_sound ("xmas/elf/cane_swipe1.wav"); + precache_sound ("xmas/elf/cane_swipe2.wav"); + precache_sound ("xmas/elf/cane_hit1.wav"); + precache_sound ("xmas/elf/cane_hit2.wav"); + precache_sound ("xmas/elf/jump1.wav"); + precache_sound ("xmas/elf/jump2.wav"); + + // Elf 2 - Magic attacks + precache_sound ("xmas/elf/magic.wav"); + precache_sound ("xmas/elf/attack1.wav"); + precache_sound ("xmas/elf/miss.wav"); + + // precache sight, pain and death (changes on type) + self.pain_sound = "xmas/elf/pain.wav"; + self.death_sound = "xmas/elf/death1.wav"; + self.death_sound2 = "xmas/elf/death2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + precache_sound (self.death_sound2); + + if (self.spawnflags & MON_ELF_MAGIC) { + if (self.health < 1) self.health = 75; + self.gibhealth = -25; + self.th_missile = elf_magic1; + self.exactskin = 2; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = elf_leap1; + self.th_jumpexit = elf_leap7; + // pick a random one instead + if (self.exactskin < 0 || self.exactskin > 1) self.exactskin = 0; + if (self.exactskin == 0 && random() < 0.5) self.exactskin = 1; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; // Still in one peice + self.blockudeath = TRUE; // No humanoid death sound + self.pain_flinch = 10; // Light pain threshold + self.steptype = FS_TYPELIGHT; // Very light feet + self.meleeoffset = '20 0 20'; // Cane attack offset + self.attack_offset = '10 0 4'; // Magic attack offset + self.poisonous = FALSE; // Not Supported + self.deathstring = " was torn to pieces by a Elf\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = ElfCheckAttack; + self.th_stand = elf_stand1; + self.th_walk = elf_walk1; + self.th_run = elf_run1; + self.th_melee = elf_cane1; + self.th_slide = elf_slide1; + self.th_pain = elf_pain; + self.th_die = elf_die; + + self.classtype = CT_MONELF; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_xmas_raindeer.qc b/QC_other/QC_arcane/mon_xmas_raindeer.qc new file mode 100644 index 00000000..40ad4824 --- /dev/null +++ b/QC_other/QC_arcane/mon_xmas_raindeer.qc @@ -0,0 +1,317 @@ +/*============================================================================== +XMAS Raindeer - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000 - 003) Rocket attack +$frame rattack1 rattack2 rattack3 rattack4 + +// (004 - 010) Alternative idle animation, scrape feet on floor +$frame idlefeet1 idlefeet2 idlefeet3 idlefeet4 idlefeet5 idlefeet6 idlefeet7 + +// (011 - 014) Fast and Heavy breathing +$frame stand1 stand2 stand3 stand4 + +// (015 - 022) Running/Charge attack +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// (023 - 023) Static death pose - on altar (need skin 1) +$frame altar1 + +// (024 - 025) Misc modelling stuff +$frame base1 base2 + +//====================================================================== +void() raind_idlefeet1 = [ $idlefeet1, raind_idlefeet2 ] {monster_footstep(FALSE);ai_stand();}; +void() raind_idlefeet2 = [ $idlefeet2, raind_idlefeet3 ] {ai_stand();}; +void() raind_idlefeet3 = [ $idlefeet3, raind_idlefeet4 ] {monster_footstep(FALSE);ai_stand();}; +void() raind_idlefeet4 = [ $idlefeet4, raind_idlefeet5 ] {ai_stand();}; +void() raind_idlefeet5 = [ $idlefeet5, raind_idlefeet6 ] {ai_stand();}; +void() raind_idlefeet6 = [ $idlefeet6, raind_idlefeet7 ] {ai_stand();}; +void() raind_idlefeet7 = [ $idlefeet7, raind_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() raind_stand1 = [ $stand1, raind_stand2 ] { monster_idle_sound();ai_stand();}; +void() raind_stand2 = [ $stand1, raind_stand3 ] {ai_stand();}; +void() raind_stand3 = [ $stand2, raind_stand4 ] {ai_stand();}; +void() raind_stand4 = [ $stand2, raind_stand5 ] {ai_stand();}; +void() raind_stand5 = [ $stand3, raind_stand6 ] {ai_stand();}; +void() raind_stand6 = [ $stand3, raind_stand7 ] {ai_stand();}; +void() raind_stand7 = [ $stand4, raind_stand8 ] {ai_stand();}; +void() raind_stand8 = [ $stand4, raind_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) self.think = raind_idlefeet1; +}; + +//====================================================================== +void() raind_walk1 = [ $run5, raind_walk2 ] {monster_idle_sound();ai_walk(8);}; +void() raind_walk2 = [ $run6, raind_walk3 ] {ai_walk(5);}; +void() raind_walk3 = [ $run7, raind_walk4 ] {ai_walk(10);}; +void() raind_walk4 = [ $run8, raind_walk5 ] {monster_footstep(FALSE);ai_walk(5);}; +void() raind_walk5 = [ $run1, raind_walk6 ] {ai_walk(8);}; +void() raind_walk6 = [ $run2, raind_walk7 ] {ai_walk(13);}; +void() raind_walk7 = [ $run3, raind_walk8 ] {ai_walk(5);}; +void() raind_walk8 = [ $run4, raind_walk1 ] {monster_footstep(FALSE);ai_walk(8);}; + +//====================================================================== +void() raind_run1 = [ $run5, raind_run2 ] {monster_idle_sound();ai_run(15);}; +void() raind_run2 = [ $run6, raind_run3 ] {ai_run(10);}; +void() raind_run3 = [ $run7, raind_run4 ] {ai_run(20);}; +void() raind_run4 = [ $run8, raind_run5 ] {monster_footstep(FALSE);ai_run(10);}; +void() raind_run5 = [ $run1, raind_run6 ] {ai_run(15);}; +void() raind_run6 = [ $run2, raind_run7 ] {ai_run(25);}; +void() raind_run7 = [ $run3, raind_run8 ] {ai_run(10);}; +void() raind_run8 = [ $run4, raind_run1 ] {monster_footstep(FALSE);ai_run(15);}; + +//====================================================================== +// MELEE : Antler attack +//====================================================================== +void() raind_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); + ai_damagebreakable(20); + if (!ai_checkmelee(MONAI_MELEERAINDEER)) return; + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + sound(self, CHAN_WEAPON, "xmas/raindeer/hit.wav", TRUE, TRUE); + + // Antler attack is weak (1-9) + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at antlers + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() raind_ram1 = [ $rattack1, raind_ram2 ] {ai_charge(10);}; +void() raind_ram2 = [ $rattack2, raind_ram3 ] {raind_melee();}; +void() raind_ram3 = [ $rattack3, raind_ram4 ] {ai_charge(5);}; +void() raind_ram4 = [ $rattack4, raind_run1 ] { + // Check if raindeer is within range to attack again + if (ai_checkmelee(MONAI_MELEERAINDEER) && self.enemy.health > 0) { + if (self.health > 0) self.think = raind_ram1; + } +}; + +//====================================================================== +// RANGE : Rockets from backpack +//====================================================================== +void(vector sideofs) raind_attack = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_RAINDROCK + (skill * SPEED_RAINDROCKSKILL); + + // Cycle between attack sounds + if (self.lefty == 0) + sound (self, CHAN_WEAPON, "xmas/raindeer/attack1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "xmas/raindeer/attack2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; + + // turn and face your enemy! + ai_face(); + makevectors (self.angles); + + org = self.origin + attack_vector(sideofs); + // Fire rocket direction to match raindeer side + vec = v_right*(sideofs_x+(random()*10)); + dir = normalize((self.enemy.origin + vec) - org); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_RAINDEER, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() raind_shoot1 = [ $rattack1, raind_shoot2 ] {ai_face();}; +void() raind_shoot2 = [ $rattack2, raind_shoot3 ] {}; +void() raind_shoot3 = [ $rattack3, raind_shoot4 ] {ai_face();}; +void() raind_shoot4 = [ $rattack4, raind_shoot5 ] { + // Skills - EASY/NORMAL = 1 rocket, HARD/NM = 2 rockets + if (skill < SKILL_HARD) { + self.think = raind_run1; + // Randomize upper side (LEFT=-12 RIGHT=12) + if (random() < 0.5) raind_attack('-2 -12 12'); + else raind_attack('-2 12 12'); + } + else raind_attack('-2 -12 12'); +}; +void() raind_shoot5 = [ $rattack1, raind_shoot6 ] {ai_face();}; +void() raind_shoot6 = [ $rattack2, raind_shoot7 ] {}; +void() raind_shoot7 = [ $rattack3, raind_shoot8 ] {ai_face();}; +void() raind_shoot8 = [ $rattack4, raind_run1 ] { + raind_attack('-2 12 12'); +}; + +//====================================================================== +// PAIN : quick reflection +//====================================================================== +void() raind_pain1 = [ $rattack1, raind_pain2 ] {}; +void() raind_pain2 = [ $rattack2, raind_pain3 ] {ai_pain(4);}; +void() raind_pain3 = [ $rattack3, raind_pain4 ] {}; +void() raind_pain4 = [ $rattack4, raind_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) raind_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) raind_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + raind_pain1 (); + } + } +}; + +//====================================================================== +// DEATH : Its raining raindeer tonight! +//====================================================================== +void() raind_explode = +{ + // no more raindeer! + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // ID style explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (self.death_dmg > 0) + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Sprite + Dust + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + + // Regular blood like gibs + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + ThrowGib(25, 1); + ThrowGib(11, 2 + rint(random()*2)); + // Metal backpack + self.gibtype = GIBTYPE_METAL; + ThrowGib(12, rint(random()*2)); +}; + +//---------------------------------------------------------------------- +void() raind_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // There is no death animation + sound (self, CHAN_BODY, self.death_sound, 1, ATTN_NORM); + raind_explode(); +}; + +//---------------------------------------------------------------------- +void() raind_deadbody = +{ + // Setup bounding box based on presets + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + monster_bbox(); + + // Sacrifice pose + skin + self.frame = $altar1; + self.exactskin = self.skin = 1; + self.gib2mdl = self.gib1mdl; + if (random() < 0.5) self.gib3mdl = self.gib1mdl; + if (random() < 0.5) self.gib4mdl = self.gib1mdl; + misc_deadbody_setup(); +}; + +//============================================================================= +//QUAKED monster_xmas_raindeer (0.5 0.75 0) (-16 -16 -24) (16 16 40) Ambush +//============================================================================= +void() monster_xmas_raindeer = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_raindeer.mdl"; // Brown meat + self.headmdl = "progs/xmas/h_raindeer.mdl"; // Bloody meat + self.gib1mdl = "progs/xmas/gib_rdleg1.mdl"; // Bloody stump + self.gib2mdl = "progs/xmas/gib_rdrockpack.mdl"; // Rocket backpack + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_RAIND); // Snowy Rockets + precache_model (self.gib1mdl); // Legs + precache_model (self.gib2mdl); // Rocket Packs + + self.idle_sound = "xmas/raindeer/idle.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "xmas/raindeer/sight.wav"; + precache_sound (self.sight_sound); + + // Alternating rocket firing sound + precache_sound ("xmas/raindeer/attack1.wav"); + precache_sound ("xmas/raindeer/attack2.wav"); + + self.pain_sound = "xmas/raindeer/hit.wav"; + precache_sound (self.pain_sound); + self.death_sound = "xmas/raindeer/death.wav"; + precache_sound (self.death_sound); + + // Dead body version is setup different + if (self.spawnflags & MON_RAINDEER_DEAD) { + raind_deadbody(); return; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 200; + if (self.death_dmg < 1) self.death_dmg = DAMAGE_RAINDEER; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.blockudeath = TRUE; // no humanoid death sound + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 30; // Light pain threshold + self.pain_longanim = FALSE; // No long pain animation + self.steptype = FS_TYPESLOW; // Small sounding feet + self.poisonous = FALSE; // Not Supported + self.meleeoffset = '24 0 20'; // Antler attack offset + self.lefty = 0; // Cycle attack sounds + self.deathstring = " was trampled by a Raindeer\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = RaindeerCheckAttack; + self.th_stand = raind_stand1; + self.th_walk = raind_walk1; + self.th_run = raind_run1; + self.th_melee = raind_ram1; + self.th_missile = raind_shoot1; + self.th_pain = raind_pain; + self.th_die = raind_die; + + self.classtype = CT_MONRAINDEER; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + diff --git a/QC_other/QC_arcane/mon_xmas_santa.qc b/QC_other/QC_arcane/mon_xmas_santa.qc new file mode 100644 index 00000000..6ac36c7a --- /dev/null +++ b/QC_other/QC_arcane/mon_xmas_santa.qc @@ -0,0 +1,461 @@ +/*============================================================================== +XMAS Santa - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000 - 005) Standing +$frame stand1 stand2 stand3 stand4 stand5 stand6 + +// (006 - 011) Running +$frame run1 run2 run3 run4 run5 run6 + +// (012 - 017) Lounging Evil Santa +$frame lounge1 lounge2 lounge3 lounge4 lounge5 lounge6 + +// (018 - 027) Victory at player's death! +$frame victory1 victory2 victory3 victory4 victory5 victory6 +$frame victory7 victory8 victory9 victory10 + +// (028 - 031) Gun Range attack +$frame attack1 attack2 attack3 attack4 + +// (032 - 041) Sack Melee attack +$frame sack1 sack2 sack3 sack4 sack5 sack6 sack7 sack8 sack9 sack10 + +// (042 - 046) Pain A +$frame painA1 painA2 painA3 painA4 painA5 + +// (047 - 051) Pain B +$frame painB1 painB2 painB3 painB4 painB5 + +// (052 - 061) Death FORWARD (180 spin) +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 + +// (062 - 070) Death BACKWARD (180 spin) +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +// (071 - 077) Sitting Good Santa 1 +$frame sitA1 sitA2 sitA3 sitA4 sitA5 sitA6 sitA7 + +// (078 - 083) Sitting Good Santa 2 +$frame sitB1 sitB2 sitB3 sitB4 sitB5 sitB6 + +// (084 - 086) Misc modelling stuff +$frame base1 base2 base3 + +//====================================================================== +// Sitting down animation (located below model baseline) +// There is no blend animation for this to go from sitting to standing +// Original MOD had this animation as a standing alternative +// Really looked odd when the monster jumped straight to running +/* +void() santa_lounge1 = [ $lounge1, santa_lounge2 ] {monster_idle_sound();ai_stand();}; +void() santa_lounge2 = [ $lounge2, santa_lounge3 ] {ai_stand();}; +void() santa_lounge3 = [ $lounge3, santa_lounge4 ] {ai_stand();}; +void() santa_lounge4 = [ $lounge4, santa_lounge5 ] {ai_stand();}; +void() santa_lounge5 = [ $lounge5, santa_lounge6 ] {ai_stand();}; +void() santa_lounge6 = [ $lounge6, santa_lounge1 ] {ai_stand();}; */ + +//====================================================================== +// A scaled down good santa sitting shaking his head +//====================================================================== +void() santa_seatA1 = [ $sitA1, santa_seatA2 ] {}; +void() santa_seatA2 = [ $sitA2, santa_seatA3 ] {}; +void() santa_seatA3 = [ $sitA3, santa_seatA4 ] {}; +void() santa_seatA4 = [ $sitA4, santa_seatA5 ] {}; +void() santa_seatA5 = [ $sitA5, santa_seatA6 ] {}; +void() santa_seatA6 = [ $sitA6, santa_seatA7 ] {}; +void() santa_seatA7 = [ $sitA7, santa_seatA1 ] {self.th_stand();}; + +//---------------------------------------------------------------------- +void() santa_seatB1 = [ $sitB1, santa_seatB2 ] {}; +void() santa_seatB2 = [ $sitB2, santa_seatB3 ] {}; +void() santa_seatB3 = [ $sitB3, santa_seatB4 ] {}; +void() santa_seatB4 = [ $sitB4, santa_seatB5 ] {}; +void() santa_seatB5 = [ $sitB5, santa_seatB6 ] {}; +void() santa_seatB6 = [ $sitB6, santa_seatB1 ] {self.th_stand();}; + +//---------------------------------------------------------------------- +void() santa_trigger = +{ + // Trigger Once + if (self.waitmin > time) return; + self.waitmin = LARGE_TIMER; + self.use = SUB_Null; + + // "My dear boy, you saved me!" + sound(self, CHAN_WEAPON, self.noise2, 1, ATTN_NORM); + + // Fire all triggers/sounds/messages + SUB_UseTargets(); + + // Fade out santa (+delete model) + self.think = model_fade; + self.nextthink = time + 2 + random(); + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() santa_seated = +{ + // Keep resetting health/touch function + self.health = self.max_health; + self.use = santa_trigger; + if (random() < 0.5) santa_seatA1(); + else santa_seatB1(); +}; + +//====================================================================== +void() santa_stand1 = [ $stand1, santa_stand2 ] {monster_idle_sound();ai_stand();}; +void() santa_stand2 = [ $stand2, santa_stand3 ] {ai_stand();}; +void() santa_stand3 = [ $stand3, santa_stand4 ] {ai_stand();}; +void() santa_stand4 = [ $stand4, santa_stand5 ] {ai_stand();}; +void() santa_stand5 = [ $stand5, santa_stand6 ] {ai_stand();}; +void() santa_stand6 = [ $stand6, santa_stand1 ] {ai_stand();}; + +//====================================================================== +void() santa_walk1 = [ $run1, santa_walk2 ] {monster_idle_sound();ai_walk(15);} +void() santa_walk2 = [ $run2, santa_walk3 ] {ai_walk(17);}; +void() santa_walk3 = [ $run3, santa_walk4 ] {monster_footstep(FALSE);ai_walk(15);}; +void() santa_walk4 = [ $run4, santa_walk5 ] {ai_walk(15);}; +void() santa_walk5 = [ $run5, santa_walk6 ] {ai_walk(17);}; +void() santa_walk6 = [ $run6, santa_walk1 ] {monster_footstep(FALSE);ai_walk(15);}; + +//====================================================================== +void() santa_run1 = [ $run1, santa_run2 ] {monster_idle_sound();ai_run(20);} +void() santa_run2 = [ $run2, santa_run3 ] {ai_run(24);}; +void() santa_run3 = [ $run3, santa_run4 ] {monster_footstep(FALSE);ai_run(20);}; +void() santa_run4 = [ $run4, santa_run5 ] {ai_run(20);}; +void() santa_run5 = [ $run5, santa_run6 ] {ai_run(24);}; +void() santa_run6 = [ $run6, santa_run1 ] {monster_footstep(FALSE);ai_run(20);}; + +//====================================================================== +// MELEE : Sack of Presents +//====================================================================== +void() SantaMelee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // + ai_face() + ai_damagebreakable(50); + if (!ai_checkmelee(MONAI_MELEESANTA)) return; + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + sound(self, CHAN_WEAPON, "xmas/santa/sack_hit.wav", 1, ATTN_NORM); + + // Sack attack is strong (1-60) + ldmg = (random() + random() + random()) * 20; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at sack + spawn_touchblood (self, self.enemy, ldmg*3); + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); +}; + +//---------------------------------------------------------------------- +void() santa_sack1 = [ $sack1, santa_sack2 ] {ai_face();}; +void() santa_sack2 = [ $sack2, santa_sack3 ] {}; +void() santa_sack3 = [ $sack3, santa_sack4 ] {ai_face();}; +void() santa_sack4 = [ $sack4, santa_sack5 ] {ai_face(); + // This sound is exactly 0.4s long, with hit to complete + sound(self, CHAN_WEAPON, "xmas/santa/sack_swing.wav", 1, ATTN_NORM); +}; +void() santa_sack5 = [ $sack5, santa_sack6 ] {ai_charge(10);}; +void() santa_sack6 = [ $sack6, santa_sack7 ] {ai_charge(10);}; +void() santa_sack7 = [ $sack7, santa_sack8 ] {ai_charge(10);}; +void() santa_sack8 = [ $sack8, santa_sack9 ] {SantaMelee();}; +void() santa_sack9 = [ $sack9, santa_sack10 ] {}; +void() santa_sack10 = [ $sack10, santa_run1 ] { + // Check if snowman is within range to attack again + if (ai_checkmelee(MONAI_MELEESANTA) && self.enemy.health > 0) { + if (self.health > 0) self.think = santa_sack3; + } +}; + +//====================================================================== +// RANGE : Rocket Gun +//====================================================================== +void() Santa_FireSnow = +{ + local vector org, dir, spot1, spot2; + + // Keep adding up projectile counter + self.attack_chance = self.attack_chance + 1; + + // Lit up that barrel + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_SANTAPROJ + (skill * SPEED_SANTASKILL); + sound (self, CHAN_WEAPON, "xmas/santa/fire.wav", 1, ATTN_NORM); + + // Keep tracking enemy origin (similar to wizards) + ai_trackenemy(); + + // Calculate the center of the gun + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + // Work out projectil direction + dir = normalize(self.attack_track - org); + + // Barrel 1 + spot1 = org + v_right*6; + spot2 = normalize((self.attack_track+v_right*6) - spot1); + launch_projectile (spot1, spot2, CT_PROJ_SANTA, self.attack_speed); + + // Barrel 2 + spot1 = org - v_right*6; + spot2 = normalize((self.attack_track-v_right*6) - spot1); + launch_projectile (spot1, spot2, CT_PROJ_SANTA, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() santa_snow1 = [ $attack1, santa_snow2 ] {ai_trackenemy(); + // First 0.2s is repeatable to get machine gun sound + sound(self, CHAN_WEAPON, "xmas/santa/fire.wav", 1, ATTN_NORM); +}; +void() santa_snow2 = [ $attack2, santa_snow3 ] {ai_trackenemy();}; +void() santa_snow3 = [ $attack3, santa_snow4 ] {Santa_FireSnow();}; +void() santa_snow4 = [ $attack4, santa_run1 ] {ai_trackenemy(); + // Anymore projectiles to fire? + if (self.attack_chance < MONAI_SANTAMAX) { + // Is the player still visible? + if ( visxray(self.enemy, self.attack_offset, '0 0 0', FALSE) ) { + self.attack_timer = time + 0.8; + } + // Is the enemy in view timer still active? + if (self.attack_timer > time) self.think = santa_snow1; + } +}; + +void() santa_snowstart = +{ + self.attack_track = self.enemy.origin; + self.attack_chance = self.attack_timer = 0; + santa_snow1(); +}; + +//====================================================================== +// PAIN : quick reflection +//====================================================================== +void() santa_painA1 = [ $painA1, santa_painA2 ] {}; +void() santa_painA2 = [ $painA2, santa_painA3 ] {}; +void() santa_painA3 = [ $painA3, santa_painA4 ] {}; +void() santa_painA4 = [ $painA4, santa_painA5 ] {}; +void() santa_painA5 = [ $painA5, santa_run1 ] {}; + +//---------------------------------------------------------------------- +void() santa_painB1 = [ $painB1, santa_painB2 ] {}; +void() santa_painB2 = [ $painB2, santa_painB3 ] {}; +void() santa_painB3 = [ $painB3, santa_painB4 ] {}; +void() santa_painB4 = [ $painB4, santa_painB5 ] {}; +void() santa_painB5 = [ $painB5, santa_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) santa_pain = +{ + // Good santa cannot feel pain or die + if (self.spawnflags & MON_SANTA_GOOD) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.8) santa_painA1 (); + else { + santa_painB1 (); + self.pain_finished = time + 2; + } + } + } +}; + +//====================================================================== +// Typical forward/backward death animation +//====================================================================== +void() santa_die1 =[ $death1, santa_die2] {}; +void() santa_die2 =[ $death2, santa_die3] {monster_check_gib();}; +void() santa_die3 =[ $death3, santa_die4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() santa_die4 =[ $death4, santa_die5] {}; +void() santa_die5 =[ $death5, santa_die6] {}; +void() santa_die6 =[ $death6, santa_die7] {}; +void() santa_die7 =[ $death7, santa_die8] {}; +void() santa_die8 =[ $death8, santa_die9] {}; +void() santa_die9 =[ $death9, santa_die10] {monster_death_postcheck();}; +void() santa_die10 =[ $death10, santa_die10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() santa_dieb1 =[ $bdeath1, santa_dieb2] {}; +void() santa_dieb2 =[ $bdeath2, santa_dieb3] {monster_check_gib();}; +void() santa_dieb3 =[ $bdeath3, santa_dieb4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() santa_dieb4 =[ $bdeath4, santa_dieb5] {}; +void() santa_dieb5 =[ $bdeath5, santa_dieb6] {}; +void() santa_dieb6 =[ $bdeath6, santa_dieb7] {}; +void() santa_dieb7 =[ $bdeath7, santa_dieb8] {}; +void() santa_dieb8 =[ $bdeath8, santa_dieb9] {ai_back(4);monster_death_postcheck();}; +void() santa_dieb9 =[ $bdeath9, santa_dieb9] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() santa_die = +{ + // Good santa cannot feel pain or die + if (self.spawnflags & MON_SANTA_GOOD) return; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + + // Pick a random fall direction + if (random() > 0.5) santa_die1 (); + else santa_dieb1 (); + } +}; + +/*====================================================================== +QUAKED monster_santa (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_xmas_santa = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_santa.mdl"; // Big Sack Man! + self.headmdl = "progs/xmas/h_santa.mdl"; // Pointy Face + self.gib1mdl = "progs/xmas/gib_santagun.mdl"; + self.gib2mdl = "progs/xmas/gib_santasack.mdl"; + self.gib3mdl = "progs/xmas/gib_snowball.mdl"; // Snowballs + self.gib1sound = GIB_IMPACT_WOOD; + self.gib2sound = GIB_IMPACT_WOOD; + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (MODEL_PROJ_SNOWBALL); + + // Idle/Sight sounds for GOOD/EVIL santa + if (self.spawnflags & MON_SANTA_GOOD) { + self.idle_sound = "xmas/santa/good_hohoho.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "xmas/santa/good_hohoho.wav"; + precache_sound (self.sight_sound); + // Touch trigger - "My dear boy, you saved me!" + self.noise2 = "xmas/santa/good_saved.wav"; + precache_sound (self.noise2); + } + else { + // Evil santa has combat idle sounds + self.idle_sound = "xmas/santa/hohoho.wav"; // Slow ho-ho-ho + self.idle_sound2 = "xmas/santa/laugh1.wav"; // long laugh + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + self.idle_soundcom = "xmas/santa/laugh3_com.wav"; + self.idle_soundcom2 = "xmas/santa/hohoho.wav"; + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + // Sight sounds - "Come sit on santa's lap little human!" + self.sight_sound = "xmas/santa/sight.wav"; + precache_sound (self.sight_sound); + } + + // Attack melee/range + precache_sound ("xmas/santa/sack_swing.wav"); + precache_sound ("xmas/santa/sack_hit.wav"); + precache_sound ("xmas/santa/fire.wav"); + + // precache sight, pain and death (changes on type) + self.pain_sound = "xmas/santa/pain1.wav"; + self.pain_sound2 = "xmas/santa/pain2.wav"; + // Fading out slow ho-ho-ho death sound + self.death_sound = "xmas/santa/death2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound (self.death_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + if (self.health < 1) self.health = 1200; + self.gibhealth = -60; // Difficult to gib + self.blockudeath = TRUE; // no humanoid death sound + self.gibbed = FALSE; // Still in one peice + self.pain_flinch = 200; // Strong pain threshold + self.pain_timeout = 2; // Stop constant pain + self.infightextra = 8; // Does not like infighting + self.pain_longanim = FALSE; // No long pain animation + self.no_liquiddmg = TRUE; // no slime/lava damage + self.steptype = FS_TYPEHEAVY; // Giant boots! + self.poisonous = FALSE; // Not Supported + self.attack_offset = '28 22 26';// End of gun + self.attack_rage = TRUE; // Not in combat yet + self.deathstring = " was wrapped up by Santa\n"; + + // Setup Ammo Resistance + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0.5; + self.reflectlightning = TRUE; // Reflect lightning strikes + self.reflectplasma = TRUE; // Reflect plasma projectiles + + // Pain/Death functions + self.th_pain = santa_pain; + self.th_die = santa_die; + + // Check for GOOD Santa setup? + if (self.spawnflags & MON_SANTA_GOOD) { + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[GOOD SANTA]\b Missing targetname name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + // Setup default rescue message + self.noise = SOUND_EMPTY; + if (self.message == "") + self.message = "You have rescued Santa!\nfrom the claws of hell!\n"; + // Nobody should be trying to kill good santa, WTF!?! + self.resist_shells = self.resist_nails = 1.0; + self.resist_rockets = self.resist_cells = 1.0; + self.nomonstercount = TRUE; + self.health = self.max_health = MEGADEATH; + self.gibhealth = MON_NEVERGIB; + self.exactskin = 1; + // Direct every state to the sit function + self.th_stand = santa_seated; + self.th_walk = santa_seated; + self.th_run = santa_seated; + self.waitmin = 0; + } + else { + // Default EVIL Santa! + self.th_checkattack = SantaCheckAttack; + self.th_stand = santa_stand1; + self.th_walk = santa_walk1; + self.th_run = santa_run1; + self.th_melee = santa_sack1; + self.th_missile = santa_snowstart; + } + + self.classtype = CT_MONSANTA; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_xmas_snowman.qc b/QC_other/QC_arcane/mon_xmas_snowman.qc new file mode 100644 index 00000000..b2b86dcc --- /dev/null +++ b/QC_other/QC_arcane/mon_xmas_snowman.qc @@ -0,0 +1,297 @@ +/*============================================================================== +XMAS Snowman - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000) Standing Still +$frame stand1 + +// (001 - 005) Fast Claw attack +$frame claw1 claw2 claw3 claw4 claw5 + +// (006 - 008) Fast Nail Attack +$frame attack1 attack2 attack3 + +// (009 - 010) Misc modelling stuff +$frame base1 base2 + +//====================================================================== +void() snowm_stand1 = [ $stand1, snowm_stand2 ] {monster_idle_sound();ai_stand();} +void() snowm_stand2 = [ $stand1, snowm_stand3 ] {ai_stand();}; +void() snowm_stand3 = [ $stand1, snowm_stand4 ] {ai_stand();}; +void() snowm_stand4 = [ $stand1, snowm_stand5 ] {ai_stand();}; +void() snowm_stand5 = [ $stand1, snowm_stand6 ] {ai_stand();}; +void() snowm_stand6 = [ $stand1, snowm_stand7 ] {ai_stand();}; +void() snowm_stand7 = [ $stand1, snowm_stand8 ] {ai_stand();}; +void() snowm_stand8 = [ $stand1, snowm_stand1 ] {ai_stand();}; + +//====================================================================== +void() snowm_walk1 = [ $stand1, snowm_walk2 ] {monster_idle_sound();ai_walk(0);} +void() snowm_walk2 = [ $stand1, snowm_walk3 ] {ai_walk(0);}; +void() snowm_walk3 = [ $stand1, snowm_walk4 ] {ai_walk(0);}; +void() snowm_walk4 = [ $stand1, snowm_walk5 ] {ai_walk(0);}; +void() snowm_walk5 = [ $stand1, snowm_walk6 ] {ai_walk(0);}; +void() snowm_walk6 = [ $stand1, snowm_walk7 ] {ai_walk(0);}; +void() snowm_walk7 = [ $stand1, snowm_walk8 ] {ai_walk(0);}; +void() snowm_walk8 = [ $stand1, snowm_walk1 ] {ai_walk(0);}; + +//====================================================================== +void() snowm_run1 = [ $stand1, snowm_run2 ] {monster_idle_sound();ai_run(0);} +void() snowm_run2 = [ $stand1, snowm_run3 ] {ai_run(0);}; +void() snowm_run3 = [ $stand1, snowm_run4 ] {ai_run(0);}; +void() snowm_run4 = [ $stand1, snowm_run5 ] {ai_run(0);}; +void() snowm_run5 = [ $stand1, snowm_run6 ] {ai_run(0);}; +void() snowm_run6 = [ $stand1, snowm_run7 ] {ai_run(0);}; +void() snowm_run7 = [ $stand1, snowm_run8 ] {ai_run(0);}; +void() snowm_run8 = [ $stand1, snowm_run1 ] {ai_run(0);}; + +//====================================================================== +// MELEE : Crows Claw +//====================================================================== +void() SnowmMelee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESNOWMAN)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + sound(self, CHAN_WEAPON, "xmas/snowman/claw.wav", TRUE, TRUE); + + // Claw attack is good (1-15) + ldmg = (random() + random() + random()) * 5; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at claw + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() snowm_claw1 = [ $claw1, snowm_claw2 ] {ai_face();}; +void() snowm_claw2 = [ $claw2, snowm_claw3 ] {ai_face();}; +void() snowm_claw3 = [ $claw3, snowm_claw4 ] {ai_face();SnowmMelee();}; +void() snowm_claw4 = [ $claw4, snowm_claw5 ] {}; +void() snowm_claw5 = [ $claw5, snowm_run1 ] { + // Check if snowman is within range to attack again + if (ai_checkmelee(MONAI_MELEESNOWMAN) && self.enemy.health > 0) { + if (self.health > 0) self.think = snowm_claw1; + } +}; + +//====================================================================== +// RANGE : Burst of Nails +//====================================================================== +void() SnowmFireNails = +{ + local vector org, dir, vec; + local float loopvar; + + // Check for death? + if (self.health < 1) return; + loopvar = 0; + + // Light up face, setup projectile speed and play fire sound + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_NAILSNOWMPROJ + (skill * SPEED_NAILSNOWMSKILL); + sound(self, CHAN_WEAPON, "xmas/snowman/nail_fire.wav", 1, ATTN_NORM); + + // turn and face your enemy! + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Loop through the nail burst (all at once) + while (loopvar < self.attack_count) { + // Random circle spread pattern + vec = (crandom()*20)*v_right + (crandom()*20)*v_up; + dir = normalize((self.enemy.origin + vec) - org); + // Generate a red hot nail projectile + launch_projectile(org, dir, CT_PROJ_MONNG, self.attack_speed); + loopvar = loopvar + 1; + } +}; + +//---------------------------------------------------------------------- +void() snowm_nail1 = [ $attack1, snowm_nail2 ] {ai_face();}; +void() snowm_nail2 = [ $attack2, snowm_nail3 ] {ai_face();}; +void() snowm_nail3 = [ $attack3, snowm_nail4 ] {ai_face();SnowmFireNails();}; +void() snowm_nail4 = [ $attack2, snowm_nail5 ] {}; +void() snowm_nail5 = [ $attack1, snowm_run1 ] {ai_face();}; + +//====================================================================== +// PAIN : quick reflection +//====================================================================== +void() snowm_pain1 = [ $claw4, snowm_pain2 ] {}; +void() snowm_pain2 = [ $claw3, snowm_pain3 ] {}; +void() snowm_pain3 = [ $claw2, snowm_pain4 ] {}; +void() snowm_pain4 = [ $claw1, snowm_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) snowm_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1) snowm_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + snowm_pain1 (); + } + } +}; + +//====================================================================== +// Exploding snowball! +//====================================================================== +void() snowm_explode = +{ + // no more raindeer! + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // ID style explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (self.death_dmg > 0) + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Sprite + Dust + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + + // No blood or guts! + ThrowGib(25, 1); + ThrowGib(11, 1); + ThrowGib(12, 1); + ThrowGib(13, 8 + rint(random()*8)); + + /*------------------------------------------------------------------- + // The snowball model has a melting animation (6 frames) + // Unfortunately it does look really old and dated, + // its better to let model just fade away. + // + // The final gib is a snowball which has a melting animation + // Setup animation start/finish parameters before throwing + self.gibAnimstart = 1; + self.gibAnimfinal = 5; + self.gibAnimTimer = 2; // timer + (random() * (timer*2)) + ThrowGib(13, 8 + rint(random()*8)); */ +}; + +//---------------------------------------------------------------------- +void() snowm_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // There is no death animation + if (random() < 0.5) + sound (self, CHAN_BODY, self.death_sound, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.death_sound2, 1, ATTN_NORM); + snowm_explode(); +}; + +/*====================================================================== +QUAKED monster_snowman (1 0 0) (-16 -16 -24) (16 16 32) Ambush +======================================================================*/ +void() monster_xmas_snowman = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_snowman.mdl"; // Top Hat Snow + self.headmdl = "progs/xmas/h_snowman.mdl"; // Top Hat + self.gib1mdl = "progs/xmas/gib_snowclaw.mdl"; // Claw + self.gib2mdl = "progs/xmas/gib_snowgun.mdl"; // Nail Gun + self.gib3mdl = "progs/xmas/gib_snowball.mdl"; // Snowballs + self.gib1sound = GIB_IMPACT_WOOD; + self.gib2sound = GIB_IMPACT_METALA; + + precache_model (self.mdl); + precache_model (self.headmdl); // Top Hat + precache_model (self.gib1mdl); // Claw + precache_model (self.gib2mdl); // Gun + precache_model (self.gib3mdl); // Snow-BALLS! + precache_model (MODEL_PROJ_NGRED); // Red Nails (easier to see) + + // Idle calm/angry + self.idle_sound = "xmas/snowman/idle.wav"; // Rustling sound + precache_sound (self.idle_sound); + + // Many different sight sounds + self.sight_sound = "xmas/snowman/sight1.wav"; // Deep voice + self.sight_sound2 = "xmas/snowman/sight2.wav"; // Growling + precache_sound (self.sight_sound); + precache_sound (self.sight_sound2); + self.sight_count = 2; + + // Melee/Range Attacks + // Original version used ice, switched to red nails + // Ice nails are really difficult to see + precache_sound ("xmas/snowman/claw.wav"); + precache_sound ("xmas/snowman/nail_fire.wav"); + + // precache sight, pain and death (changes on type) + self.pain_sound = "xmas/snowman/pain1.wav"; + self.pain_sound2 = "xmas/snowman/pain2.wav"; + self.death_sound = "xmas/snowman/death1.wav"; + self.death_sound2 = "xmas/snowman/death2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound (self.death_sound); + precache_sound (self.death_sound2); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 125; + if (self.death_dmg < 1) self.death_dmg = DAMAGE_SNOWMAN; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.blockudeath = TRUE; // No humanoid death sound + self.gibbed = FALSE; // Still in one peice + self.pain_flinch = 30; // Light pain threshold + self.pain_longanim = FALSE; // No long pain animation + self.steptype = FS_TYPESLOW; // Small sounding feet + self.poisonous = FALSE; // Not Supported + self.meleeoffset = '24 0 20'; // Claw attack offset + self.attack_offset = '24 0 20'; // Run + Gun vector + self.bleedcolour = MON_BCOLOR_SILVER;// Red is odd for snow + self.deathstring = " was smashed on a Snowman\n"; + + // Default amount of nails to burst fire (5x9=45dmg) + if (self.attack_count < 1) self.attack_count = 5; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SnowmanCheckAttack; + self.th_stand = snowm_stand1; + self.th_walk = snowm_walk1; + self.th_run = snowm_run1; + self.th_melee = snowm_claw1; + self.th_missile = snowm_nail1; + self.th_pain = snowm_pain; + self.th_die = snowm_die; + + self.classtype = CT_MONSNOWMAN; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/mon_zombie.qc b/QC_other/QC_arcane/mon_zombie.qc new file mode 100644 index 00000000..d83455cd --- /dev/null +++ b/QC_other/QC_arcane/mon_zombie.qc @@ -0,0 +1,742 @@ +/*============================================================================== +ZOMBIE +==============================================================================*/ +$cd id1/models/zombie + +$origin 0 0 24 + +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 +$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 +$frame run13 run14 run15 run16 run17 run18 + +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11 +$frame atta12 atta13 + +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11 +$frame attb12 attb13 attb14 + +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11 +$frame attc12 + +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10 +$frame paina11 paina12 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19 +$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19 +$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28 +$frame paine29 paine30 + +$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6 + +void(float type) zombie_sound; + +//============================================================================= +void() zombie_stand1 =[ $stand1, zombie_stand2 ] { + zombie_sound(2); self.solid = SOLID_SLIDEBOX; ai_stand(); +}; +void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();}; +void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();}; +void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();}; +void() zombie_stand5 =[ $stand5, zombie_stand6 ] {ai_stand();}; +void() zombie_stand6 =[ $stand6, zombie_stand7 ] {ai_stand();}; +void() zombie_stand7 =[ $stand7, zombie_stand8 ] {ai_stand();}; +void() zombie_stand8 =[ $stand8, zombie_stand9 ] {ai_stand();}; +void() zombie_stand9 =[ $stand9, zombie_stand10 ] {ai_stand();}; +void() zombie_stand10 =[ $stand10, zombie_stand11 ] {ai_stand();}; +void() zombie_stand11 =[ $stand11, zombie_stand12 ] {ai_stand();}; +void() zombie_stand12 =[ $stand12, zombie_stand13 ] {ai_stand();}; +void() zombie_stand13 =[ $stand13, zombie_stand14 ] {ai_stand();}; +void() zombie_stand14 =[ $stand14, zombie_stand15 ] {ai_stand();}; +void() zombie_stand15 =[ $stand15, zombie_stand1 ] {ai_stand();}; + +//============================================================================ +void() zombie_walk1 =[ $walk1, zombie_walk2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_walk(0); +}; +void() zombie_walk2 =[ $walk2, zombie_walk3 ] {monster_footstep(TRUE); ai_walk(2);}; +void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);}; +void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);}; +void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);}; +void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);}; +void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);}; +void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);}; +void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);}; +void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);}; +void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);}; +void() zombie_walk12 =[ $walk12, zombie_walk13 ] {monster_footstep(FALSE); ai_walk(2);}; +void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);}; +void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);}; +void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);}; +void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);}; +void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);}; +void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);}; +void() zombie_walk19 =[ $walk19, zombie_walk1 ] {zombie_sound(2);}; + +//============================================================================ +void() zombie_run1 =[ $run1, zombie_run2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_run(1); +}; +void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);}; +void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);}; +void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);}; +void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);}; +void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);}; +void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);}; +void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);}; +void() zombie_run9 =[ $run9, zombie_run10] {monster_footstep(FALSE); ai_run(2);}; +void() zombie_run10 =[ $run10, zombie_run11] {ai_run(0);}; +void() zombie_run11 =[ $run11, zombie_run12] {ai_run(0);}; +void() zombie_run12 =[ $run12, zombie_run13] {ai_run(0);}; +void() zombie_run13 =[ $run13, zombie_run14] {ai_run(2);}; +void() zombie_run14 =[ $run14, zombie_run15] {ai_run(4);}; +void() zombie_run15 =[ $run15, zombie_run16] {ai_run(6);}; +void() zombie_run16 =[ $run16, zombie_run17] {ai_run(7);}; +void() zombie_run17 =[ $run17, zombie_run18] {monster_footstep(FALSE); ai_run(3);}; +void() zombie_run18 =[ $run18, zombie_run1 ] {zombie_sound(3); ai_run(8); }; + +//====================================================================== +// Zombie Range Attack +//====================================================================== +void(vector st) ZombieThrowFlesh = +{ + local vector org, dir, ang, avel; + + if (self.health < 0) return; + + // Throw the flesh missle from the hand above the head + makevectors (self.angles); + org = self.origin + attack_vector(st); + + // Is Z aware enabled (AI track player much better) + if ( query_configflag(SVR_ZAWARE) || self.no_zaware ) { + dir = normalize(self.enemy.origin - org); + dir = dir * SPEED_ZOMBFLESH; + dir_z = ELEV_ZAXIS; + } + else { + // One final angle adjustment (based on actual projectile origin) + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(self.attack_elev, org, self.enemy.origin, self.attack_speed); + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; + makevectors (ang); + dir = v_forward * self.attack_speed; + } + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_FLESH); +}; + +//---------------------------------------------------------------------- +void() zombie_atta1 =[ $atta1, zombie_atta2 ] {ai_face();}; +void() zombie_atta2 =[ $atta2, zombie_atta3 ] {ai_face();}; +void() zombie_atta3 =[ $atta3, zombie_atta4 ] {ai_face();}; +void() zombie_atta4 =[ $atta4, zombie_atta5 ] {ai_face();}; +void() zombie_atta5 =[ $atta5, zombie_atta6 ] {ai_face();}; +void() zombie_atta6 =[ $atta6, zombie_atta7 ] {ai_face();}; +void() zombie_atta7 =[ $atta7, zombie_atta8 ] {ai_face();}; +void() zombie_atta8 =[ $atta8, zombie_atta9 ] {ai_face();}; +void() zombie_atta9 =[ $atta9, zombie_atta10 ] {ai_face();}; +void() zombie_atta10 =[ $atta10, zombie_atta11 ] {ai_face(); + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() zombie_atta11 =[ $atta11, zombie_atta12 ] {ai_face(); + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() zombie_atta12 =[ $atta12, zombie_atta13 ] {ai_face(); + ZombieThrowFlesh('8 12 28');}; +void() zombie_atta13 =[ $atta13, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombie_attb1 =[ $attb1, zombie_attb2 ] {ai_face();}; +void() zombie_attb2 =[ $attb2, zombie_attb3 ] {ai_face();}; +void() zombie_attb3 =[ $attb3, zombie_attb4 ] {ai_face();}; +void() zombie_attb4 =[ $attb4, zombie_attb5 ] {ai_face();}; +void() zombie_attb5 =[ $attb5, zombie_attb6 ] {ai_face();}; +void() zombie_attb6 =[ $attb6, zombie_attb7 ] {ai_face();}; +void() zombie_attb7 =[ $attb7, zombie_attb8 ] {ai_face();}; +void() zombie_attb8 =[ $attb8, zombie_attb9 ] {ai_face();}; +void() zombie_attb9 =[ $attb9, zombie_attb10 ] {ai_face();}; +void() zombie_attb10 =[ $attb10, zombie_attb11 ] {ai_face();}; +void() zombie_attb11 =[ $attb11, zombie_attb12 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attb12 =[ $attb12, zombie_attb13 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attb13 =[ $attb13, zombie_attb14 ] {ai_face(); + ZombieThrowFlesh('6 -6 26');}; +void() zombie_attb14 =[ $attb13, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombie_attc1 =[ $attc1, zombie_attc2 ] {ai_face();}; +void() zombie_attc2 =[ $attc2, zombie_attc3 ] {ai_face();}; +void() zombie_attc3 =[ $attc3, zombie_attc4 ] {ai_face();}; +void() zombie_attc4 =[ $attc4, zombie_attc5 ] {ai_face();}; +void() zombie_attc5 =[ $attc5, zombie_attc6 ] {ai_face();}; +void() zombie_attc6 =[ $attc6, zombie_attc7 ] {ai_face();}; +void() zombie_attc7 =[ $attc7, zombie_attc8 ] {ai_face();}; +void() zombie_attc8 =[ $attc8, zombie_attc9 ] {ai_face();}; +void() zombie_attc9 =[ $attc9, zombie_attc10 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face(); + ZombieThrowFlesh('18 13 24');}; +void() zombie_attc12 =[ $attc12, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombie_missile = +{ + self.lip = self.meleeattack; + // Don't pick the same attack twice in a row + while (self.lip == self.meleeattack) { + self.lip = rint(random()*3); + } + + self.meleeattack = self.lip; + if (self.meleeattack == 1) zombie_atta1 (); + else if (self.meleeattack == 2) zombie_attb1 (); + else zombie_attc1 (); +}; + +//====================================================================== +// PAIN +//====================================================================== +void() zombie_paina1 =[ $paina1, zombie_paina2 ] {zombie_sound(4);}; +void() zombie_paina2 =[ $paina2, zombie_paina3 ] {ai_painforward(3);}; +void() zombie_paina3 =[ $paina3, zombie_paina4 ] {ai_painforward(1);}; +void() zombie_paina4 =[ $paina4, zombie_paina5 ] {ai_pain(1);}; +void() zombie_paina5 =[ $paina5, zombie_paina6 ] {ai_pain(3);}; +void() zombie_paina6 =[ $paina6, zombie_paina7 ] {ai_pain(1);}; +void() zombie_paina7 =[ $paina7, zombie_paina8 ] {}; +void() zombie_paina8 =[ $paina8, zombie_paina9 ] {}; +void() zombie_paina9 =[ $paina9, zombie_paina10 ] {}; +void() zombie_paina10 =[ $paina10, zombie_paina11 ] {}; +void() zombie_paina11 =[ $paina11, zombie_paina12 ] {}; +void() zombie_paina12 =[ $paina12, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombie_painc1 =[ $painc1, zombie_painc2 ] {zombie_sound(4);}; +void() zombie_painc2 =[ $painc2, zombie_painc3 ] {}; +void() zombie_painc3 =[ $painc3, zombie_painc4 ] {ai_pain(3);}; +void() zombie_painc4 =[ $painc4, zombie_painc5 ] {ai_pain(1);}; +void() zombie_painc5 =[ $painc5, zombie_painc6 ] {}; +void() zombie_painc6 =[ $painc6, zombie_painc7 ] {}; +void() zombie_painc7 =[ $painc7, zombie_painc8 ] {}; +void() zombie_painc8 =[ $painc8, zombie_painc9 ] {}; +void() zombie_painc9 =[ $painc9, zombie_painc10 ] {}; +void() zombie_painc10 =[ $painc10, zombie_painc11 ] {}; +void() zombie_painc11 =[ $painc11, zombie_painc12 ] {ai_painforward(1);}; +void() zombie_painc12 =[ $painc12, zombie_painc13 ] {ai_painforward(1);}; +void() zombie_painc13 =[ $painc13, zombie_painc14 ] {}; +void() zombie_painc14 =[ $painc14, zombie_painc15 ] {}; +void() zombie_painc15 =[ $painc15, zombie_painc16 ] {}; +void() zombie_painc16 =[ $painc16, zombie_painc17 ] {}; +void() zombie_painc17 =[ $painc17, zombie_painc18 ] {}; +void() zombie_painc18 =[ $painc18, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombie_paind1 =[ $paind1, zombie_paind2 ] {zombie_sound(4);}; +void() zombie_paind2 =[ $paind2, zombie_paind3 ] {}; +void() zombie_paind3 =[ $paind3, zombie_paind4 ] {}; +void() zombie_paind4 =[ $paind4, zombie_paind5 ] {}; +void() zombie_paind5 =[ $paind5, zombie_paind6 ] {}; +void() zombie_paind6 =[ $paind6, zombie_paind7 ] {}; +void() zombie_paind7 =[ $paind7, zombie_paind8 ] {}; +void() zombie_paind8 =[ $paind8, zombie_paind9 ] {}; +void() zombie_paind9 =[ $paind9, zombie_paind10 ] {ai_pain(1);}; +void() zombie_paind10 =[ $paind10, zombie_paind11 ] {}; +void() zombie_paind11 =[ $paind11, zombie_paind12 ] {}; +void() zombie_paind12 =[ $paind12, zombie_paind13 ] {}; +void() zombie_paind13 =[ $paind13, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +// Fall down - B : random pain, E : large amount of damage +//---------------------------------------------------------------------- +void() zombie_painb1 =[ $painb1, zombie_painb2 ] {self.inpain = 2;}; +void() zombie_painb2 =[ $painb2, zombie_painb3 ] {ai_pain(2);}; +void() zombie_painb3 =[ $painb3, zombie_painb4 ] {ai_pain(8);}; +void() zombie_painb4 =[ $painb4, zombie_painb5 ] {ai_pain(6);}; +void() zombie_painb5 =[ $painb5, zombie_painb6 ] {ai_pain(2);}; +void() zombie_painb6 =[ $painb6, zombie_painb7 ] {}; +void() zombie_painb7 =[ $painb7, zombie_painb8 ] {zombie_sound(5);}; +void() zombie_painb8 =[ $painb8, zombie_painb9 ] {self.solid = SOLID_NOT;}; +void() zombie_painb9 =[ $painb9, zombie_painb9 ] { + zombie_onground(MONAI_ZOMBIEUPB);}; + +// Start of get up sequence +void() zombie_painb10 =[ $painb10, zombie_painb11 ] {}; +void() zombie_painb11 =[ $painb11, zombie_painb12 ] {}; +void() zombie_painb12 =[ $painb12, zombie_painb13 ] {}; +void() zombie_painb13 =[ $painb13, zombie_painb14 ] {}; +void() zombie_painb14 =[ $painb14, zombie_painb15 ] {}; +void() zombie_painb15 =[ $painb15, zombie_painb16 ] {}; +void() zombie_painb16 =[ $painb16, zombie_painb17 ] {}; +void() zombie_painb17 =[ $painb17, zombie_painb18 ] {}; +void() zombie_painb18 =[ $painb18, zombie_painb19 ] {}; +void() zombie_painb19 =[ $painb19, zombie_painb20 ] {}; +void() zombie_painb20 =[ $painb20, zombie_painb21 ] {}; +void() zombie_painb21 =[ $painb21, zombie_painb22 ] {}; +void() zombie_painb22 =[ $painb22, zombie_painb23 ] {}; +void() zombie_painb23 =[ $painb23, zombie_painb24 ] {}; +void() zombie_painb24 =[ $painb24, zombie_painb25 ] {}; +void() zombie_painb25 =[ $painb25, zombie_painb26 ] {monster_footstep(FALSE); ai_painforward(1);}; +void() zombie_painb26 =[ $painb26, zombie_painb27 ] {}; +void() zombie_painb27 =[ $painb27, zombie_painb28 ] {}; +void() zombie_painb28 =[ $painb28, zombie_run1 ] { + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +//---------------------------------------------------------------------- +void() zombie_paine1 =[ $paine1, zombie_paine2 ] {self.inpain = 2;}; +void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);}; +void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);}; +void() zombie_paine4 =[ $paine4, zombie_paine5 ] {ai_pain(3);}; +void() zombie_paine5 =[ $paine5, zombie_paine6 ] {ai_pain(1);}; +void() zombie_paine6 =[ $paine6, zombie_paine7 ] {ai_pain(2);}; +void() zombie_paine7 =[ $paine7, zombie_paine8 ] {ai_pain(1);}; +void() zombie_paine8 =[ $paine8, zombie_paine9 ] {ai_pain(1);}; +void() zombie_paine9 =[ $paine9, zombie_paine10 ] {ai_pain(2);}; +void() zombie_paine10 =[ $paine10, zombie_paine11 ] {zombie_sound(5);}; +void() zombie_paine11 =[ $paine11, zombie_paine12 ] {self.solid = SOLID_NOT;}; +void() zombie_paine12 =[ $paine12, zombie_paine12 ] { + zombie_onground(MONAI_ZOMBIEUPE);}; + +// Start of get up sequence +void() zombie_paine13 =[ $paine13, zombie_paine14 ] {}; +void() zombie_paine14 =[ $paine14, zombie_paine15 ] {}; +void() zombie_paine15 =[ $paine15, zombie_paine16 ] {}; +void() zombie_paine16 =[ $paine16, zombie_paine17 ] {}; +void() zombie_paine17 =[ $paine17, zombie_paine18 ] {}; +void() zombie_paine18 =[ $paine18, zombie_paine19 ] {}; +void() zombie_paine19 =[ $paine19, zombie_paine20 ] {}; +void() zombie_paine20 =[ $paine20, zombie_paine21 ] {}; +void() zombie_paine21 =[ $paine21, zombie_paine22 ] {}; +void() zombie_paine22 =[ $paine22, zombie_paine23 ] {}; +void() zombie_paine23 =[ $paine23, zombie_paine24 ] {}; +void() zombie_paine24 =[ $paine24, zombie_paine25 ] {monster_footstep(FALSE);}; +void() zombie_paine25 =[ $paine25, zombie_paine26 ] {ai_painforward(5);}; +void() zombie_paine26 =[ $paine26, zombie_paine27 ] {ai_painforward(3);}; +void() zombie_paine27 =[ $paine27, zombie_paine28 ] {ai_painforward(1);}; +void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);}; +void() zombie_paine29 =[ $paine29, zombie_paine30 ] {}; +void() zombie_paine30 =[ $paine30, zombie_run1 ] { + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +/*====================================================================== + ZOMBIE PAIN + * All damage must come through pain function to reset health + * Be careful blocking zombie pain function with pain_finished + * zombies react in 2 ways, minor pain (a,c,d) and full knockdown (b,e) +======================================================================*/ +void(entity inflictor, entity attacker, float take) zombie_pain = +{ + // Is the zombie in the process of dying? + if (self.deadflag > DEAD_NO) return; + // Always reset health + self.health = self.max_health; + + // Check for invulnerability frames and shadow axe + if (self.inpain > 0 && self.axhitme == 2) { + self.axhitme = 0; // Reset axe + self.health = self.gibhealth; // Reset Health + Killed (self, attacker); // Gib time + return; + } + else self.axhitme = 0; // Reset axe + + //---------------------------------------------------------------------- + // Pain/damage too low OR down on ground, totally ignore + //---------------------------------------------------------------------- + if (take < MONAI_ZOMBIELOW_DAM || self.inpain == 2) return; + + //---------------------------------------------------------------------- + // Damage 29-60, drop straight away to ground (SSG, Quad NG) + // This has to be a single large hit over 0.1 frame + //---------------------------------------------------------------------- + if (take > MONAI_ZOMBIEHGH_DAM) { + zombie_paine1(); + return; + } + + //---------------------------------------------------------------------- + // Projectile shotguns pellets don't all hit at same time + // they accumulate over time and can distort damage values + // Need to block damage over time to detect second hit + // Cannot use pain_finished because it blocks the pain function + // and the health needs to be reset all the time + // Using 'lefty' because zombies don't use it for anything + if (self.lefty < time && self.inpain == 1) { + // Second hit, drop to ground + zombie_paine1 (); + return; + } + + //---------------------------------------------------------------------- + // Damage 9-25 random pain animation (random chance of knockdown painb) + //---------------------------------------------------------------------- + if (self.inpain) return; // Already in minor pain + self.inpain = 1; // Minor pain active + self.lefty = time + 0.5; // Wait for second hit + self.lip = random(); + if (self.lip < 0.25) zombie_paina1 (); // 12 frames (bent over, short) + else if (self.lip < 0.5) zombie_painb1 (); // 28 frames (9 = on ground) + else if (self.lip < 0.75) zombie_painc1 (); // 18 frames (bent over, long) + else zombie_paind1 (); // 13 frames (slight hit) +}; + +/*============================================================================= + ZOMBIE WAKEUP (check if can get up) +=============================================================================*/ +void() zombie_wakeup = { + if (self.gibbed) return; // Do nothing dead + + self.use = SUB_Null; // No more using at this point + if (!self.enemy) FindTarget(); // If no enemy, look around? + + // Make sure bounding box is correct, if blocked can be set 0,0,0 + setsize (self, self.bbmins, self.bbmaxs); + // Turn monster collision on and test if can walk forward + self.solid = SOLID_SLIDEBOX; + if (!walkmove (0, 0)) + { + self.inpain = 2; // On ground + self.nextthink = time + 0.1; // Keep checking + self.think = self.th_wakeup; // Same function + self.solid = SOLID_NOT; // No world interaction yet + // Check if something has been blocking the zombie from getting up + // This is a check for weird world/bmodel geo or monster/players + // standing on zombies while on the ground trying to get up! + self.count = self.count + 1; + if (self.count > MONAI_ZOMBGRDBLOCK) { + self.health = self.gibhealth; // Gib time + Killed(self, self); // Register death + return; + } + } + else { + self.bodyonflr = ""; // Body is chop proof! + self.inpain = 2; // Animation not finished + zombie_sound(6); // Wake up sound + self.nextthink = time + 0.1; + self.use = monster_use; // Just in case interruption + if (self.zombieflr == MONAI_ZOMBIEUPB) self.think = zombie_painb10; + else self.think = zombie_paine13; + } +}; + +//---------------------------------------------------------------------- +// Puts the zombie on the floor with a random Yaw rotation +// paintype = 0 Setup on floor with use trigger +// paintype > 0 On floor and waiting to get back up +//---------------------------------------------------------------------- +void(float frameno) zombie_onground = { + self.health = self.max_health; // reset health + self.inpain = 2; // Lying on floor, no pain + self.count = 0; // Reset get up tries + self.solid = SOLID_NOT; // No world interaction + self.bodyonflr = MON_ONFLR; // mark body for the chop + + // Does the zombie start on the ground? + if (frameno == MONAI_ZOMBIEFLR) { + // Do nothing else while on the floor + self.nextthink = self.pausetime; + self.think = SUB_Null; + + // Check for spawning onfloor orientation flag + // aflag = 1 Forward = 2 Backward + if (self.aflag < 1 || self.aflag > 2) { + if (random() < 0.5) self.aflag = 1; + else self.aflag = 2; + } + + // Pick random starting pose + if (self.aflag == 1) { + self.zombieflr = MONAI_ZOMBIEUPB; + self.frame = $painb9; + } + else { + self.zombieflr = MONAI_ZOMBIEUPE; + self.frame = $paine12; + } + // If no angle set, Random fall direction + if (self.angles_y < 1) self.angles_y = rint(random()*359); + self.use = self.th_wakeup; + self.fixangle = TRUE; + // Reset onspawn fall down angle (only used once) + self.aflag = 0; + } + else { + self.zombieflr = frameno; // Wakeup pose for later + // Keep zombies on the ground and check again later + self.nextthink = self.nextthink + MONAI_ZOMBGRDTIMER; + self.think = self.th_wakeup; + } +}; + +/*============================================================================ + All sounds used + 1 = sticking around, crucified + 2 = strutting the stuff (walking) + 3 = running (in slow motion) + 4 = all pain routines (zombie_paina1, _painb1, _painc1, _paind1, _paine1) + 5 = its a knockout! + 6 = get up and moan about it + 7 = fire zombie gib +============================================================================*/ +void(float type) zombie_sound = +{ + // check for gibbed or idle sound block + if (self.health < 1) return; + if (self.spawnflags & MON_SPAWN_NOIDLE && type < 3) return; + + // Random sound check + self.lip = random(); + if (type == 1) { + if (self.lip < 0.1) + sound (self, CHAN_VOICE, "zombie/idle_w2.wav", 1, ATTN_STATIC); + } + else if (type == 2 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + } + else if (type == 3 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + if (self.lip > 0.8) sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 4) { + if (self.lip < 0.25) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } + else if (type == 5) { + sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + } + else if (type == 6) { + if (self.lip < 0.5) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 7) { + sound (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); + } +}; + +//============================================================================ +void() zombie_die = +{ + self.health = self.gibhealth; // Force gib + monster_death_precheck(); +}; + +//============================================================================ +void() zombie_cruc1 = [$cruc_1,zombie_cruc2] {zombie_sound(1);}; +void() zombie_cruc2 = [$cruc_2,zombie_cruc3] {self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc3 = [$cruc_3,zombie_cruc4] {self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc4 = [$cruc_4,zombie_cruc5] {self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc5 = [$cruc_5,zombie_cruc6] {self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc6 = [$cruc_6,zombie_cruc1] {self.nextthink = time + 0.1 + random()*0.1;}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) zombie_cruc_pain = +{ + self.health = self.max_health; // reset health + // Any pain to moan about? + if (self.pain_finished < time) zombie_sound(4); + self.pain_finished = time + 1 + random(); +}; + +//---------------------------------------------------------------------- +void() zombie_cruc_spawn = +{ + self.use = SUB_Null; // No more triggers + self.solid = SOLID_BBOX; // Interact with objects + self.movetype = MOVETYPE_FLY; // Cannot be movetype_none + setmodel(self, self.mdl); // Nail to cross + setsize (self, self.bbmins, self.bbmaxs); + + // Setup exact/randon skin choices + self.randomskin = 4; + if (self.exactskin > 0) self.skin = rint(self.exactskin); + else self.skin = rint(random()*(self.randomskin-1)); + if (self.skin < 0) self.skin = 0; // Double check no negatives + + self.takedamage = DAMAGE_AIM; // Can receive damage + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.view_ofs = '0 0 -24'; // Standard setup + self.pain_timeout = 1; // Default + + zombie_cruc1 (); // Time to do some moaning +}; + +//---------------------------------------------------------------------- +void() zombie_cruc_setup = +{ + // Setup AI functions + self.th_stand = self.th_walk = self.th_run = zombie_cruc1; + self.th_pain = zombie_cruc_pain; self.th_die = zombie_die; + + self.gibbed = FALSE; // Still in one piece + self.health = self.max_health = 60; // Save for later + self.gibhealth = 0 - self.health; // Work out damage trigger + self.pain_flinch = 10; // Always in pain + self.nomonstercount = TRUE; // Don't include in initial total + + // Zombies cannot be crucified and on the floor at once! + self.spawnflags = self.spawnflags - (self.spawnflags & MON_ONFLOOR); + + self.flags = FL_MONSTER; // Always reset this flag + self.effects = 0; // Always reset + self.oldorigin = self.origin; // Save origin + self.bbmins = '-8 -8 -24'; // Narrow pole + self.bbmaxs = '8 8 32'; + + if (self.spawnflags & MON_SPAWN_DELAY) { + setmodel(self, string_null); + self.solid = SOLID_NOT; // No world interaction + self.use = zombie_cruc_spawn; // Wait for trigger + } + else { + // Variable start delay on all monsters to reduce packet errors + self.nextthink = time + 0.1 + random()*0.4; + self.think = zombie_cruc_spawn; + } +}; + +/*====================================================================== + QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) Crucified ambush FLOOR +If crucified, stick the bounding box 12 pixels back into a wall to look right. +======================================================================*/ +void() monster_zombie = +{ + if (deathmatch) { remove(self); return; } + + // Stupid ID getting the crucified and ambush back to front on zombies + // Lets fix the problem and reverse the flags to match everything else + if (self.classtype != CT_MONMUMMY) { + if (self.spawnflags & MON_ZOMCRUCIFIED || self.spawnflags & MON_ZOMBAMBUSH) { + self.health = 0; // Temporarily use this variable + if (self.spawnflags & MON_ZOMCRUCIFIED) self.health = self.health + MON_CRUCIFIED; + if (self.spawnflags & MON_ZOMBAMBUSH) self.health = self.health + MON_AMBUSH; + + // Removed the old bits and then add the new one's + self.spawnflags = self.spawnflags - (self.spawnflags & MON_ZOMIDHACK); + self.spawnflags = self.spawnflags + self.health; + } + } + + self.mdl = "progs/mon_zombie.mdl"; + self.headmdl = "progs/h_zombie.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_FLESH); // Also in world.qc + + precache_sound ("zombie/z_idle.wav"); // Idle A + precache_sound ("zombie/z_idle1.wav"); // Idle B + precache_sound ("zombie/idle_w2.wav"); // Crucified + + self.pain_sound = "zombie/z_pain.wav"; + self.pain_sound2 = "zombie/z_pain1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("zombie/z_shot1.wav"); // Swipe sound + precache_sound ("zombie/z_fall.wav"); // Impact - floor + precache_sound ("zombie/z_miss.wav"); // Impact - miss + precache_sound ("zombie/z_hit.wav"); // Impact - hit + precache_sound ("zombie/z_gib.wav"); // Death sound + + self.sight_sound = "zombie/z_idle.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_FLESHP); // Green flesh!?! + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (!self.classtype) self.classtype = CT_MONZOMBIE; + self.classgroup = CG_ZOMBIE; // One big happy zombie family! + self.classmove = MON_MOVEWALK; + if (!self.exactskin) self.randomskin = 4; + if (self.deathstring == "") + self.deathstring = " joins the Zombies\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Setup crucified zombies + if (self.spawnflags & MON_CRUCIFIED) zombie_cruc_setup(); + else { + // Setup zombie ready for placement + self.health = 60; // Basic health (cannot override) + self.gibhealth = -60; // Gib value, not used + self.gibbed = FALSE; // In one piece + self.pain_flinch = MONAI_ZOMBIEHGH_DAM; + self.steptype = FS_TYPESLOW; // Small leg + self.altsteptype = FS_TYPEDRAG; // Clubfoot + self.pain_timeout = -5; // Always go into pain (health reset) + if (!self.movespeed) self.movespeed = 1;// Adjustable speed via skill level + self.inpain = 0; // Zombie starts with no pain lock + self.count = 0; // Reset get up timer + + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; + self.th_wakeup = zombie_wakeup; // Get off floor + + monster_start(); + } +}; + +/*====================================================================== + QUAKED monster_mummy (1 0 0) (-16 -16 -24) (16 16 32) ambush x FLOOR +Poisonous Zombie that explodes poisonous gibs on death +======================================================================*/ +void() monster_mummy = +{ + self.classtype = CT_MONMUMMY; // Special poison zombie + self.exactskin = 6; // Mouldly bandages + self.no_liquiddmg = TRUE; // Immune to slime/lava + self.spawnflags = self.spawnflags - (self.spawnflags & MON_CRUCIFIED); + self.deathstring = " was Mummified\n"; + + // The mummy is just poisonous, it is still a zombie + monster_zombie(); +}; + diff --git a/QC_other/QC_arcane/mon_zombiek.qc b/QC_other/QC_arcane/mon_zombiek.qc new file mode 100644 index 00000000..dcb3a1fc --- /dev/null +++ b/QC_other/QC_arcane/mon_zombiek.qc @@ -0,0 +1,872 @@ +/*====================================================================== +Zombie KNIGHT (undead version of original knight) +======================================================================*/ +$cd id1/models/zombiek +$origin 0 0 24 +$base base +$skin skin + +// (001 - 015) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +// (016 - 029) Default walk dragging left foot +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 + +// (030 - 040) Default run, fast for a zombie +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 + +// (041 - 052) Still moving forward +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 +$frame paina9 paina10 paina11 paina12 + +// (053 - 077) Stagger backwards, long animation +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 +$frame painb9 painb10 painb11 painb12 painb13 painb14 painb15 painb16 +$frame painb17 painb18 painb19 painb20 painb21 painb22 painb23 painb24 painb25 + +// (078 - 098) Fall down to knees and get back up +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 +$frame painc9 painc10 painc11 painc12 painc13 painc14 painc15 painc16 +$frame painc17 painc18 painc19 painc20 painc21 + +// (099 - 121) Fall down FORWARD (paind12 = on floor) +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 paind20 paind21 paind22 paind23 + +// (122 - 152) Fall down BACKWARD (paine12 = on floor) +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 +$frame paine9 paine10 paine11 paine12 paine13 paine14 paine15 paine16 +$frame paine17 paine18 paine19 paine20 paine21 paine22 paine23 paine24 +$frame paine25 paine26 paine27 paine28 paine29 paine30 paine31 + +// (153 - 171) Melee Attack 1 - Smash (chop overhead to ground) +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 +$frame atta9 atta10 atta11 atta12 atta13 atta14 atta15 atta16 atta17 atta18 atta19 + +// (172 - 188) Melee Attack 2 - Stationary over arm swing +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 +$frame attb9 attb10 attb11 attb12 attb13 attb14 attb15 attb16 attb17 + +// (189 - 203) Melee Attack 3 - Stationary sideways swing +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 +$frame attc9 attc10 attc11 attc12 attc13 attc14 attc15 + +// (204 - 223) idle 2 - scratch brains +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 +$frame idleb9 idleb10 idleb11 idleb12 idleb13 idleb14 idleb15 idleb16 +$frame idleb17 idleb18 idleb19 idleb20 + +// (224 - 238) idle 3 - swing head LEFT +$frame idlec1 idlec2 idlec3 idlec4 idlec5 idlec6 idlec7 idlec8 +$frame idlec9 idlec10 idlec11 idlec12 idlec13 idlec14 idlec15 + +// (239 - 253) idle 4 - swing head RIGHT +$frame idled1 idled2 idled3 idled4 idled5 idled6 idled7 idled8 +$frame idled9 idled10 idled11 idled12 idled13 idled14 idled15 + +void(float type) zombiek_sound; +void() zombiek_knockdown; + +//============================================================================= +void() zombiek_standB1 =[ $idleb1, zombiek_standB2 ] {ai_stand();}; +void() zombiek_standB2 =[ $idleb2, zombiek_standB3 ] {ai_stand();}; +void() zombiek_standB3 =[ $idleb3, zombiek_standB4 ] {ai_stand();}; +void() zombiek_standB4 =[ $idleb4, zombiek_standB5 ] {ai_stand();}; +void() zombiek_standB5 =[ $idleb5, zombiek_standB6 ] {ai_stand();}; +void() zombiek_standB6 =[ $idleb6, zombiek_standB7 ] {ai_stand();}; +void() zombiek_standB7 =[ $idleb7, zombiek_standB8 ] {ai_stand();}; +void() zombiek_standB8 =[ $idleb8, zombiek_standB9 ] {ai_stand();}; +void() zombiek_standB9 =[ $idleb9, zombiek_standB10 ] {ai_stand();}; +void() zombiek_standB10 =[ $idleb10, zombiek_standB11 ] {ai_stand();}; +void() zombiek_standB11 =[ $idleb11, zombiek_standB12 ] {ai_stand();}; +void() zombiek_standB12 =[ $idleb12, zombiek_standB13 ] {ai_stand();}; +void() zombiek_standB13 =[ $idleb13, zombiek_standB14 ] {ai_stand();}; +void() zombiek_standB14 =[ $idleb14, zombiek_standB15 ] {ai_stand();}; +void() zombiek_standB15 =[ $idleb15, zombiek_standB16 ] {ai_stand();}; +void() zombiek_standB16 =[ $idleb16, zombiek_standB17 ] {ai_stand();}; +void() zombiek_standB17 =[ $idleb17, zombiek_standB18 ] {ai_stand();}; +void() zombiek_standB18 =[ $idleb18, zombiek_standB19 ] {ai_stand();}; +void() zombiek_standB19 =[ $idleb19, zombiek_standB20 ] {ai_stand();}; +void() zombiek_standB20 =[ $idleb20, zombiek_stand1 ] {ai_stand();}; + +//============================================================================= +void() zombiek_standC1 =[ $idlec1, zombiek_standC2 ] {ai_stand();}; +void() zombiek_standC2 =[ $idlec2, zombiek_standC3 ] {ai_stand();}; +void() zombiek_standC3 =[ $idlec3, zombiek_standC4 ] {ai_stand();}; +void() zombiek_standC4 =[ $idlec4, zombiek_standC5 ] {ai_stand();}; +void() zombiek_standC5 =[ $idlec5, zombiek_standC6 ] {ai_stand();}; +void() zombiek_standC6 =[ $idlec6, zombiek_standC7 ] {ai_stand();}; +void() zombiek_standC7 =[ $idlec7, zombiek_standC8 ] {ai_stand();}; +void() zombiek_standC8 =[ $idlec8, zombiek_standC9 ] {ai_stand();}; +void() zombiek_standC9 =[ $idlec9, zombiek_standC10 ] {ai_stand();}; +void() zombiek_standC10 =[ $idlec10, zombiek_standC11 ] {ai_stand();}; +void() zombiek_standC11 =[ $idlec11, zombiek_standC12 ] {ai_stand();}; +void() zombiek_standC12 =[ $idlec12, zombiek_standC13 ] {ai_stand();}; +void() zombiek_standC13 =[ $idlec13, zombiek_standC14 ] {ai_stand();}; +void() zombiek_standC14 =[ $idlec14, zombiek_standC15 ] {ai_stand();}; +void() zombiek_standC15 =[ $idlec15, zombiek_stand1 ] {ai_stand();}; + +//============================================================================= +void() zombiek_standD1 =[ $idled1, zombiek_standD2 ] {ai_stand();}; +void() zombiek_standD2 =[ $idled2, zombiek_standD3 ] {ai_stand();}; +void() zombiek_standD3 =[ $idled3, zombiek_standD4 ] {ai_stand();}; +void() zombiek_standD4 =[ $idled4, zombiek_standD5 ] {ai_stand();}; +void() zombiek_standD5 =[ $idled5, zombiek_standD6 ] {ai_stand();}; +void() zombiek_standD6 =[ $idled6, zombiek_standD7 ] {ai_stand();}; +void() zombiek_standD7 =[ $idled7, zombiek_standD8 ] {ai_stand();}; +void() zombiek_standD8 =[ $idled8, zombiek_standD9 ] {ai_stand();}; +void() zombiek_standD9 =[ $idled9, zombiek_standD10 ] {ai_stand();}; +void() zombiek_standD10 =[ $idled10, zombiek_standD11 ] {ai_stand();}; +void() zombiek_standD11 =[ $idled11, zombiek_standD12 ] {ai_stand();}; +void() zombiek_standD12 =[ $idled12, zombiek_standD13 ] {ai_stand();}; +void() zombiek_standD13 =[ $idled13, zombiek_standD14 ] {ai_stand();}; +void() zombiek_standD14 =[ $idled14, zombiek_standD15 ] {ai_stand();}; +void() zombiek_standD15 =[ $idled15, zombiek_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() zombiek_standE1 =[ $idlec1, zombiek_standE2 ] {ai_stand();}; +void() zombiek_standE2 =[ $idlec2, zombiek_standE3 ] {ai_stand();}; +void() zombiek_standE3 =[ $idlec3, zombiek_standE4 ] {ai_stand();}; +void() zombiek_standE4 =[ $idlec4, zombiek_standE5 ] {ai_stand();}; +void() zombiek_standE5 =[ $idlec5, zombiek_standE6 ] {ai_stand();}; +void() zombiek_standE6 =[ $idlec6, zombiek_standE7 ] {ai_stand();}; +void() zombiek_standE7 =[ $idlec7, zombiek_standE8 ] {ai_stand();}; +void() zombiek_standE8 =[ $idlec8, zombiek_standE9 ] {ai_stand();}; +void() zombiek_standE9 =[ $idlec9, zombiek_standE10 ] {ai_stand();}; +void() zombiek_standE10 =[ $idlec10, zombiek_standE11 ] {ai_stand();}; +void() zombiek_standE11 =[ $idlec11, zombiek_standE12 ] {ai_stand();}; +void() zombiek_standE12 =[ $idlec12, zombiek_standE13 ] {ai_stand();}; +void() zombiek_standE13 =[ $idlec13, zombiek_standE14 ] {ai_stand();}; +void() zombiek_standE14 =[ $idlec14, zombiek_standE15 ] {ai_stand();}; +void() zombiek_standE15 =[ $idlec15, zombiek_standE16 ] {ai_stand();}; +void() zombiek_standE16 =[ $idled1, zombiek_standE17 ] {ai_stand();}; +void() zombiek_standE17 =[ $idled2, zombiek_standE18 ] {ai_stand();}; +void() zombiek_standE18 =[ $idled3, zombiek_standE19 ] {ai_stand();}; +void() zombiek_standE19 =[ $idled4, zombiek_standE20 ] {ai_stand();}; +void() zombiek_standE20 =[ $idled5, zombiek_standE21 ] {ai_stand();}; +void() zombiek_standE21 =[ $idled6, zombiek_standE22 ] {ai_stand();}; +void() zombiek_standE22 =[ $idled7, zombiek_standE23 ] {ai_stand();}; +void() zombiek_standE23 =[ $idled8, zombiek_standE24 ] {ai_stand();}; +void() zombiek_standE24 =[ $idled9, zombiek_standE25 ] {ai_stand();}; +void() zombiek_standE25 =[ $idled10, zombiek_standE26 ] {ai_stand();}; +void() zombiek_standE26 =[ $idled11, zombiek_standE27 ] {ai_stand();}; +void() zombiek_standE27 =[ $idled12, zombiek_standE28 ] {ai_stand();}; +void() zombiek_standE28 =[ $idled13, zombiek_standE29 ] {ai_stand();}; +void() zombiek_standE29 =[ $idled14, zombiek_standE30 ] {ai_stand();}; +void() zombiek_standE30 =[ $idled15, zombiek_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() zombiek_stand1 =[ $stand1, zombiek_stand2 ] {ai_stand();}; +void() zombiek_stand2 =[ $stand2, zombiek_stand3 ] {ai_stand();}; +void() zombiek_stand3 =[ $stand3, zombiek_stand4 ] {ai_stand();}; +void() zombiek_stand4 =[ $stand4, zombiek_stand5 ] {ai_stand();}; +void() zombiek_stand5 =[ $stand5, zombiek_stand6 ] {ai_stand();}; +void() zombiek_stand6 =[ $stand6, zombiek_stand7 ] {ai_stand();}; +void() zombiek_stand7 =[ $stand7, zombiek_stand8 ] {ai_stand();}; +void() zombiek_stand8 =[ $stand8, zombiek_stand9 ] {ai_stand();}; +void() zombiek_stand9 =[ $stand9, zombiek_stand10 ] {ai_stand();}; +void() zombiek_stand10 =[ $stand10, zombiek_stand11 ] {ai_stand();}; +void() zombiek_stand11 =[ $stand11, zombiek_stand12 ] {ai_stand();}; +void() zombiek_stand12 =[ $stand12, zombiek_stand13 ] {ai_stand();}; +void() zombiek_stand13 =[ $stand13, zombiek_stand14 ] {ai_stand();}; +void() zombiek_stand14 =[ $stand14, zombiek_stand15 ] {ai_stand();}; +void() zombiek_stand15 =[ $stand15, zombiek_stand1 ] { + self.idlebusy = FALSE; + self.solid = SOLID_SLIDEBOX; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + if (self.lip < 1) self.think = zombiek_standB1; // Pick brains! + else if (self.lip < 2) self.think = zombiek_standE1; // Look BOTH + else if (self.lip < 3) self.think = zombiek_standC1; // Look LEFT + else self.think = zombiek_standD1; // Look RIGHT + } + ai_stand(); +}; + +//============================================================================ +void() zombiek_walk1 =[ $walk1, zombiek_walk2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_walk(1);}; +void() zombiek_walk2 =[ $walk2, zombiek_walk3 ] {ai_walk(1);}; +void() zombiek_walk3 =[ $walk3, zombiek_walk4 ] {ai_walk(4);}; +void() zombiek_walk4 =[ $walk4, zombiek_walk5 ] {ai_walk(4);}; +void() zombiek_walk5 =[ $walk5, zombiek_walk6 ] {ai_walk(2);}; +void() zombiek_walk6 =[ $walk6, zombiek_walk7 ] {ai_walk(1);}; +void() zombiek_walk7 =[ $walk7, zombiek_walk8 ] {ai_walk(1);}; +void() zombiek_walk8 =[ $walk8, zombiek_walk9 ] {ai_walk(1);monster_footstep(FALSE);}; +void() zombiek_walk9 =[ $walk9, zombiek_walk10] {ai_walk(1);}; +void() zombiek_walk10 =[ $walk10, zombiek_walk11] {ai_walk(1);}; +void() zombiek_walk11 =[ $walk11, zombiek_walk12] {ai_walk(1);}; +void() zombiek_walk12 =[ $walk12, zombiek_walk13] {ai_walk(1);monster_footstep(TRUE);}; // Scrapping Clubfoot +void() zombiek_walk13 =[ $walk13, zombiek_walk14] {ai_walk(1);}; +void() zombiek_walk14 =[ $walk14, zombiek_walk1 ] {zombiek_sound(2);ai_walk(1);}; + +//============================================================================ +void() zombiek_run1 =[ $run1, zombiek_run2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_run(12);}; +void() zombiek_run2 =[ $run2, zombiek_run3 ] {ai_run(12);}; +void() zombiek_run3 =[ $run3, zombiek_run4 ] {ai_run(13);}; +void() zombiek_run4 =[ $run4, zombiek_run5 ] {ai_run(12);}; +void() zombiek_run5 =[ $run5, zombiek_run6 ] {ai_run(12);monster_footstep(FALSE);}; +void() zombiek_run6 =[ $run6, zombiek_run7 ] {ai_run(12);}; +void() zombiek_run7 =[ $run7, zombiek_run8 ] {ai_run(12);}; +void() zombiek_run8 =[ $run8, zombiek_run9 ] {ai_run(11);}; +void() zombiek_run9 =[ $run9, zombiek_run10 ] {ai_run(14);}; +void() zombiek_run10 =[ $run10, zombiek_run11 ] {ai_run(13);}; +void() zombiek_run11 =[ $run11, zombiek_run1 ] {ai_run(11); + self.steptype = FS_TYPEHEAVY; // Heavy clubfoot + monster_footstep(FALSE); + self.steptype = FS_TYPESLOW; // Normal zombie foot +}; + +//=========================================================================== +// Melee Attack 2 - Stationary over arm swing (17->12 frames) +// Removed frames 1,3,4,5,7 +void() zombiek_attb1 =[ $attb2, zombiek_attb6 ] {ai_face();}; +void() zombiek_attb6 =[ $attb6, zombiek_attb8 ] {ai_face();}; +void() zombiek_attb8 =[ $attb8, zombiek_attb9 ] {ai_face();zombiek_sound(7);}; +void() zombiek_attb9 =[ $attb9, zombiek_attb10] {ai_face();}; +void() zombiek_attb10=[ $attb10, zombiek_attb11] {ai_face();ai_melee();}; +void() zombiek_attb11=[ $attb11, zombiek_attb12] {ai_melee();}; +void() zombiek_attb12=[ $attb12, zombiek_attb13] {ai_melee();}; +void() zombiek_attb13=[ $attb13, zombiek_attb14] {}; +void() zombiek_attb14=[ $attb14, zombiek_attb15] {}; +void() zombiek_attb15=[ $attb15, zombiek_attb16] {}; +void() zombiek_attb16=[ $attb16, zombiek_attb17] {}; +void() zombiek_attb17=[ $attb17, zombiek_run1 ] {}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - Stationary sideways swing (15->12 frames) +// Removed frames 1,3,15 +void() zombiek_attc1 =[ $attc2, zombiek_attc4 ] {ai_face();}; +void() zombiek_attc4 =[ $attc4, zombiek_attc5 ] {ai_face();}; +void() zombiek_attc5 =[ $attc5, zombiek_attc6 ] {zombiek_sound(7); ai_face();}; +void() zombiek_attc6 =[ $attc6, zombiek_attc7 ] {ai_face();}; +void() zombiek_attc7 =[ $attc7, zombiek_attc8 ] {ai_face();ai_melee();}; +void() zombiek_attc8 =[ $attc8, zombiek_attc9 ] {ai_melee();}; +void() zombiek_attc9 =[ $attc9, zombiek_attc10] {ai_melee();}; +void() zombiek_attc10=[ $attc10, zombiek_attc11] {}; +void() zombiek_attc11=[ $attc11, zombiek_attc12] {}; +void() zombiek_attc12=[ $attc12, zombiek_attc13] {}; +void() zombiek_attc13=[ $attc13, zombiek_attc14] {}; +void() zombiek_attc14=[ $attc14, zombiek_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombiek_melee = +{ + ai_face (); // Turn towards enemy target + walkmove (self.ideal_yaw, 20); + + // Randomly select melee attacks + if (random() < 0.5) zombiek_attb1(); // Stationary over arm swing + else zombiek_attc1(); // Stationary sideways swing +}; + +//============================================================================ +// Jump + melee attack +// Melee Attack 1 - Smash, chop overhead to ground (19->10/11 frames) +//============================================================================ +void() zombiek_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 10 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + } + } + + // Is the zombie knight floating in the air? + if (!checkbottom(self)) { + // Is the zombie knight standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() zombiek_jump1 =[ $atta1, zombiek_jump2 ] {ai_charge(12); + self.jump_flag = time + MONAI_JUMPZOMBTIME; + zombiek_sound(3); // Moan about jumping forward +}; +void() zombiek_jump2 =[ $atta2, zombiek_jump3 ] {ai_charge(16);}; +void() zombiek_jump3 =[ $atta3, zombiek_jump4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPZOMBTIME; + self.touch = zombiek_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * (150 + random() * 50) + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() zombiek_jump4 =[ $atta4, zombiek_jump5 ] {ai_face();}; +void() zombiek_jump5 =[ $atta5, zombiek_jump6 ] {ai_face();}; +void() zombiek_jump6 =[ $atta6, zombiek_jump6 ] {ai_face();}; +void() zombiek_jump7 =[ $atta7, zombiek_jump7 ] {ai_face();}; +void() zombiek_jump8 =[ $atta8, zombiek_jump9 ] {ai_face(); + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + if (!checkbottom(self)) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = zombiek_jump3; + } + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() zombiek_jump15; // Chance of quick animation exit +void() zombiek_jump9 =[ $atta9, zombiek_jump10] {ai_melee();}; +void() zombiek_jump10=[ $atta10, zombiek_jump11] {ai_melee();}; +void() zombiek_jump11=[ $atta11, zombiek_jump12] {}; +void() zombiek_jump12=[ $atta12, zombiek_jump13] { + if (random() < 0.5) self.think = zombiek_jump15;}; // quick recovery +void() zombiek_jump13=[ $atta13, zombiek_jump14] {}; +void() zombiek_jump14=[ $atta14, zombiek_jump16] {}; +void() zombiek_jump15=[ $atta15, zombiek_jump16] {}; +void() zombiek_jump16=[ $atta16, zombiek_jump18] {}; +void() zombiek_jump18=[ $atta18, zombiek_run1 ] {ai_resetangles();}; + +/*====================================================================== + PAIN +========================================================================*/ +void() zombiek_paina1 =[ $paina1, zombiek_paina2 ] {zombiek_sound(4);ai_painforward(8);}; +void() zombiek_paina2 =[ $paina2, zombiek_paina3 ] {ai_painforward(3);}; +void() zombiek_paina3 =[ $paina3, zombiek_paina4 ] {ai_painforward(3);}; +void() zombiek_paina4 =[ $paina4, zombiek_paina5 ] {ai_painforward(3);monster_footstep(FALSE);}; +void() zombiek_paina5 =[ $paina5, zombiek_paina6 ] {ai_painforward(3);}; +void() zombiek_paina6 =[ $paina6, zombiek_paina7 ] {ai_painforward(3);}; +void() zombiek_paina7 =[ $paina7, zombiek_paina8 ] {ai_painforward(3);}; +void() zombiek_paina8 =[ $paina8, zombiek_paina9 ] {ai_painforward(3);}; +void() zombiek_paina9 =[ $paina9, zombiek_paina10 ] {ai_painforward(2);monster_footstep(FALSE);}; +void() zombiek_paina10 =[ $paina10, zombiek_paina11 ] {ai_painforward(1);}; +void() zombiek_paina11 =[ $paina11, zombiek_paina12 ] {ai_painforward(2);}; +void() zombiek_paina12 =[ $paina12, zombiek_run1 ] {ai_painforward(1);self.inpain = 0;}; + +//---------------------------------------------------------------------- +void() zombiek_painb1 =[ $painb1, zombiek_painb2 ] {zombiek_sound(4);ai_painforward(8);}; +void() zombiek_painb2 =[ $painb2, zombiek_painb3 ] {ai_pain(1);}; +void() zombiek_painb3 =[ $painb3, zombiek_painb4 ] {ai_pain(1);}; +void() zombiek_painb4 =[ $painb4, zombiek_painb5 ] {ai_pain(1);}; +void() zombiek_painb5 =[ $painb5, zombiek_painb6 ] {ai_pain(1);}; +void() zombiek_painb6 =[ $painb6, zombiek_painb7 ] {ai_pain(2);}; +void() zombiek_painb7 =[ $painb7, zombiek_painb8 ] {ai_pain(2);}; +void() zombiek_painb8 =[ $painb8, zombiek_painb9 ] {ai_pain(4);}; +void() zombiek_painb9 =[ $painb9, zombiek_painb10 ] {ai_pain(4);}; +void() zombiek_painb10 =[ $painb10, zombiek_painb11 ] {ai_pain(4);}; +void() zombiek_painb11 =[ $painb11, zombiek_painb12 ] {ai_pain(2);monster_footstep(FALSE);}; +void() zombiek_painb12 =[ $painb12, zombiek_painb13 ] {ai_pain(2);}; +void() zombiek_painb13 =[ $painb13, zombiek_painb14 ] {ai_pain(3);}; +void() zombiek_painb14 =[ $painb14, zombiek_painb15 ] {}; +void() zombiek_painb15 =[ $painb15, zombiek_painb16 ] {}; +void() zombiek_painb16 =[ $painb16, zombiek_painb17 ] {}; +void() zombiek_painb17 =[ $painb17, zombiek_painb18 ] {}; +void() zombiek_painb18 =[ $painb18, zombiek_painb19 ] {ai_painforward(3);}; +void() zombiek_painb19 =[ $painb19, zombiek_painb20 ] {ai_painforward(3);}; +void() zombiek_painb20 =[ $painb20, zombiek_painb21 ] {ai_painforward(3);}; +void() zombiek_painb21 =[ $painb21, zombiek_painb22 ] {ai_painforward(3);}; +void() zombiek_painb22 =[ $painb22, zombiek_painb23 ] {ai_painforward(3);}; +void() zombiek_painb23 =[ $painb23, zombiek_painb24 ] {ai_painforward(3);}; +void() zombiek_painb24 =[ $painb24, zombiek_painb25 ] {ai_painforward(3);}; +void() zombiek_painb25 =[ $painb25, zombiek_run1 ] {ai_painforward(3);}; + +//---------------------------------------------------------------------- +void() zombiek_painc1 =[ $painc1, zombiek_painc2 ] {zombiek_sound(4);ai_painforward(8);}; +void() zombiek_painc2 =[ $painc2, zombiek_painc3 ] {ai_painforward(6);}; +void() zombiek_painc3 =[ $painc3, zombiek_painc4 ] {ai_painforward(5);}; +void() zombiek_painc4 =[ $painc4, zombiek_painc5 ] {ai_painforward(7);zombiek_sound(5);}; +void() zombiek_painc5 =[ $painc5, zombiek_painc6 ] {ai_painforward(6);}; +void() zombiek_painc6 =[ $painc6, zombiek_painc7 ] {ai_painforward(3);}; +void() zombiek_painc7 =[ $painc7, zombiek_painc8 ] {ai_painforward(3);}; +void() zombiek_painc8 =[ $painc8, zombiek_painc9 ] {}; +void() zombiek_painc9 =[ $painc9, zombiek_painc10 ] {}; + +// Re-entry point for painD wakeup animation +void() zombiek_painc10 =[ $painc10, zombiek_painc11 ] {}; +void() zombiek_painc11 =[ $painc11, zombiek_painc12 ] {}; +void() zombiek_painc12 =[ $painc12, zombiek_painc13 ] {}; +void() zombiek_painc13 =[ $painc13, zombiek_painc14 ] {}; +void() zombiek_painc14 =[ $painc14, zombiek_painc15 ] {}; +void() zombiek_painc15 =[ $painc15, zombiek_painc16 ] {}; +void() zombiek_painc16 =[ $painc16, zombiek_painc17 ] {}; +void() zombiek_painc17 =[ $painc17, zombiek_painc18 ] {}; +void() zombiek_painc18 =[ $painc18, zombiek_painc19 ] {}; +void() zombiek_painc19 =[ $painc19, zombiek_painc20 ] {monster_footstep(FALSE);}; +void() zombiek_painc20 =[ $painc20, zombiek_painc21 ] {}; +void() zombiek_painc21 =[ $painc21, zombiek_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombiek_paind1 =[ $paind1, zombiek_paind2 ] { + self.inpain = 2; + zombiek_sound(4); + ai_painforward(8); +}; +void() zombiek_paind2 =[ $paind2, zombiek_paind3 ] {ai_painforward(4);}; +void() zombiek_paind3 =[ $paind3, zombiek_paind4 ] {ai_painforward(4);}; +void() zombiek_paind4 =[ $paind4, zombiek_paind5 ] {ai_painforward(4);}; +void() zombiek_paind5 =[ $paind5, zombiek_paind6 ] {ai_painforward(3);}; +void() zombiek_paind6 =[ $paind6, zombiek_paind7 ] {ai_painforward(2);}; +void() zombiek_paind7 =[ $paind7, zombiek_paind8 ] {ai_painforward(2);}; +void() zombiek_paind8 =[ $paind8, zombiek_paind9 ] {}; +void() zombiek_paind9 =[ $paind9, zombiek_paind10 ] {}; +void() zombiek_paind10 =[ $paind10, zombiek_paind11 ] {zombiek_sound(5);}; +void() zombiek_paind11 =[ $paind11, zombiek_paind12 ] {self.solid = SOLID_NOT;}; +void() zombiek_paind12 =[ $paind12, zombiek_paind12 ] {zombiek_onground(MONAI_ZOMBIEUPD);}; + +// Start of get up sequence +void() zombiek_paind13 =[ $paind13, zombiek_paind14 ] {}; +void() zombiek_paind14 =[ $paind14, zombiek_paind15 ] {}; +void() zombiek_paind15 =[ $paind15, zombiek_paind16 ] {}; +void() zombiek_paind16 =[ $paind16, zombiek_paind17 ] {}; +void() zombiek_paind17 =[ $paind17, zombiek_paind18 ] { + monster_footstep(TRUE);ai_pain(1);}; // Scrapping feet sound while standing up +void() zombiek_paind18 =[ $paind18, zombiek_paind19 ] {ai_pain(1);}; +void() zombiek_paind19 =[ $paind19, zombiek_paind20 ] {ai_pain(1);}; +void() zombiek_paind20 =[ $paind20, zombiek_paind21 ] {ai_pain(1);}; +void() zombiek_paind21 =[ $paind21, zombiek_paind22 ] {ai_pain(1);}; +void() zombiek_paind22 =[ $paind22, zombiek_paind23 ] {ai_pain(2);}; +void() zombiek_paind23 =[ $paind23, zombiek_painw10 ] {ai_pain(2);}; +// Originally re-entry to C, need onfloor check +void() zombiek_painw10 =[ $painc10, zombiek_painw11 ] {}; +void() zombiek_painw11 =[ $painc11, zombiek_painw12 ] {}; +void() zombiek_painw12 =[ $painc12, zombiek_painw13 ] {}; +void() zombiek_painw13 =[ $painc13, zombiek_painw14 ] {}; +void() zombiek_painw14 =[ $painc14, zombiek_painw15 ] {}; +void() zombiek_painw15 =[ $painc15, zombiek_painw16 ] {}; +void() zombiek_painw16 =[ $painc16, zombiek_painw17 ] {}; +void() zombiek_painw17 =[ $painc17, zombiek_painw18 ] {}; +void() zombiek_painw18 =[ $painc18, zombiek_painw19 ] {}; +void() zombiek_painw19 =[ $painc19, zombiek_painw20 ] {monster_footstep(FALSE);}; +void() zombiek_painw20 =[ $painc20, zombiek_painw21 ] {}; +void() zombiek_painw21 =[ $painc21, zombiek_run1 ] { + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +//---------------------------------------------------------------------- +void() zombiek_paine1 =[ $paine1, zombiek_paine2 ] { + self.inpain = 2; + zombiek_sound(4); + ai_pain(8); +}; +void() zombiek_paine2 =[ $paine2, zombiek_paine3 ] {ai_pain(4);}; +void() zombiek_paine3 =[ $paine3, zombiek_paine4 ] {ai_pain(3);}; +void() zombiek_paine4 =[ $paine4, zombiek_paine5 ] {ai_pain(3);}; +void() zombiek_paine5 =[ $paine5, zombiek_paine6 ] {ai_pain(3);}; +void() zombiek_paine6 =[ $paine6, zombiek_paine7 ] {ai_pain(2);}; +void() zombiek_paine7 =[ $paine7, zombiek_paine8 ] {ai_pain(2);}; +void() zombiek_paine8 =[ $paine8, zombiek_paine9 ] {}; +void() zombiek_paine9 =[ $paine9, zombiek_paine10 ] {}; +void() zombiek_paine10 =[ $paine10, zombiek_paine11 ] {self.solid = SOLID_NOT;}; +void() zombiek_paine11 =[ $paine11, zombiek_paine12 ] {zombiek_sound(5);}; +void() zombiek_paine12 =[ $paine12, zombiek_paine12 ] {zombiek_onground(MONAI_ZOMBIEUPE);}; + +// Start of get up sequence +void() zombiek_paine13 =[ $paine13, zombiek_paine14 ] { + monster_footstep(TRUE); // Scrapping feet sound while standing up +}; +void() zombiek_paine14 =[ $paine14, zombiek_paine15 ] {}; +void() zombiek_paine15 =[ $paine15, zombiek_paine16 ] {}; +void() zombiek_paine16 =[ $paine16, zombiek_paine17 ] {}; +void() zombiek_paine17 =[ $paine18, zombiek_paine18 ] {}; +void() zombiek_paine18 =[ $paine17, zombiek_paine19 ] {}; +void() zombiek_paine19 =[ $paine19, zombiek_paine20 ] { + self.steptype = FS_TYPEHEAVY; // Heavy clubfoot + monster_footstep(FALSE); + self.steptype = FS_TYPESLOW; // Normal zombie foot +}; +void() zombiek_paine20 =[ $paine20, zombiek_paine21 ] {}; +void() zombiek_paine21 =[ $paine21, zombiek_paine22 ] {}; +void() zombiek_paine22 =[ $paine22, zombiek_paine23 ] {}; +void() zombiek_paine23 =[ $paine23, zombiek_paine24 ] {}; +void() zombiek_paine24 =[ $paine24, zombiek_paine25 ] {}; +void() zombiek_paine25 =[ $paine25, zombiek_paine26 ] {}; +void() zombiek_paine26 =[ $paine26, zombiek_paine27 ] {}; +void() zombiek_paine27 =[ $paine27, zombiek_paine28 ] {ai_painforward(3);}; +void() zombiek_paine28 =[ $paine28, zombiek_paine29 ] {ai_painforward(3);}; +void() zombiek_paine29 =[ $paine29, zombiek_paine30 ] {ai_painforward(3);}; +void() zombiek_paine30 =[ $paine30, zombiek_paine31 ] {ai_painforward(3);}; +void() zombiek_paine31 =[ $paine31, zombiek_run1 ] {ai_painforward(3); + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +/*====================================================================== + ZOMBIE PAIN + * All damage must come through pain function to reset health + * Be careful blocking zombie pain function with pain_finished + * zombies react in 2 ways, minor pain (a,c,d) and full knockdown (b,e) +======================================================================*/ +void(entity inflictor, entity attacker, float take) zombiek_pain = +{ + // Is the zombie in the process of dying? + if (self.deadflag > DEAD_NO) return; + // Always reset health + self.health = self.max_health; + self.attack_elev = targzone(self, attacker); + + // Check for invulnerability frames and shadow axe + if (self.inpain > 0 && self.axhitme == 2) { + self.axhitme = 0; // Reset axe + self.health = self.gibhealth; // Reset Health + Killed (self, attacker); // Gib time + return; + } + else self.axhitme = 0; // Reset axe + + //---------------------------------------------------------------------- + // Pain/damage too low OR down on ground, totally ignore + //---------------------------------------------------------------------- + if (take < MONAI_ZOMBIELOW_DAM || self.inpain == 2) return; + + //---------------------------------------------------------------------- + // Damage 29-60, drop straight away to ground (SSG, Quad NG) + // This has to be a single large hit over 0.1 frame + //---------------------------------------------------------------------- + if (take > MONAI_ZOMBIEHGH_DAM) { + zombiek_knockdown(); + return; + } + + //---------------------------------------------------------------------- + // Projectile shotguns pellets don't all hit at same time + // they accumulate over time and can distort damage values + // Need to block damage over time to detect second hit + // Cannot use pain_finished because it blocks the pain function + // and the health needs to be reset all the time + // Using 'lefty' because zombiek only use it for idle animations + if (self.lefty < time && self.inpain == 1) { + // Second hit, drop to ground + zombiek_knockdown(); + return; + } + + //---------------------------------------------------------------------- + // Damage 9-25 random pain animation (random chance of knockdown) + //---------------------------------------------------------------------- + if (self.inpain) return; // Already in minor pain + self.inpain = 1; // Minor pain active + self.lefty = time + 0.5; // Wait for second hit + self.lip = random(); + if (self.lip < 0.25) zombiek_paina1 (); // 12 frames (drag foot) + else if (self.lip < 0.5) zombiek_knockdown(); // ON THE GROUND + else if (self.lip < 0.75 && self.attack_elev == TARGET_FRONT) + zombiek_painb1 (); // 25 frames (flail arms backwards) + else zombiek_painc1 (); // 21 frames (fall to knees) +}; + +/*============================================================================= + ZOMBIE WAKEUP (check if can get up) +=============================================================================*/ +void() zombiek_wakeup = { + if (self.gibbed) return; // Do nothing dead + + self.use = SUB_Null; // No more using at this point + if (!self.enemy) FindTarget(); // If no enemy, look around? + + // Make sure bounding box is correct, if blocked can be set 0,0,0 + setsize (self, self.bbmins, self.bbmaxs); + // Turn monster collision on and test if can walk forward + self.solid = SOLID_SLIDEBOX; + if (!walkmove (0, 0)) + { + self.inpain = 2; // On ground + self.nextthink = time + 0.1; // Keep checking + self.think = self.th_wakeup; // Same function + self.solid = SOLID_NOT; // No world interaction yet + // Check if something has been blocking the zombie from getting up + // This is a check for weird world/bmodel geo or monster/players + // standing on zombies while on the ground trying to get up! + self.count = self.count + 1; + if (self.count > MONAI_ZOMBGRDBLOCK) { + self.health = self.gibhealth; // Gib time + Killed(self, self); // Register death + return; + } + } + else { + self.bodyonflr = string_null; // Body is chop proof! + self.inpain = 2; // Animation not finished + zombiek_sound(6); // Wake up sound + self.nextthink = time + 0.1; + self.use = monster_use; // Just in case interruption + if (self.zombieflr == MONAI_ZOMBIEUPD) self.think = zombiek_paind13; + else self.think = zombiek_paine13; + } +}; + +//---------------------------------------------------------------------- +// Puts the zombie on the floor with a random Yaw rotation +// IF frameno = MONAI_ZOMBIEFLR Setup on floor with use trigger +// ELSE setup next think timer and wait for opportunity to get back up +//---------------------------------------------------------------------- +void(float frameno) zombiek_onground = { + self.health = self.max_health; // reset health + self.inpain = 2; // Lying on floor, no pain + self.count = 0; // Reset get up tries + self.solid = SOLID_NOT; // No world interaction + self.bodyonflr = MON_ONFLR; // mark body for the chop + + // Does the zombie start on the ground? + if (frameno == MONAI_ZOMBIEFLR) { + // Do nothing else while on the floor + self.nextthink = self.pausetime; + self.think = SUB_Null; + + // Check for spawning onfloor orientation flag + // aflag = 1 Forward = 2 Backward + if (self.aflag < 1 || self.aflag > 2) { + if (random() < 0.5) self.aflag = 1; + else self.aflag = 2; + } + + // Pick random starting pose + if (self.aflag == 1) { + self.zombieflr = MONAI_ZOMBIEUPD; + self.frame = $paind12; + } + else { + self.zombieflr = MONAI_ZOMBIEUPE; + self.frame = $paine12; + } + // If no angle set, Random fall direction + if (self.angles_y < 1) self.angles_y = rint(random()*359); + self.use = self.th_wakeup; + self.fixangle = TRUE; + // Reset onspawn fall down angle (only used once) + self.aflag = 0; + } + else { + // Zombie fall down function defines wake up pose + self.zombieflr = frameno; + // Keep zombies on the ground and check again later + self.nextthink = self.nextthink + MONAI_ZOMBGRDTIMER; + self.think = self.th_wakeup; + } +}; + +//---------------------------------------------------------------------- +// Puts the zombie on the floor based on the angle of attack +// 270-360, 360-90 : Fall forward (3 checks Left, middle, right) +// 180-270, 90-180 : Fall backward +//---------------------------------------------------------------------- +void() zombiek_knockdown = +{ + local float enemy_ang, comp_ang; + + // Work out which direction the damage came from (enemy) + enemy_ang = targangle(self, self.enemy, 0, FALSE); + comp_ang = anglemod(enemy_ang + 45); // Shift clockwise (front cone) + + //if (self.debuglvl) { + // dprint("Self ("); dprint(ftos(self.angles_y)); + // dprint(") Targ ("); dprint(ftos(enemy_ang)); + // dprint(") Comp ("); dprint(ftos(comp_ang)); + // dprint(")\n"); + //} + + // NORTH WEST : 270-315 (fall BACKWARD, reverse force) + if (comp_ang > 315) { + //if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the UPPER LEFT\n"); + self.ideal_yaw = anglemod(enemy_ang + 180); + ChangeYaw (); + zombiek_paine1(); + } + // SOUTH WEST : 225-270 (fall FORWARD, side force +45) + else if (comp_ang > 270) { + //if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the LOWER LEFT\n"); + self.ideal_yaw = comp_ang; + ChangeYaw (); + zombiek_paind1(); + } + // SOUTH : 135-225 (fall FORWARD) + else if (comp_ang > 180) { + //if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the BACK\n"); + self.ideal_yaw = self.angles_y; // Fix for ai_painforward + ChangeYaw (); + zombiek_paind1(); + } + // SOUTH EAST : 90-135 (fall FORWARD, side force -45) + else if (comp_ang > 135) { + //if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the LOWER RIGHT\n"); + self.ideal_yaw = anglemod(enemy_ang+315); + ChangeYaw (); + zombiek_paind1(); + } + // NORTH EAST : 45-90 (fall BACKWARD, reverse force) + else if (comp_ang > 90) { + //if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the UPPER RIGHT\n"); + self.ideal_yaw = anglemod(enemy_ang + 180); + ChangeYaw (); + zombiek_paine1(); + } + // NORTH : 315-45 (fall BACKWARD) + else { + //if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the FRONT\n"); + zombiek_paine1(); + } +}; + +/*============================================================================ + All sounds used + 2 = strutting the stuff (walking) + 3 = running (in slow motion) + 4 = all pain routines (zombiek_paina1, _painb1, _painc1, _paind1) + 5 = its a knockout! + 6 = get up and moan about it + 7 = sword swipe +============================================================================*/ +void(float type) zombiek_sound = +{ + // check for gibbed or idle sound block + if (self.health < 1) return; + if (self.spawnflags & MON_SPAWN_NOIDLE && type < 3) return; + + // Random sound check + self.lip = random(); + if (type == 2 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + } + else if (type == 3 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + if (self.lip > 0.8) sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 4) { + if (self.lip < 0.25) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } + else if (type == 5) { + sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + } + else if (type == 6) { + if (self.lip < 0.5) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 7) { + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); + } +}; + +//============================================================================ +void() zombiek_die = +{ + self.health = self.gibhealth; // Force gib + monster_death_precheck(); +}; + +/*====================================================================== + QUAKED monster_zombiek (1 0 0) (-16 -16 -24) (16 16 32) Ambush x FLOOR +======================================================================*/ +void() monster_zombiek = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_zombiek.mdl"; // Zombie Knight + self.headmdl = "progs/h_zombiek.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + + self.gib1mdl = "progs/w_zombiesword.mdl"; // Unique sword + self.gib1sound = GIB_IMPACT_METALA; + precache_model (self.gib1mdl); + + precache_sound ("zombie/z_idle.wav"); // Idle A + precache_sound ("zombie/z_idle1.wav"); // Idle B + + self.pain_sound = "zombie/z_pain.wav"; + self.pain_sound2 = "zombie/z_pain1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("zombie/z_fall.wav"); // Impact - floor + precache_sound ("zombie/z_gib.wav"); // Death sound + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // New sight sound, mixture of knight + zombie + self.sight_sound = "zombie/zk_sight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + self.skin = self.exactskin = self.gib1skin = 1; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.health = 60; // Basic health (cannot override) + self.gibhealth = -60; // Gib value, not used + self.gibbed = FALSE; // In one piece + self.pain_flinch = MONAI_ZOMBIEHGH_DAM; + self.steptype = FS_TYPESLOW; // Small leg + self.altsteptype = FS_TYPEDRAG; // Clubfoot + self.pain_timeout = -5; // Always go into pain (health reset) + self.inpain = 0; // Zombie starts with no pain lock + self.count = 0; // Reset get up timer + self.deathstring = " was cornered by a Zombie Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = ZombiekCheckAttack; + self.th_stand = zombiek_stand1; + self.th_walk = zombiek_walk1; + self.th_run = zombiek_run1; + self.th_melee = zombiek_melee; // two melee attacks (stationary) + self.th_jump = zombiek_jump1; // Leap attack + self.th_jumpexit = zombiek_jump9; // Exit animation for jump + self.th_pain = zombiek_pain; + self.th_die = zombiek_die; + self.th_wakeup = zombiek_wakeup; // Get off floor + + self.classtype = CT_MONZOMBIEK; + self.classgroup = CG_ZOMBIE; // One big happy zombie family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_arcane/monsters.qc b/QC_other/QC_arcane/monsters.qc new file mode 100644 index 00000000..42922d47 --- /dev/null +++ b/QC_other/QC_arcane/monsters.qc @@ -0,0 +1,1147 @@ +/*====================================================================== + MONSTER FUNCTIONS +======================================================================*/ + +float MONAI_ZOMBIEFLR = 1; // start on floor +float MONAI_ZOMBIEUPB = 2; // zombie painb - 28 frames (9 = on ground) +float MONAI_ZOMBIEUPD = 4; // knight paind - 35 frames (12 = on ground) +float MONAI_ZOMBIEUPE = 8; // knight + zombie paine - 30 frames (12 = on ground) +float MONAI_ZOMBGRDTIMER = 2; // Zombie onground timer (between checking) +float MONAI_ZOMBGRDBLOCK = 300; // 0.1 * 300 = 30s +float MONAI_ZOMBIELOW_DAM = 9; // Pain threshold for animations +float MONAI_ZOMBIEHGH_DAM = 28; // Has to be higher than SG (7x4) + +void(float frameno) zombie_onground; +void(float frameno) zombiek_onground; + +//---------------------------------------------------------------------- +// Pre-defined bounding boxes for monsters +// Use 'bboxtype' to specify one of these +//---------------------------------------------------------------------- +float BBOX_TINY = 1; // -16 -16 -24, 16 16 16 +float BBOX_SHORT = 4; // -16 -16 -24, 16 16 32 +float BBOX_TALL = 5; // -16 -16 -24, 16 16 40 +float BBOX_WIDE = 7; // -24 -24 -24, 24 24 40 +float BBOX_GIANT = 8; // -24 -24 -24, 24 24 64 +float BBOX_MASSIVE = 10; // -32 -32 -24, 32 32 64 +float BBOX_GOLEM = 15; // -24 -24 -24, 24 24 72 +float BBOX_DOG = 20; // -20 -20 -24, 20 20 16 +float BBOX_FISH = 25; // -16 -16 -24, 16 16 24 +float BBOX_FISHS = 26; // -12 -12 -16, 12 12 16 +float BBOX_EEL = 27; // -16 -16 -16, 16 16 16 +float BBOX_HYDRA = 30; // -20 -20 -16, 20 20 16 +float BBOX_CUSTOM = 99; // Custom size set already + +/*====================================================================== + monster_use - trigger/make angry +======================================================================*/ +void() monster_use = +{ + // Busy with another enemy or dead? + if (self.enemy) return; + if (self.health < 1) return; + + // Spiders/Vorelings can be setup on the ceilings + // need to trigger/drop instead them before anything else + if (self.classtype == CT_MONSPIDER && self.spawnflags & MON_SPIDER_CEILING || + self.classtype == CT_MONSWAMPLING && self.spawnflags & MON_SWAMPLING_CEILING || + self.classtype == CT_MONVORELING && self.spawnflags & MON_VORELING_CEILING) { + // Start with activator as enemy + self.enemy = activator; + // Work through exceptions + if (activator.classtype != CT_PLAYER) self.enemy = world; + if (activator.items & IT_INVISIBILITY) self.enemy = world; + if (activator.flags & FL_NOTARGET) self.enemy = world; + // Drop from ceiling + self.th_run(); + return; + } + + // Player exceptions + if (activator.classtype != CT_PLAYER) return; + if (activator.items & IT_INVISIBILITY) return; + if (activator.flags & FL_NOTARGET) return; + + // Monster angry! Hunt enemy!?! + self.enemy = activator; + + // If wakeup trigger setup do not wait, special animation + // This is really designed to go with a breakable trigger + if (self.wakeuptrigger && self.th_wakeup) { + self.wakeuptrigger = FALSE; // Trigger no longer needed, reset + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + self.th_wakeup(); + } + else { + // delay reaction (wait one frame) so if the monster + // has been teleported the sound is heard correctly + self.nextthink = time + 0.1; + self.think = FoundTarget; + } +}; + +/*====================================================================== + liquid_check + for some reason monsters never take damage from liquids + This functions checks for liquid content and applies a + modifier damage (they die too slow otherwise) + * If a monster is in liquid there is often no way out! + * Moves the content check to the monsters feet (shallow liquid) +======================================================================*/ +void() monster_liquid_check = +{ + local float monster_dmg; + local vector monster_feet; + + // This function is for monsters only (high damage) + if (self.no_liquiddmg) return; + if (query_configflag(SVR_LIQDAM)) return; + if ( !(self.flags & FL_MONSTER)) return; + if (self.health < 1) return; + if (self.liquidcheck > time) return; + + // Reset liquid damage timer + self.liquidcheck = time + LIQUID_TIMER; + + // Check for liquid at monsters feet (bottom of bounding box) + monster_feet = self.origin; + monster_feet_z = monster_feet_z + self.mins_z; + self.liquidbase = pointcontents(monster_feet); + + // Setup standard damage for liquid types + if (self.liquidbase == CONTENT_SLIME) monster_dmg = SLIME_DAMAGE * MON_MULTIPLIER; + else if (self.liquidbase == CONTENT_LAVA) monster_dmg = LAVA_DAMAGE * MON_MULTIPLIER; + else return; + + // Gib monster if about to die + if (self.health < monster_dmg + 5) { + monster_dmg = self.health + 5; + self.gibondeath = 1; + } + + // Liquid damage + self.pain_finished = 0; // Always pain + T_Damage (self, world, world, monster_dmg, DAMARMOR); +}; + +/*====================================================================== + monster_idle_sound + - use one routine so more stuff can be added easily + - easier to add any exceptions this way + - zombies have their own unique idle routine + - tarby added using sight sound +======================================================================*/ +void() monster_idle_sound = +{ + // No monsters, dead and timer not reset? + if ( !(self.flags & FL_MONSTER) ) return; + if (self.health < 1) return; + if (self.idletimer > time) return; + if (self.spawnflags & MON_SPAWN_NOIDLE) return; + + self.idletimer = time + 5 + (random() * 3); + if (!self.idlemoreoften && random() > MON_IDLE_SOUND) return; + + // Is the monster active in combat (special idle sound) + if (self.enemy && self.idle_soundcom != "") { + if (self.idle_soundcom2 != "") { + if (random() < 0.5) sound (self, CHAN_VOICE, self.idle_soundcom, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_soundcom2, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.idle_soundcom, 1, ATTN_NORM); + } + else { + // setup each monster with unique idle sounds (easier and quicker) + if (self.idle_sound2 != "") { + if (random() < 0.5) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_sound2, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + monster_sightsound + - Switched sound channel to CHAN_BODY so death always stops it + - Randomnly get sound file cut off using voice channel +======================================================================*/ +void() monster_sightsound = +{ + local float rsnd; + + // No monsters, dead and timer not reset? + if ( !(self.flags & FL_MONSTER) ) return; + if (self.health < 1) return; + if (!self.sight_sound) return; + if (self.spawnflags & MON_SPAWN_NOSIGHT) return; + if (intermission_running > 0) return; // intermission or finale + + // Only do a sight sound when necessary, otherwise it overlaps and gets messy + if (self.sight_timeout < time) { + self.sight_timeout = time + MON_SIGHTSOUND; // Use pre-defined reset values + + rsnd = random(); + // The id enforcer has four sight sounds, which is a bit excessive + // Check through sight strings to find out quantity + if (self.sight_count == 2) { + if (rsnd < 0.5) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.sight_sound2, 1, ATTN_NORM); + } + else if (self.sight_count == 3) { + if (rsnd < 0.3) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else if (rsnd < 0.6) sound (self, CHAN_BODY, self.sight_sound2, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.sight_sound3, 1, ATTN_NORM); + } + else if (self.sight_count == 4) { + if (rsnd < 0.25) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else if (rsnd < 0.5) sound (self, CHAN_BODY, self.sight_sound2, 1, ATTN_NORM); + else if (rsnd < 0.75) sound (self, CHAN_BODY, self.sight_sound3, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.sight_sound4, 1, ATTN_NORM); + } + // setup each monster with unique sight sounds (easier and quicker) + else sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + monster_footstep + This function will play a footstep sound + * Types : Slow, Drag, Light, Medium, Heavy, Large + * called from animation blocks to sync with sound +======================================================================*/ +void(float altfoot) monster_footstep = +{ + local float footstep, footstepnext, footvol; + local string footstepwav; + + if (query_configflag(SVR_FOOTSTEP)) return; // Default(0) = ON + if (self.health < 1) return; + if (self.movetype == MOVETYPE_NOCLIP) return; + if (self.watertype < CONTENT_EMPTY) return; + if (self.steptype == FS_FLYING) return; + + // Wide volume range for player + if (self.flags & FL_CLIENT) footvol = 0.2 + random()*0.6; + // feetsteps need to be louder during combat + else if (self.enemy) footvol = 1; + // Dogs have too many legs making noise, reduce volume + else if (self.classtype == CT_MONDOG) footvol = 0.2 + random()*0.6; + // Slight random volume level out of combat + else footvol = 0.7 + random()*0.3; + + // Decide which foot sound to play, long live clubfoot! + if (altfoot) { + // Switch to ALTernative foot sound + footstep = self.altsteptype; + if (self.altsteplast < 1) self.altsteplast = rint(1 + random()*4); + + // Increase footstep sound index by one + footstepnext = rint(self.altsteplast + 1); + // Every loop around, randomly reset + if (footstepnext > 5) footstepnext = rint(1 + random()*4); + self.altsteplast = footstepnext; + } + else { + // Setup last footstep sound + footstep = self.steptype; + if (self.steplast < 1) self.steplast = rint(1 + random()*4); + + // Player is randomly selected footsteps + if (self.flags & FL_CLIENT) { + // Quake random function is not really super random + // Probably a bad seed starting point for function + // Use 3 randoms to create something more random! + footstepnext = rint(self.steplast + random() + random() + random()); + if (footstepnext > 5) footstepnext = footstepnext - 5; + } + else { + // Increase footstep sound index by one + footstepnext = rint(self.steplast + 1); + // Every loop around, randomly reset + if (footstepnext > 5) footstepnext = rint(1 + random()*4); + } + + // update last footstep index + self.steplast = footstepnext; + } + + // Cycle through all footstep types and work out correct sound file + // All footstep types reduced down to 5 possible choices (speed things up) + // Could store sound files with entity and cycle round quicker, req more memory + // re-checking the sound file every footstep is costly on time + // Luckly most footstep sounds are several frames apart (too noisy as well) + if (footstep == FS_TYPELIGHT) { + // Light heal/ paw sound + if (footstepnext < 2) footstepwav = SOUND_FS_LIGHT1; + else if (footstepnext < 3) footstepwav = SOUND_FS_LIGHT2; + else if (footstepnext < 4) footstepwav = SOUND_FS_LIGHT3; + else if (footstepnext < 5) footstepwav = SOUND_FS_LIGHT4; + else footstepwav = SOUND_FS_LIGHT5; + } + else if (footstep == FS_TYPEMEDIUM) { + // Average foot/boot sound + if (footstepnext < 2) footstepwav = SOUND_FS_MEDIUM1; + else if (footstepnext < 3) footstepwav = SOUND_FS_MEDIUM2; + else if (footstepnext < 4) footstepwav = SOUND_FS_MEDIUM3; + else if (footstepnext < 5) footstepwav = SOUND_FS_MEDIUM4; + else footstepwav = SOUND_FS_MEDIUM5; + } + else if (footstep == FS_TYPEHEAVY) { + // Heavy foot with slight echo + if (footstepnext < 2) footstepwav = SOUND_FS_HEAVY1; + else if (footstepnext < 3) footstepwav = SOUND_FS_HEAVY2; + else if (footstepnext < 4) footstepwav = SOUND_FS_HEAVY3; + else if (footstepnext < 5) footstepwav = SOUND_FS_HEAVY4; + else footstepwav = SOUND_FS_HEAVY5; + } + else if (footstep == FS_TYPELARGE) { + // Large foot with large echo + if (footstepnext < 2) footstepwav = SOUND_FS_LARGE1; + else if (footstepnext < 3) footstepwav = SOUND_FS_LARGE2; + else if (footstepnext < 4) footstepwav = SOUND_FS_LARGE3; + else if (footstepnext < 5) footstepwav = SOUND_FS_LARGE4; + else footstepwav = SOUND_FS_LARGE5; + } + else if (footstep == FS_TYPEGIANT) { + // Giant foot with long echo + if (footstepnext < 2) footstepwav = SOUND_FS_GIANT1; + else if (footstepnext < 3) footstepwav = SOUND_FS_GIANT2; + else if (footstepnext < 4) footstepwav = SOUND_FS_GIANT3; + else if (footstepnext < 5) footstepwav = SOUND_FS_GIANT4; + else footstepwav = SOUND_FS_GIANT5; + } + else if (footstep == FS_TYPECUSTOM) { + // Custom feet sounds (usually boss type creatures) + if (footstepnext < 2) footstepwav = self.stepc1; + else if (footstepnext < 3) footstepwav = self.stepc2; + else if (footstepnext < 4) footstepwav = self.stepc3; + else if (footstepnext < 5) footstepwav = self.stepc4; + else footstepwav = self.stepc5; + } + else if (footstep == FS_TYPEDRAG) { + // Small scraping foot on ground + if (footstepnext < 2) footstepwav = SOUND_FS_DRAG1; + else if (footstepnext < 3) footstepwav = SOUND_FS_DRAG2; + else if (footstepnext < 4) footstepwav = SOUND_FS_DRAG3; + else if (footstepnext < 5) footstepwav = SOUND_FS_DRAG4; + else footstepwav = SOUND_FS_DRAG5; + } + // FS_TYPESLOW (default) + else { + // Souless shoe foot sound + if (footstepnext < 2) footstepwav = SOUND_FS_SLOW1; + else if (footstepnext < 3) footstepwav = SOUND_FS_SLOW2; + else if (footstepnext < 4) footstepwav = SOUND_FS_SLOW3; + else if (footstepnext < 5) footstepwav = SOUND_FS_SLOW4; + else footstepwav = SOUND_FS_SLOW5; + } + + // Play the sound (large feet need to be heard further away) + if (footstep == FS_TYPELARGE) sound (self, CHAN_FEET, footstepwav, footvol, ATTN_FEETL); + else sound (self, CHAN_FEET, footstepwav, footvol, ATTN_FEET); +}; + +//====================================================================== +// PRE/POST CHECK conditions for monster death +//====================================================================== +void() monster_death_precheck = +{ + if (self.flags & FL_MONSTER) { + // Check for minion monster and update parent counters + if (self.owner.minion_active) update_minioncount(self.owner, -1); + + self.deadflag = DEAD_DEAD; // Its dead jim! + self.effects = 0; // Remove effects on death + self.think = SUB_Null; // No more thinking/animation + self.nextthink = -1; // Never fire think + + monster_check_gib(); // Check for gib state + } +}; + +//---------------------------------------------------------------------- +void() monster_fade = +{ + // Make sure model/entity is removed + self.height = 0; + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() monster_death_postcheck = +{ + local float bodytimer; + + self.blockudeath = TRUE; // Body is dead, no human death noise + if (!self.gibbed) self.bodyonflr = MON_ONFLR; + + // Allow for the dead body/head to touch triggers (void/hurt) + setorigin(self, self.origin); + self.solid = SOLID_TRIGGER; + self.touch = SUB_Null; + + // Check for global or individual body fading mechanic + if (self.bodyfadeaway > 0 || map_bodyfadeaway > 0) { + if (map_bodyfadeaway > 0) bodytimer = map_bodyfadeaway; + else bodytimer = self.bodyfadeaway; + self.pain_finished = time + 10 + random() * bodytimer; + } + // Body sticks around + else self.pain_finished = time + LARGE_TIMER; +}; + +//---------------------------------------------------------------------- +void() monster_deadbody_check = +{ + // Remove/Fade out body if timer is finished + if (self.pain_finished < time) { monster_fade(); return; } + // Exit condition, body no longer has any interaction + if (self.deadflag == DEAD_FINISHED) return; + + // Check for deadflag first, if touched something this will be changed + if (self.deadflag == DEAD_REMOVE || self.deadflag == DEAD_EXPLODE + && self.gibbed == FALSE) { + // make sure touch,solid and body axe interaction are off + self.touch = SUB_Null; + self.solid = SOLID_NOT; + self.bodyonflr = ""; + self.gibhealth = TRUE; + // Only two options available, gib explode or remove + if (self.deadflag == DEAD_EXPLODE) self.think = monster_ThrowGib; + // Replace animation frame group think function + else self.think = SUB_Remove; + self.nextthink = time + 0.1; + // Prevent this function from running again + self.deadflag = DEAD_FINISHED; + } + else { + // Check global map variable first (default = off) + // Check floor below dead body (global function) + if (map_bodyflrcheck == TRUE) + ent_floorcheck(self, FLOOR_TRACE_MONSTER); + + // Keep checking for dead body/head conditions + self.think = monster_deadbody_check; + self.nextthink = time + 0.1; + } +}; + +/*====================================================================== + monster_death_use + - When a mosnter dies, it fires all of its targets with the current + enemy as activator. +======================================================================*/ +void() monster_death_use = +{ + // fall to ground or stop swimming + if (self.flags & FL_FLY) self.flags = self.flags - FL_FLY; + if (self.flags & FL_SWIM) self.flags = self.flags - FL_SWIM; + + // Always use a deathtarget if one defined + if (self.deathtarget != "") { + // Validate deathtarget exists before firing it + self.movelast = find(world, targetname, self.deathtarget); + // Deathtarget valid, switch around and fire targets + if (self.movelast) self.target = self.deathtarget; + } + + // Is there no target defined? + if (self.target == "") return; + + activator = self.enemy; + SUB_UseTargets (); +}; + +/*====================================================================== + monster_paincheck + - Tests all pain conditions and returns what to do + * 0 = Nothing + * 1 = Sound + Animation + * 2 = Sound + Long Animation + * 3 = Sound ONLY +======================================================================*/ +void(entity attacker, float damage) monster_pain_check = +{ + self.pain_check = 0; // Reset pain check + + // already dying, don't go into pain frame + if (self.health < 1) self.pain_check = 0; + // The new axe forces monsters into long pain animations (if they exist) + else if (attacker.moditems & IT_UPGRADE_AXE && self.axhitme > 0 && self.pain_longanim) self.pain_check = 2; + // always go into pain frame if it has been a while (first hit = pain) + else if (time - self.pain_finstate > PAIN_ALWAY) self.pain_check = 1; + // Dangerous liquids should kill the monster and keeping them in + // constant pain animations which makes them look better than doing nothing! + else if (self.liquidbase == CONTENT_SLIME || self.liquidbase == CONTENT_LAVA) self.pain_check = 1; + // If being attacked by a world object (shooter, electricity, bmodel) in pain + else if (attacker == world) self.pain_check = 1; + // Random chance to flinch and not ignore the pain (play sound only) + else if (random()* self.pain_flinch > damage ) self.pain_check = 3; + // DEFAULT : pain animation + sound (last condition) + else self.pain_check = 1; +}; + +/*====================================================================== + monster_targets (second part of setup function) + - Checks for any targets to get angry at or stand/walk around +======================================================================*/ +void() monster_targets = +{ + // Reset everything first + self.enemy = self.goalentity = self.movetarget = world; + + //---------------------------------------------------------------------- + // * Monsters can spawn angry at the player/activator + // * the target key can point to a path_corner + // * If the target key points at another monster they will infight + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SPAWN_ANGRY || self.angrytarget) { + // Check if the activator is a player? if not find a player + if (activator.flags & FL_CLIENT) self.enemy = activator; + else self.enemy = checkclient (); + + // Double check enemy is player and has notarget or wearing RoS? + if (self.enemy.flags & FL_CLIENT) { + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + } + // If the activator not a player, reset to world + // Cannot get angry at triggers, use angrytarget for infighting + else self.enemy = world; + + // If an alternative angry target defined, find it and attack! + if (self.angrytarget) { + self.oldenemy = find(world, targetname, self.angrytarget); + // Is the attack target a monster and spawned/active (take damage) + if (self.oldenemy.flags & FL_MONSTER && self.oldenemy.takedamage != DAMAGE_NO) + self.enemy = self.oldenemy; + } + + // Check the enemy is a player/monster and alive + if (self.enemy.flags & (FL_CLIENT | FL_MONSTER) && self.enemy.health > 0) { + self.nextthink = time + 0.1; + self.think = FoundTarget; + monster_sightsound (); // Wake up sound + return; + } + } + else { + // If the monster has a target check if path_corner or something to attack? + // Do nothing with patrol paths if spawning angry with the player + if (self.target != "") { + self.movetarget = find(world, targetname, self.target); + // Cannot chase a target if setup as a turret + if (self.movetarget && self.movespeed != -1) { + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_walk; + return; + } + } + } + } + + // no angrytarget, enemy or path corner, stand around waiting + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // Stand around +}; + +/*====================================================================== + monster_setup + - Setup monster ready for action +======================================================================*/ +void() monster_spawn = +{ + //---------------------------------------------------------------------- + // Check for Axe / Shotgun / LG upgrade monster spawn exceptions? + if (self.upgrade_axe || self.upgrade_ssg || self.upgrade_lg) { + // Has ANY player (server test not individual) + // picked up the relevant upgrade weapons? + if (self.upgrade_axe && !query_configflag(SVR_UPDAXE) ) return; + if (self.upgrade_ssg && !query_configflag(SVR_UPDSSG) ) return; + if (self.upgrade_lg && !query_configflag(SVR_UPDLG) ) return; + + // Update monster count (not added to monster count until spawned) + total_monsters = total_monsters + 1; + update_hud_totals(HUD_MONSTERS); + } + + //---------------------------------------------------------------------- + // Check if the monster can spawn without telefragging something + if (self.spawnnotelefrag > 0) { + // Switch on world interaction + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + // restore model/bbox to get world collision + setmodel(self, self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + // reset origin, just in case been moved since last + setorigin(self, self.oldorigin); + + // Make sure movement flag types are correct + if (self.classmove == MON_MOVEFLY ) + self.flags = self.flags | FL_FLY; + else if (self.classmove == MON_MOVESWIM ) + self.flags = self.flags | FL_SWIM; + + // Can the monster walk without collision? + if (!walkmove (0, 0)) { + dprint("BLOCKED "); dprint(self.classname); dprint(" "); + // Switch off monster and wait again + self.solid = SOLID_NOT; + setmodel(self,""); + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + self.think = monster_spawn; + self.nextthink = time + 0.1 + random()*0.5; + return; + } + else { + // make sure monster is not displayed yet + // might have a nosight check to do + self.solid = SOLID_NOT; + setmodel(self,""); + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + } + } + + //---------------------------------------------------------------------- + // Check for spawnnosight conditions + if (self.spawnnosight > 0) { + // Setup maximum time limit for spawning regardless + if (self.attack_finished == FALSE) { + // Default is 30s (check for override condition first) + if (self.spawnnosighttime < 1) self.spawnnosighttime = 30; + self.attack_finished = time + self.spawnnosighttime; + } + + // Reset sight condition first and find client in PVS + self.lefty = FALSE; + self.oldenemy = checkclient(); + // Did the client PVS check return an entity? + if (self.oldenemy) { + // is the client a player? + if (self.oldenemy.flags & FL_CLIENT) { + // Check if the player can be seen? + enemy_vis = visible(self.oldenemy); + if (enemy_vis) self.lefty = TRUE; + // Check for an insight spawn distance + if (self.spawnnosight > 1) { + // Find distance (3d vector distance) + self.enemydist = range_distance(self.oldenemy, FALSE); + // check for player being too close for spawn + if (self.enemydist > self.spawnnosight) + self.lefty = FALSE; + } + } + // Checks for notarget/inv player conditions + // disabled - not really necessary as a spawn condition + //if (self.oldenemy.flags & FL_NOTARGET) self.lefty = FALSE; + //if (self.oldenemy.items & IT_INVISIBILITY) self.lefty = FALSE; + } + + // Can the player see the spawn location? wait instead + if (self.lefty == TRUE && self.attack_finished > time) { + self.think = monster_spawn; + self.nextthink = time + 0.1; + return; + } + } + + //---------------------------------------------------------------------- + // Time to finally spawn the monster!?! All conditions met! + + if (self.think1) self.use = self.think1; // different use function? + else self.use = monster_use; // default trigger event + self.solid = SOLID_SLIDEBOX; // Standard monster movement + self.movetype = MOVETYPE_STEP; // Standard monster movement + setmodel(self, self.mdl); // Setup model + self.skin = self.skin_override; // Restore any skins + self.frame = self.frame_override; // Restore any frames + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + // Check for delay spawn monster count + if (self.delaymonstercount) { + // Reset both monster count conditions + self.nomonstercount = self.delaymonstercount = 0; + total_monsters = total_monsters + 1; + update_hud_totals(HUD_MONSTERS); + } + + // Restore any effect flags settings (various dlight glows) + if (self.savedeffects > 0) self.effects = self.savedeffects; + + // Should grenades bounce off the body? + if (self.bouncegrenade) self.takedamage = DAMAGE_YES; + else self.takedamage = DAMAGE_AIM; // Can receive damage + + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + if (!self.pain_flinch) self.pain_flinch = self.health; + if (!self.switchoverride) self.switchoverride = 1; + + // Double check that all ammo resistance are within range + Resist_CheckRange(self); + + // Check for tether system (special target field) + setup_tethersystem(); + + // Long time before first idle sound (except scorpions!) + if (self.idletimer < 1) { + if (self.classtype == CT_MONSCORPION) self.idletimer = time + 0.1 + random(); + else self.idletimer = time + 4 + (random() * 4); + } + + // Reset all enemy tracking entities + if (!self.enemy) self.enemy = self.movetarget = self.goalentity = world; + self.pausetime = LARGE_TIMER; + + // Setup pain tolerence level based on current skill level + if (!self.pain_timeout) self.pain_timeout = 1; // Default + if (skill == SKILL_HARD) self.pain_timeout = self.pain_timeout + 1; + if (skill == SKILL_NIGHTMARE) self.pain_timeout = self.pain_timeout + 3; + + //---------------------------------------------------------------------- + // Setup different skin options + //---------------------------------------------------------------------- + if (self.exactskin > 0) self.skin = rint(self.exactskin); + else if (self.randomskin > 1) self.skin = rint(random()*(self.randomskin-1)); + if (self.skin < 0) self.skin = 0; // Double check no negatives + + //---------------------------------------------------------------------- + self.ideal_yaw = self.angles * '0 1 0'; + if (self.classmove == MON_MOVEWALK ) { // Walking Monsters + if (!self.yaw_speed) self.yaw_speed = 20; + } + else if (self.classmove == MON_MOVEFLY ) { // Flying Monsters + if (!self.yaw_speed) self.yaw_speed = 15; + self.flags = self.flags | FL_FLY; + } + else if (self.classmove == MON_MOVESWIM ) { // Swimming Monsters + if (!self.yaw_speed) self.yaw_speed = 10; + self.flags = self.flags | FL_SWIM; + } + + // Not all bounding boxes extend up very high, make sure the view_ofs + // is relevant to where the top of the bounding box is + if (self.view_ofs_z == 0) { + if (self.maxs_z <= MON_VIEWOFS) self.view_ofs_z = self.maxs_z*0.5; + else self.view_ofs_z = MON_VIEWOFS; + } + + //---------------------------------------------------------------------- + // Is the monster a zombie (type) lying on the floor? (starting pose) + // Angles key used for specific facing direction, 0 = random setup + // This function check is before any droptofloor or content checks + // It will allow onfloor monsters to exist in tight spaces, shallow graves + //---------------------------------------------------------------------- + if (self.spawnflags & MON_ONFLOOR && self.classgroup == CG_ZOMBIE) { + if (self.classtype == CT_MONZOMBIEK) zombiek_onground(MONAI_ZOMBIEFLR); + else zombie_onground(MONAI_ZOMBIEFLR); + return; + } + + //---------------------------------------------------------------------- + // Special minions (start small and grow fast) + // CT_MINIONSPIDER, CT_MINIONVORELING, CT_MINIONGARGOYLE + //---------------------------------------------------------------------- + if (self.minion_active) { + self.angles = vectoangles(self.enemy.origin - self.origin); + self.angles_x = self.angles_z = 0; + update_hud_totals(HUD_MONSTERS); + self.pain_finished = time + 1.2; + self.th_stand(); + return; + } + + //---------------------------------------------------------------------- + // Perched Gargoyles/Gaunt have special idle animation (sitting) + // and need to fly up before resuming any normal behaviour + // (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.classtype == CT_MONGARGOYLE && self.spawnflags & MON_GARGOYLE_PERCH || + self.classtype == CT_MONGAUNT && self.spawnflags & MON_GAUNT_PERCH ) + { + self.flags = self.flags | FL_FLY; // Stop any ground checks + self.th_stand(); + return; + } + + //---------------------------------------------------------------------- + // Ceiling critters have special idle animation (rotated) + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.classtype == CT_MONSPIDER && self.spawnflags & MON_SPIDER_CEILING || + self.classtype == CT_MONSWAMPLING && self.spawnflags & MON_SWAMPLING_CEILING || + self.classtype == CT_MONVORELING && self.spawnflags & MON_VORELING_CEILING) { + // Work out where the ceiling is (traceline upwards) + traceline (self.origin, self.origin+'0 0 4096', TRUE, self); + + // Check for empty content before moving + if (pointcontents(trace_endpos) == CONTENT_EMPTY) { + self.flags = self.flags | FL_FLY; // Stop any ground checks + self.classmove = MON_MOVEFLY; // Avoid ground check function + self.origin = trace_endpos; // Move critter to ceiling + setorigin(self, self.origin); + // If the view_ofs is not underneath the critter, no sight + // functions will work (checkclient for example) + self.view_ofs = '0 0 -24'; + self.yaw_speed = 20; // Ground yaw speed + setsize(self, '-16 -16 -24', '16 16 0'); + } + else { + dprint("\b[MONSTER]\b Trying to place on ceiling, no space!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + //---------------------------------------------------------------------- + // Check to see if monster (walking) are stuck in geometry + if (self.classmove == MON_MOVEWALK) { + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // Tempoaraily use lip variable for stuck condition + self.lip = TRUE; + // Some monster placement in the original ID maps NEED original Bounding Boxes + // this is something that cannot be easily fixed, so go back to original BB + // and test the monster placement again + if (CheckZeroVector(self.idmins) == FALSE) { + self.bbmins = self.idmins; self.bbmaxs = self.idmaxs; + setsize (self, self.bbmins, self.bbmaxs); // Restore ID BB size + self.origin_z = self.origin_z + 1; + droptofloor(); + // re-test monster movement using ID Bounding Box + if (walkmove(0,0)) self.lip = FALSE; + } + + // It seems that some mappers want to spawn stuff in mid air + // and let it drop naturally over time (>1 frame) + // check for empty point content at origin as final test + if (pointcontents(self.origin) == CONTENT_EMPTY) self.lip = FALSE; + + // Is the monster stuck with new/old bounding box? + // Stuck monsters contribute towards level monster totals + if (self.lip) { + // If the monster is stuck and delay spawned, gib instead + if (self.spawnflags & MON_SPAWN_DELAY) { + self.health = self.gibhealth; + Killed(self, self); + } + else { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + return; + } + } + } + + //---------------------------------------------------------------------- + // Telefrag (kill) anything at monster position + // Phased monsters cannot telefrag or produce spawn effects + if (!self.bodyphased) { + // New spawn condition via entity key nospawndamage + // This is to prevent excessive damage to breakables + // Monsters can spawn in very wierd situations (inside things) + // if spawning damage is disabled (spawn_tdeath) + if (self.nospawndamage == 0) + spawn_tdeath(self.origin, self); // 50K damage! + + // Don't show spawning effect if delay spawn + nogfx + if (self.spawnflags & MON_SPAWN_DELAY && !(self.spawnflags & MON_SPAWN_NOGFX)) + spawn_tfog(self.origin); + } + + //---------------------------------------------------------------------- + // Hell Knights can be setup to point at a target and fire lightning + // This uses the magicB attack by ID software that was never used + // When the Hell Knight recieves damage from the player or triggered + // will revert back to normal walking/talking/fighting monster! + // ** Has unique use/think function + //---------------------------------------------------------------------- + if (self.classtype == CT_MONHELLK && self.spawnflags & MON_POINT_KNIGHT) { + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // statue function + return; + } + + //---------------------------------------------------------------------- + // Knights, Hell Knights, Golems and Gargoyles can start as statues + // They are frozen in an selected pose and wake up on trigger + // Have different skin, high pain resistance and stone gibs! + // Added double check for statue spawnflag, just in case + // ** Has unique use/think function + //---------------------------------------------------------------------- + if (self.spawnstatue && self.spawnflags & MON_STATUE) { + self.takedamage = DAMAGE_NO; // No damage till wakeup + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // statue function + return; + } + + //---------------------------------------------------------------------- + // Start in special standby mode with a blue halo glowing shield + // Will wait for a trigger before reverted back to normal gameplay + // ** Has unique use/think function + //---------------------------------------------------------------------- + if (self.classtype == CT_MONSEEKER && self.spawnflags & MON_SEEK_SHIELD) { + self.takedamage = DAMAGE_NO; // No damage till wakeup + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // statue function + return; + } + + //---------------------------------------------------------------------- + // Once the skull wizard is setup on the ground, phase out body + //---------------------------------------------------------------------- + if (self.classtype == CT_MONSKULLW && self.bodyphased == MONAI_SKULLWINVIS) { + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + setmodel(self,""); + } + //---------------------------------------------------------------------- + // No more spawn exception check for targets + monster_targets(); +}; + +//---------------------------------------------------------------------- +// Setup bounding box for monster (based on types) +//---------------------------------------------------------------------- +void() monster_bbox = +{ + if (self.bboxtype == BBOX_CUSTOM) return; + else if (self.bboxtype == BBOX_TINY) + // Lost Soul, Scorpion, Spider, Voreling + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 16'; } + else if (self.bboxtype == BBOX_SHORT) + // Player, Death Guards, Knights, Crossbow Knights, + // Army, Army_Rocket, Army_Grenade, Army_Plasma, Jim + // Zombie, Poison Zombie, Zombie Knight + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 32'; } + else if (self.bboxtype == BBOX_TALL) + // Hell Knight, Death Knight, Fury Knight, Sergeant + // Enforcer, Defender, Eliminator, Pyro, Centurion + // Skull Wizard, Wizard, Gargoyles, Tarbaby, Wraith + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 40'; } + else if (self.bboxtype == BBOX_WIDE) + // Demon, Ogre, Hunter Ogre, _Mace, _Hammer, Shalrath + { self.bbmins = '-24 -24 -24'; self.bbmaxs = '24 24 40'; } + else if (self.bboxtype == BBOX_GIANT) + // Drole, Minotaur + { self.bbmins = '-24 -24 -24'; self.bbmaxs = '24 24 64'; } + else if (self.bboxtype == BBOX_MASSIVE) + // Shambler, ID Ogre + { self.bbmins = '-32 -32 -24'; self.bbmaxs = '32 32 64'; } + + // Some monsters are custom sizes + else if (self.bboxtype == BBOX_DOG) + { self.bbmins = '-20 -20 -24'; self.bbmaxs = '20 20 16'; } + else if (self.bboxtype == BBOX_FISH) + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 24'; } + else if (self.bboxtype == BBOX_FISHS) + { self.bbmins = '-12 -12 -14'; self.bbmaxs = '12 12 14'; } + else if (self.bboxtype == BBOX_EEL) + { self.bbmins = '-16 -16 -16'; self.bbmaxs = '16 16 16'; } + else if (self.bboxtype == BBOX_HYDRA) + { self.bbmins = '-20 -20 -16'; self.bbmaxs = '20 20 16'; } + else if (self.bboxtype == BBOX_GOLEM) + { self.bbmins = '-28 -28 -24'; self.bbmaxs = '28 28 80'; } + + // default bounding box = TALL + else { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 40'; } +}; + +/*====================================================================== + walkmonster_start + - Main entry point for ALL monster routines +======================================================================*/ +void() monster_start = +{ + self.flags = FL_MONSTER; // Always reset this flag + self.skin_override = self.skin; // Save for later + self.frame_override = self.frame; + + // Check for spawning conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Warning if effects flag is active before spawning + if (self.effects) { + dprint("\b[MONSTER]\b Effects flag active\n"); + self.savedeffects = self.effects; + } + // Reset effects flag because some engines will show effects + // This is especially obvious for delay spawned monsters + self.effects = 0; + + self.oldorigin = self.origin; // Save origin + self.max_health = self.health; // Save max health + if (!self.gibhealth) self.gibhealth = 0 - self.health; // Default gib health + if (self.turrethealth < 0 || self.turrethealth > 1) self.turrethealth = 0.5; + + // Check if jump function has been disabled? + if (self.jump_flag < 0) self.jump_flag = LARGE_TIMER; + + // Default attack function and class group + if (!self.th_checkattack) self.th_checkattack = CheckAttack; + if (!self.classgroup) self.classgroup = CG_MONSTERS; + + // Highlight monsters with forced no_zaware entity key + if (self.no_zaware && developer > 0 && !query_configflag(SVR_DEVHELPER)) + spawn_marker(self.origin+'0 0 32', SPNMARK_WHITE); + + // Setup bounding box based on presets + monster_bbox(); + // Cannot have multiple upgrade restrictions on monsters + remove_duplicate_upgrades(); + + // Cannot delay spawn a monster if nothing can trigger it!?! + if (self.spawnflags & MON_SPAWN_DELAY && self.targetname == "") { + dprint("\b[MONSTER]\b Cannot delay spawn without targetname!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Check for Axe / Shotgun upgrade monster exceptions? + // Don't add these kind of monster to the count until spawned + if (self.upgrade_axe || self.upgrade_ssg || self.upgrade_lg) { + if ( !(self.spawnflags & MON_SPAWN_DELAY) ) { + dprint("\b[MONSTER]\b need spawn delay for axe/shotgun/lg\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // make sure the monster has no nomonstercount exceptions + if (self.nomonstercount) self.nomonstercount = 0; + } + else { + // Allow mappers to spawn monsters that don't affect monster count + // I know this can be a dangerous if used incorrectly, but good for statues + // delaymonstercount = update count on spawn instead of death + if (self.nomonstercount > 0 || self.delaymonstercount > 0) + { + if (developer > 1) { + dprint("\b[MONSTER]\b ("); dprint(self.targetname); + dprint(") - no monster count\n"); + } + } + // Default state - update monster total + // HUD update done with client setup + else total_monsters = total_monsters + 1; + } + + //---------------------------------------------------------------------- + // Detect monster armour map hack + if (self.armorvalue || self.armortype) { + // This hack really should be stopped, no point upsetting mappers at this point + // self.armorvalue = self.armortype = 0; + dprint("\b[MAPHACKS]\b Using armor on monsters, use health key instead!\n"); + } + + if (self.spawnflags & MON_SPAWN_DELAY) { + setmodel(self, string_null); + self.solid = SOLID_NOT; // No world interaction + self.use = monster_spawn; // Wait for trigger + + if (developer > 0 && !query_configflag(SVR_DEVHELPER)) { + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, MODEL_BROKEN); + if (self.nomonstercount == 1) self.skin = SPNMARK_GREEN; + else self.skin = SPNMARK_BLUE; + self.frame = 0; + } + } + else { + // Variable start delay on all monsters to reduce packet errors + self.nextthink = time + 0.1 + random()*0.4; + self.think = monster_spawn; + } +}; + +//====================================================================== +// Map hacks are not supported in this MOD +// There is no use in pretending otherwise! +//====================================================================== +void() walkmonster_start_go = { remove(self); return; }; +void() flymonster_start_go = { remove(self); return; }; +void() swimmonster_start_go = { remove(self); return; }; + +/*====================================================================== +/*QUAKED monster_x (1 0 0) (x y z) (x y z) AMBUSH x x NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +XXX, x health points. +-------- KEYS -------- +targetname : monster/trigger name +target : Starting position or path_corner to walk towards (always define) +target2 : Additional trigger function (need target to be defined as well) +angrytarget : something (monster/player) to get angry at once spawned +deathtarget : entity to trigger upon death (useful if target field already in use) +health : Override default health settings +exactskin : Override default skin selection of 0 (no error checking) +upgrade_ssg : 1 = will only spawn if shotgun upgrade active on server +upgrade_axe : 1 = will only spawn if axe upgrade active on server +upgrade_lg : 1 = will only spawn if lightning gun upgrade active on server +nomonstercount : will not be included in any monster count functionality +infightextra : Damage multiplier for infighting damage +pain_ignore : 1 = Ignore pain when hit by other monsters +noinfighting : Will not react to any infighting (it can look stupid) +no_liquiddmg : Blocks all liquid (slime/lava) damage checks +no_zaware : All Z Aware projectiles will be disabled +bboxtype : Change bbox 1=Tiny,4=Short,5=Tall,7=Wide,8=Giant,10=Massive +gibondeath : 1 = always explode in a shower of gibs on death +bodyfadeaway : Time (secs) before body/head will fade away (default=0) +movespeed : -1 = no movement(turret), =0/1 free movement (default) +turrethealth : = 0.0->1.0; % of HP when monster turret is released +turrettarget : Target(s) to fire when turret % HP is released + +--- Knights --- +frame: statue frame to be frozen in. (default 44) +STATUE : Stone statue until triggered +NOTFROZEN : Will start active (works with statue spawnflag) + +--- Hell Knight --- +frame: statue frame to be frozen in. (default 73) +STATUE : Stone statue until triggered +NOTFROZEN : Will start active (works with statue spawnflag) + +--- Crossbow Knight --- +SNIPER : no max range limitations for enemies (sniper mode) +TRACKING : Enable tracking for the firing of bolts (really hard) + +--- Golem --- +frame: statue frame to be frozen in. (default 48) +STATUE : Stone statue until triggered + +--- Tarbaby --- +death_dmg : Damage on Death (def=120) +poisonous : 0=Jump attack (default, 1=Poison attack +exactskin : 0-1=Blue, 2-3=Green1, 4-5=Green2, 6-7=Green3 + +--- Skull Wizards --- +bodyphased : Spawn phased out and wait to see player +bodystatic : Prevents skull wizard from teleporting + +-------- SPAWNFLAGS -------- +AMBUSH : the monster will only wake up on seeing the player, not by another monster +NOSIGHT : No sight sound +NOIDLE : No idle sound +NOGFX : No spawn effect or sound when triggered +STARTOFF : Trigger Spawn +ANGRY : Trigger Spawn angry at the player +-------- NOTES -------- +XXX, x health points. +======================================================================*/ diff --git a/QC_other/QC_arcane/part_emitter.qc b/QC_other/QC_arcane/part_emitter.qc new file mode 100644 index 00000000..659c4fb1 --- /dev/null +++ b/QC_other/QC_arcane/part_emitter.qc @@ -0,0 +1,1468 @@ +/*====================================================================== + Particle EMITTER functions +======================================================================*/ +float(entity pe_ent) misc_particle_style = +{ + pe_ent.start_delay = 1 + (random()*2); // Particle emitter start delay (default) + pe_ent.spr_frame = 1; // Use all sprite frames (Light/Dark) + pe_ent.dpp_name = ""; // DP particle effect name + pe_ent.dpp_wait = 0.1; // Defautlt timer + pe_ent.dpp_rnd = 1; // Random time multiplier + pe_ent.dpp_vel = '0 0 0'; // Velocity direction of particles + pe_ent.part_movetype = MOVETYPE_NOCLIP; + + //---------------------------------------------------------------------- + // Portal Gate + //---------------------------------------------------------------------- + if (pe_ent.part_style == PARTICLE_STYLE_PORTAL) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.spr_frame = 3; // Dark frames + pe_ent.part_limit = 100; // High Amount of particles + pe_ent.part_life = 3; // Long life time + pe_ent.part_ofs = '0 0 0'; // No change + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; + + // If the angle is up or down then it is a special case + if (pe_ent.angles_y == -1) { + pe_ent.part_vel = '0 0 20'; // UP direction + pe_ent.dpp_name = DPP_PORTALUP; // particles flying up + } + else if (pe_ent.angles_y == -2) { + pe_ent.part_vel = '0 0 -20'; // DOWN direction + pe_ent.dpp_name = DPP_PORTALDOWN; // smoke falling down + } + else { + // Setup DP portal effects volume size based on initial emitter angle + if (pe_ent.angles_y == 90 || pe_ent.angles_y == 270) { + if (!pe_ent.part_vol) pe_ent.part_vol = '32 0 48'; // Volume (X/Y/Z) + pe_ent.dpp_name = DPP_PORTALSIDE; + } + else { + if (!pe_ent.part_vol) pe_ent.part_vol = '0 32 48'; // Volume (X/Y/Z) + pe_ent.dpp_name = DPP_PORTALFRONT; // default direction + } + + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.angles); + pe_ent.part_vel = v_forward * 20; // Slow speed away from portal + } + + if (!pe_ent.part_velrand) pe_ent.part_velrand = '10 10 4'; // More X/Y wobble + if (!pe_ent.wakeup_dist) pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 4; // High timer (runs all the time) + if (!pe_ent.spawn_base) pe_ent.spawn_base = 0.1; // Fast Spawn rate + if (!pe_ent.spawn_rand) pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_vel = normalize(pe_ent.part_vel); // Particle direction + } + //---------------------------------------------------------------------- + // Spiral Jumppad pattern + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_JUMPPAD) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 100; // High Amount of particles + pe_ent.part_life = 3; // Long life time + pe_ent.part_ofs = '0 0 0'; // Start below emitter origin + pe_ent.part_velbase = '0 0 12'; // Always go upwards + pe_ent.part_vel = '0 0 32'; // UP direction + pe_ent.part_velrand = '8 8 0'; // Slight wobble + pe_ent.part_vol = '24 24 0'; // Volume around circle pad + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // inside circle volume + pe_ent.wakeup_dist = 1024; // Long range distance + pe_ent.wakeup_timer = 2; // High timer (runs all the time) + pe_ent.spawn_base = 0.05; // Average Spawn rate + pe_ent.spawn_rand = 0.05; // Spawn rate randomness + pe_ent.dpp_name = DPP_JUMPPAD; // streaming up + } + //---------------------------------------------------------------------- + // Circular floor pattern (triggered) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FCIRCLE) { + pe_ent.spr_name1 = PART_TORCH1; + pe_ent.spr_name2 = PART_TORCH2; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 64; // High Amount of particles + pe_ent.part_life = 5; // Long life time + pe_ent.part_ofs = '0 0 1'; // Slightly off floor + pe_ent.part_vel = '0 0 12'; // Slowly move upwards + pe_ent.part_velrand = '4 4 0'; // Slight wobble + // Circle radius/rotation degrees + if (CheckZeroVector(pe_ent.pemit_source.part_vol)) pe_ent.part_vol = '56 17 0'; + pe_ent.part_veltype = PARTICLE_ORIGIN_RANDCIRCLE; + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 0.5; // 4x timer + // Fast spawn rate and randomness + if (!pe_ent.pemit_source.spawn_base) pe_ent.spawn_base = 0.1; // Fast Spawn rate + if (!pe_ent.pemit_source.spawn_rand) pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_FCIRCLE; // Circular floor pattern + pe_ent.dpp_rnd = 0.2; // Random time multiplier + } + //---------------------------------------------------------------------- + // Forcefield + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FFIELD) { + if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_YELLOW) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_YELLOW; + pe_ent.spr_name3 = PART_DOTMED_YELLOW; + pe_ent.dpp_name = DPP_FFIELDPARTY; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_GREEN) { + pe_ent.spr_name1 = PART_DOTSML_LGREEN; + pe_ent.spr_name2 = PART_DOTSML_GREEN; + pe_ent.spr_name3 = PART_DOTMED_GREEN; + pe_ent.dpp_name = DPP_FFIELDPARTG; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_RED) { + pe_ent.spr_name1 = PART_DOTSML_GREY; + pe_ent.spr_name2 = PART_DOTSML_RED; + pe_ent.spr_name3 = PART_DOTMED_RED; + pe_ent.dpp_name = DPP_FFIELDPARTR; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_BLUE) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTMED_BLUE; + pe_ent.dpp_name = DPP_FFIELDPARTB; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_PURPLE) { + pe_ent.spr_name1 = PART_DOTSML_PURP; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTMED_PURP; + pe_ent.dpp_name = DPP_FFIELDPARTP; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_FIRE) { + pe_ent.spr_name1 = PART_TORCH1; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTMED_GREY; + pe_ent.dpp_name = DPP_FFIELDPARTY; + } + else { + pe_ent.spr_name1 = PART_DOTSML_WHITE; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTMED_GREY; + pe_ent.dpp_name = DPP_FFIELDPARTW; + } + + // reset particle sprite frame range to all + pe_ent.spr_frame = 0; + + // Particle quantity should be low, allow customization for volume size + if (!pe_ent.pemit_source.part_limit) pe_ent.part_limit = 25; + else pe_ent.part_limit = pe_ent.pemit_source.part_limit; + if (!pe_ent.pemit_source.part_life) pe_ent.part_life = 2; + else pe_ent.part_life = pe_ent.pemit_source.part_life; + if (!pe_ent.pemit_source.part_ofs) pe_ent.part_ofs = '0 0 0'; + else pe_ent.part_ofs = pe_ent.pemit_source.part_ofs; + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; + if (!pe_ent.part_velrand) pe_ent.part_velrand = '4 4 4'; + // The volume and direction really need to be set before the + // emitter is setup because the volume maybe switched off + if (CheckZeroVector(pe_ent.pemit_source.part_vol)) pe_ent.part_vol = '8 8 8'; + else pe_ent.part_vol = pe_ent.pemit_source.part_vol; + if (CheckZeroVector(pe_ent.pemit_source.part_vel)) pe_ent.part_vel = '0 0 4'; + else pe_ent.part_vel = pe_ent.pemit_source.part_vel; + + if (!pe_ent.pemit_source.wakeup_dist) pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 4; // High timer (runs all the time) + if (!pe_ent.pemit_source.spawn_base) pe_ent.spawn_base = 0.05; // Fast Spawn rate + if (pe_ent.spawn_base < 0.01) pe_ent.spawn_base = 0.01; // Need minimum + if (!pe_ent.pemit_source.spawn_rand) pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_vel = pe_ent.part_vel; + pe_ent.dpp_wait = 0.01; + pe_ent.dpp_rnd = 0.1; + } + + //====================================================================== + // Book Phase 1 - closed + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_BOOK) { + pe_ent.spr_name1 = PART_BOOKRUNE1; + pe_ent.spr_name2 = PART_BOOKRUNE2; + if (random()<0.5) pe_ent.spr_name3 = PART_BOOKRUNE1; + else pe_ent.spr_name3 = PART_BOOKRUNE2; + pe_ent.part_limit = 3; // Very Low + pe_ent.part_life = 7; // Long Life + pe_ent.part_ofs = '0 0 10'; // Top of Book + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_velrot = 45; // Velocity rotation - y + random(y) + pe_ent.part_vol = '1 1 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Close range distance + pe_ent.wakeup_timer = 8; // High timer + pe_ent.spawn_base = 2; // Slow (runs all the time) + pe_ent.spawn_rand = 1; // Spawn rate randomness + if (pe_ent.pemit_source.style == MISCBOOK_BLUE) pe_ent.dpp_name = DPP_BOOKBLUE; + else if (pe_ent.pemit_source.style == MISCBOOK_RED) pe_ent.dpp_name = DPP_BOOKRED; + else pe_ent.dpp_name = DPP_BOOKGOLD; + pe_ent.dpp_wait = 1; // Slow timer + pe_ent.dpp_rnd = 2; // Long pause + } + //---------------------------------------------------------------------- + // Book Phase 2 - open + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_OPENBOOK) { + if (random()<0.5) pe_ent.spr_name1 = PART_BOOKRUNE1; + else pe_ent.spr_name1 = PART_BOOKRUNE2; + + // Setup particle colour based on book type + if (pe_ent.pemit_source.style == MISCBOOK_BLUE) { + if (random() < 0.5) pe_ent.spr_name2 = PART_DOTMED_BLUE; + else pe_ent.spr_name2 = PART_DOTSML_BLUE; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.dpp_name = DPP_OPENBOOKBLUE; + } + else if (pe_ent.pemit_source.style == MISCBOOK_RED) { + if (random() < 0.5) pe_ent.spr_name2 = PART_DOTMED_RED; + else pe_ent.spr_name2 = PART_DOTSML_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_OPENBOOKRED; + } + else { + if (random() < 0.5) pe_ent.spr_name2 = PART_DOTMED_YELLOW; + else pe_ent.spr_name2 = PART_DOTSML_YELLOW; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_OPENBOOKGOLD; + } + pe_ent.part_limit = 30; // Average + pe_ent.part_life = 7; // Long Life + pe_ent.part_ofs = '0 0 4'; // Pages of Book + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_velrot = 45; // Velocity rotation - y + random(y) + pe_ent.part_vol = '8 8 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Close range distance + pe_ent.wakeup_timer = 4; // High timer + pe_ent.spawn_base = 0.1; // Fast (particles) + pe_ent.spawn_rand = 0.3; // Spawn rate randomness + pe_ent.dpp_wait = 0.5; // Fast timer + pe_ent.dpp_rnd = 2; // Long pause + } + //====================================================================== + // Electric Beam Particle Stream (code triggered) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_ELECTRIC) { + pe_ent.spr_name1 = PART_DOTMED_BLUE; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_BLUE; + pe_ent.part_limit = 100; // Maximum particles + pe_ent.part_life = 1; // Short Lifetime + pe_ent.part_ofs = '0 0 0'; // center of target object + pe_ent.part_vel = '50 0 0'; // Speed of particles + pe_ent.part_velrand = '0 0 16'; // Vertical wobble + pe_ent.part_vol = '8 8 8'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 0.2; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_ELECTRIC; // directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + } + //---------------------------------------------------------------------- + // Torches Flames (slow start) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FLAMET) { + pe_ent.start_delay = 3 + (random()*8); + pe_ent.spr_name1 = PART_TORCH1; // Embers - Red/Yellow + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 8; // Minimal amount of particles + pe_ent.part_life = 2; // Short Life + pe_ent.part_ofs = '0 0 12'; // Top of wood + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_vol = '1 1 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + if (pe_ent.pemit_source.wakeup_dist < 1) pe_ent.wakeup_dist = 384; + else pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + if (pe_ent.pemit_source.wakeup_timer < 1) pe_ent.wakeup_timer = 8; + else pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.25; // Spawn rate base (runs all the time) + pe_ent.spawn_rand = 0.25; // Spawn rate randomness + pe_ent.dpp_name = DPP_FLAMET; // smoke and particles floating up + pe_ent.dpp_wait = 1; // Slow timer + } + //---------------------------------------------------------------------- + // Small Flames (slow start) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FLAMES) { + pe_ent.start_delay = 3 + (random()*8); + pe_ent.spr_name1 = PART_TORCH1; // Embers - Red/Yellow + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 8; // Minimal amount of particles + pe_ent.part_life = 2; // Short Life + pe_ent.part_ofs = '0 0 0'; // Bottom of flame + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_vol = '1 1 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + if (pe_ent.pemit_source.wakeup_dist < 1) pe_ent.wakeup_dist = 384; + else pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + if (pe_ent.pemit_source.wakeup_timer < 1) pe_ent.wakeup_timer = 6; + else pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.25; // Spawn rate base (runs all the time) + pe_ent.spawn_rand = 0.25; // Spawn rate randomness + pe_ent.dpp_name = DPP_FLAMES; // smoke and particles floating up + pe_ent.dpp_wait = 1; // Slow timer + } + //---------------------------------------------------------------------- + // Large Flames (high particle count) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FLAMEL) { + pe_ent.spr_name1 = PART_TORCH1; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 100; // Large amount of active particles + if (pe_ent.pemit_source.part_life < 1) pe_ent.part_life = 8; + else pe_ent.part_life = pe_ent.pemit_source.part_life; + pe_ent.part_ofs = '0 0 0'; // Bottom of flame + pe_ent.part_vel = '0 0 12'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_vol = '4 4 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + if (pe_ent.pemit_source.wakeup_dist < 1) pe_ent.wakeup_dist = 768; + else pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + if (pe_ent.pemit_source.wakeup_timer < 1) pe_ent.wakeup_timer = 1; + else pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.05; // Frequent (runs all the time) + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_name = DPP_FLAMEL; // smoke and particles floating up + } + //---------------------------------------------------------------------- + // Skill Particle Stream (Designed for 4 sides of pillar) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SKILL) { + pe_ent.spr_name1 = PART_DOTMED_RED; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_RED; + pe_ent.part_limit = 35; // Maximum particles + pe_ent.part_life = 2; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.pemit_source.angles); + pe_ent.part_vel = v_forward * 10; // Slow speed away from skill column + pe_ent.part_vol = '4 4 4'; // Volume (X/Y/Z) + pe_ent.part_velrand = '4 4 8'; // Volume wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 1; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_SKILLPILLAR; // Directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + pe_ent.dpp_vel = normalize(v_forward); // Particle direction + } + //---------------------------------------------------------------------- + // Skill Particle Stream (Designed for Silver Key Doors) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_BSKILL) { + pe_ent.spr_name1 = PART_DOTMED_BLUE; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTSML_BLUE; + pe_ent.part_limit = 35; // Maximum particles + pe_ent.part_life = 2; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.pemit_source.angles); + pe_ent.part_vel = v_forward * 10; // Slow speed away from skill column + pe_ent.part_vol = '4 4 4'; // Volume (X/Y/Z) + pe_ent.part_velrand = '4 4 8'; // Volume wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 1; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_BSKILLPILLAR; // Directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + pe_ent.dpp_vel = normalize(v_forward); // Particle direction + } + //---------------------------------------------------------------------- + // Skill Particle Stream (Designed for Green Key Doors) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_GSKILL) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 35; // Maximum particles + pe_ent.part_life = 2; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.pemit_source.angles); + pe_ent.part_vel = v_forward * 10; // Slow speed away from skill column + pe_ent.part_vol = '4 4 4'; // Volume (X/Y/Z) + pe_ent.part_velrand = '4 4 8'; // Volume wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 1; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_GSKILLPILLAR; // Directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + pe_ent.dpp_vel = normalize(v_forward); // Particle direction + } + //---------------------------------------------------------------------- + // Skill Particle Stream (Designed for Purple Key Doors) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_PSKILL) { + pe_ent.spr_name1 = PART_DOTSML_PURP; + pe_ent.spr_name2 = PART_DOTMED_PURP; + pe_ent.spr_name3 = PART_DOTSML_PURP; + pe_ent.part_limit = 35; // Maximum particles + pe_ent.part_life = 2; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.pemit_source.angles); + pe_ent.part_vel = v_forward * 10; // Slow speed away from skill column + pe_ent.part_vol = '4 4 4'; // Volume (X/Y/Z) + pe_ent.part_velrand = '4 4 8'; // Volume wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 1; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_PSKILLPILLAR; // Directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + pe_ent.dpp_vel = normalize(v_forward); // Particle direction + } + //---------------------------------------------------------------------- + // Particles raising up around an altar + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_ALTAR) { + if (pe_ent.pemit_source.cnt == 1) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_ALTARGREY; // floating upwards + } + else { + pe_ent.spr_name1 = PART_DOTMED_RED; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_RED; + pe_ent.dpp_name = DPP_ALTARRED; // floating upwards + } + pe_ent.part_limit = 100; // Maximum particles + pe_ent.part_life = 5; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + if (CheckZeroVector(pe_ent.pemit_source.part_vel)) pe_ent.part_vel = '0 0 12'; + pe_ent.part_velrand = '4 4 12'; // Slight wobble + pe_ent.part_vol = '64 64 0'; // Volume (X/Y/Z) + if (pe_ent.pemit_source.t_length > 0) + pe_ent.part_vol_x = pe_ent.pemit_source.t_length; + if (pe_ent.pemit_source.t_width > 0) + pe_ent.part_vol_y = pe_ent.pemit_source.t_width; + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Close range distance + pe_ent.wakeup_timer = 4; // High timer + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + } + //---------------------------------------------------------------------- + // DP ONLY - velocity directional smoke + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SMOKE) { + pe_ent.dpp_only = TRUE; + if (pe_ent.pemit_source.exactskin == 0) pe_ent.dpp_name = DPP_VELSMOKEGREY1; + else if (pe_ent.pemit_source.exactskin == 1) pe_ent.dpp_name = DPP_VELSMOKEGREY2; + else if (pe_ent.pemit_source.exactskin == 2) pe_ent.dpp_name = DPP_VELSMOKEWHITE; + else if (pe_ent.pemit_source.exactskin == 3) pe_ent.dpp_name = DPP_VELSMOKETOXIC; + else if (pe_ent.pemit_source.exactskin == 4) pe_ent.dpp_name = DPP_VELSMOKEGREEN; + else if (pe_ent.pemit_source.exactskin == 5) pe_ent.dpp_name = DPP_VELSMOKEPURPLE; + else if (pe_ent.pemit_source.exactskin == 6) pe_ent.dpp_name = DPP_VELSMOKERED; + else if (pe_ent.pemit_source.exactskin == 7) pe_ent.dpp_name = DPP_VELSMOKEFIRE; + pe_ent.dpp_rnd = pe_ent.pemit_source.delay; + pe_ent.dpp_wait = pe_ent.pemit_source.wait; + pe_ent.dpp_vel = pe_ent.pemit_source.movedir * pe_ent.pemit_source.height; + } + //====================================================================== + // Items + //====================================================================== + else if (pe_ent.part_style == PARTICLE_STYLE_RESPAWN) { + pe_ent.start_delay = 0.1; // Particle emitter start delay + pe_ent.spr_name1 = PART_DOTSML_YELLOW; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 25; // Variable, depends on spawn rate + pe_ent.part_life = 1; // Short life time + pe_ent.part_ofs = '0 0 1'; // Custom for each item + pe_ent.part_vel = '0 0 10'; // Slowly move upwards + pe_ent.part_vol = '16 16 0'; // Flat base of model + pe_ent.part_velrand = '4 4 6'; // Slight wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.05; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_RESPAWN; // Particles floating up, starts slow + pe_ent.dpp_rnd = 0; // NO Random time multiplier + } + //---------------------------------------------------------------------- + // Items - Mega Health + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_MEGAH) { + pe_ent.spr_name1 = PART_DOTSML_WHITE; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 3.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to the top of the key + pe_ent.part_vel = '12 12 4'; // Speed of particles outwards + pe_ent.part_velrand = '0 0 8'; // Slight wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.05; // Fast Spawn rate + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_name = DPP_MEGAH; // Particles drifting out from center + } + //---------------------------------------------------------------------- + // Item - Armor (Green/Yellow/Red) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_ARMOR) { + if (pe_ent.pemit_source.items & IT_ARMOR1) { + pe_ent.spr_name1 = PART_DOTSML_LGREEN; + pe_ent.spr_name2 = PART_DOTMED_LGREEN; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_ARMOR1; // Green particles + smoke + } + else if (pe_ent.pemit_source.items & IT_ARMOR2) { + if (pe_ent.pemit_source.spawnflags & ARMOR_BLUE) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTMED_BLUE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_ARMOR2BLUE;// Blue particles + smoke + } + else { + pe_ent.spr_name1 = PART_DOTSML_YELLOW; + pe_ent.spr_name2 = PART_DOTMED_YELLOW; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_ARMOR2; // Yellow particles + smoke + } + } + else { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTMED_RED; + pe_ent.dpp_name = DPP_ARMOR3; // Red particles + smoke + } + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2.75; // Short life time + pe_ent.part_ofs = '0 0 24'; // Move up to middle of Suit + pe_ent.part_vel = '6 6 4'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + } + //---------------------------------------------------------------------- + // Item - Silver Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYSILVER) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTSML_BLUE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYSILVER; // Blue particles from top of key + } + //---------------------------------------------------------------------- + // Item - Gold Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYGOLD) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYGOLD; // Yellow particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic Red Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYRED) { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYRED; // Red particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic Green Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYGREEN) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYGREEN; // Green particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic Purple Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYPURPLE) { + pe_ent.spr_name1 = PART_DOTSML_PURP; + pe_ent.spr_name2 = PART_DOTMED_PURP; + pe_ent.spr_name3 = PART_DOTSML_PURP; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYPURPLE; // Purple particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic White Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYWHITE) { + pe_ent.spr_name1 = PART_DOTSML_GREY; + pe_ent.spr_name2 = PART_DOTMED_GREY; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYWHITE; // White particles from top of key + } + //---------------------------------------------------------------------- + // Item - Sigil / Rune + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SIGIL) { + pe_ent.spr_name1 = PART_DOTMED_PURP; + pe_ent.spr_name2 = PART_DOTSML_PURP; + pe_ent.spr_name3 = PART_DOTSML_PURP; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center of sigil + pe_ent.part_vel = '8 8 16'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_SIGIL; // Purple particles from center + } + //---------------------------------------------------------------------- + // Item - Custom Backpack + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_BACKPACK) { + if (pe_ent.pemit_source.exactskin == 1) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_GREEN; + pe_ent.dpp_name = DPP_BACKPACKG; // Green + } + else if (pe_ent.pemit_source.exactskin == 2) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTMED_BLUE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_BACKPACKB; // Blue + } + else if (pe_ent.pemit_source.exactskin == 3) { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_BACKPACKR; // Red + } + else if (pe_ent.pemit_source.exactskin == 4) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.dpp_name = DPP_BACKPACKY; // Yellow + } + else if (pe_ent.pemit_source.exactskin == 5) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.dpp_name = DPP_BACKPACKG; // Green + } + else { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_BACKPACK; // Default Grey/White + } + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 12'; // Middle of pack + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + } + //====================================================================== + // Artifacts + //====================================================================== + //---------------------------------------------------------------------- + // Artifact - Environmental Suit + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SUIT) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2.75; // Short life time + pe_ent.part_ofs = '0 0 28'; // Move up to belt of Suit (chest=32) + pe_ent.part_vel = '8 8 3'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_SUIT; // Green/Yellow particles from center + pe_ent.dpp_wait = 0.5; // Slow timer + } + //---------------------------------------------------------------------- + // Artifact - Pentagram + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_PENT) { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center of Pent + pe_ent.part_vel = '12 12 12'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_PENT; // Red/Gold particles from center + pe_ent.dpp_wait = 1; // Slow timer + } + //---------------------------------------------------------------------- + // Artifact - Shadow Ring + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SRING) { + pe_ent.spr_name1 = PART_DOTSML_YELLOW; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 35; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 6'; // Move up to the top of the amulet + pe_ent.part_vel = '8 8 3'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 -12'; // Move downwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_name = DPP_SRING; // White/Gold particles from center + } + //---------------------------------------------------------------------- + // Artifact - Quad Damage + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_QUAD) { + pe_ent.spr_name1 = PART_DOTMED_BLUE; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_BLUE; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center of quad + pe_ent.part_vel = '10 10 16'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_QUAD; // Blue/White particles from center + } + //---------------------------------------------------------------------- + // Artifact - Tome of Power + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_TOMEOFP) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_YELLOW; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 16'; // Lower part of book + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 -4'; // Move downward + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.05; // Fast Spawn rate + pe_ent.spawn_rand = 0.05; // Spawn rate randomness + pe_ent.dpp_name = DPP_TOMEOFP; // Yellow particles + pe_ent.dpp_wait = 0.5; // Slow timer + } + //---------------------------------------------------------------------- + // Artifact - Sharp Shooter + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SHARP) { + if (pe_ent.pemit_source.exactskin == 1) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.dpp_name = DPP_SHARPG; // Green particles from center + } + else { + pe_ent.spr_name1 = PART_DOTMED_PURP; + pe_ent.spr_name2 = PART_DOTSML_PURP; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_SHARP; // Purple particles from center + } + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center + pe_ent.part_vel = '10 10 16'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + } + //---------------------------------------------------------------------- + // Artifact - Nail Piercer + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_PIERCE) { + pe_ent.spr_name1 = PART_DOTMED_PURP; + pe_ent.spr_name2 = PART_DOTSML_PURP; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center + pe_ent.part_vel = '8 8 4'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_PIERCE; // Purple particles from center + } + //---------------------------------------------------------------------- + // Artifact - Wet Suit + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_WETSUIT) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTMED_BLUE; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2.75; // Short life time + pe_ent.part_ofs = '0 0 28'; // Move up to belt of Suit (chest=32) + pe_ent.part_vel = '8 8 3'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_WETSUIT; // Blue/White particles raising up + pe_ent.dpp_wait = 0.5; // Slow timer + } + //====================================================================== + // Weather System + //====================================================================== + else if (pe_ent.part_style == PARTICLE_STYLE_WEATHER) { + pe_ent.part_limit = pe_ent.pemit_source.count; + pe_ent.part_vel = '0 0 0'; + pe_ent.part_vel_z = pe_ent.pemit_source.speed; + pe_ent.part_velrand = pe_ent.pemit_source.v_angle; + pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.1; // Default timer + pe_ent.spawn_rand = 0; // No spawn rate randomness + } + //---------------------------------------------------------------------- + // No style defined - ERROR!!!!! + //---------------------------------------------------------------------- + else { + dprint("\b[PEMITTER]\b Style no ("); dprint(ftos(pe_ent.part_style)); + dprint(") not valid!!!"); + pe_ent.part_style = PARTICLE_STYLE_EMPTY; // empty definition + spawn_marker(pe_ent.origin, SPNMARK_YELLOW);// Visual problem + } + + // return any error conditions; 0=ERROR + return pe_ent.part_style; +}; + +//---------------------------------------------------------------------- +void(entity pe_ent) misc_particle_off = +{ + // Double check dealing with a particle emitter? + if (pe_ent.classtype != CT_PARTICLEEMIT) return; + if (pe_ent.state == STATE_OFF) return; + // The particle emitter is still being setup, remember state for later + if (pe_ent.state == STATE_SETUP) { + pe_ent.spawnflags = PARTICLE_START_OFF; + return; + } + + pe_ent.state = STATE_OFF; + pe_ent.estate = ESTATE_OFF; + // Setup a particle explosion on floor circles when they are triggered off + if (pe_ent.part_style == PARTICLE_STYLE_FCIRCLE) { + particle_ring(pe_ent.origin, '0 0 4', '4 4 16', pe_ent.part_vol_x+8, pe_ent.part_limit, pe_ent.part_life, 4 ); + particle_ring(pe_ent.origin, '0 0 4', '0 0 12', pe_ent.part_vol_x-4, pe_ent.part_limit, pe_ent.part_life, 1 ); + } +}; + +//---------------------------------------------------------------------- +void() misc_particle_use = +{ + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + // If particle still not setup toggle spawnflags instead + if (self.state == STATE_SETUP) { + if (self.spawnflags & PARTICLE_START_ON) self.spawnflags = PARTICLE_START_OFF; + else self.spawnflags = PARTICLE_START_ON; + return; + } + + // Double check for particle style setup correctly + if (self.part_style == PARTICLE_STYLE_EMPTY) return; + + // Toggle shooter on/off + if (self.state == STATE_OFF) { + self.state = STATE_ON; + self.estate = ESTATE_ON; + + // Is DP particles active?) + if ((ext_dppart || self.dpp_only) && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // decide between particle types + if (self.part_style == PARTICLE_STYLE_FCIRCLE) emitdpp_fcircle(); + else if (self.part_style == PARTICLE_STYLE_WEATHER) { + // Check if particle effects are available from the engine + if (!ext_dpsnow || !ext_dprain) return; + emitepp_weather(); + } + else emitdpp_particle(); + } + // Pixel goodness particles + else { + // Weather effects not supported on Fitz/QS engines + if (self.part_style == PARTICLE_STYLE_WEATHER) return; + else emit_particle(); + } + } + else misc_particle_off(self); +}; + +//---------------------------------------------------------------------- +void(entity pe_ent) misc_particle_on = +{ + // Double check dealing with a particle emitter? + if (pe_ent.classtype != CT_PARTICLEEMIT) return; + if (pe_ent.state == STATE_ON) return; + // The particle emitter is still being setup, remember state for later + if (pe_ent.state == STATE_SETUP) { + pe_ent.spawnflags = PARTICLE_START_ON; + return; + } + + pe_ent.state = STATE_OFF; + pe_ent.think = misc_particle_use; + pe_ent.nextthink = time + TIME_MINTICK; +}; + +//---------------------------------------------------------------------- +void(entity pe_ent, float partemit_style) misc_particle_update = +{ + // Double check dealing with a particle emitter? + if (pe_ent.classtype != CT_PARTICLEEMIT) return; + if (pe_ent.state == STATE_SETUP) return; + if (pe_ent.part_style == PARTICLE_STYLE_EMPTY) return; + + pe_ent.part_style = partemit_style; + if (misc_particle_style(pe_ent) == FALSE) + dprint("\b[MISC_PARTICLE]\b Error updating emitter!"); +}; + +//---------------------------------------------------------------------- +void() misc_particle_switch_on = { misc_particle_on(self); }; +void() misc_particle_switch_off = { misc_particle_off(self); }; +void() misc_particle_switch_disable = { self.state = STATE_OFF; }; + +//---------------------------------------------------------------------- +void() misc_particle_finishsetup = +{ + // Was the particle emitter setup correctly? + if (self.part_style != PARTICLE_STYLE_EMPTY) { + self.circular_angle = 0; // Starting circular angle + self.state = STATE_OFF; // Initial state + self.estate = ESTATE_OFF; + + // Setup entity state wrapper if targetname exists + if (self.targetname != "") self.use = entity_state_use; + else self.use = misc_particle_use; + self.estate_on = misc_particle_switch_on; + self.estate_off = misc_particle_switch_off; + self.estate_disable = misc_particle_switch_disable; + self.estate_use = misc_particle_use; + + // Delay start of particle emitter so if it needs to be switched off + // other functions can catch it and save switching states quickly + if (self.spawnflags & PARTICLE_START_ON) misc_particle_use(); + } +}; + +//---------------------------------------------------------------------- +void() misc_particle_delay = +{ + // If target setup, find it and store entity + if (self.target != "") self.pemit_target = find(world, targetname, self.target); + if (!self.pemit_target) self.target = ""; + + if (!self.start_delay) self.start_delay = 1 + (random()*2); + self.nextthink = time + self.start_delay; + self.think = misc_particle_finishsetup; +}; + +//---------------------------------------------------------------------- +void() misc_particletemplate = { + self.classtype = CT_PARTICLETEMP; + // make sure any sprite assets used are pre-cached ready + if (self.spr_name1 != "") precache_model(self.spr_name1); + if (self.spr_name2 != "") precache_model(self.spr_name2); + if (self.spr_name3 != "") precache_model(self.spr_name3); +}; + +//---------------------------------------------------------------------- +void() misc_particle_copytemplate = +{ + local entity fdest; + + // Cycle through list for TARGET2 template + fdest = find (world, targetname, self.target2); + while(fdest) { + if (fdest.classtype == CT_PARTICLETEMP) { + self.owner = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.target2); + } + + // Is the particle template missing? + if (!self.owner) { + dprint("\b[MISC_PARTICLE]\b Missing target template!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Custom particle setup defined in map + self.part_style = PARTICLE_STYLE_CUSTOM; + + // Copy over all the DEFINED data from the template + // Fill in any gaps with default data (based on quad) + if (self.owner.spr_name1) self.spr_name1 = self.owner.spr_name1; + else self.spr_name1 = PART_DOTMED_BLUE; + if (self.owner.spr_name2) self.spr_name2 = self.owner.spr_name2; + else self.spr_name2 = PART_DOTSML_WHITE; + if (self.owner.spr_name3) self.spr_name3 = self.owner.spr_name3; + else self.spr_name3 = PART_DOTSML_BLUE; + + // Particle quantity, life, direction, rotation and volume + if (self.owner.part_movetype) self.part_movetype = self.owner.part_movetype; + else self.part_movetype = MOVETYPE_NOCLIP; + if (self.owner.part_limit) self.part_limit = self.owner.part_limit; + else self.part_limit = 25; + if (self.owner.part_life) self.part_life = self.owner.part_life; + else self.part_life = 1; + if (self.owner.part_ofs) self.part_ofs = self.owner.part_ofs; + else self.part_ofs = '0 0 0'; + if (self.owner.part_veltype) self.part_veltype = self.owner.part_veltype; + else self.part_veltype = PARTICLE_ORIGIN_CENTER; + if (self.owner.part_vel) self.part_vel = self.owner.part_vel; + if (self.owner.part_velbase) self.part_velbase = self.owner.part_velbase; + if (self.owner.part_velrand) self.part_velrand = self.owner.part_velrand; + if (self.owner.part_velrot) self.part_velrot = self.owner.part_velrot; + if (self.owner.part_vol) self.part_vol = self.owner.part_vol; + + // Particle spawn timing and wakeup distance + if (self.owner.wakeup_dist) self.wakeup_dist = self.owner.wakeup_dist; + else self.wakeup_dist = 1024; + if (self.owner.wakeup_timer) self.wakeup_timer = self.owner.wakeup_timer; + else self.wakeup_timer = 1; + if (self.wakeup_timer < TIME_MINTICK) self.wakeup_timer = TIME_MINTICK; + if (self.owner.spawn_base) self.spawn_base = self.owner.spawn_base; + else self.spawn_base = 0.1; + if (self.spawn_base < TIME_MINTICK) self.spawn_base = TIME_MINTICK; + if (self.owner.spawn_rand) self.spawn_rand = self.owner.spawn_rand; + else self.spawn_rand = 0; + + // Particle setup for DarkPlaces + if (self.owner.dpp_name) self.dpp_name = self.owner.dpp_name; + else self.dpp_name = ""; + if (self.owner.dpp_wait) self.dpp_wait = self.owner.dpp_wait; + else self.dpp_wait = 0.1; + if (self.dpp_wait < TIME_MINTICK) self.dpp_wait = TIME_MINTICK; + if (self.owner.dpp_rnd) self.dpp_rnd = self.owner.dpp_rnd; + else self.dpp_rnd = 0; + if (self.owner.dpp_vel) self.dpp_vel = self.owner.dpp_vel; + else self.dpp_vel = '0 0 0'; + + // Setup particle states + misc_particle_delay(); +}; + +//---------------------------------------------------------------------- +void() misc_particle_setup = +{ + // Setup Particle styles (pre-defined) + if (misc_particle_style(self) != PARTICLE_STYLE_EMPTY) + misc_particle_delay(); +}; + +//---------------------------------------------------------------------- +// Entry point for code to spawn particle emitter +// source - starting point for particles +// target - destination (can be self/world to spawn at origin) +// style - type of particle to create (check styles above) +// spawnf - spawnflag values (startoff) +//---------------------------------------------------------------------- +entity(entity pe_source, entity pe_target, float pe_style, float pe_spawnf) spawn_pemitter = +{ + local entity new_pe; + + new_pe = spawn(); + new_pe.classtype = CT_PARTICLEEMIT; + new_pe.state = STATE_SETUP; + new_pe.pemit_source = pe_source; + + if (pe_source != pe_target) new_pe.pemit_target = pe_target; + + // Setup a random number on source entity for linking + // If the source entity is deleted this number will change + gen_unique_no(self); + new_pe.entno_unique = self.entno_unique; + + // Check for bmodel origin first + if (pe_source.bsporigin) new_pe.origin = bmodel_origin(pe_source); + else new_pe.origin = pe_source.origin; + + // Move Particle emitter to source origin + setorigin(new_pe, new_pe.origin); + new_pe.part_style = pe_style; // must use global defs + new_pe.spawnflags = pe_spawnf; // spawnflags are parameters + new_pe.angles = pe_source.angles; // Copy over any angle params + + // Back through emitter function + new_pe.think = misc_particle_setup; + new_pe.nextthink = time + 0.1 + random(); + + return new_pe; +}; + +//---------------------------------------------------------------------- +void() misc_particle = +{ + if (self.spawnflags & ENT_STARTOFF) self.spawnflags = PARTICLE_START_OFF; + else self.spawnflags = PARTICLE_START_ON; + + // Default setup for any particle emitter + self.classtype = CT_PARTICLEEMIT; + self.pemit_source = self; + gen_unique_no(self); + self.state = STATE_SETUP; + // Let state of particle emitter change before finishing setup + if (self.targetname != "") self.use = misc_particle_use; + + // Custom particle setup using template? + if (self.target2 != "") { + self.nextthink = time + 0.1 + random(); + self.think = misc_particle_copytemplate; + return; + } + + // Setup any pre-defined particle types + if (self.message == "ARMOR1") { self.part_style = PARTICLE_STYLE_ARMOR; self.items = IT_ARMOR1; } + else if (self.message == "ARMOR2") { self.part_style = PARTICLE_STYLE_ARMOR; self.items = IT_ARMOR2; } + else if (self.message == "ARMOR3") { self.part_style = PARTICLE_STYLE_ARMOR; self.items = IT_ARMOR3; } + + else if (self.message == "BOOK") self.part_style = PARTICLE_STYLE_BOOK; + else if (self.message == "ELECTRIC") self.part_style = PARTICLE_STYLE_ELECTRIC; + else if (self.message == "FCIRCLE") self.part_style = PARTICLE_STYLE_FCIRCLE; + else if (self.message == "FLAMES") self.part_style = PARTICLE_STYLE_FLAMES; + else if (self.message == "FLAMEL") self.part_style = PARTICLE_STYLE_FLAMEL; + + else if (self.message == "KEYGOLD") self.part_style = PARTICLE_STYLE_KEYGOLD; + else if (self.message == "KEYSILVER") self.part_style = PARTICLE_STYLE_KEYSILVER; + else if (self.message == "KEYRED") self.part_style = PARTICLE_STYLE_KEYRED; + else if (self.message == "KEYGREEN") self.part_style = PARTICLE_STYLE_KEYGREEN; + else if (self.message == "KEYPURPLE") self.part_style = PARTICLE_STYLE_KEYPURPLE; + else if (self.message == "KEYWHITE") self.part_style = PARTICLE_STYLE_KEYWHITE; + else if (self.message == "MEGAH") self.part_style = PARTICLE_STYLE_MEGAH; + else if (self.message == "PENT") self.part_style = PARTICLE_STYLE_PENT; + else if (self.message == "PORTAL") self.part_style = PARTICLE_STYLE_PORTAL; + + else if (self.message == "JUMPPAD") self.part_style = PARTICLE_STYLE_JUMPPAD; + else if (self.message == "QUAD") self.part_style = PARTICLE_STYLE_QUAD; + + else if (self.message == "SIGIL") self.part_style = PARTICLE_STYLE_SIGIL; + else if (self.message == "ALTAR") self.part_style = PARTICLE_STYLE_ALTAR; + else if (self.message == "SKILL") self.part_style = PARTICLE_STYLE_SKILL; + else if (self.message == "BSKILL") self.part_style = PARTICLE_STYLE_BSKILL; + else if (self.message == "GSKILL") self.part_style = PARTICLE_STYLE_GSKILL; + else if (self.message == "PSKILL") self.part_style = PARTICLE_STYLE_PSKILL; + else if (self.message == "SRING") self.part_style = PARTICLE_STYLE_SRING; + else if (self.message == "SUIT") self.part_style = PARTICLE_STYLE_SUIT; + else { + dprint("\b[MISC_PARTICLE]\b Missing particle style!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Back through emitter function + self.nextthink = time + 0.1 + random(); + self.think = misc_particle_setup; +}; + +//---------------------------------------------------------------------- +void() misc_particle_burst_use = +{ + particle_explode(self.origin+self.part_ofs, self.count, self.part_life, self.part_style, self.part_movetype); + // Check for temporary continuous mode + if (self.waitmin > 0) { + if (self.pausetime == 0) { + if (!self.waitmin2) self.waitmin2 = 0.1; + self.pausetime = time + self.waitmin; + } + if (self.pausetime > time) { + self.think = misc_particle_burst_use; + self.nextthink = time + self.waitmin2; + } + else self.pausetime = 0; + } +}; + +//---------------------------------------------------------------------- +// This is also used by item_custom in items.qc +//---------------------------------------------------------------------- +void() misc_particle_burst_setup = +{ + // Read tcount from entity, but it cannot be used for constant emitters + // The finish particle system will decrease the tcount directly! + if (!self.pemit_tcount) self.count = 20; + + if (!self.part_life) self.part_life = 2; + if (CheckZeroVector(self.part_ofs)) self.part_ofs = '0 0 0'; + + if (self.part_style == 1) self.part_style = PARTICLE_BURST_YELLOW; + else if (self.part_style == 2) self.part_style = PARTICLE_BURST_GREEN; + else if (self.part_style == 3) self.part_style = PARTICLE_BURST_RED; + else if (self.part_style == 4) self.part_style = PARTICLE_BURST_BLUE; + else if (self.part_style == 5) self.part_style = PARTICLE_BURST_PURPLE; + else if (self.part_style == 6) self.part_style = PARTICLE_BURST_FIRE; + else self.part_style = PARTICLE_BURST_WHITE; + + if (self.part_movetype == 3) self.part_movetype = PARTICLE_BURST_UPWARD; + else if (self.part_movetype == 4) self.part_movetype = PARTICLE_BURST_SHOCKWAVE; + else if (self.part_movetype == 5) self.part_movetype = PARTICLE_BURST_SKULLUP; + else if (self.part_movetype == 6) self.part_movetype = PARTICLE_BURST_LOSTUP; + else if (self.part_movetype == 7) self.part_movetype = PARTICLE_BURST_MINOTAUR; + else self.part_movetype = PARTICLE_BURST_CENTER; +}; + +//---------------------------------------------------------------------- +void() misc_particle_burst = +{ + // Default setup for any particle emitter + self.classtype = CT_PARTICLEEMIT; + self.pemit_source = self; + self.health = LARGE_TIMER; + + misc_particle_burst_setup(); + self.use = misc_particle_burst_use; +}; + +//---------------------------------------------------------------------- +void() misc_weather = +{ + // Setup particle emitter to start on/off + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags | PARTICLE_START_OFF; + else self.spawnflags = self.spawnflags | PARTICLE_START_ON; + + // Default setup for any particle emitter + self.classtype = CT_PARTICLEEMIT; + self.part_style = PARTICLE_STYLE_WEATHER; + self.pemit_source = self; + gen_unique_no(self); + self.state = STATE_SETUP; + + // Find out size of volume brush + InitTrigger(); + // Save the brush bounding box for later + self.bbmins = self.mins; + self.bbmaxs = self.maxs; + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin,0); + + // hide volume, no longer needed + self.solid = SOLID_NOT; + + // Setup default particle count based on volume + // - 10% of the volume size as particle count + if (!self.count) + self.count = rint((vlen(self.bbmaxs - self.bbmins)*0.1)); + + // Change for variable wind change + if (!self.speed) self.speed = 30; + self.attack_speed = time + self.speed + (random()*self.speed); + + // Setup default wind (X/Y) and vertical velocity + if (self.spawnflags & PARTICLE_WEATHER_SNOW) { + if (CheckZeroVector(self.pos1)) self.pos1 = '8 15 0'; // Mostly white + if (CheckZeroVector(self.pos2)) self.pos2 = '100 100 -100'; + } + else { + if (CheckZeroVector(self.pos1)) self.pos1 = '1 15 0'; // grey->white + if (CheckZeroVector(self.pos2)) self.pos2 = '100 100 -500'; + } + + // Particle colour range - Make sure Y > X + if (self.pos1_x > self.pos1_y) { + self.pos1_z = self.pos1_x; + self.pos1_x = self.pos1_y; + self.pos1_y = self.pos1_z; + } + // Work out range of colour + self.pos1_z = rint(self.pos1_y - self.pos1_x); + if (self.pos1_z < 1) self.pos1_z = 1; + + // Create initial wind direction + self.pos3_x = crandom() * self.pos2_x; + self.pos3_y = crandom() * self.pos2_y; + self.pos3_z = self.pos2_z; + + // Back through emitter function + self.nextthink = time + 0.1 + random(); + self.think = misc_particle_setup; +}; + +/*====================================================================== +/*QUAKED misc_particle (0 0.5 0.75) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x +A particle emitter which can be turned on/off (use function) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : destination of effect (self -> target) +target2 : name of a particle template +message : Particle style string (upper case) leave blank for custom + ALTAR, ARMOR1, ARMOR2, ARMOR3, BOOK, ELECTRIC, + FCIRCLE, FLAMES, FLAMEL, JUMPPAD, + KEYGOLD, KEYSILVER, KEYRED, KEYGREEN, KEYPURPLE, KEYWHITE, + MEGAH, PENT, PORTAL, QUAD, SIGIL, SRING, SUIT, + SKILL, BSKILL, GSKILL, PSKILL +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +A particle emitter which can be turned on/off (use function) + +//----------------------------------------------------------------------------- +/*QUAKED misc_particletemplate (0 0.5 0.75) (-8 -8 -8) (8 8 8) x +A particle emitter template +-------- KEYS -------- +targetname : target name reference for misc_particle entities +start_delay : Particle emitter start delay +spr_name1 : sprite name (progs\s_bubble_blue1.spr) +spr_name2 : sprite name (progs\s_bubble_wht.spr) +spr_name3 : sprite name (progs\s_dotmed_grey.spr) +part_movetype: Movetype of particle (def.qc for movetypes) +part_limit : Maximum amount of particles to emit at once +part_life : Life time particle is active (seconds) +part_ofs : Offset from emitter (XYZ) +part_veltype : Velocity type 1=random, 2=circular +part_vel : Velocity direction (XYZ) +part_velrand : Extra random velocity (need vel type 1) +part_velrot : Velocity rotation (Y axis only) +part_vol : Spawning volume around emitter (XYZ) +cirular_angle: Circular rotation angle +wakeup_dist : Wake up distance for particle emitter +wakeup_timer : How often to check distance check +spawn_base : Spawn rate - base value (seconds) +spawn_rand : Spawn rate - random adjustment (seconds) +dpp_name : DP particle effect name in effectinfo.txt file +dpp_wait : DP particle re-trigger timer +dpp_rnd : DP particle random multiplier for time +dpp_vel : Direction of DP particles to move towards (XYZ) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +A particle emitter template + +//----------------------------------------------------------------------------- +/*QUAKED misc_particle_burst (0 0.5 0.75) (-8 -8 -8) (8 8 8) x +A particle emitter that fires a burst +-------- KEYS -------- +targetname : Trigger Particle Emitter +part_ofs : Particle Origin Offset (def='0 0 0') +part_tcount : Particle Quantity (def=20) +part_life : Particle Life Time (def=2s) +part_style : 1=yellow, 2=green, 3=red, 4=blue, 5=purple, 6=fire, 7=white +part_movetype : 2=center, 3=up, 4=shockwave, 5=skull, 6=lost, 7=minotaur +-------- SPAWNFLAGS -------- +-------- NOTES -------- +A particle emitter that fires a burst + +//----------------------------------------------------------------------------- +/*QUAKED misc_weather (0 0.5 0.75) ? x x SILENT SNOW BLOOD SLIME STARTOFF x +A particle emitter which produces weather effects +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +count : Quantity of particles for volume +speed : Downward velocity (def=300) +v_angle : Random velocity adjustment (def=8 8 150) +wakeup_dist : how close the player needs to be for the weather to work +wakeup_timer : time to keep checking when in standby mode +-------- SPAWNFLAGS -------- +SILENT : Don't make any drip sound (good for multiple drips) +SNOW : White wispy flakes falling +BLOOD : Blood red rain +SLIME : Slime green rain +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +A particle emitter which produces weather effects + +======================================================================*/ diff --git a/QC_other/QC_arcane/part_generate.qc b/QC_other/QC_arcane/part_generate.qc new file mode 100644 index 00000000..ee392840 --- /dev/null +++ b/QC_other/QC_arcane/part_generate.qc @@ -0,0 +1,944 @@ +/*====================================================================== + Generate PARTICLES + + PRIMARY SPRITE/MODE PARTICLE EMITTER FUNCTION + - Designed for Fitz type engines (retro pixel goodness) + + DPP particle functions + - float(string effectname) particleeffectnum + - -void(entity ent, float effectnum, vector start, vector end) trailparticles + - -void(float effectnum, vector org, vector vel, float howmany) pointparticles + +======================================================================*/ +void() emit_particle; +float() emit_checksource = +{ + // killtarget can easily destroy connections between entities + // Some particle emitter types rely on the source entity connection + // Quake maintains all entities in one list with a number as reference + // If an entity is deleted the entity number can be given to any new + // entity spawned. This is not a reference to the original entity but + // it is just a location in a list. + // To get around this problem any entity that spawns a particle + // emitter will generate an unique number which the emitter will + // keep track of and compare to make sure the connection is valid. + // + // If the connection is broken, destroy particle emitter + if (self.entno_unique != self.pemit_source.entno_unique) + self.part_style = PARTICLE_STYLE_EMPTY; + + if (self.part_style == PARTICLE_STYLE_EMPTY) self.state = STATE_OFF; + // Exception - respawning particle are never blocked! + else if (self.part_style != PARTICLE_STYLE_RESPAWN) { + // Has the particle emitter SOURCE been switched off? + if (self.pemit_source.estate & ESTATE_BLOCK) self.state = STATE_OFF; + } + + // Final check to see if emitter is active or not? + if (self.state == STATE_OFF) { self.estate = ESTATE_OFF; return TRUE; } + else return FALSE; +}; + +//---------------------------------------------------------------------- +void() emitdpp_particle = { + + // Check source entity and style type are valid + if (emit_checksource()) return; + + // Double check DP particles active? (quickload issues) + // If not active, revert back to Fitz/particle system + if (!ext_dppart) { + self.think = emit_particle; + self.nextthink = time + random(); + // Check if particle banks need extending + extend_particlechain(); + return; + } + + if (self.pemit_target) { + // Easier solution for finding particle direction (velocity) + // Subtract target from source and normalize (range 0-1) + // Previous version was using vectoangles (was broken) + self.dpp_vel = normalize(self.pemit_target.origin - self.pemit_source.origin); + } + + // Check for volume particle spawning + if (!CheckZeroVector(self.part_vol)) { + + // Check if owner is a Bmodel? (different origin location) + if (self.pemit_source.bsporigin) + self.pos1 = self.pemit_source.origin + bmodel_origin(self.pemit_source); + else self.pos1 = self.pemit_source.origin; + + self.pos1_x = self.pos1_x + ( (random()*(self.part_vol_x*2)) - self.part_vol_x); + self.pos1_y = self.pos1_y + ( (random()*(self.part_vol_y*2)) - self.part_vol_y); + self.pos1_z = self.pos1_z + ( (random()*(self.part_vol_z*2)) - self.part_vol_z); + } + else self.pos1 = self.pemit_source.origin; + + // Generate particles (DP Engine) + // DP particles are designed to go at origin, not origin+offset + pointparticles(particleeffectnum(self.dpp_name), self.pos1, self.dpp_vel, 1); + self.think = emitdpp_particle; + self.nextthink = time + self.dpp_wait + (random() * self.dpp_rnd); +}; + +//---------------------------------------------------------------------- +// Custom setup for Floor Circle particle emitter +//---------------------------------------------------------------------- +void() emitdpp_fcircle = +{ + local float loop_cnt; + local vector circle_vec, circle_org; + + // Check source entity and style type are valid + if (emit_checksource()) return; + + // Double check DP particles active? (quickload issues) + // If not active, revert back to Fitz/particle system + if (!ext_dppart) { + self.think = emit_particle; + self.nextthink = time + random(); + return; + } + + loop_cnt = 4; + while(loop_cnt > 0) { + loop_cnt = loop_cnt - 1; + + circle_vec = '0 0 0'; + circle_vec_y = circle_vec_y + rint(random()*360); + makevectors(circle_vec); + circle_org = self.pemit_source.origin + v_forward * self.part_vol_x; + + // Generate particles (DP Engine) around circumference + pointparticles(particleeffectnum(self.dpp_name), circle_org, self.dpp_vel, 1); + } + + // Draw bright pulse ring texture over the floor pattern + // Only draw this if the circle is the original shape + if (self.part_vol_x == 56) + pointparticles(particleeffectnum(DPP_FCIRCLE_RING), self.pemit_source.origin, '0 0 0', 1); + + self.think = emitdpp_fcircle; + self.nextthink = time + self.dpp_wait + (random() * self.dpp_rnd); +}; + +//====================================================================== +// Particle weather system +//====================================================================== +// splash animation (runs at 20fps) +void() pe_splash1 = [0, pe_splash2] {self.nextthink = time+0.05;}; +void() pe_splash2 = [1, pe_splash3] {self.nextthink = time+0.05;}; +void() pe_splash3 = [2, pe_splash4] {self.nextthink = time+0.05;}; +void() pe_splash4 = [3, pe_splash5] {self.nextthink = time+0.05;}; +void() pe_splash5 = [4, pe_splash6] {self.nextthink = time+0.05;}; +void() pe_splash6 = [5, finish_particle] {self.nextthink = time+0.05;}; + +//---------------------------------------------------------------------- +void() emitepp_weather = +{ + // Check for variable wind direction + if (self.attack_speed < time && self.speed > 0) { + self.attack_speed = time + self.speed + (random()*self.speed); + self.pos3_x = crandom() * self.pos2_x; + self.pos3_y = crandom() * self.pos2_y; + } + + // Work out random colour range + self.t_width = self.pos1_x + random()*self.pos1_z; + // Vary the count by +/- 25% of total + self.t_length = self.count * 0.75 + ((random() * 0.5) * self.count); + // Vary the wind speed by +/- 25% of total + self.pos3_z = self.pos2_z * 0.75 + ((random() * 0.5) * self.pos2_z); + + // DP volume particle system parameters + // vector mins : minimum corner of the cube + // vector maxs : maximum corner of the cube + // vector velocity : velocity of particles + // short count : number of particles + // byte color : 8bit palette color + + // Double check if engine weather systems are enabled + if (query_configflag(SVR_WEATHER)) { + // Wait for any change, slow timer + self.think = emitepp_weather; + self.nextthink = time + 2; + } + else { + if (self.spawnflags & PARTICLE_WEATHER_SNOW) + te_particlesnow(self.bbmins, self.bbmaxs, self.pos3, self.t_length, self.t_width); + else te_particlerain(self.bbmins, self.bbmaxs, self.pos3, self.t_length, self.t_width); + self.think = emitepp_weather; + self.nextthink = time + 0.1; + } + +}; + +//---------------------------------------------------------------------- +void() emit_weather_think = +{ + if (self.origin_z < (self.pos2_z-4)) { + self.movetype = MOVETYPE_NONE; + setorigin(self, self.pos2 + '0 0 12'); + setmodel(self, self.headmdl); + self.velocity = '0 0 0'; + pe_splash1(); + } + else { + self.think = emit_weather_think; + self.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() emit_weather = +{ + // Check source entity and style type are valid + if (emit_checksource()) return; + if (!ext_dppart) return; + + // Setup next particle (loop) + self.think = emit_weather; + + // make sure player distance check is available + if (!self.enemy) self.enemy = find(world, classname, "player"); + if ( !(self.enemy.flags & FL_CLIENT) ) { + self.nextthink = time + 0.1; + return; + } + + // Is the particle emitter close to the player? + if (range_distance(self.enemy, TRUE) < self.wakeup_dist) { + + // Normal think timer, player within range + self.nextthink = time + self.spawn_base + (random()*self.spawn_rand); + + // Is there anymore particles left to spawn? + if (self.pemit_tcount < self.part_limit) { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + self.pemit_tcount = self.pemit_tcount + 1; + part.movetype = self.part_movetype; + setmodel(part, self.spr_name1); + part.headmdl = self.spr_name2; + setsize(part, VEC_ORIGIN, VEC_ORIGIN); + part.velocity_x = self.part_velrand_x * random(); + part.velocity_y = self.part_velrand_y * random(); + part.velocity_z = self.part_velrand_z * random(); + part.velocity = part.velocity + self.part_vel; + part.velocity_z = -part.velocity_z; + + // Pick a random point across the top of volume + part.pos1_x = self.pos1_x * random(); + part.pos1_y = self.pos1_y * random(); + part.pos1_z = 0; + part.pos1 = part.pos1 + self.pos2; + setorigin(part, part.pos1); + + // trace down to find travel distance + traceline (part.pos1, part.pos1 + '0 0 -4096', TRUE, self); + part.pos2 = trace_endpos; + + // Find out if any liquid in the way + if (trace_inwater) self.height = 8; + else self.count = 0; + + // Binary divide the distance to find water surface + while (self.height > 0) { + // Break out early from loop if <8 from water surface + if (fabs(part.pos2_z-part.pos1_z) < 8) self.height = 0; + // Calculate midway point between origin and endtrace + part.pos3 = part.pos1; + part.pos3_z = part.pos1_z + ((part.pos2_z - part.pos1_z)*0.5); + + // Test which half has water and shift top/bottom positions + traceline (part.pos1, part.pos3, TRUE, self); + if (trace_inwater) part.pos2 = part.pos3; + else part.pos1 = part.pos3; + // Only loop a limited amount of times + self.height = self.height - 1; + } + + // Check travel distance + part.think = emit_weather_think; + part.nextthink = time + 0.1; + + } + } + } + else { + // If no player within range of the emitter, slower think timer + self.nextthink = time + self.wakeup_timer + (random()*self.spawn_rand); + } +}; + +//---------------------------------------------------------------------- +void() emit_particle = +{ + local float randno; + local vector angle_vec; + + // Check source entity and style type are valid + if (emit_checksource()) return; + + // Setup next particle (loop) + self.think = emit_particle; + + // make sure player distance check is available + if (!self.enemy) self.enemy = find(world, classname, "player"); + if ( !(self.enemy.flags & FL_CLIENT) ) { + self.nextthink = time + 0.1; + return; + } + + // Is the particle emitter close to the player? + if (range_distance(self.enemy, TRUE) < self.wakeup_dist) { + + // Normal think timer, player within range + self.nextthink = time + self.spawn_base + (random()*self.spawn_rand); + + // Is there anymore particles left to spawn? + if (self.pemit_tcount < self.part_limit) { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + self.pemit_tcount = self.pemit_tcount + 1; + part.movetype = self.part_movetype; // 6=Gravity, 8=Noclip, 10=Bounce + + // Select particle type + randno = random(); + + //---------------------------------------------------------------------- + // Setup SPRITE particle (string and frame no) + //---------------------------------------------------------------------- + if (randno < 0.3) setmodel(part, self.spr_name1); + else if (randno < 0.6) setmodel(part, self.spr_name2); + else setmodel(part, self.spr_name3); + + //---------------------------------------------------------------------- + // Sprite Frame style (1=LIGHT, 2=DARK, 3=ALL) + //---------------------------------------------------------------------- + if (self.spr_frame == 1) part.frame = rint(random()*1.4); + else if (self.spr_frame == 2) part.frame = rint(random()*2); + else part.frame = rint(random()*3.4); + + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + //---------------------------------------------------------------------- + // STARTING POINT (Particle origin - uses MANGLE key) + // + // 0 = Randomly picked from a volume (X/Y/Z) - DEFAULT + // 1 = Circular motion (radius/segment controlled) + // 2 = Randomly pick a point on the circle circumference + // 3 = Spiral in/out from circle circumference + // 5 = Explosion from central point + //---------------------------------------------------------------------- + // Circular motion around emitter (self) + if (self.part_veltype == PARTICLE_ORIGIN_CIRCLE) { + angle_vec = '0 0 0'; + angle_vec_y = angle_vec_y + self.circular_angle; + makevectors(angle_vec); + part.origin = self.origin + v_forward * self.part_vol_x; + setorigin (part, part.origin + self.part_ofs); + self.circular_angle = anglemod(self.circular_angle + self.part_vol_y); + } + // Random circumference point around emitter (self) + else if (self.part_veltype == PARTICLE_ORIGIN_RANDCIRCLE) { + angle_vec = '0 0 0'; + angle_vec_y = angle_vec_y + rint(random()*360); + makevectors(angle_vec); + part.origin = self.origin + v_forward * self.part_vol_x; + setorigin (part, part.origin + self.part_ofs); + } + // Spiral in/out around circumference point (self) + else if (self.part_veltype == PARTICLE_ORIGIN_SPIRAL) { + angle_vec = '0 0 0'; + angle_vec_y = angle_vec_y + self.circular_angle; + makevectors(angle_vec); + if (self.lefty == 0) self.lefty = 1; + self.part_vol_z = self.part_vol_z + self.lefty; + if (self.part_vol_z == 0) self.lefty = 1; + if (self.part_vol_z == self.part_vol_x) self.lefty = -1; + part.origin = self.origin + v_forward * self.part_vol_z; + setorigin (part, part.origin + self.part_ofs); + self.circular_angle = anglemod(self.circular_angle + self.part_vol_y); + } + // Explosion from central point (self) + else if (self.part_veltype == PARTICLE_ORIGIN_CENTER) { + // Always calculate from the center of original object + part.origin = self.pemit_source.origin + self.part_ofs; + setorigin (part, part.origin); + } + // Random volume point around particle (part) + else { + // Check if owner is a Bmodel? (different origin location) + if (self.pemit_source.bsporigin) { + part.pos1 = self.pemit_source.origin + bmodel_origin(self.pemit_source); + part.origin = part.pos1; + // Double check the bmodel volume has been setup correctly (not zero) + // Particle emitters can be started before bmodel has initialized + if (CheckZeroVector(self.part_vol)) self.part_vol = self.pemit_source.size * 0.5; + } + else part.origin = self.pemit_source.origin + self.part_ofs; + + part.origin_x = part.origin_x + ( (random()*(self.part_vol_x*2)) - self.part_vol_x); + part.origin_y = part.origin_y + ( (random()*(self.part_vol_y*2)) - self.part_vol_y); + part.origin_z = part.origin_z + ( (random()*(self.part_vol_z*2)) - self.part_vol_z); + setorigin (part, part.origin); + } + + //---------------------------------------------------------------------- + // VELOCITY (Particle speed/direction - uses ANGLES key) + // + // Initially setup linear velocity + // if PART_VELRAND defined create extra wobble/randomness + // if oldenemy (noise4) specified go towards specific target entity + //---------------------------------------------------------------------- + if (self.pemit_target) { + // Check if finish target is a Bmodel? (different origin location) + if (self.pemit_target.bsporigin) { + part.pos2 = self.pemit_target.origin + bmodel_origin(self.pemit_target); + angle_vec = part.pos2 - part.origin; + } + else + angle_vec = self.pemit_target.origin - part.origin; // Target -> Self + + angle_vec = normalize(angle_vec); // vector unit scale + part.velocity = angle_vec * ( (random()*self.part_vel_x) + self.part_vel_x); + + // Add extra wobble if part_velrand defined + if (self.part_velrand_x > 0 || self.part_velrand_y > 0 || self.part_velrand_z > 0) { + part.velocity_x = part.velocity_x + (random()*(self.part_velrand_x*2)) - self.part_velrand_x; + part.velocity_y = part.velocity_y + (random()*(self.part_velrand_y*2)) - self.part_velrand_y; + part.velocity_z = part.velocity_z + (random()*(self.part_velrand_z*2)) - self.part_velrand_z; + } + } + // Explosion from central point (self) + else if (self.part_veltype == PARTICLE_ORIGIN_CENTER) { + // Setup BASE + CRANDOM (+/-) velocity + part.velocity = '0 0 0'; + part.velocity_x = self.part_vel_x - (random()*(self.part_vel_x*2)); + part.velocity_y = self.part_vel_y - (random()*(self.part_vel_y*2)); + part.velocity_z = self.part_vel_z - (random()*(self.part_vel_z*2)); + part.velocity = part.velocity + self.part_velbase; + } + else { + // Setup BASE + RANDOM (+) velocity + part.velocity = '0 0 0'; + part.velocity_x = random(self.part_vel_x) + self.part_vel_x; + part.velocity_y = random(self.part_vel_y) + self.part_vel_y; + part.velocity_z = random(self.part_vel_z) + self.part_vel_z; + part.velocity = part.velocity + self.part_velbase; + + // Add extra wobble if part_velrand defined + if (self.part_velrand_x > 0 || self.part_velrand_y > 0 || self.part_velrand_z > 0) { + part.velocity_x = part.velocity_x + (random()*(self.part_velrand_x*2)) - self.part_velrand_x; + part.velocity_y = part.velocity_y + (random()*(self.part_velrand_y*2)) - self.part_velrand_y; + part.velocity_z = part.velocity_z + (random()*(self.part_velrand_z*2)) - self.part_velrand_z; + } + } + //---------------------------------------------------------------------- + // ROTATION (Y axis only - uses PART_VELROT key) + // Random Y axis rotation + //---------------------------------------------------------------------- + if (self.part_velrot) { + part.angles = self.enemy.angles; // Rotate the same way first + part.avelocity = '0 0 0'; + part.avelocity_y = self.part_velrot + (random()*self.part_velrot); + } + + // Setup time of death! + part.nextthink = time + random() + self.part_life; + part.think = finish_particle; + } + + } + } + else { + // If no player within range of the emitter, slower think timer + self.nextthink = time + self.wakeup_timer + (random()*self.spawn_rand); + } +}; + +//---------------------------------------------------------------------- +// Pick a particle sprite based on type +//---------------------------------------------------------------------- +void(entity part_ent, float part_style) particle_style = +{ + local float ring_rand; + + ring_rand = random(); + if (ring_rand < 0.4) { + if (part_style & PARTICLE_BURST_YELLOW) setmodel (part_ent, PART_DOTSML_GOLD); + else if (part_style & PARTICLE_BURST_GREEN) setmodel (part_ent, PART_DOTSML_LGREEN); + else if (part_style & PARTICLE_BURST_RED) setmodel (part_ent, PART_DOTSML_GREY); + else if (part_style & PARTICLE_BURST_BLUE) setmodel (part_ent, PART_DOTSML_BLUE); + else if (part_style & PARTICLE_BURST_PURPLE) setmodel (part_ent, PART_DOTSML_PURP); + else if (part_style & PARTICLE_BURST_FIRE) setmodel (part_ent, PART_TORCH1); + else setmodel (part_ent, PART_DOTSML_WHITE); + } + else if (ring_rand < 0.8) { + //---------------------------------------------------------------------- + if (part_style & PARTICLE_BURST_YELLOW) setmodel (part_ent, PART_DOTSML_YELLOW); + else if (part_style & PARTICLE_BURST_GREEN) setmodel (part_ent, PART_DOTSML_GREEN); + else if (part_style & PARTICLE_BURST_RED) setmodel (part_ent, PART_DOTSML_RED); + else if (part_style & PARTICLE_BURST_BLUE) setmodel (part_ent, PART_DOTSML_GREY); + else if (part_style & PARTICLE_BURST_PURPLE) setmodel (part_ent, PART_DOTSML_GREY); + else if (part_style & PARTICLE_BURST_FIRE) setmodel (part_ent, PART_DOTSML_GOLD); + else setmodel (part_ent, PART_DOTSML_GREY); + } + else { + //---------------------------------------------------------------------- + if (part_style & PARTICLE_BURST_YELLOW) setmodel (part_ent, PART_DOTMED_YELLOW); + else if (part_style & PARTICLE_BURST_GREEN) setmodel (part_ent, PART_DOTMED_GREEN); + else if (part_style & PARTICLE_BURST_RED) setmodel (part_ent, PART_DOTMED_RED); + else if (part_style & PARTICLE_BURST_BLUE) setmodel (part_ent, PART_DOTMED_BLUE); + else if (part_style & PARTICLE_BURST_PURPLE) setmodel (part_ent, PART_DOTMED_PURP); + else if (part_style & PARTICLE_BURST_FIRE) setmodel (part_ent, PART_DOTMED_GREY); + else setmodel (part_ent, PART_DOTMED_GREY); + } + // Random frame (sprite) + part.frame = rint(random()*3); +}; + +//---------------------------------------------------------------------- +// Particle ring explosion (used for respawn function) +// ring_org : center of particle ring +// ring_dir : direction for particles to move +// ring_rdir : random wobble for particle direction +// ring_rad : starting point offset (grow/shrink ring size) +// ring_qty : circle division (how many points around circumference) +// ring_time : lifespan of particle (time + random()*time) +// ring_style : particle ring colour (1=yellow, 2=green, 3=red, 4=white) +//---------------------------------------------------------------------- +void(vector ring_org, vector ring_dir, vector ring_rdir, float ring_rad, float ring_qty, float ring_time, float ring_style) particle_ring = +{ + local vector circle_vec, circle_org; + local float ring_loop, ring_angle; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Setup DP particle style based on supplied style + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + if (ring_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_RINGPARTY; + else if (ring_style & PARTICLE_BURST_GREEN) dpp_string = DPP_RINGPARTG; + else if (ring_style & PARTICLE_BURST_RED) dpp_string = DPP_RINGPARTR; + else if (ring_style & PARTICLE_BURST_BLUE) dpp_string = DPP_RINGPARTB; + else if (ring_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_RINGPARTP; + else dpp_string = DPP_RINGPARTW; + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+ring_qty) >= part_max - 1) return; + } + + ring_loop = 0; + ring_angle = 360 / ring_qty; + while (ring_loop < ring_qty) { + // Is the DP particle system active? + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // Work out point on circle circumference using + // the v_forward vector with incremental angles + circle_vec = '0 0 0'; + circle_vec_y = circle_vec_y + (ring_angle * ring_loop); + makevectors(circle_vec); + circle_org = ring_org + (v_forward * ring_rad); + + // Generate particles (DP Engine) + pointparticles(particleeffectnum(dpp_string), circle_org, '0 0 0', 1); + } + else { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + part.movetype = MOVETYPE_NOCLIP; + + // Setup correct particle type (sprite/model) based on ring colour + particle_style(part, ring_style); + + // Work out point on circle circumference using + // the v_forward vector with incremental angles + circle_vec = '0 0 0'; + circle_vec_y = circle_vec_y + (ring_angle * ring_loop); + makevectors(circle_vec); + part.origin = ring_org + (v_forward * ring_rad); + setorigin (part, part.origin); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + // Setup particle velocity with random element + part.velocity_x = ring_dir_x + ( (random()*(ring_rdir_x*2)) - ring_rdir_x); + part.velocity_y = ring_dir_y + ( (random()*(ring_rdir_y*2)) - ring_rdir_y); + part.velocity_z = ring_dir_z + (random()*ring_rdir_z); + + // Setup time of death! + part.nextthink = time + (random()*ring_time) + ring_time; + part.think = finish_particle; + } + } + // Keep on loopin! + ring_loop = ring_loop + 1; + } +}; + +//---------------------------------------------------------------------- +void(entity part_ent, vector part_org, float expl_style) explosion_style = +{ + local vector org_volume, expl_vel; + + // Ogre hammer is a flat floor explosion with particles bouncing + if (expl_style & PARTICLE_BURST_SHOCKWAVE) { + org_volume = '0 0 0'; + org_volume_x = crandom()*16; + org_volume_y = crandom()*16; + part_ent.origin = part_org + org_volume; + setorigin (part_ent, part_ent.origin); + + // Random chance of dead particles that are + // stationary on the ground + if (random() < 0.3) { + part_ent.velocity = '0 0 0'; + if (random() < 0.5) setmodel (part_ent, PART_DOTSML_GREY); + else setmodel (part_ent, PART_DOTMED_GREY); + part_ent.frame = rint(random()*3); + } + else { + // Particles that explode up and out + expl_vel_x = crandom() * 75; + expl_vel_y = crandom() * 75; + expl_vel_z = 150 + random() * 150; + part_ent.velocity = expl_vel; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_TOSS; + part_ent.gravity = 0.75; + part_ent.flags = 0; + } + } + // Skull wizard teleporting = particle burst upwards + else if (expl_style & PARTICLE_BURST_SKULLUP) { + part_ent.origin_x = part_org_x + crandom()*8; + part_ent.origin_y = part_org_y + crandom()*8; + // If skull wizard dead, spawn particles from robes on floor + // Otherwise the particles are being used for a teleport + if (self.health < 0) part_ent.origin_z = part_org_z - MON_VIEWOFS; + else part_ent.origin_z = part_org_z - crandom()*MON_VIEWOFS; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*8; + part_ent.velocity_y = crandom()*8; + part_ent.velocity_z = random()*25; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + // Lost souls fire particles upwards + else if (expl_style & PARTICLE_BURST_LOSTUP) { + part_ent.origin_x = part_org_x + crandom()*4; + part_ent.origin_y = part_org_y + crandom()*4; + part_ent.origin_z = part_org_z; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*4; + part_ent.velocity_y = crandom()*4; + part_ent.velocity_z = random()*10; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + // Minotaur finished plasma attack + else if (expl_style & PARTICLE_BURST_MINOTAUR) { + part_ent.origin_x = part_org_x + crandom()*8; + part_ent.origin_y = part_org_y + crandom()*8; + part_ent.origin_z = part_org_z - crandom()*MON_VIEWOFS; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*8; + part_ent.velocity_y = crandom()*8; + part_ent.velocity_z = random()*35; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + // Generic particle burst drifting upward + else if (expl_style & PARTICLE_BURST_UPWARD) { + part_ent.origin_x = part_org_x + crandom()*24; + part_ent.origin_y = part_org_y + crandom()*24; + part_ent.origin_z = part_org_z + random()*64; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*16; + part_ent.velocity_y = crandom()*16; + part_ent.velocity_z = 8+random()*16; + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + else { + // default = explode outwards in all directions + part_ent.origin = part_org; + setorigin (part_ent, part_ent.origin); + part_ent.velocity = vecrand(0,16,TRUE); + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } +}; + +/*====================================================================== + Particle Implode + + e_org : center of particle implode + e_qty : quantity of particle burst + e_speed : Particle speed towards center + e_dist : circumference of implosion circle + p_style : sprite style (check function particle_style above) +======================================================================*/ +void(vector e_org, float e_qty, float e_speed, float e_dist, float p_style) particle_implode = +{ + local float e_loop, e_len, e_traveltime; + local vector e_dir, e_vdestdelta, e_finaldest; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+e_qty) >= part_max - 1) return; + + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // Setup DP particle style based on supplied style + if (p_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_BURSTPARTY; + else if (p_style & PARTICLE_BURST_GREEN) dpp_string = DPP_BURSTPARTG; + else if (p_style & PARTICLE_BURST_RED) dpp_string = DPP_BURSTPARTR; + else if (p_style & PARTICLE_BURST_BLUE) dpp_string = DPP_BURSTPARTB; + else if (p_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_BURSTPARTP; + else dpp_string = DPP_BURSTPARTW; + } + // pointparticles(particleeffectnum(dpp_string), e_org, '0 0 0', e_qty); + + e_loop = 0; + while (e_loop < e_qty) { + e_loop = e_loop + 1; // Keep on loopin! + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + particle_style(part, p_style); + + // Work out random direction from origin center + e_dir = normalize(vecrand(0,50,TRUE)); + e_finaldest = e_org + e_dir * (e_dist + random()*50); + + // Calculate distance and time travelled + e_vdestdelta = e_org - e_finaldest; + e_len = vlen(e_vdestdelta); + e_traveltime = e_len / (e_speed + random()*50); + + // Move to outer edge of implosion circle + setorigin(part, e_finaldest); + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + part.movetype = MOVETYPE_NOCLIP; + + // Setup inward velocity and time to kill + part.velocity = e_vdestdelta * (1/e_traveltime); + part.nextthink = time + e_traveltime; + part.think = finish_particle; + } + } +}; + +/*====================================================================== + Particle explosion + + e_org : center of particle explosion + e_qty : quantity of particle burst + e_time : lifespan of particle (time + random()*time) + p_style : sprite style (check function particle_style above) + e_style : explosion style (pre-defined in part_manage.qc) +======================================================================*/ +void(vector e_org, float e_qty, float e_time, float p_style, float e_style) particle_explode = +{ + local float e_loop; + local vector dp_vec; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Can only have integer particle quantity + e_qty = rint(e_qty); + + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // DP hammer impact, 1=regular 2=shockwave + if (e_style & PARTICLE_BURST_SHOCKWAVE) { + if (e_style & 1) pointparticles(particleeffectnum(DPP_BURSTSHOCKWAVE1), e_org, '0 0 0', 1); + else pointparticles(particleeffectnum(DPP_BURSTSHOCKWAVE1), e_org, '0 0 0', 1); + } + else { + // Setup DP particle style based on supplied style + if (p_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_BURSTPARTY; + else if (p_style & PARTICLE_BURST_GREEN) dpp_string = DPP_BURSTPARTG; + else if (p_style & PARTICLE_BURST_RED) dpp_string = DPP_BURSTPARTR; + else if (p_style & PARTICLE_BURST_BLUE) dpp_string = DPP_BURSTPARTB; + else if (p_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_BURSTPARTP; + else dpp_string = DPP_BURSTPARTW; + pointparticles(particleeffectnum(dpp_string), e_org, '0 0 0', e_qty); + } + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+e_qty) >= part_max - 1) return; + e_loop = 0; + while (e_loop < e_qty) { + e_loop = e_loop + 1; // Keep on loopin! + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + particle_style(part, p_style); + explosion_style(part, e_org, e_style); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + part.nextthink = ((time + (random() * e_time)) + e_time); + part.think = finish_particle; + } + } + } +}; + +//---------------------------------------------------------------------- +// Slowly rising cloud of particle dots +//---------------------------------------------------------------------- +void(vector debuff_center, float debuff_volsize, float debuff_qty, float debuff_style) particle_debuff = +{ + local float debuff_loop, debuff_time; + local vector debuff_org, debuff_vol; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Setup DP particle style based on supplied style + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + if (debuff_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_RINGPARTY; + else if (debuff_style & PARTICLE_BURST_GREEN) dpp_string = DPP_RINGPARTG; + else if (debuff_style & PARTICLE_BURST_RED) dpp_string = DPP_RINGPARTR; + else if (debuff_style & PARTICLE_BURST_BLUE) dpp_string = DPP_RINGPARTB; + else if (debuff_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_RINGPARTP; + else dpp_string = DPP_RINGPARTW; + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+debuff_qty) >= part_max - 1) return; + } + + debuff_loop = 0; + debuff_time = 2; + + while (debuff_loop < debuff_qty) { + debuff_vol = vecrand(0,debuff_volsize,TRUE); + debuff_org = debuff_center + debuff_vol; + + // Is the DP particle system active? + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) + pointparticles(particleeffectnum(dpp_string), debuff_org, '0 0 0', 1); + else { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + part.movetype = MOVETYPE_NOCLIP; + + // Setup correct particle type (sprite/model) based on ring colour + particle_style(part, debuff_style); + setorigin (part, debuff_org); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + // Setup particle velocity with random element + part.velocity = vecrand(0,2,TRUE); + part.velocity_z = 8 + random()*24; + + // Setup time of death! + part.nextthink = time + (random()*debuff_time) + debuff_time; + part.think = finish_particle; + } + } + // Keep on loopin! + debuff_loop = debuff_loop + 1; + } +}; + +//---------------------------------------------------------------------- +// Falling particle dust/dots +//---------------------------------------------------------------------- +void(vector dust_center, float dust_qty, float dust_style) particle_dust = +{ + local float dust_loop, dust_volsize, dust_time; + local vector dust_org, dust_vol; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Setup DP particle style based on supplied style + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + if (dust_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_RINGPARTY; + else if (dust_style & PARTICLE_BURST_GREEN) dpp_string = DPP_RINGPARTG; + else if (dust_style & PARTICLE_BURST_RED) dpp_string = DPP_RINGPARTR; + else if (dust_style & PARTICLE_BURST_BLUE) dpp_string = DPP_RINGPARTB; + else if (dust_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_RINGPARTP; + else dpp_string = DPP_RINGPARTW; + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+dust_qty) >= part_max - 1) return; + } + + dust_loop = 0; + dust_time = 1; + dust_volsize = 16; + + while (dust_loop < dust_qty) { + dust_vol = vecrand(0,dust_volsize,TRUE); + dust_org = dust_center + dust_vol; + + // Is the DP particle system active? + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) + pointparticles(particleeffectnum(dpp_string), dust_org, '0 0 0', 1); + else { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + part.movetype = MOVETYPE_NOCLIP; + part.solid = SOLID_NOT; + + // Setup correct particle type (sprite/model) based on ring colour + particle_style(part, dust_style); + setorigin (part, dust_org); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + // Setup particle velocity with random element + part.velocity = vecrand(0,35,TRUE); + part.velocity_z = -100 - random()*100; + part.avelocity = '300 300 300'; + + // Setup time of death! + part.nextthink = time + (random()*dust_time) + dust_time; + part.think = finish_particle; + } + } + // Keep on loopin! + dust_loop = dust_loop + 1; + } +}; diff --git a/QC_other/QC_arcane/part_manage.qc b/QC_other/QC_arcane/part_manage.qc new file mode 100644 index 00000000..1a36c56d --- /dev/null +++ b/QC_other/QC_arcane/part_manage.qc @@ -0,0 +1,546 @@ +//====================================================================== +// Particle System +//====================================================================== +// Particle management +float PARTICLE_MAXENTS = 1024; // Maximum amount of particles active (default) +float PARTICLE_BANK = 64; // How many particle in each setup bank +float PARTICLE_BUFFER = 128; // How many particle to create before unlock +float part_message; // Timer for particle message (every 3s) +entity part_control; // Particle setup entity (drives nextthink) +entity part_start; // Pointers to start/end particle chain +entity part_end; +entity part_free; // Current particle entity +float part_total; // Currently active particles +float part_max; // Maximum active particles +entity part; // Spawning particle emitters and particles + +//---------------------------------------------------------------------- +// Particle emitter parameters +float PARTICLE_START_OFF = 1; // Particle emitter starts OFF +float PARTICLE_START_ON = 2; // Particle emitter starts ON +float PARTICLE_WEATHER_SNOW = 8; // Weather snow - White + +.float particlemax; // Maximum about of ACTIVE particles per map +.entity entchain; // Entity pointer to next entity in chain +.entity part_emitter; // Particle emitter link on any entity +.entity pemit_source; // Source/owner of particle emitter +.entity pemit_target; // Particle emitter target entity +.float target_valid; // Test condition for valid target entity (not self or world) +.float part_style; // Pre-defined particle styles +.float pemit_tcount; // Particle emitter, total active particles +.float part_active; // Is the particle active or not +.float start_delay; // Particle emitter start delay +.float dpp_only; // Is the particle a DPP only effect? +.string dpp_name; // DP particle effect name in effectinfo.txt file +.float dpp_wait; // DP particle re-trigger timer +.float dpp_rnd; // DP particle random multiplier for time +.vector dpp_vel; // Direction of DP particles to move towards + +//---------------------------------------------------------------------- +// Particle style parameters +.string spr_name1; // Sprite string name 1 (uses defs) +.string spr_name2; // Sprite string name 2 +.string spr_name3; // Sprite string name 3 +.float spr_frame; // Sprite frame type 1=all, 2=light, 3=dark +.float part_limit; // Maximum amount of particles to emit +.float part_life; // Life time +.vector part_ofs; // Offset from emitter +.float part_veltype; // Velocity types +.vector part_velbase; // Base velocity (always this direction) +.vector part_vel; // Random Velocity direction (vel+random*vel) +.vector part_velrand; // Extra random velocity wobble +.float part_velrot; // Velocity rotation (Y axis only) +.vector part_vol; // Spawning volume +.float circular_angle; // Circular rotation angle +.float part_movetype; // Movetype of particle +.float wakeup_dist; // Wake up distance for particle emitter +.float wakeup_timer; // How often to check distance check +.float spawn_base; // Spawn rate - base value +.float spawn_rand; // Spawn rate - random adjustment + +// Compiler forward links +void() setup_particleprecache; + +//---------------------------------------------------------------------- +// The particle is finished with, update emitter particle counter +//---------------------------------------------------------------------- +void() finish_particle = +{ + if (self.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_RETURN]\b This is not a particle!?!\n"); + } + else { + if (self.owner.pemit_tcount > 0) + self.owner.pemit_tcount = self.owner.pemit_tcount - 1; + + self.velocity = VEC_ORIGIN; // no more movement + self.avelocity = VEC_ORIGIN; + self.origin = VEC_ORIGIN; + self.part_active = FALSE; // Finished with particle + setmodel(self, ""); // Remove from world + self.owner = world; // No owner anymore + self.skin = self.frame = self.flags = FALSE; + self.gravity = 1; + + // Update active particle total + if (part_total > 1) part_total = part_total - 1; + + if (part_free.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_RETURN]\b Current free particle is wrong classtype!!\n"); + } + else { + // Add particle back into central particle list + self.entchain = part_free.entchain; // link new particle forward in chain + part_free.entchain = self; // link free particle to new particle + + if (part_debug == 2) { + dprint("Return Free ("); dprint(ftos(part_free.cnt)); + dprint(") Next ("); dprint(ftos(part_free.entchain.cnt)); + dprint(")\n"); + } + } + } +}; + +//---------------------------------------------------------------------- +// All requests for particles must go through one function +//---------------------------------------------------------------------- +entity() fetch_particle = +{ + local entity tpart_ret; + tpart_ret = world; // Default - no particle returned + + // Make sure the system has 2 banks of particles setup first! + if (part_control.count < PARTICLE_BUFFER) return tpart_ret; + + // Display particle limits if skill set to a debug number + if (part_debug == 1) { + sprint(client_ent, "CREATE Particle ("); sprint(client_ent, ftos(part_total)); + sprint(client_ent, "/"); sprint(client_ent, ftos(part_max)); + sprint(client_ent, ")\n"); + } + + // Are there any free particles? + if (part_total >= part_max - 1) { + if (part_message < time) { + dprint("\b[PARTICLE]\b current limit ("); dprint(ftos(part_max)); + dprint(") too low!\n"); + part_message = time + 5; // interval console spam + } + } + else { + if (part_free.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_FETCH]\b Current free particle is wrong classtype!!\n"); + } + else if (part_free.entchain.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_FETCH]\b Next free particle is wrong classtype!!\n"); + dprint("Free ("); dprint(ftos(part_free.cnt)); + dprint(") Ctype ("); dprint(ftos(part_free.classtype)); + dprint(") Next ("); dprint(ftos(part_free.entchain.cnt)); + dprint(") Ctype ("); dprint(ftos(part_free.entchain.classtype)); + dprint(")\n"); + } + else { + tpart_ret = part_free.entchain; // return next free particle + part_free.entchain = tpart_ret.entchain; // Skip forward in the chain + + // Update currently active particle total + part_total = part_total + 1; + tpart_ret.part_active = TRUE; + + if (part_debug == 2) { + dprint("Fetch Free ("); dprint(ftos(part_free.cnt)); + dprint(") return ("); dprint(ftos(tpart_ret.cnt)); + dprint(")\n"); + } + } + } + + return (tpart_ret); +}; + +//---------------------------------------------------------------------- +// Generate a chain of entities (one block at a time) +//---------------------------------------------------------------------- +void() generate_particlechain = +{ + local entity part_prev, part_first; + local float pcount; + + // Reset all variables + part_first = part_prev = part = world; + pcount = 0; + + // Is there anymore particles need to be created? + if (self.count + 1 < part_max) { + dprint("\b[PCHAIN]\b Part bank ("); + dprint(ftos(self.count)); dprint(" / "); + dprint(ftos(part_max)); dprint(")\n"); + + while (pcount < PARTICLE_BANK) { + // Create a new particle entity + part = spawn(); + part.solid = SOLID_NOT; + part.owner = world; + part.part_active = FALSE; + part.classname = "particle"; + part.classtype = CT_PARTICLE; + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) part.effects = part.effects + EF_NOSHADOW; + part.cnt = self.count + pcount; + + pcount = pcount + 1; // Increase loop + + //---------------------------------------------------------------------- + // Link particle chains together + if (part_prev.classtype != CT_PARTICLE) + part_first = part; // NEW CHAIN - setup all entity pointers + else part_prev.entchain = part; // EXISTING CHAIN - Link particles together + + part_prev = part; // Setup previous particle in chain + //---------------------------------------------------------------------- + } + + // Update total particles generated + self.count = self.count + PARTICLE_BANK; + + //---------------------------------------------------------------------- + // Are there any previous banks of particles? + if (part_start.classtype != CT_PARTICLE) { + // NEW BANK - Setup start/end particle and close chain + part_start = part.entchain = part_first; + part_free = part_first.entchain; // Move forward 1 + part_end = part; + } + else { + // EXISTING BANK - Link new bank to existing banks + part_end.entchain = part_first; // Link end and first of new bank together + part.entchain = part_start; // Link current and start together + part_end = part; // Move end of bank forward + } + //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- + // Is there anymore particles need to be created? + if (self.count + 1 < part_max) { + self.think = generate_particlechain; + self.nextthink = time + 0.2; + } + // Finished generating particle banks + else self.waitmin = FALSE; +}; + +//---------------------------------------------------------------------- +// Setup particle chain in small banks +//---------------------------------------------------------------------- +void() setup_particlechain = +{ + // Pre-cache all sprites + setup_particleprecache(); + + if (part_control.classtype != CT_PARTICLECONT) { + part_control = spawn(); + part_control.solid = SOLID_NOT; + part_control.classtype = CT_PARTICLECONT; + + dprint("\b[PCHAIN]\b Creating controller\n"); + part_free = part_end = part_start = world; + part_total = part_control.count = 0; + part_control.waitmin = TRUE; + } + // Setup next think + part_control.think = generate_particlechain; + part_control.nextthink = time + 0.3; +}; + +//---------------------------------------------------------------------- +// Extend particle chain (used by quickload issues) +//---------------------------------------------------------------------- +void() extend_particlechain = +{ + local float new_part_max; + + // Check for particle chain controller FIRST! + if (part_control.classtype != CT_PARTICLECONT) return; + // Check if particle bank setup is running already + if (part_control.waitmin) return; + + // Make sure particle banks are reset to default if low + if (part_max < PARTICLE_MAXENTS) new_part_max = PARTICLE_MAXENTS; + + // Check for any worldspawn override value + if (world.particlemax > 0) { + if (new_part_max < world.particlemax) + new_part_max = world.particlemax; + } + + // Does the particle bank max need to change? + if (part_max > new_part_max) return; + else part_max = new_part_max; + + dprint("\b[WORLD]\b New max particles ("); + dprint(ftos(part_max)); dprint(")\n"); + + // Setup next think + part_control.think = generate_particlechain; + part_control.nextthink = time + 0.3; + part_control.waitmin = TRUE; +}; + +//---------------------------------------------------------------------- +float PARTICLE_ORIGIN_VOL = 0; // Pick random point inside volume +float PARTICLE_ORIGIN_CIRCLE = 1; // Move around circumference of circle +float PARTICLE_ORIGIN_RANDCIRCLE = 2; // Randomly point on circumference +float PARTICLE_ORIGIN_SPIRAL = 3; // Spiral outwards to circumference +float PARTICLE_ORIGIN_CENTER = 5; // Explosion style from center + +//---------------------------------------------------------------------- +// particle BURST explosions +float PARTICLE_BURST_YELLOW = 1; // gold, yellow, yellow +float PARTICLE_BURST_GREEN = 2; // light green, green, green +float PARTICLE_BURST_RED = 4; // grey, red, red +float PARTICLE_BURST_BLUE = 8; // blue, grey, blue +float PARTICLE_BURST_PURPLE = 16; // purple, grey, purple +float PARTICLE_BURST_FIRE = 32; // gold, red, grey (used by ogre) +float PARTICLE_BURST_WHITE = 64; // white, grey, grey + +float PARTICLE_BURST_RING = 256; // Circular particle burst +float PARTICLE_BURST_CENTER = 512; // Central particle burst +float PARTICLE_BURST_UPWARD = 1024; // Drifting upward burst +float PARTICLE_BURST_SHOCKWAVE = 4096; // Floor impact shockwave +float PARTICLE_BURST_SKULLUP = 8192; // Skull wizard teleport +float PARTICLE_BURST_LOSTUP = 16384; // Lost souls particle burn +float PARTICLE_BURST_MINOTAUR = 32768; // Minotaur magic attack over +//---------------------------------------------------------------------- +// Map referenced particles +float PARTICLE_STYLE_CUSTOM = 1; // Custom particle defined in map +float PARTICLE_STYLE_WEATHER = 5; // Various weather type effects +float PARTICLE_STYLE_PORTAL = 10; // White dot/bubbles floating outwards (volume) +float PARTICLE_STYLE_JUMPPAD = 15; // Spiral pattern floating upward +float PARTICLE_STYLE_FCIRCLE = 20; // Yellow dots floating upwards from circle on floor +float PARTICLE_STYLE_FFIELD = 25; // Volume Forcefield custom direction + +// Code referenced particles +float PARTICLE_STYLE_EMPTY = 0; // Particle emitter is dead/broken +float PARTICLE_STYLE_BOOK = 50; // Rotating white runes floating upwards (CLOSED) +float PARTICLE_STYLE_OPENBOOK = 55; // Particle dots based on book colour (OPEN) +float PARTICLE_STYLE_ELECTRIC = 65; // White/blue sparks floating towards target +float PARTICLE_STYLE_FLAMES = 70; // Small Flame Yellow/red embers +float PARTICLE_STYLE_FLAMET = 72; // Small Torch Yellow/red embers +float PARTICLE_STYLE_FLAMEL = 75; // Large Flame and lots of particles +float PARTICLE_STYLE_SMOKE = 80; // DP only effect, velocity driven smoke + +float PARTICLE_STYLE_RESPAWN = 100; // Red/yellow dots spawning from single point +float PARTICLE_STYLE_MEGAH = 105; // Red dot/heal particles from center +float PARTICLE_STYLE_ARMOR = 110; // Green/Yellow/Red dots floating up +float PARTICLE_STYLE_KEYSILVER = 120; // Blue explosion from top of key +float PARTICLE_STYLE_KEYGOLD = 122; // Yellow explosion from top of key +float PARTICLE_STYLE_KEYRED = 124; // Red explosion from top of key +float PARTICLE_STYLE_KEYGREEN = 126; // Green explosion from top of key +float PARTICLE_STYLE_KEYPURPLE = 128; // Purple explosion from top of key +float PARTICLE_STYLE_KEYWHITE = 130; // White explosion from top of key +float PARTICLE_STYLE_SIGIL = 140; // Purple explosion from center of rune +float PARTICLE_STYLE_ALTAR = 145; // Red/yellow dots raising around altar +float PARTICLE_STYLE_SKILL = 150; // Burst of red/yellow from skill column +float PARTICLE_STYLE_BSKILL = 152; // Burst of blue particles +float PARTICLE_STYLE_GSKILL = 154; // Burst of green particles +float PARTICLE_STYLE_PSKILL = 156; // Burst of purple particles +float PARTICLE_STYLE_BACKPACK = 175; // Grey/White dots from center + +float PARTICLE_STYLE_SUIT = 200; // Green dots rising up +float PARTICLE_STYLE_PENT = 210; // Red/Black dots from center +float PARTICLE_STYLE_SRING = 220; // Yellow dots falling down +float PARTICLE_STYLE_QUAD = 230; // Blue dots from center +float PARTICLE_STYLE_TOMEOFP = 240; // Yellow explosion from skull +float PARTICLE_STYLE_SHARP = 250; // Purple dots from center +float PARTICLE_STYLE_PIERCE = 260; // Purple dots from center +float PARTICLE_STYLE_WETSUIT = 270; // Blue dots rising up + +//---------------------------------------------------------------------- +// Darkplaces custom particles defined in effectinfo.txt +//void(entity gibent, float gibpoison) DPP_blood_trail; + +// DarkPlaces Particles definition block names +// defined in effectinfo.txt (location - root of mod directory) +string DPP_TRBLOOD = "TR_BLOOD"; // Blood TRail for model flag +string DPP_ITSBLOOD = "TR_ITSBLOOD"; // Blood TRail (extra blood) +string DPP_TRSBLOOD = "TR_SBLOOD"; // Stone Blood TRail for model flag +string DPP_TRPBLOOD = "TR_PBLOOD"; // Poison Blood TRail for model flag + +string DPP_TRLASER = "TR_LASER"; // Laser particle TRail + +string DPP_TEEXPLODE = "TE_EXPLOSION"; // Default particle explosion + +string DPP_TRPLASMA = "TR_PLASMA"; // Plasma particle TRail +string DPP_TEPLASMA = "TE_PLASMA"; // Plasma particle explosion +string DPP_TEPLASMABIG = "TE_PLASMABIG";// Plasma Big explosion + +string DPP_TRPOISON = "TR_POISON"; // Poison particle TRail +string DPP_TEPOISON = "TE_POISON"; // Poison particle explosion +string DPP_TEPOISONMED = "TE_POISONBIG";// Poison Medium explosion + +string DPP_TEBSMOKE = "TE_BSMOKE"; // A burst of Smoke/Steam +string DPP_TEBFLAME = "TE_BFLAME"; // A burst of red flame (smoke) +string DPP_TEBPOISON = "TE_BPOISON"; // A burst of green poison (smoke) + +string DPP_PORTALFRONT = "DPP_ITSPORTALFRONT"; // 0,180 angle +string DPP_PORTALSIDE = "DPP_ITSPORTALSIDE"; // 90,270 angle +string DPP_PORTALDOWN = "DPP_ITSPORTALDOWN"; // -2 angle +string DPP_PORTALUP = "DPP_ITSPORTALUP"; // -1 angle +string DPP_FCIRCLE = "DPP_ITSFCIRCLE"; +string DPP_JUMPPAD = "DPP_ITSJUMPPAD"; +string DPP_BOOKBLUE = "DPP_ITSBOOKBLUE"; +string DPP_BOOKRED = "DPP_ITSBOOKRED"; +string DPP_BOOKGOLD = "DPP_ITSBOOKGOLD"; +string DPP_OPENBOOKBLUE = "DPP_ITSOPENBOOKBLUE"; +string DPP_OPENBOOKRED = "DPP_ITSOPENBOOKRED"; +string DPP_OPENBOOKGOLD = "DPP_ITSOPENBOOKGOLD"; +string DPP_ELECTRIC = "DPP_ITSELECTRIC"; +string DPP_FLAMES = "DPP_ITSSFLAME"; +string DPP_FLAMET = "DPP_ITSTFLAME"; +string DPP_FLAMEL = "DPP_ITSLFLAME"; +string DPP_SKILLPILLAR = "DPP_ITSSKILLPILLAR"; +string DPP_BSKILLPILLAR = "DPP_ITSBSKILLPILLAR"; +string DPP_GSKILLPILLAR = "DPP_ITSGSKILLPILLAR"; +string DPP_PSKILLPILLAR = "DPP_ITSPSKILLPILLAR"; +string DPP_ALTARRED = "DPP_ITSALTARRED"; +string DPP_ALTARGREY = "DPP_ITSALTARGREY"; +string DPP_RESPAWN = "DPP_ITSRESPAWN"; +string DPP_MEGAH = "DPP_ITSMEGAH"; +string DPP_ARMOR1 = "DPP_ITSARMOR1"; +string DPP_ARMOR2 = "DPP_ITSARMOR2"; +string DPP_ARMOR2BLUE = "DPP_ITSARMOR2BLUE"; +string DPP_ARMOR3 = "DPP_ITSARMOR3"; +string DPP_WEAPON = "DPP_ITSWEAPON"; +string DPP_KEYSILVER = "DPP_ITSSILVERKEY"; +string DPP_KEYGOLD = "DPP_ITSGOLDKEY"; +string DPP_KEYRED = "DPP_ITSREDKEY"; +string DPP_KEYGREEN = "DPP_ITSGREENKEY"; +string DPP_KEYPURPLE = "DPP_ITSPURPLEKEY"; +string DPP_KEYWHITE = "DPP_ITSWHITEKEY"; +string DPP_SIGIL = "DPP_ITSSIGIL"; +string DPP_BACKPACK = "DPP_ITSBACKPACK"; +string DPP_BACKPACKB = "DPP_ITSBACKPACKB"; +string DPP_BACKPACKG = "DPP_ITSBACKPACKG"; +string DPP_BACKPACKR = "DPP_ITSBACKPACKR"; +string DPP_BACKPACKY = "DPP_ITSBACKPACKY"; +string DPP_SUIT = "DPP_ITSSUIT"; +string DPP_PENT = "DPP_ITSPENT"; +string DPP_SRING = "DPP_ITSSRING"; +string DPP_QUAD = "DPP_ITSQUAD"; +string DPP_TOMEOFP = "DPP_ITSTOMEOFP"; +string DPP_SHARP = "DPP_ITSSHARP"; +string DPP_SHARPG = "DPP_ITSSHARPG"; +string DPP_PIERCE = "DPP_ITSPIERCE"; +string DPP_WETSUIT = "DPP_ITSWETSUIT"; + +// Special trigger effects +string DPP_TEVORESPIKE = "TE_VORESPIKE"; +string DPP_WRAITHEXPLODE = "DPP_ITSWRAITHEXPLODE"; +string DPP_INTERACTIVE = "DPP_ITSINTERACTIVE"; +string DPP_BURSTFLAME = "DPP_ITSFLAME_BURST"; +string DPP_FCIRCLE_RING = "DPP_ITSFCIRCLE_RING"; +string DPP_SIGILPICKUP = "DPP_ITSSIGIL_PICKUP"; +string DPP_BURSTSHOCKWAVE1 = "DPP_ITSBURSTSHOCKWAVE1"; +string DPP_BURSTSHOCKWAVE2 = "DPP_ITSBURSTSHOCKWAVE2"; +string DPP_PYROFLAME1 = "DPP_ITSPYROFLAME1"; +string DPP_PYROFLAME2 = "DPP_ITSPYROFLAME2"; +string DPP_PYROFLAME3 = "DPP_ITSPYROFLAME3"; + +// Velocity driven smoke +string DPP_VELSMOKEGREY1 = "DPP_ITSVELSMOKEGREY1"; +string DPP_VELSMOKEGREY2 = "DPP_ITSVELSMOKEGREY2"; +string DPP_VELSMOKEWHITE = "DPP_ITSVELSMOKEWHITE"; +string DPP_VELSMOKETOXIC = "DPP_ITSVELSMOKETOXIC"; +string DPP_VELSMOKEGREEN = "DPP_ITSVELSMOKEGREEN"; +string DPP_VELSMOKEPURPLE = "DPP_ITSVELSMOKEPURPLE"; +string DPP_VELSMOKERED = "DPP_ITSVELSMOKERED"; +string DPP_VELSMOKEFIRE = "DPP_ITSVELSMOKEFIRE"; + +// Respawn effects +string DPP_RINGPARTY = "DPP_ITSPART_RINGY"; +string DPP_RINGPARTG = "DPP_ITSPART_RINGG"; +string DPP_RINGPARTR = "DPP_ITSPART_RINGR"; +string DPP_RINGPARTB = "DPP_ITSPART_RINGB"; +string DPP_RINGPARTP = "DPP_ITSPART_RINGP"; +string DPP_RINGPARTW = "DPP_ITSPART_RINGW"; + +string DPP_BURSTPARTY = "DPP_ITSPART_BURSTY"; +string DPP_BURSTPARTG = "DPP_ITSPART_BURSTG"; +string DPP_BURSTPARTR = "DPP_ITSPART_BURSTR"; +string DPP_BURSTPARTB = "DPP_ITSPART_BURSTB"; +string DPP_BURSTPARTP = "DPP_ITSPART_BURSTP"; +string DPP_BURSTPARTW = "DPP_ITSPART_BURSTW"; +// Forcefield volumes +string DPP_FFIELDPARTY = "DPP_ITSPART_FFIELDY"; +string DPP_FFIELDPARTG = "DPP_ITSPART_FFIELDG"; +string DPP_FFIELDPARTR = "DPP_ITSPART_FFIELDR"; +string DPP_FFIELDPARTB = "DPP_ITSPART_FFIELDB"; +string DPP_FFIELDPARTP = "DPP_ITSPART_FFIELDP"; +string DPP_FFIELDPARTW = "DPP_ITSPART_FFIELDW"; + +//---------------------------------------------------------------------- +// GENERIC particle filename strings +string PART_BUBBLE_BLUE = "progs/s_bubble_blue1.spr"; +string PART_DOTMED_BLUE = "progs/s_dotmed_blue.spr"; +string PART_DOTSML_BLUE = "progs/s_dotsml_blue.spr"; +string PART_DOTMED_DBLUE = "progs/s_dotmed_dblue.spr"; +string PART_DOTSML_DBLUE = "progs/s_dotsml_dblue.spr"; +string PART_BUBBLE_YELLOW = "progs/s_bubble_yell.spr"; +string PART_DOTMED_YELLOW = "progs/s_dotmed_yell.spr"; +string PART_DOTSML_YELLOW = "progs/s_dotsml_yell.spr"; +string PART_DOTSML_GOLD = "progs/s_dotsml_gold.spr"; +string PART_BUBBLE_RED = "progs/s_bubble_red1.spr"; +string PART_DOTMED_RED = "progs/s_dotmed_red.spr"; +string PART_DOTSML_RED = "progs/s_dotsml_red.spr"; +string PART_DOTMED_GREEN = "progs/s_dotmed_grn.spr"; +string PART_DOTSML_GREEN = "progs/s_dotsml_grn.spr"; +string PART_DOTMED_LGREEN = "progs/s_dotmed_lgrn.spr"; +string PART_DOTSML_LGREEN = "progs/s_dotsml_lgrn.spr"; +string PART_DOTSML_PURP = "progs/s_dotsml_purp.spr"; +string PART_DOTMED_PURP = "progs/s_dotmed_purp.spr"; +string PART_BUBBLE_WHITE = "progs/s_bubble_wht.spr"; +string PART_DOTSML_WHITE = "progs/s_dotsml_wht.spr"; +string PART_DOTMED_GREY = "progs/s_dotmed_grey.spr"; +string PART_DOTSML_GREY = "progs/s_dotsml_grey.spr"; + +// SPECIFIC particle filename strings +string PART_TORCH1 = "progs/s_dotmed_tor1.spr"; +string PART_TORCH2 = "progs/s_dotmed_tor2.spr"; +string PART_BOOKRUNE1 = "progs/s_bookrune1.spr"; +string PART_BOOKRUNE2 = "progs/s_bookrune2.spr"; + +//---------------------------------------------------------------------- +// Particle sprites +//---------------------------------------------------------------------- +void() setup_particleprecache = +{ + precache_model (PART_TORCH1); // Embers - Red/Yellow + precache_model (PART_TORCH2); // Embers - Red/Yellow + precache_model (PART_BOOKRUNE1); // Celtic Book Runes + precache_model (PART_BOOKRUNE2); // Celtic Book Runes + + precache_model (PART_BUBBLE_BLUE); // Bubbles - Blue + precache_model (PART_DOTMED_BLUE); // Dots - Medium Blue + precache_model (PART_DOTSML_BLUE); // Dots - Small Blue + precache_model (PART_DOTMED_DBLUE); // Dots - Medium Dark Blue + precache_model (PART_DOTSML_DBLUE); // Dots - Small Dark Blue + precache_model (PART_BUBBLE_YELLOW); // Bubbles - Yellow + precache_model (PART_DOTMED_YELLOW); // Dots - Medium Yellow + precache_model (PART_DOTSML_YELLOW); // Dots - Small Yellow + precache_model (PART_DOTSML_GOLD); // Dots - Small Gold + precache_model (PART_BUBBLE_RED); // Bubbles - Red + precache_model (PART_DOTMED_RED); // Dots - Medium Red + precache_model (PART_DOTSML_RED); // Dots - Small Red + precache_model (PART_DOTMED_GREEN); // Dots - Medium Green + precache_model (PART_DOTSML_GREEN); // Dots - Small Green + precache_model (PART_DOTMED_LGREEN); // Dots - Medium Light Green + precache_model (PART_DOTSML_LGREEN); // Dots - Small Light Green + precache_model (PART_DOTSML_PURP); // Dots - Purple/Pink + precache_model (PART_DOTMED_PURP); // Dots - Purple/Pink + precache_model (PART_BUBBLE_WHITE); // Bubbles - White + precache_model (PART_DOTSML_WHITE); // Dots - Small White + precache_model (PART_DOTMED_GREY); // Dots - Medium Grey + precache_model (PART_DOTSML_GREY); // Dots - Small Grey +}; diff --git a/QC_other/QC_arcane/player.qc b/QC_other/QC_arcane/player.qc new file mode 100644 index 00000000..fdca992a --- /dev/null +++ b/QC_other/QC_arcane/player.qc @@ -0,0 +1,633 @@ +/*============================================================================== +PLAYER +==============================================================================*/ +$cd id1/models/player_4 +$origin 0 -6 24 +$base base +$skin skin + +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 + +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 + +$frame stand1 stand2 stand3 stand4 stand5 + +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 + +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 +$frame axdeth7 axdeth8 axdeth9 + +$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 +$frame deatha9 deatha10 deatha11 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 + +$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 +$frame deathd8 deathd9 + +$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 +$frame deathe8 deathe9 + +// attacks +$frame nailatt1 nailatt2 +$frame light1 light2 +$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 +$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + +void() player_run; + +// Updated player idle/fire weapon frame logic to be consistent +// Bug highlighted by Stas "dwere" Kuznetsov +float IDLE_WEAPON_FRAME = 0; // Default idle state +float FIRE_WEAPON_FRAME = 1; // Start of firing frames + +/*============================================================================== +PLAYER AXE + +Frame 0 - Idle LOW +Frame 1 - Idle HIGH + +Axe A Original - 1,2,3,4 New - 3,4,5,7 a3,a4,a5,a7 +Axe B Original - 5,6,7,8 New - 10,11,13,14 b3,b4,b6,b7 +Axe C Original - 1,2,3,4 New - 17,18,20,21 c3,c4,c6,c7 +Axe D Original - 5,6,7,8 New - 24,25,26,28 d3,d4,d5,d7 +Axe E Original - x,x,x,x New - 31,32,34,35 e3,e4,e6,e7 + +============================================================================*/ +void() player_axe1 = [$axatt1, player_axe2 ] {self.weaponframe=1;}; +void() player_axe2 = [$axatt2, player_axe3 ] {self.weaponframe=2;}; +void() player_axe3 = [$axatt3, player_axe4 ] {self.weaponframe=3;W_FireAxe();}; +void() player_axe4 = [$axatt4, player_run ] {self.weaponframe=4;}; + +void() player_axeb1 = [$axattb1, player_axeb2 ] {self.weaponframe=5;}; +void() player_axeb2 = [$axattb2, player_axeb3 ] {self.weaponframe=6;}; +void() player_axeb3 = [$axattb3, player_axeb4 ] {self.weaponframe=7;W_FireAxe();}; +void() player_axeb4 = [$axattb4, player_run ] {self.weaponframe=8;}; + +void() player_axec1 = [$axattc1, player_axec2 ] {self.weaponframe=9;}; +void() player_axec2 = [$axattc2, player_axec3 ] {self.weaponframe=10;}; +void() player_axec3 = [$axattc3, player_axec4 ] {self.weaponframe=11;W_FireAxe();}; +void() player_axec4 = [$axattc4, player_run ] {self.weaponframe=12;}; + +void() player_axed1 = [$axattd1, player_axed2 ] {self.weaponframe=13;}; +void() player_axed2 = [$axattd2, player_axed3 ] {self.weaponframe=14;}; +void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe=15;W_FireAxe();}; +void() player_axed4 = [$axattd4, player_run ] {self.weaponframe=16;}; + +void() player_axee1 = [$axattd1, player_axee2 ] {self.weaponframe=17;}; +void() player_axee2 = [$axattd2, player_axee3 ] {self.weaponframe=18;}; +void() player_axee3 = [$axattd3, player_axee4 ] {self.weaponframe=19;W_FireAxe();}; +void() player_axee4 = [$axattd4, player_run ] {self.weaponframe=20;}; + +//============================================================================ +void() player_stand1 =[ $axstnd1, player_stand1 ] { + self.weaponframe=IDLE_WEAPON_FRAME; + if (self.velocity_x || self.velocity_y) { + self.walkframe = 0; + player_run(); + return; + } + + if (self.weapon == IT_AXE) { + if (self.walkframe >= 12) self.walkframe = 0; + self.frame = $axstnd1 + self.walkframe; + } + else { + if (self.walkframe >= 5) self.walkframe = 0; + self.frame = $stand1 + self.walkframe; + } + self.walkframe = self.walkframe + 1; +}; + +//============================================================================ +void() player_run =[ $rockrun1, player_run ] { + + // Get out of any weapon animation + self.weaponframe = IDLE_WEAPON_FRAME; + // Standing around has different animation sets + if (!self.velocity_x && !self.velocity_y) { + self.walkframe = 0; + player_stand1(); + return; + } + // make sure correct player animation active + if (self.weapon == IT_AXE) { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = $axrun1 + self.walkframe; + } + else { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = self.frame + self.walkframe; + } + + // Check for player feet sound, using velocity & ground flag + if ((self.walkframe == 2 || self.walkframe == 5) && + self.flags & FL_ONGROUND) { + self.cnt = fabs(self.velocity_x + self.velocity_y); + // Need to be moving before feet sounds + if (self.cnt > 50) monster_footstep(FALSE); + } + // Update frame + self.walkframe = self.walkframe + 1; +}; + +//============================================================================ +void() player_run_nofeet =[ $rockrun1, player_run ] { + + // Get out of any weapon animation + self.weaponframe = IDLE_WEAPON_FRAME; + // Standing around has different animation sets + if (!self.velocity_x && !self.velocity_y) { + self.walkframe = 0; + player_stand1(); + return; + } + // make sure correct player animation active + if (self.weapon == IT_AXE) { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = $axrun1 + self.walkframe; + } + else { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = self.frame + self.walkframe; + } + + // Update frame + self.walkframe = self.walkframe + 1; +}; + +//---------------------------------------------------------------------- +void(entity targ) remoteplayer_run = +{ + local entity tself; + tself = self; self = targ; + // This has to run the block above otherwise weaponframe errors + // the animation code "xx = [ $x, x ]" has to be run + // The above code cannot be pasted into this function + // Be careful with this function, it needs a certain layout! + player_run_nofeet(); + self = tself; +}; + +//============================================================================ +void() player_sgreset = [$shotatt1, player_sg2 ] { + self.weaponframe=FIRE_WEAPON_FRAME; +}; + +void() player_sg1 = [$shotatt1, player_sg1 ] { + self.weaponframe=IDLE_WEAPON_FRAME; + if (!self.button0) { player_run(); return; } + W_FireShotgun (); +}; +void() player_sg2 = [$shotatt2, player_sg3 ] { self.weaponframe=2; }; +void() player_sg3 = [$shotatt3, player_sg4 ] { self.weaponframe=3; }; +void() player_sg4 = [$shotatt4, player_sg5 ] { self.weaponframe=4; }; +void() player_sg5 = [$shotatt5, player_sg1 ] { self.weaponframe=5; }; + +//============================================================================ +void() player_ssgreset = [$shotatt1, player_supersg2 ] { + self.weaponframe=FIRE_WEAPON_FRAME; +}; + +void() player_supersg1 = [$shotatt1, player_supersg1 ] { + self.weaponframe=IDLE_WEAPON_FRAME; + if (!self.button0) { player_run(); return; } + W_FireSuperShotgun (); +}; +void() player_supersg2 = [$shotatt2, player_supersg3 ] { self.weaponframe=2; }; +void() player_supersg3 = [$shotatt3, player_supersg4 ] { self.weaponframe=3; }; +void() player_supersg4 = [$shotatt4, player_supersg5 ] { self.weaponframe=4; }; +void() player_supersg5 = [$shotatt5, player_supersg6 ] { self.weaponframe=5; }; +void() player_supersg6 = [$shotatt6, player_supersg1 ] { self.weaponframe=6; + // If player has one shell left, switch to SG after SSG fire animation + if (self.ammo_shells < 2) { forceweaponswitch(0.2); return;}}; + +//============================================================================ +// The Nailgun +//============================================================================ +void(float oframe, float ox) nail_upd = { + if (!self.button0) { player_run(); return; } + self.weaponframe = oframe; + W_FireSpikes (0,ox); +}; + +void() player_nail1 = [$nailatt1, player_nail2 ] {nail_upd(1,2);}; +void() player_nail2 = [$nailatt2, player_nail3 ] {nail_upd(2,-2);}; +void() player_nail3 = [$nailatt1, player_nail4 ] {nail_upd(3,2);}; +void() player_nail4 = [$nailatt2, player_nail5 ] {nail_upd(4,-2);}; +void() player_nail5 = [$nailatt1, player_nail6 ] {nail_upd(5,2);}; +void() player_nail6 = [$nailatt2, player_nail7 ] {nail_upd(6,-2);}; +void() player_nail7 = [$nailatt1, player_nail8 ] {nail_upd(7,2);}; +void() player_nail8 = [$nailatt2, player_nail1 ] {nail_upd(8,-2);}; + +//============================================================================ +// The Super Nailgun +// I really liked the idea of saving the frame number of the SNG +// so that when it stops/starts it remembers where it left off +// Unfortunately the gun is reset to frame 0 - the idle state +// when the weapon is not being fired. +// - SNG projectile offset idea by Kinn +//============================================================================ +void(float oframe, float oz, float ox) snail_upd = { + if (!self.button0) { player_run(); return; } + self.weaponframe = oframe; + W_FireSpikes (oz,ox); +}; + +void() player_snail1 = [$nailatt1, player_snail2 ] {snail_upd(1,8,2.5);}; +void() player_snail2 = [$nailatt2, player_snail3 ] {snail_upd(2,5.5,-3.5);}; +void() player_snail3 = [$nailatt1, player_snail4 ] {snail_upd(3,3,2.5);}; +void() player_snail4 = [$nailatt2, player_snail5 ] {snail_upd(4,9,0);}; +void() player_snail5 = [$nailatt1, player_snail6 ] {snail_upd(5,3,-2.5);}; +void() player_snail6 = [$nailatt2, player_snail7 ] {snail_upd(6,5.5,3.5);}; +void() player_snail7 = [$nailatt1, player_snail8 ] {snail_upd(7,8,-2.5);}; +void() player_snail8 = [$nailatt2, player_snail1 ] {snail_upd(8,2,0);}; + +//============================================================================ +void() player_plasma1 =[$light1, player_plasma2 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = FIRE_WEAPON_FRAME; + W_FirePlasma(); +}; +void() player_plasma2 =[$light2, player_plasma1 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = FIRE_WEAPON_FRAME; + W_FirePlasma(); +}; + +//============================================================================ +void() player_light1 =[$light1, player_light2 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = FIRE_WEAPON_FRAME; + W_FireLightning(); +}; +void() player_light2 =[$light2, player_light1 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = FIRE_WEAPON_FRAME; + W_FireLightning(); +}; + +//============================================================================ +void() player_rockreset =[$rockatt1, player_rocket2 ] { + self.weaponframe=FIRE_WEAPON_FRAME; +}; + +void() player_rocket1 =[$rockatt1, player_rocket1 ] { + self.weaponframe=IDLE_WEAPON_FRAME; + if (!self.button0) { player_run(); return; } + W_FireRocket(); +}; +void() player_rocket2 =[$rockatt2, player_rocket3 ] { self.weaponframe=2;}; +void() player_rocket3 =[$rockatt3, player_rocket4 ] { self.weaponframe=3;}; +void() player_rocket4 =[$rockatt4, player_rocket5 ] { self.weaponframe=4;}; +void() player_rocket5 =[$rockatt5, player_rocket6 ] { self.weaponframe=5;}; +void() player_rocket6 =[$rockatt6, player_rocket1 ] { self.weaponframe=6;}; + +//============================================================================ +void() player_grenreset =[$rockatt1, player_grenade2 ] { + self.weaponframe=FIRE_WEAPON_FRAME; +}; + +void() player_grenade1 =[$rockatt1, player_grenade1 ] { + self.weaponframe=IDLE_WEAPON_FRAME; + if (!self.button0) { player_run(); return; } + W_FireGrenade(); +}; +void() player_grenade2 =[$rockatt2, player_grenade3 ] { self.weaponframe=2;}; +void() player_grenade3 =[$rockatt3, player_grenade4 ] { self.weaponframe=3;}; +void() player_grenade4 =[$rockatt4, player_grenade5 ] { self.weaponframe=4;}; +void() player_grenade5 =[$rockatt5, player_grenade6 ] { self.weaponframe=5;}; +void() player_grenade6 =[$rockatt6, player_grenade1 ] { self.weaponframe=6;}; + +//---------------------------------------------------------------------- +// Only used for the player when they die +//---------------------------------------------------------------------- +void() misc_bubble_bob; +void() death_bubble_spawn = +{ + local entity bubble; + + if (self.owner.waterlevel != 3) return; + + bubble = spawn(); + bubble.classname = "bubble"; + bubble.solid = SOLID_NOT; + bubble.movetype = MOVETYPE_NOCLIP; + setmodel (bubble, SBUBBLE_DROWN); + bubble.frame = bubble.cnt = 0; + setorigin (bubble, self.owner.origin + '0 0 24'); + setsize (bubble, '-8 -8 -8', '8 8 8'); + bubble.velocity = '0 0 15'; + bubble.nextthink = time + 0.5; + bubble.think = misc_bubble_bob; + + self.nextthink = time + 0.1; + self.think = death_bubble_spawn; + self.air_finished = self.air_finished + 1; + if (self.air_finished >= self.bubble_count) remove(self); +}; + +//---------------------------------------------------------------------- +void(float num_bubbles) death_bubbles = +{ + local entity bubble_spawner; + + bubble_spawner = spawn(); + bubble_spawner.owner = self; + bubble_spawner.air_finished = 0; + bubble_spawner.bubble_count = num_bubbles; + setorigin (bubble_spawner, self.origin); + bubble_spawner.nextthink = time + 0.1; + bubble_spawner.think = death_bubble_spawn; +}; + +//============================================================================ +void() PainSound = +{ + if (self.health < 0) return; + if (self.pain_finished > time) { self.axhitme = 0; return; } + + // don't make multiple pain sounds right after each other + self.pain_finished = time + 0.5; + + if (damage_attacker.classname == "teledeath") { + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + } + // water pain sounds + else if (self.watertype == CONTENT_WATER && self.waterlevel == 3) { + death_bubbles(1); + if (random() > 0.5) sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM); + } + // slime pain sounds + else if (self.watertype == CONTENT_SLIME) { + // FIX ME put in some steam here + if (random() > 0.5) sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + } + else if (self.watertype == CONTENT_LAVA) { + if (random() > 0.5) sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + } + else { + // ax pain sound + if (self.axhitme > 0) { + self.axhitme = 0; + // Player been hit by an axe (MP thing) + sound (self, CHAN_VOICE, SOUND_AXE_PLAYER, 1, ATTN_NORM); + } + else { + self.lip = rint((random() * 5) + 1); + if (self.lip == 1) self.noise = "player/pain1.wav"; + else if (self.lip == 2) self.noise = "player/pain2.wav"; + else if (self.lip == 3) self.noise = "player/pain3.wav"; + else if (self.lip == 4) self.noise = "player/pain4.wav"; + else if (self.lip == 5) self.noise = "player/pain5.wav"; + else self.noise = "player/pain6.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + } +}; + +//============================================================================ +void() player_pain1 = [ $pain1, player_pain2 ] { + PainSound(); + self.weaponframe=IDLE_WEAPON_FRAME; +}; +void() player_pain2 = [ $pain2, player_pain3 ] {}; +void() player_pain3 = [ $pain3, player_pain4 ] {}; +void() player_pain4 = [ $pain4, player_pain5 ] {}; +void() player_pain5 = [ $pain5, player_pain6 ] {}; +void() player_pain6 = [ $pain6, player_run ] {}; + +void() player_axpain1 = [ $axpain1, player_axpain2 ] { + PainSound(); + self.weaponframe=IDLE_WEAPON_FRAME; +}; +void() player_axpain2 = [ $axpain2, player_axpain3 ] {}; +void() player_axpain3 = [ $axpain3, player_axpain4 ] {}; +void() player_axpain4 = [ $axpain4, player_axpain5 ] {}; +void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; +void() player_axpain6 = [ $axpain6, player_run ] {}; + +//============================================================================ +void(entity inflictor, entity attacker, float damage) player_pain = +{ + if (self.weaponframe) return; + if (self.invisible_finished > time) return; // eyes don't have pain frames + if (self.weapon == IT_AXE) player_axpain1 (); + else player_pain1 (); +}; + +//============================================================================ +void() player_dead = +{ + self.nextthink = -1; + // allow respawn after a certain time + self.deadflag = DEAD_DEAD; +}; + +//============================================================================ +void() player_diea1 = [ $deatha1, player_diea2 ] {}; +void() player_diea2 = [ $deatha2, player_diea3 ] {}; +void() player_diea3 = [ $deatha3, player_diea4 ] {}; +void() player_diea4 = [ $deatha4, player_diea5 ] {}; +void() player_diea5 = [ $deatha5, player_diea6 ] {}; +void() player_diea6 = [ $deatha6, player_diea7 ] {}; +void() player_diea7 = [ $deatha7, player_diea8 ] {}; +void() player_diea8 = [ $deatha8, player_diea9 ] {}; +void() player_diea9 = [ $deatha9, player_diea10 ] {}; +void() player_diea10 = [ $deatha10, player_diea11 ] {}; +void() player_diea11 = [ $deatha11, player_diea11 ] {player_dead();}; + +void() player_dieb1 = [ $deathb1, player_dieb2 ] {}; +void() player_dieb2 = [ $deathb2, player_dieb3 ] {}; +void() player_dieb3 = [ $deathb3, player_dieb4 ] {}; +void() player_dieb4 = [ $deathb4, player_dieb5 ] {}; +void() player_dieb5 = [ $deathb5, player_dieb6 ] {}; +void() player_dieb6 = [ $deathb6, player_dieb7 ] {}; +void() player_dieb7 = [ $deathb7, player_dieb8 ] {}; +void() player_dieb8 = [ $deathb8, player_dieb9 ] {}; +void() player_dieb9 = [ $deathb9, player_dieb9 ] {player_dead();}; + +void() player_diec1 = [ $deathc1, player_diec2 ] {}; +void() player_diec2 = [ $deathc2, player_diec3 ] {}; +void() player_diec3 = [ $deathc3, player_diec4 ] {}; +void() player_diec4 = [ $deathc4, player_diec5 ] {}; +void() player_diec5 = [ $deathc5, player_diec6 ] {}; +void() player_diec6 = [ $deathc6, player_diec7 ] {}; +void() player_diec7 = [ $deathc7, player_diec8 ] {}; +void() player_diec8 = [ $deathc8, player_diec9 ] {}; +void() player_diec9 = [ $deathc9, player_diec10 ] {}; +void() player_diec10 = [ $deathc10, player_diec11 ] {}; +void() player_diec11 = [ $deathc11, player_diec12 ] {}; +void() player_diec12 = [ $deathc12, player_diec13 ] {}; +void() player_diec13 = [ $deathc13, player_diec14 ] {}; +void() player_diec14 = [ $deathc14, player_diec15 ] {}; +void() player_diec15 = [ $deathc15, player_diec15 ] {player_dead();}; + +void() player_died1 = [ $deathd1, player_died2 ] {}; +void() player_died2 = [ $deathd2, player_died3 ] {}; +void() player_died3 = [ $deathd3, player_died4 ] {}; +void() player_died4 = [ $deathd4, player_died5 ] {}; +void() player_died5 = [ $deathd5, player_died6 ] {}; +void() player_died6 = [ $deathd6, player_died7 ] {}; +void() player_died7 = [ $deathd7, player_died8 ] {}; +void() player_died8 = [ $deathd8, player_died9 ] {}; +void() player_died9 = [ $deathd9, player_died9 ] {player_dead();}; + +void() player_diee1 = [ $deathe1, player_diee2 ] {}; +void() player_diee2 = [ $deathe2, player_diee3 ] {}; +void() player_diee3 = [ $deathe3, player_diee4 ] {}; +void() player_diee4 = [ $deathe4, player_diee5 ] {}; +void() player_diee5 = [ $deathe5, player_diee6 ] {}; +void() player_diee6 = [ $deathe6, player_diee7 ] {}; +void() player_diee7 = [ $deathe7, player_diee8 ] {}; +void() player_diee8 = [ $deathe8, player_diee9 ] {}; +void() player_diee9 = [ $deathe9, player_diee9 ] {player_dead();}; + +void() player_die_ax1 = [ $axdeth1, player_die_ax2 ] {}; +void() player_die_ax2 = [ $axdeth2, player_die_ax3 ] {}; +void() player_die_ax3 = [ $axdeth3, player_die_ax4 ] {}; +void() player_die_ax4 = [ $axdeth4, player_die_ax5 ] {}; +void() player_die_ax5 = [ $axdeth5, player_die_ax6 ] {}; +void() player_die_ax6 = [ $axdeth6, player_die_ax7 ] {}; +void() player_die_ax7 = [ $axdeth7, player_die_ax8 ] {}; +void() player_die_ax8 = [ $axdeth8, player_die_ax9 ] {}; +void() player_die_ax9 = [ $axdeth9, player_die_ax9 ] {player_dead();}; + +//============================================================================ +void() player_death_sound = +{ + // water death sounds + if (self.waterlevel == 3) { + death_bubbles(20); + sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE); + } + else { + self.lip = rint ((random() * 4) + 1); + if (self.lip == 2) self.noise = "player/death2.wav"; + else if (self.lip == 3) self.noise = "player/death3.wav"; + else if (self.lip == 4) self.noise = "player/death4.wav"; + else if (self.lip == 5) self.noise = "player/death5.wav"; + else self.noise = "player/death1.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE); + } +}; + +//============================================================================ +void() player_gib = +{ + // Set all gib/death flags correctly + self.gibbed = TRUE; + self.deadflag = DEAD_DEAD; + self.takedamage = DAMAGE_NO; + self.nextthink = -1; + + // Let the head model bounce around + self.movetype = MOVETYPE_BOUNCE; + setmodel (self, self.headmdl); + setsize (self, '-16 -16 0', '16 16 32'); + self.frame = 0; // Reset frame, head model only has 1 frame + self.height = 1; // Do not remove after model fadeout + + + ThrowGib(1, 1); + ThrowGib(2, 1); + ThrowGib(3, 1); + ThrowGib(4, rint(random()*2)); + ThrowGib(5, 1); + + // Lots of vertical momentum + self.velocity_x = 50 * crandom(); + self.velocity_y = 50 * crandom(); + self.velocity_z = 200 + 100 * random(); + + // Minimal angle rotation + self.avelocity = '0 0 0'; + self.avelocity_y = 200 + random() * 200; + self.angles = '0 0 0'; + self.angles_y = self.ideal_yaw = random() * 360; + + // Play GIB death sound + if (damage_attacker.classname == "teledeath") + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + else if (damage_attacker.classname == "teledeath2") + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + else { + if (random() < 0.5) sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE); + else sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE); + } +}; + +//============================================================================ +void() player_death = +{ + // don't let sbar look bad if a player + if (self.health < -99) self.health = -99; + if (deathmatch || coop) DropBackpack(); + + // Remove all powerup/debuff effects + ResetPowerSystem(self); + ResetDebuffSystem(self); + + self.weaponmodel=""; + self.view_ofs = '0 0 8'; + self.deadflag = DEAD_DYING; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_TOSS; + + // Remove floor/ground flag, time to fly + self.flags = self.flags - (self.flags & FL_ONGROUND); + setorigin(self, self.origin + '0 0 1'); + + // Did the player explode from high damage? + if (self.health < self.gibhealth) player_gib(); + else { + player_death_sound(); + self.angles_x = self.angles_z = 0; + if (self.velocity_z < 10) + self.velocity_z = self.velocity_z + random()*300; + + if (self.weapon == IT_AXE) player_die_ax1 (); + else { + self.lip = 1 + floor(random()*6); + if (self.lip == 1) player_diea1(); + else if (self.lip == 2) player_dieb1(); + else if (self.lip == 3) player_diec1(); + else if (self.lip == 4) player_died1(); + else player_diee1(); + } + } +}; + +//============================================================================ +void() set_suicide_frame = +{ + // used by kill command and diconnect command + if (self.gibbed == TRUE) return; // already gibbed + self.frame = $deatha11; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_TOSS; + self.deadflag = DEAD_DEAD; + self.nextthink = -1; +}; diff --git a/QC_other/QC_arcane/progs.src b/QC_other/QC_arcane/progs.src new file mode 100644 index 00000000..86541123 --- /dev/null +++ b/QC_other/QC_arcane/progs.src @@ -0,0 +1,133 @@ +../progs.dat + +defs.qc +defscustom.qc +dpextensions.qc +mathlib.qc + +subs.qc +subs_soc.qc +hiprot.qc +estate.qc +globalfog.qc +settings.qc +breakable.qc +pushable.qc + +part_manage.qc +part_generate.qc +part_emitter.qc + +ai_gibs.qc +ai_enemytarget.qc +ai_pathcorner.qc +ai_tether.qc +ai_checkattack.qc +ai_explosion.qc +ai_ammoresist.qc +ai_subs.qc +ai_states.qc +ai_combat.qc +ai_minions.qc + +world.qc +client_mapvar.qc +client_debuff.qc +client_power.qc +client.qc +client_camera.qc +client_info.qc + +monsters.qc +items.qc +projectiles.qc +weapons.qc +player.qc +triggers_states.qc +triggers.qc +targets.qc +func.qc +func_doors.qc +func_doorsecret.qc +func_buttons.qc +func_pswitch.qc +func_insvolume.qc +func_plats.qc +func_trains.qc +misc.qc +misc_textbook.qc +misc_targetdummy.qc +traps.qc +traps_pendulum.qc +traps_sawblade.qc +lights.qc +sounds.qc + +// Monsters +mon_demon.qc +mon_dog.qc +mon_fish.qc +mon_hknight.qc +mon_knight.qc +mon_ogre.qc +mon_enforcer.qc +mon_shalrath.qc +mon_shambler.qc +mon_soldier.qc +mon_tarbaby.qc +mon_wizard.qc +mon_zombie.qc + +// New Monsters +mon_boil.qc +mon_centurion.qc +mon_dcrossbow.qc +mon_dfury.qc +mon_dguard.qc +mon_dguardquoth.qc +mon_dknight.qc +mon_dlord.qc +mon_drole.qc +mon_dsergeant.qc +mon_eel.qc +mon_freddie.qc +mon_gargoyle.qc +mon_gaunt.qc +mon_golem.qc +//mon_gug.qc +mon_hogre.qc +mon_hogreham.qc +mon_hogremac.qc +mon_jim.qc +mon_lostsoul.qc +mon_minotaur.qc +mon_pyro.qc +mon_scorpion.qc +mon_seeker.qc +mon_sentinel.qc +mon_skullwiz.qc +mon_spider.qc +mon_swampling.qc +mon_voreling.qc +mon_wraith.qc +mon_zombiek.qc + +// Xmas Monsters +mon_xmas_elf.qc +mon_xmas_raindeer.qc +mon_xmas_snowman.qc +mon_xmas_santa.qc + +// ID Bosses +mon_bossidchthon.qc +mon_bossidshub.qc +mon_bossxxchthon.qc +mon_bossxxshub.qc + +// New Bosses +mon_bossboglord.qc +mon_bosseidolon.qc +mon_bossfiretop.qc +mon_bossicegolem.qc +mon_bossnour.qc + diff --git a/QC_other/QC_arcane/projectiles.qc b/QC_other/QC_arcane/projectiles.qc new file mode 100644 index 00000000..b238c297 --- /dev/null +++ b/QC_other/QC_arcane/projectiles.qc @@ -0,0 +1,1645 @@ +/*====================================================================== + PROJECTILE Systems + ------------------ + + * Bullets (PROJECTILE) + * Nails + * Rockets + * Grenades + * Plasma + + PLAYER Projectile Collision (movetypes) + --------------------------------------- + + * ID software Quake originally had most player projectiles (rockets/nails) + use a large collision size (MOVETYPE_FLYMISSILE) and this especially + helped with flying enemies (scrags) that strafe around quickly. + + * AD changed all the player projectile collision boxes to a smaller + size (MOVETYPE_FLY) to add a greater challenge to combat and this + is noticeable when fighting flying monsters. + This change was linked to the setting of the sv_aim console command, + which has been changed from 0.93 to 1 in most modern quake clients. + The sv_aim command was used to help steer projectiles into monsters + to ultimately make the combat easier for keyboard only players. + + * Projectiles move in discreet steps on the server and with a small + movetype they can often skip through objects. This was probably the + reason ID software had large collision and changing them to small + only makes combat more difficult and less fun. + + * The projectile size is now linked to a worldspawn variables which + defaults to 0 and will keep the original ID software default while + giving map makers the choice to override this option. + + There is also an impulse command (105) to toggle this setting and + its reported on the mod info table on the console (developer 1) + + The new worldspawn variable is - no_bigprojectiles + + This change will affect the following ammo type/weapons: + shells(SG/SSG/WSG), nails(NG/SNG), rockets(RL) and cells(PG). + + * There is a big projectile collision for grenades but ID software + never used it. All grenades are setup with MOVETYPE_BOUNCE + which is always a small collision. + +======================================================================*/ +void() Particle_Bullet = +{ + // Is the touch function blocked? + if (self.waitmin > time) return; + if (self.delay < time) entity_remove(self, 1); + else { + if (random() < 0.5) { + self.oldorigin = crandom() * '1 1 1'; + if (random() < 0.8) self.lip = rint(random()*4); + else self.lip = 112 + rint(random()*4); + particle (self.origin, self.oldorigin, self.lip, 1 + rint(random()*2)); + } + self.think = Particle_Bullet; + self.nextthink = time + self.speed; + } +}; + +//---------------------------------------------------------------------- +void() Touch_Bullet = +{ + if (self.touchedvoid) return; // Marked for removal + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + if (self.waitmin > time) return; // bullet touch has been disabled + entity_remove(self, 1); // Setup bullet for removal + + //---------------------------------------------------------------------- + // Hit monster/interactive object, impact blood + //---------------------------------------------------------------------- + if (other.takedamage) { + // Due to how difficult projectile shotguns were to hit thing + // An extra +4 damage (dead center tracer) was added to help + // In AD 1.7+ the bullet projectiles are now using wide impact + // against monsters which means more pellets will hit. + // The extra tracer pellet damage is not required anymore. + + // Check pellet type for damage + if (self.classtype == CT_PROJ_TRACEPART) self.dmg = 0; + else if (self.classtype == CT_PROJ_TRACE) self.dmg = 0; + // Old code kept for reference + // No extra trace damage for zombies, it will kill them + //if (other.classgroup == CG_ZOMBIE) self.dmg = 0; + //else self.dmg = DAMAGE_PTSHELL; + // Default shell pellet damage + else self.dmg = DAMAGE_PSHELL; + + // Check for breakable/pushable no monster damage + if (ai_immunedamage(self.owner, other)) { + self.dmg = 0; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + // Show bullet resistance as small blood+gunshot+smoke + else if (other.resist_shells > 0) { + self.dmg = Resist_Damage(other, IT_SHELLS, self.dmg); + Resist_Shells(other, self.origin, self.velocity, self.dmg); + } + else { + // Hitting monsters does twice the amount of blood effects + if (other.flags & FL_MONSTER) spawn_touchblood (self, other, self.dmg*2); + else spawn_touchblood (self, other, self.dmg); + } + + // Finally do the damage, if any available (after resistance) + if (self.dmg > 0) T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + } + //---------------------------------------------------------------------- + // Hit world/static object, impact particles + //---------------------------------------------------------------------- + else { + // Tracer bullet, dead center and inflight particle emitter + // Originally did no damage, but changed to buff particle SG + if (self.classtype == CT_PROJ_TRACE) { + self.lip = random(); + // NG tink sound or SG ricochet sound (hardcoded client sounds) + if (self.lip < 0.5) sound(self, CHAN_VOICE, "weapons/tink1.wav", random()*0.5, ATTN_LOW); + else if (self.lip < 0.7) sound(self, CHAN_VOICE, "weapons/ric2.wav", random()*0.5, ATTN_LOW); + else sound(self, CHAN_VOICE, "weapons/ric3.wav", random()*0.5, ATTN_LOW); + } + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + } +}; + +//---------------------------------------------------------------------- +void(vector org, vector dir, float proj_type, float proj_speed) Launch_Bullet = +{ + newmis = spawn(); + newmis.owner = self; + newmis.classname = "proj_bullet"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJSHELLS; // Ammo type + //---------------------------------------------------------------------- + // Horrible hack! If the player has the TSG or quad, flag it for zombies + //---------------------------------------------------------------------- + if (self.moditems & IT_UPGRADE_SSG || self.super_damage_finished > 0) + newmis.weapon = TRUE; + + //---------------------------------------------------------------------- + // Setup player/monster projectile collision + //---------------------------------------------------------------------- + if (self.classtype == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + } + else newmis.movetype = MOVETYPE_FLYMISSILE; // Default = large collision + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Bullet; // touch function + newmis.waitmin = 0; // Touch function active + + // Particle tracer (true aim, no damage) + if (proj_type == CT_PROJ_TRACE || proj_type == CT_PROJ_TRACEPART) { + newmis.delay = time + LIFE_SHELLS; // Maximum life time + if (self.weapon & IT_SUPER_SHOTGUN) newmis.count = 1; + else newmis.count = 1 + rint(random()*2); // Default particles for SG + newmis.speed = 0.02; // Next function interval (very high tick) + newmis.think = Particle_Bullet; // Particle trail + newmis.nextthink = time + newmis.speed; + } + // SG/SSG shells (scatter effect) + else { + newmis.think = SUB_Remove; + newmis.nextthink = time + LIFE_SHELLS; // Stop projectile going forever + } + + newmis.mdl = MODEL_PROJ_DIAM2; + setmodel(newmis, newmis.mdl); // Diamond model + newmis.frame = random()*15; // Full range of sizes + newmis.skin = 16 + random()*7; // Bright colours + + newmis.velocity = dir * proj_speed; // Constant speed multiplier + newmis.angles = vectoangles(dir); // Create direction angle + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); // Zero size + setorigin (newmis, org); // Move to starting position + newmis.avelocity = vecrand(100,200,FALSE); + +}; + +//---------------------------------------------------------------------- +void(float bullet_count, vector bullet_spread, float bullet_type) Launch_Shells = +{ + local vector src_origin, bullet_dir, spread_dir; + local float bullet_speed, var_speed; + + // Is the player firing the shotgun? + if (self.flags & FL_CLIENT) { + makevectors(self.v_angle); + // Infront of player model and down towards gun + src_origin = self.origin + attack_vector('10 0 8'); + if (bullet_type == CT_PROJ_SG) bullet_speed = SPEED_PLAYERSG; + else bullet_speed = SPEED_PLAYERSSG; + // Either straight line or auto aim assist (builtin function 44) + if (autoaim_cvar < 1) bullet_dir = aim(self, SPEED_PLAYAIM); + else bullet_dir = normalize(v_forward * bullet_speed); + } + else { + makevectors(self.angles); + // At the end of the new soldier gun model + src_origin = self.origin + attack_vector(self.attack_offset); + bullet_speed = SPEED_MONSG + (skill*SPEED_MONSGMULT); + // fire somewhat behind the player, so a dodging player is harder to hit + bullet_dir = self.enemy.origin - self.enemy.velocity*0.2; + bullet_dir = normalize (bullet_dir - self.origin); + } + + // Setup particle emitter/tracer shot (true aim) + Launch_Bullet(src_origin, bullet_dir, CT_PROJ_TRACE, bullet_speed); + // Reduced the amount of visual noise infront of the player + // The projectiles below are particle trail emitters only + // Launch_Bullet(src_origin+(v_right*(crandom()*10)), bullet_dir, CT_PROJ_TRACEPART, bullet_speed + (crandom()*30) ); + // Launch_Bullet(src_origin+(v_right*(crandom()*10)), bullet_dir, CT_PROJ_TRACEPART, bullet_speed + (crandom()*30) ); + + while (bullet_count > 0) { + var_speed = crandom()*10 + bullet_speed; // Slight speed variance + spread_dir = bullet_dir + (crandom()*bullet_spread_x) * v_right + (crandom()*bullet_spread_y) * v_up; + Launch_Bullet(src_origin, spread_dir, bullet_type, var_speed); + + bullet_count = bullet_count - 1; + } +}; + +/*====================================================================== + PLASMA PROJECTILES + * requires special blue/white particle trail + * Has radius and impact touch damage + * used by Eliminator (enforcer), Soldier and Minotaur +======================================================================*/ +void() Particle_Plasma = +{ + // projectile has touched something + if (self.waitmin > time) return; + + // Generate sprite particles? DP not active? + if (random() < 0.5 && !ext_dppart) { + self.oldorigin = crandom() * '1 1 1'; + if (self.poisonous) self.lip = 56 + rint(random()*8); + else self.lip = 40 + rint(random()*8); + particle (self.origin, self.oldorigin, self.lip, 4 + rint(random()*4)); + if (self.poisonous) self.lip = 182 + rint(random()*8); + else self.lip = 198 + rint(random()*4); + particle (self.origin, self.oldorigin, self.lip, 2 + rint(random()*2)); + } + + // The Player plasma projectile grows over frames + if (self.classproj == CT_PLAYER) { + if (self.attack_finished < time) { + self.frame = self.frame + 1; + if (self.frame < 6) self.attack_finished = time + 0.1; + else self.frame = 6; + } + } + + self.think = Particle_Plasma; + self.nextthink = time + self.speed; +}; + +//---------------------------------------------------------------------- +// Compiler forward reference +void(vector org, vector dir, float proj_type, float proj_speed) launch_plasma; +//---------------------------------------------------------------------- +void() Touch_PlasmaProjectile = +{ + local vector org, vec, dir; + local entity tself; + + if (self.touchedvoid) return; // Marked for removal + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + if (self.waitmin > time) return; // plasma touch has been disabled + + if (self.classproj == CT_PLAYER) self.pos1 = DAMAGE_PGPLAYER; + else if (self.classproj == CT_REFLECTLIGHT) self.pos1 = DAMAGE_PGREFLECT; + else if (self.classproj == CT_REFLECTPLASMA) self.pos1 = DAMAGE_PGREFLECT; + else if (self.classproj == CT_MONMINOTAUR) self.pos1 = DAMAGE_PGMINOTAUR; + else if (self.classproj == CT_MONGAUNT) self.pos1 = DAMAGE_PGGAUNT; + else if (self.classproj == CT_MONNOUR) self.pos1 = DAMAGE_PGNOUR; + else self.pos1 = DAMAGE_PLASMA; + + // Check for breakable/pushable immunity first + if (ai_immunedamage(self.owner, other)) self.pos1 = '0 0 0'; + self.dmg = self.pos1_x + random()*self.pos1_y; + + // Plasma Splashdamage affects everything, check for 0 dmg first + // This will also apply a poisonous debuff from the attacker + if (self.pos1_z > 0) + T_RadiusDamage (self, self.owner, self.pos1_z, world, DAMAGEALL); + + //---------------------------------------------------------------------- + // Hit monster/interactive object, impact blood + //---------------------------------------------------------------------- + if (other.takedamage) { + // Check for breakable/pushable no monster damage + if (ai_immunedamage(self.owner, other)) { + // Using a cut down version of ammo resistance + SpawnExplosion(EXPLODE_BURST_SMOKE, self.origin, SOUND_PLASMA_HIT); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 300, 50, 150); + } + // Check for plasma/cell resistance + else if (other.resist_cells > 0) { + self.dmg = Resist_Damage(other, IT_CELLS, self.dmg); + Resist_Plasma(other, self.origin); + } + else { + // Hitting monsters does twice the amount of blood effects + if (other.flags & FL_MONSTER) spawn_touchblood (self, other, self.dmg*2); + else spawn_touchblood (self, other, self.dmg); + + // Switch poisonous to poison sprite, but keep plasma explosion + // Otherwise this sounds confusing with a rocket explosion + if (self.poisonous) self.lip = EXPLODE_POISON_SMALL; + else { + // Randomly pick between quoth electric and blue explosions + if (random() < 0.3) self.lip = EXPLODE_PLASMA_SMALL; + else self.lip = EXPLODE_ELECT_SMALL; + } + SpawnExplosion(self.lip, self.origin, SOUND_PLASMA_HIT); + } + + // Plasma hits always kill any zombie (1 hit) + if (other.classgroup == CG_ZOMBIE) self.dmg = DAMAGE_ZOMBIECLASS; + // Don't bother with damage if there is none! + if (self.dmg > 0) T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + + } + //---------------------------------------------------------------------- + // Hit world/static object, impact particles + //---------------------------------------------------------------------- + else { + // New special coloured particle explosion (rogue expansion) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (self.poisonous) WriteByte (MSG_BROADCAST, 51); + else WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Poisonous sprite explosion instead + if (self.poisonous) self.lip = EXPLODE_POISON_SMALL; + // Classic quoth electric impact explosion + else self.lip = EXPLODE_ELECT_SMALL; + SpawnExplosion(self.lip, self.origin, SOUND_PLASMA_HIT); + } + // Check for any plasma reflection? (player only function) + if (self.classproj == CT_PLAYER && other.reflectplasma) { + org = self.origin; + // Random chance that plasma will reflect straight back + if (random() < 0.2 && self.owner) + dir = normalize(self.owner.origin - org); + else { + // Pick random location instead + vec = org + vecrand(0,1000,1); + dir = normalize(vec - org); + } + // Switch around self to make sure reflection happens once + tself = self; self = other; + launch_plasma(org, dir, CT_REFLECTPLASMA, SPEED_REFLECTION); + self = tself; + } + + // Remove plasma bolt + entity_remove(self, 1); +}; + +//---------------------------------------------------------------------- +void(vector org, vector dir, float proj_type, float proj_speed) launch_plasma = +{ + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_plasma"; // obj name, not really used anymore + newmis.classtype = CT_PROJ_PLASMA; // Class type number, quick identity + newmis.classgroup = CG_PROJCELLS; // Ammo type + newmis.classproj = proj_type; // Monster type number + newmis.attack_speed = proj_speed; // Save for later + + // The player plasma projectile use to be linked to autoaim condition + // Switched to larger collision, so that greater chance to hit enemies + // Monsters always use large collision (otherwise infighting would be less) + //---------------------------------------------------------------------- + if (proj_type == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + } + else { + // Monster get the raw deal, small projectile collision + newmis.movetype = MOVETYPE_FLY; + // Minotaur, Gaunt is rapid fire, don't need glow effect (slow down) + if (proj_type != CT_MONGAUNT && proj_type != CT_MONMINOTAUR) + newmis.effects = EF_DIMLIGHT; + } + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_PlasmaProjectile; + newmis.nextthink = time + LIFE_PROJECTILE; + newmis.think = SUB_Remove; + newmis.poisonous = newmis.owner.poisonous; + + // Setup model and special parameters (zombie, boss) + //---------------------------------------------------------------------- + if (proj_type == CT_MONARMYPLASMA) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONELIMATOR) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONCENTURION) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONGAUNT) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_GAPLASMAGRN); + else setmodel (newmis, MODEL_PROJ_GAPLASMA); + } + else if (proj_type == CT_MONEEL) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONSEEKER) setmodel (newmis, MODEL_PROJ_PLASMA); + else if (proj_type == CT_MONMINOTAUR) setmodel (newmis, MODEL_PROJ_MPLASMA); + else if (proj_type == CT_MONNOUR) setmodel (newmis, MODEL_PROJ_NOUR3); + else if (proj_type == CT_REFLECTLIGHT) setmodel (newmis, MODEL_PROJ_LIGHTNING2); + else if (proj_type == CT_REFLECTPLASMA) { + setmodel (newmis, MODEL_PROJ_PGPLASMA); + newmis.avelocity = vecrand(0,300,TRUE); // randomize avel + newmis.angles_y = rint(random()*360); // Random angle + newmis.frame = 3; // Medium size + } + else { + setmodel (newmis, MODEL_PROJ_PGPLASMA); + newmis.attack_finished = time + 0.1; // Update model frame every 0.1s + newmis.avelocity = vecrand(0,300,TRUE); // randomize avel + newmis.angles_y = rint(random()*360); // Random angle + newmis.frame = 0; // Start really small + } + + //---------------------------------------------------------------------- + // Is DP engine active for new particle trail? + if (ext_dppart) { + if (newmis.poisonous) newmis.traileffectnum = particleeffectnum(DPP_TRPOISON); + else newmis.traileffectnum = particleeffectnum(DPP_TRPLASMA); + newmis.effects = 0; + // Extra glow and light colour (DP mostly) + //newmis.effects = EF_BLUE; + //newmis.glow_color = 246; // Blue/gold + } + + // Manually generate special particle trail (blue or green) + newmis.count = 1 + rint(random()*2); // Default particles + newmis.speed = 0.02; // Next function interval (very high tick) + newmis.think = Particle_Plasma; // Particle trail + newmis.nextthink = time + newmis.speed; + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.velocity = dir * newmis.attack_speed; + if (proj_type != CT_PLAYER) newmis.angles = vectoangles(dir); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + SMALL PROJECTILES - used all over the place ... + + * player (nailgun, super nailgun) + * Wizards (double spit) + * Hell Knights (magic spray) + * spike shooters (regular, super, laser) + * Enforcers (laser) + * Crossbow Knights (bolts) + * Zombies (flesh) +======================================================================*/ +// Forward compiler reference because of peircing nails function +void(vector org, vector dir, float proj_type, float proj_speed) launch_projectile; + +//---------------------------------------------------------------------- +void() Touch_Projectile = +{ + local vector org, dir, vec; + local float proj_type, proj_speed; + local entity tself; + + if (self.touchedvoid) return; // Marked for removal + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other == self.owner) return; // no touching self + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + // No more touch/world interaction + self.touch = SUB_Null; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + + //---------------------------------------------------------------------- + // Laser impact/stop sound (precached by owner) + if (self.classtype == CT_PROJ_LASER) + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + // Golem rock impact sound (precached by owner) + else if (self.classtype == CT_PROJ_GROCK) { + self.lip = random(); + self.volume = 0.5 + random()*0.5; + if (self.lip < 0.25) sound (self, CHAN_WEAPON, SOUND_IMP_ROCK1, self.volume, ATTN_BREAK); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, SOUND_IMP_ROCK2, self.volume, ATTN_BREAK); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, SOUND_IMP_ROCK3, self.volume, ATTN_BREAK); + else sound (self, CHAN_WEAPON, SOUND_IMP_ROCK4, self.volume, ATTN_BREAK); + } + + //---------------------------------------------------------------------- + // hit something that bleeds + if (other.takedamage) { + // SNG spikes are essentially double damage (cheap way of 2 x nails) + if (self.classtype == CT_PROJ_SNG) self.dmg = DAMAGE_SNGSPIKE; + // Reflected nails (can only happen from the player) + else if (self.classtype == CT_PROJ_REFNG) self.dmg = DAMAGE_NGREFSPIKE; + // Bob and enforcer lasers are different + else if (self.owner.classtype == CT_MONJIM) + self.dmg = DAMAGE_BOBLASER + (random() * DAMAGE_BOBLASER); + else if (self.classtype == CT_PROJ_LASER) self.dmg = DAMAGE_LASER; + // Special damage and sound effects for crossbow knights + else if (self.classtype == CT_PROJ_BOLT1) { + // hit4 = flesh wound, hit1 = ting sound + if (random() < 0.3) sound (self, CHAN_WEAPON, "weapons/bolt_hit1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/bolt_hit4.wav", 1, ATTN_NORM); + // Reduce the damage if the bolt has hit another dcrossbow knight + if (other.classtype == self.owner.classtype) self.dmg = DAMAGE_BOLT0; + else self.dmg = DAMAGE_BOLT1; + } + else if (self.classtype == CT_PROJ_BLBOLT || self.classtype == CT_PROJ_BLBOLT2) + self.dmg = DAMAGE_BOGLORD; + // Zombies have special impact sound + else if (self.classtype == CT_PROJ_FLESH) { + sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + self.dmg = DAMAGE_FLESH; + } + // Scorpion spikes cannot hurt other spider types + // This is to prevent the minion scorpion killing other minions + else if (self.classtype == CT_PROJ_SCORP) { + if (other.classgroup == self.owner.classgroup) self.dmg = 0; + else self.dmg = DAMAGE_NGSPIKE; + } + // Rock projectiles cannot hurt stone monsters! + else if (self.classtype == CT_PROJ_GROCK) { + if (other.classgroup == self.owner.classgroup) self.dmg = 0; + else self.dmg = DAMAGE_NGSPIKE; + } + // Default spike damage (nails) + else self.dmg = DAMAGE_NGSPIKE; + + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self.owner, other)) { + // Zero damage and make sure no resistance checks + self.dmg = self.classgroup = 0; + // Remove poisonous effect + self.poisonous = FALSE; + // Show ammo resistance effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 200, 50, 150); + } + + //---------------------------------------------------------------------- + // Check for poison debuff (using poisonous flag) + if (self.poisonous == TRUE) PoisonDeBuff(other); + + //---------------------------------------------------------------------- + // Check for NG/SNG nail resistance + if (self.classgroup == CG_PROJNAILS && other.resist_nails > 0) { + self.dmg = Resist_Damage(other, IT_NAILS, self.dmg); + Resist_Nails(other, self.origin); + self.projeffect = 0; + // Check for any nail reflection? + if (other.reflectnails && random() < other.resist_nails) { + org = self.origin; + // Random chance that nail will reflect straight back + if (random() < 0.2 && self.owner) + dir = normalize(self.owner.origin - org); + else { + // Pick random location instead + // Flatten the Z axis so the reflection looks less random + vec = vecrand(0,100,1); + vec_z = random()*25; + vec = vec + org; + dir = normalize(vec - org); + } + // Switch around self to make sure reflection happens once + tself = self; self = other; + launch_projectile(org, dir, CT_PROJ_REFNG, SPEED_REFLECTION); + self = tself; + } + } + //---------------------------------------------------------------------- + // Produce blood particles at impact and apply damage to target + if (self.dmg > 0) { + spawn_touchblood (self, other, self.dmg); + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + } + + //---------------------------------------------------------------------- + // Nail Piercing affect, move nail through monster + if (self.projeffect & IT_ARTPIERCE) { + // a small pile of gibs! + if (random() < 0.2) SpawnMeatSpray (self, other, crandom() * 100); + // Setup projectile ready for monster tests + self.movetype = MOVETYPE_FLY; + self.solid = SOLID_BBOX; + self.oldorigin = self.origin; + self.count = 0; + + // Loop forward 8 times to find space on the other side + while (self.count < 8) { + // Trace forward from current position + self.finaldest = self.oldorigin + self.finalangle*512; + traceline(self.oldorigin, self.finaldest,FALSE,self); + // Still inside bleeding object? + if (trace_ent == other) + self.oldorigin = self.oldorigin + self.finalangle*16; + // On the other side! + else self.count = 8; + self.count = self.count + 1; + } + // Is the other side free space to spawn? + if (pointcontents(self.oldorigin) == CONTENT_EMPTY) { + tself = self; + org = self.oldorigin; + dir = self.finalangle; + proj_type = self.classtype; + proj_speed = self.attack_speed; + self = self.owner; + // Once a projectile hits an object it is impossible + // to reset its velocity/angles and carry on + // It is easier to create a new projectile and delete + // the currently damaged one instead! + launch_projectile(org, dir, proj_type, proj_speed); + self = tself; + } + } + } + //---------------------------------------------------------------------- + else { + // Some projectiles need to be left lying around for a while + if (self.bodyfadeaway) { + if (self.classtype == CT_PROJ_FLESH) + sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_SPID) + sound (self, CHAN_WEAPON, "spider/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_SWAMP) + sound (self, CHAN_WEAPON, "swampling/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_VORE) + sound (self, CHAN_WEAPON, "voreling/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_ELF) + sound (self, CHAN_WEAPON, "xmas/elf/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_BOLT1) { + if (random() < 0.5) sound (self, CHAN_WEAPON, "weapons/bolt_hit2.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/bolt_hit3.wav", 1, ATTN_NORM); + } + + self.velocity = self.avelocity = '0 0 0'; + // Straight away make projectiles vanish + self.nextthink = time + 2 + random(); + self.ltime = self.nextthink; + self.think = model_fade; + return; + } + + //---------------------------------------------------------------------- + // Standard engine impact particles and sounds + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + + if (self.classtype == CT_PROJ_SNG) WriteByte (MSG_BROADCAST, TE_SUPERSPIKE); + else if (self.classtype == CT_PROJ_LASER) WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + else if (self.classtype == CT_PROJ_GROCK) WriteByte (MSG_BROADCAST, TE_GUNSHOT); + else if (self.classtype == CT_PROJ_WIZ) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_SPID) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_SWAMP) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_VORE) WriteByte (MSG_BROADCAST, TE_SUPERSPIKE); + else if (self.classtype == CT_PROJ_ELF) WriteByte (MSG_BROADCAST, TE_GUNSHOT); + else if (self.classtype == CT_PROJ_FURY2) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_NOUR1) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_BLBOLT) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_BLBOLT2) WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + else if (self.classtype == CT_PROJ_HKN) WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + else WriteByte (MSG_BROADCAST, TE_SPIKE); + + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + } + + // Hide projectile and wait for any sounds to finish playing + entity_remove(self,2); +}; + +//---------------------------------------------------------------------- +void(vector org, vector dir, float proj_type, float proj_speed) launch_projectile = +{ + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_nail"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + + if (newmis.classtype == CT_PROJ_NG || newmis.classtype == CT_PROJ_SNG) + newmis.classgroup = CG_PROJNAILS; // Ammo type + else newmis.classgroup = CG_PROJALL; // Ammo type (default) + + // Switch model collision based on auto aim functionality + // Monsters always use large collision (otherwise infighting would be less) + //---------------------------------------------------------------------- + if (self.classtype == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + // Check if the player has the nail piercer effect active + if (self.moditems & IT_ARTPIERCE && newmis.classgroup == CG_PROJNAILS) { + newmis.projeffect = IT_ARTPIERCE; + } + } + // lasers/plasma are small and glowing + else if (proj_type == CT_PROJ_LASER) { + newmis.movetype = MOVETYPE_FLY; + newmis.effects = EF_DIMLIGHT; + } + // Crossbow bolts are small and stick around + else if (proj_type == CT_PROJ_BOLT1) { + newmis.movetype = MOVETYPE_FLY; + newmis.bodyfadeaway = TRUE; + } + // Default = large collision + else newmis.movetype = MOVETYPE_FLYMISSILE; + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Projectile; + newmis.nextthink = time + LIFE_PROJECTILE; + newmis.think = SUB_Remove; + newmis.poisonous = newmis.owner.poisonous; + + // Setup model + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_NG) setmodel (newmis, MODEL_PROJ_NG); + else if (proj_type == CT_PROJ_SNG) setmodel (newmis, MODEL_PROJ_SNG); + else if (proj_type == CT_PROJ_REFNG) setmodel (newmis, MODEL_PROJ_NGRED); + // Santa Snowball machine gun! + else if (proj_type == CT_PROJ_SANTA) setmodel (newmis, MODEL_PROJ_SNOWBALL); + // Crossbow Knight has poison/regular bolts + else if (proj_type == CT_PROJ_BOLT1) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_BOLT2); + else setmodel (newmis, MODEL_PROJ_BOLT1); + } + // Hell Knight + Death Knight magic attack (can be poisonous) + else if (proj_type == CT_PROJ_HKN) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_HKNGRN); + else setmodel (newmis, MODEL_PROJ_HKN); + } + // Death Lord - like Death Knight magic attack (spike ball instead) + else if (proj_type == CT_PROJ_DLORD) { + setmodel (newmis, MODEL_PROJ_DLORD1); + // If can see enemy, steer the spike ball + if (visible(self.enemy)) { + newmis.enemy = self.enemy; + newmis.nextthink = time + 0.1; + newmis.think = self.th_updmissile; + } + } + // Enforcer (can be poisonous) + else if (proj_type == CT_PROJ_LASER) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_LASERGRN); + else setmodel (newmis, MODEL_PROJ_LASER); + // If DP/FTE engine use new particle trail, glowing for Fitz engines + if (ext_dppart) { + if (newmis.poisonous) newmis.traileffectnum = particleeffectnum(DPP_TRPOISON); + else newmis.traileffectnum = particleeffectnum(DPP_TRLASER); + newmis.effects = 0; // Remove any glows + } + } + // Wraith fire bones (nails) can be poisonous as well + else if (proj_type == CT_PROJ_WBONE) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_WPOISON); + else setmodel (newmis, MODEL_PROJ_WBONE); + } + // Wizards/Scrags can be poisonous and have a diff skin (head+gibs) + // Cannot show change with projectile because its already green! + else if (proj_type == CT_PROJ_WIZ) setmodel (newmis, MODEL_PROJ_WIZ); + + // mpoison = Darker Minotaur, always poisonous + else if (proj_type == CT_PROJ_MPOISON) setmodel (newmis, MODEL_PROJ_MPOISON); + + // monng = Red Coloured Nails + else if (proj_type == CT_PROJ_MONNG) setmodel (newmis, MODEL_PROJ_NGRED); + else if (proj_type == CT_PROJ_SCORP) setmodel (newmis, MODEL_PROJ_SCORP); + else if (proj_type == CT_PROJ_FURY2) setmodel (newmis, MODEL_PROJ_FURY2); + else if (proj_type == CT_PROJ_NOUR1) setmodel (newmis, MODEL_PROJ_NOUR1); + // Boglord / Fire Shambler nail/lightning attack + else if (proj_type == CT_PROJ_BLBOLT) { + if (self.spawnflags & MON_BOGL_STRONG) { + newmis.classtype = CT_PROJ_BLBOLT2; + setmodel (newmis, MODEL_PROJ_BLORDBOLT2); + } + else setmodel (newmis, MODEL_PROJ_BLORDBOLT1); + } + // Golem rock storm attack + else if (proj_type == CT_PROJ_GROCK) { + if (random() < 0.5) setmodel (newmis, MODEL_PROJ_GROCK1); + else setmodel (newmis, MODEL_PROJ_GROCK2); + newmis.frame = rint(random()*9); + newmis.avelocity = vecrand(0,200,TRUE); + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.attack_speed = proj_speed; + newmis.finalangle = dir; + newmis.velocity = newmis.finalangle * newmis.attack_speed; + newmis.angles = vectoangles(newmis.finalangle); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + This missile touch function is designed for monsters NOT players + * No DIRECT damage, just radius and a lot lower (40 vs 110) + * Half damage to shamblers (inside T_RadiusDamage) + * Will work with homing or direct missile attacks + * checks for breakables that can be destroyed with explosives + * uses default explosion function +======================================================================*/ +void() Touch_HomingMissile = +{ + if (self.touchedvoid) return; // Marked for removal + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self.oldenemy, other)) { + // Show ammo resistance on bmodel + SpawnExplosion(EXPLODE_BURST_SMOKE,self.origin,SOUND_RESIST_ROCKET); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 250); + SpawnProjectileSmoke(self.origin, 300, 50, 150); + } + else { + //---------------------------------------------------------------------- + // Check for breakables that can be triggered + if (ai_foundbreakable(self.oldenemy, other, TRUE) && other.brktrigmissile != 0) { + // Found a breakable which is prone to explosive damage + trigger_ent(other, self.oldenemy); + } + else { + // Homing Missiles always kill any zombie class + if (other.classgroup == CG_ZOMBIE) + T_Damage (other, world, world, DAMAGE_ZOMBIECLASS, NOARMOR); + else { + // Missile explosion base/rnd/splash + self.pos1 = '0 0 0'; + if (self.classtype == CT_PROJ_SHUB1) self.pos1 = self.oldenemy.pos2; + // Shalrath/DSerg are using classic voreball damage + else self.pos1_z = DAMAGE_MONROCKET; + + // pre-calculate missile damage + self.dmg = self.pos1_x + (random() * self.pos1_y); + // Check for any rocket ammo resistance + if (other.resist_rockets > 0) { + self.dmg = Resist_Damage(other, IT_ROCKETS, self.dmg); + } + + // Only call T_ functions if there is damage to do! + if (self.dmg > 0 && other.health > 0) + T_Damage (other, self, self.oldenemy, self.dmg, DAMARMOR); + + if (self.pos1_z > 0) { + // Stop multiple enemies of the same class type (same as wraiths) + // killing themselves with their own homing missiles! + // Radius damage also applies poison debuff if present on attacker + T_RadiusDamage (self, self.oldenemy, self.pos1_z, self.oldenemy, IGNORECLASS); + } + else { + // Check for poison debuff (using poisonous flag) + if (self.poisonous == TRUE) PoisonDeBuff(other); + } + } + } + + //---------------------------------------------------------------------- + // Rocket resistance is shown with puffs of smoke + if (other.resist_rockets > 0) Resist_Rockets(other, self.origin); + else { + // Use special effect for voreball explosions in DP + if (ext_dppart) { + // DP effect name set before homing missile launched + if (self.poisonous == TRUE) self.dpp_name = DPP_TEPOISON; + pointparticles(particleeffectnum(self.dpp_name), self.origin, '0 0 0', 1); + // Play standard explosion sound + sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + } + else { + if (self.poisonous) { + // New special coloured particle explosion (rogue expansion) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 51); + WriteByte (MSG_BROADCAST, 8); + // Sprite explosion for Fitz engines + SpawnExplosion(EXPLODE_POISON_SMALL, self.origin, SOUND_REXP3); + } + else { + // Standard explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + // Sprite explosion for Fitz engines + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + } + } + } + } + + // Hide+Delete homing missile, no longer needed + // Wait for any sounds to finish playing + entity_remove(self, 4); +}; + +//---------------------------------------------------------------------- +// Re-direct any map hacks to the new function replacement +void() ShalMissileTouch = { Touch_HomingMissile(); }; + +//---------------------------------------------------------------------- +void() Steer_HomingMissile = +{ + local vector dir, vtemp; + + // If tracking enemies dies or end level? remove homing missiles + if (self.enemy.health < 1) { remove(self); return; } + if (intermission_running > 1) { remove(self); return; } + + vtemp = self.enemy.origin + self.v_angle; + dir = normalize(vtemp - self.origin); + self.velocity = dir * self.attack_speed; + + // After 1s let homing missiles impact on ower + if (self.waitmin < time) self.owner = self; + + // Slow speed update that the missile can steer around corners + // sloppy slow updates allows for a better game experience + self.nextthink = time + 0.2; + self.think = Steer_HomingMissile; +}; + +//---------------------------------------------------------------------- +void(vector orgofs, vector targofs, float proj_type, float proj_speed) Launch_HomingMissile = +{ + local vector org, dir; + local float dist, flytime; + + // Check if there is space to spawn entity + makevectors(self.angles); + org = self.origin + attack_vector(orgofs); + if (entity_pcontent(org)) return; + + newmis = spawn (); + // Owner is always excluded from touch functions, save in oldenemy + // and after one second remove owner so will touch everything + newmis.owner = newmis.oldenemy = self; + newmis.classname = "proj_rocket"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJROCKETS; // Ammo type + + newmis.movetype = MOVETYPE_FLYMISSILE; // Default = large collision + newmis.enemy = self.enemy; // Used for homing target + newmis.v_angle = targofs; // Store for later + + //---------------------------------------------------------------------- + // Aim the missile slightly above enemy + dir = normalize((self.enemy.origin + newmis.v_angle) - org); + dist = vlen (self.enemy.origin - org); + flytime = dist * 0.002; + if (flytime < 0.1) flytime = 0.1; + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_HomingMissile; + newmis.nextthink = flytime + time; + newmis.think = Steer_HomingMissile; + newmis.attack_speed = proj_speed; + // Allow 3s for the homing missile to travel away + newmis.waitmin = time + 3; + newmis.poisonous = newmis.owner.poisonous; + + // Setup model for each missile type + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_SHAL) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_SHALGRN); + else setmodel(newmis, MODEL_PROJ_SHAL); + newmis.dpp_name = DPP_TEVORESPIKE; + } + else if (proj_type == CT_PROJ_SERG) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_SHALGRN); + else setmodel(newmis, MODEL_PROJ_SERG); + newmis.dpp_name = DPP_TEEXPLODE; + } + else if (proj_type == CT_PROJ_SHUB1) { + setmodel(newmis, MODEL_PROJ_SHUB1); + newmis.dpp_name = DPP_TEEXPLODE; + // Push the homing missing up from center + makevectors(self.angles); + // The angles key will reverse direction + // for up-side-down Shub + dir = v_up*0.5; + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.velocity = dir * newmis.attack_speed; + newmis.avelocity = vecrand(100,200,FALSE); + newmis.angles = vectoangles(dir); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + ROCKETS + * Half damage to shamblers (T_MissileTouch and T_RadiusDamage) + * checks for breakables that can be destroyed with explosives + * All rockets have direct & radius damage (based on projectile type) +======================================================================*/ +void() Touch_Missile = +{ + if (self.touchedvoid) return; // Marked for removal + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + if (self.oldenemy) { // stop packs of owners killing each other + if (other.classtype == self.oldenemy.classtype) return; } + // Guardian skull wizards have special poison explosion + if (self.classtype == CT_PROJ_SKULLW && self.th_updmissile != SUB_Null) { + self.th_updmissile(); return; } + + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self.owner, other)) { + // Show ammo resistance + SpawnExplosion(EXPLODE_BURST_SMOKE,self.origin,SOUND_RESIST_ROCKET); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 300, 50, 150); + } + else { + //---------------------------------------------------------------------- + // Check for breakables that can be triggered + if (ai_foundbreakable(self.owner, other, TRUE) && other.brktrigmissile != 0) { + // Found a breakable which is prone to explosive damage + trigger_ent(other, self.owner); + } + else { + // Stop any updates to the missile velocity + self.nextthink = time + 1; + self.think = SUB_Null; + + // Setup rocket damage (vector = base + random and splash) + if (self.classtype == CT_PROJ_ROCKET) self.pos1 = DAMAGE_RLPLAYER; + // Boss ID - E1M7 + else if (self.classtype == CT_PROJ_LAVA) self.pos1 = DAMAGE_RLPLAYER; + // BOSS Custom version with custom damage (self.pos2) + else if (self.classtype == CT_PROJ_CHTHON) self.pos1 = self.owner.pos2; + // BOSS Custom for ad_mountain (Chthon model) + else if (self.classtype == CT_PROJ_FIRETOP) self.pos1 = DAMAGE_RLFIRETOP; + // BOSS Custom for ad_magma (Stone demon model) + else if (self.classtype == CT_PROJ_EIDO1) self.pos1 = DAMAGE_RLEIDO; + // BOSS Custom for ad_azad (Ice Golem model) + else if (self.classtype == CT_PROJ_ICEG1) self.pos1 = DAMAGE_RLICEG; + // BOSS Custom for ad_sepulcher (Fire Shambler) + else if (self.classtype == CT_PROJ_BLORD2) self.pos1 = DAMAGE_RLBLORD; + // BOSS Custom for ad_sepulcher (Green Shambler) + else if (self.classtype == CT_PROJ_BLORD) { + self.pos1 = DAMAGE_RLBLORD; + // Don't spawn gib models at impact (could be solid) + self.oldorigin = self.origin; + self.origin = self.origin - 8*normalize(self.velocity); + // Special gib model, frame and movement pattern + self.gib1mdl = MODEL_PROJ_BLORD1S; + self.gib1frame = 9; + // Throw gib quantity based on skill level + ThrowGib(11, rint(0.5 + random()*3) ); + // Restore origin for rest of rocket impact + self.origin = self.oldorigin; + } + else if (self.classtype == CT_PROJ_ARMY) self.pos1 = DAMAGE_RLARMY; + else if (self.classtype == CT_PROJ_DGUARDQ) self.pos1 = DAMAGE_RLDGUARDQ; + else if (self.classtype == CT_PROJ_DROLE) self.pos1 = DAMAGE_RLDROLE; + else if (self.classtype == CT_PROJ_FURY1) self.pos1 = DAMAGE_RLFURY; + else if (self.classtype == CT_PROJ_GARG) self.pos1 = DAMAGE_RLGARG; + else if (self.classtype == CT_PROJ_JIM2) self.pos1 = DAMAGE_RLJIM2; + else if (self.classtype == CT_PROJ_SKULLW) self.pos1 = DAMAGE_RLSKULLW; + else if (self.classtype == CT_PROJ_SEEKER) self.pos1 = DAMAGE_RLSEEKER; + else if (self.classtype == CT_PROJ_RAINDEER) self.pos1 = DAMAGE_RLRAINDEER; + + // Instant death explosion for zombies from rocket explosions! + // Is doesn't make sense that this is not a default for explosives + // This will affect _zombie, _zombiek, _mummy monster types + // The damage is direct, no splashdamage just in case anything close by + if (other.classgroup == CG_ZOMBIE) self.pos1 = DAMAGE_RLKILLZOM; + + // pre-calculate rocket damage + self.dmg = self.pos1_x + (random() * self.pos1_y); + // Check for any rocket ammo resistance + if (other.resist_rockets > 0) { + self.dmg = Resist_Damage(other, IT_ROCKETS, self.dmg); + } + + // Only call T_ functions if there is damage to do! + if (self.dmg > 0 && other.health > 0) + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + if (self.pos1_z > 0) + T_RadiusDamage (self, self.owner, self.pos1_z, other, DAMAGEALL); + } + + // Rocket resistance is shown with puffs of smoke + if (other.resist_rockets > 0) Resist_Rockets(other, self.origin); + else { + //---------------------------------------------------------------------- + // Check for poison debuff (using poisonous flag) + if (self.poisonous == TRUE) { + // Use new poison explosion + self.height = EXPLODE_POISON_MED; + // Poisonous projectiles + PoisonDeBuff(other); + } + + // Move the explosion effect higher up from point of contact + self.origin = self.origin - 8*normalize(self.velocity); + + // Default ID particle explosion for fire explosions + if (self.height < EXPLODE_PLASMA_SMALL) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + // Play original explosion sound or replacement + if (self.noise == "") self.noise = SOUND_REXP3; + SpawnExplosion(self.height, self.origin, self.noise); + } + } + + // Hide + Delete rocket, no longer needed + entity_remove(self, 1); +}; + +//---------------------------------------------------------------------- +// Re-direct any map hacks to the new function replacement +void() T_MissileTouch = { Touch_Missile(); }; + +//---------------------------------------------------------------------- +void(vector org, vector dir, vector avel, float proj_type, float proj_speed) Launch_Missile = +{ + // Check if there is space to spawn entity + if (entity_pcontent(org)) return; + + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_rocket"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJROCKETS; // Ammo type + + // Player rockets need to take into account autoaim + if (self.classtype == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + } + else { + // default monster missile width is thin! + newmis.movetype = MOVETYPE_FLY; + // Horrible exception for the missile touch function + // Gargoyle rockets need to pass through other gargoyles + // otherwise a pack of them would kill each other! + if (self.classtype == CT_MONGARGOYLE) newmis.oldenemy = self; + } + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Missile; + newmis.nextthink = time + LIFE_ROCKET; + newmis.think = SUB_Remove; + newmis.height = EXPLODE_SMALL; + newmis.poisonous = newmis.owner.poisonous; + + // Setup model for each missile type + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_ROCKET) setmodel(newmis, MODEL_PROJ_ROCKET); + // Monsters with poisonous flag awareness + else if (proj_type == CT_PROJ_GARG) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_GARGOYLEGRN); + else setmodel(newmis, MODEL_PROJ_GARGOYLE); + } + else if (proj_type == CT_PROJ_FURY1) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_SHALGRN); + else setmodel(newmis, MODEL_PROJ_FURY1); + } + else if (proj_type == CT_PROJ_CHTHON) { + if (self.spawnflags & MON_CHTHON_GREEN) setmodel (newmis, MODEL_PROJ_SLIME); + else setmodel (newmis, MODEL_PROJ_LAVA); + } + else if (proj_type == CT_PROJ_ARMY) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_ROCKETGRN); + else setmodel(newmis, MODEL_PROJ_ROCKET); + newmis.noise = "soldier/rocket_hit.wav"; + newmis.nextthink = time + 0.1; + newmis.think = self.th_updmissile; + // If can see enemy, steer the rocket towards them + if (visible(self.enemy)) newmis.enemy = self.enemy; + } + else if (proj_type == CT_PROJ_DGUARDQ) { + setmodel (newmis, MODEL_PROJ_DGUARDQ); + newmis.noise = "dguard/hit.wav"; + } + else if (proj_type == CT_PROJ_DROLE) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_DROLEGRN); + else setmodel (newmis, MODEL_PROJ_DROLE); + newmis.noise = "drole/r_explode.wav"; + newmis.nextthink = time + 0.025; + newmis.think = self.th_updmissile; + } + else if (proj_type == CT_PROJ_SKULLW) { + // Start with SUB_Null because its tested by impact function + newmis.th_updmissile = SUB_Null; + if (newmis.poisonous) { + setmodel (newmis, MODEL_PROJ_SWSKULLP); + // Copy over poison explosive function just incase + // Skull wizard dies before projectile hits something + newmis.th_updmissile = self.th_updmissile; + } + // Classic skullwizard flaming skull projectile! + else setmodel(newmis, MODEL_PROJ_SWSKULL); + } + + // All robot and boss monsters block poisonous flag + else if (proj_type == CT_PROJ_JIM2) { + setmodel(newmis, MODEL_PROJ_ROCKET); + newmis.noise = "jim/rocket_hit.wav"; + } + else if (proj_type == CT_PROJ_SEEKER) { + setmodel(newmis, MODEL_PROJ_ROCKET); + newmis.noise = "seeker/rocket_hit.wav"; + } + else if (proj_type == CT_PROJ_RAINDEER) { + setmodel(newmis, MODEL_PROJ_RAIND); + newmis.noise = "xmas/raindeer/hit.wav"; + } + else if (proj_type == CT_PROJ_LAVA) setmodel (newmis, MODEL_PROJ_LAVA); + else if (proj_type == CT_PROJ_FIRETOP) setmodel (newmis, MODEL_PROJ_LAVA); + else if (proj_type == CT_PROJ_EIDO1) { + setmodel(newmis, MODEL_PROJ_EIDO1); + newmis.frame = 7; + if (random() < 0.5) newmis.noise = "eidolon/rock_hit1.wav"; + else newmis.noise = "eidolon/rock_hit2.wav"; + if (random() < 0.5) newmis.height = EXPLODE_MED; + } + else if (proj_type == CT_PROJ_ICEG1) { + setmodel (newmis, MODEL_PROJ_GSHARD); + newmis.noise = "golem/iceshard_impact.wav"; + newmis.height = EXPLODE_ICE_BIG; + newmis.nextthink = time + 0.1; + newmis.think = self.th_updmissile; + newmis.pos1 = self.enemy.origin; + newmis.attack_timer = 0; + } + else if (proj_type == CT_PROJ_BLORD) { + // If the boglord dies before the impact of the 'rocket' + // then the self.owner field will be invalid. + // Setup the 'correct' projectile type beforehand instead! + if (self.spawnflags & MON_BOGL_STRONG) { + newmis.classtype = CT_PROJ_BLORD2; + setmodel (newmis, MODEL_PROJ_BLORD2B); + } + else setmodel (newmis, MODEL_PROJ_BLORD1B); + newmis.frame = 7; // Large size + newmis.noise = "boglord/slime_explode.wav"; + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.velocity = dir * proj_speed; + newmis.avelocity = avel; + newmis.angles = vectoangles(newmis.velocity); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + GRENADES + * Half damage to shamblers (T_MissileTouch and T_RadiusDamage) + * checks for breakables that can be destroyed with explosives + * Grenade damage is based on dmg key (default = player) +======================================================================*/ +void() Explode_Grenade = +{ + // Block touch functions + if (self.state == STATE_DISABLED) return; + self.touch = SUB_Null; + self.state = STATE_DISABLED; + + // Customize damage based on projectile type + if (self.classtype == CT_PROJ_GLMON) self.dmg = DAMAGE_MONGRENADE; + else if (self.classtype == CT_PROJ_MEGG) self.dmg = 0; + else if (self.classtype == CT_PROJ_NOUR2) { + self.dmg = DAMAGE_MONGRENADE; + // Don't spawn gib models at impact (could be solid) + self.oldorigin = self.origin; + self.origin = self.origin - 8*normalize(self.velocity); + // Special gib model, frame and movement pattern + self.gib1mdl = MODEL_PROJ_NOUR2S; + self.gib1sound = GIB_IMPACT_ACID; + self.max_health = MON_GIBFOUNTAIN; + self.gib1frame = 9; + self.gibtype = GIBTYPE_POISON; + // Setup particles from gib on floor + self.gibpartstyle = PARTICLE_BURST_YELLOW; + // Setup damage and impact explosion + self.gib1dmg = rint( 2 + (random() * skill) ); + self.gib1exp = EXPLODE_BURST_POISON; + // Throw gib quantity based on skill level + ThrowGib(11, rint( 1 + random() * (1 + skill) )); + // Restore origin for rest of grenade impact + self.origin = self.oldorigin; + self.noise = "nour/explode2.wav"; + } + // Default player grenade + else if (!self.dmg) self.dmg = DAMAGE_PLAYGRENADE; + + // Rocket resistance is reduced in RadiusDamage + if (self.dmg > 0) T_RadiusDamage (self, self.owner, self.dmg, world, DAMAGEALL); + + // Show Rocket resistance with puffs of smoke + if (other.resist_rockets > 0) Resist_Rockets(other, self.origin); + else { + //---------------------------------------------------------------------- + // Check for poison debuff (using poisonous flag) + if (self.poisonous == TRUE) { + // Use new poison explosion + self.height = EXPLODE_POISON_MED; + // Poisonous projectiles + PoisonDeBuff(other); + } + + // Default ID particle explosion for fire explosions + if (self.height < EXPLODE_PLASMA_SMALL) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + // Play original explosion sound + SpawnExplosion(self.height, self.origin, SOUND_REXP3); + + } + // Hide grenade, no longer needed + entity_remove(self, 1); +}; + +//---------------------------------------------------------------------- +void() Touch_Grenade = +{ + if (entity_pcontent(self.origin)) {remove(self); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + // Let minion eggs re-bounce in opposite direction + // Don't want them to explode like grenades + if (self.classtype == CT_PROJ_MEGG && other.takedamage == DAMAGE_AIM) { + if (CheckZeroVector(self.velocity) == FALSE) { + self.angles = vectoangles(self.mangle); + self.angles_y = anglemod(self.angles_y + 180); + self.velocity = -self.mangle; // Reverse direction + self.mangle = self.velocity; // Update new direction + sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + // Reset egg timer if still bouncing a lot + if ( vlen(self.velocity) > 100 ) self.nextthink = time + LIFE_EGG; + } + } + else { + //---------------------------------------------------------------------- + // Hit something that bleeds? (allows for grenade impact) + if (other.takedamage == DAMAGE_AIM) {Explode_Grenade(); return;} + else { + //---------------------------------------------------------------------- + // Check for breakables that can be triggered + // Any monster firing a grenade at a breakable will explode without bounce + if (ai_foundbreakable(self.owner, other, TRUE) && (self.owner.flags & FL_MONSTER)) { + // Found a breakable which is prone to explosive damage + trigger_ent(other, self.owner); + Explode_Grenade(); + return; + } + + // bounce sound and stop spinning + sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + if (CheckZeroVector(self.velocity)) self.avelocity = '0 0 0'; + } + } +}; + +//---------------------------------------------------------------------- +// Re-direct any map hacks to the new function replacement +void() OgreGrenadeExplode = { self.classtype = CT_PROJ_GLMON; Explode_Grenade(); }; +void() GrenadeExplode = { self.classtype = CT_PROJ_GLMON; Explode_Grenade(); }; +void() GrenadeTouch = { self.classtype = CT_PROJ_GLMON; Touch_Grenade(); }; + +// Compile forward functions for Launch_Grenade +void() Touch_ShellCasing; + +//---------------------------------------------------------------------- +void(vector org, vector dir, vector avel, float proj_type) Launch_Grenade = +{ + // Check if there is space to spawn entity + if (entity_pcontent(org)) return; + + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_grenade"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJROCKETS; // Ammo type + newmis.movetype = MOVETYPE_BOUNCE; + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Grenade; + newmis.nextthink = time + LIFE_GRENADE; + newmis.think = Explode_Grenade; + newmis.noise = "weapons/bounce.wav"; + newmis.bbmins = newmis.bbmaxs = VEC_ORIGIN; + newmis.height = EXPLODE_SMALL; + newmis.poisonous = newmis.owner.poisonous; + + // Setup model for each missile type + //---------------------------------------------------------------------- + // proj_gl is used by the player (separate so easier to change) + if (proj_type == CT_PROJ_GL) setmodel(newmis, MODEL_PROJ_GRENADE); + // proj_glmon is used by any monster firing grenades + else if (proj_type == CT_PROJ_GLMON) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_GRENADEGRN); + else setmodel(newmis, MODEL_PROJ_GRENADE); + } + else if (proj_type == CT_PROJ_FLESH) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_FLESHP); + else setmodel (newmis, MODEL_PROJ_FLESH); + } + else if (proj_type == CT_PROJ_MEGG) { + if (self.classtype == CT_MONWRAITH) { + setmodel( newmis, MODEL_PROJ_WEGG); + newmis.noise = "wraith/bounce.wav"; + } + else if (self.classtype == CT_MONSHAL) { + setmodel( newmis, MODEL_PROJ_SEGG); + newmis.noise = "shalrath/bounce.wav"; + } + newmis.classgroup = CG_MINIONEGG; // Proper group type + newmis.enemy = SUB_entEnemyTarget(); // Make sure got right enemy + newmis.bbmins = VEC_HULLE_MIN; // Small egg size + newmis.bbmaxs = VEC_HULLE_MAX; + newmis.frame = self.attachment.frame; // Current ball size (frame) + newmis.think = Hatch_Egg; // Eventually hatch + newmis.nextthink = time + LIFE_EGG; // Short timer + } + else if (proj_type == CT_PROJ_SPID) { + setmodel (newmis, MODEL_PROJ_SPID); + newmis.frame = rint((random() * 9)); + } + else if (proj_type == CT_PROJ_ELF) { + setmodel (newmis, MODEL_PROJ_ELF); + newmis.frame = rint((random() * 9)); + } + else if (proj_type == CT_PROJ_SWAMP) { + setmodel (newmis, MODEL_PROJ_SWAMP); + newmis.frame = rint((random() * 9)); + } + else if (proj_type == CT_PROJ_VORE) { + setmodel (newmis, MODEL_PROJ_VORE); + newmis.frame = rint((4 + random() * 4)); + } + else if (proj_type == CT_PROJ_NOUR2) { + setmodel (newmis, MODEL_PROJ_NOUR2B); + newmis.skin = self.skin; + newmis.frame = 7; // Large size + newmis.noise = "nour/bounce.wav"; + } + else if (proj_type == CT_PROJ_CHTHON2) { + setmodel (newmis, MODEL_PROJ_CHTHON1); + newmis.skin = self.skin; + newmis.frame = rint((random() * 9)); + newmis.noise = "chthon/bounce.wav"; + newmis.dmg = self.pos3_z; + } + else if (proj_type == CT_PROJ_SHUB2) { + setmodel (newmis, MODEL_PROJ_SHUB2); + newmis.frame = rint((random() * 9)); + newmis.noise = "shub/bounce.wav"; + newmis.dmg = self.pos3_z; + } + else if (proj_type == CT_PROJ_SHELLC) { + setmodel(newmis, MODEL_PROJ_SHELLC); + newmis.touch = Touch_ShellCasing; + newmis.think = model_fade; + newmis.nextthink = time + random() + LIFE_SHELLS; + newmis.ltime = newmis.nextthink; + } + + // These projectile fly like grenades but are really spikes! + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_SPID || proj_type == CT_PROJ_VORE || + proj_type == CT_PROJ_SWAMP || proj_type == CT_PROJ_ELF || + proj_type == CT_PROJ_FLESH) { + newmis.touch = Touch_Projectile; + newmis.nextthink = time + LIFE_PROJECTILE; + newmis.think = SUB_Remove; + newmis.bodyfadeaway = TRUE; + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.mangle = dir; // Save for later + newmis.velocity = newmis.mangle; + newmis.avelocity = avel; + newmis.angles = vectoangles(newmis.velocity); + setsize (newmis, newmis.bbmins, newmis.bbmaxs); + setorigin (newmis, org); +}; + +//====================================================================== +// Generic functions for firing grenades from monsters +// MonsterGrenadeSound = play generic load grenade sound +// MonsterGrenadeSpeed = return generic attack speed +// MonsterFireGrenade = fire grenade at enemy origin +// +//---------------------------------------------------------------------- +void() MonsterGrenadeSound = +{ sound (self, CHAN_WEAPON, "weapons/gl_loadshort.wav", 0.1+random()*0.5, ATTN_LOW); }; +float() MonsterGrenadeSpeed = +{ return SPEED_MONGRENADE + (skill * SPEED_MONGLSKILL); }; + +//---------------------------------------------------------------------- +void(vector grenade_org, vector grenade_enemyorg) MonsterFireGrenade = +{ + local vector ang, dir, avel; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + + // Is Z aware disabled? + if ( query_configflag(SVR_ZAWARE) || self.no_zaware ) { + makevectors (self.angles); + dir = normalize(grenade_enemyorg - grenade_org); + // Default grenade speed (player = 600) + dir = dir * SPEED_PLAYGRENADE; + dir_z = ELEV_ZAXIS; + } + else { + // Z Aware tracking is ENABLED (AI track player much better) + // One final angle adjustment (based on actual projectile origin) + self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(self.attack_elev, grenade_org, grenade_enemyorg, self.attack_speed); + ang = vectoangles(grenade_enemyorg - grenade_org); + ang_x = -self.attack_elev; + makevectors (ang); + dir = v_forward * self.attack_speed; + } + + avel = vecrand(100,200,FALSE); + Launch_Grenade(grenade_org, dir, avel, CT_PROJ_GLMON); +}; + +/*====================================================================== + Ejecting Shell Casing for SG/SSG/Upgrade +======================================================================*/ +void() Touch_ShellCasing = +{ + if (self.touchedvoid) return; // Marked for removal + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + self.touch = SUB_Null; + if (random() < 0.5) + sound(self, CHAN_VOICE, "weapons/shellc.wav", random()*0.25, ATTN_LOW); +}; + +//---------------------------------------------------------------------- +void(float shell_qty) Launch_ShellCasing = +{ + local vector org, dir, avel; + + if ( self.health < 1 ) return; + if (query_configflag(SVR_SHOTGCASE)) return; + + if (self.flags & FL_CLIENT) makevectors (self.v_angle); + else makevectors (self.angles); + org = self.origin + v_up*10; + + while (shell_qty > 0) { + dir = -v_right*75 + v_forward*(random()*50) + v_up*(100 + random()*100); + avel = vecrand(0,300,TRUE); + Launch_Grenade(org, dir, avel, CT_PROJ_SHELLC); + shell_qty = shell_qty - 1; + } +}; diff --git a/QC_other/QC_arcane/pushable.qc b/QC_other/QC_arcane/pushable.qc new file mode 100644 index 00000000..753610bc --- /dev/null +++ b/QC_other/QC_arcane/pushable.qc @@ -0,0 +1,575 @@ +/*====================================================================== + Pushables bmodels + + * Looked at the code from Hipnotic Interactive (hip_push.qc) + - It uses a proxy entity for the player to interact with + - Movement is done by constantly updating origin + - Code seems really experimental and a horrible mess + + * Looked at the code from the Nehara mod (push.qc) + - It uses the original bmodel entity with velocity instead + - Has one push sound type and moves XY directions + + * AD solution is inspired by Nehara code + - It uses the original bmodel and velocity movement + - Switches movetype/solid so players can stand on top + - Fades the bmodel (via alpha) so it does not block view + - Works with entity state system, reset very useful if stuck + - Works really close with breakables (target2 triggers) + +======================================================================*/ +float PUSH_DAMAGE = 2; // Can receive damage (from anything) +float PUSH_NOFLRCHECK = 8; // No floor below check for movement +float PUSH_FLOATING = 16; // Start floating on spawn (like items) +float PUSH_NOMONSTER = 32; // Cannot be damaged by monsters + +// Pushable sound/impact types +float PTYPE_ROCK = 1; // Default rock +float PTYPE_WOOD = 2; +float PTYPE_GLASS = 3; +float PTYPE_METAL = 4; +float PTYPE_BRICK = 5; +float PTYPE_CUSTOM = 10; // Custom push sounds + +// Three sounds to randomly pick from 0.5s each +string SOUND_PUSH_ROCK1 = "pushable/rock_m1.wav"; +string SOUND_PUSH_ROCK2 = "pushable/rock_m2.wav"; +string SOUND_PUSH_ROCK3 = "pushable/rock_m3.wav"; +string SOUND_PUSH_WOOD1 = "pushable/wood_m1.wav"; +string SOUND_PUSH_WOOD2 = "pushable/wood_m2.wav"; +string SOUND_PUSH_WOOD3 = "pushable/wood_m3.wav"; +string SOUND_PUSH_GLASS1 = "pushable/glass_m1.wav"; +string SOUND_PUSH_GLASS2 = "pushable/glass_m2.wav"; +string SOUND_PUSH_GLASS3 = "pushable/glass_m3.wav"; +string SOUND_PUSH_METAL1 = "pushable/metal_m1.wav"; +string SOUND_PUSH_METAL2 = "pushable/metal_m2.wav"; +string SOUND_PUSH_METAL3 = "pushable/metal_m3.wav"; +string SOUND_PUSH_BRICK1 = "pushable/brick_m1.wav"; +string SOUND_PUSH_BRICK2 = "pushable/brick_m2.wav"; +string SOUND_PUSH_BRICK3 = "pushable/brick_m3.wav"; + +// Which touch state (used for fading) +float STATE_PUSH = 1; +float STATE_SOLID = 2; + +//====================================================================== +/*QUAKED func_pushable (0 .5 .8) ? x DAMAGE x NOFLRCHECK FLOATING NOMONSTER STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Moveable brushwork (pushable) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +style : sound move/impact types - 1=rock, 2=wood, 3=glass, 4=metal, 5=brick, 10=custom +noise1 : Custom move sound 1 (style=10) +noise2 : Custom move sound 2 +noise3 : Custom move sound 3 +bleedcolour: Impact particle colour (starting point on palette) +target : target(s) to fire when pushable is dead (once only) +deathtarget: target(s) to fire when pushable is dead (once only) +target2 : points to a func_breakable_spawner to trigger on death +message : Message to display when killed by player +message2 : Message to display when touched by player +wait : Time for showing touch/death message (=-1 once, def=2) +health : damage taken before death +death_dmg : will explode on death (reqs health) +speed : pushing speed (def = 1) +waitmin : length of pushable sounds (def=0.5s) +waitmin2 : Alpha value to fade block down to when pushing +-------- SPAWNFLAGS -------- +DAMAGE : Pushable can be damaged or destroyed +NOFLRCHECK: No floor below check for extra velocity +FLOATING : Pushable starts off floating (until touched) +NOMONSTER : Cannot be damaged by monsters +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Moveable brushwork (pushable) +*/ +//====================================================================== + +//---------------------------------------------------------------------- +void() func_pushable_push = +{ + self.movetype = MOVETYPE_STEP; // Default monster move type + self.solid = SOLID_SLIDEBOX; // Discrete movement stepping + self.state = STATE_PUSH; // Can be moved by player +}; + +//---------------------------------------------------------------------- +void() func_pushable_solid = +{ + self.movetype = MOVETYPE_PUSH; // Blocks projectiles + self.solid = SOLID_BSP; // Square bounding box + self.state = STATE_SOLID; // No world interaction + self.inpain = FALSE; // Reset touch flag +}; + +//---------------------------------------------------------------------- +void() func_pushable_movement = +{ + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Block movement if nothing has changed + if (self.oldorigin == self.origin && !self.inpain) return; + self.oldorigin = self.origin; + // Reset touch function flag + self.inpain = FALSE; + + // Check for moving sound + if (self.attack_finished < time && self.state == STATE_PUSH) { + // Random start to setup blending and overlap + self.attack_finished = time + self.waitmin + (random()*self.waitmin); + // Make sure sound WAVs don't repeat in a row + self.lefty = self.meleeattack; + while (self.lefty == self.meleeattack) { + self.lefty = rint(random()*3); + } + // CHAN_AUTO to allow for sound blending + self.meleeattack = self.lefty; + if (self.meleeattack == 1) + sound (self, CHAN_AUTO, self.noise1, 1, ATTN_NORM); + else if (self.meleeattack == 2) + sound (self, CHAN_AUTO, self.noise2, 1, ATTN_NORM); + else sound (self, CHAN_AUTO, self.noise3, 1, ATTN_NORM); + } + + // Remove onground flag so bmodel can move + self.flags = self.flags - (self.flags & FL_ONGROUND); + + // Transfer velocity from player to pushable + // Read velocity from saved touch entity + self.velocity_x = self.finaldest_x * self.speed; + self.velocity_y = self.finaldest_y * self.speed; + + // Enable floor below check? + if (!(self.spawnflags & PUSH_NOFLRCHECK)) { + // Work out push direction + makevectors(self.finalangle); + self.movedir = normalize(v_forward); + self.movedir_z = 0; + + // Work out true min/max for bmodel using origin (offset) + self.bbmins = self.origin + self.mins; + self.bbmaxs = self.origin + self.maxs; + + // Find the middle of the bottom edge + self.move_state = self.bbmins; + self.move_state_x = self.move_state_x + (self.size_x*0.5); + self.move_state_y = self.move_state_y + (self.size_y*0.5); + + // Trace down and see if anything is underneath it + traceline(self.move_state, self.move_state+'0 0 -1024', FALSE, self); + // Work out length of traceline downward + self.t_length = fabs(trace_endpos_z - self.move_state_z); + + // Is there space below middle point? + if (self.t_length > 0) { + // Keep velocity active while ground is missing + self.velocity = self.velocity + (self.movedir*self.t_width); + // Keep looping around until on ground + self.think = func_pushable_movement; + self.nextthink = time + 0.05; + } + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_touch = +{ + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Allow for pushables to stack + if (other.classtype == CT_FUNCPUSHABLE && other.state == STATE_PUSH) { + // Switch to solid block + func_pushable_solid(); + return; + } + + // Only works for the player + if ( !(other.flags & FL_CLIENT) ) return; + + // Touch function is active + self.inpain = TRUE; + + // Keep updating touch condition for fade controller + // Create an overlap for the touch to stop working + self.pain_finished = time + 0.5; + + // Check for a touch message + if (self.message2 != "" && self.idletimer < time) { + if (self.wait > 0) self.idletimer = time + self.wait; + centerprint(other, self.message2); + if (self.wait < 0) self.message2 = ""; + } + + // Slow down the detection of the touching object + // + // This is not an ideal solution, its a horrible hack! + // The touching entity should be consistent with its Z axis + // origin if the entity is not moving up or down. + // For some reason the Z axis is inconsistent +/- 18 units + // Cannot slowdown the touch function because the movement + // of the pushable stutters and looks terrible. + // Touch functions cycle at really high frame rates so + // its easier to slowdown the reading the entity instead! + // + if (self.oldenemy != other || self.meleetimer < time) { + // Save player details for later + self.oldenemy = other; + self.dest1 = self.oldenemy.origin; + self.dest2 = self.oldenemy.view_ofs; + // Slowdown the reading of the touching entity + self.meleetimer = time + 0.01; + } + + self.finalangle = self.oldenemy.angles; + self.finaldest = self.oldenemy.velocity; + + // Setup origin of player (at feet level) + self.pos3 = self.dest1 - self.dest2; + + // Work out true min/max for bmodel using origin (offset) + self.bbmins = self.origin + self.mins; + self.bbmaxs = self.origin + self.maxs; + + // Check if player is above/below pushable + if (self.pos3_z >= self.bbmaxs_z) + func_pushable_solid(); // Stop the bmodel interacting with player + else { + func_pushable_push(); // bmodel can be moved (again) + func_pushable_movement(); // Move the pushable block + } +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) func_pushable_pain = +{ + local float loop_count; + local vector vel; + + // default = Pushables cannot die + if (!(self.spawnflags & PUSH_DAMAGE)) {self.health = MEGADEATH; return;} + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Something is trying to wear down the pushable with damage + // work out facing angle and project particles upward + makevectors(inflictor.angles); + vel = -v_up*2; + while(loop_count < 4) { + particle (inflictor.origin, vel*0.1, self.bleedcolour + rint(random()*7), damage); + loop_count = loop_count + 1; + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_death = +{ + // default = Pushables cannot die + if (!(self.spawnflags & PUSH_DAMAGE)) {self.health = MEGADEATH; return;} + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Work out current bmodel origin + self.oldorigin = bmodel_origin(self); + + // Check for breakable spawners + if (self.target2 != "") { + self.enemy = find (world, targetname, self.target2); + // Make sure its a breakable spawner ONLY! + if (self.enemy.classtype == CT_FUNCBREAKSPN) { + // Copy over pushable bmodel origin and volume to breakable + self.enemy.origin = self.oldorigin; + setorigin(self.enemy, self.enemy.origin); + self.enemy.brkvol = self.size; + // Use entity which killed pushable for breakable direction + trigger_ent(self.enemy, self.activate); + } + } + + // Check for explosion sprite/particle effect + if (self.death_dmg > 0) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.oldorigin_x); + WriteCoord (MSG_BROADCAST, self.oldorigin_y); + WriteCoord (MSG_BROADCAST, self.oldorigin_z); + + SpawnExplosion(EXPLODE_SMALL, self.oldorigin, SOUND_REXP3); + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + } + + // Fire death targets (check DT first, because target can have uses) + if (self.deathtarget != "") trigger_strs(self.deathtarget, self.activate); + if (self.target != "") trigger_strs(self.target, self.activate); + + // Any final words ... + if (self.activate.flags & FL_CLIENT && self.message != "") + centerprint (self.activate, self.message); + + // Fire once condition? + if (self.wait < 0) { + self.target = self.deathtarget = self.message = ""; + } + + // Check for any pushable above? (fake physics) + self.move_state = bmodel_origin(self); + + // Trace up and see if anything is above + traceline(self.move_state, self.move_state + '0 0 1024', FALSE, self); + + // Check for a pushable entity above (but not touching) + if (trace_ent != self && trace_ent.classtype == CT_FUNCPUSHABLE) + trigger_ent(trace_ent, self); + + // Switch off entity instead of hide/remove + // So the pushable can be reset again + self.estate_off(); +}; + +//====================================================================== +// The pushable needs a controller to reach to the touch function +// and to reset the alpha fade if the pushable is not being touched +//====================================================================== +void() pushable_controller_think = +{ + // Keep the controller alive + self.think = pushable_controller_think; + self.nextthink = time + 0.1; + + // Block entity state exceptions + if (self.owner.estate & ESTATE_BLOCK) return; + + // Check if the player is touching the pushable? + // If the player is standing on the block, no alpha + if (self.owner.pain_finished > time && self.owner.state == STATE_PUSH) { + // Is the alpha set the right amount? + if (self.owner.alpha > self.owner.waitmin2) { + self.owner.alpha = self.owner.alpha - 0.01; + self.nextthink = time + FADEMODEL_TIME; + } + } + else { + if (self.owner.alpha < 1.00) { + self.owner.alpha = self.owner.alpha + 0.01; + self.nextthink = time + FADEMODEL_TIME; + } + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_controller_setup = +{ + // Check if controller entity been setup + if (!self.attachment) self.attachment = spawn(); + + // Setup link back to pushable + self.attachment.owner = self; + self.attachment.classtype = CT_CONTROL; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + // Move to pushable bmodel origin location + self.attachment.origin = bmodel_origin(self); + setorigin(self.attachment, self.attachment.origin); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Start fade controller think loop + self.attachment.think = pushable_controller_think; + self.attachment.nextthink = time + 0.1; +}; + +//====================================================================== +// Entity state functions +//====================================================================== +void() func_pushable_use = +{ + // Switch on pushable first + if (self.estate == ESTATE_OFF) entity_state_on(); + else { + // Let the pushable move around + func_pushable_push(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + // Push upward using size as force + self.velocity_z = self.t_width; + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_reset = +{ + // If the block starts off(disabled) then do nothing + if (self.spawnflags & ENT_STARTOFF) return; + + // reset to original position + setorigin(self, VEC_ORIGIN); + // Make sure the bmodel drops down, no weird ofset + self.velocity = self.avelocity = '0 0 0'; + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() func_pushable_off = +{ + // Do nothing if pushable is already off + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + // Switch off impact particles + self.takedamage = DAMAGE_NO; +}; + +//---------------------------------------------------------------------- +void() func_pushable_on = +{ + // Do nothing if pushable is already on + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + func_pushable_push(); + setmodel (self, self.mdl); + + // Setup touch fade controller + if (!self.attachment) func_pushable_controller_setup(); + + // Switch on impact particles + self.takedamage = DAMAGE_AIM; + // Reset health to spawn + self.health = self.max_health; + + if (!(self.spawnflags & PUSH_FLOATING)) { + // Make sure it drops to ground on spawn + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + } + else func_pushable_solid(); +}; + +//====================================================================== +// Main entity definition +//====================================================================== +void() func_pushable = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + //------------------------------------------------------------------ + // make sure initial break sound is within range types (def=rock) + if (self.style < PTYPE_ROCK || self.style > PTYPE_CUSTOM) + self.style = PTYPE_ROCK; + + // Medium drag sound with light brown impact particles + if (self.style == PTYPE_WOOD) { + self.noise1 = SOUND_PUSH_WOOD1; + self.noise2 = SOUND_PUSH_WOOD2; + self.noise3 = SOUND_PUSH_WOOD3; + if (self.bleedcolour <= 0) self.bleedcolour = 112; + } + // Light drag sound with light yellow impact particles + else if (self.style == PTYPE_GLASS) { + self.noise1 = SOUND_PUSH_GLASS1; + self.noise2 = SOUND_PUSH_GLASS2; + self.noise3 = SOUND_PUSH_GLASS3; + if (self.bleedcolour <= 0) self.bleedcolour = 96; + } + // Medium drag sound with green/brown impact particles + else if (self.style == PTYPE_METAL) { + self.noise1 = SOUND_PUSH_METAL1; + self.noise2 = SOUND_PUSH_METAL2; + self.noise3 = SOUND_PUSH_METAL3; + if (self.bleedcolour <= 0) self.bleedcolour = 80; + } + // Light drag sound with brown impact particles + else if (self.style == PTYPE_BRICK) { + self.noise1 = SOUND_PUSH_BRICK1; + self.noise2 = SOUND_PUSH_BRICK2; + self.noise3 = SOUND_PUSH_BRICK3; + if (self.bleedcolour <= 0) self.bleedcolour = 80; + } + // Custom sounds with white/grey impact particles + else if (self.style == PTYPE_CUSTOM) { + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + if (self.bleedcolour <= 0) self.bleedcolour = 1; + } + // *** DEFAULT *** + // Heavy drag sound with brown impact particles + else { + self.noise1 = SOUND_PUSH_ROCK1; + self.noise2 = SOUND_PUSH_ROCK2; + self.noise3 = SOUND_PUSH_ROCK3; + if (self.bleedcolour <= 0) self.bleedcolour = 80; + } + + // Cache all sounds + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + self.classtype = CT_FUNCPUSHABLE; + self.classgroup = CG_BREAKABLE; + self.bsporigin = TRUE; + self.mdl = self.model; + + // Save starting position and reset angles + self.mangle = self.angles; + self.angles = '0 0 0'; + + // Default parameters and states + if (!self.speed) self.speed = 1; + if (!self.wait) self.wait = 2; + + // Length of dragging sounds + if (!self.waitmin) self.waitmin = 0.5; + // Create halway point for random start + self.waitmin = self.waitmin * 0.5; + // Start with pushing state + self.state = STATE_PUSH; + self.pain_finished = -1; + // Setup default alpha fade (lower) value + if (!self.waitmin2) self.waitmin2 = 0.6; + self.alpha = 1; + + // setup pain/die functions + self.th_pain = func_pushable_pain; + self.th_die = func_pushable_death; + + // The pushable needs to take damage for impact sounds + // to work correctly. Check for health default first + // Pain/death needs to reset health if indestructible + if (self.health <= 0) { + if (self.spawnflags & PUSH_DAMAGE) self.health = 1; + else self.health = MEGADEATH; + } + self.max_health = self.health; + + // Setup the bmodel ready for interaction + func_pushable_solid(); + setmodel(self, self.mdl); + setorigin(self, VEC_ORIGIN); + setsize(self, self.mins, self.maxs); + + // Work out average size of block + self.t_width = rint((self.size_x + self.size_y) * 0.5); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + self.use = entity_state_use; + self.estate_use = func_pushable_use; + self.estate_on = func_pushable_on; + self.estate_off = func_pushable_off; + self.estate_reset = func_pushable_reset; + self.touch = func_pushable_touch; + + // Setup pushable in correct state + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; diff --git a/QC_other/QC_arcane/settings.qc b/QC_other/QC_arcane/settings.qc new file mode 100644 index 00000000..df9e198e --- /dev/null +++ b/QC_other/QC_arcane/settings.qc @@ -0,0 +1,1020 @@ +/*====================================================================== + MOD CUSTOM SETTINGS +======================================================================*/ +void() toggleautoaim; // Toggle auto aim +void() toggleprojsize; // Toggle player projectile size +void() togglezaware; // Toggle Z aware monsters +void() togglefootstep; // Toggle footstep sound (player/monster) +void() toggleliquiddmg; // Toggle Monster Liquid damage +void() toggleshotgunproj; // Toggle Shotgun Projectiles +void() toggleshotguncase; // Toggle Shotgun Casing +void() toggleupgradeaxe; // Toggle Axe Upgrade (inventory only) +void() toggleupgradessg; // Toggle Shotgun Upgrade (inventory only) +void() toggleupgradelg; // Toggle Lightning Upgrade (inventory only) +void() togglepixels; // Toggle Texture modes + +void() togglecoopartifacts; // Toggle COOP can drop artifacts +void() togglecoopammoboxes; // Toggle COOP ammo boxes to respawn +void() togglecoopweapons; // Toggle COOP weapons to respawn +void() togglecoophealth; // Toggle COOP health packs to respawn +void() togglecooppowerups; // Toggle COOP powerups to respawn + +void() toggleweather; // Toggle weather systems +void() toggledevhelpers; // Toggle dev helpers (mark/arrows) +void() togglebodyremoval; // Toggle monster body fade/removal + +void() display_configflag; // Display config flag +void() display_playinfo; // Display Player information +void() display_version; // Display MOD information +void() display_mapvar; // Display Map Variables +void() display_customkeys; // Display Custom Key inventory +void() CycleParticleDebug; // Cycle particle debug messages + +void(float sigil_bit) givesigil; // Testing only +void(float key_bit) givekey; // Testing only + +void() CycleWeaponCommand; +void() CycleWeaponReverseCommand; +void() CheatCommand; +void() SharpshooterCheat; +void() NailPiercerCheat; +void() EnvSuitCheat; +void() PentagramCheat; +void() InvisibleCheat; +void() QuadDamageCheat; +void() StartIntermissionCamera; + +/*====================================================================== + Show MOD name and version +======================================================================*/ +void() display_version = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + sprint(self,"\b[INFO]\b Arcane Dimensions v1.70 Patch 1\n"); +}; + +/*====================================================================== + Prints origin and mangle to console screen + Useful for creating good locations for intermission camera's + ** Been replaced with viewpos and setview console commands ** +======================================================================*/ +void() display_playinfo = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + sprint(self,"\b[INFO]\b Org ("); sprint(self,vtos(self.origin)); + sprint(self,") Ang ("); sprint(self,vtos(self.v_angle)); + sprint(self,")\n"); +}; + + +/*====================================================================== + Prints which custom keys the player has in their inventory +======================================================================*/ +void() display_customkeys = +{ + local string ckey_str1, ckey_str2, ckey_str3, ckey_str4; + local float ckey_count; + + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + self.impulse = 0; + + // Check for any custom keys in player inventory + if (self.moditems & IT_CKEYALL) { + // Always reset key count + ckey_count = 0; + + if (self.moditems & IT_CKEY1) { + ckey_str1 = self.ckeyname1; + ckey_count = ckey_count + 1; + } + if (self.moditems & IT_CKEY2) { + if (ckey_count == 1) ckey_str2 = self.ckeyname2; + else ckey_str1 = self.ckeyname2; + ckey_count = ckey_count + 1; + } + if (self.moditems & IT_CKEY3) { + if (ckey_count == 2) ckey_str3 = self.ckeyname3; + else if (ckey_count == 1) ckey_str2 = self.ckeyname3; + else ckey_str1 = self.ckeyname3; + ckey_count = ckey_count + 1; + } + if (self.moditems & IT_CKEY4) { + if (ckey_count == 3) ckey_str4 = self.ckeyname4; + else if (ckey_count == 2) ckey_str3 = self.ckeyname4; + else if (ckey_count == 1) ckey_str2 = self.ckeyname4; + else ckey_str1 = self.ckeyname4; + ckey_count = ckey_count + 1; + } + + // if 4 keys are present, then squash the last two key names together + // The maximum amount of strings that centerprint can handle is 7 + // A bit of shame, because only needed one more string! + if (ckey_count == 4) + centerprint7 (self, "-[ \bArcane Key Inventory\b ]-\nYou have the following\n\n", ckey_str1, "\n", ckey_str2, "\n", ckey_str3, ckey_str4); + else + // Space out title and keys (does not print key 4) + centerprint7 (self, "-[ \bArcane Key Inventory\b ]-\nYou have the following\n\n", ckey_str1, "\n", ckey_str2, "\n", ckey_str3, "\n"); + } + else + // Should always say the state of the inventory + centerprint(self, "-[ \bArcane Key Inventory\b ]-\n\nIs Empty!\n"); +}; + +/*====================================================================== + ImpulseCommands +======================================================================*/ +void() ImpulseCommands = +{ + if (self.impulse >= 1 && self.impulse <= 8) W_ChangeWeapon (self); + else if (self.impulse == 10) CycleWeaponCommand(); + else if (self.impulse == 12) CycleWeaponReverseCommand(); + + // Only these MOD options can be changed via the console + else if (self.impulse == 100) toggleautoaim(); // Toggle auto aim + else if (self.impulse == 105) toggleprojsize(); // Toggle player proj size + else if (self.impulse == 110) togglezaware(); // Toggle Z aware monsters + else if (self.impulse == 115) togglepixels(); // Toggle texture modes + else if (self.impulse == 120) togglefootstep(); // Toggle footstep sound + else if (self.impulse == 125) toggleliquiddmg(); // Toggle liquid damage + else if (self.impulse == 130) toggleshotgunproj(); // Toggle SG Projectile + else if (self.impulse == 135) toggleshotguncase(); // Toggle SG Casing + else if (self.impulse == 140) display_version(); // Display MOD config flag + else if (self.impulse == 142) display_playinfo(); // Display Player information + else if (self.impulse == 145) StartIntermissionCamera(); + + else if (self.impulse == 150) togglecoopartifacts();// Toggle COOP can drop artifacts + else if (self.impulse == 152) togglecoopweapons(); // Toggle COOP weapons to respawn + else if (self.impulse == 154) togglecoophealth(); // Toggle COOP health to respawn + else if (self.impulse == 156) togglecoopammoboxes();// Toggle COOP ammo boxes to respawn + else if (self.impulse == 158) togglecooppowerups(); // Toggle COOP powerups to respawn + + else if (self.impulse == 160) toggleweather(); // Toggle Weather Systems + else if (self.impulse == 170) togglebodyremoval(); // Toggle monster body fade/removal + else if (self.impulse == 175) display_customkeys(); // Display Custom Key inventory + + // Only works developer only) + else if (self.impulse == 200) toggleupgradeaxe(); // Toggle Axe Upgrade + else if (self.impulse == 205) toggleupgradessg(); // Toggle Shotgun Upgrade + else if (self.impulse == 210) toggleupgradelg(); // Toggle Lightning Upgrade + else if (self.impulse == 220) display_configflag(); // Display MOD config flag + else if (self.impulse == 225) display_mapvar(); // Display all map variables + else if (self.impulse == 230) toggledevhelpers(); // Toggle Dev Helpers (mark/arrow) + else if (self.impulse == 235) CycleParticleDebug(); // Cycle particle debug + + else if (self.impulse == 240) givesigil(SVR_RUNE_ALL); // Give all sigils to player + else if (self.impulse == 241) givesigil(SVR_RUNE_KEY1); // Give various sigil to player + else if (self.impulse == 242) givesigil(SVR_RUNE_KEY2); // Will be reset on map load + else if (self.impulse == 243) givesigil(SVR_RUNE_KEY3); // Mainly used for testing + else if (self.impulse == 244) givesigil(SVR_RUNE_KEY4); + + else if (self.impulse == 245) givekey(IT_KEY1 + IT_KEY2); // Both + + // Legacy cheat commands, should be developer 1 only ... + else if (self.impulse == 9) CheatCommand(); + else if (self.impulse == 250) SharpshooterCheat(); + else if (self.impulse == 251) NailPiercerCheat(); + else if (self.impulse == 252) EnvSuitCheat(); + else if (self.impulse == 253) PentagramCheat(); + else if (self.impulse == 254) InvisibleCheat(); + else if (self.impulse == 255) QuadDamageCheat(); + + self.impulse = 0; +}; + +/*====================================================================== + The MOD can be customizied from three different source: + quake.rc < worldspawn < impulse commands (top priority) + + The serverflags is the ONLY variable that is passed between MAP loads + and that variable is not available straightaway! Once the worldspawn + is loaded (first thing to happen) the serverflags is still empty + and the functions have to cope with it 'out of sync' until later. + + after worldspawn is loaded, the combination of the quake.rc (TEMP1) + is merged with the keys on worldspawn and all spawning functions + use the configflags until it can be sync'd with serverflags. + + The configflags is setup to be temporary so that any previous value + from a quickload does not interfere with it. + +======================================================================*/ +// Assume that serverflags not setup yet, merge worldspawn with configflag +// Once serverflags available, then sync everything together +void(float regbitflag, float worldvalue) update_worldspawn = +{ + // Is the bit value TRUE? + if (worldvalue > 0) configflag = configflag | regbitflag; + // Only take about a bit value from configflag if bit value is present + else if (worldvalue < 0) { + if (configflag & regbitflag) configflag = configflag - regbitflag; + } +}; + +//---------------------------------------------------------------------- +// The worldspawn key values always override the quake.rc values and +// should be merged with the console variable when loading a map +// serverflags is not available before spawn functions +void() sycn_worldspawn = +{ + update_worldspawn(SVR_ITEMOFFSET, self.no_item_offset); + update_worldspawn(SVR_UPDAXE, self.upgrade_axe); + update_worldspawn(SVR_UPDSSG, self.upgrade_ssg); + update_worldspawn(SVR_UPDLG, self.upgrade_lg); + update_worldspawn(SVR_ZAWARE, self.no_zaware); + update_worldspawn(SVR_LIQDAM, self.no_liquiddmg); +}; + +//---------------------------------------------------------------------- +// Reset the serverflag to console + worldspawn settings +// This only needs to be done when loading a new map or changelevel +// quickload cannot run this function it will damage inventory +void() sync_serverflags = +{ + local float checkflag; + + if (serverflags & SVR_LIVE) { + dprint("\b[SERVERFLAG]\b MAP LOAD reset/sync\n"); + // Take 1-8 runes, 9-16 worldspawn merge, 17-23 mod/console options + checkflag = (serverflags & SVR_RUNEFLAG) + (temp1flag & SVR_WORLDFLAG) + (configflag & SVR_HIGHFLAG); + // Update the serverflags ready for future updates + serverflags = configflag = checkflag; + } +}; + +//---------------------------------------------------------------------- +// Update configflag and if the serverflags is active, update that as well! +void(float regbitflag, float regbitvalue) update_configflag = +{ + // Is the bit value TRUE? + if (regbitvalue == TRUE) { + configflag = configflag | regbitflag; + if (serverflags & SVR_LIVE) serverflags = serverflags | regbitflag; + } + // If the bit value FALSE + else { + configflag = configflag - (configflag & regbitflag); + if (serverflags & SVR_LIVE) { + serverflags = serverflags - (serverflags & regbitflag); + } + } + + // Only the top 8 bits of TEMP1 flag can be updated + // Some options should not be changed easily, causes problems + if (regbitflag & SVR_HIGHFLAG) { + // Re-fresh the console variable + dprint("\b[TEMP1]\b Changing ("); dprint(ftos(regbitflag)); + dprint(")\n"); + temp1flag = cvar("temp1"); + if (regbitvalue > 0) temp1flag = temp1flag | regbitflag; + else temp1flag = temp1flag - (temp1flag & regbitflag); + // Write any changes to the console variable (TEMP1) + cvar_set("temp1", ftos(temp1flag)); + } +}; + +//---------------------------------------------------------------------- +float(float regbitflag) query_configflag = +{ + // Return bitflag value so multiple bits can be tested together + return (configflag & regbitflag); +}; + +//---------------------------------------------------------------------- +float(float regbitflag) query_temp1flag = +{ + // Return bitflag value so multiple bits can be tested together + return (temp1flag & regbitflag); +}; + +//---------------------------------------------------------------------- +// Once global variables are available (client/server is setup) +// Sync the serverflag with the configflag +//---------------------------------------------------------------------- +void() sync_configflag = +{ + local float checkflag; + + // At this point the live data is all over the place and needs to be merged + // The serverflag can contain (rune keys and console options) if quickload + // and the configflag contains default + worldspawn keys + if (serverflags & SVR_LIVE) { + dprint("\b[SERVERFLAG]\b LIVE data detected\n"); + // Take 1-16 runes & spawn options, 17-23 mod/console options + checkflag = (serverflags & SVR_LOWFLAG) + (configflag & SVR_HIGHFLAG); + + // Make sure all flags are in sync with each other + configflag = serverflags = checkflag | SVR_LIVE; + } + else { + dprint("\b[SERVERFLAG]\b new game detected\n"); + // Update the serverflags ready for future updates + serverflags = configflag | SVR_LIVE; + } +}; + +//---------------------------------------------------------------------- +void() display_configflag = +{ + // No warning message, called from client.qc + if (developer == 0) return; + + dprint("\n\b[CONFIG]\b MOD Settings ("); + if (configflag & SVR_LIVE) dprint(ftos(configflag-SVR_LIVE)); + else dprint(ftos(configflag)); + if (configflag & SVR_LIVE) dprint(") L\n"); + else dprint(")\n"); + dprint("--------------------------------------\n"); + // Particle system + if (query_configflag(SVR_PARTICLES)) dprint("+ Particle System enabled\n"); + else dprint("- Particle System disabled\n"); + if (query_configflag(SVR_SPRPARTON) || world.sprite_particles == TRUE) + dprint("* Sprite/Dot particles ONLY\n"); + if (query_configflag(SVR_WEATHER)) dprint("- Weather System disabled\n"); + else dprint("+ Weather System enabled\n"); + // All new MOD weapons + if (world.upgrade_axe < 0) dprint("W Axe Upg Removed on Worldspawn\n"); + else if (world.upgrade_axe > 0) dprint("W Axe Upg Added on Worldspawn\n"); + else if (query_temp1flag(SVR_UPDAXE)) dprint("* Axe Upgrade in quake.rc\n"); + else if (query_configflag(SVR_UPDAXE)) dprint("+ Axe Upgrade from inventory\n"); + else dprint("- NO Axe upgrade detected\n"); + + if (world.upgrade_ssg < 0) dprint("W SSG Upg Removed on Worldspawn\n"); + else if (world.upgrade_ssg > 0) dprint("W SSG Upg Added on Worldspawn\n"); + else if (query_temp1flag(SVR_UPDSSG)) dprint("* SSG Upgrade in quake.rc\n"); + else if (query_configflag(SVR_UPDSSG)) dprint("+ SSG Upgrade from inventory\n"); + else dprint("- NO SSG upgrade detected\n"); + + if (world.upgrade_lg < 0) dprint("W LG Upg Removed on Worldspawn\n"); + else if (world.upgrade_lg > 0) dprint("W LG Upg Added on Worldspawn\n"); + else if (query_temp1flag(SVR_UPDLG)) dprint("* LG Upgrade in quake.rc\n"); + else if (query_configflag(SVR_UPDLG)) dprint("+ LG Upgrade from inventory\n"); + else dprint("- NO LG upgrade detected\n"); + + // New Shotgun bullet projectile/casing system + if (world.no_sgprojectile > 0) dprint("W SG Projs Disabled on worldspawn\n"); + else if (query_configflag(SVR_SHOTGPROJ)) dprint("- Shotgun hitscan system\n"); + else dprint("+ Shotgun projectiles system\n"); + if (world.no_sgcasing > 0) dprint("W SG Casing Disabled on worldspawn\n"); + else if (query_configflag(SVR_SHOTGCASE)) dprint("- Shotgun casing disabled\n"); + else dprint("+ Shotgun casing enabled\n"); + if (playerprojsize == 0) dprint("+ Large Projectile Collision\n"); + else dprint("- Small Projectile Collision\n"); + + // Items updates; origin points and random rotation + if (query_configflag(SVR_ITEMOFFSET)) dprint("+ All items use center origin\n"); + else dprint("- All items use corner origin\n"); + dprint("+ All items are randomly rotated\n"); + + // General MOD settings + if (autoaim_cvar >= 1) dprint("+ Player weapon autoaim disabled\n"); + else dprint("- Player weapon autoaim enabled\n"); + if (query_configflag(SVR_ZAWARE)) dprint("- Z Aware Monster combat disabled\n"); + else dprint("+ Z Aware Monster combat enabled\n"); + if (query_configflag(SVR_FOOTSTEP)) dprint("- footstep sounds disabled\n"); + else dprint("+ footstep sounds enabled\n"); + if (query_configflag(SVR_LIQDAM)) dprint("- monster liquid damage disabled\n"); + else dprint("+ monster liquid damage enabled\n"); + if (query_configflag(SVR_DEVHELPER)) dprint("- Dev helpers (mark/arrow) disabled\n"); + else dprint("+ Dev helpers (mark/arrow) enabled\n"); + + // Body fade/floor checks + if (map_bodyfadeaway > 0) dprint("+ Monster dead body fade away\n"); + else dprint("- No fade away for monster bodies\n"); + if (map_bodyflrcheck > 0) dprint("+ Monster dead body check floor\n"); + else dprint("- No floor checks for monster bodies\n"); + + // Visual settings - fog / wateralpha / gravity + if (query_configflag(SVR_NOFOGCMDS)) dprint("- Global fog system disabled\n"); + else if (fog_active && fog_control) { + dprint("+ Gfog ("); + lftos(self, fog_control.fog_currden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self, fog_control.fog_currcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self, fog_control.fog_currcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self, fog_control.fog_currcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + } + else dprint("* Global fog default not defined\n"); + if (liquid_alpha != 1) { + dprint("+ Water Alpha has changed ("); + lftos(self, liquid_alpha, 0,3, BUFFER_DPRINT); dprint(")\n"); + } + if (map_gravity != DEF_GRAVITY) { + dprint("+ Map gravity has changed ("); + dprint(ftos(map_gravity)); dprint(")\n"); + } + + // DP compatible visual settings + if (engine == ENG_DPEXT) { + dprint("+ DP features ( "); + // Show all active features + if (ext_dpfog) dprint("FOG "); + if (ext_dpsurf) dprint("SURF "); + if (ext_dprain) dprint("RAIN "); + if (ext_dpsnow) dprint("SNOW"); + dprint(")\n"); + } + + // Show the coop respawn options + if (coop > 0) { + if (coop_weapons == FALSE) dprint("+ COOP weapons respawn TRUE\n"); + else dprint("- COOP weapons respawn FALSE\n"); + if (coop_ammoboxes == FALSE) dprint("- COOP ammo boxes respawn FALSE\n"); + else dprint("+ COOP ammo boxes respawn TRUE\n"); + if (coop_health == FALSE) dprint("- COOP health packs respawn FALSE\n"); + else dprint("+ COOP health packs respawn TRUE\n"); + if (coop_powerups == FALSE) dprint("- COOP powerups respawn FALSE\n"); + else dprint("+ COOP powerups respawn TRUE\n"); + } + + dprint("--------------------------------------\n"); +}; + +/*====================================================================== + Give the player various sigils (serverflag) + Give the player silver/gold keys +======================================================================*/ +void(float sigil_bit) givesigil = +{ + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + dprint("\b[SIGIL]\b Server updated ("); + dprint(ftos(sigil_bit)); dprint(")\n"); + if (sigil_bit & SVR_RUNE_KEY1) update_configflag(SVR_RUNE_KEY1,TRUE); + if (sigil_bit & SVR_RUNE_KEY2) update_configflag(SVR_RUNE_KEY2,TRUE); + if (sigil_bit & SVR_RUNE_KEY3) update_configflag(SVR_RUNE_KEY3,TRUE); + if (sigil_bit & SVR_RUNE_KEY4) update_configflag(SVR_RUNE_KEY4,TRUE); +}; + +//---------------------------------------------------------------------- +void(float key_bit) givekey = +{ + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + dprint("\b[KEYS]\b Inventory updated ("); + dprint(ftos(key_bit)); dprint(")\n"); + if (key_bit & IT_KEY1) self.items = self.items | IT_KEY1; + if (key_bit & IT_KEY2) self.items = self.items | IT_KEY2; +}; + +/*====================================================================== + Various MOD features +======================================================================*/ +void() toggleautoaim = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable + if (autoaim_cvar >= 1) autoaim_cvar = 0.93; + else autoaim_cvar = 1; + cvar_set("sv_aim", ftos(autoaim_cvar)); + + sprint(self, "\b[Impulse]\b Auto aim state ("); + if (autoaim_cvar < 1) sprint(self, "ON)\n"); + else sprint(self, "OFF)\n"); +}; + +//---------------------------------------------------------------------- +void() toggleprojsize = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the global variable + if (playerprojsize == 1) playerprojsize = 0; + else playerprojsize = 1; + + sprint(self, "\b[Impulse]\b Player proj size ("); + if (playerprojsize == 1) sprint(self, "SMALL)\n"); + else sprint(self, "LARGE)\n"); +}; + +//---------------------------------------------------------------------- +void() togglezaware = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_ZAWARE)) update_configflag(SVR_ZAWARE, FALSE); + else update_configflag(SVR_ZAWARE, TRUE); + + sprint(self, "\b[Impulse]\b Z Aware Monsters ("); + if (query_configflag(SVR_ZAWARE)) sprint(self, "Disabled)\n"); + else sprint(self, "Enabled)\n"); +}; + +//---------------------------------------------------------------------- +void() togglepixels = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + sprint(self, "\b[SETTINGS]\b texture filtering ("); + if (pixelmode == TRUE) { + pixelmode = FALSE; + stuffcmd(self, "\ngl_texturemode GL_LINEAR_MIPMAP_LINEAR\n"); + sprint(self, "blurry)\n"); + } + else { + pixelmode = TRUE; + stuffcmd(self, "\ngl_texturemode GL_NEAREST_MIPMAP_LINEAR\n"); + sprint(self, "crispy)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglefootstep = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_FOOTSTEP)) update_configflag(SVR_FOOTSTEP, FALSE); + else update_configflag(SVR_FOOTSTEP, TRUE); + + sprint(self, "\b[Impulse]\b footsteps ("); + if (query_configflag(SVR_FOOTSTEP)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +//---------------------------------------------------------------------- +void() toggleliquiddmg = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_LIQDAM)) update_configflag(SVR_LIQDAM, FALSE); + else update_configflag(SVR_LIQDAM, TRUE); + + sprint(self, "\b[Impulse]\b Monster Liquid Damage ("); + if (query_configflag(SVR_LIQDAM)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +//---------------------------------------------------------------------- +void() toggleshotgunproj = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_SHOTGPROJ)) update_configflag(SVR_SHOTGPROJ, FALSE); + else update_configflag(SVR_SHOTGPROJ, TRUE); + + sprint(self, "\b[Impulse]\b Shotgun Projectiles ("); + if (query_configflag(SVR_SHOTGPROJ)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +//---------------------------------------------------------------------- +void() toggleshotguncase = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_SHOTGCASE)) update_configflag(SVR_SHOTGCASE, FALSE); + else update_configflag(SVR_SHOTGCASE, TRUE); + + sprint(self, "\b[Impulse]\b Shotgun Casing ("); + if (query_configflag(SVR_SHOTGCASE)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +//---------------------------------------------------------------------- +void() togglecoopartifacts = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Drop Artifacts ("); + if (coop_artifacts == TRUE) { + coop_artifacts = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_artifacts = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecoopweapons = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Weapons Respawn ("); + if (coop_weapons == TRUE) { + coop_weapons = FALSE; + sprint(self, "ON)\n"); + } + else { + coop_weapons = TRUE; + sprint(self, "OFF)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecoopammoboxes = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Ammo Boxes Respawn ("); + if (coop_ammoboxes == TRUE) { + coop_ammoboxes = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_ammoboxes = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecoophealth = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Health Packs Respawn ("); + if (coop_health == TRUE) { + coop_health = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_health = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecooppowerups = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Powerups Respawn ("); + if (coop_powerups == TRUE) { + coop_powerups = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_powerups = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() update_weather = +{ + // Check for advanced engines + if (ext_active) { + // FTE/QSS only supports one console command for weather + // Engine does not remember setting and resets it + if (checkextension("FTE_SV_POINTPARTICLES")) + if (query_configflag(SVR_WEATHER)) + stuffcmd(self, "\nr_part_rain 0\n"); + else stuffcmd(self, "\nr_part_rain 1\n"); + else { + // DP engine remembers rain/snow weather settings + // DP has separate commands for weather types + if (query_configflag(SVR_WEATHER)) { + // Weather disabled + stuffcmd(self, "\ncl_particles_rain 0\n"); + stuffcmd(self, "\ncl_particles_snow 0\n"); + } + else { + // Weather enabled + stuffcmd(self, "\ncl_particles_rain 1\n"); + stuffcmd(self, "\ncl_particles_snow 1\n"); + } + } + } +}; + +//---------------------------------------------------------------------- +void() toggleweather = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + // Enhanced engines enabled? + if (!ext_active) { + sprint(self,"\b[Impulse]\b Engine does not support weather.\n"); + return; + } + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_WEATHER)) update_configflag(SVR_WEATHER, FALSE); + else update_configflag(SVR_WEATHER, TRUE); + + sprint(self, "\b[Impulse]\b Particle weather system ("); + if (query_configflag(SVR_WEATHER)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); + update_weather(); +}; + +//---------------------------------------------------------------------- +void() togglebodyremoval = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle body removal/fade system timer + // default = time + 10 + random() * 5 + if (map_bodyfadeaway > 0) map_bodyfadeaway = 0; + else map_bodyfadeaway = 5; + + sprint(self, "\b[Impulse]\b Monster body removal ("); + if (map_bodyfadeaway > 0) sprint(self, "ON)\n"); + else sprint(self, "OFF)\n"); +}; + + +/*====================================================================== + Require DEVELOPER mode to be active +======================================================================*/ +void() toggleupgradeaxe = +{ + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + if (self.moditems & IT_UPGRADE_AXE) { + dprint("\b[Impulse]\b Shadow Axe Removed\n"); + self.moditems = self.moditems - IT_UPGRADE_AXE; + } + else { + dprint("\b[Impulse]\b Shadow Axe Added\n"); + self.moditems = self.moditems | IT_UPGRADE_AXE; + } + + if (self.weapon == IT_AXE) W_SetCurrentAmmo(self); +}; + +//---------------------------------------------------------------------- +void() toggleupgradessg = +{ + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + if (self.moditems & IT_UPGRADE_SSG) { + dprint("\b[Impulse]\b Widowmaker Shotgun Removed\n"); + self.moditems = self.moditems - IT_UPGRADE_SSG; + } + else { + dprint("\b[Impulse]\b Widowmaker Shotgun Added\n"); + self.moditems = self.moditems | IT_UPGRADE_SSG; + } + + // make sure player VIEW model is up to date + if (self.weapon == IT_SUPER_SHOTGUN) W_SetCurrentAmmo(self); +}; + +//---------------------------------------------------------------------- +void() toggleupgradelg = +{ + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + if (self.moditems & IT_UPGRADE_LG) { + dprint("\b[Impulse]\b Plasma Gun Removed\n"); + self.moditems = self.moditems - IT_UPGRADE_LG; + } + else { + dprint("\b[Impulse]\b Plasma Gun Added\n"); + self.moditems = self.moditems | IT_UPGRADE_LG; + } + + // make sure player VIEW model is up to date + if (self.weapon == IT_LIGHTNING) W_SetCurrentAmmo(self); +}; + +//---------------------------------------------------------------------- +void() toggledevhelpers = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_DEVHELPER)) update_configflag(SVR_DEVHELPER, FALSE); + else update_configflag(SVR_DEVHELPER, TRUE); + + sprint(self, "\b[Impulse]\b Dev Helpers are ("); + if (query_configflag(SVR_DEVHELPER)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +//---------------------------------------------------------------------- +void() CycleParticleDebug = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + + part_debug = part_debug + 1; + if (part_debug > PARTICLE_DEBUGMAX) part_debug = 0; + + sprint(self, "\b[Impulse]\b Particle debug level ("); + sprint(self, ftos(part_debug)); + sprint(self, ")\n"); +}; + + +/*====================================================================== + IMPULSE 9 + Gives the player certain weapons and ammo (CHEAT COMMAND) +======================================================================*/ +void() CheatCommand = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 9]\b Weapon Cheat Command\n"); + dprint("- Use Impulse 245 to get silver/gold keys!\n"); + self.impulse = 0; + self.ammo_rockets = 75; + self.ammo_nails = 150; + self.ammo_shells = 150; + self.ammo_cells = 150; + self.items = self.items | IT_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN | + IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | IT_LIGHTNING; + self.items = self.items | IT_ARMOR1; + self.weapon = IT_LIGHTNING; + W_SetCurrentAmmo (self); +}; + +/*====================================================================== + IMPULSE 250 +======================================================================*/ +void() SharpshooterCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 250]\b Sharp Shooter Cheat\n"); + self.impulse = 0; + self.sharpshoot_time = 1; + self.sharpshoot_finished = time + POWERUP_TIMER; + self.items = self.items | IT_QUAD; + self.moditems = self.moditems | IT_ARTSHARP; +}; + +/*====================================================================== + IMPULSE 251 +======================================================================*/ +void() NailPiercerCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 251]\b Nail Piercer Cheat\n"); + self.impulse = 0; + self.nailpiercer_time = 1; + self.nailpiercer_finished = time + POWERUP_TIMER; + self.items = self.items | IT_QUAD; + self.moditems = self.moditems | IT_ARTPIERCE; +}; + +/*====================================================================== + IMPULSE 252 +======================================================================*/ +void() EnvSuitCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 252]\b Environmental Suit Cheat\n"); + self.impulse = 0; + self.rad_time = 1; + self.radsuit_finished = time + POWERUP_TIMER; + self.items = self.items | IT_SUIT; +}; + +/*====================================================================== + IMPULSE 253 +======================================================================*/ +void() PentagramCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 253]\b Pentagram of Protection Cheat\n"); + self.impulse = 0; + self.invincible_time = 1; + self.invincible_finished = time + POWERUP_TIMER; + self.items = self.items | IT_INVULNERABILITY; +}; + +/*====================================================================== + IMPULSE 254 +======================================================================*/ +void() InvisibleCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 254]\b Ring of Shadows Cheat\n"); + self.impulse = 0; + self.invisible_time = 1; + self.invisible_finished = time + POWERUP_TIMER; + self.items = self.items | IT_INVISIBILITY; +}; + +/*====================================================================== + IMPULSE 255 +======================================================================*/ +void() QuadDamageCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 255]\b Quad Damage Cheat\n"); + self.impulse = 0; + self.super_time = 1; + self.super_damage_finished = time + POWERUP_TIMER; + self.items = self.items | IT_QUAD; +}; diff --git a/QC_other/QC_arcane/sounds.qc b/QC_other/QC_arcane/sounds.qc new file mode 100644 index 00000000..efbc3e2c --- /dev/null +++ b/QC_other/QC_arcane/sounds.qc @@ -0,0 +1,526 @@ +/*====================================================================== + SOUND functions +======================================================================*/ +float SOUND_PLAYONCE = 2; // When triggered plays once + +//---------------------------------------------------------------------- +void() ambient_sound_setup = +{ + if (self.volume > 1) self.volume = 1; + ambientsound (self.origin, self.noise, self.volume, ATTN_STATIC); +}; + +/*============================================================================ +/*QUAKED ambient_custom_loop (0.3 0.1 0.6) (-16 -16 -8) (16 16 8) x +Custom ambient (must be looped) sound, CANNOT toggle/switch state +-------- KEYS -------- +volume : volume of sound (default 1, capped at 1) +noise : custom sound to play (looped) +-------- SPAWNFLAGS -------- +STARTOFF : Wait for trigger, will become static +-------- NOTES -------- +Custom ambient (must be looped) sound, CANNOT toggle/switch state +============================================================================*/ +void() ambient_custom_loop = +{ + // Check for sound file + if (self.noise == "") { + dprint("\b[AMB_CUSTOM_LOOP]\b Missing sound file\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + if (self.volume > 1) self.volume = 1; + + // Ambient sounds can ONLY be setup on frame 1 + // The command (ambientsound) does not work delayed + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_comp_hum = +{ + self.noise = "ambience/comp1.wav"; + precache_sound (self.noise); + self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_drip = +{ + self.noise = "ambience/drip1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_drone = +{ + self.noise = "ambience/drone6.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_flouro_buzz = +{ + self.noise = "ambience/buzz1.wav"; + precache_sound (self.noise); + self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_light_buzz = +{ + self.noise = "ambience/fl_hum1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_suck_wind = +{ + self.noise = "ambience/suck1.wav"; + precache_sound (self.noise); + self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_swamp1 = +{ + self.noise = "ambience/swamp1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_swamp2 = +{ + self.noise = "ambience/swamp2.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_thunder = +{ + self.noise = "ambience/thunder1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; + +//====================================================================== +/*QUAKED ambient_custom_sound (0.5 0.1 0.8) (-16 -16 -8) (16 16 8) x PLAYONCE x x x x STARTOFF x +Play a sound on a periodic basis +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : targets to trigger each time sound is played +volume : volume of sound (default 1, capped at 1) +noise : primary sound (ambience/windgust1a.wav) +noise1 : stop sound (anbience/switch_6off.wav) +noise2 : random sound (ambience/windgust1b.wav) +wait : random time between sounds (default 20, =-1 no random element) +delay : minimum time between sounds (default 2) +waitmin : Starting time (waitmin + random() x waitmin, =-1 no delay) +waitmin2: 1 = Will not silence any playing sound if switching off +impulse : channel on which to play sound (0-7) (0 automatic is default) +speed : attenuation -1=no attenuation, 1=normal (default), 2=idle, 3=static, 4=quiet +-------- SPAWNFLAGS -------- +PLAYONCE : When triggered plays once +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Play a sound on a periodic basis +*/ +//====================================================================== +void() ambient_custom_stop = +{ + // Cannot block via entity state because there is an 'off sound' + // Need to check against entity internal state for off state + if (self.state == STATE_OFF) return; + + // Switch off sound emitter, clear next think + self.state = STATE_OFF; + self.think = SUB_Null; + self.nextthink = time + 0.1; + + // Catch play once/disable setting separate + if (self.estate & ESTATE_DISABLE) return; + + // Check for OFF sound, else play silence to clear sound + if (self.noise1 != "") + sound (self, self.impulse, self.noise1, self.volume, self.speed); + else { + // If aflag is defined, do not cut off sound + if (!self.waitmin2) sound (self, self.impulse, SOUND_EMPTY, self.volume, self.speed); + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_play = +{ + // Block everything except ON entity state + if (self.estate & ESTATE_BLOCK) return; + + // Internal state used for switch off sound + self.state = STATE_ON; + + // Check for random volume changes + if (self.t_width > 0) { + self.volume = self.t_width + (random() * self.t_length); + if (self.volume > 1) self.volume = 1; + } + + // Check for weather system? + if (self.check_weather == TRUE) { + // Check if weather system still active? + if (!query_configflag(SVR_WEATHER)) { + // never has multiple sounds + sound (self, self.impulse, self.noise, self.volume, self.speed); + } + } + else { + // Check for multiple random sounds + if (self.noise2 != "" && random() < 0.5) + sound (self, self.impulse, self.noise2, self.volume, self.speed); + else sound (self, self.impulse, self.noise, self.volume, self.speed); + + // If any targets defined, trigger them + if (self.target != "") trigger_strs(self.target, self); + } + + // Keep playing sound? + // If sound is setup to play once, don't turn off sound before finished + // Let the sound play out and switch off ambient sound entity + if (self.spawnflags & SOUND_PLAYONCE) self.estate = ESTATE_DISABLE; + else { + // Check for any random time element + if (self.wait == 0) self.nextthink = time + self.delay; + else self.nextthink = time + self.delay + random()*self.wait; + self.think = ambient_custom_play; + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove spawnflag and switch ON entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.estate_on(); + } + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // Toggle state of ambient sound to start/stop + if (self.state == STATE_OFF) self.estate_on(); + else self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_on = +{ + self.estate = ESTATE_ON; + ambient_custom_play(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_off = +{ + self.estate = ESTATE_OFF; + ambient_custom_stop(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_disable = +{ + self.state = STATE_OFF; + sound (self, self.impulse, SOUND_EMPTY, self.volume, self.speed); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_sound = +{ + // Check for sound file + if (self.noise == "") { + dprint("\b[AMBIENT_SOUND]\b Missing sound file at "); + dprint(vtos(self.origin)); dprint("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + precache_sound (self.noise); + + // Is there an OFF sound defined (used for toggle sounds) + if (self.noise1 != "") precache_sound (self.noise1); + + // Is there any random alternative sounds + if (self.noise2 != "") precache_sound (self.noise2); + + self.classtype = CT_SOUNDEMITTER; + if (self.volume <= 0 || self.volume > 1) self.volume = 1; + + // Setup defaults for sound waits (-1=no random element) + if (self.wait == 0) self.wait = 20; + if (self.wait < 0) self.wait = 0; + + if (self.delay <= 0) self.delay = 2; + if (self.waitmin == 0) self.waitmin = 4; + if (self.impulse <= 0) self.impulse = 1; + + // attenuation -1=no attenuation, 1=normal (default), 2=idle, 3=static, 4=quiet + if (self.speed < 0) self.speed = ATTN_NONE; + else if (self.speed == 2) self.speed = ATTN_IDLE; + else if (self.speed == 3) self.speed = ATTN_STATIC; + else if (self.speed == 4) self.speed = ATTN_QUIET; + else self.speed = ATTN_NORM; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = ambient_custom_on; + self.estate_off = ambient_custom_off; + self.estate_use = ambient_custom_use; + self.estate_disable = ambient_custom_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + if (self.waitmin > 0) { + self.nextthink = time + self.waitmin + random()*self.waitmin; + self.think = self.estate_on; + } + else self.estate_on(); + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_water = +{ + if (self.noise == "") self.noise = "ambience/water1.wav"; + if (!self.volume) self.volume = 0.75; + ambient_custom_loop(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_rain = +{ + if (self.count == 1) { + // Long dripping water sound + self.noise = "ambience/rain1_nl.wav"; + if (!self.speed) self.speed = 2; + if (!self.volume) self.volume = 0.4; + // Sound is 7s long, 0.1s for overlap + self.delay = 6.9; + } + else { + // Very short intense rain sound + self.noise = "ambience/rain2_nl.wav"; + if (!self.speed) self.speed = 1; + if (!self.volume) self.volume = 0.5; + // Sound is 3s long, 0.1s for overlap + self.delay = 2.9; + } + + self.wait = -1; // pretend loop, no pause + self.waitmin = -1; // No start delay + self.check_weather = TRUE; // Keep checking weather system + + // Always start off, must be triggered + self.spawnflags = self.spawnflags | ENT_STARTOFF; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_rumble = +{ + // Always precache all sounds and then randomly pick one + // load/save games will always generate new random selection + // and that will produce cache errors everytime + precache_sound ("ambience/rumble1.wav"); + precache_sound ("ambience/rumble2.wav"); + precache_sound ("ambience/rumble3.wav"); + + // Pick a random sound to start with + if (self.count < 0) self.count = random()*3; + + // Setup sound wav names + if (self.count <= 1) { + self.noise = "ambience/rumble1.wav"; + // Pick an alternative random sound + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/rumble2.wav"; + else self.noise2 = "ambience/rumble3.wav"; + } + } + else if (self.count <= 2) { + self.noise = "ambience/rumble2.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/rumble1.wav"; + else self.noise2 = "ambience/rumble3.wav"; + } + } + else { + self.noise = "ambience/rumble3.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/rumble1.wav"; + else self.noise2 = "ambience/rumble2.wav"; + } + } + + // Default values for rumble + if (!self.volume) { self.t_width = 0.5; self.t_length = 0.5; } + if (!self.speed) self.speed = 1; + if (!self.delay) self.delay = 20; + if (!self.wait) self.wait = 20; + if (!self.waitmin) self.waitmin = 6 + random()*6; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_wind = +{ + // Always precache all sounds and then randomly pick one + // load/save games will always generate new random selection + // and that will produce cache errors everytime + precache_sound ("ambience/windgust1.wav"); + precache_sound ("ambience/windgust2.wav"); + precache_sound ("ambience/windgust3.wav"); + precache_sound ("ambience/windgust4.wav"); + precache_sound ("ambience/windgust5.wav"); + precache_sound ("ambience/windgust6.wav"); + + // Pick a random sound to start with + if (self.count < 0) self.count = random()*6; + + // Setup sound wav names + if (self.count <= 1) { + self.noise = "ambience/windgust1.wav"; + // Pick an alternative random sound + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/windgust2.wav"; + else self.noise2 = "ambience/windgust3.wav"; + } + } + else if (self.count <= 2) { + self.noise = "ambience/windgust2.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/windgust1.wav"; + else self.noise2 = "ambience/windgust3.wav"; + } + } + else if (self.count <= 3) { + self.noise = "ambience/windgust3.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/windgust1.wav"; + else self.noise2 = "ambience/windgust2.wav"; + } + } + else if (self.count <= 4) { + self.noise = "ambience/windgust4.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/windgust5.wav"; + else self.noise2 = "ambience/windgust6.wav"; + } + } + else if (self.count <= 5) { + self.noise = "ambience/windgust5.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/windgust4.wav"; + else self.noise2 = "ambience/windgust6.wav"; + } + } + else { + self.noise = "ambience/windgust6.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/windgust4.wav"; + else self.noise2 = "ambience/windgust5.wav"; + } + } + + // Default values for wind + if (!self.volume) self.volume = 1; + if (!self.speed) self.speed = 1; + if (!self.delay) self.delay = 10; + if (!self.wait) self.wait = 10; + if (!self.waitmin) self.waitmin = 4 + random()*4; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_wood = +{ + // Always precache all sounds and then randomly pick one + // load/save games will always generate new random selection + // and that will produce cache errors everytime + precache_sound ("ambience/woodcreak2a.wav"); + precache_sound ("ambience/woodcreak2b.wav"); + precache_sound ("ambience/woodcreak2c.wav"); + precache_sound ("ambience/woodcreak2d.wav"); + + // Pick a random sound to start with + if (self.count < 0) self.count = random()*4; + + if (self.count <= 1) { + self.noise = "ambience/woodcreak2a.wav"; + // Pick an alternative random sound + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/woodcreak2b.wav"; + else self.noise2 = "ambience/woodcreak2c.wav"; + } + } + else if (self.count <= 2) { + self.noise = "ambience/woodcreak2b.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/woodcreak2c.wav"; + else self.noise2 = "ambience/woodcreak2d.wav"; + } + } + else if (self.count <= 3) { + self.noise = "ambience/woodcreak2c.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/woodcreak2a.wav"; + else self.noise2 = "ambience/woodcreak2d.wav"; + } + } + else { + self.noise = "ambience/woodcreak2d.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ambience/woodcreak2a.wav"; + else self.noise2 = "ambience/woodcreak2b.wav"; + } + } + + // Default values for wood + if (!self.volume) self.volume = 1; + if (!self.speed) self.speed = 2; + if (!self.delay) self.delay = 15; + if (!self.wait) self.wait = 30; + if (!self.waitmin) self.waitmin = 8 + random()*8; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_chime = +{ + if (self.noise == "") self.noise = "ambience/chimes.wav"; + if (!self.speed) self.speed = 2; + if (!self.volume) self.volume = 1; + if (!self.wait) self.wait = 10; + if (!self.delay) self.delay = 10; + if (!self.waitmin) self.waitmin = 10 + random()*10; + if (!self.waitmin2) self.waitmin2 = -1; + + // Back into main function + ambient_custom_sound(); +}; diff --git a/QC_original/sprites.qc b/QC_other/QC_arcane/sprites.qc similarity index 100% rename from QC_original/sprites.qc rename to QC_other/QC_arcane/sprites.qc diff --git a/QC_other/QC_arcane/subs.qc b/QC_other/QC_arcane/subs.qc new file mode 100644 index 00000000..880cb21f --- /dev/null +++ b/QC_other/QC_arcane/subs.qc @@ -0,0 +1,865 @@ +/*====================================================================== + SUB FUNCTIONS +======================================================================*/ +void() SUB_Null = {}; +void() SUB_Remove = {remove(self);}; +void(entity inflictor, entity attacker, float damage) SUB_Null_pain = {}; + +void() SUB_CalcMoveDone; +void() SUB_CalcAngleMoveDone; +void(vector marker_org, float marker_type) spawn_marker; +void(float hud_item) update_hud_totals; + +//====================================================================== +// To determine if an entity is still active this function generates +// an unique number that can be checked/shared between linked entities +//---------------------------------------------------------------------- +void(entity targ) gen_unique_no = +{ + // Check if target entity has an unique number already + if (targ.entno_unique == 0) + targ.entno_unique = rint(random()*1000) * rint(random()*1000); +}; + +//====================================================================== +// Most of the monsters have an attack_offset setup to spawn their +// proejctiles in the right location relative to their gun model +// This function expects the makevectors has been done already +// makevectors (self.angles); <--- if missing, vector will be rubbish! +//---------------------------------------------------------------------- +vector(vector attack_dir) attack_vector = +{ + local vector retvec; + retvec = v_forward * attack_dir_x; + retvec = retvec + (v_right * attack_dir_y); + retvec = retvec + (v_up * attack_dir_z); + return retvec; +}; + +//====================================================================== +// Bmodels have a 0,0,0 origin key, need to calculate from mins/maxs +// This function will return the true origin using mins/max vectors +//---------------------------------------------------------------------- +vector(entity bmodel_ent) bmodel_origin = +{ + local vector vdiff, vorigin; + + // Calculate the middle point of the mins/maxs size vectors + vdiff_x = (bmodel_ent.maxs_x - bmodel_ent.mins_x) / 2; + vdiff_y = (bmodel_ent.maxs_y - bmodel_ent.mins_y) / 2; + vdiff_z = (bmodel_ent.maxs_z - bmodel_ent.mins_z) / 2; + + // The mins vector is an absolute value of where the Bmodel is located + // Add mins vector to middle point to get true origin + // When bmodel do move they also update their origin co-ordinates + // So any additional movement needs to be added as well + // This means that bmodels can be tracked by movement functions + vorigin = bmodel_ent.origin + bmodel_ent.mins + vdiff; + + // Return origin + return vorigin; +}; + +//====================================================================== +// Check for bmodel errors, model key empty (can crash engine) +//---------------------------------------------------------------------- +float() check_bmodel_keys = +{ + if (self.model == "") { + // this error can be fatal for most engines, show warning + dprint ("\b[BMODEL]\b "); dprint (self.classname); + dprint (" ("); dprint (self.targetname); + dprint (") missing MODEL key!\n"); + + self.classtype = CT_DEVMARKER; // Useless entity + self.movetype = MOVETYPE_NONE; // Stationary + self.solid = SOLID_NOT; // no world interaction + + // If developer active show yellow diamond + if (developer > 0) setmodel(self, MODEL_BROKEN); + else setmodel(self,""); + + // Make sure no world interaction + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + // Randomly place debug diamond above 0,0,0 + self.pos1 = '0 0 0'; + self.pos1_z = random()*64; + setorigin(self, self.pos1); + + // Do nothing with this entity + return TRUE; + } + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Cannot have multiple upgrade restrictions on monster/items +//---------------------------------------------------------------------- +void() remove_duplicate_upgrades = +{ + if (self.upgrade_axe) { + if (self.upgrade_ssg) self.upgrade_ssg = FALSE; + else if (self.upgrade_lg) self.upgrade_lg = FALSE; + } + else if (self.upgrade_ssg) { + if (self.upgrade_axe) self.upgrade_axe = FALSE; + else if (self.upgrade_lg) self.upgrade_lg = FALSE; + } + else if (self.upgrade_lg) { + if (self.upgrade_axe) self.upgrade_axe = FALSE; + else if (self.upgrade_ssg) self.upgrade_ssg = FALSE; + } +} + +/*====================================================================== +QuakeEd only writes a single float for angles (bad idea), +so up and down are just constant angles. +======================================================================*/ +void() SetMovedir = +{ + if (self.angles == '0 -1 0') self.movedir = '0 0 1'; + else if (self.angles == '0 -2 0') self.movedir = '0 0 -1'; + else { + makevectors (self.angles); + self.movedir = v_forward; + } + // Bmodels need angles key reset otherwise twisted on spawn + self.angles = '0 0 0'; +}; + +//---------------------------------------------------------------------- +float(vector check_vec) CheckZeroVector = +{ + if (check_vec_x == 0 && check_vec_y == 0 && check_vec_z == 0) + return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Some entities have directional parameters (angles -> movedir) +// This function searches for a target entity (useful for tracking) +// Always finds the first target key (will fail if multiple targets) +//---------------------------------------------------------------------- +void() TargetMovedir = +{ + local entity targ; + local vector org, targorg; + + if (self.target == "") return; + + // Check self for Bmodel origin + if (self.bsporigin) org = bmodel_origin(self); + else org = self.origin; + + // Find target entity + targ = find(world, targetname, self.target); + if (targ) { + // Check for a Bmodel object (special origin) + if (targ.bsporigin) targorg = bmodel_origin(targ); + else targorg = targ.origin; + // Calculate facing angle towards target + self.movedir = normalize(targorg - org); + } +}; + +/*====================================================================== +InitTrigger +======================================================================*/ +void() InitTrigger = +{ + // trigger angles are used for one-way touches. An angle of 0 is assumed + // to mean no restrictions, so use a yaw of 360 instead. + if (CheckZeroVector(self.angles) == FALSE) SetMovedir (); + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + self.mdl = self.model; // Save model for later + setmodel (self, self.mdl); // set size and link into world + self.bbmins = self.mins; // Save bmodel bounds for later + self.bbmaxs = self.maxs; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + self.modelindex = 0; + self.model = ""; // hide bmodel surface +}; + +/*====================================================================== +SUB_CalcMove + +calculate self.velocity and self.nextthink to reach dest from +self.origin traveling at speed +======================================================================*/ +void(vector tdest, float tspeed, void() func) SUB_CalcMove = +{ + local vector vdestdelta; + local float len, traveltime; + + if (!tspeed) tspeed = 40; // Create default speed if none specified + self.think1 = func; // Finished moving function + self.finaldest = tdest; // Final destination + self.think = SUB_CalcMoveDone; // Tidy up function + + vdestdelta = tdest - self.origin; // set destdelta to the vector needed to move + len = vlen (vdestdelta); // calculate length of vector + traveltime = len / tspeed; // divide by speed to get time to reach dest + + // If move distance or time too small, snap to final location + if (traveltime < 0.1 || tdest == self.origin) { + self.velocity = '0 0 0'; + self.nextthink = self.ltime + 0.1; + return; + } + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float + self.nextthink = self.ltime + traveltime; +}; + +/*====================================================================== +After moving, set origin to exact final destination +======================================================================*/ +void() SUB_CalcMoveDone = +{ + self.velocity = '0 0 0'; + setorigin(self, self.finaldest); + self.nextthink = -1; + if (self.think1) self.think1(); +}; + +//---------------------------------------------------------------------- +// Not used anywhere +//---------------------------------------------------------------------- +void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = +{ + local entity stemp; + stemp = self; + self = ent; + + SUB_CalcMove (tdest, tspeed, func); + self = stemp; +}; + +/*====================================================================== +SUB_CalcMoveEntity + +calculate self.velocity and self.nextthink to reach dest from +self.origin traveling at speed +======================================================================*/ +void() SUB_MoveEntityDone = +{ + self.movetype = self.classmove; + SUB_CalcMoveDone(); +}; + +//---------------------------------------------------------------------- +void(vector tdest, float tspeed, void() func) SUB_CalcMoveEntity = +{ + local vector vdestdelta; + local float traveltime; + + if (!tspeed) tspeed = 4; // Create default travel time if none specified + self.classmove = self.movetype; // save previous movetype + self.movetype = MOVETYPE_FLY; // Allow entity to move smoothly + self.think1 = func; // Store final function + self.finaldest = tdest; // Store final destination + + vdestdelta = tdest - self.origin; // set destdelta to the vector needed to move + traveltime = 1 / tspeed; // Work out percentage travel velocity + self.velocity = vdestdelta * traveltime; // Calc time travel fraction + + self.nextthink = time + tspeed; + self.think = SUB_MoveEntityDone; +}; + +/*====================================================================== +SUB_CalcAngleMove + +calculate self.avelocity and self.nextthink to reach destangle from +self.angles rotating + +The calling function should make sure self.think is valid +======================================================================*/ +void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = +{ +local vector destdelta; +local float len, traveltime; + + if (!tspeed) dprint("[SUB_CALC_ANGLE] No speed is defined!"); + + // set destdelta to the vector needed to move + destdelta = destangle - self.angles; + + // calculate length of vector + len = vlen (destdelta); + + // divide by speed to get time to reach dest + traveltime = len / tspeed; + + // set nextthink to trigger a think when dest is reached + self.nextthink = self.ltime + traveltime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.avelocity = destdelta * (1 / traveltime); + + self.think1 = func; + self.finalangle = destangle; + self.think = SUB_CalcAngleMoveDone; +}; + +/*====================================================================== +After rotating, set angle to exact final angle +======================================================================*/ +void() SUB_CalcAngleMoveDone = +{ + self.angles = self.finalangle; + self.avelocity = '0 0 0'; + self.nextthink = -1; + if (self.think1) + self.think1(); +}; + +//---------------------------------------------------------------------- +// Not used anywhere +//---------------------------------------------------------------------- +void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = +{ + local entity stemp; + stemp = self; + self = ent; + SUB_CalcAngleMove (destangle, tspeed, func); + self = stemp; +}; + +//---------------------------------------------------------------------- +void() DelayThink = +{ + activator = self.enemy; + SUB_UseTargets (); + remove(self); +}; + +/*====================================================================== +SUB_UseTargets + +the global "activator" should be set to the entity that initiated the firing. + +If self.delay is set, a DelayedUse entity will be created that will actually +do the SUB_UseTargets after that many seconds have passed. + +Centerprints any self.message to the activator. + +Removes all entities with a targetname that match self.killtarget, +and removes them, so some events can remove other triggers. + +Search for (string)targetname in all entities that +match (string)self.target and call their .use function + +======================================================================*/ +void() SUB_UseTargets = +{ + local entity t, stemp, otemp, act; + + //---------------------------------------------------------------------- + // Check for recursive loops!?! + //---------------------------------------------------------------------- + if (self.targetname != "") { + if (self.targetname == self.target || self.targetname == self.target2) { + dprint("\n----------------------------------------\n"); + dprint("\b[USE_TARGET]\b target == targetname, really bad!!!\n"); + dprint(self.classname); + dprint(" ("); dprint(self.targetname); dprint(") at "); + if (self.bsporigin) dprint(vtos(bmodel_origin(self))); + else dprint(vtos(self.origin)); + dprint("\ntarg ("); dprint(self.target); + dprint(") targ2 ("); dprint(self.target2); + dprint(") kill ("); dprint(self.killtarget); + dprint(")\n----------------------------------------\n"); + return; + } + } + //---------------------------------------------------------------------- + // check for a delay + //---------------------------------------------------------------------- + if (self.delay) { + // create a temp object to fire at a later time + t = spawn(); + t.classname = "DelayedUse"; + t.classtype = CT_TRIGRELAYDELAY; + t.owner = self; + t.nextthink = time + self.delay; + t.think = DelayThink; + t.enemy = activator; + t.message = self.message; + t.killtarget = self.killtarget; + t.target = self.target; + t.target2 = self.target2; + t.noise = self.noise; + return; + } + + //---------------------------------------------------------------------- + // Check if previous delay has been disabled + // Unfortunately start off = OFF state and not easy to check for + // because some entities use that spawnflag bit for other things! + //---------------------------------------------------------------------- + if (self.classtype == CT_TRIGRELAYDELAY) { + if (self.owner.estate & ESTATE_DISABLE) return; + } + + //---------------------------------------------------------------------- + // print any messages + //---------------------------------------------------------------------- + if (activator.flags & FL_CLIENT && self.message != "") { + if (coop > 0) { + // Write message to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CENTERPRINT); + WriteString (MSG_ALL, self.message); + } + // Write message to single client + else centerprint (activator, self.message); + // Default noise = classic beep beep sound + if (self.noise == "") sound (activator, CHAN_VOICE, SOUND_TALK, 1, ATTN_NORM); + } + + //---------------------------------------------------------------------- + // kill targets + // I really do hate this function because there is hardly any checks + // on entities being removed, added a player check for sanity! + //---------------------------------------------------------------------- + if (self.killtarget != "") { + t = find (world, targetname, self.killtarget); + while(t) { + // Check for activate mosnters? Tidy up kill counter + if (t.flags & FL_MONSTER && t.health > 0) { + // If a monster marked with no monster count dies + // update HUD totals to reflect death properly + if (t.nomonstercount) { + total_monsters = total_monsters + 1; + update_hud_totals(HUD_MONSTERS); + } + // Update global monster death totals + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + } + // Added extra check to prevent player client removal!?! + if (!(t.flags & FL_CLIENT)) { + // Try to minimize the entity chain damage, check for + // entity attachments and delete them as well! + if (t.attachment) remove(t.attachment); + if (t.attachment2) remove(t.attachment2); + if (t.attachment3) remove(t.attachment3); + // Make sure any unique ent number is reset + if (t.entno_unique > 0) t.entno_unique = 0; + // Remove entity from chain list + remove (t); + } + // Find the next killtarget + t = find (t, targetname, self.killtarget); + } + } + //---------------------------------------------------------------------- + // fire targets + //---------------------------------------------------------------------- + if (self.target != "") { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.target); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp; // Switch self/other + self.activate = stemp; // used by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + // Are there anymore targets left in the list? + t = find (t, targetname, self.target); + } + } + //---------------------------------------------------------------------- + if (self.target2 != "") { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.target2); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.target2); + } + } +}; + +/*====================================================================== + SUB_AttackFinished + in nightmare mode, all attack_finished times become 0 + some monsters refire twice automatically (using .cnt variable) + Change nightmare to be less range spam and better time scaling +======================================================================*/ +void(float normal) SUB_AttackFinished = +{ + local float nightadj; // Easier to work out percentage + self.cnt = 0; // reset checkfire counter + + // Nightmare skill attacks are faster (turret like) and with + // hitscan enemies this can easily overwhelm targets locking + // them into damage/pain function loops. This can especially be + // be bad if a large enough enemy group is involved! + // Changed - NM behaviour for boss fights is default + // + if (skill == SKILL_NIGHTMARE && self.enemy.bossflag == FALSE) { + // Nightmare mode is just endless range attacks! + // I never thought this was a good way to end skill levels + // Changed nightmare mode to 50-75% decrease in time + // Exceptions to nightmare mode (minion spawning) - 75-100% time + nightadj = 0.5 + (random()*0.25); + if (self.minion_active) nightadj = nightadj + 0.25; + // The original ID shamblers were lightning turrets on Nightmare + // Shamblers don't scale with skill levels in AD because + // they don't have projectiles, so they need a switch instead + // On Nightmare skill Shamblers go from 2-4s to 1s! + // Instead of 2-4s, NM is 0.6-1.2s, Average 1.2s +2 frames + if (self.classtype == CT_MONSHAM) nightadj = 0.4; + self.attack_finished = time + (normal*nightadj); + } + // Easy, Nornal and Hard skill all pass through, no change + else self.attack_finished = time + normal; + //dprint("Time ("); dprint(ftos(time)); + //dprint(") AF ("); dprint(ftos(normal)); + //dprint(") Dif ("); dprint(ftos(self.attack_finished - time)); + //dprint(") Att ("); dprint(ftos(self.attack_finished)); + //dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Used by soliders and enforcers (special double fire mode) +//---------------------------------------------------------------------- +void (void() thinkst) SUB_CheckRefire = +{ + if (skill != SKILL_NIGHTMARE) return; + if (self.cnt == 1) return; + if (!visible (self.enemy)) return; + self.cnt = 1; + self.think = thinkst; +}; + +//---------------------------------------------------------------------- +// Not used anywhere in QC +//---------------------------------------------------------------------- +/*float() SUB_CountTargets = +{ + local entity t; + local float i; + + i = 0; + if (self.target != "") { + t = world; + do { + t = find(t, targetname, self.target); + if (!t) break; + i = i + 1; + } while ( 1 ); + } + return i; +};*/ + +/*====================================================================== + ChooseTurn + - can't find any reference to this in the QC +======================================================================*/ +/*void(vector dest3) ChooseTurn = +{ + local vector dir, newdir; + + dir = self.origin - dest3; + + newdir_x = trace_plane_normal_y; + newdir_y = 0 - trace_plane_normal_x; + newdir_z = 0; + + if (dir * newdir > 0) { + dir_x = 0 - trace_plane_normal_y; + dir_y = trace_plane_normal_x; + } + else { + dir_x = trace_plane_normal_y; + dir_y = 0 - trace_plane_normal_x; + } + + dir_z = 0; + self.ideal_yaw = vectoyaw(dir); +};*/ + +/*====================================================================== + SPAWN_TFOG and SPAWN_TDEATH + + These functions were originally in triggers.qc, but are used all + over the place by monsters, items and players. Subs seems a better + home for these generic functions. + + ======================================================================*/ +void() play_teleport = +{ + self.lip = random() * 5; + if (self.lip < 1) self.noise = "misc/r_tele1.wav"; + else if (self.lip < 2) self.noise = "misc/r_tele2.wav"; + else if (self.lip < 3) self.noise = "misc/r_tele3.wav"; + else if (self.lip < 4) self.noise = "misc/r_tele4.wav"; + else self.noise = "misc/r_tele5.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.nextthink = time + 2; // Allow time for the sound to finish + self.think = SUB_Remove; // tidy up function +}; + +//---------------------------------------------------------------------- +void(vector org) spawn_tfog = +{ + local entity spawneffect; + + spawneffect = spawn (); + spawneffect.origin = org; + spawneffect.nextthink = time + 0.2; + spawneffect.think = play_teleport; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); +}; + +//---------------------------------------------------------------------- +void() tdeath_touch = +{ + // Cannot telefrag yourself!?! + if (other == self.owner) return; + // Check if found a breakable than cannot be broken + if (ai_foundbreakable(self, other, FALSE)) return; + + // A boss cannot be telefragged (except shub) + // Telefrag entity trying to telefrag boss instead!?! + if (other.bossflag == TRUE) { + if (other.classtype != CT_MONIDSHUB) { + T_Damage (self.owner, other, other, MEGADEATH, NOARMOR); + return; + } + } + + // frag anyone who teleports in on top of an invincible player + if (other.flags & FL_CLIENT) { + if (other.invincible_finished > time) self.classname = "teledeath2"; + // other monsters explode themselves + if ( !(self.owner.flags & FL_CLIENT) ) { + T_Damage (self.owner, self, self, MEGADEATH, NOARMOR); + return; + } + } + + // Sudden death incoming ... + if (other.health) T_Damage (other, self, self, MEGADEATH, NOARMOR); +}; + +//---------------------------------------------------------------------- +void(vector org, entity death_owner) spawn_tdeath = +{ + local entity death; + + death = spawn(); + death.classname = "teledeath"; + death.owner = death_owner; + death.movetype = MOVETYPE_NONE; + death.solid = SOLID_TRIGGER; + death.angles = '0 0 0'; + setsize (death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1'); + setorigin (death, org); + death.touch = tdeath_touch; + death.nextthink = time + 0.2; + death.think = SUB_Remove; + + // This is extremely costly on the engine because it re-checks + // every trigger in the map to see if it is touching something + force_retouch = 2; +}; + +/*====================================================================== + skill_chanceattack + Calculate chance to attack player based on skill level and distance + The standard ID range formula + (enemy_range == RANGE_MELEE) chance = 0.9 + (enemy_range == RANGE_NEAR) chance = 0.4 + (enemy_range == RANGE_MID) chance = 0.05 + else chance = 0; + The problem with this formula is that the chance factor is not gradual + and will spike in chance when close to range boundaries + Also this formula has no skill modifiers leading to limited gameplay rules + +======================================================================*/ +float() SUB_ChanceAttack = +{ + local float chrange, chskill, chance; + + chrange = chskill = 0; // taniwha patch + + // Upper and lower limits of range have fixed chance rates + if (self.enemydist > MON_MAX_RANGE) chance = 0.05; + else if (self.enemydist < MON_RANGE_MELEE) chance = 0.95; + else { + // Random chance of range attack based on player distance + chrange = ((MON_MAX_RANGE - self.enemydist) / MON_STEPRANGE) / 10; + + // Skill modifier to chance (Easy -0.2 Norm -0.1, Hard 0, Night 0.1) + chskill = ((skill-SKILL_HARD)*0.1); + chance = chrange + chskill; + + // There Should always be a chance to HIT or MISS + if (chance > 0.95) chance = 0.95; + else if (chance < 0.05) chance = 0.05; + } + + // Return result and finish debug information line + if (random() < chance) return TRUE; + else return FALSE; +}; + +/*====================================================================== + skill_subattack + Calculate attack_finished time based on skill level +======================================================================*/ +float (float min_time, float ranbase_time) SUB_SkillAttack = +{ + local float ran_time, sub_time; + + // Easy = min + random(base + 1.5) Normal = min + random(base + 1.0) + // Hard = min + random(base + 0.5) Nightm = min + random(base + 0.0) + ran_time = ranbase_time + ((SKILL_NIGHTMARE - skill) * 0.5); + sub_time = min_time + (ran_time * random()); + + return sub_time; +}; + +/*====================================================================== + SUB_Tracking + Progressively tracks the origin of enemies making attacks more accurate + * Original code by Necros (http://shoresofnis.com/) +======================================================================*/ +vector(vector iorg, vector org_offset, entity targ, float zspeed) SUB_Tracking = +{ + local vector vec, org; + local float diff; + + // Allow for source origin to be fine tuned (directional) + makevectors (self.angles); + org = self.origin + attack_vector(org_offset); + + diff = vlen(iorg - org) / zspeed; // Workout difference + vec = targ.velocity; + if (targ.flags & FL_MONSTER) vec_z = 0; // Flatten Z axis for monsters + else vec_z = vec_z * 0.2; // Aim for headshot with players + + iorg = targ.origin + diff * vec; // Refine target origin + return iorg; +}; + +/*====================================================================== + SUB_Elevation + Calculates the Elevation for Z Aware monsters + * Original code by Preach (https://tomeofpreach.wordpress.com/) + * Added support for variable origin locations and proj speeds + * Added support for distance scaling linked to skill levels +======================================================================*/ +float(float theta, vector sorg, vector mdest, float zspeed) SUB_Elevation = +{ + local float a, b, c; //constants in the equation to be solved + local vector ofs; //displacement we wish the projectile to travel + local float y, z; //horizontal and vertical components of ofs + local float tan_theta; //trig values of the angle theta + local vector vec, eorg; + local float dist, sperc; + + // Place projectile destination at player head level + if (self.classtype == CT_MONSPIDER) mdest = mdest + ELEV_SPID_OFS; + else mdest = mdest + ELEV_VIEW_OFS; + + // Work out vector distance between source and destination + // Normalize the distance and create a percentage of that + // This is a skill based calculation so the aiming gets better + // The grenade is aimed infront of target so that it bounces + // No check for vertical difference so it bad going up height! + // Zombie, poison spiders zaware calculation is fine, exception! + if (self.classgroup != CG_ZOMBIE && self.classtype != CT_MONSPIDER + && self.classtype != CT_MONBOGLORD) { + vec = mdest - sorg; + dist = vlen(vec); + vec = normalize(vec); + sperc = 0.45 + skill*0.15; + eorg = sorg + (vec * (dist*sperc)); + ofs = eorg - sorg; + } + else ofs = mdest - sorg; + + //calculate how far we are firing + // ofs = mdest - sorg; + z = ofs_z; + ofs_z = 0; + y = vlen(ofs); + + // Map gravity is a global variable defined in world.qc + //find the coefficients of the quadratic in tan(theta) + a = 0.5 * map_gravity * y * y / (zspeed * zspeed); + b = -y; + c = a + z; + + //check if the destination is too far to reach + if(b*b < 4*a*c) return ELEV_DEFAULT; + + //calculate the tan value of the given theta + tan_theta = mathlib_tan(theta); + + //reuse ang to create the improved firing direction + theta = mathlib_atan2(a*tan_theta*tan_theta - c, 2*a*tan_theta + b); + + //constrain the values to stop anything too mad happening + while(theta > 90) theta = theta - 180; + return theta; +}; + +/*====================================================================== + SUB_Elevat (Alternative version, not used anymore, left for reference) + Calculates the Elevation for Z Aware monsters + * Original formula WIKI with QC help from ericw +======================================================================*/ +/*float(vector source, vector targ, float zspeed) SUB_Elevat = +{ + local float g; // Gravity + local float targx, targy; // Sub parts of distance + local float v2, v4; // speed*speed & speed*speed*speed*speed + local vector dist; // Distance to travel + local float ang, theta; + + g = map_gravity; // default 800 + dist = targ - source; // vector distance + targy = dist_z; // Up direction + dist_z = 0; + targx = vlen(dist); // X,Y direction + + v2 = zspeed * zspeed; + v4 = v2 * v2; + + // First part of equation + ang = v4 - (g * ( (g * targx * targx) + (2 * targy * v2) ) ); + // Cap elevation angle at default value + //if(ang < 0) return ELEV_DEFAULT; + + // Second section of equation + theta = mathlib_atan2 ((v2 - mathlib_sqrt(ang)) / (g * targx),1); + return theta; +}; */ diff --git a/QC_other/QC_arcane/subs_soc.qc b/QC_other/QC_arcane/subs_soc.qc new file mode 100644 index 00000000..7920c8ad --- /dev/null +++ b/QC_other/QC_arcane/subs_soc.qc @@ -0,0 +1,393 @@ +//====================================================================== +// Trigger/use all entities that match the supplied targetname +// self is switched around so target use function works correctly +// +//---------------------------------------------------------------------- +void(string target_strs, entity activator_ent) trigger_strs = +{ + local entity tself, tother, tactivator, ent_list; + + // Some entities constantly use this function (<0.1s trigger) + // This is just an entity key to block the debug info + if (activator_ent.nodebuginfo == FALSE) { + dprint("\b[STR_TRIG]\b Str ("); dprint(target_strs); + dprint(") Activator ("); dprint(activator_ent.classname); + if (target_strs == "") dprint(") - ERROR!!\n"); + else dprint(")\n"); + } + + // Prevent this function from triggering everything by + // checking if the target_str is empty (empty = world) + if (target_strs != "") { + // Store self/other for later + tself = self; + tother = other; + tactivator = activator; + if (activator_ent.flags & FL_CLIENT) activator = activator_ent; + + // Build initial list from world + ent_list = find(world, targetname, target_strs); + // Cycle through list + while(ent_list) { + // Setup self/other ready for trigger/use function + self = ent_list; + other = tself; + if (self.use) { + self.activate = activator_ent; // Link activator + self.use(); // Fire use function + } + // Find next trigger from intial list (not world) + ent_list = find(ent_list, targetname, target_strs); + } + // Restore self/other from previous temp storage + self = tself; + other = tother; + if (activator_ent.flags & FL_CLIENT) activator = tactivator; + } +}; + +//====================================================================== +// Trigger/use the entity supplied and activator +// self is switched around so target use function works correctly +// +//---------------------------------------------------------------------- +void(entity target_ent, entity activator_ent) trigger_ent = +{ + local entity tself, tother, tactivator; + + // Some entities constantly use this function (<0.1s trigger) + // This is just an entity key to block the debug info + if (activator_ent.nodebuginfo == FALSE) { + dprint("\b[ENT_TRIG]\b Ent ("); dprint(ftos(target_ent.classtype)); + dprint(") Activator ("); dprint(activator_ent.classname); + if (!target_ent) dprint(") - ERROR!!\n"); + else dprint(")\n"); + } + + if (target_ent && target_ent.use) { + // Save self/other for later + tself = self; + tother = other; + tactivator = activator; + if (activator_ent.flags & FL_CLIENT) activator = activator_ent; + + // Switch around self/other for USE function + self = target_ent; + other = tself; + + // Use trigger + if (self.use) { + self.activate = activator_ent; // Link activator + self.use(); // Fire use function + } + + // Restore self/other from previous temp storage + self = tself; + other = tother; + if (activator_ent.flags & FL_CLIENT) activator = tactivator; + } +}; + +//====================================================================== +// Check if the entity has solid surface below +// There is no entity type checks, can be any entity in theory! +// First check is checkbottom for completel bounding box coverage +// Second check is trace down to find floor surface below +// Typical trace down distance is 128 units with 24 unit difference +// +// Uses for this function:- +// ai_states.qc - ai_stand +// monsters.qc - monster_deadbody_check +// ai_gibs.qc - CheckFloorGib +// items.qc - item_thinkloop +// +//---------------------------------------------------------------------- +void(entity source, float floor_dist) ent_floorcheck = +{ + local vector trace_pos1; + local float trace_dist; + + // if (!checkbottom(source)) = disabled + // too expensive, 5 traces (4 corners + center) and liquid check + + // Tracedown directly from origin for floor check + trace_pos1 = source.origin; + trace_pos1_z = trace_pos1_z - FLOOR_TRACE_DIST; + traceline (source.origin, trace_pos1, TRUE, source); + + // Work out distance from origin to floor + trace_dist = source.origin_z - trace_endpos_z; + + // Check if the floor is too far away? (usually 24 units) + if (trace_dist > floor_dist && source.flags & FL_ONGROUND) { + // Move entity up and do a trace/fall down (256 units max) + source.oldorigin = source.origin; + source.origin_z = source.origin_z + 1; + droptofloor(); + if (source.oldorigin != source.origin) { + // lift entity upward and remove onground flag + source.flags = source.flags - (source.flags & FL_ONGROUND); + source.velocity_z = 10 + 10*random(); + // Check for any attachment (lids) for ammo + if (source.classgroup == CG_AMMOITEM && source.attachment) { + // sync flag/velocity so lid falls correctly + source.attachment.flags = source.attachment.flags - (source.attachment.flags & FL_ONGROUND); + source.attachment.velocity = source.velocity; + } + } + // Move item back to original pos before droptofloor + setorigin(source, source.oldorigin); + } +}; + +//====================================================================== +// Check for contact with sky brushes +// - Use pointcontent() for Typical/Enhanced Quake engines +// - Use new FTE string functions and surface check for Darkplaces engine +// +//---------------------------------------------------------------------- +float(vector targ_origin) check_skycontent = +{ + local float surfnum; + local string texturename; + + // Does the engine supports extended surface checks? + if (ext_dpsurf) { + surfnum = getsurfacenearpoint(world, targ_origin); + if (surfnum >= 0) { + texturename = getsurfacetexture(world, surfnum); + if (strncasecmp(texturename, "SKY", 3) == 0) return TRUE; + } + } + else { + // Original method for checking sky content (Fitz engines) + if (pointcontents(targ_origin) == CONTENT_SKY) return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check point content for SOLID or SKY problems +//---------------------------------------------------------------------- +float(vector pc_org) entity_pcontent = +{ + local float pcontent; + pcontent = pointcontents(pc_org); + if (pcontent == CONTENT_SOLID) return TRUE; + if (check_skycontent(pc_org)) return TRUE; + return FALSE; +} + +//====================================================================== +// Updates totals on the HUD (checks for client to exist) +// - Specify which total to update using constant +// - Uses MSG_ONE because it is more reliable across many clients +// - Other client updates (SVC_KILLEDMONSTER, SVC_FOUNDSECRET) +// +//---------------------------------------------------------------------- +void(float hud_item) update_hud_totals = +{ + // Has the client player been setup yet? + if (client_ent && client_ent.flags & FL_CLIENT) { + + // Update total secrets + if (hud_item & HUD_SECRETS) { + msg_entity = client_ent; + WriteByte (MSG_ONE, SVC_UPDATESTAT); + WriteByte (MSG_ONE, STAT_TOTALSECRETS); + WriteLong (MSG_ONE, total_secrets); + } + // Update total monsters + if (hud_item & HUD_MONSTERS) { + msg_entity = client_ent; + WriteByte (MSG_ONE, SVC_UPDATESTAT); + WriteByte (MSG_ONE, STAT_TOTALMONSTERS); + WriteLong (MSG_ONE, total_monsters); + } + } +}; + +//====================================================================== +// Reduce any entity down to a non-interactive empty marker +// +//---------------------------------------------------------------------- +void(entity targ) entity_hide = +{ + targ.use = targ.touch = SUB_Null; // No more touchy + targ.think = SUB_Null; // No more thinking/animation + targ.nextthink = -1; // Never fire think + targ.estate = ESTATE_OFF; // Entity state off + targ.modelindex = 0; // Make sure no model + setmodel (targ, ""); // invisible + targ.takedamage = DAMAGE_NO; // No pain/death triggers + targ.movetype = MOVETYPE_NONE; // Stationary + targ.solid = SOLID_NOT; // no world interaction + setsize (targ, VEC_ORIGIN, VEC_ORIGIN); // No size, no impact + targ.velocity = targ.avelocity = '0 0 0'; // Frozen velocity + targ.spawnflags = targ.effects = 0; // Leave flags alone + targ.waitmin = time + LARGE_TIMER; // Block any touch function +}; + +//---------------------------------------------------------------------- +void(entity targ, float removetime) entity_remove = +{ + if (targ == world) return; + entity_hide(targ); + targ.think = SUB_Remove; + targ.nextthink = time + removetime; +}; + +//====================================================================== +// Show where broken monster/items are located (developer only) +// SPNMARK_YELLOW, SPNMARK_BLUE, SPNMARK_GREEN, +// SPNMARK_RED, SPNMARK_PURPLE, SPNMARK_WHITE +//---------------------------------------------------------------------- +void(vector marker_org, float marker_type) spawn_marker = +{ + local entity brokend; + + if (developer > 0) { + brokend = spawn(); + brokend.classtype = CT_DEVMARKER; + brokend.movetype = MOVETYPE_NONE; + brokend.solid = SOLID_NOT; + setmodel(brokend, MODEL_BROKEN); + setorigin(brokend, marker_org); + setsize (brokend, VEC_ORIGIN, VEC_ORIGIN); + // Setup marker type (skin colour) + // YELLOW = error, BLUE = delay, GREEN = nocount, RED = nightmare + brokend.skin = marker_type; + brokend.frame = 0; + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) brokend.effects = brokend.effects + EF_NOSHADOW; + } +}; + +//---------------------------------------------------------------------- +entity(vector spawn_org) spawn_devmarker = +{ + local entity spawn_ent; + + spawn_ent = spawn(); + spawn_ent.classtype = CT_DEVMARKER; + spawn_ent.movetype = MOVETYPE_NONE; + spawn_ent.solid = SOLID_NOT; + setmodel(spawn_ent, MODEL_BROKEN); + setorigin(spawn_ent, spawn_org); + setsize (spawn_ent, VEC_ORIGIN, VEC_ORIGIN); + return spawn_ent; +}; + +//---------------------------------------------------------------------- +// Check for SKILL spawning conditions (frame 0 check ONLY) +// Returns FALSE = do nothing TRUE = inhibit spawning +//---------------------------------------------------------------------- +float() check_nightmare = +{ + // Check for nightmare skill only spawning + if (self.nightmare == TRUE) { + // Double check the coop console variable, not setup till frame 1+ + // Use a nosave variable to prevent constant cvar command checking + if (skill_cvar != TRUE) { skill = cvar("skill"); skill_cvar = TRUE; } + if (skill == SKILL_NIGHTMARE) return FALSE; + else { + // Check for BSP entities has origin is different + if (self.bsporigin) spawn_marker(bmodel_origin(self), SPNMARK_RED); + else spawn_marker(self.origin, SPNMARK_RED); + // Hide entity instead of removing it + // Because of possible active touch functions + entity_hide(self); + return TRUE; + } + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check for COOP spawning conditions (frame 0 check ONLY) +// Returns FALSE = do nothing TRUE = inhibit spawning +//---------------------------------------------------------------------- +float() check_coop = +{ + // Check for coop only spawning conditions + if (self.cooponly == TRUE || self.cooponly == NEGATIVE) { + // Double check the coop console variable, not setup till frame 1+ + // Use a nosave variable to prevent constant cvar command checking + if (coop_cvar != TRUE) { coop = cvar("coop"); coop_cvar = TRUE; } + + // Only one condition will let a cooponly item spawn + // cooponly = 1 coop = 0 inhibit = TRUE + // cooponly = 1 coop = 1 inhibit = FALSE + // cooponly = -1 coop = 0 inhibit = TRUE + // cooponly = -1 coop = 1 inhibit = TRUE + if (self.cooponly == TRUE && coop == TRUE) return FALSE; + else { + // Check for BSP entities has origin is different + if (self.bsporigin) spawn_marker(bmodel_origin(self), SPNMARK_PURPLE); + else spawn_marker(self.origin, SPNMARK_PURPLE); + // Hide entity instead of removing it + // Because of possible active touch functions + entity_hide(self); + return TRUE; + } + } + return FALSE; +}; + +//====================================================================== +// Clear all trigger strings +// +//---------------------------------------------------------------------- +void (entity targ) clear_trigstrs = +{ + if (targ.target != "") targ.target = string_null; + if (targ.target2 != "") targ.target2 = string_null; + if (targ.killtarget != "") targ.killtarget = string_null; +}; + +//====================================================================== +// Vector randomizer, used mostly for avelocity setups +// Used all over the place; monsters, weapons and gibs! +// +//---------------------------------------------------------------------- +vector(float base, float rndmix, float plusminus) vecrand = +{ + local vector vecmix; + if (plusminus) { + vecmix_x = base + crandom() * rndmix; + vecmix_y = base + crandom() * rndmix; + vecmix_z = base + crandom() * rndmix; + } + else { + vecmix_x = base + random() * rndmix; + vecmix_y = base + random() * rndmix; + vecmix_z = base + random() * rndmix; + } + return vecmix; +}; + +//====================================================================== +// model_fade : Gradually fade out a model over time +// * Optionally entity removal if height = 0 +// +//---------------------------------------------------------------------- +void() model_fade = +{ + self.alpha = 1 - ((time - self.ltime) / 1); + + if (self.alpha > 1) self.alpha = 1; + else if (self.alpha <= 0) { + self.alpha = 0; + self.modelindex = 0; // Make sure no model + self.model = ""; + // Remove model by default + if (!self.height) { + self.think = SUB_Remove; + self.nextthink = time + 1; + } + return; + } + + self.nextthink = time + FADEMODEL_TIME; +}; + diff --git a/QC_other/QC_arcane/targets.qc b/QC_other/QC_arcane/targets.qc new file mode 100644 index 00000000..ad37cb78 --- /dev/null +++ b/QC_other/QC_arcane/targets.qc @@ -0,0 +1,873 @@ +/*====================================================================== + TARGET FUNCTIONS + + Trigger_relay and trigger_count are not triggers, they don't have + any touch functionality and don't even set/use any of the activator + system used by most trigger/func entities. + + These entities are essentially targets that reply on input from other + targets (use) and then use their targets (conditionally). They should + be re-classifed as target_relay and target_count, but it is too late now + for such a change, the opportunity has long gone! + +======================================================================*/ +float TRIG_COUNTNOMESSAGE = 1; // Prevents all count messages +float TRIG_COUNTEXACTNO = 16; // Display exact count number +float TRIG_COUNTSTARTDIS = 32; // Count starts in disabled state + +float TRIG_RANDOMTARGET = 2; // Randomly trigger target/target2 +float TRIG_RELAYSTARTDIS = 32; // trigger_delay starts disabled +float TRIG_EXPLODENOEFF = 2; // No old particle effect +float TRIG_EXPLODEDUST = 4; // Exploding projectile dust +float TRIG_MONKILLDFUNC = 16; // kill monsters via death function + +float TRIG_ENGFITZ = 1; // Fitz engine +float TRIG_ENGDP = 2; // DP engine +float TRIG_ENGFTE = 4; // FTE/QSS engine +float TRIG_ENGRAIN = 16; // Check for rain effects +float TRIG_ENGSNOW = 32; // Check for snow effects + +/*====================================================================== +/*QUAKED trigger_relay (0.5 0 0.5) (-8 -8 -8) (8 8 8) x RANDOM x x x STARTDIS x x Not_Easy Not_Normal Not_Hard +Triggers target(s) with custom sounds and messages +-------- KEYS -------- +targetname : trigger entity +target : targets to trigger when relay is activated +target2 : secondary targets to trigger when activated +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +wait : -1 = will only fire targets once +delay : delay before firing (after being triggered) +cnt : random amount of time to add to delay +waitmin : % random chance between target/target2 +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +RANDOM : Will randomly select between target/target2 +STARTDIS : Will start disabled, will req trigger_entitystate_on to enable +-------- NOTES -------- +This fixed size trigger cannot be touched, it can only be fired by other events. +Can contain killtargets, targets, delays, and messages. + +======================================================================*/ +void() trigger_relay_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + //---------------------------------------------------------------------- + // The Shotgun and Axe upgrades can make maps too easy, allow for + // triggers to not fire if the key is TRUE and inventory empty + //---------------------------------------------------------------------- + if ( other.flags & FL_CLIENT ) { + if (self.upgrade_axe && !(other.moditems & IT_UPGRADE_AXE)) return; + if (self.upgrade_ssg && !(other.moditems & IT_UPGRADE_SSG) ) return; + if (self.upgrade_lg && !(other.moditems & IT_UPGRADE_LG) ) return; + } + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Randomly pick between target/target2 + // SUB_UseTargets will fire both target strings if found + // the random choices need to be stored elsewhere (noise3/4) + if (self.spawnflags & TRIG_RANDOMTARGET) { + if (random() < self.waitmin) self.target = self.noise3; + else self.target = self.noise4; + } + + // One thing to note about trigger_relay is that it does not change the + // activator global variable to the entity that used this trigger last + // This is handy for client test triggers (like trigger_secret) + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() trigger_relay = +{ + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGRELAY; + if (self.delay <= 0) self.delay = 0; + if (self.cnt > 0) self.delay = self.delay + random()*self.cnt; + + // Setup random trigger selection strings and random % + // No checks are done on the target/target so that they can + // be blank and the mapper can randomly select an empty trigger + // only check = The random % has got to exist between 0-1 + if (self.spawnflags & TRIG_RANDOMTARGET) { + if (self.waitmin <=0 || self.waitmin >= 1) self.waitmin = 0.5; + self.noise3 = self.noise4 = ""; // Initialize strings + self.noise3 = self.target; // Copy over strings + self.noise4 = self.target2; + self.target = self.target2 = ""; // Remove originals + } + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_relay_use; + // Setup intial entity state (can start disabled) + if (self.spawnflags & TRIG_RELAYSTARTDIS) self.estate = ESTATE_DISABLE; + else self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_counter (0.5 0 0.1) (-8 -8 -8) (8 8 8) NOMESSAGE x x x EXACTNO STARTDIS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A counter which triggers target(s) when complete +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger target(s) when complete + +message : message to display when complete (ignores NOMESSAGE spawnflag) +startmsg : message to display before counting begins (use wait for pause time) +count : number of triggers needed to fire own target, (def=2) +delay : time delay to fire final trigger event +sounds : 0=silent,1=Secret,2=talk,3=switch,5=custom,6=secret2 +noise : custom sound to play when complete +wait : time to pause before starting to count (def=2s) +-------- SPAWNFLAGS -------- +NOMESSAGE : disables count display +EXACTNO : display exact number when counting down +STARTDIS : Starts disabled and waits for trigger +STARTOFF : Requires trigger to activate +-------- NOTES -------- +A counter which triggers target(s) when complete + +======================================================================*/ +void() trigger_counter_reset = +{ + // Reset counter to initial (spawning) value + self.count = self.height; +}; + +//---------------------------------------------------------------------- +void() trigger_counter_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Check for any pre-count messages + if (self.startmsg != "") { + centerprint (activator, self.startmsg); + self.startmsg = ""; + self.nextthink = time + self.wait; + self.think = self.estate_use; + return; + } + + self.count = self.count - 1; + if (self.count < 0) return; + + // Count down messages for trigger + if (self.count > 0) { + if (activator.flags & FL_CLIENT && !(self.spawnflags & TRIG_COUNTNOMESSAGE) ) { + if (self.count >= 4) { + if (self.spawnflags & TRIG_COUNTEXACTNO) + centerprint3 (activator, "Only ", ftos(self.count), " more to go..."); + else centerprint (activator, "There are more to go..."); + } + else if (self.count == 3) centerprint (activator, "Only 3 more to go..."); + else if (self.count == 2) centerprint (activator, "Only 2 more to go..."); + else centerprint (activator, "Only 1 more to go..."); + } + return; + } + + // Reach zero on counter, time to trigger counter target + if (activator.flags & FL_CLIENT) { + if (self.message2 != "") centerprint(activator, self.message2); + else if ( !(self.spawnflags & TRIG_COUNTNOMESSAGE) ) + centerprint(activator, "Sequence completed!"); + } + + // If sound defined, play sound + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // This is a big problem with the trigger_counter entity, it does not update + // the activator global variable and does not wake up enemies correctly. + // If a trigger_count is targetting monsters then they will not get angry + // at the player, the count has to target a _once or _multi trigger instead. + self.enemy = activator; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() trigger_counter_delay = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Remove the trigger delay function + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Re-route use function to actual counter + self.estate_use = trigger_counter_use; +}; + +//---------------------------------------------------------------------- +void() trigger_counter = +{ + trigger_bmodel_sounds(); // Precache any sounds + if (!self.count) self.count = 2; // default count + self.height = self.count; // Save for later, reset + if (self.wait <= 0) self.wait = 2; // Default pre-message time + self.classtype = CT_TRIGCOUNT; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_reset = trigger_counter_reset; + if (!self.estate) self.estate = ESTATE_ON; + // Check for disable state (need trigger_entityon to work again) + if (self.spawnflags & TRIG_COUNTSTARTDIS) self.estate = ESTATE_DISABLE; + + // The delay function is not switched off, its activate to use + if (self.spawnflags & ENT_STARTOFF) self.estate_use = trigger_counter_delay; + else self.estate_use = trigger_counter_use; +}; + +/*====================================================================== +/*QUAKED trigger_engine (0 0 1) (-8 -8 -16) (8 8 16) FITZ DP FTE x RAIN SNOW x x +Triggers target(s) when certain engine active +-------- KEYS -------- +targetname : trigger entity +target : targets to trigger when relay is activated +wait : -1 = will only fire targets once +delay : delay before firing (after being triggered) +cnt : random amount of time to add to delay +-------- SPAWNFLAGS -------- +FITZ : Only trigger for Fitz engines (default type) +DP : Only trigger for DP engine +FTE : Only trigger for FTE/QSS engines +RAIN : Check for rain effect being active +SNOW : Check for snow effect being active +-------- NOTES -------- +Triggers target(s) when certain engine active + +======================================================================*/ +void() trigger_engine_fire = +{ + // Parameter to check at of tests + self.aflag = FALSE; + + // Check each engine type for conditions + // This trigger will not reset the activator + // Should be done with one of the targets instead + if (self.spawnflags & TRIG_ENGFITZ && engine == ENG_FITZ) self.aflag = TRUE; + else if (self.spawnflags & TRIG_ENGDP && engine == ENG_DPEXT) self.aflag = TRUE; + // Extra check for FTE/QSS (they support DP particles) + else if (self.spawnflags & TRIG_ENGFTE && engine == ENG_DPEXT) { + if (checkextension("FTE_SV_POINTPARTICLES")) self.aflag = TRUE; + } + + if (self.aflag == TRUE) { + // Check for engine weather effects + if (self.spawnflags & TRIG_ENGRAIN && !ext_dprain) self.aflag = FALSE; + if (self.spawnflags & TRIG_ENGSNOW && !ext_dpsnow) self.aflag = FALSE; + // Check for weather being disabled + if (self.spawnflags & (TRIG_ENGRAIN | TRIG_ENGSNOW)) { + if (query_configflag(SVR_WEATHER)) self.aflag = FALSE; + } + + // If engine and/or weather active, fire targets! + if (self.aflag == TRUE) SUB_UseTargets(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_engine_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + + // Check for any trigger delay? + if (self.delay > 0) { + self.think = trigger_engine_fire; + self.nextthink = time + self.delay; + } + else trigger_engine_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_engine = +{ + self.classtype = CR_TRIGENG; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_engine_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_clientmsg (0.5 0.5 0) (-8 -8 -16) (8 8 16) x +Centerprints a message to all clients +-------- KEYS -------- +targetname : trigger entity +message : Text to center print +sounds : 1=Secret,2=talk,3=switch,4=silent(def),5=custom,6=secret2 +noise : custom sound to play when triggered +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Centerprints a message to all clients + +======================================================================*/ +void() trigger_clientmsg_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Write message to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CENTERPRINT); + WriteString (MSG_ALL, self.message); + + // If any sounds defined play them at entity source + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void() trigger_clientmsg = +{ + // Default = the sound of silence! + if (self.sounds == 0) self.sounds = 4; + trigger_bmodel_sounds(); + + // Setup default message + if (self.message == "") self.message = "Default Trigger Message!\n"; + self.classtype = CT_TRIGCLMSG; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_clientmsg_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_cdtrack (0.8 0.5 0) (-8 -8 -16) (8 8 16) x +Change CD track for all clients +-------- KEYS -------- +targetname : trigger entity +count : CD track number (eg. 0-x) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Change CD track for all clients + +======================================================================*/ +void() trigger_cdtrack_change = +{ + // Write CD track to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, trig_cdtrack); + WriteByte (MSG_ALL, trig_cdtrack); +}; + +//---------------------------------------------------------------------- +void() trigger_cdtrack_use = +{ + // Check for entity state system block + if (self.estate & ESTATE_BLOCK) return; + + // Make sure CD track change in savefile + trig_cdtrack = self.count; + + // Write message to all clients + trigger_cdtrack_change(); +}; + +//---------------------------------------------------------------------- +void() trigger_cdtrack = +{ + self.classtype = CT_TRIGCDTRACK; + // Make sure specified cd track is integer number + self.count = fabs(rint(self.count)); + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_cdtrack_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_skybox (0.9 0.9 0.9) (-8 -8 -16) (8 8 16) x +Load/Change Skybox for all clients +-------- KEYS -------- +targetname : trigger entity +message : Skybox name (eg moonrise_) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Load/Change Skybox for all clients + +======================================================================*/ +void(entity targ) trigger_skybox_change = +{ + // Write skybox change to all clients + stuffcmd(targ, "SKY "); + stuffcmd(targ, trig_skybox); + stuffcmd(targ, "\n"); +}; + +//---------------------------------------------------------------------- +void() trigger_skybox_use = +{ + // Check for entity state system block + if (self.estate & ESTATE_BLOCK) return; + + // Check for client trigger first + if (activator.classtype == CT_PLAYER) self.enemy = activator; + + // Find a player for the stuff command + if (!self.enemy) { + self.enemy = find(world,targetname,"player"); + if (self.enemy.classtype != CT_PLAYER) return; + } + + // Write skybox name to all clients + trig_skybox = self.message; + trigger_skybox_change(self.enemy); +}; + +//---------------------------------------------------------------------- +void() trigger_skybox = +{ + self.classtype = CT_TRIGSKYBOX; + if (self.message == "") self.message = "Sky"; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_skybox_use; + self.estate = ESTATE_ON; +}; +/*====================================================================== +/*QUAKED trigger_itemrespawnupd (0.5 0 0.5) (-8 -8 -16) (8 8 16) x x x x RESPAWN x x x +Change the state of respawn flag on items +-------- KEYS -------- +targetname : trigger entity +target : this points to the item to affect +-------- SPAWNFLAGS -------- +RESPAWN : Value of respawn flag to copy to item +-------- NOTES -------- +Change the state of respawn flag on items +Useful for switching off respawning items after arena fight is over + +======================================================================*/ +void() trigger_itemrespawnupd_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Loop around target(s) and update respawn flag + self.enemy = find (world, targetname, self.target); + while(self.enemy) { + // only work with active items + if (self.enemy.flags & FL_ITEM) { + if (self.spawnflags & ITEM_RESPAWN) { + self.enemy.spawnflags = self.enemy.spawnflags | ITEM_RESPAWN; + } + else { + // Remove respawn flag (even if missing) + self.enemy.spawnflags = self.enemy.spawnflags - (self.enemy.spawnflags & ITEM_RESPAWN); + } + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() trigger_itemrespawnupd = +{ + self.classtype = CT_TRIGITEMFLAG; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_itemrespawnupd_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +QUAKED trigger_monstermovespeed (0.5 0 0.5) (-8 -8 -16) (8 8 16) x +Toggle the monster move speed state +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : this points to the monster(s) to affect +state : -1 = No movement, 0 = Toggle, 1 = Free movement +wait : -1 = trigger once only +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Toggle the monster move speed state + +======================================================================*/ +void() trigger_monstermovespeed_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Loop around target(s) and update move speed + self.enemy = find (world, targetname, self.target); + while(self.enemy) { + // only work with living monsters (ignore rest) + if (self.enemy.flags & FL_MONSTER && self.enemy.health > 0) { + // Is the state a toggle or exact update? + if (self.state == 0) { + if (self.enemy.movespeed < 1) self.enemy.movespeed = 1; + else self.enemy.movespeed = -1; + } + // Exact value update + else self.enemy.movespeed = self.state; + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } + + // Trigger once functionality? + if (self.wait < 0) self.estate = ESTATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trigger_monstermovespeed = +{ + self.classtype = CT_TRIGMONMOVE; + if (self.target == "") { + dprint("\b[MON_MOVESPEED]\b No target set, removing\n"); + remove(self); + } + + // make sure state has the correct values + if (self.state < -1 || self.state > 1) self.state = 0; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monstermovespeed_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_monsterkill (0.5 0 0.5) (-8 -8 -16) (8 8 16) x x x x DEATH x x x +Remove monster(s) from the map +-------- KEYS -------- +targetname : Name of this trigger entity +target : Name of monster(s) to remove/stop +-------- SPAWNFLAGS -------- +DEATH : kill monsters via death function +-------- NOTES -------- +Remove monster(s) from the map + +======================================================================*/ +void() trigger_monsterkill_use = +{ + if (self.estate & ESTATE_BLOCK) return; + // This only works once! + self.use = SUB_Null; + + // Loop around target(s) and remove the game + self.enemy = find (world, targetname, self.target); + while(self.enemy) { + // There are always exceptions to the use of the monster flag + // Point Hell knights don't use monster flag to prevent damage! + if (self.enemy.spawnflags & MON_POINT_KNIGHT && self.enemy.health > 0) + self.enemy.flags = self.enemy.flags | FL_MONSTER; + + // only work with monsters, can't be dead, dying or negative health! + if (self.enemy.flags & FL_MONSTER && self.enemy.health > 0 && !self.enemy.deadflag) { + // Check if death function is required for monster + // Also double check they have a death function setup! + if (self.spawnflags & TRIG_MONKILLDFUNC && self.enemy.th_die) { + self.enemy.takedamage = DAMAGE_YES; + // Always do enough damage to kill the monster + // Can be a problem for ammo resistant + T_Damage (self.enemy, self, self, self.enemy.health+1, NOARMOR); + } + else { + self.enemy.deadflag = DEAD_DEAD; + self.enemy.enemy = world; + self.enemy.health = self.enemy.gibhealth; + + // If a monster marked with no monster count dies + // update HUD totals to reflect death properly + if (self.enemy.nomonstercount) { + total_monsters = total_monsters + 1; + update_hud_totals(HUD_MONSTERS); + } + // Update global monster death totals + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + + // Stop all animation think functions + self.enemy.think = SUB_Null; + self.enemy.nextthink = time + LARGE_TIMER; + // Finally stop and hide all models + // Should not remove monster, it might have dependancies + entity_hide(self.enemy); + entity_remove(self.enemy.attachment, 0.1); + entity_remove(self.enemy.attachment2, 0.1); + entity_remove(self.enemy.attachment3, 0.1); + } + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterkill = +{ + self.classtype = CT_TRIGMONKILL; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monsterkill_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_monsterattack (0.5 0 0.5) (-8 -8 -16) (8 8 16) x +Force a monster to attack a certain target +-------- KEYS -------- +targetname : Name of this trigger entity +target : Name of monster to affect +target2 : Name of entity to attack +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Force a monster to attack a certain target + +======================================================================*/ +void() trigger_monsterattack_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Find target monster first and see if alive? + self.enemy = find (world, targetname, self.target); + // only work with monsters, can't be dead, dying or negative health! + if (self.enemy.flags & FL_MONSTER && self.enemy.health > 0) { + self.oldenemy = find(world, targetname, self.target2); + // Check if attacking target is alive and can be damaged? + if (self.oldenemy.health > 0 && self.oldenemy.takedamage != DAMAGE_NO) { + // Setup monster to attack new target (use damage function) + T_Damage (self.enemy, self.oldenemy, self.oldenemy, 1, NOARMOR); + } + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterattack = +{ + self.classtype = CT_TRIGMONATT; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monsterattack_use; + self.estate = ESTATE_ON; +}; + +//====================================================================== +// General purpose sprite+particle explosion +// Entity is fired once (default) +//====================================================================== +/*QUAKED trigger_explode (.8 .5 .5) (-4 -4 -4) (4 4 4) x EXPLODENOEFF DUST +Triggered entity producing damage + sprite explosion +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +dmg : explosive radius damage (def=40, -1=no damage) +delay : time delay to explosion (def=0s) +noise : string name for explosion sound (def=weapons/r_exp3b.wav) +wait : re-trigger explosions (def=-1 trigger once) +style : 0=Explosion, 1=Plasma, 2=Poison, 3=Electric, 4=Burst (Smoke/Flame/Poison) +height : 0=Small, 1=Medium, 2=Large, -1=Random +count : Random amount of dust particles to spawn (1-x) +pos1 : Base dust velocity (X=Forward, Y=Right, Z=Up) +pos2 : Random dust velocity (X=Forward, Y=Right, Z=Up) +-------- SPAWNFLAGS -------- +EXPLODENOEFF : no old school particle explosion +DUST : Dust particle explosion (use angle for direction) +-------- NOTES -------- +Triggered entity producing damage + sprite explosion + +=============================================================================*/ +void() trig_explode_fire = +{ + // Dust particles are empty models with rocket smoke trails + if (self.spawnflags & TRIG_EXPLODEDUST) { + // Setup direction of projectile + makevectors(self.angles); + // Always spawn at least 1 dust particle + self.lip = 1 + rint(random() * self.count); + while (self.lip > 0) { + // Keep spawning temporary entities + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_PROJ_SMOKE); + + // Randomize the origin of the particles + self.oldorigin = self.origin + (v_right*(crandom()*self.pos1_y)); + setorigin(newmis, self.oldorigin); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + // Use pos1+pos2 vector (calculated from angles) + self.pos3_x = self.pos1_x + ( random() * self.pos2_x ); + self.pos3_y = crandom() * (self.pos1_y + ( random() * self.pos2_y )); + self.pos3_z = self.pos1_z + ( random() * self.pos2_z ); + newmis.velocity = (v_forward*self.pos3_x) + (v_right*self.pos3_y) + (v_up*self.pos3_z); + + // Setup removal and keep counting + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; + self.lip = self.lip - 1; + } + // No damage or sprites needed + return; + } + + // create any explosive radius damage + if (self.dmg > 0) T_RadiusDamage (self, self, self.dmg, self, DAMAGEALL); + + // Check for old particle effect + if ( !(self.spawnflags & TRIG_EXPLODENOEFF) ) { + // classic ID explosion + if (self.style == 0) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + // New Rogue extension - Blue + else if (self.style == 1) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 39); // Blue 32 + 7 + WriteByte (MSG_BROADCAST, 8); // Colour range + } + // New Rogue extension - Green + else if (self.style == 2) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 55); // Green 48 + 7 + WriteByte (MSG_BROADCAST, 8); // Colour range + } + } + + // Check for randomly sized explosion type + if (self.height == -1) self.lip = rint(0.5+ random() * 2.5); + else self.lip = rint(self.height); + // Work out explosion type offset + self.lip = self.lip + rint(self.style) * 10; + + // Use global function (Fitz/DP aware) + SpawnExplosion(self.lip, self.origin, self.noise); +}; + +//---------------------------------------------------------------------- +void() trig_explode_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Check for Trigger once setting + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + + // Check for explosion delay or straight away blow up + if (self.delay > 0) { + self.nextthink = time + self.delay; + self.think = trig_explode_fire; + } + else trig_explode_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_explode = +{ + // Default settings + self.classtype = CT_TRIGEXPLODE; + if (self.dmg >= 0) self.dmg = DAMAGE_MONROCKET; + if (self.wait == 0) self.wait = -1; + if (self.height == 0 || self.height > 3) self.height = 1; + if (self.style < 0 || self.style > 4) self.style = 0; + self.attack_finished = 0; + + if (self.noise == "") { + if (self.style == 3) self.noise = SOUND_PLASMA_HIT; + else if (self.style == 4) self.noise = SOUND_RESIST_ROCKET; + else self.noise = SOUND_REXP3; // Default + } + precache_sound (self.noise); + + // Precache smoke particles and set default movement + if (self.spawnflags & TRIG_EXPLODEDUST) { + precache_model(MODEL_PROJ_SMOKE); + if (CheckZeroVector(self.angles)) self.angles_y = 360; + if (CheckZeroVector(self.pos1)) self.pos1 = '100 25 100'; + if (CheckZeroVector(self.pos2)) self.pos2 = '100 25 100'; + } + + // Burst Sprites are NOT precached in world.qc + if (self.style == 4) { + // Check for random selection + if (self.height == -1) { + precache_model(SBURST_SMOKE); + precache_model(SBURST_FLAME); + precache_model(SBURST_POISON); + } + else if (self.height == 1) precache_model(SBURST_SMOKE); + else if (self.height == 2) precache_model(SBURST_FLAME); + else precache_model(SBURST_POISON); + } + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trig_explode_use; + self.estate = ESTATE_ON; +}; diff --git a/QC_other/QC_arcane/traps.qc b/QC_other/QC_arcane/traps.qc new file mode 100644 index 00000000..588b3e90 --- /dev/null +++ b/QC_other/QC_arcane/traps.qc @@ -0,0 +1,693 @@ +/*====================================================================== + TRAP SHOOTERS +======================================================================*/ +float TRAP_SNGSPIKE = 1; // Large SNG spikes (high damage) +float TRAP_LASER = 2; // Enforcer style lasers +float TRAP_WIZSPIKE = 4; // Wizard Acid spit spike +float TRAP_HELLSPIKE = 8; // Hell Knight Fire spikes +float TRAP_LARGEGRENADE = 1; // Player grenades (high damage) +float TRAP_LAVAROCKET = 1; // Slow moving Cthton lava ball +float TRAP_FIREROCKET = 2; // Fast moving Gargoyle fireball +float TRAP_JIMROCKET = 4; // Low damage player rocket +float TRAP_LIGHTLARGE = 1; // Cthton Lightning effect +float TRAP_LIGHTDUST = 8; // Dust/Smoke effects at impact +float TRAP_LIGHTPART = 16; // Particle effects at impact + +float TRAP_GASSTEAM = 1; // Gas particle types (default) +float TRAP_GASFIRE = 2; +float TRAP_GASPOISON = 4; +float TRAP_GASSILENT = 16; // No particle sound effects + +float TRAP_TOGGLE = 32; // Toggle function with triggered +float TRAP_TRACKING = 128; // Keep updating the target position + +/*====================================================================== +/*QUAKED trap_spikeshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) SNG LASER WIZARD HELLK x TOGGLE x TRACK +When triggered, fires a SPIKE in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for projectile to follow, use "360" for angle 0 +wait : time between projectiles (def=0s) +delay : random time between projectile (def=0s) +count : = 1 Continuous mode (toggle/trigger to switch off) +speed : Change projectile speed (def/sng=500, laser=600, wiz=500, hell=300) +-------- SPAWNFLAGS -------- +SNG : shoots large spike (SNG damage) +LASER : shoots laser (Enforcer damage) +WIZARD : shoots acid spike (Wizard damage) +HELLK : shoots fire spike (Hell Knight damage) +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a SPIKE in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_tracking = +{ + if (self.target == "") return; + if (!self.movetarget) + self.movetarget = find(world, targetname, self.target); + + if (self.movetarget) { + // Check for a Bmodel object (special origin) + if (self.movetarget.bsporigin) self.dest1 = bmodel_origin(self.movetarget); + else self.dest1 = self.movetarget.origin; + // Calculate facing angle towards target + self.movedir = normalize(self.dest1 - self.origin); + } +}; + +//---------------------------------------------------------------------- +void() trap_shooter_fire = +{ + local vector lightn_start, lightn_finish; + + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) self.state = STATE_OFF; + if (self.state == STATE_OFF) return; + + // Check for any target entity tracking changes + if (self.spawnflags & TRAP_TRACKING) trap_tracking(); + + // Fire projectile sound + if (self.classtype == CT_LIGHTSHOOTER) { + // Time for a new LG hit sound? + if (self.t_width < time) { + // Lower volume and attenuation just in case of several together + sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + self.t_width = time + 0.6; + } + } + else if (self.noise != "") + sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + + // Determine type of projectile shooter + if (self.classtype == CT_SPIKESHOOTER) { + launch_projectile (self.origin, self.movedir, self.classproj ,self.speed); + } + else if (self.classtype == CT_GRENADESHOOTER) { + self.finaldest = self.movedir * self.speed; + self.finaldest_z = ELEV_ZAXIS; + self.finalangle = vecrand(100,200,FALSE); + Launch_Grenade(self.origin, self.finaldest, self.finalangle, self.classproj); + } + else if (self.classtype == CT_ROCKETSHOOTER) { + if (self.spawnflags == TRAP_LAVAROCKET) self.finalangle = vecrand(100,200,FALSE); + else self.finalangle = '0 0 0'; + Launch_Missile (self.origin, self.movedir, self.finalangle, self.classproj, self.speed); + } + else if (self.classtype == CT_LIGHTSHOOTER) { + // Double check a destination origin exists + if (CheckZeroVector(self.dest1)) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + + // setup any random X/Y/Z start/end point wobble + lightn_start = lightn_finish = '0 0 0'; + if (CheckZeroVector(self.pos1) == FALSE) { + lightn_start_x = self.pos1_x * crandom(); + lightn_start_y = self.pos1_y * crandom(); + lightn_start_z = self.pos1_z * crandom(); + } + lightn_start = lightn_start + self.origin; + if (CheckZeroVector(self.pos2) == FALSE) { + lightn_finish_x = self.pos2_x * crandom(); + lightn_finish_y = self.pos2_y * crandom(); + lightn_finish_z = self.pos2_z * crandom(); + } + lightn_finish = lightn_finish + self.dest1; + + // trace a line from trap in direction or an exact end point + traceline(lightn_start, lightn_finish, TRUE, self); + + // Check for particle effects at impact + // Designed to spray dust back towards source origin + if (self.spawnflags & TRAP_LIGHTDUST && random() < 0.7) { + // Classic temporary entity + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_PROJ_SMOKE); + setorigin(newmis, trace_endpos); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + // Work out vector between source and target + self.pos3 = normalize(lightn_finish - lightn_start); + // Convert vector to angle so v_forward/v_right correct + self.pos3 = vectoangles(self.pos3); + makevectors(self.pos3); + + // Randomize the X/Y and push the vector back to source + newmis.velocity = (crandom()*v_right)*150 + v_forward*(150+random()*300); + + // Temporary ents, quickly remove afterward + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; + } + if (self.spawnflags & TRAP_LIGHTPART) + particle_explode(trace_endpos, 5+random()*5, 1, PARTICLE_BURST_BLUE, PARTICLE_BURST_LOSTUP); + + // Generate the lightning effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, self.lip); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, lightn_start_x); + WriteCoord (MSG_BROADCAST, lightn_start_y); + WriteCoord (MSG_BROADCAST, lightn_start_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + // Check for things to damage in between the two points + LightningDamage (lightn_start, trace_endpos, self, self.dmg); + } + + // Check for temporary continuous mode + if (self.waitmin > 0 && time < self.pausetime) { + self.think = trap_shooter_fire; + self.nextthink = time + self.waitmin2; + } + else { + // Continuous mode? + if (self.spawnflags & TRAP_TOGGLE) { + self.think = trap_shooter_fire; + self.nextthink = time + self.wait + random()*self.delay; + } + // Fire once and switch off + else self.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() trap_shooter_use = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) return; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Toggle shooter on/off + if (self.state == STATE_OFF) { + self.state = STATE_ON; + if (self.waitmin > 0) self.pausetime = time + self.waitmin; + if (!self.waitmin2) self.waitmin2 = 0.1; + } + else self.state = STATE_OFF; + + trap_shooter_fire(); +}; + +//---------------------------------------------------------------------- +// Vanilla ID QC Hack +void() spikeshooter_use = {}; + +//---------------------------------------------------------------------- +void() trap_shooter_reset = +{ + self.estate = ESTATE_ON; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_spikeshooter = +{ + if (self.spawnflags & TRAP_SNGSPIKE) { + self.mdl = MODEL_PROJ_SNG; + self.noise = "weapons/spike2.wav"; + self.classproj = CT_PROJ_SNG; + if (!self.speed) self.speed = SPEED_TRAPSPIKE; + } + else if (self.spawnflags & TRAP_LASER) { + self.mdl = MODEL_PROJ_LASER; + self.noise = "enforcer/enfire.wav"; + self.classproj = CT_PROJ_LASER; + if (!self.speed) self.speed = SPEED_LASER; + // Used for impact sound of laser + precache_sound ("enforcer/enfstop.wav"); + } + else if (self.spawnflags & TRAP_WIZSPIKE) { + self.mdl = MODEL_PROJ_WIZ; + self.noise = "weapons/spike2.wav"; + self.volume = 0.5; + self.classproj = CT_PROJ_WIZ; + if (!self.speed) self.speed = SPEED_WIZSPIKE; + } + else if (self.spawnflags & TRAP_HELLSPIKE) { + self.mdl = MODEL_PROJ_HKN; + self.noise = "weapons/spike2.wav"; + self.volume = 0.5; + self.classproj = CT_PROJ_HKN; + if (!self.speed) self.speed = SPEED_HKSPIKE; + } + else { + self.mdl = MODEL_PROJ_NG; + self.noise = "weapons/spike2.wav"; + self.classproj = CT_PROJ_NG; + if (!self.speed) self.speed = SPEED_TRAPSPIKE; + } + precache_model (self.mdl); + precache_sound (self.noise); + + self.classtype = CT_SPIKESHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 1; + self.mangle = self.angles; + SetMovedir (); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; + +/*====================================================================== +/*QUAKED trap_grenadeshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) LARGE x x x x TOGGLE x TRACK Not_Easy Not_Normal Not_Hard Not_DM +When triggered, fires a GRENADE in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for projectile to follow, use "360" for angle 0 +wait : time between projectiles (def=0s) +delay : random time between projectile (def=0s) +speed : Change projectile speed (def=500, large=600) +-------- SPAWNFLAGS -------- +LARGE : shoots high damage grenade (Player damage, def=ogre) +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a GRENADE in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_grenadeshooter = +{ + self.mdl = MODEL_PROJ_GRENADE; + precache_model (self.mdl); + self.noise = "weapons/grenade.wav"; + precache_sound (self.noise); + + if (self.spawnflags & TRAP_LARGEGRENADE) { + self.classproj = CT_PROJ_GL; + if(!self.speed) self.speed = SPEED_PLAYGRENADE; + } + else { + self.classproj = CT_PROJ_GLMON; + if(!self.speed) self.speed = SPEED_PLAYGRENADE; + } + + self.classtype = CT_GRENADESHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 1; + self.mangle = self.angles; + SetMovedir (); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; + +/*====================================================================== +/*QUAKED trap_rocketshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) LAVA FIRE JIM x x TOGGLE x TRACK Not_Easy Not_Normal Not_Hard Not_DM +When triggered, fires a ROCKET in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for projectile to follow, use "360" for angle 0 +wait : time between projectiles (def=0s) +delay : random time between projectile (def=0s) +speed : Change projectile speed (def=1000, lava=300, fire=500) +-------- SPAWNFLAGS -------- +LAVABALL : shoots Chthon lava ball (Player damage) +FIREBALL : shoots Gargoyle fire ball (low damage) +JIM FLYER: shoots Jim rocket (low damage) +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a ROCKET in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_rocketshooter = +{ + if (self.spawnflags & TRAP_LAVAROCKET) { + self.mdl = MODEL_PROJ_LAVA; + precache_model (self.mdl); + self.noise = "boss1/throw.wav"; + precache_sound (self.noise); + + self.classproj = CT_PROJ_LAVA; + if (!self.speed) self.speed = SPEED_LAVABALL; + } + else if (self.spawnflags & TRAP_FIREROCKET) { + self.mdl = MODEL_PROJ_GARGOYLE; + precache_model (self.mdl); + self.noise = "gargoyle/attack1.wav"; + precache_sound (self.noise); + + self.classproj = CT_PROJ_GARG; + if (!self.speed) self.speed = SPEED_GARGMISSILE; + } + else if (self.spawnflags & TRAP_JIMROCKET) { + self.mdl = MODEL_PROJ_ROCKET; + precache_model (self.mdl); + self.noise = "weapons/sgun1.wav"; + precache_sound (self.noise); + precache_sound ("jim/rocket_hit.wav"); + + self.classproj = CT_PROJ_JIM2; + if (!self.speed) self.speed = SPEED_RLPLAYER; + } + else { + self.mdl = MODEL_PROJ_ROCKET; + precache_model (self.mdl); + self.noise = "weapons/sgun1.wav"; + precache_sound (self.noise); + + self.classproj = CT_PROJ_ROCKET; + if (!self.speed) self.speed = SPEED_RLPLAYER; + } + + self.classtype = CT_ROCKETSHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 1; + self.mangle = self.angles; + SetMovedir (); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; + +/*====================================================================== +/*QUAKED trap_lightningshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) LARGE x x DUST PART TOGGLE x TRACK +When triggered, fires a LIGHTNING at the target entity (can be blocked) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for destination (required) +wait : time between projectiles (def=1s) +delay : random time between projectile (def=0s) +volume : Lightning hit sound volume (def=0.75) +dmg : Damage from lightning strike (def=15, large=30) +pos1 : Random XYZ wobble to source position +pos2 : Random XYZ wobble to target position +-------- SPAWNFLAGS -------- +LARGE : Cthton Boss Lightning +DUST : Produce dust/smoke at point of impact +PARTICLE: Produce particles at point of impact +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a LIGHTNING at the target entity (can be blocked) +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_lightningshooter = +{ + self.noise = "weapons/lhit.wav"; + precache_sound (self.noise); + + self.classtype = CT_LIGHTSHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 0.75; + self.t_width = 0; // Light sound timer + + // Sort out lightning damage + if (self.dmg < 1) { + self.dmg = 15; + // Double for large lightning + if (self.spawnflags & TRAP_LIGHTLARGE) self.dmg = 30; + } + + // Work out which lightning bolt to use + if (self.spawnflags & TRAP_LIGHTLARGE) self.lip = TE_LIGHTNING3; + else self.lip = TE_LIGHTNING2; + + // Must have target for destination of lightning + if (self.target == "") { + dprint("\b[TRAP]\b Lightning trap missing target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // Find target once everything has spawned + self.nextthink = time + 1 + random(); + self.think = trap_tracking; +}; + +//====================================================================== +/*QUAKED trap_gasshooter (0 .5 .8) (-8 -8 -8) (8 8 8) STEAM FIRE POISON x SILENT TOGGLE x TRACK +When triggered, fires a gas particle in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for stream to follow, use "360" for angle 0 +wait : time between particles (def=0.05s) +speed : velocity speed (def=200) +waitmin: auto switch off timer (def=0.5s) +dmg : damage from contact with particles (def=1) +-------- SPAWNFLAGS -------- +STEAM : White hot clouds of steam (default) +FIRE : Will add burning debuff to player +POISON : Will add poison debuff to player +SILENT : No on/off sound, its silent! +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a gas particle in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_gasshooter_touch = +{ + if (other == self.owner) return; + if (other.solid == SOLID_TRIGGER) return; + if (other.health < 1) return; + if (other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + if (other.classtype == self.owner.classtype) return; + + self.attack_finished = time + 1; + + // Check contact is a player? + if (other.flags & FL_CLIENT) { + // Check for debuff particle type first + if (self.owner.spawnflags & TRAP_GASFIRE) + ApplyFireDmg(other, self.owner.dmg, self.owner.dmg); + else if (self.owner.spawnflags & TRAP_GASPOISON) + PoisonDeBuff(other); + else T_Damage (other, self, self, self.owner.dmg, NOARMOR); + } + // Monsters have special damage to kill them quicker + else if (other.flags & FL_MONSTER) T_Damage (other, self, self, DAMAGE_MONFLAME, NOARMOR); + else T_Damage (other, self, self, self.owner.dmg, NOARMOR); + self.velocity = '0 0 0'; +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_think = +{ + self.cnt = self.cnt + 1; + if (self.cnt > 6) remove(self); + else { + self.frame = self.cnt; + self.nextthink = time + 0.1 + random() * 0.05; + } +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_spawn = +{ + local entity partemit; + + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) self.state = STATE_OFF; + if (self.state == STATE_OFF) return; + + // Check for any target entity tracking changes + if (self.spawnflags & TRAP_TRACKING) trap_tracking(); + + partemit = spawn(); + partemit.classtype = CT_TEMPSTREAM; + partemit.owner = self; + partemit.frame = partemit.cnt = 0; + + partemit.movetype = MOVETYPE_FLY; // Fly, no gravity, but contact + partemit.solid = SOLID_TRIGGER; // collision, touch required + setmodel (partemit, self.mdl); + setorigin (partemit, self.origin); + setsize (partemit, VEC_ORIGIN, VEC_ORIGIN); + + partemit.oldorigin = vecrand(0,20,TRUE); + partemit.velocity = (self.movedir * self.speed) + partemit.oldorigin; + partemit.angles_z = random() * 360; + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) partemit.effects = partemit.effects + EF_NOSHADOW; + + partemit.nextthink = time + 0.1 + random() * 0.05; + partemit.think = trap_gasshooter_think; + partemit.touch = trap_gasshooter_touch; + + // Continuous mode or auto switch off mode still on? + if (self.spawnflags & TRAP_TOGGLE || self.waitmin2 > time) { + self.think = trap_gasshooter_spawn; + self.nextthink = time + self.wait; + } + // Time to switch off + else { + self.state = STATE_OFF; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_off = +{ + self.estate = ESTATE_OFF; + // If gas shooter currently on, play switch off sound + if (self.state == STATE_ON) + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_reset = +{ + self.estate = ESTATE_ON; + // clear any sounds playing + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_on = +{ + self.estate = ESTATE_ON; + self.state = STATE_ON; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.waitmin2 = time + self.waitmin; + trap_gasshooter_spawn(); +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_use = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) return; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Toggle shooter on/off + if (self.state == STATE_ON) { + self.state = STATE_OFF; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + } + else trap_gasshooter_on(); +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter = +{ + if (self.spawnflags & TRAP_GASFIRE) { + self.mdl = SBURST_FLAME; + self.noise1 = "traps/flame_loop.wav"; + self.noise2 = "traps/flame_off.wav"; + } + else if (self.spawnflags & TRAP_GASPOISON) { + self.mdl = SBURST_POISON; + self.noise1 = "traps/steam_loop.wav"; + self.noise2 = "traps/steam_off.wav"; + } + else { + // Steam particles is the default + self.spawnflags = self.spawnflags | TRAP_GASSTEAM; + self.mdl = SBURST_STEAM; + self.noise1 = "traps/steam_loop.wav"; + self.noise2 = "traps/steam_off.wav"; + } + + if (self.spawnflags & TRAP_GASSILENT) { + self.noise1 = SOUND_EMPTY; + self.noise2 = SOUND_EMPTY; + } + precache_model (self.mdl); + precache_sound (self.noise1); + precache_sound (self.noise2); + + self.classtype = CT_GASSHOOTER; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + + if (!self.dmg) self.dmg = 1; + if (self.speed < 1) self.speed = 200; + if (self.wait <0.05) self.wait = 0.05; + if (self.waitmin <=0) self.waitmin = 0.5; + + // Does not auto switch off anymore + if (self.spawnflags & TRAP_TOGGLE) self.waitmin = LARGE_TIMER; + + // setup any angle direction + if (self.angles_y == 0) self.angles_y = 360; + self.mangle = self.angles; + SetMovedir(); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_gasshooter_use; + self.estate_reset = trap_gasshooter_reset; + self.estate_off = trap_gasshooter_off; + self.estate_on = trap_gasshooter_on; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; diff --git a/QC_other/QC_arcane/traps_pendulum.qc b/QC_other/QC_arcane/traps_pendulum.qc new file mode 100644 index 00000000..58b164a8 --- /dev/null +++ b/QC_other/QC_arcane/traps_pendulum.qc @@ -0,0 +1,423 @@ +/*====================================================================== + TRAP PENDULUM +======================================================================*/ +float PEND_MAXFRAME = 12; // Frames 0-12 +float PEND_ANIMGROUP = 13; // Size of animation group +float PEND_MIDFRAME = 7; // Fastest think frame + +float PEND_REVERSE = 1; // Start at frame 12 instead of 0 +float PEND_ONESWING = 2; // Do one swing cycle and stop (back+forth) +float PEND_SHORT = 16; // Short pole version (128 instead of 192) +float PEND_XSWING = 32; // Swing X axis (def=Y) + +//---------------------------------------------------------------------- +// The array is setup from world.qc before anything loads +//---------------------------------------------------------------------- +vector pend_X[26], pend_Y[26], pend_short[26]; + +//---------------------------------------------------------------------- +// As the pendulum swings the bounding box is adjusted around the blade +// Some swings have the bbox ahead of the blade to catch impacts better +// bbox values taken from the original pendulum from Rogue mission pack +// Using view_ofs because the model has been rebuilt/reskinned +//---------------------------------------------------------------------- +void() pendulum_setuparray = +{ + local float loopc, loopd, tempx; + local vector tbuffer; + + pend_Y[0] = '-8 -176 48'; pend_Y[1] = '8 -120 128'; + pend_Y[2] = '-8 -172 12'; pend_Y[3] = '8 -112 88'; + pend_Y[4] = '-8 -160 -22'; pend_Y[5] = '8 -96 50'; + pend_Y[6] = '-8 -138 -51'; pend_Y[7] = '8 -70 17'; + pend_Y[8] = '-8 -110 -72'; pend_Y[9] = '8 -38 -8'; + pend_Y[10] = '-8 -76 -83'; pend_Y[11] = '8 0 -23'; + pend_Y[12] = '-8 -40 -88'; pend_Y[13] = '8 40 -32'; + pend_Y[14] = '-8 0 -83'; pend_Y[15] = '8 76 -23'; + pend_Y[16] = '-8 38 -72'; pend_Y[17] = '8 100 -8'; + pend_Y[18] = '-8 70 -51'; pend_Y[19] = '8 138 17'; + pend_Y[20] = '-8 96 -22'; pend_Y[21] = '8 160 50'; + pend_Y[22] = '-8 112 12'; pend_Y[23] = '8 172 88'; + pend_Y[24] = '-8 120 48'; pend_Y[25] = '8 176 128'; + + // 128 unit pendulum - Y Swing (default) + pend_short[0] = '0 64 -108'; pend_short[1] = '0 56 -92'; + pend_short[2] = '0 56 -76'; pend_short[3] = '0 48 -60'; + pend_short[4] = '0 36 -52'; pend_short[5] = '0 16 -44'; + pend_short[6] = '0 0 -44'; pend_short[7] = '0 -16 -44'; + pend_short[8] = '0 -32 -52'; pend_short[9] = '0 -48 -60'; + pend_short[10] = '0 -56 -76'; pend_short[11] = '0 -56 -92'; + pend_short[12] = '0 -64 -108'; + + loopc = loopd = 0; + + while (loopc < PEND_ANIMGROUP) { + // Generate X axis vector offset from Y axis data (short pendulum) + tbuffer = pend_short[loopc]; // Read vector offset + tempx = tbuffer_x; // Tempoary store + tbuffer_x = tbuffer_y; // Swap around + tbuffer_y = tempx; // Restore temp + pend_short[PEND_ANIMGROUP + loopc] = tbuffer; + + // Generate X axis swing min/max vector from Y axis data + tbuffer = pend_Y[loopd]; // min bbox + tempx = tbuffer_x; + tbuffer_x = tbuffer_y; + tbuffer_y = tempx; + pend_X[loopd] = tbuffer; + tbuffer = pend_Y[loopd+1]; // max bbox + tempx = tbuffer_x; + tbuffer_x = tbuffer_y; + tbuffer_y = tempx; + pend_X[loopd+1] = tbuffer; + + loopc = loopc + 1; + loopd = loopd + 2; + } +}; + +//---------------------------------------------------------------------- +// The original rogue pendulum adjusted the bbox every animation frame +// FTEQCC supports arrays and the previous method can now be done easier +// Also sets the nextthink time to adjust for swing momentum +//---------------------------------------------------------------------- +void(float frame_seq) trap_pendsize = { + self.cnt = frame_seq * 2; + + // Short pendulum needs a different offset each frame + if (self.spawnflags & PEND_SHORT) { + if (self.spawnflags & PEND_XSWING) self.view_ofs = pend_short[PEND_ANIMGROUP+frame_seq]; + else self.view_ofs = pend_short[frame_seq]; + } + + // X/Y swing axis have different bbox vectors + if (self.spawnflags & PEND_XSWING) { + self.pos1 = pend_X[self.cnt] + self.view_ofs; + self.pos2 = pend_X[self.cnt + 1] + self.view_ofs; + } + else { + self.pos1 = pend_Y[self.cnt] + self.view_ofs; + self.pos2 = pend_Y[self.cnt + 1] + self.view_ofs; + } + setsize( self, self.pos1, self.pos2 ); + + if (self.think) { + // Change nextthink time to simulate the pendulum going fast/slow from momentum + self.cnt = 0.05 + (fabs(PEND_MIDFRAME - (frame_seq + 1)) * 0.02); + self.nextthink = time + self.cnt; + } +}; + +//---------------------------------------------------------------------- +// Pendulum animation frames +//---------------------------------------------------------------------- +$frame pend_frame1 pend_frame2 pend_frame3 pend_frame4 pend_frame5 pend_frame6 pend_frame7 +$frame pend_frame8 pend_frame9 pend_frame10 pend_frame11 pend_frame12 pend_frame13 + +// Stationary idle for beginning and ending +void() pend_idle1 =[ $pend_frame1, pend_idle1 ] {}; +void() pend_idle21 =[ $pend_frame13, pend_idle21 ] {}; + +//---------------------------------------------------------------------- +// Pendulum Swing (one cycle is 26 frames) +//---------------------------------------------------------------------- +void() pend_swing1 =[ $pend_frame1, pend_swing2 ] { + // Stop the pendulum if state is OFF / DISABLED + if (self.estate & ESTATE_BLOCK) self.think = pend_idle1; + else if (self.state == STATE_OFF) self.think = pend_idle1; + else { + self.count = self.count + 1; + if (self.spawnflags & PEND_ONESWING && self.count > 2) { + self.state = STATE_OFF; + self.think = pend_idle1; + } + else { + trap_pendsize(0); // Move bbox to frame 0 + self.aflag = 1; // Direction of pendulum blade (touch function) + } + } +}; +void() pend_swing2 =[ $pend_frame2, pend_swing3 ] { trap_pendsize(1);}; +void() pend_swing3 =[ $pend_frame3, pend_swing4 ] { trap_pendsize(2);}; +void() pend_swing4 =[ $pend_frame4, pend_swing5 ] { trap_pendsize(3); +sound ( self, CHAN_VOICE, self.noise1, 0.5, ATTN_NORM);}; +void() pend_swing5 =[ $pend_frame5, pend_swing6 ] {trap_pendsize(4);}; +void() pend_swing6 =[ $pend_frame6, pend_swing7 ] {trap_pendsize(5);}; +void() pend_swing7 =[ $pend_frame7, pend_swing8 ] {trap_pendsize(6);}; +void() pend_swing8 =[ $pend_frame8, pend_swing9 ] {trap_pendsize(7);}; +void() pend_swing9 =[ $pend_frame9, pend_swing10 ] {trap_pendsize(8);}; +void() pend_swing10 =[ $pend_frame10, pend_swing11 ] {trap_pendsize(9);}; +void() pend_swing11 =[ $pend_frame11, pend_swing12 ] {trap_pendsize(10);}; +void() pend_swing12 =[ $pend_frame12, pend_swing13 ] {trap_pendsize(11);}; +// One extra frame pause at end of sequence +void() pend_swing13 =[ $pend_frame13, pend_swing21 ] {trap_pendsize(12);}; + +//---------------------------------------------------------------------- +void() pend_swing21 =[ $pend_frame13, pend_swing22 ] { + // Stop the pendulum if state is OFF / DISABLED + if (self.estate & ESTATE_BLOCK) self.think = pend_idle21; + else if (self.state == STATE_OFF) self.think = pend_idle21; + else { + self.count = self.count + 1; + if (self.spawnflags & PEND_ONESWING && self.count > 2) { + self.state = STATE_OFF; + self.think = pend_idle21; + } + else { + trap_pendsize(12); // Move bbox to frame 12 + self.aflag = -1; // Direction of pendulum blade (touch function) + } + } +}; +void() pend_swing22 =[ $pend_frame12, pend_swing23 ] {trap_pendsize(11);}; +void() pend_swing23 =[ $pend_frame11, pend_swing24 ] {trap_pendsize(10);}; +void() pend_swing24 =[ $pend_frame10, pend_swing25 ] {trap_pendsize(9); +sound ( self, CHAN_VOICE, self.noise1, 0.5, ATTN_NORM);}; +void() pend_swing25 =[ $pend_frame9, pend_swing26 ] {trap_pendsize(8);}; +void() pend_swing26 =[ $pend_frame8, pend_swing27 ] {trap_pendsize(7);}; +void() pend_swing27 =[ $pend_frame7, pend_swing28 ] {trap_pendsize(6);}; +void() pend_swing28 =[ $pend_frame6, pend_swing29 ] {trap_pendsize(5);}; +void() pend_swing29 =[ $pend_frame5, pend_swing30 ] {trap_pendsize(4);}; +void() pend_swing30 =[ $pend_frame4, pend_swing31 ] {trap_pendsize(3);}; +void() pend_swing31 =[ $pend_frame3, pend_swing32 ] {trap_pendsize(2);}; +void() pend_swing32 =[ $pend_frame2, pend_swing33 ] {trap_pendsize(1);}; +// One extra frame pause at end of sequence +void() pend_swing33 =[ $pend_frame1, pend_swing1 ] {trap_pendsize(0);}; + +//---------------------------------------------------------------------- +// if something has touched the pendulum, damage and bounce away +//---------------------------------------------------------------------- +void() trap_pendulum_touch = +{ + // Blade can still hurt if touched, except when OFF = not visible + if (self.estate & ESTATE_OFF) return; + // Double check if dead monster body! + if (trigger_check_body(other,DEAD_EXPLODE)) return; + if (other.health < 1 || other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + if (self.waitmin > 0) self.attack_finished = time + self.waitmin; + + // only play hit sound once per second + if (self.pain_finished < time) { + sound ( self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + self.pain_finished = time + 1; + } + + // Instant death for monsters, they can get knocked into wierd locations + if (other.flags & FL_MONSTER) + T_Damage (other, self, self, other.max_health + 100, DAMARMOR); + else + // Small damage but can be lethal because of how often touch runs + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // Fling the player/object away from blade + // Setting aflag in animation frame to specify direction + if (self.spawnflags & PEND_XSWING) other.velocity_x = self.aflag * 250; + else other.velocity_y = self.aflag * 250; + other.velocity_z = 200; // Little upward lift + + // Blood and gore at object location not pendulum + SpawnMeatSpray (other, other, crandom() * 200); +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_fire = +{ + // Swing counter + self.count = 0; + // Make sure starting frame is start or finish + if (self.frame != 0 && self.frame != PEND_MAXFRAME) + self.frame = self.frame_override; + + // Setup next frame to update swing + if (self.frame == 0) self.think = pend_swing1; + else self.think = pend_swing13; + self.nextthink = time + 0.01 + self.wait; +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove spawnflag and switch ON entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.state = STATE_OFF; // use toggle function + self.estate_on(); // switch on + } + + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // Toggle state of pendulum to start/stop + if (self.state == STATE_OFF) { + self.state = STATE_ON; + trap_pendulum_fire(); + } + else self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_on = +{ + // Turn on model/world interaction + self.estate = ESTATE_ON; + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.mdl); + setsize (self, self.mins , self.maxs); + trap_pendsize(self.frame); +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.frame = self.frame_override; + self.state = STATE_OFF; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_disable = +{ + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_pendlong = +{ + // Short/long version of the model + if (self.spawnflags & PEND_SHORT) self.mdl = "progs/trap_pendshort.mdl"; + else self.mdl = "progs/trap_pendlong.mdl"; + precache_model (self.mdl); + + self.view_ofs = '0 0 -108'; // Offset bbox vectors (new model different location) + self.oldorigin = '0 0 0'; // Entity is correct location + + self.noise1 = "traps/pend_swing.wav"; + self.noise2 = "traps/pend_hit.wav"; + precache_sound (self.noise1); + precache_sound (self.noise2); + + self.classtype = CT_PENDULUM; + if (self.dmg == 0) self.dmg = 5; // Default touch damage + if (self.dmg < 0) self.dmg = 0; // Use -1 for no damage option + if (self.wait <= 0) self.wait = 0; // Default starting delay + if (!self.waitmin) self.waitmin = 0.5; // Damage throttle + self.state = STATE_OFF; + + // Error - Check for targetname for trigger event + if (self.targetname == "") { + dprint("\b[PENDULUM]\b missing targetname, cannot be triggered!\n"); + } + + // Rotate model and swing on X axis instead + if (self.spawnflags & PEND_XSWING) self.angles = '0 270 0'; + else self.angles = '0 0 0'; + + // Start the opposite way around (frame 13 instead of 1) + // This also affects one swing parameter + if (self.spawnflags & PEND_REVERSE) self.frame_override = PEND_MAXFRAME; + else self.frame_override = 0; + self.frame = self.frame_override; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trap_pendulum_on; + self.estate_off = trap_pendulum_off; + self.estate_use = trap_pendulum_use; + self.estate_disable = trap_pendulum_disable; + self.touch = trap_pendulum_touch; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() trap_pendlongx = +{ + self.spawnflags = self.spawnflags | PEND_XSWING; + trap_pendlong(); +} + +//---------------------------------------------------------------------- +void() trap_pendshort = +{ + self.spawnflags = self.spawnflags | PEND_SHORT; + trap_pendlong(); +} + +//---------------------------------------------------------------------- +void() trap_pendshortx = +{ + self.spawnflags = self.spawnflags | PEND_SHORT; + self.spawnflags = self.spawnflags | PEND_XSWING; + trap_pendlong(); +} + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendlong (0.5 0.75 0) (-8 -192 -24) (8 0 24) REVERSE ONESWING x x x x STARTOFF x +Long (192 units) Pendulum (From Rogue mission pack) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Long (192 units) Pendulum (From Rogue mission pack) +*/ + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendlongx (0.5 0.75 0) (-192 -8 -24) (0 8 24) REVERSE ONESWING x x x x STARTOFF x +Long (192 units) Pendulum working on X axis only +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Long (192 units) Pendulum working on X axis only +*/ + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendshort (0.5 0.75 0) (-8 -192 -24) (8 0 24) REVERSE ONESWING x x x x STARTOFF x +Short (128 units) Pendulum +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Short (128 units) Pendulum +*/ + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendshortx (0.5 0.75 0) (-192 -8 -24) (0 8 24) REVERSE ONESWING x x x x STARTOFF x +Short (128 units) Pendulum working on X axis only +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Short (128 units) Pendulum working on X axis only +*/ diff --git a/QC_other/QC_arcane/traps_sawblade.qc b/QC_other/QC_arcane/traps_sawblade.qc new file mode 100644 index 00000000..aa753687 --- /dev/null +++ b/QC_other/QC_arcane/traps_sawblade.qc @@ -0,0 +1,282 @@ +/*====================================================================== + TRAP Sawblade + * Originally based on code from Rogue Software + * Extra code support from lunaran +======================================================================*/ +float SAW_STARTON = 1; +float SAW_XAXIS = 16; +float SAW_REVERSE = 32; + +/*====================================================================== +/*QUAKED trap_sawbladex (0 .5 .8) (-18 -18 -18) (18 18 18) STARTON x x x x REVERSE STARTOFF x +Rotating Saw Blade +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : Name of first path_corner to start at (instant move) +speed : Speed to follow path, def=100 +yaw_speed : Rotation speed for Saw Blade (def=180) +dmg : Damage to do for each contact, def=4 +waitmin : Damage throttle for ON touch function, def=0.1s +height : Damage throttle for OFF touch function, def=1s +lip : Deceleration time; def=2s, =-1 instant stop +sounds : 0=Silent, 1=Woodmill, 5=Custom sounds +noise : custom sound - stopped +noise1 : custom sound - moving (looping) +-------- SPAWNFLAGS -------- +STARTON : Start moving straight away if targetname is used +REVERSE : Start going backward through path_corner chain +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Rotating Saw Blade + +======================================================================*/ + +void() trap_sawblade_touch = +{ + // Blade can still hurt if touched, except when OFF = not visible + if (self.estate & ESTATE_OFF) return; + // Double check if dead monster body! + if (trigger_check_body(other,DEAD_EXPLODE)) return; + if (other.health < 1 || other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + + // --- lunaran ------------------- + // Different touch damage based on blade state + if (self.state == STATE_ON) { + if (self.waitmin > 0) self.attack_finished = time + self.waitmin; + // Hit sounded added by Lunaran, added sound string check + if (self.noise2 !="") sound (self, CHAN_AUTO, self.noise2, 1, 1); + } + else { + if (self.height > 0) self.attack_finished = time + self.height; + } + + // Instant death for monsters + if (other.flags & FL_MONSTER) + T_Damage (other, self, self, other.max_health + 100, DAMARMOR); + else + // Small damage but can be lethal because of how often touch runs + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // Blood and gore at object location not sawblade + SpawnMeatSpray ( other, other, crandom() * 200); +}; + +//---------------------------------------------------------------------- +// New slowdown/stop function by lunaran +//---------------------------------------------------------------------- +void() trap_sawblade_stopthink = +{ + float remaining; + + // If slow down time expired, make sure blade has stopped + if (self.pain_finished <= time) { + self.velocity = self.avelocity = '0 0 0'; + return; + } + + remaining = (self.pain_finished - time) / self.lip; + + //---------------------------------------------------------------------- + // quit moving if we've hit the next pathcorner + // it'd be cooler to continue on the track as we decelerate but this way + // we don't have to muck about in the func_train code + //---------------------------------------------------------------------- + if (self.rad_time && self.rad_time <= time) { + self.velocity = '0 0 0'; + setorigin(self, self.finaldest); + self.rad_time = 0; + } + + // ramp down from original speed and spinrate over self.lip seconds + if (CheckZeroVector(self.velocity) == FALSE) + self.velocity = normalize(self.velocity) * self.speed * remaining; + self.avelocity = normalize(self.avelocity) * self.yaw_speed * remaining; + + // Double tick time to smooth out slowdown + self.nextthink = time + 0.05; +} + +//---------------------------------------------------------------------- +// New slowdown/stop function by lunaran +//---------------------------------------------------------------------- +void() trap_sawblade_stop = +{ + float d, timeToPathCorner; + + // Play wind down stop sound + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // save the time we become completely still in pain_finished + self.pain_finished = time + self.lip; + + // calculate when we'll hit the next pathcorner (if ever) + // so we can stop there + timeToPathCorner = vlen(self.origin-self.finaldest) / self.speed; + + // linear deceleration = stopping distance of exactly 1/2 speed*stoptime + if (self.lip * 0.5 > timeToPathCorner ) { + // linear deceleration = exponential time taken relative to distance + d = mathlib_sqrt( 1 - ( 2 * timeToPathCorner / self.lip ) ); + d = self.lip * ( 1 - d ); + + // save the time in rad_time + self.rad_time = time + d; + } + self.think = trap_sawblade_stopthink; + self.think(); +}; + +//---------------------------------------------------------------------- +void() trap_sawblade_use = +{ + // Block entity state OFF + DISABLE + if (self.estate & ESTATE_BLOCK) return; + + // Toggle function + if (self.state == STATE_OFF) { + self.state = STATE_ON; + // use special train resume function + func_train_resume(); + } + else { + self.state = STATE_OFF; + trap_sawblade_stop(); + } +}; + +//---------------------------------------------------------------------- +void() trap_sawblade_setup = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove start off flag and switch on entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + } + + self.estate_on(); // Switch on entity + func_train_startcorner(); // Move to first corner + self.estate_use = trap_sawblade_use;// Switch ON sawblade + self.estate_fire = func_train_next; // Move to next path corner + self.state = STATE_OFF; // sawblade is OFF, waiting + + // Sharp pointy edges! + self.touch = trap_sawblade_touch; + + // Did the first corner (owner) exist? + if (self.owner && self.spawnflags & SAW_STARTON) { + self.nextthink = time + 0.1; + self.think = self.estate_use; + } +}; + +//---------------------------------------------------------------------- +void() trap_sawblade_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // Turn on model/world interaction + self.estate = ESTATE_ON; // Switch on entity + self.solid = SOLID_TRIGGER; // Keep on cutting! + self.movetype = MOVETYPE_NOCLIP; // Free movement + setmodel (self, self.mdl); // Show bmodel/model + setsize (self, self.bbmins , self.bbmaxs); // Use pre-defined size + // Stop any current sounds, new sound will play in func_train function + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.velocity = self.avelocity = '0 0 0'; // reset velocity/rotation +}; + +//---------------------------------------------------------------------- +void() trap_sawbladey = +{ + // 0 = No sound, 1 = buzzzzz, 5 = custom + if (self.sounds > 0) { + if (self.sounds == 1) { + self.noise = ("traps/sawblade_off.wav"); + self.noise1 = ("traps/sawblade_on.wav"); + self.noise2 = ("traps/sawstrike1.wav"); // lunaran + } + else if (self.sounds == 5) { + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; // lunaran + } + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); // lunaran + } + + self.mdl = "progs/trap_sawblade.mdl"; + precache_model (self.mdl); + + self.classtype = CT_SAWBLADE; + self.state = STATE_OFF; + self.volume = 0.5; + + // Error - Check for first path corner target + if (self.target == "") { + dprint("\b[SAWBLADE]\b missing path corner target!\n"); + } + + // Setup orientiation and bounding box parameters + // required for state on and touch function + if (self.spawnflags & SAW_XAXIS) { + self.angles = '0 0 0'; + self.bbmins = '-20 -2 -20'; + self.bbmaxs = '20 2 20'; + } + else { + self.angles = '0 90 0'; + self.bbmins = '-2 -20 -20'; + self.bbmaxs = '2 20 20'; + } + + if (!self.dmg) self.dmg = 4; // Default touch damage + if (!self.waitmin) self.waitmin = 0.1; // Damage throttle ON state + if (self.speed < 1) self.speed = 100; // Default path speed + self.wait = self.delay = 0; // reset wait and delay + + // --- lunaran ---------------------- + if (!self.height) self.height = 1; // Damage throttle OFF state + if (!self.lip) self.lip = 2; // Deceleration time, -1 for none + if (self.lip < 0) self.lip = 0; // Convert -1 switch to 0 time + + // Setup default rotation speed + if (!self.yaw_speed) self.yaw_speed = 180; + self.v_angle = '0 0 0'; + self.v_angle_x = self.yaw_speed; + + // Save spawn location + self.dest0 = self.finaldest = self.origin; + if (self.target == "") self.owner = self; + self.bsporigin = FALSE; + + // Cannot have start ON and OFF together, remove OFF state! + if (self.spawnflags & SAW_STARTON && self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Setup train direction (switchable via path corners) + if (self.spawnflags & SAW_REVERSE) self.direction = 1; + else self.direction = 0; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trap_sawblade_on; + self.estate_off = func_train_off; + self.estate_use = trap_sawblade_setup; + self.estate_reset = func_train_reset; + self.estate_disable = func_train_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + self.nextthink = time + 0.1; + self.think = self.estate_use; + } +}; + +//---------------------------------------------------------------------- +void() trap_sawbladex = +{ + self.spawnflags = self.spawnflags | SAW_XAXIS; + trap_sawbladey(); +}; \ No newline at end of file diff --git a/QC_other/QC_arcane/triggers.qc b/QC_other/QC_arcane/triggers.qc new file mode 100644 index 00000000..575a500b --- /dev/null +++ b/QC_other/QC_arcane/triggers.qc @@ -0,0 +1,2029 @@ +/*====================================================================== + TRIGGER FUNCTIONS +======================================================================*/ +float TRIG_SPAWNBUBBLES = 2; // Produce bubbles +float TRIG_SECRETNOMSG = 2; // No default message +float TRIG_TELEPLAYER = 1; // Player only +float TRIG_TELESILENT = 2; // No teleport sound +float TRIG_TELEALWAYSON = 4; // Trigger teleports starts on +float TRIG_HURTMONSTER = 4; // Only hurt monsters +float TRIG_HURTFALLING = 32; // Only hurt if player falling +float TRIG_PUSHONCE = 1; // Switch off after one use +float TRIG_PUSHSILENT = 2; // No wind sound for player +float TRIG_PUSHNOMONSTER = 4; // Monsters cannot use this push trigger +float TRIG_CONVMONSTER = 2; // Conveyor moving monsters +float TRIG_CONVITEM = 4; // Conveyor moving items +float TRIG_CONVPUSHABLE = 8; // Conveyor moving pushables +float TRIG_CMAPNOPAUSE = 1; // No info screen, next map +float TRIG_CMAPRESETINV = 2; // Reset inventory (shotgun+25shells) +float TRIG_CMAPSECSPAWN = 4; // Spawn at the second spawn point +float TRIG_MONJUMPFLY = 2; // Will affect flying units +float TRIG_MONJUMPSWIM = 4; // Will affect swimming units +float TRIG_TSOUNDWGEO = 4; // World Geometry interaction +float TRIG_TSOUNDDRAIN = 8; // Drain effect when disabled +float TRIG_VOIDNOCLIENT = 1; // Clients will suffer no damage +float TRIG_VOIDNOMONSTER = 2; // Monsters will be immune to the void +float TRIG_VOIDNOAMMO = 4; // Ammo projectiles will pass through +float TRIG_VOIDNOGG = 8; // Minion eggs will ignore the void +float TRIG_VOIDNOTEMP = 16; // Temporary entities will exist longer +float TRIG_VOIDNOITEM = 32; // All items will carry on as before + +//====================================================================== +// If a dead body has touched a trigger, setup removal +//====================================================================== +float(entity body_ent, float body_death) trigger_check_body = +{ + if (body_ent.flags & FL_MONSTER && body_ent.deadflag == DEAD_DEAD) { + body_ent.deadflag = body_death; + body_ent.touchedvoid = TRUE; + return TRUE; + } + return FALSE; +}; + +//====================================================================== +// Setup/Spawn/Remove bubbles inside a trigger volume +//====================================================================== +void() trigger_setup_bubbles = +{ + // Quake compilers can add the style key to any entity connected + // to dynamic lights, this is usually 32-64 in value and should + // not interfere, but never use style > 32 for any values + if (self.style == 1) self.mdl = "progs/s_bubble_grey.spr"; + else if (self.style == 2) self.mdl = "progs/s_bubble_brnd1.spr"; + else if (self.style == 4) self.mdl = "progs/s_bubble_grn1.spr"; + else if (self.style == 5) self.mdl = "progs/s_bubble_red1.spr"; + else if (self.style == 6) self.mdl = "progs/s_bubble_brnd2.spr"; + else if (self.style == 7) self.mdl = "progs/s_bubble_pinkyel.spr"; + else if (self.style == 8) self.mdl = "progs/s_bubble_brnl1.spr"; + else if (self.style == 9) self.mdl = "progs/s_bubble_purp1.spr"; + else if (self.style == 10) self.mdl = "progs/s_bubble_purp2.spr"; + else if (self.style == 11) self.mdl = "progs/s_bubble_brnl2.spr"; + else if (self.style == 12) self.mdl = "progs/s_bubble_grn2.spr"; + else if (self.style == 13) self.mdl = "progs/s_bubble_yellow.spr"; + else if (self.style == 14) self.mdl = "progs/s_bubble_blue2.spr"; + else if (self.style == 15) self.mdl = "progs/s_bubble_red2.spr"; + else self.mdl = "progs/s_bubble_blue1.spr"; + precache_model(self.mdl); + + // Setup defaults for healing bubbles + self.waitmin = self.bubble_count = 0; // Reset counters + if (!self.count) self.count = 5; // max active bubbles + if (!self.height) self.height = self.size_z; + if (self.height < 64) self.height = 64; // min top of volume + self.oldorigin = bmodel_origin(self); + self.oldorigin_z = self.mins_z; + self.t_width = (self.size_x/2); + self.t_length = (self.size_y/2); + // Default spawn rate for bubbles + if (self.yaw_speed <= 0) self.yaw_speed = 0.5; +}; + +//---------------------------------------------------------------------- +void() trigger_remove_bubble = +{ + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + self.touch = SUB_Null; + if (self.owner.bubble_count > 0) + self.owner.bubble_count = self.owner.bubble_count - 1; + remove(self); +}; + +//---------------------------------------------------------------------- +void() trigger_update_bubble = +{ + // The size of the trigger is the default height for the bubbles + // to raise up, or The height can be specified as a value + + self.lefty = fabs(self.origin_z - self.owner.oldorigin_z); + if (self.lefty > self.owner.height) { + trigger_remove_bubble(); + } + else { + // Wobble on the X / Y axis as the bubble raises up + self.velocity_x = self.velocity_y = 0; + if (random() < 0.5) self.velocity_x = self.velocity_x + crandom()*4; + else self.velocity_y = self.velocity_y + crandom()*4; + // Make the bubble raise faster by random amounts + self.velocity_z = self.velocity_z + random(); + // Keep updating bubble, 15 updates is the limit + self.nextthink = time + 0.5 + random()*0.5; + if (self.count < 15) self.count = self.count + 1; + else trigger_remove_bubble(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_spawn_bubbles = +{ + local entity bubble; + + if (self.estate & ESTATE_BLOCK) return; + if ( !(self.spawnflags & TRIG_SPAWNBUBBLES) ) return; + + if (self.bubble_count < self.count) { + self.bubble_count = self.bubble_count + 1; + + bubble = spawn(); + bubble.owner = self; + bubble.classname = "misc_bubble"; + bubble.classtype = CT_BUBBLE; + bubble.classgroup = CG_TEMPENT; + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_TRIGGER; + setmodel(bubble, self.mdl); + bubble.frame = rint(random() * 3); // Light/dark colours + setsize (bubble, VEC_ORIGIN, VEC_ORIGIN); + bubble.origin_x = self.oldorigin_x + crandom()*self.t_width; + bubble.origin_y = self.oldorigin_y + crandom()*self.t_length; + bubble.origin_z = self.oldorigin_z; + setorigin(bubble, bubble.origin); + bubble.velocity = vecrand(0,5,TRUE); + bubble.velocity_z = 10 + random()*15; + bubble.count = rint(random()*4); + + bubble.nextthink = time + 0.5 + random()*0.5; + bubble.think = trigger_update_bubble; + bubble.touch = trigger_remove_bubble; + } + + // Keep spawning bubbles until told not too! + self.think = trigger_spawn_bubbles; + self.nextthink = time + self.yaw_speed + random()*self.yaw_speed; +}; + +/*====================================================================== +/*QUAKED trigger_multiple (0.5 0 0.5) ? NOTOUCH x DEVMODE x MODCHECK MONSTERS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Variable sized bmodel that uses multiple times +------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger all these targets +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +health : Can be damaged instead of touched +wait : time between re-triggering +delay : delay before firing (after being triggered) +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +DEVMODE : Will only trigger if developer mode active +MODCHECK : Will remove this entity if THIS mod is active +MONSTER : can be touched/triggered by monsters +STARTOFF : Requires trigger to activate +------- NOTES -------- +Variable sized bmodel that uses multiple times + +======================================================================*/ +void() trigger_multiple = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.spawnflags & TRIG_MODCHECK) { remove(self); return; } + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGMULTI; + InitTrigger (); + if (!self.wait) self.wait = 0.2; + + // Setup Entity State functionality + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_once (0.5 0 0.5) ? NOTOUCH x DEVMODE INVIEW MODCHECK MONSTER STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Variable sized bmodel that uses once +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger all these targets +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +health : Can be damaged instead of touched +wait : Always -1 +delay : delay before firing (after being triggered) +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +t_length : Inview distance (less than) to activate trigger +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +DEVMODE : Will only trigger if developer mode active +INVIEW : Player has to be infront and look at trigger (>30 & <60) +MODCHECK : Will remove this entity if THIS mod is active +MONSTER : can be touched/triggered by monsters +STARTOFF : Requires trigger to activate +-------- NOTES -------- +Variable sized bmodel that uses once + +======================================================================*/ +void() trigger_once = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.spawnflags & TRIG_MODCHECK) { remove(self); return; } + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGONCE; + InitTrigger (); + self.wait = -1; + + // Inview triggers need to start delayed, high cpu functions + if (self.spawnflags & TRIG_INVIEW) { + self.spawnflags = self.spawnflags | ENT_STARTOFF; + // Cannot have inview triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + } + + // Setup Entity State functionality + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_secret (.5 0 .5) ? NOTOUCH NOMSG x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Update map secret counter +------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +health : Can be damaged instead of touched +wait : Always -1 +angle : Facing Direction for trigger to work, use 360 for angle 0. +sounds : 1=Secret(def),2=talk,3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +NOMSG : Remove/Block any trigger secret message +STARTOFF : Requires trigger to activate +------- NOTES -------- +Update map secret counter + +======================================================================*/ +void() trigger_secret = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.sounds == 0) self.sounds = 1; + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGSECRET; + InitTrigger (); + self.wait = -1; // Trigger ONCE + self.count = 1; // Add 1 secret + + total_secrets = total_secrets + self.count; + if (!self.message) self.message = "You found a secret area!"; + if (self.spawnflags & TRIG_SECRETNOMSG) self.message = ""; + + // Cannot have secret triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_teleport (0.5 0 0.5) ? PLAYER_ONLY SILENT STARTON x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Teleport player/monsters to target location +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : Points to info_teleport_destination entity +wait : -1 = trigger once condition (def=0) +speed : forward momentum speed after teleporting (def=300) +volume : teleporter hum sound volume (def=0.5) +noise : custom sound to play when active (must be looped, def=hum1.wav) +waitmin : the length of the custom sound (def=3.622 for hum1.wav) +-------- SPAWNFLAGS -------- +PLAYER_ONLY : Can only be used by players (nothing else) +SILENT : No teleporter hum sound regardless of state +STARTON : Will start active regardless of targetname setting +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Teleport player/monsters to target location +if targetname is setup, the teleporter requires a trigger to activate +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_teleport_sound = +{ + // Has the original bmodel trigger been deleted!?! + if (!self.owner) { + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + return; + } + + // The Quake sound system is really basic and dumb! :) + // Originally the sound of the teleporter was setup as an ambientsound, + // which always play, loop and never can be turned off! + // + // Normal sounds are ONLY active when the player is in the same portal! + // This is probably an optimization (engine) thing to save time + // constantly checking attenuation levels + // + // The teleporter sound is manually looped because of portal problems + // and that the trigger can be turned on / off. + // The waitmin parameter has to match the length of the sound, otherwise + // the looping will literally sound odd + // + + // Keep checking for any updates + self.nextthink = time + 0.1; + self.think = trigger_teleport_sound; + + // Wait for trigger to start before doing anything + if (self.owner.spawnflags & ENT_STARTOFF) return; + + // Has the trigger been switched off recently? + if (self.owner.estate != self.estate) { + // Check for OFF and disabled together + if (self.owner.estate & ESTATE_BLOCK) { + self.estate = self.owner.estate; + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.fly_sound = LARGE_TIMER; + return; + } + else { + // trigger has been switched on, reset sound + self.estate = self.owner.estate; + self.fly_sound = 0; + } + } + + // Play the sound if loop has finished or been reset + if (self.fly_sound < time ) { + self.fly_sound = time + self.owner.waitmin; + sound (self, CHAN_VOICE, self.owner.noise, self.owner.volume, ATTN_STATIC); + } +}; + +//---------------------------------------------------------------------- +// This is used for the closet monster setup where the trigger is fired +// and then anything touching the trigger 0.2s later is teleported +// This forces all touch triggers in a map to check what they are touching! +//---------------------------------------------------------------------- +void() trigger_teleport_use = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove start off flag and switch on entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.estate_on(); + return; + } + // Block entity state DISABLE + if (self.estate & ESTATE_DISABLE) return; + if (self.estate & ESTATE_OFF) self.estate_on(); + + // Force retouch is really hard on the engine because EVERY trigger + // in the map is re-checked for any touching objects + force_retouch = 2; + self.nextthink = time + 0.2; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport_on = +{ + self.estate = ESTATE_ON; + self.state = STATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport_off = +{ + self.estate = ESTATE_OFF; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport_touch = +{ + if (self.estate & ESTATE_BLOCK) return; // Entity off/disabled? + if (self.spawnflags & ENT_STARTOFF) return; // Starts off? + if (self.attack_finished > time) return; // Trigger once? + if (self.state == STATE_OFF) return; // Waiting for trigger? + + // Is the teleporter designed for players only? + if (self.spawnflags & TRIG_TELEPLAYER && !(other.flags & FL_CLIENT)) return; + // only teleport living creatures and monsters (mostly) + if (other.health < 1 || other.solid != SOLID_SLIDEBOX) return; + + // Find teleporter target + if (!self.goalentity) { + self.goalentity = find (world, targetname, self.target); + if (!self.goalentity) { + dprint("\b[TELEPORT_TOUCH]\b Cannot find target\n"); + return; + } + // New feature, fire targets on teleporter destination + if (self.goalentity.classtype == CT_MISCTELEPORT && self.goalentity.target != "") { + trigger_strs(self.goalentity.target, other); // Fire all targets + self.goalentity.target = ""; // only work once + } + // This stuff never changes, might as well generate it now + makevectors (self.goalentity.mangle); + self.goalentity.movedir = v_forward; + self.goalentity.pos1 = self.goalentity.origin + 32 * self.goalentity.movedir; + } + + // Check for a trigger_once condition + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } + + // Fire all targets on trigger teleporter entity (ID code) + // not sure why? the target *should* be pointing at info_destination + // Could use killtarget or message strings + SUB_UseTargets (); + + // put a tfog where the player was + spawn_tfog (other.origin); + + // spawn a tfog flash in front of the destination + spawn_tfog (self.goalentity.pos1); + spawn_tdeath(self.goalentity.origin, other); + + // Add a little forward momentum to teleporting entity + // This is usually used for gib/telefrag effects + if (!other.health) { + other.origin = self.goalentity.origin; + other.velocity = (self.goalentity.movedir * other.velocity_x) + (self.goalentity.movedir * other.velocity_y); + return; + } + + // Move/rotate teleporting entity to new location + setorigin (other, self.goalentity.origin); + other.angles = self.goalentity.mangle; + + // If player, rotate (immediately) and push forward + if (other.flags & FL_CLIENT) { + other.fixangle = 1; // turn this way immediately + other.teleport_time = time + 0.7; // Special state for engine + other.velocity = self.goalentity.movedir * self.speed; + } + // Telporting entities need to check for ground + other.flags = other.flags - (other.flags & FL_ONGROUND); +}; + +//---------------------------------------------------------------------- +void() trigger_teleport = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Always pre-cache telporter teleporter sound + if (self.noise == "") self.noise = "ambience/hum1.wav"; + precache_sound (self.noise); + // The length of the custom sound cannot be < 0.1s + if (self.waitmin <= 0.1) self.waitmin = 3.622; + + self.classtype = CT_TRIGTELEPORT; + InitTrigger (); + + // A trigger teleporter going nowhere!?! + // Need to initialize trigger to get mins/maxs for origin + if (self.target == "") { + dprint("\b[TRIGGER_TELEPORT]\b Missing target\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Spawnflag 1 is used for something else (notouch duplicate) + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + if (!self.volume) self.volume = 0.5; + if (!self.speed) self.speed = 300; + // Save this for later (sound emitter) + self.oldorigin = bmodel_origin(self); + + // Trigger teleport is a special case in the way it is setup because + // is it abused for monster closets, where the trigger is always active + self.touch = trigger_teleport_touch; + self.solid = SOLID_TRIGGER; + setsize (self, self.bbmins, self.bbmaxs); + + // Setup Entity State functionality + self.estate_on = trigger_teleport_on; + self.estate_off = trigger_teleport_off; + self.estate_use = trigger_teleport_use; + self.use = entity_state_use; + + // Damn annoying that the targetname is being used like this because + // there could have been a better way to do this type of functionality + // == "" teleporter works fine (starts on) + // != "" teleporter requires trigger activation + if (self.spawnflags & TRIG_TELEALWAYSON) self.estate = ESTATE_ON; + else if (self.spawnflags & ENT_STARTOFF) self.estate = ESTATE_OFF; + else if (self.targetname != "") self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; + + // Setup sound emitter for teleporter state + if ( !(self.spawnflags & TRIG_TELESILENT) ) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.estate = -1; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setorigin(self.attachment, self.oldorigin); + //setmodel(self.attachment, MODEL_BROKEN); + self.attachment.nextthink = time + 1; + self.attachment.think = trigger_teleport_sound; + } +}; + +/*====================================================================== +/*QUAKED trigger_changelevel (0.5 0 0.5) ? NO_INTERMIS RESETINV x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Finish current map, show intermission screen and loads next +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger before intermission +map : The name of next map (e.g. e1m1) default=same map +startspawn2: Special unique number (1-7) which must match info_player_start2 +-------- SPAWNFLAGS -------- +NO_INTERMIS : No Intermission screen +RESETINV : Reset player inventory to default (Shotgun+Shells) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Finish current map, show intermission screen and loads next +This entity cannot be damaged and is always touchable once activated + + ======================================================================*/ +void() trigger_changelevel_finish = +{ + intermission_running = 1; + + // enforce a wait time before allowing changelevel + if (deathmatch) intermission_exittime = time + 5; + else intermission_exittime = time + 2; + + WriteByte (MSG_ALL, SVC_CDTRACK); // Update CD track + WriteByte (MSG_ALL, SVC_UPDATESTAT); // Update stats, total kills etc + WriteByte (MSG_ALL, SVC_UPDATESTAT); // Update twice? + StartIntermissionCamera(); // Setup intermission camera(s) + WriteByte (MSG_ALL, SVC_INTERMISSION); // Start intermission (lock movement) +}; + +//---------------------------------------------------------------------- +void() trigger_changelevel_fire = +{ + if (self.attack_finished > time) return; + if ( !(self.bmodel_act.flags & FL_CLIENT) ) return; + if ( self.bmodel_act.health < 1 ) return; + + self.attack_finished = LARGE_TIMER; + + // Check for map variables on exit + if (!CheckZeroVector(self.mapvar_update)) + mapvar_range(self.mapvar_update); + + // Reset player inventory back to ID default (shotgun+25shells) + if (self.spawnflags & TRIG_CMAPRESETINV) { + dprint("\b[CHANGELVL]\b Resetting client inventory!\n"); + self.bmodel_act.health = HEAL_PLAYMAX; + self.bmodel_act.armortype = self.bmodel_act.armorvalue = 0; + self.bmodel_act.ammo_shells = DEF_SHELLS; + self.bmodel_act.ammo_nails = self.bmodel_act.ammo_rockets = self.bmodel_act.ammo_cells = 0; + self.bmodel_act.items = IT_SHOTGUN | IT_AXE; + self.bmodel_act.moditems = 0; + self.bmodel_act.weapon = IT_SHOTGUN; + } + + // Some crazy DM parameters to prevent teleport exit + if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) { + T_Damage (self.bmodel_act, self, self, MEGADEATH, NOARMOR); return; + } + // More crazy DM stuff + if (coop || deathmatch) { + bprint (self.bmodel_act.netname); + bprint (" exited the level\n"); + } + + // is there a special info_player_start2 location setup? + // This will also reset any values back to zero (default) + if (self.startspawn2 < 1 && self.startspawn2 > 7) self.startspawn2 = 0; + update_configflag(SVR_SPAWN_BIT1, floor( (self.startspawn2 & 1) / 1) ); + update_configflag(SVR_SPAWN_BIT2, floor( (self.startspawn2 & 2) / 2) ); + update_configflag(SVR_SPAWN_BIT3, floor( (self.startspawn2 & 4) / 4) ); + + // *change* if map key not defined, reload current map again + if (self.map) nextmap = self.map; + SUB_UseTargets (); + + // If no intermission, go straight to next map + if ( (self.spawnflags & TRIG_CMAPNOPAUSE) && (deathmatch == 0) ) { + GotoNextMap(); + return; + } + + // we can't move people right now, because touch functions are called + // in the middle of C movement code, so set a think time to do it + self.think = trigger_changelevel_finish; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() trigger_changelevel_setup = +{ + // If map not defined, use current mapname instead + if (!self.map) self.map = mapname; +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() changelevel_touch = { trigger_changelevel_fire();}; + +//---------------------------------------------------------------------- +void() trigger_changelevel = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGLEVEL; + InitTrigger (); + // Spawnflag 1 is used for something else (notouch duplicate) + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + // Cannot have change level triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_fire = trigger_changelevel_fire; + trigger_bmodel_setup(); + + // Wait for everything to spawn before checking map name + self.think = trigger_changelevel_setup; + self.nextthink = time + 1; +}; + +/*====================================================================== +/*QUAKED trigger_setskill (0.5 0 0.5) ? NOTOUCH x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Sets player skill level (via console) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +health : Can be damaged instead of touched +wait : time between re-triggering (def=0.2s, -1=once) +angle : Facing Direction for trigger to work, use "360" for angle 0. +message : Skill Level - 0 = easy, 1 = normal, 2 = hard, 3 = nightmare +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Sets player skill level (via console) + +======================================================================*/ +void() trigger_setskill_fire = +{ + if (self.attack_finished > time) return; + + // There is no client check for the skill level change so that + // the use functionality can work from trigger chains + cvar_set ("skill", self.message); + + // Is the trigger repeatable? + if (self.wait > 0) { + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + // block trigger and turn off (trigger_once) + else { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_setskill = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGSKILLS; + InitTrigger (); + + if (!self.wait) self.wait = 1; + if (self.message == "") self.message = "0"; + + // Cannot have skill triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + self.estate_fire = trigger_setskill_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_rune (0.5 0 0.5) ? E1 E2 E3 E4 x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A Trigger that fires once if the player has certain runes +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +health : Can be damaged instead of touched +angle : Facing Direction for trigger to work, use "360" for angle 0. +target : trigger to fire if player has MIXTURE of runes +noise1 : trigger to fire if player has rune 1 +noise2 : trigger to fire if player has rune 2 +noise3 : trigger to fire if player has rune 3 +noise4 : trigger to fire if player has rune 4 +wait : = -1 Only trigger once if the player has runes +-------- SPAWNFLAGS -------- +E1 : Episode 1 +E2 : Episode 2 +E3 : Episode 3 +E4 : Episode 4 +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +There are two ways this trigger can be used, a single check for multiple +runes using target key OR individual triggers for runes using noise 1-4 keys +This trigger is designed to work once when rune conditions are met + +======================================================================*/ +void() trigger_rune_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + // Stop the trigger constantly firing + self.attack_finished = time + self.waitmin; + + // Check for single rune trigger + if (self.target) { + if (query_configflag(SVR_RUNE_ALL) & self.customkey == self.customkey) { + trigger_strs(self.target, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + } + else { + // Check for multiple rune triggers + if (query_configflag(self.customkey & SVR_RUNE_KEY1) == SVR_RUNE_KEY1 && self.noise1 != "") { + trigger_strs(self.noise1, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + if (query_configflag(self.customkey & SVR_RUNE_KEY2) == SVR_RUNE_KEY2 && self.noise2 != "") { + trigger_strs(self.noise2, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + if (query_configflag(self.customkey & SVR_RUNE_KEY3) == SVR_RUNE_KEY3 && self.noise3 != "") { + trigger_strs(self.noise3, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + if (query_configflag(self.customkey & SVR_RUNE_KEY4) == SVR_RUNE_KEY4 && self.noise4 != "") { + trigger_strs(self.noise4, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + } + + // The attack_finished is set by the RUNE condition being TRUE + // The trigger is designed to be trigger_once (no need to check wait) + // The trigger needs to meet a rune condition before switching off + if (self.attack_finished == LARGE_TIMER) self.estate_off(); +}; + +//---------------------------------------------------------------------- +void() trigger_rune = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGRUNES; + // Spawnflag 1 is used for something else (notouch duplicate) + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH; + InitTrigger (); + if (self.waitmin <=0) self.waitmin = 1; + + // Cannot have rune triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + // Calculate the rune key selection + self.customkey = self.spawnflags & SVR_RUNE_ALL; + + // Cannot do anything with the trigger if no runes are selected + if (self.customkey == 0) { + dprint("\b[TRIG_RUNE]\b No runes setup!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Setup Entity State functionality + self.estate_fire = trigger_rune_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_push (0.5 0 0.5) ? PUSH_ONCE SILENT NOMONSTER x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Push the Player and Grenades! +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : target entity for custom direction +angle : direction of push (-2 is down, -1 up) +angles : Pitch Yaw Roll (up/down, angle, tilt left/right) +speed : Speed of push direction (def=1000) +-------- SPAWNFLAGS -------- +PUSH_ONCE : trigger_once functionality +SILENT : No wind sound for player +NOMONSTER : Monsters cannot be pushed by this trigger +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Push the Player, player/ogre grenades and minion eggs! +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_push_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + // Check for any dead monster bodies (no exceptions) + if (trigger_check_body(self.bmodel_act,DEAD_EXPLODE)) return; + // Check for no monster exception + if (self.spawnflags & TRIG_PUSHNOMONSTER && self.bmodel_act.flags & FL_MONSTER) return; + + // Cool feature is that it will push grenades! + // Added player, ogre and minion eggs to the catch + if (self.bmodel_act.classtype == CT_PROJ_GL || + self.bmodel_act.classtype == CT_PROJ_GLMON || + self.bmodel_act.classtype == CT_PROJ_MEGG) + self.bmodel_act.velocity = self.speed * self.movedir * 10; + // Standard push for all bmodel_act living entities + else if (self.bmodel_act.health > 0) { + self.bmodel_act.velocity = self.speed * self.movedir * 10; + // Play wind sound for the player + if (self.bmodel_act.classtype == CT_PLAYER) { + if (self.bmodel_act.fly_sound < time) { + self.bmodel_act.fly_sound = time + 1.5; + sound (self.bmodel_act, CHAN_AUTO, self.noise, 1, ATTN_NORM); + } + } + } + + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +// Map hack reference +void() trigger_push_touch = { self.bmodel_act = other; trigger_push_fire(); } + +//---------------------------------------------------------------------- +void() trigger_push = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGPUSH; + InitTrigger (); + // Spawnflag 1 is used for something else (notouch duplicate) + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + if (!self.speed) self.speed = 1000; + + // Setup default wind sound if no custom sound found + // else if silent trigger, use misc/empty sound + if ( !(self.spawnflags & TRIG_PUSHSILENT) && self.noise == "") + self.noise = "ambience/windfly.wav"; + if (self.noise == "") self.noise = SOUND_EMPTY; + precache_sound (self.noise); + + if (self.spawnflags & TRIG_PUSHONCE) self.wait = -1; + + // Setup Entity State functionality + self.estate_fire = trigger_push_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 2; + self.think = TargetMovedir; + } +}; + +//---------------------------------------------------------------------- +// Removed - No map used the feature +//---------------------------------------------------------------------- +void() trigger_conveyor = { remove(self); }; + +/*====================================================================== + Player ladder (originally from Rubicon2 codebase by JohnFitz) + - This is a very simple system, jump to attach to the ladder brush + - move up down via jumpping (hook in preplayer code) + - Added multiple climbing sounds (works with player footsound state) + - Modified to have on/off/toggle state via triggers + - Downsides to system, there is no abilty to go down a ladder + +/*====================================================================== +/*QUAKED trigger_ladder (.5 .5 .5) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Invisible brush based ladder (jump key to climb) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +angle : direction player must be facing to climb ladder (required) +waitmin : time between climb sound (def = depends on sound type) +speed : velocity speed to climb ladder (def=160) +sounds : 1=metal, 2=wood, 3=rope, 4=silent, 5=custom (def=wood) +noise1-4 : custom sounds to play when climbing ladder +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Invisible brush based ladder (jump key to climb) +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_ladder_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + + // Ladders ONLY work with players because of client.qc (PlayerPreThink) + if (self.estate & ESTATE_BLOCK) return; + if ( !(self.bmodel_act.flags & FL_CLIENT) ) return; + if ( self.bmodel_act.health < 1 ) return; + + // Don't stick underwater, or in the middle of a waterjump + if (self.bmodel_act.waterlevel > 1) return; + if (self.bmodel_act.flags & FL_WATERJUMP) return; + + self.bmodel_act.onladder = 1; // Add everytime the player touches volume + self.bmodel_act.entladder = self; // Link back to play sounds +}; + +//---------------------------------------------------------------------- +void() trigger_ladder = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Default = wood + if (!self.sounds) self.sounds = 2; + if (self.sounds == 1) { // Metal + if(!self.waitmin) self.waitmin = 0.45; + self.noise1 = "player/ladmetal1.wav"; + self.noise2 = "player/ladmetal2.wav"; + self.noise3 = "player/ladmetal3.wav"; + self.noise4 = "player/ladmetal4.wav"; + } + else if (self.sounds == 2) { // Wood + if(!self.waitmin) self.waitmin = 0.4; + self.noise1 = "player/ladwood1.wav"; + self.noise2 = "player/ladwood2.wav"; + self.noise3 = "player/ladwood3.wav"; + self.noise4 = "player/ladwood4.wav"; + } + else if (self.sounds == 3) { // Old Rope + if(!self.waitmin) self.waitmin = 0.7; + self.noise1 = "player/ladrope1.wav"; + self.noise2 = "player/ladrope2.wav"; + self.noise3 = "player/ladrope3.wav"; + self.noise4 = "player/ladrope4.wav"; + } + else { + // Custom or empty + if (!self.waitmin) self.waitmin = 0.5; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + if (self.noise4 == "") self.noise4 = SOUND_EMPTY; + } + precache_sound(self.noise1); + precache_sound(self.noise2); + precache_sound(self.noise3); + precache_sound(self.noise4); + + self.classtype = CT_TRIGLADDER; + InitTrigger (); + if (!self.speed) self.speed = 160; + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Cannot have ladder triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + self.estate_fire = trigger_ladder_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_giveitems (0.5 0 0.5) ? NOTOUCH x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Variable sized bmodel used to give items to player +The target items only work if delay spawned spawnflag is set +The pickup sound can be turned off by adding sounds=4 to item +The target items will not respawn or work more than once +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : Points to all items to give to the player +wait : (def) -1 = will only fire targets once +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +STARTOFF : Requires trigger to activate +-------- NOTES -------- +Variable sized bmodel used to give items to activator +The target items only work if delay spawned spawnflag is set +The pickup sound can be turned off by adding sounds=4 to item +The target items will not respawn or work more than once + +======================================================================*/ +void() trigger_giveitem_fire = +{ + local entity stemp; + + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + // Activator can only be the player + if (!(self.bmodel_act.flags & FL_CLIENT)) return; + if (self.bmodel_act.health < 1) return; + if (self.target == "") return; + + // Save for later and reset activator + stemp = self; activator = self.bmodel_act; + + // Play the sound ON the activator and display message + if (self.noise != "") sound (activator, CHAN_VOICE, self.noise, 1, ATTN_NORM); + if (self.message != "") centerprint (activator, self.message); + + // Search entity list for targets + self.enemy = find (world, targetname, self.target); + + while(self.enemy) { + // This only works with items + if (self.enemy.flags & FL_ITEM) { + // Only works with items that start off + if (self.enemy.spawnflags & ENT_STARTOFF) { + if (self.enemy.touch2 != SUB_Null) { + // Switch to item for touch function + other = self.bmodel_act; + activator = self.bmodel_act; + self = self.enemy; + // make sure items never respawn and silent pickup + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + self.respawn_time = -1; + self.respawn_trig = FALSE; + // item should always be floating (no drop to floor functions) + self.spawnflags = self.spawnflags | ITEM_FLOATING; + // give trigger sound overrides all items + if (stemp.sounds != 4) self.noise = SOUND_EMPTY; + // Use original touch function + self.touch2 (); + self = stemp; + + } + } + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } + + // always TRIGGER_ONCE functionality + self.attack_finished = LARGE_TIMER; +}; + +//---------------------------------------------------------------------- +void() trigger_giveitems = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.sounds == 0) self.sounds = 4; // Default = silence + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGGIVEITEM; + InitTrigger (); + + // Always trigger once functionality + self.wait = -1; + + // Cannot have trigger give items touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + self.estate_fire = trigger_giveitem_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_fog (.5 .5 .5) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Trigger change global fog to new value over time +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger +speed : time (secs) to fade from current to new (-1 = instant, 2s = default) +wait : time between re-triggering (def=2s, -1=once) +angle : Facing Direction for trigger to work, use "360" for angle 0. +fog_density : new fog density (def=0.5, -1=debug mode) +fog_colour : new fog colours (def=0.1 0.1 0.1) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Trigger change global fog to new value over time + +======================================================================*/ +void() trigger_fog_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + if (query_configflag(SVR_NOFOGCMDS)) { + dprint("\b[FOG]\b quake.rc disabled, removing!\n"); + self.attack_finished = LARGE_TIMER; + entity_remove(self, 0.1); + return; + } + + // Print dev message if worldspawn not setup correctly + // First fog blend will be weird otherwise + if (!fog_active) { + if (self.pain_finished < time) { + dprint("\b[FOG]\b Missing density + colour on worldspawn!\n"); + dprint("\b[FOG]\b First fog blend requires worldspawn setup\n"); + } + self.pain_finished = time + 1; + } + + // Crazy test option, random fog! + if (self.lefty) { + self.fog_density = random(); + self.fog_colour_x = random(); + self.fog_colour_y = random(); + self.fog_colour_z = random(); + self.speed = 1 + random()*4; + } + + // Update global fog controller + fade_fog(self.fog_density, self.fog_colour, self.speed); + SUB_UseTargets(); + + // Is the trigger repeatable? + if (self.wait > 0) { + if (self.wait < self.speed) self.wait = self.speed + 0.1; + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + // block trigger and turn off (trigger_once) + else { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_fog_waitforcontrol = +{ + if (fog_control && fog_active) { + // Setup Entity State functionality + self.estate_fire = trigger_fog_fire; + trigger_bmodel_setup(); + } + else { + self.think = trigger_fog_waitforcontrol; + self.nextthink = time + 0.1 + random(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_fog = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGFOG; + InitTrigger (); + + // A fade time < minimum fade time = instant change + if (self.speed == 0) self.speed = 2; + if (self.speed < FADEFOG_TIME) self.speed = FADEFOG_TIME; + if (self.wait == 0) self.wait = 2; + self.attack_finished = 0; + + // Cannot have fog triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Check for debug test mode (random density/colour) + if (self.fog_density < 0) self.lefty = TRUE; + // Default density/colour + if (!self.fog_density) self.fog_density = 0.1; + if (CheckZeroVector(self.fog_colour)) self.fog_colour = '0.1 0.1 0.1'; + + trigger_fog_waitforcontrol(); +}; + +/*====================================================================== +/*QUAKED trigger_monsternojump (.5 .5 .5) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Stop monsters from using jump attack +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : -1 = trigger_once functionality +delay : time to delay jump attack by (def=0.5s) +waitmin: Re-trigger timer to stop touch flooding (def=0.1s) +noise1 : specify classname that CAN use this trigger (noise1=monster_dog) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Stop monsters from using jump attack + +======================================================================*/ +void() trigger_monsternojump_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Block non-monsters + if (!(self.bmodel_act.flags & FL_MONSTER)) return; + + // Is there any classname exception setup? + if (self.noise1 != "") { + if (self.bmodel_act.classname != self.noise1) return; + } + + // Check for any extra triggers, fire them once! + if (self.target != "") { + trigger_strs(self.target, activator); + self.target = ""; + } + + // Update jump flag to block jump attacks + self.bmodel_act.jump_flag = time + self.delay; + // Restrict the trigger to 0.1s re-triggering + self.attack_finished = time + self.waitmin; + + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsternojump = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGNOJUMP; + if (!self.delay) self.delay = 0.5; + if (!self.waitmin) self.waitmin = 0.1; + // Work out dimensions of trigger + InitTrigger (); + + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Setup Entity State functionality + self.estate_fire = trigger_monsternojump_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); + +}; + +//---------------------------------------------------------------------- +// Re-direct because it was renamed to be more consistent +void() trigger_nomonjump = { trigger_monsternojump(); }; + +/*====================================================================== +/*QUAKED trigger_monsterdrop (0 .5 .5) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Drop monster(s) to floor +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : -1 = trigger_once functionality +height : the speed thrown upwards (def 50) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Drop monster(s) to floor +======================================================================*/ + +void() trigger_monsterdrop_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + if (self.target == "") return; + + // Build initial list from world + self.oldenemy = find(world, targetname, self.target); + while (self.oldenemy) { + // only works with monsters + if (self.oldenemy.flags & FL_MONSTER) { + // Double check for swim/fly types + if (!(self.oldenemy.flags & (FL_FLY || FL_SWIM))) { + // Got to be onground already + if (self.oldenemy.flags & FL_ONGROUND) { + // Set monster in motion + self.oldenemy.flags = self.oldenemy.flags - FL_ONGROUND; + self.oldenemy.velocity_z = self.height; + } + } + } + // Find next monster in list + self.oldenemy = find(self.oldenemy, targetname, self.target); + } + // Setup to trigger once functionality? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterdrop = +{ + self.classtype = CT_TRIGMONDROP; + if (!self.height) self.height = 50; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monsterdrop_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_monsterjump (.5 .5 .5) ? x FLYING SWIMMING x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Push monsters in a certain direction +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : target entity for custom direction +wait : -1 = trigger_once functionality +angle : direction of push (-2 is down, -1 up) +speed : the speed thrown forward (def 200) +height : the speed thrown upwards (def 200) +noise1 : specify classname that CAN use this trigger (noise1=monster_dog) +-------- SPAWNFLAGS -------- +FLYING : Will affect flying monsters +SWIMMING : Will affect swimming monsters +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Push monsters in a certain direction +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_monsterjump_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Cannot move spawning statues + if (self.bmodel_act.spawnstatue) return; + // Check monster is not jumping already + if (self.bmodel_act.jump_flag > time) return; + + // Block non-monsters and fly/swim if spawnflag not set + if (!(self.bmodel_act.flags & FL_MONSTER)) return; + if (!(self.spawnflags & TRIG_MONJUMPFLY) && self.bmodel_act.flags & FL_FLY) return; + if (!(self.spawnflags & TRIG_MONJUMPSWIM) && self.bmodel_act.flags & FL_SWIM) return; + + // Is there any classname exception setup? + if (self.noise1 != "") { + if (self.bmodel_act.classname != self.noise1) return; + // extra special condition for enraged drole's + if (self.bmodel_act.classtype == CT_MONDROLE && !self.bmodel_act.attack_rage) return; + } + + // Check for any triggers, fire them once! + if (self.target != "") { + trigger_strs(self.target, activator); + self.target = ""; + } + + // Flying/Swimming monsters only need a push in the right direction + if (self.bmodel_act.flags & FL_FLY || self.bmodel_act.flags & FL_SWIM) { + self.bmodel_act.velocity = self.movedir * self.speed; + } + else { + // set XY even if not on ground, so the jump will clear lips + self.bmodel_act.velocity_x = self.movedir_x * self.speed; + self.bmodel_act.velocity_y = self.movedir_y * self.speed; + // If monster on the ground, lift them up + if (self.bmodel_act.flags & FL_ONGROUND ) { + self.bmodel_act.flags = self.bmodel_act.flags - FL_ONGROUND; + self.bmodel_act.velocity_z = self.height; + } + } + + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterjump = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGMONJUMP; + if (!self.speed) self.speed = 200; + if (!self.height) self.height = 200; + if (self.angles_y == 0) self.angles_y = 360; + // Work out facing angle + InitTrigger (); + + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Setup Entity State functionality + self.estate_fire = trigger_monsterjump_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 2; + self.think = TargetMovedir; + } +}; + +//---------------------------------------------------------------------- +void() trigger_drolejump = +{ + self.noise1 = "monster_drole"; + trigger_monsterjump(); +}; + +/*====================================================================== +/*QUAKED trigger_monsterturret (0.5 0.3 0) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Temporarily turn a monster into a turret +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : -1 = Only trigger a monster turret function once +count : random chance to pause; constant = -1, def = 0.25, range = 0 - 1 +noise1 : only works with this type of monster (monster_ogre) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Temporarily turn a monster into a turret +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_monsterturret_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + + local entity tself; + + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; // trigger_once functionality + if (!(self.bmodel_act.flags & FL_MONSTER)) return; // ONLY Monsters! + if (self.bmodel_act.health < 1) return; // Dead things cannot be turrets! + if (self.bmodel_act.movespeed < 0) return; // Already a turret!?! + if (!self.bmodel_act.enemy) return; // This is a combat node only + if (self.bmodel_act.turretactive) return; // Already using a turret position + if (!self.bmodel_act.th_missile) return; // Only works if got range attack + if (self.noise1 != "") { if (self.noise1 != self.bmodel_act.classname) return; } + + // Switch to monster + tself = self; + self = self.bmodel_act; other = tself; + // check enemy visibility and direction + if (visible(self.enemy) && infront(self.enemy)) { + // Link the monster to the turret (used by ai_run) + self.turretactive = other; + } + + self = tself; + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterturret = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGMONTURRET; + if (self.count < 0) self.count = -1; + else if (self.count == 0 || self.count > 1) self.count = 0.25; + InitTrigger (); + + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Setup Entity State functionality + self.estate_fire = trigger_monsterturret_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_hurt (.5 .5 .5) ? x BUBBLES MONSTER_ONLY x MODCHECK FALLING STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Will hurt any touching entity +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +dmg : damage from contact with trigger (def=5) +wait : time between pain contact (def=1s) +angle : Facing Direction for trigger to work, use "360" for angle 0. +speed : used by falling spawnflag for velocity check (def=300) +height : Maximum travel distance up for bubbles (default trigger size) +count : total amount of active bubbles at once (default 5) +style : 1-15 (grey,brown1,blue1,green1,red1,brown2,pinkyel,brown3,purp1,purp2,brown4,green2,yellow,blue2,red2) +-------- SPAWNFLAGS -------- +BUBBLES : Spawn bubbles within trigger volume when active +MONSTER_ONLY : Will only affect monsters +MODCHECK : Will remove this entity if THIS mod is active +FALLING : Only hurts if the player is falling (speed=velocity) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Will hurt any touching entity that can take damage +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_hurt_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.attack_finished > time) return; + if (self.bmodel_act.takedamage == DAMAGE_NO) return; + if (self.spawnflags & TRIG_HURTMONSTER && !(self.bmodel_act.flags & FL_MONSTER)) return; + // Check for falling damage conditions (player + flying + speeding) + if (self.spawnflags & TRIG_HURTFALLING) { + // Only affects players and monsters + if (!(self.bmodel_act.flags & FL_MONSTER) && + !(self.bmodel_act.flags & FL_CLIENT)) return; + if (self.bmodel_act.flags & FL_ONGROUND) return; + // Can't kill something dead already! + if (self.bmodel_act.health < 1) return; + if (fabs(self.bmodel_act.velocity_z) < self.speed) return; + } + + // Check for any dead monster bodies (no exceptions) + if (trigger_check_body(self.bmodel_act,DEAD_EXPLODE)) return; + + // Check for godmode players taking screenshots! + if (self.bmodel_act.flags & FL_CLIENT && self.bmodel_act.flags & FL_GODMODE) return; + + // Block touch function based on wait time + self.attack_finished = time + self.wait; + T_Damage (self.bmodel_act, self, self, self.dmg, DAMARMOR); +}; + +//---------------------------------------------------------------------- +void() trigger_hurt_on = +{ + self.estate = ESTATE_ON; + self.solid = SOLID_TRIGGER; + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + // Spawn bubbles inside volume brush + trigger_spawn_bubbles(); +}; + +//---------------------------------------------------------------------- +void() trigger_hurt = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.spawnflags & TRIG_MODCHECK) { remove(self); return; } + self.classtype = CT_TRIGHURT; + InitTrigger (); + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + if (self.dmg < 0) self.dmg = 0; + else if (self.dmg == 0) self.dmg = 5; + if (self.wait <= 0) self.wait = 1; + + // Setup bubble model/counter/volume + if (self.spawnflags & TRIG_SPAWNBUBBLES) trigger_setup_bubbles(); + + // Setup default falling damage speed + if (self.spawnflags & TRIG_HURTFALLING && self.speed < 1) self.speed = 300; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trigger_hurt_on; + self.estate_off = trigger_bmodel_off; + self.estate_disable = trigger_bmodel_disable; + if (self.dmg > 0) { + self.estate_fire = trigger_hurt_fire; + self.touch = trigger_bmodel_anytouch; + } + + // Switch on OR off? + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +/*====================================================================== +/*QUAKED trigger_heal (.5 .5 .5) ? x BUBBLES x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Heals any player who touches this trigger +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger once when players stands in trigger (start cycle) +target2 : trigger once when healing expires (finish cycle) +wait : time between healing (default 1s) +healamount : amount to heal each time touched (default 10) +max_health : total amount to heal (default 50, -1=no limit) +sounds : 1=heal_15, 2=heal_25, 3=heal_100, 4=respawn, 5=custom (default 1) +noise : Custom sound for healing +lip : All messages are silent to the player (heal/expire) 1=block heal 2=block all +message : centerprints when players stands in trigger +message2 : centerprints when healing function has expired +height : Maximum travel distance up for bubbles (default trigger size) +count : total amount of active bubbles at once (default 5) +style : 1-15 (grey,brown1,blue1,green1,red1,brown2,pinkyel,brown3,purp1,purp2,brown4,green2,yellow,blue2,red2) +yaw_speed : spawning rate (def=0.5) for bubbles (speed + random() x speed) +-------- SPAWNFLAGS -------- +BUBBLES : Spawn bubbles within trigger volume when active +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Heals any player who touches this trigger, can be triggered on/off and produces +bubbles within the bounding box of the trigger when spawnflag enabled + +======================================================================*/ +void() trigger_heal_touch = +{ + if (self.estate & ESTATE_BLOCK) return; // Function off/disabled + if (self.attack_finished > time) return; // Touch blocked (temporary) + if ( !(other.flags & FL_CLIENT) ) return; // Only works with clients + if (other.health < 1 ) return; // Cannot heal, target is dead + if (self.health < 1) return; // Run out of health + + // Do not constantly check healing, use wait + self.attack_finished = time + self.wait; + + // Can the pool heal the player? + if (!T_Heal(other, self.healamount, 0)) return; + + // Healing sound + sound (other, CHAN_BODY, self.noise, 1, ATTN_NORM); + // Has the pool run out of health? + if (self.max_health > 0) self.health = self.health - self.healamount; + + // Has the healing trigger expired? + if (self.health < 1) { + // Only block message lip=1 healing 2=all messages + if (self.lip < 2) centerprint (other, self.message2); + // Fire any targets once (finish of healing cycle) + if (self.target2 != "") {trigger_strs(self.target2, other);self.target2 = "";} + // Switch off healing trigger + entity_state_off(); + } + else { + // Fire any targets once (start of healing cycle) + if (self.target != "") {trigger_strs(self.target, other);self.target = "";} + // Display healing message (check for lip block) + if (!self.lip) centerprint (other, self.message); + } +}; + +//---------------------------------------------------------------------- +void() trigger_heal_on = +{ + if (self.health > 0) { + self.estate = ESTATE_ON; + self.solid = SOLID_TRIGGER; + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + // Spawn bubbles inside volume brush + trigger_spawn_bubbles(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_heal_reset = +{ + if (self.max_health > 0) { + // Reset health, targets and switch on entity + self.health = self.max_health; + if (self.noise1 != "") self.target = self.noise1; + if (self.noise2 != "") self.target2 = self.noise2; + self.estate_on(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_heal = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGHEAL; + InitTrigger (); + + // Setup default healing sound + if (self.sounds == 2) self.noise = SOUND_HEAL25; + else if (self.sounds == 3) self.noise = SOUND_HEAL100; + else if (self.sounds == 4) self.noise = SOUND_RESPAWN; + else if (self.sounds == 5 && self.noise == "") self.noise = SOUND_HEAL15; + else self.noise = SOUND_HEAL15; + precache_sound(self.noise); + + // Setup bubble model/counter/volume + if (self.spawnflags & TRIG_SPAWNBUBBLES) trigger_setup_bubbles(); + + if (!self.wait) self.wait = 1; // Default trigger time + if (self.healamount < 1) self.healamount = 10; // Quantity to heal each touch trigger + if (!self.max_health) self.max_health = 50; // Default max healing + // Cannot have healamount large than max, need to cap healamount + if (self.max_health > 0 && self.max_health < self.healamount) + self.healamount = self.max_health; + + if (self.max_health < 0) self.health = 100; // max < 0 = Infinite healing + else self.health = self.max_health; // Reset total ready + + if (!self.message) self.message = "You feel the effects of the healing pool"; + if (!self.message2) self.message2 = "The Healing Pool has expired!"; + + // Save any trigger names for reset events + if (self.target != "" ) self.noise1 = self.target; + if (self.target2 != "" ) self.noise2 = self.target2; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trigger_heal_on; + self.estate_off = trigger_bmodel_off; + self.estate_disable = trigger_bmodel_disable; + self.estate_reset = trigger_heal_reset; + self.touch = trigger_heal_touch; + + // Switch on OR off? + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +/*====================================================================== +/*QUAKED trigger_touchsound (.5 .5 .5) ? x x WORLDGEO DRAIN x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Plays sounds when touched by the player +------- KEYS -------- +targetname : trigger entity (works with entity state system) +sounds : 1=Water (def) 2=Slime 3=Lava 4=silent 5=custom +noise : Custom trigger touch sound +noise1 : Custom trigger exit sound +noise2 : Custom draining sound +speed : Time (def=1.5s) to drain liquid +yaw_speed : Vertical drain speed (def=0.05) +water_alpha: Alpha value for liquid (override worldspawn) +-------- SPAWNFLAGS -------- +WORLDGEO : Will draw bmodel (not just a trigger) +DRAIN : Drain effect when trigger_disabled +STARTOFF : Requires trigger to activate +------- NOTES -------- +Plays sounds when touched by the player + +======================================================================*/ +void() trigger_tsound_touch = +{ + if (self.estate & ESTATE_BLOCK) return; // Function off/disabled + if (self.attack_finished > time) return; // Touch blocked (temporary) + if ( !(other.flags & FL_CLIENT) ) return; // Only works with clients + if (other.health < 1 ) return; // other is dead + + if (other.touchedliquid < time) + sound (other, CHAN_BODY, self.noise, 1, ATTN_NORM); + other.touchedliquid = time + 0.1; + other.touchedsound = self.noise1; + self.attack_finished = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + self.origin = self.oldorigin; + self.alpha = self.water_alpha; + if (self.spawnflags & TRIG_TSOUNDWGEO) setmodel (self, self.mdl); +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_fade = +{ + // Take draining time and divide by time passed + self.lip = self.speed - ((time - self.ltime) / self.speed); + // Start at current alpha value and move towards 0 + self.alpha = self.lip * (self.water_alpha / self.speed); + // Slowly sink into the ground as alpha fading + self.origin_z = self.origin_z - (self.speed * self.yaw_speed); + // Exit condition + if (self.alpha <= 0) { + self.alpha = 0.01; + self.modelindex = 0; // Make sure no model + self.model = ""; + self.estate = ESTATE_OFF; + return; + } + // Keep on loop (using minimum QS time segment) + self.nextthink = time + FADEMODEL_TIME; +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_drain = +{ sound(self, CHAN_AUTO, self.owner.noise2, 1, ATTN_NORM); }; + +//---------------------------------------------------------------------- +void() trigger_tsound_disable = +{ + if (self.estate & ESTATE_BLOCK) return; + self.solid = SOLID_NOT; + self.estate = ESTATE_DISABLE; + + if (self.spawnflags & TRIG_TSOUNDDRAIN) { + // Allow for bmodel timer to alpha correctly + self.ltime = time; + // Gradually fade and lower bmodel + self.think = trigger_tsound_fade; + self.nextthink = time + FADEMODEL_TIME; + // Start playing draining sound + self.sound_emitter.think = trigger_tsound_drain; + self.sound_emitter.nextthink = time + self.super_time; + } +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_syncalpha = +{ + // Allow for trigger to override global water alpha + if (self.water_alpha > 0) self.alpha = self.water_alpha; + else if (liquid_alpha > 0) self.alpha = liquid_alpha; + else self.alpha = 1; + // Save this value for later + self.water_alpha = self.alpha; + if (!(self.spawnflags & ENT_STARTOFF)) self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() trigger_touchsound = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGTSOUND; + self.mdl = self.model; + InitTrigger (); + + if (!self.speed) self.speed = 1.5; + if (!self.yaw_speed) self.yaw_speed = 0.05; + if (self.super_time < 0.1) self.super_time = 0.1; + self.attack_finished = 0; + self.oldorigin = self.origin; + + // Default sounds (water) + if (self.sounds < 1) self.sounds = 1; + + // Precache all sounds + if (self.sounds == 1) { + if (self.noise == "") self.noise = "player/inh2o.wav"; + if (self.noise1 == "") self.noise1 = "misc/outwater.wav"; + } + else if (self.sounds == 2) { + if (self.noise == "") self.noise = "player/slimbrn2.wav"; + if (self.noise1 == "") self.noise1 = "misc/outwater.wav"; + } + else if (self.sounds == 3) { + if (self.noise == "") self.noise = "player/inlava.wav"; + if (self.noise1 == "") self.noise1 = "misc/outwater.wav"; + } + // make sure there is always a sound (empty) defined + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + + precache_sound(self.noise); + precache_sound(self.noise1); + + if (self.spawnflags & TRIG_TSOUNDDRAIN) { + if (self.noise2 == "") self.noise2 = "ambience/liquid_drain.wav"; + precache_sound(self.noise2); + // Create an entity to play drain sound + // bmodel origins are at 0,0,0 so never play properly + self.sound_emitter = spawn(); + self.sound_emitter.owner = self; + self.sound_emitter.origin = bmodel_origin(self) + '0 0 32'; + self.sound_emitter.solid = SOLID_NOT; + self.sound_emitter.movetype = MOVETYPE_NONE; + setmodel(self.sound_emitter, MODEL_EMPTY); + setorigin(self.sound_emitter, self.sound_emitter.origin); + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trigger_tsound_on; + self.estate_off = trigger_bmodel_off; + self.estate_disable = trigger_tsound_disable; + self.touch = trigger_tsound_touch; + + // Switch off? + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + + // Sync the water alpha console variable + self.think = trigger_tsound_syncalpha; + self.nextthink = time + 0.1 + random(); +}; + +/*====================================================================== +/*QUAKED trigger_void (.5 .5 .5) ? NO_CLIENT NO_MONSTER NO_AMMO NO_EGG NO_TEMP NO_ITEM STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Garbage collector for bottom of skyboxes +------- KEYS -------- +targetname : trigger entity (works with entity state system) +-------- SPAWNFLAGS -------- +NO_CLIENT : Ignore clients (anything flagged as a client) +NO_MONSTER : Ignore monsters (anything flagged as a monster) +NO_AMMO : Ignore ammo types (all ammo projectile types) +NO_EGG : Ignore minion eggs (affects shalrath, wraiths) +NO_TEMP : Ignore temporary ents (gibs, sparks, smoke) +NO_ITEM : Ignore items (weapons,armor,keys,runes,powerups) +STARTOFF : Requires trigger to activate +------- NOTES -------- +Garbage collector for bottom of skyboxes +======================================================================*/ +void() trigger_void_touch = +{ + // Exception, entity state and particles! + if (self.estate & ESTATE_BLOCK) return; + if (other.classtype == CT_PARTICLE) return; + + // Check for any dead monster bodies (no exceptions) + if (trigger_check_body(other,DEAD_REMOVE)) return; + + // Process spawnflag exceptions + if (self.spawnflags & TRIG_VOIDNOCLIENT && other.flags & FL_CLIENT) return; + if (self.spawnflags & TRIG_VOIDNOMONSTER && other.flags & FL_MONSTER) return; + if (self.spawnflags & TRIG_VOIDNOAMMO) { + if (other.classgroup == CG_PROJALL) return; + else if (other.classgroup == CG_PROJSHELLS) return; + else if (other.classgroup == CG_PROJNAILS) return; + else if (other.classgroup == CG_PROJROCKETS) return; + else if (other.classgroup == CG_PROJCELLS) return; + } + if (self.spawnflags & TRIG_VOIDNOGG && other.classgroup == CG_MINIONEGG) return; + if (self.spawnflags & TRIG_VOIDNOTEMP && other.classgroup == CG_TEMPENT) return; + if (self.spawnflags & TRIG_VOIDNOITEM) { + if (other.classgroup == CG_WEAPON) return; + else if (other.classgroup == CG_AMMOITEM) return; + else if (other.classgroup == CG_ARMOR) return; + else if (other.classgroup == CG_KEY) return; + else if (other.classgroup == CG_RUNE) return; + else if (other.classgroup == CG_ARTIFACT) return; + } + + // flag touching entity, so other functions will ignore it + other.touchedvoid = TRUE; + + // Let monsters and clients die through their own functions + if (other.flags & FL_CLIENT || other.flags & FL_MONSTER) + T_Damage (other, self, self, other.health+8, NOARMOR); + else { + // Remove all ammo projectiles on contact + // Hide other items types (may have particles active) + if (other.classgroup == CG_PROJALL) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJSHELLS) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJNAILS) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJROCKETS) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJCELLS) entity_remove(other,0.1); + else if (other.classgroup == CG_MINIONEGG) entity_remove(other,0.1); + else if (other.classgroup == CG_TEMPENT) entity_remove(other,0.1); + else if (other.classgroup == CG_WEAPON) entity_hide(other); + else if (other.classgroup == CG_AMMOITEM) { + entity_hide(other); + // Hide any shell/nail lids + if (other.attachment) entity_hide(other.attachment); + } + else if (other.classgroup == CG_ARMOR) entity_hide(other); + else if (other.classgroup == CG_KEY) entity_hide(other); + else if (other.classgroup == CG_RUNE) entity_hide(other); + else if (other.classgroup == CG_ARTIFACT) entity_hide(other); + else if (other.classgroup == CG_MISCENT) entity_hide(other); + else if (other.classgroup == CG_BREAKABLE) entity_hide(other); + } +}; + +//---------------------------------------------------------------------- +void() trigger_void = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGVOID; + InitTrigger (); + setsize (self, self.bbmins, self.bbmaxs); + + // Setup Entity State functionality + // This does not work via typical trigger bmodel paths + // This trigger is special, needs to work straight away + // There is only a toggle/on/off state function + if (self.targetname != "") self.use = entity_state_use; + self.touch = trigger_void_touch; + if (self.spawnflags & ENT_STARTOFF) self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; +}; diff --git a/QC_other/QC_arcane/triggers_states.qc b/QC_other/QC_arcane/triggers_states.qc new file mode 100644 index 00000000..8c225589 --- /dev/null +++ b/QC_other/QC_arcane/triggers_states.qc @@ -0,0 +1,364 @@ +/*====================================================================== + TRIGGER STATE FUNCTIONS +======================================================================*/ +float TRIG_NOTOUCH = 1; // Touch functionality is disabled +float TRIG_DEVMODE = 4; // Will only trigger in dev model +float TRIG_INVIEW = 8; // player has to see trigger +float TRIG_MODCHECK = 16; // Will remove this entity if THIS mod is active +float TRIG_MONSTERS = 32; // Can be touched/triggered by monsters +// float ENT_STARTOFF = 64; // Global spawnflags setting + +// Added by functions, no map entity interaction +float TRIG_NODAMAGE = 16384; // Block trigger damage functionality +float TRIG_ALWAYTOUCH = 32768; // Always allow touch function to exist + +//---------------------------------------------------------------------- +void() trigger_bmodel_sounds = +{ + // Used by lots of different triggers for standard sounds + if (self.sounds == 1) self.noise = "misc/secret.wav"; + else if (self.sounds == 2) self.noise = SOUND_TALK; + else if (self.sounds == 3) self.noise = "misc/trigger1.wav"; + else if (self.sounds == 4) self.noise = SOUND_EMPTY; + else if (self.sounds == 6) self.noise = "misc/secret3.wav"; + // precache any sounds that have been defined + if (self.noise != "") precache_sound(self.noise); +}; + +//---------------------------------------------------------------------- +// Special sight trigger, Is the player *looking* at this trigger +// This sight trigger cannot be disabled or turned off atm +//---------------------------------------------------------------------- +void() trigger_bmodel_inview = +{ + local entity client, tself; + local float play_dist, play_range, play_angle; + + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + + // Checkclient needs an proper entity origin, bmodels are '0 0 0' + // Create a temporary entity to switch around too for checkclient + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.oldorigin = bmodel_origin(self); + setorigin(self.attachment, self.oldorigin); + } + + // Swap around self/attachment so checkclient can work properly + tself = self; self = self.attachment; + client = checkclient (); // Find a client in current PVS + self = tself; + + // Found a player to check sight/distance for? + if (client.flags & FL_CLIENT) { + if (visxray(client, VEC_ORIGIN, VEC_ORIGIN, FALSE)) { + // Work out vector length between entity and player + play_dist = vlen(self.oldorigin - client.origin); + // Is there a distance check active? if not make sure it will pass + if (!self.t_length) play_range = play_dist + 1; + else play_range = self.t_length; + + // The angle the player is facing towards the trigger (45 = forward) + play_angle = viewangle(self.oldorigin, client.origin, 45, TRUE, client.v_angle_y); + + // Check distance is correct and facing angle focused + if (play_dist < play_range && play_angle > 30 && play_angle < 60) { + self.wait = -1; + self.bmodel_act = activator; + self.estate_fire(); + return; + } + } + } + + // Keep checking, 0.1 standard entity timing + self.nextthink = time + 0.1; + self.think = trigger_bmodel_inview; +}; + +//---------------------------------------------------------------------- +// the trigger was just touched/killed/used +// self.bmodel_act should be set to the activator so it can be held +// through a delay so wait for the delay time before firing +//---------------------------------------------------------------------- +void() trigger_bmodel_fire = +{ + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + + // Check for developer mode only triggers + if (self.spawnflags & TRIG_DEVMODE && developer == 0) { + // This feature only work for ONCE/MULTIPLE triggers + if (self.classtype == CT_TRIGONCE || + self.classtype == CT_TRIGMULTI) return; + } + + //---------------------------------------------------------------------- + // The Shotgun and Axe upgrades can make maps too easy, allow for + // triggers to not fire if the key is TRUE and inventory empty + //---------------------------------------------------------------------- + if ( self.bmodel_act.flags & FL_CLIENT ) { + if (self.upgrade_axe && !(self.bmodel_act.moditems & IT_UPGRADE_AXE)) return; + if (self.upgrade_ssg && !(self.bmodel_act.moditems & IT_UPGRADE_SSG) ) return; + if (self.upgrade_lg && !(self.bmodel_act.moditems & IT_UPGRADE_LG) ) return; + } + + // Trigger secrets only work for players + if (self.classtype == CT_TRIGSECRET) { + // If trigger_secret has NOTOUCH then check activator + if (!(self.bmodel_act.flags & FL_CLIENT)) return; + // The trigger can be reset, so double check + if (self.count > 0) { + found_secrets = found_secrets + self.count; + WriteByte (MSG_ALL, SVC_FOUNDSECRET); + self.count = 0; // Secrets only work once + } + } + + // Play the sound ON the trigger, NOT the activator + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + //---------------------------------------------------------------------- + // One of the downside to trigger_multi and trigger_once is that they + // reset the activator global variable each time they are used. + // This can causes problems with triggers that require client references + // for centerprint/sound cues (like trigger_secret) + // The way to get around this problem is to use trigger_relay as this does + // not change the activator variable + // + activator = self.bmodel_act; + SUB_UseTargets(); + + // Is the trigger repeatable? + if (self.wait > 0) { + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + else { + // TRIGGER_ONCE functionality + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_use = +{ + // There is no client test here because this can come from + // multiple entity types, the activator is passed on + if (self.estate & ESTATE_BLOCK) return; + self.bmodel_act = activator; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_touch = +{ + // This is a client touch event, triggers that require + // other entity types need to have their own touch event + if (self.estate & ESTATE_BLOCK) return; + if ( !(self.spawnflags & TRIG_MONSTERS) && !(other.flags & FL_CLIENT) ) return; + + // Did the trigger have an angle key setup? + if (CheckZeroVector(self.movedir) == FALSE) { + makevectors (other.angles); + if (v_forward * self.movedir < 0) return; + } + + self.bmodel_act = other; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_anytouch = +{ + // This will allow anything to touch it + if (self.estate & ESTATE_BLOCK) return; + self.bmodel_act = other; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_killed = +{ + // The proto button setup of triggers using health + // Always reset health regardless if blocked or not + self.health = self.max_health; + if (self.estate & ESTATE_BLOCK) return; + self.takedamage = DAMAGE_NO; + self.bmodel_act = damage_attacker; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +// Setup touch/damage/bounding box functionality +//---------------------------------------------------------------------- +void() trigger_bmodel_restore = +{ + // Damage functionality + if (self.max_health > 0 && !(self.spawnflags & TRIG_NODAMAGE) ) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + } + // The extra option (ALWAYSTOUCH) was added because some triggers + // have re-used spawnflag 1 for other purposes and they still need + // touch founctionality + else if ( !(self.spawnflags & TRIG_NOTOUCH) || self.spawnflags & TRIG_ALWAYTOUCH) + self.solid = SOLID_TRIGGER; + // Turn off touch functionality + else self.solid = SOLID_NOT; + + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_delay = +{ + if (self.estate == ESTATE_DISABLE) return; + + // Remove the START OFF functionality + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Reset USE and trigger_once conditions + self.estate_use = trigger_bmodel_use; + self.attack_finished = 0; + self.estate = ESTATE_ON; + + // Check if the player needs to be inview before triggering? + // It would be weird to have this on multiple/secret triggers + if (self.classtype == CT_TRIGONCE && self.spawnflags & TRIG_INVIEW) { + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + // Inview triggers are not touchable and cannot be damaged + self.spawnflags = self.spawnflags | TRIG_NOTOUCH | TRIG_NODAMAGE; + self.estate_use = trigger_bmodel_inview; + self.estate_use(); + return; + } + + //---------------------------------------------------------------------- + // I would have never of guessed this was used throughout the original + // ID maps and there are countless cases of trigger_multiple entities + // being used like buttons that can be damaged but not touched. + // I get the impression this was a prototype stage of development where + // everyone was waiting for func_button functionality to come online. + // + if (self.health && !(self.spawnflags & TRIG_NODAMAGE)) { + self.max_health = self.health; // save health for later + self.th_die = trigger_bmodel_killed; // damage trigger + } + else { + // Setup touch functionality + if ( !(self.spawnflags & TRIG_NOTOUCH) || self.spawnflags & TRIG_ALWAYTOUCH) { + if (!self.touch) self.touch = trigger_bmodel_touch; + } + } + + // Setup touch/damage/bounding box functionality + trigger_bmodel_restore(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_on = +{ + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + + // Check for delayed/trigger_once functionality? + if (self.spawnflags & ENT_STARTOFF || self.attack_finished > time) + self.solid = SOLID_NOT; + else { + // Setup touch/damage/bounding box functionality + trigger_bmodel_restore(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + self.estate_disable(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_reset = +{ + // Reset trigger_once conditions + self.attack_finished = 0; + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_disable = +{ + // Shutdown trigger completely + self.takedamage = DAMAGE_NO; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_default = +{ + self.estate_on = trigger_bmodel_on; + self.estate_off = trigger_bmodel_off; + if (!self.estate_fire) self.estate_fire = trigger_bmodel_fire; + self.estate_disable = trigger_bmodel_disable; + self.estate_reset = trigger_bmodel_reset; + self.estate = ESTATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_setup = +{ + trigger_bmodel_default(); + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_bmodel_delay; + + if (self.spawnflags & ENT_STARTOFF) { + self.estate_use = trigger_bmodel_delay; + self.estate_on = trigger_bmodel_delay; + self.estate_off(); + } + // The original functionality of the trigger is to pass through + else self.estate_use(); +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() multi_trigger = { + trigger_bmodel_default(); + trigger_bmodel_fire(); +}; +void() multi_killed = { + trigger_bmodel_default(); + trigger_bmodel_killed(); +}; +void() multi_use = { + trigger_bmodel_default(); + trigger_bmodel_use(); +}; +void() multi_touch = { + trigger_bmodel_default(); + trigger_bmodel_touch(); +}; +void() multi_wait = { + if (self.max_health) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + } +}; diff --git a/QC_other/QC_arcane/weapons.qc b/QC_other/QC_arcane/weapons.qc new file mode 100644 index 00000000..42bfd5da --- /dev/null +++ b/QC_other/QC_arcane/weapons.qc @@ -0,0 +1,1180 @@ +/*====================================================================== + PLAYER ONLY WEAPON FUNCTIONS + +void() W_Precache; - moved to world.qc +float() crandom; - moved to subs.qc +vector() wall_velocity - merged into spawn_touchblood (only used once) +void(vector org, vector vel) SpawnChunk - Not used anywhere, removed + + W_SetCurrentAmmo - Update HUD icons based on self.weapon value + W_BestWeapon - returns best weapon LG > SNG > SSG > NG > SG > Axe + interesting that the function does not return GL/RL + W_CheckNoAmmo - Ammo check for attack function + W_Attack - Main function that fire weapons (player animations) + Will automatically wakeup any nearby monsters + W_ChangeWeapon - Change weapon based on availabilty and ammo + CycleWeaponCommand - Move forward or backward through active weapons + CycleWeaponReverseCommand + W_WeaponFrame - Called every frame, catches impulse event + SuperDamageSound - Plays quad damage sound + +======================================================================*/ +void() player_run; // Start of run cycle +void(entity targ) remoteplayer_run; +void() player_axe1; // Different Axe animations +void() player_axeb1; +void() player_axec1; +void() player_axed1; +void() player_axee1; +void() player_sg1; // Shotgun +void() player_supersg1; // Super Shotgun +void() player_nail1; // Nailgun +void() player_snail1; // Super Nailgun +void() player_rocket1; // Rocket Launcher +void() player_grenade1; // Grenade Launcher +void() player_light1; // Thunderbolt +void() player_plasma1; // Plasma Gun + +void() player_ssgreset; // Reset weaponframe +void() player_sgreset; +void() player_grenreset; +void() player_rockreset; + +/*====================================================================== + Weapon ammo run out and switching to next best weapon +======================================================================*/ +void(float wait_time) forceweaponswitch = +{ + local float nextweap; + + // has the player run out of ammo? work out next best weapon + nextweap = W_BestWeapon (self); + // Does the player need to switch weapons? + if (self.weapon != nextweap) { + self.weapon = nextweap; + W_SetCurrentAmmo (self); + } +}; + +/*====================================================================== + W_FireAxe +======================================================================*/ +void() W_FireAxe = +{ + local vector source, org, vec; + local float src_dist, dotprod, axedmg; + local entity onflr; + + makevectors (self.v_angle); // Player forward angle + source = self.origin + '0 0 16'; // Move source point up body + + if (self.flags & FL_GODMODE && self.flags & FL_NOTARGET) { + traceline (source, source + (v_forward* RANGE_PLAYAXE), FALSE, self); + if (trace_fraction < 1.0) { + if (trace_ent.flags & FL_MONSTER && trace_ent.health > 0) { + dprint("\n\b[DEBUG]\b system active, changing monster\n"); + trace_ent.debuglvl = 1 - trace_ent.debuglvl; + } + } + return; + } + + if (self.moditems & IT_UPGRADE_AXE) { + // See if there are any bodies lying around + onflr = find(world, bodyonflr, MON_ONFLR); + while (onflr) { + src_dist = vlen(source - onflr.origin); + if (src_dist < RANGE_CHOPAXE) { // Is the body close to the player? + org = onflr.origin - '0 0 16'; // move origin close to floor + makevectors (self.v_angle); // Calculate viewing angle + vec = normalize (org - self.origin); + dotprod = vec * v_forward; + if (dotprod > 0.6) { // Is the body infront of the player + onflr.origin = org; // Move gib closer to floor + // Now a function in ai_gibs, used by boil explosion as well + monster_flrbody_gib(onflr, axedmg*4); + return; + } + } + // See if there are anymore bodies close by + onflr = find(onflr,bodyonflr, MON_ONFLR); + } + } + + // Trace forward and see if the axe has hit anything? + traceline (source, source + (v_forward* RANGE_PLAYAXE), FALSE, self); + if (trace_fraction == 1.0) return; // No contact, no hit + + org = trace_endpos - v_forward*4; // Back 4 units to spawn blood + + // Only stuff that can be damaged has unique impact sounds + if (trace_ent.takedamage) { + // Mark the monster with type of axe used and change damage + if (self.moditems & IT_UPGRADE_AXE) { + axedmg = DAMAGE_PLAYAXE2; trace_ent.axhitme = 2; } + else { + axedmg = DAMAGE_PLAYAXE1; trace_ent.axhitme = 1; } + + // Spamn blood always up so player can see it + SpawnBlood (trace_ent, org, '0 0 1', axedmg); + T_Damage (trace_ent, self, self, axedmg, DAMARMOR); + + // Monster impact sounds (fleshy stuff) + if (trace_ent.flags & FL_MONSTER) { + if (random() < 0.5) sound (self, CHAN_WEAPON, GIB_SOUND_HEAVY, 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, GIB_SOUND_HEAVY2, 1, ATTN_NORM); + } + // Breakable impact sounds (def=stone/brick) + else if (trace_ent.classtype == CT_FUNCBREAK) { + if (trace_ent.style == BTYPE_WOOD) + sound (self, CHAN_WEAPON, SOUND_AXE_WOOD, 1, ATTN_NORM); + else if (trace_ent.style == BTYPE_GLASS) + sound (self, CHAN_WEAPON, SOUND_AXE_GLASS, 1, ATTN_NORM); + else if (trace_ent.style == BTYPE_METAL) + sound (self, CHAN_WEAPON, SOUND_AXE_METAL, 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, SOUND_AXE_STONE, 1, ATTN_NORM); + } + // Pushable impact sounds (def=stone/brick) + else if (trace_ent.classtype == CT_FUNCPUSHABLE) { + if (trace_ent.style == PTYPE_WOOD) + sound (self, CHAN_WEAPON, SOUND_AXE_WOOD, 1, ATTN_NORM); + else if (trace_ent.style == PTYPE_GLASS) + sound (self, CHAN_WEAPON, SOUND_AXE_GLASS, 1, ATTN_NORM); + else if (trace_ent.style == PTYPE_METAL) + sound (self, CHAN_WEAPON, SOUND_AXE_METAL, 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, SOUND_AXE_STONE, 1, ATTN_NORM); + } + } + //---------------------------------------------------------------------- + // WORLD OBJECT : Target does not bleed, play stone hitting sound + //---------------------------------------------------------------------- + else { + sound (self, CHAN_WEAPON, SOUND_AXE_STONE, 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + } +}; + +/*====================================================================== + OLD STYLE BULLET SYSTEM (HITSCAN) +======================================================================*/ +void() ClearMultiDamage = +{ + multi_ent = world; + multi_damage = 0; +}; + +//---------------------------------------------------------------------- +void() ApplyMultiDamage = +{ + local float temp_classgroup; + + // Return if no target entity + if (!multi_ent) return; + + // Check for bullet/shell resistance + if (multi_ent.resist_shells > 0) + multi_damage = Resist_Damage(multi_ent, IT_SHELLS, multi_damage); + + // Need to fool T_Damage that damage is coming from a shell + temp_classgroup = self.classgroup; + self.classgroup = CG_PROJSHELLS; + T_Damage (multi_ent, self, self, multi_damage, DAMARMOR); + self.classgroup = temp_classgroup; +}; + +//---------------------------------------------------------------------- +void(entity hit, float damage) AddMultiDamage = +{ + if (!hit) return; + + if (hit != multi_ent) { + ApplyMultiDamage (); + multi_damage = damage; + multi_ent = hit; + } + else multi_damage = multi_damage + damage; +}; + +//---------------------------------------------------------------------- +void(vector org, float marker_time) MarkAttack = +{ + newmis = spawn(); + newmis.classtype = CT_DEVMARKER; + newmis.movetype = MOVETYPE_NONE; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_IMPACT); + newmis.skin = rint(random()*7); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.think = SUB_Remove; + newmis.nextthink = time + marker_time; +}; + +//---------------------------------------------------------------------- +void(float damage, vector dir) TraceAttack = +{ + local vector vel, org; + + vel = normalize(dir + v_up*crandom() + v_right*crandom()); + vel = vel + 2*trace_plane_normal; + vel = vel * 200; + + org = trace_endpos - dir*4; + + // Check for sky content? skies don't impact or bleed + if (!check_skycontent(org)) { + if (trace_ent.takedamage) { + // Show bullet resistance as small blood+gunshot+smoke + if (trace_ent.resist_shells > 0) + Resist_Shells(trace_ent, org, vel, damage); + else { + // Hitting monsters does twice the amount of blood effects + if (trace_ent.flags & FL_MONSTER) SpawnBlood (trace_ent, org, vel*0.2, damage*2); + else SpawnBlood (trace_ent, org, vel*0.2, damage); + } + // Keep adding up the damage + AddMultiDamage (trace_ent, damage); + + // Check for target dummy (manually create marker) + if (trace_ent.classtype == CT_TARGETDUMMY) + MarkAttack(org, trace_ent.wait); + } + else { + // Hit something that does not bleed (often world) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + } + } +}; + +//---------------------------------------------------------------------- +void(float shotcount, vector spread) FireBullets = +{ + local vector direction, src, dir; + + if (self.flags & FL_CLIENT) { + makevectors(self.v_angle); + src = self.origin + v_forward*10; + src_z = self.absmin_z + self.size_z * 0.7; + // Auto aim assist (builtin function 44) + if (autoaim_cvar < 1) dir = aim(self, SPEED_PLAYAIM); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYAIM); + } + else { + makevectors(self.angles); + src = self.origin + attack_vector(self.attack_offset); + // A monster attacking a monster will not dodge + if (self.enemy.flags & FL_MONSTER) + dir = normalize(self.enemy.origin - src); + else { + // fire somewhat behind the player + // so a dodging player is harder to hit + dir = self.enemy.origin - self.enemy.velocity*0.2; + dir = normalize (dir - src); + } + } + + ClearMultiDamage (); + while (shotcount > 0) { + direction = dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up; + traceline (src, src + direction*2048, FALSE, self); + if (trace_fraction != 1.0) TraceAttack (DAMAGE_SHELL, direction); + shotcount = shotcount - 1; + } + ApplyMultiDamage (); +}; + +/*====================================================================== +W_FireShotgun +======================================================================*/ +void() W_FireShotgun = +{ + local vector spread_pat; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_shells < 1) { forceweaponswitch(0.2); return;} + + // Change weapon sound if using Projectile Pellets + // IMPORTANT - default for Projectile Pellets is ON = 0 + if (!query_configflag(SVR_SHOTGPROJ)) + sound (self ,CHAN_WEAPON, "weapons/sg2.wav", 1, ATTN_NORM); + else + sound (self ,CHAN_WEAPON, "weapons/sg1.wav", 1, ATTN_NORM); + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.5; + self.punchangle_x = -2; + player_sgreset(); // reset weaponframe + + self.currentammo = self.ammo_shells = self.ammo_shells - 1; + + if (self.moditems & IT_ARTSHARP) spread_pat = SPREAD_SG2; + else spread_pat = SPREAD_SG; + + // Choose between a projectile or hitscan system + if (query_configflag(SVR_SHOTGPROJ)) { + FireBullets (QUANTITY_SG, spread_pat); + Launch_ShellCasing(1); // Shell casings + } + else { + Launch_Shells(QUANTITY_SG, spread_pat, CT_PROJ_SG); + Launch_ShellCasing(1); // Shell casings + } +}; + +/*====================================================================== +W_FireSuperShotgun +======================================================================*/ +void() W_FireSuperShotgun = +{ + local float ssg_qty, shell_qty; + local vector spread_pat; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_shells < 2) { forceweaponswitch(0.2); return;} + + makevectors (self.v_angle); // Special view angle for the player + + // if shot in the air - do Newton's 3rd law. (from zerstorer) + if (!(self.flags & FL_ONGROUND)) + self.velocity = self.velocity - (v_forward * 35); + + // Change weapon sound if using Shotgun Upgrade or Projectile Pellets + // IMPORTANT - default for Projectile Pellets is ON = 0 + if (self.moditems & IT_UPGRADE_SSG || !query_configflag(SVR_SHOTGPROJ)) + sound (self ,CHAN_WEAPON, "weapons/ssg2.wav", 1, ATTN_NORM); + else + sound (self ,CHAN_WEAPON, "weapons/ssg1.wav", 1, ATTN_NORM); + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.7; + self.punchangle_x = -4; + player_ssgreset(); // reset weaponframe + shell_qty = 2; // Standard shell casings quantity + + // If the player has the Widowmaker, setup triple shot + if (self.moditems & IT_UPGRADE_SSG) { + // Only got 2 shells in the gun (reduced damage) + if (self.ammo_shells < 3) { + self.ammo_shells = 0; + ssg_qty = QUANTITY_SSG; + } + else { + // 150% damage + shell_qty = 3; + self.ammo_shells = self.ammo_shells - 3; + ssg_qty = QUANTITY_WM; + } + } + else { + // Default ID SSG damage + self.ammo_shells = self.ammo_shells - 2; + ssg_qty = QUANTITY_SSG; + } + + self.currentammo = self.ammo_shells; + if (self.moditems & IT_ARTSHARP) spread_pat = SPREAD_SSG2; + else spread_pat = SPREAD_SSG; + + // Choose between a projectile or hit-scan system + if (query_configflag(SVR_SHOTGPROJ)) { + FireBullets (ssg_qty, spread_pat); // Hit-scan + Launch_ShellCasing(shell_qty); + } + else { + Launch_Shells(ssg_qty, spread_pat, CT_PROJ_SSG); + Launch_ShellCasing(shell_qty); + } +}; + +/*====================================================================== +W_FireSpikes +======================================================================*/ +void(float oz, float ox) W_FireSpikes = +{ + local vector org, dir; + + // If run out of ammo, switch weapons to next best + if (self.ammo_nails < 1) { forceweaponswitch(0.2); return; } + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + makevectors (self.v_angle); + + // Check for auto aim state + // Auto aim assist (builtin function 44) + if (autoaim_cvar < 1) dir = aim(self, SPEED_PLAYSPIKE); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYSPIKE); + + // SNG setup, sound and ammo change + if (self.ammo_nails > 1 && self.weapon == IT_SUPER_NAILGUN) { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + self.currentammo = self.ammo_nails = self.ammo_nails - 2; + + //------------------------------------------------------------- + // Original setup - org = self.origin + '0 0 16'; + // - SNG projectile offset idea by Kinn + // org = self.origin + dir*14 + v_right*ox; + // org_z = org_z + oz; + // The SNG offset idea was hiting far below the crosshair + // which was causing impact problems. + // Kept the barrel offset, removed the Z adjustment instead! + //------------------------------------------------------------- + org = self.origin + '0 0 16' + v_right*ox; + launch_projectile (org, dir, CT_PROJ_SNG, SPEED_PLAYSPIKE); + } + // NG setup, sound and ammo change + else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + self.currentammo = self.ammo_nails = self.ammo_nails - 1; + + // Original setup - org = self.origin + '0 0 16' + v_right*ox; + // - NG projectile offset idea by Kinn + // org = self.origin + '0 0 8' + dir*14 + v_right*ox; + org = self.origin + '0 0 16' + v_right*ox; + launch_projectile (org, dir, CT_PROJ_NG, SPEED_PLAYSPIKE); + } +}; + +/*====================================================================== +GRENADES +======================================================================*/ +void() W_FireGrenade = +{ + local vector dir, avel; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_rockets < 1) { forceweaponswitch(0.2); return;} + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.6; + self.punchangle_x = -2; + player_grenreset(); // reset weaponframe + + makevectors (self.v_angle); + // Has the player aimed left/right? then no auto aim assist + if (self.v_angle_x) { + dir = v_forward*SPEED_PLAYGRENADE + v_up * ELEV_ZAXIS + crandom()*v_right*10 + crandom()*v_up*10; + } + else { + // Check for auto aim state + if (autoaim_cvar < 1) dir = aim(self, SPEED_PLAYAIM); + else dir = normalize(v_forward * SPEED_PLAYGRENADE); + // Work out default speed and elevation + dir = dir * SPEED_PLAYGRENADE; + dir_z = ELEV_ZAXIS; + } + avel = vecrand(100,200,FALSE); + Launch_Grenade(self.origin, dir, avel, CT_PROJ_GL); +}; + +/*====================================================================== + ROCKETS +======================================================================*/ +void() W_FireRocket = +{ + local vector org, dir; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_rockets < 1) { forceweaponswitch(0.2); return;} + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.8; + self.punchangle_x = -2; + player_rockreset(); // reset weaponframe + + makevectors (self.v_angle); + org = self.origin + v_forward * 8 + '0 0 16'; + + // Auto aim assist (builtin function 44) + if (autoaim_cvar < 1) dir = aim(self, SPEED_RLPLAYER); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_RLPLAYER); + + Launch_Missile (org, dir, '0 0 0', CT_PROJ_ROCKET, SPEED_RLPLAYER); +}; + +/*====================================================================== +PLASMA +======================================================================*/ +void() W_FirePlasma = +{ + local vector org, dir; + + // If run out of ammo, switch weapons to next best + if (self.attack_finished > time) return; + if (self.ammo_cells < 1) { forceweaponswitch(0.2); return; } + + // Do nothing if weapon is under water + if (self.waterlevel > 1) { + self.attack_finished = time + 0.2; + sound (self, CHAN_WEAPON, "weapons/nofire.wav", 1, ATTN_NORM); + return; + } + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + + makevectors (self.v_angle); + + // Check for auto aim state + // Auto aim assist (builtin function 44) + if (autoaim_cvar < 1) dir = aim(self, SPEED_PLAYPLASMA); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYPLASMA); + + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + self.currentammo = self.ammo_cells = self.ammo_cells - 1; + + org = self.origin + v_forward*8 + '0 0 16'; + launch_plasma (org, dir, CT_PLAYER, SPEED_PLAYPLASMA); +}; + +/*====================================================================== +LIGHTNING +======================================================================*/ +void(vector lstart, entity lsource, float ldamage) LightningReflection; +//---------------------------------------------------------------------- +// This is a general purpose lighting damage function +// Used by monsters and traps +//---------------------------------------------------------------------- +void(vector lstart, vector lfinish, entity lsource, float ldamage) LightningDamage = +{ + local vector spot1, spot2, lightdir; + local float lighthit, loffset; + + lighthit = FALSE; + loffset = 8; + + // Traceline 1 - Direct single line from source to target + traceline (lstart, lfinish, FALSE, lsource); + if (trace_ent.takedamage > DAMAGE_NO) lighthit = TRUE; + else { + // Where out vector direction from source to target + lightdir = lfinish - lstart; + makevectors(lightdir); + + // Traceline 2 - Left and right of center + spot1 = lstart + v_right * loffset; + spot2 = lfinish + v_right * loffset; + traceline (spot1, spot2, FALSE, lsource); + if (trace_ent.takedamage > DAMAGE_NO) lighthit = TRUE; + else { + spot1 = lstart - v_right * loffset; + spot2 = lfinish - v_right * loffset; + traceline (spot1, spot2, FALSE, lsource); + if (trace_ent.takedamage > DAMAGE_NO) lighthit = TRUE; + else { + // Traceline 3 - Up and down of center + spot1 = lstart + v_up * loffset; + spot2 = lfinish + v_up * loffset; + traceline (spot1, spot2, FALSE, lsource); + if (trace_ent.takedamage > DAMAGE_NO) lighthit = TRUE; + else { + spot1 = lstart - v_up * loffset; + spot2 = lfinish - v_up * loffset; + traceline (spot1, spot2, FALSE, lsource); + if (trace_ent.takedamage > DAMAGE_NO) lighthit = TRUE; + } + } + } + } + + // Found a target to hit? + if (lighthit) { + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self, trace_ent)) { + // This is resist lightning function without pain sound + // Don't spawn smoke constantly (let the sprite finish) + if (self.lightning_timer < time) { + self.lightning_timer = time + 0.3; + SpawnExplosion(EXPLODE_BURST_SMOKE, trace_endpos, ""); + } + SpawnProjectileSmoke(trace_endpos, 200, 50, 150); + } + //---------------------------------------------------------------------- + // Check for any cell/lightning resistance + else if (trace_ent.resist_cells > 0) { + ldamage = Resist_Damage(trace_ent, IT_CELLS, ldamage); + Resist_Lightning(trace_ent, trace_endpos); + if (ldamage > 0) + // classic damage from source with armour saves + T_Damage (trace_ent, lsource, lsource, ldamage, DAMARMOR); + } + else { + // Originally used 225 blood colour + SpawnBlood(trace_ent, trace_endpos, '0 0 100', ldamage*4); + T_Damage (trace_ent, lsource, lsource, ldamage, DAMARMOR); + } + // Check for any lightning reflection abilitites + if (trace_ent.reflectlightning) { + // Source = Lightning originally came from player + LightningReflection(trace_endpos, trace_ent, ldamage*0.5); + } + } +}; + +//---------------------------------------------------------------------- +// New ability to spawn lighting strikes in random directions +//---------------------------------------------------------------------- +void(vector lstart, entity lsource, float ldamage) LightningReflection = +{ + local vector lfinish, dir; + + // Setup a random XYZ direction (+/-) + lfinish = lstart + vecrand(0,1000,1); + + // Trace line in random direction + traceline(lstart, lfinish, FALSE, lsource); + + // Random chance of a plasma/lightning bolt! + if (random() < 0.5) { + dir = normalize(trace_endpos - lstart); + launch_plasma(lstart, dir, CT_REFLECTLIGHT, SPEED_REFLECTION); + } + else { + // Draw lighting beam (32 model unit chunks) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, lsource); + WriteCoord (MSG_BROADCAST, lstart_x); + WriteCoord (MSG_BROADCAST, lstart_y); + WriteCoord (MSG_BROADCAST, lstart_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + // Check for damage with new lightning beam + LightningDamage(lstart, trace_endpos, world, ldamage); + } +}; + +//---------------------------------------------------------------------- +// This lightning damage check is designed for the lightning gun +// with many modifiers designed for the player and MP combat +// This function should not be used for general lightning damage +//---------------------------------------------------------------------- +void(vector p1, vector p2, entity from, float damage) PlayerLightningDamage = +{ + local entity e1, e2; + local vector f; + local float lighthit, temp_classgroup; + + f = p2 - p1; + normalize (f); + f_x = 0 - f_y; + f_y = f_x; + f_z = 0; + f = f*16; + + e1 = e2 = world; + lighthit = FALSE; + // LightningDamage (org, trace_endpos, self, 10); + // dprint("Light ("); dprint(trace_ent.classname); dprint(")\n"); + traceline (p1, p2, FALSE, self); + if (trace_ent.takedamage) { + lighthit = TRUE; + // Some weird MP velocity hack! + // The story about this code (from quakeworld.nu) + // + // This code appears to have been there for a long, long time. + // It was there in Quake 1.06 Shareware release, and it may have + // been there before that. Someone must have been experimenting + // with something and forgot it there, but no one noticed because + // in that function, the 'other' entity is not usually set to + // anything in particular, and the code never worked. + // + // But then QW came along, and in the QW engine it turns out + // that 'other' will be set to 'self' if the player is touching + // a platform. And so the dormant code stared working! It was + // discovered by players, and players started using it to their + // advantage. Now it's an integral part of dm6 gameplay. + // + // The code was apparently discovered and removed when Quake QC + // code was cleaned up before being released to public, so you + // won't normally see it in NQ mods. But it is there in the + // progs.dat in pak0.pak; and it will work in QuakeWorld engines + // supporting progs.dat (currently FTE and ZQuake). + // + if (self.classtype == CT_PLAYER) { + if (other.classtype == CT_PLAYER) + trace_ent.velocity_z = trace_ent.velocity_z + 400; + } + } + else { + e1 = trace_ent; + + traceline (p1 + f, p2 + f, FALSE, self); + if (trace_ent != e1 && trace_ent.takedamage) lighthit = TRUE; + else { + e2 = trace_ent; + + traceline (p1 - f, p2 - f, FALSE, self); + if (trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage) + lighthit = TRUE; + } + } + + // Found a target to hit? + if (lighthit) { + // Check for any cell/lightning resistance + if (trace_ent.resist_cells > 0) { + damage = Resist_Damage(trace_ent, IT_CELLS, damage); + Resist_Lightning(trace_ent, trace_endpos); + if (damage > 0) { + // Need to fool T_Damage that damage is coming from LG + temp_classgroup = from.classgroup; + from.classgroup = CG_PROJCELLS; + T_Damage (trace_ent, from, from, damage, DAMARMOR); + from.classgroup = temp_classgroup; + } + } + else { + // Originally used 225 blood colour + SpawnBlood(trace_ent, trace_endpos, '0 0 100', damage*4); + T_Damage (trace_ent, from, from, damage, DAMARMOR); + } + // Check for any lightning reflection abilitites + if (trace_ent.reflectlightning) { + // Source = Lightning originally came from player + LightningReflection(trace_endpos, trace_ent, damage*0.5); + } + } +}; + +//---------------------------------------------------------------------- +void() W_FireLightning = +{ + local vector dir; + local float cells; + + // Ran out of ammo, switch to next best weapon + if (self.ammo_cells < 1) { forceweaponswitch(0.2); return; } + + // explode if under water + if (self.waterlevel > 1) { + cells = self.ammo_cells; + self.ammo_cells = 0; + W_SetCurrentAmmo (self); + T_RadiusDamage (self, self, 35*cells, world, DAMAGEALL); + return; + } + + // Time for a new LG hit sound? + if (self.t_width < time) { + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.t_width = time + 0.6; + } + + self.currentammo = self.ammo_cells = self.ammo_cells - 1; + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + + dir = self.origin + '0 0 16'; + traceline (dir, dir + v_forward*600, TRUE, self); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, dir_x); + WriteCoord (MSG_BROADCAST, dir_y); + WriteCoord (MSG_BROADCAST, dir_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + PlayerLightningDamage (self.origin, trace_endpos + v_forward*4, self, DAMAGE_LGPLAYER); +}; + +/*====================================================================== + PLAYER WEAPON UPDATES AND AMMO CHECKS + + W_SetCurrentAmmo - Update HUD icons based on self.weapon value + W_BestWeapon - returns best weapon LG > SNG > SSG > NG > SG > Axe + interesting that the function does not return GL/RL + W_CheckNoAmmo - Ammo check for attack function + W_Attack - Main function that fire weapons (player animations) + Will automatically wakeup any nearby monsters + W_ChangeWeapon - Change weapon based on availabilty and ammo + CycleWeaponCommand - Move forward or backward through active weapons + CycleWeaponReverseCommand + W_WeaponFrame - Called every frame, catches impulse event + SuperDamageSound - Plays quad damage sound + +======================================================================*/ +void(entity targ) W_SetCurrentAmmo = +{ + if (intermission_running > 0) return; // intermission or finale + remoteplayer_run (targ); // get out of any weapon firing states + + // Reset all Ammo types for gfx on sbar (engine code hack - sbar.c) + targ.items = targ.items - ( targ.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) ); + + if (targ.weapon == IT_AXE) { + targ.currentammo = 0; + targ.weaponframe = 0; // reset before setting model + if (targ.moditems & IT_UPGRADE_AXE) + targ.weaponmodel = MODEL_VWEAP_UPAXE; + else targ.weaponmodel = MODEL_VWEAP_AXE; + } + else if (targ.weapon == IT_SHOTGUN) { + targ.currentammo = targ.ammo_shells; + targ.weaponframe = 0; // reset before setting model + targ.weaponmodel = MODEL_VWEAP_SG; + targ.items = targ.items | IT_SHELLS; + } + else if (targ.weapon == IT_SUPER_SHOTGUN) { + targ.currentammo = targ.ammo_shells; + targ.weaponframe = 0; // reset before setting model + if (targ.moditems & IT_UPGRADE_SSG) + targ.weaponmodel = MODEL_VWEAP_UPSSG; + else targ.weaponmodel = MODEL_VWEAP_SSG; + targ.items = targ.items | IT_SHELLS; + } + else if (targ.weapon == IT_NAILGUN) { + targ.currentammo = targ.ammo_nails; + targ.weaponframe = 0; // reset before setting model + targ.weaponmodel = MODEL_VWEAP_NG; + targ.items = targ.items | IT_NAILS; + } + else if (targ.weapon == IT_SUPER_NAILGUN) { + targ.currentammo = targ.ammo_nails; + targ.weaponframe = 0; // reset before setting model + targ.weaponmodel = MODEL_VWEAP_SNG; + targ.items = targ.items | IT_NAILS; + } + else if (targ.weapon == IT_GRENADE_LAUNCHER) { + targ.currentammo = targ.ammo_rockets; + targ.weaponframe = 0; // reset before setting model + targ.weaponmodel = MODEL_VWEAP_GL; + targ.items = targ.items | IT_ROCKETS; + } + else if (targ.weapon == IT_ROCKET_LAUNCHER) { + targ.currentammo = targ.ammo_rockets; + targ.weaponframe = 0; // reset before setting model + targ.weaponmodel = MODEL_VWEAP_RL; + targ.items = targ.items | IT_ROCKETS; + } + else if (targ.weapon == IT_LIGHTNING) { + targ.currentammo = targ.ammo_cells; + targ.weaponframe = 0; // reset before setting model + if (targ.moditems & IT_UPGRADE_LG) + targ.weaponmodel = MODEL_VWEAP_UPLG; + else targ.weaponmodel = MODEL_VWEAP_LG; + targ.items = targ.items | IT_CELLS; + } + else { + // Bad situation no viewmodel + targ.currentammo = 0; + targ.weaponframe = 0; // reset before setting model + targ.weaponmodel = ""; + } +}; + +/*====================================================================== + Return best weapon based on current ammo quantities +======================================================================*/ +float(entity targ) W_BestWeapon = +{ + if (targ.waterlevel < 2 && targ.ammo_cells > 0 && (targ.items & IT_LIGHTNING) ) + return IT_LIGHTNING; + if(targ.ammo_nails > 1 && (targ.items & IT_SUPER_NAILGUN) ) + return IT_SUPER_NAILGUN; + if(targ.ammo_shells > 1 && (targ.items & IT_SUPER_SHOTGUN) ) + return IT_SUPER_SHOTGUN; + if(targ.ammo_nails > 0 && (targ.items & IT_NAILGUN) ) + return IT_NAILGUN; + if(targ.ammo_shells > 0 && (targ.items & IT_SHOTGUN) ) + return IT_SHOTGUN; + return IT_AXE; +}; + +//---------------------------------------------------------------------- +float(entity targ) W_CheckNoAmmo = +{ + if (targ.currentammo > 0) return TRUE; + if (targ.weapon == IT_AXE) return TRUE; + + targ.weapon = W_BestWeapon (targ); + W_SetCurrentAmmo (targ); + + // drop the weapon down + return FALSE; +}; + +/*====================================================================== +W_Attack +======================================================================*/ +void() W_Attack = +{ + if (intermission_running > 0) return; // intermission or finale + if ( !W_CheckNoAmmo(self) ) return; // Out of ammo? + + makevectors (self.v_angle); // calculate forward angle for velocity + self.show_hostile = time + 1; // wake monsters up + + //---------------------------------------------------------------------- + // Axe - Mighty chopper + //---------------------------------------------------------------------- + if (self.weapon == IT_AXE) { + if (random() < 0.5) sound (self, CHAN_WEAPON, SOUND_AXE_SWIPE1, 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, SOUND_AXE_SWIPE2, 1, ATTN_NORM); + // Work out which axe swing to play (never play swing twice in a row) + self.lip = self.meleeattack; + while (self.meleeattack == self.lip) { + self.lip = rint(random()*4.4); + } + self.meleeattack = self.lip; + if (self.meleeattack == 0) player_axe1(); + else if (self.meleeattack == 1) player_axeb1(); + else if (self.meleeattack == 2) player_axec1(); + else if (self.meleeattack == 3) player_axed1(); + else player_axee1(); + self.attack_finished = time + 0.5; + } + //---------------------------------------------------------------------- + else if (self.weapon == IT_SHOTGUN) player_sg1(); + else if (self.weapon == IT_SUPER_SHOTGUN) player_supersg1(); + else if (self.weapon == IT_NAILGUN) player_nail1(); + else if (self.weapon == IT_SUPER_NAILGUN) player_snail1(); + else if (self.weapon == IT_GRENADE_LAUNCHER) player_grenade1(); + else if (self.weapon == IT_ROCKET_LAUNCHER) player_rocket1(); + else if (self.weapon == IT_LIGHTNING) { + if (self.moditems & IT_UPGRADE_LG) player_plasma1(); + else { + player_light1(); + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + } + } +}; + +/*====================================================================== + W_ChangeWeapon + Check if got weapon and ammo and switch to relevant weapon +======================================================================*/ +void(entity targ) W_ChangeWeapon = +{ + local float it, am, fl; + + if (intermission_running > 0) return; // intermission or finale + it = targ.items; + am = FALSE; + + if (targ.impulse == 1) fl = IT_AXE; + else if (targ.impulse == 2) { + fl = IT_SHOTGUN; + if (targ.ammo_shells < 1) am = TRUE; + } + else if (targ.impulse == 3) { + fl = IT_SUPER_SHOTGUN; + if (targ.ammo_shells < 2) am = TRUE; + } + else if (targ.impulse == 4) { + fl = IT_NAILGUN; + if (targ.ammo_nails < 1) am = TRUE; + } + else if (targ.impulse == 5) { + fl = IT_SUPER_NAILGUN; + if (targ.ammo_nails < 2) am = TRUE; + } + else if (targ.impulse == 6) { + fl = IT_GRENADE_LAUNCHER; + if (targ.ammo_rockets < 1) am = TRUE; + } + else if (targ.impulse == 7) { + fl = IT_ROCKET_LAUNCHER; + if (targ.ammo_rockets < 1) am = TRUE; + } + else if (targ.impulse == 8) { + fl = IT_LIGHTNING; + if (targ.ammo_cells < 1) am = TRUE; + } + + targ.impulse = 0; // Clear impulse + + //---------------------------------------------------------------------- + // FL = don't have the weapon + // AM = out of ammo + //---------------------------------------------------------------------- + if (!(targ.items & fl)) sprint (targ, "no weapon.\n"); + else if (am) sprint (targ, "not enough ammo.\n"); + else { + targ.weapon = fl; // Switch to weapon (internal number) + W_SetCurrentAmmo (targ); + } +}; + +/*====================================================================== +CycleWeaponCommand +======================================================================*/ +void() CycleWeaponCommand = +{ + local float am; + + if (intermission_running > 0) return;// intermission or finale + self.impulse = 0; // reset impulse + + // Keep cycling around weapon list until found a weapon with ammo + while (1) { + am = 0; + if (self.weapon == IT_LIGHTNING) { + self.weapon = IT_AXE; + } + else if (self.weapon == IT_AXE) { + self.weapon = IT_SHOTGUN; + if (self.ammo_shells < 1) am = 1; + } + else if (self.weapon == IT_SHOTGUN) { + self.weapon = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) am = 1; + } + else if (self.weapon == IT_SUPER_SHOTGUN) { + self.weapon = IT_NAILGUN; + if (self.ammo_nails < 1) am = 1; + } + else if (self.weapon == IT_NAILGUN) { + self.weapon = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) am = 1; + } + else if (self.weapon == IT_SUPER_NAILGUN) { + self.weapon = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_GRENADE_LAUNCHER) { + self.weapon = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_ROCKET_LAUNCHER) { + self.weapon = IT_LIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + + // Has the player got the weapons and ammo to switch? + if ( (self.items & self.weapon) && !am) { + W_SetCurrentAmmo (self); + return; + } + } +}; + +/*====================================================================== +CycleWeaponReverseCommand +======================================================================*/ +void() CycleWeaponReverseCommand = +{ + local float am; + + if (intermission_running > 0) return; // intermission or finale + self.impulse = 0; // reset impulse + + // Keep cycling around weapon list until found a weapon with ammo + while (1) { + am = 0; + if (self.weapon == IT_LIGHTNING) { + self.weapon = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_ROCKET_LAUNCHER) { + self.weapon = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_GRENADE_LAUNCHER) { + self.weapon = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) am = 1; + } + else if (self.weapon == IT_SUPER_NAILGUN) { + self.weapon = IT_NAILGUN; + if (self.ammo_nails < 1) am = 1; + } + else if (self.weapon == IT_NAILGUN) { + self.weapon = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) am = 1; + } + else if (self.weapon == IT_SUPER_SHOTGUN) { + self.weapon = IT_SHOTGUN; + if (self.ammo_shells < 1) am = 1; + } + else if (self.weapon == IT_SHOTGUN) { + self.weapon = IT_AXE; + } + else if (self.weapon == IT_AXE) { + self.weapon = IT_LIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + + if ( (self.items & self.weapon) && !am) { + W_SetCurrentAmmo (self); + return; + } + } +}; + +/*====================================================================== +W_WeaponFrame +======================================================================*/ +void() W_WeaponFrame = +{ + ImpulseCommands (); + // Allow for impulse commands before weapon lockout + if (time < self.attack_finished) return; + + // check for attack + if (self.button0) { + // originally - SuperDamageSound + // Only play one powerup sound at once + if (self.super_damage_finished > 0 && self.powerup_sound < time) { + if (self.super_sound < time) { + self.super_sound = time + 1; + self.powerup_sound = time + 1; + sound (self, CHAN_BODY, SOUND_ARTQUAD3, 1, ATTN_NORM); + } + } + // Only play one powerup sound at once + if (self.sharpshoot_finished > 0 && self.powerup_sound < time) { + // Only works with the shotguns + if (self.weapon == IT_SHOTGUN || self.weapon == IT_SUPER_SHOTGUN) { + if (self.sharpshooter_sound < time) { + self.sharpshooter_sound = time + 0.5; + // Only play the sound every other shot + self.powerup_sound = time + 1; + sound (self, CHAN_BODY, SOUND_ARTSHARP3, 1, ATTN_NORM); + } + } + } + // Only play one powerup sound at once + if (self.nailpiercer_finished > 0 && self.powerup_sound < time) { + // Only works with nailgun + super nailgun + if (self.weapon == IT_NAILGUN || self.weapon == IT_SUPER_NAILGUN) { + if (self.nailpiercer_sound < time) { + self.nailpiercer_sound = time + 0.5; + self.powerup_sound = time + 1; + sound (self, CHAN_BODY, SOUND_ARTNAILP3, 1, ATTN_NORM); + } + } + } + // Check for weapon updates + W_Attack (); + } +}; diff --git a/QC_other/QC_arcane/world.qc b/QC_other/QC_arcane/world.qc new file mode 100644 index 00000000..65f3745b --- /dev/null +++ b/QC_other/QC_arcane/world.qc @@ -0,0 +1,791 @@ +/*====================================================================== + GLOBAL STUFF +======================================================================*/ +entity lastspawn; // client.qc (SelectSpawnPoint) + +void() InitBodyQue; +void() pendulum_setuparray; +void() mapvar_setuparray; + +//---------------------------------------------------------------------- +void() main = +{ + dprint ("\b[MAIN]\bfunction started ...\n"); + + //---------------------------------------------------------------------- + // these are just commands the the prog compiler to copy these files + //---------------------------------------------------------------------- + precache_file ("progs.dat"); + precache_file ("gfx.wad"); + precache_file ("quake.rc"); + precache_file ("default.cfg"); + + precache_file ("end1.bin"); + precache_file2 ("end2.bin"); + + //precache_file ("demo1.dem"); + //precache_file ("demo2.dem"); + //precache_file ("demo3.dem"); + + //---------------------------------------------------------------------- + // these are all of the lumps from the cached.ls files + //---------------------------------------------------------------------- + precache_file ("gfx/palette.lmp"); + precache_file ("gfx/colormap.lmp"); + + precache_file2 ("gfx/pop.lmp"); + + precache_file ("gfx/complete.lmp"); + precache_file ("gfx/inter.lmp"); + + precache_file ("gfx/ranking.lmp"); + precache_file ("gfx/vidmodes.lmp"); + precache_file ("gfx/finale.lmp"); + precache_file ("gfx/conback.lmp"); + precache_file ("gfx/qplaque.lmp"); + + precache_file ("gfx/menudot1.lmp"); + precache_file ("gfx/menudot2.lmp"); + precache_file ("gfx/menudot3.lmp"); + precache_file ("gfx/menudot4.lmp"); + precache_file ("gfx/menudot5.lmp"); + precache_file ("gfx/menudot6.lmp"); + + precache_file ("gfx/menuplyr.lmp"); + precache_file ("gfx/bigbox.lmp"); + precache_file ("gfx/dim_modm.lmp"); + precache_file ("gfx/dim_drct.lmp"); + precache_file ("gfx/dim_ipx.lmp"); + precache_file ("gfx/dim_tcp.lmp"); + precache_file ("gfx/dim_mult.lmp"); + precache_file ("gfx/mainmenu.lmp"); + + precache_file ("gfx/box_tl.lmp"); + precache_file ("gfx/box_tm.lmp"); + precache_file ("gfx/box_tr.lmp"); + + precache_file ("gfx/box_ml.lmp"); + precache_file ("gfx/box_mm.lmp"); + precache_file ("gfx/box_mm2.lmp"); + precache_file ("gfx/box_mr.lmp"); + + precache_file ("gfx/box_bl.lmp"); + precache_file ("gfx/box_bm.lmp"); + precache_file ("gfx/box_br.lmp"); + + precache_file ("gfx/sp_menu.lmp"); + precache_file ("gfx/ttl_sgl.lmp"); + precache_file ("gfx/ttl_main.lmp"); + precache_file ("gfx/ttl_cstm.lmp"); + + precache_file ("gfx/mp_menu.lmp"); + + precache_file ("gfx/netmen1.lmp"); + precache_file ("gfx/netmen2.lmp"); + precache_file ("gfx/netmen3.lmp"); + precache_file ("gfx/netmen4.lmp"); + precache_file ("gfx/netmen5.lmp"); + + precache_file ("gfx/sell.lmp"); + + precache_file ("gfx/help0.lmp"); + precache_file ("gfx/help1.lmp"); + precache_file ("gfx/help2.lmp"); + precache_file ("gfx/help3.lmp"); + precache_file ("gfx/help4.lmp"); + precache_file ("gfx/help5.lmp"); + + precache_file ("gfx/pause.lmp"); + precache_file ("gfx/loading.lmp"); + + precache_file ("gfx/p_option.lmp"); + precache_file ("gfx/p_load.lmp"); + precache_file ("gfx/p_save.lmp"); + precache_file ("gfx/p_multi.lmp"); + + //---------------------------------------------------------------------- + // sounds loaded by C code + //---------------------------------------------------------------------- + precache_sound ("misc/menu1.wav"); + precache_sound ("misc/menu2.wav"); + precache_sound ("misc/menu3.wav"); + + precache_sound ("ambience/water1.wav"); + precache_sound ("ambience/wind2.wav"); + + //---------------------------------------------------------------------- + // shareware + //---------------------------------------------------------------------- + precache_file ("maps/start.bsp"); + + precache_file ("maps/e1m1.bsp"); + precache_file ("maps/e1m2.bsp"); + precache_file ("maps/e1m3.bsp"); + precache_file ("maps/e1m4.bsp"); + precache_file ("maps/e1m5.bsp"); + precache_file ("maps/e1m6.bsp"); + precache_file ("maps/e1m7.bsp"); + precache_file ("maps/e1m8.bsp"); + + //---------------------------------------------------------------------- + // registered + //---------------------------------------------------------------------- + precache_file2 ("gfx/pop.lmp"); + + precache_file2 ("maps/e2m1.bsp"); + precache_file2 ("maps/e2m2.bsp"); + precache_file2 ("maps/e2m3.bsp"); + precache_file2 ("maps/e2m4.bsp"); + precache_file2 ("maps/e2m5.bsp"); + precache_file2 ("maps/e2m6.bsp"); + precache_file2 ("maps/e2m7.bsp"); + + precache_file2 ("maps/e3m1.bsp"); + precache_file2 ("maps/e3m2.bsp"); + precache_file2 ("maps/e3m3.bsp"); + precache_file2 ("maps/e3m4.bsp"); + precache_file2 ("maps/e3m5.bsp"); + precache_file2 ("maps/e3m6.bsp"); + precache_file2 ("maps/e3m7.bsp"); + + precache_file2 ("maps/e4m1.bsp"); + precache_file2 ("maps/e4m2.bsp"); + precache_file2 ("maps/e4m3.bsp"); + precache_file2 ("maps/e4m4.bsp"); + precache_file2 ("maps/e4m5.bsp"); + precache_file2 ("maps/e4m6.bsp"); + precache_file2 ("maps/e4m7.bsp"); + precache_file2 ("maps/e4m8.bsp"); + + precache_file2 ("maps/end.bsp"); + + precache_file2 ("maps/dm1.bsp"); + precache_file2 ("maps/dm2.bsp"); + precache_file2 ("maps/dm3.bsp"); + precache_file2 ("maps/dm4.bsp"); + precache_file2 ("maps/dm5.bsp"); + precache_file2 ("maps/dm6.bsp"); +}; + +/*====================================================================== +/*QUAKED worldspawn (0 0 0) ? x +Only used for the world. +-------- KEYS -------- +worldtype : World type 0 = medieval, 1 = metal, 2 = base +wad : list of Wad Files used by compiler (; for seperation) +message : Title of map +sounds : CD Music track to play (4-11) + +light : Ambient light level (eg 5) +sky : 6 sided cube for sky brushes (night_) +_range : Scales brightness range of all lights (useful for dirt) + +_sunlight : Brightness of SUN (eg 100) +_sunlight_color : Red/Green/Blue (0.78 0.86 1.00) +_sunlight_mangle : Angle of sunlight (eg 0 -90 0) +_sunlight_penumbra : Penumbra width, in degrees, of sunlight +_sunlight_dirt : 1 = enables dirt mapping on sun + +// Ambient bounce light (multiple suns in a dome) +_sunlight2 : Second SUN (eg 100) +_sunlight2_color : Red/Green/Blue (0.78 0.86 1.00) +_sunlight2_dirt : 1 = enables dirt mapping on sun 2 + +_dirt : 1 = enables dirtmapping (ambient occlusion) on all lights +_dirtmode : Choose between ordered (def=0) and randomized (1) +_dirtscale : Scale factor used in dirt calculations, def=1 +_dirtgain : Exponent used in dirt calculation, def=1 +_dirtdepth : Maximum depth of occlusion checking, def=128 + +gravity : gravity of map (default = 800) +fog : console command (Den/R/G/B - '0.05 0.3 0.3 0.3') +fog_density : Trigger fog starting density (default = 0.1) +fog_colour : Trigger fog starting colour (default = 0.1 0.1 0.1) +fog_dpextra : extra DP fog parameters, default - '1 0 8192 1024 32' +water_alpha : Water Alpha, default - 1.00 +particlemax : Amount of ACTIVE particles per map + +no_item_offset : All ammo/heal items use central point rotation +no_zaware : Switch OFF zaware monster attacks +no_sgprojectile : Switches OFF ALL shotgun projectiles +no_sgcasing : Switches OFF ALL shotgun casings +no_liquiddmg : Switch OFF liquid (slime/lava) monster damage +knight_defskin : Default skin (0-3) type for new knight model +bodyflrcheck : All monster dead body check floor for gravity +bodyfadeaway : All monster dead bodies fade away +sprite_particles: Switch all custom particles to sprites (builtin excluded) + +upgrade_axe : Upgrade Axe -1=disable, 1=enable +upgrade_ssg : Upgrade Super Shotgun -1=disable, 1=enable +upgrade_lg : Upgrade Lightning Gun -1=disable, 1=enable + +give_weapons : Bit flag for which weapons to give to the player +take_weapons : 1=SG, 2=SSG, 4=NG, 8=SNG, 16=GL, 32=RL, 64=LG (excludes Axe) +max_health : Update player health if below this value +currentammo : =1 reset inventory, =0 minimum values +ammo_shells : Setup starting shell quanity (reset/minimum) +ammo_nails : Setup starting nails quanity (reset/minimum) +ammo_rockets : Setup starting rockets quanity (reset/minimum) +ammo_cells : Setup starting cells quanity (reset/minimum) +armortype : Armour type to start with 1=Green, 2=Yellow, 3=Red +armorvalue : Quantity of armour to reset player (100/150/200) + +======================================================================*/ +void() worldspawn = +{ + lastspawn = world; + InitBodyQue (); + developer = cvar("developer"); + self.classtype = CT_WORLD; + + //---------------------------------------------------------------------- + // these sounds MUST be the first precache_sounds + //---------------------------------------------------------------------- + precache_sound ("weapons/r_exp3.wav"); // Hardcoded Explosion (null) + precache_sound ("weapons/rocket1i.wav"); // spike gun + precache_sound ("weapons/sgun1.wav"); // Rocket launcher!?! + // precache_sound ("weapons/guncock.wav"); // player shotgun (not used anymore) + precache_sound ("weapons/sg1.wav"); // Original SG (reduced hiss/noise) + precache_sound ("weapons/sg2.wav"); // New SG (with shell casing) + precache_sound ("weapons/ric1.wav"); // ricochet (used in c code) + precache_sound ("weapons/ric2.wav"); // ricochet (used in c code) + precache_sound ("weapons/ric3.wav"); // ricochet (used in c code) + precache_sound ("weapons/spike2.wav"); // super spikes + precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code) + precache_sound ("weapons/grenade.wav"); // grenade launcher + precache_sound ("weapons/gl_loadshort.wav");// MONSTER grenade launcher + precache_sound ("weapons/bounce.wav"); // grenade bounce + // precache_sound ("weapons/shotgn2.wav"); // super shotgun (not used anymore) + precache_sound ("weapons/ssg1.wav"); // Original SSG (reduced hiss/noise) + precache_sound ("weapons/ssg2.wav"); // Projectile shells or Shotgun upgrade + precache_sound (SOUND_PLASMA_FIRE); // Player PG (eliminator) + precache_sound (SOUND_PLASMA_HIT); // New fire/impact sounds + precache_sound ("weapons/nofire.wav"); // Weapon jams/noammo/broken + + //---------------------------------------------------------------------- + precache_sound (SOUND_REXP3); // Original explosion + precache_sound (SOUND_RESIST_ROCKET); // Resist Rockets + + //---------------------------------------------------------------------- + // sounds used from C physics code + precache_sound ("demon/dland2.wav"); // landing thud + precache_sound ("misc/h2ohit1.wav"); // landing splash + + //---------------------------------------------------------------------- + // Always precaches player sounds + precache_sound (SOUND_RESPAWN); // item respawn sound + precache_sound ("player/plyrjmp8.wav"); // player jump + precache_sound ("player/land.wav"); // player landing + precache_sound ("player/land2.wav"); // player hurt landing + precache_sound ("player/drown1.wav"); // drowning pain + precache_sound ("player/drown2.wav"); // drowning pain + precache_sound ("player/gasp1.wav"); // gasping for air + precache_sound ("player/gasp2.wav"); // taking breath + precache_sound ("player/h2odeath.wav"); // drowning death + + precache_sound (SOUND_EMPTY); // Empty sound + precache_sound (SOUND_TALK); // talk message/trigger + precache_sound ("player/teledth1.wav"); // telefrag + precache_sound ("misc/r_tele1.wav"); // teleport sounds + precache_sound ("misc/r_tele2.wav"); + precache_sound ("misc/r_tele3.wav"); + precache_sound ("misc/r_tele4.wav"); + precache_sound ("misc/r_tele5.wav"); + precache_sound ("weapons/lock4.wav"); // ammo pick up + precache_sound ("weapons/pkup.wav"); // weapon up + precache_sound ("items/armor1.wav"); // armor up + precache_sound ("weapons/lhit.wav"); // lightning + precache_sound ("weapons/lstart.wav"); // lightning start + precache_sound ("weapons/shellc.wav"); // Shotgun shell falling to floor + precache_sound (SOUND_ARTQUAD3); // Quad firing + precache_sound (SOUND_ARTNAILP3); // Nail Piercer firing + precache_sound (SOUND_ARTPENT3); // God mode on, taking damage + + precache_sound ("misc/power.wav"); //lightning for boss + + //---------------------------------------------------------------------- + // player gib sounds + precache_sound ("player/gib.wav"); // Used for players only + precache_sound (GIB_SOUND_UDEATH); // Used for monsters and players (sounds player) + precache_sound ("player/tornoff2.wav"); // Exit sound for client disconnect + + //---------------------------------------------------------------------- + // player pain sounds + precache_sound ("player/pain1.wav"); + precache_sound ("player/pain2.wav"); + precache_sound ("player/pain3.wav"); + precache_sound ("player/pain4.wav"); + precache_sound ("player/pain5.wav"); + precache_sound ("player/pain6.wav"); + + //---------------------------------------------------------------------- + // player death sounds + precache_sound ("player/death1.wav"); + precache_sound ("player/death2.wav"); + precache_sound ("player/death3.wav"); + precache_sound ("player/death4.wav"); + precache_sound ("player/death5.wav"); + + //---------------------------------------------------------------------- + // more weapon sounds + // precache_sound ("weapons/ax1.wav"); // ax swoosh + // precache_sound ("player/axhit1.wav"); // ax hit meat + // precache_sound ("player/axhit2.wav"); // ax hit world + precache_sound(SOUND_AXE_SWIPE1); // Axe swipe 1 + precache_sound(SOUND_AXE_SWIPE2); // Axe swipe 2 + precache_sound(SOUND_AXE_PLAYER); // axe hit player + precache_sound(SOUND_AXE_STONE); // stone impact + precache_sound(SOUND_AXE_WOOD); // wood impact + precache_sound(SOUND_AXE_GLASS); // glass impact + precache_sound(SOUND_AXE_METAL); // metal impact + precache_sound(SOUND_AXE_CERAMIC); // Ceramic impact + precache_sound(GIB_SOUND_HEAVY); // fleshy + precache_sound(GIB_SOUND_HEAVY2); // harder flesh! + + precache_sound ("player/h2ojump.wav"); // player jumping into water + precache_sound ("player/slimbrn2.wav"); // player enter slime + precache_sound ("player/inh2o.wav"); // player enter water + precache_sound ("player/inlava.wav"); // player enter lava + precache_sound ("misc/outwater.wav"); // leaving water sound + + precache_sound ("player/lburn1.wav"); // lava burn + precache_sound ("player/lburn2.wav"); // lava burn + + precache_sound ("misc/water1.wav"); // swimming + precache_sound ("misc/water2.wav"); // swimming + precache_sound (SOUND_HEARTBEAT); // Heartbeat (fast 1s) + + precache_model (MODEL_PLAYER); + precache_model (MODEL_PLAYER_EYES); + precache_model (MODEL_PLAYER_HEAD); + // precache_model ("progs/gib1.mdl"); // Replaced with better models + // precache_model ("progs/gib2.mdl"); + // precache_model ("progs/gib3.mdl"); + + precache_model (SBUBBLE_DROWN); // player drowning bubbles + precache_model (SEXP_SMALL); // Fire explosion (ID) + precache_model (SEXP_MED); // Fire explosion (Quoth) + precache_model (SEXP_BIG); // Fire explosion (Quoth) + precache_model (SEXP_PLASMA_SMALL); // Plasma explosion (Marcher) + precache_model (SEXP_PLASMA_BIG); // Plasma explosion (Marcher) + precache_model (SEXP_POISON_SMALL); // Poison explosion (Marcher) + precache_model (SEXP_POISON_MED); // Poison explosion (Quoth) + precache_model (SEXP_ELECTRIC); // Impact explosion (Quoth) + precache_model (SBURST_SMOKE); // Small puff of smoke (Rubicon2) + // Hardly ever used, entity cache it if needed +// precache_model (SEXP_ICE_BIG); // Ice explosion (ne_ruin) + + precache_model (MODEL_PROJ_SMOKE); // Empty model + smoke trail + precache_model (MODEL_PROJ_FLESH); // SpawnMeatSpray - projectiles.qc + precache_model (MODEL_PROJ_FLESHP); // Poisonous version of meat + + precache_model (MODEL_VWEAP_AXE); // regular + precache_model (MODEL_VWEAP_UPAXE); // Upgrade - Shadow + precache_model (MODEL_VWEAP_SG); + precache_model (MODEL_VWEAP_SSG); + precache_model (MODEL_VWEAP_UPSSG); // Upgrade - Widowmaker + precache_model (MODEL_VWEAP_NG); + precache_model (MODEL_VWEAP_SNG); + precache_model (MODEL_VWEAP_GL); + precache_model (MODEL_VWEAP_RL); + precache_model (MODEL_VWEAP_LG); + precache_model (MODEL_VWEAP_UPLG); // Upgrade - Plasma Gun + + // precache_model (MODEL_VWEAP_ZSSG); // Zerstorer Riot gun + + precache_model ("progs/bolt.mdl"); // for lightning gun + precache_model ("progs/bolt2.mdl"); // for lightning gun + precache_model ("progs/bolt3.mdl"); // for boss shock + precache_model (MODEL_PROJ_PGPLASMA); // Plasma bolt for PG + precache_model (MODEL_PROJ_LIGHTNING2); // reflected lightning + // precache_model ("progs/lavaball.mdl"); // for testing + + precache_model (MODEL_PROJ_SHELLC); // Launch_ShellCasing - projectiles.qc + precache_model (MODEL_PROJ_DIAM2); // Projectile bullets + precache_model (MODEL_PROJ_NG); + precache_model (MODEL_PROJ_NGRED); // Reflected nails + precache_model (MODEL_PROJ_SNG); + precache_model (MODEL_PROJ_GRENADE); + // precache_model (MODEL_PROJ_GRENADEGRN); // Poisonous Grenade + precache_model (MODEL_PROJ_ROCKET); + precache_model (MODEL_BACKPACK); // DropBackpack - items.qc + + //---------------------------------------------------------------------- + // Pre-cache for MOD stuff + //---------------------------------------------------------------------- + precache_model (MODEL_BROKEN); // Broken model error + precache_model (MODEL_EMPTY); // Used for info_intermission cameras + + precache_model (GIB1_BLOOD); // New gib - arm/leg + precache_model (GIB2_BLOOD); // New gib - body + precache_model (GIB3_BLOOD); // New gib - slice + precache_model (GIB4_BLOOD); // New gib - small chunk/ball + precache_model (GIB5_BLOOD); // New gib - large chunk/ball + + precache_sound (GIB1_SOUND); // Monster Gib 1 + precache_sound (GIB3_SOUND); // Monster Gib 3 + precache_sound (GIB5_SOUND); // Monster Gib 5 + precache_sound (GIBHIT1_SOUND); // Gib Impact sound 1 + precache_sound (GIBHIT2_SOUND); // Gib Impact sound 2 + precache_sound (GIBHIT3_SOUND); // Gib Impact sound 3 + precache_sound (GIBHIT4_SOUND); // Gib Impact sound 4 + precache_sound (GIBHIT5_SOUND); // Gib Impact sound 5 + precache_sound (GIBHIT1_STONESOUND); // long roll + precache_sound (GIBHIT3_STONESOUND); // quick roll + precache_sound (GIBHIT5_STONESOUND); // slow roll + precache_sound (GIBHIT1_METALSOUND); // small clink + precache_sound (GIBHIT3_METALSOUND); // large clank + precache_sound (GIBHIT5_METALSOUND); // gigantic clonk + precache_sound (GIB_SOUND_HEAVY); // Large gib + precache_sound (GIB_SOUND_METALA); // Sword impact + precache_sound (GIB_SOUND_METALB); // Sword impact + precache_sound (GIB_SOUND_CHAIN); // Chain impact + precache_sound (GIB_SOUND_WOOD); // Wooden impact + precache_sound (GIB_SOUND_ACID); // Acid burning + precache_sound (GIB_SOUND_SDEATH); // Stone death + + //---------------------------------------------------------------------- + // Footstep sounds (slow, light, medium, heavy, large & giant) + //---------------------------------------------------------------------- + precache_sound (SOUND_FS_SLOW1); + precache_sound (SOUND_FS_SLOW2); + precache_sound (SOUND_FS_SLOW3); + precache_sound (SOUND_FS_SLOW4); + precache_sound (SOUND_FS_SLOW5); + + precache_sound (SOUND_FS_DRAG1); + precache_sound (SOUND_FS_DRAG2); + precache_sound (SOUND_FS_DRAG3); + precache_sound (SOUND_FS_DRAG4); + precache_sound (SOUND_FS_DRAG5); + + precache_sound (SOUND_FS_LIGHT1); + precache_sound (SOUND_FS_LIGHT2); + precache_sound (SOUND_FS_LIGHT3); + precache_sound (SOUND_FS_LIGHT4); + precache_sound (SOUND_FS_LIGHT5); + + precache_sound (SOUND_FS_MEDIUM1); + precache_sound (SOUND_FS_MEDIUM2); + precache_sound (SOUND_FS_MEDIUM3); + precache_sound (SOUND_FS_MEDIUM4); + precache_sound (SOUND_FS_MEDIUM5); + + precache_sound (SOUND_FS_HEAVY1); + precache_sound (SOUND_FS_HEAVY2); + precache_sound (SOUND_FS_HEAVY3); + precache_sound (SOUND_FS_HEAVY4); + precache_sound (SOUND_FS_HEAVY5); + + precache_sound (SOUND_FS_LARGE1); + precache_sound (SOUND_FS_LARGE2); + precache_sound (SOUND_FS_LARGE3); + precache_sound (SOUND_FS_LARGE4); + precache_sound (SOUND_FS_LARGE5); + + precache_sound (SOUND_FS_GIANT1); + precache_sound (SOUND_FS_GIANT2); + precache_sound (SOUND_FS_GIANT3); + precache_sound (SOUND_FS_GIANT4); + precache_sound (SOUND_FS_GIANT5); + + //---------------------------------------------------------------------- + // Setup light animation tables. 'a' is total darkness, 'z' is maxbright. + //---------------------------------------------------------------------- + // 0 normal + lightstyle(0, "m"); + // 1 FLICKER (first variety) + lightstyle(1, "mmnmmommommnonmmonqnmmo"); + // 2 SLOW STRONG PULSE + lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); + // 3 CANDLE (first variety) + lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); + // 4 FAST STROBE + lightstyle(4, "mamamamamama"); + // 5 GENTLE PULSE 1 + lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj"); + // 6 FLICKER (second variety) + lightstyle(6, "nmonqnmomnmomomno"); + // 7 CANDLE (second variety) + lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm"); + // 8 CANDLE (third variety) + lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"); + // 9 SLOW STROBE (fourth variety) + lightstyle(9, "aaaaaaaazzzzzzzz"); + // 10 FLUORESCENT FLICKER + lightstyle(10, "mmamammmmammamamaaamammma"); + // 11 SLOW PULSE NOT FADE TO BLACK + lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); + // styles 32-62 are assigned by the light program for switchable lights + // 63 testing + lightstyle(63, "a"); + + //---------------------------------------------------------------------- + // Check for engine type and extensions (different features) + //---------------------------------------------------------------------- + engine = ENG_FITZ; // Default engine type (no extensions) + ext_active = cvar("pr_checkextension"); // Check for extra extensions + if (ext_active) { + // This could be DP, QSS, DQ, RMQ, Qbism etc + engine = ENG_DPEXT; + + // Check for DP point particle extensions + ext_dppart = checkextension("DP_SV_POINTPARTICLES"); + // DP extra fog params + ext_dpfog = checkextension("DP_GFX_FOG"); + // surface content + ext_dpsurf = checkextension("DP_QC_GETSURFACE"); + // particle rain/snow system + // QSS supports weather extensions in v7+ + ext_dprain = checkextension("DP_TE_PARTICLERAIN"); + ext_dpsnow = checkextension("DP_TE_PARTICLESNOW"); + // Engine support for proper rotating/colliding bmodels + //ext_dprot = checkextension("DP_SV_ROTATINGBMODEL"); + + // Check for FTE/QS-S point particle extensions + // Engine wants config files in different locations + if (checkextension("FTE_SV_POINTPARTICLES")) { + ext_dppart = TRUE; + if (checkextension("FTE_PART_NAMESPACE_EFFECTINFO")) { + // Load particle effects file (DP default=mod root) + particleeffectnum("effectinfo.txt"); + // Load up default weather effects + particleeffectnum("fte_weather.cfg"); + } + } + } + + dprint("\n\b[ENGINE]\b "); + if (engine == ENG_FITZ) dprint("Fitz Compatible\n"); + else if (engine == ENG_DPEXT) dprint("DP Compatible\n"); + else dprint("Unknown\n"); + + // Large maps cannot use this function, check for disable + if (self.no_surfacecheck == TRUE) ext_dpsurf = 0; + + //---------------------------------------------------------------------- + // Check for any custom water alpha defined on the worldspawn + // This is not very precise because FTOS is only ONE decimal place + // Once the client has started, the water alpha is fine tuned + if (self.water_alpha) { + liquid_alpha = self.water_alpha; + cvar_set ("r_wateralpha", ftos(liquid_alpha)); + } + + // Default is auto aim OFF + autoaim_cvar = 1; + + // Check for any override on player projectiles + playerprojsize = world.no_bigprojectiles; + + //---------------------------------------------------------------------- + // Check for any custom gravity settings or ziggy secret map + if (!self.gravity) map_gravity = DEF_GRAVITY; + else map_gravity = self.gravity; + if (self.model == "maps/e1m8.bsp") map_gravity = 100; // Ziggy secret map + cvar_set ("sv_gravity", ftos(map_gravity)); + + //---------------------------------------------------------------------- + // Check for global body floor check and fading timer + if (self.bodyflrcheck == 1) map_bodyflrcheck = TRUE; + else map_bodyflrcheck = FALSE; + if (self.bodyfadeaway > 0) map_bodyfadeaway = self.bodyfadeaway; + else map_bodyfadeaway = FALSE; + + //---------------------------------------------------------------------- + // The values of configflag is never saved, its always generated! + // merge any changes from worldspawn into console variable + configflag = cvar("temp1"); + sycn_worldspawn(); + temp1flag = configflag; + + dprint("\b[WORLD]\b TEMP1 + Worldspawn ("); + dprint(ftos(temp1flag)); dprint(")\n"); + + //---------------------------------------------------------------------- + // Setup Particle System + //---------------------------------------------------------------------- + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) { + if (self.particlemax > 0) part_max = self.particlemax; + else part_max = PARTICLE_MAXENTS; + // DP/FTE setup requires less entities for sprite particles + if (engine == ENG_DPEXT && query_configflag(SVR_SPRPARTON) == FALSE + && self.sprite_particles == FALSE) + part_max = part_max * 0.5; + dprint("\b[WORLD]\b Max particles ("); + dprint(ftos(part_max)); dprint(")\n"); + setup_particlechain(); // Setup intial particle chain + } + + //---------------------------------------------------------------------- + dprint("\b[WORLD]\b Setup Pendulum vector array\n"); + pendulum_setuparray(); + dprint("\b[WORLD]\b Setup Map Var bitflag array\n"); + mapvar_setuparray(); + + //---------------------------------------------------------------------- + // Original id levels + // Episode 1 + // The Slipgate Complex, Castle of the Damned, The Necropolis, The Grisly Grotto + // Gloom Keep, The Door to Chthon, The House of Chthon, Ziggurat Vertigo (S) + // Episode 2 + // The Installation, The Ogre Citadel, The Crypt of Decay, The Ebon Fortress + // The Wizard's Manse, The Dismal Oubliette, The Underearth (S) + // Episode 3 + // Termination Central, The Vaults of Zin, The Tomb of Terror, Satan's Dark Delight + // The Wind Tunnels, Chambers of Torment, The Haunted Halls (S) + // Episode 4 + // The Sewage System, The Tower of Despair, The Elder God Shrine, The Palace of Hate + // Hell's Atrium, The Pain Maze, Azure Agony, The Nameless City (S) + //---------------------------------------------------------------------- +}; + +/*====================================================================== + Start frame +======================================================================*/ +void() StartFrame = +{ + teamplay = cvar("teamplay"); + developer = cvar("developer"); + skill = cvar("skill"); + coop = cvar("coop"); + + framecount = framecount + 1; +}; + +/*====================================================================== + BODY QUE + Keeps track of dead player models +======================================================================*/ +entity bodyque_head; + +// just here so spawn functions don't complain after the world +// creates bodyques +void() bodyque = {}; + +//---------------------------------------------------------------------- +// New Code from Inside3d forums (old system was terrible) +//---------------------------------------------------------------------- +void() InitBodyQue = +{ + local entity e, prev; + local float numBodies, num; + + num = 0; + // how many player corpses to allow in the world at once + numBodies = 10; + prev = world; + bodyque_head = world; + + while(num < numBodies) { + // Spawn another body + e = spawn(); + e.classname = "bodyque"; + + // If this is the first, set the bodyque_head pointer + // (start of the list) + if(bodyque_head == world) bodyque_head = e; + + // Link up to previous item to form the linked list + if(prev != world) e.owner = prev; + + // Point prev to the new item + prev = e; + num = num + 1; + } + // turn the linked list into a linked loop + bodyque_head.owner = prev; +}; + +//---------------------------------------------------------------------- +// make a body que entry for the given ent so the ent can be +// respawned elsewhere +//---------------------------------------------------------------------- +void(entity ent) CopyToBodyQue = +{ + bodyque_head.angles = ent.angles; + bodyque_head.model = ent.model; + bodyque_head.modelindex = ent.modelindex; + bodyque_head.frame = ent.frame; + bodyque_head.colormap = ent.colormap; + bodyque_head.movetype = ent.movetype; + bodyque_head.velocity = ent.velocity; + bodyque_head.flags = 0; + setorigin (bodyque_head, ent.origin); + setsize (bodyque_head, ent.mins, ent.maxs); + bodyque_head = bodyque_head.owner; +}; + +/*====================================================================== + Stuff removed + - QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10) + - QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8) + - QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) + Used as a positional target for spotlights, etc. + - QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) + Used as a positional target for lightning. + - QUAKED test_teleport (0 .5 .8) ? + - QUAKED test_fodder (0 .5 .8) ? + - QUAKED noclass (0 0 0) (-8 -8 -8) (8 8 8) + - QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big + +======================================================================*/ +void() item_weapon = { remove(self); }; +void() misc_noisemaker = { remove(self); }; +void() noclass = { remove(self); }; + +void() test_fodder = { remove(self); }; +void() test_goaway = { remove(self); }; +void() test_spawn = { remove(self); }; +void() test_teleport = { remove(self); }; + +void() testplayerstart = { remove(self); }; +void() viewthing = { remove(self); }; + +/*====================================================================== +/*QUAKED trigger_onlyregistered (.5 .5 .5) ? +Checks for registered version of game, no one uses this anymore +======================================================================*/ +void() trigger_onlyregistered_touch = +{ + if ( !(other.flags & FL_CLIENT) ) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 2; + if (cvar("registered")) { + self.message = ""; + SUB_UseTargets (); + remove (self); + } + else { + if (self.message != "") { + centerprint (other, self.message); + sound (other, CHAN_BODY, SOUND_TALK, 1, ATTN_NORM); + } + } +}; + +//---------------------------------------------------------------------- +void() trigger_onlyregistered = +{ + InitTrigger (); + self.touch = trigger_onlyregistered_touch; +}; + +//---------------------------------------------------------------------- +// A function that supresses compiler errors +//---------------------------------------------------------------------- +void() dpcompiler_errors = +{ + worldstatus = ""; + gettaginfo_parent = 0; + gettaginfo_name = ""; + gettaginfo_offset = '0 0 0'; + gettaginfo_forward = '0 0 0'; + gettaginfo_right = '0 0 0'; + gettaginfo_up = '0 0 0'; + trace_dpstartcontents = 0; + trace_dphitcontents = 0; + trace_dphitq3surfaceflags = 0; + trace_dphittexturename = ""; +}; diff --git a/QC_other/QC_copper/ai.qc b/QC_other/QC_copper/ai.qc new file mode 100644 index 00000000..a034a4e5 --- /dev/null +++ b/QC_other/QC_copper/ai.qc @@ -0,0 +1,1372 @@ +/* +============================================================================== + +AI + +Moving, animating, and decision making + +============================================================================== +*/ + + + + +/* +============= +eyeline +============= +*/ +vector(entity targ) eyeline = +{ + vector spot1, spot2; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + return (spot2 - spot1); +} + +/* +============= +range + +returns the range categorization of an entity relative to self +============= +*/ +float(entity targ) range = +{ + vector d; + float r; + + if (EntitiesTouching(self, targ)) // always melee someone standing on your head + return RANGE_MELEE; + + d = eyeline(targ); + d_z *= 2; // don't melee guys way above or below you + r = vlen(d); + if (r < 120) + return RANGE_MELEE; + if (r < 500) + return RANGE_NEAR; + if (r < 900) + return RANGE_MID; + if (r < 1250) + return RANGE_FAR; + return RANGE_TOOFAR; +} + +/* +============= +visible + +returns 1 if the entity is visible to self, even if not infront() + +uses enemy's real position, NOT the potentially ring-of-shadows-offset BS position! +============= +*/ +float (entity targ) visible = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline2(spot1, spot2, self, TRACE_NOMONSTERS|TRACE_WATER); // see through other monsters + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (trace_fraction == 1) + return TRUE; + return FALSE; +} + + +/* +============= +infront + +returns 1 if the entity is in front (in sight) of self +============= +*/ +float(entity targ) infront = +{ + vector vec; + float dot; + + makevectors (self.angles); + vec = normalize (targ.origin - self.origin); + dot = vec * v_forward; + + if ( dot > 0.3) + { + return TRUE; + } + return FALSE; +} +/* +float(entity src) infrontof = +{ + local float result; + local entity temp; + + temp = self; + self = src; + + result = infront(temp); + + self = temp; + return result; +} +*/ + +/* +============= +enemy_vispos + +Run every monster's aiming routine against this func instead of self.enemy.origin, so they +can be confused by a ring of shadows and fire in wrong directions +============= +*/ +vector() enemy_vispos = +{ + // dogs can still smell the player + if (self.enemy.invisible_finished < time || self.classname == "monster_dog" ) + return self.enemy.origin; + + vector visOrg; + + // pick random offset based on time, salted with monster's position for variety + visOrg = SinCos(time * 121 - self.origin_x - self.origin_y) * (vlen(self.enemy.origin - self.origin) * 0.4 + 64); + visOrg += self.enemy.origin; + + return visOrg; +} + +/* +============= +enemy_yaw +============= +*/ +float() enemy_yaw = +{ + if (!self.enemy) + return self.ideal_yaw; + + return vectoyaw(enemy_vispos() - self.origin); +} + +/* +============ +FacingIdeal +============ +*/ +float() FacingIdeal = +{ + local float delta; + + delta = anglemod(self.angles_y - self.ideal_yaw); + if (delta > 45 && delta < 315) + return FALSE; + return TRUE; +} + + +/* +============ +LeadTarget + +returns a relative position to aim at to lead a shot at a moving target +(not a normalized firing vector, so monsters can modify the result further first) + +source: where the projectile will originate from +misvel: speed of projectile +degree: amount to lead target, < 1 will still lag behind target a bit +============ +*/ +vector(vector source, float misvel, float degree) LeadTarget = +{ + local vector vel, lead_offset, evel; + + vel = enemy_vispos() - source; + // don't lead if you can't see the target + if (self.enemy.invisible_finished > time) + return vel; + + evel = self.enemy.velocity; + if( !(self.enemy.flags & FL_ONGROUND) && fabs(evel_z) < 275 ) + evel_z = 0; // ignore if the player is jumping around + + lead_offset = (vlen(vel) / misvel) * evel * degree; + return vel + lead_offset; +} + +vector(vector source, float misvel) LeadTargetBySkill = +{ + // in normal combat, leading above ~50% makes for worse accuracy, not better, because + // the player is always changing speed and direction + return LeadTarget(source, misvel, min(0.5, skill * 0.25)); +} + + + +/* +============================================================================== + +ATTACK CHECKS + +============================================================================== +*/ + + +/* +=========== +CheckClearAttack + +Ensure the line of fire to the enemy isn't blocked by another creature +============ +*/ +float() CheckClearAttack = +{ + vector spot1, spot2; + + if (self.enemy.invisible_finished > time) // if we can't see him just blaze away + return TRUE; + + + spot1 = self.origin + self.view_ofs; + spot2 = enemy_vispos() + self.enemy.view_ofs; + traceline2(spot1, spot2, self, TRACE_WATER); + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (trace_ent != self.enemy) + { + if (trace_ent.classname == "player") + return TRUE; // go ahead and hit a player + + return FALSE; // don't have a clear shot + } + + return TRUE; +} + +/* +=========== +ai_attack_finished + +lunaran: nightmare is no longer made harder by all monsters always firing. they looked +really stupid when they'd automatically become turrets, and it made combat much less +mobile and dynamic (shamblers were particularly 'cheesable') + +monster attack frequency is no longer used as a means to artificially inflate or +scale difficulty. a theoretical player who begins learning Quake on Easy would gain +skills and reflexive instincts which can be guaranteed to carry over to higher skills +as that player improves to higher challenges. +============ +*/ +void(float normal) ai_attack_finished = +{ + self.attack_finished = time + normal; +} + +/* +=========== +ai_check_refire + +these monsters DO fire more than once on nightmare, but not infinitely over and +over - making it random makes it uncertain and thus not cheesable +============ +*/ +void (void() th, float minf) ai_check_refire_min = +{ + if (self.enemy.health <= 0 || self.enemy.customflags & CFL_PLUNGE ) + return; + if (!CheckClearAttack()) + return; + + if (self.cnt < minf) + { + self.cnt += 1; + self.think = th; + return; + } + + // no further refire unless nightmare + if (skill < 3) + { + self.cnt = 0; + return; + } + + // diminish chances of refire with each extra shot + self.cnt = max(1, (self.cnt-minf) * 2); + if ( random() * self.cnt > 0.5 ) + { + self.cnt = 0; + return; + } + self.cnt += minf; + self.think = th; +} + +void (void() th) ai_check_refire = +{ + ai_check_refire_min(th, 0); +} + + + +/* +=========== +CheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() CheckAttack = +{ + local float chance; + + if (!CheckClearAttack()) return FALSE; + + if (enemy_range == RANGE_MELEE || + (self.enemy.invisible_finished > time && random() < 0.1) ) // wave arms randomly now and then if target is invisible + { + if (self.th_melee) + { + self.th_melee (); + return TRUE; + } + } + + if (!self.th_missile) return FALSE; + if (time < self.attack_finished) return FALSE; // after melee check + if (enemy_range >= RANGE_FAR) return FALSE; + + if (enemy_range == RANGE_MELEE) + { + chance = 0.9; + self.attack_finished = 0; + } + else if (enemy_range == RANGE_NEAR) + { + if (self.th_melee) + chance = 0.2; + else + chance = 0.4; + } + else if (enemy_range == RANGE_MID) + { + if (self.th_melee) + chance = 0.05; + else + chance = 0.1; + } + else + chance = 0; + + if (random() < chance) + { + self.th_missile (); + ai_attack_finished (2*random()); + return TRUE; + } + + return FALSE; +} + + +/* +============================================================================== + +WAKING UP + +============================================================================== +*/ +void() HuntTarget = +{ + self.goalentity = self.enemy; + self.ideal_yaw = enemy_yaw(); + + // if zombie is lying, finish the pain frames before starting + if (self.spawnflags & SPAWN_LYING && self.type == "zombie") + { + + if (self.classname == "monster_zombie") + { + self.think = zombie_getup; + self.nextthink = time;// + 0.01; + ai_attack_finished (3); // wait a while before first attack + } + self.spawnflags = not(self.spawnflags, SPAWN_LYING); // don't do getup again if an infight starts + return; + } + + self.think = self.th_run; + self.nextthink = time + 0.1; + ai_attack_finished (1); // wait a while before first attack +} + +void() SightSound = +{ + if (self.classname == "monster_ogre" ) + sound (self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM); + else if (self.classname == "monster_knight" || self.classname == "monster_axegrunt") + sound (self, CHAN_VOICE, "knight/ksight.wav", 1, ATTN_NORM); + else if (self.classname == "monster_shambler") + sound (self, CHAN_VOICE, "shambler/ssight.wav", 1, ATTN_NORM); + else if (self.classname == "monster_demon1") + sound (self, CHAN_VOICE, "demon/sight2.wav", 1, ATTN_NORM); + else if (self.classname == "monster_wizard") + sound (self, CHAN_VOICE, "wizard/wsight.wav", 1, ATTN_NORM); + else if (self.classname == "monster_zombie") + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_NORM); + else if (self.classname == "monster_dog") + sound (self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM); + else if (self.classname == "monster_hell_knight" ) + sound (self, CHAN_VOICE, "hknight/sight1.wav", 1, ATTN_NORM); + else if (self.classname == "monster_tarbaby") + sound (self, CHAN_VOICE, "blob/sight1.wav", 1, ATTN_NORM); + else if (self.classname == "monster_enforcer") + { + local float rsnd; + rsnd = random(); + if (rsnd < 0.25) + sound (self, CHAN_VOICE, "enforcer/sight1.wav", 1, ATTN_NORM); + else if (rsnd < 0.5) + sound (self, CHAN_VOICE, "enforcer/sight2.wav", 1, ATTN_NORM); + else if (rsnd < 0.75) + sound (self, CHAN_VOICE, "enforcer/sight3.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "enforcer/sight4.wav", 1, ATTN_NORM); + } + else if (self.classname == "monster_army") + sound (self, CHAN_VOICE, "soldier/sight1.wav", 1, ATTN_NORM); + else if (self.classname == "monster_shalrath") + sound (self, CHAN_VOICE, "shalrath/sight.wav", 1, ATTN_NORM); +} + +void() FoundTarget = +{ + if (self.enemy.health <= 0 || self.enemy.customflags & CFL_PLUNGE) + return; + + if (self.enemy.classname == "player") + { // let other monsters see this monster for a while + sight_entity = self; + sight_entity_time = time; + } + + self.show_hostile = time + 1; // wake up other monsters + self.dmgtime = time + 1; // aggro timer + self.search_time = time + 5; // aggro timer + + SightSound (); + + // for awakening with velocity + if (self.movetype == MOVETYPE_STEP && self.movedir != '0 0 0') + { + self.velocity = self.movedir; + self.flags = not(self.flags, FL_ONGROUND); + self.movedir = '0 0 0'; // don't leap again if an infight starts + } + + HuntTarget (); +} + +/* +=========== +FindTarget + +Self is currently not attacking anything, so try to find a target + +Returns TRUE if an enemy was sighted + +When a player fires a missile, the point of impact becomes a fakeplayer so +that monsters that see the impact will respond as if they had seen the +player. +============ +*/ +float() FindTarget = +{ + local entity client; + local float r; + + //dprint("in findtarget\n"); + // (spawnflags & 3) unhacked by lunaran since I actually want to use spawnflag 2 for something + // apparently all the mega-enforcers in lunsp1 were ambush because of this ... oops + if ( sight_entity_time >= time - 0.1 && ( !(self.spawnflags & SPAWN_AMBUSH ) ) ) + { + client = sight_entity; + if (client.enemy == self.enemy) + return FALSE; + } + else + { + // to avoid spending too much time, only check a single client (or fakeclient) + // this means multiplayer games have slightly slower noticing monsters + client = checkclient(); + if (!client) + return FALSE; // no check entities in PVS + } + + if (client.flags & FL_NOTARGET || client.movetype == MOVETYPE_NOCLIP) + return FALSE; + if (client.health <= 0 || client.customflags & CFL_PLUNGE) + return FALSE; + + if (client == self.enemy) + return FALSE; + + r = range (client); + if (r == RANGE_TOOFAR) + return FALSE; + if (!visible (client)) + return FALSE; + + // tarbabies have all-around vision when idle because they are amorphous blobs + if (r == RANGE_NEAR) + { + if (client.show_hostile < time && (!infront(client) && self.classname != "monster_tarbaby")) + return FALSE; + } + else if (r == RANGE_MID || r == RANGE_FAR) + { + if ( /* client.show_hostile < time || */ (!infront(client) && self.classname != "monster_tarbaby")) + return FALSE; + } + + // the only two things that alert monsters when invisible besides damage: + // - firing a weapon + // - bumping into a dog + if (client.items & IT_INVISIBILITY) + { + if (self.classname == "monster_dog" && client.classname == "player") + { + if (r != RANGE_MELEE) + return FALSE; + } + else if (client.show_hostile < time) + { + return FALSE; + } + } + + // got one + self.enemy = client; + if (self.enemy.classname != "player") + { + self.enemy = self.enemy.enemy; // angered by a monster angering, use its enemy + if (self.enemy.classname != "player") + { + self.enemy = world; + return FALSE; + } + } + + FoundTarget (); + + return TRUE; +} + + +void(entity m) ai_freeze_monster = +{ + if (m == world) + error("tried to freeze the world"); + if (m.nextthink > time + 0.11 || m.nextthink < time) + return; // don't mess with what isn't active anyway + + m.nextthink = time + A_SHITLOAD; + m.button0 = m.movetype; + m.button1 = m.solid; + m.button2 = m.takedamage; + m.oldorigin = m.velocity; + + m.movetype = MOVETYPE_NONE; + m.solid = SOLID_NOT; + m.takedamage = DAMAGE_NO; + m.velocity = VEC_ORIGIN; +} + + + +void(entity m) ai_unfreeze_monster = +{ + if (m == world) + error("tried to unfreeze the world"); + if (!m.button0 && !m.button1 && !m.button2) + return; // never frozen + + m.nextthink = time + random() * 0.1 + 0.01; + m.movetype = m.button0; + m.solid = m.button1; + m.takedamage = m.button2; + m.velocity = m.oldorigin; + + m.button0 = m.button1 = m.button2 = 0; +} + + +/* +============================================================================== +PATH PATROL CODE + +The angle of the pathcorner effects standing and bowing direction, but has +no effect on movement, which always heads to the next target. +============================================================================== +*/ + +void() path_corner_touch = +{ + if (other.goalentity != self) return; + if (other.enemy) return; // fighting, not following a path + //bprint("valid pathcorner touch\n"); + + if (self.target != string_null) + { + other.goalentity = findunlocked(world, targetname, self.target); + } + else + { + other.goalentity = world; + } + if (!other.goalentity) + { + //bprint("dude stopped without a goalentity\n"); + other.pausetime = time + A_SHITLOAD; + other.think = other.th_stand; + // other.th_stand (); + other.ideal_yaw = self.angles_y; + return; + } + + if (other.classname == "monster_ogre") + sound (other, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound + + if (self.wait) + { + other.pausetime = time + self.wait; + other.think = other.th_stand; + // other.th_stand (); + other.ideal_yaw = self.angles_y; + return; + } + other.ideal_yaw = vectoyaw(other.goalentity.origin - other.origin); +} + +/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) +Monsters will continue walking towards the next target corner. + +Keys: +"targetname" must be present. The name of this pathcorner. +"target" the next spot to move to. If not present, stop here for good. +"wait" The number of seconds to spend standing here +"angle" direction to face while standing here +*/ +/*FGD +@PointClass base(Appearflags, Targetname, Target, Angle) size(16 16 16) color(0 255 255) = + path_corner : +"Waypoint for platforms and monsters. Will stop here for good if no path_corner is targeted by this entity. +Monsters who wait here will turn to face 'angle'." +[ + wait(integer) : "Wait (seconds)" : 0 +] +*/ +void() path_corner = +{ + if (!SUB_ShouldSpawn()) return; + + if (self.targetname == string_null) + { + dprint3("path_corner with no targetname at ", vtos(self.origin), "\n"); + remove(self); + return; + } + + if (!self.wait) + { + if (self.pausetime) + self.wait = self.pausetime; + else if (!self.target) + self.wait = -1; + } + + self.solid = SOLID_TRIGGER; + self.touch = path_corner_touch; + setsize (self, '-8 -8 -8', '8 8 8'); +} + + +/* +============= +ai_check_liquid + +take damage from slime and lava +============= +*/ +void() ai_check_liquid = +{ + // there are hacked takedamage cthons out there, and they're all in the lava + if (self.type == "boss" || self.classname == "monster_rotfish") + return; + + vector wtt; + wtt = WaterTest(); + float wl, wt; + wl = wtt_x; + wt = wtt_y; + + // never do liquid damage for some mild wading, since lots of ep3 has lava + // the monsters can step into and out of + if (wl < 3) + return; + + // monsters that spawn in slime/lava were clearly intended to be there by the + // mapper, so give them special dispensation to not quietly die before the + // player ever finds them. also, revoke their liquid rights once they leave, so + // they just die instead of staying lost if they fall back in + if (!wl) + { + self.customflags = not(self.customflags, CFL_LIQUID_IMMUNE); + return; + } + if (self.customflags & CFL_LIQUID_IMMUNE) + return; + + if (self.type == "zombie") + { + // zombies immune to slime (or else they just keep falling and getting up) + if (wt == CONTENT_LAVA) // but always gib if touching lava + T_Damage(self, world, world, self.health + 10); + } + else + { + if (wt == CONTENT_LAVA) + T_Damage(self, world, world, wl * 10); + if (wt == CONTENT_SLIME && self.classname != "monster_wizard") + // scrags will happily fly down into slime, and they do spit green shit anyway + T_Damage(self, world, world, wl * 5); + } +} + +/* +============================================================================== + +ANIMATION + +============================================================================== +*/ + + +/* +============= +ai_face + +Stay facing the enemy +============= +*/ +void() ai_face = +{ + ai_check_liquid(); + if (self.flags & (FL_FLY|FL_SWIM)) + self.velocity = '0 0 0'; + + self.ideal_yaw = enemy_yaw(); + ChangeYaw (); +} + + +/* +============= +ai_floatmove + +wrap movement code in this hot bullshit for making scrags do sick drifts +============= +*/ +void() ai_floatmove_start = +{ + if (self.flags & (FL_FLY|FL_SWIM) == 0) + return; + + self.velocity = '0 0 0'; + self.movetype = MOVETYPE_STEP; + self.oldorigin = self.origin; + self.flags = not(self.flags, FL_ONGROUND); +} + +float(vector mask) ai_floatmove_ceiltrace = +{ + vector start, end; + start = self.origin + vec_scale(self.maxs, mask); + end = self.origin + vec_scale(VEC_HULL_MAX, mask); + + traceline(start, end, FALSE, self); + if (trace_fraction < 1.0 || trace_startsolid || trace_allsolid) + return FALSE; + return TRUE; +} + +float() ai_floatmove_ceilcheck = +{ + if (!ai_floatmove_ceiltrace('0 0 1')) return FALSE; + if (!ai_floatmove_ceiltrace('1 1 1')) return FALSE; + if (!ai_floatmove_ceiltrace('-1 1 1')) return FALSE; + if (!ai_floatmove_ceiltrace('1 -1 1')) return FALSE; + if (!ai_floatmove_ceiltrace('-1 -1 1')) return FALSE; + return TRUE; +} + +float() ai_fishmovecheck = +{ + float opc; + opc = pointcontents(self.oldorigin); + if ( pointcontents(self.origin) != opc || + pointcontents(self.origin + '0 0 16') != opc || + !ai_floatmove_ceilcheck()) // goddamn fish noclipping through ceilings + return FALSE; + return TRUE; +} + +void(float dist) ai_floatmove_finish = +{ + vector move; + float interv, spd, frac; + + if (self.flags & (FL_FLY|FL_SWIM) == 0) + return; + + self.movetype = MOVETYPE_FLY; + move = self.origin - self.oldorigin; + + // fish have short bounding boxes, which in quake physics land means they can noclip through ceilings + if (pointcontents(self.origin) == CONTENT_SOLID) + { + setorigin(self, self.oldorigin); + //dprint("detected move into solid\n"); + self.velocity = '0 0 0'; + return; + } + + if (vlen(move) > dist + 16) + { + // probably touched a teleporter, so don't try to velocity interp + self.velocity = '0 0 0'; + return; + } + + interv = max(0.01, self.nextthink - time); + + // flying/swimming monsters don't raise/lower for regular path walking normally, so + // fudge the z velocity manually + if (self.goalentity.classname == "path_corner") + { + if (fabs(self.goalentity.origin_z - self.origin_z) > 16) + { + spd = vlen(move); + frac = spd / vlen(self.goalentity.origin - self.origin); + move_z = frac * (self.goalentity.origin_z - self.origin_z); + } + } + // FL_SWIM just invalidates any movement out of water, so simulate velocity + // being clipped off at the surface instead + // TODO: support water volumes that end in other directions than up + if (self.flags & FL_SWIM) + { + if (!ai_fishmovecheck()) + move_z = -1; + } + setorigin(self, self.oldorigin); + self.velocity = move / interv; +} + +/* +============= +movetogoalplus/walkmoveplus +============= +*/ +void(float dist) movetogoalplus = +{ + ai_floatmove_start(); + movetogoal(dist); + ai_floatmove_finish(dist); +} + +float(float yaw, float dist) walkmoveplus = +{ + float result; + vector oldorg; + ai_floatmove_start(); + oldorg = self.origin; + result = walkmove(yaw, dist); + if (oldorg == self.origin || !result) + { + ai_floatmove_finish(0); + return FALSE; + } + ai_floatmove_finish(dist); + return TRUE; +} + +/* +============= +walkmove_jitter + +try walkmoves on either side of ideal_yaw in case we're blocked by something glancing +============= +*/ +float(float yaw, float dist) walkmove_jitter = +{ + float yd; + if (walkmoveplus(yaw, dist)) return TRUE; + + if (random() < 0.5) yd = -15; + else yd = 15; + + if (walkmoveplus(yaw + yd, dist)) return TRUE; + if (walkmoveplus(yaw - yd, dist)) return TRUE; + return FALSE; +} + +/* +============= +ai_rush + +The monster is in a charging melee attack, always turning to face the player +rather than navigating around obstacles. this sometimes leads to getting hung +up and stuck on anything in the way, so add a safety check for our origin not +changing. + +we don't do this in normal ai_charge or wonky things happen with the charges +as part of normal melee-range attacks involving forward steps +============= +*/ +void(float d) ai_rush = +{ + ai_face(); + + if ( !walkmove_jitter(self.ideal_yaw, d) ) + { + if ( !walkmove_jitter(self.ideal_yaw, d * 0.5) ) + { + if (!walkmove_jitter(self.ideal_yaw, 1)) + { + if (self.oldorigin == self.origin && d > 0) + { + // haven't moved in 3 frames, verify charge + if (range(self.enemy) != RANGE_MELEE || !visible(self.enemy)) + { + // we aren't in the enemy's face, probably hung up on something + //bprint("canceling charge\n"); + self.think = self.th_run; + ai_attack_finished(0.4); // take a half second to get around the obstacle + return; + } + // it's important to use RANGE_MELEE as the test or else monsters will rapidly + // oscillate in and out of melee when fights get crowded and they can't move + } + } + } + } + + self.oldorigin = self.origin; +} + +/* +============= +ai_charge + +The monster is in a melee attack, so get as close as possible to .enemy +============= +*/ +float(float d) ai_charge = +{ + ai_face(); + + // try to get closer + // don't movetogoal in ai_charge or the yaw will spaz as the monster tries to 'pathfind' in c + if ( !walkmove_jitter(self.ideal_yaw, d) ) + { + if ( !walkmove_jitter(self.ideal_yaw, d * 0.5) ) + { + if (walkmove_jitter(self.ideal_yaw, 1)) + { + return TRUE; + } + } + else + { + return TRUE; + } + } + else + { + return TRUE; + } + return FALSE; +} + +void() ai_charge_side = +{ + local vector dtemp; + local float heading; + + +// aim to the left of the enemy for a flyby + + self.ideal_yaw = enemy_yaw(); + ChangeYaw (); + + + makevectors (self.angles); + dtemp = self.enemy.origin - 30*v_right; + heading = vectoyaw(dtemp - self.origin); + + walkmove_jitter(heading, 20); +} + + +/* +============= +ai_melee +============= +*/ +void() ai_melee = +{ + local vector delta; + local float ldmg; + + if (!self.enemy) + return; // removed before stroke + + delta = self.enemy.origin - self.origin; + + if (vlensqr(delta) > 60*60) + return; + + if (self.enemy.type == "zombie") + ldmg = 15; // trigger zombie pain so ai_melee'ing monsters don't just slash away endlessly + else + ldmg = 3 + random() * 2; //(random() + random() + random()) * 3; + + T_DamageMelee (self.enemy, self, ldmg); +} + + +void() ai_melee_side = +{ + local vector delta; + local float ldmg; + + if (!self.enemy) + return; // removed before stroke + + ai_charge_side(); + + delta = self.enemy.origin - self.origin; + + if (vlensqr(delta) > 60*60) + return; + if (!CanDamage (self.enemy, self)) + return; + ldmg = (random() + random() + random()) * 3; + T_DamageMelee (self.enemy, self, ldmg); +} + +//============================================================================ + +/* +============= +ai_forward/ai_back + +move without invoking any decisionmaking +============= +*/ +void(float dist) ai_forward = +{ + walkmove_jitter (self.angles_y, dist); +} + +void(float dist) ai_back = +{ + walkmove_jitter ( (self.angles_y+180), dist); +} + + +/* +============= +ai_pain + +stagger back a bit +============= +*/ +void(float dist) ai_pain = +{ + ai_back (dist); +} + +/* +============= +ai_painforward + +stagger back a bit, but forward +============= +*/ +void(float dist) ai_painforward = +{ + //walkmove (self.ideal_yaw, dist); + ai_forward (dist); +} + +/* +============= +ai_walk + +The monster is walking its beat +============= +*/ +void(float dist) ai_walk = +{ + //movedist = dist; + ai_check_liquid(); + + // check for noticing a player + if (FindTarget ()) + return; + + movetogoalplus(dist); // wraps movetogoal +} + + +/* +============= +ai_stand + +The monster is staying in one place for a while +============= +*/ +void() ai_stand = +{ + ai_check_liquid(); + + if (self.flags & (FL_FLY|FL_SWIM)) + self.velocity = '0 0 0'; + + if (FindTarget ()) + return; + + if (time > self.pausetime && self.goalentity) + { + self.th_walk (); + return; + } + + ChangeYaw(); +} + +/* +============= +ai_turn + +don't move, but turn towards ideal_yaw +============= +*/ +void() ai_turn = +{ + + if (FindTarget ()) + return; + + ChangeYaw (); +} + + +//============================================================================ + +/* +============= +ai_run_melee + +Turn and close until within an angle to launch a melee attack +============= +*/ +void() ai_run_melee = +{ + self.ideal_yaw = enemy_yaw(); + ChangeYaw (); + + if (FacingIdeal()) + { + self.th_melee (); + self.attack_state = AS_STRAIGHT; + } +} + + +/* +============= +ai_run_missile + +Turn in place until within an angle to launch a missile attack +============= +*/ +void() ai_run_missile = +{ + self.ideal_yaw = enemy_yaw(); + ChangeYaw (); + if (FacingIdeal()) + { + self.th_missile (); + self.attack_state = AS_STRAIGHT; + } +} + + +/* +============= +ai_run_slide + +Strafe sideways, but stay at approximately the same range +FIXME: check CONTENT_SOLID and reverse movement if any corners go out of the map +to fix scrags strafing into walls +is it strafing only or does flying ai_forward do it too? +============= +*/ +void(float dist) ai_run_slide = +{ + local float ofs; + + self.ideal_yaw = enemy_yaw(); + ChangeYaw (); + if (self.customflags & CFL_LEFTY) + ofs = 90; + else + ofs = -90; + + if (walkmoveplus (self.ideal_yaw + ofs, dist)) + return; + + self.customflags = xor(self.customflags, CFL_LEFTY); + //self.lefty = 1 - self.lefty; + + walkmoveplus (self.ideal_yaw - ofs, dist); +} + + +/* +============= +ai_run + +The monster has an enemy it is trying to kill +============= +*/ +void(float dist) ai_run = +{ + local entity targ; + + ai_check_liquid(); + + if (self.health <= 0) return; // died in slime/lava already + + targ = self.enemy; + + // if infighting and we haven't damaged our enemy in a while, give up + if (self.enemy.classname != "player" && self.oldenemy.classname == "player") + { + self.frags += 1; + // 15 seconds for monsters with ranged attacks, 10 for melee monsters + if (((self.customflags & CFL_MELEEONLY) && self.frags > 100) || self.frags > 150) + { + self.frags = 0; + SightSound(); + self.enemy = self.oldenemy; + } + } + + // see if the enemy is dead + // also consider a downed zombie to be dead, instead of waving a chainsaw over its body forever + if (targ.health <= 0 || targ.customflags & CFL_KNOCKEDDOWN) + { + self.enemy = world; + // FIXME: look all around for other targets + if (self.oldenemy.health > 0) + { + self.enemy = targ = self.oldenemy; + + HuntTarget (); + } + else + { + if (targ.classname == "player") + { + // go mill around the dead enemy + targ = spawn(); + targ.solid = SOLID_TRIGGER; + setorigin(targ, self.goalentity.origin); + setsize (targ, '-64 -64 -512', '64 64 1024'); + targ.angles = self.angles; + targ.touch = path_corner_touch; + + self.goalentity = targ; + self.th_walk (); + } + else + { + self.goalentity = world; + self.th_stand (); + } + return; + } + } + + self.show_hostile = time + 1; // wake up other monsters + + // check knowledge of enemy + enemy_vis = visible(targ); + enemy_range = range(targ); + + if (enemy_vis) + self.search_time = time + 5; + + // look for other coop players + if (coop && self.search_time < time) + { + if (FindTarget ()) + return; + } + + if (enemy_vis && !(self.enemy.customflags & CFL_PLUNGE)) + { + if (self.th_checkattack()) + { + if (self.attack_state == AS_MISSILE) + ai_run_missile (); + else if (self.attack_state == AS_MELEE) + ai_run_melee (); + else if (self.attack_state == AS_SLIDING) + ai_run_slide (dist); + return; + } + } + + if (self.attack_state == AS_SLIDING) + { + ai_run_slide (dist); + return; + } + + // head straight in + movetogoalplus(dist); // wraps movetogoal() +} + +/* +============= +ai_nop +============= +*/ +void() ai_nop = +{ + if (self.flags & (FL_FLY | FL_SWIM)) + self.velocity = '0 0 0'; +} diff --git a/QC_other/QC_copper/buttons.qc b/QC_other/QC_copper/buttons.qc new file mode 100644 index 00000000..5ad8d0ce --- /dev/null +++ b/QC_other/QC_copper/buttons.qc @@ -0,0 +1,198 @@ +/* +=========================================== +BUTTONS + +button and multiple button +for all your button +=========================================== +*/ + +void() button_wait = +{ + self.state = STATE_TOP; + self.nextthink = self.ltime + self.wait; + self.think = button_return; + activator = self.enemy; + SUB_UseTargets(); + SUB_PrintMessage(); + self.frame = 1; // use alternate textures +} + +void() button_done = +{ + self.state = STATE_BOTTOM; +} + +void() button_return = +{ + if (self.customflags & CFL_LOCKED) return; + self.state = STATE_DOWN; + SUB_CalcMove (self.pos1, self.speed, button_done); + self.frame = 0; // use normal textures + if (self.health) + self.takedamage = DAMAGE_YES; // can be shot again +} + + +void() button_blocked = +{ // do nothing, just don't ome all the way back out +} + + +void() button_fire = +{ + if (self.customflags & CFL_LOCKED) return; + if (self.state == STATE_UP || self.state == STATE_TOP) + return; + + if (self.noise != string_null) + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + self.state = STATE_UP; + SUB_CalcMove (self.pos2, self.speed, button_wait); +} + + +void() button_use = +{ + if (self.customflags & CFL_LOCKED) return; + self.enemy = activator; + + if (self.state == STATE_UP || self.state == STATE_DOWN) + return; + /* + // this is what target_lock is for + if (self.state == STATE_TOP) + { + if (self.wait < 0) + button_return(); + return; + }*/ + + button_fire (); +} + +void() button_touch = +{ + if (self.customflags & CFL_LOCKED) return; + if (other.classname != "player" || other.health <= 0) + return; + + self.enemy = other; + button_fire (); +} + +void() button_killed = +{ + self.enemy = damage_attacker; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + button_fire (); +} + +void(entity b) button_force = +{ + b.enemy = self; + SUB_CallAsSelf(button_fire, b); +} + +/*QUAKED func_button (0 .5 .8) ? +When a button is touched, it moves some distance in the direction of its angle, triggers all of its targets, waits some time, then returns to its original position where it can be triggered again. + +"angle" determines the opening direction +"target" all entities with a matching targetname will be used +"speed" override the default 40 speed +"wait" override the default 1 second wait (-1 = never return) +"lip" override the default 4 pixel lip remaining at end of move +"health" if set, the button must be killed instead of touched +"sounds" +0) steam metal +1) wooden clunk +2) metallic click +3) in-out +4) trigger noise (big light switch) +*/ +/*FGD +@SolidClass base(Angle,Target,Targetname,LipDist) = func_button : +"Button. When a button is touched, it moves some distance in the direction of its angle, triggers all of its targets, waits some time, then returns to its original position where it can be triggered again. +Acts as if touched when triggered." +[ + speed(integer) : "Speed" : 40 + health(integer) : "Health (shootable if > 0)" + lip(integer) : "Lip remaining at end of move" : 4 + distance(string) : "Distance to travel (overrides Lip)" : "0.0" + sounds(choices) : "Sounds" = + [ + 0 : "Steam metal" + 1 : "Wooden clunk" + 2 : "Metallic clink" + 3 : "In-out" + 4 : "Trigger noise (big light switch)" + ] + wait(string) : "Delay before reset" : "1" + delay(string) : "Delay before trigger" + message(string) : "Message" +] +*/ +void() func_button = +{ + if (!SUB_ShouldSpawn()) return; + if (self.sounds == 0) + { + precache_sound ("buttons/airbut1.wav"); + self.noise = "buttons/airbut1.wav"; + } + if (self.sounds == 1) + { + precache_sound ("buttons/switch21.wav"); + self.noise = "buttons/switch21.wav"; + } + if (self.sounds == 2) + { + precache_sound ("buttons/switch02.wav"); + self.noise = "buttons/switch02.wav"; + } + if (self.sounds == 3) + { + precache_sound ("buttons/switch04.wav"); + self.noise = "buttons/switch04.wav"; + } + if (self.sounds == 4) + { + precache_sound ("misc/trigger1.wav"); + self.noise = "misc/trigger1.wav"; + } + + SetMovedir (); + + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.model); + + self.blocked = button_blocked; + self.use = button_use; + + if (self.health) + { + self.max_health = self.health; + self.th_die = button_killed; + self.takedamage = DAMAGE_YES; + } + else + self.touch = button_touch; + + if (!self.speed) + self.speed = 40; + if (!self.wait) + self.wait = 1; + if (!self.lip) + self.lip = 4; + if (!self.distance) + self.distance = fabs(self.movedir*self.size) - self.lip; + + self.state = STATE_BOTTOM; + + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir * self.distance; +} + diff --git a/QC_other/QC_copper/client.qc b/QC_other/QC_copper/client.qc new file mode 100644 index 00000000..de791c7d --- /dev/null +++ b/QC_other/QC_copper/client.qc @@ -0,0 +1,1694 @@ +/* +============================================================================== + +CLIENT + +============================================================================== +*/ + + +void() SetChangeParms = +{ + if(reset_flag) + { + setspawnparms(self); + return; + } + + if (self.health <= 0) + { + SetNewParms (); + return; + } + + // remove items + self.items = self.items - (self.items & ( + IT_KEY1 | IT_KEY2 | + IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD + ) ); + + // cap super health + self.health = min(self.health, self.max_health); + // bump the player up if he's below 50 <- pretty much the only 'autobalance' in quake + if (skill < 3) // nightmare players now get no help + self.health = max(self.health, 50); + + parm1 = self.items; + parm2 = self.health; + parm3 = self.armorvalue; + // provide an ammo floor similar to the health floor on easy/medium + if (skill < 2 && self.ammo_shells < 25 && self.ammo_nails < 25) + parm4 = max(self.ammo_shells, 25 - self.ammo_nails); + else + parm4 = self.ammo_shells; + parm5 = self.ammo_nails; + parm6 = self.ammo_rockets; + parm7 = self.ammo_cells; + parm8 = self.weapon; + //parm9 = self.armortype; + +} + +void() SetNewParms = +{ + parm1 = IT_SHOTGUN | IT_AXE; + parm4 = 25; + parm8 = IT_SHOTGUN; + parm2 = 100; + parm3 = 0; + parm5 = 0; + parm6 = 0; + parm7 = 0; + parm9 = 0; +// parm10 = 0; +} + +void() DecodeLevelParms = +{ + + if (world.model == "maps/start.bsp") + SetNewParms (); // take away all stuff on starting new episode + + self.items = parm1; + self.health = parm2; + self.armorvalue = parm3; + self.ammo_shells = parm4; + self.ammo_nails = parm5; + self.ammo_rockets = parm6; + self.ammo_cells = parm7; + self.weapon = parm8; + //self.armortype = parm9; + + armor_set_type(self); +} + + +void(entity client, string savename) autosave = +{ + autosavename = savename; + stuffcmd(client, "echo Autosaving...; wait; save "); + stuffcmd(client, savename); + stuffcmd(client, "\n"); +} + +// this is no longer called +// too many ways to accidentally load into the wrong game or at the wrong time +// especially because stuffcmd evaluates during demo playback +void(entity client) autoload = +{ + if (autosavename == string_null) {bprint("no autosave\n");return;} + if (coop || deathmatch) {bprint("is mp\n");return;} + stuffcmd(client, "echo Loading last autosave...; wait; load "); + stuffcmd(client, autosavename); + stuffcmd(client, "\n"); +} + + + +/* +============================================================================= + +PLAYER GAME EDGE FUNCTIONS + +============================================================================= +*/ + +entity(entity start) get_next_client = +{ + entity next; + next = find(start, classname, "player"); + if (next == world) + next = find(world, classname, "player"); + return next; +} + +/* +================================ +transfer_keys +take a player's keys and give them to other clients + +letting the player carry more than one of each key broke coop. keys don't vanish +when touched so the game doesn't break if a key gets lost through death/lava/disconnect, +but a coop player could thus get a full load of keys within 15 frames by touching +one of these eternal keys. changing one requires fixing the other in a different way. +================================ +*/ +float() TransferKeys = +{ + if (!coop) return TRUE; + + float silver, gold, give; + entity recipient; + + if (self.items & IT_KEY1) + silver = self.worldtype & 15; + if (self.items & IT_KEY2) + gold = (self.worldtype & 240) / 16; + + // no keys + if (!silver && !gold) + return TRUE; + + recipient = get_next_client(self); + // if it's coop in name only and we're the only client, recipient will be self right away + while (recipient != self) + { + if (silver > 0) + { + give = 15 - (recipient.worldtype & 15); + give = min(give, silver); + if (give) + { + recipient.worldtype += give; + recipient.items |= IT_KEY1; + sprint(recipient, "You got "); + if (give > 1) + { + sprint(recipient, ftos(give)); + sprint(recipient, " Silver Keys from "); + } + else + sprint(recipient, "the Silver Key from "); + sprint(recipient, self.netname); + sprint(recipient, "\n"); + silver -= give; + } + } + if (gold > 0) + { + give = 15 - (recipient.worldtype & 240)/16; + give = min(give, gold); + if (give) + { + recipient.worldtype += give * 16; + recipient.items |= IT_KEY2; + sprint(recipient, "You got "); + if (give > 1) + { + sprint(recipient, ftos(give)); + sprint(recipient, " Gold Keys from "); + } + else + sprint(recipient, "the Gold Key from "); + sprint(recipient, self.netname); + sprint(recipient, "\n"); + gold -= give; + } + } + // no keys left, all given away + if (!silver && !gold) + return TRUE; + + recipient = get_next_client(recipient); + } + // we didn't give all the keys away, either all other players are full or we're the + // only dude left on the server + self.worldtype = silver + gold * 16; + return FALSE; + // just leave the rest in our own inventory and we'll respawn with them ourselves + + // keys can still be 'lost' from the server in the following way: + // if someone makes a map for copper (possible) with more than 15 of the same key in + // it (unlikely) and coop players (very unlikely) pick them all up and then + // someone disconnects such that there isn't enough room in all other players' + // combined inventories for them (infinitesimal), the remainder have nowhere to go + // and vanish with the disconnecting player +} + + +void() clear_respawning_flag_do = +{ + dprint("RESPAWNING flag cleared\n"); + serverflags = not(serverflags, SVFL_RESPAWNING); + remove(self); +} + +void() clear_respawning_flag = +{ + entity e = spawn(); + e.think = clear_respawning_flag_do; + e.nextthink = 2; +} + +// called by ClientKill and DeadThink +void() respawn = +{ + if (coop) + { + // make a copy of the dead body for appearances sake + CopyToBodyQueue (self); + // save the keys + TransferKeys(); + // get the spawn parms as they were at level start + setspawnparms (self); + // respawn + PutClientInServer (); + } + else if (deathmatch) + { + // make a copy of the dead body for appearances sake + CopyToBodyQueue (self); + // set default spawn parms + SetNewParms (); + // respawn + PutClientInServer (); + } + else + { // restart the entire server + //localcmd ("restart\n"); + + // preach's runefix: + // put serverflags back to map's initial setting + serverflags = startingserverflags | SVFL_RESPAWNING; // notify starting autosaves not to autosave + reset_flag = TRUE; // request a reset to the parms + localcmd("changelevel "); // "change" to the same level + localcmd(mapname); + localcmd("\n"); + } +} + + +/* +============ +ClientKill + +Player entered the suicide command +============ +*/ +void() ClientKill = +{ + bprint (self.netname); + bprint (" suicides\n"); + set_suicide_frame (); + self.modelindex = modelindex_player; + self.frags = self.frags - 2; // extra penalty + respawn (); +} + +float(vector v) CheckSpawnPoint = +{ + return FALSE; +} + +/* +============ +SelectSpawnPoint + +Returns the entity to spawn at +============ +*/ +entity() SelectSpawnPoint = +{ + local entity spot; + local entity thing; + local float pcount; + + spot = world; + + // testinfo_player_start is only found in regioned levels + if (!coop) + { + spot = find (world, classname, "testplayerstart"); + while (spot) + { + if (spot.spawnflags & 1 && cvar("developer")) + return spot; + + spot = find (spot, classname, "testplayerstart"); + } + } + + // choose a start point + if (coop) + { + lastspawn = find(lastspawn, classname, "info_player_coop"); + if (lastspawn == world) + lastspawn = find (world, classname, "info_player_coop"); + if (lastspawn == world) + lastspawn = find (lastspawn, classname, "info_player_start"); + if (lastspawn != world) + return lastspawn; + } + else if (deathmatch) + { + spot = lastspawn; + while (1) + { + spot = find(spot, classname, "info_player_deathmatch"); + if (spot != world) + { + if (spot == lastspawn) + return lastspawn; + pcount = 0; + thing = findradius(spot.origin, 32); + while(thing) + { + if (thing.classname == "player") + pcount = pcount + 1; + thing = thing.chain; + } + if (pcount == 0) + { + lastspawn = spot; + return spot; + } + } + else + error("This map does not support deathmatch! (no spawn points)\n"); + } + } + + if (serverflags & (SVFL_ALLEPISODES)) + { // return with a rune to start + spot = find (world, classname, "info_player_start2"); + if (spot) + return spot; + } + + spot = find (world, classname, "info_player_start"); + if (!spot) + error ("PutClientInServer: no info_player_start on level"); + + return spot; +} + + +/* +===========F +PutClientInServer + +called each time a player is spawned +============ +*/ +void() PutClientInServer = +{ + local entity spot; + + spot = SelectSpawnPoint (); + self.classname = "player"; + + // new for nightmare: reduced max health instead of the manky attack time scale + if (skill == 3) + self.max_health = 50; + else + self.max_health = 100; + self.health = self.max_health; + + self.takedamage = DAMAGE_AIM; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_WALK; + self.show_hostile = 0; + self.flags = FL_CLIENT; + self.customflags = 0; + self.air_finished = time + 12; + self.dmg = 0; // initial water damage + self.super_damage_finished = 0; + self.radsuit_finished = 0; + self.invisible_finished = 0; + self.invincible_finished = 0; + self.invincible_time = 0; + self.effects = 0; + + DecodeLevelParms(); + SetChangeParms(); + W_ResetWeaponState(); + + // we respawned with keys not taken away, make sure .items reflects this + if (self.worldtype & 15) self.items |= IT_KEY1; + if (self.worldtype & 240) self.items |= IT_KEY2; + + self.attack_finished = time; + self.th_pain = player_pain; + self.th_die = PlayerDie; + + self.deadflag = DEAD_NO; +// paustime is set by teleporters to keep the player from moving a while + self.pausetime = 0; + +// spot = SelectSpawnPoint (); + + self.origin = spot.origin + '0 0 1'; + self.v_angle = self.angles = spot.angles; + self.fixangle = TRUE; // turn this way immediately + + // yet another thing that doesn't work on the first frame + if (spot.fog_density) + fog_save(self,spot.fog_density,spot.fog_color); + else if (world.fog_density) + fog_save(self,world.fog_density,world.fog_color); + cleanUpClientShit = 2; + +// oh, this is a hack! + setmodel (self, "progs/eyes.mdl"); + modelindex_eyes = self.modelindex; + + setmodel (self, "progs/player.mdl"); + modelindex_player = self.modelindex; + + setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + + self.view_ofs = '0 0 22'; + + player_stand1(); + + if (deathmatch || coop) + { + teleport_flash(); + } + + spawn_tdeath (self.origin, self); + + // spawns fire targets when spawned at + SUB_UseEntTargets(spot); + + self.attack_finished = time + 0.1; // don't shoot on the first frame if we clicked to spawn + + if (serverflags & SVFL_RESPAWNING) clear_respawning_flag(); + + // if you load a map or a save while the storycam is up, its state persists, so clean it up here + // TintScreen(0); + // RestoreCrosshair(); + // neither of these works. too early for stuffcmds? now in player think +} + + +/* +=============================================================================== + +DEATHMATCH RULES + +=============================================================================== +*/ + +/* +go to the next level for deathmatch +only called if a time or frag limit has expired +*/ +void() NextLevel = +{ + local entity o; + + if (mapname == "start") + { + if (!cvar("registered")) + { + mapname = "e1m1"; + } + else if (!(serverflags & SVFL_EPISODE1)) + { + mapname = "e1m1"; + serverflags = serverflags | SVFL_EPISODE1; + } + else if (!(serverflags & SVFL_EPISODE2)) + { + mapname = "e2m1"; + serverflags = serverflags | SVFL_EPISODE2; + } + else if (!(serverflags & SVFL_EPISODE3)) + { + mapname = "e3m1"; + serverflags = serverflags | SVFL_EPISODE3; + } + else if (!(serverflags & SVFL_EPISODE4)) + { + mapname = "e4m1"; + serverflags = serverflags - 7; // cycle back to 1 + } + + o = spawn(); + o.map = mapname; + } + else + { + // find a trigger changelevel + o = find(world, classname, "trigger_changelevel"); + + // go back to start if no trigger_changelevel + if (!o) + { + mapname = "start"; + o = spawn(); + o.map = mapname; + } + } + + nextmap = o.map; + gameover = TRUE; + + if (o.nextthink < time) + { + o.think = execute_changelevel; + o.nextthink = time + 0.1; + } +} + +/* +============ +CheckRules + +Exit deathmatch games upon conditions +============ +*/ +void() CheckRules = +{ + local float timelimit; + local float fraglimit; + + if (gameover || !deathmatch) + return; + + timelimit = cvar("timelimit") * 60; + fraglimit = cvar("fraglimit"); + + if (timelimit && time >= timelimit) + { + NextLevel (); + return; + } + + if (fraglimit && self.frags >= fraglimit) + { + NextLevel (); + return; + } +} + +/* +//============================================================================ + +PLAYER THINKS AND MOVEMENT + +//============================================================================ +*/ + +// the player's health will always rot off to the soft max +// countdown is global now and not controlled by a touched megahealth thinking +void() PlayerHealthTick = +{ + if ( time < self.healthtime ) + return; + if ( self.health <= 0 ) + return; + + float hmax = self.max_health; + + if (self.health > hmax) + { + if (self.waterlevel < WL_EYES) + self.dmg = 0; // clear drown damage when overhealed + self.health -= 1; + self.healthtime = time + 1; + } + else + { + if (self.dmg > 0 && (self.waterlevel < WL_EYES || self.radsuit_finished > time) ) + { + // recover damage taken from drowning + //T_Heal(self, self.dmg, 0); + if (skill > 2) + self.health = min(hmax, self.health + ceil(self.dmg/4)); + else + self.health = min(hmax, self.health + ceil(self.dmg/2)); + self.dmg = max(0, self.dmg - 1); + self.healthtime = time + 0.5; + } + } + + +} + +/* +============ +IntermissionThink + +When the player presses attack or jump, change to the next level +============ +*/ +void() IntermissionThink = +{ + if (self.impulse) + { + // cycle forward or back in the intermissions with weapnext/weapprev + if (self.attack_finished < time) + { + // stay on cameras twice as long if player cycles to them manually + if (self.impulse == 10) + { + move_player_to_next_intermission(); + self.attack_finished = time + 0.2; + self.lifetime_finished = time + 12; + } + else if (self.impulse == 12) + { + move_player_to_previous_intermission(); + self.attack_finished = time + 0.2; + self.lifetime_finished = time + 12; + } + } + self.impulse = 0; + } + // auto-cycle intermission camera after six seconds + else if (time > self.lifetime_finished) + { + move_player_to_next_intermission(); + self.lifetime_finished = time + 6; + } + + if (time < intermission_exittime) + return; + + // start listening for input to leave + if (!self.button0 && !self.button1 && !self.button2) { + if (self.wait) ExitIntermission (); + self.wait = 0; + return; + } + + self.wait = 1; +} + +/* +============ +PlayerDeathThink + +When the player presses attack or jump, respawn or restart +============ +*/ +void() PlayerDeathThink = +{ + local float forward; + + if ((self.flags & FL_ONGROUND)) + { + forward = vlen (self.velocity); + forward = forward - 20; + if (forward <= 0) + self.velocity = '0 0 0'; + else + self.velocity = forward * normalize(self.velocity); + } + +// wait for all buttons released + if (self.deadflag == DEAD_DEAD) + { + if (self.button2 || self.button1 || self.button0) + return; + self.deadflag = DEAD_RESPAWNABLE; + return; + } + +// wait for any button down + if (!self.button2 && !self.button1 && !self.button0) + return; + + self.button0 = 0; + self.button1 = 0; + self.button2 = 0; + respawn(); +} + + +void() PlayerJump = +{ + + if (self.flags & FL_WATERJUMP) + return; + + if (self.waterlevel >= WL_WAIST) + { + if (self.watertype == CONTENT_WATER) + self.velocity_z = 100; + else if (self.watertype == CONTENT_SLIME) + self.velocity_z = 80; + else + self.velocity_z = 50; + +// play swiming sound + if (self.nextmovesound < time) + { + self.nextmovesound = time + 1; + if (random() < 0.5) + sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); + } + + return; + } + + if (self.movetype != MOVETYPE_NOCLIP) + { + if (!(self.flags & FL_ONGROUND)) return; + if ( !(self.flags & FL_JUMPRELEASED) ) return; // don't pogo stick + sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM); // h00rt + } + +// self.flags = self.flags - (self.flags & FL_JUMPRELEASED); +// self.flags = self.flags - FL_ONGROUND; // don't stairwalk + self.flags = not(self.flags, FL_JUMPRELEASED | FL_ONGROUND); // don't stairwalk + + self.button2 = 0; + self.velocity_z = self.velocity_z + 270; +} + + + +/* +=========== +WaterTest +test for liquids touching self from all directions + +doesn't set self.waterlevel/self.watertype directly because it's also used by +monsters, and faffing with those values makes them spam constant splash noises +============ +*/ +vector() WaterTest = +{ + if (self.movetype == MOVETYPE_NOCLIP) + return VEC_ORIGIN; + + float wl = 0; + float wt = 0; + float wp; + + // iw -- fix waterlevel detection + vector waist; + + // this is how the engine calculates the player's waist height (see + // the "SV_CheckWater" function in "sv_phys.c") + waist = self.origin; + waist_z += (self.mins_z + self.maxs_z) * 0.5; + + //wp = pointcontents(self.origin); + wp = pointcontents(waist); + // iw -- END + if (wp < -2 && wp > -6) + { + wl += 1; + wt = min(wt,wp); + } + wp = pointcontents(self.origin + self.mins); + if (wp < -2 && wp > -6) + { + wl += 1; + wt = min(wt,wp); + } + wp = pointcontents(self.origin + self.maxs); + if (wp < -2 && wp > -6) + { + wl += 1; + wt = min(wt,wp); + } + wp = pointcontents(self.origin + self.view_ofs); + if (wp < -2 && wp > -6) + { + wl += 1; + wt = min(wt,wp); + } + + return Vector(min(3,wl),wt,0); +} + +/* +=========== +PlayerWaterTest +============ +*/ +void() PlayerWaterTest = +{ + vector wtt; + wtt = WaterTest(); + float wl, wt; + wl = wtt_x; + wt = wtt_y; + + self.waterlevel = max(wl,self.waterlevel); + self.watertype = min(wt,self.watertype); +} + +/* +=========== +WaterMove +============ +*/ +void() WaterMove = +{ + if (self.movetype == MOVETYPE_NOCLIP) { + self.air_finished = time + 120; + return; + } + if (self.health < 0) + return; + + if (self.waterlevel < WL_EYES) // view is above water + { + if (time > self.air_finished || + time > self.air_finished - 10 && self.dmg) + { + sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM); + self.healthtime = time + 0.5; + } + else if (time > self.air_finished - 9) + { + sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM); + } + + // pentagram protects you from drowning, but if you spend enough time underwater, + // you're instantly out of air when it ends + self.air_finished = max(self.invincible_finished, time + 12); + //self.dmg = 0; // remember damage taken to recover it slowly + } + else // view is below the water + { + // if you don't catch your breath from the last drowning episode before diving + // again, you start to drown sooner the next time + if (self.air_finished < time + self.dmg / 2) + { // drown! + if (self.pain_finished < time) + { + self.deathtype = "drowning"; + if (skill > 2) + T_Damage (self, world, world, ceil(max(self.dmg, 1)/2)); + else + T_Damage (self, world, world, max(self.dmg, 1)); + self.deathtype = string_null; + self.pain_finished = time + 1; + self.dmg = min(15, self.dmg + 1); + } + } + } + + if (!self.waterlevel) + { + if (self.flags & FL_INWATER) + { + // play leave water sound + sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM); + self.flags = self.flags - FL_INWATER; + } + return; + } + + if (self.watertype == CONTENT_LAVA) + { // do damage + if (self.dmgtime < time) + { + if (self.radsuit_finished > time) + self.dmgtime = time + 1; + else + self.dmgtime = time + 0.2; + + if (self.waterlevel) + { + self.deathtype = "lava"; + // biosuit protects from lava if it's 16u deep or less + if (!(self.radsuit_finished > time && pointcontents(self.origin - '0 0 7') != CONTENT_LAVA)) + T_Damage (self, world, world, 10 * self.waterlevel); + self.deathtype = string_null; + } + } + } + else if (self.watertype == CONTENT_SLIME) + { // do damage + if (self.dmgtime < time && self.radsuit_finished < time) + { + self.dmgtime = time + 1; + self.deathtype = "slime"; + T_Damage (self, world, world, 4 * self.waterlevel); + self.deathtype = string_null; + } + } + + if ( !(self.flags & FL_INWATER) ) + { // player enter water sound + if (self.watertype == CONTENT_LAVA) + sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); + else if (self.watertype == CONTENT_WATER) + sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM); + else if (self.watertype == CONTENT_SLIME) + sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); + + self.flags = self.flags + FL_INWATER; + self.dmgtime = 0; + } + + if ( !(self.flags & FL_WATERJUMP) ) + { + // this is for water friction + self.velocity = self.velocity - 0.8 * self.waterlevel * frametime * self.velocity; + } +} + +void() CheckWaterJump = +{ + if (self.movetype == MOVETYPE_NOCLIP) + return; + + local vector start, end; + + + // check for a jump-out-of-water + makevectors (self.angles); + start = self.origin; + start_z = start_z + 8; + + if (v_forward_z < -0.25) + return; // don't waterjump if looking down into the water + + v_forward_z = 0; + normalize(v_forward); + end = start + v_forward*24; + + traceline (start, end, TRUE, self); + + if (trace_fraction < 1) + { + // solid at waist + start_z = start_z + self.maxs_z - 8; + end = start + v_forward*24; + self.movedir = trace_plane_normal * -50; + + traceline (start, end, TRUE, self); + + if (trace_fraction == 1) + { + // open at eye level + self.flags = self.flags | FL_WATERJUMP; + self.velocity_z = 225; + self.flags = self.flags - (self.flags & FL_JUMPRELEASED); + self.teleport_time = time + 2; // safety net + + return; + } + } +} + + +/* +================ +PlayerPreThink + +Called every frame before physics are run +================ +*/ +void() PlayerPreThink = +{ + if (cleanUpClientShit) + { + fog_setFromEnt( self, self ); + if ( !( self.customflags & CFL_PLUNGE ) ) + { + stuffcmd(self,"\nv_cshift\n"); + } + } + + if (intermission_running) + { + IntermissionThink (); // otherwise a button could be missed between + return; // the think tics + } + makevectors (self.v_angle); // is this still used + // lunaran: "yes" + + self.wait = 0; + + CheckRules(); + PlayerWaterTest(); + WaterMove(); + + if (self.waterlevel == WL_WAIST) + CheckWaterJump (); + + if (self.deadflag >= DEAD_DEAD) + { + PlayerDeathThink (); + return; + } + + if (self.deadflag == DEAD_DYING) + return; // dying, so do nothing + + if (self.button2) + { + PlayerJump (); + } + else + { + self.flags = self.flags | FL_JUMPRELEASED; + } + +// teleporters can force a non-moving pause time + if (time < self.pausetime) + self.velocity = '0 0 0'; + + if(time > self.attack_finished && + self.currentammo == 0 && + self.weapon != IT_AXE + ) + { + W_SelectBestWeapon(); + } + + if (self.movetype == MOVETYPE_NOCLIP) + { + self.flags = self.flags | FL_FLY; + } + + // ai_nav + //nav_editorThink(); +} + +/* +================ +CheckPowerups + +Check for turning off powerups +================ +*/ +void() CheckPowerups = +{ + if (self.health <= 0) + return; + +// invisibility + if (self.invisible_finished) + { +// sound and screen flash when items starts to run out + if (self.invisible_sound < time) + { + sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE); + self.invisible_sound = time + ((random() * 3) + 1); + } + + + if (self.invisible_finished < time + 3) + { + if (self.invisible_time == 1) + { + sprint (self, "Ring of Shadows' magic is fading ...\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, "items/inv2.wav", 1, ATTN_NORM); + self.invisible_time = time + 1; + } + + if (self.invisible_time < time) + { + self.invisible_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + + if (self.invisible_finished < time) + { // just stopped + self.items = self.items - IT_INVISIBILITY; + self.invisible_finished = 0; + self.invisible_time = 0; + } + + // use the eyes + self.frame = 0; + self.modelindex = modelindex_eyes; + } + else + self.modelindex = modelindex_player; // don't use eyes + +// invincibility + if (self.invincible_finished) + { +// sound and screen flash when items starts to run out + if (self.invincible_finished < time + 3) + { + if (self.invincible_time == 1) + { + sprint (self, "Protection is almost burned out ...\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM); + self.invincible_time = time + 1; + } + + if (self.invincible_time < time) + { + self.invincible_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + + if (self.invincible_finished < time) + { // just stopped + self.items = self.items - IT_INVULNERABILITY; + self.invincible_time = 0; + self.invincible_finished = 0; + } + if (self.invincible_finished > time) + self.effects = self.effects | EF_DIMLIGHT; + else + self.effects = self.effects - (self.effects & EF_DIMLIGHT); + } + +// super damage + if (self.super_damage_finished) + { + +// sound and screen flash when items starts to run out + + if (self.super_damage_finished < time + 3) + { + if (self.super_time == 1) + { + sprint (self, "Quad damage's power weakens ...\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM); + self.super_time = time + 1; + } + + if (self.super_time < time) + { + self.super_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + + if (self.super_damage_finished < time) + { // just stopped + self.items = self.items - IT_QUAD; + self.super_damage_finished = 0; + self.super_time = 0; + } + if (self.super_damage_finished > time) + self.effects = self.effects | EF_DIMLIGHT; + else + self.effects = self.effects - (self.effects & EF_DIMLIGHT); + } + +// suit + if (self.radsuit_finished) + { + self.air_finished = time + 12; // don't drown + +// sound and screen flash when items starts to run out + if (self.radsuit_finished < time + 3) + { + if (self.rad_time == 1) + { + sprint (self, "Air supply in Biosuit expiring ...\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM); + self.rad_time = time + 1; + } + + if (self.rad_time < time) + { + self.rad_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + + if (self.radsuit_finished < time) + { // just stopped + self.items = self.items - IT_SUIT; + self.rad_time = 0; + self.radsuit_finished = 0; + } + } + +} + +// a failed experiment to fix DOOF-DOOF-DOOFing down stairs +/* +void() CheckStairDescend = +{ + local vector drop; + if (!(self.customflags & CFL_WASONGROUND)) + return; + if (self.velocity_z > 0) + return; + + drop = self.origin; + + if (droptofloor(0,16)) + { + drop = drop - self.origin; + bprint("dropped "); + bprint(ftos(drop_z)); + bprint(" units\n"); + self.view_ofs_z += drop_z; + } +} +*/ + +/* +================ +PlayerPostThink + +Called every frame after physics are run +================ +*/ +void() PlayerPostThink = +{ + if ( intermission_running ) return; + + if (self.view_ofs == '0 0 0') + return; // intermission or finale + if (self.deadflag) + return; + + // do weapon stuff + W_WeaponFrame (); + // do health stuff + PlayerHealthTick(); + +// check to see if player landed and play landing sound + if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0)) + { + if (self.watertype == CONTENT_WATER) + sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM); + else if (self.jump_flag < -650) + { + self.deathtype = "falling"; + T_Damage (self, world, world, 5); + self.deathtype = string_null; + sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); + } + else + sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); + + self.jump_flag = 0; + } + + CheckPowerups (); + + if (self.movetype != MOVETYPE_NOCLIP) + { + self.flags = not(self.flags, FL_FLY); + } + + if (!(self.flags & FL_ONGROUND)) + self.jump_flag = self.velocity_z; + + // vaulting off the top of stairs sucks, but the right place to fix this is the .exe + /* + if (self.flags & FL_ONGROUND) + { + self.customflags = self.customflags | CFL_WASONGROUND; + } + else + { + self.jump_flag = self.velocity_z; + CheckStairDescend(); + + self.customflags = not(self.customflags, CFL_WASONGROUND); + } + */ +} + + +/* +=========== +ClientConnect + +called when a player connects to a server +============ +*/ +void() ClientConnect = +{ + bprint (self.netname); + bprint (" entered the game\n"); + + clients += 1; + +// a client connecting during an intermission can cause problems + if (intermission_running) + ExitIntermission (); +} + + +/* +=========== +ClientDisconnect + +called when a player disconnects from a server +============ +*/ +void() ClientDisconnect = +{ + if (gameover) + return; + // if the level end trigger has been activated, just return + // since they aren't *really* leaving + + clients -= 1; + + // don't leave with keys + TransferKeys(); + + // let everyone else know + bprint (self.netname); + bprint (" left the game with "); + bprint (ftos(self.frags)); + bprint (" frags\n"); + sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); + set_suicide_frame (); +} + +/* +=========== +ClientObituary + +called when a player dies +============ +*/ +void() ClientObituary = +{ + local float rnum; + local string deathstring, deathstring2; + rnum = random(); + + entity attacker = self.enemy; + + if (attacker.deathtype != string_null && attacker.classname != "player" ) + { + bprint(self.netname); + bprint(" "); + bprint(attacker.deathtype); + bprint("\n"); + return; + } + if (attacker.classname == "teledeath") + { + bprint (self.netname); + bprint (" was telefragged by "); + bprint (attacker.owner.netname); + bprint ("\n"); + + attacker.owner.frags = attacker.owner.frags + 1; + return; + } + if (attacker.classname == "trigger_void" || attacker.classname == "func_void") + { + bprint (self.netname); + bprint (" was lost to the void\n"); + return; + } + if (attacker.classname == "teledeath2") + { + bprint ("Satan's power deflects "); + bprint (self.netname); + bprint ("'s telefrag\n"); + + self.frags = self.frags - 1; + return; + } + + if (attacker.classname == "player") + { + if (self == attacker) + { + // killed self + attacker.frags = attacker.frags - 1; + bprint (self.netname); + + if (self.weapon == IT_LIGHTNING && self.waterlevel >= WL_WAIST) + { + bprint (" discharges into the water\n"); + return; + } + if (self.weapon == IT_GRENADE_LAUNCHER) + bprint (" tries to put the pin back in\n"); + else if (self.weapon == IT_ROCKET_LAUNCHER) + { + if (random() < 0.5) + bprint (" rocket-jumps into the next world\n"); + else + bprint (" is no rocket surgeon\n"); + } + else + bprint (" becomes bored with life\n"); + return; + } + + if ( (teamplay == 2) && (self.team > 0) && (self.team == attacker.team) ) + { + if (rnum < 0.25) + deathstring = " mows down a teammate\n"; + else if (rnum < 0.50) + deathstring = " checks his glasses\n"; + else if (rnum < 0.75) + deathstring = " gets a frag for the other team\n"; + else + deathstring = " loses another friend\n"; + bprint (attacker.netname); + bprint (deathstring); + attacker.frags = attacker.frags - 1; + return; + } + else + { + attacker.frags = attacker.frags + 1; + + rnum = attacker.weapon; + if (rnum == IT_AXE) + { + deathstring = " was axe-murdered by "; + deathstring2 = "\n"; + } + if (rnum == IT_SHOTGUN) + { + deathstring = " chewed on "; + deathstring2 = "'s boomstick\n"; + } + if (rnum == IT_SUPER_SHOTGUN) + { + deathstring = " ate 2 loads of "; + deathstring2 = "'s buckshot\n"; + } + if (rnum == IT_NAILGUN) + { + deathstring = " was nailed by "; + deathstring2 = "\n"; + } + if (rnum == IT_SUPER_NAILGUN) + { + deathstring = " was punctured by "; + deathstring2 = "\n"; + } + if (rnum == IT_GRENADE_LAUNCHER) + { + deathstring = " eats "; + deathstring2 = "'s pineapple\n"; + if (self.health < -40) + { + deathstring = " was gibbed by "; + deathstring2 = "'s grenade\n"; + } + } + if (rnum == IT_ROCKET_LAUNCHER) + { + deathstring = " rides "; + deathstring2 = "'s rocket\n"; + if (self.health < -40) + { + deathstring = " was gibbed by "; + deathstring2 = "'s rocket\n" ; + } + } + if (rnum == IT_LIGHTNING) + { + deathstring = " accepts "; + if (attacker.waterlevel >= WL_WAIST) + deathstring2 = "'s discharge\n"; + else + deathstring2 = "'s shaft\n"; + } + bprint (self.netname); + bprint (deathstring); + bprint (attacker.netname); + bprint (deathstring2); + } + return; + } + else + { + self.frags = self.frags - 1; + bprint (self.netname); + + // killed by a monster? + if (attacker.flags & FL_MONSTER) + { + // moved monster obits to their individual *.qc files + bprint (" was uninsured\n"); + return; + } + + // tricks and traps + if (attacker.classname == "explo_box") + { + bprint (" blew up\n"); + return; + } + if (attacker.solid == SOLID_BSP && attacker != world) + { + bprint (" was squished\n"); + return; + } + if (attacker.classname == "trap_shooter" || attacker.classname == "trap_spikeshooter") + { + bprint (" was spiked\n"); + return; + } + if (attacker.classname == "fireball") + { + bprint (" ate a lavaball\n"); + return; + } + if (attacker.classname == "trigger_changelevel") + { + bprint (" tried to leave\n"); + return; + } + + // liquid deaths + if (self.deathtype == "drowning") + { + if (random() < 0.5) + bprint (" sleeps with the fishes\n"); + else + bprint (" sucks it down\n"); + return; + } + else if (self.deathtype == "slime") + { + if (random() < 0.5) + bprint (" gulped a load of slime\n"); + else + bprint (" can't exist on slime alone\n"); + return; + } + else if (self.deathtype == "lava") + { + if (self.waterlevel < WL_EYES) + { + bprint (" burst into flames\n"); + return; + } + if (random() < 0.5) + bprint (" turned into hot slag\n"); + else + bprint (" visits the Volcano God\n"); + return; + } + + // fell to their death? + if (self.deathtype == "falling") + { + self.deathtype = string_null; + if (random() < 0.5) + bprint (" cratered\n"); + else + bprint (" fell to his death\n"); + return; + } + + // ELEPHINO + bprint (" died\n"); + } +} + + + +/* +============================================================================= + + SPAWNPOINTS + +============================================================================= +*/ + +/*FGD +@baseclass base(Appearflags, Angle, Fog, Target) size(-16 -16 -24, 16 16 32) + color(0 255 0) model({ "path": ":progs/player.mdl" }) = PlayerClass [] +*/ + +/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24) +The normal starting point for a level. Only one is allowed. Will fire its targets when a player is spawned here, with player as activator. + +"angle" viewing angle when spawning +"fog_color"/"fog_density" set the fog when spawning at this spot +*/ +/*FGD +@PointClass base(PlayerClass) = info_player_start : "Player 1 start" [] +*/ +void() info_player_start = +{ + self.mangle = self.angles; +} + + +/*QUAKED info_player_start2 (1 0 0) (-16 -16 -24) (16 16 24) +Only used on start map for the return point from an episode. Will fire its targets when a player is spawned here, with player as activator. + +"angle" viewing angle when spawning +"fog_color"/"fog_density" set the fog when spawning at this spot +*/ +/*FGD +@PointClass base(PlayerClass) = info_player_start2 : "Player episode return point" [] +*/ +void() info_player_start2 = +{ + self.mangle = self.angles; +} + + +/*QUAKED testplayerstart (1 0 0) (-16 -16 -24) (16 16 24) USE +Debug starting point for a level. Overrides info_player_start if present and 'USE' is checked, does nothing if 'USE' is not checked. Will fire its targets when a player is spawned, here with player as activator. + +"angle" viewing angle when spawning +"fog_color"/"fog_density" set the fog when spawning at this spot +*/ +void() testplayerstart = +{ + self.mangle = self.angles; +} + +/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24) +potential spawning position for deathmatch games + +"angle" viewing angle when spawning +"fog_color"/"fog_density" set the fog when spawning at this spot +*/ +/*FGD +@PointClass base(PlayerClass) = info_player_deathmatch : "Deathmatch start" [] +*/ +void() info_player_deathmatch = +{ +} + +void() coop_enable = +{ + self.classname = "info_player_coop"; + self.use = SUB_Null; +} + +/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24) TRIGGER_FIRST +Potential spawning position(s) for coop games. Will fire its targets when a player is spawned here, with player as activator. + +"angle" viewing angle when spawning +"fog_color"/"fog_density" set the fog when spawning at this spot + +TRIGGER_FIRST - this start won't be used to spawn coop players until triggered, so respawning players don't have to walk all the way back to the action +*/ +/*FGD +@PointClass base(PlayerClass, Targetname) = info_player_coop : "Player cooperative start" [ + spawnflags(flags) = [ + 1 : "Trigger first" : 0 + ] +] +*/ +void() info_player_coop = +{ + self.mangle = self.angles; + if (self.spawnflags & 1) + { + self.classname = "info_player_coop_notyet"; + self.use = coop_enable; + } +} \ No newline at end of file diff --git a/QC_other/QC_copper/combat.qc b/QC_other/QC_copper/combat.qc new file mode 100644 index 00000000..f6a86bc8 --- /dev/null +++ b/QC_other/QC_copper/combat.qc @@ -0,0 +1,633 @@ +/* +============================================================================== + +COMBAT + +============================================================================== +*/ + +void() killed_monster = +{ + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); +} + +/* +============ +Killed +============ +*/ +void(entity targ, entity attacker) Killed = +{ + local entity oself; + + activator = attacker; // catches a lot of misc cases like a shootable door firing a trigger_secret + + oself = self; + self = targ; + + //bprint4(self.classname, " died with ", ftos(self.health), " hp\n"); + + if (self.health < -99) + self.health = -99; // don't let sbar look bad (or throw gibs with crazy speed) + + if (self.movetype == MOVETYPE_PUSH || // doors, triggers, etc + (self.movetype == MOVETYPE_NONE && self.classname != "player")) + // players are movetype none while hanging out in a void pit waiting to die + { + //self.enemy = attacker; // why did you do this lunaran + self.th_die (); + self = oself; + return; + } + + // ai_nav + //if (self.navtarget) remove(self.navtarget); + // clear floaty bullshit on scrags and fish + ai_floatmove_start(); + + self.enemy = attacker; + self.deadflag = DEAD_DYING; + self.takedamage = DAMAGE_NO; + self.touch = SUB_Null; + + // bump the monster counter + if (self.flags & FL_MONSTER) + { + killed_monster(); + monster_death_use(); + } + + + if (self.classname != "player" && self.customflags & CFL_PLUNGE) + remove(self); + else + self.th_die (); + + self = oself; +} + + + +void(float t) PainFinished = +{ + //if (skill > 2) + // self.pain_finished = time + (t * 1.25); + //else + self.pain_finished = time + t; +} + +/* +============================================================================== + +MULTI-DAMAGE + +Collects multiple small damages into a single damage. Creates a chain of +entities and stores damage on each one, then applies it one by one and +wipes the chain. + + +============================================================================== +*/ + +entity multi_ent; + +void() ClearMultiDamage = +{ + multi_ent = world; +} + +void() ApplyMultiDamage = +{ + local entity head; + if (!multi_ent) + return; + head = multi_ent; + while (head) { + //bprint(ftos(head.multi_dmg)); + //bprint("\n"); + T_Damage (head, self, self, head.multi_dmg); + head.multi_dmg = 0; + head = head.multidmg_chain; + } +} + +void(entity hit, float damage) AddMultiDamage = +{ + local entity head; + + if (!hit) + return; + + if (!multi_ent) + { + // start the chain + head = multi_ent = hit; + head.multidmg_chain = world; + } + + else if (hit != multi_ent) + { + // search the chain for the entity we hit + head = multi_ent; + while (head) { + if (head == hit) break; + head = head.multidmg_chain; + } + if (!head) { + // put him at the beginning of the chain + hit.multidmg_chain = multi_ent; + multi_ent = hit; + head = hit; + } + } + else + head = multi_ent; + + head.multi_dmg = head.multi_dmg + damage; +} + + +/* +============ +CanDamage + +Returns true if the inflictor can directly damage the target. Used for +explosions and melee attacks. +============ +*/ +float(entity targ, entity inflictor) CanDamage = +{ + + // bmodels need special checking because their origin is 0,0,0 + if (targ.movetype == MOVETYPE_PUSH) + { + traceline2(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + if (trace_ent == targ) + return TRUE; + return FALSE; + } + + vector corner; + + // center + traceline2(inflictor.origin, targ.origin, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + // lunaran: adapted from maddes fix + + // do top first, as it's most likely to return a positive + corner = Vector(0,0,targ.maxs_z); + traceline2(inflictor.origin, targ.origin + corner, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + // check proper extents of wider monsters + corner = targ.size * 0.5 - '1 1 0'; + corner_z = 0; + traceline2(inflictor.origin, targ.origin + corner, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + corner_x *= -1; + traceline2(inflictor.origin, targ.origin + corner, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + corner_y *= -1; + traceline2(inflictor.origin, targ.origin + corner, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + corner_x *= -1; + traceline2(inflictor.origin, targ.origin + corner, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + // bottom + corner = Vector(0,0,targ.mins_z); + traceline2(inflictor.origin, targ.origin + corner, self, TRACE_NOMONSTERS); + if (trace_fraction == 1) + return TRUE; + + return FALSE; +} + +/* +============ +ArmorSave + +save damage based on the target's armor level. +is separate from T_Damage and duplicates a few checks so that func_voids can check + if they would kill the player before they actually try +============ +*/ +float ArmorSave(entity targ, float damage) +{ + if (!damage) return 0; + if (!targ.takedamage) + return 0; + if (targ.flags & FL_GODMODE || targ.invincible_finished >= time) + return 0; + + float save, savefrac; + + if (targ.deathtype == "drowning" || // armor doesn't protect you from drowning + targ.deathtype == "noarmor" || // only used by skill trigger health adjustment so far + targ.armorvalue <= 0) + return 0; + + savefrac = targ.armortype * damage; + + if (targ.classname == "player") + { + /* ======== + lots of tiny damages (like ai_melee or crushy movers) will always round to armor + when yellow or red, stripping it away too fast, and always round to health when + green, defeating the purpose of armor. + + instead we randomly apply the last fractional point to either armor or health so + that it's statistically balanced (... over geologic timescales) + ======== */ + save = floor(savefrac); + savefrac -= save; + if ( random() < savefrac ) save += 1; + } + else + { + // maintain old round-up behavior for everything else because mappers will use + // QC hacks to do just about anything + save = ceil(savefrac); + } + save = min(save, targ.armorvalue); + + return save; +} + +/* +============ +T_ReactToDamage + +.dmgtime: a monster will not be distracted from its current target + until after this time - set when hurt +============ +*/ +void( entity attacker ) T_ReactToDamage = +{ + // ignore self dmg + if ( attacker == self ) return; + // ignore bosses because we can't kill them anyway + if ( attacker.type == "boss" ) return; + + + if (attacker == self.enemy) + { + self.frags = 0; // .frags used on monsters as a 'give up on infighting' timer + return; + } + + if (attacker.classname == "player") + { + if (self.enemy.classname != "player") + { + self.enemy = attacker; + FoundTarget (); + } + self.enemy = attacker; + + self.dmgtime = time + 2; // players pull guaranteed aggro for 2 seconds before infighting can distract + return; + } + + // ======== + // all infighting cases follow: + + // don't switch away from a player who's actively attacking + if (time < self.dmgtime) return; + + // ignore doors and nailshooters and so on + if (!(attacker.flags & FL_MONSTER)) return; + + // fish should ignore monsters that aren't in the water with them + if (self.flags & FL_SWIM && pointcontents(attacker.origin) > CONTENT_WATER) return; + + // get mad unless of the same class (except for soldiers) + // classname check replaced with new "type" check + // .type defaults to classname anyway, or can be overwritten so monsters can be grouped into mutually not-infighting groups + if ( ( self.type != attacker.type ) || ( self.classname == "monster_army" ) ) + { + if (self.enemy.classname == "player") + self.oldenemy = self.enemy; + self.enemy = attacker; + self.dmgtime = time + 1; // focus on infight for a minumum of 1 second + FoundTarget(); + } +} + +/* +============ +T_Damage + +The damage is coming from inflictor, but get mad at attacker +This should be the only function that ever reduces health. +============ +*/ +void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = +{ + vector dir; + entity oldself; + float save, take; + + if (!damage || !targ.takedamage) return; + + if (targ == attacker) + { + // monsters which shouldn't be able to splash damage themselves to death: + if (attacker.type == "boss") return; + if (attacker.classname == "monster_ogre" || + attacker.classname == "monster_shalrath") + return; + } + + // used by buttons and triggers to set activator for target firing + damage_attacker = attacker; + + if (attacker.super_damage_finished > time) + { + damage = damage * 4; + + // silly hacky fix: + // knight health was dropped 3hp (75 to 72) so that exactly three shells can kill a knight + // the side effect of this was that one quad SNG shot (which does 72 dmg) would exactly kill a knight + // when, in vanilla, one would drop the knight to 3hp and the next would gib him + // the cleanest way to preserve the 'feel' of this is: + if (targ.classname == "monster_knight" && attacker.classname == "player" && inflictor.classname == "spike") + damage -= 3; + } + + + if (attacker.classname == targ.classname) + { + if (attacker.classname != "player" && attacker.classname != "monster_grunt") + damage = damage * 0.5; + } + + // .frags used on monsters to count time spent not damaging an enemy, so impossible infights time out + if (attacker.flags & FL_MONSTER && attacker.enemy == targ) + { + attacker.frags = 0; + } + + // figure momentum add + if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) + { + dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; + dir = normalize(dir); + targ.velocity = targ.velocity + dir*damage*8; + } + + if (targ.flags & FL_GODMODE) + return; + + // check for artifacts + + if (targ.invincible_finished >= time) + { + if (targ.invincible_sound < time) + { + sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); + targ.invincible_sound = time + 1; + } + return; + } + + // team play damage avoidance + if ( (teamplay == 1) && + (targ.team > 0) && + (targ.team == attacker.team) && + (targ != attacker) && + (attacker.classname == "player") && + (inflictor.classname != "door") ) // because squishing a teammate is still possible + return; + + // ready to do the damage + save = ArmorSave(targ, damage); + targ.armorvalue = targ.armorvalue - save; + if (targ.classname == "player") + armor_set_type(targ); + take = damage - save; + + // add to the damage total for clients, which will be sent as a single + // message at the end of the frame + // FIXME: remove after combining shotgun blasts? + if (targ.flags & FL_CLIENT) + { + targ.dmg_take = targ.dmg_take + take; + targ.dmg_save = targ.dmg_save + save; + targ.dmg_inflictor = inflictor; + } + + // do the damage + if (targ.customflags & CFL_UNDYING) + take = min(take, targ.health - 1); + + //bprint3("doing ", ftos(take), " damage\n"); + targ.health = ceil(targ.health - take); // be an integer dammit + + if (targ.health <= 0) + { + Killed (targ, attacker); + return; + } + + // react to the damage + oldself = self; + self = targ; + if ( (self.flags & FL_MONSTER) && attacker != world) + T_ReactToDamage( attacker ); + + if (self.th_pain) + { + self.th_pain (attacker, take); + // nightmare scaling of .pain_finished moved to PainFinished(), called from .th_pain + // on appropriate monsters only + } + self.customflags = not(self.customflags, CFL_AXEHITME | CFL_ZAPPED); // clear flags + self = oldself; +} + +/* +============ +T_DamageMelee +============ +*/ +void(entity targ, entity attacker, float damage) T_DamageMelee = +{ + if (targ.classname == "player") + { + if (targ.invisible_finished > time) + damage *= 0.5; + } + + // always do at least a damage + T_Damage(targ, attacker, attacker, max(1, floor(damage))); +} + +/* +============ +T_RadiusDamage +============ +*/ + +void(entity inflictor, entity attacker, entity tgt, float points, float multi) T_RadiusDamageCheck = +{ + local float pnts; + pnts = points; + if ( !CanDamage ( tgt, inflictor ) ) + return; + + // shambler takes half damage from all explosions + if (tgt.classname == "monster_shambler") pnts *= 0.5; + + + if (multi && tgt.movetype != MOVETYPE_WALK ) + AddMultiDamage( tgt, pnts ); + else T_Damage (tgt, inflictor, attacker, pnts); +} + + +void(entity inflictor, entity attacker, float damage, entity ignore, float multi) T_RadiusMultiDamage = +{ + float points, dist; + entity head; + vector org; + + head = findradius(inflictor.origin, damage+40); + + while (head) + { + if (head != ignore && head.takedamage) + { + org = head.origin + (head.mins + head.maxs)*0.5; + dist = vlen (inflictor.origin - org); + points = damage - (0.5 * dist); + if (head == attacker) + points = points * 0.5; + + // don't set off shootable doors/buttons with splash unless the player means it + if ((head.movetype == MOVETYPE_PUSH || head.th_die == multi_killed) && + head.type != "explobox" && + dist > damage / 3) + points = 0; + + points = max(0, points); //clamp + if (points > 0) + T_RadiusDamageCheck(inflictor, attacker, head, points, multi); + } + head = head.chain; + } +} + +void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage = +{ + T_RadiusMultiDamage(inflictor, attacker, damage, ignore, 0); +} + + + +/* +============ +T_BeamDamage +... unused +============ +*/ +void(entity attacker, float damage) T_BeamDamage = +{ + local float points; + local entity head; + + head = findradius(attacker.origin, damage+40); + + while (head) + { + if (head.takedamage) + { + points = 0.5*vlen (attacker.origin - head.origin); + if (points < 0) + points = 0; + points = damage - points; + if (head == attacker) + points = points * 0.5; + if (points > 0) + { + if (CanDamage (head, attacker)) + { + T_Damage (head, attacker, attacker, points); + } + } + } + head = head.chain; + } +} + + +/* +============ +T_Heal: add health to an entity, limiting health to max_health if it's set +special rules if the player is being healed: + "overheal" will limit health to the hard ceiling rather than medkit limit +returns TRUE if healing successfully took place +============ +*/ +float (entity e, float healamt, float overheal) T_Heal = +{ + float hmax, hceil; + + if (e.health <= 0) + return FALSE; + + healamt = ceil(healamt); + + if (e.classname == "player") + { + hmax = e.max_health; + hceil = 250; + + if (overheal) + healamt = min(healamt, hceil - e.health); + else + healamt = min(healamt, hmax - e.health); + + healamt = floor(healamt); // this should never come in as a float in the first place, buuut + + if (healamt <= 0) + return FALSE; + + if (overheal) + e.healthtime = time + 5; + else + e.healthtime = time + 1; + + e.health = e.health + healamt; + + // moved here from healthtouch so any source of healing prints messages + sprint(e, "You are healed by "); + sprint(e, ftos(healamt)); + sprint(e, "\n"); + stuffcmd (e, "bf\n"); + return TRUE; + } + + if (e.max_health >= 0) + healamt = min(healamt, e.max_health - e.health); + + if (healamt <= 0) + return FALSE; + + e.health = e.health + healamt; + + return TRUE; +} \ No newline at end of file diff --git a/QC_other/QC_copper/constants.qc b/QC_other/QC_copper/constants.qc new file mode 100644 index 00000000..eb07d7e9 --- /dev/null +++ b/QC_other/QC_copper/constants.qc @@ -0,0 +1,287 @@ +//================================================ +// constants +//================================================ + +string version = "Copper Quake 1.05 - 16 July 2019\n"; + +float FALSE = 0; +float TRUE = 1; + +// edict.flags +float FL_FLY = 1; +float FL_SWIM = 2; +float FL_CLIENT = 8; // set for all client edicts +float FL_INWATER = 16; // for enter / leave water splash +float FL_MONSTER = 32; +float FL_GODMODE = 64; // player cheat +float FL_NOTARGET = 128; // player cheat +float FL_ITEM = 256; // extra wide size for bonus items +float FL_ONGROUND = 512; // standing on something +float FL_PARTIALGROUND = 1024; // not all corners are valid +float FL_WATERJUMP = 2048; // player jumping out of water +float FL_JUMPRELEASED = 4096; // for jump debouncing + +// edict.customflags +float CFL_LEFTY = 1; // used by slidemovers (scrags) to alternate strafe direction +float CFL_ZAPPED = 2; +float CFL_AXEHITME = 4; +float CFL_LOCKED = 16; // special state-independent deactivation +float CFL_INPAIN = 16; // zombie behavior +float CFL_KNOCKEDDOWN = 32; // zombie behavior +float CFL_PLUNGE = 64; // has fallen in a death pit +float CFL_SPAWNER = 128; // is a generator of monsters +float CFL_UNDYING = 256; // god mode minus one point (player) +float CFL_LIQUID_IMMUNE = 512; // monster spawned touching slime or lava, so assume designer wants it immune to damage +float CFL_MELEEONLY = 1024; // has no ranged attack (monster) +// serverflags +float SVFL_EPISODE1 = 1; +float SVFL_EPISODE2 = 2; +float SVFL_EPISODE3 = 4; +float SVFL_EPISODE4 = 8; +float SVFL_ALLEPISODES = 15; +float SVFL_RESPAWNING = 2097152; // to notify target_autosave that we just restarted after dying + + + +// edict.movetype values +float MOVETYPE_NONE = 0; // never moves +//float MOVETYPE_ANGLENOCLIP = 1; +//float MOVETYPE_ANGLECLIP = 2; +float MOVETYPE_WALK = 3; // players only +float MOVETYPE_STEP = 4; // discrete, not real time unless fall +float MOVETYPE_FLY = 5; +float MOVETYPE_TOSS = 6; // gravity +float MOVETYPE_PUSH = 7; // no clip to world, push and crush +float MOVETYPE_NOCLIP = 8; +float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters +float MOVETYPE_BOUNCE = 10; +float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size + +// edict.solid values +float SOLID_NOT = 0; // no interaction with other objects +float SOLID_TRIGGER = 1; // touch on edge, but not blocking +float SOLID_BBOX = 2; // touch on edge, block +float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground +float SOLID_BSP = 4; // bsp clip, touch on edge, block + +// range values +float RANGE_MELEE = 0; // 0-120 +float RANGE_NEAR = 1; // 120-500 +float RANGE_MID = 2; // 500-900, max ranged attack dist +float RANGE_FAR = 3; // 900-1250, max awake dist +float RANGE_TOOFAR = 4; // 1250+ + +// deadflag values +float DEAD_NO = 0; +float DEAD_DYING = 1; +float DEAD_DEAD = 2; +float DEAD_RESPAWNABLE = 3; + +// takedamage values +float DAMAGE_NO = 0; +float DAMAGE_YES = 1; +float DAMAGE_AIM = 2; + +float TRACE_NOMONSTERS = 1; +float TRACE_WATER = 2; + +// monsters +float SPAWN_AMBUSH = 1; +float SPAWN_CRUCIFIEDX = 1; +/* +float SPAWN_TRIGGERED = 2; +float SPAWN_TFOG = 4; +float SPAWN_NO_TFRAG = 8; +float SPAWN_INSTAWAKE = 16; +float SPAWN_LYING = 32; // zombies +*/ +float SPAWN_TRIGGERED = 16; +float SPAWN_NO_TFOG = 32; +float SPAWN_NO_TFRAG = 64; +float SPAWN_INSTAWAKE = 128; +float SPAWN_LYING = 2; // zombies +float SPAWN_CRUCIFIED = 16384; // was 128, but random zombies in stock quake have spawnflags&128 left over from something :P + +// mode flags +float SPAWN_NOTEASY = 256; +float SPAWN_NOTNORMAL = 512; +float SPAWN_NOTHARD = 1024; +float SPAWN_NOTDM = 2048; +float SPAWN_COOPONLY = 4096; +float SPAWN_NOTCOOP = 8192; + +// items +float IT_AXE = 4096; +float IT_SHOTGUN = 1; +float IT_SUPER_SHOTGUN = 2; +float IT_NAILGUN = 4; +float IT_SUPER_NAILGUN = 8; +float IT_GRENADE_LAUNCHER = 16; +float IT_ROCKET_LAUNCHER = 32; +float IT_LIGHTNING = 64; +float IT_WEAPONS = 127 + 4096; + +float IT_SHELLS = 256; +float IT_NAILS = 512; +float IT_ROCKETS = 1024; +float IT_CELLS = 2048; + +float IT_ARMOR1 = 8192; +float IT_ARMOR2 = 16384; +float IT_ARMOR3 = 32768; +//float IT_SUPERHEALTH = 65536; // never gets used now, but the .exe expects the following flags + +float IT_KEY1 = 131072; +float IT_KEY2 = 262144; + +float IT_INVISIBILITY = 524288; +float IT_INVULNERABILITY = 1048576; +float IT_SUIT = 2097152; +float IT_QUAD = 4194304; +float IT_POWERUPS = IT_INVISIBILITY + IT_INVULNERABILITY + IT_SUIT + IT_QUAD; + + +// point content values +float CONTENT_EMPTY = -1; +float CONTENT_SOLID = -2; +float CONTENT_WATER = -3; +float CONTENT_SLIME = -4; +float CONTENT_LAVA = -5; +float CONTENT_SKY = -6; + +float WL_NONE = 0; +float WL_FEET = 1; +float WL_WAIST = 2; +float WL_EYES = 3; + + +// movers +float STATE_TOP = 0; +float STATE_BOTTOM = 1; +float STATE_UP = 2; +float STATE_DOWN = 3; + +float STATE_OFF = 0; +float STATE_ON = 1; + + + +float START_OFF = 1; + + +// geometry +vector VEC_ORIGIN = '0 0 0'; +vector VEC_HULL_MIN = '-16 -16 -24'; +vector VEC_HULL_MAX = '16 16 32'; + +vector VEC_HULL2_MIN = '-32 -32 -24'; +vector VEC_HULL2_MAX = '32 32 64'; + +vector VEC_ONE = '1 1 1'; +vector VEC_UP = '0 0 1'; +vector VEC_DOWN = '0 0 -1'; + +// sound channels +// channel 0 never willingly overrides +// other channels (1-7) always override a playing sound on that channel +float CHAN_AUTO = 0; +float CHAN_WEAPON = 1; +float CHAN_VOICE = 2; +float CHAN_ITEM = 3; +float CHAN_BODY = 4; +float CHAN_OTHER = 5; + +float ATTN_NONE = 0; +float ATTN_NORM = 1; +float ATTN_IDLE = 2; +float ATTN_STATIC = 3; + +// entity effects +float EF_BRIGHTFIELD = 1; +float EF_MUZZLEFLASH = 2; +float EF_BRIGHTLIGHT = 4; +float EF_DIMLIGHT = 8; + +// attack states +float AS_STRAIGHT = 1; +float AS_SLIDING = 2; +float AS_MELEE = 3; +float AS_MISSILE = 4; +float AS_LEAP = 5; + + +// protocol bytes +float SVC_UPDATESTAT = 3; +float SVC_SETVIEW = 5; +float SVC_TEMPENTITY = 23; +float SVC_CENTERPRINT = 26; +float SVC_KILLEDMONSTER = 27; +float SVC_FOUNDSECRET = 28; +float SVC_INTERMISSION = 30; +float SVC_FINALE = 31; +float SVC_CDTRACK = 32; +float SVC_SELLSCREEN = 33; +float SVC_CUTSCENE = 34; +float SVC_FOG = 41; // in fitzquake, byte byte byte byte short for density r g b lerptime + +// svc updatestat byte types +float STAT_HEALTH = 0; +float STAT_FRAGS = 1; +float STAT_WEAPON = 2; +float STAT_AMMO = 3; +float STAT_ARMOR = 4; +float STAT_WEAPONFRAME = 5; +float STAT_SHELLS = 6; +float STAT_NAILS = 7; +float STAT_ROCKETS = 8; +float STAT_CELLS = 9; +float STAT_ACTIVEWEAPON = 10; +float STAT_TOTALSECRETS = 11; // hmmm ... +float STAT_TOTALMONSTERS = 12; // must send this if new monsters are spawned after the map starts +float STAT_SECRETS = 13; // bumped on client side by svc_foundsecret +float STAT_MONSTERS = 14; // bumped by svc_killedmonster + +// temporary entities +float TE_SPIKE = 0; +float TE_SUPERSPIKE = 1; +float TE_GUNSHOT = 2; +float TE_EXPLOSION = 3; +float TE_TAREXPLOSION = 4; +float TE_LIGHTNING1 = 5; +float TE_LIGHTNING2 = 6; +float TE_WIZSPIKE = 7; +float TE_KNIGHTSPIKE = 8; +float TE_LIGHTNING3 = 9; +float TE_LAVASPLASH = 10; +float TE_TELEPORT = 11; +float TE_EXPLOSION2 = 12; +float TE_BEAM = 13; + +// update types +float UPDATE_GENERAL = 0; +float UPDATE_STATIC = 1; +float UPDATE_BINARY = 2; +float UPDATE_TEMP = 3; + +// messages +float MSG_BROADCAST = 0; // unreliable to all +float MSG_ONE = 1; // reliable to one (msg_entity) +float MSG_ALL = 2; // reliable to all +float MSG_INIT = 3; // write to the init string + + +// misc +float A_SHITLOAD = 9999999; +float AUTOAIM_DIST = 2048; + +float DEBUG_DMG_PER_ROCKET = 180; +float DEBUG_DMG_PER_NAIL = 9; +float DEBUG_DMG_PER_SHELL = 24; +float DEBUG_DMG_PER_CELL = 30; + +float MAX_AMMO_SHELLS = 100; +float MAX_AMMO_NAILS = 200; +float MAX_AMMO_ROCKETS = 100; +float MAX_AMMO_CELLS = 100; + +//================================================ diff --git a/QC_other/QC_copper/defs.qc b/QC_other/QC_copper/defs.qc new file mode 100644 index 00000000..5ee0faed --- /dev/null +++ b/QC_other/QC_copper/defs.qc @@ -0,0 +1,537 @@ +/* +============================================================================== + + SOURCE FOR GLOBALVARS_T C STRUCTURE + +============================================================================== +*/ + +// +// system globals +// +entity self; +entity other; +entity world; +float time; +float frametime; + +float force_retouch; // force all entities to touch triggers + // next frame. this is needed because + // non-moving things don't normally scan + // for triggers, and when a trigger is + // created (like a teleport trigger), it + // needs to catch everything. + // decremented each frame, so set to 2 + // to guarantee everything is touched +string mapname; + +float deathmatch; +float coop; +float teamplay; + +float serverflags; // propagated from level to level, used to + // keep track of completed episodes + +float total_secrets; +float total_monsters; + +float found_secrets; // number of secrets found +float killed_monsters; // number of monsters killed + + +// spawnparms are used to encode information about clients across server level changes +float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; + +// global variables set by built in functions +vector v_forward, v_up, v_right; // set by makevectors() + +// set by traceline / tracebox +float trace_allsolid; +float trace_startsolid; +float trace_fraction; +vector trace_endpos; +vector trace_plane_normal; +float trace_plane_dist; +entity trace_ent; +float trace_inopen; +float trace_inwater; + +entity msg_entity; // destination of single entity writes + +// required prog functions +void() main; // only for testing + +void() StartFrame; + +void() PlayerPreThink; +void() PlayerPostThink; + +void() ClientKill; +void() ClientConnect; +void() PutClientInServer; // call after setting the parm1... parms +void() ClientDisconnect; + +void() SetNewParms; // called when a client first connects to + // a server. sets parms so they can be + // saved off for restarts + +void() SetChangeParms; // call to set parms for self so they can + // be saved for a level transition + + +//================================================ +void end_sys_globals; // flag for structure dumping +//================================================ + +/* +============================================================================== + + SOURCE FOR ENTVARS_T C STRUCTURE + +============================================================================== +*/ + +// +// system fields (*** = do not set in prog code, maintained by C code) +// +.float modelindex; // *** model index in the precached list +.vector absmin, absmax; // *** origin + mins / maxs + +.float ltime; // local time for entity +.float movetype; +.float solid; + +.vector origin; // *** +.vector oldorigin; // *** +.vector velocity; +.vector angles; +.vector avelocity; + +.vector punchangle; // temp angle adjust from damage or recoil + +.string classname; // spawn function +.string model; +.float frame; +.float skin; +.float effects; + +.vector mins, maxs; // bounding box extents reletive to origin +.vector size; // maxs - mins + +.void() touch; +.void() use; +.void() think; +.void() blocked; // for doors or plats, called when can't push other + +.float nextthink; +.entity groundentity; + +// stats +.float health; +.float frags; +.float weapon; // one of the IT_SHOTGUN, etc flags +.string weaponmodel; +.float weaponframe; +.float currentammo; +.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; + +.float items; // bit flags + +.float takedamage; +.entity chain; +.float deadflag; + +.vector view_ofs; // add to origin to get eye point + +.float button0; // fire +.float button1; // use +.float button2; // jump + +.float impulse; // weapon changes + +.float fixangle; +.vector v_angle; // view / targeting angle for players +.float idealpitch; // calculated pitch angle for lookup up slopes + + +.string netname; + +.entity enemy; + +.float flags; + +.float colormap; +.float team; + +.float max_health; + +.float teleport_time; // don't back up + +.float armortype; // save this fraction of incoming damage +.float armorvalue; + +.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes, 4 = entire bbox +.float watertype; // a contents value + +.float ideal_yaw; +.float yaw_speed; + +.entity aiment; + +.entity goalentity; // a movetarget or an enemy + +.float spawnflags; + +.string target; +.string targetname; + +// damage is accumulated through a frame. and sent as one single +// message, so the super shotgun doesn't generate huge messages +.float dmg_take; +.float dmg_save; +.entity dmg_inflictor; + +.entity owner; // who launched a missile +.vector movedir; // mostly for doors, but also used for waterjump + +.string message; // trigger messages + +.float sounds; // either a cd track number or sound number + +.string noise, noise1, noise2, noise3; // contains names of wavs to play + +//================================================ +void end_sys_fields; // flag for structure dumping +//================================================ + +/* +============================================================================== + + VARS NOT REFERENCED BY C CODE + +============================================================================== +*/ + +.void() use; + +// globals + +float gameover; // set when a rule exits + +string nextmap; // used by changelevel code in client.qc - 'mapname' is current map + +string string_null; // null string, nothing should be held here + +entity activator; // the entity that activated a trigger or brush + +entity damage_attacker; // set by T_Damage + +float framecount; +float reset_flag; +float startingserverflags; +nosave float gamestarted; +nosave float cleanUpClientShit; +nosave float clients; + +string autosavename; +// this is not 'nosave' so that if you die, then autoreload from the autosave, then +// die again, the autosave remembers that you autosaved + +float skill; + +// for balancing: total monster HP/ammo -HP/zombies/grenades in the level +float monster_health; +float ammo_total; +float num_zombies; +float num_rockets; + +float trace_debug; + +// moved from ai.qc or maybe combat.qc - used for target finding +float enemy_vis, enemy_range;//, enemy_infront; +float enemy_yaw(); + +// when a monster becomes angry at a player, that monster will be used +// as the sight target the next frame so that monsters near that one +// will wake up even if they wouldn't have noticed the player +entity sight_entity; +float sight_entity_time; + +// moved from world.qc +entity lastspawn, bodyqueue_head; + +// moved from client.qc +float intermission_running, intermission_exittime; +float modelindex_eyes, modelindex_player; + +float icantsee; + +//================================================ + +// world fields +.string wad; +.string map; +.float worldtype; // 0=medieval 1=metal 2=base + +.string killtarget; +.string target2; +.string target3; +.string target4; +//.string pretarget; // to be fired before ... things +//.string posttarget; // to be fired after them + +.float alpha; + +// lights +.float style; +.float oldstyle; + +// monster ai +.void() th_stand; +.void() th_walk; +.void() th_run; +.void() th_missile; +.void() th_melee; +.void(entity attacker, float damage) th_pain; +.void() th_die; +.float() th_checkattack; +.entity oldenemy; // mad at this player before taking damage +.float attack_finished; +.float pain_finished; +.float search_time; +.float attack_state; +.float pausetime; + +// player only fields +.float walkframe; +.float invincible_time, invincible_sound, invincible_finished; +.float invisible_time, invisible_sound, invisible_finished; +.float super_time, super_sound, super_damage_finished; +.float rad_time, radsuit_finished; +.float nextmovesound; // replaces swim_flag and fly_sound, both of which were timers +.float show_hostile; // set to time+0.2 whenever a client fires a + // weapon or takes damage. Used to alert + // monsters that otherwise would let the player go +.float jump_flag; // player jump "flag" +.float air_finished; // when time > air_finished, start drowning +.float bubble_count; // keeps track of the number of bubbles +.float healthtime; +.string deathtype; // keeps track of how the player died + +// fog +.vector fog_color, fog_color2; +.float fog_density, fog_density2; + + +// object stuff +//.string mdl; // only used by items to hide until respawn time +.float gravity; +.vector mangle; // angle at start + +// doors/movers +.vector dest, dest1, dest2; +.vector pos1, pos2; // top and bottom positions +//.vector oldorigin; // only used by secret door +.vector finaldest, finalangle; +.void() think1; +.float speed, speed2; +.float wait; // time from firing to restarting +.float delay; // time from activation to firing +.float length, width, height; +.float t_length = length; // preserve old func_door_secret maphacks +.float t_width = width; + + +.float touch_time; +.float lip; +.float state; +.float dmg; // damage done by door when hit +.entity trigger_field; // door's trigger entity +.string noise4; + +// triggers +.float count; // for counting triggers +.float cnt; // used on grunts, enforcers, dguards, and ogres for attack refire + // used on nouronihar for attack patterning + // reused on players for nailgun barrel cycling + +// sounds +.float distance; +.float volume; + +//.float inpain; // from zombie.qc, moved to .customflags +//.float lefty; // moved to .customflags +//.float axhitme; // moved to .customflags +//.float zapped; // moved to .customflags +.float customflags; // inpain, axehitme, zapped, etc, see constants.qc +.float healamount; // moved from items.qc - only used on health boxes +.float dmgtime; // moved from client.qc - used in drowning code & as a coop aggro timer +.entity multidmg_chain; // moved from combat.qc - for multidmg +.float multi_dmg; + +.string type; // to make find()ing easier, and for tons of useful misc. classification +.entity buddy; // a common entity reference without the specific implications of 'owner' or 'enemy' +.float strength; + +.float lifetime_finished; +.float notrace; // entity will be invisible to traceline2() +.vector oldvelocity; // necessary for getting projectiles to pass through .notrace entities +.entity trueowner; // now this is getting dumb + +// OVERLOADS: +.float rand = healamount; // for trigger_timer +.float svflags = jump_flag; // for target_give and item_sigil +.vector fadecolor = fog_color; // for func_void fadeout +.string include = wad; // for monsterjump filters +.string exclude = map; +.float light_lev = bubble_count; // shuts up a stupid stupid warning + +//=========================================================================== +// builtin functions +//=========================================================================== + +void(vector ang) makevectors = #1; // sets v_forward, etc globals +void(entity e, vector o) setorigin = #2; +void(entity e, string m) setmodel = #3; // set movetype and solid first +void(entity e, vector min, vector max) setsize = #4; +// #5 was removed +void() break = #6; +float() random = #7; // returns 0 - 1 +void(entity e, float chan, string samp, float vol, float atten) sound = #8; +vector(vector v) normalize = #9; +void(string e) error = #10; +void(string e) objerror = #11; +float(vector v) vlen = #12; +float(vector v) vectoyaw = #13; +entity() spawn = #14; +void(entity e) remove = #15; + +// sets trace_* globals +// An entity will also be ignored for testing if forent == test, +// forent->owner == test, or test->owner == forent +// a forent of world is ignored +void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16; +// fun fact for future self: 'nomonsters' actually means no entities. the next time you +// go out of your motherfucking mind trying to trace against an entity that isn't a monster +// and get world every time, this is why. + +entity() checkclient = #17; // returns a client to look for +entity(entity start, .string fld, string match) find = #18; +string(string s) precache_sound = #19; +string(string s) precache_model = #20; +void(entity client, string s)stuffcmd = #21; +entity(vector org, float rad) findradius = #22; // findradius only works on solid entities +void(string s) bprint = #23; +void(entity client, string s) sprint = #24; +void(string s) dprint = #25; +string(float f) ftos = #26; +string(vector v) vtos = #27; +void() coredump = #28; // prints all edicts +void() traceon = #29; // turns statement trace on +void() traceoff = #30; +void(entity e) eprint = #31; // prints an entire edict +float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE +// #33 was removed +float(float yaw, float dist) droptofloor = #34; // TRUE if landed on floor +void(float style, string value) lightstyle = #35; +float(float v) rint = #36; // round to nearest int +float(float v) floor = #37; // largest integer <= v +float(float v) ceil = #38; // smallest integer >= v +// #39 was removed + +float(entity e) checkbottom = #40; // true if self is on ground +// "Returns false if any part of the bottom of the entity is off an edge that is not a staircase." + +float(vector v) pointcontents = #41; // returns a CONTENT_* +// #42 was removed +float(float f) fabs = #43; +vector(entity e, float speed) aim = #44; // returns the shooting vector +float(string s) cvar = #45; // return cvar.value +void(string s) localcmd = #46; // put string into local que +entity(entity e) nextent = #47; // for looping through all ents +void(vector org, vector dir, float color, float count) particle = #48;// start a particle effect +void() ChangeYaw = #49; // turn towards self.ideal_yaw + // at self.yaw_speed +// #50 was removed +vector(vector v) vectoangles = #51; + +// direct client message generation +void(float to, float f) WriteByte = #52; +void(float to, float f) WriteChar = #53; +void(float to, float f) WriteShort = #54; +void(float to, float f) WriteLong = #55; +void(float to, float f) WriteCoord = #56; +void(float to, float f) WriteAngle = #57; +void(float to, string s) WriteString = #58; +void(float to, entity s) WriteEntity = #59; + +// broadcast client message generation +// void(float f) bWriteByte = #59; +// void(float f) bWriteChar = #60; +// void(float f) bWriteShort = #61; +// void(float f) bWriteLong = #62; +// void(float f) bWriteCoord = #63; +// void(float f) bWriteAngle = #64; +// void(string s) bWriteString = #65; +// void(entity e) bWriteEntity = #66; + +void(float step) movetogoal = #67; + +string(string s) precache_file = #68; // no effect except for -copy +void(entity e) makestatic = #69; +void(string s) changelevel = #70; + +//#71 was removed + +void(string var, string val) cvar_set = #72; // sets cvar.value + +void(entity client, string s) centerprint = #73; // sprint, but in middle +void(entity client, string s, string s) centerprint2 = #73; // sprint, but in middle +void(entity client, string s, string s, string s) centerprint3 = #73; // sprint, but in middle +void(entity client, string s, string s, string s, string s) centerprint4 = #73; // sprint, but in middle +void(entity client, string s, string s, string s, string s, string s) centerprint5 = #73; // sprint, but in middle + +void(vector pos, string samp, float vol, float atten) ambientsound = #74; + +string(string s) precache_model2 = #75; // registered version only +string(string s) precache_sound2 = #76; // registered version only +string(string s) precache_file2 = #77; // registered version only + +void(entity e) setspawnparms = #78; // set parm1... to the + // values at level start + // for coop respawn + + +//================================================ + +/*FGD +@baseclass = Angle [ angle(integer) : "Direction" ] +@baseclass = Appearflags [ + spawnflags(Flags) = + [ + 256 : "Not on Easy" : 0 + 512 : "Not on Normal" : 0 + 1024 : "Not on Hard+" : 0 + 2048 : "Not in Deathmatch" : 0 + 4096 : "Only in Coop" : 0 + 8192 : "Not in Coop" : 0 + ] +] + +@baseclass = Targetname [ targetname(target_source) : "Name" ] +@baseclass = Target [ + target(target_destination) : "Target" + target2(target_destination) : "Target" + target3(target_destination) : "Target" + target4(target_destination) : "Target" + killtarget(target_destination) : "Killtarget" +] + +@baseclass = Deathtype [ deathtype(string) : "Obituary message" ] +@baseclass = Bounds [ mangle(string) : "Bounds size, centered (x y z)" ] + +@baseclass = Phong [ + _phong(integer) : "Use phong smoothing" : 0 + _phong_angle(integer) : "Phong angle" : 88 +] +*/ \ No newline at end of file diff --git a/QC_other/QC_copper/dev.qc b/QC_other/QC_copper/dev.qc new file mode 100644 index 00000000..ae9eb223 --- /dev/null +++ b/QC_other/QC_copper/dev.qc @@ -0,0 +1,206 @@ +/* +============================================================================== + +DEV COMMANDS + +============================================================================== +*/ + +void() dev_test = +{ + local vector org; + makevectors(self.v_angle); + org = self.origin + self.view_ofs; + traceline2(org, org + v_forward * 8192, self, 0); + + if (trace_fraction == 1.0 || !trace_ent) + return; + + entity head = findalltargets(trace_ent); + while(head) + { + bprint4(head.classname, " @ ", vtos(head.origin), "\n"); + head = head.chain; + } + bprint("-----\n"); +} + +void() dev_tracetest = +{ + local vector org; + makevectors(self.v_angle); + org = self.origin + self.view_ofs; + + traceline (org, org + v_forward * 2048, FALSE, self); + + bprint3("startpos: ", vtos(org), "\n"); + bprint3("endpos: ", vtos(trace_endpos), "\n"); + bprint3("water: ", ftos(trace_inwater), "\n"); + bprint3("open: ", ftos(trace_inopen), "\n"); + bprint3("allsolid: ", ftos(trace_allsolid), "\n"); + + traceline2 (org, org + v_forward * 2048, self, 0); + + bprint3("startpos: ", vtos(org), "\n"); + bprint3("endpos: ", vtos(trace_endpos), "\n"); + bprint3("water: ", ftos(trace_inwater), "\n"); + bprint3("open: ", ftos(trace_inopen), "\n"); + bprint3("allsolid: ", ftos(trace_allsolid), "\n"); +} + +void() dev_hitpoints = +{ + float zdif; + + bprint("----------\nRockets: "); + bprint(ftos(num_rockets)); + bprint(" Zombies: "); + bprint(ftos(num_zombies)); + + zdif = num_rockets - num_zombies; + zdif = max(0,num_rockets); + ammo_total += zdif * DEBUG_DMG_PER_ROCKET; + + bprint("\nMonster HP: "); + bprint(ftos(monster_health)); + bprint("\nAmmo DP: "); + bprint(ftos(ammo_total)); + bprint("\nRATIO: "); + bprint(ftos(ammo_total / monster_health)); + bprint("\n"); +} + +void() dev_warp = +{ + if(deathmatch || coop) + return; + local vector org; + makevectors(self.v_angle); + org = self.origin + self.view_ofs; + traceline (org, org + v_forward * 8192, FALSE, self); + + if (trace_fraction < 1.0) + { + org = trace_endpos; + org += trace_plane_normal * 40; + } + setorigin(self,org); +} + +void() dev_serverflags = +{ + bprint3("SERVER FLAGS:\n========\n",ftos(serverflags),"\n"); + if (serverflags & SVFL_EPISODE1) bprint(" episode 1 completed\n"); + if (serverflags & SVFL_EPISODE2) bprint(" episode 2 completed\n"); + if (serverflags & SVFL_EPISODE3) bprint(" episode 3 completed\n"); + if (serverflags & SVFL_EPISODE4) bprint(" episode 4 completed\n"); + if (serverflags & SVFL_ALLEPISODES) bprint(" all of quake completed\n"); +} + + +// this is the most fun cheat code in the history of anything: +void() dev_invoke = +{ + if(deathmatch || coop) + return; + local vector org; + makevectors(self.v_angle); + org = self.origin + self.view_ofs; + traceline2(org, org + v_forward * 8192, self, 0); + + if (trace_fraction < 1.0 && trace_ent) + { + activator = self; + + if (trace_ent.flags & FL_MONSTER) + monster_kill(trace_ent); + else if (trace_ent.classname == "func_door") + door_force(trace_ent); + else if (trace_ent.classname == "func_door_secret") + secret_door_force(trace_ent); + else if (trace_ent.classname == "func_button") + button_force(trace_ent); + } +} + +void() dev_reveal = +{ +// bprint("dev\n"); + local vector org; + makevectors(self.v_angle); + org = self.origin + self.view_ofs; + traceline (org, org + v_forward * 8192, FALSE, self); + + if (trace_fraction < 1.0 && trace_ent) + { + // trace_ent.developer = 1; + //bprint("hit entity:\n"); + bprint3("time: ", ftos(time), "\n"); + eprint(trace_ent); + //bprint("hit ent's enemy:\n"); + //eprint(trace_ent.enemy); + if (trace_ent.flags & FL_ONGROUND) bprint(" entity is ONGROUND\n"); + if (trace_ent.flags & FL_PARTIALGROUND) bprint(" entity is PARTIAL_GROUND\n"); + if (checkbottom(trace_ent)) bprint(" checkbottom is true\n"); + else bprint(" checkbottom is FALSE\n"); + } +} + +void() dev_trigger = +{ + if(deathmatch || coop) + return; + local entity t, act; + +// bprint("dev\n"); + act = activator; + t = world; + do { + t = SUB_UseNextTarget( t, self.netname ); + activator = act; + if (!t) break; + } while ( 1 ); +} + +void() dev_enemychain = +{ + local vector org; + makevectors(self.v_angle); + org = self.origin + self.view_ofs; + traceline (org, org + v_forward * 8192, FALSE, self); + + entity e; + float i; + i = 0; + if (trace_fraction < 1.0 && trace_ent) + { + e = trace_ent; + do + { + bprint5(ftos(i),": ",e.classname," at ~ ",vtos((e.absmin + e.absmax)* 0.5)); + bprint("\n"); + e = e.enemy; + i += 1; + } + while (e != trace_ent); + } +} + + +// for when i light a map at 1am and then play it again the next afternoon +void() dev_i_cant_see = +{ + if (icantsee) + lightstyle(0, "m"); + else + lightstyle(0, "z"); + icantsee = !icantsee; + cleanUpClientShit = 2; +} + + +void() dev_whatami = +{ + eprint(self); +} + diff --git a/QC_other/QC_copper/doors.qc b/QC_other/QC_copper/doors.qc new file mode 100644 index 00000000..9478577d --- /dev/null +++ b/QC_other/QC_copper/doors.qc @@ -0,0 +1,1019 @@ +/* +============================================================================= +Doors are similar to buttons, but can spawn a fat trigger field around them +to open without a touch, and they link together to form simultaneous +double/quad doors. + +Door.owner is the master door. If there is only one door, it points to itself. +If multiple doors, all will point to a single one. + +Door.enemy chains from the master door through all doors linked in the chain. +============================================================================= +*/ + +float DOOR_START_OPEN = 1; +float DOOR_SPECIAL = 2; +float DOOR_DONT_LINK = 4; +float DOOR_GOLD_KEY = 8; +float DOOR_SILVER_KEY = 16; +float DOOR_TOGGLE = 32; +float DOOR_FLIP_SKIN = 64; + +/* +============================================================================= + +THINK FUNCTIONS + +============================================================================= +*/ + +void() door_blocked = +{ + T_Damage (other, self, self, self.dmg); + + // if a door has a negative wait, it would never come back if blocked, + // so let it just squash the object to death real fast + if (self.wait >= 0) + { + if (self.state == STATE_DOWN) + door_go_up (); + else + door_go_down (); + } +} + + +void() door_hit_top = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; + if (self.spawnflags & DOOR_TOGGLE) + return; // don't come down automatically + self.think = door_go_down; + self.nextthink = self.ltime + self.wait; +} + +void() door_hit_bottom = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; +} + +void() door_go_down = +{ + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + if (self.max_health) + { + self.takedamage = DAMAGE_YES; + self.health = self.max_health; + } + + self.state = STATE_DOWN; + self.frame = !self.frame; + SUB_CalcMove (self.pos1, self.speed2, door_hit_bottom); +} + +void() door_go_up = +{ + if (self.state == STATE_UP) + return; // already going up + + if (self.state == STATE_TOP) + { // reset top wait time + self.nextthink = self.ltime + self.wait; + return; + } + + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos2, self.speed, door_hit_top); + self.frame = !self.frame; + + SUB_UseTargets(); +} + +/* +============================================================================= + +ACTIVATION FUNCTIONS + +============================================================================= +*/ + +void() door_fire = +{ + local entity oself; + local entity starte; + + if (self.owner != self) + objerror ("door_fire: self.owner != self"); + + //dprint("door firing\n"); + + // play use key sound + if (self.items) + sound (self, CHAN_BODY, self.noise4, 1, ATTN_NORM); // was chan_voice, door move sound was cutting it off + + if (!( self.spawnflags & DOOR_TOGGLE ) ) + { + self.message = string_null; // no more message + } + else + { + oself = self; + if (self.state == STATE_TOP || self.state == STATE_UP ) + { + starte = self; + do + { + door_go_down (); + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; + return; + } + } + +// trigger all paired doors + starte = self; + if ( !( self.spawnflags & DOOR_TOGGLE ) || ( self.spawnflags & DOOR_TOGGLE && self.state == STATE_BOTTOM) ) + do { + door_go_up (); + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; +} + + +void() door_use = +{ + //local entity oself; + //local entity starte; + + // trigger all paired doors + /* + oself = self; + starte = self; + if (self.spawnflags & DOOR_FLIP_SKIN) do { + self.frame = !self.frame; + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; + */ + if (!( self.spawnflags & DOOR_TOGGLE ) ) + { + self.message = string_null; // door message are for touch only + self.owner.message = string_null; + self.enemy.message = string_null; + } + SUB_CallAsSelf(door_fire,self.owner); +} + +void() door_trigger_touch = +{ + if (other.health <= 0) return; + if (other.movetype == MOVETYPE_NOCLIP) return; + if (time < self.attack_finished) return; + + // silly fix for sleeping monsters standing behind doors inside their touch fields causing them to open + if (other.flags & FL_MONSTER && other.enemy == world && other.goalentity == world) return; + + self.attack_finished = time + 1; + activator = other; + self = self.owner; + door_use (); +} + +void() door_killed = +{ + local entity oself; + + oself = self; + self = self.owner; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + door_use (); + self = oself; +} + +void(entity d) door_force = +{ + SUB_CallAsSelf(door_fire,d.owner); +} + +/* +================ +door_touch + +Prints messages and opens key doors +================ +*/ +void() door_touch = +{ + if (!CheckValidTouch()) return; + + if (self.owner.attack_finished > time) + return; + + self.owner.attack_finished = time + 2; + + if (self.owner.message != string_null && self.owner.state == STATE_BOTTOM && !(self.owner.items)) + { + centerprint (other, self.owner.message); + sound (other, CHAN_VOICE, "doors/locked4.wav", 1, ATTN_NORM); + } + + // from here on is key door stuff + if (!self.items) + return; + // key doors don't spawn trigger fields, so door_touch does a lot of what door_trigger_touch does + + if ( (self.items & other.items) != self.items || self.customflags & CFL_LOCKED ) + { + centerprint (other, self.owner.message); + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + return; + } + + if (self.items & IT_KEY1) + { + key_take_silver(other); + } + else if (self.items & IT_KEY2) + { + key_take_gold(other); + } + else + { + other.items = other.items - self.items; + } + + self.touch = SUB_Null; + if (self.enemy) + self.enemy.touch = SUB_Null; // get paired door + + activator = other; + + door_use (); +} + + +void(entity d) door_lock = +{ + entity e; + d.customflags = d.customflags | CFL_LOCKED; + +// d.owner.touch = SUB_Null; +// d.owner.use = SUB_Null; + if (d.owner.trigger_field == world && !d.owner.items) objerror("door being locked doesn't have a trigger"); + else if (d.owner.trigger_field) + d.owner.trigger_field.touch = SUB_Null; + + // close any open doors immediately + if (d.state != STATE_BOTTOM) + { + e = d; + do { + SUB_CallAsSelf(door_go_down,d); + e = e.enemy; + } + while ( e != d && e != world ); + } +} + +void(entity d) door_unlock = +{ + d.customflags = not(d.customflags, CFL_LOCKED); + +// d.owner.touch = door_touch; +// d.owner.use = door_use; + if (d.owner.trigger_field == world && !d.owner.items) objerror("door being unlocked doesn't have a trigger"); + else if (d.owner.trigger_field) + d.owner.trigger_field.touch = door_trigger_touch; +} + +float(entity d) door_getslocked = +{ + if (d.targetname == string_null) + return FALSE; + + entity t; + t = find(world, target, d.targetname); + while (t) { + if (t.classname == "target_lock") return TRUE; + t = find(t, target, d.targetname); + } + t = find(world, target2, d.targetname); + while (t) { + if (t.classname == "target_lock") return TRUE; + t = find(t, target2, d.targetname); + } + t = find(world, target3, d.targetname); + while (t) { + if (t.classname == "target_lock") return TRUE; + t = find(t, target3, d.targetname); + } + t = find(world, target4, d.targetname); + while (t) { + if (t.classname == "target_lock") return TRUE; + t = find(t, target4, d.targetname); + } + return FALSE; +} + +/* +============================================================================= + +SPAWNING FUNCTIONS + +============================================================================= +*/ + +entity(vector fmins, vector fmaxs) door_spawn_field = +{ + local entity trigger; + local vector t1, t2; + + trigger = spawn(); + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + trigger.owner = self; + trigger.touch = door_trigger_touch; + + t1 = fmins; + t2 = fmaxs; + setsize (trigger, t1 - '60 60 8', t2 + '60 60 8'); + return (trigger); +} + +void(vector cmins, vector cmaxs) door_finalize = +{ + entity t; + // switch positions after linking so START_OPEN doors link properly + t = self; + do { + // DOOR_START_OPEN is to allow an entity to be lighted in the closed position + // but spawn in the open position + if (t.spawnflags & DOOR_START_OPEN) + { + setorigin (t, t.pos2); + t.pos2 = t.pos1; + t.pos1 = t.origin; + } + t = t.enemy; + } while (t != self); + + // shootable, fired, or key doors just needed the owner/enemy links, + // they don't spawn a field + if (self.items) + { + t = self; + do { + //self.items = t.items; + door_key_init(); + self = self.enemy; + } while (t != self); + return; + } + if (self.health) + return; + if (self.targetname != string_null) + if (!door_getslocked(self)) + return; + + self.trigger_field = door_spawn_field(cmins, cmaxs); +} + +/* +============= +door_link +============= +*/ +void() door_link = +{ + local entity t, masterdoor; + local vector cmins, cmaxs; + + if (self.enemy) + return; // already linked by another door + if (self.spawnflags & DOOR_DONT_LINK) + { + self.owner = self.enemy = self; + door_finalize(self.mins, self.maxs); + return; // don't want to link this door + } + + cmins = self.mins; + cmaxs = self.maxs; + + masterdoor = self; + t = self; + + do + { + self.owner = masterdoor; + + if (self != masterdoor) + { + if (self.health) + masterdoor.health = self.health; + if (self.targetname != string_null) + { + masterdoor.targetname = self.targetname; + self.targetname = string_null; + // all the doors in the chain having the same targetname will cause + // the whole chain to be triggered once for every door in the chain + } + SUB_MergeTargets(masterdoor); // same deal + self.target = string_null; + self.target2 = string_null; + self.target3 = string_null; + self.target4 = string_null; + self.killtarget = string_null; + if (self.message != string_null) + masterdoor.message = self.message; + if (self.items) + { + masterdoor.items |= self.items; + } + } + + t = find (t, classname, self.classname); + if (!t) + { + self.enemy = masterdoor; // make the chain a loop + self = self.owner; + + door_finalize(cmins, cmaxs); + + return; + } + + if (EntitiesTouching(self,t) && !(t.spawnflags & DOOR_DONT_LINK)) + { + if (t.enemy) + objerror ("cross connected doors"); + + self.enemy = t; + self = t; + + cmins_x = min(t.mins_x, cmins_x); + cmins_y = min(t.mins_y, cmins_y); + cmins_z = min(t.mins_z, cmins_z); + cmaxs_x = max(t.maxs_x, cmaxs_x); + cmaxs_y = max(t.maxs_y, cmaxs_y); + cmaxs_z = max(t.maxs_z, cmaxs_z); + } + } while (1); +} + +void() LinkDoors = {door_link();} + +void() door_key_init = +{ + if (self.message == string_null) + { + if (self.items & IT_KEY1) + { + if (world.worldtype == 2) + self.message = "You need the silver keycard"; + else if (world.worldtype == 1) + self.message = "You need the silver runekey"; + else if (world.worldtype == 0) + self.message = "You need the silver key"; + } + else if (self.items & IT_KEY2) + { + if (world.worldtype == 2) + self.message = "You need the gold keycard"; + else if (world.worldtype == 1) + self.message = "You need the gold runekey"; + else if (world.worldtype == 0) + self.message = "You need the gold key"; + } + } + if (self.items) + self.wait = -1; +} + +/*QUAKED func_door (0 .5 .8) ? START_OPEN ? DONT_LINK GOLD_KEY SILVER_KEY TOGGLE CHANGE_SKIN +Door. Opens; closes. If two doors touch, they are assumed to be connected and operate as a unit. Targetnames, spawnflags, and items are safely shared between linked doors automatically. + +SPAWNFLAGS +"start_open" causes the door to move to its destination when spawned, and operate in reverse. It is used to temporarily or permanently close off an area when triggered (not usefull for touch or takedamage doors). +"dont_link" don't link to any touching doors +"toggle" causes the door to wait in both the start and end states for a trigger event. +"change_skin" causes the door to change textures when activated + +Key doors are always wait -1. + +"message" is printed when the door is touched if it is a trigger door and it hasn't been fired yet. if locked, will print this instead of default silver/gold message. +"angle" determines the opening direction +"targetname" if set, no touch field will be spawned and a remote button or trigger activates the door, unless the door is only targeted by a target_lock. +"health" if set, door must be shot open +"speed" movement speed (100 default) +"speed2" make close speed different from open speed +"wait" wait before returning (3 default, -1 = never return) +"lip" lip remaining at end of move (8 default) +"distance" specify movement distance directly, overrides lip +"dmg" damage to inflict when blocked (2 default) +"sounds" +0) no sound, or override with noise1/noise2 +1) stone +2) base +3) stone chain +4) hissy metal +5) winchy secret door +6) base secret door +*/ +/*FGD +@SolidClass base(Angle, Appearflags, Targetname, Target) = func_door : +"Basic door. Opens; closes. +If two doors touch, they are assumed to be connected and operate as a unit. Targetnames, spawnflags, and items are safely shared between linked doors automatically." +[ + speed(integer) : "Speed" : 100 + speed2(integer) : "Close Speed (if different from open speed)" : 0 + sounds(choices) : "Sound" : 0 = + [ + 0: "Silent" + 1: "Stone" + 2: "Machine" + 3: "Stone Chain" + 4: "Screechy Metal" + 5: "Winchy secret door" + 6: "Base secret door" + ] + noise1(string) : "Override move sound (requires sounds 0)" + noise2(string) : "Override stop sound (requires sounds 0)" + wait(string) : "Wait before close" : "3" + lip(integer) : "Lip remaining at end of move" : 8 + distance(string) : "Distance to travel (overrides Lip)" : "0.0" + dmg(integer) : "Damage inflicted when blocked" : 2 + message(string) : "Message if touched. Overrides key messages if locked." + health(integer) : "Health (shootable)" : 0 + spawnflags(flags) = + [ + 1 : "Starts Open" : 0 + 4 : "Don't link with touching doors" : 0 + 8 : "Gold Key required" : 0 + 16: "Silver Key required" : 0 + 32: "Toggle" : 0 + 64: "Change +0/+a skin" : 0 + ] +] +*/ +void() func_door = +{ + if (!SUB_ShouldSpawn()) return; + + if (world.worldtype == 1) + { + precache_sound ("doors/runetry.wav"); + precache_sound ("doors/runeuse.wav"); + self.noise3 = "doors/runetry.wav"; + self.noise4 = "doors/runeuse.wav"; + } + else if (world.worldtype == 2) + { + precache_sound ("doors/basetry.wav"); + precache_sound ("doors/baseuse.wav"); + self.noise3 = "doors/basetry.wav"; + self.noise4 = "doors/baseuse.wav"; + } + else + { + precache_sound ("doors/medtry.wav"); + precache_sound ("doors/meduse.wav"); + self.noise3 = "doors/medtry.wav"; + self.noise4 = "doors/meduse.wav"; + } + + if (self.sounds == 0) + { + if (!self.noise1) + self.noise1 = ("misc/null.wav"); + if (!self.noise2) + self.noise2 = ("misc/null.wav"); + precache_sound(self.noise1); + precache_sound(self.noise2); + } + if (self.sounds == 1) + { + precache_sound ("doors/drclos4.wav"); + precache_sound ("doors/doormv1.wav"); + self.noise1 = "doors/drclos4.wav"; + self.noise2 = "doors/doormv1.wav"; + } + if (self.sounds == 2) + { + precache_sound ("doors/hydro1.wav"); + precache_sound ("doors/hydro2.wav"); + self.noise2 = "doors/hydro1.wav"; + self.noise1 = "doors/hydro2.wav"; + } + if (self.sounds == 3) + { + precache_sound ("doors/stndr1.wav"); + precache_sound ("doors/stndr2.wav"); + self.noise2 = "doors/stndr1.wav"; + self.noise1 = "doors/stndr2.wav"; + } + if (self.sounds == 4) + { + precache_sound ("doors/ddoor1.wav"); + precache_sound ("doors/ddoor2.wav"); + self.noise1 = "doors/ddoor2.wav"; + self.noise2 = "doors/ddoor1.wav"; + } + if (self.sounds == 5) + { + precache_sound ("doors/winch2.wav"); + precache_sound ("doors/drclos4.wav"); + self.noise2 = "doors/winch2.wav"; + self.noise1 = "doors/drclos4.wav"; + } + if (self.sounds == 6) + { + precache_sound ("doors/basesec1.wav"); + precache_sound ("doors/basesec2.wav"); + self.noise2 = "doors/basesec1.wav"; + self.noise1 = "doors/basesec2.wav"; + } + precache_sound3 ("doors/locked4.wav"); + + SetMovedir (); + + self.max_health = self.health; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + setmodel (self, self.model); + //self.classname = "door"; + + self.blocked = door_blocked; + self.use = door_use; + + if (!self.speed) + self.speed = 100; + if (!self.speed2) + self.speed2 = self.speed; + if (!self.wait) + self.wait = 3; + self.dmg = zeroconvertdefault(self.dmg, 2); + if (!self.lip) + self.lip = 8; + if (!self.distance) + self.distance = BoundsAngleSize( self.movedir, self.size ) - self.lip; + // ^^ super-pejankery for non-cardinal angles + + if (self.spawnflags & DOOR_SILVER_KEY) self.items = IT_KEY1; + else if (self.spawnflags & DOOR_GOLD_KEY) self.items = IT_KEY2; + //door_key_init(); + + if (self.pos1 && self.pos2) + { + setorigin(self, self.pos1); + } + else + { + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir * self.distance; + } + + self.state = STATE_BOTTOM; + + if (self.health) + { + self.takedamage = DAMAGE_YES; + self.th_die = door_killed; + } + + self.touch = door_touch; + + // door_link can't be done until all of the doors have been spawned, so + // the sizes can be detected properly. + self.think = door_link; + self.nextthink = self.ltime + 0.1; +} + +/* +============================================================================= + +SECRET DOORS + +============================================================================= +*/ + +void() secretdoor_move1; +void() secretdoor_move2; +void() secretdoor_move3; +void() secretdoor_move4; +void() secretdoor_move5; +void() secretdoor_move6; +void() secretdoor_done; + +float SECRET_OPEN_ONCE = 1; // stays open +float SECRET_1ST_LEFT = 2; // 1st move is left of angle +float SECRET_1ST_DOWN = 4; // 1st move is down from angle +float SECRET_NO_SHOOT = 8; // only opened by trigger +float SECRET_YES_SHOOT = 16; // shootable even if targeted + +void () secretdoor_use = +{ + self.health = self.max_health; + + // enter correct phase of opening if retriggered while moving + if (self.origin != self.oldorigin) + { + secret_door_force(self); + return; + } + + self.message = string_null; // no more message + + SUB_UseTargets(); // fire all targets / killtargets + + if (!(self.spawnflags & SECRET_NO_SHOOT)) + { + // self.th_pain = SUB_Null; + self.takedamage = DAMAGE_NO; + } + self.velocity = '0 0 0'; + + secretdoor_move0(); +} + +// hodor correctly depending on what state the door is in +void(entity door) secret_door_force = +{ + entity oself; + oself = self; + self = door; + if (self.think == secretdoor_move4) // waiting in open pos, extend timer + { + self.nextthink = self.ltime + self.wait; + } + else if (self.think1 == secretdoor_move5) // 2nd reverse move in progress or done + { + secretdoor_move2(); // restart 2nd open move + } + else if (self.think == secretdoor_move6 || self.origin == self.oldorigin) // 1st reverse move in progress or done + { + secretdoor_move0(); // restart 1st open move + } + self = oself; +} + +void(entity attacker, float damage) secretdoor_pain = +{ + if (attacker.classname != "player") return; // no monsters opening secrets for you + + secretdoor_use(); +} + +// Make a sound, wait a little... +void () secretdoor_move0 = +{ + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.nextthink = self.ltime + 0.1; + + SUB_CalcMove(self.dest1, self.speed, secretdoor_move1); + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); +} + +// Wait after first movement... +void () secretdoor_move1 = +{ + self.nextthink = self.ltime + 1.0; + self.think = secretdoor_move2; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +} + +// Start moving sideways w/sound... +void () secretdoor_move2 = +{ + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest2, self.speed, secretdoor_move3); +} + +// Wait here until time to go back... +void () secretdoor_move3 = +{ + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + if (!(self.spawnflags & SECRET_OPEN_ONCE) || self.wait > 0) + { + self.nextthink = self.ltime + self.wait; + self.think = secretdoor_move4; + return; + } + self.think = SUB_Null; +} + +// Move backward... +void () secretdoor_move4 = +{ + self.think = SUB_Null; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest1, self.speed, secretdoor_move5); +} + +// Wait 1 second... +void () secretdoor_move5 = +{ + self.nextthink = self.ltime + 1.0; + self.think = secretdoor_move6; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +} + +// last move ... +void () secretdoor_move6 = +{ + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.oldorigin, self.speed, secretdoor_done); +} + +void () secretdoor_done = +{ + self.think1 = SUB_Null; + if (!self.targetname || self.spawnflags & SECRET_YES_SHOOT) + { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.th_pain = secretdoor_pain; + } + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +} + +void () secret_blocked = +{ + if (time < self.attack_finished) + return; + self.attack_finished = time + 0.5; + T_Damage (other, self, self, self.dmg); +} + +/* +================ +secret_touch + +Prints messages +================ +*/ +void() secret_touch = +{ + if (!CheckValidTouch()) return; + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 2; + + if (self.message != string_null) + { + centerprint (other, self.message); + sound (other, CHAN_BODY, "doors/locked4.wav", 1, ATTN_NORM); + } +} + + +/*QUAKED func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot +Basic secret door. Slides back, then to the side. Angle determines direction of second move. First move is v_right unless inhibited. + +Flags: +"open_once" stays open +"1st_left" First move is opposite of v_right, then toward "angle" +"1st_down" First move is down, then toward "angle" +"no_shoot" only opened by trigger +"always_shoot" even if targeted, keep shootable + +Keys: +"dmg" damage to inflict when blocked (default: 2). If a secret door has a targetname, it will only be opened by it's button or trigger, not by damage. +"sounds" + 1 = medieval + 2 = metal + 3 = base +"t_width" override distance for first move +"t_length" override distance for second move +"dest1"+"dest2" if both set, uses dest1 and dest2 for first and second move vectors, ignoring 1st_whatever spawnflags. still needs width and length. +"wait" # of seconds before coming back, default 5 +*/ +/*FGD +@SolidClass base(Appearflags, Targetname, Target) = func_door_secret : +"Secret door. Slides back, then to the side. +Angle determines direction of second move. First move is to the right of 'angle'." +[ + angle(integer) : "Direction of second move" + t_width(integer) : "First move length" + t_length(integer) : "Second move length" + dmg(integer) : "Damage when blocked" : 2 + wait(string) : "Wait before close" : "2" + dest1(string) : "Force vector for first move (requires dest2)" + dest2(string) : "Force vector for second move (requires dest1)" + sounds(choices) : "Sounds" : 3 = + [ + 1: "Medieval" + 2: "Metal" + 3: "Base" + ] + message(string) : "Message" + spawnflags(flags) = + [ + 1 : "Open once" : 0 + 2 : "Move left first" : 0 + 4 : "Move down first" : 0 + 8 : "Not shootable" : 0 + 16 : "Always shootable" : 0 + ] +] +*/ +void () func_door_secret = +{ + if (!SUB_ShouldSpawn()) return; + self.sounds = zeroconvertdefault(self.sounds, 3); + + if (self.sounds == 1) + { + precache_sound ("doors/latch2.wav"); + precache_sound ("doors/winch2.wav"); + precache_sound ("doors/drclos4.wav"); + self.noise1 = "doors/latch2.wav"; + self.noise2 = "doors/winch2.wav"; + self.noise3 = "doors/drclos4.wav"; + } + if (self.sounds == 2) + { + precache_sound ("doors/airdoor1.wav"); + precache_sound ("doors/airdoor2.wav"); + self.noise1 = "doors/airdoor2.wav"; + self.noise2 = "doors/airdoor1.wav"; + self.noise3 = "doors/airdoor2.wav"; + } + if (self.sounds == 3) + { + precache_sound ("doors/basesec1.wav"); + precache_sound ("doors/basesec2.wav"); + self.noise1 = "doors/basesec2.wav"; + self.noise2 = "doors/basesec1.wav"; + self.noise3 = "doors/basesec2.wav"; + } + + self.dmg = zeroconvertdefault(self.dmg, 2); + + self.mangle = self.angles; + self.angles = '0 0 0'; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + //self.classname = "door"; + setmodel (self, self.model); + setorigin (self, self.origin); + + self.touch = secret_touch; + self.blocked = secret_blocked; + self.speed = 50; + self.use = secretdoor_use; + if ( !self.targetname || self.spawnflags & SECRET_YES_SHOOT) + { + if (!self.health) + self.health = 10; + self.max_health = self.health; + self.takedamage = DAMAGE_YES; + self.th_pain = secretdoor_pain; + self.th_die = secretdoor_use; + } + self.oldorigin = self.origin; + + if (self.spawnflags & SECRET_OPEN_ONCE) self.wait = -1; + if (!self.wait) self.wait = 5; // 5 seconds before closing + + // Magic formula... + // lunaran: the magic formula sucked + // also you moved this to secret_door_use at some point, don't know why, if a secret door breaks somewhere that might be why + local vector firstmove, secondmove; + + if (!self.dest1 && !self.dest2) + { + // dumb old way + makevectors(self.mangle); + if (self.spawnflags & SECRET_1ST_LEFT) + firstmove = v_right * -1; + else if (self.spawnflags & SECRET_1ST_DOWN) + firstmove = v_up * -1; + else + firstmove = v_right; + secondmove = v_forward; + } + else + { + firstmove = normalize(self.dest1); + secondmove = normalize(self.dest2); + } + + if (!self.t_width) + self.t_width = BoundsAngleSize(firstmove, self.size); + + if (!self.t_length) + self.t_length = BoundsAngleSize(secondmove, self.size); + + self.dest1 = self.origin + firstmove * self.t_width; + self.dest2 = self.dest1 + secondmove * self.t_length; +} diff --git a/QC_other/QC_copper/explobox.qc b/QC_other/QC_copper/explobox.qc new file mode 100644 index 00000000..5c8f72a5 --- /dev/null +++ b/QC_other/QC_copper/explobox.qc @@ -0,0 +1,231 @@ +/* +============================================================================== + +EXPLOBOXES + +============================================================================== +*/ + +void() explobox_respawn = +{ + entity who = find_touching(); + if (who) // solid, can't respawn if blocked + { + self.think = explobox_respawn; + self.nextthink = self.ltime + 0.2; + return; + } + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + self.use = barrel_explode_go; + self.takedamage = DAMAGE_AIM; + self.health = self.max_health; + self.alpha = 1; + setorigin(self, self.origin); + ItemPiff(self); +} + +void() explobox_flicker = +{ + if (self.ltime >= self.attack_finished) + { + explobox_respawn(); + return; + } + + // flicker back into place + self.alpha = (3.5 - (self.attack_finished - self.ltime)) / 8 + (1 - mod(self.attack_finished - self.ltime, 0.5)) * 0.2; + self.nextthink = self.ltime + 0.1; +} + +void() explobox_prespawn = +{ + self.model = self.wad; // restore original model + setorigin(self, self.origin); + self.enemy = world; + + self.think = explobox_flicker; + explobox_flicker(); +} + +void() barrel_explode_go = +{ + self.takedamage = DAMAGE_NO; + self.classname = "explo_box"; + sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); + + self.use = SUB_Null; + self.health = 0; // ensure triggered exploboxes don't hurt themselves and loop again + kaboom(BoundsCenter(self), self.dmg, self, 0); + + if (!self.wait) + { + if (self.enemy) + activator = self.enemy; + SUB_UseTargets(); + SUB_Remove(); + } + + self.wad = self.model; + self.model = string_null; + self.solid = SOLID_NOT; + self.takedamage = DAMAGE_NO; + + self.think = explobox_prespawn; + self.attack_finished = self.ltime + self.wait; + self.nextthink = self.attack_finished - 3.5; + if (self.count > 0) // only respawn 'count' more times + { + self.count = self.count - 1; + if (self.count == 0) + { + if (self.enemy) + activator = self.enemy; + SUB_UseTargets(); + SUB_Remove(); + } + } +} + +void() barrel_explode = +{ + if (self.think == barrel_explode_go) + return; // already exploding + self.enemy = activator; + self.think = barrel_explode_go; + self.nextthink = self.ltime + 0.1; // infini-barrel crash fixed +} + + +//============================================================================ + + +void() explobox_setup = +{ + precache_sound ("weapons/r_exp3.wav"); + self.th_die = barrel_explode; + self.use = barrel_explode_go; + self.takedamage = DAMAGE_AIM; + self.type = "explobox"; + if (!self.health) + self.health = 18; + self.max_health = self.health; + + /* + vector oldorg; + + oldorg = self.origin; + self.origin_z = self.origin_z + 2; + droptofloor(0,0); + if (oldorg_z - self.origin_z > 250) + { + dprint3("explobox fell out of level at ",vtos(oldorg),"\n"); + remove(self); + } + */ + + vector bottom = self.origin + (self.mins + self.maxs) / 2; + bottom_z = self.origin_z; + traceline(bottom, bottom + '0 0 -512', TRUE, self); + if (trace_allsolid || trace_fraction == 1.0 || trace_fraction == 0.0) + return; + bottom = self.origin; + bottom_z = trace_endpos_z; + setorigin(self, bottom); +} + +/*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64) +Large exploding box. 150 damage. +will do enough damage to set off other barrels at up to ~172u distance (center to center) + +"target" fires targets when it explodes +"targetname" will explode when triggered +"wait" will respawn after 'wait' seconds +"count" will only respawn 'count' times +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) size(0 0 0, 32 32 64) model({ "path": ":maps/b_explob.bsp" }) = misc_explobox : +"Large exploding container, 150 damage. +Explodes when triggered or shot. Fires targets when it explodes. +will do enough damage to set off other barrels at up to ~172u distance (center to center)." +[ + wait(integer) : "Respawn delay" + count(integer) : "Respawn limit" +] +*/ +void() misc_explobox = +{ + if (!SUB_ShouldSpawn()) return; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + precache_model ("maps/b_explob.bsp"); + setmodel (self, "maps/b_explob.bsp"); + if (!self.dmg) + self.dmg = 150; + + explobox_setup(); +} + + +/*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 32) +Smaller exploding box. 100 damage. REGISTERED ONLY +will do enough damage to set off other barrels at up to ~128u distance (center to center) + +"target" fires targets when it explodes +"targetname" will explode when triggered +"wait" will respawn after 'wait' seconds +"count" will only respawn 'count' times +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) size(0 0 0, 32 32 32) model({ "path": ":maps/b_exbox2.bsp" }) = misc_explobox2 : "Small exploding container, 100 damage. +Explodes when triggered or shot. Fires targets when it explodes. +will do enough damage to set off other barrels at up to ~128u distance (center to center)." +[ + wait(integer) : "Respawn delay" + count(integer) : "Respawn limit" +] +*/ +void() misc_explobox2 = +{ + if (!SUB_ShouldSpawn()) return; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + precache_model2 ("maps/b_exbox2.bsp"); + setmodel (self, "maps/b_exbox2.bsp"); + if (!self.dmg) + self.dmg = 100; + + explobox_setup(); +} + +/*QUAKED func_explobox (0 .5 .8) ? +Build your own exploding box! + +Keyvalues: +"health" defaults to 18 +"dmg" damage to explode with, defaults to 150 +"target" fires targets when it explodes +"targetname" will explode when triggered +"wait" will respawn after 'wait' seconds +"count" will only respawn 'count' times +*/ +/*FGD +@SolidClass base(Appearflags, Target, Targetname) = misc_explobox2 : "Customizable exploding container. +Explodes when triggered or shot. Fires targets when it explodes." +[ + health(integer) : "Hit points" : 18 + dmg(integer) : "Explosion damage" : 150 + wait(integer) : "Respawn delay" + count(integer) : "Respawn limit" +] +*/ +void() func_explobox = +{ + if (!SUB_ShouldSpawn()) return; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + if (!self.dmg) + self.dmg = 150; + explobox_setup(); +} \ No newline at end of file diff --git a/QC_other/QC_copper/fly.qc b/QC_other/QC_copper/fly.qc new file mode 100644 index 00000000..2c4affde --- /dev/null +++ b/QC_other/QC_copper/fly.qc @@ -0,0 +1,197 @@ +/* +======================================= +FLYMOVE + +.distance = estimated total time to reach target +.delay = estimated time left to reach target +delay / distance = % of movement remaining + +.speed2 = previous movement speed +.speed = destination movement speed + +actual velocity is a lerp from .speed2 to .speed by (delay / distance) so that +the flying entity eases in and out of waypoints/idles + +======================================= +*/ + +// FIXME: if triggered when waiting at a path_corner in holding pattern mode, +// if current idle drift is away from the next path corner, flying object +// will make an unsightly long arc to get back on track +// sometimes this is desirable but sometimes not (big flytrains) +void() fly_go = +{ + //dprint("in fly_go\n"); + local vector vel, destvel; + local float frac, lspeed; + + destvel = self.dest - self.origin; + + lspeed = vlen(self.velocity); + + if (vlen(destvel) < (lspeed * 0.15)) + { + // we'll be past it next think so this is close enough + // avoids the sprite spazzing out very near the destination + SUB_UseEntTargets(self.goalentity); // fire this path_corner's target2/3/4s + fly_newgoal( 0, 0 ); + destvel = self.dest - self.origin; + } + + destvel = normalize(destvel); + + // figure out where we're flitting to + frac = self.delay / self.distance; + + vel = self.velocity; + vel = normalize(vel); + // proportionally mix vectors to gradually steer towards the destination + vel = vel * frac + destvel * (1 - frac); + // proportionally mix speeds to accel/decel towards destination speed + lspeed = self.speed2 * frac + self.speed * (1 - frac); + + if (self.delay > 0) + self.delay = self.delay - 0.1; + +// dprint( ftos(lspeed)); +// dprint( "\n"); + + self.velocity = vel * lspeed; +} + +void() fly_idle = +{ + //dprint("in fly_idle," ); + local vector vel, destvel; + local float frac, lspeed; + + destvel = self.dest - self.origin; + + if (vlen(destvel) < 4) { + // close enough + fly_newgoal( 0, 1 ); + destvel = self.dest - self.origin; + } + + destvel = normalize(destvel); + + // figure out where we're flitting to + frac = self.delay / self.distance; // frac = % *remaining* + + local string what; + what = ftos(frac); + //dprint("frac: "); + //dprint( what ); + //dprint("\n"); + + vel = self.velocity; + vel = normalize(vel); + vel = vel * frac + destvel * (1 - frac); + lspeed = self.speed2 * frac + self.speed * (1 - frac); + + if (self.delay > 0) + self.delay = self.delay - 0.1; + else self.delay = 0; + + self.velocity = vel * lspeed; +} + +void() fly_delayuse = +{ + local entity oldself; + oldself = self; + self = self.enemy; + self.use(); + self = oldself; + remove(self); +} + +void() fly_findnextgoal = +{ + entity oself; + oself = self; + self = self.goalentity; + oself.goalentity = findunlockedtarget(world); + self = oself; +} + +void( float nowait, float idlespeed ) fly_newgoal = +{ + //dprint("in fly_newgoal\n"); + + + if (self.goalentity.wait && !nowait) + { + //dprint("waiting at pathcorner\n"); + self.speed2 = vlen(self.velocity); // self.speed; + if ( self.classname == "train" ) + self.speed = 8; + else + self.speed = 32; + + local vector randy; + randy_x = crandom(); + randy_y = crandom(); + randy_z = crandom(); + if ( self.classname == "train" ) + randy = normalize(randy) * 4; + else + randy = normalize(randy) * 12; + + self.think1 = fly_idle; + self.dest = self.goalentity.origin + randy; + + if (self.goalentity.wait > 0) { + local entity t; + //dprint("waiting here for a few seconds\n"); + + // create a temp object to fire at a later time + t = spawn(); + t.classname = "DelayedUse"; + t.nextthink = time + self.goalentity.wait; + t.think = fly_delayuse; + t.enemy = self; + } + self.th_stand(); + } + else + { + // get new destination + if (!self.goalentity.target) + { + //dprint("no goalentity target\n"); + if (self.classname != "train") + { + self.th_die(); + return; + } + SUB_CalcMove(self.goalentity.origin, self.speed, self.th_die); // lerp straight to the finish point, then die + } + + //self.goalentity = find(world, targetname, self.goalentity.target); + fly_findnextgoal(); + + if (!self.goalentity) { + //dprint("no goalentity\n"); + self.th_die(); + return; + } + else + self.think1 = fly_go; + + // get new speed from where we are now + self.speed2 = vlen(self.velocity);//self.speed; + if (self.speed2 < 32) self.speed2 = 32; + if (idlespeed) + self.speed = 32; + else if (self.goalentity.wait != 0) + self.speed = 16; // should be 32 but this makes up for a hard jolt when arriving at a waited pathcorner + // the math here is really rough + else if (self.goalentity.speed) + self.speed = self.goalentity.speed; + + self.dest = self.goalentity.origin; + } + // ... really, really rough: + self.distance = self.delay = 4 * (vlen( self.origin - self.dest ) / (self.speed + self.speed2)); +} diff --git a/QC_other/QC_copper/fog.qc b/QC_other/QC_copper/fog.qc new file mode 100644 index 00000000..383e362d --- /dev/null +++ b/QC_other/QC_copper/fog.qc @@ -0,0 +1,337 @@ +/* +==================== + +FOG + +adapted from similar things czg did in honey_fog.qc god bless him + +==================== +*/ + +float FOG_INTERVAL = 0.04166667; //1/24; +/*FGD +@baseclass = Fog [ + fog_density(string) : "Fog Density" + fog_color(string) : "Fog Color" +] +@baseclass = FogShift [ + fog_density(string) : "Start Fog Density" + fog_color(string) : "Start Fog Color" + fog_density2(string) : "End Fog Density" + fog_color2(string) : "End Fog Color" +] +*/ + +/* +================ +fog_save +================ +*/ +void( entity client, float density, vector color ) fog_save = +{ + if (client.classname != "player") return; + + // save whatever we set the client's fog to in case of saves/loads + client.fog_density = density; + client.fog_color = color; +} + +/* +================ +fog_setFromEnt +================ +*/ +void( entity client, entity fogger ) fog_setFromEnt = +{ + dprint("setting fog values\n"); + // don't set the fog if the entity has no values, because it might be a custom map with + // _fog on the worldspawn instead + // to actually get an entity to clear the fog, set a color but leave density at 0 + if (!fogger.fog_color) + if (!fogger.fog_density) + return; + + fog_set(client, fogger.fog_density, fogger.fog_color); +} + +/* +================ +fog_set +================ +*/ +void( entity client, float density, vector color ) fog_set = +{ + if (client.classname != "player") return; + + //stuffcmd(client, "r_showtris 0\n"); return; + + stuffcmd(client, "\nfog "); + stuffcmd_float(client, density); + stuffcmd(client, " "); + stuffcmd_float(client, color_x * (icantsee + 1)); + stuffcmd(client, " "); + stuffcmd_float(client, color_y * (icantsee + 1)); + stuffcmd(client, " "); + stuffcmd_float(client, color_z * (icantsee + 1)); + stuffcmd(client, "\n"); + + fog_save(client, density, color); +} + +/* +================ +fog_blendTouch +================ +*/ +void() fog_blendTouch = +{ + if (!CheckValidTouch()) return; + + // fix for only first client getting a fog change when multiple coop clients are touching this at once + if (time != self.rad_time) // because fog is rad + if (time < self.attack_finished) + return; + + float f, ldensity, leaving; + vector dorg, mid, ovel; + vector lcolor; + + // if you run/fall through a fogblend fast enough you can come out the other side + // partially blended, so check if player will exit the trigger bounds before the + // next touch (same class of bug as leaping through lasers in Q2) + ovel = other.velocity * FOG_INTERVAL; + leaving = ( (other.absmax_x + ovel_x < self.absmin_x) || + (other.absmax_y + ovel_y < self.absmin_y) || + (other.absmax_z + ovel_z < self.absmin_z) || + (other.absmin_x + ovel_x > self.absmax_x) || + (other.absmin_y + ovel_y > self.absmax_y) || + (other.absmin_z + ovel_z > self.absmax_z) ); + + if (leaving) + { + // last chance to set fog correctly, so snap it to the final values + leaving = other.velocity * self.movedir; + if (leaving > 0) + { + ldensity = self.fog_density2; + lcolor = self.fog_color2; + } + else + { + ldensity = self.fog_density; + lcolor = self.fog_color; + } + } + else + { + // in transition, blend proportionally between the two fogs + mid = (self.mins + self.maxs) * 0.5; + dorg = other.origin + other.view_ofs - mid; + + f = dorg * self.movedir; + f = (f / self.distance) + 0.5; + + ldensity = lerp(self.fog_density, self.fog_density2, f); + lcolor = lerpVector(self.fog_color, self.fog_color2, f); + } + fog_set(other, ldensity, lcolor); + fog_save(other, ldensity, lcolor); + + self.rad_time = time; + self.attack_finished = time + FOG_INTERVAL; + +// bprint(ftos(f*1000)); +// bprint("\n"); +} + + +/*QUAKED trigger_fogblend (.5 .5 .2) ? +Acts as a smoothly blending portal between two zones of different fog. Sets the fog for any client passing through it, blending their global fog settings between "fog_color"/"fog_density" and "fog_color2"/"fog_density2" proportional to their position within the trigger. +The axis of motion on which the blend happens is defined by "angle", pointing to whatever zone has color2 and density2. Trigger therefore has two 'sides' - the side that "angle" points to, and the opposite side. + +"distance" - override the length of the blend period in world units - defaults to bounds size + on 'angle' otherwise. this is only useful for diagonal triggers. + +CAVEATS: +- will 'stuffcmd' 2 dozen times per frame so try not to make these huge +- a bug in most quake engine ports will reset the eye position smoothing that happens when climbing stairs or riding a plat on every frame that a 'stuffcmd' is sent, so fog transitions during upwards motion will cause noticeable stuttering. +*/ +/*FGD +@SolidClass base(Appearflags, Targetname, Target, FogShift) = trigger_fogblend : +"Trigger: Fog Blend +Acts as a smoothly blending portal between two zones of different fog. Sets the fog for any client passing through it, blending their global fog settings between start and end values proportional to their position within the trigger. + +- will 'stuffcmd' 2 dozen times per frame so try not to make these huge +- a bug in most quake engine ports will reset the eye position smoothing that happens when climbing stairs or riding a plat on every frame that a 'stuffcmd' is sent, so fog transitions during upwards motion will cause noticeable stuttering." +[ + distance(integer) : "Length of blend distance (defaults to size of trigger)" + angle(integer) : "Axis of motion of blend (points toward end values)" +] +*/ +void() trigger_fogblend = +{ + if (!SUB_ShouldSpawn()) return; + if (self.angles == '0 0 0') // InitTrigger assumes angle 0 means no angle + self.angles = '0 360 0'; + + InitTrigger (); + self.touch = fog_blendTouch; + self.distance = zeroconvertdefault(self.distance, BoundsAngleSize(self.movedir, self.size)); +} + + + +// ================================ + +void(float density, vector color) target_fogblend_save = +{ + if (self.spawnflags & 4) + { + entity pl; + pl = find(world, classname, "player"); + while (pl) + { + fog_save(pl, density, color); + pl = find(pl, classname, "player"); + } + } + else + fog_save(self.enemy, density, color); +} + +void(float density, vector color) target_fogblend_set = +{ + if (self.spawnflags & 4) + { + entity pl; + pl = find(world, classname, "player"); + while (pl) + { + fog_set(pl, density, color); + pl = find(pl, classname, "player"); + } + } + else + fog_set(self.enemy, density, color); +} + +/* +================ +target_fogblend_use +================ +*/ +void() target_fogblend_use = +{ + float d; + vector c; + self.enemy = activator; + if (self.enemy.classname != "player") return; + if (!(self.spawnflags & 1)) + self.state = 1 - self.state; + + self.nextthink = time + self.delay; + if (self.state) + { + self.pain_finished = time + self.delay + self.speed; + d = self.fog_density2; + c = self.fog_color2; + } + else + { + self.pain_finished = time + self.delay + self.speed2; + d = self.fog_density; + c = self.fog_color; + } + target_fogblend_save(d, c); + self.use = SUB_Null; // don't allow retriggering before the blend is done or it looks super duper wacky +} + +/* +================ +fog_blendTimeThink +================ +*/ +void() fog_blendTimeThink = +{ + float f, d; + vector c; + + if (time >= self.pain_finished) + { + f = 1; + self.use = target_fogblend_use; + } + else + { + self.nextthink = time + FOG_INTERVAL; + if (self.state && self.speed) + f = 1 - (self.pain_finished - time) / self.speed; + else if (self.speed2) + f = 1 - (self.pain_finished - time) / self.speed2; + else + f = 1; + } + + if (self.state) + { + d = lerpHermite(self.fog_density, self.fog_density2, f); + c = lerpVectorHermite(self.fog_color, self.fog_color2, f); + } + else + { + d = lerpHermite(self.fog_density2, self.fog_density, f); + c = lerpVectorHermite(self.fog_color2, self.fog_color, f); + } + target_fogblend_set(d, c); +} + +/*QUAKED target_fogblend (.5 .5 .2) (-8 -8 -8) (8 8 8) ONE_WAY REVERSE GLOBAL +Blends the fog for a client. activator's fog will be blended from "fog_color" and "fog_density" +to "fog_color2" and "fog_density2". Triggering again will blend it back, unless ONE_WAY is set. +Set REVERSE if you're tired of swapping the values by hand. +Set GLOBAL to affect all clients in multiplayer, not just the activator. + +"delay" - pause before beginning to blend +"speed" - time to spend blending, -1 for an instant change to fog2. +"speed2" - time to spend blending back, if different than "speed". -1 for instant. + +CAVEATS: +- will 'stuffcmd' 2 dozen times per frame so try not to make this take too long +- a bug in most quake engine ports will reset the eye position smoothing that happens when climbing stairs or riding a plat on every frame that a 'stuffcmd' is sent, so fog transitions during upwards motion will cause noticeable stuttering. +*/ +/*FGD +@PointClass base(Appearflags, Targetname, Target, FogShift) color(128 128 50) = target_fogblend : +"Target: Fog Blend +Activator's fog will be blended over time from start to end values. + +- will 'stuffcmd' 2 dozen times per frame so try not to make this take too long +- a bug in most quake engine ports will reset the eye position smoothing that happens when climbing stairs or riding a plat on every frame that a 'stuffcmd' is sent, so fog transitions during upwards motion will cause noticeable stuttering." +[ + spawnflags(flags) = [ + 1 : "One-Way Only" : 0 + 2 : "Reverse Start/End" : 0 + 4 : "All clients" : 0 + ] + delay(string) : "Pause before starting blend" + speed(string) : "Time to blend (-1 for instant)" + speed2(string) : "Time to blend back, if different (-1 for instant)" +] +*/ +void() target_fogblend = +{ + if (!SUB_ShouldSpawn()) return; + self.use = target_fogblend_use; + self.think = fog_blendTimeThink; + if (self.spawnflags & 2) + self.state = 1; + else + self.state = 0; + if (self.spawnflags & 1) + self.state = 1 - self.state; + + if (!self.speed) self.speed = 1; + if (!self.speed2) self.speed2 = self.speed; + + if (self.speed == -1) self.speed = 0; + if (self.speed2 == -1) self.speed2 = 0; +} \ No newline at end of file diff --git a/QC_other/QC_copper/fx.qc b/QC_other/QC_copper/fx.qc new file mode 100644 index 00000000..35cda2b2 --- /dev/null +++ b/QC_other/QC_copper/fx.qc @@ -0,0 +1,695 @@ +/* +================================================================ + +FX + +================================================================ +*/ + +void(vector org) gunshot = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); +} + +void(vector a, vector b, entity who) fx_beam = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity (MSG_BROADCAST, who); + WriteCoord (MSG_BROADCAST, a_x); + WriteCoord (MSG_BROADCAST, a_y); + WriteCoord (MSG_BROADCAST, a_z); + WriteCoord (MSG_BROADCAST, b_x); + WriteCoord (MSG_BROADCAST, b_y); + WriteCoord (MSG_BROADCAST, b_z); +} + + +void() s_explode1 = [0, s_explode2] {} +void() s_explode2 = [1, s_explode3] {} +void() s_explode3 = [2, s_explode4] {} +void() s_explode4 = [3, s_explode5] {} +void() s_explode5 = [4, s_explode6] {} +void() s_explode6 = [5, SUB_Remove] {} + +void() BecomeBlast = +{ + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel (self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + self.nextthink = time + 0.5; + self.think = SUB_Remove; + s_explode1 (); +} + +void() BecomeExplosion = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + BecomeBlast(); +} + +void() fx_explode = +{ + kaboom(self.origin, 0, self, 0); +} + +/* +======== +kaboom + +for making explosions when and where you please +======== +*/ +entity(vector org, float damg, entity parent, float multi) kaboom = +{ + local entity boom; + + boom = spawn(); + setorigin(boom, org); + boom.nextthink = time; + boom.think = BecomeExplosion; + + if (damg > 0) T_RadiusMultiDamage (boom, parent, damg, boom, multi); + + return boom; +} + +void() shockwave1 =[ 0, shockwave2 ] {self.skin = 0; self.nextthink = time + 0.05;} +void() shockwave2 =[ 1, shockwave3 ] {self.skin = 1; self.nextthink = time + 0.05;} +void() shockwave3 =[ 2, shockwave4 ] {self.skin = 2; self.nextthink = time + 0.05;} +void() shockwave4 =[ 3, shockwave5 ] {self.skin = 3; self.nextthink = time + 0.05;} +void() shockwave5 =[ 4, SUB_Remove ] {self.alpha = 0.6; self.nextthink = time + 0.05;} + +void() shockwave6 =[ 5, shockwave7 ] {self.skin = 0; self.nextthink = time + 0.05;} +void() shockwave7 =[ 6, shockwave8 ] {self.skin = 0; self.nextthink = time + 0.05;} +void() shockwave8 =[ 7, shockwave9 ] {self.skin = 1; self.nextthink = time + 0.05;} +void() shockwave9 =[ 8, shockwave10 ] {self.skin = 2; self.nextthink = time + 0.05;} +void() shockwave10 =[ 9, shockwave11 ] {self.skin = 3; self.nextthink = time + 0.05;} +void() shockwave11 =[ 10, SUB_Remove ] {self.alpha = 0.6; self.nextthink = time + 0.05;} + + +//============================================================================= + +//flagrant abuse of particle() + + +void(vector a, vector b, float color) fx_trail = +{ + local float i, maxd; + local vector dir; + maxd = floor(vlen(b-a)); + dir = normalize(b-a); + + for (i=0; i<maxd; i+=8) + particle(a + dir * i, dir, color, 2); +} + +void(vector c, float r, float color) fx_ring = +{ + local float segments, ang, i; + local vector a, b; + segments = ceil(sqrt(2 * r)); + + for (i=0; i<segments; i++) + { + ang = (360.0/segments) * i; + makevectors('0 1 0' * ang); + a = v_forward * r + c; + ang = (360.0/segments) * (i + 1); + makevectors('0 1 0' * ang); + b = v_forward * r + c; + fx_trail(a,b,color); + } +} + +//============================================================================ + +void(float num) particlefield_burst = +{ + vector org, org2, dir; + while (num > 0) + { + num -= 1; + org = Vector(crandom(), crandom(), crandom()); + org2 = vec_scale(org, self.mangle); + + dir = self.movedir; + if (self.spawnflags & 2) + { + // in + dir -= org * vlen(self.movedir); + } + else if (self.spawnflags & 4) + { + // out + dir += org * vlen(self.movedir); + } + + particle (org2 + self.origin, dir, self.health, self.speed2); + } +} + +void() particlefield_think = +{ + float num; + + num = floor(0.5 + self.speed / 10); + + particlefield_burst(num); + + if (self.state) + self.nextthink = time + 0.1; +} + +void() particlefield_use = +{ + if (self.spawnflags & 8) + { + particlefield_burst(self.speed); + return; + } + + self.state = !self.state; + if (self.state) + self.nextthink = time + 0.1; +} + + +/*QUAKED misc_particlefield_box (0 .6 1) (-8 -8 -8) (8 8 8) START_ON INWARD OUTWARD BURST +Makes dots appear continuously within its bounds. Trigger to toggle on or off. + +"mangle" dimensions of sparkly zone +"speed" number of clumps per second +"speed2" number of dots per clump +"health" color index (0-255). quake will use every color in the row (each row is 16 colors) +"movedir" give particles a velocity + +Flags: +INWARD particles are sucked toward origin. additive with movedir. +OUTWARD particles are blown out from origin. additive with movedir. +BURST spew one second's worth of particles in one shot when triggered rather than toggling on/off + +Color Reference: +0-15 grey (higher = lighter) +16-31 dirt brown (higher = lighter) +32-47 sky blue (higher = lighter) +48-63 grass green (higher = lighter) +64-79 red (higher = lighter) +80-95 green/orange (higher = lighter) +96-111 copper/gold (higher = lighter) +112-127 flesh tone (higher = lighter) +128-143 pale purple (higher = darker) +144-159 reddish purple (higher = darker) +160-175 pale beige (higher = darker) +176-191 turquoise (higher = darker) +192-207 yellow (higher = darker) +208-223 deep blue (higher = darker) +224-239 fire/lava (higher = lighter) +240-255 fullbright mess +*/ +/*FGD +@Pointclass base(Targetname, Appearflags, Bounds) color(0 160 255) size(16 16 16) = misc_particlefield_box : +"Makes dots appear continuously within its bounds. Trigger to toggle on/off. + +Color Reference: +0-15 grey (higher = lighter) +16-31 dirt brown (higher = lighter) +32-47 sky blue (higher = lighter) +48-63 grass green (higher = lighter) +64-79 red (higher = lighter) +80-95 green/orange (higher = lighter) +96-111 copper/gold (higher = lighter) +112-127 flesh tone (higher = lighter) +128-143 pale purple (higher = darker) +144-159 reddish purple (higher = darker) +160-175 pale beige (higher = darker) +176-191 turquoise (higher = darker) +192-207 yellow (higher = darker) +208-223 deep blue (higher = darker) +224-239 fire/lava (higher = lighter) +240-255 fullbright mess" +[ + spawnflags(flags) = [ + 1 : "Start on" : 0 + 2 : "Particles are sucked inward" : 0 + 4 : "Particles are blown outward" : 0 + 8 : "Oneshot burst when triggered" : 0 + ] + speed(integer) : "Clumps per second" : 10 + speed2(integer) : "Dots per clump" : 16 + health(integer) : "Color index (0-255)" : 0 + movedir(string) : "Velocity of particles (x y z)" +] +*/ +void() misc_particlefield_box = +{ + if (!SUB_ShouldSpawn()) return; + self.state = self.spawnflags & 1; + self.think = particlefield_think; + self.use = particlefield_use; + + if (!self.speed) + self.speed = 10; + if (!self.speed2) + self.speed2 = 16; + + if (self.state) + self.nextthink = time + 0.1; + + // innie and outie cancel + if (self.spawnflags & 2 && self.spawnflags & 4) + self.spawnflags -= 6; + + self.mangle_x *= 0.5; + self.mangle_y *= 0.5; + self.mangle_z *= 0.5; +} + + +//============================================================================= + + +void(entity targ, float mag) screenshake_go = +{ + mag = mag + 1; + + // punchangle doesn't work when we're in an intermission camera, so do + // this with actual angle offsets when intermission_running > 0 + if (intermission_running) + { + local vector kick; + kick_x = (random()- 0.5) * mag; + kick_y = (random()- 0.5) * mag; + kick_z = (random()- 0.5) * mag * 2; + targ.angles = targ.finalangle + kick; + targ.angles_z = kick_z; + targ.fixangle = 1; + return; + } + +/* local vector kick; + kick_x = (-0.5 + random()) * mag; + kick_y = (-0.5 + random()) * mag; + kick_z = (-0.5 + random()) * mag; + targ.angles = targ.v_angle + kick; + targ.angles_z = kick_z; + targ.fixangle = 1; // turn this way immediately*/ + + targ.punchangle_x = random() * mag * 2 - mag; + targ.punchangle_y = random() * mag * 2 - mag; + + // punchangle seems to get integerized, so we need some kind of + // activity when the magnitude is low so it feels like a faint + // rumble instead of just a dying fish kicking occasionally + mag = mag * 2; // the rolls feel a lot less violent, so bump them up a little + + targ.punchangle_z = random() * mag * 2 - mag; +} + +void() screenshake_think = +{ + local entity t; + local float mag; + + if (time > self.pain_finished) + { + t = find( world, classname, "player" ); + while (t) + { + t.v_angle_z = 0; // unroll + t = find( t, classname, "player" ); + } + return; + } + + if (time < self.super_time + self.delay) + { + mag = 1 - ((self.super_time + self.delay) - time) / self.delay; + } + else if (time < self.super_time + self.delay + self.length) + { + mag = 1; + } + else if (time < self.pain_finished) + { + mag = (self.pain_finished - time) / self.wait; + } + else mag = 0; + + mag = mag * mag; // power of 2 falloff seems smoother than linear + + t = find( world, classname, "player" ); + while (t) + { +// bprint(ftos(self.strength * mag)); +// bprint("\n"); + screenshake_go(t, self.strength * mag); + t = find( t, classname, "player" ); + } + + self.nextthink = time + 0.05; +} + +void() screenshake_use = +{ + self.pain_finished = time + self.wait + self.delay + self.length; + self.super_time = time; + self.nextthink = time + 0.05; + self.think = screenshake_think; +} + + +/*QUAKED target_screenshake (0 .5 .8) (-8 -8 -8) (8 8 8) +Shakes the screen. Jostles the view of all clients, but doesn't physically move their bounding boxes or apply velocities. +Keys +"length" Duration of full intensity quake +"delay" Time to ramp up quake intensity from 0 +"wait" Time to ramp down quake intensity to 0. Total quake duration is length + delay + wait. +"strength" Intensity of quake. 1 is a hearty rumble, 10 is spasmodic bordering on hilarious. +*/ +/*FGD +@Pointclass base(Targetname, Appearflags) color(0 128 224) size(16 16 16) = target_screenshake : +"Shakes the screen. Jostles the view of all clients, but doesn't physically move their bounding boxes or apply velocities. +Total shake duration is length + delay + wait." +[ + length(string) : "Duration of full intensity (sustain)" + delay(string) : "Time to ramp up from 0 (attack)" + wait(string) : "Time to ramp down quake intensity to 0." + strength(string) : "Intensity of quake. 1 is a hearty rumble, 10 is spasmodic bordering on hilarious." +] +*/ +void() target_screenshake = +{ + if (!SUB_ShouldSpawn()) return; + self.wait = max(0, self.wait); + self.delay = max(0, self.delay); + self.length = max(0, self.length); + + if (!self.delay && !self.length && !self.wait) + dprint("misc_screenshake will last 0 seconds\n"); + + if (!self.strength) + { + if (self.volume) + objerror("convert target_screenshake to .strength please"); + + self.strength = 10; // set your own value goddamnit + } + self.use = screenshake_use; +} + + +void(float attack, float sustain, float release, float str) screenshake_oneshot = +{ + entity shake, oself; + + shake = spawn(); + + shake.delay = attack; + shake.length = sustain; + shake.wait = release; + shake.strength = str; + + oself = self; + self = shake; + + target_screenshake(); + screenshake_use(); + + self = oself; +} + +//============================================================================ + +void() target_explosion_go = +{ + if (self.dmg) T_RadiusMultiDamage (self, self, self.dmg, self, 0); + BecomeExplosion(); +} + +void() target_explosion_use = +{ + float i; + entity bewm; + + if (self.count == 1 && self.delay == 0) + { + kaboom(self.origin, self.dmg, self, 0); + return; + } + + for (i=0;i<self.count;i++) + { + bewm = spawn(); + setorigin(bewm, self.origin); + bewm.think = target_explosion_go; + bewm.nextthink = time + self.delay + self.wait * i; + bewm.dmg = self.dmg; + bewm.deathtype = self.deathtype; + } +} + +/*QUAKED target_explosion (0 .5 .8) (-8 -8 -8) (8 8 8) +Causes explosions, same appearance as a rocket/grenade blast. + +Keys +"count" number of times to explode after triggering, default 1 +"delay" Time to wait before first explode +"wait" Time to wait between explosions +"dmg" Do splash damage, default 0 +"deathtype" death message if the player is killed by your horrible trap +*/ +/*FGD +@Pointclass base(Targetname, Appearflags, Deathtype) color(0 128 224) size(16 16 16) = target_explosion : +"Causes explosions, same appearance as a rocket/grenade blast." +[ + count(integer) : "Repeat count" : 1 + delay(string) : "Delay before first blast" : "0" + wait(string) : "Wait between blasts" : "1" + dmg(integer) : "Splash damage" : 0 +] +*/ +void() target_explosion = +{ + if (!SUB_ShouldSpawn()) return; + self.count = zeroconvertdefault(self.count, 1); + self.use = target_explosion_use; + if (!self.wait) + self.wait = 1; + if (self.deathtype == string_null) + self.deathtype = "joins the smithereens"; +} + +//============================================================================ + +void() target_telefog_use = +{ + float i; + entity tfog; + + if (self.count == 1 && self.delay == 0) + { + teleport_flash(); + return; + } + + for (i=0;i<self.count;i++) + { + tfog = spawn(); + setorigin(tfog, self.origin); + tfog.think = teleport_flasher; + tfog.nextthink = time + self.delay + self.wait * i; + } +} + +/*QUAKED target_telefog (0 .5 .8) (-8 -8 -8) (8 8 8) +Causes a flash of teleport fog. + +Keys +"count" number of times to flash after triggering, default 1 +"delay" Time to wait before first flash +"wait" Time to wait between flashes +*/ +/*FGD +@Pointclass base(Targetname, Appearflags) color(0 128 224) size(16 16 16) = target_telefog : +"Causes a flash of teleport fog." +[ + count(integer) : "Repeat count" : 1 + delay(string) : "Delay before first flash" : "0" + wait(string) : "Wait between flashes" : "1" +] +*/ +void() target_telefog = +{ + if (!SUB_ShouldSpawn()) return; + self.count = zeroconvertdefault(self.count, 1); + self.use = target_telefog_use; + if (!self.wait) + self.wait = 1; +} + + + + +//============================================================================ + +// bubbas + +entity(vector org) bubble_spawn = +{ + entity bubble; + + bubble = spawn(); + setmodel (bubble, "progs/s_bubble.spr"); + setorigin (bubble, org); + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_NOT; + setsize (bubble, '-8 -8 -8', '8 8 8'); + bubble.velocity = '0 0 18'; + + bubble.nextthink = time + 0.25; + bubble.think = bubble_bob; + bubble.touch = SUB_RemoveSoon; + bubble.classname = "bubble"; + if (random() < 0.2) + { + bubble.frame = 1; + bubble.cnt = 11; + } + else + { + bubble.frame = 0; + bubble.cnt = 0; + } + return bubble; +} + +void() air_bubbles_use = +{ + self.state = !(self.state); + self.think = make_bubbles; + if (self.state) + { + self.nextthink = 0; + return; + } + self.nextthink = time + random() * self.rand + self.wait; +} + +/*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) START_OFF +air bubble emitter. always bubbles. +"wait" bubble interval, default 1 +"rand" random extra interval, default 0 +*/ +/*FGD +@PointClass base(Appearflags, Targetname) color(0 150 220) = air_bubbles : "Air bubbles" +[ + spawnflags(flags) = [ + 1 : "Start off" : 0 + ] + wait(string) : "Bubble interval" : "0.5" + rand(string) : "Random extra interval" : "1" +] +*/ +void() air_bubbles = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch) + { + remove (self); + return; + } + precache_model ("progs/s_bubble.spr"); + self.wait = zeroconvertdefault(self.wait, 1); + self.rand = zeroconvertdefault(self.rand, 1); + + self.think = make_bubbles; + if (self.targetname != string_null) + { + self.use = air_bubbles_use; + self.state = self.spawnflags & 1; + if (self.state) + return; + } + self.nextthink = time + self.wait; +} + +void() make_bubbles = +{ + if (self.state) + return; + bubble_spawn(self.origin); + self.nextthink = time + random() * self.rand + self.wait; + self.think = make_bubbles; +} + +void() bubble_split = +{ + entity bubble; + bubble = bubble_spawn(self.origin); + bubble.frame = 1; + bubble.cnt = floor(9 + random()*4); + bubble.velocity = self.velocity + '0 0 2'; + self.frame = 1; + self.cnt = 10; + if (pointcontents(self.origin + '0 0 8') != CONTENT_WATER) + remove (self); +} + +void() bubble_remove = +{ + remove(self); +} + +void() bubble_bob = +{ + float rnd1, rnd2, rnd3; + + if (pointcontents(self.origin + '0 0 8') != CONTENT_WATER) + { + SUB_Remove(); + return; + } + + self.cnt = self.cnt + 1; + if (self.cnt == 10) + bubble_split(); + if (self.cnt >= 20 + random()*5) + remove(self); + + rnd1 = self.velocity_x + crandom() * 20; + rnd2 = self.velocity_y + crandom() * 20; + rnd3 = self.velocity_z + crandom() * 15; + + if (rnd1 > 10) + rnd1 = 5; + if (rnd1 < -10) + rnd1 = -5; + + if (rnd2 > 10) + rnd2 = 5; + if (rnd2 < -10) + rnd2 = -5; + + if (rnd3 < 20) + rnd3 = 25; + if (rnd3 > 40) + rnd3 = 35; + + self.velocity_x = rnd1; + self.velocity_y = rnd2; + self.velocity_z = rnd3; + + self.nextthink = time + 0.25; + self.think = bubble_bob; +} \ No newline at end of file diff --git a/QC_other/QC_copper/impulse.qc b/QC_other/QC_copper/impulse.qc new file mode 100644 index 00000000..8632dab1 --- /dev/null +++ b/QC_other/QC_copper/impulse.qc @@ -0,0 +1,276 @@ +/* +============================================================================== + +IMPULSES + +============================================================================== +*/ + +// -------------------------------- +// Cheat_Keys +// -------------------------------- +void() Cheat_Keys = +{ + if(deathmatch || coop) + return; + + self.items = self.items | + IT_KEY1 | IT_KEY2; + self.worldtype += 17; // grant one of each key per use + + stuffcmd(self,"bf\n"); +} + + +// -------------------------------- +// Cheat_Items +// -------------------------------- +void() Cheat_Items = +{ + if(deathmatch || coop) + return; + + self.ammo_shells = MAX_AMMO_SHELLS; + self.ammo_nails = MAX_AMMO_NAILS; + self.ammo_rockets = MAX_AMMO_ROCKETS; + self.ammo_cells = MAX_AMMO_CELLS; + + self.items = self.items | + // IT_KEY1 | IT_KEY2 | + IT_AXE | + IT_SHOTGUN | + IT_SUPER_SHOTGUN | + IT_NAILGUN | + IT_SUPER_NAILGUN | + IT_GRENADE_LAUNCHER | + IT_ROCKET_LAUNCHER; + + self.items = self.items | IT_LIGHTNING; + + self.weapon = IT_ROCKET_LAUNCHER; + + stuffcmd(self,"bf\n"); + W_ResetWeaponState(); +} + +// -------------------------------- +// Cheat_Genocide +// -------------------------------- +void() Cheat_Genocide = +{ + if(deathmatch || coop) + return; + entity t; + + t = nextent(world); + while(t != world) + { + // these monsters haven't spawned yet, turn them into relays so their + // deathtargets fire as soon as they're triggered and their absence doesn't + // break the level + if(t.customflags & CFL_SPAWNER || t.spawnflags & SPAWN_TRIGGERED) + { + t.classname = "trigger_relay"; + t.count = 0; + t.use = trigger_relay_use; + t.spawnflags = 0; + } + t = nextent(t); + } + // kill existing monsters second, so that any monsters triggered by other monsters + // are already de-monsterized + t = nextent(world); + while(t != world) + { + if(t.flags & FL_MONSTER) + T_Damage(t, self, self, t.health); // waurgh + t = nextent(t); + } +} + +// -------------------------------- +// Cheat_Undying +// -------------------------------- +void() Cheat_Undying = +{ + if(deathmatch || coop) + return; + if(self.customflags & CFL_UNDYING) + { + sprint(self, "Undying mode disabled\n"); + self.customflags = not(self.customflags, CFL_UNDYING); + return; + } + sprint(self, "Undying mode enabled\n"); + self.customflags |= CFL_UNDYING; +} + + +// -------------------------------- +// Cheat_Quad +// -------------------------------- +void() Cheat_Quad = +{ + if(deathmatch || coop) + return; + stuffcmd(self, "bf\n"); + self.items = self.items | IT_QUAD; + powerup_super_damage(self, 30); +} + +// -------------------------------- +// Cheat_Pent +// -------------------------------- +void() Cheat_Pent = +{ + if(deathmatch || coop) + return; + stuffcmd(self, "bf\n"); + self.items = self.items | IT_INVULNERABILITY; + powerup_invulnerability(self, 30); +} + +// -------------------------------- +// Cheat_Ring +// -------------------------------- +void() Cheat_Ring = +{ + if(deathmatch || coop) + return; + stuffcmd(self, "bf\n"); + self.items = self.items | IT_INVISIBILITY; + powerup_invisibility(self, 30); +} + +// -------------------------------- +// Cheat_Suit +// -------------------------------- +void() Cheat_Suit = +{ + if(deathmatch || coop) + return; + stuffcmd(self, "bf\n"); + self.items = self.items | IT_SUIT; + powerup_envirosuit(self, 30); +} + + + +// -------------------------------- +// ImpulseCommands +// -------------------------------- +void() ImpulseCommands = +{ + switch(self.impulse) + { + case 0: + return; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + W_ChangeWeapon(); + break; + case 10: + CycleWeaponCommand(); + break; + case 12: + CycleWeaponReverseCommand(); + break; + +/* + // ai_nav + case 80: + nav_toggleEditor(); + break; + case 81: + nav_nodeSizeUp(); + break; + case 82: + nav_nodeSizeDown(); + break; + case 83: + nav_createNode(); + break; + case 84: + nav_deleteNode(); + break; + */ + case 64: + dev_i_cant_see(); + break; + case 72: + dev_test(); + break; + case 100: + dev_invoke(); + break; + case 101: + dev_reveal(); + break; + case 102: + dev_trigger(); + break; + case 103: + dev_hitpoints(); + break; + case 104: + dev_serverflags(); + break; + case 105: + dev_warp(); + break; + case 106: + dev_whatami(); + break; + case 108: + dev_tracetest(); + break; + case 127: + case 129: + coredump(); + break; + + case 140: + sound(self, CHAN_VOICE, "player/tornoff2.wav", 1, ATTN_STATIC); + centerprint(self, version); + break; + + case 9: + Cheat_Items(); + break; + case 99: + Cheat_Keys(); + break; + // how about, execute order six? + // nah. makes it sound like there aren't that many orders + case 66: + case 205: + Cheat_Genocide(); + break; + case 215: + Cheat_Undying(); + break; + case 225: + Cheat_Suit(); + break; + case 235: + Cheat_Pent(); + break; + case 245: + Cheat_Ring(); + break; + case 255: + Cheat_Quad(); + break; + + default: + return; + } + + self.impulse = 0; +} diff --git a/QC_other/QC_copper/item_backpack.qc b/QC_other/QC_copper/item_backpack.qc new file mode 100644 index 00000000..800fb527 --- /dev/null +++ b/QC_other/QC_copper/item_backpack.qc @@ -0,0 +1,274 @@ +/* +=============================================================================== + +BACKPACKS + +=============================================================================== +*/ + +/* +================================ +print_quant +pretty-print a quantity to a client's buffer +================================ +*/ +void(float amt, string noun, entity to) print_quant = +{ + string s; + + if (amt == 1) + { + sprint (to, "1 "); + sprint (to, noun); + return; + } + + s = ftos(amt); + sprint (to, s); + sprint (to, " "); + sprint (to, noun); + sprint (to, "s"); +} + +/* +================================ +BackpackTouch +================================ +*/ +void() BackpackTouch = +{ + if (!CheckValidTouch()) return; + + float acount; + + other.ammo_shells = other.ammo_shells + self.ammo_shells; + other.ammo_nails = other.ammo_nails + self.ammo_nails; + other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; + other.ammo_cells = other.ammo_cells + self.ammo_cells; + bound_ammo(other); + armor_give(other, self.armorvalue, FALSE); + + sprint (other, "You got "); + + if (self.items && (other.items & self.items) == 0) + { + entity oself; + acount = TRUE; + sprint (other, "the "); + sprint (other, self.netname); + + oself = self; + self = other; + // change to the weapon + W_BetterWeapon(oself.items); + self = oself; + } + + if (self.armorvalue) + { + if (acount) sprint(other, ", "); + acount = 1; + sprint(other, ftos(self.armorvalue)); + sprint(other, " armor"); + } + if (self.ammo_shells) + { + if (acount) sprint(other, ", "); + acount = 2; + print_quant(self.ammo_shells, "shell", other); + } + if (self.ammo_nails) + { + if (acount) sprint(other, ", "); + acount = 2; + print_quant(self.ammo_nails, "nail", other); + } + if (self.ammo_rockets) + { + if (acount) sprint(other, ", "); + acount = 2; + print_quant(self.ammo_rockets, "rocket", other); + } + if (self.ammo_cells) + { + if (acount) sprint(other, ", "); + acount = 2; + print_quant(self.ammo_cells, "cell", other); + } + + sprint (other, "\n"); + + // do this after because t_heal prints its own message + if (self.healamount) + T_Heal(other, self.healamount, 0); + + // regular monster backpacks don't make the AWESOME NEW backpack sound + if (self.classname == "item_backpack") + { + if (acount == 2) + sound(other, CHAN_ITEM, "items/pack.wav", 1, ATTN_NORM); + else // only got armor, play armor sound instead + sound(other, CHAN_ITEM, "items/patch.wav", 1, ATTN_NORM); + } + else + sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); + + stuffcmd (other, "bf\n"); + + SUB_CallAsSelf(W_SetCurrentAmmo, other); + ItemTouched(); +} + +/* +================================ +BackpackAutoTouch + +backpacks can always be picked up, so mapper-placed ammo backpacks should +give the player something else if they're maxxed out on any ammo types, +since they're little exploration rewards for hiding behind crates and etc +================================ +*/ +void() BackpackAutoTouch = +{ + if (!CheckValidTouch()) return; + + if (self.spawnflags & 1) + sprint (other, "You found a big backpack!\n"); + else + sprint (other, "You found a backpack\n"); + + if (other.ammo_shells + self.ammo_shells > MAX_AMMO_SHELLS) + { + self.armorvalue += other.ammo_shells + self.ammo_shells - MAX_AMMO_SHELLS; + self.ammo_shells = MAX_AMMO_SHELLS - other.ammo_shells; + } + if (other.ammo_nails + self.ammo_nails > MAX_AMMO_NAILS) + { + self.armorvalue += ceil((other.ammo_nails + self.ammo_nails - MAX_AMMO_NAILS) / 2); + self.ammo_nails = MAX_AMMO_NAILS - other.ammo_nails; + } + if (other.ammo_rockets + self.ammo_rockets > MAX_AMMO_ROCKETS) + { + self.armorvalue += (other.ammo_rockets + self.ammo_rockets - MAX_AMMO_ROCKETS) * 3; + self.ammo_rockets = MAX_AMMO_ROCKETS - other.ammo_rockets; + } + if (other.ammo_cells + self.ammo_cells > MAX_AMMO_CELLS) + { + self.armorvalue += (other.ammo_cells + self.ammo_cells - MAX_AMMO_CELLS) * 3; + self.ammo_cells = MAX_AMMO_CELLS - other.ammo_cells; + } + + self.armorvalue = floor(self.armorvalue / 2); + BackpackTouch(); +} + +/*QUAKED item_backpack (0 .5 .5) (-16 -16 0) (16 16 40) BIG ? SUSPENDED - +A forgotten explorer's backpack. Grants a paltry sum of shells and nails (about half a small pack of each). Grants armor instead of any ammo the player already has maxed. + +Flags: +"big" doubles shells and nails, adds 2 rockets and 4 cells, appears red + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Item) size(-16 -16 0, 16 16 40) color(0 128 128) + model({ "path": ":progs/backpack.mdl" }) + = item_backpack : +"A forgotten explorer's backpack. Grants a paltry sum of shells and nails (about half a small pack of each). Grants armor instead of any ammo the player already has maxed." +[ + spawnflags(flags) = [ + 1 : "Big (2x, red, rockets/cells)" : 0 + ] +] +*/ +void() item_backpack = +{ + if (!SUB_ShouldSpawn()) return; + precache_model("progs/backpack.mdl"); + precache_sound3("items/pack.wav"); // backpacks can play either of these + precache_sound3("items/patch.wav"); + + self.flags = FL_ITEM; + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_TOSS; + setmodel (self, "progs/backpack.mdl"); + setsize (self, '-16 -16 0', '16 16 56'); + self.skin = 1; + + self.ammo_shells = floor(3 * random() + 6); + self.ammo_nails = floor(5 * random() + 12); + if (self.spawnflags & 1) + { + self.ammo_shells *= 2; + self.ammo_nails *= 2; + + self.ammo_rockets = 2; + self.ammo_cells = 4; + self.skin = 2; + } + + self.touch = BackpackAutoTouch; + StartItem (); +} + + + + +/* +=============== +DropBackpack +=============== +*/ +void() DropBackpack = +{ + entity item; + + if (!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells)) + return; // nothing in it + + item = spawn(); + item.origin = self.origin - '0 0 24'; + + item.items = self.weapon; + if (item.items == IT_AXE) + item.netname = "Axe"; + else if (item.items == IT_SHOTGUN) + item.netname = "Shotgun"; + else if (item.items == IT_SUPER_SHOTGUN) + item.netname = "Double-Barrelled Shotgun"; + else if (item.items == IT_NAILGUN) + item.netname = "Nailgun"; + else if (item.items == IT_SUPER_NAILGUN) + item.netname = "Perforator"; + else if (item.items == IT_GRENADE_LAUNCHER) + item.netname = "Grenade Launcher"; + else if (item.items == IT_ROCKET_LAUNCHER) + item.netname = "Rocket Launcher"; + else if (item.items == IT_LIGHTNING) + item.netname = "Thunderbolt"; + else + item.netname = string_null; + + item.ammo_shells = self.ammo_shells; + item.ammo_nails = self.ammo_nails; + item.ammo_rockets = self.ammo_rockets; + item.ammo_cells = self.ammo_cells; + + item.velocity_z = 300; + item.velocity_x = -100 + (random() * 200); + item.velocity_y = -100 + (random() * 200); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + setmodel (item, "progs/backpack.mdl"); + setsize (item, '-16 -16 0', '16 16 56'); + item.touch = BackpackTouch; + + item.nextthink = time + 120; // remove after 2 minutes + item.think = SUB_Remove; +} \ No newline at end of file diff --git a/QC_other/QC_copper/item_health_armor.qc b/QC_other/QC_copper/item_health_armor.qc new file mode 100644 index 00000000..7e3148df --- /dev/null +++ b/QC_other/QC_copper/item_health_armor.qc @@ -0,0 +1,329 @@ +/* +========================================================================= + +HEALTH BOXES + +========================================================================= +*/ + +float ITEM_HEALTH_ROTTEN = 1; +float ITEM_HEALTH_MEGA = 2; + + +void() health_touch = +{ + if (!CheckValidTouch()) return; + + if (!T_Heal(other, self.healamount, (self.spawnflags & ITEM_HEALTH_MEGA))) + return; + sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + + ItemTouched(); +} + + +/* +================================ +item_health & item_health_go +split up precaches and business code for late game health spawns +================================ +*/ +void() item_health_go +{ + self.touch = health_touch; + self.type = "health"; + + if (self.spawnflags & ITEM_HEALTH_ROTTEN) + { + setmodel(self, "maps/b_bh10.bsp"); + self.noise = "items/r_item1.wav"; + self.healamount = 15; + } + else if (self.spawnflags & ITEM_HEALTH_MEGA) + { + setmodel(self, "maps/b_bh100.bsp"); + self.noise = "items/r_item2.wav"; + self.healamount = 100; + } + else + { + setmodel(self, "maps/b_bh25.bsp"); + self.noise = "items/health1.wav"; + self.healamount = 25; + } + setsize (self, '0 0 0', '32 32 56'); + + if (deathmatch == 1) + self.wait = 20; + + StartItem (); +} + +// =============================================================================== + +/*QUAKED item_health (0 .5 .5) (0 0 0) (32 32 32) SMALL MEGA SUSPENDED +Health box. Normally gives 25 points. + +Flags: +"mega" will add 100 health, then rot you down to your maximum health limit, one point per second +"small" gives 15 points + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(0 0 0, 32 32 56) base(Item) + model( + {{ + spawnflags & 2 -> ":maps/b_bh100.bsp", + spawnflags & 1 -> ":maps/b_bh10.bsp", + ":maps/b_bh25.bsp" + }} + ) = + item_health : "Health pack" +[ + spawnflags(flags) = + [ + 1 : "Rotten" : 0 + 2 : "Megahealth" : 0 + ] +] +*/ +void() item_health = +{ + if (!SUB_ShouldSpawn()) return; + if (self.spawnflags & ITEM_HEALTH_MEGA) + { + precache_model("maps/b_bh100.bsp"); + precache_sound("items/r_item2.wav"); + } + else if (self.spawnflags & ITEM_HEALTH_ROTTEN) + { + precache_model("maps/b_bh10.bsp"); + precache_sound("items/r_item1.wav"); + } + else + { + precache_model("maps/b_bh25.bsp"); + precache_sound("items/health1.wav"); + } + + item_health_go(); +} + + + + + +/* +=============================================================================== + +ARMOR + +=============================================================================== +*/ + +/* +============ +armor_set_type + +coverage proportional to quantity, not derived from last armor grabbed +============ +*/ +void(entity e) armor_set_type = +{ + if (e.classname != "player") + return; + + e.items = not(e.items, (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); + if (!e.armorvalue) + return; + + // change HUD icon based on protection strength + if (e.armorvalue <= 100) + e.items |= IT_ARMOR1; + else if (e.armorvalue <= 150) + e.items |= IT_ARMOR2; + else + e.items |= IT_ARMOR3; + + e.armorvalue = min(e.armorvalue, 500); + + // armor never worth less than 25%, absorbs a theoretical 100% of damage at 250 armor points + e.armortype = 0.05 + e.armorvalue / 250; + e.armortype = clamp(e.armortype, 0.25, 1.0); + // this yields 25% up to 50 armor, 45% at 100 armor, 65% at 150, and 85% at 200 + // armors thus start out a little stronger than their vanilla counterparts (30/60/80%) before weakening with loss + // the green armor gets the biggest buff from this ramp but that's okay +} + + +/* +============ +armor_give +============ +*/ +float(entity e, float amt, float merge) armor_give = +{ +/* + if (e.armorvalue <= 0) + { + // default to green armor if there isn't some already + e.armortype = 0.3; + e.items = not(e.items, (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1; + }*/ + if (merge) + { + // dumb magic formula for merging armor quake2 style + /* + float l, s; + + if (e.armorvalue < amt) + { + l = amt; + s = e.armorvalue; + } + else + { + s = amt; + l = e.armorvalue; + } + + amt = l + max(0,(8 * s - l)) / 10; + amt = floor(5 * ceil(amt / 5)); // round up to multiple of 5 so new armor still feels nice and crisp + */ + if (e.armorvalue >= amt) + return FALSE; + e.armorvalue = amt; + } + else + e.armorvalue += amt; + + armor_set_type(e); + return TRUE; +} + + +/* +============ +armor_touch +============ +*/ +void() armor_touch = +{ + //float getamt, atype, bit; + if (!CheckValidTouch()) return; + +/* + float value; + // amounts are reduced, but armor always stacks with existing armor + if (self.classname == "item_armor1") + { + //atype = 0.3; + value = 100; + //bit = IT_ARMOR1; + //value = 80; + } + else if (self.classname == "item_armor2") + { + //atype = 0.6; + value = 150; + //bit = IT_ARMOR2; + //value = 120; + } + else //if (self.classname == "item_armorInv") + { + //atype = 0.8; + value = 200; + //bit = IT_ARMOR3; + //value = 160; + } + */ + //other.armortype = atype; // old way + //other.items = not(other.items, (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit; + if (!armor_give(other, self.strength, TRUE)) + return; + + sound(other, CHAN_ITEM, "items/armor1.wav", 1, ATTN_NORM); + sprint(other, "You got armor\n"); + + stuffcmd (other, "bf\n"); + ItemTouched(); +} + +// =============================================================================== +/* +============ +StartArmor +============ +*/ +void(float skn, float amt) StartArmor = +{ + if (!SUB_ShouldSpawn()) return; + + self.skin = skn; + self.strength = amt; + + self.touch = armor_touch; + self.type = "armor"; + precache_model ("progs/armor.mdl"); + setmodel (self, "progs/armor.mdl"); + + if (deathmatch == 1) + self.wait = 20; + + setsize (self, '-16 -16 0', '16 16 56'); + StartItem (); +} + + + +/*QUAKED item_armor1 (0 .5 .5) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Green armor, gives 100 points. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 0, 16 16 56) base(Item) model({ "path": ":progs/armor.mdl" }) = + item_armor1 : "Green armor (100%)" [] +*/ +void() item_armor1 = { StartArmor(0,100); } + +/*QUAKED item_armor2 (0 .5 .5) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Yellow armor, gives 150 points. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 0, 16 16 56) base(Item) model({ "path": ":progs/armor.mdl", "skin": 1 }) = + item_armor2 : "Yellow armor (150%)" [] +*/ +void() item_armor2 = { StartArmor(1,150); } + +/*QUAKED item_armorInv (0 .5 .5) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Red armor, gives 200 armor points. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 0, 16 16 56) base(Item) model({ "path": ":progs/armor.mdl", "skin": 2 }) = + item_armorInv : "Red armor (200%)" [] +*/ +void() item_armorInv = { StartArmor(2,200); } + + diff --git a/QC_other/QC_copper/item_keys_runes.qc b/QC_other/QC_copper/item_keys_runes.qc new file mode 100644 index 00000000..c60ed049 --- /dev/null +++ b/QC_other/QC_copper/item_keys_runes.qc @@ -0,0 +1,470 @@ +/* +=============================================================================== + +KEYS + +we use .worldtype on the player to store number of keys: first 4 bits are silver keys, +next higher 4 bits are golds + +15 of each key is well above the number of keys a mapper should expect a player to collect + +=============================================================================== +*/ + +float(entity cl) key_count_silver = +{ + if (!(cl.items & IT_KEY1)) + return 0; + return (cl.worldtype & 15); +} + +float(entity cl) key_count_gold = +{ + if (!(cl.items & IT_KEY2)) + return 0; + return (cl.worldtype & 240)/16; +} + +float(entity cl) key_give_silver = +{ + if (!(cl.items & IT_KEY1)) + { + sprint (cl, "You got the Silver Key\n"); + + cl.items |= IT_KEY1; + cl.worldtype += 1; + return TRUE; + } + + if (cl.worldtype & 15 == 15) + return FALSE; // we're full + + cl.worldtype += 1; + sprint (cl, "You have "); + sprint (cl, ftos(cl.worldtype & 15)); + sprint (cl, " Silver Keys\n"); + + return TRUE; +} + +float(entity cl) key_take_silver = +{ + if (!(cl.items & IT_KEY1)) + { + return FALSE; // we're dry + } + + cl.worldtype -= 1; + if (cl.worldtype & 15 == 0) + { + cl.items = not(cl.items, IT_KEY1); + return TRUE; + } + + float keys = (cl.worldtype & 15); + sprint (cl, "You have "); + sprint (cl, ftos(keys)); + if (keys > 1) + sprint (cl, " Silver Keys left\n"); + else + sprint (cl, " Silver Key left\n"); + + return TRUE; +} + + +float(entity cl, float num) key_take_silvers = +{ + if (key_count_silver(cl) < num) + { + return FALSE; // we're dry + } + + cl.worldtype -= num; + if (cl.worldtype & 15 == 0) + { + cl.items = not(cl.items, IT_KEY1); + return TRUE; + } + + float keys = (cl.worldtype & 15); + sprint (cl, "You have "); + sprint (cl, ftos(keys)); + if (keys > 1) + sprint (cl, " Silver Keys left\n"); + else + sprint (cl, " Silver Key left\n"); + + return TRUE; +} + +float(entity cl) key_give_gold = +{ + if (!(cl.items & IT_KEY2)) + { + sprint (cl, "You got the Gold Key\n"); + + cl.items |= IT_KEY2; + cl.worldtype += 16; + return TRUE; + } + + if (cl.worldtype & 240 == 240) + return FALSE; // we're full + + cl.worldtype += 16; + sprint (cl, "You have "); + sprint (cl, ftos((cl.worldtype & 240)/16)); + sprint (cl, " Gold Keys\n"); + + return TRUE; +} + +float(entity cl) key_take_gold = +{ + if (!(cl.items & IT_KEY2)) + { + return FALSE; // we're dry + } + + cl.worldtype -= 16; + if (cl.worldtype & 240 == 0) + { + cl.items = not(cl.items, IT_KEY2); + return TRUE; + } + + float keys = (cl.worldtype & 240)/16; + sprint (cl, "You have "); + sprint (cl, ftos(keys)); + if (keys > 1) + sprint (cl, " Gold Keys left\n"); + else + sprint (cl, " Gold Key left\n"); + + return TRUE; +} + +float(entity cl, float num) key_take_golds = +{ + if (key_count_gold(cl) < num) + { + return FALSE; // we're dry + } + + cl.worldtype -= 16 * num; + if (cl.worldtype & 240 == 0) + { + cl.items = not(cl.items, IT_KEY2); + return TRUE; + } + + float keys = (cl.worldtype & 240)/16; + sprint (cl, "You have "); + sprint (cl, ftos(keys)); + if (keys > 1) + sprint (cl, " Gold Keys left\n"); + else + sprint (cl, " Gold Key left\n"); + + return TRUE; +} + +void() key_touch = +{ + if (!CheckValidTouch()) return; + + float gave = FALSE; + + if (self.items == IT_KEY1) + { + gave = key_give_silver(other); + } + else if (self.items == IT_KEY2) + { + gave = key_give_gold(other); + } + + if (!gave) return; + //if (other.items & self.items) return; + + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + //other.items = other.items | self.items; + +// if (!coop) +// { + self.solid = SOLID_NOT; + self.model = string_null; +// } + + activator = other; + SUB_UseTargets(); // fire all targets / killtargets +} + + +void() key_setsounds = +{ + if (world.worldtype == 0) + { + precache_sound ("misc/medkey.wav"); + self.noise = "misc/medkey.wav"; + } + if (world.worldtype == 1) + { + precache_sound ("misc/runekey.wav"); + self.noise = "misc/runekey.wav"; + } + if (world.worldtype == 2) + { + precache_sound2 ("misc/basekey.wav"); + self.noise = "misc/basekey.wav"; + } +} + +/*QUAKED item_key1 (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED +Silver key. In order for keys to work you MUST set your maps worldtype (see worldspawn). + +Keys: +"target" fired when picked up +*//* +"skin" flavor +0 = Silver +2 = Iron +4 = Pewter +6 = Lead +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/w_s_key.mdl" }) = + item_key1 : "Silver Key" [] +*/ +void() item_key1 = +{ + if (!SUB_ShouldSpawn()) return; + if (world.worldtype == 0) + { + precache_model ("progs/m_key.mdl"); + setmodel (self, "progs/m_key.mdl"); + if (self.skin == 2) + self.netname = "iron key"; + else if (self.skin == 4) + self.netname = "lead key"; + else if (self.skin == 6) + self.netname = "pewter key"; + else + { + self.netname = "silver key"; + self.skin = 0; + } + } + else if (world.worldtype == 1) + { + precache_model ("progs/r_key.mdl"); + setmodel (self, "progs/r_key.mdl"); + if (self.skin == 2) + self.netname = "iron runekey"; + else if (self.skin == 4) + self.netname = "lead runekey"; + else if (self.skin == 6) + self.netname = "pewter runekey"; + else + { + self.netname = "silver runekey"; + self.skin = 0; + } + } + else if (world.worldtype == 2) + { + precache_model2 ("progs/b_s_key.mdl"); + setmodel (self, "progs/b_s_key.mdl"); + self.netname = "silver keycard"; + } + key_setsounds(); + self.touch = key_touch; + self.items = IT_KEY1; + setsize (self, '-16 -16 -24', '16 16 32'); + StartItem (); +} + +/*QUAKED item_key2 (.5 .5 0) (-16 -16 -24) (16 16 32) ? ? SUSPENDED +Gold key. In order for keys to work you MUST set your maps worldtype (see worldspawn). + +Keys: +"target" fired when picked up +*//* +"skin" flavor +1 = Gold +3 - Copper +5 = Bronze +7 = Brass +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/w_g_key.mdl" }) = + item_key2 : "Gold Key" [] +*/ +void() item_key2 = +{ + if (!SUB_ShouldSpawn()) return; + if (world.worldtype == 0) + { + precache_model ("progs/m_key.mdl"); + setmodel (self, "progs/m_key.mdl"); + if (self.skin == 3) + self.netname = "copper key"; + else if (self.skin == 5) + self.netname = "bronze key"; + else if (self.skin == 7) + self.netname = "brass key"; + else + { + self.netname = "gold key"; + self.skin = 1; + } + } + else if (world.worldtype == 1) + { + precache_model ("progs/r_key.mdl"); + setmodel (self, "progs/r_key.mdl"); + if (self.skin == 3) + self.netname = "copper runekey"; + else if (self.skin == 5) + self.netname = "bronze runekey"; + else if (self.skin == 7) + self.netname = "brass runekey"; + else + { + self.netname = "gold runekey"; + self.skin = 1; + } + } + if (world.worldtype == 2) + { + precache_model2 ("progs/b_g_key.mdl"); + setmodel (self, "progs/b_g_key.mdl"); + self.netname = "gold keycard"; + } + key_setsounds(); + self.touch = key_touch; + self.items = IT_KEY2; + setsize (self, '-16 -16 -24', '16 16 32'); + StartItem (); +} + + +/* +=============================================================================== + +RUNES + +=============================================================================== +*/ + +void() sigil_touch = +{ + if (!CheckValidTouch()) return; + + self.solid = SOLID_NOT; + self.model = string_null; + serverflags |= self.svflags; + self.classname = string_null; // so rune doors won't find it + + + activator = other; + SUB_UseTargets(); // fire all targets / killtargets + + if (time <= 1.5) return; // don't message in maps that start the player standing on a rune for control flow (zendar) + + centerprint (other, self.message); + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); +} + + +/*QUAKED item_sigil (0 .5 .5) (-16 -16 -24) (16 16 32) E1 E2 E3 E4 SUSPENDED +End of episode sigil. Can be customized through keyvalue manipulation to serve as any generic cross-map inventory item. + +Flags: +"E1 -E4" sets episode +"SUSPENDED" do not drop to floor on spawn + +Keys: +"noise" override pickup noise +"svflags" set a serverflag other than the episode 1-4 flags on pickup +"model" specify any model +"message" override pickup message +"target" entity to trigger when picked up +"targetname" entity name +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/end1.mdl" }) = + item_sigil : "End of episode rune" +[ + spawnflags(Flags) = + [ + 1 : "Episode 1" : 1 + 2 : "Episode 2" : 0 + 4 : "Episode 3" : 0 + 8 : "Episode 4" : 0 + 16 : "Suspended" : 0 + ] +] +*/ +void() item_sigil = +{ + if (!SUB_ShouldSpawn()) return; + if (!self.spawnflags) + objerror("no spawnflags"); + + if (!self.noise) + self.noise = "misc/runekey.wav"; + precache_sound (self.noise); + + if (self.message == string_null) + self.message = "You got the rune!"; + + if (self.spawnflags & 8) + { + precache_model2 ("progs/end4.mdl"); + setmodel (self, "progs/end4.mdl"); + self.message = "You got the rune\n of Elder Magic!"; + self.svflags = 8; + } + else if (self.spawnflags & 4) + { + precache_model2 ("progs/end3.mdl"); + setmodel (self, "progs/end3.mdl"); + self.message = "You got the rune\n of Hell Magic!"; + self.svflags = 4; + } + else if (self.spawnflags & 2) + { + precache_model2 ("progs/end2.mdl"); + setmodel (self, "progs/end2.mdl"); + self.message = "You got the rune\n of Black Magic!"; + self.svflags = 2; + } + else if (self.spawnflags & 1) + { + precache_model ("progs/end1.mdl"); + setmodel (self, "progs/end1.mdl"); + self.message = "You got the rune\n of Earth Magic!"; + self.svflags = 1; + } + else + { + if (!self.model) + self.model = "progs/end1.mdl"; + precache_model2(self.model); + setmodel(self, self.model); + if (!self.svflags) + self.svflags = 16; + } + + // rearrange extra spawnflags so they align with other items + self.spawnflags = not(self.spawnflags, SVFL_ALLEPISODES); + if (self.spawnflags & 16) + self.spawnflags = self.spawnflags - 16 + ITEM_SUSPENDED; + self.touch = sigil_touch; + setsize (self, '-16 -16 -24', '16 16 32'); + StartItem (); +} diff --git a/QC_other/QC_copper/item_powerups.qc b/QC_other/QC_copper/item_powerups.qc new file mode 100644 index 00000000..8632324a --- /dev/null +++ b/QC_other/QC_copper/item_powerups.qc @@ -0,0 +1,269 @@ +/* +=============================================================================== + +POWERUPS + +=============================================================================== +*/ + +/* +=============== +powerup_envirosuit +=============== +*/ +void(entity h, float t) powerup_envirosuit = +{ + sprint (h, "It's stuffy in this thing ...\n"); + h.items |= IT_SUIT; + h.rad_time = 1; + h.radsuit_finished = time + t; +} + +/* +=============== +powerup_invulnerability +=============== +*/ +void(entity h, float t) powerup_invulnerability = +{ + sprint (h, "An unholy ward surrounds you ...\n"); + h.items |= IT_INVULNERABILITY; + h.invincible_time = 1; + h.invincible_finished = time + t; +} + +/* +=============== +powerup_invisibility +=============== +*/ +void(entity h, float t) powerup_invisibility = +{ + sprint (h, "Others' eyes deceive them, but yours give you away ...\n"); + h.items |= IT_INVISIBILITY; + h.invisible_time = 1; + h.invisible_finished = time + t; +} + +/* +=============== +powerup_super_damage +=============== +*/ +void(entity h, float t) powerup_super_damage = +{ + sprint (h, "You begin to channel unstoppable power ...\n"); + h.items |= IT_QUAD; + h.super_damage_finished = time + t; + h.super_time = 1; +} + +/* +=============== +powerup_touch +=============== +*/ +void() powerup_touch = +{ + if ( !CheckValidTouch() ) return; + + sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + other.items = other.items | self.items; + + if (self.classname == "item_artifact_envirosuit") + powerup_envirosuit(other, 30); + + if (self.classname == "item_artifact_invulnerability") + powerup_invulnerability(other, 30); + + if (self.classname == "item_artifact_invisibility") + powerup_invisibility(other, 30); + + if (self.classname == "item_artifact_super_damage") + powerup_super_damage(other, 30); + + ItemTouched(); +} + + +/* +=============================================================================== + +PENTAGRAM + +=============================================================================== +*/ +void() precache_invulnerability = +{ + precache_model ("progs/invul.mdl"); + precache_sound ("items/protect.wav"); + precache_sound ("items/protect2.wav"); + precache_sound ("items/protect3.wav"); +} +/*QUAKED item_artifact_invulnerability (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED +Player is invulnerable for 30 seconds. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/invulner.mdl" }) = + item_artifact_invulnerability : "Pentagram of Protection" [] +*/ +void() item_artifact_invulnerability = +{ + if (!SUB_ShouldSpawn()) return; + self.touch = powerup_touch; + precache_invulnerability(); + + self.noise = "items/protect.wav"; + setmodel (self, "progs/invul.mdl"); + self.netname = "Pentagram of Protection"; + self.items = IT_INVULNERABILITY; + setsize (self, '-16 -16 -24', '16 16 32'); + if (deathmatch) + self.wait = 300; + StartItem (); +} + + +/* +=============================================================================== + +BIOSUIT + +=============================================================================== +*/ +void() precache_envirosuit = +{ + precache_model ("progs/suit.mdl"); + precache_sound ("items/suit.wav"); + precache_sound ("items/suit2.wav"); +} +/*QUAKED item_artifact_envirosuit (0 .5 .5) (-16 -16 -8) (16 16 48) ? ? SUSPENDED +Player takes no damage from water or slime for 30 seconds. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/suit.mdl" }) = + item_artifact_envirosuit : "Environmental protection suit" [] +*/ +void() item_artifact_envirosuit = +{ + if (!SUB_ShouldSpawn()) return; + self.touch = powerup_touch; + + precache_envirosuit(); + self.noise = "items/suit.wav"; + setmodel (self, "progs/suit.mdl"); + self.netname = "Biosuit"; + self.items = IT_SUIT; + setsize (self, '-16 -16 -8', '16 16 48'); + if (deathmatch) + self.wait = 60; + StartItem (); +} + + +/* +=============================================================================== + +RING OF SHADOWS + +=============================================================================== +*/ +void() precache_invisibility = +{ + precache_model ("progs/invis.mdl"); + precache_sound ("items/inv1.wav"); + precache_sound ("items/inv2.wav"); + precache_sound ("items/inv3.wav"); +} + +/*QUAKED item_artifact_invisibility (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED +Player is invisible for 30 seconds. Monsters will not awaken on sight, but they will on hearing sound (like gunfire). Awakened monsters will try to attack an invisible player and do an inaccurate job, possibly starting infights. +monster_dog can still smell an invisible player, but monster_tarbaby can't find the player at all. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/invisibl.mdl" }) = + item_artifact_invisibility : "Ring of Shadows" [] +*/ +void() item_artifact_invisibility = +{ + if (!SUB_ShouldSpawn()) return; + self.touch = powerup_touch; + precache_invisibility(); + self.noise = "items/inv1.wav"; + setmodel (self, "progs/invis.mdl"); + self.netname = "Ring of Shadows"; + self.items = IT_INVISIBILITY; + setsize (self, '-16 -16 -24', '16 16 32'); + if (deathmatch) + self.wait = 300; + StartItem (); +} + + +/* +=============================================================================== + +QUAD + +=============================================================================== +*/ +void() precache_super_damage = +{ + precache_model ("progs/quaddama.mdl"); + precache_sound ("items/damage.wav"); + precache_sound ("items/damage2.wav"); + precache_sound ("items/damage3.wav"); +} + +/*QUAKED item_artifact_super_damage (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED +Quad Damage. Player's attacks do 4x damage and he stops paying attention to anything else. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass size(-16 -16 -24, 16 16 32) base(Item) model({ "path": ":progs/quaddama.mdl" }) = + item_artifact_super_damage : "Quad damage" [] +*/ +void() item_artifact_super_damage = +{ + if (!SUB_ShouldSpawn()) return; + self.touch = powerup_touch; + + precache_super_damage(); + setmodel (self, "progs/quaddama.mdl"); + self.netname = "Quad Damage"; + self.noise = "items/damage.wav"; + self.items = IT_QUAD; + setsize (self, '-16 -16 -24', '16 16 32'); + if (deathmatch) + self.wait = 60; + StartItem (); +} + + + + + diff --git a/QC_other/QC_copper/item_weap_ammo.qc b/QC_other/QC_copper/item_weap_ammo.qc new file mode 100644 index 00000000..8d2b3d82 --- /dev/null +++ b/QC_other/QC_copper/item_weap_ammo.qc @@ -0,0 +1,550 @@ +/* +=============================================================================== + +WEAPONS + +=============================================================================== +*/ + +float ITEM_AMMO_BIG = 1; + + +void(entity e) bound_ammo = +{ + e.ammo_shells = min(e.ammo_shells, MAX_AMMO_SHELLS); + e.ammo_nails = min(e.ammo_nails, MAX_AMMO_NAILS); + e.ammo_rockets = min(e.ammo_rockets, MAX_AMMO_ROCKETS); + e.ammo_cells = min(e.ammo_cells, MAX_AMMO_CELLS); +} + +/* +============= +weapon_touch_coop +============= +*/ +void() weapon_touch_coop = +{ + if (!coop) return; + activator = other; + SUB_UseTargets(); + self.killtarget = string_null; + self.target = string_null; + self.target2 = string_null; + self.target3 = string_null; + self.target4 = string_null; +} + +/* +============= +weapon_touch +============= +*/ +void() weapon_touch = +{ + float new = 0; + entity stemp; + float leave; + + if (!CheckValidTouch()) return; + + if (deathmatch == 2 || coop) + leave = 1; + else + leave = 0; + + if (other.items & self.items == self.items) + { + if (leave) + { + weapon_touch_coop(); + return; + } + } + else + { + other.items |= self.items; + } + + other.ammo_shells += self.ammo_shells; + other.ammo_nails += self.ammo_nails; + other.ammo_rockets += self.ammo_rockets; + other.ammo_cells += self.ammo_cells; + + bound_ammo(other); + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + + sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // change to the weapon + stemp = self; + self = other; + W_BetterWeapon(stemp.items); + self = stemp; + + if (leave) + { + weapon_touch_coop(); + return; + } + + ItemTouched(); +} + + +/* +============ +StartWeapon +============ +*/ +void() StartWeapon = +{ + self.type = "weapon"; + self.touch = weapon_touch; + setsize (self, '-16 -16 0', '16 16 56'); + if (deathmatch == 1) + self.wait = 30; + StartItem (); +} + + +// =============================================================================== + +/*FGD +@baseclass size(-16 -16 0, 16 16 56) color(0 0 200) base(Item) = Weapon [] +*/ + + +/*QUAKED weapon_shotgun (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Shotgun. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_shotgn.mdl" }) = weapon_shotgun : "Shotgun" [] +*/ +void() weapon_shotgun = +{ + if (!SUB_ShouldSpawn()) return; + precache_model3 ("progs/g_shotgn.mdl"); + setmodel (self, "progs/g_shotgn.mdl"); + self.items = IT_SHOTGUN; + self.ammo_shells = 5; + self.netname = "Shotgun"; + StartWeapon(); +} + + +/*QUAKED weapon_supershotgun (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +SuperShotgun. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_shot.mdl" }) = weapon_supershotgun : "Double-barreled shotgun" [] +*/ +void() weapon_supershotgun = +{ + if (!SUB_ShouldSpawn()) return; + precache_model ("progs/g_shot.mdl"); + setmodel (self, "progs/g_shot.mdl"); + self.items = IT_SUPER_SHOTGUN; + self.ammo_shells = 5; + self.netname = "Double-barreled Shotgun"; + StartWeapon(); +} + +/*QUAKED weapon_nailgun (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Nailgun. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_nail.mdl" }) = weapon_nailgun : "Nailgun" [] +*/ +void() weapon_nailgun = +{ + if (!SUB_ShouldSpawn()) return; + precache_model ("progs/g_nail.mdl"); + setmodel (self, "progs/g_nail.mdl"); + self.items = IT_NAILGUN; + self.ammo_nails = 30; + self.netname = "nailgun"; + StartWeapon(); +} + +/*QUAKED weapon_supernailgun (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Perforator (Super Nailgun). + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_nail2.mdl" }) = weapon_supernailgun : "Super nailgun" [] +*/ +void() weapon_supernailgun = +{ + if (!SUB_ShouldSpawn()) return; + precache_model ("progs/g_nail2.mdl"); + setmodel (self, "progs/g_nail2.mdl"); + self.items = IT_SUPER_NAILGUN; + self.ammo_nails = 30; + self.netname = "Perforator"; + StartWeapon(); +} + +/*QUAKED weapon_grenadelauncher (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Grenade Launcher. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_rock.mdl" }) = weapon_grenadelauncher : "Grenade launcher" [] +*/ +void() weapon_grenadelauncher = +{ + if (!SUB_ShouldSpawn()) return; + precache_model ("progs/g_rock.mdl"); + setmodel (self, "progs/g_rock.mdl"); + self.items = IT_GRENADE_LAUNCHER; + self.ammo_rockets = 5; + self.netname = "Grenade Launcher"; + StartWeapon(); +} + +/*QUAKED weapon_rocketlauncher (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Rocket Launcher. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_rock2.mdl" }) = weapon_rocketlauncher : "Rocket launcher" [] +*/ +void() weapon_rocketlauncher = +{ + if (!SUB_ShouldSpawn()) return; + precache_model ("progs/g_rock2.mdl"); + setmodel (self, "progs/g_rock2.mdl"); + self.items = IT_ROCKET_LAUNCHER; + self.ammo_rockets = 5; + self.netname = "Rocket Launcher"; + StartWeapon(); +} + + +/*QUAKED weapon_lightning (0 0 1) (-16 -16 0) (16 16 32) ? ? SUSPENDED +Thunderbolt Cannon. + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Weapon) model({ "path": ":progs/g_light.mdl" }) = weapon_lightning : "Thunderbolt" [] +*/ +void() weapon_lightning = +{ + if (!SUB_ShouldSpawn()) return; + precache_model ("progs/g_light.mdl"); + setmodel (self, "progs/g_light.mdl"); + self.items = IT_LIGHTNING; + self.ammo_cells = 12; + self.netname = "Thunderbolt"; + StartWeapon(); +} + + +// =============================================================================== + +/* +============ +ammo_touch +============ +*/ +void() ammo_touch = +{ + if (!CheckValidTouch()) return; + + // structured in dual if's instead of using && to preserve ammo_touch maphacks + if (self.ammo_shells) + { + if (other.ammo_shells < MAX_AMMO_SHELLS) + other.ammo_shells += self.ammo_shells; + else return; + } + else if (self.ammo_nails) + { + if (other.ammo_nails < MAX_AMMO_NAILS) + other.ammo_nails += self.ammo_nails; + else return; + } + else if (self.ammo_rockets) + { + if (other.ammo_rockets < MAX_AMMO_ROCKETS) + other.ammo_rockets += self.ammo_rockets; + else return; + } + else if (self.ammo_cells) + { + if (other.ammo_cells < MAX_AMMO_CELLS) + other.ammo_cells += self.ammo_cells; + else return; + } + //else return; + + bound_ammo(other); + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + + sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // if changed current ammo, update it + SUB_CallAsSelf(W_SetCurrentAmmo, other); + + ItemTouched(); +} + +/* +============ +StartAmmo +============ +*/ +void() StartAmmo = +{ + self.type = "ammo"; + setsize (self, '0 0 0', '32 32 56'); + self.touch = ammo_touch; + if (deathmatch == 1) + self.wait = 30; + StartItem (); + //ItemRotateAndSize('32 32 56'); +} + +/*FGD +@baseclass size(0 0 0, 32 32 56) color(80 0 200) base(Item) = Ammo [ spawnflags(flags) = [ 1 : "Large box" : 0 ] ] +*/ + +/*QUAKED item_shells (0 .5 .5) (0 0 0) (32 32 32) BIG ? SUSPENDED +20 shells for both Shotgun and SuperShotgun. + +Flags: +"big" gives 40 instead of 20 + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Ammo) + model( + {{ + spawnflags & 1 -> ":maps/b_shell1.bsp", + ":maps/b_shell0.bsp" + }} + ) = item_shells : "Shells, 20/40" [] +*/ +void() item_shells = +{ + if (!SUB_ShouldSpawn()) return; + if (self.spawnflags & ITEM_AMMO_BIG) + { + self.ammo_shells = 40; + precache_model ("maps/b_shell1.bsp"); + setmodel (self, "maps/b_shell1.bsp"); + } + else + { + self.ammo_shells = 20; + precache_model ("maps/b_shell0.bsp"); + setmodel (self, "maps/b_shell0.bsp"); + } + self.weapon = 1; + self.netname = "shells"; + StartAmmo(); +} + +/*QUAKED item_spikes (0 .5 .5) (0 0 0) (32 32 32) BIG ? SUSPENDED +25 ammo points (spikes) for Perforator and Super Perforator. + +Flags: +"big" gives 50 instead of 25 + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Ammo) + model( + {{ + spawnflags & 1 -> ":maps/b_nail1.bsp", + ":maps/b_nail0.bsp" + }} + ) = item_spikes : "Nailgun/Perforator ammo, 25/50" [] +*/ +void() item_spikes = +{ + if (!SUB_ShouldSpawn()) return; + if (self.spawnflags & ITEM_AMMO_BIG) + { + self.ammo_nails = 50; + precache_model ("maps/b_nail1.bsp"); + setmodel (self, "maps/b_nail1.bsp"); + } + else + { + self.ammo_nails = 25; + precache_model ("maps/b_nail0.bsp"); + setmodel (self, "maps/b_nail0.bsp"); + } + self.weapon = 2; + self.netname = "nails"; + StartAmmo(); +} + +/*QUAKED item_rockets (0 .5 .5) (0 0 0) (32 32 32) BIG ? SUSPENDED +3 ammo points (rockets) for the Rocket/Grenade Launcher. + +Flags: +"big" gives 6 instead of 3 + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Ammo) + model( + {{ + spawnflags & 1 -> ":maps/b_rock1.bsp", + ":maps/b_rock0.bsp" + }} + ) = + item_rockets : "Rockets, 4/8" [] +*/ +void() item_rockets = +{ + if (!SUB_ShouldSpawn()) return; + if (self.spawnflags & ITEM_AMMO_BIG) + { + self.ammo_rockets = 8; + precache_model ("maps/b_rock1.bsp"); + setmodel (self, "maps/b_rock1.bsp"); + } + else + { + self.ammo_rockets = 4; + precache_model ("maps/b_rock0.bsp"); + setmodel (self, "maps/b_rock0.bsp"); + } + self.weapon = 3; + self.netname = "rockets"; + StartAmmo(); +} + +/*QUAKED item_cells (0 .5 .5) (0 0 0) (32 32 32) BIG ? SUSPENDED +6 ammo points (cells) for the Thunderbolt (Lightning). + +Flags: +"big" gives 12 instead of 6 + +Keys: +"target/2/3/4/k" - entity to trigger when picked up +"targetname" - will not spawn until triggered +"wait" - will respawn after 'wait' seconds. fires targets every time. +"count" - limit number of times to respawn +*/ +/*FGD +@PointClass base(Ammo) + model( + {{ + spawnflags & 1 -> ":maps/b_batt1.bsp", + ":maps/b_batt0.bsp" + }} + ) = + item_cells : "Thunderbolt Ammo, 6/12 cells" [] +*/ +void() item_cells = +{ + if (!SUB_ShouldSpawn()) return; + if (self.spawnflags & ITEM_AMMO_BIG) + { + self.ammo_cells = 12; + precache_model ("maps/b_batt1.bsp"); + setmodel (self, "maps/b_batt1.bsp"); + } + else + { + self.ammo_cells = 6; + precache_model ("maps/b_batt0.bsp"); + setmodel (self, "maps/b_batt0.bsp"); + } + self.weapon = 4; + self.netname = "cells"; + StartAmmo(); +} + + + +// ================================ + + +// still used in a few id maps, bleh +void() item_weapon = +{ + float WEAPON_SHOTGUN = 1; + float WEAPON_ROCKET = 2; + float WEAPON_SPIKES = 4; + float WEAPON_BIG = 8; + + float oldflags; + oldflags = self.spawnflags & 15; + self.spawnflags = not(self.spawnflags, 15); + + if (oldflags & WEAPON_BIG) + self.spawnflags = self.spawnflags | ITEM_AMMO_BIG; + + if (oldflags & WEAPON_SHOTGUN) + item_shells(); + else if (oldflags & WEAPON_SPIKES) + item_spikes(); + else if (oldflags & WEAPON_ROCKET) + item_rockets(); +}; \ No newline at end of file diff --git a/QC_other/QC_copper/items.qc b/QC_other/QC_copper/items.qc new file mode 100644 index 00000000..11e14198 --- /dev/null +++ b/QC_other/QC_copper/items.qc @@ -0,0 +1,900 @@ +/* +============================================================================== + +ITEMS + +items now set a lot of their own values directly rather than expect touch +functions to check classnames + +============================================================================== +*/ + +float ITEM_SUSPENDED = 4; +/*FGD +@baseclass base(Appearflags, Target, Targetname) = Item +[ + message(string) : "Message" + wait(integer) : "Respawn time" : 0 + count(integer) : "Respawn count" : 0 + spawnflags(flags) = + [ + 4 : "Suspended" : 0 + ] +] +*/ + +/* +================================ +ItemFall +================================ +*/ +void() ItemFall = +{ + if (!(self.spawnflags & ITEM_SUSPENDED)) + return; + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_TOSS; + self.velocity = '0 0 1'; + self.spawnflags = not(self.spawnflags, ITEM_SUSPENDED); +} + +/* +================================ +ItemUse + +triggering an item + - if it regenerates, stop regenerating + - if it doesn't, force it to respawn +items which have yet to be spawned have a different .use +================================ +*/ +void() ItemUse = +{ + if (self.wait > 0) + { + self.wait = 0; + self.think = SUB_Remove; // if nextthink is in the future, don't respawn again + return; + } + self.alpha = 1; + ItemPiff(self); + ItemSpawn(); +} + +/* +================================ +ItemPiff +throw some light teledust off an item when it respawns +================================ +*/ +void(entity i) ItemPiff = +{ + vector org; + org = (i.absmin + i.absmax) * 0.5; + org_z = i.absmin_z + 8; + particle(org, '8 8 0', 8, 16); + particle(org, '8 -8 0', 8, 16); + particle(org, '-8 8 0', 8, 16); + particle(org, '-8 -8 0', 8, 16); +} + +/* +================================ +ItemSpawn +================================ +*/ +void() ItemSpawn = +{ + // optimized away .mdl, recycled .wad as only the world uses it + self.model = self.wad; // restore original model + self.solid = SOLID_TRIGGER; // allow it to be touched again + setorigin (self, self.origin); + //ItemFall(); + + + if (self.targetname != string_null && self.use != SUB_regen) + sound (self, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); // play respawn sound + + if (self.wait) + self.use = ItemUse; +} + +/* +================================ +SUB_regen +make the little effect on respawn but not initial spawn - there's too many cases where +I trigger items behind doors so they look like they were always there, and the piff +gives them away +================================ +*/ +void() SUB_regen = {ItemSpawn();} + +/* +================================ +ItemPrespawnFlicker +================================ +*/ +void() ItemPrespawnFlicker = +{ + if (time >= self.attack_finished) + { + self.alpha = 1; + ItemPiff(self); + ItemSpawn(); + return; + } + + // flicker back into place + //self.alpha = (3.5 - (self.attack_finished - time)) / 8 + (1 - mod(self.attack_finished - time, 0.5)) * 0.2; + self.alpha = (0.5 - mod(self.attack_finished - time, 0.5)); + self.nextthink = time + 0.05; +} + +/* +================================ +ItemPrespawn +get ready to respawn by setting up a throbby fadein +================================ +*/ +void() ItemPrespawn = +{ + self.model = self.wad; // restore original model + setorigin(self, self.origin); + + self.think = ItemPrespawnFlicker; + ItemPrespawnFlicker(); +} + +/* +================================ +ItemTouched +================================ +*/ +void() ItemTouched = +{ + // wait > 0 == item respawns, either from deathmatch rules or entity keyvalue + if (self.wait > 0) + { + //self.model = string_null; + self.alpha = 0.2; + self.solid = SOLID_NOT; + + self.think = ItemPrespawn; + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished - 2.45; + } + // wait -1 == respawn every time the item is triggered + else if (self.wait < 0 || self.use == SUB_regen) // maintain old respawn hacks + { + self.model = string_null; + self.solid = SOLID_NOT; + if (self.use != SUB_regen) + self.use = ItemUse; + } + else + { + SUB_RemoveSoon(); + } + + if (self.count > 0) // only respawn 'count' more times + { + self.count = self.count - 1; + if (self.count == 0) + SUB_RemoveSoon(); // can't remove during c touch/movement code + } + + activator = other; + SUB_UseTargets(); +} + + + +/* +================================ +ItemRotateAndSize +jigger the origin and bounds of items with off-center origins so their models +appear in the center of their bboxes using MATHS +================================ +*/ +void() ItemRotateAndSize = +{ + if (self.angles_y == 0) + return; + if (self.mins != '0 0 0') + return; // not a silly corner-bbox item + + vector rot, orgofs; + vector max = self.maxs; + + rot = SinCos(self.angles_y - 135); + rot *= 22.6274; // length of diagonal radius of 32u box + orgofs_x = rot_y + 16; + orgofs_y = rot_x + 16; + orgofs_z = 0; + + setorigin(self, self.origin + orgofs); + setsize(self, orgofs * -1, max - orgofs); +} + +/* +================================ +ItemDrop +plants the object on the floor or sometimes just destroys it completely +================================ +*/ +void() ItemDrop = +{ + float oldz; + self.movetype = MOVETYPE_TOSS; + self.velocity = '0 0 0'; + self.origin_z = self.origin_z + 6; + oldz = self.origin_z; + if (!droptofloor(0, 0)) + { + dprint4(self.classname," fell out of level at ",vtos(self.origin),"\n"); + remove(self); + } +} + +/* +================================ +ItemPlace +work out initial placement based on states +================================ +*/ +void() ItemPlace = +{ + self.flags |= FL_ITEM; // make extra wide + + if (SUB_VerifyTriggerable()) + { // hide them until triggered if triggerable + self.solid = SOLID_NOT; + self.model = string_null; + self.use = ItemSpawn; + } + else + { + self.solid = SOLID_TRIGGER; + SUB_ChangeModel(self,self.wad); + if (self.use != SUB_regen) // map hack back compat + self.use = ItemUse; + } + + if (self.spawnflags & ITEM_SUSPENDED) + { + //dprint("item is suspended\n"); + self.movetype = MOVETYPE_NONE; + } + else + { + ItemDrop(); + } + + ItemRotateAndSize(); // must do this after item_drop, droptofloor is picky about the weird things we do +} + +void() PlaceItem = {ItemPlace();} + + +/* +================================ +StartItem +Sets the clipping size and drops to floor +================================ +*/ +void() StartItem = +{ + // putting this here means items that never appear in the level will precache + // anyway, but this isn't a big deal and I'm lazy + if (!SUB_ShouldSpawn()) return; + + if (!self.type) + self.type = "item"; + + self.wad = self.model; // so it can be restored on respawn + self.model = string_null; + + self.nextthink = time + 0.2; // items start after other solids + self.think = ItemPlace; + + ammo_total += self.ammo_shells * DEBUG_DMG_PER_SHELL + + self.ammo_cells * DEBUG_DMG_PER_CELL + + self.ammo_nails * DEBUG_DMG_PER_NAIL; + num_rockets += self.ammo_rockets; +} + + +/* +=============================================================================== + +DROPPING + +=============================================================================== +*/ + +void(string tname) target_drop_do = +{ + if (tname == string_null) + return; + + entity t; + t = world; + + do { + t = find (t, targetname, tname); + if (!t) break; + + SUB_CallAsSelf(ItemFall, t); + } while (t); +} + +void() target_drop_use = +{ + target_drop_do(self.target); + target_drop_do(self.target2); + target_drop_do(self.target3); + target_drop_do(self.target4); +} + +/*QUAKED target_drop (0.75 0.25 0) (-16 -16 -16) (16 16 16) ? +Causes all targeted items which are SUSPENDED to drop when triggered. +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) size(32 32 32) color(192 64 0) = target_drop : +"Target Drop. Causes all targeted items which are suspended to drop when triggered." [] +*/ +void() target_drop = +{ + if (!SUB_ShouldSpawn()) return; + self.use = target_drop_use; +} + + + +/* +=============================================================================== + +GIVING/TAKING/CHECKING + +=============================================================================== +*/ + +float SPAWN_TGTITEMS_TAKE = 1; +float SPAWN_TGTITEMS_OVERRIDE = 2; +float SPAWN_TGTITEMS_FLASH = 4; +float SPAWN_TGTITEMS_TEST = 8; + +/*FGD +@baseclass = TrigItems [ + svflags(flags) = + [ + 1 : "E1 complete" : 0 + 2 : "E2 complete" : 0 + 4 : "E3 complete" : 0 + 8 : "E4 complete" : 0 + 16 : "Unused" : 0 + 32 : "Unused" : 0 + 64 : "Unused" : 0 + 128 : "Unused" : 0 + ] + items(flags) = + [ + 1 : "Shotgun" : 0 + 2 : "Super Shotgun" : 0 + 4 : "Nailgun" : 0 + 8 : "Perforator" : 0 + 16 : "Grenade Laucher" : 0 + 32 : "Rocket Launcher" : 0 + 64 : "Lightning Gun" : 0 + 4096 : "Axe" : 0 + 131072 : "Silver Key" : 0 + 262144 : "Gold Key" : 0 + 524288 : "Ring" : 0 + 1048576 : "Pent" : 0 + 2097152 : "Biosuit" : 0 + 4194304 : "Quad" : 0 + ] + ammo_shells(integer) : "Shells" : 0 + ammo_nails(integer) : "Nails" : 0 + ammo_rockets(integer) : "Rockets" : 0 + ammo_cells(integer) : "Cells" : 0 + health(integer) : "Health" : 0 + armorvalue(integer) : "Armor" : 0 +] +*/ +void(entity e) target_items_setweapon = +{ + if (self.weapon) + { + if (self.weapon & e.items) + e.weapon = self.weapon; + } + if (!(e.weapon & e.items)) + SUB_CallAsSelf(W_SelectBestWeapon, e); +} + + +void(entity e) target_items_giveinv = +{ + if (self.health) + T_Heal(e, self.health, TRUE); + + if (self.armorvalue) + armor_give(e, zeroconvert(self.armorvalue), FALSE); + + if (self.ammo_shells) e.ammo_shells += zeroconvert(self.ammo_shells); + if (self.ammo_nails) e.ammo_nails += zeroconvert(self.ammo_nails); + if (self.ammo_rockets) e.ammo_rockets += zeroconvert(self.ammo_rockets); + if (self.ammo_cells) e.ammo_cells += zeroconvert(self.ammo_cells); + bound_ammo(e); + + if (self.svflags) + serverflags |= zeroconvert(self.svflags); + + if (self.items) + { + float it = zeroconvert(self.items); + + if (it & IT_WEAPONS) + e.items |= it & IT_WEAPONS; + + // set artifact timers properly + if (it & IT_INVISIBILITY) + powerup_invisibility(e, self.length); + if (it & IT_INVULNERABILITY) + powerup_invulnerability(e, self.length); + if (it & IT_SUIT) + powerup_envirosuit(e, self.length); + if (it & IT_QUAD) + powerup_super_damage(e, self.length); + + if (it & IT_KEY1) + key_give_silver(e); + if (it & IT_KEY2) + key_give_gold(e); + + target_items_setweapon(e); + } +} + +float(entity e) target_items_testinv = +{ + if (self.health > 0 && self.health > e.health) return FALSE; + if (self.armorvalue && self.armorvalue > e.armorvalue) return FALSE; + + if (self.svflags) + { + float sf = zeroconvert(self.svflags); + if (sf & serverflags != sf) return FALSE; + } + + + if (self.ammo_shells && self.ammo_shells > e.ammo_shells) return FALSE; + if (self.ammo_nails && self.ammo_nails > e.ammo_nails) return FALSE; + if (self.ammo_rockets && self.ammo_rockets > e.ammo_rockets) return FALSE; + if (self.ammo_cells && self.ammo_cells > e.ammo_cells) return FALSE; + + if (self.items) + { + float it = zeroconvert(self.items); + if (it & e.items != it) return FALSE; + } + + return TRUE; +} + +float(entity e) target_items_takeinv = +{ + if (!target_items_testinv(e)) return FALSE; + + if (self.health > 0) + { + e.health = max(0, e.health - self.health); + if (e.health <= 0) + Killed(e, self); + } + + if (self.armorvalue) + { + e.armorvalue = max(0, e.armorvalue - self.armorvalue); + armor_set_type(e); + } + + if (self.svflags) + { + float sf = zeroconvert(self.svflags); + serverflags = not(serverflags, sf); + } + + + if (self.ammo_shells) + { + e.ammo_shells = max(0, e.ammo_shells - zeroconvert(self.ammo_shells)); + } + if (self.ammo_nails) + { + e.ammo_nails = max(0, e.ammo_nails - zeroconvert(self.ammo_nails)); + } + if (self.ammo_rockets) + { + e.ammo_rockets = max(0, e.ammo_rockets - zeroconvert(self.ammo_rockets)); + } + if (self.ammo_cells) + { + e.ammo_cells = max(0, e.ammo_cells - zeroconvert(self.ammo_cells)); + } + + if (self.items) + { + float it = zeroconvert(self.items); + + if (it & IT_WEAPONS) + e.items = not(e.items, it & IT_WEAPONS); + + // set artifact timers properly + if (it & IT_INVISIBILITY) + { + e.items = not(e.items, it & IT_INVISIBILITY); + e.invisible_finished = 0; + e.invisible_time = 0; + } + + if (it & IT_INVULNERABILITY) + { + e.items = not(e.items, it & IT_INVULNERABILITY); + e.invincible_finished = 0; + e.invincible_time = 0; + } + + if (it & IT_SUIT) + { + e.items = not(e.items, it & IT_SUIT); + e.radsuit_finished = 0; + e.rad_time = 0; + } + + if (it & IT_QUAD) + { + e.items = not(e.items, it & IT_QUAD); + e.super_damage_finished = 0; + e.super_time = 0; + } + + if (!(e.items & (IT_INVISIBILITY | IT_INVULNERABILITY | IT_QUAD))) + e.effects = not(e.effects, EF_DIMLIGHT); + + if (it & IT_KEY1) + key_take_silver(e); + if (it & IT_KEY2) + key_take_gold(e); + + target_items_setweapon(e); + } + + return TRUE; +} + + +void(entity e) target_items_setinv = +{ + if (self.health > 0) + e.health = self.health; + + if (self.armorvalue) + { + e.armorvalue = zeroconvert(self.armorvalue); + armor_set_type(e); + } + + if (self.svflags) + { + serverflags = zeroconvert(self.svflags); + } + + + if (self.ammo_shells) e.ammo_shells = zeroconvert(self.ammo_shells); + if (self.ammo_nails) e.ammo_nails = zeroconvert(self.ammo_nails); + if (self.ammo_rockets) e.ammo_rockets = zeroconvert(self.ammo_rockets); + if (self.ammo_cells) e.ammo_cells = zeroconvert(self.ammo_cells); + bound_ammo(e); + + if (self.items) + { + float it = zeroconvert(self.items); + + if (it & IT_WEAPONS) + e.items = not(e.items, IT_WEAPONS) + (it & IT_WEAPONS); + + // set artifact timers properly + if (it & IT_INVISIBILITY) + powerup_invisibility(e, self.length); + else + { + e.items = not(e.items, IT_INVISIBILITY); + e.invisible_finished = 0; + e.invisible_time = 0; + } + + if (it & IT_INVULNERABILITY) + powerup_invulnerability(e, self.length); + else + { + e.items = not(e.items, IT_INVULNERABILITY); + e.invincible_finished = 0; + e.invincible_time = 0; + } + + if (it & IT_SUIT) + powerup_envirosuit(e, self.length); + else + { + e.items = not(e.items, IT_SUIT); + e.radsuit_finished = 0; + e.rad_time = 0; + } + + if (it & IT_QUAD) + powerup_super_damage(e, self.length); + else + { + e.items = not(e.items, IT_QUAD); + e.super_damage_finished = 0; + e.super_time = 0; + } + + if (!(e.items & (IT_INVISIBILITY | IT_INVULNERABILITY | IT_QUAD))) + e.effects = not(e.effects, EF_DIMLIGHT); + + e.items = not(e.items, IT_KEY1 | IT_KEY2); + e.worldtype = 0; + if (it & IT_KEY1) + key_give_silver(e); + if (it & IT_KEY2) + key_give_gold(e); + + target_items_setweapon(e); + } +} + + +void() target_items_use = +{ + entity act = activator; + if (act.classname != "player") return; + + if (self.spawnflags & SPAWN_TGTITEMS_OVERRIDE) + { + target_items_setinv(act); + } + else if (self.spawnflags & SPAWN_TGTITEMS_TEST) + { + // TAKE reverses the polarity of TEST, so that it only tests if you don't + // have all the specified inventory + if (target_items_testinv(act) != !!(self.spawnflags & SPAWN_TGTITEMS_TAKE)) + { + activator = act; + SUB_UseTargets(); + } + else + SUB_PrintMessage(); + return; + } + else if (self.spawnflags & SPAWN_TGTITEMS_TAKE) + { + if (target_items_takeinv(act)) + { + if (self.spawnflags & SPAWN_TGTITEMS_FLASH) + stuffcmd(act, "bf\n"); + activator = act; + SUB_UseTargets(); + } + else + SUB_PrintMessage(); + return; + } + else + { + target_items_giveinv(act); + } + if (self.spawnflags & SPAWN_TGTITEMS_FLASH) + stuffcmd(act, "bf\n"); + activator = act; +} + +/*QUAKED target_items (0.75 0.25 0) (-8 -8 -8) (8 8 8) TAKE OVERRIDE FLASH TEST +Gives weapons, ammo, items, health, armor, and/or runes to the activating player when triggered. + +Keyvalues: +"ammo_shells" number of shells player should receive - same for _cells, _rockets, and _nails +"health" health (will overheal beyond 100) +"armorvalue" armor (protection color scales automatically) +"weapon" item bitflag (not impulse number!) of the weapon the player should swap to (if he has it) +"items" bitmask of what items the player should get (see below for reference) +"svflags" bitmask of serverflags to alter (1/2/4/8 are the episode runes, 16+ are invisible) +"length" length of powerup time in seconds if any are given (default 30) + +Spawnflags: +TAKE: subtract specified inventory amounts instead of adding + - subtracting enough health WILL kill the player + - subtracting all weapons WILL break the game + - will fire its targets if all items are successfully taken + - will print "message" if fewer than all items are successfully taken +OVERRIDE: force the player's inventory to all specified amounts (mainly useful triggered from spawnpoints), specify -1 for any keyvalue to force a 0 (-1 does not work for items or health) +FLASH: flash the recipient's screen when triggered, defaults to being stealthy +TEST: behaves like TAKE, but doesn't take anything + - fires targets if activator has the matching inventory + - prints "message" if not + - TEST with TAKE will reverse the test (fire if player doesn't have) + - beware of how this interacts with triggers: it will only test the first client to touch a trigger in coop! + +Item Bitmask Reference: + SG = 1 SSG = 2 + NG = 4 SNG = 8 + GL = 16 RL = 32 + LG = 64 Axe = 4096 + + Silver = 131072 + Gold = 262144 + Ring = 524288 + Pent = 1048576 + Biosuit = 2097152 + Quad = 4194304 +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname, TrigItems, Deathtype) size(32 32 32) color(192 64 0) = target_items : +"Target: Give. Gives weapons, ammo, items, health, armor, and/or runes to the activating player when triggered. + +Usage: +TAKE: subtract specified inventory amounts instead of adding + - subtracting enough health WILL kill the player + - subtracting all weapons WILL break the game + - will fire its targets if all items are successfully taken + - will print 'message' if fewer than all items are successfully taken +OVERRIDE: force the player's inventory to all specified amounts (mainly useful triggered from spawnpoints), specify -1 for any keyvalue to force a 0 (-1 does not work for items or health) +TEST: behaves like TAKE, but doesn't take anything + - fires targets if activator has the matching inventory + - prints 'message' if not + - TEST with TAKE will reverse the test (fire if player doesn't have) + - beware of how this interacts with triggers: it will only test the first client to touch a trigger in coop!" +[ + length(integer) : "Override powerup duration" : 0 + message(string) : "Message to print if Take was unsuccessful" + spawnflags(flags) = + [ + 1 : "Take instead" : 0 + 2 : "Override instead" : 0 + 4 : "Flash screen" : 0 + 8 : "Test only" : 0 + ] + weapon(choices) : "Force Select Weapon" = + [ + 0 : "Don't" + 1 : "Shotgun" + 2 : "Super Shotgun" + 4 : "Nailgun" + 8 : "Perforator" + 16 : "Grenade Laucher" + 32 : "Rocket Launcher" + 64 : "Lightning Gun" + 4096 : "Axe" + ] +] +*/ +void() target_items = +{ + if (!SUB_ShouldSpawn()) return; + self.use = target_items_use; + + if (self.length <= 0) + self.length = 30; + if (self.deathtype == string_null) + self.deathtype = "had his life removed"; + + if (self.items > 0) + { + // clear the item flags that are only for HUD switches so we can be sloppy with .items later + self.items = not(self.items, IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | + IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3 ); + + if (self.items & IT_INVISIBILITY) + precache_invisibility(); + if (self.items & IT_INVULNERABILITY) + precache_invulnerability(); + if (self.items & IT_SUIT) + precache_envirosuit(); + if (self.items & IT_QUAD) + precache_super_damage(); + } +} +void() target_give = {target_items();} + + +// ========================================================== + +void() trigger_inventory_touch = +{ + // for multiple coop clients touching this at once + if (time != self.dmgtime) + if (time < self.attack_finished) + return; + + if (self.wait > 0) + { + self.attack_finished = time + self.wait; + } + else + { + self.attack_finished = time + 1; + self.think = SUB_Remove; + self.nextthink = time + 0.1; + } + + // the trigger has to test every client touching this frame until one passes, then stop testing + // but set attack_finished to the next wait interval either way + if (target_items_testinv(other) != !!(self.spawnflags & 2)) + { + multi_trigger(); + self.dmgtime = 0; // stop checking clients + return; + } + SUB_PrintMessage(); + self.dmgtime = time; +} + +/*QUAKED trigger_inventory (.5 .0 .5) ? ? INVERSE TRIGGER_FIRST +Variable sized trigger. Triggers only if the player's current inventory or stats match what's specified by trigger_inventory - this follows the same rules as target_items in TEST mode. Will test all touching clients in a given frame until one passes the test. + +Flags: +"inverse" reverse polarity of the test (fire only if player doesn't have specified inventory) +"trigger_first" won't be touchable until triggered once by something else + +Keys: +"message" message to display if inventory test fails (ie triggers do NOT fire) +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav +"target" entity to trigger (required) +"targetname" entity name + +Inventory stuff: +"ammo_shells" number of shells player should have - same for _cells, _rockets, and _nails +"health" health minimum +"armorvalue" armor minumum +"items" bitmask of what items the player should have (see below for reference) +"svflags" bitmask of serverflags that must be set (1/2/4/8 are the episode runes, 16+ are invisible) + +Item Bitmask Reference: + SG = 1 SSG = 2 + NG = 4 SNG = 8 + GL = 16 RL = 32 + LG = 64 Axe = 4096 + + Silver = 131072 + Gold = 262144 + Ring = 524288 + Pent = 1048576 + Biosuit = 2097152 + Quad = 4194304 + +*/ +/*FGD +@SolidClass base(Trigger, TrigItems) = trigger_inventory : "Trigger: Activate if inventory matches" [ + spawnflags(Flags) = [ + 2 : "Activate if !match" : 0 + 4 : "Trigger first" : 0 + ] +] +*/ +void() trigger_inventory = +{ + if(!SUB_ShouldSpawn()) return; + InitTrigger(); + if (!self.wait) self.wait = 0.2; + self.touch = trigger_inventory_touch; +} \ No newline at end of file diff --git a/QC_other/QC_copper/lights.qc b/QC_other/QC_copper/lights.qc new file mode 100644 index 00000000..2bfea885 --- /dev/null +++ b/QC_other/QC_copper/lights.qc @@ -0,0 +1,579 @@ +// +// ================================================================ +// +// Setup light animation tables. 'a' is total darkness, 'z' is maxbright. + // you know what's cool? arrays. +// 0 normal +string light0 = "m"; +// 1 FLICKER (first variety) +string light1 = "mmnmmommommnonmmonqnmmo"; +// 2 SLOW STRONG PULSE +string light2 = "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"; +// 3 CANDLE (first variety) +string light3 = "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"; +// 4 FAST STROBE +string light4 = "mamamamamama"; +// 5 GENTLE PULSE 1 +string light5 = "jklmnopqrstuvwxyzyxwvutsrqponmlkj"; +// 6 FLICKER (second variety) +string light6 = "nmonqnmomnmomomno"; +// 7 CANDLE (second variety) +string light7 = "mmmaaaabcdefgmmmmaaaammmaamm"; +// 8 CANDLE (third variety) +string light8 = "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"; +// 9 SLOW STROBE (fourth variety) +string light9 = "aaaaaaaazzzzzzzz"; +// 10 FLUORESCENT FLICKER +string light10 = "mmamammmmammamamaaamammma"; +// 11 SLOW PULSE TO BLACK +string light11 = "abcdefghijklmnopqrrqponmlkjihgfedcba"; +// styles 32-62 are assigned by the light program for switchable lights + +string light_off = "a"; + + +/*FGD +@baseclass base() color(255 255 40) size(-8 -8 -8, 8 8 8) = Light [ + light(integer) : "Brightness" : 300 + _color(string) : "Color" : "1 1 1" + wait(integer) : "Fade distance multiplier" : 1 + mangle(string) : "Spotlight aim (yaw pitch roll, neg. pitch is down)" + angle(integer) : "Spotlight cone angle" + _softangle(integer) : "Spotlight inner cone angle" + _dirt(integer) : "Override dirt" + message(string) : "override the style string directly for the assigned style (clashes will overwrite each other)" + delay(choices) : "Attenuation" = + [ + 0 : "Linear falloff (Default)" + 1 : "Inverse distance falloff" + 2 : "Inverse distance squared" + 3 : "No falloff" + 4 : "Local minlight" + 5 : "Inverse distance squared B" + ] + style(Choices) : "Appearance" : 0 = + [ + 0 : "Normal" + 10: "Fluorescent flicker (mmnmmommommnonmmonqnmmo)" + 2 : "Slow, strong pulse (abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba)" + 11: "Slow pulse, black (abcdefghijklmnopqrrqponmlkjihgfedcba)" + 5 : "Gentle pulse, noblac (jklmnopqrstuvwxyzyxwvutsrqponmlkj)" + 1 : "Flicker A (mmnmmommommnonmmonqnmmo)" + 6 : "Flicker B (nmonqnmomnmomomno)" + 3 : "Candle A (mmmmmaaaaammmmmaaaaaabcdefgabcdefg)" + 7 : "Candle B (mmmaaaabcdefgmmmmaaaammmaamm)" + 8 : "Candle C (mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa)" + 4 : "Fast strobe (mamamamamama)" + 9 : "Slow strobe (aaaaaaaazzzzzzzz)" + ] +] +@baseclass base(Light, Targetname) = LightTriggerable [ + oldstyle(integer) : "Switchable light's 'on' style" + spawnflags(flags) = [ + 1 : "Start off" : 0 + ] +] +*/ + +// +// ================================================================ +// + +string( float st ) GetLightStyle = +{ + if (st == 1) return light1; + if (st == 2) return light2; + if (st == 3) return light3; + if (st == 4) return light4; + if (st == 5) return light5; + if (st == 6) return light6; + if (st == 7) return light7; + if (st == 8) return light8; + if (st == 9) return light9; + if (st == 10) return light10; + if (st == 11) return light11; +/* if (st == 12) return light12; + if (st == 13) return light13; + if (st == 14) return light14; + if (st == 15) return light15; + if (st == 16) return light16; + if (st == 17) return light17; + if (st == 18) return light18;*/ + + if (icantsee) + return "z"; + return light0; +} + +void() InitLightStyles = +{ + lightstyle(0, light0); + lightstyle(1, light1); + lightstyle(2, light2); + lightstyle(3, light3); + lightstyle(4, light4); + lightstyle(5, light5); + lightstyle(6, light6); + lightstyle(7, light7); + lightstyle(8, light8); + lightstyle(9, light9); + lightstyle(10, light10); + lightstyle(11, light11); +/* lightstyle(12, light12); + lightstyle(13, light13); + lightstyle(14, light14); + lightstyle(15, light15); + lightstyle(16, light16); + lightstyle(17, light17); + lightstyle(18, light18);*/ + + // 63 testing + //lightstyle(63, "a"); +} + +void() light_use = +{ + //dprint("light_use\n"); + if (self.spawnflags & START_OFF) + { + if (self.message != string_null) + lightstyle(self.style, self.message); + else + lightstyle(self.style, GetLightStyle(self.oldstyle)); + self.spawnflags = self.spawnflags - START_OFF; + //dprint("turning light on\n"); + } + else + { + lightstyle(self.style, light_off); + self.spawnflags = self.spawnflags | START_OFF; + //dprint("turning light off\n"); + } +} + +// Lights with "count" will gradually change brightness each time they're triggered, reaching normal brightness or complete darkness after 'count' triggers. +void() light_inc_use = +{ + local float bright; + + if (self.spawnflags & START_OFF) + { + if (self.cnt == self.count) return; + self.cnt = self.cnt + 1; + } + else + { + if (self.cnt == 0) return; + self.cnt = self.cnt - 1; + } + + // you know what's cool? arrays. + bright = floor( (self.cnt / self.count) * 13); + if (bright >= 13) lightstyle(self.style, "m"); + else if (bright == 12) lightstyle(self.style, "l"); + else if (bright == 11) lightstyle(self.style, "k"); + else if (bright == 10) lightstyle(self.style, "j"); + else if (bright == 9 ) lightstyle(self.style, "i"); + else if (bright == 8 ) lightstyle(self.style, "h"); + else if (bright == 7 ) lightstyle(self.style, "g"); + else if (bright == 6 ) lightstyle(self.style, "f"); + else if (bright == 5 ) lightstyle(self.style, "e"); + else if (bright == 4 ) lightstyle(self.style, "d"); + else if (bright == 3 ) lightstyle(self.style, "c"); + else if (bright == 2 ) lightstyle(self.style, "b"); + else if (bright <= 1 ) lightstyle(self.style, "a"); +} + +/*QUAKED light (0 .75 0) (-8 -8 -8) (8 8 8) start_off +Non-displayed light. If targeted, it will toggle between on or off. + +"start_off" starts off until triggered + +Keys: +"light" sets brightness (default: 300) +"targetname" entity name +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"oldstyle" make a targeted light switchable between that style and off. +"message" override the style string directly for the assigned style (clashes will overwrite each other) +*/ +/*FGD +@PointClass base(LightTriggerable) = light : "Invisible light source" [] +*/ +void() light = +{ + if (self.message != string_null) + { + if (self.oldstyle > 11) + lightstyle(self.oldstyle, self.message); + else if (self.style > 11) + lightstyle(self.style, self.message); + else + dprint5("WARNING: light at ", vtos(self.origin), " with message ", self.message, " but no style # set\n"); + } + + if (self.targetname == string_null) + { // inert light + remove(self); + return; + } + + if (self.style >= 32) + { + if (self.count > 0) + { + self.use = light_inc_use; + if (self.spawnflags & START_OFF) + { + lightstyle(self.style, light_off); + self.cnt = 0; + } + else + { + lightstyle(self.style, GetLightStyle(self.oldstyle)); + self.cnt = self.count; + } + return; + } + + self.use = light_use; + if (self.spawnflags & START_OFF) + lightstyle(self.style, light_off); + else + lightstyle(self.style, GetLightStyle(self.oldstyle)); + } +} + +//============================================================================ + +/*QUAKED light_fluoro (1 1 0) (-8 -8 -8) (8 8 8) START_OFF +Non-displayed light. Makes steady fluorescent humming sound. + +Flags: +"start_off" starts off until triggered + +Keys: +"light" sets brightness (default: 300) +"targetname" entity name +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"oldstyle" make a targeted light switchable between that style and off. +"message" override the style string directly for the assigned style (clashes will overwrite each other) +*/ +/*FGD +@PointClass base(LightTriggerable) = light_fluoro : "Humming fluorescent light source" [] +*/ +void() light_fluoro = +{ + if (self.style >= 32) + { + self.use = light_use; + if (self.spawnflags & START_OFF) + lightstyle(self.style, "a"); + else + lightstyle(self.style, "m"); + } + + precache_sound ("ambience/fl_hum1.wav"); + ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); +} + +/*QUAKED light_fluorospark (1 1 0) (-8 -8 -8) (8 8 8) +Non-displayed light. Default style is 10. Makes sparking, broken fluorescent sound. + +Keys: +"light" sets brightness (default: 300) +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"message" override the style string directly for the assigned style (clashes will overwrite each other) +*/ +/*FGD +@PointClass base(Light) = light_fluorospark : "Sparking flickering light source" [] +*/ +void() light_fluorospark = +{ + if (!self.style) + self.style = 10; + + precache_sound ("ambience/buzz1.wav"); + ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC); +} + +/*QUAKED light_globe (1 1 0) (-8 -8 -8) (8 8 8) +Sphere globe light. Can't be triggered. + +Keys: +"light" sets brightness (default: 300) +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"message" override the style string directly for the assigned style (clashes will overwrite each other) +*/ +/*FGD +@PointClass base(Light) = light_globe : "Globe light" [] +*/ +void() light_globe = +{ + precache_model ("progs/s_light.spr"); + setmodel (self, "progs/s_light.spr"); + makestatic (self); +} + +void() FireAmbient = +{ + if (self.spawnflags & 2) return; // silent spawnflag + precache_sound ("ambience/fire1.wav"); +// attenuate fast + ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC); +} + +/*QUAKED light_torch_small_walltorch (1 1 0) (-4 -4 -12) (4 4 20) +Short wall torch. Makes crackly torch sound. + +Flags: +"start_off" starts off until triggered + +Keys: +"light" sets brightness (default: 300) +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"message" override the style string directly for the assigned style (clashes will overwrite each other) +*/ +/*FGD +@PointClass base(Light) size(-4 -4 -12, 4 4 20) model({ "path": ":progs/flame.mdl" }) = + light_torch_small_walltorch : "Small walltorch" [] +*/ +void() light_torch_small_walltorch = +{ + precache_model ("progs/flame.mdl"); + setmodel (self, "progs/flame.mdl"); + FireAmbient (); + makestatic (self); +} + +/*QUAKED light_flame_large_yellow (1 1 0) (-8 -8 -12) (8 8 20) +Large yellow flame ball. Makes crackly torch sound. + +Flags: +"start_off" starts off until triggered + +Keys: +"light" sets brightness (default: 300) +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"message" override the style string directly for the assigned style (clashes will overwrite each other) + +*/ +/*FGD +@PointClass base(Light) size(-8 -8 -12, 8 8 20) model({ "path": ":progs/flame2.mdl" }) = + light_flame_large_yellow : "Large yellow flame" [] +*/ +void() light_flame_large_yellow = +{ + precache_model ("progs/flame2.mdl"); + setmodel (self, "progs/flame2.mdl"); + self.frame = 1; + FireAmbient (); + makestatic (self); +} + +/*QUAKED light_flame_small_yellow (1 1 0) (-4 -4 -12) (4 4 20) +Small yellow flame ball. Makes crackly torch sound. + +Keys: +"light" sets brightness (default: 300) +"mangle" spotlight direction - the first # is yaw, 0 to 360 around Z. second # is pitch, 90 up to -90 down. +"angle" spotlight cone size +"_softangle" spotlight inner cone size +"wait" scale the falloff distance. N>1 will shorten range, n<1 will extend it +"delay" attenuation formula + 0 = Linear, original id (default) + 1 = 1/x attenuation formula + 2 = 1/(x^2) attenuation formula + 3 = No attenuation (light stays same brightness at any distance) +"_color" "# # #" 0-255 +"style" + 0 = normal + 1 = flicker: "mmnmmommommnonmmonqnmmo" + 2 = slow strong pulse: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" + 3 = candle: "mmmmmaaaaammmmmaaaaaabcdefgabcdefg" + 4 = fast strobe: "mamamamamama" + 5 = slow pulse, no black: "jklmnopqrstuvwxyzyxwvutsrqponmlkj" + 6 = flicker: "nmonqnmomnmomomno" + 7 = candle: "mmmaaaabcdefgmmmmaaaammmaamm" + 8 = candle2: "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa" + 9 = slow strobe: "aaaaaaaazzzzzzzz" + 10 = flourescent flicker: mmamammmmammamamaaamammma" + 11 = slow pulse, fading to black: "abcdefghijklmnopqrrqponmlkjihgfedcba" + + styles 32-62 are assigned by the light program for switchable lights + (default: 0) +"message" override the style string directly for the assigned style (clashes will overwrite each other) + +*/ +/*FGD +@PointClass base(Light) size(-4 -4 -12, 4 4 20) model({ "path": ":progs/flame2.mdl" }) = + light_flame_small_yellow : "Small yellow flame" [] +*/ +void() light_flame_small_yellow = +{ + precache_model ("progs/flame2.mdl"); + setmodel (self, "progs/flame2.mdl"); + FireAmbient (); + makestatic (self); +} + +/*QUAKED light_flame_small_white (1 1 0) (-4 -4 -12) (4 4 20) +Same as light_flame_small_yellow. Use that one. +*/ +/*FGD +@PointClass base(Light) size(-4 -4 -12, 4 4 20) model({ "path": ":progs/flame2.mdl" }) = + light_flame_small_white : "Small white flame (same as light_flame_small_yellow)" [] +*/ +void() light_flame_small_white = +{ + light_flame_small_yellow(); +} diff --git a/QC_other/QC_copper/m_boss.qc b/QC_other/QC_copper/m_boss.qc new file mode 100644 index 00000000..7cfb280e --- /dev/null +++ b/QC_other/QC_copper/m_boss.qc @@ -0,0 +1,442 @@ +/* +============================================================================== + +BOSS-ONE + +============================================================================== +*/ +$cd id1/models/boss1 +$origin 0 0 -15 +$base base +$skin skin +$scale 5 + +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +void() boss_face = +{ + +// go for another player if multi player + if (self.enemy.health <= 0 || random() < 0.02) + { + self.enemy = find(self.enemy, classname, "player"); + if (!self.enemy) + self.enemy = find(self.enemy, classname, "player"); + } + ai_face(); +} + +void() boss_rise1 =[ $rise1, boss_rise2 ] { +sound (self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM); +} +void() boss_rise2 =[ $rise2, boss_rise3 ] { +sound (self, CHAN_VOICE, "boss1/sight1.wav", 1, ATTN_NORM); +} +void() boss_rise3 =[ $rise3, boss_rise4 ] {} +void() boss_rise4 =[ $rise4, boss_rise5 ] {} +void() boss_rise5 =[ $rise5, boss_rise6 ] {} +void() boss_rise6 =[ $rise6, boss_rise7 ] {} +void() boss_rise7 =[ $rise7, boss_rise8 ] {} +void() boss_rise8 =[ $rise8, boss_rise9 ] {} +void() boss_rise9 =[ $rise9, boss_rise10 ] {} +void() boss_rise10 =[ $rise10, boss_rise11 ] {} +void() boss_rise11 =[ $rise11, boss_rise12 ] {} +void() boss_rise12 =[ $rise12, boss_rise13 ] {} +void() boss_rise13 =[ $rise13, boss_rise14 ] {} +void() boss_rise14 =[ $rise14, boss_rise15 ] {} +void() boss_rise15 =[ $rise15, boss_rise16 ] {} +void() boss_rise16 =[ $rise16, boss_rise17 ] {} +void() boss_rise17 =[ $rise17, boss_missile1 ] {} + +void() boss_idle1 =[ $walk1, boss_idle2 ] +{ +// look for other players +} +void() boss_idle2 =[ $walk2, boss_idle3 ] {boss_face();} +void() boss_idle3 =[ $walk3, boss_idle4 ] {boss_face();} +void() boss_idle4 =[ $walk4, boss_idle5 ] {boss_face();} +void() boss_idle5 =[ $walk5, boss_idle6 ] {boss_face();} +void() boss_idle6 =[ $walk6, boss_idle7 ] {boss_face();} +void() boss_idle7 =[ $walk7, boss_idle8 ] {boss_face();} +void() boss_idle8 =[ $walk8, boss_idle9 ] {boss_face();} +void() boss_idle9 =[ $walk9, boss_idle10 ] {boss_face();} +void() boss_idle10 =[ $walk10, boss_idle11 ] {boss_face();} +void() boss_idle11 =[ $walk11, boss_idle12 ] {boss_face();} +void() boss_idle12 =[ $walk12, boss_idle13 ] {boss_face();} +void() boss_idle13 =[ $walk13, boss_idle14 ] {boss_face();} +void() boss_idle14 =[ $walk14, boss_idle15 ] {boss_face();} +void() boss_idle15 =[ $walk15, boss_idle16 ] {boss_face();} +void() boss_idle16 =[ $walk16, boss_idle17 ] {boss_face();} +void() boss_idle17 =[ $walk17, boss_idle18 ] {boss_face();} +void() boss_idle18 =[ $walk18, boss_idle19 ] {boss_face();} +void() boss_idle19 =[ $walk19, boss_idle20 ] {boss_face();} +void() boss_idle20 =[ $walk20, boss_idle21 ] {boss_face();} +void() boss_idle21 =[ $walk21, boss_idle22 ] {boss_face();} +void() boss_idle22 =[ $walk22, boss_idle23 ] {boss_face();} +void() boss_idle23 =[ $walk23, boss_idle24 ] {boss_face();} +void() boss_idle24 =[ $walk24, boss_idle25 ] {boss_face();} +void() boss_idle25 =[ $walk25, boss_idle26 ] {boss_face();} +void() boss_idle26 =[ $walk26, boss_idle27 ] {boss_face();} +void() boss_idle27 =[ $walk27, boss_idle28 ] {boss_face();} +void() boss_idle28 =[ $walk28, boss_idle29 ] {boss_face();} +void() boss_idle29 =[ $walk29, boss_idle30 ] {boss_face();} +void() boss_idle30 =[ $walk30, boss_idle31 ] {boss_face();} +void() boss_idle31 =[ $walk31, boss_idle1 ] {boss_face();} + +void() boss_missile1 =[ $attack1, boss_missile2 ] {boss_face();} +void() boss_missile2 =[ $attack2, boss_missile3 ] {boss_face();} +void() boss_missile3 =[ $attack3, boss_missile4 ] {boss_face();} +void() boss_missile4 =[ $attack4, boss_missile5 ] {boss_face();} +void() boss_missile5 =[ $attack5, boss_missile6 ] {boss_face();} +void() boss_missile6 =[ $attack6, boss_missile7 ] {boss_face();} +void() boss_missile7 =[ $attack7, boss_missile8 ] {boss_face();} +void() boss_missile8 =[ $attack8, boss_missile9 ] {boss_missile('100 -100 200');} +void() boss_missile9 =[ $attack9, boss_missile10 ] {boss_face();} +void() boss_missile10 =[ $attack10, boss_missile11 ] {boss_face();} +void() boss_missile11 =[ $attack11, boss_missile12 ] {boss_face();} +void() boss_missile12 =[ $attack12, boss_missile13 ] {boss_face();} +void() boss_missile13 =[ $attack13, boss_missile14 ] {boss_face();} +void() boss_missile14 =[ $attack14, boss_missile15 ] {boss_face();} +void() boss_missile15 =[ $attack15, boss_missile16 ] {boss_face();} +void() boss_missile16 =[ $attack16, boss_missile17 ] {boss_face();} +void() boss_missile17 =[ $attack17, boss_missile18 ] {boss_face();} +void() boss_missile18 =[ $attack18, boss_missile19 ] {boss_face();} +void() boss_missile19 =[ $attack19, boss_missile20 ] {boss_missile('100 100 200');} +void() boss_missile20 =[ $attack20, boss_missile21 ] {boss_face();} +void() boss_missile21 =[ $attack21, boss_missile22 ] {boss_face();} +void() boss_missile22 =[ $attack22, boss_missile23 ] {boss_face();} +void() boss_missile23 =[ $attack23, boss_missile1 ] {boss_face();} + +void() boss_shocka1 =[ $shocka1, boss_shocka2 ] {} +void() boss_shocka2 =[ $shocka2, boss_shocka3 ] {} +void() boss_shocka3 =[ $shocka3, boss_shocka4 ] {} +void() boss_shocka4 =[ $shocka4, boss_shocka5 ] {} +void() boss_shocka5 =[ $shocka5, boss_shocka6 ] {} +void() boss_shocka6 =[ $shocka6, boss_shocka7 ] {} +void() boss_shocka7 =[ $shocka7, boss_shocka8 ] {} +void() boss_shocka8 =[ $shocka8, boss_shocka9 ] {} +void() boss_shocka9 =[ $shocka9, boss_shocka10 ] {} +void() boss_shocka10 =[ $shocka10, boss_missile1 ] {} + +void() boss_shockb1 =[ $shockb1, boss_shockb2 ] {} +void() boss_shockb2 =[ $shockb2, boss_shockb3 ] {} +void() boss_shockb3 =[ $shockb3, boss_shockb4 ] {} +void() boss_shockb4 =[ $shockb4, boss_shockb5 ] {} +void() boss_shockb5 =[ $shockb5, boss_shockb6 ] {} +void() boss_shockb6 =[ $shockb6, boss_shockb7 ] {} +void() boss_shockb7 =[ $shockb1, boss_shockb8 ] {} +void() boss_shockb8 =[ $shockb2, boss_shockb9 ] {} +void() boss_shockb9 =[ $shockb3, boss_shockb10 ] {} +void() boss_shockb10 =[ $shockb4, boss_missile1 ] {} + +void() boss_shockc1 =[ $shockc1, boss_shockc2 ] {} +void() boss_shockc2 =[ $shockc2, boss_shockc3 ] {} +void() boss_shockc3 =[ $shockc3, boss_shockc4 ] {} +void() boss_shockc4 =[ $shockc4, boss_shockc5 ] {} +void() boss_shockc5 =[ $shockc5, boss_shockc6 ] {} +void() boss_shockc6 =[ $shockc6, boss_shockc7 ] {} +void() boss_shockc7 =[ $shockc7, boss_shockc8 ] {} +void() boss_shockc8 =[ $shockc8, boss_shockc9 ] {} +void() boss_shockc9 =[ $shockc9, boss_shockc10 ] {} +void() boss_shockc10 =[ $shockc10, boss_death1 ] {} + +void() boss_death1 = [$death1, boss_death2] { +sound (self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM); +} +void() boss_death2 = [$death2, boss_death3] {} +void() boss_death3 = [$death3, boss_death4] {} +void() boss_death4 = [$death4, boss_death5] {} +void() boss_death5 = [$death5, boss_death6] {} +void() boss_death6 = [$death6, boss_death7] {} +void() boss_death7 = [$death7, boss_death8] {} +void() boss_death8 = [$death8, boss_death9] {} +void() boss_death9 = [$death9, boss_death10] +{ + // moved kill count here to break boss_death10 killcount hack, as it was only + // used to fix the rotfish killcount bug (iw) + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + + sound (self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +} + +void() boss_death10 = [$death9, boss_death10] +{ + activator = self.enemy; + SUB_UseTargets (); + remove (self); +} + +void() boss_missile_touch = +{ + sound(self, CHAN_VOICE, "misc/null.wav", 0.5, ATTN_STATIC); + sound(self, CHAN_WEAPON, "misc/null.wav", 0.5, ATTN_STATIC); + sound(self, CHAN_BODY, "misc/null.wav", 0.5, ATTN_STATIC); + T_MissileTouch(); +} + +void(float chan) boss_lavahiss = +{ + float r = random(); + if (r < 0.25) + sound(self, chan + 1, "weapons/lavabal1.wav", 1, ATTN_STATIC); + else if (r < 0.5) + sound(self, chan + 1, "weapons/lavabal2.wav", 1, ATTN_STATIC); + else if (r < 0.75) + sound(self, chan + 1, "weapons/lavabal3.wav", 1, ATTN_STATIC); + else + sound(self, chan + 1, "weapons/lavabal4.wav", 1, ATTN_STATIC); +} + +void() boss_missile_think = +{ + self.state = cycle(self.state, 3); + boss_lavahiss(self.state); + self.nextthink = time + 0.1; +} + +void(vector p) boss_missile = +{ + vector org, vec, dir; + entity missile; + float hard, spd, lead; + + org = self.origin + p_x*v_forward + p_y*v_right + p_z * '0 0 1'; + + // accelerate the projectile danger with each phase + hard = (1 - (self.health+self.armorvalue)/self.max_health); + spd = 300 + 200 * hard; + + // lead the player on hard mode + lead = skill * 0.333; + lead = lead * lead + 0.05 * hard; + if (self.enemy.teleport_time > time) // don't instantly snipe the player the moment he teleports in + dir = normalize(enemy_vispos() - org); + else + dir = LeadTarget(org, spd, min(lead, 0.8)); + + vec = normalize (dir); + + missile = launch_lavamissile (org, vec*spd); + missile.avelocity = '200 100 300'; + missile.dmg = 100; + missile.think = boss_missile_think; + missile.nextthink = time; + missile.touch = boss_missile_touch; + sound (self, CHAN_WEAPON, "boss1/throw.wav", 1, ATTN_NORM); + + // check for dead enemy + if (self.enemy.health <= 0) + boss_idle1 (); +} + + +void() boss_awake = +{ + self.type = "boss"; // so nobody gets mad at us + self.classname = "monster_boss"; // map hack back compat + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_NO; + + setmodel (self, "progs/boss.mdl"); + setsize (self, '-128 -128 -24', '128 128 256'); + + if (skill == 0) + self.health = 1; + else + self.health = 3; + self.max_health = self.health + self.armorvalue; // for hacked takedamage cthons + + self.enemy = activator; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + self.yaw_speed = 20; + boss_rise1 (); +} + + +/*QUAKED monster_boss (1 0 0) (-128 -128 -24) (128 128 256) +*/ +/*FGD +@PointClass base(Angle, Appearflags, Target, Targetname, Deathtype) size(-128 -128 -24, 128 128 256) color(0 0 220) model({ "path": ":progs/boss.mdl" }) = monster_boss : "Chthon" [] +*/ +void() monster_boss = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/boss.mdl"); + precache_model ("progs/lavaball.mdl"); + + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("weapons/lavabal1.wav"); + precache_sound ("weapons/lavabal2.wav"); + precache_sound ("weapons/lavabal3.wav"); + precache_sound ("weapons/lavabal4.wav"); + precache_sound ("boss1/out1.wav"); + precache_sound ("boss1/sight1.wav"); + precache_sound ("misc/power.wav"); + precache_sound ("boss1/throw.wav"); + precache_sound ("boss1/pain.wav"); + precache_sound ("boss1/death.wav"); + + if (self.deathtype == string_null) + self.deathtype = "was owned by Chthon"; + + total_monsters = total_monsters + 1; + + self.type = "boss"; // so nobody gets mad at us + self.use = boss_awake; +} + +//=========================================================================== + +void() lightning_fire = +{ + vector p1, p2; + entity le1, le2; + + le1 = self.buddy; + le2 = le1.buddy; + + if (time >= self.attack_finished) + { // done here, put the terminals back up + activator = self.enemy; + SUB_CallAsSelf(door_go_down, le1); + SUB_CallAsSelf(door_go_down, le2); + return; + } + + p1 = (le1.mins + le1.maxs) * 0.5; + p1_z = le1.absmin_z - 8; + + p2 = (le2.mins + le2.maxs) * 0.5; + p2_z = le2.absmin_z - 8; + + // compensate for length of bolt + p2 = p2 - normalize(p2-p1)*100; + + self.nextthink = time + 0.1; + self.think = lightning_fire; + + WriteByte (MSG_ALL, SVC_TEMPENTITY); + WriteByte (MSG_ALL, TE_LIGHTNING3); + WriteEntity (MSG_ALL, world); + WriteCoord (MSG_ALL, p1_x); + WriteCoord (MSG_ALL, p1_y); + WriteCoord (MSG_ALL, p1_z); + WriteCoord (MSG_ALL, p2_x); + WriteCoord (MSG_ALL, p2_y); + WriteCoord (MSG_ALL, p2_z); +} + +void() lightning_use = +{ + entity le1, le2; + + if (self.attack_finished >= time + 1) + return; + + le1 = find( world, target, "lightning"); + le2 = find( le1, target, "lightning"); + if (!le1 || !le2) + { + dprint ("missing lightning targets\n"); + return; + } + + self.buddy = le1; + le1.buddy = le2; + + if ((le1.state != le2.state) || + (le1.state != STATE_TOP && le1.state != STATE_BOTTOM) || + (le2.state != STATE_TOP && le2.state != STATE_BOTTOM) ) + { +// dprint ("not aligned\n"); + return; + } + +// don't let the electrodes go back up until the bolt is done + le1.nextthink = -1; + le2.nextthink = -1; + self.attack_finished = time + 1; + + self.enemy = activator; + sound (self, CHAN_VOICE, "misc/power.wav", 1, ATTN_NORM); + lightning_fire (); + + if (le1.state == STATE_TOP && le2.state == STATE_TOP) + SUB_UseTargets(); + + // advance the boss pain if down + self = find (world, classname, "monster_boss"); + if (!self) + return; + if (le1.state == STATE_TOP && self.health > 0) + { + sound (self, CHAN_VOICE, "boss1/pain.wav", 1, ATTN_NORM); + self.health = self.health - 1; + if (self.health >= 2) + boss_shocka1(); + else if (self.health == 1) + boss_shockb1(); + else if (self.health == 0) + boss_shockc1(); + } + +} + + +/*QUAKED event_lightning (0 1 1) (-16 -16 -16) (16 16 16) +Just for boss level. Fires targets on a successful zap. +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) = + event_lightning : "Chthon lightning. Fires targets on a successful zap." [] +*/ +void() event_lightning = +{ + if (!SUB_ShouldSpawn()) return; + precache_sound ("misc/power.wav"); //lightning for boss + + self.use = lightning_use; +} + + + diff --git a/QC_other/QC_copper/m_demon.qc b/QC_other/QC_copper/m_demon.qc new file mode 100644 index 00000000..1fb61551 --- /dev/null +++ b/QC_other/QC_copper/m_demon.qc @@ -0,0 +1,525 @@ +/* +============================================================================== + +DEMON + +============================================================================== +*/ + +$cd id1/models/demon3 +$scale 0.8 +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +$frame run1 run2 run3 run4 run5 run6 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 +$frame leap11 leap12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 +$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 + +//============================================================================ + +float DEMON_LEAP_HVEL = 600; +float DEMON_LEAP_VVEL = 250; + +void() demon1_stand1 =[ $stand1, demon1_stand2 ] {ai_stand();} +void() demon1_stand2 =[ $stand2, demon1_stand3 ] {ai_stand();} +void() demon1_stand3 =[ $stand3, demon1_stand4 ] {ai_stand();} +void() demon1_stand4 =[ $stand4, demon1_stand5 ] {ai_stand();} +void() demon1_stand5 =[ $stand5, demon1_stand6 ] {ai_stand();} +void() demon1_stand6 =[ $stand6, demon1_stand7 ] {ai_stand();} +void() demon1_stand7 =[ $stand7, demon1_stand8 ] {ai_stand();} +void() demon1_stand8 =[ $stand8, demon1_stand9 ] {ai_stand();} +void() demon1_stand9 =[ $stand9, demon1_stand10 ] {ai_stand();} +void() demon1_stand10 =[ $stand10, demon1_stand11 ] {ai_stand();} +void() demon1_stand11 =[ $stand11, demon1_stand12 ] {ai_stand();} +void() demon1_stand12 =[ $stand12, demon1_stand13 ] {ai_stand();} +void() demon1_stand13 =[ $stand13, demon1_stand1 ] {ai_stand();} + +void() demon1_walk1 =[ $walk1, demon1_walk2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "demon/idle1.wav", 1, ATTN_IDLE); +ai_walk(8); +} +void() demon1_walk2 =[ $walk2, demon1_walk3 ] {ai_walk(6);} +void() demon1_walk3 =[ $walk3, demon1_walk4 ] {ai_walk(6);} +void() demon1_walk4 =[ $walk4, demon1_walk5 ] {ai_walk(7);} +void() demon1_walk5 =[ $walk5, demon1_walk6 ] {ai_walk(4);} +void() demon1_walk6 =[ $walk6, demon1_walk7 ] {ai_walk(6);} +void() demon1_walk7 =[ $walk7, demon1_walk8 ] {ai_walk(10);} +void() demon1_walk8 =[ $walk8, demon1_walk1 ] {ai_walk(10);} + +// ai_run already concluded we can't leap, but make sure we can't just run up some stairs +float() DemonCheckCharge = +{ + // check for mad charge + if (!enemy_vis) + return FALSE; + if (time < self.attack_finished) + return FALSE; + + vector edir = self.origin - self.enemy.origin; + if ( fabs(edir_z) > vlen(edir) / 2) + return FALSE; // too much height change + + if ( range(self.enemy) == RANGE_MELEE ) + return FALSE; // defer to regular attack + + // charge + ai_attack_finished (0.5); + demon1_charge1 (); + return TRUE; +} + +void() demon1_run1 =[ $run1, demon1_run2 ] { + if (random() < 0.2) + sound (self, CHAN_VOICE, "demon/idle1.wav", 1, ATTN_IDLE); + ai_run(20); + DemonCheckCharge(); +} +void() demon1_run2 =[ $run2, demon1_run3 ] {ai_run(15);} +void() demon1_run3 =[ $run3, demon1_run4 ] {ai_run(36);} +void() demon1_run4 =[ $run4, demon1_run5 ] {ai_run(20);} +void() demon1_run5 =[ $run5, demon1_run6 ] {ai_run(15);} +void() demon1_run6 =[ $run6, demon1_run1 ] {ai_run(36);} + +void() demon1_charge1 =[ $run1, demon1_charge2 ] {ai_rush(20);DemonCheckAttack();} +void() demon1_charge2 =[ $run2, demon1_charge3 ] {ai_rush(15);DemonCheckAttack();} +void() demon1_charge3 =[ $run3, demon1_charge4 ] {ai_rush(36);DemonCheckAttack();} +void() demon1_charge4 =[ $run4, demon1_charge5 ] {ai_rush(20);DemonCheckAttack();} +void() demon1_charge5 =[ $run5, demon1_charge6 ] {ai_rush(15);DemonCheckAttack();} +void() demon1_charge6 =[ $run6, demon1_run1 ] {ai_rush(36);DemonCheckAttack();} + + +void() demon1_pain1 =[ $pain1, demon1_pain2 ] {} +void() demon1_pain2 =[ $pain2, demon1_pain3 ] {} +void() demon1_pain3 =[ $pain3, demon1_pain4 ] {} +void() demon1_pain4 =[ $pain4, demon1_pain5 ] {} +void() demon1_pain5 =[ $pain5, demon1_pain6 ] {} +void() demon1_pain6 =[ $pain6, demon1_run1 ] {} + +void(entity attacker, float damage) demon1_pain = +{ + if (self.touch == Demon_JumpTouch) + { + return; + } + + if (self.pain_finished > time) + return; + + PainFinished(1); + sound (self, CHAN_VOICE, "demon/dpain1.wav", 1, ATTN_NORM); + + if (random()*200 > damage) + return; // didn't flinch + + demon1_pain1 (); +} + +void() demon1_die1 =[ $death1, demon1_die2 ] { +sound (self, CHAN_VOICE, "demon/ddeath.wav", 1, ATTN_NORM);} +void() demon1_die2 =[ $death2, demon1_die3 ] {} +void() demon1_die3 =[ $death3, demon1_die4 ] {} +void() demon1_die4 =[ $death4, demon1_die5 ] {self.solid = SOLID_NOT;} +void() demon1_die5 =[ $death5, demon1_die6 ] {} +void() demon1_die6 =[ $death6, demon1_die7 ] {} +void() demon1_die7 =[ $death7, demon1_die8 ] {} +void() demon1_die8 =[ $death8, demon1_die9 ] {} +void() demon1_die9 =[ $death9, demon1_die9 ] {} + +void() demon_die = +{ + if (self.health < -80) + { + Gib ("progs/h_demon.mdl", self.health); + return; + } + demon1_die1 (); +} + + +//============================================================================ + +void() demon1_jumpabort =[ $leap10, demon1_jump11 ] {} + +void() demon1_jump1 =[ $leap1, demon1_jump2 ] +{ + ai_face(); + ai_attack_finished(0.2); + sound (self, CHAN_VOICE, "demon/djump.wav", 1, ATTN_NORM); + //bprint(" djump\n"); +} +void() demon1_jump2 =[ $leap2, demon1_jump3 ] {ai_face();} +void() demon1_jump3 =[ $leap3, demon1_jump4 ] {ai_face();} +void() demon1_jump4 =[ $leap4, demon1_jump5 ] +{ + ai_face(); + + self.touch = Demon_JumpTouch; + //self.origin_z = self.origin_z + 1; + + makevectors (self.angles); + self.velocity = v_forward * DEMON_LEAP_HVEL + VEC_UP * DEMON_LEAP_VVEL; + if (!CheckDemonJumpPath(v_forward)) + { + self.velocity *= 0.5; + } + self.flags = not(self.flags, FL_ONGROUND); +} +void() demon1_jump5 =[ $leap5, demon1_jump6 ] {} +void() demon1_jump6 =[ $leap6, demon1_jump7 ] {} +void() demon1_jump7 =[ $leap7, demon1_jump8 ] {} +void() demon1_jump8 =[ $leap8, demon1_jump9 ] {} +void() demon1_jump9 =[ $leap9, demon1_jump10 ] {} +void() demon1_jump10 =[ $leap10, demon1_airthink ] { + self.oldorigin = self.origin; + self.lifetime_finished = time + 3; +} +void() demon1_jump11 =[ $leap11, demon1_jump12 ] {} +void() demon1_jump12 =[ $leap12, demon1_run1 ] {ai_face();} + + +void() demon1_airthink = +{ + self.think = demon1_airthink; + self.nextthink = time + 0.1; + + // if three seconds pass, assume demon is stuck and jump again + if (time >= self.lifetime_finished) + { + demon1_jump1(); + return; + } + // we aren't moving, assume leap is over so we don't get stuck with our arms up + if (self.origin == self.oldorigin && self.flags & FL_ONGROUND) + { + demon1_jump11(); + return; + } + self.oldorigin = self.origin; +} + +/* +============== +Demon_JumpSweep + +do a bunch of traces along the jump vector to ensure the takeoff path is clear, +so we don't deflect off doorways and stairs and bounce around like an idiot +============== +*/ +float(vector dir) Demon_JumpSweep = +{ + vector corner, wmins; + + // early out check first from origin + traceline(self.origin, self.origin+dir, TRUE, self); + if (trace_fraction < 1) + return FALSE; + + float x, y, z; + wmins = self.origin + self.mins + VEC_UP; // one unit off the ground + for (x=0; x<=1; x+=1) for (y=0; y<=1; y+=1) for (z=0; z<=1; z+=1) + { + corner = wmins + vec_scale(self.size, Vector(x, y, z)); + traceline(corner, corner+dir, TRUE, self); + if (trace_fraction < 1 || trace_startsolid || trace_allsolid ) + { + if (fabs(trace_plane_normal * normalize(dir)) < 0.2) // player and fiend are both along a wall + continue; + return FALSE; + } + } + + return TRUE; +} + + +float(vector attack) CheckDemonJumpPath = +{ + vector dir; + float sweeptime = 0.25; + + dir = normalize(attack) * DEMON_LEAP_HVEL * sweeptime; + dir_z = DEMON_LEAP_VVEL * sweeptime; + + if (Demon_JumpSweep(dir)) return TRUE; + + return FALSE; +} + + +/* +============== +CheckDemonJump +============== +*/ +float() CheckDemonJump = +{ + vector dist;//, d_right; + float d; + + if (!(self.flags & FL_ONGROUND)) + return FALSE; + + // enemy too low, will go overhead + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + 0.75 * self.enemy.size_z) + return FALSE; + + // enemy too high + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + 0.5 * self.enemy.size_z) + return FALSE; + + dist = self.enemy.origin - self.origin; + dist_z = 0; + + + d = vlen(dist); + + if (d < 100) + return FALSE; + + if (d > 360 && random() < 0.9) + return FALSE; + + if (!CheckDemonJumpPath(dist)) + { + // check on either side of player for possible glancing blows + // d_right = CrossProduct(normalize(dist), '0 0 1') * 32; + // if (random() < 0.5) d_right *= -1; + // if (!CheckDemonJumpPath(dist + d_right)) + // if (!CheckDemonJumpPath(dist - d_right)) + return FALSE; + } + + return TRUE; +} + + + +void() Demon_JumpTouchGround = +{ + // FL_ONGROUND: in contact with a horizontal surface (cos < 0.7) in any way, always set by SV_Phys after impact + // if we're not touching anything horizontal it's not the ground so we don't care + if (!(self.flags & FL_ONGROUND)) return; + + self.touch = SUB_Null; + + // checkbottom: false if any corners are more than a step's height above the surface beneath + if (checkbottom(self)) // safely on ground + { + demon1_jump11(); + return; + } + + // jump randomly to not get hung up + self.think = demon1_jump1; + self.nextthink = time + 0.1; +} + +void() Demon_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) + return; + + if (other.takedamage) + { + if ( vlen(self.velocity) > 300 ) + { + if (other.classname != "player" || time > self.touch_time) // fix for landing on the player's head + { + if (other.classname == "player") + { + self.touch_time = time + 0.2; + } + ldmg = 40 + 10 * random(); + T_Damage(other, self, self, ldmg); // fiend leap counts as a ranged attack + } + } + } + + Demon_JumpTouchGround(); +} + +//=========================================================================== + +void() demon1_atta1 =[ $attacka1, demon1_atta2 ] {ai_charge(4);} +void() demon1_atta2 =[ $attacka2, demon1_atta3 ] {ai_charge(0);} +void() demon1_atta3 =[ $attacka3, demon1_atta4 ] {ai_charge(0);} +void() demon1_atta4 =[ $attacka4, demon1_atta5 ] {ai_charge(1);} +void() demon1_atta5 =[ $attacka5, demon1_atta6 ] {ai_charge(2); Demon_Melee(200);} +void() demon1_atta6 =[ $attacka6, demon1_atta7 ] {ai_charge(1);} +void() demon1_atta7 =[ $attacka7, demon1_atta8 ] {ai_charge(6);} +void() demon1_atta8 =[ $attacka8, demon1_atta9 ] {ai_charge(8);} +void() demon1_atta9 =[ $attacka9, demon1_atta10] {ai_charge(4);} +void() demon1_atta10 =[ $attacka10, demon1_atta11] {ai_charge(2);} +void() demon1_atta11 =[ $attacka11, demon1_atta12] {Demon_Melee(-200);} +void() demon1_atta12 =[ $attacka12, demon1_atta13] {ai_charge(5);} +void() demon1_atta13 =[ $attacka13, demon1_atta14] {ai_charge(8);} +void() demon1_atta14 =[ $attacka14, demon1_atta15] {ai_charge(4);} +void() demon1_atta15 =[ $attacka15, demon1_run1] +{ + ai_charge(4); + enemy_range = range(self.enemy); + if (CheckDemonMelee()) self.think = demon1_atta1; // skip the one flash of run1, it makes the feet jump +} + +/* +============== +CheckDemonMelee + +Returns TRUE if a melee attack would hit right now +============== +*/ +float() CheckDemonMelee = +{ + if ( enemy_range > RANGE_MELEE || // can't reach + self.enemy.health <= 0 || // is dead + self.enemy.customflags & CFL_PLUNGE || // will be dead + !CanDamage(self.enemy,self) ) // can't hit + return FALSE; + return TRUE; +} + +void(float side) Demon_Melee = +{ + local float ldmg; + local vector delta; + + ai_face (); + walkmove (self.ideal_yaw, 12); // allow a little closing + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 100) + return; + if (!CanDamage (self.enemy, self)) + return; + + sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); + ldmg = 10 + 5*random(); + T_DamageMelee (self.enemy, self, ldmg); + + makevectors (self.angles); + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); +} + +//=========================================================================== + +float() DemonCheckAttack = +{ + if (time < self.attack_finished) return FALSE; + + if (!CheckClearAttack()) + return FALSE; + + // if close enough for slashing, go for it + if (CheckDemonMelee ()) + { + self.attack_state = AS_MELEE; + return TRUE; + } + + if (CheckDemonJump ()) + { + self.attack_state = AS_MISSILE; + return TRUE; + } + + return FALSE; +} + + + + +void() monster_demon_spawn = +{ + self.classname = "monster_demon1"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/demon.mdl"); + + //setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + setsize (self, VEC_HULL2_MIN, '32 32 40'); + self.health = 300; + + self.yaw_speed = 30; + self.customflags |= CFL_MELEEONLY; + + self.th_stand = demon1_stand1; + self.th_walk = demon1_walk1; + self.th_run = demon1_run1; + self.th_die = demon_die; + self.th_melee = demon1_atta1; + self.th_missile = demon1_jump1; + self.th_pain = demon1_pain; + self.th_checkattack = DemonCheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was eviscerated by a Fiend"; + + walkmonster_start(); +} + +void() monster_demon_spawner = {mon_spawner_use(monster_demon_spawn);} + +/*QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Fiend (Demon), 300 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model({ "path": ":progs/demon.mdl" }) = monster_demon1 : "Fiend" [] +*/ +void() monster_demon1 = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/demon.mdl"); + precache_model ("progs/h_demon.mdl"); + + precache_sound ("demon/ddeath.wav"); + precache_sound ("demon/dhit2.wav"); + precache_sound ("demon/djump.wav"); + precache_sound ("demon/dpain1.wav"); + precache_sound ("demon/idle1.wav"); + precache_sound ("demon/sight2.wav"); + precache_sound ("misc/null.wav"); + + self.health = 300; + setsize (self, VEC_HULL2_MIN, '32 32 40'); + if ( monster_spawnsetup( monster_demon_spawner ) ) return; + + addmonster(1); + monster_demon_spawn(); +} diff --git a/QC_other/QC_copper/m_dog.qc b/QC_other/QC_copper/m_dog.qc new file mode 100644 index 00000000..db08621e --- /dev/null +++ b/QC_other/QC_copper/m_dog.qc @@ -0,0 +1,411 @@ +/* +============================================================================== + +DOG + +============================================================================== +*/ +$cd id1/models/dog +$origin 0 0 24 +$base base +$skin skin + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +/* +================ +dog_bite + +================ +*/ +void() dog_bite = +{ + vector delta; + + if (!self.enemy) + return; + + ai_charge(10); + + if (!CanDamage (self.enemy, self)) + return; + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 100) + return; + + T_DamageMelee (self.enemy, self, 8 + random() * 8); +} + +void() Dog_JumpTouchGround = +{ + if (!checkbottom(self)) + { + if (self.flags & FL_ONGROUND) + { // jump randomly to not get hung up + self.touch = SUB_Null; + self.think = dog_leap1; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = dog_run1; + self.nextthink = time + 0.1; +} + +void() Dog_JumpTouch = +{ + if (self.health <= 0) + return; + + if (other.classname != "monster_dog" && // pack dogs whose bboxes brush each other during leaps wind up killing each other + other.takedamage) + { + if ( vlen(self.velocity) > 300 ) + { + if (other.classname != "player" || time > self.touch_time) // fix for landing on the player's head + { + if (other.classname == "player") + { + self.touch_time = time + 0.2; + } + T_DamageMelee (other, self, 10 + 10*random()); + } + } + } + Dog_JumpTouchGround(); +} + +void() dog_airthink = +{ + self.think = dog_airthink; + self.nextthink = time + 0.1; + + // if three seconds pass, assume dog is stuck and jump again + if (time >= self.lifetime_finished) + { + dog_leap1(); + return; + } + // we aren't moving, assume leap is over so we don't get stuck + if (self.origin == self.oldorigin && self.flags & FL_ONGROUND) + { + dog_run1(); + return; + } + self.oldorigin = self.origin; +} + +void() dog_stand1 =[ $stand1, dog_stand2 ] {ai_stand();} +void() dog_stand2 =[ $stand2, dog_stand3 ] {ai_stand();} +void() dog_stand3 =[ $stand3, dog_stand4 ] {ai_stand();} +void() dog_stand4 =[ $stand4, dog_stand5 ] {ai_stand();} +void() dog_stand5 =[ $stand5, dog_stand6 ] {ai_stand();} +void() dog_stand6 =[ $stand6, dog_stand7 ] {ai_stand();} +void() dog_stand7 =[ $stand7, dog_stand8 ] {ai_stand();} +void() dog_stand8 =[ $stand8, dog_stand9 ] {ai_stand();} +void() dog_stand9 =[ $stand9, dog_stand1 ] {ai_stand();} + +void() dog_walk1 =[ $walk1 , dog_walk2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); +ai_walk(8);} +void() dog_walk2 =[ $walk2 , dog_walk3 ] {ai_walk(8);} +void() dog_walk3 =[ $walk3 , dog_walk4 ] {ai_walk(8);} +void() dog_walk4 =[ $walk4 , dog_walk5 ] {ai_walk(8);} +void() dog_walk5 =[ $walk5 , dog_walk6 ] {ai_walk(8);} +void() dog_walk6 =[ $walk6 , dog_walk7 ] {ai_walk(8);} +void() dog_walk7 =[ $walk7 , dog_walk8 ] {ai_walk(8);} +void() dog_walk8 =[ $walk8 , dog_walk1 ] {ai_walk(8);} + +void() dog_run1 =[ $run1 , dog_run2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); +ai_run(16);} +void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(32);} +void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);} +void() dog_run4 =[ $run4 , dog_run5 ] {ai_run(20);} +void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);} +void() dog_run6 =[ $run6 , dog_run7 ] {ai_run(32);} +void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(16);} +void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);} +void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);} +void() dog_run10 =[ $run10 , dog_run11 ] {ai_run(20);} +void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);} +void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);} + +void() dog_atta1 =[ $attack1, dog_atta2 ] {ai_charge(10);} +void() dog_atta2 =[ $attack2, dog_atta3 ] {ai_charge(10);} +void() dog_atta3 =[ $attack3, dog_atta4 ] {ai_charge(10);} +void() dog_atta4 =[ $attack4, dog_atta5 ] { +sound (self, CHAN_VOICE, "dog/dattack1.wav", 1, ATTN_NORM); +dog_bite();} +void() dog_atta5 =[ $attack5, dog_atta6 ] {ai_charge(10);} +void() dog_atta6 =[ $attack6, dog_atta7 ] {ai_charge(10);} +void() dog_atta7 =[ $attack7, dog_atta8 ] {ai_charge(10);} +void() dog_atta8 =[ $attack8, dog_run1 ] {ai_charge(10);} + +void() dog_leap1 =[ $leap1, dog_leap2 ] {ai_face();} +void() dog_leap2 =[ $leap2, dog_leap3 ] +{ + ai_face(); + ai_attack_finished(0.2); + if (self.flags & FL_ONGROUND || self.velocity_z == 0) + { + + makevectors (self.angles); + self.flags = not(self.flags, FL_ONGROUND); + self.velocity = v_forward * 300 + '0 0 200'; + self.touch = Dog_JumpTouch; + } +} +void() dog_leap3 =[ $leap3, dog_leap4 ] {} +void() dog_leap4 =[ $leap4, dog_leap5 ] {} +void() dog_leap5 =[ $leap5, dog_leap6 ] {} +void() dog_leap6 =[ $leap6, dog_leap7 ] {} +void() dog_leap7 =[ $leap7, dog_leap8 ] {} +void() dog_leap8 =[ $leap8, dog_leap9 ] {} +void() dog_leap9 =[ $leap9, dog_airthink] { + self.oldorigin = self.origin; + self.lifetime_finished = time + 1; +} + +void() dog_pain1 =[ $pain1 , dog_pain2 ] {} +void() dog_pain2 =[ $pain2 , dog_pain3 ] {} +void() dog_pain3 =[ $pain3 , dog_pain4 ] {} +void() dog_pain4 =[ $pain4 , dog_pain5 ] {} +void() dog_pain5 =[ $pain5 , dog_pain6 ] {} +void() dog_pain6 =[ $pain6 , dog_run1 ] {} + +void() dog_painb1 =[ $painb1 , dog_painb2 ] {} +void() dog_painb2 =[ $painb2 , dog_painb3 ] {} +void() dog_painb3 =[ $painb3 , dog_painb4 ] {ai_pain(4);} +void() dog_painb4 =[ $painb4 , dog_painb5 ] {ai_pain(12);} +void() dog_painb5 =[ $painb5 , dog_painb6 ] {ai_pain(12);} +void() dog_painb6 =[ $painb6 , dog_painb7 ] {ai_pain(2);} +void() dog_painb7 =[ $painb7 , dog_painb8 ] {} +void() dog_painb8 =[ $painb8 , dog_painb9 ] {ai_pain(4);} +void() dog_painb9 =[ $painb9 , dog_painb10 ] {} +void() dog_painb10 =[ $painb10 , dog_painb11 ] {ai_pain(10);} +void() dog_painb11 =[ $painb11 , dog_painb12 ] {} +void() dog_painb12 =[ $painb12 , dog_painb13 ] {} +void() dog_painb13 =[ $painb13 , dog_painb14 ] {} +void() dog_painb14 =[ $painb14 , dog_painb15 ] {} +void() dog_painb15 =[ $painb15 , dog_painb16 ] {} +void() dog_painb16 =[ $painb16 , dog_run1 ] {} + +void(entity attacker, float damage) dog_pain = +{ + sound (self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM); + + if (random() > 0.5) + dog_pain1 (); + else + dog_painb1 (); +} + +void() dog_die1 =[ $death1, dog_die2 ] {} +void() dog_die2 =[ $death2, dog_die3 ] {} +void() dog_die3 =[ $death3, dog_die4 ] { self.solid = SOLID_NOT; } +void() dog_die4 =[ $death4, dog_die5 ] {} +void() dog_die5 =[ $death5, dog_die6 ] {} +void() dog_die6 =[ $death6, dog_die7 ] {} +void() dog_die7 =[ $death7, dog_die8 ] {} +void() dog_die8 =[ $death8, dog_die9 ] {} +void() dog_die9 =[ $death9, dog_die9 ] {} + +void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {} +void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {} +void() dog_dieb3 =[ $deathb3, dog_dieb4 ] { self.solid = SOLID_NOT;} +void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {} +void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {} +void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {} +void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {} +void() dog_dieb8 =[ $deathb8, dog_dieb9 ] {} +void() dog_dieb9 =[ $deathb9, dog_dieb9 ] {} + + +void() dog_die = +{ +// check for gib + if (self.health < -35) + { + Gib ("progs/h_dog.mdl", self.health); + return; + } + +// regular death + sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); + + if (random() > 0.5) + dog_die1 (); + else + dog_dieb1 (); +} + +//============================================================================ + +/* +============== +CheckDogMelee + +Returns TRUE if a melee attack would hit right now +============== +*/ +float() CheckDogMelee = +{ + if (enemy_range == RANGE_MELEE) + { // FIXME: check canreach + self.attack_state = AS_MELEE; + return TRUE; + } + return FALSE; +} + +/* +============== +CheckDogJump +============== +*/ +float() CheckDogJump = +{ + local vector dist; + local float d; + + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) + return FALSE; + + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) + return FALSE; + + dist = self.enemy.origin - self.origin; + dist_z = 0; + + d = vlen(dist); + + if (d < 80) + return FALSE; + + if (d > 150) + return FALSE; + + return TRUE; +} + +float() DogCheckAttack = +{ +// if close enough for slashing, go for it + if (CheckDogMelee ()) + { + self.attack_state = AS_MELEE; + return TRUE; + } + + if (CheckDogJump ()) + { + self.attack_state = AS_MISSILE; + return TRUE; + } + + return FALSE; +} + + +//=========================================================================== + + +void() monster_dog_spawn = +{ + self.classname = "monster_dog"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/dog.mdl"); + + setsize (self, '-32 -32 -24', '32 32 40'); + self.health = 35; + self.customflags |= CFL_MELEEONLY; + + self.th_stand = dog_stand1; + self.th_walk = dog_walk1; + self.th_run = dog_run1; + self.th_pain = dog_pain; + self.th_die = dog_die; + self.th_melee = dog_atta1; + self.th_missile = dog_leap1; + self.th_checkattack = DogCheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was mauled by a Rottweiler"; + + walkmonster_start(); +} + +void() monster_dog_spawner = {mon_spawner_use(monster_dog_spawn);} + +/*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Dog (Rottweiler), 25 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-32 -32 -24, 32 32 40) model({ "path": ":progs/dog.mdl" }) = monster_dog : "Rottweiler" [] +*/ +void() monster_dog = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/h_dog.mdl"); + precache_model ("progs/dog.mdl"); + + precache_sound ("dog/dattack1.wav"); + precache_sound ("dog/ddeath.wav"); + precache_sound ("dog/dpain1.wav"); + precache_sound ("dog/dsight.wav"); + precache_sound ("dog/idle.wav"); + + self.health = 35; + setsize (self, '-32 -32 -24', '32 32 40'); + if ( monster_spawnsetup( monster_dog_spawner ) ) return; + + addmonster(1); + monster_dog_spawn(); +} diff --git a/QC_other/QC_copper/m_enforcer.qc b/QC_other/QC_copper/m_enforcer.qc new file mode 100644 index 00000000..917d3826 --- /dev/null +++ b/QC_other/QC_copper/m_enforcer.qc @@ -0,0 +1,389 @@ +/* +============================================================================== + +ENFORCER + +============================================================================== +*/ + +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 + +vector() enforcer_muzzle_org = +{ + vector vec, right; + vec = normalize(enemy_vispos() - self.origin); + right = CrossProduct(vec, '0 0 1'); + + return (self.origin + vec * 24 + right * 6 + '0 0 16'); +} + +float() enforcer_clear_attack = +{ + vector spot1, spot2; + + if (self.enemy.invisible_finished > time) return TRUE; // blast away + + spot1 = enforcer_muzzle_org(); + spot2 = enemy_vispos() + self.enemy.view_ofs; + + traceline2(spot1, spot2, self, TRACE_WATER); + + if (trace_inopen && trace_inwater) return FALSE; // sight line crossed contents + if (trace_ent != self.enemy) return FALSE; // don't have a clear shot + return TRUE; +} + +float() enforcer_check_attack = +{ + float chance; + + if (time < self.attack_finished) return FALSE; + if (enemy_range >= RANGE_FAR) return FALSE; + if (!enforcer_clear_attack()) return FALSE; + + if (enemy_range == RANGE_MELEE) + { + chance = 0.9; + self.attack_finished = 0; + } + else if (enemy_range == RANGE_NEAR) + chance = 0.4; + else if (enemy_range == RANGE_MID) + chance = 0.2; + else + chance = 0; + + if (random() < chance) + { + self.th_missile (); + ai_attack_finished (2*random()); + return TRUE; + } + + return FALSE; +} + +void() enforcer_fire = +{ + vector org, vec; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + org = enforcer_muzzle_org(); + vec = normalize(enemy_vispos() - org); + + launch_laser(org, vec * 600); +} + +//============================================================================ + +void() enf_stand1 =[ $stand1, enf_stand2 ] {ai_stand();} +void() enf_stand2 =[ $stand2, enf_stand3 ] {ai_stand();} +void() enf_stand3 =[ $stand3, enf_stand4 ] {ai_stand();} +void() enf_stand4 =[ $stand4, enf_stand5 ] {ai_stand();} +void() enf_stand5 =[ $stand5, enf_stand6 ] {ai_stand();} +void() enf_stand6 =[ $stand6, enf_stand7 ] {ai_stand();} +void() enf_stand7 =[ $stand7, enf_stand1 ] {ai_stand();} + +void() enf_walk1 =[ $walk1 , enf_walk2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE); +ai_walk(2);} +void() enf_walk2 =[ $walk2 , enf_walk3 ] {ai_walk(4);} +void() enf_walk3 =[ $walk3 , enf_walk4 ] {ai_walk(4);} +void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3);} +void() enf_walk5 =[ $walk5 , enf_walk6 ] {ai_walk(1);} +void() enf_walk6 =[ $walk6 , enf_walk7 ] {ai_walk(2);} +void() enf_walk7 =[ $walk7 , enf_walk8 ] {ai_walk(2);} +void() enf_walk8 =[ $walk8 , enf_walk9 ] {ai_walk(1);} +void() enf_walk9 =[ $walk9 , enf_walk10 ] {ai_walk(2);} +void() enf_walk10 =[ $walk10, enf_walk11 ] {ai_walk(4);} +void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);} +void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);} +void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);} +void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);} +void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);} +void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);} + +void() enf_run1 =[ $run1 , enf_run2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "enforcer/idle1.wav", 1, ATTN_IDLE); + self.yaw_speed = 20; +ai_run(18);} +void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14);} +void() enf_run3 =[ $run3 , enf_run4 ] {ai_run(7);} +void() enf_run4 =[ $run4 , enf_run5 ] {ai_run(12);} +void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14);} +void() enf_run6 =[ $run6 , enf_run7 ] {ai_run(14);} +void() enf_run7 =[ $run7 , enf_run8 ] {ai_run(7);} +void() enf_run8 =[ $run8 , enf_run1 ] {ai_run(11);} + +void() enf_atk1 =[ $attack1, enf_atk2 ] {self.yaw_speed = 30; ai_face();} +void() enf_atk2 =[ $attack2, enf_atk3 ] {ai_face();} +void() enf_atk3 =[ $attack3, enf_atk4 ] {ai_face();} +void() enf_atk4 =[ $attack4, enf_atk5 ] {ai_face();} +void() enf_atk5 =[ $attack5, enf_atk6 ] {ai_face();} +void() enf_atk6 =[ $attack6, enf_atk7 ] {enforcer_fire();} +void() enf_atk7 =[ $attack7, enf_atk8 ] {ai_face();} +void() enf_atk8 =[ $attack8, enf_atk9 ] {ai_face();} +void() enf_atk9 =[ $attack9, enf_atk10 ] {ai_face(); + if (self.enemy.health <= 0 || self.enemy.customflags & CFL_PLUNGE ) + return; + if (self.enemy.invisible_finished > time && random() > 0.80) + { + ai_attack_finished(0.25 + random()); // randomly break volley if player is being sneaky + return; + } + if (!enforcer_clear_attack()) + { + ai_attack_finished(1 + random()); // force a little maneuvering if LOS is broken + return; + } + self.think = enf_atk6; +} + +void() enf_atk10 =[ $attack10, enf_run1 ] {self.yaw_speed = 20; ai_face();} + +void() enf_paina1 =[ $paina1, enf_paina2 ] {} +void() enf_paina2 =[ $paina2, enf_paina3 ] {} +void() enf_paina3 =[ $paina3, enf_paina4 ] {} +void() enf_paina4 =[ $paina4, enf_run1 ] {} + +void() enf_painb1 =[ $painb1, enf_painb2 ] {} +void() enf_painb2 =[ $painb2, enf_painb3 ] {} +void() enf_painb3 =[ $painb3, enf_painb4 ] {} +void() enf_painb4 =[ $painb4, enf_painb5 ] {} +void() enf_painb5 =[ $painb5, enf_run1 ] {} + +void() enf_painc1 =[ $painc1, enf_painc2 ] {} +void() enf_painc2 =[ $painc2, enf_painc3 ] {} +void() enf_painc3 =[ $painc3, enf_painc4 ] {} +void() enf_painc4 =[ $painc4, enf_painc5 ] {} +void() enf_painc5 =[ $painc5, enf_painc6 ] {} +void() enf_painc6 =[ $painc6, enf_painc7 ] {} +void() enf_painc7 =[ $painc7, enf_painc8 ] {} +void() enf_painc8 =[ $painc8, enf_run1 ] {} + +void() enf_paind1 =[ $paind1, enf_paind2 ] {} +void() enf_paind2 =[ $paind2, enf_paind3 ] {} +void() enf_paind3 =[ $paind3, enf_paind4 ] {} +void() enf_paind4 =[ $paind4, enf_paind5 ] {ai_painforward(2);} +void() enf_paind5 =[ $paind5, enf_paind6 ] {ai_painforward(1);} +void() enf_paind6 =[ $paind6, enf_paind7 ] {} +void() enf_paind7 =[ $paind7, enf_paind8 ] {} +void() enf_paind8 =[ $paind8, enf_paind9 ] {} +void() enf_paind9 =[ $paind9, enf_paind10 ] {} +void() enf_paind10 =[ $paind10, enf_paind11 ] {} +void() enf_paind11 =[ $paind11, enf_paind12 ] {ai_painforward(1);} +void() enf_paind12 =[ $paind12, enf_paind13 ] {ai_painforward(1);} +void() enf_paind13 =[ $paind13, enf_paind14 ] {ai_painforward(1);} +void() enf_paind14 =[ $paind14, enf_paind15 ] {} +void() enf_paind15 =[ $paind15, enf_paind16 ] {} +void() enf_paind16 =[ $paind16, enf_paind17 ] {ai_pain(1);} +void() enf_paind17 =[ $paind17, enf_paind18 ] {ai_pain(1);} +void() enf_paind18 =[ $paind18, enf_paind19 ] {} +void() enf_paind19 =[ $paind19, enf_run1 ] {} + +void(entity attacker, float damage) enf_pain = +{ + local float r; + self.yaw_speed = 20; + + r = random (); + if (self.pain_finished > time) + return; + + + if (r < 0.5) + sound (self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "enforcer/pain2.wav", 1, ATTN_NORM); + + if (r < 0.2) + { + PainFinished(1); + enf_paina1 (); + } + else if (r < 0.4) + { + PainFinished(1); + enf_painb1 (); + } + else if (r < 0.7) + { + PainFinished(1); + enf_painc1 (); + } + else + { + PainFinished(2); + enf_paind1 (); + } +} + +//============================================================================ + + + + +void() enf_die1 =[ $death1, enf_die2 ] {} +void() enf_die2 =[ $death2, enf_die3 ] {} +void() enf_die3 =[ $death3, enf_die4 ] { + self.solid = SOLID_NOT; + //self.ammo_cells = 5; + //DropBackpack(); +} +void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);} +void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);} +void() enf_die6 =[ $death6, enf_die7 ] {} +void() enf_die7 =[ $death7, enf_die8 ] {} +void() enf_die8 =[ $death8, enf_die9 ] {} +void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);} +void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);} +void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);} +void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);} +void() enf_die13 =[ $death13, enf_die14 ] {} +void() enf_die14 =[ $death14, enf_die14 ] {} + +void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] {} +void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {} +void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] { + self.solid = SOLID_NOT; + //self.ammo_cells = 5; + //DropBackpack(); +} +void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {} +void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {} +void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {} +void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {} +void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {} +void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {} +void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {} +void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {} + + +void() enf_die = +{ +// check for gib + if (self.health < -35) + { + Gib ("progs/h_mega.mdl", self.health); + return; + } + +// regular death + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) + enf_die1 (); + else + enf_fdie1 (); +} + + +void() monster_enforcer_spawn = +{ + self.classname = "monster_enforcer"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/enforcer.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 80; + + self.th_stand = enf_stand1; + self.th_walk = enf_walk1; + self.th_run = enf_run1; + self.th_pain = enf_pain; + self.th_die = enf_die; + self.th_missile = enf_atk1; + self.th_checkattack = enforcer_check_attack; + + if (self.deathtype == string_null) + self.deathtype = "was blasted by an Enforcer"; + + walkmonster_start(); +} + +void() monster_enforcer_spawner = {mon_spawner_use(monster_enforcer_spawn);} + + +/*QUAKED monster_enforcer (1 0 0) (-16 -16 -24) (16 16 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Enforcer, 80 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model({ "path": ":progs/enforcer.mdl" }) = monster_enforcer : "Enforcer" [] +*/ +void() monster_enforcer = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model2 ("progs/enforcer.mdl"); + precache_model2 ("progs/h_mega.mdl"); + precache_model2 ("progs/laser.mdl"); + + precache_sound2 ("enforcer/death1.wav"); + precache_sound2 ("enforcer/enfire.wav"); + precache_sound2 ("enforcer/enfstop.wav"); + precache_sound2 ("enforcer/idle1.wav"); + precache_sound2 ("enforcer/pain1.wav"); + precache_sound2 ("enforcer/pain2.wav"); + precache_sound2 ("enforcer/sight1.wav"); + precache_sound2 ("enforcer/sight2.wav"); + precache_sound2 ("enforcer/sight3.wav"); + precache_sound2 ("enforcer/sight4.wav"); + + self.health = 80; + setsize (self, '-16 -16 -24', '16 16 40'); + if ( monster_spawnsetup( monster_enforcer_spawner ) ) return; + + addmonster(1); + monster_enforcer_spawn(); +} diff --git a/QC_other/QC_copper/m_fish.qc b/QC_other/QC_copper/m_fish.qc new file mode 100644 index 00000000..afe74d70 --- /dev/null +++ b/QC_other/QC_copper/m_fish.qc @@ -0,0 +1,324 @@ +$cd id1/models/fish +$origin 0 0 24 +$base base +$skin skin + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 attack11 attack12 attack13 +$frame attack14 attack15 attack16 attack17 attack18 + +$frame death1 death2 death3 death4 death5 death6 death7 +$frame death8 death9 death10 death11 death12 death13 death14 death15 +$frame death16 death17 death18 death19 death20 death21 + +$frame swim1 swim2 swim3 swim4 swim5 swim6 swim7 swim8 +$frame swim9 swim10 swim11 swim12 swim13 swim14 swim15 swim16 swim17 +$frame swim18 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 +$frame pain9 + +void() f_stand1 =[ $swim1, f_stand2 ] {ai_stand();} +void() f_stand2 =[ $swim2, f_stand3 ] {ai_stand();} +void() f_stand3 =[ $swim3, f_stand4 ] {ai_stand();} +void() f_stand4 =[ $swim4, f_stand5 ] {ai_stand();} +void() f_stand5 =[ $swim5, f_stand6 ] {ai_stand();} +void() f_stand6 =[ $swim6, f_stand7 ] {ai_stand();} +void() f_stand7 =[ $swim7, f_stand8 ] {ai_stand();} +void() f_stand8 =[ $swim8, f_stand9 ] {ai_stand();} +void() f_stand9 =[ $swim9, f_stand10 ] {ai_stand();} +void() f_stand10 =[ $swim10, f_stand11 ] {ai_stand();} +void() f_stand11 =[ $swim11, f_stand12 ] {ai_stand();} +void() f_stand12 =[ $swim12, f_stand13 ] {ai_stand();} +void() f_stand13 =[ $swim13, f_stand14 ] {ai_stand();} +void() f_stand14 =[ $swim14, f_stand15 ] {ai_stand();} +void() f_stand15 =[ $swim15, f_stand16 ] {ai_stand();} +void() f_stand16 =[ $swim16, f_stand17 ] {ai_stand();} +void() f_stand17 =[ $swim17, f_stand18 ] {ai_stand();} +void() f_stand18 =[ $swim18, f_stand1 ] {ai_stand();} + +void() f_walk1 =[ $swim1, f_walk2 ] {ai_walk(5);} +void() f_walk2 =[ $swim2, f_walk3 ] {ai_walk(6);} +void() f_walk3 =[ $swim3, f_walk4 ] {ai_walk(7);} +void() f_walk4 =[ $swim4, f_walk5 ] {ai_walk(8);} +void() f_walk5 =[ $swim5, f_walk6 ] {ai_walk(9);} +void() f_walk6 =[ $swim6, f_walk7 ] {ai_walk(10);} +void() f_walk7 =[ $swim7, f_walk8 ] {ai_walk(9);} +void() f_walk8 =[ $swim8, f_walk9 ] {ai_walk(8);} +void() f_walk9 =[ $swim9, f_walk10 ] {ai_walk(7);} +void() f_walk10 =[ $swim10, f_walk11 ] {ai_walk(6);} +void() f_walk11 =[ $swim11, f_walk12 ] {ai_walk(5);} +void() f_walk12 =[ $swim12, f_walk13 ] {ai_walk(6);} +void() f_walk13 =[ $swim13, f_walk14 ] {ai_walk(7);} +void() f_walk14 =[ $swim14, f_walk15 ] {ai_walk(8);} +void() f_walk15 =[ $swim15, f_walk16 ] {ai_walk(9);} +void() f_walk16 =[ $swim16, f_walk17 ] {ai_walk(8);} +void() f_walk17 =[ $swim17, f_walk18 ] {ai_walk(7);} +void() f_walk18 =[ $swim18, f_walk1 ] {ai_walk(6);} + +void() f_run1 =[ $swim1, f_run2 ] {ai_run(12); + if (random() < 0.5) + sound (self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM); +} +void() f_run2 =[ $swim3, f_run3 ] {ai_run(14);} +void() f_run3 =[ $swim5, f_run4 ] {ai_run(16);} +void() f_run4 =[ $swim7, f_run5 ] {ai_run(14);} +void() f_run5 =[ $swim9, f_run6 ] {ai_run(12);} +void() f_run6 =[ $swim11, f_run7 ] {ai_run(14);} +void() f_run7 =[ $swim13, f_run8 ] {ai_run(16);} +void() f_run8 =[ $swim15, f_run9 ] {ai_run(14);} +void() f_run9 =[ $swim17, f_run1 ] {ai_run(12);} + +void() fish_melee = +{ + float ldmg; + + if (!self.enemy || self.enemy.health <= 0) + return; // removed before stroke + + if (vlen(self.enemy.origin - self.origin) > 60) + { + self.think = f_run1; + ai_attack_finished(1); + return; + } + + sound (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM); + ldmg = 6 + random() * 6; + T_DamageMelee (self.enemy, self, ldmg); +} + +/* +void() fish_checkdash = +{ + if (vlen(self.origin - self.enemy.origin) < 60) + { + if(infront(self.enemy)) + f_attack3(); + else + f_run1(); + return; + } + if (!ai_fishmovecheck() || self.velocity != self.oldvelocity) + { + f_run1(); + return; + } +} + +void() f_dash = +{ + ai_face(); + ai_face(); + if (!infront(self.enemy)) + { + f_run1(); + return; + } + self.velocity = normalize(enemy_vispos() - self.origin) * 300; + self.oldvelocity = self.velocity; + f_dash1(); +} + +void() f_dash1 =[ $swim1, f_dash2 ] { + //ai_rush(20); + if (random() < 0.1) + sound (self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM); +} +void() f_dash2 =[ $swim3, f_dash3 ] {fish_checkdash();} +void() f_dash3 =[ $swim6, f_dash4 ] {fish_checkdash();} +void() f_dash4 =[ $swim10, f_dash5 ] {fish_checkdash();} +void() f_dash5 =[ $swim12, f_dash6 ] {fish_checkdash();} +void() f_dash6 =[ $swim14, f_dash7 ] {fish_checkdash();} +void() f_dash7 =[ $swim16, f_dash1 ] {fish_checkdash();} +*/ +void() f_attack = +{ + float r; + r = random(); + if (r<0.33) + f_attack1(); + else if (r<0.66) + f_attack7(); + else + f_attack13(); +} + +void() f_attack1 = [ $attack1, f_attack2 ] {ai_charge(10);} +void() f_attack2 = [ $attack2, f_attack3 ] {ai_charge(10);} +void() f_attack3 = [ $attack3, f_attack4 ] {fish_melee();} +void() f_attack4 = [ $attack4, f_attack5 ] {ai_charge(10);} +void() f_attack5 = [ $attack5, f_attack6 ] {ai_charge(10);} +void() f_attack6 = [ $attack6, f_attack7 ] {ai_charge(10);} +void() f_attack7 = [ $attack7, f_attack8 ] {ai_charge(10);} +void() f_attack8 = [ $attack8, f_attack9 ] {ai_charge(10);} +void() f_attack9 = [ $attack9, f_attack10] {fish_melee();} +void() f_attack10 =[ $attack10, f_attack11] {ai_charge(10);} +void() f_attack11 =[ $attack11, f_attack12] {ai_charge(10);} +void() f_attack12 =[ $attack12, f_attack13] {ai_charge(10);} +void() f_attack13 =[ $attack13, f_attack14] {ai_charge(10);} +void() f_attack14 =[ $attack14, f_attack15] {ai_charge(10);} +void() f_attack15 =[ $attack15, f_attack16] {fish_melee();} +void() f_attack16 =[ $attack16, f_attack17] {ai_charge(10);} +void() f_attack17 =[ $attack17, f_attack18] {ai_charge(10);} +void() f_attack18 =[ $attack18, f_attack1 ] {ai_charge(10);} + +void() f_death1 =[ $death1, f_death2 ] {} +void() f_death2 =[ $death2, f_death3 ] {} +void() f_death3 =[ $death3, f_death4 ] {} +void() f_death4 =[ $death4, f_death5 ] {} +void() f_death5 =[ $death5, f_death6 ] {} +void() f_death6 =[ $death6, f_death7 ] {} +void() f_death7 =[ $death7, f_death8 ] {} +void() f_death8 =[ $death8, f_death9 ] {} +void() f_death9 =[ $death9, f_death10 ] {} +void() f_death10 =[ $death10, f_death11 ] {} +void() f_death11 =[ $death11, f_death12 ] {} +void() f_death12 =[ $death12, f_death13 ] {} +void() f_death13 =[ $death13, f_death14 ] {} +void() f_death14 =[ $death14, f_death15 ] {} +void() f_death15 =[ $death15, f_death16 ] {} +void() f_death16 =[ $death16, f_death17 ] {} +void() f_death17 =[ $death17, f_death18 ] {} +void() f_death18 =[ $death18, f_death19 ] {} +void() f_death19 =[ $death19, f_death20 ] {} +void() f_death20 =[ $death20, f_death21 ] {} +void() f_death21 =[ $death21, f_death21 ] {} + +void() f_pain1 =[ $pain1, f_pain2 ] {ai_nop();} +void() f_pain2 =[ $pain2, f_pain3 ] {ai_pain(6);} +void() f_pain3 =[ $pain3, f_pain4 ] {ai_pain(6);} +void() f_pain4 =[ $pain4, f_pain5 ] {ai_pain(6);} +void() f_pain5 =[ $pain5, f_pain6 ] {ai_pain(6);} +void() f_pain6 =[ $pain6, f_pain7 ] {ai_pain(6);} +void() f_pain7 =[ $pain7, f_pain8 ] {ai_pain(6);} +void() f_pain8 =[ $pain8, f_pain9 ] {ai_pain(6);} +void() f_pain9 =[ $pain9, f_run1 ] {ai_pain(6);} + +void(entity attacker, float damage) fish_pain = +{ + if (time < self.pain_finished) return; + f_pain1 (); + PainFinished(1); +} + +void() fish_gib = +{ + entity meat; + vector mvel; + + mvel_x = crandom() * 128; + mvel_y = crandom() * 128; + mvel_z = random() * 256; + + meat = toss_projectile(self.origin, mvel); + //meat.solid = SOLID_NOT; + meat.type = "gib"; + meat.avelocity = '300 100 200'; + meat.lifetime_finished = time + 1; + meat.classname = "gib"; + + SUB_ChangeModel(meat, "progs/zom_gib.mdl"); +} + +void() fish_die = +{ + self.solid = SOLID_NOT; + + // just spray a bunch of blood and bubbles + if (self.health < -30) + { + vector org, bl; + float x,y,z; + org = self.origin - '0 0 8'; + for (x=-1;x<2;x+=2) for (y=-1;y<2;y+=2) for (z=-1;z<2;z+=2) + { + bl = Vector(8 * x * random(), 8 * y * random(), 8 * z * random()); + particle(org + bl, bl, 73, 20); + particle(org - bl, '0 0 1', 73, 20); + // removing bubbles because there's no air in fish + //if (random() < 0.5) + // bubble_spawn(org - bl); + // also duh + } + sound (self, CHAN_VOICE, "player/tornoff2.wav", 1, ATTN_NORM); + for (x=0;x<3;x++) + fish_gib(); + SUB_RemoveSoon(); + return; + } + + sound (self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM); + f_death1(); +} + +void() monster_fish_spawn = +{ + self.classname = "monster_fish"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/fish.mdl"); + + setsize (self, '-16 -16 -24', '16 16 8'); + //setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + self.health = 35; + self.customflags |= CFL_MELEEONLY; + + self.th_stand = f_stand1; + self.th_walk = f_walk1; + self.th_run = f_run1; + self.th_die = fish_die; + self.th_pain = fish_pain; + self.th_melee = f_attack; + //self.th_missile = f_dash; + self.th_checkattack = CheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was fed to the Rotfish"; + + swimmonster_start (); +} + +void() monster_fish_spawner = {mon_spawner_use(monster_fish_spawn);} + + +/*QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Rotfish, 35 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 24) model({ "path": ":progs/fish.mdl" }) = monster_fish : "Rotfish" [] +*/ +void() monster_fish = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model2 ("progs/fish.mdl"); + precache_model ("progs/zom_gib.mdl"); + precache_sound2 ("fish/death.wav"); + precache_sound2 ("fish/bite.wav"); + precache_sound2 ("fish/idle.wav"); + + self.health = 35; + setsize (self, '-16 -16 -24', '16 16 8'); + //setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + if ( monster_spawnsetup( monster_fish_spawner ) ) return; + addmonster(1); + monster_fish_spawn(); +} diff --git a/QC_other/QC_copper/m_hknight.qc b/QC_other/QC_copper/m_hknight.qc new file mode 100644 index 00000000..35073da3 --- /dev/null +++ b/QC_other/QC_copper/m_hknight.qc @@ -0,0 +1,464 @@ +/* +============================================================================== + +KNIGHT + +============================================================================== +*/ + +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +// swipe left & right whilst running +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 +// two armed smash +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 magica9 magica10 magica11 magica12 magica13 magica14 +// sword gun - 7 & 8 are identical +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 magicb9 magicb10 magicb11 magicb12 magicb13 +// helicopter run +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 +// two armed forward swipe +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 +// one armed forward smash +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 smash11 +// swipe left & right whilst walking +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 +// broad sweep attack +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 magicc9 magicc10 magicc11 + + +void(float offset) hknight_shot = +{ + local vector offang; + local vector org, vec; + + offang = vectoangles (enemy_vispos() - self.origin); + offang_y = offang_y + offset * 6; + + makevectors (offang); + + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + +// set missile speed + vec = normalize (v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + + launch_knightspike (org, vec*425); + + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); +} + +void() hkCheckCharge = +{ + // check for mad charge + if (!enemy_vis) + return; + if (time < self.attack_finished) + return; + if ( fabs(self.origin_z - self.enemy.origin_z) > 32) + return; // too much height change + if ( vlen (self.origin - self.enemy.origin) < 80) + return; // use regular attack + + // charge + ai_attack_finished (2); + hknight_char_a1 (); +} + +void() hkCheckContinueCharge = +{ + if (time > self.attack_finished) + { + ai_attack_finished (3); + hknight_run1 (); + + return; // done charging + } + + if (random() > 0.5) + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +} + +//=========================================================================== + +void() hknight_stand1 =[ $stand1, hknight_stand2 ] {ai_stand();} +void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();} +void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();} +void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();} +void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();} +void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();} +void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();} +void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();} +void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();} + +//=========================================================================== + +void() hknight_walk1 =[ $walk1, hknight_walk2 ] { +hk_idle_sound(); +ai_walk(2);} +void() hknight_walk2 =[ $walk2, hknight_walk3 ] {ai_walk(5);} +void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);} +void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);} +void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);} +void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);} +void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);} +void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);} +void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);} +void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);} +void() hknight_walk11 =[ $walk11, hknight_walk12 ] {ai_walk(3);} +void() hknight_walk12 =[ $walk12, hknight_walk13 ] {ai_walk(4);} +void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);} +void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);} +void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);} +void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);} +void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);} +void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);} +void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);} +void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);} + +//=========================================================================== + +void() hknight_run1 =[ $run1, hknight_run2 ] { +hk_idle_sound(); +ai_run (20); hkCheckCharge (); } +void() hknight_run2 =[ $run2, hknight_run3 ] {ai_run(25);} +void() hknight_run3 =[ $run3, hknight_run4 ] {ai_run(18);} +void() hknight_run4 =[ $run4, hknight_run5 ] {ai_run(16);} +void() hknight_run5 =[ $run5, hknight_run6 ] {ai_run(14);} +void() hknight_run6 =[ $run6, hknight_run7 ] {ai_run(25);} +void() hknight_run7 =[ $run7, hknight_run8 ] {ai_run(21);} +void() hknight_run8 =[ $run8, hknight_run1 ] {ai_run(13);} + +//============================================================================ + +void() hknight_pain1 =[ $pain1, hknight_pain2 ] { sound (self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM);} +void() hknight_pain2 =[ $pain2, hknight_pain3 ] {} +void() hknight_pain3 =[ $pain3, hknight_pain4 ] {} +void() hknight_pain4 =[ $pain4, hknight_pain5 ] {} +void() hknight_pain5 =[ $pain5, hknight_pain6 ] {} +void() hknight_pain6 =[ $stand1, hknight_pain7 ] {} +void() hknight_pain7 =[ $stand5, hknight_run1 ] {} + +//============================================================================ + +void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);} +void() hknight_die2 =[ $death2, hknight_die3 ] {ai_forward(8);} +void() hknight_die3 =[ $death3, hknight_die4 ] +{self.solid = SOLID_NOT; ai_forward(7);} +void() hknight_die4 =[ $death4, hknight_die5 ] {} +void() hknight_die5 =[ $death5, hknight_die6 ] {} +void() hknight_die6 =[ $death6, hknight_die7 ] {} +void() hknight_die7 =[ $death7, hknight_die8 ] {} +void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);} +void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);} +void() hknight_die10 =[ $death10, hknight_die11 ] {} +void() hknight_die11 =[ $death11, hknight_die12 ] {} +void() hknight_die12 =[ $death12, hknight_die12 ] {} + +void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {} +void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {} +void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] +{self.solid = SOLID_NOT;} +void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {} +void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {} +void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {} +void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {} +void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {} +void() hknight_dieb9 =[ $deathb9, hknight_dieb9 ] {} + +void() hknight_die = +{ +// check for gib + if (self.health < -40) + { + Gib ("progs/h_hellkn.mdl", self.health); + return; + } + +// regular death + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) + hknight_die1 (); + else + hknight_dieb1 (); +} + + +//============================================================================ +// not used +void() hknight_magica1 =[ $magica1, hknight_magica2 ] {ai_face();} +void() hknight_magica2 =[ $magica2, hknight_magica3 ] {ai_face();} +void() hknight_magica3 =[ $magica3, hknight_magica4 ] {ai_face();} +void() hknight_magica4 =[ $magica4, hknight_magica5 ] {ai_face();} +void() hknight_magica5 =[ $magica5, hknight_magica6 ] {ai_face();} +void() hknight_magica6 =[ $magica6, hknight_magica7 ] {ai_face();} +void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);} +void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);} +void() hknight_magica9 =[ $magica9, hknight_magica10] {hknight_shot(0);} +void() hknight_magica10 =[ $magica10, hknight_magica11] {hknight_shot(1);} +void() hknight_magica11 =[ $magica11, hknight_magica12] {hknight_shot(2);} +void() hknight_magica12 =[ $magica12, hknight_magica13] {hknight_shot(3);} +void() hknight_magica13 =[ $magica13, hknight_magica14] {ai_face();} +void() hknight_magica14 =[ $magica14, hknight_run1 ] {ai_face();} + +//============================================================================ +// not used +void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {ai_face();} +void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {ai_face();} +void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {ai_face();} +void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {ai_face();} +void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {ai_face();} +void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {ai_face();} +void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);} +void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);} +void() hknight_magicb9 =[ $magicb9, hknight_magicb10] {hknight_shot(0);} +void() hknight_magicb10 =[ $magicb10, hknight_magicb11] {hknight_shot(1);} +void() hknight_magicb11 =[ $magicb11, hknight_magicb12] {hknight_shot(2);} +void() hknight_magicb12 =[ $magicb12, hknight_magicb13] {hknight_shot(3);} +void() hknight_magicb13 =[ $magicb13, hknight_run1] {ai_face();} + +//============================================================================ + +void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {ai_face();} +void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {ai_face();} +void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {ai_face();} +void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {ai_face();} +void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {ai_face();} +void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2);} +void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1);} +void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0);} +void() hknight_magicc9 =[ $magicc9, hknight_magicc10] {hknight_shot(1);} +void() hknight_magicc10 =[ $magicc10, hknight_magicc11] {hknight_shot(2);} +void() hknight_magicc11 =[ $magicc11, hknight_run1] {hknight_shot(3);} + +//=========================================================================== + +void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] {ai_rush(20);} +void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {ai_rush(25);} +void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {ai_rush(18); } +void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] {ai_rush(16); ai_melee(); } +void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {ai_rush(14); ai_melee(); } +void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {ai_rush(20); ai_melee(); } +void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {ai_rush(21); } +void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {ai_rush(13); } +void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {ai_rush(20); } +void() hknight_char_a10=[ $char_a10, hknight_char_a11 ] {ai_rush(20); ai_melee();} +void() hknight_char_a11=[ $char_a11, hknight_char_a12 ] {ai_rush(18); ai_melee();} +void() hknight_char_a12=[ $char_a12, hknight_char_a13 ] {ai_rush(16); ai_melee();} +void() hknight_char_a13=[ $char_a13, hknight_char_a14 ] {ai_rush(14); ai_melee();} +void() hknight_char_a14=[ $char_a14, hknight_char_a15 ] {ai_rush(25); } +void() hknight_char_a15=[ $char_a15, hknight_char_a16 ] {ai_rush(21);} +void() hknight_char_a16=[ $char_a16, hknight_run1 ] {ai_rush(13);} + +//=========================================================================== + +void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] +{hkCheckContinueCharge (); ai_rush(23); ai_melee();} +void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {ai_rush(17); ai_melee();} +void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {ai_rush(12); ai_melee();} +void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {ai_rush(22); ai_melee();} +void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {ai_rush(18); ai_melee();} +void() hknight_char_b6 =[ $char_b6, hknight_char_b1 ] {ai_rush(8); ai_melee();} + +//=========================================================================== + +void() hknight_slice1 =[ $slice1, hknight_slice2 ] {ai_charge(9);} +void() hknight_slice2 =[ $slice2, hknight_slice3 ] {ai_charge(6);} +void() hknight_slice3 =[ $slice3, hknight_slice4 ] {ai_charge(13); } +void() hknight_slice4 =[ $slice4, hknight_slice5 ] {ai_charge(4);} +void() hknight_slice5 =[ $slice5, hknight_slice6 ] {ai_charge(7); ai_melee();} +void() hknight_slice6 =[ $slice6, hknight_slice7 ] {ai_charge(15); ai_melee();} +void() hknight_slice7 =[ $slice7, hknight_slice8 ] {ai_charge(8); ai_melee();} +void() hknight_slice8 =[ $slice8, hknight_slice9 ] {ai_charge(2); ai_melee();} +void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();} +void() hknight_slice10 =[ $slice10, hknight_run1 ] {ai_charge(3); } + +//=========================================================================== + +void() hknight_smash1 =[ $smash1, hknight_smash2 ] {ai_charge(1);} +void() hknight_smash2 =[ $smash2, hknight_smash3 ] {ai_charge(13);} +void() hknight_smash3 =[ $smash3, hknight_smash4 ] {ai_charge(9);} +void() hknight_smash4 =[ $smash4, hknight_smash5 ] {ai_charge(11); } +void() hknight_smash5 =[ $smash5, hknight_smash6 ] {ai_charge(10); ai_melee();} +void() hknight_smash6 =[ $smash6, hknight_smash7 ] {ai_charge(7); ai_melee();} +void() hknight_smash7 =[ $smash7, hknight_smash8 ] {ai_charge(12); ai_melee();} +void() hknight_smash8 =[ $smash8, hknight_smash9 ] {ai_charge(2); ai_melee();} +void() hknight_smash9 =[ $smash9, hknight_smash10 ] {ai_charge(3); ai_melee();} +void() hknight_smash10 =[ $smash10, hknight_smash11 ] {ai_charge(0); } +void() hknight_smash11 =[ $smash11, hknight_run1 ] {ai_charge(0);} + +//============================================================================ + +void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {ai_charge(2);} +void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {ai_charge(0); } +void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {ai_charge(0);} +void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {ai_charge(0);} +void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_charge(0);} +void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_charge(0); } +void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {ai_charge(1); ai_melee();} +void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {ai_charge(4); ai_melee();} +void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {ai_charge(5); ai_melee(); } +void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {ai_charge(3); ai_melee();} +void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {ai_charge(2); ai_melee();} +void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {ai_charge(2); ai_melee();} +void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {ai_charge(0); } +void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {ai_charge(0);} +void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {ai_charge(0);} +void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {ai_charge(1); } +void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {ai_charge(1); ai_melee();} +void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {ai_charge(3); ai_melee();} +void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {ai_charge(4); ai_melee();} +void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {ai_charge(6); } +void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {ai_charge(7);} +void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {ai_charge(3);} + +//============================================================================ + +void() hk_idle_sound = +{ + if (random() < 0.2) + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); +} + +void() hknight_pain_go = +{ + hknight_pain1 (); + PainFinished(1); +} + +void(entity attacker, float damage) hknight_pain = +{ + if (self.pain_finished > time) + return; + + if (time - self.pain_finished > 5) + { // always go into pain frame if it has been a while + hknight_pain_go(); + return; + } + + if ( ( random()*30 > damage ) ) + return; // didn't flinch + + hknight_pain_go(); +} + +float hknight_type; + +void() hknight_melee = +{ + hknight_type = hknight_type + 1; + + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); + if (hknight_type == 1) + hknight_slice1 (); + else if (hknight_type == 2) + hknight_smash1 (); + else if (hknight_type == 3) + { + hknight_watk1 (); + hknight_type = 0; + } +} + + +void() monster_hell_knight_spawn = +{ + self.classname = "monster_hell_knight"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/hknight.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = hknight_run1; + self.th_melee = hknight_melee; + self.th_missile = hknight_magicc1; + self.th_pain = hknight_pain; + self.th_die = hknight_die; + self.th_checkattack = CheckAttack; + + self.type = "brigade"; // no infighting amongst the hell death brigade legion squad + + if (self.deathtype == string_null) + self.deathtype = "was slain by a Hell Knight"; + + walkmonster_start (); +} + +void() monster_hell_knight_spawner = {mon_spawner_use(monster_hell_knight_spawn);} + +/*QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Hell Knight, 250 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model({ "path": ":progs/hknight.mdl" }) = monster_hell_knight : "Hell knight" [] +*/ +void() monster_hell_knight = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model2 ("progs/hknight.mdl"); + precache_model2 ("progs/k_spike.mdl"); + precache_model2 ("progs/h_hellkn.mdl"); + + + precache_sound2 ("hknight/attack1.wav"); + precache_sound2 ("hknight/death1.wav"); + precache_sound2 ("hknight/pain1.wav"); + precache_sound2 ("hknight/sight1.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound2 ("hknight/slash1.wav"); + precache_sound2 ("hknight/idle.wav"); + precache_sound2 ("hknight/grunt.wav"); + + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + + self.health = 250; + setsize (self, '-16 -16 -24', '16 16 40'); + if ( monster_spawnsetup( monster_hell_knight_spawner ) ) return; + + addmonster(1); + monster_hell_knight_spawn(); +} diff --git a/QC_other/QC_copper/m_knight.qc b/QC_other/QC_copper/m_knight.qc new file mode 100644 index 00000000..94bb5ca2 --- /dev/null +++ b/QC_other/QC_copper/m_knight.qc @@ -0,0 +1,317 @@ +/* +============================================================================== + +KNIGHT + +============================================================================== +*/ +$flush +$cd id1/models/knight +$origin 0 0 24 +$base base +$skin badass3 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8 + +//frame runc1 runc2 runc3 runc4 runc5 runc6 + +$frame runattack1 runattack2 runattack3 runattack4 runattack5 +$frame runattack6 runattack7 runattack8 runattack9 runattack10 +$frame runattack11 + +$frame pain1 pain2 pain3 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 +$frame painb10 painb11 + +//frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 +//frame attack8 attack9 attack10 attack11 + +$frame attackb0 attackb1 attackb2 attackb3 attackb4 attackb5 +$frame attackb6 attackb7 attackb8 attackb9 attackb10 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +$frame kneel1 kneel2 kneel3 kneel4 kneel5 + +$frame standing2 standing3 standing4 standing5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 + +void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();} +void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();} +void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();} +void() knight_stand4 =[ $stand4, knight_stand5 ] {ai_stand();} +void() knight_stand5 =[ $stand5, knight_stand6 ] {ai_stand();} +void() knight_stand6 =[ $stand6, knight_stand7 ] {ai_stand();} +void() knight_stand7 =[ $stand7, knight_stand8 ] {ai_stand();} +void() knight_stand8 =[ $stand8, knight_stand9 ] {ai_stand();} +void() knight_stand9 =[ $stand9, knight_stand1 ] {ai_stand();} + +void() knight_walk1 =[ $walk1, knight_walk2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); +ai_walk(3);} +void() knight_walk2 =[ $walk2, knight_walk3 ] {ai_walk(2);} +void() knight_walk3 =[ $walk3, knight_walk4 ] {ai_walk(3);} +void() knight_walk4 =[ $walk4, knight_walk5 ] {ai_walk(4);} +void() knight_walk5 =[ $walk5, knight_walk6 ] {ai_walk(3);} +void() knight_walk6 =[ $walk6, knight_walk7 ] {ai_walk(3);} +void() knight_walk7 =[ $walk7, knight_walk8 ] {ai_walk(3);} +void() knight_walk8 =[ $walk8, knight_walk9 ] {ai_walk(4);} +void() knight_walk9 =[ $walk9, knight_walk10 ] {ai_walk(3);} +void() knight_walk10 =[ $walk10, knight_walk11 ] {ai_walk(3);} +void() knight_walk11 =[ $walk11, knight_walk12 ] {ai_walk(2);} +void() knight_walk12 =[ $walk12, knight_walk13 ] {ai_walk(3);} +void() knight_walk13 =[ $walk13, knight_walk14 ] {ai_walk(4);} +void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);} + + +void() knight_run1 =[ $runb1, knight_run2 ] +{ + if (random() < 0.2) + sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); + + ai_run(16); +} +void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(20);} +void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);} +void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);} +void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);} +void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(20);} +void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);} +void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);} + + +void() knight_runatk1 =[ $runattack1, knight_runatk2 ] +{ + if (random() > 0.5) + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); + + ai_charge(20); + //bprint(vtos(self.origin)); bprint("\n"); +} +void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side(); } +void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side(); } +void() knight_runatk4 =[ $runattack4, knight_runatk5 ] {ai_charge_side(); } +void() knight_runatk5 =[ $runattack5, knight_runatk6 ] {ai_melee_side(); } +void() knight_runatk6 =[ $runattack6, knight_runatk7 ] {ai_melee_side(); } +void() knight_runatk7 =[ $runattack7, knight_runatk8 ] {ai_melee_side(); } +void() knight_runatk8 =[ $runattack8, knight_runatk9 ] {ai_melee_side(); } +void() knight_runatk9 =[ $runattack9, knight_runatk10 ] {ai_melee_side(); } +void() knight_runatk10 =[ $runattack10, knight_runatk11 ] {ai_charge_side(); } +void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10); } + +void() knight_atk1 =[ $attackb1, knight_atk2 ] +{ + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); + ai_charge(0); +} +void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);} +void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4); } +void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(0);} +void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(3);} +void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();} +void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();} +void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3); ai_melee();} +void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1); } +void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);} + +// moved from fight.qc +void() knight_attack = +{ + local float len; + + // decide if now is a good swing time + len = vlen(self.enemy.origin+self.enemy.view_ofs - (self.origin+self.view_ofs)); + + if (len < 80 || ( self.enemy.invisible_finished > time && random() > 0.5 )) + knight_atk1 (); + else + knight_runatk1 (); +} + + + +//=========================================================================== + +void() knight_pain1 =[ $pain1, knight_pain2 ] {ai_nop(); } +void() knight_pain2 =[ $pain2, knight_pain3 ] {ai_nop(); } +void() knight_pain3 =[ $pain3, knight_run1 ] {ai_nop(); } + +void() knight_painb1 =[ $painb1, knight_painb2 ] {ai_nop(); } +void() knight_painb2 =[ $painb2, knight_painb3 ] {ai_painforward(3);} +void() knight_painb3 =[ $painb3, knight_painb4 ] {ai_nop();} +void() knight_painb4 =[ $painb4, knight_painb5 ] {ai_nop();} +void() knight_painb5 =[ $painb5, knight_painb6 ] {ai_painforward(2);} +void() knight_painb6 =[ $painb6, knight_painb7 ] {ai_painforward(4);} +void() knight_painb7 =[ $painb7, knight_painb8 ] {ai_painforward(2);} +void() knight_painb8 =[ $painb8, knight_painb9 ] {ai_painforward(5);} +void() knight_painb9 =[ $painb9, knight_painb10 ] {ai_painforward(5);} +void() knight_painb10 =[ $painb10, knight_painb11 ] {ai_nop();} +void() knight_painb11 =[ $painb11, knight_run1 ] {ai_nop();} + +void(entity attacker, float damage) knight_pain = +{ + local float r; + + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, "knight/khurt.wav", 1, ATTN_NORM); + r = random(); + if (r < 0.85) + knight_pain1 (); + else + knight_painb1 (); + + PainFinished(1); +} + +//=========================================================================== + +void() knight_bow1 =[ $kneel1, knight_bow2 ] {ai_turn();} +void() knight_bow2 =[ $kneel2, knight_bow3 ] {ai_turn();} +void() knight_bow3 =[ $kneel3, knight_bow4 ] {ai_turn();} +void() knight_bow4 =[ $kneel4, knight_bow5 ] {ai_turn();} + +void() knight_bow5 =[ $kneel5, knight_bow5 ] {ai_turn();} + +void() knight_bow6 =[ $kneel4, knight_bow7 ] {ai_turn();} +void() knight_bow7 =[ $kneel3, knight_bow8 ] {ai_turn();} +void() knight_bow8 =[ $kneel2, knight_bow9 ] {ai_turn();} +void() knight_bow9 =[ $kneel1, knight_bow10 ] {ai_turn();} +void() knight_bow10 =[ $walk1, knight_walk1 ] {ai_turn();} + +void() knight_die1 =[ $death1, knight_die2 ] {ai_nop();} +void() knight_die2 =[ $death2, knight_die3 ] {ai_nop();} +void() knight_die3 =[ $death3, knight_die4 ] {ai_nop();} +void() knight_die4 =[ $death4, knight_die5 ] {ai_nop();self.solid = SOLID_NOT;} +void() knight_die5 =[ $death5, knight_die6 ] {ai_nop();} +void() knight_die6 =[ $death6, knight_die7 ] {ai_nop();} +void() knight_die7 =[ $death7, knight_die8 ] {ai_nop();} +void() knight_die8 =[ $death8, knight_die9 ] {ai_nop();} +void() knight_die9 =[ $death9, knight_die10] {ai_nop();} +void() knight_die10=[ $death10, SUB_Null] {ai_nop(); if (self.lip == 555) self.think = SUB_Remove;} + + +void() knight_dieb1 =[ $deathb1, knight_dieb2 ] {ai_nop();} +void() knight_dieb2 =[ $deathb2, knight_dieb3 ] {ai_nop();} +void() knight_dieb3 =[ $deathb3, knight_dieb4 ] {ai_nop();} +void() knight_dieb4 =[ $deathb4, knight_dieb5 ] {ai_nop();self.solid = SOLID_NOT;} +void() knight_dieb5 =[ $deathb5, knight_dieb6 ] {ai_nop();} +void() knight_dieb6 =[ $deathb6, knight_dieb7 ] {ai_nop();} +void() knight_dieb7 =[ $deathb7, knight_dieb8 ] {ai_nop();} +void() knight_dieb8 =[ $deathb8, knight_dieb9 ] {ai_nop();} +void() knight_dieb9 =[ $deathb9, knight_dieb10] {ai_nop();} +void() knight_dieb10 = [ $deathb10, knight_dieb11] {ai_nop();} +void() knight_dieb11 = [ $deathb11, SUB_Null] {ai_nop(); if (self.lip == 555) self.think = SUB_Remove;} + + +void() knight_die = +{ + // check for gib + if (self.health < -40) + { + Gib ("progs/h_knight.mdl", self.health); + return; + } + + // regular death + sound (self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + if (random() < 0.5) + knight_die1 (); + else + knight_dieb1 (); +} + +//=========================================================================== + +void() monster_knight_spawn = +{ + self.classname = "monster_knight"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/knight.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 72; + + self.customflags |= CFL_MELEEONLY; + //if (self.lip == 555) self.skin = 4; + + self.th_stand = knight_stand1; + self.th_walk = knight_walk1; + self.th_run = knight_run1; + self.th_melee = knight_attack; + self.th_pain = knight_pain; + self.th_die = knight_die; + self.th_checkattack = CheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was slashed by a Knight"; + + walkmonster_start (); +} + +void() monster_knight_spawner = {mon_spawner_use(monster_knight_spawn);} + +/*QUAKED monster_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Knight, 72 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model({ "path": ":progs/knight.mdl" }) = monster_knight : "Knight" [] +*/ +void() monster_knight = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/knight.mdl"); + precache_model ("progs/h_knight.mdl"); + + // FIXME debug shit remove this + //precache_model3 ("progs/knight_s.mdl"); + //precache_model3 ("progs/knight_s2.mdl"); + + precache_sound ("knight/kdeath.wav"); + precache_sound ("knight/khurt.wav"); + precache_sound ("knight/ksight.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + precache_sound ("knight/idle.wav"); + + self.health = 72; + setsize (self, '-16 -16 -24', '16 16 40'); + + if ( monster_spawnsetup( monster_knight_spawner ) ) return; + + addmonster(1); + monster_knight_spawn(); +} diff --git a/QC_other/QC_copper/m_ogre.qc b/QC_other/QC_copper/m_ogre.qc new file mode 100644 index 00000000..73ea6720 --- /dev/null +++ b/QC_other/QC_copper/m_ogre.qc @@ -0,0 +1,588 @@ +/* +============================================================================== + +OGRE + +============================================================================== +*/ + +$cd id1/models/ogre_c +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 swing8 swing9 swing10 swing11 swing12 swing13 swing14 +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 smash11 smash12 smash13 smash14 +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 + +$frame pain1 pain2 pain3 pain4 pain5 +$frame painb1 painb2 painb3 +$frame painc1 painc2 painc3 painc4 painc5 painc6 +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 paine11 paine12 paine13 paine14 paine15 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 death10 death11 death12 death13 death14 +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 bdeath7 bdeath8 bdeath9 bdeath10 + +$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 + +//============================================================================= + +void() OgreGrenadeExplode = +{ + T_RadiusDamage (self, self.trueowner, 40, world); + sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); + + BecomeExplosion(); +} + +void() OgreGrenadeTouch = +{ + if (other == self.owner) return; // don't explode on owner + if (CheckProjectilePassthru()) return; + + if (other.takedamage == DAMAGE_AIM) + { + if (other.type == "zombie") + T_Damage (other, self, self.trueowner, other.health + 25); + OgreGrenadeExplode(); + return; + } + sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound + if (self.velocity == '0 0 0') + self.avelocity = '0 0 0'; +} + +/* +================ +OgreAimGrenade +original OP aim code by Preach + +the best solution seemed to be to average the perfect aim and the old +one-vector-fits-all. ogres now aim within -20 and 40 degrees pitch, making +them appear as ineffective as they used to be but providing more flexibility +in placement, so rooms don't have to be designed around how high the ogres +have to be +================ +*/ +vector(vector dest, float speed) OgreAimGrenade = +{ + float theta, a; + vector angs; + + theta = BallisticTheta(dest,speed,18); // stock quake ogre firing angle is 18 + + a = vectoyaw(dest); + angs = '0 0 0'; + angs_y = a; + // clamp the perfect terminator-aim to limit deadon shots to the face, then average with + // old dumb aim for "z-only-slightly-aware"ness(tm) + if (vlen(dest) < 160) + theta = (clamp(theta, -80, 70) + 18) / 2; + else + theta = (clamp(theta, -60, 60) + 18) / 2; + angs_x = -theta; + makevectors(angs); + + return v_forward * speed; +} + + +/* +================ +OgreFire +================ +*/ +void() OgreFireGrenade = +{ + local entity g; + vector gorg, gvel; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + + // set grenade speed + makevectors (self.angles); + gorg = self.origin + v_forward * 16; + gvel = OgreAimGrenade(enemy_vispos() - gorg, 632); + + g = launch_grenade(gorg, gvel); + g.touch = OgreGrenadeTouch; + g.th_die = OgreGrenadeExplode; +} + + +/* +void() OgreFireFlak = +{ + local vector dir, org; + + makevectors(self.angles); + + dir = normalize(enemy_vispos() - self.origin); + org = self.origin + v_forward * 32 + '0 0 16'; + + sound (self, CHAN_WEAPON, "weapons/flakfire.wav", 1, ATTN_NORM); + + launch_ogrespike(org, 500 * dir); + launch_ogrespike(org, 500 * normalize(dir + v_right * 0.125)); + launch_ogrespike(org, 500 * normalize(dir + v_right * -0.125)); + launch_ogrespike(org, 500 * normalize(dir + v_up * 0.075)); + launch_ogrespike(org, 500 * normalize(dir + v_up * -0.075)); +} +*/ + + +void() ogre_dropammo = +{ + // reduced grenade drops from ogres + // don't want to have to keep soaking them up with pointless zombie squads early on + self.ammo_rockets = 1; + DropBackpack(); +} + + +//============================================================================= + +/* +================ +chainsaw + +FIXME +================ +*/ +void(float side) chainsaw = +{ +local vector delta; +local float ldmg; + + if (!self.enemy) + return; + if (!CanDamage (self.enemy, self)) + return; + + ai_charge(10); + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 100) + return; + + ldmg = (random() + random() + random()) * 4; + T_DamageMelee (self.enemy, self, ldmg); + + if (side) + { + makevectors (self.angles); + if (side == 1) + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); + else + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); + } +} + + +void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();} +void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();} +void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();} +void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();} +void() ogre_stand5 =[ $stand5, ogre_stand6 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); +ai_stand(); +} +void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();} +void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();} +void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();} +void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();} + +void() ogre_walk1 =[ $walk1, ogre_walk2 ] {ai_walk(3);} +void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);} +void() ogre_walk3 =[ $walk3, ogre_walk4 ] { +ai_walk(2); +if (random() < 0.2) + sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); +} +void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);} +void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);} +void() ogre_walk6 =[ $walk6, ogre_walk7 ] { +ai_walk(5); +if (random() < 0.1) + sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); +} +void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);} +void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);} +void() ogre_walk9 =[ $walk9, ogre_walk10 ] {ai_walk(3);} +void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);} +void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);} +void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);} +void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);} +void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);} +void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);} +void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);} + +void() ogre_run1 =[ $run1, ogre_run2 ] {ai_run(9); +if (random() < 0.2) + sound (self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE); +} +void() ogre_run2 =[ $run2, ogre_run3 ] {ai_run(12);} +void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);} +void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);} +void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);} +void() ogre_run6 =[ $run6, ogre_run7 ] {ai_run(4);} +void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);} +void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);} + +void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11); +sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); +} +void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1); } +void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);} +void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);} +/* +// what ever the fuck was going on here? +void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);self.angles_y = self.angles_y + random()*25;} +void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);self.angles_y = self.angles_y + random()* 25;} +void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;} +void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;} +void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;} +void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);self.angles_y = self.angles_y + random()* 25;} +void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;} +*/ +void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);} +void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);} +void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);} +void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);} +void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);} +void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);} +void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);} + +void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3); } +void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);} +void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);} + +void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6); +sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); +} +void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);} +void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0); } +void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);} +void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);} +void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0);} +void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);} +void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);} +void() ogre_smash9 =[ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);} +void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1);} +void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0); +self.nextthink = self.nextthink + random()*0.2;} // slight variation +void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge(0); } +void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);} +void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);} + +void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();} +void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();} +void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();} +void() ogre_nail4 =[ $shoot3, ogre_nail5 ] +{ + ai_face(); + OgreFireGrenade(); +} +void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();} +void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();} +void() ogre_nail7 =[ $shoot6, ogre_run1 ] { + ai_face(); + ai_check_refire(ogre_nail2); + ai_attack_finished (1 + 2*random()); +} + +/* +=========== +OgreCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() OgreCheckAttack = +{ + if (enemy_range == RANGE_MELEE) + { + if (CanDamage (self.enemy, self)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if (time < self.attack_finished) + return FALSE; + + if (!enemy_vis) + return FALSE; + + // randomly attack with the chainsaw if enemy has the ring of shadows + // TODO: friendly chainsaw fire to start infights + if (self.enemy.invisible_finished > time) + { + if (random() < 0.2) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if (!CheckClearAttack()) return FALSE; + + // missile attack + if (time < self.attack_finished) + return FALSE; + + if (enemy_range == RANGE_TOOFAR) + return FALSE; + if (self.classname == "monster_ogre" && enemy_range == RANGE_FAR) + return FALSE; // too far for grenades + + self.attack_state = AS_MISSILE; + return TRUE; +} + + +void() ogre_pain1 =[ $pain1, ogre_pain2 ] { } +void() ogre_pain2 =[ $pain2, ogre_pain3 ] {} +void() ogre_pain3 =[ $pain3, ogre_pain4 ] {} +void() ogre_pain4 =[ $pain4, ogre_pain5 ] {} +void() ogre_pain5 =[ $pain5, ogre_run1 ] {} + +void() ogre_painb1 =[ $painb1, ogre_painb2 ] { } +void() ogre_painb2 =[ $painb2, ogre_painb3 ] {} +void() ogre_painb3 =[ $painb3, ogre_run1 ] {} + +void() ogre_painc1 =[ $painc1, ogre_painc2 ] { } +void() ogre_painc2 =[ $painc2, ogre_painc3 ] {} +void() ogre_painc3 =[ $painc3, ogre_painc4 ] {} +void() ogre_painc4 =[ $painc4, ogre_painc5 ] {} +void() ogre_painc5 =[ $painc5, ogre_painc6 ] {} +void() ogre_painc6 =[ $painc6, ogre_run1 ] {} + +void() ogre_paind1 =[ $paind1, ogre_paind2 ] { } +void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);} +void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);} +void() ogre_paind4 =[ $paind4, ogre_paind5 ] {ai_pain(4);} +void() ogre_paind5 =[ $paind5, ogre_paind6 ] {} +void() ogre_paind6 =[ $paind6, ogre_paind7 ] {} +void() ogre_paind7 =[ $paind7, ogre_paind8 ] {} +void() ogre_paind8 =[ $paind8, ogre_paind9 ] {} +void() ogre_paind9 =[ $paind9, ogre_paind10 ] {} +void() ogre_paind10=[ $paind10, ogre_paind11 ] {} +void() ogre_paind11=[ $paind11, ogre_paind12 ] {} +void() ogre_paind12=[ $paind12, ogre_paind13 ] {} +void() ogre_paind13=[ $paind13, ogre_paind14 ] {} +void() ogre_paind14=[ $paind14, ogre_paind15 ] {} +void() ogre_paind15=[ $paind15, ogre_paind16 ] {} +void() ogre_paind16=[ $paind16, ogre_run1 ] {} + +void() ogre_paine1 =[ $paine1, ogre_paine2 ] { } +void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);} +void() ogre_paine3 =[ $paine3, ogre_paine4 ] {ai_pain(9);} +void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);} +void() ogre_paine5 =[ $paine5, ogre_paine6 ] {} +void() ogre_paine6 =[ $paine6, ogre_paine7 ] {} +void() ogre_paine7 =[ $paine7, ogre_paine8 ] {} +void() ogre_paine8 =[ $paine8, ogre_paine9 ] {} +void() ogre_paine9 =[ $paine9, ogre_paine10 ] {} +void() ogre_paine10=[ $paine10, ogre_paine11 ] {} +void() ogre_paine11=[ $paine11, ogre_paine12 ] {} +void() ogre_paine12=[ $paine12, ogre_paine13 ] {} +void() ogre_paine13=[ $paine13, ogre_paine14 ] {} +void() ogre_paine14=[ $paine14, ogre_paine15 ] {} +void() ogre_paine15=[ $paine15, ogre_run1 ] {} + + +void(entity attacker, float damage) ogre_pain = +{ + local float r; + + // don't make multiple pain sounds right after each other + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); + r = random(); + if (r < 0.25) + { + ogre_pain1 (); + PainFinished(1); + } + else if (r < 0.5) + { + ogre_painb1 (); + PainFinished(1); + } + else if (r < 0.75) + { + ogre_painc1 (); + PainFinished(1); + } + else if (r < 0.88) + { + ogre_paind1 (); + PainFinished(2); + } + else + { + ogre_paine1 (); + PainFinished(2); + } +} + +void() ogre_die1 =[ $death1, ogre_die2 ] {} +void() ogre_die2 =[ $death2, ogre_die3 ] {} +void() ogre_die3 =[ $death3, ogre_die4 ] { + self.solid = SOLID_NOT; + ogre_dropammo(); +} +void() ogre_die4 =[ $death4, ogre_die5 ] {} +void() ogre_die5 =[ $death5, ogre_die6 ] {} +void() ogre_die6 =[ $death6, ogre_die7 ] {} +void() ogre_die7 =[ $death7, ogre_die8 ] {} +void() ogre_die8 =[ $death8, ogre_die9 ] {} +void() ogre_die9 =[ $death9, ogre_die10 ] {} +void() ogre_die10 =[ $death10, ogre_die11 ] {} +void() ogre_die11 =[ $death11, ogre_die12 ] {} +void() ogre_die12 =[ $death12, ogre_die13 ] {} +void() ogre_die13 =[ $death13, ogre_die14 ] {} +void() ogre_die14 =[ $death14, ogre_die14 ] {} + +void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {} +void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {ai_forward(5);} +void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] { + self.solid = SOLID_NOT; + ogre_dropammo(); +} +void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);} +void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);} +void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);} +void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);} +void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {} +void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {} +void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {} + +void() ogre_die = +{ +// check for gib + if (self.health < -80) + { + Gib ("progs/h_ogre.mdl", self.health); + return; + } + + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + + if (random() < 0.5) + ogre_die1 (); + else + ogre_bdie1 (); +} + +void() ogre_melee = +{ + if (random() > 0.5) + ogre_smash1 (); + else + ogre_swing1 (); +} + + + + +//============================================================================= + + + +void() monster_ogre_spawn = +{ + self.classname = "monster_ogre"; + self.type = "ogre"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/ogre.mdl"); + + setsize (self, VEC_HULL2_MIN, '32 32 40'); + self.health = 200; + + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_die = ogre_die; + self.th_melee = ogre_melee; + self.th_missile = ogre_nail1; + self.th_pain = ogre_pain; + self.th_checkattack = OgreCheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was destroyed by an Ogre"; + + walkmonster_start(); +} + +void() monster_ogre_spawner = {mon_spawner_use(monster_ogre_spawn);} + +/*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Ogre, 200 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model({ "path": ":progs/ogre.mdl" }) = monster_ogre : "Ogre" [] +*/ +void() monster_ogre = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/ogre.mdl"); + precache_model ("progs/h_ogre.mdl"); + precache_model ("progs/grenade.mdl"); + + precache_sound ("ogre/ogdrag.wav"); + precache_sound ("ogre/ogdth.wav"); + precache_sound ("ogre/ogidle.wav"); + precache_sound ("ogre/ogidle2.wav"); + precache_sound ("ogre/ogpain1.wav"); + precache_sound ("ogre/ogsawatk.wav"); + precache_sound ("ogre/ogwake.wav"); + + self.health = 200; + if ( monster_spawnsetup( monster_ogre_spawner ) ) return; + + addmonster(1); + monster_ogre_spawn(); +} + +void() monster_ogre_marksman = +{ + monster_ogre (); +} + diff --git a/QC_other/QC_copper/m_oldone.qc b/QC_other/QC_copper/m_oldone.qc new file mode 100644 index 00000000..66e075d9 --- /dev/null +++ b/QC_other/QC_copper/m_oldone.qc @@ -0,0 +1,419 @@ +/* +============================================================================== + +OLD ONE + +============================================================================== +*/ +$cd id1/models/old_one +$origin 0 0 24 +$base base +$skin skin +$scale 1 + +$frame old1 old2 old3 old4 old5 old6 old7 old8 old9 +$frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19 +$frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29 +$frame old30 old31 old32 old33 old34 old35 old36 old37 old38 old39 +$frame old40 old41 old42 old43 old44 old45 old46 + +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 +$frame shake15 shake16 shake17 shake18 shake19 shake20 + +void() old_idle1 =[ $old1, old_idle2 ] {} +void() old_idle2 =[ $old2, old_idle3 ] {} +void() old_idle3 =[ $old3, old_idle4 ] {} +void() old_idle4 =[ $old4, old_idle5 ] {} +void() old_idle5 =[ $old5, old_idle6 ] {} +void() old_idle6 =[ $old6, old_idle7 ] {} +void() old_idle7 =[ $old7, old_idle8 ] {} +void() old_idle8 =[ $old8, old_idle9 ] {} +void() old_idle9 =[ $old9, old_idle10 ] {} +void() old_idle10 =[ $old10, old_idle11 ] {} +void() old_idle11 =[ $old11, old_idle12 ] {} +void() old_idle12 =[ $old12, old_idle13 ] {} +void() old_idle13 =[ $old13, old_idle14 ] {} +void() old_idle14 =[ $old14, old_idle15 ] {} +void() old_idle15 =[ $old15, old_idle16 ] {} +void() old_idle16 =[ $old16, old_idle17 ] {} +void() old_idle17 =[ $old17, old_idle18 ] {} +void() old_idle18 =[ $old18, old_idle19 ] {} +void() old_idle19 =[ $old19, old_idle20 ] {} +void() old_idle20 =[ $old20, old_idle21 ] {} +void() old_idle21 =[ $old21, old_idle22 ] {} +void() old_idle22 =[ $old22, old_idle23 ] {} +void() old_idle23 =[ $old23, old_idle24 ] {} +void() old_idle24 =[ $old24, old_idle25 ] {} +void() old_idle25 =[ $old25, old_idle26 ] {} +void() old_idle26 =[ $old26, old_idle27 ] {} +void() old_idle27 =[ $old27, old_idle28 ] {} +void() old_idle28 =[ $old28, old_idle29 ] {} +void() old_idle29 =[ $old29, old_idle30 ] {} +void() old_idle30 =[ $old30, old_idle31 ] {} +void() old_idle31 =[ $old31, old_idle32 ] {} +void() old_idle32 =[ $old32, old_idle33 ] {} +void() old_idle33 =[ $old33, old_idle34 ] {} +void() old_idle34 =[ $old34, old_idle35 ] {} +void() old_idle35 =[ $old35, old_idle36 ] {} +void() old_idle36 =[ $old36, old_idle37 ] {} +void() old_idle37 =[ $old37, old_idle38 ] {} +void() old_idle38 =[ $old38, old_idle39 ] {} +void() old_idle39 =[ $old39, old_idle40 ] {} +void() old_idle40 =[ $old40, old_idle41 ] {} +void() old_idle41 =[ $old41, old_idle42 ] {} +void() old_idle42 =[ $old42, old_idle43 ] {} +void() old_idle43 =[ $old43, old_idle44 ] {} +void() old_idle44 =[ $old44, old_idle45 ] {} +void() old_idle45 =[ $old45, old_idle46 ] {} +void() old_idle46 =[ $old46, old_idle1 ] {} + +void() old_thrash1 =[ $shake1, old_thrash2 ] {lightstyle(0, "m"); + sound (self, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NONE); + screenshake_oneshot(0.2, 0.8, 0.8, 1.5); + //self.use = SUB_Null; +} +void() old_thrash2 =[ $shake2, old_thrash3 ] {lightstyle(0, "k");} +void() old_thrash3 =[ $shake3, old_thrash4 ] {lightstyle(0, "j");} +void() old_thrash4 =[ $shake4, old_thrash5 ] {lightstyle(0, "h");} +void() old_thrash5 =[ $shake5, old_thrash6 ] {lightstyle(0, "g");} +void() old_thrash6 =[ $shake6, old_thrash7 ] {lightstyle(0, "e");} +void() old_thrash7 =[ $shake7, old_thrash8 ] {lightstyle(0, "c");} +void() old_thrash8 =[ $shake8, old_thrash9 ] {lightstyle(0, "a");} +void() old_thrash9 =[ $shake9, old_thrash10 ] {lightstyle(0, "b");} +void() old_thrash10 =[ $shake10, old_thrash11 ] {lightstyle(0, "e");} +void() old_thrash11 =[ $shake11, old_thrash12 ] {lightstyle(0, "f");} +void() old_thrash12 =[ $shake12, old_thrash13 ] {lightstyle(0, "g");} +void() old_thrash13 =[ $shake13, old_thrash14 ] {lightstyle(0, "i");} +void() old_thrash14 =[ $shake14, old_thrash15 ] {lightstyle(0, "j");} +void() old_thrash15 =[ $shake15, old_thrash16 ] {lightstyle(0, "h");} +void() old_thrash16 =[ $shake16, old_thrash17 ] {lightstyle(0, "e");} +void() old_thrash17 =[ $shake17, old_thrash18 ] {lightstyle(0, "g");} +void() old_thrash18 =[ $shake18, old_thrash19 ] {lightstyle(0, "j"); + // the death gurgle is the same sound looped, so stop it by overriding that channel with nothing + sound (self, CHAN_VOICE, "misc/null.wav", 1, ATTN_NORM); + + if (world.model == "maps/end.bsp" && self.health <= 0) + { + if (self.strength) + { + self.strength -= 1; + self.think = old_thrash1; + } + return; + } + + if (self.strength) + { + lightstyle(0, "m"); + self.think = old_idle1; + //self.use = shub_use; + return; + } +} +void() old_thrash19 =[ $shake19, old_thrash20 ] {lightstyle(0, "k");} +void() old_thrash20 =[ $shake20, shub_finale_4 ] {lightstyle(0, "m");} + +//============================================================================ + +// make fake versions of all players as standins, and move the real +// players to the intermission spot +void() shub_set_viewpoints = +{ + local entity pos, pl; + + intermission_exittime = time + A_SHITLOAD; // no exit yet + intermission_running = 1; + + // find the intermission spot + pos = find (world, classname, "info_intermission"); + if (!pos) + pos = find (world, classname, "info_player_start"); + if (!pos) + error ("no info_intermission"); + self.buddy = pos; + pl = find (world, classname, "misc_teleporttrain"); + if (pl) remove (pl); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, string_null); + + move_players_to_intermission(); +} + +void() shub_dudecycle = +{ + self.frame += 1; + if (skill > 2) + { + if (self.frame > 28) self.frame = 17; + } + else + { + if (self.frame > 16) self.frame = 12; + } + self.nextthink = time + 0.1; +} + +void() shub_finale_1 = +{ + local entity timer; + + shub_set_viewpoints(); + + // wait for 1 second + timer = spawn(); + timer.nextthink = time + 1; + timer.think = shub_finale_2; + timer.enemy = self; +} + +void() shub_finale_2 = +{ + local vector o; + + // start a teleport splash inside shub + + o = self.enemy.origin - '0 100 0'; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, o_x); + WriteCoord (MSG_BROADCAST, o_y); + WriteCoord (MSG_BROADCAST, o_z); + + sound (self.enemy, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + + self.nextthink = time + 2; + self.think = shub_finale_3; +} + +void() shub_finale_3 = +{ + // start shub thrashing wildly + self.enemy.strength = 2; + self.enemy.think = old_thrash1; +} + +void() shub_finale_4 = +{ + vector org; + entity n; + float x, y, z; + float r; + + sound (n, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NONE); + + // throw tons of meat chunks + org = self.origin; + + for (z = 16; z <= 144; z += 96) + { + for (x = -64; x <= 64; x += 32) + { + for (y = -64; y <= 64; y += 32) + { + self.origin_x = org_x + x; + self.origin_y = org_y + y; + self.origin_z = org_z + z; + + r = random(); + if (r < 0.3) + ThrowGib ("progs/gib1.mdl", -300); + else if (r < 0.6) + ThrowGib ("progs/gib2.mdl", -300); + else + ThrowGib ("progs/gib3.mdl", -300); + } + } + } + + lightstyle(0, "m"); + self.origin = org; + killed_monster(); + activator = self.enemy; + monster_death_use(); + + if (world.model == "maps/end.bsp") + { + // do this if we triggered shub to death + if (self.health >= 0) + shub_set_viewpoints(); + + // put a player model down + n = spawn(); + setmodel (n, "progs/player.mdl"); + //org = self.origin; + org = (org + self.buddy.origin) * 0.5; + org_z = self.origin_z; + setorigin (n, org); + if (skill > 2) // axe on nightmare because you are very badass + { + n.angles = '0 235 0'; + n.frame = 17 + ceil(random() * 10); + } + else + { + n.angles = '0 295 0'; + n.frame = 12 + ceil(random() * 2); + } + n.think = shub_dudecycle; + n.nextthink = time + 0.1; + + // kill everything else + shub_gibnearby(); + Cheat_Genocide(); + + // allow the player to click back to a reset start map + nextmap = self.map; + intermission_exittime = time + 3; + intermission_running = 2; + serverflags = 0; // clear all the runes and stuff + + // start the end text + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Congratulations, and well done! You have\nbeaten the hideous Shub-Niggurath and\nher hundreds of ugly changelings and\nmonsters. You have proven that your\nskill and your cunning are greater than\nall the powers of Quake. You are the\nmaster now.\n\nId Software is currently out of the\noffice, but if you leave a message,\nthey will be happy to salute you in\na couple of months."); + + // switch cd track + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 2); + } + + remove (self); +} + + +void() shub_axefinale_1 = +{ + shub_set_viewpoints(); + shub_finale_4(); +} + +//============================================================================ + +// clean up environs for the dramatic final shot - gib monsters in the way so the +// body pile isn't too deep, and just get rid of backpacks +void() shub_gibnearby = +{ + entity head; + + head = findradius(self.origin, 272); + while (head) + { + if (head.flags & FL_MONSTER) + { + T_Damage(head, self, self, head.health + 100); + } + head = head.chain; + } + + head = findradiusplus(self.origin, 272, classname, "item_backpack"); + while (head) + { + remove(head); + head = head.chain; + } +} + +void() shub_die = +{ + self.deadflag = DEAD_DYING; + if (world.model == "maps/end.bsp") + shub_finale_1(); + else + shub_finale_4(); +} + +// rather than a telefrag, shub can be killed by triggering her a +// specifiable number of times, to allow for more possible encounters +void() shub_use = +{ + self.strength -= 1; + self.enemy = activator; + old_thrash1(); +} + +void (entity attacker, float damage) shub_pain = +{ + if (self.deadflag) return; + + // a separate 'pain counter' is reduced by + // any damage over 10000 + if (damage >= 10000) + { + shub_use(); + } + if (self.health > 0) + self.health = 49999; // stay dead +} + +//============================================================================ + + +/*QUAKED monster_oldone (1 0 0) (-128 -128 -24) (128 128 256) +shubby + +explodes in gibs on death. can be killed by traditional telefrag or in several new ways: +- being triggered "strength" times +- being damaged for more than 10000 hp "strength" times +both of the above cause one thrashy roary anim that flickers the lights and causes a screenshake. + +if the map is end.bsp, the finale cutscene will trigger, otherwise shub will just die like any other monster. + +Keyvalues: +"strength" number of hits to take before exploding, defaults to 3 +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname, Angle) size(-128 -128 -24, 128 128 256) model({ "path": ":progs/oldone.mdl" }) = monster_oldone : +"Shubby +can be killed by traditional telefrag or in several new ways: +- being triggered 'strength' times +- being damaged for more than 10000 hp 'strength' times +both of the above cause one thrashy roary anim that flickers the lights and causes a screenshake. +if the map is end.bsp, the finale cutscene will trigger, otherwise shub will just die like any other monster." +[ + strength(integer) : "Health, in hits" : 3 +] +*/ +void() monster_oldone = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + + precache_model2 ("progs/oldone.mdl"); + + precache_sound2 ("boss2/death.wav"); + precache_sound2 ("boss2/idle.wav"); + precache_sound2 ("boss2/sight.wav"); + precache_sound2 ("boss2/pop2.wav"); + precache_sound ("misc/null.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.type = "boss"; + + setmodel (self, "progs/oldone.mdl"); + setsize (self, '-128 -128 -24', '128 128 256'); + + if (!self.strength) + self.strength = 3; + if (!self.map) + self.map = "start"; + if (self.deathtype == string_null) + self.deathtype = "became one with Shub-Niggurath"; + + self.health = 49999; // kill by telefrag + self.think = old_idle1; + self.nextthink = time + 0.1; + self.takedamage = DAMAGE_YES; + self.th_pain = shub_pain; + self.th_die = shub_die; + self.use = shub_use; + + total_monsters = total_monsters + 1; +} + diff --git a/QC_other/QC_copper/m_shalrath.qc b/QC_other/QC_copper/m_shalrath.qc new file mode 100644 index 00000000..0e856d6e --- /dev/null +++ b/QC_other/QC_copper/m_shalrath.qc @@ -0,0 +1,355 @@ +/* +============================================================================== + +SHAL-RATH + +============================================================================== +*/ + +float SHAL_BALL_TURN_RATE = 225; +float SHAL_BALL_THINK_RATE = 0.1;//0.075; +float SHAL_BALL_VEL = 272; + + +$cd id1/models/shalrath +$origin 0 0 24 +$base base +$skin skin +$scale 0.7 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 + +void() shal_stand =[ $walk1, shal_stand ] {ai_stand();} + +void() shal_walk1 =[ $walk2, shal_walk2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE); +ai_walk(6);} +void() shal_walk2 =[ $walk3, shal_walk3 ] {ai_walk(4);} +void() shal_walk3 =[ $walk4, shal_walk4 ] {ai_walk(0);} +void() shal_walk4 =[ $walk5, shal_walk5 ] {ai_walk(0);} +void() shal_walk5 =[ $walk6, shal_walk6 ] {ai_walk(0);} +void() shal_walk6 =[ $walk7, shal_walk7 ] {ai_walk(0);} +void() shal_walk7 =[ $walk8, shal_walk8 ] {ai_walk(5);} +void() shal_walk8 =[ $walk9, shal_walk9 ] {ai_walk(6);} +void() shal_walk9 =[ $walk10, shal_walk10 ] {ai_walk(5);} +void() shal_walk10 =[ $walk11, shal_walk11 ] {ai_walk(0);} +void() shal_walk11 =[ $walk12, shal_walk12 ] {ai_walk(4);} +void() shal_walk12 =[ $walk1, shal_walk1 ] {ai_walk(5);} + +void() shal_run1 =[ $walk2, shal_run2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE); +ai_run(6);} +void() shal_run2 =[ $walk3, shal_run3 ] {ai_run(4);} +void() shal_run3 =[ $walk4, shal_run4 ] {ai_run(0);} +void() shal_run4 =[ $walk5, shal_run5 ] {ai_run(0);} +void() shal_run5 =[ $walk6, shal_run6 ] {ai_run(0);} +void() shal_run6 =[ $walk7, shal_run7 ] {ai_run(0);} +void() shal_run7 =[ $walk8, shal_run8 ] {ai_run(5);} +void() shal_run8 =[ $walk9, shal_run9 ] {ai_run(6);} +void() shal_run9 =[ $walk10, shal_run10 ] {ai_run(5);} +void() shal_run10 =[ $walk11, shal_run11 ] {ai_run(0);} +void() shal_run11 =[ $walk12, shal_run12 ] {ai_run(4);} +void() shal_run12 =[ $walk1, shal_run1 ] {ai_run(5);} + +void() shal_attack1 =[ $attack1, shal_attack2 ] { +sound (self, CHAN_VOICE, "shalrath/attack.wav", 1, ATTN_NORM); +ai_face(); +} +void() shal_attack2 =[ $attack2, shal_attack3 ] {ai_face();} +void() shal_attack3 =[ $attack3, shal_attack4 ] {ai_face();} +void() shal_attack4 =[ $attack4, shal_attack5 ] {ai_face();} +void() shal_attack5 =[ $attack5, shal_attack6 ] {ai_face();} +void() shal_attack6 =[ $attack6, shal_attack7 ] {ai_face();} +void() shal_attack7 =[ $attack7, shal_attack8 ] {ai_face();} +void() shal_attack8 =[ $attack8, shal_attack9 ] {ai_face();} +void() shal_attack9 =[ $attack9, shal_attack10 ] {ShalMissile();} +void() shal_attack10 =[ $attack10, shal_attack11 ] {ai_face();} +void() shal_attack11 =[ $attack11, shal_run1 ] {} + +void() shal_pain1 =[ $pain1, shal_pain2 ] {} +void() shal_pain2 =[ $pain2, shal_pain3 ] {} +void() shal_pain3 =[ $pain3, shal_pain4 ] {} +void() shal_pain4 =[ $pain4, shal_pain5 ] {} +void() shal_pain5 =[ $pain5, shal_run1 ] {} + +void() shal_death1 =[ $death1, shal_death2 ] {} +void() shal_death2 =[ $death2, shal_death3 ] {self.solid = SOLID_NOT;} +void() shal_death3 =[ $death3, shal_death4 ] {} +void() shal_death4 =[ $death4, shal_death5 ] {} +void() shal_death5 =[ $death5, shal_death6 ] {} +void() shal_death6 =[ $death6, shal_death7 ] {} +void() shal_death7 =[ $death7, shal_death7 ] {} + + +void( entity attacker, float damage ) shalrath_pain = +{ + if (self.health <= 0) return; + if (self.pain_finished > time) return; + + sound (self, CHAN_VOICE, "shalrath/pain.wav", 1, ATTN_NORM); + shal_pain1(); + + PainFinished(3); +} + +void() shalrath_die = +{ +// check for gib + if (self.health < -90) + { + Gib ("progs/h_shal.mdl", self.health); + return; + } + + sound (self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM); + shal_death1(); +} + +/* +================ +ShalMissile +================ +*/ + +void() ShalMissileExplode = +{ + T_RadiusDamage (self, self.trueowner, 40, world); + sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + + BecomeExplosion(); +} + +void() ShalMissileTouch = +{ + if (CheckProjectilePassthru()) return; + if (other == self.owner) + return; // don't explode on owner + + if (other.type == "zombie") + T_Damage (other, self, self.trueowner, other.health + 25); + + ShalMissileExplode(); +} + +vector(entity targ, float turnrate) ShalTurnToward = +{ + vector vel, aimdir, temp, temp2, out; + + temp = targ.origin + '0 0 10'; + aimdir = temp - self.origin; + aimdir = normalize(aimdir); + vel = normalize(self.velocity); + + temp = CrossProduct(vel, aimdir); + out = rotateVectorAround(vel, temp, turnrate * SHAL_BALL_THINK_RATE); + + // don't turn past the desired direction + temp2 = CrossProduct(out, aimdir); + if ((temp * temp2) < 0) + return aimdir; + return out; +} + +void() ShalHome = +{ + // a voreball with perfect homing causes combat to effectively stop, forcing the player + // to run around around trying to shake it, often backpedaling through lots of empty map. + // limiting the voreball's turn rate so they can be dodged and forgotten about makes vores + // a more flexible enemy and more useful to the mapper + float dist, rate, dot; + + if (self.lifetime_finished < time) + { + ShalMissileExplode(); + return; + } + if (self.enemy.health <= 0) + { + remove(self); + return; + } + + self.nextthink = time + SHAL_BALL_THINK_RATE; + rate = SHAL_BALL_TURN_RATE; + dot = normalize(self.velocity) * normalize(self.enemy.origin - self.origin); + + // 'poor' homing (half turn rate): + if ( self.owner.health <= 0 // if our mama dies + //|| !visible(self.enemy) // if we lost LOS + // took ^^ this one out, because it made voreballs even more effective at going + // around corners, which meant that high skill players had a nice new dodge move + // but average players who tried to fight the vore the old cautious way were punished + || self.enemy.invisible_finished > time // if target is invis + || pointcontents(self.origin) < CONTENT_SOLID ) // if voreball is underwater + { + // voreballs headed straight at the player when he's hidden should maintain course, to + // make the dodge possible without it immediately turning to hit him + if (dot > 0) + { + rate *= max(1, 1.5 * (1 - dot)); + } + self.velocity = SHAL_BALL_VEL * ShalTurnToward(self.enemy, rate * 0.5); + } + else // good homing (full turn rate): + { + // voreballs headed straight away from the player don't normally seem to be able to pick a direction to + // turn and wobble more or less straight away - amp turn rate in these cases to force a 'decision' + if (dot < 0) + { + rate *= min(1.4, 1.4 + fabs(dot)); + } + // FIXME: figure out how to stop them veering up or down when they don't have to + self.velocity = SHAL_BALL_VEL * ShalTurnToward(self.enemy, rate); + } + + // go faster at long distance to close the gap, so snipey vores have a better presence + dist = vlen(self.enemy.origin - self.origin); + dist = saturate( (dist-120) / 512 ); + self.velocity *= 1 + dist; + + self.think = ShalHome; + self.oldvelocity = self.velocity; +} + + +/* +void() ShalHome = +{ + local vector dir, vtemp; + + if (self.attack_finished < time) + { + ShalMissileExplode(); + return; + } + + vtemp = self.enemy.origin + '0 0 10'; + + if (self.enemy.health < 1) + { + remove(self); + return; + } + dir = normalize(vtemp - self.origin); + if (skill >= 3) + self.velocity = dir * 350; + else + self.velocity = dir * 250; + self.nextthink = time + 0.2; + self.think = ShalHome; +} +*/ + +void() ShalMissile = +{ + local entity missile; +/* local vector dir; + local float dist, flytime; + + dir = normalize((self.enemy.origin + '0 0 10') - self.origin); + dist = vlen (self.enemy.origin - self.origin); + flytime = dist * 0.002; + if (flytime < 0.1) + flytime = 0.1; +*/ + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM); + makevectors(self.angles); + + missile = launch_projectile(self.origin + '0 0 10' + v_forward * 16, normalize((enemy_vispos() + '0 0 10') - self.origin) * 300); + + SUB_ChangeModel (missile, "progs/v_spike.mdl"); + + missile.avelocity = '300 300 300'; + missile.nextthink = time + 0.1; + missile.think = ShalHome; + missile.enemy = self.enemy; + missile.touch = ShalMissileTouch; + missile.lifetime_finished = time + 30; // blow up after a while +} + +//================================================================= +void() monster_shalrath_spawn = +{ + self.classname = "monster_shalrath"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/shalrath.mdl"); + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + self.health = 400; + + self.th_stand = shal_stand; + self.th_walk = shal_walk1; + self.th_run = shal_run1; + self.th_die = shalrath_die; + self.th_pain = shalrath_pain; + self.th_missile = shal_attack1; + self.th_checkattack = CheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was exploded by a Vore"; + + self.think = walkmonster_start; + self.nextthink = time + 0.1 + random ()*0.1; +} + +void() monster_shalrath_spawner = {mon_spawner_use(monster_shalrath_spawn);} + + +/*QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Vore (Shalrath), 400 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model({ "path": ":progs/shalrath.mdl" }) = monster_shalrath : "Vore" [] +*/ +void() monster_shalrath = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model2 ("progs/shalrath.mdl"); + precache_model2 ("progs/h_shal.mdl"); + precache_model2 ("progs/v_spike.mdl"); + + precache_sound2 ("shalrath/attack.wav"); + precache_sound2 ("shalrath/attack2.wav"); + precache_sound2 ("shalrath/death.wav"); + precache_sound2 ("shalrath/idle.wav"); + precache_sound2 ("shalrath/pain.wav"); + precache_sound2 ("shalrath/sight.wav"); + + self.health = 400; + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + if ( monster_spawnsetup( monster_shalrath_spawner ) ) return; + + addmonster(1); + monster_shalrath_spawn(); +} diff --git a/QC_other/QC_copper/m_shambler.qc b/QC_other/QC_copper/m_shambler.qc new file mode 100644 index 00000000..b279a038 --- /dev/null +++ b/QC_other/QC_copper/m_shambler.qc @@ -0,0 +1,496 @@ +/* +============================================================================== + +SMABLER + +============================================================================== +*/ + +float SHAM_LIGHTNING_RANGE = 640; + +$cd id1/models/shams +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 + +$frame run1 run2 run3 run4 run5 run6 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 + +$frame swingr1 swingr2 swingr3 swingr4 swingr5 +$frame swingr6 swingr7 swingr8 swingr9 + +$frame swingl1 swingl2 swingl3 swingl4 swingl5 +$frame swingl6 swingl7 swingl8 swingl9 + +$frame magic1 magic2 magic3 magic4 magic5 +$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 + +void() sham_stand1 =[ $stand1, sham_stand2 ] {ai_stand();} +void() sham_stand2 =[ $stand2, sham_stand3 ] {ai_stand();} +void() sham_stand3 =[ $stand3, sham_stand4 ] {ai_stand();} +void() sham_stand4 =[ $stand4, sham_stand5 ] {ai_stand();} +void() sham_stand5 =[ $stand5, sham_stand6 ] {ai_stand();} +void() sham_stand6 =[ $stand6, sham_stand7 ] {ai_stand();} +void() sham_stand7 =[ $stand7, sham_stand8 ] {ai_stand();} +void() sham_stand8 =[ $stand8, sham_stand9 ] {ai_stand();} +void() sham_stand9 =[ $stand9, sham_stand10] {ai_stand();} +void() sham_stand10 =[ $stand10, sham_stand11] {ai_stand();} +void() sham_stand11 =[ $stand11, sham_stand12] {ai_stand();} +void() sham_stand12 =[ $stand12, sham_stand13] {ai_stand();} +void() sham_stand13 =[ $stand13, sham_stand14] {ai_stand();} +void() sham_stand14 =[ $stand14, sham_stand15] {ai_stand();} +void() sham_stand15 =[ $stand15, sham_stand16] {ai_stand();} +void() sham_stand16 =[ $stand16, sham_stand17] {ai_stand();} +void() sham_stand17 =[ $stand17, sham_stand1 ] {ai_stand();} + +void() sham_walk1 =[ $walk1, sham_walk2 ] {ai_walk(10);} +void() sham_walk2 =[ $walk2, sham_walk3 ] {ai_walk(9);} +void() sham_walk3 =[ $walk3, sham_walk4 ] {ai_walk(9);} +void() sham_walk4 =[ $walk4, sham_walk5 ] {ai_walk(5);} +void() sham_walk5 =[ $walk5, sham_walk6 ] {ai_walk(6);} +void() sham_walk6 =[ $walk6, sham_walk7 ] {ai_walk(12);} +void() sham_walk7 =[ $walk7, sham_walk8 ] {ai_walk(8);} +void() sham_walk8 =[ $walk8, sham_walk9 ] {ai_walk(3);} +void() sham_walk9 =[ $walk9, sham_walk10] {ai_walk(13);} +void() sham_walk10 =[ $walk10, sham_walk11] {ai_walk(9);} +void() sham_walk11 =[ $walk11, sham_walk12] {ai_walk(7);} +void() sham_walk12 =[ $walk12, sham_walk1 ] {ai_walk(7); +if (random() > 0.8) + sound (self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);} + +void() sham_run1 =[ $run1, sham_run2 ] {ai_run(20);} +void() sham_run2 =[ $run2, sham_run3 ] {ai_run(24);} +void() sham_run3 =[ $run3, sham_run4 ] {ai_run(20);} +void() sham_run4 =[ $run4, sham_run5 ] {ai_run(20);} +void() sham_run5 =[ $run5, sham_run6 ] {ai_run(24);} +void() sham_run6 =[ $run6, sham_run1 ] {ai_run(20); +if (random() > 0.8) + sound (self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE); +} + +void() ShamSmash = +{ + local vector delta; + local float ldmg; + + if (!self.enemy) + return; + ai_charge(0); + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 100) + return; + if (!CanDamage (self.enemy, self)) + return; + + ldmg = (random() + random() + random()) * 40; + T_DamageMelee (self.enemy, self, ldmg); + sound (self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); + + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); +} + +void() sham_smash1 =[ $smash1, sham_smash2 ] { + sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); + ai_charge(2); +} +void() sham_smash2 =[ $smash2, sham_smash3 ] {ai_charge(6);} +void() sham_smash3 =[ $smash3, sham_smash4 ] {ai_charge(6);} +void() sham_smash4 =[ $smash4, sham_smash5 ] {ai_charge(5);} +void() sham_smash5 =[ $smash5, sham_smash6 ] {ai_charge(4);} +void() sham_smash6 =[ $smash6, sham_smash7 ] {ai_charge(1);} +void() sham_smash7 =[ $smash7, sham_smash8 ] {ai_charge(0);} +void() sham_smash8 =[ $smash8, sham_smash9 ] {ai_charge(0);} +void() sham_smash9 =[ $smash9, sham_smash10 ] {ai_charge(0);} +void() sham_smash10 =[ $smash10, sham_smash11 ] {ShamSmash();} +void() sham_smash11 =[ $smash11, sham_smash12 ] {ai_charge(5);} +void() sham_smash12 =[ $smash12, sham_run1 ] {ai_charge(4);} + +void(float side) ShamClaw = +{ + float ldmg; + + if (!self.enemy) + return; + ai_charge(10); + + if (vdist(self.enemy.origin, self.origin) > 100) + return; + + ldmg = (random() + random() + random()) * 20; + T_DamageMelee (self.enemy, self, ldmg); + sound (self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); + + if (side) + { + makevectors (self.angles); + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); + } +} + +void() sham_swingl1 =[ $swingl1, sham_swingl2 ] { + sound (self, CHAN_VOICE, "shambler/melee2.wav", 1, ATTN_NORM); + ai_charge(5); +} +void() sham_swingl2 =[ $swingl2, sham_swingl3 ] {ai_charge(3);} +void() sham_swingl3 =[ $swingl3, sham_swingl4 ] {ai_charge(7);} +void() sham_swingl4 =[ $swingl4, sham_swingl5 ] {ai_charge(3);} +void() sham_swingl5 =[ $swingl5, sham_swingl6 ] {ai_charge(7);} +void() sham_swingl6 =[ $swingl6, sham_swingl7 ] {ai_charge(9);} +void() sham_swingl7 =[ $swingl7, sham_swingl8 ] {ai_charge(5); ShamClaw(250);} +void() sham_swingl8 =[ $swingl8, sham_swingl9 ] {ai_charge(4);} +void() sham_swingl9 =[ $swingl9, sham_run1 ] { + ai_charge(8); + if (random()<0.5 && + vdist(self.enemy.origin, self.origin) < 100 && + CheckClearAttack()) + self.think = sham_swingr1; +} + +void() sham_swingr1 =[ $swingr1, sham_swingr2 ] { + sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); + ai_charge(1); +} +void() sham_swingr2 =[ $swingr2, sham_swingr3 ] {ai_charge(8);} +void() sham_swingr3 =[ $swingr3, sham_swingr4 ] {ai_charge(14);} +void() sham_swingr4 =[ $swingr4, sham_swingr5 ] {ai_charge(7);} +void() sham_swingr5 =[ $swingr5, sham_swingr6 ] {ai_charge(3);} +void() sham_swingr6 =[ $swingr6, sham_swingr7 ] {ai_charge(6);} +void() sham_swingr7 =[ $swingr7, sham_swingr8 ] {ai_charge(6); ShamClaw(-250);} +void() sham_swingr8 =[ $swingr8, sham_swingr9 ] {ai_charge(3);} +void() sham_swingr9 =[ $swingr9, sham_run1 ] { + ai_charge(11); + if (random()<0.5 && + vdist(self.enemy.origin, self.origin) < 100 && + CheckClearAttack()) + self.think = sham_swingl1; +} + +void() sham_melee = +{ + if (self.enemy.type == "zombie") + { + sham_smash1(); // just fuck up a zombie and get on with life + return; + } + + float chance; + chance = random(); + + // gradually building chance that the shambler will lightning instead of + // continuing to melee, so that attempting a shambler dance is an + // increasingly dangerous gamble and not a solidly predictable exploit + if (chance < floor(self.cnt) / 6.66) // step up by 15% every other melee + { + sham_magic1(); + return; + } + + if (self.health > 575) + { + if (chance > 0.2) + sham_smash1 (); + else if (chance > 0.1) + sham_swingr1 (); + else + sham_swingl1 (); + } + else + { + if (chance > 0.6) + sham_smash1 (); + else if (chance > 0.3) + sham_swingr1 (); + else + sham_swingl1 (); + } + self.cnt += 0.5; +} + + +//============================================================================ + +void() CastLightning = +{ + local vector org, dir; + + self.effects = self.effects | EF_MUZZLEFLASH; + + org = self.origin + '0 0 40'; + + // shamblers look weird when their lightning jumps around seeking the player + if (self.enemy.invisible_finished < time) + { + ai_face (); + dir = enemy_vispos() + '0 0 16' - org; + dir = normalize (dir); + } + else + { + makevectors(self.angles); + dir = v_forward; + } + + traceline2(org, self.origin + dir * SHAM_LIGHTNING_RANGE, self, TRACE_NOMONSTERS); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + LightningDamage (org, trace_endpos, self, 10); +} + +void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face(); + sound (self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM); + self.cnt = 0; +} +void() sham_magic2 =[ $magic2, sham_magic3 ] {ai_face();} +void() sham_magic3 =[ $magic3, sham_magic4 ] {ai_face(); + self.nextthink = self.nextthink + 0.2; + local entity o; + + self.effects = self.effects | EF_MUZZLEFLASH; + ai_face(); + self.buddy = spawn(); + o = self.buddy; + setmodel (o, "progs/s_light.mdl"); + setorigin (o, self.origin); + o.angles = self.angles; + o.nextthink = time + 0.7; + o.think = SUB_Remove; +} +void() sham_magic4 =[ $magic4, sham_magic5 ] +{ + self.effects = self.effects | EF_MUZZLEFLASH; + self.buddy.frame = 1; +} +void() sham_magic5 =[ $magic5, sham_magic6 ] +{ + self.effects = self.effects | EF_MUZZLEFLASH; + self.buddy.frame = 2; +} +void() sham_magic6 =[ $magic6, sham_magic9 ] +{ + remove (self.buddy); + sound (self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM); + CastLightning(); +} +void() sham_magic9 =[ $magic9, sham_magic10 ]{ CastLightning();} +void() sham_magic10 =[ $magic10, sham_magic11n ]{ CastLightning();} +void() sham_magic11n =[ $magic11, sham_magic12 ] {} +void() sham_magic12 =[ $magic12, sham_run1 ] {} + +// nightmare no longer needs special cases like this to force the game to seem harder, +// but we save this function with the name preserved because it's been used in past +// maps as a secret hack way to fire nightmare-only triggers +void() sham_magic11 =[ $magic11, sham_magic12 ]{ if (skill >= 3) CastLightning(); } + + +void() sham_pain1 =[ $pain1, sham_pain2 ] {} +void() sham_pain2 =[ $pain2, sham_pain3 ] {} +void() sham_pain3 =[ $pain3, sham_pain4 ] {} +void() sham_pain4 =[ $pain4, sham_pain5 ] {} +void() sham_pain5 =[ $pain5, sham_pain6 ] {} +void() sham_pain6 =[ $pain6, sham_run1 ] {} + +// i get no kick from this function +void(entity attacker, float damage) sham_pain = +{ + if (self.health <= 0) return; + if (self.pain_finished > time) return; + if (random()*400 > damage) return; // didn't flinch + + sound (self, CHAN_VOICE, "shambler/shurt2.wav", 1, ATTN_NORM); + PainFinished(2); + sham_pain1 (); +} + + +//============================================================================ + +/* +=========== +ShamCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() ShamCheckAttack = +{ + if (enemy_range == RANGE_MELEE && CheckClearAttack()) + { + if (vdist(self.origin, self.enemy.origin) > 95) + { + // we'll have to step forward to hit, don't try if there's no room to close in + // (fix for shambler-meleeing-in-place-harmlessly-forever behavior) + if (ai_charge(1)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + else + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if (time < self.attack_finished) + return FALSE; + + if (!enemy_vis) + return FALSE; + + // randomly melee if enemy has the ring of shadows + if (self.enemy.invisible_finished > time) + { + if (random() < 0.1) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if (!CheckClearAttack()) return FALSE; + + // missile attack + //if (enemy_range >= RANGE_FAR) + if (vlen(self.origin - enemy_vispos()) > SHAM_LIGHTNING_RANGE) + return FALSE; + + self.attack_state = AS_MISSILE; + ai_attack_finished (2 + 2*random()); + return TRUE; +} + +//============================================================================ + +void() sham_death1 =[ $death1, sham_death2 ] {} +void() sham_death2 =[ $death2, sham_death3 ] {} +void() sham_death3 =[ $death3, sham_death4 ] {} +void() sham_death4 =[ $death4, sham_death5 ] {self.solid = SOLID_NOT;} +void() sham_death5 =[ $death5, sham_death6 ] {} +void() sham_death6 =[ $death6, sham_death7 ] {} +void() sham_death7 =[ $death7, sham_death8 ] {} +void() sham_death8 =[ $death8, sham_death9 ] {} +void() sham_death9 =[ $death9, sham_death10 ] {} +void() sham_death10 =[ $death10, sham_death11 ] {} +void() sham_death11 =[ $death11, sham_death11 ] {} + +void() sham_die = +{ +// check for gib + if (self.health < -60) + { + Gib ("progs/h_shams.mdl", self.health); + return; + } + +// regular death + sound (self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM); + sham_death1 (); +} + +//============================================================================ + + +void() monster_shambler_spawn = +{ + self.classname = "monster_shambler"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/shambler.mdl"); + + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + + self.th_stand = sham_stand1; + self.th_walk = sham_walk1; + self.th_run = sham_run1; + self.th_die = sham_die; + self.th_melee = sham_melee; + self.th_missile = sham_magic1; + self.th_pain = sham_pain; + self.th_checkattack = ShamCheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was smashed by a Shambler"; + + walkmonster_start(); +} + +void() monster_shambler_spawner = {mon_spawner_use(monster_shambler_spawn);} + +/*QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Shambler, 600 health points. Rockets only have half damage when hitting the Shambler. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-32 -32 -24, 32 32 64) model({ "path": ":progs/shambler.mdl" }) = monster_shambler : "Shambler" [] +*/ +void() monster_shambler = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/shambler.mdl"); + precache_model ("progs/s_light.mdl"); + precache_model ("progs/h_shams.mdl"); + precache_model ("progs/bolt.mdl"); + + precache_sound ("shambler/sattck1.wav"); + precache_sound ("shambler/sboom.wav"); + precache_sound ("shambler/sdeath.wav"); + precache_sound ("shambler/shurt2.wav"); + precache_sound ("shambler/sidle.wav"); + precache_sound ("shambler/ssight.wav"); + precache_sound ("shambler/melee1.wav"); + precache_sound ("shambler/melee2.wav"); + precache_sound ("shambler/smack.wav"); + + self.health = 600; + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + + if ( monster_spawnsetup( monster_shambler_spawner ) ) return; + + addmonster(1); + monster_shambler_spawn(); +} diff --git a/QC_other/QC_copper/m_soldier.qc b/QC_other/QC_copper/m_soldier.qc new file mode 100644 index 00000000..29c06568 --- /dev/null +++ b/QC_other/QC_copper/m_soldier.qc @@ -0,0 +1,357 @@ +/* +============================================================================== + +SOLDIER / PLAYER + +============================================================================== +*/ + +$cd id1/models/soldier3 +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 + +$frame load1 load2 load3 load4 load5 load6 load7 load8 load9 load10 load11 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 shoot9 + +$frame prowl_1 prowl_2 prowl_3 prowl_4 prowl_5 prowl_6 prowl_7 prowl_8 +$frame prowl_9 prowl_10 prowl_11 prowl_12 prowl_13 prowl_14 prowl_15 prowl_16 +$frame prowl_17 prowl_18 prowl_19 prowl_20 prowl_21 prowl_22 prowl_23 prowl_24 + +/* +============================================================================== +SOLDIER CODE +============================================================================== +*/ + +void() army_stand1 =[ $stand1, army_stand2 ] {ai_stand();} +void() army_stand2 =[ $stand2, army_stand3 ] {ai_stand();} +void() army_stand3 =[ $stand3, army_stand4 ] {ai_stand();} +void() army_stand4 =[ $stand4, army_stand5 ] {ai_stand();} +void() army_stand5 =[ $stand5, army_stand6 ] {ai_stand();} +void() army_stand6 =[ $stand6, army_stand7 ] {ai_stand();} +void() army_stand7 =[ $stand7, army_stand8 ] {ai_stand();} +void() army_stand8 =[ $stand8, army_stand1 ] {ai_stand();} + +void() army_walk1 =[ $prowl_1, army_walk2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); +ai_walk(1);} +void() army_walk2 =[ $prowl_2, army_walk3 ] {ai_walk(1);} +void() army_walk3 =[ $prowl_3, army_walk4 ] {ai_walk(1);} +void() army_walk4 =[ $prowl_4, army_walk5 ] {ai_walk(1);} +void() army_walk5 =[ $prowl_5, army_walk6 ] {ai_walk(2);} +void() army_walk6 =[ $prowl_6, army_walk7 ] {ai_walk(3);} +void() army_walk7 =[ $prowl_7, army_walk8 ] {ai_walk(4);} +void() army_walk8 =[ $prowl_8, army_walk9 ] {ai_walk(4);} +void() army_walk9 =[ $prowl_9, army_walk10 ] {ai_walk(2);} +void() army_walk10 =[ $prowl_10, army_walk11 ] {ai_walk(2);} +void() army_walk11 =[ $prowl_11, army_walk12 ] {ai_walk(2);} +void() army_walk12 =[ $prowl_12, army_walk13 ] {ai_walk(1);} +void() army_walk13 =[ $prowl_13, army_walk14 ] {ai_walk(0);} +void() army_walk14 =[ $prowl_14, army_walk15 ] {ai_walk(1);} +void() army_walk15 =[ $prowl_15, army_walk16 ] {ai_walk(1);} +void() army_walk16 =[ $prowl_16, army_walk17 ] {ai_walk(1);} +void() army_walk17 =[ $prowl_17, army_walk18 ] {ai_walk(3);} +void() army_walk18 =[ $prowl_18, army_walk19 ] {ai_walk(3);} +void() army_walk19 =[ $prowl_19, army_walk20 ] {ai_walk(3);} +void() army_walk20 =[ $prowl_20, army_walk21 ] {ai_walk(3);} +void() army_walk21 =[ $prowl_21, army_walk22 ] {ai_walk(2);} +void() army_walk22 =[ $prowl_22, army_walk23 ] {ai_walk(1);} +void() army_walk23 =[ $prowl_23, army_walk24 ] {ai_walk(1);} +void() army_walk24 =[ $prowl_24, army_walk1 ] {ai_walk(1);} + +void() army_run1 =[ $run1, army_run2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); +ai_run(11);} +void() army_run2 =[ $run2, army_run3 ] {ai_run(15);} +void() army_run3 =[ $run3, army_run4 ] {ai_run(10);} +void() army_run4 =[ $run4, army_run5 ] {ai_run(10);} +void() army_run5 =[ $run5, army_run6 ] {ai_run(8);} +void() army_run6 =[ $run6, army_run7 ] {ai_run(15);} +void() army_run7 =[ $run7, army_run8 ] {ai_run(10);} +void() army_run8 =[ $run8, army_run1 ] {ai_run(8);} + +void() army_atk1 =[ $shoot1, army_atk2 ] {ai_face();} +void() army_atk2 =[ $shoot2, army_atk3 ] {ai_face();} +void() army_atk3 =[ $shoot3, army_atk4 ] {ai_face();} +void() army_atk4 =[ $shoot4, army_atk5 ] {ai_face();} +void() army_atk5 =[ $shoot5, army_atk6 ] {ai_face();army_fire(); +self.effects = self.effects | EF_MUZZLEFLASH;} +void() army_atk6 =[ $shoot6, army_atk7 ] {ai_face();} +void() army_atk7 =[ $shoot7, army_atk8 ] {ai_face();ai_check_refire (army_atk3);} +void() army_atk8 =[ $shoot8, army_atk9 ] {ai_face();} +void() army_atk9 =[ $shoot9, army_run1 ] {ai_face();} + + +void() army_pain1 =[ $pain1, army_pain2 ] {} +void() army_pain2 =[ $pain2, army_pain3 ] {} +void() army_pain3 =[ $pain3, army_pain4 ] {} +void() army_pain4 =[ $pain4, army_pain5 ] {} +void() army_pain5 =[ $pain5, army_pain6 ] {} +void() army_pain6 =[ $pain6, army_run1 ] {ai_pain(1);} + +void() army_painb1 =[ $painb1, army_painb2 ] {} +void() army_painb2 =[ $painb2, army_painb3 ] {ai_painforward(13);} +void() army_painb3 =[ $painb3, army_painb4 ] {ai_painforward(9);} +void() army_painb4 =[ $painb4, army_painb5 ] {} +void() army_painb5 =[ $painb5, army_painb6 ] {} +void() army_painb6 =[ $painb6, army_painb7 ] {} +void() army_painb7 =[ $painb7, army_painb8 ] {} +void() army_painb8 =[ $painb8, army_painb9 ] {} +void() army_painb9 =[ $painb9, army_painb10] {} +void() army_painb10=[ $painb10, army_painb11] {} +void() army_painb11=[ $painb11, army_painb12] {} +void() army_painb12=[ $painb12, army_painb13] {ai_pain(2);} +void() army_painb13=[ $painb13, army_painb14] {} +void() army_painb14=[ $painb14, army_run1 ] {} + +void() army_painc1 =[ $painc1, army_painc2 ] {} +void() army_painc2 =[ $painc2, army_painc3 ] {ai_pain(1);} +void() army_painc3 =[ $painc3, army_painc4 ] {} +void() army_painc4 =[ $painc4, army_painc5 ] {} +void() army_painc5 =[ $painc5, army_painc6 ] {ai_painforward(1);} +void() army_painc6 =[ $painc6, army_painc7 ] {ai_painforward(1);} +void() army_painc7 =[ $painc7, army_painc8 ] {} +void() army_painc8 =[ $painc8, army_painc9 ] {ai_pain(1);} +void() army_painc9 =[ $painc9, army_painc10] {ai_painforward(4);} +void() army_painc10=[ $painc10, army_painc11] {ai_painforward(3);} +void() army_painc11=[ $painc11, army_painc12] {ai_painforward(6);} +void() army_painc12=[ $painc12, army_painc13] {ai_painforward(8);} +void() army_painc13=[ $painc13, army_run1] {} + +void(entity attacker, float damage) army_pain = +{ + local float r; + + if (self.pain_finished > time) + return; + + r = random(); + + if (r < 0.2) + { + PainFinished(0.6); + army_pain1 (); + sound (self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); + } + else if (r < 0.6) + { + PainFinished(1.1); + army_painb1 (); + sound (self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + } + else + { + PainFinished(1.1); + army_painc1 (); + sound (self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + } +} + + +void() army_fire = +{ + local vector dir; + + ai_face(); + + sound (self, CHAN_WEAPON, "soldier/sattck1.wav", 1, ATTN_NORM); + +// fire somewhat behind the player, so a dodging player is harder to hit + dir = enemy_vispos() - self.enemy.velocity*0.2; + dir = normalize (dir - self.origin); + + // lunaran: moved multidamage here + ClearMultiDamage (); + FireBullets (4, dir, '0.1 0.1 0'); + ApplyMultiDamage (); +} + + +/* +=========== +SoldierCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() SoldierCheckAttack = +{ + local float chance; + + if (time < self.attack_finished) + return FALSE; + + if (enemy_range >= RANGE_FAR) + return FALSE; + + if (!CheckClearAttack()) return FALSE; + + // missile attack + + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else if (enemy_range == RANGE_NEAR) + chance = 0.4; + else if (enemy_range == RANGE_MID) + chance = 0.05; + else + chance = 0; + + if (random () < chance) + { + self.th_missile (); + ai_attack_finished (1 + random() + random()); + // if (random() < 0.3) + // self.customflags = xor(self.customflags, CFL_LEFTY); + + return TRUE; + } + + return FALSE; +} +//============================================================================= + + +void() army_die1 =[ $death1, army_die2 ] {} +void() army_die2 =[ $death2, army_die3 ] {} +void() army_die3 =[ $death3, army_die4 ] +{self.solid = SOLID_NOT;self.ammo_shells = 5;DropBackpack();} +void() army_die4 =[ $death4, army_die5 ] {} +void() army_die5 =[ $death5, army_die6 ] {} +void() army_die6 =[ $death6, army_die7 ] {} +void() army_die7 =[ $death7, army_die8 ] {} +void() army_die8 =[ $death8, army_die9 ] {} +void() army_die9 =[ $death9, army_die10 ] {} +void() army_die10 =[ $death10, army_die10 ] {} + +void() army_cdie1 =[ $deathc1, army_cdie2 ] {} +void() army_cdie2 =[ $deathc2, army_cdie3 ] {ai_back(5);} +void() army_cdie3 =[ $deathc3, army_cdie4 ] +{self.solid = SOLID_NOT;self.ammo_shells = 5;DropBackpack();ai_back(4);} +void() army_cdie4 =[ $deathc4, army_cdie5 ] {ai_back(13);} +void() army_cdie5 =[ $deathc5, army_cdie6 ] {ai_back(3);} +void() army_cdie6 =[ $deathc6, army_cdie7 ] {ai_back(4);} +void() army_cdie7 =[ $deathc7, army_cdie8 ] {} +void() army_cdie8 =[ $deathc8, army_cdie9 ] {} +void() army_cdie9 =[ $deathc9, army_cdie10 ] {} +void() army_cdie10 =[ $deathc10, army_cdie11 ] {} +void() army_cdie11 =[ $deathc11, army_cdie11 ] {} + + +void() army_die = +{ +// check for gib + if (self.health < -35) + { + Gib("progs/h_guard.mdl", self.health); + return; + } + +// regular death + sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); + if (random() < 0.5) + army_die1 (); + else + army_cdie1 (); +} + +void() monster_army_spawn = +{ + self.classname = "monster_army"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/soldier.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 35; + + self.th_stand = army_stand1; + self.th_walk = army_walk1; + self.th_run = army_run1; + self.th_missile = army_atk1; + self.th_pain = army_pain; + self.th_die = army_die; + self.th_checkattack = SoldierCheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was shot by a Grunt"; + + walkmonster_start (); +} + +void() monster_army_spawner = {mon_spawner_use(monster_army_spawn);} + +/*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Grunt, 30 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model({ "path": ":progs/soldier.mdl" }) = monster_army : "Grunt" [] +*/ +void() monster_army = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/soldier.mdl"); + precache_model ("progs/h_guard.mdl"); + precache_model ("progs/gib1.mdl"); + precache_model ("progs/gib2.mdl"); + precache_model ("progs/gib3.mdl"); + + precache_sound ("soldier/death1.wav"); + precache_sound ("soldier/idle.wav"); + precache_sound ("soldier/pain1.wav"); + precache_sound ("soldier/pain2.wav"); + precache_sound ("soldier/sattck1.wav"); + precache_sound ("soldier/sight1.wav"); + + precache_sound ("player/udeath.wav"); // gib death + self.health = 35; + + setsize (self, '-16 -16 -24', '16 16 40'); + if ( monster_spawnsetup( monster_army_spawner ) ) return; + + addmonster(1); + monster_army_spawn(); +} diff --git a/QC_other/QC_copper/m_tarbaby.qc b/QC_other/QC_copper/m_tarbaby.qc new file mode 100644 index 00000000..b612bb53 --- /dev/null +++ b/QC_other/QC_copper/m_tarbaby.qc @@ -0,0 +1,377 @@ +/* +============================================================================== + +BLOB + +============================================================================== +*/ + +$cd id1/models/tarbaby +$origin 0 0 24 +$base base + +$skin skin + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 +$frame walk20 walk21 walk22 walk23 walk24 walk25 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13 +$frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23 +$frame run24 run25 + +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +$frame fly1 fly2 fly3 fly4 + +$frame exp + +void() tbaby_idle = +{ + if (random() < 0.4) + sound (self, CHAN_BODY, "blob/idle.wav", 1, ATTN_IDLE); +} + +void() tbaby_stand1 =[ $walk1, tbaby_stand1] {ai_stand();} + +void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();} + +void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();} +void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();} +void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();} +void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();} +void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();} +void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_walk(1);} +void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_walk(1);} +void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_walk(1.5);} +void() tbaby_walk9 =[ $walk9, tbaby_walk10] {ai_walk(2.5);} +void() tbaby_walk10 =[ $walk10, tbaby_walk11] {ai_walk(2);} +void() tbaby_walk11 =[ $walk11, tbaby_walk12] {ai_walk(4);} +void() tbaby_walk12 =[ $walk12, tbaby_walk13] {ai_walk(6);} +void() tbaby_walk13 =[ $walk13, tbaby_walk14] {ai_walk(7);} +void() tbaby_walk14 =[ $walk14, tbaby_walk15] {ai_walk(6);tbaby_idle();} +void() tbaby_walk15 =[ $walk15, tbaby_walk16] {ai_walk(5);} +void() tbaby_walk16 =[ $walk16, tbaby_walk17] {ai_turn();} +void() tbaby_walk17 =[ $walk17, tbaby_walk18] {ai_turn();} +void() tbaby_walk18 =[ $walk18, tbaby_walk19] {ai_turn();} +void() tbaby_walk19 =[ $walk19, tbaby_walk20] {ai_turn();} +void() tbaby_walk20 =[ $walk20, tbaby_walk21] {ai_turn();} +void() tbaby_walk21 =[ $walk21, tbaby_walk22] {ai_turn();} +void() tbaby_walk22 =[ $walk22, tbaby_walk23] {ai_turn();} +void() tbaby_walk23 =[ $walk23, tbaby_walk24] {ai_walk(3);} +void() tbaby_walk24 =[ $walk24, tbaby_walk25] {ai_walk(1);} +void() tbaby_walk25 =[ $walk25, tbaby_walk1 ] {ai_walk(1);} + +void() tbaby_run1 =[ $run1, tbaby_run2 ] { + ai_face(); + Tar_Forget(); + self.cnt = 0; +} +void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();} +void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();} +void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();} +void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();} +void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();} +void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_run(1);} +void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_run(1);} +void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_run(1);} +void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_run(2);} +void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);} +void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(3);} +void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(3);} +void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(1);} +void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_face();tbaby_idle();} +void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_face();} +void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);} +void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(4);} +void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(5);} +void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(1);} +void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(4);} +void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);} +void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);} +void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(1);} +void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(1);} + + +//============================================================================ + +float(entity e) tar_visible = +{ + return (visible(e) && e.invisible_finished < time); +} + +void() Tar_Forget = +{ + if (!self.rad_time) // time to be RAD + { + // we just woke up, don't forget right away, because if we were awoken + // by another monster waking we'll just lay here and burp (ikspq2) + self.rad_time = time + 60; + } + + if (time < self.rad_time) + return; + + if (!tar_visible(self.enemy)) + { + if (tar_visible(self.oldenemy)) + { + self.enemy = self.oldenemy; + } + else + { + self.enemy = world; + } + self.oldenemy = world; + } + if (!self.enemy) + { + self.rad_time = 0; // reset the clock + ai_stand(); + } +} + + +void() Tar_JumpTouchGround = +{ + if (!checkbottom(self)) + { + if (self.flags & FL_ONGROUND) + { // jump randomly to not get hung up + self.think = tbaby_jump1; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + if (self.cnt > 4 && (!tar_visible(self.enemy))) + { + self.think = tbaby_run1; + self.cnt = 0; + // if the player listens to sound cues and ambushes the spawn just as it + // stops, he has a full second to attack it + ai_attack_finished(1); + } + else + { + self.think = tbaby_jump1; + } + self.nextthink = time + 0.1; +} + +void() Tar_JumpTouch = +{ + local float ldmg; + + if (other.takedamage && + other.classname != self.classname) + { + if ( vlen(self.velocity) > 400 ) + { + if (other.classname != "player" || time > self.touch_time) // fix for landing on the player's head + { + if (other.classname == "player") + { + self.touch_time = time + 0.2; + self.cnt = max(0, self.cnt - 1); + } + + self.rad_time = time + 60; + ldmg = 10 + 10*random(); + T_Damage (other, self, self, ldmg); + sound (self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM); + } + } + } + else + sound (self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); + + Tar_JumpTouchGround(); +} + +void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {} +void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {} +void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {} +void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] +{ + self.delay = self.delay + 1; + if (self.delay == 4) + { + //dprint ("spawn hop\n"); + tbaby_jump1 (); + } +} + +void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();} +void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();} +void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();} +void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();} +void() tbaby_jump5 =[ $jump5, tbaby_jump6 ] +{ + self.movetype = MOVETYPE_BOUNCE; + self.touch = Tar_JumpTouch; + makevectors (self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 600 + '0 0 200'; + self.velocity_z = self.velocity_z + random()*150; + if (self.flags & FL_ONGROUND) + self.flags = self.flags - FL_ONGROUND; + + if (!tar_visible(self.enemy)) + self.cnt = self.cnt + 1; + + self.delay = 0; + self.rad_time = time + 60; +} +void() tbaby_jump6 =[ $jump6,tbaby_fly1 ] {} + + + +//============================================================================= + +void(entity attacker, float damage) tbaby_pain = +{ + self.rad_time = time + 60; + + // shooting a tbaby while invisible triggers one spastic leap + if (attacker.invisible_finished > time && self.pain_finished < time) + { + self.pain_finished = time + 1; + self.cnt = 4; + tbaby_jump1(); + return; + } + + self.cnt = 0; +} + +void() tbaby_die1 =[ $exp, tbaby_die2 ] { +self.takedamage = DAMAGE_NO; +} +void() tbaby_die2 =[ $exp, tbaby_run1 ] +{ + T_RadiusDamage (self, self, 120, world); + + sound (self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + BecomeBlast (); +} + +//============================================================================= + +float() tbaby_check_attack = +{ + float chance; + + // spawns don't launch an attack if the player is invisible, or else + // they'd time out after five leaps and then just start again + if (self.enemy.invisible_finished > time) return FALSE; + + if (time < self.attack_finished) return FALSE; + if (enemy_range >= RANGE_FAR) return FALSE; + if (!CheckClearAttack()) return FALSE; + + if (enemy_range == RANGE_MELEE) + { + chance = 0.9; + self.attack_finished = 0; + } + else if (enemy_range == RANGE_NEAR) + chance = 0.4; + else if (enemy_range == RANGE_MID) + chance = 0.1; + else + chance = 0; + + if (random() < chance) + { + self.th_missile (); + ai_attack_finished (2*random()); + return TRUE; + } + + return FALSE; +} + +void() monster_tarbaby_spawn = +{ + self.classname = "monster_tarbaby"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/tarbaby.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 80; + self.yaw_speed = 30; + + self.customflags |= CFL_MELEEONLY; + + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + self.th_missile = tbaby_jump1; + self.th_melee = tbaby_jump1; + self.th_die = tbaby_die1; + self.th_checkattack = tbaby_check_attack; + self.th_pain = tbaby_pain; + + if (self.deathtype == string_null) + self.deathtype = "was slimed by a Spawn"; + + walkmonster_start (); +} + +void() monster_tarbaby_spawner = {mon_spawner_use(monster_tarbaby_spawn);} + +/*QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Spawn (Tarbaby), 80 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 24) model({ "path": ":progs/tarbaby.mdl" }) = monster_tarbaby : "Spawn" [] +*/ +void() monster_tarbaby = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model2 ("progs/tarbaby.mdl"); + + precache_sound2 ("blob/death1.wav"); + precache_sound2 ("blob/hit1.wav"); + precache_sound2 ("blob/land1.wav"); + precache_sound2 ("blob/sight1.wav"); + precache_sound2 ("blob/idle.wav"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 80; + if ( monster_spawnsetup( monster_tarbaby_spawner ) ) return; + + addmonster(1); + monster_tarbaby_spawn(); +} diff --git a/QC_other/QC_copper/m_wizard.qc b/QC_other/QC_copper/m_wizard.qc new file mode 100644 index 00000000..a364f8c3 --- /dev/null +++ b/QC_other/QC_copper/m_wizard.qc @@ -0,0 +1,435 @@ +/* +============================================================================== + +WIZARD + +============================================================================== +*/ + +$cd id1/models/a_wizard +$origin 0 0 24 +$base wizbase +$skin wizbase + +$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 +$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 + +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 fly9 fly10 +$frame fly11 fly12 fly13 fly14 + +$frame magatt1 magatt2 magatt3 magatt4 magatt5 magatt6 magatt7 +$frame magatt8 magatt9 magatt10 magatt11 magatt12 magatt13 + +$frame pain1 pain2 pain3 pain4 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 + +/* +================= +WizardCheckAttack +================= +*/ +float() WizardCheckAttack = +{ + local vector spot1, spot2; + local float chance; + + if (time < self.attack_finished) + return FALSE; + if (!enemy_vis) + return FALSE; + + if (enemy_range >= RANGE_FAR) + { + if (self.attack_state != AS_STRAIGHT) + { + self.attack_state = AS_STRAIGHT; + wiz_run1 (); + } + return FALSE; + } + + // see if any entities are in the way of the shot + if (self.enemy.invisible_finished < time) // but not if we can't see him + { + // see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = self.enemy.origin + self.enemy.view_ofs; + + traceline2(spot1, spot2, self, TRACE_WATER); + + if (trace_ent != self.enemy) + { // don't have a clear shot, so move to a side + if (self.attack_state != AS_STRAIGHT) + { + self.attack_state = AS_STRAIGHT; + wiz_run1 (); + } + return FALSE; + } + } + + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else if (enemy_range == RANGE_NEAR) + chance = 0.6; + else if (enemy_range == RANGE_MID) + chance = 0.2; + else + chance = 0; + + if (random () < chance) + { + self.attack_state = AS_MISSILE; + return TRUE; + } + + if (enemy_range == RANGE_MID) + { + if (self.attack_state != AS_STRAIGHT) + { + self.attack_state = AS_STRAIGHT; + wiz_run1 (); + } + } + else + { + // no circle strafing when we're really close ... because it's annoying + if (enemy_range == RANGE_MELEE) + { + self.attack_state = AS_STRAIGHT; + wiz_run1 (); + return TRUE; + } + if (self.attack_state != AS_SLIDING) + { + self.attack_state = AS_SLIDING; + wiz_side1 (); + } + } + + return FALSE; +} + +/* +================= +WizardAttackFinished +================= +*/ +void() WizardAttackFinished = +{ + if (enemy_range >= RANGE_MID || !enemy_vis) + { + self.attack_state = AS_STRAIGHT; + self.think = wiz_run1; + } + else + { + self.attack_state = AS_SLIDING; + self.think = wiz_side1; + } +} + +/* +============================================================================== + +FAST ATTACKS + +============================================================================== +*/ + +void() Wiz_FastFire = +{ + local vector vec; + local vector dst; + local entity wsp; + + if (self.owner.health > 0) + { + self.owner.effects = self.owner.effects | EF_MUZZLEFLASH; + + makevectors (self.enemy.angles); + dst = enemy_vispos() - 13*self.movedir; + + vec = normalize(dst - self.origin); + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + wsp = launch_wizspike (self.origin, vec*600); + wsp.owner = wsp.trueowner = self.owner; + } + + remove (self); +} + + +void() Wiz_StartFast = +{ + local entity missile; + + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + self.v_angle = self.angles; + makevectors (self.angles); + + missile = spawn (); + missile.owner = self; + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + '0 0 30' + v_forward*14 + v_right*14); + missile.enemy = self.enemy; + missile.nextthink = time + 0.8; + missile.think = Wiz_FastFire; + missile.movedir = v_right; + + missile = spawn (); + missile.owner = self; + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + '0 0 30' + v_forward*14 + v_right* -14); + missile.enemy = self.enemy; + missile.nextthink = time + 0.3; + missile.think = Wiz_FastFire; + missile.movedir = VEC_ORIGIN - v_right; +} + + + +void() Wiz_idlesound = +{ +local float wr; + wr = random() * 5; + + if (self.wait < time) + { + self.wait = time + 2; + if (wr > 4.5) + sound (self, CHAN_VOICE, "wizard/widle1.wav", 1, ATTN_IDLE); + if (wr < 1.5) + sound (self, CHAN_VOICE, "wizard/widle2.wav", 1, ATTN_IDLE); + } + return; +} + +void() wiz_stand1 =[ $hover1, wiz_stand2 ] {ai_stand();} +void() wiz_stand2 =[ $hover2, wiz_stand3 ] {ai_stand();} +void() wiz_stand3 =[ $hover3, wiz_stand4 ] {ai_stand();} +void() wiz_stand4 =[ $hover4, wiz_stand5 ] {ai_stand();} +void() wiz_stand5 =[ $hover5, wiz_stand6 ] {ai_stand();} +void() wiz_stand6 =[ $hover6, wiz_stand7 ] {ai_stand();} +void() wiz_stand7 =[ $hover7, wiz_stand8 ] {ai_stand();} +void() wiz_stand8 =[ $hover8, wiz_stand1 ] {ai_stand();} + +void() wiz_walk1 =[ $hover1, wiz_walk2 ] {ai_walk(8); +Wiz_idlesound();} +void() wiz_walk2 =[ $hover2, wiz_walk3 ] {ai_walk(8);} +void() wiz_walk3 =[ $hover3, wiz_walk4 ] {ai_walk(8);} +void() wiz_walk4 =[ $hover4, wiz_walk5 ] {ai_walk(8);} +void() wiz_walk5 =[ $hover5, wiz_walk6 ] {ai_walk(8);} +void() wiz_walk6 =[ $hover6, wiz_walk7 ] {ai_walk(8);} +void() wiz_walk7 =[ $hover7, wiz_walk8 ] {ai_walk(8);} +void() wiz_walk8 =[ $hover8, wiz_walk1 ] {ai_walk(8);} + +void() wiz_side1 =[ $hover1, wiz_side2 ] {ai_run(8); +Wiz_idlesound();} +void() wiz_side2 =[ $hover2, wiz_side3 ] {ai_run(8);} +void() wiz_side3 =[ $hover3, wiz_side4 ] {ai_run(8);} +void() wiz_side4 =[ $hover4, wiz_side5 ] {ai_run(8);} +void() wiz_side5 =[ $hover5, wiz_side6 ] {ai_run(8);} +void() wiz_side6 =[ $hover6, wiz_side7 ] {ai_run(8);} +void() wiz_side7 =[ $hover7, wiz_side8 ] {ai_run(8);} +void() wiz_side8 =[ $hover8, wiz_side1 ] {ai_run(8);} + +void() wiz_run1 =[ $fly1, wiz_run2 ] {ai_run(16); +Wiz_idlesound(); +} +void() wiz_run2 =[ $fly2, wiz_run3 ] {ai_run(16);} +void() wiz_run3 =[ $fly3, wiz_run4 ] {ai_run(16);} +void() wiz_run4 =[ $fly4, wiz_run5 ] {ai_run(16);} +void() wiz_run5 =[ $fly5, wiz_run6 ] {ai_run(16);} +void() wiz_run6 =[ $fly6, wiz_run7 ] {ai_run(16);} +void() wiz_run7 =[ $fly7, wiz_run8 ] {ai_run(16);} +void() wiz_run8 =[ $fly8, wiz_run9 ] {ai_run(16);} +void() wiz_run9 =[ $fly9, wiz_run10 ] {ai_run(16);} +void() wiz_run10 =[ $fly10, wiz_run11 ] {ai_run(16);} +void() wiz_run11 =[ $fly11, wiz_run12 ] {ai_run(16);} +void() wiz_run12 =[ $fly12, wiz_run13 ] {ai_run(16);} +void() wiz_run13 =[ $fly13, wiz_run14 ] {ai_run(16);} +void() wiz_run14 =[ $fly14, wiz_run1 ] {ai_run(16);} + +void() wiz_fast1 =[ $magatt1, wiz_fast2 ] {ai_face();Wiz_StartFast();} +void() wiz_fast2 =[ $magatt2, wiz_fast3 ] {ai_face();} +void() wiz_fast3 =[ $magatt3, wiz_fast4 ] {ai_face();} +void() wiz_fast4 =[ $magatt4, wiz_fast5 ] {ai_face();} +void() wiz_fast5 =[ $magatt5, wiz_fast6 ] {ai_face();} +void() wiz_fast6 =[ $magatt6, wiz_fast7 ] {ai_face();} +void() wiz_fast7 =[ $magatt5, wiz_fast8 ] {ai_face();} +void() wiz_fast8 =[ $magatt4, wiz_fast9 ] {ai_face();} +void() wiz_fast9 =[ $magatt3, wiz_fast10 ] {ai_face();} +void() wiz_fast10 =[ $magatt2, wiz_run1 ] {ai_face(); ai_attack_finished(2); WizardAttackFinished();} + +void() wiz_pain1 =[ $pain1, wiz_pain2 ] {ai_nop();} +void() wiz_pain2 =[ $pain2, wiz_pain3 ] {ai_nop();} +void() wiz_pain3 =[ $pain3, wiz_pain4 ] {ai_nop();} +void() wiz_pain4 =[ $pain4, wiz_run1 ] {ai_nop();} + +void() wiz_death1 =[ $death1, wiz_death2 ] { + +self.velocity_x = -200 + 400*random(); +self.velocity_y = -200 + 400*random(); +self.velocity_z = 100 + 100*random(); +self.flags = not(self.flags, FL_ONGROUND); +sound (self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM); +} +void() wiz_death2 =[ $death2, wiz_death3 ] {} +void() wiz_death3 =[ $death3, wiz_death4 ] {self.solid = SOLID_NOT; self.flags = not(self.flags, FL_ONGROUND);} +void() wiz_death4 =[ $death4, wiz_death5 ] {} +void() wiz_death5 =[ $death5, wiz_death6 ] {} +void() wiz_death6 =[ $death6, wiz_death7 ] {} +void() wiz_death7 =[ $death7, wiz_death8 ] {} +void() wiz_death8 =[ $death8, wiz_death8 ] {}// deathvoidcheck(); } + +void() wiz_die = +{ +// check for gib + if (self.health < -40) + { + Gib ("progs/h_wizard.mdl", self.health); + return; + } + + wiz_death1 (); +} + + +void(entity attacker, float damage) Wiz_Pain = +{ + sound (self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM); + if (random()*70 > damage) + return; // didn't flinch + + wiz_pain1 (); +} + + +void() monster_wizard_spawn = +{ + self.classname = "monster_wizard"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/wizard.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 80; + + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = wiz_fast1; + self.th_pain = Wiz_Pain; + self.th_die = wiz_die; + self.th_checkattack = WizardCheckAttack; + + if (self.deathtype == string_null) + self.deathtype = "was scragged by a Scrag"; + + flymonster_start (); +} + +void() monster_wizard_spawner = {mon_spawner_use(monster_wizard_spawn);} + +/*QUAKED monster_wizard (1 0 0) (-16 -16 -24) (16 16 40) Ambush ? ? ? Triggered NoTfog NoTelefrag Instawake +Scrag (the WIZARD), 80 health points. + +Flags: +"ambush" only wake up on seeing the player, not another monster getting angry + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 40) model({ "path": ":progs/wizard.mdl" }) = monster_wizard : "Scrag" [] +*/ +void() monster_wizard = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + precache_model ("progs/wizard.mdl"); + precache_model ("progs/h_wizard.mdl"); + precache_model ("progs/w_spike.mdl"); + + precache_sound ("wizard/hit.wav"); // used by c code + precache_sound ("wizard/wattack.wav"); + precache_sound ("wizard/wdeath.wav"); + precache_sound ("wizard/widle1.wav"); + precache_sound ("wizard/widle2.wav"); + precache_sound ("wizard/wpain.wav"); + precache_sound ("wizard/wsight.wav"); + + self.health = 80; + //setsize (self, '-16 -16 -24', '16 16 40'); + setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + if ( monster_spawnsetup( monster_wizard_spawner ) ) return; + + addmonster(1); + monster_wizard_spawn(); +} + + + + + + + +/* +============= +LaunchMissile + +Sets the given entities velocity and angles so that it will hit self.enemy +if self.enemy maintains it's current velocity +0.1 is moderately accurate, 0.0 is totally accurate +============= +*/ +/* +void(entity missile, float mspeed, float accuracy) LaunchMissile = +{ + local vector vec, move; + local float fly; + + makevectors (self.angles); + +// set missile speed + vec = self.enemy.origin + self.enemy.mins + self.enemy.size * 0.7 - missile.origin; + +// calc aproximate time for missile to reach vec + fly = vlen (vec) / mspeed; + +// get the entities xy velocity + move = self.enemy.velocity; + move_z = 0; + +// project the target forward in time + vec = vec + move * fly; + + vec = normalize(vec); + vec = vec + accuracy*v_up*(random()- 0.5) + accuracy*v_right*(random()- 0.5); + + missile.velocity = vec * mspeed; + + missile.angles = '0 0 0'; + missile.angles_y = vectoyaw(missile.velocity); + +// set missile duration + missile.nextthink = time + 5; + missile.think = SUB_Remove; +} + +*/ + diff --git a/QC_other/QC_copper/m_zombie.qc b/QC_other/QC_copper/m_zombie.qc new file mode 100644 index 00000000..073a437c --- /dev/null +++ b/QC_other/QC_copper/m_zombie.qc @@ -0,0 +1,647 @@ +/* +============================================================================== + +ZOMBIE + +============================================================================== +*/ +$cd id1/models/zombie + +$origin 0 0 24 + +$base base +$skin skin +//0 +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 +//15 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 +$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 +//34 +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 +$frame run13 run14 run15 run16 run17 run18 +//52 +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11 +$frame atta12 atta13 +//65 +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11 +$frame attb12 attb13 attb14 +//79 +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11 +$frame attc12 +//91 +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10 +$frame paina11 paina12 +//103 +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19 +$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28 +//131 +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18 +//149 +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 +//162 +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19 +$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28 +$frame paine29 paine30 +//192 +$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6 + + +//============================================================================= + +void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand();} +void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();} +void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();} +void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();} +void() zombie_stand5 =[ $stand5, zombie_stand6 ] {ai_stand();} +void() zombie_stand6 =[ $stand6, zombie_stand7 ] {ai_stand();} +void() zombie_stand7 =[ $stand7, zombie_stand8 ] {ai_stand();} +void() zombie_stand8 =[ $stand8, zombie_stand9 ] {ai_stand();} +void() zombie_stand9 =[ $stand9, zombie_stand10 ] {ai_stand();} +void() zombie_stand10 =[ $stand10, zombie_stand11 ] {ai_stand();} +void() zombie_stand11 =[ $stand11, zombie_stand12 ] {ai_stand();} +void() zombie_stand12 =[ $stand12, zombie_stand13 ] {ai_stand();} +void() zombie_stand13 =[ $stand13, zombie_stand14 ] {ai_stand();} +void() zombie_stand14 =[ $stand14, zombie_stand15 ] {ai_stand();} +void() zombie_stand15 =[ $stand15, zombie_stand1 ] {ai_stand();} + +void() zombie_cruc1 = [ $cruc_1, zombie_cruc2 ] { +if (random() < 0.1) + sound (self, CHAN_VOICE, "zombie/idle_w2.wav", 1, ATTN_STATIC);} +void() zombie_cruc2 = [ $cruc_2, zombie_cruc3 ] {self.nextthink = time + 0.1 + random()*0.1;} +void() zombie_cruc3 = [ $cruc_3, zombie_cruc4 ] {self.nextthink = time + 0.1 + random()*0.1;} +void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] {self.nextthink = time + 0.1 + random()*0.1;} +void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] {self.nextthink = time + 0.1 + random()*0.1;} +void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] {self.nextthink = time + 0.1 + random()*0.1;} + +void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(0);} +void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(2);} +void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);} +void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);} +void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);} +void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);} +void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);} +void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);} +void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);} +void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);} +void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);} +void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(2);} +void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);} +void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);} +void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);} +void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);} +void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);} +void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);} +void() zombie_walk19 =[ $walk19, zombie_walk1 ] { +ai_walk(0); +if (random() < 0.2) + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);} + +void() zombie_run1 =[ $run1, zombie_run2 ] { + ai_run(1); + self.customflags = not(self.customflags, CFL_INPAIN | CFL_KNOCKEDDOWN); +} +void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);} +void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);} +void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);} +void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);} +void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);} +void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);} +void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);} +void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(2);} +void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(0);} +void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(0);} +void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(0);} +void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(2);} +void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);} +void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(6);} +void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(7);} +void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(3);} +void() zombie_run18 =[ $run18, zombie_run1 ] { +ai_run(8); +if (random() < 0.2) + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); +if (random() > 0.8) + sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); +} + +/* +============================================================================= + +ATTACKS + +============================================================================= +*/ + +void() ZombieGrenadeTouch = +{ + if (CheckProjectilePassthru()) return; + + if (other.takedamage) + { + T_Damage (other, self, self.trueowner, 10 ); + sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + remove (self); + return; + } + sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound + self.velocity = '0 0 0'; + self.avelocity = '0 0 0'; + self.touch = SUB_Remove; +} + +/* +================ +ZombieFireGrenade +================ +*/ +void(vector st) ZombieFireGrenade = +{ + entity missile; + vector org, badvel, goodvel; + float dist; + + sound (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); + + // calc org + makevectors (self.angles); + org = self.origin + st_x * v_forward + st_y * v_right + st_z * v_up; + + // set missile speed + dist = vlen(enemy_vispos() - org); + goodvel = normalize(enemy_vispos() - org); + badvel = vec_scale(goodvel, '1 1 0') * 600; + badvel_z = 200; + goodvel = vec_scale(goodvel, '1 1 1.1') * 750; + + // accurate pitch very close, throw like idiots far away + missile = toss_projectile(org, lerpVector(goodvel, badvel, saturate(0.2 + dist/400))); + + missile.lifetime_finished = time + 2.5; + missile.touch = ZombieGrenadeTouch; + missile.th_die = SUB_Remove; + SUB_ChangeModel (missile, "progs/zom_gib.mdl"); +} + + +void() zombie_atta1 =[ $atta1, zombie_atta2 ] {ai_face();} +void() zombie_atta2 =[ $atta2, zombie_atta3 ] {ai_face();} +void() zombie_atta3 =[ $atta3, zombie_atta4 ] {ai_face();} +void() zombie_atta4 =[ $atta4, zombie_atta5 ] {ai_face();} +void() zombie_atta5 =[ $atta5, zombie_atta6 ] {ai_face();} +void() zombie_atta6 =[ $atta6, zombie_atta7 ] {ai_face();} +void() zombie_atta7 =[ $atta7, zombie_atta8 ] {ai_face();} +void() zombie_atta8 =[ $atta8, zombie_atta9 ] {ai_face();} +void() zombie_atta9 =[ $atta9, zombie_atta10 ] {ai_face();} +void() zombie_atta10 =[ $atta10, zombie_atta11 ] {ai_face();} +void() zombie_atta11 =[ $atta11, zombie_atta12 ] {ai_face();} +void() zombie_atta12 =[ $atta12, zombie_atta13 ] {ai_face();} +void() zombie_atta13 =[ $atta13, zombie_run1 ] {ai_face();ZombieFireGrenade('10 14 8');} + +void() zombie_attb1 =[ $attb1, zombie_attb2 ] {ai_face();} +void() zombie_attb2 =[ $attb2, zombie_attb3 ] {ai_face();} +void() zombie_attb3 =[ $attb3, zombie_attb4 ] {ai_face();} +void() zombie_attb4 =[ $attb4, zombie_attb5 ] {ai_face();} +void() zombie_attb5 =[ $attb5, zombie_attb6 ] {ai_face();} +void() zombie_attb6 =[ $attb6, zombie_attb7 ] {ai_face();} +void() zombie_attb7 =[ $attb7, zombie_attb8 ] {ai_face();} +void() zombie_attb8 =[ $attb8, zombie_attb9 ] {ai_face();} +void() zombie_attb9 =[ $attb9, zombie_attb10 ] {ai_face();} +void() zombie_attb10 =[ $attb10, zombie_attb11 ] {ai_face();} +void() zombie_attb11 =[ $attb11, zombie_attb12 ] {ai_face();} +void() zombie_attb12 =[ $attb12, zombie_attb13 ] {ai_face();} +void() zombie_attb13 =[ $attb13, zombie_attb14 ] {ai_face();} +void() zombie_attb14 =[ $attb13, zombie_run1 ] {ai_face();ZombieFireGrenade('10 -10 16');} + +void() zombie_attc1 =[ $attc1, zombie_attc2 ] {ai_face();} +void() zombie_attc2 =[ $attc2, zombie_attc3 ] {ai_face();} +void() zombie_attc3 =[ $attc3, zombie_attc4 ] {ai_face();} +void() zombie_attc4 =[ $attc4, zombie_attc5 ] {ai_face();} +void() zombie_attc5 =[ $attc5, zombie_attc6 ] {ai_face();} +void() zombie_attc6 =[ $attc6, zombie_attc7 ] {ai_face();} +void() zombie_attc7 =[ $attc7, zombie_attc8 ] {ai_face();} +void() zombie_attc8 =[ $attc8, zombie_attc9 ] {ai_face();} +void() zombie_attc9 =[ $attc9, zombie_attc10 ] {ai_face();} +void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face();} +void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face();} +void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('10 14 8');} + +void() zombie_missile = +{ + local float r; + + r = random(); + + if (r < 0.3) + zombie_atta1 (); + else if (r < 0.6) + zombie_attb1 (); + else + zombie_attc1 (); +} + + +/* +============================================================================= + +PAIN + +============================================================================= +*/ + +// this expects a zombie's th_pain to trigger the long knockdown if currently in +// pain_finished +void(entity zom) zombie_knockdown = +{ + entity oself; + oself = self; + self = zom; + + if (self.pain_finished < time) + self.pain_finished = time + 0.1; + self.customflags = not(self.customflags, CFL_INPAIN); + + self.th_pain(oself, 50); + + self = oself; +} + +void() zombie_paina1 =[ $paina1, zombie_paina2 ] {sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);} +void() zombie_paina2 =[ $paina2, zombie_paina3 ] {ai_painforward(3);} +void() zombie_paina3 =[ $paina3, zombie_paina4 ] {ai_painforward(1);} +void() zombie_paina4 =[ $paina4, zombie_paina5 ] {ai_pain(1);} +void() zombie_paina5 =[ $paina5, zombie_paina6 ] {ai_pain(3);} +void() zombie_paina6 =[ $paina6, zombie_paina7 ] {ai_pain(1);} +void() zombie_paina7 =[ $paina7, zombie_paina8 ] {} +void() zombie_paina8 =[ $paina8, zombie_paina9 ] {} +void() zombie_paina9 =[ $paina9, zombie_paina10 ] {} +void() zombie_paina10 =[ $paina10, zombie_paina11 ] {} +void() zombie_paina11 =[ $paina11, zombie_paina12 ] {} +void() zombie_paina12 =[ $paina12, zombie_run1 ] {} + +void() zombie_painb1 =[ $painb1, zombie_painb2 ] {sound (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);} +void() zombie_painb2 =[ $painb2, zombie_painb3 ] {ai_pain(2);} +void() zombie_painb3 =[ $painb3, zombie_painb4 ] {ai_pain(8);} +void() zombie_painb4 =[ $painb4, zombie_painb5 ] {ai_pain(6);} +void() zombie_painb5 =[ $painb5, zombie_painb6 ] {ai_pain(2);} +void() zombie_painb6 =[ $painb6, zombie_painb7 ] {} +void() zombie_painb7 =[ $painb7, zombie_painb8 ] {} +void() zombie_painb8 =[ $painb8, zombie_painb9 ] {} +void() zombie_painb9 =[ $painb9, zombie_painb10 ] {sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);} +void() zombie_painb10 =[ $painb10, zombie_painb11 ] {} +void() zombie_painb11 =[ $painb11, zombie_painb12 ] {} +void() zombie_painb12 =[ $painb12, zombie_painb13 ] {} +void() zombie_painb13 =[ $painb13, zombie_painb14 ] {} +void() zombie_painb14 =[ $painb14, zombie_painb15 ] {} +void() zombie_painb15 =[ $painb15, zombie_painb16 ] {} +void() zombie_painb16 =[ $painb16, zombie_painb17 ] {} +void() zombie_painb17 =[ $painb17, zombie_painb18 ] {} +void() zombie_painb18 =[ $painb18, zombie_painb19 ] {} +void() zombie_painb19 =[ $painb19, zombie_painb20 ] {} +void() zombie_painb20 =[ $painb20, zombie_painb21 ] {} +void() zombie_painb21 =[ $painb21, zombie_painb22 ] {} +void() zombie_painb22 =[ $painb22, zombie_painb23 ] {} +void() zombie_painb23 =[ $painb23, zombie_painb24 ] {} +void() zombie_painb24 =[ $painb24, zombie_painb25 ] {} +void() zombie_painb25 =[ $painb25, zombie_painb26 ] {ai_painforward(1);} +void() zombie_painb26 =[ $painb26, zombie_painb27 ] {} +void() zombie_painb27 =[ $painb27, zombie_painb28 ] {} +void() zombie_painb28 =[ $painb28, zombie_run1 ] {} + +void() zombie_painc1 =[ $painc1, zombie_painc2 ] {sound (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);} +void() zombie_painc2 =[ $painc2, zombie_painc3 ] {} +void() zombie_painc3 =[ $painc3, zombie_painc4 ] {ai_pain(3);} +void() zombie_painc4 =[ $painc4, zombie_painc5 ] {ai_pain(1);} +void() zombie_painc5 =[ $painc5, zombie_painc6 ] {} +void() zombie_painc6 =[ $painc6, zombie_painc7 ] {} +void() zombie_painc7 =[ $painc7, zombie_painc8 ] {} +void() zombie_painc8 =[ $painc8, zombie_painc9 ] {} +void() zombie_painc9 =[ $painc9, zombie_painc10 ] {} +void() zombie_painc10 =[ $painc10, zombie_painc11 ] {} +void() zombie_painc11 =[ $painc11, zombie_painc12 ] {ai_painforward(1);} +void() zombie_painc12 =[ $painc12, zombie_painc13 ] {ai_painforward(1);} +void() zombie_painc13 =[ $painc13, zombie_painc14 ] {} +void() zombie_painc14 =[ $painc14, zombie_painc15 ] {} +void() zombie_painc15 =[ $painc15, zombie_painc16 ] {} +void() zombie_painc16 =[ $painc16, zombie_painc17 ] {} +void() zombie_painc17 =[ $painc17, zombie_painc18 ] {} +void() zombie_painc18 =[ $painc18, zombie_run1 ] {} + +void() zombie_paind1 =[ $paind1, zombie_paind2 ] {sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);} +void() zombie_paind2 =[ $paind2, zombie_paind3 ] {} +void() zombie_paind3 =[ $paind3, zombie_paind4 ] {} +void() zombie_paind4 =[ $paind4, zombie_paind5 ] {} +void() zombie_paind5 =[ $paind5, zombie_paind6 ] {} +void() zombie_paind6 =[ $paind6, zombie_paind7 ] {} +void() zombie_paind7 =[ $paind7, zombie_paind8 ] {} +void() zombie_paind8 =[ $paind8, zombie_paind9 ] {} +void() zombie_paind9 =[ $paind9, zombie_paind10 ] {ai_pain(1);} +void() zombie_paind10 =[ $paind10, zombie_paind11 ] {} +void() zombie_paind11 =[ $paind11, zombie_paind12 ] {} +void() zombie_paind12 =[ $paind12, zombie_paind13 ] {} +void() zombie_paind13 =[ $paind13, zombie_run1 ] {} + +void() zombie_paine1 =[ $paine1, zombie_paine2 ] { + sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); + self.health = 60; +} +void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);} +void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);} +void() zombie_paine4 =[ $paine4, zombie_paine5 ] {ai_pain(3);} +void() zombie_paine5 =[ $paine5, zombie_paine6 ] {ai_pain(1);} +void() zombie_paine6 =[ $paine6, zombie_paine7 ] {ai_pain(2);} +void() zombie_paine7 =[ $paine7, zombie_paine8 ] {ai_pain(1);} +void() zombie_paine8 =[ $paine8, zombie_paine9 ] {ai_pain(1);} +void() zombie_paine9 =[ $paine9, zombie_paine10 ] {ai_pain(2);} +void() zombie_paine10 =[ $paine10, zombie_paine11 ] { + sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; +} +void() zombie_paine11 =[ $paine11, zombie_paine12 ] { + self.nextthink = time + 5; + self.health = 60; +} +void() zombie_paine12 =[ $paine12, zombie_paine13 ]{ + // see if ok to stand up + self.health = 60; + if (zombie_forget(zombie_lay)) + return; + + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 40'); + if (!walkmove (0, 0)) + { + self.think = zombie_paine11; + self.solid = SOLID_NOT; + return; + } +} +void() zombie_paine13 =[ $paine13, zombie_paine14 ] {} +void() zombie_paine14 =[ $paine14, zombie_paine15 ] {self.th_stand = zombie_stand1;} +void() zombie_paine15 =[ $paine15, zombie_paine16 ] {} +void() zombie_paine16 =[ $paine16, zombie_paine17 ] {} +void() zombie_paine17 =[ $paine17, zombie_paine18 ] {} +void() zombie_paine18 =[ $paine18, zombie_paine19 ] {} +void() zombie_paine19 =[ $paine19, zombie_paine20 ] {} +void() zombie_paine20 =[ $paine20, zombie_paine21 ] {} +void() zombie_paine21 =[ $paine21, zombie_paine22 ] {} +void() zombie_paine22 =[ $paine22, zombie_paine23 ] {} +void() zombie_paine23 =[ $paine23, zombie_paine24 ] {} +void() zombie_paine24 =[ $paine24, zombie_paine25 ] {} +void() zombie_paine25 =[ $paine25, zombie_paine26 ] {ai_painforward(5);} +void() zombie_paine26 =[ $paine26, zombie_paine27 ] {ai_painforward(3);} +void() zombie_paine27 =[ $paine27, zombie_paine28 ] {ai_painforward(1);} +void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);} +void() zombie_paine29 =[ $paine29, zombie_paine30 ] {} +void() zombie_paine30 =[ $paine30, zombie_run1 ] { + self.spawnflags = not(self.spawnflags, SPAWN_LYING); // clear lying spawnflag +} + +void() zombie_die = +{ + sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); + GibSpray ("progs/h_zombie.mdl", self.health); +} + +// lunaran - for sleeping on the job +void() zombie_lay =[ $paine12, zombie_lay ] { + ai_stand(); + self.customflags = self.customflags | (CFL_INPAIN | CFL_KNOCKEDDOWN); + self.solid = SOLID_NOT; + // self.takedamage = DAMAGE_NO; +} + +void() zombie_getup =[ $paine12, zombie_paine13 ]{ + // see if ok to stand up + self.health = 60; + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_NORM); + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 40'); + if (!walkmove (0, 0)) + { + self.think = zombie_paine11; + self.solid = SOLID_NOT; + return; + } +} + +// zombies forget non-player enemies when downed so they don't resume infights +float(void() lay) zombie_forget = +{ + if (self.enemy.classname != "player") + { + if (self.oldenemy.classname == "player") + self.enemy = self.oldenemy; + else + self.enemy = world; + self.oldenemy = world; + } + if (!self.enemy) + { + // if the zombie had two non-player enemies, just stay on the ground until + // a player comes along and re-aggroes them + self.th_stand = lay; + lay(); + return TRUE; + } + return FALSE; +} + +/* +================= +zombie_pain + +Zombies can only be killed (gibbed) by doing 60 hit points of damage +in a single frame (rockets, grenades, quad shotgun, quad nailgun). + +A hit of 25 points or more (super shotgun, quad nailgun) will always put it +down to the ground. + +A hit of from 10 to 40 points in one frame will cause it to go down if it +has been twice in two seconds, otherwise it goes into one of the four +fast pain frames. + +A hit of less than 10 points of damage (winged by a shotgun) will be ignored. + +FIXME: aggro juggling stops zombies from dropping down - why? +================= +*/ +void(entity attacker, float take) zombie_pain = +{ + local float r; + + // always reset health + self.health = 60; + + if (take < 9) + return; + if (self.customflags & CFL_KNOCKEDDOWN ) + return; + + // go down immediately if hit is big enough or frequent enough + if (take >= 25 || self.pain_finished > time) + { + self.customflags = self.customflags | CFL_KNOCKEDDOWN; + zombie_paine1 (); + return; + } + + // if hit again in next few seconds while not in pain frames, definitely drop + if (self.customflags & CFL_INPAIN ) + { + self.pain_finished = time + 3; + return; + } + + // go into one of the fast pain animations + self.customflags = self.customflags | CFL_INPAIN; + + r = random(); + if (r < 0.25) + zombie_paina1 (); + else if (r < 0.5) + zombie_painb1 (); + else if (r < 0.75) + zombie_painc1 (); + else + zombie_paind1 (); +} + +//============================================================================ + +// fucking crucified flag >( +float() zombie_crucifix = +{ + local float lowflags, hiflags; + + lowflags = self.spawnflags & 15; + hiflags = self.spawnflags - lowflags; + + // shift flags down 1 bit so I don't have to add (if classname == zombie) exceptions all over the place + if (lowflags & SPAWN_CRUCIFIEDX) + hiflags |= SPAWN_CRUCIFIED; + lowflags = floor((lowflags / 2) + 0.5); + + self.spawnflags = lowflags + hiflags; + + return (self.spawnflags & SPAWN_CRUCIFIED); +} + +void() monster_zombie_spawn = +{ + self.classname = "monster_zombie"; + self.type = "zombie"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/zombie.mdl"); + + if (self.deathtype == string_null) + self.deathtype = "joins the Zombies"; + + setsize (self, '-16 -16 -24', '16 16 40'); + if (self.spawnflags & SPAWN_CRUCIFIED) + { + self.movetype = MOVETYPE_NONE; + self.use = zombie_die; + zombie_cruc1 (); + } + else + { + self.health = 60; + + if (self.spawnflags & SPAWN_LYING) // lying in wait flag for zombehs + { + self.th_stand = zombie_lay; + self.frame = $paine12; // don't display frame 1 in the split second before first think + + // setorigin(self, self.origin - '0 0 12'); + } + else + { + self.th_stand = zombie_stand1; + } + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; + self.th_checkattack = CheckAttack; + + walkmonster_start(); + } +} + +void() monster_zombie_spawner = {mon_spawner_use(monster_zombie_spawn);} + +/*QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) Crucified Ambush Lying ? Triggered NoTfog NoTelefrag Instawake +Zombie, 60 health points. If crucified, stick the bounding box back 12 pixels into the wall to look right. + +Flags: +"crucified" stick the bounding box 12 pixels back into a wall to look right. +"ambush" only wake up on seeing the player, not another monster getting angry +"lying" will spawn knocked down and will get up when awakened - good for hiding in water + +"Triggered" will not spawn until triggered - triggering again will wake him up. Set 'count' to make this a multi-use spawner. +"NoTfog" supress teleport glitter when spawned with 'triggered' +"NoTelefrag" will silently fail to spawn if doing so would telefrag an existing monster. the mapper is responsible for triggering it again. +"Instawake" spawn angry at activator + +Keys: +"target" entity to trigger when killed +"targetname" entity name +"movedir" set to a velocity to make the monster jump on awakening +*/ +/*FGD +@PointClass base(Monster) size(-16 -16 -24, 16 16 32) model({ "path": ":progs/zombie.mdl" }) = monster_zombie : "Zombie" +[ + spawnflags(Flags) = + [ + 1 : "Crucified" : 0 + 2 : "Ambush" : 0 + 4 : "Spawn Prone" : 0 + ] +] +*/ +void() monster_zombie = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch || cvar("nomonsters") != 0) + { + remove(self); + return; + } + + precache_model ("progs/zombie.mdl"); + precache_model ("progs/h_zombie.mdl"); + precache_model ("progs/zom_gib.mdl"); + + precache_sound ("zombie/z_idle.wav"); + precache_sound ("zombie/z_idle1.wav"); + precache_sound ("zombie/z_shot1.wav"); + precache_sound ("zombie/z_gib.wav"); + precache_sound ("zombie/z_pain.wav"); + precache_sound ("zombie/z_pain1.wav"); + precache_sound ("zombie/z_fall.wav"); + precache_sound ("zombie/z_miss.wav"); + precache_sound ("zombie/z_hit.wav"); + precache_sound ("zombie/idle_w2.wav"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.type = "zombie"; + + if ( !zombie_crucifix() ) + { + // TODO: if triggered and lying, spawn 16u under the ground and rise through the floor on spawn + if ( monster_spawnsetup( monster_zombie_spawner ) ) return; + + addmonster(1); + } + monster_zombie_spawn(); +} diff --git a/QC_other/QC_copper/maths.qc b/QC_other/QC_copper/maths.qc new file mode 100644 index 00000000..6cab5daf --- /dev/null +++ b/QC_other/QC_copper/maths.qc @@ -0,0 +1,306 @@ +// =================== +// MATHS. +// =================== + +float mathlib_accuracy; //accuracy of sqrt & pow + +// frikqcc doesn't like it when i swizzle directly +// TODO: see if fteqcc cares +vector(float x, float y, float z) Vector = +{ + local vector swiz; + swiz_x = x; + swiz_y = y; + swiz_z = z; + return swiz; +} + +float (vector a, vector b) vdist = +{ + return vlen(b-a); +} +float (vector a, vector b) hdist = +{ + vector c = b - a; + c_z = 0; + return vlen(c); +} + +float (vector v) vlensqr = +{ + return v_x * v_x + v_y * v_y + v_z * v_z; +} + +vector(float num) SinCos = +{ + local vector angle, vf, vu, vr, result; + + vf = v_forward; + vu = v_up; + vr = v_right; + + angle = '0 1 0' * num; + makevectors(angle); + result = Vector(v_forward_y,v_forward_x,0); + + v_forward = vf; + v_up = vu; + v_right = vr; + + return result; +} + +float(float num) sin = +{ + vector temp; + temp = SinCos(num); + return temp_x; +} + +float(float num) cos = +{ + vector temp; + temp = SinCos(num); + return temp_y; +} + +float(float num) tan = +{ + vector temp; + temp = SinCos(num); + return temp_x / temp_y; +} + +float(float y, float x) atan2 = +{ + local vector ang; //temporary used to calculate trig values + ang = '0 0 0'; + ang_x = x; + ang_y = y; + return vectoyaw(ang); +} + +vector(vector a, vector b) CrossProduct = +{ + vector c; + + c_x = a_y * b_z - a_z * b_y; + c_y = a_z * b_x - a_x * b_z; + c_z = a_x * b_y - a_y * b_x; + + return c; +} + +float(vector a, vector b) DotProduct = +{ +// return (a_x * b_x) + (a_y * b_y) + (a_z * b_z); + return a * b; // you idiot +} + +float(float a, float b, float mix) lerp = +{ + if (mix <= 0) return a; + if (mix >= 1) return b; + return (b * mix + a * ( 1 - mix ) ); +} + +vector(vector a, vector b, float mix) lerpVector = +{ + if (mix <= 0) return a; + if (mix >= 1) return b; + return (b * mix + a * ( 1 - mix ) ); +} + +// for a relaxing lerp: hermite lerp. +float(float a, float b, float mix) lerpHermite = +{ + if (mix <= 0) return a; + if (mix >= 1) return b; + + local float h01; + + h01 = mix * mix; + h01 *= 3 - 2 * mix; + + return (b * h01 + a * ( 1 - h01 ) ); +} + +vector(vector a, vector b, float mix) lerpVectorHermite = +{ + if (mix <= 0) return a; + if (mix >= 1) return b; + + local float h01; + + h01 = mix * mix; + h01 *= 3 - 2 * mix; + + return (b * h01 + a * ( 1 - h01 ) ); +} + +// even more smooth: +float(float a, float b, float mix) lerpCosine = +{ + if (mix <= 0) return a; + if (mix >= 1) return b; + + local float cmx; + cmx = (1 - cos(mix * 180)) / 2; + + return (b * cmx + a * ( 1 - cmx ) ); +} + +vector(vector a, vector b, float mix) lerpVectorCosine = +{ + if (mix <= 0) return a; + if (mix >= 1) return b; + + local float cmx; + cmx = (1 - cos(mix * 180)) / 2; + + return (b * cmx + a * ( 1 - cmx ) ); +} + + +// rotates B around A +vector(vector b, vector a, float r) rotateVectorAround = +{ + float sin, cos, dot; + vector cross, temp; + + cross = CrossProduct(a, b); + dot = a*b; + + temp = SinCos(r); + sin = temp_x; + cos = temp_y; + + return b*cos + cross*sin + a*dot*(1-cos); +} + +float() crandom = +{ + return 2*(random() - 0.5); +} + +vector(vector a, vector b) vec_scale = +{ + return Vector(a_x * b_x, a_y * b_y, a_z * b_z); +} + +float(float a, float b) min = { if (a <= b) return a; return b; } +float(float a, float b) max = { if (a >= b) return a; return b; } +float(float a, float mn, float mx) clamp = { if (a >= mx) return mx; if (a <= mn) return mn; return a; } +float(float a) saturate = { return clamp(a, 0, 1); } + +float(float a, float b) xor = { return (a | b) - (a & b); } +float(float a, float b) not = { return a - (a & b); } + +float(float a, float limit) cycle = +{ + a += 1; + if (a >= limit) return 0; + return a; +} + +// ================================ +// Z-Aware Projectile Maths +// ================================ +float(vector dest, float speed, float th) BallisticTheta = +{ + float a, b, c, y, z; + float theta, tan_theta, oldtheta; + + theta = th; + + //calculate how far we are firing + z = dest_z; + dest_z = 0; + y = vlen(dest); + + //find the coefficients of the quadratic in tan(theta) + a = 0.5 * world.gravity * y * y / (speed * speed); + b = -y; + c = a + z; + + if(b*b >= 4*a*c) //check if the destination is too far to reach + { + y = 0; + // newton raphson to within 1 degree, no more than 4x + while (fabs(oldtheta - theta) > 1 && y < 4) + { + oldtheta = theta; + tan_theta = tan(theta); + theta = atan2(a*tan_theta*tan_theta - c, 2*a*tan_theta + b); + y += 1; + } + + //constrain the values to stop anything too mad happening + while(theta > 90) + theta = theta - 180; + } + + return theta; +} + + +// ================================ + + +float(float base, float exp) ipow = +{ + float x, out; + + x = exp - 1; + out = base; + + while (x) + { + out *= base; + x -= 1; + } + return out; +} + + + + +// the following are by any one of the following people: +// frikac, preach, kashua, lordhavoc, sock + +float(float a, float b) mod = +{ + return a - (floor(a / b) * b); +} + +//faster version of id's anglemod +float(float v) anglemod = +{ + return v - floor(v/360) * 360; +} + +// mathlib_sqrt +float(float num) sqrt = +{ + local float apr; + + if(mathlib_accuracy <= 0) + mathlib_accuracy = 0.001; //this sets a level of accuracy, it's a global float + + if (num < mathlib_accuracy) + return 0; + if (num>1) + apr = num; + else + apr = 1; + do + { + apr = (num + (apr * apr)) / (2 * apr); + } + while (fabs((apr * apr) - num) > (num * mathlib_accuracy)); + return apr; +} + + + + diff --git a/QC_other/QC_copper/meat.qc b/QC_other/QC_copper/meat.qc new file mode 100644 index 00000000..873ec942 --- /dev/null +++ b/QC_other/QC_copper/meat.qc @@ -0,0 +1,208 @@ +/* +============================================================================== + +MEAT FIREWORKS + +moved from player.qc + +the rule: gibs pass through .notrace monsterclip but heads do not, because heads +are kind of the trophies for gibbing something and should hang around rather +than fall through grates (also they look too big) + +============================================================================== +*/ + +vector(float dm) GibVelocityForHealth = +{ + local vector v; + local float voom; + + v_x = 150 * crandom(); + v_y = 150 * crandom(); + v_z = 150 + 150 * random(); + + voom = max(1, min(10, dm * dm / 5000)); + + return v * voom; +} + +entity(string gibname, float dm) ThrowGib = +{ + local entity gib; + + // gibs have to be thinking ballistic projectiles to pass through monsterclip/notrace :( + gib = toss_projectile(self.origin, GibVelocityForHealth(dm)); + gib.classname = "gib"; + gib.lifetime_finished = time + 8 + random() * 8; + gib.th_die = SUB_Remove; + + SUB_ChangeModel(gib, gibname); +// gib.solid = SOLID_NOT; + gib.type = "gib"; + gib.avelocity = Vector(random(),random(),random()) * 600; + + gib.frame = 0; + gib.flags = 0; + + return gib; +} + +void(string gibname, float dm) ThrowHead = +{ + setmodel (self, gibname); + self.frame = 0; + self.nextthink = -1; + //self.skin = 0; // so skinned variants of monsters (like rocket ogres) don't throw blue mystery heads + self.movetype = MOVETYPE_BOUNCE; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + self.view_ofs = '0 0 8'; + setsize (self, '-16 -16 0', '16 16 56'); + self.velocity = GibVelocityForHealth (dm); + self.origin_z = self.absmax_z - 24; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.type = "head"; + self.avelocity = crandom() * '0 600 0'; +} + + +// Gib & GibSpray are split up since some monsters play special gib sounds (zombies/players) and +// I want all monsters going through GibSpray for trigger_void tests +void(string headmdl, float dm) GibSpray = +{ + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + + if (self.classname != "player") + if (damage_attacker.classname == "trigger_void" || damage_attacker.classname == "func_void" ) + { + SUB_Remove(); + return; + } + + + ThrowHead (headmdl, dm); +} + +void(string headmdl, float dm) Gib = +{ + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + + GibSpray(headmdl, dm); +} + + +/* +================ +SpawnMeatSpray +================ +*/ +void(vector org, vector vel) SpawnMeatSpray = +{ + entity meat; + vector mvel; + + mvel = vel; + mvel_z += 250 + 50 * random(); + + meat = toss_projectile(org, mvel); + //meat.solid = SOLID_NOT; + meat.type = "gib"; + meat.avelocity = '3000 1000 2000'; + meat.lifetime_finished = time + 1; + meat.classname = "gib"; + + SUB_ChangeModel(meat, "progs/zom_gib.mdl"); +} + +/* +================ +SpawnBlood +================ +*/ +void(vector org, vector vel, float damage) SpawnBlood = +{ + particle (org, vel*0.1, 73, damage*2); +} + +//============================================================================ + +// meat noise +// meat noise +// play that funky meat noise +void() meat_noise = +{ + float r = random(); + if (r < 0.25) + sound (self, CHAN_BODY, "player/teledth1.wav", 1, ATTN_NORM); + else if (r < 0.5) + sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NORM); + else if (r < 0.75) + sound (self, CHAN_BODY, "player/udeath.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "player/gib.wav", 1, ATTN_NORM); +} + +void() target_meat_fireworks_go = +{ + meat_noise(); + + SpawnMeatSpray(self.origin, Vector(crandom(),crandom(),0.5) * self.speed); + SpawnMeatSpray(self.origin, Vector(crandom(),crandom(),0.5) * self.speed); + ThrowGib ("progs/gib1.mdl", self.speed * -1); + ThrowGib ("progs/gib2.mdl", self.speed * -1); + ThrowGib ("progs/gib3.mdl", self.speed * -1); +} + +void() target_meat_fireworks_use = +{ + float i; + entity meats; + + if (self.count == 1 && self.delay == 0) + { + target_meat_fireworks_go(); + return; + } + + for (i=0;i<self.count;i++) + { + meats = spawn(); + setorigin(meats, self.origin); + meats.think = target_meat_fireworks_go; + meats.speed = self.speed; + meats.nextthink = time + self.delay + self.wait * i; + } +} + +/*QUAKED target_meat_fireworks (0.7 .0 .2) (-16 -16 -16) (16 16 16) +trigger for meat + +Keys +"count" number of times of meat after triggering, default 1 +"delay" time to wait before first meat +"wait" time to wait between meat +"speed" speed of meat +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) size(32 32 32) color(180 0 50) = target_meat_fireworks : "trigger for meat" +[ + count(integer) : "Repeat meat" : 1 + delay(string) : "Delay before first meat" : "0" + wait(string) : "Wait between meat" : "1" + speed(integer) : "Speed of meat" : 128 +] +*/ +void() target_meat_fireworks = +{ + if (!SUB_ShouldSpawn()) return; + if (!self.speed) + self.speed = 128; + self.count = zeroconvertdefault(self.count, 1); + self.use = target_meat_fireworks_use; + if (!self.wait) + self.wait = 1; +} + +void() misc_meat_fireworks = {target_meat_fireworks();} \ No newline at end of file diff --git a/QC_other/QC_copper/misc.qc b/QC_other/QC_copper/misc.qc new file mode 100644 index 00000000..34cb0558 --- /dev/null +++ b/QC_other/QC_copper/misc.qc @@ -0,0 +1,809 @@ + +/*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) +Used as a positional target for spotlights, etc. Not present in game. +*/ +/*FGD +@PointClass base(Targetname) size(8 8 8) color(200 150 150) = info_null : "info_null (spotlight target)" [] +*/ +void() info_null = +{ + remove(self); +} + +/*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) +Used as a positional target for lighting. Present in game. +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) size(8 8 8) color(200 150 150) = info_notnull : "Wildcard entity" // I love you too +[ + use(string) : "self.use" + think(string) : "self.think" + nextthink(integer) : "nextthink" + noise(string) : "noise" + touch(string) : "self.touch" +] +*/ +void() info_notnull = +{ + if (!SUB_ShouldSpawn()) return; +} + +/*QUAKED misc_external_map (0.6 0.7 0.8) (-4 -4 -4) (4 4 4) + +"_external_map" Specifies the filename of the .map to import. +"_external_map_classname" What entity you want the external map to turn in to. You can use internal qbsp entity types such as "func_detail", or a regular bmodel classname like "func_wall" or "func_door". +"_external_map_angles" Rotation for the prefab, "pitch yaw roll" format. Negative pitch is UP. +"_external_map_angle" Short version of "_external_map_angles" for when you want to specify just a yaw rotation. +"_external_map_scale" Scale factor for the prefab, defaults to 1. Either specify a single value or three scales, "x y z". +*/ +/*FGD +@PointClass = misc_external_map : "Put another map in your map" [ + _external_map(string) : "Filename of .map to import" + _external_map_classname(string) : "Classname to turn imported worldspawn into" + _external_map_angles(string) : "Rotation (pitch yaw roll, negative pitch is up)" + _external_map_angle(string) : "Rotation (yaw only)" + _external_map_scale(string) : "Scale (one value or x y z)" +] +*/ + +void() misc_model_animate = +{ + vector anim; + if (self.state) anim = self.pos2; + else anim = self.pos1; + + self.frame += 1; + if (self.frame > anim_z) + { + self.frame = anim_x; + if (self.spawnflags & SPAWN_MODEL_ANIMONCE && self.state) + { + self.state = !self.state; + self.frame = self.pos1_y; + self.nextthink = time + self.speed; + return; + } + } + self.nextthink = time + self.speed; +} + +void() misc_model_use = +{ + float tmp; + self.state = !self.state; + if (self.spawnflags & SPAWN_MODEL_TOGGLEVIS) + { + tmp = self.oldstyle; + self.oldstyle = self.alpha; + self.alpha = tmp; + } + if (self.state) + { + self.frame = self.pos2_y; + } + else + { + self.frame = self.pos1_y; + } + self.think = misc_model_animate; + self.nextthink = time + self.speed; +} + +float SPAWN_MODEL_TOGGLEVIS = 1; +float SPAWN_MODEL_STARTINVIS = 2; +float SPAWN_MODEL_ANIMONCE = 4; + +/*QUAKED misc_model (0.6 0.7 0.8) (-8 -8 -8) (8 8 8) TOGGLE_VIS START_INVIS ANIM_ONCE +display a model. will not be solid! for a misc_model which can be toggled on or off, use a func_wall_point with a targetname. + +"model" filename of model to stand in for this entity. can be a bsp or an mdl. +"mangle" exact orientation of the model, values are 'pitch yaw roll', positive pitch is down +"frame" frame of model (0-ordinal) +"skin" skin index on model (0-ordinal) +"pos1" override frame with an animation (firstframe startframe lastframe) +"pos2" if triggerable, second animation to toggle to (firstframe startframe lastframe) +"ideal_yaw" randomly select yaw angle (for quickly scattering props) + +TOGGLE_VIS show/hide when triggered +START_INVIS start hidden +ANIM_ONCE if second triggered animation, will play once when triggered (instead of switching loops) + +dead player.mdl frame reference because we both know that's what you want: +axdeth: 49 (on back (with axe (duh))) +deatha: 60 (on face) +deathb: 69 (sat) +deathc: 84 (also on face) +deathd: 93 (also on face but arms under forehead as if sad) +deathe: 102 (on side) +*/ +/*FGD +@PointClass base(Appearflags) size(16 16 16) color(160 192 224) = misc_model : +"Display a model. Not solid. +for a misc_model which can be toggled on or off, use a func_wall_point with a targetname." +[ + spawnflags(flags) = [ + 1 : "Trigger Visibility" : 0 + 2 : "Start Invisible" : 0 + 4 : "2nd anim once" : 0 + ] + model(string) : "Filename of model (mdl or bsp)" + mangle(string) : "Orientation (pitch yaw roll, positive pitch is down)" + frame(integer) : "frame of mdl to display" : 0 + skin(integer) : "skin of mdl to display" : 0 + pos1(string) : "override frame with an animation (firstframe startframe lastframe)" + pos2(string) : "if triggerable, second animation to toggle to" +] +*/ +void() misc_model = +{ + if (!SUB_ShouldSpawn()) return; + + if (self.targetname == string_null && self.length == 0) + { + func_static_point(); + return; + } + + precache_safe_model(self.model); + + if (self.mangle != '0 0 0') + { + self.angles = self.mangle; + } + else if (self.angles != '0 0 0') + { + if (self.angles == '0 -1 0') + self.angles = '-90 0 0'; + else if (self.angles == '0 -2 0') + self.angles = '90 0 0'; + } + if (self.ideal_yaw) + self.angles_y = random()*360; + setmodel (self, self.model); + setsize(self, '-16 -16 -16', '16 16 16'); + + if (self.spawnflags & SPAWN_MODEL_STARTINVIS) + { + self.oldstyle = self.alpha; + self.alpha = -1; + } + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (!self.speed) + self.speed = 0.1; + + // toggle animation + if (self.targetname != string_null) + { + self.use = misc_model_use; + } + if (self.pos1) + { + self.frame = self.pos1_y; + self.think = misc_model_animate; + self.nextthink = time + 0.1; + } +} + + +//============================================================================ + + +void() target_heal_setmax = +{ + if (self.max_health) + self.count = self.max_health - activator.health; + else + self.count = activator.max_health - activator.health; + if (self.strength) + self.count = ceil(self.count * self.strength); + self.count = max(self.lip, self.count); +} + +void() target_heal_do = +{ + float h; + entity tgt; + + if (self.count > 0) + h = min(self.healamount, self.count); // only heal for what's left if we're almost dry + else + h = self.healamount; + + // don't heal activator if we have target fields even if we find no targets, + // because if a target_heal's targets have all been killtargeted or removed + // we don't want the player to receive mystery health instead + if (self.target == string_null && + self.target2 == string_null && + self.target3 == string_null && + self.target4 == string_null) + { + if ((self.spawnflags & 2) && tgt.classname != "player") + return; // player only + tgt = activator; + if (T_Heal(tgt, h, (self.spawnflags & 1)) && self.count > 0) + self.count -= h; + return; + } + + if (self.target == string_null) return; + tgt = world; while(1) { + tgt = find(tgt,targetname,self.target); if (!tgt) break; + if (T_Heal(tgt, h, (self.spawnflags & 1)) && self.count > 0) + self.count -= h; + } + if (self.target2 == string_null) return; + tgt = world; while(1) { + tgt = find(tgt,targetname,self.target2); if (!tgt) break; + if (T_Heal(tgt, h, (self.spawnflags & 1)) && self.count > 0) + self.count -= h; + } + if (self.target3 == string_null) return; + tgt = world; while(1) { + tgt = find(tgt,targetname,self.target3); if (!tgt) break; + if (T_Heal(tgt, h, (self.spawnflags & 1)) && self.count > 0) + self.count -= h; + } + if (self.target4 == string_null) return; + tgt = world; while(1) { + tgt = find(tgt,targetname,self.target4); if (!tgt) break; + if (T_Heal(tgt, h, (self.spawnflags & 1)) && self.count > 0) + self.count -= h; + } +} + +void() target_heal_use = +{ + if (self.customflags & CFL_LOCKED) + return; + if (self.count == 0) + return; // we're dry + + // trigger first + if (!self.state) + { + self.state = 1; + // autobalance + if ((self.spawnflags & 8) && activator.health >= 0 && activator.max_health) + target_heal_setmax(); + + return; + } + + target_heal_do(); +} + +/*QUAKED target_heal (0.75 0.25 0) (-8 -8 -8) (8 8 8) OVERHEAL PLAYER_ONLY TRIGGER_FIRST AUTO_AMT +Heals activator for 'healamount' when triggered. Use for healing pools, first aid dispensers, etc. +If it has any targets, it heals them instead, even doors and buttons. This will not reset 'dead' doors or buttons with a wait of -1. + +Spawnflags: +OVERHEAL will ignore target's max_health when healing +PLAYER_ONLY will ignore any targets or activators which aren't clients +TRIGGER_FIRST will treat its first trigger as an activation, then work normally after +AUTO_AMT if trigger_first, will choose 'count' based on how much health the activator needs when first triggered, for dirty lazy automatic game balance + +Keyvalues: +"healamount" amount to heal per use, default 5 +"count" expire after healing this much in total, default -1 (never) + "strength" if auto, count will be multiplied by this much, default 1 + "lip" if auto, never set count less than this much, defaults to healamount + "max_health" if auto, never set count to heal *target* above this much +*/ +/*FGD +@Pointclass base(Target, Targetname, Appearflags) color(192 64 0) size(32 32 32) = target_heal : +"Heals targets when triggered, or activator if no targets set" +[ + spawnflags(flags) = [ + 1 : "ignore max_health" : 0 + 2 : "ignore non-clients" : 0 + 4 : "first trigger activates" : 0 + 8 : "auto-set count on trigger-first" : 0 + ] + healamount(integer) : "heal per use" : 5 + count(integer) : "lifetime limit" : -1 + strength(string) : "scale auto-limit" : "1.0" + lip(integer) : "minimum for auto-limit" + max_health(integer) : "max target health for auto-limit" +] +*/ +void() target_heal = +{ + if (self.healamount <= 0) + self.healamount = 5; + if (!self.count) + self.count = -1; + if (!(self.spawnflags & 4)) + self.state = 1; + if (self.spawnflags & 8) + { + if (!self.strength) self.strength = 1; + if (!self.lip) self.lip = self.healamount; + } + + self.use = target_heal_use; +} + + + +//============================================================================ + + +void() target_kill_use = +{ + local entity t; + + // kill targets + if (self.target != string_null) { + t = world; + do { + t = find(t, targetname, self.target); + if (!t) break; + RemoveTarget (t); + } while ( 1 ); + } + if (self.target2 != string_null) { + t = world; + do { + t = find(t, targetname, self.target2); + if (!t) break; + RemoveTarget (t); + } while ( 1 ); + } + if (self.target3 != string_null) { + t = world; + do { + t = find(t, targetname, self.target3); + if (!t) break; + RemoveTarget (t); + } while ( 1 ); + } + if (self.target4 != string_null) { + t = world; + do { + t = find(t, targetname, self.target4); + if (!t) break; + RemoveTarget (t); + } while ( 1 ); + } + + SUB_KillTargets(self.killtarget); +} + +/*QUAKED target_kill (0.75 0.5 0) (-8 -8 -8) (8 8 8) +Kills ALL of its targets (1-4) as well as killtargets when triggered. for targets you really don't like. +*/ +/*FGD +@Pointclass base(Target, Targetname, Appearflags) color(192 64 0) size(16 16 16) = target_kill : +"Removes all targets when triggered." [] +*/ +void() target_kill = +{ + if (!SUB_ShouldSpawn()) return; + self.use = target_kill_use; +} + +//============================================================================ + + +void() target_autosave_use = +{ + if (self.enemy) + { + activator = self.enemy; + self.enemy = world; + } + if (activator.classname != "player") return; + if (time < 2) // make sure an autosave fired from a player start doesn't happen too early + { + if (serverflags & SVFL_RESPAWNING) + { + dprint("RESPAWNING flag set, skipping autosave\n"); + return; + } + self.enemy = activator; + self.think = target_autosave_use; + self.nextthink = 2; + return; + } + autosave(activator, self.message); +} + +/*QUAKED target_autosave (1 .0 .5) (-8 -8 -8) (8 8 8) +Saves the game when triggered by a player. Never appears in multiplayer. the bprint tends to stomp any other prints on screen in most quake clients, so use a delayed trigger_relay if you fire this from an important pickup/trigger_counter/something else that puts text on screen more important than the autosave blurb. + +Keys: +"message" change save file name, defaults to 'auto' +*/ +/*FGD +@Pointclass base(Target, Targetname, Appearflags) color(255 0 128) size(32 32 32) = target_autosave : +"Saves the game when triggered by a player. Never appears in multiplayer. +the bprint tends to stomp any other prints on screen in most quake clients, so use a delayed trigger_relay if you fire this from an important pickup/trigger_counter/something else that puts text on screen more important than the autosave blurb." +[ + message(string) : "Change save filename" : "auto" +] +*/ +void() target_autosave = +{ + if (deathmatch) + { + remove(self); + return; + } + + // never autosave in coop anyway + self.spawnflags = not(self.spawnflags, SPAWN_COOPONLY) | SPAWN_NOTCOOP; + if (!SUB_ShouldSpawn()) return; + + if (self.message == string_null) + self.message = "auto"; + + self.use = target_autosave_use; +} + + +//============================================================================ + + + + +void() lavaball_touch = +{ + if (other.takedamage) + { + sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_IDLE); + T_Damage (other, self, self, self.dmg); + } + remove(self); +} + +void() lavaball_fly = +{ + entity fireball; + vector vel; + vel = self.movedir * self.speed; + vel_x += crandom() * self.mangle_x; + vel_y += crandom() * self.mangle_y; + vel_z += crandom() * self.mangle_z; + + fireball = launch_lavamissile(self.origin, vel); + fireball.movetype = MOVETYPE_TOSS; + + fireball.classname = "fireball"; + + if (!(self.spawnflags & 4)) + fireball.touch = lavaball_touch; + fireball.dmg = self.dmg; +} + +void() lavaball_toggle = +{ + self.state = !self.state; + if (!self.state) + { + self.nextthink = 0; + return; + } + self.think = lavaball_idle; + self.nextthink = time + self.delay + random() * self.rand; +} + +void() lavaball_use = +{ + self.nextthink = time + self.delay + random() * self.rand; + self.think = lavaball_fly; +} + +void() lavaball_idle = +{ + lavaball_fly(); + self.nextthink = time + self.wait + random() * self.rand; +} + +/*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8) START_OFF BURST EXPLODE +LavA_Ballz +Fires randomly. Trigger to turn on/off. + +"wait" min pause between balls +"rand" max extra pause between balls (total pause is 'wait' + 'rand' * random()) +"speed" launch velocity, defaults to 1000 +"movedir" launch direction, defaults to straight up (0 0 1) +"mangle" amount of randomness to apply to velocity (x, y, z) +"dmg" damage on contact, default 20 + +Spawnflags +START_OFF start off +BURST fires "delay" seconds after being triggered +EXPLODE blow up on contact, does 'dmg' damage (default 20) +*/ +/*FGD +@PointClass base(Appearflags, Targetname) model({ "path": ":progs/lavaball.mdl" }) = misc_fireball : "Lavaball Launcher. Trigger to toggle on/off." +[ + spawnflags(flags) = [ + 1 : "Start off" : 0 + 2 : "Launch when triggered (no toggle)" : 0 + 4 : "Explode on contact" : 0 + ] + delay(string) : "Pause before first ball" : "0" + wait(string) : "Pause between balls" : "3" + rand(string) : "Random extra pause before ball" : "5" + speed(integer) : "Speed" : 1000 + movedir(string) : "Launch Dir" : "0 0 1" + mangle(string) : "Random velocity addition (x y z)" : "50 50 100" + dmg(integer) : "Contact damage" : 20 +] +*/ +void() misc_fireball = +{ + if (!SUB_ShouldSpawn()) return; + + precache_model ("progs/lavaball.mdl"); + self.classname = "fireball"; + + self.wait = zeroconvertdefault(self.wait, 3); + self.rand = zeroconvertdefault(self.rand, 5); + self.dmg = zeroconvertdefault(self.dmg, 20); + + if (self.targetname == string_null) + { + self.think = lavaball_idle; + self.nextthink = time + self.delay + (random() * self.rand); + } + else // targeted + { + if (self.spawnflags & 2) // fire on trigger + self.use = lavaball_use; + else // toggle on trigger + { + self.state = !(self.spawnflags & 1); + self.use = lavaball_toggle; + } + } + + if (self.mangle == VEC_ORIGIN) + self.mangle = '50 50 100'; + if (self.movedir == VEC_ORIGIN) + self.movedir = '0 0 1'; + else + self.movedir = normalize(self.movedir); + self.speed = zeroconvertdefault(self.speed, 1000); +} + + + +//============================================================================ + +float SPAWNFLAG_SHOOTER_SUPERSPIKE = 1; +float SPAWNFLAG_SHOOTER_LASER = 2; + +/*FGD +@baseclass base(Appearflags, Targetname, Angle) color(220 150 150) = Shooter +[ + spawnflags(Flags) = + [ + 1 : "Spike" : 0 + 2 : "Laser" : 0 + ] + movedir(string) : "Override launch vector (x y z)" + volume(string) : "Override sound volume" + mangle(string) : "Random velocity addition (x y z)" : "50 50 100" + delay(string) : "Pause before firing" : "0" +] +*/ + +void() spikeshooter_fire = +{ + if (self.state) return; + + vector dir; + entity tgt; + + if (self.target != string_null) + tgt = find(world, targetname, self.target); + + if (tgt) + dir = normalize(tgt.origin - self.origin); + else + dir = self.movedir; + + if (self.spawnflags & SPAWNFLAG_SHOOTER_LASER) + { + sound (self, CHAN_VOICE, "enforcer/enfire.wav", self.volume, ATTN_NORM); + dprint5("shot from ", vtos(self.origin), " at ",vtos(dir), "\n"); + launch_laser (self.origin, dir*600); + } + else + { + sound (self, CHAN_VOICE, "weapons/spike2.wav", self.volume, ATTN_NORM); + launch_nail (self.origin, dir * 500, (self.spawnflags & SPAWNFLAG_SHOOTER_SUPERSPIKE)); + } +} + +void() shooter_proxy_think = +{ + spikeshooter_fire(); + remove(self); +} + +void() shooter_once_think = +{ + // iw - if a shooter is triggered more often than its .delay, nextthink is + // repeatedly overwritten and the shooter never fires (bbin1) + // lunaran - spawn a proxy that'll fire at the right time to 'queue up' + // shots, so that none are missed + if (self.nextthink) + { + entity shooty = spawn(); + shooty.think = shooter_proxy_think; + shooty.nextthink = time + self.delay; + return; + } + self.think = spikeshooter_fire; + self.nextthink = time + self.delay; +} + +void() shooter_think = +{ + spikeshooter_fire (); + self.nextthink = time + self.wait + self.rand * random(); +} + +void() shooter_use = +{ + self.state = !(self.state); + + if (self.state) return; + + self.nextthink = time + self.delay; +} + +/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser +When triggered, fires a spike in the direction set by "angle". + +"movedir" override angle with a launch vector of your choosing +"mangle" random velocity offset +"delay" delay before firing (for staggering shooters) +"volume" override how loud these things are because damn +*/ +/*FGD +@PointClass base(Shooter) = trap_spikeshooter : "Triggered shooter" [] +*/ +void() trap_spikeshooter = +{ + if (!SUB_ShouldSpawn()) return; + SetMovedir (); + self.volume = zeroconvertdefault(self.volume, 1); + self.use = shooter_once_think; + if (self.spawnflags & SPAWNFLAG_SHOOTER_LASER) + { + precache_model2 ("progs/laser.mdl"); + + precache_sound2 ("enforcer/enfire.wav"); + precache_sound2 ("enforcer/enfstop.wav"); + } + else + precache_sound ("weapons/spike2.wav"); +} + + +/*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser frost +Continuously fires spikes in the direction set by "angle". Trigger to turn on, trigger again to turn off. +Laser is only for REGISTERED. YOU PAY FOR LASER +"wait" time between shots (1.0 default) +"delay" delay before firing first spike, so multiple shooters can be staggered +"movedir" override angle with a launch vector of your choosing +*/ +/*FGD +@PointClass base(Shooter) = trap_shooter : "Continuous shooter" +[ + nextthink(integer) : "Delay before first spike" + wait(integer) : "Wait between spikes" + rand(string) : "Random extra delay between spikes" +] +*/ +void() trap_shooter = +{ + if (!SUB_ShouldSpawn()) return; + trap_spikeshooter (); + + if (self.targetname != string_null) // start off if something targets us + self.state = 1; + self.use = shooter_use; + if (self.wait == 0) + self.wait = 1; + + // original id trap_shooter used nextthink as a mapper-editable delay, which is dumb + // add it to nextthink here anyway for backwards compatibility + self.nextthink = self.nextthink + self.delay + self.wait + self.ltime; + self.think = shooter_think; +} + +//============================================================================= + +void() target_multiprint_use = +{ + //dprint("in multiprint_use\n"); + // print the message + if (activator.classname == "player") + { + if ( self.message != string_null ) + { + centerprint (activator, self.message); + if (!(self.spawnflags & 1)) + sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + + self.message = self.noise; + self.noise = self.noise1; + self.noise1 = self.noise2; + self.noise2 = self.noise3; + self.noise3 = self.noise4; + self.noise4 = string_null; + } + else + { + SUB_UseTargets(); + } + } +} + +/*QUAKED target_multiprint (.5 .5 .5) (-8 -8 -8) (8 8 8) SILENT +This entity will print a different string every time it"s triggered. Prints "message", +"noise", "noise1", "noise2", "noise3", then "noise4." Once all strings are used up, it will +fire its targets instead (so several of these can be chained if you really need that +many prints in a row). + +SILENT: Don't play the beep wav when triggered. +*/ +/*FGD +@PointClass base(Appearflags, Targetname, Target) color(128 128 128) = target_multiprint : +"Target : Multiprint +Prints a different string every time it's triggered, or fires its targets if it ran out." +[ + spawnflags(flags) = [ + 1 : "Silent" : 0 + ] + message(string) : "First print" + noise(string) : "Second print" + noise1(string) : "Third print" + noise2(string) : "Fourth print" + noise3(string) : "Fifth print" + noise4(string) : "Sixth print" +] +*/ +void() target_multiprint = +{ + if (!SUB_ShouldSpawn()) return; + self.use = target_multiprint_use; +} + + + +/*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~> +~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/ + +/* viewthing (0 .5 .8) (-8 -8 -8) (8 8 8) + +Just for the debugging level. Don't use +*/ + +void() viewthing = + +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + precache_model ("progs/player.mdl"); + setmodel (self, "progs/player.mdl"); +} + + + +/* noclass (0 0 0) (-8 -8 -8) (8 8 8) +prints a warning message when spawned +*/ +void() noclass = +{ + dprint3("noclass spawned at",vtos(self.origin),"\n"); + remove (self); +} + diff --git a/QC_other/QC_copper/monsters.qc b/QC_other/QC_copper/monsters.qc new file mode 100644 index 00000000..c09f7749 --- /dev/null +++ b/QC_other/QC_copper/monsters.qc @@ -0,0 +1,493 @@ +/* +============================================================================== + +MONSTERS + +All things spawning and initializing + +============================================================================== +*/ + +/*FGD +@baseclass base(Angle, Appearflags, Target, Targetname, Deathtype) color(220 0 0) = Monster +[ + spawnflags(Flags) = + [ + 1 : "Ambush" : 0 + 16 : "Triggered Spawn" : 0 + 32 : "Teleflash on Spawn" : 0 + 64 : "No Telefrag on Spawn" : 0 + 128 : "Spawn Angry" : 0 + ] + movedir(string) : "Auto jump velocity on awaken" + count(integer) : "Number of times to spawn if triggered (-1 for infinite)" +] +*/ + +// at map start, anything that is a monster calls this and adds itself to various +// balance debugging totals, to take some of the guesswork out of ammo placement +void() TallyHitpoints = +{ + //dprint5("tally hitpoints for ",self.classname," adding ",ftos(self.health),"\n"); + if (self.classname == "monster_boss" || self.classname == "monster_oldone") + return; + + local float num; + num = 1; + if (self.spawnflags & SPAWN_TRIGGERED) + { + if (self.count > 1) + num = self.count; + } + + if (self.type == "zombie") + { + if ( !( self.spawnflags & SPAWN_CRUCIFIED ) ) + num_zombies += num; + } + else + monster_health += self.health * num; + + if (self.classname == "monster_army") + ammo_total += 5 * DEBUG_DMG_PER_SHELL; + //if (self.classname == "monster_enforcer") + // ammo_total += 5 * DEBUG_DMG_PER_CELL; + if (self.classname == "monster_ogre") + num_rockets += 1; +} + +/* +================================================================ + +SPAWNING + +all monster_* entities can be used as triggerable monster teleport spawns, +which is way better than building a big teleport setup in a hidden room +for each one. + +setting 'count' on any monster allows the same entity to be triggered more than +once to spawn monsters repeatedly. 'count' monsters are added to the kill total +when the map starts. +setting count to a negative number makes the spawner unlimited use, and monsters +are added to the kill total as they're spawned. + +FIXME: their bodies and head gibs WILL stick around forever + +================================================================ +*/ + + + +/* +================ +monster_spawnsetup_go + +sanity check for trigger-spawned monsters with no existing targeters +fix by iw +================ +*/ +void() monster_spawnsetup_go = +{ + self.think = SUB_Null; // just to tidy up after ourselves + + if (self.targetname == string_null) + { + dprint5("WARNING: removed triggered-spawn ", self.classname, + " with no targetname at ", vtos(self.origin), "\n"); + remove(self); + return; + } + + if (!SUB_VerifyTriggerable()) + { + dprint4("WARNING: removed triggered-spawn ", self.classname, + " with unmatched targetname '", self.targetname); + dprint3("' at ", vtos(self.origin), "\n"); + remove(self); + return; + } + + self.customflags |= CFL_SPAWNER; + self.use = self.think1; + self.think1 = SUB_Null; // just to tidy up after ourselves + + if (!self.count) + self.count = 1; + if (self.count < 0) + self.count = 0; + addmonster(self.count); +}; + +/* +================ +monster_spawnsetup + +Checks if this monster is in some way a spawner of monsters, and returns +TRUE if so, after scheduling appropriate setup. A return of TRUE should +signal the calling spawnfunc that the monster shouldn't continue to be +spawned right now. + +'spawnthink' is the function that should be used as the triggering action +if this monster is a spawner. +================ +*/ +float( void() spawnthink ) monster_spawnsetup = +{ + TallyHitpoints(); + + if (!(self.spawnflags & SPAWN_TRIGGERED)) + return FALSE; + + // wait for all potential targeters to finish spawning + self.think1 = spawnthink; + self.think = monster_spawnsetup_go; + self.nextthink = time + 0.1; + + return TRUE; +} + +void(float num) addmonster = +{ + if (!self.th_checkattack) + self.th_checkattack = CheckAttack; + + if (!num) return; + + total_monsters = total_monsters + num; + WriteByte (MSG_ALL, SVC_UPDATESTAT); + WriteByte (MSG_ALL, STAT_TOTALMONSTERS); + WriteLong (MSG_ALL, total_monsters); +} + +float(entity me) monster_check_enemy_activator = +{ + if (me.enemy) + return FALSE; + if (activator.health <= 0) + return FALSE; + // monsters spawning asleep seemed like a neat consequence for the ring of shadows, + // but it neuters big ambushes a little too hard + //if (activator.items & IT_INVISIBILITY) + // return FALSE; + if (activator.flags & FL_NOTARGET) + return FALSE; + if (activator.movetype == MOVETYPE_NOCLIP) + return FALSE; + if (activator.classname != "player") + return FALSE; + return TRUE; +} + + +entity() find_touching = +{ + entity head = findradius(BoundsCenter(self), self.size_z); + while (head != world) + { + if (head.health <= 0 || + (head.solid == SOLID_NOT || head.solid == SOLID_TRIGGER) || + !BoundsTouching(self.absmin, self.absmax, head.absmin, head.absmax, 2) ) + { + head = head.chain; + } + else return head; + } + return world; +} + + +entity( void() spawnthink ) mon_spawner_use = +{ + if ( (self.spawnflags & SPAWN_NO_TFRAG) ) + { + if (find_touching()) + { + return world; + } + } + + local entity mon; + mon = spawn(); + setorigin(mon, self.origin); + mon.angles = self.angles; + mon.nextthink = time + 0.01 + random()*0.05; + mon.spawnflags = self.spawnflags; + mon.movedir = self.movedir; + mon.lip = self.lip; + mon.state = self.state; + mon.health = self.health; + mon.think = spawnthink; + SUB_CopyTargets(mon); + + // set .enemy before monster_start thinks, because 'activator' will be different by then + if ( (self.spawnflags & SPAWN_INSTAWAKE) && monster_check_enemy_activator(mon) ) + { + mon.enemy = activator; + } + + if (!(self.spawnflags & SPAWN_NO_TFOG)) + { + teleport_flash(); + } + + if (self.count > 0) + { + self.count = self.count - 1; + if (self.count == 0) + { + SUB_Remove(); + } + } + else + { + addmonster(1); // add them one at a time if this is an unlimited spawner + } + + return mon; +} + +void(entity m) monster_kill = +{ + T_Damage(m, self, self, m.health + 100); +} + +/* +================ +monster_use + +Using a monster makes it angry at the current activator, because +nobody likes to be used +================ +*/ +void() monster_use = +{ + if (!monster_check_enemy_activator(self)) return; + + // delay reaction so the monster is still heard if it's teleported + self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + +} + + +/* +================ +monster_death_use + +When a monster dies, it fires all of its targets with the current +enemy as activator. +================ +*/ +void() monster_death_use = +{ + // fall to ground + if (self.flags & FL_FLY) + self.flags = self.flags - FL_FLY; + if (self.flags & FL_SWIM) + self.flags = self.flags - FL_SWIM; + + if (!self.target && !self.target2 && !self.target3 && !self.target4 && !self.killtarget) + return; + + // try to make player activator even if the monster was killed while infighting + if (self.enemy.classname != "player" && self.oldenemy.classname == "player") + activator = self.oldenemy; + else + activator = self.enemy; + + SUB_UseTargets (); +} + + +//============================================================================ + +/* +================ +Common monster starts +================ +*/ + +void() monster_start = +{ + // moved from mon_spawner_use because it was too early to catch the monster's mins and maxs + spawn_tdeath(self.origin, self); + + // wait a few frames to make sure doors have spawned before doing droptofloor + self.nextthink = 1.15; + // why 1.15 is a magic number: + // - quake starts 'time' at 1.0 seconds. + // - doors and movers and stuff reposition themselves at 1.1 seconds. + // - items drop themselves into place at 1.2 seconds, after movers, so that they fall on them + // in their final positions. + // - we want monsters to do this too, but before items do, because they were always before + // items originally and altering the drop order too much could cause items that didn't + // fall out of the world before to do so erroneously in Copper. + // - we don't use 'time + 0.15' because this could be running on a late spawn. a constant + // 1.15 will always be when we want at map start but in the past upon late spawn. + + if (self.type == string_null) + self.type = self.classname; + +} + +void() monster_start_go = +{ + local entity pathgoal; + self.takedamage = DAMAGE_AIM; + + self.ideal_yaw = self.angles * '0 1 0'; + self.use = monster_use; + self.flags = self.flags | FL_MONSTER; + + // check if the mapper placed them touching a killer liquid and grant them immunity to it + vector wtt; + wtt = WaterTest(); + if (wtt_x) + { + if (wtt_y == CONTENT_LAVA || wtt_y == CONTENT_SLIME) + { + self.customflags |= CFL_LIQUID_IMMUNE; + } + } + // ai_nav + //self.radius = (self.maxs_x - self.mins_x) * 0.7; + + if (self.enemy) + { + self.th_stand (); + self.think = FoundTarget; + } + else if (self.target) + { + pathgoal = find(world, targetname, self.target); + if (!pathgoal) + { + dprint (self.classname); + dprint (" at "); + dprint (vtos(self.origin)); + dprint (" can't find target\n"); + } + + if (pathgoal.classname == "path_corner") + { + self.goalentity = pathgoal; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + self.th_walk (); + } + else + { + self.pausetime = time + A_SHITLOAD; + self.th_stand (); + } + } + else + { + self.pausetime = time + A_SHITLOAD; + self.th_stand (); + } + + // spread think times so they don't all happen at same time + // add tiny minimum in case random() ever returns exactly 0 (rare but possible) + self.nextthink = time + random()*0.1 + 0.01; + +} + +/* +================ +Walkmonster starts +================ +*/ + +void() walkmonster_start_go = +{ + if (self.movedir == '0 0 0' && !(self.spawnflags & SPAWN_TRIGGERED) ) // always put telespawned monsters where the mapper wants + { + self.origin_z = self.origin_z + 1; // raise off floor a bit + droptofloor(0,0); + } + + if (!walkmove(0,0)) + { + dprint ("walkmonster in wall at: "); + dprint (vtos(self.origin)); + dprint ("\n"); + } + + if (!self.yaw_speed) + self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + + + monster_start_go(); +} + + +void() walkmonster_start = +{ + monster_start(); + self.think = walkmonster_start_go; +} + +/* +================ +Flymonster starts +================ +*/ + +void() flymonster_start_go = +{ + if (!self.yaw_speed) + self.yaw_speed = 10; + self.view_ofs = '0 0 25'; + + if (!walkmove(0,0)) + { + dprint ("flymonster in wall at: "); + dprint (vtos(self.origin)); + dprint ("\n"); + } + + + monster_start_go(); +} + +void() flymonster_start = +{ + monster_start(); + // iw -- move these here so fish don't fall for a frame and a half + self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_FLY; + + self.think = flymonster_start_go; +} + +/* +================ +Swimmonster starts +================ +*/ + +void() swimmonster_start_go = +{ + if (!self.yaw_speed) + self.yaw_speed = 20;//10 + self.view_ofs = '0 0 10'; + + // FIXME: why don't fish do a walkmove test? + monster_start_go(); + // yes besides the fact that they don't have feet dickhead +} + +void() swimmonster_start = +{ + monster_start(); + // iw -- move these here so fish don't fall for a frame and a half + self.flags = self.flags | FL_SWIM; + self.movetype = MOVETYPE_FLY; + + self.think = swimmonster_start_go; +} + + +// - \ No newline at end of file diff --git a/QC_other/QC_copper/plats.qc b/QC_other/QC_copper/plats.qc new file mode 100644 index 00000000..e298b2b6 --- /dev/null +++ b/QC_other/QC_copper/plats.qc @@ -0,0 +1,943 @@ +/* +============================================================================= + +LIFTS AND TRAINS + +============================================================================= +*/ + +float PLAT_LOW_TRIGGER = 1; + + +void() plat_spawn_inside_trigger = +{ + local entity t; + local vector tmin, tmax; + + // FIXME: if the plat spawns before the trigger, will this fail? + if (self.target) + { + // override touch zone for tweaking/effects + t = find (world, targetname, self.target); + if (!t) dprint("plat with unmatched target"); + if ( (t.classname != "trigger_once") && (t.classname != "trigger_multiple") && (t.classname != "trigger_multiple_box") ) + dprint("plat targets a non-trigger"); + } + else + { + // touch zone should extend from the top of the plat in its lowest position + // to 8 units above the top of the plat in its highest position. pos1 cannot + // be assumed to be the highest position. + t = spawn(); + local float high, low; + + high = max(self.pos1_z, self.pos2_z) + self.maxs_z; + low = min(self.pos1_z, self.pos2_z) + self.maxs_z; + + tmin = self.mins + '25 25 0'; + tmax = self.maxs - '25 25 0'; + if (self.size_x <= 50) + { + tmin_x = (self.mins_x + self.maxs_x) / 2; + tmax_x = tmin_x + 1; + } + if (self.size_y <= 50) + { + tmin_y = (self.mins_y + self.maxs_y) / 2; + tmax_y = tmin_y + 1; + } + + tmin_z = low; + if (self.spawnflags & PLAT_LOW_TRIGGER) + tmax_z = low + 8; + else + tmax_z = high + 8; + + t.solid = SOLID_TRIGGER; + setsize (t, tmin, tmax); + } + + t.touch = plat_center_touch; + t.think = SUB_Null; + t.movetype = MOVETYPE_NONE; + t.enemy = self; + self.trigger_field = t; + + self.target = ""; +} + +void() plat_hit_top = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; + self.think = plat_go_down; + self.nextthink = self.ltime + self.wait; +} + +void() plat_hit_bottom = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; +} + +void() plat_go_down = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom); +} + +void() plat_go_up = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, plat_hit_top); +} + +void() plat_center_touch = +{ + if (!CheckValidTouch()) return; + + self = self.enemy; + if (self.state == STATE_BOTTOM) + plat_go_up (); + else if (self.state == STATE_TOP) + self.nextthink = self.ltime + 1; // delay going down +} +/* +void() plat_outside_touch = +{ + if (!CheckValidTouch()) return; + +//dprint ("plat_outside_touch\n"); + self = self.enemy; + if (self.state == STATE_TOP) + plat_go_down (); +} +*/ +void() plat_trigger_use = +{ + if (self.think) + return; // already activated + plat_go_down(); +} + + +void() plat_crush = +{ +//dprint ("plat_crush\n"); + + T_Damage (other, self, self, 1); + + if (self.state == STATE_UP) + plat_go_down (); + else if (self.state == STATE_DOWN) + plat_go_up (); + else + dprint("plat_crush: bad self.state\n"); +} + +void() plat_use = +{ + self.use = SUB_Null; + if (self.state != STATE_UP) + dprint("plat_use: not in up state\n"); + plat_go_down(); +} + +void(entity p) plat_lock = +{ + p.trigger_field.touch = SUB_Null; + p.use = SUB_Null; + p.customflags |= CFL_LOCKED; +} + +void(entity p) plat_unlock = +{ + p.trigger_field.touch = plat_center_touch; + if (p.targetname != string_null) + p.use = plat_use; + p.customflags = not(p.customflags, CFL_LOCKED); +} + + +/*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER +Plats are always drawn in the extended position, so they will light correctly. +If the plat is the target of another trigger or button, it will start out disabled in the top position until it is triggered, when it will lower and become a normal plat. +If the plat targets a trigger once/multiple/multiple_box, it will override the plat's default activation zone. + +"PLAT_LOW_TRIGGER" activation zone will only be at the bottom of the movement course, instead of the whole vertical + +"speed" default 150 +"height" implicitly determine the distance the plat moves +"pos1"&"pos2" directly override top and bottom positions - plat can be built anywhere else in the map +"wait" time to pause at apex in seconds, default 3 +"sounds" + 1: base fast + 2: chain slow (default if 0) + -1: silent +*/ +/*FGD +@SolidClass base(Appearflags, Targetname) = func_plat : "Elevator" +[ + spawnflags(Flags) = + [ + 1 : "Low trigger volume" : 0 + ] + target(target_destination) : "Custom activation trigger" + speed(integer) : "Speed" : 150 + height(integer) : "Travel altitude (can be negative)" : 0 + wait(string) : "Apex pause time" : "3" + pos1(string) : "Override top position (x y z)" + pos2(string) : "Override bottom position (x y z)" + sounds(choices) : "Sound" : 1 = + [ + 0: "None" + 1: "Base fast" + 2: "Chain Slow" + ] +] +*/ +void() func_plat = +{ + if (!SUB_ShouldSpawn()) return; + + precache_safe_model(self.model); + + if (self.sounds == 0) + self.sounds = 2; + // FIXME load generic plat sound + + if (self.sounds == -1) + { + if (!self.noise) + self.noise = ("misc/null.wav"); + if (!self.noise1) + self.noise1 = ("misc/null.wav"); + precache_sound(self.noise); + precache_sound(self.noise1); + } + if (self.sounds == 1) + { + precache_sound ("plats/plat1.wav"); + precache_sound ("plats/plat2.wav"); + self.noise = "plats/plat1.wav"; + self.noise1 = "plats/plat2.wav"; + } + + if (self.sounds == 2) + { + precache_sound ("plats/medplat1.wav"); + precache_sound ("plats/medplat2.wav"); + self.noise = "plats/medplat1.wav"; + self.noise1 = "plats/medplat2.wav"; + } + + self.mangle = self.angles; + self.angles = '0 0 0'; + + self.classname = "plat"; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + setmodel (self, self.model); + setsize (self, self.mins, self.maxs); + + self.blocked = plat_crush; + if (!self.speed) + self.speed = 150; + if (!self.wait) + self.wait = 3; + + if (!self.pos1 && !self.pos2) + { + // pos1 is the top position, pos2 is the bottom + self.pos1 = self.origin; + self.pos2 = self.origin; + if (self.height) + self.pos2_z = self.origin_z - self.height; + else + self.pos2_z = self.origin_z - self.size_z + 8; + } + self.use = plat_trigger_use; + + plat_spawn_inside_trigger (); // the "start moving" trigger + + //if (self.targetname) + if (self.targetname != string_null) + { + setorigin (self, self.pos1); + self.state = STATE_UP; + self.use = plat_use; + } + else + { + setorigin (self, self.pos2); + self.state = STATE_BOTTOM; + } +} + +//============================================================================ + +void() train_sounds = +{ + if (self.sounds == 0) + { + if (!self.noise) + self.noise = ("misc/null.wav"); + if (!self.noise1) + self.noise1 = ("misc/null.wav"); + precache_sound(self.noise); + precache_sound(self.noise1); + } + + if (self.sounds == 1) + { + self.noise = ("plats/train2.wav"); + precache_sound ("plats/train2.wav"); + self.noise1 = ("plats/train1.wav"); + precache_sound ("plats/train1.wav"); + } + if (self.sounds == 2) + { + precache_sound ("plats/plat1.wav"); + precache_sound ("plats/plat2.wav"); + self.noise1 = "plats/plat1.wav"; + self.noise = "plats/plat2.wav"; + } + +} + +void() flytrain_think = +{ + self.think1(); + self.nextthink = self.ltime + 0.1; + +// dprint(ftos(vlen(self.velocity))); +// dprint("\n"); +} + +void() flytrain_use = +{ + if (self.think1 == fly_idle) + fly_newgoal( 1, 0 ); +} + +void() flytrain_init2 = +{ + //dprint("in flytrain_init2\n"); + fly_newgoal( 1, 0 ); + + self.think = flytrain_think; + flytrain_think(); + + //dprint("end of flytrain_init2\n"); +} + +// flytrain_init +// switch the light and sparklies on +void() flytrain_init = +{ + //dprint("in flytrain_init\n"); + self.goalentity = self; // haaax + self.use = flytrain_use; + self.think = flytrain_init2; + self.nextthink = self.ltime + 0.1; + //dprint("end of flytrain_init\n"); +} + +void() flytrain_stop = +{ + setorigin(self, self.goalentity.origin); + self.velocity = '0 0 0'; + self.nextthink = -1; +} + +/*FGD +@baseclass = TrainSounds [ + sounds(choices) : "Sound" : 1 = + [ + 0: "Silent/Override" + 1: "Ratchet Metal" + 2: "Base Lift" + ] +] +@baseclass base(Appearflags, Targetname, TrainSounds) = Train [ + speed(integer) : "Speed (units per second)" : 64 + target(target_source) : "Target to start at" + dmg(integer) : "Damage on block" : 2 + noise(string) : "Override stop sound" + noise1(string) : "Override move sound" +] +*/ + +/*QUAKED func_flytrain (0 .5 .8) ? +A func_train that follows a curved flypath and variable speed rules. Inherits movement speed from each path_corner's "speed" key. +If the train is the target of a button or trigger, it will not begin moving until activated. + +"sounds" +0) none, or, set your own with 'noise' (stop sound) and 'noise1' (move sound) +1) ratchet metal +2) base plat +*/ +/*FGD +@PointClass base(Train) size(16 16 16) = func_flytrain : +"A func_train that follows a curved flypath and variable speed rules. Inherits movement speed from each path_corner's 'speed' key." [] +*/ +void() func_flytrain = +{ + if (!SUB_ShouldSpawn()) return; + if (!self.speed) { + self.speed2 = 128; + self.speed = 128; + } + if (!self.target) + objerror ("func_train without a target"); + if (!self.dmg) + self.dmg = 2; + if (self.dmg == -1) + self.dmg = 0; + + train_sounds(); + + self.use = flytrain_init; + self.th_die = flytrain_stop; + self.th_stand = SUB_Null; + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + self.blocked = train_blocked; + self.classname = "train"; +} + +/*QUAKED func_flytrain_point (0 .5 .8) (-8 -8 -8) (8 8 8) +A func_train that follows a curved flypath and variable speed rules. Inherits movement speed from each path_corner's "speed" key. +If the train is the target of a button or trigger, it will not begin moving until activated. + +"sounds" +0) none, or, set your own with 'noise' (stop sound) and 'noise1' (move sound) +1) ratchet metal +2) base plat +*/ +/*FGD +@PointClass base(Train) size(16 16 16) = func_flytrain_point : +"A func_train that follows a curved flypath and variable speed rules. Inherits movement speed from each path_corner's 'speed' key." +[ + model(string) : "Model to use" +] +*/ +void() func_flytrain_point = +{ + if (!SUB_ShouldSpawn()) return; + + func_flytrain(); + + precache_safe_model(self.model); + setmodel (self, self.model); + setsize (self, self.mins, self.maxs); + setorigin (self, self.origin); +} + +//============================================================================ + +float TRAIN_INHERIT = 1; + +void() train_blocked = +{ + if (time < self.attack_finished) + return; + self.attack_finished = time + self.dmgtime; + T_Damage (other, self, self, self.dmg); +} + +void() train_use = +{ + if (self.state == STATE_ON) + return; // already activated + train_next(); +} + +void() train_wait = +{ + // trains now fire their pathcorners' targets on arrival + SUB_UseEntTargets(self.enemy); + + // inherit speed from path_corners on arrival + if (self.enemy.speed && self.spawnflags & TRAIN_INHERIT) + self.speed = self.enemy.speed; + + if (self.wait == -1) + { + self.state = STATE_OFF; + self.use = train_next; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + else if (self.wait > 0) + { + self.think = train_next; + self.nextthink = self.ltime + self.wait; + if (self.wait > 0.1) + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + else // self.wait is 0 or a garbage value + { + train_next(); + } +} + +void() train_next = +{ + local entity targ; + + //targ = find (world, targetname, self.target); + targ = findunlockedtarget(world); + self.enemy = targ; + self.target = targ.target; + if (targ.wait) + self.wait = targ.wait; + else + self.wait = self.pausetime; + if (!self.target && self.wait != -1) // if wait is forever, it doesn't matter if the path ends + { + dprint("train_next: no next target\n"); + remove(self); + return; + } + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_ON; + SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait); +} + +void() func_train_find = +{ + local entity targ; + + //targ = find (world, targetname, self.target); + targ = findunlockedtarget(world); + self.enemy = targ; + self.target = targ.target; + setorigin (self, targ.origin - self.mins); + if ((self.spawnflags & TRAIN_INHERIT) && targ.speed) + self.speed = targ.speed; + //if (!self.targetname) + if (self.targetname == string_null) + { // not triggered, so start immediately + self.state = STATE_ON; + self.nextthink = self.ltime + 0.1; + self.think = train_next; + } +} + +void() func_train_setup = +{ + if (!self.speed) + self.speed = 100; + if (!self.target) + objerror("func_train without a target"); + self.dmg = zeroconvertdefault(self.dmg, 2); + if (!self.dmgtime) + self.dmgtime = 0.5; + self.pausetime = zeroconvertdefault(self.pausetime, 0.1); + self.wait = 0; // this is american mcgee's fault + + train_sounds(); + +// self.cnt = 1; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + self.blocked = train_blocked; + self.use = train_use; + self.classname = "train"; + self.state = STATE_OFF; + + // start trains on the second frame, to make sure their targets have had + // a chance to spawn + self.nextthink = self.ltime + 0.1; + self.think = func_train_find; + +} + +/*QUAKED func_train (0 .5 .8) ? PATH_SPEED +Trains are moving platforms that players can ride. +The targets origin specifies the min point of the train at each corner. The train spawns at the first target it is pointing at. +If the train is the target of a button or trigger, it will not begin moving until activated. +A train will fire all targets of a pathcorner on arrival. +Keys: +"speed" default 100 +"dmg" default 2 +"sounds" + 0) none, or, set your own with 'noise' (stop sound) and 'noise1' (move sound) + 1) ratchet metal + 2) base plat +"pausetime" pausetime at a pathcorner that doesn't specify a wait, default 0.1, -1 for continuous motion + +Spawnflags: +PATH_SPEED: train will inherit 'speed' value from path_corners as it reaches them +*/ +/*FGD +@SolidClass base(Train) = func_train : "Moving platform. +Origin is min corner of the train. +A train will fire all targets of a pathcorner on arrival." [ + spawnflags(Flags) = [ + 1 : "Speed from path" : 0 + ] +] +*/ +void() func_train = +{ + if (!SUB_ShouldSpawn()) return; + func_train_setup(); + + precache_safe_model(self.model); + setmodel (self, self.model); + setsize (self, self.mins , self.maxs); + setorigin (self, self.origin); +} + +/*QUAKED func_train_point (0 .5 .8) (-8 -8 -8) (8 8 8) PATH_SPEED +Trains are moving platforms that players can ride. +The targets origin specifies the min point of the train at each corner. The train spawns at the first target it is pointing at. +If the train is the target of a button or trigger, it will not begin moving until activated. +A train will fire all targets of a pathcorner on arrival. +Keys: +"model" model to use +"speed" default 100 +"dmg" default 2 +"sounds" + 0) none, or, set your own with 'noise' (stop sound) and 'noise1' (move sound) + 1) ratchet metal + 2) base plat +"pausetime" pausetime at a pathcorner that doesn't specify a wait, default 0.1, -1 for continuous motion + +Spawnflags: +PATH_SPEED: train will inherit 'speed' value from path_corners as it reaches them +*/ +/*FGD +@PointClass base(Train) = func_train_point : "Moving platform. +Origin is min corner of the train. +A train will fire all targets of a pathcorner on arrival." +[ + model(string) : "Model to use" + spawnflags(Flags) = [ + 1 : "Speed from path" : 0 + ] +] +*/ +void() func_train_point = +{ + if (!SUB_ShouldSpawn()) return; + func_train_setup(); + + precache_model (self.model); + setmodel (self, self.model); + setsize (self, self.mins, self.maxs); + setorigin (self, self.origin); +} + +// ======================================= + +void() func_bobbing_blocked = +{ + T_Damage (other, self, self, self.dmg); + + if ((self.spawnflags & 2)) // don't reverse if we're a CRUSHER + return; + + // reversing direction entails reversing the phase + self.delay = (self.delay * -1) + 1; + func_bobbing_think(); +} + +void() func_bobbing_use = +{ + self.state = !self.state; + + + if (self.state) + { + if (self.noise != string_null) // cut off move sound with stop sound + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.nextthink = 0; + return; + } + + if (self.noise1 != string_null) // move + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.think(); +} + +vector(float phase) func_bobbing_pos = +{ + vector pos; + float cosD; + + cosD = (1 - cos(360 * phase)) / 2; // flip -1/1 and scale to 0-1 + pos = self.pos1 + (cosD * (self.pos2 - self.pos1)); + return pos; +} + +void() func_bobbing_think = +{ + vector dst; + float phase; + + // delay = current phase offset (0-1) + // length = current think rate + // wait = total wave interval + phase = self.delay + self.length / self.wait; // advance the phase + if ( (self.delay < 0.5 && phase > 0.5) || (self.delay < 1 && phase > 1) ) + { + // when we pass either apex, repeat the noises + if (self.noise1 != string_null) // move + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + if (self.noise != string_null) // stop + sound (self, CHAN_BODY, self.noise, 1, ATTN_NORM); + } + self.delay = phase; + while (self.delay > 1) // wrap phase to 0-1 + self.delay -= 1; + + dst = func_bobbing_pos(self.delay); + self.velocity = (dst - self.origin) / self.length; + self.nextthink = self.ltime + self.length; +} + +/*QUAKED func_bobbing (0 .5 .8) ? START_OFF CRUSHER +bobbatron 2000. does not need a 'speed' key; specify "wait" for the period and the bobbalondo 9000 does the rest. +trigger to freeze in place or reactivate. + +"angle" set bobaxis +"distance" total distance of bob, will move half this far in either direction +"pos1"/"pos2" ignore angle/distance and set apex offsets directly +"wait" wavelength of bob in seconds +"delay" phase offset to start at (0 = pos1, 0.5 = pos2, 1.0 = back at pos1 again) +"sounds" +0) none, or, set your own with 'noise' (stop sound) and 'noise1' (move sound) +1) ratchet metal +2) base plat + +Spawnflags +START_OFF start off +CRUSHER don't reverse when blocked +*/ +/*FGD +@baseclass base(Targetname, TrainSounds) = Bob +[ + spawnflags(flags) = [ + 1 : "Start off" : 0 + 2 : "Crusher (no reverse)" : 0 + ] + wait(string) : "period of bob" : "4" + distance(integer) : "length of bob" : 64 + delay(string) : "starting phase offset (0-1)" : "0.0" + dmg(integer) : "Damage on block" : 2 + noise(string) : "Override stop sound" + noise1(string) : "Override move sound" + pos1(string) : "Override apex 1" + pos2(string) : "Override apex 2" +] +@SolidClass base(Bob) = func_bobbing : "Bobbing platform" [] +*/ +void() func_bobbing = +{ + if (!SUB_ShouldSpawn()) return; + + self.solid = zeroconvertdefault(self.solid, SOLID_BSP); + self.movetype = MOVETYPE_PUSH; + + SetMovedir(); + if (!self.distance) + self.distance = 64; + if (self.wait <= 0) + self.wait = 4; + + self.dmg = zeroconvertdefault(self.dmg, 2); + + if (!self.pos1 && !self.pos2) + { + self.pos1 = self.origin + self.distance * 0.5 * self.movedir; + self.pos2 = self.origin - self.distance * 0.5 * self.movedir; + } + self.use = func_bobbing_use; + self.blocked = func_bobbing_blocked; + self.think = func_bobbing_think; + + self.length = min(0.1, self.wait / 6); + + self.state = self.spawnflags & 1; + if (!(self.state)) + self.nextthink = self.ltime + self.length; + + train_sounds(); + + precache_model (self.model); + setmodel (self, self.model); + setsize (self, self.mins, self.maxs); + setorigin (self, func_bobbing_pos(self.delay)); +} + +/*QUAKED func_bobbing_point (0 .5 .8) (-8 -8 -8) (8 8 8) START_OFF CRUSHER +bobbatron 2000. does not need a 'speed' key; specify "wait" for the period and the bobbalondo 9000 does the rest. +trigger to freeze in place or reactivate. + +"angle" set bobaxis +"distance" total distance of bob, will move half this far in either direction +"pos1"/"pos2" ignore angle/distance and set apex offsets directly +"wait" wavelength of bob in seconds +"delay" phase offset to start at (0 = pos1, 0.5 = pos2, 1.0 = back at pos1 again) +"sounds" +0) none, or, set your own with 'noise' (stop sound) and 'noise1' (move sound) +1) ratchet metal +2) base plat + +Spawnflags +START_OFF start off +CRUSHER don't reverse when blocked +*/ +/*FGD +@PointClass base(Bob) = func_bobbing_point : "Bobbing platform point" [ + model(string) : "Model to use" +] +*/ +void() func_bobbing_point = {func_bobbing();} + +// ======================================= + +void() teleball_think = +{ + self.think1(); + self.nextthink = time + 0.1; +} + +void() teleball_use = +{ + self.avelocity = 50 * Vector(crandom(), crandom(), crandom()); + if (self.think1 == fly_idle) + fly_newgoal( 1, 0 ); +} + +void() teleball_init2 = +{ + fly_newgoal( 1, 0 ); + self.think = teleball_think; + teleball_think(); +} + +void() teleball_init = +{ + //dprint("in teleball_init\n"); + if (self.spawnflags & 1) + { + setmodel (self, "progs/teleport.mdl"); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + } + + self.avelocity = 50 * Vector(crandom(), crandom(), crandom()); + self.goalentity = self; // haaax + self.use = teleball_use; + self.think = teleball_init2; + self.nextthink = time + 0.1; +} + +void() misc_teleball_curvy = +{ + //dprint("in misc_teleball\n"); + setorigin (self, self.origin); + if (!(self.spawnflags & 1)) + { + teleball_init(); + setmodel (self, "progs/teleport.mdl"); + } + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.movetype = MOVETYPE_NOCLIP; + + if (!self.speed) { + self.speed2 = 100; + self.speed = 100; + } + + self.use = teleball_init; + self.th_die = SUB_Remove; + self.th_stand = SUB_Null; +} + + +// special linear move function for the dumb teletrain so it doesn't have to be MOVETYPE_PUSH +void() teletrain_go = +{ + float l; + vector dir; + + if (self.spawnflags & 1) + { + setmodel (self, "progs/teleport.mdl"); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.spawnflags -= 1; + } + + self.enemy = find(world, targetname, self.target); + self.target = self.enemy.target; + + dir = (self.enemy.origin + self.pos1) - self.origin; + l = vlen(dir); + self.velocity = normalize(dir) * self.speed; + self.nextthink = time + (l / self.speed); + self.think = teletrain_go; +} + +void() teletrain_find = +{ + self.enemy = find(world, targetname, self.target); + self.target = self.enemy.target; + setorigin(self, self.enemy.origin + self.pos1); +} + +/*QUAKED misc_teleporttrain (0 .5 .8) (-16 -16 -16) (16 16 16) START_INVIS CURVY +This is used for the final boss + +Spawnflags +START_INVIS Invisible until triggered +CURVY behaves like a func_flytrain, following path_corners, waiting at them (a wait of -1 on a path_corner will stop the ball until triggered again), then disappearing at the last path_corner. Inherits movement speed from each path_corner's "speed" key. movement is smoothed out so it doesn't move in straight lines between waypoints - sharp turns near walls could make it clip out of the level and disappear for a moment, so place pathcorners carefully. +*/ +/*FGD +@PointClass base(Appearflags ) size(16 16 16) model({ "path": ":progs/teleport.mdl" }) = misc_teleporttrain : "Flying teleporter destination" +[ + target(string) : "First stop target" + targetname(target_source) : "Name" + spawnflags(flags) = + [ + 1 : "Start invisible" : 0 + 2 : "Curving path" : 0 + ] +] +*/ +void() misc_teleporttrain = +{ + if (!SUB_ShouldSpawn()) return; + + precache_model2 ("progs/teleport.mdl"); + if (self.spawnflags & 2) + { + misc_teleball_curvy(); + return; + } + + if (!self.speed) + self.speed = 100; + if (!self.target) + objerror("misc_teleporttrain without a target"); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_FLY; + self.use = teletrain_go; + + if (!(self.spawnflags & 1)) + setmodel (self, "progs/teleport.mdl"); + setsize (self, self.mins, self.maxs); + self.pos1 = 0.5 * (self.maxs - self.mins); + setorigin (self, self.origin); + + self.think = teletrain_find; + self.nextthink = time + 0.1; +} + diff --git a/QC_other/QC_copper/player.qc b/QC_other/QC_copper/player.qc new file mode 100644 index 00000000..24752a6e --- /dev/null +++ b/QC_other/QC_copper/player.qc @@ -0,0 +1,599 @@ +/* +============================================================================== + +PLAYER + +============================================================================== +*/ + +$cd id1/models/player_4 +$origin 0 -6 24 +$base base +$skin skin + +// running 0-11 +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 + +// standing 12-28 +$frame stand1 stand2 stand3 stand4 stand5 +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 + +// pain 13-40 +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +// death 41-102 +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 axdeth7 axdeth8 axdeth9 +$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 deatha9 deatha10 deatha11 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 deathb9 +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 +$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 deathd8 deathd9 +$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 deathe8 deathe9 + +// gun attacks 103-118 +$frame nailatt1 nailatt2 +$frame light1 light2 +$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 +$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 + +// ax attax 119-142 +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + + +/* +============================================================================== +PLAYER +============================================================================== +*/ + +void() player_stand1 =[ $axstnd1, player_stand1 ] +{ + W_SetIdleWeaponFrame(); + if (self.velocity_x || self.velocity_y) + { + self.walkframe=0; + player_run(); + return; + } + + if (self.weapon == IT_AXE ) + { + if (self.walkframe >= 12) + self.walkframe = 0; + self.frame = $axstnd1 + self.walkframe; + } + else + { + if (self.walkframe >= 5) + self.walkframe = 0; + self.frame = $stand1 + self.walkframe; + } + self.walkframe = self.walkframe + 1; +} + +void() player_run =[ $rockrun1, player_run ] +{ + W_SetIdleWeaponFrame(); + if (!self.velocity_x && !self.velocity_y) + { + self.walkframe=0; + player_stand1(); + return; + } + + if (self.weapon == IT_AXE ) + { + if (self.walkframe >= 6) + self.walkframe = 0; + self.frame = $axrun1 + self.walkframe; + } + else + { + if (self.walkframe >= 6) + self.walkframe = 0; + self.frame = self.frame + self.walkframe; + } + self.walkframe = self.walkframe + 1; +} + +void() player_shot1 = [$shotatt1, player_shot2 ] {self.weaponframe=1; +self.effects = self.effects | EF_MUZZLEFLASH;} +void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe=2;} +void() player_shot3 = [$shotatt3, player_shot4 ] {self.weaponframe=3;} +void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe=4;} +void() player_shot5 = [$shotatt5, player_shot6 ] {self.weaponframe=5;} +void() player_shot6 = [$shotatt6, player_run ] {self.weaponframe=6;} + + + +/* +======================================== +Player Axe Thinks + +this was done to decouple the player's in-world animations from the weaponframe cycle, +so that the weapon code can take over the think cycle directly and drive (normally +invisible) player animation as a secondary consideration, rather than vice versa +======================================== +*/ + + +// simplified little machine for cycling through an axe attack anim, then the +// axe run to artificially extend the anim up to 1.2 seconds +void() player_axecyc = +{ + self.frame += 1; + if (mod(max(0,self.frame - $axatt1), 6) == 0) // conveniently all the same length + { + self.frame = $axrun1; + } +} + + +void() player_axe1 = [$axatt1, player_axe2 ] {W_AxeWhiffSound();} +void() player_axe2 = [$axatt2, player_axe3 ] {self.weaponframe += 1;} +void() player_axe3 = [$axatt3, player_axe4 ] {self.weaponframe += 1; W_FireAxe();} +void() player_axe4 = [$axatt4, player_axe5 ] {self.weaponframe += 1;} +void() player_axe5 = [$axatt5, player_run ] {self.weaponframe += 1;} +void() player_axe6 = [$axatt6, player_run ] {self.weaponframe += 1;} + +void() player_axeb1 = [$axattb1, player_axeb2 ] {W_AxeWhiffSound();} +void() player_axeb2 = [$axattb2, player_axeb3 ] {self.weaponframe += 1;} +void() player_axeb3 = [$axattb3, player_axeb4 ] {self.weaponframe += 1; W_FireAxe();} +void() player_axeb4 = [$axattb4, player_axeb5 ] {self.weaponframe += 1;} +void() player_axeb5 = [$axattb5, player_run ] {self.weaponframe += 1;} +void() player_axeb6 = [$axattb6, player_run ] {self.weaponframe += 1;} + +void() player_axec1 = [$axattc1, player_axec2 ] {W_AxeWhiffSound();} +void() player_axec2 = [$axattc2, player_axec3 ] {self.weaponframe += 1;} +void() player_axec3 = [$axattc3, player_axec4 ] {self.weaponframe += 1; W_FireAxe();} +void() player_axec4 = [$axattc4, player_axec5 ] {self.weaponframe += 1;} +void() player_axec5 = [$axattc5, player_run ] {self.weaponframe += 1;} +void() player_axec6 = [$axattc6, player_run ] {self.weaponframe += 1;} + +void() player_axed1 = [$axattd1, player_axed2 ] {W_AxeWhiffSound();} +void() player_axed2 = [$axattd2, player_axed3 ] {self.weaponframe += 1;} +void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe += 1; W_FireAxe();} +void() player_axed4 = [$axattd4, player_axed5 ] {self.weaponframe += 1;} +void() player_axed5 = [$axattd5, player_run ] {self.weaponframe += 1;} +void() player_axed6 = [$axattd6, player_run ] {self.weaponframe += 1;} + +void() player_axee1 = [$axattc1, player_axee2] {} +void() player_axee2 = [$axattb1, player_axee3] {self.weaponframe += 1;} +void() player_axee3 = [$axattb2, player_axee4] { + self.weaponframe += 1; + W_AxeWhiffSound(); +} +void() player_axee4 = [$axattb3, player_axee5] {self.weaponframe += 1;} +void() player_axee5 = [$axattb4, player_axee6] {self.weaponframe += 1; W_FireAxe();} +void() player_axee6 = [$axattb5, player_axee7] {self.weaponframe += 1;} +void() player_axee7 = [$axattb6, player_run] {self.weaponframe += 1;} +void() player_axee8 = [$axattb6, player_run] {self.weaponframe += 1;} + +void() player_axe = +{ + float r; + r = random(); + if (r < 0.25) + self.frame = $axatt1; + //player_axe1(); + else if (r<0.5) + self.frame = $axattb1; + //player_axeb1(); + else if (r<0.75) + self.frame = $axattc1; + //player_axec1(); + else + self.frame = $axattd1; + //player_axed1(); + + self.think1 = player_axecyc; +} + +//============================================================================ + +void() player_nail = +{ + if (!self.button0) + { + player_run(); + return; + } + + self.effects |= EF_MUZZLEFLASH; + + if (self.frame != $nailatt1) self.frame = $nailatt1; + else self.frame += 1; + self.think = player_nail; + self.nextthink = time + 0.125; // TODO: oh fuck it, it works, you're never touching this again + + self.weaponframe = self.cnt + 1; +} + +//============================================================================ + +void() player_light1 =[$light1, player_light2 ] +{ + self.effects = self.effects | EF_MUZZLEFLASH; + + if (!self.button0) + {player_run ();return;} + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe == 5) + self.weaponframe = 1; + SuperDamageSound(); + W_FireLightning(0); + self.attack_finished = time + 0.2; +} +void() player_light2 =[$light2, player_light1 ] +{ + self.effects = self.effects | EF_MUZZLEFLASH; + + if (!self.button0) + {player_run ();return;} + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe == 5) + self.weaponframe = 1; + SuperDamageSound(); + W_FireLightning(0); + self.attack_finished = time + 0.2; +} + +//============================================================================ + + +void() player_rocket1 =[$rockatt1, player_rocket2 ] {self.weaponframe=1; +self.effects = self.effects | EF_MUZZLEFLASH;} +void() player_rocket2 =[$rockatt2, player_rocket3 ] {self.weaponframe=2;} +void() player_rocket3 =[$rockatt3, player_rocket4 ] {self.weaponframe=3;} +void() player_rocket4 =[$rockatt4, player_rocket5 ] {self.weaponframe=4;} +void() player_rocket5 =[$rockatt5, player_rocket6 ] {self.weaponframe=5;} +void() player_rocket6 =[$rockatt6, player_run ] {self.weaponframe=6;} + + +void() PainSound = { + float rs; + + if (self.health < 0) + return; + + if (damage_attacker.classname == "teledeath") + { + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + return; + } + + // water pain sounds + if (self.watertype == CONTENT_WATER && self.waterlevel >= 3 && (self.items & IT_SUIT == 0)) + { + DeathBubbles(1); + if (random() > 0.5) + sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM); + return; + } + + // slime/lava pain sounds + if (( (self.watertype == CONTENT_SLIME || self.watertype == CONTENT_LAVA) && damage_attacker == world) || + damage_attacker.classname == "fireball") + { + if (random() > 0.5) + sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + return; + } + + // don't make multiple pain sounds right after each other + if (self.pain_finished > time) + { + self.customflags = not(self.customflags, CFL_AXEHITME ); + return; + } + self.pain_finished = time + 0.5; + + +// ax pain sound + if (self.customflags & CFL_AXEHITME) + { + self.customflags = not(self.customflags, CFL_AXEHITME ); + sound (self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM); + return; + } + + + rs = rint((random() * 5) + 1); + + self.noise = string_null; + if (rs == 1) + self.noise = "player/pain1.wav"; + else if (rs == 2) + self.noise = "player/pain2.wav"; + else if (rs == 3) + self.noise = "player/pain3.wav"; + else if (rs == 4) + self.noise = "player/pain4.wav"; + else if (rs == 5) + self.noise = "player/pain5.wav"; + else + self.noise = "player/pain6.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + return; +} + +void() player_pain1 = [ $pain1, player_pain2 ] {PainSound();self.weaponframe=0;} +void() player_pain2 = [ $pain2, player_pain3 ] {} +void() player_pain3 = [ $pain3, player_pain4 ] {} +void() player_pain4 = [ $pain4, player_pain5 ] {} +void() player_pain5 = [ $pain5, player_pain6 ] {} +void() player_pain6 = [ $pain6, player_run ] {} + +void() player_axpain1 = [ $axpain1, player_axpain2 ] {PainSound();self.weaponframe=0;} +void() player_axpain2 = [ $axpain2, player_axpain3 ] {} +void() player_axpain3 = [ $axpain3, player_axpain4 ] {} +void() player_axpain4 = [ $axpain4, player_axpain5 ] {} +void() player_axpain5 = [ $axpain5, player_axpain6 ] {} +void() player_axpain6 = [ $axpain6, player_run ] {} + +void(entity attacker, float damage) player_pain = +{ + if (self.weaponframe) + return; + + if (self.invisible_finished > time) + return; // eyes don't have pain frames + + if (self.weapon == IT_AXE ) + player_axpain1 (); + else + player_pain1 (); +} + +void() DeathBubblesSpawn = +{ + entity bubble; + if (self.owner.waterlevel < 3) + return; + bubble = bubble_spawn(self.owner.origin + '0 0 24'); + + self.nextthink = time + 0.1; + self.think = DeathBubblesSpawn; + self.air_finished += 1; + if (self.air_finished >= self.bubble_count) + remove(self); +} + +void(float num_bubbles) DeathBubbles = +{ +local entity bubble_spawner; + + bubble_spawner = spawn(); + setorigin (bubble_spawner, self.origin); + bubble_spawner.movetype = MOVETYPE_NONE; + bubble_spawner.solid = SOLID_NOT; + bubble_spawner.nextthink = time + 0.1; + bubble_spawner.think = DeathBubblesSpawn; + bubble_spawner.air_finished = 0; + bubble_spawner.owner = self; + bubble_spawner.bubble_count = num_bubbles; + return; +} + + +void() DeathSound = +{ +local float rs; + + // water death sounds + if (self.waterlevel >= 3 && (self.items & IT_SUIT == 0)) + { + if (self.watertype == CONTENT_WATER || self.watertype == CONTENT_SLIME) + { + DeathBubbles(20); + sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE); + return; + } + } + + rs = rint ((random() * 4) + 1); + if (rs == 1) + self.noise = "player/death1.wav"; + if (rs == 2) + self.noise = "player/death2.wav"; + if (rs == 3) + self.noise = "player/death3.wav"; + if (rs == 4) + self.noise = "player/death4.wav"; + if (rs == 5) + self.noise = "player/death5.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE); + return; +} + + +void() PlayerDead = +{ + self.nextthink = -1; +// allow respawn after a certain time + self.deadflag = DEAD_DEAD; +} + +void() GibPlayer = +{ + + self.deadflag = DEAD_DEAD; + + if (damage_attacker.classname == "trigger_void" || damage_attacker.classname == "func_void" ) + { + sound (self, CHAN_VOICE, "player/splat1.wav", 1, ATTN_NONE); + stuffcmd( self, "\nv_cshift 16 0 0 255\n"); + return; + } + + if (damage_attacker.classname == "teledeath") + { + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + return; + } + + if (damage_attacker.classname == "teledeath2") + { + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + return; + } + + if (random() < 0.5) + sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE); + else + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE); + + GibSpray ("progs/h_player.mdl", self.health); +} + +void() PlayerDie = +{ + local float i; + + self.items = self.items - (self.items & IT_INVISIBILITY); + self.invisible_finished = 0; // don't die as eyes + self.invincible_finished = 0; + self.super_damage_finished = 0; + self.radsuit_finished = 0; + self.modelindex = modelindex_player; // don't use eyes + + self.items = not(self.items, IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD); + self.effects = 0; + + ClientObituary(); // moved from Killed() so it doesn't get called when non-players die + + if (deathmatch || coop) + DropBackpack(); + + self.weaponmodel = string_null; + self.view_ofs = '0 0 0'; +// self.deadflag = DEAD_DYING; // moved to Killed() so I can use this flag on monsters + self.solid = SOLID_NOT; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.movetype = MOVETYPE_TOSS; + setsize(self, '-16 -16 -16', '16 16 8'); + if (self.velocity_z < 10) + self.velocity_z = self.velocity_z + random()*300; + + if (self.health < -40) + { + GibPlayer (); + return; + } + + DeathSound(); + + self.angles_x = 0; + self.angles_z = 0; + + if (self.weapon == IT_AXE ) + { + player_die_ax1 (); + return; + } + + i = 1 + floor(random()*6); + + if (i == 1) + player_diea1(); + else if (i == 2) + player_dieb1(); + else if (i == 3) + player_diec1(); + else if (i == 4) + player_died1(); + else + player_diee1(); + +} + +void() set_suicide_frame = +{ // used by kill command and disconnect command + if (self.model != "progs/player.mdl") + return; // already gibbed + self.frame = $deatha11; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_TOSS; + self.deadflag = DEAD_DEAD; + self.nextthink = -1; +} + + +void() player_diea1 = [ $deatha1, player_diea2 ] {} +void() player_diea2 = [ $deatha2, player_diea3 ] {} +void() player_diea3 = [ $deatha3, player_diea4 ] {} +void() player_diea4 = [ $deatha4, player_diea5 ] {} +void() player_diea5 = [ $deatha5, player_diea6 ] {} +void() player_diea6 = [ $deatha6, player_diea7 ] {} +void() player_diea7 = [ $deatha7, player_diea8 ] {} +void() player_diea8 = [ $deatha8, player_diea9 ] {} +void() player_diea9 = [ $deatha9, player_diea10 ] {} +void() player_diea10 = [ $deatha10, player_diea11 ] {} +void() player_diea11 = [ $deatha11, player_diea11 ] {PlayerDead();} + +void() player_dieb1 = [ $deathb1, player_dieb2 ] {} +void() player_dieb2 = [ $deathb2, player_dieb3 ] {} +void() player_dieb3 = [ $deathb3, player_dieb4 ] {} +void() player_dieb4 = [ $deathb4, player_dieb5 ] {} +void() player_dieb5 = [ $deathb5, player_dieb6 ] {} +void() player_dieb6 = [ $deathb6, player_dieb7 ] {} +void() player_dieb7 = [ $deathb7, player_dieb8 ] {} +void() player_dieb8 = [ $deathb8, player_dieb9 ] {} +void() player_dieb9 = [ $deathb9, player_dieb9 ] {PlayerDead();} + +void() player_diec1 = [ $deathc1, player_diec2 ] {} +void() player_diec2 = [ $deathc2, player_diec3 ] {} +void() player_diec3 = [ $deathc3, player_diec4 ] {} +void() player_diec4 = [ $deathc4, player_diec5 ] {} +void() player_diec5 = [ $deathc5, player_diec6 ] {} +void() player_diec6 = [ $deathc6, player_diec7 ] {} +void() player_diec7 = [ $deathc7, player_diec8 ] {} +void() player_diec8 = [ $deathc8, player_diec9 ] {} +void() player_diec9 = [ $deathc9, player_diec10 ] {} +void() player_diec10 = [ $deathc10, player_diec11 ] {} +void() player_diec11 = [ $deathc11, player_diec12 ] {} +void() player_diec12 = [ $deathc12, player_diec13 ] {} +void() player_diec13 = [ $deathc13, player_diec14 ] {} +void() player_diec14 = [ $deathc14, player_diec15 ] {} +void() player_diec15 = [ $deathc15, player_diec15 ] {PlayerDead();} + +void() player_died1 = [ $deathd1, player_died2 ] {} +void() player_died2 = [ $deathd2, player_died3 ] {} +void() player_died3 = [ $deathd3, player_died4 ] {} +void() player_died4 = [ $deathd4, player_died5 ] {} +void() player_died5 = [ $deathd5, player_died6 ] {} +void() player_died6 = [ $deathd6, player_died7 ] {} +void() player_died7 = [ $deathd7, player_died8 ] {} +void() player_died8 = [ $deathd8, player_died9 ] {} +void() player_died9 = [ $deathd9, player_died9 ] {PlayerDead();} + +void() player_diee1 = [ $deathe1, player_diee2 ] {} +void() player_diee2 = [ $deathe2, player_diee3 ] {} +void() player_diee3 = [ $deathe3, player_diee4 ] {} +void() player_diee4 = [ $deathe4, player_diee5 ] {} +void() player_diee5 = [ $deathe5, player_diee6 ] {} +void() player_diee6 = [ $deathe6, player_diee7 ] {} +void() player_diee7 = [ $deathe7, player_diee8 ] {} +void() player_diee8 = [ $deathe8, player_diee9 ] {} +void() player_diee9 = [ $deathe9, player_diee9 ] {PlayerDead();} + +void() player_die_ax1 = [ $axdeth1, player_die_ax2 ] {} +void() player_die_ax2 = [ $axdeth2, player_die_ax3 ] {} +void() player_die_ax3 = [ $axdeth3, player_die_ax4 ] {} +void() player_die_ax4 = [ $axdeth4, player_die_ax5 ] {} +void() player_die_ax5 = [ $axdeth5, player_die_ax6 ] {} +void() player_die_ax6 = [ $axdeth6, player_die_ax7 ] {} +void() player_die_ax7 = [ $axdeth7, player_die_ax8 ] {} +void() player_die_ax8 = [ $axdeth8, player_die_ax9 ] {} +void() player_die_ax9 = [ $axdeth9, player_die_ax9 ] {PlayerDead();} diff --git a/QC_other/QC_copper/progs.src b/QC_other/QC_copper/progs.src new file mode 100644 index 00000000..7822a58e --- /dev/null +++ b/QC_other/QC_copper/progs.src @@ -0,0 +1,73 @@ +../progs.dat +#pragma autoproto + +defs.qc +constants.qc + +maths.qc +utility.qc +subs.qc +subs_move.qc +subs_tgt.qc +ai.qc +meat.qc // gibs and gore +combat.qc // fight.qc decrufted away +fly.qc // smoothed pathcorner movement + +items.qc +item_health_armor.qc +item_weap_ammo.qc +item_powerups.qc +item_keys_runes.qc +item_backpack.qc + +projectiles.qc +weapons.qc +w_axe.qc +w_lightning.qc +w_shotguns.qc +w_rockets.qc +w_nails.qc +dev.qc +impulse.qc + +world.qc +client.qc +player.qc +monsters.qc +doors.qc +buttons.qc +triggers.qc +t_tele.qc +t_level.qc +t_ctrl.qc +plats.qc +lights.qc +explobox.qc +misc.qc +walls.qc +sound.qc + +fog.qc // atmosfear +t_void.qc // bottomless pits +fx.qc // more dots + +// prefixed all these so I can more easily open all the monster files at once +m_ogre.qc +m_demon.qc +m_shambler.qc +m_knight.qc +m_soldier.qc +m_wizard.qc +m_dog.qc +m_zombie.qc +m_boss.qc + +m_tarbaby.qc // registered +m_hknight.qc // registered +m_fish.qc // registered +m_shalrath.qc // registered +m_enforcer.qc // registered +m_oldone.qc // registered + +test.qc \ No newline at end of file diff --git a/QC_other/QC_copper/projectiles.qc b/QC_other/QC_copper/projectiles.qc new file mode 100644 index 00000000..b9da5b8b --- /dev/null +++ b/QC_other/QC_copper/projectiles.qc @@ -0,0 +1,516 @@ +/* +================================================================ + + PROJECTILES + +================================================================ +*/ + + +/* +============ +traceline2 + +a more robust wrapper for traceline() that can ignore a wider array of entities. +performs one or more staggered traceline()s until the trace_ent isn't something we +actually want to ignore, so what would be one trace can turn into several. +============ +*/ +void(vector start, vector end, entity ignore, float traceflags) traceline2 = +{ + entity ig = ignore; + //entity lastent = world; + vector src = start; + vector lastend = start; + float traces = 0; + float nomonsters = 0; + + if (traceflags & TRACE_NOMONSTERS) nomonsters = TRUE; + + float t_allsolid = 2; + float t_startsolid = -1; + float t_inopen = -1; + float t_inwater = -1; + + if (trace_debug) dprint5("tracing from ", vtos(src), " to ", vtos(end), "\n"); + + // check for trace-through cases and repeat + do { + if (trace_debug) dprint5(" trace: ", vtos(src), " to ", vtos(end), "\n"); + traceline (src, end, nomonsters, ig); + + // preserve the accuracy of the trace result flags + if (t_startsolid == -1) t_startsolid = trace_startsolid; + if (!trace_startsolid) + { + t_allsolid = min(t_allsolid, trace_allsolid); + t_inopen = max(t_inopen, trace_inopen); + t_inwater = max(t_inwater, trace_inwater); + + if ( trace_ent.deadflag == DEAD_DYING || // don't let guys in death frames who aren't nonsolid yet act like solid walls to bullets + trace_ent == ignore || // always ignore the original ignore ent on future loops + trace_ent.movetype == MOVETYPE_NOCLIP || // don't shoot noclipping players + trace_ent.notrace) // flag to make things game-functionally nonsolid (monsterclip/etc) + { + // if two entities that are both to be ignored are touching, the trace will + // fail with a distance of zero once 'ig' changes, so nudge forward one unit + // to make sure the point of origin isn't touching the old ig + lastend = trace_endpos; + src = trace_endpos + normalize(end - start); + ig = trace_ent; + if (trace_debug) dprint3(" hit ", trace_ent.classname, ", trying again\n"); + } + else ig = world; + } + else + { + // if the nudge forward put the trace start in a solid, the last trace should + // have been the end. this can happen when a notrace surface and a legit solid + // surface are coincident in the path of the trace2, and the notrace one is the + // one quake 'sees' first. + if (trace_debug) dprint(" trace started solid!\n"); + trace_endpos = lastend; + ig = world; + } + traces++; + } while (ig != world); // true if we hit a wall or hit nothing + + if (trace_debug) dprint3("trace complete after ", ftos(traces), " traces \n"); + + // unify global trace results so the calling function can pretend it only made one trace + float lastfrac = vlen(start - trace_endpos) / vlen(start - end); + entity lastent = trace_ent; + if (traceflags & (TRACE_NOMONSTERS|TRACE_WATER) == TRACE_WATER) + { + // thanks to a structural oddity in SV_ClipToLinks (world.c), a traceline() without nomonsters + // doesn't properly populate the open/inwater trace flags, so we have to do another nomonsters + // traceline2 over the path of the last one to catch the case of crossing water contents. + + // we can't just check pointcontents at start and end because it doesn't catch when mappers do + // wacky things with water volumes (ie the E4 entry in the original start.bsp), and it can't be + // a singular traceline() because a monster might be looking through a notrace bmodel into water. + //dprint(" tracing again with nomonsters to get trace flags right\n"); + traceline2(start, trace_endpos, ignore, TRACE_NOMONSTERS); + } + else + { + trace_startsolid = t_startsolid; + trace_allsolid = t_allsolid; + trace_inopen = t_inopen; + trace_inwater = t_inwater; + } + trace_fraction = lastfrac; + trace_ent = lastent; + + if (trace_debug) { + if (trace_ent) + dprint3(" entity: ", trace_ent.classname, "\n"); + dprint3(" end: ", vtos(trace_endpos), "\n"); + dprint3(" fraction: ", ftos(trace_fraction*100), "%\n"); + dprint3(" startsolid: ", ftos(trace_startsolid), "\n"); + dprint3(" allsolid: ", ftos(trace_allsolid), "\n"); + dprint3(" inopen: ", ftos(trace_inopen), "\n"); + dprint("----------\n"); + // dprint3(" inwater: ", ftos(trace_inwater), "\n----------\n"); + } +} + +/* +================================================================ + +PENETRATION AND PASSTHRU + +we "patch" the limited options for solid/nonsolid interaction in the quake physics by +overriding the results of said physics in the progs .touch() functions that are called +immediately after. + +to emulate objects being nonsolid to each other when quake didn't want them to be, +we respond to their collisions by setting one as the .owner of the other, which causes +quake to ignore their collisions on subsequent frames, then restoring the physics to +roughly the state they'd be in if SV_Move had not altered their velocities in response to +that collision. in the case of linear projectiles, this means restoring their starting +velocity, but for TOSS/BOUNCE projectiles it means tracking their always-changing +velocities constantly with a frequent .think(). thus all grenades, as well as gibs, +think at 20hz until they come to rest. not ideal, but not seriously so. + +this is further complicated by not being able to alter .velocity from the touch function +itself, because at that point quake is in the physics half of the game frame when such +monkeying is not allowed. thus, we have to make our corrections immediately thereafter +in a .think(), while preserving the previous .think() and .nextthink so as not to break +the projectile's normal behavior (voreball homing, particles, etc). + +on all projectiles, .touch must be some function that calls CheckProjectilePassthru() and +halts if it returns TRUE (representing "not an actual collision"). the check handles all +consequences behind the scenes. + +on ballistic projectiles, .think and .nextthink are overridden, so they cannot be used +for projectile timeout. set .lifetime_finished to the time when projectile should expire, +and .th_die to the function to call when it does. + +================================================================ +*/ + + +/* +============ +projectile_passthru_think + +think function to make a projectile ignore what it just hit +the new owner has been set by this point +============ +*/ +void() projectile_passthru_think = +{ + self.flags = not(self.flags, FL_ONGROUND); + self.velocity = self.oldvelocity; + self.think = self.think1; + self.nextthink = self.pain_finished; + + // nudge the projectile forward a tiny bit to be inside its new owner + setorigin(self, self.origin + normalize(self.velocity) * 0.1); + // if the old owner and the new owner are touching at the point that the + // projectile crosses over, next frame it'll be coincident with both old + // and new, the trace in sv_move will wind up being allsolid, and the + // projectile will travel through worldspawn. +} + +/* +============ +projectile_toss_think + +when a passthru overrides server physics for a TOSS projectile, we must +restore a recent enough velocity that the projectile appeared not to touch. +grenades change velocity every frame, so they have to save it near-continuously +============ +*/ +void() projectile_toss_think = +{ + if (time > self.lifetime_finished) + { + self.th_die(); + return; + } + if (self.velocity == VEC_ORIGIN) // stopped on the ground + { + self.think = self.th_die; + self.nextthink = self.lifetime_finished; + // bprint3("at rest, exploding in ", ftos(self.nextthink), " seconds\n"); + self.th_die = SUB_Null; + self.lifetime_finished = 0; + self.solid = SOLID_NOT; + return; + } + + self.flags = not(self.flags, FL_ONGROUND); + self.oldvelocity = self.velocity; + self.nextthink = time + 0.05; // 10hz is probably enough, but 20hz is surely twice as good +} + +/* +============ +projectile_valid_passthru + +returns TRUE in cases where we pass through and should not collide +============ +*/ +float() projectile_valid_passthru = +{ + // SOLID_NOT entities touch SOLID_BSP by default without generating touch events. + // gibs had to be made SOLID_BBOX in order to make selectively passing through + // notrace/monsterclip even possible, so they need special handling by our owner- + // changing hackery to ensure they stay nonsolid in the other cases too + if (self.type == "gib") + { + if (other.movetype == MOVETYPE_PUSH || other.solid == SOLID_BSP) + return other.notrace; + return TRUE; + } + + if (other.deadflag == DEAD_DYING || // corpses not yet on the ground + other.notrace || // specially marked (monsterclip) + other.movetype == MOVETYPE_NOCLIP || // ignore noclipping players + other == self.trueowner ) // still track the original owner - there are cases when monsters + // or players firing fat FLYMISSILE projectiles into an adjacent + // monsterclip can be hit by them when the owner switches + return TRUE; + + return FALSE; +} + +/* +============ +projectile_passthru + +we can't alter physics stuff to make the projectile physically penetrate during +touch/physics, so set an immediate think to 'repair' the state of the projectile +============ +*/ +void() projectile_passthru = +{ + self.owner = other; + + // our nextthink was probably to explode or remove, so save that + self.think1 = self.think; + self.pain_finished = self.nextthink; + + self.think = projectile_passthru_think; + self.nextthink = time; +} + +/* +============ +CheckProjectilePassthru + +called within every projectile touch function, returns TRUE if pierced an otherwise solid entity +============ +*/ +float() CheckProjectilePassthru = +{ + if (!other) return FALSE; // always collide with world + if (other == self.owner) return FALSE; // this actually shouldn't have been called, but: don't touch owner + + if (other.classname == "func_void") + { + // go away at the bottoms of pits + SUB_RemoveSoon(); + return TRUE; + } + + // handle overriding the quake physics with our own desired result + if (projectile_valid_passthru()) + { + projectile_passthru(); + return TRUE; + } + + return FALSE; +} + +void() projectile_touch_null = { CheckProjectilePassthru(); } + + + + +/* +================================================================ + + FIRE ZE MISSILES + +if you're looking for 'newmis' and 'launch_spike' this is where they went + +================================================================ +*/ + +/* +======== +launch_projectile + +base linear projectile, does not set model, touch, or damage +speed expected to derive from the length of 'dir' +======== +*/ +entity(vector org, vector dir) launch_projectile = +{ + entity prj; + + prj = spawn(); + prj.owner = prj.trueowner = self; + prj.movetype = MOVETYPE_FLYMISSILE; + prj.solid = SOLID_BBOX; + + prj.angles = vectoangles(dir); + + prj.classname = "spike"; + prj.touch = projectile_touch_null; + prj.th_die = SUB_Remove; + prj.think = SUB_Remove; + prj.nextthink = time + 6; + + setsize (prj, VEC_ORIGIN, VEC_ORIGIN); + setorigin (prj, org); + + prj.velocity = prj.oldvelocity = dir; + + return prj; +} + +/* +======== +toss_projectile + +base ballistic projectile, does not set model, touch, or damage +speed expected to derive from the length of 'dir' +======== +*/ +entity(vector org, vector dir) toss_projectile = +{ + entity g; + g = launch_projectile(org, dir); + g.movetype = MOVETYPE_BOUNCE; + g.classname = "grenade"; + + g.think = projectile_toss_think; + g.nextthink = time; + g.touch = projectile_touch_null; + g.th_die = SUB_Remove; + g.lifetime_finished = time + 6; + + return g; +} + + +//================================================================ + + +/* +======== +launch_nail + +basic hurty projectile, used by trap_spikeshooter and player nailguns +inherited from by lots of other hurty projectiles +======== +*/ +entity(vector org, vector dir, float superness) launch_nail = +{ + entity spike; + + spike = launch_projectile(org, dir); + spike.touch = spike_touch; + + SUB_ChangeModel (spike, "progs/spike.mdl"); + + if(superness) + { + spike.classname = "superspike"; + spike.dmg = 18; + spike.skin = 1; + } + else + { + spike.dmg = 9; + spike.skin = 0; + } + + return spike; +} + +/* +======== +launch_knightspike +hellknight spreadfire +======== +*/ +entity(vector org, vector vel) launch_knightspike = +{ + entity spike; + + spike = launch_projectile(org, vel); // FLYMISSILE + spike.touch = spike_touch; + spike.classname = "knightspike"; + SUB_ChangeModel (spike, "progs/k_spike.mdl"); + + spike.dmg = 8; + + return spike; +} + + +/* +======== +launch_wizspike +scrag spit, used by scrags and nouronihar +======== +*/ +entity(vector org, vector vel) launch_wizspike = +{ + entity spike; + + spike = launch_projectile(org, vel); // FLYMISSILE + spike.touch = spike_touch; + spike.dmg = 9; + spike.classname = "wizspike"; + SUB_ChangeModel (spike, "progs/w_spike.mdl"); + + return spike; +} + +/* +======== +launch_laser +used by trapshooter and enforcers +======== +*/ +entity(vector org, vector vel) launch_laser = +{ + entity spike; + + spike = launch_projectile(org, vel); + spike.touch = spike_touch; + spike.effects = EF_DIMLIGHT; + spike.movetype = MOVETYPE_FLY; // enforcer lasers aren't FLYMISSILE in id106 + + SUB_ChangeModel (spike, "progs/laser.mdl"); + + spike.dmg = 12; + spike.classname = "laser"; + + return spike; +} + + +/* +======== +launch_rocket +basic missile, used by player and ogre rocket fire +======== +*/ +entity(vector org, vector vel) launch_rocket = +{ + entity missile; + + missile = launch_projectile(org, vel); // FLYMISSILE + missile.classname = "missile"; + missile.dmg = 100; + missile.touch = T_MissileTouch; + + SUB_ChangeModel (missile, "progs/missile.mdl"); + + return missile; +} + +/* +======== +launch_lavamissile +exploding cthon lavaball +======== +*/ +entity(vector org, vector vel) launch_lavamissile = +{ + entity missile; + + missile = launch_rocket(org, vel); // FLYMISSILE + missile.avelocity = '200 200 200'; + SUB_ChangeModel (missile, "progs/lavaball.mdl"); + + return missile; +} + +/* +======== +launch_grenade +basic grenade, used by player and ogre +======== +*/ +entity(vector org, vector vel) launch_grenade = +{ + entity grenade; + + grenade = toss_projectile(org, vel); + grenade.lifetime_finished = time + 2.5; + grenade.avelocity = '300 300 300'; + SUB_ChangeModel (grenade, "progs/grenade.mdl"); + + return grenade; +} + + diff --git a/QC_other/QC_copper/sound.qc b/QC_other/QC_copper/sound.qc new file mode 100644 index 00000000..87344022 --- /dev/null +++ b/QC_other/QC_copper/sound.qc @@ -0,0 +1,307 @@ + +//============================================================================ + +/*FGD +@baseclass base(AppearFlags) = Ambient [ + distance(choices) : "Attenuation" : 0 = [ + 0 : "Ambient" + 1 : "Monster Idle" + 2 : "Monster Bark" + 3 : "Global" + ] +] +*/ +void(float vol) sound_setup = +{ + if (!self.volume) + self.volume = vol; + if (!self.distance) + self.distance = ATTN_STATIC; + else if (self.distance == 1) self.distance = ATTN_IDLE; + else if (self.distance == 2) self.distance = ATTN_NORM; + else if (self.distance == 3) self.distance = ATTN_NONE; + precache_sound2(self.noise); +} + +void(float vol) ambient_setup = +{ + sound_setup(vol); + ambientsound (self.origin, self.noise, self.volume, self.distance); +} + +/*QUAKED ambient_sound (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +specify any ambient sound you want. any at all! + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) + +"noise" wav to play - don't leave off the ".wav"! +ambience/ + buzz1.wav clicking sparks (ambient_flouro_buzz) + comp1.wav bloops and bleeps (ambient_comp_hum) + drip1.wav those drips (ambient_drip) + drone6.wav deep slipgate throb (ambient_drone) + fire1.wav torch crackle (ambient_) + fl_hum1.wav flourescent light buzz (ambient_light_buzz) + hum1.wav wispy teleporter wind (trigger_teleport sound) + suck1.wav deep hollow wind (ambient_suck_wind) + swamp1.wav frogs and crickets (ambient_swamp1 or 2) + water1.wav eerie swooshing water (waterbrush sound) + wind2.wav higher pitched hollow wind (skybrush sound) + windfly.wav the wind tunnel air sound +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_sound : "Custom ambient sound" +[ + noise(string) : "path to .wav" + volume(string) : "Volume" : "1" +] +*/ +void() ambient_sound = +{ + if (!SUB_ShouldSpawn()) return; + if (self.noise == string_null) + return; + + ambient_setup(1); +} + +//============================================================================ + + +/*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +good old suck wind + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_suck_wind : "Wind sound" [ + volume(string) : "Volume" : "1" +] +*/ +void() ambient_suck_wind = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/suck1.wav"; + ambient_setup(1); +} + +/*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +more of a throb, really + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_drone : "Engine/machinery sound" [ + volume(string) : "Volume" : "0.55" +] +*/ +void() ambient_drone = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/drone6.wav"; + ambient_setup(0.55); +} + +/*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +zaps and sparks + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_flouro_buzz : "Fluorescent buzzing sound" [ + volume(string) : "Volume" : "1" +] +*/ +void() ambient_flouro_buzz = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/buzz1.wav"; + ambient_setup(1); +} +/*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +drip drip + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_drip : "Dripping sound" [ + volume(string) : "Volume" : "0.75" +] +*/ +void() ambient_drip = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/drip1.wav"; + ambient_setup(0.75); +} +/*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +bleeps and bloops + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_comp_hum : "Computer background sounds" [ + volume(string) : "Volume" : "1" +] +*/ +void() ambient_comp_hum = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/comp1.wav"; + ambient_setup(1); +} +/*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +what + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_thunder : "Thunder sound" [ + volume(string) : "Volume" : "0.5" +] +*/ +void() ambient_thunder = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/thunder1.wav"; + ambient_setup(0.5); +} +/*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +gentle lamp hum + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_light_buzz : "Buzzing sound from light" [ + volume(string) : "Volume" : "0.85" +] +*/ +void() ambient_light_buzz = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/fl_hum1.wav"; + ambient_setup(0.85); +} +/*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +swamp + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_swamp1 : "Frogs croaking" [ + volume(string) : "Volume" : "0.75" +] +*/ +void() ambient_swamp1 = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/swamp1.wav"; + ambient_setup(0.75); +} +/*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) +same as swamp1 + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = ambient_swamp2 : "Frogs croaking B" [ + volume(string) : "Volume" : "0.5" +] +*/ +void() ambient_swamp2 = +{ + if (!SUB_ShouldSpawn()) return; + self.noise = "ambience/swamp2.wav"; + ambient_setup(0.5); +} + +//============================================================================ + +void() target_sound_use = +{ + sound(self, CHAN_AUTO, self.noise, self.volume, self.distance); +} + +/*QUAKED target_sound (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) +play a sound when triggered. + +"distance" attenuation (integer) - defaults to 0, which is the same as other ambient sounds. + 1 = 'idle' - monster idle sound range + 2 = 'normal' - monster bark sound range + 3 = 'none' - loops everywhere forever (don't use this) +"volume" volume, defaults to 1.0 (full volume) +"noise" wav to play - don't leave off the ".wav"! +*/ +/*FGD +@PointClass base(Ambient) color(150 0 150) = target_sound : "Custom triggered sound" +[ + noise(string) : "path to .wav" + volume(string) : "Volume" : "1" +] +*/ +void() target_sound = +{ + sound_setup(1); + self.use = target_sound_use; +} + +//============================================================================ + +void() noise_think = +{ + self.nextthink = time + 0.5; + sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM); + sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM); + sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM); + sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM); + sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM); + sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM); + sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM); +} + +void() misc_noisemaker = +{ + precache_sound2 ("enforcer/enfire.wav"); + precache_sound2 ("enforcer/enfstop.wav"); + precache_sound2 ("enforcer/sight1.wav"); + precache_sound2 ("enforcer/sight2.wav"); + precache_sound2 ("enforcer/sight3.wav"); + precache_sound2 ("enforcer/sight4.wav"); + precache_sound2 ("enforcer/pain1.wav"); + precache_sound2 ("enforcer/pain2.wav"); + precache_sound2 ("enforcer/death1.wav"); + precache_sound2 ("enforcer/idle1.wav"); + + self.nextthink = time + 0.1 + random(); + self.think = noise_think; +} diff --git a/QC_other/QC_copper/subs.qc b/QC_other/QC_copper/subs.qc new file mode 100644 index 00000000..10273071 --- /dev/null +++ b/QC_other/QC_copper/subs.qc @@ -0,0 +1,124 @@ +/* +================================================================ + + MISC SUBSTITUTION FUNCTIONS + +================================================================ +*/ + +void() SUB_Null = {} + +/* +============= +SUB_Remove/SUB_RemoveSoon + +RemoveSoon is to be used during touch functions to avoid touchlinks errors +=============== +*/ +void() SUB_Remove = { remove(self); } +void() SUB_RemoveSoon = +{ + // ensure no shenanigans take place in the next hundredth of a second + // otherwise we get weirdness like items being picked up twice at high framerates + self.model = string_null; + self.solid = SOLID_NOT; + self.touch = SUB_Null; + self.use = SUB_Null; + + self.think = SUB_Remove; + self.nextthink = time; +} + +/* +============= +RemoveTarget + +take an entity out of gameplay (independent of 'killing' it) +=============== +*/ +void(entity victim) RemoveTarget = +{ + + // iw -- don't change kill count when removing a dead monster + if (victim.flags & FL_MONSTER && victim.deadflag == DEAD_NO && !(victim.customflags & CFL_SPAWNER)) + addmonster(-1); // since the player won't get credit for the kill + + // clean up door triggers so they don't get lonely and crash + if (victim.trigger_field != world) + remove(victim.trigger_field); + + + remove (victim); +} + +/* +============= +SUB_CallAsSelf + +wrap the self/oself shuffle for code cleanliness elsewhere +=============== +*/ +void(void() fun, entity newself) SUB_CallAsSelf = +{ + local entity oself; + + oself = self; + self = newself; + fun(); + self = oself; +} + +/* +============= +SUB_ChangeModel + +size changes after a model change, use this to preserve it +=============== +*/ +void(entity ent, string mdl) SUB_ChangeModel = +{ + local vector sz,smin,smax; + sz = ent.size; + smin = ent.mins; + smax = ent.maxs; + + setmodel(ent, mdl); + + if (sz == VEC_ORIGIN) + setsize(ent, VEC_ORIGIN, VEC_ORIGIN); + else + setsize(ent, smin, smax); +} + +/* +void(float frame, void() th, float thtime) SUB_FrameThinkTime +{ + self.frame = frame; + self.think = th; + self.nextthink = time + thtime; +} +*/ + + +/* +=============== +SUB_ShouldSpawn + +check coop spawn flags, because we invented them and the exe +only checks skill/dm flags +=============== +*/ +float() SUB_ShouldSpawn = +{ + if (self.spawnflags & SPAWN_COOPONLY && self.spawnflags & SPAWN_NOTCOOP) + objerror("cooponly and notincoop flags both set on the same entity"); + if ( ((self.spawnflags & SPAWN_NOTCOOP) && coop) || ((self.spawnflags & SPAWN_COOPONLY) && !(coop)) ) + { + remove(self); + return FALSE; + } + return TRUE; +} + + + diff --git a/QC_other/QC_copper/subs_move.qc b/QC_other/QC_copper/subs_move.qc new file mode 100644 index 00000000..c80c60a2 --- /dev/null +++ b/QC_other/QC_copper/subs_move.qc @@ -0,0 +1,197 @@ +/* +================================================================ + + MOVEMENT SUBS + +================================================================ +*/ + +/* +============= +SetMovedir +=============== +*/ +void() SetMovedir = +{ + if (self.movedir != VEC_ORIGIN) return; // we already did + + vector t_angle; + t_angle = '0 0 0'; + if (self.mangle != '0 0 0') + { + t_angle = self.angles; + if (t_angle == '0 -1 0') + t_angle = '0 -90 0'; + else if (t_angle == '0 -2 0') + t_angle = '0 90 0'; + + // self.angles_x = self.mangle_y; + // self.angles_y = self.mangle_x; + // self.angles_z = self.mangle_z; + self.angles = Vector(self.mangle_y,self.mangle_x,self.mangle_z); + } + + if (self.angles == '0 -1 0') + self.movedir = '0 0 1'; + else if (self.angles == '0 -2 0') + self.movedir = '0 0 -1'; + else + { + makevectors (self.angles); + self.movedir = v_forward; + } + + self.angles = t_angle; +} + + +/* +============= +SUB_CalcMoveDone +=============== +*/ +void() SUB_CalcMoveDone = +{ +// After moving, set origin to exact final destination + setorigin(self, self.finaldest); + self.velocity = '0 0 0'; + self.nextthink = -1; + if (self.think1) + self.think1(); +} + +/* +============= +SUB_CalcMove + +calculate self.velocity and self.nextthink to reach dest from +self.origin traveling at speed +=============== +*/ +void(vector tdest, float tspeed, void() func) SUB_CalcMove = +{ +local vector vdestdelta; +local float len, traveltime; + + if (!tspeed) + objerror( "No speed is defined!" ); + + self.think1 = func; + self.finaldest = tdest; + self.think = SUB_CalcMoveDone; + + if (tdest == self.origin) + { + self.velocity = '0 0 0'; + self.nextthink = self.ltime + 0.1; + return; + } + +// set destdelta to the vector needed to move + vdestdelta = tdest - self.origin; + +// calculate length of vector + len = vlen (vdestdelta); + +// divide by speed to get time to reach dest + traveltime = len / tspeed; + + if (traveltime < 0.1) + { + self.velocity = '0 0 0'; + self.nextthink = self.ltime + 0.1; + return; + } + +// set nextthink to trigger a think when dest is reached + self.nextthink = self.ltime + traveltime; + +// scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float +} + +/* +============= +SUB_CalcMoveEnt +=============== +*/ +void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = +{ + local entity stemp; + stemp = self; + self = ent; + + SUB_CalcMove (tdest, tspeed, func); + self = stemp; +} + + +// ================================================================ + + +/* +============= +SUB_CalcAngleMoveDone +=============== +*/ +void() SUB_CalcAngleMoveDone = +{ +// After rotating, set angle to exact final angle + self.angles = self.finalangle; + self.avelocity = '0 0 0'; + self.nextthink = -1; + if (self.think1) + self.think1(); +} + +/* +============= +SUB_CalcAngleMove + +calculate self.avelocity and self.nextthink to reach destangle from +self.angles rotating + +The calling function should make sure self.think is valid +=============== +*/ +void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = +{ +local vector destdelta; +local float len, traveltime; + + if (!tspeed) + objerror( "No speed is defined!"); + +// set destdelta to the vector needed to move + destdelta = destangle - self.angles; + +// calculate length of vector + len = vlen (destdelta); + +// divide by speed to get time to reach dest + traveltime = len / tspeed; + +// set nextthink to trigger a think when dest is reached + self.nextthink = self.ltime + traveltime; + +// scale the destdelta vector by the time spent traveling to get velocity + self.avelocity = destdelta * (1 / traveltime); + + self.think1 = func; + self.finalangle = destangle; + self.think = SUB_CalcAngleMoveDone; +} + +/* +============= +SUB_CalcAngleMoveEnt +=============== +*/ +void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = +{ + local entity stemp; + stemp = self; + self = ent; + SUB_CalcAngleMove (destangle, tspeed, func); + self = stemp; +} \ No newline at end of file diff --git a/QC_other/QC_copper/subs_tgt.qc b/QC_other/QC_copper/subs_tgt.qc new file mode 100644 index 00000000..875568c3 --- /dev/null +++ b/QC_other/QC_copper/subs_tgt.qc @@ -0,0 +1,511 @@ +/* +================================================================ + + USETARGET SUBS + +================================================================ +*/ + + +/* +============= +tgtcmp + +checks if two entities target each other +returns 1 if n1 targets n2, -1 if n2 targets n1, 0 otherwise +=============== +*/ +float(entity n1, entity n2) tgtcmp = +{ + if (n1.target == n2.targetname) return 1; + if (n1.target2 == n2.targetname) return 1; + if (n1.target3 == n2.targetname) return 1; + if (n1.target4 == n2.targetname) return 1; + + if (n2.target == n1.targetname) return -1; + if (n2.target2 == n1.targetname) return -1; + if (n2.target3 == n1.targetname) return -1; + if (n2.target4 == n1.targetname) return -1; + + return 0; +} + +/* +============= +SUB_CopyTargets +=============== +*/ +void(entity to) SUB_CopyTargets = +{ + if (to == world) return; + to.target = self.target; + to.target2 = self.target2; + to.target3 = self.target3; + to.target4 = self.target4; + to.killtarget = self.killtarget; +} + +/* +============= +SUB_AddTarget +=============== +*/ +void(entity to, string tname) SUB_AddTarget = +{ + if (to == world) return; + if (to.target == string_null) + to.target = tname; + else if (to.target2 == string_null) + to.target2 = tname; + else if (to.target3 == string_null) + to.target3 = tname; + else if (to.target4 == string_null) + to.target4 = tname; + else + dprint3("Warning: no room to add target to ", to.classname, "\n"); +} + +/* +============= +SUB_MergeTargets +=============== +*/ +void(entity to) SUB_MergeTargets = +{ + // iw -- fixed copying target over all 4 targets and never copying killtarget + if (to == world) return; + if (self.target != string_null) + SUB_AddTarget(to, self.target); + if (self.target2 != string_null) + SUB_AddTarget(to, self.target2); + if (self.target3 != string_null) + SUB_AddTarget(to, self.target3); + if (self.target4 != string_null) + SUB_AddTarget(to, self.target4); + if (self.killtarget != string_null) + { + if (to.killtarget != string_null) + dprint3("Warning: no room to add killtarget to ", to.classname, "\n"); + else + to.killtarget = self.killtarget; + } +} + +/* +============= +DelayThink +=============== +*/ +void() DelayThink = +{ + activator = self.enemy; + SUB_UseTargets (); + remove(self); +} + +/* +============= +DelayThinkRandom +=============== +*/ +void() DelayThinkRandom = +{ + activator = self.enemy; + SUB_UseRandomTarget (); + remove(self); +} + +/* +============= +SUB_UseTargetsDelay +=============== +*/ +void( void() delayedthink ) SUB_UseTargetsDelay = +{ + local entity t; + // create a temp object to fire at a later time + t = spawn(); + t.classname = "DelayedUse"; + t.nextthink = time + self.delay; + t.think = delayedthink; + t.enemy = activator; + t.message = self.message; + SUB_CopyTargets(t); + + t.cnt = self.cnt; +} + +/* +============= +SUB_PrintMessage +=============== +*/ +void() SUB_PrintMessage = +{ + if (self.message == string_null) + return; + if (self.classname == "info_storycamera") + return; + entity client = world; + float i; + + dprint5("Printing message '",self.message,"' to ",activator.classname," ...\n"); + + // print the message + if (activator.classname == "player") + { + centerprint (activator, self.message); + if (!self.noise) + sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + } + else + { + // sometimes activator can be an infighting monster that killed a monster + // with a targetname, so just print to all clients + client = find(client,classname,"player"); + i = 0; + while (i < 4 && client != world) + { + centerprint (client, self.message); + if (!self.noise) + sound (client, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + if (!coop) break; + client = find(client,classname,"player"); + i++; + } + } +} + +/* +============= +SUB_UseNextTarget +=============== +*/ +entity(entity t, string tname) SUB_UseNextTarget = +{ + local entity otemp, stemp; + t = find (t, targetname, tname); + if (!t) return world; + stemp = self; + otemp = other; + self = t; + other = stemp; + if (self.use != SUB_Null) + if (self.use) self.use (); + + self = stemp; + other = otemp; + return t; +} + + +/* +============= +SUB_UseEntTargets +=============== +*/ +void(entity t) SUB_UseEntTargets = +{ + if (t == world) return; + activator = self; + entity oself = self; + self = t; + SUB_UseTargets(); + self = oself; +} + +/* +============= +SUB_UseTargetsByField +=============== +*/ +string curTgt; +void(.string fld) SUB_UseTargetsByField = +{ + if (self.fld == string_null) return; + local entity t, act; + + dprint5(activator.classname," caused ",self.classname," to fire target '",self.fld); + dprint("'\n"); + + act = activator; + t = world; + // some custom maps (like dm456sp.bsp) have cross-targeted doors that all open in unison + // by targeting themselves and each other, which can smash the stack on older versions of + // quake with MAX_STACK_DEPTH 32 + if (curTgt != self.fld) + { + curTgt = self.fld; + do { + t = SUB_UseNextTarget( t, self.fld ); + activator = act; + if (!t) + { + curTgt = string_null; + return; + } + } while ( 1 ); + } + dprint3("WARNING: circular tname reference: ", curTgt, ", skipping\n"); + curTgt = string_null; +} + +void(string tname) SUB_KillTargets = +{ + // kill the killtargets + if (tname == string_null) + return; + + entity t = world; + do + { + t = find (t, targetname, tname); + if (!t) + break; + RemoveTarget (t); + } while ( 1 ); +} + +/* +============================== +SUB_UseTargets + +the global "activator" should be set to the entity that initiated the firing. + +If self.delay is set, a DelayedUse entity will be created that will actually +do the SUB_UseTargets after that many seconds have passed. + +Centerprints any self.message to the activator. + +Removes all entities with a targetname that match self.killtarget. + +Search for (string)targetname in all entities that +match (string)self.target and call their .use function + +lunaran: using "findalltargets" here would be much simpler and lead to a shorter +call stack, but entities that trigger each other in sequence within one frame +(like trigger_relays) would stomp each others' linked lists of targets and cause +targets not to fire. +============================== +*/ +void() SUB_UseTargets = +{ + //local entity t;//, act; + + if (!self.target && !self.target2 && !self.target3 && !self.target4 && !self.killtarget) + return; + + if (activator == world) + { + //error("activator was null. globals are bad, kids.\n"); + //return; + dprint3("WARNING: Activator was null!\nuser (self): ", self.classname, "\n"); + } + + // check for a delay + if (self.delay) + { + SUB_UseTargetsDelay(DelayThink); + return; + } + + if (self.killtarget != string_null) + { + if (self.killtarget == self.targetname) + dprint5("WARNING: ", self.classname, " killtargets itself! (", self.killtarget, ")\n"); + if (self.killtarget == self.target || + self.killtarget == self.target2 || + self.killtarget == self.target3 || + self.killtarget == self.target4 ) + dprint5("WARNING: ", self.classname, " targets and killtargets the same targetname (", self.killtarget, ")\n"); + } + + // makes more logical sense to do killtarget after targets, but it was + // before in id1 so before is where it has to stay + SUB_KillTargets(self.killtarget); + + SUB_UseTargetsByField(target); + SUB_UseTargetsByField(target2); + SUB_UseTargetsByField(target3); + SUB_UseTargetsByField(target4); +} + +/* +============= +SUB_UseRandomTarget +=============== +*/ +void() SUB_UseRandomTarget = +{ + local entity t, act, otemp, stemp; + local float randy; + + // check for a delay + if (self.delay) + { + SUB_UseTargetsDelay(DelayThinkRandom); + return; + } + + // fire targets + if (self.target != string_null) { + randy = ceil( random() * self.cnt ); + act = activator; + t = world; + do { + t = find (t, targetname, self.target); + randy = randy - 1; + if (!t) break; + } while ( randy > 0 ); + stemp = self; + otemp = other; + self = t; + other = stemp; + if (self.use != SUB_Null) { + if (self.use) self.use (); + } + self = stemp; + other = otemp; + activator = act; + } + + // kill the killtargets + if (self.killtarget != string_null) + { + randy = ceil( random() * self.frags ); + t = world; + do + { + t = find (t, targetname, self.killtarget); + randy = randy - 1; + if (!t) break; + } while ( randy > 0 ); + RemoveTarget(t); + } +} + + + +/* +============= +SUB_CountTargets +=============== +*/ +void() SUB_CountTargets = +{ + local entity t; + local float i; + + i = 0; + t = world; + while (self.target != string_null) + { + t = find(t, targetname, self.target); + if (!t) break; + i = i + 1; + } + t = world; + while (self.target2 != string_null) + { + t = find(t, targetname, self.target2); + if (!t) break; + i = i + 1; + } + t = world; + while (self.target3 != string_null) + { + t = find(t, targetname, self.target3); + if (!t) break; + i = i + 1; + } + t = world; + while (self.target4 != string_null) + { + t = find(t, targetname, self.target4); + if (!t) break; + i = i + 1; + } + + self.cnt = i; + + i = 0; + t = world; + while (self.killtarget != string_null) + { + t = find(t, targetname, self.killtarget); + if (!t) break; + i = i + 1; + } + + self.frags = i; +} + +/* +============= +SUB_VerifyTrigger + +somewhat unreliable attempt to ensure items with targetnames that aren't actually +triggered by anything don't stay unspawned forever and break a stock map +examples: weapons in antediluvium targeted by spotlights, the silver key in e4m4 +=============== +*/ +float(entity tg) SUB_VerifyTrigger = +{ + // things that could conceivably be targeted at an item but cannot fire targets + if (tg.classname == "light" || + //tg.classname == "path_corner" || // trains do fire targets + tg.classname == "trap_shooter" || + tg.classname == "target_drop" || + tg.classname == "trap_spikeshooter") + return FALSE; + + if (tg.killtarget == self.targetname) // id1 'killtarget must target' protection + return FALSE; + return TRUE; +} + +/* +============= +SUB_VerifyTriggerable +=============== +*/ +float() SUB_VerifyTriggerable = +{ + if (self.targetname == string_null) return FALSE; + // some quake maps use SUB_regen as a hack to make items respawn, but + // they expect those items to still spawn at map start, so catch those + // cases and return false to force the item to spawn + if (self.use == SUB_regen) return FALSE; + + float validTriggerers; + entity tg; + + validTriggerers = FALSE; + tg = world; + while(1) { + tg = find(tg, target, self.targetname); + if (!tg) break; + validTriggerers |= SUB_VerifyTrigger(tg); + } + tg = world; + while(1) { + tg = find(tg, target2, self.targetname); + if (!tg) break; + validTriggerers |= SUB_VerifyTrigger(tg); + } + tg = world; + while(1) { + tg = find(tg, target3, self.targetname); + if (!tg) break; + validTriggerers |= SUB_VerifyTrigger(tg); + } + tg = world; + while(1) { + tg = find(tg, target4, self.targetname); + if (!tg) break; + validTriggerers |= SUB_VerifyTrigger(tg); + } + + return validTriggerers; +} + diff --git a/QC_other/QC_copper/t_ctrl.qc b/QC_other/QC_copper/t_ctrl.qc new file mode 100644 index 00000000..40cb3ead --- /dev/null +++ b/QC_other/QC_copper/t_ctrl.qc @@ -0,0 +1,440 @@ +/* +================================================================ + +CONTROL FLOW + +All the relays, counters, and other gates that manipulate the firing +of other entities' .use() functions + +including entities that aren't real triggers but are named trigger_* + +================================================================ +*/ + +void() trigger_relay_msg = +{ + activator = self.enemy; + SUB_PrintMessage(); + + if (self.noise) + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + if (self.spawnflags & 1) + self.message = string_null; +} + +void() trigger_relay_use = +{ + if (self.customflags & CFL_LOCKED) + { + dprint(" trigger_relay is locked: not relaying\n"); + return; + } + + self.enemy = activator; + + if (self.spawnflags & 2) + { + SUB_CountTargets(); + //dprint2(ftos(self.cnt), " targets left to fire\n"); + SUB_UseRandomTarget(); + } + else SUB_UseTargets(); + + // separate from usetargets because of relays and triggers with odd messages all over quake + if (self.delay) + { + self.think = trigger_relay_msg; + self.nextthink = time + self.delay; + } + else + trigger_relay_msg(); + + if (self.count > 0) + { + self.count -= 1; + if (self.count == 0) + remove(self); + } +} + + +/*QUAKED trigger_relay (.5 .0 .5) (-8 -8 -8) (8 8 8) MSG_ONCE RANDOM KILL_LAST +This fixed size trigger cannot be touched, it can only be fired by other events. Target this with a target_lock to selectively disable/reenable it for logic fun. + +Keys: +"delay" delay before firing (after trigger) +"killtarget" removes target +"message" displayed when fired +"target/2/3/4" fires target when triggered +"targetname" entity name (required) +"sounds" same as other triggers, plays after 'delay' +"noise" or, pick any wav +"count" only fire this many times, then auto self-destruct + +Spawnflags: +"MSG_ONCE" only print its message on the first firing, otherwise it prints every time +"RANDOM" randomly fire one of its targets (and/or kill one of its killtargets) instead of them all +"KILL_LAST" will only kill its killtarget(s) if no entities can be found to trigger +*/ +/*FGD +@PointClass base(AppearFlags, TriggerSounds, Target, Targetname) = trigger_relay : "Trigger: Relay" +[ + spawnflags(flags) = [ + 1 : "Only print message once" : 0 + 2 : "Choose one target at random" : 0 + 4 : "Only killtarget if no targets left" : 0 + ] + message(string) : "Print when triggered" + count(integer) : "Limit uses" : 0 +] +*/ +void() trigger_relay = +{ + if (!SUB_ShouldSpawn()) return; + if (self.targetname == string_null) + { + // IW fix - no longer objerror, which is a game-ender in old engines + dprint3("WARNING: trigger_relay at ", vtos(self.origin), "not targeted by anything"); + remove(self); + return; + } + + self.use = trigger_relay_use; + InitTriggerSounds(); +} + + +//============================================================================= + +void() target_state_use = +{ + if (self.customflags & CFL_LOCKED) + return; + + if (self.spawnflags & 1) + { + entity inc; + inc = find(world, targetname, self.include); + if (inc) + { + if (inc.state == self.state || (self.spawnflags & 2 && inc.state != self.state) ) + SUB_UseTargets(); + } + return; + } + + float mx = max(1, self.count); + if (self.spawnflags & 2) + { + self.state = self.state - 1; + if (self.state < 0) self.state = mx; + } + else + { + self.state = self.state + 1; + if (self.state > mx) self.state = 0; + } +} + +/*QUAKED target_state (.5 .0 .5) (-8 -8 -8) (8 8 8) RELAY INVERSE +Numeric variable. set 'state' to initial value. triggering this will cycle the value (swapping 0 and 1). + +If "RELAY" is checked, it acts as a relay instead of holding state. It fires its targets based on the value of the 'state' member of another entity, specified by setting 'state' to the value it has to match and 'include' to that entity's targetname. This can be another target_state, or any other entity which has a 'state', such as doors or plats. + 0: off (lights/etc)/top (plats)/open (doors)/pushed (buttons) + 1: on (lights/etc)/bottom (plats)/closed (doors)/unpushed (buttons) + 2: going up (plats)/opening (doors)/pushing (buttons) + 3: going down (plats)/closing (doors)/unpushing (buttons) +A trigger_counter's 'state' is its current trigger count. + +Keys: +"count" if > 1, state will be incremented on each trigger to a maximum of 'count' before cycling to 0 +"delay" delay before firing (after trigger) +"target2/3/4/kill" targets to fire if RELAY + +Spawnflags: +"INVERSE" if RELAY, will fire if state is anything other than a match. otherwise, will decrement when triggered instead of increment +*/ +/*FGD +@PointClass base(AppearFlags, Target, Targetname) = target_state : "Target : State. Holds a numeric variable, or tests other entities for theirs before firing targets." +[ + spawnflags(flags) = [ + 1 : "Relay" : 0 + 2 : "Inverse" : 0 + ] + include(target_destination) : "Entity to monitor" + count(integer) : "Max state to cycle to" + state(integer) : "State to monitor" +] +*/ +void() target_state = +{ + if (!SUB_ShouldSpawn()) return; + if (self.targetname == string_null) + objerror("target_state not targeted by anything"); + if (self.spawnflags & 1 && self.include == string_null) + objerror("target_state relay has no include"); + + self.use = target_state_use; +} + +//============================================================================= + +void(string tname) target_lock_do = +{ + if (tname == string_null) return; + + local entity t, c; + t = world; + + do { + t = find (t, targetname, tname); + if (!t) break; + + // outer loop finds doors targeted directly + if (t.classname == "func_door") + { + if (self.state) door_unlock(t); + else door_lock(t); + // inner loop checks for doors that are linked by touch and not targetname + c = t.enemy; + do { + if (c.targetname != t.targetname) // outer loop will find this one + if (self.state) door_unlock(t); + else door_lock(t); + c = c.enemy; + } while (c != t); + } + else if (t.classname == "func_plat") + { + if (self.state) plat_unlock(t); + else plat_lock(t); + } + else //if (t.classname == "trigger_relay" || t.classname == "func_button") + { + if (self.state) + { + t.customflags = not(t.customflags, CFL_LOCKED); + dprint4(t.classname, " with targetname ", t.targetname, " is unlocked\n"); + } + else + { + t.customflags |= CFL_LOCKED; + dprint4(t.classname, " with targetname ", t.targetname, " is locked\n"); + } + } + } while ( t ); +} + +void() target_lock_use = +{ + //bprint("in target lock use\n"); + target_lock_do(self.target); + target_lock_do(self.target2); + target_lock_do(self.target3); + target_lock_do(self.target4); + + if (self.spawnflags & 4) self.state = 1; + else if (self.spawnflags & 2) self.state = 0; + else self.state = 1 - self.state; +} + +/*QUAKED target_lock (0 .5 .8) (-8 -8 -8) (8 8 8) START_LOCKED LOCK_ONLY UNLOCK_ONLY +Locks and unlocks targeted entities independent of their toggle/start_open/etc states. Works on various entities: +- A locked func_door won't respond to touches or triggers. Use this for doors behind temporary bars. +- A locked func_plat behaves as an unreleased LOW_TRIGGER plat +- A locked trigger_relay will not fire or evaluate at all +- Locked path_corners are not considered valid patrol/train destinations +- Locked trigger volumes (once/multi/teleport/secret/changelevel/push/monsterjump) will not activate when touched or triggered + +Spawnflags: +"start_locked" Targeted entities start out locked. +"lock_only" Will only lock its targets rather than toggling +"unlock_only" Will only unlock its targets rather than toggling +*/ +/*FGD +@Pointclass base(Target, Targetname, Appearflags) color(192 64 0) size(16 16 16) = target_lock : +"Locks and unlocks targeted entities independent of their toggle/start_open/etc states. Works on various entities: +- A locked func_door won't respond to touches or triggers. Use this for doors behind temporary bars. +- A locked func_plat behaves as an unreleased LOW_TRIGGER plat +- A locked trigger_relay will not fire or evaluate at all +- Locked path_corners are not considered valid patrol/train destinations +- Locked trigger volumes (once/multi/teleport/secret/changelevel/push/monsterjump) will not activate when touched or triggered" +[ + spawnflags(flags) = [ + 1: "Targeted entities start locked" : 0 + 2: "Lock only" : 0 + 4: "Unlock only" : 0 + ] +] +*/ +void() target_lock = +{ + if (!SUB_ShouldSpawn()) return; + self.use = target_lock_use; + if (self.spawnflags & 4) self.state = 1; + else self.state = 0; + + if (self.spawnflags & 1) + { + self.state = 0; + self.think = target_lock_use; + self.nextthink = time + 0.25; + } +} + +//============================================================================ + + +void() counter_use = +{ + self.state = self.state + 1; + if (self.state > self.count) + return; + + if (self.state != self.count) + { + float rem = self.count - self.state; + if (activator.classname == "player" && !(self.spawnflags & SPAWNFLAG_NOMESSAGE)) + { + if (rem >= 6) + centerprint (activator, "There are more to go ..."); + else if (rem == 5) + centerprint (activator, "There are 5 more to go ..."); + else if (rem == 4) + centerprint (activator, "There are 4 more to go ..."); + else if (rem == 3) + centerprint (activator, "There are 3 more to go ..."); + else if (rem == 2) + centerprint (activator, "Only 2 more to go ..."); + else + centerprint (activator, "Only 1 more to go ..."); + } + return; + } + + if (activator.classname == "player" && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + centerprint(activator, self.message); + + self.enemy = activator; + if (self.spawnflags & 2) + self.state = 0; // repeatable + multi_trigger (); +} + +/*QUAKED trigger_counter (.5 .0 .5) (-8 -8 -8) (8 8 8) nomessage repeat +Acts as an intermediary for an action that takes multiple inputs. +If nomessage is not set, it will print "1 more.. " etc when triggered and "sequence complete" when finished. After the counter has been triggered "count" times, it will fire all of it's targets and remove itself, unless 'repeat' has been set. + +Flags: +"nomessage" disables count display + +Keys: +"count" number of triggers needed to fire own target, default is 2 +"target" entity to trigger (required) +"targetname" entity name (required) +"message" override text to print on completion +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) = trigger_counter : "Trigger: Counter" +[ + spawnflags(flags) = [ + 1: "No Message" : 0 + 2: "Repeat" : 0 + ] + count(integer) : "Count before trigger" : 2 + delay (integer) : "Delay" + message(string) : "Message" +] +*/ +void() trigger_counter = +{ + if (!SUB_ShouldSpawn()) return; + if (self.spawnflags & 2) + self.wait = 1; + else + self.wait = -1; + + if (!self.count) + self.count = 2; + if (self.message == string_null) + self.message = "Sequence completed!"; + + //self.cnt = self.count; + + self.use = counter_use; +} + + +//============================================================================ + + +void() timer_think = +{ + if (self.count == 0) { + //SUB_Remove(); + return; + } + + if (self.nextthink > time) // turn off again + { + self.nextthink = 0; + return; + } + + self.nextthink = time + self.wait + random() * self.rand; + self.count = self.count - 1; + activator = self.owner; + SUB_UseTargets(); +} + +void() timer_use = +{ + dprint("in timer_use\n"); + + self.owner = activator; + self.count = self.cnt; + timer_think(); +} + +/*QUAKED trigger_timer (.5 .5 .5) (-8 -8 -8) (8 8 8) start_on +Fires its targets once every "wait" seconds. If "count" is set, it will only fire that many times and then stop. Set "rand" to add a random extra delay to the wait interval. + +SPAWNFLAGS +START_ON: do not wait until triggered to begin firing +*/ +/*FGD +@PointClass base(Appearflags, Target, Targetname) = trigger_timer : "Trigger: Timer" +[ + spawnflags(flags) = [ + 1: "Start On" : 0 + ] + count(integer) : "Limit" : 0 + wait(string) : "Interval" + rand(string) : "Random Extra Interval" +] +*/ +void() trigger_timer = +{ + if (!SUB_ShouldSpawn()) return; + if (!self.wait) + self.wait = 1; + if (self.rand < 0) + self.rand = 0; + + self.think = timer_think; + self.use = timer_use; + + if (self.spawnflags & 1) + { + self.nextthink = time + self.wait; + } + + if (!self.count) + self.count = -1; + self.cnt = self.count; +} + +//============================================================================ + + diff --git a/QC_other/QC_copper/t_level.qc b/QC_other/QC_copper/t_level.qc new file mode 100644 index 00000000..60a69d17 --- /dev/null +++ b/QC_other/QC_copper/t_level.qc @@ -0,0 +1,447 @@ +/* +============================================================================= + + LEVEL CHANGING / INTERMISSION + +============================================================================= +*/ + +void() GotoNextMap = +{ + if (cvar("samelevel")) // if samelevel is set, stay on same level + changelevel (mapname); // name of current level + else + changelevel (nextmap); // global set to next level +} + + +void() ExitIntermission = +{ + // skip any text in deathmatch + if (deathmatch) + { + GotoNextMap (); + return; + } + + intermission_exittime = time + 1; + intermission_running = intermission_running + 1; + + // end of episode drivel + if (intermission_running == 2) + { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + if (world.model == "maps/e1m7.bsp") + { + if (!cvar("registered")) + { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!"); + } + else + { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!"); + } + return; + } + else if (world.model == "maps/e2m6.bsp") + { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral."); + return; + } + else if (world.model == "maps/e3m6.bsp") + { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth."); + return; + } + else if (world.model == "maps/e4m7.bsp") + { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person."); + return; + } + GotoNextMap(); + } + + if (intermission_running == 3) + { + if (!cvar("registered")) + { // shareware episode has been completed, go to sell screen + WriteByte (MSG_ALL, SVC_SELLSCREEN); + return; + } + + if ( (serverflags & SVFL_ALLEPISODES) == SVFL_ALLEPISODES) + { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born."); + return; + } + GotoNextMap(); + } + + if (intermission_running == 4) + { + GotoNextMap(); + } + + if (intermission_running >= 5) + { + GotoNextMap(); + return; + } + + + dprint("fell off the end of exitintermission\n"); + return; +} + + + +/* +============ +ClearItemEffects + +turn off glow and screen coloring while we're in a camera +============ +*/ +void(entity who) ClearItemEffects = +{ + who.items = not(who.items, IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD); + who.effects = 0; + + // remember how much time was left on the powerup + if (who.radsuit_finished > time) + who.radsuit_finished -= time; + if (who.invincible_finished > time) + who.invincible_finished -= time; + if (who.invisible_finished > time) + who.invisible_finished -= time; + if (who.super_damage_finished > time) + who.super_damage_finished -= time; + /* + who.rad_time = 0; + who.invincible_time = 0; + who.invisible_time = 0; + who.super_time = 0; + */ +} + + +/* +============ +RestoreItemEffects +============ +*/ +void(entity who) RestoreItemEffects = +{ + if ( who.radsuit_finished > 0 ) + { + who.radsuit_finished += time; + who.items += IT_SUIT; + } + if ( who.invincible_finished > 0 ) + { + who.invincible_finished += time; + who.items += IT_INVULNERABILITY; + } + if ( who.invisible_finished > 0 ) + { + who.invisible_finished += time; + who.items += IT_INVISIBILITY; + } + if ( who.super_damage_finished > 0 ) + { + who.super_damage_finished += time; + who.items += IT_QUAD; + } +} + + + +/* +============ +FindIntermission + +Returns an entity to view from +============ +*/ +entity(entity start) FindIntermission = +{ + entity spot; + float cyc; + +// look for info_intermission first + spot = find (start, classname, "info_intermission"); + if (spot) + { + // pick a random one + cyc = random() * 16; + while (cyc > 1) + { + spot = find (spot, classname, "info_intermission"); + if (!spot) + spot = find (spot, classname, "info_intermission"); + cyc = cyc - 1; + } + return spot; + } + spot = find (world, classname, "info_intermission"); + if (spot) + return spot; + +// then look for the start position + spot = find (world, classname, "info_player_start"); + if (spot) + return spot; + +// testinfo_player_start is only found in regioned levels + spot = find (world, classname, "testplayerstart"); + if ( spot && ( spot.spawnflags & 1 ) ) + return spot; + + objerror ("FindIntermission: no spot"); + return world; +} + +entity(entity start) FindNextIntermission = +{ + if (!start) return world; + if (start.classname != "info_intermission") return start; + + entity spot; + spot = find(start, classname, "info_intermission"); + if (!spot) + spot = find(world, classname, "info_intermission"); + return spot; +} + +entity(entity start) FindPreviousIntermission = +{ + if (!start) return world; + if (start.classname != "info_intermission") return start; + entity last, spot; + spot = find(world, classname, "info_intermission"); + + if (spot == start) + { + // there's either only one spot or we're starting with the first one, so try to find the last one + while(spot) + { + last = spot; + spot = find(spot, classname, "info_intermission"); + } + return last; + } + + while(spot != start) + { + last = spot; + spot = find(spot, classname, "info_intermission"); + } + return last; +} + +// ================================================================ + +void(entity client, entity spot) move_player_to_intermission = +{ + ClearItemEffects(client); // remove powerups to clear glows/tints + + client.flags |= FL_NOTARGET; + client.view_ofs = '0 0 0'; + client.angles = client.v_angle = client.finalangle = spot.mangle; + client.fixangle = TRUE; // turn this way immediately + client.nextthink = time + 0.5; + client.takedamage = DAMAGE_NO; + client.solid = SOLID_NOT; + client.movetype = MOVETYPE_NONE; + client.goalentity = spot; + //bprint3("setting origin to ", vtos(spot.origin), "\n"); + + // dumb hack: origins don't update without a model? + client.modelindex = modelindex_eyes; + setorigin (client, spot.origin); +// client.modelindex = 0; + + fog_setFromEnt(client, spot); // need to get fog from any camera we jump to +} + +void() move_player_to_next_intermission = +{ + entity spot; + spot = FindNextIntermission(self.goalentity); + move_player_to_intermission(self,spot); +} + +void() move_player_to_previous_intermission = +{ + entity spot; + spot = FindPreviousIntermission(self.goalentity); + move_player_to_intermission(self,spot); +} + +void() move_players_to_intermission = +{ + entity spot; + spot = FindIntermission(world); + + other = find (world, classname, "player"); + + while (other != world) + { + move_player_to_intermission(other,spot); + other.lifetime_finished = time + 6; + other = find (other, classname, "player"); + } +} + +void() execute_changelevel = +{ + + //bprint("WHY ARE WE IN EXECUTE CHANGELEVEL\n"); + + intermission_running = 1; + +// enforce a wait time before allowing changelevel + if (deathmatch) + intermission_exittime = time + 5; + else + intermission_exittime = time + 2; + + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 3); + + move_players_to_intermission(); + + WriteByte (MSG_ALL, SVC_INTERMISSION); +} + +void() changelevel_do = +{ + if (coop || deathmatch) + { + bprint (other.netname); + bprint (" exited the level\n"); + } + + nextmap = self.map; + + if ( (self.spawnflags & 1) && (deathmatch == 0) ) + { // NO_INTERMISSION + GotoNextMap(); + return; + } + + // we can't move people right now, because touch functions are called + // in the middle of C movement code, so set a think time to do it + self.think = execute_changelevel; + self.nextthink = time + 0.1; +} + + +void() changelevel_touch = +{ + if (!CheckValidTouch()) return; + if (self.customflags & CFL_LOCKED) return; + + if (deathmatch) + { + if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) + { + T_Damage (other, self, self, 50000); + return; + } + } + + self.touch = SUB_Null; + + activator = other; + SUB_UseTargets (); + + changelevel_do(); +} + +/*QUAKED trigger_changelevel (.5 0 .5) ? no_intermission ? TRIGGER_FIRST +When the player touches this, he gets sent to the map listed in the "map" variable. The view will go to the info_intermission spot and display stats. + +Flags: +"no_intermission" bypasses intermission screen +"trigger_first" won't be touchable until triggered once by something else + +Keys: +"map" set to name of next map (e.g. e1m1) if no map is set, the current map will restart +*/ +/*FGD +@SolidClass base(Trigger) = trigger_changelevel : "Trigger: Change level" +[ + map(string) : "Next map" + spawnflags(flags) = + [ + 1: "No intermission" : 0 + ] +] +*/ +void() trigger_changelevel = +{ + if (!SUB_ShouldSpawn()) return; + if (!self.map) + objerror ("trigger_changelevel doesn't have map"); + + InitTrigger (); + self.touch = changelevel_touch; +} + +/*QUAKED target_changelevel (1 1 0.5) (-16 -16 -16) (16 16 16) NO_INTERMISSION +When the player triggers this by any means, he gets sent to the map listed in the "map" variable. +Spawnflags: +NO_INTERMISSION: the view will not go to the info_intermission spot and display stats +*/ +/*FGD +@PointClass base(Trigger) = trigger_changelevel : "Target: Change level" +[ + map(string) : "Next map" + spawnflags(flags) = + [ + 1: "No intermission" : 0 + ] +] +*/ +void() target_changelevel = +{ + if (!SUB_ShouldSpawn()) return; + if (!self.map) + objerror ("target_changelevel doesn't have map"); + + self.use = changelevel_do; +} + + +/*QUAKED info_intermission (.75 .25 .25) (-8 -8 -8) (8 8 8) +This is the camera point for the intermission. Use "mangle" instead of angle, so you can set pitch or roll as well as yaw. +Quake does a random pick if more than one exists. +If no info_intermission entity is set, Quake uses the player start. + +Keys: +"mangle" set pitch yaw roll, positive pitch is down +"fog_color"/"fog_density" set the fog for the view from this camera + +*/ +/*FGD +@PointClass base(Fog, Appearflags) = info_intermission : "Intermission camera" +[ + mangle(string) : "Camera angle (Pitch Yaw Roll, positive pitch down)" +] +*/ +void() info_intermission = +{ + if (!SUB_ShouldSpawn()) return; +} + + diff --git a/QC_other/QC_copper/t_tele.qc b/QC_other/QC_copper/t_tele.qc new file mode 100644 index 00000000..87712eea --- /dev/null +++ b/QC_other/QC_copper/t_tele.qc @@ -0,0 +1,442 @@ +/* +============================================================================== + +TELEPORT TRIGGERS + +all teleport functionality handled by one function, to allow me to invoke +teleports with a couple different entities that don't replicate each other's +code + +============================================================================== +*/ + +float TELEPORT_PLAYER_ONLY = 1; +float TELEPORT_SILENT = 2; +float TELEPORT_PUSH = 2; +float TELEPORT_TRIGGER_FIRST = 4; +float TELEPORT_NOTRIGGER = 8; +float TELEPORT_NOFLASH = 16; +float TELEPORT_MONSTER_ONLY = 32; + +// -------------------------------- + +void() teleport_flash = +{ + local float v; + local string snd; + v = random() * 5; + if (v < 1) + snd = "misc/r_tele1.wav"; + else if (v < 2) + snd = "misc/r_tele2.wav"; + else if (v < 3) + snd = "misc/r_tele3.wav"; + else if (v < 4) + snd = "misc/r_tele4.wav"; + else + snd = "misc/r_tele5.wav"; + + sound (self, CHAN_VOICE, snd, 1, ATTN_NORM); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +} + +// player teleports are the only case we don't want to play the tflash right on +// an entity, so teleport_flash still accepts an entity argument and we just make +// a temp entity for it in this single case +// arguably not at all better than changing teleport_flash to accept a vector arg +// but we need an ent to play the sound on anyway +void() teleport_flasher = +{ + teleport_flash(); + remove(self); +} + +// just call this to teleport something somewhere +void(entity traveler, entity dst, float tfog, float nofwd) teleport = +{ + entity tport; + vector vdir; + + if (dst.classname == "misc_teleporttrain") + { + if (dst.think1 == fly_idle) + { + vdir = vectoangles(dst.origin - traveler.origin); + nofwd = TRUE; + } + else + { + vdir = vectoangles(dst.velocity); + } + vdir_x = 0; // null pitch + } + else + vdir = dst.mangle; + + if (tfog) + { + SUB_CallAsSelf(teleport_flash, traveler); // flash at departure point + tport = spawn(); + + // teleport controller's origin is desired teleport flash location on arrival + if (traveler.classname == "player") + { + makevectors (vdir); + setorigin(tport, dst.origin + v_forward * 16); + } + else + { + setorigin(tport, dst.origin); + } + + tport.think = teleport_flasher; + tport.nextthink = time + 0.05; + } + + spawn_tdeath(dst.origin, traveler); + + setorigin(traveler, dst.origin); + traveler.angles = vdir; + if (traveler.flags & FL_MONSTER) + { + traveler.ideal_yaw = traveler.angles_y; + } + + if (traveler.classname == "player") + { + fog_setFromEnt(traveler, dst); + traveler.fixangle = 1; // turn this way immediately + makevectors (vdir); + SUB_UseEntTargets(dst); + + if (!nofwd) + { + traveler.teleport_time = time + 0.7; + traveler.velocity = v_forward * 300; + } + else + { + traveler.velocity = VEC_ORIGIN; + } + } + else + { + traveler.velocity = VEC_ORIGIN; + } + + traveler.flags = not(traveler.flags, FL_ONGROUND); +} + +// -------------------------------- +// tdeath +// -------------------------------- + +void() tdeath_touch = +{ + if (other == self.owner) + return; + +// frag anyone who teleports in on top of an invincible player + if (other.classname == "player") + { + if (other.invincible_finished > time) + self.classname = "teledeath2"; + if (self.owner.classname != "player") + { // other monsters explode themselves + T_Damage (self.owner, self, self, 50000); + return; + } + } + + if (other.health) + T_Damage (other, self, self, 50000); +} + +void(vector org, entity death_owner) spawn_tdeath = +{ + local entity death; + + // dumb hack so the world isn't flooded with a tdeath for every monster at map start + if (time < 2) return; + + death = spawn(); + death.classname = "teledeath"; + death.movetype = MOVETYPE_NONE; + death.solid = SOLID_TRIGGER; + setsize (death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1'); + setorigin (death, org); + death.angles = '0 0 0'; + death.touch = tdeath_touch; + death.nextthink = time + 0.2; + death.think = SUB_Remove; + death.owner = death_owner; + + force_retouch = 2; // make sure even still objects get hit +} + +// -------------------------------- + +void() teleport_touch = +{ + local entity t; + if (self.customflags & CFL_LOCKED) return; + if (other.health <= 0 || other.solid != SOLID_SLIDEBOX) return; // only teleport living creatures + if (other.movetype == MOVETYPE_NOCLIP) return; + if ((self.spawnflags & TELEPORT_PLAYER_ONLY) && (other.classname != "player")) return; + if ((self.spawnflags & TELEPORT_MONSTER_ONLY) && !(other.flags & FL_MONSTER)) return; + + if ((self.spawnflags & TELEPORT_NOTRIGGER) == 0) + if (self.targetname != string_null) + if ((self.spawnflags & TELEPORT_TRIGGER_FIRST) == 0) // not trigger first + if (self.nextthink < time) + { + //dprint3(" teleport with targetname ", self.targetname, " not activated yet, not teleporting\n"); + return; + } + + t = find (world, targetname, self.target); + if (!t) + objerror ("teleporter couldn't find target"); + + if (!self.count) + { + SUB_RemoveSoon(); + return; + } + else if (self.count > 0) + self.count -= 1; + + teleport( other, t, ((self.spawnflags & TELEPORT_NOFLASH) == 0), 0 ); + + activator = other; + SUB_UseTargets(); +} + +/*QUAKED info_teleport_destination (.75 .25 .85) (-16 -16 0) (16 16 48) +This is the destination marker for a teleporter. + +Keys: +"angle" new view angle after teleporting +"targetname" value used by teleporter +"fog_color"/"fog_density" set the fog for anyone teleporting here +*/ +/*FGD +@PointClass size(-32 -32 0, 32 32 64) base(Appearflags, Angle, Targetname, Fog) model({ "path": ":progs/player.mdl" }) = info_teleport_destination : "Teleporter destination" [] +*/ +void() info_teleport_destination = +{ + if (!SUB_ShouldSpawn()) return; +// this does nothing, just serves as a target spot + self.mangle = self.angles; + self.angles = '0 0 0'; + self.model = string_null; + self.origin = self.origin + '0 0 27'; + if (!self.targetname) + objerror ("no targetname"); +} + +// -------------------------------- +// info_teleport_target +// +// this entity is handy when activating a big trigger_teleport volume +// to try and teleport something is inconvenient +// -------------------------------- + +// teleports the activator to this spot +void() teleport_target_use = +{ + if (self.customflags & CFL_LOCKED) + { + dprint(" teleport_target is locked: not teleporting\n"); + return; + } + + if (self.spawnflags & TELEPORT_PLAYER_ONLY) + if (activator.classname != "player") + return; + if (self.spawnflags & TELEPORT_MONSTER_ONLY) + if (!(activator.flags & FL_MONSTER)) + return; + if (activator.movetype == MOVETYPE_NOCLIP) + return; + // only teleport living creatures + if (activator.health <= 0 || activator.solid != SOLID_SLIDEBOX) + return; + + if (!self.count) + { + SUB_RemoveSoon(); + return; + } + else if (self.count > 0) + self.count -= 1; + + teleport( activator, self, !(self.spawnflags & TELEPORT_NOFLASH), !(self.spawnflags & TELEPORT_PUSH) ); + activator.jump_flag = 0; +} + + +/*QUAKED info_teleport_target (.5 .75 .25) (-8 -8 -8) (8 8 32) PLAYER_ONLY PUSH TRIGGER_FIRST ? NOFLASH MONSTER_ONLY +This is a usable destination marker that acts as its own teleporter. When triggered, the activator is teleported to this spot. + +Flags: +PLAYER_ONLY only players will teleport +PUSH chuck the player forward like a trigger_teleport does +TRIGGER_FIRST first use turns it on, and every subsequent use teleports +NOFLASH don't spawn telefog or make noise +MONSTER_ONLY only monsters will teleport + +Keys: +"fog_color"/"fog_density" set the fog for anyone teleporting here +"count" remove after this many uses +*/ +/*FGD +@PointClass size(-32 -32 0, 32 32 64) base(Appearflags, Angle, Fog, Trigger) = info_teleport_target : "Triggerable Teleporter destination" [ + spawnflags(flags) = [ + 1 : "Player only" : 0 + 2 : "Push forward" : 0 + 16 : "No tflash" : 0 + ] +] +*/ +void() info_teleport_target = +{ + if (!SUB_ShouldSpawn()) return; + self.mangle = self.angles; + self.angles = '0 0 0'; + setorigin(self, self.origin + '0 0 16'); // + //if (!self.targetname) + if (self.targetname == string_null) + objerror ("no targetname"); + self.count = zeroconvertdefault(self.count, -1); + self.use = teleport_target_use; +} + + +// -------------------------------- + +void() teleport_hum = +{ + local vector o; + if (self.origin != '0 0 0') + o = self.origin; + else + o = (self.absmin + self.absmax)*0.5; + ambientsound (o, "ambience/hum1.wav",0.5 , ATTN_STATIC); +} + +void() teleport_use = +{ + self.nextthink = time + 0.2; + force_retouch = 2; // make sure even still objects get hit + self.think = SUB_Null; +} + +void() teleport_reactivate = +{ + trigger_reactivate(); + // triggerfirst + nonsilent = delayed ambientsound, so shortcut teleporters don't sound like secrets + if ( self.spawnflags & TELEPORT_TRIGGER_FIRST && !(self.spawnflags & TELEPORT_SILENT) ) + teleport_hum(); + + self.use = teleport_use; +} + +void() trigger_teleport_setup = +{ + self.touch = teleport_touch; + // find the destination + if (!self.target) + objerror ("no target"); + self.use = teleport_use; + self.count = zeroconvertdefault(self.count, -1); + if (!(self.spawnflags & TELEPORT_SILENT)) + { + precache_sound ("ambience/hum1.wav"); + if (!(self.spawnflags & TELEPORT_TRIGGER_FIRST)) + teleport_hum(); + } +} + +/*FGD +@baseclass base(Appearflags, Target, Targetname) = Teleport [ + spawnflags(Flags) = + [ + 1 : "Player only" : 0 + 2 : "Silent" : 0 + 8 : "Not triggerable (ignore targetname)" : 0 + 16 : "No tflash" : 0 + 32 : "Monsters only" : 0 + ] + count(integer) : "Limited uses" : -1 +] + +*/ + +/*QUAKED trigger_teleport (.5 .0 .5) ? player_only silent trigger_first notrigger noflash monster_only +Any object touching this will be transported to the corresponding info_teleport_destination entity. +You must set the "target" field, and create an object with a "targetname" field that matches. + +Flags: +"player_only" only players will teleport +"silent" no whispering from the slipgate +"trigger_first" won't be touchable until triggered once by something else +"notrigger" default behavior for a teleporter with a targetname is to only teleport what's touching it + when triggered. this will preserve ordinary no-targetname behavior (if you're using the teleporter's + targetname for a killtarget for example) +"noflash" don't spawn tfog or make noise +"monster_only" only monsters will teleport + +Keys: +"target" targetname of info_teleport_destination (required) +"targetname" entity name (required) +"count" remove after this many uses +*/ +/*FGD +@SolidClass base(Teleport) = trigger_teleport : "Trigger: Teleporter" [] +*/ +void() trigger_teleport = +{ + if (!SUB_ShouldSpawn()) return; + InitTrigger (); + trigger_teleport_setup(); // after inittrigger, so that size/model is set, so the telehum hums in the right place + if (self.spawnflags & TELEPORT_TRIGGER_FIRST) + self.use = teleport_reactivate; +} + +/*QUAKED trigger_teleport_box (.5 .0 .5) (-8 -8 -8) (8 8 8) player_only silent trigger_first notrigger +Any object touching this will be transported to the corresponding info_teleport_destination entity. +You must set the "target" field, and create an object with a "targetname" field that matches. +Quoth2-style edict-saving bounding box trigger: define bounds size with "mangle" - trigger volume will be centered on the trigger_teleport_box's origin. + +Flags: +"player_only" only players will teleport +"silent" no whispering from the slipgate +"trigger_first" won't be touchable until triggered once by something else +"notrigger" default behavior for a teleporter with a targetname is to only teleport what's touching it + when triggered. this will preserve ordinary no-targetname behavior (if you're using the teleporter's + targetname for a killtarget for example) +"noflash" don't spawn tfog or make noise + +Keys: +"target" targetname of info_teleport_destination (required) +"targetname" entity name (required) +*/ +/*FGD +@PointClass base(Teleport, Bounds) = trigger_teleport_box : "Trigger: Teleporter bounds" [] +*/ +void() trigger_teleport_box = +{ + if (!SUB_ShouldSpawn()) return; + InitTriggerBounds(); + trigger_teleport_setup(); + if (self.spawnflags & TELEPORT_TRIGGER_FIRST) + self.use = teleport_reactivate; +} + + diff --git a/QC_other/QC_copper/t_void.qc b/QC_other/QC_copper/t_void.qc new file mode 100644 index 00000000..0745e277 --- /dev/null +++ b/QC_other/QC_copper/t_void.qc @@ -0,0 +1,377 @@ +/* +============= +THE VOID + +The bottoms of pits have to be lit so scrags are lit, but then you can see their bodies at +the bottom along with heads and shit. Dead things are problematic to remove since they're +all SOLID_NOT and don't touch triggers, and trying to undo that requires hacky stuff like +thinking trigger bodies, and if you cover the bottom with a func static to just hide them +inside it, the player still sees all the garbage when he falls down there and dies himself. + +thus, a func_void: +- Sets itself as an invisible trigger that kills whatever touches it +- Creates a nonsolid 'ghost object' 32 units higher using its own brushmodel that hides + accumulated garbage +- Creates another trigger a specified height above itself that fades out players' view + when they fall through it + +A player's screen has fully faded to black by the time he hits the ghost, so he doesn't +see the trash underneath. Since he doesn't know he's not still falling, we can hold him +in stasis for a little while longer before we splat him, to imply the pit is deeper than +it really is (often not that deep). + +=============== +*/ + +/* +============ +TintScreen +============ +*/ +void(entity who, float amt) TintScreen +{ +// bprint(ftos(amt)); bprint("\n"); + stuffcmd(who, "\nv_cshift 0 0 0 "); + stuffcmd(who, ftos(amt)); + stuffcmd(who, "\n"); +} + + +/* +============ +TintScreenColor +============ +*/ +void(entity who, float amt, vector color) TintScreenColor +{ + // cshifts are 0-255 + if (color_x <= 1 && color_y <= 1 && color_z <= 1) + color *= 255; + color_x = ceil(color_x); + color_y = ceil(color_y); + color_z = ceil(color_z); + + // ugh: + stuffcmd(who, "\nv_cshift "); + stuffcmd(who, ftos(color_x)); + stuffcmd(who, " "); + stuffcmd(who, ftos(color_y)); + stuffcmd(who, " "); + stuffcmd(who, ftos(color_z)); + stuffcmd(who, " "); + stuffcmd(who, ftos(amt)); + stuffcmd(who, "\n"); +} + +// -------------------------------- +// void_unplunge +// player was rescued, somehow, probably by being a noclipping whore +// -------------------------------- +void(entity e) void_unplunge = +{ + e.customflags = not(e.customflags, CFL_PLUNGE); + SUB_CallAsSelf(W_ResetWeaponState, e); // restore weaponmodel + TintScreen(e,0); +} + +// -------------------------------- +// void_salvation +// sometimes we don't want to instantly murder the player for minor navigational errors +// -------------------------------- +float(entity o) void_salvation = +{ + if (!self.buddy) + return FALSE; + + // this func_void targets a teledest, so it's only for light punishment + + if ( (ArmorSave(other, self.dmg) + other.health - 1 > self.dmg) || + other.customflags & CFL_UNDYING || + other.flags & FL_GODMODE || + other.items & IT_INVULNERABILITY ) + { + void_unplunge(o); + teleport(o, self.buddy, TRUE, FALSE); + T_Damage(o, self, self, self.dmg); + o.velocity = '0 0 0'; + sound (o, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); + return TRUE; + } + // light punishment is still lethal, proceed with the display + return FALSE; +} + +// -------------------------------- +// void_func_touch +// player hit the physical bottom of the pit but may not have hit the implied bottom +// -------------------------------- +void() void_func_touch = +{ + if ( other.solid == SOLID_BSP || other.solid == SOLID_TRIGGER ) + return; + + if ( CheckValidTouch() ) // a living player not in noclip + { + if (void_salvation(other)) + return; + + other.customflags = not(other.customflags, CFL_UNDYING); + other.flags = not(other.flags, FL_GODMODE); + + // a pent will not save you from THE LEVEL DESIGNER + if (other.items & IT_INVULNERABILITY || other.invincible_finished > time) + { + other.items = other.items - (other.items & IT_INVULNERABILITY); + other.invincible_finished = 0; + other.invincible_time = 0; + } + + // other.customflags = not(other.customflags, CFL_UNDYING); + // other.customflags = not(other.customflags, CFL_PLUNGE); + + TintScreenColor(other,255,self.fadecolor); + other.velocity = '0 0 0'; + + other.solid = SOLID_NOT; + + other.movetype = MOVETYPE_NONE; + other.flags = other.flags | FL_NOTARGET; + + other.weaponmodel = string_null; + other.model = string_null; + + if (!(other.customflags & CFL_PLUNGE)) + { + // this is non-optimal - means the player got in under a plunge trigger somehow. + // can happen if the pit is wider at the top than the bottom, and the func_void + // was made only as wide as the bottom + other.armorvalue = 0; + if (!void_salvation(other)) // maybe save him anyway? + T_Damage(other, self, self, 5000); // or just blast him now and forget about it + return; + } + + other.takedamage = DAMAGE_NO; + return; + } + else if (other.classname != "player") // not a living player who IS in noclip + { + if (other.takedamage) + { + other.customflags |= CFL_PLUNGE; // set this so Killed() doesn't throw gibs + //T_Damage(other, self, other.enemy, other.health + 10); + if (other.enemy.classname == "player") + Killed(other,other.enemy); + else if (other.oldenemy.classname == "player") + Killed(other,other.oldenemy); + // attacker must be the monster's enemy, so that players still count as the + // killer if they boosh monsters into a pit + return; + } + + // anything else just vanishes + SUB_CallAsSelf(SUB_Remove,other); + } +} + + +// -------------------------------- +// void_hitbottom +// player hit the implied fake bottom (ie fell for 'delay' seconds), time to die +// -------------------------------- +void() void_fall_hitbottom = +{ + + self.enemy.takedamage = DAMAGE_YES; + self.enemy.armorvalue = 0; + T_Damage(self.enemy, self, self, 5000); + + SUB_RemoveSoon(); +} + + +void() void_fall_unplunge = +{ + void_unplunge(self.enemy); +} + +// -------------------------------- +// void_fallthink +// timer for fading out the player's view as he's falling +// -------------------------------- +void() void_fallthink = +{ + local float plummet; + + if ( self.enemy.origin_z > self.oldorigin_z ) + { + // player rose back up out of the pit, mostly convenience for noclipping around + void_fall_unplunge(); + SUB_RemoveSoon(); + return; + } + + if ( self.enemy.movetype == MOVETYPE_NONE ) // has touched the func + { + if (self.pain_finished <= time) + { + void_fall_hitbottom(); + } + else + { + self.think = void_fall_hitbottom; + self.nextthink = self.pain_finished; + } + return; + } + + plummet = (self.enemy.origin_z - self.lip) / self.height; + plummet = 1 - plummet * plummet; // exponential falloff seems to look more linear, since the player accelerates exponentially + plummet = min( ceil( plummet * 255 ), 255); + + TintScreenColor(self.enemy,plummet,self.fadecolor); + + self.nextthink = time + 0.0333; +} + + +// -------------------------------- +// void_trigger_touch +// the is-now-irretrievably-falling trigger +// -------------------------------- +void() void_trigger_touch = +{ + if (!CheckValidTouch()) return; + + if (other.customflags & CFL_PLUNGE) return; // don't touch the trigger a bunch of times on the way down + // we could set a refire time on the trigger but players in coop could go over the edge simultaneously + + if (time > self.attack_finished) + { + activator = other; + SUB_UseTargets(); + self.attack_finished = time + 0.5; + } + + //bprint("waaa\n"); + sound (self, CHAN_VOICE, "player/q3fall.wav", 1, ATTN_NONE); + + other.customflags = other.customflags | CFL_PLUNGE; + + other.weaponmodel = string_null; + + local entity fall; + + fall = spawn(); + fall.classname = "trigger_void"; + fall.deathtype = self.deathtype; + fall.nextthink = time + 0.05; + fall.think = void_fallthink; + fall.enemy = other; + fall.height = self.height; + fall.oldorigin = other.origin; // track player's descent + fall.lip = other.origin_z - self.height; // z at bottom + fall.pain_finished = time + self.wait; + fall.fadecolor = self.fadecolor; +} + + +void() void_find_teleports = +{ + if (self.target == string_null) + return; + + entity head; + head = world; + while (1) + { + head = find(head, targetname, self.target); + if (!head) return; + if (head.classname == "info_teleport_destination") + self.buddy = head; + } +} + + +/*QUAKED func_void (.5 .2 0) ? +for holes into which one should not fall + +Texture this with black (or sky?) and cover the bottom of the pit with it. Automatically offsets its own visual model upward, to hide pesky heads and scrag corpses underneath. Also automatically spawns a start-of-plunge trigger of the same size "height" units above itself that plays a yell sound and fades out the view of clients as they start to fall in. + +Keyvalues +"delay" how long the player should 'fall' before the splat, default 3 +"height" how high above the func_void the plunge trigger should spawn. do not make this high enough that players will touch it without falling in or they'll hear random screaming noises as they walk around and that'll be strange. +"lip" distance to raise the visual model, default 32 +"fadecolor" color to fade the screen to while falling, default black + +Fires all "target"s/"killtarget"s when a client touches the plunge trigger (ie the yell, not the splat). +If the func_void's target is an info_teleport_destination, it will hurt the player for "dmg" damage and teleport him to the destination. If "dmg" is enough to kill the player when he falls in, it continues with the fade and splat as normal. +*/ +/*FGD +@SolidClass base(Target, Appearflags) color(128 50 0) = func_void : +"for holes into which one should not fall +Texture this with black (or sky?) and cover the bottom of the pit with it. Automatically offsets its own visual model upward, to hide pesky heads and scrag corpses underneath. Also automatically spawns a start-of-plunge trigger of the same size 'height' units above itself that plays a yell sound and fades out the view of clients as they start to fall in. +Fires all targets when a client touches the plunge trigger (ie the yell, not the splat). +If the func_void's target is an info_teleport_destination, it will hurt the player and teleport him to the destination. If the damage is enough to kill the player, it continues with the fade and splat as normal without teleporting." +[ + delay(string) : "how long the player should 'fall' before the splat" : "3" + height(integer) : "how high above the func_void the plunge trigger should spawn. do not make this high enough that players will touch it without falling in or they'll hear random screaming noises as they walk around and that'll be strange." + lip(integer) : "distance to raise the visual model" : 32 + fadecolor(string) : "color to fade the screen to while falling" : "0 0 0" +] +*/ +void() func_void = +{ + if (!SUB_ShouldSpawn()) return; + entity trig, ghost; + vector offset; + + precache_sound3("player/q3fall.wav"); + precache_sound3("player/splat1.wav"); + + // set own model to link into world, then set to null to be solid but invisible + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.model); + self.touch = void_func_touch; + + // recycle the same model on a nonsolid entity 32 units higher to hide detritus + if (!self.lip) self.lip = 32; + offset = VEC_UP * self.lip; + ghost = spawn(); + ghost.solid = SOLID_NOT; + ghost.movetype = MOVETYPE_NONE; + setorigin(ghost, offset); + setmodel (ghost, self.model); + ghost.modelindex = self.modelindex; + ghost.classname = "void_ghost"; + + self.model = string_null; + + if (!self.height) self.height = 128; // height above func to spawn plunge trigger + if (!self.delay) self.delay = 3; // time to spend "falling" after touching plunge trigger + + // wait for other things to spawn + self.think = void_find_teleports; + self.nextthink = time + 0.1; + if (!self.dmg) + self.dmg = 60; + + // create another solid entity with the same bounds with solid_trigger as a catch on the way down + trig = spawn(); + trig.movetype = MOVETYPE_NONE; + trig.solid = SOLID_TRIGGER; + trig.owner = self; + trig.buddy = self.buddy; + trig.touch = void_trigger_touch; + trig.height = self.height; + trig.wait = self.delay; // if trigger has 'delay' field it adds a delay to its own usetargets + trig.deathtype = self.deathtype; + trig.fadecolor = self.fadecolor; + + SUB_CopyTargets(trig); + + offset = VEC_UP * self.height; + + setsize (trig, self.mins + offset, self.maxs + offset); +} \ No newline at end of file diff --git a/QC_other/QC_copper/test.qc b/QC_other/QC_copper/test.qc new file mode 100644 index 00000000..0d4cba2d --- /dev/null +++ b/QC_other/QC_copper/test.qc @@ -0,0 +1,23 @@ +void() testspin = +{ + precache_model3("progs/tree.mdl"); + setmodel(self, "progs/tree.mdl"); + + +} + + +void() test_spin6 = +{ + self.movetype = MOVETYPE_NOCLIP; + testspin(); + + self.avelocity = '0 45 0'; +} +void() test_spin7 = +{ + self.movetype = MOVETYPE_FLYMISSILE; + testspin(); + + self.avelocity = '0 -45 0'; +} diff --git a/QC_other/QC_copper/triggers.qc b/QC_other/QC_copper/triggers.qc new file mode 100644 index 00000000..decdc0b2 --- /dev/null +++ b/QC_other/QC_copper/triggers.qc @@ -0,0 +1,1077 @@ +/* +================================================================ + +TRIGGERS + +================================================================ +*/ + +float SPAWNFLAG_NOMESSAGE = 1; +float SPAWNFLAG_NOTOUCH = 1; +float SPAWNFLAG_SUPERSECRET = 2; +float SPAWNFLAG_TRIGGER_FIRST = 4; +float SPAWNFLAG_TRIGGER_TOGGLE = 4; +float SPAWNFLAG_TRIGGER_MONSTERS = 8; + +/*FGD +@baseclass = TriggerSounds +[ + sounds(choices) : "Sounds" : 0 = + [ + 0 : "None" + 1 : "secret" + 2 : "beep beep" + 3 : "large switch" + ] + noise(string) : "Choose wav to play" +] +@baseclass base(AppearFlags, Target, Targetname) = Trigger +[ + spawnflags(Flags) = [ + 4 : "trigger first" + ] + message(string) : "message to display when triggered" +] +@baseclass base(Trigger, TriggerSounds, Angle) = TriggerMulti +[ + health(integer) : "solid, must be killed to activate" + delay(string) : "delay before firing (after trigger)" : "0" + distance(string) : "dot product result to compare 'angle' against" + spawnflags(Flags) = [ + 1 : "notouch" : 0 + 8 : "monsters will fire" : 0 + ] +] +*/ + +void() trigger_reactivate = +{ + self.solid = SOLID_TRIGGER; + self.use = self.think1; + force_retouch = 2; // make sure even still objects get hit +} + +/* +================================ +CheckValidTouch +health and playerhood checks were duplicated everywhere +added noclip check because Quake's default still-touch-everything noclip is awful +================================ +*/ +float() CheckValidTouch = +{ + if (other.classname != "player") + return FALSE; + if (other.health <= 0) + return FALSE; + if (other.movetype == MOVETYPE_NOCLIP) + return FALSE; + return TRUE; +} + + +/* +================ +InitTrigger +================ +*/ +void() InitTrigger = +{ +// trigger angles are used for one-way touches. An angle of 0 is assumed +// to mean no restrictions, so use a yaw of 360 instead. + if (self.angles != '0 0 0') + SetMovedir (); + + // do this first so setmodel links us correctly + self.solid = SOLID_TRIGGER; + setmodel (self, self.model); // set size and link into world + self.movetype = MOVETYPE_NONE; + + if (self.spawnflags & SPAWNFLAG_TRIGGER_FIRST) + { + self.solid = SOLID_NOT; + self.think1 = self.use; + self.use = trigger_reactivate; + } + + self.modelindex = 0; + self.model = string_null; +} + +/* +================ +InitTriggerBounds +quoth2-style edict-saving bounding box triggers +================ +*/ +void() InitTriggerBounds = +{ +// trigger angles are used for one-way touches. An angle of 0 is assumed +// to mean no restrictions, so use a yaw of 360 instead. + + // do this first so setsize links us correctly + self.solid = SOLID_TRIGGER; + setorigin (self, self.origin); + + setsize (self, self.mangle * -0.5, self.mangle * 0.5); + self.mangle = '0 0 0'; // so setMoveDir doesn't think our mangle is our angle + + if (self.angles != '0 0 0') + SetMovedir (); + + if (self.spawnflags & SPAWNFLAG_TRIGGER_FIRST) + { + self.solid = SOLID_NOT; + self.think1 = self.use; + self.use = trigger_reactivate; + } + + self.movetype = MOVETYPE_NONE; +// particle(self.origin - self.mangle, '0 0 0', 232, 4); +// particle(self.origin + self.mangle, '0 0 0', 232, 4); +// self.modelindex = 0; +// self.model = string_null; +} + +/* +================ +InitTriggerSounds +================ +*/ +void() InitTriggerSounds = +{ + if (!self.noise) + { + if (self.sounds == 1) + self.noise = "misc/secret.wav"; + else if (self.sounds == 2) + self.noise = "misc/talk.wav"; + else if (self.sounds == 3) + self.noise = "misc/trigger1.wav"; + } + if (self.noise) + precache_sound (self.noise); +} + +//============================================================================= + +// the wait time has passed, so set back up for another activation +void() multi_wait = +{ + if (self.max_health) + { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + } +} + +// the trigger was just touched/killed/used +// self.enemy should be set to the activator so it can be held through a delay +// so wait for the delay time before firing +float() multi_trigger = +{ + if (self.nextthink > time) + return FALSE; // already been triggered + + if (self.customflags & CFL_LOCKED) + { + dprint(" trigger is locked: not firing\n"); + return FALSE; + } + + activator = self.enemy; + SUB_UseTargets(); + + if (self.noise) + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + if (self.classname == "trigger_secret") + { + secret_use(); + return FALSE; + } + +// don't trigger again until reset + self.takedamage = DAMAGE_NO; + + if (self.wait > 0) + { + self.think = multi_wait; + self.nextthink = time + self.wait; + } + else + { // we can't just remove (self) here, because this is a touch function + // called while C code is looping through area links... + self.touch = SUB_Null; + SUB_RemoveSoon(); + } + + return TRUE; +} + +// trigger_multiples are sometimes used as shootable buttons :( +// most notably the 'well of wishes' secret message in start.bsp +void() multi_killed = +{ + self.enemy = damage_attacker; + if (multi_trigger() ) SUB_PrintMessage(); +} + +void() multi_use = +{ + self.enemy = activator; + if (multi_trigger() ) SUB_PrintMessage(); +} + +void() multi_touch = +{ + if (!CheckValidTouch()) + { + if (other.flags & FL_MONSTER && (other.enemy != world || other.goalentity != world)) + { + if (!(self.spawnflags & SPAWNFLAG_TRIGGER_MONSTERS)) + return; + } + else + return; + } + + // if the trigger has an angles field, check player's facing direction + if (self.movedir != '0 0 0') + { + makevectors (other.v_angle); + if (v_forward * self.movedir < self.distance) + return; // not facing the right way + } + + self.enemy = other; + + if (multi_trigger()) SUB_PrintMessage(); +} + + +/*QUAKED trigger_multiple (.5 .0 .5) ? notouch ? TRIGGER_FIRST MONSTERS +Variable sized repeatable trigger. +Must be targeted at one or more entities. + +Flags: +"notouch" only triggered by other entities, not by touching +"trigger_first" won't be touchable until triggered once by something else +"monsters" monsters will fire this trigger (and count as activator, so be careful) + +Keys: +"angle" the trigger will only fire when someone is facing the direction of the angle, use 360 for angle 0. +"distance" dot product result to compare "angle" against. 0 is 90 degrees off (default), 0.7 is ~45 degrees. +"delay" delay before firing (after trigger) +"health" button must be killed to activate +"message" message to display when triggered +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav +"target" entity to trigger (required) +"targetname" entity name +"wait" delay between triggerings (default: 0.2) +*/ +/*FGD +@SolidClass base(TriggerMulti) = trigger_multiple : "Trigger: Activate multiple" +[ + wait(string) : "Wait before reset" : "0.2" +] +*/ +void() trigger_multiple = +{ + if (!SUB_ShouldSpawn()) return; + InitTriggerSounds(); + + if (!self.wait) + self.wait = 0.2; + self.use = multi_use; + + InitTrigger (); + + if (self.health) + { + if (self.spawnflags & SPAWNFLAG_NOTOUCH) + objerror ("health and notouch don't make sense\n"); + self.max_health = self.health; + self.th_die = multi_killed; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + setorigin (self, self.origin); // make sure it links into the world + } + else + { + if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) ) + { + self.touch = multi_touch; + } + } +} + + +/*QUAKED trigger_multiple_box (.5 .5 0) (-8 -8 -8) (8 8 8) ? ? TRIGGER_FIRST MONSTERS +Quoth2-style cache-saving bounding box triggers: define size with "mangle", as total dimensions in xyz - trigger volume will be that size centered on the trigger_multiple_box's origin. otherwise acts like a normal trigger. + +Flags: +"notouch" only triggered by other entities, not by touching +"trigger_first" won't be touchable until triggered once by something else +"monsters" monsters will fire this trigger (and count as activator, so be careful) + +Keys: +"angle" the trigger will only fire when someone is facing the direction of the angle, use "360" for angle 0. +"distance" dot product result to compare "angle" against. 0 is 90 degrees off (default), 0.7 is 45 degrees. +"delay" delay before firing (after trigger) +"health" button must be killed to activate +"message" message to display when triggered +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav +"target" entity to trigger (required) +"targetname" entity name +"wait" delay between triggerings (default: 0.2) +*/ +/*FGD +@PointClass base(TriggerMulti, Bounds) = trigger_multiple_box : "Trigger: Activate multiple" +[ + wait(string) : "Wait before reset" : "0.2" +] +*/ +void() trigger_multiple_box = +{ + if (!SUB_ShouldSpawn()) return; + InitTriggerSounds(); + + if (!self.wait) + self.wait = 0.2; + self.use = multi_use; + + setorigin (self, self.origin); // make sure it links into the world + InitTriggerBounds (); + + if (self.health) + { + if (self.spawnflags & SPAWNFLAG_NOTOUCH) + objerror ("health and notouch don't make sense\n"); + self.max_health = self.health; + self.th_die = multi_killed; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + } + else + { + if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) ) + { + self.touch = multi_touch; + } + } +} + + +/*QUAKED trigger_once (.5 .0 .5) ? notouch ? TRIGGER_FIRST MONSTERS +Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching "targetname". If notouch is set, the trigger is only fired by other entities, not by touching. + +Wait is always -1. + +Flags: +"notouch" only triggered by other entities, not by touching +"trigger_first" won't be touchable until triggered once by something else +"monsters" monsters will fire this trigger (and count as activator, so be careful) + +Keys: +"angle" the trigger will only fire when someone is facing the direction of the angle, use "360" for angle 0. +"distance" dot product result to compare "angle" against. 0 is 90 degrees off (default), 0.7 is 45 degrees. +"delay" delay before firing (after trigger) +"health" button must be killed to activate +"message" message to display when triggered +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav +"target" entity to trigger (required) +"targetname" entity name +*/ +/*FGD +@SolidClass base(TriggerMulti) = trigger_once : "Trigger: Activate once" [] +*/ +void() trigger_once = +{ + self.wait = -1; + trigger_multiple(); +} + +//============================================================================= + + + +/*FGD +@baseclass = Secret +[ + spawnflags(flags) = [ + 2 : "Supersecret" : 0 + ] + sounds(choices) : "Sounds" : 1 = + [ + 0 : "None" + 1 : "secret" + 2 : "beep beep" + 3 : "large switch" + ] + message(string) : "Message" +] +*/ +void() target_secret_use = +{ + if (self.noise) + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + + secret_use(); +} + +void() secret_use = +{ + if (activator.classname != "player") + return; + + if (self.spawnflags & SPAWNFLAG_SUPERSECRET) + { + // super secrets aren't counted toward the total until found + total_secrets = total_secrets + 1; + WriteByte (MSG_ALL, SVC_UPDATESTAT); + WriteByte (MSG_ALL, STAT_TOTALSECRETS); + WriteLong (MSG_ALL, total_secrets); + } + + found_secrets = found_secrets + 1; + WriteByte (MSG_ALL, SVC_FOUNDSECRET); + + SUB_PrintMessage(); +// sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + self.touch = SUB_Null; + SUB_RemoveSoon(); +} + + +void() trigger_secret_setup = +{ + if (!(self.spawnflags & SPAWNFLAG_SUPERSECRET)) + { + // super secrets aren't counted toward the total until found + total_secrets = total_secrets + 1; + } + self.spawnflags = not(self.spawnflags, SPAWNFLAG_TRIGGER_MONSTERS); // jic of old stale spawnflags 8 + + self.wait = -1; + self.classname = "trigger_secret"; + if (self.message == string_null) + { + if (self.spawnflags & SPAWNFLAG_SUPERSECRET) + self.message = "You found a \bvery\b secret area!"; + else + self.message = "You found a secret area!"; + + } + if (!self.sounds) + self.sounds = 1; + + InitTriggerSounds(); +} + +void() target_secret_check = +{ + // sanity check for dumb mappers like me + entity w; + w = find(world, target, self.targetname); + if (w) + { + if (w.type == "ammo" || + // ( w.type == "armor" && w.classname != "item_armorpatch") || + ( w.type == "health" && !(w.spawnflags & 2)) ) + objerror("target_secret targeted by something the player might not be able to grab\n"); + } +} + +/*QUAKED target_secret (.5 .0 .5) (-8 -8 -8) (8 8 8) ? SUPERSECRET +Secret counter trigger. Player gets a secret credit when triggered. Note when using a target_secret: if the item can't be picked up (because of health/armor/ammo limits already being met, etc), it won't fire its targets and thus the target_secret won't give credit. Use a trigger in that case. + +Set "SUPERSECRET" to hide its existence in the total until it's found. +Keys: +"message" message to display when triggered +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav +*/ +/*FGD +@PointClass base(Secret) = target_secret : "Target : Secret +Counts as a secret, trigger to give credit" [] +*/ +void() target_secret = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch) { remove(self); return; } + trigger_secret_setup(); + self.use = target_secret_use; + + self.think = target_secret_check; + self.nextthink = time + 0.2; +} + +/*QUAKED trigger_secret (.5 .0 .5) ? ? SUPERSECRET TRIGGER_FIRST +Secret counter trigger. Player gets a secret credit when touched. Set "SUPERSECRET" to hide its existence in the total until found. +Keys: +"message" message to display when triggered +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav + +Flags: +"SUPERSECRET" hide its existence in the total until it's found +"trigger_first" won't be touchable until triggered once by something else +*/ +/*FGD +@SolidClass base(Trigger, Secret) = trigger_secret : "Trigger : Secret +Counts as a secret, trigger to give credit" [] +*/ +void() trigger_secret = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch) { remove(self); return; } + trigger_multiple (); + trigger_secret_setup(); +} + +/*QUAKED trigger_secret_box (.5 .0 .5) (-8 -8 -8) (8 8 8) ? SUPERSECRET TRIGGER_FIRST +Secret counter trigger. Player gets a secret credit when touched. Set "SUPERSECRET" to hide its existence in the total until found. + +Quoth2-style edict-saving bounding box trigger: define size with "mangle", trigger volume will be that size centered on the trigger_secret_box's origin. + +Keys: +"message" message to display when triggered +"sounds" + 1 = secret + 2 = beep beep + 3 = large switch + 4 = it is a mysteryyy + -1 = silent +"noise" choose your own .wav + +Flags: +"SUPERSECRET" hide its existence in the total until it's found +"trigger_first" won't be touchable until triggered once by something else +*/ +/*FGD +@PointClass base(Trigger, Secret, Bounds) = target_secret : "Trigger : Secret +Counts as a secret, trigger to give credit" [] +*/ +void() trigger_secret_box = +{ + if (!SUB_ShouldSpawn()) return; + if (deathmatch) { remove(self); return; } + trigger_multiple_box (); + trigger_secret_setup(); +} + + +//============================================================================= + + + +/* +============================================================================== +trigger_setskill & target_setskill + +I have a trigger_ and a target_ for setskill and route both through one function, +so that the skill teleporters themselves in the start map can be the 'barrier' +that changes the skill. nightmare changes max health, and I want players to see +it change on the hud the instant they make their 'selection' by entering the +teleporter, not at the start of the next map. +============================================================================== +*/ + +void(float h) skill_adjust_health = +{ + entity p; + p = find(world, classname, "player"); + while (p) + { + p.max_health = h; + if (p.health > p.max_health) + { + p.deathtype = "noarmor"; + T_Damage(p, world, world, p.health - p.max_health); + p.deathtype = ""; + } + else if (p.health < p.max_health) + { + T_Heal(p, p.max_health - p.health, FALSE); + } + p = find(p, classname, "player"); + } +} + +void(entity e, string sk) skill_set = +{ + if (sk == "0" || sk == "1" || sk == "2" || sk == "") + { + skill_adjust_health(100); + } + else if (sk == "3") + { + skill_adjust_health(50); + } + + cvar_set ("skill", sk); + skill = cvar("skill"); +} + +void() target_setskill_use +{ + skill_set(activator, self.message); +} + +/*FGD +@baseclass = Setskill [ + message(choices) : "Skill" : 0 = [ + 0 : "Easy" + 1 : "Normal" + 2 : "Hard" + 3 : "NIGHTMAAARE" + ] +] +*/ + +/*QUAKED target_setskill (.5 .0 .5) (-8 -8 -8) (8 8 8) +Sets skill level to the value of "message". Only used on start map. + +Keys: +"message" + sets skill level + 0 = easy + 1 = normal + 2 = hard + 3 = nightmare +*/ +/*FGD +@PointClass base(Setskill, Targetname) = target_setskill : "Target: Set Skill" [] +*/ +void() target_setskill = +{ + self.use = target_setskill_use; +} + +void() trigger_skill_touch = +{ + if (!CheckValidTouch()) return; + if (self.customflags & CFL_LOCKED) return; + + skill_set(other, self.message); +} + +/*QUAKED trigger_setskill (.5 .0 .5) ? ? ? TRIGGER_FIRST +Sets skill level to the value of "message". Only used on start map. + +Flags: +"trigger_first" won't be touchable until triggered once by something else + +Keys: +"message" + sets skill level + 0 = easy + 1 = normal + 2 = hard + 3 = nightmare + 4 = helllll +*/ +/*FGD +@PointClass base(Setskill, Trigger) = trigger_setskill : "Trigger: Set Skill" [] +*/ +void() trigger_setskill = +{ + if (!SUB_ShouldSpawn()) return; + InitTrigger (); + self.touch = trigger_skill_touch; +} + + +//============================================================================ + +void() trigger_onlyregistered_touch = +{ + if (!CheckValidTouch()) return; + if (self.attack_finished > time) + return; + + self.attack_finished = time + 2; + if (cvar("registered")) + { + self.message = string_null; + activator = other; + SUB_UseTargets (); + remove (self); + } + else + { + if (self.message != string_null) + { + centerprint (other, self.message); + sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); + } + } +} + +/*QUAKED trigger_onlyregistered (.5 .5 .5) ? +Only fires if playing the registered version, otherwise prints the message +*/ +/*FGD +@SolidClass base(Trigger) = trigger_onlyregistered : "Trigger: Registered only" [] +*/ +void() trigger_onlyregistered = +{ + precache_sound ("misc/talk.wav"); + InitTrigger (); + self.touch = trigger_onlyregistered_touch; +} + + + + +//============================================================================ + +void() hurt_on = +{ + self.solid = SOLID_TRIGGER; + self.nextthink = -1; +} + +void() hurt_touch = +{ + if (!CheckValidTouch()) return; + if (self.customflags & CFL_LOCKED) return; + if (!other.takedamage) + return; + if ((self.spawnflags & 4) && (other.flags & FL_MONSTER)) + return; + if ((self.spawnflags & 2) && (other.radsuit_finished > time)) + return; + + // fix for multiple coop clients touching this at once only hurting the first one + if (time != self.dmgtime) + if (time < self.attack_finished) + return; + + if (self.spawnflags & 1) + { + T_Damage (other, self, self, other.health + min(other.armorvalue, other.health / other.armortype) + 5); + } + else + T_Damage (other, self, self, self.dmg); + + self.dmgtime = time; + self.attack_finished = time + self.delay; +} + +/*FGD +@baseclass base(Trigger) = Hurt [ + spawnflags(flags) = [ + 1 : "Kill" : 0 + 2 : "Biosuit Immune" : 0 + 8 : "Won't Hurt Monsters" : 0 + ] + dmg(integer) : "Damage" : 5 + delay(string) : "Interval" : "1" +] +*/ + +/*QUAKED trigger_hurt (.5 .0 .5) ? KILL NO_BIOSUIT TRIGGER_FIRST NO_MONSTERS +any entity touching this will be hurt / to see if it still feels + +Keys: +"dmg" sets damage, default is 5 +"delay" frequency of damage in seconds, default 1 + +Flags: +"kill" always do enough damage to kill instantly +"no_biosuit" the biosuit protects against this trigger +"trigger_first" won't be touchable until triggered once by something else +"no_monsters" trigger will only hurt players +*/ +/*FGD +@SolidClass base(Hurt) = trigger_hurt : "Trigger: Hurt" [] +*/ +void() trigger_hurt = +{ + if (!SUB_ShouldSpawn()) return; + InitTrigger (); + self.touch = hurt_touch; + if (!self.dmg) + self.dmg = 5; + if (!self.delay) + self.delay = 1; +} + +/*QUAKED trigger_hurt_box (.5 .0 .5) (-8 -8 -8) (8 8 8) ? ? TRIGGER_FIRST +Any object touching this will be hurt. +Quoth2-style edict-saving bounding box trigger: define bounds size with "mangle" - trigger volume will be centered on the trigger_hurt_box's origin. +Resist the urge to put a tiny one of these on every light_flame. + +Keys: +"dmg" sets damage, default is 5 +"delay" frequency of damage in seconds, default 1 + +Flags: +"trigger_first" won't be touchable until triggered once by something else +*/ +/*FGD +@PointClass base(Hurt,Bounds) = trigger_hurt_box : "Trigger: Hurt bounds" [] +*/ +void() trigger_hurt_box = +{ + if (!SUB_ShouldSpawn()) return; + InitTriggerBounds (); + self.touch = hurt_touch; + if (!self.dmg) + self.dmg = 5; + if (!self.delay) + self.delay = 1; + self.classname = "trigger_hurt"; +} + + + +//============================================================================ + +float PUSH_ONCE = 1; +float PUSH_ADD_VEL = 2; + +void() trigger_push_touch = +{ + if (other.movetype == MOVETYPE_NOCLIP) + return; + if (self.customflags & CFL_LOCKED) + return; + else if (other.health > 0 || other.classname == "grenade") + { + if (self.spawnflags & PUSH_ADD_VEL) + other.velocity += self.speed * self.movedir; + else + other.velocity = self.speed * self.movedir * 10; + if (other.classname == "player") + { + if (other.nextmovesound < time) + { + other.nextmovesound = time + 1.5; + sound (other, CHAN_AUTO, "ambience/windfly.wav", 1, ATTN_NORM); + } + } + } + if (self.spawnflags & PUSH_ONCE) + remove(self); +} + + +/*QUAKED trigger_push (.5 .0 .5) ? PUSH_ONCE ADD_VEL TRIGGER_FIRST +Pushes the player and Grenades. + +Flags: +"push_once" removes itself after firing +"trigger_first" won't be touchable until triggered once by something else + +Keys: +"angle" direction of push (-2 is down, -1 up) +"speed" speed of push (default: 1000) +*/ +/*FGD +@SolidClass base(Angle, Trigger) = trigger_push : "Trigger: Push" +[ + spawnflags(flags) = [ 1: "Push once" : 0 ] + speed(integer) : "Speed" : 1000 +] +*/ +void() trigger_push = +{ + if (!SUB_ShouldSpawn()) return; + if (self.angles == '0 0 0') + self.angles = '0 360 0'; + + InitTrigger (); + precache_sound ("ambience/windfly.wav"); + self.touch = trigger_push_touch; + if (!self.speed) + self.speed = 1000; +} + + +//============================================================================ + +float SPAWN_MJUMP_NOLARGE = 1; +float SPAWN_MJUMP_NOSMALL = 2; +float SPAWN_MJUMP_MELEES = 8; +float SPAWN_MJUMP_ONLYFRONT = 16; +float SPAWN_MJUMP_ONLYBELOW = 32; +float SPAWN_MJUMP_ADDVEL = 64; + +void() trigger_monsterjump_touch = +{ + vector dir; + + if (self.customflags & CFL_LOCKED) return; + if ( other.flags & (FL_MONSTER | FL_FLY | FL_SWIM) != FL_MONSTER ) + return; + if (time < self.attack_finished) + return; + + // filtration + if (other.classname != self.include) // always allow this classname + { + if (self.spawnflags & SPAWN_MJUMP_NOLARGE && other.maxs_x == 32) return; + if (self.spawnflags & SPAWN_MJUMP_NOSMALL && other.maxs_x == 16) return; + if (self.spawnflags & SPAWN_MJUMP_MELEES && !(other.customflags & CFL_MELEEONLY)) return; + + if (self.exclude == other.classname) return; // always exclude this classname + } + if (self.spawnflags & SPAWN_MJUMP_ONLYBELOW && (other.enemy.absmin_z) >= (other.absmin_z)) return; + if (self.spawnflags & SPAWN_MJUMP_ONLYFRONT) + { + dir = other.enemy.origin - other.origin; + dir_z = 0; + dir = normalize(dir); + if (dir * self.movedir < self.distance) + return; + } + + self.attack_finished = time + self.wait; + // set XY even if not on ground, so the jump will clear lips + if (self.spawnflags & SPAWN_MJUMP_ADDVEL) + { + other.velocity_x += self.movedir_x * self.speed; + other.velocity_y += self.movedir_y * self.speed; + } + else + { + other.velocity_x = self.movedir_x * self.speed; + other.velocity_y = self.movedir_y * self.speed; + } + + if ( !(other.flags & FL_ONGROUND) ) + { + if (self.spawnflags & SPAWN_MJUMP_ADDVEL) + other.velocity_z += self.height; + else + return; + } + + other.flags = not(other.flags, FL_ONGROUND); + other.velocity_z = self.height; +} + +void() trigger_monsterjump_init = +{ + self.speed = zeroconvertdefault(self.speed, 200); + self.height = zeroconvertdefault(self.height, 200); + if (!self.distance) + self.distance = 0.5; + if (self.angles == '0 0 0') + self.angles = '0 360 0'; + self.touch = trigger_monsterjump_touch; +} + +/*QUAKED trigger_monsterjump (.5 .0 .5) ? NO_LARGE NO_SMALL TRIGGER_FIRST ONLY_MELEES ONLY_FRONT ONLY_BELOW ADD_VEL +Walking monsters that touch this will jump in the direction of the trigger's angle. + +Flags: +NO_LARGE only monsters with 32x32 bounds +NO_SMALL only monsters with 64x64 bounds +TRIGGER_FIRST won't be touchable until triggered once by something else +ONLY_MELEES only monsters with no ranged attack (dogs/fiends/spawns) +ONLY_FRONT will only trigger if monster's enemy is in front of the monster relative to jump angle +ONLY_BELOW will only trigger if monster's enemy is below the monster +ADD_VEL add velocity to monster rather than setting it + +Keys: +"angle" angle towards the monster jumps +"height" the speed thrown upwards (default: 200) +"speed" the speed thrown forward (default: 200) +"target" entity to trigger +"targetname" entity name +"include" allow this classname of monster no matter what +"exclude" exclude this classname of monster no matter what +*/ +/*FGD +@baseclass base(Trigger, Angle) = Monsterjump [ + spawnflags(flags) = [ + 1 : "No large monsters" : 0 + 2 : "No small monsters" : 0 + 8 : "Only melee monsters" : 0 + 16 : "Only if target in front" : 0 + 32 : "Only if target below" : 0 + 64 : "Additive push" : 0 + ] + speed(integer) : "Jump Speed" : 200 + height(integer) : "Jump Height" : 200 + include(string) : "allow this classname of monster no matter what" + exclude(string) : "exclude this classname of monster no matter what" +] +@SolidClass base(Monsterjump) = trigger_monsterjump : "Trigger: Monster jump" [] +*/ +void() trigger_monsterjump = +{ + if (!SUB_ShouldSpawn()) return; + trigger_monsterjump_init(); + InitTrigger(); +} + + +/*QUAKED trigger_monsterjump_box (.5 .0 .5) (-8 -8 -8) (8 8 8) NO_LARGE NO_SMALL TRIGGER_FIRST ONLY_MELEES ONLY_FRONT ONLY_BELOW ADD_VEL +Walking monsters that touch this will jump in the direction of the trigger's angle. +Quoth2-style edict-saving bounding box trigger: define bounds size with "mangle" - trigger volume will be centered on the trigger_monsterjump_box's origin. + +Flags: +NO_LARGE only monsters with 32x32 bounds +NO_SMALL only monsters with 64x64 bounds +TRIGGER_FIRST won't be touchable until triggered once by something else +ONLY_MELEES only monsters with no ranged attack (dogs/fiends/spawns) +ONLY_FRONT will only trigger if monster's enemy is in front of the monster relative to jump angle +ONLY_BELOW will only trigger if monster's enemy is below the monster +ADD_VEL add velocity to monster rather than setting it + +Keys: +"angle" angle towards the monster jumps +"height" the speed thrown upwards (default: 200) +"speed" the speed thrown forward (default: 200) +"target" entity to trigger +"targetname" entity name +"include" allow this classname of monster no matter what +"exclude" exclude this classname of monster no matter what +*/ +/*FGD +@PointClass base(Monsterjump, Bounds) = trigger_monsterjump_box : "Trigger: Monster jump bounds" [] +*/ +void() trigger_monsterjump_box = +{ + if (!SUB_ShouldSpawn()) return; + trigger_monsterjump_init(); + InitTriggerBounds(); + self.classname = "trigger_monsterjump"; +} + diff --git a/QC_other/QC_copper/utility.qc b/QC_other/QC_copper/utility.qc new file mode 100644 index 00000000..8c2eb7af --- /dev/null +++ b/QC_other/QC_copper/utility.qc @@ -0,0 +1,519 @@ + +void(string s, string ss) bprint2 = + { bprint(s); bprint(ss); } +void(string s, string ss, string sss) bprint3 = + { bprint(s); bprint(ss); bprint(sss); } +void(string s, string ss, string sss, string ssss) bprint4 = + { bprint(s); bprint(ss); bprint(sss); bprint(ssss); } +void(string s, string ss, string sss, string ssss, string sssss) bprint5 = + { bprint(s); bprint(ss); bprint(sss); bprint(ssss); bprint(sssss); } + +void(string s, string ss) dprint2 = + { dprint(s); dprint(ss); } +void(string s, string ss, string sss) dprint3 = + { dprint(s); dprint(ss); dprint(sss); } +void(string s, string ss, string sss, string ssss) dprint4 = + { dprint(s); dprint(ss); dprint(sss); dprint(ssss); } +void(string s, string ss, string sss, string ssss, string sssss) dprint5 = + { dprint(s); dprint(ss); dprint(sss); dprint(ssss); dprint(sssss); } + + +void(string s) centerprintall = +{ + entity e; + e = find(world, classname, "player"); + + while (e != world) + { + centerprint(e, s); + e = find(e, classname, "player"); + } +} + +//============================================================================ + +// findradius only works on solid entities, because apparently it's only for explosions +entity(vector point, float rad, .string fld, string match) findradiusplus = +{ + entity head, prev; + prev = world; + head = find(world, fld, match); + + float found = 0; + + while(head) + { + if ( vlen(point - head.origin) <= rad ) + { + head.chain = prev; + prev = head; + found += 1; + } + head = find(head, fld, match); + } + return prev; +} + + +// just find every damn thing targeted by 'src' and return it as head.chain +// targets will be primarily in order by target/2/3/4, and secondarily by spawn order +// so 'target's always come before 'target2's in the chain, etc +entity(entity src) findalltargets = +{ + // WARNING: do not use this in the context of actually triggering targets. + // an entity triggering down an active .chain of targets could trigger one + // which itself calls findalltargets to do the same, which could blow away + // the existing chain. + entity head, f, prev; + head = world; + f = world; + prev = world; + + if (src.target != string_null) + { + f = find(world, targetname, src.target); + while(f) + { + if (!head) head = f; // mark the start location + if (prev) + prev.chain = f; // connect the end of the chain + prev = f; + f = find(f, targetname, src.target); + } + } + if (src.target2 != string_null) + { + f = find(world, targetname, src.target2); + while(f) + { + if (!head) head = f; + if (prev) + prev.chain = f; + prev = f; + f = find(f, targetname, src.target2); + } + } + if (src.target3 != string_null) + { + f = find(world, targetname, src.target3); + while(f) + { + if (!head) head = f; + if (prev) + prev.chain = f; + prev = f; + f = find(f, targetname, src.target3); + } + } + if (src.target4 != string_null) + { + f = find(world, targetname, src.target4); + while(f) + { + if (!head) head = f; + if (prev) + prev.chain = f; + prev = f; + f = find(f, targetname, src.target4); + } + } + + prev.chain = world; // don't link to stale chains + return head; +} + +// findalltargets, but in reverse: returns a chain of all entities that target dst +entity(entity dst) findalltargeters = +{ + if (dst.targetname == string_null) + return world; + + entity head, f, prev; + head = world; + f = world; + prev = world; + + f = find(world, target, dst.targetname); + while(f) + { + if (!head) head = f; // mark the start location + if (prev) + prev.chain = f; // connect the end of the chain + prev = f; + f = find(f, target, dst.targetname); + } + + f = find(world, target2, dst.targetname); + while(f) + { + if (!head) head = f; + if (prev) + prev.chain = f; + prev = f; + f = find(f, target2, dst.targetname); + } + + f = find(world, target3, dst.targetname); + while(f) + { + if (!head) head = f; + if (prev) + prev.chain = f; + prev = f; + f = find(f, target3, dst.targetname); + } + + f = find(world, target4, dst.targetname); + while(f) + { + if (!head) head = f; + if (prev) + prev.chain = f; + prev = f; + f = find(f, target4, dst.targetname); + } + + prev.chain = world; // don't link to stale chains + return head; +} + +entity(entity start, .string fld, string match) findunlocked = +{ + entity head; + float found = FALSE; + head = find(start, fld, match); + while (head) + { + if (!(head.customflags & CFL_LOCKED)) + break; + head = find(head, fld, match); + } + return head; +} + +entity(entity start) findunlockedtarget = +{ + entity head = world; + if (self.target != string_null) + head = findunlocked(start, targetname, self.target); + if (head) return head; + + if (self.target2 != string_null) + head = findunlocked(start, targetname, self.target2); + if (head) return head; + + if (self.target3 != string_null) + head = findunlocked(start, targetname, self.target3); + if (head) return head; + + if (self.target4 != string_null) + return findunlocked(start, targetname, self.target4); + return world; +} + + +/* +i've brought over the quoth convention of letting mappers set the 'model' key on func_* +to override an entity's model with something external, which must be precached, but that +collides with the existing use of the model keyvalue, and also causes precache-out-of-turn +errors on maps with map hacks like mce.bsp + +however, if the entity already has a modelindex, it already has a model internal to the +bsp and precache should never be called no matter what time it is. +*/ +void(string s) precache_safe_model = { if (s != string_null && !self.modelindex) precache_model2(s); } + +/* +failed precaches still prevent the map from loading in most engines. put all mod-related +precaches through these wrappers so they can be easily turned off, in the event you want +to send small test builds to engine programmers to show them bugs without having to +build and package your entire mod. +*/ +void(string s) precache_model3 = { precache_model2(s); } +void(string s) precache_sound3 = { precache_sound2(s); } +/* +void(string s) precache_model3 = { return; } +void(string s) precache_sound3 = { return; } +*/ + + +// shorthand for turning -1 to 0 for keyvalues for which 0 is a valid non-default selection +float(float in) zeroconvert = +{ + if (in == -1) return 0; + return in; +} +float(float in, float def) zeroconvertdefault = +{ + if (in == -1) return 0; + if (in == 0) return def; + return in; +} + + + + +// ================================ +// Frustum/Box Tests +// ================================ + +vector(entity e) BoundsCenter = +{ + return 0.5 * ( e.absmin + e.absmax ); +} + +vector(entity e) BoundsBottom = +{ + vector out; + out = 0.5 * ( e.absmin + e.absmax ); + out_z = e.absmin_z; + return out; +} + +// for measuring how large an entity is along an arbitrary vector +// FIXME: this is trash and it returns trash +float(vector v, vector s) BoundsAngleSize = +{ + v_x = fabs(v_x); + v_y = fabs(v_y); + v_z = fabs(v_z); + + // size is always + + + but this is in case I switch the parameters somewhere + s_x = fabs(s_x); + s_y = fabs(s_y); + s_z = fabs(s_z); + + return v * s; +} + +float (vector e1mins, vector e1maxs, vector e2mins, vector e2maxs, float pad) BoundsTouching = +{ + if (e1mins_x > e2maxs_x + pad) return FALSE; + if (e1mins_y > e2maxs_y + pad) return FALSE; + if (e1mins_z > e2maxs_z + pad) return FALSE; + if (e1maxs_x < e2mins_x - pad) return FALSE; + if (e1maxs_y < e2mins_y - pad) return FALSE; + if (e1maxs_z < e2mins_z - pad) return FALSE; + return TRUE; +} + +// moved from doors +float (entity e1, entity e2) EntitiesTouching = +{ + return BoundsTouching(e1.absmin, e1.absmax, e2.absmin, e2.absmax, 0); +} + +float(vector org, float hside, vector point) BoundingCubeTest = +{ + if (point_x > org_x + hside) return FALSE; + if (point_x < org_x - hside) return FALSE; + if (point_y > org_y + hside) return FALSE; + if (point_y < org_y - hside) return FALSE; + if (point_z > org_z + hside) return FALSE; + if (point_z < org_z - hside) return FALSE; + return TRUE; +} + +float(vector planeN, float planeD, vector point) PlaneTest = +{ + return point * planeN - planeD; +} + +float(vector planeN, float planeD, vector mn, vector mx) BoxPlaneTest = +{ + local float outCount; + + outCount = 0; + + // you know what's cool? arrays. + if (PlaneTest(planeN, planeD, Vector(mn_x, mn_y, mn_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mx_x, mn_y, mn_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mn_x, mx_y, mn_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mx_x, mx_y, mn_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mn_x, mn_y, mx_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mx_x, mn_y, mx_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mn_x, mx_y, mx_z)) <= 0) outCount++; + if (PlaneTest(planeN, planeD, Vector(mx_x, mx_y, mx_z)) <= 0) outCount++; + + dprint(": "); + dprint(ftos(outCount)); + dprint(" "); + + return outCount; +} + +float(entity observer, float fov, vector mn, vector mx) FrustumCheck = +{ + local vector vorg; + vorg = observer.origin + observer.view_ofs; + makevectors(observer.v_angle); + + // assume vertical fov is at most 3/4 hfov, because nobody plays quake in a square window + local float hfov, vfov; + hfov = fov * 0.6; + vfov = fov * 0.45; // was 0.5/0.375 + // added a 20% buffer because engines like mk5 and quakespasm have added "correction" + // so now hfov can't be trusted to just be the actual fucking fov anymore + + local float bpt, hc, hs, vc, vs; + local vector temp, side0n, side1n, side2n, side3n, side4n; + local float side0d, side1d, side2d, side3d, side4d; + + temp = SinCos(hfov); + hs = temp_x; + hc = temp_y; + + temp = SinCos(vfov); + vs = temp_x; + vc = temp_y; + + // determine frustum planes one at a time, starting with near, then left/right, then top/bottom + // far plane isn't really necessary + side0n = v_forward; + side0d = vorg * side0n; + dprint("NR"); + bpt = BoxPlaneTest(side0n, side0d, mn, mx); + if (bpt == 8) return 0; + + side1n = v_forward * hs + v_right * hc; + side1d = vorg * side1n; + dprint("LF"); + bpt = BoxPlaneTest(side1n, side1d, mn, mx); + if (bpt == 8) return 0; + + side2n = v_forward * hs - v_right * hc; + side2d = vorg * side2n; + dprint("RT"); + bpt = BoxPlaneTest(side2n, side2d, mn, mx); + if (bpt == 8) return 0; + + side3n = v_forward * vs + v_up * vc; + side3d = vorg * side3n; + dprint("DN"); + bpt = BoxPlaneTest(side3n, side3d, mn, mx); + if (bpt == 8) return 0; + + side4n = v_forward * vs - v_up * vc; + side4d = vorg * side4n; + dprint("UP"); + bpt = BoxPlaneTest(side4n, side4d, mn, mx); + if (bpt == 8) return 0; + + return 1; +} + + + + + +// the following amazing pollution is by czg + +/* +============= +stuffcmd_float + +This is a horrible hack that I am ashamed of! +=============== +*/ +void stuffcmd_digit( entity client, float f) = +{ + float d; + d = floor(f); + d = mod(d, 10); + + //CLOSE YOUR EYES, HONEY! DON'T LOOK! + if(d == 0) + stuffcmd(client, "0"); + else if(d == 1) + stuffcmd(client, "1"); + else if(d == 2) + stuffcmd(client, "2"); + else if(d == 3) + stuffcmd(client, "3"); + else if(d == 4) + stuffcmd(client, "4"); + else if(d == 5) + stuffcmd(client, "5"); + else if(d == 6) + stuffcmd(client, "6"); + else if(d == 7) + stuffcmd(client, "7"); + else if(d == 8) + stuffcmd(client, "8"); + else if(d == 9) + stuffcmd(client, "9"); +} + +void stuffcmd_int( entity client, float f, float numdigits) = +{ + + float tmp; + + + if(f == 0) + { + stuffcmd( client, "0"); + return; + } + + if(f < 0) + { + // Yeah sure. + stuffcmd( client, "-"); + f = fabs(f); + } + + if(numdigits <= 0) + { + tmp = f; + numdigits = 1; + while(tmp >= 1){ + tmp = tmp / 10; + numdigits = numdigits * 10; + } + } + + //I don't know what I'm thinking here... + //I need to do this to get zero-padding to work. + + while( numdigits > 1 ) + { + numdigits = numdigits / 10; + tmp = f / numdigits; + stuffcmd_digit( client, tmp); + } +} + +void stuffcmd_float( entity client, float f) = +{ + float intpart, decpart, isNegative; + + isNegative = FALSE; + + if(f == 0) + { + stuffcmd( client, "0"); + return; + } + + if(f < 0) + { + // easier this way + isNegative = TRUE; + f = fabs(f); + } + + // 1: stuff the integer part. + intpart = floor(f); + if(isNegative) + stuffcmd( client, "-"); + stuffcmd_int( client, intpart, 0); + + // 2: stuff the decimal point. + stuffcmd( client, "."); + + // 3: stuff the decimal part. + decpart = mod( f, 1); + decpart = decpart * 10000; + stuffcmd_int( client, decpart, 10000); +} diff --git a/QC_other/QC_copper/w_axe.qc b/QC_other/QC_copper/w_axe.qc new file mode 100644 index 00000000..5086513b --- /dev/null +++ b/QC_other/QC_copper/w_axe.qc @@ -0,0 +1,142 @@ +/* +=============== + +THE AXE + +=============== +*/ + +// SOUNDS + +void() W_AxeWhiffSound = +{ + sound (self, CHAN_OTHER, "weapons/ax1.wav", 1, ATTN_NORM); +} + +void() W_AxeHitSound = +{ + if (random() < 0.5) + sound (self, CHAN_WEAPON, "weapons/axhit1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "weapons/axhit2.wav", 1, ATTN_NORM); +} + + +void(float foff) W_AxeCycle = +{ + // lip and touch_time are overloaded on the player for animation event timing + // lip = 10fps player anim clock (axe animates at 20 so player has to think on 20s) + // touch_time = timer for the actual weapon attack trace event + self.weaponframe = min(57, self.weaponframe + foff); + + // entire axe swing anim is scheduled to be done by now + if (self.attack_finished <= time) + { + // stop the player anim cycle and restore normal thinking + W_SetIdleWeaponFrame(); + player_run(); + return; + } + + if (self.touch_time && self.touch_time <= time) + { + self.touch_time = 0; + W_FireAxe(); + } + + // time for a regular animation think + else if (self.lip <= time) + { + self.think1(); // advance the player anim on the standard 10fps clock + self.lip = time + 0.1; + } + self.nextthink = time + 0.05; +} + +void() W_AxeThink = { self.think = W_AxeThink; W_AxeCycle(1); } +void() W_AxeThinkReverse = { self.think = W_AxeThinkReverse; W_AxeCycle(-1); } + +void() W_AxeSwing = +{ + W_AxeWhiffSound(); + self.weaponframe = 10 * (floor(4.99 * random())); + self.touch_time = time + 0.1; + self.attack_finished = time + 0.49; + self.think1 = player_axe; + W_AxeThink(); +} + + +/* +================ +W_FireAxe +================ +*/ +void() W_FireAxe = +{ + vector source, org; + if (self.health <= 0) + return; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + + // for ai_nav: + //if (nav_w_nodeNudge()) return; + + + traceline2(source, source + v_forward * (64), self, 0); + if (trace_fraction == 1.0) + return; + + self.show_hostile = time + 1; // wake monsters up + + org = trace_endpos - v_forward*4; + + if (trace_ent.takedamage) + { + trace_ent.customflags = trace_ent.customflags | CFL_AXEHITME; + SpawnBlood (org, '0 0 0', 20); + + if (trace_ent.type == "zombie") + zombie_knockdown(trace_ent); + + T_Damage (trace_ent, self, self, 24); + + if (trace_ent.flags & FL_MONSTER) + { + W_AxeHitSound(); + } + else + { + sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_IDLE); + } + + // do knockback with a quad + if (self.super_damage_finished > time) + { + if ((trace_ent.movetype == MOVETYPE_STEP || trace_ent.movetype == MOVETYPE_WALK) && + // don't swat bosses or other non-standard-sized enemies around + trace_ent.maxs_x <= 32 && trace_ent.health > 0 && trace_ent.type != "boss") + { + local vector toss; + toss = v_forward; + toss_z = 0; + toss = normalize(toss) * 400; + toss_z = 100; + //bprint(vtos(toss)); + //bprint("\n"); + //toss *= - vlen(head.maxs - head.mins) + trace_ent.origin_z = trace_ent.origin_z + 1; + trace_ent.velocity = toss; + trace_ent.flags = not(trace_ent.flags, FL_ONGROUND); + } + } + } + else + { // hit wall + sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); + gunshot(org); + } +} + diff --git a/QC_other/QC_copper/w_lightning.qc b/QC_other/QC_copper/w_lightning.qc new file mode 100644 index 00000000..bc42fdcf --- /dev/null +++ b/QC_other/QC_copper/w_lightning.qc @@ -0,0 +1,205 @@ + +/* +=============== + +LIGHTNING + +=============== +*/ + +/* +================= +LightningDamage +================= +*/ + +void(entity from, float damage, float multi) LightningMultiDamage_Do = +{ + //if (trace_ent.classname == "monster_enforcer") + // trace_ent.armorvalue = 0; + particle (trace_endpos, '0 0 100', 225, damage*4); + trace_ent.customflags |= CFL_ZAPPED; + if (multi) AddMultiDamage (trace_ent, damage); + else T_Damage (trace_ent, from, from, damage); + if (self.classname == "player") + { + if (trace_ent.classname == "player") + trace_ent.velocity_z += 400; + } +} + +void(vector p1, vector p2, entity from, float damage, float multi) LightningMultiDamage = +{ + local entity e1, e2; + local vector f; + + f = p2 - p1; + normalize (f); + f_x = 0 - f_y; + f_y = f_x; + f_z = 0; + f = f*16; + + e1 = e2 = world; + + traceline2(p1, p2, self, 0); + if (trace_ent.takedamage) + { + LightningMultiDamage_Do(from, damage, multi); + } + e1 = trace_ent; + + traceline2(p1 + f, p2 + f, self, 0); + if (trace_ent != e1 && trace_ent.takedamage) + { + LightningMultiDamage_Do(from, damage, multi); + } + e2 = trace_ent; + + traceline2(p1 - f, p2 - f, self, 0); + if (trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage) + { + LightningMultiDamage_Do(from, damage, multi); + } +} + +void(vector p1, vector p2, entity from, float damage) LightningDamage = +{ + LightningMultiDamage( p1, p2, from, damage, 0); +} + +void(entity source, entity from, float iter) W_ChainLightning = +{ + local entity head; + local entity targ1, targ2; + local float len1, len2, dist, kill; + local vector org, dorg; + + if (iter == 5) { + // let's crash quake yaay + T_Damage (source, from, from, 60); + return; + } + kill = 25 + 5*iter; // increase damage per iteration + // I was reducing it per iteration, but it wasn't as much + // fun when your primary target died before everything else did + // and you had to find another target. this further amps the + // usefulness in crowd situations. + iter = iter+1; + + org = source.origin + (source.mins + source.maxs)*0.5; + head = findradius(source.origin+(source.mins + source.maxs)*0.5, 192); + + targ1 = targ2 = source; + len1 = len2 = A_SHITLOAD; + + // find the two closest enemies who haven't been zapped yet + while (head) + { + if (head != from && + head.takedamage && + !(head.customflags & CFL_ZAPPED) && + (head.movetype > 2 && head.movetype < 6)) // walk/step/fly + { + traceline2(org, head.origin + (head.mins + head.maxs)*0.5, self, TRACE_NOMONSTERS); + if (trace_fraction == 1.0) + { + dist = vlen(head.origin - source.origin); + if (dist <= len1) { + targ2 = targ1; + len2 = len1; + targ1 = head; + len1 = dist; + } else if (dist <= len2) { + targ2 = head; + len2 = dist; + } + } + } + head = head.chain; + } + + if (targ1 != source) { + targ1.customflags = targ1.customflags | CFL_ZAPPED; + dorg = targ1.origin + (targ1.mins + targ1.maxs)*0.5; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, targ1); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, dorg_x); + WriteCoord (MSG_BROADCAST, dorg_y); + WriteCoord (MSG_BROADCAST, dorg_z); + W_ChainLightning(targ1, from, iter); + + if (targ2 != source) { + targ2.customflags = targ2.customflags | CFL_ZAPPED; + dorg = targ2.origin + (targ2.mins + targ2.maxs)*0.5; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, targ2); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, dorg_x); + WriteCoord (MSG_BROADCAST, dorg_y); + WriteCoord (MSG_BROADCAST, dorg_z); + W_ChainLightning(targ2, from, iter); + } + else kill += 30 - 5 * iter; // do more damage if there's no one else to chain to + } + else kill += 60 - 5 * iter; // this makes the LG more like a normal quad LG against single targets + T_Damage (source, from, from, kill); +} + +void(float special) W_FireLightning = +{ + local vector org; + local float cells; + + if (self.ammo_cells < 1 && !special) + { + W_SelectBestWeapon(); + return; + } + +// explode if under water + if (self.waterlevel > 1) + { + cells = self.ammo_cells; + self.ammo_cells = 0; + W_SetCurrentAmmo (); + T_RadiusDamage (self, self, 35*cells, world); + return; + } + + if (self.width < time && !special) + { + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.width = time + 0.6; + } + self.punchangle_x = -2; + + if (!special) self.currentammo = self.ammo_cells = self.ammo_cells - 1; + + org = self.origin + '0 0 16'; + + traceline2(org, org + v_forward*600, self, TRACE_NOMONSTERS); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + if (special) + LightningMultiDamage (self.origin, trace_endpos + v_forward*4, self, 30, 1); + else + LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30); +} diff --git a/QC_other/QC_copper/w_nails.qc b/QC_other/QC_copper/w_nails.qc new file mode 100644 index 00000000..3ac5ec29 --- /dev/null +++ b/QC_other/QC_copper/w_nails.qc @@ -0,0 +1,169 @@ +/* +================ +spawn_touchblood + +only used by nailguns so now it's here +================ +*/ +void(float damage) spawn_touchblood = +{ + local vector vel; + + vel = normalize(self.velocity) * -1; + vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5)); + + //vel = vel + 2*trace_plane_normal; + // nailguns don't do traces so there is no valid trace plane normal + // (which explains why nailgun blood spurts always seemed to be caught in some strange wind) + + SpawnBlood (self.origin + vel, vel * 40, damage); +} + + + + +/* +=============== + +SPIKY BITS + +=============== +*/ + + +// -------------------------------- + + +entity (vector muzzle, float speed, float spread) W_FireSpike = +{ + vector dir, org; + + org = self.origin + '0 0 16' + v_forward * 11; + org += muzzle_x * v_right + muzzle_z * v_up; + + if (spread) + dir = normalize(v_forward + (2 * v_right * crandom() + v_up * crandom()) * spread) * speed; + else + dir = normalize(v_forward) * speed; + return launch_nail(org, dir, 0); +} + +void() W_FireSpikes = +{ + //makevectors (self.v_angle); + vector v; + entity spike1, spike2; + v = vectoangles( aim( self, AUTOAIM_DIST ) ); + v_x *= -1; // pitch comes back inverted from vectoangles :| + makevectors( v ); + + if (self.ammo_nails < 1) + { + W_SelectBestWeapon(); + return; + } + else if (self.ammo_nails >= 2 && self.weapon == IT_SUPER_NAILGUN) + { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + self.currentammo = self.ammo_nails = self.ammo_nails - 2; + + if (mod(self.cnt,4) == 0) v = '0 0 1.25'; + else if (mod(self.cnt,4) == 1) v = '1 0 1'; + else if (mod(self.cnt,4) == 2) v = '1.25 0 0'; + else if (mod(self.cnt,4) == 3) v = '1 0 -1'; + spike1 = W_FireSpike(v, 950, 0.03); + spike2 = W_FireSpike(-v, 1050, 0.03); + self.attack_finished = time + 0.09; + if (self.super_damage_finished > time) + { + // here's a silly thing: + // one vanilla SNG nail does 18 dmg, 72 with quad, enough to gib zombies and grunts + // two copper nails do 9 each, 36 each with quad, for the same total damage, but that + // only kills grunts and knocks zombies down because the second nail doesn't hit + + // the dumb solution is to make one nail do 0 dmg and the other do 18 in quad mode + // so the math works out like the old math and the quad SNG still feels right + spike2.dmg = 18; + spike1.dmg = 18; + spike2.buddy = spike1; + spike1.buddy = spike2; + // first one to hit does its damage and then nerfs its 'buddy' + } + } + else + { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + self.currentammo = self.ammo_nails = self.ammo_nails - 1; + v = VEC_ORIGIN; + if ( !mod( self.cnt, 2 ) ) v_x = 2.5; + else v_x = -2.5; + W_FireSpike(v, 1996, 0); // :) + // default sv_maxvelocity is 2000, any higher leads to weird + // angular offsets caused by clamping the velocity + self.attack_finished = time + 0.09; + } + self.punchangle_x = -2; + + self.cnt = cycle(self.cnt,8); +} + +float() CheckValidSpikeTouch = +{ + if (other == self.owner) {dprint("other==self.owner\n");return 0;} + if (other.solid == SOLID_TRIGGER) {dprint("other==trig\n");return 0;} + if (CheckProjectilePassthru()) {dprint("passthru true\n");return 0;} + + if (pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return 0; + } + + return 1; +} + + +void() spike_touch = +{ + if (!CheckValidSpikeTouch()) return; + + if (self.dmg) + { + if (other.takedamage) + { + spawn_touchblood (self.dmg); + T_Damage (other, self, self.trueowner, self.dmg); + } + else + { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + + switch(self.classname) + { + case "wizspike": + WriteByte (MSG_BROADCAST, TE_WIZSPIKE); break; + case "knightspike": + WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); break; + case "laser": + WriteByte(MSG_BROADCAST, TE_GUNSHOT); break; + default: + WriteByte (MSG_BROADCAST, TE_SPIKE); + } + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + if (self.classname == "laser") + { + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + particle (self.origin, self.velocity*-0.01, 235, 15); + } + } + // nonsense for combining quad SNG spike damage + if (self.buddy) + self.buddy.dmg = 0; + remove(self); +} + + diff --git a/QC_other/QC_copper/w_rockets.qc b/QC_other/QC_copper/w_rockets.qc new file mode 100644 index 00000000..690c89b4 --- /dev/null +++ b/QC_other/QC_copper/w_rockets.qc @@ -0,0 +1,170 @@ +/* +=============== + +ROCKETS + +=============== +*/ + + +void(entity missile, float rad) T_GibDownedZombies = +{ + if (missile.owner.classname != "player") return; + + entity head; + head = findradiusplus(missile.origin + '0 0 16', rad, type, "zombie"); + // look a little too high since we'll assume zombies are lower than their + // actual origin, which is 24u off the ground + + while(head) + { + if ( head.customflags & CFL_KNOCKEDDOWN && // on ground + CanDamage(head, missile) && // in sight + rad - vlen(head.origin - missile.origin) > 0.5 * head.health // close enough to hurt + ) + { + T_Damage (head, self, self, head.health + 10); + } + head = head.chain; + } +} + + +// ======================================================= + + +void() T_MissileTouch = +{ + local float damg; + + if (other == self.owner) return; // don't explode on owner + if (CheckProjectilePassthru()) return; + + if (pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + damg = 100 + random()*20; + + if (other.health) + { + if (other.classname == "monster_shambler") + damg = damg * 0.5; + if (other.type == "zombie") + damg = max(damg, other.health + 25); // so ogre rockets kill zombies despite being too weak + T_Damage (other, self, self.trueowner, damg ); + } + + // note: find downed zombies to gib first, then do radius damage, or else the radius + // damage will knock far away zombies down, then immediately gib them too + T_GibDownedZombies (self, damg); + // don't do radius damage to other, because all damage will be done in the impact + T_RadiusDamage (self, self.trueowner, 120, other); + + self.origin = self.origin - 8*normalize(self.velocity); + + BecomeExplosion (); +} + + + +/* +================ +W_FireRocket +player rocket launch inherited from generic launch_rocket +================ +*/ + +void() W_FireRocket = +{ + local entity missile; + local vector loc; + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + + self.punchangle_x = -2; + + makevectors (self.v_angle); + loc = self.origin + v_forward * 8 + '0 0 16'; + + missile = launch_rocket( loc, v_forward * 1000 ); + self.attack_finished = time + 0.8; +} + + + +//============================================================================= + + + +/* +=============== + +GERNADES + +=============== +*/ + + + +void() GrenadeExplode = +{ + T_RadiusDamage (self, self.trueowner, 120, world); + T_GibDownedZombies (self, 120); + + BecomeExplosion (); +} + +void() GrenadeTouch = +{ + if (other == self.owner ) return; // don't explode on owner + if (CheckProjectilePassthru()) return; + if (other.takedamage == DAMAGE_AIM) + { + self.velocity = '0 0 0'; + GrenadeExplode(); + return; + } + sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound + if (self.velocity == '0 0 0') + self.avelocity = '0 0 0'; +} + + + +/* +================ +W_FireGrenade +================ +*/ +void() W_FireGrenade = +{ + entity g; + float base; + vector gvel; + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + self.punchangle_x = -2; + + // set grenade speed + makevectors (self.v_angle); + base = 200; + if (self.v_angle_x) + gvel = v_forward * base * 3 + v_up * base + crandom() * v_right * 10 + crandom() * v_up * 10; + else + { + gvel = aim(self, AUTOAIM_DIST); + gvel = gvel * base * 3; + gvel_z = base; + } + + g = launch_grenade(self.origin, gvel); + self.attack_finished = time + 0.6; + g.touch = GrenadeTouch; + g.th_die = GrenadeExplode; +} diff --git a/QC_other/QC_copper/w_shotguns.qc b/QC_other/QC_copper/w_shotguns.qc new file mode 100644 index 00000000..c21548c6 --- /dev/null +++ b/QC_other/QC_copper/w_shotguns.qc @@ -0,0 +1,187 @@ +/* +=============== + +BULLETS + +sg: 6 * 4 = 24 / 48 / 72 / 96 / 120 +ssg: 14 * 4 = 56 / 112 / 168 / 224 / 280 + +sg: 5 * 5 = 25 / 50 / 75 / 100 / 125 +ssg: 11 * 5 = 55 / 110 / 165 / 220 / 275 +ssg: 12 * 5 = 60 / 120 / 180 / 240 / 300 + +=============== +*/ + + +/* +================ +BulletImpact +Go to the trouble of combining multiple pellets into a single damage call. +================ +*/ +void(float damage, vector dir) BulletImpact = +{ + vector vel, org; + + vel = normalize(dir + v_up*crandom() + v_right*crandom()); + vel = vel + 2*trace_plane_normal; + + org = trace_endpos - dir*4; + + if (trace_ent.takedamage) + { + SpawnBlood (org, vel*40, damage); + AddMultiDamage (trace_ent, damage); + } + else gunshot(org); +} + +float(entity t) HasBeenShotToDeath = +{ + if (t.multi_dmg < t.health) return FALSE; + if (t.multi_dmg - ArmorSave(t, t.multi_dmg) >= t.health) return TRUE; + return FALSE; +} + +/* +================ +FireBullets + +Used by shotgun, super shotgun, and enemy soldier firing +================ +*/ +void(float shotcount, vector dir, vector spread) FireBullets = +{ + vector src, direction; + entity ig; + float s, lim; + + if (shotcount <= 0) return; + + makevectors(self.v_angle); + + if (trace_debug) dprint3("*** firing ", ftos(shotcount), " bullets *\n\n"); + for (s = 0; s < shotcount; s++) + { + src = self.origin + v_forward*10; + src_z = self.absmin_z + self.size_z * 0.7; + direction = SpreadVector(dir, spread); + + if (trace_debug) dprint("* firing a bullet *\n"); + + lim = 0; + // check for trace-through cases + for (ig = self; ig != world; lim++) // ig == world if we hit a wall or hit nothing + { + traceline2(src, src + direction*2048, ig, 0); + + // if we've already pelted a monster enough to kill it, let additional bullets add + // up for possible gibs (ala quake), but trace them again through the target for + // better crowd control feels (ala doom). + // this is only noticeable with big hordes of weak guys, but it makes big hordes of + // weak guys not feel like solid ammo-sponge walls. + if (trace_ent.takedamage && + (trace_ent.flags & FL_MONSTER || trace_ent.classname == "player" ) && + // some id shootables are actually trigger_multiples with health and SOLID_BBOX, so this doesn't work (see e1m6): + //( trace_ent.solid == SOLID_BBOX || trace_ent.solid == SOLID_SLIDEBOX ) && + HasBeenShotToDeath(trace_ent) ) + { + BulletImpact (2+2*random(), direction); + + // start 0.1 unit forward, or else when shooting an adjacent enemy we'll + // just hit ourselves again + src = trace_endpos + direction * 0.1; + ig = trace_ent; + if (trace_debug) dprint3("bullet hit ", ig.classname, ", continuing thru\n"); + } + else + { + if (trace_debug) dprint("bullet reached world\n"); + ig = world; + } + if (lim > 8) + { + dprint("bullet pen limit exceeded\n"); + break; + } + } + + if (trace_fraction != 1.0) + { + BulletImpact (4, direction); + } + + if (trace_debug) dprint("bullet is over\n\n"); + } +} + +/* +================ +W_FireShotgun +================ +*/ +void() W_FireShotgun = +{ + local vector dir; + + // for ai_nav: + /*if (nav_w_nodeLink()) + { + self.attack_finished = time + 0.5; + return; + }*/ + + sound (self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM); + + self.punchangle_x = -2; + makevectors(self.v_angle); + + self.currentammo = self.ammo_shells = self.ammo_shells - 1; + dir = aim (self, AUTOAIM_DIST); + + ClearMultiDamage (); + FireBullets (6, dir, '0.04 0.04 0'); + self.attack_finished = time + 0.5; + + ApplyMultiDamage (); +} + + +/* +================ +W_FireSuperShotgun +================ +*/ +void() W_FireSuperShotgun = +{ + local vector dir; + + // for ai_nav: + /*if (nav_w_nodeLinkSpecial()) + { + self.attack_finished = time + 0.5; + return; + }*/ + + if (self.currentammo == 1) + { + W_FireShotgun (); + return; + } + + sound (self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM); + + self.punchangle_x = -4; + + self.currentammo = self.ammo_shells = self.ammo_shells - 2; + dir = aim (self, AUTOAIM_DIST); + + ClearMultiDamage (); + + FireBullets (14, dir, '0.14 0.08 0'); + self.attack_finished = time + 0.75; + + ApplyMultiDamage (); + +} diff --git a/QC_other/QC_copper/walls.qc b/QC_other/QC_copper/walls.qc new file mode 100644 index 00000000..4698b206 --- /dev/null +++ b/QC_other/QC_copper/walls.qc @@ -0,0 +1,276 @@ +/* +============================================================================== + +SIMPLE BMODELS + +func_s that don't do more than appear and disappear + +============================================================================== +*/ + +/* +metlslime on making walls disappear: + +"i finally got it to work, and here's how. + +1) to enable being solid after turning inivisible and then visible again, i only ever set the model using setmodel once, and from then on alternate between setting modelindex to 0 or the actual index. + +Since setmodel is never called, the entity stays linked into the world with the original physics bounds. self.solid can be changed without issue. + +2) for entities that are set to START_OFF, there was still a problem where they'd never appear at all, and never become visible. My hack solution is to wait 1 second, then make them invisible/nonsolid in a special think function, rather than in the spawn function." +*/ + +void() bmodel_appear = +{ + // *** + // IN THIS ORDER + // *** + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + setmodel (self, self.model); + self.alpha = 1; + // *** + // NOT ANY OTHER ORDERS + // *** + + self.state = STATE_BOTTOM; + //force_retouch = 2; +} + +void() bmodel_vanish = +{ + self.solid = SOLID_NOT; + self.state = STATE_TOP; + self.alpha = -1; + + // drop things that are sitting on the bmodel: + //force_retouch = 2; // nope + entity drop; + drop = world; + do { + drop = nextent(drop); + if (drop.flags & FL_ONGROUND && EntitiesTouching(self,drop)) + drop.flags = not(drop.flags, FL_ONGROUND); + } while (drop); +} + + +// ========================================== + + +void() func_wall_use = +{ // change to alternate textures + if (self.noise) sound(self, CHAN_BODY, self.noise, 1.0, ATTN_NORM); + + if (self.spawnflags & 2) + { + if (self.state == STATE_TOP) + { + bmodel_appear(); + if (self.spawnflags & 1) + self.solid = SOLID_NOT; + } + else + { + bmodel_vanish(); + } + return; + } + + self.frame = 1 - self.frame; +} + +/*FGD +@baseclass base(Appearflags, Targetname) = Wall [ + spawnflags(flags) = [ + 1 : "Illusionary" : 0 + 2 : "Toggle Visible+Solid" : 0 + 4 : "Start Invisible" : 0 + ] + noise(string) : "Sound to play when triggered" +] +*/ + +/*QUAKED func_wall (0 .5 .8) ? NONSOLID TOGGLE_VIS START_INVIS +This is just a solid wall if not inhibited. Changes its texture(s) to alternate ones (e.g. basebtn), if targeted. +NOT STATIC. Use a func_static for inconsequential bmodels. + +Flags: +NONSOLID act as a func_illusionary, but still respond to trigger events +TOGGLE_VIS change visibility and solidity instead of texture when triggered. starts solid and visible unless START_INVIS is checked. + +Keys: +"targetname" entity name +"mangle" orientation of the model, values are 'pitch yaw roll', positive pitch is down. not recommended on bmodels. +"noise" sound to play when triggered. +*/ +/*FGD +@SolidClass base(Wall) = func_wall : "Wall, appears/disappears or starts animation when triggered (if supporting texture)" [] +*/ +void() func_wall = +{ + if (!SUB_ShouldSpawn()) return; + + if (self.noise) precache_sound(self.noise); + precache_safe_model(self.model); + + self.angles = self.mangle; + self.use = func_wall_use; + //self.angles = '0 0 0'; + + self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + if (self.spawnflags & 1) + self.solid = SOLID_NOT; + else + self.solid = SOLID_BSP; + + setmodel (self, self.model); + + if (self.spawnflags & 4) + bmodel_vanish(); + else + self.state = STATE_BOTTOM; +} + +/*QUAKED func_wall_point (0 .5 .8) (-8 -8 -8) (8 8 8) NONSOLID +This is just a solid wall if not inhibited. Changes its texture(s) to alternate ones (e.g. basebtn), if triggered. + +Keys: +"model" filename of model to stand in for this entity. can be a bsp or an mdl. mdls will not be solid. +"mangle" orientation of the model, values are 'pitch yaw roll', positive pitch is down +"noise" sound to play when triggered. +"targetname" entity name +*/ +/*FGD +@PointClass base(Wall) = func_wall_point : "Wall (point), appears/disappears or starts animation when triggered (if supporting texture)" [ + model(string) : "External model" + mangle(string) : "Orientation of external model" +] +*/ +void() func_wall_point = { func_wall(); } + +/*QUAKED func_static (0 .5 .8) ? +Like a func_wall but calls makestatic. Static entities are always nonsolid. +*/ +/* +@SolidClass base(Appearflags) = func_static : "Nonsolid, untriggerable static wall" [] +*/ +void() func_static = +{ + if (!SUB_ShouldSpawn()) return; + func_wall(); + makestatic(self); +} + +/*QUAKED func_static_point (0 .5 .8) (-8 -8 -8) (8 8 8) +Like a func_wall but calls makestatic. Static entities are always nonsolid. + +"model" filename of model to stand in for this entity. can be bsp or mdl. +*/ +/* +@PointClass base(Appearflags) = func_static_point : "Static (untriggerable) nonsolid model (point)" [ + model(string) : "External model" + mangle(string) : "Orientation of external model" +] +*/ +void() func_static_point = { func_static(); } + + +/*QUAKED func_illusionary (0 .5 .8) ? +A simple entity that looks solid but lets you walk through it. Functionally identical to a func_static. +*/ +/*FGD +@SolidClass base(Appearflags) = func_illusionary : "Static nonsolid wall" [] +*/ +void() func_illusionary = +{ + func_static(); +} + + +// ========================================== + +void() gate_use = +{ + activator = self; + SUB_UseTargets(); +} + +/*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 +This bmodel will appear if the episode has already been completed, so players can't reenter it. +If it does spawn, it fires its targets immediately. +*/ +/*FGD +@SolidClass base(Appearflags, Target) = func_episodegate : +"Episode Gate. +If players have completed the episode, it fires its targets. +If players have NOT completed the episode, it self-removes." +[ + spawnflags(Flags) = + [ + 1 : "Episode 1" : 1 + 2 : "Episode 2" : 0 + 4 : "Episode 3" : 0 + 8 : "Episode 4" : 0 + ] +] +*/ +void() func_episodegate = +{ + if (!SUB_ShouldSpawn()) return; + if (!(serverflags & self.spawnflags)) + return; // can still enter episode + + self.spawnflags = 0; + func_wall(); + + self.think = gate_use; + self.nextthink = time + 0.2; +} + +/*QUAKED func_bossgate (0 .5 .8) ? +This bmodel does not spawn unless players have all of the episode sigils. +If it does spawn, it fires its targets immediately. +*/ +/*FGD +@SolidClass base(Appearflags, Target) = func_bossgate : +"Boss Gate. +If players have NOT completed all episodes, it fires its targets. +If players have completed all episodes, it self-removes." +[] +*/ +void() func_bossgate = +{ + if (!SUB_ShouldSpawn()) return; + if ( (serverflags & SVFL_ALLEPISODES) == SVFL_ALLEPISODES) + return; // all episodes completed + self.spawnflags = 0; + func_wall(); + + self.think = gate_use; + self.nextthink = time + 0.2; +} + + +// ========================================== + + +/*QUAKED func_group (0.6 0.7 0.8) ? +groups brushes into a group that may or may not be easier to work with +*/ +/*QUAKED func_detail (0.2 .5 .6) ? +Apparently this behaves like a detail brush. Doesn't seal against leaks. +*/ +/*QUAKED func_detail_wall (0.2 .5 .6) ? +Apparently this behaves like a detail brush. Doesn't seal against leaks. Doesn't cut geometry it touches. +*/ +/*QUAKED func_detail_illusionary (0.2 .5 .6) ? +Apparently this behaves like a detail brush. Doesn't seal against leaks. Doesn't cut geometry it touches. Non-solid. +*/ +/*FGD +@SolidClass base(Phong) = func_group : "Group of brushes for in-editor use" [] +@SolidClass base(Phong) = func_detail : "Group of brushes which aren't abusive to bsp" [] +@SolidClass base(Phong) = func_detail_wall : "Group of brushes which aren't abusive to bsp or geometry" [] +@SolidClass base(Phong) = func_detail_illusionary : "Group of brushes which aren't solid, or abusive to bsp or geometry" [] +*/ diff --git a/QC_other/QC_copper/weapons.qc b/QC_other/QC_copper/weapons.qc new file mode 100644 index 00000000..d49b8fd8 --- /dev/null +++ b/QC_other/QC_copper/weapons.qc @@ -0,0 +1,543 @@ +/* +=============================================================================== + +PLAYER WEAPONS + +individual weapons moved to their own files, as this one was getting long + +=============================================================================== +*/ + + +// called by worldspawn +void() W_Precache = +{ + precache_sound ("weapons/r_exp3.wav"); + precache_sound ("weapons/rocket1i.wav"); // nailgun + precache_sound ("weapons/sgun1.wav"); + precache_sound ("weapons/guncock.wav"); // sg + precache_sound ("weapons/ric1.wav"); // ricochet (used in c code) + precache_sound ("weapons/ric2.wav"); // ricochet (used in c code) + precache_sound ("weapons/ric3.wav"); // ricochet (used in c code) + precache_sound ("weapons/spike2.wav"); // super spikes + precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code) + precache_sound ("weapons/grenade.wav"); // grenade launcher + precache_sound ("weapons/bounce.wav"); // grenade bounce + precache_sound ("weapons/shotgn2.wav"); // ssg + precache_model2 ("progs/k_spike.mdl"); + precache_model ("progs/lavaball.mdl"); + precache_sound ("weapons/lhit.wav"); //lightning + precache_sound ("weapons/lstart.wav"); //lightning start +// precache_sound ("items/damage3.wav"); + +// ax sounds + precache_sound ("weapons/ax1.wav"); // ax swoosh + precache_sound3 ("weapons/axhit1.wav"); // ax hit meat + precache_sound3 ("weapons/axhit2.wav"); // ax hit meat 2 + precache_sound ("player/axhit1.wav"); // ax hit me + precache_sound ("player/axhit2.wav"); // ax hit world + + precache_sound ("zombie/z_hit.wav"); + + + + precache_model ("progs/v_axe.mdl"); + precache_model ("progs/v_shot.mdl"); + precache_model ("progs/v_nail.mdl"); + precache_model ("progs/v_rock.mdl"); + precache_model ("progs/v_shot2.mdl"); + precache_model ("progs/v_nail2.mdl"); + precache_model ("progs/v_rock2.mdl"); + precache_model ("progs/v_light.mdl"); + +} + +// shorthand for managing spread on various shotguns in various states of quad +vector(vector dir, vector spread) SpreadVector = +{ + return dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up; +} + + + + + +/* +======== +SuperDamageSound +======== +*/ +void() SuperDamageSound = +{ + if (self.super_damage_finished > time) + if (self.super_sound < time) + { + self.super_sound = time + 1; + sound (self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM); + } +} + +void() W_SetIdleWeaponFrame = +{ + self.weaponframe = 0; +} + +void() W_SetCurrentAmmo = +{ + self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) ); + + if (self.weapon == IT_SHOTGUN || self.weapon == IT_SUPER_SHOTGUN) + { + self.currentammo = self.ammo_shells; + self.items = self.items | IT_SHELLS; + } + else if (self.weapon == IT_NAILGUN || self.weapon == IT_SUPER_NAILGUN) + { + self.currentammo = self.ammo_nails; + self.items = self.items | IT_NAILS; + } + else if (self.weapon == IT_GRENADE_LAUNCHER || self.weapon == IT_ROCKET_LAUNCHER) + { + self.currentammo = self.ammo_rockets; + self.items = self.items | IT_ROCKETS; + } + else if (self.weapon == IT_LIGHTNING) + { + self.currentammo = self.ammo_cells; + self.items = self.items | IT_CELLS; + } + else // axes, etc + { + self.currentammo = 0; + } +} + +void() W_ResetWeaponState = +{ + player_run (); // get out of any weapon firing states + + self.weaponframe = 0; + self.attack_finished = 0; + + if (self.weapon == IT_AXE ) + self.weaponmodel = "progs/v_axe.mdl"; + else if (self.weapon == IT_SHOTGUN) + self.weaponmodel = "progs/v_shot.mdl"; + else if (self.weapon == IT_SUPER_SHOTGUN) + self.weaponmodel = "progs/v_shot2.mdl"; + else if (self.weapon == IT_NAILGUN) + self.weaponmodel = "progs/v_nail.mdl"; + else if (self.weapon == IT_SUPER_NAILGUN) + self.weaponmodel = "progs/v_nail2.mdl"; + else if (self.weapon == IT_GRENADE_LAUNCHER) + self.weaponmodel = "progs/v_rock.mdl"; + else if (self.weapon == IT_ROCKET_LAUNCHER) + self.weaponmodel = "progs/v_rock2.mdl"; + else if (self.weapon == IT_LIGHTNING) + self.weaponmodel = "progs/v_light.mdl"; + else + self.weaponmodel = string_null; + + W_SetCurrentAmmo(); +} + +float(float w) W_RankForWeapon = +{ + if (w == IT_LIGHTNING) + return 1; + if (w == IT_ROCKET_LAUNCHER) + return 2; + if (w == IT_SUPER_NAILGUN) + return 3; + if (w == IT_GRENADE_LAUNCHER) + return 4; + if (w == IT_SUPER_SHOTGUN) + return 5; + if (w == IT_NAILGUN) + return 6; + return 7; +} + +/* +============= +W_BetterWeapon + +Deathmatch weapon change rules for picking up a weapon +============= +*/ +void(float new) W_BetterWeapon = +{ + if (!deathmatch) + { + // don't switch to explosive weapons with quad + if (self.super_damage_finished > time && (new == IT_ROCKET_LAUNCHER || new == IT_GRENADE_LAUNCHER)) + return; + // don't switch to a lightning gun when standing in water + if (self.waterlevel >= 2 && new == IT_LIGHTNING) + return; + } + if (!deathmatch || W_RankForWeapon (new) < W_RankForWeapon (self.weapon) ) + self.weapon = new; + W_ResetWeaponState(); +} + +float() W_BestWeapon = +{ + local float it; + + self.lip = 0; // reset nailgun barrel cycle + + it = self.items; + + if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) ) + return IT_SUPER_NAILGUN; + if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) ) + return IT_SUPER_SHOTGUN; + if (self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & IT_LIGHTNING) ) + return IT_LIGHTNING; + if(self.ammo_nails >= 1 && (it & IT_NAILGUN) ) + return IT_NAILGUN; + if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) ) + return IT_SHOTGUN; + return IT_AXE; +} + +void() W_SelectBestWeapon = +{ + self.weapon = W_BestWeapon(); + W_ResetWeaponState(); +} + +float() W_CheckNoAmmo = +{ + if (self.currentammo > 0) + return TRUE; + + if (self.weapon == IT_AXE) + return TRUE; + + W_SelectBestWeapon (); + return FALSE; +} + +/* +============ +W_Attack + +An attack impulse can be triggered now +============ +*/ +void() W_Attack = +{ + if (!W_CheckNoAmmo ()) + return; + if (self.customflags & CFL_PLUNGE) + return; +// if (self.movetype == MOVETYPE_NOCLIP) +// return; + + makevectors (self.v_angle); // calculate forward angle for velocity + + if (self.weapon == IT_AXE) + { + player_axe(); + W_AxeSwing(); + return; + } + + // moved after axe so that silent swings don't wake monsters + self.show_hostile = time + 1; + + if (self.weapon == IT_SHOTGUN) + { + player_shot1 (); + W_FireShotgun (); + // if (self.super_damage_finished > time) self.attack_finished = time + 0.75; + // else self.attack_finished = time + 0.5; + } + else if (self.weapon == IT_SUPER_SHOTGUN) + { + player_shot1 (); + W_FireSuperShotgun (); + } + else if (self.weapon == IT_NAILGUN || self.weapon == IT_SUPER_NAILGUN) + { + player_nail(); + W_FireSpikes (); + } + else if (self.weapon == IT_GRENADE_LAUNCHER) + { + player_rocket1(); + W_FireGrenade(); + } + else if (self.weapon == IT_ROCKET_LAUNCHER) + { + player_rocket1(); + W_FireRocket(); + } + + else if (self.weapon == IT_LIGHTNING) + { + player_light1(); + self.attack_finished = time + 0.1; + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + } +} + +/* +============ +W_ChangeWeapon +============ +*/ +void() W_ChangeWeapon = +{ + local float it, am, fl; + + if (self.customflags & CFL_PLUNGE) + return; + + it = self.items; + am = 0; + + if (self.impulse == 1) + { + fl = IT_AXE; + } + else if (self.impulse == 2) + { + fl = IT_SHOTGUN; + if (self.ammo_shells < 1) + am = 1; + } + else if (self.impulse == 3) + { + fl = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) + am = 1; + } + else if (self.impulse == 4) + { + fl = IT_NAILGUN; + if (self.ammo_nails < 1) + am = 1; + } + else if (self.impulse == 5) + { + fl = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) + am = 1; + } + else if (self.impulse == 6) + { + fl = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) + am = 1; + } + else if (self.impulse == 7) + { + fl = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) + am = 1; + } + else if (self.impulse == 8) + { + fl = IT_LIGHTNING; + if (self.ammo_cells < 1) + am = 1; + } + + self.impulse = 0; + +// if (!nav_editing) // ai_nav +// { + if (!(self.items & fl)) + { // don't have the weapon or the ammo + sprint (self, "no weapon.\n"); + return; + } + + if (am) + { // don't have the ammo + sprint (self, "not enough ammo.\n"); + return; + } +// } + +// +// set weapon, set ammo +// + self.weapon = fl; + W_ResetWeaponState(); +} + +/* +============ +CycleWeaponCommand + +Go to the next weapon with ammo +============ +*/ +void() CycleWeaponCommand = +{ + local float it, am; + + it = self.items; + self.impulse = 0; + + while (1) + { + am = 0; + + if (self.weapon == IT_LIGHTNING) + { + self.weapon = IT_AXE; + } + else if (self.weapon == IT_AXE) + { + self.weapon = IT_SHOTGUN; + if (self.ammo_shells < 1) + am = 1; + } + else if (self.weapon == IT_SHOTGUN) + { + self.weapon = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) + am = 1; + } + else if (self.weapon == IT_SUPER_SHOTGUN) + { + self.weapon = IT_NAILGUN; + if (self.ammo_nails < 1) + am = 1; + } + else if (self.weapon == IT_NAILGUN) + { + self.weapon = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) + am = 1; + } + else if (self.weapon == IT_SUPER_NAILGUN) + { + self.weapon = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) + am = 1; + } + else if (self.weapon == IT_GRENADE_LAUNCHER) + { + self.weapon = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) + am = 1; + } + else if (self.weapon == IT_ROCKET_LAUNCHER) + { + self.weapon = IT_LIGHTNING; + if (self.ammo_cells < 1) + am = 1; + } + + if ( (it & self.weapon) && am == 0) + { + W_ResetWeaponState (); + return; + } + } + +} + +/* +============ +CycleWeaponReverseCommand + +Go to the prev weapon with ammo +============ +*/ +void() CycleWeaponReverseCommand = +{ + local float it, am; + + it = self.items; + self.impulse = 0; + + while (1) + { + am = 0; + + if (self.weapon == IT_LIGHTNING) + { + self.weapon = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) + am = 1; + } + else if (self.weapon == IT_ROCKET_LAUNCHER) + { + self.weapon = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) + am = 1; + } + else if (self.weapon == IT_GRENADE_LAUNCHER) + { + self.weapon = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) + am = 1; + } + else if (self.weapon == IT_SUPER_NAILGUN) + { + self.weapon = IT_NAILGUN; + if (self.ammo_nails < 1) + am = 1; + } + else if (self.weapon == IT_NAILGUN) + { + self.weapon = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) + am = 1; + } + else if (self.weapon == IT_SUPER_SHOTGUN) + { + self.weapon = IT_SHOTGUN; + if (self.ammo_shells < 1) + am = 1; + } + else if (self.weapon == IT_SHOTGUN) + { + self.weapon = IT_AXE; + } + else if (self.weapon == IT_AXE) + { + self.weapon = IT_LIGHTNING; + if (self.ammo_cells < 1) + am = 1; + } + + if ( (it & self.weapon) && am == 0) + { + W_ResetWeaponState (); + return; + } + } +} + +/* +============ +W_WeaponFrame + +Called every frame so impulse events can be handled as well as possible +============ +*/ +void() W_WeaponFrame = +{ + if (time < self.attack_finished) + return; + + if (self.impulse) + ImpulseCommands (); + +// check for attack + if (self.button0) + { + SuperDamageSound (); + W_Attack (); + } +} + +// impulses also moved to their own file diff --git a/QC_other/QC_copper/world.qc b/QC_other/QC_copper/world.qc new file mode 100644 index 00000000..409480f4 --- /dev/null +++ b/QC_other/QC_copper/world.qc @@ -0,0 +1,406 @@ +void() main = +{ + dprint ("main function\n"); + +// these are just commands to the prog compiler to copy these files + + precache_file ("progs.dat"); + precache_file ("gfx.wad"); + precache_file ("quake.rc"); + precache_file ("default.cfg"); + + precache_file ("end1.bin"); + precache_file2 ("end2.bin"); + + precache_file ("demo1.dem"); + precache_file ("demo2.dem"); + precache_file ("demo3.dem"); + +// +// these are all of the lumps from the cached.ls files +// + precache_file ("gfx/palette.lmp"); + precache_file ("gfx/colormap.lmp"); + + precache_file2 ("gfx/pop.lmp"); + + precache_file ("gfx/complete.lmp"); + precache_file ("gfx/inter.lmp"); + + precache_file ("gfx/ranking.lmp"); + precache_file ("gfx/vidmodes.lmp"); + precache_file ("gfx/finale.lmp"); + precache_file ("gfx/conback.lmp"); + precache_file ("gfx/qplaque.lmp"); + + precache_file ("gfx/menudot1.lmp"); + precache_file ("gfx/menudot2.lmp"); + precache_file ("gfx/menudot3.lmp"); + precache_file ("gfx/menudot4.lmp"); + precache_file ("gfx/menudot5.lmp"); + precache_file ("gfx/menudot6.lmp"); + + precache_file ("gfx/menuplyr.lmp"); + precache_file ("gfx/bigbox.lmp"); + precache_file ("gfx/dim_modm.lmp"); + precache_file ("gfx/dim_drct.lmp"); + precache_file ("gfx/dim_ipx.lmp"); + precache_file ("gfx/dim_tcp.lmp"); + precache_file ("gfx/dim_mult.lmp"); + precache_file ("gfx/mainmenu.lmp"); + + precache_file ("gfx/box_tl.lmp"); + precache_file ("gfx/box_tm.lmp"); + precache_file ("gfx/box_tr.lmp"); + + precache_file ("gfx/box_ml.lmp"); + precache_file ("gfx/box_mm.lmp"); + precache_file ("gfx/box_mm2.lmp"); + precache_file ("gfx/box_mr.lmp"); + + precache_file ("gfx/box_bl.lmp"); + precache_file ("gfx/box_bm.lmp"); + precache_file ("gfx/box_br.lmp"); + + precache_file ("gfx/sp_menu.lmp"); + precache_file ("gfx/ttl_sgl.lmp"); + precache_file ("gfx/ttl_main.lmp"); + precache_file ("gfx/ttl_cstm.lmp"); + + precache_file ("gfx/mp_menu.lmp"); + + precache_file ("gfx/netmen1.lmp"); + precache_file ("gfx/netmen2.lmp"); + precache_file ("gfx/netmen3.lmp"); + precache_file ("gfx/netmen4.lmp"); + precache_file ("gfx/netmen5.lmp"); + + precache_file ("gfx/sell.lmp"); + + precache_file ("gfx/help0.lmp"); + precache_file ("gfx/help1.lmp"); + precache_file ("gfx/help2.lmp"); + precache_file ("gfx/help3.lmp"); + precache_file ("gfx/help4.lmp"); + precache_file ("gfx/help5.lmp"); + + precache_file ("gfx/pause.lmp"); + precache_file ("gfx/loading.lmp"); + + precache_file ("gfx/p_option.lmp"); + precache_file ("gfx/p_load.lmp"); + precache_file ("gfx/p_save.lmp"); + precache_file ("gfx/p_multi.lmp"); + +// sounds loaded by C code + precache_sound ("misc/menu1.wav"); + precache_sound ("misc/menu2.wav"); + precache_sound ("misc/menu3.wav"); + + precache_sound ("ambience/water1.wav"); + precache_sound ("ambience/wind2.wav"); + +// shareware + precache_file ("maps/start.bsp"); + + precache_file ("maps/e1m1.bsp"); + precache_file ("maps/e1m2.bsp"); + precache_file ("maps/e1m3.bsp"); + precache_file ("maps/e1m4.bsp"); + precache_file ("maps/e1m5.bsp"); + precache_file ("maps/e1m6.bsp"); + precache_file ("maps/e1m7.bsp"); + precache_file ("maps/e1m8.bsp"); + +// registered + precache_file2 ("gfx/pop.lmp"); + + precache_file2 ("maps/e2m1.bsp"); + precache_file2 ("maps/e2m2.bsp"); + precache_file2 ("maps/e2m3.bsp"); + precache_file2 ("maps/e2m4.bsp"); + precache_file2 ("maps/e2m5.bsp"); + precache_file2 ("maps/e2m6.bsp"); + precache_file2 ("maps/e2m7.bsp"); + + precache_file2 ("maps/e3m1.bsp"); + precache_file2 ("maps/e3m2.bsp"); + precache_file2 ("maps/e3m3.bsp"); + precache_file2 ("maps/e3m4.bsp"); + precache_file2 ("maps/e3m5.bsp"); + precache_file2 ("maps/e3m6.bsp"); + precache_file2 ("maps/e3m7.bsp"); + + precache_file2 ("maps/e4m1.bsp"); + precache_file2 ("maps/e4m2.bsp"); + precache_file2 ("maps/e4m3.bsp"); + precache_file2 ("maps/e4m4.bsp"); + precache_file2 ("maps/e4m5.bsp"); + precache_file2 ("maps/e4m6.bsp"); + precache_file2 ("maps/e4m7.bsp"); + precache_file2 ("maps/e4m8.bsp"); + + precache_file2 ("maps/end.bsp"); + + precache_file2 ("maps/dm1.bsp"); + precache_file2 ("maps/dm2.bsp"); + precache_file2 ("maps/dm3.bsp"); + precache_file2 ("maps/dm4.bsp"); + precache_file2 ("maps/dm5.bsp"); + precache_file2 ("maps/dm6.bsp"); +} + + + +//======================= +/*QUAKED worldspawn (0 0 0) ? + +Keys: +"light" default light level +"message" sets the title of the map +"sounds" CD track to play +"wad" which graphics wads to use. semicolon delineated, no spaces +"worldtype" style of keys to spawn + 0 = medieval + 1 = metal + 2 = base +"gravity" how fast your dreams come crashing down + +"_sunlight" "#" +"_sun_mangle" "# # 0" yaw pitch roll. pitch is 90 to -90 degrees up to down. +"_sunlight_color" "# # #" + +"_dirt" use dirtmapping +"_dirtdepth" length of dirt rays, default 128. +"_dirtscale" Scale factor used in dirt calculations, default 1 (higher is darker) +"_dirtgain" Exponent used in dirt calculation, default 1 (lower is darker) +*/ +/*FGD +@SolidClass = worldspawn : "World entity" +[ + message(string) : "Map name" + worldtype(choices) : "Key Style" : 0 = + [ + 0 : "Medieval" + 1 : "Metal (runic)" + 2 : "Base" + ] + sounds(integer) : "CD track to play" : 0 + light(integer) : "Ambient light" + gravity(integer) : "Gravity" + _sunlight(integer) : "Sunlight" + _sun_mangle(string) : "Sun mangle (Yaw pitch roll)" + _sunlight_color(string) : "Sun color" + _dirt(integer) : "use dirtmapping" : 0 + _dirtdepth(integer) : "length of dirt rays" : 128 + _dirtscale(string) : "Scale factor used in dirt calculations, higher is darker" : "1.0" + _dirtgain(string) : "Exponent used in dirt calculation, lower is darker" : "1.0" +] +*/ +//======================= +void() worldspawn = +{ + lastspawn = world; + startingserverflags = serverflags; + + InitBodyQueue (); + InitLightStyles(); // moved to lights.qc + + if (!self.gravity) + { + if (self.model == "maps/e1m8.bsp") + { + self.gravity = 100; + } + else + { + self.gravity = 800; + } + } + cvar_set("sv_gravity", ftos(self.gravity)); + self.light_lev = 0; // shut up FTEQCC warning + +// the area based ambient sounds MUST be the first precache_sounds + +// player precaches + W_Precache (); // get weapon precaches + + precache_sound ("misc/null.wav"); + + // sounds used from C physics code + precache_sound ("demon/dland2.wav"); // landing thud + precache_sound ("misc/h2ohit1.wav"); // landing splash + + // player sounds + precache_sound ("items/itembk2.wav"); // item respawn sound + precache_sound ("player/plyrjmp8.wav"); // player jump + precache_sound ("player/land.wav"); // player landing + precache_sound ("player/land2.wav"); // player hurt landing + precache_sound ("player/drown1.wav"); // drowning pain + precache_sound ("player/drown2.wav"); // drowning pain + precache_sound ("player/gasp1.wav"); // gasping for air + precache_sound ("player/gasp2.wav"); // taking breath + precache_sound ("player/h2odeath.wav"); // drowning death + + precache_sound ("misc/talk.wav"); // talk + precache_sound ("player/teledth1.wav"); // telefrag + precache_sound ("misc/r_tele1.wav"); // teleport sounds + precache_sound ("misc/r_tele2.wav"); + precache_sound ("misc/r_tele3.wav"); + precache_sound ("misc/r_tele4.wav"); + precache_sound ("misc/r_tele5.wav"); + +// iw -- fix powerup cheat sounds +// sounds used by cheats + precache_sound ("items/suit2.wav"); // suit (finish) + precache_sound ("items/protect2.wav"); // pent (finish) + precache_sound ("items/protect3.wav"); // pent (protect) + precache_sound ("items/inv2.wav"); // ring (finish) + precache_sound ("items/inv3.wav"); // ring (idle) + precache_sound ("items/damage2.wav"); // quad (finish) + precache_sound ("items/damage3.wav"); // quad (attack) +// iw -- END + + // items + precache_sound ("weapons/lock4.wav"); // ammo pick up + precache_sound ("weapons/pkup.wav"); // weapon up + precache_sound ("items/armor1.wav"); // armor up + + precache_sound3("items/pack.wav"); // backpacks can play either of these + precache_sound3("items/patch.wav"); + + // player gib sounds + precache_sound ("player/gib.wav"); // player gib sound + precache_sound ("player/udeath.wav"); // player gib sound + precache_sound ("player/tornoff2.wav"); // gib sound + +// player pain sounds + + precache_sound ("player/pain1.wav"); + precache_sound ("player/pain2.wav"); + precache_sound ("player/pain3.wav"); + precache_sound ("player/pain4.wav"); + precache_sound ("player/pain5.wav"); + precache_sound ("player/pain6.wav"); + +// player death sounds + precache_sound ("player/death1.wav"); + precache_sound ("player/death2.wav"); + precache_sound ("player/death3.wav"); + precache_sound ("player/death4.wav"); + precache_sound ("player/death5.wav"); + +// liquids + precache_sound ("player/h2ojump.wav"); // player jumping into water + precache_sound ("player/slimbrn2.wav"); // player enter slime + precache_sound ("player/inh2o.wav"); // player enter water + precache_sound ("player/inlava.wav"); // player enter lava + precache_sound ("misc/outwater.wav"); // leaving water sound + precache_sound ("player/lburn1.wav"); // lava burn + precache_sound ("player/lburn2.wav"); // lava burn + precache_sound ("misc/water1.wav"); // swimming + precache_sound ("misc/water2.wav"); // swimming + + precache_model ("progs/player.mdl"); + precache_model ("progs/eyes.mdl"); + precache_model ("progs/h_player.mdl"); + precache_model ("progs/gib1.mdl"); + precache_model ("progs/gib2.mdl"); + precache_model ("progs/gib3.mdl"); + + precache_model ("progs/s_bubble.spr"); // drowning bubbles + precache_model ("progs/s_explod.spr"); // sprite explosion + + precache_model ("progs/bolt.mdl"); // for lightning gun + precache_model ("progs/bolt2.mdl"); // for lightning gun + precache_model ("progs/bolt3.mdl"); // for boss shock + precache_model ("progs/lavaball.mdl"); // for testing + + precache_model ("progs/missile.mdl"); + precache_model ("progs/grenade.mdl"); + precache_model ("progs/spike.mdl"); + //precache_model ("progs/s_spike.mdl"); + + precache_model ("progs/backpack.mdl"); + + precache_model ("progs/zom_gib.mdl"); + +} + +void() StartFrame = +{ + teamplay = cvar("teamplay"); + skill = cvar("skill"); + + //if (framecount != cvar("registered")) + + if (cleanUpClientShit) + cleanUpClientShit -= 1; + else if (!gamestarted && framecount > 2) + { + if (framecount != 3) + cleanUpClientShit += 2; + + gamestarted = TRUE; + } + + framecount++; + //cvar_set("registered",ftos(framecount)); + + /* + 'activator' should be a parameter of *_use(), but it's a global. so it goes. + + this can lead to lots of hard-to-repro bugs in cases where 'activator' isn't set + properly, since it just happens to be set to the player anyway *most* of the time. + + for this reason I enforce a global ban on activator ever being 'world' (via a + gameplay-ending error() in SUB_UseTargets) and nulling it out every single frame. + stale or incorrectly set activators are thus smoked out immediately, and not six + months from now the first time a monster touches a door field at a critical but + impossible to reproduce moment. + */ + activator = world; +} + +/* +============================================================================== + +BODY QUE[UE ~ ed.] + +============================================================================== +*/ + +void() bodyqueue = +{ // just here so spawn functions don't complain after the world creates bodyqueues +} + +void() InitBodyQueue = +{ + bodyqueue_head = spawn(); + bodyqueue_head.classname = "bodyqueue"; + bodyqueue_head.owner = spawn(); + bodyqueue_head.owner.classname = "bodyqueue"; + bodyqueue_head.owner.owner = spawn(); + bodyqueue_head.owner.owner.classname = "bodyqueue"; + bodyqueue_head.owner.owner.owner = spawn(); + bodyqueue_head.owner.owner.owner.classname = "bodyqueue"; + bodyqueue_head.owner.owner.owner.owner = bodyqueue_head; +} + + +// make a body queue entry for the given ent so the ent can be +// respawned elsewhere +void(entity ent) CopyToBodyQueue = +{ + bodyqueue_head.angles = ent.angles; + bodyqueue_head.model = ent.model; + bodyqueue_head.modelindex = ent.modelindex; + bodyqueue_head.frame = ent.frame; + bodyqueue_head.colormap = ent.colormap; + bodyqueue_head.movetype = ent.movetype; + bodyqueue_head.velocity = ent.velocity; + bodyqueue_head.flags = 0; + setorigin (bodyqueue_head, ent.origin); + setsize (bodyqueue_head, ent.mins, ent.maxs); + bodyqueue_head = bodyqueue_head.owner; +} \ No newline at end of file diff --git a/QC_other/QC_frikbot/frikbot/bot.qc b/QC_other/QC_frikbot/frikbot/bot.qc new file mode 100644 index 00000000..3b62f8cb --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot.qc @@ -0,0 +1,1266 @@ + +/* +====================================== +FrikBot X (Version 0.10.2) +====================================== + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +====================================== +These installation instructions only apply to Normal Quake (as does this +entire file). For QuakeWorld, please refer to bot_qw.qc + +-------------------------------------- +To install on a new mod, do all this: +-------------------------------------- +Place all included bot*.qc files in the subdirectory "frikbot" +in your source folder, then... + +* Add the following lines to progs.src right after the defs.qc line +frikbot/bot.qc +frikbot/bot_way.qc +frikbot/bot_fight.qc +frikbot/bot_ai.qc +frikbot/bot_misc.qc +frikbot/bot_phys.qc +frikbot/bot_move.qc +frikbot/bot_ed.qc + +-------------------------------------- +* Comment out the following functions in defs.qc +sound, stuffcmd, sprint, aim, centerprint, setspawnparms +WriteByte, WriteChar, WriteShort, WriteLong, WriteCoord +WriteAngle, WriteString, WriteEntity +-------------------------------------- +* Add this to worldspawn() in world.qc, right at the very top, before InitBodyQue(); +BotInit(); // FrikBot +-------------------------------------- +* Add this line to StartFrame() in world.qc, at the very top +BotFrame(); // FrikBot +-------------------------------------- +* Add these two lines to PlayerPreThink in client.qc at the very top +if (BotPreFrame()) // FrikBot + return; +-------------------------------------- +* Add this line to PlayerPostThink in client.qc at the very top +if (BotPostFrame()) // FrikBot + return; +-------------------------------------- +* Add the following line to the very top of Client Connect in client.qc +ClientInRankings(); // FrikBot +-------------------------------------- +* Add these lines to the very top of ClientDisconnect in client.qc +ClientDisconnected(); // FrikBot +-------------------------------------- + +To install the waypoints: + +add + +waypoints/map_dm1.qc +waypoints/map_dm2.qc +waypoints/map_dm3.qc +waypoints/map_dm4.qc +waypoints/map_dm5.qc +waypoints/map_dm6.qc + +To progs.src, immediately after defs.qc + +To remove these waypoints: + +Delete the code in bot_map_load, located below. +*/ + +void() bot_map_load = +{ + // place your qc loaded waypoints here + + if (mapname == "dm1") + map_dm1(); + else if (mapname == "dm2") + map_dm2(); + else if (mapname == "dm3") + map_dm3(); + else if (mapname == "dm4") + map_dm4(); + else if (mapname == "dm5") + map_dm5(); + else if (mapname == "dm6") + map_dm6(); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Variables and shtuff + +bot.qc has become pretty much a header file +for all variables in the bot... + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +// ----- entity fields --- +.float wallhug, keys, oldkeys, ishuman; +.float b_frags, b_clientno, b_shirt, b_pants; +.float priority, ai_time, b_sound, missile_speed; +.float portal_time, b_skill, switch_wallhug; +.float b_aiflags, b_num, b_chattime; +.float b_menu, b_menu_time, b_menu_value; +.float route_failed, dyn_flags, dyn_time; +.float dyn_plat; +.entity temp_way, last_way, phys_obj; +.entity target1, target2, target3, target4; +.entity _next, _last; +.entity current_way; +.vector b_angle, b_dest, mouse_emu, obs_dir; +.vector movevect, b_dir; +.vector dyn_dest; + +// --------defines----- +float SVC_UPDATENAME = 13; +float SVC_UPDATEFRAGS = 14; +float SVC_UPDATECOLORS = 17; + +// used for the physics & movement AI +float KEY_MOVEUP = 1; +float KEY_MOVEDOWN = 2; +float KEY_MOVELEFT = 4; +float KEY_MOVERIGHT = 8; +float KEY_MOVEFORWARD = 16; +float KEY_MOVEBACK = 32; +float KEY_LOOKUP = 64; +float KEY_LOOKDOWN = 128; +float KEY_LOOKLEFT = 256; +float KEY_LOOKRIGHT = 512; + +// these are aiflags for waypoints +// some overlap to the bot +float AI_TELELINK_1 = 1; // link type +float AI_TELELINK_2 = 2; // link type +float AI_TELELINK_3 = 4; // link type +float AI_TELELINK_4 = 8; // link type +float AI_DOORFLAG = 16; // read ahead +float AI_PRECISION = 32; // read ahead + point +float AI_SURFACE = 64; // point +float AI_BLIND = 128; // read ahead + point +float AI_JUMP = 256; // point + ignore +float AI_DIRECTIONAL = 512; // read ahead + ignore +float AI_PLAT_BOTTOM = 1024; // read ahead +float AI_RIDE_TRAIN = 2048; // read ahead +float AI_SUPER_JUMP = 4096; // point + ignore + route test +float AI_SNIPER = 8192; // point type +float AI_AMBUSH = 16384; // point type +float AI_DOOR_NO_OPEN = 32768; // read ahead +float AI_DIFFICULT = 65536; // route test +float AI_TRACE_TEST = 131072; // route test + +// these are flags for bots/players (dynamic/editor flags) +float AI_OBSTRUCTED = 1; +float AI_HOLD_SELECT = 2; +float AI_ROUTE_FAILED = 2; +float AI_WAIT = 4; +float AI_DANGER = 8; + + +// addition masks +float AI_POINT_TYPES = 29152; +float AI_READAHEAD_TYPES = 36528; +float AI_IGNORE_TYPES = 4864; + +float WM_UNINIT = 0; +float WM_DYNAMIC = 1; +float WM_LOADING = 2; +float WM_LOADED = 3; +float WM_EDITOR = 4; +float WM_EDITOR_DYNAMIC = 5; +float WM_EDITOR_DYNLINK = 6; + + +float OPT_SAVEBOTS = 1; +float OPT_NOCHAT = 2; + +// -------globals----- +float active_clients; +float max_clients, real_frametime; +float bot_count, b_options; +float waypoint_mode, dump_mode; +float waypoints, direct_route; +float sv_friction, sv_gravity; +float sv_accelerate, sv_maxspeed, sv_stopspeed; +entity fixer; +entity route_table; +entity b_temp1, b_temp2, b_temp3; +entity player_head, phys_head, way_head; +float busy_waypoints; +float saved_bots, saved_skills1, saved_skills2, current_bots; + +// -------ProtoTypes------ +// external +void() ClientConnect; +void() ClientDisconnect; +void() SetNewParms; + +// rankings +float(float clientno) ClientBitFlag; +float() ClientNextAvailable; +void(float whichteam, float whatbot, float whatskill) BotConnect; +void(entity bot) BotDisconnect; +void(float clientno) BotInvalidClientNo; +void(entity who) UpdateClient; + +// waypointing +void() DynamicWaypoint; +entity(vector org) make_waypoint; +void() ClearAllWays; +void() FixWaypoints; +float() begin_route; +void(entity this, float direct) bot_get_path; +void() WaypointThink; +entity(entity start) FindWayPoint; + +// physics & movement +float(entity e) bot_can_rj; +void() bot_jump; +void() frik_bot_roam; +float(vector weird) frik_walkmove; +void() frik_movetogoal; +void() frik_obstacles; +float(float flag) frik_recognize_plat; +float(vector sdir) frik_KeysForDir; +void(vector whichway, float danger) frik_obstructed; +void() SV_Physics_Client; +void() SV_ClientThink; +void() CL_KeyMove; + +// ai & misc +string() PickARandomName; +float(entity targ) fov; +float(float y1, float y2) angcomp; +float(entity targ1, entity targ2) wisible; +float(entity targ) sisible; +float(entity targ) fisible; +vector(entity ent) realorigin; +void(entity ent) target_drop; +void(entity ent) target_add; +void() KickABot; +void() BotImpulses; +void(entity targ, float success) bot_lost; +string(float r) BotName; +float(float v) frik_anglemod; +void() bot_chat; +void(float tpic) bot_start_topic; + + +// editor stuffs + +void() bot_way_edit; +void() bot_menu_display; + + +// ----------Commands--------- +void(entity e, float chan, string samp, float vol, float atten) frik_sound = #8; +void(entity client, string s) frik_stuffcmd = #21; +void(entity client, string s) frik_sprint = #24; +vector(entity e, float sped) frik_aim = #44; +void(entity client, string s) frik_centerprint = #73; +void(entity e) frik_setspawnparms = #78; +void(float to, float f) frik_WriteByte = #52; +void(float to, float f) frik_WriteChar = #53; +void(float to, float f) frik_WriteShort = #54; +void(float to, float f) frik_WriteLong = #55; +void(float to, float f) frik_WriteCoord = #56; +void(float to, float f) frik_WriteAngle = #57; +void(float to, string s) frik_WriteString = #58; +void(float to, entity s) frik_WriteEntity = #59; + +void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) +frik_big_centerprint = #73; + +//---------------------------------------------------------------------------- + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Function redclarations. These allow function +designed to work for clients (sprint, so forth) +to mainly not complain when working with a bot + +Although these shouldn't be needed anymore, +as the bots truly are clients now, if you don't +stop the SZ_ buffer from filling up by disabling +direct messages to the bots, it crashes quake :-( + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(entity client, string s) stuffcmd = +{ + if (client.ishuman == 1) + frik_stuffcmd(client, s); + b_temp1 = player_head; + + while(b_temp1) + { + if (b_temp1.classname == "botcam") + { + if ((b_temp1.enemy == client) && b_temp1.ishuman) + frik_stuffcmd(b_temp1, s); + } + b_temp1 = b_temp1._next; + } +}; + +void(entity e) setspawnparms = +{ + if (e.ishuman == 1) + frik_setspawnparms(e); + else + { + b_temp1 = player_head; + while(b_temp1) + { + if (b_temp1.ishuman) + { + frik_setspawnparms(b_temp1); + return; + } + b_temp1 = b_temp1._next; + } + SetNewParms(); + } +}; +void(entity client, string s) sprint = +{ + if (client.ishuman == 1) + frik_sprint(client, s); + b_temp1 = player_head; + + while(b_temp1) + { + if (b_temp1.classname == "botcam") + { + if ((b_temp1.enemy == client) && b_temp1.ishuman) + frik_sprint(b_temp1, s); + } + b_temp1 = b_temp1._next; + } + +}; +void(entity client, string s) centerprint = +{ + if (client.ishuman == 1) + frik_centerprint(client, s); + b_temp1 = player_head; + + while(b_temp1) + { + if (b_temp1.classname == "botcam") + { + if ((b_temp1.enemy == client) && b_temp1.ishuman) + frik_centerprint(b_temp1, s); + } + b_temp1 = b_temp1._next; + } +}; + +vector(entity e, float sped) aim = +{ + e.missile_speed = sped; + return frik_aim(e, sped); +}; + +void(entity e, float chan, string samp, float vol, float atten) sound = +{ + + frik_sound(e, chan, samp, vol, atten); + if (samp == "items/inv3.wav") + return; + else if (e.classname == "player") + e.b_sound = time + 1; + else if (other.classname == "player") + other.b_sound = time + 1; + +}; +void(float to, float f) WriteByte = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteByte(to, f); +}; +void(float to, float f) WriteChar = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteChar(to, f); +}; +void(float to, float f) WriteShort = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteShort(to, f); +}; +void(float to, float f) WriteLong = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteLong(to, f); +}; +void(float to, float f) WriteCoord = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteCoord(to, f); +}; +void(float to, float f) WriteAngle = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteAngle(to, f); +}; +void(float to, string s) WriteString = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteString(to, s); +}; +void(float to, entity s) WriteEntity = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteEntity(to, s); +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Cam, see what the bot sees (or any other player) + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float() botcam = +{ + if (self.classname != "botcam") + return FALSE; + setorigin(self, self.enemy.origin); + self.items = self.enemy.items; + self.weapon = self.enemy.weapon; + self.weaponmodel = self.enemy.weaponmodel; + self.currentammo = self.enemy.currentammo; + self.weaponframe = self.enemy.weaponframe; + self.ammo_shells = self.enemy.ammo_shells; + self.ammo_nails = self.enemy.ammo_nails; + self.ammo_rockets= self.enemy.ammo_rockets; + self.ammo_cells = self.enemy.ammo_cells; + self.view_ofs = self.enemy.view_ofs; + self.health = self.enemy.health; + self.armorvalue = self.enemy.armorvalue; + self.dmg_take = self.enemy.dmg_take; + self.dmg_save = self.enemy.dmg_save; + self.dmg_inflictor = self.enemy.dmg_inflictor; + self.punchangle = self.enemy.punchangle; + self.deadflag = self.enemy.deadflag; + msg_entity = self; + WriteByte (MSG_ONE,5); + WriteEntity (MSG_ONE, self.enemy); + WriteByte (MSG_ONE, 10); + WriteAngle (MSG_ONE,self.enemy.v_angle_x); + WriteAngle (MSG_ONE,self.enemy.v_angle_y); + WriteAngle (MSG_ONE,self.enemy.v_angle_z); + self.modelindex = 0; + + self.impulse = 0; + return TRUE; +}; + +void() botcam_u = +{ + // sloppy cycling code + if (self.classname != "botcam") + { + self.enemy = player_head; + } + else + { + do + self.enemy = self.enemy._next; + while (self.enemy.classname == "botcam"); + } + if (self.enemy == self) + { + do + self.enemy = self.enemy._next; + while (self.enemy.classname == "botcam"); + } + self.classname = "botcam"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + + if (!self.enemy) + { + sprint(self, "No one left to track!\n"); + msg_entity = self; + WriteByte (MSG_ONE,5); + WriteEntity (MSG_ONE, self); + PutClientInServer(); + return; + } + if (!self.enemy.ishuman) + { + self.enemy.dmg_take = 0; + self.enemy.dmg_save = 0; + } + sprint(self, "Now tracking "); + sprint(self, self.enemy.netname); + sprint(self, "\n"); +}; + + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Stuff mentioned up top +it just links the bot into the mod + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClientFixRankings = +{ + local float cno; + + if (self.switch_wallhug > time) + return; + self.switch_wallhug = 0; + + b_temp2 = nextent(world); + cno = 0; + + while (cno < max_clients) + { + if ((!b_temp2.ishuman) && (active_clients & ClientBitFlag(cno))) + UpdateClient(b_temp2); + cno = cno + 1; + b_temp2 = nextent(b_temp2); + } +}; + +void() ClientInRankings = +{ + local float cno; + + cno = self.colormap - 1; + BotInvalidClientNo (cno); + + if (player_head) + player_head._last = self; + + self._next = player_head; + self._last = world; + player_head = self; + + if (!self.phys_obj) + { + b_temp2 = phys_head; + while (b_temp2 != world && b_temp2.owner != self) + b_temp2 = b_temp2._next; + self.phys_obj = b_temp2; + } + + if (self.ishuman == 2) + { + self.ishuman = FALSE; + return; + } + active_clients = active_clients | ClientBitFlag(cno); + + self.b_clientno = cno; + self.ishuman = TRUE; + self.switch_wallhug = time + 1; +}; + + +void() ClientDisconnected = +{ + if (player_head == self) + player_head = self._next; + if (self._next) + self._next._last = self._last; + if (self._last) + self._last._next = self._next; + + active_clients = active_clients - active_clients & ClientBitFlag(self.b_clientno); +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotPreFrame & BotPostFrame, used to make the +bot easier to install + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float () BotPreFrame = +{ + if (self.b_clientno == -1) + return TRUE; + if (self.ishuman) + { + if (self.switch_wallhug) + ClientFixRankings(); + if (self.classname == "botcam") + return TRUE; + + } + if (self.b_frags != self.frags) + { + + if (self.b_frags > self.frags) + { + if (pointcontents(self.origin) == CONTENT_LAVA) + bot_start_topic(10); + else + bot_start_topic(9); + } + else + bot_start_topic(2); + self.b_frags = self.frags; + } + DynamicWaypoint(); + return FALSE; +}; +float () BotPostFrame = +{ + if (self.b_clientno == -1) + return TRUE; + if (self.ishuman) + { + + if (waypoint_mode > WM_LOADED) + bot_menu_display(); + + BotImpulses(); + + if (botcam()) + return TRUE; + } + return FALSE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Chat code + +The rest of this code is in bot_misc.qc + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(string h) BotSay = // simulate talking by composing a 'chat' message +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, self.netname); + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 2); + WriteString(MSG_ALL, h); +}; +void() BotSayInit = +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, self.netname); +}; +void(string h) BotSay2 = +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 2); + WriteString(MSG_ALL, h); +}; +void(string h) BotSayTeam = +{ + local entity t; + if (!teamplay) + return; + t = player_head; + while(t) + { + if (t.team == self.team) + { + msg_entity = t; + WriteByte(MSG_ONE, 8); + WriteByte(MSG_ONE, 1); + WriteByte(MSG_ONE, 40); + WriteString(MSG_ONE, self.netname); + WriteByte(MSG_ONE, 8); + WriteByte(MSG_ONE, 2); + WriteByte(MSG_ONE, 41); + WriteString(MSG_ONE, h); + } + t = t._next; + } +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotInit + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void() BotInit = +{ + local entity ent, fisent; + local float numents; + + // spawn entities for the physics + ent = nextent(world); + max_clients = 0; + + while(ent != world) + { + max_clients = max_clients + 1; + ent = nextent(ent); + } + if (max_clients > 16) + max_clients = 16; + + ent = nextent(world); + fisent = world; + while (numents < max_clients) + { + + phys_head = spawn(); + if (fisent) + fisent._next = phys_head; + phys_head._last = fisent; + fisent = phys_head; + ent.phys_obj = phys_head; + phys_head.classname = "phys_obj"; + phys_head.owner = ent; + numents = numents + 1; + ent = nextent(ent); + } + precache_model("progs/s_light.spr"); + precache_model("progs/s_bubble.spr"); + + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Rankings 'utilities'. Written by Alan Kivlin, +this code just fools clients by sending precisely +the same network messages as when a real player +signs on to the server. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void(entity who) UpdateClient = +{ + WriteByte (MSG_ALL, SVC_UPDATENAME); + WriteByte (MSG_ALL, who.b_clientno); + WriteString (MSG_ALL, who.netname); + WriteByte (MSG_ALL, SVC_UPDATECOLORS); + WriteByte (MSG_ALL, who.b_clientno); + WriteByte (MSG_ALL, who.b_shirt * 16 + who.b_pants); + WriteByte (MSG_ALL, SVC_UPDATEFRAGS); + WriteByte (MSG_ALL, who.b_clientno); + WriteShort (MSG_ALL, who.frags); +}; + +float(float clientno) ClientBitFlag = +{ + // bigger, but faster + if (clientno == 0) + return 1; + else if (clientno == 1) + return 2; + else if (clientno == 2) + return 4; + else if (clientno == 3) + return 8; + else if (clientno == 4) + return 16; + else if (clientno == 5) + return 32; + else if (clientno == 6) + return 64; + else if (clientno == 7) + return 128; + else if (clientno == 8) + return 256; + else if (clientno == 9) + return 512; + else if (clientno == 10) + return 1024; + else if (clientno == 11) + return 2048; + else if (clientno == 12) + return 4096; + else if (clientno == 13) + return 8192; + else if (clientno == 14) + return 16384; + else if (clientno == 15) + return 32768; + return 0; +}; + +float() ClientNextAvailable = +{ + local float clientno; + + clientno = max_clients; + while(clientno > 0) + { + clientno = clientno - 1; + + if(!(active_clients & ClientBitFlag(clientno))) + return clientno; + } + + return -1; +}; + + +void(entity e1, entity e2, float flag) DeveloperLightning = +{ + // used to show waypoint links for debugging + WriteByte (MSG_BROADCAST, 23); + if (flag) + WriteByte (MSG_BROADCAST, 6); + else + WriteByte (MSG_BROADCAST, 13); + WriteEntity (MSG_BROADCAST, e2); + WriteCoord (MSG_BROADCAST, e1.origin_x); + WriteCoord (MSG_BROADCAST, e1.origin_y); + WriteCoord (MSG_BROADCAST, e1.origin_z); + WriteCoord (MSG_BROADCAST, e2.origin_x); + WriteCoord (MSG_BROADCAST, e2.origin_y); + WriteCoord (MSG_BROADCAST, e2.origin_z); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Find Another Color + +Team finding code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float(float tcolor) FindAnotherColor = +{ + local float bestbet, scolor, pcount, bestp; + bestbet = -1; + bestp = 16; + while(scolor < 14) + { + if (scolor != tcolor) + { + b_temp2 = player_head; + pcount = 0; + while(b_temp2 != world) + { + if (b_temp2.team == scolor + 1) + pcount = pcount + 1; + b_temp2 = b_temp2._next; + } + if ((pcount < bestp) && pcount) + { + bestbet = scolor; + bestp = pcount; + } + } + scolor = scolor + 1; + } + if (bestbet < 0) + { + bestbet = tcolor; + while (bestbet == tcolor) + { + bestbet = floor(random() * 13); + } + } + return bestbet; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotConnect and related functions. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +entity(float num) GetClientEntity = +{ + local entity upsy; + upsy = world; + num = num + 1; + while (num > 0) + { + num = num - 1; + upsy = nextent(upsy); + } + return upsy; +}; + +void(float whichteam, float whatbot, float whatskill) BotConnect = +{ + local float f; + local string h; + local entity uself; + + f = ClientNextAvailable(); + uself = self; + if(f == -1) + { + bprint("Unable to connect a bot, server is full.\n"); + return; + } + + // chat thing + + bot_count = bot_count + 1; + self = GetClientEntity(f); + if (!saved_bots) + bot_start_topic(1); + self.b_clientno = f; + self.colormap = f + 1; + if (whatbot) + self.netname = BotName(whatbot); + else + self.netname = PickARandomName(); + // players can set skill all weird, so leave these checks in + whatskill = rint(whatskill); + if (whatskill > 3) + whatskill = 3; + else if (whatskill < 0) + whatskill = 0; + self.b_skill = whatskill; + + if (teamplay && !coop) + { + if (whichteam) + self.b_pants = FindAnotherColor(uself.team - 1); + else + self.b_pants = uself.team - 1; + self.b_shirt = self.b_pants; + } + + self.team = self.b_pants + 1; + UpdateClient(self); + SetNewParms(); + self.ishuman = 2; + ClientConnect(); + PutClientInServer(); + + active_clients = active_clients | ClientBitFlag(f); + + // this is risky... could corrupt .way files if done wrong + // If you're not the gambling type, comment this out + + f = ClientBitFlag(self.b_num - 1); + current_bots = current_bots | f; + + if (self.b_num <= 8) + saved_skills1 = (saved_skills1 & (65536 - (3 * f)) | (self.b_skill * f)); + else + { + f = ClientBitFlag(self.b_num - 9); + saved_skills2 = (saved_skills2 & (65536 - (3 * f)) | (self.b_skill * f)); + } + + h = ftos(current_bots); + cvar_set("scratch1", h); + h = ftos(saved_skills1); + cvar_set("scratch2", h); + h = ftos(saved_skills2); + cvar_set("scratch3", h); + self = uself; + +}; + +void(entity bot) BotDisconnect = +{ + local string h; + local entity uself; + uself = self; + self = bot; + + bot_count = bot_count - 1; + current_bots = current_bots - (current_bots & ClientBitFlag(self.b_num - 1)); + h = ftos(current_bots); + cvar_set("scratch1", h); + + + ClientDisconnect(); + + if (self.b_clientno != -1) + { + // the bot's client number is not in use by a real player so we + // must remove it's entry in the rankings + // Quake engine sets all fields to 0, can only do the most important here + self.b_frags = self.frags = 0; + self.netname = ""; + self.classname = ""; + self.health = 0; + self.items = 0; + self.armorvalue = 0; + self.weaponmodel = ""; + self.b_pants = 0; + self.b_shirt = 0; + self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = 0; + UpdateClient(self); + active_clients = active_clients - (active_clients & ClientBitFlag(self.b_clientno)); + self.b_clientno = -1; + } + self = uself; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotInvalidClientNo +kicks a bot if a player connects and takes the bot's space + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(float clientno) BotInvalidClientNo = +{ + local entity bot; + + bot = GetClientEntity(clientno); + if(bot.b_clientno > 0) + { + if (active_clients & ClientBitFlag(self.b_clientno)) + { + bot.b_clientno = -1; + BotDisconnect(bot); + active_clients = active_clients | ClientBitFlag(self.b_clientno); + BotConnect(0, bot.b_num, bot.b_skill); + return; + } + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Loading from file + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void() LoadWaypoint = +{ + local vector org; + local entity tep; + local float r; + org_x = cvar("saved1"); + org_y = cvar("saved2"); + org_z = cvar("saved3"); + + tep = make_waypoint(org); + + r = cvar("saved4"); + + tep.b_aiflags = floor(r / 4); + tep.b_pants = cvar("scratch1"); + tep.b_skill = cvar("scratch2"); + tep.b_shirt = cvar("scratch3"); + tep.b_frags = cvar("scratch4"); +}; + +void() bot_return = +{ + if (time > 2) + { + if ((waypoint_mode == WM_DYNAMIC) || (waypoint_mode == WM_LOADED)) + { + // minor precaution + + if (saved_bots & 1) BotConnect(0, 1, saved_skills1 & 3); + if (saved_bots & 2) BotConnect(0, 2, (saved_skills1 & 12) / 4); + if (saved_bots & 4) BotConnect(0, 3, (saved_skills1 & 48) / 16); + if (saved_bots & 8) BotConnect(0, 4, (saved_skills1 & 192) / 64); + if (saved_bots & 16) BotConnect(0, 5, (saved_skills1 & 768) / 256); + if (saved_bots & 32) BotConnect(0, 6, (saved_skills1 & 3072) / 1024); + if (saved_bots & 64) BotConnect(0, 7, (saved_skills1 & 12288) / 4096); + if (saved_bots & 128) BotConnect(0, 8, (saved_skills1 & 49152) / 16384); + if (saved_bots & 256) BotConnect(0, 9, saved_skills2 & 3); + if (saved_bots & 512) BotConnect(0, 10, (saved_skills2 & 12) / 4); + if (saved_bots & 1024) BotConnect(0, 11, (saved_skills2& 48) / 16); + if (saved_bots & 2048) BotConnect(0, 12, (saved_skills2 & 192) / 64); + if (saved_bots & 4096) BotConnect(0, 13, (saved_skills2 & 768) / 256); + if (saved_bots & 8192) BotConnect(0, 14, (saved_skills2 & 3072) / 1024); + if (saved_bots & 16384) BotConnect(0, 15, (saved_skills2 & 12288) / 4096); + if (saved_bots & 32768) BotConnect(0, 16, (saved_skills2 & 49152) / 16384); + saved_bots = 0; + } + } +}; + + +void() WaypointWatch = +{ + // Waypoint Baywatch + local float bigboobs; + local string h; + if (framecount < 4) + return; + if (max_clients < 2) + return; + if (waypoint_mode != WM_UNINIT) + { + bigboobs = cvar("saved4"); + if (bigboobs != 0) + { + if ((bigboobs & 3) == 1) + ClearAllWays(); + else if ((bigboobs & 3) == 3) + { + FixWaypoints(); + h = ftos(b_options); + cvar_set("saved1", h); + cvar_set("saved4", "0"); + cvar_set("scratch1", "0"); + waypoint_mode = WM_LOADED; + return; + } + LoadWaypoint(); + waypoint_mode = WM_LOADING; + cvar_set("saved4", "0"); + } + } + else + { + // the bots return! + b_options = cvar("saved1"); + if (coop || (b_options & OPT_SAVEBOTS)) + { + saved_bots = cvar("scratch1"); + saved_skills1 = cvar("scratch2"); + saved_skills2 = cvar("scratch3"); + } + cvar_set ("saved4", "0"); + if (max_clients > 1) + { + localcmd("exec maps/"); + localcmd(mapname); + localcmd(".way\n"); + waypoint_mode = WM_DYNAMIC; + bot_map_load(); + } + else + waypoint_mode = WM_LOADED; + } +}; +void() BotFrame = +{ + local float num; + + // for the sake of speed + sv_maxspeed = cvar("sv_maxspeed"); + sv_gravity = cvar("sv_gravity"); + sv_friction = cvar("sv_friction"); + sv_accelerate = cvar("sv_accelerate"); + sv_stopspeed = cvar("sv_stopspeed"); + real_frametime = frametime; // in NQ this is alright + + self = nextent(world); + num = 0; + while (num < max_clients) + { + if (self.ishuman == FALSE) + { + if (active_clients & ClientBitFlag(num)) + { + frik_obstacles(); + CL_KeyMove(); + SV_ClientThink(); + SV_Physics_Client(); + } + } + self = nextent(self); + num = num + 1; + } + WaypointWatch(); + + if (saved_bots) + bot_return(); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Impulses. Allows the player to perform bot +related functions. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() BotImpulses = +{ + local float f; + + if (self.impulse == 100) + { + f = cvar("skill"); + BotConnect(0, 0, f); + } + else if (self.impulse == 101) + { + f = cvar("skill"); + BotConnect(1, 0, f); + } + else if (self.impulse == 102) + KickABot(); + else if (self.impulse == 103) + botcam_u(); + else if (self.impulse == 104) + bot_way_edit(); + else + return; + + self.impulse = 0; +}; + + + diff --git a/QC_other/QC_frikbot/frikbot/bot_ai.qc b/QC_other/QC_frikbot/frikbot/bot_ai.qc new file mode 100644 index 00000000..29708f98 --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_ai.qc @@ -0,0 +1,1016 @@ +/*********************************************** +* * +* FrikBot General AI * +* "The I'd rather be playing Quake AI" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +target_onstack + +checks to see if an entity is on the bot's stack + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float(entity scot) target_onstack = +{ + if (scot == world) + return FALSE; + else if (self.target1 == scot) + return 1; + else if (self.target2 == scot) + return 2; + else if (self.target3 == scot) + return 3; + else if (self.target4 == scot) + return 4; + else + return FALSE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +target_add + +adds a new entity to the stack, since it's a +LIFO stack, this will be the bot's new target1 + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity ent) target_add = +{ + if (ent == world) + return; + if (target_onstack(ent)) + return; + self.target4 = self.target3; + self.target3 = self.target2; + self.target2 = self.target1; + self.target1 = ent; + self.search_time = time + 5; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +target_drop + +Removes an entity from the bot's target stack. +The stack will empty everything up to the object +So if you have target2 item_health, target1 +waypoint, and you drop the health, the waypoint +is gone too. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity ent) target_drop = +{ + local float tg; + + tg = target_onstack(ent); + if (tg == 1) + { + self.target1 = self.target2; + self.target2 = self.target3; + self.target3 = self.target4; + self.target4 = world; + } + else if (tg == 2) + { + self.target1 = self.target3; + self.target2 = self.target4; + self.target3 = self.target4 = world; + } + else if (tg == 3) + { + self.target1 = self.target4; + self.target2 = self.target3 = self.target4 = world; + } + else if (tg == 4) + self.target1 = self.target2 = self.target3 = self.target4 = world; + self.search_time = time + 5; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_lost + +Bot has lost its target. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity targ, float success) bot_lost = +{ + if (!targ) + return; + + target_drop(targ); + if (targ.classname == "waypoint") + targ.b_sound = targ.b_sound - (targ.b_sound & ClientBitFlag(self.b_clientno)); + + // find a new route + if (!success) + { + self.target1 = self.target2 = self.target3 = self.target4 = world; + self.last_way = FindWayPoint(self.current_way); + ClearMyRoute(); + self.b_aiflags = 0; + } + else + { + if (targ.classname == "item_artifact_invisibility") + if (self.items & 524288) + bot_start_topic(3); + + if (targ.flags & FL_ITEM) + { + if (targ.model == string_null) + targ._last = world; + else + targ._last = self; + } + } + + + if (targ.classname != "player") + targ.search_time = time + 5; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_check_lost + +decide if my most immediate target should be +removed. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(entity targ) bot_check_lost = +{ + local vector dist; + dist = realorigin(targ) - self.origin; + dist_z = 0; + if (targ == world) + return; + + // waypoints and items are lost if you get close enough to them + + else if (targ.flags & FL_ITEM) + { + if (vlen(targ.origin - self.origin) < 32) + bot_lost(targ, TRUE); + else if (targ.model == string_null) + bot_lost(targ, TRUE); + } + else if (targ.classname == "waypoint") + { + if (!(self.b_aiflags & (AI_SNIPER | AI_AMBUSH))) + { + if (self.b_aiflags & AI_RIDE_TRAIN) + { + if (vlen(targ.origin - self.origin) < 48) + bot_lost(targ, TRUE); + } + else if (self.b_aiflags & AI_PRECISION) + { + if (vlen(targ.origin - self.origin) < 24) + bot_lost(targ, TRUE); + } + else if (vlen(targ.origin - self.origin) < 32) + bot_lost(targ, TRUE); + } + } + else if (targ.classname == "temp_waypoint") + { + if (vlen(targ.origin - self.origin) < 32) + bot_lost(targ, TRUE); + } + else if (targ.classname == "player") + { + if (targ.health <= 0) + bot_lost(targ, TRUE); + else if ((coop) || (teamplay && targ.team == self.team)) + { + if (targ.target1.classname == "player") + { + if (!targ.target1.ishuman) + bot_lost(targ, TRUE); + } + else if (targ.teleport_time > time) + { + // try not to telefrag teammates + self.keys = self.keys & 960; + } + else if (vlen(targ.origin - self.origin) < 128) + { + if (vlen(targ.origin - self.origin) < 48) + frik_walkmove(self.origin - targ.origin); + else + { + self.keys = self.keys & 960; + bot_start_topic(4); + } + self.search_time = time + 5; // never time out + } + else if (!fisible(targ)) + bot_lost(targ, FALSE); + } + else if (waypoint_mode > WM_LOADED) + { + if (vlen(targ.origin - self.origin) < 128) + { + bot_lost(targ, TRUE); + } + } + } + + // buttons are lost of their frame changes + else if (targ.classname == "func_button") + { + if (targ.frame) + { + bot_lost(targ, TRUE); + if (self.enemy == targ) + self.enemy = world; + //if (self.target1) + // bot_get_path(self.target1, TRUE); + + } + } + // trigger_multiple style triggers are lost if their thinktime changes + else if ((targ.movetype == MOVETYPE_NONE) && (targ.solid == SOLID_TRIGGER)) + { + if (targ.nextthink >= time) + { + bot_lost(targ, TRUE); + //if (self.target1) + // bot_get_path(self.target1, TRUE); + } + } + // lose any target way above the bot's head + // FIXME: if the bot can fly in your mod.. + if ((targ.origin_z - self.origin_z) > 64) + { + dist = targ.origin - self.origin; + dist_z = 0; + if (vlen(dist) < 32) + if (self.flags & FL_ONGROUND) + if(!frik_recognize_plat(FALSE)) + bot_lost(targ, FALSE); + } + else if (targ.classname == "train") + { + if (frik_recognize_plat(FALSE)) + bot_lost(targ, TRUE); + } + // targets are lost if the bot's search time has expired + if (time > self.search_time) + bot_lost(targ, FALSE); +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_handle_ai + +This is a 0.10 addition. Handles any action +based b_aiflags. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_handle_ai = +{ + local entity newt; + local vector v; + + // handle ai flags -- note, not all aiflags are handled + // here, just those that perform some sort of action + + // wait is used by the ai to stop the bot until his search time expires / or route changes + + if (self.b_aiflags & AI_WAIT) + self.keys = self.keys & 960; + + if (self.b_aiflags & AI_DOORFLAG) // was on a door when spawned + { + b_temp3 = self; + self = self.last_way; + if (!frik_recognize_plat(FALSE)) // if there is nothing there now + { + newt = FindThing("door"); // this is likely the door responsible (crossfingers) + self = b_temp3; + + if (self.b_aiflags & AI_DOOR_NO_OPEN) + { + if (newt.nextthink) + self.keys = self.keys & 960; // wait until it closes + else + { + bot_lost(self.last_way, FALSE); + } + } + else + { + if (newt.targetname) + { + newt = find(world, target, newt.targetname); + if (newt.health > 0) + { + self.enemy = newt; + bot_weapon_switch(1); + } + else + { + // target_drop(self.last_way); + target_add(newt); + // bot_get_path(newt, TRUE); + } + } + self.b_aiflags = self.b_aiflags - AI_DOORFLAG; + } + } + else + self = b_temp3; + } + + if (self.b_aiflags & AI_JUMP) + { + if (self.flags & FL_ONGROUND) + { + bot_jump(); + self.b_aiflags = self.b_aiflags - AI_JUMP; + } + } + else if (self.b_aiflags & AI_SUPER_JUMP) + { + if (self.weapon != WID_ROCKET_LAUNCHER) + self.impulse = 7; + + else if (self.flags & FL_ONGROUND) + { + self.b_aiflags = self.b_aiflags - AI_SUPER_JUMP; + if (bot_can_rj(self)) + { + bot_jump(); + self.v_angle_x = self.b_angle_x = 80; + self.button0 = TRUE; + } + else + bot_lost(self.target1, FALSE); + + } + } + if (self.b_aiflags & AI_SURFACE) + { + if (self.waterlevel > 2) + { + self.keys = KEY_MOVEUP; + self.button2 = TRUE; // swim! + } + else + self.b_aiflags = self.b_aiflags - AI_SURFACE; + } + if (self.b_aiflags & AI_RIDE_TRAIN) + { + // simple, but effective + // this can probably be used for a lot of different + // things, not just trains (door elevators come to mind) + b_temp3 = self; + self = self.last_way; + + if (!frik_recognize_plat(FALSE)) // if there is nothing there now + { + self = b_temp3; + self.keys = self.keys & 960; + } + else + { + self = b_temp3; + if (frik_recognize_plat(FALSE)) + { + v = realorigin(trace_ent) + trace_ent.origin - self.origin; + v_z = 0; + if (vlen(v) < 24) + self.keys = self.keys & 960; + else + { + self.b_aiflags = self.b_aiflags | AI_PRECISION; + self.keys = frik_KeysForDir(v); + } + } + } + } + if (self.b_aiflags & AI_PLAT_BOTTOM) + { + newt = FindThing("plat"); + if (newt.state != 1) + { + v = self.origin - realorigin(newt); + v_z = 0; + if (vlen(v) > 96) + self.keys = self.keys & 960; + else + frik_walkmove(v); + } + else + self.b_aiflags = self.b_aiflags - AI_PLAT_BOTTOM; + } + if (self.b_aiflags & AI_DIRECTIONAL) + { + if ((normalize(self.last_way.origin - self.origin) * self.b_dir) > 0.4) + { + self.b_aiflags = self.b_aiflags - AI_DIRECTIONAL; + bot_lost(self.target1, TRUE); + } + } + if (self.b_aiflags & AI_SNIPER) + { + self.b_aiflags = (self.b_aiflags | AI_WAIT | AI_PRECISION) - AI_SNIPER; + // FIXME: Add a switch to wep command + // FIXME: increase delay? + } + if (self.b_aiflags & AI_AMBUSH) + { + self.b_aiflags = (self.b_aiflags | AI_WAIT) - AI_AMBUSH; + // FIXME: Add a switch to wep command + // FIXME: increase delay? + } + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_path + +Bot will follow a route generated by the +begin_route set of functions in bot_way.qc. +This code, while it works pretty well, can get +confused + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_path = +{ + + local entity jj, tele; + + bot_check_lost(self.target1); + if (!self.target1) + { + self.keys=0; + return; + } + if (target_onstack(self.last_way)) + return; // old waypoint still being hunted + + jj = FindRoute(self.last_way); + if (!jj) + { + // this is an ugly hack + if (self.target1.current_way != self.last_way) + { + if (self.target1.classname != "temp_waypoint") + if (self.target1.classname != "player") + bot_lost(self.target1, FALSE); + } + + return; + } + + // update the bot's special ai features + + // Readahed types are AI conditions to perform while heading to a waypoint + // point types are AI flags that should be executed once reaching a waypoint + + self.b_aiflags = (jj.b_aiflags & AI_READAHEAD_TYPES) | (self.last_way.b_aiflags & AI_POINT_TYPES); + target_add(jj); + if (self.last_way) + { + if (CheckLinked(self.last_way, jj) == 2) // waypoints are telelinked + { + tele = FindThing("trigger_teleport"); // this is probbly the teleport responsible + target_add(tele); + } + traceline(self.last_way.origin, jj.origin, FALSE, self); // check for blockage + if (trace_fraction != 1) + { + if (trace_ent.classname == "door" && !(self.b_aiflags & AI_DOOR_NO_OPEN)) // a door blocks the way + { + // linked doors fix + if (trace_ent.owner) + trace_ent = trace_ent.owner; + if ((trace_ent.health > 0) && (self.enemy == world)) + { + self.enemy = trace_ent; + bot_weapon_switch(1); + self.b_aiflags = self.b_aiflags | AI_BLIND; // nick knack paddy hack + } + else if (trace_ent.targetname) + { + tele = find(world, target, trace_ent.targetname); + if (tele.health > 0) + { + self.enemy = tele; + bot_weapon_switch(1); + } + else + { + // target_drop(jj); + target_add(tele); + // bot_get_path(tele, TRUE); + self.b_aiflags = self.b_aiflags | AI_BLIND; // give a bot a bone + return; + } + } + } + else if (trace_ent.classname == "func_wall") + { + // give up + bot_lost(self.target1, FALSE); + return; + } + } + } + // this is used for AI_DRIECTIONAL + self.b_dir = normalize(jj.origin - self.last_way.origin); + + self.last_way = jj; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Priority Look. What a stupid name. This is where +the bot finds things it wants to kill/grab. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +// priority scale +// 0 - 10 virtually ignore +// 10 - 30 normal item range +// 30 - 50 bot will consider this a target worth changing course for +// 50 - 90 bot will hunt these as vital items + +// *!* Make sure you add code to bot_check_lost to remove the target *!* + +float(entity thing) priority_for_thing = +{ + local float thisp; + thisp = 0; + // This is the most executed function in the bot. Careful what you do here. + + if ((thing.flags & FL_ITEM) && thing.model != string_null && thing.search_time < time) + { + + // ugly hack + if (thing._last != self) + thisp = 20; + //~ ai fix start + + if (thing.classname == "item_artifact_super_damage") + thisp = 10*(random()) + 55; + else if (thing.classname == "item_artifact_invulnerability") + thisp = 10*(random()) + 55; + else if (thing.classname == "item_artifact_invisibility") + thisp = 10*(random()) + 55; + else if (thing.classname == "item_health") + { + if (thing.spawnflags & 2) + thisp = 10*(random()) + 50; + if (self.health <= 50) + thisp = 70; + } + else if (thing.classname == "weapon_rocketlauncher") + { + if(!VR_ItemUtil_EntHasItem(self, IID_ROCKET_LAUNCHER)) + thisp = 60; + } + else if (thing.classname == "weapon_lightning") + { + if(!VR_ItemUtil_EntHasItem(self, IID_LIGHTNING)) + thisp = 50; + } + else if (thing.classname == "weapon_grenadelauncher") + { + if(!VR_ItemUtil_EntHasItem(self, IID_GRENADE_LAUNCHER)) + thisp = 45; + } + else if (thing.classname == "weapon_supernailgun") + { + if(!VR_ItemUtil_EntHasItem(self, IID_SUPER_NAILGUN)) + thisp = 35; + } + else if (thing.classname == "weapon_nailgun") + { + if(!VR_ItemUtil_EntHasItem(self, IID_NAILGUN)) + thisp = 30; + } + else if (thing.classname == "weapon_supershotgun") + { + if(!VR_ItemUtil_EntHasItem(self, IID_SUPER_SHOTGUN)) + thisp = 25; + } + else if (thing.model == "progs/armor.mdl") + { + if (self.armorvalue < 200) + { + if (self.armorvalue <= 50) + thisp = 60; + else if (self.armorvalue <= 100 && thing.classname != "item_armor1") + thisp = 55; + else if (self.armorvalue <= 150 && thing.classname == "item_armorInv") + thisp = 50; + } + } + else if (thing.model == "progs/backpack.mdl") + thisp = 45; + else if (thing.classname == "item_artifact_envirosuit") + thisp = 30; + } + //~ ai fix end + else if ((thing.flags & FL_MONSTER) && thing.health > 0) + thisp = 45; + else if (thing.classname == "player") + { + if (thing.health > 0) + { + if (thing == self) + return 0; + else + { + if(VR_ItemUtil_EntHasItem(thing, IID_INVISIBILITY)) //FIXME + thisp = 2; + else if (coop) + { + thisp = 200; + if (thing.target1.classname == "player") + if (!thing.target1.ishuman) + return 0; + } + else if (teamplay && thing.team == self.team) + { + thisp = 100; + if (thing.target1.classname == "player") + return 0; + } + else thisp = 30; + } + } + } + else if (thing.classname == "waypoint") + { + if (thing.b_aiflags & AI_SNIPER) + thisp = 45; //~ ai fix + else if (thing.b_aiflags & AI_AMBUSH) + thisp = 30; + } + if (pointcontents(thing.origin) < -3) + return 0; + if (thisp) + { + if (thing.current_way) + { + // check to see if it's unreachable + if (thing.current_way.items == -1) + return 0; + else + thisp = thisp + (13000 - thing.current_way.items) * 0.05; + } + } + return thisp; +}; + +void(float scope) bot_look_for_crap = +{ + local entity foe, best; + local float thatp, bestp, dist; + + if (scope == 1) + foe = findradius(self.origin, 13000); + else + foe = findradius(self.origin, 500); + + bestp = 1; + while(foe) + { + thatp = priority_for_thing(foe); + if (thatp) + if (!scope) + if (!sisible(foe)) + thatp = 0; + if (thatp > bestp) + { + bestp = thatp; + best = foe; + dist = vlen(self.origin - foe.origin); + } + foe = foe.chain; + } + if (best == world) + return; + if (!target_onstack(best)) + { + target_add(best); + if (scope) + { + bot_get_path(best, FALSE); + self.b_aiflags = self.b_aiflags | AI_WAIT; + } + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_angle_set + +Sets the bots look keys & b_angle to point at +the target - used for fighting and just +generally making the bot look good. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_angle_set = +{ + local float h; + local vector view; + + if (self.enemy) + { + if (self.enemy.items & 524288) + if (random() > 0.01) + return; + if (self.missile_speed == 0) + self.missile_speed = 10000; + if (self.enemy.solid == SOLID_BSP) + { + view = (((self.enemy.absmin + self.enemy.absmax) * 0.5) - self.origin); + } + else + { + + local float levels; + + levels = 3; + + view = self.enemy.origin; + + while (levels) + { + h = vlen(view - self.origin) / self.missile_speed; + if (self.enemy.flags & FL_ONGROUND) + view = self.enemy.velocity * h + '0 0 -20'; + else + view = (self.enemy.velocity - (sv_gravity * '0 0 1') * h) * h; + view = self.enemy.origin + view; + traceline(self.enemy.origin, view, FALSE, self); + view = trace_endpos; + levels = levels - 1; + } + view = normalize(view - self.origin); + } + view = vectoangles(view); + view_x = view_x * -1; + self.b_angle = view; + } + else if (self.target1) + { + view = realorigin(self.target1); + if (self.target1.flags & FL_ITEM) + view = view + '0 0 48'; + view = view - (self.origin + self.view_ofs); + view = vectoangles(view); + view_x = view_x * -1; + self.b_angle = view; + } + else + self.b_angle_x = 0; + // HACK HACK HACK HACK + // The bot falls off ledges a lot because of "turning around" + // so let the bot use instant turn around when not hunting a player + if (self.b_skill == 3) + { + self.keys = self.keys & 63; + self.v_angle = self.b_angle; + while (self.v_angle_x < -180) + self.v_angle_x = self.v_angle_x + 360; + while (self.v_angle_x > 180) + self.v_angle_x = self.v_angle_x - 360; + + } + else if ((self.enemy == world || self.enemy.movetype == MOVETYPE_PUSH) && self.target1.classname != "player") + { + self.keys = self.keys & 63; + self.v_angle = self.b_angle; + while (self.v_angle_x < -180) + self.v_angle_x = self.v_angle_x + 360; + while (self.v_angle_x > 180) + self.v_angle_x = self.v_angle_x - 360; + } + else if (self.b_skill < 2) // skill 2 handled in bot_phys + { + if (self.b_angle_x > 180) + self.b_angle_x = self.b_angle_x - 360; + self.keys = self.keys & 63; + + if (angcomp(self.b_angle_y, self.v_angle_y) > 10) + self.keys = self.keys | KEY_LOOKLEFT; + else if (angcomp(self.b_angle_y, self.v_angle_y) < -10) + self.keys = self.keys | KEY_LOOKRIGHT; + if (angcomp(self.b_angle_x, self.v_angle_x) < -10) + self.keys = self.keys | KEY_LOOKUP; + else if (angcomp(self.b_angle_x, self.v_angle_x) > 10) + self.keys = self.keys | KEY_LOOKDOWN; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotAI + +This is the main ai loop. Though called every +frame, the ai_time limits it's actual updating + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float stagger_think; + +void() BotAI = +{ + // am I dead? Fire randomly until I respawn + // health < 1 is used because fractional healths show up as 0 on normal player + // status bars, and the mod probably already compensated for that + + if (self.health < 1) + { + self.button0 = floor(random() * 2); + self.button2 = 0; + self.keys = 0; + self.b_aiflags = 0; + ClearMyRoute(); + self.target1 = self.target2 = self.target3 = self.target4 = self.enemy = world; + self.last_way = world; + return; + } + + // stagger the bot's AI out so they all don't think at the same time, causing game + // 'spikes' + if (self.b_skill < 2) + { + if (self.ai_time > time) + return; + + self.ai_time = time + 0.05; + if (bot_count > 0) + { + if ((time - stagger_think) < (0.1 / bot_count)) + self.ai_time = self.ai_time + 0.1 / (2 * bot_count); + } + else + return; + } + if (self.view_ofs == '0 0 0') + bot_start_topic(7); + stagger_think = time; + + // shut the bot's buttons off, various functions will turn them on by AI end + + self.button2 = 0; + self.button0 = 0; + + + // target1 is like goalentity in normal Quake monster AI. + // it's the bot's most immediate target + if (route_table == self) + { + if (busy_waypoints <= 0) + { + if (waypoint_mode < WM_EDITOR) + bot_look_for_crap(TRUE); + } + self.b_aiflags = 0; + self.keys = 0; + } + else if (self.target1) + { + frik_movetogoal(); + bot_path(); + } + else + { + if (waypoint_mode < WM_EDITOR) + { + if(self.route_failed) + { + if (waypoint_mode == WM_DYNAMIC) + frik_bot_roam(); + else + self.keys = 0; + self.route_failed = 0; + } + else if(!begin_route()) + { + bot_look_for_crap(FALSE); + self.keys = 0; + } + + } + else + { + self.b_aiflags = AI_WAIT; + self.keys = 0; + } + } + + // bot_angle_set points the bot at it's goal (self.enemy or target1) + + bot_angle_set(); + + // fight my enemy. Enemy is probably a field QC coders will most likely use a lot + // for their own needs, since it's unused on a normal player + // FIXME + if (self.enemy) + bot_fight_style(); + else if (random() < 0.2) + if (random() < 0.2) + bot_weapon_switch(-1); + bot_dodge_stuff(); + + // checks to see if bot needs to start going up for air + if (self.waterlevel > 2) + { + if (time > (self.air_finished - 2)) + { + traceline (self.origin, self.origin + '0 0 6800', TRUE, self); + if (trace_inopen) + { + self.keys = KEY_MOVEUP; + self.button2 = TRUE; // swim! + return; // skip ai flags for now - this is life or death + } + } + } + + // b_aiflags handling + + + if (self.b_aiflags) + bot_handle_ai(); + else + bot_chat(); // don't want chat to screw him up if he's rjing or something +}; diff --git a/QC_other/QC_frikbot/frikbot/bot_ed.qc b/QC_other/QC_frikbot/frikbot/bot_ed.qc new file mode 100644 index 00000000..2d326e95 --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_ed.qc @@ -0,0 +1,1646 @@ +/*********************************************** +* * +* FrikBot Waypoint Editor * +* "The 'wtf is this doing in my mod' code" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +float saved1, saved2, saved3, scratch1, scratch2, scratch3, scratch4; +float bytecounter, filecount; + +float MENU_MAIN = 1; +float MENU_WAYPOINTS = 2; +float MENU_LINKS = 3; +float MENU_FLAGS = 4; +float MENU_FLAGS2 = 5; +float MENU_BOTS = 6; +float MENU_WAYLIST = 7; +// 8 = link way +// 9 = telelink way +// 10 = delete link +// 11 = create link X2 +// 12 = delete link x2 +// 13 = confirmation of delete all +// 14 = Teleport to way +// 15 = confirmation of delete point + +void() BSPDumpWaypoints; +void() QCDumpWaypoints; +void() DumpWaypoints; +void() SaveWays; +/* +// source for the menu strings... + +\b-- Main Menu --\b\n +\[\1\] >>Waypoint Management\n +\[\2\] >>Link Management \n +\[\3\] >>AI Flag Management \n +\[\4\] >>Bot Management \n +\[\5\] >>Waylist Management \n +\[\6\] \[\{133}\] Noclip \n +\[\7\] \[\{133}\] Godmode \n +\[\8\] \[\{133}\] Hold Select \n +\[\9\] Teleport to Way # \n +\[\0\] Close Menu \n + +// missing from main is show way info +// iffy on the teleport to way thing being on main...seems like either a bot or way list thing + +\b-- Waypoint Management --\b\n +\[\1\] Move Waypoint \n +\[\2\] Delete Waypoint \n +\[\3\] Make Waypoint \n +\[\4\] Make Way + Link \n +\[\5\] Make Way + Link X2 \n +\[\6\] Make Way + Telelink \n +\[\7\] Show waypoint info \n +\[\8\] >>Link Management \n +\[\9\] >>AI Flag Management \n +\[\0\] >>Main Menu \n + +\b-- Link Management --\b\n +\[\1\] Unlink Waypoint \n +\[\2\] Create Link \n +\[\3\] Create Telelink \n +\[\4\] Delete Link \n +\[\5\] Create Link X2 \n +\[\6\] Delete Link X2 \n +\[\7\] >Make Waypoint \n +\[\8\] >>Waypoint Management\n +\[\9\] >>AI Flag Management \n +\[\0\] >>Main Menu \n + +// Ai flags...ugh + +\b-- AI Flag Management --\b\n +\[\1\] \[\{133}\] Door Flag \n +\[\2\] \[\{133}\] Precision \n +\[\3\] \[\{133}\] Surface for air \n +\[\4\] \[\{133}\] Blind mode \n +\[\5\] \[\{133}\] Jump \n +\[\6\] \[\{133}\] Directional \n +\[\7\] \[\{133}\] Super Jump \n +\n +\[\9\] >>AI Flags page 2 \n +\[\0\] >>Main Menu \n + +\b-- AI Flags pg. 2--\b\n +\[\1\] \[\{133}\] Difficult \n +\[\2\] \[\{133}\] Wait for plat \n +\[\3\] \[\{133}\] Ride train \n +\[\4\] \[\{133}\] Door flag no open\n +\[\5\] \[\{133}\] Ambush \n +\[\6\] \[\{133}\] Snipe \n +\[\7\] \[\{133}\] Trace Test \n +\n +\[\9\] >>AI Flag Management \n +\[\0\] >>Main Menu \n + +\b-- Bot Management --\b\n +\[\1\] Add a Test Bot \n +\[\2\] Order Test Bot here \n +\[\3\] Remove Test Bot \n +\[\4\] Stop Test Bot \n +\[\5\] Teleport Bot here \n +\[\6\] Teleport to Way # \n +\n +\n +\n +\[\0\] >>Main Menu \n + +\b-- Waylist Management --\b\n +\[\1\] Delete ALL Waypoints \n +\[\2\] Dump Waypoints \n +\[\3\] Check For Errors \n +\[\4\] Save Waypoints \n +\[\5\] \[\{133}\] Dynamic Mode \n +\[\6\] \[\{133}\] Dynamic Link \n +\[\7\] \[\{133}\] WAY output \n +\[\8\] \[\{133}\] QC output \n +\[\9\] \[\{133}\] BSP ents output \n +\[\0\] Main Menu \n + +\b-- Misc Commands --\b\n +\[\1\] Teleport to Selected \n +\[\2\] Select \n +\[\3\] Swap to old \n +\[\4\] Trace select \n +\[\5\] Create way in path \n +\[\6\] Delete Way from path \n + + +\b-- Editor Memory --\b\n +\[\1\] Store as slot 1 \n +\[\2\] Store as slot 2 \n +\[\3\] Store as slot 3 \n +\[\4\] Store as slot 4 \n +\[\5\] Recall slot 1 \n +\[\6\] Recall slot 2 \n +\[\7\] Recall slot 3 \n +\[\8\] Recall slot 4 \n + +*/ + +void() bot_menu_display = +{ +// build options + local string s1, s2, s3, s4, s5, s6, s7, h; + local entity t; + +// check impulses + if (self.impulse > 0 && self.impulse < 11 && self.b_menu) + { + if (self.b_menu == MENU_MAIN) + { + if (self.impulse == 1) + { + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + else if (self.impulse == 3) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if (self.impulse == 4) + { + self.b_menu = MENU_BOTS; + self.b_menu_time = time; + } + else if (self.impulse == 5) + { + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + else if (self.impulse == 6) + { + if (self.movetype == MOVETYPE_NOCLIP) + self.movetype = MOVETYPE_WALK; + else + self.movetype = MOVETYPE_NOCLIP; + self.b_menu_time = time; + + } + else if (self.impulse == 7) + { + if (self.flags & FL_GODMODE) + self.flags = self.flags - FL_GODMODE; + else + self.flags = self.flags | FL_GODMODE; + self.b_menu_time = time; + + } + else if (self.impulse == 8) + { + if (self.b_aiflags & AI_HOLD_SELECT) + self.b_aiflags = self.b_aiflags - AI_HOLD_SELECT; + else + self.b_aiflags = self.b_aiflags | AI_HOLD_SELECT; + self.b_menu_time = time; + } + else if (self.impulse == 9) + { + self.b_menu = 14; + self.b_menu_time = time; + } + else if (self.impulse == 10) + bot_way_edit(); + } + else if (self.b_menu == MENU_WAYPOINTS) + { + if (self.impulse == 1) + { + if (self.current_way) + setorigin(self.current_way, self.origin + self.view_ofs); + } + else if (self.impulse == 2) + { + if (self.current_way) + { + self.b_menu = 15; + self.b_menu_time = time; + self.last_way = self.current_way; + } + } + else if (self.impulse == 3) + { + make_waypoint(self.origin + self.view_ofs); + } + else if (self.impulse == 4) + { + t = make_waypoint(self.origin + self.view_ofs); + if (!LinkWays(self.current_way, t)) + sprint(self, "Unable to link them\n"); + } + else if (self.impulse == 5) + { + t = make_waypoint(self.origin + self.view_ofs); + if (!LinkWays(self.current_way, t)) + sprint(self, "Unable to link old to new\n"); + LinkWays(t, self.current_way); + } + else if (self.impulse == 6) + { + t = make_waypoint(self.origin + self.view_ofs); + if (!TeleLinkWays(self.current_way, t)) + sprint(self, "Unable to link them\n"); + } + else if (self.impulse == 7) + { + if (self.current_way) + { + sprint(self, "\nwaypoint info for waypoint #"); + h = ftos(self.current_way.count); + sprint(self, h); + sprint(self, "\nAI Flag value: "); + h = ftos(self.current_way.b_aiflags); + sprint(self, h); + + if (self.current_way.target1) + { + h = ftos(self.current_way.target1.count); + if (self.current_way.b_aiflags & AI_TELELINK_1) + sprint(self, "\nTelelink1 to:"); + else + sprint(self, "\nLink1 to:"); + sprint(self, h); + } + if (self.current_way.target2) + { + h = ftos(self.current_way.target2.count); + if (self.current_way.b_aiflags & AI_TELELINK_2) + sprint(self, "\nTelelink2 to:"); + else + sprint(self, "\nLink2 to:"); + sprint(self, h); + } + if (self.current_way.target3) + { + h = ftos(self.current_way.target3.count); + if (self.current_way.b_aiflags & AI_TELELINK_3) + sprint(self, "\nTelelink3 to:"); + else + sprint(self, "\nLink3 to:"); + sprint(self, h); + } + if (self.current_way.target4) + { + h = ftos(self.current_way.target4.count); + if (self.current_way.b_aiflags & AI_TELELINK_4) + sprint(self, "\nTelelink4 to:"); + else + sprint(self, "\nLink4 to:"); + sprint(self, h); + } + sprint(self, "\n\n"); + } + + } + if (self.impulse == 8) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + else if (self.impulse == 9) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if (self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if (self.b_menu == MENU_LINKS) + { + if (self.impulse == 1) + { + self.b_menu = 16; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if (self.impulse == 2) + { + self.b_menu = 8; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if (self.impulse == 3) + { + self.b_menu = 9; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if (self.impulse == 4) + { + self.b_menu = 10; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if (self.impulse == 5) + { + self.b_menu = 11; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if (self.impulse == 6) + { + self.b_menu = 12; + self.b_menu_time = time; + self.last_way = self.current_way; + } + else if (self.impulse == 7) + make_waypoint(self.origin + self.view_ofs); + else if (self.impulse == 8) + { + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + else if (self.impulse == 9) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if (self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if (self.b_menu == MENU_FLAGS) + { + + if (self.current_way) + { + if (self.impulse == 1) + { + if (self.current_way.b_aiflags & AI_DOORFLAG) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOORFLAG); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOORFLAG; + + self.b_menu_time = time; + } + else if (self.impulse == 2) + { + if (self.current_way.b_aiflags & AI_PRECISION) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PRECISION); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; + self.b_menu_time = time; + } + else if (self.impulse == 3) + { + if (self.current_way.b_aiflags & AI_SURFACE) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SURFACE); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SURFACE; + self.b_menu_time = time; + } + else if (self.impulse == 4) + { + if (self.current_way.b_aiflags & AI_BLIND) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_BLIND); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; + self.b_menu_time = time; + } + else if (self.impulse == 5) + { + if (self.current_way.b_aiflags & AI_JUMP) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_JUMP); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_JUMP; + self.b_menu_time = time; + } + else if (self.impulse == 6) + { + if (self.current_way.b_aiflags & AI_DIRECTIONAL) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIRECTIONAL); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIRECTIONAL; + self.b_menu_time = time; + } + else if (self.impulse == 7) + { + if (self.current_way.b_aiflags & AI_SUPER_JUMP) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SUPER_JUMP); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SUPER_JUMP; + self.b_menu_time = time; + } + } + if (self.impulse == 9) + { + self.b_menu = MENU_FLAGS2; + self.b_menu_time = time; + } + else if (self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if (self.b_menu == MENU_FLAGS2) + { + + if (self.current_way) + { + if (self.impulse == 1) + { + if (self.current_way.b_aiflags & AI_DIFFICULT) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIFFICULT); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIFFICULT; self.b_menu_time = time; + } + else if (self.impulse == 2) + { + if (self.current_way.b_aiflags & AI_PLAT_BOTTOM) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PLAT_BOTTOM); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PLAT_BOTTOM; + self.b_menu_time = time; + } + else if (self.impulse == 3) + { + if (self.current_way.b_aiflags & AI_RIDE_TRAIN) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_RIDE_TRAIN); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_RIDE_TRAIN; + self.b_menu_time = time; + } + else if (self.impulse == 4) + { + if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOOR_NO_OPEN); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOOR_NO_OPEN; + self.b_menu_time = time; + } + else if (self.impulse == 5) + { + if (self.current_way.b_aiflags & AI_AMBUSH) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_AMBUSH); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_AMBUSH; + self.b_menu_time = time; + } + else if (self.impulse == 6) + { + if (self.current_way.b_aiflags & AI_SNIPER) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SNIPER); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SNIPER; + self.b_menu_time = time; + } + else if (self.impulse == 7) + { + if (self.current_way.b_aiflags & AI_TRACE_TEST) + self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_TRACE_TEST); + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_TRACE_TEST; + self.b_menu_time = time; + } + + } + if (self.impulse == 9) + { + self.b_menu = MENU_FLAGS; + self.b_menu_time = time; + } + else if (self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + + else if (self.b_menu == MENU_BOTS) + { + if (self.impulse == 1) + { + self.impulse = 100; + return; + } + else if (self.impulse == 2) + { + b_temp3 = self; + self = player_head; + while(self) + { + if (!self.ishuman) + { + target_add(b_temp3); + bot_get_path(b_temp3, TRUE); + self = world; + } + else + self = self._next; + } + self = b_temp3; + } + else if (self.impulse == 3) + { + self.impulse = 102; + return; + } + else if (self.impulse == 4) + { + b_temp1 = self; + self = player_head; + while(self) + { + if (!self.ishuman) + { + self.target1 = self.target2 = self.target3 = self.target4 = world; + route_table = world; + } + self = self._next; + } + self = b_temp1; + } + else if (self.impulse == 5) + { + if (self.current_way) + { + b_temp1 = self; + self = player_head; + while(self) + { + if (!self.ishuman) + { + setorigin(self, b_temp1.current_way.origin); + } + self = self._next; + } + self = b_temp1; + } + else + sprint(self, "select a waypoint first\n"); + } + else if (self.impulse == 6) + { + self.b_menu = 14; + self.b_menu_time = time; + } + else if (self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if (self.b_menu == MENU_WAYLIST) + { + if (self.impulse == 1) + { + self.b_menu = 13; + self.b_menu_time = time; + } + else if (self.impulse == 2) + { + if (dump_mode == 0) + DumpWaypoints(); + else if (dump_mode == 1) + QCDumpWaypoints(); + else if (dump_mode == 2) + BSPDumpWaypoints(); + } + else if (self.impulse == 3) + { + t = way_head; + while(t) + { + if ((t.target1 == world) && (t.target2 == world) && (t.target3 == world) && (t.target4 == world)) + { + sprint(self, "Waypoint #"); + h = ftos(t.count); + sprint(self, h); + sprint(self, " has no outbound links\n"); + } + if ((t.target1 == t) || (t.target2 == t) || (t.target3 == t) || (t.target4 == t)) + { + sprint(self, "Waypoint #"); + h = ftos(t.count); + sprint(self, h); + sprint(self, " links to itself (??)\n"); + } + t = t._next; + } + sprint(self, "Error check complete\n"); + } + else if (self.impulse == 4) + { + // FIXME: detect engine feature and skip prompt + + /* if (cvar("pr_checkextension")) + { + if (frik_checkextension("FRIK_FILE")) + { + SaveWays(); + } + self.b_menu = 17; + self.b_menu_time = time; + } + else */ + { + self.b_menu = 17; + self.b_menu_time = time; + } + } + else if (self.impulse == 5) + { + if (waypoint_mode == WM_EDITOR_DYNAMIC) + waypoint_mode = WM_EDITOR; + else + waypoint_mode = WM_EDITOR_DYNAMIC; + self.b_menu_time = time; + + } + else if (self.impulse == 6) + { + if (waypoint_mode == WM_EDITOR_DYNLINK) + waypoint_mode = WM_EDITOR; + else + waypoint_mode = WM_EDITOR_DYNLINK; + self.b_menu_time = time; + } + else if (self.impulse == 7) + { + dump_mode = 0; + self.b_menu_time = time; + } + else if (self.impulse == 8) + { + dump_mode = 1; + self.b_menu_time = time; + } + else if (self.impulse == 9) + { + dump_mode = 2; + self.b_menu_time = time; + } + else if (self.impulse == 10) + { + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + } + else if (self.b_menu == 8) + { + if (self.impulse == 1) + { + if (self.current_way) + { + if (!LinkWays(self.last_way, self.current_way)) + sprint(self, "Unable to link them\n"); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 9) + { + if (self.impulse == 1) + { + if (self.current_way) + { + if (!TeleLinkWays(self.last_way, self.current_way)) + sprint(self, "Unable to link them\n"); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 10) + { + if (self.impulse == 1) + { + if (self.current_way) + { + UnlinkWays(self.last_way, self.current_way); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 11) + { + if (self.impulse == 1) + { + if (self.current_way) + { + if (!LinkWays(self.last_way, self.current_way)) + sprint(self, "Unable to link 1 to 2\n"); + if (!LinkWays(self.current_way, self.last_way)) + sprint(self, "Unable to link 2 to 1\n"); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 12) + { + if (self.impulse == 1) + { + if (self.current_way) + { + UnlinkWays(self.last_way, self.current_way); + UnlinkWays(self.current_way, self.last_way); + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 13) + { + if (self.impulse == 1) + { + ClearAllWays(); + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + else if (self.impulse == 2) + { + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + } + else if (self.b_menu == 14) + { + if (self.impulse == 10) + self.impulse = 0; + self.b_menu_value = self.b_menu_value * 10 + self.impulse; + self.b_menu_time = 0; + } + else if (self.b_menu == 15) + { + if (self.impulse == 1) + { + delete_waypoint(self.last_way); + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + else if (self.impulse == 2) + { + self.b_menu = MENU_WAYPOINTS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 16) + { + if (self.impulse == 1) + { + if (self.last_way) + { + self.last_way.target1 = self.last_way.target2 = self.last_way.target3 = self.last_way.target4 = world; + self.last_way.b_aiflags = self.last_way.b_aiflags - (self.last_way.b_aiflags & 15); + } + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + else if (self.impulse == 2) + { + self.b_menu = MENU_LINKS; + self.b_menu_time = time; + } + } + else if (self.b_menu == 17) + { + if (self.impulse < 3) + { + self.b_menu = MENU_WAYLIST; + self.b_menu_time = time; + } + } + self.impulse = 0; + } + if (self.b_menu_time <= time) + { + if (self.b_menu == MENU_MAIN) + { + s1 = "\b-- Main Menu --\b\n\[\1\] >>Waypoint Management\n\[\2\] >>Link Management \n\[\3\] >>AI Flag Management \n\[\4\] >>Bot Management \n\[\5\] >>Waylist Management \n"; + if (self.movetype == MOVETYPE_NOCLIP) + s2 = "\[\6\] \[\{133}\] Noclip \n"; + else + s2 = "\[\6\] \[ \] Noclip \n"; + + if (self.flags & FL_GODMODE) + s3 = "\[\7\] \[\{133}\] Godmode \n"; + else + s3 = "\[\7\] \[ \] Godmode \n"; + if (self.b_aiflags & AI_HOLD_SELECT) + s4 = "\[\8\] \[\{133}\] Hold Select \n"; + else + s4 = "\[\8\] \[ \] Hold Select \n"; + s5 = "\[\9\] Teleport to Way # \n\[\0\] Close Menu \n"; + } + else if (self.b_menu == MENU_WAYPOINTS) + { + s1 = "\b-- Waypoint Management --\b\n\[\1\] Move Waypoint \n\[\2\] Delete Waypoint \n\[\3\] Make Waypoint \n\[\4\] Make Way + Link \n\[\5\] Make Way + Link X2 \n\[\6\] Make Way + Telelink \n\[\7\] Show waypoint info \n\[\8\] >>Link Management \n\[\9\] >>AI Flag Management \n\[\0\] >>Main Menu \n"; + } + else if (self.b_menu == MENU_LINKS) + { + s1 = "\b-- Link Management --\b\n\[\1\] Unlink Waypoint \n\[\2\] Create Link \n\[\3\] Create Telelink \n\[\4\] Delete Link \n\[\5\] Create Link X2 \n\[\6\] Delete Link X2 \n\[\7\] >Make Waypoint \n\[\8\] >>Waypoint Management\n\[\9\] >>AI Flag Management \n\[\0\] >>Main Menu \n"; + } + else if (self.b_menu == MENU_FLAGS) + { + if (self.current_way.b_aiflags & AI_DOORFLAG) + s1 = "\b-- AI Flag Management --\b\n\[\1\] \[\{133}\] Door Flag \n"; + else + s1 = "\b-- AI Flag Management --\b\n\[\1\] \[ \] Door Flag \n"; + + if (self.current_way.b_aiflags & AI_PRECISION) + s2 = "\[\2\] \[\{133}\] Precision \n"; + else + s2 = "\[\2\] \[ \] Precision \n"; + + if (self.current_way.b_aiflags & AI_SURFACE) + s3 = "\[\3\] \[\{133}\] Surface for air \n"; + else + s3 = "\[\3\] \[ \] Surface for air \n"; + + if (self.current_way.b_aiflags & AI_BLIND) + s4 = "\[\4\] \[\{133}\] Blind mode \n"; + else + s4 = "\[\4\] \[ \] Blind mode \n"; + + if (self.current_way.b_aiflags & AI_JUMP) + s5 = "\[\5\] \[\{133}\] Jump \n"; + else + s5 = "\[\5\] \[ \] Jump \n"; + + if (self.current_way.b_aiflags & AI_DIRECTIONAL) + s6 = "\[\6\] \[\{133}\] Directional \n"; + else + s6 = "\[\6\] \[ \] Directional \n"; + + if (self.current_way.b_aiflags & AI_SUPER_JUMP) + s7 = "\[\7\] \[\{133}\] Super Jump \n\n\[\9\] >>AI Flags page 2 \n\[\0\] >>Main Menu \n"; + else + s7 = "\[\7\] \[ \] Super Jump \n\n\[\9\] >>AI Flags page 2 \n\[\0\] >>Main Menu \n"; + } + else if (self.b_menu == MENU_FLAGS2) + { + if (self.current_way.b_aiflags & AI_DIFFICULT) + s1 = "\b-- AI Flags pg. 2--\b\n\[\1\] \[\{133}\] Difficult \n"; + else + s1 = "\b-- AI Flags pg. 2--\b\n\[\1\] \[ \] Difficult \n"; + + if (self.current_way.b_aiflags & AI_PLAT_BOTTOM) + s2 = "\[\2\] \[\{133}\] Wait for plat \n"; + else + s2 = "\[\2\] \[ \] Wait for plat \n"; + + if (self.current_way.b_aiflags & AI_RIDE_TRAIN) + s3 = "\[\3\] \[\{133}\] Ride train \n"; + else + s3 = "\[\3\] \[ \] Ride train \n"; + + if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN) + s4 = "\[\4\] \[\{133}\] Door flag no open\n"; + else + s4 = "\[\4\] \[ \] Door flag no open\n"; + + if (self.current_way.b_aiflags & AI_AMBUSH) + s5 = "\[\5\] \[\{133}\] Ambush \n"; + else + s5 = "\[\5\] \[ \] Ambush \n"; + + if (self.current_way.b_aiflags & AI_SNIPER) + s6 = "\[\6\] \[\{133}\] Snipe \n"; + else + s6 = "\[\6\] \[ \] Snipe \n"; + + if (self.current_way.b_aiflags & AI_TRACE_TEST) + s7 = "\[\7\] \[\{133}\] Trace Test \n\n\[\9\] >>AI Flag Management \n\[\0\] >>Main Menu \n"; + else + s7 = "\[\7\] \[ \] Trace Test \n\n\[\9\] >>AI Flag Management \n\[\0\] >>Main Menu \n"; + + } + else if (self.b_menu == MENU_BOTS) + { + s1 = "\b-- Bot Management --\b\n\[\1\] Add a Test Bot \n\[\2\] Order Test Bot here \n\[\3\] Remove Test Bot \n\[\4\] Stop Test Bot \n\[\5\] Teleport Bot here \n\[\6\] Teleport to Way # \n\n\n\n\[\0\] >>Main Menu \n"; + } + else if (self.b_menu == MENU_WAYLIST) + { + s1 = "\b-- Waylist Management --\b\n\[\1\] Delete ALL Waypoints \n\[\2\] Dump Waypoints \n\[\3\] Check For Errors \n\[\4\] Save Waypoints \n"; + + if (waypoint_mode == WM_EDITOR_DYNAMIC) + s2 = "\[\5\] \[\{133}\] Dynamic Mode \n\[\6\] \[\{133}\] Dynamic Link \n"; + else if (waypoint_mode == WM_EDITOR_DYNLINK) + s2 = "\[\5\] \[ \] Dynamic Mode \n\[\6\] \[\{133}\] Dynamic Link \n"; + else + s2 = "\[\5\] \[ \] Dynamic Mode \n\[\6\] \[ \] Dynamic Link \n"; + if (dump_mode == 0) + s3 = "\[\7\] \[\{133}\] WAY output \n\[\8\] \[ \] QC output \n\[\9\] \[ \] BSP ents output \n\[\0\] Main Menu \n"; + else if (dump_mode == 1) + s3 = "\[\7\] \[ \] WAY output \n\[\8\] \[\{133}\] QC output \n\[\9\] \[ \] BSP ents output \n\[\0\] Main Menu \n"; + else if (dump_mode == 2) + s3 = "\[\7\] \[ \] WAY output \n\[\8\] \[ \] QC output \n\[\9\] \[\{133}\] BSP ents output \n\[\0\] Main Menu \n"; + + } + else if (self.b_menu == 8) + s1 = "\b-- Link Ways --\b\n\nSelect another way and push 1\nor press 2 to cancel"; + else if (self.b_menu == 9) + s1 = "\b-- Telelink Ways --\b\n\nSelect another way and push 1\nor press 2 to cancel"; + else if (self.b_menu == 10) + s1 = "\b-- Delete Link --\b\n\nSelect another way and push 1\nor press 2 to cancel"; + else if (self.b_menu == 11) + s1 = "\b-- Create Link X2 --\b\n\nSelect another way and push 1\nor press 2 to cancel"; + else if (self.b_menu == 12) + s1 = "\b-- Delete Link X2 --\b\n\nSelect another way and push 1\nor press 2 to cancel"; + else if (self.b_menu == 13) + s1 = "\b-- Delete ALL Ways --\b\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; + else if (self.b_menu == 14) + { + s1 = "\b-- Teleport to Way # --\b\n\nEnter way number and press\nimpulse 104 to warp\n\nWaypoint #"; + s2 = ftos(self.b_menu_value); + + } + else if (self.b_menu == 15) + s1 = "\b-- Delete Waypoint --\b\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; + else if (self.b_menu == 16) + s1 = "\b-- Unlink Waypoint --\b\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; + else if (self.b_menu == 17) + s1 = "\b-- Save Waypoints --\b\n\nSave Waypoints requires\nFRIK_FILE support from\nwww.quakesrc.org to be present\n in the engine code.\n Push 1 to return to previous menu."; + + frik_big_centerprint(self, s1, s2, s3, s4, s5, s6, s7); + self.b_menu_time = time + 1.25; + } +}; + + +// engage menu +void() bot_way_edit = +{ + local entity t; + local float f; + if (self.b_menu_value) + { + if (self.b_menu == 14) + { + t = WaypointForNum(self.b_menu_value); + if (t) + setorigin(self, t.origin - self.view_ofs); + else + sprint(self, "No waypoint with that number\n"); + + self.b_menu = MENU_MAIN; + self.b_menu_time = time; + } + self.b_menu_value = 0; + return; + } + if (waypoint_mode < WM_EDITOR) + { + self.b_menu = MENU_MAIN; + waypoint_mode = WM_EDITOR; + self.b_menu_time = 0; + cvar_set("saved2", "0"); + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n"); + localcmd("cmdline\n"); + t = way_head; + while (t) + { + setmodel(t, "progs/s_bubble.spr"); // show the waypoints + t = t._next; + } + if (self.current_way) + setmodel(self.current_way, "progs/s_light.spr"); + } + else + { + saved2 = cvar("saved2"); + if (saved2 != 0) + { + f = self.b_menu; + self.b_menu = floor(saved2/16); + self.impulse = saved2 & 15; + bot_menu_display(); + if (self.b_menu == floor(saved2/16)) + self.b_menu = f; + cvar_set("saved2", "0"); + return; + } + self.b_menu = 0; + waypoint_mode = WM_LOADED; + t = way_head; + while (t) + { + setmodel(t, string_null); // hide the waypoints + t = t._next; + } + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Saving to file. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +// bytecount is really iffy +// since there is no true way to determine the length of an ftos +// it uses an approximate of 5 +// various other things are guesses, but I don't cut it at the absolute +// max so it should be okay + +void() PrintWaypoint = +{ + local entity t; + local float needcolon; + local string h; + + if (self.enemy == world) + t = way_head; + else + t = self.enemy._next; + if (bytecounter >= 8000) + { + bprint("exec maps/"); + bprint(mapname); + bprint(".wa"); + h = ftos(filecount); + bprint(h); + filecount = filecount + 1; + bprint("\n// **** break here ****\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + bytecounter = 26; + } + if (t == world) + { + remove(self); + fixer = world; + bprint("saved4 3\n// end waypoint dump\n"); + bytecounter = bytecounter + 27; + return; + } +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + if ((t.origin_x != saved1) || (t.count == 1)) + { + bprint("saved1 "); + h = ftos(t.origin_x); + bprint(h); + saved1 = t.origin_x; + bytecounter = bytecounter + 12; + needcolon = TRUE; + } + if ((t.origin_y != saved2) || (t.count == 1)) + { + if (needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("saved2 "); + h = ftos(t.origin_y); + bprint(h); + bytecounter = bytecounter + 12; + saved2 = t.origin_y; + } + if ((t.origin_z != saved3) || (t.count == 1)) + { + if (needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("saved3 "); + h = ftos(t.origin_z); + bprint(h); + bytecounter = bytecounter + 12; + saved3 = t.origin_z; + } + if (needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + bytecounter = bytecounter + 1; + bprint("\n"); + needcolon = FALSE; + } + if ((scratch1 != t.target1.count) || t.count == 1) + { + needcolon = TRUE; + bprint("scratch1 "); + bytecounter = bytecounter + 14; + h = ftos(t.target1.count); + bprint(h); + scratch1 = t.target1.count; + } + if ((scratch2 != t.target2.count) || t.count == 1) + { + if (needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("scratch2 "); + bytecounter = bytecounter + 14; + h = ftos(t.target2.count); + bprint(h); + scratch2 = t.target2.count; + } + if ((scratch3 != t.target3.count) || t.count == 1) + { + if (needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("scratch3 "); + bytecounter = bytecounter + 14; + h = ftos(t.target3.count); + bprint(h); + scratch3 = t.target3.count; + } + if ((scratch4 != t.target4.count) || t.count == 1) + { + if (needcolon) + { + bprint("; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + bprint("scratch4 "); + bytecounter = bytecounter + 14; + h = ftos(t.target4.count); + bprint(h); + scratch4 = t.target4.count; + } + if (needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + bprint("\n"); + needcolon = FALSE; + } + bprint("saved4 "); + bytecounter = bytecounter + 19; + if (t.count != 1) + h = ftos(t.b_aiflags * 4 + 2); + else + h = ftos(t.b_aiflags * 4 + 1); + bprint(h); + bprint ("; wait\n"); + self.nextthink = time + 0.01; + self.enemy = t; +}; + +// to allow for 100+ waypoints, we need to trick the runaway loop counter +void() DumpWaypoints = +{ + bytecounter = 50; + filecount = 1; + + bprint("// "); + bprint(world.message); + bprint(" - maps/"); // 2001-09-10 FrikBot support by FrikaC/Maddes + bprint(mapname); + bprint(".way\n"); + bprint("// Ways by "); + bprint(self.netname); + bprint("\n"); + if (!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = PrintWaypoint; + fixer.enemy = world; + } +}; + +void() PrintQCWaypoint = +{ + local entity t; + local string h; + + if (self.enemy == world) + t = way_head; + else + t = self.enemy._next; + + if (t == world) + { + remove(self); + fixer = world; + bprint("};\n// End dump\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + return; + } + bprint(" make_way("); +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + h = vtos(t.origin); + bprint(h); + bprint(", '"); + h = ftos(t.target1.count); + bprint(h); + bprint(" "); + h = ftos(t.target2.count); + bprint(h); + bprint(" "); + h = ftos(t.target3.count); + bprint(h); + bprint("', "); + h = ftos(t.target4.count); + bprint(h); + bprint(", "); + h = ftos(t.b_aiflags); + bprint(h); + bprint(");\n"); + self.nextthink = time + 0.01; + self.enemy = t; + +}; + +void() QCDumpWaypoints = +{ + bprint("/* QC Waypoint Dump - src/frikbot/map_"); + + bprint(mapname); + bprint(".qc\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, float flargs) make_way;\n"); + bprint("// Ways by "); + bprint(self.netname); + bprint("\n\n"); + + bprint("void() map_"); + bprint(mapname); + bprint(" =\n{\n"); + + if (!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = PrintQCWaypoint; + fixer.enemy = world; + } +}; + +void() PrintBSPWaypoint = +{ + local entity t; + local string h; + + if (self.enemy == world) + t = way_head; + else + t = self.enemy._next; + + if (t == world) + { + bprint("// End dump\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + remove(self); + fixer = world; + return; + } + bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \""); +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + h = ftos(t.origin_x); + bprint(h); + bprint(" "); + h = ftos(t.origin_y); + bprint(h); + bprint(" "); + h = ftos(t.origin_z); + bprint(h); + if (t.target1.count) + { + bprint("\"\n\"b_pants\" \""); + h = ftos(t.target1.count); + bprint(h); + } + if (t.target2.count) + { + bprint("\"\n\"b_skill\" \""); + h = ftos(t.target2.count); + bprint(h); + } + if (t.target3.count) + { + bprint("\"\n\"b_shirt\" \""); + h = ftos(t.target3.count); + bprint(h); + } + if (t.target4.count) + { + bprint("\"\n\"b_frags\" \""); + h = ftos(t.target4.count); + bprint(h); + } + if (t.b_aiflags) + { + bprint("\"\n\"b_aiflags\" \""); + h = ftos(t.b_aiflags); + bprint(h); + } + bprint("\"\n}\n"); + self.nextthink = time + 0.01; + self.enemy = t; + +}; + +void() BSPDumpWaypoints = +{ + bprint("/* BSP entities Dump - maps/"); + + bprint(mapname); + bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n"); // 2001-09-10 FrikBot support by FrikaC/Maddes + + if (!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = PrintBSPWaypoint; + fixer.enemy = world; + } +}; + +// FrikaC's file access tutorial... +string(string s1, string s2) strcat = #115; +float(string filename, float mode) open = #110; +string(string s) zone = #118; +void(string s) unzone = #119; +void(float handle) close = #111; +void(float handle, string s) write = #113; +float(string ext) frik_checkextension = #99; +float file; + +void() SaveWaypoint = +{ + local entity t; + local float needcolon; + local string h, j, k, l; + + if (self.enemy == world) + t = way_head; + else + t = self.enemy._next; + if (bytecounter >= 8000) + { + h = "maps/"; + j = ftos(filecount); + k = h = zone(strcat("maps/", mapname)); + l = h = zone(strcat(h, ".wa")); + unzone(k); + h = zone(strcat(h, j)); + unzone(l); + write(file, "exec "); + write(file, h); + write(file, "\n"); + filecount = filecount + 1; + close(file); + file = open(h, 2); + unzone(h); + if (file == -1) + { + remove(self); + fixer = world; + bprint("Error: failed to save file\n"); + return; + } + bytecounter = 0; + } + if (t == world) + { + remove(self); + fixer = world; + write(file, "saved4 3\n"); + close(file); + bprint("waypoints saved.\n"); + bytecounter = bytecounter + 27; + return; + } +// 2001-09-10 FrikBot support by FrikaC/Maddes start + t.origin_x = rint(t.origin_x); + t.origin_y = rint(t.origin_y); + t.origin_z = rint(t.origin_z); +// 2001-09-10 FrikBot support by FrikaC/Maddes end + if ((t.origin_x != saved1) || (t.count == 1)) + { + write(file, "saved1 "); + h = ftos(t.origin_x); + write(file, h); + saved1 = t.origin_x; + bytecounter = bytecounter + 12; + needcolon = TRUE; + } + if ((t.origin_y != saved2) || (t.count == 1)) + { + if (needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "saved2 "); + h = ftos(t.origin_y); + write(file, h); + bytecounter = bytecounter + 12; + saved2 = t.origin_y; + } + if ((t.origin_z != saved3) || (t.count == 1)) + { + if (needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "saved3 "); + h = ftos(t.origin_z); + write(file, h); + bytecounter = bytecounter + 12; + saved3 = t.origin_z; + } + if (needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + bytecounter = bytecounter + 1; + write(file, "\n"); + needcolon = FALSE; + } + if ((scratch1 != t.target1.count) || t.count == 1) + { + needcolon = TRUE; + write(file, "scratch1 "); + bytecounter = bytecounter + 14; + h = ftos(t.target1.count); + write(file, h); + scratch1 = t.target1.count; + } + if ((scratch2 != t.target2.count) || t.count == 1) + { + if (needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "scratch2 "); + bytecounter = bytecounter + 14; + h = ftos(t.target2.count); + write(file, h); + scratch2 = t.target2.count; + } + if ((scratch3 != t.target3.count) || t.count == 1) + { + if (needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "scratch3 "); + bytecounter = bytecounter + 14; + h = ftos(t.target3.count); + write(file, h); + scratch3 = t.target3.count; + } + if ((scratch4 != t.target4.count) || t.count == 1) + { + if (needcolon) + { + write(file, "; "); + bytecounter = bytecounter + 2; + } + else + needcolon = TRUE; + write(file, "scratch4 "); + bytecounter = bytecounter + 14; + h = ftos(t.target4.count); + write(file, h); + scratch4 = t.target4.count; + } + if (needcolon) // 2001-09-10 FrikBot support by FrikaC/Maddes + { + write(file, "\n"); + needcolon = FALSE; + } + write(file, "saved4 "); + bytecounter = bytecounter + 19; + if (t.count != 1) + h = ftos(t.b_aiflags * 4 + 2); + else + h = ftos(t.b_aiflags * 4 + 1); + write(file, h); + write(file, "; wait\n"); + self.nextthink = time + 0.01; + self.enemy = t; +}; + +// to allow for 100+ waypoints, we need to trick the runaway loop counter +void() SaveWays = +{ + local string h, f; + bytecounter = 50; + filecount = 1; + h = strcat("maps/", mapname); + f = h = zone(h); + h = strcat(h, ".way"); + unzone(f); + file = open(h, 2); + if (file == -1) + { + bprint("Error: failed to open file\n"); + return; + } + if (!fixer) + { + fixer = spawn(); + fixer.nextthink = time + 0.01; + fixer.think = SaveWaypoint; + fixer.enemy = world; + } +}; diff --git a/QC_other/QC_frikbot/frikbot/bot_fight.qc b/QC_other/QC_frikbot/frikbot/bot_fight.qc new file mode 100644 index 00000000..97a3e60d --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_fight.qc @@ -0,0 +1,498 @@ +/*********************************************** +* * +* FrikBot Fight Code * +* "Because I ain't no Ghandi code" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +.entity avoid; + +float(entity e, float wid) ent_is_holding = +{ + return e.weapon == wid || e.weapon2 == wid; +} + +float(entity e) bot_size_player = +{ + local float sz; + + sz = e.health + e.armorvalue * e.armortype; + + if (ent_is_holding(e, WID_ROCKET_LAUNCHER)) + sz = sz + 60; + else if (ent_is_holding(e, WID_LIGHTNING)) + sz = sz + 60; + else if (ent_is_holding(e, WID_GRENADE_LAUNCHER)) + sz = sz + 50; + else if (ent_is_holding(e, WID_SUPER_NAILGUN)) + sz = sz + 50; + else if (ent_is_holding(e, WID_NAILGUN)) + sz = sz + 40; + else if (ent_is_holding(e, WID_SUPER_SHOTGUN)) + sz = sz + 40; + else if (ent_is_holding(e, WID_SHOTGUN)) + sz = sz + 10; + else if (ent_is_holding(e, WID_AXE)) + sz = sz - 50; + + if(VR_ItemUtil_EntHasItem(e, IID_QUAD)) + sz = sz + 200; + + if(VR_ItemUtil_EntHasItem(e, IID_INVULNERABILITY)) + sz = sz + 300; + + if(VR_ItemUtil_EntHasItem(e, IID_INVISIBILITY)) + sz = sz + 250; + + return sz; +}; + +void() bot_dodge_stuff = +{ + local entity foe; + local float avdist, foesz, flen, tsz; + local vector v; + + if (waypoint_mode > WM_LOADED) + return; + + self.avoid = world; + + + if (self.enemy) + { + v = self.origin - realorigin(self.enemy); + + foesz = bot_size_player(self.enemy); + foesz = foesz + vlen(v) * 0.5; + } + else + foesz = 9999999; + avdist = 256; + + foe = find(world, classname, "grenade"); + while(foe) + { + flen = vlen(foe.origin - self.origin); + if (flen < avdist) + { + avdist = flen; + self.avoid = foe; + } + foe = find(foe, classname, "grenade"); + } + if (!self.avoid) + { + foe = find(world, classname, "missile"); + while(foe) + { + if (foe.owner != self) + { + flen = vlen(foe.origin - self.origin); + if (flen < avdist) + { + avdist = flen; + self.avoid = foe; + } + } + foe = find(foe, classname, "missile"); + } + if (!self.avoid) + { + foe = find(world, classname, "spike"); + while(foe) + { + if (foe.owner != self) + { + flen = vlen(foe.origin - self.origin); + if (flen < avdist) + { + avdist = flen; + self.avoid = foe; + } + } + foe = find(foe, classname, "spike"); + } + } + } + if (coop) + { + if (!self.enemy) + { + foe = findradius(self.origin, 9999); + while(foe) + { + if(foe.flags & FL_MONSTER) + { + if(foe.health > 0) + { + tsz = bot_size_player(foe) + vlen(foe.origin - self.origin) * 0.5; + if (tsz < foesz) + { + if (fisible(foe)) + { + self.enemy = foe; + foesz = tsz; + } + } + } + } + foe = foe.chain; + } + } + } + else + { + foe = player_head; + while(foe) + { + if(foe != self) + { + if (foe.modelindex != 0) + { + if (foe.health > 0) + { + if (!(teamplay && self.team == foe.team)) + { + tsz = bot_size_player(foe) + vlen(foe.origin - self.origin) * 0.5; + if (tsz < foesz) + { + if (fov(foe) || foe.b_sound > time || self.b_skill == 3) + { + if (fisible(foe)) + { + self.enemy = foe; + foesz = tsz; + } + } + } + } + } + } + } + foe = foe._next; + } + } +}; + + + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +weapon_range + +_x "sweet spot range" - try to maintain this range if possible +_y minimum range bot can be to be effective (rl/gl) (move away) +_z maximum range bot can be to be effective (lg/axe) (move in) +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +vector(float wid) weapon_range = +{ + if (wid == WID_AXE) + return '48 0 64'; + else if (wid == WID_SHOTGUN) + return '128 8 3000'; + else if (wid == WID_SUPER_SHOTGUN) + return '128 0 3000'; + else if (wid == WID_NAILGUN) + return '180 0 3000'; + else if (wid == WID_SUPER_NAILGUN) + return '180 0 3000'; + else if (wid == WID_GRENADE_LAUNCHER) + return '180 48 3000'; + else if (wid == WID_ROCKET_LAUNCHER) + return '180 48 3000'; + else if (wid == WID_LIGHTNING) + return '350 0 512'; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +bot_weapon_switch + +Pick a weapon based on range / ammo + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +// TODO VR: (P0) fix this, grep for weapon/weaponmodel/WID_,etc + +void(float brange) bot_weapon_switch = +{ + local float it, wid, pulse, v; + + if( (VR_WeaponUtil_EntHasWeapon(self, WID_ROCKET_LAUNCHER)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) >= 1)) + { + wid = WID_ROCKET_LAUNCHER; + pulse = 7; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } + else if(self.waterlevel <= 1 && + (VR_WeaponUtil_EntHasWeapon(self, WID_LIGHTNING)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_CELLS) >= 1)) + { + wid = WID_LIGHTNING; + pulse = 8; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } + else if((VR_WeaponUtil_EntHasWeapon(self, WID_SUPER_NAILGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_NAILS) >= 2)) + { + wid = WID_SUPER_NAILGUN; + pulse = 5; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } + else if((VR_WeaponUtil_EntHasWeapon(self, WID_GRENADE_LAUNCHER)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_ROCKETS) >= 1)) + { + wid = WID_GRENADE_LAUNCHER; + pulse = 6; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } + else if((VR_WeaponUtil_EntHasWeapon(self, WID_SUPER_SHOTGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) >= 2)) + { + wid = WID_SUPER_SHOTGUN; + pulse = 3; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } + else if((VR_WeaponUtil_EntHasWeapon(self, WID_NAILGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_NAILS) >= 1)) + { + wid = WID_NAILGUN; + pulse = 4; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } + else if((VR_WeaponUtil_EntHasWeapon(self, WID_SHOTGUN)) && + (VR_AmmoUtil_GetAmmoCountByAmmoId(self, AID_SHELLS) >= 1)) + { + wid = WID_SHOTGUN; + pulse = 2; + + v = weapon_range(wid); + if(brange >= v_y && brange <= v_z) + { + self.impulse = pulse; + return; + } + } +}; + +void() bot_shoot = +{ + // quick little function to stop making him shoot the wrong way ! Argh + local float g; + + g = angcomp(self.v_angle_x, self.b_angle_x); + if (fabs(g) > 30) + return; // argh, too far away + + g = angcomp(self.v_angle_y, self.b_angle_y); + if (fabs(g) > 30) + return; // not again! + + // TODO VR: (P0) this should copy v_angle to handrot, or something like that, test. + self.handrot = self.v_angle; + self.offhand_handrot = self.v_angle; + + self.handpos = self.origin; + self.offhand_handpos = self.origin; + + self.button0 = TRUE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot_fight_style + +This is the core of the bot's thinking when +attacking an enemy. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() bot_fight_style = +{ + local vector v, v1, v2, org; + local float foedist, mysz, foesz; + + + if (self.enemy.health <= 0) + { + self.enemy = world; + return; + } + else if (!self.enemy.takedamage) + { + self.enemy = world; + return; + } + else if (!fisible(self.enemy)) + { + self.enemy = world; + return; + } + + org = realorigin(self.enemy); + makevectors(self.v_angle); + + // decide if I should shoot + + foedist = vlen(org - self.origin); + v = weapon_range(self.weapon); + + if (foedist > v_y && foedist < v_z) + { + traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * v_z, FALSE, self); + if (vlen(trace_endpos - (self.origin + self.view_ofs)) >= v_y) + { + // try to avoid shooting teammates + if (trace_ent.classname == "player") + if ((trace_ent.team == self.team && teamplay) || (coop)) + return; + bot_shoot(); + } + } + else + bot_weapon_switch(foedist); + + if (!(self.b_aiflags & (AI_PRECISION | AI_BLIND | AI_OBSTRUCTED))) + { + foesz = bot_size_player(self.enemy); + mysz = bot_size_player(self) + 5; + + if (foesz > mysz) + { + if (teamplay) + { + if (random() < 0.02) + { + bot_start_topic(5); + self.b_chattime = 1; + } + } + + return; + } + else if (mysz < 140) + return; + else if (self.avoid) + { + if (self.avoid.velocity) + v = self.avoid.velocity; + else + v = normalize(self.avoid.origin - self.origin); + v1_x = v_y * -1; + v1_y = v_x; + v2_x = v_y; + v2_y = v_x * -1; + foedist = vlen(self.avoid.origin - (self.origin + v1)); + if (foedist < vlen(self.avoid.origin - (self.origin + v2))) + frik_walkmove(v2); + else + frik_walkmove(v1); + } + else if (!self.enemy.flags & FL_MONSTER) + { + if (foedist + 32 < v_x) + frik_walkmove(self.origin - org); + else if (foedist - 32 > v_x) + frik_walkmove(org - self.origin); + else if (self.wallhug) + frik_walkmove(v_right); + else + frik_walkmove(v_right * -1); + } + } + else + { + foesz = bot_size_player(self.enemy); + mysz = bot_size_player(self) + 5; + + if (foesz > mysz) + return; + else if (mysz < 140) + return; + self.keys = self.keys & 960; + } +}; + + diff --git a/QC_other/QC_frikbot/frikbot/bot_misc.qc b/QC_other/QC_frikbot/frikbot/bot_misc.qc new file mode 100644 index 00000000..87c25868 --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_misc.qc @@ -0,0 +1,777 @@ +/*********************************************** +* * +* FrikBot Misc Code * +* "Because you can't name it anything else" * +* * +***********************************************/ + +/* +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotName + +Sets bot's name and colors + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +string(float r) BotName = +{ + self.b_num = r; + if (r == 1) + { + self.b_pants = 11; + self.b_shirt = 0; + return "Vincent"; + } + else if (r == 2) + { + self.b_pants = 1; + self.b_shirt = 3; + return "Bishop"; + } + else if (r == 3) + { + self.b_pants = 13; + self.b_shirt = 2; + return "Nomad"; + } + else if (r == 4) + { + self.b_pants = 7; + self.b_shirt = 6; + return "Hudson"; + } + else if (r == 5) + { + self.b_pants = 12; + self.b_shirt = 6; + return "Lore"; + } + else if (r == 6) + { + self.b_pants = 4; + self.b_shirt = 4; + return "Servo"; + } + else if (r == 7) + { + self.b_pants = 2; + self.b_shirt = 5; + return "Gort"; + } + else if (r == 8) + { + self.b_pants = 10; + self.b_shirt = 3; + return "Kryten"; + } + else if (r == 9) + { + self.b_pants = 9; + self.b_shirt = 4; + return "Pimp Bot"; + } + else if (r == 10) + { + self.b_pants = 4; + self.b_shirt = 7; + return "Max"; + } + else if (r == 11) + { + self.b_pants = 3; + self.b_shirt = 11; + return "Marvin"; + } + else if (r == 12) + { + self.b_pants = 13; + self.b_shirt = 12; + return "Erwin"; + } + else if (r == 13) + { + self.b_pants = 11; + self.b_shirt = 2; + return "FrikBot"; + } + else if (r == 14) + { + self.b_pants = 0; + self.b_shirt = 2; + return "Krosis"; + } + else if (r == 15) + { + self.b_pants = 8; + self.b_shirt = 9; + return "Gypsy"; + } + else if (r == 16) + { + self.b_pants = 5; + self.b_shirt = 10; + return "Hal"; + } +}; +string () PickARandomName = +{ + if (bot_count > 16) + return "player"; + + local float y, test; + local string h; + local entity t; + y = TRUE; + while(y) + { + test = ceil(random() * 16); + h = BotName(test); + t = find(world, netname, h); + if (t == world) + y = FALSE; + } + return h; +}; + + + +// I didn't like the old code so this is very stripped down + +entity b_originator; +float b_topic; +/* FBX Topics + +b_originator == self + 1 - sign on + 2 - killed targ + 3 - team message "friendly eyes" + 4 - team message "on your back" + 5 - team message "need back up" + 6 - excuses + ---- + 7 - gameover + ---- + 8 - welcoming someone onto server + 9 - ridicule lost frag (killed self?) + 10 - ridicule lost frag (lava) + 11 - lag +b_originator == targ + + +*/ +void(float tpic) bot_start_topic = +{ + if (random() < 0.2) + { + b_topic = tpic; + b_originator = self; + } + else + b_topic = 0; +}; + +void() bot_chat = +{ + local float r; + if (b_options & OPT_NOCHAT) + return; + r = ceil (random() * 6); + + if (self.b_chattime > time) + { + if (self.b_skill < 2) + self.keys = self.button0 = self.button2 = 0; + return; + } + else if (self.b_chattime) + { + if (b_topic == 1) + { + if (b_originator == self) + { + if (r == 1) + { + BotSay(": lo all\n"); + bot_start_topic(8); + } + else if (r == 2) + { + BotSay(": hey everyone\n"); + bot_start_topic(8); + } + else if (r == 3) + { + BotSay(": prepare to be fragged!\n"); + bot_start_topic(0); + } + else if (r == 4) + { + BotSay(": boy this is laggy\n"); + bot_start_topic(11); + } + else if (r == 5) + { + BotSay(": #mm getting some lag here\n"); + bot_start_topic(11); + } + else + { + BotSay(": hi everyone\n"); + bot_start_topic(8); + } + } + } + else if (b_topic == 2) + { + if (b_originator == self) + { + if (r == 1) + BotSay(": take that\n"); + else if (r == 2) + BotSay(": yehaww!\n"); + else if (r == 3) + BotSay(": wh00p\n"); + else if (r == 4) + BotSay(": j00_sawk();\n"); + else if (r == 5) + BotSay(": i rule\n"); + else + BotSay(": eat that\n"); + bot_start_topic(0); + } + } + else if (b_topic == 3) + { + if (b_originator == self) + { + if (r < 3) + BotSayTeam(": friendly eyes\n"); + else + BotSayTeam(": team eyes\n"); + bot_start_topic(0); + } + } + else if (b_topic == 4) + { + if (b_originator == self) + { + if (r < 3) + BotSayTeam(": on your back\n"); + else + BotSayTeam(": I'm with you\n"); + bot_start_topic(0); + } + } + else if (b_topic == 5) + { + if (b_originator == self) + { + if (r < 3) + BotSayTeam(": I need help\n"); + else + BotSayTeam(": need backup\n"); + bot_start_topic(0); + } + } + else if (b_topic == 6) + { + if (b_originator == self) + { + if (r == 1) + { + BotSay(": sun got in my eyes\n"); + bot_start_topic(0); + } + else if (r == 2) + { + BotSay(": mouse needs cleaning\n"); + bot_start_topic(0); + } + else if (r == 3) + { + BotSay(": i meant to do that\n"); + bot_start_topic(0); + } + else if (r == 4) + { + BotSay(": lag\n"); + bot_start_topic(11); + } + else if (r == 5) + { + BotSay(": killer lag\n"); + bot_start_topic(11); + } + else + { + BotSay(": 100% lag\n"); + bot_start_topic(11); + } + } + } + else if (b_topic == 7) + { + if (r == 1) + BotSay(": gg\n"); + else if (r == 2) + BotSay(": gg all\n"); + else if (r == 3) + BotSay(": that was fun\n"); + else if (r == 4) + BotSay(": good game\n"); + else if (r == 5) + BotSay(": pah\n"); + else + BotSay(": hrm\n"); + bot_start_topic(0); + } + else if (b_topic == 8) + { + if (b_originator != self) + { + if (r == 1) + { + BotSay(": heya\n"); + bot_start_topic(0); + } + else if (r == 2) + { + BotSay(": welcome\n"); + bot_start_topic(0); + } + else if (r == 3) + { + BotSayInit(); + BotSay2(": hi "); + BotSay2(b_originator.netname); + BotSay2("\n"); + bot_start_topic(0); + } + else if (r == 4) + { + BotSayInit(); + BotSay2(": hey "); + BotSay2(b_originator.netname); + BotSay2("\n"); + bot_start_topic(0); + } + else if (r == 5) + { + BotSay(": howdy\n"); + bot_start_topic(0); + } + else + { + BotSay(": lo\n"); + bot_start_topic(0); + } + } + } + + else if (b_topic == 9) + { + if (b_originator != self) + { + if (r == 1) + BotSay(": hah\n"); + else if (r == 2) + BotSay(": heheh\n"); + else if (r == 3) + { + BotSayInit(); + BotSay2(": good work "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if (r == 4) + { + BotSayInit(); + BotSay2(": nice1 "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if (r == 5) + BotSay(": lol\n"); + else + BotSay(": :)\n"); + b_topic = 6; + } + } + else if (b_topic == 10) + { + if (b_originator != self) + { + if (r == 1) + BotSay(": have a nice dip?\n"); + else if (r == 2) + BotSay(": bah I hate levels with lava\n"); + else if (r == 3) + { + BotSayInit(); + BotSay2(": good job "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if (r == 4) + { + BotSayInit(); + BotSay2(": nice backflip "); + BotSay2(b_originator.netname); + BotSay2("\n"); + } + else if (r == 5) + BotSay(": watch your step\n"); + else + BotSay(": hehe\n"); + b_topic = 6; + } + } + + else if (b_topic == 11) + { + if (b_originator != self) + { + if (r == 1) + { + BotSayInit(); + BotSay2(": yeah right "); + BotSay2(b_originator.netname); + BotSay2("\n"); + bot_start_topic(0); + } + else if (r == 2) + { + BotSay(": ping\n"); + bot_start_topic(0); + } + else if (r == 3) + { + BotSay(": shuddup, you're an lpb\n"); + bot_start_topic(0); + } + else if (r == 4) + { + BotSay(": lag my eye\n"); + bot_start_topic(0); + } + else if (r == 5) + { + BotSay(": yeah\n"); + bot_start_topic(11); + } + else + { + BotSay(": totally\n"); + bot_start_topic(11); + } + } + } + self.b_chattime = 0; + } + else if (b_topic) + { + if (random() < 0.5) + { + if (self == b_originator) + { + if (b_topic <= 7) + self.b_chattime = time + 2; + } + else + { + if (b_topic >= 7) + self.b_chattime = time + 2; + } + } + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Kick A Bot. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() KickABot = +{ + local entity ty; + ty = find(world, classname, "player"); + while (ty != world) + { + if (!(ty.ishuman)) + { + + BotDisconnect(ty); + ty.ishuman = TRUE; + ty = world; + } + else + ty = find(ty, classname, "player"); + } + +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Simplified origin checking. + +God, I wish I had inline + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +vector(entity ent) realorigin = +{ +// even more simplified... + return (ent.absmin + ent.absmax) * 0.5; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +fisible + +a version of visible that checks for corners +of the bounding boxes + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float (entity targ) fisible = +{ + local vector spot1, org; + local float thruwater, pc1, pc2; + + org = realorigin(targ); + spot1 = self.origin + self.view_ofs; + + if (targ.solid == SOLID_BSP) + { + traceline (spot1, org, TRUE, self); + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; + return FALSE; + } + else + { + pc1 = pointcontents(org); + pc2 = pointcontents(spot1); + if (targ.classname == "player") + thruwater = FALSE; + else if (pc1 == CONTENT_LAVA) + return FALSE; + else + thruwater = TRUE; + } + + if (pc1 < -1) // targ's origin is in water or other liquid + { + if (pc2 != pc1) + { + // look for their head + traceline (spot1, org + targ.mins, TRUE, self); + // cross the water check + if (trace_inopen) + if (trace_inwater) + if (!thruwater) + return FALSE; + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; + return FALSE; + } + } + else + { + if (pc2 != pc1) + { + traceline (spot1, org + targ.maxs, TRUE, self); + if (trace_inopen) + if (trace_inwater) + if (!thruwater) + return FALSE; + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; + return FALSE; + } + } + traceline (spot1, org, TRUE, self); + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; + traceline (spot1, org + targ.maxs, TRUE, self); + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; + traceline (spot1, org + targ.mins, TRUE, self); + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; + return FALSE; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Wisible + +goes through movable brushes/entities, used +for waypoints + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +// this is used for waypoint stuff.... +float (entity targ1, entity targ2) wisible = +{ + local vector spot1, spot2; + local entity ignore; + + spot1 = targ1.origin; + spot2 = realorigin(targ2); + + ignore = self; + do + { + traceline (spot1, spot2, TRUE, ignore); + spot1 = realorigin(trace_ent); + ignore = trace_ent; + } while ((trace_ent != world) && (trace_fraction != 1)); + if (trace_endpos == spot2) + return TRUE; + else + return FALSE; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +sisible + +Now this is getting ridiculous. Simple visible, +used when we need just a simple traceline nothing else + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float (entity targ) sisible = +{ + traceline (self.origin, targ.origin, TRUE, self); + if (trace_ent == targ) + return TRUE; + else if (trace_fraction == 1) + return TRUE; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +angcomp + +subtracts one angle from another + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float (float y1, float y2) angcomp = +{ + y1 = frik_anglemod(y1); + y2 = frik_anglemod(y2); + + local float answer; + answer = y1 - y2; + if (answer > 180) + answer = answer - 360; + else if (answer < -180) + answer = answer + 360; + return answer; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +fov + +is the entity in the bot's field of view + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float (entity targ) fov = +{ + local vector yawn; + local float g; + yawn = realorigin(targ); + yawn = (yawn + targ.view_ofs) - (self.origin + self.view_ofs); + yawn = normalize(yawn); + yawn = vectoangles(yawn); + g = angcomp(self.v_angle_x, yawn_x); + if (fabs(g) > 45) + return FALSE; + g = angcomp(self.v_angle_y, yawn_y); + if (fabs(g) > 60) + return FALSE; + + return TRUE; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +frik_anglemod + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float(float v) frik_anglemod = +{ + return v - floor(v/360) * 360; +}; \ No newline at end of file diff --git a/QC_other/QC_frikbot/frikbot/bot_move.qc b/QC_other/QC_frikbot/frikbot/bot_move.qc new file mode 100644 index 00000000..d20664ae --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_move.qc @@ -0,0 +1,520 @@ +/*********************************************** +* * +* FrikBot Movement AI * +* "The slightly better movement AI" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +void() bot_jump = +{ + // TODO check for precision, etc. + self.button2 = TRUE; +}; + +float(entity e) bot_can_rj = +{ + // this returns true of the bot can rocket/superjump/hook + // if your mod doesn't have an RL you can just return FALSE all the time + // if it has a hook or some other means for the bot to get to high places + // you can check here for that capability + + // am I dumb? + if (e.b_skill == 0) + return FALSE; + + // quad = bad + if (e.items & 4194304) + return FALSE; + + // do I have rockets & RL? + if (!((e.items & 32) && (e.ammo_rockets > 0))) + return FALSE; + + // do I have pent? + if (e.items & 1048576) + return TRUE; + + if (e.health > 50) + return TRUE; + else + return FALSE; +}; + +float(float flag) frik_recognize_plat = +{ + if ((self.classname != "waypoint") && !(self.flags & FL_ONGROUND)) + return FALSE; + traceline(self.origin, self.origin - '0 0 64', TRUE, self); + if (trace_ent != world) + { + if (flag) // afect bot movement too + { + if (self.keys & KEY_MOVEUP) + { + if (trace_ent.velocity_z > 0) + self.keys = self.keys & 960; // 960 is all view keys + } + else if (self.keys & KEY_MOVEDOWN) + { + if (trace_ent.velocity_z < 0) + self.keys = self.keys & 960; + } + } + return TRUE; + } + else + return FALSE; +}; + +float(vector sdir) frik_KeysForDir = +{ + + local vector keydir; + local float outkeys, tang; + outkeys = 0; + if (sdir_x || sdir_y) + { + // Everything is tested against 60 degrees, + // this allows the bot to overlap the keys + // 30 degrees on each diagonal 45 degrees + // might look more realistic + + keydir = vectoangles(sdir); + tang = angcomp(keydir_y, self.v_angle_y); + if ((tang <= 150) && (tang >= 30)) + outkeys = outkeys + KEY_MOVELEFT; + else if ((tang >= -150) && (tang <= -30)) + outkeys = outkeys + KEY_MOVERIGHT; + if (fabs(tang) <= 60) + outkeys = outkeys + KEY_MOVEFORWARD; + else if (fabs(tang) >= 120) + outkeys = outkeys + KEY_MOVEBACK; + } + if (sdir_z > 0) + outkeys = outkeys + KEY_MOVEUP; + else if (sdir_z < 0) + outkeys = outkeys + KEY_MOVEDOWN; + return outkeys; + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +frik_obstructed + +Bot has hit a ledge or wall that he should +manuever around. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(vector whichway, float danger) frik_obstructed = +{ + local float dist; + local vector disway, org; +// TODO: something + if (self.b_aiflags & AI_BLIND) + return; + org = realorigin(self.target1); + + if (danger) + { + self.b_aiflags = self.b_aiflags | AI_DANGER; + self.keys = frik_KeysForDir('0 0 0' - whichway); + } + if (self.b_aiflags & AI_PRECISION) + return; + + + if (self.target1) + { + if (self.b_aiflags & AI_OBSTRUCTED) + { + if (!(self.b_aiflags & AI_DANGER)) + { + self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + return; + } + else if (!danger) + return; + } + self.obs_dir = whichway; + disway_x = whichway_y * -1; + disway_y = whichway_x; + dist = vlen(org - (self.origin + disway)); + disway_x = whichway_y; + disway_y = whichway_x * -1; + self.wallhug = vlen(org - (self.origin + disway)) > dist; + self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; + + } + else + { + disway_x = whichway_y * -1; + disway_y = whichway_x; + dist = vlen(disway - self.obs_dir); + disway_x = whichway_y; + disway_y = whichway_x * -1; + self.wallhug = vlen(disway - self.obs_dir) < dist; + self.obs_dir = whichway; + + self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +frik_obstacles + +Detects small bumps the bot needs to jump over +or ledges the bot should avoid falling in. + +Also responsible for jumping gaps. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_obstacles = +{ + local vector start, stop, ang; + local float test, conts, dist, hgt; + + if (!(self.flags & FL_ONGROUND)) + return; + if (self.b_aiflags & AI_BLIND) + return; + + ang = normalize(self.velocity); + ang_z = 0; + start = self.origin + ang * 32; // ahem + start_z = self.origin_z + self.maxs_z; + stop = start; + stop_z = self.origin_z + self.mins_z; + traceline(start, stop - '0 0 256', TRUE, self); + if (trace_allsolid || trace_startsolid) + return; + hgt = trace_endpos_z - stop_z; + + if (hgt > 18) + { + bot_jump(); + return; + } + if (hgt >= 0) + return; + + conts = pointcontents(trace_endpos + '0 0 4'); + start = stop - '0 0 8'; + stop = start + ang * 256; + traceline(start, stop, TRUE, self); + test = vlen(trace_endpos - start); + if (test <= 20) + return; // it's a walkable gap, do nothing + ang_x = self.velocity_y * -1; + ang_y = self.velocity_x; + ang = normalize(ang); + traceline(start - (ang * 10), start + (ang * 10), TRUE, self); + if ((trace_fraction != 1) || trace_startsolid) + return; // gap is only 20 wide, walkable + ang = self.velocity; + ang_z = 0; + dist = ((540 / sv_gravity) * vlen(ang))/* + 32*/; + if (test > dist) // I can't make it + { + if (conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + else + { + if (self.target1) + { + stop = realorigin(self.target1); + if ((stop_z - self.origin_z) < -32) + return; // safe to fall + } + frik_obstructed(ang, FALSE); + return; + } + } + else + { + ang = normalize(ang); + //look for a ledge + traceline(self.origin, self.origin + (ang * (test + 20)), TRUE, self); + if (trace_fraction != 1) + { + if (conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + else + { + if (self.target1) + { + stop = realorigin(self.target1); + if ((stop_z - self.origin_z) < -32) + return; // safe to fall + } + frik_obstructed(ang, FALSE); + return; + } + } + + if (self.target1) + { + // getting furter away from my target? + test = vlen(self.target1.origin - (ang + self.origin)); + if (test > vlen(self.target1.origin - self.origin)) + { + if (conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + else + { + frik_obstructed(ang, FALSE); + return; + } + } + } + } + if (hgt < -18) + { + if (conts < -3) // bad stuff down dare + { + frik_obstructed(ang, TRUE); + return; + } + if (self.target1) + { + stop = realorigin(self.target1); + if ((stop_z - self.origin_z) < -32) + { + + return; // safe to fall + } + } + bot_jump(); + } + // go for it +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +After frik_obstructed, the bot uses the +following funtion to move "around" the obstacle + +I have no idea how well it will work + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_dodge_obstruction = +{ + local vector way, org; + local float oflags, yaw; + + if (!(self.b_aiflags & AI_OBSTRUCTED)) + return; + if ((self.b_aiflags & (AI_BLIND | AI_PRECISION)) || !(self.flags & FL_ONGROUND)) + { + self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + return; + } + + // perform a walkmove check to see if the obs_dir is still obstructed + // walkmove is less forgiving than frik_obstacles, so I dunno + // how well this will work + + oflags = self.flags; + org = self.origin; + + yaw = vectoyaw(self.obs_dir); + if (walkmove(yaw, 32)) + self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + else + { + if (self.b_aiflags & AI_DANGER) + { + way = '0 0 0' - self.obs_dir; + } + else if (self.wallhug) + { + way_x = self.obs_dir_y * -1; + way_y = self.obs_dir_x; + } + else + { + way_x = self.obs_dir_y; + way_y = self.obs_dir_x * -1; + } + self.keys = self.keys & 960 + frik_KeysForDir(way); + } + + // fix the bot + + self.origin = org; + self.flags = oflags; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +movetogoal and walkmove replacements + +blah + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_movetogoal = +{ + local vector way, start, stop, ang; + local float g; + + if (self.target1 == world) + { + makevectors(self.v_angle); + frik_walkmove(v_forward); + return; + } + way = realorigin(self.target1) - self.origin; + if (vlen(way) < 25) + { + self.keys = self.keys & 960; + return; + } + + way = normalize(way); + self.keys = self.keys & 960 + frik_KeysForDir(way); + + frik_dodge_obstruction(); + frik_recognize_plat(TRUE); + + if (self.b_aiflags & AI_PRECISION) + { + g = angcomp(self.v_angle_x, self.b_angle_x); + if (fabs(g) > 10) + self.keys = self.keys & 960; + g = angcomp(self.v_angle_y, self.b_angle_y); + if (fabs(g) > 10) + self.keys = self.keys & 960; + } +}; + +float(vector weird) frik_walkmove = +{ + // okay so it's not walkmove + // sue me + self.keys = self.keys & 960 + frik_KeysForDir(weird); + + frik_dodge_obstruction(); + frik_recognize_plat(TRUE); + if (self.b_aiflags & AI_OBSTRUCTED) + return FALSE; + else + return TRUE; +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The "hook" method of navigation. This nav +system is copyrighted 1999 by Ryan "Frika C" +Smith, keep that in mind when you steal it. + +I brought this back because normal roaming +won't work - the bot gets distracted by it's +own waypoints. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() frik_bot_roam = +{ + local vector org, ang, org1; + local float loopcount, flag, dist; + + loopcount = 26; + flag = FALSE; + while((loopcount > 0) && !flag) + { + loopcount = loopcount - 1; + org = self.origin + self.view_ofs; + ang = self.angles; + ang_y = frik_anglemod(ang_y - 90 + (random() * 180)); + ang_x = 0; // avoid upward sloping + makevectors(ang); + traceline(org, org + v_forward * 2300, TRUE, self); + if (trace_fraction != 1) + { + org1 = trace_endpos; + ang = normalize(trace_plane_normal); + ang_z = 0; // avoid upward sloping + traceline(org1, org1 + (ang * 2300), TRUE, self); + if ((trace_fraction != 1) && (vlen(trace_endpos - org1) >= 64)) + { + org = trace_endpos; + traceline(org, self.origin + self.view_ofs, TRUE, self); + if (trace_fraction != 1) + { + dist = vlen(org1 - org) /2; + org = org1 + (ang * dist); + traceline(org, org - '0 0 48', TRUE, self); + if (trace_fraction != 1) + { + SpawnTempWaypoint(org); + flag = TRUE; + } + } + } + } + } + self.b_angle_y = self.v_angle_y + 10; + frik_walkmove(v_forward); +}; diff --git a/QC_other/QC_frikbot/frikbot/bot_phys.qc b/QC_other/QC_frikbot/frikbot/bot_phys.qc new file mode 100644 index 00000000..cf774f4d --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_phys.qc @@ -0,0 +1,683 @@ +/*********************************************** +* * +* FrikBot Physics * +* The near-perfect emulation of * +* Client movement * +* * +* Special Thanks to: Asdf, Frog * +* Alan "Strider" Kivlin * +* * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + +/* +========================================= + +Stuff mimicking cl_input.c code + +========================================= +*/ +float(float key) CL_KeyState = +{ + return ((self.keys & key) > 0); +}; + +void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles +{ + local float anglespeed; + local vector view; + if (self.keys != self.oldkeys) + { + self.movevect = '0 0 0'; + self.movevect_y = self.movevect_y + (350 * CL_KeyState(KEY_MOVERIGHT)); + // 350 is the default cl_sidespeed + self.movevect_y = self.movevect_y - (350 * CL_KeyState(KEY_MOVELEFT)); + // 350 is the default cl_sidespeed + self.movevect_x = self.movevect_x + (200 * CL_KeyState(KEY_MOVEFORWARD)); + // 200 is the default cl_forwardspeed + self.movevect_x = self.movevect_x - (200 * CL_KeyState(KEY_MOVEBACK)); + // 200 is the default cl_backspeed + self.movevect_z = self.movevect_z + (200 * CL_KeyState(KEY_MOVEUP)); + // 200 is the default cl_upspeed + self.movevect_z = self.movevect_z - (200 * CL_KeyState(KEY_MOVEDOWN)); + // 200 is the default cl_upspeed + if (!self.b_aiflags & AI_PRECISION) + self.movevect = self.movevect * 2; + // 2 is the default cl_movespeedkey & bot always has +speed + } + self.oldkeys = self.keys; + + if (self.b_skill != 2) // use mouse emulation + { + anglespeed = 1.5 * real_frametime; + // 1.5 is the default cl_anglespeedkey & bot always has +speed + self.v_angle_y = self.v_angle_y + anglespeed * CL_KeyState(KEY_LOOKLEFT) * 140; + // 140 is default cl_yawspeed + self.v_angle_y = self.v_angle_y - anglespeed * CL_KeyState(KEY_LOOKRIGHT) * 140; + // 140 is default cl_yawspeed + self.v_angle_x = self.v_angle_x - anglespeed * CL_KeyState(KEY_LOOKUP) * 150; + // 150 is default cl_pitchspeed + self.v_angle_x = self.v_angle_x + anglespeed * CL_KeyState(KEY_LOOKDOWN) * 150; + // 150 is default cl_pitchspeed + } + else + { + view_x = angcomp(self.b_angle_x, self.v_angle_x); + view_y = angcomp(self.b_angle_y, self.v_angle_y); + if (vlen(view) > 30) + { + self.mouse_emu = self.mouse_emu + (view * 30); + if (vlen(self.mouse_emu) > 180) + self.mouse_emu = normalize(self.mouse_emu) * 180; + } + else + self.mouse_emu = view * (1 / real_frametime); + self.v_angle = self.v_angle + self.mouse_emu * real_frametime; + + + } + if (self.v_angle_x > 80) + self.v_angle_x = 80; + else if (self.v_angle_x < -70) + self.v_angle_x = -70; + + if (self.v_angle_z > 50) + self.v_angle_z = 50; + else if (self.v_angle_z < -50) + self.v_angle_z = -50; + self.v_angle_y = frik_anglemod(self.v_angle_y); + +}; + +/* +========================================= + +Stuff mimicking sv_user.c + +========================================= +*/ +void() SV_UserFriction = +{ + local vector vel, start, stop; + local float sped, friction, newspeed; + + vel = self.velocity; + vel_z =0; + sped = vlen(vel); + vel = self.velocity; + + if (!sped) + return; + +// if the leading edge is over a dropoff, increase friction + + start_x = stop_x = self.origin_x + vel_x / (sped * 16); + start_y = stop_y = self.origin_y + vel_y / (sped * 16); + start_z = self.origin_z + self.mins_z; + stop_z = start_z - 34; + + traceline(start, stop, TRUE, self); + + if (trace_fraction == 1) + friction = sv_friction * 2; // 2 is default edgefriction, removed for QW compatability + else + friction = sv_friction; + if (sped < sv_stopspeed) + newspeed = sped - real_frametime * sv_stopspeed * friction; + else + newspeed = sped - real_frametime * sped * friction; + + if (newspeed < 0) + newspeed = 0; + newspeed = newspeed / sped; + + self.velocity_y = vel_y * newspeed; + self.velocity_x = vel_x * newspeed; +}; +void() SV_WaterJump = +{ + if (time > self.teleport_time || !self.waterlevel) + { + self.flags = self.flags - (self.flags & FL_WATERJUMP); + self.teleport_time = 0; + } + self.velocity_x = self.movedir_x; + self.velocity_y = self.movedir_y; +}; + +void() DropPunchAngle = +{ + local float len; + len = vlen(self.punchangle); + self.punchangle = normalize(self.punchangle); + len = len - 10 * real_frametime; + if (len < 0) + len = 0; + self.punchangle = self.punchangle * len; +}; + + +void(vector wishvel) SV_AirAccelerate = +{ + local float addspeed, wishspd, accelspeed, currentspeed; + + wishspd = vlen(wishvel); + wishvel = normalize(wishvel); + if (wishspd > 30) + wishspd = 30; + currentspeed = self.velocity * wishvel; + addspeed = wishspd - currentspeed; + if (addspeed <= 0) + return; + accelspeed = 10 * sv_accelerate * wishspd * real_frametime; + if (accelspeed > addspeed) + accelspeed = addspeed; + + self.velocity = self.velocity + accelspeed * wishvel; +}; + +void(vector wishvel) SV_Accelerate = +{ + local float addspeed, wishspd, accelspeed, currentspeed; + + wishspd = vlen(wishvel); + wishvel = normalize(wishvel); + + currentspeed = self.velocity * wishvel; + addspeed = wishspd - currentspeed; + if (addspeed <= 0) + return; + accelspeed = sv_accelerate * wishspd * real_frametime; + if (accelspeed > addspeed) + accelspeed = addspeed; + + self.velocity = self.velocity + accelspeed * wishvel; +}; +void() SV_WaterMove = +{ + local vector wishvel; + local float wishspeed, addspeed, cspeed, newspeed; + makevectors(self.v_angle); + wishvel = v_right * self.movevect_y + v_forward * self.movevect_x; + + if (self.movevect == '0 0 0') + wishvel_z = wishvel_z - 60; + else + wishvel_z = wishvel_z + self.movevect_z; + wishspeed = vlen(wishvel); + + if (wishspeed > sv_maxspeed) + { + wishvel = (sv_maxspeed / wishspeed) * wishvel; + wishspeed = sv_maxspeed; + } + wishspeed = wishspeed * 0.7; + cspeed = vlen(self.velocity); + if (cspeed) + { + newspeed = cspeed - (real_frametime * cspeed * sv_friction); + if (newspeed < 0) + newspeed = 0; + self.velocity = self.velocity * (newspeed / cspeed); + + } + else + newspeed = 0; + + if (!wishspeed) + return; + addspeed = wishspeed - newspeed; + if (addspeed <= 0) + return; + wishvel = normalize(wishvel); + cspeed = sv_accelerate * wishspeed * real_frametime; + if (cspeed > addspeed) + cspeed = addspeed; + self.velocity = self.velocity + cspeed * wishvel; +}; +void() SV_AirMove = +{ + local vector wishvel, vangle; + + vangle = self.v_angle; + vangle_x = vangle_z = 0; + makevectors(vangle); + if (time < self.teleport_time && (self.movevect_x < 0)) + self.movevect_x = 0; + wishvel = v_right * self.movevect_y + v_forward * self.movevect_x; + + + if (self.movetype != MOVETYPE_WALK) + wishvel_z = self.movevect_z; + else + wishvel_z = 0; + if (vlen(wishvel) > sv_maxspeed) + wishvel = normalize(wishvel) * sv_maxspeed; + if (self.movetype == MOVETYPE_NOCLIP) + self.velocity = wishvel; + else if (self.flags & FL_ONGROUND) + { + SV_UserFriction(); + SV_Accelerate(wishvel); + } + else + SV_AirAccelerate (wishvel); +}; + +void() SV_ClientThink = +{ + local vector vangle; + + if (self.movetype == MOVETYPE_NONE) + return; + DropPunchAngle(); + if (self.health <= 0) + return; + self.v_angle_z = 0; // V_CalcRoll removed, sucks + self.angles_z = self.v_angle_z * 4; + vangle = self.v_angle + self.punchangle; + if (!self.fixangle) + { + self.angles_x = (vangle_x / -3); + self.angles_y = vangle_y; + } else + { + self.v_angle = self.angles; + self.fixangle = 0; + } + if (self.flags & FL_WATERJUMP) + { + SV_WaterJump(); + return; + } + if ((self.waterlevel >= 2) && (self.movetype != MOVETYPE_NOCLIP)) + { + SV_WaterMove(); + return; + } + SV_AirMove(); + +}; +/* +========================================= + +Stuff mimicking sv_phys.c + +========================================= +*/ + +float() SV_RunThink = +{ + local float thinktime, bkuptime; + thinktime = self.nextthink; + bkuptime = time; + if (thinktime <= 0 || thinktime > (time + real_frametime)) + return TRUE; + if (thinktime < time) + thinktime = time; + self.nextthink = 0; + time = thinktime; + other = world; + makevectors(self.v_angle); // hack + self.think(); + time = bkuptime; + return TRUE; +}; + +void(float scale) SV_AddGravity = +{ + self.velocity_z = self.velocity_z - (scale * sv_gravity * real_frametime); +}; + +float() SV_CheckWater = +{ + local vector point; + local float cont; + + point_x = self.origin_x; + point_y = self.origin_y; + self.waterlevel = 0; + self.watertype = CONTENT_EMPTY; + point_z = self.origin_z + self.mins_z + 1; + cont = pointcontents(point); + if (cont <= CONTENT_WATER) + { + self.watertype = cont; + self.waterlevel = 1; + point_z = self.origin_z + (self.mins_z + self.maxs_z) * 0.5; + cont = pointcontents(point); + if (cont <= CONTENT_WATER) + { + self.waterlevel = 2; + point_z = self.origin_z + self.view_ofs_z; + cont = pointcontents(point); + if (cont <= CONTENT_WATER) + self.waterlevel = 3; + } + } + return (self.waterlevel > 1); + +}; +void() RemoveThud = // well sometimes +{ + local entity oself; + if (other == world) + { + if (self.flags & FL_ONGROUND) + { + self.flags = self.flags - FL_ONGROUND; + } + } + else + { + if (other.solid == SOLID_BSP && (self.flags & FL_ONGROUND)) + { + // RM: Does this break anything? + // If not, then some more thuds have been removed. + self.flags = self.flags - FL_ONGROUND; + } + if (other == self.owner) + return; + if (self.owner.solid == SOLID_NOT) + return; + oself = other; + other = self.owner; + self = oself; + if (self.solid == SOLID_BSP) + if (self.touch) + self.touch(); + } + +}; +void() SV_CheckOnGround = +{ + local vector org, v; + org = self.origin; + local float currentflags; + currentflags = self.flags; + self.flags = self.flags | FL_ONGROUND | FL_PARTIALGROUND; + walkmove(0,0); // perform C touch function + self.flags = currentflags | FL_ONGROUND; + if ((org_x != self.origin_x) || (org_y != self.origin_y)) + org = self.origin; + else + self.origin = org; + v = org; + v_z = self.maxs_z + org_z + 1; + traceline (org, v, TRUE, self); + if ((self.waterlevel == 3) && (self.movetype == MOVETYPE_WALK)) + self.flags = self.flags - FL_ONGROUND; + else if ((trace_plane_normal_z <= 0.7) && (trace_fraction != 1)) + self.flags = self.flags - FL_ONGROUND; + //~ else if (!droptofloor(0,0)) + else if (!droptofloor()) //~ hip_fbx bugfix + self.flags = self.flags - FL_ONGROUND; + else if (org_z - self.origin_z < 2) + self.flags = self.flags | FL_ONGROUND; + else + self.flags = self.flags - FL_ONGROUND; + setorigin(self, org); +}; +// Thanks to Alan Kivlin for this function +// modified heavily by me +float(vector dir) botCheckForStep = +{ + local vector currentorigin, v; + local float currentflags, yaw, stepdistance, movedistance; + currentorigin = self.origin; + currentflags = self.flags; + self.flags = FL_ONGROUND | FL_PARTIALGROUND; + dir = normalize(dir); + dir_z = 0; + yaw = vectoyaw(dir); + if(walkmove(yaw, 3)) + { + //~ if(droptofloor(0,0)) + if(droptofloor()) + { + stepdistance = self.origin_z - currentorigin_z; + v = self.origin - currentorigin; + v_z = 0; + movedistance = vlen(v); + if((stepdistance > 0 && stepdistance <= 16) && movedistance != 0) + { + self.flags = currentflags | FL_PARTIALGROUND; + return 1; + } + } + } + self.flags = currentflags; + v = currentorigin; + v_z = self.origin_z; + if (vlen(v - self.origin) <= 4) + setorigin(self, currentorigin); + return 0; +}; +// this is merely here to fix a problem with e3m5 +void(vector dir) BruteForceStep = +{ + local vector currentorigin; + local float currentflags, i, len; + + currentorigin = self.origin; + currentflags = self.flags; + len = vlen(dir); + if (len > 16) + dir = normalize(dir) * 16; + + setorigin(self, currentorigin + dir); + + while(i < 18 && !walkmove(0, 0)) + { + self.origin_z = currentorigin_z + i; + i = i + 2; + } + self.flags = currentflags; + if (i >=18) + setorigin(self, currentorigin); +}; + +void() PostPhysics = +{ + local vector obstr, org; + local float back, dst,cflags; + + self = self.owner; + + self.velocity = self.velocity - self.phys_obj.dest1 + self.phys_obj.velocity; + if (self.phys_obj.dest2 == self.origin) + { + setorigin(self, self.phys_obj.origin); + // might've been moved during other person's physics + // (teleporters / plats) + + if (self.movetype == MOVETYPE_WALK) + { + + if (self.phys_obj.dest1_x || self.phys_obj.dest1_y) + { + if ((self.flags & FL_ONGROUND) || (self.waterlevel <= 2)) + { + obstr = self.phys_obj.movedir - self.origin; + obstr_z = 0; + if (vlen(obstr) > 0.1) + { + dst = vlen(obstr); + back = vectoyaw(obstr); + cflags = self.flags; + self.flags = self.flags | FL_PARTIALGROUND; + if(walkmove(back, dst)) + { + self.flags = cflags; + self.phys_obj.dest1_z = 0; + self.velocity = self.velocity + self.phys_obj.dest1 - self.phys_obj.velocity; + } + else + { + if (dst > 1) + frik_obstructed(obstr, FALSE); + + org = self.origin; + self.flags = cflags; + obstr = self.phys_obj.dest1; + obstr_x = 0; + if (!botCheckForStep(obstr)) + { + obstr = self.phys_obj.dest1; + obstr_y = 0; + if (!botCheckForStep(obstr)) + { + // if no steps were found, bot is really obstucted + BruteForceStep(self.phys_obj.dest1); + } + } + } + } + } + } + } + } + + SV_CheckOnGround(); + + PlayerPostThink(); + BotAI(); + self.dmg_take = self.dmg_save = 0; + +}; +// Avoid calling BotAI and the physics at the same time +// Can trip the runaway loop counter + +void() SV_FlyMove = +{ + // This is nothing like the Quake function. + + if (self.phys_obj == world) + { + self.phys_obj = find(world,classname,"phys_obj"); + while (self.phys_obj.owner != self) + { + self.phys_obj = find(self.phys_obj,classname,"phys_obj"); + if (self.phys_obj == world) + { + error("No physics entity spawned!\nMake sure BotInit was called\n"); + } + } + } + + setmodel(self.phys_obj, string_null); + self.phys_obj.movetype = MOVETYPE_STEP; + + self.phys_obj.solid = SOLID_TRIGGER; + self.phys_obj.touch = RemoveThud; + setsize(self.phys_obj, self.mins, self.maxs); + self.phys_obj.dest2 = self.phys_obj.origin = self.origin; + self.phys_obj.watertype = 0; + self.phys_obj.movedir = self.origin + real_frametime * self.velocity; + self.phys_obj.dest1 = self.phys_obj.velocity = self.velocity; + self.phys_obj.velocity_z = self.phys_obj.velocity_z + sv_gravity * real_frametime; + self.phys_obj.flags = 0; + self.phys_obj.think = PostPhysics; + self.phys_obj.nextthink = time; +}; + + +void() SV_Physics_Toss = +{ + if (!SV_RunThink()) + return; + if (self.flags & FL_ONGROUND) + { + self.velocity = '0 0 0'; + BotAI(); + return; + } + if (self.movetype != MOVETYPE_FLY) + SV_AddGravity(1); + self.angles = self.angles + real_frametime * self.avelocity; + SV_FlyMove(); + +}; +void() SV_Physics_Client = +{ + + PlayerPreThink(); + + if (self.movetype == MOVETYPE_NONE) + { + if (!SV_RunThink()) + return; + PlayerPostThink(); + BotAI(); + + } + else if ((self.movetype == MOVETYPE_WALK) || (self.movetype == MOVETYPE_STEP)) + { + if (!SV_RunThink()) + return; + if (!(SV_CheckWater()) && (!(self.flags & FL_WATERJUMP))) + SV_AddGravity(1); + SV_FlyMove(); + } + else if ((self.movetype == MOVETYPE_TOSS) || (self.movetype == MOVETYPE_BOUNCE)) + { + SV_Physics_Toss(); + } + else if (self.movetype == MOVETYPE_FLY) + { + if (!SV_RunThink()) + return; + SV_FlyMove(); + } + else if (self.movetype == MOVETYPE_NOCLIP) + { + if (!SV_RunThink()) + return; + self.origin = self.origin + real_frametime * self.velocity; + + PlayerPostThink(); + BotAI(); + } + else + error ("SV_Physics_Client: Bad Movetype (BOT)"); + +}; + + diff --git a/QC_other/QC_frikbot/frikbot/bot_qw.qc b/QC_other/QC_frikbot/frikbot/bot_qw.qc new file mode 100644 index 00000000..dd20fc0b --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_qw.qc @@ -0,0 +1,964 @@ + +/* +====================================== +FrikBot X (Version 0.10.2) QW +====================================== + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + + +====================================== +These installation instructions only apply to QuakeWorld (as does this entire +file). For Normal Quake, please refer to bot.qc + +-------------------------------------- +To install on a new mod, do all this: +-------------------------------------- +Place all included bot*.qc files in the subdirectory "frikbot" +in your source folder, then... + +* Add the following lines to progs.src right after the defs.qc line +frikbot/bot_qw.qc +frikbot/bot_way.qc +frikbot/bot_fight.qc +frikbot/bot_ai.qc +frikbot/bot_misc.qc +frikbot/bot_phys.qc +frikbot/bot_move.qc +-------------------------------------- +* Comment out the following functions in defs.qc +sound, stuffcmd, sprint, aim, centerprint, setspawnparms +WriteByte, WriteChar, WriteShort, WriteLong, WriteCoord +WriteAngle, WriteString, WriteEntity +-------------------------------------- +* Add this to worldspawn() in world.qc, right at the very top, before InitBodyQue(); +BotInit(); // FrikBot +-------------------------------------- +* add this line to StartFrame() in world.qc, at the very top +BotFrame(); // FrikBot +-------------------------------------- +* Add these two lines to PlayerPreThink in client.qc at the very top +if (BotPreFrame()) // FrikBot + return; +-------------------------------------- +* Add this line to PlayerPostThink in client.qc at the very top +if (BotPostFrame()) // FrikBot + return; +-------------------------------------- +* Add the following line to the very top of Client Connect in client.qc +ClientInRankings(); // FrikBot +-------------------------------------- +* Add these lines to the very top of ClientDisconnect in client.qc +ClientDisconnected(); // FrikBot +-------------------------------------- +* Add these lines to the very top of SpectatorConnect in spectate.qc +ClientFixRankings(); // FrikBot +-------------------------------------- + +To install the waypoints: + +add + +waypoints/map_dm1.qc +waypoints/map_dm2.qc +waypoints/map_dm3.qc +waypoints/map_dm4.qc +waypoints/map_dm5.qc +waypoints/map_dm6.qc + +To progs.src, immediately after defs.qc + +To remove these waypoints: + +Delete the code in bot_map_load, located below. +*/ + +void() bot_map_load = +{ + // place your qc loaded waypoints here + + if (mapname == "dm1") + map_dm1(); + else if (mapname == "dm2") + map_dm2(); + else if (mapname == "dm3") + map_dm3(); + else if (mapname == "dm4") + map_dm4(); + else if (mapname == "dm5") + map_dm5(); + else if (mapname == "dm6") + map_dm6(); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Variables and shtuff + +bot.qc has become pretty much a header file +for all variable in the bot... + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +// ----- entity fields --- +.float wallhug, keys, oldkeys, ishuman; +.float b_frags, b_clientno, b_shirt, b_pants; +.float priority, ai_time, b_sound, missile_speed; +.float portal_time, b_skill, switch_wallhug; +.float b_aiflags, b_num, b_chattime; +.float b_entertime, b_userid; // QW shtuff +.float b_menu, b_menu_time, b_menu_value; +.float route_failed, dyn_flags, dyn_time; +.float dyn_plat; +.entity temp_way, last_way, phys_obj; +.entity target1, target2, target3, target4; +.entity _next, _last; +.entity current_way; +.vector b_angle, b_dest, mouse_emu, obs_dir; +.vector movevect, b_dir; +.vector dyn_dest; +.vector punchangle; // HACK - Don't want to screw with bot_phys + +// --------defines----- +float SVC_UPDATENAME = 13; +float SVC_UPDATEFRAGS = 14; +float SVC_UPDATECOLORS = 17; + +// used for the physics & movement AI +float KEY_MOVEUP = 1; +float KEY_MOVEDOWN = 2; +float KEY_MOVELEFT = 4; +float KEY_MOVERIGHT = 8; +float KEY_MOVEFORWARD = 16; +float KEY_MOVEBACK = 32; +float KEY_LOOKUP = 64; +float KEY_LOOKDOWN = 128; +float KEY_LOOKLEFT = 256; +float KEY_LOOKRIGHT = 512; + +// these are aiflags for waypoints +// some overlap to the bot +float AI_TELELINK_1 = 1; // link type +float AI_TELELINK_2 = 2; // link type +float AI_TELELINK_3 = 4; // link type +float AI_TELELINK_4 = 8; // link type +float AI_DOORFLAG = 16; // read ahead +float AI_PRECISION = 32; // read ahead + point +float AI_SURFACE = 64; // point +float AI_BLIND = 128; // read ahead + point +float AI_JUMP = 256; // point + ignore +float AI_DIRECTIONAL = 512; // read ahead + ignore +float AI_PLAT_BOTTOM = 1024; // read ahead +float AI_RIDE_TRAIN = 2048; // read ahead +float AI_SUPER_JUMP = 4096; // point + ignore + route test +float AI_SNIPER = 8192; // point type +float AI_AMBUSH = 16384; // point type +float AI_DOOR_NO_OPEN = 32768; // read ahead +float AI_DIFFICULT = 65536; // route test +float AI_TRACE_TEST = 131072; // route test + +// these are flags for bots/players (dynamic/editor flags) +float AI_OBSTRUCTED = 1; +float AI_HOLD_SELECT = 2; +float AI_ROUTE_FAILED = 2; +float AI_WAIT = 4; +float AI_DANGER = 8; + +// addition masks +float AI_POINT_TYPES = 29152; +float AI_READAHEAD_TYPES = 36528; +float AI_IGNORE_TYPES = 4864; + +float WM_UNINIT = 0; +float WM_DYNAMIC = 1; +float WM_LOADING = 2; +float WM_LOADED = 3; +// editor modes aren't available in QW, but we retain support of them +// since the editor is still built into the AI in places +float WM_EDITOR = 4; +float WM_EDITOR_DYNAMIC = 5; +float WM_EDITOR_DYNLINK = 6; + +float OPT_NOCHAT = 2; + +// -------globals----- +float active_clients1, active_clients2; +float max_clients, real_frametime; +float bot_count, b_options, lasttime; +float waypoint_mode, dump_mode; +float waypoints, direct_route, userid; +float sv_friction, sv_gravity; +float sv_accelerate, sv_maxspeed, sv_stopspeed; +entity fixer; +entity route_table; +entity b_temp1, b_temp2, b_temp3; +entity player_head, phys_head, way_head; +float busy_waypoints; + +float coop = 0; // hack + +// -------ProtoTypes------ +// external +void() ClientConnect; +void() ClientDisconnect; +void() SetNewParms; + +// rankings +float(float clientno) ClientBitFlag; +float() ClientNextAvailable; +void(float whatbot, float whatskill) BotConnect; +void(entity bot) BotDisconnect; +void(float clientno) BotInvalidClientNo; +void(entity who) UpdateClient; + +// waypointing +void() DynamicWaypoint; +entity(vector org) make_waypoint; +void() ClearAllWays; +void() FixWaypoints; +float() begin_route; +void(entity this, float direct) bot_get_path; +void() WaypointThink; +entity(entity start) FindWayPoint; + +// physics & movement +float(entity e) bot_can_rj; +void() bot_jump; +void() frik_bot_roam; +float(vector weird) frik_walkmove; +void() frik_movetogoal; +void() frik_obstacles; +float(float flag) frik_recognize_plat; +float(vector sdir) frik_KeysForDir; +void(vector whichway, float danger) frik_obstructed; +void() SV_Physics_Client; +void() SV_ClientThink; +void() CL_KeyMove; + +// ai & misc +string() PickARandomName; +float(entity targ) fov; +float(float y1, float y2) angcomp; +float(entity targ1, entity targ2) wisible; +float(entity targ) sisible; +float(entity targ) fisible; +vector(entity ent) realorigin; +void(entity ent) target_drop; +void(entity ent) target_add; +void() KickABot; +void() BotImpulses; +void(entity targ, float success) bot_lost; +string(float r) BotName; +float(float v) frik_anglemod; +void() bot_chat; +void(float tpic) bot_start_topic; + + +// ----------Commands--------- +void(entity e, float chan, string samp, float vol, float atten) frik_sound = #8; +void(entity client, string s) frik_stuffcmd = #21; +void(entity client, float level, string s) frik_sprint = #24; +vector(entity e, float sped) frik_aim = #44; +void(entity client, string s) frik_centerprint = #73; +void(entity e) frik_setspawnparms = #78; +void(float to, float f) frik_WriteByte = #52; +void(float to, float f) frik_WriteChar = #53; +void(float to, float f) frik_WriteShort = #54; +void(float to, float f) frik_WriteLong = #55; +void(float to, float f) frik_WriteCoord = #56; +void(float to, float f) frik_WriteAngle = #57; +void(float to, string s) frik_WriteString = #58; +void(float to, entity s) frik_WriteEntity = #59; + +//---------------------------------------------------------------------------- + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Function redclarations. These allow function +designed to work for clients (sprint, so forth) +to mainly not complain when working with a bot + +Although these shouldn't be needed anymore, +as the bots truly are clients now, if you don't +stop the SZ_ buffer from filling up by disabling +direct messages to the bots, it crashes quake :-( + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(entity client, string s) stuffcmd = +{ + if (client.ishuman) + frik_stuffcmd(client, s); +}; + +void(entity e) setspawnparms = +{ + if (e.ishuman) + frik_setspawnparms(e); + else + SetNewParms(); +}; +void(entity client, float level, string s) sprint = +{ + if (client.ishuman) + frik_sprint(client, level, s); +}; +void(entity client, string s) centerprint = +{ + if (client.ishuman) + frik_centerprint(client, s); +}; + +vector(entity e, float sped) aim = +{ + e.missile_speed = sped; + return frik_aim(e, sped); +}; + +void(entity e, float chan, string samp, float vol, float atten) sound = +{ + frik_sound(e, chan, samp, vol, atten); + if (samp == "items/inv3.wav") + return; + else if (e.classname == "player") + e.b_sound = time + 1; + else if (other.classname == "player") + other.b_sound = time + 1; +}; +void(float to, float f) WriteByte = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteByte(to, f); +}; +void(float to, float f) WriteChar = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteChar(to, f); +}; +void(float to, float f) WriteShort = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteShort(to, f); +}; +void(float to, float f) WriteLong = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteLong(to, f); +}; +void(float to, float f) WriteCoord = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteCoord(to, f); +}; +void(float to, float f) WriteAngle = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteAngle(to, f); +}; +void(float to, string s) WriteString = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteString(to, s); +}; +void(float to, entity s) WriteEntity = +{ + if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) + return; + frik_WriteEntity(to, s); +}; + + +float(float clientno) ClientIsActive = +{ + if(clientno > 16) + { + if(active_clients2 & ClientBitFlag(clientno - 16)) + return TRUE; + else + return FALSE; + } + else + { + if(active_clients1 & ClientBitFlag(clientno)) + return TRUE; + else + return FALSE; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Stuff mentioned up top +it just links the bot into the mod + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClientFixRankings = +{ + local float cno; + if (self.switch_wallhug > time) + return; + self.switch_wallhug = 0; + + b_temp2 = nextent(world); + cno = 0; + + while (cno < max_clients) + { + if (!b_temp2.ishuman) + { + if (ClientIsActive(cno)) + UpdateClient(b_temp2); + } + cno = cno + 1; + b_temp2 = nextent(b_temp2); + } +}; + +void() ClientInRankings = +{ + local float cno; + + cno = self.colormap - 1; + BotInvalidClientNo (cno); + + if (player_head) + player_head._last = self; + self._next = player_head; + player_head = self; + userid = userid + 1; + self.b_userid = userid; + + if (!self.phys_obj) + { + b_temp2 = phys_head; + while (b_temp2 != world && b_temp2.owner != self) + b_temp2 = b_temp2._next; + self.phys_obj = b_temp2; + } + + if (self.ishuman == 2) + { + self.ishuman = FALSE; + return; + } + if(cno > 16) + active_clients2 = active_clients2 | ClientBitFlag(cno - 16); + else + active_clients1 = active_clients1 | ClientBitFlag(cno); + self.b_clientno = cno; + self.ishuman = TRUE; + self.switch_wallhug = time + 1; +}; + + +void() ClientDisconnected = +{ + if (player_head == self) + player_head = self._next; + if (self._next) + self._next._last = self._last; + if (self._last) + self._last._next = self._next; + if(self.b_clientno > 16) + active_clients2 = active_clients2 - (active_clients2 & ClientBitFlag(self.b_clientno - 16)); + else + active_clients1 = active_clients1 - (active_clients1 & ClientBitFlag(self.b_clientno)); +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotPreFrame & BotPostFrame, used to make the +bot easier to install + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +float () BotPreFrame = +{ + if (self.b_clientno == -1) + return TRUE; + if (self.ishuman) + if (self.switch_wallhug) + ClientFixRankings(); + if (self.b_frags != self.frags) + { + if (self.b_frags > self.frags) + { + if (pointcontents(self.origin) == CONTENT_LAVA) + bot_start_topic(10); + else + bot_start_topic(9); + } + else + bot_start_topic(2); + self.b_frags = self.frags; + if (!self.ishuman) + { + WriteByte(2, 14); + WriteByte(2, self.b_clientno); + WriteShort(2, self.frags); + } + } + DynamicWaypoint(); + return FALSE; +}; +float () BotPostFrame = +{ + if (self.b_clientno == -1) + return TRUE; + if (self.ishuman) + BotImpulses(); + return FALSE; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Chat code + +The rest of this code is in bot_rank.qc + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +void(string h) BotSay = // simulate talking by composing a 'chat' message +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 3); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, self.netname); + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 3); + WriteByte(MSG_ALL, 2); + WriteString(MSG_ALL, h); +}; +void() BotSayInit = +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 3); + WriteByte(MSG_ALL, 1); + WriteString(MSG_ALL, self.netname); +}; +void(string h) BotSay2 = +{ + WriteByte(MSG_ALL, 8); + WriteByte(MSG_ALL, 3); + WriteByte(MSG_ALL, 2); + WriteString(MSG_ALL, h); +}; +void(string h) BotSayTeam = +{ + // FBX QW doesn't support teamplay...yet +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotInit + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void() BotInit = +{ + local entity ent, fisent; + local float numents; + + // spawn entities for the physics + ent = nextent(world); + max_clients = 0; + + while(ent != world) + { + max_clients = max_clients + 1; + ent = nextent(ent); + } + + ent = nextent(world); + fisent = world; + while (numents < max_clients) + { + + phys_head = spawn(); + if (fisent) + fisent._next = phys_head; + phys_head._last = fisent; + fisent = phys_head; + ent.phys_obj = phys_head; + phys_head.classname = "phys_obj"; + phys_head.owner = ent; + numents = numents + 1; + ent = nextent(ent); + } + bot_map_load(); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Rankings 'utilities'. Written by Alan Kivlin, +this code just fools clients by sending precisely +the same network messages as when a real player +signs on to the server. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void(entity who) UpdateClient = +{ + WriteByte(2, 14 ); + WriteByte(2, who.b_clientno); + WriteShort(2, who.frags); + WriteByte(2, 36); + WriteByte(2, who.b_clientno); + WriteShort(2, 100 * (3 - who.b_skill)); + WriteByte(2, 37); // update entertime + WriteByte(2, who.b_clientno); // client number + WriteLong(2, time - who.b_entertime); // client entertime + WriteByte(2, 40 ); // update userinfo + WriteByte(2, who.b_clientno); // client number + WriteLong(2, who.b_userid); // client userid + WriteByte(2, 92); // \ + WriteByte(2, 98); // b + WriteByte(2, 111); // o + WriteByte(2, 116); // t + WriteByte(2, 116); // t + WriteByte(2, 111); // o + WriteByte(2, 109); // m + WriteByte(2, 99); // c + WriteByte(2, 111); // o + WriteByte(2, 108); // l + WriteByte(2, 111); // o + WriteByte(2, 114); // r + WriteByte(2, 92); // \ + if(who.b_pants > 9) + { + WriteByte(2, 49); + WriteByte(2, 38 + who.b_pants); + } + else + WriteByte(2, 48 + who.b_pants); + WriteByte(2, 92); // \ + WriteByte(2, 116); // t + WriteByte(2, 111); // o + WriteByte(2, 112); // p + WriteByte(2, 99); // c + WriteByte(2, 111); // o + WriteByte(2, 108); // l + WriteByte(2, 111); // o + WriteByte(2, 114); // r + WriteByte(2, 92); // \ + if(who.b_shirt > 9) + { + WriteByte(2, 49); + WriteByte(2, 38 + who.b_shirt); + } + else + WriteByte(2, 48 + who.b_shirt); + WriteByte(2, 92); // \ + WriteByte(2, 116); // t + WriteByte(2, 101); // e + WriteByte(2, 97); // a + WriteByte(2, 109); // m + WriteByte(2, 92); // \ + WriteByte(2, 98); // b + WriteByte(2, 111); // o + WriteByte(2, 116); // t + // FIXME: do teams properly + // note this has no effect on infokey + WriteByte(2, 92 ); // \ + WriteByte(2, 115); // s + WriteByte(2, 107); // k + WriteByte(2, 105); // i + WriteByte(2, 110); // n + WriteByte(2, 92); // \ + WriteByte(2, 98); // b + WriteByte(2, 97); // a + WriteByte(2, 115); // s + WriteByte(2, 101); // e + WriteByte(2, 92); // \ + WriteByte(2, 110); // n + WriteByte(2, 97); // a + WriteByte(2, 109); // m + WriteByte(2, 101); // e + WriteByte(2, 92); // \ + WriteString( 2, who.netname); +}; + +float(float clientno) ClientBitFlag = +{ + local float bitflag; + bitflag = 1; + while(clientno > 0) + { + bitflag = bitflag * 2; + clientno = clientno - 1; + } + return bitflag; +}; + +float() ClientNextAvailable = +{ + local float clientno; + // I want to do this top down, but QW won't let me + clientno = 0; + while(clientno < max_clients) + { + clientno = clientno + 1; + + if(!ClientIsActive(clientno)) + return clientno; + } + return -1; +}; + + +void(entity e1, entity e2, float flag) DeveloperLightning = {}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotConnect and related functions. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ +entity(float num) GetClientEntity = +{ + local entity upsy; + upsy = world; + num = num + 1; + while (num > 0) + { + num = num - 1; + upsy = nextent(upsy); + } + return upsy; +}; + +void(float whatbot, float whatskill) BotConnect = +{ + local float f; + local string h; + local entity uself; + + f = ClientNextAvailable(); + uself = self; + if(f == -1) + { + bprint(PRINT_HIGH, "Unable to connect a bot, server is full.\n"); + return; + } + + bot_count = bot_count + 1; + self = GetClientEntity(f); + bot_start_topic(1); + self.b_clientno = f; + self.colormap = f + 1; + if (whatbot) + self.netname = BotName(whatbot); + else + self.netname = PickARandomName(); + // players can set skill all weird, so leave these checks in + whatskill = rint(whatskill); + if (whatskill > 3) + whatskill = 3; + else if (whatskill < 0) + whatskill = 0; + self.b_skill = whatskill; + self.b_entertime = time; + self.team = self.b_pants + 1; + UpdateClient(self); + SetNewParms(); + self.ishuman = 2; + ClientConnect(); + PutClientInServer(); + if(f > 16) + active_clients2 = active_clients2 | ClientBitFlag(f - 16); + else + active_clients1 = active_clients1 | ClientBitFlag(f); + self = uself; +}; + +void(entity bot) BotDisconnect = +{ + local string h; + local entity uself; + uself = self; + self = bot; + + bot_count = bot_count - 1; + + ClientDisconnect(); + + //if (self.b_clientno != -1) + //{ + // the bot's client number is not in use by a real player so we + // must remove it's entry in the rankings + // Quake engine sets all fields to 0, can only do the most important here + self.b_frags = self.frags = 0; + self.netname = ""; + self.classname = ""; + self.health = 0; + self.items = 0; + self.armorvalue = 0; + self.weaponmodel = ""; + self.b_pants = 0; + self.b_shirt = 0; + self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = 0; + UpdateClient(self); + if(self.b_clientno > 16) + active_clients2 = active_clients2 - (active_clients2 & ClientBitFlag(self.b_clientno - 16)); + else + active_clients1 = active_clients1 - (active_clients1 & ClientBitFlag(self.b_clientno)); + self.b_clientno = -1; + //} + self = uself; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BotInvalidClientNo +kicks a bot if a player connects and takes the bot's space + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(float clientno) BotInvalidClientNo = +{ + local entity bot; + + if (ClientIsActive(clientno)) + { + bot = GetClientEntity (clientno); + + if (bot.b_clientno == clientno) + { + bot.b_clientno = -1; + BotDisconnect(bot); + if(clientno > 16) + active_clients2 = active_clients2 | (active_clients2 & ClientBitFlag(clientno - 16)); + else + active_clients1 = active_clients1 | (active_clients1 & ClientBitFlag(clientno)); + BotConnect(self.b_num, self.b_skill); + return; + } + } +}; + +void() BotFrame = +{ + local float num; + local string h; + + h = infokey(world, "bot_options"); + b_options = stof(h); + + // for the sake of speed + sv_maxspeed = cvar("sv_maxspeed"); + sv_gravity = cvar("sv_gravity"); + sv_friction = cvar("sv_friction"); + sv_accelerate = cvar("sv_accelerate"); + sv_stopspeed = cvar("sv_stopspeed"); + real_frametime = time - lasttime; // in QW frametime is fuxx0red + lasttime = time; + + self = nextent(world); + num = 0; + while (num < max_clients) + { + if (self.ishuman == FALSE) + { + if (self.b_clientno > 0) + { + frik_obstacles(); + CL_KeyMove(); + SV_ClientThink(); + SV_Physics_Client(); + // this is sickening + if (self.phys_obj) + { + if (self.phys_obj.modelindex != self.modelindex) + { + setmodel(self.phys_obj, "progs/player.mdl"); + self.phys_obj.modelindex = self.modelindex; + } + self.phys_obj.frame = self.frame; + self.phys_obj.angles = self.angles; + self.phys_obj.colormap = self.colormap; + self.phys_obj.effects = self.effects; + } + } + } + self = nextent(self); + num = num + 1; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Bot Impulses. Allows the player to perform bot +related functions. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() BotImpulses = +{ + local float f; + local string h; + + if (self.impulse == 100) + { + h = infokey(world, "skill"); + f = stof(h); + BotConnect(0, f); + } + else if (self.impulse == 102) + KickABot(); + else + return; + self.impulse = 0; +}; \ No newline at end of file diff --git a/QC_other/QC_frikbot/frikbot/bot_way.qc b/QC_other/QC_frikbot/frikbot/bot_way.qc new file mode 100644 index 00000000..2341ebdf --- /dev/null +++ b/QC_other/QC_frikbot/frikbot/bot_way.qc @@ -0,0 +1,1007 @@ + /*********************************************** +* * +* FrikBot Waypoints * +* "The better than roaming AI" * +* * +***********************************************/ + +/* + +This program is in the Public Domain. My crack legal +team would like to add: + +RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" +AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE +ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR +FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN +NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY +GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, +EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" +SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. + +You accept this software on the condition that you +indemnify and hold harmless Ryan "FrikaC" Smith from +any and all liability or damages to third parties, +including attorney fees, court costs, and other +related costs and expenses, arising out of your use +of this software irrespective of the cause of said +liability. + +The export from the United States or the subsequent +reexport of this software is subject to compliance +with United States export control and munitions +control restrictions. You agree that in the event you +seek to export this software, you assume full +responsibility for obtaining all necessary export +licenses and approvals and for assuring compliance +with applicable reexport restrictions. + +Any reproduction of this software must contain +this notice in its entirety. + +*/ + + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Linking code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +float (entity e1, entity e2) CheckLinked = +{ + if ((e1 == e2) || (e2 == world) || (e1 == world)) + return FALSE; + else if (e1.target1 == e2) + { + if (e1.b_aiflags & AI_TELELINK_1) + return 2; + else return TRUE; + } + else if (e1.target2 == e2) + { + if (e1.b_aiflags & AI_TELELINK_2) + return 2; + else return TRUE; + } + else if (e1.target3 == e2) + { + if (e1.b_aiflags & AI_TELELINK_3) + return 2; + else return TRUE; + } + else if (e1.target4 == e2) + { + if (e1.b_aiflags & AI_TELELINK_4) + return 2; + else return TRUE; + } + + else return FALSE; +}; + + +float (entity e1, entity e2) LinkWays = +{ + if ((e1 == e2) || (e2 == world) || (e1 == world)) + return FALSE; + else if (CheckLinked(e1, e2)) + return FALSE; // already linked!!! + + if (e1.target1 == world) + { + e1.target1 = e2; + return TRUE; + } + else if (e1.target2 == world) + { + e1.target2 = e2; + return TRUE; + } + else if (e1.target3 == world) + { + e1.target3 = e2; + return TRUE; + } + else if (e1.target4 == world) + { + e1.target4 = e2; + return TRUE; + } + else return FALSE; + +}; +// Link Ways part 2, used only for teleporters + +float (entity e1, entity e2) TeleLinkWays = +{ + if ((e1 == e2) || (e2 == world) || (e1 == world)) + return FALSE; + else if (CheckLinked(e1, e2)) + return FALSE; // already linked!!! + + if (e1.target1 == world) + { + e1.target1 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_1; + return TRUE; + } + else if (e1.target2 == world) + { + e1.target2 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_2; + return TRUE; + } + else if (e1.target3 == world) + { + e1.target3 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_3; + return TRUE; + } + else if (e1.target4 == world) + { + e1.target4 = e2; + e1.b_aiflags = e1.b_aiflags | AI_TELELINK_4; + return TRUE; + } + else + return FALSE; + +}; + +void (entity e1, entity e2) UnlinkWays = +{ + if ((e1 == e2) || (e2 == world) || (e1 == world)) + return; + else if (!CheckLinked(e1, e2)) + return; + + if (e1.target1 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_1); + e1.target1 = world; + } + if (e1.target2 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_2); + e1.target2 = world; + } + if (e1.target3 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_3); + e1.target3 = world; + } + if (e1.target4 == e2) + { + e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_4); + e1.target4 = world; + } + +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +FindWaypoint + +This is used quite a bit, by many different +functions big lag causer + +Finds the closest, fisible, waypoint to e + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +entity(entity start) FindWayPoint = +{ + local entity t; + local vector org; + local float dst, tdst; + local entity best; + + org = realorigin(self); + + t = way_head; + if (start != world) + { + dst = vlen(start.origin - org); + best = start; + } + else + { + dst = 100000; + best = world; + } + while(t) + { + // real players cut through ignore types + if (dst < 20) + return best; + if (!(t.b_aiflags & AI_IGNORE_TYPES) || self.ishuman) + { + tdst = vlen(t.origin - org); + if (tdst < dst) + { + if (sisible(t)) + { + dst = tdst; + best = t; + } + } + } + t = t._next; + } + return best; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Spawning Code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +entity way_foot; // Ugh. Do I need a foot for this or not? + +entity(vector org) make_waypoint = +{ + local entity point; + point = spawn(); + point.classname = "waypoint"; + point.solid = SOLID_TRIGGER; + point.movetype = MOVETYPE_NONE; + point.items = -1; + setorigin(point, org); + + setsize(point, VEC_HULL_MIN, VEC_HULL_MAX); + waypoints = waypoints + 1; + if (!way_head) + { + way_head = point; + way_foot = point; + } + else + { + way_foot._next = point; + point._last = way_foot; + way_foot = point; + } + + point.count = waypoints; + if (waypoint_mode > WM_LOADED) // editor modes + setmodel(point, "progs/s_bubble.spr"); + return point; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Dynamic Waypoint spawning and linking. Not +very good all things considered. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() DynamicWaypoint = +{ + local entity t; + local float dist, dynlink, dynpoint, editor; + + if (self.teleport_time > self.portal_time) + { + if (!self.flags & FL_WATERJUMP) + { + self.dyn_flags = 2; + if (!self.ishuman) + { + bot_lost(self.target1, TRUE); + self.enemy = world; + } + } + self.portal_time = self.teleport_time; + } +// stacking everything on waypoint_mode might've been good for the editor, +// but it sucks to beat hell for this code. + + +// convert waypoint_mode to something more usable.. + if (waypoint_mode > WM_LOADED) + { + if (self.ishuman) + { + if (waypoint_mode == WM_EDITOR_DYNLINK) + dynlink = 1; + else if (waypoint_mode == WM_EDITOR_DYNAMIC) + dynlink = dynpoint = 1; + editor = 1; + } + } + else if (waypoint_mode == WM_DYNAMIC) + dynlink = dynpoint = 1; + +// if there's nothing for dynamic to do.. + if (!dynpoint) + { + if (!editor) + return; + } +// for speed sake, I won't have bots dynamic waypoint in coop + if (!self.ishuman) + if (coop) + return; + +// don't waypoint in single player + if (max_clients < 2) + return; +// if you're dead + else if (self.health <= 0) + { + if (dynpoint) + { + if (self.current_way) + { + if (pointcontents(self.origin) < -4) + { + if (self.current_way.b_aiflags & AI_BLIND) + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; + else + self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; + } + } + } + self.dyn_dest = '0 0 0'; + self.current_way = world; + self.dyn_flags = 0; + return; + } + +// you shouldn't be making waypoints mid air + if (dynpoint) + { + if (!((self.flags & FL_ONGROUND) || self.waterlevel == 3)) + { + if (self.dyn_flags != 2) + { + self.dyn_flags = 1; + } + return; + } + } +// keep from doing the rest of this every frame + if (self.dyn_time > time) + return; + self.dyn_time = time + 0.2; + +// display the links for editor mode + if (editor) + { + if (self.current_way) + { + if (self.current_way.target1) + DeveloperLightning(self.current_way, self.current_way.target1, self.current_way.b_aiflags & AI_TELELINK_1); + if (self.current_way.target2) + DeveloperLightning(self.current_way, self.current_way.target2, self.current_way.b_aiflags & AI_TELELINK_2); + if (self.current_way.target3) + DeveloperLightning(self.current_way, self.current_way.target3, self.current_way.b_aiflags & AI_TELELINK_3); + if (self.current_way.target4) + DeveloperLightning(self.current_way, self.current_way.target4, self.current_way.b_aiflags & AI_TELELINK_4); + } + if (self.b_aiflags & AI_HOLD_SELECT) + return; + } + + t = FindWayPoint(self.current_way); + if (t) + { + dist = vlen(self.origin - t.origin); + if (dist < 192) + { + if (dist < 64) + { + + if (t != self.current_way) + { + if (dynlink) + { + if (!self.dyn_flags) + { + if (wisible(t, self.current_way)) + LinkWays(t, self.current_way); + } + if (self.dyn_flags == 2) + TeleLinkWays(self.current_way, t); + else if (wisible(t, self.current_way)) + LinkWays(self.current_way, t); + } + if (editor) + { + setmodel(t, "progs/s_light.spr"); + if (self.current_way) + setmodel(self.current_way, "progs/s_bubble.spr"); + } + } + self.current_way = t; + self.dyn_flags = 0; + } + self.dyn_dest = self.origin + self.view_ofs; + return; + } + } + + if (frik_recognize_plat(FALSE)) + { + if (vlen(trace_ent.velocity) > 0) + { + if (self.dyn_plat) + return; + self.dyn_plat = TRUE; + if (!self.dyn_flags) + self.dyn_flags = 1; + //bprint("on a plat!!!!!\n"); + } + else + self.dyn_plat = FALSE; + } + else + self.dyn_plat = FALSE; + + if (self.dyn_flags == 2) + self.dyn_dest = self.origin + self.view_ofs; + else if (self.dyn_dest == '0 0 0') + self.dyn_dest = self.origin + self.view_ofs; + if (!dynpoint) + return; + t = make_waypoint(self.dyn_dest); + + if (!self.dyn_flags) + { + if (wisible(t, self.current_way)) + LinkWays(t, self.current_way); + } + if (self.dyn_flags == 2) + TeleLinkWays(self.current_way, t); + else if (wisible(t, self.current_way)) + LinkWays(self.current_way, t); + + if (editor) + { + setmodel(t, "progs/s_light.spr"); + if (self.current_way) + setmodel(self.current_way, "progs/s_bubble.spr"); + } + self.current_way = t; + self.dyn_flags = 0; + + self.dyn_dest = self.origin + self.view_ofs; + + if (frik_recognize_plat(FALSE)) + { + if (trace_ent.classname == "door") + t.b_aiflags = t.b_aiflags | AI_DOORFLAG; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Waypoint Loading from file + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClearAllWays = +{ + + local entity t, n; + t = way_head; + while(t) + { + n = t._next; + remove(t); + t = n; + } + way_head = world; + way_foot = world; + waypoints = 0; +}; + +entity(float num) WaypointForNum = +{ + local entity t; + if (!num) + return world; + + t = way_head; + while (t) + { + if (t.count == num) + return t; + t = t._next; + } + return world; +}; + +void() FixThisWaypoint = +{ + self.enemy.target1 = WaypointForNum(self.enemy.b_pants); + self.enemy.target2 = WaypointForNum(self.enemy.b_skill); + self.enemy.target3 = WaypointForNum(self.enemy.b_shirt); + self.enemy.target4 = WaypointForNum(self.enemy.b_frags); + self.enemy = self.enemy._next; + self.nextthink = time; + if (self.enemy == world) + { + remove(self); + fixer = world; + } +}; + +void() FixWaypoints = +{ + if (!fixer) + fixer = spawn(); + fixer.nextthink = time; + fixer.think = FixThisWaypoint; + fixer.enemy = way_head; +}; + + + +void(entity what) delete_waypoint = +{ + local entity t; + + if (way_head == what) + way_head = what._next; + if (way_foot == what) + way_foot = what._last; + if (what._last) + what._last._next = what._next; + if (what._next) + what._next._last = what._last; + waypoints = 0; + t = way_head; + while(t) + { + t.count = waypoints = waypoints + 1; + if (CheckLinked(t, what)) + UnlinkWays(t, what); + t = t._next; + } + if (self.current_way == what) + self.current_way = world; + remove(what); +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +FindRoute & FindThing used by the pathing code +in bot_ai.qc + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +entity(string s) FindThing = +{ + local entity t; + local float tdst, dst; + local entity best; + dst = 100000; + best = world; + t = find (world, classname, s); + while (t != world) + { + tdst = vlen(((t.absmin + t.absmax) * 0.5) - self.origin); + if (tdst < dst) + { + dst = tdst; + best = t; + } + t = find(t, classname, s); + } + return best; +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +FindRoute, this is a key function in the +pathing. The name is a bit misleading, this +code finds the closest waypoint that is part +of a route calculated by the begin_route and +end_route routines This is a definite path to +an object. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +entity(entity lastone) FindRoute = +{ + // kinda like FindWaypoint, only of this bots route though + local entity t, best; + local float dst, tdst, flag; + flag = ClientBitFlag(self.b_clientno); + + if (lastone) + { + if (lastone.target1.b_sound & flag) + return lastone.target1; + else if (lastone.target2.b_sound & flag) + return lastone.target2; + else if (lastone.target3.b_sound & flag) + return lastone.target3; + else if (lastone.target4.b_sound & flag) + return lastone.target4; + } + + t = way_head; + dst = 100000; + best = world; + while(t) + { + tdst = vlen(t.origin - self.origin); + if ((tdst < dst) && (t.b_sound & flag)) + { + dst = tdst; + best = t; + } + t = t._next; + } + return best; +}; +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Route & path table management + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() ClearRouteTable = +{ + // cleans up route table + + local entity t; + t = way_head; + while (t) + { + t. keys = FALSE; + t.enemy = world; + t.items = -1; // not in table + t = t._next; + } +}; + +void() ClearMyRoute = +{ + local float flag; + local entity t; + + flag = ClientBitFlag(self.b_clientno); + + t = way_head; + while (t) + { + t.b_sound = t.b_sound - (t.b_sound & flag); + t = t._next; + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Mark_path + +After the route has been found, mark it with +bitflags so the table can be used for a +different bot. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + + +void(entity this) mark_path = +{ + local entity t, oself; + local float flag; + + ClearMyRoute(); + + oself = self; + self = this; + t = FindWayPoint(this.current_way); + self = oself; + // FIXME + // ugh, better way to find players please!!! + if (this.classname != "player") + this.current_way = t; + + if (t.enemy == world) + { + bot_lost(this, FALSE); + self.route_failed = TRUE; + return; + } + + flag = ClientBitFlag(self.b_clientno); + + while(t) + { + if (t.b_sound & flag) + return; + if (t == self.last_way) + return; + t.b_sound = t.b_sound | flag; + t = t.enemy; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +WaypointThink + +Calculates the routes. We use thinks to avoid +tripping the runaway loop counter + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(entity e2, float b_bit) FollowLink = +{ + local float dist; + + if (self.b_aiflags & b_bit) + dist = self.items; + else + dist = vlen(self.origin - e2.origin) + self.items; + + // check if this is an RJ link + if (e2.b_aiflags & AI_SUPER_JUMP) + { + if (!bot_can_rj(route_table)) + return; + } + if (e2.b_aiflags & AI_DIFFICULT) + dist = dist + 1000; + + if ((dist < e2.items) || (e2.items == -1)) + { + if (!e2.keys) + busy_waypoints = busy_waypoints + 1; + e2.keys = TRUE; + e2.items = dist; + e2.think = WaypointThink; + e2.nextthink = time; + e2.enemy = self; + } +}; + +void() WaypointThink = +{ + local entity oself; + + if (self.items == -1) + return; + // can you say ugly? + if (self.b_aiflags & AI_TRACE_TEST) + { + if (self.target1) + { + traceline(self.origin, self.target1.origin, TRUE, self); + if (trace_fraction == 1) + FollowLink(self.target1, AI_TELELINK_1); + } + if (self.target2) + { + traceline(self.origin, self.target2.origin, TRUE, self); + if (trace_fraction == 1) + FollowLink(self.target2, AI_TELELINK_2); + } + if (self.target3) + { + traceline(self.origin, self.target3.origin, TRUE, self); + if (trace_fraction == 1) + FollowLink(self.target3, AI_TELELINK_3); + } + if (self.target4) + { + traceline(self.origin, self.target4.origin, TRUE, self); + if (trace_fraction == 1) + FollowLink(self.target4, AI_TELELINK_4); + } + } + else + { + if (self.target1) + FollowLink(self.target1, AI_TELELINK_1); + if (self.target2) + FollowLink(self.target2, AI_TELELINK_2); + if (self.target3) + FollowLink(self.target3, AI_TELELINK_3); + if (self.target4) + FollowLink(self.target4, AI_TELELINK_4); + } + + busy_waypoints = busy_waypoints - 1; + self.keys = FALSE; + + if (busy_waypoints <= 0) + { + if (direct_route) + { + oself = self; + self = route_table; + bot_get_path(self.target1, FALSE); + self = oself; + direct_route = FALSE; + } + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +begin_route and bot_get_path + +PLEASE NOTE: bot_get_path replaces the old +calls to begin_route. + +Routing isn't done all at once now, but in two +stages, the bot will calc a route *THEN* +choose a target, *THEN* mark a path. + +Boy it's confusing. + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +float() begin_route = +{ + if (busy_waypoints > 0) + return FALSE; + + if (route_table != world) + { + if (!route_table.ishuman) + { + if (route_table.b_clientno != -1) + return FALSE; + } + } + + route_table = self; + ClearRouteTable(); + self.last_way = FindWayPoint(self.current_way); + + if (self.last_way != world) + { + self.last_way.items = vlen(self.last_way.origin - self.origin); + self.last_way.nextthink = time; + self.last_way.think = WaypointThink; + self.last_way.keys = TRUE; + busy_waypoints = 1; + return TRUE; + } + else + { + route_table = world; + busy_waypoints = 0; + return FALSE; + } +}; + +void(entity this, float direct) bot_get_path = +{ + if (this == world) + return; + + if (route_table == self) + { + if (busy_waypoints <= 0) + { + route_table = world; + mark_path(this); + } + return; + } + if (direct) + { + if(begin_route()) + direct_route = TRUE; + else + bot_lost(this, FALSE); + return; + } +}; + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +BSP/QC Waypoint loading + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void() waypoint = +{ + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setorigin(self, self.origin); + + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + waypoints = waypoints + 1; + if (!way_head) + { + way_head = self; + way_foot = self; + } + else + { + way_foot._next = self; + self._last = way_foot; + way_foot = self; + } + + self.count = waypoints; + waypoint_mode = WM_LOADED; + if (self.count == 1) + { + localcmd("echo BSP waypoints detected\n"); + self.think = FixWaypoints; // wait until all bsp loaded points are spawned + self.nextthink = time; + } +}; + +void(vector org, vector bit1, float bit4, float flargs) make_way = +{ + local entity y; + waypoint_mode = WM_LOADED; + y = make_waypoint(org); + y.b_aiflags = flargs; + y.b_pants = bit1_x; + y.b_skill = bit1_y; + y.b_shirt = bit1_z; + y.b_frags = bit4; + if (y.count == 1) + { + localcmd("echo QuakeC waypoints detected\n"); + y.think = FixWaypoints; // wait until all qc loaded points are spawned + y.nextthink = time; + } +}; + + +/* +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Temporary Marker code + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +*/ + +void(vector org) SpawnTempWaypoint = +{ + local entity tep; + + if (!self.temp_way) + self.temp_way = tep = spawn(); + else + tep = self.temp_way; + + tep.classname = "temp_waypoint"; + tep.solid = SOLID_TRIGGER; + tep.movetype = MOVETYPE_NOCLIP; + setorigin(tep, org); + target_add(tep); + setsize(tep, VEC_HULL_MIN, VEC_HULL_MAX); // FIXME: convert these to numerical +}; \ No newline at end of file diff --git a/QC_other/QC_frikbot/waypoints/map_dm1.qc b/QC_other/QC_frikbot/waypoints/map_dm1.qc new file mode 100644 index 00000000..a330eac0 --- /dev/null +++ b/QC_other/QC_frikbot/waypoints/map_dm1.qc @@ -0,0 +1,62 @@ +/* QC Waypoint Dump - src/frikbot/map_dm1.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm1 = +{ + make_way('640.0 716.0 46.0', '2 20 0', 0, 0); + make_way('1066.0 733.0 94.0', '1 3 40', 0, 0); + make_way('1054.0 1321.0 94.0', '2 4 0', 0, 0); + make_way('783.0 1313.0 46.0', '6 37 3', 5, 0); + make_way('585.0 883.0 46.0', '4 6 37', 0, 0); + make_way('901.0 1060.0 46.0', '4 5 37', 0, 0); + make_way('448.0 1313.0 42.0', '37 27 8', 0, 0); + make_way('436.0 1562.0 46.0', '7 9 0', 0, 0); + make_way('238.0 1593.0 46.0', '8 10 44', 0, 0); + make_way('-122.0 1583.0 -98.0', '9 11 0', 0, 0); + make_way('-127.0 1414.0 -98.0', '10 12 0', 0, 0); + make_way('113.0 1416.0 -98.0', '11 13 43', 0, 0); + make_way('109.0 1287.0 -98.0', '12 14 41', 31, 0); + make_way('417.0 1258.0 -98.0', '13 35 31', 15, 0); + make_way('157.0 916.0 -98.0', '46 16 31', 14, 0); + make_way('-292.0 866.0 -98.0', '46 38 41', 15, 0); + make_way('397.0 1595.0 -98.0', '35 7 0', 0, 2); + make_way('-143.0 1418.0 46.0', '44 19 0', 0, 32784); + make_way('-385.0 1407.0 46.0', '36 18 0', 0, 65536); + make_way('607.0 608.0 46.0', '1 51 0', 0, 0); + make_way(' 77.0 614.0 46.0', '51 48 0', 0, 0); + make_way('-501.0 770.0 46.0', '47 23 0', 0, 0); + make_way('-534.0 988.0 46.0', '22 24 0', 0, 0); + make_way('-655.0 992.0 46.0', '23 25 0', 0, 0); + make_way('-651.0 1227.0 46.0', '24 26 32', 45, 0); + make_way('-524.0 1592.0 46.0', '25 10 39', 45, 128); + make_way('443.0 1145.0 46.0', '7 28 29', 0, 0); + make_way('220.0 1236.0 46.0', '27 30 31', 0, 0); + make_way('178.0 1027.0 46.0', '27 30 31', 0, 0); + make_way(' 28.0 1157.0 46.0', '29 28 31', 0, 128); + make_way('153.0 1154.0 -98.0', '13 15 41', 14, 0); + make_way('-307.0 1219.0 94.0', '25 33 39', 0, 0); + make_way('-292.0 1100.0 94.0', '32 16 38', 0, 0); + make_way('464.0 823.0 46.0', '52 0 0', 0, 128); + make_way('435.0 1451.0 -98.0', '17 0 0', 0, 128); + make_way('-300.0 1432.0 46.0', '10 0 0', 0, 128); + make_way('600.0 1309.0 46.0', '4 5 7', 6, 0); + make_way('-322.0 1007.0 -98.0', '16 41 0', 0, 0); + make_way('-543.0 1222.0 46.0', '26 32 45', 0, 0); + make_way('1000.0 941.0 94.0', '6 0 0', 0, 0); + make_way('-156.0 1049.0 -98.0', '38 31 16', 13, 0); + make_way('104.0 1392.0 46.0', '44 11 0', 0, 128); + make_way('280.0 1416.0 -98.0', '12 0 0', 0, 0); + make_way('280.0 1416.0 46.0', '18 9 42', 0, 128); + make_way('-656.0 1417.0 46.0', '25 26 39', 0, 0); + make_way('-263.0 723.0 -98.0', '15 16 0', 0, 0); + make_way('-203.0 769.0 46.0', '48 22 38', 0, 0); + make_way(' 82.0 763.0 46.0', '21 47 50', 15, 0); + make_way('348.0 758.0 46.0', '34 0 0', 0, 256); + make_way('141.0 764.0 46.0', '49 0 0', 0, 256); + make_way('488.0 607.0 46.0', '52 20 21', 0, 0); + make_way('482.0 683.0 54.0', '51 34 0', 0, 0); +}; diff --git a/QC_other/QC_frikbot/waypoints/map_dm2.qc b/QC_other/QC_frikbot/waypoints/map_dm2.qc new file mode 100644 index 00000000..73f74c5d --- /dev/null +++ b/QC_other/QC_frikbot/waypoints/map_dm2.qc @@ -0,0 +1,98 @@ +/* QC Waypoint Dump - src/frikbot/map_dm2.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by Frika C + +void() map_dm2 = +{ + make_way('2441.0 -189.1 46.0', '2 72 0', 0, 0); + make_way('2036.7 -141.6 46.0', '26 1 41', 46, 0); + make_way('2126.7 238.6 46.0', '0 43 41', 0, 0); + make_way('2615.4 -7.7 142.0', '68 41 0', 0, 0); + make_way('2614.6 -781.7 142.0', '73 6 62', 0, 0); + make_way('2455.8 -830.3 142.0', '5 7 48', 62, 0); + make_way('2511.8 -1395.2 46.0', '8 11 62', 0, 0); + make_way('2481.5 -1681.3 46.0', '28 9 7', 0, 0); + make_way('2391.6 -1861.9 46.0', '10 8 0', 0, 0); + make_way('2184.0 -1867.0 46.0', '53 9 0', 0, 0); + make_way('2741.6 -1424.7 46.0', '7 12 0', 0, 0); + make_way('2735.0 -1693.3 142.0', '11 47 0', 0, 0); + make_way('2927.9 -1852.4 142.0', '47 14 0', 0, 16); + make_way('2946.4 -1993.7 142.0', '13 37 0', 0, 16); + make_way('2254.5 -185.3 -114.0', '16 0 0', 0, 0); + make_way('2249.8 -27.2 -114.0', '15 17 0', 0, 0); + make_way('2611.8 -8.2 -50.0', '44 16 45', 0, 0); + make_way('1347.5 -1024.0 366.0', '59 58 0', 0, 0); + make_way('2002.3 -1024.0 366.0', '35 0 0', 0, 0); + make_way('1330.1 -714.6 366.0', '18 0 59', 0, 1024); + make_way('1323.0 -381.6 206.0', '22 24 0', 0, 0); + make_way('1328.2 -487.0 206.0', '21 20 61', 0, 0); + make_way('1559.7 -654.4 206.0', '0 60 0', 0, 0); + make_way('1837.4 -363.6 206.0', '21 25 0', 0, 0); + make_way('1877.0 -652.0 206.0', '24 26 0', 0, 0); + make_way('2038.3 -473.0 126.0', '2 27 50', 0, 0); + make_way('1683.4 -506.8 46.0', '26 64 63', 71, 0); + make_way('1699.3 -1694.6 46.0', '65 8 0', 0, 65536); + make_way('1697.9 -1336.4 42.0', '35 31 30', 65, 32784); + make_way('2058.4 -1354.2 158.0', '29 33 0', 0, 0); + make_way('1307.4 -1338.4 166.0', '29 32 0', 0, 0); + make_way('1315.8 -1034.8 222.0', '31 36 0', 0, 0); + make_way('2043.6 -1030.7 222.0', '30 34 0', 0, 0); + make_way('2043.6 -904.3 54.0', '35 0 0', 0, 1); + make_way('1696.0 -1037.4 42.0', '64 29 55', 56, 32784); + make_way('1307.4 -872.6 54.0', '35 0 0', 0, 1); + make_way('2733.5 -2008.2 142.0', '38 0 0', 0, 0); + make_way('2731.0 -2283.1 142.0', '37 39 0', 0, 0); + make_way('2425.1 -2305.7 142.0', '38 40 0', 0, 0); + make_way('2423.1 -2444.5 142.0', '39 67 31', 0, 4); + make_way('2175.6 -55.9 46.0', '4 2 0', 3, 0); + make_way('2181.9 -2388.8 222.0', '67 70 0', 0, 0); + make_way('2347.3 317.0 30.0', '3 74 0', 0, 0); + make_way('2644.7 235.2 -50.0', '74 17 0', 0, 0); + make_way('2806.9 -27.3 -50.0', '18 0 0', 0, 1); + make_way('2408.5 -401.3 30.0', '2 0 0', 0, 0); + make_way('2742.7 -1857.6 142.0', '12 13 0', 0, 0); + make_way('2352.0 -858.9 78.0', '49 0 0', 0, 0); + make_way('2375.9 -685.3 78.0', '48 46 0', 0, 0); + make_way('1971.3 -556.1 126.0', '25 0 0', 0, 4096); + make_way('2429.1 -1968.0 142.0', '52 66 0', 0, 128); + make_way('2280.0 -1968.0 142.0', '51 53 0', 0, 160); + make_way('2170.1 -1977.8 94.0', '10 69 0', 0, 160); + make_way('2189.7 -2258.8 106.0', '42 0 0', 0, 4096); + make_way('1424.0 -944.4 42.0', '35 0 0', 0, 32768); + make_way('1908.5 -928.4 42.0', '35 0 0', 0, 32768); + make_way('1825.4 -1029.8 366.0', '19 0 0', 0, 2048); + make_way('1512.9 -1015.2 366.0', '18 57 0', 0, 2048); + make_way('1264.0 -721.5 366.0', '20 22 18', 0, 0); + make_way('1440.6 -673.6 206.0', '23 61 0', 0, 32); + make_way('1449.1 -566.9 206.0', '60 22 63', 0, 32); + make_way('2525.9 -867.2 142.0', '6 0 5', 0, 1024); + make_way('1545.7 -488.4 46.0', '27 0 0', 0, 128); + make_way('1687.9 -744.0 42.0', '27 35 0', 0, 32784); + make_way('1700.6 -1513.2 46.0', '29 28 0', 0, 0); + make_way('2553.9 -1971.9 142.0', '51 0 0', 0, 160); + make_way('2160.2 -2469.1 222.0', '42 40 0', 0, 0); + make_way('2601.2 -176.0 142.0', '4 73 0', 0, 0); + make_way('2178.2 -2134.2 106.0', '53 54 70', 0, 0); + make_way('2172.0 -2347.6 110.0', '69 75 0', 0, 0); + make_way('1622.4 -528.7 46.0', '61 0 0', 0, 4096); + make_way('2576.0 -192.1 54.0', '1 0 0', 0, 0); + make_way('2611.3 -441.3 142.0', '5 68 0', 0, 0); + make_way('2456.5 297.3 -34.0', '43 44 0', 0, 0); + make_way('2168.4 -2336.3 110.0', '76 0 0', 0, 16); + make_way('2165.7 -1808.0 46.0', '77 0 0', 0, 0); + make_way('2529.4 -1844.5 46.0', '78 0 0', 0, 0); + make_way('2585.1 -1394.2 46.0', '79 0 0', 0, 0); + make_way('2752.6 -1389.0 46.0', '80 0 0', 0, 0); + make_way('2734.7 -1822.2 142.0', '81 0 0', 0, 0); + make_way('2980.3 -1832.3 142.0', '82 0 0', 0, 16); + make_way('2957.0 -2032.2 142.0', '83 0 0', 0, 16); + make_way('2720.9 -2057.8 150.0', '84 0 0', 0, 0); + make_way('2693.6 -2275.7 142.0', '85 0 0', 0, 0); + make_way('2429.9 -2295.8 142.0', '86 0 0', 0, 0); + make_way('2431.5 -2115.8 142.0', '51 0 0', 0, 32784); +}; + +// End dump \ No newline at end of file diff --git a/QC_other/QC_frikbot/waypoints/map_dm3.qc b/QC_other/QC_frikbot/waypoints/map_dm3.qc new file mode 100644 index 00000000..56637c3f --- /dev/null +++ b/QC_other/QC_frikbot/waypoints/map_dm3.qc @@ -0,0 +1,149 @@ +/* QC Waypoint Dump - src/frikbot/map_dm3.qc +For instructions please read the +wayedit.txt that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by Frika C + +void() map_dm3 = +{ + make_way('-888.8 -71.0 6.0', '44 3 2', 0, 0); + make_way('-937.4 19.2 6.0', '3 1 45', 0, 0); + make_way('-827.2 26.1 6.0', '1 2 4', 0, 0); + make_way('-801.5 366.8 6.0', '3 5 0', 0, 0); + make_way('-783.8 774.2 6.0', '4 6 0', 0, 0); + make_way('-550.2 759.6 6.0', '5 7 0', 0, 0); + make_way('-574.0 368.0 6.0', '6 8 0', 0, 0); + make_way('-430.2 378.3 6.0', '7 9 0', 0, 0); + make_way('-406.9 784.0 6.0', '8 10 0', 0, 0); + make_way('-259.9 772.3 6.0', '9 11 12', 0, 0); + make_way('-243.7 250.5 14.0', '10 12 0', 0, 0); + make_way('-35.8 581.6 62.0', '10 11 13', 14, 0); + make_way(' 29.5 647.5 62.0', '12 15 49', 0, 0); + make_way('521.9 603.4 78.0', '12 15 0', 0, 0); + make_way('507.6 514.3 78.0', '14 13 16', 0, 0); + make_way('504.3 308.4 78.0', '15 20 17', 0, 0); + make_way('175.2 -34.7 78.0', '16 19 20', 18, 0); + make_way('485.8 -387.2 78.0', '17 21 19', 0, 0); + make_way('368.0 -201.7 78.0', '17 18 51', 0, 0); + make_way('397.0 124.9 78.0', '16 17 51', 0, 0); + make_way('496.0 -558.1 78.0', '18 22 58', 31, 0); + make_way('147.5 -528.0 174.0', '21 23 0', 0, 128); + make_way('-213.3 -528.0 174.0', '22 24 0', 0, 128); + make_way('-229.6 -865.0 174.0', '23 25 0', 0, 128); + make_way('339.0 -873.6 286.0', '24 26 0', 0, 128); + make_way('341.2 -538.2 286.0', '25 27 0', 0, 128); + make_way('-143.0 -535.0 350.0', '26 28 0', 0, 128); + make_way('-143.3 -696.6 350.0', '27 29 0', 0, 128); + make_way('283.6 -703.7 350.0', '28 30 0', 0, 128); + make_way('371.0 -699.8 286.0', '31 0 0', 0, 128); + make_way('416.0 -691.3 6.0', '33 32 0', 0, 0); + make_way('253.9 -794.9 6.0', '31 57 34', 0, 0); + make_way('253.7 -610.4 6.0', '57 31 0', 0, 0); + make_way('-64.0 -727.5 6.0', '32 35 36', 37, 0); + make_way('-40.6 -874.3 6.0', '34 37 58', 0, 128); + make_way(' 43.7 -535.1 6.0', '37 57 34', 56, 0); + make_way('-172.1 -560.9 6.0', '38 36 35', 34, 0); + make_way('-298.6 -563.7 6.0', '39 37 0', 0, 0); + make_way('-318.6 -710.5 6.0', '38 40 0', 0, 0); + make_way('-629.4 -683.2 6.0', '39 41 0', 0, 0); + make_way('-626.9 -449.0 6.0', '40 42 43', 0, 0); + make_way('-565.7 -449.0 6.0', '41 19 0', 0, 2); + make_way('-654.9 -271.1 6.0', '41 44 0', 0, 0); + make_way('-873.3 -247.0 6.0', '43 1 0', 0, 0); + make_way('-939.9 347.7 142.0', '46 2 0', 0, 0); + make_way('-912.7 821.5 142.0', '47 45 5', 0, 0); + make_way('-577.0 859.7 142.0', '50 46 48', 0, 0); + make_way('-556.0 784.6 142.0', '47 6 59', 0, 256); + make_way('-98.5 799.3 142.0', '13 50 0', 0, 0); + make_way('-198.8 861.0 142.0', '49 47 10', 0, 0); + make_way('584.5 -30.1 -146.0', '52 69 71', 0, 0); + make_way('288.5 -27.4 -154.0', '53 51 0', 0, 0); + make_way('126.7 -188.8 -154.0', '54 52 0', 0, 0); + make_way('-164.4 -210.3 -154.0', '55 53 0', 0, 0); + make_way('-177.9 -425.6 -90.0', '56 54 0', 0, 0); + make_way(' 52.6 -443.0 -10.0', '36 55 0', 0, 0); + make_way(' 71.4 -634.1 6.0', '36 33 32', 0, 0); + make_way('496.0 -880.0 78.0', '35 21 31', 0, 128); + make_way('-528.0 664.4 142.0', '60 6 0', 0, 65536); + make_way('-496.8 461.0 142.0', '59 8 7', 61, 65792); + make_way('-466.9 320.2 142.0', '62 11 7', 60, 65824); + make_way('-459.7 277.2 166.0', '63 0 0', 0, 65824); + make_way('-467.3 208.0 198.0', '11 64 0', 0, 65536); + make_way('-719.9 208.0 206.0', '63 68 0', 0, 65664); + make_way('-825.0 251.2 206.0', '68 66 3', 0, 65792); + make_way('-799.7 108.2 206.0', '67 2 0', 0, 65568); + make_way('-688.0 99.6 206.0', '66 0 0', 0, 65536); + make_way('-797.7 318.5 206.0', '65 64 45', 0, 65664); + make_way('822.8 -265.4 -162.0', '51 70 0', 0, 0); + make_way('1000.0 -29.9 -162.0', '71 69 122', 0, 0); + make_way('827.2 198.1 -162.0', '51 70 0', 0, 0); + make_way('1970.0 -31.5 -146.0', '123 78 73', 0, 0); + make_way('1982.6 197.3 -66.0', '72 74 0', 0, 0); + make_way('1964.1 437.3 -66.0', '73 75 76', 0, 0); + make_way('1544.8 491.8 -66.0', '74 76 0', 0, 0); + make_way('1693.0 400.0 -66.0', '75 74 77', 0, 256); + make_way('1695.4 362.0 -42.0', '132 131 0', 0, 0); + make_way('1963.1 -436.8 -2.0', '72 79 0', 0, 0); + make_way('1380.4 -427.4 -2.0', '78 102 80', 0, 0); + make_way('1186.5 -681.2 -2.0', '81 79 121', 0, 0); + make_way('1322.4 -745.5 -2.0', '82 80 0', 0, 0); + make_way('1461.8 -756.2 -2.0', '85 83 81', 0, 0); + make_way('1432.7 -944.0 -2.0', '82 84 0', 0, 0); + make_way('1248.5 -926.6 -2.0', '83 101 0', 0, 2); + make_way('1707.9 -715.7 -2.0', '86 82 0', 0, 0); + make_way('1821.0 -850.6 -2.0', '87 85 0', 0, 0); + make_way('1531.5 -899.7 110.0', '88 86 82', 85, 0); + make_way('1125.5 -896.2 110.0', '89 87 0', 0, 0); + make_way('986.5 -799.6 110.0', '90 88 80', 121, 0); + make_way('811.1 -657.7 110.0', '91 89 0', 0, 0); + make_way('658.1 -638.4 110.0', '92 90 0', 0, 0); + make_way('656.0 -356.4 78.0', '93 91 0', 0, 0); + make_way('824.9 -256.7 78.0', '94 92 51', 0, 0); + make_way('952.1 -32.8 78.0', '95 93 0', 0, 0); + make_way('817.3 175.9 78.0', '96 94 51', 0, 0); + make_way('633.2 323.0 78.0', '97 95 0', 0, 0); + make_way('631.7 415.3 78.0', '98 96 0', 0, 0); + make_way('822.9 444.2 78.0', '99 101 97', 0, 0); + make_way('1111.5 624.0 78.0', '101 100 98', 0, 256); + make_way('1114.6 651.3 102.0', '111 0 0', 0, 768); + make_way('1338.2 383.4 78.0', '102 99 98', 0, 0); + make_way('1366.0 -48.8 -2.0', '79 101 123', 122, 0); + make_way('1355.8 65.9 -370.0', '128 125 132', 104, 65600); + make_way('1362.6 635.0 -334.0', '103 135 0', 0, 65792); + make_way('1366.7 875.6 -274.0', '135 111 0', 0, 0); + make_way('841.8 1105.2 -242.0', '111 112 107', 0, 0); + make_way('1439.7 1113.7 -213.0', '106 108 0', 0, 0); + make_way('1871.4 990.6 -191.0', '107 109 0', 0, 0); + make_way('1851.0 655.5 -158.0', '108 110 0', 0, 0); + make_way('1542.3 802.5 -274.0', '105 104 0', 0, 0); + make_way('1074.9 805.1 -274.0', '105 112 106', 135, 0); + make_way('703.5 681.7 -242.0', '111 106 113', 0, 1024); + make_way('608.0 681.2 -82.0', '114 0 0', 0, 0); + make_way('612.4 789.1 -82.0', '115 111 0', 0, 1024); + make_way('614.1 858.3 46.0', '116 0 0', 0, 0); + make_way('618.9 1020.4 46.0', '115 117 0', 0, 0); + make_way('539.7 1025.0 62.0', '116 118 0', 0, 0); + make_way('516.6 923.8 62.0', '117 119 0', 0, 1024); + make_way('511.4 848.0 238.0', '120 0 0', 0, 0); + make_way('504.8 654.8 238.0', '119 14 0', 0, 0); + make_way('1112.4 -706.8 -2.0', '89 80 0', 0, 4096); + make_way('1124.4 -31.4 -146.0', '138 70 124', 126, 0); + make_way('1654.0 -38.6 -146.0', '137 72 131', 129, 0); + make_way('1160.0 78.5 -147.2', '125 122 0', 0, 512); + make_way('1137.3 45.9 -370.0', '124 103 127', 0, 65536); + make_way('1161.1 -144.4 -148.3', '122 127 0', 0, 66048); + make_way('1159.7 -167.3 -370.0', '126 125 128', 134, 65536); + make_way('1468.4 -211.2 -370.0', '129 103 133', 130, 65536); + make_way('1654.8 -127.0 -162.2', '123 128 134', 0, 65600); + make_way('1798.0 -355.0 -370.0', '128 133 0', 0, 65536); + make_way('1660.2 51.5 -152.0', '132 123 0', 0, 64); + make_way('1657.1 71.4 -370.0', '103 131 133', 0, 65536); + make_way('1621.6 -110.8 -370.0', '128 132 130', 0, 65536); + make_way('1344.8 -141.7 -370.0', '127 103 128', 129, 65536); + make_way('1368.7 785.3 -271.1', '105 104 0', 0, 0); + make_way('1365.6 -34.1 -146.0', '138 137 0', 0, 0); + make_way('1536.2 -35.6 -146.0', '136 123 0', 0, 0); + make_way('1197.9 -32.8 -146.0', '122 136 0', 0, 0); + make_way('1537.0 8.8 -146.0', '123 102 0', 0, 4096); +}; diff --git a/QC_other/QC_frikbot/waypoints/map_dm4.qc b/QC_other/QC_frikbot/waypoints/map_dm4.qc new file mode 100644 index 00000000..3a150d8d --- /dev/null +++ b/QC_other/QC_frikbot/waypoints/map_dm4.qc @@ -0,0 +1,69 @@ +/* QC Waypoint Dump - src/frikbot/map_dm4.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm4 = +{ + make_way('776.0 -808.0 -210.0', '33 34 47', 0, 2); + make_way('272.0 -952.0 46.0', '18 17 0', 0, 0); + make_way('112.0 -1136.0 -82.0', '57 16 8', 0, 0); + make_way('784.0 -176.0 46.0', '22 0 28', 0, 0); + make_way('-64.0 -232.0 -50.0', '24 27 0', 0, 0); + make_way('-64.0 512.0 -274.0', '46 59 0', 0, 0); + make_way('428.0 -966.0 -82.0', '57 9 8', 58, 0); + make_way('134.0 -820.0 -82.0', '3 57 58', 7, 0); + make_way('426.0 -790.0 -82.0', '58 57 7', 3, 0); + make_way('336.0 -732.0 -82.0', '58 54 0', 11, 0); + make_way('354.0 -471.0 -86.0', '55 0 0', 0, 0); + make_way('188.0 -408.0 -82.0', '54 11 0', 0, 0); + make_way('505.0 -318.0 -82.0', '54 15 14', 0, 0); + make_way('512.0 -97.0 -82.0', '13 15 53', 35, 0); + make_way('631.0 -386.0 -82.0', '13 14 35', 0, 4); + make_way('337.0 -1206.0 -2.0', '3 17 0', 0, 0); + make_way('334.0 -1016.0 46.0', '16 18 0', 0, 0); + make_way('337.0 -863.0 42.0', '17 19 43', 0, 4); + make_way('337.0 -737.0 46.0', '18 20 0', 0, 0); + make_way('337.0 -508.0 46.0', '19 21 23', 13, 0); + make_way('516.0 -468.0 46.0', '20 54 13', 22, 0); + make_way('610.0 -180.0 46.0', '21 4 51', 14, 0); + make_way('120.0 -478.0 46.0', '20 24 54', 0, 0); + make_way('143.0 -303.0 -34.0', '23 25 5', 0, 0); + make_way('160.0 -183.0 -50.0', '24 52 0', 0, 384); + make_way('199.0 76.0 -82.0', '52 0 0', 0, 0); + make_way('-120.0 -518.0 -50.0', '5 28 56', 0, 2); + make_way('868.0 -176.0 46.0', '48 4 0', 0, 0); + make_way('847.0 -578.0 46.0', '48 30 31', 1, 0); + make_way('1121.0 -593.0 46.0', '29 0 0', 0, 0); + make_way('983.0 -457.0 -82.0', '32 33 0', 0, 0); + make_way('993.0 -594.0 -82.0', '31 33 0', 0, 0); + make_way('772.0 -471.0 -82.0', '32 31 1', 0, 0); + make_way('368.0 -92.0 -274.0', '35 44 0', 0, 0); + make_way('375.0 -239.0 -274.0', '34 41 36', 0, 128); + make_way('-49.0 -234.0 -274.0', '35 37 42', 0, 0); + make_way('-56.0 75.0 -274.0', '36 38 46', 0, 0); + make_way(' 69.0 70.0 -274.0', '37 0 0', 0, 0); + make_way('620.0 -242.0 -274.0', '41 40 0', 0, 0); + make_way('624.0 -42.0 -274.0', '39 45 49', 43, 0); + make_way('514.0 -240.0 -274.0', '35 39 0', 0, 0); + make_way('206.0 -245.0 -274.0', '14 0 0', 0, 4096); + make_way('626.0 58.0 -274.0', '49 18 45', 0, 2); + make_way('369.0 65.0 -266.0', '34 0 0', 0, 0); + make_way('701.0 66.0 -274.0', '40 49 43', 0, 0); + make_way('-60.0 334.0 -274.0', '37 6 0', 0, 128); + make_way('752.0 -502.0 -82.0', '48 0 0', 0, 4096); + make_way('856.0 -391.0 46.0', '28 29 33', 31, 0); + make_way('553.0 66.0 -274.0', '43 45 40', 0, 0); + make_way('557.0 -45.0 46.0', '51 14 0', 0, 0); + make_way('605.0 -113.0 46.0', '22 50 0', 0, 4096); + make_way('173.0 -60.0 -82.0', '25 26 0', 0, 384); + make_way('224.0 -59.0 -82.0', '26 0 0', 0, 0); + make_way('335.0 -431.0 -82.0', '35 13 12', 10, 0); + make_way('434.0 -390.0 -82.0', '22 0 0', 0, 4096); + make_way('-183.0 -472.0 -50.0', '27 0 0', 0, 0); + make_way('314.0 -1027.0 -82.0', '58 3 7', 9, 0); + make_way('336.0 -801.0 -82.0', '10 9 8', 57, 0); + make_way('-61.0 573.0 -274.0', '6 0 0', 0, 0); +}; diff --git a/QC_other/QC_frikbot/waypoints/map_dm5.qc b/QC_other/QC_frikbot/waypoints/map_dm5.qc new file mode 100644 index 00000000..d2e92745 --- /dev/null +++ b/QC_other/QC_frikbot/waypoints/map_dm5.qc @@ -0,0 +1,58 @@ +/* QC Waypoint Dump - src/frikbot/map_dm5.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm5 = +{ + make_way(' 90.0 -380.0 62.0', '2 10 17', 0, 0); + make_way('-89.0 -373.0 62.0', '3 1 26', 0, 0); + make_way('-71.0 321.0 62.0', '11 5 2', 0, 0); + make_way('504.0 348.0 14.0', '0 5 0', 0, 0); + make_way('287.0 374.0 -10.0', '4 43 3', 0, 0); + make_way('296.0 -97.0 -90.0', '0 7 43', 0, 0); + make_way('657.0 -50.0 14.0', '6 41 0', 0, 0); + make_way('281.0 -315.0 -90.0', '6 41 39', 0, 65536); + make_way('225.0 -587.0 -90.0', '0 39 10', 0, 0); + make_way(' 54.0 -601.0 -90.0', '9 0 0', 0, 0); + make_way('-72.0 512.0 62.0', '3 12 0', 0, 0); + make_way('107.0 694.0 142.0', '11 46 0', 0, 0); + make_way('816.0 371.0 238.0', '16 44 25', 0, 4); + make_way('287.0 208.0 142.0', '33 0 0', 0, 32768); + make_way('259.0 939.0 142.0', '35 0 0', 0, 0); + make_way('451.0 686.0 142.0', '46 13 0', 0, 0); + make_way('144.0 -344.0 62.0', '1 0 0', 0, 0); + make_way('271.0 368.0 238.0', '44 19 14', 33, 0); + make_way('-97.0 373.0 238.0', '18 20 32', 11, 0); + make_way('-98.0 -227.0 238.0', '19 31 30', 21, 0); + make_way('-96.0 -776.0 238.0', '22 20 34', 10, 0); + make_way('363.0 -768.0 238.0', '21 42 38', 0, 0); + make_way('160.0 -224.0 238.0', '20 30 0', 0, 0); + make_way('893.0 -768.0 238.0', '29 48 25', 0, 0); + make_way('1003.0 -767.0 238.0', '24 13 0', 0, 2); + make_way('-81.0 -767.0 62.0', '2 27 0', 0, 0); + make_way('397.0 -766.0 142.0', '0 26 38', 0, 0); + make_way('338.0 -389.0 142.0', '0 8 0', 38, 0); + make_way('880.0 -256.0 238.0', '45 24 0', 0, 0); + make_way('321.0 -224.0 238.0', '20 45 28', 23, 0); + make_way('-180.0 -201.0 190.0', '2 0 0', 0, 0); + make_way('-178.0 376.0 185.0', '3 0 0', 0, 0); + make_way('288.0 448.0 142.0', '14 4 3', 47, 0); + make_way('-169.0 -825.0 188.0', '26 0 0', 0, 0); + make_way('288.0 1007.0 142.0', '15 46 0', 0, 32768); + make_way('621.0 -544.0 190.0', '37 0 38', 48, 0); + make_way('663.0 -326.0 142.0', '36 38 0', 0, 0); + make_way('499.0 -498.0 174.0', '27 28 36', 37, 0); + make_way('407.0 -392.0 -90.0', '40 9 8', 0, 0); + make_way('548.0 -309.0 -90.0', '41 39 0', 0, 0); + make_way('544.0 -53.0 -90.0', '8 7 40', 6, 0); + make_way('489.0 -769.0 238.0', '23 22 48', 0, 0); + make_way('294.0 134.0 -90.0', '6 5 0', 0, 0); + make_way('599.0 369.0 238.0', '18 13 0', 0, 0); + make_way('664.0 -226.0 238.0', '29 30 37', 0, 0); + make_way('290.0 744.0 142.0', '47 12 16', 15, 0); + make_way('288.0 619.0 142.0', '46 33 0', 0, 0); + make_way('640.0 -776.0 238.0', '24 42 36', 0, 0); +}; diff --git a/QC_other/QC_frikbot/waypoints/map_dm6.qc b/QC_other/QC_frikbot/waypoints/map_dm6.qc new file mode 100644 index 00000000..fd1fe5a3 --- /dev/null +++ b/QC_other/QC_frikbot/waypoints/map_dm6.qc @@ -0,0 +1,79 @@ +/* QC Waypoint Dump - src/frikbot/map_dm6.qc +For instructions please read the +readme.html that comes with FrikBot */ + +void(vector org, vector bit1, float bit4, float flargs) make_way; +// Ways by igor9 + +void() map_dm6 = +{ + make_way('760.0 -1080.0 278.0', '2 8 47', 0, 0); + make_way('830.0 -880.0 278.0', '1 3 0', 0, 0); + make_way('994.0 -852.0 278.0', '2 4 0', 0, 0); + make_way('1213.0 -878.0 278.0', '3 5 0', 0, 0); + make_way('1226.0 -1088.0 278.0', '4 6 0', 10, 0); + make_way('1199.0 -1302.0 278.0', '5 7 0', 0, 0); + make_way('1040.0 -1349.0 278.0', '6 8 0', 0, 0); + make_way('856.0 -1313.0 278.0', '7 1 0', 0, 0); + make_way('1033.0 -1466.0 278.0', '7 0 0', 0, 0); + make_way('1519.0 -1087.0 231.0', '11 5 0', 0, 0); + make_way('1761.0 -1087.0 190.0', '10 12 0', 0, 0); + make_way('1763.0 -908.0 190.0', '11 13 54', 0, 0); + make_way('1764.0 -706.0 190.0', '12 14 53', 0, 0); + make_way('1766.0 -418.0 190.0', '13 18 15', 23, 0); + make_way('1883.0 -420.0 190.0', '14 16 0', 0, 0); + make_way('1891.0 -157.0 190.0', '15 17 0', 0, 0); + make_way('1628.0 -158.0 190.0', '16 18 0', 0, 0); + make_way('1629.0 -278.0 190.0', '17 19 14', 23, 0); + make_way('1318.0 -319.0 190.0', '18 21 23', 0, 0); + make_way(' 87.0 -1522.0 62.0', '41 0 0', 0, 0); + make_way('1293.0 -555.0 190.0', '19 22 0', 0, 0); + make_way('1670.0 -535.0 62.0', '23 31 21', 0, 0); + make_way('1556.0 -438.0 62.0', '22 24 52', 0, 0); + make_way('1381.0 -429.0 62.0', '23 25 58', 0, 0); + make_way('1016.0 -416.0 62.0', '24 0 0', 0, 0); + make_way('852.0 -1085.0 -22.0', '27 33 65', 69, 0); + make_way('832.0 -1085.0 -258.0', '28 0 0', 0, 0); + make_way('513.0 -1091.0 -258.0', '27 68 0', 0, 2); + make_way('1380.0 -1096.0 14.0', '32 30 0', 0, 0); + make_way('1730.0 -1099.0 62.0', '29 31 0', 0, 0); + make_way('1720.0 -824.0 62.0', '30 22 0', 0, 0); + make_way('1226.0 -1087.0 -18.0', '29 68 67', 66, 0); + make_way('1020.0 -1257.0 -2.0', '69 34 26', 68, 0); + make_way('1020.0 -1665.0 62.0', '33 35 0', 0, 0); + make_way('685.0 -1662.0 62.0', '34 36 0', 0, 0); + make_way('517.0 -1660.0 62.0', '48 57 40', 35, 0); + make_way('576.0 -1088.0 131.0', '59 38 0', 0, 0); + make_way('703.0 -1090.0 81.0', '26 37 33', 65, 0); + make_way('201.0 -895.0 158.0', '63 57 59', 0, 2); + make_way('247.0 -1654.0 62.0', '36 41 57', 56, 0); + make_way(' 87.0 -1612.0 62.0', '40 42 56', 0, 0); + make_way(' 80.0 -1758.0 62.0', '56 41 43', 51, 0); + make_way(' 72.0 -2008.0 110.0', '42 44 0', 0, 0); + make_way('426.0 -2007.0 190.0', '43 45 0', 0, 0); + make_way('446.0 -1681.0 254.0', '44 62 40', 57, 0); + make_way('464.0 -1366.0 278.0', '62 47 0', 0, 0); + make_way('408.0 -1088.0 278.0', '46 1 0', 0, 0); + make_way('512.0 -1901.0 62.0', '36 49 51', 0, 0); + make_way('507.0 -2037.0 62.0', '48 50 0', 0, 0); + make_way('355.0 -2040.0 62.0', '49 51 57', 0, 0); + make_way('298.0 -1906.0 62.0', '42 50 48', 0, 0); + make_way('1613.0 -426.0 62.0', '14 18 0', 0, 4096); + make_way('1648.0 -702.0 137.0', '31 22 0', 0, 0); + make_way('1648.0 -911.0 128.0', '30 31 0', 0, 0); + make_way('211.0 -1225.0 134.0', '63 59 0', 0, 0); + make_way('151.0 -1785.0 70.0', '42 41 51', 39, 8); + make_way('323.0 -1785.0 78.0', '40 50 36', 39, 8); + make_way('1379.0 -589.0 62.0', '24 0 0', 0, 0); + make_way('305.0 -1088.0 150.0', '63 55 39', 37, 0); + make_way('896.0 -1464.0 278.0', '9 0 0', 0, 0); + make_way('232.0 -1512.0 62.0', '20 0 0', 0, 0); + make_way('456.0 -1504.0 278.0', '46 45 0', 0, 0); + make_way('202.0 -1109.0 134.0', '59 39 55', 0, 0); + make_way('1051.0 -529.0 62.0', '25 66 0', 0, 0); + make_way('921.0 -961.0 -18.0', '66 26 69', 0, 0); + make_way('1028.0 -812.0 30.0', '65 64 68', 32, 0); + make_way('1262.0 -1248.0 -18.0', '32 0 0', 0, 0); + make_way('1088.0 -1094.0 -10.0', '66 32 33', 57, 8); + make_way('951.0 -1095.0 -10.0', '65 33 26', 57, 8); +}; diff --git a/QC_hipnotic/AI.QC b/QC_other/QC_hipnotic/AI.QC similarity index 100% rename from QC_hipnotic/AI.QC rename to QC_other/QC_hipnotic/AI.QC diff --git a/QC_hipnotic/AMTEST.QC b/QC_other/QC_hipnotic/AMTEST.QC similarity index 100% rename from QC_hipnotic/AMTEST.QC rename to QC_other/QC_hipnotic/AMTEST.QC diff --git a/QC_hipnotic/BOSS.QC b/QC_other/QC_hipnotic/BOSS.QC similarity index 100% rename from QC_hipnotic/BOSS.QC rename to QC_other/QC_hipnotic/BOSS.QC diff --git a/QC_hipnotic/BUTTONS.QC b/QC_other/QC_hipnotic/BUTTONS.QC similarity index 100% rename from QC_hipnotic/BUTTONS.QC rename to QC_other/QC_hipnotic/BUTTONS.QC diff --git a/QC_hipnotic/CLIENT.QC b/QC_other/QC_hipnotic/CLIENT.QC similarity index 100% rename from QC_hipnotic/CLIENT.QC rename to QC_other/QC_hipnotic/CLIENT.QC diff --git a/QC_hipnotic/COMBAT.QC b/QC_other/QC_hipnotic/COMBAT.QC similarity index 100% rename from QC_hipnotic/COMBAT.QC rename to QC_other/QC_hipnotic/COMBAT.QC diff --git a/QC_hipnotic/DEFS.QC b/QC_other/QC_hipnotic/DEFS.QC similarity index 100% rename from QC_hipnotic/DEFS.QC rename to QC_other/QC_hipnotic/DEFS.QC diff --git a/QC_hipnotic/DEMON.QC b/QC_other/QC_hipnotic/DEMON.QC similarity index 100% rename from QC_hipnotic/DEMON.QC rename to QC_other/QC_hipnotic/DEMON.QC diff --git a/QC_hipnotic/DOG.QC b/QC_other/QC_hipnotic/DOG.QC similarity index 100% rename from QC_hipnotic/DOG.QC rename to QC_other/QC_hipnotic/DOG.QC diff --git a/QC_hipnotic/DOORS.QC b/QC_other/QC_hipnotic/DOORS.QC similarity index 100% rename from QC_hipnotic/DOORS.QC rename to QC_other/QC_hipnotic/DOORS.QC diff --git a/QC_hipnotic/ENFORCER.QC b/QC_other/QC_hipnotic/ENFORCER.QC similarity index 100% rename from QC_hipnotic/ENFORCER.QC rename to QC_other/QC_hipnotic/ENFORCER.QC diff --git a/QC_hipnotic/FIGHT.QC b/QC_other/QC_hipnotic/FIGHT.QC similarity index 100% rename from QC_hipnotic/FIGHT.QC rename to QC_other/QC_hipnotic/FIGHT.QC diff --git a/QC_hipnotic/FISH.QC b/QC_other/QC_hipnotic/FISH.QC similarity index 100% rename from QC_hipnotic/FISH.QC rename to QC_other/QC_hipnotic/FISH.QC diff --git a/QC_hipnotic/FLAG.QC b/QC_other/QC_hipnotic/FLAG.QC similarity index 100% rename from QC_hipnotic/FLAG.QC rename to QC_other/QC_hipnotic/FLAG.QC diff --git a/QC_hipnotic/HIPARMA.QC b/QC_other/QC_hipnotic/HIPARMA.QC similarity index 100% rename from QC_hipnotic/HIPARMA.QC rename to QC_other/QC_hipnotic/HIPARMA.QC diff --git a/QC_hipnotic/HIPCLOCK.QC b/QC_other/QC_hipnotic/HIPCLOCK.QC similarity index 100% rename from QC_hipnotic/HIPCLOCK.QC rename to QC_other/QC_hipnotic/HIPCLOCK.QC diff --git a/QC_hipnotic/HIPCOUNT.QC b/QC_other/QC_hipnotic/HIPCOUNT.QC similarity index 100% rename from QC_hipnotic/HIPCOUNT.QC rename to QC_other/QC_hipnotic/HIPCOUNT.QC diff --git a/QC_hipnotic/HIPDECOY.QC b/QC_other/QC_hipnotic/HIPDECOY.QC similarity index 100% rename from QC_hipnotic/HIPDECOY.QC rename to QC_other/QC_hipnotic/HIPDECOY.QC diff --git a/QC_hipnotic/HIPDEFS.QC b/QC_other/QC_hipnotic/HIPDEFS.QC similarity index 100% rename from QC_hipnotic/HIPDEFS.QC rename to QC_other/QC_hipnotic/HIPDEFS.QC diff --git a/QC_hipnotic/HIPGREM.QC b/QC_other/QC_hipnotic/HIPGREM.QC similarity index 100% rename from QC_hipnotic/HIPGREM.QC rename to QC_other/QC_hipnotic/HIPGREM.QC diff --git a/QC_hipnotic/HIPHOLES.QC b/QC_other/QC_hipnotic/HIPHOLES.QC similarity index 100% rename from QC_hipnotic/HIPHOLES.QC rename to QC_other/QC_hipnotic/HIPHOLES.QC diff --git a/QC_hipnotic/HIPITEMS.QC b/QC_other/QC_hipnotic/HIPITEMS.QC similarity index 100% rename from QC_hipnotic/HIPITEMS.QC rename to QC_other/QC_hipnotic/HIPITEMS.QC diff --git a/QC_hipnotic/HIPMISC.QC b/QC_other/QC_hipnotic/HIPMISC.QC similarity index 100% rename from QC_hipnotic/HIPMISC.QC rename to QC_other/QC_hipnotic/HIPMISC.QC diff --git a/QC_hipnotic/HIPMODEL.QC b/QC_other/QC_hipnotic/HIPMODEL.QC similarity index 100% rename from QC_hipnotic/HIPMODEL.QC rename to QC_other/QC_hipnotic/HIPMODEL.QC diff --git a/QC_hipnotic/HIPQUAKE.QC b/QC_other/QC_hipnotic/HIPQUAKE.QC similarity index 100% rename from QC_hipnotic/HIPQUAKE.QC rename to QC_other/QC_hipnotic/HIPQUAKE.QC diff --git a/QC_hipnotic/HIPROT.QC b/QC_other/QC_hipnotic/HIPROT.QC similarity index 100% rename from QC_hipnotic/HIPROT.QC rename to QC_other/QC_hipnotic/HIPROT.QC diff --git a/QC_hipnotic/HIPRUBBL.QC b/QC_other/QC_hipnotic/HIPRUBBL.QC similarity index 100% rename from QC_hipnotic/HIPRUBBL.QC rename to QC_other/QC_hipnotic/HIPRUBBL.QC diff --git a/QC_hipnotic/HIPSCRGE.QC b/QC_other/QC_hipnotic/HIPSCRGE.QC similarity index 100% rename from QC_hipnotic/HIPSCRGE.QC rename to QC_other/QC_hipnotic/HIPSCRGE.QC diff --git a/QC_hipnotic/HIPSPAWN.QC b/QC_other/QC_hipnotic/HIPSPAWN.QC similarity index 100% rename from QC_hipnotic/HIPSPAWN.QC rename to QC_other/QC_hipnotic/HIPSPAWN.QC diff --git a/QC_hipnotic/HIPSPIKE.QC b/QC_other/QC_hipnotic/HIPSPIKE.QC similarity index 100% rename from QC_hipnotic/HIPSPIKE.QC rename to QC_other/QC_hipnotic/HIPSPIKE.QC diff --git a/QC_hipnotic/HIPSPR.QC b/QC_other/QC_hipnotic/HIPSPR.QC similarity index 100% rename from QC_hipnotic/HIPSPR.QC rename to QC_other/QC_hipnotic/HIPSPR.QC diff --git a/QC_hipnotic/HIPSUBS.QC b/QC_other/QC_hipnotic/HIPSUBS.QC similarity index 100% rename from QC_hipnotic/HIPSUBS.QC rename to QC_other/QC_hipnotic/HIPSUBS.QC diff --git a/QC_hipnotic/HIPTRAIN.QC b/QC_other/QC_hipnotic/HIPTRAIN.QC similarity index 100% rename from QC_hipnotic/HIPTRAIN.QC rename to QC_other/QC_hipnotic/HIPTRAIN.QC diff --git a/QC_hipnotic/HIPTRIG.QC b/QC_other/QC_hipnotic/HIPTRIG.QC similarity index 100% rename from QC_hipnotic/HIPTRIG.QC rename to QC_other/QC_hipnotic/HIPTRIG.QC diff --git a/QC_hipnotic/HIPWATER.QC b/QC_other/QC_hipnotic/HIPWATER.QC similarity index 100% rename from QC_hipnotic/HIPWATER.QC rename to QC_other/QC_hipnotic/HIPWATER.QC diff --git a/QC_hipnotic/HIP_BRK.QC b/QC_other/QC_hipnotic/HIP_BRK.QC similarity index 100% rename from QC_hipnotic/HIP_BRK.QC rename to QC_other/QC_hipnotic/HIP_BRK.QC diff --git a/QC_hipnotic/HIP_EXPL.QC b/QC_other/QC_hipnotic/HIP_EXPL.QC similarity index 100% rename from QC_hipnotic/HIP_EXPL.QC rename to QC_other/QC_hipnotic/HIP_EXPL.QC diff --git a/QC_hipnotic/HIP_PART.QC b/QC_other/QC_hipnotic/HIP_PART.QC similarity index 100% rename from QC_hipnotic/HIP_PART.QC rename to QC_other/QC_hipnotic/HIP_PART.QC diff --git a/QC_hipnotic/HIP_PUSH.QC b/QC_other/QC_hipnotic/HIP_PUSH.QC similarity index 100% rename from QC_hipnotic/HIP_PUSH.QC rename to QC_other/QC_hipnotic/HIP_PUSH.QC diff --git a/QC_hipnotic/HKNIGHT.QC b/QC_other/QC_hipnotic/HKNIGHT.QC similarity index 100% rename from QC_hipnotic/HKNIGHT.QC rename to QC_other/QC_hipnotic/HKNIGHT.QC diff --git a/QC_hipnotic/ITEMS.QC b/QC_other/QC_hipnotic/ITEMS.QC similarity index 100% rename from QC_hipnotic/ITEMS.QC rename to QC_other/QC_hipnotic/ITEMS.QC diff --git a/QC_hipnotic/JCTEST.QC b/QC_other/QC_hipnotic/JCTEST.QC similarity index 100% rename from QC_hipnotic/JCTEST.QC rename to QC_other/QC_hipnotic/JCTEST.QC diff --git a/QC_hipnotic/KNIGHT.QC b/QC_other/QC_hipnotic/KNIGHT.QC similarity index 100% rename from QC_hipnotic/KNIGHT.QC rename to QC_other/QC_hipnotic/KNIGHT.QC diff --git a/QC_hipnotic/MISC.QC b/QC_other/QC_hipnotic/MISC.QC similarity index 100% rename from QC_hipnotic/MISC.QC rename to QC_other/QC_hipnotic/MISC.QC diff --git a/QC_hipnotic/MODELS.QC b/QC_other/QC_hipnotic/MODELS.QC similarity index 100% rename from QC_hipnotic/MODELS.QC rename to QC_other/QC_hipnotic/MODELS.QC diff --git a/QC_hipnotic/MONSTERS.QC b/QC_other/QC_hipnotic/MONSTERS.QC similarity index 100% rename from QC_hipnotic/MONSTERS.QC rename to QC_other/QC_hipnotic/MONSTERS.QC diff --git a/QC_hipnotic/OGRE.QC b/QC_other/QC_hipnotic/OGRE.QC similarity index 100% rename from QC_hipnotic/OGRE.QC rename to QC_other/QC_hipnotic/OGRE.QC diff --git a/QC_hipnotic/OLDONE.QC b/QC_other/QC_hipnotic/OLDONE.QC similarity index 100% rename from QC_hipnotic/OLDONE.QC rename to QC_other/QC_hipnotic/OLDONE.QC diff --git a/QC_hipnotic/PLATS.QC b/QC_other/QC_hipnotic/PLATS.QC similarity index 100% rename from QC_hipnotic/PLATS.QC rename to QC_other/QC_hipnotic/PLATS.QC diff --git a/QC_hipnotic/PLAYER.QC b/QC_other/QC_hipnotic/PLAYER.QC similarity index 100% rename from QC_hipnotic/PLAYER.QC rename to QC_other/QC_hipnotic/PLAYER.QC diff --git a/QC_hipnotic/PROGS.SRC b/QC_other/QC_hipnotic/PROGS.SRC similarity index 100% rename from QC_hipnotic/PROGS.SRC rename to QC_other/QC_hipnotic/PROGS.SRC diff --git a/QC_hipnotic/SHALRATH.QC b/QC_other/QC_hipnotic/SHALRATH.QC similarity index 100% rename from QC_hipnotic/SHALRATH.QC rename to QC_other/QC_hipnotic/SHALRATH.QC diff --git a/QC_hipnotic/SHAMBLER.QC b/QC_other/QC_hipnotic/SHAMBLER.QC similarity index 100% rename from QC_hipnotic/SHAMBLER.QC rename to QC_other/QC_hipnotic/SHAMBLER.QC diff --git a/QC_hipnotic/SOLDIER.QC b/QC_other/QC_hipnotic/SOLDIER.QC similarity index 100% rename from QC_hipnotic/SOLDIER.QC rename to QC_other/QC_hipnotic/SOLDIER.QC diff --git a/QC_hipnotic/SPRITES.QC b/QC_other/QC_hipnotic/SPRITES.QC similarity index 100% rename from QC_hipnotic/SPRITES.QC rename to QC_other/QC_hipnotic/SPRITES.QC diff --git a/QC_hipnotic/SUBS.QC b/QC_other/QC_hipnotic/SUBS.QC similarity index 100% rename from QC_hipnotic/SUBS.QC rename to QC_other/QC_hipnotic/SUBS.QC diff --git a/QC_hipnotic/TARBABY.QC b/QC_other/QC_hipnotic/TARBABY.QC similarity index 100% rename from QC_hipnotic/TARBABY.QC rename to QC_other/QC_hipnotic/TARBABY.QC diff --git a/QC_hipnotic/TRIGGERS.QC b/QC_other/QC_hipnotic/TRIGGERS.QC similarity index 100% rename from QC_hipnotic/TRIGGERS.QC rename to QC_other/QC_hipnotic/TRIGGERS.QC diff --git a/QC_hipnotic/WEAPONS.QC b/QC_other/QC_hipnotic/WEAPONS.QC similarity index 100% rename from QC_hipnotic/WEAPONS.QC rename to QC_other/QC_hipnotic/WEAPONS.QC diff --git a/QC_hipnotic/WIZARD.QC b/QC_other/QC_hipnotic/WIZARD.QC similarity index 100% rename from QC_hipnotic/WIZARD.QC rename to QC_other/QC_hipnotic/WIZARD.QC diff --git a/QC_hipnotic/WORLD.QC b/QC_other/QC_hipnotic/WORLD.QC similarity index 100% rename from QC_hipnotic/WORLD.QC rename to QC_other/QC_hipnotic/WORLD.QC diff --git a/QC_hipnotic/ZOMBIE.QC b/QC_other/QC_hipnotic/ZOMBIE.QC similarity index 100% rename from QC_hipnotic/ZOMBIE.QC rename to QC_other/QC_hipnotic/ZOMBIE.QC diff --git a/QC_other/QC_keep/ai_ammoresist.qc b/QC_other/QC_keep/ai_ammoresist.qc new file mode 100644 index 00000000..01ac731f --- /dev/null +++ b/QC_other/QC_keep/ai_ammoresist.qc @@ -0,0 +1,163 @@ +/*====================================================================== + MONSTER AMMO RESISTANCE SYSTEM + +======================================================================*/ + +float(entity targ, float resist_type, float damage) Resist_Damage = +{ + local float ret_damage; + + if (resist_type == IT_SHELLS) ret_damage = damage * (1 - targ.resist_shells); + else if (resist_type == IT_NAILS) ret_damage = damage * (1 - targ.resist_nails); + else if (resist_type == IT_ROCKETS) ret_damage = damage * (1 - targ.resist_rockets); + else if (resist_type == IT_CELLS) ret_damage = damage * (1 - targ.resist_cells); + + return ret_damage; +}; + +//---------------------------------------------------------------------- +// Double check that all ammo resistance are within range +//---------------------------------------------------------------------- +void(entity targ) Resist_CheckRange = +{ + // Check Ammo resistance is within range + if (targ.resist_shells < 0) targ.resist_shells = 0; + else if (targ.resist_shells > 1) targ.resist_shells = 1; + if (targ.resist_nails < 0) targ.resist_nails = 0; + else if (targ.resist_nails > 1) targ.resist_nails = 1; + if (targ.resist_rockets < 0) targ.resist_rockets = 0; + else if (targ.resist_rockets > 1) targ.resist_rockets = 1; + if (targ.resist_cells < 0) targ.resist_cells = 0; + else if (targ.resist_cells > 1) targ.resist_cells = 1; +}; + +//---------------------------------------------------------------------- +// Save current ammo resistance to ammo variables +// ** Ammo variables are used for backpack, use with caution +//---------------------------------------------------------------------- +void(entity targ) Resist_Save = +{ + // Store the ammo resistance for switching later + targ.ammo_shells = targ.resist_shells; + targ.ammo_nails = targ.resist_nails; + targ.ammo_rockets = targ.resist_rockets; + targ.ammo_cells = targ.resist_cells; +}; + +//---------------------------------------------------------------------- +// Switch resistance from FULL to monster default +// This works with Resist_Save system, use with caution +// Designed for bosses which don't drop things on death +//---------------------------------------------------------------------- +void(entity targ, float artype) Resist_ChangeType = +{ + if (artype == TRUE) { + // Complete resistance to everything + targ.resist_shells = targ.resist_nails = 1; + targ.resist_rockets = targ.resist_cells = 1; + targ.pain_finished = LARGE_TIMER; + } + else { + // Default ammo resist, rocket/cell immunnity + targ.resist_shells = targ.ammo_shells; + targ.resist_nails = targ.ammo_nails; + targ.resist_rockets = targ.ammo_rockets; + targ.resist_cells = targ.ammo_cells; + targ.pain_finished = time + 1; + } + dprint("\b[AMMO RESIST]\b"); + dprint(" S="); dprint(ftos(targ.resist_shells)); + dprint(" N="); dprint(ftos(targ.resist_nails)); + dprint(" R="); dprint(ftos(targ.resist_rockets)); + dprint(" C="); dprint(ftos(targ.resist_cells)); + dprint("\n"); +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org, vector vel, float damage) Resist_Shells = +{ + if (targ.health > 0 && targ.pain_finished < time) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + // Drastically reduce blood particles + if (targ.resist_shells < 1) SpawnBlood (targ, org, vel*0.2, damage/4); + if (random() < 0.3) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + if (random() < 0.5) WriteByte (MSG_BROADCAST, TE_SPIKE); + else WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + SpawnProjectileSmoke(org, 200, 50, 150); + } +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Nails = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_nails < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + if (random() < 0.5) WriteByte (MSG_BROADCAST, TE_SPIKE); + else WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + if (random() < 0.5) SpawnProjectileSmoke(org, 200, 50, 150); +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Rockets = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_rockets < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + SpawnExplosion(EXPLODE_BURST_SMOKE,org,SOUND_RESIST_ROCKET); + SpawnProjectileSmoke(org, 200, 50, 150); + SpawnProjectileSmoke(org, 200, 50, 250); + SpawnProjectileSmoke(org, 300, 50, 150); + // Can the target bleed? + if (targ.resist_rockets < 1) { + SpawnProjectileMeat(targ, org, 200, 50, 150); + SpawnProjectileMeat(targ, org, 300, 50, 150); + } +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Lightning = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_cells < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + // Don't spawn smoke constantly (let the sprite finish) + if (self.lightning_timer < time) { + self.lightning_timer = time + 0.3; + SpawnExplosion(EXPLODE_BURST_SMOKE, org, ""); + } + // Spawn a random smoke particle and chance of blood + SpawnProjectileSmoke(org, 200, 50, 150); + if (targ.resist_cells < 1 && random() < 0.4) + SpawnProjectileMeat(targ, org, 200, 50, 150); +}; + +//---------------------------------------------------------------------- +void(entity targ, vector org) Resist_Plasma = +{ + if (targ.health > 0 && targ.pain_finished < time && targ.resist_cells < 1) { + targ.pain_finished = time + 0.3 + random(); + sound (targ, CHAN_VOICE, targ.pain_sound, 1, ATTN_NORM); + } + SpawnExplosion(EXPLODE_BURST_SMOKE, org, SOUND_PLASMA_HIT); + SpawnProjectileSmoke(org, 200, 50, 150); + SpawnProjectileSmoke(org, 200, 50, 250); + SpawnProjectileSmoke(org, 300, 50, 150); + // Can the target bleed? + if (targ.resist_cells < 1 && random() < 0.3) + SpawnProjectileMeat(targ,org, 200, 50, 150); +}; + diff --git a/QC_other/QC_keep/ai_blood.qc b/QC_other/QC_keep/ai_blood.qc new file mode 100644 index 00000000..e44e6734 --- /dev/null +++ b/QC_other/QC_keep/ai_blood.qc @@ -0,0 +1,106 @@ +//========================================================================== +// +// BLOOD +// +//========================================================================== + +//========================================================================== +// MEAT SPRAY +//========================================================================== + +// Precaches and enables the use of a requested blood model. +// Note: BLOOD_RED is standard and automatically precached by worldspawn. +void(float btype) precache_blood = +{ + if (btype == BLOOD_GREEN) + { + precache_model ("progs/drake/blood_gr.mdl"); + precache_model ("progs/drake/gr_gib.mdl"); + bloodbank = bloodbank | BB_GREEN; + } + else if (btype == BLOOD_PURPLE) + { +// precache_model ("progs/blood_pu.mdl"); + precache_model ("progs/drake/pur_gib.mdl"); + bloodbank = bloodbank | BB_PURPLE; + } + else if (btype == BLOOD_FIRE) + { +// precache_model ("progs/smoke.mdl"); + precache_model ("progs/drake/ember.mdl"); + bloodbank = bloodbank | BB_FIRE; + } +}; + +// Spawns a particle trail for an invisible blood model. +// Useful for any monster with blood of unusual color (like black or blue). +// It could be motor oil, antifreeze, milk, or fruit juice for all we know. +void() MeatSprayThink = +{ + if (self.delay <= time) + {remove(self); return;} + + local vector dir; + + dir = normalize (self.velocity); + particle (self.origin, dir, self.bloodtype, 10); + + self.nextthink = time + 0.100; +}; + +//========================================================================== +// BLOOD SPRAYS +//========================================================================== +// Creates blood spawning entities. This is a variation of SpawnMeatSpray. +// Used by decapitation code. +void(vector org, vector vel) SpawnBloodSpray = { + local entity gib; + local string text; + + if (self.bloodtype == BLOOD_RED) + text = "progs/drake/blood.mdl"; + else if ((self.bloodtype == BLOOD_GREEN) && (bloodbank & BB_GREEN)) + text = "progs/drake/blood_gr.mdl"; + else if (self.bloodtype == BLOOD_PURPLE) + {if (bloodbank & BB_PURPLE) text = "progs/drake/pur_gib.mdl";} + else + return; + + gib = spawn (); + gib.owner = self; + gib.movetype = MOVETYPE_TOSS; + gib.solid = SOLID_NOT; + + gib.velocity = vel; + gib.velocity_z = gib.velocity_z + 250 + 50*random(); + +// set missile duration + gib.nextthink = time + 1; + gib.think = SUB_Remove; + setmodel (gib, text); + + setsize (gib, '0 0 0', '0 0 0'); + setorigin (gib, org); +}; + +// Sprays blood from a given point. Used by decapitation code. +void(vector org, float loop) blood_spray = { + local vector vel; + + makevectors (self.angles); + org = self.origin + (v_forward * org_x) + (v_right * org_y) + (v_up * org_z); + if (loop == -1) + { // Cheesy check to make one final blood spurt ahead. + vel = (v_forward * (random() * 100 + 100)); //+ (v_up * 50); + SpawnBloodSpray (org, vel); + return; + } + while (loop > 0) + { + vel_x = crandom(); vel_y = crandom(); vel_z = 0; + vel = normalize(vel) * 200; + SpawnBloodSpray (org, vel); + + loop = loop - 1; + } +}; diff --git a/QC_other/QC_keep/ai_checkattack.qc b/QC_other/QC_keep/ai_checkattack.qc new file mode 100644 index 00000000..2cadb848 --- /dev/null +++ b/QC_other/QC_keep/ai_checkattack.qc @@ -0,0 +1,2110 @@ +/*====================================================================== + SPECIFIC AI LOGIC ROUTINES + + * Specific routines for certain monster types to determine if + they can melee or missile (range) attack + * Always working 1 frame behind the ai_run function + * Moved demon/wizard checkattack routines here (split locations) + + CheckAttack (generic) +======================================================================*/ +void() CheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT) && self.th_melee) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0 && self.th_missile) { + if (time < self.attack_finished) return; + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + return; + } + + //---------------------------------------------------------------------- + // Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (!self.th_missile) return; + if (time < self.attack_finished) return; + if (enemy_range == RANGE_FAR) return; + + // range < 120 map units + if (enemy_range == RANGE_MELEE) { + self.attack_chance = 0.9; + self.attack_finished = 0; + } + // range < 500 map units + else if (enemy_range == RANGE_NEAR) { + if (self.th_melee) self.attack_chance = 0.2; + else self.attack_chance = 0.4; + } + // range < 1000 map units + else if (enemy_range == RANGE_MID) { + if (self.th_melee) self.attack_chance = 0.05; + else self.attack_chance = 0.1; + } + else self.attack_chance = 0; + + if (random () < self.attack_chance) { + SUB_AttackFinished (2*random()); + self.th_missile (); + } +}; + +/*====================================================================== + SoldierCheckAttack (Rocket version has melee) +======================================================================*/ +void() SoldierCheckAttack = +{ + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // If enemy is within melee range, just keep on attacking! + // Original ID behaviour is 10% chance to not attack in melee range + // This has changed so that the soldier is more agressive up close + // The army rocket has a special behaviour for melee range + //---------------------------------------------------------------------- + if (self.classtype != CT_MONARMYROCKET && enemy_range == RANGE_MELEE) { + self.attack_state = AS_MISSILE; + return; + } + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + + if (self.classtype == CT_MONARMYROCKET) { + if (ai_checkmelee(MONAI_RANGEARMYR)) { + self.oldorigin = self.origin; + // If move backward works, run back animation + if (walkmove(self.angles_y+180, 16)) { + setorigin(self, self.oldorigin); + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + else setorigin(self, self.oldorigin); + } + } + + //---------------------------------------------------------------------- + // Range attack (bullets) + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + if (enemy_range == RANGE_FAR) return; + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.4; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.05; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + self.attack_state = AS_MISSILE; + if (self.classtype == CT_MONARMYROCKET) SUB_AttackFinished (2 + random()); + else SUB_AttackFinished (1 + random()); + if (random() < 0.3) self.lefty = !self.lefty; + } +}; + +/*====================================================================== + PyrpCheckAttack (Melee=FIRE!) +======================================================================*/ +void() PyroCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + if (ai_checkmelee(MONAI_RANGEPYRO)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } +}; + +/*====================================================================== + ShamCheckAttack +======================================================================*/ +void() ShamCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(claws/overhead smash) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESHAM)) { + self.attack_state = AS_MELEE; + // Don't wait for next frame, melee attack straight away + // (different id behaviour) + self.th_melee (); + return; + } + + //---------------------------------------------------------------------- + // Range attack (lightning) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + if (self.enemydist > MONAI_SHAMRANGE) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + (2*random())); +}; + +/*====================================================================== + BogLordCheckAttack (Shambler model) +======================================================================*/ +void() BogLordCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(overhead slime balls) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_BOGLORDMELEE)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + + //---------------------------------------------------------------------- + // Range attack (Fast volley of bolts) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Setup attack chance of using melee attack more often + // easy=0.5, norm=0.6, hard=0.7, nm=0.8 + self.attack_chance = 0.5 + (skill * 0.1); + + // Check for inside range for melee attack? + if (self.enemydist < MONAI_BOGLORDRANGE && random() > self.attack_chance) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + else { + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + } +}; + +/*====================================================================== + SeekerCheckAttack +======================================================================*/ +void() SeekerCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee punch + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELRAGESEEKER)) { + // Need both arms for melee animation + if (self.state == 0) { + self.attack_state = AS_MELEE; + self.th_melee (); + } + // Instantly go to rocket range attack + // If the player is too close + else { + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + random()); + } + return; + } + + //---------------------------------------------------------------------- + // Range attack (rockets or lasers) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + SantaCheckAttack +======================================================================*/ +void() SantaCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Antlers) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESANTA)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Let sightsound play out before machine gun attack + //---------------------------------------------------------------------- + if (self.attack_rage) { + self.attack_finished = time + 3; + self.attack_rage = FALSE; + } + //---------------------------------------------------------------------- + // Range attack (snowball machine gun) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Check if gun is being blocked (extra wide check) + if ( visblocked_wide(self.enemy, self.attack_offset, '0 0 0') ) return; + + // Straight to snow machine gun! + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + RaindeerCheckAttack +======================================================================*/ +void() RaindeerCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Antlers) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEERAINDEER)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (rockets) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + +/*====================================================================== + SnowmanCheckAttack +======================================================================*/ +void() SnowmanCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Antlers) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESNOWMAN)) { + self.attack_state = AS_MELEE; + // As soon as out of melee, range attack! + self.attack_finished = 0; + return; + } + //---------------------------------------------------------------------- + // Range attack (rockets) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); +}; + + +/*====================================================================== + GolemCheckAttack +======================================================================*/ +void() GolemCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack(Punch/Pound) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (self.enemydist < MONAI_MELEEGOLEM) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Floor stomp attack + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_GOLEMRANGE && random() < 0.3) { + SUB_AttackFinished (1 + 2*random()); + self.th_slide (); + return; + } + //---------------------------------------------------------------------- + // Range attack (Rock Attack) + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + if (!self.th_missile) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 24')) { + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); + } +}; + +/*====================================================================== + ShalCheckAttack +======================================================================*/ +void() ShalCheckAttack = +{ + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // Slower spawnrate for minion eggs than voreballs + if (!(self.spawnflags & MON_SHALRATH_MINIONS)) { + if (visblocked(self.enemy)) return; + SUB_AttackFinished (2*random()); + } + else SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + // Minion spawning shalraths should maintain distance + // Use the new turn and side walk function to stay mid range + if (self.spawnflags & MON_SHALRATH_MINIONS && self.enemy.flags & FL_CLIENT) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // If too far away from enemy, move in a straight line + if (self.enemydist > MONAI_RANGESHAL) { + self.attack_state = AS_STRAIGHT; + } + else { + // If range attack still blocked, move sideway/backwards + if (time < self.attack_finished) { + // If too close, move backwards and sideways so that + // there is plenty of room to spawn more minions + if (self.enemydist < MONAI_RANGESHAL2) + self.attack_state = AS_BACKWARD; + else self.attack_state = AS_SIDESTEP; + // straight away move + return; + } + } + } + + // Does the monster have a clear shot to the enemy? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (enemy_range == RANGE_FAR) return; + if (time < self.attack_finished) return; + + // random chance based on distance to enemy + if (enemy_range == RANGE_MELEE) { + self.attack_chance = 0.9; // < 120 + self.attack_finished = 0; // If enemy really close, constantly fire! + } + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.4; // < 500 + else if (enemy_range == RANGE_MID) self.attack_chance = 0.1; // < 1000 + else self.attack_chance = 0; + + // Random chance of range attack? + if (random () < self.attack_chance) { + // Slower spawnrate for minion eggs than voreballs + if (self.spawnflags & MON_SHALRATH_MINIONS) SUB_AttackFinished (1 + 2*random()); + else SUB_AttackFinished (2*random()); + self.attack_state = AS_MISSILE; + } +}; + +/*====================================================================== + EliminatorCheckAttack (Range=Plasma) +======================================================================*/ +void() EliminatorCheckAttack = +{ + //---------------------------------------------------------------------- + // Range attack (Plasma) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + if (enemy_range == RANGE_FAR) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Aggressive range attack, no % chances + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); +}; + +/*====================================================================== + DefenderCheckAttack (Melee=SSG / Range=GL) +======================================================================*/ +void() DefenderCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Super Shotgun to face) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_RANGEDEFSSG)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // Range attack (Grenades) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + if (enemy_range == RANGE_FAR) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // Aggressive range attack, no % chances + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); +}; + +/*====================================================================== + OgreCheckAttack + Vanilla, Hunter, Fishing and Mace versions +======================================================================*/ +void() OgreCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (chainsaw) + //---------------------------------------------------------------------- + if (self.enemydist < self.meleerange) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (grenades) + // strangely enough the chance attack percentages are not used + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + // Fishing ogre fires much faster than standard + if (self.classtype == CT_MONOGREFISH) + SUB_AttackFinished (1 + random()); + else SUB_AttackFinished (1 + 2*random()); +}; + +/*====================================================================== + OgreHamCheckAttack (Hammer only, much faster) +======================================================================*/ +void() OgreHamCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (Special hammer attack) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_HOGRE_METAL) { + if (self.enemydist < MONAI_MELEEOGREHAM) { + self.attack_state = AS_MELEE; + return; + } + } + else { + // Default melee attack, just a simple hammer + if (self.enemydist < self.meleerange) { + self.attack_state = AS_MELEE; + return; + } + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (grenades) + // strangely enough the chance attack percentages are not used + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + random()); +}; + +/*====================================================================== + FreddieCheckAttack +======================================================================*/ +void() FreddieCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (chainsaw) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFREDDIE)) { + // Hard/Nightmare skill have chance to ignore melee attacks + if (skill < SKILL_HARD || (skill > SKILL_NORMAL && random() < 0.7)) { + self.attack_state = AS_MELEE; + return; + } + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range attack (spikes/laser) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + // If Freddie too far away for stationary attack? + if (self.enemydist > MONAI_RANGEFREDDIE && skill > SKILL_EASY) { + // Work out vector angle of enemy infront + makevectors (self.angles); + self.pos1 = normalize (self.enemy.origin - self.origin); + self.lip = self.pos1 * v_forward; + // Is the enemy infront of freddie? + if (self.lip > 0.8) { + self.cnt = 0; + self.attack_timer = TRUE; + SUB_AttackFinished (1 + random()); + } + else { + // Small random chance of stop+fire + if (random() < 0.2) { + self.attack_timer = FALSE; + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + } + } + } + else { + // Close to enemy, stop+fire + self.attack_timer = FALSE; + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + } +}; + +/*====================================================================== + WizardCheckAttack (No melee attack) +======================================================================*/ +void() WizardCheckAttack = +{ + //---------------------------------------------------------------------- + // Range attack (spit) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (visblocked(self.enemy)) return; + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + // The original id behaviour is wizards run until within range + //---------------------------------------------------------------------- + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + self.attack_state = AS_MISSILE; + } + //---------------------------------------------------------------------- + // If turret, then do not move sideways + // otherwise keep moving forward to enemy target + //---------------------------------------------------------------------- + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } +}; + +/*====================================================================== + SkullWizardCheckAttack (No melee attack) +======================================================================*/ +void() SkullWizCheckAttack = +{ + //---------------------------------------------------------------------- + // Teleport away if player too close + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEESKULLW && !self.bodystatic) { + self.attack_state = AS_MELEE; + return; + } + // make sure enemy is stationary (turret) + else self.attack_state = AS_TURRET; + + //---------------------------------------------------------------------- + // Range / missile attack (skull attack) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); +}; + +/*====================================================================== + LostCheckAttack +======================================================================*/ +void() LostCheckAttack = +{ + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + + //---------------------------------------------------------------------- + // Melee attack (bite) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEELOSTSOUL)) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // If too close, move sideways until can ram again + // If too far, move closer + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_RANGELOSTNEAR) { + self.attack_state = AS_SLIDING; + return; + } + else if (self.enemydist > MONAI_RANGELOSTFAR) { + self.attack_state = AS_STRAIGHT; + return; + } + + //---------------------------------------------------------------------- + // Cannot see enemy? go into guard mode + //---------------------------------------------------------------------- + if (!enemy_vis && self.lostsearch == FALSE) { + SUB_switchEnemyTarget(); + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.lostsearch = TRUE; + self.lostenemy = self.enemy; + self.losttimer = time + MONAI_LOSTTIMER + random()*5; + self.enemy = self.goalentity = self.movetarget = world; + self.th_altstand(); + return; + } + + //---------------------------------------------------------------------- + // Range attack (Ramming Speed) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.view_ofs, '0 0 24')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + // No space for raming speed, strafe side to side + else self.attack_state = AS_SLIDING; + } + // Wait for attack timer, better to face the player + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + JimCheckAttack (No melee attack) + This is essentially the monster_centarion check +======================================================================*/ +void() JimCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Lasers) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + //---------------------------------------------------------------------- + // Make sure jim maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + CenturionCheckAttack (No melee attack) +======================================================================*/ +void() CenturionCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Plasma) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + //---------------------------------------------------------------------- + // Make sure the centurion maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + GargoyleCheckAttack (No melee attack) +======================================================================*/ +void() GargoyleCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Fireball) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + + //---------------------------------------------------------------------- + // Make sure the gargoyle maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + GauntCheckAttack (No melee attack) +======================================================================*/ +void() GauntCheckAttack = +{ + // Cannot see enemy? stop chasing enemytarget + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (Plasma volley) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + } + + //---------------------------------------------------------------------- + // Make sure the Gaunt maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + EelCheckAttack (No melee attack) +======================================================================*/ +void() EelCheckAttack = +{ + //---------------------------------------------------------------------- + // Range attack (Plasma bolt) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + + //---------------------------------------------------------------------- + // Make sure the Eel maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID || !enemy_vis) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + WraithCheckAttack (No melee attack) +======================================================================*/ +void() WraithCheckAttack = +{ + //---------------------------------------------------------------------- + // Cannot see enemy? stop chasing enemytarget + //---------------------------------------------------------------------- + if (!enemy_vis) { + SUB_switchEnemyTarget(); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + } + return; + } + //---------------------------------------------------------------------- + // setup enemytarget if one os not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET && self.height > 0) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + //---------------------------------------------------------------------- + // Range attack (burning and creature summons) + // Much more aggressive decision on range attacks (ogre style) + // No random chance percentages, logic with wraith magic function + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset, '0 0 0')) { + if (enemy_range != RANGE_MELEE) SUB_AttackFinished(2 + random()); + self.attack_state = AS_MISSILE; + return; + } + } + + //---------------------------------------------------------------------- + // If turret, then do not move sideways + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + return; + } + //---------------------------------------------------------------------- + // Make sure the wraith maintains its distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +/*====================================================================== + MinotaurCheckAttack +======================================================================*/ +void() MinotaurCheckAttack = +{ + //---------------------------------------------------------------------- + // If health is low enough, switch to rage mode + // This does not affect the minion spawning version + if ( !(self.spawnflags & MON_MINOTAUR_MINIONS) && self.movespeed >= 0) { + if (self.health < self.max_health*0.5 && !self.attack_rage) { + self.attack_rage = TRUE; + self.th_charge(); // Short howl at the sky + return; + } + } + //---------------------------------------------------------------------- + // Melee attack (claws) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEMINOTAUR)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + // Keep firing rockets when at range + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // RAGE mode (keep running at player) + //---------------------------------------------------------------------- + if (self.attack_rage) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + // Check range and sight for a low chance range attack + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // If enemy not infront or random chance, stop and range attack + if (!infront(self.enemy) || random() < 0.1) { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Plasma bolt attack + SUB_AttackFinished (2 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + //---------------------------------------------------------------------- + // PASSIVE mode (keep at distance) + //---------------------------------------------------------------------- + else { + // Is the player NOT visible? Keep getting closer + if (!enemy_vis) { + if (self.attack_state != AS_STRAIGHT) + self.attack_state = AS_STRAIGHT; + } + else { + //---------------------------------------------------------------------- + // Mid Range attack (JUMP) Not spawning dark version + //---------------------------------------------------------------------- + if ( !(self.spawnflags & MON_MINOTAUR_MINIONS) && random() < 0.35) { + // Jumped recently, facing right direction and not blocked? + if ( self.jump_flag < time && infront(self.enemy)) { + if (!visblocked_wide(self.enemy, self.view_ofs, self.enemy.view_ofs) ) { + // Check for enemy above? (z axis) + if (self.enemy.origin_z <= self.origin_z) { + // Is the minotaur within the right range? + if (self.enemydist > MONAI_JUMPMINONEAR && + self.enemydist < MONAI_JUMPMINOFAR) { + // Block any range attacks for a while + SUB_AttackFinished (random()); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.th_jump (); + return; + } + } + } + } + } + //---------------------------------------------------------------------- + // Range / missile attack (plasma bolts) + //---------------------------------------------------------------------- + // Any chance of a range attack? + if (time < self.attack_finished) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // Don't always stay at absolute range, move closer + if (random() < 0.15 && self.enemydist > MONAI_RANGEMINOTAUR) { + self.attack_sidedeny = time + 1 + random(); + self.attack_state = AS_STRAIGHT; + } + else { + // If not blocked, turn and move sideways + if (self.attack_sidedeny < time) + self.attack_state = AS_SIDESTEP; + } + } + else { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Keep firing plasma when at range + SUB_AttackFinished (2 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + } +}; + +/*====================================================================== + DroleCheckAttack +======================================================================*/ +void() DroleCheckAttack = +{ + //---------------------------------------------------------------------- + // Quoth setup - 500HP, with rage at 350HP + // Converted it to a % so mappers can change health + //---------------------------------------------------------------------- + if (self.movespeed >= 0) { + if (self.health < self.max_health*0.7 && !self.attack_rage) { + self.attack_rage = TRUE; + } + } + //---------------------------------------------------------------------- + // Melee attack (claws) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEDROLE2)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + if (visblocked(self.enemy)) return; + // Keep firing rockets when at range + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // RAGE mode (keep running at player) + //---------------------------------------------------------------------- + if (self.attack_rage) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + // Check range and sight for a low chance range attack + if (!enemy_vis) return; + if (time < self.attack_finished) return; + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist > MONAI_RANGEDROLE && random() < 0.3) { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Standard rocket attack + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + //---------------------------------------------------------------------- + // PASSIVE mode (keep at distance) + //---------------------------------------------------------------------- + else { + // Is the player visible? Keep getting closer + if (!enemy_vis) { + if (self.attack_state != AS_STRAIGHT) + self.attack_state = AS_STRAIGHT; + } + // Player in sight, fireball or loiter? + else { + // Any chance of a range attack? + if (time < self.attack_finished) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // Don't always stay at absolute range, move closer + if (random() < 0.15 && self.enemydist > MONAI_RANGEDROLE) { + self.attack_sidedeny = time + 1 + random(); + self.attack_state = AS_STRAIGHT; + } + else { + // If not blocked, turn and move sideways + if (self.attack_sidedeny < time) + self.attack_state = AS_SIDESTEP; + } + } + else { + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + // Keep firing rockets when at range + SUB_AttackFinished (1 + 2*random()); + self.attack_state = AS_MISSILE; + } + } + } +}; + +/*====================================================================== + DSergeantCheckAttack +======================================================================*/ +void() DSergeantCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 10', FALSE)) return; + self.attack_state = AS_MISSILE; + return; + } + + // If range blocked do charging instead + if (time < self.attack_finished) { + //---------------------------------------------------------------------- + // Charge attack + // Player within certain range, height and charging not blocked? + //---------------------------------------------------------------------- + self.height = fabs(self.origin_z - self.enemy.origin_z); + if (ai_checkmelee(MONAI_CHARGEFLAIL) && self.height < MONAI_CHARGEZAXIS + && self.attack_timer < time) { + // If attack timer not active, bump up with a random amount + if (self.attack_finished < time) SUB_AttackFinished (random()); + self.th_charge (); + return; + } + } + else { + //---------------------------------------------------------------------- + // Range attack - Homing missile + //---------------------------------------------------------------------- + // If the sightline between self and player blocked + // Allow for monsters to be hit (infighting rules!) + if (!visxray(self.enemy, self.attack_offset, '0 0 10', FALSE)) return; + self.attack_state = AS_MISSILE; + } +}; + +/*====================================================================== + DFuryCheckAttack +======================================================================*/ +void() DFuryCheckAttack = +{ + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // Melee attack + // enemy_range is checked before this function (ai_run - ai.qc) + // If the monster is within melee range they instantly attack + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // is the enemy close enough for a double sword slice attack? + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_JUMPFURYNEAR) { + self.attack_state = AS_MELEE; + self.th_slide (); + return; + } + //---------------------------------------------------------------------- + // Mid Range attack (JUMP) + //---------------------------------------------------------------------- + // Jumped recently, facing right direction and not blocked? + if ( self.jump_flag < time && infront(self.enemy) && !visblocked(self.enemy) ) { + // Check for enemy above? (z axis) + if (self.enemy.origin_z <= self.origin_z) { + // Is the fury knight within the right range? + if (self.enemydist > MONAI_JUMPFURYNEAR && + self.enemydist < MONAI_JUMPFURYFAR) { + // Block any range attacks for a while + SUB_AttackFinished (random()); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + if (random() < 0.65) self.th_jump (); + else self.th_charge (); + return; + } + } + } + //---------------------------------------------------------------------- + // Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + // If the sightline between self and player blocked by anything, keep moving + if (!visxray(self.enemy, self.attack_offset, '0 0 0', FALSE)) return; + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.4; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.05; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) self.attack_state = AS_MISSILE; +}; + +/*====================================================================== + DCrossCheckAttack +======================================================================*/ +void() DCrossCheckAttack = +{ + if (!enemy_vis) return; + //---------------------------------------------------------------------- + // Melee attack (blunt end of crossbow) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, check range attack only + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + // If sight blocked by another monster, do nothing + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) return; + self.attack_state = AS_MISSILE; + return; + } + //---------------------------------------------------------------------- + // Range / missile attack (slow bolts) + // The range logic is done via two set of animations (hold/slide) + // Once within a certain range, stay there and snipe at the enemy + //---------------------------------------------------------------------- + // range < 500 map units + if (enemy_range == RANGE_NEAR || self.enemymaxdist) { + // If sight blocked by another monster, slide to the side + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + else { + // No monster in the way, hold still and start aiming + self.attack_state = AS_MISSILE; + self.th_missile (); + } + } + else self.attack_state = AS_STRAIGHT; +}; + +/*====================================================================== + ZombiekCheckAttack (Has no range attack) + The player is in view, so decide to jump or melee +======================================================================*/ +void() ZombiekCheckAttack = +{ + if (!enemy_vis) return; + //---------------------------------------------------------------------- + // Melee attack (rusty sword) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range / missile attack (jumping) + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + self.attack_chance = 0.3 + skill*0.1; + if (random() < self.attack_chance) { + // Is the enemy the right distance away and the random chance is correct? + if (self.enemydist > MONAI_JUMPZKNEAR && self.enemydist < MONAI_JUMPZKFAR) { + SUB_AttackFinished (2 + random()*2); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; // JUMP JUMP JUMP! + } + } +}; + +/*====================================================================== + BoilCheckAttack (Has no range attack) + The player is in view, so blow up! +======================================================================*/ +void() BoilCheckAttack = +{ + if (!enemy_vis) return; + // Only has one attack, run at player and explode + // Does one simple range check regardless if turret + if (self.enemydist < MONAI_MELEEBOIL) self.attack_state = AS_MELEE; +}; + +/*====================================================================== + SpawnCheckAttack +======================================================================*/ +void() SpawnCheckAttack = +{ + // Spawns don't start jumping straight away unless they can directly + // see the player. // They slowly crawl around which can make them + // tricky to plan for an ambush. + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (visblocked(self.enemy)) return; + + //---------------------------------------------------------------------- + // JUMP Melee attack + // This pretty much a close quarter jump in the face attack! + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESPAWN)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // JUMP Range attack + // The attack chance percentages are constant across skill levels + //---------------------------------------------------------------------- + if (time < self.attack_finished) return; + + // range < 120 map units + if (enemy_range == RANGE_MELEE) { + self.attack_chance = 0.9; + self.attack_finished = 0; + } + // range < 500 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.2; + // range < 1000 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.05; + else self.attack_chance = 0; + + if (random () < self.attack_chance) { + SUB_AttackFinished (2*random()); + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; // JUMP JUMP JUMP! + } +}; + +/*====================================================================== + DemonCheckAttack +======================================================================*/ +void() DemonCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (CLAWS) + //---------------------------------------------------------------------- + // Check that within range of a claw attack + if (ai_checkmelee(MONAI_MELEEDEMON)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (JUMP) + //---------------------------------------------------------------------- + // Time for another jump? + if (self.jump_flag < time) { + // Stop the demon over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + // Check for closeness, but not long range! + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPDEMONNEAR) return; + + // Check for low ceilings directly above the demon + traceline(self.origin, self.origin + '0 0 256', TRUE, self); + self.height = fabs(vlen(trace_endpos - self.origin)); + // Ceiling is too low (looks dumb hitting ceilings) + if (self.height < MONAI_JUMPDEMONCHECK) return; + + // ** QC code from necros ** + // Move the demon forward 16 units and check if blocked + self.pos1 = self.origin; + self.ideal_yaw = vectoyaw(self.enemy.origin - self.pos1); + // If move forward fails, move back and indicate no jump + if (!walkmove(self.ideal_yaw, 16)) { + setorigin(self, self.pos1); + return; + } + + setorigin(self, self.pos1); // walkmove successful, move demon back + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; // JUMP JUMP JUMP! + } +}; + +/*====================================================================== + ScorpionCheckAttack (high damage pincher) +======================================================================*/ +void() ScorpionCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (CLAWS) + //---------------------------------------------------------------------- + if (ai_checkmelee(MONAI_MELEESCORPION)) { + self.attack_state = AS_MELEE; + self.th_melee (); + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, do range attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (time < self.attack_finished) return; + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + return; + } + + //---------------------------------------------------------------------- + // Range attack (JUMP/TAIL) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + if (self.spawnflags & MON_SCORPION_STINGER) { + // check for extra wide space to jump + if (!visblocked_wide(self, self.attack_offset, self.enemy.view_ofs)) return; + + // Time for another jump? + if (self.jump_flag < time) { + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPSCORPNEAR) return; + if (self.enemydist > MONAI_JUMPSCORPFAR) return; + + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } + else { + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + } +}; + +/*====================================================================== + DogCheckAttack +======================================================================*/ +void() DogCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEEDOG)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // If setup to be a turret, randomly do melee attacks + //---------------------------------------------------------------------- + if (self.movespeed < 0) { + if (random() < MONAI_TURRETMODE) return; + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (JUMP) + //---------------------------------------------------------------------- + // Has the dog jumped less than 2 seconds ago? + if (self.jump_flag < time) { + // Stop the dog over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPDOGNEAR) return; + if (self.enemydist > MONAI_JUMPDOGFAR) return; + + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } +}; + +/*====================================================================== + SpiderCheckAttack +======================================================================*/ +void() SpiderCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEESPIDER)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Large Green Spider = SPIT) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SPIDER_LARGE) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Small Brown Spider = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the spider over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPSPIDERNEAR) return; + if (self.enemydist > MONAI_JUMPSPIDERFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + ElfCheckAttack +======================================================================*/ +void() ElfCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (CANE) + //---------------------------------------------------------------------- + // Check that within range of a cane attack + if (ai_checkmelee(MONAI_MELEEELF)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Elf 2 (Black pants) = Magic) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_ELF_MAGIC) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Elf 1 (green/red pants) = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the elf over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPELFNEAR) return; + if (self.enemydist > MONAI_JUMPELFFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + VorelingCheckAttack +======================================================================*/ +void() VorelingCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEEVORELING)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Large Purple Voreling = SPIT) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_VORELING_LARGE) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Small White Voreling = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the voreling over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + // Too close/far? + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPVORELINGNEAR) return; + if (self.enemydist > MONAI_JUMPVORELINGFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + SwamplingCheckAttack +======================================================================*/ +void() SwamplingCheckAttack = +{ + //---------------------------------------------------------------------- + // Melee attack (BITE) + //---------------------------------------------------------------------- + // Check that within range of a bite attack + if (ai_checkmelee(MONAI_MELEESWAMPLING)) { + self.attack_state = AS_MELEE; + return; + } + //---------------------------------------------------------------------- + // Range attack (Large Green Swampling = SPIT) + // Behaves like a wizards; strafe, spit goo + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SWAMPLING_LARGE) { + if (!enemy_vis) return; + if (time < self.attack_finished) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (enemy_range == RANGE_FAR || visblocked(self.enemy)) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + return; + } + + if (enemy_range == RANGE_MELEE) self.attack_chance = 0.9; // range < 120 map units + else if (enemy_range == RANGE_NEAR) self.attack_chance = 0.6; // range < 500 map units + else if (enemy_range == RANGE_MID) self.attack_chance = 0.2; // range < 1000 map units + else self.attack_chance = 0; + if (random () < self.attack_chance) { + SUB_AttackFinished (2 + random()); + self.attack_state = AS_MISSILE; + } + else if (enemy_range == RANGE_MID) { + if (self.attack_state != AS_STRAIGHT) { + self.attack_state = AS_STRAIGHT; + self.th_run (); + } + } + else { + if (self.attack_state != AS_SLIDING) { + self.attack_state = AS_SLIDING; + self.th_slide (); + } + } + } + //---------------------------------------------------------------------- + // Range attack (Small Light Green Swampling = JUMP) + // Behaves like a dog; run and jump + //---------------------------------------------------------------------- + else { + // Is it time to jump? + if (self.jump_flag < time) { + // Stop the swampling over or under jumping the enemy + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + + 0.75 * self.enemy.size_z) return; + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + + 0.25 * self.enemy.size_z) return; + + // Too close/far? + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_JUMPSWAMPLINGNEAR) return; + if (self.enemydist > MONAI_JUMPSWAMPLINGFAR) return; + // Check for enemy above? (z axis) + if (self.enemy.origin_z > self.origin_z) return; + self.jumptouch = world; // Reset last object touched + self.count = 0; // Number of times jumped + self.attack_state = AS_JUMP; + } + } +}; + +/*====================================================================== + Check if the AI is blocked by a breakable object in the way +======================================================================*/ +void() CheckBlockedBreakable = +{ + local vector spot1, spot2, brkorg; + local float brklen; + + // Still busy attacking? do nothing + if (time < self.attack_finished) return; + + // FIXME : there needs to be check on the breakable health + // otherwise the monster will be stuck constantly attacking the breakable + + // Check for breakables from middle of models (not head height) + spot1 = self.origin; + spot2 = self.enemy.origin; + traceline (spot1, spot2, TRUE, self); // see through other monsters + + if (trace_ent.classtype != CT_FUNCBREAK) { + // Check for breakables from top of models + spot1 = self.origin + self.view_ofs; + spot2 = self.enemy.origin + self.enemy.view_ofs; + traceline (spot1, spot2, TRUE, self); // see through other monsters + } + + if (ai_foundbreakable(self, trace_ent,FALSE)) { + // Find origin of breakable, check for bmodel 0,0,0 origins + if (trace_ent.bsporigin) brkorg = bmodel_origin(trace_ent); + else brkorg = trace_ent.origin; + brklen = fabs(vlen(self.origin - brkorg)); + SUB_AttackFinished (1+random()); + + // Double check a melee range has been setup + if (self.th_melee && !self.meleerange) + self.meleerange = MONAI_MELEEKNIGHT; + + // Check breakable within melee/missile range? + if (brklen < self.meleerange && self.th_melee) self.attack_state = AS_MELEE; + else if (self.th_missile) self.attack_state = AS_MISSILE; + } +}; + +void () LavaManCheckAttack = { + if (!visblocked_wide(SUB_entEnemyTarget(), self.attack_offset,'0 0 0')) return; + + if (time < self.attack_finished) return; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished ((random())); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_combat.qc b/QC_other/QC_keep/ai_combat.qc new file mode 100644 index 00000000..b96336d1 --- /dev/null +++ b/QC_other/QC_keep/ai_combat.qc @@ -0,0 +1,559 @@ +/*====================================================================== + COMBAT FUNCTIONS + + Returns true if the inflictor can directly damage the target. + Used for explosions and melee attacks. +======================================================================*/ +void(entity targ, entity attacker) ClientObituary; + +//----------------------------------------------------------- +float(entity targ, entity inflictor) CanDamage = { + // Any entity marked with no damage is automatically excluded + if (targ.takedamage == DAMAGE_NO) return FALSE; + + // bmodels need special checking because their origin is 0,0,0 + if (targ.movetype == MOVETYPE_PUSH) { + traceline(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + if (trace_ent == targ) return TRUE; + return FALSE; + } + + // Trace around the target to see if it can hit + traceline(inflictor.origin, targ.origin, TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '15 15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '-15 -15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '-15 15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, inflictor); + if (trace_fraction == 1) return TRUE; + + return FALSE; +}; + +//----------------------------------------------------------- +void(entity targ, entity attacker) Killed = +{ + local entity oself; + + // Switch self for death functions + oself = self; self = targ; + self.activate = attacker; // Always keep track of what did damage + + // doors, triggers, etc + if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE || + self.classtype == CT_FUNCPUSHABLE) { + self.th_die (); + } + else { + if (!self.deadflag && (self.flags & FL_MONSTER || self.flags & FL_CLIENT) ) { + // Object is dying, stop re-triggering + self.deadflag = DEAD_DYING; + self.enemy = attacker; // Enemy dealing final blow + if (self.enemy.classtype == CT_WORLD) self.enemy = self; + + // bump the monster counter + if (self.flags & FL_MONSTER) { + if (!self.nomonstercount) { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + } + } + + ClientObituary(self, attacker); + self.touch = SUB_Null; + + if (self.flags & FL_MONSTER) monster_death_use(); + self.th_die (); + } + // Completely fuckup setup for the oldone boss with a weird target + // field and mess of triggers around it! This elseif is just an + // exception so it works, anyway no one fights the oldone! + else if (!self.deadflag && self.classtype == CT_MONIDSHUB) { + self.deadflag = DEAD_DEAD; + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + self.th_die (); + } + } + // Restore self + self = oself; +}; + +/*====================================================================== + T_Damage + The damage is coming from inflictor, but get mad at attacker + This should be the only function that ever reduces health. + Parameters: + targ = entity receiving damage (monster) + inflictor = entity causing damage (bullets) + attacker = parent entity of inflictor (player firing bullets) + damage = quantity (before modifiers, quad etc) + checkarmor = can bypass armour (DAMARMOR, NOARMOR) +======================================================================*/ +void(entity targ, entity inflictor, entity attacker, float damage, float checkarmor) T_Damage = +{ + local vector dir; + local entity oldself; + local float save, take, flinch, misc; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (targ.classtype == CT_WORLD) return; + if (targ.classtype == CT_ENEMYTARGET) return; + + // Is the monster dying and going through death animation? + if (targ.flags & FL_MONSTER && targ.health < 1) { + if (targ.health > targ.gibhealth) { + // SSG projectiles need to do more damage (higher chance of gib) + if (inflictor.classtype == CT_PROJ_SSG) take = 1 + random()*0.25; + // Lowered the chance of extra gibs from other weapons + // way to much gibbing was happening to all monsters + else take = 1; + + // Keep taking health off after death + targ.health = targ.health - (damage*take); + } + return; + } + + // If target cannot take damage, no point doing damage + if (targ.takedamage == DAMAGE_NO) return; + + // Check for breakable/pushables being immune to monster damage + // This check is present in all projectiles functions instead + // Its not really necessary here because its about monsters + // if (ai_immunedamage(attacker, targ)) return; + + // used by buttons and triggers to set activator for target firing + damage_attacker = attacker; + + // check for quad damage powerup on the attacker + if (attacker.super_damage_finished > 0) damage = damage * 4; + + if ((attacker.perms & POW_VAMPIRE) && (attacker.weapon == IT_AXE || attacker.weapon == IT2_MJOLNIR)) damage = damage * 1.25; //Apply Berserker Helm melee damage boost, Drake permanent powerup + + if (targ.classname == "monster_death_lord" && targ.shield == 1) + damage = damage * 0.5; + + // co-op team play damage avoidance + if ( (teamplay == 1) && (targ.team > 0) && (targ.team == attacker.team) ) return; + + // Poor zombies, they have so many exceptional ways to die! + if (targ.classgroup == CG_ZOMBIE) { + // If a zombie falls into slime or lava, instant death + if (targ.watertype == CONTENT_SLIME || targ.watertype == CONTENT_LAVA) { + damage = fabs(targ.gibhealth * 4); + //dprint("\b[T_DAMAGE]\b Instant death, in slime or lava\n"); + } + // Exploding boils always destroy zombies + if (attacker.classtype == CT_MONBOIL) damage = fabs(targ.gibhealth * 2); + } + + // Are monsters infighting and is there a damage modifier active? + if (attacker.infightextra && targ.flags & FL_MONSTER) + damage = damage * attacker.infightextra; + + //---------------------------------------------------------------------- + // Check for plasma burn/explosion on fatal hit + if (inflictor.classtype == CT_PROJ_PLASMA && attacker.flags & FL_CLIENT) { + if ((targ.health-damage < 0) && attacker.plasma_burn < time && random() < 0.2) { + // Stop the plasma burn effect not happening alot at once + attacker.plasma_burn = time + 4 + random()*4; + // Don't add anymore damage if quad active + if (attacker.super_damage_finished == 0) + damage = (targ.health - targ.gibhealth); + // Big blue sprite explosion + particles + particle_explode(targ.origin-'0 0 16', 50+random()*50, 2, PARTICLE_BURST_BLUE, PARTICLE_BURST_UPWARD); + SpawnExplosion(EXPLODE_PLASMA_BIG, inflictor.origin+'0 0 8', SOUND_REXP3); + } + } + + //---------------------------------------------------------------------- + // save damage based on the target's armor level + //---------------------------------------------------------------------- + save = 0; + if (checkarmor == DAMARMOR) { + save = ceil(targ.armortype*damage); + if (save >= targ.armorvalue) { + save = targ.armorvalue; + targ.armortype = 0; // lost all armor + targ.items2 = targ.items2 - (targ.items2 & (IT2_ARMOR1 | IT2_ARMOR2 | IT2_ARMOR3)); + } + // Reduce armour based on save forumla above + targ.armorvalue = targ.armorvalue - save; + // CEIL function will round up any fractional damage + // TBH it is better to round up than round down + take = ceil(damage-save); + } + else take = damage; + + //---------------------------------------------------------------------- + // add to the damage total for clients, which will be sent as a single + // message at the end of the frame + // FIXME: remove after combining shotgun blasts? + //---------------------------------------------------------------------- + if (targ.flags & FL_CLIENT) { + targ.dmg_take = targ.dmg_take + take; + targ.dmg_save = targ.dmg_save + save; + targ.dmg_inflictor = inflictor; + } + + // figure momentum add + if (inflictor != world && targ != world && (targ.movetype == MOVETYPE_WALK || targ.classname == "player")) { + dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; + dir = normalize(dir); + dir = dir*damage*8; + if (targ.mass == MASS_SUPER) dir = dir*0.5; // Harder to shove. + damage_velocity = dir; + targ.velocity = targ.velocity + dir; + } + + if (attacker.weapon == IT2_CROSS) { + float z_add = 150; + if (inflictor.classtype == CT_WANDBIGSPARK) z_add = z_add * 2; + if (targ.flags & FL_MONSTER) { + targ.flags = targ.flags - FL_ONGROUND; + targ.velocity = targ.velocity + dir; + if (targ.velocity_z < z_add) targ.velocity_z = z_add; + } + } + + // check for godmode or invincibility + if (targ.flags & FL_GODMODE || targ.invincible_finished >= time) { + if (targ.invincible_sound < time) { + sound (targ, CHAN_ITEM, SOUND_ARTPENT3, 1, ATTN_NORM); + targ.invincible_sound = time + 2; + } + return; + } + + //---------------------------------------------------------------------- + // do the damage + //---------------------------------------------------------------------- + targ.health = targ.health - take; + + // Apply berserker helm life leech to heal the attacker if the target still has health + if (attacker.perms & POW_VAMPIRE && targ.health > 0 && (attacker.weapon == IT_AXE || attacker.weapon == IT2_MJOLNIR)) { + misc = ceil(take * 0.1); //10% of the damage done gets leeched. Damage was already done so doesn't affect damage amount + if (misc < 1) misc = 1; // minimum of 1 leech + attacker.health = attacker.health + misc; + if (attacker.health > HEAL_MEGAMAX) attacker.health = HEAL_MEGAMAX; + } + + //---------------------------------------------------------------------- + // Check monster turret is to be released based on % health + // Fire any targets (once only) when this condition is met + //---------------------------------------------------------------------- + if (targ.turrethealth > 0 && targ.movespeed < 0) { + if (targ.health < (targ.max_health * targ.turrethealth)) { + if (targ.turrettarget != "") { + // Fire all targets and remove trigger string + trigger_strs(targ.turrettarget, attacker); + targ.turrettarget = ""; + } + // Release turret, free movement + targ.movespeed = 1; + } + } + + //---------------------------------------------------------------------- + // When the SG projectile system is active each monster needs to keep + //track of cumulative damage so that pain flinches work correctly + // AmmoShells classgroup is only active when SG projectiles are fired + //---------------------------------------------------------------------- + // Is the Shotguns projectile system active? + if (inflictor.classgroup == CG_PROJSHELLS) { + // Does the frame damage acculator need to be reset? + if (targ.dmgtimeframe <= time) { + targ.dmgtimeframe = time + 0.1; + targ.dmgcombined = 0; + } + // Accumulate damage until next fromae + targ.dmgcombined = targ.dmgcombined + take; + } + + //---------------------------------------------------------------------- + // When the SG projectile system is active ZOMBIES need to know if + // there has been enough damage over a single frame to die or not + // AmmoShells classgroup is only active when SG projectiles are fired + //---------------------------------------------------------------------- + if (targ.classgroup == CG_ZOMBIE) { + // Zombies MUST ALWAYS RUN their pain function!?! + self.pain_finished = 0; + // Horrible Hack - Launch_Bullet sets the weapon flag on projectiles + // Only register damage against zombies if SSG upgrade or Quad! + if (inflictor.classgroup == CG_PROJSHELLS && inflictor.weapon) { + // Has the accumulator gone over the max health? + if (targ.dmgcombined > targ.max_health) { + targ.health = targ.gibhealth; + } + } + } + + /*---------------------------------------------------------------------- + // Axe upgrade will gib enemies if they are killed with the axe + // A bit excessive on the gibbing, disabled for the moment + if (attacker.moditems & IT_SHADAXE && attacker.weapon == IT_AXE) { + if (targ.health < 1 && targ.gibhealth) targ.health = targ.gibhealth; + } */ + + //---------------------------------------------------------------------- + // Has the monster died? + //---------------------------------------------------------------------- + if (targ.health < 1) { + Killed (targ, attacker); + return; + } + + //---------------------------------------------------------------------- + // Switch self (foundtarget and pain function need self correct) + // self restored before end of function + oldself = self; + self = targ; + //---------------------------------------------------------------------- + // react to the damage - only if a monster + // No reaction if attacker is world (env trap, door, etc) + //---------------------------------------------------------------------- + if ( (self.flags & FL_MONSTER) && attacker != world && inflictor.classtype != CT_PROJ_BOLT1 && inflictor.classtype != CT_PROJ_BOLT2) { + // Is the current attacker not self and not current enemy target? + if (self != attacker && attacker != SUB_entEnemyTarget()) { + if ( self.noinfighting && attacker.flags & FL_MONSTER + || attacker.noinfighting) { + // Prevent monsters from infighting + // but let them react to the player + } + else { + // If previous switch target dead, focus on new target + if (self.switchattacker.health < 1) self.switchtimer = 0; + // Is the attacker a different classgroup and switching target available? + if ( self.classgroup != attacker.classgroup && self.switchtimer < time) { + // Prevent the monster from rapidily switching targets + if (self.switchattacker != attacker) self.switchtimer = time + 1; + else self.switchtimer = time + 0.1 + random(); + // Switch to new target + self.switchattacker = attacker; + + // Shift previous enemy to old enemy ready for new target + // Only switch if the new enemy is the player! (id logic) + // Check for new enemy target system before switching + if (SUB_flagsEnemyTarget(FL_CLIENT)) self.oldenemy = SUB_entEnemyTarget(); + if (self.enemy.classtype == CT_ENEMYTARGET) SUB_switchEnemyTarget(); + self.enemy = attacker; // attack the attacker! + FoundTarget (); // Run+turn towards new enemy + } + } + } + } + self = oldself; + + //---------------------------------------------------------------------- + // Check for ammo type resistance and immunity to pain + // Targetdummies rely on the pain function to display stats + if (targ.classtype != CT_TARGETDUMMY) { + if (targ.resist_shells > 0 && inflictor.classgroup == CG_PROJSHELLS) return; + else if (targ.resist_nails > 0 && inflictor.classgroup == CG_PROJNAILS) return; + else if (targ.resist_rockets > 0 && inflictor.classgroup == CG_PROJROCKETS) return; + else if (targ.resist_cells > 0 && inflictor.classgroup == CG_PROJCELLS) return; + } + + //---------------------------------------------------------------------- + // Switch self (foundtarget and pain function need self correct) + // self restored before end of function + oldself = self; + self = targ; + //---------------------------------------------------------------------- + + if (self.th_pain && self.pain_finished < time) { + // Save pain finished state for later + self.pain_finstate = self.pain_finished; + + // The damage from projectile shotguns trinkle at the monster + // which means it cannot trigger the flinch function + // Let the combined damage over 1 frame accumulate first + // Exception - Zombies don't flinch, they must run pain function + if (inflictor.classgroup == CG_PROJSHELLS && targ.classgroup != CG_ZOMBIE) { + // Demon, Shambler, Shalrath and Wizard all have high flinch values + if (self.pain_flinch > 40) flinch = 40; + else flinch = self.pain_flinch + 1; + if (self.dmgcombined < flinch) {self = oldself; return;} + } + + // Block pain re-trigger event + self.pain_finished = time + self.pain_timeout; + + // Ignoring pain from other monsters? (infighting) + if (self.pain_ignore && attacker.flags & FL_MONSTER) + self.pain_finished = self.pain_finished + 1 + random(); + else { + // If accumulated pain is higher, use that instead + // Added classgroup exception otherwise damage qty is wrong + if (inflictor.classgroup == CG_PROJSHELLS && take < self.dmgcombined) + self.th_pain (inflictor, attacker, self.dmgcombined); + else self.th_pain (inflictor, attacker, take); + + // nightmare mode monsters don't go into pain frames often + if (skill == SKILL_NIGHTMARE && targ.classgroup != CG_ZOMBIE) self.pain_finished = time + 5; + + // Exceptions to pain not being blocked (even nightmare!) + // If the monster is in slime or lava always go into pain + if (self.watertype == CONTENT_SLIME || self.watertype == CONTENT_LAVA) + self.pain_finished = time + 0.3; + } + } + self = oldself; +}; + +/*====================================================================== + T_RadiusDamage + + inflictor -(self) = projectile + attacker - (self.owner) = monster/player OR (self) = direct attack + ignore - (other) = Original target OR (world) = no exceptions +======================================================================*/ +void(entity inflictor, entity attacker, float damage, entity ignore, float checkclass) T_RadiusDamage = +{ + local float points; + local entity head; + local vector org, imporg; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (attacker.noradiusdmg) return; + if (attacker.classtype == CT_WORLD) return; + if (attacker.classtype == CT_ENEMYTARGET) return; + + // check if inflictor is a bmodel (different origin location) + if (inflictor.bsporigin) imporg = bmodel_origin(inflictor); + else imporg = inflictor.origin; + + head = findradius(imporg, damage+40); + + while (head) { + if (head != ignore) { + // This is used mostly for wraiths so when they die they don't + // kill each other, can't get the code logic to work so its + // setup as a dead exception path + if (checkclass == IGNORECLASS && head.classtype == ignore.classtype) { } + else { + // Check for breakable/pushable monster immunity + // Do nothing, radius damage has no miss effect + if (ai_immunedamage(attacker, head)) { + } + // Check for any breakable which is prone to explosive damage + else if (ai_foundbreakable(attacker, head,TRUE) && head.brktrigmissile !=0) { + trigger_ent(head, attacker); + } + else { + // Can be damaged and NOT immune to radius (splash) damage + if (head.takedamage > 0 && head.noradiusdmg == 0) { + // This formula is using bounding box size which means + // the damage amount is lower if the monster is larger + // It should really be based on bounding box edge + // not monster origin + org = head.origin + (head.mins + head.maxs)*0.5; + points = 0.5*vlen (imporg - org); + if (points < 0) points = 0; + points = damage - points; + + // Half damage if caught by own explosion + if (head == attacker) points = points * 0.5; + + if (points > 0 && head.health > 0) { + // Need CanDamage to check for anything blocking LoS + // It will do several traces (source->target) to check + // for any blocking entities (lifts, doors, walls etc) + if (CanDamage (head, inflictor)) { + // Splash damage is part of rocket resistance + if (head.resist_rockets > 0) + points = Resist_Damage(head, IT_ROCKETS, points); + + // Any damage left? Check for poison as well + if (points > 0) T_Damage (head, inflictor, attacker, points, DAMARMOR); + if (attacker.poisonous) PoisonDeBuff(head); + } + } + } + } + } + } + head = head.chain; + } +}; + +/*====================================================================== + T_BeamDamage (never used, leftover dev crap!) +====================================================================== +void(entity attacker, float damage) T_BeamDamage = +{ + local float points; + local entity head; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (attacker.classtype == CT_WORLD) return; + if (attacker.classtype == CT_ENEMYTARGET) return; + + head = findradius(attacker.origin, damage+40); + + while (head) { + if (head.takedamage) { + points = 0.5*vlen (attacker.origin - head.origin); + if (points < 0) points = 0; + points = damage - points; + if (head == attacker) points = points * 0.5; + if (points > 0) { + if (CanDamage (head, attacker)) { + if (head.resist_rockets > 0) + points = points * head.resist_rockets; + T_Damage (head, attacker, attacker, points,DAMARMOR); + } + } + } + head = head.chain; + } +}; */ + +//============ +// T_Repair +// +// Add armor to an entity, within limits. Similar to T_Heal, but for armor. +//============ +float(entity e, float heal, float ignore) T_Repair = +{ + local float full; + + if (e.health <= 0) + return 0; // Dead. + //if (Armor_NoPatch (e)) + //return 0; + + if (ignore) + full = 250; // armorvalue on hud is restricted to max of 255. + else if (e.armortype == ARMOR_RED_TYPE) + full = ARMOR_RED_VALUE; + else if (e.armortype == ARMOR_YEL_TYPE) + full = ARMOR_YEL_VALUE; + else + full = ARMOR_GRN_VALUE; + + if (e.armorvalue >= full) + return 0; // Armor already fully restored. + + if (e.armorvalue + heal >= full) + heal = full - e.armorvalue; + if (heal < 1) + return 0; // Don't damage the armor. + + e.armorvalue = e.armorvalue + heal; + if (!e.armortype) + //if (!Armor_Exotic (e)) { + // Some of the custom armors are cursed! + // Add green armor. + e.armortype = ARMOR_GRN_TYPE; + if (e.flags & FL_CLIENT) + if (!(e.items2 & IT2_ARMOR1) || !(e.items2 & IT2_ARMOR2) || !(e.items2 & IT2_ARMOR3)) + e.items2 = e.items2 | IT2_ARMOR1; + //} + return heal; // Return amount healed instead of TRUE. +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_combatkeep.qc b/QC_other/QC_keep/ai_combatkeep.qc new file mode 100644 index 00000000..aa55b581 --- /dev/null +++ b/QC_other/QC_keep/ai_combatkeep.qc @@ -0,0 +1,692 @@ +/*====================================================================== + T_EELZap + Ignores entities outside of the water and other eels + inflictor -(self) = projectile + attacker - (self.owner) = monster/player OR (self) = direct attack + ignore - (other) = Original target OR (world) = no exceptions +======================================================================*/ +void(entity inflictor, entity attacker, float damage, entity ignore, float checkclass) T_EELZap = { + local float points; + local entity head; + local vector org, imporg; + + // Cannot hurt the world or enemy targets (fake flying markers) + if (attacker.noradiusdmg) return; + if (attacker.classtype == CT_WORLD) return; + if (attacker.classtype == CT_ENEMYTARGET) return; + + // check if inflictor is a bmodel (different origin location) + if (inflictor.bsporigin) imporg = bmodel_origin(inflictor); + else imporg = inflictor.origin; + + head = findradius(imporg, damage+40); + while (head) { + if (head != ignore) { + // This is used mostly for wraiths so when they die they don't + // kill each other, can't get the code logic to work so its + // setup as a dead exception path + if (checkclass == IGNORECLASS && head.classtype == ignore.classtype) { } + else { + // Check for any breakable which is prone to explosive damage + if (ai_foundbreakable(attacker, head,TRUE) && head.brktrigmissile !=0) { + trigger_ent(head, attacker); + } + else { + // Can be damaged and NOT immune to radius (splash) damage + if (head.takedamage > 0 && head.noradiusdmg == 0) { + org = head.origin + (head.mins + head.maxs)*0.5; + points = 0.5*vlen (imporg - org); + if (points < 0) points = 0; + points = damage - points; + if (head == attacker) points = points * 0.5; + if (points > 0 && head.health > 0) { + // Need CanDamage to check for anything blocking LoS + // It will do several traces (source->target) to check + // for any blocking entities (lifts, doors, walls etc) + if (CanDamage (head, inflictor)) { + if (head.resist_rockets > 0) + points = points * head.resist_rockets; + if ((head.classtype != CT_MONEEL) && (head.flags & FL_INWATER)) { + T_Damage (head, inflictor, attacker, points, DAMARMOR); + } + } + } + } + } + } + } + head = head.chain; + } +}; + +// From Quoth +void() ai_shotcheck = { if (visible(self.enemy)) self.oldenemyorigin = self.enemy.origin; }; + +/* DRAKE DAMAGE CODE + +// Knockback! +void(entity targ, entity inflictor, float damage, float dflags) T_KnockBack = +{ + local vector dir; + + if (!targ) + return; // Can't move the world! + + dir = '0 0 0'; + if (inflictor) + if (!(dflags & DF_NO_KNOCK)) + { + dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; + dir = normalize(dir); + dir = dir*damage*8; + // If target is a player, move him now. Do not check for + // movetype_walk because the player may use flight. + if (targ.classname == "player") // Was 'movetype == MOVETYPE_WALK'. + targ.velocity = targ.velocity + dir; + else if (dflags & DF_PUSH_NPC) + { + if (targ.mass && (targ.mass <= MASS_SUPER)) + if (targ.solid != SOLID_BSP) + { + if (targ.mass == MASS_SUPER) + dir = dir * 0.5; // Harder to shove. + targ.velocity = targ.velocity + dir; + if (targ.flags & FL_ONGROUND) + { // Engine does not update velocity unless falling. + targ.flags = targ.flags - FL_ONGROUND; + targ.velocity = dir; // Set to new velocity. + if (targ.velocity_z < 150) + targ.velocity_z = 150; + } + else + targ.velocity = targ.velocity + dir; + } + } + } + damage_velocity = dir; +}; + +//============ +// T_Damage +// +// The damage is coming from inflictor, but get mad at attacker +// This should be the only function that ever reduces health. +// +// FIXME: Pass impact point and velocity. +//============ +void(entity targ, entity inflictor, entity attacker, float damage, + float dflags, string dtype) T_NewDamage = +{ + if (!targ.takedamage) + { + if (!(dflags & DF_NO_SHIELDS) || !(targ.xfl & XFL_SHIELDS)) + return; + // ELSE... penetrate the mega-enforcers' shields. + } + if (dflags & DF_BLESSED) + if (Ally_Check (targ, attacker)) + return; // A 'blessed' attack ignores allies. + +// local vector dir; + local entity oldself; + local float save; + local float take; + local float burn; // PM: Burn damage. + local float misc; // PM: Miscellaneous float. + local float exotic, adamant; // Update 5/13/10: Exotic armors. + +// Used by buttons and triggers to set activator for target firing. +// If minion did it, give credit to master, so messages can be displayed. +// FIXME: This may cause weird things for other code that use damage_attacker. +// Example: Gremlin uses it to determine choice of death animation. + damage_attacker = Patriarch (attacker); + +// check for quad damage powerup on the attacker +// PM: Yes, I know Quake2 does it differently and better, but this is simple +// and works well enough. + if (!(dflags & DF_PROXY)) + { + if (attacker.curse_type == CURSE_WEAKEN) + damage = damage / 2; // FIXME: What if percentile damage? + if (attacker.perms & POW_VAMPIRE) + if (dflags & DF_MELEE) + damage = damage * 1.25; + if (attacker.super_damage_finished) // IT_QUAD + { + if (dflags & DF_PERCENT) + damage = FourZaps (damage); + else + damage = damage * 4; + dflags = dflags | DF_SCAR; // Let quad anything blast zombies. + } + } + +// Check for health percentage mod. Works like Static Field from Diablo2. + if (dflags & DF_PERCENT) + damage = targ.health * damage / 100; + +// - - - - - - - - - - - - - - - - - - - +// check for other damage modifiers +// +// PM: Unlike Diablo II, apply resistance to armor too. +// We (generally) don't know how the target gets his resistance. +// That is, barrier (always full damage) vs. innate/buffs (use resists). +// - - - - - - - - - - - - - - - - - - - + burn = 0; + misc = 0; + damage = ResistDamage (targ, damage, dflags); + +// Empathy shields - - - - - - - - - - - +// PM: This is DANGEROUS!!! Prone to bugs if not careful. +// Check the comments in some of the monster files, namely those with +// jump attacks, to see the changes I made to prevent thorns-related bugs. +// - - - - - - - - - - - - - - - - - - - + if (targ.thorns_finished) + if (!(dflags & DF_NO_ARMOR)) + { + take = dflags & DF_PROXY; + if (take || !attacker.thorns_finished) + { + damage = damage * 0.5; + if (!take) + T_NewDamage (attacker, targ, targ, damage, dflags, "thorns"); + // ELSE... damage by proxy. + // Damage did not really come from the attacker, even though + // all the credit goes to him. + + // Was placed between invulnerability and teamplay checks. + if (targ.thorns_sound < time) + { + if (powcache & PCH_THORNS_USE) + sound (targ, CHAN_ITEM, "hipitems/empathy2.wav", 1, ATTN_NORM); + targ.thorns_sound = time + 0.5; + } + } + // ELSE both sides have thorns, and they cancel each other out. + } +// - - - - - - - - - - - - - - - - - - - +// Final damage + damage = ceil(damage); + +// figure momentum add + T_KnockBack (targ, inflictor, damage, dflags); + +// Check for invulnerability. In classic Doom, invulnerability did not +// red flash or otherwise change the player's view. Some other Quake mods +// harken back to that style. + if (targ.flags & FL_GODMODE) + { + if (skill < 4) + return; + if (!(targ.flags & FL_CLIENT)) + return; + // Players can't cheat in Hell. + targ.flags = targ.flags - FL_GODMODE; + if (Kill_Cheater (targ, inflictor, "fell from grace")) + return; + } + if (targ.invincible_finished) + { + ProtectSound (targ); + return; + } +// Cross of Deflection - - - - - - - - - + if (targ.cross_finished) + { // Note: Cross reduces damage only, not knockback. + CrossSound (targ); + if (dflags & DF_CROSS_BLOCK) + return; // Negate all damage from this attack. + damage = ceil(damage * 0.5); // Even armor-piercers get affected. + } +// - - - - - - - - - - - - - - - - - - - +// Friendly fire. Placed after shielding items. + if (teamplay == 1) + if (Team_Match (targ, attacker)) + return; // team play damage avoidance +// FIXME: Too messy, rewrite. + if (targ.xfl & XFL_BOSS) + { + // SoE: Bane clones. + if (targ.classname == attacker.classname) + if ((targ.classname == "monster_bane") || (targ.classname == "monster_morph")) + if (Ally_Check (targ, attacker)) + return; // Bane can't hurt himself and his clones. + // Minion immunity. + if (targ == attacker.master) + if (Ally_Check (targ, attacker)) + return; // Immune to minions' attacks. + } +// - - - - - - - - - - - - - - - - - - - + +// Damage vs. protection + take = damage; + save = 0; + exotic = Armor_Exotic (targ); + adamant = Armor_Infinite (targ); + + // Save damage based on target's armor level. + // Note: Treat armorvalue of morphed players more like health by + // absorbing all damage, even armor-piercing damage. + if (!(dflags & DF_NO_ARMOR) || targ.form_active) + { + damage = damage - PowerArmor_Absorb (targ, damage, TRUE); + +// take = 1; + if (targ.form_active) + { // Absorb all damage while in monster form. +// if (targ.form_active == FORM_SCORPIO) +// take = 2; // Centroid has 300 hp. 150 * 2 = 300 hp. +// save = damage / take; + save = damage; + } + else if (targ.armortype) + { // Target has armor. + if ((exotic != SUIT_COURAGE) || UseCourage (targ, inflictor.origin)) + save = ceil (targ.armortype * damage); + } + else if (exotic == SUIT_CHAOS) + { + if (targ.health > 0) + { + save = Armor_ChaosRating (targ); + save = ceil (save * damage); + // Chance to confuse attacker. Must delay confusion + // in case T_Damage was called within T_RadiusDamage. +// DISABLED -- I need to precache a sound to use this, and there's never +// enough slots! Variable absorption and teleportation should be chaotic enough. +// if (!(dflags & DF_PROXY)) +// if (random() < (save + 1) * 0.01) +// Confusion_Delayed (attacker, targ); + } + } + + if (save) // Non-zero only with armor, and most are unarmored. + { + if (targ.curse_type == CURSE_ARMOR) + save = ceil(save / 2); // Armor is not as effective. + if (!adamant) + if (save > targ.armorvalue) + save = targ.armorvalue; + take = ceil (damage - save); + // take = ceil (damage - save * take); + } + } + +// Light up the screen if target is a living client. + if (targ.flags & FL_CLIENT) + { + if (!targ.deadflag) + { + //- - - - - - - - - + // Timed, continuous, or persistant damage hurts the target each + // frame (or every other frame) it is active, and flashing the + // hud each time will eventually blind the client with red flash. + // + // Leave the hud alone if damage is timed and the client is + // already reeling in pain. + //- - - - - - - - - + if ( !(dflags & DF_TIMED) || (targ.pain_finished <= time) ) + { + if (damage < 0) + stuffcmd (targ, "bf\n"); // Use yellow flash. + else + { + targ.dmg_take = targ.dmg_take + take; + targ.dmg_save = targ.dmg_save + save; + } + } + targ.dmg_inflictor = inflictor; + } + } + + // Now check for armor damage. + if (save) + if (!adamant) + { + misc = targ.armorvalue; // Remember armor before hit. + targ.armorvalue = targ.armorvalue - save; + if ((targ.armorvalue <= 0) && !Armor_Indestructible (targ)) + { // Normal procedure. + Armor_Remove (targ); // Lost all armor. + exotic = 0; + } + else if (damage < 0) + { // Negative damage can increase armor value. For clients, + // do not let it rollover the max of 255 (8-bit). + if (targ.flags & FL_CLIENT) + if (targ.armorvalue > 250) + { // Move unused armor into health. + take = take - (targ.armorvalue - 250); + targ.armorvalue = 250; + if (misc >= 250) + misc = 0; + } + if (misc) + ProtectSound (targ); + } + else if (!take) + { + if ((exotic == SUIT_SPIRIT) || (exotic == SUIT_ULTRA)) + { // Spirit armor absorbed all damage this time. + ProtectSound (targ); + return; // Yes, even if a monster wouldn't notice. + } + } + } + +// Check for post-armor resistance, like CTF's Earth rune. +// Protection that is applied after armor damage and momentum. +// Note: Multipliers first, then additions. +// if (targ.tech == TECH_ARMOR) +// take = take / 2; + if (targ.curse_type == CURSE_DAMAGE) + take = take * 2; + if (exotic == SUIT_BERSERKER) // Demonhide increases damage taken. + take = take * 1.3; // Green armor reduces 30%, reverse it! + take = floor(take); +// DISABLED -- Phaser/Wand doesn't reduce damage anymore. +// Keep the code handy in case I want to add a protection artifact. +// // Holding the wand reduces damage by one -- think ring of protection +1. +// if (!targ.form_active) +// if (targ.war == WAR_ZAPPER) +// if (targ.arsenal & WAR_ZAPPER) +// if (take > 0) +// take = take - 1; + +// Negative damage check. + if (take < 0) + { // Negative damage? Heal the target. One of czg's maps has a + // fountain that heals the player by causing negative damage. + // Since negative damage could add health over the normal limit + // in the standard progs.dat, do so here too. + if (T_Heal (targ, 0 - take, 2)) // 2 = Heal even dead things. + { + if (targ.health >= 1) + { + if (targ.deadflag == DEAD_DEAD) + monster_revive (targ, targ); +// DISABLED -- No sound please. +// else if (!targ.deadflag) +// ProtectSound (targ); + } + } + return; + } + +// Check for burn damage. Works only if player did not heal from damage. +// Warning: Ugly hack alert -- the big burn hack! + if (dflags & DF_BURN) + { // Okay, here's the deal. The ignition stuff is tailored specially + // for dragons' fire attacks. Anything that lights stuff on fire + // is set rigidly to the same standard. I could change the code to + // allow more variable burning stats, but I would need to add yet + // another variable to be passed to T_Damage, and I don't want to + // just for the dragons. Hence, the big burn hack. + if (dtype == "rabies") // Named after Diablo2 druid skill. + { // 50% chance to infect a new target with fire. + // Assumes inflictor is a big fire burning on targ. + if (random() < 0.5) + Burn_Add (targ, attacker, inflictor.dmg - BURN_PER_SECOND); + dtype = "fire"; // Change it back. + } + else + { // Chance to burn equals (damage + 1)%. E.g., 9 damage = 10%. + // Yes, use 'damage' and not 'take'. + if (random() < (damage+1)*0.01) + Burn_Add (targ, attacker, MAX_BURN_DAMAGE); + } + } + +// Check if the damage is allowed to hurt the target. In case of +// zombies/corpses, remove health only on one-hit kill or scar damage. +// Note: Boss monsters always cause scar damage to other monsters +// because we don't want a lowly zombie to overpower the boss. +// +// Now that 'burn' served its original purpose (or would have), use it as +// a boolean such that TRUE = hurt the target or FALSE = ignore the damage. + burn = FALSE; + if (dflags & DF_SCAR) // This type of damage hurts even the dead. + burn = TRUE; + else if ((targ.curse_type == CURSE_ARMOR) || (attacker.xfl & XFL_BOSS)) + { // Negate zombies' damage immunity. + if (targ.flags & FLx_CREATURE) + burn = TRUE; + } + else if (targ.deadflag) + { // Dead targets are like zombies, damage only if it gibs on one hit. + if (take > (0 - targ.gib_health)) + if (!(dflags & DF_NO_GIB)) + burn = TRUE; + } + else + { // Live target -- zombies are hurt only by one-hit kill. + // Anything else is hurt normally. + if (!(targ.xfl & XFL_ZOMBIE) || (take >= targ.max_health)) + burn = TRUE; + } + +// Do the damage. + if (burn) + { + // Check for life leech before applying the damage. + // Only living attackers can leech from living targets. + // Update: Healing is done after damage. + // Note: It is possible for attacker to leech himself. Silly, + // but I do not see why it would not work as long as leech is + // kept below 100%. + // FIXME: Make leech ineffective against non-living such as undead. + local float ignore, hi; + + ignore = FALSE; + save = misc = 0; + if (attacker.health > 0) + if (attacker.flags & FLx_CREATURE) + if (targ.flags & FLx_CREATURE) + { + if (dflags & DF_LEECH) + { if (attacker.family & FAM_WRATH) + { + save = save + 0.5; // Assume life drain attack. + ignore = TRUE; // Exceed normal health limit. + } + else + save = save + 0.1; + } +// DISABLED -- Removed lifetap curse. +// if (targ.curse_type == CURSE_LIFETAP) +// save = save + 0.5; + if (save > 1) + save = 1; // Cannot heal more than damage dealt. + + if (take > targ.health) + hi = targ.health; + else + hi = take; + if (save) + { + misc = ceil (hi * save); + } + + if (dflags & DF_MELEE) + if (attacker.perms & POW_VAMPIRE) + if (!(targ.family & FAMx_NONLIVING)) + { + misc = misc + 1; + if (misc > hi) + misc = hi; + } + } + // Now inflict the damage for real. + targ.hit_points = targ.health = targ.health - take; + if (misc > 0) + T_Heal (attacker, misc, ignore); + // Update 5/14/2010: Demonhide lifesaver check. + if (exotic == SUIT_BERSERKER) + { // Demonhide will try to save player from a fatal wound. + if (targ.health < 1) + { // Armor will heal the player then break. + targ.health = targ.armorvalue + targ.health; + if (targ.health > targ.max_health) + targ.health = targ.max_health; + targ.hit_points = targ.health; + if (targ.flags & FL_CLIENT) + { + if (targ.health > 0) + { +// sound (targ, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + ProtectSound (targ); + centerprint (targ, "You absorb your armor!"); + } + // ELSE... Damage was too much to overcome -- tough luck! + } + // Saved the player's ass, so go away now. + Armor_Remove (targ); + } + } + //- - - - - - - - - +// DISABLED -- Regen code. +// targ.healtime = time + 1; // Suppress regeneration. + } + if (targ.health <= 0) + { + // Target was slain! + if (!targ.deadflag) + { + // Shotgun hack: Knockback on kill! + if (!q1shot) + if (dtype == "ssg") + if (targ.flags & FL_MONSTER) + if (take >= 25) + { + if (targ.classname == "monster_zombie") + take = take * 0.5; // Offset 2x damage from headshot. + else if (targ.family & FAM_WRATH) + take = take * 0.2; // Give a slight push + T_KnockBack (targ, inflictor, take, DF_PUSH_NPC | dflags); + } + + if (dflags & DF_GIB) + targ.hit_points = targ.health = -99; + else if (dflags & DF_NO_GIB) + targ.hit_points = targ.health = 0; + Killed (targ, attacker, dtype); + } + else if (targ.th_gib) + { + if (burn) + { + oldself = self; + self = targ; + if (self.th_gib (0 - take)) // Gibbed if TRUE. + self.th_gib = world.null_func; + self = oldself; + } + } + return; + } + +// React to the damage. + oldself = self; + self = targ; + + if (self.flags & FL_MONSTER) + { + //- - - - - - - - - + // Notes: + // 1) Never react to 'timed' damage because it becomes too easy for + // multiple attackers to paralyze the target. + // 2) AFAIK, doors are both inflictor and attacker. Also, since doors + // are not creatures, monsters can't get mad at it. So no need for + // 'if (inflictor.classname != "door")' + // 3) Normally, DoE dragon does not react. In this mod, it reacts if + // not bound to a path. + //- - - - - - - - - + if (attacker) // != world) + if (!(dflags & DF_NO_REACT)) + if (!(dflags & DF_TIMED) || !self.enemy) + if (!(self.ryuflags & RYU_PATH)) // For DoE dragon. + if (Enemy_Check (self, attacker)) + NewEnemy (attacker); + } + + if (self.th_pain) + { + if (dflags & DF_TIMED) + take = 0; // Minimize pain. + self.th_pain (attacker, take); + + // Do Nightmare stuff on a case-by-case basis like in Quake2. + // Quake2 has Quake's pain_finished = T+5, but was made moot by + // the no pain anims in nightmare override most monsters have. + } + + self = oldself; +}; + +/============ +// T_RadiusDamage +//============ +void(entity inflictor, entity attacker, float damage, entity ignore, + float dflags, string dtype, float radius, float attn) T_RadiusDamage_II = +{ +// Do some sanity checking. + if (damage < 1) + return; // No damage, don't waste time. + +// Now do the radius damage routine. + local float points; + local entity head; + local vector org; + local float no_water; + local float ldmg; + + dflags = (dflags | DF_CROSS_BLOCK) - (dflags & DF_NO_SHIELDS); + ldmg = 0; + no_water = !(dflags & DF_WATER_ONLY); +// head = QC_FindRadius(inflictor.origin, radius); // Hits SOLID_NOT. + head = findradius(inflictor.origin, radius); + while (head) + { + if (head != ignore) + if (head.takedamage) + if (!(head.xfl & XFL_FIREANGEL)) + if (no_water || head.h2olevel) + if (head.solid > SOLID_NOT) // So DarkPlaces won't gib the fallen. + { + // T_RadiusDamage may be called during WorldScan, and the less + // code ran and functions called, the less likely FitzQuake will + // crash when a huge mob gets nuked by Mjolnir. Here, do the + // math from Midpoint instead of calling the function. + org = head.origin + (head.mins + head.maxs)*0.5; //Midpoint (head); + points = attn * vlen(inflictor.origin - org); + points = damage - points; + if (points > 0) + if (CanDamage (head, inflictor)) + { + if (head == attacker) + { // Ignore attacker until after everyone else is hit. + if (dflags & DF_PROXY) + ldmg = points; + else if (!(dflags & DF_SAFE)) + ldmg = points * 0.5; + } + else + T_NewDamage (head, inflictor, attacker, points, dflags, dtype); + } + } + head = head.chain; + } + +// Damage attacker last. Why? Since frags do not go less than zero, +// build up the frags from kills first before applying the suicide penalty. +// FIXME: Does not account for teammate kills, which reduces frags too. + if (ldmg) + T_NewDamage (attacker, inflictor, attacker, ldmg, dflags, dtype); +}; +//============ +void(entity inflictor, entity attacker, float damage, entity ignore, + float dflags, string dtype) T_NewRadiusDamage = +{ + T_RadiusDamage_II (inflictor, attacker, damage, ignore, dflags, dtype, damage+40, ATTN_DAMAGE); +}; +*/ \ No newline at end of file diff --git a/QC_other/QC_keep/ai_doom.qc b/QC_other/QC_keep/ai_doom.qc new file mode 100644 index 00000000..fea062f2 --- /dev/null +++ b/QC_other/QC_keep/ai_doom.qc @@ -0,0 +1,240 @@ +float(float yaw, float dist) flat_move; + +//========================================================================== +// Doom Movement -- Used by the cyberdemon from Doom/II. + +float(float yaw, float dist) doom_step = +{ + if (QC_StepDir (yaw, dist)) + { + self.movecount = prandom() & 15; + return TRUE; + } + self.movecount = 0; // Not in Doom's p_enemy.c. + return FALSE; +}; + +// Based on 'SV_NewChaseDir'. +void(float dist) doom_chase = +{ + local vector delta; + local float d1, d2; + local float old, back, turn; + + old = floor (self.ideal_yaw / 45); // IIRC, int chops off decimals. + old = anglemod (old * 45); + back = anglemod (old - 180); + + delta = self.goalentity.origin - self.origin; + if (delta_x > 10) + d1 = 0; + else if (delta_x < -10) + d1 = 180; + else + d1 = -1; + if (delta_y < -10) + d2 = 270; + else if (delta_y > 10) + d2 = 90; + else + d2 = -1; + +// Try direct route. + if (d1 != -1) + if (d2 != -1) + { + if (d1 == 0) + {if (d2 == 90) turn = 45; else turn = 315;} + else + {if (d2 == 90) turn = 135; else turn = 215;} + + if (turn != back) + if (doom_step (turn, dist)) + return; + } + +// Try other directions. + local float ax, ay; + + ax = fabs(delta_x); + ay = fabs(delta_y); + // Note: Quake uses 1/3, Doom uses 200/255 (0.2156862745). + if ((random() < 0.2157) || (ay > ax)) + {turn = d1; d1 = d2; d2 = turn;} + + if (d1 != -1) + if (d1 != back) + if (doom_step (d1, dist)) + return; + if (d2 != -1) + if (d2 != back) + if (doom_step (d2, dist)) + return; + +// No direct path to goal, so pick another way. + if (old != -1) + if (doom_step (old, dist)) + return; + + local float end, next; + if (random() < 0.5) + {turn = 0; end = 315; next = 45;} + else + {turn = 315; end = 0; next = -45;} + + while (turn <= end) + { + if (turn != back) + if (doom_step (turn, dist)) + return; + turn = turn + next; + } + + if (back != -1) + if (doom_step (back, dist)) + return; + +// Can't move. + self.ideal_yaw = old; + +// Pull out code. + flat_move (0, 0); // This will do the 'SV_FixCheckBottom' code. +}; + +void(float dist) doom_goal = +{ + local vector org; + + org = self.origin; + self.movecount = 0; + if (self.flags & FLx_NOT_FALLING) + { // Bump around... +// DISABLED -- Not useful if not following Doom code exactly. +// I do not fully understand Doom code, so wing it and use Quake code. +// self.movecount = self.movecount - 1; +// if (self.movecount < 0) // Was (random() < 0.333) + if (random() < 0.333) + doom_chase (dist); + else if (!doom_step (self.ideal_yaw, dist)) + doom_chase (dist); +// dprint(ftos(self.movecount)); dprint ("\n"); + return; + } +}; + + +//=========== +// DoomCheckAttack +// +// The player is in view, so decide to move or launch an attack +// Returns FALSE if movement should continue +// +// Used by monsters originally from the classic Doom games, +// such as the cyberdemon. Tries to emulate some of the Doom AI. +//============ +void() DoomCheckAttack = { +// DISABLED -- Monsters in Doom can attack from any range. +// if (enemy_range == RANGE_FAR) +// return FALSE; // Don't call traceline again when we don't need to. + if (!self.enemy.modelindex) + return; // Enemy phased out of the level. + + local vector spot1, spot2; + local entity targ; + local float dist; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.attack_offset; + spot2 = targ.origin + targ.attack_offset; + +// Doom monsters don't care who is in the way. + traceline (spot1, spot2, TRUE, self); + if (trace_fraction < 1) + return; // Blocked by a wall. + + // PM: Added alert support so that some monsters can see and attack + // through water like players can. + // FIXME: Is the 'fish check' necessary here? + if (trace_inopen) + if (trace_inwater) + if (!(self.ryuflags & RYU_ALERT)) // PM: Alert support. + return; // sight line crossed contents + + if (enemy_range == RANGE_MELEE) + if (self.th_melee) + {self.th_melee (); return;} + +// missile attack + if (!self.th_missile) + return; + if (self.ryuflags & RYU_JUSTHIT) // TRUE after recovery from pain frame. + { + self.ryuflags = self.ryuflags - RYU_JUSTHIT; + self.movecount = 1; // See end of function for explanation. + self.th_missile (); + return; + } + if (time < self.attack_finished) // Used as reactiontime here. + return; + if (self.movecount) + if (skill < 3) + return; // Not allowed to attack now. + +// FIXME: Add global in range function. + dist = vlen(spot2 - spot1); + if (!self.th_melee) + dist = dist - 128; + dist = fabs(dist); // Is 'dist >>= 16' in Doom's p_enemy.c. + +/* DISABLED -- These monsters don't exist in Quake. + if (self.classname == "monster_archvile") + if (dist > 896) //14*64 + return FALSE; + else if (self.classname == "monster_revenant") + { + if (dist < 196) + return FALSE; + dist = dist / 2; + } + else if ((self.classname == "monster_spiderdemon") || (self.classname == "monster_lostsoul")) + dist = dist / 2; +*/ + + if (self.classname == "monster_cyberdemon") + { dist = dist / 2; + if (dist > 160) + dist = 160; + } + else + { if (dist > 200) + dist = 200; + } + + if (prandom() < dist) + return; + + if (self.attack_offset != VEC_ORIGIN) + { // Make sure missile can hit the target from where it spawns. + // Was not applicable in Doom, but it is here! + makevectors (self.angles); + spot1 = self.origin + (v_forward*self.attack_offset_x) + + (v_right*self.attack_offset_y) + (v_up*self.attack_offset_z); + traceline (spot1, spot2, TRUE, self); + if (trace_fraction < 1) + return; // Blocked by a wall. + } + +// attack_finished does not exist in Doom, so don't set it! +// In fact, attack_finished is used as reactiontime for Doom monsters. + // In Quake, attack is checked before movement, so set movecount + // to ensure movement checks first. Hack-ish and not ideal, but + // works for me. + self.movecount = 1; + self.th_missile (); + return; +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/ai_drake.qc b/QC_other/QC_keep/ai_drake.qc new file mode 100644 index 00000000..6946fa25 --- /dev/null +++ b/QC_other/QC_keep/ai_drake.qc @@ -0,0 +1,196 @@ +void HuntTarget (); + +//- - - - - - - - - +// Like checkclient, but for monsters. +// Checks if a given target is available for attacking. +// The entity targ is supposed to be the current entity on a given hitlist. +entity(entity targ) CheckTarget = +{ + if (targ.health > 0) + if (visible (targ)) + return targ; + return world; +}; + +//- - - - - - - - - +// SOW = Stand or walk. Called at the end of a victory dance. +void() monster_sow = +{ + if (self.movetarget) + self.th_walk (); + else + self.th_stand (); +}; + +//- - - - - - - - - +// Tells the monster to go straight up, if distance is positive. +// A negative distance will make the monster go down instead. +// Returns TRUE if fully or partially successful at moving. +// +// Originally from Dragons. +//- - - - - - - - - +float(float dist) ai_up = +{ + local entity box, os; + local entity swap; + local vector spot; + + if (dist < 0) + { + dist = 0 - dist; // 'fabs' it. + temp_goal.origin_z = self.origin_z - 40 - dist; // Going down. + } + else + temp_goal.origin_z = self.origin_z - 30 + dist; // Going up. + setorigin (temp_goal, temp_goal.origin); + + spot = self.origin; + + swap = self.enemy; + self.enemy = temp_goal; + while (dist > 0) + { + if (dist < 8) // walkmove moves self up or down 8 units at a time. + { // Last run through loop. + // Go through the trouble of moving less than 8 units. + // Create a dummy to move for the monster. If the dummy + // can move, it is safe to set origin directly for monster. + box = spawn(); + box.oldorigin = self.origin; + box.angles = self.angles; + box.solid = self.solid; + box.movetype = self.movetype; + box.flags = self.flags & FLx_NOT_FALLING; + box.enemy = self.enemy; + box.owner = self; // Pass through monster. + setsize (box, self.mins, self.maxs); + setorigin (box, self.origin); + os = self; + self = box; + if (safe_move (self.angles_y, 0)) + { // Dummy moved, now move the monster precisely. + if (self.origin_z > self.oldorigin_z) + { // Going up. + os.origin_z = os.origin_z + dist; + setorigin (os, os.origin); + } + else if (self.origin_z < self.oldorigin_z) + { // Going down. + os.origin_z = os.origin_z - dist; + setorigin (os, os.origin); + } + } + remove (box); + self = os; + } + else + safe_move (self.angles_y, 0); // Fails only in solid. + + dist = dist - 8; + } + self.enemy = swap; + + return (self.origin != spot); +}; + +float(float dist) ai_down = {return ai_up (0 - dist);}; + +// Changes mode from fight to idle. Does not actually change thinking. +void() ai_calm_down = +{ +// Reset fight status. + self.fighting = FALSE; + self.search_time = time + 3; + +// Forget all enemies and go idle. + self.enemy = self.oldenemy = world; +}; + +// Check if self should stop running after enemy. +float() ai_run_kill = +{ + local float winner; + +// Check for victory sound. Must do first because enemy will be changed. +// Sound is played only if enemy slain is a client. + winner = FALSE; + if (self.enemy) + if (self.enemy.classname == "player") + if (visible (self.enemy)) + { + winner = TRUE; + // Set yaw in case we need to face the fallen during the dance. + self.ideal_yaw = vectoyaw (self.enemy.origin - self.origin); + } + + self.enemy = world; +// FIXME: look all around for other targets + if (self.oldenemy.health > 0) + { + self.enemy = self.oldenemy; + self.oldenemy = world; + // FIXME: Replace with simpler version without the thinking. + HuntTarget (); + } + else + { + ai_calm_down (); + if (winner) + if (self.th_win) + {self.th_win (); return TRUE;} // We have a winner! + monster_sow (); + return TRUE; + } + return FALSE; +}; + +// Monster is done running and going back to stand/walk. +void() ai_run_done = { + ai_calm_down (); + monster_sow (); +}; + +// Same as W_ShowHostile, minus the quad sound. Some monsters can abort +// attacks in their attack functions so don't blindly play the quad sound. +void() M_ShowHostile = //{self.show_hostile = time + 1;}; +{ + self.show_hostile = time + 1; + //self.attack_time = time; +}; + +//============= +// ai_run_bank -- Custom strafing AI for Dragons! +// +// Move to the side of ideal_yaw. Assumes ideal_yaw was set prior to a +// call to this function. While similar to 'ai_run_slide', this function +// has two important differences. +// +// * Only one move attempt is made. If it fails, it does not get a second +// try to move to the other side. +// +// * If the move fails, the 'lefty' value is toggled only if 'self' was +// leaning toward the side it tried to move to. +// +// This is used to help provide the illusion of a momentum change. +//============= +void(float dist) ai_run_bank = { + local float ofs, flip; + + if (self.lefty) + {ofs = 90; flip = (self.angles_z < 0);} + else + {ofs = -90; flip = (self.angles_z > 0);} + + if (!safe_move (self.ideal_yaw + ofs, dist)) // Do this first to move! + if (flip) + self.lefty = !self.lefty; +}; + +// Adds 'fadd' to frame 'fr'. Used to animate monsters. +void(float fr, float fadd, float fmax) WalkFrame_Add = +{ + if ((self.walkframe < 0) || (self.walkframe > fmax)) + self.walkframe = 0; + self.frame = fr + self.walkframe; + self.walkframe = self.walkframe + fadd; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_enemytarget.qc b/QC_other/QC_keep/ai_enemytarget.qc new file mode 100644 index 00000000..89aaaaf8 --- /dev/null +++ b/QC_other/QC_keep/ai_enemytarget.qc @@ -0,0 +1,186 @@ +/*====================================================================== + Flying units maintain the same Z axis as their enemy targets + This makes it impossible to have flying units above the player + because the engine is constantly moving the monster downwards + + This system replaces the enemy target with a fake one which + floats above the real enemy target. This fake marker can be + seen if developer 1 is active, otherwise hidden + + The engine will track the fake enemytarget and gameplay functions + can carry on using the real enemy target for calculations + + All the gameplay functions should use these self.enemy wrappers + defined below to make sure they return the correct enemy! + +======================================================================*/ +// Detects enemytarget and returns real ENEMY angles +// Returns the correct takedamage flag, useful for function tests +float() SUB_takedEnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return (self.enemy.enemy.takedamage); + else return (self.enemy.takedamage); +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns for flags bitwise operation +// Returns the correct entity flags, useful for function tests +float(float bitflag) SUB_flagsEnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return (self.enemy.enemy.flags & bitflag); + else return (self.enemy.flags & bitflag); +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns real ENEMY angles +// Returns the correct entity angles, useful for function tests +vector() SUB_angEnemyTarget = +{ + if (!self.enemy) return VEC_ORIGIN; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy.angles; + else return self.enemy.angles; +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns real ENEMY health +// Returns the correct entity health, useful for function tests +float() SUB_healthEnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy.health; + else return self.enemy.health; +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns real ENEMY origin +// Returns the correct entity origin, useful for function tests +vector() SUB_orgEnemyTarget = +{ + if (!self.enemy) return VEC_ORIGIN; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy.origin; + else return self.enemy.origin; +}; + +//---------------------------------------------------------------------- +// Detects enemytarget and returns the real ENEMY entity +// Returns the correct entity, useful for function tests +entity() SUB_entEnemyTarget = +{ + if (!self.enemy) return world; + if (self.enemy.classtype == CT_ENEMYTARGET) return self.enemy.enemy; + else return self.enemy; +}; + +//---------------------------------------------------------------------- +// Returns TRUE if enemytarget system active +// A simple test to see if enemytarget system is active +float() SUB_EnemyTarget = +{ + if (!self.enemy) return -1; + if (self.enemy.classtype == CT_ENEMYTARGET) return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Self = monster; Will switch enemy and enemytarget around (restore) +// Its a good idea to do this when the enemytarget is out of sight +// Will restore the enemy to the ground height (useful for doorways) +void() SUB_switchEnemyTarget = +{ + if (self.enemytarget.classtype != CT_ENEMYTARGET) return; + self.enemytarget.state = STATE_OFF; + self.enemy = self.enemytarget.enemy; +}; + +//---------------------------------------------------------------------- +// Self = monster; Will remove enemytarget function safely (delete) +// The enemytarget system should take care of itself and safely delete +// This is a brute force version that will make sure, "its dead jim!" +void() SUB_removeEnemyTarget = +{ + if (self.enemytarget.classtype != CT_ENEMYTARGET) return; + self.enemytarget.state = STATE_OFF; + self.enemytarget.think = SUB_Remove; + self.enemytarget.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Function called all the time when the enemytarget is active +void() SUB_updateEnemyTarget = +{ + // OWNER DIED - Safely remove this entity + if (self.owner.health < 1) { + self.state = STATE_OFF; + self.think = SUB_Remove; + self.nextthink = time + 0.1; + } + // TARGET DIED - Stop tracking, wait for another enemy + else if (self.enemy.health < 1) { + self.state = STATE_OFF; + } + // ENEMY ACTIVE - Update position and check for height change + else if (self.state == STATE_ON) { + // Is there any random variance to the Z location? + if (self.waitmin < time && self.wait > 0) { + self.waitmin = time + self.wait + random()*self.wait; + // Check if the enemy is close? Go to maximum height if inside melee range + self.enemydist = range_distance(SUB_entEnemyTarget(), FALSE); + if (self.enemydist < MONAI_ABOVEMELEE) self.view_ofs_z = self.height; + else self.view_ofs_z = (self.height*0.25) + ((self.height*0.75) * random()); + } + + // Check for solid/sky origin content + self.lip = pointcontents(self.enemy.origin + self.view_ofs); + if (self.lip == CONTENT_SOLID || self.lip == CONTENT_SKY) { + // Traceline upwards to nearest point + traceline(self.enemy.origin, self.enemy.origin + self.view_ofs, TRUE, self); + setorigin(self,trace_endpos); + } + else setorigin(self, self.enemy.origin + self.view_ofs); + + // Next update time tick (def=0.1s) + self.think = SUB_updateEnemyTarget; + self.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void(entity targ, float zoffset, float rndtimer) SUB_setupEnemyTarget = +{ + // Don't try to get higher than other flying units + // Two monsters with the same abilty will constantly rise up + if (targ.movetype == MOVETYPE_FLY) return; + + // Create the enemytarget if one does not exist + if (!self.enemytarget) { + self.enemytarget = spawn(); + self.enemytarget.owner = self; + self.enemytarget.classtype = CT_ENEMYTARGET; + + // Show enemytarget system in devmode ONLY + if (developer > 0) { + self.enemytarget.mdl = MODEL_BROKEN; + setmodel(self.enemytarget, self.enemytarget.mdl); + } + setsize (self.enemytarget, VEC_ORIGIN, VEC_ORIGIN); + self.enemytarget.movetype = MOVETYPE_NONE; + self.enemytarget.solid = SOLID_NOT; + // Plenty of functions test for health and damage + self.enemytarget.health = LARGE_TIMER; + self.enemytarget.takedamage = DAMAGE_YES; + } + + // If attacking a monster stay up high out its way, else move up and down + if (targ.flags & FL_MONSTER) self.enemytarget.wait = 0; + else if (self.bossflag) self.enemytarget.wait = 0; + else self.enemytarget.wait = rndtimer; + + // Setup parameters and enable update routine + self.enemytarget.state = STATE_ON; + self.enemytarget.height = self.enemytarget.view_ofs_z = zoffset; + self.enemytarget.enemy = targ; + self.enemytarget.think = SUB_updateEnemyTarget; + self.enemytarget.nextthink = time + 0.1; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_fly.qc b/QC_other/QC_keep/ai_fly.qc new file mode 100644 index 00000000..96516133 --- /dev/null +++ b/QC_other/QC_keep/ai_fly.qc @@ -0,0 +1,35 @@ +void(float dist) ai_walkfly = { + local vector oldorg; + local vector reqvel; + local float d; + + oldorg = self.origin; + self.movetype = MOVETYPE_STEP; + ai_walk(dist); + d = vlen(self.origin - oldorg); + self.velocity = VEC_ORIGIN; + if (d <= dist + 5) { + self.movetype = MOVETYPE_FLY; + reqvel = normalize(self.origin - oldorg) * dist * 7; + setorigin(self, oldorg); + self.velocity = reqvel; + } +}; + +void(float dist) ai_runfly = { + local vector oldorg; + local vector reqvel; + local float d; + + oldorg = self.origin; + self.movetype = MOVETYPE_STEP; + ai_run(dist); + d = vlen(self.origin - oldorg); + self.velocity = VEC_ORIGIN; + if (d <= dist + 5) { + self.movetype = MOVETYPE_FLY; + reqvel = normalize(self.origin - oldorg) * dist * 7; + setorigin(self, oldorg); + self.velocity = reqvel; + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_gibs.qc b/QC_other/QC_keep/ai_gibs.qc new file mode 100644 index 00000000..f7d072db --- /dev/null +++ b/QC_other/QC_keep/ai_gibs.qc @@ -0,0 +1,1108 @@ +/*====================================================================== + AI GIB FUNCTIONS +======================================================================*/ +.float gibondeath; // true/false always gib on death +.vector gib_ofs; // Vertical gib origin offset (override) + +.string gib1mdl; // Gib 1 unique weapon/body part +.string gib2mdl; // Gib 2 unique weapon/body part +.string gib3mdl; // Gib 3 unique weapon/body part +.string gib4mdl; // Gib 4 unique weapon/body part +.string gib5mdl; // Gib 5 unique weapon/body part +.float gib1skin; // Special gib model unique skin no +.float gib2skin; // Special gib model unique skin no +.float gib3skin; // Special gib model unique skin no +.float gib1frame; // Frame range to randomly pick from +.float gib2frame; // Frame range to randomly pick from +.float gib3frame; // Frame range to randomly pick from +.float gib1sound; // Gib 1 - impact sound type +.float gib2sound; // Gib 2 - impact sound type +.float gib3sound; // Gib 3 - impact sound type +.vector gib1origin; // Gib 1 - Exact origin to spawn +.vector gib2origin; // Gib 2 - Exact origin to spawn +.vector gib3origin; // Gib 3 - Exact origin to spawn +.string gib1soundx; // Gib custom impact sound +.string gib2soundx; // Gib custom impact sound +.string gib3soundx; // Gib custom impact sound +.float gibtype; // What type of gibs (blood, stone, etc) +.float blockudeath; // ID udeath.wav sounds human, block it for non-humanoids +.float gib1dmg; // Special damage from touching +.float gib1exp; // Special damage particle explosion + +.float gibpartbase; // Base quantity of particle from gibs +.float gibpartrnd; // Random quantity of particles from gibs +.float gibpartlife; // Lifetime of particles from gibs +.float gibpartchance; // The % percentage chance of particles +.float gibpartstyle; // Particle style + +float GIB_IMPACT_LIGHT = 0; // Light fleshy impact (default) +float GIB_IMPACT_HEAVY = 1; // Heavy fleshy impact +float GIB_IMPACT_ACID = 5; // Fleshy acid burning sound (dangerous) +float GIB_IMPACT_STONE = 10; // Light stones dropping +float GIB_IMPACT_STONE2 = 11; // Dropping pebbles +float GIB_IMPACT_STONE3 = 12; // Dropping pebbles +float GIB_IMPACT_WOOD = 20; // Heavy crossbow/chainsaw +float GIB_IMPACT_METALA = 40; // Short metal impact +float GIB_IMPACT_METALB = 41; // Long metal impact +float GIB_IMPACT_CHAIN = 42; // Blue metal flail + +float GIBTYPE_BLOOD = 0; // Blood (default) +float GIBTYPE_STONE = 1; // Stone/rubble +float GIBTYPE_WOOD = 2; // Woodchip +float GIBTYPE_GLASS = 3; // Glass impact sounds +float GIBTYPE_METAL = 4; // Metal scraps +float GIBTYPE_POISON = 10; // Poisoned flesh +float GIBTYPE_ICE = 16; + +float MON_BCOLOR_RED = 68; // Red index colour +float MON_BCOLOR_GREEN = 52; // Green index +float MON_BCOLOR_YELLOW = 192; // Bright yellow, not gold +float MON_BCOLOR_SILVER = 36; // Silver/Ice +float MON_BCOLOR_WHITE = 4; // Grey/white + +string GIB_SOUND_HEAVY = "gibs/gibheavy1.wav"; +string GIB_SOUND_HEAVY2 = "gibs/gibheavy2.wav"; +string GIB_SOUND_METALA = "gibs/gibmetala.wav"; +string GIB_SOUND_METALB = "gibs/gibmetalb.wav"; +string GIB_SOUND_CHAIN = "gibs/gibchain.wav"; +string GIB_SOUND_WOOD = "gibs/gibwood.wav"; +string GIB_SOUND_UDEATH = "player/udeath.wav"; +string GIB_SOUND_ACID = "gibs/gibacid.wav"; +string GIB_SOUND_SDEATH = "gibs/stonedeath.wav"; + +string GIB1_BLOOD = "progs/ad171/gib_1.mdl"; +string GIB2_BLOOD = "progs/ad171/gib_2.mdl"; +string GIB3_BLOOD = "progs/ad171/gib_3.mdl"; +string GIB4_BLOOD = "progs/ad171/gib_4.mdl"; +string GIB5_BLOOD = "progs/ad171/gib_5.mdl"; + +string GIB1_STONE = "progs/ad171/gib_s1.mdl"; +string GIB2_STONE = "progs/ad171/gib_s2.mdl"; +string GIB3_STONE = "progs/ad171/gib_s3.mdl"; +string GIB4_STONE = "progs/ad171/gib_s4.mdl"; +string GIB5_STONE = "progs/ad171/gib_s5.mdl"; + +string GIB1_POISON = "progs/ad171/gib_p1.mdl"; +string GIB2_POISON = "progs/ad171/gib_p2.mdl"; +string GIB3_POISON = "progs/ad171/gib_p3.mdl"; +string GIB4_POISON = "progs/ad171/gib_p4.mdl"; +string GIB5_POISON = "progs/ad171/gib_p5.mdl"; + +string GIB1_SOUND = "gibs/gib1.wav"; +string GIB3_SOUND = "gibs/gib3.wav"; +string GIB5_SOUND = "gibs/gib5.wav"; +string GIBHIT1_SOUND = "gibs/gibhit1.wav"; +string GIBHIT2_SOUND = "gibs/gibhit2.wav"; +string GIBHIT3_SOUND = "gibs/gibhit3.wav"; +string GIBHIT4_SOUND = "gibs/gibhit4.wav"; +string GIBHIT5_SOUND = "gibs/gibhit5.wav"; +string GIBHIT1_STONESOUND = "gibs/gibstone1.wav"; +string GIBHIT3_STONESOUND = "gibs/gibstone3.wav"; +string GIBHIT5_STONESOUND = "gibs/gibstone5.wav"; +string GIBHIT1_METALSOUND = "gibs/gibmetal1.wav"; +string GIBHIT3_METALSOUND = "gibs/gibmetal3.wav"; +string GIBHIT5_METALSOUND = "gibs/gibmetal5.wav"; + +float GIB_FADETIME = 10; + +float(entity e, float heal, float ignore) T_Repair; +void Rocket_Explosion2 (vector org, float x, float y); +void MakeIcyExp (vector org); +float() M_RespawnCheck; +void(float secs) M_RespawnNextthink; + +/*====================================================================== + precache_stonegibs, precache_poisongibs + Only load extra gibs when there is a monster requiring them + There are separate gib models because of particle trail colours + These functions have to be called from monster spawn functions + The gib system tests for the global variables defined below + If the extra gibs are not active then default blood vers are used +======================================================================*/ +void() precache_stonegibs = +{ + gibstone = TRUE; + precache_model (GIB1_STONE); // New gib - arm/leg + precache_model (GIB2_STONE); // New gib - body + precache_model (GIB3_STONE); // New gib - slice + precache_model (GIB4_STONE); // New gib - small chunk/ball + precache_model (GIB5_STONE); // New gib - large chunk/ball +}; + +//---------------------------------------------------------------------- +void() precache_poisongibs = +{ + gibpoison = TRUE; + precache_model (GIB1_POISON); // New gib - arm/leg + precache_model (GIB2_POISON); // New gib - body + precache_model (GIB3_POISON); // New gib - slice + precache_model (GIB4_POISON); // New gib - small chunk/ball + precache_model (GIB5_POISON); // New gib - large chunk/ball +}; + +/*====================================================================== + DirectionForDamage + Takes the angle between self and enemy and projects backwards +======================================================================*/ +vector(float gibforce) DirectionForDamage = +{ + local vector gvel; + + // Gentle fountain, not much upward motion + if (self.max_health == MON_GIBFOUNTAIN) { + gvel_x = crandom()*100; + gvel_y = crandom()*100; + gvel_z = 100 + (100 * random()); + return gvel; + } + // Party popper version (large explosion) + else if (self.max_health == MON_GIBEXPLOSION) { + gvel_x = crandom()*250; + gvel_y = crandom()*250; + gvel_z = 400 + (100 * random()); + return gvel; + } + else if (self.max_health == MON_XYGIBVELOCITY) { + // Back to front vector so gib will travel away from enemy + gvel = vectoangles(self.origin - self.enemy.origin); + makevectors(gvel); + gvel = v_forward * (50 + (100 * random())); + gvel = gvel + (v_right * (200 * crandom())); + gvel_z = 100 + (100 * random()); + } + else if (self.max_health == MON_NOGIBVELOCITY) { + // Back to front vector so gib will travel away from enemy + gvel = vectoangles(self.origin - self.enemy.origin); + makevectors(gvel); + gvel = v_forward * (50 + (100 * random())); + gvel = gvel + (v_right * (100 * crandom())); + gvel_z = 30; + } + else { + // Back to front vector so gib will travel away from enemy + gvel = vectoangles(self.origin - self.enemy.origin); + makevectors(gvel); + gvel = v_forward * (50 + (100 * random())); + gvel = gvel + (v_right * (100 * crandom())); + gvel_z = 100 + (100 * random()); + } + + if (gibforce > -50) gvel = gvel * 1.25; + return gvel; +}; + +//====================================================================== +void() RemoveGib = +{ + // Fade away model + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() CheckFloorGib = +{ + // Is it time for the gib to fade away? + if (self.pain_finished > time) { + // Check for particles from gib + if (self.gibpartstyle > 0) { + if (random() < self.gibpartchance) { + particle_explode(self.origin, self.gibpartbase+random()*self.gibpartrnd, self.gibpartlife+random(), self.gibpartstyle, 0); + } + } + // Check floor below gib (global function) + // Origin at base of model + 16 (typical step height) + ent_floorcheck(self, FLOOR_TRACE_GIBS); + + // Keep checking + self.think = CheckFloorGib; + self.nextthink = time + 0.1; + } + else RemoveGib(); +}; + +//---------------------------------------------------------------------- +void() TouchGib = +{ + // Always check for sky and void functions first + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + + // Check if the gib can damage (only players) on touch + if (self.gib1dmg > 0 && other.flags & FL_CLIENT) { + T_Damage (other, self, self, self.gib1dmg, DAMARMOR); + self.gib1dmg = 0; + SpawnExplosion(self.gib1exp,self.origin,""); + entity_remove(self, 0.1); + return; + } + + // Check rest of touch restrictions + if (self.waitmin > time) return; // Touch function disabled + if (other == self.owner) return; // Ignore original monster + if (other.classgroup == CG_TEMPENT) return; // Ignore other temp entities + + // Block multiple touch of impact sound + self.waitmin = time + 2 + random() * 2; + + // Is there any time left to setup floor checks + if (self.pain_finished > time + 0.1) { + self.think = CheckFloorGib; + self.nextthink = time + 0.1; + } + + // stop gibs constantly touching moving func bmodels + // let the impact sound work once and then stop + if (other.classgroup == CG_FUNCMOVER) { + if (self.waitmin2 > time) return; + self.waitmin2 = LARGE_TIMER; + } + + //---------------------------------------------------------------------- + // Only need to pick the impact sound once + // No point to keep randomly picking + //---------------------------------------------------------------------- + if (self.noise == "") { + // Setup defaults for gib impact sound + self.volume = ATTN_GIB; + self.noise = SOUND_EMPTY; + + // Check first for unique impact sound + if (self.weapon > 0) { + self.volume = ATTN_NORM; + if (self.weapon == GIB_IMPACT_HEAVY) self.noise = GIB_SOUND_HEAVY; + else if (self.weapon == GIB_IMPACT_METALA) self.noise = GIB_SOUND_METALA; + else if (self.weapon == GIB_IMPACT_METALB) self.noise = GIB_SOUND_METALB; + else if (self.weapon == GIB_IMPACT_CHAIN) self.noise = GIB_SOUND_CHAIN; + else if (self.weapon == GIB_IMPACT_WOOD) self.noise = GIB_SOUND_WOOD; + else if (self.weapon == GIB_IMPACT_ACID) self.noise = GIB_SOUND_ACID; + } + // Check default gib impact types (stone, metal, blood) + else { + if (self.gibtype == GIBTYPE_STONE) { + self.lip = random() * 3; + if (self.lip < 1) self.noise = GIBHIT1_STONESOUND; + else if (self.lip < 2) self.noise = GIBHIT3_STONESOUND; + else self.noise = GIBHIT5_STONESOUND; + } + else if (self.gibtype == GIBTYPE_METAL) { + self.lip = random() * 3; + if (self.lip < 1) self.noise = GIBHIT1_METALSOUND; + else if (self.lip < 2) self.noise = GIBHIT3_METALSOUND; + else self.noise = GIBHIT5_METALSOUND; + } + else { + self.lip = random() * 5; + if (self.lip < 1) self.noise = GIBHIT1_SOUND; + else if (self.lip < 2) self.noise = GIBHIT2_SOUND; + else if (self.lip < 3) self.noise = GIBHIT3_SOUND; + else if (self.lip < 4) self.noise = GIBHIT4_SOUND; + else self.noise = GIBHIT5_SOUND; + } + } + } + + // Has any impact sounds been defined? + if (self.noise != "") sound(self, CHAN_VOICE, self.noise, 1, self.volume); +}; + +//---------------------------------------------------------------------- +void(entity gibent) DPP_blood_trail = +{ + // Cannot add particle trails to the player! + if (gibent.flags & FL_CLIENT) { + dprint("\b[GIB]\b Cannot add particle trail to player!\n"); + return; + } + + // Stone = dark black dust on the floor + if (gibent.gibtype == GIBTYPE_STONE) { + gibent.traileffectnum = particleeffectnum(DPP_TRSBLOOD); + } + // Glowing green blobs splashed about + else if (gibent.gibtype == GIBTYPE_POISON) { + gibent.traileffectnum = particleeffectnum(DPP_TRPBLOOD); + } + else { + // Typical blood stains (20% chance of more blood) + if (random() < 0.2) gibent.traileffectnum = particleeffectnum(DPP_ITSBLOOD); + else gibent.traileffectnum = particleeffectnum(DPP_TRBLOOD); + } +}; + +//====================================================================== +// ThrowGib was originally in player.qc (moved here instead) +// Spawns a gib model and throws it up into the air to bounce around +//====================================================================== +void(float gib_no, float gib_qty) ThrowGib = +{ + + while (gib_qty > 0) { + gibitem = spawn(); + gibitem.owner = self; + gibitem.classname = "item_gib"; + gibitem.classtype = CT_TEMPGIB; + gibitem.classgroup = CG_TEMPENT; + gibitem.frame = gibitem.skin = 0; + + // Check for any touch/contact damage / explosions + if (self.gib1dmg > 0) gibitem.gib1dmg = self.gib1dmg; + if (self.gib1exp > 0) gibitem.gib1exp = self.gib1exp; + + // Setup gib type (particle trail) + if (self.gibtype) gibitem.gibtype = self.gibtype; + + // Create extra blood particles for DP engine + if (ext_dppart) DPP_blood_trail(gibitem); + + // Arm/leg joint (small) + if (gib_no == 1) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB1_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB1_POISON; + else gibitem.mdl = GIB1_BLOOD; + } + // Torso (large lump) + else if (gib_no == 2) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB2_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB2_POISON; + else gibitem.mdl = GIB2_BLOOD; + } + // Slice (large and wedge like) + else if (gib_no == 3) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB3_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB3_POISON; + else gibitem.mdl = GIB3_BLOOD; + } + // Blob (small and round) + else if (gib_no == 4) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB4_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB4_POISON; + else gibitem.mdl = GIB4_BLOOD; + } + // Blob (large and round) + else if (gib_no == 5) { + if (self.gibtype == GIBTYPE_STONE && gibstone) gibitem.mdl = GIB5_STONE; + else if (self.gibtype == GIBTYPE_POISON && gibpoison) gibitem.mdl = GIB5_POISON; + else gibitem.mdl = GIB5_BLOOD; + } + // Custom Gib (defined by monster) + else if (gib_no == 11) { + // Check for custom model, skin and frame + gibitem.mdl = self.gib1mdl; + gibitem.weapon = self.gib1sound; + if (self.gib1skin > 0) gibitem.skin = self.gib1skin; + if (self.gib1frame) gibitem.frame = rint(random()*self.gib1frame); + if (self.gib1origin) gibitem.oldorigin = self.gib1origin; + + // Check for any particles setup on gib + if (self.gibpartstyle > 0) { + if (self.gibpartbase > 0) gibitem.gibpartbase = self.gibpartbase; + else gibitem.gibpartbase = 1; + if (self.gibpartrnd > 0) gibitem.gibpartrnd = self.gibpartrnd; + else gibitem.gibpartrnd = 1; + if (self.gibpartlife > 0) gibitem.gibpartlife = self.gibpartlife; + else gibitem.gibpartlife = 0.5; + if (self.gibpartchance > 0) gibitem.gibpartchance = self.gibpartchance; + else gibitem.gibpartchance = 0.5; + gibitem.gibpartstyle = self.gibpartstyle; + } + } + // Custom Gib (defined by monster) + else if (gib_no == 12) { + // Check for custom model, skin and frame + gibitem.mdl = self.gib2mdl; + gibitem.weapon = self.gib2sound; + if (self.gib2skin > 0) gibitem.skin = self.gib2skin; + if (self.gib2frame) gibitem.frame = rint(random()*self.gib2frame); + if (self.gib2origin) gibitem.oldorigin = self.gib2origin; + } + // Custom Gib (defined by monster) + else if (gib_no == 13) { + // Check for custom model, skin and frame + gibitem.mdl = self.gib3mdl; + gibitem.weapon = self.gib3sound; + if (self.gib3skin > 0) gibitem.skin = self.gib3skin; + if (self.gib3frame) gibitem.frame = rint(random()*self.gib3frame); + if (self.gib3origin) gibitem.oldorigin = self.gib3origin; + } + // Extra Custom Gib (just models, no paramters) + else if (gib_no == 14) gibitem.mdl = self.gib4mdl; + else if (gib_no == 15) gibitem.mdl = self.gib4mdl; + else if (gib_no == GIBTYPE_ICE) gibitem.mdl = "progs/drake/ice_cube.mdl"; + // Special head gib (based on headmdl and skin no) + else if (gib_no == 25) { + gibitem.mdl = self.headmdl; + gibitem.skin = self.skin; + } + + // Bounce like a grenade have trigger/touch impact + gibitem.movetype = MOVETYPE_BOUNCE; + gibitem.solid = SOLID_TRIGGER; + + setmodel (gibitem, gibitem.mdl); + setsize (gibitem, VEC_ORIGIN, VEC_ORIGIN); + + // 10 frames of different pose/sizes for regular gibs + if (gib_no < 10) gibitem.frame = rint(random()*9); + + // Special head gib (plenty of upward motion) + if (gib_no == 25) { + gibitem.oldorigin = self.origin; + setorigin(gibitem, gibitem.oldorigin); + + gibitem.velocity_x = 50 * crandom(); + gibitem.velocity_y = 50 * crandom(); + gibitem.velocity_z = 200 + 100 * random(); + + gibitem.avelocity = '0 0 0'; + gibitem.avelocity_y = 200 + random() * 200; + gibitem.angles_y = gibitem.ideal_yaw = random() * 360; + } + else { + //---------------------------------------------------------------------- + // Spawn gib inside of owner model volume instead of from a single point + // Not used anymore, does not cope very well with larger bound boxes + //gibitem.oldorigin_x = self.absmin_x + random()*(self.maxs_x - self.mins_x); + //gibitem.oldorigin_y = self.absmin_y + random()*(self.maxs_y - self.mins_y); + //gibitem.oldorigin_z = 16 + (random()*12) + self.origin_z; + + //---------------------------------------------------------------------- + // This version copes with taller enemies by using all of the bounding box + if (CheckZeroVector(gibitem.oldorigin)) + gibitem.oldorigin = self.origin + self.gib_ofs + crandom()*self.maxs; + setorigin(gibitem, gibitem.oldorigin); + + //---------------------------------------------------------------------- + // NEW Directional gib velocity with modifier + gibitem.velocity = DirectionForDamage(self.health); + gibitem.angles_y = gibitem.ideal_yaw = random() * 360; + if (gib_no < 10) gibitem.avelocity = vecrand(100,200,FALSE); + else gibitem.avelocity = crandom() * '0 300 0'; + } + + //---------------------------------------------------------------------- + // Check for water content, adjust for water friction + if (pointcontents(gibitem.oldorigin) == CONTENT_WATER) { + gibitem.gravity = 0.35; + gibitem.velocity_z = 0; + } + + gibitem.touch = TouchGib; + gibitem.nextthink = time + GIB_FADETIME + random() * GIB_FADETIME; + gibitem.pain_finished = gibitem.nextthink; + gibitem.think = RemoveGib; + + gib_qty = gib_qty - 1; + } +}; + +//====================================================================== +// Explode monster into a shower of gibs (throw head as well) +//====================================================================== +void() monster_ThrowGib = +{ + self.gibbed = TRUE; // Monster has offically gone to pieces ;) + + //---------------------------------------------------------------------- + // New set of gib sounds - gib1, gib3, gib5 + // FIXME - Sadly the source for these files is UT :( + // Zombies have special gib sound because they always go that way! + // Stone enemies are just a pile of rubble and dust! + //---------------------------------------------------------------------- + if (self.classgroup == CG_ZOMBIE) + sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); + else if (self.gibtype == GIBTYPE_STONE) + sound(self, CHAN_VOICE, GIB_SOUND_SDEATH, 1, ATTN_NORM); + else { + self.lip = random() * 4; + if (self.lip < 1) sound (self, CHAN_VOICE, GIB1_SOUND, 1, ATTN_NORM); + else if (self.lip < 2) sound (self, CHAN_VOICE, GIB3_SOUND, 1, ATTN_NORM); + else { + // Is the monster humanoid? (udeath is the original id gib sound) + if (self.blockudeath) sound (self, CHAN_VOICE, GIB5_SOUND, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, GIB_SOUND_UDEATH, 1, ATTN_NORM); + } + } + + // Some monsters have special death setups + //---------------------------------------------------------------------- + if (self.th_gibdie) { self.th_gibdie(); return; } + + //---------------------------------------------------------------------- + // If any special gib models defined, throw them + //---------------------------------------------------------------------- + if (self.gib1mdl != "") ThrowGib(11, 1); + if (self.gib2mdl != "") ThrowGib(12, 1); + if (self.gib3mdl != "") ThrowGib(13, 1); + + //---------------------------------------------------------------------- + // Work through each monster type (default = humanoid) + // GIB 1 - arm/leg (small) + // GIB 2 - torso (large) + // GIB 3 - slice (medium) + // GIB 4 - blob (small) + // GIB 5 - blob (medium) + //---------------------------------------------------------------------- + if (self.classtype == CT_MONDEMON) { + ThrowGib(4, 1 + rint(random()*2)); + ThrowGib(5, 3 + rint(random()*2)); + } + else if (self.classtype == CT_MONDROLE) { + ThrowGib(4, 2 + rint(random()*2)); + ThrowGib(5, 4 + rint(random()*2)); + } + else if (self.classtype == CT_MONDOG) { + ThrowGib(4, 1 + rint(random()*3)); + ThrowGib(5, 1 + rint(random()*2)); + } + else if (self.classtype == CT_MONWRAITH) { + ThrowGib(4, 3 + rint(random()*2)); + } + else if (self.classtype == CT_MONSHAL) { + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classtype == CT_MONGOLEM) { + ThrowGib(11, 4 + rint(random()*2)); + ThrowGib(12, 8 + rint(random()*2)); + } + else if (self.classtype == CT_MONSCORPION) { + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*2)); + } + // Includes brown/green spiders and vorelings + else if (self.classgroup == CG_SPIDER) { + ThrowGib(4, rint(random()*3)); + ThrowGib(11, rint(random()*2)); + } + else if (self.classgroup == CG_FISH) { + ThrowGib(4, 3 + rint(random()*3)); + ThrowGib(5, 1); + } + else if (self.classtype == CT_MONBOIL) { + ThrowGib(3, 1 + rint(random()*2)); + ThrowGib(4, 4 + rint(random()*2)); + ThrowGib(4, 5 + rint(random()*3)); + } + else if (self.classgroup == CG_ZOMBIE) { + ThrowGib(4, 3 + rint(random()*2)); + } + // Includes vanilla and new hunter ogres + else if (self.classgroup == CG_OGRE) { + ThrowGib(4, 1 + rint(random()*3)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classgroup == CG_DCAPTAIN) { + ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + } + else if (self.classtype == CT_MONGARGOYLE) { + ThrowGib(4, 2 + rint(random()*3)); + ThrowGib(5, 1 + rint(random()*2)); + } + else if (self.classtype == CT_MONGAUNT) { + ThrowGib(4, 3 + rint(random()*2)); + ThrowGib(5, 2 + rint(random()*2)); + } + else if (self.classtype == CT_MONWIZARD) { + ThrowGib(4, 1 + rint(random()*3)); + } + else if (self.classtype == CT_MONSHAM) { + ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + } + else if (self.classtype == CT_MONBOGLORD) { + ThrowGib(11, 1); // Claw 1 + ThrowGib(12, 1); // Claw 2 + ThrowGib(13, 1); // Foot 1 + ThrowGib(14, 1); // Foot 2 + ThrowGib(4, 5 + rint(random()*5)); + ThrowGib(5, 10 + rint(random()*10)); + } + else if (self.classtype == CT_MONMINOTAUR) { + ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + } + // Default humanoid explosion + else { + if (random()<0.5) ThrowGib(2, 2); + else ThrowGib(3, 1); + ThrowGib(4, 2 + rint(random()*4)); + } + + //---------------------------------------------------------------------- + // Throw head last because all previous gibs rely on the origin + //---------------------------------------------------------------------- + if (self.headmdl != "") { + // If monster set for low velocity throw extra gibs instead + if (self.max_health == MON_NOGIBVELOCITY) + ThrowGib(4, rint(random()*4)); + // Throw a head gib instead of switch to one + else ThrowGib(25, 1); + } + // Finally hide monster + entity_hide (self); +}; + +//====================================================================== +// Check health for gib condition +//====================================================================== +void() monster_check_gib = +{ + // There are always exceptions to the every rule! + // Spawns=Explode, Wraith=Explode, Jim=Explode + // SkullWiz=Fade away, Lost Souls=Explode + if (self.gibhealth == MON_NEVERGIB) return; + if (self.touchedvoid) { entity_hide(self); return; } + + // Can only gib a monster once! + if (self.gibbed) return; + if ( self.health < (self.gibhealth + 1) || self.gibondeath) + monster_ThrowGib(); +}; + +float() Gib_NearCeiling = +{ + local vector add, vec; + + add = '0 0 56'; // 32 + 24 + vec = self.origin; + traceline (vec, vec + add, TRUE, self); + if (trace_fraction < 1) + return TRUE; + if (pointcontents (vec + add) == CONTENT_SKY) + return TRUE; // Since sky tends to be flat, make one check for it. + vec = self.origin + '16 16 0'; + traceline (vec, vec + add, TRUE, self); + if (trace_fraction < 1) + return TRUE; + vec = self.origin + '-16 16 0'; + traceline (vec, vec + add, TRUE, self); + if (trace_fraction < 1) + return TRUE; + vec = self.origin + '-16 -16 0'; + traceline (vec, vec + add, TRUE, self); + if (trace_fraction < 1) + return TRUE; + vec = self.origin + '16 -16 0'; + traceline (vec, vec + add, TRUE, self); + if (trace_fraction < 1) + return TRUE; + return FALSE; +}; + +// Checks if gib should be eaten. TRUE = yes. +float() Gib_Eaten = +{ + if (other.health <= 0) + return 0; // Dead. + if (!(other.xfl & XFL_GHOUL)) + return 0; // Can't eat gibs. + if (self.healamount < 1) + return 0; // Gib has no food value. + + local float leave; + + leave = 1; + if (other.form_active) + { // Note: Morphed clients use armorvalue as health. + if (T_Repair (other, self.healamount, FALSE)) // armor + leave = 0; + } + else + { + if (T_Heal (other, self.healamount, FALSE)) // health + leave = 0; + } + + if (other.xfl & XFL_HUNGRY == 0) + { + if (leave) + return 0; + } + // ELSE... It's hungry, eat it anyway! +//- - - - - - - - - +// FIXME: Experimental code for vomitus. +// if (other.enemy == self) +// {other.enemy = world; other.gorging = FALSE;} +//- - - - - - - - - + +// Do the eating effects. + if (self.tronyn) { + // The big crunch when eating a head! + sound (other, CHAN_ITEM, "cube/bc_gulp.wav", 1, ATTN_NORM); + + // Throw some meat chunks. + local float gibs; + local vector vec; + + gibs = 3; + while (gibs > 0) { + vec_x = 200 * (random() - 0.5); + vec_y = 200 * (random() - 0.5); + vec_z = 0; + SpawnMeatSprayDrake (self.origin, vec, self.bloodtype); + gibs = gibs - 1; + } + + // Removing head now can wreck links. Do it next frame. + //Burn_Null (self); + self.solid = SOLID_NOT; + self.touch = SUB_Null; + self.use = SUB_Null; + self.targetname = ""; + // Remove! + self.nextthink = 0.01; + self.think = SUB_Remove; + } else { + sound (other, CHAN_ITEM, "cube/bc_attck.wav", 1, ATTN_NORM); + remove (self); + } + Safe_stuffcmd (other, "bf\n"); + return 1; +}; + +// Called when the gib is touched by something. +void() Gib_Touch = { + if (Gib_Eaten ()) // This may remove self if TRUE. + return; + if (!self.volume) + return; + +// Rest of the code here should be used only by gibs spawned by a fountain. + if (self.velocity == '0 0 0') { + self.avelocity = '0 0 0'; + self.attack_finished = 0; // Prevent any more plopping. + self.nextthink = time + 2 + random()*6; + return; + } + + if (self.volume < time) + if (pointcontents(self.origin) == CONTENT_EMPTY) { // Bounce sound + sound (self, CHAN_AUTO, "gibfnt/gf_plop.wav", 1, ATTN_NORM); + self.volume = time + 0.3; + } +}; + +/* +void() Gib_Burn = +{ + self.lefty = !self.lefty; + if (self.lefty) + {if (!VecInWater (self.origin)) MakeFlame (self);} + else + MakeSmoke (self.origin, 5); + + self.alpha = self.alpha - 0.05; + if (self.alpha <= 0.001) + remove (self); + else + self.nextthink = time + 0.1; +}; +*/ + +void() Gib_Melt = +{ + if (self.frame >= 3) + {remove (self); return;} + self.frame = self.frame + 1; + self.alpha = self.alpha - 0.1; + self.nextthink = time + self.lefty + random()*self.lefty; +}; + +//- - - - - - - - - +// This is the all-purpose function for spawning a gib. +// All references to the entity self were eliminated here. +// +// -- Arguments -- +// org = Point where the gib spawns. +// gibname = Filename used by gib entity. +// vel = Velocity of the gib. +// spin = Angle velocity or spin speed of the gib. +// gibskin = Speaks for itself, used by Qtest Dragons. +// gibframe = Ditto. +// heal = Gib can be eaten if TRUE. +// fast = Make gib disappear faster if TRUE. +//- - - - - - - - - +void(vector org, string gibname, vector vel, vector spin, float gibskin, + float gibframe, float heal, float fast) Gib_Spawn = +{ + local entity new; + + new = spawn(); + setorigin (new, org); + setmodel (new, gibname); + setsize (new, '0 0 0', '0 0 0'); + + new.velocity = vel; + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + if (heal) + { + new.solid = SOLID_TRIGGER; // So 'findradius' detects this. + new.healamount = 5; // Gives health if consumed. + new.tronyn = 0; // Normal eating effects. + new.flags = FL_ITEM; // Make it easier to pick up. + new.touch = Gib_Touch; + } + new.xf2 = XF2_QUAKE; + new.volume = 0; + new.avelocity = spin; + new.think = SUB_Remove; + new.ltime = time; + if (fast) + { + if (fast == -1) + { // Blood fountain gib. + new.volume = time; + new.nextthink = time + 6; + } + //else if (fast == -2) + //{ // Burning gib. + // heal = 0; // Bloodcube can't eat meat on fire. + // new.nextthink = time + 0.1; + // new.think = Gib_Burn; + // new.alpha = 1; + //} + else + new.nextthink = time + 2 + random()*2; + } + else if (gibname == "progs/drake/ice_cube.mdl") + { // FIXME: Messy -- rewrite ice hack to something cleaner. + if (fast) + new.lefty = 0.5; + else + new.lefty = 2.5; + new.nextthink = time + new.lefty + random()*new.lefty; + new.think = Gib_Melt; + new.alpha = 1; + new.frame = 0; + } + else + new.nextthink = time + 10 + random()*10; + new.frame = gibframe; + new.skin = gibskin; + new.flags = 0; + + //if (heal) + //Gib_FeedCube (new); +}; + +//- - - - - - - - - +// Temporary touch function for heads. +void() Head_Touch = { + //if (self.tronyn) // Confirm it's a head. + // if (Gib_Eaten ()) // Head will be removed at next tic if TRUE. + //Pets_Free (self); +}; + +// Removes heads after a delay if necessary. +void() Head_SetThink = +{ + // Set cleanup time if necessary. + if (self.spawned) + { // Remove summoned critters quickly to make room for more. + self.nextthink = time + 4 + random()*4; + self.think = SUB_Remove; + } + else if (M_RespawnCheck ()) + { + M_RespawnNextthink (0); + } + else + { + //if (corpse_removal) { + self.nextthink = time + 20 + random()*10; + self.think = SUB_Remove; + //} + //else + //{ self.nextthink = -1; + // self.think = SUB_Null; + //} + } +}; + +// Delayed function for heads. +void() Head_Think = +{ + Head_SetThink (); + //if (self.flags & FL_MONSTER) + //Pets_Free (self); // Make sure this isn't done during T_Damage. + if (self.touch == Head_Touch) + { // Pets_Free was done here, but moved up in case of inedible head. + self.touch = Gib_Touch; + } +}; + +//- - - - - - - - - +// This is the all-purpose function for turning self into a head gib. +// +// Arguments here are used in the same manner as in Gib_Spawn. +//- - - - - - - - - +void(string gibname, vector vel, vector spin, float gibskin, float gibframe, + float heal) Gib_Head = +{ + local float lo; + + lo = self.mins_z; // Usually -24. Higher for spiders. + + setmodel (self, gibname); + self.frame = gibframe; + self.skin = gibskin; + if (self.classname == "player") + { // Never remove a client's head! + heal = 0; // Don't let cannibals eat the head either! + self.nextthink = -1; + self.think = SUB_Null; + } + else + { + if (self.deadflag < DEAD_DEAD) + self.deadflag = DEAD_DEAD; + if (self.flags & FL_MONSTER) + { // We can't release pets now because that may cause T_Damage loop. + // We must delay pet release for another frame so we don't crash. + self.nextthink = 0.01; + self.think = Head_Think; + //monster_item_drop (); // Update 9/4/09: Check for special drop. + } + else + Head_SetThink (); + } + self.movetype = MOVETYPE_BOUNCE; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + if (heal) + { + // FIXME: Is changing the head's solid to trigger safe? + // Make the head a trigger solid so others can find and eat it. + self.volume = 0; + self.solid = SOLID_TRIGGER; + self.healamount = 5; // Gives health if consumed. + // Can't use .style, which is used as secondary spawnflags. + // FIXME: Use something other than .tronyn. + self.tronyn = 1; // Alternate eating effects. Was .style. + // Monsters cannot use Gib_Touch until after pets are released. + if (self.flags & FL_MONSTER) + self.touch = Head_Touch; + else + self.touch = Gib_Touch; + // NOTE: No need to set FL_ITEM to heads. + } + self.view_ofs = '0 0 8'; +// I am not fond of the head moved at self's feet, but I see it done +// that way because of Quake's infernal way of moving and clip entities +// against bsps. Namely Quake uses only three bbox sizes to clip entities. +// Note: Assumes self has a size at least as big as VEC_HULL_xxx. + setsize (self, '-16 -16 0', '16 16 56'); + self.velocity = vel; + if (Gib_NearCeiling ()) // Don't move head unless necessary. + self.origin_z = self.origin_z + lo; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.avelocity = spin; + self.volume = 0; // So head won't plop on contact. + +// Now gibbed, so change to a null function to stop the possibility +// of multiple gibbings. Update: And stop resurrection. +// (Note: Should've been done in combat.qc but just in case it hasn't...) + self.gibbed = TRUE; + self.gorging = TRUE; // Don't let gremlin eat the head. + + // Don't send head to cube immediately -- the fields are needed for + // other things, such as properly triggering events. +}; + +// All-purpose support function for throwing gibs, rubble, etc. +void(string gibname, float dm, float gibflags) ThrowIt = +{ + local float gibskin, gibframe, heal, fast; + local vector org, vel, spin; + + heal = gibflags & GIB_EAT; + gibskin = gibframe = 0; + if (gibflags & GIB_SKIN_MATCH) + gibskin = self.skin; + +// Calculate gib velocity. + if (gibflags & GIB_DMV) + { // Add some of the damage velocity to the gib. + // Full speed is too fast, so use 25-50%. + vel = damage_velocity * 0.25; // FIXME: Make sure dmv is defined. + if (vel_z < 0) + vel_z = 0; // Gibs always go up. + vel = vel + VelocityForDamage (dm); + } + else + vel = VelocityForDamage (dm); + +// Check if it is a head or normal gib. + if (gibflags & GIB_HEAD) + { + if (self.maxs_x > 96) + heal = FALSE; // Too big to eat. + gibskin = self.skin; + spin = crandom() * '0 600 0'; + Gib_Head (gibname, vel, spin, gibskin, gibframe, heal); + return; // We are done here. + } + +// Find the spawn point for the gib. + if (gibflags & (GIB_BODY_HALF | GIB_BODY_FULL)) + { + spin = self.size * 0.5; + org = Midpoint (self); + org_x = org_x + crandom() * spin_x; + org_y = org_y + crandom() * spin_y; + if (gibflags & GIB_BODY_FULL) + org_z = org_z + crandom() * spin_z; + else + org_z = org_z - random() * spin_z; // Use only the lower half. + } + else + org = self.origin; + +// Calculate gib spin (angle velocity). + spin_x = random()*600; + spin_y = random()*600; + spin_z = random()*600; + +// Got all the info, so call the gib spawning function. + if (gibflags & GIB_BURN) + fast = -2; + else + fast = self.spawned; + Gib_Spawn (org, gibname, vel, spin, gibskin, gibframe, heal, fast); +}; + +void(string gibname, float dm) ThrowJunk = // This throws an inedible gib. + { ThrowIt (gibname, dm, 0); }; + +//========================================================================== +// Ice +// If TRUE, self explodes into ice chunks, one of which is a head gib. +float() Shattered = { + if (self.deathtype != "frozen") + return FALSE; + + // Since this is called during T_Damage, don't invoke more damage calls here. + // In other words, don't call T_RadiusDamage for colateral damage. + sound (self, CHAN_VOICE, "weapons/shatter.wav", 1, ATTN_NORM); + Rocket_Explosion2 (self.origin, 32, 16); + // Icy shockwave here would be over-the-top, so don't make one. + MakeIcyExp (self.origin); + + ThrowGib(GIBTYPE_ICE,3); + self.skin = 0; + return TRUE; +}; + +// Okay, this has nothing to do with ice. +// This should return TRUE if the monster died from holy damage. +// Nothing causes holy damage at the moment (though Mjolnir should). +//float() Dispelled = +//{ +// return FALSE; +//}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_gibskeep.qc b/QC_other/QC_keep/ai_gibskeep.qc new file mode 100644 index 00000000..973249cb --- /dev/null +++ b/QC_other/QC_keep/ai_gibskeep.qc @@ -0,0 +1,53 @@ +void() monster_death_postcheck; + +//====================================================================== +// StartGib function for Rogue Overlord Wrath +//====================================================================== +entity (string gibname) StartGib = { + local entity new; + + new = spawn (); + new.origin = self.origin; + setmodel (new,gibname); + setsize (new,VEC_ORIGIN,VEC_ORIGIN); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = ((time + 10) + (random () * 10)); + new.frame = FALSE; + new.flags = FALSE; + return (new); +}; + +//---------------------------------------------------------------------- +void() ThrowHead = { + setmodel (self, self.headmdl); + self.frame = 0; + self.nextthink = -1; + self.movetype = MOVETYPE_BOUNCE; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + // Hide the entity if it hits void, don't remove it + self.classgroup = CG_MISCENT; + self.view_ofs = '0 0 8'; + setsize (self, '-16 -16 0', '16 16 32'); + + self.velocity_x = 50 * crandom(); + self.velocity_y = 50 * crandom(); + self.velocity_z = 200 + 100 * random(); + + self.avelocity = '0 0 0'; + self.avelocity_y = 200 + random() * 200; + self.angles_y = self.ideal_yaw = random() * 360; + + //---------------------------------------------------------------------- + // Check for water content, adjust for water friction + if (pointcontents(gibitem.oldorigin) == CONTENT_WATER) { + gibitem.gravity = 0.25; + gibitem.velocity_z = 50 + 50 * random(); + } + + self.flags = self.flags - (self.flags & FL_ONGROUND); + monster_death_postcheck(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_minions.qc b/QC_other/QC_keep/ai_minions.qc new file mode 100644 index 00000000..7b1c28e0 --- /dev/null +++ b/QC_other/QC_keep/ai_minions.qc @@ -0,0 +1,267 @@ +/*====================================================================== + MINIONS FUNCTIONS + + Minion Support functions + Setup and update minion counters centralized to reduce errors + monster_death_precheck remove from the counter (dying event) + minion_voreling, minion_spider add to the counter (spawn event) + +======================================================================*/ + +.float minion_baseattack; // Block base attack within melee range +.float minion_count; // Current active amount of minions +.float minion_maxcount; // Maximum amount of active minions +.float minion_trigger; // Spawn counter for trigger event +.float minion_maxtrigger; // Spawn total for trigger event +.string miniontarget; // targetname string for trigger event +.float minion_throwspeed; // Starting forward speed of ball +.float minion_throwextra; // Extra random forward speed of ball +.float minion_throwside; // Extra sideways momentum (+/-) +.entity minion_test; // Test entity for minion collision +float MIN_MAXACTIVE = 5; // Maximum amount active at once +float MIN_MAXTRIGGER = 5; // How many spawns before triggering +float MIN_THROWSPD = 200; // Monster jump speed +float MIN_THROWRND = 50; // Some randomness +float MIN_THROWSIDE = 50; // Sideways movement (+/-) + +void(vector org, vector dir, vector avel, float proj_type) Launch_Grenade; + +//---------------------------------------------------------------------- +void() setup_minionsupport = +{ + // Reset all counters + self.minion_active = TRUE; + self.minion_count = 0; + self.minion_trigger = 0; + + // Setup default max counters (check for existing values) + if (!self.minion_maxcount) self.minion_maxcount = MIN_MAXACTIVE; + if (!self.minion_maxtrigger) self.minion_maxtrigger = MIN_MAXTRIGGER; + + // Chance to fire original (base) attack of monster + if (!self.minion_baseattack) self.minion_baseattack = TRUE; + + // Throw speed of minion ball/egg + if (!self.minion_throwspeed) self.minion_throwspeed = MIN_THROWSPD; + if (!self.minion_throwextra) self.minion_throwextra = MIN_THROWRND; + if (!self.minion_throwside) self.minion_throwside = MIN_THROWSIDE; +}; + +//---------------------------------------------------------------------- +void(entity msource, float countupd) update_minioncount = +{ + if (!msource.minion_active) return; + // Add to the active minion counters (check range limits) + msource.minion_count = msource.minion_count + countupd; + if (msource.minion_count < 0) msource.minion_count = 0; + if (msource.minion_count > msource.minion_maxcount) + msource.minion_count = msource.minion_maxcount; + + // Check for trigger events (ignore death triggers) + if (countupd > 0) { + msource.minion_trigger = msource.minion_trigger + countupd; + if (msource.minion_trigger >= msource.minion_maxtrigger) { + msource.minion_trigger = 0; + // Check for trigger event string? + if (msource.miniontarget != "") { + trigger_strs(msource.miniontarget, msource); + } + } + } +}; + +//---------------------------------------------------------------------- +// Check if anymore minions can be spawned at the moment +//---------------------------------------------------------------------- +float(entity msource) query_minionactive = +{ + if (!msource.minion_active) return NEGATIVE; + if (msource.minion_count < msource.minion_maxcount) return TRUE; + else return FALSE; +}; + +//====================================================================== +// Check if there is space to spawn a minion +// +// Version 1 - use a touch trigger to detect players +// Version 2 - use a findradius command to find players +//====================================================================== +void() delete_minionspace = { if (self.minion_test) entity_remove(self.minion_test,0.1); } +void() touch_minionspace = { if (other.flags & FL_CLIENT) self.aflag = TRUE; }; + +//---------------------------------------------------------------------- +// Touch trigger version for detecting client/players too close +//---------------------------------------------------------------------- +void(vector org, vector minspace, vector maxspace) setup_minionspace = +{ + // Create a touch trigger if one does not exist + if (!self.minion_test) self.minion_test = spawn(); + // reset all parameters + self.minion_test.movetype = MOVETYPE_NONE; + self.minion_test.solid = SOLID_TRIGGER; + setmodel(self.minion_test, MODEL_EMPTY); + self.minion_test.skin = self.minion_test.frame = 0; + self.minion_test.flags = 0; + + // Move touch trigger to correct location + setorigin(self.minion_test, org); + setsize (self.minion_test, minspace, maxspace); + // Enable touch function and reset collision flag + self.minion_test.touch = touch_minionspace; + self.minion_test.aflag = FALSE; +}; + +float() test_minionspace = +{ + // Quick exit if no touch entity exists + if (!self.minion_test) return FALSE; + + // Basic world collision test for origin/min/max of spawn + if (pointcontents(self.minion_test.origin) != CONTENT_EMPTY) return FALSE; + if (pointcontents(self.minion_test.origin+'-16 -16 -24') != CONTENT_EMPTY) return FALSE; + if (pointcontents(self.minion_test.origin+'16 16 40') != CONTENT_EMPTY) return FALSE; + + // Switch off touch function and check for collision + self.minion_test.touch = SUB_Null; + if (self.minion_test.aflag == TRUE) return FALSE; + else return TRUE; +}; + +//---------------------------------------------------------------------- +// Findradius version for detecting client/players too close +//---------------------------------------------------------------------- +float(vector org) find_minionspace = +{ + local entity minstuff; + local float foundclient; + + // Basic world collision test for origin/min/max of spawn + if (pointcontents(org) != CONTENT_EMPTY) return FALSE; + if (pointcontents(org+'-16 -16 -24') != CONTENT_EMPTY) return FALSE; + if (pointcontents(org+'16 16 40') != CONTENT_EMPTY) return FALSE; + + foundclient = TRUE; + // The player can cover crazy amount of distance very fast + // Extend radius out further to catch running players + minstuff = findradius(org, MONAI_RANGESUMMON); + while (minstuff) { + if (minstuff.flags & FL_CLIENT) { + foundclient = FALSE; + minstuff = world; + } + minstuff = minstuff.chain; + } + return foundclient; +}; + +/*====================================================================== + MINION EGGS + * Spawns a projecile (egg) at the player + * Wait for egg to bounce and settle + * Spawn (rotating) minion inside egg and then explode +======================================================================*/ +void(vector minion_org, entity minion_targ) minion_spider; +void(vector minion_org, entity minion_targ) minion_scorpion; +void(vector minion_org, entity minion_targ) minion_voreling; + +//---------------------------------------------------------------------------- +void() Explode_Egg = +{ + // Remove egg and throw gibs up as minion grows + setmodel (self, ""); + if (self.classgroup == CT_MONWRAITH) self.gib1mdl = MODEL_PROJ_WSHELL; + else if (self.classgroup == CT_MONSHAL) self.gib1mdl = MODEL_PROJ_SSHELL; + self.gib1frame = 9; + self.max_health = MON_GIBFOUNTAIN; + ThrowGib(11,rint(2+random()*4)); + + // Safely remove egg + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Once the egg has landed via Grenade Touch function +// The minion is spawned and the egg is set to explode +//---------------------------------------------------------------------- +void() Hatch_Egg = +{ + // Block this functions + if (self.state == STATE_DISABLED) return; + // Has the egg been marked for removal? + if (self.touchedvoid) return; + + // Its possible for the egg to get stuck, setup death timer + if (!self.gibbed) { + self.gibbed = TRUE; + self.attack_finished = time + 6; + } + // Egg has been stuck for too long, destroy it + if (self.attack_finished < time) { + self.state = STATE_DISABLED; + self.think = Explode_Egg; + self.nextthink = time + 0.1; + return; + } + + // Turn off touch function and any movement + self.touch = SUB_Null; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + self.velocity = '0 0 0'; + + // Check if the egg can hatch? turn on collision + // setup new bounds and extend upwards for testing + setsize (self, VEC_HULLT_MIN, VEC_HULLT_MAX); + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_TOSS; + self.oldorigin = self.origin; + self.origin_z = self.origin_z + 8; + droptofloor(); + + // Can the egg hatch yet? Solid content? + if (!walkmove(0,0) || pointcontents(self.origin) == CONTENT_SOLID) { + self.origin = self.oldorigin; + self.think = Hatch_Egg; + self.nextthink = time + 1 + random(); + self.solid = SOLID_NOT; // turn off again + return; + } + + // Setup egg ready for minion + self.state = STATE_DISABLED; + + // Setup spawn location for minion + traceline (self.origin+'0 0 128', self.origin-'0 0 256', TRUE, world); + self.oldorigin = trace_endpos + '0 0 32'; + + // Spawn minion inside of egg model + // self.owner is re-assigned to minion to avoid shell gibs interacting + if (self.owner.classtype == CT_MONWRAITH) { + if (self.owner.spawnflags & MON_WRAITH_SCORPIONS) minion_scorpion(self.oldorigin, self.enemy); + else minion_spider(self.oldorigin, self.enemy); + } + else if (self.owner.classtype == CT_MONSHAL) minion_voreling(self.oldorigin, self.enemy); + + // Skip a couple of frames + self.think = Explode_Egg; + self.nextthink = time + 0.4; +}; + +//---------------------------------------------------------------------- +// Work out direction speed of egg and then launch it! +//---------------------------------------------------------------------- +void(vector eggofs) Create_Egg = +{ + local vector org, dir; + local float egg_speed; + if (self.health < 1) return; + + // Turn towards player and drop the egg! + makevectors(self.angles); + org = self.origin + attack_vector(eggofs); + egg_speed = self.minion_throwspeed + (random() * self.minion_throwextra); + dir = (v_forward * egg_speed) + (v_right * (crandom()*self.minion_throwside)); + Launch_Grenade(org,dir,'0 0 0',CT_PROJ_MEGG); + SUB_AttackFinished (2 + random()); +}; diff --git a/QC_other/QC_keep/ai_pathcorner.qc b/QC_other/QC_keep/ai_pathcorner.qc new file mode 100644 index 00000000..49dccee8 --- /dev/null +++ b/QC_other/QC_keep/ai_pathcorner.qc @@ -0,0 +1,475 @@ +/*====================================================================== + Path_Corner FUNCTIONS +======================================================================*/ +float PATHC_EXACT = 1; // Exact route logic instead of random (def) +float PATHC_INSTANT = 2; // Instantly move to this path_corner +float PATHC_REVERSE = 4; // Train direction is reversed at this corner +float PATHC_NOPAUSE = 8; // Train does not pause on this corner + +float PATHC_RESET = 15; // Use to reset spawnflags + +float PATHC_TARGET1 = 16; // Has target been found +float PATHC_TARGET2 = 32; // Has target2 been found +float PATHC_BACKLINK = 64; // Backward path route +float PATHC_DEADEND = 128; // no targets found + +float STATE_ROUTE1 = 1; // Route 1 is the priority (forward) +float STATE_ROUTE2 = 2; // Route 2 is the priority (forward) +float STATE_ROUTE3 = 3; // Route 3 is the priority (backward) +float STATE_EXACT = 4; // Switch to exact route selection +float STATE_RANDOM = 5; // Switch to random route selection + +/*====================================================================== +/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -24) (8 8 48) EXACT INSTANT REVERSE NOPAUSE +Node based path routing system +-------- KEYS -------- +targetname : Name of current path corner +corner_event : Name of target(s) to trigger when used/touched +corner_route : Change path_corner route (1-3 routes, 4=exact, 5=random) +corner_switch: Change spawnflags REVERSE (-1=NO, 1=YES, 2=Toggle) +corner_pause : Change spawnflags NOPAUSE (-1=NO, 1=YES, 2=Toggle) +state : Starting route (1=forward, 2=alt forward, 3=backward) +target : Targetname of FORWARD route +target2 : Alternative FORWARD route +targetback : Override default BACKWARD route +wait : fixed amount of time to pause at corner (=-1 stop) +delay : random amount of time to pause at corner +alpha : Override default for visual arrows (def=0.35) +speed : Override default speed of func_train (def=100) +-------- SPAWNFLAGS -------- +EXACT : Exact route logic (def=random route choices) +INSTANT : Move instantly to this corner if next destination +REVERSE : Train direction is reversed for next corner +NOPAUSE : Train does not pause on this path corner +-------- NOTES -------- +Node based path routing system + +======================================================================*/ +entity(string arrowmdl, vector arroworg) path_corner_spawnarrow = +{ + local entity arrow; + arrow = spawn(); + arrow.owner = self; + arrow.classtype = CT_ATTACHMENT; + arrow.movetype = MOVETYPE_NONE; + arrow.solid = SOLID_NOT; + setmodel(arrow, arrowmdl); + setorigin(arrow, arroworg); + setsize(arrow, VEC_ORIGIN, VEC_ORIGIN); + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) arrow.effects = arrow.effects + EF_NOSHADOW; + + if (!self.alpha) arrow.alpha = 0.35; + else arrow.alpha = self.alpha; + return arrow; +}; + +//---------------------------------------------------------------------- +void() path_corner_updatearrow = +{ + // Is the AI pathing info turned off? + if (query_configflag(SVR_AIPATH)) return; + if ( !(self.spawnflags & PATHC_TARGET2) ) return; + + // Switch colour of arrow based on route logic + if (self.spawnflags & PATHC_TARGET1 && self.state == STATE_ROUTE1) { + if (self.attachment) self.attachment.skin = 3; + if (self.attachment2) self.attachment2.skin = 2; + if (self.attachment3) self.attachment3.skin = 0; + } + else if (self.spawnflags & PATHC_TARGET2 && self.state == STATE_ROUTE2) { + if (self.attachment) self.attachment.skin = 0; + if (self.attachment2) self.attachment2.skin = 3; + if (self.attachment3) self.attachment3.skin = 0; + } + else if (self.spawnflags & PATHC_BACKLINK && self.state == STATE_ROUTE3) { + if (self.attachment) self.attachment.skin = 0; + if (self.attachment2) self.attachment2.skin = 2; + if (self.attachment3) self.attachment3.skin = 3; + } + else { + // Default - Random logic has no route highlight + if (self.attachment) self.attachment.skin = 0; + if (self.attachment2) self.attachment2.skin = 2; + if (self.attachment3) self.attachment3.skin = 0; + } +}; + +//---------------------------------------------------------------------- +void() path_corner_setuparrow = +{ + // Is the AI pathing info turned off? + if (query_configflag(SVR_AIPATH)) return; + + // Draw back link arrow + if (self.spawnflags & PATHC_BACKLINK) { + self.attachment3 = path_corner_spawnarrow( self.mdl, self.oldorigin); + self.movedir = normalize(self.movetarget3.oldorigin - self.oldorigin); + self.attachment3.angles = vectoangles(self.movedir); + } + // Missing backlink, this is a bad situation! + // Highlight this problem with a pointing up RED arrow + else { + // There is no back link, so use forward target instead + if (self.spawnflags & PATHC_TARGET1) self.oldenemy = self.movetarget; + else self.oldenemy = self; + self.attachment3 = path_corner_spawnarrow( self.mdl, self.oldorigin); + self.movedir = normalize(self.oldenemy.oldorigin - self.oldorigin); + self.attachment3.angles = vectoangles(self.movedir); + self.attachment3.skin = 4; + makevectors(self.movedir); + self.attachment3.angles = self.attachment3.angles + vectoangles(v_up); + } + + // Draw route choice 1 (target) + if (self.spawnflags & PATHC_TARGET1) { + self.attachment = path_corner_spawnarrow( self.headmdl, self.oldorigin); + self.movedir = normalize(self.movetarget.oldorigin - self.oldorigin); + self.attachment.angles = vectoangles(self.movedir); + } + // Missing forward link (deadend), this is a bad situation + // Highlight this problem with a pointing up RED arrow + else { + // There is no forward link, so use back link instead + if (self.spawnflags & PATHC_BACKLINK) self.oldenemy = self.movetarget3; + else self.oldenemy = self; + self.attachment = path_corner_spawnarrow( self.headmdl, self.oldorigin); + self.movedir = normalize(self.oldenemy.oldorigin - self.oldorigin); + self.attachment.angles = vectoangles(self.movedir); + self.attachment.skin = 4; + makevectors(self.movedir); + self.attachment.angles = self.attachment.angles + vectoangles(v_up); + } + + // Draw route choice 2 (target2) + if (self.spawnflags & PATHC_TARGET2) { + self.attachment2 = path_corner_spawnarrow( self.headmdl, self.oldorigin); + self.movedir = normalize(self.movetarget2.oldorigin - self.oldorigin); + self.attachment2.angles = vectoangles(self.movedir); + self.attachment2.skin = 2; + } + + // Update arrows if route logic active + path_corner_updatearrow(); +}; + +//---------------------------------------------------------------------- +void() path_corner_setuptargets = +{ + local entity fdest; + + // Cycle through list for TARGET path_corner + if (self.target != "") { + fdest = find (world, targetname, self.target); + while(fdest) { + if (fdest.classtype == CT_PATHCORNER) { + // Update (spawnflags) path_corner and save entity + self.spawnflags = self.spawnflags | PATHC_TARGET1; + self.movetarget = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.target); + } + } + // Cycle through list for TARGET2 path_corner + if (self.target2 != "") { + fdest = find (world, targetname, self.target2); + while(fdest) { + if (fdest.classtype == CT_PATHCORNER) { + // Update (spawnflags) path_corner and save entity + self.spawnflags = self.spawnflags | PATHC_TARGET2; + self.movetarget2 = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.target2); + } + } + + // Has the path corner back link override key been used? + // If this override string does not exist, weird things will happen + if (self.targetback != "") { + fdest = find (world, targetname, self.targetback); + while(fdest) { + // Update (spawnflags) path_corner and save entity + if (fdest.classtype == CT_PATHCORNER) { + self.spawnflags = self.spawnflags | PATHC_BACKLINK; + self.movetarget3 = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.targetback); + } + } + else { + // Setup back link name, if none exist use targetname + self.targetback = self.targetname; + + // Cycle through list for BACKLINK path_corner + fdest = find (world, target, self.targetback); + while(fdest) { + // Update (spawnflags) path_corner and save entity + if (fdest.classtype == CT_PATHCORNER) { + self.spawnflags = self.spawnflags | PATHC_BACKLINK; + self.movetarget3 = fdest; + fdest = world; + } + else fdest = find(fdest, target, self.targetback); + } + } + + // Double check TARGET2 before declaring a deadend + if ( !(self.spawnflags & PATHC_BACKLINK) ) { + fdest = find (world, target2, self.targetback); + while(fdest) { + if (fdest.classtype == CT_PATHCORNER) { + self.spawnflags = self.spawnflags | PATHC_BACKLINK; + self.movetarget3 = fdest; + fdest = world; + } + else fdest = find(fdest, target2, self.targetback); + } + } + + // Bad situation : Found a path corner with no back-link + // label as deadend (direction reverse) and circular link + if ( !(self.spawnflags & PATHC_BACKLINK) ) { + dprint("\b[PATH_CORNER]\b ("); dprint(self.targetname); + dprint(") - Deadend found\n"); + if (self.movetarget) self.movetarget3 = self.movetarget; + else self.movetarget3 = self; + self.spawnflags = self.spawnflags | PATHC_DEADEND; + } + + // Random time interval as this is not important + // Generate developer arrow models on path_corner + self.nextthink = time + 0.5 + random(); + self.think = path_corner_setuparrow; + +}; + +//---------------------------------------------------------------------- +void() path_corner_use = +{ + // Change spawnflags NOPAUSE (-1=NO, 1=YES, 2=Toggle) + if (other.corner_pause) { + // Store the parameter locally so it can modified + self.corner_pause = other.corner_pause; + if (self.corner_pause == 2) { + if (self.spawnflags & PATHC_NOPAUSE) self.corner_pause = 1; + else self.corner_pause = -1; + } + // The toggle state uses the on/off code by storing the value + // locally and modifying it beforehand + if (self.corner_pause > 0) { + if (self.spawnflags & PATHC_NOPAUSE) + self.spawnflags = self.spawnflags - PATHC_NOPAUSE; + self.wait = -1; + } + else if (self.corner_pause < 0) { + self.spawnflags = self.spawnflags | PATHC_NOPAUSE; + self.wait = 0; + } + } + + // Change spawnflags REVERSE (-1=NO, 1=YES, 2=Toggle) + if (other.corner_switch) { + // Store the parameter locally so it can modified + self.corner_switch = other.corner_switch; + if (self.corner_switch == 2) { + if (self.spawnflags & PATHC_REVERSE) self.corner_switch = -1; + else self.corner_switch = 1; + } + // The toggle state uses the on/off code by storing the value + // locally and modifying it beforehand + if (self.corner_switch > 0) { + self.spawnflags = self.spawnflags | PATHC_REVERSE; + } + else if (self.corner_switch < 0) { + if (self.spawnflags & PATHC_REVERSE) + self.spawnflags = self.spawnflags - PATHC_REVERSE; + } + } + + // Change speed of train moving towards path_corner (default=100) + if (other.corner_speed > 0) self.speed = other.corner_speed; + + // Changing routes? + if (other.corner_route) { + // Double check that the routes exist before setting them + if (other.corner_route == STATE_ROUTE1 && + self.spawnflags & PATHC_TARGET1) self.state = STATE_ROUTE1; + else if (other.corner_route == STATE_ROUTE2 && + self.spawnflags & PATHC_TARGET2) self.state = STATE_ROUTE2; + else if (other.corner_route == STATE_ROUTE3 && + self.spawnflags & PATHC_BACKLINK) self.state = STATE_ROUTE3; + // If changing routing logic, make sure spawnflag is updated + else if (other.corner_route == STATE_EXACT) { + self.spawnflags = self.spawnflags | PATHC_EXACT; + self.state = STATE_ROUTE1; + } + // When routing logic is changed, need to reset state + else if (other.corner_route == STATE_RANDOM) { + if (self.spawnflags & PATHC_EXACT) + self.spawnflags = self.spawnflags - PATHC_EXACT; + self.state = STATE_ROUTE1; + } + dprint("Corner ("); dprint(self.targetname); + dprint(") Route ("); dprint(ftos(self.state)); + dprint(")\n"); + } + else { + // Toggle route selection if EXACT routing logic is active + // and the path corner has multiple routes available + if (self.spawnflags & PATHC_EXACT && self.spawnflags & PATHC_TARGET2) { + if (self.state == STATE_ROUTE1) self.state = STATE_ROUTE2; + else if (self.state == STATE_ROUTE2) self.state = STATE_ROUTE3; + else self.state = STATE_ROUTE1; + } + } + + // Update arrows if route logic active + path_corner_updatearrow(); +}; + +//---------------------------------------------------------------------- +void() path_corner_stop = +{ + other.goalentity = other.movetarget = world; + other.pausetime = time + LARGE_TIMER; + other.think = other.th_stand; + other.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() path_corner_touch = +{ + if (!(other.flags & FL_MONSTER)) return; // ONLY Monsters can use path corners + if (other.health < 1) return; // Dead things don't need path guidance + if (other.enemy) return; // In combat, no time to follow paths + if (other.movetarget != self) return; // Suppose to follow this corner? + + // If ogre, play chainsaw drag sound (50% of the time) + if (other.classtype == CT_MONOGRE || other.classtype == CT_MONHOGRE) + if (random() > 0.5) sound (other, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + + // Fire any event targets (activator = monster) + if (self.corner_event) trigger_strs(self.corner_event,other); + // Check if this path_corner is a dead end? (no target) + if (self.spawnflags & PATHC_DEADEND) path_corner_stop(); + // Has this path corner been linked yet? Try again? + if ( !(self.spawnflags & PATHC_TARGET1) ) path_corner_setuptargets(); + + // Is there a target to move towards? + if (self.spawnflags & PATHC_TARGET1) { + // Check for a second random path? + if (self.spawnflags & PATHC_TARGET2) { + // Check route logic (only use forward routes) + if (self.spawnflags & PATHC_EXACT) { + if (self.state == STATE_ROUTE1) other.goalentity = self.movetarget; + else other.goalentity = self.movetarget2; + } + else { + // Default = random routes + if (random() < 0.5) other.goalentity = self.movetarget; + else other.goalentity = self.movetarget2; + } + } + // Default, 1 path = 1 choice + else other.goalentity = self.movetarget; + // Setup goal for monster to move toward + other.movetarget = other.goalentity; + + // Does the monster need to pause at current path_corner? + if (self.wait < 0) path_corner_stop(); + else if (self.wait > 0) { + other.pausetime = time + self.wait + random()*self.delay; + other.think = other.th_stand; + other.nextthink = time + 0.05; + } + // no pause, turn and keep walking towards next goal + else { + other.ideal_yaw = vectoyaw(other.goalentity.origin - other.origin); + other.pausetime = 0; + } + } + // No new target to follow, stand around + else path_corner_stop(); +}; + +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +void() path_corner = +{ + // Really need to prevent path corners with no targetname + // otherwise it will cause problems with linking later + if (self.targetname == "") { + dprint("\b[PATH_CORNER]\b Missing targetname!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Cache developer arrow models + if (developer == 1) { + self.headmdl = MODEL_CORNER1; // Top of Arrow (forward) + self.mdl = MODEL_CORNER2; // Bottom of Arrow (backward) + precache_model(self.headmdl); + precache_model(self.mdl); + } + + // Setup time delay at corner ( wait + delay*random() ) + if (self.wait == 0) self.wait = 0; + if (self.delay <= 0) self.delay = 0; + + // Reset all path targets/entities, spawnflags (low 4 bits only) + self.spawnflags = self.spawnflags & PATHC_RESET; + self.movetarget = self.movetarget2 = self.movetarget3 = world; + + self.solid = SOLID_TRIGGER; // always touchable + self.movetype = MOVETYPE_NONE; // Does not move + self.classtype = CT_PATHCORNER; // Self identification + setsize (self, '-8 -8 -16', '8 8 16'); // Size of trigger + self.touch = path_corner_touch; // Useable by monsters + self.use = path_corner_use; // Used by trigger events + + // Work out which (random/toggle) route logic is active + if (self.spawnflags & PATHC_EXACT) { + // If state is specified and outside range, reset + if (self.state < STATE_ROUTE1 || self.state > STATE_ROUTE3) + self.state = STATE_ROUTE1; + } + else self.state = STATE_ROUTE1; + // Cannot start with route 2 (alt forward) if target2 is empty!?! + if (self.state == STATE_ROUTE2 && self.target2 == "") self.state = STATE_ROUTE1; + + // Many of the ID maps have path_corners buried in solid architecture + // which makes it difficult to see where they are and impossible to draw + // visual arrows on them. + // + // This code checks for solid content and keeps nudging the + // temporary origin upwards 8 units at a time (max 64 units) + // If it cannot find any empty space above, it will give up and + // use the original origin point instead + // + self.oldorigin = self.origin; + if (pointcontents(self.oldorigin) == CONTENT_SOLID) { + self.lip = 8; + while (self.lip > 0) { + self.lip = self.lip - 1; + self.oldorigin = self.oldorigin + '0 0 8'; + if (pointcontents(self.oldorigin) != CONTENT_SOLID) + self.lip = -1; + } + } + // Origin is still in something solid, reset + if (self.lip != -1) self.oldorigin = self.origin; + + // Check for dead end path_corner + if (self.target == "") self.spawnflags = self.spawnflags | PATHC_DEADEND; + + // Allow 1 frame for path_corners to spawn + // Got to start linking before func_train (2nd frame) + self.think = path_corner_setuptargets; + self.nextthink = time + 0.1; + +}; diff --git a/QC_other/QC_keep/ai_ryu.qc b/QC_other/QC_keep/ai_ryu.qc new file mode 100644 index 00000000..3d5496b3 --- /dev/null +++ b/QC_other/QC_keep/ai_ryu.qc @@ -0,0 +1,861 @@ +.float dodge_back; // Time to reverse dodge, sort of like lefty. +float RYU_RANGE_MELEE = 120; +float RYU_RANGE_BEST = 750; // Maximum range for shot spray. +float RYU_RANGE_MAX = 2000; // Maximum attack range. +float SPEED_RYU_MIN = 8; +float SPEED_RYU_SLOW = 20; + +entity() RandomPlayer; + +// edict.spawnflags +float SPAWN_WYRM = 2; // Upgrades dragon to full Qtest-sized. +float SPAWN_FAST = 4; +float SPAWN_SLOW = 8; +float SPAWNx_SKILL= 12; // Combo - 4+8. + +//////////////////////////////////////////////////////////////////////////// +// 1.1. Custom MoveToGoal AI // +// // +// The fundamentals! Used when neither 'walkmove' nor 'movetogoal' // +// alone are good enough. This takes care of the problems of water // +// immersion and wall clipping. // +//////////////////////////////////////////////////////////////////////////// + +//========================================================================== +// Basic Movement +// Checks if the dragon should be allowed to move freely, or horizontal only. +// TRUE = Free move allowed, FALSE = Flat move only. +float() Ryu_UseFreeMove = { + if (!self.enemy) + return TRUE; // Movement is automatically flat. + if (self.h2olevel) + return TRUE; // Get out of the water ASAP. + +//- - - - - - - - - +// The point of flat movement is to prevent the dragon from entering water. +// Builtin movement functions move the dragon 8 pixels toward its enemy +// per call. Therefore, plot a point 7 pixels away from the bbox edge. +// If the point is in an offending liquid, use flat movement code to +// prevent entry. +// +// Also, if the dragon has a bbox maxs_z greater than 64, use flat movement +// to prevent (or greatly reduce the chance of) the dragon from clipping +// the ceiling. +//- - - - - - - - - + local vector spot; + local float diff, pc; + +// NOTE: Checks current point only, not post-move point. Fix this! + spot = self.origin; + diff = spot_z - self.enemy.origin_z; + if (diff < 30) + spot_z = spot_z + self.maxs_z + 7; // Going up. + else if (diff > 40) + spot_z = spot_z + self.mins_z - 7; // Going down. + else + return TRUE; // Already level, so no need to use flat move code + // because the engine code will do that for us. + + pc = pointcontents(spot); + +// Don't let big dragons clip the ceiling. +// NOTE: Doesn't always work -- fix. + if (pc == CONTENT_SOLID) + if (self.maxs_z > 64) + return FALSE; // Stop huge dragons from clipping the ceiling. + +// Check for water. Dragons who are afraid of water never go in. +// Dragons not afraid of water may enter water, but NOT slime/lava, +// unless the dragon has invunlerability. No dragon may enter a sky brush. + if (self.ryuflags & RYU_NO_WATER) + diff = CONTENT_WATER; // Never go into water no matter what. + else if (self.invincible_finished > time + 3) + diff = CONTENT_SKY; // Invulnerable! + else if (self.cross_finished > time + 3) + diff = CONTENT_SKY; // Protected from elements by cross. + else + diff = CONTENT_SLIME; // Even those who can swim won't enter this. + +// If test spot goes into the water, use flat move code. + return (pc > diff); +}; + +float(float yaw, float dist) Ryu_WalkMove = { + if (Ryu_UseFreeMove ()) + return walkmove (yaw, dist); + return flat_move (yaw, dist); +}; + +void(float dist) Ryu_MoveToGoal = { + if (Ryu_UseFreeMove ()) + movetogoal (dist); + else + flat_goal (dist); +}; + +//////////////////////////////////////////////////////////////////////////// +// 1.2. Dragon Movement AI // +// // +// Does collision checking as well as detecting and dodging projectiles // +// or other dangerous entities nearby the dragon. // +// // +// Also deals with situations that involve water. // +//////////////////////////////////////////////////////////////////////////// + +//========================================================================== +// Angular Movement + +// Reverses angle changes caused by tilting. Should be called each frame +// unless the dragon needs to tilt. +void() ryu_untilt = { + if (self.angles_z != 0) { + if (self.angles_z < -5) + self.angles_z = self.angles_z + 5; + else if (self.angles_z < 5) + self.angles_z = 0; + else //if (self.angles_z > 5) + self.angles_z = self.angles_z - 5; + } +}; + +// Called whenever the dragon strafes, this tilts the dragon's angles_z. +// Note: If called by wyrm AI, dist should always be high for big turns. +// FIXME: Should confirm angles with 'anglemod'. +void(float left, float dist) ryu_tilt = { + local float hi; + + if (dist > 20) + {dist = 10; hi = 30;} // Fast -- Running + else + {dist = 5; hi = 20;} // Slow -- Walking + + if (left) + { // Going left. + hi = 0 - hi; + left = self.angles_z - dist; + if (left < hi) + left = hi; + } + else + { // Going right. + left = self.angles_z + dist; + if (left > hi) + left = hi; + } + self.angles_z = left; +}; + +// Returns the distance the dragon should move while strafing. The idea is +// the dragon takes time to accelerate to full speed while sidestepping. +// However, the dragon will never move slower than the allowed minimum. +float(float dist) ryu_slide_speed = { + if (dist <= SPEED_RYU_MIN) + return SPEED_RYU_MIN; + + // Note: Make sure the angle divisor matches the fast 'hi' in the + // above tilt function. + dist = (dist - SPEED_RYU_MIN) * (fabs(self.angles_z) / 30); + dist = floor(dist) + SPEED_RYU_MIN; + return dist; +}; + +//========================================================================== +// Vertical Movement +// This checks if the dragon should stay away from water. Dragons that +// only have breath weapons that are ineffective or too dangerous to use +// underwater are usually afraid of water. However, a dragon that is on +// fire will venture into water, even if it normally avoids water. +// Update: Monsters can drown or fry in water. Remember that! +//------------------------------------------------------------------------// +float() Ryu_HatesWater = { + if (self.invincible_finished <= time + 3) // Powerups ring at T-3 seconds. + { + // Cheap hack -- make the dragon afraid of water when low on air. + // Give at least five seconds because the dragon may either be in + // deep water or caught up in battle. + if (!(self.xfl & XFL_NO_AIR)) // SoE: Disabled drowning + if (self.air_finished < time + 5) + return TRUE; // Running out of air, so leave the water now! + + // If frying in the hot sauce, get out! Even the new dragon move AI + // won't stop it from entering such liquid via teleportation. + if (self.h2otype <= CONTENT_SLIME) + return TRUE; // Burning in slime or lava! + } + + //if (IsBurning (self)) + //return FALSE; // Any dragon on fire won't mind taking a dip. + return (self.ryuflags & RYU_NO_WATER); // Return fear status. +}; + +//------------------------------------------------------------------------// +// This tells the dragon to escape a pool of water. +//------------------------------------------------------------------------// +float(float dist) Ryu_LeaveWater = +{ + // Check if air is above the water (like above a pool or river) + // from an underwater point. + traceline (self.origin, self.origin + '0 0 2048', FALSE, self); + if (trace_inopen) + if (trace_inwater) + if (ai_up (dist)) + return TRUE; + + // Removed: Don't bother checking for air below water. + + // No air is detected, continue on present course. + return FALSE; +}; + +//------------------------------------------------------------------------// +// If a dragon is in the water, this makes the dragon rise out of it. +//------------------------------------------------------------------------// +float(float dist) Ryu_GetOutOfWater = { + if (Ryu_HatesWater ()) + if (self.h2olevel) + if (Ryu_LeaveWater (dist)) + return TRUE; + + return FALSE; +}; + +//------------------------------------------------------------------------// +// The dragon flies up or down based on current conditions. +//------------------------------------------------------------------------// +void(float dist, entity ent) Ryu_VerticalSlide = { +// If in the unlikely event a water-fearing dragon is in the water, +// find some air and go in the direction it is found. + if (Ryu_GetOutOfWater (dist)) + return; + +// Fly away from... whatever 'ent' is. + if (ent.origin_z > self.origin_z) { + // Going down would increase chances of evading ent. + // Do it only if dragon is already above the goalentity. + if (self.goalentity) + { + local float delta; + + delta = (self.origin_z + 30) - self.goalentity.origin_z; + if (delta < 0) + return; // Don't go down when climbing toward a goal. + if (delta < dist) + dist = delta; // Don't descend fully. + } + dist = 0 - dist; + } + else + { // Thinking about going up. + if (self.goalentity) + if (self.origin_z - self.goalentity.origin_z > 1000) + return; // Don't fly so high up beyond medium range. + } +// Now we're really going. + ai_up (dist); +}; + + +//========================================================================== +// Danger Evasion + +//------------------------------------------------------------------------// +// Fly toward to direction that will most likely dodge the threat. +//------------------------------------------------------------------------// +void(float newyaw, float dist, entity threat) Ryu_Dodge = +{ +// Strafe away from the detected danger. If path is blocked, +// flag it with a time so that future checks use a different path. + if (!safe_move (newyaw, dist)) + { + if (self.dodge_back > time) + self.dodge_back = 0; + else + self.dodge_back = time + 0.5 + random(); + } + + local entity targ; + + targ = self.goalentity; + +// Face its goal. + self.ideal_yaw = vectoyaw (targ.origin - self.origin); + ChangeYaw (); + +// Next, check if the dragon should slide vertically away from its goal. + if (targ != threat) + { + // For elevation, if dragon is between the goal and threat entity, + // don't slide vertically away from goal. We do not want the dragon + // to move toward the threat now would we? + local float tz, sz; + + tz = targ.origin_z; + sz = self.origin_z + self.view_ofs_z; + if (tz < sz) + {if (sz < threat.origin_z) return;} + else if (tz > sz) + {if (sz > threat.origin_z) return;} + } + Ryu_VerticalSlide (dist, targ); +}; + +//------------------------------------------------------------------------// +// Find the best direction to head for. +//------------------------------------------------------------------------// +float(float theta) Ryu_ChangeCourse = +{ + theta = anglemod (theta); + if (theta < 60) return -90; // Dodge right. + if (theta < 120) return 0; // Continue straight ahead. + if (theta < 180) return -90; // Dodge right. + if (theta < 240) return 90; // Dodge left. + if (theta < 300) return 0; // Continue straight ahead. + return 90; // Dodge left. +}; + +//------------------------------------------------------------------------// +// Compare the yaws of the dragon's direction and the direction +// toward the threat, and find the best direction to dodge the +// threat on the results. +//------------------------------------------------------------------------// +void(float dist, entity ent) Ryu_FindBestPath = +{ + local float yaw; + + yaw = vectoyaw (ent.origin - self.origin); + yaw = Ryu_ChangeCourse (yaw - self.angles_y); + if (self.dodge_back > time) + yaw = 0 - yaw; // Reverse direction if blocked recently. + +// Flip the dragon and adjust speed based on its angles. + if (yaw != 0) + { // Sidestep. +yaw = left, -yaw = right. + ryu_tilt (yaw > 0, dist); + dist = ryu_slide_speed (dist); + } + else + ryu_untilt (); + +// Set new course and head in that direction if possible. + Ryu_Dodge (self.angles_y + yaw, dist, ent); +}; + + +//========================================================================== +// Danger Detection + +//------------------------------------------------------------------------// +// This tells the dragon whether or not it is best to stay away from +// the entity. TRUE is returned if the dragon should stay away. +// FALSE is returned if the dragon is better off closing in on entity. +// Only alert dragons can spot who the entity is and what kind of +// weapons, items, or other abilities it has. +//------------------------------------------------------------------------// +float(entity ent) Ryu_KeepAway = +{ +// Check for burning first because even the stupid know that fire is bad. +// FIXME: Burning is slated for removal. + //if (IsBurning (ent)) + //if (self.resist_fire < 1) + //if (!self.invincible_finished) + //return TRUE; // ent burns, and dragon isn't immune to dmg. + +// Begin standard check. +// 6/17/2011: Disabled alert. The remaining checks are something even +// an idiot can do. +// if (!(self.ryuflags & RYU_ALERT)) +// return FALSE; // Not smart enough to use keep away tactics. + if (!self.th_missile) + return FALSE; // Has no choice but to attack up close. + + // If player, check his items. + if ((ent.classname == "player") || (ent.classname == "monster_ranger")) + { // Must be alive and opposed. + if (ent.health > 0) + /*if (!Align_Match (ent, self)) { + if (ent.invincible_finished || ent.super_damage_finished) + return TRUE; // Avoid if using pentagram or quad damage. + + // Check weapons. Requires alertness to spot weapons. + if (self.ryuflags & RYU_ALERT) + if (!ent.form_active) + { + // FIXME: Berserker helm enables leech, but it's limited. + if (self.tome_finished) + { // ToP makes melee weapons leech life. + if (ent.war == WAR_AXE) + return TRUE; + if (ent.war == WAR_CHAINSAW) + return TRUE; + } + // FIXME: Rocket check could be removed. + if (vlen(ent.origin - self.origin) >= 120) + { // Far enough away for ent to use big guns safely. + if (ent.war & WARx_USES_ROCKETS) + return TRUE; + if (ent.war == WAR_PLASMA_GUN) + return TRUE; + } + } + }*/ + + // Close in on the player. + return FALSE; + } + + // The rest of the checks apply only if the entity is a live monster. + if (ent.flags & FL_MONSTER) + if (ent.health <= 0) + { + if (ent.invincible_finished || ent.super_damage_finished) + return TRUE; // Avoid if using invulnerability or quad damage. + + // Update 6/2/2011: Removed .threat field and simplified checks. + // Stay away from an enemy if it has more health than the dragon, + // or anytime the dragon has low health and the enemy is melee only. + // Enemy is defined as any monster targeting the dragon, or the + // dragon targeting the given monster. + if ((self.enemy == ent) || (ent.enemy == self)) + { + if (ent.classname == "monster_tarbaby") + return TRUE; // These guys are bouncing bombs -- bad news! + + if (ent.health > self.health) + return TRUE; + + if (self.health <= 100) + { // Dragon becomes more evasive against melee when weakened. + // After all, a knight cannot kill a dragon he cannot reach. + if (!ent.th_missile) + return TRUE; // More likely to live by hanging back. + } + } + } + + // It is best to close in on the enemy. + return FALSE; +}; + +//------------------------------------------------------------------------// +// This checks if the entity found is dangerous and should be avoided +// (if possible). +//------------------------------------------------------------------------// +float(entity ent) Ryu_IsHostile = +{ + // Ignore entities owned by its owner (for obvious reasons). + if (ent.owner == self) + return FALSE; + + // Check if entity is an avoidable projectile. + if (IsMissile (ent)) + { // Found a projectile. See if the dragon should avoid it. + if (ent.enemy == self) + { // Homing missile. + if (ent.yaw_speed >= 180) + return FALSE; // Can't dodge this (vore/wrath) missile. + return infront(ent); // Dodge only if seen; hope it misses. + } + + // Check if projectile can hit dragon. + // NOTE: 32 = 16 for missile clip bonus + 16 for 2 builtin z moves. + if (ent.velocity_z > 0) + { if (ent.origin_z > self.origin_z + self.maxs_z + 32) + return FALSE; // Can't hit dragon below if going up. + } + else if (ent.velocity_z < 0) + { if (ent.origin_z < self.origin_z + self.mins_z - 32) + return FALSE; // Can't hit dragon above if going down. + } + + // Note: If this section slows play too much, remove and return TRUE. + // Check distance to projectile now (before) vs. one frame later + // (after). If the expected distance increases (before < after), + // assume projectile is flying away and ignore it. Otherwise, + // assume it is incoming and avoid it. + local vector vec; + local float before, after; + + vec = ent.origin - self.origin; + before = vlen(vec); + after = vlen(vec + (ent.velocity*0.1)); + return (before >= after); + //- - - - - - - - - + } + + // Decide whether or not to stay away from the entity detected. + return Ryu_KeepAway (ent); +}; + +//------------------------------------------------------------------------// +// This searches for dangerous entities near the dragon. +//------------------------------------------------------------------------// +entity() Ryu_FindThreat = +{ + local entity head; + + // Return the first threat found (if any). + // Note: Proper radius is ((maxs_x / 16) * 25) + 275. + head = findradius(self.origin, self.maxs_x * 1.5625 + 275); + while (head) + { + if (head != self) + { + traceline (self.origin, head.origin, TRUE, self); + if (trace_fraction == 1) + if (Ryu_IsHostile (head)) + return head; // Got one! + } + head = head.chain; + } + + // If the function made it this far, nothing valid was found. + return head; +}; + +//------------------------------------------------------------------------// +// This checks if a dangerous entity is nearby and if so, get out of +// its way. +//------------------------------------------------------------------------// +float(float dist) Ryu_DetectDanger = +{ +// Find the first entity that poses a threat if any are nearby. + local entity head; + + head = Ryu_FindThreat (); + if (head) + {Ryu_FindBestPath (dist, head); return TRUE;} // Got one! + return FALSE; // Nothing dangerous was found. +}; + + +//////////////////////////////////////////////////////////////////////////// +// 1.3. General Dragon AI // +// // +// Dictates the AI of the dragons. // +//////////////////////////////////////////////////////////////////////////// + +//========================================================================== +// Dragon Combat + +//------------------------------------------------------------------------// +// Check if dragon is in guard mode. +//------------------------------------------------------------------------// +float() Ryu_InGuardMode = +{ +// Other monsters always move if fighting. + return FALSE; +}; + +//------------------------------------------------------------------------// +// This checks if the dragon cannot use its missile attacks because +// of some detrimental side effect that could result from it. +//------------------------------------------------------------------------// +float(entity ent) Ryu_NoShot = { + local float element; + + if (ent.h2olevel > 1) { + element = ent.ryuflags & RYU_ELEMENTS; + if (element == RYU_USE_LITE) + return TRUE; // Lightning is useless underwater. + else if (element == RYU_USE_ICE) { + if (ent.h2otype == CONTENT_LAVA) + return TRUE; // Melts in lava! + } + } +//- - - - - - - - - +// Update: Reflector shield. +// Watching attacks bounce off the reflector shield is fun, even if the +// dragon knows better not to attack. Therefore, dragon must be alert +// to avoid attacking. (Otherwise, what fun would that be to the player?) + //if (ent.ryuflags & RYU_ALERT) + //if (ent.enemy) + //if (HasReflection (ent.enemy, self.origin, 0)) + //return TRUE; // Attacks can bounce back. +//- - - - - - - - - + return FALSE; // May attack. +}; + +//========================================================================== +// Dragon Behavior + +//------------------------------------------------------------------------// +// This checks if the dragon should strafe. +//------------------------------------------------------------------------// +float() Ryu_DoStrafe = { + //if (ImmuneToDamage (self)) + // return FALSE; // No need to circle-strafe if invulnerable. + + // Always strafe if it wants to, especially after flinching from pain. + if (self.inpain >= time) + return TRUE; + + if (self.enemy.xfl & XFL_ZOMBIE) + return FALSE; // Always approach zombies, unless panicked. + // Reason is only melee attacks can hurt them. + + // If inclined to strafe, do it half the time. + if (random() < 0.5) + { // Strafe when enemy attacked recently. + if (self.enemy.attack_finished >= time) + return TRUE; + if (self.enemy.show_hostile >= time) + return TRUE; + } + + // Dragon decided not to strafe after all. + return FALSE; +}; + +//------------------------------------------------------------------------// +// The dragon decides whether to strafe or hold still while attacking. +// Used in missile attacks. +//------------------------------------------------------------------------// +void() Ryu_StrafeOption = +{ + if (Ryu_DoStrafe ()) + { + self.attack_state = AS_SLIDING; + if (random() < 0.5) + self.lefty = !self.lefty; + return; + } + self.attack_state = AS_STRAIGHT; // Don't strafe. +}; + +//------------------------------------------------------------------------// +// Check if an attack can be made. +//------------------------------------------------------------------------// +void() DragonCheckAttack = { + local vector spot1, spot2; + local entity targ; + local float guarding; + local float nofire; // Melee only if TRUE. + local float chance, reach; + + guarding = Ryu_InGuardMode (); + + // Check if the dragon has a breath weapon. + if (self.th_missile) + nofire = FALSE; + else + nofire = TRUE; + + // Check if dragon can see the target. + targ = self.enemy; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + chance = 1; // Melee attack enabled. + + traceline (spot1, spot2, FALSE, self); + if (trace_ent != targ) + { + // Could not see the target. + if (trace_fraction < 1) + { // Blocked by obstacle. If blocked by monster, flag it so + // dragon may try to move around it vertically. + targ = trace_ent; + if (!guarding) + { + if (targ) + if (targ.solid == SOLID_SLIDEBOX) + if (targ.health > 0) + self.attack_state = AS_SLIDING; + } + //if (DontHurtMe (targ)) + //return FALSE; + + // Whoever blocked the way is an enemy too, so continue the check. + chance = 0; // Disable melee this time. + targ = self.enemy; + } + else + { // Target is non-solid. (e.g., downed zombies, nightshade.) + // Dragon can try to engage it in melee, provided the target is + // vulnerable to damage. Don't use missile attack because it + // will pass through the enemy harmlessly. + + // NOTE: Don't use ghost check because it fails on downed + // zombies. + + if (!targ.takedamage) return; +// Commented out because those with no mindex should have DAMAGE_NO too. +// if (!targ.modelindex) +// return; + + // Update: Lightning will hit ghosts, so fail only if either + // does not apply. + if (self.ryuflags & RYU_ELEMENTS != RYU_USE_LITE) + nofire = TRUE; + //else if (!IsGhost (targ)) + // nofire = TRUE; + } + } + + // If target is reachable within melee range, the dragon will attack + // the target if the dragon has a melee attack. + if (enemy_range == RANGE_MELEE) + if (chance) + if (self.th_melee) + if (CanDamage (targ, self)) { self.attack_state = AS_MELEE; return ; } + +// missile attack + + // Check if the dragon can shoot. + if (nofire) + { + self.attack_state = AS_STRAIGHT; + return; + } + if (Ryu_NoShot (self)) + return; + + if (guarding) + { + if (!FacingIdeal ()) + return; + + // Quake2 gave 40% chance for attacking while in standing ground AI. + if (random() < 0.4) + { // If enemy is within range, fire at will. + local float dist; + + dist = vlen (spot2 - spot1); + reach = RYU_RANGE_MAX; + if (dist < reach) + { + self.th_missile (); + SUB_AttackFinished (0); + return; + } + } + return; + } + + // Check if allowed to attack. + if (time < self.attack_finished) + return; + +// Determine the chance that the dragon will use its breath weapon. + if (enemy_range == RANGE_MELEE) + { // Any dragon will almost certainly attack within melee range. + self.attack_finished = 0; + chance = 0.9; + } + else if (enemy_range == RANGE_NEAR) + { // Short range (120-500) + chance = 0.2; + } + else + { + reach = RYU_RANGE_MAX; + if (vlen(spot2 - spot1) > reach) + { // Target is outside of attack range. + self.attack_state = AS_STRAIGHT; + return; + } + if (enemy_range == RANGE_MID) + chance = 0.1; // Medium range (500-1000) + else + chance = 0.02; // Long range (1000+) + } + +// The dragon decides whether to attack or move on. + if (random () < chance) { + local float pause; + + pause = random() * 2 + 1; // Has long attack anim. + SUB_AttackFinished (pause); // Reversed in custom 'ai.qc' too. + self.th_missile (); + return; + } +// If the function made it this far, the dragon moves on. +}; + +//------------------------------------------------------------------------// +// This checks if the dragon is allowed to make a step toward its enemy. +// Conditions that force the dragon to either stand its ground or dodge +// incoming threats causes this function to return FALSE. Otherwise, +// the dragon will be allowed to step forward and TRUE will be returned. +//------------------------------------------------------------------------// +float(float melee) ryu_step = +{ + // Turn to face enemy. + ai_face (); + + if (Ryu_InGuardMode ()) + { + ryu_untilt (); + return FALSE; // Guarding -- don't move. + } + + /*if (!ImmuneToDamage (self)) + { + local float evade; + + evade = TRUE; + if (melee) + { // Disable evasion if attempting a melee with nearby opponent. + local float r; + + r = (self.maxs_x + self.enemy.maxs_x) * 1.4142 + 30; + if (r < 120) + r = 120; // Standard melee range. + if (vlen(self.enemy.origin - self.origin) <= r) + evade = FALSE; // In range, close in for the kill. + // If evade is still TRUE, enemy moved out of range, so back off. + } + if (evade) + { + if (self.ryuflags & RYU_ALERT) + { + if (Ryu_DetectDanger (self.speed)) + return FALSE; + } + else + { + if (self.attack_state != AS_SLIDING) + if (Ryu_DetectDanger (SPEED_RYU_MIN)) + return FALSE; + } + } + }*/ + + // Check if the dragon is in strafe mode. + if (self.attack_state == AS_SLIDING) + { + local float dist; + + ryu_tilt (self.lefty, self.speed); + + dist = ryu_slide_speed (self.speed); + // Replaced 'ai_run_circle (self.speed);' with new bank code. + // Call 'ai_face' before AND after the move function to circlestrafe. + ai_face (); + ai_run_bank (dist); + ai_face (); + + return FALSE; + } + +// Proceed forward. + ryu_untilt (); // Undo any angle changes due to evasion. + return TRUE; +}; + +//------------------------------------------------------------------------// +// The dragon is engaged in melee with its opponent. +//------------------------------------------------------------------------// +void() ryu_melee = +{ + if (ryu_step (TRUE)) + safe_goal (SPEED_RYU_MIN); // Close in on the opponent. +}; + +//------------------------------------------------------------------------// +// Face and close in on the opponent while attacking. +//------------------------------------------------------------------------// +void() ryu_missile = +{ + if (ryu_step (FALSE)) + safe_move (self.angles_y, SPEED_RYU_MIN); // Move straight in. +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_states.qc b/QC_other/QC_keep/ai_states.qc new file mode 100644 index 00000000..a61b6204 --- /dev/null +++ b/QC_other/QC_keep/ai_states.qc @@ -0,0 +1,187 @@ +/*====================================================================== + Three basic types of behaviour is Quake, stand, walk and run +======================================================================*/ +void monster_poisoned_check(); + +//---------------------------------------------------------------------- +// ai_stand +//---------------------------------------------------------------------- +void() ai_stand = +{ + if (self.health < 1) return; // Health < 0, no more standing + monster_liquid_check(); // Check for liquid damage + check_tethertimer(); // Check for tethering system + monster_poisoned_check(); // Check and apply poison + if (FindTarget ()) return; // Found a player? + // Double check there is a goalentity, no pause and no turret + if (self.goalentity && time > self.pausetime && self.movespeed >= 0) { + // Make sure AI is turning towards new path corner direction + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + ChangeYaw (); + self.th_walk (); + } + else { + // Only test ground walking monsters (no fly/swim) + // Check global map variable first (default = off) + if (map_bodyflrcheck == TRUE && self.classmove == MON_MOVEWALK) + ent_floorcheck(self, FLOOR_TRACE_MONSTER); + } +}; + +//---------------------------------------------------------------------- +// ai_walk +//---------------------------------------------------------------------- +void(float dist) ai_walk = +{ + local vector vertdiff; + + if (self.health < 1) return; // Health < 0, no more walking + // Turret monsters don't walk, they stand around + if (self.movespeed < 0) { self.th_stand(); return; } + monster_liquid_check(); // Check for liquid damage + monster_poisoned_check(); // Check and apply poison + movedist = dist; + if (FindTarget ()) return; // Found a player? + + // Allow for flying units to move up/down between path corners + if (self.classmove == MON_MOVEFLY) { + // Allow for some Z axis tolerance + if (fabs(self.origin_z - self.goalentity.origin_z) > MON_ZTOL) { + if (self.move_elev == 0) self.move_elev = MON_ZMOVEMENT; + if (self.origin_z < self.goalentity.origin_z) + self.origin_z = self.origin_z + self.move_elev; + else self.origin_z = self.origin_z - self.move_elev; + + vertdiff = '0 0 0'; + vertdiff_x = fabs(self.goalentity.origin_x - self.origin_x); + vertdiff_y = fabs(self.goalentity.origin_y - self.origin_y); + // Are the path corners stacked on top of each other? + if (vertdiff_x < MON_ZTOL && vertdiff_y < MON_ZTOL) dist = 0; + } + } + + // Move to goal (code function) + if (self.huntingcharmer) { + movetogoal (dist); + self.nextthink = (time + ((self.nextthink - time) / FL_SWIM)); + } else { + movetogoal (dist); + } +}; + +//---------------------------------------------------------------------- +// ai_run +//---------------------------------------------------------------------- +void(float dist) ai_run = +{ + if (self.health < 1) return; // Health < 0, no more running + monster_liquid_check(); // Check for liquid damage + monster_poisoned_check(); // Check and apply poison + movedist = dist; + + // Is the enemy dead or no longer taking damage? + if (SUB_healthEnemyTarget() < 1 || SUB_takedEnemyTarget() == DAMAGE_NO || (self.charmed && (self.charmer == self.enemy))) { + // Switch around any enemytarget for enemy + SUB_switchEnemyTarget(); + self.enemy = self.goalentity = world; + if (self.charmed) { + HuntCharmer(); + return; + } + // Is the old enemy still alive and can it be damaged? + if (self.oldenemy.health > 0 && self.oldenemy.takedamage > 0) { + self.enemy = self.oldenemy; + HuntTarget (); + } + else { + // Nothing left to fight, stand around and wait for something + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.think = self.th_walk; + } + else self.think = self.th_stand; + return; + } + } + + self.show_hostile = time + 1; // wake up other monsters + + // check knowledge of enemy + enemy_vis = visible(SUB_entEnemyTarget()); + if (enemy_vis) self.search_time = time + 5; + + // look for other coop players + if (coop && self.search_time < time && !self.charmed) { + if (FindTarget ()) return; + } + + // Calculate if goal/enemy is infront, the range and direction + enemy_infront = infront(SUB_entEnemyTarget()); + enemy_range = range(SUB_entEnemyTarget()); + enemy_yaw = vectoyaw(SUB_orgEnemyTarget() - self.origin); + self.enemydist = range_distance(SUB_entEnemyTarget(), FALSE); + + //---------------------------------------------------------------------- + // Check for temporary turret mode via trigger_monsterturret + //---------------------------------------------------------------------- + if (self.turretactive.classtype == CT_TRIGMONTURRET && enemy_vis && self.th_missile) { + if (self.turrettimer < time) { + // Is there a chance to pause? + if (random() < self.turretactive.count) + self.turrettimer = time + 1 + random()*2; + + self.attack_state = AS_TURRET; + ai_run_missile (); + return; + } + } + + //---------------------------------------------------------------------- + // Check if tether system is active + //---------------------------------------------------------------------- + if (check_tethersystem() && self.health > 0) { + self.tetherlock = TRUE; + if (self.th_tether) self.think = self.th_tether; + return; + } + + //---------------------------------------------------------------------- + // Check if blocked by breakables + CheckBlockedBreakable(); + + //---------------------------------------------------------------------- + if (self.attack_state == AS_MISSILE) { + ai_run_missile (); return; + } + else if (self.attack_state == AS_JUMP) { + ai_run_jump (); return; + } + else if (self.attack_state == AS_MELEE) { + ai_run_melee (); return; + } + //---------------------------------------------------------------------- + // This has to go after range/melee attack state checks + // otherwise the AI will not do anything + // These checks are for the next frame, not this one + // Exception : wizards need to strafe quickly + //---------------------------------------------------------------------- + // Some monsters don't have distance checks, like wizards + // All monsters have checkattack defined, no need for ifs and buts! + if (self.enemymaxdist || self.enemydist < MON_MAX_RANGE) + self.th_checkattack (); + + //---------------------------------------------------------------------- + if (self.attack_state == AS_SLIDING) { + ai_run_slide (dist); return; + } + else if (self.attack_state == AS_SIDESTEP) { + ai_run_sidestep (dist); return; + } + else if (self.attack_state == AS_BACKWARD) { + ai_run_backward (dist); return; + } + + // head straight towards the enemy + // unless of course I am a turret! + movetogoal (dist); +}; diff --git a/QC_other/QC_keep/ai_subs.qc b/QC_other/QC_keep/ai_subs.qc new file mode 100644 index 00000000..53b33f11 --- /dev/null +++ b/QC_other/QC_keep/ai_subs.qc @@ -0,0 +1,1315 @@ +/*====================================================================== + AI (monster) FUNCTIONALITY + + Visibility checks + - float(entity targ) visible + - float(entity targ, vector s_offset, vector t_offset, float nomonsters) visxray + - float(entity targ) visblocked + - float (entity targ, vector s_ofset, vector t_ofset) visblocked_wide + - float(entity targ) infront + + Distance checks + - float(entity targ) range + - float(entity targ, float flat2d) range_distance + - float (entity source, entity targ) rangeattack_check + + Angle checks + - float(entity source, entity targ, float offset, float reverse) targangle + - float(entity source, entity targ) targzone + + Hunt & Target Enemies + - void() HuntTarget + - void() FoundTarget + - void(float wakeupothers) FoundHuntTarget + - float() FindTarget + + AI animation movement (used mostly in monsters QC file) + - void(float dist) ai_forward + - void(float dist) ai_back + - void(float dist) ai_pain + - void(float dist) ai_painforward + - void() ai_turn + - float() FacingIdeal + - void() ai_face + - void() ai_resetangles + - void(float dist) ai_charge + - void(float dist) ai_chargenoturn + - void() ai_charge_side + - void() ai_charge_front + + AI ATTACK states + - void() ai_run_melee + - void() ai_run_missile + - void() ai_run_jump + - void(float dist) ai_run_slide + - void(float dist) ai_run_sidestep + - void(float dist) ai_run_backward + + AI interactions with Breakable System + - float(entity source, entity targ, float ignorenoshoot) ai_foundbreakable + - void(float brkdmg) ai_damagebreakable + - void(float brkdmg) ai_jumpbreakable + + AI melee checks and damage + - float(float attackdist) ai_checkmelee + - void() ai_melee + - void(float dmg_multiplier) ai_meleesmash + - void() ai_melee_side + +======================================================================*/ + +/*====================================================================== + check_liquidblock + - Checks pointcontents of source+target because traceline parms + are not 100% reliable for flagging water/air content + - One function check for all the different visibility functions + - Designed to work with the new liquidblock entity flag +======================================================================*/ +float(vector org_source, vector org_targ) check_liquidblock = +{ + local float pc_source, pc_targ; + + // Is r_wateralpha set or monsters forced to check liquid surfaces? + if (liquid_alpha == 1 || self.liquidblock) { + // Check point contents first + pc_source = pointcontents(org_source); + pc_targ = pointcontents(org_targ); + // Are point content different? (like water/air) + if (pc_source != pc_targ) return TRUE; + + // Standard traceline check (not 100% reliable) + if (trace_inopen && trace_inwater) return TRUE; + } + + // No liquid check required + return FALSE; +}; + +/*====================================================================== + visible (target entity) + Conditions added to water surface check + - most maps are compiled with transparent water nowadays +======================================================================*/ +float(entity targ) visible = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, TRUE, self); // see through other monsters + + // Debug system (enabled via axe) uses funcs from subs_soc.qc + // This will draw a diamond model where the AI is looking + if (self.debuglvl) { + if (!debugent1) debugent1 = spawn_devmarker(self.origin); + spot1 = vectoangles(self.origin - trace_endpos); + makevectors(spot1); + spot2 = trace_endpos + (v_up * -16) + (v_forward * 50); + setorigin(debugent1,'0 0 0'); + setorigin(debugent1, spot2); + } + + // Does the world define any water transparency + //if (liquid_alpha == 1) { + // sight line crossed contents + // if (trace_inopen && trace_inwater) return FALSE; + //} + // Check for liquid surface block condition + if (check_liquidblock(spot1, spot2) == TRUE) return FALSE; + + if (trace_fraction == 1) return TRUE; + return FALSE; +}; + +/*====================================================================== + visxray (variable options) + Returns TRUE if there is no blocking, FALSE if something in the way + Custom options for variable source/target offsets and monster blocking + (nomonsters) TRUE = no block, FALSE = blocked + self is excluded from any trace starting points +======================================================================*/ +float(entity targ, vector s_offset, vector t_offset, float nomonsters) visxray = +{ + local vector spot1, spot2; + + // Bmodels don't have proper origins + if (self.bsporigin) spot1 = bmodel_origin(self) + s_offset; + else spot1 = self.origin + s_offset; + + spot2 = targ.origin + t_offset; + traceline (spot1, spot2, nomonsters, self); // custom options + + // Does the world define any water transparency + //if (liquid_alpha == 1) { + // sight line crossed contents + // if (trace_inopen && trace_inwater) return FALSE; + //} + // Check for liquid surface block condition + if (check_liquidblock(spot1, spot2) == TRUE) return FALSE; + + // monster blocking changes which test to use + if (nomonsters) { + // Has the traceline gone from source>target without anything blocking? + if (trace_fraction == 1) return TRUE; + return FALSE; + } + else { + // Is the entity hit by the traceline the targ destination? + if (trace_ent == targ) return TRUE; + return FALSE; + } +}; + +/*====================================================================== + visblocked (target entity) + check to see if sightline is blocked by other monsters + Really only used in CheckAttack functions (was in org ID code) +======================================================================*/ +float(entity targ) visblocked = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, FALSE, self); // blocked by monsters + + // Does the world define any water transparency + //if (liquid_alpha == 1) { + // sight line crossed contents + // if (trace_inopen && trace_inwater) return FALSE; + //} + // Check for liquid surface block condition + if (check_liquidblock(spot1, spot2) == TRUE) return FALSE; + + // Original ID behaviour for this type of function + // Traceline entity hit = enemy? + if (trace_ent == targ) return FALSE; + return TRUE; +}; + +/*====================================================================== + viswide (target entity) + check to see if sightline is blocked by other monsters + extra wide check using 3 traces, +/- 16 left/right and origin + All three traces have to complete for a positive result +======================================================================*/ +float (entity targ, vector s_ofset, vector t_ofset) visblocked_wide = +{ + local vector spot1, spot2, spot3, tr_line; + local float tr_leftmon, tr_rightmon, tr_result; + + tr_line = '0 0 0'; + tr_leftmon = tr_rightmon = 0; + makevectors(self.angles); + + // Traceline 1 - MIDDLE + spot1 = self.origin + s_ofset_x * v_forward + s_ofset_y * v_right + s_ofset_z * v_up; + spot2 = targ.origin + t_ofset; + traceline (spot1, spot2, FALSE, self); + + // Is trace entity the same as the target entity? + if (trace_ent == targ) tr_line_x = 1; + // Check for liquid surface block condition + // Only need to do this once for the central traceline + // If this fails then the left/right should as well + if (check_liquidblock(spot1, spot2) == TRUE) tr_line_x = 0; + + //------------------------------------------------------------------ + // Traceline 2 - 32 units LEFT + spot3 = spot1 - (v_right * 16); + traceline (spot3, spot2, FALSE, self); + // Work out if clear shot, hit world or another entity + if (trace_ent == targ) tr_line_y = 1; + else if (trace_ent != world) tr_leftmon = 1; + + if (self.debuglvl) { + if (!debugent2) debugent2 = spawn_devmarker(self.origin); + setorigin(debugent2, trace_endpos); + } + + // Traceline 3 - 32 units RIGHT + spot3 = spot1 + (v_right * 16); + traceline (spot3, spot2, FALSE, self); + // Work out if clear shot, hit world or another entity + if (trace_ent == targ) tr_line_z = 1; + else if (trace_ent != world) tr_rightmon = 1; + + if (self.debuglvl) { + if (!debugent3) debugent3 = spawn_devmarker(self.origin); + setorigin(debugent3, trace_endpos); + } + + // Default = no clear shot (keep aim/moving) + tr_result = TRUE; + // SIMPLE 3 complete traces = nothing blocking visibility + if (tr_line_x + tr_line_y + tr_line_z == 3) tr_result = FALSE; + // Central trace is good but either side has hit something? + else if (tr_line_x) { + // Hit a monster on either side = always fail! + if (tr_leftmon || tr_rightmon) tr_result = TRUE; + // The crssbow bolt is fired from the LEFT side, only right can be clear + else if (self.classtype == CT_MONDCROSS) { + if (tr_line_y == 0 && tr_line_z == 1) tr_result = FALSE; + } + // Default - space available on either side + else if (tr_line_y + tr_line_z == 1) tr_result = FALSE; + } + + if (self.debuglvl) { + dprint("Trace ("); dprint(ftos(tr_line_x)); + dprint(" "); dprint(ftos(tr_line_y)); + dprint(" "); dprint(ftos(tr_line_z)); + dprint(") Ent ("); dprint(ftos(tr_leftmon)); + dprint(" "); dprint(ftos(tr_rightmon)); + dprint(") = ("); dprint(ftos(tr_result)); + dprint(")\n"); + } + return tr_result; +}; + +/*====================================================================== + infront (target entity) + - relies on self being set correctly before entering this function + - returns 1 if the entity is in front (in sight) of self +======================================================================*/ +float(entity targ) infront = +{ + local vector vec; + local float dot; + + makevectors (self.angles); // sets v_forward, etc globals + vec = normalize (targ.origin - self.origin); + dot = vec * v_forward; + + if ( dot > 0.3) return TRUE; + else return FALSE; +}; + +/*====================================================================== + range (target entity) + returns the range catagorization of an entity reletive to self + uses constants defined in defs.qc +======================================================================*/ +float(entity targ) range = +{ + local vector spot1, spot2; + local float r; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + r = vlen (spot1 - spot2); + + if (r < MON_RANGE_MELEE) return RANGE_MELEE; // <120 = MELEE + else if (r < MON_RANGE_NEAR) { + if (r < (self.maxs_x + targ.maxs_x) * SQRT2 + 30) // PM: Extend melee range for huge monsters like the dragon. + return RANGE_MELEE; + else + return RANGE_NEAR; // <500 = NEAR + } + else if (r < MON_RANGE_MID) return RANGE_MID; // <1000 = MID + return RANGE_FAR; // >1000 = FAR +}; + +/*====================================================================== + range_distance (target entity) + returns the vector distance between two points +======================================================================*/ +float(entity targ, float flat2d) range_distance = +{ + local vector spot1, spot2; + local float r; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + if (flat2d) { spot1_z = spot2_z = 0; } + r = vlen (spot1 - spot2); + + return r; +}; + +/*====================================================================== + rangeattack_check + check to see if (source) can get a clear shot at (targ) + Ignores any water/air content checks +======================================================================*/ +float (entity source, entity targ) rangeattack_check = +{ + local vector spot1, spot2; + local float r; + + // origin+offset, otherwise cannot see player up/down slopes + spot1 = source.origin + source.view_ofs; + spot2 = targ.origin + targ.view_ofs; + r = vlen(spot1 - spot2); + + // Maximum range attack (was 600 taken from shambler, changed to 1000) + if (r > MON_RANGE_MID) return FALSE; + + // Monsters without melee should always range anything really close + if (!source.th_melee && r < MON_RANGE_MELEE) return TRUE; + + traceline (spot1, spot2, FALSE, source); // trace hits monsters (infighting) + if (trace_ent != targ) return FALSE; // don't have a clear shot + + // Does the world define any water transparency + if (liquid_alpha == 1 || source.liquidblock) { + // sight line crossed contents + if (trace_inopen && trace_inwater) return FALSE; + } + + return TRUE; +}; + +/*====================================================================== + targangle + Returns what angle the target entity is relative to the source entity + Useful for checking where the player is located. + source, targ = entity origins to create vector angle + reverse = the creation of the vector can be reversed + offset = shift the final angle clockwise. (frontal sight cone 315-45) +======================================================================*/ +float(entity source, entity targ, float offset, float reverse) targangle = +{ + local float targ_dir, targ_ang; + + // Calculate vector angle between two points (source, target) + if (reverse) targ_dir = vectoyaw(source.origin - targ.origin); + else targ_dir = vectoyaw(targ.origin - source.origin); + + targ_ang = anglemod( (source.angles_y - targ_dir) + offset ); + return targ_ang; +}; + +// Modified version of targangle not using entities but supplied origins +// Targets Y angles needs to be supplied as no entity reference available +float(vector source, vector targ, float offset, float reverse, float dst_ang) viewangle = +{ + local float targ_dir, targ_ang; + + // Calculate vector angle between two points (source, target) + if (reverse) targ_dir = vectoyaw(source - targ); + else targ_dir = vectoyaw(targ - source); + + targ_ang = anglemod( (dst_ang - targ_dir) + offset ); + return targ_ang; +}; + +/*====================================================================== + targzone (source entity, target entity) + - Checks which zone the target enemy is located in relation to source (self) + 0 = Behind (315-45), 1 = Left (45-135), 2 = Front (135-225), Right = (225-315) +======================================================================*/ +float(entity source, entity targ) targzone = +{ + local float target_ang; + + // Work out angle the angle of the player based on the monster (source) + // Add 45 degree offset to shift clockwise the frontal sight cone + target_ang = targangle(source, targ, 45, TRUE); + + if (target_ang > 270) return TARGET_RIGHT; + else if (target_ang > 180) return TARGET_FRONT; + else if (target_ang > 90) return TARGET_LEFT; + else return TARGET_BACK; +}; + + +/*====================================================================== + HuntTarget + Main routine - constantly running/turning towards the enemy +======================================================================*/ +void() HuntTarget = +{ + if (self.health < 1) return; // Dead monsters don't hunt! + //self.fighting = TRUE; + //self.search_time = time + 5; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // Some monsters have special wakeup animations before attacking + self.nextthink = time + 0.1; + self.think = self.th_run; // Start running + // Default 1s wait (NM adjusted) before attacking + + if (self.ryuflags & RYU_ALERT) + SUB_AttackFinished (0.5); // alert monsters don't wait as long... + else + if (!self.attack_instant) SUB_AttackFinished (1); // wait a while before first attack +}; + +/*====================================================================== + FoundTarget + - An enemy target has been found, wakeup and hunt target + - Used by FindTarget once an enemy target has been found + - used by T_Damage (combat.qc) for infighting +======================================================================*/ +void() FoundTarget = { + if (self.health < 1) return FALSE; // Dead monsters don't hunt! + + // Check for Liquid surface block entity key + // if the monster has range attack, can NOW see through liquid surface + if (self.liquidblock == TRUE && self.th_missile) + self.liquidblock = FALSE; + + if ( (self.enemy.flags & FL_CLIENT) ) { + if ( self.charmed ) { + if ( ((self.charmer == self.enemy) || (self.charmer == self.enemy.charmer)) ) { + self.enemy = world; + return ; + } + } + sight_entity = self; // Highlight an angry monster for others + sight_entity_time = time; // reset wakeup timer + } else { + if ( self.charmed ) { + if ( (self.charmer == self.enemy.charmer) ) { + self.enemy = world; + return ; + } + } + } + + //---------------------------------------------------------------------- + // This will cause a group of monsters to all attack the same target + // Using the global sight enemy system which works with FindTarget() + // Always check for an empty sighttarget first because the + // the global sight entity could have an empty targetname + //---------------------------------------------------------------------- + if (self.sighttarget != "") { + if (self.enemy.targetname == self.sighttarget) { + // Make sure the sight target is alive before chasing it + sight_entity = self.enemy; // Highlight target for others + sight_entity_time = time; // reset wakeup timer + monster_sightsound(); // Always make wakeup noise! + } + } + + self.show_hostile = time + 1; // wake up other monsters + // Only play wakeup sound if player, not for other monsters + if (self.enemy.flags & FL_CLIENT && self.health > 0) monster_sightsound(); + HuntTarget (); // Keep running after enemy +}; + +/*====================================================================== + FoundHuntTarget + - This is a combination of FoundTarget and HuntTarget + - Does not do any sight sound, needs to be done outside this func + - Does not pause or wait for any monster, straight to combat + - Has no end funtion state, can decide this afterwards +======================================================================*/ +void(float wakeupothers) FoundHuntTarget = +{ + if (self.health < 1) return; // Dead monsters don't hunt! + if (!self.enemy) return; + + // Check for Liquid surface block entity key + // if the monster has range attack, can NOW see through liquid surface + if (self.liquidblock == TRUE && self.th_missile) + self.liquidblock = FALSE; + + if (self.enemy.flags & FL_CLIENT && wakeupothers == TRUE) { + sight_entity = self; // Highlight an angry monster for others + sight_entity_time = time; // reset wakeup timer + } + + self.show_hostile = time + 1; // wake up other monsters + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + SUB_AttackFinished (1); // wait a while before first attack +}; + +/*====================================================================== + FindTarget + - Main routine for finding a PLAYER target + - Returns TRUE if an enemy was sighted +======================================================================*/ +float() FindTarget = { + local entity client, playtarg, selected, head; + local float r, dist; + + if (self.health < 1) return FALSE; // Dead monsters don't hunt! + + if ( self.charmed ) { + self.effects = (self.effects | EF_DIMLIGHT); + if ( (self.huntingcharmer > FALSE) ) { + UpdateCharmerGoal (); + r = vlen ((self.origin - self.goalentity.origin)); + if ( (r < MIN_CHARMER_DISTANCE) ) { + if ( ((self.huntingcharmer == MOVETYPE_WALK) && (r > TOOCLOSE_CHARMER_DISTANCE)) ) { + return ( FALSE ); + } + StopHuntingCharmer (); + return (TRUE); + } + } else { + if ( (vlen ((self.origin - self.charmer.origin)) > MAX_CHARMER_DISTANCE) ) { + HuntCharmer (); + return (FALSE); + } else { + if ( (vlen ((self.origin - self.charmer.origin)) < TOOCLOSE_CHARMER_DISTANCE) ) { + FleeCharmer (); + return ( FALSE ); + } + } + } + } + + //---------------------------------------------------------------------- + // Does the global sight entity match the enemy sight group? + // Always check for an empty sighttarget first because the + // the global sight entity could have an empty targetname + //---------------------------------------------------------------------- + if (self.sighttarget != "") { + if (sight_entity.targetname == self.sighttarget) { + // Make sure the sight target is alive before chasing it + if (sight_entity.health < 0) self.sighttarget = ""; + else { + // If using enemytarget system, switch off tracking entity first + if (self.enemy.classtype == CT_ENEMYTARGET) SUB_switchEnemyTarget(); + self.enemy = sight_entity; // Switch to new enemy + FoundTarget (); // Run+turn towards new enemy + return TRUE; + } + } + } + //---------------------------------------------------------------------- + // if the first spawnflag bit is set, the monster will only wake up on + // really seeing the player, not another monster getting angry + // Zombies have their ambush/crucified spawnflag mix up fixed + //---------------------------------------------------------------------- + if (sight_entity_time >= time - 0.1 && !(self.spawnflags & MON_AMBUSH) && !self.charmed ) { + client = sight_entity; // Global variable + if (client.enemy == self.enemy) return TRUE; + } else { + if ( self.charmed ) { + selected = world; + dist = CHARMED_RADIUS; + head = findradius (self.origin,CHARMED_RADIUS); + while (head) { + if ( (!(head.flags & FL_NOTARGET) && (head.flags & FL_MONSTER)) ) { + if ( ((visible (head) && (visible_distance < dist)) && (head.health > FALSE)) ) { + if ( (((head != self) && (head != self.charmer)) && (head.charmer != self.charmer)) ) { + selected = head; + dist = visible_distance; + } + } + } + head = head.chain; + } + if ((selected == world)) return ( FALSE ); + client = selected; + } else { + client = checkclient (); // Find a client in current PVS + if ( !client ) return ( FALSE ); // If no client found, return + } + } + + //---------------------------------------------------------------------- + // Checkclient is *supposed* to find ONLY players in the current PVS + // but it seems the code does something slightly different + // Checkclient will return other 'objects' (monsters) who are mad + // at the player, which is suppose to be caught with sight_enemy + // Find the player entity (client,.enemy,world) for specific checks + //---------------------------------------------------------------------- + if (client.flags & FL_CLIENT) playtarg = client; + else { + if (client.enemy) playtarg = client; + else playtarg = find(world,targetname,"player"); + } + + //---------------------------------------------------------------------- + // If current enemy = client (player), already got *that* target + //---------------------------------------------------------------------- + if (client == self.enemy) return FALSE; + + //---------------------------------------------------------------------- + // Check for debug mode, invis artifact, menu system active + //---------------------------------------------------------------------- + if (playtarg.flags & FL_NOTARGET && !self.charmed) return FALSE; + if (playtarg.items & IT_INVISIBILITY) return FALSE; + if (intermission_running) return FALSE; + + //---------------------------------------------------------------------- + // Is the client/player >1000 = FAR do nothing, too far away + //---------------------------------------------------------------------- + enemy_range = range (client); + if (enemy_range == RANGE_FAR) return FALSE; + + //---------------------------------------------------------------------- + // Do not wake up unless the client (player/monster) is visible + //---------------------------------------------------------------------- + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + + if (!self.charmed) { + //---------------------------------------------------------------------- + // (Distance >128 && < 500) Is client infront+side and hostile? + // show_hostile flag is set when the player fires a weapon + //---------------------------------------------------------------------- + if (enemy_range == RANGE_NEAR) { + if (client.show_hostile < time && !infront (client)) + return FALSE; + } + //---------------------------------------------------------------------- + // (Distance < 1000) Is client infront? + //---------------------------------------------------------------------- + else if (enemy_range == RANGE_MID) { + if (!infront (client)) return FALSE; + } + } + + // At this point if the enemy is <120 (melee range) the enemy + // will always wake up and turn around towards the player + + //---------------------------------------------------------------------- + // Finally got a target, check if its a player + // This is an odd sitation because at this point client *should* be + // the player/client and this code tries to fix the problem by + // searching through enemy of enemy chains + //---------------------------------------------------------------------- + self.enemy = client; + + // Don't hurt other player charmed pets! + if ( !(client.flags & FL_CLIENT) && !self.charmed && !self.enemy.charmed ) { + // Is the enemy of the enemy a player? + self.enemy = self.enemy.enemy; + if ( !(client.enemy.flags & FL_CLIENT) ) { + self.enemy = world; + return FALSE; + } + } + FoundTarget (); // Run+turn towards new enemy + return TRUE; // stop previous routine got a target + +}; + + +//====================================================================== +// ai_face (generic) +//---------------------------------------------------------------------- +void() ai_face = +{ + if (self.health < 1) return;// Unusual check, caught elsewhere + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); // Done in code +}; + +//---------------------------------------------------------------------- +// ai_forward +//---------------------------------------------------------------------- +void(float dist) ai_forward = +{ + walkmove (self.angles_y, dist); +}; + +//---------------------------------------------------------------------- +// ai_forward + ai_face +//---------------------------------------------------------------------- +void(float dist) ai_faceforward = +{ + ai_face(); + walkmove (self.angles_y, dist); +}; + +//---------------------------------------------------------------------- +// ai_back + backface +//---------------------------------------------------------------------- +void(float dist) ai_back = +{ + walkmove ( (self.angles_y+180), dist); +}; + +void(float dist) ai_backface = +{ + ai_face(); + ai_back(dist); +}; + +//---------------------------------------------------------------------- +// ai_pain (does nothing, just uses ai_back instead) +//---------------------------------------------------------------------- +void(float dist) ai_pain = +{ + ai_back (dist); +}; + +//---------------------------------------------------------------------- +// ai_painforward +//---------------------------------------------------------------------- +void(float dist) ai_painforward = +{ + walkmove (self.angles_y, dist); + // Not sure why Id used ideal_yaw when other functions use angles_y +// walkmove (self.ideal_yaw, dist); +}; + +//---------------------------------------------------------------------- +// ai_turn (Very costly function, re-using FindTarget again) +//---------------------------------------------------------------------- +void() ai_turn = +{ + if (FindTarget ()) return; + ChangeYaw (); // Code function +}; + + +//---------------------------------------------------------------------- +// FacingIdeal +//---------------------------------------------------------------------- +float() FacingIdeal = +{ + local float delta; + + delta = anglemod(self.angles_y - self.ideal_yaw); + if (delta > 45 && delta < 315) return FALSE; + else return TRUE; +}; + +//---------------------------------------------------------------------- +// ai_trackenemy +//---------------------------------------------------------------------- +void() ai_trackenemy = +{ + if (visible(self.enemy)) { + self.attack_track = self.enemy.origin; + ai_face(); + } +}; + +//---------------------------------------------------------------------- +// ai_resetangles +//---------------------------------------------------------------------- +void() ai_resetangles = +{ + // There is a chance when finished a monster jump that some + // of the angles (X/Z) values are wrong and need resetting + // Should only be used after jump functions + self.angles_x = self.angles_z = 0; +}; + +//---------------------------------------------------------------------- +// ai_charge (generic) +// - The monster is in a melee attack, +// so get as close as possible to .enemy +//---------------------------------------------------------------------- +void(float dist) ai_charge = +{ + ai_face (); + movetogoal (dist); +}; + +//---------------------------------------------------------------------- +// ai_chargenoturn (generic) +//---------------------------------------------------------------------- +void(float dist) ai_chargenoturn = +{ + movetogoal (dist); +}; + +//---------------------------------------------------------------------- +// ai_charge_side (generic) +//---------------------------------------------------------------------- +void() ai_charge_side = +{ + local vector dtemp; + local float heading; + + // aim to the left of the enemy for a flyby + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); + + makevectors (self.angles); + dtemp = self.enemy.origin - (30 * v_right); + heading = vectoyaw(dtemp - self.origin); + + walkmove(heading, 20); +}; + +//---------------------------------------------------------------------- +// ai_charge_front (generic) +//---------------------------------------------------------------------- +void() ai_charge_front = +{ + local float heading; + + ai_face(); // Turn towards enemy first + + makevectors (self.angles); + heading = vectoyaw(self.enemy.origin - self.origin); + + walkmove(heading, 10); +}; + +/*====================================================================== + ai_run_melee + - Turn and close until within an angle to launch a melee attack +======================================================================*/ +void() ai_run_melee = +{ + self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + + //---------------------------------------------------------------------- + // Facing towards the ENEMY target? (ideal_yaw) + //---------------------------------------------------------------------- + if (FacingIdeal()) { + self.th_melee (); + self.attack_state = AS_STRAIGHT; + } +}; + +/*====================================================================== + ai_run_missile + - Turn in place until within an angle to launch a missile attack +======================================================================*/ +void() ai_run_missile = +{ + self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + + //---------------------------------------------------------------------- + // Facing towards the ENEMY target? (ideal_yaw) + //---------------------------------------------------------------------- + if (FacingIdeal()) { + self.th_missile (); + self.attack_state = AS_STRAIGHT; + } +}; + +/*====================================================================== + ai_run_jump + - Turn in place until within an angle to jump attack +======================================================================*/ +void() ai_run_jump = +{ + self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + + //---------------------------------------------------------------------- + // Facing towards the ENEMY target? (ideal_yaw) + //---------------------------------------------------------------------- + if (FacingIdeal()) { + self.th_jump (); + self.attack_state = AS_STRAIGHT; + } +}; + +/*====================================================================== + ai_run_slide + - Strafe sideways, but stay at aproximately the same range +======================================================================*/ +void(float dist) ai_run_slide = +{ + local float ofs; + + // It is better to re-calcuate this than wait for ai_run to update + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + // self.ideal_yaw = enemy_yaw; // This is defined in ai_run + ChangeYaw (); // Code function + if (self.lefty > 0) ofs = 90; + else ofs = -90; + + // Tests if monsters can strafe or not by moving the monster + if (walkmove (self.ideal_yaw + ofs, dist)) return; + + // Switch strafe sides for later use + self.lefty = rint(1 - self.lefty); + if (walkmove (self.ideal_yaw - ofs, dist)) return; + + // Try moving backwards if both sides are blocked + walkmove (self.ideal_yaw - 180, dist); +}; + +/*====================================================================== + ai_run_sidestep + - Turn 90 degrees and move to the side +======================================================================*/ +void(float dist) ai_run_sidestep = +{ + local float ofs; + + if (self.attack_sidestep < time) { + self.attack_sidestep = time + 4 + random()*4; + self.lefty = rint(1 - self.lefty); + } + if (self.lefty > 0) ofs = 85; + else ofs = -85; + + // Work out angle to face for enemy and then turn +/- 90 degrees + // so that the monster is moving sideways to the enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin) + ofs; + ChangeYaw (); + + // Tests if monsters can move sideways + if (walkmove (self.ideal_yaw, dist)) return; + // Switch strafe sides for later use + self.attack_sidestep = -1; +}; + +/*====================================================================== + ai_run_backwards + - Turn 180 degrees and move backwards +======================================================================*/ +void(float dist) ai_run_backward = +{ + // Work out angle to face for enemy and then turn +/- 90 degrees + // so that the monster is moving sideways to the enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin) + 180; + ChangeYaw (); + + // Tests if monsters can move backwards + if (walkmove (self.ideal_yaw, dist)) return; + // Cannot walk backwards, move sideways instead + self.attack_state = AS_SIDESTEP; +}; + +/*====================================================================== + ai_foundbreakable + Check if the monster is allowed to break the breakable!?! +======================================================================*/ +float(entity source, entity targ, float ignorenoshoot) ai_foundbreakable = +{ + // Found a breakable in the way? + if (targ.classtype == CT_FUNCBREAK) { + // Check if a monster and nomonster damage/trigger allowed? + if (source.flags & FL_MONSTER && targ.spawnflags & BREAK_NOMONSTER) + return FALSE; + // Ignoring noshoot spawnflag? (designed for jump/missile events) + else if (ignorenoshoot == TRUE) return TRUE; + // Can the breakable be damaged? + else if (targ.spawnflags & BREAK_NOSHOOT) return FALSE; + // Its a breakable that breaks! + else return TRUE; + } + return FALSE; +}; + +/*====================================================================== + ai_immunedamage + Check if a breakable/pushable is immune to damage from monsters +======================================================================*/ +float(entity source, entity targ) ai_immunedamage = +{ + // Found a breakable? + if (targ.classtype == CT_FUNCBREAK) { + // Check no damage spawnflag? + if (source.flags & FL_MONSTER && targ.spawnflags & BREAK_NOMONSTER) + return TRUE; + } + // Found a pushable? + else if (targ.classtype == CT_FUNCPUSHABLE) { + // Check no damage spawnflag? + if (source.flags & FL_MONSTER && targ.spawnflags & PUSH_NOMONSTER) + return TRUE; + } + return FALSE; +}; + +/*====================================================================== + ai_damagebreakable + Check if the monster (self) can hit any breakables infront (target) + Triple trace infront (self.angles) up,middle,down + If any breakables found, damage them to see if they will break +======================================================================*/ +void(float brkdmg) ai_damagebreakable = +{ + local vector spot1, spot2; + local float ldmg; + + // Setup damage, forward facing vector and initial trace origin + ldmg = (random() + random() + random()) * brkdmg; + makevectors(self.angles); + spot1 = self.origin; + + // Trace directly infront of entity using angles + spot2 = spot1 + v_forward * 100; + traceline (spot1, spot2, TRUE, self); + if (ai_foundbreakable(self, trace_ent, FALSE)) { + // Check for any monster damage modifier on breakable + if (trace_ent.brkmondmg>0) ldmg = ldmg * trace_ent.brkmondmg; + T_Damage (trace_ent, self, self, ldmg, DAMARMOR); + } + else { + // Trace upwards + spot2 = spot1 + v_forward * 100 + v_up * 64; + traceline (spot1, spot2, TRUE, self); + if (ai_foundbreakable(self, trace_ent, FALSE)) { + // Check for any monster damage modifier on breakable + if (trace_ent.brkmondmg>0) ldmg = ldmg * trace_ent.brkmondmg; + T_Damage (trace_ent, self, self, ldmg, DAMARMOR); + } + else { + // Trace downwards + spot2 = spot1 + v_forward * 100 - v_up * 64; + traceline (spot1, spot2, TRUE, self); + if (ai_foundbreakable(self, trace_ent, FALSE)) { + // Check for any monster damage modifier on breakable + if (trace_ent.brkmondmg>0) ldmg = ldmg * trace_ent.brkmondmg; + T_Damage (trace_ent, self, self, ldmg, DAMARMOR); + } + } + } +}; + +/*====================================================================== + ai_jumpbreakable + Check if the monster can trigger a breakable from jump attack +======================================================================*/ +void(float brkdmg) ai_jumpbreakable = +{ + if (ai_foundbreakable(self, other,TRUE) && other.brktrigjump != 0) { + // Found a breakable which is prone to jump damage + trigger_ent(other, self); + } + else ai_damagebreakable(brkdmg); // Damage any breakables +}; + +/*====================================================================== + ai_checkmelee + Check if the monster (self) can attack enemy (target) + and returns TRUE if the monster is within XYZ range +======================================================================*/ +float(float attackdist) ai_checkmelee = +{ + local vector spot1, spot2; + local float delta, zdiff; + + // Calculate distance and z axis difference seperate + spot1 = SUB_orgEnemyTarget(); + spot2 = self.origin; + zdiff = fabs(spot1_z - spot2_z); + spot1_z = spot2_z = 0; // Flatten Z axis before vector length + delta = vlen(spot1 - spot2); // Calculate vector distance + + // Is the enemy too far away and the zaxis is wrong (too low/high) + if (delta < attackdist && zdiff < MONAI_MELEEZAXIS) return TRUE; + else return FALSE; +}; + +/*====================================================================== + ai_melee (generic) + - slashing type of damage facing forward + really assuming the monster is stationary while attacking +======================================================================*/ +void() ai_melee = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEFRONT)) return; // Too far away + + // Can the target bleed? - no blood/damage, quick exit + // This candamage test not in origina id code (sync'd to melee_side) + if (!CanDamage (self.enemy, self)) return; + + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Only spawn blood/gore/sound every second + if (self.meleetimer < time) { + self.meleetimer = time + 1; + SpawnMeatSpray (self, self.enemy, random() * 100); + } + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Some melee weapons have swing and hit as separate sounds + // This is trigger_once per melee combat swing + // No check if meleehitsound is defined or not + if (self.meleecontact) { + self.meleecontact = FALSE; + sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + ai_meleesmash (generic) + - large smashing damage overhead attack, usually a single strike + really assuming the monster is stationary while attacking +======================================================================*/ +void(float dmg_multiplier) ai_meleesmash = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(3*dmg_multiplier); // Damage any breakables + if (!ai_checkmelee(self.meleerange)) return; // Too far away + + // Can the target bleed? - no blood/damage, quick exit + // This candamage test not in origina id code (sync'd to melee_side) + if (!CanDamage (self.enemy, self)) return; + + // This function is designed for monsters attacking players or infighting + // If this is infighting do more damage as it will look more impressive + // Also if this damage is enough to kill in a single blow, gib for effect + if (self.enemy.flags & FL_MONSTER) dmg_multiplier = dmg_multiplier * 2; + ldmg = (random() + random() + random()) * dmg_multiplier; + if (self.enemy.health < ldmg) ldmg = ldmg*3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Some melee weapons have swing and hit as separate sounds + // This is trigger_once per melee combat swing + if (self.meleecontact) { + self.meleecontact = FALSE; + if (self.meleehitsound) sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + ai_melee_side (generic) + - move forward/side and attack (can cause animation sliding errors) + this is really designed for glancing blows and monsters which are + moving fast like they are charging at the player +======================================================================*/ +void() ai_melee_side = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(10); // Damage any breakables + ai_charge_side(); // move (20 units) to the side of enemy + if (!ai_checkmelee(MONAI_MELEESIDE)) return; // Too far away + + // Can the target bleed? - no blood/damage, quick exit + if (!CanDamage (self.enemy, self)) return; + + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, random() * 50); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Some melee weapons have swing and hit as separate sounds + // This is trigger_once per melee combat swing + // No check if meleehitsound is defined or not + if (self.meleecontact) { + self.meleecontact = FALSE; + sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + ai_shockwave + - produce a large ground slam/shockwave effect + - Used by hammer ogres and golems +======================================================================*/ +void() ai_shockwave_think = +{ + self.wait = rint((time - self.ltime)*10); + if (self.wait > 6) SUB_Remove(); + else { + self.frame = self.wait; + if (self.wait > 4) { + if (!self.delay) {self.delay = time;} + self.alpha = 1-((time - self.delay)*5); + } + self.angles_y = anglemod(self.angles_y + rint(random()*20)); + self.nextthink = time + TIME_MINTICK; + } +}; + +//---------------------------------------------------------------------- +void(vector imp_vec, float imp_damage, float imp_radius, float imp_forward, float imp_up) ai_shockwave = +{ + local entity swave, sjump; + local vector impact, fvel; + local float vdist, vpercent, vpart; + local float impzdiff; + + self.effects = self.effects | EF_MUZZLEFLASH; + // Check if the player is close enough for damage? + self.meleecontact = TRUE; + ai_meleesmash(imp_damage); + self.meleecontact = FALSE; + + // Play impact sound and work out where the impact is going to happen + sound (self, CHAN_WEAPON, self.meleehitsound, 1, ATTN_IDLE); + makevectors (self.angles); +// impact = self.origin + v_forward*imp_vec_x + v_right*imp_vec_y + v_up*imp_vec_z; + impact = self.origin + attack_vector(imp_vec); + + // Push all entities within a certain radius outwards + // Do this find search before spawning ring and particles + // findradius will find ALL entities regardless of type + sjump = findradius(impact, imp_radius); + while(sjump) { + // Ignore monster (self) + if (sjump != self) { + // Only affect players and other monsters + if (sjump.flags & FL_CLIENT || sjump.flags & FL_MONSTER) { + // Exclude statues, stone/heavy monsters and bosses! + if (sjump.classgroup != CG_STONE && sjump.bossflag == FALSE) { + // Is the entity on the ground? + if (sjump.flags & FL_ONGROUND) { + // Is the entity too far above or below the impact? + impzdiff = fabs(sjump.origin_z - impact_z); + if (impzdiff < MONAI_IMPACTZAXIS) { + // Distance between impact and enemy + vdist = vlen(sjump.origin - impact); + // Percentage of impact force + vpercent = 1 - (vdist / imp_radius); + // Monsters have less impact + if (sjump.flags & FL_MONSTER) vpercent = vpercent * 0.75; + // Ogre facing angle (easier to understand) + makevectors(self.angles); + // Combine forward/up force with existing velocity + fvel = (v_forward * (imp_forward * vpercent)) + (v_up * (imp_up * vpercent)); + sjump.velocity = sjump.velocity + fvel; + sjump.flags = sjump.flags - (sjump.flags & FL_ONGROUND); + } + } + } + } + } + sjump = sjump.chain; + } + + // Spawn impact model ring on the ground + swave = spawn(); + swave.mdl = MODEL_PROJ_RINGSHOCK; + setmodel(swave,swave.mdl); + setsize(swave, VEC_ORIGIN, VEC_ORIGIN); + setorigin(swave, impact); // on floor, slight up (2 pixels) + swave.solid = SOLID_NOT; // No interaction with world + swave.movetype = MOVETYPE_NONE; // Static item, no movement + swave.think = ai_shockwave_think; + swave.nextthink = time + TIME_MINTICK; // High time loop + swave.ltime = swave.nextthink; + + // Spawn particle explosion where impact is located + vpart = 64 + rint(random()*64); + particle_explode(impact, vpart, 0.5, PARTICLE_BURST_FIRE, PARTICLE_BURST_SHOCKWAVE); +}; + +// From Drake +float(float yaw, float dist) flat_move = { + local entity swap; + + swap = self.enemy; + self.enemy = world; // This prevents 'self' from going up/down. + dist = walkmove (yaw, dist); // After this, dist = TRUE or FALSE. + self.enemy = swap; + return dist; +}; + +// From Drake +// This is 'movetogoal' without the vertical movement. +void(float dist) flat_goal = { + local entity swap; + + swap = self.enemy; + self.enemy = world; // This prevents 'self' from going up/down. + movetogoal (dist); + self.enemy = swap; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_subskeep.qc b/QC_other/QC_keep/ai_subskeep.qc new file mode 100644 index 00000000..fd6a1f12 --- /dev/null +++ b/QC_other/QC_keep/ai_subskeep.qc @@ -0,0 +1,7 @@ +void (entity destEnt, float trackSpeed) ai_track = { + local vector dir; + + dir = (destEnt.origin + destEnt.view_ofs); + dir = normalize ((dir - self.origin)); + self.velocity = (dir * trackSpeed); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_tether.qc b/QC_other/QC_keep/ai_tether.qc new file mode 100644 index 00000000..f9ae25c9 --- /dev/null +++ b/QC_other/QC_keep/ai_tether.qc @@ -0,0 +1,136 @@ +/*====================================================================== + MONSTER TETHER SYSTEM + +======================================================================*/ +// new entity keys + +.string tethertarget; // String name to link tethering too +.entity tethertarg; // Entity to track for tether system +.void() th_tether; // Function to call when at max range +.float tethered; // is the monster tethered during combat +.float tetherrange; // The circular range around tether point +.float tetherdist; // Distance from nonster to tether point +.float tetherenemy; // Distance from enemy to tether point +.float tetherwait; // Amount of time to wait before returning +.float tethertimer; // Time before returning to tether point +.float tetherturn; // Make sure monster turns towards enemy +.float tetherpause; // % to not pause attack at max range +.entity tetherfocus; // Enemy to turn towards while waiting + +float TETHER_RADIUS = 300; // Default tether radius +float TETHER_WAIT = 30; // Default timer to wait before reset + +// Defined under defs.qc +//.float tetherlock; // Is the monster locked from movement + +//---------------------------------------------------------------------- +// Check for tether point (find and setup entity) +//---------------------------------------------------------------------- +void() setup_tethersystem = +{ + // Check if the tether system be setup already + if (self.tethertarget != "") { + // Check for range attack, cannot tether if no range + if (!self.th_missile) { + dprint("\b[TETHER]\b No range attack for "); + dprint(self.tethertarget); + dprint("\n"); + self.tethertarget = ""; + return; + } + + // Find the tether point (has to be path corner) + self.tethertarg = find(world, targetname, self.tethertarget); + if (self.tethertarg != world) { + // Tether system is active (reset lock) + self.tethered = TRUE; + self.tetherlock = FALSE; + // Setup default tether range + if (self.tetherrange < 32) self.tetherrange = TETHER_RADIUS; + if (self.tetherwait <= 0) self.tetherwait = TETHER_WAIT; + // Reset distances (updated in check function) + self.tetherdist = self.tetherenemy = 0; + // No stand/walk timer active yet + self.tethertimer = LARGE_TIMER; + // Check for tether function (def=missile) + if (!self.th_tether) self.th_tether = self.th_missile; + // Don't need tethertarget anymore + self.tethertarget = ""; + } + } +}; + +//---------------------------------------------------------------------- +// Check for tether range and return TRUE if at radius limit +//---------------------------------------------------------------------- +float() check_tethersystem = +{ + local vector org; + + // Is the system active on the monster? + if (self.tethered == FALSE) return FALSE; + + // Read tether target for BSP/Ent origin + if (self.tethertarg.bsporigin) org = bmodel_origin(self.tethertarg); + else org = self.tethertarg.origin; + + // Setup tether distance for monster and enemy + self.tetherdist = vlen(self.origin - org); + // Check for enemy entity first before distance check + if (self.enemy) self.tetherenemy = vlen(self.enemy.origin - org); + else self.tetherenemy = 0; + + // Reset lock + self.tetherlock = FALSE; + + // If inside tether range, keep moving + if (self.tetherdist < self.tetherrange) return FALSE; + else { + // If enemy behind tether point, move closer + if (infront(self.tethertarg) && infront(self.enemy)) + return FALSE; + // Reach tether limit + else { + // Can monster see the enemy? + if (enemy_vis) return TRUE; + else { + // Check for no pause override + if (self.tetherpause > 0) { + if (random() <= self.tetherpause) return TRUE; + } + // At max range + cannot see enemy, exit combat + self.tetherfocus = self.enemy; // Save for later + self.enemy = self.goalentity = self.movetarget = world; + self.attack_state = AS_STRAIGHT; + self.think = self.th_stand; // Wait for enemy + self.tethertimer = time + self.tetherwait; + } + } + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check tether timer for stand function +//---------------------------------------------------------------------- +void() check_tethertimer = +{ + if (self.tethered == FALSE) return; // System active? + if (!self.tethertarg) return; // No target active + if (self.enemy) return; // In combat? + + // Has the timer been reached? + if (self.tethertimer < time) { + self.tetherlock = FALSE; // Make sure not set + self.goalentity = self.movetarget = self.tethertarg; + self.tethertimer = LARGE_TIMER; // Timer no longer needed + self.pausetime = 0; // Start walking + } + else { + // Check to see if facing enemy is active? + if (self.tetherturn && self.tetherfocus) { + self.ideal_yaw = vectoyaw(self.tetherfocus.origin - self.origin); + ChangeYaw (); + } + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/ai_wyrm.qc b/QC_other/QC_keep/ai_wyrm.qc new file mode 100644 index 00000000..4a060964 --- /dev/null +++ b/QC_other/QC_keep/ai_wyrm.qc @@ -0,0 +1,237 @@ +//- - - - - - - - - +// Wyrm_WalkMove +//- - - - - - - - - +// Any monster, regardless of size, uses one of three clipping hull sizes. +// +// if (size_x < 3) +// clip size: '0 0 0' +// else if (size_x <= 32) +// clip size: mins = '-16 -16 -24', maxs = '16 16 32' +// else +// clip size: mins = '-32 -32 -24', maxs = '32 32 64' +// +// The largest clip size available is size_x = 64. +// +// Monsters whose actual size is bigger than the largest hull size will +// clip into the north and east walls. Their bbox begins at the point +// mins, and ends at mins + '64 64 88'. The excess is ignored, which is +// why they clip into said walls. +// +// To fix the clipping problem, move a test clip box of the largest size +// multiple times from different points. If each test move succeeds, +// then the actual move should not clip any walls... in theory. +// +// Notes about the anti-clip code below: +// size_x <= 64: Totally unnecessary, just use one of the standard hulls. +// +// 64 < size_x <= 128: Works almost flawlessly. +// +// size_x > 128: Works okay with simple architecture and a relatively flat +// and smooth floor and ceiling (such as the open sky). Works not-so-well +// with complex architecture and broken terrain, where the dragon may clip +// walls and get stuck inside of them. +//- - - - - - - - - +float(float yaw, float dist) Wyrm_WalkMove = { + local entity swap; + local vector org; + local float flat, up; + + org = self.origin; + +// Prepare empty hull for movement. + setorigin (move_box, self.origin); + setsize (move_box, self.mins, self.maxs); +// move_box.solid = SOLID_NOT; +// move_box.movetype = self.movetype; + move_box.flags = FL_FLY; + move_box.angles = self.angles; + move_box.ideal_yaw = self.ideal_yaw; + move_box.enemy = self.enemy; // For walkmove's up/down motion. + move_box.goalentity = self.goalentity; + move_box.owner = self; // So box can pass through owner. +// Splash sound control. Synchronize builtin water values with the dragon's. +// Otherwise, any time the dragon is underwater, Quake will think the +// hull box enters water when it moves, resulting in repeating splash +// sounds each frame. + move_box.h2olevel = self.h2olevel; + move_box.watertype = self.watertype; + + swap = self; + self = move_box; + +// Check if the dragon could move at all. Use the move box to test the move. +// This checks the SW corner. + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + +// Remember this! All movement must have the same elevation. + flat = FALSE; + up = self.origin_z; + +// The dragon could move, so now use move box to check. +// The SW corner is guaranteed to move correctly, so check the other corners. + local float lo, hi; + local vector add; + + lo = swap.mins_x + 32; + hi = swap.maxs_x - 32; + +// Reset hull size to standard big size. + setsize (move_box, VEC_HULL2_MIN, VEC_HULL2_MAX); + + add = '0 0 0'; +// Check NW corner. + add_x = lo; + add_y = hi; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; +// Check NE corner. + add_x = hi; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; +// Check SE corner. + add_y = lo; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; +// If the dragon is larger than a 128x128 area, areas between the corners +// must be checked too. Otherwise, we are done. + if (swap.maxs_x > 96) + { // 4x4 -- Safe up to 256x256. + // Check S face. + add_x = 32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_x = -32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check N face. + add_y = hi; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_x = 32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check W face. + add_x = lo; + add_y = 32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_y = -32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check E face. + add_x = hi; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_y = 32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check the middle. Yes, we need to do this too to prevent the + // dragon for clipping things directly above or below it, such as + // the tops of pyramids or obelisks. + add_x = 32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_x = -32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_y = -32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + add_x = 32; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + } + else if (swap.maxs_x > 64) + { // 3x3 -- Safe up to 192x192. + // Check S face. + add_x = 0; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check N face. + add_y = hi; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check W face. + add_x = lo; + add_y = 0; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check E face. + add_x = hi; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + // Check the middle. Yes, we need to do this too to prevent the + // dragon for clipping things directly above or below it, such as + // the tops of pyramids or obelisks. + add_x = 0; + setorigin (self, org + add); + if (!Ryu_WalkMove (yaw, dist)) + {self = swap; return FALSE;} + if (self.origin_z != up) + flat = TRUE; + } + +// Test movement successful. Now move the dragon for real. + self = swap; + if (flat) + return flat_move (yaw, dist); + return Ryu_WalkMove (yaw, dist); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/breakable.qc b/QC_other/QC_keep/breakable.qc new file mode 100644 index 00000000..693e4ca0 --- /dev/null +++ b/QC_other/QC_keep/breakable.qc @@ -0,0 +1,1543 @@ +/*====================================================================== + Breakable functions +======================================================================*/ +float BREAK_STARTOFF = 1; // Will wait for trigger to spawn +float BREAK_NOSHOOT = 2; // Cannot be damaged/shot, trigger only +float BREAK_EXPLOSION = 4; // Spawn sprite/particle explosion +float BREAK_SILENT = 8; // No initial break sound +float BREAK_DAMAGE = 16; // Rubble does damage on touch +float BREAK_NOMONSTER = 32; // No damage to monsters from rubble +float BREAK_NOSOUND = 64; // No impact sound for rubble +float BREAK_NOROTATE = 128; // No Y rotation for rubble +float BREAK_MOVEDIR = 4096; // Set by entity, movedir/angles active +float BREAK_USEMAP = 8192; // Use func_breakable_template's from the map + +float MONTRIG_NODELAY = 1; // No delay between monster and breakable trigger +float MONTRIG_WAKEUPANIM = 2; // Monster trigger does special wakeup animation + +float BREAKWALL_START_ON = 1; // Switchable bmodel for breakable setups +float BREAKWALL_SOLID = 2; // Solid player collision when active +float BREAKWALL_FADEOUT = 4; // Will fade out after a certain amount of time + +float BTYPE_ROCK = 1; // Default rock/brick +float BTYPE_WOOD = 2; +float BTYPE_GLASS = 3; +float BTYPE_METAL = 4; +float BTYPE_BRICK = 5; +float BTYPE_CERAMIC = 6; +float BTYPE_MAX = 6; +float BTYPE_CUSTOM = 10; + +float BMODTYPE_SELF = 1; // Single self models +float BMODTYPE_CUSTOM = 5; // Custom models +float BMODTYPE_ROCK1 = 10; // ID rock4_1 (dark large bricks) +float BMODTYPE_ROCK2 = 11; // ID rock4_2 (light stone) +float BMODTYPE_ROCK3 = 12; // ID rock3_8 (light vertical) +float BMODTYPE_ROCK4 = 13; // ID city5_3 (white plaster) +float BMODTYPE_ROCK5 = 14; // ID stone1_7b (dark blue ver) +float BMODTYPE_ROCK6 = 15; // ID cliff4 (black rock) +float BMODTYPE_WOOD1 = 20; // ID dung01_3 (dark) +float BMODTYPE_WOOD2 = 21; // ID dung01_2 (light) +float BMODTYPE_WOOD3 = 22; // ID wizwood1_7 (mouldy) +float BMODTYPE_GLASS1 = 30; // ID window1_2 (blue sqr) +float BMODTYPE_GLASS2 = 31; // ID window01_4 (red stain) +float BMODTYPE_GLASS3 = 32; // ID window02_1 (yellow stain) +float BMODTYPE_GLASS4 = 33; // ID window01_3 (purple stain) +float BMODTYPE_METAL1 = 40; // ID metal1_2 (brown generic) +float BMODTYPE_METAL2 = 41; // ID metal4_5 (metal4_4 generic) +float BMODTYPE_METAL3 = 42; // ID metal4_7 (rivet metal panels) +float BMODTYPE_METAL4 = 43; // ID cop1_1 (green generic) +float BMODTYPE_METAL5 = 44; // ID metal2_8 (blue generic) +float BMODTYPE_BRICK1 = 50; // ID wbrick1_5 (large brown) +float BMODTYPE_BRICK2 = 51; // ID city2_3 (small sewer green) +float BMODTYPE_BRICK3 = 52; // ID city6_8 (small drywall greyish) +float BMODTYPE_BRICK4 = 53; // ID wiz1_4 (large white) +float BMODTYPE_BRICK5 = 54; // ID city2_1 (small red brick) +float BMODTYPE_BRICK6 = 55; // ID city1_6 (small brown brick) +float BMODTYPE_BRICK7 = 56; // ID city4_5 (small blue brick) +float BMODTYPE_CERAMIC1 = 60; // Blank atm + +//---------------------------------------------------------------------- +// Breakable objects explosion/impact sounds +string SOUND_BRK_ROCK = "break/rock_impact.wav"; +string SOUND_BRK_WOOD = "break/wood_impact.wav"; +string SOUND_BRK_GLASS = "break/glass_impact.wav"; +string SOUND_BRK_METAL = "break/metal_impact.wav"; +string SOUND_BRK_CERAMIC = "break/ceramic_impact.wav"; + +string SOUND_IMP_ROCK1 = "break/rock_i1.wav"; +string SOUND_IMP_ROCK2 = "break/rock_i2.wav"; +string SOUND_IMP_ROCK3 = "break/rock_i3.wav"; +string SOUND_IMP_ROCK4 = "break/rock_i4.wav"; +string SOUND_IMP_WOOD1 = "break/wood_i1.wav"; +string SOUND_IMP_WOOD2 = "break/wood_i2.wav"; +string SOUND_IMP_WOOD3 = "break/wood_i3.wav"; +string SOUND_IMP_WOOD4 = "break/wood_i4.wav"; +string SOUND_IMP_GLASS1 = "break/glass_i1.wav"; +string SOUND_IMP_GLASS2 = "break/glass_i2.wav"; +string SOUND_IMP_GLASS3 = "break/glass_i3.wav"; +string SOUND_IMP_GLASS4 = "break/glass_i4.wav"; +string SOUND_IMP_METAL1 = "break/metal_i1.wav"; +string SOUND_IMP_METAL2 = "break/metal_i2.wav"; +string SOUND_IMP_METAL3 = "break/metal_i3.wav"; +string SOUND_IMP_METAL4 = "break/metal_i4.wav"; +string SOUND_IMP_CERAMIC1 = "break/ceramic_i1.wav"; +string SOUND_IMP_CERAMIC2 = "break/ceramic_i2.wav"; +string SOUND_IMP_CERAMIC3 = "break/ceramic_i3.wav"; +string SOUND_IMP_CERAMIC4 = "break/ceramic_i4.wav"; + +//---------------------------------------------------------------------- +// Breakable objects explosion/impact models +// ID rock4_1, rock4_2, rock3_8, city5_3, stone1_7b, cliff4 +string MODEL_BRK_ROCK1A = "maps/ad_brk/rock01.bsp"; +string MODEL_BRK_ROCK1B = "maps/ad_brk/rock02.bsp"; +string MODEL_BRK_ROCK1C = "maps/ad_brk/rock03.bsp"; +string MODEL_BRK_ROCK1D = "maps/ad_brk/rock04.bsp"; +string MODEL_BRK_ROCK2A = "maps/ad_brk/rock05.bsp"; +string MODEL_BRK_ROCK2B = "maps/ad_brk/rock06.bsp"; +string MODEL_BRK_ROCK2C = "maps/ad_brk/rock07.bsp"; +string MODEL_BRK_ROCK2D = "maps/ad_brk/rock08.bsp"; +string MODEL_BRK_ROCK3A = "maps/ad_brk/rock09.bsp"; +string MODEL_BRK_ROCK3B = "maps/ad_brk/rock10.bsp"; +string MODEL_BRK_ROCK3C = "maps/ad_brk/rock11.bsp"; +string MODEL_BRK_ROCK3D = "maps/ad_brk/rock12.bsp"; +string MODEL_BRK_ROCK4A = "maps/ad_brk/rock13.bsp"; +string MODEL_BRK_ROCK4B = "maps/ad_brk/rock14.bsp"; +string MODEL_BRK_ROCK4C = "maps/ad_brk/rock15.bsp"; +string MODEL_BRK_ROCK4D = "maps/ad_brk/rock16.bsp"; +string MODEL_BRK_ROCK5A = "maps/ad_brk/rock17.bsp"; +string MODEL_BRK_ROCK5B = "maps/ad_brk/rock18.bsp"; +string MODEL_BRK_ROCK5C = "maps/ad_brk/rock19.bsp"; +string MODEL_BRK_ROCK5D = "maps/ad_brk/rock20.bsp"; +string MODEL_BRK_ROCK6A = "maps/ad_brk/rock21.bsp"; +string MODEL_BRK_ROCK6B = "maps/ad_brk/rock22.bsp"; +string MODEL_BRK_ROCK6C = "maps/ad_brk/rock23.bsp"; +string MODEL_BRK_ROCK6D = "maps/ad_brk/rock24.bsp"; +// ID dung01_3 (dark), dung01_2 (light), wizwood1_7 (mouldy) +string MODEL_BRK_WOOD1A = "maps/ad_brk/wood01.bsp"; +string MODEL_BRK_WOOD1B = "maps/ad_brk/wood02.bsp"; +string MODEL_BRK_WOOD1C = "maps/ad_brk/wood03.bsp"; +string MODEL_BRK_WOOD1D = "maps/ad_brk/wood04.bsp"; +string MODEL_BRK_WOOD2A = "maps/ad_brk/wood05.bsp"; +string MODEL_BRK_WOOD2B = "maps/ad_brk/wood06.bsp"; +string MODEL_BRK_WOOD2C = "maps/ad_brk/wood07.bsp"; +string MODEL_BRK_WOOD2D = "maps/ad_brk/wood08.bsp"; +string MODEL_BRK_WOOD3A = "maps/ad_brk/wood09.bsp"; +string MODEL_BRK_WOOD3B = "maps/ad_brk/wood10.bsp"; +string MODEL_BRK_WOOD3C = "maps/ad_brk/wood11.bsp"; +string MODEL_BRK_WOOD3D = "maps/ad_brk/wood12.bsp"; +// ID window1_2 (blue sqr), window01_4 (red stain), +// window02_1 (yellow stain), window01_3 (purple dragon) +string MODEL_BRK_GLASS1A = "maps/ad_brk/glass01.bsp"; +string MODEL_BRK_GLASS1B = "maps/ad_brk/glass02.bsp"; +string MODEL_BRK_GLASS1C = "maps/ad_brk/glass03.bsp"; +string MODEL_BRK_GLASS1D = "maps/ad_brk/glass04.bsp"; +string MODEL_BRK_GLASS2A = "maps/ad_brk/glass05.bsp"; +string MODEL_BRK_GLASS2B = "maps/ad_brk/glass06.bsp"; +string MODEL_BRK_GLASS2C = "maps/ad_brk/glass07.bsp"; +string MODEL_BRK_GLASS2D = "maps/ad_brk/glass08.bsp"; +string MODEL_BRK_GLASS3A = "maps/ad_brk/glass09.bsp"; +string MODEL_BRK_GLASS3B = "maps/ad_brk/glass10.bsp"; +string MODEL_BRK_GLASS3C = "maps/ad_brk/glass11.bsp"; +string MODEL_BRK_GLASS3D = "maps/ad_brk/glass12.bsp"; +string MODEL_BRK_GLASS4A = "maps/ad_brk/glass13.bsp"; +string MODEL_BRK_GLASS4B = "maps/ad_brk/glass14.bsp"; +string MODEL_BRK_GLASS4C = "maps/ad_brk/glass15.bsp"; +string MODEL_BRK_GLASS4D = "maps/ad_brk/glass16.bsp"; +// ID metal1_2 (brown generic), metal4_5 (metal4_4 generic), +// metal4_7 (rivet metal panels), cop1_1 (green generic) +string MODEL_BRK_METAL1A = "maps/ad_brk/metal01.bsp"; +string MODEL_BRK_METAL1B = "maps/ad_brk/metal02.bsp"; +string MODEL_BRK_METAL1C = "maps/ad_brk/metal03.bsp"; +string MODEL_BRK_METAL1D = "maps/ad_brk/metal04.bsp"; +string MODEL_BRK_METAL2A = "maps/ad_brk/metal05.bsp"; +string MODEL_BRK_METAL2B = "maps/ad_brk/metal06.bsp"; +string MODEL_BRK_METAL2C = "maps/ad_brk/metal07.bsp"; +string MODEL_BRK_METAL2D = "maps/ad_brk/metal08.bsp"; +string MODEL_BRK_METAL3A = "maps/ad_brk/metal09.bsp"; +string MODEL_BRK_METAL3B = "maps/ad_brk/metal10.bsp"; +string MODEL_BRK_METAL3C = "maps/ad_brk/metal11.bsp"; +string MODEL_BRK_METAL3D = "maps/ad_brk/metal12.bsp"; +string MODEL_BRK_METAL4A = "maps/ad_brk/metal13.bsp"; +string MODEL_BRK_METAL4B = "maps/ad_brk/metal14.bsp"; +string MODEL_BRK_METAL4C = "maps/ad_brk/metal15.bsp"; +string MODEL_BRK_METAL4D = "maps/ad_brk/metal16.bsp"; +string MODEL_BRK_METAL5A = "maps/ad_brk/metal17.bsp"; +string MODEL_BRK_METAL5B = "maps/ad_brk/metal18.bsp"; +string MODEL_BRK_METAL5C = "maps/ad_brk/metal19.bsp"; +string MODEL_BRK_METAL5D = "maps/ad_brk/metal20.bsp"; +// ID wbrick1_5 (large brown), city2_3 (small sewer green), +// city6_8 (small drywall greyish), wiz1_4 (large white) +// city2_1 (small red brick), city1_6 (small brown) +string MODEL_BRK_BRICK1A = "maps/ad_brk/brick01.bsp"; +string MODEL_BRK_BRICK1B = "maps/ad_brk/brick02.bsp"; +string MODEL_BRK_BRICK1C = "maps/ad_brk/brick03.bsp"; +string MODEL_BRK_BRICK1D = "maps/ad_brk/brick04.bsp"; +string MODEL_BRK_BRICK2A = "maps/ad_brk/brick05.bsp"; +string MODEL_BRK_BRICK2B = "maps/ad_brk/brick06.bsp"; +string MODEL_BRK_BRICK2C = "maps/ad_brk/brick07.bsp"; +string MODEL_BRK_BRICK2D = "maps/ad_brk/brick08.bsp"; +string MODEL_BRK_BRICK3A = "maps/ad_brk/brick09.bsp"; +string MODEL_BRK_BRICK3B = "maps/ad_brk/brick10.bsp"; +string MODEL_BRK_BRICK3C = "maps/ad_brk/brick11.bsp"; +string MODEL_BRK_BRICK3D = "maps/ad_brk/brick12.bsp"; +string MODEL_BRK_BRICK4A = "maps/ad_brk/brick13.bsp"; +string MODEL_BRK_BRICK4B = "maps/ad_brk/brick14.bsp"; +string MODEL_BRK_BRICK4C = "maps/ad_brk/brick15.bsp"; +string MODEL_BRK_BRICK4D = "maps/ad_brk/brick16.bsp"; +string MODEL_BRK_BRICK5A = "maps/ad_brk/brick17.bsp"; +string MODEL_BRK_BRICK5B = "maps/ad_brk/brick18.bsp"; +string MODEL_BRK_BRICK5C = "maps/ad_brk/brick19.bsp"; +string MODEL_BRK_BRICK5D = "maps/ad_brk/brick20.bsp"; +string MODEL_BRK_BRICK6A = "maps/ad_brk/brick21.bsp"; +string MODEL_BRK_BRICK6B = "maps/ad_brk/brick22.bsp"; +string MODEL_BRK_BRICK6C = "maps/ad_brk/brick23.bsp"; +string MODEL_BRK_BRICK6D = "maps/ad_brk/brick24.bsp"; +string MODEL_BRK_BRICK7A = "maps/ad_brk/brick25.bsp"; +string MODEL_BRK_BRICK7B = "maps/ad_brk/brick26.bsp"; +string MODEL_BRK_BRICK7C = "maps/ad_brk/brick27.bsp"; +string MODEL_BRK_BRICK7D = "maps/ad_brk/brick28.bsp"; + +//---------------------------------------------------------------------- +// Axe impact/swipe/miss sounds +string SOUND_AXE_SWIPE1 = "weapons/axe_swoosh1.wav"; // Fast swipe +string SOUND_AXE_SWIPE2 = "weapons/axe_swoosh2.wav"; // Faster swipe +string SOUND_AXE_WOOD = "weapons/axe_wood.wav"; // wood impact +string SOUND_AXE_GLASS = "weapons/axe_glass.wav"; // glass impact +string SOUND_AXE_METAL = "weapons/axe_metal.wav"; // metal impact +string SOUND_AXE_CERAMIC = "weapons/axe_ceramic.wav"; // ceramic impact +string SOUND_AXE_PLAYER = "player/axhit1.wav"; // ax hit meat (another player) +string SOUND_AXE_STONE = "player/axhit2.wav"; // stone impact + +void() make_breakable_debris; + +//============================================================================= +/*QUAKED func_breakable (0 .5 .8) ? STARTOFF NODAMAGE EXPLOSION SILENT DAMAGE NOMOSTER NOSOUND NOROTATE Not_Easy Not_Normal Not_Hard Not_DM +Spawn breakable objects from a bmodel +-------- KEYS -------- +target : targets to fire when breakable is dead/used (only used once) +target2 : Additional trigger function (need target to be defined as well) +style : pre-defined sound/model types - 1=rock, 2=wood, 3=glass, 4=metal, 5=brick, 6=ceramic, 10=custom +brksound : Initial breaking sound type (override style default) +brkimpsound : Impact sound type (override style default) +brkobjects : Breakable object model type (10-15=rocks, 20-22=woods, 30-32=glass, 40-42=metals, 50-54=brick, 60=ceramic) +noise : Initial breaking sound (unique sound file) +noise1 : Custom Rubble Impact sounds (unique sound files, must have 1 defined) +noise2 : Custom Rubble Impact sound 2 +noise3 : Custom Rubble Impact sound 3 +noise4 : Custom Rubble Impact sound 4 +brkobj1 : Custom Rubble bmodel objects (unique models, must have 1 defined) +brkobj2 : Custom Rubble bmodel objects 2 +brkobj3 : Custom Rubble bmodel objects 3 +brkobj4 : Custom Rubble bmodel objects 4 +health : amount of damage to take before breaking (def 1) +count : minimum quantity to spawn (def 4) +cnt : random quantity to spawn (def 4) =-1 no random qty +dmg : explosive radius damage (emits from center of func object) +pos1 : x=start particle colour, y=random range, z=quantity +brkvelbase : Base amount for velocity of broken parts (def "50 50 100") +brkveladd : Random additions for velocity of broken parts (def "100 100 150") +brkavel : Amount of breaking object angle velocity (def 200) +brkfade : Fade time before rubble fades away (def 4+random()x4) +brkmondmg : Damage multiplier for monster damage against breakable +angles : direction to throw rubble (override default = impact direction) +brktrigjump : Trigger if damaged by jumping monster attack +brktrigmissile : Trigger if damaged by rocket/grenade/shalball/radiusdmg +brktrignoplayer: No player/clients can damage this breakable +brkgravity : Change the gravity for rubble, useful for underwater (Value = 0-1) +-------- SPAWNFLAGS -------- +STARTOFF : Will wait for trigger to spawn +NODAMAGE : Cannot be damaged or shot, trigger only +EXPLOSION : trigger sprite/particle explosion +SILENT : No initial breakage sound +DAMAGE : Spawning rubble can damage (def = 2, use dmg key for touch damage) +NOMONSTER : monsters cannot damage this breakable and/or spawning rubble will not damage monsters +NOSOUND : Spawning rubble has no impact sounds +NOROTATE : Spawning rubble has No Y rotation +-------- NOTES -------- +Spawn breakable ojects from a bmodel +*/ + +//============================================================================= +/*QUAKED func_breakable_spawner (0.5 .5 .8) (-8 -8 -8) (8 8 8) x x EXPLOSION SILENT DAMAGE NOMOSTER NOSOUND NOROTATE Not_Easy Not_Normal Not_Hard Not_DM +Spawn breakable objects from a single point +-------- KEYS -------- +target : targets to fire when breakable is dead/used (only used once) +target2 : Additional trigger function (need target to be defined as well) +style : pre-defined sound/model types - 1=rock, 2=wood, 3=glass, 4=metal, 5=brick, 6=ceramic, 10=custom +brksound : Initial breaking sound type (override style default) +brkimpsound : Impact sound type (override style default) +brkobjects : Breakable object model type (10-15=rocks, 20-22=woods, 30-32=glass, 40-42=metals, 50-54=brick, 60=ceramic) +noise : Initial breaking sound (unique sound file) +noise1 : Custom Rubble Impact sounds (unique sound files, must have 1 defined) +noise2 : Custom Rubble Impact sound 2 +noise3 : Custom Rubble Impact sound 3 +noise4 : Custom Rubble Impact sound 4 +brkobj1 : Custom Rubble bmodel objects (unique models, must have 1 defined) +brkobj2 : Custom Rubble bmodel objects 2 +brkobj3 : Custom Rubble bmodel objects 3 +brkobj4 : Custom Rubble bmodel objects 4 +health : amount of damage to take before breaking (def 1) +count : minimum quantity to spawn (def 4) +cnt : random quantity to spawn (def 4) =-1 no random qty +dmg : explosive radius damage (emits from center of func object) +pos1 : x=start particle colour, y=random range, z=quantity +brkvelbase : Base amount for velocity of broken parts (def "50 50 100") +brkveladd : Random additions for velocity of broken parts (def "100 100 150") +brkavel : Amount of breaking object angle velocity (def 200) +brkfade : Fade time before rubble fades away (def 4+random()x4) +angles : direction to throw rubble (override default = impact direction) +brktrigjump : Trigger if damaged by jumping monster attack +brktrigmissile : Trigger if damaged by rocket/grenade/shalball/radiusdmg +brkgravity : Change the gravity for rubble, useful for underwater (Value = 0-1) +brkvol : Spawning volume vector for breakable point entity +-------- SPAWNFLAGS -------- +EXPLOSION : trigger sprite/particle explosion +SILENT : No initial breakage sound +DAMAGE : Spawning rubble can damage (def = 2, use dmg key for touch damage) +NOMONSTER : Spawning rubble will not damage monsters +NOSOUND : Spawning rubble has no impact sounds +NOROTATE : Spawning rubble has No Y rotation +-------- NOTES -------- +Spawn breakable ojects from a single point +*/ + +//---------------------------------------------------------------------- +void() breakable_remove = +{ + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() breakable_checkfloor = +{ + // Is it time for the breakable to fade away? + if (self.pain_finished > time) { + // Check floor below breakable (global function) + // Origin at base of model + 16 (typical step height) + ent_floorcheck(self, FLOOR_TRACE_BREAK); + + // Keep checking + self.think = breakable_checkfloor; + self.nextthink = time + 0.1; + } + else breakable_remove(); +}; + +//---------------------------------------------------------------------- +void() breakable_particle = +{ + // Are particles disabled? has the model touched something? + if (self.wait) { + // Is there any time left to setup floor checks + if (self.pain_finished > time + 0.1) { + self.think = breakable_checkfloor; + } + else self.think = breakable_remove; + self.nextthink = time + 0.1; + } + else { + // Add a bit of randomness to the particles generated + if (random() < 0.5) self.nextthink = time + 0.01; + else self.nextthink = time + 0.02; + particle (self.origin, self.oldorigin, rint(self.pos1_x + random()*self.pos1_y), self.pos1_z); + // Check for removal timer + if (self.pain_finished < time) self.think = breakable_remove; + } +}; + +//---------------------------------------------------------------------- +void() breakable_touch = +{ + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) { entity_remove(self,0.1); return; } + if (other.classtype == CT_FUNCBREAKOBJ) return; // Ignore other breakables + if (other.solid == SOLID_TRIGGER) return; // Ignore trigger fields + self.wait = TRUE; // No more particles + + if (self.count < 1) { + self.touch = SUB_Null; // no more touching + self.solid = SOLID_NOT; // Turn off world interaction + self.avelocity = '0 0 0'; // Stop any velocity rotation + } + else { + // Does the spawning rubble hurt? + if (self.owner.spawnflags & BREAK_DAMAGE) { + if (other.takedamage) { + if ( other.flags & FL_MONSTER && self.owner.spawnflags & BREAK_NOMONSTER ) {} + else T_Damage(other, self, self, self.owner.dmg, DAMARMOR); + } + } + self.count = self.count - 1; + if (!(self.owner.spawnflags & BREAK_NOSOUND)) { + // Randomize impact sound + self.lip = random()*self.owner.brkimpqty; + if (self.lip < 1) sound(self, CHAN_VOICE, self.owner.noise1, 1, ATTN_BREAK); + else if (self.lip < 2) sound(self, CHAN_VOICE, self.owner.noise2, 1, ATTN_BREAK); + else if (self.lip < 3) sound(self, CHAN_VOICE, self.owner.noise3, 1, ATTN_BREAK); + else sound(self, CHAN_VOICE, self.owner.noise4, 1, ATTN_BREAK); + } + } +}; + +//---------------------------------------------------------------------- +// Can't have multiple radius explosion on same frame +// Always delay them to prevent endless loops +//---------------------------------------------------------------------- +void() funcbreakable_delayexplode = +{ + T_RadiusDamage (self.attachment, self.attachment, self.dmg, self.attachment, DAMAGEALL); +}; + +//====================================================================== +// Main function for generating rubble +//====================================================================== +void() funcbreakable_use = +{ + local vector dirvec, rorg, gvel, dirorg; + local float content_loop, content_flag; + + if (self.waitmin == TRUE) return; // Trigger once block + + //---------------------------------------------------------------------- + // Play initial breaking sound (exception - silent spawnflag) + if (!(self.spawnflags & BREAK_SILENT)) + sound (self.attachment, CHAN_BODY, self.noise, 1, ATTN_NORM); + + //---------------------------------------------------------------------- + // Hide breakable func model (ignore if point entity) + if (self.classtype == CT_FUNCBREAK) { + self.waitmin = TRUE; // Only fire breakable ONCE + self.use = SUB_Null; // No more triggers + self.takedamage = DAMAGE_NO; // No more pain/damage + self.model = ""; // hide model + self.solid = SOLID_NOT; // no world interaction + self.movetype = MOVETYPE_NONE; + // Work out bottom corner of min/max bounding box + self.oldorigin = self.attachment.origin - (self.size*0.5); + } + else if (self.classtype == CT_FUNCBREAKMDL) { + self.waitmin = TRUE; // Only fire breakable ONCE + self.use = SUB_Null; // No more triggers + self.takedamage = DAMAGE_NO; // No more pain/damage + self.model = ""; // hide model + self.solid = SOLID_NOT; // no world interaction + self.movetype = MOVETYPE_NONE; + } + // Breakable point entities just keep on spawning rubble + else self.oldorigin = self.origin; + + //---------------------------------------------------------------------- + // Fire all targets (usually the target is the broken remains) + // Only fire this target once and check based on target field only + // Targets are fired before rubble so pointcontent check can + // take into account any ruined sections and not spawn inside brushwork + if (self.target != "") { + // Check death entity (set in Killed in ai_combat.qc) + if (self.activate.flags & FL_CLIENT) activator = self.activate; + SUB_UseTargets(); + } + // Only fire targets once, remove any further triggering + clear_trigstrs(self); + + //---------------------------------------------------------------------- + // By default all breakables use direction force for rubble + // If angles (movedir) set on breakable use that instead + // Work out direction of impact (using activate passed from combat.qc or trigger.qc) + // All bmodels are labelled with .bsporigin flag (origin = 0,0,0) + // attachment points to self if funcbreakable_wall active + if (self.spawnflags & BREAK_MOVEDIR) dirvec = self.movedir; + else if (!self.activate) dirvec = '0 0 1'; + else { + if (self.activate.bsporigin) dirorg = bmodel_origin(self.activate); + else dirorg = self.activate.origin; + dirvec = vectoangles(self.attachment.origin - dirorg); + } + + // spawn custom templates instead of debris models + if (self.spawnflags & BREAK_USEMAP) { + make_breakable_debris (); + return; + } + //---------------------------------------------------------------------- + // Main rubble loop + while(self.count > 0 && self.brkobjqty > 0) { + //---------------------------------------------------------------------- + // Work out position inside bounding box of breakable bmodel + // Just in case no space to spawn anywhere, dont do an infinite loop + content_loop = 4; + + while (content_loop > 0) { + // Setup broken object inside area (min/max) of parent breakable object + if (self.classtype == CT_FUNCBREAK) { + rorg_x = self.oldorigin_x + random()*self.size_x; + rorg_y = self.oldorigin_y + random()*self.size_y; + rorg_z = self.oldorigin_z + random()*self.size_z; + } + else { + // trigger version is a single origin point with slight wobble + rorg_x = self.origin_x + crandom()*self.brkvol_x; + rorg_y = self.origin_y + crandom()*self.brkvol_y; + rorg_z = self.origin_z + crandom()*self.brkvol_z; + } + // Check point content and keep checking (limited loop cycles) + content_flag = pointcontents(rorg); + if (content_flag != CONTENT_SOLID && content_flag != CONTENT_SKY) content_loop = -1; + else content_loop = content_loop - 1; + } + + //---------------------------------------------------------------------- + // Was there any space to spawn rubble? + if (content_loop < 0) { + // Create new piece of rubble + newmis = spawn(); + newmis.classname = "rubble"; + newmis.classtype = CT_FUNCBREAKOBJ; + newmis.classgroup = CG_TEMPENT; + newmis.owner = self; + + // Setup broken model/bsp (random selection if possible) + self.lip = random()*self.brkobjqty; + if (self.lip < 1) setmodel (newmis, self.brkobj1); + else if (self.lip < 2) setmodel (newmis, self.brkobj2); + else if (self.lip < 3) setmodel (newmis, self.brkobj3); + else setmodel (newmis, self.brkobj4); + + // Setup origin based on previous content checks + setorigin (newmis, rorg); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + //---------------------------------------------------------------------- + // Setup movement and spin parameters + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_BBOX; + if (!(self.spawnflags & BREAK_NOROTATE)) newmis.angles_y = random() * 360; + newmis.avelocity = vecrand(0,self.brkavel,TRUE); + + //---------------------------------------------------------------------- + if (self.spawnflags & BREAK_MOVEDIR && self.movedir_y < 0) { + // Up/down direction with slight X/Y wobble + newmis.velocity_x = crandom() * (self.brkveladd_x/2); + newmis.velocity_y = crandom() * (self.brkveladd_y/2); + if (self.movedir_y == -2) newmis.velocity_z = 0 - random()*50; + else newmis.velocity_z = self.brkvelbase_z + (random()*self.brkveladd_z); + } + else { + // Directional velocity based on angle_y or activator entity + makevectors(dirvec); + gvel = v_forward * (self.brkvelbase_x + random() * self.brkveladd_x); + gvel = gvel + v_right * (crandom() * self.brkveladd_y); + gvel = gvel + v_up * (self.brkvelbase_z + random() * self.brkveladd_z); + newmis.velocity = gvel; + } + //---------------------------------------------------------------------- + // How many bounce sounds - randomly pick 1-2 + if (random() < 0.2) newmis.count = 2; + else newmis.count = 1; + + //---------------------------------------------------------------------- + // Touch and eventual fade functions + newmis.touch = breakable_touch; + newmis.pain_finished = time + self.brkfade + random()*self.brkfade; + newmis.nextthink = time + 0.01; + newmis.think = breakable_particle; + + //---------------------------------------------------------------------- + // Setup particle colour and particle dirction (forward) + newmis.pos1 = self.pos1; + gvel = vectoangles(newmis.velocity); + makevectors(gvel); + newmis.oldorigin = v_forward; + if (self.brkgravity) newmis.gravity = self.brkgravity; + } + + //---------------------------------------------------------------------- + // Keep on spawning rubble! + self.count = self.count - 1; + } + + //---------------------------------------------------------------------- + // breakable trigger entities can spawn debris multiple times + if (self.wait != -1) { + self.count = self.height; + } + else { + // Don't need to be active in the world anymore + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + // Produce explosion sprite/particle effect using attachment entity + if (self.spawnflags & BREAK_EXPLOSION) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.attachment.origin_x); + WriteCoord (MSG_BROADCAST, self.attachment.origin_y); + WriteCoord (MSG_BROADCAST, self.attachment.origin_z); + + SpawnExplosion(EXPLODE_SMALL, self.attachment.origin, SOUND_REXP3); + // Do no remove breakable, the rumble is still using + // the noise keys for impact sounds + entity_hide(self); + } + //---------------------------------------------------------------------- + // create any explosive damage (do this last!) + // setup the radius explosion as a delay to prevent endless loops + if (self.dmg) { + self.think = funcbreakable_delayexplode; + self.nextthink = time + 0.05; + } + } +}; + +//---------------------------------------------------------------------- +void() funcbreakable_touch = +{ + // This only works for monster and special jumping break impacts + if (!(other.flags & FL_MONSTER)) return; + if (other.flags & FL_ONGROUND) return; + if (!self.brktrigjump) return; + self.touch = SUB_Null; + self.use(); +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) funcbreakable_pain = +{ + local float loop_count; + local vector vel; + // As always there are exceptions + // Grenades bounce and don't impact breakables, cannot tell impact point + // If inflictor the same as attacker then particle impact done already + if (inflictor.classtype == CT_PROJ_GL) return; + if (inflictor == attacker) return; + // Check for player exception on damage to breakable + if (inflictor.flags & FL_CLIENT && self.brktrignoplayer) return; + if (attacker.flags & FL_CLIENT && self.brktrignoplayer) return; + + // Something is trying to wear down the breakable with damage + // work out facing angle and project particles upward + makevectors(inflictor.angles); + vel = -v_up*2; + while(loop_count < 4) { + particle (inflictor.origin, vel*0.1, self.bleedcolour + rint(random()*7), damage); + loop_count = loop_count + 1; + } +}; + +//---------------------------------------------------------------------- +void() funcbreakable_death = +{ + if (self.spawnflags & BREAK_NOSHOOT) return; + // Check for player exception on damage to breakable + else if (self.activate.flags & FL_CLIENT && self.brktrignoplayer) return; + else funcbreakable_use(); +}; + + + + +// Qmaster's custom template breakable setup +.string break_template1; +.string break_template2; +.string break_template3; +.string break_template4; +.string break_template5; +.float brk_obj_count1; +.float brk_obj_count2; +.float brk_obj_count3; +.float brk_obj_count4; +.float brk_obj_count5; + +void() break_template_setup = { + if (self.break_template1 != "") precache_model(self.break_template1); + if (self.break_template2 != "") precache_model(self.break_template2); + if (self.break_template3 != "") precache_model(self.break_template3); + if (self.break_template4 != "") precache_model(self.break_template4); + if (self.break_template5 != "") precache_model(self.break_template5); +}; + +// from Qmaster -- dumptruck_ds +void() make_breakable_debris = { + local float i; + local entity new; + + i = 0; + if (self.break_template1 != "") { + while (i < self.brk_obj_count1) { + new = spawn(); + new.model = self.break_template1; + new.origin_x = (self.maxs_x - self.mins_x)*random() + self.mins_x; + new.origin_y = (self.maxs_y - self.mins_y)*random() + self.mins_y; + new.origin_z = (self.maxs_z - self.mins_z)*random() + self.mins_z; + setmodel (new, new.model); //dumptruck_ds + setsize (new, '0 0 0', '0 0 0'); + new.velocity = VelocityForDamage (self.health*2); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.flags = 0; + i++; + } + } + + i = 0; + if (self.break_template2 != "") { + while (i < self.brk_obj_count2) { + new = spawn(); + new.model = self.break_template2; + new.origin_x = (self.maxs_x - self.mins_x)*random() + self.mins_x; + new.origin_y = (self.maxs_y - self.mins_y)*random() + self.mins_y; + new.origin_z = (self.maxs_z - self.mins_z)*random() + self.mins_z; + setmodel (new, new.model); //dumptruck_ds + setsize (new, '0 0 0', '0 0 0'); + new.velocity = VelocityForDamage (self.health*2); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.flags = 0; + i++; + } + } + + i = 0; + if (self.break_template3 != "") { + while (i < self.brk_obj_count3) { + new = spawn(); + new.model = self.break_template3; + new.origin_x = (self.maxs_x - self.mins_x)*random() + self.mins_x; + new.origin_y = (self.maxs_y - self.mins_y)*random() + self.mins_y; + new.origin_z = (self.maxs_z - self.mins_z)*random() + self.mins_z; + setmodel (new, new.model); //dumptruck_ds + setsize (new, '0 0 0', '0 0 0'); + new.velocity = VelocityForDamage (self.health*2); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.flags = 0; + i++; + } + } + + i = 0; + if (self.break_template4 != "") { + while (i < self.brk_obj_count4) { + new = spawn(); + new.model = self.break_template4; + new.origin_x = (self.maxs_x - self.mins_x)*random() + self.mins_x; + new.origin_y = (self.maxs_y - self.mins_y)*random() + self.mins_y; + new.origin_z = (self.maxs_z - self.mins_z)*random() + self.mins_z; + setmodel (new, new.model); //dumptruck_ds + setsize (new, '0 0 0', '0 0 0'); + new.velocity = VelocityForDamage (self.health*2); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.flags = 0; + i++; + } + } + + i = 0; + if (self.break_template5 != "") { + while (i < self.brk_obj_count5) { + new = spawn(); + new.model = self.break_template5; + new.origin_x = (self.maxs_x - self.mins_x)*random() + self.mins_x; + new.origin_y = (self.maxs_y - self.mins_y)*random() + self.mins_y; + new.origin_z = (self.maxs_z - self.mins_z)*random() + self.mins_z; + setmodel (new, new.model); //dumptruck_ds + setsize (new, '0 0 0', '0 0 0'); + new.velocity = VelocityForDamage (self.health*2); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.flags = 0; + i++; + } + } +}; + +//====================================================================== +// Setup all model/sound pre-cache +//---------------------------------------------------------------------- +void() breakable_cache = +{ + if (self.spawnflags & BREAK_USEMAP) { + break_template_setup(); + return; + } + + //---------------------------------------------------------------------- + // If a breakable style key setup, update all undefined sounds/model keys + if (self.style > 0 && self.style < BTYPE_CUSTOM) { + if (!self.brksound) self.brksound = self.style; + if (!self.brkimpsound) self.brkimpsound = self.style; + if (!self.brkobjects) self.brkobjects = self.style*10; + } + else return; + + //---------------------------------------------------------------------- + // make sure initial break sound is within range types (def=rock) + if (self.brksound < BTYPE_ROCK || self.brksound > BTYPE_CUSTOM) + self.brksound = BTYPE_ROCK; + + if (self.brksound == BTYPE_ROCK || self.brksound == BTYPE_BRICK) { + self.noise = SOUND_BRK_ROCK; + // Heavy rocks don't move around too much + if (!self.brkvelbase) self.brkvelbase = '0 0 50'; + if (!self.brkveladd) self.brkveladd = '100 100 100'; + } + else if (self.brksound == BTYPE_WOOD) { + self.noise = SOUND_BRK_WOOD; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 50'; + } + else if (self.brksound == BTYPE_GLASS) { + self.noise = SOUND_BRK_GLASS; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + else if (self.brksound == BTYPE_METAL) { + self.noise = SOUND_BRK_METAL; + if (!self.brkvelbase) self.brkvelbase = '50 50 100'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + else if (self.brksound == BTYPE_CERAMIC) { + self.noise = SOUND_BRK_CERAMIC; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + else if (self.noise == "") { + self.noise = SOUND_EMPTY; + if (!self.brkvelbase) self.brkvelbase = '50 50 50'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + } + precache_sound(self.noise); + + //---------------------------------------------------------------------- + // make sure impack sounds are within range types (def=rock) + if (self.brkimpsound < BTYPE_ROCK || self.brkimpsound > BTYPE_CUSTOM) + self.brkimpsound = BTYPE_ROCK; + // All the impact sounds come in sets of 4 for random variety + self.brkimpqty = 4; + + if (self.brkimpsound == BTYPE_ROCK || self.brkimpsound == BTYPE_BRICK) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_ROCK1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_ROCK2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_ROCK3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_ROCK4; + } + else if (self.brkimpsound == BTYPE_WOOD) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_WOOD1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_WOOD2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_WOOD3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_WOOD4; + } + else if (self.brkimpsound == BTYPE_GLASS) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_GLASS1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_GLASS2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_GLASS3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_GLASS4; + } + else if (self.brkimpsound == BTYPE_METAL) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_METAL1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_METAL2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_METAL3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_METAL4; + } + else if (self.brkimpsound == BTYPE_CERAMIC) { + if (self.noise1 == "") self.noise1 = SOUND_IMP_CERAMIC1; + if (self.noise2 == "") self.noise2 = SOUND_IMP_CERAMIC2; + if (self.noise3 == "") self.noise3 = SOUND_IMP_CERAMIC3; + if (self.noise4 == "") self.noise4 = SOUND_IMP_CERAMIC4; + } + else { + // Workout total amount of active impact sounds (custom can have <4) + // empty slots are filled up with empty sounds for precache reasons + if (self.noise2 != "") { + if (self.noise3 != "") { + if (self.noise4 != "") self.brkimpqty = 4; + else self.brkimpqty = 3; + } + else self.brkimpqty = 2; + } + else self.brkimpqty = 1; + // Cannot have no impact sounds, always setup one sound by default + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.noise1 == "") self.noise1 = SOUND_IMP_ROCK1; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + if (self.noise4 == "") self.noise4 = SOUND_EMPTY; + } + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + precache_sound (self.noise4); + + //---------------------------------------------------------------------- + // make sure breakable objects are within range types (def=rock) + //---------------------------------------------------------------------- + if (self.brkobjects < BMODTYPE_SELF) self.brkobjects = BMODTYPE_ROCK1; + + // Two ways the models can be defined, using the default bmodel types + // or specifying the models via the brkobjs strings + // If the first string is empty, then the default = 4 (pre-defined) + // If first string defined, then count the model strings + + // If the first string is not empty then the mapper has to specify + // exactly what rubble models to choose from (randomly) + // The auto fill option (style/brkobjects) only if brkobj1 = empty + + if (self.brkobj1 == "") self.brkobjqty = 4; // Default + else { + // Need to check for custom breakable quantity first + if (self.brkobj2 != "") { + if (self.brkobj3 != "") { + if (self.brkobj4 != "") self.brkobjqty = 4; + else self.brkobjqty = 3; + } + else self.brkobjqty = 2; + } + else self.brkobjqty = 1; + } + + // All the broken models come in sets of 4 for random variety + // if brkobjects is set to a custom value then model strings will be filled in + // with a blank string and the brkobjqty will be adjusted to actual quanity + if (self.brkobjects == BMODTYPE_ROCK1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK1D; + } + else if (self.brkobjects == BMODTYPE_ROCK2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK2D; + } + else if (self.brkobjects == BMODTYPE_ROCK3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '20 8 1'; // Light Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK3D; + } + else if (self.brkobjects == BMODTYPE_ROCK4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '168 8 1'; // Whiteish + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK4D; + } + else if (self.brkobjects == BMODTYPE_ROCK5) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK5A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK5B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK5C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK5D; + } + else if (self.brkobjects == BMODTYPE_ROCK6) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '1 8 1'; // Black + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK6A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK6B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_ROCK6C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_ROCK6D; + } + else if (self.brkobjects == BMODTYPE_WOOD1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Dark Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_WOOD1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_WOOD1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_WOOD1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_WOOD1D; + } + else if (self.brkobjects == BMODTYPE_WOOD2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '112 8 1'; // Light Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_WOOD2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_WOOD2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_WOOD2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_WOOD2D; + } + else if (self.brkobjects == BMODTYPE_WOOD3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_WOOD3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_WOOD3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_WOOD3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_WOOD3D; + } + else if (self.brkobjects == BMODTYPE_GLASS1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS1D; + } + else if (self.brkobjects == BMODTYPE_GLASS2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '64 8 1'; // Red + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS2D; + } + else if (self.brkobjects == BMODTYPE_GLASS3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '96 8 1'; // Pink/Yellow + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS3D; + } + else if (self.brkobjects == BMODTYPE_GLASS4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '128 4 1'; // Purple + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS4D; + } + else if (self.brkobjects == BMODTYPE_METAL1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL1D; + } + else if (self.brkobjects == BMODTYPE_METAL2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL2D; + } + else if (self.brkobjects == BMODTYPE_METAL3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL3D; + } + else if (self.brkobjects == BMODTYPE_METAL4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL4D; + } + else if (self.brkobjects == BMODTYPE_METAL5) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_METAL5A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_METAL5B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_METAL5C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_METAL5D; + } + else if (self.brkobjects == BMODTYPE_BRICK1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK1B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK1C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK1D; + } + else if (self.brkobjects == BMODTYPE_BRICK2) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '80 8 1'; // Green/Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK2A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK2B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK2C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK2D; + } + else if (self.brkobjects == BMODTYPE_BRICK3) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '48 8 1'; // Green + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK3D; + } + else if (self.brkobjects == BMODTYPE_BRICK4) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '0 8 1'; // Grey/White + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK4A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK4B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK4C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK4D; + } + else if (self.brkobjects == BMODTYPE_BRICK5) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK5A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK5B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK5C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK5D; + } + else if (self.brkobjects == BMODTYPE_BRICK6) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '16 8 1'; // Brown + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK6A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK6B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK6C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK6D; + } + else if (self.brkobjects == BMODTYPE_BRICK7) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '32 8 1'; // Blue + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_BRICK7A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_BRICK7B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_BRICK7C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_BRICK7D; + } + else if (self.brkobjects == BMODTYPE_CERAMIC1) { + if (self.pos1_x + self.pos1_y == 0) self.pos1 = '96 8 1'; // Pink/Yellow + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_GLASS3A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_GLASS3B; + if (self.brkobj3 == "") self.brkobj3 = MODEL_BRK_GLASS3C; + if (self.brkobj4 == "") self.brkobj4 = MODEL_BRK_GLASS3D; + } + else { + // Cannot have no breakable models, always setup one model by default + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK1A; + if (self.brkobj2 == "") self.brkobj2 = MODEL_EMPTY; + if (self.brkobj3 == "") self.brkobj3 = MODEL_EMPTY; + if (self.brkobj4 == "") self.brkobj4 = MODEL_EMPTY; + } + + precache_model(self.brkobj1); + precache_model(self.brkobj2); + precache_model(self.brkobj3); + precache_model(self.brkobj4); +}; + +//---------------------------------------------------------------------- +// Setup defaults +//---------------------------------------------------------------------- +void() breakable_defaults = +{ + // Reset trigger ONCE function + self.waitmin = FALSE; + + // Setup rubble counter = count + random*cnt + if (self.count <= 0) self.count = 4; + if (self.cnt == 0) self.cnt = 4; + + // If cnt = -1 then don't do any random factor, just exact amount + if (self.cnt < 0) self.height = self.count; + else self.height = self.count + rint(random()*self.cnt); + + // Backup rubble count for later (point entity) + self.count = self.height; + + // Special conditions - jump only, missile only, no health + if (self.brktrigjump < 0 || self.brktrigmissile < 0 || self.health < 0) + self.spawnflags = self.spawnflags | BREAK_NOSHOOT; + + // Setup default health + if (self.health == 0) self.health = 1; + + // Rubble damage overrides any explosion damage + if (self.spawnflags & BREAK_DAMAGE) { + if (self.dmg <= 0) self.dmg = 2; + } + else if (self.spawnflags & BREAK_EXPLOSION) { + if (self.dmg <= 0) self.dmg = DAMAGE_MONROCKET; + } + + // Setup default base + additional velocity and angle spin + if (!self.brkvelbase) self.brkvelbase = '50 50 100'; + if (!self.brkveladd) self.brkveladd = '100 100 150'; + if (self.brkavel <= 0) self.brkavel = 200; + if (self.brkfade <= 0) self.brkfade = 4; + + // angles has to be 0 0 0 otherwise brush model is twisted + // Is there any angle direction defined for impact force direction + if (self.angles_y) { + self.movedir_y = self.angles_y; + self.spawnflags = self.spawnflags | BREAK_MOVEDIR; + } + self.mangle = self.angles = '0 0 0'; + + // reset velocity / avelocity just in case of rogue key fields + self.velocity = self.avelocity = '0 0 0'; + + // Can fire other triggers, make sure no delay on breakable function + self.delay = 0; +}; + +//---------------------------------------------------------------------- +void() breakable_on = +{ + // Make sure use function reset + self.use = SUB_Null; + + // Setup collision based on bmodel type + if (self.bsporigin) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.model); + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + + // Used for sound, radius damage and explosion + self.attachment = spawn(); + self.attachment.origin = bmodel_origin(self); + setorigin(self.attachment, self.attachment.origin); + } + else { + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.mdl); + setorigin (self, self.origin); + setsize (self, self.bbmins , self.bbmaxs); + self.angles = self.pos2; + + // Used for sound, radius damage and explosion + self.attachment = self; + } + + if (self.spawnflags & BREAK_NOSHOOT) { + self.takedamage = DAMAGE_NO; + self.th_pain = SUB_Null_pain; + self.th_die = SUB_Null; + } + else { + self.takedamage = DAMAGE_YES; + self.th_pain = funcbreakable_pain; + self.th_die = funcbreakable_death; + self.bleedcolour = self.pos1_x; + // Setup location (origin) to spawn particles + if (self.bsporigin) self.oldorigin = bmodel_origin(self); + else self.oldorigin = self.origin; + } + + // Originally had this as a targetname condition because + // if the breakable is used then it needs a referenced name + // Since adding brktrigjump, brktrigmissile ent keys there are + // external trigger events which need breakable entities to react + self.use = funcbreakable_use; + // Jumping monsters don't often hit the breakable object easily + // Easier to trap jump impact triggering with a touch function + if (self.brktrigjump) self.touch = funcbreakable_touch; +}; + +//====================================================================== +// Basic workhorse of breakable system (bmodel) +//====================================================================== +void() func_breakable = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // reset out of range styles and setup default = BTYPE_ROCK (1) + if (self.style < BTYPE_ROCK || self.style > BTYPE_MAX) self.style = BTYPE_ROCK; + // precache all sound/model stuff + breakable_cache(); + breakable_defaults(); + + // No point setting up a breakable if it cannot be triggered or shoot + if (self.targetname == "" && self.spawnflags & BREAK_NOSHOOT) { + dprint("\b[BRKMDL]\b Cannot be triggered or shoot, removed\n"); + setmodel (self, self.model); // set size and link into world + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + spawn_marker(bmodel_origin(self), SPNMARK_YELLOW); + remove(self); + return; + } + + self.classtype = CT_FUNCBREAK; + self.classgroup = CG_BREAKABLE; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + self.wait = -1; // Always work once, cannot unbreak + + if (self.spawnflags & BREAK_STARTOFF) self.use = breakable_on; + else breakable_on(); +}; + +//---------------------------------------------------------------------- +// Point entity version of breakbles +// Good for producing rubble from areas unreachable players +// Earthquake and rubble and dust from ceilings +//---------------------------------------------------------------------- +void() func_breakable_spawner = +{ + // reset out of range styles and setup default = BTYPE_ROCK (1) + if (self.style < BTYPE_ROCK || self.style > BTYPE_MAX) self.style = BTYPE_ROCK; + // precache all sound/model stuff + breakable_cache(); + breakable_defaults(); + + // Check for targetname + if (self.targetname == "") { + dprint("\b[BRKTRIG]\b Missing targetname\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + self.classtype = CT_FUNCBREAKSPN; + self.classgroup = CG_BREAKABLE; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.brkvol_x < 8) self.brkvol_x = 8; + if (self.brkvol_y < 8) self.brkvol_y = 8; + if (self.brkvol_z < 8) self.brkvol_z = 8; + + // Already a point entity, don't need to generate anything else + self.attachment = self; + self.use = funcbreakable_use; +}; + +//====================================================================== +// General purpose bmodel with toggle states and solid/fade functions +// Could be used for all sorts of situations not involving breakables +//====================================================================== +/*QUAKED func_breakable_wall (0 .5 .8) ? START_ON SOLID FADEOUT +Switchable bmodel for breakable setups with optional collision +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : set to -1 for trigger once condition (def=0) +waitmin : random time to wait before fading out +-------- SPAWNFLAGS -------- +START_ON : Will spawn visible and wait for trigger +SOLID : Will block player/monster movement +FADEOUT : Will fade out after a certain amount of time if visible! +-------- NOTES -------- +Switchable bmodel for breakable setups with optional collision + +=============================================================================*/ +void() breakable_wall_state = +{ + // Show model and setup collision state + if (self.state == STATE_ENABLED) { + // Does the bmodel require any solid collision? + if (self.spawnflags & BREAKWALL_SOLID) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + } + else { + // Bmodel visiable, no collision + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + } + // Add bmodel to the world + setmodel (self, self.mdl); + } + // hide model + else { + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.model = ""; + } +}; + +//---------------------------------------------------------------------- +void() breakable_wall_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + + // Toggle bmodel visible state + if (self.state == STATE_ENABLED) self.state = STATE_DISABLED; + else self.state = STATE_ENABLED; + + // make sure model state is correct + breakable_wall_state(); + + // Is the breakable wall visible and designed to fade away? + if (self.spawnflags & BREAKWALL_FADEOUT && self.state == STATE_ENABLED) { + // Setup random timer and fade away! + self.nextthink = time + self.waitmin + random()*self.waitmin; + self.think = breakable_remove; + // Change the model type and state otherwise will not alpah fade + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_BBOX; + } +}; + +//---------------------------------------------------------------------- +void() func_breakable_wall = { + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCBREAKWALL; + self.classgroup = CG_BREAKABLE; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + self.angles = '0 0 0'; // Stop model twisting + self.mdl = self.model; // Save for later + + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Make sure the bmodel is active in the world before changing state + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.mdl); + + // Something that fades away does it only once + if (self.spawnflags & BREAKWALL_FADEOUT) self.wait = -1; + // Default fade time = time+fade+random()*fade + if (!self.waitmin) self.waitmin = 4; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = breakable_wall_use; + self.estate = ESTATE_ON; + + if (self.spawnflags & BREAKWALL_START_ON) self.state = STATE_ENABLED; + else self.state = STATE_DISABLED; + breakable_wall_state(); +}; + +//====================================================================== +// A point entity which triggers a breakable and monster together +//====================================================================== +/*QUAKED trigger_monsterbreak (.8 .5 .8) (-8 -8 -8) (8 8 8) NODELAY WAKEANIM +Trigger (once) breakable and monster together +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : points to func_breakable (single target) +target2 : points to a monster (single target) +wait : time before breakable is triggered (def 0.2) +-------- SPAWNFLAGS -------- +NODELAY : No delay between monster and breakable trigger +WAKEANIM : Will do special wakeup animation when triggered +-------- NOTES -------- +Trigger (once) breakable and monster together + +======================================================================*/ +void() trig_monbreak_delay = +{ + // Check for breakable targetname first + if (self.target != "") { + // Find breakable (single target only) + self.owner = find(world,targetname,self.target); + if (self.owner.classtype == CT_FUNCBREAK) { + self.owner.activate = self; + self = self.owner; + self.use(); + } + } +}; + +//---------------------------------------------------------------------- +void() trig_monbreak_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Trigger once + self.attack_finished = LARGE_TIMER; + + // Any monster defined to wakeup? + if (self.target2 != "") { + // Find monster (single target only) + self.enemy = find(world,targetname,self.target2); + if (self.enemy.flags & FL_MONSTER) { + if (self.spawnflags & MONTRIG_WAKEUPANIM) self.enemy.wakeuptrigger = TRUE; + trigger_ent(self.enemy, other); + } + } + + // Time to explode breakable? + if (self.spawnflags & MONTRIG_NODELAY) trig_monbreak_delay(); + else { + // setup delay to trigger breakable wall + self.nextthink = time + self.wait; + self.think = trig_monbreak_delay; + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterbreak = +{ + self.classtype = CT_TRIGMONBREAK; + self.classgroup = CG_BREAKABLE; + if (self.wait <= 0) self.wait = 0.2; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trig_monbreak_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED misc_breakable_pot1 (1 .5 .25) (-24 -24 -32) (24 24 32) STARTOFF NODAMAGE EXPLOSION SILENT DAMAGE NOMOSTER NOSOUND NOROTATE +{ model(":progs/misc_pot1.mdl"); } +Breakable ceramic Pot 1 with handles +-------- KEYS -------- +target : Additional targets to fire when model breaks +mangle : Override model orientation (Pitch Yaw Roll) +exactskin : 0=Default, 1=pattern 2, 2=pattern 3, 3= pattern 4 +health : amount of damage to take before breaking (def 1) +count : minimum quantity to spawn (def 4) +cnt : random quantity to spawn (def 4) final qty = count + random(cnt) +dmg : explosive radius damage (emits from center of func object) +pos1 : x=start particle colour, y=random range, z=quantity +brkvelbase : Base amount for velocity of broken parts (def "50 50 100") +brkveladd : Random additions for velocity of broken parts (def "100 100 150") +brkavel : Amount of breaking object angle velocity (def 200) +brkfade : Fade time before rubble fades away (def 4+random()x4) +angles : direction to throw rubble (override default = impact direction) +brkgravity : will change the gravity for rubble, useful for underwater +-------- SPAWNFLAGS -------- +STARTOFF : Will wait for trigger to spawn +NODAMAGE : Cannot be damaged or shot, trigger only +EXPLOSION : trigger sprite/particle explosion +SILENT : No initial breakage sound +DAMAGE : Spawning rubble can damage (def = 2, use dmg key for touch damage) +NOMONSTER : monsters cannot damage this breakable and/or spawning rubble will not damage monsters +NOSOUND : Spawning rubble has no impact sounds +NOROTATE : Spawning rubble has No Y rotation +-------- NOTES -------- +Breakable ceramic Pot 1 with handles +======================================================================*/ +void() misc_breakable_pot1 = +{ + self.classtype = CT_FUNCBREAKMDL; + self.classgroup = CG_BREAKABLE; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 48'; + self.brkvol = '32 32 48'; + self.mdl = "progs/ne_ruins/pot1.mdl"; + precache_model(self.mdl); + self.skin = self.exactskin; + + self.style = BTYPE_CERAMIC; + self.brkobjects = BMODTYPE_CUSTOM; + self.brkobj1 = "progs/ne_ruins/potshard1.mdl"; + self.brkobj2 = "progs/ne_ruins/potshard2.mdl"; + self.brkobj3 = "progs/ne_ruins/potshard3.mdl"; + self.brkobj4 = "progs/ne_ruins/potshard4.mdl"; + self.pos1 = '16 8 1'; // Brown + self.wait = -1; // Only break once + + // Save any custom angles, otherwise random Y rotation + self.pos2 = '0 0 0'; + if (CheckZeroVector(self.mangle) == FALSE) self.pos2 = self.mangle; + else if (query_configflag(SVR_ITEMROTATE) == FALSE) + self.pos2_y = rint(random()*359); + + // precache all sound/model stuff + breakable_cache(); + breakable_defaults(); + + if (self.spawnflags & BREAK_STARTOFF) self.use = breakable_on; + else breakable_on(); +}; diff --git a/QC_other/QC_keep/client.qc b/QC_other/QC_keep/client.qc new file mode 100644 index 00000000..92f0edf4 --- /dev/null +++ b/QC_other/QC_keep/client.qc @@ -0,0 +1,1524 @@ +/*====================================================================== + CLIENT FUNCTIONS +======================================================================*/ +// Vanilla Quake Inventory reset combined flag +// IT_SUPERHEALTH, IT_KEY1, IT_KEY2 +// IT_INVISIBILITY, IT_INVULNERABILITY, IT_SUIT, IT_QUAD +float IT_ITEMRESET = 7864320; // 65536++ +float IT_MODRESET = 8380416; // 8192++ +float IT2_ITEMRESET = 7342016; +float ALL_WEAPONS = 8517759; + +// client_camera.qc +void() SetupIntermissionCamera; +void() CycleIntermissionCamera; + +// client_debuff.qc AND client_power.qc +void() ClientDeBuff; +void() ClientPowerups; +void() GrappleService; + +// player.qc +void(entity inflictor, entity attacker, float damage) player_pain; +void() player_death; +void() player_stand1; + +// triggers.qc +void() trigger_changelevel_finish; + + + + +//======================================================================== +// SPECIAL parm# ENCODING CODE TO STORE MULTIPLE VALUES IN A SINGLE parm# + +// boundary check function +// take a float value and return: + +// < 0 - return 0 +// 0 - MAX - return integer value, always rounding down +// > MAX - return MAX +// where MAX is the max bit value, 255 is used with standard encoder below + +float(float f, float MAX) f_bound = +{ +if (MAX > 16777215) MAX = 16777215; + +if (f > MAX) +f = MAX; +else if (f < 0) +f = 0; +f = floor(f); +return f; +}; + +// parm* value encoding and decoding +// maximize storage of data in parm* values +// most ammo data has a maximum of 200, armor is 200, health is 100, etc. +// this can be encoded into 8 bits - +// the original code uses 1 parm* per data point - a serious waste of bits +// each parm* variable has 24 bits - 3 * 8 bit values + +// encode 3 values according to formulas with all values bounded 0 - 255 +// values are set into float value 0 - 16777215 + +// where +// s1 - into high 8 bits +// s2 - into middle 8 bits +// s3 - into low 8 bits + +float(float s1, float s2, float s3) encode = +{ +local float f; +f = f_bound(s1, 255) * 65536 + f_bound(s2, 255) * 256 + f_bound(s3, 255); +return f; +}; + +// generic encode + +// s1 is value +// bits are max value - 1, 3, 7, 15, 31...255...65535...{n} - a series of 1 bits +// pos is the position in the parm* variable +// - position will be the next bit value above the previous bits +// - i.e. for 3 value bits at position 1, the next position is 4 +// - for 7 value bits at position 4, the next position is 32 +// binary math equivalent: +// - 00000011 - 3 value at 1 +// - 00011100 - 7 value at 4 +// - 11100000 - 7 value at 32 + +// you could encode any values in any position with this function +// it is included here as an example if you have values smaller or larger than 255 to encode +// such as the painkeep carry items with a limit of 3 on most inventory + +float(float s1, float bits, float pos) g_encode = +{ +local float f; +f = f_bound(s1, bits) * pos; +return f; +}; + +// recover an 8 bit value (0 - 255) from parm encoding + +// parmval - passed value of parm* variable + +// where which is +// 3 - return high 8 bits +// 2 - return middle 8 bits +// 1 - return low 8 bits +// any other value - return low 8 bits + +// use these handy codes to avoid confusion +float HI8 = 3; // s3 value of encode() call +float MID8 = 2; // s2 value of encode() call +float LOW8 = 1; // s1 value of encode() call + +float(float parmval, float which) decode = +{ +local float f; + +if (which == 1) +f = (parmval / 65536) & 255; +else if (which == 2) +f = (parmval / 256) & 255; +else +f = parmval & 255; +return f; +}; + +// generic decode - extract data from generic encode above + +// parmval is the parm* variable data +// bits are max value - 1, 3, 7, 15, 31...255...65535...{n} - a series of 1 bits +// pos is the position in the parm* variable + +// this uses the same bits & pos to extract any generic encoded data +// see notes under g_encode for more details + +float(float parmval, float bits, float pos) g_decode = +{ +local float f; + +f = (parmval / pos) & bits; +return f; +}; + +//======================================================================== +//======================================================================== + + + + + + + +/*====================================================================== + USED : Load (map command) NEW MAP or NEW GAME + This is a function called via the engine for new games + Resets all parm data back to default values, followed by Decode +======================================================================*/ +void() SetNewParms = +{ + dprint("\b[CLIENT]\b SetNewParms\n"); + + // Brand new game/map, reset start position settings + update_configflag(SVR_SPAWN_BIT1, FALSE); + update_configflag(SVR_SPAWN_BIT2, FALSE); + update_configflag(SVR_SPAWN_BIT3, FALSE); + fog_active = FALSE; + + parm1 = IT_SHOTGUN | IT_AXE; // Default self.items, give shotgun and axe to start + parm2 = encode(100, 0, 0); // Default Health, Armortype, Armorvalue in that order + //parm2 = 100; // Starting Health + //parm3 = 0; // Armourtype + //parm9 = 0; // Armourvalue + + parm3 = encode(25,0,0); // Default shells, nails, rockets in that order + //parm4 = 25; // Ammo qty shells + //parm5 = 0; // Ammo qty nails + //parm6 = 0; // Ammo qty rockets + + parm4 = 0; // Ammo qty cells, bolts, poison in that order + //parm7 = 0; // Ammo qty cells + + parm5 = 0; // Ammo qty lava_nails, multi_rockets, plasma in that order + + parm8 = 1; // Current selected weapon + parm10 = 0; // New MOD items + parm11 = 0; // self.items2 + parm12 = 0; // globalstate + parm13 = 0; // permanent powerups (perms) from Drake, can be reset this level using world.take_perms > 0 + + // Update new player inventory based on config flag + if (query_configflag(SVR_UPDAXE)) parm10 = parm10 | IT_UPGRADE_AXE; + if (query_configflag(SVR_UPDSSG)) parm10 = parm10 | IT_UPGRADE_SSG; + if (query_configflag(SVR_UPDLG)) parm10 = parm10 | IT_UPGRADE_LG; + + // Are map variables live? + if (mapvar_cvar) dprint("\b[CLIENT]\b LIVE Map Variables Detected\n"); + else { + dprint("\b[CLIENT]\b RESETTING Map Variables\n"); + // Reset map variables ready for use + parm6 = parm7 = parm9 = parm14 = parm15 = parm16 = 0; + mapvar_reset(); + } +}; + +/*====================================================================== +// USED : trigger CHANGE LEVEL +// Stores a copy of the parm data ready for death/level reset +======================================================================*/ +void() SetChangeParms = +{ + dprint("\n\b[CLIENT]\b SetChangeParms\n"); + if (self.health < 1) { SetNewParms (); return; } + + // remove temporary items (keys and powerups) + self.items = self.items - (self.items & IT_ITEMRESET); + parm1 = self.items; + self.moditems = self.moditems - (self.moditems & IT_MODRESET); + parm10 = self.moditems; + dprint("\b[CLIENT]\b MOD weapons ("); dprint(ftos(parm10)); dprint(")\n"); + self.items2 = self.items2 - (self.items2 & IT2_ITEMRESET); + parm11 = self.items2; // save the good stuff! multi-weapons and such + + // cap super health + if (self.health > HEAL_PLAYMAX) self.health = HEAL_PLAYMAX; + if (self.health < 50) self.health = 50; //heal me on level change up to 50 from potentially 1 + parm2 = encode(self.health, self.armortype, self.armorvalue); + //parm2 = self.health; + //parm9 = self.armortype * 100; + //parm3 = self.armorvalue; + + parm3 = encode(self.ammo_shells,self.ammo_nails,self.ammo_rockets); + // Always make sure the player has 25 shells + // Uh no, no we won't + //if (self.ammo_shells < DEF_SHELLS) parm4 = DEF_SHELLS; + //else parm4 = self.ammo_shells; + //parm4 = self.ammo_shells; + //parm5 = self.ammo_nails; + //parm6 = self.ammo_rockets; + parm4 = encode(self.ammo_cells,self.ammo_bolts,self.ammo_poison); + //parm7 = self.ammo_cells; + parm5 = encode(self.ammo_lava_nails,self.ammo_multi_rockets,self.ammo_plasma); + //parm6; + //parm7; + parm8 = self.weapon; + //parm9; + //parm10 is self.moditems above + //parm11 is self.items2 above + parm12 = globalstate; + parm13 = self.perms; + //parm14; + //parm15; + //parm16; +}; + +/*====================================================================== + USED : Load NEW MAP or trigger CHANGE LEVEL + Not used when loading a saved file or quickload +======================================================================*/ +void() DecodeWorldParms = +{ + local float parm_items, tlow8, tmid8, thi8; + parm_items = parm1; + + dprint("\b[CLIENT]\b Decode Worldspawn Inv Parms\n"); + //---------------------------------------------------------------------- + // Show developer feedback on player inventory update + if (world.give_weapons) { + dprint("\b[CLIENT]\b Weapon Give ( "); + if (world.give_weapons & IT_SHOTGUN) dprint("SG "); + if (world.give_weapons & IT_SUPER_SHOTGUN) dprint("SSG "); + if (world.give_weapons & IT_NAILGUN) dprint("NG "); + if (world.give_weapons & IT_SUPER_NAILGUN) dprint("SNG "); + if (world.give_weapons & IT_GRENADE_LAUNCHER) dprint("GL "); + if (world.give_weapons & IT_ROCKET_LAUNCHER) dprint("RL "); + if (world.give_weapons & IT_LIGHTNING) dprint("LG "); + dprint(")\n"); + } + if (world.take_weapons && (world.take_weapons < 99999999)) { + dprint("\b[CLIENT]\b Weapon Take ( "); + if (world.take_weapons & IT_SHOTGUN) dprint("SG "); + if (world.take_weapons & IT_SUPER_SHOTGUN) dprint("SSG "); + if (world.take_weapons & IT_NAILGUN) dprint("NG "); + if (world.take_weapons & IT_SUPER_NAILGUN) dprint("SNG "); + if (world.take_weapons & IT_GRENADE_LAUNCHER) dprint("GL "); + if (world.take_weapons & IT_ROCKET_LAUNCHER) dprint("RL "); + if (world.take_weapons & IT_LIGHTNING) dprint("LG "); + dprint(")\n"); + } + + //---------------------------------------------------------------------- + // Adding weapons to existing inventory + if (world.give_weapons) { + parm_items = parm_items | (world.give_weapons & ALL_WEAPONS); + } + //---------------------------------------------------------------------- + if (world.take_weapons > 0) { + if (world.take_weapons > 999) { + parm_items = 0; //take all + parm13 = parm13 - (parm13 & IT_BLASTER); + parm8 = 0; + parm4 = 0; + dprint("\b[CLIENT]\b Weapon Take ( "); + dprint("ALL WEAPONS! "); + dprint(")\n"); + } else { + if (world.take_weapons & IT_SHOTGUN && parm_items & IT_SHOTGUN) { + parm_items = parm_items - IT_SHOTGUN; + parm13 = parm13 - (parm13 & IT_BLASTER); + } + if (world.take_weapons & IT_SUPER_SHOTGUN && parm_items & IT_SUPER_SHOTGUN) { + parm_items = parm_items - IT_SUPER_SHOTGUN; + // Player cannot have upgrades without base item + parm10 = parm10 - (parm10 & IT_UPGRADE_SSG); + } + if (world.take_weapons & IT_NAILGUN && parm_items & IT_NAILGUN) + parm_items = parm_items - IT_NAILGUN; + if (world.take_weapons & IT_SUPER_NAILGUN && parm_items & IT_SUPER_NAILGUN) + parm_items = parm_items - IT_SUPER_NAILGUN; + if (world.take_weapons & IT_GRENADE_LAUNCHER && parm_items & IT_GRENADE_LAUNCHER) + parm_items = parm_items - IT_GRENADE_LAUNCHER; + if (world.take_weapons & IT_ROCKET_LAUNCHER && parm_items & IT_ROCKET_LAUNCHER) + parm_items = parm_items - IT_ROCKET_LAUNCHER; + if (world.take_weapons & IT_LIGHTNING && parm_items & IT_LIGHTNING) { + parm_items = parm_items - IT_LIGHTNING; + // Player cannot have upgrades without base item + parm10 = parm10 - (parm10 & IT_UPGRADE_LG); + } + } + } + + // Store result back to global variable + parm1 = parm_items; + + // parm2 health | armortype | armorvalue + tlow8 = decode(parm2,LOW8); + tmid8 = decode(parm2,MID8); + thi8 = decode(parm2,HI8); + //---------------------------------------------------------------------- + // Update player health (reset or minimum value) + if (world.reset_health > 0 && world.reset_health <= HEAL_PLAYMAX) { + dprint("\b[CLIENT]\b Health ("); dprint(ftos(tlow8)); dprint(") To ("); + tlow8 = world.reset_health; //uses low8 position + parm2 = encode(tlow8,tmid8,thi8); + dprint(ftos(tlow8)); dprint(")\n"); + } + else if (world.max_health && (tlow8 < world.max_health) ) { + dprint("\b[CLIENT]\b Health ("); dprint(ftos(tlow8)); dprint(") To ("); + if (tlow8 < world.max_health) { + tlow8 = world.max_health; //uses low8 position + parm2 = encode(tlow8,tmid8,thi8); + } + dprint(ftos(tlow8)); dprint(")\n"); + } + + //---------------------------------------------------------------------- + // Update the inventory ammo quantities + // currentammo = 1 to reset the inventory to worldspawn values + // currentammo = 0 to use the worldspawn values as a minimum quantity + + // parm3 = shells | nails | rockets + tlow8 = decode(parm3,LOW8); + tmid8 = decode(parm3,MID8); + thi8 = decode(parm3,HI8); + if (world.ammo_shells || (world.currentammo && tlow8 > 0)) { + dprint("\b[CLIENT]\b Ammo Shells ("); dprint(ftos(tlow8)); dprint(") To ("); + if (world.currentammo) tlow8 = world.ammo_shells; + else if (tlow8 < world.ammo_shells) tlow8 = world.ammo_shells; + if (tlow8 > AMMO_MAXSHELLS) tlow8 = AMMO_MAXSHELLS; + else if (tlow8 < 0) tlow8 = 0; + dprint(ftos(tlow8)); dprint(")\n"); + parm3 = encode(tlow8,tmid8,thi8); //store shells back in parm3 + } + if (world.ammo_nails || (world.currentammo && tmid8 > 0)) { + dprint("\b[CLIENT]\b Ammo Spikes ("); dprint(ftos(tmid8)); dprint(") To ("); + if (world.currentammo) tmid8 = world.ammo_nails; + else if (tmid8 < world.ammo_nails) tmid8 = world.ammo_nails; + if (tmid8 > AMMO_MAXNAILS) tmid8 = AMMO_MAXNAILS; + else if (tmid8 < 0) tmid8 = 0; + dprint(ftos(tmid8)); dprint(")\n"); + parm3 = encode(tlow8,tmid8,thi8); //store nails back in parm3 + } + if (world.ammo_rockets || (world.currentammo && thi8 > 0)) { + dprint("\b[CLIENT]\b Ammo Rockets ("); dprint(ftos(thi8)); dprint(") To ("); + if (world.currentammo) thi8 = world.ammo_rockets; + else if (thi8 < world.ammo_rockets) thi8 = world.ammo_rockets; + if (thi8 > AMMO_MAXROCKETS) thi8 = AMMO_MAXROCKETS; + else if (thi8 < 0) thi8 = 0; + dprint(ftos(thi8)); dprint(")\n"); + parm3 = encode(tlow8,tmid8,thi8); //store rockets back in parm3 + } + + // parm4 = cells | bolts | poison + tlow8 = decode(parm4,LOW8); + tmid8 = decode(parm4,MID8); + thi8 = decode(parm4,HI8); + if (world.ammo_cells || (world.currentammo && tlow8 > 0)) { + dprint("\b[CLIENT]\b Ammo Cells ("); dprint(ftos(tlow8)); dprint(") To ("); + if (world.currentammo) tlow8 = world.ammo_cells; + else if (tlow8 < world.ammo_cells) tlow8 = world.ammo_cells; + if (tlow8 > AMMO_MAXROCKETS) tlow8 = AMMO_MAXROCKETS; + else if (tlow8 < 0) tlow8 = 0; + dprint(ftos(tlow8)); dprint(")\n"); + parm4 = encode(tlow8,tmid8,thi8); //store cells back in parm4 + } + if (world.ammo_bolts || (world.currentammo && tmid8 > 0)) { + dprint("\b[CLIENT]\b Ammo Bolts ("); dprint(ftos(tmid8)); dprint(") To ("); + if (world.currentammo) tmid8 = world.ammo_bolts; + else if (tmid8 < world.ammo_bolts) tmid8 = world.ammo_bolts; + if (tmid8 > AMMO_MAXBOLTS) tmid8 = AMMO_MAXBOLTS; + else if (tmid8 < 0) tmid8 = 0; + dprint(ftos(tmid8)); dprint(")\n"); + parm4 = encode(tlow8,tmid8,thi8); //store bolts back in parm4 + } + if (world.ammo_poison || (world.currentammo && thi8 > 0)) { + dprint("\b[CLIENT]\b Ammo Poison ("); dprint(ftos(thi8)); dprint(") To ("); + if (world.currentammo) thi8 = world.ammo_poison; + else if (thi8 < world.ammo_poison) thi8 = world.ammo_poison; + if (thi8 > AMMO_MAXPOISON) thi8 = AMMO_MAXPOISON; + else if (thi8 < 0) thi8 = 0; + dprint(ftos(thi8)); dprint(")\n"); + parm4 = encode(tlow8,tmid8,thi8); //store poison back in parm4 + } + + // parm5 = lava_nails | multi_rockets | plasma + tlow8 = decode(parm5,LOW8); + tmid8 = decode(parm5,MID8); + thi8 = decode(parm5,HI8); + if (world.ammo_lava_nails || (world.currentammo && tlow8 > 0)) { + dprint("\b[CLIENT]\b Ammo Lava Nails ("); dprint(ftos(tlow8)); dprint(") To ("); + if (world.currentammo) tlow8 = world.ammo_lava_nails; + else if (tlow8 < world.ammo_lava_nails) tlow8 = world.ammo_lava_nails; + if (tlow8 > AMMO_MAXLAVANAILS) tlow8 = AMMO_MAXLAVANAILS; + else if (tlow8 < 0) tlow8 = 0; + dprint(ftos(tlow8)); dprint(")\n"); + parm5 = encode(tlow8,tmid8,thi8); //store lava_nails back in parm5 + } + if (world.ammo_multi_rockets || (world.currentammo && tmid8 > 0)) { + dprint("\b[CLIENT]\b Ammo Multi-Rockets ("); dprint(ftos(tmid8)); dprint(") To ("); + if (world.currentammo) tmid8 = world.ammo_multi_rockets; + else if (tmid8 < world.ammo_multi_rockets) tmid8 = world.ammo_multi_rockets; + if (tmid8 > AMMO_MAXMULTIROCKETS) tmid8 = AMMO_MAXMULTIROCKETS; + else if (tmid8 < 0) tmid8 = 0; + dprint(ftos(tmid8)); dprint(")\n"); + parm5 = encode(tlow8,tmid8,thi8); //store multi_rockets back in parm5 + } + if (world.ammo_plasma || (world.currentammo && thi8 > 0)) { + dprint("\b[CLIENT]\b Ammo Plasma ("); dprint(ftos(thi8)); dprint(") To ("); + if (world.currentammo) thi8 = world.ammo_plasma; + else if (thi8 < world.ammo_plasma) thi8 = world.ammo_plasma; + if (thi8 > AMMO_MAXPLASMA) thi8 = AMMO_MAXPLASMA; + else if (thi8 < 0) thi8 = 0; + dprint(ftos(thi8)); dprint(")\n"); + parm5 = encode(tlow8,tmid8,thi8); //store plasma back in parm5 + } + + + //---------------------------------------------------------------------- + // Update player armour type and quantity + if (world.armortype > 0) { + // Remove any previous armour types from the HUD + parm11 = parm11 - (parm11 & (IT2_ARMOR1 | IT2_ARMOR2 | IT2_ARMOR3)); + // Setup any armour quantity first, limit check with armour type + if (world.armorvalue > 0) { + tlow8 = decode(parm2,LOW8); // health + tmid8 = decode(parm2,MID8); // armortype + parm2 = encode(tlow8,tmid8,world.armorvalue); + } + + // Work through the different armour types, resetting armour quantity + if (world.armortype == 1) { + parm11 = parm11 | IT2_ARMOR1; + tlow8 = decode(parm2,LOW8); + tmid8 = decode(parm2,MID8); + thi8 = ARMOR_GRN_TYPE * 100; //parm9 = ARMOR_GRN_TYPE * 100; + if (!world.armorvalue || thi8 > ARMOR_GRN_VALUE) thi8 = ARMOR_GRN_VALUE; + dprint("\b[CLIENT]\b Green Armor ("); dprint(ftos(thi8)); dprint(")\n"); + parm2 = encode(tlow8,tmid8,thi8); + + } + else if (world.armortype == 2) { + parm11 = parm11 | IT2_ARMOR2; + tlow8 = decode(parm2,LOW8); + tmid8 = decode(parm2,MID8); + thi8 = ARMOR_YEL_TYPE * 100; //parm9 = ARMOR_YEL_TYPE * 100; + if (!world.armorvalue || thi8 > ARMOR_YEL_VALUE) thi8 = ARMOR_YEL_VALUE; + dprint("\b[CLIENT]\b Yellow Armor ("); dprint(ftos(thi8)); dprint(")\n"); + parm2 = encode(tlow8,tmid8,thi8); + + } + else if (world.armortype == 3) { + parm11 = parm11 | IT2_ARMOR3; + tlow8 = decode(parm2,LOW8); + tmid8 = decode(parm2,MID8); + thi8 = ARMOR_RED_TYPE * 100; //parm9 = ARMOR_RED_TYPE * 100; + if (!world.armorvalue || thi8 > ARMOR_RED_VALUE) thi8 = ARMOR_RED_VALUE; + dprint("\b[CLIENT]\b Red Armor ("); dprint(ftos(thi8)); dprint(")\n"); + parm2 = encode(tlow8,tmid8,thi8); + + } else { + // Default is no armour + tlow8 = decode(parm2,LOW8); + //parm3 = 0; + thi8 = decode(parm2,HI8); + parm2 = encode(tlow8,0,thi8); + } + } + + if (world.take_perms > 0) { + parm13 = 0; // take away all permanent powerups + } +}; + +/*====================================================================== + USED : Load NEW MAP or trigger CHANGE LEVEL + Double check the player inventory matches the server/config flags + Check worldspawn for add/removal of upgrade items +======================================================================*/ +void() SyncModInventory = +{ + //---------------------------------------------------------------------- + // Shadow Axe + //---------------------------------------------------------------------- + // Check worldspawn for upgrade_axe first, add/deny inventory + if (world.upgrade_axe < 0) { + dprint("\b[MODINV]\b Worldspawn removing Axe Upgrade\n"); + parm10 = parm10 - (parm10 & IT_UPGRADE_AXE); + update_configflag(SVR_UPDAXE, FALSE); + } + else if (world.upgrade_axe > 0) { + dprint("\b[MODINV]\b Worldspawn adding Axe Upgrade\n"); + parm10 = parm10 | IT_UPGRADE_AXE; + parm1 = parm1 | IT_AXE; + update_configflag(SVR_UPDAXE, TRUE); + } + // Finally syncing the player inventory to serverflags + else if (parm10 & IT_UPGRADE_AXE) { + dprint("\b[MODINV]\b Inventory adding Axe Upgrade\n"); + update_configflag(SVR_UPDAXE, TRUE); + } + + //---------------------------------------------------------------------- + // Widowmaker Shotgun + //---------------------------------------------------------------------- + // Check worldspawn for upgrade_ssg first, add/deny inventory + if (world.upgrade_ssg < 0) { + dprint("\b[MODINV]\b Worldspawn removing SSG Upgrade\n"); + parm10 = parm10 - (parm10 & IT_UPGRADE_SSG); + update_configflag(SVR_UPDSSG, FALSE); + } + else if (world.upgrade_ssg > 0) { + dprint("\b[MODINV]\b Worldspawn adding SSG Upgrade\n"); + parm10 = parm10 | IT_UPGRADE_SSG; + parm1 = parm1 | IT_SUPER_SHOTGUN; + update_configflag(SVR_UPDSSG, TRUE); + } + // Syncing the player inventory to serverflags + else if (parm10 & IT_UPGRADE_SSG) { + dprint("\b[MODINV]\b Inventory adding SSG Upgrade\n"); + update_configflag(SVR_UPDSSG, TRUE); + } + + //---------------------------------------------------------------------- + // Projectile Shotgun + //---------------------------------------------------------------------- + // Check for worldspawn feature to turn off projectiles + casing + if (world.no_sgprojectile > 0) + update_configflag(SVR_SHOTGPROJ, TRUE); + if (world.no_sgcasing > 0) + update_configflag(SVR_SHOTGCASE, TRUE); + + //---------------------------------------------------------------------- + // Plasma Gun + //---------------------------------------------------------------------- + // Check worldspawn for upgrade_lg first, add/deny inventory + if (world.upgrade_lg < 0) { + dprint("\b[MODINV]\b Worldspawn removing LG Upgrade\n"); + parm10 = parm10 - (parm10 & IT_UPGRADE_LG); + update_configflag(SVR_UPDLG, FALSE); + } + else if (world.upgrade_lg > 0) { + dprint("\b[MODINV]\b Worldspawn adding LG Upgrade\n"); + parm10 = parm10 | IT_UPGRADE_LG; + parm1 = parm1 | IT_LIGHTNING; + update_configflag(SVR_UPDLG, TRUE); + } + // Finally syncing the player inventory to serverflags + else if (parm10 & IT_UPGRADE_LG) { + dprint("\b[MODINV]\b Inventory adding LG Upgrade\n"); + update_configflag(SVR_UPDLG, TRUE); + } +}; + +/*====================================================================== + USED : Load NEW MAP or trigger CHANGE LEVEL + Not used when loading a saved file or quickload +======================================================================*/ +void() DecodeLevelParms = +{ + dprint("\b[CLIENT]\b Decode (Level) Parms\n"); + // Map Variables are active (do not reset) + mapvar_cvar = TRUE; + // Found any runes? going back to start map? reset inventory + if (serverflags & SVR_RUNE_ALL) { + // take away all stuff on starting new episode + if (world.model == "maps/start.bsp") SetNewParms (); + } + + DecodeWorldParms(); // Decode worldspawn client inv updates + sync_serverflags(); // update/sync serverflags to worldspawn + SyncModInventory(); // update/sync mod inventory items + + // Read all current params into client variables + self.items = parm1; + self.health = decode(parm2,LOW8); + self.armortype = decode(parm2,MID8); + self.armorvalue = decode(parm2,HI8); + self.ammo_shells = decode(parm3,LOW8); + self.ammo_nails = decode(parm3,MID8); + self.ammo_rockets = decode(parm3,HI8); + self.ammo_cells = decode(parm4,LOW8); + self.ammo_bolts = decode(parm4,MID8); + self.ammo_poison = decode(parm4,HI8); + self.ammo_lava_nails = decode(parm5,LOW8); + self.ammo_multi_rockets = decode(parm5,MID8); + self.ammo_plasma = decode(parm5,HI8); + // parm6; + // parm7; + self.weapon = parm8; + // parm9; + self.moditems = parm10; + self.items2 = parm11; + globalstate = parm12; + self.perms = parm13; + // parm14; + // parm15; + // parm16; + + dprint("\b[CLIENT]\b self.weapon == "); + dprint(ftos(self.weapon)); + dprint("\n"); + + dprint("\b[CLIENT]\b self.items == "); + dprint(ftos(self.items)); + dprint("\n"); + + dprint("\b[CLIENT]\b Reading Map Variables\n"); + // Read/Setup map variables (22 bits per parm, 132 total) + mapvar[0] = parm6; + mapvar[1] = parm7; + mapvar[2] = parm9; + mapvar[3] = parm14; + mapvar[4] = parm15; + mapvar[5] = parm16; + + // Check for any worldspawn map variable settings + if (CheckZeroVector(world.mapvar_update) == FALSE) + mapvar_range(world.mapvar_update); +}; + +//---------------------------------------------------------------------- +void() GotoNextMap = +{ + // if samelevel is set, stay on same level + if (cvar("samelevel")) changelevel (mapname); + else changelevel (nextmap); +}; + +/*====================================================================== + NextLevel (DM ONLY) + - A special function designed for MP only, will cycle around + the first map of each episode until someone quits + gives the player runes as well to tell which to load +======================================================================*/ +void() NextLevel = +{ + local entity o; + + if (mapname == "start") { + if (!cvar("registered")) mapname = "e1m1"; + else if (query_configflag(SVR_RUNE_KEY1) == FALSE) { + mapname = "e1m1"; + update_configflag(SVR_RUNE_KEY1, TRUE); + } + else if (query_configflag(SVR_RUNE_KEY2) == FALSE) { + mapname = "e2m1"; + update_configflag(SVR_RUNE_KEY1, TRUE); + } + else if (query_configflag(SVR_RUNE_KEY3) == FALSE) { + mapname = "e3m1"; + update_configflag(SVR_RUNE_KEY1, TRUE); + } + else if (query_configflag(SVR_RUNE_KEY4) == FALSE) { + mapname = "e4m1"; + update_configflag(SVR_RUNE_KEY1, FALSE); + update_configflag(SVR_RUNE_KEY2, FALSE); + update_configflag(SVR_RUNE_KEY3, FALSE); + } + + o = spawn(); + o.map = mapname; + } + else { + // find a trigger changelevel + o = find(world, classname, "trigger_changelevel"); + + // go back to start if no trigger_changelevel + if (!o) { + mapname = "start"; + o = spawn(); + o.map = mapname; + } + } + + nextmap = o.map; + gameover = TRUE; + + if (o.nextthink < time) { + o.think = trigger_changelevel_finish; + o.nextthink = time + 0.1; + } +}; + +/*====================================================================== + CheckRules (DM ONLY) + - Check death timers (time/frag limits) + and decide if to load a new map or not +======================================================================*/ +void() CheckRules = +{ + local float timelimit, fraglimit; + + if (deathmatch == 0) return; // Playing SP? + if (gameover) return; // someone else quit the game already + + timelimit = cvar("timelimit") * 60; + fraglimit = cvar("fraglimit"); + + if (timelimit && time >= timelimit) NextLevel(); + else if (fraglimit && self.frags >= fraglimit) NextLevel(); +}; + +//---------------------------------------------------------------------- +void() SetupSpawnCoopLocations = +{ + local entity cooploc, prevloc; + + // The first spawn for coop is always the SP start location + cooploc = find (world, classname, "info_player_coop"); + prevloc = world; + + // Any coop spawns exist? + if (cooploc) { + // Create a list + while(cooploc) { + // first spawn in chain? setup first and previous spawns + if (!prevloc) { + coop_ent = cooploc; + coop_ent.count = 0; + } + else prevloc.owner = cooploc; + + // Save current spawn location to previous ready for loop + prevloc = cooploc; + coop_ent.count = coop_ent.count + 1; + + cooploc = find(cooploc, classname, "info_player_coop"); + } + // Close the chain + prevloc.owner = coop_ent; + dprint("\b[COOP]\b Spawn locations found ("); + dprint(ftos(coop_ent.count)); dprint(")\n"); + } + else { + // No coop spawns, use start location + dprint("\b[COOP]\b Spawn locations Missing!\n"); + coop_ent = find (world, classname, "info_player_start"); + // no start location, WTF!?! + if (!coop_ent) coop_ent = client_ent; + coop_ent.owner = coop_ent; + } +}; + +//---------------------------------------------------------------------- +// Find a location for the player to spawn at +//---------------------------------------------------------------------- +entity() SelectSpawnPoint = +{ + local entity spot, spot2, thing; + local float pcount, start2; + + // Always use a player start as default position + if (!lastspawn) lastspawn = find (world, classname, "info_player_start"); + + // Cycle through list of info_player_coop location + if (coop > 0) { + // Check for coop spawn list + if (!coop_ent) return lastspawn; + // If first entry of coop list start player then its broken + else if (coop_ent.classtype == CT_SPAWNSP) return lastspawn; + else { + // Setup coop list if last location isstart player + if (lastspawn.classtype == CT_SPAWNSP) lastspawn = coop_ent; + // Move forward in coop spawn location list + lastspawn = lastspawn.owner; + // Check if spawn location is active? + if (lastspawn.estate & ESTATE_BLOCK) { + pcount = coop_ent.count; + while(pcount > 0) { + lastspawn = lastspawn.owner; + if (lastspawn.estate == ESTATE_ON) pcount = -1; + else pcount = pcount - 1; + } + } + // Double check if spawn location free? + if (lastspawn.estate & ESTATE_BLOCK) { + // Default back to player start if not available + lastspawn = find (world, classname, "info_player_start"); + } + return lastspawn; + } + } + // choose a info_player_deathmatch point + else if (deathmatch > 0) { + spot = lastspawn; + while (1) { + spot = find(spot, classname, "info_player_deathmatch"); + if (spot == world) spot = find (world, classname, "info_player_start"); + if (spot != world) { + if (spot == lastspawn) return lastspawn; + pcount = 0; + thing = findradius(spot.origin, 32); + while(thing) { + if (thing.flags & FL_CLIENT) pcount = pcount + 1; + thing = thing.chain; + } + if (pcount == 0) { + lastspawn = spot; + return spot; + } + } + } + } + + // Check for any info_player_start2 special spawn locations + start2 = mathlib_bitvalue( query_configflag(SVR_SPAWN_BIT1), SVR_SPAWN_BIT1); + start2 = start2 + mathlib_bitvalue( query_configflag(SVR_SPAWN_BIT2), SVR_SPAWN_BIT2)*2; + start2 = start2 + mathlib_bitvalue( query_configflag(SVR_SPAWN_BIT3), SVR_SPAWN_BIT3)*4; + if (start2 > 0) dprint("\b[CLIENT]\b Unique Info_Player_Start2 Active\n"); + + // have a rune or new spawnflag option? Pick second spawn position + if ( query_configflag(SVR_RUNE_ALL) || start2 > 0 ) { + // Read any spawn location number (High/low bit flag, 0-3 values) + spot = find (world, classname, "info_player_start2"); + if (spot) { + spot2 = spot; + while (spot) { + if (spot.startspawn2 == start2) spot2 = spot; + spot = find(spot, classname, "info_player_start2"); + } + return spot2; + } + } + + // Last chance to find a spawn location before giving up! + spot = find (world, classname, "info_player_start"); + if (!spot) dprint ("\b[CLIENT_SPAWN]\b missing info_player_start!"); + + return spot; +}; + +float CMD_RESEND_ON_LOAD = 16; + +void () RunCommandSpawn = { + local entity cmd; + cmd = find(cmd, classname, "info_command_spawn"); + if (cmd != world && cmd.spawnflags & CMD_RESEND_ON_LOAD) cmd.use(); +}; + +//---------------------------------------------------------------------- +// PutClientInServer - called each time a player is spawned +//---------------------------------------------------------------------- +void() PutClientInServer = +{ + local entity spot; + + client_ent = self; + self.classname = "player"; + self.classtype = CT_PLAYER; + self.classgroup = CG_PLAYERS; + // This entity can never be switched off + self.estate = ESTATE_ON; + self.estate_off = SUB_Null; + + // Setup entity chains for coop, dm and intermission + SetupSpawnCoopLocations(); + SetupIntermissionCamera(); + + // Find a spawn location in the map + spot = SelectSpawnPoint (); + // Fire any targets on spawn location + if (spot.target) self.target2 = spot.target; + else self.target2 = ""; + + self.headmdl = MODEL_PLAYER_HEAD; + self.health = self.max_health = HEAL_PLAYMAX; + self.takedamage = DAMAGE_AIM; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_WALK; + self.classmove = MON_MOVEWALK; + self.show_hostile = 0; + self.gibhealth = -40; + self.gibbed = FALSE; + self.flags = FL_CLIENT; + self.air_finished = time + WATER_AIR; + self.dmg = WATER_DAMAGE; + self.effects = 0; + self.steplast = 1; + + // Drake variables + self.mist = world; + self.hook = world; // for grapple service + self.mirv1 = world; + + self.super_damage_finished = self.super_time = 0; + self.radsuit_finished = self.rad_time = 0; + self.invisible_finished = self.invisible_time = 0; + self.invincible_finished = self.invincible_time = 0; + + self.sharpshoot_finished = self.sharpshoot_time = 0; + self.nailpiercer_finished = self.nailpiercer_time = 0; + self.wetsuit_finished = self.wetsuit_time = 0; + self.empathy_finished = self.empathy_time = 0; + + self.antigrav_finished = self.antigrav_time = 0; + self.shield_finished = self.shield_time = 0; + + self.cross_finished = self.cross_time = 0; + self.trinity_finished = self.trinity_time = 0; + + self.wing_finished = self.wing_time = 0; + + self.steptype = FS_TYPEMEDIUM; // Standard boots + self.suppressCenterPrint = FALSE; // No centerprint active + + ResetDebuffSystem(self); // Reset/initialize debuff system + + self.enemy = world; + DecodeLevelParms (); + if (globalstate > 0) + sprint (self,"Global states are set!\n"); + else + sprint (self,"No global states are set.\n"); + self.weapon = W_BestWeapon (self); // Pick best weapon from inventory + W_SetCurrentAmmo (self); // Update hud icons and v_model + + self.attack_finished = time; + self.th_pain = player_pain; + self.th_die = player_death; + + self.deadflag = DEAD_NO; // The player is alive! + self.pausetime = 0; // make sure player has 0 velocity when spawning + + update_hud_totals(HUD_MONSTERS); // Make screen total is correct + update_hud_totals(HUD_SECRETS); // Update monsters and secrets + + // spot = SelectSpawnPoint (); + self.origin = spot.origin + '0 0 1'; + if (spot.mangle) self.angles = spot.mangle; + else self.angles = spot.angles; + self.v_angle = self.angles; + self.fixangle = TRUE; // turn this way immediately + + // oh, this is a hack! + setmodel (self, MODEL_PLAYER_EYES); + modelindex_eyes = self.modelindex; + + setmodel (self,"progs/hipnotic/playham.mdl"); + modelindex_hammer = self.modelindex; + + setmodel (self, MODEL_PLAYER); + modelindex_player = self.modelindex; + + setmodel (self, "progs/drake/playham0.mdl"); + mindex_hamout = self.modelindex; + + setmodel (self, "progs/drake/playsaw.mdl"); + mindex_saw = self.modelindex; + + self.bbmins = VEC_HULLSHORT_MIN; // -16 -16 -24, 16 16 32 + self.bbmaxs = VEC_HULLSHORT_MAX; + setsize (self, self.bbmins, self.bbmaxs); + self.view_ofs = '0 0 22'; + player_stand1 (); + + if (deathmatch || coop) { + makevectors(self.angles); + spawn_tfog (self.origin + v_forward*20); + } + + spawn_tdeath (self.origin, self); + + RunCommandSpawn(); +}; + +// Forward compiler links +void() PlayerJump; +void() WaterMove; +void() CheckWaterJump; +void() ClientDeath; + +//---------------------------------------------------------------------- +// PlayerPreThink - Called every frame before physics are run +//---------------------------------------------------------------------- +void() PlayerPreThink = +{ + // Once the map has loaded (prethink) set loadflag (never saved) + if (!prethink) { + prethink = TRUE; // prethink flag complete + postthink = FALSE; // postthink flag reset + sync_configflag(); // Setup and sync serverflag + // Some clients load faster, prevent player gasping for air + self.air_finished = time + WATER_AIR; + + // Double check which engine is active? + // A DP/FTE Quickload could be happening and the + // Particle system needs to cope with the change + ext_active = cvar("pr_checkextension"); + if (!ext_active) { + // Revert to default = Fitz engine setup + engine = ENG_FITZ; + ext_dppart = ext_dpfog = ext_dpsurf = FALSE; + ext_dprain = ext_dpsnow = FALSE; + } + + // Check for trigger CD track/Skybox change + // Load/Quickload does not keep track of these changes + // Use a new global variable instead + if (trig_cdtrack > 0) trigger_cdtrack_change(); + if (trig_skybox != "") trigger_skybox_change(self); + } + + // If Intermission system active check for button0-2 keys + if (intermission_running > 0) { CycleIntermissionCamera(); return; } + + if (earthquake_active) + { + if ( self.flags & FL_ONGROUND ) + { + self.velocity_x = self.velocity_x + + (random() * earthquake_intensity * 2) - + earthquake_intensity; + self.velocity_y = self.velocity_y + + (random() * earthquake_intensity * 2) - + earthquake_intensity; + self.velocity_z = self.velocity_z + + (random() * earthquake_intensity * 2) - + earthquake_intensity; + } + } + + makevectors (self.v_angle); + CheckRules (); + WaterMove (); + + if (self.movetype == MOVETYPE_FLY) { + self.oldorigin = self.origin; + if (vlen(self.velocity) >= 70) { + self.waterlevel = 3; // Swim mode gives player full 3D control. + self.flags = self.flags - (self.flags & FL_ONGROUND); // If onground, moving will cause the pitch to center automatically if mouselook is off, so remove the flag while the player swims in mid-air. + if (self.h2olevel < 2) self.velocity = self.velocity * 1.429; // This negates the underwater speed penalty. Don't forget to undo the changes made here in PlayerPostThink. Inspired by Hip's wetsuit code. But only in the air. 10/7 or 1.428571... + } else { + self.waterlevel = 0; // So player doesn't sink while not moving. + self.flags = self.flags | FL_ONGROUND; // While not in swim mode, the onground flag gives the player full control in the air, so make sure the flag is on. + } + self.flags = self.flags - (self.flags & FL_JUMPRELEASED); // Since the player is flying, make sure the jumpreleased flag is off at all times so when the player loses flight, he can't jump in mid-air in case the onground flag is on. + // A 'groundentity' is the entity the player stands on. If the groundentity + // is not the world, the player is assumed to be standing on something that + // may move, such as an elevator, a train, trap door. etc. If groundentity + // moves, the player tags along for the ride. The problem comes in if a + // player, flying in mid-air, has a non-world, moving groundentity. This + // lets the groundentity pull the player along when it shouldn't. To fix + // this, always set the groundentity to the world, which can never move. + self.groundentity = world; + + // The jump button works a bit differently while in flymode. + if (self.button2) { + // Rise if in water. Otherwise, slam on the brakes. + if (self.h2olevel) { + // WaterRise + if (self.h2otype == CONTENT_WATER) + self.velocity_z = 100; + else if (self.h2otype == CONTENT_SLIME) + self.velocity_z = 80; + else + self.velocity_z = 50; + + // Play swimming sound + if (self.swim_flag < time) { + self.swim_flag = time + 1; + if (random() < 0.5) sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); + } + // end WaterRise + if (self.h2olevel < 2) + self.velocity_z = self.velocity_z * 1.429; // 10/7 or 1.428571... + } else { self.velocity_z = 0; } + } + } else { + // Not movetype_fly...normal movement + if (self.waterlevel == 2) CheckWaterJump (); + + if (self.deadflag >= DEAD_DEAD) { + ClientDeath (); + return; + } + + if (self.deadflag == DEAD_DYING) return; // dying, so do nothing + + //---------------------------------------------------------------------- + // Rubicon Ladder Code - johnfitz + // Modified by me to support diff climb sounds and on/off/toggle states + //---------------------------------------------------------------------- + if (self.onladder) { + self.onladder = 0; // Reset ladder touch function + if (self.button2) { // Is jump key being pressed? + // Reset velocity upwards and all sideways movement + // so that the player stays on the ladder and climbs + // straight up with very little sidways movement + self.velocity = '0 0 0'; + self.velocity_z = self.entladder.speed; + self.gravity = 0.0000001; + + if (self.timeladder < time) { + // Reset timer for next sound to play + self.timeladder = time + self.entladder.waitmin; + // Check for any sounds and query if footsteps are active + if (self.entladder.sounds != 4 && query_configflag(SVR_FOOTSTEP) == FALSE) { + self.lip = random(); + if (self.lip < 0.25 && self.entladder.noise1) + sound (self, CHAN_BODY, self.entladder.noise1, 1, ATTN_NORM); + else if (self.lip < 0.5 && self.entladder.noise2) + sound (self, CHAN_BODY, self.entladder.noise2, 1, ATTN_NORM); + else if (self.lip < 0.75 && self.entladder.noise3) + sound (self, CHAN_BODY, self.entladder.noise3, 1, ATTN_NORM); + else if (self.entladder.noise4) + sound (self, CHAN_BODY, self.entladder.noise4, 1, ATTN_NORM); + } + } + } + else { + // Jump key released, stay floating on the ladder + self.flags = self.flags | FL_JUMPRELEASED; + self.velocity = 0.9 * self.velocity; + self.velocity_z = 0; + } + } else { + // Reset any ladder gravity settings + if (self.antigrav_finished > time) { + self.gravity = 0.25; + } else { + if (self.gravtrig == 1) { + self.gravity = self.gravtrigent.gravity; + } else { + self.gravity = 1; + } + } + + // Reset gravtrig each frame requiring trigger to reset it so we don't get stuck in low gravity even after leaving the trigger + self.gravtrig = 0; + + // Original jump conditions + if (self.button2) { + PlayerJump (); + } else { + if (self.wing_finished) + self.gravity = fabs(self.gravity); + + self.flags = self.flags | FL_JUMPRELEASED; + } + } + } + + // When the player/client starts in the map they don't want any velocity + if (time < self.pausetime) self.velocity = '0 0 0'; +}; + +void() PlayerFly_PostThink = { + // PM: If compiling for DarkPlaces, comment the code below out so that + // nothing is done. + if (self.waterlevel) + if (self.h2olevel < 2) + self.velocity = self.velocity * 0.7; +}; + +//---------------------------------------------------------------------- +// PlayerPostThink - Called every frame after physics are run +//---------------------------------------------------------------------- +void() PlayerPostThink = +{ + if (prethink && !postthink) { + // Check for the player? + // - first couple of frames the player is not setup correctly + if (self.flags & FL_CLIENT) { + postthink = TRUE; // postthink flag complete + mapvar_cvar = TRUE; // Map Variable are live + // Reset any screen cshift parameters, eng often leaves them + if (!self.cshift_upd) self.cshift_time = -1; + + // Check worldspawn water alpha parameters? + // liquid alpha is used by the monster visible system + if (world.water_alpha) { + liquid_alpha = world.water_alpha; + stuffcmd(self, "\nr_wateralpha "); + lftos(self, liquid_alpha ,1,3, BUFFER_STUFFCMD); + stuffcmd(self, "\n"); + dprint("\b[CLIENT]\b Water Alpha ("); + lftos(self, liquid_alpha ,1,3, BUFFER_DPRINT); + dprint(")\n"); + + } + else liquid_alpha = cvar("r_wateralpha"); + + // Check engine for actual autoaim setting + // Always reset with newgame and quickload + autoaim_cvar = cvar("sv_aim"); + + // Setup/change global fog if enabled (default) + if (!(query_configflag(SVR_NOFOGCMDS))) { + // Create fog controller and/or update engine fog + if (fog_active) change_fog(self); + else setup_fog_controller(); + } + + // Update console with MOD settings + display_configflag(); + display_version(); + if (globalstate > 0) + sprint (self,"Global states are set!\n"); + else + sprint (self,"No global states are set.\n"); + } + } + if (intermission_running > 0) return; // intermission or finale + if (self.deadflag) return; // Dead + + // Any spawn targets to update? + if (self.target2 != "") { + trigger_strs(self.target2, self); self.target2 = ""; + } + + if (self.movetype == MOVETYPE_FLY) PlayerFly_PostThink (); // flight think if we have boots of levitation + + W_WeaponFrame (); // Impulse commands and Quad updates + + // check to see if player landed and play landing sound + if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0)) { + if (self.watertype == CONTENT_WATER) + sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM); + else if (self.jump_flag < -650) { + T_Damage (self, world, world, 5, DAMARMOR); + sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); + self.deathtype = "falling"; + } + else + sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); + + self.jump_flag = 0; + } + + // Check for any fake water exit sounds + if (self.touchedliquid < time && self.touchedsound != "") { + sound (self, CHAN_BODY, self.touchedsound, 1, ATTN_NORM); + self.touchedsound = ""; + } + + // If flying through the air, store player Z velocity in jump flag + if (!(self.flags & FL_ONGROUND)) self.jump_flag = self.velocity_z; + ClientPowerups (); + ClientDeBuff (); + +// Update 7/24/09: Added grappler weapon from DoE. + if (self.hook) + GrappleService (); +}; + +//---------------------------------------------------------------------- +void() PlayerJump = +{ + if (self.flags & FL_WATERJUMP) return; + + if (self.waterlevel >= 2) { + if (self.watertype == CONTENT_WATER) self.velocity_z = 100; + else if (self.watertype == CONTENT_SLIME) self.velocity_z = 80; + else self.velocity_z = 50; + + // play swiming sound + if (self.swim_flag < time) { + self.swim_flag = time + 1; + if (random() < 0.5) sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); + } + return; + } + + // Levitation - - - - - - - - - - - - - + if (self.wing_finished) { + if (self.wing_sound <= time) { + //if (powcache & PCH_WING_USE) + sound (self, CHAN_AUTO, "items/levitate.wav", 1, ATTN_NORM); + self.wing_sound = time + 1; + } + // Gravity reversal was the simplest method to implement. + // Using fancy math to get reverse standard gravity can cause problems + // if the player gets hit with other effects that change gravity field. + self.gravity = 0 - fabs(self.gravity); + + return; + } + //- - - - - - - - - - - - - - - - - - - + + if (!(self.flags & FL_ONGROUND)) return; + if ( !(self.flags & FL_JUMPRELEASED) ) return; // don't pogo stick + + self.flags = self.flags - (self.flags & FL_JUMPRELEASED); + self.flags = self.flags - FL_ONGROUND; // don't stairwalk + + self.button2 = 0; + // player jumping sound + sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM); + self.velocity_z = self.velocity_z + 270; +}; + +//---------------------------------------------------------------------- +// Deals with water, slime and lava +//---------------------------------------------------------------------- +void() WaterMove = +{ + //dprint (ftos(self.waterlevel)); + // Fix noclip water gasping bug by giving air to the player + if (self.movetype == MOVETYPE_NOCLIP) { + self.air_finished = time + 1; + return; + } + if (self.health < 0) return; + + if (self.waterlevel != 3) { + if (self.air_finished < time) + sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM); + else if (self.air_finished < time + 9) + sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM); + self.air_finished = time + 12; + self.dmg = 2; + } + else if (self.air_finished < time) { // drown! + if (self.pain_finished < time) { + self.dmg = self.dmg + 2; + if (self.dmg > 15) self.dmg = 10; + T_Damage (self, world, world, self.dmg, DAMARMOR); + self.pain_finished = time + 1; + } + } + + if (!self.waterlevel) { + if (self.flags & FL_INWATER) { + // play leave water sound + sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM); + self.flags = self.flags - FL_INWATER; + } + return; + } + + if (self.watertype == CONTENT_LAVA) { // do damage + if (self.dmgtime < time && self.therm_finished < time) { + if (self.radsuit_finished > time) self.dmgtime = time + 1; + else self.dmgtime = time + 0.2; + T_Damage (self, world, world, 10*self.waterlevel, DAMARMOR); + } + } + else if (self.watertype == CONTENT_SLIME) { // do damage + if (self.dmgtime < time && self.radsuit_finished < time && self.therm_finished < time) { + self.dmgtime = time + 1; + T_Damage (self, world, world, 4*self.waterlevel, DAMARMOR); + } + } + + if ( !(self.flags & FL_INWATER) ) { // player enter water sound + if (self.watertype == CONTENT_LAVA) + sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); + if (self.watertype == CONTENT_WATER) + sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM); + if (self.watertype == CONTENT_SLIME) + sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); + + self.flags = self.flags + FL_INWATER; + self.dmgtime = 0; + } + + if (! (self.flags & FL_WATERJUMP) ) + self.velocity = self.velocity - 0.8*self.waterlevel*frametime*self.velocity; +}; + +//---------------------------------------------------------------------- +void() CheckWaterJump = +{ + local vector start, end; + + // check for a jump-out-of-water + makevectors (self.angles); + start = self.origin; + start_z = start_z + 8; + v_forward_z = 0; + normalize(v_forward); + end = start + v_forward*24; + traceline (start, end, TRUE, self); + + if (trace_fraction < 1) { // solid at waist + start_z = start_z + self.maxs_z - 8; + end = start + v_forward*24; + self.movedir = trace_plane_normal * -50; + traceline (start, end, TRUE, self); + if (trace_fraction == 1) { // open at eye level + self.flags = self.flags | FL_WATERJUMP; + self.velocity_z = 225; + self.flags = self.flags - (self.flags & FL_JUMPRELEASED); + self.teleport_time = time + 2; // safety net + return; + } + } +}; + +/*====================================================================== + CLIENT GAME EDGE FUNCTIONS +======================================================================*/ +// This function cannot be move, ref an exact frame in players model +void() set_suicide_frame; // In player.qc + +//---------------------------------------------------------------------- +void() ClientRespawn = +{ + if (coop) { + CopyToBodyQue (self); // make a copy of the dead body for appearances sake + setspawnparms (self); // get the spawn parms as they were at level start + PutClientInServer (); // respawn + } + else if (deathmatch) { + CopyToBodyQue (self); // make a copy of the dead body for appearances sake + SetNewParms (); // set default spawn parms + PutClientInServer (); // respawn + } + // restart the entire server + else localcmd ("restart\n"); +}; + +//---------------------------------------------------------------------- +void() ClientDeath = +{ + local float forward; + + if ((self.flags & FL_ONGROUND)) { + forward = vlen (self.velocity); + forward = forward - 20; + if (forward <= 0) + self.velocity = '0 0 0'; + else + self.velocity = forward * normalize(self.velocity); + } + + // wait for all buttons released + if (self.deadflag == DEAD_DEAD) { + if (self.button2 || self.button1 || self.button0) return; + self.deadflag = DEAD_RESPAWNABLE; + return; + } + + // wait for any button down + if (!self.button2 && !self.button1 && !self.button0) return; + self.button0 = self.button1 = self.button2 = 0; + ClientRespawn(); +}; + +//---------------------------------------------------------------------- +// Player entered the suicide command +//---------------------------------------------------------------------- +void() ClientKill = +{ + bprint (self.netname); + bprint (" suicides\n"); + set_suicide_frame (); + self.modelindex = modelindex_player; + self.frags = self.frags - 2; // extra penalty + ClientRespawn (); +}; + +//---------------------------------------------------------------------- +// Called when a player connects to a server +//---------------------------------------------------------------------- +void() ClientConnect = +{ + bprint (self.netname); + bprint (" entered the game\n"); + + // a client connecting during an intermission can cause problems + if (intermission_running > 0) GotoNextMap (); +}; + +//---------------------------------------------------------------------- +// Called when a player disconnects from a server +//---------------------------------------------------------------------- +void() ClientDisconnect = +{ + if (gameover) return; + // if the level end trigger has been activated, just return + // since they aren't *really* leaving + + // let everyone else know + bprint (self.netname); + bprint (" left the game with "); + bprint (ftos(self.frags)); + bprint (" frags\n"); + sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); + set_suicide_frame (); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/client_camera.qc b/QC_other/QC_keep/client_camera.qc new file mode 100644 index 00000000..fc80a8bf --- /dev/null +++ b/QC_other/QC_keep/client_camera.qc @@ -0,0 +1,278 @@ +/*====================================================================== +Intermission Camera System + + SetupIntermissionCamera - Find/setup all camera(s) + StartIntermissionCamera - Setup player ready for viewing + NextIntermissionCamera - Move player to first/next camera + CycleIntermissionCamera - wait for player input + FinishIntermissionCamera - No more viewing +======================================================================*/ +float CAMERA_NOINTERMIS = 1; // Will not work if intermission active +float CAMERA_SOLID = 2; // Intermission camera interacts with world +float INTERMISSION_ACTIVE = 2; // Regular Intermission active +float INTERMISSION_RUNE = 3; // Check for end of episode +float INTERMISSION_ENDGAME = 4; // End of game!?! (set in oldone.qc) +float INTERMISSION_CAMERA = 10; // Special Camera only mode + +//---------------------------------------------------------------------- +void() SetupIntermissionCamera = +{ + local entity intercam, prevcam; + + // Is the infomission camera chain been setup already? + if (camera_ent) return; + + // Try to find the first intermission camera + intercam = find (world, classname, "info_intermission"); + prevcam = world; + + if (intercam) { + // Cycle through all intermission cameras and link them together + while(intercam) { + // first camera in chain? setup first and previous camera + if (!prevcam) { camera_ent = intercam; camera_ent.count = 0;} + else prevcam.owner = intercam; + + // Save current camera to previous ready for loop + prevcam = intercam; + camera_ent.count = camera_ent.count + 1; + //dprint("[CAM] ("); dprint(ftos(camera_ent.count)); + //dprint(") Org ("); dprint(vtos(intercam.origin)); dprint(")\n"); + + intercam = find(intercam, classname, "info_intermission"); + } + // Close the camera chain + prevcam.owner = camera_ent; + dprint("\b[CAMERA]\b Intermissions found ("); + dprint(ftos(camera_ent.count)); dprint(")\n"); + } + else { + dprint("\b[CAMERA]\b Intermissions missing!\n"); + // Cannot find any info_intermission cameras, so use player start + // If there is no player start then use player's last location! + if (deathmatch) intercam = find (world, classname, "info_player_deathmatch"); + else intercam = find (world, classname, "info_player_start"); + if (!intercam) intercam = client_ent; + + // Spawn a new camera entity + camera_ent = spawn(); + camera_ent.classtype = CT_CAMERA; + setsize (camera_ent, VEC_ORIGIN, VEC_ORIGIN); + camera_ent.movetype = MOVETYPE_NONE; + camera_ent.solid = SOLID_NOT; + setorigin(camera_ent, intercam.origin); + setmodel(camera_ent, MODEL_EMPTY); + camera_ent.mangle = intercam.angles; + camera_ent.count = 1; + camera_ent.owner = camera_ent; + } +}; + +//---------------------------------------------------------------------- +void() FinishIntermissionCamera = +{ + // skip any text in deathmatch + if (deathmatch) { GotoNextMap (); return; } + + intermission_exittime = time + 1; + intermission_running = intermission_running + 1; + + //---------------------------------------------------------------------- + // run some text if at the end of an each episode + //---------------------------------------------------------------------- + if (intermission_running == INTERMISSION_RUNE) { + if (world.model == "maps/e1m7.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + if (!cvar("registered")) { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!"); + } + else { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!"); + } + return; + } + else if (world.model == "maps/e2m6.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral."); + return; + } + else if (world.model == "maps/e3m6.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth."); + return; + } + else if (world.model == "maps/e4m7.bsp") { + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 2); + WriteByte (MSG_ALL, 3); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person."); + return; + } + // No special end text? go straight to next map + GotoNextMap(); + } + //---------------------------------------------------------------------- + // If the player has all four runes, print more text!?! + //---------------------------------------------------------------------- + else if (intermission_running == INTERMISSION_ENDGAME) { + if (!cvar("registered")) { + // shareware episode has been completed, go to sell screen + WriteByte (MSG_ALL, SVC_SELLSCREEN); + return; + } + + if ( (serverflags & SVR_RUNE_ALL) == SVR_RUNE_ALL) { + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born."); + return; + } + } + // Finished episode text and shub waking up text, then finally next map! + else GotoNextMap(); +}; + +//---------------------------------------------------------------------- +void() NextIntermissionCamera = +{ + // This method is unreliable, it is better to move the players + // origin like the orginal method used by the id QC + //msg_entity = self; + //WriteByte(MSG_ALL, SVC_SETVIEW); + //WriteEntity(MSG_ALL, self.goalentity); + + // Exclude the special intermission cameras (special impulse) + if (camera_ent.count > 1 && intermission_running > 0 + && intermission_running < INTERMISSION_CAMERA) { + // Cycle through list trying to find a camera + // designed for the intermission at the end of a map + // Can have special cameras designed for impulse 145! + while(self.goalentity.spawnflags & CAMERA_NOINTERMIS) { + self.goalentity = self.goalentity.owner; + } + } + + // Switch player view to intermission camera + self.view_ofs = '0 0 0'; + setorigin(self, self.goalentity.origin); + self.angles = self.v_angle = self.goalentity.mangle; + self.fixangle = TRUE; + + // Change the camera to allow for environment interaction + if (self.goalentity.spawnflags & CAMERA_SOLID) { + self.solid = SOLID_TRIGGER; + setsize(self, VEC_HULLE_MIN, VEC_HULLE_MAX); + } + // no interaction, static + else { + self.solid = SOLID_NOT; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + } + + // If target exists on camera fire triggers (once) + if (self.goalentity.target) { + trigger_strs(self.goalentity.target, self); + self.goalentity.target = ""; + } + + // Test for any fog changes on intermission entity + if (fog_active && self.goalentity.fog_density > 0) { + // Double check for quake.rc parameter + if (query_configflag(SVR_NOFOGCMDS)) self.goalentity.fog_density = 0; + else fade_fog(self.goalentity.fog_density, self.goalentity.fog_colour, self.goalentity.speed); + } +}; + +//---------------------------------------------------------------------- +void() CycleIntermissionCamera = +{ + // Is the intermission camera still being setup? + if (intermission_running < INTERMISSION_ACTIVE) return; + if (self.waitmin > time) return; // delay input from keyboard + + // check for jump button to exit + if (self.button1 || self.button2 || (self.button0 && camera_ent.count == 1) ) { + self.button0 = self.button1 = self.button2 = 0; + if (intermission_running != INTERMISSION_CAMERA) { + self.waitmin = time + 1; + if (time > intermission_exittime) FinishIntermissionCamera (); + } + } + // check for attack button to switch cameras + else if (self.button0) { + self.button0 = self.button1 = self.button2 = 0; + self.waitmin = time + 0.5; + + // Shift forward to next camera + self.goalentity = self.goalentity.owner; + NextIntermissionCamera(); + } +}; + +//---------------------------------------------------------------------- +void() StartIntermissionCamera = +{ + if (camera_ent) { + // Switch self to client (stored when client is setup) + self = client_ent; + + // Switch on notarget so monsters don't attack player + // Add god mode to prevent any damage, is reset on map change + self.flags = self.flags + (FL_NOTARGET || FL_GODMODE); + self.flags = self.flags - (self.flags & FL_ONGROUND); + + // reset player model to nothing and no world interaction + self.view_ofs = self.velocity = self.avelocity = '0 0 0'; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; // no more movement + self.takedamage = DAMAGE_NO; // no more damage + setmodel(self, MODEL_EMPTY); // Hide player model + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + self.weaponmodel = string_null; // No vmodel updates + self.frame = self.weaponframe = 0; // reset all frames + self.waitmin = time + 0.5; // Delay before start + self.think = SUB_Null; // Stop player.qc + + // Finish all other artifacts - stop all the timers + self.radsuit_finished = self.invisible_finished = 0; + self.invincible_finished = self.super_damage_finished = 0; + self.sharpshoot_finished = self.nailpiercer_finished = 0; + self.wetsuit_finished = 0; + + // Setup default - first camera to look through + self.goalentity = camera_ent; + // Is there more than 1 camera and intermission time? + // Always start at the first camera if using camera test mode + if (camera_ent.count > 1 && intermission_running > 0) { + // Randomly pick a camera to cycle forward to + self.lip = rint(random() * camera_ent.count); + while (self.lip > 0) { + self.goalentity = self.goalentity.owner;// Cycle through list + self.lip = self.lip - 1; // Keep looping + } + } + + // Switch player to the currently selected camera + NextIntermissionCamera(); + + // Check if end of map intermission is really running? + // Can enter this function via camera test mode (impulse xxx) + if (intermission_running == 0) intermission_running = INTERMISSION_CAMERA; + else intermission_running = INTERMISSION_ACTIVE; + } + // If camera entity not setup, go straight to next map + else FinishIntermissionCamera (); +}; diff --git a/QC_other/QC_keep/client_debuff.qc b/QC_other/QC_keep/client_debuff.qc new file mode 100644 index 00000000..c582957b --- /dev/null +++ b/QC_other/QC_keep/client_debuff.qc @@ -0,0 +1,365 @@ +/*====================================================================== + CheckDeBuff - Check for negative buffs affecting the player +======================================================================*/ + +.float cshift_upd; // Screen updates (v_cshift) are active +.float cshift_time; // Timer (0.1s tick) for screen updates +.vector cshift_col; // RGB / XYZ values for screen colour +.float cshift_den; // Screen colour density +.float cshift_step; // Quantity to reduce density by per tick + +.float debuff_sound; // Heartbeat sound when tick happens +.float debuff_qty; // Quantity to do something with (temp) + +.float bleeding; // Bleeding debuff status +.float bleeding_time; // Timer (1s tick) for screen/sound update +.float bleeding_qty; // Total amount of health stored (HoT) + +.float burning; // Burning debuff status +.float burning_time; // Timer (1s tick) for screen/sound update +.float burning_qty; // Total amount of damage stored (DoT) + +.float poisoned; // Poison debuff status +.float poisoned_time; // Timer (1s tick) for screen/sound update +.float poisoned_qty; // Total amount of damage stored (DoT) + +// IT_INVISIBILITY + IT_INVULNERABILITY + IT_SUIT + IT_QUAD +// 524288 + 1048576 + 2097152 + 4194304 +float ALL_ITARTIFACTS = 7864320; + +// Wraith Health drain +vector DEBUFF_BLEED_COL = '200 0 0'; // Strong red +float DEBUFF_BLEED_DEN = 120; +float DEBUFF_BLEED_STEP = 10; +float DEBUFF_BLEED_HEAL = 5; +float DEBUFF_BLEED_MIN = 5; + +// Pyro flame burn +vector DEBUFF_BURN_COL = '200 100 0'; // Orange +float DEBUFF_BURN_DEN = 120; +float DEBUFF_BURN_STEP = 10; +float DEBUFF_BURN_DMG = 1; +float DEBUFF_BURN_MAX = 10; + +// Mummy poisoned gibs +vector DEBUFF_POISON_COL = '0 200 0'; // Strong Green +float DEBUFF_POISON_DEN = 84; +float DEBUFF_POISON_STEP = 7; +float DEBUFF_POISON_DMG = 1; +float DEBUFF_POISON_DMGMON = 15; + +//---------------------------------------------------------------------- +// Various debuff reset functions, used all over the place +//---------------------------------------------------------------------- +void(entity targ) ResetDebuffScreen = +{ + targ.cshift_upd = FALSE; + targ.cshift_time = LARGE_TIMER; + stuffcmd(targ, "v_cshift 0 0 0 0\n"); + targ.cshift_col = '0 0 0'; + targ.cshift_den = 0; +}; + +void(entity targ) ResetDebuffBurning = +{ targ.burning = targ.burning_qty = 0; }; + +void(entity targ) ResetDebuffPoisoned = +{ targ.poisoned = targ.poisoned_qty = 0; }; + +void(entity targ) ResetDebuffBleeding = +{ targ.bleeding = targ.bleeding_qty = 0; }; + +void(entity targ) ResetDebuffSystem = +{ + ResetDebuffScreen(targ); + ResetDebuffBurning(targ); + ResetDebuffPoisoned(targ); + ResetDebuffBleeding(targ); +}; + +//---------------------------------------------------------------------- +// Core debuff function, run every frame from client.qc +//---------------------------------------------------------------------- +void() ClientDeBuff = +{ + // If player is dead or intermission running, turn everything off + if (intermission_running > 0 || self.health < 1) { + ResetDebuffSystem(self); + return; + } + + // Check for burning debuff (DoT) + if (self.burning) { + // Is it time for a debuff update + if (self.burning_time < time) { + if (self.burning_qty > 0) { + // Reset burning tick timer + self.burning_time = time + 1; + + // Give priority to bleeding(heal) and poisoned + if (!self.bleeding && !self.poisoned) { + if (self.debuff_sound < time) self.debuff_sound = time + 1; + self.cshift_upd = TRUE; // Update screen colour + self.cshift_time = -1; // Update striaght away + self.cshift_col = DEBUFF_BURN_COL; + self.cshift_den = DEBUFF_BURN_DEN; + self.cshift_step = DEBUFF_BURN_STEP; + } + + // Setup default burning damage + self.debuff_qty = DEBUFF_BURN_DMG; + // Check burning does not exceed stored damage + if (self.burning_qty < self.debuff_qty) self.debuff_qty = self.burning_qty; + // Subtract burning damage from counters + self.burning_qty = self.burning_qty - self.debuff_qty; + + // Use global damage function (has death checks) + T_Damage (self, world, world, self.debuff_qty, NOARMOR); + } + } + // Check if player is in water up to waist? + // 0 = not in, 1 = feet, 2 = waist, 3 = eyes + if (self.waterlevel >= 2 || self.burning_qty < 1) { + ResetDebuffBurning(self); + } + } + + // Check for poisoned debuff (DoT) + if (self.poisoned) { + // Is it time for a debuff update + if (self.poisoned_time < time) { + if (self.poisoned_qty > 0) { + // Reset poisoned tick timer + self.poisoned_time = time + 1; + + // Give priority to bleeding(heal) + if (!self.bleeding) { + if (self.debuff_sound < time) self.debuff_sound = time + 1; + self.cshift_upd = TRUE; // Update screen colour + self.cshift_time = -1; // Update striaght away + self.cshift_col = DEBUFF_POISON_COL; + self.cshift_den = DEBUFF_POISON_DEN; + self.cshift_step = DEBUFF_POISON_STEP; + } + + // Setup default poison damage + self.debuff_qty = DEBUFF_POISON_DMG; + // Check poison does not exceed damage left + if (self.poisoned_qty < self.debuff_qty) self.debuff_qty = self.poisoned_qty; + // Subtract poison damage from counters + self.poisoned_qty = self.poisoned_qty - self.debuff_qty; + + // Use global damage function (has death checks) + T_Damage (self, world, world, self.debuff_qty, NOARMOR); + } + } + // Check if poison has finished? + if (self.poisoned_qty < 1) ResetDebuffPoisoned(self); + } + + // Check for bleeding debuff (HoT) + if (self.bleeding) { + // Is it time for a debuff update + if (self.bleeding_time < time) { + if (self.bleeding_qty > 0) { + // Reset bleeding(healing) tick timer + self.bleeding_time = time + 1; + if (self.debuff_sound < time) self.debuff_sound = time + 1; + self.cshift_upd = TRUE; // Update screen colour + self.cshift_time = -1; // Update striaght away + self.cshift_col = DEBUFF_BLEED_COL; + self.cshift_den = DEBUFF_BLEED_DEN; + self.cshift_step = DEBUFF_BLEED_STEP; + + // Setup default healing + self.debuff_qty = DEBUFF_BLEED_HEAL; + // Check healing does not exceed current reserve + if (self.bleeding_qty < self.debuff_qty) self.debuff_qty = self.bleeding_qty; + // Subtract bleeding heals from counters + self.bleeding_qty = self.bleeding_qty - self.debuff_qty; + // Check healing does not go over max player limit + if (self.health + self.debuff_qty > self.max_health) + self.debuff_qty = self.max_health - self.health; + + // Directly add health back to player + self.health = self.health + self.debuff_qty; + } + } + // Check if player is over max health or run out of healing + if (self.health >= self.max_health || self.bleeding_qty < 1) { + ResetDebuffBleeding(self); + } + } + + // Check for any debuff screen updates? + if (self.cshift_upd) { + // Play different debuff sounds (pressure is on!) + if (self.debuff_sound > time) { + self.debuff_sound = -1; // Reset + + // Sound exception for god/pentagram mode + if (self.flags & FL_GODMODE || self.invincible_finished >= time) { + if (self.invincible_sound < time) { + sound (self, CHAN_VOICE, SOUND_ARTPENT3, 1, ATTN_NORM); + self.invincible_sound = time + 2; + } + } + else { + // Play heartbeat only for bleeding/healing + if (self.bleeding) + sound (self, CHAN_VOICE, SOUND_HEARTBEAT, 1, ATTN_IDLE); + // Re-use player pain sounds + else if (self.poisoned) { + if (random() < 0.5) sound (self, CHAN_VOICE, "player/pain2.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "player/pain3.wav", 1, ATTN_IDLE); + } + // Play on the same channel as player pain + else if (self.burning) { + if (random() < 0.5) sound (self, CHAN_VOICE, "player/pain1.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "player/pain4.wav", 1, ATTN_IDLE); + } + } + } + // Check for screen update? 0.1s tick interval + if (self.cshift_time < time) { + // Generate some particles based on debuff + // Priority is bleeding > poisoned > burning + if (self.bleeding) particle_debuff(self.origin, 16, rint(1+random()*4), PARTICLE_BURST_RED); + else if (self.poisoned) particle_debuff(self.origin, 16, rint(1+random()*4), PARTICLE_BURST_GREEN); + else if (self.burning) particle_debuff(self.origin, 16, rint(1+random()*4), PARTICLE_BURST_YELLOW); + + // Count down density and check for reset condition + self.cshift_den = self.cshift_den - self.cshift_step; + if (self.cshift_den < 1) ResetDebuffScreen(self); + else { + // Update screen using stuffcmds! + self.cshift_time = time + 0.1; + + // Don't update the screen if an artifact is active + // The engine will be updating at the same time + if (self.items & ALL_ITARTIFACTS == 0) { + stuffcmd(self, "v_cshift "); + stuffcmd(self, ftos(rint(self.cshift_col_x))); + stuffcmd(self, " "); + stuffcmd(self, ftos(rint(self.cshift_col_y))); + stuffcmd(self, " "); + stuffcmd(self, ftos(rint(self.cshift_col_z))); + stuffcmd(self, " "); + stuffcmd(self, ftos(rint(self.cshift_den))); + stuffcmd(self, "\n"); + } + } + } + } + // Reset cshift if nothing is active (engine does not reset) + // This is to catch new games or quickload resets + else if (self.cshift_time < time) ResetDebuffScreen(self); +}; + +//---------------------------------------------------------------------- +void(entity targ) BleedDeBuff = +{ + local float debuffqty; + + // Check for minimum amount of health for debuff + // Immune to debuff if using Pent of Protection or BioSuit + if (targ.health < DEBUFF_BLEED_MIN) return; + if (targ.flags & FL_CLIENT == FALSE) return; + if (targ.items & (IT_INVULNERABILITY | IT_SUIT)) { + T_Damage (targ, self, self, DAMGE_WRAITHBOLT, DAMARMOR); + return; + } + + // if debuff not active, starting bleeding! + if (!targ.bleeding) { + targ.bleeding = TRUE; + targ.bleeding_time = -1; + } + + // Take health from player and store it + debuffqty = rint(targ.health * 0.5); + T_Damage (targ, self, self, debuffqty, NOARMOR); + targ.bleeding_qty = targ.bleeding_qty + debuffqty; +}; + +//---------------------------------------------------------------------- +void(entity targ) BurnDeBuff = +{ + local float debuffqty; + + // Do not stack burning time beyond a certain limit + // Cannot be burning if knee deep in water + // Immune to debuff if using Pent of Protection or BioSuit + if (targ.burning_qty > DEBUFF_BURN_MAX) return; + if (targ.flags & FL_CLIENT == FALSE) return; + if (targ.waterlevel >= 3) return; + if (targ.items & (IT_INVULNERABILITY | IT_SUIT)) return; + + // if debuff not active, starting burning! + if (!targ.burning) { + targ.burning = TRUE; + targ.burning_time = -1; + } + + // work out time remaining on debuff + debuffqty = rint(5*skill + 3 + 2*random()); + targ.burning_qty = targ.burning_qty + debuffqty; + if (targ.burning_qty > DEBUFF_BURN_MAX) targ.burning_qty = DEBUFF_BURN_MAX; + + targ.cshift_upd = TRUE; // Update screen colour + targ.cshift_time = -1; // Update striaght away + targ.cshift_col = DEBUFF_BURN_COL; + targ.cshift_den = DEBUFF_BURN_DEN; + targ.cshift_step = DEBUFF_BURN_STEP; +}; + +//---------------------------------------------------------------------- +void(entity targ) PoisonDeBuff = +{ + local float debuffqty; + + // Immune to debuff if using Pent of Protection or BioSuit + //if (targ.flags & FL_CLIENT == FALSE) return; + if (targ.items & (IT_INVULNERABILITY | IT_SUIT)) return; + if (targ.poisoned) return; // Only poison once + + // if debuff not active, start poison! + targ.poisoned = TRUE; + targ.poisoned_time = -1; + // work out time remaining on debuff + if (targ.flags & FL_CLIENT) { + debuffqty = rint(skill + 3 + 2*random()); + } else { + debuffqty = rint(3 + (2 * random())); + } + targ.poisoned_qty = targ.poisoned_qty + debuffqty; + + targ.cshift_upd = TRUE; // Update screen colour + targ.cshift_time = -1; // Update striaght away + targ.cshift_col = DEBUFF_POISON_COL; + targ.cshift_den = DEBUFF_POISON_DEN; + targ.cshift_step = DEBUFF_POISON_STEP; +}; + +//---------------------------------------------------------------------- +// Used by Pyro and Wraith; consistent damage from both monsters +//---------------------------------------------------------------------- +void(entity targ, float playdmg, float mondmg) ApplyFireDmg = +{ + local float reduction, firedamage; + + // Bio suit reduction - easy=80%, normal=70%, hard=60%, nm=50% + reduction = 0.2 + skill * 0.1; + + // Thermal protection suit reduction + if (targ.therm_finished > time) reduction = 0.2 + skill * 0.05; // reduce by double that of radsuit + + // Damage is different for monsters/players + if (targ.flags & FL_MONSTER) firedamage = mondmg; + else if (targ.items & IT_SUIT || targ.therm_finished > time) firedamage = rint(playdmg * reduction); + else firedamage = playdmg; + + // Final damage (no armour save) + T_Damage (targ, self, self.owner, firedamage, NOARMOR); + BurnDeBuff(targ); +}; diff --git a/QC_other/QC_keep/client_info.qc b/QC_other/QC_keep/client_info.qc new file mode 100644 index 00000000..c83d4106 --- /dev/null +++ b/QC_other/QC_keep/client_info.qc @@ -0,0 +1,145 @@ +/*====================================================================== + INFO ENTITIES +======================================================================*/ +void() info_null = { remove(self); }; +void() info_notnull = {}; +void() info_target = {}; + +/*====================================================================== +/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24) x x x x x x x x Not_Easy Not_Normal Not_Hard Not_DM Dyn_Easy Dyn_Normal Dyn_Hard Dyn_Night +{ model(":progs/player.mdl"); } +DEFAULT starting point for a player +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +-------- SPAWNFLAGS -------- +-------- NOTES -------- +DEFAULT starting point for a player + +======================================================================*/ +void() info_player_start = { + self.classtype = CT_SPAWNSP; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED info_player_start2 (0.9 0 0) (-16 -16 -24) (16 16 24) x x x x x x x x Not_Easy Not_Normal Not_Hard Not_DM Dyn_Easy Dyn_Normal Dyn_Hard Dyn_Night +{ model(":progs/player.mdl"); } +Starting point for players with runes or startspawn2 system +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +startspawn2 : Unique spawn location number matching a trigger_changelevel +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Starting point for players with runes or using the startspawn2 system +The startspawn2 system lets players move between maps using exact location + +======================================================================*/ +void() info_player_start2 = { + self.classtype = CT_SPAWNSP; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/player.mdl"); } +Starting position for coop games +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +-------- SPAWNFLAGS -------- +STARTOFF : Starts off +-------- NOTES -------- +Starting position for coop games + +======================================================================*/ +void() info_player_coop = { + self.classtype = CT_SPAWNCOOP; + if (self.spawnflags & MON_SPAWN_DELAY) self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; +}; + +/*====================================================================== +/*QUAKED info_player_deathmatch (0 1 1) (-16 -16 -24) (16 16 24) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/player.mdl"); } +Starting position for deathmatch games +-------- KEYS -------- +target : triggered target(s) when used as a client destination +angle : Starting view angle +-------- SPAWNFLAGS -------- +STARTOFF : Starts off +-------- NOTES -------- +Starting position for deathmatch games + +======================================================================*/ +void() info_player_deathmatch = { + self.classtype = CT_SPAWNDM; + if (self.spawnflags & MON_SPAWN_DELAY) self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; +}; + +/*====================================================================== +/*QUAKED info_teleport_destination (1 0.5 0.5) (-8 -8 -8) (8 8 32) x +Destination marker for a teleporter +-------- KEYS -------- +targetname : link to trigger_teleport +target : fires when the entities is used as a destination +angles : Pitch Yaw Roll (viewing angle after teleporting) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Destination marker for a teleporter + +======================================================================*/ +void() info_teleport_destination = +{ + self.classtype = CT_MISCTELEPORT; + self.estate = ESTATE_ON; + self.mangle = self.angles; + self.angles = '0 0 0'; + self.origin = self.origin + '0 0 27'; +}; + +/*====================================================================== +/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16) NO_INTERMIS SOLID x x x x x x Not_Easy Not_Normal Not_Hard Not_DM +This is the camera point for the intermission +-------- KEYS -------- +target : triggered target(s) when used as a viewing camera +mangle : Pitch Yaw Roll +fog_density : fog density (Must be >0 to activate feature) +fog_colour : fog colours (def=0.1 0.1 0.1) +speed : fog time to change (def=2s) +-------- SPAWNFLAGS -------- +NO_INTERMIS : Will not display when proper intermission active +SOLID : Intermission camera interacts with world +-------- NOTES -------- +mangle = up/down, angle, tilt left/right 'pitch roll yaw' +up/left = negative value, down/right = positive value + +======================================================================*/ +void() info_intermission = +{ + self.classtype = CT_CAMERA; + self.estate = ESTATE_ON; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, MODEL_EMPTY); + self.view_ofs = '0 0 0'; + self.owner = self; + + // Check for any trigger fog parameters + if (self.fog_density > 0) { + if (!self.speed) self.speed = 2; + // Double check its within range + if (self.fog_density > 1) self.fog_density = 1; + if (CheckZeroVector(self.fog_colour)) self.fog_colour = '0.1 0.1 0.1'; + } + // Disable fog trigger if density not setup + else self.fog_density = 0; + +}; \ No newline at end of file diff --git a/QC_other/QC_keep/client_mapvar.qc b/QC_other/QC_keep/client_mapvar.qc new file mode 100644 index 00000000..43607bd1 --- /dev/null +++ b/QC_other/QC_keep/client_mapvar.qc @@ -0,0 +1,411 @@ +/*====================================================================== +Client Map Variables +-------------------- + +Allows for binary (0/1) map variables to be stored with the map save +system (parm1-16) by the engine. The top 6 parm variables are never used +and can easily be turned into variables for the map to use. + +======================================================================*/ +float MAPV_BITS = 22; // Bits used in each parm block +float MAPV_BLCK = 6; // Blocks used (total parm's) +float MAPV_TOTAL = 132; // Maximum amount of variables + +float MAPV_QUERY = 1; // Point entity - Query value +float MAPV_UPDATE = 2; // Point entity - Update value +float MAPV_TOGGLE = 4; // Point entity - Toggle value +float MAPV_MONSTERS = 32; // Monsters can use bmodel trigger + +float bitflags[24]; // Bitflag values +float mapvar[6]; // Map variables stored in savefile +void() trigger_bmodel_sounds; +void() trigger_bmodel_setup; +void() trigger_cdtrack_change; +void(entity e) trigger_skybox_change; + +//====================================================================== +/*QUAKED trigger_mapvar_query (.5 .7 1) (-8 -8 -16) (8 8 16) x +Trigger target(s) based on mapvar +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +target : Map variable == 0 fire these target(s) +target2 : Map variable == 1 fire these target(s) +noise : aframe switchable object +wait : -1 = trigger once +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Trigger target(s) based on mapvar +//----------------------------------------------------------------------------- +/*QUAKED trigger_mapvar_update (.5 .7 1) (-8 -8 -16) (8 8 16) x +Update the value of mapvar +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +cnt : Value (0/1) +target : Map variable == 0 fire these target(s) +target2 : Map variable == 1 fire these target(s) +noise : aframe switchable object +wait : -1 = trigger once +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Update the value of mapvar +//----------------------------------------------------------------------------- +/*QUAKED trigger_mapvar_toggle (.5 .7 1) (-8 -8 -16) (8 8 16) x +Toggle the value of mapvar +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +target : Map variable == 0 fire these target(s) +target2 : Map variable == 1 fire these target(s) +noise : aframe switchable object +wait : -1 = trigger once +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Toggle the value of mapvar +======================================================================*/ + +// Setup the bitflag array (used in world.qc) +void() mapvar_setuparray = +{ + local float bitindex, bitpow; + + // Setup loop and first bit + bitindex = 0; bitpow = 1; + while (bitindex < 24) { + bitflags[bitindex] = bitpow; + bitpow = bitpow * 2; + bitindex = bitindex + 1; + } +}; + +//---------------------------------------------------------------------- +// Reset all map variable banks to zero (used in client.qc) +void() mapvar_reset = +{ + local float mapv_bank; + + mapv_bank = 0; + while (mapv_bank < MAPV_BLCK) { + mapvar[mapv_bank] = 0; + mapv_bank = mapv_bank + 1; + } +}; + +//---------------------------------------------------------------------- +// Read map variable from block/bits parms and return value +float(float mapv_indx) query_mapvar = +{ + local float mapv_bank, mapv_cell, mapv_bit; + + // Work out parm and bitflag index + mapv_bank = floor(mapv_indx/MAPV_BITS); + mapv_cell = mapv_indx - (mapv_bank*MAPV_BITS); + // Error check return value + if (mapv_bank < 0 || mapv_bank >= MAPV_BLCK) mapv_bank = 0; + if (mapv_cell < 0 || mapv_cell >= MAPV_BITS) mapv_cell = 0; + // Find bitflag mask value + mapv_bit = mapvar[mapv_bank] & bitflags[mapv_cell]; + + /* Debug info (not used anymore) + dprint("Number ("); dprint(ftos(mapv_indx)); + dprint(") B/C ("); dprint(ftos(mapv_bank)); + dprint(" "); dprint(ftos(mapv_cell)); + dprint(") = ("); dprint(ftos(mapv_bit)); + dprint(")\n"); */ + + if (mapv_bit > 0) return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Update map variable from block/bits parms +void(float mapv_indx, float mapv_val) update_mapvar = +{ + local float mapv_bank, mapv_cell; + + // Work out parm and bitflag index + mapv_bank = floor(mapv_indx/MAPV_BITS); + mapv_cell = mapv_indx - (mapv_bank*MAPV_BITS); + // Error check return value + if (mapv_bank < 0 || mapv_bank >= MAPV_BLCK) mapv_bank = 0; + if (mapv_cell < 0 || mapv_cell >= MAPV_BITS) mapv_cell = 0; + + // Remove any existing bitflag value + mapvar[mapv_bank] = mapvar[mapv_bank] - (mapvar[mapv_bank] & bitflags[mapv_cell]); + + // Is the bit value TRUE? + if (mapv_val == TRUE) { + mapvar[mapv_bank] = mapvar[mapv_bank] | bitflags[mapv_cell]; + } +}; + +//---------------------------------------------------------------------- +// Set a range of map variables (used in triggers.qc) +void(vector mapv_range) mapvar_range = +{ + local vector mapv_dest; + local float mapv_swap, mapv_loop; + + // Remove any negative or fractions + mapv_dest_x = fabs(rint(mapv_range_x)); + mapv_dest_y = fabs(rint(mapv_range_y)); + mapv_dest_z = fabs(rint(mapv_range_z)); + + // Check for upper variable range + if (mapv_dest_x >= (MAPV_BLCK*MAPV_BITS)) + mapv_dest_x = (MAPV_BLCK*MAPV_BITS) - 1; + if (mapv_dest_y >= (MAPV_BLCK*MAPV_BITS)) + mapv_dest_y = (MAPV_BLCK*MAPV_BITS) - 1; + if (mapv_dest_z > 1) mapv_dest_z = 1; + + // Check for reverse order on range + if (mapv_dest_x > mapv_dest_y) { + mapv_swap = mapv_dest_x; + mapv_dest_x = mapv_dest_y; + mapv_dest_y = mapv_swap; + } + + // Count through range + mapv_loop = mapv_dest_x; + while (mapv_loop <= mapv_dest_y) { + // Change map variable + update_mapvar(mapv_loop, mapv_dest_z); + mapv_loop = mapv_loop + 1; + } +}; + +//---------------------------------------------------------------------- +// Display the value of all map variable parm blocks +void() display_mapvar = +{ + local float loopbank, loopcell, loopspace, loopval; + + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + // Has the map variable system been setup? + if (!mapvar_cvar) { + sprint(self,"\b[MAPVAR]\b System has not been setup yet!\n"); + return; + } + + // Reset impulse and initialize variables + self.impulse = 0; + loopbank = loopcell = 0; + + dprint("\n\b[MAPVAR]\b Current System Values\n"); + dprint("--------------------------------------\n"); + while (loopbank < MAPV_BLCK) { + dprint("Bank "); dprint(ftos(loopbank)); dprint(" - "); + loopcell = 0; loopspace = 4; + while (loopcell < MAPV_BITS) { + loopval = query_mapvar((loopbank*MAPV_BITS)+loopcell); + dprint(ftos(loopval)); + + loopcell = loopcell+1; + if (loopcell == loopspace) { + dprint(" "); + loopspace = loopspace+4; + } + } + dprint("\n"); + loopbank = loopbank+1; + } + dprint("--------------------------------------\n"); +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_base_use = +{ + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + + // UPDATE : Map Variable + if (self.style == MAPV_UPDATE) { + self.lefty = self.cnt; + update_mapvar(self.count, self.cnt); + } + // TOGGLE : map variable + else if (self.style == MAPV_TOGGLE) { + self.lefty = query_mapvar(self.count); + self.lefty = 1 - self.lefty; + update_mapvar(self.count, self.lefty); + } + // QUERY : map variable + else { + self.lefty = query_mapvar(self.count); + } + + // Check for On/Off target(s) + if (self.lefty == FALSE) { + if (self.target != "") trigger_strs(self.target, activator); + } + else { + if (self.target2 != "") trigger_strs(self.target2, activator); + } + + // Check for switchable bmodel + if (self.noise != "") { + // Check if entity exists first + if (!self.oldenemy) + self.oldenemy = find(world, targetname, self.noise); + // Only work with Bmodel entities (usually aframes) + if (self.oldenemy.bsporigin) { + // Flashing (ON) is +0frame ; Static (OFF) is +aframe + if (self.lefty == TRUE) self.oldenemy.frame = 0; + else self.oldenemy.frame = 1; + } + } + + // Check for fire once condition and wait timer + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + else self.attack_finished = time + self.wait; +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_base = +{ + // Check for any missing keys + if (self.targetname == "") dprint("\b[MAPVAR]\b Missing targetname!\n"); + // Remove any negative or fractions + self.count = fabs(rint(self.count)); + + // Check for upper variable range + if (self.count >= (MAPV_BLCK*MAPV_BITS)) + self.count = (MAPV_BLCK*MAPV_BITS) - 1; + + // Check for bitflag value range + if (self.cnt < FALSE || self.cnt > TRUE) self.cnt = FALSE; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_mapvar_base_use; + self.estate = ESTATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_query = +{ + self.classtype = CT_MAPVAR; + self.style = MAPV_QUERY; + trigger_mapvar_base(); +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_update = +{ + self.classtype = CT_MAPVAR; + self.style = MAPV_UPDATE; + trigger_mapvar_base(); +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_toggle = +{ + self.classtype = CT_MAPVAR; + self.style = MAPV_TOGGLE; + trigger_mapvar_base(); +}; + +//====================================================================== +/*QUAKED trigger_mapvar_multiple (0.5 0 0.5) ? x x x x x MONSTERS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Touch trigger target(s) based on mapvar +------- KEYS -------- +targetname : trigger entity (works with entity state system) +count : Map Variable to check (range checks) +target : Map variable == 0 fire these target(s) +message : Map variable == 0 message to display +target2 : Map variable == 1 fire these target(s) +message2: Map variable == 1 message to display +health : Can be damaged instead of touched +wait : time between re-triggering +delay : delay before firing (after being triggered) +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +-------- SPAWNFLAGS -------- +MONSTER : can be touched/triggered by monsters +STARTOFF : Requires trigger to activate +------- NOTES -------- +Touch trigger target(s) based on mapvar +======================================================================*/ +void() trigger_mapvar_multiple_fire = +{ + if (self.attack_finished > time) return; // Trigger once? + + // Find out map variable value + self.lefty = query_mapvar(self.count); + // Switch around target/message strings + if (self.lefty == FALSE) { + self.target = self.idle_sound; + self.message = self.idle_soundcom; + } + else { + self.target = self.idle_sound2; + self.message = self.idle_soundcom2; + } + + // Play the sound ON the trigger, NOT the activator + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Original trigger_multiple activator behaviour + activator = self.bmodel_act; + SUB_UseTargets(); + + // Is the trigger repeatable? + if (self.wait > 0) { + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + else { + // TRIGGER_ONCE functionality + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_mapvar_multiple = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Remove excessive spawnflags not used + self.lefty = 0; + if (self.spawnflags & MAPV_MONSTERS) self.lefty = self.lefty | MAPV_MONSTERS; + if (self.spawnflags & ENT_STARTOFF) self.lefty = self.lefty | ENT_STARTOFF; + self.spawnflags = self.lefty; + + // Remove any negative or fractions + self.count = fabs(rint(self.count)); + + // Check for upper variable range + if (self.count >= (MAPV_BLCK*MAPV_BITS)) + self.count = (MAPV_BLCK*MAPV_BITS) - 1; + + // Typical bmodel trigger setup + trigger_bmodel_sounds(); + self.classtype = CT_MAPVAR; + InitTrigger (); + if (!self.wait) self.wait = 0.2; + + // Save all entity for later + self.idle_sound = self.target; + self.idle_sound2 = self.target2; + self.idle_soundcom = self.message; + self.idle_soundcom2 = self.message2; + + // Reset all strings to prevent SUB_UseTargets errors + self.target = ""; self.target2 = ""; + self.message = ""; self.message2 = ""; + + // Setup Entity State functionality + self.estate_fire = trigger_mapvar_multiple_fire; + trigger_bmodel_setup(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/client_obituary.qc b/QC_other/QC_keep/client_obituary.qc new file mode 100644 index 00000000..e40618b7 --- /dev/null +++ b/QC_other/QC_keep/client_obituary.qc @@ -0,0 +1,359 @@ +//---------------------------------------------------------------------- +// Called when a player dies, deals with all death messages +//---------------------------------------------------------------------- +void(entity targ, entity attacker) ClientObituary = +{ + local float rnum; + local string clientstring, clientstring2; + rnum = random(); + + if (targ.flags & FL_CLIENT) { + if (attacker.classname == "teledeath") { + bprint (targ.netname); + bprint (" was telefragged by "); + bprint (attacker.owner.netname); + bprint ("\n"); + + attacker.owner.frags = attacker.owner.frags + 1; + return; + } + + if (attacker.classname == "teledeath2") { + bprint ("Satan's power deflects "); + bprint (targ.netname); + bprint ("'s telefrag\n"); + + targ.frags = targ.frags - 1; + return; + } + + if (attacker.flags & FL_CLIENT) { + if (targ == attacker) { + // killed self + attacker.frags = attacker.frags - 1; + bprint (targ.netname); + + if (targ.weapon == 64 && targ.waterlevel > 1) { + bprint (" discharges into the water.\n"); + return; + } + if (targ.weapon == IT_GRENADE_LAUNCHER) + bprint (" tries to put the pin back in\n"); + else + bprint (" becomes bored with life\n"); + return; + } + else if ( (teamplay == 2) && (targ.team > 0)&&(targ.team == attacker.team) ) { + if (rnum < 0.25) clientstring = " mows down a teammate\n"; + else if (rnum < 0.50) clientstring = " checks his glasses\n"; + else if (rnum < 0.75) clientstring = " gets a frag for the other team\n"; + else clientstring = " loses another friend\n"; + bprint (attacker.netname); + bprint (clientstring); + attacker.frags = attacker.frags - 1; + return; + } + else { + attacker.frags = attacker.frags + 1; + rnum = attacker.weapon; + if (rnum == IT_SHOTGUN) { + if ( (random () < 0.500) ) { + clientstring = " chewed on "; + clientstring2 = "'s boomstick\n"; + } else { + clientstring = " was gunned down by "; + clientstring2 = "\n"; + } + + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s puny shotgun\n"; + } + } + if (rnum == IT_SUPER_SHOTGUN) { + if ( (random () < 0.500) ) { + clientstring = " ate 2 loads of "; + clientstring2 = "'s buckshot\n"; + } else { + clientstring = " took both barrels from "; + clientstring2 = "\n"; + } + + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s Widowmaker!\n"; + } + } + if (rnum == IT_NAILGUN) { + clientstring = " was nailed by "; + clientstring2 = "\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s nails\n"; + } + } + if (rnum == IT_SUPER_NAILGUN) { + if ( (random () < 0.500) ) { + clientstring = " was punctured by "; + } else { + clientstring = " was perforated by "; + } + + clientstring2 = "\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s furious nails\n"; + } + } + if (rnum == IT_GRENADE_LAUNCHER) { + if ( (random () < 0.500) ) { + clientstring = " eats "; + clientstring2 = "'s pineapple\n"; + } else { + clientstring = " caught "; + clientstring2 = "'s grenade\n"; + } + + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s grenade\n"; + } + } + if (rnum == IT_ROCKET_LAUNCHER) { + if ( (random () < 0.500) ) { + if ( (random () < 0.500) ) { + clientstring = " rides "; + } else { + clientstring = " eats "; + } + clientstring2 = "'s rocket\n"; + } else { + if ( (random () < 0.500) ) { + clientstring = " was smeared by "; + } else { + clientstring = " was ripped a new one by "; + } + clientstring2 = "'s rocket\n"; + } + + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s rocket\n" ; + } + } + if (rnum == IT_LIGHTNING) { + if ( (random () < 0.500) ) { + clientstring = " accepts "; + if (attacker.waterlevel > 1) clientstring2 = "'s discharge\n"; //typically gibs, no gib specific message + else clientstring2 = "'s shaft\n"; + } else { + clientstring = " was shafted by "; + if (attacker.waterlevel > 1) clientstring = " was electrocuted by "; //typically gibs, no gib specific message + else clientstring2 = "\n"; + } + + } + if (rnum == IT_AXE) { + clientstring = " was ax-murdered by "; //TODO check for sword perm + clientstring2 = "\n"; + if (targ.health < -40) { + clientstring = " was chopped to pieces by "; + clientstring2 = "\n"; + } + + if (attacker.perms & IT_CHAINSAW) { + if ( (random () < 0.500) ) { + clientstring = " was chainsaw-massacred by "; + } else { + clientstring = " was chewed up by "; + } + clientstring2 = "'s bloody chainsaw\n"; + if (targ.health < -40) { + clientstring = " was turned to gibs by "; + clientstring2 = "'s bloody chainsaw\n"; + } + } + } + if (rnum == IT_LAVA_NAILGUN) { + clientstring = " was burned by "; + clientstring2 = "'s lava nails\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s fire and nails\n"; + } + } + if (rnum == IT_LAVA_SUPER_NAILGUN) { + clientstring = " was burned with fury by "; + clientstring2 = "'s lava nails\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s furious fire and nails\n"; + } + } + if (rnum == IT_MULTI_GRENADE) { + clientstring = " was blasted to bits by "; + clientstring2 = "'s multi-grenade\n"; + if (targ.health < -40) { + clientstring = " was turned into fireworks by "; + clientstring2 = "'s multi-grenade party\n"; + } + } + if (rnum == IT_MULTI_ROCKET) { + clientstring = " was obliterated by "; + clientstring2 = "'s multi-rockets\n"; + if (targ.health < -40) { + clientstring = " was completely obliterated by "; + clientstring2 = "'s multi-rockets\n"; + } + } + if (rnum == IT_PLASMA_GUN) { + if ( (random () < 0.500) ) { + clientstring = " was fused by "; + } else { + clientstring = " was electrified by "; + } + clientstring2 = "'s plasma\n"; + if (targ.health < -40) { + clientstring = " was melted by "; + clientstring2 = "'s plasma\n"; + } + } + if (rnum == IT_EXTRA_WEAPON) { + clientstring = " was skewered by "; + clientstring2 = "\n"; + if (targ.health < -40) { + clientstring = " was splintered to bits by "; + clientstring2 = "'s bolt\n"; + } + } + if (rnum == IT2_CHAINLIGHTNING) { + clientstring = " accepts "; + if (attacker.waterlevel > 1) clientstring2 = "'s chain discharges\n"; //typically gibs, no gib specific message + else clientstring2 = "'s chain shafts\n"; + } + if (rnum == IT2_PROXIMITY_GUN) { + if ( (random () < 0.500) ) { + clientstring = " got too friendly with "; + } else { + clientstring = " did the rhumba with "; + } + if ( (random () < 0.500) ) { + clientstring2 = "'s bomb\n"; + } else { + clientstring2 = "'s mine\n"; + } + clientstring2 = "'s mine\n"; + if (targ.health < -40) { + clientstring = " was surprise shattered by "; + clientstring2 = "'s mine\n"; + } + } + if (rnum == IT2_MJOLNIR) { + if ( (random () < 0.500) ) { + clientstring = " was hammered by "; + } else { + clientstring = " was slammed by "; + } + + clientstring2 = "'s Mjolnir\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s mighty Mjolnir!\n" ; + } + } + if (rnum == IT2_LASER_CANNON || ((rnum == IT_SHOTGUN) && (attacker.perms & IT_BLASTER))) { + if ( (random () < 0.500) ) { + clientstring = " was toasted by "; + } else { + if ( (random () < 0.500) ) { + clientstring = " saw the light from "; + } else { + clientstring = " was radiated by "; + } + } + clientstring2 = "'s laser\n"; + if (targ.health < -40) { + clientstring = " was gibbed by "; + clientstring2 = "'s laser\n"; + } + } + if (rnum == IT2_GRAPPLE) { + clientstring = " was grappled by "; + clientstring2 = "\n"; + if (targ.health < -40) { + clientstring = " was chewed to shreds by "; + clientstring2 = "'s grapple\n"; + } + } + bprint (targ.netname); + bprint (clientstring); + bprint (attacker.netname); + bprint (clientstring2); + } + return; + } + else { + targ.frags = targ.frags - 1; + bprint (targ.netname); + + //----------------------------------------------------------------- + // All the monster death messages are now defined in the monster QC + // It is much easier to remember to add these with creating the + // QC for each new monster than find/edit them here! + //----------------------------------------------------------------- + + // Check for boss or monster flags + if (attacker.bossflag > 0 || attacker.flags & FL_MONSTER) { + if (attacker.deathstring != "") bprint (attacker.deathstring); + else bprint(" was killed by Quake!\n"); + return; + } + + // tricks and traps + if (attacker.solid == SOLID_BSP && attacker != world) bprint (" was squished\n"); + else if (attacker.classtype == CT_EXPLO_BOX) bprint (" blew up\n"); + else if (attacker.classtype == CT_SPIKESHOOTER) bprint (" did not stick around\n"); + else if (attacker.classtype == CT_GRENADESHOOTER) bprint (" was pineappled\n"); + else if (attacker.classtype == CT_ROCKETSHOOTER) bprint (" was blasted\n"); + else if (attacker.classtype == CT_LIGHTSHOOTER) bprint (" was struck down\n"); + else if (attacker.classtype == CT_GASSHOOTER) bprint (" was burnt to a crisp\n"); + else if (attacker.classtype == CT_PENDULUM) bprint (" was cleaved in two\n"); + else if (attacker.classtype == CT_SAWBLADE) bprint (" was sliced to pieces\n"); + else if (attacker.classtype == CT_FIREBALL) bprint (" ate a lavaball\n"); + else if (attacker.classtype == CT_TRIGLEVEL) bprint (" tried to leave\n"); + + // in-water deaths + else if (targ.watertype == -3) { + if (random() < 0.5) bprint (" sleeps with the fishes\n"); + else bprint (" sucks it down\n"); + } + else if (targ.watertype == -4) { + if (random() < 0.5) bprint (" gulped a load of slime\n"); + else bprint (" can't exist on slime alone\n"); + } + else if (targ.watertype == -5) { + if (targ.health < -15) bprint (" burst into flames\n"); + else if (random() < 0.5) bprint (" turned into hot slag\n"); + else bprint (" visits the Volcano God\n"); + } + + // Debuff deaths + else if (targ.burning) bprint (" was burnt to a crisp\n"); + else if (targ.poisoned) bprint (" was poisoned\n"); + else if (targ.bleeding) bprint (" bled to death\n"); + + // fell to their death? + else if (targ.deathtype == "falling") { + targ.deathtype = string_null; + bprint (" fell to his death\n"); + } + else if (targ.touchedvoid) { + targ.deathtype = string_null; + bprint (" touched the void\n"); + } + else + // hell if I know; he's just dead!!! + bprint (" is dead Jim!\n"); + } + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/client_power.qc b/QC_other/QC_keep/client_power.qc new file mode 100644 index 00000000..12f0b65b --- /dev/null +++ b/QC_other/QC_keep/client_power.qc @@ -0,0 +1,376 @@ +/*====================================================================== + CheckPowerups + - Check for turning off powerups +======================================================================*/ +float (entity targ) Zapper_Level; + +void(entity targ) ResetPowerInvRing = +{ + targ.items = targ.items - (self.items & IT_INVISIBILITY); + targ.invisible_finished = targ.invisible_time = 0; + targ.modelindex = modelindex_player; + targ.frame = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerEnvSuit = +{ + targ.items = targ.items - (targ.items & IT_SUIT); + targ.radsuit_finished = targ.rad_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerThermSuit = +{ + //targ.items = targ.items - (targ.items & IT_SUIT); + targ.therm_finished = targ.therm_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerPent = +{ + targ.items = targ.items - (targ.items & IT_INVULNERABILITY); + targ.invincible_finished = targ.invincible_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerQuad = { + targ.super_damage_finished = targ.super_time = 0;}; +void(entity targ) ResetPowerQuadItem = { + targ.items = targ.items - (targ.items & IT_QUAD);}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerSharp = +{ + targ.moditems = targ.moditems - (targ.moditems & IT_ARTSHARP); + targ.sharpshoot_finished = targ.sharpshoot_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerPiercer = +{ + targ.moditems = targ.moditems - (targ.moditems & IT_ARTPIERCE); + targ.nailpiercer_finished = targ.nailpiercer_time = 0; +}; + +void(entity targ) ResetPowerLevitation = { + targ.wing_finished = 0; + targ.wing_time = 0; + targ.gravity = fabs(targ.gravity); +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerWetSuit = +{ + targ.moditems = targ.moditems - (targ.moditems & IT_ARTWETSUIT); + targ.wetsuit_finished = targ.wetsuit_time = 0; +}; + +//---------------------------------------------------------------------- +void(entity targ) ResetPowerSystem = +{ + ResetPowerInvRing(targ); + ResetPowerEnvSuit(targ); + ResetPowerPent(targ); + ResetPowerQuad(targ); + ResetPowerQuadItem(targ); + ResetPowerSharp(targ); + ResetPowerPiercer(targ); + ResetPowerWetSuit(targ); +}; + +//============================================================================ +void() ClientPowerups = +{ + if (intermission_running > 0) return; + if (self.health < 1) return; + + //---------------------------------------------------------------------- + // Invisibility (Gold Ring) + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.invisible_finished > 0) { + // sound and screen flash when items starts to run out + if (self.invisible_sound < time) { + sound (self, CHAN_AUTO, SOUND_ARTINV3, 0.5, ATTN_IDLE); + self.invisible_sound = time + ((random() * 3) + 1); + } + + if (self.invisible_finished < time + 3) { + if (self.invisible_time == 1) { + sprint (self, "Ring of Shadows magic is fading\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTINV2, 1, ATTN_NORM); + self.invisible_time = time + 1; + } + + if (self.invisible_time < time) { + self.invisible_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.invisible_finished < time) { + ResetPowerInvRing(self); + } else { + // keep using the eyes + self.modelindex = modelindex_eyes; + self.frame = 0; + } + } else { + if (mindex_hammer && self.weapon == IT2_MJOLNIR) { + //if (self.hammer_finished) + // self.modelindex = mindex_hamout; + //else + self.modelindex = mindex_hammer; + } + else if (mindex_saw && self.weapon == IT_AXE && self.perms & IT_CHAINSAW) + self.modelindex = mindex_saw; + else + self.modelindex = modelindex_player; + } + + //---------------------------------------------------------------------- + // Env Suit + // - Flash screen 3s before running out + // - Give player standard 12s of air after suit finishes + //---------------------------------------------------------------------- + if (self.radsuit_finished > 0) { + self.air_finished = time + 12; // don't drown + + + // sound and screen flash when items starts to run out + if (self.radsuit_finished < time + 3) { + if (self.rad_time == 1) { + sprint (self, "Air supply in Biosuit expiring\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTSUIT2, 1, ATTN_NORM); + self.rad_time = time + 1; + } + if (self.rad_time < time) { + self.rad_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.radsuit_finished < time) ResetPowerEnvSuit(self); + } + //---------------------------------------------------------------------- + // Thermal Protection Suit + // - Flash screen 3s before running out + // - Give player standard 12s of air after suit finishes + //---------------------------------------------------------------------- + if (self.therm_finished > 0) { + self.air_finished = time + 12; // don't drown + + // sound and screen flash when items starts to run out + if (self.therm_finished < time + 3) { + if (self.therm_time == 1) { + sprint (self, "Thermal protection suit is expiring\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTSUIT2, 1, ATTN_NORM); + self.therm_time = time + 1; + } + if (self.therm_time < time) { + self.therm_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.therm_finished < time) ResetPowerThermSuit(self); + } + + //---------------------------------------------------------------------- + // Wet Suit + // - Flash screen 3s before running out + // - Give player 12s of air after suit finishes + //---------------------------------------------------------------------- + if (self.wetsuit_finished > 0) { + self.air_finished = time + 12; // don't drown + + // Produce particle bubbles + if (self.waterlevel == 3) { + if (self.wetsuit_bubbles < time) { + self.wetsuit_bubbles = time + 0.5 + random(); + particle_debuff(self.origin, 16, rint(10+random()*40), PARTICLE_BURST_BLUE); + } + } + + // Check to see if the water level has changed + if (self.wetsuit_level != self.waterlevel) { + // Is the player coming out of the water? + if (self.wetsuit_level > 2 && self.waterlevel < 3) + self.wetsuit_sound = 0; + // Is the player going into the water? (above head) + else if (self.wetsuit_level < 3 && self.waterlevel > 2) + self.wetsuit_sound = 0; + self.wetsuit_level = self.waterlevel; + } + + // Play active sound based on water level + if (self.wetsuit_sound < time) { + if (self.waterlevel == 3) { + // Under water sound with bubbbles + self.volume = 0.5 + random() * 0.5; + sound (self, CHAN_ITEM, SOUND_ARTWETS3, self.volume, ATTN_IDLE); + self.wetsuit_sound = time + 4; + } + else { + // Different sound when not in the water (faster) + self.volume = 0.4 + random() * 0.4; + sound (self, CHAN_ITEM, SOUND_ARTWETS3B, self.volume, ATTN_IDLE); + self.wetsuit_sound = time + 3 + random(); + } + } + + // sound and screen flash when items starts to run out + if (self.wetsuit_finished < time + 3) { + self.wetsuit_sound = time + 4; // Stop breathing sound + if (self.wetsuit_time == 1) { + sprint (self, "Air supply in Wet suit expiring\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTWETS2, 1, ATTN_NORM); + self.wetsuit_time = time + 1; + } + if (self.wetsuit_time < time) { + self.wetsuit_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.wetsuit_finished < time) ResetPowerWetSuit(self); + } + + + + //---------------------------------------------------------------------- + // Invincibility (Pentagram) + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.invincible_finished > 0) { + // sound and screen flash when items starts to run out + if (self.invincible_finished < time + 3) { + if (self.invincible_time == 1) { + sprint (self, "Protection is almost burned out\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTPENT2, 1, ATTN_NORM); + self.invincible_time = time + 1; + } + if (self.invincible_time < time) { + self.invincible_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.invincible_finished < time) ResetPowerPent(self); + } + + //---------------------------------------------------------------------- + // Super Damage (Quad) + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.super_damage_finished > 0) { + // sound and screen flash when items starts to run out + if (self.super_damage_finished < time + 3) { + if (self.super_time == 1) { + sprint (self, "Quad Damage is wearing off\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTQUAD2, 1, ATTN_NORM); + self.super_time = time + 1; + } + if (self.super_time < time) { + self.super_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.super_damage_finished < time) ResetPowerQuad(self); + } + + //---------------------------------------------------------------------- + // SharpShooter + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.sharpshoot_finished > 0) { + // sound and screen flash when items starts to run out + if (self.sharpshoot_finished < time + 3) { + if (self.sharpshoot_time == 1) { + sprint (self, "Sharpshooter has almost gone\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTSHARP2, 1, ATTN_NORM); + self.sharpshoot_time = time + 1; + } + if (self.sharpshoot_time < time) { + self.sharpshoot_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.sharpshoot_finished < time) ResetPowerSharp(self); + } + + //---------------------------------------------------------------------- + // Nail Piercer + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.nailpiercer_finished > 0) { + // sound and screen flash when items starts to run out + if (self.nailpiercer_finished < time + 3) { + if (self.nailpiercer_time == 1) { + sprint (self, "Nail Piercer is wearing off\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, SOUND_ARTNAILP2, 1, ATTN_NORM); + self.nailpiercer_time = time + 1; + } + if (self.nailpiercer_time < time) { + self.nailpiercer_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.nailpiercer_finished < time) ResetPowerPiercer(self); + } + + //---------------------------------------------------------------------- + // Boots of Levitation + // - Flash screen 3s before running out + //---------------------------------------------------------------------- + if (self.wing_finished > 0) { + // sound and screen flash when items starts to run out + if (self.wing_finished < time + 3) { + if (self.wing_time == 1) { + sprint (self, "Boots of Levitation are fading\n"); + stuffcmd (self, "bf\n"); + sound (self, CHAN_AUTO, "ambience/wingend.wav", 1, ATTN_NORM); + self.wing_time = time + 1; + } + if (self.wing_time < time) { + self.wing_time = time + 1; + stuffcmd (self, "bf\n"); + } + } + // Update inventory and timers + if (self.wing_finished < time) ResetPowerLevitation(self); + } + + //------------------------------------------------------------------ + // Only remove the quad effect (status bar update) + // if all extra mod artifacts have expired as well + //------------------------------------------------------------------ + if (self.super_damage_finished == 0 && self.sharpshoot_finished == 0 + && self.nailpiercer_finished == 0) + ResetPowerQuadItem(self); + + //------------------------------------------------------------------ + // This check for setting the client effect needs to be separate + // because its setup by several different artifacts! + //------------------------------------------------------------------ + if (self.super_damage_finished > 0 || self.invincible_finished > 0 || + self.sharpshoot_finished > 0 || self.nailpiercer_finished > 0) { + self.effects = self.effects | EF_DIMLIGHT; + } + else self.effects = self.effects - (self.effects & EF_DIMLIGHT); + + if (self.items2 & IT2_CROSS && self.weapon == IT2_CROSS) self.currentammo = Zapper_Level(self); +}; + diff --git a/QC_other/QC_keep/csqc/csprogs.src b/QC_other/QC_keep/csqc/csprogs.src new file mode 100644 index 00000000..70d6e378 --- /dev/null +++ b/QC_other/QC_keep/csqc/csprogs.src @@ -0,0 +1,7 @@ +../../csprogs.dat +qsextensions.qc //builtins and lots of extensions + +csqc_hud_vanilla.qc //The actual hud code. self-contained, except for qc extensions. +csqc_scoreboard.qc //Code for the deathmatch scoreboard overlay. self-contained except for qc extensions + +csqc_legacycompat.qc //And because non-simple csqc isn't simple, this file needed for getting old versions of FTE, or DP to behave. comment out if you don't care about old engines. \ No newline at end of file diff --git a/QC_other/QC_keep/csqc/csqc_hud_hipnotic.qc b/QC_other/QC_keep/csqc/csqc_hud_hipnotic.qc new file mode 100644 index 00000000..35179479 --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_hud_hipnotic.qc @@ -0,0 +1,649 @@ +// This file implements NQ, QW, and N64-style huds in csqc. Its meant to be complete, while not otherwise being that different. +// The hud layout+items used are specific to the Hipnotic (Scourge of Armagon) mission pack, and is not compatible with Quake itself. +// Quoth also uses this item-set. +// +// The entry points are at the bottom of the file. +// You can just add this file (and fteextensions.qc or qsextensions.qc) into any mod and then just adapt it as desired. +// +// Note that it doesn't understand viewsizes all that well, but no worse than eg scr_sbaralpha<1 in QS (its default). (this keeps the api spec simpler.) +// the 'simple csqc' api means that this file (and api defs) is all you need for a hud, and can be directly embedded into a regular nq progs.dat, if needed. +// +// I have made attempts to avoid copying the engine code, however I will not be held liable if there's any GPL contagion. +// There is otherwise no license for the code in this file. + + +/*autocvars: + cl_sbar: alternative layouts (sorry for this complication, but mneh). + 0: QuakeWorld style hud + 1: Vanilla style hud + 2: n64-style hud + 3: n64-style with meshes instead of models, where supported. + cl_hudswap: QW/n64 ammo+weapons are on the + 0: right + 1: left + scr_sbaralpha: opacity of backgroundy elements +*/ + +// items. FIXME: you should share these with your ssqc... +float IT_SHOTGUN = 1<<0; +float IT_SUPER_SHOTGUN = 1<<1; +float IT_NAILGUN = 1<<2; +float IT_SUPER_NAILGUN = 1<<3; +float IT_GRENADE_LAUNCHER = 1<<4; +float IT_ROCKET_LAUNCHER = 1<<5; +float IT_LIGHTNING = 1<<6; + +float HIT_MJOLNIR = 1<<7; + +float IT_SHELLS = 1<<8; +float IT_NAILS = 1<<9; +float IT_ROCKETS = 1<<10; +float IT_CELLS = 1<<11; +float IT_AXE = 1<<12; + +float IT_ARMOR1 = 1<<13; +float IT_ARMOR2 = 1<<14; +float IT_ARMOR3 = 1<<15; +float HIT_PROXIMITY = 1<<16; + +float IT_KEY1 = 1<<17; +float IT_KEY2 = 1<<18; +float IT_INVISIBILITY = 1<<19; +float IT_INVULNERABILITY = 1<<20; +float IT_SUIT = 1<<21; +float IT_QUAD = 1<<22; + +float HIT2_LASER = 1<<0; +float HIT2_WETSUIT = 1<<1; +float HIT2_EMP_SHIELD = 1<<2; +//float HIT2_HORN = 1<<3; //not actually displayed on the hud + +//no sigils + + +//wad image names in array form, for easier access. +static string number[10] = { + "gfx/num_0", + "gfx/num_1", + "gfx/num_2", + "gfx/num_3", + "gfx/num_4", + "gfx/num_5", + "gfx/num_6", + "gfx/num_7", + "gfx/num_8", + "gfx/num_9" +}; +static string anumber[10] = { + "gfx/anum_0", + "gfx/anum_1", + "gfx/anum_2", + "gfx/anum_3", + "gfx/anum_4", + "gfx/anum_5", + "gfx/anum_6", + "gfx/anum_7", + "gfx/anum_8", + "gfx/anum_9" +}; +static string weaponnames[] = { + "shotgun", + "sshotgun", + "nailgun", + "snailgun", + "rlaunch", + "srlaunch", + "lightng", +#define WEAPONICONS 9 +#define LIGHTNING_WIDTH 32 + "laser", + "mjolnir", + "gren_prox",//foo + "prox_gren",//bar + "prox" //only have prox +}; +static string facetab[] = { + "gfx/face5", "gfx/face4", "gfx/face3", "gfx/face2", "gfx/face1", + "gfx/face_p5", "gfx/face_p4", "gfx/face_p3", "gfx/face_p2", "gfx/face_p1", + "gfx/face_inv2", "gfx/face_quad", "gfx/face_invis", "gfx/face_invul2" +}; + + + +//copies of stats, for easier access +static float sitems; //copy of .items +static float sitems2; //copy of .items2 (or serverflags) +static float sweapon; //copy of .weapon +static float shealth; //copy of .health + +//Note: these are not tracked for splitscreen, which limits them to one player. We're lazy and just don't update them. +static float flashtime[WEAPONICONS]; //tracks the time that various items were obtained, so we can flash stuff accordingly. +static float painfinishtime;//tracks when we took damage, for flinching. + + +//registers the various pics so they're ready as needed. +static void() Hud_Init +{ + float i; + precache_pic("gfx/sbar", TRUE); + precache_pic("gfx/ibar", TRUE); + for (i = 0; i < 10; i++) + { + precache_pic(number[i], TRUE); + precache_pic(anumber[i], TRUE); + } + + precache_pic("gfx/sb_armor1", TRUE); + precache_pic("gfx/sb_armor2", TRUE); + precache_pic("gfx/sb_armor3", TRUE); + precache_pic("gfx/disc", TRUE); + + precache_pic("gfx/sb_shells", TRUE); + precache_pic("gfx/sb_nails", TRUE); + precache_pic("gfx/sb_rocket", TRUE); + precache_pic("gfx/sb_cells", TRUE); + + precache_pic("gfx/sb_key1", TRUE); + precache_pic("gfx/sb_key2", TRUE); + precache_pic("gfx/sb_invis", TRUE); + precache_pic("gfx/sb_invuln", TRUE); + precache_pic("gfx/sb_suit", TRUE); + precache_pic("gfx/sb_quad", TRUE); + + precache_pic("gfx/sb_wsuit", TRUE); + precache_pic("gfx/sb_eshld", TRUE); + + for (i = 0; i < weaponnames.length; i++) + { + precache_pic(strcat("gfx/inv_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inv2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva1_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva3_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva4_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva5_", weaponnames[i]), TRUE); + } + for (i = 0; i < facetab.length; i++) + precache_pic(facetab[i], TRUE); +}; + + + + +static void(vector pos, float value, float threshhold) Hud_DrawLargeValue = +{ + float c; + float len; + string s; + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 24 * (3-len); + + + if (value <= threshhold) + { //use alternate (red) numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', anumber[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } + else + { //use normal numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', number[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } +}; + +static void(float type, vector pos, float drawback) Hud_DrawAmmoCount = +{ + string s; + float value; + float len; + float c; + value = getstatf(STAT_SHELLS+type); + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + if (drawback) + { + drawsubpic(pos, '42 11', "gfx/ibar", [(3.0/320)+type*(48.0/320), 0], [42.0/320, 11.0/24], '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + pos_x += 8; + } + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 8 * (3-len); + while(len>0) + { + len--; + c = str2chr(s, len); + drawcharacter(pos+len * '8 0 0', (18-'0') + c, '8 8 0', '1 1 1', 1, 0); + } +}; + +static void(float num, vector pos) Hud_DrawWeapon = +{ + string prefix; + float flash = (time - flashtime[num])*10; + if (flash >= 10) + { + if (sweapon == (1<<num)) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + + drawpic(pos, strcat(prefix, weaponnames[num]), '24 16 0', '1 1 1', 1, 0); +}; +static void(float num, float lflashtime, float iscurrent, vector pos, float drawwidth, float imgwidth) Hud_DrawWeaponEx = +{ + string prefix; + float flash = (time - lflashtime)*10; + if (flash >= 10) + { + if (iscurrent) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + drawsubpic(pos, [drawwidth, 16], strcat(prefix, weaponnames[num]), '0 0 0', [drawwidth/imgwidth, 1], '1 1 1', 1, 0); +}; + +static string(float f, float chars, string lead) FormatFloat +{ + string s = ftos(f); + if (f < 10 && chars >= 3) + s = strcat(lead, lead, s); + else if (f < 10 && chars == 2) + s = strcat(lead, s); + else if (f < 100 && chars >= 3) + s = strcat(lead, s); + return s; +}; + +static void(vector pos) Hud_CoopScores_SBar = +{ + string s; + float nsecs; + float nmins; + vector sbar = pos; + drawpic(sbar, "gfx/scorebar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + s = strcat("Monsters:", FormatFloat(getstatf(STAT_KILLEDMONSTERS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALMONSTERS), 3, " ")); + drawstring(sbar + '8 4', s, '8 8 0', '1 1 1', 1, 0); + s = strcat("Secrets :", FormatFloat(getstatf(STAT_FOUNDSECRETS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALSECRETS), 3, " ")); + drawstring(sbar + '8 12', s, '8 8 0', '1 1 1', 1, 0); + + nmins = floor(time/60); + nsecs = floor(time - nmins*60); + s = strcat("Time :", FormatFloat(nmins, 3, " "), ":", FormatFloat(nsecs, 2, "0")); + drawstring(sbar + '184 4', s, '8 8 0', '1 1 1', 1, 0); + + drawstring(sbar + '232 12' - strlen(world.message)*'4 0', world.message, '8 8 0', '1 1 1', 1, 0); +}; + +static void Hud_PicOrModel(vector topleft, string pic, string showmodel, float showskin, float speed) +{ + vector sz = '24 24'; +#ifdef DP_QC_RENDER_SCENE //requires fteextensions.qc instead of qsextensions.qc + if (autocvar(cl_sbar, 1) >= 3) + if (checkextension("DP_QC_RENDER_SCENE")) + { + //reset view props and wipe entity lists + clearscene(); + + //set up the various view details, set up the renderer to be a little larger than the intended size... it avoids harsh cuts. + setviewprop(VF_MIN, topleft - sz); + setviewprop(VF_SIZE, sz * 3); + setviewprop(VF_DRAWENGINESBAR, FALSE); + setviewprop(VF_DRAWCROSSHAIR, FALSE); + setviewprop(VF_DRAWWORLD, FALSE); + setviewprop(VF_AFOV, 30); //a small fov reduces perspective distortions without making it look like its isometric. + setviewprop(VF_ANGLES, '15 0 0'); //angle downwards slightly + makevectors('15 0 0'); + setviewprop(VF_ORIGIN, v_forward*-256); //and move the camera away so that we can position the model at the center without needing to worry about the tilt. + + //spawn a (reusable) entity for our scene + static entity hudpicent; + if (!hudpicent) + hudpicent = spawn(); + precache_model(showmodel); + setmodel(hudpicent, showmodel); + hudpicent.angles_y = cltime*speed; + hudpicent.skin = showskin; + makevectors(hudpicent.angles); + //make sure its centered + vector org = (hudpicent.maxs+hudpicent.mins)*0.5; + setorigin(hudpicent, - v_forward*org_x + v_right*org_y - v_up*org_z); + //and now copy it into the scene + addentity(hudpicent); + + //and ask the engine to actually draw that single-entity scene. Think of this as a drawpic call. + renderscene(); + + return; + } +#endif + drawpic(topleft, pic, '24 24 0', '1 1 1', 1, 0); +}; + +static void Hud_DrawFace(vector pos) +{ + string face; + if (sitems & IT_INVISIBILITY) + { //invis can go first, because its the most obvious image difference. + if (sitems & IT_INVULNERABILITY) + face = facetab[10]; //special double-powerup image! + else + face = facetab[12]; + } + else if (sitems & IT_QUAD) + face = facetab[11]; + else if (sitems & IT_INVULNERABILITY) + face = facetab[13]; + else + { + float frame = shealth/20; + if (frame < 0) + frame = 0; + else if (frame > 4) + frame = 4; + if (painfinishtime > time) + frame += 5; //pain. + face = facetab[frame]; + } + + if (shealth > 100) + Hud_PicOrModel(pos, face, "maps/b_bh100.bsp", 0, -90); + else if (shealth > 50) + Hud_PicOrModel(pos, face, "maps/b_bh25.bsp", 0, -90); + else + Hud_PicOrModel(pos, face, "maps/b_bh10.bsp", 0, -90); +}; + + +static void Hud_DrawSBar(vector pos, vector virtsize) +{ + if (autocvar(cl_sbar, 1) >= 2) + { //n64-style + pos = [0, virtsize_y-24]; + Hud_DrawFace(pos+[3*24,0]); + Hud_DrawLargeValue(pos, shealth, 25); + + if (sitems & (IT_INVULNERABILITY|IT_ARMOR1|IT_ARMOR2|IT_ARMOR3)) + { + pos_y -= 24; + if (sitems & IT_INVULNERABILITY) + Hud_DrawLargeValue(pos, 999, 25); + else + Hud_DrawLargeValue(pos, getstatf(STAT_ARMOR), 25); + pos+=[3*24,0]; + if (sitems & IT_INVULNERABILITY) + Hud_PicOrModel(pos, "gfx/disc", "progs/invulner.mdl", 0, 70); + else if (sitems & IT_ARMOR3) + Hud_PicOrModel(pos, "gfx/sb_armor3", "progs/armor.mdl", 2, 70); + else if (sitems & IT_ARMOR2) + Hud_PicOrModel(pos, "gfx/sb_armor2", "progs/armor.mdl", 1, 70); + else if (sitems & IT_ARMOR1) + Hud_PicOrModel(pos, "gfx/sb_armor1", "progs/armor.mdl", 0, 70); + } + + pos = virtsize - [24,24]; + if (sitems & IT_SHELLS) + Hud_PicOrModel(pos, "gfx/sb_shells", "maps/b_shell1.bsp", 0, 80); + else if (sitems & IT_NAILS) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_nail1.bsp", 0, 80); + else if (sitems & IT_ROCKETS) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_rock1.bsp", 0, 80); + else if (sitems & IT_CELLS) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_batt1.bsp", 0, 80); + Hud_DrawLargeValue(pos-[24*3], getstatf(STAT_AMMO), 10); + return; + } + + if (autocvar(cl_sbar, 1)) + drawpic(pos, "gfx/sbar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_INVULNERABILITY) + { + drawpic(pos, "gfx/disc", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'24 0 0', 999, 25); + } + else + { + Hud_DrawLargeValue(pos+'24 0 0', getstatf(STAT_ARMOR), 25); + if (sitems & IT_ARMOR3) + drawpic(pos, "gfx/sb_armor3", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR2) + drawpic(pos, "gfx/sb_armor2", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR1) + drawpic(pos, "gfx/sb_armor1", '24 24 0', '1 1 1', 1, 0); + } + + if (sitems & IT_KEY1) + drawpic(pos+'209 3 0', "gfx/sb_key1", '16 9 0', '1 1 1', 1, 0); + if (sitems & IT_KEY2) + drawpic(pos+'209 12 0', "gfx/sb_key2", '16 9 0', '1 1 1', 1, 0); + + Hud_DrawFace(pos+'112 0 0'); + Hud_DrawLargeValue(pos+'136 0 0', shealth, 25); + + if (sitems & IT_SHELLS) + drawpic(pos+'224 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_NAILS) + drawpic(pos+'224 0 0', "gfx/sb_nails", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ROCKETS) + drawpic(pos+'224 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_CELLS) + drawpic(pos+'224 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'248 0 0', getstatf(STAT_AMMO), 10); +}; + +static void Hud_DrawIBar(vector pos, vector br) +{ + if (!autocvar(cl_sbar, 1) || autocvar(cl_sbar, 1) >= 2) + { //qw puts its ammo+weapons on the side. mimic that. + vector pos2, pos3; + const float hheight = (WEAPONICONS*16)+(11*4); + pos2 = [0, br_y-48, 0]; + if (pos2_y < hheight) + pos2_y = hheight; + if (autocvar(cl_hudswap, 0)) + pos3 = pos2 + [0,-44]; //hudswap puts it on the left + else + { //otherwise align to the right edge + pos2_x += br_x-42; + pos3 = pos2 + [42-24,-44]; + } + if (autocvar(cl_sbar, 1) >= 2) + { + pos3_y = 0; //n64-style hud puts them at the top, apparently. + pos_x = br_x-320; //align any keys+powerups as though the hud was aligned to the right. + if (pos2_y < hheight) + pos2_y = hheight; + } + else pos3_y -= WEAPONICONS*16; + Hud_DrawAmmoCount(0, pos2 + '0 -44', TRUE); + Hud_DrawAmmoCount(1, pos2 + '0 -33', TRUE); + Hud_DrawAmmoCount(2, pos2 + '0 -22', TRUE); + Hud_DrawAmmoCount(3, pos2 + '0 -11', TRUE); + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos3+[0,16*0]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos3+[0,16*1]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos3+[0,16*2]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos3+[0,16*3]); + if ((sitems & (IT_GRENADE_LAUNCHER|HIT_PROXIMITY)) == IT_GRENADE_LAUNCHER|HIT_PROXIMITY) + { if (sweapon == HIT_PROXIMITY) Hud_DrawWeaponEx(10, flashtime[4], TRUE, pos3+[0,16*4], 24, 24); + else Hud_DrawWeaponEx(9, flashtime[4], sweapon==IT_GRENADE_LAUNCHER, pos3+[0,16*4], 24, 24); + } else if (sitems & HIT_PROXIMITY) Hud_DrawWeaponEx(11, flashtime[4], sweapon==HIT_PROXIMITY, pos3+[0,16*4], 24, 24); + else + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos3+[0,16*4]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos3+[0,16*5]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + if (sitems2 & HIT2_LASER) Hud_DrawWeaponEx(7, flashtime[7], sweapon==1<<23, pos3+[0,16*7], 24, 24); + if (sitems & HIT_MJOLNIR) Hud_DrawWeaponEx(8, flashtime[8], sweapon==HIT_MJOLNIR, pos3+[0,16*8], 24, 24); + } + else + { //standard nq sbar + drawpic(pos, "gfx/ibar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos+[24*0,8]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos+[24*1,8]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos+[24*2,8]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos+[24*3,8]); + if ((sitems & (IT_GRENADE_LAUNCHER|HIT_PROXIMITY)) == IT_GRENADE_LAUNCHER|HIT_PROXIMITY) + { if (sweapon == HIT_PROXIMITY) Hud_DrawWeaponEx(10, flashtime[4], TRUE, pos+[24*4,8], 24, 24); + else Hud_DrawWeaponEx(9, flashtime[4], sweapon==IT_GRENADE_LAUNCHER, pos+[24*4,8], 24, 24); + } else if (sitems & HIT_PROXIMITY) Hud_DrawWeaponEx(11, flashtime[4], sweapon==HIT_PROXIMITY, pos+[24*4,8], 24, 24); + else + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos+[24*4,8]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos+[24*5,8]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos+[24*6,8], LIGHTNING_WIDTH, LIGHTNING_WIDTH); + if (sitems2 & HIT2_LASER) Hud_DrawWeaponEx(7, flashtime[7], sweapon==1<<23, pos+'176 8 0', 24, 24); + if (sitems & HIT_MJOLNIR) Hud_DrawWeaponEx(8, flashtime[8], sweapon==HIT_MJOLNIR, pos+'200 8 0', 24, 24); + + Hud_DrawAmmoCount(0, pos + '10 0 0', FALSE); + Hud_DrawAmmoCount(1, pos + '58 0 0', FALSE); + Hud_DrawAmmoCount(2, pos + '106 0 0', FALSE); + Hud_DrawAmmoCount(3, pos + '154 0 0', FALSE); + } + + if (sitems & IT_INVISIBILITY) + drawpic(pos+'224 8 0', "gfx/sb_invis", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVULNERABILITY) + drawpic(pos+'240 8 0', "gfx/sb_invuln", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_SUIT) + drawpic(pos+'256 8 0', "gfx/sb_suit", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_QUAD) + drawpic(pos+'272 8 0', "gfx/sb_quad", '16 16 0', '1 1 1', 1, 0); + + if (sitems2 & HIT2_WETSUIT) + drawpic(pos+'288 8 0', "gfx/sb_wsuit", '16 16 0', '1 1 1', 1, 0); + if (sitems2 & HIT2_EMP_SHIELD) + drawpic(pos+'304 8 0', "gfx/sb_eshld", '16 16 0', '1 1 1', 1, 0); + + if (deathmatch) + { //should probably show team scores, but this mimics vanilla + pos_x += 194; + for (float i = -1; i >= -4; i--) + { + string frags = getplayerkeyvalue(i, "frags"); + if not (frags) + break; + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + drawfill(pos+[0,1], [28,3], top, 0.75, 0); + drawfill(pos+[0,4], [28,4], bot, 0.75, 0); + drawstring(pos+[2,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { + drawcharacter(pos+[-4,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[24,0], 0xe011, [8,8], [1,1,1],1, 0); + } + pos_x += 8*4; + } + } +}; + +float numclientseats; +static void Hud_Draw(vector virtsize, float scoreboard) +{ + vector pos; + float oitems = sitems; + float oitems2 = sitems2; + float ohealth = shealth; + + pos_x = (virtsize_x-320)/2; + pos_y = virtsize_y; + + sitems = getstatbits(STAT_ITEMS, 0, 23); //note that we could use getstati to read the items stat, but it'd degrade when then cast to a float, and QSS+DP don't support ints, so we have to use two floats. + sitems2 = getstatbits(STAT_ITEMS, 23, 9); + sweapon = getstatf(STAT_ACTIVEWEAPON); + shealth = getstatf(STAT_HEALTH); + //note that ssqc can provide custom stats, eg: clientstat(STAT_USER+n, EV_FLOAT, items3); can then be read by us with float items3 = getstatf(STAT_USER+n); + + if (shealth <= 0) + scoreboard = TRUE; + + if (numclientseats <= 1) + { //note that we only track one player's stats. with splitscreen we need to stop looking for changes otherwise we'd see them all the time. + if (ohealth && sitems != oitems) + { + for (float f = 0; f < 7; f++) + { + if ((sitems & (1<<f)) && !(oitems & (1<<f))) + flashtime[f] = time; + } + if ((sitems & HIT_PROXIMITY) && !(oitems & HIT_PROXIMITY)) + flashtime[4] = time; + if ((sitems2 & HIT2_LASER) && !(oitems2 & HIT2_LASER)) + flashtime[7] = time; + if ((sitems & HIT_MJOLNIR) && !(oitems & HIT_MJOLNIR)) + flashtime[8] = time; + } + } + + if (autocvar(viewsize, 100) < 120) + { + if (scoreboard) + Hud_CoopScores_SBar(pos - '0 24 0'); + else + Hud_DrawSBar(pos - '0 24 0', virtsize); + + if (autocvar(viewsize, 100) < 110) + Hud_DrawIBar(pos - '0 48 0', virtsize); + } +}; + +//lame entry point, just so that we know when damage was taken +float(float save, float take, vector dir) CSQC_Parse_Damage = +{ + if (numclientseats <= 1) + painfinishtime = time + 0.2; + return FALSE; //let the engine handle any red tints etc +}; + +//Hud entry point! +//showscores is set if +scores is held (check health yourself). +void(vector virtsize, float showscores) CSQC_DrawHud = +{ + Hud_Draw(virtsize, showscores); +}; + +void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + Hud_Init(); +}; + diff --git a/QC_other/QC_keep/csqc/csqc_hud_hipnotic.qc.orig b/QC_other/QC_keep/csqc/csqc_hud_hipnotic.qc.orig new file mode 100644 index 00000000..15103530 --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_hud_hipnotic.qc.orig @@ -0,0 +1,649 @@ +// This file implements NQ, QW, and N64-style huds in csqc. Its meant to be complete, while not otherwise being that different. +// The hud layout+items used are specific to the Hipnotic (Scourge of Armagon) mission pack, and is not compatible with Quake itself. +// Quoth also uses this item-set. +// +// The entry points are at the bottom of the file. +// You can just add this file (and fteextensions.qc or qsextensions.qc) into any mod and then just adapt it as desired. +// +// Note that it doesn't understand viewsizes all that well, but no worse than eg scr_sbaralpha<1 in QS (its default). (this keeps the api spec simpler.) +// the 'simple csqc' api means that this file (and api defs) is all you need for a hud, and can be directly embedded into a regular nq progs.dat, if needed. +// +// I have made attempts to avoid copying the engine code, however I will not be held liable if there's any GPL contagion. +// There is otherwise no license for the code in this file. + + +/*autocvars: + cl_sbar: alternative layouts (sorry for this complication, but mneh). + 0: QuakeWorld style hud + 1: Vanilla style hud + 2: n64-style hud + 3: n64-style with meshes instead of models, where supported. + cl_hudswap: QW/n64 ammo+weapons are on the + 0: right + 1: left + scr_sbaralpha: opacity of backgroundy elements +*/ + +// items. FIXME: you should share these with your ssqc... +float IT_SHOTGUN = 1<<0; +float IT_SUPER_SHOTGUN = 1<<1; +float IT_NAILGUN = 1<<2; +float IT_SUPER_NAILGUN = 1<<3; +float IT_GRENADE_LAUNCHER = 1<<4; +float IT_ROCKET_LAUNCHER = 1<<5; +float IT_LIGHTNING = 1<<6; + +float HIT_MJOLNIR = 1<<7; + +float IT_SHELLS = 1<<8; +float IT_NAILS = 1<<9; +float IT_ROCKETS = 1<<10; +float IT_CELLS = 1<<11; +float IT_AXE = 1<<12; + +float IT_ARMOR1 = 1<<13; +float IT_ARMOR2 = 1<<14; +float IT_ARMOR3 = 1<<15; +float HIT_PROXIMITY = 1<<16; + +float IT_KEY1 = 1<<17; +float IT_KEY2 = 1<<18; +float IT_INVISIBILITY = 1<<19; +float IT_INVULNERABILITY = 1<<20; +float IT_SUIT = 1<<21; +float IT_QUAD = 1<<22; + +float HIT2_LASER = 1<<0; +float HIT2_WETSUIT = 1<<1; +float HIT2_EMP_SHIELD = 1<<2; +//float HIT2_HORN = 1<<3; //not actually displayed on the hud + +//no sigils + + +//wad image names in array form, for easier access. +static string number[10] = { + "gfx/num_0", + "gfx/num_1", + "gfx/num_2", + "gfx/num_3", + "gfx/num_4", + "gfx/num_5", + "gfx/num_6", + "gfx/num_7", + "gfx/num_8", + "gfx/num_9" +}; +static string anumber[10] = { + "gfx/anum_0", + "gfx/anum_1", + "gfx/anum_2", + "gfx/anum_3", + "gfx/anum_4", + "gfx/anum_5", + "gfx/anum_6", + "gfx/anum_7", + "gfx/anum_8", + "gfx/anum_9" +}; +static string weaponnames[] = { + "shotgun", + "sshotgun", + "nailgun", + "snailgun", + "rlaunch", + "srlaunch", + "lightng", +#define WEAPONICONS 9 +#define LIGHTNING_WIDTH 32 + "laser", + "mjolnir", + "gren_prox",//foo + "prox_gren",//bar + "prox" //only have prox +}; +static string facetab[] = { + "gfx/face5", "gfx/face4", "gfx/face3", "gfx/face2", "gfx/face1", + "gfx/face_p5", "gfx/face_p4", "gfx/face_p3", "gfx/face_p2", "gfx/face_p1", + "gfx/face_inv2", "gfx/face_quad", "gfx/face_invis", "gfx/face_invul2" +}; + + + +//copies of stats, for easier access +static float sitems; //copy of .items +static float sitems2; //copy of .items2 (or serverflags) +static float sweapon; //copy of .weapon +static float shealth; //copy of .health + +//Note: these are not tracked for splitscreen, which limits them to one player. We're lazy and just don't update them. +static float flashtime[WEAPONICONS]; //tracks the time that various items were obtained, so we can flash stuff accordingly. +static float painfinishtime;//tracks when we took damage, for flinching. + + +//registers the various pics so they're ready as needed. +static void() Hud_Init +{ + float i; + precache_pic("gfx/sbar", TRUE); + precache_pic("gfx/ibar", TRUE); + for (i = 0; i < 10; i++) + { + precache_pic(number[i], TRUE); + precache_pic(anumber[i], TRUE); + } + + precache_pic("gfx/sb_armor1", TRUE); + precache_pic("gfx/sb_armor2", TRUE); + precache_pic("gfx/sb_armor3", TRUE); + precache_pic("gfx/disc", TRUE); + + precache_pic("gfx/sb_shells", TRUE); + precache_pic("gfx/sb_nails", TRUE); + precache_pic("gfx/sb_rocket", TRUE); + precache_pic("gfx/sb_cells", TRUE); + + precache_pic("gfx/sb_key1", TRUE); + precache_pic("gfx/sb_key2", TRUE); + precache_pic("gfx/sb_invis", TRUE); + precache_pic("gfx/sb_invuln", TRUE); + precache_pic("gfx/sb_suit", TRUE); + precache_pic("gfx/sb_quad", TRUE); + + precache_pic("gfx/sb_wsuit", TRUE); + precache_pic("gfx/sb_eshld", TRUE); + + for (i = 0; i < weaponnames.length; i++) + { + precache_pic(strcat("gfx/inv_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inv2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva1_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva3_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva4_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva5_", weaponnames[i]), TRUE); + } + for (i = 0; i < facetab.length; i++) + precache_pic(facetab[i], TRUE); +}; + + + + +static void(vector pos, float value, float threshhold) Hud_DrawLargeValue = +{ + float c; + float len; + string s; + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 24 * (3-len); + + + if (value <= threshhold) + { //use alternate (red) numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', anumber[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } + else + { //use normal numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', number[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } +}; + +static void(float type, vector pos, float drawback) Hud_DrawAmmoCount = +{ + string s; + float value; + float len; + float c; + value = getstatf(STAT_SHELLS+type); + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + if (drawback) + { + drawsubpic(pos, '42 11', "gfx/ibar", [(3.0/320)+type*(48.0/320), 0], [42.0/320, 11.0/24], '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + pos_x += 8; + } + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 8 * (3-len); + while(len>0) + { + len--; + c = str2chr(s, len); + drawcharacter(pos+len * '8 0 0', (18-'0') + c, '8 8 0', '1 1 1', 1, 0); + } +}; + +static void(float num, vector pos) Hud_DrawWeapon = +{ + string prefix; + float flash = (time - flashtime[num])*10; + if (flash >= 10) + { + if (sweapon == (1<<num)) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + + drawpic(pos, strcat(prefix, weaponnames[num]), '24 16 0', '1 1 1', 1, 0); +}; +static void(float num, float lflashtime, float iscurrent, vector pos, float drawwidth, float imgwidth) Hud_DrawWeaponEx = +{ + string prefix; + float flash = (time - lflashtime)*10; + if (flash >= 10) + { + if (iscurrent) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + drawsubpic(pos, [drawwidth, 16], strcat(prefix, weaponnames[num]), '0 0 0', [drawwidth/imgwidth, 1], '1 1 1', 1, 0); +}; + +static string(float f, float chars, string lead) FormatFloat +{ + string s = ftos(f); + if (f < 10 && chars >= 3) + s = strcat(lead, lead, s); + else if (f < 10 && chars == 2) + s = strcat(lead, s); + else if (f < 100 && chars >= 3) + s = strcat(lead, s); + return s; +}; + +static void(vector pos) Hud_CoopScores_SBar = +{ + string s; + float nsecs; + float nmins; + vector sbar = pos; + drawpic(sbar, "gfx/scorebar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + s = strcat("Monsters:", FormatFloat(getstatf(STAT_KILLEDMONSTERS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALMONSTERS), 3, " ")); + drawstring(sbar + '8 4', s, '8 8 0', '1 1 1', 1, 0); + s = strcat("Secrets :", FormatFloat(getstatf(STAT_FOUNDSECRETS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALSECRETS), 3, " ")); + drawstring(sbar + '8 12', s, '8 8 0', '1 1 1', 1, 0); + + nmins = floor(time/60); + nsecs = floor(time - nmins*60); + s = strcat("Time :", FormatFloat(nmins, 3, " "), ":", FormatFloat(nsecs, 2, "0")); + drawstring(sbar + '184 4', s, '8 8 0', '1 1 1', 1, 0); + + drawstring(sbar + '232 12' - strlen(world.message)*'4 0', world.message, '8 8 0', '1 1 1', 1, 0); +}; + +static void Hud_PicOrModel(vector topleft, string pic, string showmodel, float showskin, float speed) +{ + vector sz = '24 24'; +#ifdef DP_QC_RENDER_SCENE //requires fteextensions.qc instead of qsextensions.qc + if (autocvar(cl_sbar, 1) >= 3) + if (checkextension("DP_QC_RENDER_SCENE")) + { + //reset view props and wipe entity lists + clearscene(); + + //set up the various view details, set up the renderer to be a little larger than the intended size... it avoids harsh cuts. + setviewprop(VF_MIN, topleft - sz); + setviewprop(VF_SIZE, sz * 3); + setviewprop(VF_DRAWENGINESBAR, FALSE); + setviewprop(VF_DRAWCROSSHAIR, FALSE); + setviewprop(VF_DRAWWORLD, FALSE); + setviewprop(VF_AFOV, 30); //a small fov reduces perspective distortions without making it look like its isometric. + setviewprop(VF_ANGLES, '15 0 0'); //angle downwards slightly + makevectors('15 0 0'); + setviewprop(VF_ORIGIN, v_forward*-256); //and move the camera away so that we can position the model at the center without needing to worry about the tilt. + + //spawn a (reusable) entity for our scene + static entity hudpicent; + if (!hudpicent) + hudpicent = spawn(); + precache_model(showmodel); + setmodel(hudpicent, showmodel); + hudpicent.angles_y = cltime*speed; + hudpicent.skin = showskin; + makevectors(hudpicent.angles); + //make sure its centered + vector org = (hudpicent.maxs+hudpicent.mins)*0.5; + setorigin(hudpicent, - v_forward*org_x + v_right*org_y - v_up*org_z); + //and now copy it into the scene + addentity(hudpicent); + + //and ask the engine to actually draw that single-entity scene. Think of this as a drawpic call. + renderscene(); + + return; + } +#endif + drawpic(topleft, pic, '24 24 0', '1 1 1', 1, 0); +}; + +static void Hud_DrawFace(vector pos) +{ + string face; + if (sitems & IT_INVISIBILITY) + { //invis can go first, because its the most obvious image difference. + if (sitems & IT_INVULNERABILITY) + face = facetab[10]; //special double-powerup image! + else + face = facetab[12]; + } + else if (sitems & IT_QUAD) + face = facetab[11]; + else if (sitems & IT_INVULNERABILITY) + face = facetab[13]; + else + { + float frame = shealth/20; + if (frame < 0) + frame = 0; + else if (frame > 4) + frame = 4; + if (painfinishtime > time) + frame += 5; //pain. + face = facetab[frame]; + } + + if (shealth > 100) + Hud_PicOrModel(pos, face, "maps/b_bh100.bsp", 0, -90); + else if (shealth > 50) + Hud_PicOrModel(pos, face, "maps/b_bh25.bsp", 0, -90); + else + Hud_PicOrModel(pos, face, "maps/b_bh10.bsp", 0, -90); +}; + + +static void Hud_DrawSBar(vector pos, vector virtsize) +{ + if (autocvar(cl_sbar, 1) >= 2) + { //n64-style + pos = [0, virtsize_y-24]; + Hud_DrawFace(pos+[3*24,0]); + Hud_DrawLargeValue(pos, shealth, 25); + + if (sitems & (IT_INVULNERABILITY|IT_ARMOR1|IT_ARMOR2|IT_ARMOR3)) + { + pos_y -= 24; + if (sitems & IT_INVULNERABILITY) + Hud_DrawLargeValue(pos, 999, 25); + else + Hud_DrawLargeValue(pos, getstatf(STAT_ARMOR), 25); + pos+=[3*24,0]; + if (sitems & IT_INVULNERABILITY) + Hud_PicOrModel(pos, "gfx/disc", "progs/invulner.mdl", 0, 70); + else if (sitems & IT_ARMOR3) + Hud_PicOrModel(pos, "gfx/sb_armor3", "progs/armor.mdl", 2, 70); + else if (sitems & IT_ARMOR2) + Hud_PicOrModel(pos, "gfx/sb_armor2", "progs/armor.mdl", 1, 70); + else if (sitems & IT_ARMOR1) + Hud_PicOrModel(pos, "gfx/sb_armor1", "progs/armor.mdl", 0, 70); + } + + pos = virtsize - [24,24]; + if (sitems & IT_SHELLS) + Hud_PicOrModel(pos, "gfx/sb_shells", "maps/b_shell1.bsp", 0, 80); + else if (sitems & IT_NAILS) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_nail1.bsp", 0, 80); + else if (sitems & IT_ROCKETS) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_rock1.bsp", 0, 80); + else if (sitems & IT_CELLS) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_batt1.bsp", 0, 80); + Hud_DrawLargeValue(pos-[24*3], getstatf(STAT_AMMO), 10); + return; + } + + if (autocvar(cl_sbar, 1)) + drawpic(pos, "gfx/sbar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_INVULNERABILITY) + { + drawpic(pos, "gfx/disc", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'24 0 0', 999, 25); + } + else + { + Hud_DrawLargeValue(pos+'24 0 0', getstatf(STAT_ARMOR), 25); + if (sitems & IT_ARMOR3) + drawpic(pos, "gfx/sb_armor3", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR2) + drawpic(pos, "gfx/sb_armor2", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR1) + drawpic(pos, "gfx/sb_armor1", '24 24 0', '1 1 1', 1, 0); + } + + if (sitems & IT_KEY1) + drawpic(pos+'209 3 0', "gfx/sb_key1", '16 9 0', '1 1 1', 1, 0); + if (sitems & IT_KEY2) + drawpic(pos+'209 12 0', "gfx/sb_key2", '16 9 0', '1 1 1', 1, 0); + + Hud_DrawFace(pos+'112 0 0'); + Hud_DrawLargeValue(pos+'136 0 0', shealth, 25); + + if (sitems & IT_SHELLS) + drawpic(pos+'224 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_NAILS) + drawpic(pos+'224 0 0', "gfx/sb_nails", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ROCKETS) + drawpic(pos+'224 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_CELLS) + drawpic(pos+'224 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'248 0 0', getstatf(STAT_AMMO), 10); +}; + +static void Hud_DrawIBar(vector pos, vector br) +{ + if (!autocvar(cl_sbar, 1) || autocvar(cl_sbar, 1) >= 2) + { //qw puts its ammo+weapons on the side. mimic that. + vector pos2, pos3; + const float hheight = (WEAPONICONS*16)+(11*4); + pos2 = [0, br_y-48, 0]; + if (pos2_y < hheight) + pos2_y = hheight; + if (autocvar(cl_hudswap, 0)) + pos3 = pos2 + [0,-44]; //hudswap puts it on the left + else + { //otherwise align to the right edge + pos2_x += br_x-42; + pos3 = pos2 + [42-24,-44]; + } + if (autocvar(cl_sbar, 1) >= 2) + { + pos3_y = 0; //n64-style hud puts them at the top, apparently. + pos_x = br_x-320; //align any keys+powerups as though the hud was aligned to the right. + if (pos2_y < hheight) + pos2_y = hheight; + } + else pos3_y -= WEAPONICONS*16; + Hud_DrawAmmoCount(0, pos2 + '0 -44', TRUE); + Hud_DrawAmmoCount(1, pos2 + '0 -33', TRUE); + Hud_DrawAmmoCount(2, pos2 + '0 -22', TRUE); + Hud_DrawAmmoCount(3, pos2 + '0 -11', TRUE); + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos3+[0,16*0]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos3+[0,16*1]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos3+[0,16*2]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos3+[0,16*3]); + if ((sitems & (IT_GRENADE_LAUNCHER|HIT_PROXIMITY)) == IT_GRENADE_LAUNCHER|HIT_PROXIMITY) + { if (sweapon == HIT_PROXIMITY) Hud_DrawWeaponEx(10, flashtime[4], TRUE, pos3+[0,16*4], 24, 24); + else Hud_DrawWeaponEx(9, flashtime[4], sweapon==IT_GRENADE_LAUNCHER, pos3+[0,16*4], 24, 24); + } else if (sitems & HIT_PROXIMITY) Hud_DrawWeaponEx(11, flashtime[4], sweapon==HIT_PROXIMITY, pos3+[0,16*4], 24, 24); + else + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos3+[0,16*4]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos3+[0,16*5]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + if (sitems2 & HIT2_LASER) Hud_DrawWeaponEx(7, flashtime[7], sweapon==1<<23, pos3+[0,16*7], 24, 24); + if (sitems & HIT_MJOLNIR) Hud_DrawWeaponEx(8, flashtime[8], sweapon==HIT_MJOLNIR, pos3+[0,16*8], 24, 24); + } + else + { //standard nq sbar + drawpic(pos, "gfx/ibar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos+[24*0,8]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos+[24*1,8]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos+[24*2,8]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos+[24*3,8]); + if ((sitems & (IT_GRENADE_LAUNCHER|HIT_PROXIMITY)) == IT_GRENADE_LAUNCHER|HIT_PROXIMITY) + { if (sweapon == HIT_PROXIMITY) Hud_DrawWeaponEx(10, flashtime[4], TRUE, pos+[24*4,8], 24, 24); + else Hud_DrawWeaponEx(9, flashtime[4], sweapon==IT_GRENADE_LAUNCHER, pos+[24*4,8], 24, 24); + } else if (sitems & HIT_PROXIMITY) Hud_DrawWeaponEx(11, flashtime[4], sweapon==HIT_PROXIMITY, pos+[24*4,8], 24, 24); + else + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos+[24*4,8]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos+[24*5,8]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos+[24*6,8], LIGHTNING_WIDTH, LIGHTNING_WIDTH); + if (sitems2 & HIT2_LASER) Hud_DrawWeaponEx(7, flashtime[7], sweapon==1<<23, pos+'176 8 0', 24, 24); + if (sitems & HIT_MJOLNIR) Hud_DrawWeaponEx(8, flashtime[8], sweapon==HIT_MJOLNIR, pos+'200 8 0', 24, 24); + + Hud_DrawAmmoCount(0, pos + '10 0 0', FALSE); + Hud_DrawAmmoCount(1, pos + '58 0 0', FALSE); + Hud_DrawAmmoCount(2, pos + '106 0 0', FALSE); + Hud_DrawAmmoCount(3, pos + '154 0 0', FALSE); + } + + if (sitems & IT_INVISIBILITY) + drawpic(pos+'224 8 0', "gfx/sb_invis", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVULNERABILITY) + drawpic(pos+'240 8 0', "gfx/sb_invuln", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_SUIT) + drawpic(pos+'256 8 0', "gfx/sb_suit", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_QUAD) + drawpic(pos+'272 8 0', "gfx/sb_quad", '16 16 0', '1 1 1', 1, 0); + + if (sitems2 & HIT2_WETSUIT) + drawpic(pos+'288 8 0', "gfx/sb_wsuit", '16 16 0', '1 1 1', 1, 0); + if (sitems2 & HIT2_EMP_SHIELD) + drawpic(pos+'304 8 0', "gfx/sb_eshld", '16 16 0', '1 1 1', 1, 0); + + if (deathmatch) + { //should probably show team scores, but this mimics vanilla + pos_x += 194; + for (float i = -1; i >= -4; i--) + { + string frags = getplayerkeyvalue(i, "frags"); + if not (frags) + break; + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + drawfill(pos+[0,1], [28,3], top, 0.75, 0); + drawfill(pos+[0,4], [28,4], bot, 0.75, 0); + drawstring(pos+[2,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { + drawcharacter(pos+[-4,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[24,0], 0xe011, [8,8], [1,1,1],1, 0); + } + pos_x += 8*4; + } + } +}; + +float numclientseats; +static void Hud_Draw(vector virtsize, float scoreboard) +{ + vector pos; + float oitems = sitems; + float oitems2 = sitems2; + float ohealth = shealth; + + pos_x = (virtsize_x-320)/2; + pos_y = virtsize_y; + + sitems = getstatbits(STAT_ITEMS, 0, 23); //note that we could use getstati to read the items stat, but it'd degrade when then cast to a float, and QSS+DP don't support ints, so we have to use two floats. + sitems2 = getstatbits(STAT_ITEMS, 23, 9); + sweapon = getstatf(STAT_ACTIVEWEAPON); + shealth = getstatf(STAT_HEALTH); + //note that ssqc can provide custom stats, eg: clientstat(STAT_USER+n, EV_FLOAT, items3); can then be read by us with float items3 = getstatf(STAT_USER+n); + + if (shealth <= 0) + scoreboard = TRUE; + + if (numclientseats <= 1) + { //note that we only track one player's stats. with splitscreen we need to stop looking for changes otherwise we'd see them all the time. + if (ohealth && sitems != oitems) + { + for (float f = 0; f < 7; f++) + { + if ((sitems & (1<<f)) && !(oitems & (1<<f))) + flashtime[f] = time; + } + if ((sitems & HIT_PROXIMITY) && !(oitems & HIT_PROXIMITY)) + flashtime[4] = time; + if ((sitems2 & HIT2_LASER) && !(oitems2 & HIT2_LASER)) + flashtime[7] = time; + if ((sitems & HIT_MJOLNIR) && !(oitems & HIT_MJOLNIR)) + flashtime[8] = time; + } + } + + if (autocvar(viewsize, 100) < 120) + { + if (scoreboard) + Hud_CoopScores_SBar(pos - '0 24 0'); + else + Hud_DrawSBar(pos - '0 24 0', virtsize); + + if (autocvar(viewsize, 100) < 110) + Hud_DrawIBar(pos - '0 48 0', virtsize); + } +}; + +//lame entry point, just so that we know when damage was taken +float(float save, float take, vector dir) CSQC_Parse_Damage = +{ + if (numclientseats <= 1) + painfinishtime = time + 0.2; + return FALSE; //let the engine handle any red tints etc +}; + +//Hud entry point! +//showscores is set if +scores is held (check health yourself). +void(vector virtsize, float showscores) CSQC_DrawHud = +{ + Hud_Draw(virtsize, showscores); +}; + +void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + Hud_Init(); +}; + diff --git a/QC_other/QC_keep/csqc/csqc_hud_rogue.qc b/QC_other/QC_keep/csqc/csqc_hud_rogue.qc new file mode 100644 index 00000000..5300d02f --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_hud_rogue.qc @@ -0,0 +1,665 @@ +// This file implements NQ, QW, and N64-style huds in csqc. Its meant to be complete, while not otherwise being that different. +// The hud layout+items used are specific to the Rogue (Dissolution of Eternity) mission pack, and is not compatible with Quake itself. +// +// The entry points are at the bottom of the file. +// You can just add this file (and fteextensions.qc or qsextensions.qc) into any mod and then just adapt it as desired. +// +// Note that it doesn't understand viewsizes all that well, but no worse than eg scr_sbaralpha<1 in QS (its default). (this keeps the api spec simpler.) +// the 'simple csqc' api means that this file (and api defs) is all you need for a hud, and can be directly embedded into a regular nq progs.dat, if needed. +// +// I have made attempts to avoid copying the engine code, however I will not be held liable if there's any GPL contagion. +// There is otherwise no license for the code in this file. + + +/*autocvars: + cl_sbar: alternative layouts (sorry for this complication, but mneh). + 0: QuakeWorld style hud + 1: Vanilla style hud + 2: n64-style hud + 3: n64-style with meshes instead of models, where supported. + cl_hudswap: QW/n64 ammo+weapons are on the + 0: right + 1: left + scr_sbaralpha: opacity of backgroundy elements +*/ + +// items. FIXME: you should share these with your ssqc... +float IT_SHOTGUN = 1<<0; +float IT_SUPER_SHOTGUN = 1<<1; +float IT_NAILGUN = 1<<2; +float IT_SUPER_NAILGUN = 1<<3; +float IT_GRENADE_LAUNCHER = 1<<4; +float IT_ROCKET_LAUNCHER = 1<<5; +float IT_LIGHTNING = 1<<6; + +float IT_SHELLS = 1<<7; +float IT_NAILS = 1<<8; +float IT_ROCKETS = 1<<9; +float IT_CELLS = 1<<10; + +float IT_AXE = 1<<11; +float RIT_NAILGUN2 = 1<<12; +float RIT_SUPER_NAILGUN2 = 1<<13; +float RIT_GRENADE_LAUNCHER2 = 1<<14; +float RIT_ROCKET_LAUNCHER2 = 1<<15; +float RIT_LIGHTNING2 = 1<<16; + +float IT_KEY1 = 1<<17; +float IT_KEY2 = 1<<18; +float IT_INVISIBILITY = 1<<19; +float IT_INVULNERABILITY = 1<<20; +float IT_SUIT = 1<<21; +float IT_QUAD = 1<<22; + +//these are all wrong. +float RIT2_ARMOR1 = 1<<0; +float RIT2_ARMOR2 = 1<<1; +float RIT2_ARMOR3 = 1<<2; +float RIT2_NAILS2 = 1<<3; +float RIT2_ROCKETS2 = 1<<4; +float RIT2_CELLS2 = 1<<5; +float RIT2_SHIELD = 1<<6; +float RIT2_ANTIGRAV = 1<<7; +//float RIT2_SUPERHEALTH = 1<<8; +//no sigils + + +//wad image names in array form, for easier access. +static string number[10] = { + "gfx/num_0", + "gfx/num_1", + "gfx/num_2", + "gfx/num_3", + "gfx/num_4", + "gfx/num_5", + "gfx/num_6", + "gfx/num_7", + "gfx/num_8", + "gfx/num_9" +}; +static string anumber[10] = { + "gfx/anum_0", + "gfx/anum_1", + "gfx/anum_2", + "gfx/anum_3", + "gfx/anum_4", + "gfx/anum_5", + "gfx/anum_6", + "gfx/anum_7", + "gfx/anum_8", + "gfx/anum_9" +}; +static string weaponnames[] = { + "shotgun", + "sshotgun", + "nailgun", + "snailgun", + "rlaunch", + "srlaunch", + "lightng", +#define WEAPONICONS 7 +#define LIGHTNING_WIDTH 48 +}; +static string facetab[] = { + "gfx/face5", "gfx/face4", "gfx/face3", "gfx/face2", "gfx/face1", + "gfx/face_p5", "gfx/face_p4", "gfx/face_p3", "gfx/face_p2", "gfx/face_p1", + "gfx/face_inv2", "gfx/face_quad", "gfx/face_invis", "gfx/face_invul2" +}; + + + +//copies of stats, for easier access +static float sitems; //copy of .items +static float sitems2; //copy of .items2 (or serverflags) +static float sweapon; //copy of .weapon +static float shealth; //copy of .health + +//Note: these are not tracked for splitscreen, which limits them to one player. We're lazy and just don't update them. +static float flashtime[WEAPONICONS]; //tracks the time that various items were obtained, so we can flash stuff accordingly. +static float painfinishtime;//tracks when we took damage, for flinching. + + +//registers the various pics so they're ready as needed. +static void() Hud_Init +{ + float i; + precache_pic("gfx/sbar", TRUE); + precache_pic("gfx/r_invbar1", TRUE); + precache_pic("gfx/r_invbar2", TRUE); + for (i = 0; i < 10; i++) + { + precache_pic(number[i], TRUE); + precache_pic(anumber[i], TRUE); + } + + precache_pic("gfx/sb_armor1", TRUE); + precache_pic("gfx/sb_armor2", TRUE); + precache_pic("gfx/sb_armor3", TRUE); + precache_pic("gfx/disc", TRUE); + + precache_pic("gfx/sb_shells", TRUE); + precache_pic("gfx/sb_nails", TRUE); + precache_pic("gfx/sb_rocket", TRUE); + precache_pic("gfx/sb_cells", TRUE); + + precache_pic("gfx/sb_key1", TRUE); + precache_pic("gfx/sb_key2", TRUE); + precache_pic("gfx/sb_invis", TRUE); + precache_pic("gfx/sb_invuln", TRUE); + precache_pic("gfx/sb_suit", TRUE); + precache_pic("gfx/sb_quad", TRUE); + + precache_pic("gfx/r_ammolava", TRUE); + precache_pic("gfx/r_ammomulti", TRUE); + precache_pic("gfx/r_ammoplasma", TRUE); + precache_pic("gfx/r_shield1", TRUE); + precache_pic("gfx/r_agrav1", TRUE); + + precache_pic("gfx/r_lava", TRUE); + precache_pic("gfx/r_superlava", TRUE); + precache_pic("gfx/r_gren", TRUE); + precache_pic("gfx/r_multirock", TRUE); + precache_pic("gfx/r_plasma", TRUE); + + for (i = 0; i < weaponnames.length; i++) + { + precache_pic(strcat("gfx/inv_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inv2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva1_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva3_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva4_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva5_", weaponnames[i]), TRUE); + } + for (i = 0; i < facetab.length; i++) + precache_pic(facetab[i], TRUE); +}; + + + + +static void(vector pos, float value, float threshhold) Hud_DrawLargeValue = +{ + float c; + float len; + string s; + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 24 * (3-len); + + + if (value <= threshhold) + { //use alternate (red) numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', anumber[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } + else + { //use normal numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', number[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } +}; + +static void(float type, vector pos, float drawback) Hud_DrawAmmoCount = +{ + string s; + float value; + float len; + float c; + value = getstatf(STAT_SHELLS+type); + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + if (drawback) + { + drawsubpic(pos, '42 11', (sweapon>=RIT_NAILGUN2)?"gfx/r_invbar1":"gfx/r_invbar2", [(3.0/320)+type*(48.0/320), 0], [42.0/320, 11.0/24], '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + pos_x += 8; + } + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 8 * (3-len); + while(len>0) + { + len--; + c = str2chr(s, len); + drawcharacter(pos+len * '8 0 0', (18-'0') + c, '8 8 0', '1 1 1', 1, 0); + } +}; + +static void(float num, vector pos) Hud_DrawWeapon = +{ + string prefix; + float flash = (time - flashtime[num])*10; + if (flash >= 10) + { + if (sweapon == (1<<num)) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + + drawpic(pos, strcat(prefix, weaponnames[num]), '24 16 0', '1 1 1', 1, 0); +}; +static void(float num, float lflashtime, float iscurrent, vector pos, float drawwidth, float imgwidth) Hud_DrawWeaponEx = +{ + string prefix; + float flash = (time - lflashtime)*10; + if (flash >= 10) + { + if (iscurrent) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + drawsubpic(pos, [drawwidth, 16], strcat(prefix, weaponnames[num]), '0 0 0', [drawwidth/imgwidth, 1], '1 1 1', 1, 0); +}; + +static string(float f, float chars, string lead) FormatFloat +{ + string s = ftos(f); + if (f < 10 && chars >= 3) + s = strcat(lead, lead, s); + else if (f < 10 && chars == 2) + s = strcat(lead, s); + else if (f < 100 && chars >= 3) + s = strcat(lead, s); + return s; +}; + +static void(vector pos) Hud_CoopScores_SBar = +{ + string s; + float nsecs; + float nmins; + vector sbar = pos; + drawpic(sbar, "gfx/scorebar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + s = strcat("Monsters:", FormatFloat(getstatf(STAT_KILLEDMONSTERS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALMONSTERS), 3, " ")); + drawstring(sbar + '8 4', s, '8 8 0', '1 1 1', 1, 0); + s = strcat("Secrets :", FormatFloat(getstatf(STAT_FOUNDSECRETS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALSECRETS), 3, " ")); + drawstring(sbar + '8 12', s, '8 8 0', '1 1 1', 1, 0); + + nmins = floor(time/60); + nsecs = floor(time - nmins*60); + s = strcat("Time :", FormatFloat(nmins, 3, " "), ":", FormatFloat(nsecs, 2, "0")); + drawstring(sbar + '184 4', s, '8 8 0', '1 1 1', 1, 0); + + drawstring(sbar + '232 12' - strlen(world.message)*'4 0', world.message, '8 8 0', '1 1 1', 1, 0); +}; + +static void Hud_PicOrModel(vector topleft, string pic, string showmodel, float showskin, float speed) +{ + vector sz = '24 24'; +#ifdef DP_QC_RENDER_SCENE //requires fteextensions.qc instead of qsextensions.qc + if (autocvar(cl_sbar, 1) >= 3) + if (checkextension("DP_QC_RENDER_SCENE")) + { + //reset view props and wipe entity lists + clearscene(); + + //set up the various view details, set up the renderer to be a little larger than the intended size... it avoids harsh cuts. + setviewprop(VF_MIN, topleft - sz); + setviewprop(VF_SIZE, sz * 3); + setviewprop(VF_DRAWENGINESBAR, FALSE); + setviewprop(VF_DRAWCROSSHAIR, FALSE); + setviewprop(VF_DRAWWORLD, FALSE); + setviewprop(VF_AFOV, 30); //a small fov reduces perspective distortions without making it look like its isometric. + setviewprop(VF_ANGLES, '15 0 0'); //angle downwards slightly + makevectors('15 0 0'); + setviewprop(VF_ORIGIN, v_forward*-256); //and move the camera away so that we can position the model at the center without needing to worry about the tilt. + + //spawn a (reusable) entity for our scene + static entity hudpicent; + if (!hudpicent) + hudpicent = spawn(); + precache_model(showmodel); + setmodel(hudpicent, showmodel); + hudpicent.angles_y = cltime*speed; + hudpicent.skin = showskin; + makevectors(hudpicent.angles); + //make sure its centered + vector org = (hudpicent.maxs+hudpicent.mins)*0.5; + setorigin(hudpicent, - v_forward*org_x + v_right*org_y - v_up*org_z); + //and now copy it into the scene + addentity(hudpicent); + + //and ask the engine to actually draw that single-entity scene. Think of this as a drawpic call. + renderscene(); + + return; + } +#endif + drawpic(topleft, pic, '24 24 0', '1 1 1', 1, 0); +}; + +static void Hud_DrawFace(vector pos) +{ + string face; + if (sitems & IT_INVISIBILITY) + { //invis can go first, because its the most obvious image difference. + if (sitems & IT_INVULNERABILITY) + face = facetab[10]; //special double-powerup image! + else + face = facetab[12]; + } + else if (sitems & IT_QUAD) + face = facetab[11]; + else if (sitems & IT_INVULNERABILITY) + face = facetab[13]; + else + { + float frame = shealth/20; + if (frame < 0) + frame = 0; + else if (frame > 4) + frame = 4; + if (painfinishtime > time) + frame += 5; //pain. + face = facetab[frame]; + } + + if (shealth > 100) + Hud_PicOrModel(pos, face, "maps/b_bh100.bsp", 0, -90); + else if (shealth > 50) + Hud_PicOrModel(pos, face, "maps/b_bh25.bsp", 0, -90); + else + Hud_PicOrModel(pos, face, "maps/b_bh10.bsp", 0, -90); +}; + + +static void Hud_DrawSBar(vector pos, vector virtsize) +{ + if (autocvar(cl_sbar, 1) >= 2) + { //n64-style + pos = [0, virtsize_y-24]; + Hud_DrawFace(pos+[3*24,0]); + Hud_DrawLargeValue(pos, shealth, 25); + + if ((sitems & IT_INVULNERABILITY) || (sitems2 & (RIT2_ARMOR1|RIT2_ARMOR2|RIT2_ARMOR3))) + { + pos_y -= 24; + if (sitems & IT_INVULNERABILITY) + Hud_DrawLargeValue(pos, 999, 25); + else + Hud_DrawLargeValue(pos, getstatf(STAT_ARMOR), 25); + pos+=[3*24,0]; + if (sitems & IT_INVULNERABILITY) + Hud_PicOrModel(pos, "gfx/disc", "progs/invulner.mdl", 0, 70); + else if (sitems2 & RIT2_ARMOR3) + Hud_PicOrModel(pos, "gfx/sb_armor3", "progs/armor.mdl", 2, 70); + else if (sitems2 & RIT2_ARMOR2) + Hud_PicOrModel(pos, "gfx/sb_armor2", "progs/armor.mdl", 1, 70); + else if (sitems2 & RIT2_ARMOR1) + Hud_PicOrModel(pos, "gfx/sb_armor1", "progs/armor.mdl", 0, 70); + } + + pos = virtsize - [24,24]; + if (sitems & IT_SHELLS) + Hud_PicOrModel(pos, "gfx/sb_shells", "maps/b_shell1.bsp", 0, 80); + else if (sitems & IT_NAILS) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_nail1.bsp", 0, 80); + else if (sitems & IT_ROCKETS) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_rock1.bsp", 0, 80); + else if (sitems & IT_CELLS) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_batt1.bsp", 0, 80); + else if (sitems2 & RIT2_NAILS2) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_lnail1.bsp", 0, 80); + else if (sitems2 & RIT2_ROCKETS2) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_mrock1.bsp", 0, 80); + else if (sitems2 & RIT2_CELLS2) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_plas1.bsp", 0, 80); + Hud_DrawLargeValue(pos-[24*3], getstatf(STAT_AMMO), 10); + return; + } + + if (autocvar(cl_sbar, 1)) + drawpic(pos, "gfx/sbar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_INVULNERABILITY) + { + drawpic(pos, "gfx/disc", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'24 0 0', 999, 25); + } + else + { + Hud_DrawLargeValue(pos+'24 0 0', getstatf(STAT_ARMOR), 25); + if (sitems2 & RIT2_ARMOR3) + drawpic(pos, "gfx/sb_armor3", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_ARMOR2) + drawpic(pos, "gfx/sb_armor2", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_ARMOR1) + drawpic(pos, "gfx/sb_armor1", '24 24 0', '1 1 1', 1, 0); + } + + + Hud_DrawFace(pos+'112 0 0'); + Hud_DrawLargeValue(pos+'136 0 0', shealth, 25); + + if (sitems & IT_SHELLS) + drawpic(pos+'224 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_NAILS) + drawpic(pos+'224 0 0', "gfx/sb_nails", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ROCKETS) + drawpic(pos+'224 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_CELLS) + drawpic(pos+'224 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_NAILS2) + drawpic(pos+'224 0 0', "gfx/r_ammolava", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_ROCKETS2) + drawpic(pos+'224 0 0', "gfx/r_ammomulti", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_CELLS2) + drawpic(pos+'224 0 0', "gfx/r_ammoplasma", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'248 0 0', getstatf(STAT_AMMO), 10); +}; + +static void Hud_DrawIBar(vector pos, vector br) +{ + if (!autocvar(cl_sbar, 1) || autocvar(cl_sbar, 1) >= 2) + { //qw puts its ammo+weapons on the side. mimic that. + vector pos2, pos3; + const float hheight = (WEAPONICONS*16)+(11*4); + pos2 = [0, br_y-48, 0]; + if (pos2_y < hheight) + pos2_y = hheight; + if (autocvar(cl_hudswap, 0)) + pos3 = pos2 + [0,-44]; //hudswap puts it on the left + else + { //otherwise align to the right edge + pos2_x += br_x-42; + pos3 = pos2 + [42-24,-44]; + } + if (autocvar(cl_sbar, 1) >= 2) + { + pos3_y = 0; //n64-style hud puts them at the top, apparently. + pos_x = br_x-320; //align any keys+powerups as though the hud was aligned to the right. + if (pos2_y < hheight) + pos2_y = hheight; + } + else pos3_y -= WEAPONICONS*16; + Hud_DrawAmmoCount(0, pos2 + '0 -44', TRUE); + Hud_DrawAmmoCount(1, pos2 + '0 -33', TRUE); + Hud_DrawAmmoCount(2, pos2 + '0 -22', TRUE); + Hud_DrawAmmoCount(3, pos2 + '0 -11', TRUE); + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos3+[0,16*0]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos3+[0,16*1]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos3+[0,16*2]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos3+[0,16*3]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos3+[0,16*4]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos3+[0,16*5]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + if (sweapon >= RIT_NAILGUN2) + { + if (sitems & RIT_NAILGUN2) Hud_DrawWeaponEx(7, flashtime[2], sweapon==RIT_NAILGUN2, pos3+[0,16*2], 24, 24); + if (sitems & RIT_SUPER_NAILGUN2) Hud_DrawWeaponEx(8, flashtime[3], sweapon==RIT_SUPER_NAILGUN2, pos3+[0,16*3], 24, 24); + if (sitems & RIT_GRENADE_LAUNCHER2) Hud_DrawWeaponEx(9, flashtime[4], sweapon==RIT_GRENADE_LAUNCHER2, pos3+[0,16*4], 24, 24); + if (sitems & RIT_ROCKET_LAUNCHER2) Hud_DrawWeaponEx(10, flashtime[5], sweapon==RIT_ROCKET_LAUNCHER2, pos3+[0,16*5], 24, 24); + if (sitems & RIT_LIGHTNING2) Hud_DrawWeaponEx(11, flashtime[6], sweapon==RIT_LIGHTNING2, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + } + } + else + { //standard nq sbar + drawpic(pos, (sweapon>=RIT_NAILGUN2)?"gfx/r_invbar1":"gfx/r_invbar2", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos+[24*0,8]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos+[24*1,8]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos+[24*2,8]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos+[24*3,8]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos+[24*4,8]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos+[24*5,8]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos+[24*6,8], LIGHTNING_WIDTH, LIGHTNING_WIDTH); + if (sweapon >= RIT_NAILGUN2) + { + if (sweapon == RIT_NAILGUN2) drawpic(pos+[24*2,8], "gfx/r_lava", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_SUPER_NAILGUN2) drawpic(pos+[24*3,8], "gfx/r_superlava", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_GRENADE_LAUNCHER2) drawpic(pos+[24*4,8], "gfx/r_gren", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_ROCKET_LAUNCHER2) drawpic(pos+[24*5,8], "gfx/r_multirock", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_LIGHTNING2) drawpic(pos+[24*6,8], "gfx/r_plasma", [LIGHTNING_WIDTH,16], '1 1 1', 1, 0); + } + + Hud_DrawAmmoCount(0, pos + '10 0 0', FALSE); + Hud_DrawAmmoCount(1, pos + '58 0 0', FALSE); + Hud_DrawAmmoCount(2, pos + '106 0 0', FALSE); + Hud_DrawAmmoCount(3, pos + '154 0 0', FALSE); + } + + if (sitems & IT_KEY1) + drawpic(pos+'192 8 0', "gfx/sb_key1", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_KEY2) + drawpic(pos+'208 8 0', "gfx/sb_key2", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVISIBILITY) + drawpic(pos+'224 8 0', "gfx/sb_invis", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVULNERABILITY) + drawpic(pos+'240 8 0', "gfx/sb_invuln", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_SUIT) + drawpic(pos+'256 8 0', "gfx/sb_suit", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_QUAD) + drawpic(pos+'272 8 0', "gfx/sb_quad", '16 16 0', '1 1 1', 1, 0); + + if (sitems2 & RIT2_SHIELD) + drawpic(pos+'288 8 0', "gfx/r_shield1", '16 16 0', '1 1 1', 1, 0); + if (sitems2 & RIT2_ANTIGRAV) + drawpic(pos+'304 8 0', "gfx/r_agrav1", '16 16 0', '1 1 1', 1, 0); + + if (deathmatch) + { //should probably show team scores, but this mimics vanilla + pos_x += 194; + for (float i = -1; i >= -4; i--) + { + string frags = getplayerkeyvalue(i, "frags"); + if not (frags) + break; + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + drawfill(pos+[0,1], [28,3], top, 0.75, 0); + drawfill(pos+[0,4], [28,4], bot, 0.75, 0); + drawstring(pos+[2,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { + drawcharacter(pos+[-4,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[24,0], 0xe011, [8,8], [1,1,1],1, 0); + } + pos_x += 8*4; + } + } +}; + +float numclientseats; +static void Hud_Draw(vector virtsize, float scoreboard) +{ + vector pos; + float oitems = sitems; + float oitems2 = sitems2; + float ohealth = shealth; + + pos_x = (virtsize_x-320)/2; + pos_y = virtsize_y; + + sitems = getstatbits(STAT_ITEMS, 0, 23); //note that we could use getstati to read the items stat, but it'd degrade when then cast to a float, and QSS+DP don't support ints, so we have to use two floats. + sitems2 = getstatbits(STAT_ITEMS, 23, 9); + sweapon = getstatf(STAT_ACTIVEWEAPON); + shealth = getstatf(STAT_HEALTH); + //note that ssqc can provide custom stats, eg: clientstat(STAT_USER+n, EV_FLOAT, items3); can then be read by us with float items3 = getstatf(STAT_USER+n); + + if (shealth <= 0) + scoreboard = TRUE; + + if (numclientseats <= 1) + { //note that we only track one player's stats. with splitscreen we need to stop looking for changes otherwise we'd see them all the time. + if (ohealth && sitems != oitems) + { + for (float f = 0; f < 7; f++) + { + if ((sitems & (1<<f)) && !(oitems & (1<<f))) + flashtime[f] = time; + } + } + } + + if (autocvar(viewsize, 100) < 120) + { + if (scoreboard) + Hud_CoopScores_SBar(pos - '0 24 0'); + else + Hud_DrawSBar(pos - '0 24 0', virtsize); + + if (autocvar(viewsize, 100) < 110) + Hud_DrawIBar(pos - '0 48 0', virtsize); + } +}; + +//lame entry point, just so that we know when damage was taken +float(float save, float take, vector dir) CSQC_Parse_Damage = +{ + if (numclientseats <= 1) + painfinishtime = time + 0.2; + return FALSE; //let the engine handle any red tints etc +}; + +//Hud entry point! +//showscores is set if +scores is held (check health yourself). +void(vector virtsize, float showscores) CSQC_DrawHud = +{ + Hud_Draw(virtsize, showscores); +}; + +void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + Hud_Init(); +}; + diff --git a/QC_other/QC_keep/csqc/csqc_hud_rogue.qc.orig b/QC_other/QC_keep/csqc/csqc_hud_rogue.qc.orig new file mode 100644 index 00000000..6f22d4ea --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_hud_rogue.qc.orig @@ -0,0 +1,665 @@ +// This file implements NQ, QW, and N64-style huds in csqc. Its meant to be complete, while not otherwise being that different. +// The hud layout+items used are specific to the Rogue (Dissolution of Eternity) mission pack, and is not compatible with Quake itself. +// +// The entry points are at the bottom of the file. +// You can just add this file (and fteextensions.qc or qsextensions.qc) into any mod and then just adapt it as desired. +// +// Note that it doesn't understand viewsizes all that well, but no worse than eg scr_sbaralpha<1 in QS (its default). (this keeps the api spec simpler.) +// the 'simple csqc' api means that this file (and api defs) is all you need for a hud, and can be directly embedded into a regular nq progs.dat, if needed. +// +// I have made attempts to avoid copying the engine code, however I will not be held liable if there's any GPL contagion. +// There is otherwise no license for the code in this file. + + +/*autocvars: + cl_sbar: alternative layouts (sorry for this complication, but mneh). + 0: QuakeWorld style hud + 1: Vanilla style hud + 2: n64-style hud + 3: n64-style with meshes instead of models, where supported. + cl_hudswap: QW/n64 ammo+weapons are on the + 0: right + 1: left + scr_sbaralpha: opacity of backgroundy elements +*/ + +// items. FIXME: you should share these with your ssqc... +float IT_SHOTGUN = 1<<0; +float IT_SUPER_SHOTGUN = 1<<1; +float IT_NAILGUN = 1<<2; +float IT_SUPER_NAILGUN = 1<<3; +float IT_GRENADE_LAUNCHER = 1<<4; +float IT_ROCKET_LAUNCHER = 1<<5; +float IT_LIGHTNING = 1<<6; + +float IT_SHELLS = 1<<7; +float IT_NAILS = 1<<8; +float IT_ROCKETS = 1<<9; +float IT_CELLS = 1<<10; + +float IT_AXE = 1<<11; +float RIT_NAILGUN2 = 1<<12; +float RIT_SUPER_NAILGUN2 = 1<<13; +float RIT_GRENADE_LAUNCHER2 = 1<<14; +float RIT_ROCKET_LAUNCHER2 = 1<<15; +float RIT_LIGHTNING2 = 1<<16; + +float IT_KEY1 = 1<<17; +float IT_KEY2 = 1<<18; +float IT_INVISIBILITY = 1<<19; +float IT_INVULNERABILITY = 1<<20; +float IT_SUIT = 1<<21; +float IT_QUAD = 1<<22; + +//these are all wrong. +float RIT2_ARMOR1 = 1<<0; +float RIT2_ARMOR2 = 1<<1; +float RIT2_ARMOR3 = 1<<2; +float RIT2_NAILS2 = 1<<3; +float RIT2_ROCKETS2 = 1<<4; +float RIT2_CELLS2 = 1<<5; +float RIT2_SHIELD = 1<<6; +float RIT2_ANTIGRAV = 1<<7; +//float RIT2_SUPERHEALTH = 1<<8; +//no sigils + + +//wad image names in array form, for easier access. +static string number[10] = { + "gfx/num_0", + "gfx/num_1", + "gfx/num_2", + "gfx/num_3", + "gfx/num_4", + "gfx/num_5", + "gfx/num_6", + "gfx/num_7", + "gfx/num_8", + "gfx/num_9" +}; +static string anumber[10] = { + "gfx/anum_0", + "gfx/anum_1", + "gfx/anum_2", + "gfx/anum_3", + "gfx/anum_4", + "gfx/anum_5", + "gfx/anum_6", + "gfx/anum_7", + "gfx/anum_8", + "gfx/anum_9" +}; +static string weaponnames[] = { + "shotgun", + "sshotgun", + "nailgun", + "snailgun", + "rlaunch", + "srlaunch", + "lightng", +#define WEAPONICONS 7 +#define LIGHTNING_WIDTH 48 +}; +static string facetab[] = { + "gfx/face5", "gfx/face4", "gfx/face3", "gfx/face2", "gfx/face1", + "gfx/face_p5", "gfx/face_p4", "gfx/face_p3", "gfx/face_p2", "gfx/face_p1", + "gfx/face_inv2", "gfx/face_quad", "gfx/face_invis", "gfx/face_invul2" +}; + + + +//copies of stats, for easier access +static float sitems; //copy of .items +static float sitems2; //copy of .items2 (or serverflags) +static float sweapon; //copy of .weapon +static float shealth; //copy of .health + +//Note: these are not tracked for splitscreen, which limits them to one player. We're lazy and just don't update them. +static float flashtime[WEAPONICONS]; //tracks the time that various items were obtained, so we can flash stuff accordingly. +static float painfinishtime;//tracks when we took damage, for flinching. + + +//registers the various pics so they're ready as needed. +static void() Hud_Init +{ + float i; + precache_pic("gfx/sbar", TRUE); + precache_pic("gfx/r_invbar1", TRUE); + precache_pic("gfx/r_invbar2", TRUE); + for (i = 0; i < 10; i++) + { + precache_pic(number[i], TRUE); + precache_pic(anumber[i], TRUE); + } + + precache_pic("gfx/sb_armor1", TRUE); + precache_pic("gfx/sb_armor2", TRUE); + precache_pic("gfx/sb_armor3", TRUE); + precache_pic("gfx/disc", TRUE); + + precache_pic("gfx/sb_shells", TRUE); + precache_pic("gfx/sb_nails", TRUE); + precache_pic("gfx/sb_rocket", TRUE); + precache_pic("gfx/sb_cells", TRUE); + + precache_pic("gfx/sb_key1", TRUE); + precache_pic("gfx/sb_key2", TRUE); + precache_pic("gfx/sb_invis", TRUE); + precache_pic("gfx/sb_invuln", TRUE); + precache_pic("gfx/sb_suit", TRUE); + precache_pic("gfx/sb_quad", TRUE); + + precache_pic("gfx/r_ammolava", TRUE); + precache_pic("gfx/r_ammomulti", TRUE); + precache_pic("gfx/r_ammoplasma", TRUE); + precache_pic("gfx/r_shield1", TRUE); + precache_pic("gfx/r_agrav1", TRUE); + + precache_pic("gfx/r_lava", TRUE); + precache_pic("gfx/r_superlava", TRUE); + precache_pic("gfx/r_gren", TRUE); + precache_pic("gfx/r_multirock", TRUE); + precache_pic("gfx/r_plasma", TRUE); + + for (i = 0; i < weaponnames.length; i++) + { + precache_pic(strcat("gfx/inv_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inv2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva1_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva3_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva4_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva5_", weaponnames[i]), TRUE); + } + for (i = 0; i < facetab.length; i++) + precache_pic(facetab[i], TRUE); +}; + + + + +static void(vector pos, float value, float threshhold) Hud_DrawLargeValue = +{ + float c; + float len; + string s; + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 24 * (3-len); + + + if (value <= threshhold) + { //use alternate (red) numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', anumber[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } + else + { //use normal numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', number[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } +}; + +static void(float type, vector pos, float drawback) Hud_DrawAmmoCount = +{ + string s; + float value; + float len; + float c; + value = getstatf(STAT_SHELLS+type); + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + if (drawback) + { + drawsubpic(pos, '42 11', (sweapon>=RIT_NAILGUN2)?"gfx/r_invbar1":"gfx/r_invbar2", [(3.0/320)+type*(48.0/320), 0], [42.0/320, 11.0/24], '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + pos_x += 8; + } + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 8 * (3-len); + while(len>0) + { + len--; + c = str2chr(s, len); + drawcharacter(pos+len * '8 0 0', (18-'0') + c, '8 8 0', '1 1 1', 1, 0); + } +}; + +static void(float num, vector pos) Hud_DrawWeapon = +{ + string prefix; + float flash = (time - flashtime[num])*10; + if (flash >= 10) + { + if (sweapon == (1<<num)) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + + drawpic(pos, strcat(prefix, weaponnames[num]), '24 16 0', '1 1 1', 1, 0); +}; +static void(float num, float lflashtime, float iscurrent, vector pos, float drawwidth, float imgwidth) Hud_DrawWeaponEx = +{ + string prefix; + float flash = (time - lflashtime)*10; + if (flash >= 10) + { + if (iscurrent) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + drawsubpic(pos, [drawwidth, 16], strcat(prefix, weaponnames[num]), '0 0 0', [drawwidth/imgwidth, 1], '1 1 1', 1, 0); +}; + +static string(float f, float chars, string lead) FormatFloat +{ + string s = ftos(f); + if (f < 10 && chars >= 3) + s = strcat(lead, lead, s); + else if (f < 10 && chars == 2) + s = strcat(lead, s); + else if (f < 100 && chars >= 3) + s = strcat(lead, s); + return s; +}; + +static void(vector pos) Hud_CoopScores_SBar = +{ + string s; + float nsecs; + float nmins; + vector sbar = pos; + drawpic(sbar, "gfx/scorebar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + s = strcat("Monsters:", FormatFloat(getstatf(STAT_KILLEDMONSTERS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALMONSTERS), 3, " ")); + drawstring(sbar + '8 4', s, '8 8 0', '1 1 1', 1, 0); + s = strcat("Secrets :", FormatFloat(getstatf(STAT_FOUNDSECRETS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALSECRETS), 3, " ")); + drawstring(sbar + '8 12', s, '8 8 0', '1 1 1', 1, 0); + + nmins = floor(time/60); + nsecs = floor(time - nmins*60); + s = strcat("Time :", FormatFloat(nmins, 3, " "), ":", FormatFloat(nsecs, 2, "0")); + drawstring(sbar + '184 4', s, '8 8 0', '1 1 1', 1, 0); + + drawstring(sbar + '232 12' - strlen(world.message)*'4 0', world.message, '8 8 0', '1 1 1', 1, 0); +}; + +static void Hud_PicOrModel(vector topleft, string pic, string showmodel, float showskin, float speed) +{ + vector sz = '24 24'; +#ifdef DP_QC_RENDER_SCENE //requires fteextensions.qc instead of qsextensions.qc + if (autocvar(cl_sbar, 1) >= 3) + if (checkextension("DP_QC_RENDER_SCENE")) + { + //reset view props and wipe entity lists + clearscene(); + + //set up the various view details, set up the renderer to be a little larger than the intended size... it avoids harsh cuts. + setviewprop(VF_MIN, topleft - sz); + setviewprop(VF_SIZE, sz * 3); + setviewprop(VF_DRAWENGINESBAR, FALSE); + setviewprop(VF_DRAWCROSSHAIR, FALSE); + setviewprop(VF_DRAWWORLD, FALSE); + setviewprop(VF_AFOV, 30); //a small fov reduces perspective distortions without making it look like its isometric. + setviewprop(VF_ANGLES, '15 0 0'); //angle downwards slightly + makevectors('15 0 0'); + setviewprop(VF_ORIGIN, v_forward*-256); //and move the camera away so that we can position the model at the center without needing to worry about the tilt. + + //spawn a (reusable) entity for our scene + static entity hudpicent; + if (!hudpicent) + hudpicent = spawn(); + precache_model(showmodel); + setmodel(hudpicent, showmodel); + hudpicent.angles_y = cltime*speed; + hudpicent.skin = showskin; + makevectors(hudpicent.angles); + //make sure its centered + vector org = (hudpicent.maxs+hudpicent.mins)*0.5; + setorigin(hudpicent, - v_forward*org_x + v_right*org_y - v_up*org_z); + //and now copy it into the scene + addentity(hudpicent); + + //and ask the engine to actually draw that single-entity scene. Think of this as a drawpic call. + renderscene(); + + return; + } +#endif + drawpic(topleft, pic, '24 24 0', '1 1 1', 1, 0); +}; + +static void Hud_DrawFace(vector pos) +{ + string face; + if (sitems & IT_INVISIBILITY) + { //invis can go first, because its the most obvious image difference. + if (sitems & IT_INVULNERABILITY) + face = facetab[10]; //special double-powerup image! + else + face = facetab[12]; + } + else if (sitems & IT_QUAD) + face = facetab[11]; + else if (sitems & IT_INVULNERABILITY) + face = facetab[13]; + else + { + float frame = shealth/20; + if (frame < 0) + frame = 0; + else if (frame > 4) + frame = 4; + if (painfinishtime > time) + frame += 5; //pain. + face = facetab[frame]; + } + + if (shealth > 100) + Hud_PicOrModel(pos, face, "maps/b_bh100.bsp", 0, -90); + else if (shealth > 50) + Hud_PicOrModel(pos, face, "maps/b_bh25.bsp", 0, -90); + else + Hud_PicOrModel(pos, face, "maps/b_bh10.bsp", 0, -90); +}; + + +static void Hud_DrawSBar(vector pos, vector virtsize) +{ + if (autocvar(cl_sbar, 1) >= 2) + { //n64-style + pos = [0, virtsize_y-24]; + Hud_DrawFace(pos+[3*24,0]); + Hud_DrawLargeValue(pos, shealth, 25); + + if ((sitems & IT_INVULNERABILITY) || (sitems2 & (RIT2_ARMOR1|RIT2_ARMOR2|RIT2_ARMOR3))) + { + pos_y -= 24; + if (sitems & IT_INVULNERABILITY) + Hud_DrawLargeValue(pos, 999, 25); + else + Hud_DrawLargeValue(pos, getstatf(STAT_ARMOR), 25); + pos+=[3*24,0]; + if (sitems & IT_INVULNERABILITY) + Hud_PicOrModel(pos, "gfx/disc", "progs/invulner.mdl", 0, 70); + else if (sitems2 & RIT2_ARMOR3) + Hud_PicOrModel(pos, "gfx/sb_armor3", "progs/armor.mdl", 2, 70); + else if (sitems2 & RIT2_ARMOR2) + Hud_PicOrModel(pos, "gfx/sb_armor2", "progs/armor.mdl", 1, 70); + else if (sitems2 & RIT2_ARMOR1) + Hud_PicOrModel(pos, "gfx/sb_armor1", "progs/armor.mdl", 0, 70); + } + + pos = virtsize - [24,24]; + if (sitems & IT_SHELLS) + Hud_PicOrModel(pos, "gfx/sb_shells", "maps/b_shell1.bsp", 0, 80); + else if (sitems & IT_NAILS) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_nail1.bsp", 0, 80); + else if (sitems & IT_ROCKETS) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_rock1.bsp", 0, 80); + else if (sitems & IT_CELLS) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_batt1.bsp", 0, 80); + else if (sitems2 & RIT2_NAILS2) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_lnail1.bsp", 0, 80); + else if (sitems2 & RIT2_ROCKETS2) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_mrock1.bsp", 0, 80); + else if (sitems2 & RIT2_CELLS2) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_plas1.bsp", 0, 80); + Hud_DrawLargeValue(pos-[24*3], getstatf(STAT_AMMO), 10); + return; + } + + if (autocvar(cl_sbar, 1)) + drawpic(pos, "gfx/sbar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_INVULNERABILITY) + { + drawpic(pos, "gfx/disc", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'24 0 0', 999, 25); + } + else + { + Hud_DrawLargeValue(pos+'24 0 0', getstatf(STAT_ARMOR), 25); + if (sitems2 & RIT2_ARMOR3) + drawpic(pos, "gfx/sb_armor3", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_ARMOR2) + drawpic(pos, "gfx/sb_armor2", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_ARMOR1) + drawpic(pos, "gfx/sb_armor1", '24 24 0', '1 1 1', 1, 0); + } + + + Hud_DrawFace(pos+'112 0 0'); + Hud_DrawLargeValue(pos+'136 0 0', shealth, 25); + + if (sitems & IT_SHELLS) + drawpic(pos+'224 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_NAILS) + drawpic(pos+'224 0 0', "gfx/sb_nails", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ROCKETS) + drawpic(pos+'224 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_CELLS) + drawpic(pos+'224 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_NAILS2) + drawpic(pos+'224 0 0', "gfx/r_ammolava", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_ROCKETS2) + drawpic(pos+'224 0 0', "gfx/r_ammomulti", '24 24 0', '1 1 1', 1, 0); + else if (sitems2 & RIT2_CELLS2) + drawpic(pos+'224 0 0', "gfx/r_ammoplasma", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'248 0 0', getstatf(STAT_AMMO), 10); +}; + +static void Hud_DrawIBar(vector pos, vector br) +{ + if (!autocvar(cl_sbar, 1) || autocvar(cl_sbar, 1) >= 2) + { //qw puts its ammo+weapons on the side. mimic that. + vector pos2, pos3; + const float hheight = (WEAPONICONS*16)+(11*4); + pos2 = [0, br_y-48, 0]; + if (pos2_y < hheight) + pos2_y = hheight; + if (autocvar(cl_hudswap, 0)) + pos3 = pos2 + [0,-44]; //hudswap puts it on the left + else + { //otherwise align to the right edge + pos2_x += br_x-42; + pos3 = pos2 + [42-24,-44]; + } + if (autocvar(cl_sbar, 1) >= 2) + { + pos3_y = 0; //n64-style hud puts them at the top, apparently. + pos_x = br_x-320; //align any keys+powerups as though the hud was aligned to the right. + if (pos2_y < hheight) + pos2_y = hheight; + } + else pos3_y -= WEAPONICONS*16; + Hud_DrawAmmoCount(0, pos2 + '0 -44', TRUE); + Hud_DrawAmmoCount(1, pos2 + '0 -33', TRUE); + Hud_DrawAmmoCount(2, pos2 + '0 -22', TRUE); + Hud_DrawAmmoCount(3, pos2 + '0 -11', TRUE); + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos3+[0,16*0]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos3+[0,16*1]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos3+[0,16*2]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos3+[0,16*3]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos3+[0,16*4]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos3+[0,16*5]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + if (sweapon >= RIT_NAILGUN2) + { + if (sitems & RIT_NAILGUN2) Hud_DrawWeaponEx(7, flashtime[2], sweapon==RIT_NAILGUN2, pos3+[0,16*2], 24, 24); + if (sitems & RIT_SUPER_NAILGUN2) Hud_DrawWeaponEx(8, flashtime[3], sweapon==RIT_SUPER_NAILGUN2, pos3+[0,16*3], 24, 24); + if (sitems & RIT_GRENADE_LAUNCHER2) Hud_DrawWeaponEx(9, flashtime[4], sweapon==RIT_GRENADE_LAUNCHER2, pos3+[0,16*4], 24, 24); + if (sitems & RIT_ROCKET_LAUNCHER2) Hud_DrawWeaponEx(10, flashtime[5], sweapon==RIT_ROCKET_LAUNCHER2, pos3+[0,16*5], 24, 24); + if (sitems & RIT_LIGHTNING2) Hud_DrawWeaponEx(11, flashtime[6], sweapon==RIT_LIGHTNING2, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + } + } + else + { //standard nq sbar + drawpic(pos, (sweapon>=RIT_NAILGUN2)?"gfx/r_invbar1":"gfx/r_invbar2", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos+[24*0,8]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos+[24*1,8]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos+[24*2,8]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos+[24*3,8]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos+[24*4,8]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos+[24*5,8]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos+[24*6,8], LIGHTNING_WIDTH, LIGHTNING_WIDTH); + if (sweapon >= RIT_NAILGUN2) + { + if (sweapon == RIT_NAILGUN2) drawpic(pos+[24*2,8], "gfx/r_lava", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_SUPER_NAILGUN2) drawpic(pos+[24*3,8], "gfx/r_superlava", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_GRENADE_LAUNCHER2) drawpic(pos+[24*4,8], "gfx/r_gren", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_ROCKET_LAUNCHER2) drawpic(pos+[24*5,8], "gfx/r_multirock", '24 16 0', '1 1 1', 1, 0); + if (sweapon == RIT_LIGHTNING2) drawpic(pos+[24*6,8], "gfx/r_plasma", [LIGHTNING_WIDTH,16], '1 1 1', 1, 0); + } + + Hud_DrawAmmoCount(0, pos + '10 0 0', FALSE); + Hud_DrawAmmoCount(1, pos + '58 0 0', FALSE); + Hud_DrawAmmoCount(2, pos + '106 0 0', FALSE); + Hud_DrawAmmoCount(3, pos + '154 0 0', FALSE); + } + + if (sitems & IT_KEY1) + drawpic(pos+'192 8 0', "gfx/sb_key1", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_KEY2) + drawpic(pos+'208 8 0', "gfx/sb_key2", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVISIBILITY) + drawpic(pos+'224 8 0', "gfx/sb_invis", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVULNERABILITY) + drawpic(pos+'240 8 0', "gfx/sb_invuln", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_SUIT) + drawpic(pos+'256 8 0', "gfx/sb_suit", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_QUAD) + drawpic(pos+'272 8 0', "gfx/sb_quad", '16 16 0', '1 1 1', 1, 0); + + if (sitems2 & RIT2_SHIELD) + drawpic(pos+'288 8 0', "gfx/r_shield1", '16 16 0', '1 1 1', 1, 0); + if (sitems2 & RIT2_ANTIGRAV) + drawpic(pos+'304 8 0', "gfx/r_agrav1", '16 16 0', '1 1 1', 1, 0); + + if (deathmatch) + { //should probably show team scores, but this mimics vanilla + pos_x += 194; + for (float i = -1; i >= -4; i--) + { + string frags = getplayerkeyvalue(i, "frags"); + if not (frags) + break; + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + drawfill(pos+[0,1], [28,3], top, 0.75, 0); + drawfill(pos+[0,4], [28,4], bot, 0.75, 0); + drawstring(pos+[2,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { + drawcharacter(pos+[-4,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[24,0], 0xe011, [8,8], [1,1,1],1, 0); + } + pos_x += 8*4; + } + } +}; + +float numclientseats; +static void Hud_Draw(vector virtsize, float scoreboard) +{ + vector pos; + float oitems = sitems; + float oitems2 = sitems2; + float ohealth = shealth; + + pos_x = (virtsize_x-320)/2; + pos_y = virtsize_y; + + sitems = getstatbits(STAT_ITEMS, 0, 23); //note that we could use getstati to read the items stat, but it'd degrade when then cast to a float, and QSS+DP don't support ints, so we have to use two floats. + sitems2 = getstatbits(STAT_ITEMS, 23, 9); + sweapon = getstatf(STAT_ACTIVEWEAPON); + shealth = getstatf(STAT_HEALTH); + //note that ssqc can provide custom stats, eg: clientstat(STAT_USER+n, EV_FLOAT, items3); can then be read by us with float items3 = getstatf(STAT_USER+n); + + if (shealth <= 0) + scoreboard = TRUE; + + if (numclientseats <= 1) + { //note that we only track one player's stats. with splitscreen we need to stop looking for changes otherwise we'd see them all the time. + if (ohealth && sitems != oitems) + { + for (float f = 0; f < 7; f++) + { + if ((sitems & (1<<f)) && !(oitems & (1<<f))) + flashtime[f] = time; + } + } + } + + if (autocvar(viewsize, 100) < 120) + { + if (scoreboard) + Hud_CoopScores_SBar(pos - '0 24 0'); + else + Hud_DrawSBar(pos - '0 24 0', virtsize); + + if (autocvar(viewsize, 100) < 110) + Hud_DrawIBar(pos - '0 48 0', virtsize); + } +}; + +//lame entry point, just so that we know when damage was taken +float(float save, float take, vector dir) CSQC_Parse_Damage = +{ + if (numclientseats <= 1) + painfinishtime = time + 0.2; + return FALSE; //let the engine handle any red tints etc +}; + +//Hud entry point! +//showscores is set if +scores is held (check health yourself). +void(vector virtsize, float showscores) CSQC_DrawHud = +{ + Hud_Draw(virtsize, showscores); +}; + +void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + Hud_Init(); +}; + diff --git a/QC_other/QC_keep/csqc/csqc_hud_vanilla.qc b/QC_other/QC_keep/csqc/csqc_hud_vanilla.qc new file mode 100644 index 00000000..f72c2df4 --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_hud_vanilla.qc @@ -0,0 +1,679 @@ +// This file implements NQ, QW, and N64-style huds in csqc. Its meant to be complete, while not otherwise being that different. +// The hud layout+items used are specific to vanilla Quake. For the mission packs, you should use the appropriate alternative huds. +// +// The entry points are at the bottom of the file. +// You can just add this file (and fteextensions.qc or qsextensions.qc) into any mod and then just adapt it as desired. +// +// Note that it doesn't understand viewsizes all that well, but no worse than eg scr_sbaralpha<1 in QS (its default). (this keeps the api spec simpler.) +// the 'simple csqc' api means that this file (and api defs) is all you need for a hud, and can be directly embedded into a regular nq progs.dat, if needed. +// +// I have made attempts to avoid copying the engine code, however I will not be held liable if there's any GPL contagion. +// There is otherwise no license for the code in this file. + + +/*autocvars: + cl_sbar: alternative layouts (sorry for this complication, but mneh). + 0: QuakeWorld style hud + 1: Vanilla style hud + 2: n64-style hud + 3: n64-style with meshes instead of models, where supported. + cl_hudswap: QW/n64 ammo+weapons are on the + 0: right + 1: left + scr_sbaralpha: opacity of backgroundy elements +*/ + +// items. FIXME: you should share these with your ssqc... +/* +float IT_SHOTGUN = 1<<0; +float IT_SUPER_SHOTGUN = 1<<1; +float IT_NAILGUN = 1<<2; +float IT_SUPER_NAILGUN = 1<<3; +float IT_GRENADE_LAUNCHER = 1<<4; +float IT_ROCKET_LAUNCHER = 1<<5; +float IT_LIGHTNING = 1<<6; + +//float IT_EXTRA_WEAPON = 1<<7; + +float IT_SHELLS = 1<<8; +float IT_NAILS = 1<<9; +float IT_ROCKETS = 1<<10; +float IT_CELLS = 1<<11; +float IT_AXE = 1<<12; + +float IT_ARMOR1 = 1<<13; +float IT_ARMOR2 = 1<<14; +float IT_ARMOR3 = 1<<15; +//float IT_SUPERHEALTH = 1<<16; + +float IT_KEY1 = 1<<17; +float IT_KEY2 = 1<<18; +float IT_INVISIBILITY = 1<<19; +float IT_INVULNERABILITY = 1<<20; +float IT_SUIT = 1<<21; +float IT_QUAD = 1<<22; + +float IT2_RUNE1 = 1<<5; +float IT2_RUNE2 = 1<<6; +float IT2_RUNE3 = 1<<7; +float IT2_RUNE4 = 1<<8; +*/ +//=======================================SELF.ITEMS1====================================================== +float IT_SHOTGUN = 1.000; //Correct for standard HUD & HIP & DOE W +float IT_SUPER_SHOTGUN = 2.000; //Correct for standard HUD & HIP & DOE W +float IT_NAILGUN = 4.000; //Correct for standard HUD & HIP & DOE W +float IT_SUPER_NAILGUN = 8.000; //Correct for standard HUD & HIP & DOE W +float IT_GRENADE_LAUNCHER = 16.000; //Correct for standard HUD & HIP & DOE W +float IT_ROCKET_LAUNCHER = 32.000; //Correct for standard HUD & HIP & DOE W +float IT_LIGHTNING = 64.000; //Correct for standard HUD & HIP & DOE W +float IT_SHELLS = 128.000; //Correct for DOE HUD I +float IT_NAILS = 256.000; //Correct for DOE HUD I +float IT_ROCKETS = 512.000; //Correct for DOE HUD I +float IT_CELLS = 1024.000; //Correct for DOE HUD I +float IT_AXE = 2048.000; //Correct for DOE HUD W +float IT_LAVA_NAILGUN = 4096.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_LAVA_SUPER_NAILGUN = 8192.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_MULTI_GRENADE = 16384.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_MULTI_ROCKET = 32768.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_PLASMA_GUN = 65536.000; //Correct for DOE HUD W +float IT_KEY1 = 131072.000; //Correct for standard HUD & HIP & DOE I +float IT_KEY2 = 262144.000; //Correct for standard HUD & HIP & DOE I +float IT_INVISIBILITY = 524288.000; //Correct for standard HUD & HIP & DOE I +float IT_INVULNERABILITY = 1048576.000; //Correct for standard HUD & HIP & DOE I +float IT_SUIT = 2097152.000; //Correct for standard HUD & HIP & DOE I +float IT_QUAD = 4194304.000; //Correct for standard HUD & HIP & DOE I +float IT_EXTRA_WEAPON = 8388608.000; //Correct for DOE HUD W +//=======================================SELF.ITEMS2====================================================== +float IT2_ARMOR1 = 1.000; //Correct for DOE HUD I +float IT2_ARMOR2 = 2.000; //Correct for DOE HUD I +float IT2_ARMOR3 = 4.000; //Correct for DOE HUD I +float IT2_LAVA_NAILS = 8.000; //Correct for DOE HUD I +float IT2_PLASMA_AMMO = 16.000; //Correct for DOE HUD I +float IT2_MULTI_ROCKETS = 32.000; //Correct for DOE HUD I +float IT2_SHIELD = 64.000; //Correct for DOE HUD I +float IT2_CHAINLIGHTNING = 128.000; //Zerstorer chain lightning W (I Antigrav for DOE HUD) +float IT2_SUPERHEALTH = 256.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_EARTHQUAKE = 512.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_V_SPHERE = 1024.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_BOLTS = 2048.000; //Keep specific I +float IT2_POISON = 4096.000; //EMTPY SLOT I +float HIP_IT2_WETSUIT = 8192.000; //Keep specific (modified from HIP) I +float HIP_IT2_EMPATHY_SHIELDS = 16384.000; //Keep specific (modified from HIP) I +float HIP_IT2_HORN_OF_CONJURING = 32768.000; //Keep specific (modified from HIP) I + //= 65536.000; EMPTY SLOT (skipped...same as IT_PLASMA_GUN) I +float IT2_PROXIMITY_GUN = 131072.000; //Keep specific.Unique number for self.weapon calls W +float IT2_MJOLNIR = 262144.000; //Keep specific "" W +float IT2_LASER_CANNON = 524288.000; //Keep specific "" W +float IT2_GRAPPLE = 1048576.000; //Keep specific "" W Rogue grapple +float IT2_TRINITY = 2097152.000; //Quoth +float IT2_CROSS = 4194304.000; //Quoth (available for a new weapon) + //= 8388608.000; EMPTY SLOT +//======================================================================================================== + +//wad image names in array form, for easier access. +static string number[10] = { + "gfx/num_0", + "gfx/num_1", + "gfx/num_2", + "gfx/num_3", + "gfx/num_4", + "gfx/num_5", + "gfx/num_6", + "gfx/num_7", + "gfx/num_8", + "gfx/num_9" +}; +static string anumber[10] = { + "gfx/anum_0", + "gfx/anum_1", + "gfx/anum_2", + "gfx/anum_3", + "gfx/anum_4", + "gfx/anum_5", + "gfx/anum_6", + "gfx/anum_7", + "gfx/anum_8", + "gfx/anum_9" +}; +static string weaponnames[] = { + "shotgun", + "sshotgun", + "nailgun", + "snailgun", + "rlaunch", + "srlaunch", + "lightng", +#define WEAPONICONS 7 +#define LIGHTNING_WIDTH 48 +}; +static string facetab[] = { + "gfx/face5", "gfx/face4", "gfx/face3", "gfx/face2", "gfx/face1", + "gfx/face_p5", "gfx/face_p4", "gfx/face_p3", "gfx/face_p2", "gfx/face_p1", + "gfx/face_inv2", "gfx/face_quad", "gfx/face_invis", "gfx/face_invul2" +}; + + + +//copies of stats, for easier access +static float sitems; //copy of .items +static float sitems2; //copy of .items2 (or serverflags) +static float sweapon; //copy of .weapon +static float shealth; //copy of .health + +//Note: these are not tracked for splitscreen, which limits them to one player. We're lazy and just don't update them. +static float flashtime[WEAPONICONS]; //tracks the time that various items were obtained, so we can flash stuff accordingly. +static float painfinishtime;//tracks when we took damage, for flinching. + + +//registers the various pics so they're ready as needed. +static void() Hud_Init +{ + float i; + precache_pic("gfx/sbar", TRUE); + precache_pic("gfx/ibar", TRUE); + for (i = 0; i < 10; i++) + { + precache_pic(number[i], TRUE); + precache_pic(anumber[i], TRUE); + } + + precache_pic("gfx/sb_armor1", TRUE); + precache_pic("gfx/sb_armor2", TRUE); + precache_pic("gfx/sb_armor3", TRUE); + precache_pic("gfx/disc", TRUE); + + precache_pic("gfx/sb_shells", TRUE); + precache_pic("gfx/sb_nails", TRUE); + precache_pic("gfx/sb_rocket", TRUE); + precache_pic("gfx/sb_cells", TRUE); + + precache_pic("gfx/sb_key1", TRUE); + precache_pic("gfx/sb_key2", TRUE); + precache_pic("gfx/sb_invis", TRUE); + precache_pic("gfx/sb_invuln", TRUE); + precache_pic("gfx/sb_suit", TRUE); + precache_pic("gfx/sb_quad", TRUE); + + precache_pic("gfx/sb_sigil1", TRUE); + precache_pic("gfx/sb_sigil2", TRUE); + precache_pic("gfx/sb_sigil3", TRUE); + precache_pic("gfx/sb_sigil4", TRUE); + + for (i = 0; i < weaponnames.length; i++) + { + precache_pic(strcat("gfx/inv_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inv2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva1_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva3_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva4_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva5_", weaponnames[i]), TRUE); + } + for (i = 0; i < facetab.length; i++) + precache_pic(facetab[i], TRUE); +}; + + + + +static void(vector pos, float value, float threshhold) Hud_DrawLargeValue = +{ + float c; + float len; + string s; + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 24 * (3-len); + + + if (value <= threshhold) + { //use alternate (red) numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', anumber[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } + else + { //use normal numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', number[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } +}; + +static void(float type, vector pos, float drawback) Hud_DrawAmmoCount = +{ + string s; + float value; + float len; + float c; + value = getstatf(STAT_SHELLS+type); + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + if (drawback) + { + drawsubpic(pos, '42 11', "gfx/ibar", [(3.0/320)+type*(48.0/320), 0], [42.0/320, 11.0/24], '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + pos_x += 8; + } + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 8 * (3-len); + while(len>0) + { + len--; + c = str2chr(s, len); + drawcharacter(pos+len * '8 0 0', (18-'0') + c, '8 8 0', '1 1 1', 1, 0); + } +}; + +static void(float num, vector pos) Hud_DrawWeapon = +{ + string prefix; + float flash = (time - flashtime[num])*10; + if (flash >= 10) + { + if (sweapon == (1<<num)) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + + drawpic(pos, strcat(prefix, weaponnames[num]), '24 16 0', '1 1 1', 1, 0); +}; +static void(float num, float lflashtime, float iscurrent, vector pos, float drawwidth, float imgwidth) Hud_DrawWeaponEx = +{ + string prefix; + float flash = (time - lflashtime)*10; + if (flash >= 10) + { + if (iscurrent) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + drawsubpic(pos, [drawwidth, 16], strcat(prefix, weaponnames[num]), '0 0 0', [drawwidth/imgwidth, 1], '1 1 1', 1, 0); +}; + +static string(float f, float chars, string lead) FormatFloat +{ + string s = ftos(f); + if (f < 10 && chars >= 3) + s = strcat(lead, lead, s); + else if (f < 10 && chars == 2) + s = strcat(lead, s); + else if (f < 100 && chars >= 3) + s = strcat(lead, s); + return s; +}; + +static void(vector pos) Hud_CoopScores_SBar = +{ + string s; + float nsecs; + float nmins; + vector sbar = pos; + drawpic(sbar, "gfx/scorebar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + s = strcat("Monsters:", FormatFloat(getstatf(STAT_KILLEDMONSTERS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALMONSTERS), 3, " ")); + drawstring(sbar + '8 4', s, '8 8 0', '1 1 1', 1, 0); + s = strcat("Secrets :", FormatFloat(getstatf(STAT_FOUNDSECRETS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALSECRETS), 3, " ")); + drawstring(sbar + '8 12', s, '8 8 0', '1 1 1', 1, 0); + + nmins = floor(time/60); + nsecs = floor(time - nmins*60); + s = strcat("Time :", FormatFloat(nmins, 3, " "), ":", FormatFloat(nsecs, 2, "0")); + drawstring(sbar + '184 4', s, '8 8 0', '1 1 1', 1, 0); + + drawstring(sbar + '232 12' - strlen(world.message)*'4 0', world.message, '8 8 0', '1 1 1', 1, 0); +}; + +static void Hud_PicOrModel(vector topleft, string pic, string showmodel, float showskin, float speed) +{ + vector sz = '24 24'; +#ifdef DP_QC_RENDER_SCENE //requires fteextensions.qc instead of qsextensions.qc + if (autocvar(cl_sbar, 1) >= 3) + if (checkextension("DP_QC_RENDER_SCENE")) + { + //reset view props and wipe entity lists + clearscene(); + + //set up the various view details, set up the renderer to be a little larger than the intended size... it avoids harsh cuts. + setviewprop(VF_MIN, topleft - sz); + setviewprop(VF_SIZE, sz * 3); + setviewprop(VF_DRAWENGINESBAR, FALSE); + setviewprop(VF_DRAWCROSSHAIR, FALSE); + setviewprop(VF_DRAWWORLD, FALSE); + setviewprop(VF_AFOV, 30); //a small fov reduces perspective distortions without making it look like its isometric. + setviewprop(VF_ANGLES, '15 0 0'); //angle downwards slightly + makevectors('15 0 0'); + setviewprop(VF_ORIGIN, v_forward*-256); //and move the camera away so that we can position the model at the center without needing to worry about the tilt. + + //spawn a (reusable) entity for our scene + static entity hudpicent; + if (!hudpicent) + hudpicent = spawn(); + precache_model(showmodel); + setmodel(hudpicent, showmodel); + hudpicent.angles_y = cltime*speed; + hudpicent.skin = showskin; + makevectors(hudpicent.angles); + //make sure its centered + vector org = (hudpicent.maxs+hudpicent.mins)*0.5; + setorigin(hudpicent, - v_forward*org_x + v_right*org_y - v_up*org_z); + //and now copy it into the scene + addentity(hudpicent); + + //and ask the engine to actually draw that single-entity scene. Think of this as a drawpic call. + renderscene(); + + return; + } +#endif + drawpic(topleft, pic, '24 24 0', '1 1 1', 1, 0); +}; + +static void Hud_DrawFace(vector pos) +{ + string face; + if (sitems & IT_INVISIBILITY) + { //invis can go first, because its the most obvious image difference. + if (sitems & IT_INVULNERABILITY) + face = facetab[10]; //special double-powerup image! + else + face = facetab[12]; + } + else if (sitems & IT_QUAD) + face = facetab[11]; + else if (sitems & IT_INVULNERABILITY) + face = facetab[13]; + else + { + float frame = shealth/20; + if (frame < 0) + frame = 0; + else if (frame > 4) + frame = 4; + if (painfinishtime > time) + frame += 5; //pain. + face = facetab[frame]; + } + + if (shealth > 100) + Hud_PicOrModel(pos, face, "maps/b_bh100.bsp", 0, -90); + else if (shealth > 50) + Hud_PicOrModel(pos, face, "maps/b_bh25.bsp", 0, -90); + else + Hud_PicOrModel(pos, face, "maps/b_bh10.bsp", 0, -90); +}; + + +static void Hud_DrawSBar(vector pos, vector virtsize) +{ + if (autocvar(cl_sbar, 1) >= 2) + { //n64-style + pos = [0, virtsize_y-24]; + Hud_DrawFace(pos+[3*24,0]); + Hud_DrawLargeValue(pos, shealth, 25); + + if (sitems & (IT_INVULNERABILITY|IT_ARMOR1|IT_ARMOR2|IT_ARMOR3)) + { + pos_y -= 24; + if (sitems & IT_INVULNERABILITY) + Hud_DrawLargeValue(pos, 999, 25); + else + Hud_DrawLargeValue(pos, getstatf(STAT_ARMOR), 25); + pos+=[3*24,0]; + if (sitems & IT_INVULNERABILITY) + Hud_PicOrModel(pos, "gfx/disc", "progs/invulner.mdl", 0, 70); + else if (sitems & IT_ARMOR3) + Hud_PicOrModel(pos, "gfx/sb_armor3", "progs/armor.mdl", 2, 70); + else if (sitems & IT_ARMOR2) + Hud_PicOrModel(pos, "gfx/sb_armor2", "progs/armor.mdl", 1, 70); + else if (sitems & IT_ARMOR1) + Hud_PicOrModel(pos, "gfx/sb_armor1", "progs/armor.mdl", 0, 70); + } + + pos = virtsize - [24,24]; + if (sitems & IT_SHELLS) + Hud_PicOrModel(pos, "gfx/sb_shells", "maps/b_shell1.bsp", 0, 80); + else if (sitems & IT_NAILS) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_nail1.bsp", 0, 80); + else if (sitems & IT_ROCKETS) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_rock1.bsp", 0, 80); + else if (sitems & IT_CELLS) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_batt1.bsp", 0, 80); + Hud_DrawLargeValue(pos-[24*3], getstatf(STAT_AMMO), 10); + return; + } + + if (autocvar(cl_sbar, 1)) + drawpic(pos, "gfx/sbar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_INVULNERABILITY) + { + drawpic(pos, "gfx/disc", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'24 0 0', 999, 25); + } + else + { + Hud_DrawLargeValue(pos+'24 0 0', getstatf(STAT_ARMOR), 25); + if (sitems & IT_ARMOR3) + drawpic(pos, "gfx/sb_armor3", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR2) + drawpic(pos, "gfx/sb_armor2", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR1) + drawpic(pos, "gfx/sb_armor1", '24 24 0', '1 1 1', 1, 0); + } + + + Hud_DrawFace(pos+'112 0 0'); + Hud_DrawLargeValue(pos+'136 0 0', shealth, 25); + + if (sitems & IT_SHELLS) + drawpic(pos+'224 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_NAILS) + drawpic(pos+'224 0 0', "gfx/sb_nails", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ROCKETS) + drawpic(pos+'224 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_CELLS) + drawpic(pos+'224 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'248 0 0', getstatf(STAT_AMMO), 10); +}; + +static void Hud_DrawIBar(vector pos, vector br) +{ + if (!autocvar(cl_sbar, 1) || autocvar(cl_sbar, 1) >= 2) + { //qw puts its ammo+weapons on the side. mimic that. + vector pos2, pos3; + const float hheight = (WEAPONICONS*16)+(11*4); + pos2 = [0, br_y-48, 0]; + if (pos2_y < hheight) + pos2_y = hheight; + if (autocvar(cl_hudswap, 0)) + pos3 = pos2 + [0,-44]; //hudswap puts it on the left + else + { //otherwise align to the right edge + pos2_x += br_x-42; + pos3 = pos2 + [42-24,-44]; + } + if (autocvar(cl_sbar, 1) >= 2) + { + pos3_y = 0; //n64-style hud puts them at the top, apparently. + pos_x = br_x-320; //align any keys+powerups as though the hud was aligned to the right. + if (pos2_y < hheight) + pos2_y = hheight; + } + else pos3_y -= WEAPONICONS*16; + Hud_DrawAmmoCount(0, pos2 + '0 -44', TRUE); + Hud_DrawAmmoCount(1, pos2 + '0 -33', TRUE); + Hud_DrawAmmoCount(2, pos2 + '0 -22', TRUE); + Hud_DrawAmmoCount(3, pos2 + '0 -11', TRUE); + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos3+[0,16*0]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos3+[0,16*1]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos3+[0,16*2]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos3+[0,16*3]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos3+[0,16*4]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos3+[0,16*5]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + } + else + { //standard nq sbar + drawpic(pos, "gfx/ibar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos+[24*0,8]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos+[24*1,8]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos+[24*2,8]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos+[24*3,8]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos+[24*4,8]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos+[24*5,8]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos+[24*6,8], LIGHTNING_WIDTH, LIGHTNING_WIDTH); + + Hud_DrawAmmoCount(0, pos + '10 0 0', FALSE); + Hud_DrawAmmoCount(1, pos + '58 0 0', FALSE); + Hud_DrawAmmoCount(2, pos + '106 0 0', FALSE); + Hud_DrawAmmoCount(3, pos + '154 0 0', FALSE); + } + + if (sitems & IT_KEY1) + drawpic(pos+'192 8 0', "gfx/sb_key1", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_KEY2) + drawpic(pos+'208 8 0', "gfx/sb_key2", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVISIBILITY) + drawpic(pos+'224 8 0', "gfx/sb_invis", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVULNERABILITY) + drawpic(pos+'240 8 0', "gfx/sb_invuln", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_SUIT) + drawpic(pos+'256 8 0', "gfx/sb_suit", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_QUAD) + drawpic(pos+'272 8 0', "gfx/sb_quad", '16 16 0', '1 1 1', 1, 0); + + if (sitems2 & IT2_RUNE1) + drawpic(pos+'288 8 0', "gfx/sb_sigil1", '8 16 0', '1 1 1', 1, 0); + if (sitems2 & IT2_RUNE2) + drawpic(pos+'296 8 0', "gfx/sb_sigil2", '8 16 0', '1 1 1', 1, 0); + if (sitems2 & IT2_RUNE3) + drawpic(pos+'304 8 0', "gfx/sb_sigil3", '8 16 0', '1 1 1', 1, 0); + if (sitems2 & IT2_RUNE4) + drawpic(pos+'312 8 0', "gfx/sb_sigil4", '8 16 0', '1 1 1', 1, 0); + + if (deathmatch) + { //should probably show team scores, but this mimics vanilla + pos_x += 194; + for (float i = -1; i >= -4; i--) + { + string frags = getplayerkeyvalue(i, "frags"); + if not (frags) + break; + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + drawfill(pos+[0,1], [28,3], top, 0.75, 0); + drawfill(pos+[0,4], [28,4], bot, 0.75, 0); + drawstring(pos+[2,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { + drawcharacter(pos+[-4,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[24,0], 0xe011, [8,8], [1,1,1],1, 0); + } + pos_x += 8*4; + } + } +}; + +float numclientseats; +static void Hud_Draw(vector virtsize, float scoreboard) +{ + vector pos; + float oitems = sitems; + float oitems2 = sitems2; + float ohealth = shealth; + + pos_x = (virtsize_x-320)/2; + pos_y = virtsize_y; + + sitems = getstatbits(STAT_ITEMS, 0, 23); //note that we could use getstati to read the items stat, but it'd degrade when then cast to a float, and QSS+DP don't support ints, so we have to use two floats. + sitems2 = getstatbits(STAT_ITEMS, 23, 9); + sweapon = getstatf(STAT_ACTIVEWEAPON); + shealth = getstatf(STAT_HEALTH); + //note that ssqc can provide custom stats, eg: clientstat(STAT_USER+n, EV_FLOAT, items3); can then be read by us with float items3 = getstatf(STAT_USER+n); + + if (shealth <= 0) + scoreboard = TRUE; + + if (numclientseats <= 1) + { //note that we only track one player's stats. with splitscreen we need to stop looking for changes otherwise we'd see them all the time. + if (ohealth && sitems != oitems) + { + for (float f = 0; f < 7; f++) + { + if ((sitems & (1<<f)) && !(oitems & (1<<f))) + flashtime[f] = time; + } + } + } + + if (autocvar(viewsize, 100) < 120) + { + if (scoreboard) + Hud_CoopScores_SBar(pos - '0 24 0'); + else + Hud_DrawSBar(pos - '0 24 0', virtsize); + + if (autocvar(viewsize, 100) < 110) + Hud_DrawIBar(pos - '0 48 0', virtsize); + } +}; + +//lame entry point, just so that we know when damage was taken +float(float save, float take, vector dir) CSQC_Parse_Damage = +{ + if (numclientseats <= 1) + painfinishtime = time + 0.2; + return FALSE; //let the engine handle any red tints etc +}; + +//Hud entry point! +//showscores is set if +scores is held (check health yourself). +void(vector virtsize, float showscores) CSQC_DrawHud = +{ + Hud_Draw(virtsize, showscores); +}; + +void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + Hud_Init(); +}; + diff --git a/QC_other/QC_keep/csqc/csqc_hud_vanilla.qc.orig b/QC_other/QC_keep/csqc/csqc_hud_vanilla.qc.orig new file mode 100644 index 00000000..f6ee2444 --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_hud_vanilla.qc.orig @@ -0,0 +1,679 @@ +// This file implements NQ, QW, and N64-style huds in csqc. Its meant to be complete, while not otherwise being that different. +// The hud layout+items used are specific to vanilla Quake. For the mission packs, you should use the appropriate alternative huds. +// +// The entry points are at the bottom of the file. +// You can just add this file (and fteextensions.qc or qsextensions.qc) into any mod and then just adapt it as desired. +// +// Note that it doesn't understand viewsizes all that well, but no worse than eg scr_sbaralpha<1 in QS (its default). (this keeps the api spec simpler.) +// the 'simple csqc' api means that this file (and api defs) is all you need for a hud, and can be directly embedded into a regular nq progs.dat, if needed. +// +// I have made attempts to avoid copying the engine code, however I will not be held liable if there's any GPL contagion. +// There is otherwise no license for the code in this file. + + +/*autocvars: + cl_sbar: alternative layouts (sorry for this complication, but mneh). + 0: QuakeWorld style hud + 1: Vanilla style hud + 2: n64-style hud + 3: n64-style with meshes instead of models, where supported. + cl_hudswap: QW/n64 ammo+weapons are on the + 0: right + 1: left + scr_sbaralpha: opacity of backgroundy elements +*/ + +// items. FIXME: you should share these with your ssqc... +/* +float IT_SHOTGUN = 1<<0; +float IT_SUPER_SHOTGUN = 1<<1; +float IT_NAILGUN = 1<<2; +float IT_SUPER_NAILGUN = 1<<3; +float IT_GRENADE_LAUNCHER = 1<<4; +float IT_ROCKET_LAUNCHER = 1<<5; +float IT_LIGHTNING = 1<<6; + +//float IT_EXTRA_WEAPON = 1<<7; + +float IT_SHELLS = 1<<8; +float IT_NAILS = 1<<9; +float IT_ROCKETS = 1<<10; +float IT_CELLS = 1<<11; +float IT_AXE = 1<<12; + +float IT_ARMOR1 = 1<<13; +float IT_ARMOR2 = 1<<14; +float IT_ARMOR3 = 1<<15; +//float IT_SUPERHEALTH = 1<<16; + +float IT_KEY1 = 1<<17; +float IT_KEY2 = 1<<18; +float IT_INVISIBILITY = 1<<19; +float IT_INVULNERABILITY = 1<<20; +float IT_SUIT = 1<<21; +float IT_QUAD = 1<<22; + +float IT2_RUNE1 = 1<<5; +float IT2_RUNE2 = 1<<6; +float IT2_RUNE3 = 1<<7; +float IT2_RUNE4 = 1<<8; +*/ +//=======================================SELF.ITEMS1====================================================== +float IT_SHOTGUN = 1.000; //Correct for standard HUD & HIP & DOE W +float IT_SUPER_SHOTGUN = 2.000; //Correct for standard HUD & HIP & DOE W +float IT_NAILGUN = 4.000; //Correct for standard HUD & HIP & DOE W +float IT_SUPER_NAILGUN = 8.000; //Correct for standard HUD & HIP & DOE W +float IT_GRENADE_LAUNCHER = 16.000; //Correct for standard HUD & HIP & DOE W +float IT_ROCKET_LAUNCHER = 32.000; //Correct for standard HUD & HIP & DOE W +float IT_LIGHTNING = 64.000; //Correct for standard HUD & HIP & DOE W +float IT_SHELLS = 128.000; //Correct for DOE HUD I +float IT_NAILS = 256.000; //Correct for DOE HUD I +float IT_ROCKETS = 512.000; //Correct for DOE HUD I +float IT_CELLS = 1024.000; //Correct for DOE HUD I +float IT_AXE = 2048.000; //Correct for DOE HUD W +float IT_LAVA_NAILGUN = 4096.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_LAVA_SUPER_NAILGUN = 8192.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_MULTI_GRENADE = 16384.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_MULTI_ROCKET = 32768.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_PLASMA_GUN = 65536.000; //Correct for DOE HUD W +float IT_KEY1 = 131072.000; //Correct for standard HUD & HIP & DOE I +float IT_KEY2 = 262144.000; //Correct for standard HUD & HIP & DOE I +float IT_INVISIBILITY = 524288.000; //Correct for standard HUD & HIP & DOE I +float IT_INVULNERABILITY = 1048576.000; //Correct for standard HUD & HIP & DOE I +float IT_SUIT = 2097152.000; //Correct for standard HUD & HIP & DOE I +float IT_QUAD = 4194304.000; //Correct for standard HUD & HIP & DOE I +float IT_EXTRA_WEAPON = 8388608.000; //Correct for DOE HUD W +//=======================================SELF.ITEMS2====================================================== +float IT2_ARMOR1 = 1.000; //Correct for DOE HUD I +float IT2_ARMOR2 = 2.000; //Correct for DOE HUD I +float IT2_ARMOR3 = 4.000; //Correct for DOE HUD I +float IT2_LAVA_NAILS = 8.000; //Correct for DOE HUD I +float IT2_PLASMA_AMMO = 16.000; //Correct for DOE HUD I +float IT2_MULTI_ROCKETS = 32.000; //Correct for DOE HUD I +float IT2_SHIELD = 64.000; //Correct for DOE HUD I +float IT2_CHAINLIGHTNING = 128.000; //Zerstorer chain lightning W (I Antigrav for DOE HUD) +float IT2_SUPERHEALTH = 256.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_EARTHQUAKE = 512.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_V_SPHERE = 1024.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_BOLTS = 2048.000; //Keep specific I +float IT2_POISON = 4096.000; //EMTPY SLOT I +float HIP_IT2_WETSUIT = 8192.000; //Keep specific (modified from HIP) I +float HIP_IT2_EMPATHY_SHIELDS = 16384.000; //Keep specific (modified from HIP) I +float HIP_IT2_HORN_OF_CONJURING = 32768.000; //Keep specific (modified from HIP) I + //= 65536.000; EMPTY SLOT (skipped...same as IT_PLASMA_GUN) I +float IT2_PROXIMITY_GUN = 131072.000; //Keep specific.Unique number for self.weapon calls W +float IT2_MJOLNIR = 262144.000; //Keep specific "" W +float IT2_LASER_CANNON = 524288.000; //Keep specific "" W +float IT2_GRAPPLE = 1048576.000; //Keep specific "" W Rogue grapple +float IT2_TRINITY = 2097152.000; //Quoth +float IT2_CROSS = 4194304.000; //Quoth (available for a new weapon) + //= 8388608.000; EMPTY SLOT +//======================================================================================================== + +//wad image names in array form, for easier access. +static string number[10] = { + "gfx/num_0", + "gfx/num_1", + "gfx/num_2", + "gfx/num_3", + "gfx/num_4", + "gfx/num_5", + "gfx/num_6", + "gfx/num_7", + "gfx/num_8", + "gfx/num_9" +}; +static string anumber[10] = { + "gfx/anum_0", + "gfx/anum_1", + "gfx/anum_2", + "gfx/anum_3", + "gfx/anum_4", + "gfx/anum_5", + "gfx/anum_6", + "gfx/anum_7", + "gfx/anum_8", + "gfx/anum_9" +}; +static string weaponnames[] = { + "shotgun", + "sshotgun", + "nailgun", + "snailgun", + "rlaunch", + "srlaunch", + "lightng", +#define WEAPONICONS 7 +#define LIGHTNING_WIDTH 48 +}; +static string facetab[] = { + "gfx/face5", "gfx/face4", "gfx/face3", "gfx/face2", "gfx/face1", + "gfx/face_p5", "gfx/face_p4", "gfx/face_p3", "gfx/face_p2", "gfx/face_p1", + "gfx/face_inv2", "gfx/face_quad", "gfx/face_invis", "gfx/face_invul2" +}; + + + +//copies of stats, for easier access +static float sitems; //copy of .items +static float sitems2; //copy of .items2 (or serverflags) +static float sweapon; //copy of .weapon +static float shealth; //copy of .health + +//Note: these are not tracked for splitscreen, which limits them to one player. We're lazy and just don't update them. +static float flashtime[WEAPONICONS]; //tracks the time that various items were obtained, so we can flash stuff accordingly. +static float painfinishtime;//tracks when we took damage, for flinching. + + +//registers the various pics so they're ready as needed. +static void() Hud_Init +{ + float i; + precache_pic("gfx/sbar", TRUE); + precache_pic("gfx/ibar", TRUE); + for (i = 0; i < 10; i++) + { + precache_pic(number[i], TRUE); + precache_pic(anumber[i], TRUE); + } + + precache_pic("gfx/sb_armor1", TRUE); + precache_pic("gfx/sb_armor2", TRUE); + precache_pic("gfx/sb_armor3", TRUE); + precache_pic("gfx/disc", TRUE); + + precache_pic("gfx/sb_shells", TRUE); + precache_pic("gfx/sb_nails", TRUE); + precache_pic("gfx/sb_rocket", TRUE); + precache_pic("gfx/sb_cells", TRUE); + + precache_pic("gfx/sb_key1", TRUE); + precache_pic("gfx/sb_key2", TRUE); + precache_pic("gfx/sb_invis", TRUE); + precache_pic("gfx/sb_invuln", TRUE); + precache_pic("gfx/sb_suit", TRUE); + precache_pic("gfx/sb_quad", TRUE); + + precache_pic("gfx/sb_sigil1", TRUE); + precache_pic("gfx/sb_sigil2", TRUE); + precache_pic("gfx/sb_sigil3", TRUE); + precache_pic("gfx/sb_sigil4", TRUE); + + for (i = 0; i < weaponnames.length; i++) + { + precache_pic(strcat("gfx/inv_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inv2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva1_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva2_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva3_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva4_", weaponnames[i]), TRUE); + precache_pic(strcat("gfx/inva5_", weaponnames[i]), TRUE); + } + for (i = 0; i < facetab.length; i++) + precache_pic(facetab[i], TRUE); +}; + + + + +static void(vector pos, float value, float threshhold) Hud_DrawLargeValue = +{ + float c; + float len; + string s; + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 24 * (3-len); + + + if (value <= threshhold) + { //use alternate (red) numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', anumber[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } + else + { //use normal numbers + + while(len>0) + { + len--; + c = str2chr(s, len); + + drawpic(pos+len * '24 0 0', number[c-'0'], '24 24 0', '1 1 1', 1, 0); + } + } +}; + +static void(float type, vector pos, float drawback) Hud_DrawAmmoCount = +{ + string s; + float value; + float len; + float c; + value = getstatf(STAT_SHELLS+type); + if (value < 0) + value = 0; //hrm + if (value>999) + value = 999; + + if (drawback) + { + drawsubpic(pos, '42 11', "gfx/ibar", [(3.0/320)+type*(48.0/320), 0], [42.0/320, 11.0/24], '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + pos_x += 8; + } + + s = ftos(floor(value)); + len = strlen(s); + + pos_x += 8 * (3-len); + while(len>0) + { + len--; + c = str2chr(s, len); + drawcharacter(pos+len * '8 0 0', (18-'0') + c, '8 8 0', '1 1 1', 1, 0); + } +}; + +static void(float num, vector pos) Hud_DrawWeapon = +{ + string prefix; + float flash = (time - flashtime[num])*10; + if (flash >= 10) + { + if (sweapon == (1<<num)) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + + drawpic(pos, strcat(prefix, weaponnames[num]), '24 16 0', '1 1 1', 1, 0); +}; +static void(float num, float lflashtime, float iscurrent, vector pos, float drawwidth, float imgwidth) Hud_DrawWeaponEx = +{ + string prefix; + float flash = (time - lflashtime)*10; + if (flash >= 10) + { + if (iscurrent) + prefix = "gfx/inv2_"; + else + prefix = "gfx/inv_"; + } + else + { + static string tab[] = {"gfx/inva1_","gfx/inva2_","gfx/inva3_","gfx/inva4_","gfx/inva5_"}; + if (flash >= 5) + flash -= 5; + prefix = tab[flash]; + } + drawsubpic(pos, [drawwidth, 16], strcat(prefix, weaponnames[num]), '0 0 0', [drawwidth/imgwidth, 1], '1 1 1', 1, 0); +}; + +static string(float f, float chars, string lead) FormatFloat +{ + string s = ftos(f); + if (f < 10 && chars >= 3) + s = strcat(lead, lead, s); + else if (f < 10 && chars == 2) + s = strcat(lead, s); + else if (f < 100 && chars >= 3) + s = strcat(lead, s); + return s; +}; + +static void(vector pos) Hud_CoopScores_SBar = +{ + string s; + float nsecs; + float nmins; + vector sbar = pos; + drawpic(sbar, "gfx/scorebar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + s = strcat("Monsters:", FormatFloat(getstatf(STAT_KILLEDMONSTERS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALMONSTERS), 3, " ")); + drawstring(sbar + '8 4', s, '8 8 0', '1 1 1', 1, 0); + s = strcat("Secrets :", FormatFloat(getstatf(STAT_FOUNDSECRETS), 3, " "), "/", FormatFloat(getstatf(STAT_TOTALSECRETS), 3, " ")); + drawstring(sbar + '8 12', s, '8 8 0', '1 1 1', 1, 0); + + nmins = floor(time/60); + nsecs = floor(time - nmins*60); + s = strcat("Time :", FormatFloat(nmins, 3, " "), ":", FormatFloat(nsecs, 2, "0")); + drawstring(sbar + '184 4', s, '8 8 0', '1 1 1', 1, 0); + + drawstring(sbar + '232 12' - strlen(world.message)*'4 0', world.message, '8 8 0', '1 1 1', 1, 0); +}; + +static void Hud_PicOrModel(vector topleft, string pic, string showmodel, float showskin, float speed) +{ + vector sz = '24 24'; +#ifdef DP_QC_RENDER_SCENE //requires fteextensions.qc instead of qsextensions.qc + if (autocvar(cl_sbar, 1) >= 3) + if (checkextension("DP_QC_RENDER_SCENE")) + { + //reset view props and wipe entity lists + clearscene(); + + //set up the various view details, set up the renderer to be a little larger than the intended size... it avoids harsh cuts. + setviewprop(VF_MIN, topleft - sz); + setviewprop(VF_SIZE, sz * 3); + setviewprop(VF_DRAWENGINESBAR, FALSE); + setviewprop(VF_DRAWCROSSHAIR, FALSE); + setviewprop(VF_DRAWWORLD, FALSE); + setviewprop(VF_AFOV, 30); //a small fov reduces perspective distortions without making it look like its isometric. + setviewprop(VF_ANGLES, '15 0 0'); //angle downwards slightly + makevectors('15 0 0'); + setviewprop(VF_ORIGIN, v_forward*-256); //and move the camera away so that we can position the model at the center without needing to worry about the tilt. + + //spawn a (reusable) entity for our scene + static entity hudpicent; + if (!hudpicent) + hudpicent = spawn(); + precache_model(showmodel); + setmodel(hudpicent, showmodel); + hudpicent.angles_y = cltime*speed; + hudpicent.skin = showskin; + makevectors(hudpicent.angles); + //make sure its centered + vector org = (hudpicent.maxs+hudpicent.mins)*0.5; + setorigin(hudpicent, - v_forward*org_x + v_right*org_y - v_up*org_z); + //and now copy it into the scene + addentity(hudpicent); + + //and ask the engine to actually draw that single-entity scene. Think of this as a drawpic call. + renderscene(); + + return; + } +#endif + drawpic(topleft, pic, '24 24 0', '1 1 1', 1, 0); +}; + +static void Hud_DrawFace(vector pos) +{ + string face; + if (sitems & IT_INVISIBILITY) + { //invis can go first, because its the most obvious image difference. + if (sitems & IT_INVULNERABILITY) + face = facetab[10]; //special double-powerup image! + else + face = facetab[12]; + } + else if (sitems & IT_QUAD) + face = facetab[11]; + else if (sitems & IT_INVULNERABILITY) + face = facetab[13]; + else + { + float frame = shealth/20; + if (frame < 0) + frame = 0; + else if (frame > 4) + frame = 4; + if (painfinishtime > time) + frame += 5; //pain. + face = facetab[frame]; + } + + if (shealth > 100) + Hud_PicOrModel(pos, face, "maps/b_bh100.bsp", 0, -90); + else if (shealth > 50) + Hud_PicOrModel(pos, face, "maps/b_bh25.bsp", 0, -90); + else + Hud_PicOrModel(pos, face, "maps/b_bh10.bsp", 0, -90); +}; + + +static void Hud_DrawSBar(vector pos, vector virtsize) +{ + if (autocvar(cl_sbar, 1) >= 2) + { //n64-style + pos = [0, virtsize_y-24]; + Hud_DrawFace(pos+[3*24,0]); + Hud_DrawLargeValue(pos, shealth, 25); + + if (sitems & (IT_INVULNERABILITY|IT_ARMOR1|IT_ARMOR2|IT_ARMOR3)) + { + pos_y -= 24; + if (sitems & IT_INVULNERABILITY) + Hud_DrawLargeValue(pos, 999, 25); + else + Hud_DrawLargeValue(pos, getstatf(STAT_ARMOR), 25); + pos+=[3*24,0]; + if (sitems & IT_INVULNERABILITY) + Hud_PicOrModel(pos, "gfx/disc", "progs/invulner.mdl", 0, 70); + else if (sitems & IT_ARMOR3) + Hud_PicOrModel(pos, "gfx/sb_armor3", "progs/armor.mdl", 2, 70); + else if (sitems & IT_ARMOR2) + Hud_PicOrModel(pos, "gfx/sb_armor2", "progs/armor.mdl", 1, 70); + else if (sitems & IT_ARMOR1) + Hud_PicOrModel(pos, "gfx/sb_armor1", "progs/armor.mdl", 0, 70); + } + + pos = virtsize - [24,24]; + if (sitems & IT_SHELLS) + Hud_PicOrModel(pos, "gfx/sb_shells", "maps/b_shell1.bsp", 0, 80); + else if (sitems & IT_NAILS) + Hud_PicOrModel(pos, "gfx/sb_nails", "maps/b_nail1.bsp", 0, 80); + else if (sitems & IT_ROCKETS) + Hud_PicOrModel(pos, "gfx/sb_rocket", "maps/b_rock1.bsp", 0, 80); + else if (sitems & IT_CELLS) + Hud_PicOrModel(pos, "gfx/sb_cells", "maps/b_batt1.bsp", 0, 80); + Hud_DrawLargeValue(pos-[24*3], getstatf(STAT_AMMO), 10); + return; + } + + if (autocvar(cl_sbar, 1)) + drawpic(pos, "gfx/sbar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_INVULNERABILITY) + { + drawpic(pos, "gfx/disc", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'24 0 0', 999, 25); + } + else + { + Hud_DrawLargeValue(pos+'24 0 0', getstatf(STAT_ARMOR), 25); + if (sitems & IT_ARMOR3) + drawpic(pos, "gfx/sb_armor3", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR2) + drawpic(pos, "gfx/sb_armor2", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ARMOR1) + drawpic(pos, "gfx/sb_armor1", '24 24 0', '1 1 1', 1, 0); + } + + + Hud_DrawFace(pos+'112 0 0'); + Hud_DrawLargeValue(pos+'136 0 0', shealth, 25); + + if (sitems & IT_SHELLS) + drawpic(pos+'224 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_NAILS) + drawpic(pos+'224 0 0', "gfx/sb_nails", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_ROCKETS) + drawpic(pos+'224 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', 1, 0); + else if (sitems & IT_CELLS) + drawpic(pos+'224 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', 1, 0); + Hud_DrawLargeValue(pos+'248 0 0', getstatf(STAT_AMMO), 10); +}; + +static void Hud_DrawIBar(vector pos, vector br) +{ + if (!autocvar(cl_sbar, 1) || autocvar(cl_sbar, 1) >= 2) + { //qw puts its ammo+weapons on the side. mimic that. + vector pos2, pos3; + const float hheight = (WEAPONICONS*16)+(11*4); + pos2 = [0, br_y-48, 0]; + if (pos2_y < hheight) + pos2_y = hheight; + if (autocvar(cl_hudswap, 0)) + pos3 = pos2 + [0,-44]; //hudswap puts it on the left + else + { //otherwise align to the right edge + pos2_x += br_x-42; + pos3 = pos2 + [42-24,-44]; + } + if (autocvar(cl_sbar, 1) >= 2) + { + pos3_y = 0; //n64-style hud puts them at the top, apparently. + pos_x = br_x-320; //align any keys+powerups as though the hud was aligned to the right. + if (pos2_y < hheight) + pos2_y = hheight; + } + else pos3_y -= WEAPONICONS*16; + Hud_DrawAmmoCount(0, pos2 + '0 -44', TRUE); + Hud_DrawAmmoCount(1, pos2 + '0 -33', TRUE); + Hud_DrawAmmoCount(2, pos2 + '0 -22', TRUE); + Hud_DrawAmmoCount(3, pos2 + '0 -11', TRUE); + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos3+[0,16*0]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos3+[0,16*1]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos3+[0,16*2]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos3+[0,16*3]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos3+[0,16*4]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos3+[0,16*5]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos3+[0,16*6], 24, LIGHTNING_WIDTH); + } + else + { //standard nq sbar + drawpic(pos, "gfx/ibar", '320 24 0', '1 1 1', autocvar(scr_sbaralpha, 0.75), 0); + + if (sitems & IT_SHOTGUN) Hud_DrawWeapon(0, pos+[24*0,8]); + if (sitems & IT_SUPER_SHOTGUN) Hud_DrawWeapon(1, pos+[24*1,8]); + if (sitems & IT_NAILGUN) Hud_DrawWeapon(2, pos+[24*2,8]); + if (sitems & IT_SUPER_NAILGUN) Hud_DrawWeapon(3, pos+[24*3,8]); + if (sitems & IT_GRENADE_LAUNCHER) Hud_DrawWeapon(4, pos+[24*4,8]); + if (sitems & IT_ROCKET_LAUNCHER) Hud_DrawWeapon(5, pos+[24*5,8]); + if (sitems & IT_LIGHTNING) Hud_DrawWeaponEx(6, flashtime[6], sweapon==IT_LIGHTNING, pos+[24*6,8], LIGHTNING_WIDTH, LIGHTNING_WIDTH); + + Hud_DrawAmmoCount(0, pos + '10 0 0', FALSE); + Hud_DrawAmmoCount(1, pos + '58 0 0', FALSE); + Hud_DrawAmmoCount(2, pos + '106 0 0', FALSE); + Hud_DrawAmmoCount(3, pos + '154 0 0', FALSE); + } + + if (sitems & IT_KEY1) + drawpic(pos+'192 8 0', "gfx/sb_key1", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_KEY2) + drawpic(pos+'208 8 0', "gfx/sb_key2", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVISIBILITY) + drawpic(pos+'224 8 0', "gfx/sb_invis", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_INVULNERABILITY) + drawpic(pos+'240 8 0', "gfx/sb_invuln", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_SUIT) + drawpic(pos+'256 8 0', "gfx/sb_suit", '16 16 0', '1 1 1', 1, 0); + if (sitems & IT_QUAD) + drawpic(pos+'272 8 0', "gfx/sb_quad", '16 16 0', '1 1 1', 1, 0); + + if (sitems2 & IT2_RUNE1) + drawpic(pos+'288 8 0', "gfx/sb_sigil1", '8 16 0', '1 1 1', 1, 0); + if (sitems2 & IT2_RUNE2) + drawpic(pos+'296 8 0', "gfx/sb_sigil2", '8 16 0', '1 1 1', 1, 0); + if (sitems2 & IT2_RUNE3) + drawpic(pos+'304 8 0', "gfx/sb_sigil3", '8 16 0', '1 1 1', 1, 0); + if (sitems2 & IT2_RUNE4) + drawpic(pos+'312 8 0', "gfx/sb_sigil4", '8 16 0', '1 1 1', 1, 0); + + if (deathmatch) + { //should probably show team scores, but this mimics vanilla + pos_x += 194; + for (float i = -1; i >= -4; i--) + { + string frags = getplayerkeyvalue(i, "frags"); + if not (frags) + break; + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + drawfill(pos+[0,1], [28,3], top, 0.75, 0); + drawfill(pos+[0,4], [28,4], bot, 0.75, 0); + drawstring(pos+[2,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { + drawcharacter(pos+[-4,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[24,0], 0xe011, [8,8], [1,1,1],1, 0); + } + pos_x += 8*4; + } + } +}; + +float numclientseats; +static void Hud_Draw(vector virtsize, float scoreboard) +{ + vector pos; + float oitems = sitems; + float oitems2 = sitems2; + float ohealth = shealth; + + pos_x = (virtsize_x-320)/2; + pos_y = virtsize_y; + + sitems = getstatbits(STAT_ITEMS, 0, 23); //note that we could use getstati to read the items stat, but it'd degrade when then cast to a float, and QSS+DP don't support ints, so we have to use two floats. + sitems2 = getstatbits(STAT_ITEMS, 23, 9); + sweapon = getstatf(STAT_ACTIVEWEAPON); + shealth = getstatf(STAT_HEALTH); + //note that ssqc can provide custom stats, eg: clientstat(STAT_USER+n, EV_FLOAT, items3); can then be read by us with float items3 = getstatf(STAT_USER+n); + + if (shealth <= 0) + scoreboard = TRUE; + + if (numclientseats <= 1) + { //note that we only track one player's stats. with splitscreen we need to stop looking for changes otherwise we'd see them all the time. + if (ohealth && sitems != oitems) + { + for (float f = 0; f < 7; f++) + { + if ((sitems & (1<<f)) && !(oitems & (1<<f))) + flashtime[f] = time; + } + } + } + + if (autocvar(viewsize, 100) < 120) + { + if (scoreboard) + Hud_CoopScores_SBar(pos - '0 24 0'); + else + Hud_DrawSBar(pos - '0 24 0', virtsize); + + if (autocvar(viewsize, 100) < 110) + Hud_DrawIBar(pos - '0 48 0', virtsize); + } +}; + +//lame entry point, just so that we know when damage was taken +float(float save, float take, vector dir) CSQC_Parse_Damage = +{ + if (numclientseats <= 1) + painfinishtime = time + 0.2; + return FALSE; //let the engine handle any red tints etc +}; + +//Hud entry point! +//showscores is set if +scores is held (check health yourself). +void(vector virtsize, float showscores) CSQC_DrawHud = +{ + Hud_Draw(virtsize, showscores); +}; + +void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + Hud_Init(); +}; + diff --git a/QC_other/QC_keep/csqc/csqc_legacycompat.qc b/QC_other/QC_keep/csqc/csqc_legacycompat.qc new file mode 100644 index 00000000..27d2c61b --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_legacycompat.qc @@ -0,0 +1,102 @@ +//This file isn't needed for the simple-csqc API. +//However, old versions of FTE, DP, or RMQe don't support the simple-csqc API, so this provides entry points that match the older API so that these older versions can use our new hud too. + +static float dp_fuckedsizes; //true for DP, false for FTE +static float sb_showscores; //magic name in DP + + + +//to avoid large extensions files, these are the minimum extra things needed for both dp+fte. +void() clearscene = #300; +void(float mask) addentities = #301; +float(float property, ...) setproperty = #303; +void() renderscene = #304; +const float MASK_ENGINE = 1; +const float MASK_VIEWMODEL = 2; +const float VF_MIN = 1; +const float VF_SIZE = 4; +const float VF_DRAWENGINESBAR = 20; +const float VF_DRAWCROSSHAIR = 21; + + + +void(float vwidth, float vheight, float notmenu) CSQC_UpdateView = +{ + vector ssize = [vwidth, vheight]; + clearscene(); + addentities(MASK_ENGINE|MASK_VIEWMODEL); + setproperty(VF_MIN, '0 0'); //otherwise DP bugs out if viewsize < 100 + setproperty(VF_SIZE, ssize); //otherwise DP bugs out if viewsize < 100 + setproperty(VF_DRAWENGINESBAR, FALSE); //we have our own hud. that's the whole point of this. + setproperty(VF_DRAWCROSSHAIR, TRUE); + renderscene(); + + if (dp_fuckedsizes) + { + //Yes, we got told the size to use. + //but apparently that's not enough. + //reading these cvars means that we're screwed if either is set to 0 (to mean 'maintain aspect') + //ideally one of these will ALWAYS be 0, so yeah, expect fucked aspects in DP. Its been like this for YEARS. + ssize_x = cvar("vid_conwidth"); + ssize_y = cvar("vid_conheight"); + } + + if (!intermission) + intermission_time = time; //make a guess at the intermission time... + deathmatch = stof(serverkey("deathmatch")); + coop = !deathmatch && maxclients > 1; + + CSQC_DrawHud(ssize, sb_showscores); + CSQC_DrawScores(ssize, sb_showscores); +}; + +//The following functions are just stubs, because DP INSISTS that they exist. +//Note that they might have been defined elsewhere already, but in case they were not, fteqcc's weak references to the rescue! +__weak float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent = +{ + return FALSE; +}; +__weak float(string str) CSQC_ConsoleCommand = +{ + tokenize_console(str); + return FALSE; +}; +__weak void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ +} + +//we need to wrap this because its the easiest way to see if its a shitty old engine. +//and if its shitty then we can reliably assume that its DP. +__wrap void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + if (!apilevel && !enginename && !engineversion) + { + dp_fuckedsizes = TRUE; //shitty engine + dprint("Assuming DP fuckage\n"); + } + prior(apilevel, enginename, engineversion); + + registercommand("+showscores"); + registercommand("+showscores"); + registercommand("+showteamscores"); + registercommand("+showteamscores"); +}; + +//but we need to figure out when +showscores etc are pressed... +__wrap float(string str) CSQC_ConsoleCommand = +{ + if (prior(str)) + return TRUE; + string c = argv(0); + if (c == "+showscores") + sb_showscores |= 1; + else if (c == "+showteamscores") + sb_showscores |= 2; + else if (c == "-showscores") + sb_showscores &~= 1; + else if (c == "-showteamscores") + sb_showscores &~= 2; + else + return FALSE; + return TRUE; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/csqc/csqc_legacycompat.qc.orig b/QC_other/QC_keep/csqc/csqc_legacycompat.qc.orig new file mode 100644 index 00000000..1ddf7143 --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_legacycompat.qc.orig @@ -0,0 +1,102 @@ +//This file isn't needed for the simple-csqc API. +//However, old versions of FTE, DP, or RMQe don't support the simple-csqc API, so this provides entry points that match the older API so that these older versions can use our new hud too. + +static float dp_fuckedsizes; //true for DP, false for FTE +static float sb_showscores; //magic name in DP + + + +//to avoid large extensions files, these are the minimum extra things needed for both dp+fte. +void() clearscene = #300; +void(float mask) addentities = #301; +float(float property, ...) setproperty = #303; +void() renderscene = #304; +const float MASK_ENGINE = 1; +const float MASK_VIEWMODEL = 2; +const float VF_MIN = 1; +const float VF_SIZE = 4; +const float VF_DRAWENGINESBAR = 20; +const float VF_DRAWCROSSHAIR = 21; + + + +void(float vwidth, float vheight, float notmenu) CSQC_UpdateView = +{ + vector ssize = [vwidth, vheight]; + clearscene(); + addentities(MASK_ENGINE|MASK_VIEWMODEL); + setproperty(VF_MIN, '0 0'); //otherwise DP bugs out if viewsize < 100 + setproperty(VF_SIZE, ssize); //otherwise DP bugs out if viewsize < 100 + setproperty(VF_DRAWENGINESBAR, FALSE); //we have our own hud. that's the whole point of this. + setproperty(VF_DRAWCROSSHAIR, TRUE); + renderscene(); + + if (dp_fuckedsizes) + { + //Yes, we got told the size to use. + //but apparently that's not enough. + //reading these cvars means that we're screwed if either is set to 0 (to mean 'maintain aspect') + //ideally one of these will ALWAYS be 0, so yeah, expect fucked aspects in DP. Its been like this for YEARS. + ssize_x = cvar("vid_conwidth"); + ssize_y = cvar("vid_conheight"); + } + + if (!intermission) + intermission_time = time; //make a guess at the intermission time... + deathmatch = stof(serverkey("deathmatch")); + coop = !deathmatch && maxclients > 1; + + CSQC_DrawHud(ssize, sb_showscores); + CSQC_DrawScores(ssize, sb_showscores); +}; + +//The following functions are just stubs, because DP INSISTS that they exist. +//Note that they might have been defined elsewhere already, but in case they were not, fteqcc's weak references to the rescue! +__weak float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent = +{ + return FALSE; +}; +__weak float(string str) CSQC_ConsoleCommand = +{ + tokenize_console(str); + return FALSE; +}; +__weak void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ +} + +//we need to wrap this because its the easiest way to see if its a shitty old engine. +//and if its shitty then we can reliably assume that its DP. +__wrap void(float apilevel, string enginename, float engineversion) CSQC_Init = +{ + if (!apilevel && !enginename && !engineversion) + { + dp_fuckedsizes = TRUE; //shitty engine + dprint("Assuming DP fuckage\n"); + } + prior(apilevel, enginename, engineversion); + + registercommand("+showscores"); + registercommand("+showscores"); + registercommand("+showteamscores"); + registercommand("+showteamscores"); +}; + +//but we need to figure out when +showscores etc are pressed... +__wrap float(string str) CSQC_ConsoleCommand = +{ + if (prior(str)) + return TRUE; + string c = argv(0); + if (c == "+showscores") + sb_showscores |= 1; + else if (c == "+showteamscores") + sb_showscores |= 2; + else if (c == "-showscores") + sb_showscores &~= 1; + else if (c == "-showteamscores") + sb_showscores &~= 2; + else + return FALSE; + return TRUE; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/csqc/csqc_scoreboard.qc b/QC_other/QC_keep/csqc/csqc_scoreboard.qc new file mode 100644 index 00000000..72e4b7ef --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_scoreboard.qc @@ -0,0 +1,118 @@ +vector(string picname, float height) Hud_AspectSize = +{ + vector sz = drawgetimagesize(picname); + return [sz_x * height/sz_y, height]; +}; +void(string picname, float screenwidth, vector pos, float height) Hud_CentrePic = +{ + vector sz = Hud_AspectSize(picname, height); + pos_x += (screenwidth-sz_x)/2; + drawpic(pos, picname, sz, [1,1,1],1,0); +}; +void(vector virtmin, vector virtsize) Hud_DeathmatchScoreboard = +{ + vector pos = virtmin; + if not (getplayerkeyvalue(-16, "name")) + pos_y += (virtsize_y-200)/2; + + if not (getplayerkeyvalue(-24, "name")) + { //and only draw the header when its not a really big game + pos_y += 8; + Hud_CentrePic("gfx/ranking.lmp", virtsize_x, pos, 24); pos_y += 24; + pos_y += 10; + } + + if (autocvar(cg_woot, 0)) //I added this mostly just to demonstrate that you're actually using the csqc version... + pos_x = (virtsize_x-320)/2 * (1+sin(time)); + else + pos_x += (virtsize_x-320)/2; + + pos_x += 80; + + //negative numbers are players sorted by frags. + for (float i = -1; ; i--, pos_y += 10) + { + string name = getplayerkeyvalue(i, "name"); + if not (name) + break; + float isspec = stof(getplayerkeyvalue(i, "*spectator")); + string frags = getplayerkeyvalue(i, "frags"); + string ping = getplayerkeyvalue(i, "ping"); + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + name = strconv(0,2,2, name); + //FIXME: string team = getplayerkeyvalue(i, "team"); //QW team names do NOT match player colours. + /*Other interesting fields + pl - for packetloss + activetime - how long the player has been on the server. + chat - to check if someone is at the console/tabbed out + userid - for easy banning etc, assuming you're the server. + ignored - text from this player will be dropped clientside. + vignored - voicechat from this player will be dropped (clientside and hopefully serverside too). + voipspeaking- whether they're speaking or not + voiploudness- the player's average voip volume. + also any other networked userinfo + */ + + drawstring(pos-[8*5 ,0], strpad(-4, ping), [8,8], [1,1,1],1,0); + if (isspec) + drawstring(pos+[4,0], "spec", [8,8], [1,1,1],1,0); + else + { + drawfill(pos+[0,0], [40,4], top, 0.75, 0); + drawfill(pos+[0,4], [40,4], bot, 0.75, 0); + drawstring(pos+[8,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { +// drawcharacter(pos-[8,0], 0xe00d, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[ 0,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[32,0], 0xe011, [8,8], [1,1,1],1, 0); + } + } + drawstring(pos+[64,0], name, [8,8], [1,1,1],1,0); + } +}; + +static void(vector pos, string num) Hud_DrawIntermissionNumber = +{ + float i; + float c; + for(i = 0; ; i++, pos_x += 24) + { + c = str2chr(num, i); + if (!c) + break; + if (c == ' ') + continue; + if (c == '/') + drawpic(pos, "gfx/num_slash", [24,24],[1,1,1],1,0); + else if (c == ':' || c == '.') + drawpic(pos, "gfx/num_colon", [24,24],[1,1,1],1,0); + else if (c == '-') + drawpic(pos, "gfx/num_minus", [24,24],[1,1,1],1,0); + else if (c >= '0' && c <= '9') + drawpic(pos, sprintf("gfx/num_%c", c), [24,24],[1,1,1],1,0); + } +}; + +void(vector virtmin, vector virtsize) Hud_Intermission = +{ + vector pos = virtmin + (virtsize-[320,200])/2; + + Hud_CentrePic("gfx/complete.lmp", 320, pos+'0 24', 24); + drawpic(pos+[0,56], "gfx/inter.lmp", [160,144],[1,1,1],1,0); + + Hud_DrawIntermissionNumber(pos+[144, 64], sprintf("%3.0f:%02.0f", intermission_time/60, intermission_time%60)); + Hud_DrawIntermissionNumber(pos+[144, 104], sprintf("%3.0f/%.0f", getstatf(STAT_FOUNDSECRETS), getstatf(STAT_TOTALSECRETS))); + Hud_DrawIntermissionNumber(pos+[144, 144], sprintf("%3.0f/%.0f", getstatf(STAT_KILLEDMONSTERS), getstatf(STAT_TOTALMONSTERS))); +}; + +//called unless there's a menu/finale visible. also called during intermissions. +void(vector virtsize, float showscores) CSQC_DrawScores = +{ + if (intermission || showscores || getstatf(STAT_HEALTH) <= 0) + if (deathmatch) + return Hud_DeathmatchScoreboard('0 0 0', virtsize); + if (intermission) + Hud_Intermission('0 0 0', virtsize); +}; diff --git a/QC_other/QC_keep/csqc/csqc_scoreboard.qc.orig b/QC_other/QC_keep/csqc/csqc_scoreboard.qc.orig new file mode 100644 index 00000000..16e48a4c --- /dev/null +++ b/QC_other/QC_keep/csqc/csqc_scoreboard.qc.orig @@ -0,0 +1,118 @@ +vector(string picname, float height) Hud_AspectSize = +{ + vector sz = drawgetimagesize(picname); + return [sz_x * height/sz_y, height]; +}; +void(string picname, float screenwidth, vector pos, float height) Hud_CentrePic = +{ + vector sz = Hud_AspectSize(picname, height); + pos_x += (screenwidth-sz_x)/2; + drawpic(pos, picname, sz, [1,1,1],1,0); +}; +void(vector virtmin, vector virtsize) Hud_DeathmatchScoreboard = +{ + vector pos = virtmin; + if not (getplayerkeyvalue(-16, "name")) + pos_y += (virtsize_y-200)/2; + + if not (getplayerkeyvalue(-24, "name")) + { //and only draw the header when its not a really big game + pos_y += 8; + Hud_CentrePic("gfx/ranking.lmp", virtsize_x, pos, 24); pos_y += 24; + pos_y += 10; + } + + if (autocvar(cg_woot, 0)) //I added this mostly just to demonstrate that you're actually using the csqc version... + pos_x = (virtsize_x-320)/2 * (1+sin(time)); + else + pos_x += (virtsize_x-320)/2; + + pos_x += 80; + + //negative numbers are players sorted by frags. + for (float i = -1; ; i--, pos_y += 10) + { + string name = getplayerkeyvalue(i, "name"); + if not (name) + break; + float isspec = stof(getplayerkeyvalue(i, "*spectator")); + string frags = getplayerkeyvalue(i, "frags"); + string ping = getplayerkeyvalue(i, "ping"); + vector top = stov(getplayerkeyvalue(i, "topcolor_rgb")); + vector bot = stov(getplayerkeyvalue(i, "bottomcolor_rgb")); + name = strconv(0,2,2, name); + //FIXME: string team = getplayerkeyvalue(i, "team"); //QW team names do NOT match player colours. + /*Other interesting fields + pl - for packetloss + activetime - how long the player has been on the server. + chat - to check if someone is at the console/tabbed out + userid - for easy banning etc, assuming you're the server. + ignored - text from this player will be dropped clientside. + vignored - voicechat from this player will be dropped (clientside and hopefully serverside too). + voipspeaking- whether they're speaking or not + voiploudness- the player's average voip volume. + also any other networked userinfo + */ + + drawstring(pos-[8*5 ,0], strpad(-4, ping), [8,8], [1,1,1],1,0); + if (isspec) + drawstring(pos+[4,0], "spec", [8,8], [1,1,1],1,0); + else + { + drawfill(pos+[0,0], [40,4], top, 0.75, 0); + drawfill(pos+[0,4], [40,4], bot, 0.75, 0); + drawstring(pos+[8,0], strpad(-3, frags), [8,8], [1,1,1],1,0); + if (player_localentnum == stof(getplayerkeyvalue(i, "viewentity"))) + { +// drawcharacter(pos-[8,0], 0xe00d, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[ 0,0], 0xe010, [8,8], [1,1,1],1, 0); + drawcharacter(pos+[32,0], 0xe011, [8,8], [1,1,1],1, 0); + } + } + drawstring(pos+[64,0], name, [8,8], [1,1,1],1,0); + } +}; + +static void(vector pos, string num) Hud_DrawIntermissionNumber = +{ + float i; + float c; + for(i = 0; ; i++, pos_x += 24) + { + c = str2chr(num, i); + if (!c) + break; + if (c == ' ') + continue; + if (c == '/') + drawpic(pos, "gfx/num_slash", [24,24],[1,1,1],1,0); + else if (c == ':' || c == '.') + drawpic(pos, "gfx/num_colon", [24,24],[1,1,1],1,0); + else if (c == '-') + drawpic(pos, "gfx/num_minus", [24,24],[1,1,1],1,0); + else if (c >= '0' && c <= '9') + drawpic(pos, sprintf("gfx/num_%c", c), [24,24],[1,1,1],1,0); + } +}; + +void(vector virtmin, vector virtsize) Hud_Intermission = +{ + vector pos = virtmin + (virtsize-[320,200])/2; + + Hud_CentrePic("gfx/complete.lmp", 320, pos+'0 24', 24); + drawpic(pos+[0,56], "gfx/inter.lmp", [160,144],[1,1,1],1,0); + + Hud_DrawIntermissionNumber(pos+[144, 64], sprintf("%3.0f:%02.0f", intermission_time/60, intermission_time%60)); + Hud_DrawIntermissionNumber(pos+[144, 104], sprintf("%3.0f/%.0f", getstatf(STAT_FOUNDSECRETS), getstatf(STAT_TOTALSECRETS))); + Hud_DrawIntermissionNumber(pos+[144, 144], sprintf("%3.0f/%.0f", getstatf(STAT_KILLEDMONSTERS), getstatf(STAT_TOTALMONSTERS))); +}; + +//called unless there's a menu/finale visible. also called during intermissions. +void(vector virtsize, float showscores) CSQC_DrawScores = +{ + if (intermission || showscores || getstatf(STAT_HEALTH) <= 0) + if (deathmatch) + return Hud_DeathmatchScoreboard('0 0 0', virtsize); + if (intermission) + Hud_Intermission('0 0 0', virtsize); +}; diff --git a/QC_other/QC_keep/csqc/fteqccgui.exe b/QC_other/QC_keep/csqc/fteqccgui.exe new file mode 100644 index 00000000..9105a1df Binary files /dev/null and b/QC_other/QC_keep/csqc/fteqccgui.exe differ diff --git a/QC_other/QC_keep/csqc/qsextensions.qc b/QC_other/QC_keep/csqc/qsextensions.qc new file mode 100644 index 00000000..ea67c446 --- /dev/null +++ b/QC_other/QC_keep/csqc/qsextensions.qc @@ -0,0 +1,889 @@ +/* +Extensions file for QSS 0.93.1 +This file is auto-generated by pr_dumpplatform with no args. +You will probably need to use FTEQCC to compile this. +*/ + + +//This file only supports csqc, so including this file in some other situation is a user error +#if defined(QUAKEWORLD) || defined(MENU) +#error Mixed up module defs +#endif +#ifndef CSQC +#define CSQC +#endif +#ifndef CSQC_SIMPLE +#define CSQC_SIMPLE +#endif + + +//List of advertised extensions +//DP_CON_SET +//DP_CON_SETA +//DP_EF_NOSHADOW +//DP_ENT_ALPHA +//DP_ENT_COLORMOD +//DP_ENT_SCALE +//DP_ENT_TRAILEFFECTNUM +//DP_INPUTBUTTONS +//DP_QC_AUTOCVARS +//DP_QC_ASINACOSATANATAN2TAN +//DP_QC_COPYENTITY +//DP_QC_CRC16 +//DP_QC_CVAR_DEFSTRING +//DP_QC_CVAR_STRING +//DP_QC_CVAR_TYPE +//DP_QC_EDICT_NUM +//DP_QC_ENTITYDATA +//DP_QC_ETOS +//DP_QC_FINDCHAIN +//DP_QC_FINDCHAINFLAGS +//DP_QC_FINDCHAINFLOAT +//DP_QC_FINDFLAGS +//DP_QC_FINDFLOAT +//DP_QC_GETLIGHT +//DP_QC_GETSURFACE +//DP_QC_GETSURFACETRIANGLE +//DP_QC_GETSURFACEPOINTATTRIBUTE +//DP_QC_MINMAXBOUND +//DP_QC_MULTIPLETEMPSTRINGS +//DP_QC_RANDOMVEC +//DP_QC_SINCOSSQRTPOW +//DP_QC_SPRINTF +//DP_QC_STRFTIME +//DP_QC_STRING_CASE_FUNCTIONS +//DP_QC_STRINGBUFFERS +//DP_QC_STRINGCOLORFUNCTIONS +//DP_QC_STRREPLACE +//DP_QC_TOKENIZEBYSEPARATOR +//DP_QC_TRACEBOX +//DP_QC_TRACETOSS +//DP_QC_TRACE_MOVETYPES +//DP_QC_URI_ESCAPE +//DP_QC_VECTOANGLES_WITH_ROLL +//DP_QC_VECTORVECTORS +//DP_QC_WHICHPACK +//DP_VIEWZOOM +//DP_REGISTERCVAR +//DP_SV_BOTCLIENT +//DP_SV_DROPCLIENT +//DP_SV_POINTSOUND +//DP_SV_PRINT +//DP_SV_SETCOLOR +//DP_SV_SPAWNFUNC_PREFIX +//DP_SV_WRITEUNTERMINATEDSTRING +//DP_TE_PARTICLERAIN +//DP_TE_PARTICLESNOW +//DP_TE_STANDARDEFFECTBUILTINS +//EXT_BITSHIFT +//FRIK_FILE +//FTE_PART_SCRIPT +//FTE_PART_NAMESPACES +//FTE_PART_NAMESPACE_EFFECTINFO +//FTE_QC_CHECKCOMMAND +//FTE_QC_CROSSPRODUCT +//FTE_QC_INFOKEY +//FTE_QC_INTCONV +//FTE_QC_MULTICAST +//FTE_STRINGS +//FTE_SV_POINTPARTICLES +//KRIMZON_SV_PARSECLIENTCOMMAND +//ZQ_QC_STRINGS + + +//Explicitly flag this stuff as probably-not-referenced, meaning fteqcc will shut up about it and silently strip what it can. +#pragma noref 1 +entity self,other,world; +float time,frametime,force_retouch; +string mapname; +float deathmatch,coop,teamplay,serverflags,total_secrets,total_monsters,found_secrets,killed_monsters,parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; +vector v_forward, v_up, v_right; +float trace_allsolid,trace_startsolid,trace_fraction; +vector trace_endpos,trace_plane_normal; +float trace_plane_dist; +entity trace_ent; +float trace_inopen,trace_inwater; +entity msg_entity; +void() main,StartFrame,PlayerPreThink,PlayerPostThink,ClientKill,ClientConnect,PutClientInServer,ClientDisconnect,SetNewParms,SetChangeParms; +void end_sys_globals; +.float modelindex; +.vector absmin, absmax; +.float ltime,movetype,solid; +.vector origin,oldorigin,velocity,angles,avelocity,punchangle; +.string classname,model; +.float frame,skin,effects; +.vector mins, maxs,size; +.void() touch,use,think,blocked; +.float nextthink; +.entity groundentity; +.float health,frags,weapon; +.string weaponmodel; +.float weaponframe,currentammo,ammo_shells,ammo_nails,ammo_rockets,ammo_cells,items,takedamage; +.entity chain; +.float deadflag; +.vector view_ofs; +.float button0,button1,button2,impulse,fixangle; +.vector v_angle; +.float idealpitch; +.string netname; +.entity enemy; +.float flags,colormap,team,max_health,teleport_time,armortype,armorvalue,waterlevel,watertype,ideal_yaw,yaw_speed; +.entity aiment,goalentity; +.float spawnflags; +.string target,targetname; +.float dmg_take,dmg_save; +.entity dmg_inflictor,owner; +.vector movedir; +.string message; +.float sounds; +.string noise, noise1, noise2, noise3; +void end_sys_fields; + + +//Some custom types (that might be redefined as accessors by fteextensions.qc, although we don't define any methods here) +#ifdef _ACCESSORS +accessor strbuf:float; +accessor searchhandle:float; +accessor hashtable:float; +accessor infostring:string; +accessor filestream:float; +#else +#define strbuf float +#define searchhandle float +#define hashtable float +#define infostring string +#define filestream float +#endif +void(string cmd) SV_ParseClientCommand; +void() EndFrame; +void(float apilevel, string enginename, float engineversion) CSQC_Init; +float(string cmdstr) CSQC_ConsoleCommand; +void(vector virtsize, float showscores) CSQC_DrawHud; +void(vector virtsize, float showscores) CSQC_DrawScores; +float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent; +void() CSQC_Parse_Event; +float(float save, float take, vector dir) CSQC_Parse_Damage; +float cltime; /* increases regardless of pause state or game speed */ +float maxclients; /* maximum number of players possible on this server */ +float intermission; /* in intermission */ +float intermission_time; /* when the intermission started */ +float player_localnum; /* the player slot that is believed to be assigned to us*/ +float player_localentnum; /* the entity number that the view is attached to */ +const float FALSE = 0; +const float TRUE = 1; +const float IE_KEYDOWN = 0; +const float IE_KEYUP = 1; +const float IE_MOUSEDELTA = 2; +const float IE_MOUSEABS = 3; +const float IE_JOYAXIS = 6; +const float STAT_HEALTH = 0; /* Player's health. */ +const float STAT_WEAPONMODELI = 2; /* This is the modelindex of the current viewmodel (renamed from the original name 'STAT_WEAPON' due to confusions). */ +const float STAT_AMMO = 3; /* player.currentammo */ +const float STAT_ARMOR = 4; +const float STAT_WEAPONFRAME = 5; +const float STAT_SHELLS = 6; +const float STAT_NAILS = 7; +const float STAT_ROCKETS = 8; +const float STAT_CELLS = 9; +const float STAT_ACTIVEWEAPON = 10; /* player.weapon */ +const float STAT_TOTALSECRETS = 11; +const float STAT_TOTALMONSTERS = 12; +const float STAT_FOUNDSECRETS = 13; +const float STAT_KILLEDMONSTERS = 14; +const float STAT_ITEMS = 15; /* self.items | (self.items2<<23). In order to decode this stat properly, you need to use getstatbits(STAT_ITEMS,0,23) to read self.items, and getstatbits(STAT_ITEMS,23,11) to read self.items2 or getstatbits(STAT_ITEMS,28,4) to read the visible part of serverflags, whichever is applicable. */ +const float STAT_VIEWHEIGHT = 16; /* player.view_ofs_z */ +const float STAT_VIEW2 = 20; /* This stat contains the number of the entity in the server's .view2 field. */ +const float STAT_VIEWZOOM = 21; /* Scales fov and sensitiity. Part of DP_VIEWZOOM. */ +const float STAT_IDEALPITCH = 25; +const float STAT_PUNCHANGLE_X = 26; +const float STAT_PUNCHANGLE_Y = 27; + +const float STAT_USER = 32; /* Custom user stats start here (lower values are reserved for engine use). */ +const float EV_VOID = 0; +const float EV_STRING = 1; +const float EV_FLOAT = 2; +const float EV_VECTOR = 3; +const float EV_ENTITY = 4; +const float EV_FIELD = 5; +const float EV_FUNCTION = 6; +const float EV_POINTER = 7; +const float EV_INTEGER = 8; + + +//Supported Extension fields +.float gravity; +//.float items2; /*if defined, overrides serverflags for displaying runes on the hud*/ +.float traileffectnum; /*can also be set with 'traileffect' from a map editor*/ +.float emiteffectnum; /*can also be set with 'traileffect' from a map editor*/ +.vector movement; /*describes which forward/right/up keys the player is holidng*/ +.entity viewmodelforclient; /*attaches this entity to the specified player's view. invisible to other players*/ +.float scale; /*rescales the etntiy*/ +.float alpha; /*entity opacity*/ +.vector colormod; /*tints the entity's colours*/ +.entity tag_entity; +.float tag_index; +.float button3; +.float button4; +.float button5; +.float button6; +.float button7; +.float button8; +.float viewzoom; /*rescales the user's fov*/ +.float modelflags; /*provides additional modelflags to use (effects&EF_NOMODELFLAGS to replace the original model's)*/ + + +//Supported Extension Constants +const float MOVETYPE_FOLLOW = 12; +const float SOLID_CORPSE = 5; +const float CLIENTTYPE_DISCONNECT = 0; +const float CLIENTTYPE_REAL = 1; +const float CLIENTTYPE_BOT = 2; +const float CLIENTTYPE_NOTCLIENT = 3; +const float EF_NOSHADOW = 0x1000; +const float EF_NOMODELFLAGS = 0x800000; /*the standard modelflags from the model are ignored*/ +const float MF_ROCKET = 0x1; +const float MF_GRENADE = 0x2; +const float MF_GIB = 0x4; +const float MF_ROTATE = 0x8; +const float MF_TRACER = 0x10; +const float MF_ZOMGIB = 0x20; +const float MF_TRACER2 = 0x40; +const float MF_TRACER3 = 0x80; +const float MSG_MULTICAST = 4; +const float MULTICAST_ALL = 0; +const float MULTICAST_PVS = 2; +const float MULTICAST_ONE = 6; +const float MULTICAST_ALL_R = 3; +const float MULTICAST_PVS_R = 5; +const float MULTICAST_ONE_R = 7; +const float MULTICAST_INIT = 8; +const float FILE_READ = 0; +const float FILE_APPEND = 1; +const float FILE_WRITE = 2; + + +//Vanilla Builtin list (reduced, so as to avoid conflicts) +void(vector) makevectors = #1; +void(entity,vector) setorigin = #2; +void(entity,string) setmodel = #3; +void(entity,vector,vector) setsize = #4; +float() random = #7; +vector(vector) normalize = #9; +void(string e) error = #10; +void(string n) objerror = #11; +float(vector) vlen = #12; +entity() spawn = #14; +void(entity e) remove = #15; +void(string,...) dprint = #25; +string(float) ftos = #26; +string(vector) vtos = #27; +float(float n) rint = #36; +float(float n) floor = #37; +float(float n) ceil = #38; +float(float n) fabs = #43; +float(string) cvar = #45; +void(string,...) localcmd = #46; +entity(entity) nextent = #47; +void(string var, string val) cvar_set = #72; + + +//Builtin list +vector(vector fwd, optional vector up) vectoangles2 = #51; /* + Returns the angles (+x=UP) required to orient an entity to look in the given direction. The 'up' argument is required if you wish to set a roll angle, otherwise it will be limited to just monster-style turning. */ + +float(float angle) sin = #60; +float(float angle) cos = #61; +float(float value) sqrt = #62; +void(entity ent, entity ignore) tracetoss = #64; +string(entity ent) etos = #65; +string(entity e, string key) infokey = #80; /* + If e is world, returns the field 'key' from either the serverinfo or the localinfo. If e is a player, returns the value of 'key' from the player's userinfo string. There are a few special exceptions, like 'ip' which is not technically part of the userinfo. */ + +float(entity e, string key) infokeyf = #0; /* + Identical to regular infokey, but returns it as a float instead of creating new tempstrings. */ + +float(string) stof = #81; +#define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0) +void(vector where, float set) multicast = #82; /* + Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */ + +void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; /* + Exactly like traceline, but a box instead of a uselessly thin point. Acceptable sizes are limited by bsp format, q1bsp has strict acceptable size values. */ + +vector() randomvec = #91; /* + Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive. */ + +vector(vector org) getlight = #92; +float(string cvarname, string defaultvalue) registercvar = #93; /* + Creates a new cvar on the fly. If it does not already exist, it will be given the specified value. If it does exist, this is a no-op. + This builtin has the limitation that it does not apply to configs or commandlines. Such configs will need to use the set or seta command causing this builtin to be a noop. + In engines that support it, you will generally find the autocvar feature easier and more efficient to use. */ + +float(float a, float b, ...) min = #94; /* + Returns the lowest value of its arguments. */ + +float(float a, float b, ...) max = #95; /* + Returns the highest value of its arguments. */ + +float(float minimum, float val, float maximum) bound = #96; /* + Returns val, unless minimum is higher, or maximum is less. */ + +float(float value, float exp) pow = #97; +#define findentity findfloat +entity(entity start, .__variant fld, __variant match) findfloat = #98; /* + Equivelent to the find builtin, but instead of comparing strings contents, this builtin compares the raw values. This builtin requires multiple calls in order to scan all entities - set start to the previous call's return value. + world is returned when there are no more entities. */ + +float(string extname) checkextension = #99; /* + Checks for an extension by its name (eg: checkextension("FRIK_FILE") says that its okay to go ahead and use strcat). + Use cvar("pr_checkextension") to see if this builtin exists. */ + +float(__variant funcref) checkbuiltin = #0; /* + Checks to see if the specified builtin is supported/mapped. This is intended as a way to check for #0 functions, allowing for simple single-builtin functions. */ + +float(string builtinname) builtin_find = #100; /* + Looks to see if the named builtin is valid, and returns the builtin number it exists at. */ + +float(float value) anglemod = #102; +filestream(string filename, float mode, optional float mmapminsize) fopen = #110; /* + Opens a file, typically prefixed with "data/", for either read or write access. */ + +void(filestream fhandle) fclose = #111; +string(filestream fhandle) fgets = #112; /* + Reads a single line out of the file. The new line character is not returned as part of the string. Returns the null string on EOF (use if not(string) to easily test for this, which distinguishes it from the empty string which is returned if the line being read is blank */ + +void(filestream fhandle, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) fputs = #113; /* + Writes the given string(s) into the file. For compatibility with fgets, you should ensure that the string is terminated with a \n - this will not otherwise be done for you. It is up to the engine whether dos or unix line endings are actually written. */ + +#define ftell fseek //c-compat +int(filestream fhandle, optional int newoffset) fseek = #0; /* + Changes the current position of the file, if specified. Returns prior position, in bytes. */ + +float(string s) strlen = #114; +string(string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) strcat = #115; +string(string s, float start, float length) substring = #116; +vector(string s) stov = #117; +string(string s, ...) strzone = #118; /* + Create a semi-permanent copy of a string that only becomes invalid once strunzone is called on the string (instead of when the engine assumes your string has left scope). */ + +void(string s) strunzone = #119; /* + Destroys a string that was allocated by strunzone. Further references to the string MAY crash the game. */ + +float(float number, float quantity) bitshift = #218; +void(vector org) te_lightningblood = #219; +float(string s1, string sub, optional float startidx) strstrofs = #221; /* + Returns the 0-based offset of sub within the s1 string, or -1 if sub is not in s1. + If startidx is set, this builtin will ignore matches before that 0-based offset. */ + +float(string str, float index) str2chr = #222; /* + Retrieves the character value at offset 'index'. */ + +string(float chr, ...) chr2str = #223; /* + The input floats are considered character values, and are concatenated. */ + +string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; /* + Converts quake chars in the input string amongst different representations. + ccase specifies the new case for letters. + 0: not changed. + 1: forced to lower case. + 2: forced to upper case. + redalpha and redchars switch between colour ranges. + 0: no change. + 1: Forced white. + 2: Forced red. + 3: Forced gold(low) (numbers only). + 4: Forced gold (high) (numbers only). + 5+6: Forced to white and red alternately. + You should not use this builtin in combination with UTF-8. */ + +string(float pad, string str1, ...) strpad = #225; /* + Pads the string with spaces, to ensure its a specific length (so long as a fixed-width font is used, anyway). If pad is negative, the spaces are added on the left. If positive the padding is on the right. */ + +string(infostring old, string key, string value) infoadd = #226; /* + Returns a new tempstring infostring with the named value changed (or added if it was previously unspecified). Key and value may not contain the \ character. */ + +string(infostring info, string key) infoget = #227; /* + Reads a named value from an infostring. The returned value is a tempstring */ + +#define strcmp strncmp +float(string s1, string s2, optional float len, optional float s1ofs, optional float s2ofs) strncmp = #228; /* + Compares up to 'len' chars in the two strings. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. + Returns 0 if the two strings are equal, a negative value if s1 appears numerically lower, and positive if s1 appears numerically higher. */ + +float(string s1, string s2) strcasecmp = #229; /* + Compares the two strings without case sensitivity. + Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ + +float(string s1, string s2, float len, optional float s1ofs, optional float s2ofs) strncasecmp = #230; /* + Compares up to 'len' chars in the two strings without case sensitivity. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. + Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ + +string(string s) strtrim = #0; /* + Trims the whitespace from the start+end of the string. */ + +void(float num, float type, .__variant fld) clientstat = #232; /* + Specifies what data to use in order to send various stats, in a client-specific way. + 'num' should be a value between 32 and 127, other values are reserved. + 'type' must be set to one of the EV_* constants, one of EV_FLOAT, EV_STRING, EV_INTEGER, EV_ENTITY. + fld must be a reference to the field used, each player will be sent only their own copy of these fields. */ + +void(float num, float type, string name) globalstat = #233; /* + Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, name however, is the name of the global to read in the form of a string (pass "foo"). */ + +void(float num, float type, __variant *address) pointerstat = #0; /* + Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, address however, is the address of the variable you would like to use (pass &foo). */ + +float(entity player) isbackbuffered = #234; /* + Returns if the given player's network buffer will take multiple network frames in order to clear. If this builtin returns non-zero, you should delay or reduce the amount of reliable (and also unreliable) data that you are sending to that client. */ + +void(vector org, float count) te_bloodqw = #239; +float(float a, float n) mod = #245; +int(string) stoi = #259; /* + Converts the given string into a true integer. Base 8, 10, or 16 is determined based upon the format of the string. */ + +string(int) itos = #260; /* + Converts the passed true integer into a base10 string. */ + +int(string) stoh = #261; /* + Reads a base-16 string (with or without 0x prefix) as an integer. Bugs out if given a base 8 or base 10 string. :P */ + +string(int) htos = #262; /* + Formats an integer as a base16 string, with leading 0s and no prefix. Always returns 8 characters. */ + +int(float) ftoi = #0; /* + Converts the given float into a true integer without depending on extended qcvm instructions. */ + +float(int) itof = #0; /* + Converts the given true integer into a float without depending on extended qcvm instructions. */ + +#ifndef dotproduct +#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2)) +#endif +vector(vector v1, vector v2) crossproduct = #0; /* + Small helper function to calculate the crossproduct of two vectors. */ + +float(float modidx, string framename) frameforname = #276; /* + Looks up a framegroup from a model by name, avoiding the need for hardcoding. Returns -1 on error. */ + +float(float modidx, float framenum) frameduration = #277; /* + Retrieves the duration (in seconds) of the specified framegroup. */ + +void(float buf, float fl) WriteFloat = #280; +string(float modidx, float framenum) frametoname = #284; +float(string name) checkcommand = #294; /* + Checks to see if the supplied name is a valid command, cvar, or alias. Returns 0 if it does not exist. */ + +float(string name) iscachedpic = #316; /* + Checks to see if the image is currently loaded. Engines might lie, or cache between maps. */ + +string(string name, optional float trywad) precache_pic = #317; /* + Forces the engine to load the named image. If trywad is specified, the specified name must any lack path and extension. */ + +#define draw_getimagesize drawgetimagesize +vector(string picname) drawgetimagesize = #318; /* + Returns the dimensions of the named image. Images specified with .lmp should give the original .lmp's dimensions even if texture replacements use a different resolution. */ + +float(vector position, float character, vector size, vector rgb, float alpha, optional float drawflag) drawcharacter = #320; /* + Draw the given quake character at the given position. + If flag&4, the function will consider the char to be a unicode char instead (or display as a ? if outside the 32-127 range). + size should normally be something like '8 8 0'. + rgb should normally be '1 1 1' + alpha normally 1. + Software engines may assume the named defaults. + Note that ALL text may be rescaled on the X axis due to variable width fonts. The X axis may even be ignored completely. */ + +float(vector position, string pic, vector size, vector rgb, float alpha, optional float drawflag) drawpic = #322; /* + Draws an shader within the given 2d screen box. Software engines may omit support for rgb+alpha, but must support rescaling, and must clip to the screen without crashing. */ + +float(vector position, vector size, vector rgb, float alpha, optional float drawflag) drawfill = #323; /* + Draws a solid block over the given 2d box, with given colour, alpha, and blend mode (specified via flags). + flags&3=0 simple blend. + flags&3=1 additive blend */ + +void(float x, float y, float width, float height) drawsetcliparea = #324; /* + Specifies a 2d clipping region (aka: scissor test). 2d draw calls will all be clipped to this 2d box, the area outside will not be modified by any 2d draw call (even 2d polygons). */ + +void(void) drawresetcliparea = #325; /* + Reverts the scissor/clip area to the whole screen. */ + +float(vector position, string text, vector size, vector rgb, float alpha, float drawflag) drawstring = #326; /* + Draws a string, interpreting markup and recolouring as appropriate. */ + +float(string text, float usecolours, optional vector fontsize) stringwidth = #327; /* + Calculates the width of the screen in virtual pixels. If usecolours is 1, markup that does not affect the string width will be ignored. Will always be decoded as UTF-8 if UTF-8 is globally enabled. + If the char size is not specified, '8 8 0' will be assumed. */ + +void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, optional float drawflag) drawsubpic = #328; /* + Draws a rescaled subsection of an image to the screen. */ + +#define getstati_punf(stnum) (float)(__variant)getstati(stnum) +int(float stnum) getstati = #330; /* + Retrieves the numerical value of the given EV_INTEGER or EV_ENTITY stat. Use getstati_punf if you wish to type-pun a float stat as an int to avoid truncation issues in DP. */ + +#define getstatbits getstatf +float(float stnum, optional float firstbit, optional float bitcount) getstatf = #331; /* + Retrieves the numerical value of the given EV_FLOAT stat. If firstbit and bitcount are specified, retrieves the upper bits of the STAT_ITEMS stat (converted into a float, so there are no VM dependancies). */ + +void(entity e, float mdlindex) setmodelindex = #333; /* + Sets a model by precache index instead of by name. Otherwise identical to setmodel. */ + +float(string effectname) particleeffectnum = #335; /* + Precaches the named particle effect. If your effect name is of the form 'foo.bar' then particles/foo.cfg will be loaded by the client if foo.bar was not already defined. + Different engines will have different particle systems, this specifies the QC API only. */ + +void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; /* + Draws the given effect between the two named points. If ent is not world, distances will be cached in the entity in order to avoid framerate dependancies. The entity is not otherwise used. */ + +void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; /* + Spawn a load of particles from the given effect at the given point traveling or aiming along the direction specified. The number of particles are scaled by the count argument. */ + +void(string s, ...) cprint = #338; /* + Print into the center of the screen just as ssqc's centerprint would appear. */ + +void(string s, ...) print = #339; /* + Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */ + +string(float keynum) keynumtostring = #340; /* + Returns a hunam-readable name for the given keycode, as a tempstring. */ + +float(string keyname) stringtokeynum = #341; /* + Looks up the key name in the same way that the bind command would, returning the keycode for that key. */ + +string(float keynum) getkeybind = #342; /* + Returns the current binding for the given key (returning only the command executed when no modifiers are pressed). */ + +void(float usecursor, optional string cursorimage, optional vector hotspot, optional float scale) setcursormode = #343; /* + Pass TRUE if you want the engine to release the mouse cursor (absolute input events + touchscreen mode). Pass FALSE if you want the engine to grab the cursor (relative input events + standard looking). If the image name is specified, the engine will use that image for a cursor (use an empty string to clear it again), in a way that will not conflict with the console. Images specified this way will be hardware accelerated, if supported by the platform/port. */ + +float(float effective) getcursormode = #0; /* + Reports the cursor mode this module previously attempted to use. If 'effective' is true, reports the cursor mode currently active (if was overriden by a different module which has precidence, for instance, or if there is only a touchscreen and no mouse). */ + +void(float sens) setsensitivityscaler = #346; /* + Temporarily scales the player's mouse sensitivity based upon something like zoom, avoiding potential cvar saving and thus corruption. */ + +string(float playernum, string keyname) getplayerkeyvalue = #348; /* + Look up a player's userinfo, to discover things like their name, topcolor, bottomcolor, skin, team, *ver. + Also includes scoreboard info like frags, ping, pl, userid, entertime, as well as voipspeaking and voiploudness. */ + +float(float playernum, string keyname, optional float assumevalue) getplayerkeyfloat = #0; /* + Cheaper version of getplayerkeyvalue that avoids the need for so many tempstrings. */ + +float() isdemo = #349; /* + Returns if the client is currently playing a demo or not */ + +float() isserver = #350; /* + Returns if the client is acting as the server (aka: listen server) */ + +void(string cmdname) registercommand = #352; /* + Register the given console command, for easy console use. + Console commands that are later used will invoke CSQC_ConsoleCommand. */ + +float(entity ent) wasfreed = #353; /* + Quickly check to see if the entity is currently free. This function is only valid during the two-second non-reuse window, after that it may give bad results. Try one second to make it more robust. */ + +string(string key) serverkey = #354; /* + Look up a key in the server's public serverinfo string */ + +float(string key, optional float assumevalue) serverkeyfloat = #0; /* + Version of serverkey that returns the value as a float (which avoids tempstrings). */ + +void(string evname, string evargs, ...) sendevent = #359; /* + Invoke Cmd_evname_evargs in ssqc. evargs must be a string of initials refering to the types of the arguments to pass. v=vector, e=entity(.entnum field is sent), f=float, i=int. 6 arguments max - you can get more if you pack your floats into vectors. */ + +float() readbyte = #360; +float() readchar = #361; +float() readshort = #362; +float() readlong = #363; +float() readcoord = #364; +float() readangle = #365; +string() readstring = #366; +float() readfloat = #367; +float() readentitynum = #368; +void(string newcaption) setwindowcaption = #0; /* + Replaces the title of the game window, as seen when task switching or just running in windowed mode. */ + +entity(entity from, optional entity to) copyentity = #400; /* + Copies all fields from one entity to another. */ + +void(entity ent, float colours) setcolors = #401; /* + Changes a player's colours. The bits 0-3 are the lower/trouser colour, bits 4-7 are the upper/shirt colours. */ + +entity(.string field, string match) findchain = #402; +entity(.float fld, float match) findchainfloat = #403; +void(vector org, vector dir, float count) te_blood = #405; +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; +void(vector org, optional float count) te_gunshot = #418; +void(vector org) te_spike = #419; +void(vector org) te_superspike = #420; +void(vector org) te_explosion = #421; +void(vector org) te_tarexplosion = #422; +void(vector org) te_wizspike = #423; +void(vector org) te_knightspike = #424; +void(vector org) te_lavasplash = #425; +void(vector org) te_teleport = #426; +void(vector org, float color, float colorlength) te_explosion2 = #427; +void(entity own, vector start, vector end) te_lightning1 = #428; +void(entity own, vector start, vector end) te_lightning2 = #429; +void(entity own, vector start, vector end) te_lightning3 = #430; +void(entity own, vector start, vector end) te_beam = #431; +void(vector dir) vectorvectors = #432; +float(entity e, float s) getsurfacenumpoints = #434; +vector(entity e, float s, float n) getsurfacepoint = #435; +vector(entity e, float s) getsurfacenormal = #436; +string(entity e, float s) getsurfacetexture = #437; +float(entity e, vector p) getsurfacenearpoint = #438; +vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; +void(entity e, string s) clientcommand = #440; +float(string s) tokenize = #441; +string(float n) argv = #442; +float() argc = #0; +void(entity e, entity tagentity, string tagname) setattachment = #443; /* */ + +searchhandle(string pattern, optional float caseinsensitive, optional float quiet) search_begin = #444; /* + initiate a filesystem scan based upon filenames. Be sure to call search_end on the returned handle. */ + +void(searchhandle handle) search_end = #445; /* */ + +float(searchhandle handle) search_getsize = #446; /* + Retrieves the number of files that were found. */ + +string(searchhandle handle, float num) search_getfilename = #447; /* + Retrieves name of one of the files that was found by the initial search. */ + +float(searchhandle handle, float num) search_getfilesize = #0; /* + Retrieves the size of one of the files that was found by the initial search. */ + +string(searchhandle handle, float num) search_getfilemtime = #0; /* + Retrieves modification time of one of the files in %Y-%m-%d %H:%M:%S format. */ + +string(string cvarname) cvar_string = #448; +entity(entity start, .float fld, float match) findflags = #449; +entity(.float fld, float match) findchainflags = #450; +void(entity player) dropclient = #453; +entity() spawnclient = #454; /* + Spawns a dummy player entity. + Note that such dummy players will be carried from one map to the next. + Warning: DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME are not implemented in quakespasm, so use KRIMZON_SV_PARSECLIENTCOMMAND's clientcommand builtin to change the bot's name/colours/skin/team/etc, in the same way that clients would ask. */ + +float(entity client) clienttype = #455; +void(float target, string str) WriteUnterminatedString = #456; +entity(float entnum) edict_num = #459; +strbuf() buf_create = #460; +void(strbuf bufhandle) buf_del = #461; +float(strbuf bufhandle) buf_getsize = #462; +void(strbuf bufhandle_from, strbuf bufhandle_to) buf_copy = #463; +void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #464; +string(strbuf bufhandle, string glue) buf_implode = #465; +string(strbuf bufhandle, float string_index) bufstr_get = #466; +void(strbuf bufhandle, float string_index, string str) bufstr_set = #467; +float(strbuf bufhandle, string str, float order) bufstr_add = #468; +void(strbuf bufhandle, float string_index) bufstr_free = #469; +float(float s) asin = #471; +float(float c) acos = #472; +float(float t) atan = #473; +float(float c, float s) atan2 = #474; +float(float a) tan = #475; +float(string s) strlennocol = #476; /* + Returns the number of characters in the string after any colour codes or other markup has been parsed. */ + +string(string s) strdecolorize = #477; /* + Flattens any markup/colours, removing them from the string. */ + +string(float uselocaltime, string format, ...) strftime = #478; +float(string s, string separator1, ...) tokenizebyseparator = #479; +string(string s) strtolower = #480; +string(string s) strtoupper = #481; +string(string s) cvar_defstring = #482; +void(vector origin, string sample, float volume, float attenuation) pointsound = #483; +string(string search, string replace, string subject) strreplace = #484; +string(string search, string replace, string subject) strireplace = #485; +vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; +float(float caseinsensitive, string s, ...) crc16 = #494; +float(string name) cvar_type = #495; +float() numentityfields = #496; /* + Gives the number of named entity fields. Note that this is not the size of an entity, but rather just the number of unique names (ie: vectors use 4 names rather than 3). */ + +float(string fieldname) findentityfield = #0; /* + Find a field index by name. */ + +typedef .__variant field_t; +field_t(float fieldnum) entityfieldref = #0; /* + Returns a field value that can be directly used to read entity fields. Be sure to validate the type with entityfieldtype before using. */ + +string(float fieldnum) entityfieldname = #497; /* + Retrieves the name of the given entity field. */ + +float(float fieldnum) entityfieldtype = #498; /* + Provides information about the type of the field specified by the field num. Returns one of the EV_ values. */ + +string(float fieldnum, entity ent) getentityfieldstring = #499; +float(float fieldnum, entity ent, string s) putentityfieldstring = #500; +string(string filename, optional float makereferenced) whichpack = #503; /* + Returns the pak file name that contains the file specified. progs/player.mdl will generally return something like 'pak0.pak'. If makereferenced is true, clients will automatically be told that the returned package should be pre-downloaded and used, even if allow_download_refpackages is not set. */ + +string(string in) uri_escape = #510; +string(string in) uri_unescape = #511; +float(entity ent) num_for_edict = #512; +float(string str) tokenize_console = #514; /* + Tokenize a string exactly as the console's tokenizer would do so. The regular tokenize builtin became bastardized for convienient string parsing, which resulted in a large disparity that can be exploited to bypass checks implemented in a naive SV_ParseClientCommand function, therefore you can use this builtin to make sure it exactly matches. */ + +float(float idx) argv_start_index = #515; /* + Returns the character index that the tokenized arg started at. */ + +float(float idx) argv_end_index = #516; /* + Returns the character index that the tokenized arg stopped at. */ + +string(string cvarname) cvar_description = #518; /* + Retrieves the description of a cvar, which might be useful for tooltips or help files. This may still not be useful. */ + +float(optional float timetype) gettime = #519; +string(string command, optional float bindmap) findkeysforcommand = #521; /* + Returns a list of keycodes that perform the given console command in a format that can only be parsed via tokenize (NOT tokenize_console). This always returns at least two values - if only one key is actually bound, -1 will be returned. The bindmap argument is listed for compatibility with dp-specific defs, but is ignored in FTE. */ + +string(string command, optional float bindmap) findkeysforcommandex = #0; /* + Returns a list of key bindings in keyname format instead of keynums. Use tokenize to parse. This list may contain modifiers. May return large numbers of keys. */ + +float(float v, optional float base) log = #532; /* + Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ + +float(string filename, strbuf bufhandle) buf_loadfile = #535; /* + Appends the named file into a string buffer (which must have been created in advance). The return value merely says whether the file was readable. */ + +float(filestream filehandle, strbuf bufhandle, optional float startpos, optional float numstrings) buf_writefile = #536; /* + Writes the contents of a string buffer onto the end of the supplied filehandle (you must have already used fopen). Additional optional arguments permit you to constrain the writes to a subsection of the stringbuffer. */ + +void(.../*, string funcname*/) callfunction = #605; /* + Invokes the named function. The function name is always passed as the last parameter and must always be present. The others are passed to the named function as-is */ + +float(string s) isfunction = #607; /* + Returns true if the named function exists and can be called with the callfunction builtin. */ + +float(entity e, string s, optional float offset) parseentitydata = #613; /* + Reads a single entity's fields into an already-spawned entity. s should contain field pairs like in a saved game: {"foo1" "bar" "foo2" "5"}. Returns <=0 on failure, otherwise returns the offset in the string that was read to. */ + +string(string fmt, ...) sprintf = #627; +float(entity e, float s) getsurfacenumtriangles = #628; +vector(entity e, float s, float n) getsurfacetriangle = #629; + + +//Builtin Stubs List (these are present for simpler compatibility, but not properly supported in QuakeSpasm at this time). +/* +void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; +void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; +void(vector org, vector color) te_explosionrgb = #407; +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; +void(vector org, vector vel, float howmany) te_spark = #411; +void(vector org) te_gunshotquad = #412; +void(vector org) te_spikequad = #413; +void(vector org) te_superspikequad = #414; +void(vector org) te_explosionquad = #415; +void(vector org) te_smallflash = #416; +void(vector org, float radius, float lifetime, vector color) te_customflash = #417; +void(vector org) te_plasmaburn = #433; +*/ +const float K_TAB = 9; +const float K_ENTER = 13; +const float K_ESCAPE = 27; +const float K_SPACE = 32; +const float K_BACKSPACE = 127; +const float K_UPARROW = 128; +const float K_DOWNARROW = 129; +const float K_LEFTARROW = 130; +const float K_RIGHTARROW = 131; +const float K_ALT = 132; +const float K_CTRL = 133; +const float K_SHIFT = 134; +const float K_F1 = 135; +const float K_F2 = 136; +const float K_F3 = 137; +const float K_F4 = 138; +const float K_F5 = 139; +const float K_F6 = 140; +const float K_F7 = 141; +const float K_F8 = 142; +const float K_F9 = 143; +const float K_F10 = 144; +const float K_F11 = 145; +const float K_F12 = 146; +const float K_INS = 147; +const float K_DEL = 148; +const float K_PGDN = 149; +const float K_PGUP = 150; +const float K_HOME = 151; +const float K_END = 152; +const float K_KP_SLASH = 168; +const float K_KP_STAR = 169; +const float K_KP_MINUS = 170; +const float K_KP_HOME = 164; +const float K_KP_UPARROW = 165; +const float K_KP_PGUP = 166; +const float K_KP_PLUS = 171; +const float K_KP_LEFTARROW = 161; +const float K_KP_5 = 162; +const float K_KP_RIGHTARROW = 163; +const float K_KP_END = 158; +const float K_KP_DOWNARROW = 159; +const float K_KP_PGDN = 160; +const float K_KP_ENTER = 172; +const float K_KP_INS = 157; +const float K_KP_DEL = 167; +const float K_COMMAND = -170; +const float K_MOUSE1 = 512; +const float K_MOUSE2 = 513; +const float K_MOUSE3 = 514; +const float K_JOY1 = 768; +const float K_JOY2 = 769; +const float K_JOY3 = 770; +const float K_JOY4 = 771; +const float K_AUX1 = 784; +const float K_AUX2 = 785; +const float K_AUX3 = 786; +const float K_AUX4 = 787; +const float K_AUX5 = 788; +const float K_AUX6 = 789; +const float K_AUX7 = 790; +const float K_AUX8 = 791; +const float K_AUX9 = 792; +const float K_AUX10 = 793; +const float K_AUX11 = 794; +const float K_AUX12 = 795; +const float K_AUX13 = 796; +const float K_AUX14 = 797; +const float K_AUX15 = 798; +const float K_AUX16 = 799; +const float K_AUX17 = 800; +const float K_AUX18 = 801; +const float K_AUX19 = 802; +const float K_AUX20 = 803; +const float K_AUX21 = 804; +const float K_AUX22 = 805; +const float K_AUX23 = 806; +const float K_AUX24 = 807; +const float K_AUX25 = 808; +const float K_AUX26 = 809; +const float K_AUX27 = 810; +const float K_AUX28 = 811; +const float K_AUX29 = 812; +const float K_AUX30 = 813; +const float K_AUX31 = 814; +const float K_AUX32 = 815; +const float K_MWHEELUP = 515; +const float K_MWHEELDOWN = 516; +const float K_MOUSE4 = 517; +const float K_MOUSE5 = 518; +const float K_LTHUMB = 822; +const float K_RTHUMB = 823; +const float K_LSHOULDER = 824; +const float K_RSHOULDER = 825; +const float K_ABUTTON = 826; +const float K_BBUTTON = 827; +const float K_XBUTTON = 828; +const float K_YBUTTON = 829; +const float K_LTRIGGER = 830; +const float K_RTRIGGER = 831; +const float K_PAUSE = 153; + + +//Reset this back to normal. +#pragma noref 0 diff --git a/QC_other/QC_keep/csqc/qsextensions.qc.orig b/QC_other/QC_keep/csqc/qsextensions.qc.orig new file mode 100644 index 00000000..a2469777 --- /dev/null +++ b/QC_other/QC_keep/csqc/qsextensions.qc.orig @@ -0,0 +1,889 @@ +/* +Extensions file for QSS 0.93.1 +This file is auto-generated by pr_dumpplatform with no args. +You will probably need to use FTEQCC to compile this. +*/ + + +//This file only supports csqc, so including this file in some other situation is a user error +#if defined(QUAKEWORLD) || defined(MENU) +#error Mixed up module defs +#endif +#ifndef CSQC +#define CSQC +#endif +#ifndef CSQC_SIMPLE +#define CSQC_SIMPLE +#endif + + +//List of advertised extensions +//DP_CON_SET +//DP_CON_SETA +//DP_EF_NOSHADOW +//DP_ENT_ALPHA +//DP_ENT_COLORMOD +//DP_ENT_SCALE +//DP_ENT_TRAILEFFECTNUM +//DP_INPUTBUTTONS +//DP_QC_AUTOCVARS +//DP_QC_ASINACOSATANATAN2TAN +//DP_QC_COPYENTITY +//DP_QC_CRC16 +//DP_QC_CVAR_DEFSTRING +//DP_QC_CVAR_STRING +//DP_QC_CVAR_TYPE +//DP_QC_EDICT_NUM +//DP_QC_ENTITYDATA +//DP_QC_ETOS +//DP_QC_FINDCHAIN +//DP_QC_FINDCHAINFLAGS +//DP_QC_FINDCHAINFLOAT +//DP_QC_FINDFLAGS +//DP_QC_FINDFLOAT +//DP_QC_GETLIGHT +//DP_QC_GETSURFACE +//DP_QC_GETSURFACETRIANGLE +//DP_QC_GETSURFACEPOINTATTRIBUTE +//DP_QC_MINMAXBOUND +//DP_QC_MULTIPLETEMPSTRINGS +//DP_QC_RANDOMVEC +//DP_QC_SINCOSSQRTPOW +//DP_QC_SPRINTF +//DP_QC_STRFTIME +//DP_QC_STRING_CASE_FUNCTIONS +//DP_QC_STRINGBUFFERS +//DP_QC_STRINGCOLORFUNCTIONS +//DP_QC_STRREPLACE +//DP_QC_TOKENIZEBYSEPARATOR +//DP_QC_TRACEBOX +//DP_QC_TRACETOSS +//DP_QC_TRACE_MOVETYPES +//DP_QC_URI_ESCAPE +//DP_QC_VECTOANGLES_WITH_ROLL +//DP_QC_VECTORVECTORS +//DP_QC_WHICHPACK +//DP_VIEWZOOM +//DP_REGISTERCVAR +//DP_SV_BOTCLIENT +//DP_SV_DROPCLIENT +//DP_SV_POINTSOUND +//DP_SV_PRINT +//DP_SV_SETCOLOR +//DP_SV_SPAWNFUNC_PREFIX +//DP_SV_WRITEUNTERMINATEDSTRING +//DP_TE_PARTICLERAIN +//DP_TE_PARTICLESNOW +//DP_TE_STANDARDEFFECTBUILTINS +//EXT_BITSHIFT +//FRIK_FILE +//FTE_PART_SCRIPT +//FTE_PART_NAMESPACES +//FTE_PART_NAMESPACE_EFFECTINFO +//FTE_QC_CHECKCOMMAND +//FTE_QC_CROSSPRODUCT +//FTE_QC_INFOKEY +//FTE_QC_INTCONV +//FTE_QC_MULTICAST +//FTE_STRINGS +//FTE_SV_POINTPARTICLES +//KRIMZON_SV_PARSECLIENTCOMMAND +//ZQ_QC_STRINGS + + +//Explicitly flag this stuff as probably-not-referenced, meaning fteqcc will shut up about it and silently strip what it can. +#pragma noref 1 +entity self,other,world; +float time,frametime,force_retouch; +string mapname; +float deathmatch,coop,teamplay,serverflags,total_secrets,total_monsters,found_secrets,killed_monsters,parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; +vector v_forward, v_up, v_right; +float trace_allsolid,trace_startsolid,trace_fraction; +vector trace_endpos,trace_plane_normal; +float trace_plane_dist; +entity trace_ent; +float trace_inopen,trace_inwater; +entity msg_entity; +void() main,StartFrame,PlayerPreThink,PlayerPostThink,ClientKill,ClientConnect,PutClientInServer,ClientDisconnect,SetNewParms,SetChangeParms; +void end_sys_globals; +.float modelindex; +.vector absmin, absmax; +.float ltime,movetype,solid; +.vector origin,oldorigin,velocity,angles,avelocity,punchangle; +.string classname,model; +.float frame,skin,effects; +.vector mins, maxs,size; +.void() touch,use,think,blocked; +.float nextthink; +.entity groundentity; +.float health,frags,weapon; +.string weaponmodel; +.float weaponframe,currentammo,ammo_shells,ammo_nails,ammo_rockets,ammo_cells,items,takedamage; +.entity chain; +.float deadflag; +.vector view_ofs; +.float button0,button1,button2,impulse,fixangle; +.vector v_angle; +.float idealpitch; +.string netname; +.entity enemy; +.float flags,colormap,team,max_health,teleport_time,armortype,armorvalue,waterlevel,watertype,ideal_yaw,yaw_speed; +.entity aiment,goalentity; +.float spawnflags; +.string target,targetname; +.float dmg_take,dmg_save; +.entity dmg_inflictor,owner; +.vector movedir; +.string message; +.float sounds; +.string noise, noise1, noise2, noise3; +void end_sys_fields; + + +//Some custom types (that might be redefined as accessors by fteextensions.qc, although we don't define any methods here) +#ifdef _ACCESSORS +accessor strbuf:float; +accessor searchhandle:float; +accessor hashtable:float; +accessor infostring:string; +accessor filestream:float; +#else +#define strbuf float +#define searchhandle float +#define hashtable float +#define infostring string +#define filestream float +#endif +void(string cmd) SV_ParseClientCommand; +void() EndFrame; +void(float apilevel, string enginename, float engineversion) CSQC_Init; +float(string cmdstr) CSQC_ConsoleCommand; +void(vector virtsize, float showscores) CSQC_DrawHud; +void(vector virtsize, float showscores) CSQC_DrawScores; +float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent; +void() CSQC_Parse_Event; +float(float save, float take, vector dir) CSQC_Parse_Damage; +float cltime; /* increases regardless of pause state or game speed */ +float maxclients; /* maximum number of players possible on this server */ +float intermission; /* in intermission */ +float intermission_time; /* when the intermission started */ +float player_localnum; /* the player slot that is believed to be assigned to us*/ +float player_localentnum; /* the entity number that the view is attached to */ +const float FALSE = 0; +const float TRUE = 1; +const float IE_KEYDOWN = 0; +const float IE_KEYUP = 1; +const float IE_MOUSEDELTA = 2; +const float IE_MOUSEABS = 3; +const float IE_JOYAXIS = 6; +const float STAT_HEALTH = 0; /* Player's health. */ +const float STAT_WEAPONMODELI = 2; /* This is the modelindex of the current viewmodel (renamed from the original name 'STAT_WEAPON' due to confusions). */ +const float STAT_AMMO = 3; /* player.currentammo */ +const float STAT_ARMOR = 4; +const float STAT_WEAPONFRAME = 5; +const float STAT_SHELLS = 6; +const float STAT_NAILS = 7; +const float STAT_ROCKETS = 8; +const float STAT_CELLS = 9; +const float STAT_ACTIVEWEAPON = 10; /* player.weapon */ +const float STAT_TOTALSECRETS = 11; +const float STAT_TOTALMONSTERS = 12; +const float STAT_FOUNDSECRETS = 13; +const float STAT_KILLEDMONSTERS = 14; +const float STAT_ITEMS = 15; /* self.items | (self.items2<<23). In order to decode this stat properly, you need to use getstatbits(STAT_ITEMS,0,23) to read self.items, and getstatbits(STAT_ITEMS,23,11) to read self.items2 or getstatbits(STAT_ITEMS,28,4) to read the visible part of serverflags, whichever is applicable. */ +const float STAT_VIEWHEIGHT = 16; /* player.view_ofs_z */ +const float STAT_VIEW2 = 20; /* This stat contains the number of the entity in the server's .view2 field. */ +const float STAT_VIEWZOOM = 21; /* Scales fov and sensitiity. Part of DP_VIEWZOOM. */ +const float STAT_IDEALPITCH = 25; +const float STAT_PUNCHANGLE_X = 26; +const float STAT_PUNCHANGLE_Y = 27; + +const float STAT_USER = 32; /* Custom user stats start here (lower values are reserved for engine use). */ +const float EV_VOID = 0; +const float EV_STRING = 1; +const float EV_FLOAT = 2; +const float EV_VECTOR = 3; +const float EV_ENTITY = 4; +const float EV_FIELD = 5; +const float EV_FUNCTION = 6; +const float EV_POINTER = 7; +const float EV_INTEGER = 8; + + +//Supported Extension fields +.float gravity; +//.float items2; /*if defined, overrides serverflags for displaying runes on the hud*/ +.float traileffectnum; /*can also be set with 'traileffect' from a map editor*/ +.float emiteffectnum; /*can also be set with 'traileffect' from a map editor*/ +.vector movement; /*describes which forward/right/up keys the player is holidng*/ +.entity viewmodelforclient; /*attaches this entity to the specified player's view. invisible to other players*/ +.float scale; /*rescales the etntiy*/ +.float alpha; /*entity opacity*/ +.vector colormod; /*tints the entity's colours*/ +.entity tag_entity; +.float tag_index; +.float button3; +.float button4; +.float button5; +.float button6; +.float button7; +.float button8; +.float viewzoom; /*rescales the user's fov*/ +.float modelflags; /*provides additional modelflags to use (effects&EF_NOMODELFLAGS to replace the original model's)*/ + + +//Supported Extension Constants +const float MOVETYPE_FOLLOW = 12; +const float SOLID_CORPSE = 5; +const float CLIENTTYPE_DISCONNECT = 0; +const float CLIENTTYPE_REAL = 1; +const float CLIENTTYPE_BOT = 2; +const float CLIENTTYPE_NOTCLIENT = 3; +const float EF_NOSHADOW = 0x1000; +const float EF_NOMODELFLAGS = 0x800000; /*the standard modelflags from the model are ignored*/ +const float MF_ROCKET = 0x1; +const float MF_GRENADE = 0x2; +const float MF_GIB = 0x4; +const float MF_ROTATE = 0x8; +const float MF_TRACER = 0x10; +const float MF_ZOMGIB = 0x20; +const float MF_TRACER2 = 0x40; +const float MF_TRACER3 = 0x80; +const float MSG_MULTICAST = 4; +const float MULTICAST_ALL = 0; +const float MULTICAST_PVS = 2; +const float MULTICAST_ONE = 6; +const float MULTICAST_ALL_R = 3; +const float MULTICAST_PVS_R = 5; +const float MULTICAST_ONE_R = 7; +const float MULTICAST_INIT = 8; +const float FILE_READ = 0; +const float FILE_APPEND = 1; +const float FILE_WRITE = 2; + + +//Vanilla Builtin list (reduced, so as to avoid conflicts) +void(vector) makevectors = #1; +void(entity,vector) setorigin = #2; +void(entity,string) setmodel = #3; +void(entity,vector,vector) setsize = #4; +float() random = #7; +vector(vector) normalize = #9; +void(string e) error = #10; +void(string n) objerror = #11; +float(vector) vlen = #12; +entity() spawn = #14; +void(entity e) remove = #15; +void(string,...) dprint = #25; +string(float) ftos = #26; +string(vector) vtos = #27; +float(float n) rint = #36; +float(float n) floor = #37; +float(float n) ceil = #38; +float(float n) fabs = #43; +float(string) cvar = #45; +void(string,...) localcmd = #46; +entity(entity) nextent = #47; +void(string var, string val) cvar_set = #72; + + +//Builtin list +vector(vector fwd, optional vector up) vectoangles2 = #51; /* + Returns the angles (+x=UP) required to orient an entity to look in the given direction. The 'up' argument is required if you wish to set a roll angle, otherwise it will be limited to just monster-style turning. */ + +float(float angle) sin = #60; +float(float angle) cos = #61; +float(float value) sqrt = #62; +void(entity ent, entity ignore) tracetoss = #64; +string(entity ent) etos = #65; +string(entity e, string key) infokey = #80; /* + If e is world, returns the field 'key' from either the serverinfo or the localinfo. If e is a player, returns the value of 'key' from the player's userinfo string. There are a few special exceptions, like 'ip' which is not technically part of the userinfo. */ + +float(entity e, string key) infokeyf = #0; /* + Identical to regular infokey, but returns it as a float instead of creating new tempstrings. */ + +float(string) stof = #81; +#define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0) +void(vector where, float set) multicast = #82; /* + Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */ + +void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; /* + Exactly like traceline, but a box instead of a uselessly thin point. Acceptable sizes are limited by bsp format, q1bsp has strict acceptable size values. */ + +vector() randomvec = #91; /* + Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive. */ + +vector(vector org) getlight = #92; +float(string cvarname, string defaultvalue) registercvar = #93; /* + Creates a new cvar on the fly. If it does not already exist, it will be given the specified value. If it does exist, this is a no-op. + This builtin has the limitation that it does not apply to configs or commandlines. Such configs will need to use the set or seta command causing this builtin to be a noop. + In engines that support it, you will generally find the autocvar feature easier and more efficient to use. */ + +float(float a, float b, ...) min = #94; /* + Returns the lowest value of its arguments. */ + +float(float a, float b, ...) max = #95; /* + Returns the highest value of its arguments. */ + +float(float minimum, float val, float maximum) bound = #96; /* + Returns val, unless minimum is higher, or maximum is less. */ + +float(float value, float exp) pow = #97; +#define findentity findfloat +entity(entity start, .__variant fld, __variant match) findfloat = #98; /* + Equivelent to the find builtin, but instead of comparing strings contents, this builtin compares the raw values. This builtin requires multiple calls in order to scan all entities - set start to the previous call's return value. + world is returned when there are no more entities. */ + +float(string extname) checkextension = #99; /* + Checks for an extension by its name (eg: checkextension("FRIK_FILE") says that its okay to go ahead and use strcat). + Use cvar("pr_checkextension") to see if this builtin exists. */ + +float(__variant funcref) checkbuiltin = #0; /* + Checks to see if the specified builtin is supported/mapped. This is intended as a way to check for #0 functions, allowing for simple single-builtin functions. */ + +float(string builtinname) builtin_find = #100; /* + Looks to see if the named builtin is valid, and returns the builtin number it exists at. */ + +float(float value) anglemod = #102; +filestream(string filename, float mode, optional float mmapminsize) fopen = #110; /* + Opens a file, typically prefixed with "data/", for either read or write access. */ + +void(filestream fhandle) fclose = #111; +string(filestream fhandle) fgets = #112; /* + Reads a single line out of the file. The new line character is not returned as part of the string. Returns the null string on EOF (use if not(string) to easily test for this, which distinguishes it from the empty string which is returned if the line being read is blank */ + +void(filestream fhandle, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) fputs = #113; /* + Writes the given string(s) into the file. For compatibility with fgets, you should ensure that the string is terminated with a \n - this will not otherwise be done for you. It is up to the engine whether dos or unix line endings are actually written. */ + +#define ftell fseek //c-compat +int(filestream fhandle, optional int newoffset) fseek = #0; /* + Changes the current position of the file, if specified. Returns prior position, in bytes. */ + +float(string s) strlen = #114; +string(string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) strcat = #115; +string(string s, float start, float length) substring = #116; +vector(string s) stov = #117; +string(string s, ...) strzone = #118; /* + Create a semi-permanent copy of a string that only becomes invalid once strunzone is called on the string (instead of when the engine assumes your string has left scope). */ + +void(string s) strunzone = #119; /* + Destroys a string that was allocated by strunzone. Further references to the string MAY crash the game. */ + +float(float number, float quantity) bitshift = #218; +void(vector org) te_lightningblood = #219; +float(string s1, string sub, optional float startidx) strstrofs = #221; /* + Returns the 0-based offset of sub within the s1 string, or -1 if sub is not in s1. + If startidx is set, this builtin will ignore matches before that 0-based offset. */ + +float(string str, float index) str2chr = #222; /* + Retrieves the character value at offset 'index'. */ + +string(float chr, ...) chr2str = #223; /* + The input floats are considered character values, and are concatenated. */ + +string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; /* + Converts quake chars in the input string amongst different representations. + ccase specifies the new case for letters. + 0: not changed. + 1: forced to lower case. + 2: forced to upper case. + redalpha and redchars switch between colour ranges. + 0: no change. + 1: Forced white. + 2: Forced red. + 3: Forced gold(low) (numbers only). + 4: Forced gold (high) (numbers only). + 5+6: Forced to white and red alternately. + You should not use this builtin in combination with UTF-8. */ + +string(float pad, string str1, ...) strpad = #225; /* + Pads the string with spaces, to ensure its a specific length (so long as a fixed-width font is used, anyway). If pad is negative, the spaces are added on the left. If positive the padding is on the right. */ + +string(infostring old, string key, string value) infoadd = #226; /* + Returns a new tempstring infostring with the named value changed (or added if it was previously unspecified). Key and value may not contain the \ character. */ + +string(infostring info, string key) infoget = #227; /* + Reads a named value from an infostring. The returned value is a tempstring */ + +#define strcmp strncmp +float(string s1, string s2, optional float len, optional float s1ofs, optional float s2ofs) strncmp = #228; /* + Compares up to 'len' chars in the two strings. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. + Returns 0 if the two strings are equal, a negative value if s1 appears numerically lower, and positive if s1 appears numerically higher. */ + +float(string s1, string s2) strcasecmp = #229; /* + Compares the two strings without case sensitivity. + Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ + +float(string s1, string s2, float len, optional float s1ofs, optional float s2ofs) strncasecmp = #230; /* + Compares up to 'len' chars in the two strings without case sensitivity. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. + Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ + +string(string s) strtrim = #0; /* + Trims the whitespace from the start+end of the string. */ + +void(float num, float type, .__variant fld) clientstat = #232; /* + Specifies what data to use in order to send various stats, in a client-specific way. + 'num' should be a value between 32 and 127, other values are reserved. + 'type' must be set to one of the EV_* constants, one of EV_FLOAT, EV_STRING, EV_INTEGER, EV_ENTITY. + fld must be a reference to the field used, each player will be sent only their own copy of these fields. */ + +void(float num, float type, string name) globalstat = #233; /* + Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, name however, is the name of the global to read in the form of a string (pass "foo"). */ + +void(float num, float type, __variant *address) pointerstat = #0; /* + Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, address however, is the address of the variable you would like to use (pass &foo). */ + +float(entity player) isbackbuffered = #234; /* + Returns if the given player's network buffer will take multiple network frames in order to clear. If this builtin returns non-zero, you should delay or reduce the amount of reliable (and also unreliable) data that you are sending to that client. */ + +void(vector org, float count) te_bloodqw = #239; +float(float a, float n) mod = #245; +int(string) stoi = #259; /* + Converts the given string into a true integer. Base 8, 10, or 16 is determined based upon the format of the string. */ + +string(int) itos = #260; /* + Converts the passed true integer into a base10 string. */ + +int(string) stoh = #261; /* + Reads a base-16 string (with or without 0x prefix) as an integer. Bugs out if given a base 8 or base 10 string. :P */ + +string(int) htos = #262; /* + Formats an integer as a base16 string, with leading 0s and no prefix. Always returns 8 characters. */ + +int(float) ftoi = #0; /* + Converts the given float into a true integer without depending on extended qcvm instructions. */ + +float(int) itof = #0; /* + Converts the given true integer into a float without depending on extended qcvm instructions. */ + +#ifndef dotproduct +#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2)) +#endif +vector(vector v1, vector v2) crossproduct = #0; /* + Small helper function to calculate the crossproduct of two vectors. */ + +float(float modidx, string framename) frameforname = #276; /* + Looks up a framegroup from a model by name, avoiding the need for hardcoding. Returns -1 on error. */ + +float(float modidx, float framenum) frameduration = #277; /* + Retrieves the duration (in seconds) of the specified framegroup. */ + +void(float buf, float fl) WriteFloat = #280; +string(float modidx, float framenum) frametoname = #284; +float(string name) checkcommand = #294; /* + Checks to see if the supplied name is a valid command, cvar, or alias. Returns 0 if it does not exist. */ + +float(string name) iscachedpic = #316; /* + Checks to see if the image is currently loaded. Engines might lie, or cache between maps. */ + +string(string name, optional float trywad) precache_pic = #317; /* + Forces the engine to load the named image. If trywad is specified, the specified name must any lack path and extension. */ + +#define draw_getimagesize drawgetimagesize +vector(string picname) drawgetimagesize = #318; /* + Returns the dimensions of the named image. Images specified with .lmp should give the original .lmp's dimensions even if texture replacements use a different resolution. */ + +float(vector position, float character, vector size, vector rgb, float alpha, optional float drawflag) drawcharacter = #320; /* + Draw the given quake character at the given position. + If flag&4, the function will consider the char to be a unicode char instead (or display as a ? if outside the 32-127 range). + size should normally be something like '8 8 0'. + rgb should normally be '1 1 1' + alpha normally 1. + Software engines may assume the named defaults. + Note that ALL text may be rescaled on the X axis due to variable width fonts. The X axis may even be ignored completely. */ + +float(vector position, string pic, vector size, vector rgb, float alpha, optional float drawflag) drawpic = #322; /* + Draws an shader within the given 2d screen box. Software engines may omit support for rgb+alpha, but must support rescaling, and must clip to the screen without crashing. */ + +float(vector position, vector size, vector rgb, float alpha, optional float drawflag) drawfill = #323; /* + Draws a solid block over the given 2d box, with given colour, alpha, and blend mode (specified via flags). + flags&3=0 simple blend. + flags&3=1 additive blend */ + +void(float x, float y, float width, float height) drawsetcliparea = #324; /* + Specifies a 2d clipping region (aka: scissor test). 2d draw calls will all be clipped to this 2d box, the area outside will not be modified by any 2d draw call (even 2d polygons). */ + +void(void) drawresetcliparea = #325; /* + Reverts the scissor/clip area to the whole screen. */ + +float(vector position, string text, vector size, vector rgb, float alpha, float drawflag) drawstring = #326; /* + Draws a string, interpreting markup and recolouring as appropriate. */ + +float(string text, float usecolours, optional vector fontsize) stringwidth = #327; /* + Calculates the width of the screen in virtual pixels. If usecolours is 1, markup that does not affect the string width will be ignored. Will always be decoded as UTF-8 if UTF-8 is globally enabled. + If the char size is not specified, '8 8 0' will be assumed. */ + +void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, optional float drawflag) drawsubpic = #328; /* + Draws a rescaled subsection of an image to the screen. */ + +#define getstati_punf(stnum) (float)(__variant)getstati(stnum) +int(float stnum) getstati = #330; /* + Retrieves the numerical value of the given EV_INTEGER or EV_ENTITY stat. Use getstati_punf if you wish to type-pun a float stat as an int to avoid truncation issues in DP. */ + +#define getstatbits getstatf +float(float stnum, optional float firstbit, optional float bitcount) getstatf = #331; /* + Retrieves the numerical value of the given EV_FLOAT stat. If firstbit and bitcount are specified, retrieves the upper bits of the STAT_ITEMS stat (converted into a float, so there are no VM dependancies). */ + +void(entity e, float mdlindex) setmodelindex = #333; /* + Sets a model by precache index instead of by name. Otherwise identical to setmodel. */ + +float(string effectname) particleeffectnum = #335; /* + Precaches the named particle effect. If your effect name is of the form 'foo.bar' then particles/foo.cfg will be loaded by the client if foo.bar was not already defined. + Different engines will have different particle systems, this specifies the QC API only. */ + +void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; /* + Draws the given effect between the two named points. If ent is not world, distances will be cached in the entity in order to avoid framerate dependancies. The entity is not otherwise used. */ + +void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; /* + Spawn a load of particles from the given effect at the given point traveling or aiming along the direction specified. The number of particles are scaled by the count argument. */ + +void(string s, ...) cprint = #338; /* + Print into the center of the screen just as ssqc's centerprint would appear. */ + +void(string s, ...) print = #339; /* + Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */ + +string(float keynum) keynumtostring = #340; /* + Returns a hunam-readable name for the given keycode, as a tempstring. */ + +float(string keyname) stringtokeynum = #341; /* + Looks up the key name in the same way that the bind command would, returning the keycode for that key. */ + +string(float keynum) getkeybind = #342; /* + Returns the current binding for the given key (returning only the command executed when no modifiers are pressed). */ + +void(float usecursor, optional string cursorimage, optional vector hotspot, optional float scale) setcursormode = #343; /* + Pass TRUE if you want the engine to release the mouse cursor (absolute input events + touchscreen mode). Pass FALSE if you want the engine to grab the cursor (relative input events + standard looking). If the image name is specified, the engine will use that image for a cursor (use an empty string to clear it again), in a way that will not conflict with the console. Images specified this way will be hardware accelerated, if supported by the platform/port. */ + +float(float effective) getcursormode = #0; /* + Reports the cursor mode this module previously attempted to use. If 'effective' is true, reports the cursor mode currently active (if was overriden by a different module which has precidence, for instance, or if there is only a touchscreen and no mouse). */ + +void(float sens) setsensitivityscaler = #346; /* + Temporarily scales the player's mouse sensitivity based upon something like zoom, avoiding potential cvar saving and thus corruption. */ + +string(float playernum, string keyname) getplayerkeyvalue = #348; /* + Look up a player's userinfo, to discover things like their name, topcolor, bottomcolor, skin, team, *ver. + Also includes scoreboard info like frags, ping, pl, userid, entertime, as well as voipspeaking and voiploudness. */ + +float(float playernum, string keyname, optional float assumevalue) getplayerkeyfloat = #0; /* + Cheaper version of getplayerkeyvalue that avoids the need for so many tempstrings. */ + +float() isdemo = #349; /* + Returns if the client is currently playing a demo or not */ + +float() isserver = #350; /* + Returns if the client is acting as the server (aka: listen server) */ + +void(string cmdname) registercommand = #352; /* + Register the given console command, for easy console use. + Console commands that are later used will invoke CSQC_ConsoleCommand. */ + +float(entity ent) wasfreed = #353; /* + Quickly check to see if the entity is currently free. This function is only valid during the two-second non-reuse window, after that it may give bad results. Try one second to make it more robust. */ + +string(string key) serverkey = #354; /* + Look up a key in the server's public serverinfo string */ + +float(string key, optional float assumevalue) serverkeyfloat = #0; /* + Version of serverkey that returns the value as a float (which avoids tempstrings). */ + +void(string evname, string evargs, ...) sendevent = #359; /* + Invoke Cmd_evname_evargs in ssqc. evargs must be a string of initials refering to the types of the arguments to pass. v=vector, e=entity(.entnum field is sent), f=float, i=int. 6 arguments max - you can get more if you pack your floats into vectors. */ + +float() readbyte = #360; +float() readchar = #361; +float() readshort = #362; +float() readlong = #363; +float() readcoord = #364; +float() readangle = #365; +string() readstring = #366; +float() readfloat = #367; +float() readentitynum = #368; +void(string newcaption) setwindowcaption = #0; /* + Replaces the title of the game window, as seen when task switching or just running in windowed mode. */ + +entity(entity from, optional entity to) copyentity = #400; /* + Copies all fields from one entity to another. */ + +void(entity ent, float colours) setcolors = #401; /* + Changes a player's colours. The bits 0-3 are the lower/trouser colour, bits 4-7 are the upper/shirt colours. */ + +entity(.string field, string match) findchain = #402; +entity(.float fld, float match) findchainfloat = #403; +void(vector org, vector dir, float count) te_blood = #405; +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; +void(vector org, optional float count) te_gunshot = #418; +void(vector org) te_spike = #419; +void(vector org) te_superspike = #420; +void(vector org) te_explosion = #421; +void(vector org) te_tarexplosion = #422; +void(vector org) te_wizspike = #423; +void(vector org) te_knightspike = #424; +void(vector org) te_lavasplash = #425; +void(vector org) te_teleport = #426; +void(vector org, float color, float colorlength) te_explosion2 = #427; +void(entity own, vector start, vector end) te_lightning1 = #428; +void(entity own, vector start, vector end) te_lightning2 = #429; +void(entity own, vector start, vector end) te_lightning3 = #430; +void(entity own, vector start, vector end) te_beam = #431; +void(vector dir) vectorvectors = #432; +float(entity e, float s) getsurfacenumpoints = #434; +vector(entity e, float s, float n) getsurfacepoint = #435; +vector(entity e, float s) getsurfacenormal = #436; +string(entity e, float s) getsurfacetexture = #437; +float(entity e, vector p) getsurfacenearpoint = #438; +vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; +void(entity e, string s) clientcommand = #440; +float(string s) tokenize = #441; +string(float n) argv = #442; +float() argc = #0; +void(entity e, entity tagentity, string tagname) setattachment = #443; /* */ + +searchhandle(string pattern, optional float caseinsensitive, optional float quiet) search_begin = #444; /* + initiate a filesystem scan based upon filenames. Be sure to call search_end on the returned handle. */ + +void(searchhandle handle) search_end = #445; /* */ + +float(searchhandle handle) search_getsize = #446; /* + Retrieves the number of files that were found. */ + +string(searchhandle handle, float num) search_getfilename = #447; /* + Retrieves name of one of the files that was found by the initial search. */ + +float(searchhandle handle, float num) search_getfilesize = #0; /* + Retrieves the size of one of the files that was found by the initial search. */ + +string(searchhandle handle, float num) search_getfilemtime = #0; /* + Retrieves modification time of one of the files in %Y-%m-%d %H:%M:%S format. */ + +string(string cvarname) cvar_string = #448; +entity(entity start, .float fld, float match) findflags = #449; +entity(.float fld, float match) findchainflags = #450; +void(entity player) dropclient = #453; +entity() spawnclient = #454; /* + Spawns a dummy player entity. + Note that such dummy players will be carried from one map to the next. + Warning: DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME are not implemented in quakespasm, so use KRIMZON_SV_PARSECLIENTCOMMAND's clientcommand builtin to change the bot's name/colours/skin/team/etc, in the same way that clients would ask. */ + +float(entity client) clienttype = #455; +void(float target, string str) WriteUnterminatedString = #456; +entity(float entnum) edict_num = #459; +strbuf() buf_create = #460; +void(strbuf bufhandle) buf_del = #461; +float(strbuf bufhandle) buf_getsize = #462; +void(strbuf bufhandle_from, strbuf bufhandle_to) buf_copy = #463; +void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #464; +string(strbuf bufhandle, string glue) buf_implode = #465; +string(strbuf bufhandle, float string_index) bufstr_get = #466; +void(strbuf bufhandle, float string_index, string str) bufstr_set = #467; +float(strbuf bufhandle, string str, float order) bufstr_add = #468; +void(strbuf bufhandle, float string_index) bufstr_free = #469; +float(float s) asin = #471; +float(float c) acos = #472; +float(float t) atan = #473; +float(float c, float s) atan2 = #474; +float(float a) tan = #475; +float(string s) strlennocol = #476; /* + Returns the number of characters in the string after any colour codes or other markup has been parsed. */ + +string(string s) strdecolorize = #477; /* + Flattens any markup/colours, removing them from the string. */ + +string(float uselocaltime, string format, ...) strftime = #478; +float(string s, string separator1, ...) tokenizebyseparator = #479; +string(string s) strtolower = #480; +string(string s) strtoupper = #481; +string(string s) cvar_defstring = #482; +void(vector origin, string sample, float volume, float attenuation) pointsound = #483; +string(string search, string replace, string subject) strreplace = #484; +string(string search, string replace, string subject) strireplace = #485; +vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; +float(float caseinsensitive, string s, ...) crc16 = #494; +float(string name) cvar_type = #495; +float() numentityfields = #496; /* + Gives the number of named entity fields. Note that this is not the size of an entity, but rather just the number of unique names (ie: vectors use 4 names rather than 3). */ + +float(string fieldname) findentityfield = #0; /* + Find a field index by name. */ + +typedef .__variant field_t; +field_t(float fieldnum) entityfieldref = #0; /* + Returns a field value that can be directly used to read entity fields. Be sure to validate the type with entityfieldtype before using. */ + +string(float fieldnum) entityfieldname = #497; /* + Retrieves the name of the given entity field. */ + +float(float fieldnum) entityfieldtype = #498; /* + Provides information about the type of the field specified by the field num. Returns one of the EV_ values. */ + +string(float fieldnum, entity ent) getentityfieldstring = #499; +float(float fieldnum, entity ent, string s) putentityfieldstring = #500; +string(string filename, optional float makereferenced) whichpack = #503; /* + Returns the pak file name that contains the file specified. progs/player.mdl will generally return something like 'pak0.pak'. If makereferenced is true, clients will automatically be told that the returned package should be pre-downloaded and used, even if allow_download_refpackages is not set. */ + +string(string in) uri_escape = #510; +string(string in) uri_unescape = #511; +float(entity ent) num_for_edict = #512; +float(string str) tokenize_console = #514; /* + Tokenize a string exactly as the console's tokenizer would do so. The regular tokenize builtin became bastardized for convienient string parsing, which resulted in a large disparity that can be exploited to bypass checks implemented in a naive SV_ParseClientCommand function, therefore you can use this builtin to make sure it exactly matches. */ + +float(float idx) argv_start_index = #515; /* + Returns the character index that the tokenized arg started at. */ + +float(float idx) argv_end_index = #516; /* + Returns the character index that the tokenized arg stopped at. */ + +string(string cvarname) cvar_description = #518; /* + Retrieves the description of a cvar, which might be useful for tooltips or help files. This may still not be useful. */ + +float(optional float timetype) gettime = #519; +string(string command, optional float bindmap) findkeysforcommand = #521; /* + Returns a list of keycodes that perform the given console command in a format that can only be parsed via tokenize (NOT tokenize_console). This always returns at least two values - if only one key is actually bound, -1 will be returned. The bindmap argument is listed for compatibility with dp-specific defs, but is ignored in FTE. */ + +string(string command, optional float bindmap) findkeysforcommandex = #0; /* + Returns a list of key bindings in keyname format instead of keynums. Use tokenize to parse. This list may contain modifiers. May return large numbers of keys. */ + +float(float v, optional float base) log = #532; /* + Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ + +float(string filename, strbuf bufhandle) buf_loadfile = #535; /* + Appends the named file into a string buffer (which must have been created in advance). The return value merely says whether the file was readable. */ + +float(filestream filehandle, strbuf bufhandle, optional float startpos, optional float numstrings) buf_writefile = #536; /* + Writes the contents of a string buffer onto the end of the supplied filehandle (you must have already used fopen). Additional optional arguments permit you to constrain the writes to a subsection of the stringbuffer. */ + +void(.../*, string funcname*/) callfunction = #605; /* + Invokes the named function. The function name is always passed as the last parameter and must always be present. The others are passed to the named function as-is */ + +float(string s) isfunction = #607; /* + Returns true if the named function exists and can be called with the callfunction builtin. */ + +float(entity e, string s, optional float offset) parseentitydata = #613; /* + Reads a single entity's fields into an already-spawned entity. s should contain field pairs like in a saved game: {"foo1" "bar" "foo2" "5"}. Returns <=0 on failure, otherwise returns the offset in the string that was read to. */ + +string(string fmt, ...) sprintf = #627; +float(entity e, float s) getsurfacenumtriangles = #628; +vector(entity e, float s, float n) getsurfacetriangle = #629; + + +//Builtin Stubs List (these are present for simpler compatibility, but not properly supported in QuakeSpasm at this time). +/* +void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; +void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; +void(vector org, vector color) te_explosionrgb = #407; +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; +void(vector org, vector vel, float howmany) te_spark = #411; +void(vector org) te_gunshotquad = #412; +void(vector org) te_spikequad = #413; +void(vector org) te_superspikequad = #414; +void(vector org) te_explosionquad = #415; +void(vector org) te_smallflash = #416; +void(vector org, float radius, float lifetime, vector color) te_customflash = #417; +void(vector org) te_plasmaburn = #433; +*/ +const float K_TAB = 9; +const float K_ENTER = 13; +const float K_ESCAPE = 27; +const float K_SPACE = 32; +const float K_BACKSPACE = 127; +const float K_UPARROW = 128; +const float K_DOWNARROW = 129; +const float K_LEFTARROW = 130; +const float K_RIGHTARROW = 131; +const float K_ALT = 132; +const float K_CTRL = 133; +const float K_SHIFT = 134; +const float K_F1 = 135; +const float K_F2 = 136; +const float K_F3 = 137; +const float K_F4 = 138; +const float K_F5 = 139; +const float K_F6 = 140; +const float K_F7 = 141; +const float K_F8 = 142; +const float K_F9 = 143; +const float K_F10 = 144; +const float K_F11 = 145; +const float K_F12 = 146; +const float K_INS = 147; +const float K_DEL = 148; +const float K_PGDN = 149; +const float K_PGUP = 150; +const float K_HOME = 151; +const float K_END = 152; +const float K_KP_SLASH = 168; +const float K_KP_STAR = 169; +const float K_KP_MINUS = 170; +const float K_KP_HOME = 164; +const float K_KP_UPARROW = 165; +const float K_KP_PGUP = 166; +const float K_KP_PLUS = 171; +const float K_KP_LEFTARROW = 161; +const float K_KP_5 = 162; +const float K_KP_RIGHTARROW = 163; +const float K_KP_END = 158; +const float K_KP_DOWNARROW = 159; +const float K_KP_PGDN = 160; +const float K_KP_ENTER = 172; +const float K_KP_INS = 157; +const float K_KP_DEL = 167; +const float K_COMMAND = -170; +const float K_MOUSE1 = 512; +const float K_MOUSE2 = 513; +const float K_MOUSE3 = 514; +const float K_JOY1 = 768; +const float K_JOY2 = 769; +const float K_JOY3 = 770; +const float K_JOY4 = 771; +const float K_AUX1 = 784; +const float K_AUX2 = 785; +const float K_AUX3 = 786; +const float K_AUX4 = 787; +const float K_AUX5 = 788; +const float K_AUX6 = 789; +const float K_AUX7 = 790; +const float K_AUX8 = 791; +const float K_AUX9 = 792; +const float K_AUX10 = 793; +const float K_AUX11 = 794; +const float K_AUX12 = 795; +const float K_AUX13 = 796; +const float K_AUX14 = 797; +const float K_AUX15 = 798; +const float K_AUX16 = 799; +const float K_AUX17 = 800; +const float K_AUX18 = 801; +const float K_AUX19 = 802; +const float K_AUX20 = 803; +const float K_AUX21 = 804; +const float K_AUX22 = 805; +const float K_AUX23 = 806; +const float K_AUX24 = 807; +const float K_AUX25 = 808; +const float K_AUX26 = 809; +const float K_AUX27 = 810; +const float K_AUX28 = 811; +const float K_AUX29 = 812; +const float K_AUX30 = 813; +const float K_AUX31 = 814; +const float K_AUX32 = 815; +const float K_MWHEELUP = 515; +const float K_MWHEELDOWN = 516; +const float K_MOUSE4 = 517; +const float K_MOUSE5 = 518; +const float K_LTHUMB = 822; +const float K_RTHUMB = 823; +const float K_LSHOULDER = 824; +const float K_RSHOULDER = 825; +const float K_ABUTTON = 826; +const float K_BBUTTON = 827; +const float K_XBUTTON = 828; +const float K_YBUTTON = 829; +const float K_LTRIGGER = 830; +const float K_RTRIGGER = 831; +const float K_PAUSE = 153; + + +//Reset this back to normal. +#pragma noref 0 diff --git a/QC_other/QC_keep/defs.qc b/QC_other/QC_keep/defs.qc new file mode 100644 index 00000000..f3c5288d --- /dev/null +++ b/QC_other/QC_keep/defs.qc @@ -0,0 +1,843 @@ +/*============================================================================== + + SOURCE FOR GLOBALVARS_T C STRUCTURE + +==============================================================================*/ + +// +// system globals +// +entity self; +entity other; +entity world; +float time; +float frametime; + +float force_retouch; // force all entities to touch triggers + // next frame. this is needed because + // non-moving things don't normally scan + // for triggers, and when a trigger is + // created (like a teleport trigger), it + // needs to catch everything. + // decremented each frame, so set to 2 + // to guarantee everything is touched +string mapname; + +float deathmatch; +float coop; +float teamplay; + +float serverflags; // propagated from level to level, used to + // keep track of completed episodes + +float total_secrets; +float total_monsters; + +float found_secrets; // number of secrets found +float killed_monsters; // number of monsters killed + + +// spawnparms are used to encode information about clients across server +// level changes +float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; + +// +// global variables set by built in functions +// +vector v_forward, v_up, v_right; // set by makevectors() + +// set by traceline / tracebox +float trace_allsolid; // both start and end vectors were in a solid (in the void) +float trace_startsolid; // the start point was in a solid +float trace_fraction; // how much of the vector (% from 0 to 1) was traced before it hit something +vector trace_endpos; // the final position (if it didn't hit anything, then this is the same as vec2, otherwise it's the impact point +vector trace_plane_normal; // the normal of the surface it hit +float trace_plane_dist; // used for angled surfaces +entity trace_ent; // the entity it hit (or world if it hit nothing) +float trace_inopen; // if some portion of the trace is in the air +float trace_inwater; // if some portion of the trace is in water (if it's in both air and water, both are set) + +entity msg_entity; // destination of single entity writes + +// +// required prog functions +// +void() main; // only for testing + +void() StartFrame; + +void() PlayerPreThink; +void() PlayerPostThink; + +void() ClientKill; +void() ClientConnect; +void() PutClientInServer; // call after setting the parm1... parms +void() ClientDisconnect; + +void() SetNewParms; // called when a client first connects to + // a server. sets parms so they can be + // saved off for restarts + +void() SetChangeParms; // call to set parms for self so they can + // be saved for a level transition + + +//================================================ +void end_sys_globals; // flag for structure dumping +//================================================ + +/*============================================================================== + SOURCE FOR ENTVARS_T C STRUCTURE +==============================================================================*/ +// +// system fields (*** = do not set in prog code, maintained by C code) +// +.float modelindex; // *** model index in the precached list +.vector absmin, absmax; // *** origin + mins / maxs + +.float ltime; // local time for entity +.float movetype; +.float solid; + +.vector origin; // *** +.vector oldorigin; // *** +.vector velocity; +.vector angles; +.vector avelocity; + +.vector punchangle; // temp angle adjust from damage or recoil + +.string classname; // spawn function +.string model; +.float frame; +.float skin; +.float effects; + +.vector mins, maxs; // bounding box extents reletive to origin +.vector size; // maxs - mins + +.void() touch; +.void() use; +.void() think; +.void() blocked; // for doors or plats, called when can't push other + +.float nextthink; +.entity groundentity; // Do not re-use, engine resets value all the time + +// stats +.float health; +.float frags; +.float weapon; // one of the IT_SHOTGUN, etc flags +.string weaponmodel; +.float weaponframe; +.float currentammo; +.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; + +.float items; // bit flags + +.float takedamage; +.entity chain; +.float deadflag; + +.vector view_ofs; // add to origin to get eye point + + +.float button0; // fire +.float button1; // use +.float button2; // jump + +.float impulse; // weapon changes + +.float fixangle; +.vector v_angle; // view / targeting angle for players +.float idealpitch; // calculated pitch angle for lookup up slopes + + +.string netname; + +.entity enemy; + +.float flags; + +.float colormap; +.float team; + +.float max_health; // players maximum health is stored here + +.float teleport_time; // don't back up + +.float armortype; // save this fraction of incoming damage +.float armorvalue; + +.float waterlevel; // 0 = not in, 1 = feet, 2 = waist, 3 = eyes +.float watertype; // a contents value + +.float ideal_yaw; +.float yaw_speed; + +.entity aiment; + +.entity goalentity; // a movetarget or an enemy + +.float spawnflags; + +.string target; +.string targetname; + +// damage is accumulated through a frame. and sent as one single +// message, so the super shotgun doesn't generate huge messages +.float dmg_take; +.float dmg_save; +.entity dmg_inflictor; + +.entity owner; // who launched a missile +.vector movedir; // mostly for doors, but also used for waterjump + +.string message; // trigger messages + +.float sounds; // either a cd track number or sound number + +.string noise, noise1, noise2, noise3; // contains names of wavs to play + +//================================================ +void end_sys_fields; // flag for structure dumping +//================================================ + +/*============================================================================== + VARS NOT REFERENCED BY C CODE +==============================================================================*/ +float FALSE = 0; +float TRUE = 1; +float NEGATIVE = -1; + +// edict.flags +float FL_FLY = 1; +float FL_SWIM = 2; +float FL_CLIENT = 8; // set for all client edicts +float FL_INWATER = 16; // for enter / leave water splash +float FL_MONSTER = 32; +float FL_GODMODE = 64; // player cheat +float FL_NOTARGET = 128; // player cheat +float FL_ITEM = 256; // extra wide size for bonus items +float FL_ONGROUND = 512; // standing on something +float FL_PARTIALGROUND = 1024; // not all corners are valid +float FL_WATERJUMP = 2048; // player jumping out of water +float FL_JUMPRELEASED = 4096; // for jump debouncing + +// edict.movetype values +float MOVETYPE_NONE = 0; // never moves +//float MOVETYPE_ANGLENOCLIP = 1; +//float MOVETYPE_ANGLECLIP = 2; +float MOVETYPE_WALK = 3; // players only +float MOVETYPE_STEP = 4; // discrete, not real time unless fall +float MOVETYPE_FLY = 5; +float MOVETYPE_TOSS = 6; // gravity +float MOVETYPE_PUSH = 7; // no clip to world, push and crush +float MOVETYPE_NOCLIP = 8; +float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters +float MOVETYPE_BOUNCE = 10; +float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size + +// edict.solid values +float SOLID_NOT = 0; // no interaction with other objects +float SOLID_TRIGGER = 1; // touch on edge, but not blocking +float SOLID_BBOX = 2; // touch on edge, block +float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground +float SOLID_BSP = 4; // bsp clip, touch on edge, block + +// range values +float RANGE_MELEE = 0; +float RANGE_NEAR = 1; +float RANGE_MID = 2; +float RANGE_FAR = 3; + +// deadflag values +float DEAD_NO = 0; +float DEAD_DYING = 1; +float DEAD_DEAD = 2; +float DEAD_RESPAWNABLE = 3; +float DEAD_REMOVE = 4; +float DEAD_EXPLODE = 5; +float DEAD_FINISHED = 6; + +// takedamage values +float DAMAGE_NO = 0; +float DAMAGE_YES = 1; +float DAMAGE_AIM = 2; + +// OVERRIDDEN +/* See defskeep.qc for IT_'s +// items +//float IT_AXE = 4096; +//float IT_SHOTGUN = 1; +//float IT_SUPER_SHOTGUN = 2; +//float IT_NAILGUN = 4; +//float IT_SUPER_NAILGUN = 8; +//float IT_GRENADE_LAUNCHER = 16; +//float IT_ROCKET_LAUNCHER = 32; +//float IT_LIGHTNING = 64; +//float IT_EXTRA_WEAPON = 128; + +// Used by the engine to update the Sbar with gfx type +//float IT_SHELLS = 256; +//float IT_NAILS = 512; +//float IT_ROCKETS = 1024; +//float IT_CELLS = 2048; + +//float IT_ARMOR1 = 8192; +//float IT_ARMOR2 = 16384; +//float IT_ARMOR3 = 32768; +//float IT_SUPERHEALTH = 65536; + +//float IT_KEY1 = 131072; +//float IT_KEY2 = 262144; + +//float IT_INVISIBILITY = 524288; +//float IT_INVULNERABILITY = 1048576; +//float IT_SUIT = 2097152; +//float IT_QUAD = 4194304; +*/ + +// point content values + +float CONTENT_EMPTY = -1; +float CONTENT_SOLID = -2; +float CONTENT_WATER = -3; +float CONTENT_SLIME = -4; +float CONTENT_LAVA = -5; +float CONTENT_SKY = -6; + +float STATE_TOP = 0; +float STATE_BOTTOM = 1; +float STATE_UP = 2; +float STATE_DOWN = 3; +float STATE_DISABLED = 4; +float STATE_ENABLED = 5; +float STATE_DELETE = 6; +float STATE_MOVING = 7; +float STATE_ONE = 1; +float STATE_TWO = 2; + +vector VEC_ORIGIN = '0 0 0'; + +// Minion Eggs = Scorpions, Spiders and Voreling +vector VEC_HULLE_MIN = '-2 -2 -2'; +vector VEC_HULLE_MAX = '2 2 2'; +vector VEC_HULLT_MIN = '-24 -24 0'; +vector VEC_HULLT_MAX = '24 24 40'; + +// Player +vector VEC_HULLSHORT_MIN = '-16 -16 -24'; +vector VEC_HULLSHORT_MAX = '16 16 32'; + +// Original ID Ogre, Shalrath, Demon, Shambler +vector VEC_HULL2_MIN = '-32 -32 -24'; +vector VEC_HULL2_MAX = '32 32 64'; + +// protocol bytes +//---------------------------------------------------------------------- +float SVC_DISCONNECT = 2; // Mainly used in client.qc +float SVC_UPDATESTAT = 3; // Force update of stats +float SVC_SETVIEW = 5; // Set camera viewpoint entity +float STAT_TOTALSECRETS = 11; //added total monster message +float STAT_TOTALMONSTERS = 12; +float SVC_TEMPENTITY = 23; +float SVC_SETPAUSE = 24; +float SVC_CENTERPRINT = 26; +float SVC_KILLEDMONSTER = 27; +float SVC_FOUNDSECRET = 28; +float SVC_SPAWNSTATICSOUND= 29; +float SVC_INTERMISSION = 30; +float SVC_FINALE = 31; +float SVC_CDTRACK = 32; +float SVC_SELLSCREEN = 33; +float SVC_CUTSCENE = 34; + +float TE_SPIKE = 0; +float TE_SUPERSPIKE = 1; +float TE_GUNSHOT = 2; +float TE_EXPLOSION = 3; +float TE_TAREXPLOSION = 4; +float TE_LIGHTNING1 = 5; +float TE_LIGHTNING2 = 6; +float TE_WIZSPIKE = 7; +float TE_KNIGHTSPIKE = 8; +float TE_LIGHTNING3 = 9; +float TE_LAVASPLASH = 10; +float TE_TELEPORT = 11; +float TE_EXPLOSION2 = 12; +float TE_BEAM = 13; + +/*------------------------------------------------------------------ +New particle types added by (rogue software) + +TE_EXPLOSION2 (coloured version of TE_EXPLOSION) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 228); // 247 + WriteByte (MSG_BROADCAST, 5); + + TE_BEAM used to draw a line between two points (grapple hook) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_BEAM); + WriteEntity (MSG_BROADCAST, h); + WriteCoord (MSG_BROADCAST, h.origin_x); + WriteCoord (MSG_BROADCAST, h.origin_y); + WriteCoord (MSG_BROADCAST, h.origin_z); + WriteCoord (MSG_BROADCAST, player.origin_x); + WriteCoord (MSG_BROADCAST, player.origin_y); + WriteCoord (MSG_BROADCAST, player.origin_z + 16); +------------------------------------------------------------------*/ + +// sound channels +// channel 0 never willingly overrides +// other channels (1-7) allways override a playing sound on that channel +float CHAN_AUTO = 0; +float CHAN_WEAPON = 1; +float CHAN_VOICE = 2; +float CHAN_ITEM = 3; +float CHAN_BODY = 4; +float CHAN_FEET = 5; +float CHAN_EXTRA1 = 6; +float CHAN_EXTRA2 = 7; + +float ATTN_NONE = 0; +float ATTN_NORM = 1; +float ATTN_FEETL = 1.5; +float ATTN_FEET = 2; +float ATTN_IDLE = 2; +float ATTN_ARMOUR = 2; +float ATTN_GIB = 2; +float ATTN_BREAK = 2; +float ATTN_WEAPON = 2.3; +float ATTN_LOW = 3; +float ATTN_STATIC = 3; +float ATTN_QUIET = 3.99; + +// update types +float UPDATE_GENERAL = 0; +float UPDATE_STATIC = 1; +float UPDATE_BINARY = 2; +float UPDATE_TEMP = 3; + +// entity effects +float EF_BRIGHTFIELD = 1; +float EF_MUZZLEFLASH = 2; +float EF_BRIGHTLIGHT = 4; +float EF_DIMLIGHT = 8; + +/* Stuff added by DP/community +// Fitz/QS protocol only supports effects up 256 +// defined in dpextensions.qc (here for quick reference) +float EF_NODRAW = 16; +float EF_ADDITIVE = 32; +float EF_BLUE = 64; +float EF_RED = 128; +float EF_NOGUNBOB = 256; +float EF_FULLBRIGHT = 512; +float EF_FLAME = 1024; +float EF_STARDUST = 2048; +float EF_NOSHADOW = 4096; +float EF_NODEPTHTEST = 8192; +float EF_DOUBLESIDED = 32768; +float EF_RESTARTANIM_BIT = 1048576; +float EF_TELEPORT_BIT = 2097152; +*/ + +// messages +float MSG_BROADCAST = 0; // unreliable to all +float MSG_ONE = 1; // reliable to one (msg_entity) +float MSG_ALL = 2; // reliable to all +float MSG_INIT = 3; // write to the init string + +//====================================================================== +// globals +//====================================================================== +float movedist; +float gameover; // set when a rule exits + +// make sure string_null remains NULL even after save/loading +// #define string_null __NULL__ +string string_null; // null string, nothing should be held here +//float empty_float; + +entity newmis; // launch_spike sets this after spawning it +entity activator; // the entity that activated a trigger or brush +entity damage_attacker; // set by T_Damage +float framecount; + +float skill; +float developer; + +//====================================================================== +// world fields (FIXME: make globals) +//====================================================================== +.string wad; +.string map; +.float worldtype; // 0=medieval 1=metal 2=base + +.string killtarget; + +//====================================================================== +// quakeed fields +//====================================================================== +.float light_lev; // not used by game, but parsed by light util +.float style; + +//====================================================================== +// monster ai +//====================================================================== +.void() th_stand; +.void() th_walk; +.void() th_run; +.void() th_missile; +.void() th_melee; +.void(entity inflictor, entity attacker, float damage) th_pain; +.void() th_die; + +.entity oldenemy; // mad at this player before taking damage +.float speed; + +.float lefty; + +.float search_time; +.float attack_state; + +float AS_RUNNING = 0; // Hunt mode (find player) +float AS_STRAIGHT = 1; // Running at player +float AS_SLIDING = 2; // Straft attack +float AS_MELEE = 3; // Melee attack +float AS_MISSILE = 4; // Range attack +float AS_JUMP = 5; // Jumping attack +float AS_TURRET = 6; // Turret Range attack +float AS_SIDESTEP = 7; // Turn 90 degrees and move to the side +float AS_BACKWARD = 8; // Turn 180 degrees and move backwards + +//====================================================================== +// player only fields +//====================================================================== +.float walkframe; + +.float attack_finished; +.float pain_finished; + +.float invincible_finished; +.float invisible_finished; +.float super_damage_finished; +.float radsuit_finished; + +.float invincible_time, invincible_sound; +.float invisible_time, invisible_sound; +.float super_time, super_sound; +.float rad_time; +.float fly_sound; + +.float axhitme; + +.float show_hostile; // set to time+0.2 whenever a client fires a + // weapon or takes damage. Used to alert + // monsters that otherwise would let the player go +.float jump_flag; // player jump flag +.float swim_flag; // player swimming sound flag +.float air_finished; // when time > air_finished, start drowning +.float bubble_count; // keeps track of the number of bubbles +.string deathtype; // keeps track of how the player died + +//====================================================================== +// object stuff +.string mdl; +.vector mangle; // angle at start +.float t_length, t_width; + +//====================================================================== +// doors, etc +.vector dest0, dest1, dest2; +.float wait; // time from firing to restarting +.float delay; // time from activation to firing +.entity trigger_field; // door's trigger entity +.string noise4; +.float dmg; // damage done by door when hit + +//====================================================================== +// monsters +.float pausetime; +.entity movetarget; +.float inpain; // Originally defined in zombie.qc + +//====================================================================== +// items +.float aflag; // Ammo quantity stored on items + +//====================================================================== +// misc +.float cnt; // misc flag + +//====================================================================== +// subs +.void() think1; +.vector finaldest, finalangle; + +//====================================================================== +// triggers +.float count; // for counting triggers + +//====================================================================== +// plats / doors / buttons +.float lip; +.float state; +.vector pos1, pos2, pos3; // top and bottom positions +.float height; + +//====================================================================== +// sounds +.float waitmin, waitmin2; /*, waitmax*/ +.float distance; +.float volume; + +//====================================================================== +// builtin functions +//====================================================================== +void(vector ang) makevectors = #1; // sets v_forward, etc globals +void(entity e, vector o) setorigin = #2; +void(entity e, string m) setmodel = #3; // set movetype and solid first +void(entity e, vector min, vector max) setsize = #4; +// #5 was removed +void() break = #6; +float() random = #7; // returns 0 - 1 +void(string s) dprint; +void(entity e, float chan, string samp, float vol, float atten) sound = #8; + +/*------------------------------------------------------------------------- +// A wrapper for the sound command, to help track down precache errors +//--------------------------------------------------------------------- +void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8; +void(entity e, float chan, string samp, float vol, float atten) sound = { + if (samp == "") { + dprint("\b[SOUND]\b Entity ("); dprint(e.classname); + dprint(") missing sound!\n"); + } + else sound_builtin (e, chan, samp, vol, atten); +}; */ + +vector(vector v) normalize = #9; +void(string e) error = #10; +void(string e) objerror = #11; +float(vector v) vlen = #12; +float(vector v) vectoyaw = #13; +entity() spawn = #14; +void(entity e) remove = #15; +//---------------------------------------------------------------------- +// sets trace_* globals +// nomonsters can be: +// An entity will also be ignored for testing if forent == test, +// forent->owner == test, or test->owner == forent +// a forent of world is ignored +//---------------------------------------------------------------------- +void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16; +entity() checkclient = #17; // returns a client to look for +entity(entity start, .string fld, string match) find = #18; +string(string s) precache_sound = #19; +string(string s) precache_model = #20; +void(entity client, string s)stuffcmd = #21; +entity(vector org, float rad) findradius = #22; +void(string s) bprint = #23; +void(entity client, string s) sprint = #24; +void(string s) dprint = #25; +string(float f) ftos = #26; +string(vector v) vtos = #27; +void() coredump = #28; // prints all edicts +void() traceon = #29; // turns statment trace on +void() traceoff = #30; +void(entity e) eprint = #31; // prints an entire edict +//---------------------------------------------------------------------- +.float movespeed; // Movement speed (linked to skill) +.float tetherlock; // Is the monster locked from movement +float(float yaw, float dist) walkmove_builtin = #32; // returns TRUE or FALSE +float(float yaw, float dist) walkmove = { + if (self.attack_state == AS_TURRET) return FALSE; + if (self.movespeed < 0) return FALSE; + if (self.tetherlock == TRUE) return FALSE; + return walkmove_builtin(yaw,dist); +}; +//---------------------------------------------------------------------- +// #33 was removed +float() droptofloor= #34; // TRUE if landed on floor +void(float style, string value) lightstyle = #35; +float(float v) rint = #36; // round to nearest int +float(float v) floor = #37; // largest integer <= v +float(float v) ceil = #38; // smallest integer >= v +// #39 was removed +float(entity e) checkbottom = #40; // true if self is on ground +float(vector v) pointcontents = #41; // returns a CONTENT_* +// #42 was removed +float(float f) fabs = #43; +vector(entity e, float speed) aim = #44; // returns the shooting vector +float(string s) cvar = #45; // return cvar.value +void(string s) localcmd = #46; // put string into local que +entity(entity e) nextent = #47; // for looping through all ents +void(vector o, vector d, float color, float count) particle = #48;// start a particle effect +void() ChangeYaw = #49; // turn towards self.ideal_yaw at self.yaw_speed +// #50 was removed +vector(vector v) vectoangles = #51; +//---------------------------------------------------------------------- +// direct client message generation +void(float to, float f) WriteByte = #52; +void(float to, float f) WriteChar = #53; +void(float to, float f) WriteShort = #54; +void(float to, float f) WriteLong = #55; +void(float to, float f) WriteCoord = #56; +void(float to, float f) WriteAngle = #57; +void(float to, string s) WriteString = #58; +void(float to, entity s) WriteEntity = #59; +//---------------------------------------------------------------------- +// broadcast client message generation +// void(float f) bWriteByte = #59; +// void(float f) bWriteChar = #60; +// void(float f) bWriteShort = #61; +// void(float f) bWriteLong = #62; +// void(float f) bWriteCoord = #63; +// void(float f) bWriteAngle = #64; +// void(string s) bWriteString = #65; +// void(entity e) bWriteEntity = #66; +//---------------------------------------------------------------------- +void(float step) movetogoal_builtin = #67; +void(float step) movetogoal = { + if (self.attack_state == AS_TURRET) return; + if (self.movespeed < 0) return; + if (self.tetherlock == TRUE) return; + movetogoal_builtin(step); +}; +//---------------------------------------------------------------------- +string(string s) precache_file = #68; // no effect except for -copy +void(entity e) makestatic = #69; +void(string s) changelevel = #70; +//#71 was removed +void(string var, string val) cvar_set = #72; // sets cvar.value +void(string var, string s, string s) cvar_setlong = #72; // sets cvar.value +//---------------------------------------------------------------------- +.float suppressCenterPrint; +void(entity client, string s) centerprint_builtin = #73; +void(entity client, string s, string s) centerprint_msg = #73; +void(entity client, string s, string s, string s) centerprint_msg3 = #73; +void(entity client, string s, string s, string s, string s) centerprint_msg4 = #73; +void(entity client, string s) centerprint = { + // Is the centerprint message being used by something else? + if (!client.suppressCenterPrint) + centerprint_builtin(client, s); + else { + // Send message to client console instead + sprint(client, "(centerprint) "); + sprint(client, s); + sprint(client, "\n"); + } +} +void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) centerprint_msg7 = #73; +void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) centerprint7 = { + // Is the centerprint message being used by something else? + if (!client.suppressCenterPrint) + centerprint_msg7(client, s1, s2, s3, s4, s5, s6, s7); + else { + // Send message to client console instead + sprint(client, "(centerprint) "); + sprint(client, s1); + sprint(client, s2); + sprint(client, s3); + sprint(client, s4); + sprint(client, s5); + sprint(client, s6); + sprint(client, s7); + sprint(client, "\n"); + } +} +//---------------------------------------------------------------------- +void(vector pos, string samp, float vol, float atten) ambientsound = #74; +string(string s) precache_model2 = #75; // not used anymore +string(string s) precache_sound2 = #76; // registered version only +string(string s) precache_file2 = #77; // not used anymore +void(entity e) setspawnparms = #78; // set parm1... to the values at level start for coop respawn + +/*====================================================================== + All global variables and func definitions from all other QC files +======================================================================*/ +// ai.qc +entity sight_entity; // Highlight an angry monster +float sight_entity_time; // Time got angry + +float(entity targ) infront; +float (entity targ) visible; +float(entity targ, float flat2d) range_distance; +float(float attackdist) ai_checkmelee; +float(entity targ) visblocked; +float(entity targ, vector s_offset, vector t_offset, float nomonsters) visxray; +float (entity targ, vector s_ofset, vector t_ofset) visblocked_wide; +float() FacingIdeal; +float(entity source, entity targ, float ignorenoshoot) ai_foundbreakable; + +// client.qc +float modelindex_eyes, modelindex_player; +float intermission_running; +float intermission_exittime; +string nextmap; // Used by GotoNextMap() +.float dmgtime; // Used by WaterMove() +.float poisonous; // A monster with poisonous attack +void(entity targ) BleedDeBuff; +void(entity targ) BurnDeBuff; +void(entity targ) PoisonDeBuff; + +// combat.qc +float DAMARMOR = 1; +float NOARMOR = 2; +float DAMAGEALL = 4; +float IGNORECLASS = 8; +void(entity targ, entity inflictor, entity attacker, float damage, float checkarmor) T_Damage; +void(entity inflictor, entity attacker, float damage, entity ignore, float checkclass) T_RadiusDamage; +float(entity targ, entity inflictor) CanDamage; + +// fight.qc +float enemy_vis, enemy_infront, enemy_range; +float enemy_yaw; + +// items.qc +.float healamount, healtype; +float (entity e, float healamount, float ignore) T_Heal; + +// monsters.qc +void() monster_sightsound; +void() monster_liquid_check; +void() monster_death_use; +void(float gib_no, float gib_qty) ThrowGib; +void() monster_ThrowGib; + +// subs.qc +void() SUB_Null; +void() SUB_UseTargets; +void() SUB_Remove; + +// traps_pendulum.qc +void() pendulum_setuparray; + +// weapon.qc +entity multi_ent; +float multi_damage; +void(entity targ) W_ChangeWeapon; +void(entity targ) W_SetCurrentAmmo; +float(entity targ) W_BestWeapon; +void() W_WeaponFrame; + +// ai_explosion.qc +void(float sprite_type, vector org, string expl_sound) SpawnExplosion; +void(vector org, float velrnd, float upbase, float uprnd) SpawnProjectileSmoke; +void(entity source, entity targ, float side) SpawnMeatSpray; +void(entity targ, vector org, vector vel, float part_qty) SpawnBlood; + +//====================================================================== +void() DummyFunction = //gets rid of the last compiler warnings ; - ) +{ + local string w; + local float l; + w = self.wad; + l = self.light_lev; +} \ No newline at end of file diff --git a/QC_other/QC_keep/defsclass.qc b/QC_other/QC_keep/defsclass.qc new file mode 100644 index 00000000..2c7f0bc2 --- /dev/null +++ b/QC_other/QC_keep/defsclass.qc @@ -0,0 +1,511 @@ +.float classtype; // Class type - used for quick reference +.float classgroup; // Class group - used for quick reference +.float classmove; // 1=Walk, 2=Fly, 4=Swim +.float classproj; // Projectile used by entity class + +//====================================================================== +// Unique Class Groups for quicker searches (mostly items) +// Previous system used classname (slow string search) +//====================================================================== +float CG_PLAYERS = 50; // All player/clients +float CG_HEALTH = 100; // All health pack types (15/25/+100) +float CG_AMMOITEM = 200; // All ammo items/packs +float CG_PROJALL = 205; // All monster projectiles +float CG_PROJSHELLS = 210; // To help with combining shell damage +float CG_PROJNAILS = 220; // Testing ammo resistance in t_damage +float CG_PROJROCKETS = 230; +float CG_PROJCELLS = 240; +float CG_MINIONEGG = 245; // Special minion eggs +float CG_WEAPON = 250; // All weapon items +float CG_ARMOR = 275; // All armor types +float CG_KEY = 300; // All keys (gold/silver/custom) +float CG_RUNE = 310; // All runes 1-4 +float CG_ARTIFACT = 350; // All powerups +float CG_TRAPS = 400; // Endless supply of traps! +float CG_MISCENT = 410; // All misc entity types +float CG_TEMPENT = 420; // All temporary types (gibs, smoke, sparks) +float CG_BREAKABLE = 430; // All breakable types +float CG_FUNCMOVER = 450; // All FUNC movers +float CG_MONSTERS = 500; // Default + +//---------------------------------------------------------------------- +// Useful for infighting grouping checks +//---------------------------------------------------------------------- +float CG_ARMY = 600; // (4) Shotgun, Rocket Launcher and Plasma +float CG_ENFORCER = 610; // (5) Standard, Grenade and Flame, Pyro, Centurion +float CG_DEMON = 615; // (3) Demon, Drole, Minotaur, Boglord, Lichfiend, Hephaestus +float CG_DOG = 620; // (1) Dog +float CG_FISH = 625; // (2) Fish +float CG_ROBOT = 630; // (2) Jim, Laser/Rocket, Seeker, Floyd +float CG_KNIGHT = 635; // (3) Knight, Death Guard and Crossbow +float CG_DKNIGHT = 637; // (2) Hell and Death Knight +float CG_DCAPTAIN = 640; // (2) Fury, Sergeant Captains +float CG_STONE = 645; // (4) Boss Eidolon, Statues and Golem +float CG_OGRE = 650; // (4) Vanilla and Hunter (Chainsaw, Mace, Hammer), Freddie +float CG_SPIDER = 660; // (4) Shalrath, Vorling, Wraith, Spider, Snakeman +float CG_SHAM = 666; // (1) Shambler +float CG_SPAWN = 670; // (2) Blue/Green, Boil +float CG_WIZARD = 680; // (6) Wizard, Gargoyle, Gaunt, Skull Wizard, Skull, Nour +float CG_ZOMBIE = 685; // (3) Zombie, Knight, Mummy +float CG_XMAS = 686; // (4) Elf, Raindeer, Snowman, Santa +float CG_BOSS = 690; // (3) Cthon, Old one, Anaconda +float CG_DRAGON = 695; // (9) Rogue Dragon, Drake Dragons, Drake Dragon King + +//====================================================================== +// Unique Class Types for quicker entity searches +// Previous system used classname (slow string search) +//====================================================================== +float CT_WORLD = 1; // World entity +float CT_PLAYER = 7; // Player (007) + +float CT_SPAWNSP = 10; // Spawn location - Single Player +float CT_SPAWNCOOP = 11; // Spawn location - Coop +float CT_SPAWNDM = 12; // Spawn location - Deathmatch +float CT_CONTROL = 15; // Controller entity +float CT_CAMERA = 16; // Camera entity (info_intermission) + +float CT_LIGHT = 20; // Light entity +float CT_SOUNDEMITTER = 22; // Sound emitter +float CT_DEVMARKER = 24; // Developer model marker +float CT_PATHCORNER = 26; // Standard path nodes + +float CT_ENEMYTARGET = 30; // Target enemy for flying enemies +float CT_ATTACHMENT = 32; // Attachment for entities +float CT_ESTATE = 34; // Entity state modifier +float CT_MAPVAR = 35; // Map Variable logic + +float CT_PARTICLE = 40; // A particle +float CT_PARTICLEEMIT = 41; // A particle emitter +float CT_PARTICLECONT = 42; // Particle controller (setup particle banks) +float CT_PARTICLETEMP = 45; // Particle emitter template + +float CT_TEMPGIB = 50; // Temporary entity (gib) +float CT_TEMPSPARK = 52; // Temporary entity (spark) +float CT_TEMPSTREAM = 54; // Temporary entity (stream) +float CT_REFLECTLIGHT = 55; // Reflection entity (Lightning) +float CT_REFLECTPLASMA = 56; // Reflection entity (Plasma) + +float CT_STORYCONTROL = 60; // Controller for story system +float CT_STORYBOOK = 62; // Story book for the player +float CT_STORYCHAPTER = 64; // Story chapter for story system + +float CT_TARGETDUMMY = 90; // Misc target dummy +float CT_TARGETNUMBER = 95; // Misc number drawn ingame + +//---------------------------------------------------------------------- +// Class Types for all monsters +//---------------------------------------------------------------------- +float CT_MONARMY = 100; // Army Soldier +float CT_MONARMYAXE = 101; // Axe Grunt +float CT_MONNEMESANT = 102; // Zerstorer Nemesant plus Drake additions +float CT_MONARCHER = 103; // Hexen2 Archer from Drake +float CT_MONVOMITUS = 104; // Vomitus from Qtest (Drake version) +float CT_MONRYU = 105; // Red Dragon from Drake +float CT_MONWYRM = 106; // Green Dragon from Drake +float CT_MONSHADE = 107; // Nightshade Dragon from Drake +float CT_MONBARON = 108; // Baron from Drake/SOE +float CT_MONSUPERGRUNT = 109; // Super Grunt from Kinn +float CT_MONENFORCER = 110; // Enforcer +float CT_MONSENTINEL = 111; // Sentinel from Quoth 2 +float CT_MONWILLYSPIDER = 112; // Willy the Spider +float CT_MONSNAKEMAN = 113; // Snakeman +float CT_MONFLOYD = 114; // Floyd robot +float CT_MONDEMON = 115; // 2 clawed fiend +float CT_MONDOG = 120; // 4 legged friend +float CT_MONFISH = 125; // Fish fish fishy +float CT_MONHELLK = 130; // Strong spikey Knights +float CT_MONKNIGHT = 140; // Small metal Knights +float CT_MONOGRE = 150; // Chainsaw wielding manics +float CT_MONOGREFISH = 155; // Madfox fishing ogre +float CT_MONSHAL = 160; // Shalrath / Vore +float CT_MONSHAM = 165; // Shambler +float CT_MONBOGLORD = 166; // Lord of the Bog! (Big shammy) +float CT_MONSPAWN = 170; // Bouncing annoying shit! +float CT_MONWIZARD = 180; // Wizard / Scrags +float CT_CACHEWIZARD = 181; // Special entity for precache of assets +float CT_MINIONWIZARD = 182; // Minion Spawning version for Nour Boss +float CT_MONZOMBIE = 185; // Rotten flesh +float CT_MONZOMBIEK = 186; // Undead Knights +float CT_MONCYBERDEMON = 187; // Doom Cyber Demon +float CT_MONHELLHOUND = 188; // Hell Hound +float CT_MONANACONDA = 189; // Anaconda +float CT_MONIDCHTHON = 190; // ID Software Chthon +float CT_MONXXCHTHON = 191; // Mapper Custom Chthon +float CT_MONFIRETOP = 192; // Firetop Mountain Chthon +float CT_MONIDSHUB = 195; // ID Software Shub-Niggurath +float CT_MONXXSHUB = 196; // Mapper Custom Shub-Niggurath +float CT_MONNOUR = 197; // Nour Boss +float CT_MONVIRTUS = 198; // Virtus worm boss +// New (death) Knight series (sock/necros) +float CT_MONDGUARD = 200; // HD Knight (Guard) +float CT_MONDCROSS = 205; // HD Knight (Crossbow) +float CT_MONDFURY = 210; // HD Knight (Fury) +float CT_MONDBLOOD = 215; // HD Hell Knight (Blood) +float CT_MONDKNIGHT = 220; // HD Hell Knight (Death) +float CT_MONDSERG = 225; // HD Hell Knight (Sergeant) +float CT_MONCOMM = 230; // HD Hell Knight (Commander) + +// New (hunter) Ogre series (sock/necros) +float CT_MONHOGRE = 250; // HD Ogre (Chainsaw) +float CT_MONHOGREMAC = 255; // HD Ogre (Mace) +float CT_MONHOGREHAM = 260; // HD Ogre (Hammer) + +// New base monster series (Inspired by lunaran/Quoth) +float CT_MONARMYROCKET = 270; // Army Soldier (Rocket) +float CT_MONARMYGRENADE = 272; // Army Soldier (Grenade) +float CT_MONARMYPLASMA = 275; // Army Soldier (Plasma) +float CT_MONDEFENDER = 280; // Enforcer SSG/GL (Defender) +float CT_MONELIMATOR = 285; // Enforcer Plasma (Eliminator) + +// Hexen 2 series (Raven Software) +float CT_MONSPIDER = 300; // Spiders (brown/green versions) +float CT_CACHESPIDER = 302; // Special entity for precache of assets +float CT_MINIONSPIDER = 304; // Minion Spawning version from wraith +float CT_MONSCORPION = 310; // Deadly Scorpion (HL Black Crab!) +float CT_CACHESCORPION = 312; // Special entity for precache of assets +float CT_MINIONSCORPION = 314; // Minion Spawning version from wraith +float CT_MONLOSTSOUL = 315; // The Original Doom flying lost soul +float CT_CACHELOSTSOUL = 317; // Special entity for precache of assets +float CT_MINIONLOSTSOUL = 319; // Minion Spawning version from skullwizard +float CT_MONSKULLW = 320; // Creepy Skull Wizard (Teleport) +float CT_MONGARGOYLE = 325; // Flying Gargoyle (Flying fireball) +float CT_MONGARGOYLE_MINI = 326; // Flying Impling +float CT_CACHEGARGOYLE = 327; // Special entity for precache of assets +float CT_MONGARGOYLE_MEGA = 328; // Flying Imp Lord +float CT_MINIONGARGOYLE = 329; // Minion Spawning version from minotaur +float CT_MONGOLEM = 330; // Giant stone Golem (ground slam) +float CT_MONICEGOLEM = 335; // Giant Ice Golem (shards+ground slam) +float CT_MONICEGOLEMWAVE = 337; // Wave targets for boss Ice Golem +float CT_MONMINOTAUR = 340; // Large tank like bull (magic/charge) +float CT_MONEIDOLON = 345; // Large demon boss Eidolon + +float CT_MONEIDOLONWAVE = 347; // Wave targets for boss Eidolon + + +float CT_MONWRAITH = 350; // Undead wraith (Burning debuff) +// Twisted Xmas MOD (Twisted Matrix) +float CT_MONELF = 351; // Little melee (knight) +float CT_MONRAINDEER = 352; // Rocket wielding stag (ogre) +float CT_MONSNOWMAN = 353; // Quick firing turret +float CT_MONSANTA = 354; // Good/bad santa (boss) +float CT_MONMUMMY = 355; // Undead mummy (Poison debuff) +float CT_MONMORPH = 356; // Guardian +float CT_MONBOIL = 360; // Slow moving zombie bomb +float CT_MONLAVAMAN = 361; // Hephaestus from Rogue +float CT_MONLICHFIEND = 362; // Headless fiend spawning boss +float CT_MONSEEKER = 364; // Robot replacement for Shambler +float CT_MONEEL = 365; // Sparky eel (electric projectile) from Rogue plus AD plasma shot +float CT_MONINVISSWORD = 366; // Invisible swordsman from Rogue +float CT_MONGREMLIN = 367; // Gremlin from Hipnotic + +// Quoth MOD (Kell/Necros/Preach) +float CT_MONVORELING = 370; // Little baby vorelings! ahh so cute! +float CT_CACHEVORELING = 372; // Special entity for precache of assets +float CT_MINIONVORELING = 374; // Minion Spawning version from shalrath +float CT_MONSWAMPLING = 375; // Tiny swamplings! ahh so cute! +float CT_MONDROLE = 380; // Fast moving tentacle tank with rockets +float CT_MONFREDDIE = 381; // Slow moving mechanical ogre mutant +float CT_MONGAUNT = 382; // Flying harpy thing with plasma bolts! +float CT_MONJIM = 385; // Jim the flying robot of doom! +float CT_MONJIMROCKET = 386; // Jim has a rocket launcher! +float CT_MONGUG = 387; // Gug! +float CT_MONPOLYP = 388; // Flying Polyp +float CT_MONVERMIS = 389; // Vermis + +float CT_MONPYRO = 390; // Enforcer Flame (Pyro) +float CT_MONENF_ULTRA = 391; // Ultra Enforcer +float CT_MONFUMIGATOR = 392; // Poison version of the Pyro +float CT_MONENF_MEGA = 393; // Mega Enforcer +float CT_MONCENTURION = 395; // Enforcer hoverboard (Plasma) + +//---------------------------------------------------------------------- +// Class Types for all projectiles in game (there is a lot!) +//---------------------------------------------------------------------- +float CT_PROJ_TRACE = 400; // Tracer shot (true aim) +float CT_PROJ_SMARTBALL = 401; // Nemesant bouncing fire ball +float CT_PROJ_TRACEPART = 402; // Tracer shot (extra particles) +float CT_PROJ_SHELLC = 405; // Shellcase projectile +float CT_PROJ_WILLY = 406; // Willy the Spider projectile +float CT_PROJ_CYBER = 407; // Cyber Demon rocket + + +float CT_PROJ_SG = 410; // SG projectile +float CT_PROJ_SSG = 412; // SSG projectile + + +float CT_PROJ_NG = 415; // NG projectile +float CT_PROJ_SNG = 416; // SNG projectile +float CT_PROJ_MONNG = 417; // NG monster projectile (glowing red) +float CT_PROJ_REFNG = 418; // Reflected (glowing red) +float CT_PROJ_HKN = 419; // Hell Knight Spike +float CT_PROJ_WBONE = 420; // Wraith Bone Bolt (nail) +float CT_PROJ_GROCK = 421; // Golem rock debris (pebble) +float CT_PROJ_SCORP = 422; // Scorpion Tail (nail) + +float CT_PROJ_SANTA = 424; // Santa Snowball shotgun! +float CT_PROJ_WIZ = 425; // Wizard Spit +float CT_PROJ_NOUR1 = 426; // Nour Spit +float CT_PROJ_MPOISON = 427; // Minotaur Poison Bolt (nail) +float CT_PROJ_WPOISON = 428; // Wraith Poison Bolt (nail) +float CT_PROJ_FURY2 = 429; // Fury Spit with grenade trail + + + + + +float CT_PROJ_BOLT1 = 435; // Crossbow Knight Bolt +hknight trail +float CT_PROJ_BOLT2 = 436; // Poison +float CT_PROJ_NOUR3 = 437; // Nour Lightning Bolt +float CT_PROJ_ENFHKN = 438; // Ultra Enforcer knight spike +float CT_PROJ_LAVANG = 439; // Lava nailgun +float CT_PROJ_LASER = 440; // Enforcer/Traps/Bob Laser +float CT_PROJ_PLASMA = 441; // Generic Plasma (blue laser version) +float CT_PROJ_LAVASNG = 442; // Lava super nailgun +float CT_PROJ_GAUNT = 443; // Gaunt Plasma bolt +float CT_PROJ_MINO = 444; // Minotaur Plasma bolt +float CT_PROJ_WBOLT = 445; // Wraith Hitscan Bolt +float CT_PROJ_BLBOLT = 446; // Boglord fast bolt +float CT_PROJ_LAVASPIK = 447; // Lava nail + +float CT_PROJ_BLBOLT2 = 449; // Boglord fast bolt (red) + + +float CT_PROJ_GL = 450; // Grenade projectile + +float CT_PROJ_GLMON = 452; // Monster grenades +float CT_PROJ_GLMONMULTI = 453; // Monster multi-grenades +float CT_PROJ_GLMONPROX = 454; // Monster grenades +float CT_PROJ_MEGG = 455; // Minion Egg (grenade arc+bounce) + + + + +float CT_PROJ_FLESH = 460; // Zombie Flesh (grenade arc) + +float CT_PROJ_FLESHP = 462; // Zombie Poison Flesh (grenade arc) +float CT_PROJ_SWAMP = 463; // Swampling Spit (grenade arc) +float CT_PROJ_ELF = 464; // Elf snowball (grenade arc) +float CT_PROJ_SPID = 465; // Spider Spit (grenade arc) +float CT_PROJ_VORE = 466; // Voreling Spit (grenade arc) +float CT_PROJ_NOUR2 = 467; // Nour Spit bomb! (grenade arc+bounce) +float CT_PROJ_CHTHON2 = 468; // Chthon Frenzy (grenade arc) +float CT_PROJ_SHUB2 = 469; // Shub Frenzy (grenade arc) +float CT_PROJ_ROCKET = 470; // Rocket projectile +float CT_PROJ_LAVA = 471; // Chthon Lavaball +float CT_PROJ_FIRETOP = 472; // Chthon Lavaball (less splash dmg) +float CT_PROJ_CHTHON = 473; // Custom Chthon Lava/Slime ball +float CT_PROJ_GARG = 475; // Gargoyle fireball +float CT_PROJ_SKULLW = 477; // Skull Wizard Skull (rocket) +float CT_PROJ_SKULLWP = 478; // Skull Wizard Skull (poison rocket) +float CT_PROJ_FURY1 = 480; // Fury Knight spike ball +rocket trail +float CT_PROJ_ARMY = 482; // Army rocket +float CT_PROJ_JIM2 = 483; // Jim robot rocket +float CT_PROJ_SEEKER = 484; // Seeker robot rocket +float CT_PROJ_DROLE = 485; // Drole fireball +float CT_PROJ_BLORD = 487; // Bog Lord Slime bomb +float CT_PROJ_BLORD2 = 488; // Bog Lord Red Slime bomb +float CT_PROJ_EIDO1 = 490; // Eidolon boulder +float CT_PROJ_ICEG1 = 492; // Ice Golem ice shard +float CT_WANDSPARK = 493; // Magic wand normal spark +float CT_WANDBIGSPARK = 494; // Magic wand large burst +float CT_PROJ_SHAL = 495; // Shalrath spike ball +purple trail +float CT_PROJ_SERG = 496; // Death Sergeant spike ball +hknight trail +float CT_PROJ_SHUB1 = 497; // Custom Shub homing spike attack +float CT_PROJ_RAINDEER = 498; // Raindeer rocket + + +//---------------------------------------------------------------------- +float CT_UPGRADE_AXE = 500; // Shadow Axe +float CT_AXE = 501; // Axe +float CT_SHOTGUN = 505; // Shotgun +float CT_SUPER_SHOTGUN = 510; // Super Shotgun +float CT_UPGRADE_SSG = 515; // The Widowmaker Shotgun +float CT_NAILGUN = 520; // Nailgun +float CT_LAVANG = 521; // Lava nailgun +float CT_SUPER_NAILGUN = 525; // Super Nailgun +float CT_LAVASNG = 526; // Lava nailgun +float CT_WAND = 527; // Magic Wand (Drake) +float CT_GRAPPLE = 528; // Grapple (Rogue with Drake upgrades) +float CT_CHAINLIGHTGUN = 529; // Chain Lightning Gun +float CT_GRENADE_LAUNCHER = 530; // Grenade Launcher +float CT_PROXIMITY_GUN = 531; // Grenade Launcher +float CT_MULTI_GRENADE = 532; // Multi Grenade Launcher +float CT_MULTI_ROCKET = 533; // Multi Rocket Launcher +float CT_BLASTERWEP = 534; // Drake Laser Blaster +float CT_ROCKET_LAUNCHER = 535; // Rocket Launcher +float CT_LIGHTNING = 540; // Lightning Gun +float CT_UPGRADE_LG = 545; // Plasma Gun +float CT_PLASMAGUN = 546; // Rogue Plasma Gun +float CT_MJOLNIR = 547; // Mjolnir's Hammer +float CT_EXTRA_WEAPON = 548; // Extra Weapon (Crossbow) +float CT_LASER_CANNON = 549; // Laser Cannon +float CT_ARTSUIT = 550; // Environment suit +float CT_CIRCUIT = 551; // Circuit Board collectible (17mm Fromitz board from Rubicon2) +float CT_CHAINSAW = 552; // Chainsaw (Zerstorer with Drake upgrades) + + +float CT_ARTPENT = 555; // Pentagram - Invulnerability +float CT_ARTINVS = 560; // Ring of Shadows +float CT_ARTQUAD = 565; // Quad Damage +float CT_ARTSHARP = 570; // Sharp Shooter +float CT_ARTPIERCE = 575; // Nail Piercer + + + + + + + +float CT_ARTTOME = 590; // Tome of Power +float CT_ARTPSHIELD = 591; // Power Shield +float CT_ARTGRAVBELT = 592; // Anti-Gravity Belt +float CT_ARTWETSUIT = 593; // Wetsuit +float CT_ARTEMPATHY = 594; // Empathy Shield +float CT_ARTHORNCONJ = 595; // Horn of Conjuring +float CT_ARTTHERMSUIT = 596; // Thermal Protection Suit +float CT_ARTTRINITY = 597; // Trinity +float CT_ARTCROSS = 598; // Cross of Deflection +float CT_ARTHORN = 599; // Horn of Conjuring +float CT_SILVERKEY = 600; // Silver key +float CT_GOLDKEY = 605; // Gold key +float CT_CUSTOMKEY = 610; // Custom key +float CT_CUSTOMITEM = 615; // Custom pickup item +float CT_RUNEKEY = 620; // End of Level rune keys 1-4 +float CT_ARTBERSERK = 621; // Berserker Helm, Drake +float CT_ARTEQUALIZER = 622; // Equalizer Twin Shot, Drake +float CT_ARTLEVITATION = 623; // Boots of Levitation, Drake +float CT_ARTOPTIMIZER = 624; // Shotgun Optimizer, Drake +float CT_SIGILBANE = 625; // Seal of Bane, Drake + +float CT_SPIKESHOOTER = 650; // Trap SPIKE shooter +float CT_GRENADESHOOTER = 652; // Trap GRENADE shooter +float CT_ROCKETSHOOTER = 654; // Trap ROCKET shooter +float CT_LIGHTSHOOTER = 656; // Trap LIGHTNING shooter +float CT_GASSHOOTER = 658; // Trap GAS shooter +float CT_EXPLO_BOX = 660; // Exploding box +float CT_PENDULUM = 662; // Swing Pendulum +float CT_SAWBLADE = 666; // Saw Blade + +float CT_FIREBALL = 670; // Misc Fireball +float CT_MISCSPARK = 672; // Misc Spark +float CT_MISCSHAKE = 676; // Misc Shake of screen/player +float CT_MISCDRIP = 680; // Misc Drip (water) +float CT_BUBBLE = 682; // Bubbles +float CT_MISCMODEL = 690; // Misc Model +float CT_MISCSMOKE = 692; // Misc Smoke + +//---------------------------------------------------------------------- +float CT_AMMOPACK = 700; // Ammo Backpacks +float CT_AMMORANDOM = 702; // Random Ammo Backpack +float CT_AMMOSHELLS = 710; // Different ammo types +float CT_AMMONAILS = 720; +float CT_AMMOROCKETS = 730; +float CT_AMMOCELLS = 740; +float CT_AMMOPOISON = 741; +float CT_AMMOBOLTS = 742; +float CT_AMMOLAVANAILS = 743; +float CT_AMMOMULTIROCKETS = 744; +float CT_AMMOPLASMA = 745; + + + + +float CT_HEALROT = 750; // Different Health packs + + + + +float CT_HEALNORM = 755; + + + + +float CT_HEALMEGA = 760; + +float CT_ARMOR1 = 770; // Green armour +float CT_ARMOR2 = 775; // Yellow armour +float CT_ARMORINV = 790; // Red armour + + +//---------------------------------------------------------------------- +float CT_FUNCDOOR = 800; // Func door +float CT_FUNCDOORTRIG = 801; // Generated touch trigger around door +float CT_FUNCSECDOOR = 805; // Func SECRET door +float CT_FUNCBUTTON = 810; // Func button + +float CT_FUNCPSWITCH = 812; // Func Pressure Switch +float CT_FUNCINSVOLUME = 813; // Func to detect inside volume + +float CT_FUNCBOB = 815; // Func bobbing bmodels +float CT_FUNCTRAIN = 820; // Func train +float CT_FUNCWALL = 830; // Func wall +float CT_FUNCILLUSIONARY = 832; // Func illusionary +float CT_FUNCLASER = 834; // Func laser +float CT_FUNCSKILL = 836; // Func_skill pillars + +float CT_FUNCBREAK = 840; // Func breakable (parent) +float CT_FUNCBREAKWALL = 841; // Bmodel to activate after breakage +float CT_FUNCBREAKMDL = 845; // Func breakable (model) +float CT_FUNCBREAKSPN = 846; // Func breakable (spawner) +float CT_FUNCBREAKOBJ = 847; // Func breakable (rubble)) +float CT_FUNCPUSHABLE = 850; // Func pushable + +float CT_FUNCEPISODEGATE = 875; // Episode gates (not used anymore) +float CT_FUNCBOSSGATE = 880; // Final boss gate (not used anymore) +float CT_FUNCPLAT = 890; // Old platform system +float CT_FUNCLIFT = 895; // New platform system + +//---------------------------------------------------------------------- +float CT_TRIGONCE = 900; // Once, volume + +float CT_TRIGMULTI = 905; // Multiple, volume + +float CT_TRIGRELAY = 910; // Relay, point entity no touch + +float CT_TRIGDOORSTATE = 914; // Set func_door to specific state +float CT_TRIGRELAYDELAY = 915; // Relay, point entity no touch + +float CT_TRIGCOUNT = 920; // Count, point entity no touch + +float CR_TRIGENG = 922; // Engine, point entity no touch + +float CT_TRIGRUNES = 925; // Rune, volume +float CT_TRIGSKILLS = 927; // Skill, volume +float CT_TRIGTELEPORT = 930; // Trigger teleport +float CT_MISCTELEPORT = 932; // info_teleport_destination +float CT_SKULLTELEPORT = 934; // info_skullwiz_destination +float CT_TRIGEXPLODE = 945; // Trigger sprite explosion +float CT_TRIGSECRET = 950; // Secret, volume +float CT_TRIGLADDER = 955; // Ladder, volume + +float CT_TRIGFOG = 957; // Fog, volume + +float CT_TRIGHURT = 960; // Hurt, volume + +float CT_TRIGGIVEITEM = 964; // Give items, volume +float CT_TRIGHEAL = 965; // Heal, volume + +float CT_TRIGTSOUND = 968; // Touch sounds, volume + +float CT_TRIGPUSH = 970; // Push, volume + +float CT_TRIGLEVEL = 975; // Change level +float CT_TRIGSKYBOX = 976; // Change/Load Skybox console command +float CT_TRIGITEMFLAG = 977; // Change item spawnflags +float CT_TRIGCLMSG = 978; // Message to all clients +float CT_TRIGCDTRACK = 979; // Change CD track +float CT_TRIGMONJUMP = 980; // Triger monster to jump forward +float CT_TRIGNOJUMP = 981; // Trigger monster to NOT jump! +float CT_TRIGMONDROP = 982; // Trigger monster to fall naturally + +float CT_TRIGMONTURRET = 985; // Trigger monster to turn into turret + +float CT_TRIGMONMOVE = 987; // Trigger monster movement state +float CT_TRIGMONBREAK = 990; // Trigger monster/breakable together + +float CT_TRIGMONKILL = 992; // Trigger monster to be killed + +float CT_TRIGMONATT = 996; // Trigger monster to attack something + +float CT_TRIGVOID = 999; // Skybox garbage collector! +//---------------------------------------------------------------------- \ No newline at end of file diff --git a/QC_other/QC_keep/defscustom.qc b/QC_other/QC_keep/defscustom.qc new file mode 100644 index 00000000..b26364ed --- /dev/null +++ b/QC_other/QC_keep/defscustom.qc @@ -0,0 +1,1288 @@ +//====================================================================== +// Author : Simon "Sock" OCallaghan +// Website: www.simonoc.com +//====================================================================== +nosave float configflag; // Temp cvar used to hold serverflags until live +nosave float temp1flag; // Temp cvar used to hold temp1 console flag +nosave float prethink; // always runs everytime the map is start/load/quickload +nosave float postthink; // Used once after map load +nosave float coop_cvar; // Has the coop cvar been read from console +nosave float skill_cvar; // Has the skill cvar been read from console +nosave float autoaim_cvar; // What is the current state of autoaim +nosave float mapvar_cvar; // Detects if map variables have been loaded + +// Client related features +entity client_ent; // Client entity that started server +entity camera_ent; // Start of the info_intermission camera chain +entity coop_ent; // Start of the info_coop spawn locations +float coop_artifacts; // Do artifacts drop from backpacks for coop +float coop_ammoboxes; // Override ammo boxes respawning in coop +float coop_weapons; // Toggle weapons respawning in coop +float coop_health; // Toggle health packs respawning in coop +float coop_powerups; // Toggle powerups respawning in coop +float trig_cdtrack; // Trigger changed CD track +string trig_skybox; // Trigger changed Skybox +float engine; // Type of engine active 0=Fitz, 1=DP, 2=FTE +float ext_active; // PR extenstions active (DP/FTE) +float ext_dpfog; // Extra DP fog parameters +float ext_dppart; // Extra DP particle system +float ext_dpsurf; // Extra DP query surface information +float ext_dprain; // Extra DP particle rain system +float ext_dpsnow; // Extra DP particle snow system +//float ext_dprot; // Extra DP rotating bmodel system +float pixelmode; // Change texture pixel mode (linear/nearest) +float playerprojsize; // Player projectiles 0=Large or 1=Small +entity gibitem; // Latest gib to be generated +float gibstone; // Has stone gibs been precached +float gibpoison; // Has poison gibs been precached +float liquid_alpha; // Stores water alpha, used for monster sight checks +float map_gravity; // Current map gravity setting +float map_bodyflrcheck; // Check floor for monster dead bodies +float map_bodyfadeaway; // Fade all dead monster bodies (time in secs) +entity debugent1, debugent2, debugent3; // Used on wide visibility tests + +// Worldspawn features +.float alpha; // Alpha value (requires modern engine) +.float gravity; // per-entity gravity (support added in engines after hipnotic xpac) +.float water_alpha; // Map specific alpha value for water surfaces +//.float proj_shotgun; // Enable/Disable projectile shotgun +.float upgrade_axe; // Upgrade the axe with new weapon +.float upgrade_ssg; // Upgrade Super Shotgun with new weapon +.float upgrade_lg; // Upgrade Lightning Gun with new weapon +.float no_item_offset; // All ammo + heal items to use central rotation +.float no_item_rotate; // No random rotated for all items (ammo/heal/misc) +.float no_zaware; // Switch OFF zaware monsters +.float no_sgprojectile; // Switches OFF ALL shotgun projectiles +.float no_sgcasing; // Switches OFF ALL shotgun casings +.float no_bigprojectiles; // Switches OFF large player projectiles size +.float no_liquiddmg; // Blocks liquid damage checks for monsters +.float no_surfacecheck; // Stops surface checks for large maps +.float sprite_particles; // Forces all particles to be dots/sprites +.float knight_defskin; // Default skin (0-3) type for new knight model +.float give_weapons; // Which weapons the player always starts with +.float take_weapons; // Which weapons the player never starts with +.float reset_health; // Reset health to this value upon spawning +.float bodyflrcheck; // Check floor for monster dead bodies +.float bodyfadeaway; // Time in seconds before body/head fades away +.vector mapvar_update; // Update map variables (Range X->Y=Z) + +// Global fog system +float fog_active; // Global fog values are active +entity fog_control; // Global fog controller (unique to map) +.float fog_density; // Global fog density when map loads +.vector fog_colour; // Global fog colour when map loads +.string fog_dpextra; // Extra parameters for DP engine +.float fog_currden; // Current fog density +.float fog_targden; // Target fog density +.float fog_diffden; // Difference between current and target +.vector fog_currcol; // Current fog colour (RGB) +.vector fog_targcol; // Target fog colour (RBG) +.vector fog_diffcol; // Difference between current and target +.float fog_difftime; // Amount of time to fade fog (seconds) +.float fog_steptime; // Amount of steps to fade (20 per second) + +// General features +.float moditems; // New items flag for new stuff in the mod +.float customkey; // Bit flag for custom keys (func_door) +.float bsporigin; // All bmodel origins are 0,0,0 check this first +.float savedeffects; // Saved effects to apply after spawn +.float nightmare; // Only spawn entity if nightmare skill active +.float cooponly; // Only spawn entity if coop gameplay active +.float startspawn2; // player_start2 unique spawn location number +.entity activate; // When something is triggered, this is the culprit! +.entity bmodel_act; // Trigger bmodel generic touch/kill/use functions +.float bboxtype; // Different types of bounding box setups +.vector bbmins; // Saved bounding box size (minimum) +.vector bbmaxs; // Saved bounding box size (maximum) +.vector idmins; // Original ID bounding box (min) +.vector idmaxs; // Used for stuck issues in original id maps +.entity touching; // The trigger entity that is touching +.string startmsg; // Start message for trigger_counter entity +.string message2; // Additional messages for all entities +.string message3; // Used by misc_books for addtional text +.string message4; // Used by misc_books for addtional text +.string target2; // Secondary target field (additional fires) +.void() touch2; // Used by items for final touch function +.float projeffect; // Special effects and states active +.float gibhealth; // The negative health value for gibbing +.float gibbed; // true/false flag on body state +.float touchedvoid; // true/false flag if touched void bmodel +.float touchedliquid; // true/false flag if touched fake liquid +.string touchedsound; // Sound string for fake liquid exit +.string headmdl; // Head model for gib routine +.float bleedcolour; // Alternative colour for 'bleeding' objects +.float locksounds; // Locked sound for doors etc +.float skin_override; // Override skin selection based on world theme +.float frame_override; // Override frame number (ammo_boxes) +.float frame_box; // Set frame number for model animation (-1=random) +.float item_flrcheck; // Check the floor surface under items +.float item_expired; // Removal timer for item in item_thinkloop +.float item_skinanim; // Does the skin require animating? +.float item_skincycle; // Skin animations are usually 0.3s (health packs) +.float item_skinanim_no; // Skin no for animation groups +.float noradiusdmg; // Block all T_RadiusDamage, stops grenade spam +.float nodebuginfo; // Blocks certain debug info for entities +.float onladder; // Update state from ladder entity to client +.entity entladder; // Ladder entity for reference (time, sounds etc) +.float timeladder; // Amount of time before playing climb sound +.entity attachment; // 1st Entity attachment (additional model) +.entity attachment2; // 2nd entity attachment (additional model) +.entity attachment3; // 3rd entity attachment (additional model) +.entity sound_emitter; // Used by various entities for add sound +.float check_weather; // Checks for weather system on sound emitters +.float entno_unique; // Unique number for linking entities +//.string str_unique; // Unique string name for testing +.string ckeyname1, ckeyname2, ckeyname3, ckeyname4; // Custom key netnames +.float ckeyhint; // Hint to the player about inventory key + +// Pressure switch/ volume trigger parameters +.float presstype; // 0/1 if touching entity type is valid +.float presstimersound; // Timer for sound FX (stops repeating) +.float no_deadbody; // Monster dead bodies don't work with trigger + + +// Item respawning parameter +.float respawn_time; // Amount of time to spend respawning item +.float respawn_count; // Total amount of times to respawn an item +.float respawn_trig; // Wait for a trigger before respawning +.float respawn_effect; // Show particle effect for respawning items +.float respawn_style; // Which particle colour and pattern to use +.vector respawn_ofs; // Z axis height for respawn burst +.entity respawn_part; // Respawn particle emiiter link on items + +// AI Pathing (corners/trains) +.float direction; // Travel direction for func_trains +.float corner_route; // Change path_corner route (1-3 routes, 4=exact, 5=random) +.float corner_switch; // Change spawnflags REVERSE (-1=NO, 1=YES, 2=Toggle) +.float corner_pause; // Change spawnflags NOPAUSE (-1=NO, 1=YES, 2=Toggle) +.float corner_speed; // Change path_corner speed (def=100) +.string corner_event; // Special target event on path_corners +.string targetback; // Override backwards pathing route on path_corners +.entity movetarget2; // Additional move target for AI pathing +.entity movetarget3; // Additional move target for AI pathing +.entity movelast; // The last AI pathing corner been at + +// Ingame number displays +.float targetnumber; // Float number to pass to misc_targetnumber +.entity tno1, tno2, tno3, tno4, tno5, tno6, tno7, tno8; // Entity digits + +// Entity state system +.float estate_trigger; // Entity state to be applied to target +.float estate; // Entity state (off,on and disable) +.void() estate_on; // Entity state ON function +.void() estate_off; // Entity state OFF function +.void() estate_disable; // Entity state DISABLE function +.void() estate_use; // Entity state USE function +.void() estate_fire; // Entity state USE++ function +.void() estate_reset; // Entity state RESET function +.void() estate_aframe; // Entity state AFRAME function + +// Breakable system +.float brksound; // Initial sound type +.float brkimpsound; // Impact sound type +.float brkimpqty; // Total impact sounds setup +.float brkobjects; // Breakable sub object type +.string brkobj1; // Breakable object 1 (bsp/mdl) +.string brkobj2; // Breakable object 2 (bsp/mdl) +.string brkobj3; // Breakable object 3 (bsp/mdl) +.string brkobj4; // Breakable object 4 (bsp/mdl) +.float brkobjqty; // Total breakable sub objects setup +.vector brkvelbase; // Base amount for velocity of broken parts +.vector brkveladd; // Random additions for velocity of broken parts +.float brkavel; // Amount of breaking object angle velocity +.float brkfade; // Fade time before rumble fades away +.vector brkvol; // Spawning volume for breakable point entity +.float brkgravity; // Change the gravity for rumble, useful for underwater +.float brkmondmg; // Damage multipler for monster attacks +.float brktrigmissile; // Trigger breakable if hit by - rocket/grenade/shalball +.float brktrigjump; // Trigger breakable if hit by jumping monster attack +.float brktrignoplayer; // Players cannot damage this breakable + +// Monster features +.float bossflag; // Flag set on all bosses +.entity enemytarget; // flying monsters enemy target +.float debuglvl; // Used to debug monsters behaviour +.float randomskin; // 0=nothing, x=random number of skins +.float exactskin; // 1-x exact skin number to choose + +.void() th_checkattack; // Which check attack function to use +.void() th_slide; // Mainly used by wizard monster +.void() th_charge; // Mainly used by Hell/Death Knight monsters +.void() th_altstand; // Alternative stand animation (Knights only) +.void() th_wakeup; // Special wakeup animations before combat +.void() th_jump; // Special jump animation for jumpers! +.void() th_jumpexit; // Exit animation to stop flying (stuck) +.void() th_updmissile; // Update monster missiles while flying +.void() th_gibdie; // Special function for gib death + +.float liquidbase; // Liquid content at base of model (feet) +.float liquidcheck; // Timer to prevent over checking of liqdmg +.float liquidblock; // Cannot see through liquids for wakeup +.float distmin; // Minimum amount of distance to teleport +.float distmax; // Maximum amount of distance to teleport + +.float attack_elev; // Iternative attack angle for zaware monsters +.float move_elev; // Z movement adjustment for flying units +.vector move_state; // AI state movement; Stand, Walk & Run +.float bouncegrenade; // All grenades bounce off monster body +.float reflectlightning; // All Lightning strikes are reflected +.float reflectplasma; // All plasma projectiles are reflected +.float reflectnails; // All NG/SNG projectiles are reflected +.entity reflectent; // Entity to generate lightning from + +.vector attack_track; // Iternative tracking for range attacks +.float attack_chance; // The percentage chance the monster will attack +.float attack_speed; // Skill based adjusted projectile speed +.float attack_timer; // Blocking of certain attack types (charging) +.float attack_count; // Total amount of consecutive attacks +.vector attack_offset; // Vector where AI fires projectiles from +.float attack_rage; // Is the monster in a rage mode +.float attack_sidestep; // Timer to switch sides for movement +.float attack_sidedeny; // Timer to block side movement +.float attack_instant; // No pause when waking up to attack +//.float attack_sniper; // Will wake up at any range (def=1000) + +.float meleeattack; // Which type of melee attack is happening +.float meleerange; // Distance used for checking melee contact +.float meleetimer; // Blood and gore sound/effect timer +.string meleehitsound; // Sound to play when melee impacts on enemy +.float meleecontact; // Flag set if monster has melee contact sound +.vector meleeoffset; // Offset for melee contact (spawning blood) + +.float plasma_burn; // Timer to stop constant plasma explosions +.float weaponstate; // State of the weapon (up/down etc) +.float weaponswitch; // Switch timer for different weapons +.string weaponglow; // Special glowing model for magic attacks +.float bodyphased; // Used for teleporter monsters +.float bodystatic; // Used to prevent teleporting monsters +.float spawnstatue; // Start/spawn as a statue (cannot be move) +.float nospawndamage; // Will not do any telefrag damage on spawn +.float wakeuptrigger; // Trigger flag to use special wakeup animation +.entity turretactive; // Set when a monster touches a triggerturret +.float turrettimer; // Timer used to prevent constant spamming +.float turrethealth; // % HP at which a turret monster is released +.string turrettarget; // Target to fire when turret % HP is released + +.float pain_flinch; // Random chance to ignore this much damage +.float pain_longanim; // Force monster into long pain animations +.float pain_finstate; // Store the current pain finished state +.float pain_check; // Pain condition results +.float pain_timeout; // Time block to pain function +.float pain_ignore; // Ignore pain when hit by other monsters +.string pain_sound; // Pain sound wav file +.string pain_sound2; // Alternative Pain sound wav file +.string death_sound; // Death sound wav file +.string death_sound2; // Alternative death sound wav file +.float death_dmg; // Used by tarbaby for explosive damage on death +.string deathstring; // Used by client for player death messages + +.float idlebusy; // Busy with an alternative idle animation +.float idlereverse; // Reverse direction for idle animation +.float idletimer; // Idle sound timer (next time to check) +.float idlemoreoften; // Chance of more idle sound (def=random) +.string idle_sound; // Idle sound wav file +.string idle_sound2; // Alternative Idle sound wav file +.string idle_soundcom; // Combat Idle sound wav file +.string idle_soundcom2; // Alternative Combat Idle sound wav file +.float sight_timeout; // Time block for sight sound +.string sight_sound; // Sight sound wav file +.string sight_sound2; // Sight sound wav file 2 +.string sight_sound3; // Sight sound wav file 3 +.string sight_sound4; // Sight sound wav file 4 +.float sight_count; // Total amount of sight sounds defined +.float sight_nofront; // Monster has no infront check + +.float enemydist; // Distance the enemy is from the monster +.float enemymaxdist; // Maximum distance enemy is out of range +.entity lostenemy; // Lost soul enemy before losing sight +.float losttimer; // Lost soul idle timer after losing sight +.float lostsearch; // Lost soul searching for previous enemy + +.string angrytarget; // Alternative target to attack upon spawn +.string deathtarget; // Alternative target to fire when dying +.string sighttarget; // Will always attack this target if sighted +.entity switchattacker; // Last entity to attack and cause damage +.float switchtimer; // Cooldown before switching targets (infighting) +.float infightextra; // Damage multiplier for infighting damage +.float noinfighting; // Will ignore/start any infighting +.float nomonstercount; // excluded from map monster count +.entity jumptouch; // Last entity a jumping monster touched + +.float steptype; // Primary footstep type +.float altsteptype; // Secondary footstep type +.float steplast; // Last footstep sound +.float altsteplast; // Last club foot sound +.string stepc1, stepc2, stepc3, stepc4, stepc5; // Custom feet sounds +.float zombieflr; // Get up frame for zombie on floor +.string bodyonflr; // String used for find function +//.string bodyonflrtrig; // Trigger to fire when body is axed! +.float dmgtimeframe; // Time before damage frame can be reset +.float dmgcombined; // combined damage over 1 frame (0.1 time) + +.float bosswave; // Current wave of the boss (backwards) +.float bosswavetotal; // Total amount of boss waves +.float bosswaveqty; // Total HP for each boss wave +.float bosswavetrig; // Current HP trigger for wave + +// Minions (rest of the parameters in ai_minions.qc) +.float minion_active; // is the minion system active + +// Projectile resistance (% protection) for monsters +.float resist_shells, resist_nails, resist_rockets, resist_cells; +.float lightning_timer; // Cool down for LG resist effect + +//---------------------------------------------------------------------- +float ENG_UNKNOWN = 0; // Default engine type +float ENG_FITZ = 1; // Fitz clone engines +float ENG_DPEXT = 2; // Engine with Darkplaces extensions + +float DEF_GRAVITY = 800; // Default gravity for maps +float DEF_FOGDEN = 0.1; // Default fog parameter +vector DEF_FOGCOL = '0.1 0.1 0.1'; // Wispy white +string DEF_FOGEXT = "1 0 8192 1024 32"; // DP only extra +float TELE_SPEED = 300; // Default teleport velocity +float LARGE_TIMER = 999999; // Don't run out of time! +float MEGADEATH = 50000; // Time to die! +float TIME_MINTICK = 0.01; // Smallest amount of time to tick functions +float FADEMODEL_TIME = 0.01; // Small amount of time +float FADEFOG_TIME = 0.05; // 20 updates per second +float PARTICLE_DEBUGMAX = 2; // Maximum debug level +float part_debug; // Particle debug level (visual details) +float POWERUP_TIMER = 30; // Default timer for powerups +float DEF_SHELLS = 25; // Default ammo given to new players +float FLOOR_TRACE_DIST = 256; // Default distance for floor trace checks +float FLOOR_TRACE_MONSTER = 40; // Distance for monster/body checks +float FLOOR_TRACE_GIBS = 16; // Distance for gib/head checks +float FLOOR_TRACE_BREAK = 16; // Distance for breakable checks + +//---------------------------------------------------------------------- +// Server flags (only way to carry items over between maps) +// bits 1-4 Runes, 5-8 Additional keys/items +float SVR_RUNE_KEY1 = 1; // Rune 1 +float SVR_RUNE_KEY2 = 2; // Rune 2 +float SVR_RUNE_KEY3 = 4; // Rune 3 +float SVR_RUNE_KEY4 = 8; // Rune 4 +float SVR_RUNE_ALL = 15; // Runes 1-4 (together) + +float SVR_SPAWN_BIT1 = 16; // 3 bit spawn location +float SVR_SPAWN_BIT2 = 32; // Supports 7 locations 001-111 +float SVR_SPAWN_BIT3 = 64; // Set via trigger_change_level + +float SVR_LIVE = 128; // Bit 8 - Serverflag has active data +float SVR_RUNEFLAG = 255; // Bits 1- 8 - Runes and Keys +float SVR_LOWFLAG = 65535; // Bits 1-16 - rune keys and spawn settings +float SVR_WORLDFLAG = 65280; // Bits 9-16 - default/worldspawn options +float SVR_HIGHFLAG = 8323072; // Bits 17-23 - these options carry over + +// MOD Options that can only be changed via temp1 console variable +// These affect the spawning functions of monster / items +float SVR_ITEMOFFSET = 256; // Toggle item offset (corner/center) +float SVR_ITEMROTATE = 512; // Always randomly rotate ammo items +float SVR_PARTICLES = 1024; // Turn ON particle system (default OFF) +float SVR_NOFOGCMDS = 2048; // Disables all fog commands (winquake) +float SVR_DEVHELPER = 4096; // Turn OFF Dev helpers (marks+arrows) +float SVR_UPDAXE = 8192; // Upgrade Axe, +75% dmg, gib zombies +float SVR_UPDSSG = 16384; // Upgrade Super Shotgun, +50% dmg, uses 3 shells +float SVR_UPDLG = 32768; // Upgrade Lightning Gun, Direct+Splashdamage +// MOD Options that can be changed via impulse commands (need a map loaded) +// These options will override the temp1 console variable +float SVR_WEATHER = 65536; // Turn OFF All weather systems +float SVR_SHOTGPROJ = 131072; // Turn OFF Shotgun projectiles +float SVR_SHOTGCASE = 262144; // Turn OFF Shotgun casings +float SVR_ZAWARE = 524288; // Turn OFF Z aware monsters +float SVR_FOOTSTEP = 1048576; // Turn OFF Enemy/player footsteps +float SVR_AIPATH = 2097152; // Turn OFF AI path corner extra info +float SVR_LIQDAM = 4194304; // Turn OFF Liquid damage checks for monsters +float SVR_SPRPARTON = 8388608; // Always use sprite particles (default OFF) + +//---------------------------------------------------------------------- +float IT_UPGRADE_AXE = 2048; // Shadow Axe, +75% dmg, +gib bodies +float IT_UPGRADE_SSG = 2; // The Widowmaker, +50 dmg, +3 shells +float IT_UPGRADE_LG = 64; // Plasma Gun, direct + splashdamage +float IT_ALLARMOR = 57344;// Test for player grn/yel/red armour + +float IT_CKEY1 = 8192; // Custom Key 1 +float IT_CKEY2 = 16384; // Custom Key 2 +float IT_CKEY3 = 32768; // Custom Key 3 +float IT_CKEY4 = 65536; // Custom Key 4 +float IT_CKEYALL = 122880; // All Custom keys + +float IT_ARTTOME = 524288; // Tome of Power (event trigger) +float IT_ARTSHARP = 1048576; // Reduce SG/SSG/RG spread pattern +float IT_ARTWETSUIT = 2097152; // Underwater Wetsuit + tank 5mins Oxygen +float IT_ARTPIERCE = 4194304; // NG/SNG Nails travel through enemy bodies + +.float powerup_sound; +.float sharpshoot_finished, sharpshoot_time, sharpshooter_sound; +.float nailpiercer_finished, nailpiercer_time, nailpiercer_sound; +.float wetsuit_finished, wetsuit_time, wetsuit_sound; +.float wetsuit_level, wetsuit_bubbles; + +//---------------------------------------------------------------------- +float SKILL_EASY = 0; // Skill level constants +float SKILL_NORMAL = 1; +float SKILL_HARD = 2; +float SKILL_NIGHTMARE = 3; + +float HUD_SECRETS = 2; // Update secrets screen counter +float HUD_MONSTERS = 4; // Update monster screen counter + +float BUFFER_STUFFCMD = 1; // Long float print function (lftos) +float BUFFER_SPRINT = 2; // Defined in subs.soc.qc +float BUFFER_DPRINT = 4; + +//---------------------------------------------------------------------- +float STATE_SETUP = -1; // Setup state (on/off functions) +float STATE_ON = 1; // Stupid idea to have on states as 0 +float STATE_OFF = 2; // Impossible to test for 0 as 'not setup' is 0 + +float ENT_SPNSTATIC = 32; // Will convert entity to static on spawn +float ENT_STARTOFF = 64; // Global spawnflags setting +float ESTATE_BLOCK = 6; // Blocked OFF+DISABLE +float ESTATE_LOWER = 7; // ON+OFF+DISABLE +float ESTATE_ON = 1; // Switch ON +float ESTATE_OFF = 2; // Switch OFF +float ESTATE_DISABLE = 4; // Disabled (blocks toggle) +float ESTATE_RESET = 8; // Reset parameters +float ESTATE_AFRAME = 16; // Changes Aframe only + +float TARGET_BACK = 0; // Behind - 315-45 +float TARGET_LEFT = 1; // Side - 45-135 +float TARGET_FRONT = 2; // Front - 135-225 +float TARGET_RIGHT = 3; // Right - 225-315 + +float SPNMARK_YELLOW = 0; // Error something is broken +float SPNMARK_BLUE = 1; // Delay spawn monster/item +float SPNMARK_GREEN = 2; // Delay spawn mosnter with no counter +float SPNMARK_RED = 3; // Nightmare only spawn +float SPNMARK_PURPLE = 4; // Coop only spawn +float SPNMARK_WHITE = 5; // Not used atm + +//---------------------------------------------------------------------- +// Environmental damage +float LIQUID_TIMER = 1; // Amount of time to check for liquid damage +float MON_MULTIPLIER = 10; // Multiplier for liquid damage against monsters +float WATER_DAMAGE = 2; // water drowning +float WATER_AIR = 12; // time before damage +float LIQUID_DMG = 1; // Base damage from liquid damage +float SLIME_DAMAGE = 4; // Acid burning +float LAVA_DAMAGE = 10; // Getting crispy + +//---------------------------------------------------------------------- +// Footstep types (slow, drag, light, medium, heavy, large, giant) +float FS_TYPESLOW = 1; // Demon, Dogs, Ogres, Zombies +float FS_TYPEDRAG = 2; // Alt Zombie foot +float FS_TYPELIGHT = 3; +float FS_TYPEMEDIUM = 4; +float FS_TYPEHEAVY = 5; // Death/Hell Knight, Drole, Player, Enforcer +float FS_TYPELARGE = 6; // Minotaur, Shambler +float FS_TYPEGIANT = 7; // Golem +float FS_TYPECUSTOM = 9; // Defined/precached by monster +float FS_FLYING = 10; // Exclusion, no happy feet! + +//---------------------------------------------------------------------- +// Monster constant values +float MON_MOVEWALK = 1; // Walking Monster +float MON_MOVEFLY = 2; // Flying Monster +float MON_MOVESWIM = 4; // Swiming Monster +float MON_SIGHTSOUND = 10; // Stop repeating sightsounds +float PAIN_ALWAY = 5; // Always go into a pain animation after this time +float MON_VIEWOFS = 24; // Default view ofset for monsters +float MON_ZMOVEMENT = 8; // Z Movement for flying monsters +float MON_ZTOL = 16; // Z movement tolerance for adjustment +string MON_ONFLR = "TRUE"; // Search string for bodies on the floor +float MON_NOGIBVELOCITY = -1; // Gib system will use minimal velocity +float MON_XYGIBVELOCITY = -2; // Gib system will add more XY velocity +float MON_GIBFOUNTAIN = -3; // Gibs fly up and outwards (fountain) +float MON_GIBEXPLOSION = -4; // Gibs fly upwards with force +float MON_NEVERGIB = -300; // Monster can never be gibbed + +// Used in AI.QC routine for AI distance checks +float MON_RANGE_MELEE = 120; // Melee range +float MON_RANGE_CLOSE = 192; // Close melee range +float MON_RANGE_WAKEUP = 256; // Sight Wakeup range +float MON_RANGE_NEAR = 500; // Near range +float MON_RANGE_MID = 1000; // Mid range +float MON_MAX_RANGE = 1000; // Max range (realistic) +float MON_STEPRANGE = 100; // Step points for range chance +float MONAI_MDLHEIGHT = 24; // Offset height of monsters from floor +float MONAI_STEPHEIGHT = 16; // Maximum step height +float MONAI_STEPLARGE = 32; // large height distance, flight of steps? +float MONAI_ABOVEMELEE = 120; // Always be high above enemies inside this distance +float MONAI_ABOVEDIST = 128; // Distance to maintain above enemytarget +float MONAI_ABOVETIMER = 2; // Amount of time before changing Z +float MONAI_TURRETMODE = 0.3; // Percentage change of attack in turret mode + +float MON_IDLE_SOUND = 0.2; // random chance of idle sound +float MON_IDLE_ANIMATION = 0.2; // random chance of idle animation + +// Generic options +float MON_AMBUSH = 1; // Ambush (will only wakeup if see the player) +float MON_SPAWN_NOSIGHT = 8; // No wakeup sight sound +float MON_SPAWN_NOIDLE = 16; // no idle sounds (cupboard monster) +float MON_SPAWN_NOGFX = 32; // no spawn effect or sound +float MON_SPAWN_DELAY = 64; // Trigger spawn DELAY +float MON_SPAWN_ANGRY = 128; // Trigger spawn ANGRY +float MON_GHOST_ONLY = 4096; // Design for the ghost knights +float MON_POINT_KNIGHT = 8192; // Pointy Electricity Knight + +// Unique options +float MON_HOGRE_METAL = 4; // Metal Skin version +HP +float MON_HOGRE_METUPG = 50; // Extra health for metal upgrade +float MON_OGRE_NAIL = 4096; // Fires Nails instead of grenades +float MON_OGRE_GREEN = 4; // Green Skin version +HP +float MON_OGRE_GRNUPG = 50; // Extra health for green upgrade +float MON_FREDDIE_LASER = 2; // Fires laser instead of nails +float MON_SPIDER_LARGE = 2; // Large green spitting version +float MON_VORELING_LARGE = 2; // Large purple spitting version +float MON_SPIDER_CEILING = 4; // Spider starts on the ceiling +float MON_VORELING_CEILING = 4; // Voreling starts on the ceiling +float MON_SWAMPLING_LARGE = 2; // Large Green spitting version +float MON_SWAMPLING_CEILING = 4; // Swampling starts on the ceiling +float MON_GARGOYLE_PERCH = 4; // Start in perched position +float MON_GAUNT_PERCH = 4; // Start in perched position +// Underwater enemies (liquid block option for all of them) +float MON_LIQUIDBLOCK = 4; // Liquids block sightlines (fish/eel) +float MON_FISH_SMALL = 2; // Smaller and faster fish! +float MON_BOIL_HANGING = 2; // Hanging on wall upside down by spikes +float MON_BOIL_HOBBLED = 4; // Hobbled on the floor, random A/B position +float MON_SEEK_SHIELD = 4; // Shield mode until triggered +float MON_CHTHON_RED = 2; // New red skin + fire balls +float MON_CHTHON_GREEN = 4; // Green skin + Slime balls +float MON_SHUB_DMGTRIG = 2; // Can be triggered with damage +float MON_SHUB_UPSIDE = 4; // Setup upside (ceiling pose) + +// Minion spawner options +float MON_MINOTAUR_MINIONS = 4; // Allow the Minotaur to spawn gargoyles +float MON_SHALRATH_MINIONS = 4; // Allow the Shalrath to spawn vorlings +float MON_SKULLWIZ_GUARDIAN = 2; // Special version guarding the runes +float MON_SKULLWIZ_MINIONS = 4; // Allow the Skull Wizard to spawn skulls +float MON_WRAITH_SCORPIONS = 2; // Allow the wraith to spawn scorpions +float MON_WRAITH_SPIDERS = 4; // Allow the wraith to spawn spiders +float MON_BOGL_STRONG = 2; // Stronger +HP and skin 2 +float MON_DCROSSSNIPER = 2; // No max range limitations for enemies +float MON_DCROSSTRACK = 4; // Enable tracking for crossbow knights +float MON_ELF_MAGIC = 2; // Magic range attack (+HP) +float MON_RAINDEER_DEAD = 2; // Dead body sacrifice +float MON_SANTA_GOOD = 2; // Good Santa with touch trigger + +float MON_JIM_ROCKET = 4; // Rocket version of Jim the Robot +float MON_SCORPION_STINGER = 4; // Black stinger scorpion (debuff) +float MON_TARBYLESSJUMP = 4; // Will not constantly jump around +float MON_WIZARD_ABOVE = 4; // Wizard will float above enemy +float MON_GOLEM_MELEEONLY = 4; // Golems only do melee + stomp + +// Statue/Zombie options +float MON_CRUCIFIED = 2; // Zombies - start in crucified position +float MON_STATUE = 2; // Will start frozen with stone skin +float MON_NOTFROZEN = 4; // Will not start frozen (works with statues) +float MON_ONFLOOR = 4; // Zombies - start lying on the floor +// Zombie hacks +float MON_ZOMCRUCIFIED = 1; // Zombies - crucified +float MON_ZOMBAMBUSH = 2; // Zombies - Ambush (ID hack) +float MON_ZOMIDHACK = 3; // Used to switch ID hack around + +//---------------------------------------------------------------------- +// Player +float RANGE_PLAYAXE = 72; // Distance for fire axe (player) +float RANGE_CHOPAXE = 64; // Player distance to chop up bodies +float DAMAGE_PLAYAXE1 = 20; // Default axe damage +float DAMAGE_PLAYAXE2 = 35; // Enhanced axe damage + +//---------------------------------------------------------------------- +// Weapon damage and parameters +float SPEED_PLAYAIM = 10000; // Player auto aim distance +float SPEED_PLAYERSG = 2000; // Player speed for SG +float SPEED_PLAYERSSG = 1500; // Player speed for SSG/Upgrade +float SPEED_MONSG = 800; // Monster speed for SG +float SPEED_MONSGMULT = 150; // 800=easy, 950=normal, 1100=hard, 1250=nm +float QUANTITY_SG = 6; // Shotgun +float QUANTITY_SGP = 7; // Projectile SG ONLY +float QUANTITY_SSG = 14; // Super Shotgun +float QUANTITY_GRUNT = 4; // Soldier +float QUANTITY_DEFENDER = 10; // Defender +vector SPREAD_SG = '0.04 0.04 0'; // Narrow and square spread +vector SPREAD_SG2 = '0.01 0.01 0'; // Sharpshooter version +vector SPREAD_SSG = '0.14 0.08 0'; // Wide and short SSG spread +vector SPREAD_SSG2 = '0.04 0.04 0'; // Sharpshooter version +vector SPREAD_GRUNT = '0.1 0.1 0'; // Solider version (very narrow) +vector SPREAD_DEF = '0.18 0.1 0'; // Defender version (really wide) +float DAMAGE_SHELL = 4; // Single Shotgun Shell (hitscan) +float DAMAGE_PSHELL = 4; // Single Shotgun Shell (projectile) +float DAMAGE_PTSHELL = 4; // Dead center tracer shell (proj only) +float LIFE_SHELLS = 6; // Lifetime before being removed + +float SPEED_PLAYSPIKE = 1000; // Player speed for Spikes +float SPEED_TRAPSPIKE = 500; // Trap shooters +float SPEED_HKSPIKE = 200; // Hell Knight (def=300) +float SPEED_HKSKILL = 50; // 200=easy, 250=normal, 300=hard, 350=nm +float SPEED_WIZSPIKE = 500; // Wizards (def=600) +float SPEED_WIZSKILL = 50; // 500=easy, 550=normal, 600=hard, 650=nm +float SPEED_SPIDER = 600; // Large Spiders (acid spit) +float SPEED_VORELING = 600; // Large Voreling (purple spit) +float SPEED_SWAMPLING = 600; // Large Swamping (poison spit) +float SPEED_BLORD = 600; // Boglord (acid spit) +float SPEED_ELF = 600; // Dark Elf (snowballs) +float SPEED_LAVABALL = 250; // Boss Lava balls +float SPEED_LAVASKILL = 50; // Lava ball skill upgrade + +float SPEED_RLPLAYER = 1000; // Player rocket speed +float SPEED_PLAYGRENADE = 600; // Player speed for Grenades +float SPEED_MONGRENADE = 500; // Ogre grenade speed (org 600) +float SPEED_MONGLSKILL = 50; // 500=easy, 550=normal, 600=hard, 650=nm +float SPEED_ZOMBFLESH = 550; // Zombie flesh speed (org 600) +float SPEED_ZOMBIESKILL = 25; // 550=easy, 575=normal, 600=hard, 625=nm + +float SPEED_PLAYPLASMA = 900; // Player speed for Plasma +float SPEED_REFLECTION = 600; // Reflection speed for Plasma/Lightning +float SPEED_LASER = 600; // Enforcer laser speed +float SPEED_PLASMA = 600; // Eliminator plasma speed +float SPEED_JIMPROJ = 575; // Crazy flying jim robot laz0r/rockets!? +float SPEED_JIMPROJSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 + +float SPEED_SEEKROCK = 575; // Large UV ugly robot from rrp +float SPEED_SEEKROCKSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 +float SPEED_SEEKLAZ = 400; // Base speed of Laser attacks +float SPEED_SEEKLAZSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_RAINDROCK = 575; // Mobile xmas meat wagaon +float SPEED_RAINDROCKSKILL = 75; // 575=easy, 650=normal, 725=hard, nm=800 + +float SPEED_DFURYSPIKE = 400; // Base speed of Fury attack A/B +float SPEED_DFURYSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_NOURSPIKE = 600; // Base speed of Nour attack A/B +float SPEED_NOURSKILL = 200; // 600=easy, 800=normal, 1000=hard, 1200=nm +float SPEED_NOURBOMB = 600; // Grenade bounce speed (no skill change) + +float SPEED_GARGMISSILE = 500; // Gargoyle rocket speed +float SPEED_GARGSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_SWIZMISSILE = 525; // Skull wizard rocket speed +float SPEED_SWIZSKILL = 75; // 525=easy, 600=normal, 675=hard, 750=nm +float DAMAGE_SWIZPOISON = 30; // Direct damage from Poison Rocket + +float SPEED_MINOBOLT = 500; // Minotaur plasma bolt speed +float SPEED_MINOSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_GAUNTBOLT = 500; // Gaunt plasma bolt speed +float SPEED_GAUNTSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_EELBOLT = 300; // Eel plasma bolt speed +float SPEED_EELSKILL = 100; // 300=easy, 400=normal, 500=hard, 600=nm + +float SPEED_SANTAPROJ = 600; // Santa snowball attack +float SPEED_SANTASKILL = 200; // 600=easy, 800=normal, 1000=hard, 1200=nm +float MONAI_SANTAMAX = 30; // Maximum amount of projectiles to fire + +float SPEED_FREDDIEPROJ = 500; // Freddie spike/laser bolt speed +float SPEED_FREDDIESKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_NAILOGREPROJ = 500; // Nail Ogre spike speed +float SPEED_NAILOGRESKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_NAILSNOWMPROJ = 500; // Snowman Nail spike speed +float SPEED_NAILSNOWMSKILL = 150; // 500=easy, 650=normal, 800=hard, 950=nm + +float SPEED_SHALMISSILE = 200; // Shalrath intial speed of homing missile +float SPEED_SHALSKILL = 50; // 200=easy, 250=normal, 300=hard, 350=nm +float SPEED_SERGMISSILE = 200; // Death Sergeant homing missile initial speed +float SPEED_SERGSKILL = 20; // 200=easy, 220=normal, 240=hard, 260=nm + +float SPEED_SCORPTAIL = 400; // Scorpion Tail Swipe (large arc infront) +float SPEED_SCORPSKILL = 100; // 400=easy, 500=normal, 600=hard, 700=nm + +float SPEED_GOLEMSPIKE = 400; // Base speed of Golem Rock storm attacks +float SPEED_GOLEMSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_EIDOROCK = 400; // Base speed of Eidolon boulder attack +float SPEED_EIDOSKILL = 150; // 400=easy, 550=normal, 700=hard, 850=nm +float SPEED_EIDOSPIKE = 400; // Base speed of Eidolon rock storm attacks +float SPEED_EIDOSKILLSP = 225; // 400=easy, 625=normal, 850=hard, 1075=nm + +float SPEED_ICEGSHARD = 600; // Base speed for Ice Golem Shard attack +float SPEED_ICEGSKILL = 200; // 600=easy, 800=normal, 1000=hard, 1200=nm + +float SPEED_BLORDBALL = 400; // Base speed of Bog Lord melee balls +float SPEED_BLORDSKILL = 225; // 400=easy, 625=normal, 850=hard, 1075=nm +float SPEED_BLORDBOLT = 600; // Base speed of Bog Lord bolts + // 600=easy, 825=normal, 1025=hard, 1275=nm + +float LIFE_PROJECTILE = 6; // Lifetime before being removed +float LIFE_ROCKET = 5; // Disappear in a puff of smoke! +float LIFE_GRENADE = 2.5; // Bounce, bounce, explode +float LIFE_EGG = 1.5; // Very quick egg hatch! +float LIFE_FLESH = 2.5; // Life of zombie flesh + +float DAMAGE_NGREFSPIKE = 4; // Reflected Spike for NG +float DAMAGE_NGSPIKE = 9; // Single Spike for NG +float DAMAGE_SNGSPIKE = 18; // Single Spike for SNG +float DAMAGE_LAVANGSPIKE = 15; // Single Spike for NG +float DAMAGE_LAVASNGSPIKE = 30; // Single Spike for SNG +float DAMAGE_PLAYGRENADE = 120; // Direct damage from player grenade +float DAMAGE_MONGRENADE = 40; // Toned down grenade damage +float DAMAGE_MONROCKET = 40; // Toned down rocket damage + +float ELEV_ZAXIS = 200; // Standard default Z axis adjustment +float ELEV_DEFAULT = 30; // Zaware default elevation if range too far +vector ELEV_VIEW_OFS = '0 0 12'; // Zaware target adjustment +vector ELEV_SPID_OFS = '0 0 -16'; // Hit low + +vector DAMAGE_RLPLAYER = '100 20 120'; // Base + Random, Splash +vector DAMAGE_RLFURY = '20 0 20'; // Fury rockets - Equal Direct/Radius +vector DAMAGE_RLGARG = '20 10 30'; // Gargoyle rocket, very weak dmg +vector DAMAGE_RLSKULLW = '30 10 20'; // Skull wizard, high direct, low splash +vector DAMAGE_RLWRAITH = '100 20 0'; // Wraith hitscan bolt against monsters +vector DAMAGE_RLDROLE = '40 10 80'; // High splash damage, low direct +vector DAMAGE_RLARMY = '25 5 45'; // Weak direct, high splash +vector DAMAGE_RLJIM2 = '25 15 25'; // Weak direct, med splash +vector DAMAGE_RLSEEKER = '25 15 25'; // Weak direct, med splash +vector DAMAGE_RLFIRETOP = '70 0 20'; // High direct, low splash +vector DAMAGE_RLEIDO = '25 15 25'; // Eidolon Rock - med damage +vector DAMAGE_RLICEG = '20 0 20'; // Ice Golem shard - fury damage +vector DAMAGE_RLBLORD = '30 0 10'; // Bog Lord Slime - Low Direct/Splash +vector DAMAGE_SMARTBALL = '30 10 40'; // Nemesant smart fire ball chasing projectile +vector DAMAGE_RLCYBER = '40 0 40'; // Cyber Demon + +vector DAMAGE_PLASMA = '15 5 20'; // Default plasma (very high) +vector DAMAGE_PGPLAYER = '45 0 20'; // Player plasma (very high) +vector DAMAGE_PGREFLECT = '15 0 0'; // Plasma reflection (very low) +vector DAMAGE_PGMINOTAUR = '10 5 10'; // Lower damage for minotaur +vector DAMAGE_PGGAUNT = '10 5 10'; // Lower damage for gaunt +vector DAMAGE_PGNOUR = '10 0 0'; // Direct damage only +vector DAMAGE_PGGREMLIN = '15 5 20'; + +float DAMAGE_LGPLAYER = 30; // Player Lightning gun (per 0.1s) +float DAMAGE_LASER = 15; // Lasers! (traps AND enforcers) +float DAMAGE_BOGLORD = 20; // Very high and fast damage +float DAMAGE_BOBLASER = 5; // Weak laser (x + random()*x) 5-10dmg +float DAMAGE_FLESH = 10; // Flesh from zombies +float DAMAGE_ZOMBIECLASS = 120; // Instant death to any zombie class + +float SPEED_WRAITHBONE = 400; // Wraith Nail Storm (large arc infront) +float SPEED_WBONESKILL = 100; // 400=easy, 500=normal, 600=hard, 700=nm +float DAMGE_WRAITHBOLT = 10; // Biosuit protection from debuff, base dmg +float DAMAGE_PYROWRAITH = 20; // Damage from Wraith flame bolt +float DAMAGE_WRAITH = 120; // Explosive damage from wraiths (org=80) + +float SPEED_PYROFLAME = 250; // Base speed of flames +float SPEED_PYROSKILL = 50; // 250=easy, 300=normal, 350=hard, 400=nm +float DAMAGE_PYROFLAME = 4; // Damage from each pyro flame +float DAMAGE_MONFLAME = 20; // Damage to any monster +float DAMAGE_FUMPOISON = 2; // Damage from each fumigator burst + +// Both crossbow and fury projectiles need to cap at 1100 for NM skill +// Otherwise they are close to impossible to avoid due to spread pattern +float SPEED_DCROSS = 500; // Base speed of projectile bolts +float SPEED_BOLTSKILL = 200; // 500=easy, 700=normal, 900=hard, 1100=nm +float DAMAGE_BOLT0 = 5; // Bolt damge against crossbow knights only +float DAMAGE_BOLT1 = 15; // Hot red bolts! +float DAMAGE_BOLTPLAYER = 100; // Powerful player bolt +float DAMAGE_BOLTPLAYERP = 110; // Powerful player poison bolt + +float DAMAGE_TARBABY = 120; // Explosive damage from tarbies +float DAMAGE_BOIL = 60; // Explosive damage from boil +float DAMAGE_SEEKER = 50; // Explosive damage from seeker +float DAMAGE_FREDDIE = 40; // Explosive damage from Freddie +float DAMAGE_RAINDEER = 20; // Explosive damage from raindeer +float DAMAGE_SNOWMAN = 40; // Explosive damage from Snowman + +float SPEED_LOSTSTART = 400; // Initial charging speed +float SPEED_LOSTCHARGE = 50; // Charging speed multiplier +float SPEED_LOSTMAX = 800; // Charging Maximum speed +float DAMAGE_LOSTSOUL = 40; // Explosive damage from lost soul +float DAMAGE_LOSTCHARGE = 10; // Charging damage for lost soul + +//---------------------------------------------------------------------- +// Generic melee/jump attack distances +float MONAI_MELEEFRONT = 70; // Front attacks reach further (original = 60) +float MONAI_MELEESIDE = 60; // Side attacks less distance +float MONAI_MELEEZAXIS = 48; // Z axis range for melee attack +float MONAI_CHARGEZAXIS = 20; // Maximum height for knight charge attack +float MONAI_RANGESUMMON = 128; // High close to block summoning minion + +// Various monsters +float MONAI_MELEEKNIGHT = 80; // Knight and DKnight sword range +float MONAI_MELEEOGRE = 100; // Ogre chainsaw got a long range +float MONAI_MELEEBLUNTOGRE = 120; // Ogre hammer/mace very long range +float MONAI_MELEEOGREHAM = 250; // Ogre Special Hammer with knockback +float MONAI_MELEESHAM = 100; // Shambler smash claw attack range +float MONAI_SHAMRANGE = 600; // Range of Shambler lightning +float MONAI_BOGLORDMELEE = 200; // over arm slime ball attack +float MONAI_BOGLORDRANGE = 400; // Inside range for intense melee +float MONAI_MELEESPAWN = 80; // Jump in-the-face range +float MONAI_MELEEFISH = 60; // Distance for fish bite +float MONAI_RANGEARMYR = 64; // Too close range for army rocket +float MONAI_RANGEDEFSSG = 100; // Close range for SSG Defender +float MONAI_RANGEPYRO = 80; // Pyro flame melee range +float MONAI_RANGEDEFGL = 256; // Far range for GL Defender +float MONAI_GARGHEIGHT = 96; // Try to maintain this height above enemies +float MONAI_MELEEDROLE1 = 90; // Long arm reach on drole claws +float MONAI_MELEEDROLE2 = 150; // Inside range for a second claw swipe +float MONAI_RANGEDROLE = 300; // pre-rage distance to maintain +float MONAI_MELEEFREDDIE = 100; // Ogre Freddie blade got a long range +float MONAI_RANGEFREDDIE = 300; // Inside range for stand and fire +float MONAI_MELEEMINOTAUR = 100; // Large long range minotaur claws +float MONAI_RANGEMINOTAUR = 300; // pre-rage distance to maintain +float MONAI_RANGESHAL = 400; // Distance to keep minion spawners at +float MONAI_RANGESHAL2 = 300; // Too close, move away from enemy +float MONAI_MELEESKULLW = 192; // Too close, teleport away +float MONAI_RANGESKULLW = 256; // Distance to be after teleport +float MONAI_MELEEGOLEM = 100; // Golem punch/pound attack range +float MONAI_GOLEMRANGE = 200; // How close for golem stomp attack +float MONAI_LOSTTIMER = 15; // How long a lost soul will stay lost +float MONAI_MELEEBOIL = 80; // Exploding boil trigger range +float MONAI_HOBBLEBOIL = 120; // Exploding range for hobble version +float MONAI_MELEESWAMPLING = 60; // Distance for swampling bite +float MONAI_JUMPSWAMPLINGNEAR = 80; // SWAMPLING Jump attack ranges +float MONAI_JUMPSWAMPLINGFAR = 200; +float MONAI_JUMPSWAMPLINGDIST = 500;// Forward distance modifier + +float MONAI_JUMPTIMEOUT = 2; // Time between jumps +float MONAI_RUNPAUSE = 128; // If enemy this close, stop pause and run! + +// Dog +float MONAI_MELEEDOG = 80; // Distance for dog bite +float MONAI_JUMPDOGNEAR = 80; // DOG Jump attack distance ranges +float MONAI_JUMPDOGFAR = 150; + +// Spider / Voreling / Scorpion / Lost Soul +float MONAI_MELEESPIDER = 60; // Distance for spider bite +float MONAI_JUMPSPIDERNEAR = 80; // SPIDER Jump attack ranges +float MONAI_JUMPSPIDERFAR = 200; +float MONAI_JUMPSPIDERDIST = 400; // Forward distance modifier +float MONAI_MELEEVORELING = 60; // Distance for voreling bite +float MONAI_JUMPVORELINGNEAR = 80; // VORELING Jump attack ranges +float MONAI_JUMPVORELINGFAR = 200; +float MONAI_JUMPVORELINGDIST = 500; // Forward distance modifier +float MONAI_MELEELOSTSOUL = 80; // Distance for Lost Soul bite +float MONAI_RANGELOSTNEAR = 200; // Too close for charge attack +float MONAI_RANGELOSTFAR = 400; // Too far for charge attack + +// Scorpions +float MONAI_JUMPSCORPTIME = 1; // Special timer for scorpion +float MONAI_MELEESCORPION = 80; // Distance for scorpion claws +float MONAI_JUMPSCORPNEAR = 80; // SCORPION Jump attack ranges +float MONAI_JUMPSCORPFAR = 300; // long jump distance! + +// Demon1 +float MONAI_MELEEDEMON = 80; // Distance for demon claws +float MONAI_JUMPDEMONNEAR = 100; // DEMON Jump attack distance ranges +float MONAI_JUMPDEMONFAR = 200; +float MONAI_JUMPDEMONCHECK = 128; // Ceiling height check for jumping demons + +// Zombie Knight +float MONAI_JUMPZOMBTIME = 2; // Time before next jump attack +float MONAI_JUMPZKNEAR = 100; // Near range for a zombie knight jump +float MONAI_JUMPZKFAR = 160; // Far range for zombie knight + +// Sergeant +float MONAI_JUMPSERGTIME = 2; // Time before next jump attack +float MONAI_JUMPSERGNEAR = 100; // SERG jump attack distance +float MONAI_JUMPSERGFAR = 250; +float MONAI_CHARGEFLAIL = 350; // Flail Knight charging distance + +// Fury Knight +float MONAI_JUMPFURYTIME = 2; // Time before next jump attack +float MONAI_JUMPFURYNEAR = 150; // FURY jump attack distance +float MONAI_JUMPFURYFAR = 350; + +// Minotaur +float MONAI_JUMPMINOTIME = 2; // Time before next jump attack +float MONAI_JUMPMINONEAR = 150; // MINOTAUR jump attack distance +float MONAI_JUMPMINOFAR = 300; + +// Seeker +float MONAI_MELEESEEKER = 80; // Long arm reach on Seeker +float MONAI_MELRAGESEEKER = 150; // Range for melee attack +float MONAI_RANGESWSEEKER = 300; // Switch between rockets and lasers + +// Skull wizard starting state +float MONAI_SKULLWSOLID = 1; // Regular spawn state +float MONAI_SKULLWINVIS = 2; // Invisible + +// Hunter Ogre - Chainsaw +float MONAI_JUMPHOGRETIME = 5; // Time before next jump attack +float MONAI_JUMPHOGRENEAR = 200; // Hunter Ogre jump attack distance +float MONAI_JUMPHOGREFAR = 300; + +// Xmas monsters +float MONAI_MELEERAINDEER = 80; // Medium range attack +float MONAI_MELEEELF = 60; // Distance for elf melee +float MONAI_JUMPELFNEAR = 80; // ELF Jump attack ranges +float MONAI_JUMPELFFAR = 200; // (Based on spiders) +float MONAI_JUMPELFDIST = 400; // Forward distance modifier +float MONAI_MELEESNOWMAN = 80; // Standing still attack +float MONAI_MELEESANTA = 100; // Large Sack attack + +// Shockwave floor attacks +vector MONAI_STOMPIMPACT = '12 8 -22'; +float MONAI_STOMPDAMAGE = 30; // Impact damage +float MONAI_STOMPRADIUS = 512; // Radius of foot stomp attack +float MONAI_STOMPFORWARD = 300; // Forward momentum +float MONAI_STOMPUP = 600; // Vertical momentum + +vector MONAI_HAMMERIMPACT = '56 0 -22'; +float MONAI_HAMMERDAMAGE = 30; // Impaxct damage +float MONAI_HAMMERRADIUS = 512; // Radius of hammer slam attack +float MONAI_HAMMERFORWARD = 300; // Forward momentum +float MONAI_HAMMERUP = 500; // Vertical momentum + +float MONAI_IMPACTZAXIS = 128; // Above/below limit on affect + +// Boss Nour +float MONAI_MELEENOUR = 192; // Always attack player +float MONAI_CLOSENOUR = 400; // Close distance spit/bomb +float MONAI_MAXNOUR = 325; // Maximum tether range + +// Boss Eidolon +float MONAI_SPAWNEIDO = 80; // Close to spawn location +float MONAI_CLOSEEIDO = 192; // Always attack player +float MONAI_MEDIUMEIDO = 384; // Good distance for boulder +float MONAI_MAXEIDO = 448; // Maximum tether range + +// Boss Ice Golem +float MONAI_MELEEICEG = 128; // Always attack with melee +float MONAI_MAXICEG = 400; // Maximum tether range +float MONAI_STOMPICEG = 400; // How close for stomp attack +float MONAI_STOMPICERADIUS = 640; // Radius of foot stomp attack + +// Boss Lich Fiend +float MONAI_MELEELFIEND = 128; // Always attack with melee +float MONAI_CLOSELFIEND = 384; // Close distance fireballs +float MONAI_MAXLFIEND = 350; // Maximum tether range + +float AMMO_MAXSHELLS = 200; // Maximum ammo the player can carry +float AMMO_MAXNAILS = 200; // Shells use to be 100 +float AMMO_MAXROCKETS = 100; +float AMMO_MAXCELLS = 100; + +float AMMO_SHELLS_SML = 20; // Ammo quantities for small / large boxes +float AMMO_SHELLS_LGR = 40; // and from weapon pickups +float AMMO_SHELLS_WPN = 25; +float AMMO_NAILS_SML = 25; +float AMMO_NAILS_LGR = 50; +float AMMO_NAILS_WPN = 30; // Both Nailgun and Super +float AMMO_ROCKETS_SML = 5; +float AMMO_ROCKETS_LGR = 10; +float AMMO_ROCKETS_WPN = 10; // Both Rocket and Grenade launcher +float AMMO_CELLS_SML = 6; +float AMMO_CELLS_LGR = 12; +float AMMO_CELLS_WPN = 15; +float AMMO_BOLTS_WPN = 8; +float AMMO_LAVA_NAILS_WPN = 30; // Both Nailgun and Super +float AMMO_MULTI_ROCKETS_WPN = 10; // Both Rocket and Grenade launcher +float AMMO_PLASMA_WPN = 10; + +//---------------------------------------------------------------------- +float ARMOR_GRN_TYPE = 0.3; // Armour damage reduction and quantity +float ARMOR_GRN_VALUE = 100; +float ARMOR_YEL_TYPE = 0.6; +float ARMOR_YEL_VALUE = 150; +float ARMOR_RED_TYPE = 0.8; +float ARMOR_RED_VALUE = 200; + +//---------------------------------------------------------------------- +float HEAL_ROT = 15; // Health packs +float HEAL_NORM = 25; +float HEAL_MEGA = 100; // How much extra health to add +float HEAL_PLAYMAX = 100; // Maximum player health (default) +float HEAL_MEGAMAX = 250; // Maximum health (several megahealths) + +//---------------------------------------------------------------------- +// Required here because of link to particle emitters +float MISCBOOK_GREEN = 1; // Green Cover +float MISCBOOK_BLUE = 2; // Blue Cover +float MISCBOOK_RED = 3; // Red Cover + +//---------------------------------------------------------------------- +string SOUND_EMPTY = "misc/null.wav"; // No sound +string MODEL_EMPTY = "progs/ad171/misc_empty.mdl"; // Empty Model (1 point) +string MODEL_BROKEN = "progs/ad171/misc_broken.mdl"; // Model error +string MODEL_IMPACT = "progs/ad171/misc_impact.mdl"; // Impact Model Marker +string MODEL_CORNER1 = "progs/ad171/misc_corner1.mdl";// Path corner helper (Forward) +string MODEL_CORNER2 = "progs/ad171/misc_corner2.mdl";// Path corner helper (Backward) +string MODEL_BACKPACK = "progs/ad171/w_backpack.mdl"; // HD backpack + +string MODEL_PLAYER = "progs/player.mdl"; +string MODEL_PLAYER_HEAD = "progs/h_player.mdl"; +string MODEL_PLAYER_EYES = "progs/eyes.mdl"; + +string SOUND_HEAL15 = "items/r_item1.wav"; // pickup sound for rotten health +string SOUND_HEAL25 = "items/health1.wav"; // large health +string SOUND_HEAL100 = "items/r_item2.wav"; // mega health +string SOUND_RESPAWN = "items/itembk2.wav"; // item respawn sound +string SOUND_TALK = "misc/talk.wav"; // Activate/message sound + +string SOUND_REXP3 = "weapons/r_exp3b.wav"; // Original explode sound +string SOUND_PLASMA_FIRE = "weapons/plasma_fire.wav"; // Plasma Fire +string SOUND_PLASMA_HIT = "weapons/plasma_hit.wav"; // Plasma Impact + +// Resist ammo damage +string SOUND_RESIST_ROCKET = "weapons/resist_rocket.wav"; + +//---------------------------------------------------------------------- +// Projectile models +string MODEL_PROJ_DIAM1 = "progs/ad171/proj_diam1.mdl"; // Not used atm +string MODEL_PROJ_DIAM2 = "progs/ad171/proj_diam2.mdl"; +string MODEL_PROJ_SMOKE = "progs/ad171/proj_smoke.mdl"; +string MODEL_PROJ_SHELLC = "progs/ad171/proj_shellcase.mdl"; +string MODEL_PROJ_NG = "progs/ad171/proj_ng.mdl"; +string MODEL_PROJ_NGRED = "progs/ad171/proj_ngred.mdl"; +string MODEL_PROJ_SNG = "progs/ad171/proj_sng.mdl"; +string MODEL_PROJ_GRENADE = "progs/ad171/proj_grenade.mdl"; +string MODEL_PROJ_GRENADEGRN = "progs/ad171/proj_grenadegrn.mdl"; +string MODEL_PROJ_RINGSHOCK = "progs/ad171/proj_ringshock.mdl"; +string MODEL_PROJ_RINGBLAST = "progs/ad171/proj_ringblast.mdl"; +string MODEL_PROJ_ROCKET = "progs/ad171/proj_rocket.mdl"; +string MODEL_PROJ_FLESH = "progs/ad171/proj_flesh.mdl"; +string MODEL_PROJ_FLESHP = "progs/ad171/proj_fleshp.mdl"; +string MODEL_PROJ_HKN = "progs/ad171/proj_dk.mdl"; +string MODEL_PROJ_HKNGRN = "progs/ad171/proj_dkgrn.mdl"; +string MODEL_PROJ_SERG = "progs/ad171/proj_serg.mdl"; +string MODEL_PROJ_FURY1 = "progs/ad171/proj_fury1.mdl"; +string MODEL_PROJ_FURY2 = "progs/ad171/proj_fury2.mdl"; +string MODEL_PROJ_NOUR1 = "progs/ad171/proj_nour1.mdl"; +string MODEL_PROJ_NOUR2B = "progs/ad171/proj_nour2b.mdl"; +string MODEL_PROJ_NOUR2P = "progs/ad171/proj_nour2p.mdl"; +string MODEL_PROJ_NOUR2S = "progs/ad171/proj_nour2s.mdl"; +string MODEL_PROJ_NOUR3 = "progs/ad171/proj_nour3.mdl"; +string MODEL_PROJ_BLORD1B = "progs/ad171/proj_blord1b.mdl"; +string MODEL_PROJ_BLORD1S = "progs/ad171/proj_blord1s.mdl"; +string MODEL_PROJ_BLORDBOLT = "progs/ad171/proj_blord2.mdl"; +string MODEL_PROJ_BLORDBEAM = "progs/ad171/proj_blordbeam.mdl"; +string MODEL_PROJ_BLORDBOLT1 = "progs/ad171/proj_blordbolt1.mdl"; +string MODEL_PROJ_BLORDBEAM1 = "progs/ad171/proj_blordbeam1.mdl"; +string MODEL_PROJ_BLORD2B = "progs/ad171/proj_blord2b.mdl"; +string MODEL_PROJ_BLORD2S = "progs/ad171/proj_blord2s.mdl"; +string MODEL_PROJ_BLORDBOLT2 = "progs/ad171/proj_blordbolt2.mdl"; +string MODEL_PROJ_BLORDBEAM2 = "progs/ad171/proj_blordbeam2.mdl"; +string MODEL_PROJ_SHAMLIT = "progs/ad171/proj_shamlit.mdl"; +string MODEL_PROJ_WIZ = "progs/ad171/proj_wiz.mdl"; +string MODEL_PROJ_SPID = "progs/ad171/proj_spider.mdl"; +string MODEL_PROJ_VORE = "progs/ad171/proj_voreling.mdl"; +string MODEL_PROJ_SWAMP = "progs/ad171/proj_swampling.mdl"; +string MODEL_PROJ_SHOME = "progs/ad171/proj_shalhome.mdl"; +string MODEL_PROJ_SHAL = "progs/ad171/proj_shal.mdl"; +string MODEL_PROJ_SHALGRN = "progs/ad171/proj_shalgrn.mdl"; +string MODEL_PROJ_SBALL = "progs/ad171/proj_shalball.mdl"; +string MODEL_PROJ_SEGG = "progs/ad171/proj_shalegg.mdl"; +string MODEL_PROJ_SSHELL = "progs/ad171/proj_shalshell.mdl"; +string MODEL_PROJ_LAVA = "progs/ad171/proj_balllava.mdl"; +string MODEL_PROJ_SLIME = "progs/ad171/proj_ballslime.mdl"; +string MODEL_PROJ_DROLE = "progs/ad171/proj_drole.mdl"; +string MODEL_PROJ_DROLEGRN = "progs/ad171/proj_drolegrn.mdl"; +string MODEL_PROJ_LASER = "progs/ad171/proj_laz.mdl"; +string MODEL_PROJ_LASERGRN = "progs/ad171/proj_lazgrn.mdl"; +string MODEL_PROJ_LIGHTNING2 = "progs/ad171/proj_lightning2.mdl"; +string MODEL_PROJ_PLASMA = "progs/ad171/proj_plasma.mdl"; +string MODEL_PROJ_PLASMAGRN = "progs/AD171/proj_plasmagrn.mdl"; +string MODEL_PROJ_PGPLASMA = "progs/ad171/proj_pgplasma.mdl"; +string MODEL_PROJ_GAPLASMA = "progs/ad171/proj_gaplasma.mdl"; +string MODEL_PROJ_GAPLASMAGRN = "progs/ad171/proj_gaplasmagrn.mdl"; +string MODEL_PROJ_BOLT1 = "progs/ad171/proj_bolt1.mdl"; +string MODEL_PROJ_SWSKULL = "progs/ad171/proj_skullwiz.mdl"; +string MODEL_PROJ_SWSKULLP = "progs/ad171/proj_skullwizp.mdl"; +string MODEL_PROJ_SWBALL = "progs/ad171/proj_skullball.mdl"; +string MODEL_PROJ_GARGBALL = "progs/ad171/proj_gargball.mdl"; +string MODEL_PROJ_GARGBALLGRN = "progs/ad171/proj_gargballgrn.mdl"; +string MODEL_PROJ_GARGOYLE = "progs/ad171/proj_gargoyle.mdl"; +string MODEL_PROJ_WTRAIL = "progs/ad171/proj_wraithtrail.mdl"; +string MODEL_PROJ_WBALL = "progs/ad171/proj_wraithball.mdl"; +string MODEL_PROJ_WBONE = "progs/ad171/proj_wraithbone.mdl"; +string MODEL_PROJ_WPOISON = "progs/ad171/proj_wraithpoison.mdl"; +string MODEL_PROJ_WEGG = "progs/ad171/proj_wraithegg.mdl"; +string MODEL_PROJ_WSHELL = "progs/ad171/proj_wraithshell.mdl"; +string MODEL_PROJ_SCORP = "progs/ad171/proj_scorpion.mdl"; +string MODEL_PROJ_MBALL = "progs/ad171/proj_minoball.mdl"; +string MODEL_PROJ_MPLASMA = "progs/ad171/proj_minoplasma.mdl"; +string MODEL_PROJ_MPOISON = "progs/ad171/proj_minopoison.mdl"; +string MODEL_PROJ_GROCK1 = "progs/ad171/proj_golemrock1.mdl"; +string MODEL_PROJ_GROCK2 = "progs/ad171/proj_golemrock2.mdl"; +string MODEL_PROJ_EIDO1 = "progs/ad171/proj_eidolonrock1.mdl"; +string MODEL_PROJ_GSHARD = "progs/ad171/proj_golemshard.mdl"; +string MODEL_PROJ_RAIND = "progs/xmas/proj_rdrocket.mdl"; +string MODEL_PROJ_ELF = "progs/xmas/proj_elfsnow.mdl"; +string MODEL_PROJ_SNOWBALL = "progs/xmas/proj_snowball.mdl"; +string MODEL_PROJ_CHTHON1 = "progs/ad171/proj_chthon1.mdl"; +string MODEL_PROJ_SHUB1 = "progs/ad171/proj_shub1.mdl"; +string MODEL_PROJ_SHUB2 = "progs/ad171/proj_shub2.mdl"; + +//---------------------------------------------------------------------- +// Sprites +string SEXP_SMALL = "progs/ad171/s_exp_small.spr"; // Original ID one +string SEXP_MED = "progs/ad171/s_exp_med.spr"; // From Quoth +string SEXP_BIG = "progs/ad171/s_exp_big.spr"; // From Quoth +string SEXP_PLASMA_SMALL = "progs/ad171/s_exp_plasma_small.spr"; // Kinn/Marcher +string SEXP_PLASMA_BIG = "progs/ad171/s_exp_plasma_big.spr"; // Kinn/Marcher +string SEXP_POISON_SMALL = "progs/ad171/s_exp_poison_small.spr"; // Kinn/Marcher +string SEXP_POISON_MED = "progs/ad171/s_exp_poison_med.spr"; // From Quoth +string SEXP_ELECTRIC = "progs/ad171/s_exp_electric.spr"; // From Quoth +string SEXP_ICE_BIG = "progs/ad171/s_exp_ice_big.spr"; // From Ne_ruins +string SBURST_FLAME = "progs/ad171/s_burst_flame.spr"; // From Rubicon2 +string SBURST_FLAMEDP = "progs/ad171/s_burst_flamedp.spr"; // DP collision +string SBURST_POISON = "progs/ad171/s_burst_poison.spr"; // From Rubicon2 +string SBURST_POISONDP = "progs/ad171/s_burst_poisondp.spr"; // DP collision +string SBURST_SMOKE = "progs/ad171/s_burst_smoke.spr"; // From Rubicon2 +string SBURST_STEAM = "progs/ad171/s_burst_steam.spr"; // From Rubicon2 +string SBUBBLE_DROWN = "progs/s_bubble.spr"; // Original ID one +string SWATER_DRIP = "progs/ad171/s_dripblue.spr"; // From RRP/RMQ +string SWATER_SPLASH = "progs/ad171/s_dripsplblue.spr"; // From RRP/RMQ +string SBLOOD_DRIP = "progs/ad171/s_dripred.spr"; // Re-painted +string SBLOOD_SPLASH = "progs/ad171/s_dripsplred.spr"; +string SSLIME_DRIP = "progs/ad171/s_dripgreen.spr"; // Re-painted +string SSLIME_SPLASH = "progs/ad171/s_dripsplgreen.spr"; + +//---------------------------------------------------------------------- +// Sprite types +float EXPLODE_SMALL = 1; +float EXPLODE_MED = 2; +float EXPLODE_BIG = 3; +float EXPLODE_PLASMA_SMALL = 11; +float EXPLODE_PLASMA_MED = 12; +float EXPLODE_PLASMA_BIG = 13; +float EXPLODE_POISON_SMALL = 21; +float EXPLODE_POISON_MED = 22; +float EXPLODE_POISON_BIG = 23; +float EXPLODE_ELECT_SMALL = 31; +float EXPLODE_ELECT_MED = 32; +float EXPLODE_ELECT_BIG = 33; +float EXPLODE_ICE_BIG = 38; +float EXPLODE_BURST_SMOKE = 41; +float EXPLODE_BURST_FLAME = 42; +float EXPLODE_BURST_POISON = 43; + +//---------------------------------------------------------------------- +// WORLD weapon models (player) +string MODEL_GWEAP_UPAXE = "progs/ad171/g_shadaxe.mdl"; // Has all 6 skins +string MODEL_GWEAP_SG = "progs/ad171/g_shot1.mdl"; // From Rubicon +string MODEL_GWEAP_SSG = "progs/ad171/g_shot2.mdl"; // New Model update +string MODEL_GWEAP_UPSSG = "progs/ad171/g_shot3.mdl"; // SSG Upgrade +string MODEL_GWEAP_NG = "progs/ad171/g_nail.mdl"; // Remake from me +string MODEL_GWEAP_SNG = "progs/ad171/g_nail2.mdl"; +string MODEL_GWEAP_GL = "progs/g_rock.mdl"; +string MODEL_GWEAP_RL = "progs/g_rock2.mdl"; +string MODEL_GWEAP_LG = "progs/g_light.mdl"; +string MODEL_GWEAP_UPLG = "progs/ad171/g_plasma.mdl"; // LG Upgrade + +// VIEW weapon models (player) +string MODEL_VWEAP_UPAXE = "progs/ad171/v_shadaxe3.mdl"; // Axe Upgrade +string MODEL_VWEAP_SG = "progs/ad171/v_shot.mdl"; +string MODEL_VWEAP_SSG = "progs/ad171/v_shot2.mdl"; +string MODEL_VWEAP_UPSSG = "progs/ad171/v_shot3.mdl"; // SSG Upgrade +string MODEL_VWEAP_NG = "progs/ad171/v_nail.mdl"; +string MODEL_VWEAP_SNG = "progs/ad171/v_nail2.mdl"; +string MODEL_VWEAP_GL = "progs/ad171/v_rock.mdl"; +string MODEL_VWEAP_RL = "progs/ad171/v_rock2.mdl"; +string MODEL_VWEAP_LG = "progs/ad171/v_light.mdl"; +string MODEL_VWEAP_UPLG = "progs/ad171/v_plasma.mdl"; // LG Upgrade + +//---------------------------------------------------------------------- +// Standard ID artifact sounds +string SOUND_ARTSUIT1 = "items/suit.wav"; // Pick up +string SOUND_ARTSUIT2 = "items/suit2.wav"; // Fading +string SOUND_ARTWETS1 = "items/wetsuit.wav"; // Pick up +string SOUND_ARTWETS2 = "items/wetsuit2.wav"; // Fading +string SOUND_ARTWETS3 = "items/wetsuit3.wav"; // In Water +string SOUND_ARTWETS3B = "items/wetsuit3out.wav"; // Out Water +string SOUND_ARTPENT1 = "items/protect.wav"; // Pick up +string SOUND_ARTPENT2 = "items/protect2.wav"; // Fading +string SOUND_ARTPENT3 = "items/protect3.wav"; // Active +string SOUND_ARTINV1 = "items/inv1.wav"; // Pick up +string SOUND_ARTINV2 = "items/inv2.wav"; // Fading +string SOUND_ARTINV3 = "items/inv3.wav"; // Active +string SOUND_ARTQUAD1 = "items/damage.wav"; // Pick up +string SOUND_ARTQUAD2 = "items/damage2.wav"; // Fading +string SOUND_ARTQUAD3 = "items/damage3.wav"; // Active +string SOUND_ARTSHARP1 = "items/sharp.wav"; // Pick up +string SOUND_ARTSHARP2 = "items/sharp2.wav"; // Fading +string SOUND_ARTSHARP3 = "items/sharp3.wav"; // Active +string SOUND_ARTNAILP1 = "items/nailp.wav"; // Pick up +string SOUND_ARTNAILP2 = "items/nailp2.wav"; // Fading +string SOUND_ARTNAILP3 = "items/nailp3.wav"; // Active + +//---------------------------------------------------------------------- +// DeBuff sounds +string SOUND_HEARTBEAT = "player/heartbeat.wav"; // Fast heartbeat (1s) + +//---------------------------------------------------------------------- +// Footstep sounds +string SOUND_FS_SLOW1 = "steps/slow1.wav"; +string SOUND_FS_SLOW2 = "steps/slow2.wav"; +string SOUND_FS_SLOW3 = "steps/slow3.wav"; +string SOUND_FS_SLOW4 = "steps/slow4.wav"; +string SOUND_FS_SLOW5 = "steps/slow5.wav"; + +string SOUND_FS_DRAG1 = "steps/drag1.wav"; +string SOUND_FS_DRAG2 = "steps/drag2.wav"; +string SOUND_FS_DRAG3 = "steps/drag3.wav"; +string SOUND_FS_DRAG4 = "steps/drag4.wav"; +string SOUND_FS_DRAG5 = "steps/drag5.wav"; + +string SOUND_FS_LIGHT1 = "steps/light1.wav"; +string SOUND_FS_LIGHT2 = "steps/light2.wav"; +string SOUND_FS_LIGHT3 = "steps/light3.wav"; +string SOUND_FS_LIGHT4 = "steps/light4.wav"; +string SOUND_FS_LIGHT5 = "steps/light5.wav"; + +string SOUND_FS_MEDIUM1 = "steps/medium1.wav"; +string SOUND_FS_MEDIUM2 = "steps/medium2.wav"; +string SOUND_FS_MEDIUM3 = "steps/medium3.wav"; +string SOUND_FS_MEDIUM4 = "steps/medium4.wav"; +string SOUND_FS_MEDIUM5 = "steps/medium5.wav"; + +string SOUND_FS_HEAVY1 = "steps/heavy1.wav"; +string SOUND_FS_HEAVY2 = "steps/heavy2.wav"; +string SOUND_FS_HEAVY3 = "steps/heavy3.wav"; +string SOUND_FS_HEAVY4 = "steps/heavy4.wav"; +string SOUND_FS_HEAVY5 = "steps/heavy5.wav"; + +string SOUND_FS_LARGE1 = "steps/large1.wav"; +string SOUND_FS_LARGE2 = "steps/large2.wav"; +string SOUND_FS_LARGE3 = "steps/large3.wav"; +string SOUND_FS_LARGE4 = "steps/large4.wav"; +string SOUND_FS_LARGE5 = "steps/large5.wav"; + +string SOUND_FS_GIANT1 = "steps/giant1.wav"; +string SOUND_FS_GIANT2 = "steps/giant2.wav"; +string SOUND_FS_GIANT3 = "steps/giant3.wav"; +string SOUND_FS_GIANT4 = "steps/giant4.wav"; +string SOUND_FS_GIANT5 = "steps/giant5.wav"; + +/* For reference only +float SVC_BAD = 0; +float SVC_NOP = 1; +float SVC_DISCONNECT = 2; +float SVC_UPDATESTAT = 3; +float SVC_VERSION = 4; +float SVC_SETVIEW = 5; +float SVC_SOUND = 6; +float SVC_TIME = 7; +float SVC_PRINT = 8; +float SVC_STUFFTEXT = 9; +float SVC_SETANGLE = 10; +float SVC_SERVERINFO = 11; +float SVC_LIGHTSTYLE = 12; +float SVC_UPDATENAME = 13; +float SVC_UPDATEFRAGS = 14; +float SVC_CLIENTDATA = 15; +float SVC_STOPSOUND = 16; +float SVC_UPDATECOLORS = 17; +float SVC_PARTICLE = 18; +float SVC_DAMAGE = 19; +float SVC_SPAWNSTATIC = 20; +float SVC_SPAWNBINARY = 21; +float SVC_SPAWNBASELINE = 22; +float SVC_TEMPENTITY = 23; +float SVC_SETPAUSE = 24; +float SVC_SIGNONNUM = 25; +float SVC_CENTERPRINT = 26; +float SVC_KILLEDMONSTER = 27; +float SVC_FOUNDSECRET = 28; +float SVC_SPAWNSTATICSOUND= 29; +float SVC_INTERMISSION = 30; +float SVC_FINALE = 31; +float SVC_CDTRACK = 32; +float SVC_SELLSCREEN = 33; +float SVC_CUTSCENE = 34; +*/ \ No newline at end of file diff --git a/QC_other/QC_keep/defsdrake.qc b/QC_other/QC_keep/defsdrake.qc new file mode 100644 index 00000000..2a59c431 --- /dev/null +++ b/QC_other/QC_keep/defsdrake.qc @@ -0,0 +1,624 @@ +float ALPHA_GHOST = 0.7; // Used by wraiths. +float ALPHA_ICE = 0.7; // Used by ice shards. +float ALPHA_ICEBALL = 0.9; // Used by iceballs. + +//vector ARMOR_STATS_GREEN = '0.3 100 1'; +//vector ARMOR_STATS_YELLOW = '0.6 150 2'; +//vector ARMOR_STATS_RED = '0.8 200 4'; +// Note: Dragonscale uses the same stats as red armor. +vector ARMOR_STATS_COURAGE = '0.95 150 4'; +vector ARMOR_STATS_ONYX = '0.5 0 8388608'; +//vector ARMOR_STATS_POWER = '0.5 0 65536'; // Onyx with power shield. +vector ARMOR_STATS_DEMON = '0 100 4'; +vector ARMOR_STATS_SPIRIT = '1 25 0'; +vector ARMOR_STATS_CHAOS = '0 200 65536'; +vector ARMOR_STATS_ULTRA = '1 30 65536'; // Ultra enforcer armor. + +// Custom attack states. +//See defshipnotic.qc float AS_DODGING = 5; // One of Hipnotic's inventions for the scourge. +float AS_CHASING = 9; // Use shortest, direct path to chase target. +float AS_VERTICAL = 10; // Like AS_SLIDING, but vertical (up or down). +float AS_FLANKING = 11; // AS_SLIDING if close, AS_STRAIGHT otherwise. +float AS_FLEEING = 12; // Reverse of AS_STRAIGHT, used by wraith. +float AS_REAPER = 13; // Sucking in souls, used by wraith. +float AS_COWARDLY = 14; // Back off if too close. Otherwise, as_straight. + +float ATTN_DAMAGE = 0.5; // Default attenuation for radius damage. + +// arrows ------------------------------------------------------------------- +float AKARROW_SPEED_FLY = 1000; +//float AKARROW_SPEED_TOSS = 1200; +float ARROW_FLY = 2; // Use 0=FALSE(toss) or 2=TRUE(flymissile). + +// arrow model skins +float ARROW_WOOD = 0; +float ARROW_EBONY = 1; +float ARROW_ICE = 2; +float ARROW_MAGIC = 3; // Orange. Use skin + 3 to match laser colors. + +// Burning damage constants. +float BURN_PER_SECOND = 4; // 4 is slime dmg, 5 divides evenly with armor %s. +float MAX_BURN_DAMAGE = 60; // Enough to kill standard zombies. + // FIXME: No it isn't with regeneration! + +float CURSE_DAMAGE = 1; // Reverse Resistance +float CURSE_WEAKEN = 2; // Reverse Strength +float CURSE_SLOW = 3; // Reverse Haste +float CURSE_ARMOR = 4; // Reverse Regeneration +float CURSE_CONFUSE = 5; +//float CURSE_LIFETAP = 6; + +vector VEC_360 = '360 360 0'; +vector VEC_QUAKE = '5 4 4'; // Standard earthquake angle tilts. + +// deathmatch values -------------------------------------------------------- +float DM_OLD_SCHOOL = 2; // Like Doom, weapons stay, nothing respawns. + // Deathmatch 2 is 'the silly old rules'. +//float DM_DOOM = 4; // Use Doom style shotguns -- OBSOLETE! +float DM_GRAPPLE = 8; // Players start with grapple. +float DM_MONSTERS = 16; // SoE: Monsters stay on the level. +float DM_REVIVE = 32; // Monsters resurrect after death. + +// damage values ------------------------------------------------------------ +// FIXME: Redo damage types. +// acid = 1, cold = 2, fire = 3, lightning = 4, nether = 5. +float DF_NONE = 0; // No flags -- just for readability. +float DF_TIMED = 1; // Damage done slowly over time... usually. +float DF_NO_ARMOR = 2; // Armor cannot absorb this damage. +float DF_NO_KNOCK = 4; // Don't add to velocity. +float DF_GIB = 8; // Attack will gib if it kills the target. +float DF_LEECH = 16; // Attacker heals from target damage. +float DF_PROXY = 32; // Indirect attack, no quad, no thorns. + // Used by doors and the bloodcube. +float DF_SCAR = 64; // Can kill zombies if applied continuously. +float DF_ACID = 128; +float DF_COLD = 256; +float DF_FIRE = 512; +float DF_LIGHTNING = 1024; +float DF_ROCKET = 2048; // Damage caused by rockets and equivalent. +float DF_BURN = 4096; // Target may ignite when damaged. +//float DF_13 = 8192; +float DF_MELEE = 8192; // Melee attack, used to check a powerup. +float DF_PERCENT = 16384; // Remove current hp% instead of hp. +// Radius only +float DF_SAFE = 32768; // Attacker is immune to his attack. +float DF_WATER_ONLY = 65536; // Takes damage only if in water. +// Special +//float DF_17 = 131072; // Matching class can't hurt each other. +float DF_NO_GIB = 131072; // Attack cannot gib. +float DF_ZKILL = 262144; // One-hit kill zombies on direct hit. +float DF_CROSS_BLOCK = 524288; // Cross blocks all damage. +float DF_PUSH_NPC = 1048576; // Apply knockback to npcs. +float DF_NO_SHIELDS = 2097152; // Mega-enforcer shields can't stop this. +float DF_NO_REACT = 4194304; // Don't get mad at attacker. +float DF_BLESSED = 8388608; // Don't hit allies. +// FIXME: Add more flags? Must replace some of the above flags first. +// DF_HIT_ALL = Hit solid_not. +// DF_CLASSED = Ignore targets with same classname. +// DF_NO_HALF = Attacker takes full damage instead of half. +// DF_NETHER = Hurts living, not undead. + +// Combo values +//float DFx_TYPES = 7; +float DFx_BURNING = 69; // Timed + No Knock + Scar +float DFx_FIREBALL = 576; // Fire + Scar +//float DFx_FIREBALL = 4672; // Fire + Scar + Burn +//float DFx_PLASMA = 3072; // Lightning + Rocket +float DFx_RESISTS = 3969; // Acid + Cold + Fire + Lightning + Rocket + +// Note to self, don't add centroid morph: +// * Proper view_ofs is too low. Things look ugly when player sits inside +// an item he cannot take. (e.g., ammo or health when at max capacity.) +// * Fat shambler-sized forms are often difficult to navigate with. +// In fact, I am tempted to replace the dragon morph with something +// such as an imp. Dragon stays due to legacy issues (i.e., Soul of Evil). +float FORM_DRAGON = 1; + +// hit type ----------------------------------------------------------------- +//.float hittype; + +float HIT_NORMAL = 0; // Default. +float HIT_METAL = 1; // Knights, centroids, and other armored guys. +float HIT_STONE = 2; // Statues, golems. + + + +// List of exotic armor. Player can wear only one at a time. Duh! +float SUIT_COURAGE = 1; // Reflective half-armor. From Zerstorer. +float SUIT_DRAGON = 2; // Dragonscale and morph. +float SUIT_ONYX = 3; // Indestructible. +float SUIT_ONYX_POWER = 4; // As Onyx, plus built-in power shield. +float SUIT_BERSERKER = 5; // Demonhide - regeneration and life-saving. +float SUIT_SPIRIT = 6; // Spirit shroud, like hyper enforcer shield. +float SUIT_CHAOS = 7; // Variable protection, teleportation. +float SUIT_NINJA = 8; // Jumpsuit with special powers. +float SUIT_ULTRA = 9; // Ultra enforcer particle shield. NPC only. + +float SUITx_ALL = 15; // Value must be a power of 2 minus 1. + // This means 3, 7, or 15. No higher. + +float COURAGE_DAMAGE = 10; // Damage to armor if it reflects a rocket. + +//========================================================================== +// Sprite Frame Data + +// FIXME: put unused in 's_unused.spr'. + +// Frames for 's_fancy.spr'. +float X32_PUFF_ORANGE = 0; +float X32_PUFF_BLUE = 5; +float X32_PUFF_PURPLE = 10; +float X32_CLOUD_GREEN = 15; +// Remove - - - - - +float X32_PLASMA_ORANGE = 21; +float X32_PLASMA_RED = 27; +float X32_PLASMA_YELLOW = 33; +float X32_PLASMA_BLUE = 39; +//- - - - - - - - - +float X32_STAR_ORANGE = 45; +float X32_STAR_RED = 50; +float X32_STAR_YELLOW = 55; +float X32_STAR_BLUE = 60; +//- - - - - - - - - +// 4 frames +float X32_SPARK_ORANGE = 65; +float X32_SPARK_RED = 69; +float X32_SPARK_YELLOW = 73; +float X32_SPARK_BLUE = 77; +float X32_CUT_ORANGE = 81; +float X32_CUT_RED = 85; +float X32_CUT_YELLOW = 89; +float X32_CUT_BLUE = 93; +//- - - - - - - - - +float X56_PUFF_ORANGE = 97; +float X56_PUFF_BLUE = 103; +float X56_PUFF_PURPLE = 109; +float X56_CLOUD_GREEN = 115; +float X56_PLASMA_ORANGE = 120; +float X56_PLASMA_RED = 126; +float X56_PLASMA_YELLOW = 132; +float X56_PLASMA_BLUE = 138; +float X56_SPLASH_RED = 144; +float X56_SPLASH_GREEN = 147; +float X56_SPLASH_PURPLE = 150; +float X80_SPARK_ORANGE = 153; +float X80_SPARK_RED = 159; +float X80_SPARK_YELLOW = 165; +float X80_SPARK_BLUE = 171; + +// Frames for 's_wave.spr'. +float RING_FIRE = 0; // Custent's flaming shockwave, modified. +float RING_BLUE = 8; // Drake's airstrike impact. +float RING_QUAKE = 14; // Drake's quake slam. +float RING_ICE = 19; // Iceball shockwave. +// Ends at frame 21. + +// Select frames in 's_wave2.spr'. Each color lasts 3 frames. +float RING2_QUAKE = 0; +float RING2_ICE = 6; +// Ends at frame 56. + +// If you want an object that does not spray gore when hit by the likes of +// a chainsaw, add +1 to one of the non-zero defined bloodtypes. +// For example, (ent.bloodtype = BLOOD_RED + 1;). +// The 'particle' function uses all colors within a range +// from (x*8) to (x*8)+7, where x ranges from 0 to 31. +//============ +float BLOOD_NONE = 0; +float BLOOD_DARK = 33; // Black-and-blue for shadow creatures. +float BLOOD_GREEN = 57; // For acid-blooded ala Alien Quake. +float BLOOD_RED = 73; // Standard blood red color. +float BLOOD_SPARKS = 105; // For machines like drones or robots. +float BLOOD_PURPLE = 145; // For tarbaby. +//float BLOOD_BLUE = 209; // For cacodemons. +//float BLOOD_SHAFT = 225; // Alternate blood red color. +float BLOOD_FIRE = 233; // For lava monsters like Chthon. +float CHUNKS_ICE = -41; // For ice chunks. + +float BB_GREEN = 1; // Blood bits for bloodbank +float BB_PURPLE = 2; +float BB_FIRE = 4; + +//float FLx_MOVE = 3; // Fly + Swim +float FLx_CREATURE = 40; // Client + Monster +float FLx_NOT_MISSILE = 296; // Client + Monster + Item +//float FLx_CHEATS = 192; // Godmode + Notarget +float FLx_NOT_FALLING = 515; // Fly + Swim + Onground +float FLx_JUMP_READY = 4608; // Onground + Jumpreleased + +float GIB_HEAD = 1; // Head gib. +float GIB_EAT = 2; // Gib can be eaten for health. +float GIB_DMV = 4; // Add damage velocity to gib velocity. +float GIB_BODY_HALF = 8; // Spawn within the lower half of body. +float GIB_BODY_FULL = 16; // Spawn anywhere from e.absmin to e.absmax. +float GIB_SKIN_MATCH = 32; // Set gib.skin equal to self.skin, not 0. +float GIB_BURN = 64; // Gib burns away. Used for books. +float GIBx_STATUE = 12; // Properties for statue gibs. Dmv+Half. +float GIBx_GIB = 14; // Normal properties for gibs. Eat+Dmv+Half. +float GIBx_RUBBLE = 20; // Properties for rubble. Dmv+Full. + +float HOOK_NEAR = 50; + +float INF_SAFE = 1000000; // Use this if operations is a possibility +float INFINITY = 16777215; // High as we can go without rollover. + +// Unlike in other games (e.g., Doom, Quake2). All we need mass for are: +// 1) Who gets pulled when grappled. +// 2) Who gets shaken and damaged by earthquakes. +// For these purposes, a few weight classes are sufficient. +// Do not use them to calculate velocities, such as v = vel * (1 / mass). +// Besides, the velocity effects in Quake look best without varying mass +// mucking up expected flight paths of gibs and the like. +//- - - - - - - - - +float MASS_LIGHT = 1; // Under 0.5x player mass. +float MASS_MEDIUM = 2; // From 0.5x to 1.5x player mass. +float MASS_HEAVY = 3; // From 1.5x to 5x player mass. +float MASS_SUPER = 4; // Over 5x player mass. +//float MASS_X = 0; // Over 10x player mass. +//- - - - - - - - - +// Note: Zero mass is treated as beyond superheavy. +// Explanation of mass/weight classes. +//- - - - - - - - - +// Light = Target gets pulled toward grappler. +// Medium = Neither target nor grappler are pulled. +// Heavy = Grappler gets pulled toward target. +// Superheavy = As heavy, but target is immune to quakes and resists pushing. +// X = As superheavy, plus immune to forced movement of any kind. +//- - - - - - - - - + +// rocket damage types ------------------------------------------------------ +float MDAM_RANDOM = 0; // damage = damage * (5+random()) / 6 +float MDAM_GRENADE = 1; // Use radius damage, with minimum of 10% max. +float MDAM_FULL = 2; // Full damage on contact. +float MDAM_TWENTY = 3; // Damage ranges from dmg-20 to dmg. + +// Dragon flags (NOTE: Also used for other monsters...) +float RYU_ELEMENTS = 3; + float RYU_USE_FIRE = 0; + float RYU_USE_ACID = 1; + float RYU_USE_LITE = 2; + float RYU_USE_ICE = 3; +float RYU_BOMB = 4; +//float RYU_03 = 8; +//float RYU_04 = 16; +//float RYU_05 = 32; +float RYU_ALERT = 64; // Has better awareness and reflexes. +float RYU_CRANKED = 128; // Stronger, and may use special attacks. +float RYU_NO_WATER = 256; // Hates and avoids water. +float RYU_STAY = 512; // Stay if on, move if off. +float RYU_CALM = 1024; // Ignore targets if on. +float RYU_PATROL = 2048; // Glide back-and-forth. +float RYU_FORCED = 4096; // Commanded by player to shoot. +//float RYU_GREEDY = 8192; // PET: Take every item with loot rank. +//float RYU_LOADED = 16384; // PET: Currently holds loot. +//float RYU_RUNAWAY = 32768; // PET: Ignore items. +//float RYU_DRACO = 65536; // PLAYER: Draco is alive! +//float RYU_TELEPORT = 131072; // PET: Draco was told to teleport. +float RYU_BERSERK = 65536; // For drole. +// FIXME: Next three bits could be moved to somewhere else? +float RYU_JUSTHIT = 131072; // Cyberdemon: shoot back after pain. +//float RYU_SLOW = 262144; // PET: Move slowly for one frame. +float RYU_ANGRY = 262144; // Infight even if alert. Fix for Hell. +float RYU_INSANE = 524288; // Attack ally if hurt by it. +float RYU_PATH = 1048576; // DoE: Stay on path, for DoE dragon. +//float RYU_FLANKER = 2097152; // Move like Quoth enforcers. +float RYU_DOOM = 2097152; // Use Doom AI. +float RYU_REBEL = 4194304; // SoE: For rebel archers in nsoe2. +float RYU_REAPER = 8388608; // Soul collector. +//float RYU_NO_SIGHT = ??? // No Line of sight needed for attacks. + +// Speed for various missiles. +float SPEED_HOOK = 500; // Was 500 in Roman, 1000 in original. +float SPEED_BURIZA = 2000; // Was 1000. + +// --> Spawnflags <-- +// Note: sf32, 64, and 128 are the same as in Quoth. +// Note#2: Zerstorer used sf64 for delay spawn, Quake2 used sf2. +float SPAWN_AMBUSH = 1; // Standard. Wake up on sight or pain. +//float SPAWN_BOSS = 2; // Upgrades some to boss versions. +float SPAWN_STATUE = 4; // Statue mode for select monsters. +float SPAWN_WHITE = 16; // Monster teams up and helps client. +float SPAWN_SILENT = 32; // Slient sf64. +float SPAWN_NORMAL = 64; // Spawns when triggered; classic sf64. +float SPAWN_AWARE = 128; // Monsters: Spawn mad at activator. +float SPAWN_RESPAWN = 128; // Items: Always respawn. +// Next four are used by Quake engine to remove entities during level load. +//float SPAWN_NOT_EASY = 256; +//float SPAWN_NOT_NORM = 512; +//float SPAWN_NOT_HARD = 1024; +//float SPAWN_NOT_DM = 2048; + +// Note to self, don't add IKguns: +// * Models are off to the side, while Quake weapons are centered. +// * Plasma gun Doom/IK style is redundant with super nailgun, lasers, +// and lightning guns. (Quoth style plasma on the other hand...) +// * Asha is not necessary now that Tome of Power modifies shotguns to +// fire similar effects. +// There, I said it! Here so I don't think about adding the asha back. + +// Note 1/31/2010: Plasma can kill zombies, but lasers can't, so plasma +// may need to be added back in case Quoth compatibility is needed. +// Also, chainsaw could be added back. Just use standard model and +// lightning gun frames. Worked for Doom. + +// Note 3/31/2010: Added Quoth's plasma gun. Why? Two reasons. +// One, ToP induced BFG10K mode is better suited for plasma weaponry +// instead of chain lightning. Two, it's the perfect weapon for a +// high-level soldier NPC. (Quoth eliminator, DoomRL former commando.) + +//- - - - - - - - - +// Bits are sorted for 'RankForWeapon'. Higher ranking weapons use high +// bits, and lower ranking weapons use low bits. I use the "bigger is +// better" paradigm because it is possible for a player to have +// NO weapons, and the weapon value for an unarmed player is zero. +// Unarmed players cannot attack -- at all. Having even a crappy +// low-bit weapon is still better than having no weapon. +//- - - - - - - - - +// Note: Axe and sword are interchangable. +// +// Update: Moved Mjolnir to the high end, since it was powered-up. +// An upgrade item will be required in Drake, but not in Tronyn's mods. +//- - - - - - - - - +// Update 4/20/2011: Forget Mjolnir upgrade, leave it powered up. +//- - - - - - - - - +// Update 5/26/2011: I'll level with you. Any plans I had for building +// maps have been scrapped. Tronyn is wrapping up his maps. No point in +// entertaining feature creep if they won't be used. What this means is +// the removal of some weapons. Gone are the following: Monster tamer, +// auto shotgun, and railgun. Monster tamer, I really wanted, as the +// replacement for the Draco bot, but building a good model is too much +// work for me, and implementation without interfering with other stuff +// is a problem. Auto shotgun, the one from Nehahra is somewhat crude +// and not very Quakey. Railgun, standard Quake does not handle such +// effects very well, both engine and level/AI design. I also need to +// build a good model, or reskin the grapple -- I'm not doing that. +// Pity, railgun is a classic weapon. +// +// Note 6/17/2011: Railgun effect may return as a crossbow upgrade item. +//- - - - - - - - - +float WAR_GRAPPLE = 1; // Built as a tool, not a weapon. +float WAR_AXE = 2; // Knives aren't as good as guns. +float WAR_CHAINSAW = 4; // 50% stronger than axe. +float WAR_SHOTGUN = 8; +float WAR_ZAPPER = 16; // Low base damage, but chargable. +float WAR_NAILGUN = 32; +float WAR_SUPER_SHOTGUN = 64; // Buffed to riotgun/Q3 strength. +float WAR_BLASTER = 128; +float WAR_GRENADE_LAUNCHER = 256; +float WAR_SUPER_NAILGUN = 512; +float WAR_SIDEWINDER = 1024; // Proximity gun replacement. +float WAR_ROCKET_LAUNCHER = 2048; +float WAR_LASER_CANNON = 4096; +float WAR_PLASMA_GUN = 8192; // Quoth's, with less damage. +float WAR_THUNDERBOLT = 16384; +float WAR_CHAIN_LIGHTNING = 32768; +float WAR_CRUISE_MISSILE = 65536; // Most destructive gun. +float WAR_MJOLNIR = 131072; // Modified to BFG-like power. +float WAR_BURIZA = 262144; // Insta-kill crossbow. +//float WAR_19 = 524288; +//float WAR_20 = 1048576; +//float WAR_21 = 2097152; +//float WAR_22 = 4194304; +//float WAR_23 = 8388608; // Highest bit, and best weapon. +// All 24 bits on equals 16777215. + +// Weapon combo values +float WARx_QUAKE_WEAPONS = 19306; // Original Quake weapons +float WARx_AXE_FRAMES = 131074; // Use axe frames on this weapon. +float WARx_WEAPON_FREE = 131095; // These don't need ammo to use. +float WARx_NO_STEALING = 131103; // Monsters can't steal these. +float WARx_LASERS = 4224; // Blaster/Laser Cannon guns. +float WARx_SHAFT = 49152; // Chain/Thunderbolt guns. +float WARx_DISCHARGE = 188416; // Discharge when used underwater. +// WARx_AI* are used by monster code only. +float WARx_AI_RAPID_FIRE = 53792; // Nails, LC, Shafts. +float WARx_AI_GUNS = 131048; // Guns used by monster_army npcs. + +float WARx_USES_SHELLS = 72; +float WARx_USES_NAILS = 544; +float WARx_USES_ROCKETS = 68864; +float WARx_USES_CELLS = 192640; + +// IMPORTANT!!! This next one determines what weapons are usable and +// available in the game. Not even the 'legalized' field can override it. +float WARx_ALL_WEAPONS = 524287; // All usable weapon bits on! + +// This links weapons to icons on the sbar. +float WARx_WEAPON1 = 24; // items/weapon == 1 (Shotgun) +float WARx_WEAPON2 = 64; // items/weapon == 2 (Super Shotgun) +float WARx_WEAPON3 = 32; // items/weapon == 4 (Nailgun) +float WARx_WEAPON4 = 4736; // items/weapon == 8 (Super Nailgun) +float WARx_WEAPON5 = 1280; // items/weapon == 16 (Grenades) +float WARx_WEAPON6 = 67584; // items/weapon == 32 (Rockets) +float WARx_WEAPON7 = 319488; // items/weapon == 64 (Thunderbolt) +//float WARx_WEAPON7 = 57344; // items/weapon == 64 (Thunderbolt) +//float WARx_WEAPON8 = 262144; // items/weapon == b23 (Laser Cannon) +float WARx_WEAPON8 = 0; // items/weapon == 128 (Mjolnir) +float WARx_WEAPON9 = 0; // items/weapon == 128 (Mjolnir) + +float XFL_HUNGRY = 1; // Eats items. (Was Draco before removal.) +float XFL_ITEMS = 2; // Can pickup items. +float XFL_GHOUL = 4; // Allowed to eat gibs. "Brains!" +float XFL_IMMUNITY = 8; // Entity is immune to poison. +//float XFL_TELEPORT = 16; // Teleporters can transport this entity. +float XFL_WIND = 32; // Wind tunnels can push this entity. +float XFL_USE_AMMO = 64; // Monster needs ammo to shoot guns. +float XFL_NO_AIR = 128; // Doesn't need to breathe. +//float XFL_WATER = 256; // Breathes in water instead of air. +// FIXME: Add rank. +float XFL_BOSS = 512; // Boss -- Don't infight if coaligned. +float XFL_INEDIBLE = 1024; // Gremlin can't eat this corpse. +float XFL_ZOMBIE = 2048; // Hurt only by 1-hit kill or scar damage. +float XFL_NO_SCAN = 4096; // Ignore this monster during a worldscan. +float XFL_SHIELDS = 8192; // Has DAMAGE_NO because of shields. +float XFL_ARMORED = 16384; // Magic-resistant/immune to knightspike. +float XFL_GHOST_BANE = 32768; // Able to hurt ghosts. +float XFL_ADD_TO_KILL = 65536; // Add one to kills when killed. +float XFL_FIREANGEL = 131072; // Immune to splash damage (cyberdemon). +//float XFL_GRENADE = 262144; // Use different damage algorithm. +float XFL_PET = 524288; // Use to decrement pet counter. +float XFL_NO_BURN = 1048576; // Cannot ignite. +float XFL_IGNORE = 2097152; // Don't infight this entity. +float XFL_SLIMER = 4194304; // Not harmed by slime. +float XFL_FLUX = 8388608; // Made solid by ghost touch code. + +//.float xf2; + +float XF2_QUAKE = 1; // Safe for quake to shake. +float XF2_HORN = 2; // Enemy may be charmed by horn. +//float XF2_ETHEREAL = 4; // Enemy has fazed out. +float XF2_BOOMERANG = 8; // Missile that can return to owner. +float XF2_CLONE = 16; // For Rogue Guardian. + +//.float xsf; // Extra spawnflags used by func_spawn and sf64. + +float XSF_MOVETYPE = 15; // Monster's old movetype. *Do NOT change!* +float XSF_FUNC_SPAWN = 16; // Spawned by func_spawn. +float XSF_SPAWNSILENT = 32; // No fog effects when spawned. +float XSF_SPAWNAWARE = 64; // Mad at activator when spawned. +float XSF_NO_FALL = 128; // Temp add fly flag to stop prethink fall. +float XSF_STATUE = 256; // Spawned as statue. +float XSF_DMSP = 512; // Spawned by dmsp monster spawner. +float XSF_GO = 1024; // Player: TRUE = Repeat spawn. +float XSF_CHEST_HACK = 2048; +float XSF_BODY_DOUBLE = 4096; // Spawned decapitated body double. +float XSF_CUBE_SPAWN = 8192; // Spawned by cube, used in telefrag check. +float XSF_GHOST_HACK = 16384; // nsoe1: Ghost can be hit by any melee. + + +float bloodbank; // Non-red blood types known to be precached. +float cranked; // TRUE = Stronger monsters and brutal falling rules. +float cutscene; // Set to TRUE during a cutscene. +float doomed; // TRUE = Monsters respawn after death. +float gloat; // GLObal fLOAT -- like hknight_type. +float respawning; // Toggle used when respawning monsters. +float soul_evil; // TRUE = Soul of Evil mode. Merger code. +float super_active; + +// hit type ----------------------------------------------------------------- +.float hittype; +vector damage_velocity; // Set by 'T_Damage' for gib velocity. + +.float bloodtype; // For blood other than red, like in Alien Quake. +.float form_active; // Non-zero if player is in monster form. +.float ryuflags; // AI flags for monsters. +.float mass; +.float perms; // Permanent powerups. +.vector purse; // Used by monsters to drop money when killed. + // x=coins, y=gems, z=random data. + // z1=max items, z2=spawn chance, z3=gem chance. +.float spawned; // TRUE if created/summoned after a level load. +.float spawnskin; +.void() th_revive; // Resurrection scene. +.void() th_spawn; // Respawn function. +.void(float hello) th_sight; // Sight sound when spotting a target. +.float tronyn; // Flags that do special things in his maps. +.float waitmin, waitmax; +.float xfl, xf2; // Extra flags without C code connections. +.float xsf; // Extra spawnflags used by func_spawn and sf64. + +//=========================================================================== +// Weapons + +// weapon values ------------------------------------------------------------ +.float saw_time; // Time to play chainsaw idle sound. +.float tracer_time; // Used by rapid-fire energy weapons. +.float zapper_time; // Time to recharge flare gun/wand. +.float arsenal; // Up to 24 weapons can be stored here. +.float war; // Short for 'Weapon ARmed'. Current weapon. +.float drama1; // DRAke Monster Arsenal. For release 1. +.float ammo_super; // Super shots for crossbow. +.float shots_max; // Maximum shots in an attack. +.float shots_left; // Like currentammo. +.float hit_points; // True health, used to stop 'give h <#>'. +.float curse_finished, curse_type, curse_ping; // Necromancer debuffs. +.float curse_slow; // Delay nextthink to time here. +// DISABLED -- Stopping 'give' ammo cheats requires adding code in +// too many places. With the other cheats removed, combined with the +// monsters' ferocity in Hell, the player can give himself as much ammo +// as he wants, and he will probably still die anyway. +// real_* is used to stop the give ammo cheats. + +.entity master; // Like owner, without the C code bondage. + // HEAVILY USED by monster summoning code! + // Update: Used by all missiles for reflection. + +// FIXME: Can we find another field that can be used as this? +.float encore; // TRUE = followup attack in a series. + +// FIXME: tamed is unused. +//.entity tamed; // Link to monster stored in capture weapon. +.entity mist; // Link to monster capturing entity. +.entity chain2; +.entity mirv1; // Link to most recently launched MIRV. +.entity hook; // Link to most recently launched grappling hook. +// FIXME: Do I need this? +//.entity rain1; // Link to rainstorm entity. + +// extra flags -------------------------------------------------------------- +//.float xfl, xf2; // Extra flags without C code connections. +//.float xsf; // Extra spawnflags used by func_spawn and sf64. + +// persistent attacks ------------------------------------------------------- +.entity burner; // Flame that is burning on the entity. +.vector burn_ofs; // Where flame burns relative to target origin. + // x = v_forward, y = v_right, z = v_up. + +// More powerups ----------------------------------------------------------- +.float thorns_finished, thorns_time, thorns_sound; // Empathy shields +.float wing_finished, wing_time, wing_sound; // Dark-Angel Wings * +.float mirror_finished, mirror_time, mirror_sound, mirror_ping; // Reflection +.float slow_finished, slow_time, slow_ping; // For those hit by ice arrow. +.float tome_finished, tome_time; // Tome of Power. + +.float fighting; // Checks if monster is really fighting while + // running. Monsters can run to follow friends. + +void SpawnMeatSprayDrake(vector org, vector vel, float btype); + +.float(float yaw, float dist) th_move; // 'walkmove' or equivalent. +.void(float dist) th_goal; // 'movetogoal' or equivalent. +.void() th_win; // Monsters: sound when killing a player. + // Missiles: code prior to origin shift. + // Items: additional code after spawning + +.float mindex2; // used for storing modelindex when phasing in/out +.float h2olevel; // 'waterlevel' without the C code baggage. +.float h2otype; // Ditto, except for 'watertype'. +.float level; // Used for monster_baron to set it as a boss of different types + +// cool.qc +.entity divine_attacker; // Who gets credit when lightning strikes. +.float divine_finished; // If non-zero, when an entity gets zapped. +.float divine_hits; // How many zaps an attacker is allowed. +.float movecount; + +// Ruby wand stats. Normal mode. +// Use 0.3 delay for Heretic wand speed, or 0.4 delay for Doom pistol speed. +float WAND_CHARGE = 0.4; // Delay between charges. +float WAND_DELAY = 0.35; // Reload time and delay between charges. +float WAND_FULL = 3; // Maximum shots. Super shot is max+1. +float WAND_DAMAGE = 16; // Damage per charge. +float WAND_RANGE = 600; + +float multi_headinjury; // If >=25, blow off his head! + +// Power armor damage absorption. +float DAMAGE_PER_CELL = 2; + +// Note: Until dragonscale armor was settled on, the dragon morph was +// triggered by an artifact weapon named "Eye/Mark of Bahamut". +// Thus, some names are legacy code written prior to morphing armors. +.float baha_ammo; // Renewable energy for dragon form. +.float baha_time; // Time it takes for ammo to recharge. +.float baha_click; // Helps check for double-clicking. + +float mindex_saw; // Player with chainsaw. +float mindex_hammer; +float mindex_hamout; + +float PUSH_ONCE = 1; +float PUSH_CURRENT = 2; // Zerstorer -- "Silent" PUSH for water currents. +float PUSH_JUMP_ONLY = 4; // Drake -- Push only when jump is pressed. + +.float jump_time; // Used by custom trigger_jump Q3 style jump pad \ No newline at end of file diff --git a/QC_other/QC_keep/defsextras.qc b/QC_other/QC_keep/defsextras.qc new file mode 100644 index 00000000..9d30fb26 --- /dev/null +++ b/QC_other/QC_keep/defsextras.qc @@ -0,0 +1,43 @@ +//Written by Frank Condello <pox@planetquake.com> +//Prototypes and globals for extra junk... + +// Globals ==================================================================== +// Footsteps +//.float spawnsilent; +//.vector old_velocity; + +// Swimming +//.float uwmuffle; // underwater muffle playing flag +//.float outwsound; // head out of water flag +//.float inwsound; // head back in water flag + +// No bleed triggers +//.float nobleed; + +// func_liquid & func_ladder +//.float fwatershift; +//.float fwatershifttime; +//.string cshift; +//.string fmover; +.float drag; +//.float zerogtime; + +// General use +.float speed2; +.float wait2; +//.string event, event2; +//.string noise5; +.string mdl2; +//.string message2, killtarget2; + +// Hipnotic Rotate +//.vector neworigin; +//.vector rotate; +//.float endtime; +//.float rotate_type; +//.string path; +//.string group; +//.float duration; + +float FORWARD = 0; +float REVERSE = 1; \ No newline at end of file diff --git a/QC_other/QC_keep/defshipnotic.qc b/QC_other/QC_keep/defshipnotic.qc new file mode 100644 index 00000000..434d1113 --- /dev/null +++ b/QC_other/QC_keep/defshipnotic.qc @@ -0,0 +1,42 @@ +//====================================================================== +// MOD : Hipnotic (Ritual Entertainment) +// Kept by the Keep Mod. You keep what you kill (and kill with). +//====================================================================== +float AS_DODGING = 9;// was 5 in hipnotic originally +float MIN_ANGLE_DELTA = 10.000; +float UNDERWATER = 2.000; +float CHARMED_RADIUS = 1500.000; +float MAX_CHARMER_DISTANCE = 200.000; +float MIN_CHARMER_DISTANCE = 150.000; +float TOOCLOSE_CHARMER_DISTANCE = 120.000; +float hipearthquake; +.float horn_active; +.entity charmer; +.float charmed; +.float huntingcharmer; +float quakeactive; +float tesla_numtargets; +//.entity horn_charmer; +entity tesla_target; +.vector old_velocity; +.entity lastvictim; +.entity next_ent; +.entity spawnmaster; +//.float ammo_cells1; +.float col; +.float empathy_finished; +//.float empathy_sound; +.float empathy_time; +.float gorging; +.float spawnsilent; +.float spawnmulti; +.float stoleweapon; +.float struck_by_mjolnir; +.float wetsuit_finished; +.float wetsuit_time; +float discharged; +float NumProximityGrenades; +float visible_distance; +float modelindex_hammer; + + diff --git a/QC_other/QC_keep/defskeep.qc b/QC_other/QC_keep/defskeep.qc new file mode 100644 index 00000000..6377d073 --- /dev/null +++ b/QC_other/QC_keep/defskeep.qc @@ -0,0 +1,204 @@ +//====================================================================== +// MOD : Keep. +// You keep what you kill (and kill with). +//====================================================================== +string MOD_VERSION = "\b[INFO]\b Keep Mod, version 0.50\n"; +.string target3, target4; +//=======================================SELF.ITEMS1====================================================== +float IT_SHOTGUN = 1.000; //Correct for standard HUD & HIP & DOE W +float IT_SUPER_SHOTGUN = 2.000; //Correct for standard HUD & HIP & DOE W +float IT_NAILGUN = 4.000; //Correct for standard HUD & HIP & DOE W +float IT_SUPER_NAILGUN = 8.000; //Correct for standard HUD & HIP & DOE W +float IT_GRENADE_LAUNCHER = 16.000; //Correct for standard HUD & HIP & DOE W +float IT_ROCKET_LAUNCHER = 32.000; //Correct for standard HUD & HIP & DOE W +float IT_LIGHTNING = 64.000; //Correct for standard HUD & HIP & DOE W +float IT_SHELLS = 128.000; //Correct for DOE HUD I +float IT_NAILS = 256.000; //Correct for DOE HUD I +float IT_ROCKETS = 512.000; //Correct for DOE HUD I +float IT_CELLS = 1024.000; //Correct for DOE HUD I +float IT_AXE = 2048.000; //Correct for DOE HUD W +float IT_LAVA_NAILGUN = 4096.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_LAVA_SUPER_NAILGUN = 8192.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_MULTI_GRENADE = 16384.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_MULTI_ROCKET = 32768.000; //Correct for DOE HUD (okay for standard and HIP) W +float IT_PLASMA_GUN = 65536.000; //Correct for DOE HUD W +float IT_KEY1 = 131072.000; //Correct for standard HUD & HIP & DOE I +float IT_KEY2 = 262144.000; //Correct for standard HUD & HIP & DOE I +float IT_INVISIBILITY = 524288.000; //Correct for standard HUD & HIP & DOE I +float IT_INVULNERABILITY = 1048576.000; //Correct for standard HUD & HIP & DOE I +float IT_SUIT = 2097152.000; //Correct for standard HUD & HIP & DOE I +float IT_QUAD = 4194304.000; //Correct for standard HUD & HIP & DOE I +float IT_EXTRA_WEAPON = 8388608.000; //Correct for DOE HUD W +//=======================================SELF.ITEMS2====================================================== +float IT2_ARMOR1 = 1.000; //Correct for DOE HUD I +float IT2_ARMOR2 = 2.000; //Correct for DOE HUD I +float IT2_ARMOR3 = 4.000; //Correct for DOE HUD I +float IT2_LAVA_NAILS = 8.000; //Correct for DOE HUD I +float IT2_PLASMA_AMMO = 16.000; //Correct for DOE HUD I +float IT2_MULTI_ROCKETS = 32.000; //Correct for DOE HUD I +float IT2_SHIELD = 64.000; //Correct for DOE HUD I +float IT2_CHAINLIGHTNING = 128.000; //Zerstorer chain lightning W (I Antigrav for DOE HUD) +float IT2_SUPERHEALTH = 256.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_EARTHQUAKE = 512.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_V_SPHERE = 1024.000; //Correct for DOE HUD I(available for a new weapon) +float IT2_BOLTS = 2048.000; //Keep specific I +float IT2_POISON = 4096.000; //Keep specific I +float HIP_IT2_WETSUIT = 8192.000; //Keep specific (modified from HIP) I +float HIP_IT2_EMPATHY_SHIELDS = 16384.000; //Keep specific (modified from HIP) I +float HIP_IT2_HORN_OF_CONJURING = 32768.000; //Keep specific (modified from HIP) I + //= 65536.000; EMPTY SLOT (skipped...same as IT_PLASMA_GUN) I +float IT2_PROXIMITY_GUN = 131072.000; //Keep specific.Unique number for self.weapon calls W +float IT2_MJOLNIR = 262144.000; //Keep specific "" W +float IT2_LASER_CANNON = 524288.000; //Keep specific "" W +float IT2_GRAPPLE = 1048576.000; //Keep specific "" W Rogue grapple +float IT2_TRINITY = 2097152.000; //Quoth +float IT2_CROSS = 4194304.000; //Quoth I && W2 (used by Wand) +float IT2_WAND = 8388608.000; //Drake magic wand W2 (special check to prevent IT_EXTRA_WEAPON conflict + + +// More powerups ----------------------------------------------------------- +// Bits 00-07 (values 1-128) are reserved for health. +// Bits 08-11 (values 256-2048) are reserved for armor. +float POW_ARMOR1 = 256; // Divide this into perms for suit value. +float POW_POWER_ARMOR = 4096; // Power shield toggle. +// Note: Do NOT use the next three for exotic armor! +// That is because item flags use those values for basic armor, +//float POW_RESIST = 8192; // Half damage. +//float POW_REGEN = 16384; // Regeneration. +//- - - - - - - - - +float POW_DOUBLE = 65536; // Twin shot -- nailgun buff. +float POW_SHOTTYMAN = 131072; // Shotgun buff. +float POW_VAMPIRE = 262144; // Melee buff. +float POW_PACK = 524288; // Extra ammo capacity. +float IT_BLASTER = 1048576; // Drake laser blaster W stored in self.perms. was POW_20 in Drake, unused +float IT_CHAINSAW = 2097152; // Drake chainsaw W stored in self.pems. was POW_21 in Drake, unused. Chainsaw is modified version of Zerstorer +float POW_HINT_ARMOR = 4194304; // Armor instructions. +float POW_HINT_FALL = 8388608; // nsoe4: slow falling message. + +float POWx_HEALTH = 255; // Extra max health. First 8 bits. +float POWx_ARMOR = 3840; // Mutually exclustive exotic armor. + + +//======================================================================================================== +float BBOX_ARMAGON = 23; // -48 -48 -24, 48 48 84 +float BBOX_VERMIS = 24; // -64 -64 -512, 64 64 256 +float ARMOR_BLUE = 2; // Display a blue armour +float AMMO_MAXLAVANAILS = 200; +float AMMO_MAXMULTIROCKETS = 100; +float AMMO_MAXPLASMA = 100; +float AMMO_MAXPOISON = 50; +float AMMO_MAXBOLTS = 100; +float AMMO_POISON_LGR = 10; +float AMMO_POISON_SML = 5; +float AMMO_BOLTS_LGR = 16; +float AMMO_BOLTS_SML = 8; +float GREMLIN_AMMO_TAKE = 30; +float OGRE_MULTI = 2; +string MODEL_GWEAP_LNG = "progs/g_lava.mdl"; +string MODEL_GWEAP_LSNG = "progs/g_lava2.mdl"; +string MODEL_GWEAP_PROX = "progs/hipnotic/g_prox.mdl"; +string MODEL_GWEAP_LASER = "progs/hipnotic/g_laserg.mdl"; +string MODEL_GWEAP_MJOL = "progs/hipnotic/g_hammer.mdl"; +string MODEL_GWEAP_WAND= "progs/drake/g_wand.mdl"; +string MODEL_VWEAP_LAVANG = "progs/v_lava.mdl"; // Lava nailgun +string MODEL_VWEAP_LAVASNG = "progs/v_lava2.mdl"; // Lava Super Nailgun +string MODEL_VWEAP_MULTG = "progs/v_multi.mdl"; // Multi-Grenade Launcher +string MODEL_VWEAP_MULTR = "progs/v_multi2.mdl"; // Multi-Rocket Launcher +string MODEL_VWEAP_PLASM = "progs/v_plasma2.mdl"; // Plasma Gun +string MODEL_VWEAP_PROX = "progs/hipnotic/v_prox.mdl"; // Proximity Gun +string MODEL_VWEAP_MJOL = "progs/hipnotic/v_hammer.mdl"; // Mjolnir +string MODEL_VWEAP_LCAN = "progs/hipnotic/v_laserg.mdl"; // Laser Cannon +string MODEL_PROJ_GRENADEMULTI = "progs/rogue/mervup.mdl"; // Multi-Grenade for Monsters +string SOUND_ARTPSHIELD1 = "shield/pickup.wav"; // Pickup +string SOUND_ARTPSHIELD2 = "shield/hit.wav"; // Active +string SOUND_ARTPSHIELD3 = "shield/fadeout.wav"; // Fading +string SOUND_ARTCROSS2 = "items2/crosuse.wav"; // Active +string SOUND_ARTEMPATH2 = "hipitems/empathy2.wav"; // Active + +//.float oldgravity; +.float versustype; +.float therm_finished; +.float therm_time; +.float ammo_bolts; +.float ammo_poison; +.float devdata; +.entity deventity; +.float enemyhealth; + +float DEV_AMMO_N_HEALTH = 1; + +// Versus gamemode +float COOP_VERSUS = 3; +float VT_SURVIVOR = 2; +float VT_GAMEMASTER = 4; + +float GLOBALSTATE_1 = 1.000; +float GLOBALSTATE_2 = 2.000; +float GLOBALSTATE_3 = 4.000; +float GLOBALSTATE_4 = 8.000; +float GLOBALSTATE_5 = 16.000; +float GLOBALSTATE_6 = 32.000; +float GLOBALSTATE_7 = 64.000; +float GLOBALSTATE_8 = 128.000; +float GLOBALSTATE_9 = 256.000; +float GLOBALSTATE_10 = 512.000; +float GLOBALSTATE_11 = 1024.000; +float GLOBALSTATE_12 = 2048.000; +float GLOBALSTATE_13 = 4096.000; +float GLOBALSTATE_14 = 8192.000; +float GLOBALSTATE_15 = 16384.000; +float GLOBALSTATE_16 = 32768.000; +float GLOBALSTATE_17 = 65536.000; +float GLOBALSTATE_18 = 131072.000; +float GLOBALSTATE_19 = 262144.000; +float GLOBALSTATE_20 = 524288.000; +float GLOBALSTATE_21 = 1048576.000; +float GLOBALSTATE_22 = 2097152.000; +float GLOBALSTATE_23 = 4194304.000; +float GLOBALSTATE_24 = 8388608.000; +float globalstate; +.float stateflags; +.string statetarget1; +.string statetarget2; +.string statetarget3; +.string statetarget4; +.string statetarget5; +.string statetarget6; +.string statetarget7; +.string statetarget8; +.string statetarget9; +.string statetarget10; +.string statetarget11; +.string statetarget12; +.string statetarget13; +.string statetarget14; +.string statetarget15; +.string statetarget16; +.string statetarget17; +.string statetarget18; +.string statetarget19; +.string statetarget20; +.string statetarget21; +.string statetarget22; +.string statetarget23; +.string statetarget24; + +float numsurvivor; +float numgamemaster; +//float versus_setup_istrue; +.float spritestarted; +.float useold_axe; +.float take_perms; +.float nailcosthalf; // bool for checking if it is time to subtract a nail from ammo +float coins; // Currency for survival player(s) +float bones; // Currency for gamemaster player(s) +string g_axemodel; +string v_axemodel; + +.vector dest; // Could not find this in the source, added +//.vector lastpos; + +entity annie; // anaconda entity + +.entity gravtrigent; //the trigger_setgravity we are in +.float gravtrig; //bit to say whether or not we are in a gravity trigger \ No newline at end of file diff --git a/QC_other/QC_keep/defskinn.qc b/QC_other/QC_keep/defskinn.qc new file mode 100644 index 00000000..0992bc57 --- /dev/null +++ b/QC_other/QC_keep/defskinn.qc @@ -0,0 +1,13 @@ +//====================================================================== +// MOD : Kinn +// Kept by the Keep Mod. You keep what you kill (and kill with). +//====================================================================== +float FL_NOSELECT = 8192; //ignored by entity selector +float MONSTER_FLAK_OGRE = 4; +.float spikecount; + +// new stuff needed for q2 weapons +.float idleweaponframe; // this is set to be the stationary idle weapon frame used when the player is not firing + // it is different for each weapon and must therefore be set on each weapon change +.float monsterflags; +float MF_COMMANDER = 1; // beefier version \ No newline at end of file diff --git a/QC_other/QC_keep/defsnehahra.qc b/QC_other/QC_keep/defsnehahra.qc new file mode 100644 index 00000000..12214757 --- /dev/null +++ b/QC_other/QC_keep/defsnehahra.qc @@ -0,0 +1,2 @@ +.float method; // Used by some misc entities for picking a type/method, e.g. info_particles +.vector aether; // Helper vector on some entities, e.g. info_particles \ No newline at end of file diff --git a/QC_other/QC_keep/defsquoth.qc b/QC_other/QC_keep/defsquoth.qc new file mode 100644 index 00000000..636ecf3b --- /dev/null +++ b/QC_other/QC_keep/defsquoth.qc @@ -0,0 +1,36 @@ +//====================================================================== +// MOD : Quoth 2.1 +// Kept by the Keep Mod. You keep what you kill (and kill with). +//====================================================================== +.void() th_novis; +vector VEC_HULL_MIN = '-16 -16 -24'; +vector VEC_HULL_MAX = '16 16 32'; +.vector oldenemyorigin; +.vector spawnmaxs; +.entity eye; +.float activated_time; +.float awake; +.float carry_time; +.float coiled; +.float cross_finished; +.float cross_sound; +.float cross_start; +.float cross_time; +.float dangle; +.float dlord_firecnt; +.float dlord_searchtime; +.float dlord_playervis; +.float drole_searchtime; +.float drop; +.float gotbomb; +.float gug_slapped; +.float inv; +.float multiplier; +.float polyp_speed; +.float shield; +.float startonground; +.float statevis; +.float trinity_finished; +.float trinity_start; +.float trinity_time; +.float vermis_grabbed; \ No newline at end of file diff --git a/QC_other/QC_keep/defsrogue.qc b/QC_other/QC_keep/defsrogue.qc new file mode 100644 index 00000000..105f81b2 --- /dev/null +++ b/QC_other/QC_keep/defsrogue.qc @@ -0,0 +1,38 @@ +//====================================================================== +// MOD : Rogue +// Kept by the Keep Mod. You keep what you kill (and kill with). +//====================================================================== +float earthquake_active; +float earthquake_intensity; +float elv_button_dir; +.vector dragonLastVelocity; +.vector elevatorDestination; +.float ammo_lava_nails; +.float ammo_multi_rockets; +.float ammo_plasma; +.float antigrav_finished; +.float antigrav_time; +.float AGping; +.float childrenSpawned; +.float dragonAttacking; +.float dragonDeathState; +.float dragonInRoom; +.float dragonInTransit; +.float dragonPainSequence; +.float elevatorOnFloor; +.float elevatorLastUse; +.float elevatorToFloor; +.float items2; +.float plat2Called; +.float plat2GoTo; +.float plat2GoTime; +.float plat2LastMove; +.float playerInRoom; +.float playerInTransit; +.float shield_finished; +.float shield_time; +.float shieldSoundTime; +.float lavaGunFired; +.float hook_out; + + diff --git a/QC_other/QC_keep/defsrubicon.qc b/QC_other/QC_keep/defsrubicon.qc new file mode 100644 index 00000000..0f113b99 --- /dev/null +++ b/QC_other/QC_keep/defsrubicon.qc @@ -0,0 +1,9 @@ +//====================================================================== +// MOD : Rubicon +// You keep what you kill (and kill with). +//====================================================================== +float SPARKS_BLUE = 2; + +float SPARKS_PALE = 4; + +.vector movedir2; \ No newline at end of file diff --git a/QC_other/QC_keep/dpextensions.qc b/QC_other/QC_keep/dpextensions.qc new file mode 100644 index 00000000..859b58d0 --- /dev/null +++ b/QC_other/QC_keep/dpextensions.qc @@ -0,0 +1,2450 @@ +//DarkPlaces supported extension list, draft version 1.04 +//things that don't have extensions yet: +.float disableclientprediction; + +//definitions that id Software left out: +//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed) +float MOVE_NORMAL = 0; // same as FALSE +float MOVE_NOMONSTERS = 1; // same as TRUE +float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE + +//checkextension function +//idea: expected by almost everyone +//darkplaces implementation: LordHavoc +float(string s) checkextension = #99; +//description: +//check if (cvar("pr_checkextension")) before calling this, this is the only +//guaranteed extension to be present in the extension system, it allows you +//to check if an extension is available, by name, to check for an extension +//use code like this: +//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere) +//if (cvar("pr_checkextension")) +//if (checkextension("DP_SV_SETCOLOR")) +// ext_setcolor = TRUE; +//from then on you can check ext_setcolor to know if that extension is available + +//BX_WAL_SUPPORT +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//indicates the engine supports .wal textures for filenames in the textures/ directory +//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly) + +//DP_BUTTONCHAT +//idea: Vermeulen +//darkplaces implementation: LordHavoc +//field definitions: +.float buttonchat; +//description: +//true if the player is currently chatting (in messagemode, menus or console) + +//DP_BUTTONUSE +//idea: id Software +//darkplaces implementation: LordHavoc +//field definitions: +.float buttonuse; +//client console commands: +//+use +//-use +//description: +//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes). + +//DP_CL_LOADSKY +//idea: Nehahra, LordHavoc +//darkplaces implementation: LordHavoc +//client console commands: +//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming) +//description: +//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX). + +//DP_CON_SET +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars. + +//DP_CON_SETA +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars. + +//DP_CON_ALIASPARAMETERS +//idea: many +//darkplaces implementation: Black +//description: +//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward). + +//DP_CON_EXPANDCVAR +//idea: many, PHP +//darkplaces implementation: Black +//description: +//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar. + +//DP_CON_STARTMAP +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start". + +//DP_EF_ADDITIVE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_ADDITIVE = 32; +//description: +//additive blending when this object is rendered + +//DP_EF_BLUE +//idea: id Software +//darkplaces implementation: LordHavoc +//effects bit: +float EF_BLUE = 64; +//description: +//entity emits blue light (used for quad) + +//DP_EF_DOUBLESIDED +//idea: LordHavoc +//darkplaces implementation: [515] and LordHavoc +//effects bit: +float EF_DOUBLESIDED = 32768; +//description: +//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff. + +//DP_EF_FLAME +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_FLAME = 1024; +//description: +//entity is on fire + +//DP_EF_FULLBRIGHT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_FULLBRIGHT = 512; +//description: +//entity is always brightly lit + +//DP_EF_NODEPTHTEST +//idea: Supa +//darkplaces implementation: LordHavoc +//effects bit: +float EF_NODEPTHTEST = 8192; +//description: +//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost + +//DP_EF_NODRAW +//idea: id Software +//darkplaces implementation: LordHavoc +//effects bit: +float EF_NODRAW = 16; +//description: +//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things) + +//DP_EF_NOGUNBOB +//idea: Chris Page, Dresk +//darkplaces implementation: LordHAvoc +//effects bit: +float EF_NOGUNBOB = 256; +//description: +//this has different meanings depending on the entity it is used on: +//player entity - prevents gun bobbing on player.viewmodel +//viewmodelforclient entity - prevents gun bobbing on an entity attached to the player's view +//other entities - no effect +//uses: +//disabling gun bobbing on a diving mask or other model used as a .viewmodel. +//disabling gun bobbing on view-relative models meant to be part of the heads up display. (note: if fov is changed these entities may be off-screen, or too near the center of the screen, so use fov 90 in this case) + +//DP_EF_NOSHADOW +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_NOSHADOW = 4096; +//description: +//realtime lights will not cast shadows from this entity (but can still illuminate it) + +//DP_EF_RED +//idea: id Software +//darkplaces implementation: LordHavoc +//effects bit: +float EF_RED = 128; +//description: +//entity emits red light (used for invulnerability) + +//DP_EF_RESTARTANIM_BIT +//idea: id software +//darkplaces implementation: divVerent +//effects bit: +float EF_RESTARTANIM_BIT = 1048576; +//description: +//when toggled, the current animation is restarted. Useful for weapon animation. +//to toggle this bit in QC, you can do: +// self.effects += (EF_RESTARTANIM_BIT - 2 * (self.effects & EF_RESTARTANIM_BIT)); + +//DP_EF_STARDUST +//idea: MythWorks Inc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_STARDUST = 2048; +//description: +//entity emits bouncing sparkles in every direction + +//DP_EF_TELEPORT_BIT +//idea: id software +//darkplaces implementation: divVerent +//effects bit: +float EF_TELEPORT_BIT = 2097152; +//description: +//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting. +//to toggle this bit in QC, you can do: +// self.effects += (EF_TELEPORT_BIT - 2 * (self.effects & EF_TELEPORT_BIT)); + +//DP_ENT_ALPHA +//idea: Nehahra +//darkplaces implementation: LordHavoc +//fields: +//.float alpha; +//description: +//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal). + +//DP_ENT_COLORMOD +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definition: +.vector colormod; +//description: +//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal). + +//DP_ENT_CUSTOMCOLORMAP +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number. + +/* +//NOTE: no longer supported by darkplaces because all entities are delta compressed now +//DP_ENT_DELTACOMPRESS // no longer supported +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_DELTA = 8388608; +//description: +//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc). +*/ + +//DP_ENT_EXTERIORMODELTOCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//fields: +.entity exteriormodeltoclient; +//description: +//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown. Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person. + +//DP_ENT_GLOW +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float glow_color; +.float glow_size; +.float glow_trail; +//description: +//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light. + +//DP_ENT_GLOWMOD +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definition: +.vector glowmod; +//description: +//controls color of the entity's glow texture (fullbrights), '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, see colormod (same color restrictions apply). + +//DP_ENT_LOWPRECISION +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//effects bit: +float EF_LOWPRECISION = 4194304; +//description: +//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc). + +//DP_ENT_SCALE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float scale; +//description: +//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller. + +//DP_ENT_TRAILEFFECTNUM +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float traileffectnum; +//description: +//use a custom effectinfo.txt effect on this entity, assign it like this: +//self.traileffectnum = particleeffectnum("mycustomeffect"); +//this will do both the dlight and particle trail as described in the effect, basically equivalent to trailparticles() in CSQC but performed on a server entity. + +//DP_ENT_VIEWMODEL +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.entity viewmodelforclient; +//description: +//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)... the entity is not visible to any other client. + +//DP_GFX_EXTERNALTEXTURES +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//loads external textures found in various directories (tenebrae compatible)... +/* +in all examples .tga is merely the base texture, it can be any of these: +.tga (base texture) +_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha) +_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend) +_shirt.tga (same idea as pants, but for shirt color) +_diffuse.tga (this may be used instead of base texture for per pixel lighting) +_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale)) +_norm.tga (normalmap texture for per pixel lighting) +_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility) +_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility) + +due to glquake's incomplete Targa(r) loader, this section describes +required Targa(r) features support: +types: +type 1 (uncompressed 8bit paletted with 24bit/32bit palette) +type 2 (uncompressed 24bit/32bit true color, glquake supported this) +type 3 (uncompressed 8bit greyscale) +type 9 (RLE compressed 8bit paletted with 24bit/32bit palette) +type 10 (RLE compressed 24bit/32bit true color, glquake supported this) +type 11 (RLE compressed 8bit greyscale) +attribute bit 0x20 (Origin At Top Left, top to bottom, left to right) + +image formats guaranteed to be supported: tga, pcx, lmp +image formats that are optional: png, jpg + +mdl/spr/spr32 examples: +skins are named _A (A being a number) and skingroups are named like _A_B +these act as suffixes on the model name... +example names for skin _2_1 of model "progs/armor.mdl": +game/override/progs/armor.mdl_2_1.tga +game/textures/progs/armor.mdl_2_1.tga +game/progs/armor.mdl_2_1.tga +example names for skin _0 of the model "progs/armor.mdl": +game/override/progs/armor.mdl_0.tga +game/textures/progs/armor.mdl_0.tga +game/progs/armor.mdl_0.tga +note that there can be more skins files (of the _0 naming) than the mdl +contains, this is only useful to save space in the .mdl file if classic quake +compatibility is not a concern. + +bsp/md2/md3 examples: +example names for the texture "quake" of model "maps/start.bsp": +game/override/quake.tga +game/textures/quake.tga +game/quake.tga + +sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad +game/override/gfx/conchars.tga +game/textures/gfx/conchars.tga +game/gfx/conchars.tga +*/ + +//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES +//idea: Fuh? +//darkplaces implementation: LordHavoc +//description: +//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/. +//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed) +//example: +//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/ +//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/ +//as a more extreme example: +//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/ + +//DP_GFX_FOG +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//worldspawn fields: +//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3") +//description: +//global fog for the map, can not be changed by QC + +//DP_GFX_QUAKE3MODELTAGS +//idea: id Software +//darkplaces implementation: LordHavoc +//field definitions: +.entity tag_entity; // entity this is attached to (call setattachment to set this) +.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this) +//builtin definitions: +void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag) +//description: +//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior). +//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity) +//note 3: attaching to world turns off attachment +//note 4: the entity that this is attached to must be visible for this to work +//note 5: if an entity is attached to the player entity it will not be drawn in first person. + +//DP_GFX_SKINFILES +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as: +//progs/test.md3_0.skin +//progs/test.md3_1.skin +//... +// +//these files contain replace commands (replace meshname shadername), example: +//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement +//replace "teamstripes" "progs/test/redstripes.tga" +//replace "visor" "common/nodraw" // this makes the visor mesh invisible +////it is not possible to rename tags using this format +// +//Or the Quake3 syntax (100% compatible with Quake3's .skin files): +//helmet,progs/test/helmet1.tga // this is a mesh shader replacement +//teamstripes,progs/test/redstripes.tga +//visor,common/nodraw // this makes the visor mesh invisible +//tag_camera, // this defines that the first tag in the model is called tag_camera +//tag_test, // this defines that the second tag in the model is called tag_test +// +//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible. +//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set). +//other commands might be added someday but it is not expected. + +//DP_GFX_SKYBOX +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//worldspawn fields: +//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2) +//description: +//global skybox for the map, can not be changed by QC + +//DP_UTF8 +//idea: Blub\0, divVerent +//darkplaces implementation: Blub\0 +//cvar definitions: +// utf8_enable: enable utf8 encoding +//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., +//and count as 1 char for string functions like strlen, substring, etc. +// note: utf8_enable is run-time cvar, could be changed during execution +// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled + +//DP_HALFLIFE_MAP +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30). + +//DP_HALFLIFE_MAP_CVAR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//cvars: +//halflifebsp 0/1 +//description: +//engine sets this cvar when loading a map to indicate if it is halflife format or not. + +//DP_HALFLIFE_SPRITE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//simply indicates that the engine supports HalfLife sprites. + +//DP_INPUTBUTTONS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float button3; +.float button4; +.float button5; +.float button6; +.float button7; +.float button8; +.float button9; +.float button10; +.float button11; +.float button12; +.float button13; +.float button14; +.float button15; +.float button16; +//description: +//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used). +//the exact mapping of protocol button bits on the server is: +//self.button0 = (bits & 1) != 0; +///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */ +//self.button2 = (bits & 2) != 0; +//self.button3 = (bits & 4) != 0; +//self.button4 = (bits & 8) != 0; +//self.button5 = (bits & 16) != 0; +//self.button6 = (bits & 32) != 0; +//self.button7 = (bits & 64) != 0; +//self.button8 = (bits & 128) != 0; + +// DP_LIGHTSTYLE_STATICVALUE +// idea: VorteX +// darkplaces implementation: VorteX +// description: allows alternative 'static' lightstyle syntax : "=value" +// examples: "=0.5", "=2.0", "=2.75" +// could be used to control switchable lights or making styled lights with brightness > 2 +// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact +// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax + +//DP_LITSPRITES +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit). + +//DP_LITSUPPORT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting. +//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course... see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information. + +//DP_MONSTERWALK +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player. + +//DP_MOVETYPEBOUNCEMISSILE +//idea: id Software +//darkplaces implementation: id Software +//movetype definitions: +//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc +//description: +//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts. + +//DP_MOVETYPEFLYWORLDONLY +//idea: Samual +//darkplaces implementation: Samual +//movetype definitions: +float MOVETYPE_FLY_WORLDONLY = 33; +//description: +//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER. + +//DP_NULL_MODEL +//idea: Chris +//darkplaces implementation: divVerent +//definitions: +//string dp_null_model = "null"; +//description: +//setmodel(e, "null"); makes an entity invisible, have a zero bbox, but +//networked. useful for shared CSQC entities. + +//DP_MOVETYPEFOLLOW +//idea: id Software, LordHavoc (redesigned) +//darkplaces implementation: LordHavoc +//movetype definitions: +float MOVETYPE_FOLLOW = 12; +//description: +//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways: +//aiment - the entity this is attached to. +//punchangle - the original angles when the follow began. +//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle). +//v_angle - the relative angles. +//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates: +//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow +//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid +//hole.aiment = bmodel; // make the hole follow bmodel +//hole.punchangle = bmodel.angles; // the original angles of bmodel +//hole.view_ofs = hole.origin - bmodel.origin; // relative origin +//hole.v_angle = hole.angles - bmodel.angles; // relative angles + +//DP_QC_ASINACOSATANATAN2TAN +//idea: Urre +//darkplaces implementation: LordHavoc +//constant definitions: +float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144; +float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612; +float PI = 3.1415926535897932384626433832795028841971693993751058209749445923; +//builtin definitions: +float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5 +float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI +float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5 +float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees) +float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity +//description: +//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed). +//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v) + +//DP_QC_AUTOCVARS +//idea: divVerent +//darkplaces implementation: divVerent +//description: +//allows QC variables to be bound to cvars +//(works for float, string, vector types) +//example: +// float autocvar_developer; +// float autocvar_registered; +// string autocvar__cl_name; +//NOTE: copying a string-typed autocvar to another variable/field, and then +//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar +//globals is UNDEFINED. Accessing autocvar globals after cvar_set()ing that +//cvar in the same frame is IMPLEMENTATION DEFINED (an implementation may +//either yield the previous, or the current, value). Whether autocvar globals, +//after restoring a savegame, have the cvar's current value, or the original +//value at time of saving, is UNDEFINED. Restoring a savegame however must not +//restore the cvar values themselves. +//In case the cvar does NOT exist, then it is automatically created with the +//value of the autocvar initializer, if given. This is possible with e.g. +//frikqcc and fteqcc the following way: +// var float autocvar_whatever = 42; +//If no initializer is given, the cvar will be initialized to a string +//equivalent to the NULL value of the given data type, that is, the empty +//string, 0, or '0 0 0'. However, when automatic cvar creation took place, a +//warning is printed to the game console. +//NOTE: to prevent an ambiguity with float names for vector types, autocvar +//names MUST NOT end with _x, _y or _z! + +//DP_QC_CHANGEPITCH +//idea: id Software +//darkplaces implementation: id Software +//field definitions: +.float idealpitch; +.float pitch_speed; +//builtin definitions: +void(entity ent) changepitch = #63; +//description: +//equivalent to changeyaw, ent is normally self. (this was a Q2 builtin) + +//DP_QC_COPYENTITY +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(entity from, entity to) copyentity = #400; +//description: +//copies all data in the entity to another entity. + +//DP_QC_CVAR_DEFSTRING +//idea: id Software (Doom3), LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +string(string s) cvar_defstring = #482; +//description: +//returns the default value of a cvar, as a tempstring. + +//DP_QC_CVAR_DESCRIPTION +//idea: divVerent +//DarkPlaces implementation: divVerent +//builtin definitions: +string(string name) cvar_description = #518; +//description: +//returns the description of a cvar + +//DP_QC_CVAR_STRING +//idea: VorteX +//DarkPlaces implementation: VorteX, LordHavoc +//builtin definitions: +string(string s) cvar_string = #448; +//description: +//returns the value of a cvar, as a tempstring. + +//DP_QC_CVAR_TYPE +//idea: divVerent +//DarkPlaces implementation: divVerent +//builtin definitions: +float(string name) cvar_type = #495; +float CVAR_TYPEFLAG_EXISTS = 1; +float CVAR_TYPEFLAG_SAVED = 2; +float CVAR_TYPEFLAG_PRIVATE = 4; +float CVAR_TYPEFLAG_ENGINE = 8; +float CVAR_TYPEFLAG_HASDESCRIPTION = 16; +float CVAR_TYPEFLAG_READONLY = 32; + +//DP_QC_EDICT_NUM +//idea: 515 +//DarkPlaces implementation: LordHavoc +//builtin definitions: +entity(float entnum) edict_num = #459; +float(entity ent) wasfreed = #353; // same as in EXT_CSQC extension +//description: +//edict_num returns the entity corresponding to a given number, this works even for freed entities, but you should call wasfreed(ent) to see if is currently active. +//wasfreed returns whether an entity slot is currently free (entities that have never spawned are free, entities that have had remove called on them are also free). + +//DP_QC_ENTITYDATA +//idea: KrimZon +//darkplaces implementation: KrimZon +//builtin definitions: +float() numentityfields = #496; +string(float fieldnum) entityfieldname = #497; +float(float fieldnum) entityfieldtype = #498; +string(float fieldnum, entity ent) getentityfieldstring = #499; +float(float fieldnum, entity ent, string s) putentityfieldstring = #500; +//constants: +//Returned by entityfieldtype +float FIELD_STRING = 1; +float FIELD_FLOAT = 2; +float FIELD_VECTOR = 3; +float FIELD_ENTITY = 4; +float FIELD_FUNCTION = 6; +//description: +//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame. +//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers. +//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z. +//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever. +//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers. +//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned. +//putentityfieldstring puts the data returned by getentityfieldstring back into the entity. + +//DP_QC_ENTITYSTRING +void(string s) loadfromdata = #529; +void(string s) loadfromfile = #530; +void(string s) callfunction = #605; +void(float fh, entity e) writetofile = #606; +float(string s) isfunction = #607; +void(entity e, string s) parseentitydata = #608; + +//DP_QC_ETOS +//idea: id Software +//darkplaces implementation: id Software +//builtin definitions: +string(entity ent) etos = #65; +//description: +//prints "entity 1" or similar into a string. (this was a Q2 builtin) + +//DP_QC_EXTRESPONSEPACKET +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +string(void) getextresponse = #624; +//description: +//returns a string of the form "\"ipaddress:port\" data...", or the NULL string +//if no packet was found. Packets can be queued into the client/server by +//sending a packet starting with "\xFF\xFF\xFF\xFFextResponse " to the +//listening port. + +//DP_QC_FINDCHAIN +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(.string fld, string match) findchain = #402; +//description: +//similar to find() but returns a chain of entities like findradius. + +//DP_QC_FINDCHAIN_TOFIELD +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +entity(.string fld, float match, .entity tofield) findradius_tofield = #22; +entity(.string fld, string match, .entity tofield) findchain_tofield = #402; +entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450; +entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403; +//description: +//similar to findchain() etc, but stores the chain into .tofield instead of .chain +//actually, the .entity tofield is an optional field of the the existing findchain* functions + +//DP_QC_FINDCHAINFLAGS +//idea: Sajt +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(.float fld, float match) findchainflags = #450; +//description: +//similar to findflags() but returns a chain of entities like findradius. + +//DP_QC_FINDCHAINFLOAT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(.entity fld, entity match) findchainentity = #403; +entity(.float fld, float match) findchainfloat = #403; +//description: +//similar to findentity()/findfloat() but returns a chain of entities like findradius. + +//DP_QC_FINDFLAGS +//idea: Sajt +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(entity start, .float fld, float match) findflags = #449; +//description: +//finds an entity with the specified flag set in the field, similar to find() + +//DP_QC_FINDFLOAT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +entity(entity start, .entity fld, entity match) findentity = #98; +entity(entity start, .float fld, float match) findfloat = #98; +//description: +//finds an entity or float field value, similar to find(), but for entity and float fields. + +//DP_QC_FS_SEARCH +//idea: Black +//darkplaces implementation: Black +//builtin definitions: +float(string pattern, float caseinsensitive, float quiet) search_begin = #444; +void(float handle) search_end = #445; +float(float handle) search_getsize = #446; +string(float handle, float num) search_getfilename = #447; +//description: +//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload). +//search_end frees a search slot (also done at progs reload). +//search_getsize returns how many filenames were found. +//search_getfilename returns a filename from the search. + +//DP_QC_GETLIGHT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +vector(vector org) getlight = #92; +//description: +//returns the lighting at the requested location (in color), 0-255 range (can exceed 255). + +//DP_QC_GETSURFACE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(entity e, float s) getsurfacenumpoints = #434; +vector(entity e, float s, float n) getsurfacepoint = #435; +vector(entity e, float s) getsurfacenormal = #436; +string(entity e, float s) getsurfacetexture = #437; +float(entity e, vector p) getsurfacenearpoint = #438; +vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; +//description: +//functions to query surface information. + +//DP_QC_GETSURFACEPOINTATTRIBUTE +//idea: BlackHC +//darkplaces implementation: BlackHC +// constants +float SPA_POSITION = 0; +float SPA_S_AXIS = 1; +float SPA_T_AXIS = 2; +float SPA_R_AXIS = 3; // same as SPA_NORMAL +float SPA_TEXCOORDS0 = 4; +float SPA_LIGHTMAP0_TEXCOORDS = 5; +float SPA_LIGHTMAP0_COLOR = 6; +//builtin definitions: +vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; + +//description: +//function to query extended information about a point on a certain surface + +//DP_QC_GETSURFACETRIANGLE +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +float(entity e, float s) getsurfacenumtriangles = #628; +vector(entity e, float s, float n) getsurfacetriangle = #629; +//description: +//function to query triangles of a surface + +//DP_QC_GETTAGINFO +//idea: VorteX, LordHavoc +//DarkPlaces implementation: VorteX +//builtin definitions: +float(entity ent, string tagname) gettagindex = #451; +vector(entity ent, float tagindex) gettaginfo = #452; +//description: +//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index). +//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example. + +//DP_QC_GETTAGINFO_BONEPROPERTIES +//idea: daemon +//DarkPlaces implementation: divVerent +//global definitions: +float gettaginfo_parent; +string gettaginfo_name; +vector gettaginfo_offset; +vector gettaginfo_forward; +vector gettaginfo_right; +vector gettaginfo_up; +//description: +//when this extension is present, gettaginfo fills in some globals with info about the bone that had been queried +//gettaginfo_parent is set to the number of the parent bone, or 0 if it is a root bone +//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo +//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component. + +//DP_QC_GETTIME +//idea: tZork +//darkplaces implementation: tZork, divVerent +//constant definitions: +float GETTIME_FRAMESTART = 0; // time of start of frame +float GETTIME_REALTIME = 1; // current time (may be OS specific) +float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision +float GETTIME_UPTIME = 3; // time since start of the engine +//builtin definitions: +float(float tmr) gettime = #519; +//description: +//some timers to query... + +//DP_QC_GETTIME_CDTRACK +//idea: divVerent +//darkplaces implementation: divVerent +//constant definitions: +float GETTIME_CDTRACK = 4; +//description: +//returns the playing time of the current cdtrack when passed to gettime() +//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels + +//DP_QC_LOG +//darkplaces implementation: divVerent +//builtin definitions: +float log(float f) = #532; +//description: +//logarithm + +//DP_QC_MINMAXBOUND +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(float a, float b) min = #94; +float(float a, float b, float c) min3 = #94; +float(float a, float b, float c, float d) min4 = #94; +float(float a, float b, float c, float d, float e) min5 = #94; +float(float a, float b, float c, float d, float e, float f) min6 = #94; +float(float a, float b, float c, float d, float e, float f, float g) min7 = #94; +float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94; +float(float a, float b) max = #95; +float(float a, float b, float c) max3 = #95; +float(float a, float b, float c, float d) max4 = #95; +float(float a, float b, float c, float d, float e) max5 = #95; +float(float a, float b, float c, float d, float e, float f) max6 = #95; +float(float a, float b, float c, float d, float e, float f, float g) max7 = #95; +float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95; +float(float minimum, float val, float maximum) bound = #96; +//description: +//min returns the lowest of all the supplied numbers. +//max returns the highest of all the supplied numbers. +//bound clamps the value to the range and returns it. + +//DP_QC_MULTIPLETEMPSTRINGS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//this extension makes all builtins returning tempstrings (ftos for example) +//cycle through a pool of multiple tempstrings (at least 16), allowing +//multiple ftos results to be gathered before putting them to use, normal +//quake only had 1 tempstring, causing many headaches. +// +//Note that for longer term storage (or compatibility on engines having +//FRIK_FILE but not this extension) the FRIK_FILE extension's +//strzone/strunzone builtins provide similar functionality (slower though). +// +//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS + +//DP_QC_NUM_FOR_EDICT +//idea: Blub\0 +//darkplaces implementation: Blub\0 +//Function to get the number of an entity - a clean way. +float(entity num) num_for_edict = #512; + +//DP_QC_RANDOMVEC +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +vector() randomvec = #91; +//description: +//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1) + +//DP_QC_SINCOSSQRTPOW +//idea: id Software, LordHavoc +//darkplaces implementation: id Software, LordHavoc +//builtin definitions: +float(float val) sin = #60; +float(float val) cos = #61; +float(float val) sqrt = #62; +float(float a, float b) pow = #97; +//description: +//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively. + +//DP_QC_SPRINTF +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +string(string format, ...) sprintf = #627; +//description: +//you know sprintf :P +//supported stuff: +// % +// optional: <argpos>$ for the argument to format +// flags: #0- + +// optional: <width>, *, or *<argpos>$ for the field width +// optional: .<precision>, .*, or .*<argpos>$ for the precision +// length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int) +// conversions: +// d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int +// i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int +// ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int +// eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double +// s takes a string +// vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space +// For conversions s and c, the flag # makes precision and width interpreted +// as byte count, by default it is interpreted as character count in UTF-8 +// enabled engines. No other conversions can create wide characters, and # +// has another meaning in these. + +//DP_QC_STRFTIME +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +string(float uselocaltime, string format, ...) strftime = #478; +//description: +//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice: +//example: "%Y-%m-%d %H:%M:%S" (result looks like: 2007-02-08 01:03:15) +//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time) +//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function. +// +//practical uses: +//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(TRUE, "%H");hour = stof(s); +//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time. +//activating eastereggs in singleplayer games on certain dates. +// +//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries. +//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)". +//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!). +//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing. + +//DP_QC_STRINGCOLORFUNCTIONS +//idea: Dresk +//darkplaces implementation: Dresk +//builtin definitions: +float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes +string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided +//description: +//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes + +//DP_QC_STRING_CASE_FUNCTIONS +//idea: Dresk +//darkplaces implementation: LordHavoc / Dresk +//builtin definitions: +string(string s) strtolower = #480; // returns the passed in string in pure lowercase form +string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form +//description: +//provides simple string uppercase and lowercase functions + +//DP_QC_TOKENIZEBYSEPARATOR +//idea: Electro, SavageX, LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(string s, string separator1, ...) tokenizebyseparator = #479; +//description: +//this function returns tokens separated by any of the supplied separator strings, example: +//numnumbers = tokenizebyseparator("10.2.3.4", "."); +//returns 4 and the tokens are "10" "2" "3" "4" +//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000") + +//DP_QC_TOKENIZE_CONSOLE +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +float(string s) tokenize_console = #514; +float(float i) argv_start_index = #515; +float(float i) argv_end_index = #516; +//description: +//this function returns tokens separated just like the console does +//also, functions are provided to get the index of the first and last character of each token in the original string +//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token. + +//DP_QC_TRACEBOX +//idea: id Software +//darkplaces implementation: id Software +//builtin definitions: +void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90; +//description: +//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well). + +//DP_QC_TRACETOSS +//idea: id Software +//darkplaces implementation: id Software +//builtin definitions: +void(entity ent, entity ignore) tracetoss = #64; +//description: +//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity. + +//DP_QC_TRACE_MOVETYPE_HITMODEL +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constant definitions: +float MOVE_HITMODEL = 4; +//description: +//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex) + +//DP_QC_TRACE_MOVETYPE_WORLDONLY +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constant definitions: +float MOVE_WORLDONLY = 3; +//description: +//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions + +//DP_QC_UNLIMITEDTEMPSTRINGS +//idea: divVerent +//darkplaces implementation: LordHavoc +//description: +//this extension alters Quake behavior such that instead of reusing a single +//tempstring (or multiple) there are an unlimited number of tempstrings, which +//are removed only when a QC function invoked by the engine returns, +//eliminating almost all imaginable concerns with string handling in QuakeC. +// +//in short: +//you can now use and abuse tempstrings as much as you like, you still have to +//use strzone (FRIK_FILE) for permanent storage however. +// +// +// +//implementation notes for other engine coders: +//these tempstrings are expected to be stored in a contiguous buffer in memory +//which may be fixed size or controlled by a cvar, or automatically grown on +//demand (in the case of DarkPlaces). +// +//this concept is similar to quake's Zone system, however these are all freed +//when the QC interpreter returns. +// +//this is basically a poor man's garbage collection system for strings. + +//DP_QC_VECTOANGLES_WITH_ROLL +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +vector(vector forward, vector up) vectoangles2 = #51; // same number as vectoangles +//description: +//variant of vectoangles that takes an up vector to calculate roll angle (also uses this to calculate yaw correctly if the forward is straight up or straight down) +//note: just like normal vectoangles you need to negate the pitch of the returned angles if you want to feed them to makevectors or assign to self.v_angle + +//DP_QC_VECTORVECTORS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector dir) vectorvectors = #432; +//description: +//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles. + +//DP_QC_WHICHPACK +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +string(string filename) whichpack = #503; +//description: +//returns the name of the pak/pk3/whatever containing the given file, in the same path space as FRIK_FILE functions use (that is, possibly with a path name prefix) + +//DP_QC_URI_ESCAPE +//idea: divVerent +//darkplaces implementation: divVerent +//URI::Escape's functionality +string(string in) uri_escape = #510; +string(string in) uri_unescape = #511; + +//DP_QC_URI_GET +//idea: divVerent +//darkplaces implementation: divVerent +//loads text from an URL into a string +//returns 1 on success of initiation, 0 if there are too many concurrent +//connections already or if the URL is invalid +//the following callback will receive the data and MUST exist! +// void(float id, float status, string data) URI_Get_Callback; +//status is either +// negative for an internal error, +// 0 for success, or +// the HTTP response code on server error (e.g. 404) +//if 1 is returned by uri_get, the callback will be called in the future +float(string url, float id) uri_get = #513; + +//DP_QC_URI_POST +//idea: divVerent +//darkplaces implementation: divVerent +//loads text from an URL into a string after POSTing via HTTP +//works like uri_get, but uri_post sends data with Content-Type: content_type to the server +//and uri_post sends the string buffer buf, joined using the delimiter delim +float(string url, float id, string content_type, string data) uri_post = #513; +float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513; + +//DP_SKELETONOBJECTS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//this extension indicates that FTE_CSQC_SKELETONOBJECTS functionality is available in server QC (as well as CSQC). + +//DP_SV_SPAWNFUNC_PREFIX +//idea: divVerent +//darkplaces implementation: divVerent +//Make functions whose name start with spawnfunc_ take precedence as spawn function for loading entities. +//Useful if you have a field ammo_shells (required in any Quake mod) but want to support spawn functions called ammo_shells (like in Q3A). +//Optionally, you can declare a global "float require_spawnfunc_prefix;" which will require ANY spawn function to start with that prefix. + + +//DP_QUAKE2_MODEL +//idea: quake community +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports Quake2 .md2 files. + +//DP_QUAKE2_SPRITE +//idea: LordHavoc +//darkplaces implementation: Elric +//description: +//shows that the engine supports Quake2 .sp2 files. + +//DP_QUAKE3_MAP +//idea: quake community +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports Quake3 .bsp files. + +//DP_QUAKE3_MODEL +//idea: quake community +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports Quake3 .md3 files. + +//DP_REGISTERCVAR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +float(string name, string value) registercvar = #93; +//description: +//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits. +//NOTE: DP_CON_SET is much better. + +//DP_SND_DIRECTIONLESSATTNNONE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources). + +//DP_SND_FAKETRACKS +//idea: requested +//darkplaces implementation: Elric +//description: +//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound. +//Note: also plays .ogg with DP_SND_OGGVORBIS extension. + +//DP_SND_SOUND7_WIP1 +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8; +float SOUNDFLAG_RELIABLE = 1; +//description: +//plays a sound, with some more flags +//extensions to sound(): +//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto", +// i.e. support multiple sounds at once, but cannot be stopped/restarted +//- a speed parameter has been reserved for later addition of pitch shifting. +// it MUST be set to 0 for now, meaning "no pitch change" +//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send +// to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default); +// similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE +//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by +// snd_channel1volume, etc. (so, a channel shares the cvar with its respective +// auto-channel); however, the mod MUST define snd_channel8volume and upwards +// in default.cfg if they are to be used, as the engine does not create them +// to not litter the cvar list +//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and +// flags as extra 7th and 8th argument +//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP +//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support +// the finished extension once done + +//DP_SND_OGGVORBIS +//idea: Transfusion +//darkplaces implementation: Elric +//description: +//the engine supports loading Ogg Vorbis sound files. Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg). + +//DP_SND_STEREOWAV +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//the engine supports stereo WAV files. (useful with DP_SND_DIRECTIONLESSATTNNONE for music) + +//DP_SND_GETSOUNDTIME +//idea: VorteX +//darkplaces implementation: VorteX +//constant definitions: +float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error +float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.) +//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK) +//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs +//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities +//examples of use: +// - QC-driven looped sounds +// - QC events when sound playing is finished +// - toggleable ambientsounds +// - subtitles + +//DP_VIDEO_DPV +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//console commands: +// playvideo <videoname> - start playing video +// stopvideo - stops current video +//description: indicated that engine support playing videos in DPV format + +//DP_VIDEO_SUBTITLES +//idea: VorteX +//darkplaces implementation: VorteX +//cvars: +// cl_video_subtitles - toggles subtitles showing +// cl_video_subtitles_lines - how many lines to reserve for subtitles +// cl_video_subtitles_textsize - font size +//console commands: +// playvideo <videoname> <custom_subtitles_file> - start playing video +// stopvideo - stops current video +//description: indicates that engine support subtitles on videos +//subtitles stored in external text files, each video file has it's default subtitles file ( <videoname>.dpsubs ) +//example: for video/act1.dpv default subtitles file will be video/act1.dpsubs +//also video could be played with custom subtitles file by utilizing second parm of playvideo command +//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens: +// <start> <end> "string" +// start: subtitle start time in seconds +// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, +// if below 0 - show until next subtitles minus this number of seconds +// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed +//example of subtitle file: +// 3 0 "Vengeance! Vengeance for my eternity of suffering!" +// 9 0 "Whelp! As if you knew what eternity was!" +// 13 0 "Grovel before your true master." +// 17 0 "Never!" +// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..." + +//DP_SOLIDCORPSE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//solid definitions: +float SOLID_CORPSE = 5; +//description: +//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline. + +//DP_SPRITE32 +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//the engine supports .spr32 sprites. + +//DP_SV_BOTCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constants: +float CLIENTTYPE_DISCONNECTED = 0; +float CLIENTTYPE_REAL = 1; +float CLIENTTYPE_BOT = 2; +float CLIENTTYPE_NOTACLIENT = 3; +//builtin definitions: +entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available +float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants +//description: +//spawns a client with no network connection, to allow bots to use client slots with no hacks. +//How to use: +/* + // to spawn a bot + local entity oldself; + oldself = self; + self = spawnclient(); + if (!self) + { + bprint("Can not add bot, server full.\n"); + self = oldself; + return; + } + self.netname = "Yoyobot"; + self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants + ClientConnect(); + PutClientInServer(); + self = oldself; + + // to remove all bots + local entity head; + head = find(world, classname, "player"); + while (head) + { + if (clienttype(head) == CLIENTTYPE_BOT) + dropclient(head); + head = find(head, classname, "player"); + } + + // to identify if a client is a bot (for example in PlayerPreThink) + if (clienttype(self) == CLIENTTYPE_BOT) + botthink(); +*/ +//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT +//How it works: +//creates a new client, calls SetNewParms and stores the parms, and returns the client. +//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually +//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is). +//parms work the same on bot clients as they do on real clients, and do carry from level to level + +//DP_SV_BOUNCEFACTOR +//idea: divVerent +//darkplaces implementation: divVerent +//field definitions: +.float bouncefactor; // velocity multiplier after a bounce +.float bouncestop; // bounce stops if velocity to bounce plane is < bouncestop * gravity AFTER the bounce +//description: +//allows qc to customize MOVETYPE_BOUNCE a bit + +//DP_SV_CLIENTCAMERA +//idea: LordHavoc, others +//darkplaces implementation: Black +//field definitions: +.entity clientcamera; // override camera entity +//description: +//allows another entity to be the camera for a client, for example a remote camera, this is similar to sending svc_setview manually except that it also changes the network culling appropriately. + +//DP_SV_CLIENTCOLORS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float clientcolors; // colors of the client (format: pants + shirt * 16) +//description: +//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed + +//DP_SV_CLIENTNAME +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//description: +//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed + +//DP_SV_CUSTOMIZEENTITYFORCLIENT +//idea: LordHavoc +//darkplaces implementation: [515] and LordHavoc +//field definitions: +.float() customizeentityforclient; // self = this entity, other = client entity +//description: +//allows qc to modify an entity before it is sent to each client, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc +//tips on writing customize functions: +//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server. +//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent). +//example ideas for use of this extension: +//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;}; +//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;}; +//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;}; +//implementation notes: +//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis). + +//DP_SV_DISCARDABLEDEMO +//idea: parasti +//darkplaces implementation: parasti +//field definitions: +.float discardabledemo; +//description: +//when this field is set to a non-zero value on a player entity, a possibly recorded server-side demo for the player is discarded +//Note that this extension only works if: +// auto demos are enabled (the cvar sv_autodemo_perclient is set) +// discarding demos is enabled (the cvar sv_autodemo_perclient_discardable is set) + +//DP_SV_DRAWONLYTOCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.entity drawonlytoclient; +//description: +//the entity is only visible to the specified client. + +//DP_SV_DROPCLIENT +//idea: FrikaC +//darkplaces implementation: LordHavoc +//builtin definitions: +void(entity clent) dropclient = #453; +//description: +//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine + +//DP_SV_EFFECT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; +//SVC definitions: +//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate +//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate +//description: +//clientside playback of simple custom sprite effects (explosion sprites, etc). + +//DP_SV_ENTITYCONTENTSTRANSITION +//idea: Dresk +//darkplaces implementation: Dresk +//field definitions: +.void(float nOriginalContents, float nNewContents) contentstransition; +//description: +//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed. +//The first parameter provides the entities original contents, prior to the transition. The second parameter provides the new contents. +//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds. + +//DP_SV_MOVETYPESTEP_LANDEVENT +//idea: Dresk +//darkplaces implementation: Dresk +//field definitions: +.void(vector vImpactVelocity) movetypesteplandevent; +//description: +//This field function, when provided, is triggered on a MOVETYPE_STEP entity when it experiences "land event". +// The standard engine behavior for this event is to play the sv_sound_land CVar sound. +//The parameter provides the velocity of the entity at the time of the impact. The z value may therefore be used to calculate how "hard" the entity struck the surface. +//NOTE: If this field function is provided on a MOVETYPE_STEP entity, the standard sv_sound_land sound IS SUPPRESSED to allow for authors to create their own feedback. + +//DP_SV_POINTSOUND +//idea: Dresk +//darkplaces implementation: Dresk +//builtin definitions: +void(vector origin, string sample, float volume, float attenuation) pointsound = #483; +//description: +//Similar to the standard QC sound function, this function takes an origin instead of an entity and omits the channel parameter. +// This allows sounds to be played at arbitrary origins without spawning entities. + +//DP_SV_ONENTITYNOSPAWNFUNCTION +//idea: Dresk +//darkplaces implementation: Dresk +//engine-called QC prototypes: +//void() SV_OnEntityNoSpawnFunction; +//description: +// This function is called whenever an entity on the server has no spawn function, and therefore has no defined QC behavior. +// You may as such dictate the behavior as to what happens to the entity. +// To mimic the engine's default behavior, simply call remove(self). + +//DP_SV_ONENTITYPREPOSTSPAWNFUNCTION +//idea: divVerent +//darkplaces implementation: divVerent +//engine-called QC prototypes: +//void() SV_OnEntityPreSpawnFunction; +//void() SV_OnEntityPostSpawnFunction; +//description: +// These functions are called BEFORE or AFTER an entity is spawned the regular way. +// You may as such dictate the behavior as to what happens to the entity. +// SV_OnEntityPreSpawnFunction is called before even looking for the spawn function, so you can even change its classname in there. If it remove()s the entity, the spawn function will not be looked for. +// SV_OnEntityPostSpawnFunction is called ONLY after its spawn function or SV_OnEntityNoSpawnFunction was called, and skipped if the entity got removed by either. + +//DP_SV_MODELFLAGS_AS_EFFECTS +//idea: LordHavoc, Dresk +//darkplaces implementation: LordHavoc +//field definitions: +.float modelflags; +//constant definitions: +float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own +float MF_ROCKET = 1; // leave a trail +float MF_GRENADE = 2; // leave a trail +float MF_GIB = 4; // leave a trail +float MF_ROTATE = 8; // rotate (bonus items) +float MF_TRACER = 16; // green split trail +float MF_ZOMGIB = 32; // small blood trail +float MF_TRACER2 = 64; // orange split trail +float MF_TRACER3 = 128; // purple trail +//description: +//this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc. +//setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS. +// +//silly example modification #1 to W_FireRocket in weapons.qc: +//missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail +//silly example modification #2 to W_FireRocket in weapons.qc: +//missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail +// +//note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm. +// +//note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values. + +//DP_SV_NETADDRESS +//idea: Dresk +//darkplaces implementation: Dresk +//field definitions: +.string netaddress; +//description: +// provides the netaddress of the associated entity (ie. 127.0.0.1) and "null/botclient" if the netconnection of the entity is invalid + +//DP_SV_NODRAWTOCLIENT +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.entity nodrawtoclient; +//description: +//the entity is not visible to the specified client. + +//DP_SV_PING +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float ping; +//description: +//continuously updated field indicating client's ping (based on average of last 16 packet time differences). + +//DP_SV_PING_PACKETLOSS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float ping_packetloss; +.float ping_movementloss; +//description: +//continuously updated field indicating client's packet loss, and movement loss (i.e. packet loss affecting player movement). + +//DP_SV_POINTPARTICLES +//idea: Spike +//darkplaces implementation: LordHavoc +//function definitions: +float(string effectname) particleeffectnum = #335; // same as in CSQC +void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC +void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC +//SVC definitions: +//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end +//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count +//float svc_pointparticles1 = 62; // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1 +//description: +//provides the ability to spawn non-standard particle effects, typically these are defined in a particle effect information file such as effectinfo.txt in darkplaces. +//this is a port of particle effect features from clientside QC (EXT_CSQC) to server QC, as these effects are potentially useful to all games even if they do not make use of EXT_CSQC. +//warning: server must have same order of effects in effectinfo.txt as client does or the numbers would not match up, except for standard quake effects which are always the same numbers. + +//DP_SV_PUNCHVECTOR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.vector punchvector; +//description: +//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS). + +//DP_SV_PLAYERPHYSICS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.vector movement; +//cvar definitions: +//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics) +//engine-called QC prototypes: +//void() SV_PlayerPhysics; +//description: +//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit) + +//DP_PHYSICS_ODE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//globals: +//new movetypes: +const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builtins applied +//new solid types: +const float SOLID_PHYSICS_BOX = 32; +const float SOLID_PHYSICS_SPHERE = 33; +const float SOLID_PHYSICS_CAPSULE = 34; +const float SOLID_PHYSICS_TRIMESH = 35; +//SOLID_BSP; +//joint types: +const float JOINTTYPE_POINT = 1; +const float JOINTTYPE_HINGE = 2; +const float JOINTTYPE_SLIDER = 3; +const float JOINTTYPE_UNIVERSAL = 4; +const float JOINTTYPE_HINGE2 = 5; +const float JOINTTYPE_FIXED = -1; +// common joint properties: +// .entity aiment, enemy; // connected objects +// .vector movedir; +// for a spring: +// movedir_x = spring constant (force multiplier, must be > 0) +// movedir_y = spring dampening constant to prevent oscillation (must be > 0) +// movedir_z = spring stop position (+/-) +// for a motor: +// movedir_x = desired motor velocity +// movedir_y = -1 * max motor force to use +// movedir_z = stop position (+/-), set to 0 for no stop +// note that ODE does not support both in one anyway +//field definitions: +.float mass; // ODE mass, standart value is 1 +.float bouncefactor; +.float bouncestop; +.float jointtype; +//builtin definitions: +void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object +void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force +void(entity e, vector torque) physics_addtorque = #542; // add relative torque +//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option +//be sure to checkextension for it to know if library is loaded and ready, also to enable physics set "physics_ode" cvar to 1 +//note: this extension is highly experimental and may be unstable +//note: use SOLID_BSP on entities to get a trimesh collision models on them + +//DP_SV_PRINT +//idea: id Software (QuakeWorld Server) +//darkplaces implementation: Black, LordHavoc +void(string s, ...) print = #339; // same number as in EXT_CSQC +//description: +//this is identical to dprint except that it always prints regardless of the developer cvar. + +//DP_SV_PRECACHEANYTIME +//idea: id Software (Quake2) +//darkplaces implementation: LordHavoc +//description: +//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache). + +//DP_SV_QCSTATUS +//idea: divVerent +//darkplaces implementation: divVerent +//1. A global variable +string worldstatus; +//Its content is set as "qcstatus" field in the rules. +//It may be at most 255 characters, and must not contain newlines or backslashes. +//2. A per-client field +.string clientstatus; +//It is sent instead of the "frags" in status responses. +//It should always be set in a way so that stof(player.clientstatus) is a meaningful score value. Other info may be appended. If used this way, the cvar sv_status_use_qcstatus may be set to 1, and then this value will replace the frags in "status". +//Currently, qstat does not support this and will not show player info if used and set to anything other than ftos(some integer). + +//DP_SV_ROTATINGBMODEL +//idea: id Software +//darkplaces implementation: LordHavoc +//description: +//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however). +//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate) + +//DP_SV_SETCOLOR +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(entity ent, float colors) setcolor = #401; +//engine called QC functions (optional): +//void(float color) SV_ChangeTeam; +//description: +//setcolor sets the color on a client and updates internal color information accordingly (equivalent to stuffing a "color" command but immediate) +//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this. +//the color format is pants + shirt * 16 (0-255 potentially) + +//DP_SV_SLOWMO +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//cvars: +//"slowmo" (0+, default 1) +//description: +//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it. +//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed). + +//DP_SV_WRITEPICTURE +//idea: divVerent +//darkplaces implementation: divVerent +//builtin definitions: +void(float to, string s, float sz) WritePicture = #501; +//description: +//writes a picture to the data stream so CSQC can read it using ReadPicture, which has the definition +// string(void) ReadPicture = #501; +//The picture data is sent as at most sz bytes, by compressing to low quality +//JPEG. The data being sent will be equivalent to: +// WriteString(to, s); +// WriteShort(to, imagesize); +// for(i = 0; i < imagesize; ++i) +// WriteByte(to, [the i-th byte of the compressed JPEG image]); + +//DP_SV_WRITEUNTERMINATEDSTRING +//idea: FrikaC +//darkplaces implementation: Sajt +//builtin definitions: +void(float to, string s) WriteUnterminatedString = #456; +//description: +//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself. +//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivalent of it in his FrikBot mod years ago involving WriteByte calls on each character. + +//DP_TE_BLOOD +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector velocity, float howmany) te_blood = #405; +//temp entity definitions: +float TE_BLOOD = 50; +//protocol: +//vector origin +//byte xvelocity (-128 to +127) +//byte yvelocity (-128 to +127) +//byte zvelocity (-128 to +127) +//byte count (0 to 255, how much blood) +//description: +//creates a blood effect. + +//DP_TE_BLOODSHOWER +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; +//temp entity definitions: +//float TE_BLOODSHOWER = 52; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//coord explosionspeed (velocity of blood particles flying out of the center) +//short count (number of blood particles) +//description: +//creates an exploding shower of blood, for making gibbings more convincing. + +//DP_TE_CUSTOMFLASH +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, float radius, float lifetime, vector color) te_customflash = #417; +//temp entity definitions: +//float TE_CUSTOMFLASH = 73; +//protocol: +//vector origin +//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius) +//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime) +//byte red (0.0 to 1.0 converted to 0-255) +//byte green (0.0 to 1.0 converted to 0-255) +//byte blue (0.0 to 1.0 converted to 0-255) +//description: +//creates a customized light flash. + +//DP_TE_EXPLOSIONRGB +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector color) te_explosionrgb = #407; +//temp entity definitions: +//float TE_EXPLOSIONRGB = 53; +//protocol: +//vector origin +//byte red (0.0 to 1.0 converted to 0 to 255) +//byte green (0.0 to 1.0 converted to 0 to 255) +//byte blue (0.0 to 1.0 converted to 0 to 255) +//description: +//creates a colored explosion effect. + +//DP_TE_FLAMEJET +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector vel, float howmany) te_flamejet = #457; +//temp entity definitions: +//float TE_FLAMEJET = 74; +//protocol: +//vector origin +//vector velocity +//byte count (0 to 255, how many flame particles) +//description: +//creates a single puff of flame particles. (not very useful really) + +//DP_TE_PARTICLECUBE +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; +//temp entity definitions: +//float TE_PARTICLECUBE = 54; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//vector velocity +//short count +//byte color (palette color) +//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?) +//coord randomvel (how much to jitter the velocity) +//description: +//creates a cloud of particles, useful for forcefields but quite customizable. + +//DP_TE_PARTICLERAIN +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; +//temp entity definitions: +//float TE_PARTICLERAIN = 55; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//vector velocity (velocity of particles) +//short count (number of particles) +//byte color (8bit palette color) +//description: +//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube. + +//DP_TE_PARTICLESNOW +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; +//temp entity definitions: +//float TE_PARTICLERAIN = 56; +//protocol: +//vector mins (minimum corner of the cube) +//vector maxs (maximum corner of the cube) +//vector velocity (velocity of particles) +//short count (number of particles) +//byte color (8bit palette color) +//description: +//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow. + +//DP_TE_PLASMABURN +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_plasmaburn = #433; +//temp entity definitions: +//float TE_PLASMABURN = 75; +//protocol: +//vector origin +//description: +//creates a small light flash (radius 200, time 0.2) and marks the walls. + +//DP_TE_QUADEFFECTS1 +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_gunshotquad = #412; +void(vector org) te_spikequad = #413; +void(vector org) te_superspikequad = #414; +void(vector org) te_explosionquad = #415; +//temp entity definitions: +//float TE_GUNSHOTQUAD = 57; // [vector] origin +//float TE_SPIKEQUAD = 58; // [vector] origin +//float TE_SUPERSPIKEQUAD = 59; // [vector] origin +//float TE_EXPLOSIONQUAD = 70; // [vector] origin +//protocol: +//vector origin +//description: +//all of these just take a location, and are equivalent in function (but not appearance :) to the original TE_GUNSHOT, etc. + +//DP_TE_SMALLFLASH +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_smallflash = #416; +//temp entity definitions: +//float TE_SMALLFLASH = 72; +//protocol: +//vector origin +//description: +//creates a small light flash (radius 200, time 0.2). + +//DP_TE_SPARK +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org, vector vel, float howmany) te_spark = #411; +//temp entity definitions: +//float TE_SPARK = 51; +//protocol: +//vector origin +//byte xvelocity (-128 to 127) +//byte yvelocity (-128 to 127) +//byte zvelocity (-128 to 127) +//byte count (number of sparks) +//description: +//creates a shower of sparks and a smoke puff. + +//DP_TE_STANDARDEFFECTBUILTINS +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +void(vector org) te_gunshot = #418; +void(vector org) te_spike = #419; +void(vector org) te_superspike = #420; +void(vector org) te_explosion = #421; +void(vector org) te_tarexplosion = #422; +void(vector org) te_wizspike = #423; +void(vector org) te_knightspike = #424; +void(vector org) te_lavasplash = #425; +void(vector org) te_teleport = #426; +void(vector org, float color, float colorlength) te_explosion2 = #427; +void(entity own, vector start, vector end) te_lightning1 = #428; +void(entity own, vector start, vector end) te_lightning2 = #429; +void(entity own, vector start, vector end) te_lightning3 = #430; +void(entity own, vector start, vector end) te_beam = #431; +//description: +//to make life easier on mod coders. + +//DP_TRACE_HITCONTENTSMASK_SURFACEINFO +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//globals: +.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls +float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace +float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit) +float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface +string trace_dphittexturename; // texture name of impacted surface +//constants: +float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box +float DPCONTENTS_WATER = 2; +float DPCONTENTS_SLIME = 4; +float DPCONTENTS_LAVA = 8; +float DPCONTENTS_SKY = 16; +float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel +float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity +float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn +float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement +float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement +float DPCONTENTS_DONOTENTER = 1024; // AI hint brush +float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA +float DPCONTENTS_BOTCLIP = 2048; // AI hint brush +float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks) +float Q3SURFACEFLAG_NODAMAGE = 1; +float Q3SURFACEFLAG_SLICK = 2; // low friction surface +float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set) +float Q3SURFACEFLAG_LADDER = 8; // climbable surface +float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky) +float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky) +float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact +float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc) +float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds +float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds +float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc) +//description: +//adds additional information after a traceline/tracebox/tracetoss call. +//also (very important) sets trace_* globals before calling .touch functions, +//this allows them to inspect the nature of the collision (for example +//determining if a projectile hit sky), clears trace_* variables for the other +//object in a touch event (that is to say, a projectile moving will see the +//trace results in its .touch function, but the player it hit will see very +//little information in the trace_ variables as it was not moving at the time) + +//DP_VIEWZOOM +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//field definitions: +.float viewzoom; +//description: +//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such) + +//EXT_BITSHIFT +//idea: Spike +//darkplaces implementation: [515] +//builtin definitions: +float(float number, float quantity) bitshift = #218; +//description: +//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like). +//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you. + +//FRIK_FILE +//idea: FrikaC +//darkplaces implementation: LordHavoc +//builtin definitions: +float(string s) stof = #81; // get numerical value from a string +float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason +void(float fhandle) fclose = #111; // closes a file +string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring +void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file +float(string s) strlen = #114; // returns how many characters are in a string +string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring +string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version +vector(string s) stov = #117; // returns vector value from a string +string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often) +void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!) +//constants: +float FILE_READ = 0; +float FILE_APPEND = 1; +float FILE_WRITE = 2; +//cvars: +//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb) +//description: +//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space. +// +//NOTE: strzone functionality is partially superseded by +//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed +//NOTE: substring is upgraded by FTE_STRINGS extension with negative start/length handling identical to php 5.2.0 + +//FTE_CSQC_SKELETONOBJECTS +//idea: Spike, LordHavoc +//darkplaces implementation: LordHavoc +//builtin definitions: +// all skeleton numbers are 1-based (0 being no skeleton) +// all bone numbers are 1-based (0 being invalid) +float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model. +float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure +float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist +string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist +float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this) +float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity +vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone) +vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity) +void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone) +void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone) +void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones) +void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse +void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work) +float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found +float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0. +//fields: +.float skeletonindex; // active skeleton overriding standard animation on model +.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4) +.float frame2; // secondary framegroup animation (strength = lerpfrac) +.float frame3; // tertiary framegroup animation (strength = lerpfrac3) +.float frame4; // quaternary framegroup animation (strength = lerpfrac4) +.float lerpfrac; // strength of framegroup blend +.float lerpfrac3; // strength of framegroup blend +.float lerpfrac4; // strength of framegroup blend +.float frame1time; // start time of framegroup animation +.float frame2time; // start time of framegroup animation +.float frame3time; // start time of framegroup animation +.float frame4time; // start time of framegroup animation +//description: +//this extension provides a way to do complex skeletal animation on an entity. +// +//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client) +// +//notes: +//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render). +//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files). +//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton. +//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose. +// +//features include: +//multiple animations blended together. +//animating a model with animations from another model with a compatible skeleton. +//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head. +//custom bone controllers - for example making eyes track a target location. +// +// +// +//example code follows... +// +//this helper function lets you identify (by parentage) what group a bone +//belongs to - for example "torso", "leftarm", would return 1 ("torso") for +//all children of the bone named "torso", unless they are children of +//"leftarm" (which is a child of "torso") which would return 2 instead... +float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup = +{ + local string bonename; + while (bonenum >= 0) + { + bonename = skel_get_bonename(skel, bonenum); + if (bonename == g1) return 1; + if (bonename == g2) return 2; + if (bonename == g3) return 3; + if (bonename == g4) return 4; + if (bonename == g5) return 5; + if (bonename == g6) return 6; + bonenum = skel_get_boneparent(skel, bonenum); + } + return 0; +}; +// create a skeletonindex for our player using current modelindex +void() example_skel_player_setup = +{ + self.skeletonindex = skel_create(self.modelindex); +}; +// setup bones of skeleton based on an animation +// note: animmodelindex can be a different model than self.modelindex +void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin = +{ + // start with our standard animation + self.frame = framegroup; + self.frame2 = 0; + self.frame3 = 0; + self.frame4 = 0; + self.frame1time = framegroupstarttime; + self.frame2time = 0; + self.frame3time = 0; + self.frame4time = 0; + self.lerpfrac = 0; + self.lerpfrac3 = 0; + self.lerpfrac4 = 0; + skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000); +}; +// apply a different framegroup animation to bones with a specified parent +void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride = +{ + local float bonenum; + local float numbones; + self.frame = framegroup; + self.frame2 = 0; + self.frame3 = 0; + self.frame4 = 0; + self.frame1time = framegroupstarttime; + self.frame2time = 0; + self.frame3time = 0; + self.frame4time = 0; + self.lerpfrac = 0; + self.lerpfrac3 = 0; + self.lerpfrac4 = 0; + bonenum = 0; + numbones = skel_get_numbones(self.skeletonindex); + while (bonenum < numbones) + { + if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1) + skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1); + bonenum = bonenum + 1; + } +}; +// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling +void(vector eyetarget, string bonename) example_skel_player_update_eyetarget = +{ + local float bonenum; + local vector ang; + local vector oldforward, oldright, oldup; + local vector relforward, relright, relup, relorg; + local vector boneforward, boneright, boneup, boneorg; + local vector parentforward, parentright, parentup, parentorg; + local vector u, v; + local vector modeleyetarget; + bonenum = skel_find_bone(self.skeletonindex, bonename) - 1; + if (bonenum < 0) + return; + oldforward = v_forward; + oldright = v_right; + oldup = v_up; + v = eyetarget - self.origin; + modeleyetarget_x = v * v_forward; + modeleyetarget_y = 0-v * v_right; + modeleyetarget_z = v * v_up; + // this is an eyeball, make it point at the target location + // first get all the data we can... + relorg = skel_get_bonerel(self.skeletonindex, bonenum); + relforward = v_forward; + relright = v_right; + relup = v_up; + boneorg = skel_get_boneabs(self.skeletonindex, bonenum); + boneforward = v_forward; + boneright = v_right; + boneup = v_up; + parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum)); + parentforward = v_forward; + parentright = v_right; + parentup = v_up; + // get the vector from the eyeball to the target + u = modeleyetarget - boneorg; + // now transform it inversely by the parent matrix to produce new rel vectors + v_x = u * parentforward; + v_y = u * parentright; + v_z = u * parentup; + ang = vectoangles2(v, relup); + ang_x = 0 - ang_x; + makevectors(ang); + // set the relative bone matrix + skel_set_bone(self.skeletonindex, bonenum, relorg); + // restore caller's v_ vectors + v_forward = oldforward; + v_right = oldright; + v_up = oldup; +}; +// delete skeleton when we're done with it +// note: skeleton remains valid until next frame when it is really deleted +void() example_skel_player_delete = +{ + skel_delete(self.skeletonindex); + self.skeletonindex = 0; +}; +// +// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS +// + +//KRIMZON_SV_PARSECLIENTCOMMAND +//idea: KrimZon +//darkplaces implementation: KrimZon, LordHavoc +//engine-called QC prototypes: +//void(string s) SV_ParseClientCommand; +//builtin definitions: +void(entity e, string s) clientcommand = #440; +float(string s) tokenize = #441; +string(float n) argv = #442; +//description: +//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it + +//NEH_CMD_PLAY2 +//idea: Nehahra +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports the "play2" console command (plays a sound without spatialization). + +//NEH_RESTOREGAME +//idea: Nehahra +//darkplaces implementation: LordHavoc +//engine-called QC prototypes: +//void() RestoreGame; +//description: +//when a savegame is loaded, this function is called + +//NEXUIZ_PLAYERMODEL +//idea: Nexuiz +//darkplaces implementation: Black +//console commands: +//playermodel <name> - FIXME: EXAMPLE NEEDED +//playerskin <name> - FIXME: EXAMPLE NEEDED +//field definitions: +.string playermodel; // name of player model sent by client +.string playerskin; // name of player skin sent by client +//description: +//these client properties are used by Nexuiz. + +//NXQ_GFX_LETTERBOX +//idea: nxQuake +//darkplaces implementation: LordHavoc +//description: +//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view + +//PRYDON_CLIENTCURSOR +//idea: FrikaC +//darkplaces implementation: LordHavoc +//effects bit: +float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten) +//field definitions: +.float cursor_active; // true if cl_prydoncursor mode is on +.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused) +.vector cursor_trace_start; // position of camera +.vector cursor_trace_endpos; // position of cursor in world (as traced from camera) +.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt) +//cvar definitions: +//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented) +//description: +//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit. +//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen. +//the clientside trace skips transparent entities (except those marked EF_SELECTABLE). +//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2). +//intended to be used by Prydon Gate. + +//TENEBRAE_GFX_DLIGHTS +//idea: Tenebrae +//darkplaces implementation: LordHavoc +//fields: +.float light_lev; // radius (does not affect brightness), typical value 350 +.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast) +.float style; // light style (like normal light entities, flickering torches or switchable, etc) +.float pflags; // flags (see PFLAGS_ constants) +.vector angles; // orientation of the light +.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped +//constants: +float PFLAGS_NOSHADOW = 1; // light does not cast shadows +float PFLAGS_CORONA = 2; // light has a corona flare +float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!) +//description: +//more powerful dynamic light settings +//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them) +//changes compared to tenebrae (because they're too 'leet' for standards): +//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they) +//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW) + +//TW_SV_STEPCONTROL +//idea: Transfusion +//darkplaces implementation: LordHavoc +//cvars: +//sv_jumpstep (0/1, default 1) +//sv_stepheight (default 18) +//description: +//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be. + +//FTE_QC_CHECKPVS +//idea: Urre +//darkplaces implementation: divVerent +//builtin definitions: +float checkpvs(vector viewpos, entity viewee) = #240; +//description: +//returns true if viewee can be seen from viewpos according to PVS data + +//FTE_STRINGS +//idea: many +//darkplaces implementation: KrimZon +//builtin definitions: +float(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive +float(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character +string(float c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127. +string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum. +string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding +string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and " +string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found +float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character. +float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar +float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp +//string(string s, float start, float length) substring = #116; // see note below +//description: +//various string manipulation functions +//note: substring also exists in FRIK_FILE but this extension adds negative start and length as valid cases (see note above), substring is consistent with the php 5.2.0 substr function (not 5.2.3 behavior) +//substring returns a section of a string as a tempstring, if given negative +// start the start is measured back from the end of the string, if given a +// negative length the length is the offset back from the end of the string to +// stop at, rather than being relative to start, if start is negative and +// larger than length it is treated as 0. +// examples of substring: +// substring("blah", -3, 3) returns "lah" +// substring("blah", 3, 3) returns "h" +// substring("blah", -10, 3) returns "bla" +// substring("blah", -10, -3) returns "b" + +//DP_CON_BESTWEAPON +//idea: many +//darkplaces implementation: divVerent +//description: +//allows QC to register weapon properties for use by the bestweapon command, for mods that change required ammo count or type for the weapons +//it is done using console commands sent via stuffcmd: +// register_bestweapon quake +// register_bestweapon clear +// register_bestweapon <shortname> <impulse> <itemcode> <activeweaponcode> <ammostat> <ammomin> +//for example, this is what Quake uses: +// register_bestweapon 1 1 4096 4096 6 0 // STAT_SHELLS is 6 +// register_bestweapon 2 2 1 1 6 1 +// register_bestweapon 3 3 2 2 6 1 +// register_bestweapon 4 4 4 4 7 1 // STAT_NAILS is 7 +// register_bestweapon 5 5 8 8 7 1 +// register_bestweapon 6 6 16 16 8 1 // STAT_ROCKETS is 8 +// register_bestweapon 7 7 32 32 8 1 +// register_bestweapon 8 8 64 64 9 1 // STAT_CELLS is 9 +//after each map client initialization, this is reset back to Quake settings. So you should send these data in ClientConnect. +//also, this extension introduces a new "cycleweapon" command to the user. + +//DP_QC_STRINGBUFFERS +//idea: ?? +//darkplaces implementation: LordHavoc +//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine +float() buf_create = #460; +void(float bufhandle) buf_del = #461; +float(float bufhandle) buf_getsize = #462; +void(float bufhandle_from, float bufhandle_to) buf_copy = #463; +void(float bufhandle, float sortpower, float backward) buf_sort = #464; +string(float bufhandle, string glue) buf_implode = #465; +string(float bufhandle, float string_index) bufstr_get = #466; +void(float bufhandle, float string_index, string str) bufstr_set = #467; +float(float bufhandle, string str, float order) bufstr_add = #468; +void(float bufhandle, float string_index) bufstr_free = #469; + +//DP_QC_STRINGBUFFERS_CVARLIST +//idea: divVerent +//darkplaces implementation: divVerent +//functions to list cvars and store their names into a stringbuffer +//cvars that start with pattern but not with antipattern will be stored into the buffer +void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517; + +//DP_QC_STRREPLACE +//idea: Sajt +//darkplaces implementation: Sajt +//builtin definitions: +string(string search, string replace, string subject) strreplace = #484; +string(string search, string replace, string subject) strireplace = #485; +//description: +//strreplace replaces all occurrences of 'search' with 'replace' in the string 'subject', and returns the result as a tempstring. +//strireplace does the same but uses case-insensitive matching of the 'search' term +// +//DP_QC_CRC16 +//idea: divVerent +//darkplaces implementation: divVerent +//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol. +//When caseinsensitive is set, the CRC is calculated of the lower cased string. +float(float caseinsensitive, string s, ...) crc16 = #494; + +//DP_SV_SHUTDOWN +//idea: divVerent +//darkplaces implementation: divVerent +//A function that gets called just before progs exit. To save persistent data from. +//It is not called on a crash or error. +//void SV_Shutdown(); + +//EXT_CSQC +// #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC) +void(float index, float type, ...) addstat = #232; + +//ZQ_PAUSE +//idea: ZQuake +//darkplaces implementation: GreEn`mArine +//builtin definitions: +void(float pause) setpause = #531; +//function definitions: +//void(float elapsedtime) SV_PausedTic; +//description: +//during pause the world is not updated (time does not advance), SV_PausedTic is the only function you can be sure will be called at regular intervals during the pause, elapsedtime is the current system time in seconds since the pause started (not affected by slowmo or anything else). +// +//calling setpause(0) will end a pause immediately. +// +//Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause. In other words, the only things that are not called are think and other time-related functions. + + + + +// EXPERIMENTAL (not finalized) EXTENSIONS: + +//DP_CRYPTO +//idea: divVerent +//darkplaces implementation: divVerent +//field definitions: (SVQC) +.string crypto_keyfp; // fingerprint of CA key the player used to authenticate, or string_null if not verified +.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player, or string_null if not verified +.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified +.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext +.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext +// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for +//builtin definitions: (SVQC) +float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513; +//description: +//use -1 as buffer handle to justs end delim as postdata diff --git a/QC_other/QC_keep/drake_aim.qc b/QC_other/QC_keep/drake_aim.qc new file mode 100644 index 00000000..832eb582 --- /dev/null +++ b/QC_other/QC_keep/drake_aim.qc @@ -0,0 +1,651 @@ +//entity(entity attacker) Grapple_Pull_Who; + +//========================================================================== +// Shot Leading + +//------------------------------------------------------------------------// +// This returns the coefficient that multiplies an entity's velocity. +//------------------------------------------------------------------------// +float(entity ent) Aim_SpeedMod = +{ + local float sped; + + sped = 1; +// SoE: Biosuit killed the wetsuit and took its stuff. + if (ent.flags & FL_CLIENT) + { // Only a player is affected by all of these events. + if (ent.waterlevel == 3) + { + if (ent.radsuit_finished) + sped = 1.5; + } + else if (ent.waterlevel == 2) + { + if (ent.radsuit_finished) + sped = 1.25; + } + else if (ent.form_active == FORM_DRAGON) + sped = 1.429; // 10/7 or 1.428571... + + // Update: 10/29/10: Check all sources of slow. + if ((ent.curse_type == CURSE_SLOW) || ent.slow_finished) + sped = sped / 2; + } + return sped; +}; + +//------------------------------------------------------------------------// +// This checks if an entity is falling. Used by entities who lead shots. +//------------------------------------------------------------------------// +float(entity ent) IsFalling = +{ + // Not falling if flying, swimming, or already on the ground. + if (ent.flags & FLx_NOT_FALLING) + return FALSE; + + // Flying or ethereal targets cannot fall. + if (ent.movetype == MOVETYPE_FLY) + return FALSE; + if (ent.movetype == MOVETYPE_NOCLIP) + return FALSE; + if (ent.movetype == MOVETYPE_FLYMISSILE) + return FALSE; + + // Players need extra checking. + if (ent.movetype == MOVETYPE_WALK) //(ent.classname == "player") + { + if (ent.waterlevel >= 2) + return FALSE; // Swimming. + } + + // Target is falling. + return TRUE; +}; + +//------------------------------------------------------------------------// +// Check if target's vertical velocity should be ignored. +//------------------------------------------------------------------------// +float(entity ent) Aim_IgnoreZ = +{ + //- - - - - - - + // A player swimming along the surface of water has a velocity that + // oscillates up and down constantly and should be ignored. + // + // Flight via Dark Angel wings also has a similar effect in the air. + // Update: Wings replaced by Boots of Levitation. However, it is + // probably a good idea to keep the same item check code. + //- - - - - - - + if (ent.movetype == MOVETYPE_WALK) //(ent.classname == "player") + { + if (!(ent.flags & FL_ONGROUND)) + { + if (ent.waterlevel) + if (ent.waterlevel < 3) + return TRUE; // Swimming along water surface. + + if (ent.wing_finished) + if (ent.button2) + if (ent.waterlevel < 2) + return TRUE; // Flying with Dark Angel wings. + } + } + return FALSE; +}; + +//------------------------------------------------------------------------// +// This tries to predict where the target will go, then returns that spot. +// +// NOTE: This only works on targets that have a velocity value. +// In Quake, only players have a constantly updated velocity. Monsters +// do not update their velocity because they move in steps, unless it is +// jumping or falling (e.g., fip2). Bottom line: This works reliably +// only on players. +// +// NOTE: While using Law of Sines or application of (a/sin(A) = b/sin(B)) +// may be a more elegant way to a perfect answer, standard Quake does not +// support trigometric functions, and I suspect adding trig functions via +// QuakeC and using them may involve running more code than necessary when +// a more primitive yet simplier way (as far as Quake is concerned) of +// getting an answer that is "close enough" is sufficient. +//------------------------------------------------------------------------// +vector(vector p1, vector p2, float sped, entity targ) Aim_Lead = +{ + if (!targ) + return p2; // No target. + if (targ.movetype == MOVETYPE_NONE) + return p2; // Can't move, ignore velocity. + if (targ.movetype == MOVETYPE_STEP) + if (targ.flags & FLx_NOT_FALLING) + return p2; // Target velocity is not accurate. + // Removed invisibility checks -- done elsewhere. + if (!sped) + return p2; // Avoid division by zero. + + // Now find the spot. + local float mx; + local float loop; + local float airtime; + local float xyz; // TRUE = Use all three dimensions. + local float wired; // TRUE = Riding a grapple cable. + local vector lead; + local vector tv; + +//- - - - - - - - - +// Update 7/31/09: Check if target is riding on a grappling wire. +// Note: Applies only to attackers using the grappler to move, +// not creatures hooked and drawn toward the grappler. However, +// since pulling hooked monsters is rare enough and does not apply +// to players, I'm not adding another field and more code just to +// make the case of aiming at hooked monsters pulled by players work. + wired = FALSE; + if (targ.hook.state) // Should be 0 if targ.hook == world. + //if (Grapple_Pull_Who (targ) == targ) + //wired = TRUE; +//- - - - - - - - - + tv = targ.velocity; +// Check if target's vertical velocity should be ignored. + xyz = TRUE; + if (!wired) + if (Aim_IgnoreZ (targ)) + {xyz = FALSE; tv_z = 0;} + +// Calculate the time it takes for a missile to reach a given spot, +// then calculate where the moving target will be after that amount of time. +// However, after predicting where the target will be, it may take more or +// less time for the missile to reach that spot. Therefore, we ought to +// recalculate the time needed to reach the real spot. Each recalcuation +// reduces the margin of error. Idea is similar to a power series. +// Yes, brute force may be ugly, but it gets the job done. + mx = Aim_SpeedMod (targ); + loop = 5; // Make sure the number is odd. + lead = p2; + while (loop > 0) + { + airtime = vlen(lead - p1) / sped; + lead = p2 + (tv * mx) * airtime; + loop = loop - 1; + } + +// Update 7/31/09: Check if target is riding on a grappling wire. + if (wired) + { + if (targ.hook.state != 2) + loop = (targ.hook.enemy.maxs_x + targ.maxs_x); + else + loop = targ.maxs_x; + tv = targ.hook.origin - targ.origin; + mx = (vlen(tv) - loop) / SPEED_HOOK; + if (mx < airtime) + { // Target will be at the hook -- aim there! + tv = targ.hook.origin - normalize(tv)*loop; + return tv; + } + } +//- - - - - - - - - + +// Check for gravity. For better accuracy, this check should be done in +// the above loop, but since this has much more code, just do this once, +// even if accuracy isn't perfect. + if (xyz) + if (IsFalling (targ)) + { + local float fell; // Distance fallen. + local float gforce; // Target gravity. + + gforce = cvar("sv_gravity"); + if (targ.gravity) + gforce = gforce * targ.gravity; + + fell = 0.5 * gforce * airtime * airtime; // 1/2 gt^2. + lead_z = lead_z - fell; + + // Check if the path to the spot is clear. + traceline (p1, lead, TRUE, targ); + if (trace_fraction < 1) + { + if (fell) + { + // Projected spot was blocked. Check if the spot was blocked + // due to the floor or ceiling alone. If so, aim at the + // surface. + local vector spot; + + spot = lead; + spot_z = p2_z; + + traceline (spot, lead, TRUE, targ); + lead = trace_endpos; + if (fell > 0) + lead_z = lead_z - targ.mins_z; // floor + else + lead_z = lead_z - targ.maxs_z; // ceiling + } + } + } + +// Our work here is done. + return lead; +}; + +//------------------------------------------------------------------------// +// This is similar to traceline, except gravity affects this. +// +// The value returned is the closest distance the path was to a point, +// which is necessary when comparing the better of two different traces. +// +// (Originally, the value returned is the time of flight before impact.) +// +// Note: If mtype == MOVETYPE_BOUNCE, trace grenade path. +//------------------------------------------------------------------------// +float(vector p1, vector vel, float nomon, entity ignore, float fuse, + vector spot, float mtype) TraceBallistic = +{ + local float fps, tpf; // Frame Per Second, Time Per Frame. + local float g, minv, maxv; + local float t, dist, best; + +// The closer time per frame is to hosttime, the more accurate the trace is. +// However, try to keep the number of traceline calls to a minimum. Thus, +// 20 fps is a good compromise between accuracy and efficiency. + fps = 20; // Don't use zero or negative number. + tpf = 1 / fps; +// Note: If you really want to work more for more accuracy, use the +// following two lines instead. Warning: frametimes on a fast computer +// can approach a frametime of 0.01, meaning about 100 calls. That's +// A LOT of traceline calling! +// tpf = frametime; +// fps = 1 / tpf; + + best = 20000; // More than 8000 * 2. + t = 0; + fuse = floor(fuse * fps); + g = cvar("sv_gravity") * tpf; + maxv = cvar("sv_maxvelocity"); + minv = 0 - maxv; +//- - - - - - - - - + // Velocity check + if (vel_x > maxv) vel_x = maxv; + else if (vel_x < minv) vel_x = minv; + if (vel_y > maxv) vel_y = maxv; + else if (vel_y < minv) vel_y = minv; + if (vel_z > maxv) vel_z = maxv; + // Lower bound for z done in loop. +//- - - - - - - - - + while (t < fuse) + { + if (vel_z < minv) // Velocity check. + vel_z = minv; // Note: Don't bother with reverse gravity. + vel_z = vel_z - g; + traceline (p1, p1 + (vel * tpf), nomon, ignore); + p1 = trace_endpos; + //- - - - - - - - - + dist = vlen(p1 - spot); + if (dist < best) + best = dist; + //- - - - - - - - - + if (trace_fraction < 1) + { + if ((mtype != MOVETYPE_BOUNCE) || (trace_ent.takedamage == DAMAGE_AIM)) + fuse = 0; // Got a hit -- break the loop! + else + { // Rebound. Emulate C physics code. + // overbounce = 1.5, stop_epsilon = 0.1, as per C code. + vel = Vec_Reflect (vel, trace_plane_normal, 1.5, 0.1); + if (vel == '0 0 0') + fuse = 0; // Stopped. + else + { + trace_ent = world; // Bounced off the guy. + trace_fraction = 1; + } + } + } + t = t + 1; + } + return best; //return t * tpf; +}; + +// FIXME: DarkPlaces has a builtin function for this. +void(vector p1, vector vel, float nomon, entity ignore, float fuse) + TraceToss = +{ + TraceBallistic (p1, vel, nomon, ignore, fuse, p1, MOVETYPE_TOSS); +}; + +//------------------------------------------------------------------------// +// This returns how much speed to add up for a toss projectile to +// hit the target point. +// +// NOTE: The resulting speed can be much higher than the original. +//------------------------------------------------------------------------// +float(vector p1, vector p2, float sped) Aim_TossUp = +{ + local float gforce; // Target gravity. + local float up; // Add to z. + + if (sped <= 0) + return 0; // Avoid division by zero. + + gforce = cvar("sv_gravity"); + p2 = p2 - p1; + + up = 0.5 * gforce / sped; + up = vlen(p2) * up; + return up; +}; + + +//========================================================================== +// Monster Aiming + +//- NOTE - - - - - - +// The set of numbers in the 'spread' vectors passed to these aim +// functions are angles, not their tangents. +// +// Why pass the angles? Because the values returned by crandom() with +// tangents passed to it tends to favor the edges. For example, passing +// a tangent of 10000000 to crandom will very likely return a value that, +// if you calcualated its inverse tangent, be 89.x degrees. +// +// By passing the angle instead, there is no bias for any angle, assuming +// the random() function does its job. After randomization, the angle may +// be converted to a tangent for whatever purpose. +//- - - - - - - - - +vector(vector dir, vector vtan) Aim_Tangent = +{ + local vector vang; + local float mx; + + // Combine the tangent side vector to the old directional vector. + mx = vlen (dir); + dir = normalize (dir); + vang = Vangles (dir); + makevectors (vang); + dir = dir + (vtan_x * v_right) + (vtan_y * v_up); + dir = normalize (dir); + + return (dir * mx); +}; + +// spread: x = horizontal, y = vertical, z = 0/1 for randomize/set. +vector(vector dir, vector spread) Aim_Scatter = +{ + // Randomize the angles before converting them into tangents. + if (!spread_z) + {spread_x = crandom() * spread_x; spread_y = crandom() * spread_y;} + spread_x = SUB_tan (spread_x); spread_y = SUB_tan (spread_y); + + // Combine the tangent side vector to the old directional vector. + return Aim_Tangent (dir, spread); +}; + +vector(vector dir, vector spread) Maim_Scatter = +{ + local float r; + + if (self.enemy.invisible_finished || (self.enemy.items & IT_INVISIBILITY)) + { + r = random() * 4; // Monsters have 25% chance to guess right. + r = floor(r) * 5; // Aim up to 15 degrees to either side. + if (random() < 0.5) + r = 0 - r; + } + else + r = 0; + + // Randomize the angles before converting them into tangents. + if (!spread_z) + {spread_x = crandom() * spread_x; spread_y = crandom() * spread_y;} + spread_x = SUB_tan (spread_x + r); spread_y = SUB_tan (spread_y); + + // Combine the tangent side vector to the old directional vector. + return Aim_Tangent (dir, spread); +}; + + +//- - - - - - - - - +// Constants +float SHOT_TIME_TOSS = 5; +float SHOT_TIME_BOUNCE = 2.5; // Assuming grenades. +float SMARTBALL = -1; // Used instead of a movetype to do hack. + +//------------------------------------------------------------------------// +// This returns the directional vector needed for a monster to hit its +// target. +// +// NOTE: The vector returned can be smaller than a unit vector. +// (Really, it should not because that is cheating. Oh well.) +//------------------------------------------------------------------------// +vector(vector p1, vector p2, float sped, float up, entity targ, float ex, + float fuse, float mtype) Aim_Ballistic = +{ + if (!sped) + return '0 0 0'; // Avoid divison by zero. + + local vector dir, vel, v1, v2, vup; + local float d1, d2; + local float toss, mx; + + vup = '0 0 0'; + vup_z = up; + +// Locate the point we want to aim at. + if (targ) + { + dir = Aim_Lead (p1, p2, sped, targ); + if (ex < 1) + dir = p2 + ((dir - p2) * ex); // Partial leading. + // Check if the path to the projected endpoint is clear. + // NOTE: This does not check if monsters are in the way. + traceline (p1, dir, TRUE, self); + if (trace_fraction == 1) + p2 = dir; // Success. + } + self.dest = p2; + +// Get first vector: Direction in the xy-plane only, eliminate z-axis. +// This is closest, albeit not identical, to id's old aiming code. + dir = normalize(p2 - p1); + vel = dir * sped; + vel_z = vel_z + up; + + v1 = v2 = dir; + v1_z = 0; + v1 = normalize (v1); + +// Get second vector: Direction needed to hit opponent. Does not account +// for obstacles in the way. + // Determine the extra vertical speed needed to hit the target point. + toss = Aim_TossUp (p1, p2, sped); + vel = dir * sped; + vel_z = vel_z + toss - up; + //- - - - - - - - - + // At this point, the upward speed returned would let the monster hit the + // target point with perfect accuracy. However, that is cheating since + // the player cannot do that trick, especially if it lets the monster hit + // at ranges longer than the player could hit if using the same attack + // (for example, grenades). + // + // For the sake of efficiency, allow this sort of cheating only if the + // resulting speed is slower than normal, which lets the monster drop + // grenades from above without overshooting the target point. + //- - - - - - - - - + mx = vlen(vel) / sped; + vel = normalize (vel); + if (mx < 1) // Yes, we may return a shorter-than-unit vector. + vel = vel * mx; + v2 = vel; + +//- - - - - - - - - + if (mtype == SMARTBALL) + return v2; // Smartball hack. +//- - - - - - - - - +// Project flight paths from the given two vectors. If either hit the enemy, +// return the direction. In case both vectors can hit, select the first +// forward-only vector, since it is the closest to the old monster aim code. + if (self.enemy) + { // Check if we can hit our intended target. + local entity vic; // VICtim. + local entity oown; // Old OWNer, placeholder for swapping. + + vic = self.enemy; // The target the trace needs to hit. + oown = self.enemy.owner; // See below in target spawn section. + if (targ) + { // Shot leading on. + // Note: Leading shots to targ, so use targ, regardless of + // self.enemy. FWIW, targ is usually, if not always, self.enemy. + if (p2 != targ.origin) + { + vic = spawn(); // Definitely NOT self.enemy or world. + vic.owner = targ; + vic.solid = targ.solid; + vic.takedamage = targ.takedamage; + setorigin (vic, p2); + setsize (vic, targ.mins, targ.maxs); + // Setting the enemy's owner to self lets traceline ignore + // the enemy, if it ignores self. + self.enemy.owner = self; + } + } + // One + d1 = TraceBallistic (p1, v1*sped + vup, FALSE, self, fuse, p2, mtype); + if (trace_ent == vic) + { if (vic != self.enemy) + {self.enemy.owner = oown; remove (vic);} + return v1; // ONE! + } + // Two + d2 = TraceBallistic (p1, v2*sped + vup, FALSE, self, fuse, p2, mtype); + if (trace_ent == vic) + { if (vic != self.enemy) + {self.enemy.owner = oown; remove (vic);} + return v2; // TWO! + } + // If we didn't eliminate the dummy target yet, remove it now. + if (vic != self.enemy) + {self.enemy.owner = oown; remove (vic);} + } + else + { // No target to hit, so simply aim at the given point. + d1 = TraceBallistic (p1, v1*sped + vup, FALSE, self, fuse, p2, mtype); + d2 = TraceBallistic (p1, v2*sped + vup, FALSE, self, fuse, p2, mtype); + } + +// Neither projections could hit the enemy, so pick the one that reached +// the closest to the enemy. + if (d2 < d1) + return v2; // 3D Ballistic + return v1; // 2D Forward +}; + +vector(vector p1, vector p2, float sped, float up, entity targ, float ex) + Aim_TossEx = +{ + return Aim_Ballistic (p1, p2, sped, up, targ, ex, SHOT_TIME_TOSS, MOVETYPE_TOSS); +}; + +vector(vector p1, vector p2, float sped, float up, entity targ) Aim_Toss = +{ + return Aim_Ballistic (p1, p2, sped, up, targ, 1, SHOT_TIME_TOSS, MOVETYPE_TOSS); +}; + +vector(vector p1, vector p2, float sped, float up, entity targ, + vector spread, float ex) Maim_TossEx = +{ + p2 = Aim_Ballistic (p1, p2, sped, up, targ, ex, SHOT_TIME_TOSS, MOVETYPE_TOSS); + p2 = Maim_Scatter (p2, spread); + return p2; +}; + +vector(vector p1, vector p2, float sped, float up, entity targ, vector spread) + Maim_Toss = +{ + p2 = Aim_Ballistic (p1, p2, sped, up, targ, 1, SHOT_TIME_TOSS, MOVETYPE_TOSS); + p2 = Maim_Scatter (p2, spread); + return p2; +}; + +// Specially made for grenade lobbers such as ogres. +vector(vector p1, vector p2, float sped, float up, entity targ, vector spread) + Maim_Grenade = +{ + p2 = Aim_Ballistic (p1, p2, sped, up, targ, 1, SHOT_TIME_BOUNCE, MOVETYPE_BOUNCE); + p2 = Maim_Scatter (p2, spread); + return p2; +}; + +// Specially made for the "smart balls" launched by Zerstorer's Nemesant. +vector(vector p1, vector p2, float sped, float up, entity targ, vector spread) + Maim_SmartBall = +{ + p2 = Aim_Ballistic (p1, p2, sped, up, targ, 1, SHOT_TIME_TOSS, SMARTBALL); + p2 = Maim_Scatter (p2, spread); + return p2; +}; + +//- - - - - - - - - +vector(vector p1, vector p2, float sped, entity targ, float ex) Aim_LineEx = +{ + local vector dir; + + // If no speed, assume instant-hit... and avoid division by zero. + if (sped) + if (targ) + { + dir = Aim_Lead (p1, p2, sped, targ); + if (ex < 1) + dir = p2 + ((dir - p2) * ex); // Partial leading. + // Check if the path to the projected endpoint is clear. + // NOTE: This does not check if monsters are in the way. + traceline (p1, dir, TRUE, self); + if (trace_fraction == 1) + p2 = dir; // Success. + } + dir = normalize (p2 - p1); + return dir; +}; + +vector(vector p1, vector p2, float sped, entity targ) Aim_Line = +{ + return Aim_LineEx (p1, p2, sped, targ, 1); +}; + +vector(vector p1, vector p2, float sped, entity targ, vector spread, float ex) + Maim_LineEx = +{ + p2 = Aim_LineEx (p1, p2, sped, targ, ex); + p2 = Maim_Scatter (p2, spread); + return p2; +}; + +vector(vector p1, vector p2, float sped, entity targ, vector spread) + Maim_Line = +{ + p2 = Aim_LineEx (p1, p2, sped, targ, 1); + p2 = Maim_Scatter (p2, spread); + return p2; +}; + + +//========================================================================== +// Other + +// Reduces shots in a series by one and returns a number between 0 and 1. +// Number returned is used for shot leading. 0 for none, 1 for perfect. +// Used by monsters who gradually improve their aim during an attack salvo. +float() Frac_ShotDown = +{ + local float d; + + if (self) + { + self.shots_left = self.shots_left - 1; + d = self.shots_max - 1; + if (d > 1) + return fabs((d - self.shots_left) / d); + } + return 1; +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/drake_armor.qc b/QC_other/QC_keep/drake_armor.qc new file mode 100644 index 00000000..5fbd8c8b --- /dev/null +++ b/QC_other/QC_keep/drake_armor.qc @@ -0,0 +1,475 @@ +// armor.qc + +//========================================================================== +// Checks + +// Note: Arf = ARmor Float, for the functions that use a float input. + +// Checks if entity wears a custom armor. +float(float exotic) Arf_Exotic = +{ + if (exotic > SUIT_ULTRA) + return 0; // Undefined. + return exotic; +}; + +// Checks if armor has infinite durability. +float(float exotic) Arf_Infinite = +{ + return ( (exotic == SUIT_ONYX) || (exotic == SUIT_ONYX_POWER) + || (exotic == SUIT_BERSERKER)); +}; + +// Checks if armor is indestructible. What this means is the armor stays +// even if durability gets reduced to 0. Onyx armor has no durability +// (infinite), spirit armor can reform out of nothing, and chaos armor +// stays until used. +float(float exotic) Arf_Indestructible = +{ + if (exotic == SUIT_SPIRIT) + return TRUE; // Powered by intangible spirits! + if (exotic == SUIT_CHAOS) + return TRUE; // Indestructible until teleportation is used. + if (exotic == SUIT_ULTRA) + return TRUE; // Don't remove ultra enforcers' armor. + if (Arf_Infinite (exotic)) + return TRUE; // Infinite durability. + return FALSE; +}; + +// Checks if armor can/not be repaired. Armor that cannot be repaired +// include infinite armors (don't need repairs) and the spirit armor +// (protection granted by intangible forces). +float(float exotic) Arf_NoPatch = +{ + if (exotic == SUIT_SPIRIT) + return TRUE; // Powered by intangible spirits! + if (exotic == SUIT_ULTRA) + return TRUE; // Force field armor. + if (Arf_Infinite (exotic)) + return TRUE; + return FALSE; +}; + +// Checks if armor has a usable power. +float(float exotic) Arf_SuperPower = +{ + return ( (exotic == SUIT_DRAGON) || (exotic == SUIT_ONYX_POWER) + || (exotic == SUIT_BERSERKER) || (exotic == SUIT_SPIRIT) + || (exotic == SUIT_CHAOS) ); +}; + +//- - - - - - - - - +float(entity ent) Armor_Exotic = + {return Arf_Exotic ((ent.perms & POWx_ARMOR) / POW_ARMOR1);}; + +float(entity ent) Armor_Infinite = + {return Arf_Infinite ((ent.perms & POWx_ARMOR) / POW_ARMOR1);}; + +float(entity ent) Armor_Indestructible = + {return Arf_Indestructible ((ent.perms & POWx_ARMOR) / POW_ARMOR1);}; + +float(entity ent) Armor_NoPatch = + {return Arf_NoPatch ((ent.perms & POWx_ARMOR) / POW_ARMOR1);}; + +// Checks if armor allows the player to morph into something else. +float(entity ent) Armor_Morphic = +{ +// Currently, only the Dragonscale armor qualifies. + return ( (ent.perms & POWx_ARMOR) / POW_ARMOR1 == SUIT_DRAGON ); +}; + +// Returns current armorvalue for an entity's chaos armor. +float(entity ent) Armor_ChaosRating = +{ + if (ent.health > 0) + if (ent.armorvalue > 0) + return ent.armorvalue / (ent.armorvalue + ent.health); + return 0; +}; + +// Returns a rating based on armor stats. The higher it is the better. +// The old 'type*value' doesn't cut it when infinite armor gets involved. +float(float hp, float type, float value, float exotic) Defense_Rating = +{ + local float full, combo, inf; + + inf = FALSE; + exotic = exotic & SUITx_ALL; //(ent.perms & POWx_ARMOR) / POW_ARMOR1; + if (exotic) + { + if (exotic == SUIT_DRAGON) + type = 1; // Morphing into monster uses armor as health. + else if (exotic == SUIT_BERSERKER) + {type = -0.3; value = 0;} + else if (exotic == SUIT_CHAOS) + type = value / (value + hp); + + inf = Arf_Infinite (exotic); + } + + if (!type) + return 0; + + if (type < 1) + full = hp / (1 - type); + else + full = INFINITY; + + if (inf) + return full; + + combo = hp + value; + if (full > combo) + full = combo; + return full; +}; + + +//========================================================================== +// Power Shield + +//- - - - - - - - - +// How power armor worked in Quake2... +// + Power armor is applied before regular armor. +// - Power Screen +// * Protected against frontal attacks only. +// * Absorbed up to 33% incoming damage. +// * Consumes 1 cell per 1 damage absorbed. +// - Power Shield +// * Protected against all attacks that do not bypass armor. +// * Absorbed up to 66% incoming damage. +// * Consumes 1 cell per 2 damage absorbed! +// +// The power shield in Quake2 is overpowered because it made players +// very hard to kill, especially if the player wore red armor too. +// +// Drake's custom power armor is DoomRL's Onyx armor and Quake2's +// power shield rolled into one. Here is how it works... +// * Protects against all attacks that do not bypass armor. +// * Absorbs half incoming damage +// * Consumes 1 cell per 2 damage absorbed. +// * Remaining damage (now 50%) is reduced by half again (as onyx armor). +// Onyx armor plus power shield provide up to 75% damage reduction. +// Not quite, but close to red armor class, and much sturdier. +//- - - - - - - - - + +// Updates armorvalue based on power armor status. +void(entity ent) Update_PowerArmor = +{ + if (Armor_Exotic(ent) == SUIT_ONYX_POWER) + { + if (ent.perms & POW_POWER_ARMOR) + { + ent.armorvalue = ent.ammo_cells; + if (ent.flags & FL_CLIENT) + if (ent.items & IT_CELLS) + ent.currentammo = ent.ammo_cells; + if (ent.ammo_cells < 1) + { + sound (self, CHAN_AUTO, "me/me_soff.wav", 1, ATTN_NORM); + ent.perms = ent.perms - POW_POWER_ARMOR; + } + } + else + ent.armorvalue = 0; + } +}; + +// Sets the power shield switch. +void(entity ent, float turn_on) PowerArmor_Switch = +{ + local float was_on; + + was_on = ent.perms & POW_POWER_ARMOR; + if (turn_on) + { if (!was_on) + { ent.perms = ent.perms | POW_POWER_ARMOR; + sound (ent, CHAN_AUTO, "me/me_son.wav", 1, ATTN_NORM); + } + } + else + { if (was_on) + { ent.perms = ent.perms - POW_POWER_ARMOR; + sound (ent, CHAN_AUTO, "me/me_soff.wav", 1, ATTN_NORM); + } + } +}; + +// Returns the damage absorbed by power armor. +// Called by 'T_Damage' in combat.qc. +float(entity targ, float damage, float drain) PowerArmor_Absorb = +{ + local float save, fuel; + + save = 0; + if (targ.perms & POW_POWER_ARMOR) + { + save = ceil (damage / 2); // Absorb half damage, round up. + fuel = floor(targ.ammo_cells * DAMAGE_PER_CELL); + if (save > fuel) + save = fuel; + if (drain) + { + targ.ammo_cells = targ.ammo_cells - ceil(save / DAMAGE_PER_CELL); + Update_PowerArmor (targ); + Particle_Cube (targ, 241, 241); + // Was "weapons/lashit.wav", but I need to recycle sounds to save slots. + sound (self, CHAN_AUTO, "weapons/zap1.wav", 1, ATTN_NORM); + } + // ELSE... We only wanted to crunch numbers without affecting stuff. + } + return save; +}; + + +//========================================================================== +// Suit Up + +// Gives instructions to player. Called on first pickup of usable armor. +void(entity ent) Armor_Awaken = +{ + if ((ent.flags & FLx_CREATURE) == FL_CLIENT) + if (!(ent.perms & POW_HINT_ARMOR)) + { // First time taking special armor? + ent.perms = ent.perms | POW_HINT_ARMOR; + sound (ent, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + centerprint (ent, "Double-press JUMP to use armor."); + } +}; + +// Sets an entity's armor stats. +void(entity ent, vector vstat) Armor_Set = +{ +// Local vars defined for readability's sake. + local float type, value, bit, exotic; + + type = vstat_x; + value = vstat_y; + bit = vstat_z & ITx_ALL_ARMOR; + exotic = vstat_z & SUITx_ALL; + + ent.armortype = type; + ent.armorvalue = value; + ent.items = (ent.items - (ent.items & ITx_ALL_ARMOR)) | bit; + ent.perms = (ent.perms - (ent.perms & POWx_ARMOR)) | (exotic * POW_ARMOR1); + +// Special effects caused by exotic armor. + if (Arf_SuperPower (exotic)) + Armor_Awaken (ent); // Dragonscale or power armor. + if (exotic != SUIT_DRAGON) + { // Lost morphing power, so change back to human. + if (ent.form_active) + War_Transform (ent); // This should set baha_time to 0. + } + if (exotic == SUIT_ONYX_POWER) + { // Give player free large cells to fuel the armor. + Update_Cells (ent, ent.ammo_cells + LARGE_CELLS); + } + else + { // No more power armor, so switch it off if necessary. + PowerArmor_Switch (ent, FALSE); + } + Regen_ClientReset (ent); // Demonhide affects regeneration. +}; + +// Strips armor from an entity. +void(entity ent) Armor_Remove = {Armor_Set (ent, '0 0 0');}; + +// PM: This tries to put armor on 'ent'. Returns non-zero if successful. +float(entity ent, vector vstat) Armor_Add = +{ +// Local vars defined for readability's sake. + local float type, value, bit, exotic, rating; + local float ar, px; + + px = Armor_Exotic (ent); + if ((px == SUIT_BERSERKER) || (px == SUIT_ULTRA)) + return 0; // Wearing cursed armor that cannot be removed. + +// Now to see if the new armor is worth taking. + type = vstat_x; + value = vstat_y; + bit = vstat_z & ITx_ALL_ARMOR; + exotic = vstat_z & SUITx_ALL; + + if (exotic && (exotic != SUIT_ONYX) && (exotic != SUIT_COURAGE)) + { + if (px == exotic) + if (ent.armorvalue >= value) + return 0; // Already wearing same armor type that's better. + + // Still here? Take new armor for its special power at least. + } + else + { // Basic armor, or exotic armor with minor powers (courage/onyx). + if (exotic == SUIT_ONYX) + if (px == SUIT_ONYX_POWER) + return 0; // Don't replace power armor with shieldless. + + rating = Defense_Rating (ent.health, type, value, exotic); + ar = Defense_Rating (ent.health, ent.armortype, ent.armorvalue, px); + + if (ar > rating) + return 0; // Current armor is still better than new armor. + if (ar == rating) + { + if (ent.armortype*ent.armorvalue >= type*value) + return 0; // Current armor is still better than new armor. + if (Arf_Indestructible (px)) + if (!Arf_Indestructible (exotic)) + return 0; // Don't trash current indestructible armor. + } + } + +// Armor pickup confirmed! + Armor_Set (ent, vstat); + return 1; +}; + + +//========================================================================== +// Client Armor Use + +// Checks if 'who' can use chaos armor passively. +// Doing so destroys the armor, and reduces current health by half. +// This is usually called by things that would instakill otherwise, +// Similar to the powered up firemace shots in Heretic. +float(entity who) Use_ChaosArmor = +{ + if (Armor_Exotic (who) == SUIT_CHAOS) + { // Auto use chaos device. + if (Use_ChaosDevice (who)) + { // Saved! + who.hit_points = who.health = ceil(who.health / 2); + Armor_Remove (who); + return TRUE; + } + } + return FALSE; +}; + +// Lets player attempt to activate armor. +void() W_UseArmor = +{ + local float exotic; + + if (cutscene) + return; // Ignore if in cutscene so messages won't be displayed. + + // Update: No messages if armor serverflag is off. + exotic = Armor_Exotic (self); + if (exotic == SUIT_DRAGON) + { // The first armor with usable powers in Drake. + if (mindex_dragon) + { + //- - - - - + // Morphing to dragon form always sets ammo to max. To prevent + // recharge shortcuts via double morph, require ammo to fully + // recharge before allowing player to morph out of dragon form. + //- - - - - + if (self.form_active) + { + if (self.form_active == FORM_DRAGON) + if (self.baha_ammo < MAX_BAHA_AMMO) + {sprint (self, "not at full power\n"); return;} + } + if (Transform_Ok (self)) + { + War_Transform (self); + // PM: See the sprint messages below? Ripped from Nethack! + if (self.form_active) + { //sprint (self, "you merge with your scaly armor\n"); + sprint (self, "you turn into a dragon\n"); + } + else + { //sprint (self, "your skin returns to its original form\n"); + sprint (self, "you return to human form\n"); + } + // Enforce a cool down period to prevent spamming. + // Assumes armor use was triggered by impulse or double jump. + self.b2_done = self.attack_finished = time + 0.5; + } + else + { + if (!self.form_active) + self.baha_time = 0; // Override automorph. + sprint (self, "not enough room\n"); + } + } + else + { // The files were not loaded, so it fails! + sprint (self, "nothing happens\n"); + } + return; + } + if (exotic == SUIT_ONYX_POWER) + { + if (self.ammo_cells < 1) + sprint (self, "no power\n"); + else + { // Toggle power shield. + if (self.perms & POW_POWER_ARMOR) + PowerArmor_Switch (self, FALSE); // Off + else + PowerArmor_Switch (self, TRUE); // On + Update_PowerArmor (self); + } + return; + } + if (exotic == SUIT_BERSERKER) + { + if (self.armorvalue < ARMOR_STATS_DEMON_y / 2) + sprint (self, "not enough power\n"); + else if (self.super_damage_finished) + sprint (self, "nothing happens\n"); + else + { // Rage! + sprint (self, "you feel like a killing machine!\n"); + exotic = self.armorvalue / 10; + // damage3.wav is similar to damage.wav, and damage3.wav + // is always precached, so use that for our short buff. + sound (self, CHAN_VOICE, "items/damage3.wav", 1, ATTN_NORM); + self.super_damage_finished = time + exotic; + self.super_time = self.super_damage_finished - 3; + self.items = self.items | IT_QUAD; + self.armorvalue = 0; // Used up the power. + } + return; + } + if (exotic == SUIT_SPIRIT) + { + if (self.armorvalue < ARMOR_STATS_SPIRIT_y) //10 + sprint (self, "not at full power\n"); //"not enough power\n" + else if (self.invisible_finished) // Don't use if already invisible. + sprint (self, "nothing happens\n"); + else + { // Poof! + sprint (self, "you vanish in a puff of smoke\n"); + spawn_tfog (self.origin); + self.invisible_finished = time + 10; //time + (self.armorvalue / 2); + self.invisible_time = self.invisible_finished - 3; + self.items = self.items | IT_INVISO; + self.armorvalue = 0; + } + return; + } + if (exotic == SUIT_CHAOS) + { // Activate teleportation, then destroy armor. + if (Use_ChaosDevice (self)) + Armor_Remove (self); + else + sprint (self, "nothing happens\n"); + return; + } + + if (self.perms & POW_HINT_ARMOR) + { if (!self.armorvalue && !exotic) // Onyx has 0 value. + sprint (self, "no armor\n"); + else + sprint (self, "no effect\n"); + } +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/drake_box.qc b/QC_other/QC_keep/drake_box.qc new file mode 100644 index 00000000..c47e34c1 --- /dev/null +++ b/QC_other/QC_keep/drake_box.qc @@ -0,0 +1,475 @@ +//========================================================================== +// Point Contents Checks + +//------------------------------------------------------------------------// +// This checks if a bbox is inside a wall or sky. The bbox's origin +// and corners are checked. If any one points is within a solid or sky, +// TRUE is returned. +//------------------------------------------------------------------------// +float(vector vmin, vector vmax, vector spot) BoxInWall = +{ + local vector p; + local float content; + + // Check origin. + p = spot; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + // Check bbox faces. + // Order: 1)-00 2)+00 3)0-0 4)0+0 5)00- 6)00+ + p_x = spot_x + vmin_x; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmax_x; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p = spot; + p_y = spot_y + vmin_y; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_y = spot_y + vmax_y; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p = spot; + p_z = spot_z + vmin_z; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_z = spot_z + vmax_z; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + // Check bbox corners. + // Order: 1)+++ 2)-++ 3)+-+ 4)--+ 5)++- 6)-+- 7)+-- 8)--- + p_x = spot_x + vmax_x; + p_y = spot_y + vmax_y; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmin_x; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmax_x; + p_y = spot_y + vmin_y; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmin_x; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmax_x; + p_y = spot_y + vmax_y; + p_z = spot_z + vmin_z; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmin_x; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmax_x; + p_y = spot_y + vmin_y; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + p_x = spot_x + vmin_x; + content = pointcontents(p); + if (content == CONTENT_SOLID) return TRUE; + if (content == CONTENT_SKY) return TRUE; + + return FALSE; +}; + +//------------------------------------------------------------------------// +// This traces lines through a cube in space, in an attempt to find +// solids such as creatures occupying the space inside said cube. +// Returns TRUE if space is clear, FALSE if solid is found. +//------------------------------------------------------------------------// +float(vector vmin, vector vmax, vector spot, entity ignore) BoxInThing = +{ + local vector p1, p2; + +// Check inside the bbox. + p1 = vmin; + p2 = vmax; + traceline (spot + p1, spot + p2, FALSE, ignore); + if (trace_ent) + return TRUE; + +// Check along the bbox boundaries, upwards and counter-clockwise. + p2_y = vmin_y; + traceline (spot + p1, spot + p2, FALSE, ignore); + if (trace_ent) + return TRUE; + p1_x = vmax_x; + p2_y = vmax_y; + traceline (spot + p1, spot + p2, FALSE, ignore); + if (trace_ent) + return TRUE; + p1_y = vmax_y; + p2_x = vmin_x; + traceline (spot + p1, spot + p2, FALSE, ignore); + if (trace_ent) + return TRUE; + p1_x = vmin_x; + p2_y = vmin_y; + traceline (spot + p1, spot + p2, FALSE, ignore); + if (trace_ent) + return TRUE; + +// Clear + return FALSE; +}; + + +//========================================================================== +// Entry Points + +// FIXME: Add a trace that checks walls only, instead of everything. + +//------------------------------------------------------------------------// +// This checks if the path near the desired spot is blocked by +// walls or monsters. +//------------------------------------------------------------------------// +float(vector spot) EntryPoint_Trace = +{ + traceline (self.enemy.origin, spot, FALSE, self.enemy); + if (trace_fraction < 1) + { + // Unless the entity hit is the one doing the teleporting, + // consider the spot blocked. + if (trace_ent != self.owner) + return TRUE; + // Teleporting ent was hit, now check through it for more entities. + traceline (trace_endpos, spot, FALSE, self.owner); + if (trace_fraction < 1) + return TRUE; + } + + return FALSE; +}; + +//------------------------------------------------------------------------// +// This traces lines from the beacon entity (self.enemy) to all eight +// bbox points around the destination. +//------------------------------------------------------------------------// +float() EntryPoint_Path = +{ + local vector spot, p; + + // Check origin. + spot = self.origin; + p = spot; + if (EntryPoint_Trace (p)) + return TRUE; + + // Check bbox corners. + // Order: 1)+++ 2)-++ 3)+-+ 4)--+ 5)++- 6)-+- 7)+-- 8)--- + p_x = spot_x + self.maxs_x; + p_y = spot_y + self.maxs_y; + p_z = spot_z + self.maxs_z; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.mins_x; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.maxs_x; + p_y = spot_y + self.mins_y; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.mins_x; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.maxs_x; + p_y = spot_y + self.maxs_y; + p_z = spot_z + self.mins_z; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.mins_x; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.maxs_x; + p_y = spot_y + self.mins_y; + if (EntryPoint_Trace (p)) + return TRUE; + + p_x = spot_x + self.mins_x; + if (EntryPoint_Trace (p)) + return TRUE; + + return FALSE; +}; + +//------------------------------------------------------------------------// +// Checks if a given point is clear for occupation. +//------------------------------------------------------------------------// +float(vector spot) EntryPoint_Test = +{ +// Move the dummy to a test point. + setorigin (self, spot); + self.flags = self.flags - (self.flags & FL_ONGROUND); + +// Test the point. + if (self.flags & (FL_FLY | FL_SWIM)) + { + // Note: These only detect walls, not creatures. + if (BoxInWall (self.mins, self.maxs, spot)) + return FALSE; + + if (self.flags & FL_SWIM) + if (pointcontents(spot) > CONTENT_WATER) + return FALSE; // Fish must be in the water. + + // The past two checks look for walls, not creatures. + // This check will hit both walls and creature. +// traceline (spot + self.mins, spot + self.maxs, FALSE, self.owner); +// if (trace_ent) + if (BoxInThing (self.mins, self.maxs, spot, self.owner)) + return FALSE; + } + else + { + droptofloor (); + if (!walkmove (0,0)) + return FALSE; + } + +// Found a viable entry point, so now check if a clear path exists between +// it and its beacon. (If none exists, then skip this check.) + if (self.enemy) + if (EntryPoint_Path ()) + return FALSE; + +// Got one! + return TRUE; +}; + +//------------------------------------------------------------------------// +// Selects one of twelve points equidistant from the beacon. +// +// Used for summoning a monster to its master. +//------------------------------------------------------------------------// +float() EntryPoint_Circle = +{ + if (!self.enemy) + return FALSE; // No beacon. + +// Spawn at one of twelve points around the master. + local float cos0, cos30, cos60; + local vector spot, org; + + org = self.enemy.origin + '0 0 32'; + makevectors (self.enemy.angles); + + // e.g., Human with Draco: 80 + (16 + 32) * 1.25 = 140. + cos0 = 80 + (self.enemy.maxs_x + self.maxs_x) * 1.25; + cos30 = cos0 * 0.866; + cos60 = cos0 * 0.5; + +// First attempt: 12:00. + spot = org + (v_forward * cos0); + if (EntryPoint_Test (spot)) return TRUE; +// Second attempt: 1:00. + spot = org + (v_forward * cos30) + (v_right * cos60); + if (EntryPoint_Test (spot)) return TRUE; +// Third attempt: 11:00. + spot = org + (v_forward * cos30) - (v_right * cos60); + if (EntryPoint_Test (spot)) return TRUE; +// Fourth attempt: 2:00. + spot = org + (v_forward * cos60) + (v_right * cos30); + if (EntryPoint_Test (spot)) return TRUE; +// Fifth attempt: 10:00. + spot = org + (v_forward * cos60) - (v_right * cos30); + if (EntryPoint_Test (spot)) return TRUE; +// Sixth attempt: 3:00. + spot = org + (v_right * cos0); + if (EntryPoint_Test (spot)) return TRUE; +// Seventh attempt: 9:00. + spot = org - (v_right * cos0); + if (EntryPoint_Test (spot)) return TRUE; +// Eigth attempt: 4:00. + spot = org - (v_forward * cos60) + (v_right * cos30); + if (EntryPoint_Test (spot)) return TRUE; +// Ninth attempt: 8:00. + spot = org - (v_forward * cos60) - (v_right * cos30); + if (EntryPoint_Test (spot)) return TRUE; +// Tenth attempt: 5:00. + spot = org - (v_forward * cos30) + (v_right * cos60); + if (EntryPoint_Test (spot)) return TRUE; +// Eleventh attempt: 7:00. + spot = org - (v_forward * cos30) - (v_right * cos60); + if (EntryPoint_Test (spot)) return TRUE; +// Twelth and final attempt: 6:00. + spot = org - (v_forward * cos0); + if (EntryPoint_Test (spot)) return TRUE; + +// Failed. + return FALSE; +}; + +//------------------------------------------------------------------------// +// Selects a random point between a range set by given parameters. +// +// Useful as defense for mages, and as a trick move for bosses. +// Arguments: r = random distance, m = minimum distance. (max = r+m). +//------------------------------------------------------------------------// +float(float r, float m, vector ofs) EntryPoint_Randomize_Ex = +{ + local vector ang; + local vector org; // Original point. + local vector spot; // Potential teleport destination. + local float dist; // Distance from 'org' to new 'spot'. + local float three; // Boolean: 0 = ground only, 1 = three dimension. + local float loop; // Number of attempts before giving up. + + loop = 100; + ang = '0 0 0'; + three = self.flags & (FL_FLY|FL_SWIM); // Three dimensional + org = self.origin; + if (!three) // Now +56, was +32. + org_z = org_z + 56; // Go up slightly in case of sloping ground. + while (loop > 0) + { + dist = random() * r + m; + if (three) + ang_x = random() * (0 - ofs_x); //random() * 360; + if (ofs_z) + { + ang_y = random() * ofs_y; + if (ofs_z > 0) + ang_y = 0 - ang_y; + } + else + ang_y = crandom() * ofs_y; + ang_y = anglemod (self.angles_y + ang_y); //random() * 360; + makevectors (ang); + spot = org + (v_forward * dist); + if (EntryPoint_Test (spot)) + return TRUE; + + loop = loop - 1; + } + return FALSE; +}; + +float(float r, float m) EntryPoint_Randomize = + {return EntryPoint_Randomize_Ex (r, m, VEC_360);}; + +// Selects a random point between close and medium range. +float() EntryPoint_Random = {return EntryPoint_Randomize_Ex (400, 100, VEC_360);}; + +// Selects a random point between mid-close and long range. +float() EntryPoint_LongRandom = {return EntryPoint_Randomize_Ex (600, 250, VEC_360);}; + +float() EntryPoint_Fan = {return EntryPoint_Randomize_Ex (100, 60, '90 60 0');}; +//- - - - - - - - - + +//------------------------------------------------------------------------// +// Selects and tests a single given point. +//------------------------------------------------------------------------// +float() EntryPoint_One = {return EntryPoint_Test (self.origin);}; + +//------------------------------------------------------------------------// +// This spawns a dummy entity to test points its owner may use as a +// spawn point or teleport destination. An entity is needed to check +// if such points are occupied by solids, and it is better to use an +// invisible, intangible dummy than the monster who is to be moved. +// +// 'ent' = Entity to be moved. +// 'targ' = Beacon entity, must have clear path to beacon for success. +// If using summon function, appear somewhere around the beacon. +// 'spot' = Where the entity wants to go. +// 'func' = Function to use when finding a spot. +//------------------------------------------------------------------------// +float(entity ent, entity targ, vector spot, float() func) EntryPoint_Spawn = +{ +// Make a dummy entity to test the entry points so the entity to be +// teleported need not be moved around. + local entity test; + local entity os; // os = old self + local float success; + + test = spawn(); + test.angles = ent.angles; + test.movetype = MOVETYPE_STEP; + test.velocity = '0 0 0'; + test.touch = SUB_Null; + test.solid = SOLID_NOT; + test.owner = ent; // Lets dummy pass through entity at will. + test.enemy = targ; // Beacon entity. + test.flags = ent.flags & (FL_FLY | FL_SWIM); + setmodel (test, ""); // invisible + setsize (test, ent.mins, ent.maxs); + setorigin (test, spot); + +// We are ready to find an entry point. + os = self; + self = test; + success = func (); //EntryPoint_Find (); + self = os; + +// Done testing, so use any found entry point and remove the dummy. + if (success) + setorigin (ent, test.origin); + remove (test); + +// Our work here is done. + return success; +}; + + +//========================================================================== +// Speciality Updates + +//------------------------------------------------------------------------// +// Like EntryPoint_Test, but ignores creatures and beacon LoS. +//------------------------------------------------------------------------// +float() EntryPoint_BossCube = +{ +// Move the dummy to a test point. + setorigin (self, self.origin); + self.flags = self.flags - (self.flags & FL_ONGROUND); + droptofloor (); // Do this even if creature can fly or swim. + +// Test the point. + // Note: These only detect walls, not creatures. + if (BoxInWall (self.mins, self.maxs, self.origin)) + return FALSE; + if (self.flags & FL_SWIM) + if (pointcontents(self.origin) > CONTENT_WATER) + return FALSE; // Fish must be in the water. + // Don't check for creatures because of telefragging. + +// Got one! + return TRUE; +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/drake_cool.qc b/QC_other/QC_keep/drake_cool.qc new file mode 100644 index 00000000..86cd670b --- /dev/null +++ b/QC_other/QC_keep/drake_cool.qc @@ -0,0 +1,822 @@ +// Special effects. Some of which are used by the Bane. + +//========================================================================== +// Shadows + +// Trailing shadows, like Johnny Cage shadow kick, or Akuma teleport. +void() bane_shadow_think = +{ + self.alpha = self.alpha - 0.2; //0.25 + if (self.alpha <= 0.001) + remove (self); + else + self.nextthink = time + 0.1; +}; + +void() bane_shadow = +{ +// Don't leave shadow afterimages if invisible. + if (!self.modelindex) + return; + //if (self.modelindex == mindex_inviso) + //return; + +// Spawn an image. + local entity ent; + + ent = spawn(); + ent.movetype = MOVETYPE_NONE; + ent.velocity = '0 0 0'; + ent.touch = SUB_Null; + setmodel (ent, self.model); + setorigin (ent, self.origin); + ent.solid = SOLID_NOT; + ent.angles = self.angles; + ent.frame = self.frame; + if (self.classname == "monster_bane") + ent.skin = self.skin + 1; // Greyscale version of Bane. + else + ent.skin = self.skin; + if (self.alpha) + ent.alpha = self.alpha; + else + ent.alpha = 1; + ent.think = bane_shadow_think; + SUB_Think (ent, ent.think); +}; + + +//========================================================================== +// Earthquakes + +// Based on Hexen2 earthquake code, modified to behave more like Quoth's. +// Works for me. + +// Hexen2 quakes inflicted the least damage and knockback at the center +// of a quake, and the most at the edge. In Quoth, this is the reverse. +// +// Changed to behave more like Quoth's quake behavior. +// +// More damage at center like in Quoth, reverse of Hexen2. +// + +// Checks if entity is unable to fly. +float(entity ent) Grounded = +{ + if (ent.movetype != MOVETYPE_FLY) + if (ent.movetype != MOVETYPE_NOCLIP) + if (ent.movetype != MOVETYPE_FLYMISSILE) + if (!(ent.flags & FL_FLY)) + if (!ent.wing_finished) // Boots provide stability. + return TRUE; + + return FALSE; // I can fly! +}; + +// Returns TRUE if n = 1,3,6,10,15,etc. +float(float n) Quake_Ping = +{ + local float add, sum; + + if (n > 15) + return FALSE; + + sum = 1; add = 2; + while (sum < n) + { + sum = sum + add; + add = add + 1; + } + return (sum == n); +}; + +void() Quake_Think = [ 0, Quake_Think ] +{ + local entity head; + local vector org, dir; + local float radius; + local float magnitude; // Richter + local float dist; + local float frac; + local float up, upper; + local float damage, dflags; + local float hit_me, hurt_me; + local float dizzy; +// Everyone will have their view shaken. After all, if the very earth +// shakes, the view will shake even if the viewer can remain perfectly still. + +// Flyers and ghosts should be immune to damage. +// Flyers, ghosts, and immobile objects should not be thrown around. +// The blessed may avoid damage and chaos. + + if (self.delay <= time) + { + if (!self.spawnflags) + sound (self, CHAN_VOICE, "misc/quakeend.wav", 1, ATTN_NORM); + remove (self); + return; + } + +// Set damage counters to emulate Quoth's earthquake behavior. +// That is, hit on 1st, 3rd, 5th, 7th, and 9th of the whole quake. +// Update: My method, hit on 1st, 3rd, 6th, 10th, and 15th frames. + hurt_me = FALSE; + self.count = self.count + 1; +// if ((self.count & 1) && (self.count < 10)) // Quoth method. + // My method. + if (!(self.style & DF_NO_KNOCK)) // This line is a hack for gug death. + if (Quake_Ping (self.count)) + hurt_me = TRUE; + +// Damage flags: +// No React - So monsters don't get mad at unknown attacker. +// No Knock - Quake adds velocity, so don't let T_Damage kb stack. + dflags = DF_NO_REACT | DF_NO_KNOCK; + frac = (self.delay - time) / self.wait; // Fraction, from 0 to 1. + radius = self.distance; +// Update: Quake gets weaker in Hexen2. Not in Quoth, and not here. + magnitude = self.dmg; // * frac; + + if (radius) + head = findradius (self.origin, radius); + else + head = findradius (self.origin, 15000); // Pick up everyone! + while (head) + { + if (head.modelindex) + if ((head.solid >= SOLID_TRIGGER) && (head.solid != SOLID_BSP)) + if (head.mass && (head.mass <= MASS_HEAVY)) + { + hit_me = TRUE; + if (head == self.owner) + { if (self.style) // Safe or blessed. + hit_me = FALSE; + } + //else if (self.style & DF_BLESSED) + //{ //if (Ally_Check (head, self.owner)) + // hit_me = FALSE; + //} + + dizzy = TRUE; + if (head.flags & FL_MONSTER) + if (!head.fighting) + dizzy = FALSE; // Don't drift -- take damage only. + + org = Midpoint (head); + if (radius) + dist = 1 - (vlen(self.origin - org) / radius); + else + dist = 1; + upper = 80; // One-tenth of normal gravity. + + // Shake view. Only creatures can see. + if (head.flags & FLx_CREATURE) + { + if (head.classname == "player") + { // FIXME: Cameras in cutscene won't shake. + upper = 100; + // FIXME: Should this vary by magnitude? + head.punchangle_x = crandom() * self.mangle_x; + head.punchangle_y = crandom() * self.mangle_y; + head.punchangle_z = crandom() * self.mangle_z; + // Update 8/2/09: Dampen tilt if enabled. +// DISABLED... for now. +// if (0) +// head.punchangle = head.punchangle * frac; +// if (0) +// head.punchangle = head.punchangle * dist; + } + else if (head.flags & FL_MONSTER) + { + if (dizzy) + if (!IsDead (head)) + { // Mess with their yaw to feign disorientation. + head.angles_y = head.angles_y + (crandom() * 20); + head.angles_y = anglemod (head.angles_y); + // Unlike Hexen2, don't bother with pitch and roll. + } + } + } + + // Check for damage and velocity. Flyers and ghosts are immune, + // as is the attacker and possibly his allies. Swimming in the + // water won't save thee. + if (hit_me) + if (Grounded (head)) + { + damage = magnitude * dist; + + // Inflict damage. If head is not a designated flyer, take + // damage even if not onground so clever players cannot + // escape damage by jumping like a pogo-stick. + // + // Note: Hexen2 had 20% chance per think of inflicting damage. + // In Quoth, quake caused damage up to five times in first sec. + // + // 5/7/2009: Call damage function only if there's damage or + // target is a monster. Monsters may flinch from zero damage, + // and flinching works well for disorientation effects. + if (hurt_me) + if (damage || (head.flags & FL_MONSTER)) + T_Damage (head, self, self.owner, damage, DAMARMOR); + + // Add movement. + // Note: Too much trouble discriminating which objects can be + // moved without problems, so move only creatures for now. + if ((head.flags & FLx_CREATURE) || (head.xf2 & XF2_QUAKE)) + { + if (head.flags & FL_ONGROUND) + { // Bump target up a bit. We need this for players at + // least for impaired movement. Monsters will thump + // a lot, if z is too high, and that sucks. Hmmm... + up = ((random() * 100) + 25) * dist; + if (up > upper) + up = upper; + head.velocity_z = head.velocity_z + up; + } +// if (1) +// { // Move toward/away from epicenter. +// dir = org; +// dir_z = self.origin_z; +// dir = normalize (self.origin - dir); // Toward +// dir = normalize (dir - self.origin); // Away +// } +// else + { // Random drifting. + dir = '0 1 0' * (random() * 360); + makevectors (dir); + dir = v_forward; + } + // dir_z is already 0, so no need for 'dir_z = 0;'. + // Note: vel*25 from Hexen2 is too much, so use *8. + // Update: Monster does not drift if not fighting. + if (dizzy) + head.velocity = head.velocity + (dir * (damage * 8 * random())); + head.flags = head.flags - (head.flags & FL_ONGROUND); + } + } + } + head = head.chain; + } + +// Zer quakes ping once every 0.15 sec, but I'll use standard 10 fps +// in Drake. Quakes in Quoth seem to ping at least as quickly. +// DISABLED -- 10 fps stuff done in anim. macro above. +// self.nextthink = time + 0.1; +}; + +// Note: Quake can ping for 'damage' up to five times if it lasts +// long enough, at least 1.5 seconds. +void(entity attacker, float radius, float damage, vector spot, float dflags, + float secs, vector tilt) Quake_Spawn = +{ + local entity quaker; + local float attn; //, magnitude; + local string dtype; + + radius = fabs(radius); +// magnitude = damage / 5; // Was 'radius / (radius * 5 / damage)'. + if (radius) + { +// Update 5/9/2009: Disabled default damage because we may want none! +// if (damage < 1) +// magnitude = 10; // Default of 50 damage at ground zero. + attn = 1000 / (radius + 200); + if (attn > 4) + attn = 4; // Max allowed by engine. + } + else // Quake hits whole level. + attn = ATTN_NONE; + +// Inflictor is 'self'. If inflictor is attacker, don't harm him. + if (self == attacker) + { + dflags = dflags | DF_SAFE; + dtype = "quake"; + } + else + { // Assume quake was spawned by a missile, so inherit its attack type. + // Watch out for types that cause special deaths, such as fire. + dtype = self.classname; + } + +// Spawn quake entity. + quaker = spawn(); + quaker.movetype = MOVETYPE_NONE; + quaker.velocity = '0 0 0'; + quaker.touch = SUB_Null; + quaker.solid = SOLID_NOT; + quaker.classname= "quake"; + quaker.deathtype= dtype; + quaker.owner = attacker; + quaker.wait = secs; + quaker.delay = time + quaker.wait; + quaker.count = 0; // Make sure it begins at zero. + // FIXME: Expand style? + quaker.style = dflags & (DF_NO_KNOCK | DF_SAFE | DF_BLESSED); + quaker.distance = radius; + quaker.dmg = damage; //magnitude; + quaker.mangle = tilt; + quaker.nextthink= 0.01; + quaker.think = Quake_Think; + quaker.spawnflags = dflags & DF_TIMED; // Silent if true. + setsize (quaker, '0 0 0', '0 0 0'); + setorigin (quaker, spot); + +// Update 4/9/2009: Variable attenuation instead of ATTN_NORM. + if (!quaker.spawnflags) + sound (quaker, CHAN_VOICE, "misc/quake.wav", 1, attn); +}; + +void(float radius, float damage, vector spot, float dflags, float secs) + Quake_Self = + {Quake_Spawn (self, radius, damage, spot, dflags, secs, VEC_QUAKE);}; + +// Standard earthquake attack used by monsters, namely earth baron and gug. +// Note: Gugs cause up to 45-50 damage with each quake. Earth baron, +// as a boss who chooses attacks randomly, does a max of 30 damage per +// quake. 30 damage is what the shambler causes with his lightning if +// it catches a target out in the open. +void(vector spot) Quake_Attack = + {Quake_Self (800, 6, spot, DF_NONE, 3);}; + +// Shake entire level. +void(float damage, vector spot, float secs) Quake_Level = + {Quake_Self (0, damage, spot, DF_NONE, secs);}; + + +//- - - - - - - - - - - - - - - - - - - +// Update 6/4/09: Imported Zerstorer's earthquake trigger entity for +// use in Tronyn's map, toum.bsp. Code was modified and adapted to +// work with the earthquake code above. + +/* ------------------------------ */ +/* | trigger_quake | */ +/* ------------------------------ */ +/*QUAKED trigger_quake (.5 .5 .5) (-8 -8 -8) (8 8 32) NOTOUCH +Starts an earthquake. Players view will shake for amount of time you +put in "wait". Place the richter scale of the quake in the "dmg" field. +It will also trigger all targets like a 'trigger_once'. +*/ + +void() tq_remove = {SUB_UseTargets(); SUB_Remove();}; + +void(entity who) tq_go = +{ + if (who.health <= 0 || who.classname != "player") + return; + +// Use Drake's quake code instead. + Quake_Self (0, 0, VEC_ORIGIN, DF_NONE, self.wait); + tq_remove (); +}; + +void() tq_use = {tq_go (activator);}; +void() tq_touch = {tq_go (other);}; + +void() trigger_quake = +{ + if (deathmatch /*|| coop*/) + { // This will use then remove the quake. + self.think = tq_remove; + self.nextthink = time + 0.2; + return; + } + +// Disabled because sounds were precached by worldspawn already. +// precache_sound ("misc/quake.wav"); +// precache_sound ("misc/quakeend.wav"); + InitTrigger (); + + self.use = tq_use; + if (!(self.spawnflags & 1)) // PM: Added notouch flag. + self.touch = tq_touch; +}; + + +//========================================================================== +// Wrath of God + +// WOG stands for 'Wrath Of God'. +float WOG_DAMAGE = 80; +float WOG_RADIUS = 140; // Should be 'damage+60'. + +// Checks if the sky is above a given point. +float(vector org) UpIsSky = +{ + local float pc; + + traceline (org, org + '0 0 2048', TRUE, world); + pc = pointcontents (trace_endpos); + if (trace_fraction < 1) + return (pc == CONTENT_SKY); + return ((pc == CONTENT_EMPTY) || (pc == CONTENT_SKY)); +}; + +float(entity targ, entity attacker) Divine_Trace = +{ + if (targ.flags & FLx_CREATURE) + if (!targ.deadflag) + if (targ.solid) + if (targ.modelindex) + //if (!Ally_Check (targ, attacker)) +// Replaced 'CanDamage' with an eye-to-eye visibility check. +// if (CanDamage (targ, attacker)) + { + local vector v1, v2; + + v1 = attacker.origin + attacker.view_ofs; + v2 = targ.origin + targ.view_ofs; + traceline (v1, v2, TRUE, attacker); // see through other monsters + if (trace_fraction == 1) + { + if (UpIsSky (targ.origin)) + { + local float dist; + + dist = vlen (targ.origin - attacker.origin); + if (dist >= WOG_RADIUS) + if (dist <= 2000) + return TRUE; + } + } + } + return FALSE; +}; + +// Like CheckPowerups, except this sends a lethal bolt of lightning down +// to 'ent'. +void(entity ent) Divine_Check = +{ + if (ent.divine_finished) + if (ent.divine_finished < time) + { + local entity attacker; + + attacker = ent.divine_attacker; + + ent.divine_finished = 0; + ent.divine_attacker = world; + + if (attacker.divine_hits > 0) + if (Divine_Trace (ent, attacker)) + { // Lightning can hit the target. +/* DISABLED -- (see below) + // This plus ghost touch code causes overflow crash in huge maps + // in FitzQuake and derivatives (e.g., QuakeSpasm). + // + // This would prevent lightning from striking if the blast + // could hit allies. + local entity head; + + head = findradius (ent.origin, WOG_RADIUS); + while (head) + { + if (head != attacker) + if (head.flags & FLx_CREATURE) + if (Ally_Check (head, attacker)) + if (CanDamage (head, ent)) + return; // No friendly fire allowed. + head = head.chain; + } +*/ + // Send the lightning down. Since a diety is attacking on + // behalf of the attacker, damage is indirect, hence proxy flag. + // Update 6/19/2011: Added BLESSED flag to avoid blasting + // allies, since the above ally check has been disabled. + Thunderstrike_Ex (attacker, ent.origin, WOG_DAMAGE, DF_PROXY | DF_BLESSED, "divine"); + LightZero_Set (20, 0, -4); + if (attacker) + attacker.divine_hits = attacker.divine_hits - 1; + } + } +}; + +// Spawns a mini lightning storm. The attacker is 'self'. +// 'shots' = Maximum bolts called down. +// 'dur' = How long the darkness lasts. +float(float shots, float dur) Divine_Wrath = +{ + local entity head; + local float hits; + local vector vx, dir; + + if (!self) + return FALSE; + if (self.flags & FL_CLIENT) + vx = self.v_angle; + else + vx = self.angles; + makevectors (vx); + vx = v_forward; + + hits = 0; + head = nextent (world); + while (head) + { + if (Divine_Trace (head, self)) + { + dir = normalize (head.origin - self.origin); + if (dir * vx > 0.7071) // Must be within fov 90. + { // Send a bolt down. Proxy damage due to divine intervention. + // Note: The latest attacker overrides previous attackers. + head.divine_attacker = self; + head.divine_finished = hits * 0.1 + time; + hits = hits + 1; + } + } + head = nextent (head); + } + if (hits) // Set maximum hits an attacker may score. + { + if (!shots) + shots = 255; + if (!lightzero_finished) + sound (world, CHAN_AUTO, "bane/thunder.wav", 1, ATTN_NONE); + LightZero_Set (-1, dur, -2); + self.divine_hits = shots; // Number of bolts in slam, so match that. + } + + return hits; +}; + +//- - - - - - - - - +// Triggered lightning strikes based on Divine* functions. +void() divine_use = +{ + local entity swap; + local float hits, stop; + + if (self.attack_finished > time) + return; // Previous attack unfinished. + + swap = self; + +// Spawn dummy entity to act as the attacker. +// Dummy is placed where activator is so dummy can see targets. + self = spawn(); + //self.alignment = activator.alignment; // Don't hit activator. + self.angles = activator.angles; // Use to find activator's targets. + setorigin (self, activator.origin); + hits = Divine_Wrath (swap.cnt, 1); + stop = time + 0.2 + (hits * 0.1); + if (hits) + { // Lightning strike is delayed, so delay dummy removal. + self.nextthink = stop; + self.think = SUB_Remove; + } + else + { // No lightning strikes, so just flash and thunder ominously. + sound (world, CHAN_AUTO, "bane/thunder.wav", 1, ATTN_NONE); + LightZero_Set (LIGHTZERO_MAX, 0, -4); + remove (self); + } + +// Restore self. + self = swap; + self.attack_finished = stop; + +// Now function like trigger_relay. + SUB_UseTargets (); +}; + +void() trigger_smite = +{ + precache_sound ("bane/thunder.wav"); + precache_sound ("hipweap/mjolhit.wav"); + + self.attack_finished = 0; + if (!self.cnt) + self.cnt = 1; + self.use = divine_use; +}; +//- - - - - - - - - + + +//========================================================================== +// Thunderstorm + +// DISABLED! -- Code for Bane-style storms usable by players. +//.entity stormed; // Storm's current target saved by attacker. + +// Sets storm's next target. +//entity(entity attacker) Storm_NextEnemy = +//{ +// local entity targ; +// +// targ = nextent (attacker.stormed); +// if (!targ) +// targ = nextent (world); +// attacker.stormed = targ; +// do +// { +// if (Divine_Trace (targ, attacker)) +// {attacker.stormed = targ; return targ;} +// targ = nextent (targ); +// if (!targ) +// targ = nextent (world); +// } while (targ != attacker.stormed); +// +// return world; +//}; + +// Updates thunderstorm's targeting data. +void() bane_storm_target = +{ +// if (self.owner.classname == "player") +// self.enemy = Storm_NextEnemy (self.owner); +// else + { // Monsters cycle through their known enemies. + if (self.enemy == self.owner.enemy) + { if (self.owner.oldenemy) + self.enemy = self.owner.oldenemy; + } + else + self.enemy = self.owner.enemy; + } + self.dest = self.enemy.origin; +}; + +void() bane_storm_end = +{ + if (self.owner) + if (self.owner.owner == self) + self.owner.owner = world; + self.owner = world; + SUB_Remove (); +}; + +void() bane_storm1 =[ 0, bane_storm2 ] {self.nextthink = time + 0.3;}; +void() bane_storm2 =[ 0, bane_storm3 ] {self.nextthink = time + 0.4; self.dest = self.enemy.origin;}; +void() bane_storm3 =[ 0, bane_storm4 ] { + // Abort if spellcasting was interrupted. + if (( self.owner.frame <= self.waitmin ) || ( self.owner.frame >= self.waitmax ) ) + {self.think = bane_storm_end; return;} +}; +void() bane_storm4 =[ 0, bane_storm5 ] +{ +// First, check if we should even call an airstrike. + local float zot; + + zot = FALSE; + if (self.enemy) + { + local vector p1, p2; + +// if (self.ryuflags & RYU_ALERT) +// self.dest = self.enemy.origin; + + if (UpIsSky (self.dest)) + zot = TRUE; + else + { // Under shelter, so find another point nearby that isn't. + local float loop; + + loop = 5; + p1 = self.dest; + while (loop > 0) + { + loop = loop - 1; + p1_x = crandom() * 256 + self.dest_x; + p1_y = crandom() * 256 + self.dest_y; + traceline (self.dest, p1, TRUE, self); + if (trace_fraction >= 1.0) + if (UpIsSky (p1)) + {self.dest = p1; zot = TRUE; loop = 0;} + } + } + // Note: Bane can't hurt himself with Tstorm. + if (self.owner) + if (self.owner.classname != "monster_bane") + { + p1 = self.owner.origin; + p2 = self.dest; + p2_z = p1_z; + if (vlen(p2 - p1) < (self.dmg + 60)) //Was 150. + zot = FALSE; // Too close. + } + } + +// Now start for real. + self.cnt = self.cnt - 1; + if (zot) + { + LightZero_Set (16, self.delay, 0); + Thunderstrike (self.owner, self.dest, self.dmg); + self.pain_finished = time + 3; + } + else + { // No bolt -- just flash and thunder. + zot = random(); + if (zot < 0.5) + zot = 0.5; + else + LightZero_Set (13, self.delay, 0); + if (random() < 0.5) + sound (self, CHAN_AUTO, "ambience/thunder1.wav", zot, ATTN_NONE); + else + sound (self, CHAN_AUTO, "ambience/thunder2.wav", zot, ATTN_NONE); + self.pain_finished = time + 5; + } + bane_storm_target (); + self.attack_finished = time + self.delay; +}; +void() bane_storm5 =[ 0, bane_storm6 ] {LightZero_Set (12, self.delay, -4); self.nextthink = self.attack_finished;}; +void() bane_storm6 =[ 0, bane_storm_end ] +{ + if (self.owner.deadflag >= DEAD_DEAD) + return; // Spell is broken. + + if (self.cnt > 0) + { + local float abort; + + abort = FALSE; + if (random() < self.volume) + abort = TRUE; + if (!self.enemy) + if (self.pain_finished > time) + abort = TRUE; + + if (abort) + { + LightZero_Set (-1, self.delay, -4); + self.cnt = self.cnt - 1; + self.think = bane_storm6; + self.nextthink = time + self.delay; + bane_storm_target (); + } + else + bane_storm4 (); + } +}; + +void(float frmin, float frmax) bane_storm = +{ + local entity magic; + +// FIXME: Check if 'self' already has a storm active. + magic = spawn(); + setorigin (magic, self.origin); // Sound comes from here. + magic.nextthink = self.nextthink; // Synch with sword chop anim. + magic.think = bane_storm1; + + magic.owner = self; + magic.enemy = self.enemy; + magic.delay = 0.5; // Delay between strikes. + magic.cnt = 6; // Max number of zaps. Each is 0.5 sec apart. + magic.dmg = 80; // Used to be 90. + magic.classname = "lightning"; + magic.waitmin = frmin; + magic.waitmax = frmax; + magic.volume = 0.5; // 50% chance of no bolt after the first. + sound (magic, CHAN_AUTO, "bane/thunder.wav", 1, ATTN_NONE); + magic.pain_finished = time + 3; + magic.attack_finished = 0; + + if (self) + self.owner = magic; + + LightZero_Set (-1, 1, -1); +}; + +float() bane_has_storm = +{ + if (self.owner) + { + if (self.owner.owner == self) + return TRUE; + // ELSE ... entity is probably a clone and got it from its parent. + } + return FALSE; +}; + +/* DISABLED! -- Old storm proc. +// Checks if 'self' can activate a thunderstorm. Used by clients wielding +// the Mjolnir. Also activated by storm cheat. +float() ActivateThunderStorm = +{ + if (!self.owner) + { + local entity e; + + e = nextent (world); + while (e) + { // If even one target is found, start the storm. + if (Divine_Trace (e, self)) + { + bane_storm (-1, 256); // Uninterruptable storm. + if (self.flags & FL_CLIENT) + { + self.owner.enemy = Storm_NextEnemy (self); + self.owner.cnt = 10; // Override default of 6. + self.owner.ryuflags = RYU_ALERT; // Perfect accuracy. + } + return TRUE; + } + e = nextent (e); + } + } + return FALSE; +}; +*/ \ No newline at end of file diff --git a/QC_other/QC_keep/drake_fire.qc b/QC_other/QC_keep/drake_fire.qc new file mode 100644 index 00000000..9d3a9d27 --- /dev/null +++ b/QC_other/QC_keep/drake_fire.qc @@ -0,0 +1,1489 @@ +//========================================================================== +// Frame Data + +// Frame Macros for modified 'flame2.mdl'. +$cd id1/models/flame2 +$origin 0 0 12 +$base base +$skin skin + +// These are grouped scenes. +$frame flame +$frame flameb +// Next one is the firewall. Added for SoE's hell lord. +$frame flamec + +// These scenes are not grouped. +$frame ember1 ember2 ember3 ember4 ember5 ember6 + + +void(float ents) Ember_Shower; + +//========================================================================== +// Animation + +//============ +// Flame animation on modified 'flame2.mdl'. +//============ +void() m_ember1 =[ $ember1, m_ember2 ] {}; +void() m_ember2 =[ $ember2, m_ember3 ] {}; +void() m_ember3 =[ $ember3, m_ember4 ] {}; +void() m_ember4 =[ $ember4, m_ember5 ] {}; +void() m_ember5 =[ $ember5, SUB_Remove ] {}; +//============ + +// This makes flaming embers rise from the burning victim 'ent'. +void(entity ent) MakeFlame = +{ + local entity fire; // The new fire that will be created. + local vector spot; // The spot where the new fire will appear. + local float r; + + // Used to be in a loop. + spot = ent.size * 0.5; + spot_x = spot_x * (random() - 0.5); + spot_y = spot_y * (random() - 0.5); + spot_z = spot_z * (random() - 0.5); + spot = spot + Midpoint (ent); + + // Create the fire. + fire = spawn(); + + fire.frame = $ember1; + fire.solid = SOLID_NOT; + fire.takedamage = DAMAGE_NO; + fire.movetype = MOVETYPE_FLY; + fire.velocity = '0 0 100'; + fire.owner = ent; + + setall (fire, "progs/drake/flame2.mdl", '0 0 0', '0 0 0', spot); + + // Animate the flame. + r = random() * 3; + if (r > 2) + SUB_Think (fire, m_ember3); + else if (r > 1) + SUB_Think (fire, m_ember2); + else + SUB_Think (fire, m_ember1); +}; + +// This creates a small puff of smoke. +void(vector spot, float density) MakeSmoke = +{ + particle (spot, '0 0 100', 1, density); +}; + + +//========================================================================== +// Delayed Fire Damage + +//- - - - - - - - - +// Thinking for the delayed damage entity spawned by 'BecomeBigBang'. +void() DelayedFireDamage_Think = +{ + T_RadiusDamage (self, self.master, self.dmg, world, DAMAGEALL); + self.count = self.count - 1; + if (self.count > 0) + self.nextthink = time + 0.2; + else + remove (self); +}; + +// Spawn a separate entity for delayed damage so that I don't need to clog +// the generic explosion code or write yet another special explosion scene. +void(entity attacker, vector spot, float damage, float dflags, string dtype) + DelayedFireDamage_Spawn = +{ + local entity fire; + local float radius, attn; + + if (!damage) + damage = 60; // High enough damage near big fireball sprite. + radius = 100; + attn = damage / radius; + if (attn > ATTN_DAMAGE) + attn = ATTN_DAMAGE; + + fire = spawn(); + fire.master = attacker; //self.master; + fire.classname= dtype; //self.classname; + fire.movetype = MOVETYPE_NONE; + fire.velocity = '0 0 0'; + fire.touch = SUB_Null; + fire.solid = SOLID_NOT; + fire.style = DF_ROCKET | DFx_FIREBALL | dflags; + fire.count = 3; + fire.dmg = damage; + fire.distance = radius; + fire.volume = attn; + fire.nextthink= time + 0.1; + fire.think = DelayedFireDamage_Think; + setall (fire, "", '0 0 0', '0 0 0', spot); //self.origin); +}; +//- - - - - - - - - + +void() BecomeBigBangExplosion = +{ + // Make a small flame cloud to make explosion look bigger. + if (coop || deathmatch) + Ember_Shower (5); // Make fewer embers in netgames. + else + Ember_Shower (10); + + Rocket_Explosion1 (self.origin); + FlameWave (); + BecomeTheBigFire (); // Was BecomeExplosion. +}; + +// This creates a bigger fiery explosion like the one in the game Blood. +void() BecomeBigBang = +{ + local float dflags; + + dflags = 0; //self.style & (DF_SAFE|DF_BLESSED); + +// Delayed damage effects. +// Note: A 0.8 sec quake pings for damage three times. + DelayedFireDamage_Spawn (self.master, self.origin, self.dmg / 3, dflags, self.classname); + Quake_Spawn (self.master, self.dmg + 60, 5, self.origin, dflags, 0.8, VEC_QUAKE); + +// The rest of the explosion effect. + BecomeBigBangExplosion (); +}; +//- - - - - - - - - + +// Spawns a huge fiery explosion at a point. +// 'dmg1' = Explosion damage. +// 'dmg2' = Secondary fire damage. Pings multiple times. +void(entity attacker, vector spot, float dmg1, float dmg2, + float dflags, string dtype) Fireworks = +{ + local entity fire; + local float rflags; + + rflags = DF_ROCKET | DFx_FIREBALL | (dflags & (DF_SAFE|DF_BLESSED)); + + fire = spawn (); + fire.master = fire.owner = attacker; + fire.movetype = MOVETYPE_NONE; + fire.solid = SOLID_NOT; + fire.classname = dtype; //"fire"; + setorigin (fire, spot); + + T_RadiusDamage (fire, attacker, dmg1, world, DAMAGEALL); + + sound (fire, CHAN_AUTO, "nemesant/bigboom.wav", 1, ATTN_NORM); + + DelayedFireDamage_Spawn (attacker, spot, dmg2, dflags, dtype); + Quake_Spawn (self, dmg1 + 60, 5, fire.origin, dflags, 0.8, VEC_QUAKE); + SUB_Think (fire, BecomeBigBangExplosion); +}; + + +//========================================================================== +// Explosion Effects + +// Checks if a given point in space is in water. +float(vector spot) VecInWater = {return (pointcontents(spot) <= CONTENT_WATER);}; + +// This enforces air resistance on embers and updates their angles. +// NOTE: Modified flame has ember scene; frames start at 2, ends at 7. +void() Ember_Think =[ $ember1, Ember_Think ] +{ + if (self.delay <= time) + { + if (self.walkframe >= 5) + {remove (self); return;} + self.walkframe = self.walkframe + 1; + } + self.frame = $ember1 + self.walkframe; + + local vector dir; + + // Update angles to its current direction. + dir = normalize (self.velocity); + self.angles = vectoangles(dir) + '90 0 0'; + + // Cheap hack -- apply air resistance by reducing velocity. + self.velocity = self.velocity * 0.75; +}; + +// Variant of Ember_Think. Used for smoke trail entities. +void() Smoke_Think =[ 0, Smoke_Think ] +{ + if (self.delay <= time) + {remove (self); return;} + + // Cheap hack -- apply air resistance by reducing velocity. + self.velocity = self.velocity * 0.75; +}; + +// Throws a shower of embers from 'self'. +void(float ents) Ember_Shower = +{ + local entity fire; + local vector dir; + local float loop; + + loop = ents * 6; + while (loop > 0) + { + // Get initial direction. + dir_x = (random() - 0.5) * 180; + dir_y = random() * 360; + dir_z = 0; + makevectors (dir); + dir = v_forward; + + traceline (self.origin, self.origin + dir*64, FALSE, other); + if (trace_fraction == 1.0) + { + // Ember will not impact the wall immediately. + fire = spawn(); + //- - - - - - - - - + fire.walkframe = random() * 2 + 2.5; //4.5; + fire.walkframe = floor(fire.walkframe); + + fire.frame = $ember1 + fire.walkframe; + fire.think = Ember_Think; + //- - - - - - - - - + fire.solid = SOLID_BBOX; + fire.movetype = MOVETYPE_TOSS; + fire.owner = other; + + fire.velocity = dir * (200 + random() * 800); + fire.angles = vectoangles(dir) + '90 0 0'; + + fire.delay = time + 0.5 + random(); // Time when it fades. + + fire.touch = SUB_Remove; + fire.nextthink = time + 0.1; + + setall (fire, "progs/drake/flame2.mdl", '0 0 0', '0 0 0', self.origin); + + ents = ents - 1; + if (ents <= 0) + return; + } + + loop = loop - 1; + } +}; + +// Spawns an ember and smoke in most of its think frames. +void() Smokey_Think = +{ + if (self.wait > time) + if (self.enemy.modelindex) + { + // Make a thin trail of smoke above the flame, plus a few embers. + local float ftime; + + ftime = floor(time * 10); + if (ftime & 1) + { + local vector spot; + + spot = Midpoint (self.enemy); + MakeSmoke (spot, 5); + if (ftime & 2) + {if (!VecInWater (spot)) MakeFlame (self.enemy);} + } + self.nextthink = time + 0.1; + return; + } + remove (self); +}; + +// This creates an entity that produces smoke and a few embers around +// a given target 'ent'. Used on targets that die from burning. +void(entity ent) Smokey = +{ + // Create the fire. + newmis = spawn(); + + newmis.solid = SOLID_NOT; + newmis.takedamage = DAMAGE_NO; + newmis.enemy = ent; + newmis.wait = time + 1 + random() * 2; + newmis.nextthink = 0.01; + newmis.think = Smokey_Think; + + setall (newmis, "", '0 0 0', '0 0 0', VEC_ORIGIN); +}; + + +//========================================================================== +// Burn Control + +// Constants. (Update 5/30/09: Moved to defs.) + +//------------------------------------------------------------------------// +// This checks if 'ent' is on fire and burning. +// Note: world.burner should return FALSE, so don't check ent == world. +//------------------------------------------------------------------------// +float(entity ent) IsBurning = {if (ent.burner) return TRUE; return FALSE;}; + +//------------------------------------------------------------------------// +// This extinguishes the fire burning on a player (or other entity). +// This function should be called whenever the fire burning on an +// entity must be removed immediately. +// +// Examples who and when this should be called for: +// * All players (and their minions) when the level ends. +// * Anytime a player respawns after dying (from the 'kill' command). +// +// Assumptions (i.e., leaps of faith): +// * If ent == world, then ent.burner is always world (FALSE). +// * If ent.burner is not the world, then ent.burner really is a flame. +// If not, bad things will likely happen. +// +// Update: Since burning is back to the old Napalm style, always use +// this function to remove any flame pointed by ent.burner. +//------------------------------------------------------------------------// +void(entity ent) Burn_Null = +{ + if (ent.burner) + { // Note: non-zero cnt means flame is underwater. + if (ent.modelindex && !ent.burner.cnt) + { // Transform flame into a small explosion. + ent.burner.effects = EF_MUZZLEFLASH; // No more dynamic light. + SUB_Think (ent.burner, BecomeExplosion); + } + else + { // Disappear right now. + remove (ent.burner); + } + ent.burner = world; + } +}; + +//------------------------------------------------------------------------// +// Returns the point where a flame should burn (hopefully on its target). +//------------------------------------------------------------------------// +vector(entity ent) Burn_Point = +{ + if (ent.view_ofs_z) + { + makevectors (ent.angles); + if ((ent.burn_ofs_x) || (ent.burn_ofs_z)) + return ent.origin + (v_forward*ent.burn_ofs_x) + (v_up*ent.burn_ofs_z); + else + return ent.origin + (v_forward*4) + (v_up*16); + } + return Midpoint (ent); // Some entities have origin at 0,0,0. +}; + +//------------------------------------------------------------------------// +// Checks if ent is immune to burning. +// IMPORTANT NOTE: Burn immunity is NOT the same as fire immunity. +//------------------------------------------------------------------------// +float(entity ent) Burn_Not = +{ + if (!ent.modelindex) + return TRUE; // Treated as non-existant. + if (!ent.takedamage) + return TRUE; // This includes head gibs and mega-enforcer shields. + //if (ent.resist_fire >= 1) + // return TRUE; // Immune to fire. +// Items that prevent burning. + if (ent.invincible_finished) + return TRUE; + if (ent.radsuit_finished) + return TRUE; + if (ent.cross_finished) // Update 1/6/10: Cross added. + return TRUE; +//- - - - - - - - - - - - - - + if (ent.solid == SOLID_BSP) + return TRUE; // Flames don't look good on these ents. + if (ent.xfl & XFL_NO_BURN) + return TRUE; // Immunity flag. + + return FALSE; +}; + +//------------------------------------------------------------------------// +// This checks if the death flame should stop burning. +//------------------------------------------------------------------------// +float() DeathFlame_End = +{ + if (self.owner.deadflag >= DEAD_DEAD) + return TRUE; // Stop burning once the enemy is really dead. + // If solid-only burn is on, then stop once enemy becomes non-solid. + if (self.style) + { + if (self.style != self.owner.modelindex) + return TRUE; + } + else if (self.owner.solid == SOLID_NOT) + return TRUE; + + return FALSE; // Keep on burning. +}; + +//------------------------------------------------------------------------// +// This checks if the fire should shed light. +// +// Dynamic lights slow Quake like nothing else, so turn off the flame's +// light if the entity burning has light of its own, or turn on the +// light if the entity has none. +// +// Also, Quake has an upper limit for dynamic lights -- exceed it and +// the game will crash. +//------------------------------------------------------------------------// +void() Burn_Light = +{ +// Don't shed light if the target is shedding light of its own. + if (self.owner.effects & (EF_DIMLIGHT | EF_BRIGHTLIGHT)) + self.effects = self.effects - (self.effects & EF_DIMLIGHT); + else + self.effects = self.effects | EF_DIMLIGHT; +}; + +//------------------------------------------------------------------------// +// This makes the fire cause damage to whom it burns. +//------------------------------------------------------------------------// +void() Burn_Burn = +{ + Burn_Light (); // Control flame's dynamic light. + if (self.delay <= time) + { // Burn the target. + local float damage; + local entity targ; + + targ = self.owner; + damage = BURN_PER_SECOND; + if (damage > self.dmg) + damage = self.dmg; + + if (damage > 0) // Negative damage prevention. + { + if (targ.health > 0) // Don't let burn damage gib the dead. + { + // Update 5/13/10: More damage to zombies to overcome regeneration. + local float burn; + + burn = damage; + if (targ.xfl & XFL_ZOMBIE) + burn = burn + 2; // Overcome regeneration. + T_Damage (targ, targ, self.master, burn, DAMARMOR); + } + // Note: Negative radius for the constant damage. + T_RadiusDamage (self, self.master, damage, self.owner, DAMAGEALL); + } + + // Subtract from total... after the damage is done because I want + // the pain sounds done first before tampering with the flame. + if (!self.deadflag) + { + self.dmg = self.dmg - damage; + if (self.dmg < 1) + {Burn_Null (targ); return;} + } + // The fire can burn again after a moment. + // Note: findradius is called once per burning entity, and that + // can mean many times in horde combat scenarios. To minimize + // frequent calling, inflict damage once every second, much like + // slime bathing, even though I wanted more frequent calls. + self.delay = time + 1; + } +}; + +//------------------------------------------------------------------------// +// This rather large function is responsible for updating flame status. +// It checks if the flame should be snuffed. If not, this also moves +// said flame on its target and checks for damage. +//------------------------------------------------------------------------// +void() Burn_Think = +{ + local entity targ; + local vector spot; + local float pc; + + targ = self.owner; + if (!targ) + {remove (self); return;} + if (targ.burner != self) // This should not happen. + {Burn_Null (targ); return;} + +// From here on in either mode, the flame goes through a four step process: +// * Check for flame removal. +// * Move the flame so that it sticks to its target. +// * Pick behavior based on its new location (e.g., water snuffs most fires). +// * If flame is still burning, check for damage to targets. + if (self.deadflag) + { // Death mode uses different burn rules. + if (DeathFlame_End ()) + { // Done burning. + if (self.model != self.mdl) + self.cnt = 1; // Flame disappears instead of exploding. + Smokey (targ); + Burn_Null (targ); + return; + } + + // Make the flame stick to its target. + spot = Burn_Point (self.owner); + setorigin (self, spot); + + // Enemy is already dead so damaging it is unnecessary. + // Flame has different effects depending on its contents. + if (VecInWater (spot)) + { // Hide the flame and make more steam in its place. + // Think of it as a fire so hot even water can't snuff it fully. + if (self.model == self.mdl) + { + setmodel (self, ""); + sound (self, CHAN_AUTO, "player/slimbrn2.wav", 1, ATTN_NORM); + } + MakeSmoke (spot, 50); + } + else + { // Flame is not in the water. + if (self.model != self.mdl) + { // Flare back up. + MakeExplosion (spot); + setmodel (self, self.mdl); + } + Burn_Burn (); + } + } + else + { // Standard burn mode. +//- - - - - - - - - +// If enemy is dead, snuff current flame and drop a smaller, fullbright +// flame that does not shed light. The reason for doing this is because +// the big flame sheds light, and few if anything can slow down Quake as +// much as excessive dynamic lighting. So in the interest of good gameplay, +// remove big flames once the enemy dies. +// +// Update: Dropping flames are gone because, after a kill, aggressive +// players could collide with the flame before it could hit the ground +// and, as a result, take unnecessary damage. Instead, a smoker entity +// bound to a slain entity puffs smoke and a few embers for a second or two. +//- - - - - - - - - + if (targ.health < 1) + {Smokey (targ); Burn_Null (targ); return;} + + // Check if the flame should be snuffed. + if (self.dmg < 1) + {Burn_Null (targ); return;} // Out of fuel. + if (Burn_Not (targ)) + {Burn_Null (targ); return;} + + spot = Burn_Point (targ); + setorigin (self, spot); // Move the flame. + + // Check if flame is in the water. + pc = pointcontents (spot); + if (pc <= CONTENT_WATER) + { // Flame was submerged under some liquid so remove it now. + // In water or slime, make some steam too. In lava or sky, + // just disappear. + self.cnt = 1; // Flame disappears instead of exploding. + Burn_Null (targ); // Sever link between flame and its victim. + if (pc >= CONTENT_SLIME) + { + sound (targ, CHAN_AUTO, "player/slimbrn2.wav", 1, ATTN_NORM); + MakeSmoke (spot, 50); + } + return; + } + + // Keep on burning. + Burn_Burn (); + } + self.nextthink = time + 0.100; +}; + +//------------------------------------------------------------------------// +// This keeps the fire on an entity burning. +//------------------------------------------------------------------------// +void(entity ent) Burn_Check = +{ + if (ent.burner) + SUB_Think (ent.burner, Burn_Think); +}; + +//------------------------------------------------------------------------// +// This spawns a large flame on the entity to burn. +// Should only be called by 'Burn_Add' or 'Burn_Killer'. +//------------------------------------------------------------------------// +void(entity victim, entity attacker, float damage) Burn_New = +{ + local vector spot; + + if (!victim) + return; // Don't try to burn the world. + if (victim.burner) + return; // Already burning. + + if (damage) + { // Assume normal mode -- called by 'Burn_Add'. + if (victim.health <= 0) + return; // Dead! Don't add more dynamic light to slow game. + if (Burn_Not (victim)) + return; // Target can't ignite, so stop. Assumes Napalm + // (one of my old QC mods) style burns. + spot = Burn_Point (victim); + if (VecInWater (spot)) + return; // Flame will be out as soon as it spawns, so abort. + + if (victim.flags & FL_CLIENT) // Hack: Reset pain for players + victim.pain_finished = 0; // so they can scream now. + } + else + { // Assume death mode -- called by 'Burn_Killer'. + spot = Burn_Point (victim); + } + + MakeExplosion (spot); // Flare up with a bang. + +// Spawn burner entity. + newmis = spawn(); + newmis.solid = SOLID_NOT; + newmis.takedamage = DAMAGE_NO; + newmis.frame = $flameb; // Use a *big* flame. + newmis.effects = EF_DIMLIGHT; + newmis.master = attacker; + newmis.owner = victim; + newmis.classname = "fire"; + newmis.delay = time + 1; + newmis.dmg = damage; // Initial damage. + newmis.nextthink = 0.01; + newmis.think = Burn_Think; + setall (newmis, "progs/drake/flame2.mdl", '0 0 0', '0 0 0', spot); + // Added the following to differentiate between normal and death modes. + newmis.mdl = newmis.model; // Only used by death mode code. + newmis.style = 0; // Ditto, once again. + newmis.deadflag = 0; // Use standard burn rules. + +// Link target to the fire. + victim.burner = newmis; +}; + +//------------------------------------------------------------------------// +// This sets the victim on fire by adding burn damage. +// +// Update: Flames do not stack, so if the victim is already burning, +// keep the longer burning fire only. I made the change so I can have +// flames that can spread to others yet not sustain each other +// indefinitely. This style is similar to the Rabies skill in Diablo II. +//------------------------------------------------------------------------// +void(entity victim, entity attacker, float burn) Burn_Add = +{ + // Check for fire immunity. + if (!victim.takedamage) + return; // Immune to damage. + if (burn < 1) + return; // No fuel. + + if (victim.burner) + { + if (victim.burner.deadflag) + return; // In death mode, so do nothing. + if (burn < victim.burner.dmg) + return; // New fire doesn't last as long, so ignore it. + + if (victim.burner.master != attacker) + { // New attacker steals the old fire. + MakeExplosion (victim.burner.origin); + victim.burner.master = attacker; + } + victim.burner.dmg = burn; + } + else + { // Victim is not on fire, so set him alight. + Burn_New (victim, attacker, burn); + if (!victim.burner) + return; // Failed to ignite target. + } +}; + +//------------------------------------------------------------------------// +// This spawns a large burning flame on a dying target. This should +// be called ONLY from the target's 'th_die()' function. +// +// NOTE: Assumes 'self' == dying victim to be burned! +//------------------------------------------------------------------------// +void() Burn_Killer = +{ + local entity fire; // The flame entity to be used. + + if (self.burner) + { // Flame already exists so use that. + fire = self.burner; + if (fire.deadflag) + return; // Already set up. + fire.master = self.enemy; // Set by 'Killed' to victim's slayer. + } + else + { // Spawn a new flame. + Burn_New (self, self.enemy, 0); + fire = self.burner; + if (!fire) + return; // Failed to spawn. + } +// Properties common to new or borrowed flames. + fire.deadflag = 1; + fire.dmg = MAX_BURN_DAMAGE; + if (self.solid == SOLID_NOT) + fire.style = self.modelindex; +}; + + +//========================================================================== +// Fireballs + +// NOTE: Fireballs are flames turned on its side. In the official +// GLQuake, this results in a shadow cast somewhere in the air. +// +// One solution would be to add a fireball scene. However, that causes +// animation problems for embers in source ports that support frame +// interpolation. In addition, some of the source ports don't let +// flames cast shadows (which is good). Hence, no fireball scene. +// +// Update: Some ports automatically substitute 'flame2.mdl' with +// other non-model graphics (decals?), and the projectiles appear more +// like long flame trails, which look really bad. Therefore, allow +// the option for alternate fireball models. Such models do not look +// good in vanilla GLQuake or some other ports, but it's better than +// nothing. + +float FIREBALL_RADIUS = 70; + +//------------------------------------------------------------------------// +// This creates steam that has the same velocity of the fireball that +// spawned it. +//------------------------------------------------------------------------// +void(entity fire) Fireball_Steam = +{ + local float sped; + local vector vel; + + sped = vlen (fire.velocity) * 0.01; + vel = normalize (fire.velocity) * sped; + + sound (fire, CHAN_AUTO, "player/slimbrn2.wav", 1, ATTN_NORM); + particle (fire.origin, vel, 1, 50); +}; + +//------------------------------------------------------------------------// +// Check if fireball is in the water and if so remove it. +// Returns TRUE if fireball was removed. +//------------------------------------------------------------------------// +float(entity fire) Fireball_InWater = +{ + local float pc; + + pc = pointcontents (fire.origin); + if (pc <= CONTENT_WATER) + if (pc != CONTENT_SKY) // 8/24/09: So fire can rain from the sky. + { + if ((pc == CONTENT_WATER) || (pc == CONTENT_SLIME)) + Fireball_Steam (fire); + remove (fire); + return TRUE; + } + return FALSE; +}; + +//------------------------------------------------------------------------// +// This is the end of a fireball's think phase. +//------------------------------------------------------------------------// +void() Fireball_EndFrame = +{ + if (Fireball_InWater (self)) + return; + + // Check if flame should burn things near it. + if (self.wait) + if (self.wait <= time) + { // Burn nearby enemies. + //- - - - - - - - - - + // This is so dragons don't hurt themselves with their own flames. + // Works for players with dragonscale and monsters alike. + local entity ignore; + + //if (self.owner.resist_fire > 0) + // ignore = self.owner; + //else + ignore = world; + //- - - - - - - - - - + // Note: It's a tiny flame so just do damage, nothing fancy. + // Note#2: Negative radius for the constant damage. + T_RadiusDamage (self, self.owner, 1, ignore, DAMAGEALL); + self.wait = time + random(); + } + + // Fire is still burning, check again on the next frame. + self.nextthink = time + 0.1; +}; + +//------------------------------------------------------------------------// +// This checks when to put out the fire. The fire is put out when +// the burning entity finds water or when the fire is done burning. +//------------------------------------------------------------------------// +void() FloorFire_Think = +{ + if (self.delay <= time) + { // The fire burns itself out after a period of time. + MakeSmoke (self.origin, 50); + remove (self); + return; + } + Fireball_EndFrame (); +}; + +//------------------------------------------------------------------------// +// Spawns a small flame that burns on the ground, if there is ground. +// If no ground is found, no flame is spawned. Mostly for show. +// Can inflict minor damage to those standing near the flame. +//------------------------------------------------------------------------// +void(entity attacker, entity victim, vector spot) FloorFire = +{ + local entity swap; + + swap = self; + self = spawn(); + self.movetype = MOVETYPE_TOSS; + self.solid = SOLID_NOT; + self.owner = victim; // Use 'world' to hit anything. + setall (self, "", '0 0 0', '0 0 0', spot); + if (droptofloor ()) + { + self.classname = "fire"; + self.angles = '0 0 0'; + self.velocity = '0 0 0'; + self.owner = + self.master = attacker; // Remember who really owns the flame. + self.delay = random() * 3 + 2 + time; + self.wait = + self.nextthink = 0.01; + self.think = FloorFire_Think; + setall (self, "progs/drake/flame2.mdl", '-4 -4 -12', '4 4 16', self.origin + '0 0 12'); + } + else + { + remove (self); + } + self = swap; +}; + +//------------------------------------------------------------------------// +// This checks if a flame should drop after a fireball impact. +//------------------------------------------------------------------------// +float(entity fire, float chance) FloorFire_ZoneCheck = +{ + if (random() < chance) + { + if (VecInWater (fire.origin)) + return FALSE; // Don't drop underwater. + + // Drop flame if it is not inside or directly above the owner. + local entity ent; + local vector spot; + + ent = fire.owner; + spot = fire.origin; + + // Fire is 4 wide, plus 16 for possible missile clip bouns. + if (spot_x > (ent.absmax_x + 21)) return TRUE; + if (spot_y > (ent.absmax_y + 21)) return TRUE; + if (spot_x < (ent.absmin_x - 21)) return TRUE; + if (spot_y < (ent.absmin_y - 21)) return TRUE; + if (spot_z < (ent.absmin_z - 21)) return TRUE; + } + + return FALSE; +}; + +//------------------------------------------------------------------------// +// This checks if a fireball impacts the floor. +//------------------------------------------------------------------------// +float() FloorFire_FloorCheck = +{ + local vector p1, p2, vel; + local float dot; + + vel = normalize (self.velocity); + p1 = self.origin; + p2 = p1 + (vel * 64); + traceline (p1, p2, TRUE, world); + vel = trace_plane_normal; + dot = vel * '0 0 1'; + + return (dot > 0.7071); // Pass only if slope is less than 45 degrees. +}; + +//------------------------------------------------------------------------// +// Attempts to spawn a small flame on the ground. Called by fireballs' +// touch functions. +//------------------------------------------------------------------------// +void(entity fire, float chance) FloorFire_SpawnCheck = +{ + if (FloorFire_ZoneCheck (fire, chance)) + if (FloorFire_FloorCheck ()) + FloorFire (fire.master, fire, fire.origin); +}; + +//------------------------------------------------------------------------// +// Called when fireball impacts. On impact, it explodes and inflicts +// damage. +//------------------------------------------------------------------------// +void() Fireball_Touch = +{ + // If it is in the sky, disappear. + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + + // If the flame is in water, dissolve into steam. + self.velocity = normalize(self.velocity); + if (Fireball_InWater (self)) + return; + + // NEW: Rebound if impacting a reflective surface. + //if (Reflected ()) + // return; + + self.touch = SUB_Null; // Stack overflow prevention. + + // hit something that bleeds + // Update 8/30/09: Attenuation = Damage / Radius. + T_RadiusDamage (self, self.master, self.dmg, other, DAMAGEALL); + self.origin = self.origin - 8*normalize(self.velocity); + if (other.takedamage) + { + MakeFlame (other); + T_Damage (other, self, self.master, self.dmg, DAMARMOR); + } + else + FloorFire_SpawnCheck (self, 0.1); + + self.effects = self.effects | EF_MUZZLEFLASH; + if (self.noise) + sound (self, CHAN_AUTO, self.noise, 1, ATTN_NORM); + BecomeExplosion (); +}; + +//------------------------------------------------------------------------// +// This updates the fireball's angles as it flies through the air. +//------------------------------------------------------------------------// +void() Fireball_Update = +{ + local vector dir; + + dir = normalize (self.velocity); + self.angles = vectoangles(dir) + self.pos1; +// Update: Use variable 'self.pos1' instead of always '90 0 0'. +}; + +//------------------------------------------------------------------------// +// This gradually shrinks the fireball into nothing as it flies. +//------------------------------------------------------------------------// +void() Fireball_Fade = +{ + if (self.frame >= self.delay) + {remove (self); return;} + self.frame = self.frame + 1; + Fireball_Update (); + Fireball_EndFrame (); +}; + +//------------------------------------------------------------------------// +// This checks the fireball as it flies through the air. +//------------------------------------------------------------------------// +void() Fireball_Think = +{ + if (self.delay <= time) + { + // Make the fireball fade into nothing. Takes 3 frames to fade. + self.frame = $ember2; + self.delay = $ember4; + self.think = Fireball_Fade; + } + Fireball_Update (); + Fireball_EndFrame (); +}; + +//------------------------------------------------------------------------// +// Create and launch a small fireball. +//------------------------------------------------------------------------// +void(entity attacker, vector start, vector dir, float sped, float damage) + Fireball_Launch = +{ + local entity fire; + local vector ofs; + local string text; + +// if (qrack) +// {ofs = '0 0 0'; text = "progs/drake/flame2a.mdl";} +// else +// {ofs = '90 0 0'; text = "progs/drake/flame2.mdl";} + ofs = '90 0 0'; + text = "progs/drake/flame2.mdl"; + fire = spawn(); + fire.movetype = MOVETYPE_FLYMISSILE; + fire.solid = SOLID_BBOX; + fire.frame = $flame; + fire.angles = vectoangles(dir) + ofs; + fire.speed = sped; + fire.velocity = dir * sped; + fire.touch = Fireball_Touch; + fire.nextthink = 0.01; + fire.think = Fireball_Think; + fire.master = fire.owner = attacker; + fire.delay = time + 5; // Was (8000 / sped), like in Quake2. + fire.wait = 0; + fire.dmg = damage; + fire.classname = "fire"; + fire.style = DFx_FIREBALL; + fire.pos1 = ofs; + setall (fire, text, '0 0 0', '0 0 0', start); + + // So fireball can be changed later. + newmis = fire; +}; + + +//========================================================================== +// Super-sized Fireballs (a.k.a. Meteor) + +//------------------------------------------------------------------------// +// This fizzles then removes the meteor. +//------------------------------------------------------------------------// +void(entity fire) Meteor_Fizzle = +{ + local float pc; + + pc = pointcontents (fire.origin); + if ((pc == CONTENT_WATER) || (pc == CONTENT_SLIME)) + Fireball_Steam (fire); + remove (fire); +}; + +//------------------------------------------------------------------------// +// The fireball explodes then creates a small cloud of fire. +//------------------------------------------------------------------------// +void() Meteor_Explode = +{ + // Do splash damage first then explode. + T_RadiusDamage (self, self.master, self.dmg, self.enemy, DAMAGEALL); + self.origin = self.origin - 8*normalize(self.velocity); + + if (self.enemy.takedamage) + { // Someone took a direct hit. + local float damage; + + if (self.style & DF_BURN) // Always ignite if burn is enabled. + Burn_Add (other, self.master, MAX_BURN_DAMAGE); + damage = SUB_RandomDamage (self.dmg); + T_Damage (self.enemy, self, self.master, damage, DAMARMOR); + } + else + FloorFire_SpawnCheck (self, 1); + + // Make a fiery explosion. + if (self.dmg >= 80) + Rocket_Explosion1 (self.origin); + else + Rocket_Explosion2 (self.origin, 96, 16); + BecomeExplosion2 (); +}; + +//------------------------------------------------------------------------// +// The large fireball explodes on contact and inflicts severe damage +// within a radius. +//------------------------------------------------------------------------// +void() Meteor_Touch = +{ +// Destroy fireball if it has no power or if it touches the sky. + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + if (self.dmg <= 0) + {Meteor_Fizzle (self); return;} + +// NEW: Rebound if impacting a reflective surface. + //if (Reflected_Damage (COURAGE_DAMAGE)) + // return; + +// Do the damage. + self.touch = SUB_Null; // Stack overflow prevention. + self.enemy = other; + Meteor_Explode (); +}; + +//------------------------------------------------------------------------// +// This checks the big fireball. It loses strength if it travels +// through water. While active, the fireball leaves behind a trail +// of steam or embers. +//------------------------------------------------------------------------// +void() Meteor_Think = +{ +//- - - - - - - - - +// Particle trail. + local float rgb; + local float density; + + // Default trail is steam. + rgb = 6; + density = 16; + + if (VecInWater (self.origin)) + { // Fireball loses strength in water. Loses 10 damage per frame. + // Used to be 10% damage in Dragons. + self.dmg = self.dmg - 10; + if (self.dmg < 0) + self.dmg = 0; + } + else if (!VecInWater (self.oldorigin)) + { // Fireball has not been in water lately, so make an ember trail. + rgb = 233; + density = 8; + } + Meteor_Trail (rgb, density, TRUE); +//- - - - - - - - - + Fireball_Update (); + + // Fizzle if it lost all power. + if (self.dmg <= 0) + {Meteor_Fizzle (self); return;} + + // The fireball will explode after a period of time. + if (self.delay < time) + {Meteor_Explode (); return;} + + // Fire is still burning, check again. + self.nextthink = time + 0.1; +}; + +//------------------------------------------------------------------------// +// This creates a large, highly explosive fireball. +//------------------------------------------------------------------------// +void(entity attacker, vector start, vector dir, float sped, float damage) + Meteor_Launch = +{ + local entity fire; + local vector ofs; + local string text; + +// if (qrack) +// {ofs = '0 0 0'; text = "progs/drake/flame2a.mdl";} +// else +// {ofs = '90 0 0'; text = "progs/drake/flame2.mdl";} + ofs = '90 0 0'; + text = "progs/drake/flame2.mdl"; + fire = spawn(); + fire.movetype = MOVETYPE_FLYMISSILE; + fire.solid = SOLID_BBOX; + fire.frame = $flameb; // Use a *big* flame. + fire.angles = vectoangles(dir) + ofs; + fire.speed = sped; + fire.velocity = dir * sped; + fire.touch = Meteor_Touch; + fire.nextthink = 0.01; + fire.think = Meteor_Think; + fire.master = fire.owner = attacker; + fire.enemy = world; + fire.delay = time + 5; // Was (8000 / sped), like in Quake2. + fire.wait = 0; + fire.dmg = damage; + fire.classname = "fire"; + fire.style = DFx_FIREBALL | DF_ROCKET; + fire.pos1 = ofs; + // Added rocket type flag so shamblers take less damage. + + fire.effects = fire.effects | EF_DIMLIGHT; + fire.oldorigin = start; + + setall (fire, text, '0 0 0', '0 0 0', start); + + // So fireball can be changed later. + newmis = fire; +}; + + +//========================================================================== +// Firewalls + +// +// The firewall is divided into two major parts: the spawner and the +// flames. The spawner is an invisible missile that spawns flames +// on the ground below it. The flames are stationary flame missiles +// that burn whoever touches them. +// +// Code derived (and modified) from mummy.hc in Hexen2. +// In Hexen2, Each flame spawned has 17 frames and lasted about 0.85 sec. +// With 17 frames, each wall had up to 17 edicts per firewall, and that +// is way too much for comfort. In Quake, each for firewall has about +// seven flames -- a bit high, but hardly any worse than the hell knight +// missile spray. To compensate, the damage is higher than in Hexen2. +// +// Functions below: +// Firelink_*** = Flames in the firewall. +// Firewall_*** = Invisible fire spawning missile. +// + +float SPEED_FIREWALL = 400; // Don't change! + +// Animate the flame links in the firewall. +void() Firelink_Think = [ $flamec, Firelink_Think ] +{ + self.walkframe = self.walkframe + 1; + if (self.walkframe > 3) // FIXME: Use 2 for Drake. + remove (self); + else + particle (self.origin + '0 0 17', '0 0 25', self.volume, self.cnt); +}; + +// Oh dear! Someone crossed the firewall. +void() Firelink_Touch = +{ + local float damage; + + if (self.wait > time) + return; // Already burnt someone recently. + if (!other.takedamage) + return; + if (other == self.owner) + return; // Don't harm attacker. + + if (self.dmg < 1) + damage = 1; + else + damage = (random() + 1) * self.dmg; + T_Damage (other, self, self.master, damage, DAMARMOR); + self.wait = time + 0.1; // Wait until then to damage again. +// Play burning sounds. + if (self.t_width < time) + { + sound (self, CHAN_BODY, "weapons/fwallhit.wav", 1, ATTN_NORM); + self.t_width = time + 0.5; + } +}; + +// Assumes 'self' is the firewall spawner missile. +// 'hot' = Spawn fire if TRUE, or spawn steam if FALSE. +void(vector spot, float hot) Firelink_Spawn = +{ + local entity fire; + + fire = spawn(); + fire.owner = self.owner; + fire.master = self.master; + fire.angles = self.angles; + fire.movetype = MOVETYPE_FLYMISSILE; // Use for the clip bonus. + fire.solid = SOLID_TRIGGER; + fire.frame = $flamec; + fire.walkframe = 0; + fire.wait = 0; // Time to burn on touch. + if (hot) + { + fire.volume = 233; // Particle color - embers. + fire.cnt = 1; // Particle count. + // 17/7 = 2.42857. Hexen2 dmg was 3. + fire.dmg = ceil(self.dmg * 0.075); + setmodel (fire, "progs/drake/flame2.mdl"); + } + else // It's in liquid so no flame model. + { + fire.volume = 1; // Steam + fire.cnt = 5; + fire.dmg = 0; // Hot spot, minor damage. + fire.modelindex = 0; // No model. + } + setsize (fire, '0 0 0', '0 0 0'); + setorigin (fire, spot); + + fire.nextthink = time + 0.05; + fire.think = Firelink_Think; + fire.touch = Firelink_Touch; +}; + +void() Firewall_Think = +{ + local float pc; + local vector spot; + + if (self.delay <= time) + {remove (self); return;} // Time's up. + pc = pointcontents (self.origin); + if (pc == CONTENT_SOLID) + {remove (self); return;} // In the void. + + traceline (self.origin, self.origin - '0 0 600', TRUE, self); + spot = trace_endpos; + pc = pointcontents (spot); + +// Spawn a flame only if there is open space on the ground. + if (trace_fraction < 1) + if (pc != CONTENT_SOLID) + if (pc != CONTENT_SKY) + Firelink_Spawn (spot, (pc == CONTENT_EMPTY)); +// The rest of the spawner missile think. + if (self.enemy) + { // Steer toward the enemy. + spot = self.enemy.origin + self.enemy.view_ofs; +// if (1) +// { // Change pitch and yaw. Aim_Lead plots intercept point. +// spot = Aim_Lead (self.origin, spot, SPEED_FIREWALL, self.enemy); +// Missile_Face (spot); // Update angles toward desired point. +// } +// else + { // Change yaw only. Aim_Line plots intercept course. + // Use 'normalize(spot - self.origin)' instead to follow directly. + spot = Aim_Line (self.origin, spot, SPEED_FIREWALL, self.enemy); + self.ideal_yaw = vectoyaw(spot); + self.ideal_yaw = anglemod(self.ideal_yaw); + ChangeYaw (); + } + // Update direction. + spot = self.angles; + spot_x = 0 - spot_x; + makevectors (spot); + self.movedir = v_forward; + } + self.velocity = self.movedir * self.speed; + self.angles = vectoangles(self.velocity); + self.nextthink = time + 0.05; +}; + +// Explode like Maulotaur firewall. +void() Firewall_Touch = +{ + local float pass, pc; + local vector spot; + +// DISABLED -- Spawner is not solid_trigger anymore. +// if (other == self.owner) +// return; // Seems trigger entities can touch its 'owner'. + + pass = 0; +// If explosion cannot hit the target, don't explode. + traceline (self.origin, self.origin - '0 0 600', TRUE, self); + if (trace_fraction == 1) + pass = 1; // No flame on ground. + else + { + spot = trace_endpos; + pc = pointcontents (spot); + if ((pc != CONTENT_EMPTY) && (pc != CONTENT_LAVA)) + pass = 1; // Flame in void, water, or sky. + else if (other.flags & FLx_CREATURE) + { + if (fabs(other.origin_z - spot_z) > (self.dmg + 40)) + pass = 1; // Too far away to damage. + else + { + local vector mp; + + mp = Midpoint (other); + traceline (spot, mp, TRUE, self); + if (trace_fraction < 1) + pass = 1; // Blocked + } + } + } + if (pass) + { // Explosion ineffective, convert to notouch version. + self.movetype = MOVETYPE_NOCLIP; + self.solid = SOLID_NOT; + self.touch = SUB_Null; + return; + } + + // PM: Don't reflect firewall. + +// Go boom. + self.touch = SUB_Null; // Stack overflow prevention. + self.enemy = world; + // FIXME: Should spawn a dummy to explode at spot, then remove self. + setorigin (self, spot); // FIXME: Maybe this is bad if SOLID_TRIGGER? + T_MissileExplode (); +}; + +void(vector start, vector dir, float boom, entity targ) Firewall_Spawn = +{ + newmis = spawn (); + newmis.master = newmis.owner = self; + if (boom) + { // Explode if head impacts, similar to Maulotaur version. + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + // Can't use solid_trigger because of touch link breakage on contact. + // ...at least if we don't jump through hoops to avoid breakage. + } + else + { // Pass through all. + newmis.movetype = MOVETYPE_NOCLIP; + newmis.solid = SOLID_NOT; + } + newmis.classname = "fire"; // Use this so zombies burn on death. +// set missile speed + newmis.speed = SPEED_FIREWALL; + newmis.movedir = dir; + newmis.velocity = dir * SPEED_FIREWALL; + newmis.angles = vectoangles(newmis.velocity); +// set missile damage + newmis.dmg = 80; // Use 120 for Maulotaur strength. + newmis.enemy = targ; + newmis.yaw_speed = 5; // Thinks 20/sec, effective yaw_speed of 10. +// set missile special stuff + newmis.style = DFx_FIREBALL | DF_ROCKET | DF_SAFE; +// set missile duration + newmis.delay = time + 3; // Hexen2 used 2.5, not enough here. + newmis.nextthink = time + 0.05; + newmis.think = Firewall_Think; + if (newmis.solid) + newmis.touch = Firewall_Touch; + + setall (newmis, "", '0 0 0', '0 0 0', start); // Missile is invisible. + + sound (newmis, CHAN_WEAPON, "weapons/fwall.wav", 1, ATTN_NORM); +}; + +// Launch a firewall. Designed for use by hell lords. +void() M_Firewall = +{ + local entity targ; + local vector org, dir; + + self.effects = self.effects | EF_MUZZLEFLASH; + + if (skill >= 2) // As with Chthon, lead on Hard and up. + targ = self.enemy; + else + targ = world; + org = self.origin + self.view_ofs; + dir = self.enemy.origin + self.enemy.view_ofs; + dir = Maim_Line (org, dir, SPEED_FIREWALL, targ, '0 0 0'); + Firewall_Spawn (org, dir, 1, world); +}; + +// Checks if the firewall is effective against an enemy. +// Assumed to be called during ai_run and self.th_missile(). +float() M_FirewallCheck = +{ + if (self.h2olevel) + return FALSE; // Spawnpoint underwater. + if (!(self.flags & FL_ONGROUND)) + return FALSE; // Not on the ground. + if (self.enemy) + { + if (self.enemy.h2olevel) + return FALSE; // Underwater. + if (vlen(self.enemy.origin - self.origin) > 1000) + return FALSE; // Too far away. + if (!(self.enemy.flags & FL_ONGROUND)) + { + traceline (self.enemy.origin, self.enemy.origin - '0 0 100', TRUE, self.enemy); + if (trace_fraction == 1) + return FALSE; // High above the ground. + } + } + return TRUE; // Fire away. +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/drake_hook.qc b/QC_other/QC_keep/drake_hook.qc new file mode 100644 index 00000000..350a57ca --- /dev/null +++ b/QC_other/QC_keep/drake_hook.qc @@ -0,0 +1,365 @@ +//========================================================================== +// +// GRAPPLE (Based on Rogue's, heavily modified for Drake.) +// +//========================================================================== + +// Rogue Grapple Implementation +// Jan'97 by ZOID <zoid@threewave.com> +// Under contract to id software for Rogue Entertainment + +// PM: Added grapple support to Drake just in case others want to use it. +// I am not too fond of the grapple since it alters fundamental gameplay +// too much. It has its uses though. +// +// Note 9/11/10: Point is moot now since Tronyn used it in some of his maps. + +// Moved custom fields to defs.qc. + +// draw a line to the hook +void(entity h, entity player) GrappleTrail = + {Tent_Beam (13, h, h.origin, player.origin + '0 0 16');}; + +void(entity h) GrappleSever = +{ + local entity src; + + if (!h) + return; // The world is not a hook! + + src = h.master; + if (src) + if (src.hook == h) + h.count = TRUE; +}; + +void() GrappleReset = +{ + local entity src; + + src = self.master; + if (src) + if (src.hook == self) + { + src.hook = world; + if (src.weapon == IT2_GRAPPLE) + { + local float reload; + + // Add delay so player has a chance to release button + // and not shoot another hook immediately. + reload = time + 0.2; // Was 0.25. + if (src.attack_finished < reload) + src.attack_finished = reload; + + if (src.flags & FL_CLIENT) + src.weaponframe = 0; + } + } + remove (self); +}; + +float() GrappleCutCheck = +{ + local vector p1, p2; + + p1 = self.origin; + p2 = self.master.origin + '0 0 16'; + if (vlen (p2 - p1) > self.distance) + return TRUE; // Exceeded maximum distance. + traceline (p1, p2, TRUE, self); + if (trace_fraction < 1) + return TRUE; // Not in line-of-sight. + + return FALSE; +}; + +void() GrappleTrack = +{ + local vector spray; + + if (self != self.master.hook) + {remove (self); return;} // PM: Not using this hook. + + // drop the hook if owner is dead or has released the button + // Update 7/11/09: ...or has left the level. + if (!self.state || self.master.health <= 0 || !self.modelindex) + {GrappleReset(); return;} + // Player always drop the hook during a cutscene. + if (cutscene) + if (self.master.flags & FLx_CREATURE == FL_CLIENT) + {GrappleReset(); return;} + + // PM: Must have a clear path between hook and source. + // Do this here instead of the grapple check because this is + // called only 10/sec while the other is called more often than that. + if (GrappleCutCheck ()) + {GrappleReset(); return;} + + if (self.state != 2) + { + local float dflags; + + if (self.enemy.solid <= SOLID_TRIGGER) + {GrappleReset(); return;} // Release insubstantial targets. + if (self.enemy.teleport_time > time) + {GrappleReset(); return;} + + // move the hook along with the player. It's invisible, but + // we need this to make the sound come from the right spot + self.velocity = '0 0 0'; +// if (self.enemy.flags & FL_CLIENT) +// self.origin = self.enemy.origin; +// else + self.origin = Midpoint (self.enemy); //self.enemy.origin + self.enemy.mins + self.enemy.size * 0.5 + setorigin (self, self.origin); + + if (self.master.tome_finished) + dflags = DF_LEECH; + else + dflags = DF_NONE; + // Use Zerstorer's chainsaw grinding noise. + sound (self, CHAN_WEAPON, "weapons/sawguts.wav", 1, ATTN_NORM); //"pendulum/hit.wav" + T_Damage (self.enemy, self, self.master, self.dmg, DAMARMOR); + // PM: Removed 'makevectors (self.v_angle)'. + spray_x = 100 * crandom(); + spray_y = 100 * crandom(); + spray_z = 100 * crandom() + 50; + SpawnBlood (self.enemy,self.origin, spray, 20); + } + else + self.velocity = self.enemy.velocity; + + self.nextthink = time + 0.1; +}; + + +// Tries to anchor the grapple to whatever it touches +void() GrappleAnchor = +{ + local string sfx; + + if (pointcontents(self.origin) == CONTENT_SKY) + {GrappleReset(); return;} + //if (Reflected_Damage (self.dmg)) + // return; + + if (!self.dmg) + self.dmg = 10; + if (!self.cnt) + self.cnt = 1; + + self.touch = SUB_Null; // Stack overflow prevention. + if (other.takedamage || (other.solid != SOLID_BSP)) + { // PM: Removed teammate immunity. + if (other.hittype == HIT_METAL) + sfx = "weapons/clang.wav"; + else if (other.hittype == HIT_STONE) + sfx = "weapons/axhitwal.wav"; + else if ((self.master.hook == self) && !self.count) + sfx = "shambler/smack.wav"; + else // Not grabbing, so just thump. + sfx = "zombie/z_hit.wav"; + } + else + { + sfx = "player/axhit2.wav"; + self.velocity = '0 0 0'; + self.avelocity = '0 0 0'; + } + sound (self, CHAN_AUTO, sfx, 1, ATTN_NORM); + if (other.takedamage) { + spawn_touchblood (self,other,self.dmg); + T_Damage (other, self, self.master, self.dmg, DAMARMOR); + } + +// Remove the hook if one of... +// 1) Button isn't held and grappler is current weapon. +// 2) Hook hits its master, possible with reflection. +// 3) Cable was severed. +// 4) Hook isn't connected with its master. + if ( (!self.master.button0 && self.weapon == IT2_GRAPPLE) + || (other == self.master) + || (self.count) + || (self.master.hook != self) ) + { + if (!other.takedamage) + { + local vector org; + + org = self.origin - 8*normalize(self.velocity); + Tent_Point (TE_GUNSHOT, org); + } + GrappleReset(); + return; + } + +// Anchored. + if (other.solid == SOLID_BSP) + self.state = 2; + else + self.state = TRUE; + self.dmg = self.cnt; + self.enemy = other; // remember this guy! + self.think = GrappleTrack; + self.nextthink = 0.01; + self.solid = SOLID_NOT; + self.touch = SUB_Null; +}; + +void() Grapple_Think = +{ + if (self.delay < time) + {GrappleReset (); return;} + + if (GrappleCutCheck ()) + { + GrappleSever (self); + self.think = GrappleReset; + self.nextthink = self.delay; + } + else + self.nextthink = time + 0.1; +}; + +void(entity attacker, vector start, vector dir) Grapple_Launch = +{ + newmis = spawn(); + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.master = newmis.owner = attacker; + newmis.classname= "hook"; + + newmis.count = FALSE; // Cable is uncut. + newmis.state = FALSE; // Hook is out flying. + newmis.movedir = dir; + newmis.speed = 800; + newmis.dmg = 10; + newmis.cnt = 2; // Grind damage. Was 1. + + newmis.velocity = dir * newmis.speed; + newmis.avelocity= '0 0 -500'; // PM: Enabled spin. + newmis.angles = vectoangles(dir); + + newmis.touch = GrappleAnchor; + newmis.think = Grapple_Think; //GrappleReset; + // grapple only lives for X seconds, this gives max range on it + newmis.delay = time + 1.5; // Was T+2. + newmis.nextthink= 0.01; + newmis.distance = 1500; // Maximum cable range. + + newmis.frame = 1; // hook spread + setall (newmis, "progs/drake/hook.mdl", '0 0 0', '0 0 0', start); + + if (attacker) + attacker.hook = newmis; +}; + +void() W_FireGrapple = +{ + if (self.hook) // reject subsequent calls from player.qc + return; + + self.punchangle_x = -2; // bump him + + // chain out sound (loops) + sound (self, CHAN_WEAPON, "weapons/chain1.wav", 1, ATTN_NORM); + + makevectors (self.v_angle); + Grapple_Launch (self, self.origin + v_forward * 16 + '0 0 16', v_forward); +}; + + +//- - - - - - - - - +entity(entity attacker) Grapple_Pull_Who = +{ + if (attacker.hook) + { + local entity targ; + + targ = attacker.hook.enemy; + if (targ.mass == MASS_LIGHT) + return targ; + if (targ.mass == MASS_MEDIUM) + return world; // No one gets pulled. + } + return attacker; +}; + +float() Grapple_Pull_Me = +{ + if (Grapple_Pull_Who (self) == self) + return TRUE; + return FALSE; +}; + +// Called each frame by CLIENT.QC if client has a hook. +void() GrappleService = +{ + local vector /*delta,*/ vel; + local float sped, mx; + local entity targ; // Who gets pulled. + + if (!self.hook) + return; + if (self.hook.count) + return; // Already severed. + + if (!self.hook.state) + { // Hook is flying and not attached to anything yet. + // just draw a line to the hook + if (vlen(self.hook.origin - self.origin) > HOOK_NEAR) + GrappleTrail (self.hook, self); + if (!self.button0 && self.weapon == IT2_GRAPPLE) + GrappleSever (self.hook); + return; + } + +// From here on, we know the hook is attached to something. + // PM: We cannot check cutscene/intermission status here because + // This function isn't called during such as intermission. + // drop the hook if player lets go of button + if ((!self.button0 && self.weapon == IT2_GRAPPLE) + || (!(InItems2(self, IT2_GRAPPLE))) // 6/10/11: Sever if weapon is stolen. + || self.form_active // PM: Can't use grapple while morphed. + || (self.teleport_time > time)) { + // release when we get 'ported + if (self.hook) + SUB_Think (self.hook, GrappleReset); + return; + } + + // PM: Made to changes to pulling... + // 1) Smaller monsters are pulled toward the player. + // 2) Pulling speed was greatly reduced from 1000. + targ = Grapple_Pull_Who (self); + if (targ) + { + makevectors (self.angles); + // The jump button bumps the player up a little bit. + vel = self.hook.origin - ( self.origin + (v_up * 16 * + (!self.button2)) + (v_forward * 16)); + + if (targ == self) + mx = SPEED_HOOK; + else // Pulling target toward attacker. + {mx = 350; vel = vel * -1;} + + sped = vlen (vel) * 10; + if (sped > mx) // Was 1000 -- way too fast! + sped = mx; + + // DISABLED -- Combining velocity causes more trouble than it's worth. +// vel = normalize(vel) * 80 + targ.velocity; +// if (vlen(vel) > sped) + vel = normalize(vel) * sped; + targ.velocity = vel; + targ.flags = targ.flags - (targ.flags & FL_ONGROUND); + } + + if (vlen(self.hook.origin - self.origin) > HOOK_NEAR) + GrappleTrail (self.hook, self); +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/drake_respawn.qc b/QC_other/QC_keep/drake_respawn.qc new file mode 100644 index 00000000..714cd3dc --- /dev/null +++ b/QC_other/QC_keep/drake_respawn.qc @@ -0,0 +1,175 @@ +//============================================================================ + +// Checks if starting point of 'self' is clear. +float() M_CheckPosition = +{ + local entity head; + local vector vmin, vmax; + + vmin = self.oldorigin + self.dest1; + vmax = self.oldorigin + self.dest2; +// Is the spawn point blocked by terrain now? +// Don't use BoxInWall because monsters' feet may be in the ground on purpose. + if (pointcontents (self.oldorigin) == CONTENT_SOLID) + if (pointcontents (vmin) == CONTENT_SOLID) + if (pointcontents (vmax) == CONTENT_SOLID) + { //dprint ("engulfed\n"); + return FALSE; + } +// Check if the spawn point is occupied or not. + head = findradius (self.oldorigin, 256); + while (head) + { + if (head.solid >= SOLID_BBOX) + if (head != self) + if (Point_Overlap (head.absmin, head.absmax, vmin, vmax)) + { //dprint ("overlap\n"); + return FALSE; + } + head = head.chain; + } + return TRUE; +}; + +// Checks if 'ent' is allowed to respawn. +float() M_RespawnCheck = +{ + if (doomed) + if (self.th_spawn) + if (!self.spawned) + if (self.spawnflags & SPAWN_WHITE == 0) // Can't be good. + return TRUE; + return FALSE; +}; + +//================ +// monster_respawn +// +// Monster attempts to respawn. Thinking set by 'monster_end'. +//================ +void() monster_respawn = { + local float first; + +// Respawn the creature. + // If self has solid_trigger and a defined touch func, game may crash. + self.touch = SUB_Null; + self.solid = SOLID_NOT; + self.deadflag = DEAD_NO; + self.health = self.max_health; + self.enemy = world; // Forget all targets like in Doom. + self.oldenemy = world; + self.targetname = + self.killtarget = self.target = self.target2 = ""; + self.angles = self.mangle; + + // Zero out fields that may have been changed when killed. + self.cnt = + self.volume = + self.healtype = + self.healamount = 0; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.groundentity = world; + self.gorging = FALSE; + self.view_ofs = '0 0 0'; + +// Move creature back to its original spawn point and cover current point +// and spawn point with teleporter effects. + // 1. Spawn effects at original spawn point. + if (self.dest2_x > 96) + { // Hack for oldone/wyrm. + Tent_Point (TE_LAVASPLASH, self.oldorigin - '0 0 24'); + sound (self, CHAN_VOICE, "boss1/out1.wav", 1, ATTN_NORM); + } + else + spawn_tfog (self.oldorigin); + // 2. Spawn effects at its current point, if a body is visible. + if (self.mdl) + if (self.mdl != MODEL_PLAYER_EYES) + spawn_tfog (self.origin); + // 3. Move back to spawn point. + setorigin (self, self.oldorigin); + +// Doom removed the old monster and spawned a new one in its place. +// Here, in Quake, just recycle the old monster. + self.skin = self.spawnskin; + respawning = TRUE; + first = self.spawned; + self.spawned = TRUE; // Bypass precaching and thinking delays. + self.th_spawn(); + self.spawned = first; + respawning = FALSE; +}; + +void() monster_respawn_random = +{ + if (intermission_running) + {self.nextthink = -1; self.think = SUB_Null; return;} // End of level. + + Doom_NextThink (32); // T+32/35. + + if (cutscene) + return; // Not during a cutscene. + if (!self.th_spawn) + return; // No spawn function! + if (prandom() > self.cnt) // cnt is normally 4. + return; // Small chance of success per check, same as in Doom. + if (!M_CheckPosition ()) + return; // Spawn point occupied. + +// Respawn the creature. + monster_respawn (); +}; + +void() monster_respawn_timed = +{ + if (intermission_running) + {self.nextthink = -1; self.think = SUB_Null; return;} // End of level. + + self.nextthink = time + 0.1; // No need to emulate Doom if not random. + +// Since we are on a timer, stop respawning only if it is impossible. + if (!self.th_spawn) + return; // No spawn function! + if (!M_CheckPosition ()) + return; // Spawn point occupied. + +// Respawn the creature. + monster_respawn (); +}; + +void(float secs) M_RespawnNextthink = +{ + if (secs) + { + self.nextthink = time + secs; + self.think = monster_respawn_timed; + } + else + { // Emulate Doom style respawn timings. + self.nextthink = time + 12; // Minimum delay. + self.think = monster_respawn_random; + } +}; + +void() SUB_Disappear = { + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; //SUB_Null; + self.solid = SOLID_NOT; + self.takedamage = DAMAGE_NO; + setmodel (self, ""); +}; + +void() monster_disappear = { M_RespawnNextthink (0); SUB_Disappear (); }; + +// rod = Respawn or Die. +void() monster_rod = +{ + if (M_RespawnCheck ()) + {M_RespawnNextthink (0); SUB_Disappear ();} + else + SUB_Remove (); +}; + + +//============================================================================ diff --git a/QC_other/QC_keep/earthq.qc b/QC_other/QC_keep/earthq.qc new file mode 100644 index 00000000..f91a1781 --- /dev/null +++ b/QC_other/QC_keep/earthq.qc @@ -0,0 +1,135 @@ +float EQ_RANDOM = 1.000; + + +void () stop_earthquake; + +void () earthquake_rumble = { + if ( (self.attack_finished < time) ) { + stop_earthquake (); + } else { + sound (self,CHAN_VOICE,"equake/rumble.wav",TRUE,ATTN_NONE); + self.think = earthquake_rumble; + self.nextthink = (time + TRUE); + } +}; + +void () start_earthquake = { + earthquake_active = TRUE; + if ( (self.spawnflags & EQ_RANDOM) ) { + self.attack_finished = (time + (random () * self.delay)); + } else { + self.attack_finished = (time + self.delay); + } + earthquake_rumble (); +}; + +void () stop_earthquake = { + earthquake_active = FALSE; + self.think = start_earthquake; + if ( (self.spawnflags & EQ_RANDOM) ) { + self.nextthink = (time + (random () * self.wait)); + } else { + self.nextthink = (time + self.wait); + } +}; + +void () earthquake = { + if ( !self.delay ) self.delay = 20.000; + if ( !self.wait ) self.wait = 60.000; + if ( !self.weapon ) self.weapon = 40; + precache_sound ("equake/rumble.wav"); + earthquake_active = FALSE; + earthquake_intensity = (self.weapon * 0.500); + setsize (self,VEC_ORIGIN,VEC_ORIGIN); + self.think = stop_earthquake; + self.nextthink = (time + TRUE); +}; + +void () earthquake_touch = { + if ( self.delay ) { + if ( (self.attack_finished < time) ) { + sound (self,CHAN_VOICE,"equake/rumble.wav",TRUE,ATTN_NORM); + self.attack_finished = (time + TRUE); + } + if ( (other.classname == "player") ) { + if ( (other.flags & FL_ONGROUND) ) { + other.velocity_x = ((other.velocity_x + ((random () * self.weapon) * FL_SWIM)) - self.weapon); + other.velocity_y = ((other.velocity_y + ((random () * self.weapon) * FL_SWIM)) - self.weapon); + other.velocity_z = ((other.velocity_z + ((random () * self.weapon) * FL_SWIM)) - self.weapon); + } + } + } +}; + +void () earthquake_use = { self.delay = !self.delay; }; + +void () trigger_earthquake = { + precache_sound ("equake/rumble.wav"); + if ( !self.weapon ) self.weapon = 40; + self.weapon = self.weapon * 0.5; + self.delay = TRUE; + self.touch = earthquake_touch; + if ( self.targetname ) { + self.use = earthquake_use; + self.delay = FALSE; + } + InitTrigger (); +}; + +void () earthquake_kill_touch = { + local entity eq; + + if ( (other.classname != "player") ) return ; + eq = find (world,classname,"earthquake"); + if ( (eq != world) ) { + earthquake_active = FALSE; + remove (eq); + } +}; + +void () trigger_earthquake_kill = { + self.touch = earthquake_kill_touch; + InitTrigger (); +}; + + + +void () StopEarthQuake = { + hipearthquake = FALSE; +}; + +void (float value) EarthQuakeTime = { + value = (value + time); + if ( (value > hipearthquake) ) hipearthquake = value; +}; + +void () earthquake_prethink = {}; + +void () earthquake_postthink = { + if ( (hipearthquake > time) ) { + if ( (quakeactive == FALSE) ) { + sound (self,CHAN_VOICE,"misc/quake.wav",TRUE,ATTN_NONE); + quakeactive = TRUE; + } + if ( (self.flags & FL_ONGROUND) ) self.velocity = (self.velocity + (random () * '0.000 0.000 150.000')); + } else { + if ( (quakeactive == TRUE) ) { + sound (self,CHAN_VOICE,"misc/quakeend.wav",TRUE,ATTN_NONE); + quakeactive = FALSE; + } + } +}; + +void () hipearthquake_use = { + EarthQuakeTime (self.dmg); +}; + +void () func_earthquake = { + quakeactive = FALSE; + precache_sound ("misc/quake.wav"); + precache_sound ("misc/quakeend.wav"); + self.classname = "earthquake"; + self.use = hipearthquake_use; + self.think = SUB_Null; + if ( !self.dmg ) self.dmg = 0.800; +}; diff --git a/QC_other/QC_keep/elevatr.qc b/QC_other/QC_keep/elevatr.qc new file mode 100644 index 00000000..28b77fb8 --- /dev/null +++ b/QC_other/QC_keep/elevatr.qc @@ -0,0 +1,153 @@ +// elevator button +// pmack +// sept 96 + +float ELVTR_DOWN = 1; + +void() elvtr_button_wait; +void() elvtr_button_return; + +void() elvtr_button_wait = +{ + elv_button_dir = 0; + if (self.spawnflags & ELVTR_DOWN) + elv_button_dir = -1; + else + elv_button_dir = 1; + + self.state = STATE_TOP; + self.nextthink = self.ltime + self.wait; + self.think = elvtr_button_return; + activator = self.enemy; + SUB_UseTargets(); + self.frame = 1; // use alternate textures +}; + +void() elvtr_button_done = +{ + self.state = STATE_BOTTOM; +}; + +void() elvtr_button_return = +{ + self.state = STATE_DOWN; + SUB_CalcMove (self.pos1, self.speed, elvtr_button_done); + self.frame = 0; // use normal textures + if (self.health) + self.takedamage = DAMAGE_YES; // can be shot again +}; + + +void() elvtr_button_blocked = +{ // do nothing, just don't ome all the way back out +}; + + +void() elvtr_button_fire = +{ + if (self.state == STATE_UP || self.state == STATE_TOP) + return; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + self.state = STATE_UP; + SUB_CalcMove (self.pos2, self.speed, elvtr_button_wait); +}; + + +void() elvtr_button_use = +{ + self.enemy = activator; + elvtr_button_fire (); +}; + +void() elvtr_button_touch = +{ + if (other.classname != "player") + return; + self.enemy = other; + elvtr_button_fire (); +}; + +void() elvtr_button_killed = +{ + self.enemy = damage_attacker; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + elvtr_button_fire (); +}; + + +/*QUAKED func_elvtr_button (0 .5 .8) ? ELVTR_DOWN +ELEVATOR BUTTON ONLY! + +ELVTR_DOWN causes this to be a DOWN button. +Default is UP. + +When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. + +"angle" determines the opening direction +"target" all entities with a matching targetname will be used +"speed" override the default 40 speed +"wait" override the default 1 second wait (-1 = never return) +"lip" override the default 4 pixel lip remaining at end of move +"health" if set, the button must be killed instead of touched +"sounds" +0) steam metal +1) wooden clunk +2) metallic click +3) in-out +*/ +void() func_elvtr_button = { + if (self.sounds == 0) + { + precache_sound ("buttons/airbut1.wav"); + self.noise = "buttons/airbut1.wav"; + } + if (self.sounds == 1) + { + precache_sound ("buttons/switch21.wav"); + self.noise = "buttons/switch21.wav"; + } + if (self.sounds == 2) + { + precache_sound ("buttons/switch02.wav"); + self.noise = "buttons/switch02.wav"; + } + if (self.sounds == 3) + { + precache_sound ("buttons/switch04.wav"); + self.noise = "buttons/switch04.wav"; + } + + SetMovedir (); + + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.model); + + self.blocked = elvtr_button_blocked; + self.use = elvtr_button_use; + + if (self.health) + { + self.max_health = self.health; + self.th_die = elvtr_button_killed; + self.takedamage = DAMAGE_YES; + } + else + self.touch = elvtr_button_touch; + + if (!self.speed) + self.speed = 40; + if (!self.wait) + self.wait = 1; + if (!self.lip) + self.lip = 4; + + self.state = STATE_BOTTOM; + + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); +}; + diff --git a/QC_other/QC_keep/estate.qc b/QC_other/QC_keep/estate.qc new file mode 100644 index 00000000..043b48b8 --- /dev/null +++ b/QC_other/QC_keep/estate.qc @@ -0,0 +1,174 @@ +/*====================================================================== +Entity State System +------------------- + +When Quake first came out there were strict limitations on how many entities +could exist and be active at the same time. The quick fix solution to this +problem was to use the killtargets key so that entities could be removed. +This was a very powerful feature with very few restrictions on what it +could affect or destroy at the same time. + +The idea of the entity state system is to create a way to safely switch +entities on, off or have then temporarily disabled. This will help prevent +situations where entity chains are broken or strange errors occur because +the touch function does not have an entity anymore. + +The entity state is a new key on entities which is designed to work in a +passive mode until it is activated. All the entities listed below have a +default value so that any existing map will still work as before. + +There are two methods for changing the entity state and the first method +is an extra key on triggers entities (trigger _once, _multi, _relay etc) + +The ON state (default) will allow the entity to work as designed, be +toggled and physically exist as per its setup. + +The OFF state will block all of the designed functionality and hide +the entity from interaction with the player. + +The DISABLE state blocks any toggle ability or entity functionality +and turns off any visual aids like animated textures. + +The second method is via a brand new set of entities which can affect +multiple targets at once and are much easier (visually) to see what is +going on because most editors draw target lines. + +======================================================================*/ + +//---------------------------------------------------------------------- +// These entity states are monitored and updated by the entity +void() entity_state_on = { + if (self.estate_on) self.estate_on(); + else self.estate = ESTATE_ON; +}; +void() entity_state_off = { + if (self.estate_off) self.estate_off(); + else self.estate = ESTATE_OFF; +}; +void() entity_state_disable = { + if (self.estate_disable) self.estate_disable(); + self.estate = ESTATE_DISABLE; +}; +void() entity_state_reset = { + if (self.estate_reset) self.estate_reset(); +}; +void() entity_state_aframe = { + // Only switch frames if the entity has a function defintion + // This will restrict to entities designed for this change + if (self.estate_aframe) { + if (other.state == 0) self.frame = 0; + else self.frame = 1; + } +}; + +//---------------------------------------------------------------------- +void() entity_state_use = +{ + // Does the firing entity have specific state requests? + if (other.estate_trigger) { + if (other.estate_trigger & ESTATE_ON) entity_state_on(); + else if (other.estate_trigger & ESTATE_OFF) entity_state_off(); + else if (other.estate_trigger & ESTATE_DISABLE) entity_state_disable(); + else if (other.estate_trigger & ESTATE_RESET) entity_state_reset(); + else if (other.estate_trigger & ESTATE_AFRAME) entity_state_aframe(); + } + else { + // Check if disabled first + if (self.estate == ESTATE_DISABLE) return; + + // Check for USE function + if (self.estate_use) self.estate_use(); + // entity has a TOGGLE function + else if (self.estate == ESTATE_OFF) entity_state_on(); + else entity_state_off(); + } +}; + +//====================================================================== +/*QUAKED trigger_entitystate_x (.7 .5 1) (-8 -8 -16) (8 8 16) x +Switch the target(s) entity state X +-------- KEYS -------- +target : target entities to switch x +target2 : more target(s) to affect +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Switch the target(s) entity state X +======================================================================*/ +void(string targstr) trigger_entitystate_target = +{ + local entity t, stemp, otemp; + + // Start looking for targets to update + t = find(world, targetname, targstr); + stemp = self; otemp = other; // Store self/other + while(t) { + // Entity states cannot be applied to players or monsters + if ( !(t.flags & FL_CLIENT) && !(t.flags & FL_MONSTER)) { + // Only change the state to ON/OFF/DISABLE + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp; // Switch self/other + entity_state_use(); // Update entity state + self = stemp; other = otemp; // Restore self/other + } + } + } + // Are there anymore targets left in the list? + t = find(t, targetname, targstr); + } +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_use = +{ + // Check for multiple target commands + if (self.target != "") trigger_entitystate_target(self.target); + if (self.target2 != "") trigger_entitystate_target(self.target2); + if (self.target3 != "") trigger_entitystate_target(self.target3); + if (self.target4 != "") trigger_entitystate_target(self.target4); +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_off = +{ + self.classtype = CT_ESTATE; + if (!self.target) dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_on = +{ + self.classtype = CT_ESTATE; + if (!self.target) dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_disable = +{ + self.classtype = CT_ESTATE; + if (!self.target) dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_DISABLE; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_reset = +{ + self.classtype = CT_ESTATE; + if (!self.target) dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_RESET; +}; + +//---------------------------------------------------------------------- +void() trigger_entitystate_aframe = +{ + self.classtype = CT_ESTATE; + if (!self.target) dprint("\b[ENTSTATE]\b Missing target!\n"); + if (self.targetname != "") self.use = trigger_entitystate_use; + self.estate_trigger = ESTATE_AFRAME; +}; diff --git a/QC_other/QC_keep/extras_emitters.qc b/QC_other/QC_keep/extras_emitters.qc new file mode 100644 index 00000000..5d90b643 --- /dev/null +++ b/QC_other/QC_keep/extras_emitters.qc @@ -0,0 +1,977 @@ +/* +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. +*/ + +/* + Written by Frank Condello <pox@planetquake.com> + + Particle systems with QuakeC - packet overflows made easy! + + These were modeled after particle systems in high-end 3D apps, they are + not the most user friendly entities around... + + EMITER ENTITIES: + func_emitter, func_emitter_volume + + EFFECTOR TRIGGERS: + t_effector_destroy, t_effector_push, t_effector_gravity, + t_effector_trubulence, t_effector_attract, t_effector_friction + + Emitters generate a "particle" (either a .spr, .mdl or .bsp) and toss it in a direction + between the set angle limits. They can use an optional "death" model to simulate + anything from rain, falling rubble, blasts of flames, forcefields, whatever... + + Effectors change the behaviour of particles that touch them (the emitter must have + the "USEEFFECTORS" spawnflag set). + + Emitters can be attached to a func_train_ext, for some really neat shit :) + + ---------------------------------------------------------------------------------------- + NOTES: + + Don't go too nuts with these, stay away from the built-in sounds for high + frequency emitters (use fx_sound instead) and just use common sense (you don't + need a gib fountain around every corner!). + + There are a LOT of options - these are really generic and need to be + tailored to specifc purposes. + + The lifespan of animated particles may not be exact - it will always fall on + a multiple of the framerate (this usually isn't a problem, since framerates + are typically much smaller than lifespans) but you should be aware of this + limitation. + + Particles won't "die" when they hit another particle - this is on purpose. + + Particles don't register a touch on water, but a t_effector_destroy trigger can be + used to simulate this. Set KILLINFWATER to have them die in func_water volumes. + + ---------------------------------------------------------------------------------------- + ANGLES EXPLAINED: + + The angle limits may take a while to get used to, but it's a really powerful way to + control the direction and spread. Start by setting just v1 and h1 to get a tight stream + in the general direction, then adjust v1/v2 and h1/h2 to within a few degrees (plus and minus) + of the original value to increase the spread for a cone-shaped fountain. Ommit either + h2 or v2 for a fan shaped emission, or set v1=1 v2=360 h1=1 h2=360 for a fire-works style + spherical burst. + + The "emitter_angles.png" image included with this mod is a diagram that visualizes the + horizontal and vertical angle relationship (described below): + + When viewing a map from the top, an H angle value of 270 points up, and moves + clockwise, making right 360 (or 0), down 90 and left 180. Same goes for the V angle + when viewed from the front. + + The particle spread is always contained from the first angle (h1/v1) to the second angle (h2/v2), + going clockwise. So h1=10 h2=350 is NOT the same as h1=350 h2=10. (the first is a near circular spread, + while the second is a tight 20¼ fan shaped spread). + + Also note that although 0 would normally be a valid replacement for 360, you should use a range + of 1 - 360 as a value of 0 is simply ignored (though this may be desirable in certain situations). + +*/ + +//============================================================================ + +float ABSOLUTE = 2; +float TANGENTIAL = 16; +float NOT_X = 2; +float NOT_Y = 4; +float NOT_Z = 8; + +float EXTRAS_START_ON = 1; +float EMITSOLID = 2; +float REMOVEONTOUCH = 4; +float DIEAFTERANIM = 8; +float SPINPARTICLES = 16; +float STAGGERFRAMES = 32; +float KILLINFWATER = 64; +float USEEFFECTORS = 128; +float STARTSTOPPED = 256; + +.float extras_v1, extras_v2, extras_h1, extras_h2; +.float frate, frate2, nfrms, nfrms2; +.float lspan, lspan2, ppe, stagcnt; + +void() effector_use = +{ + if (self.state) + self.state = FALSE;// off + else + self.state = TRUE;// on +}; + +void() effector_destroy = +{ + if (!self.state) return;// Disabled + if (other.classname != "particle") return; + if (!(other.owner.spawnflags & USEEFFECTORS)) return; + if (other.trigger_field == self) return;// Already affected by this trigger + + if (random() < self.count) { + self = other; + self.think1();// kill it + } else + other.trigger_field = self;// Can no longer affect this particle +}; + +void() effector_push = +{ + if (!self.state) return;// Disabled + if (other.classname != "particle") return; + if (!(other.owner.spawnflags & USEEFFECTORS)) return; + if (other.trigger_field == self) return;// Already affected by this trigger + + if (random() < self.count) {// push it + other.velocity = (other.velocity - (other.velocity*self.cnt)) + self.mangle; + if (self.spawnflags & TANGENTIAL) + other.angles = vectoangles(other.velocity); + } + + other.trigger_field = self;// Can no longer affect this particle +}; + +void() effector_gravity = +{ + if (!self.state) return;// Disabled + if (other.classname != "particle") return; + if (!(other.owner.spawnflags & USEEFFECTORS)) return; + if (other.trigger_field == self) return;// Already affected by this trigger + + if (random() < self.count) {// modify gravity + + if (self.spawnflags & ABSOLUTE) + other.gravity = self.gravity; + else + other.gravity = other.gravity + self.gravity; + } + + other.trigger_field = self;// Can no longer affect this particle +}; + +void() effector_turbulence = +{ + local float r; + + if (!self.state) return;// Disabled + if (other.classname != "particle") return; + if (!(other.owner.spawnflags & USEEFFECTORS)) return; + if (other.trigger_field == self) return;// Already affected by this trigger + + if (random() < self.count) {// add turbulence + + if (random() > 0.5) r = -1; else r = 1; + + if (!(self.spawnflags & NOT_X)) + other.velocity_x = (other.velocity_x - (other.velocity_x*self.cnt)) + r*(random()*self.speed); + if (!(self.spawnflags & NOT_Y)) + other.velocity_y = (other.velocity_y - (other.velocity_y*self.cnt)) + r*(random()*self.speed); + if (!(self.spawnflags & NOT_Z)) + other.velocity_z = (other.velocity_z - (other.velocity_z*self.cnt)) + r*(random()*self.speed); + + if (self.spawnflags & TANGENTIAL) + other.angles = vectoangles(other.velocity); + } + + other.trigger_field = self;// Can no longer affect this particle +}; + +// attrators keep influencing particles that are caught +void() effector_attract = +{ + local vector dir; + + if (!self.state) return;// Disabled + if (other.classname != "particle") return; + if (!(other.owner.spawnflags & USEEFFECTORS)) return; + if (other.frags) return;// Already failed to catch this one + if (other.teleport_time > time) return;// Timed out + + if (random() < self.count || other.trigger_field == self) { + dir = normalize(self.dest - other.origin); + other.velocity = (other.velocity - (other.velocity*self.cnt)) + (dir*self.speed); + if (self.spawnflags & TANGENTIAL) + other.angles = vectoangles(other.velocity); + } + else + other.frags = TRUE;// can't touch this one + + other.teleport_time = time + 0.1;// Time out + other.trigger_field = self;// clear other triggers, and guarentee re-influence + +}; + +// friction triggers keep influencing particles that are caught +void() effector_friction = +{ + if (!self.state) return;// Disabled + if (other.classname != "particle") return; + if (!(other.owner.spawnflags & USEEFFECTORS)) return; + if (other.frags) return;// Already failed to catch this one + if (other.teleport_time > time) return;// Timed out + + if (random() < self.count || other.trigger_field == self) + other.velocity = other.velocity - (other.velocity*self.speed); + else + other.frags = TRUE;// can't touch this one + + other.teleport_time = time + 0.1;// Time out + other.trigger_field = self;// clear other triggers, and guarentee re-influence + +}; + + +/*QUAKED t_effector_friction (0 .5 .8) ? EXTRAS_START_ON +Applies friction to particles, slowing them down (negative values speed particles up) + +"speed" Amount of Friction (max 100 = dead stop, negative values can go further though -200 etc.) +"count" Override the default 100% of particles affected (valid: 1-99 i.e 50 affects roughly 50% of the particles) +"targetname" Can be enabled/disabled + +Spawnflags +"EXTRAS_START_ON" Start in enabled state even if targeted + +*/ +void() t_effector_friction = +{ + InitTrigger (); + + if (!self.count || self.count<0 || self.count>100) + self.count = 100; + + self.count = self.count*0.01; + + self.speed = self.speed/100.0; + if (self.speed > 1.0) self.speed = 1.0; + + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + self.state = FALSE;// off + else + self.state = TRUE;// on + + self.use = effector_use; + self.touch = effector_friction; +}; + +/*QUAKED t_effector_attract (0 .5 .8) ? EXTRAS_START_ON +Particles touching this trigger are attracted to it's centre. Can also repel particles with +negative strength. This works best with particles that have a low gravity setting. + +"speed" Strength of the attraction +"cnt" Percentage of original particle velocity to diminish +"count" Override the default 100% of particles affected (valid: 1-99 i.e 50 affects roughly 50% of the particles) +"targetname" Can be enabled/disabled + +Spawnflags +"EXTRAS_START_ON" Start in enabled state even if targeted +"TANGENENTAL" Particles turn to face new direction + +*/ +void() t_effector_attract = +{ + InitTrigger (); + + if (!self.count || self.count<0 || self.count>100) + self.count = 100; + + self.count = self.count*0.01; + + if (self.cnt<0) self.cnt = 0; + if (self.cnt>100) self.cnt = 100; + + self.cnt = self.cnt*0.01; + + if (!self.speed) + self.speed = 280; + + // Save out the physical center + self.dest_x = (self.mins_x + self.maxs_x)*0.5; + self.dest_y = (self.mins_y + self.maxs_y)*0.5; + self.dest_z = (self.mins_z + self.maxs_z)*0.5; + + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + self.state = FALSE;// off + else + self.state = TRUE;// on + + self.use = effector_use; + self.touch = effector_attract; +}; + + +/*QUAKED t_effector_trubulence (0 .5 .8) ? EXTRAS_START_ON +Pushes particles at random speeds in all directions (can exlude certain axii) + +"speed" Max amount of turbulence +"cnt" Percentage of original particle velocity to diminish +"count" Override the default 100% of particles affected (valid: 1-99 i.e 50 affects roughly 50% of the particles) +"targetname" Can be enabled/disabled + +Spawnflags +"EXTRAS_START_ON" Start in enabled state even if targeted +"NOT_X" Don't affect X direction +"NOT_Y" Don't affect Y direction +"NOT_Z" Don't affect Z direction +"TANGENENTAL" Particles turn to face new direction + +*/ +void() t_effector_trubulence = +{ + InitTrigger (); + + if (!self.count || self.count<0 || self.count>100) + self.count = 100; + + self.count = self.count*0.01; + + if (!self.speed) + objerror("t_effector_trubulence with no velocity"); + + if (self.cnt<0) self.cnt = 0; + if (self.cnt>100) self.cnt = 100; + + self.cnt = self.cnt*0.01; + + self.speed = fabs(self.speed); + + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + self.state = FALSE;// off + else + self.state = TRUE;// on + + self.use = effector_use; + self.touch = effector_turbulence; +}; + + +/*QUAKED t_effector_gravity (0 .5 .8) ? EXTRAS_START_ON ABSOLUTE +Modifies particle gravity + +"gravity" Add this to current gravity value, or change to this value if "ABSOLUTE" is set +"count" Override the default 100% of particles affected (valid: 1-99 i.e 50 affects roughly 50% of the particles) +"targetname" Can be enabled/disabled + +Spawnflags +"EXTRAS_START_ON" Start in enabled state even if targeted +"ABSOLUTE" Particles use new gravity outright + +*/ +void() t_effector_gravity = +{ + InitTrigger (); + + if (!self.count || self.count<0 || self.count>100) + self.count = 100; + + self.count = self.count*0.01; + + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + self.state = FALSE;// off + else + self.state = TRUE;// on + + self.use = effector_use; + self.touch = effector_gravity; +}; + +/*QUAKED t_effector_push (0 .5 .8) ? EXTRAS_START_ON ABSOLUTE +Pushes particles in a new direction + +"mangle" X Y Z speed +"cnt" Percentage of original particle velocity to diminish +"count" Override the default 100% of particles affected (valid: 1-99 i.e 50 affects roughly 50% of the particles) +"targetname" Can be enabled/disabled + +Spawnflags +"EXTRAS_START_ON" Start in enabled state even if targeted +"TANGENENTAL" Particles turn to face new direction + +*/ +void() t_effector_push = +{ + InitTrigger (); + + if (!self.count || self.count<0 || self.count>100) + self.count = 100; + + self.count = self.count*0.01; + + if (self.cnt<0) self.cnt = 0; + if (self.cnt>100) self.cnt = 100; + + self.cnt = self.cnt*0.01; + + // NOTE: mangle of '0 0 0' is ok (let gravity take over) + + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + self.state = FALSE;// off + else + self.state = TRUE;// on + + self.use = effector_use; + self.touch = effector_push; +}; + +/*QUAKED t_effector_destroy (0 .5 .8) ? EXTRAS_START_ON +Kills particles that touch it + +"count" Override the default 100% obliteration (valid: 1-99 i.e 50 affects roughly 50% of the particles) +"targetname" Can be enabled/disabled + +Spawnflags +"EXTRAS_START_ON" Start in enabled state even if targeted + +*/ +void() t_effector_destroy = +{ + InitTrigger (); + + if (!self.count || self.count<0 || self.count>100) + self.count = 100; + + self.count = self.count*0.01; + + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + self.state = FALSE;// off + else + self.state = TRUE;// on + + self.use = effector_use; + self.touch = effector_destroy; +}; + +//============================================================================ + +// Return a particle origin for a brush volume or point entity +vector() particle_origin = +{ + local vector org; + + // Point + if (!self.aflag) { + if (self.owner)// Adjust origin relative to the parent train + org = self.origin + self.dest; + else + org = self.dest; + + // Volume (submodels always have an origin of '0 0 0' so they're always in sync with the parent train) + } else { + org_x = self.absmin_x + (random() * self.size_x); + org_y = self.absmin_y + (random() * self.size_y); + org_z = self.absmin_z + (random() * self.size_z); + } + + return org; +}; + +// Play death model sequence +void() particle_death_anim = +{ + if (self.frame+1 == self.owner.nfrms2) {// done + remove(self); + return; + } + + self.frame = self.frame + 1; + self.nextthink = time + self.owner.frate2; +}; + +// Particle is done +void() particle_die = +{ + self.classname = "p_dying";// So effectors ignore dying particles + + if (self.owner.noise2) + sound (self, CHAN_VOICE, self.owner.noise2, 1, ATTN_NORM); + + if (!self.owner.mdl2) { + remove(self); + return; + } + + self.solid = SOLID_NOT;// Change this and DIE! + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + setorigin(self, self.origin + '0 0 4');// kick it up a bit + self.frame = 0; + setmodel (self, self.owner.mdl2); + self.think = particle_death_anim; + self.nextthink = time + self.owner.frate2; +}; + +// Animate Particles +void() particle_think = +{ + if (self.ltime < time) {// done + particle_die(); + return; + } + + if (self.frame+1 == self.owner.nfrms) { + if (self.owner.spawnflags & DIEAFTERANIM) {// done + particle_die(); + return; + } else + self.frame = 0;// loop + } + else + self.frame = self.frame + 1; + + self.nextthink = time + self.owner.frate; +}; + +// Do damage and play hit sound +void() particle_touch = +{ + // Don't die on other particles + if (other.classname == "particle") + return; + + if (self.cnt == 3) + return; // Don't go nuts (especially if caught up) + + if (!self.cnt) {// Only play sound on first hit + if (self.owner.noise1) + sound (self, CHAN_VOICE, self.owner.noise1, 1, ATTN_NORM); + } + + self.cnt = self.cnt + 1; + + if (self.owner.dmg != 0) + { + if (other.takedamage) + { + if (self.attack_finished < time) + { + if (self.owner.dmg > 0 && self.owner.weapon >= TE_SPIKE)// Negative damage heals + spawn_touchblood (self, other, self.owner.dmg); + + T_Damage (other, self, self, self.owner.dmg,DAMARMOR); + self.attack_finished = time + 1;// Don't go nuts if particle doesn't die on touch + } + } + // Do a temp ent effect + else if (self.owner.weapon >= TE_SPIKE) + { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, self.owner.weapon); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + } + + if (self.owner.spawnflags & REMOVEONTOUCH)// done + particle_die(); +}; + +//============================================================================ + +.float ang_ofs; +void() emitter_pause; +void() emitter_emit; + +float(string type) emitter_checkrelay = +{ + if (self.old_velocity == '0 0 0') return FALSE;// no spin + + if (type == "t_changedir") { + if (self.state == REVERSE) + self.state = FORWARD; + else + self.state = REVERSE; + return TRUE; + } + else if (type == "t_forward") { + self.mangle = self.old_velocity; + self.state = FORWARD; + return TRUE; + } + else if (type == "t_reverse") { + self.mangle = self.old_velocity; + self.state = REVERSE; + return TRUE; + } + else if (type == "t_go") { + self.mangle = self.old_velocity; + return TRUE; + } + else if (type == "t_stop") { + self.mangle = '0 0 0'; + return TRUE; + } + + return FALSE; +}; + +void() emitter_start = +{ + if (emitter_checkrelay(other.classname)) return;// spin trigger + + self.use = emitter_pause;// next use stops it + self.nextthink = time + 0.01; +}; + +void() emitter_pause = { + if (emitter_checkrelay(other.classname)) return;// spin trigger + + // Wait around for next use + self.nextthink = -1; + self.use = emitter_start; +}; + +void() emitter_emit = { + local entity p; + local vector dir; + + if (self.noise != string_null && self.count == 1)// Play emitter noise + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Emit a particle + p = spawn (); + p.owner = self; + p.origin = particle_origin(); + setorigin (p, p.origin); + setmodel (p, self.mdl); + setsize (p, VEC_ORIGIN, VEC_ORIGIN); + + p.solid = self.cnt; + p.movetype = self.style; + p.gravity = self.gravity; + p.effects = self.drag; + p.touch = particle_touch; + p.classname = "particle"; + p.think1 = particle_die;// So other triggers can kill'em + + // Get the direction for this particle + dir_x = SUB_RandomRange(self.extras_v1, self.extras_v2); + dir_y = SUB_RandomRange(self.extras_h1, self.extras_h2); + dir_z = 0; + +// if (dir_x >= 180) dir_x = dir_x - 360; +// if (dir_y >= 180) dir_y = dir_y - 360; + + // Add emitter rotation + if (self.mangle != '0 0 0') { + + if (self.state == FORWARD) + self.ang_ofs = self.ang_ofs + 0.01; + else + self.ang_ofs = self.ang_ofs - 0.01; + + if (self.ang_ofs == 360) self.ang_ofs = 0; + if (self.ang_ofs == -360) self.ang_ofs = 0; + + dir = dir + (self.mangle*self.ang_ofs); + } + + // Fling it... + makevectors(dir); + p.velocity = v_forward * SUB_RandomRange(self.speed, self.speed2); + + // Face the move direction (doesn't affect parallel sprites) + p.angles = vectoangles(p.velocity); + + // Put a spin on the particle (doesn't affect parallel sprites) + if (self.spawnflags & SPINPARTICLES) { + p.avelocity = dir; + p.avelocity_z = random()*280; + } + + // Life span + p.ltime = time + SUB_RandomRange(self.lspan, self.lspan2); + + // Think + if (!self.nfrms) {// Not animated + p.frame = self.frame; + p.think = particle_die; + p.nextthink = p.ltime; + } + else {// Animated + + if (self.spawnflags & STAGGERFRAMES) {// Stagger start frames + if (self.stagcnt >= self.nfrms) + self.stagcnt = 0; + else { + p.frame = self.stagcnt; + self.stagcnt = self.stagcnt + 1; + } + } + + p.think = particle_think; + p.nextthink = time + self.frate; + } + + // keep emitting till ppe is met + if (self.ppe > 1) { + if (self.count == self.ppe)// done + self.count = 1; + else { + self.count = self.count + 1; + self.frags = self.frags + 1; + + if (self.frags > 12) {// Avoid stack overflows + self.nextthink = time+0.01; + self.frags = 0; + return; + } else + emitter_emit();// This may not be a good idea... + + return; + } + } + + // Done for now + if (self.wait == -1) { + emitter_pause(); + return; + } + + // Fire off another burst when ready + self.nextthink = time + SUB_RandomRange(self.wait, self.wait2); +}; + +void() emitter_find = +{ + // Check for a paret train + //if (self.target) train_ext_linkchild(); + + // Start it up + self.think = emitter_emit; + if (self.targetname != string_null && !(self.spawnflags & EXTRAS_START_ON)) + emitter_pause(); + else + emitter_start(); +}; + +// Clean up the mess of vars into something we can use +void() emitter_init = +{ + local float t; + + if (!self.mdl) + objerror("func_emitter: No model specified"); + else + precache_model(self.mdl); + + if (self.mdl2) precache_model(self.mdl2); + + // Copy off the angle velocity + if (self.avelocity != '0 0 0' && !(self.spawnflags & STARTSTOPPED)) { + self.mangle = self.avelocity; + self.old_velocity = self.avelocity; + self.avelocity = '0 0 0';// probably don't have to do this, but... + } + + self.state = FORWARD;// spin this way + + if ((!self.wait || self.wait < 0) && self.wait != -1) self.wait = 0.1; + if (self.wait2 < 0) self.wait2 = 0; + + // wait2 has to be greater than wait if defined + if (self.wait != -1) { + if (self.wait2 && (self.wait2 < self.wait)) { + t = self.wait; + self.wait = self.wait2; + self.wait2 = t; + } + } + + // cap the horizontal angle + if (self.extras_h1 > 360) self.extras_h1 = 360; + if (self.extras_h1 < 0) self.extras_h1 = 0; + if (self.extras_h2 < 0) self.extras_h2 = 0;// ignored + if (self.extras_h2 > 360) self.extras_h2 = 360; + + // invert H so everything's clockwise + if (self.extras_h1 != 0 && self.extras_h1 != 360) self.extras_h1 = 360 - self.extras_h1; + if (self.extras_h2 != 0 && self.extras_h2 != 360) self.extras_h2 = 360 - self.extras_h2; + if (self.extras_h2) { + t = self.extras_h1; + self.extras_h1 = self.extras_h2; + self.extras_h2 = t; + } + + // h2 has to be greater than h1 if defined + if (self.extras_h2 && (self.extras_h2 < self.extras_h1)) { + self.extras_h1 = self.extras_h1 - 360;// So it spans the right way + } + + // cap the vertical angle + if (self.extras_v1 > 360) self.extras_v1 = 360; + if (self.extras_v1 < 0) self.extras_v1 = 0; + if (self.extras_v2 < 0) self.extras_v2 = 0;// ignored + if (self.extras_v2 > 360) self.extras_v2 = 360; + // extras_v2 has to be greater than v1 if defined + if (self.extras_v2 && (self.extras_v2 < self.extras_v1)) { + self.extras_v1 = self.extras_v1 - 360;// So it spans the right way + } + +// if (self.extras_h1 == 0) self.extras_h1 = 360; +// if (self.extras_v1 == 0) self.extras_v1 = 360; + + if (self.noise) precache_sound(self.noise); + if (self.noise1) precache_sound(self.noise1); + if (self.noise2) precache_sound(self.noise2); + + // keep the movetype in check + if (self.style) {// MOVETYPE_NONE is ok, but not very exciting + if (self.style != MOVETYPE_TOSS && self.style != MOVETYPE_BOUNCE && self.style != MOVETYPE_FLY) + self.style = MOVETYPE_TOSS; + } + + // check for EF_ flags (should really only allow one at a time here) + if (self.effects) { + self.drag = self.effects; + self.effects = 0; + } + + if (self.speed < 0) self.speed = 0; + if (self.speed2 < 0) self.speed2 = 0; + + // speed2 has to be greater than speed if defined + if (self.speed2 && (self.speed2 < self.speed)) { + t = self.speed; + self.speed = self.speed2; + self.speed2 = t; + } + + if (!self.lspan || self.lspan < 0) self.lspan = 3; + if (self.lspan2 < 0) self.lspan2 = 0; + + // lspan2 has to be greater than lspan if defined + if (self.lspan2 && (self.lspan2 < self.lspan)) { + t = self.lspan; + self.lspan = self.lspan2; + self.lspan2 = t; + } + + if (self.nfrms < 0) self.nfrms = 0; + if (self.nfrms2 < 0) self.nfrms2 = 0; + if (!self.frate || self.frate < 0) self.frate = 0.1; + if (!self.frate2 || self.frate2 < 0) self.frate2 = 0.1; + + self.stagcnt = self.frame;// start frame may not be 0 + + self.count = 1;// ppe is not zero based + + // save off solid type to be copied off to particles + if (self.spawnflags & EMITSOLID) + self.cnt = SOLID_BBOX;// Blocking + else if (self.dmg || self.spawnflags & REMOVEONTOUCH || self.spawnflags & USEEFFECTORS) + self.cnt = SOLID_TRIGGER;// Passthrough, but still touch + else + self.cnt = SOLID_NOT;// Passthrough, no touch + + if (self.weapon > TE_TELEPORT) + self.weapon = -1; + + // wait for targets to spawn + self.nextthink = time + 0.2;// start after first frame to allow train to move to it's startpoint + self.think = emitter_find; +}; + +/*QUAKED func_emitter_volume (0 .5 .8) ? EXTRAS_START_ON EMITSOLID REMOVEONTOUCH DIEAFTERANIM STAGGERFRAMES KILLINFWATER USEEFFECTORS STARTSTOPPED +Emit particles from a random spot within a brush volume. + +*/ +void() func_emitter_volume = +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.model); + setsize (self, self.mins , self.maxs); + setorigin (self, self.origin); + self.modelindex = 0; + self.model = ""; + self.classname = "emitter"; + + self.aflag = TRUE;// volume origin + emitter_init(); +}; + +/*QUAKED func_emitter (0 .5 .8) (-8 -8 -8) (8 8 8) ? EXTRAS_START_ON EMITSOLID REMOVEONTOUCH DIEAFTERANIM STAGGERFRAMES KILLINFWATER USEEFFECTORS STARTSTOPPED +Emit particles from a fixed point. + +*/ +void() func_emitter = +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.dest = self.origin;// in case it's linked + self.classname = "emitter"; + + self.aflag = FALSE;// point origin + emitter_init(); +}; + +/* The following apply to both func_emitter and func_emitter_volume + +-EMITTER OPTIONS- +"wait" Delay between particle emissions (-1 is a single burst, then pause) +"wait2" If set, delay is a random number between "wait" and "wait2" (unless "wait" is -1) +"ppe" Particles per emission (default is 1) +"h1" Toss particles along this horizontal (yaw) angle (1¼ - 360¼) +"h2" If set, tossess particles along a random horizontal angle between "h1" and "h2" +"v1" Toss particles along this vertical (pitch) angle (1¼ - 360¼) 270 is up, 90 is down. +"v2" If set, tossess particles along a random vertical angle between "v1" and "v2" +"avelocity" X Y Z emitter angle velocity (IMPORTANT: rotates after each emittion, this is NOT time based!) +"noise" Noise the emitter makes when spawning a new particle (USE WITH CAUTION WITH HIGH FREQUENCY EMITTERS!) +"target" Attach the emitter to a func_train_ext +"targetname" Can be triggered on/off + +-PARTICLE OPTIONS- +"style" Particle movetype (MOVETYPE_BOUNCE, MOVETYPE_TOSS, MOVETYPE_FLY or MOVETYPE_NONE) +"speed" Speed of the particles +"speed2" If set, speed is a random number between "speed" and "speed2" +"lspan" Life span of particles in seconds +"lspan2" If set, life span is a random number between "lspan" and "lspan2" +"mdl" Path to the sprite or model file to use as particles +"frame" Start frame (model/sprite frame) +"nfrms" Number of animation frames +"frate" Override the default 10fps (0.1) animation rate +"gravity" Alter gravity G = sv_gravity*self.gravity (NOTE: 0 or 1 is unaltered - use 0.001 for "zero G") +"dmg" Damage particles do when they hit something +"effects" EF_MUZZLEFLASH, EF_DIMLIGHT, EF_BRIGHTLIGHT or EF_BRIGHTFIELD +"noise1" Noise particles make when they hit something (USE WITH CAUTION WITH HIGH FREQUENCY EMITTERS!) +"noise2" Noise particles make when they die (USE WITH CAUTION WITH HIGH FREQUENCY EMITTERS!) +"message" Death message if player is killed by a particle + +-DEATH MODEL OPTIONS- +"weapon" If "dmg" is set (and positive) a particle acts like a projectile and spawns blood/sparks when doing damage or + this TE_ effect when hitting the world. (from 0 - 11) TE_SPIKE, TE_SUPERSPIKE, TE_GUNSHOT, TE_EXPLOSION, + TE_TAREXPLOSION, TE_LIGHTNING1, TE_LIGHTNING2, TE_WIZSPIKE, TE_KNIGHTSPIKE, TE_LIGHTNING3, TE_LAVASPLASH, TE_TELEPORT + (use -1 for no effect, default is TE_SPIKE) +"mdl2" Path to the sprite or model to become when life span expires +"nfrms2" Number of animation frames for "death" animations +"frate2" Override the default 10fps (0.1) animation rate for the "death" model + +-SPAWNFLAGS- +"EXTRAS_START_ON" Emitters with targetnames will wait for a trigger event unless this is set +"EMITSOLID" Particles are solid, block players, and collide with each other +"REMOVEONTOUCH" Remove particles (or do death animation) on touch +"DIEAFTERANIM" Remove particles (or do death animation) after reaching the last animation frame (loop animation otherwise) +"SPINPARTICLES" Gives particles semi-random angle velocity (doesn't affect parallel sprites) +"STAGGERFRAMES" Each new particle begins with the next sequential animation frame + (NOTE: DIEAFTERANIM will still kill it after the absolute "last" frame) +"KILLINFWATER" Remove particles (or do death animation) when in contact with func_water +"USEEFFECTORS" Partciles generated by this emitter are affected by effector triggers +"STARTSTOPPED" Emitter won't spin until it's used by a trigger_go/reverse/forward (only affects emitters with avelocity) + +*/ + +//============================================================================ diff --git a/QC_other/QC_keep/func.qc b/QC_other/QC_keep/func.qc new file mode 100644 index 00000000..a0ff245b --- /dev/null +++ b/QC_other/QC_keep/func.qc @@ -0,0 +1,885 @@ +/*====================================================================== +SIMPLE BMODELS +======================================================================*/ + +float FUNC_AFRAME = 2; // Start with A frame (animated textures) +float FUNC_MODCHECK = 16; // Will remove this entity if THIS mod is active + +float FUNC_LASERSOLID = 2; // Func bmodel blocks on all sides +float FUNC_LASERNODMG = 4; // Func bmodel does no touch damage + +float FUNC_SKILLSTARTOPEN = 1; // Reverse setup for lighting issues + +float BOB_COLLISION = 2; // Collision for misc_bob +float BOB_NONSOLID = 4; // Non solid for func_bob + +/*====================================================================== +/*QUAKED func_wall (0 .5 .8) ? x AFRAME x x MODCHECK x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A SOLID bmodel with toggled animated texture +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +AFRAME : Start with the A frame animated texture +MODCHECK : Will remove this entity if THIS mod is active +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +A SOLID bmodel with toggled animated texture + +======================================================================*/ +void() func_wall_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // toggle alternate textures + else self.frame = 1 - self.frame; + } +}; + +//---------------------------------------------------------------------- +void() func_wall_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() func_wall_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); +}; + +//---------------------------------------------------------------------- +void() func_wall_aframe = { }; + +//---------------------------------------------------------------------- +void() func_wall = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.angles = '0 0 0'; + self.classtype = CT_FUNCWALL; + self.bsporigin = TRUE; + self.mdl = self.model; + if (self.spawnflags & FUNC_AFRAME) self.frame = 1; + if (self.spawnflags & FUNC_MODCHECK) remove(self); + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) { + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + makestatic(self); + } + else { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_wall_on; + self.estate_off = func_wall_off; + self.estate_use = func_wall_use; + self.estate_aframe = func_wall_aframe; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + +/*====================================================================== +/*QUAKED func_illusionary (0 .5 .8) ? x AFRAME x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A NON SOLID bmodel with texture toggle +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +AFRAME : Start with the A frame animated texture +STARTOFF : Requires trigger to activate +-------- NOTES -------- +A NON SOLID bmodel with texture toggle + +======================================================================*/ +void() func_illusionary_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, self.mdl); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() func_illusionary_aframe = { }; + +//---------------------------------------------------------------------- +void() func_illusionary = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.angles = '0 0 0'; + self.classtype = CT_FUNCILLUSIONARY; + self.bsporigin = TRUE; + self.mdl = self.model; + if (self.spawnflags & FUNC_AFRAME) self.frame = 1; + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) { + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, self.mdl); + makestatic(self); + } + else { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_illusionary_on; + self.estate_off = func_wall_off; + self.estate_use = func_wall_use; + self.estate_aframe = func_illusionary_aframe; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + +/*====================================================================== +/*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 x x x x Not_Easy Not_Normal Not_Hard Not_DM +SOLID bmodel when player has SELECTED rune(s) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +E1 : Episode 1 +E2 : Episode 2 +E3 : Episode 3 +E4 : Episode 4 +-------- NOTES -------- +SOLID bmodel when player has SELECTED rune(s) + +======================================================================*/ +void() func_episodegate_use = +{ + // The RUNE condition has to be active + if (query_configflag(self.customkey) == self.customkey) self.estate_on(); + else self.estate_off(); +}; + +//---------------------------------------------------------------------- +void() func_episodegate = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.angles = '0 0 0'; + self.classtype = CT_FUNCEPISODEGATE; + self.bsporigin = TRUE; + self.mdl = self.model; + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Remove any extra spawnkey stuff like skill restrictions + self.customkey = self.spawnflags & SVR_RUNE_ALL; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_wall_on; + self.estate_off = func_wall_off; + self.estate_use = func_episodegate_use; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // Wait 1 frame before checking for rune keys + self.think = func_episodegate_use; + self.nextthink = time + 0.1; + } +}; + +/*====================================================================== +/*QUAKED func_bossgate (0 .5 .8) ? x x x x x x x x Not_Easy Not_Normal Not_Hard Not_DM +A NON SOLID bmodel when player has ALL runes +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +-------- NOTES -------- +A NON SOLID bmodel when player has ALL runes + +======================================================================*/ +void() func_bossgate_use = +{ + // The RUNE condition has to be active + if (query_configflag(SVR_RUNE_ALL) == SVR_RUNE_ALL) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() func_bossgate = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.angles = '0 0 0'; + self.classtype = CT_FUNCBOSSGATE; + self.bsporigin = TRUE; + self.mdl = self.model; + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_wall_on; + self.estate_off = func_wall_off; + self.estate_use = func_bossgate_use; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // Wait 1 frame before checking for rune keys + self.think = func_bossgate_use; + self.nextthink = time + 0.1; + } +}; + +/*====================================================================== + BModel laser (originally from Rubicon2 codebase by JohnFitz) + - Extended code to have different states and toggle function + - Added custom/silent sounds for lasers on/off + - Added on/off message once function + - Added collision and nodmg spawnflags + +/*====================================================================== +/*QUAKED func_laser (0 .5 .8) ? x SOLID NODMG x x x STARTOFF x +A togglable laser, hurts to touch, can be used to block players +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +message : message to display when switched ON +message2 : message to display when switched OFF +wait : -1 = will display the switching state messages only once +dmg : damage to do on touch. default 1 per 0.1s +alpha : alpha value will vary +/- 20% (def=0.5) +sounds : 1=laser, 2=power, 4=silent, 5=custom +noise1 : switched ON sound +noise2 : switched OFF sound +spr_frame : 1=Yellow, 2=Green, 4=Red, 8=Blue, 16=Purple, 32=Fire, 64=White +angle : Direction of particles to move (def=-2 down) +part_limit : Maximum active quantity of particles (def=25) +part_life : Lifetime of particle (def=2s) +part_velrand: Random movement of particles (def='4 4 4') +part_vol : Size of area to spawn particles in (def=bmodel) +wakeup_dist : Distance to wakeup particle emitter (def=768) +spawn_base : Minimum time frame to spawn particles (def=0.1s) +spawn_rand : Random time amount to add to spawning times (def=0.1s) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +SOLID : Will block anything +NODMG : Touch damage disabled +STARTOFF : Requires trigger to activate +-------- NOTES -------- +A togglable laser, hurts to touch, can be used to block players + +======================================================================*/ +void() func_laser_touch = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.spawnflags & FUNC_LASERNODMG) return; + if (other.takedamage == DAMAGE_NO) return; + if (self.attack_finished < time) { + T_Damage (other, self, self, self.dmg, DAMARMOR); + self.attack_finished = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() func_laser_think = +{ + if (self.estate == ESTATE_BLOCK) return; + // Change the density of the alpha to make laser beam flicker + self.alpha = self.height*0.8 + (self.alpha * (random()*0.4)); + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() func_laser_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Switch laser to active + self.estate = ESTATE_ON; + + // Only play the ON sound and display message when not spawning + if (self.waitmin == TRUE) { + // Play sound on extra emitter if sounds been defined + if (self.sound_emitter && self.noise1 != "") + sound (self.sound_emitter, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + if (activator.flags & FL_CLIENT && self.message != "") + centerprint(activator,self.message); + if (self.wait == TRUE) self.message = ""; + } + else self.waitmin = TRUE; + + // Got to set solid/movetype before model + // Otherwise trigger state does not register properly + if (self.spawnflags & FUNC_LASERSOLID) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + } + else { + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + } + + // Add bmodel back to world (visually) + setmodel (self, self.mdl); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Switch ON any particle emitter + if (self.part_emitter) misc_particle_on(self.part_emitter); + + // Reset touch and laser blink effect + self.touch = func_laser_touch; + self.think = func_laser_think; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() func_laser_off = +{ + // Switch laser to active + self.estate = ESTATE_OFF; + + // Only play the OFF sound and display message when not spawning + if (self.waitmin == TRUE) { + // Play sound on extra emitter if sounds been defined + if (self.sound_emitter && self.noise2 != "") + sound (self.sound_emitter, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + if (activator.flags & FL_CLIENT && self.message2 != "") + centerprint(activator,self.message2); + if (self.wait == TRUE) self.message2 = ""; + } + else self.waitmin = TRUE; + + // Switch OFF any particle emitter + if (self.part_emitter) misc_particle_off(self.part_emitter); + + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, ""); +}; + + +//---------------------------------------------------------------------- +void() func_laser = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_FUNCLASER; // Classtype + self.mdl = self.model; // Save for later (on function) + if (self.spr_frame > 0 && CheckZeroVector(self.angles)) self.angles = '0 -2 0'; + InitTrigger(); // Add to work and initialize + + if (!self.alpha) self.alpha = 0.5; // Lasers always transparent + self.height = self.alpha; // Used for think function + if (!self.dmg) self.dmg = 1; // Default tickle + if (self.wait < 0) self.wait = TRUE;// Display message once? + else self.wait = FALSE; + self.waitmin = FALSE; // Spawning no message check + + // Pre-cache sounds and setup sound emitter + if (self.sounds > 0 && self.sounds < 3) { + if (self.sounds == 1) { + self.noise1 = "misc/laseron.wav"; + self.noise2 = "misc/laseroff.wav"; + } + else if (self.sounds == 2) { + self.noise1 = "ambience/power_on.wav"; + self.noise2 = "ambience/power_off.wav"; + } + precache_sound(self.noise1); + precache_sound(self.noise2); + + // Setup sound emitter where bmodel is correctly located + self.sound_emitter = spawn(); + self.sound_emitter.origin = bmodel_origin(self); + setorigin(self.sound_emitter, self.sound_emitter.origin); + self.classtype = CT_SOUNDEMITTER; + } + + // Check for particles emitter type + if (self.spr_frame > 0) { + self.part_active = PARTICLE_STYLE_FFIELD; + // Volume/direction need to be set early, just in case + // the entity starts off and then it has no volume! + self.part_vol = self.size * 0.5; + self.part_vel = self.movedir * 4; + if (self.spawnflags & ENT_STARTOFF) self.lip = PARTICLE_START_OFF; + else self.lip = PARTICLE_START_ON; + self.part_emitter = spawn_pemitter(self, self, self.part_active, self.lip); + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_laser_on; + self.estate_off = func_laser_off; + + if (self.spawnflags & ENT_STARTOFF) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +/*QUAKED func_skill (0 .5 .8) ? STARTOPEN x x x x START_OFF x +This is a special bmodel that changes texture based on current skill level +Will keep checking skill level until triggered (based on door QC code) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +style : Skill Level - 0 = easy, 1 = normal, 2 = hard, 3 = nightmare +message2 : Override message to display when bmodel is touched/damaged +target : Particle emitters to switch on/off +target2 : target(s) to fire when touched/damaged +health : Can be damaged instead of touched +angle : movement direction for trigger event +speed : movement speed (100 default) +lip : lip remaining at end of move (8 default) +noise1 : Custom sound - Stop moving (doors/drclos4.wav) +noise2 : Custom sound - Start/Loop moving (doors/stndr1.wav) +noise3 : Custom sound - Touching (plats/medplat2.wav) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOPEN : bmodel works in reverse state (moved to dest at spawn) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Visual skill selection/update function + +======================================================================*/ +void() func_skill_check = +{ + // If blocked by entity state system do nothing + if (self.estate & ESTATE_BLOCK) return; + + // Has the skill level been changed? + if (self.attack_finished != skill) { + // Stop this entity constantly changing + self.attack_finished = skill; + + if (self.target != "") { + self.enemy = find(world,targetname,self.target); + while (self.enemy) { + // Found a particle emitter? + if (self.enemy.classtype == CT_PARTICLEEMIT) { + if (self.style == skill) misc_particle_on(self.enemy); + else misc_particle_off(self.enemy); + } + + // Keep searching for more targets in chain + self.enemy = find(self.enemy,targetname,self.target); + } + } + + // Is the current skill level active? + if (self.style == skill) self.frame = 0; + else self.frame = 1; // Blank texture (off) + } + self.nextthink = time + 0.1; + self.think = func_skill_check; +}; + +//---------------------------------------------------------------------- +void() func_skill_touch = +{ + // If blocked by entity state system do nothing + if (self.estate & ESTATE_BLOCK) return; + if (self.spawnflags & ENT_STARTOFF) return; + if ( !(other.flags & FL_CLIENT) ) return; + if ( other.health < 1 ) return; + + // If skill level is changing, say so on console + if (skill != self.style) { + if (self.message2 != "") sprint(other, self.message2); + else { + sprint(other,"Skill level "); + if (self.style == SKILL_EASY) sprint(other,"EASY"); + else if (self.style == SKILL_NORMAL) sprint(other,"NORMAL"); + else if (self.style == SKILL_HARD) sprint(other,"HARD"); + else sprint(other,"NIGHTMARE"); + sprint(other," has been selected!"); + } + sprint(other,"\n"); + stuffcmd (other, "bf\n"); + + // Change skill level + cvar_set ("skill", ftos(self.style)); + skill = self.style; + + // Force quick update + func_skill_check(); + + // Any other targets to fire when touch/damaged + if (self.target2 != "") trigger_strs(self.target2, other); + } + + // Play touch sound regardless of skill change + if (self.pausetime < time) { + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + self.pausetime = time + 1; // No constant sound + } +}; + +//---------------------------------------------------------------------- +void() func_skill_killed = +{ + other = damage_attacker; // The attacker + self.health = self.max_health; // Reset health to original value + + // All other exceptions are in the touch function + func_skill_touch(); +}; + +//---------------------------------------------------------------------- +void() func_skill_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + func_skill_check(); +}; + +//---------------------------------------------------------------------- +void() func_skill_stop = +{ + // Stop sound, ON and particles! + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + // Need to reset local entity time, otherwise timer is broken + // it because of the SUB_CalcMove function changes it + self.ltime = time; + func_skill_on(); +}; + +//---------------------------------------------------------------------- +void() func_skill_use = +{ + // Trigger once functionality + self.estate_use = SUB_Null; + self.estate = ESTATE_OFF; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove (self.pos2, self.speed, func_skill_stop); +}; + +//---------------------------------------------------------------------- +void() func_skill_off = { + self.estate = ESTATE_OFF; + self.frame = 1; + + // Switch off any particle emitters + if (self.target != "") { + self.enemy = find(world,targetname,self.target); + while (self.enemy) { + // Found a particle emitter? + if (self.enemy.classtype == CT_PARTICLEEMIT) + misc_particle_off(self.enemy); + + // Keep searching for more targets in chain + self.enemy = find(self.enemy,targetname,self.target); + } + } +}; + +//---------------------------------------------------------------------- +void() func_skill = { + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup default sounds if no custom sounds exist + if (self.noise1 == "") self.noise1 = "doors/drclos4.wav"; + if (self.noise2 == "") self.noise2 = "doors/stndr1.wav"; + if (self.noise3 == "") self.noise3 = "plats/medplat2.wav"; + + //Pre-cache all sounds + precache_sound(self.noise1); // stop sound (big clunk sound) + precache_sound(self.noise2); // moving sound (door moving) + precache_sound(self.noise3); // Touch sound + + self.classtype = CT_FUNCSKILL; // Type + self.bsporigin = TRUE; // Bmodel (0,0,0 origin) + self.mdl = self.model; + SetMovedir (); + + if (!self.speed) self.speed = 100; // Default movement speed + if (!self.lip) self.lip = 8; // End movement distance + + //---------------------------------------------------------------------- + // Is the skill level within proper range? + if (self.style < SKILL_EASY || self.style > SKILL_NIGHTMARE) + self.style = 0; // Default skill = EASY + self.attack_finished = -1; // Always check first time + self.lefty = cvar("skill"); // Read current setting + if (self.style != self.lefty) self.frame = 1; + + //---------------------------------------------------------------------- + // Add bmodel to world and work out movement positions + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.mdl); + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + //---------------------------------------------------------------------- + // FUNC_SKILL_START_OPEN is design is hide a skill pillar + // until it is triggered (nightmare skill) + if (self.spawnflags & FUNC_SKILLSTARTOPEN) { + setorigin (self, self.pos2); + self.pos2 = self.pos1; + self.pos1 = self.origin; + } + + // If the skill pillar is setup with a targetname then wait for + // a trigger event before becoming active (updates+particles) + if (self.targetname != "") { + self.spawnflags = self.spawnflags | ENT_STARTOFF; + self.estate_use = func_skill_use; + self.frame = 1; // Always starts off + } + + // Setup Entity State functionality + self.use = entity_state_use; + self.estate_on = func_skill_on; + self.estate_off = func_skill_off; + self.estate = ESTATE_OFF; + + // Can either be touched or damaged, never both! + if (self.health != 0) { + self.health = self.max_health = 1; + self.th_die = func_skill_killed; + self.takedamage = DAMAGE_YES; + self.touch = SUB_Null; + } + else { + self.touch = func_skill_touch; + self.takedamage = DAMAGE_NO; + } + + // Wait random amount for all entities to spawn + self.nextthink = time + 0.1 + random()*0.5; + if (self.spawnflags & ENT_STARTOFF) self.think = self.estate_off; + else self.think = self.estate_on; +}; + +/*====================================================================== +/*QUAKED func_bob (0 .5 .8) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A SOLID bmodel that gently moves back and forth +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +angle : direction movement, use "360" for angle 0 +height : direction intensity (def=4) +count : direction cycle timer (def=2s, minimum=1s) +waitmin : Speed up scale (def=1) 1+=non linear +waitmin2 : Slow down scale (def=0.75) +delay : Starting time delay (def=0, -1=random) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +A SOLID bmodel that gently moves back and forth + +======================================================================*/ +void() func_bob_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Toggle state (switch on or disable) + if (self.estate & ESTATE_BLOCK) self.estate = ESTATE_ON; + else self.estate = ESTATE_DISABLE; + } +}; + +//---------------------------------------------------------------------- +void() func_bob_timer = +{ + // Keep ticking in background, use local timer (faster) + self.think = func_bob_timer; + if (self.bsporigin) self.nextthink = self.ltime + 0.1; + else self.nextthink = time + 0.1; + + // Do nothing if entity state is off + if (self.estate & ESTATE_OFF) return; + + // Has the cycle completed? + if (self.attack_timer < time) { + // Don't reset bmodel if disabled + if (self.estate & ESTATE_DISABLE) { + self.attack_timer = LARGE_TIMER; + self.lefty = -1; + } + else { + // Setup bob cycle and half way point for slowdown + self.attack_timer = time + self.count; + self.distance = time + (self.count * 0.5); + // Flip direction of bmodel bob + self.lefty = 1 - self.lefty; + if (self.lefty < 1) self.t_length = self.height; + else self.t_length = -self.height; + } + // Always reset velocity and flags + self.velocity = '0 0 0'; + self.flags = 0; + } + + // Is the direction set? + // This is a block condition to prevent the bmodel moving + if (self.lefty != -1) { + // Slow down velocity (gradually) + if (self.distance < time) + self.velocity = self.velocity * self.waitmin2; + else { + // Speed up velocity (linear/exponentially) + self.t_length = self.t_length * self.waitmin; + self.velocity = self.velocity + (self.movedir * self.t_length); + } + } +}; + +//---------------------------------------------------------------------- +void() func_bob_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + if (self.bsporigin) { + // Check for solid spawnflag + if (self.spawnflags & BOB_NONSOLID) { + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_NOT; + } + else { + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + } + } + else { + self.movetype = MOVETYPE_FLY; + if (self.spawnflags & BOB_COLLISION) self.solid = SOLID_BBOX; + else self.solid = SOLID_NOT; + self.flags = 0; // Reset any onground flags + } + setmodel (self, self.mdl); + setsize (self, self.mins , self.maxs); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() func_bob_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.velocity = '0 0 0'; +}; + +//---------------------------------------------------------------------- +void() func_bob = +{ + self.classtype = CT_FUNCBOB; + // Using a custom model? + if (self.mdl == "") { + self.bsporigin = TRUE; + self.mdl = self.model; + } + else { + self.bsporigin = FALSE; + self.model = ""; + } + + SetMovedir (); + self.movedir = normalize(self.movedir); + + if (self.height <=0) self.height = 8; // Direction intensity + if (self.count <1) self.count = 2; // Direction switch timer + if (self.waitmin <=0) self.waitmin = 1; // Speed up + if (self.waitmin2 <=0) self.waitmin2 = 0.75; // Slow down + if (self.delay < 0) self.delay = random()* fabs(self.delay); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_bob_on; + self.estate_off = func_bob_off; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + + self.think = func_bob_timer; + self.nextthink = time + 0.1 + self.delay; +}; + +//---------------------------------------------------------------------- +void() misc_bob = +{ + if (self.mdl == "") self.mdl = MODEL_BROKEN; + precache_model(self.mdl); + + func_bob(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/func_buttons.qc b/QC_other/QC_keep/func_buttons.qc new file mode 100644 index 00000000..41746395 --- /dev/null +++ b/QC_other/QC_keep/func_buttons.qc @@ -0,0 +1,279 @@ +/*====================================================================== + BUTTON FUNCTIONS +======================================================================*/ +float BUTTON_STARTDIS = 32; // Button starts in disabled state +//---------------------------------------------------------------------- + +/*QUAKED func_button (0 .5 .8) ? x x x x x STARTDIS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Button (bmodel) with two states +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger at the start of the wait phase +angle : determines the move direction, use "360" for angle 0 +speed : Move Speed (def=40) +wait : wait before returning (def=1, -1 = never return) +delay : delay before button triggers +lip : lip remaining at end of move. (def=4) +health : Can be damaged instead of touched +sounds : 0=steam metal, 1=wooden, 2=metallic, 3=in-out, 4=Silent, 5=Custom +noise : custom sound - 1st movement +noise1 : custom sound - 2nd movement ('buttons/switch21.wav') +message: Centerprint Message to display when triggered +estate : Override starting entity state 1=ON, 2=OFF, 4=DISABLE +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTDIS : Starts disabled and waits for trigger +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Button (bmodel) with two states +*/ + +void() func_button_return; +//---------------------------------------------------------------------- +void() func_button_wait = +{ + self.state = STATE_TOP; + if (self.estate & ESTATE_BLOCK) return; + self.nextthink = self.ltime + self.wait; + self.think = func_button_return; + activator = self.enemy; + SUB_UseTargets(); + self.frame = 1; // use alternate textures +}; + +//---------------------------------------------------------------------- +void() func_button_done = +{ + self.frame = 0; // use normal textures + self.state = STATE_BOTTOM; + if (self.health) self.takedamage = DAMAGE_YES; +}; + +//---------------------------------------------------------------------- +void() func_button_return = +{ + self.state = STATE_DOWN; + if (self.estate & ESTATE_BLOCK) return; + if (self.noise1) sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + SUB_CalcMove (self.pos1, self.speed, func_button_done); +}; + +//---------------------------------------------------------------------- +void() func_button_fire = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.state == STATE_UP || self.state == STATE_TOP) return; + + self.state = STATE_UP; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + SUB_CalcMove (self.pos2, self.speed, func_button_wait); +}; + +//---------------------------------------------------------------------- +void() func_button_use = +{ + // Deal with DELAY functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong or door moving + if (self.estate & ESTATE_BLOCK) return; + + self.enemy = other; + func_button_fire(); + } +}; + +//---------------------------------------------------------------------- +// Default state for buttons, touch trigger +//---------------------------------------------------------------------- +void() func_button_touch = +{ + if ( !(other.flags & FL_CLIENT) ) return; + self.enemy = other; + func_button_fire(); +}; + +//---------------------------------------------------------------------- +// Only active if health set on trigger, touch function disabled +//---------------------------------------------------------------------- +void() func_button_killed = +{ + self.enemy = damage_attacker; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + func_button_fire(); +}; + +//---------------------------------------------------------------------- +// do nothing, just don't come all the way back out +//---------------------------------------------------------------------- +void() func_button_blocked = { }; + +//---------------------------------------------------------------------- +void() func_button_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + // Reset health, state and frame back to default + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + self.frame = 0; + + // reset health and damage trigger + if (self.max_health) { + self.health = self.max_health; + self.th_die = func_button_killed; + self.takedamage = DAMAGE_YES; + } +}; + +//---------------------------------------------------------------------- +void() func_button_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Reset health, position and frame back to default + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.takedamage = DAMAGE_NO; + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + self.frame = 0; +}; + +//---------------------------------------------------------------------- +void() func_button_disable = +{ + // Block damage function and show alternative texture + self.estate = ESTATE_DISABLE; + self.takedamage = DAMAGE_NO; + self.frame = 1; + // Make sure the button is moved to finished state + SUB_CalcMove (self.pos2, self.speed, func_button_wait); +}; + +//============================================================================= +void() func_button = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise == "") self.noise = SOUND_EMPTY; + + // Default 0 = air button + if (self.sounds == 0) self.noise = "buttons/airbut1.wav"; + else if (self.sounds == 1) self.noise = "buttons/switch21.wav"; + else if (self.sounds == 2) self.noise = "buttons/switch02.wav"; + else if (self.sounds == 3) self.noise = "buttons/switch04.wav"; + else if (self.sounds == 4) self.noise = SOUND_EMPTY; + precache_sound (self.noise); + + if (self.noise1 != "") precache_sound (self.noise1); + + self.classtype = CT_FUNCBUTTON; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + SetMovedir (); // Setup move direction base on angles + + // Default parameters and states + if (!self.speed) self.speed = 40; + if (!self.wait) self.wait = 1; + if (!self.lip) self.lip = 4; + self.state = STATE_BOTTOM; + + + // Setup the buttons two different state positions + // Got to add button to world for bmodel size parameter + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Cannot have a button start off or disabled + // with no targetname, how can it be actived!?! + if (self.spawnflags & BUTTON_STARTDIS && self.targetname == "") { + dprint("\b[BUTTON]\b Starting DISABLED with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + if (self.spawnflags & ENT_STARTOFF && self.targetname == "") { + dprint("\b[BUTTON]\b Starting OFF with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Can either shoot a button or touch it, never both + if (self.health) { + self.max_health = self.health; + self.th_die = func_button_killed; + self.takedamage = DAMAGE_YES; + } + // Important OR condition (touching only) + else self.touch = func_button_touch; + self.blocked = func_button_blocked; + + if (world.devdata & DEV_AMMO_N_HEALTH) { + if (self.wait) { + world.deventity.enemyhealth = world.deventity.enemyhealth + (self.health * 2); // assume that we will likely shoot the button twice if it can reset + } else { + world.deventity.enemyhealth = world.deventity.enemyhealth + self.health; // we only need to shoot it once, and only can shoot it once + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_button_on; + self.estate_off = func_button_off; + self.estate_use = func_button_use; + self.estate_disable = func_button_disable; + + // Check for the easy way to start a button disabled + if (self.spawnflags & BUTTON_STARTDIS) self.estate_disable(); + // Check for starting override for entity state + else if (self.estate & ESTATE_LOWER) { + if (self.estate == 1) self.estate_on(); + else if (self.estate == 2) { + // Make sure off function works, start with on state + self.estate = ESTATE_ON; + self.estate_off(); + } + else if (self.estate == 4) self.estate_disable(); + } + else { + // Check for starting off or default=on + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + diff --git a/QC_other/QC_keep/func_doors.qc b/QC_other/QC_keep/func_doors.qc new file mode 100644 index 00000000..bc48492e --- /dev/null +++ b/QC_other/QC_keep/func_doors.qc @@ -0,0 +1,806 @@ +/*====================================================================== + STANDARD DOOR FUNCTIONS +======================================================================*/ +float DOOR_START_OPEN = 1; // Work the opposite way around +float DOOR_SPAWN_TRIGGER = 2; // Spawn open trigger regardless of targetname +float DOOR_DONT_LINK = 4; // never link this door with anything +float DOOR_GOLD_KEY = 8; // Gold Key +float DOOR_SILVER_KEY = 16; // Silver Key +float DOOR_TOGGLE = 32; // Need trigger to open AND close + +/*====================================================================== +/*QUAKED func_door (0 .5 .8) ? STARTOPEN SPAWNTRIG DONTLINK GOLD SILVER TOGGLE STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Door (bmodel) with 2 states +-------- KEYS -------- +targetname : = "" door automatically opens, != "" requires trigger to open +if using entity state system set SPAWN_TRIG spawnflags to fix this problem +target : name of target(s) to trigger at the start opening sequence +angle : determines the opening direction, use "360" for angle 0 +speed : movement speed (def=100) +yaw_speed: return movement speed (def=self.speed) +wait : wait before returning (def=3, -1 = never return) +lip : lip remaining at end of move. (def=8) +health : Can be damaged instead of touched +dmg : damage to inflict when blocked. (def=2) +message : centerprint message when touched (removed when opened) +sounds : 0 = silent 1 = stone 2 = base 3 = stone chain 4 = screechy metal 5 = custom +locksounds : 0 = talktalk 1 = short rattle, 2 = medium rattle, 3 = long rattle +noise : custom sound - door locked sound (targetname+message) +noise1 : custom sound - Moving/Open door (looping) +noise2 : custom sound - Stop/Close door +noise3 : custom sound - Silver/Gold key try lock +noise4 : custom sound - Silver/Gold key OPEN +customkey: custom key required to open door (1-4 supported values) +message2 : custom key message (You need the custom key) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOPEN : door opens in reverse state (moved to dest at spawn) +SPAWNTRIG : Will spawn trigger around door even if targetname SETUP +DONTLINK : Touching doors will not link into a single entity +GOLD : Requires gold key to open +SILVER : Requires silver key to open +TOGGLE : Door waits in start and end states for a trigger +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Door (bmodel) with 2 states + +======================================================================*/ + +// Check for overlapping bound boxes +float (entity e1, entity e2) EntitiesTouching = +{ + if (e1.mins_x > e2.maxs_x) return FALSE; + if (e1.mins_y > e2.maxs_y) return FALSE; + if (e1.mins_z > e2.maxs_z) return FALSE; + if (e1.maxs_x < e2.mins_x) return FALSE; + if (e1.maxs_y < e2.mins_y) return FALSE; + if (e1.maxs_z < e2.mins_z) return FALSE; + return TRUE; +}; + +//---------------------------------------------------------------------- +void() func_door_trigger_touch = +{ + if (self.owner.estate == ESTATE_BLOCK) return; + if (self.owner.spawnflags & ENT_STARTOFF) return; + if (other.health < 1) return; + if (other.classtype == CT_FUNCBREAK) return; + if (other.flags & FL_ITEM) return; + if (time < self.attack_finished) return; + self.attack_finished = time + 1; + + // Switch to parent (self) of trigger + activator = other; + self = self.owner; + + self.estate_use(); // func_door_use +}; + +//---------------------------------------------------------------------- +entity(vector fmins, vector fmaxs) func_door_spawn_field = +{ + local entity trigger; + local vector t1, t2; + + // Create trigger entity and link to parent (self) + trigger = spawn(); + trigger.classtype = CT_FUNCDOORTRIG; + trigger.bsporigin = TRUE; + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + trigger.owner = self; + trigger.touch = func_door_trigger_touch; + + t1 = fmins; + t2 = fmaxs; + // Extend the X/Y size of the trigger +/- 60 units + // Return the trigger entity to the previous function + setsize (trigger, t1 - '60 60 8', t2 + '60 60 8'); + return (trigger); +}; + +//---------------------------------------------------------------------- +// Link touching func_door entities +//---------------------------------------------------------------------- +void() func_door_link = +{ + local entity linkdoor, master; + local vector cmins, cmaxs; + local float loopcondition; + + // Switch off the entity once the door linking has been done + if (self.spawnflags & ENT_STARTOFF) { + self.think = self.estate_off; + self.nextthink = self.ltime + 0.1; + } + + // Door linking exceptions (self.enemy = already linked) + if (self.enemy) return; + + // Setup bounding box for first door (master) + cmins = self.mins; cmaxs = self.maxs; + + // lets give the do/while a proper exit condition + loopcondition = TRUE; + + // Really important step, defining the master door + master = self; + linkdoor = self; + + while (loopcondition) + { + // Always point all doors in the list to the master door + // which is setup outside of the do/while loop + self.owner = master; + + // Make sure all linked doors have the same health/targetname/message + if (self.health) master.health = self.health; + if (self.targetname != "") master.targetname = self.targetname; + if (self.message != "") master.message = self.message; + + // For some reason the original ID code renamed doors and secret doors + // to the same classname string and then created a list of both together + // Not sure why anyone would want the two door types linked and it is + // certainly not in any of the original ID maps. + // Feature disabled - causes no end of state problems + linkdoor = find (linkdoor, classname, self.classname); + + // reached end of list? + if (!linkdoor) { + self.enemy = master; // make the chain a loop + loopcondition = FALSE; + + // no more doors left to search, switch to the master door + // It is always defined as the .owner field + self = self.owner; + + // This is the conditions for a door getting automatic open trigger + // Door CANNOT be damaged (shoot trigger) and NO key item required + if (self.health == 0 && self.items == 0) { + // Damn annoying that the targetname is being used like this because + // there could have been a better way to do this type of functionality + // == "" door has special trigger around to open door + // != "" door requires trigger event to open + if (self.targetname == "") + self.spawnflags = self.spawnflags | DOOR_SPAWN_TRIGGER; + + if (self.spawnflags & DOOR_SPAWN_TRIGGER) + self.owner.trigger_field = func_door_spawn_field(cmins, cmaxs); + } + } + else { + // Check if the bounding boxes are touching + if (EntitiesTouching(self,linkdoor)) { + // The .enemy field should be empty, otherwise its linked already + // which is a bad situation because the chains will be corrupt + // This will break the lots of later functions on + // Solution - ignore the crosslink entity and carry on + if (linkdoor.enemy) { + // Exception: No link doors are setup to be linked to themselves! + if ( !(linkdoor.spawnflags & DOOR_DONT_LINK)) { + dprint("\b[CROSSLINK]\b really bad situation, must fix!\n"); + dprint("-----------------------------------------------\n"); + eprint(linkdoor.enemy); + dprint("-----------------------------------------------\n\n"); + } + } + else { + // Setup the next entity (linkdoor) in the list (self.enemy) + // and move self forward to the new entity (linkdoor) + self.enemy = linkdoor; + self = linkdoor; + + // Expand touch trigger to include new door + if (linkdoor.mins_x < cmins_x) cmins_x = linkdoor.mins_x; + if (linkdoor.mins_y < cmins_y) cmins_y = linkdoor.mins_y; + if (linkdoor.mins_z < cmins_z) cmins_z = linkdoor.mins_z; + if (linkdoor.maxs_x > cmaxs_x) cmaxs_x = linkdoor.maxs_x; + if (linkdoor.maxs_y > cmaxs_y) cmaxs_y = linkdoor.maxs_y; + if (linkdoor.maxs_z > cmaxs_z) cmaxs_z = linkdoor.maxs_z; + } + } + } + } +}; + +//---------------------------------------------------------------------- +// Phase 4 - Door CLOSED +//---------------------------------------------------------------------- +void() func_door_hit_bottom = +{ + if (self.estate == ESTATE_OFF) return; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + self.frame = 1 - self.frame; //switch textures +}; + +//---------------------------------------------------------------------- +// Phase 3 - Door closing +//---------------------------------------------------------------------- +void() func_door_go_down = +{ + if (self.estate == ESTATE_OFF) return; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + if (self.max_health) { + self.takedamage = DAMAGE_YES; + self.health = self.max_health; + } + + self.state = STATE_DOWN; + // Add - return speed can now be different, + // yaw_speed = speed if nothing defined + SUB_CalcMove (self.pos1, self.yaw_speed, func_door_hit_bottom); +}; + +//---------------------------------------------------------------------- +// Phase 2 - Door OPEN +//---------------------------------------------------------------------- +void() func_door_hit_top = +{ + if (self.estate == ESTATE_OFF) return; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; + // don't come down automatically + if (self.spawnflags & DOOR_TOGGLE) return; + self.think = func_door_go_down; + self.nextthink = self.ltime + self.wait; +}; + +//---------------------------------------------------------------------- +// Phase 1 - Door opening +//---------------------------------------------------------------------- +void() func_door_go_up = +{ + if (self.estate == ESTATE_OFF) return; + if (self.state == STATE_UP) return; // already going up + + if (self.state == STATE_TOP) { // reset top wait time + self.nextthink = self.ltime + self.wait; + return; + } + + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos2, self.speed, func_door_hit_top); + + SUB_UseTargets(); + self.frame = 1 - self.frame; //switch textures +}; + +//---------------------------------------------------------------------- +void() func_door_fire = +{ + local entity oself, starte; + + if (self.estate == ESTATE_BLOCK) return; + if (self.owner != self) dprint ("\b[door_fire]\b self.owner != self\n"); + + // play use key sound + if (self.items) sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); + + self.message = string_null; // no more message + oself = self; + + if (self.spawnflags & DOOR_TOGGLE) { + if (self.state == STATE_UP || self.state == STATE_TOP) { + starte = self; + do { + func_door_go_down (); + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; + return; + } + } + + // trigger all paired doors + starte = self; + do { + func_door_go_up (); + self = self.enemy; + } while ( (self != starte) && (self != world) ); + self = oself; +}; + +//---------------------------------------------------------------------- +void() func_door_use = +{ + local entity oself; + + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + // Door messages are for touch functionality ONLY + self.message = string_null; + self.owner.message = string_null; + self.enemy.message = string_null; + // Switch to master door + oself = self; + self = self.owner; + func_door_fire (); + self = oself; + } +}; + +//---------------------------------------------------------------------- +void() func_door_killed = +{ + local entity oself; + if (self.estate & ESTATE_BLOCK) return; + + oself = self; + self = self.owner; + self.health = self.max_health; + self.takedamage = DAMAGE_NO; // wil be reset upon return + func_door_use (); + self = oself; +}; + +//---------------------------------------------------------------------- +// Only used for keys and messages +//---------------------------------------------------------------------- +void() func_door_touch = +{ + if (self.estate & ESTATE_BLOCK) return; + if ( !(other.flags & FL_CLIENT) ) return; + if (self.owner.attack_finished > time) return; + + // Block touch trigger for 2 seconds + self.owner.attack_finished = time + 2; + + // Does the door require any keys? + if (self.items == 0) { + // Any touch message to display? + if (self.owner.message != "") { + centerprint (other, self.owner.message); + // Use custom lock sound (default = talktalk) + sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + } + // Check door for keys (silver/gold/custom) + else { + // Is this a custom locked door? + if (self.moditems > 0) { + if ( (self.moditems & other.moditems) != self.moditems ) { + // Tell the player that a custom key is required + // Use the message2 string instead of message1 + centerprint (other, self.message2); + // Play door locked sound (based on worldspawn) + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + return; + } + else { + // Remove custom key from player/client + other.moditems = other.moditems - self.moditems; + // Tell the player that the custom key has been removed + // Use the key item netname to reference the custom key + // These netnames are updated when picking up the key + sprint(other, "You used the "); + if (self.moditems & IT_CKEY1 && other.ckeyname1 != "") sprint(other, other.ckeyname1); + else if (self.moditems & IT_CKEY2 && other.ckeyname2 != "") sprint(other, other.ckeyname2); + else if (self.moditems & IT_CKEY3 && other.ckeyname3 != "") sprint(other, other.ckeyname3); + else if (self.moditems & IT_CKEY4 && other.ckeyname4 != "") sprint(other, other.ckeyname4); + sprint(other, "\n"); + } + } + else { + // Does the player have the correct key? (silver/gold) + if ( (self.items & other.items) != self.items ) { + if (self.owner.items == IT_KEY1) { + if (self.worldtype == 1) centerprint (other, "You need the silver runekey"); + else if (self.worldtype == 2) centerprint (other, "You need the silver keycard"); + else centerprint (other, "You need the silver key"); + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + } + else { + if (self.worldtype == 1) centerprint (other, "You need the gold runekey"); + else if (self.worldtype == 2) centerprint (other, "You need the gold keycard"); + else centerprint (other, "You need the gold key"); + sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + } + return; + } + else { + // Tell the player that the key has been removed + sprint(other, "You used the "); + if (other.items & IT_KEY1) sprint(other, "Silver key\n"); + else sprint(other, "Gold key\n"); + // Take key from player inventory + other.items = other.items - self.items; + } + } + + // Turn off touch function + self.touch = SUB_Null; + // turn off touch on pair/master door + if (self.enemy) self.enemy.touch = SUB_Null; + func_door_use (); + } +}; + +//---------------------------------------------------------------------- +void() func_door_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.velocity = '0 0 0'; + self.frame = self.frame_override; // Reset to default + + // Reset Door position if NOT key or working once + if (self.items == 0 && self.wait != -1) { + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } + // reset health and damage trigger + if (self.max_health > 0) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + } +}; + +//---------------------------------------------------------------------- +void() func_door_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.velocity = '0 0 0'; + self.takedamage = DAMAGE_NO; + self.think = SUB_Null; + + // Stop all movement sounds + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + + // Reset Door position if NOT key or working once + if (self.items == 0 && self.wait != -1) { + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + } +}; + +//---------------------------------------------------------------------- +void() func_door_disable = +{ + // Block damage function and show alternative texture + self.takedamage = DAMAGE_NO; + self.frame = 1 - self.frame_override; // Turn off alt textures +}; + +//---------------------------------------------------------------------- +void() func_door_reset = +{ + // If the door is still OFF then leave it + if (self.spawnflags & ENT_STARTOFF) return; + + // Restore key functionality + if (self.items > 0 ) { + self.touch = func_door_touch; + // switch on master door as well + if (self.enemy) self.enemy.touch = func_door_touch; + } + + // reset to original position + setorigin(self, self.pos1); + self.state = STATE_BOTTOM; + self.attack_finished = 0; + self.frame = self.frame_override; // Reset Alt textures + + // Restore door to ON state + self.estate = ESTATE_OFF; + self.estate_on(); + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() func_door_blocked = +{ + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // if a door has a negative wait, it would never come back if blocked, + // so let it just squash the object to death real fast + if (self.wait != -1) { + if (self.state == STATE_DOWN) func_door_go_up (); + else func_door_go_down (); + } +}; + +//---------------------------------------------------------------------- +void() func_door = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + + if (self.sounds == 1) { + self.noise1 = "doors/drclos4.wav"; + self.noise2 = "doors/doormv1.wav"; + } + else if (self.sounds == 2) { + self.noise2 = "doors/hydro1.wav"; + self.noise1 = "doors/hydro2.wav"; + } + else if (self.sounds == 3) { + self.noise2 = "doors/stndr1.wav"; + self.noise1 = "doors/stndr2.wav"; + } + else if (self.sounds == 4) { + self.noise1 = "doors/ddoor2.wav"; + self.noise2 = "doors/ddoor1.wav"; + } + + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + // Allow for custom sounds by checking noise3/4 string content first + // Locked door sounds (silver, gold and custom keys) + if (self.noise3 == "") { + if (self.worldtype == 1) self.noise3 = "doors/runetry.wav"; + else if (self.worldtype == 2) self.noise3 = "doors/basetry.wav"; + else self.noise3 = "doors/medtry.wav"; + } + if (self.noise4 == "") { + if (self.worldtype == 1) self.noise4 = "doors/runeuse.wav"; + else if (self.worldtype == 2) self.noise4 = "doors/baseuse.wav"; + else self.noise4 = "doors/meduse.wav"; + } + + // locked sound (targetname + message) + if (self.noise == "") self.noise = SOUND_TALK; + if (self.locksounds == 1) self.noise = "doors/rattle1.wav"; + else if (self.locksounds == 2) self.noise = "doors/rattle2.wav"; + else if (self.locksounds == 3) self.noise = "doors/rattle6.wav"; + + //Pre-cache all sounds + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + precache_sound (self.noise4); + + // Setup classtype and flag as BSP origin + self.classtype = CT_FUNCDOOR; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + SetMovedir (); // Work out movedir based on angles + + if (!self.speed) self.speed = 100; + // Second movement speed can be different, yaw_speed + if (!self.yaw_speed) self.yaw_speed = self.speed; + if (!self.wait) self.wait = 3; + //if (!self.lip) self.lip = 8; + if (!self.dmg) self.dmg = 2; + self.state = STATE_BOTTOM; + self.attack_finished = 0; + + // Default/Setup alternative texture frame + if (!self.frame_override) self.frame_override = 0; + self.frame = self.frame_override; + + //---------------------------------------------------------------------- + // Is the door locked via special keys (silver/gold) + // Make sure any rogue entity keys are removed + self.items = self.moditems = 0; + if (self.spawnflags & DOOR_SILVER_KEY) self.items = IT_KEY1; + else if (self.spawnflags & DOOR_GOLD_KEY) self.items = IT_KEY2; + // Check for custom key requirement (only supports 1-4 types + if (self.customkey > 0) { + self.items = IT_KEY1 | IT_KEY2; + if (self.message2 == "") self.message2 = "You need the custom key"; + if (self.customkey == 1) self.moditems = IT_CKEY1; + else if (self.customkey == 2) self.moditems = IT_CKEY2; + else if (self.customkey == 3) self.moditems = IT_CKEY3; + else if (self.customkey == 4) self.moditems = IT_CKEY4; + else { + dprint("\b[FUNC_DOOR]\b Custom key value not supported\n"); + self.moditems = self.items = 0; + } + } + + // key doors ONLY work once and have touch function + if (self.items > 0) { + self.wait = -1; // Work once + self.health = 0; // no shoot/damage + } + + //---------------------------------------------------------------------- + // Add bmodel to world and work out movement positions + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setmodel (self, self.mdl); + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Only need door functionality if require keys or centerprint messages + if (self.items > 0 || self.message != "") self.touch = func_door_touch; + self.blocked = func_door_blocked; + + //---------------------------------------------------------------------- + // DOOR_START_OPEN is design for an entity to be lit in the closed position + // but spawn in the open position, also reversed door functions + if (self.spawnflags & DOOR_START_OPEN) { + setorigin (self, self.pos2); + self.pos2 = self.pos1; + self.pos1 = self.origin; + } + + // Only enable damage trigger (die) if health set + if (self.health) { + self.max_health = self.health; + self.takedamage = DAMAGE_YES; + self.th_die = func_door_killed; + } + + if (world.devdata & DEV_AMMO_N_HEALTH && self.health > 0) { + if (self.wait || self.spawnflags & DOOR_TOGGLE) { + world.deventity.enemyhealth = world.deventity.enemyhealth + (self.health * 2); // assume that we will likely shoot the button twice if it can reset + } else { + world.deventity.enemyhealth = world.deventity.enemyhealth + self.health; // we only need to shoot it once, and only can shoot it once + } + } + + // Setup Entity State functionality + // The 'USE' wrapper has to be setup, because after + // the doors are linked they will all have targetnames! + self.use = entity_state_use; + self.estate_on = func_door_on; + self.estate_off = func_door_off; + self.estate_use = func_door_use; + self.estate_disable = func_door_disable; + self.estate_reset = func_door_reset; + self.estate = ESTATE_ON; + + //---------------------------------------------------------------------- + // Doors cannot be linked until all bmodels have spawned and + // bounding box sizes established, check for exceptions first + if (self.spawnflags & DOOR_DONT_LINK) { + self.owner = self.enemy = self; + // Its safe to switch this entity off, no linking required + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + } + else { + self.think = func_door_link; + self.nextthink = self.ltime + 0.1; + } +}; + +/*====================================================================== +/*QUAKED trigger_doorstate (0.5 0 0.5) (-8 -8 -16) (8 8 16) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard +Trigger func_door(s) to exact state (open/close) +-------- KEYS -------- +targetname : trigger this entity +target : ALL target(s) must be func_door entities with toggle spawnflag! +state : 0 or 1 func_door state (0=closed, 1=open) +wait : -1 = will only fire targets once +-------- SPAWNFLAGS -------- +STARTOFF : Requires trigger to activate +-------- NOTES -------- +Trigger func_door(s) to exact state (open/close) + +======================================================================*/ +void() trigger_doorstate_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Fire target(s) + trigger_strs(self.target, self); + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; +}; + +//---------------------------------------------------------------------- +void() trigger_doorstate_delay = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Remove the trigger delay function + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Re-route use function to actual counter + self.estate_use = trigger_counter_use; +}; + +//---------------------------------------------------------------------- +void() trigger_doorstate_setup = +{ + // entity check condition + self.lefty = FALSE; + + // Search for func_door targets + self.enemy = find(world, targetname, self.target); + // Found any yet? + while (self.enemy) { + // Found a func_door? + if (self.enemy.classtype == CT_FUNCDOOR) { + // All func_door(s) require toggle spawnflag enabled + if (self.enemy.spawnflags & DOOR_TOGGLE) self.lefty = TRUE; + else { + dprint("\b[TRIG_DOORSTATE]\b "); + dprint(self.enemy.targetname); + dprint(" missing toggle spawnflag!\n"); + } + } + // The whole list needs to be door entities + else { + dprint("\b[TRIG_DOORSTATE]\b Target ("); dprint(self.target); + dprint(") ("); dprint(self.enemy.classname); + dprint(") Wrong!\n"); + self.lefty = FALSE; + } + + // Keep looping through the find list + self.enemy = find(self.enemy, targetname, self.target); + } + + // Found any errors with setup? + if (self.lefty == FALSE) { + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Finally setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + // The delay function is not switched off, its activate to use + if (self.spawnflags & ENT_STARTOFF) self.estate_use = trigger_doorstate_delay; + else self.estate_use = trigger_doorstate_use; +}; + +//---------------------------------------------------------------------- +void() trigger_doorstate = +{ + self.classtype = CT_TRIGDOORSTATE; + if (self.state < 0 || self.state > 1) self.state = 0; + self.delay = self.sounds = 0; + self.message = self.noise = ""; + self.nodebuginfo = TRUE; + + // This entity is called a lot from pressure plate entities + // so it really needs to be setup right before use! + // No target = hard error and warning message + if (self.target == "") { + dprint("\b[TRIG_DOORSTATE]\b Missing target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Double check targets are right type + self.think = trigger_doorstate_setup; + self.nextthink = time + 0.2; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/func_doorsecret.qc b/QC_other/QC_keep/func_doorsecret.qc new file mode 100644 index 00000000..55a8542e --- /dev/null +++ b/QC_other/QC_keep/func_doorsecret.qc @@ -0,0 +1,384 @@ +/*====================================================================== + SECRET DOOR FUNCTIONS +======================================================================*/ +float SECRET_OPEN_ONCE = 1; // stays open +float SECRET_1ST_LEFT = 2; // 1st move is left of arrow +float SECRET_1ST_DOWN = 4; // 1st move is down from arrow +float SECRET_NO_SHOOT = 8; // only opened by trigger +float SECRET_ALWAYS_SHOOT = 16; // shootable even if targeted + +/*====================================================================== +/*QUAKED func_door_secret (0 .5 .8) ? OPEN_ONCE 1ST_LEFT 1ST_DOWN NO_SHOOT ALWAYS_SHOOT x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A Door (bmodel) with 2 states and multiple stages +-------- KEYS -------- +targetname : = "" door opens with damage, != "" requires trigger to open +if using entity state system set ALWAYS_SHOOT spawnflags to fix this problem +target : name of target(s) to trigger at the start opening sequence +angle : determines the opening direction, use "360" for angle 0 +speed : movement speed (default = 50) +yaw_speed : 2nd movement speed (default = speed) +t_width : First Distance, override Width to move back (or height if going down) +t_length : Second Distance, override Length to move sideways +wait : wait before returning (default = 5) +dmg : damage to inflict when blocked. (default = 2) +message : centerprint message when touched (removed when opened) +sounds : 1 = medieval 2 = metal 3 = base(def) 4 = Silent 5 = custom +locksounds: 0 = talktalk 1 = short rattle, 2 = medium rattle, 3 = long rattle +noise : custom sound - door locked sound (targetname+message) +noise1 : custom sound - Open +noise2 : custom sound - Opening (looping) +noise3 : custom sound - Closed +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +ONCE_ONLY : Stays Open +1ST_LEFT : 1st move is left of arrow +1ST_DOWN : 1st move is down from arrow +NO_SHOOT : only opened by trigger +ALWAYS_SHOOT : Always Shootable, even if targeted +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +A Door (bmodel) with 2 states and multiple stages + +======================================================================*/ + +//---------------------------------------------------------------------- +// Touch message ONLY! (every 2s repeat) +//---------------------------------------------------------------------- +void() func_door_secret_touch = +{ + if (self.estate & ESTATE_BLOCK) return; + if ( !(other.flags & FL_CLIENT) ) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 2; + + if (self.message) { + centerprint (other, self.message); + sound (other, CHAN_BODY, self.noise, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +// FINAL move back (reset door ready for use again) +//---------------------------------------------------------------------- +void () func_door_secret_done = +{ + self.state = STATE_BOTTOM; + if (self.estate == ESTATE_OFF) return; + // Add back takedamage if door is suppose to be shootable! + if (self.spawnflags & SECRET_ALWAYS_SHOOT) self.takedamage = DAMAGE_YES; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void () func_door_secret_move6 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest0, self.yaw_speed, func_door_secret_done); +}; + +//---------------------------------------------------------------------- +// Wait 1 second... +void () func_door_secret_move5 = +{ + if (self.estate == ESTATE_OFF) return; + self.nextthink = self.ltime + 1.0; + self.think = func_door_secret_move6; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +// Move backward... +void () func_door_secret_move4 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest1, self.yaw_speed, func_door_secret_move5); +}; + +//---------------------------------------------------------------------- +// Wait here until time to go back... +void () func_door_secret_move3 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + if (!(self.spawnflags & SECRET_OPEN_ONCE)) { + self.nextthink = self.ltime + self.wait; + self.think = func_door_secret_move4; + } +}; + +//---------------------------------------------------------------------- +// Start moving sideways w/sound... +void () func_door_secret_move2 = +{ + if (self.estate == ESTATE_OFF) return; + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest2, self.speed, func_door_secret_move3); +}; + +//---------------------------------------------------------------------- +// Wait after first movement... +void () func_door_secret_move1 = +{ + if (self.estate == ESTATE_OFF) return; + self.nextthink = self.ltime + 1.0; + self.think = func_door_secret_move2; + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void () func_door_secret_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong or door moving + if (self.estate & ESTATE_BLOCK) return; + if (self.state != STATE_BOTTOM) return; + + self.state = STATE_UP; + self.takedamage = DAMAGE_NO; + self.velocity = '0 0 0'; + + // no more touch message and fire targets + self.message = string_null; + SUB_UseTargets(); + + // Make a sound, wait a little... + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.nextthink = self.ltime + 0.1; + + // Start FIRST move (t_width) + SUB_CalcMove(self.dest1, self.speed, func_door_secret_move1); + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +void() func_door_secret_killed = +{ + self.health = self.max_health; + func_door_secret_use (); +}; + +//---------------------------------------------------------------------- +void() func_door_secret_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.velocity = '0 0 0'; + + // trigger once doors? + if ( self.spawnflags & SECRET_OPEN_ONCE ) { + // if the door is open, do nothing + if (self.state == STATE_TOP) self.max_health = 0; + } + else { + // Reset health, state and frame back to default + setorigin(self, self.dest0); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } + + // reset health and damage trigger + if (self.max_health > 0) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + } +}; + +//---------------------------------------------------------------------- +void() func_door_secret_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.velocity = '0 0 0'; + + // Reset health, position and frame back to default + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.takedamage = DAMAGE_NO; + self.think = SUB_Null; + + // trigger once door? + if ( self.spawnflags & SECRET_OPEN_ONCE ) { + // if the door is moving, go to final position + if (self.state == STATE_TOP) setorigin(self, self.dest2); + } + else { + // Reset back to the beginning + setorigin(self, self.dest0); + self.state = STATE_BOTTOM; + } +}; + +//---------------------------------------------------------------------- +void() func_door_secret_disable = +{ + // Block damage function + self.takedamage = DAMAGE_NO; +}; + +//---------------------------------------------------------------------- +void() func_door_secret_reset = +{ + // If the door is still OFF then leave it + if (self.spawnflags & ENT_STARTOFF) return; + + // reset to original position + setorigin(self, self.dest0); + self.state = STATE_BOTTOM; + self.attack_finished = 0; + + // Restore door to ON state + self.estate = ESTATE_OFF; + self.estate_on(); + self.think = SUB_Null; + +}; + +//---------------------------------------------------------------------- +void () func_door_secret_blocked = +{ + if (self.estate == ESTATE_OFF) return; + if (time < self.attack_finished) return; + self.attack_finished = time + 0.5; + T_Damage (other, self, self, self.dmg, DAMARMOR); +}; + +//---------------------------------------------------------------------- +void () func_door_secret = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + + // Default = 3 - Medieval + if (self.sounds == 0 || self.sounds == 3) { + self.noise1 = "doors/basesec2.wav"; + self.noise2 = "doors/basesec1.wav"; + self.noise3 = "doors/basesec2.wav"; + } + else if (self.sounds == 1) { + self.noise1 = "doors/latch2.wav"; + self.noise2 = "doors/winch2.wav"; + self.noise3 = "doors/drclos4.wav"; + } + else if (self.sounds == 2) { + self.noise1 = "doors/airdoor2.wav"; + self.noise2 = "doors/airdoor1.wav"; + self.noise3 = "doors/airdoor2.wav"; + } + + // locked sound (targetname + message) + if (self.noise == "") self.noise = SOUND_TALK; + if (self.locksounds == 1) self.noise = "doors/rattle1.wav"; + else if (self.locksounds == 2) self.noise = "doors/rattle2.wav"; + else if (self.locksounds == 3) self.noise = "doors/rattle6.wav"; + + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + self.classtype = CT_FUNCSECDOOR; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + // Save any angle value first (original behaviour) + self.mangle = self.angles; + + // Allow for angles up/down by using movedir instead + if (CheckZeroVector(self.angles)) self.angles = '0 360 0'; + SetMovedir (); // Setup move direction base on angles + + if(!self.speed) self.speed = 50; // Movement speed (per phase) + if(!self.yaw_speed) self.yaw_speed = self.speed; + if (!self.wait) self.wait = 5; // 5 seconds before closing + if (!self.dmg) self.dmg = 2; + self.state = STATE_BOTTOM; + + // Add sec door to world to work out movement + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.dest0 = self.origin; + setorigin (self, self.origin); + setsize (self, self.mins , self.maxs); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + if (self.message != "") self.touch = func_door_secret_touch; + self.blocked = func_door_secret_blocked; + + // Damn annoying that the targetname is being used like this because + // there could have been a better way of doing this functionality + // == "" Secret_door can be damaged to be opened + // != "" Secret door cannot be damaged and requires trigger to work + // + if (self.targetname == "" && !(self.spawnflags & SECRET_NO_SHOOT)) { + self.spawnflags = self.spawnflags | SECRET_ALWAYS_SHOOT; + } + + // Finally if the spawnflag is set, then let the shooting begin! + if (self.spawnflags & SECRET_ALWAYS_SHOOT) { + self.health = self.max_health = 1; + self.takedamage = DAMAGE_YES; + self.th_die = func_door_secret_killed; + } + + // Calculate the sec door movement during spawn stage + // This was originally done when the sec door was used + self.lip = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 + // Original worked out v_forward based on angle/mangle + // Using movedir instead so up/down directions can be used + // makevectors(self.mangle); + + // Work out FIRST (t_width) direction to move + if (!self.t_width) { + if (self.spawnflags & SECRET_1ST_DOWN) self. t_width = fabs(v_up * self.size); + else self. t_width = fabs(v_right * self.size); + } + if (self.spawnflags & SECRET_1ST_DOWN) self.dest1 = self.origin - v_up * self.t_width; + else self.dest1 = self.origin + v_right * (self.t_width * self.lip); + + // Work out SECOND (t_length) direction to move + // using pre-defined movedir instead of v_forward + if (!self.t_length) self.t_length = fabs(self.movedir * self.size); + self.dest2 = self.dest1 + self.movedir * self.t_length; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_door_secret_on; + self.estate_off = func_door_secret_off; + self.estate_use = func_door_secret_use; + self.estate_reset = func_door_secret_reset; + self.estate_disable = func_door_secret_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; diff --git a/QC_other/QC_keep/func_insvolume.qc b/QC_other/QC_keep/func_insvolume.qc new file mode 100644 index 00000000..38fc6f61 --- /dev/null +++ b/QC_other/QC_keep/func_insvolume.qc @@ -0,0 +1,303 @@ +/*====================================================================== +/*QUAKED func_insidevolume (0 .5 .8) ? PLAYER MONSTER ITEM PUSHABLE x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Function to test if an entity bounding box is inside of this volume +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : Name of target(s) to trigger when fully INSIDE (fires every 0.1s) +target2 : Name of target(s) to trigger when partial INSIDE (fires every 0.1s) +message : Name of target(s) to trigger when exit VOLUME (fires on exit only) +wait : -1 = Fire the fully/exit volume target(s) once +delay : Delay time before volume controller becomes active +message2: Name of the only entity that can interact with this volume +no_deadbody : 1 = Monster dead bodies don't work with volume test +-------- SPAWNFLAGS -------- +PLAYER : Will react to player(s) +MONSTER : Will react to monster(s) +ITEM : Will react to item(s) +PUSHABLE : Will react to pushable(s) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Function to test if an entity bounding box is inside of this volume + +======================================================================*/ + +float FUNC_INSVOLPLAYER = 1; +float FUNC_INSVOLMONSTER = 2; +float FUNC_INSVOLITEM = 4; +float FUNC_INSVOLPUSHABLE = 8; + +//---------------------------------------------------------------------- +float(entity targ) func_insvolume_check = +{ + local vector targ_mins, targ_maxs; + + // Is the touching entity linked to anthing? + if (targ.touching == world) return TRUE; + + // Is the touching entity linked to this inside volume? + // Don't reset the touching entity, its being tested by something else + if (targ.touching != self.owner) return TRUE; + + // Has the touching entity been switch off/disabled + if (targ.estate & ESTATE_BLOCK) { targ.touching = world; return TRUE; } + + // Check for dead monsters and removed them from entity list + if (targ.flags & FL_MONSTER) { + if (self.owner.no_deadbody == 1 && targ.health < 1) { + targ.touching = world; + return TRUE; + } + } + + // Find entity origin + if (targ.bsporigin) { + // Bmodel origin is stored differently + self.owner.pos3 = bmodel_origin(targ); + // Min/max are only updated when spawned, use size instead + targ_mins = self.owner.pos3 - (targ.size*0.5); + targ_maxs = self.owner.pos3 + (targ.size*0.5); + } + else { + // Point entity uses origin key + self.owner.pos3 = targ.origin; + // Min/max are created when spawned + targ_mins = self.owner.pos3 + targ.mins; + targ_maxs = self.owner.pos3 + targ.maxs; + } + + // Test OUTSIDE space (targ max < trigger min) + if (targ_maxs_x < self.owner.dest1_x || targ_maxs_y < self.owner.dest1_y || + targ_maxs_z < self.owner.dest1_z) { + //dprint("ENT outside MINS\n"); + targ.touching = world; + self.owner.targetnumber = NEGATIVE; + return TRUE; + } + // Test OUTSIDE space (targ min > trigger max) + if (targ_mins_x > self.owner.dest2_x || targ_mins_y > self.owner.dest2_y || + targ_mins_z > self.owner.dest2_z) { + //dprint("ENT outside MAXS\n"); + targ.touching = world; + self.owner.targetnumber = NEGATIVE; + return TRUE; + } + + // Test INSIDE space (targ min < trigger min) + if (targ_mins_x < self.owner.dest1_x) return FALSE; + if (targ_mins_y < self.owner.dest1_y) return FALSE; + if (targ_mins_z < self.owner.dest1_z) return FALSE; + + // Test INSIDE space (targ max > trigger max) + if (targ_maxs_x > self.owner.dest2_x) return FALSE; + if (targ_maxs_y > self.owner.dest2_y) return FALSE; + if (targ_maxs_z > self.owner.dest2_z) return FALSE; + + // Finally something INSIDE the volume! + self.owner.targetnumber = TRUE; + return FALSE; +}; + +//---------------------------------------------------------------------- +void(entity targ) func_insvolume_add = +{ + if (self.tno1 == world) { self.tno1 = targ; targ.touching = self; } + else if (self.tno2 == world) { self.tno2 = targ; targ.touching = self; } + else if (self.tno3 == world) { self.tno3 = targ; targ.touching = self; } + else if (self.tno4 == world) { self.tno4 = targ; targ.touching = self; } + else if (self.tno5 == world) { self.tno5 = targ; targ.touching = self; } + else { + // A warning message for mappers to ignore! :P + if (self.pain_finished < time) { + self.pain_finished = time + 3; + dprint("\b[INSVOL]\b More than 5 entities touching!\n"); + } + } +}; + +//---------------------------------------------------------------------- +void() func_insvolume_touch = +{ + // Block functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // Already checking this (other) entity? + if (other.touching == self) return; + + // Check for an exact entity condition + if (self.message2 != "") { + // Is the touching entity the correct entity? + if (self.message2 != other.targetname) return; + } + + // Default = no touch + self.lefty = FALSE; + + // Test for all the different entity types + if (self.spawnflags & FUNC_INSVOLPLAYER && other.flags & FL_CLIENT) + self.lefty = TRUE; + else if (self.spawnflags & FUNC_INSVOLMONSTER && other.flags & FL_MONSTER) { + // Test for dead/living monsters? + if (self.no_deadbody == 0) self.lefty = TRUE; + else if (self.no_deadbody == 1 && other.health > 0) + self.lefty = TRUE; + } + else if (self.spawnflags & FUNC_INSVOLITEM && other.flags & FL_ITEM) + self.lefty = TRUE; + else if (self.spawnflags & FUNC_INSVOLPUSHABLE && other.classtype == CT_FUNCPUSHABLE) + self.lefty = TRUE; + + // If wrong type touching volume? + if (self.lefty == FALSE) return; + + // Add entity to volume list to keep checking + if (other.touching == world) + func_insvolume_add(other); +}; + +//---------------------------------------------------------------------- +void() func_insvolume_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + setsize (self, self.bbmins, self.bbmaxs); +}; + +//---------------------------------------------------------------------- +void() func_insvolume_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); +}; + +//---------------------------------------------------------------------- +void() func_insvolume_controller_think = +{ + // Keep the controller looping + self.think = func_insvolume_controller_think; + self.nextthink = time + 0.1; + self.owner.targetnumber = FALSE; + + // If switched off/disabled + if (self.owner.estate & ESTATE_BLOCK) return; + + // If no entities touching volume, do nothing + // This is a way to slow down the constant triggering + if (self.owner.tno1 != world || self.owner.tno2 != world || + self.owner.tno3 != world || self.owner.tno4 != world || + self.owner.tno5 != world) { + + // Go through the entities touching this volume + if (func_insvolume_check(self.owner.tno1) == TRUE) self.owner.tno1 = world; + if (func_insvolume_check(self.owner.tno2) == TRUE) self.owner.tno2 = world; + if (func_insvolume_check(self.owner.tno3) == TRUE) self.owner.tno3 = world; + if (func_insvolume_check(self.owner.tno4) == TRUE) self.owner.tno4 = world; + if (func_insvolume_check(self.owner.tno5) == TRUE) self.owner.tno5 = world; + + // Any entities pass the volume test? (FULL, PARTIAL and EXIT) + if (self.owner.targetnumber == TRUE) { + // FULLY inside the volume + if (self.owner.target != "") { + trigger_strs(self.owner.target, self.owner); + if (self.owner.wait < 0) self.owner.target = ""; + } + } + else if (self.owner.targetnumber == NEGATIVE) { + // Just EXIT the volume + if (self.owner.message != "") { + trigger_strs(self.owner.message, self.owner); + if (self.owner.wait < 0) self.owner.message = ""; + } + } + else { + // PARTIALLY inside the volume + if (self.owner.target2 != "") { + trigger_strs(self.owner.target2, self.owner); + } + } + } +}; + +//---------------------------------------------------------------------- +void() func_insvolume_controller_setup = +{ + // Check if controller entity been setup + if (!self.attachment) self.attachment = spawn(); + + // Setup link back to inside volume + self.attachment.owner = self; + self.attachment.classtype = CT_CONTROL; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + // Setup controller above model origin location + self.oldorigin = bmodel_origin(self); + setorigin(self.attachment, self.oldorigin + '0 0 32'); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Start controller think loop + self.attachment.think = func_insvolume_controller_think; + self.attachment.nextthink = time + 0.1 + self.delay; +}; + +//====================================================================== +void() func_insidevolume = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // No trigger/movement angles + self.angles = '0 0 0'; self.movedir = '0 0 0'; + + self.classtype = CT_FUNCINSVOLUME; + self.nodebuginfo = TRUE; + + // Setup like a trigger in the map + InitTrigger (); + setsize (self, self.bbmins, self.bbmaxs); + + // Work out actual world origin coordinates + self.pos1 = self.size * 0.5; + self.pos2 = bmodel_origin(self); + + // Setup trigger boundary edges + self.dest1 = self.pos2 - self.pos1; + self.dest2 = self.pos2 + self.pos1; + + // Block all trigger extra parameters (not needed) + self.health = self.max_health = 0; + self.takedamage = DAMAGE_NO; + if (self.delay < 0) self.delay = 0; + + // Reset all touch entities to monitor + self.tno1 = self.tno2 = self.tno3 = self.tno4 = self.tno5 = world; + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_insvolume_on; + self.estate_off = func_insvolume_off; + self.touch = func_insvolume_touch; + + // Check for starting off or default=on + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); + + // Setup volume controller (tests volumes) + self.think = func_insvolume_controller_setup; + self.nextthink = time + 0.2; +}; diff --git a/QC_other/QC_keep/func_keep.qc b/QC_other/QC_keep/func_keep.qc new file mode 100644 index 00000000..b811d04a --- /dev/null +++ b/QC_other/QC_keep/func_keep.qc @@ -0,0 +1,559 @@ +// Rogue platform +float DN_N_WAIT = 1.000; +float PLT_TOGGLE = 2.000; +float ELEVATOR = 4.000; +float START_AT_TOP = 8.000; +float PLAT2 = 16.000; +float PLAT2_BOTTOM = 32.000; + +void () dn_and_wait_go_up; +void () dn_and_wait_go_down; +void () dn_and_wait_crush; +void () toggle_go_up; +void () toggle_go_down; +void () toggle_crush; +void () elvtr_crush; +void () plat2_center_touch; +void () plat2_go_up; +void () plat2_go_down; +void () plat2_crush; + +//---------------------------------------------------------------------- +// Rogue newplats.qc +//---------------------------------------------------------------------- +// ================================== +// down N and wait code +// ================================== + +void() dn_and_wait_go_up; +void() dn_and_wait_go_down; +void() dn_and_wait_crush; + +void() dn_and_wait_hit_top = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; +}; + +void() dn_and_wait_hit_bottom = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + self.think = dn_and_wait_go_up; + self.nextthink = self.ltime + self.health; +}; + +void() dn_and_wait_go_down = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, dn_and_wait_hit_bottom); +}; + +void() dn_and_wait_go_up = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, dn_and_wait_hit_top); +}; + +void() dn_and_wait_crush = +{ + T_Damage (other, self, self, 1,DAMARMOR); + + if (self.state == STATE_UP) + dn_and_wait_go_down (); + else if (self.state == STATE_DOWN) + dn_and_wait_go_up (); + else + objerror ("plat_new_crush: bad self.state\n"); +}; + +void() dn_and_wait_use = +{ + if (self.state != STATE_TOP) + return; + + dn_and_wait_go_down (); +}; + +// ================================== +// toggle type code +// ================================== + +void() toggle_go_up; +void() toggle_go_down; +void() toggle_crush; + +void() toggle_hit_top = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; +}; + +void() toggle_hit_bottom = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; +}; + +void() toggle_go_down = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, toggle_hit_bottom); +}; + +void() toggle_go_up = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, toggle_hit_top); +}; + +void() toggle_crush = +{ + T_Damage (other, self, self, 1, DAMARMOR); + + if (self.state == STATE_UP) + toggle_go_down (); + else if (self.state == STATE_DOWN) + toggle_go_up (); + else + objerror ("plat_new_crush: bad self.state\n"); +}; + +void() toggle_use = +{ + if (self.state == STATE_TOP) + toggle_go_down (); + else if(self.state == STATE_BOTTOM) + toggle_go_up (); +}; + +// ================================== +// elvtr type code +// ================================== + +void() elvtr_crush; + +void() elvtr_stop = +{ + self.elevatorOnFloor = self.elevatorToFloor; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + self.elevatorLastUse = time; +}; + +void() elvtr_go = +{ + self.elevatorDestination = self.pos2; + self.elevatorDestination_z = self.pos2_z + + (self.height * self.elevatorToFloor); + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.elevatorDestination, self.speed, elvtr_stop); + self.elevatorLastUse = time; +}; + +void() elvtr_crush = +{ +// T_Damage (other, self, self, 1); + self.elevatorToFloor = self.elevatorOnFloor; + + elvtr_go (); +}; + +// =============== +// elevator use function +// self = plat, other = elevator button, other.enemy = player +// =============== +void() elvtr_use = +{ + local float tempDist, elvPos, btnPos; + + if ( (self.elevatorLastUse + 2) > time) + return; + + self.elevatorLastUse = time; + + if (elv_button_dir == 0) + return; + + elvPos = (self.absmin_z + self.absmax_z) * 0.5; + btnPos = (other.absmin_z + other.absmax_z) * 0.5; + + if (elvPos > btnPos) + { + tempDist = (elvPos - btnPos) / self.height; + tempDist = ceil ( tempDist); + self.elevatorToFloor = self.elevatorOnFloor - tempDist; + elvtr_go (); + return; + } + else + { + tempDist = btnPos - elvPos; + if (tempDist > self.height) + { + tempDist = tempDist / self.height; + tempDist = floor ( tempDist ); + self.elevatorToFloor = self.elevatorOnFloor + tempDist; + elvtr_go (); + return; + } + } + + if (elv_button_dir == -1) + { + if(self.elevatorOnFloor > 0) + { + self.elevatorToFloor = self.elevatorOnFloor - 1; + elvtr_go (); + } + } + else if(elv_button_dir == 1) + { + if(self.elevatorOnFloor < (self.cnt - 1)) + { + self.elevatorToFloor = self.elevatorOnFloor + 1; + elvtr_go (); + } + } +}; + +// ================================== +// PLAT2 type code +// ================================== + +void() plat2_center_touch; +void() plat2_go_up; +void() plat2_go_down; +void() plat2_crush; + +void() plat2_spawn_inside_trigger = +{ + local entity trigger; + local vector tmin, tmax; + +// +// middle trigger +// + trigger = spawn(); + trigger.touch = plat2_center_touch; + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + trigger.enemy = self; + + tmin = self.mins + '25 25 0'; + tmax = self.maxs - '25 25 -8'; + tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); + + if (self.spawnflags & PLAT_LOW_TRIGGER) + tmax_z = tmin_z + 8; + + if (self.size_x <= 50) + { + tmin_x = (self.mins_x + self.maxs_x) / 2; + tmax_x = tmin_x + 1; + } + if (self.size_y <= 50) + { + tmin_y = (self.mins_y + self.maxs_y) / 2; + tmax_y = tmin_y + 1; + } + + setsize (trigger, tmin, tmax); +}; + +void() plat2_hit_top = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_TOP; + + self.plat2LastMove = time; + if(self.plat2Called == 1) + { + self.think = plat2_go_down; + self.nextthink = self.ltime + 1.5; + self.plat2Called = 0; + self.plat2LastMove = 0; // allow immediate move + } + else if(!(self.spawnflags & START_AT_TOP)) + { + self.think = plat2_go_down; + self.nextthink = self.ltime + self.delay; + self.plat2Called = 0; + } +}; + +void() plat2_hit_bottom = +{ + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.state = STATE_BOTTOM; + + self.plat2LastMove = time; + if(self.plat2Called == 1) + { + self.think = plat2_go_up; + self.nextthink = self.ltime + 1.5; + self.plat2Called = 0; + self.plat2LastMove = 0; // allow immediate move + } + else if(self.spawnflags & START_AT_TOP) + { + self.think = plat2_go_up; + self.nextthink = self.ltime + self.delay; + self.plat2Called = 0; + } +}; + +void() plat2_go_down = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_DOWN; + SUB_CalcMove (self.pos2, self.speed, plat2_hit_bottom); +}; + +void() plat2_go_up = +{ + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.state = STATE_UP; + SUB_CalcMove (self.pos1, self.speed, plat2_hit_top); +}; + +void() plat2_use = +{ + if(self.state > 4) + self.state = self.state - 10; + + self.use = SUB_Null; +}; + +void() plat2_center_touch = +{ + local float otherState; + local vector platPosition; + + if (other.classname != "player") + return; + + if (other.health <= 0) + return; + + // at this point, self is the trigger. self.enemy is the plat. + // this changes self to be the plat, other is the player. + self = self.enemy; + + if ((self.plat2LastMove + 2) > time) + return; + + if (self.state > 4) // disabled. + return; + + if (self.plat2GoTo > STATE_BOTTOM) + { + if (self.plat2GoTime < time) + { + if (self.plat2GoTo == STATE_UP) + plat2_go_up(); + else + plat2_go_down(); + + self.plat2GoTo = 0; + } + return; + } + + if (self.state > STATE_BOTTOM) // STATE_UP or STATE_DOWN + return; + + platPosition = (self.absmax + self.absmin) * 0.5; + + if (self.state == STATE_TOP) + { + otherState = STATE_TOP; + if ( platPosition_z > other.origin_z ) + otherState = STATE_BOTTOM; + } + else + { + otherState = STATE_BOTTOM; + if ( (other.origin_z - platPosition_z) > self.height) + otherState = STATE_TOP; + } + + if (self.state == otherState) + { + self.plat2Called = 0; + self.plat2GoTime = time + 0.5; + } + else + { + self.plat2GoTime = time + 0.1; + self.plat2Called = 1; + } + + if (self.state == STATE_BOTTOM) + self.plat2GoTo = STATE_UP; + else if(self.state == STATE_TOP) + self.plat2GoTo = STATE_DOWN; +}; + +void() plat2_crush = +{ + T_Damage (other, self, self, 1, DAMARMOR); + + if (self.state == STATE_UP) + plat2_go_down (); + else if (self.state == STATE_DOWN) + plat2_go_up (); + else + objerror ("plat2_crush: bad self.state\n"); +}; + +// ================================== +// Common Plat Code +// ================================== + +/*QUAKED func_new_plat (0 .5 .8) ? DN_N_WAIT PLT_TOGGLE ELEVATOR START_AT_TOP PLAT2 P2_BOTTOM + +-------------- +DN_N_WAIT is a plat that starts at the top and when triggered, goes down, waits, then comes back up. +health - number of seconds to wait (default 5) + +-------------- +PLT_TOGGLE is a plat that will change between the top and bottom each time it is triggered. + +-------------- +ELEVATOR is an elevator plat. You can have as many levels as you want but they must be all the same distance away. Use elevator button entity as the trigger. + cnt is the number of floors + height is the distance between floors + +START_AT_TOP is an optional flag for elevators. It just tells the elevator that it's position is the top floor. (Default is the bottom floor) USE THIS ONLY WITH ELEVATORS! + +-------------- +PLAT2 is a fixed version of the original plat. If you want the plat to start at the bottom and move to the top on demand, use a negative height. That will tell Quake to lower the plat at spawn time. Always place this plat type in the top position when making the map. This will ensure correct lighting, hopefully. If a plat2 is the target of a trigger, it will be disabled until it has been triggered. Delay is the wait before the plat returns to original position. + +If you don't want to bother figuring out the height, don't put a +value in the height + +delay default 3 +speed default 150 +cnt default 2 + +P2_BOTTOM is an optional switch to have an auto-sized plat2 start at the bottom. +-------------- +Plats are always drawn in the extended position, so they will light correctly. + +If the plat is the target of another trigger or button, it will start out disabled in the extended position until it is trigger, when it will lower and become a normal plat. + +If the "height" key is set, that will determine the amount the plat moves, instead of being implicitly determined by the model's height. +Set "sounds" to one of the following: +1) base fast +2) chain slow +*/ + +void () func_new_plat = { + local float negativeHeight; + + negativeHeight = FALSE; + if ( !self.t_length ) self.t_length = 80; + if ( !self.t_width ) self.t_width = 10; + if ( (self.sounds == 0) ) self.sounds = 2; + if ( (self.sounds == 1) ) { + self.noise = "plats/plat1.wav"; + self.noise1 = "plats/plat2.wav"; + } + if ( (self.sounds == 2) ) { + self.noise = "plats/medplat1.wav"; + self.noise1 = "plats/medplat2.wav"; + } + precache_sound (self.noise); + precache_sound (self.noise1); + self.mangle = self.angles; + self.angles = VEC_ORIGIN; + self.classname = "plat"; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self,self.origin); + setmodel (self,self.model); + setsize (self,self.mins,self.maxs); + if ( !self.speed ) self.speed = 150; + self.pos1 = self.origin; // pos1 is the top position, + self.pos2 = self.origin; // pos2 is the bottom + if ( (self.height < 0) ) { + negativeHeight = TRUE; + self.height = (0 - self.height); + } + if ( self.height ) { + self.pos2_z = (self.origin_z - self.height); + } else { + negativeHeight = TRUE; + self.height = (self.size_z - 8); + self.pos2_z = (self.origin_z - self.height); + } + if ( (self.spawnflags & DN_N_WAIT) ) { + self.use = dn_and_wait_use; + self.blocked = dn_and_wait_crush; + if ( (negativeHeight == TRUE) ) { + self.state = STATE_BOTTOM; + setorigin (self,self.pos2); + } else { + self.state = STATE_TOP; + } + if ( !self.health ) self.health = 5; + } else { + if ( (self.spawnflags & PLT_TOGGLE) ) { + self.use = toggle_use; + self.blocked = toggle_crush; + if ( (negativeHeight == TRUE) ) { + setorigin (self,self.pos2); + self.state = STATE_BOTTOM; + } else { + self.state = STATE_TOP; + } + } else { + if ( (self.spawnflags & ELEVATOR) ) { + self.elevatorOnFloor = FALSE; + self.elevatorToFloor = FALSE; + self.elevatorLastUse = FALSE; + if ( (self.spawnflags & START_AT_TOP) ) { + self.pos1 = self.origin; + self.pos2 = self.origin; + self.pos2_z = (self.origin_z - (self.height * (self.cnt - TRUE))); + self.elevatorOnFloor = (self.cnt - TRUE); + } else { + self.pos1 = self.origin; + self.pos2 = self.origin; + self.pos1_z = (self.origin_z + (self.height * (self.cnt - TRUE))); + self.elevatorOnFloor = FALSE; + } + self.use = elvtr_use; + self.blocked = elvtr_crush; + } else { + if ( (self.spawnflags & PLAT2) ) { + plat2_spawn_inside_trigger (); + self.plat2Called = FALSE; + self.plat2LastMove = FALSE; + self.plat2GoTo = FALSE; + self.plat2GoTime = FALSE; + self.blocked = plat2_crush; + if ( !self.delay ) self.delay = 3; + if ( (negativeHeight == TRUE) ) { + self.state = STATE_BOTTOM; + self.spawnflags = PLAT2; + setorigin (self,self.pos2); + } else { + self.spawnflags = (self.spawnflags | START_AT_TOP); + self.state = STATE_TOP; + } + if ( self.targetname ) { + self.use = plat2_use; + self.state = (self.state + MOVETYPE_BOUNCE); + } + } + } + } + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/func_plats.qc b/QC_other/QC_keep/func_plats.qc new file mode 100644 index 00000000..be953138 --- /dev/null +++ b/QC_other/QC_keep/func_plats.qc @@ -0,0 +1,318 @@ +/*====================================================================== + PLATFORM FUNCTIONS +======================================================================*/ +float PLAT_LOW_TRIGGER = 1; +float PLAT_MIN_TRIGGER = 4; +float PLAT_START_LOWER = 8; +float PLAT_START_OPEN = 16; +float PLAT_STARTDIS = 32; // Platform starts in disabled state + +/*====================================================================== +/*QUAKED func_plat (0 .5 .8) ? LOW_TRIGGER x MIN_TRIGGER START_LOWER START_OPEN x STARTOFF x +A Platform (bmodel) with 2 states +-------- KEYS -------- +targetname : = "" plat start low, != "" plat starts high and reqs trigger to work +if using entity state system set START_LOWER spawnflags to fix this problem +speed : moving speed (def=150) +height : determines the distance to move, instead of bmodel bounds +sounds : 1=Base, 0 or 2=Medieval (def), 4=Silent, 5=Custom sounds +noise : custom sound - moving (looping) +noise1 : custom sound - Stopped +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +LOW_TRIGGER : touch trigger will not keep the platform at the top, will reset +MIN_TRIGGER : uses the min bounding box (instead of max) to calculate trigger +START_LOWER : will start the platform lower regardless of targetname +START_OPEN : Used for lighting issues, place at bottom position +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Platforms are always created in the upper position, so they can be lit better. +If targetname is defined the func_plat starts high and is locked until triggered +Once the func_plat has been triggered, it will become a normal platform. + +======================================================================*/ + +void() func_plat_hit_bottom = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_BOTTOM; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void() func_plat_go_down = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_DOWN; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + SUB_CalcMove (self.pos2, self.speed, func_plat_hit_bottom); +}; + +//---------------------------------------------------------------------- +void() func_plat_hit_top = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_TOP; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.think = func_plat_go_down; + self.nextthink = self.ltime + 3; +}; + +//---------------------------------------------------------------------- +void() func_plat_go_up = +{ + if (self.estate == ESTATE_OFF) return; + self.state = STATE_UP; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + SUB_CalcMove (self.pos1, self.speed, func_plat_hit_top); +}; + +//---------------------------------------------------------------------- +void() func_plat_trigger_touch = +{ + if (self.owner.estate & ESTATE_BLOCK) return; + if (self.owner.state == STATE_DISABLED) return; + if (!(other.flags & FL_CLIENT)) return; + if (other.health <= 0) return; + + // Switch the platform entity + self = self.owner; + if (self.state == STATE_BOTTOM) func_plat_go_up (); + else if (self.state == STATE_TOP) + self.nextthink = self.ltime + 1; // delay going down +}; + +//---------------------------------------------------------------------- +void() func_plat_trigger_spawn = +{ + local entity trigger; + local vector tmin, tmax; + + trigger = spawn(); + trigger.owner = self; + trigger.touch = func_plat_trigger_touch; + trigger.movetype = MOVETYPE_NONE; + trigger.solid = SOLID_TRIGGER; + + tmin = self.mins + '25 25 0'; + tmax = self.maxs - '25 25 -8'; + + // The ID method is to take the maximum size of the platform + // and subtract the height. This fails if the platform + // is moving around a central height point. The Alternative + // method uses the min bounding box value instead of max + // This is not 100% capatible with id maps, so hence extra option! + if (self.spawnflags & PLAT_MIN_TRIGGER) tmin_z = tmin_z - (self.height + 8); + else tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); + + if (self.spawnflags & PLAT_LOW_TRIGGER) tmax_z = tmin_z + 8; + + + if (self.size_x <= 50) { + tmin_x = (self.mins_x + self.maxs_x) / 2; + tmax_x = tmin_x + 1; + } + if (self.size_y <= 50) { + tmin_y = (self.mins_y + self.maxs_y) / 2; + tmax_y = tmin_y + 1; + } + + setsize (trigger, tmin, tmax); +}; + +//---------------------------------------------------------------------- +void() func_plat_use = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + if (self.state == STATE_DISABLED) func_plat_go_down(); + } +}; + +//---------------------------------------------------------------------- +void() func_plat_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + if (self.state != STATE_DISABLED) { + // Reset health, state and frame back to default + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } + + // If platform started disable, release to lower position + if (self.spawnflags & PLAT_STARTDIS) { + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & PLAT_STARTDIS); + if (self.state == STATE_DISABLED) func_plat_go_down(); + } +}; + +//---------------------------------------------------------------------- +void() func_plat_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Stop all movement sounds + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + + if (self.state != STATE_DISABLED) { + // Reset health, position and frame back to default + setorigin(self, self.pos2); + self.state = STATE_BOTTOM; + self.think = SUB_Null; + } +}; + +//---------------------------------------------------------------------- +void() func_plat_disable = +{ + // Lock platform in current location + self.estate = ESTATE_DISABLE; +}; + +//---------------------------------------------------------------------- +void() func_plat_blocked = +{ + T_Damage (other, self, self, 1, DAMARMOR); + + if (self.state == STATE_UP) func_plat_go_down (); + else if (self.state == STATE_DOWN) func_plat_go_up (); +}; + +//---------------------------------------------------------------------- +void() func_plat = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // default sound = medieval + if (self.sounds == 0) self.sounds = 2; + + if (self.sounds == 1) { + self.noise = "plats/plat1.wav"; + self.noise1 = "plats/plat2.wav"; + } + else if (self.sounds == 2) { + self.noise = "plats/medplat1.wav"; + self.noise1 = "plats/medplat2.wav"; + } + else { + // sounds 4 = silent, sounds 5 = custom + if (self.noise == "" || self.sounds == 4) self.noise = SOUND_EMPTY; + if (self.noise1 == "" || self.sounds == 4) self.noise1 = SOUND_EMPTY; + } + precache_sound (self.noise); + precache_sound (self.noise1); + + self.classtype = CT_FUNCPLAT; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + // angles has to be 0 0 0 otherwise brush model is twisted + // save angles to mangle for use later by movement code + self.mangle = self.angles; + self.angles = '0 0 0'; + + // This is not used anywhere, old code ideas from ID + if (!self.t_length) self.t_length = 80; + if (!self.t_width) self.t_width = 10; + if (!self.speed) self.speed = 150; + self.state = STATE_BOTTOM; // Default state (lower) + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + setmodel (self, self.mdl); + setsize (self, self.mins , self.maxs); + + // Cannot have a platform start off or disabled + // with no targetname, how can it be actived!?! + if (self.spawnflags & PLAT_STARTDIS && self.targetname == "") { + dprint("\b[PLAT]\b Starting DISABLED with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + if (self.spawnflags & ENT_STARTOFF && self.targetname == "") { + dprint("\b[PLAT]\b Starting OFF with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Move the platform up to open position (lighting issues) + // Need to update mins/maxs so that spawn trigger is correct + // otherwise it will be in original position and spawn low + if (self.spawnflags & PLAT_START_OPEN) { + self.origin_z = self.origin_z + self.height; + self.mins_z = self.mins_z + self.height; + self.maxs_z = self.maxs_z + self.height; + } + + // pos1 is the top position, pos2 is the bottom + self.pos1 = self.pos2 = self.origin; + // self.height cannot be a negative, min/maxs will be back-to-front + if (self.height) self.pos2_z = self.origin_z - fabs(self.height); + else self.pos2_z = self.origin_z - self.size_z + 8; + + // Setup touch trigger and block function + func_plat_trigger_spawn (); + self.blocked = func_plat_blocked; + + // Damn annoying that the targetname is being used like this because + // there could have been a better way to do this type of functionality + // == "" Platform starts in lower position (default) + // != "" Platform starts in upper position and requires trigger to work + // + if (self.targetname != "" && !(self.spawnflags & PLAT_START_LOWER) ) + self.state = STATE_DISABLED; + else setorigin (self, self.pos2); // Start in lower position + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_plat_on; + self.estate_off = func_plat_off; + self.estate_use = func_plat_use; + self.estate_disable = func_plat_disable; + + // Check for the easy way to start a platform disabled + if (self.spawnflags & PLAT_STARTDIS) self.estate_disable(); + // Check for starting override for entity state + else if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() plat_hit_bottom = { func_plat_hit_bottom(); }; diff --git a/QC_other/QC_keep/func_pswitch.qc b/QC_other/QC_keep/func_pswitch.qc new file mode 100644 index 00000000..6877a566 --- /dev/null +++ b/QC_other/QC_keep/func_pswitch.qc @@ -0,0 +1,245 @@ +/*====================================================================== + PRESSURE SWITCH FUNCTIONS + + * Originally started as an extension of the func_button entity + * Had too many spawning/setup conditions and was made into own entity + * Having the trigger, touch and movement on one entity did not work + * Split the trigger/touch into a separate spawn function, not v flexible + * Entity Detection has to be volume, only players have floor touch bbox + * Added a separate trigger/touch entity to detect diff entity types + * Trigger needed to keep track of multiple touching entities at once + * Detecting intersection volumes without a touch function is cpu intense + +======================================================================*/ +float PSWITCH_STARTDIS = 32; // Switch starts in disabled state +//---------------------------------------------------------------------- + +/*QUAKED func_pressureswitch (0 .5 .8) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Pressure switch (bmodel) with touch state only +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger (only works with pressure relays) +angle : Always moves downward (needs to reflect gravity pressure) +speed : Move Speed (def=40) +lip : lip remaining at end of move. (def=4) +sounds : 0=steam metal, 1=wooden, 2=metallic, 3=in-out, 4=Silent, 5=Custom +noise : custom sound - 1st movement +noise1 : custom sound - 2nd movement ('buttons/switch21.wav') +message: Centerprint Message to display when triggered +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Pressure switch (bmodel) with touch state only +*/ + +//---------------------------------------------------------------------- +void() func_pswitch_ready = +{ + // Check for entity state changes + if (self.estate & ESTATE_BLOCK) return; + + self.frame = 0; + self.state = STATE_UP; +}; + +//---------------------------------------------------------------------- +void() func_pswitch_return = +{ + // Check for entity state changes + // Do not block disable (let it move up) + if (self.estate == ESTATE_OFF) return; + + if (self.state == STATE_DOWN) { + if (self.presstimersound < time) { + self.presstimersound = time + 1; + // 2nd movement sound - going up + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + } + self.ltime = time; + self.state = STATE_MOVING; + SUB_CalcMove (self.pos1, self.speed, func_pswitch_ready); + } +}; + +//---------------------------------------------------------------------- +void() func_pswitch_finished = +{ + // Check for any completed message + if (self.message != "") { + // Write message to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CENTERPRINT); + WriteString (MSG_ALL, self.message); + if (self.wait < 0) self.message = ""; + } + + // Check for any completed trigger(s) + if (self.target != "") { + trigger_strs(self.target, world); + if (self.wait < 0) self.target = ""; + } + + self.frame = 1; + self.state = STATE_DOWN; + + // Check for entity state changes + if (self.estate & ESTATE_BLOCK) return; + + self.think = func_pswitch_return; + self.nextthink = time + 0.2; +}; + +//---------------------------------------------------------------------- +void() func_pswitch_use = +{ + // Check for entity state changes + if (self.estate & ESTATE_BLOCK) return; + // Block trigger events if moving pressure plate + if (self.state == STATE_MOVING) return; + + // Is the pressure plate UP? + if (self.state == STATE_UP) { + if (self.presstimersound < time) { + self.presstimersound = time + 1; + // 1st movement sound - going down + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + // Move pressure pad into down position + self.ltime = time; + self.state = STATE_MOVING; + SUB_CalcMove (self.pos2, self.speed, func_pswitch_finished); + } + // Is the pressure plate DOWN? + else if (self.state == STATE_DOWN) { + // Keep waiting in the down position + self.think = func_pswitch_return; + self.nextthink = time + 0.2; + } +}; + +//---------------------------------------------------------------------- +void() func_pswitch_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Add to world pressure plate + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + + // Reset state and frame back to default + setorigin(self, self.pos1); + self.state = STATE_UP; + self.think = SUB_Null; + self.frame = 0; +}; + +//---------------------------------------------------------------------- +void() func_pswitch_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Reset position and frame back to default + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + setorigin(self, self.pos1); + self.state = STATE_UP; + self.think = SUB_Null; + self.frame = 0; +}; + +//---------------------------------------------------------------------- +void() func_pressureswitch = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Setup all empty/silent sound files first + if (self.noise == "") self.noise = SOUND_EMPTY; + + // Default 0 = air (base style) button + if (self.sounds == 0) self.noise = "buttons/airbut1.wav"; + else if (self.sounds == 1) self.noise = "buttons/switch21.wav"; + else if (self.sounds == 2) self.noise = "buttons/switch02.wav"; + else if (self.sounds == 3) self.noise = "buttons/switch04.wav"; + else if (self.sounds == 4) self.noise = SOUND_EMPTY; + precache_sound (self.noise); + + if (self.noise1 == "") self.noise1 = self.noise; + precache_sound (self.noise1); + + self.classtype = CT_FUNCPSWITCH; + self.classgroup = CG_FUNCMOVER; + self.bsporigin = TRUE; + self.mdl = self.model; + + // Pressure switches always move up/down + self.movedir = '0 0 -1'; + self.angles = '0 0 0'; + + // Default parameters and states + if (!self.speed) self.speed = 40; + if (!self.lip) self.lip = 4; + self.state = STATE_UP; + + self.health = self.max_health = 0; + self.takedamage = DAMAGE_NO; + self.wait = -1; + + // Reset all pressure switch variables + self.presstype = self.presstimersound = 0; + + // Setup the pressure switch two different state positions + // Got to add switch to world for bmodel size parameter + self.movetype = MOVETYPE_PUSH; + self.solid = SOLID_BSP; + setmodel (self, self.mdl); + self.pos1 = self.origin; + self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + + // Cannot have a pressure switch start off or disabled + // with no targetname, how can it be actived!?! + if (self.spawnflags & BUTTON_STARTDIS && self.targetname == "") { + dprint("\b[PSWITCH]\b Starting DISABLED with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + if (self.spawnflags & ENT_STARTOFF && self.targetname == "") { + dprint("\b[PSWITCH]\b Starting OFF with no targetname!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_pswitch_on; + self.estate_off = func_pswitch_off; + self.estate_use = func_pswitch_use; + + // Check for starting off or default=on + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; diff --git a/QC_other/QC_keep/func_trains.qc b/QC_other/QC_keep/func_trains.qc new file mode 100644 index 00000000..ae42b274 --- /dev/null +++ b/QC_other/QC_keep/func_trains.qc @@ -0,0 +1,554 @@ +/*====================================================================== + Train FUNCTIONS +======================================================================*/ +float TRAIN_STARTON = 1; +float TRAIN_NONSOLID = 2; +float TRAIN_MODEL = 4; +float TRAIN_TOUCH = 8; +float TRAIN_REVERSE = 32; + +/*====================================================================== +/*QUAKED func_train (0 .5 .8) ? STARTON NONSOLID MODEL TOUCH x REVERSE STARTOFF x +Bmodel platform moving around entity chain +-------- KEYS -------- +targetname : = "" start moving straight away != "" wait for trigger +target : Name of first path_corner to start at (instant move) +mdl : Specify a model for MODEL mode only (progs/object.mdl) +speed : moving speed (def=100) +dmg : block damage (def=2) +sounds : 0=Silent, 1=Ratchet Metal, 5=Custom sounds +noise : custom sound - stopped +noise1 : custom sound - moving (looping) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTON : Start moving straight away if targetname is used +NONSOLID : No collision or blocking functionality (uses bmodel) +MODEL : Model with no collision (use mdl key, def=empty model) +TOUCH : Nonsolid or model trains have touch damage (dmg) +REVERSE : Start going backward through path_corner chain +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +The target's origin specifies the min point of the train at each corner. +The train spawns at the first target it is pointing at. +Use a chain of path_corners to specify which direction to travel + +======================================================================*/ +void() func_train_stop = +{ + // Play stop sound and switch state OFF + if ( self.sounds > 0 ) sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + self.velocity = self.avelocity = '0 0 0'; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +vector(entity targ) func_train_origin = +{ + local vector org; + if (self.bsporigin) org = targ.origin - self.mins; + else org = targ.origin; + return org; +}; + +//---------------------------------------------------------------------- +void() func_train_pause = +{ + // Block entity state OFF, DISABLE reqs stop sound and trigger event + if (self.estate == ESTATE_OFF) return; + + // Reset velocity and rotation (stationary object) + self.velocity = '0 0 0'; + + // Copy CURRENT path corner wait/delay setup + self.wait = self.movetarget.wait; + self.delay = self.movetarget.delay; + + // Fire any event targets on path_corner + if (self.movetarget.corner_event) + trigger_strs(self.movetarget.corner_event, self); + + // Deadend logic, setup ready for backwards route + // Check for any path corner instant switch direction logic + if (self.movetarget.spawnflags & PATHC_DEADEND || + self.movetarget.spawnflags & PATHC_REVERSE) { + self.direction = 1 - self.direction; + } + + // func_trains that are nonsolid need to reset ltime + // otherwise they will never pause at path_corner + if (!self.bsporigin) self.ltime = time; + + // If the train has been disabled, stop and make sound + // Need to check wait logic at arriving path_corner and not before + // Some ID maps used wait = -1 and some did path corner stacking + if (self.state == STATE_OFF || self.wait < 0) func_train_stop(); + + // nopause spawnflag ALWAYS overrides any wait state + else if (self.movetarget.spawnflags & PATHC_NOPAUSE) self.estate_fire(); + else { + // Is wait setup to pause the train? + if (self.wait > 0 ) { + self.nextthink = self.ltime + self.wait + (self.delay * random()); + // Play stop sound if setup + if ( self.sounds > 0 ) sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + // Stop any movement or rotation + self.velocity = self.avelocity = '0 0 0'; + } + // ID logic - 1 frame pause at each path_corner + else self.nextthink = self.ltime + 0.1; + + // Keep going to next path corner + self.think = self.estate_fire; + } +}; + +//---------------------------------------------------------------------- +void() func_train_next = +{ + // Block entity state OFF, DISABLE needs to stop properly + if (self.estate & ESTATE_DISABLE) func_train_stop(); + else if (self.estate & ESTATE_OFF) return; + else if (self.state == STATE_OFF) return; + + //---------------------------------------------------------------------- + // I suppose this is where the train logic goes off the rails! + // Two types of routing logic exists, random or exact path choices + // + // Only do extra logic routing if alternative route exists + //---------------------------------------------------------------------- + if ( self.movetarget.spawnflags & PATHC_TARGET2) { + //---------------------------------------------------------------------- + // Exact logic paths ALWAYS overriding any choice or defaults + // This will even send a train back the way it came if selected + // This route logic mode will always change direction flow + //---------------------------------------------------------------------- + if (self.movetarget.spawnflags & PATHC_EXACT) { + if (self.movetarget.state == STATE_ROUTE2) { + // Alternative forward route + self.goalentity = self.movetarget.movetarget2; + self.direction = 0; + } + else if (self.movetarget.state == STATE_ROUTE3) { + // Backward route + self.goalentity = self.movetarget.movetarget3; + self.direction = 1; + } + else { + // Default forward route + self.goalentity = self.movetarget.movetarget; + self.direction = 0; + } + } + //---------------------------------------------------------------------- + // Random logic paths behave differently based on current direction + // FORWARD : randomly pick between two forward routes, ignore back route + // BACKWARD : ignore last travelled route and randomly pick from two remaining + //---------------------------------------------------------------------- + else { + // direction : forward = 0, backward = 1 + if (self.direction) { + // Setup default route following backward flow + self.goalentity = self.movetarget.movetarget3; + // random chance to pick another route? + if (random() < 0.5) { + // Switch direction to forward and pick fresh route + self.direction = 0; + if (self.movelast == self.movetarget.movetarget) + self.goalentity = self.movetarget.movetarget2; + else if (self.movelast == self.movetarget.movetarget2) + self.goalentity = self.movetarget.movetarget; + } + } + else { + // Randomly pick from two forward routes, easy logic + self.goalentity = self.movetarget.movetarget; + if (random() < 0.5) self.goalentity = self.movetarget.movetarget2; + } + } + } + //---------------------------------------------------------------------- + // Standard path corner, one forward, one backward route + // Check if the route entities exist first + // path corners can take a while to be fully setup + //---------------------------------------------------------------------- + else { + // Backward route + if (self.direction) { + // Spawnflag setup when path_corner has found a link + if (self.movetarget.spawnflags & PATHC_BACKLINK) + self.goalentity = self.movetarget.movetarget3; + else { + // Slowly search world entity list for backlink target + self.oldenemy = find (world, target, self.movetarget.targetname); + while(self.oldenemy) { + if (self.oldenemy.classtype == CT_PATHCORNER) { + self.goalentity = self.oldenemy; + self.oldenemy = world; + } + else self.oldenemy = find(self.oldenemy, target, self.movetarget.targetname); + } + } + } + // Forward route + else { + // Spawnflag setup when path_corner has found a link + if (self.movetarget.spawnflags & PATHC_TARGET1) + self.goalentity = self.movetarget.movetarget; + else { + // Slowly search world entity list for forward target + self.oldenemy = find (world, targetname, self.movetarget.target); + while(self.oldenemy) { + if (self.oldenemy.classtype == CT_PATHCORNER) { + self.goalentity = self.oldenemy; + self.oldenemy = world; + } + else self.oldenemy = find(self.oldenemy, targetname, self.movetarget.target); + } + } + } + } + + //---------------------------------------------------------------------- + // This is the last check before moving towards the next corner + // If no route entity has been found then stop and do nothing + // If route found, setup final details and move towards next corner + //---------------------------------------------------------------------- + if (!self.goalentity) func_train_stop(); + else { + // Play moving sound if active (sounds = 1 or 5) + if ( self.sounds > 0) sound (self, CHAN_VOICE, self.noise1, self.volume, ATTN_NORM); + // Work out NEXT path_corner origin + self.finaldest = func_train_origin(self.goalentity); + // Check if CURRENT path_corner for a different speed + if (self.movetarget.speed > 0) self.distance = self.movetarget.speed; + else self.distance = self.speed; + + // Move forward to next target + self.movelast = self.movetarget; + self.movetarget = self.goalentity; + + // Horrible hack for sawblades to make sure avelocity + // matches direction of path_corners + if (self.classtype == CT_SAWBLADE) { + // Workout movement direction between path corners + self.movedir = normalize(self.movetarget.origin - self.movelast.origin); + // Only interested in 1/0/-1 values + self.movedir_x = rint(self.movedir_x); + self.movedir_y = rint(self.movedir_y); + self.movedir_z = rint(self.movedir_z); + // Check for any positive values? + if (self.movedir_x > 0 || self.movedir_y > 0 || self.movedir_z > 0) + self.avelocity = -self.v_angle; + else self.avelocity = self.v_angle; + } + + // func_trains that are nonsolid need to reset ltime + // otherwise they will instantly warp to next corner + if (!self.bsporigin) self.ltime = time; + + // Is the next path_corner an instant move? + if (self.movetarget.spawnflags & PATHC_INSTANT) { + setorigin (self, self.finaldest); + func_train_pause(); + } + else { + // Finally workout movement (finaldest) and speed (distance) + SUB_CalcMove (self.finaldest, self.distance, func_train_pause); + } + } +}; + +//---------------------------------------------------------------------- +void() func_train_resume = +{ + local float pc_dist; + + // Final destionation not setup correctly, move on + if (self.goalentity.classtype != CT_PATHCORNER) self.estate_fire(); + + pc_dist = fabs(vlen(self.finaldest - self.origin)); + if (pc_dist > 0) { + // Play moving sound if active (sounds = 1 or 5) + if ( self.sounds > 0) sound (self, CHAN_VOICE, self.noise1, self.volume, ATTN_NORM); + // Setup sawblades to keep spinning + if (self.classtype == CT_SAWBLADE) { + if (self.movedir_x > 0 || self.movedir_y > 0 || self.movedir_z > 0) + self.avelocity = -self.v_angle; + else self.avelocity = self.v_angle; + } + // Double check distance is setup correctly + if (self.distance < 1) self.distance = self.speed; + if (!self.bsporigin) self.ltime = time; + SUB_CalcMove (self.finaldest, self.distance, func_train_pause); + } + // Too close to final destination, just move on + else self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() func_train_use = +{ + // Block entity state OFF + DISABLE + if (self.estate & ESTATE_BLOCK) return; + + // Original ID logic - No toggle, a triggered train stays ON + // Stop any re-trigger events from reset movement + if (self.state == STATE_OFF) { + self.state = STATE_ON; + self.estate_fire(); + } +}; + +//---------------------------------------------------------------------- +void() func_train_touch = +{ + // Train can still hurt if touched, except when OFF = not visible + if (self.estate & ESTATE_OFF) return; + if (other.health < 1 || other.takedamage == DAMAGE_NO) return; + if (time < self.attack_finished) return; + + self.attack_finished = time + 0.5; + // Instant death for monsters + if (other.flags & FL_MONSTER) + T_Damage (other, self, self, other.max_health + 100, DAMARMOR); + else + // Small damage but can be lethal because of how often touch runs + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // Blood and gore at object location not train + SpawnMeatSpray ( other, other, 250); +}; + +//---------------------------------------------------------------------- +void() func_train_startcorner = +{ + // Find first corner (after spawning) + if (!self.owner) self.owner = find(world, targetname, self.target); + + // Has the first path corner been found? + if (self.owner) { + // Move to first path corner (instantly) + self.finaldest = func_train_origin(self.owner); + setorigin (self, self.finaldest); + self.movetarget = self.owner; + + // Setup last path corner location based on direction + if (self.direction) self.movelast = self.owner.movetarget; + else self.movelast = self.owner.movetarget3; + // Double check movelast is valid, if not reset + if (!self.movelast) self.movelast = self.owner; + + // Fire any event targets on path_corner + if (self.movetarget.corner_event) + trigger_strs(self.movetarget.corner_event, self); + } + // Cannot find first corner (bad situation) + // Go back to spawn location! + else { + setorigin (self, self.dest0); + self.movetarget = self.movelast = self; + } +}; + +//---------------------------------------------------------------------- +void() func_train_setup = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) self.estate_on(); + + func_train_startcorner(); // Reset train to first corner + self.estate_use = func_train_use; // Switch ON train only, no toggle + self.estate_fire = func_train_next; // Move train to next path corner + self.state = STATE_OFF; // Train is OFF, waiting + + // Check for any touch damage trigger (nonsolid + model only) + if (self.solid == SOLID_TRIGGER && self.spawnflags & TRAIN_TOUCH) + self.touch = func_train_touch; + + // Did the first corner (owner) exist? + if (self.owner) { + // no trigger name? = start immediately + // Extra spawnflag to bypass original ID train logic + if (self.targetname == "" || self.spawnflags & TRAIN_STARTON) { + self.nextthink = self.ltime + 0.1; + self.think = self.estate_use; + } + } +}; + +//---------------------------------------------------------------------- +void() func_train_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Setup train in different collision/visual states + if (self.spawnflags & TRAIN_NONSOLID) { + self.movetype = MOVETYPE_PUSH; // Bmodel interaction + self.solid = SOLID_TRIGGER; // No blocking collision + } + // Useful for targetting systems + else if (self.spawnflags & TRAIN_MODEL) { + self.movetype = MOVETYPE_NOCLIP; // Free movement + if (self.spawnflags & TRAIN_TOUCH) // Check for touch damage + self.solid = SOLID_TRIGGER; + else self.solid = SOLID_NOT; // No world interaction + } + else { + // default state - push/collision + self.movetype = MOVETYPE_PUSH; // Bmodel interaction + self.solid = SOLID_BSP; // blocking collision + } + + self.estate = ESTATE_ON; // Switch on entity + setmodel (self, self.mdl); // Show bmodel/model + setsize (self, self.mins , self.maxs); // Use defined size above + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); // Stop any sound + self.velocity = self.avelocity = '0 0 0'; // reset velocity/rotation +}; + +//---------------------------------------------------------------------- +void() func_train_off = +{ + // Stop re-triggering OFF state + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; // Switch off entity + self.state = STATE_OFF; // Stop train functions + self.movetype = MOVETYPE_NONE; // Switch off movement + self.solid = SOLID_NOT; // No world interaction + setmodel (self, ""); // Remove any bmodel/model + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); // Stop any sound + setorigin(self, self.finaldest); // Instantly move to final destionation + self.velocity = self.avelocity = '0 0 0'; // reset velocity/rotation + self.think = SUB_Null; // Stop any future thinking +}; + +//---------------------------------------------------------------------- +void() func_train_disable = +{ + // Wait for entity to finish what it was doing + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() func_train_reset = +{ + // If the train is still STARTING OFF? then leave it + if (self.spawnflags & ENT_STARTOFF) return; + + func_train_startcorner(); // Reset train back to first corner + self.estate = ESTATE_OFF; // Switch off entity (make sure on func works) + self.state = STATE_OFF; // Stop train functions + self.estate_on(); // Switch train back on (reset location) + self.think = SUB_Null; // Stop any future thinking +}; + +//---------------------------------------------------------------------- +void() func_train_blocked = +{ + // This is constant crushing or instant death collision + if (time < self.attack_finished) return; + self.attack_finished = time + 0.5; + T_Damage (other, self, self, self.dmg, DAMARMOR); +}; + +//---------------------------------------------------------------------- +void() func_train = +{ + // 0 = No sound, 1 = train, 5 = custom + if (self.sounds > 0) { + if (self.sounds == 1) { + self.noise = ("plats/train2.wav"); + self.noise1 = ("plats/train1.wav"); + } + else if (self.sounds == 5) { + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + } + precache_sound (self.noise); + precache_sound (self.noise1); + } + + self.classtype = CT_FUNCTRAIN; + self.classgroup = CG_FUNCMOVER; + self.state = STATE_OFF; + self.angles = '0 0 0'; + + if (self.speed < 1) self.speed = 100; + if (!self.dmg) self.dmg = 2; + self.volume = 1; + + // Cannot have nonsolid and nodraw together, they are different entity types + // nonsolid = bmodel with no collision, nodraw = point entity with empty model + if (self.spawnflags & TRAIN_NONSOLID && self.spawnflags & TRAIN_MODEL) { + dprint("\b[FUNC_TRAIN]\b Cannot be bmodel AND model!\n"); + self.spawnflags = self.spawnflags - TRAIN_MODEL; + } + + // There are two types of func_trains (bmodel or point entities) + // Setup train collision / block damage + if ( self.spawnflags & TRAIN_MODEL ) { + setmodel (self, self.model); // Setup bmodel for origin + self.dest0 = bmodel_origin(self); // Calculate reset location + self.finaldest = self.dest0; // Save reset location + setmodel(self, ""); // no longer need bmodel + setorigin(self, self.finaldest); // Move entity to world origin + if (self.mdl) precache_model(self.mdl); // Any custom model defined? + else self.mdl = MODEL_BROKEN; // Use default empty model + self.bsporigin = FALSE; // Not bmodel anymore + self.ltime = time; // Start local timer + } + else { + self.mdl = self.model; // Save bmodel for later + self.bsporigin = TRUE; // bmodel origin active + self.finaldest = self.dest0 = '0 0 0'; // reset/current origin + self.blocked = func_train_blocked; // bmodel collision/block + } + + // Cannot have start ON and OFF together, remove OFF state! + if (self.spawnflags & TRAIN_STARTON && self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Setup train direction (switchable via path corners) + if (self.spawnflags & TRAIN_REVERSE) self.direction = 1; + else self.direction = 0; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = func_train_on; + self.estate_off = func_train_off; + + // Check for a target to move towards? + if (self.target == "") { + dprint("\b[FUNC_TRAIN]\b without a target!?!\n"); + func_train_on(); + return; + } + + // Train has a target, finish setup + self.estate_use = func_train_setup; + self.estate_reset = func_train_reset; + self.estate_disable = func_train_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // Start ON to catch anything (droptofloor) + self.estate_on(); + // start trains on the second frame, to make sure their + // targets have had a chance to spawn + self.nextthink = self.ltime + 0.1; + self.think = self.estate_use; + } +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() train_wait = {}; \ No newline at end of file diff --git a/QC_other/QC_keep/fx.qc b/QC_other/QC_keep/fx.qc new file mode 100644 index 00000000..0dbe0498 --- /dev/null +++ b/QC_other/QC_keep/fx.qc @@ -0,0 +1,1297 @@ +void Touch_Missile(); + +/*====================================================================== + PROJECTILE Explosion and Blood functions + +======================================================================*/ +// Classic ID rocket/grenade explosion +// Not used anymore, left for map hackers! +void() s_explode1 = [0, s_explode2] {}; +void() s_explode2 = [1, s_explode3] {}; +void() s_explode3 = [2, s_explode4] {}; +void() s_explode4 = [3, s_explode5] {}; +void() s_explode5 = [4, s_explode6] {}; +void() s_explode6 = [5, SUB_Remove] {}; + +void() s_explode_think = +{ + if (self.frame >= self.cnt) + {SUB_Remove (); return;} + + self.frame = self.frame + 1; + self.nextthink = time + self.wait; + if (self.frame == self.cnt) + self.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +// General purpose animated spite function +// Types: Small, medium, big, plasma, puffpuff! +//---------------------------------------------------------------------- +void() SpawnExplosion_think = +{ + self.frame = self.frame + 1; + if (self.frame > self.count) SUB_Remove(); + else self.nextthink = time + self.speed; +}; + +//---------------------------------------------------------------------- +void(float sprite_type, vector org, string expl_sound) SpawnExplosion = +{ + local string spr_name; + local float spr_count, spr_speed; + + spr_count = -1; + if (sprite_type == EXPLODE_SMALL) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEEXPLODE), org, '0 0 0', 1); + else { + spr_name = SEXP_SMALL; + spr_count = 5; + spr_speed = 0.1; + } + } + else if (sprite_type == EXPLODE_MED) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEEXPLODE), org, '0 0 0', 1); + else { + spr_name = SEXP_MED; + spr_count = 13; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEEXPLODE), org, '0 0 0', 1); + else { + spr_name = SEXP_BIG; + spr_count = 16; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_PLASMA_SMALL) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMA), org, '0 0 0', 1); + else { + spr_name = SEXP_PLASMA_SMALL; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_PLASMA_MED || sprite_type == EXPLODE_PLASMA_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMABIG), org, '0 0 0', 1); + else { + spr_name = SEXP_PLASMA_BIG; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_POISON_SMALL) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPOISON), org, '0 0 0', 1); + else { + spr_name = SEXP_POISON_SMALL; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_POISON_MED || sprite_type == EXPLODE_POISON_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPOISONMED), org, '0 0 0', 1); + else { + spr_name = SEXP_POISON_MED; + spr_count = 12; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_ELECT_SMALL || sprite_type == EXPLODE_ELECT_MED + || sprite_type == EXPLODE_ELECT_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMA), org, '0 0 0', 1); + else { + spr_name = SEXP_ELECTRIC; + spr_count = 4; + spr_speed = 0.1; + } + } + // This must be pre-cached by entity using it! + // This is not cached in worldspawn as its rarely used + else if (sprite_type == EXPLODE_ICE_BIG) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEPLASMA), org, '0 0 0', 1); + else { + spr_name = SEXP_ICE_BIG; + spr_count = 9; + spr_speed = 0.1; + } + } + else if (sprite_type == EXPLODE_BURST_SMOKE) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEBSMOKE), org, '0 0 0', 1); + else { + spr_name = SBURST_SMOKE; + spr_count = 6; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_BURST_FLAME) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEBFLAME), org, '0 0 0', 1); + else { + spr_name = SBURST_FLAME; + spr_count = 6; + spr_speed = 0.05; + } + } + else if (sprite_type == EXPLODE_BURST_POISON) { + if (ext_dppart) + pointparticles(particleeffectnum(DPP_TEBPOISON), org, '0 0 0', 1); + else { + spr_name = SBURST_POISON; + spr_count = 6; + spr_speed = 0.05; + } + } + else return; + + // Always spawn a temporary entity + // Need one for sprite and/or explosion sound + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_NONE; + newmis.solid = SOLID_NOT; + setorigin(newmis, org); + + // Any sprite requirements? (Fitz engine) + if (spr_count > 0) { + setmodel(newmis, spr_name); // Setup sprite + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.alpha = 0.85; // Slightly transparent + newmis.effects = 32; // Additive blending + newmis.count = spr_count; // Total frames + newmis.speed = spr_speed; // Frame speed + + newmis.think = SpawnExplosion_think; + newmis.nextthink = time + newmis.speed; + } + else { + // No sprite required but need entity for sound to play + // Allow for sound to finish and just remove + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.think = SUB_Remove; + newmis.nextthink = time + 4; + } + + // Play any explosion sounds on temporary entity + if (expl_sound != "") { + sound(newmis, CHAN_WEAPON, expl_sound, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +// Should not be used anymore, this is the old ID system +// Use SpawnExplosion instead, copes with DP effects better +//---------------------------------------------------------------------- +void() BecomeExplosion = +{ + self.touch = SUB_Null; + self.velocity = '0 0 0'; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, ""); + SpawnExplosion(EXPLODE_SMALL, self.origin, ""); + self.nextthink = time + 0.6; + self.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +void(vector org, float velrnd, float upbase, float uprnd) SpawnProjectileSmoke = +{ + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_PROJ_SMOKE); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + if (velrnd > 0) newmis.velocity = vecrand(0,velrnd,TRUE); + else newmis.velocity = '0 0 0'; + newmis.velocity_z = upbase + random()*uprnd; + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +void(entity source, entity targ) ProjectileType = +{ + // Projectile types (Poison/Robot/Stone/Blood) + if (source.poisonous) { + setmodel (targ, MODEL_PROJ_FLESHP); + targ.gibtype = GIBTYPE_POISON; + } + else if (source.classgroup == CG_ROBOT || source.classgroup == CG_STONE) { + setmodel (targ, MODEL_PROJ_SMOKE); + targ.gibtype = GIBTYPE_STONE; + } + else { + setmodel (targ, MODEL_PROJ_FLESH); + targ.gibtype = GIBTYPE_BLOOD; + } + // Finally add DP particle trails + if (ext_dppart) DPP_blood_trail(targ); +}; + +//---------------------------------------------------------------------- +// Mainly used to show resistance to an ammo type +// Also used by boils for their idle gibs +//---------------------------------------------------------------------- +void(entity source, vector org, float velrnd, float upbase, float uprnd) SpawnProjectileMeat = +{ + newmis = spawn (); + newmis.classtype = CT_TEMPGIB; + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_NOT; + // Projectile types (Poison/Robot/Stone/Blood) + ProjectileType(source, newmis); + setorigin (newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vecrand(0,velrnd,TRUE); + newmis.velocity_z = upbase, random()*uprnd; + newmis.avelocity = vecrand(100,velrnd,FALSE); + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +// SpawnBlood +//---------------------------------------------------------------------- +void(entity targ, vector org, vector vel, float part_qty) SpawnBlood = +{ + local float loop_count, part_col; + loop_count = 0; + vel = vel * 0.1; + part_qty = part_qty / 2; + + // Exception - breakables don't really bleed red blood + if (targ.classgroup == CG_BREAKABLE) part_col = targ.bleedcolour; + else { + if (targ.poisonous) part_col = MON_BCOLOR_GREEN; + else if (targ.classgroup == CG_ROBOT) part_col = MON_BCOLOR_YELLOW; + else part_col = MON_BCOLOR_RED; + } + + // Loop through particle count creating bursts of particles + while(loop_count < 4) { + if (loop_count == 2 && targ.bleedcolour > 0) part_col = targ.bleedcolour; + particle (org, vel, part_col + rint(random()*7), part_qty); + loop_count = loop_count + 1; + } +}; + +//---------------------------------------------------------------------- +// spawn_touchblood +// Triggered by Touch_Bullet, Touch_PlasmaProjectile, Touch_Projectile +// Used by monsters - DFURY, DOG, FISH, SCORPION, SPIDER, VORELING, ZOMBIEK +//---------------------------------------------------------------------- +void(entity source, entity targ, float damage) spawn_touchblood = +{ + local vector org, vel; + + // The vel calculation uses v_up/right, make sure vectors is setup + makevectors(source.angles); + vel = normalize (source.velocity); + vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5)); + vel = vel + 2*trace_plane_normal; + // Originally vel = ((vel * 200) * 0.2) * 0.01 + vel = vel * 0.4; + + // Check for an origin blood offset (monsters) + if (CheckZeroVector(source.meleeoffset)) org = '0 0 0'; + else org = attack_vector(source.meleeoffset); + + SpawnBlood (targ, source.origin + org, vel, damage); +}; + +//====================================================================== +// SpawnMeatSpray +// Changed to remove dependance on 'self' for missile origin +// Changed parameters to add source and destination of attack +// Changed velocity to side so it is calculated correctly from angles +//====================================================================== +void(entity source, entity targ, float side) SpawnMeatSpray = +{ + local vector org; + + makevectors(source.angles); + + // Check for a melee offset? - Special vector offset + if (CheckZeroVector(source.meleeoffset)) org = v_forward * 16; + else org = attack_vector(source.meleeoffset); + + // Create starting point to spawn + org = org + source.origin; + + if (targ.bleedcolour) SpawnBlood(targ, org, v_up*2, 100); + else { + newmis = spawn (); + newmis.classtype = CT_TEMPGIB; + newmis.classgroup = CG_TEMPENT; + newmis.owner = source; + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_NOT; + + // Projectile types (Poison/Robot/Stone/Blood) + ProjectileType(targ, newmis); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); + + // Use side velocity to determine which direction to throw + newmis.velocity = ((crandom()*16) * v_forward) + (side * v_right); + newmis.velocity_z = newmis.velocity_z + 150 + 50*random(); + + newmis.avelocity = vecrand(100,200,FALSE); + // set newmis duration + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; + } +}; + +//================ +// SpawnMeatSprayDrake - from drake mod's version +//================ +void(vector org, vector vel, float btype) SpawnMeatSprayDrake = +{ + local string text; + + if (btype == BLOOD_RED) + text = "progs/zom_gib.mdl"; + else if (btype == BLOOD_GREEN) + {if (bloodbank & BB_GREEN) text = "progs/drake/gr_gib.mdl";} + else if (btype == BLOOD_PURPLE) + {if (bloodbank & BB_PURPLE) text = "progs/drake/pur_gib.mdl";} + else if ((btype == BLOOD_FIRE) && (bloodbank & BB_FIRE)) + {text = "progs/drake/ember.mdl";} + else if (btype != BLOOD_DARK) + return; // Unable to spew gore. + + local entity gib; + + gib = spawn (); + gib.owner = self; + gib.movetype = MOVETYPE_BOUNCE; + gib.solid = SOLID_NOT; + + gib.velocity = vel; + gib.velocity_z = gib.velocity_z + 250 + 50*random(); + gib.avelocity = '3000 1000 2000'; + +// set missile duration + if (text) + { + gib.nextthink = time + 1; + gib.think = SUB_Remove; + setmodel (gib, text); + } + else + { + gib.bloodtype = btype; + gib.delay = time + 1; + gib.nextthink = 0.01; + gib.think = MeatSprayThink; + gib.modelindex = 0; + } + setsize (gib, '0 0 0', '0 0 0'); + setorigin (gib, org); +}; + + +// ============================================================================== +// Drake effects: +// ============================================================================== +//========================================================================== +// Temporary Entities + +// PM: These are common within the qc progs. + +void(float fx, vector spot) Tent_Point = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, fx); + WriteCoord (MSG_BROADCAST, spot_x); + WriteCoord (MSG_BROADCAST, spot_y); + WriteCoord (MSG_BROADCAST, spot_z); +}; + +void(float fx, entity src, vector p1, vector p2) Tent_Beam = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, fx); + WriteEntity (MSG_BROADCAST, src); // If client, origin overrides p1. + WriteCoord (MSG_BROADCAST, p1_x); + WriteCoord (MSG_BROADCAST, p1_y); + WriteCoord (MSG_BROADCAST, p1_z); + WriteCoord (MSG_BROADCAST, p2_x); + WriteCoord (MSG_BROADCAST, p2_y); + WriteCoord (MSG_BROADCAST, p2_z); +}; + +void(vector spot) Tent_Explosion = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, spot_x); + WriteCoord (MSG_BROADCAST, spot_y); + WriteCoord (MSG_BROADCAST, spot_z); +}; + +void(vector spot, float rgb, float add) Tent_Explosion2 = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, 12); // TE_EXPLOSION2 + WriteCoord (MSG_BROADCAST, spot_x); + WriteCoord (MSG_BROADCAST, spot_y); + WriteCoord (MSG_BROADCAST, spot_z); + WriteByte (MSG_BROADCAST, rgb); // First index to use on the palette. + WriteByte (MSG_BROADCAST, add); // Range is from rgb to rgb+add-1. +}; + +// Generic beam. +// NOTE: Nehahra engine feature. Not available in standard Quake. +//void(string text, entity src, vector p1, vector p2) Tent_NehBeam = +//{ +// WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); +// WriteByte (MSG_BROADCAST, 17); // TE_LIGHTNING4 +// WriteString (MSG_BROADCAST, text); +// WriteEntity (MSG_BROADCAST, src); // If client, p1 is always origin. +// WriteCoord (MSG_BROADCAST, p1_x); +// WriteCoord (MSG_BROADCAST, p1_y); +// WriteCoord (MSG_BROADCAST, p1_z); +// WriteCoord (MSG_BROADCAST, p2_x); +// WriteCoord (MSG_BROADCAST, p2_y); +// WriteCoord (MSG_BROADCAST, p2_z); +//}; + +//void(vector p1, vector p2, vector ang) Tent_TomazRail = +//{ // MSG_BROADCAST should be 0. +// WriteByte (0, SVC_TEMPENTITY); WriteByte (0, 17); +// WriteCoord (0, p1_x); WriteCoord (0, p1_y); WriteCoord (0, p1_z); +// WriteCoord (0, p2_x); WriteCoord (0, p2_y); WriteCoord (0, p2_z); +// WriteCoord (0, ang_x); WriteCoord (0, ang_y); WriteCoord (0, ang_z); +//}; + +//- - - - - - - - - +void(vector spot) R_Exp3 = +{ + local entity e; + + e = spawn(); + setorigin (e, spot); + sound (e, CHAN_AUTO, "weapons/r_exp3a.wav", 1, ATTN_NORM); + remove (e); +}; + +void(vector spot) Rocket_Explosion1 = +{ + R_Exp3 (spot); + + Tent_Explosion (spot); +}; + +void(vector spot, float rgb, float add) Rocket_Explosion2 = +{ + R_Exp3 (spot); + + Tent_Explosion2 (spot, rgb, add); +}; + +void(vector spot) Rocket_TarExplosion = +{ + R_Exp3 (spot); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord (MSG_BROADCAST, spot_x); + WriteCoord (MSG_BROADCAST, spot_y); + WriteCoord (MSG_BROADCAST, spot_z); +}; +//- - - - - - - - - + + +//========================================================================== +// Common Explosions + +//float CX_ORANGE = 0; +//float CX_RED = 1; +//float CX_YELLOW = 2; +//float CX_BLUE = 3; +//float CX_PURPLE = 4; + +void(vector spot, float r) Colored_Explosion = +{ + local float base, add; + + if (r == 3) + {base = 244; add = 3;} + else if (r == 2) + {base = 240; add = 4;} + else if (r == 1) + {base = 247; add = 5;} + else + { + r = random() * 3; + if (r < 1) + {base = 224; add = 16;} + else if (r < 2) + {base = 230; add = 8;} + else + {base = 232; add = 8;} + } + Rocket_Explosion2 (spot, base, add); +}; + +// As 'BecomeAnyExplosion', with adjustable frames per second. +// Used by some custom explosions. +void(float base, float add, float fps, string text) BecomeFpsExplosion = +{ + if (!add) + add = 6; // Assume standard duration of six frames. + if (!fps) + fps = 10; + +// Become explosion code. + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel (self, text); + self.solid = SOLID_NOT; +//- - - - + self.frame = base; + self.cnt = base + add - 1; + self.wait = 1 / fps; + self.nextthink = time + self.wait; + self.think = s_explode_think; +}; + +void(float base, float add, string text) BecomeAnyExplosion = +{ + if (!add) + add = 6; // Assume standard duration of six frames. + +// Become explosion code. + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel (self, text); + self.solid = SOLID_NOT; +//- - - - + self.frame = base; + self.cnt = base + add - 1; + self.wait = 0.1; + self.nextthink = time + 0.1; + self.think = s_explode_think; +}; + +void(vector spot, float base, float add, string text) MakeAnyExplosion = { + local entity swap; + + swap = self; + + self = spawn(); + setsize (self, '0 0 0', '0 0 0'); + setorigin (self, spot); + BecomeAnyExplosion (base, add, text); + + self = swap; +}; + +void(float base, float add) BecomeFancy = + {BecomeAnyExplosion (base, add, "progs/drake/s_fancy.spr");}; + +void(vector spot, float base, float add) MakeFancy = + {MakeAnyExplosion (spot, base, add, "progs/drake/s_fancy.spr");}; + +//========================================================================== +// Ice Explosions +// iceball.mdl: frames 0-2 = iceballs, frames 3-7 = explosion of shards. +void() BecomeIcyExp = +{ + self.skin = 0; + BecomeAnyExplosion (3, 5, "progs/drake/iceball.mdl"); + self.alpha = ALPHA_ICE; +}; + +void(vector spot) MakeIcyExp = { + local entity iced; + + iced = spawn(); + iced.movetype = MOVETYPE_NONE; + iced.velocity = '0 0 0'; + iced.touch = SUB_Null; + iced.solid = SOLID_NOT; + //- - - - + iced.alpha = ALPHA_ICE; + iced.frame = 3; + iced.cnt = iced.frame + 4; // 5 - 1 + iced.wait = 0.1; + iced.nextthink = time + 0.1; + iced.think = s_explode_think; + //- - - - + setall (iced, "progs/drake/iceball.mdl", '0 0 0', '0 0 0', spot); +}; + +//========================================================================== +// Shockwaves + +void(vector spot, float base, float add, string text) ShockWave = +{ + local entity wav1, wav2, ts; + local vector ang; + +// NOTE: Don't use world in the 4th (ignore) parm or else the traceline +// will pass through any non-world bsp entites, such as shootable +// trap doors. Use self instead, which should be an inflictor entity. + traceline (spot, spot - '0 0 64', TRUE, self); + if (trace_fraction >= 1.0) + return; // Too far from ground. + if ((trace_plane_normal * '0 0 1') < 0.5) //<= 0.7071 + return; // Ground slopes too much. + + spot = trace_endpos + trace_plane_normal * 2; + ang = vectoangles(trace_plane_normal); + ang_y = anglemod(ang_y + 180); + +// Top side. + wav1 = spawn(); + wav1.angles = ang; + setorigin (wav1, spot); + +// Bottom side. + ang_x = anglemod(ang_x + 180); + wav2 = spawn(); + wav2.angles = ang; + setorigin (wav2, spot); + +// Thinking + ts = self; + self = wav1; + BecomeAnyExplosion (base, add, text); + self = wav2; + BecomeAnyExplosion (base, add, text); + self = ts; +}; + +// Used by exploding barrels and MIRVs. Yes, add 7 instead of 8. +void() FlameWave = {ShockWave (self.origin, RING_FIRE, 7, "progs/drake/s_wave.spr");}; + +// Modified Custents explosion -- appended after standard explosion sprites. +// Fast version below. Slow version was <7, 8, 10, 12, 14, 16, 18, 19, 20>. +void() s_explodeb1 =[ 7, s_explodeb2 ] {}; +void() s_explodeb2 =[ 10, s_explodeb3 ] {}; +void() s_explodeb3 =[ 13, s_explodeb4 ] {}; +void() s_explodeb4 =[ 16, s_explodeb5 ] {}; +void() s_explodeb5 =[ 19, s_explodeb6 ] {}; +void() s_explodeb6 =[ 20, SUB_Remove ] {}; + +//========================================================================== +// More Fiery Explosions + +void() s_fiery1 =[ 1, s_fiery2 ] {}; +void() s_fiery2 =[ 3, s_fiery3 ] {}; +void() s_fiery3 =[ 5, s_fiery4 ] {}; +void() s_fiery4 =[ 7, s_fiery5 ] {}; +void() s_fiery5 =[ 9, s_fiery6 ] {}; +void() s_fiery6 =[ 11, s_fiery7 ] {}; +void() s_fiery7 =[ 13, s_fiery8 ] {}; +void() s_fiery8 =[ 15, SUB_Remove ] {}; + +void(string fx, void() thinkst) Explosion_Start = +{ + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel (self, fx); + self.solid = SOLID_NOT; + thinkst (); +}; + +void() BecomeTheBigFire = +{ + if (deathmatch || coop) + Explosion_Start ("progs/drake/s_expbig.spr", s_fiery1); + else + BecomeFpsExplosion (0, 17, 20, "progs/drake/s_expbig.spr"); +}; + +void() BecomeExplosion2 = +{ + if (deathmatch || coop) + Explosion_Start ("progs/drake/s_explod.spr", s_explodeb1); + else + BecomeFpsExplosion (6, 16, 25, "progs/drake/s_explod.spr"); +}; + +// This creates a small particle trail behind the shot. +void(float rgb, float density, float full) Meteor_Trail = +{ + Particle_Beam (self.oldorigin, self.origin, rgb, rgb, density, full); + self.oldorigin = self.origin; // Update previous point. +}; + +// 'waitmin' = slow color, 'waitmax' = fast color. +void(entity shot, float rgb) Laser_Color = +{ + shot.skin = rgb; + if (rgb == 3) // Blue + {shot.waitmin = 9; shot.waitmax = 41;} + else if (rgb == 2) // Yellow + {shot.waitmin = 105; shot.waitmax = 193;} + else if (rgb == 1) // Red + {shot.waitmin = 73; shot.waitmax = 225;} + else // Orange + {shot.skin = 0; shot.waitmin = 97; shot.waitmax = 233;} + // Note: For orange, I replaced 225 with 97 to stop blood in some ports. +}; + +//========================================================================== +// Nemesant Effects + +// PM: Like BecomeExplosion, but for the Nemesant's signature explosion. +// In Drake, some bosses use this for their post-mortem explosions. +void() WarpExplosion = +{ + sound (self, CHAN_AUTO, "nemesant/bigboom.wav", 1, ATTN_NORM); + Tent_Point (TE_EXPLOSION, self.origin); + FlameWave (); // PM: New shockwave effect at ground zero. +// DISABLED -- Quake effects may be a bit excessive. +// Quake_Spawn (300, 0, self.origin, 0, 1); + BecomeTheBigFire (); // Replaced old fireball mdl with big sprite. +}; + +//- - - - - - - - - +// PM: Moved circle drawing code from Zerstorer's misc.qc to here. +void(vector Center, float Radius, float CColor) DrawCircleXY = +{ +local float MajorAxis, MinorAxis; +local float RadSqminusMajAxis, MinAxisSqThreshold; +local vector circlepos, vel; + + MajorAxis = 0; + MinorAxis = Radius; + circlepos_z = Center_z; + vel = '0 0 1'; + + RadSqminusMajAxis = Radius * Radius; + MinAxisSqThreshold = MinorAxis * MinorAxis - MinorAxis; + + do { + circlepos_x = Center_x+MajorAxis; circlepos_y = Center_y-MinorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x-MajorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x+MajorAxis; circlepos_y = Center_y+MinorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x-MajorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x+MinorAxis; circlepos_y = Center_y-MajorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x-MinorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x+MinorAxis; circlepos_y = Center_y+MajorAxis; + particle(circlepos, vel, CColor, 15); + circlepos_x = Center_x-MinorAxis; + particle(circlepos, vel, CColor, 15); + MajorAxis = MajorAxis + 20; + RadSqminusMajAxis = RadSqminusMajAxis - (MajorAxis + MajorAxis - 20); + if ( RadSqminusMajAxis <= MinAxisSqThreshold ) + { + MinorAxis = MinorAxis - 20; + MinAxisSqThreshold = MinAxisSqThreshold - (MinorAxis + MinorAxis); + } + } while ( MajorAxis <= MinorAxis ); +}; + +//========================================================================== +// Normal Lightning Bolt + +// Creates a discharge effect. +//void(entity ent) Discharge = +//{ +// local float damage; + + // if (!ent) + // return; + // damage = floor (ent.ammo_cells * 35 / 2); // Max cells is 200. + //if (damage < 1) + // return; + //Update_Cells (ent, 0); + // ent.currentammo = 0; // For NPCs. + // if (ent.flags & FL_CLIENT) + // SUB_Think (ent, War_FindBestWeapon); + +// FIXME: In DarkPlaces, clients can set lightning color for themselves. + // sound (self, CHAN_AUTO, "plasma/explode.wav", 1, ATTN_NORM); + // Rocket_Explosion2 (ent.origin, 244, 3); +// MakeFancy (ent.origin, X56_PLASMA_BLUE, 6); + // PM: Added rocket damage flag for shamblers' resistance. +// T_RadiusDamage (ent, ent, damage, world, DAMAGEALL); +//}; + +//------------------------------------------------------------------------// +// This inflicts damage to an entity hit by the lightning bolt. +//------------------------------------------------------------------------// +void LightningBlood (entity targ,vector org,float damage); + + +void(entity targ, entity inflictor, entity attacker, vector org, float damage, string dtype) BoltDamage = { + LightningBlood (targ, org, damage); + T_Damage (targ, inflictor, attacker, damage, DAMARMOR); +}; + +void(entity targ, entity inflictor, entity attacker, vector org, float damage, float dflags, string dtype) BoltDamage_Ex = { + LightningBlood (targ, org, damage); + T_Damage (targ, inflictor, attacker, damage, DAMARMOR); +}; + +// Spawns the blood caused by hits from lightning bolts. +void(entity targ, vector org, float damage) LightningBlood = +{ + local float den; + + den = damage * targ.resist_cells * 4; // Was 'damage*4' + den = floor (den); + if (den > 0) + { + local float blud; + + if (targ.bloodtype == BLOOD_RED) + blud = 225; // Lightning blood. + else + blud = targ.bloodtype; + if (blud > 0) + particle (org, '0 0 100', blud, den); // Hit/bleed + else + particle (org, '0 0 20', 0 - blud, 10); // chunks + } +}; + +//------------------------------------------------------------------------// +// This strikes all entities hit by the lightning bolt. +//------------------------------------------------------------------------// +void(vector p1, vector p2, entity attacker, float damage, entity inflictor, + float fx, string dtype) LightningBolt = +{ +// The old lightning code spawned two more invisible beams at weird places +// that could damage and kill more enemies (or teammates). The new code +// below creates a single piercing bolt that hits everything in its path, +// like the railgun. Lightning in many games (e.g., D&D, Diablo) pierce. + + local entity ruler; + local entity ignore; + local entity targ; + local vector start; + local vector dir; + local float dist; + local float delta; + local float yes; + local float first; + + //GhostTouch_On (); + + first = + yes = TRUE; + ruler = inflictor; + + dir = p2 - p1; + delta = vlen(dir); // Get total length in case of reflection. + dir = normalize(dir); + + while (ruler) + { + ignore = inflictor = ruler; + ruler = world; // End loop unless set otherwise by reflection. + start = p1; + + do + { + traceline (p1, p2, FALSE, ignore); + + p1 = trace_endpos; + targ = trace_ent; + + if (targ.solid != SOLID_BSP) + ignore = targ; + else + ignore = world; + + if (targ != inflictor) // Dirty hack to prevent suicide. + { + //if (HasReflection (targ, p1, damage)) + //{ + //if (yes) + //{ + // yes = FALSE; + // ruler = targ; + // delta = delta - vlen(p1 - start); // Get remaining dist. + // dir = normalize(p1 - targ.origin); + p2 = p1 + dir*delta; + //} + //else // ...we give up. + //{ // Use dummy entity to draw reflected bolt. + // If there are many, only one is drawn. + // inflictor = lightning; + //} + //ignore = world; // Stop bolt. + //ReflectSound (targ); + //} + //else + //{ + if (first) + if (targ.takedamage) + BoltDamage (targ, inflictor, attacker, p1, damage, dtype); + //} + } + + // If current trace hits inflictor/attacker, next trace will miss all. + // Move the new start point ahead slightly to prevent attacker from + // hitting himself and preventing the bolt from piercing anymore. + // (Note: If attacker is inside the monster because of noclip, + // he can still hit himself.) + if (ignore) // Always world if 'p2 == trace_endpos'. + { + dist = vlen(p2 - p1); + if (dist > 1) + p1 = p1 + dir; + else + ignore = world; // Not enough distance left, so just stop. + } + } + while (ignore); + + // Draw the lightning bolt between the two points. + Tent_Beam (fx, inflictor, start, p1); + } + + //GhostTouch_Off (); +}; +void(vector p1, vector p2, entity attacker, float damage) LightningBolt1 = + { LightningBolt (p1, p2, attacker, damage, attacker, TE_LIGHTNING1, "lightning"); }; +void(vector p1, vector p2, entity attacker, float damage) LightningBolt2 = + { LightningBolt (p1, p2, attacker, damage, attacker, TE_LIGHTNING2, "lightning"); }; + +//========================================================================== +// Smart Fireballs -- Used by nemesant (and SoE sorcerer). + +void() SmartBall_Think = +{ + if (self.delay <= time) + {remove(self); return;} + + self.angles = vectoangles(self.velocity); + +// Changed particle count from 25 at 10/sec to 10 at 20/sec. +// Note: 2000 speed rocket trails spawn 11 at about 50/sec. + particle (self.origin, '0 0 1', 233, 10); //particle (self.origin, '0 0 1', 233, 25); + self.nextthink = time + 0.05; //self.nextthink = time + 0.1; +}; + +void() SmartBall_Bounce = +{ + local vector p1, p2; + local float up; + + p1 = self.origin; + p2 = self.enemy.origin + self.enemy.view_ofs; // Go for the eyes. + up = Aim_TossUp (p1, p2, 400); + +// Fireballs can be fooled by invisibility. + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.velocity = Maim_SmartBall (p1, p2, 400, up, world, '0 0 0'); + self.velocity = self.velocity * 400; + self.velocity_z = self.velocity_z + up; + self.angles = vectoangles(self.velocity); + + self.nextthink = time + 0.01; + self.think = SmartBall_Think; +}; + +void() SmartBall_Touch = +{ + if (pointcontents(self.origin) == CONTENT_SKY) + {remove(self); return;} // Disappeared into space. + //if (Reflected_Damage (COURAGE_DAMAGE)) + // return; // Bounced off reflective shield. + +// Explode if... +// 1) Entity struck can take damage. +// 2) Fireball bounced more than three times. One more than HipLaser. +// 3) Target is already dead. + if (other.takedamage || (self.count >= 3) || (self.enemy.health <= 0)) + { // Go BOOM! + Touch_Missile(); + return; + } + + // PM: Removed 'hknight/hit.wav'. + sound (self, CHAN_WEAPON, "nemesant/frblfly.wav", 0.6, ATTN_NORM); + self.count = self.count + 1; + self.think = SmartBall_Bounce; + self.nextthink = time + 0.01; +}; + +void(vector start, vector dir, vector add) SmartBall_Launch = { + newmis = spawn (); + newmis.master = newmis.owner = self; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_BBOX; + newmis.classname = "fireball"; +// set missile speed + newmis.speed = 600; + newmis.velocity = (dir * 600) + add; + newmis.angles = vectoangles(newmis.velocity); +// set missile damage + if (cranked) + newmis.dmg = 60; + else + newmis.dmg = 40; + newmis.enemy = self.enemy; + newmis.style = DF_ROCKET | DF_SAFE; + newmis.worldtype = MDAM_GRENADE; +// set missile special stuff + newmis.count = 0; +// set missile duration + newmis.touch = SmartBall_Touch; + newmis.delay = time + 20; // Total duration + newmis.nextthink = time + 0.1; + newmis.think = SmartBall_Think; + newmis.classtype = CT_PROJ_SMARTBALL; + + setall (newmis, "progs/drake/smartbal.mdl", '0 0 0', '0 0 0', start); +}; + +void(vector st) M_FireSmart = { + local vector p1, p2, dir, up; + local entity targ; + + targ = world; + makevectors (self.angles); + p1 = self.origin + (v_forward*st_x) + (v_right*st_y) + (v_up*st_z); + p2 = Aimpoint (self.enemy); + + up = '0 0 0'; + up_z = Aim_TossUp (p1, p2, 600); + dir = Maim_SmartBall (p1, p2, 600, up_z, targ, '0 0 0'); + if (!targ) + { // In case we can't hit enemy, just lob it straight ahead. + TraceToss (p1, up + dir*600, FALSE, self, 5); + if (trace_ent != self.enemy) + up_z = 200; + } + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_AUTO, "nemesant/frblfly.wav", 0.6, ATTN_NORM); + + SmartBall_Launch (p1, dir, up); +}; + +void() death_puff = +{ + local vector spot; + local entity puff; + + spot_x = random(); + spot_y = random(); + spot_z = random() * 0.5; + spot = Anypoint (self, spot); + + puff = spawn(); + setorigin (puff, spot); + puff.effects = EF_MUZZLEFLASH; + sound (puff, CHAN_AUTO, "hknight/hit.wav", 1, ATTN_NORM); + SUB_Think (puff, BecomeExplosion); // FIXME: Invisible in Qrack. +}; + +// Like ShockWave, but show only the top side. +// Use for mini-rings, when you need a lot of them. +void(vector spot, float base, float add, string text) HalfWave = +{ + local entity wav1, ts; + local vector ang; + + traceline (spot, spot - '0 0 64', TRUE, world); + if (trace_fraction >= 1.0) + return; // Too far from ground. + // Removed slope check. + + spot = trace_endpos + trace_plane_normal * 2; + ang = vectoangles(trace_plane_normal); + ang_y = anglemod(ang_y + 180); + +// Top side. + wav1 = spawn(); + wav1.angles = ang; + setorigin (wav1, spot); + +// Thinking + ts = self; + self = wav1; + BecomeAnyExplosion (base, add, text); + self = ts; +}; + +//========================================================================== +// Wind Wall -- for SoE + +//- - - - - - - - - +// Missile_Up -- Variation of 'ReflectMissile'. +// Redirects a missile straight up. +// +// Entity who is reflecting the shot is assumed to be 'self'. +// +// shot: Missile to be redirected. +//- - - - - - - - - +void(entity shot) Missile_Up = +{ + if (shot.movetype == MOVETYPE_NONE) + return; // Can't move. + +// Reset fields that may affect its movement. + if (!shot.speed) + shot.speed = vlen(shot.velocity); + shot.movedir = '0 0 1'; + shot.velocity = shot.movedir * shot.speed; + shot.dest = shot.velocity; // For lasers and spikes. + shot.angles = vectoangles(shot.movedir); + if (shot.pos1_x) // For fireballs. + shot.angles_x = shot.angles_x + shot.pos1_x; + shot.oldorigin = shot.origin; // For particle trails. +// Unstick missile if engine thinks it is on the ground. + shot.flags = shot.flags - (shot.flags & FL_ONGROUND); + shot.groundentity = world; +// Special: If remote controlled mirv, sever link. + if (shot.master) + if (shot.master.mirv1 == shot) + shot.master.mirv1 = world; +}; + +// Spawns a dust cloud upward. Used by Storm Baron's gust attack. +void(entity ent) Particle_Gust = +{ + local vector spot; + local float loop; + + loop = 9; + while (loop > 0) + { + loop = loop - 1; + spot_x = random() * 2 - 0.5; + spot_y = random() * 2 - 0.5; + spot_z = loop / 8; + spot = Anypoint (ent, spot); + particle (spot, '0 0 8', 1, 5); + } +}; + +float SPRITE_PLAYONCE = 4; +float SPRITE_STARTOFF = 8; +float S_ACTIVE = 1; +float S_DEACTIVE = 0; +float S_ALPHANULL = 0.001; + +void() env_sprite_loop = { + if (self.spritestarted == FALSE) { + self.frame = self.pos1_x; + self.spritestarted = TRUE; + self.alpha = self.pos1_y; + } else { + self.frame = self.frame + 1; + } + + if (self.frame > (self.idleweaponframe)) { + self.frame = self.pos1_x; + if (self.spawnflags & SPRITE_PLAYONCE) { + self.use(); + return; + } + } + + self.think = env_sprite_loop; + self.nextthink = time + 0.05; +}; + +// Added by Qmaster +void() env_sprite_hide = { + //self.model = ""; + //self.modelindex = 0; + self.alpha = 0.0001; + self.spritestarted = FALSE; + self.frame = self.pos1_x; //reset + self.effects = 0; + self.solid = SOLID_NOT; + self.takedamage = DAMAGE_NO; + self.movetype = MOVETYPE_NONE; + self.velocity = VEC_ORIGIN; + self.angles = VEC_ORIGIN; + self.use = self.think1; + self.think = SUB_Null; + self.nextthink = time + 0.1; +}; + +void () env_sprite_use = { + if (self.state == S_ACTIVE) { + self.alpha = S_ALPHANULL; + self.spritestarted = FALSE; + self.state = S_DEACTIVE; + } else { + self.state = S_ACTIVE; + self.alpha = self.pos1_y; + } +}; + +void () env_sprite_on = { + +}; + +void () env_sprite_off = { + +}; + +void () env_sprite_disable = { + +}; + +void () env_sprite_reset = { + +}; + + +void () env_sprite = { + if (self.mdl == "") { + dprint("ERROR: no model for env_sprite\n"); + return; + } + + precache_model(self.mdl); + setmodel(self,self.mdl); + if (self.alpha <= 0) self.alpha = 1; + self.pos1_x = self.frame; + self.pos1_y = self.alpha; + self.use = env_sprite_use; + self.estate_on = env_sprite_on; + self.estate_off = env_sprite_off; + self.estate_disable = env_sprite_disable; + self.estate_reset = env_sprite_reset; + self.estate = ESTATE_ON; + + if (self.spawnflags & SPRITE_STARTOFF) { + self.estate_off(); + } + + if (self.idleweaponframe > 0) { + self.think = env_sprite_loop; + } else { + self.think = SUB_Null; + } + self.nextthink = time + 0.1; +}; diff --git a/QC_other/QC_keep/fx_drake.qc b/QC_other/QC_keep/fx_drake.qc new file mode 100644 index 00000000..dd05cfbd --- /dev/null +++ b/QC_other/QC_keep/fx_drake.qc @@ -0,0 +1,1003 @@ +void() T_MissileTouch; + +// This creates an explosion sprite entity from scratch. +void(vector spot) MakeExplosion = +{ + local entity swap; + + swap = self; + + self = spawn(); + setsize (self, '0 0 0', '0 0 0'); + setorigin (self, spot); + BecomeExplosion (); + + self = swap; +}; + +//====================================== +// Standard Rockets +//====================================== +// PM: Replaced owner with master for all missiles because of reflection. +void() T_MissileExplode = { + if (!self.dmg) + self.dmg = 120; + + if (self.enemy) // Don't check health, just if there is a target. + { + // History lesson: Doom's rockets did 1d8*20 (20-160) damage on + // a direct hit, and did full radius damage to everyone. + // Cyberdemon took full damage from direct hits, but none from + // any splash. + local float damage; + + if (self.worldtype == MDAM_TWENTY) + { + if (self.dmg < 20) + damage = random() * self.dmg; + else + damage = (self.dmg - 20) + (random() * 20); + } + else if (self.worldtype == MDAM_FULL) + damage = self.dmg; + else if (self.worldtype == MDAM_GRENADE) + damage = SUB_ExploDamage (other, self, self.dmg); + else + damage = SUB_RandomDamage (self.dmg); + // PM: For rewritten shal-rath missiles. + if (self.style & DF_ZKILL) + if (self.enemy.classname == "monster_zombie") + damage = self.enemy.health + 50; + //- - - - - - - - - + T_Damage (self.enemy, self, self.master, damage, DAMARMOR); + } + // Don't do radius damage to the enemy, because all the damage + // was done in the impact. + T_RadiusDamage (self, self.master, self.dmg, self.enemy, DAMAGEALL); +// DISABLED -- Not sure I want to do fragmentation this way. +// if (self.th_win) +// self.th_win (); // For fragmenting attacks such as gugs' bilebombs. + +// PM: Don't set origin directly during a touch function because of +// possible link scrambling. May cause FitzQuake to crash otherwise. + self.origin = self.origin - 8*normalize(self.velocity); + if (self.think1) { + // Alternate explosion code defined, so use that instead. + self.think1(); + } else { + // Standard explosion procedure. + Rocket_Explosion1 (self.origin); + BecomeExplosion2 (); + } +// PM: In classic Doom, target took damage from both impact AND explosion. +// The only exception was if the target was either the cyberdemon or +// spider mastermind, both of whom had immunity to splash damage. +}; + +//========================================================================== +// Light Zero + +// Custom addition by PM. Used by storm code, most of it in 'drake_cool.qc'. +// +// Since much of the level is lit up using lightstyle 0, changing it +// will make much of the level brighter or darker. Useful for lightning +// storm effects. + +float lightzero_finished; +float lightzero_level; +float lightzero_rate; + +float LIGHT_ZERO = 0; // Lightstyle 0. +float LIGHTZERO_NORMAL = 12; // Use for light "m". +float LIGHTZERO_MIN = 4; // Minimum light when storming. +float LIGHTZERO_MAX = 25; // Maximum light allowed. + +// Calls 'lightstyle(0, <foo>)'. +void() LightZero_Update = +{ +// dprint(ftos(lightzero_level)); dprint("\n"); + lightzero_level = floor (lightzero_level); + if (lightzero_level < 5) + { + if (lightzero_level < 1) + lightstyle(LIGHT_ZERO, "a"); + else if (lightzero_level == 1) + lightstyle(LIGHT_ZERO, "b"); + else if (lightzero_level == 2) + lightstyle(LIGHT_ZERO, "c"); + else if (lightzero_level == 3) + lightstyle(LIGHT_ZERO, "d"); + else //if (lightzero_level == 4) + lightstyle(LIGHT_ZERO, "e"); + } + else if (lightzero_level < 10) + { + if (lightzero_level == 5) + lightstyle(LIGHT_ZERO, "f"); + else if (lightzero_level == 6) + lightstyle(LIGHT_ZERO, "g"); + else if (lightzero_level == 7) + lightstyle(LIGHT_ZERO, "h"); + else if (lightzero_level == 8) + lightstyle(LIGHT_ZERO, "i"); + else //if (lightzero_level == 9) + lightstyle(LIGHT_ZERO, "j"); + } + else if (lightzero_level < 15) + { + if (lightzero_level == 10) + lightstyle(LIGHT_ZERO, "k"); + else if (lightzero_level == 11) + lightstyle(LIGHT_ZERO, "l"); + else if (lightzero_level == 12) + lightstyle(LIGHT_ZERO, "m"); + else if (lightzero_level == 13) + lightstyle(LIGHT_ZERO, "n"); + else //if (lightzero_level == 14) + lightstyle(LIGHT_ZERO, "o"); + } + else if (lightzero_level < 20) + { + if (lightzero_level == 15) + lightstyle(LIGHT_ZERO, "p"); + else if (lightzero_level == 16) + lightstyle(LIGHT_ZERO, "q"); + else if (lightzero_level == 17) + lightstyle(LIGHT_ZERO, "r"); + else if (lightzero_level == 18) + lightstyle(LIGHT_ZERO, "s"); + else //if (lightzero_level == 19) + lightstyle(LIGHT_ZERO, "t"); + } + else + { + if (lightzero_level == 20) + lightstyle(LIGHT_ZERO, "u"); + else if (lightzero_level == 21) + lightstyle(LIGHT_ZERO, "v"); + else if (lightzero_level == 22) + lightstyle(LIGHT_ZERO, "w"); + else if (lightzero_level == 23) + lightstyle(LIGHT_ZERO, "x"); + else if (lightzero_level == 24) + lightstyle(LIGHT_ZERO, "y"); + else //if (lightzero_level == 25) + lightstyle(LIGHT_ZERO, "z"); + } +}; + +void() LightZero_Go = +{ + if (!lightzero_finished) + return; + + if (lightzero_finished > time) + { + lightzero_level = lightzero_level + lightzero_rate; + if (lightzero_level < LIGHTZERO_MIN) + lightzero_level = LIGHTZERO_MIN; + else if (lightzero_level > LIGHTZERO_MAX) + lightzero_level = LIGHTZERO_MAX; + } + else + { // Restore normal lighting. + if (lightzero_level > LIGHTZERO_NORMAL) + { // Was brighter. + lightzero_level = lightzero_level - 4; + if (lightzero_level < LIGHTZERO_NORMAL) + lightzero_level = LIGHTZERO_NORMAL; + } + else if (lightzero_level < LIGHTZERO_NORMAL) + { // Was darker. + lightzero_level = lightzero_level + 2; + if (lightzero_level > LIGHTZERO_NORMAL) + lightzero_level = LIGHTZERO_NORMAL; + } + if (lightzero_level == LIGHTZERO_NORMAL) + lightzero_finished = 0; // End it! + } + + LightZero_Update (); +}; + +void(float lite, float add, float rate) LightZero_Set = +{ + lightzero_rate = rate; + if (lite == -1) + { + if (lightzero_finished) + lite = lightzero_level; + else + lite = LIGHTZERO_NORMAL; + } + add = time + add; + if (lightzero_finished < add) + lightzero_finished = add; + if (lightzero_level != lite) + { + lightzero_level = lite; + LightZero_Update (); + } +}; + +//========================================================================== +// "Storm" Lightning Strike (a.k.a. Airstrike) + +//------------------------------------------------------------------------// +// This creates a blank entity that will zap targets in the water +// within a radius for damage. +// +// Update: Added fields 'dflags' and 'dtype' for upgraded storms. +//------------------------------------------------------------------------// +void(entity attacker, vector spot, float damage, entity ignore, + float dflags, string dtype) Zapper_Spawn = +{ + local entity zap; + + zap = spawn(); + zap.movetype = MOVETYPE_NONE; + zap.velocity = '0 0 0'; + zap.touch = SUB_Null; + zap.solid = SOLID_NOT; + zap.owner = world; + setall (zap, "", '0 0 0', '0 0 0', spot); // invisible + + Rocket_Explosion2 (zap.origin, 244, 3); + T_RadiusDamage (zap, attacker, damage, ignore, DAMAGEALL); + + remove (zap); +}; + +//------------------------------------------------------------------------// +// This creates a lightning bolt that flashes down from the sky and +// strikes with explosive impact. +//------------------------------------------------------------------------// +void(entity attacker, vector spot, float damage, float dflags, string dtype) + Thunderstrike_Ex = +{ + local vector air, start, end; + local entity targ, ignore; + + air = '0 0 2048'; // Max limit of lightning draw length possible. + traceline (spot, spot + air, TRUE, world); + start = trace_endpos - '0 0 2'; + + // WARNING: Using 'world' as last traceline argument does not work. + // Trying to do so causes the trace to ignore all, even if the + // third argument is FALSE. + // + // Create dummy entity to serve as ignore for the traceline. + // That way, the lightning strike can hit even the attacker. + local entity zap; + + zap = spawn(); + zap.movetype = MOVETYPE_NONE; + zap.velocity = '0 0 0'; + zap.touch = SUB_Null; + zap.solid = SOLID_NOT; + zap.owner = world; + setall (zap, "", '0 0 0', '0 0 0', spot); // invisible + + // Execute trace. + //GhostTouch_On (); + traceline (start, spot - air, FALSE, zap); + targ = trace_ent; + //GhostTouch_Off (); + // Don't remove zap now, we need it later for thunder effects. + + // Proceed with traceline results. + if (targ.takedamage) + { + // Direct hit. + end = Midpoint (targ); + ignore = targ; + + // Trace up from target center to new point in the sky. + traceline (end, end + air, TRUE, world); + start = trace_endpos - '0 0 2'; + + // Damage the target. + // NOTE: Reflection won't save the target from the wrath of god. + local float points; + + points = SUB_RandomDamage (damage); + BoltDamage_Ex (targ, attacker, attacker, end, points, dflags, dtype); + } + else + { + end = trace_endpos; + ignore = world; + } + + // Create lightning and thunder effects. + setorigin (zap, end); + sound (zap, CHAN_AUTO, "hipweap/mjolhit.wav", 1, 0.5); // It's loud. + Tent_Beam (TE_LIGHTNING1, zap, end, start); // Draw big bolt upward. + remove (zap); // Dummy served its purpose, now begone. + + if (pointcontents(end) == CONTENT_SKY) + return; // Don't explode if it hits sky below. + + // Create explosion on impact. + Zapper_Spawn (attacker, end, damage, ignore, dflags, dtype); + ShockWave (end + '0 0 4', 8, 4, "progs/drake/s_wave.spr"); +}; + +void(entity attacker, vector spot, float damage) Thunderstrike = + {Thunderstrike_Ex (attacker, spot, damage, DF_NONE, "lightning");}; + +void() Ice_Touch = +{ + local float chunks, damage; + local vector spot; + + if (pointcontents(self.origin) <= CONTENT_LAVA) // Lava or sky. + {remove(self); return;} + //if (Reflected ()) + //return; + + self.touch = SUB_Null; // Stack overflow prevention. + chunks = TRUE; + damage = self.dmg; + if (other.takedamage) + { // Check cold resistance here instead of in the damage functions + // because it affects how much blood is spawned. + if (damage > 0) + { + spawn_touchblood (self, other, damage); + T_Damage (other, self, self.owner, damage, DAMARMOR); + chunks = FALSE; + } + } + if (chunks) + { // Ice chunks. + spawn_touchblood (self, other, 10); // Ice chunks. + sound (self, CHAN_WEAPON, "dragon/icehit.wav", 1, ATTN_NORM); + } + +// Become a mini-shockwave if close enough to the wall. +// In case of standard engines, just display a ring topside only. + spot = self.origin; + traceline (spot, spot + self.velocity, TRUE, world); // Ignore creatures. + if (trace_fraction >= 1.0) + {remove (self); return;} // Too far from a solid surface. + spot = trace_endpos + trace_plane_normal * 2; + self.angles = vectoangles(trace_plane_normal); + self.angles_y = anglemod(self.angles_y + 180); + setorigin (self, spot); + self.alpha = 0; + BecomeAnyExplosion (RING2_ICE, 3, "progs/s_wave2.spr"); +}; + +void() Ice_Think = +{ + Meteor_Trail (39, 2, FALSE); // Function in 'fire.qc'. + if (self.delay <= time) + {remove (self); return;} + if (pointcontents(self.origin) == CONTENT_LAVA) + {remove (self); return;} + + self.nextthink = time + 0.1; +}; + +void(vector start, vector dir, float sped) Ice_Launch = +{ + newmis = spawn (); + newmis.master = newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.classname = "ice"; +// set missile speed + newmis.speed = sped; + newmis.velocity = dir * sped; + newmis.angles = vectoangles(newmis.velocity); +// set missile damage + newmis.dmg = 9; +// newmis.enemy = targ; + newmis.style = DF_COLD | DF_SAFE; +// set missile special stuff +// newmis.lefty = 0; + newmis.dest = dir; + newmis.oldorigin = start; // For proper particle trail drawing. + newmis.alpha = ALPHA_ICE; +// set missile duration + newmis.touch = Ice_Touch; + newmis.delay = time + 5; // Total duration. As spikes. + newmis.nextthink = 0.01; + newmis.think = Ice_Think; + + setall (newmis, "progs/ice.mdl", '0 0 0', '0 0 0', start); + +// launch_spike (start, dir); +// setform (newmis, "progs/ice.mdl", VEC_ORIGIN, VEC_ORIGIN); +// newmis.style = TE_KNIGHTSPIKE; +// newmis.classname = "ice"; +// newmis.velocity = dir*sped; +}; + +//========================================================================== +// Iceballs -- Used by white wyrm. + +// Iceball explosion effects, called by T_MissileTouch. +void() Iceball_Explode = +{ + sound (self, CHAN_AUTO, "weapons/shatter.wav", 1, ATTN_NORM); + Tent_Explosion2 (self.origin, 32, 16); + ShockWave (self.origin, RING_ICE, 3, "progs/drake/s_wave.spr"); + BecomeIcyExp (); +}; + +// Thinking for iceballs. Unlike shards, balls explode instead of melting. +void() Iceball_Think = +{ +// Bigger ice chunks, so spawn a beam of frost. + Meteor_Trail (39, 2, TRUE); // Function in 'fire.qc'. + if (self.delay > time) + if (pointcontents(self.origin) != CONTENT_LAVA) + {self.nextthink = time + 0.1; return;} + +// Time to blow up. + T_MissileTouch (); +}; + +// Launch an explosive icy spikeball. +void(vector start, vector dir, float sped) Iceball_Launch = +{ + Ice_Launch (start, dir, sped); + + setmodel (newmis, "progs/drake/iceball.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + + newmis.avelocity = '300 300 300'; + newmis.dmg = 60; + newmis.alpha = ALPHA_ICEBALL; + newmis.touch = T_MissileTouch; + newmis.think = Iceball_Think; + newmis.think1 = Iceball_Explode; +}; + +void(vector start, vector dir, float sped, float damage) Iceball_Toss = +{ + Ice_Launch (start, dir, sped); + + setmodel (newmis, "progs/drake/iceball.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + + newmis.movetype = MOVETYPE_TOSS; + newmis.avelocity = '300 300 300'; + newmis.dmg = damage; + newmis.alpha = ALPHA_ICEBALL; + newmis.touch = T_MissileTouch; + newmis.think = Iceball_Think; + newmis.think1 = Iceball_Explode; +}; + +//========================================================================== +// Ice Mines + +// Treat destroyed mines as barrels. +void() IceMine_Die = +{ + if (self.trigger_field) + {remove (self.trigger_field); self.trigger_field = world;} + self.th_die= SUB_Null; // Don't 'die' again if damaged more. + self.touch = SUB_Null; // Stack overflow prevention. + self.solid = SOLID_NOT; + self.enemy = world; + self.nextthink = 0.01; + self.think = T_MissileExplode; +}; + +void(entity targ) IceMine_Explode = +{ + if (self.trigger_field) + {remove (self.trigger_field); self.trigger_field = world;} + self.touch = SUB_Null; // Stack overflow prevention. + self.enemy = targ; // For modified T_MissileExplode. + T_MissileExplode (); +}; + +void() IceMine_Touch = +{ +// Target must either be shootable or a creature. + if (other.takedamage != DAMAGE_AIM) + if (!(other.flags & FLx_CREATURE)) + return; +// Don't explode on attacker. + if (other == self.master) + return; + +// Removed sky and reflection checks because they do not apply to land mines. + IceMine_Explode (other); +}; + +void() mine1 =[ 1, mine2 ] {}; +void() mine2 =[ 2, mine3 ] { + local float pc; + + pc = pointcontents(self.origin); + if (pc == CONTENT_LAVA) + {IceMine_Explode (world); return;} + if (self.delay > time) + self.think = mine2; + + if (self.flags & FL_ONGROUND) + return; // Attached to the ground. + +// Float check. Ice is less dense than water. + if ((pc == CONTENT_WATER) || (pc == CONTENT_SLIME)) + { // Float to the surface; + self.movetype = MOVETYPE_FLY; +// self.flags = self.flags - (self.flags & FL_ONGROUND); + self.velocity_z = self.velocity_z + 48; + if (self.velocity_z > 48) + self.velocity_z = 48; + } + else + self.movetype = MOVETYPE_TOSS; +}; +void() mine3 =[ 3, SUB_Null ] {IceMine_Explode (world);}; + +// Made so monsters who step on the iceball will explode it. +void() IceMineTrigger_Touch = +{ + local entity ice, swap; + + ice = self.owner; + + if (!ice || (ice == self)) + {remove (self); return;} + + if (!(other.flags & FL_MONSTER)) + return; // Other things should be able touch the iceball itself. +// if (other == ice.owner) +// return; // Iceball owner is immune. + if (other == ice.master) + return; // Iceball owner is immune. + if (!(ice.flags & FL_ONGROUND) || (ice.velocity != '0 0 0')) + return; // Anything can touch iceball if it's moving. + +// Set off the mine! + if (other) + other.flags = other.flags - (other.flags & FL_ONGROUND); + self.touch = SUB_Null; + swap = self; + self = ice; + + self.trigger_field = world; + self.touch = SUB_Null; // Stack overflow prevention. + self.enemy = other; // For modified T_MissileExplode. + self.owner = other; // Pass through the mine. + T_MissileExplode (); + + self = swap; + remove (self); +}; + +void() IceMineTrigger_Think =[ 0, IceMineTrigger_Think ] +{ + if (self.owner) + setorigin (self, self.owner.origin); +}; + +void(vector start) IceMine_Spawn = +{ + local entity ice, swap; + +// Spawn the ice mine. + ice = spawn (); + ice.owner = world; + ice.master = self; + ice.movetype = MOVETYPE_TOSS; + ice.solid = SOLID_BBOX; + ice.classname = "ice"; +// set missile speed + ice.velocity = '0 0 0'; + ice.avelocity = '0 0 0'; + ice.angles = '0 0 0'; +// set missile damage + ice.dmg = 90; + ice.style = DF_COLD; +// set miscellaneous + ice.health = 25; // Barrels use 20 hp. + ice.takedamage = DAMAGE_YES; + ice.bloodtype = CHUNKS_ICE; + ice.hittype = HIT_STONE; + ice.th_die = IceMine_Die; + //ice.resist_cold = 1; // Immune to cold. + //ice.resist_fire = -1; // Fire melts ice! +// set missile duration + ice.touch = IceMine_Touch; + ice.think1 = Iceball_Explode; + ice.frame = 0; + ice.alpha = ALPHA_ICEBALL; + ice.think = mine1; + ice.nextthink = time + 0.1; + ice.delay = time + 30; + + setall (ice, "progs/drake/iceball.mdl", '-16 -16 0', '16 16 16', start); + +// Set the mine on the floor. +// if (pointcontents(start) == CONTENT_EMPTY) + { + swap = self; + self = ice; + droptofloor(); + self = swap; + } + +// Spawn touch field. +// With solid_bbox and movetype_toss, monsters can walk on the iceball +// without exploding it, which is unfair. Therefore, place a trigger +// field over the iceball so anytime a monster tries to walk on the ice, +// the iceball will explode as expected. + swap = spawn (); + swap.master = swap.owner = ice; + swap.movetype = MOVETYPE_NONE; + swap.solid = SOLID_TRIGGER; + swap.nextthink = time + 0.1; + swap.think = IceMineTrigger_Think; + swap.touch = IceMineTrigger_Touch; + setall (swap, "", '-16 -16 0', '16 16 32', start); + + ice.trigger_field = swap; // Link touch field to the iceball. + newmis = ice; // In case we need to modify the mine later. + +// Spawning effects. + sound (ice, CHAN_AUTO, "weapons/freeze.wav", 1, ATTN_NORM); + ShockWave (ice.origin + '0 0 4', RING_ICE, 3, "progs/drake/s_wave.spr"); +}; + +//========================================================================== +// Tornado -- Used by the wind baron. + +// Sucks in targets near the cone, and damages those already in it. +void() Tornado_Attack = +{ + local entity head; + local vector delta, spot, vel; + local float hit; + +// Note: Walls offer no protection against the baron's tornado. + head = findradius (self.origin, 256); + while (head) + { + if (head != self) + if (head != self.master) + if (head.origin_z + head.maxs_z >= self.origin_z) // Head must be above spawnpoint. + { + // Get horizontal distance between target and center. + spot = head.origin; spot_z = self.origin_z; + delta = self.origin - spot; // delta_z should be 0. + + // First, inflict some damage. + hit = (vlen(delta) < 100); + if (hit) + T_Damage (head, self, self.master, self.dmg, DAMARMOR); + + // Next, suck the target into the vortex if possible. + if ( ((head.flags & FLx_CREATURE) && (head.mass && (head.mass <= MASS_HEAVY))) + || (head.xfl & XFL_WIND) ) + { + if (hit || (head.flags & FL_MONSTER)) + { // Sweep the target off its feet. + if (!hit) + if (head.flags & FL_ONGROUND) + if (head.velocity_z < 80) + head.velocity_z = 80; + // Walkers lose control of movement. + head.flags = head.flags - (head.flags & FL_ONGROUND); + } + + vel = head.velocity; + vel_x = vel_x * 0.5; + vel_y = vel_y * 0.5; + if (hit) + { + vel_z = vel_z * 0.5; + if (vel_z < 150) + vel_z = 150; // Float up and away. + } + head.velocity = vel + normalize(delta) * 100; + } + } + + head = head.chain; + } +}; + +// Thinking for the smoke particles in the tornado. +void() tornado2 =[ 0, tornado2 ] +{ + if (self.delay <= time) + { + remove (self); + return; + } + + local vector spot, trig, dir; + + self.speed = self.speed + 8; + self.height = self.height + 24; + self.cnt = anglemod (self.cnt + 47); + spot = self.oldorigin; + spot_z = spot_z + self.height; + trig = CoSine (self.cnt); + dir = (('1 0 0' * self.speed) * trig_x) + (('0 1 0' * self.speed) * trig_y); + spot = spot + dir; + + setorigin (self, spot); +}; + +// Think function for the tornado. Spawns all of its effects. +void() tornado1 =[ 0, tornado1 ] +{ + if (self.delay <= time) + { + super_active = FALSE; +// StopSound (self, 6); + remove (self); + return; + } + +// FIXME: Use different sound that loops? + if (self.t_width < time) + { + self.t_width = time + 1; + sound (self, CHAN_AUTO, "baron/tornado.wav", 1, ATTN_NORM); + } + + Tornado_Attack (); + + self.height = (self.height + 3) & 7; + self.cnt = anglemod(self.cnt + 107); + + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_NOCLIP; + newmis.solid = SOLID_NOT; + newmis.velocity = '0 0 0'; + newmis.nextthink = 0.01; + newmis.delay = time + 1.2; // FIXME: Use T+1? + if (newmis.delay > self.delay) + newmis.delay = self.delay; // Last no longer than parent. + newmis.think = tornado2; + newmis.cnt = self.cnt + self.height; + newmis.oldorigin = self.origin; + setall (newmis, "progs/smoke.mdl", '0 0 0', '0 0 0', self.origin); +}; + +// Spawns an immobile tornado that sucks in and damages targets. +void(vector start) Tornado_Spawn = +{ + if (super_active) + return; // Uses many edicts and particles, only one at a time. + + traceline (start, start - '0 0 256', TRUE, self); + if (trace_fraction == 1) + return; // No ground. + + start = trace_endpos + '0 0 2'; + super_active = TRUE; // Only one big effect at a time please. + + local entity wind; + +// Spawn the tornado. + wind = spawn (); + wind.owner = world; + wind.master = self; + wind.movetype = MOVETYPE_NONE; // Immobile. No MOVETYPE_FLY. + wind.solid = SOLID_NOT; + wind.classname = "tornado"; +// set missile speed + wind.velocity = '0 0 0'; +// set missile damage + wind.dmg = 2; // 20/sec * 5 sec = 100. +// set miscellaneous + wind.takedamage = DAMAGE_NO; +// set missile duration + wind.touch = SUB_Null; + wind.frame = 0; + wind.think = tornado1; + wind.nextthink = time + 0.1; + wind.delay = time + 5; + wind.t_width = 0; + + setall (wind, "", '0 0 0', '0 0 0', start); + +// Spawning effects. + ShockWave (wind.origin + '0 0 4', RING_QUAKE, 4, "progs/drake/s_wave.spr"); +}; + +// Was named 'Knightball_Explode'. +void() Orange_Explosion = +{ + local float r; + + r = random() * 3; + if (r < 1) + Rocket_Explosion2 (self.origin, 224, 16); + else if (r < 2) + Rocket_Explosion2 (self.origin, 230, 8); + else + Rocket_Explosion2 (self.origin, 232, 8); + BecomeExplosion (); +}; + +//========================================================================== +// Teleglitter + +// NOTE: We should not emulate Heretic's algorithm for teleglitter spawners +// because that produces too many edicts, which can cause packet overflow +// in standard engines. Therefore, particles are sometimes spawned instead +// of sprites, and glitter sprites start with some velocity so they can +// collide with the ceiling sooner and disappear. + +void() glitter_think = +{ + if (self.frame >= self.waitmax) + { + if (self.cnt > 5) // 5 rewinds give 3 sec. life -- long enough. + {remove (self); return;} + self.cnt = self.cnt + 1; + self.frame = self.waitmin; + } + else + self.frame = self.frame + 1; + + if (self.height) + { // Accelerate. + self.speed = self.speed + self.height; + self.velocity = self.movedir * self.speed; + } + + self.nextthink = time + self.delay; +}; + +void() make_glitter = +{ +// Show some fireworks. + local vector spot, vel; + local float rgb; + + spot_x = self.absmin_x + (random() * self.size_x); + spot_y = self.absmin_y + (random() * self.size_y); + spot_z = self.absmin_z + (random() * self.size_z); + vel = self.movedir * self.speed; + rgb = self.count; //(serverflags & 15) * 16; + + if (self.lefty) + { + // Show particles only if the client can see the spawn point. + // We need this check because in software mode (WinQuake), + // a client can see particles through non-world wall entities + // if said client is a long distance away. + local float go; + + go = TRUE; + // Don't try this in netgames. + if (!deathmatch) { + local entity targ; + + targ = checkclient (); + if (targ) { + traceline (targ.origin + targ.view_ofs, spot, TRUE, targ); + if (trace_fraction < 1) + go = FALSE; + } else + go = FALSE; + } + if (go) { + if (rgb > 251) + rgb = 9; + else if (rgb > 246) + rgb = 225; + else if (rgb > 243) + rgb = 41; + else if (rgb > 239) + rgb = 193; + particle (spot, vel*0.1, rgb, 10); + } + } + else + { // Heretic-style teleglitter. + if (rgb > 251) + rgb = 90; + else if (rgb > 246) + rgb = 85; + else if (rgb > 243) + rgb = 80; + else + rgb = floor(rgb / 16) * 5; + + newmis = spawn(); + setmodel (newmis, "progs/drake/s_spark.spr"); + setorigin (newmis, spot); + newmis.movetype = MOVETYPE_FLY; + newmis.solid = SOLID_TRIGGER; + newmis.velocity = vel; + newmis.delay = 0.1; + newmis.nextthink = time + newmis.delay; + newmis.think = glitter_think; + newmis.touch = SUB_Remove; + newmis.classname = "glitter"; + newmis.frame = rgb; + newmis.cnt = 0; + // Note: If glitter start splashing, change size to '0 0 0'. + setsize (newmis, '-1 -1 -1', '1 1 1'); + newmis.movedir = self.movedir; + newmis.speed = self.speed; + newmis.waitmin = newmis.frame; + newmis.waitmax = newmis.frame + 4; + newmis.height = self.height; + } + self.lefty = !self.lefty; // Alternate between particles and sprites. + + self.nextthink = time + self.wait; + self.think = make_glitter; +}; + +//============ +// --> QUAKED misc_glitter (0 .5 .8) (-8 -8 -8) (8 8 8) +// Heretic-style teleglitter generator. Use on exit or teleport pads. +// Otherwise, similar idea to air_bubbles. +//============ +void() misc_glitter = { + if (self.classname == "misc_glitter") { + // Merely a glitter spawner. + if (deathmatch) + {remove (self); return;} + setsize (self, '-16 -16 -8', '16 16 48'); + } else { + // Teleporter destination with glitter spawnflag on. + if (deathmatch) + return; + // Destinations are set 27 units above placement, so subtract + // that much from new bbox mins/maxs_z to get proper bounds. + // Update: z - 26 should do. + setsize (self, '-16 -16 -34', '16 16 22'); + //self.angles = '0 0 0'; + } + precache_model ("progs/drake/s_spark.spr"); + + if (!self.wait) + self.wait = 0.1; + if (!self.count) // Palette color. + self.count = 244; // Default is bright electric blue. + if (!self.speed) + self.speed = 100; + if (!self.height) + self.height = 50; // Acceleration per frame for teleglitter. + +// Sparks should fly up by default. An angle of 0 is assumed to mean +// undefined, so to force east flight path, use a yaw of 360 instead. + if (self.angles != '0 0 0') + SetMovedir (); + else + self.movedir = '0 0 1'; + + self.nextthink = time + 1; + self.think = make_glitter; +}; + +//- - - - - - - - - +// Creates a glitter spawner. Called by spawn functions of other entities +// such as teleporter and changelevel triggers, and used by them to create +// glittering teleporter pads like in Heretic. +//- - - - - - - - - +void() Glitter_Spawner = +{ + if (deathmatch) + return; // Disabled, so don't waste time spawning an entity. + + local entity test; + local vector spot; + + spot = Anypoint (self, '0.5 0.5 0'); //Midpoint (self); + spot_z = spot_z + 8; + test = spawn(); + test.classname = "misc_glitter"; + test.count = self.count; // Glitter color + setorigin (test, spot); + SUB_Think (test, misc_glitter); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/fx_nehahra.qc b/QC_other/QC_keep/fx_nehahra.qc new file mode 100644 index 00000000..70badba9 --- /dev/null +++ b/QC_other/QC_keep/fx_nehahra.qc @@ -0,0 +1,159 @@ +void emit_particles(); +void trigger_particles(); +void particles_reset(); + +void info_particles() = { + if (self.speed <= 0) { + self.speed = 1; + } + if (self.delay <= 0) { + self.delay = 0.1; + } + if (self.targetname) { + if (self.spawnflags & 64) { + self.use = particles_reset; + self.think = emit_particles; + self.nextthink = time + self.wait; + return; + } + self.use = trigger_particles; + return; + } + trigger_particles(); +}; + +void trigger_particles() = { + self.count = 0; + self.use = particles_reset; + self.think = emit_particles; + self.nextthink = time + self.delay; +}; + +void particles_reset() = { + self.use = trigger_particles; + self.think = SUB_Null; + self.nextthink = time + LARGE_TIMER; +}; + +void emit_particles() = { + local vector spot1; + + if (self.endtime > 0) { + self.count = self.count + self.delay; + if (self.count > self.endtime) { + particles_reset(); + return; + } + } + if (self.method < 1) { + particle(self.origin, self.movedir, self.cnt, self.duration); + } + else { + makevectors(self.aether); + self.aether_y = self.aether_y + self.speed; + if (self.aether_y > 360) { + self.aether_y = self.aether_y - 360; + } + if (self.aether_y < 0) { + self.aether_y = self.aether_y + 360; + } + spot1 = self.origin + v_forward * self.impulse; + particle(spot1, self.movedir, self.cnt, self.duration); + if (self.method == 2) { + spot1 = self.origin + v_forward * (0 - self.impulse); + particle(spot1, self.movedir, self.cnt, self.duration); + } + } + self.think = emit_particles; + self.nextthink = time + self.delay; +}; + +void trigger_smoke(); +void spawn_smokethang(); +void stop_smoke(); + +// Launches invisible touchless grenades that have grenade particle trails +void misc_smokemaker() = { + precache_model("progs/null.mdl"); + if (!(self.speed)) { + self.speed = 2000; + } + if (self.cnt == 0) { + self.cnt = 0.2; + } + if (self.wait == 0) { + self.wait = 0.5; + } + if (self.targetname) { + self.use = trigger_smoke; + return; + } + self.nextthink = time + random(); + self.think = spawn_smokethang; +}; + +void trigger_smoke() = { + self.use = stop_smoke; + self.nextthink = time + random(); + self.think = spawn_smokethang; +}; + +void stop_smoke() = { + self.nextthink = time + 99999; + self.think = SUB_Null; + self.use = trigger_smoke; +}; + +void spawn_smokethang() = { + local entity head; + + head = spawn(); + head.alpha = -1; + head.solid = SOLID_TRIGGER; + head.movetype = MOVETYPE_NOCLIP; + head.velocity = '0 0 1000'; + head.velocity_z = self.speed + random() * 200; + setmodel(head, "progs/null.mdl"); + setsize(head, VEC_ORIGIN, VEC_ORIGIN); + setorigin(head, self.origin); + head.effects = head.effects & EF_NODRAW; + head.nextthink = time + self.wait; + head.think = SUB_Remove; + if (self.cnt == -1) { + self.nextthink = time + random(); + } else { + self.nextthink = time + self.cnt; + } + self.think = spawn_smokethang; +}; + +void big_bang() = { + local vector newo; + local float x, y, z; + if (self.wait == 1) { + sound(self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NONE); + } + x = random() * FL_NOTARGET - FL_GODMODE; + y = random() * FL_NOTARGET - FL_GODMODE; + z = random() * FL_NOTARGET - FL_GODMODE; + newo_x = self.origin_x + x; + newo_y = self.origin_y + y; + newo_z = self.origin_z + z; + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteCoord(MSG_BROADCAST, newo_x); + WriteCoord(MSG_BROADCAST, newo_y); + WriteCoord(MSG_BROADCAST, newo_z); + self.wait = self.wait - 1; + if (self.wait < 0) { + entity_hide(self); + } + self.nextthink = time + 0.2 * random() + 0.1; + self.think = big_bang; +}; + +void misc_boom() = { + precache_sound2("boss2/pop2.wav"); + self.use = big_bang; + self.wait = 1; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/globalfog.qc b/QC_other/QC_keep/globalfog.qc new file mode 100644 index 00000000..4e0a3251 --- /dev/null +++ b/QC_other/QC_keep/globalfog.qc @@ -0,0 +1,336 @@ +/*====================================================================== +/*QUAKED info_stuffcmd (0 0.5 0) (-8 -8 -8) (8 8 8) +puts the specified message into the console when the client spawns. +Original idea from Honey codebase +-------- KEYS -------- +message : Stuff command (r_wateralpha 0.3) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +puts the specified message into the console when the client spawns. +======================================================================*/ +void() stuffcmd_think = +{ + // wait key used for commands that are development mode only + if (!self.wait || (self.wait && developer)) { + if (client_ent && client_ent.flags & FL_CLIENT) { + stuffcmd(client_ent, self.message); + stuffcmd(client_ent, "\n"); + } + // No client in game, check again later + else self.nextthink = time + 0.2; + } +} + +void() info_stuffcmd = +{ + // No message key, remove dead entity + if(!self.message) { + dprint("[info_stuffcmd] no message found, removing\n"); + SUB_Remove(); + } + if(!self.wait) self.wait = 0; + + // Wait for client to start game + self.nextthink = time + 2; + self.think = stuffcmd_think; +} + +//---------------------------------------------------------------------- +// Returns power of 10 for string format function below +//---------------------------------------------------------------------- +float(float pow_loop) pow10 = +{ + local float pow_num, pow_counter; + pow_num = 10; + pow_counter = 1; + if (pow_loop < 1) pow_loop = 1; + + while (pow_counter < pow_loop) { + pow_num = pow_num * 10; + pow_counter = pow_counter + 1; + } + return pow_num; +}; + +//---------------------------------------------------------------------- +// (Long Float TO String) Format and print a number to the console +// - str_player : needs to be a client for various buffer commands +// - buffer : BUFFER_STUFFCMD, BUFFER_SPRINT, BUFFER_DPRINT +void(entity str_player, float str_num, float topbit, float botbit, float buffer) lftos = +{ + local float str_counter, str_pow, str_result, str_remain, str_first; + + str_counter = topbit; // Upper number length + str_pow = pow10(topbit); // Setup initial base 10 power for checking + str_remain = FALSE; // Decimal point been done yet + str_first = FALSE; // First non-zero digit printed + + // Deal with negative state first + if (str_num < 0) { + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, "-"); + else if (buffer & BUFFER_SPRINT) sprint(str_player, "-"); + else if (buffer & BUFFER_DPRINT) dprint("-"); + } + // Get rid of negative state + str_num = fabs(str_num); + + // If number larger than fixed length? - truncate number + if (str_num > str_pow) + str_num = str_num - (floor(str_num / str_pow) * str_pow); + + // Loop through upper part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + str_result = floor(str_num / str_pow); + + if (str_result > 0 || str_first) { + str_first = TRUE; + // Print digit to buffer type + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, ftos(str_result)); + else if (buffer & BUFFER_SPRINT) sprint(str_player, ftos(str_result)); + else if (buffer & BUFFER_DPRINT) dprint(ftos(str_result)); + } + + // remove top part of number, decrease str length counter + str_num = str_num - (str_result * str_pow); + str_counter = str_counter - 1; + } + + // Is there any remainder? + if (str_counter < 1) { + // Print decimal point to buffer type + if (!str_first) { + str_first = TRUE; + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, "0."); + else if (buffer & BUFFER_SPRINT) sprint(str_player, "0."); + else if (buffer & BUFFER_DPRINT) dprint("0."); + } + else { + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, "."); + else if (buffer & BUFFER_SPRINT) sprint(str_player, "."); + else if (buffer & BUFFER_DPRINT) dprint("."); + } + if (botbit <1) botbit=1; + str_counter = botbit; + while (botbit > 0) { + str_num = str_num * 10; + botbit = botbit -1; + } + str_pow = pow10(str_counter); + } + + // Loop through lower part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + str_result = floor(str_num / str_pow); + + if (str_result > 0 || str_first) { + str_first = TRUE; + // Print digit to buffer type + if (buffer & BUFFER_STUFFCMD) stuffcmd(str_player, ftos(str_result)); + else if (buffer & BUFFER_SPRINT) sprint(str_player, ftos(str_result)); + else if (buffer & BUFFER_DPRINT) dprint(ftos(str_result)); + } + + // remove top part of number, decrease str length counter + str_num = str_num - (str_result * str_pow); + str_counter = str_counter - 1; + } +}; + +/*====================================================================== + GLOBAL FOG + Changes fog colour and density to a certain value +======================================================================*/ +void(entity client) change_fog = +{ + if (!fog_control) return; + + // Update fog parameters to console buffer + stuffcmd(client, "\nfog "); + if (ext_dpfog) lftos(client, fog_control.fog_currden+0.05, 1,3, BUFFER_STUFFCMD); + else lftos(client, fog_control.fog_currden, 1,3, BUFFER_STUFFCMD); + + stuffcmd(client, " "); + lftos(client, fog_control.fog_currcol_x, 1,3, BUFFER_STUFFCMD); stuffcmd(client, " "); + lftos(client, fog_control.fog_currcol_y, 1,3, BUFFER_STUFFCMD); stuffcmd(client, " "); + lftos(client, fog_control.fog_currcol_z, 1,3, BUFFER_STUFFCMD); + // Extra fog parameters for DarkPlaces extended engines + if (ext_dpfog) { + stuffcmd(client, " "); + stuffcmd(client, fog_control.fog_dpextra); + } + stuffcmd(client, "\n"); +}; + +//---------------------------------------------------------------------- +// Make value is not below or above limits and or negative! +//---------------------------------------------------------------------- +float(float fogrange) fog_check_range = +{ + if (fogrange < 0.01) return 0.01; + if (fogrange > 1) return 1; + return fabs(fogrange); +}; + +//---------------------------------------------------------------------- +void() fog_controller_think = +{ + // Has there been a change detected? + if (self.state == STATE_SETUP) { + // If fog fade time too low, instantly switch + if (self.fog_difftime <= FADEFOG_TIME) { + self.state = STATE_OFF; + self.fog_currden = self.fog_targden; + self.fog_currcol = self.fog_targcol; + change_fog(self.owner); + } + else { + // Setup gradual fade of fog over time + self.state = STATE_ON; + // divide the fade time into segments (minimum 0.05) + // Multiple the time by segments so diff is correct + // Time segements less than 0.05 does not work v well + self.fog_steptime = self.fog_difftime / FADEFOG_TIME; + self.fog_difftime = self.fog_steptime * FADEFOG_TIME; + + // Work out fade directions for density/colour + self.fog_diffden = self.fog_targden - self.fog_currden; + self.fog_diffcol = self.fog_targcol - self.fog_currcol; + + // Debug info only + /*---------------------------------------------------------------------- + dprint("Curr ("); + lftos(self.owner, self.fog_currden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self.owner, self.fog_currcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_currcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_currcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + dprint("Targ ("); + lftos(self.owner, self.fog_targden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self.owner, self.fog_targcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_targcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_targcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + dprint("Diff ("); + lftos(self.owner, self.fog_diffden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self.owner, self.fog_diffcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_diffcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self.owner, self.fog_diffcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + //----------------------------------------------------------------------*/ + + // Work out step ammount to fade smoothly over time + self.fog_diffden = self.fog_diffden / self.fog_steptime; + self.fog_diffcol_x = self.fog_diffcol_x / self.fog_steptime; + self.fog_diffcol_y = self.fog_diffcol_y / self.fog_steptime; + self.fog_diffcol_z = self.fog_diffcol_z / self.fog_steptime; + } + } + // Is the fog fade over? Finite amount of steps + else if (self.fog_steptime < 0 && self.state != STATE_OFF) { + self.state = STATE_OFF; + self.fog_currden = self.fog_targden; + self.fog_currcol = self.fog_targcol; + + // Check density and colour values are within range + self.fog_currden = fog_check_range(self.fog_currden); + self.fog_currcol_x = fog_check_range(self.fog_currcol_x); + self.fog_currcol_y = fog_check_range(self.fog_currcol_y); + self.fog_currcol_z = fog_check_range(self.fog_currcol_z); + + change_fog(self.owner); + } + // If the fade is active, keep adding steps + else if (self.state == STATE_ON) { + self.fog_steptime = self.fog_steptime - 1; + self.fog_currden = self.fog_currden + self.fog_diffden; + self.fog_currcol = self.fog_currcol + self.fog_diffcol; + change_fog(self.owner); + } + + // Keep on looping around using min time step + self.think = fog_controller_think; + self.nextthink = time + FADEFOG_TIME; +}; + +//---------------------------------------------------------------------- +void(float gf_den, vector gf_col, float gf_time) fade_fog = +{ + // No controller active? + if (!fog_control) return; + + // Check density and colour values are within range + gf_den = fog_check_range(gf_den); + gf_col_x = fog_check_range(gf_col_x); + gf_col_y = fog_check_range(gf_col_y); + gf_col_z = fog_check_range(gf_col_z); + + // Setup fog controller with new fog values + fog_control.fog_targden = gf_den; + fog_control.fog_targcol = gf_col; + fog_control.fog_difftime = gf_time; + + // Force fog controller to calculate difference + fog_control.state = STATE_SETUP; +}; + +//---------------------------------------------------------------------- +void() setup_fog_controller = +{ + if (!fog_control) { + // Start off with the fog controller disabled + // if the worldspawn setup correctly then enable + // the controller and allow fog changes + fog_active = FALSE; + + fog_control = spawn(); + fog_control.owner = self; // Link back to client + fog_control.classtype = CT_CONTROL; + fog_control.solid = SOLID_NOT; // No world interaction + fog_control.movetype = MOVETYPE_NONE; // Static item, no movement + setorigin(fog_control, '0 0 0'); + setsize(fog_control, VEC_ORIGIN, VEC_ORIGIN); + + if (world.fog_density != 0) { + fog_active = TRUE; // engine and QC insync + fog_control.fog_currden = world.fog_density; + } + else fog_control.fog_currden = 0.1; // Bad default + fog_control.fog_targden = 0; // Target + fog_control.fog_diffden = 0; // Difference + + if (CheckZeroVector(world.fog_colour)) + fog_control.fog_currcol = '0.1 0.1 0.1'; // Bad Default + else { + fog_active = TRUE; // engine and QC insync + fog_control.fog_currcol = world.fog_colour; + } + fog_control.fog_targcol = '0 0 0'; // Target + fog_control.fog_diffcol = '0 0 0'; // Difference + + // Bat shit crazy DP extra fog parameters that no other engine uses + // dpextra = alpha mindist maxdist top fadedepth (def=1 0 8192 1024 32) + if (world.fog_dpextra != "") fog_control.fog_dpextra = world.fog_dpextra; + else fog_control.fog_dpextra = DEF_FOGEXT; + + // This is a horrible hack, it should not be here + // This parameter should be in the map file worldspawn + //if (world.model == "maps/ad_end.bsp") + // fog_control.fog_dpextra = "1 0 2048 8192 32"; + + fog_control.state = STATE_OFF; // Not fading atm + fog_control.fog_difftime = 0; // fading fog time (seconds) + fog_control.fog_steptime = 0; // How many steps to fade + + // Setup think process to monitor for fog changes + // If this entity already exists, then its thinking! + fog_control.think = fog_controller_think; + fog_control.nextthink = time + FADEFOG_TIME; + + if (fog_active) change_fog(self); + } +}; diff --git a/QC_other/QC_keep/hip_brk.qc b/QC_other/QC_keep/hip_brk.qc new file mode 100644 index 00000000..360b617d --- /dev/null +++ b/QC_other/QC_keep/hip_brk.qc @@ -0,0 +1,45 @@ +float MULTI_USE = 1.000; +float INVISIBLE = 2.000; + +void () damagethreshold_killed = { + self.health = self.max_health; + activator = damage_attacker; + self.takedamage = DAMAGE_NO; + SUB_UseTargets (); + self.takedamage = DAMAGE_YES; + if ( !(self.spawnflags & MULTI_USE) ) remove (self); +}; + +void (entity inflictor, entity attacker, float damage) damagethreshold_pain = { + self.health = self.max_health; +}; + +void () trigger_damagethreshold = { + self.mangle = self.angles; + self.angles = VEC_ORIGIN; + self.classname = "damagethreshold"; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self,self.origin); + setmodel (self,self.model); + setsize (self,self.mins,self.maxs); + if ( (self.spawnflags & INVISIBLE) ) self.model = string_null; + if ( !self.health ) self.health = 60.000; + self.max_health = self.health; + self.takedamage = DAMAGE_YES; + self.blocked = SUB_Null; + self.th_pain = damagethreshold_pain; + self.th_die = damagethreshold_killed; +}; + +void () func_breakawaywall = { + self.mangle = self.angles; + self.angles = VEC_ORIGIN; + self.classname = "breakaway"; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self,self.origin); + setmodel (self,self.model); + setsize (self,self.mins,self.maxs); + self.use = SUB_Remove; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/hip_expl.qc b/QC_other/QC_keep/hip_expl.qc new file mode 100644 index 00000000..cf4db05b --- /dev/null +++ b/QC_other/QC_keep/hip_expl.qc @@ -0,0 +1,135 @@ +float USE_PARTICLES = 1.000; + +void () exploder_fire = { + local entity temp; + + temp = self; + activator = other; + SUB_UseTargets (); + self = temp; + other = self; + if ( (self.dmg < 120) ) { + sound (self,CHAN_AUTO,"drake/misc/shortexp.wav",self.volume,self.speed); + } else { + sound (self,CHAN_AUTO,"drake/misc/longexpl.wav",self.volume,self.speed); + } + T_RadiusDamage (self,self.owner,self.dmg,other,DAMAGEALL); + if ( (self.spawnflags & USE_PARTICLES) ) { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + } + BecomeExplosion (); +}; + +void () exploder_use = { + if ( self.delay ) { + self.nextthink = (time + self.delay); + self.delay = FALSE; + self.think = exploder_fire; + } else { + exploder_fire (); + } +}; + +void () func_exploder = { + precache_sound ("drake/misc/shortexp.wav"); + precache_sound ("drake/misc/longexpl.wav"); + self.classname = "exploder"; + self.use = exploder_use; + if ( (self.dmg == FALSE) ) self.dmg = 120; + if ( (self.dmg < FALSE) ) self.dmg = FALSE; + if ( (self.speed == FALSE) ) self.speed = TRUE; + if ( (self.volume == FALSE) ) self.volume = TRUE; +}; + +void () multi_exploder_fire = { + local entity temp; + local entity expl; + + self.nextthink = (time + self.wait); + if ( (self.state == FALSE) ) { + self.state = TRUE; + self.duration = (time + self.duration); + temp = self; + activator = other; + SUB_UseTargets (); + self = temp; + other = self; + } + if ( (time > self.duration) ) { + remove (self); + return ; + } + expl = spawn (); + expl.owner = self.owner; + expl.dmg = self.dmg; + random (); + expl.origin_x = (self.absmin_x + (random () * (self.absmax_x - self.absmin_x))); + random (); + expl.origin_y = (self.absmin_y + (random () * (self.absmax_y - self.absmin_y))); + random (); + expl.origin_z = (self.absmin_z + (random () * (self.absmax_z - self.absmin_z))); + sound (expl,CHAN_VOICE,"drake/misc/shortexp.wav",self.volume,self.speed); + T_RadiusDamage (expl,self.owner,self.dmg,other,DAMAGEALL); + if ( (self.spawnflags & USE_PARTICLES) ) { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,expl.origin_x); + WriteCoord (MSG_BROADCAST,expl.origin_y); + WriteCoord (MSG_BROADCAST,expl.origin_z); + } + temp = self; + self = expl; + BecomeExplosion (); + self = temp; +}; + +void (vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion = { + local entity temp; + + temp = self; + self = spawn (); + self.origin = loc; + self.dmg = damage; + self.duration = dur; + self.wait = pause; + self.owner = world; + self.absmin = (self.origin - (rad * '1.000 1.000 1.000')); + self.absmax = (self.origin + (rad * '1.000 1.000 1.000')); + self.think = multi_exploder_fire; + self.volume = vol; + multi_exploder_fire (); + self = temp; +}; + +void () multi_exploder_use = { + if ( self.delay ) { + self.nextthink = (time + self.delay); + self.delay = FALSE; + self.think = multi_exploder_fire; + } else { + self.think = multi_exploder_fire; + multi_exploder_fire (); + } +}; + +void () func_multi_exploder = { + precache_sound ("drake/misc/shortexp.wav"); + precache_sound ("drake/misc/longexpl.wav"); + self.classname = "exploder"; + self.use = multi_exploder_use; + setmodel (self,self.model); + self.movetype = MOVETYPE_NONE; + self.modelindex = FALSE; + self.model = ""; + if ( (self.dmg == FALSE) ) self.dmg = 120; + if ( (self.dmg < FALSE) ) self.dmg = FALSE; + if ( (self.duration == FALSE) ) self.duration = TRUE; + if ( (self.speed == FALSE) ) self.speed = TRUE; + if ( (self.volume == FALSE) ) self.volume = 0.500; + if ( (self.wait == FALSE) ) self.wait = 0.250; + self.state = FALSE; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/hip_part.qc b/QC_other/QC_keep/hip_part.qc new file mode 100644 index 00000000..09f7e567 --- /dev/null +++ b/QC_other/QC_keep/hip_part.qc @@ -0,0 +1,158 @@ +float USE_COUNT = 1.000; +float START_OFF = 1.000; + +void () particlefield_XZ = { + local vector pos; + local vector start; + local vector end; + + if ( ((self.spawnflags & USE_COUNT) && (counter_GetCount (other) != self.cnt)) ) return ; + self.ltime = (time + 0.250); + if ( self.noise ) sound (self,CHAN_VOICE,self.noise,TRUE,ATTN_NORM); + if ( !checkclient () ) return ; + start = (self.dest1 + self.origin); + end = (self.dest2 + self.origin); + pos_y = start_y; + pos_z = start_z; + while ( (pos_z <= end_z) ) { + pos_x = start_x; + while ( (pos_x <= end_x) ) { + particle (pos,'0 0 0',self.col,self.count); + pos_x = (pos_x + FL_INWATER); + } + pos_z = (pos_z + FL_INWATER); + } +}; + +void () particlefield_YZ = { + local vector pos; + local vector start; + local vector end; + + if ( ((self.spawnflags & USE_COUNT) && (counter_GetCount (other) != self.cnt)) ) return; + self.ltime = (time + 0.250); + if ( self.noise ) sound (self,CHAN_VOICE,self.noise,TRUE,ATTN_NORM); + if ( !checkclient () ) return; + start = (self.dest1 + self.origin); + end = (self.dest2 + self.origin); + pos_x = start_x; + pos_z = start_z; + while ( (pos_z < end_z) ) { + pos_y = start_y; + while ( (pos_y < end_y) ) { + particle (pos,VEC_ORIGIN,self.col,self.count); + pos_y = (pos_y + FL_INWATER); + } + pos_z = (pos_z + FL_INWATER); + } +}; + +void () particlefield_XY = { + local vector pos; + local vector start; + local vector end; + + if ( ((self.spawnflags & USE_COUNT) && (counter_GetCount (other) != self.cnt)) ) return ; + self.ltime = (time + 0.250); + if ( self.noise ) sound (self,CHAN_VOICE,self.noise,TRUE,ATTN_NORM); + if ( !checkclient () ) return ; + start = (self.dest1 + self.origin); + end = (self.dest2 + self.origin); + pos_x = start_x; + pos_z = start_z; + while ( (pos_x < end_x) ) { + pos_y = start_y; + while ( (pos_y < end_y) ) { + particle (pos,VEC_ORIGIN,self.col,self.count); + pos_y = (pos_y + FL_INWATER); + } + pos_x = (pos_x + FL_INWATER); + } +}; + +void () particlefield_touch = { + if ( !self.dmg ) return; + if ( (time > self.ltime) ) return; + if ( (time < self.attack_finished) ) return; + self.attack_finished = (time + 0.500); + T_Damage (other,self,self,self.dmg,DAMARMOR); +}; + +void () func_particlefield = { + if ( !self.col ) self.col = 192.000; + if ( (self.count == FALSE) ) self.count = FL_SWIM; + self.classname = "particlefield"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setmodel (self,self.model); + self.model = string_null; + self.origin = ((self.mins + self.maxs) * 0.500); + setorigin (self,self.origin); + self.dest = ((self.maxs - self.mins) - '16.000 16.000 16.000'); + self.dest1 = ((self.mins + '8.000 8.000 8.000') - self.origin); + self.dest2 = ((self.maxs + '7.900 7.900 7.900') - self.origin); + setsize (self,self.mins,self.maxs); + self.touch = particlefield_touch; + if ( (self.dest_x > self.dest_z) ) { + if ( (self.dest_y > self.dest_z) ) { + self.use = particlefield_XY; + self.dest1_z = ((self.dest1_z + self.dest2_z) / FL_SWIM); + } else { + self.use = particlefield_XZ; + self.dest1_y = ((self.dest1_y + self.dest2_y) / FL_SWIM); + } + } else { + if ( (self.dest_y > self.dest_x) ) { + self.use = particlefield_YZ; + self.dest1_x = ((self.dest1_x + self.dest2_x) / FL_SWIM); + } else { + self.use = particlefield_XZ; + self.dest1_y = ((self.dest1_y + self.dest2_y) / FL_SWIM); + } + } + if ( self.noise ) precache_sound (self.noise); + self.ltime = time; +}; + +void () blocker_touch = { + if ( !self.dmg ) return ; + if ( (time < self.attack_finished) ) return ; + self.attack_finished = (time + 0.500); + T_Damage (other,self,self,self.dmg,DAMARMOR); +}; + +void () blocker_use = { + if ( !self.state ) { + self.state = TRUE; + setorigin (self,(self.origin - '8000.000 8000.000 8000.000')); + sound (self,CHAN_VOICE,self.noise1,TRUE,ATTN_NORM); + } else { + self.state = FALSE; + setorigin (self,(self.origin + '8000.000 8000.000 8000.000')); + sound (self,CHAN_VOICE,self.noise,TRUE,ATTN_NORM); + } +}; + +void () func_togglewall = { + self.classname = "togglewall"; + self.movetype = MOVETYPE_PUSH; + self.mdl = self.model; + setmodel (self,self.model); + setsize (self,self.mins,self.maxs); + setorigin (self,self.origin); + self.touch = blocker_touch; + self.use = blocker_use; + if ( !self.noise ) self.noise = "misc/null.wav"; + if ( !self.noise1 ) self.noise1 = "misc/null.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + self.solid = SOLID_BSP; + self.model = string_null; + if ( (self.spawnflags & START_OFF) ) { + self.state = FALSE; + setorigin (self,(self.origin + '8000.000 8000.000 8000.000')); + } else { + self.state = TRUE; + sound (self,CHAN_VOICE,self.noise1,TRUE,ATTN_NORM); + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/hipclock.qc b/QC_other/QC_keep/hipclock.qc new file mode 100644 index 00000000..5f4952ba --- /dev/null +++ b/QC_other/QC_keep/hipclock.qc @@ -0,0 +1,53 @@ +void () clock_setpos = { + local float pos; + local float ang; + local float seconds; + local string temp; + + seconds = (time + self.cnt); + pos = (seconds / self.count); + pos = (pos - floor (pos)); + ang = (360.000 * pos); + if ( self.event ) { + if ( (self.ltime > ang) ) { + temp = self.target; + self.target = self.event; + SUB_UseTargets (); + self.target = temp; + } + } + self.angles_x = (ang * self.movedir_x); + self.angles_y = (ang * self.movedir_y); + self.angles_z = (ang * self.movedir_z); + RotateTargetsFinal (); + self.ltime = ang; +}; + +void () clock_think = { + clock_setpos (); + self.nextthink = (time + TRUE); +}; + +void () clock_firstthink = { + LinkRotateTargets (); + self.think = clock_think; + clock_think (); +}; + +void () func_clock = { + local vector temp; + + self.classname = "clock"; + self.think = clock_firstthink; + self.nextthink = (time + 0.100); + self.ltime = time; + SetMovedir (); + temp = self.movedir; + self.movedir_x = (FALSE - temp_y); + self.movedir_y = (FALSE - temp_z); + self.movedir_z = (FALSE - temp_x); + if ( !self.count ) { + self.count = 60.000; + } + self.cnt = (self.cnt * (self.count / 12)); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/hiphorn.qc b/QC_other/QC_keep/hiphorn.qc new file mode 100644 index 00000000..44335c91 --- /dev/null +++ b/QC_other/QC_keep/hiphorn.qc @@ -0,0 +1,67 @@ +void () UpdateCharmerGoal = { + + local entity targ; + local vector d; + + d = normalize ((self.origin - self.charmer.origin)); + if ( (self.huntingcharmer == TRUE) ) { + + targ = spawn (); + self.trigger_field = targ; + setorigin (targ,self.charmer.origin); + self.huntingcharmer = FL_SWIM; + self.goalentity = targ; + + } + if ( (self.huntingcharmer == FL_SWIM) ) { + + targ = self.trigger_field; + traceline (self.origin,self.charmer.origin,TRUE,self); + if ( (trace_fraction == TRUE) ) { + + setorigin (targ,self.charmer.origin); + + } + + } else { + + targ = self.trigger_field; + setorigin (targ,(self.charmer.origin + (d * 300.000))); + + } + +}; + +void () HuntCharmer = { + + self.huntingcharmer = TRUE; + UpdateCharmerGoal (); + self.think = self.th_walk; + self.ideal_yaw = vectoyaw ((self.goalentity.origin - self.origin)); + self.nextthink = (time + 0.100); + +}; + +void () FleeCharmer = { + + self.huntingcharmer = TRUE; + UpdateCharmerGoal (); + self.huntingcharmer = MOVETYPE_WALK; + self.think = self.th_walk; + self.nextthink = (time + 0.100); + +}; + +void () StopHuntingCharmer = { + + self.goalentity = world; + if ( (self.huntingcharmer > TRUE) ) { + + remove (self.trigger_field); + + } + self.huntingcharmer = FALSE; + self.think = self.th_stand; + self.nextthink = (time + 0.100); + +}; \ No newline at end of file diff --git a/QC_other/QC_keep/hiprot.qc b/QC_other/QC_keep/hiprot.qc new file mode 100644 index 00000000..c7579804 --- /dev/null +++ b/QC_other/QC_keep/hiprot.qc @@ -0,0 +1,1100 @@ +/*====================================================================== + Rotate QuickC program by Jim Dose' 10/17/96 + Copyright (c)1996 Hipnotic Interactive, Inc. + + * All the functions and defs are self contained in this file + * Should make it easier to distribute as no other qc file required + * Collapsed and condensed this QC file as much as possible + * Renamed all the constants so they don't conflict + * It was a cool idea for its time (1996) but a horrible solution nowadays + It would be much better to do this in the engine (rotation collision) + Unfortunately most popular quake clients (QS/Fitz) refuse to add it + * Added target2 to func_rotate_door to allow alternative start positions + +------------------------------------------------------------------------ +/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) +Used as the point of rotation for rotatable objects. + +/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE START_ON +Creates an entity that continually rotates. Can be toggled on and +off if targeted. + +/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE + Path for rotate_train. + +/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) x +Trains are moving platforms that players can ride. +If the train is the target of a button or trigger, it will not begin +moving until activated. +The func_rotate_train entity is the center of rotation of all objects +targeted by it. + +/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING +Used to emulate collision on rotating objects. + +/*QUAKED rotate_object (0 .5 .8) ? +This defines an object to be rotated. +Used as the target of func_rotate_door. + +/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN +Creates a door that rotates between two positions around a point of +rotation each time it's triggered. + +------------------------------------------------------------------------ +Most modern compilers will expect the rotate_object to always +target a info_rotate (entity) so that it can sort out texture offset +All func_rotating objects DO NOT start at 0,0,0 like other bmodels + +------------------------------------------------------------------------ +Explaination of func_rotating objects (by Mechtech) + +func_rotating_train (controller for rotation) +targetname -> trigger to start/activate train +target -> rotate_object (bmodel) AND rotate_movewall (bmodel) +path-> path_rotate (entity chain) + +rotate_object (train brushwork) +target -> info_rotate (entity, center point for rotation) + +rotate_movewall (pretends to do collision) + +path_rotate (entity chain for train to follow) +targetname -> Used for reference +target -> next entity in chain to follow + +------------------------------------------------------------------------ +Func rotating doors cannot be moved on start so extra key added + +func_rotate_door (controller for rotation) +targetname -> trigger to start/activate two state door +target -> rotate_object (bmodel) AND rotate_movewall (bmodel) +target2 -> info_rotate (entity) starting location for bmodel + +======================================================================*/ + +// from hipdefs.qc in hipnotic/ritual source qc files +.vector neworigin; +.vector rotate; +.float endtime; +.float rotate_type; +.string path; +.string group; +.string event; +.float duration; +.vector dest; // Could not find this in the source, added + +//---------------------------------------------------------------------- +// from hipsubs.qc in hipnotic/ritual source qc files +vector ( vector ang ) SUB_NormalizeAngles = +{ + while( ang_x > 360 ) ang_x = ang_x - 360; + while( ang_x < 0 ) ang_x = ang_x + 360; + while( ang_y > 360 ) ang_y = ang_y - 360; + while( ang_y < 0 ) ang_y = ang_y + 360; + while( ang_z > 360 ) ang_z = ang_z - 360; + while( ang_z < 0 ) ang_z = ang_z + 360; + return ang; +}; + +//---------------------------------------------------------------------- +// from triggers.qc in hipnotic/ritual source qc files +void( entity ent, float amount ) hurt_setdamage = +{ + ent.dmg = amount; + if ( !amount ) ent.solid = SOLID_NOT; + else ent.solid = SOLID_TRIGGER; + ent.nextthink = -1; +}; + +//====================================================================== +// Renamed all the constants so they don't conflict with anything else +// They were mostly setup as single words (which is not a good idea) +//====================================================================== +float RSTATE_ACTIVE = 0; +float RSTATE_INACTIVE = 1; +float RSTATE_SPEEDINGUP = 2; +float RSTATE_SLOWINGDOWN = 3; + +float RSTATE_CLOSED = 4; +float RSTATE_OPEN = 5; +float RSTATE_OPENING = 6; +float RSTATE_CLOSING = 7; + +float RSTATE_WAIT = 0; +float RSTATE_MOVE = 1; +float RSTATE_STOP = 2; +float RSTATE_FIND = 3; +float RSTATE_NEXT = 4; + +float OBJECT_ROTATE = 0; +float OBJECT_MOVEWALL = 1; +float OBJECT_SETORIGIN = 2; + +float ROTENTITY_TOGGLE = 1; +float ROTENTITY_START_ON = 2; + +float TRAIN_ROTATION = 1; +float TRAIN_ANGLES = 2; +float TRAIN_STOP = 4; +float TRAIN_NO_ROTATE = 8; +float TRAIN_DAMAGE = 16; +float TRAIN_MOVETIME = 32; +float TRAIN_SET_DAMAGE = 64; + +float MOVEWALL_VISIBLE = 1; +float MOVEWALL_TOUCH = 2; +float MOVEWALL_NONBLOCKING = 4; + +float DOOR_STAYOPEN = 1; + +//====================================================================== +/*QUAKED info_rotate (0 0.5 0) (-4 -4 -4) (4 4 4) x +center point for rotatable objects +-------- KEYS -------- +-------- SPAWNFLAGS -------- +-------- NOTES -------- +center point for rotatable objects +Removes self 5s after spawning +*/ +//====================================================================== + +void() info_rotate = +{ + // remove self after a little while, to make sure that entities that + // have targeted it have had a chance to spawn + // Not sure why this entity is removed, maybe there was entity + // limits in the old days, but that is long gone! + // Leaving entity in map, no advantage to removal anymore + //self.nextthink = time + 5; + //self.think = SUB_Remove; +}; + +//---------------------------------------------------------------------- +void() RotateTargets = +{ + local entity ent; + local vector vx; + local vector vy; + local vector vz; + local vector org; + + makevectors (self.angles); + + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.rotate_type == OBJECT_SETORIGIN ) { + org = ent.oldorigin; + vx = ( v_forward * org_x ); + vy = ( v_right * org_y ); + vy = vy * -1; + vz = ( v_up * org_z ); + ent.neworigin = vx + vy + vz; + setorigin( ent, ent.neworigin + self.origin ); + } + else if ( ent.rotate_type == OBJECT_ROTATE ) { + ent.angles = self.angles; + org = ent.oldorigin; + vx = ( v_forward * org_x ); + vy = ( v_right * org_y ); + vy = vy * -1; + vz = ( v_up * org_z ); + ent.neworigin = vx + vy + vz; + setorigin( ent, ent.neworigin + self.origin ); + } + else { + org = ent.oldorigin; + vx = ( v_forward * org_x ); + vy = ( v_right * org_y ); + vy = vy * -1; + vz = ( v_up * org_z ); + ent.neworigin = vx + vy + vz; + ent.neworigin = self.origin - self.oldorigin + (ent.neworigin - ent.oldorigin); + ent.velocity = (ent.neworigin-ent.origin)*25; + } + ent = find( ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() RotateTargetsFinal = +{ + local entity ent; + + ent = find( world, targetname, self.target); + while( ent ) { + ent.velocity = '0 0 0'; + if ( ent.rotate_type == OBJECT_ROTATE ) ent.angles = self.angles; + ent = find( ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() SetTargetOrigin = +{ + local entity ent; + + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.rotate_type == OBJECT_MOVEWALL ) { + setorigin( ent, self.origin - self.oldorigin + + (ent.neworigin - ent.oldorigin) ); + } + else { + setorigin( ent, ent.neworigin + self.origin ); + } + ent = find( ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() LinkRotateTargets = +{ + local entity ent; + local vector tempvec; + + self.oldorigin = self.origin; + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.classname == "rotate_object" ) { + ent.rotate_type = OBJECT_ROTATE; + ent.oldorigin = ent.origin - self.oldorigin; + ent.neworigin = ent.origin - self.oldorigin; + ent.owner = self; + } + else if ( ent.classname == "func_movewall" ) { + ent.rotate_type = OBJECT_MOVEWALL; + tempvec = ( ent.absmin + ent.absmax ) * 0.5; + ent.oldorigin = tempvec - self.oldorigin; + ent.neworigin = ent.oldorigin; + ent.owner = self; + } + else { + ent.rotate_type = OBJECT_SETORIGIN; + ent.oldorigin = ent.origin - self.oldorigin; + ent.neworigin = ent.origin - self.oldorigin; + } + ent = find (ent, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void( float amount ) SetDamageOnTargets = +{ + local entity ent; + + ent = find( world, targetname, self.target); + while( ent ) { + if ( ent.classname == "trigger_hurt" ) hurt_setdamage( ent, amount ); + else if ( ent.classname == "func_movewall" ) ent.dmg = amount; + ent = find( ent, targetname, self.target); + } +}; + + +//---------------------------------------------------------------------- +// Simple continual rotatation +//---------------------------------------------------------------------- +void() rotate_entity_think = +{ + local float t; + + t = time - self.ltime; + self.ltime = time; + + if ( self.state == RSTATE_SPEEDINGUP ) { + self.count = self.count + self.cnt * t; + if ( self.count > 1 ) self.count = 1; + + // get rate of rotation + t = t * self.count; + } + else if ( self.state == RSTATE_SLOWINGDOWN ) { + self.count = self.count - self.cnt * t; + if ( self.count < 0 ) { + RotateTargetsFinal(); + self.state = RSTATE_INACTIVE; + self.think = SUB_Null; + return; + } + + // get rate of rotation + t = t * self.count; + } + + self.angles = self.angles + ( self.rotate * t ); + self.angles = SUB_NormalizeAngles( self.angles ); + RotateTargets(); + self.nextthink = time + 0.02; +}; + +//---------------------------------------------------------------------- +void() rotate_entity_use = +{ + // change to alternate textures + self.frame = 1 - self.frame; + + if ( self.state == RSTATE_ACTIVE ) { + if ( self.spawnflags & ROTENTITY_TOGGLE ) { + if ( self.speed ) { + self.count = 1; + self.state = RSTATE_SLOWINGDOWN; + } + else { + self.state = RSTATE_INACTIVE; + self.think = SUB_Null; + } + } + } + else if ( self.state == RSTATE_INACTIVE ) { + self.think = rotate_entity_think; + self.nextthink = time + 0.02; + self.ltime = time; + if ( self.speed ) { + self.count = 0; + self.state = RSTATE_SPEEDINGUP; + } + else { + self.state = RSTATE_ACTIVE; + } + } + else if ( self.state == RSTATE_SPEEDINGUP ) { + if ( self.spawnflags & ROTENTITY_TOGGLE ) { + self.state = RSTATE_SLOWINGDOWN; + } + } + else { + self.state = RSTATE_SPEEDINGUP; + } +}; + +//---------------------------------------------------------------------- +void() rotate_entity_firstthink = +{ + LinkRotateTargets(); + if ( self.spawnflags & ROTENTITY_START_ON ) { + self.state = RSTATE_ACTIVE; + self.think = rotate_entity_think; + self.nextthink = time + 0.02; + self.ltime = time; + } + else { + self.state = RSTATE_INACTIVE; + self.think = SUB_Null; + } + self.use = rotate_entity_use; +}; + +//====================================================================== +/*QUAKED func_rotate_entity (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE STARTON +Basic rotating object +-------- KEYS -------- +target : points to center of rotation entity +rotate : The rate of rotation in degrees +speed : time taken to go from zero to full speed and vice-versa +-------- SPAWNFLAGS -------- +TOGGLE : allows the rotation to be toggled on/off +STARTON : whether the entity is spinning when spawned. +If TOGGLE is 0, entity can be turned on, but not off. +-------- NOTES -------- +Basic rotating object +*/ +//====================================================================== +void() func_rotate_entity = +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + setmodel (self, self.model); + setsize( self, self.mins, self.maxs ); + + if ( self.speed != 0 ) self.cnt = 1 / self.speed; + + self.think = rotate_entity_firstthink; + self.nextthink = time + 0.1; + self.ltime = time; +}; + +//====================================================================== +/*QUAKED path_rotate (0.5 0.3 0) (-8 -8 -8) (8 8 8) ROTATION ANGLES STOP NO_ROTATE DAMAGE MOVETIME SET_DAMAGE +Corner Path for rotate_train +-------- KEYS -------- +event : is a target to trigger when train arrives at path_rotate +noise : contains the name of the sound to play when train stops +noise1 : contains the name of the sound to play when train moves +speed : set speed to be the new speed of the train after it reaches + the path change. If speed is -1, the train will warp directly to the next + path change after the specified wait time. If MOVETIME is set on the + path_rotate, the train to interprets "speed" as the length of time to + take moving from one corner to another. +-------- SPAWNFLAGS -------- +ROTATION : Rotate train at rate specified by 'rotate', use '0 0 0' to stop +ANGLES : Rotate to the angles specified by 'angles' + while traveling to this path_rotate. Use values < 0 or > 360 to + guarantee that it turns in a certain direction. Having this flag + set automatically clears any rotation +STOP : stop train and wait to be retriggered +NO_ROTATE : stop train rotating when waiting to be triggered +DAMAGE : Cause damage based on 'dmg' +MOVETIME : Interpret 'speed' as the length of time to take moving +SET_DAMAGE: Set all targets damage to 'dmg' +-------- NOTES -------- +Corner Path for rotate_train +*/ +//====================================================================== +void() rotate_train; +void() rotate_train_next; +void() rotate_train_find; + +//---------------------------------------------------------------------- +void() path_rotate = +{ + if ( self.noise ) precache_sound( self.noise ); + if ( self.noise1 ) precache_sound( self.noise1 ); +}; + +//---------------------------------------------------------------------- +void() rotate_train_think = +{ + local float t; + local float timeelapsed; + + t = time - self.ltime; + self.ltime = time; + + if ( ( self.endtime ) && ( time >= self.endtime ) ) { + self.endtime = 0; + if ( self.state == RSTATE_MOVE ) { + setorigin(self, self.finaldest); + self.velocity = '0 0 0'; + } + + if (self.think1) self.think1(); + } + else { + timeelapsed = (time - self.cnt) * self.duration; + if ( timeelapsed > 1 ) timeelapsed = 1; + setorigin( self, self.dest1 + ( self.dest2 * timeelapsed ) ); + } + + self.angles = self.angles + ( self.rotate * t ); + self.angles = SUB_NormalizeAngles( self.angles ); + RotateTargets(); + + self.nextthink = time + 0.02; +}; + +//---------------------------------------------------------------------- +void() rotate_train_use = +{ + if (self.think1 != rotate_train_find) { + if ( self.velocity != '0 0 0' ) return; // already activated + if ( self.think1 ) self.think1(); + } +}; + +//---------------------------------------------------------------------- +void() rotate_train_wait = +{ + self.state = RSTATE_WAIT; + + if ( self.goalentity.noise ) { + sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + if ( self.goalentity.spawnflags & TRAIN_ANGLES ) { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + + if ( self.goalentity.spawnflags & TRAIN_NO_ROTATE ) self.rotate = '0 0 0'; + + self.endtime = self.ltime + self.goalentity.wait; + self.think1 = rotate_train_next; +}; + +//---------------------------------------------------------------------- +void() rotate_train_stop = +{ + self.state = RSTATE_STOP; + + if ( self.goalentity.noise ) { + sound (self, CHAN_VOICE, self.goalentity.noise, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + if ( self.goalentity.spawnflags & TRAIN_ANGLES ) { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + if ( self.goalentity.spawnflags & TRAIN_NO_ROTATE ) self.rotate = '0 0 0'; + + self.dmg = 0; + self.think1 = rotate_train_next; +}; + +//---------------------------------------------------------------------- +void() rotate_train_next = +{ + local entity targ; + local entity current; + local vector vdestdelta; + local float len, traveltime, div; + local string temp; + + self.state = RSTATE_NEXT; + + current = self.goalentity; + targ = find (world, targetname, self.path ); + if ( targ.classname != "path_rotate" ) + dprint("\b[ROT TRAIN]\b Next target is not path_rotate\n"); + + if ( self.goalentity.noise1 ) self.noise1 = self.goalentity.noise1; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + + self.goalentity = targ; + self.path = targ.target; + if (!self.path ) dprint("\b[ROT TRAIN]\b No next target\n"); + + if ( targ.spawnflags & TRAIN_STOP ) self.think1 = rotate_train_stop; + else if (targ.wait) self.think1 = rotate_train_wait; + else self.think1 = rotate_train_next; + + if ( current.event ) { + // Trigger any events that should happen at the corner. + temp = self.target; + self.target = current.event; + self.message = current.message; + SUB_UseTargets(); + self.target = temp; + self.message = string_null; + } + + if ( current.spawnflags & TRAIN_ANGLES ) { + self.rotate = '0 0 0'; + self.angles = self.finalangle; + } + + if ( current.spawnflags & TRAIN_ROTATION ) self.rotate = current.rotate; + if ( current.spawnflags & TRAIN_DAMAGE ) self.dmg = current.dmg; + if ( current.spawnflags & TRAIN_SET_DAMAGE ) SetDamageOnTargets( current.dmg ); + + if ( current.speed == -1 ) { + // Warp to the next path_corner + setorigin( self, targ.origin ); + self.endtime = self.ltime + 0.01; + SetTargetOrigin(); + + if ( targ.spawnflags & TRAIN_ANGLES ) self.angles = targ.angles; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + self.finaldest = self.origin; + } + else { + self.state = RSTATE_MOVE; + + self.finaldest = targ.origin; + if (self.finaldest == self.origin) { + self.velocity = '0 0 0'; + self.endtime = self.ltime + 0.1; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + self.finaldest = self.origin; + return; + } + // set destdelta to the vector needed to move + vdestdelta = self.finaldest - self.origin; + + // calculate length of vector + len = vlen (vdestdelta); + + if ( current.spawnflags & TRAIN_MOVETIME ) traveltime = current.speed; + else { + // check if there's a speed change + if (current.speed>0) self.speed = current.speed; + if (!self.speed) dprint("\b[ROT TRAIN]\b No speed is defined!\n"); + + // divide by speed to get time to reach dest + traveltime = len / self.speed; + } + + if (traveltime < 0.1) { + self.velocity = '0 0 0'; + self.endtime = self.ltime + 0.1; + if ( targ.spawnflags & TRAIN_ANGLES ) self.angles = targ.angles; + return; + } + + // qcc won't take vec/float + div = 1 / traveltime; + + if ( targ.spawnflags & TRAIN_ANGLES ) { + self.finalangle = SUB_NormalizeAngles( targ.angles ); + self.rotate = ( targ.angles - self.angles ) * div; + } + + // set endtime to trigger a think when dest is reached + self.endtime = self.ltime + traveltime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * div; + + self.duration = div; // 1 / duration + self.cnt = time; // start time + self.dest2 = vdestdelta; // delta + self.dest1 = self.origin; // original position + } +}; + +//---------------------------------------------------------------------- +void() rotate_train_find = +{ + local entity targ; + + self.state = RSTATE_FIND; + LinkRotateTargets(); + + // the first target is the point of rotation. + // the second target is the path. + targ = find ( world, targetname, self.path); + if ( targ.classname != "path_rotate" ) + dprint("\b[ROT TRAIN]\b Next target is not path_rotate\n"); + + // Save the current entity + self.goalentity = targ; + + if ( targ.spawnflags & TRAIN_ANGLES ) { + self.angles = targ.angles; + self.finalangle = SUB_NormalizeAngles( targ.angles ); + } + + self.path = targ.target; + setorigin (self, targ.origin ); + SetTargetOrigin(); + RotateTargetsFinal(); + self.think1 = rotate_train_next; + if (!self.targetname) { + // not triggered, so start immediately + self.endtime = self.ltime + 0.1; + } + else self.endtime = 0; + + self.duration = 1; // 1 / duration + self.cnt = time; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position +}; + +//====================================================================== +/*QUAKED func_rotate_train (0 .5 .8) (-8 -8 -8) (8 8 8) x +Trains are moving platforms that players can ride +-------- KEYS -------- +path : Starts at'path_rotate' position +speed : travel speed (def=100) +dmg : blocking damage (def=0) +sounds : 0=Silent, 1=ratchet metal +noise : sound to play when train stops +noise1 : sound to play when train moves +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Trains are moving platforms that players can ride +If the train is the target of a button or trigger, it will for trigger +The func_rotate_train entity is the center of rotation of all objects +targeted by it. + +*/ +//====================================================================== +void() rotate_train = +{ + dprint("\b[ROTATE]\b rotate_train not supported anymore!\n"); +}; + +//---------------------------------------------------------------------- +void() func_rotate_train = +{ + if (!self.speed) self.speed = 100; + if (!self.target) dprint("\b[ROT TRAIN]\b missing target!\n"); + + if ( !self.noise ) { + if (self.sounds == 0) self.noise = SOUND_EMPTY; + if (self.sounds == 1) self.noise = "plats/train2.wav"; + } + if ( !self.noise1 ) { + if (self.sounds == 0) self.noise1 = SOUND_EMPTY; + if (self.sounds == 1) self.noise1 = "plats/train1.wav"; + } + + precache_sound( self.noise ); + precache_sound( self.noise1 ); + + self.cnt = 1; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_STEP; + self.use = rotate_train_use; + + setmodel (self, self.model); + setsize (self, self.mins, self.maxs); + setorigin (self, self.origin); + + // start trains on the second frame, to make sure their + // targets have had a chance to spawn + self.ltime = time; + self.nextthink = self.ltime + 0.1; + self.endtime = self.ltime + 0.1; + self.think = rotate_train_think; + self.think1 = rotate_train_find; + self.state = RSTATE_FIND; + + self.duration = 1; // 1 / duration + self.cnt = 0.1; // start time + self.dest2 = '0 0 0'; // delta + self.dest1 = self.origin; // original position + + self.flags = self.flags | FL_ONGROUND; +}; + +//---------------------------------------------------------------------- +// Moving clip walls +//---------------------------------------------------------------------- +void() rotate_door_reversedirection; +void() rotate_door_group_reversedirection; + +void() movewall_touch = +{ + if (time < self.owner.attack_finished) return; + + if ( self.dmg ) { + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } + else if ( self.owner.dmg ) { + T_Damage (other, self, self.owner, self.owner.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } +}; + +//---------------------------------------------------------------------- +void() movewall_blocked = +{ + local entity temp; + + if (time < self.owner.attack_finished) return; + + self.owner.attack_finished = time + 0.5; + + if ( self.owner.classname == "func_rotate_door" ) { + temp = self; + self = self.owner; + rotate_door_group_reversedirection(); + self = temp; + } + + if ( self.dmg ) { + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } + else if ( self.owner.dmg ) { + T_Damage (other, self, self.owner, self.owner.dmg, DAMARMOR); + self.owner.attack_finished = time + 0.5; + } +}; + +//---------------------------------------------------------------------- +void() movewall_think = +{ + self.ltime = time; + self.nextthink = time + 0.02; +}; + +//====================================================================== +/*QUAKED func_movewall (0 .5 .8) ? VISIBLE TOUCH NONBLOCKING +Emulate collision on rotating objects +-------- KEYS -------- +dmg : damage to cause when touched or blocked +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +VISIBLE : Causes brush to be displayed +TOUCH : Cause damage when touched by player +NONBLOCKING : makes the brush non-solid, This is useless if VISIBLE is set +-------- NOTES -------- +Emulate collision on rotating objects +*/ +//====================================================================== +void() func_movewall = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.angles = '0 0 0'; + self.movetype = MOVETYPE_PUSH; + + if ( self.spawnflags & MOVEWALL_NONBLOCKING ) self.solid = SOLID_NOT; + else { + self.solid = SOLID_BSP; + self.blocked = movewall_blocked; + } + + if ( self.spawnflags & MOVEWALL_TOUCH ) { + self.touch = movewall_touch; + } + + setmodel (self,self.model); + if ( !( self.spawnflags & MOVEWALL_VISIBLE ) ) self.model = string_null; + + self.think = movewall_think; + self.nextthink = time + 0.02; + self.ltime = time; +}; + +//====================================================================== +/*QUAKED rotate_object (0 .5 .8) ? +Defines a bmodel object to be rotated +-------- KEYS -------- +targetname : name of bmodel object +target : rotating point entities to link too +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Defines a bmodel object to be rotated +Used as the target of func_rotate_door +*/ +//====================================================================== +void() rotate_object_move = +{ + local entity ent; + + ent = find( world, targetname, self.target2); + if (ent.classname == "info_rotate") { + // Move origin to new location + self.oldorigin = ent.origin; + setorigin( self, self.oldorigin ); + } +}; + +//---------------------------------------------------------------------- +void() rotate_object = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classname = "rotate_object"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + setmodel (self,self.model); + setsize( self, self.mins, self.maxs ); + + // Check for a target (info_rotate) to move the object + if (self.target2 != "") { + self.think = rotate_object_move; + self.nextthink = time + 1; + } + else self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() rotate_door_think2 = +{ + local float t; + + t = time - self.ltime; + self.ltime = time; + + // change to alternate textures + self.frame = 1 - self.frame; + self.angles = self.dest; + + if ( self.state == RSTATE_OPENING ) self.state = RSTATE_OPEN; + else { + if ( self.spawnflags & DOOR_STAYOPEN ) { + rotate_door_group_reversedirection(); + return; + } + self.state = RSTATE_CLOSED; + } + + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + self.think = SUB_Null; + + RotateTargetsFinal(); +}; + +//---------------------------------------------------------------------- +void() rotate_door_think = +{ + local float t; + + t = time - self.ltime; + self.ltime = time; + + if ( time < self.endtime ) { + self.angles = self.angles + ( self.rotate * t ); + RotateTargets(); + } + else { + self.angles = self.dest; + RotateTargets(); + self.think = rotate_door_think2; + } + + self.nextthink = time + 0.01; +}; + +//---------------------------------------------------------------------- +void() rotate_door_reversedirection = +{ + local vector start; + + // change to alternate textures + self.frame = 1 - self.frame; + + if ( self.state == RSTATE_CLOSING ) { + start = self.dest1; + self.dest = self.dest2; + self.state = RSTATE_OPENING; + } + else { + start = self.dest2; + self.dest = self.dest1; + self.state = RSTATE_CLOSING; + } + + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + + self.rotate = ( self.dest - start ) * ( 1 / self.speed ); + self.think = rotate_door_think; + self.nextthink = time + 0.02; + self.endtime = time + self.speed - ( self.endtime - time ); + self.ltime = time; +}; + +//---------------------------------------------------------------------- +void() rotate_door_group_reversedirection = +{ + local string name; + + // tell all associated rotaters to reverse direction + if ( self.group ) { + name = self.group; + self = find( world, group, name); + while( self ) { + rotate_door_reversedirection(); + self = find( self, group, name); + } + } + else rotate_door_reversedirection(); +}; + +//---------------------------------------------------------------------- +void() rotate_door_use = +{ + // local entity t; + local vector start; + + if ( ( self.state != RSTATE_OPEN ) && ( self.state != RSTATE_CLOSED ) ) return; + + if ( !self.cnt ) { + self.cnt = 1; + LinkRotateTargets(); + } + + // change to alternate textures + self.frame = 1 - self.frame; + + if ( self.state == RSTATE_CLOSED ) { + start = self.dest1; + self.dest = self.dest2; + self.state = RSTATE_OPENING; + } + else { + start = self.dest2; + self.dest = self.dest1; + self.state = RSTATE_CLOSING; + } + + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + + self.rotate = ( self.dest - start ) * ( 1 / self.speed ); + self.think = rotate_door_think; + self.nextthink = time + 0.01; + self.endtime = time + self.speed; + self.ltime = time; +}; + +//====================================================================== +/*QUAKED func_rotate_door (0 .5 .8) (-8 -8 -8) (8 8 8) STAYOPEN +Rotating door moving around a point of rotation +-------- KEYS -------- +target : Points to the rotate_object bmodel entity +target2 : Move on spawn to this entity (info_rotate) location +dmg : Damage caused when blocked (def=2) negative numbers =no damage +speed : Time taken to rotate open/close +sounds : 1=medieval 2=metal 3=base 4=Silent (def=1) +-------- SPAWNFLAGS -------- +STAYOPEN : Reopen after closing, stops a once only door from closing if blocked +-------- NOTES -------- +Rotating door moving around a point of rotation +*/ +//====================================================================== +void() func_rotate_door = +{ + if (!self.target) dprint("\b[ROT DOOR]\b missing target!\n"); + + self.dest1 = '0 0 0'; + self.dest2 = self.angles; + self.angles = self.dest1; + + // default to 2 seconds + if ( !self.speed ) self.speed = 2; + self.cnt = 0; + + if (!self.dmg) self.dmg = 2; + else if ( self.dmg < 0 ) self.dmg = 0; + + if (self.sounds == 0) self.sounds = 1; + if (self.sounds == 1) { + self.noise1 = "doors/latch2.wav"; + self.noise2 = "doors/winch2.wav"; + self.noise3 = "doors/drclos4.wav"; + } + if (self.sounds == 2) { + self.noise2 = "doors/airdoor1.wav"; + self.noise1 = "doors/airdoor2.wav"; + self.noise3 = "doors/airdoor2.wav"; + } + if (self.sounds == 3) { + self.noise2 = "doors/basesec1.wav"; + self.noise1 = "doors/basesec2.wav"; + self.noise3 = "doors/basesec2.wav"; + } + if (self.sounds == 4) { + self.noise1 = SOUND_EMPTY; + self.noise2 = SOUND_EMPTY; + self.noise3 = SOUND_EMPTY; + } + + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.model); + setorigin( self, self.origin ); + setsize( self, self.mins, self.maxs ); + self.state = RSTATE_CLOSED; + self.use = rotate_door_use; + self.think = SUB_Null; +}; diff --git a/QC_other/QC_keep/hiprubbl.qc b/QC_other/QC_keep/hiprubbl.qc new file mode 100644 index 00000000..b794296f --- /dev/null +++ b/QC_other/QC_keep/hiprubbl.qc @@ -0,0 +1,90 @@ +void () hipRubbleTouch = { + if ( (self.ltime < self.pausetime) ) return ; + if ( other.takedamage ) { + T_Damage (other,self,self.owner,MOVETYPE_BOUNCE,DAMARMOR); + sound (self,CHAN_WEAPON,"zombie/z_hit.wav",TRUE,ATTN_NORM); + self.pausetime = (self.ltime + 0.100); + } +}; + +void (string rubblename) hipThrowRubble = { + local entity new; + + new = spawn (); + new.origin = self.origin; + setmodel (new,rubblename); + setsize (new,VEC_ORIGIN,VEC_ORIGIN); + new.velocity_x = (70.000 * crandom ()); + new.velocity_y = (70.000 * crandom ()); + new.velocity_z = (140.000 + (70.000 * random ())); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_BBOX; + new.avelocity_x = (random () * 600.000); + new.avelocity_y = (random () * 600.000); + new.avelocity_z = (random () * 600.000); + new.think = SUB_Remove; + new.touch = hipRubbleTouch; + new.ltime = time; + new.nextthink = ((time + 13.000) + (random () * MOVETYPE_BOUNCE)); + self.pausetime = time; + new.frame = FALSE; + new.flags = FALSE; +}; + +void () hip_rubble_use = { + local float which; + local float index; + + index = FALSE; + do { + which = self.cnt; + if ( (self.cnt == FALSE) ) { + which = (TRUE + (MOVETYPE_WALK * random ())); + which = floor (which); + } + if ( (which == 1) ) { + hipThrowRubble ("progs/rubble1.mdl"); + } else { + if ( (which == 2) ) { + hipThrowRubble ("progs/rubble3.mdl"); + } else { + hipThrowRubble ("progs/rubble2.mdl"); + } + } + index = (index + TRUE); + } while ( (index < self.count) ); +}; + +void () func_rubble = { + precache_model ("progs/rubble1.mdl"); + precache_model ("progs/rubble2.mdl"); + precache_model ("progs/rubble3.mdl"); + precache_sound ("zombie/z_hit.wav"); + self.classname = "rubble"; + self.cnt = FALSE; + self.use = hip_rubble_use; +}; + +void () func_rubble1 = { + precache_model ("progs/rubble1.mdl"); + precache_sound ("zombie/z_hit.wav"); + self.classname = "rubble1"; + self.cnt = TRUE; + self.use = hip_rubble_use; +}; + +void () func_rubble2 = { + precache_model ("progs/rubble3.mdl"); + precache_sound ("zombie/z_hit.wav"); + self.classname = "rubble2"; + self.cnt = FL_SWIM; + self.use = hip_rubble_use; +}; + +void () func_rubble3 = { + precache_model ("progs/rubble2.mdl"); + precache_sound ("zombie/z_hit.wav"); + self.classname = "rubble3"; + self.cnt = MOVETYPE_WALK; + self.use = hip_rubble_use; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/impulse.qc b/QC_other/QC_keep/impulse.qc new file mode 100644 index 00000000..c21461e5 --- /dev/null +++ b/QC_other/QC_keep/impulse.qc @@ -0,0 +1,60 @@ +/*====================================================================== + ImpulseCommands +======================================================================*/ +void() ImpulseCommands = +{ + if ((self.impulse >= 1 && self.impulse <= 9) || (self.impulse >= 60 && self.impulse <= 64) || (self.impulse >= 175 && self.impulse <= 181)) W_ChangeWeapon (self); + else if (self.impulse == 10) CycleWeaponCommand(); + else if (self.impulse == 12) CycleWeaponReverseCommand(); + + // Only these MOD options can be changed via the console + else if (self.impulse == 100) toggleautoaim(); // Toggle auto aim + else if (self.impulse == 105) toggleprojsize(); // Toggle player proj size + else if (self.impulse == 110) togglezaware(); // Toggle Z aware monsters + else if (self.impulse == 115) togglepixels(); // Toggle texture modes + else if (self.impulse == 120) togglefootstep(); // Toggle footstep sound + else if (self.impulse == 125) toggleliquiddmg(); // Toggle liquid damage + else if (self.impulse == 130) toggleshotgunproj(); // Toggle SG Projectile + else if (self.impulse == 135) toggleshotguncase(); // Toggle SG Casing + else if (self.impulse == 140) display_version(); // Display MOD config flag + else if (self.impulse == 142) display_playinfo(); // Display Player information + else if (self.impulse == 145) StartIntermissionCamera(); + else if (self.impulse == 150) togglecoopartifacts();// Toggle COOP can drop artifacts + else if (self.impulse == 152) togglecoopweapons(); // Toggle COOP weapons to respawn + else if (self.impulse == 154) togglecoophealth(); // Toggle COOP health to respawn + else if (self.impulse == 155) togglecoopammoboxes();// Toggle COOP ammo boxes to respawn + else if (self.impulse == 158) togglecooppowerups(); // Toggle COOP powerups to respawn + + else if (self.impulse == 160) toggleweather(); // Toggle Weather Systems + else if (self.impulse == 170) togglebodyremoval(); // Toggle monster body fade/removal + else if (self.impulse == 175) display_customkeys(); // Display Custom Key inventory + + // Only works developer only) + else if (self.impulse == 200) toggleupgradeaxe(); // Toggle Axe Upgrade + else if (self.impulse == 205) toggleupgradessg(); // Toggle Shotgun Upgrade + else if (self.impulse == 210) toggleupgradelg(); // Toggle Lightning Upgrade + else if (self.impulse == 220) display_configflag(); // Display MOD config flag + else if (self.impulse == 225) display_mapvar(); // Display all map variables + else if (self.impulse == 230) toggleaipath(); // Display AI path extra info + else if (self.impulse == 231) toggledevhelpers(); // Toggle Dev Helpers (mark/arrow) + else if (self.impulse == 235) CycleParticleDebug(); // Cycle particle debug + + else if (self.impulse == 240) givesigil(SVR_RUNE_ALL); // Give all sigils to player + else if (self.impulse == 241) givesigil(SVR_RUNE_KEY1); // Give various sigil to player + else if (self.impulse == 242) givesigil(SVR_RUNE_KEY2); // Will be reset on map load + else if (self.impulse == 243) givesigil(SVR_RUNE_KEY3); // Mainly used for testing + else if (self.impulse == 244) givesigil(SVR_RUNE_KEY4); + + else if (self.impulse == 245) givekey(IT_KEY1 + IT_KEY2); // Both + + // Legacy cheat commands, should be developer 1 only ... + else if (self.impulse == 249) CheatCommand(); + else if (self.impulse == 250) SharpshooterCheat(); + else if (self.impulse == 251) NailPiercerCheat(); + else if (self.impulse == 252) EnvSuitCheat(); + else if (self.impulse == 253) PentagramCheat(); + else if (self.impulse == 254) InvisibleCheat(); + else if (self.impulse == 255) QuadDamageCheat(); + + self.impulse = 0; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/items.qc b/QC_other/QC_keep/items.qc new file mode 100644 index 00000000..c7d35e98 --- /dev/null +++ b/QC_other/QC_keep/items.qc @@ -0,0 +1,3283 @@ +/*====================================================================== + ITEM FUNCTIONS +======================================================================*/ +void(entity e) senddevdata; + +float ITEM_RESPAWN = 16; // Item will respawn +float ITEM_FLOATING = 32; // Spawn floating +float ITEM_NOEFFECTS = 128; // Disable particles and effects + +float H_ROTTEN = 1; // Rotten +float H_MEGA = 2; // Mega Health + +float A_LARGE = 1; // Used by ammo boxes +float A_LID = 2; // Display Lid + +float ITEM_CKEY1 = 1; // Custom Key 1 +float ITEM_CKEY2 = 2; // Custom Key 2 +float ITEM_CKEY3 = 4; // Custom Key 3 +float ITEM_CKEY4 = 8; // Custom Key 4 + +float BACKPACK_SHELLS = 1; +float BACKPACK_NAILS = 2; +float BACKPACK_ROCKETS = 4; +float BACKPACK_CELLS = 8; + +// Various bounding boxes for items +// vector VEC_ORID_MIN = '0 0 0'; +// vector VEC_ORID_MAX = '32 32 56'; +vector VEC_HEAL_MIN = '-16 -16 0'; +vector VEC_HEAL_MAX = '16 16 56'; +vector VEC_WPNS_MIN = '-16 -16 0'; +vector VEC_WPNS_MAX = '16 16 56'; +vector VEC_AMMO_MIN = '-16 -16 0'; +vector VEC_AMMO_MAX = '16 16 56'; +vector VEC_KEYS_MIN = '-16 -16 -24'; +vector VEC_KEYS_MAX = '16 16 32'; +vector VEC_POWR_MIN = '-16 -16 -24'; +vector VEC_POWR_MAX = '16 16 32'; + +// Default respawn timers for items +float RESPAWN_HEALTH = 20; // 15,25,100+ +float RESPAWN_ARMOR = 20; // Green, Yellow, Red +float RESPAWN_WEAPON = 30; // SG -> LG +float RESPAWN_AMMO = 30; // Shells,Nails,Rockets,Cells +float RESPAWN_KEY = 60; // Gold,Silver,Custom +float RESPAWN_RUNE = 60; // Sigil/runes +float RESPAWN_ARTIFACT1 = 60; // Quad + Suit +float RESPAWN_ARTIFACT2 = 300; // Pent + Invisibilty +float RESPAWN_BACKPACK = 30; // Random Ammo Drop +float RESPAWN_COOP = 5; // Default timer for coop + +float RESPAWN_PARTICLES = 32; // Particle burst for ring/center +float RESPAWN_EXPTIME = 1; // Particles burst lifetime +float RESPAWN_EXPRADIUS = 12; // Particle ring radius + +float MODEL_ANIM_SPEED = 3; +float MODEL_ANIM_RANGE = 3; + +void() weapon_touch; +void() ammo_touch; +void() artifact_touch; + +//---------------------------------------------------------------------- +// Some items have pickup conditions which prevent targets +// from firing when coop mode is active, show console warning +//---------------------------------------------------------------------- +void() item_coopcheck = +{ + if (self.target != "" || self.target2 != "") { + dprint("\b[Coop]\b ("); + dprint(self.classname); + dprint(") unreliable target(s) in coop!\n"); + } +}; + +//---------------------------------------------------------------------- +// Check floor under item and animated skin for new BASE health boxes +//---------------------------------------------------------------------- +void() item_thinkloop = +{ + // Check for entity states + if (self.estate & ESTATE_BLOCK) return; + // Has the item been turned off? + if (self.attack_finished > time) return; + // Has the item removal timer been reached? + if (self.item_expired > 0 && self.item_expired < time) remove(self); + + if (self.item_skinanim > 0) { + self.item_skincycle = self.item_skincycle + 1; + if (self.item_skincycle > MODEL_ANIM_SPEED) { + self.item_skincycle = 0; + self.item_skinanim_no = self.item_skinanim_no + 1; + if (self.item_skinanim_no > MODEL_ANIM_RANGE) { + self.item_skinanim_no = 0; + } + } + // Update skin + self.skin = self.item_skinanim_no; + } + + // Check floor below item (global function) + if (self.item_flrcheck > 0) { + ent_floorcheck(self, self.item_flrcheck); + // Record any movement for respawn function + self.oldorigin = self.origin; + } + + // Keep checking + self.think = item_thinkloop; + self.nextthink = time + 0.1; +}; + +void() item_estate_setup; +//---------------------------------------------------------------------- +void() item_reset = +{ + // Reset trigger_once conditions + self.attack_finished = 0; + if (!self.estate_on) item_estate_setup(); + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() item_finished = +{ + // Check for coop respawn options + if (coop > 0) { + if (self.classgroup == CG_WEAPON) { + if (coop_weapons == TRUE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_weapons == FALSE && self.respawn_time > 0) { + self.respawn_time = RESPAWN_COOP; + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + } + else if (self.classgroup == CG_HEALTH) { + if (coop_health == FALSE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_health == TRUE && self.respawn_time > 0) + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + else if (self.classgroup == CG_AMMOITEM) { + if (coop_ammoboxes == FALSE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_ammoboxes == TRUE && self.respawn_time > 0) + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + else if (self.classgroup == CG_ARTIFACT) { + if (coop_powerups == FALSE) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + else if (coop_powerups == TRUE && self.respawn_time > 0) + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + } + + self.attack_finished = LARGE_TIMER; + if (!self.estate_off) item_estate_setup(); + self.estate_off(); +}; + +//---------------------------------------------------------------------- +void() item_respawn = +{ + // Classic quake re-spawn sound + sound (self, CHAN_VOICE, SOUND_RESPAWN, 1, ATTN_NORM); + + // Are particles enabled? + if (query_configflag(SVR_PARTICLES)) { + // Switch off any respawn emitter + if (self.respawn_part.classtype == CT_PARTICLEEMIT) + misc_particle_off(self.respawn_part); + + if (self.respawn_style & PARTICLE_BURST_RING) + particle_ring(self.origin + self.respawn_ofs, '0 0 4', '4 4 16', RESPAWN_EXPRADIUS, RESPAWN_PARTICLES, RESPAWN_EXPTIME, self.respawn_style ); + else if (self.respawn_style & PARTICLE_BURST_CENTER) + particle_explode(self.origin + self.respawn_ofs, RESPAWN_PARTICLES*2, RESPAWN_EXPTIME, self.respawn_style, self.respawn_style); + } + + self.alpha = 1; + self.estate_reset(); +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() SUB_regen = { +// self.model = self.mdl; +// self.solid = SOLID_TRIGGER; + sound (self, CHAN_VOICE, SOUND_RESPAWN, 1, ATTN_NORM); +// setorigin (self, self.origin); + item_reset(); +}; + +//---------------------------------------------------------------------- +void() alphafade_item_respawn = +{ + if (self.waitmin > time) { + self.speed = 1 - ((self.waitmin - time) / self.respawn_time); + self.alpha = 0.1 + ((self.speed*0.4)*random()); + + // If respawn effect active, modify total particles + if (self.respawn_part.part_style == PARTICLE_STYLE_RESPAWN) { + self.respawn_part.part_limit = rint(RESPAWN_PARTICLES * self.speed); + } + self.think = alphafade_item_respawn; + self.nextthink = time + 0.1; + } + else item_respawn(); +}; + +//---------------------------------------------------------------------- +void() start_item_respawn = +{ + // Is the item being respawned at the moment? + if (self.waitmin > time) return; + // Is the item setup to instantly respawn? (time = -1) + if (self.respawn_time < 1 && self.spawnflags & ITEM_RESPAWN) { + // Check for any respawn quantity counts + if (self.respawn_count > 0) { + self.respawn_count = self.respawn_count - 1; + if (self.respawn_count == 0) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + } + // Instantly spawn item + item_respawn(); + } + else { + // deathmatch 2 is the silly old rules + if (deathmatch == 1 || self.spawnflags & ITEM_RESPAWN) { + setmodel(self,self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + self.waitmin = time + self.respawn_time; + self.alpha = 0.1; + + // Check for any respawn quantity counts + if (self.respawn_count > 0) { + self.respawn_count = self.respawn_count - 1; + if (self.respawn_count == 0) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + } + + // Are particles enabled? + if (query_configflag(SVR_PARTICLES)) { + // Switch off any particle emitters + if (self.part_emitter) misc_particle_off(self.part_emitter); + // Is there any need for respawn effect? + if (self.respawn_effect) { + // If emitter does not exist? create one, else switch on + if (self.respawn_part.classtype == CT_PARTICLEEMIT) + misc_particle_on(self.respawn_part); + else self.respawn_part = spawn_pemitter(self, self, PARTICLE_STYLE_RESPAWN, PARTICLE_START_ON); + } + } + // Switch on gradual alpha fade + alphafade_item_respawn(); + } + } +}; + +//---------------------------------------------------------------------- +void() check_item_respawn = +{ + // Respawn feature is waiting for trigger + if (!self.respawn_trig) start_item_respawn(); +}; + +//---------------------------------------------------------------------- +void() item_use = +{ + // Check for any trigger respawn conditions first + // Respawn spawnflag, trigger condition and not trigger once + if (self.spawnflags & ITEM_RESPAWN && self.respawn_trig && + self.estate == ESTATE_OFF) start_item_respawn(); + else { + // usual trigger blocks, OFF, DISABLE and trigger_ONCE + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Was item setup to be floating? + if(self.spawnflags & ITEM_FLOATING){ + // Removed checkbottom check, it often fails and leaves + // items floating in midair when they should fall + // if (!checkbottom(self)) - left for comment only + // A quick toss of the item + self.movetype = MOVETYPE_TOSS; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + } + } +}; + +//---------------------------------------------------------------------- +void() item_touch = +{ + if (self.touchedvoid) {entity_hide(self); return;} + if (self.estate & ESTATE_BLOCK) return; + + if ( !(other.flags & FL_CLIENT) ) return; + if ( other.health < 1 ) return; + if ( other.flags & FL_NOTARGET ) return; + if (self.attack_finished > time) return; + + self.touch2(); // defined by item function +}; + +//---------------------------------------------------------------------- +void() item_restore = +{ + // Ammo boxes can have special animation frames or lids! + if (self.classgroup == CG_AMMOITEM) { + // Any LID (shells/spikes) defined? + if (self.spawnflags & A_LID && self.attachment) { + // Setup LID attachment entity (match angles/origin) + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = self.movetype; + setmodel(self.attachment, self.headmdl); + // Give the lid the same bbox setup so it can move + setsize (self.attachment, self.mins, self.maxs); + // Start lid off the ground and remove ground flag + // This will let the lid naturally settle on the surface + setorigin(self.attachment, self.origin + '0 0 1'); + self.attachment.flags = self.attachment.flags - (self.attachment.flags & FL_ONGROUND); + // Match angle and stored frame setup from ammo box + self.attachment.angles = self.angles; + + // lid frame options 0=random, 1-7=exact + // Always generate a new lid position for respawning items + if (self.frame_box == 0) self.attachment.frame = rint(1 + random()*6); + else if (self.frame_box > 7) self.frame_box = 1; + if (self.frame_box > 0) self.attachment.frame = self.frame_box; + + // LID has different skins for shells and spikes + if (self.classtype == CT_AMMOSHELLS) self.attachment.skin = self.skin; + else self.attachment.skin = 2 + self.skin; + } + // Any special frames (rockets/plasma) defined? + else if (self.frame_override) { + // frame options -1=random 0=nothing, 1-7=exact + // Always generate a new frame number for respawning items + if (self.frame_box == -1) self.frame = rint(1 + random()*6); + else if (self.frame_box > 7) self.frame_box = 1; + if (self.frame_box > 0) self.frame = self.frame_box; + } + } + + // Setup animated textures for old style ID health boxes + // Check floor under item for any changes + if (self.item_flrcheck > 0 || self.item_skinanim > 0) { + self.nextthink = time + random()*0.5; + self.think = item_thinkloop; + } +}; + +//---------------------------------------------------------------------- +void() item_delay = +{ + if (self.touchedvoid) {entity_hide(self); return;} + if (self.estate == ESTATE_DISABLE) return; + + //---------------------------------------------------------------------- + // Check for Axe / Shotgun / LG upgrade monster spawn exceptions? + if (self.upgrade_axe || self.upgrade_ssg || self.upgrade_lg) { + // Has ANY player (server test not individual) + // picked up the relevant upgrade weapons? + if (self.upgrade_axe && !query_configflag(SVR_UPDAXE) ) return; + if (self.upgrade_ssg && !query_configflag(SVR_UPDSSG) ) return; + if (self.upgrade_lg && !query_configflag(SVR_UPDLG) ) return; + } + + // Reset use function and any touch/skin triggers + self.estate_use = item_use; + self.touch = item_touch; + self.attack_finished = 0; + self.estate = ESTATE_ON; + // Setup enough parameters to test drop to floor + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + setmodel(self,self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + setorigin(self, self.oldorigin); + self.velocity = '0 0 0'; + + // Finalize item location (check drop to floor) + if(self.spawnflags & ITEM_FLOATING) { + // Cannot check the floor of an item if its floating!?! + if (self.item_flrcheck > 0) self.item_flrcheck = 0; + } + else { + self.movetype = MOVETYPE_TOSS; + self.velocity = '0 0 0'; + self.origin_z = self.origin_z + 6; + // ID originally use a droptofloor test for space check + // Tried a pointcontents check but it can allows things + // to fall through the floor and just keep going +// if (pointcontents(self.origin) == CONTENT_SOLID) { + if (!droptofloor()) { + dprint ("\n\b[Item]\b "); dprint (self.classname); + dprint (" stuck at ("); dprint (vtos(self.origin)); dprint (")\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + // If check floor under item enabled, workout distance check + // The bottom of the bounding box + 16 for large step + if (self.item_flrcheck > 0) { + self.item_flrcheck = fabs(self.mins_z) + 16; + } + + // Spawn particle emitter if particles active and not blocked + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) { + if (!(self.spawnflags & ITEM_NOEFFECTS) && self.part_active > 0) { + self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_ON); + } + } + + // Finally setup entity ready for use + self.oldorigin = self.origin; + + // Remove the START OFF functionality + if (self.spawnflags & ENT_STARTOFF) { + self.spawnflags = self.spawnflags - ENT_STARTOFF; + // Check for respawn effect? + if (self.spawnflags & ITEM_RESPAWN) start_item_respawn(); + else item_restore(); + } + else item_restore(); +}; + +//---------------------------------------------------------------------- +void() item_on = +{ + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + + // Restore any effect flags settings (various dlight glows) + if (self.savedeffects > 0) self.effects = self.savedeffects; + + // Check for delayed/trigger_once functionality? + if (self.spawnflags & ENT_STARTOFF || self.attack_finished > time) + self.solid = SOLID_NOT; + else { + // Restore movement, solid and model parameters + if(self.spawnflags & ITEM_FLOATING) self.movetype = MOVETYPE_NONE; + else self.movetype = MOVETYPE_TOSS; + self.solid = SOLID_TRIGGER; + setmodel(self,self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + self.velocity = '0 0 0'; + // Restore particle emitter + if (self.part_emitter) misc_particle_on(self.part_emitter); + // Setup touch/damage/bounding box functionality + self.think = SUB_Null; + item_restore(); + } +}; + +//---------------------------------------------------------------------- +void() item_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self,""); + self.effects = 0; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + // If item was setup to float then it will be trigger item + // Don't reset origin as it might have fallen somewhere better + if( !(self.spawnflags & ITEM_FLOATING) ) setorigin(self, self.oldorigin); + + if (self.attachment) { + setmodel(self.attachment,""); + setsize(self.attachment, VEC_ORIGIN, VEC_ORIGIN); + } +}; + +//---------------------------------------------------------------------- +void() item_estate_setup = +{ + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = item_on; + self.estate_off = item_off; + self.estate_use = item_delay; + self.estate_reset = item_reset; +}; + +//---------------------------------------------------------------------- +void() item_start = +{ + self.oldorigin = self.origin; // Save origin + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.flags = self.flags | FL_ITEM; + + if (world.devdata & DEV_AMMO_N_HEALTH) senddevdata(self); + + // Warning if effects flag is active before spawning + if (self.effects) { + dprint("\b[ITEM]\b Effects flag active\n"); + self.savedeffects = self.effects; + } + // Reset effects flag because some engines will show effects + // This is especially obvious for delay spawned items + self.effects = 0; + + // Check for spawning conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Cannot have multiple upgrade restrictions on items + remove_duplicate_upgrades(); + + // Check for Axe / Shotgun item exceptions? + if (self.upgrade_axe || self.upgrade_ssg) { + if ( !(self.spawnflags & ENT_STARTOFF) ) { + dprint("\b[ITEM]\b need spawn delay for axe/shotgun\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + // If respawn timer negative then wait for a trigger + if (self.respawn_time < 0) self.respawn_trig = TRUE; + if (self.respawn_count < 0) self.respawn_count = 1; + + // Setup Entity State functionality + item_estate_setup(); + + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + // delay drop to floor to make sure all doors have been spawned + // spread think times so they don't all happen at same time + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.estate_use; + } +}; + +/*====================================================================== + HEALTH FLASK/BOX + + targ - entity to receive healing + t_healamount - the quanity to heal entity with + ignore - whether to ignore max health amount + returns FALSE if cannot heal entity by healamount + returns TRUE if healamount applied +======================================================================*/ +float (entity targ, float t_healamount, float ignore) T_Heal = +{ + if (targ.health <= 0) return FALSE; + if ((!ignore) && (targ.health >= other.max_health)) return FALSE; + t_healamount = ceil(t_healamount); + + targ.health = targ.health + t_healamount; + if ((!ignore) && (targ.health >= other.max_health)) + targ.health = other.max_health; + + if (targ.health > HEAL_MEGAMAX) targ.health = HEAL_MEGAMAX; + + // Healing the player negates some debuffs + ResetDebuffBurning(targ); + ResetDebuffPoisoned(targ); + return TRUE; +}; + +//---------------------------------------------------------------------- +void() item_megahealth_rot = +{ + // Check for maximum health limit + if (self.owner.health > self.owner.max_health) { + self.owner.health = self.owner.health - 1; + self.nextthink = time + 1; + } + else { + // it is possible for a player to die and respawn between rots + // Double check player has megahealth before removing it + if (self.owner.items & IT2_SUPERHEALTH) + self.owner.items = self.owner.items - IT2_SUPERHEALTH; + + // Check to see if item can respawn + self.alpha = 0.1; + check_item_respawn(); + } +}; + +//---------------------------------------------------------------------- +void() health_touch = +{ + local string s; + + // Megahealth? Ignore max_health... + if (self.classtype == CT_HEALMEGA) { + if (other.health >= HEAL_MEGAMAX) return; + if (!T_Heal(other, self.healamount, 1)) return; + } + else { + if (!T_Heal(other, self.healamount, 0)) return; + } + + sprint(other, "You receive "); + s = ftos(self.healamount); + sprint(other, s); + sprint(other, " health\n"); + sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + item_finished(); + + // Megahealth = rot down the player's super health + // Need to wait for megahealth to finish before respawn + if (self.classtype == CT_HEALMEGA) { + other.items2 = other.items2 | IT2_SUPERHEALTH; + self.nextthink = time + 5; + self.think = item_megahealth_rot; + self.owner = other; + } + else check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +/*====================================================================== +/*QUAKED item_health (0.3 0.3 1) (-16 -16 0) (16 16 32) ROTTEN MEGA x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/health_25.mdl"); } +15, 25 or 100 Health +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : = -1 Random rotation everytime spawned (default) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +ROTTEN : 15 health +MEGA : MegaHealth +100 health, rot down to 100 +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Health box gives 15, 25 or 100 points depending on spawnflags. + +======================================================================*/ +void() item_health = +{ + if (self.spawnflags & H_ROTTEN) { + if (world.worldtype < 2 && !self.skin_override) { + // New Medieval style red flask + self.mdl = "progs/ad171/health_15.mdl"; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + } + else { + // Original ID pickup model + self.mdl = "progs/ad171/health_15b.mdl"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + } + self.noise = SOUND_HEAL15; + self.healamount = HEAL_ROT; + self.classtype = CT_HEALROT; + self.respawn_effect = TRUE; + self.respawn_ofs = '0 0 16'; + } + else if (self.spawnflags & H_MEGA) { + if (world.worldtype < 2 && !self.skin_override) { + // New Medieval style red flask + self.mdl = "progs/ad171/health_100.mdl"; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + } + else { + // Original ID pickup model + self.mdl = "progs/ad171/health_100b.mdl"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.item_skinanim = TRUE; + } + self.noise = SOUND_HEAL100; + self.healamount = HEAL_MEGA; + self.classtype = CT_HEALMEGA; + self.part_active = PARTICLE_STYLE_MEGAH; + self.respawn_effect = TRUE; + self.respawn_ofs = '0 0 28'; + } + else { + if (world.worldtype < 2 && !self.skin_override) + { + // New Medieval style red flask + self.mdl = "progs/ad171/health_25.mdl"; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + } + else { + // Original ID pickup model + self.mdl = "progs/ad171/health_25b.mdl"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 16'; + self.item_skinanim = TRUE; + } + self.noise = SOUND_HEAL25; + self.healamount = HEAL_NORM; + self.classtype = CT_HEALNORM; + self.respawn_effect = TRUE; + } + + precache_model(self.mdl); + precache_sound(self.noise); + + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + // Move the new centered ammo models to match old ammo origin + // The default is to move all ammo items to suit original id maps + if (query_configflag(SVR_ITEMOFFSET) == FALSE) { + self.oldorigin = self.origin + '16 16 0'; + setorigin(self, self.oldorigin); + } + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && query_configflag(SVR_ITEMROTATE) == FALSE) ) + self.angles_y = rint(random()*359); + + self.touch2 = health_touch; + self.classgroup = CG_HEALTH; + self.bbmins = VEC_HEAL_MIN; + self.bbmaxs = VEC_HEAL_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_HEALTH; + + // Check for coop errors + item_coopcheck(); + item_start (); +}; + +//====================================================================== +// armor_touch +//====================================================================== +void() armor_touch = +{ + if (other.armortype*other.armorvalue >= self.armortype*self.armorvalue) return; + + other.armortype = self.armortype; + other.armorvalue = self.armorvalue; + other.items2 = other.items2 - (other.items2 & (IT2_ARMOR1 | IT2_ARMOR2 | IT2_ARMOR3)) + self.items2; + + sprint(other, "You got armor\n"); + sound(other, CHAN_ITEM, "items/armor1.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_armor_setup = +{ + self.classgroup = CG_ARMOR; + self.part_active = PARTICLE_STYLE_ARMOR; + self.touch2 = armor_touch; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 56'; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_ARMOR; + + // Check for coop errors + item_coopcheck(); + item_start (); +}; + +/*====================================================================== +/*QUAKED item_armor1 (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/armour.mdl"); } +Green Armour with 100 points of protection +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Green Armour with 100 points of protection + +======================================================================*/ +void() item_armor1 = +{ + self.mdl = "progs/ad171/armour.mdl"; + precache_model (self.mdl); + self.skin = 0; + self.classtype = CT_ARMOR1; + self.items2 = IT2_ARMOR1; + self.armortype = ARMOR_GRN_TYPE; + self.armorvalue = ARMOR_GRN_VALUE; + self.respawn_effect = TRUE; + self.respawn_style = PARTICLE_BURST_GREEN + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + item_armor_setup(); +}; + +/*====================================================================== +/*QUAKED item_armor2 (0 0.5 0.8) (-16 -16 0) (16 16 56) x BLUESKIN x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/armour.mdl"); } +Yellow Armour with 150 points of protection +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BLUESKIN : Display a blue skin instead +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Yellow Armour with 150 points of protection + +======================================================================*/ +void() item_armor2 = +{ + self.mdl = "progs/ad171/armour.mdl"; + precache_model (self.mdl); + self.classtype = CT_ARMOR2; + self.items2 = IT2_ARMOR2; + self.armortype = ARMOR_YEL_TYPE; + self.armorvalue = ARMOR_YEL_VALUE; + self.respawn_effect = TRUE; + self.respawn_ofs = '0 0 24'; + + // Setup alternative colour + if (self.spawnflags & ARMOR_BLUE) { + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_RING; + self.skin = 3; + } + else { + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_RING; + self.skin = 1; + } + + item_armor_setup(); +}; + +/*====================================================================== +/*QUAKED item_armorInv (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/armour.mdl"); } +Red Armour with 200 points of protection +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Red Armour with 200 points of protection + +======================================================================*/ +void() item_armorInv = +{ + self.mdl = "progs/ad171/armour.mdl"; + precache_model (self.mdl); + self.skin = 2; + self.classtype = CT_ARMORINV; + self.items2 = IT2_ARMOR3; + self.armortype = ARMOR_RED_TYPE; + self.armorvalue = ARMOR_RED_VALUE; + self.respawn_effect = TRUE; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + item_armor_setup(); +}; + +/*====================================================================== + Deathmatch Weapon Rules +======================================================================*/ +float(float w) DM_RankForWeapon = +{ + if (w == IT_LIGHTNING) return 1; + if (w == IT_ROCKET_LAUNCHER) return 2; + if (w == IT_SUPER_NAILGUN) return 3; + if (w == IT_GRENADE_LAUNCHER) return 4; + if (w == IT_SUPER_SHOTGUN) return 5; + if (w == IT_NAILGUN) return 6; + return 7; // Axe +}; + +//---------------------------------------------------------------------- +void(float new) DM_Weapon = +{ + local float oldrank, newrank; + +// change self.weapon if desired + oldrank = DM_RankForWeapon (self.weapon); + newrank = DM_RankForWeapon (new); + if ( newrank < oldrank ) self.weapon = new; +}; + +//---------------------------------------------------------------------- +void(entity targ) bound_other_ammo = +{ + if (targ.ammo_shells > AMMO_MAXSHELLS) targ.ammo_shells = AMMO_MAXSHELLS; + if (targ.ammo_nails > AMMO_MAXNAILS) targ.ammo_nails = AMMO_MAXNAILS; + if (targ.ammo_rockets > AMMO_MAXROCKETS) targ.ammo_rockets = AMMO_MAXROCKETS; + if (targ.ammo_cells > AMMO_MAXCELLS) targ.ammo_cells = AMMO_MAXCELLS; + if (targ.ammo_bolts > 100) targ.ammo_bolts = 100; + if (targ.ammo_poison > 100) targ.ammo_poison = 100; + if (targ.ammo_lava_nails > 200) targ.ammo_lava_nails = 200; + if (targ.ammo_multi_rockets > 100) targ.ammo_multi_rockets = 100; + if (targ.ammo_plasma > 100) targ.ammo_plasma = 100; +}; + +//---------------------------------------------------------------------- +/*void() weapon_touch = +{ + local float pickupweapon, pickupammo, moditem; + + //---------------------------------------------------------------------- + if (self.classtype == CT_UPGRADE_AXE) { + pickupweapon = IT_UPGRADE_AXE; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.moditems & pickupweapon) return; + // Update serverflag and highlight as MOD weapon + update_configflag(SVR_UPDAXE, TRUE); + moditem = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SHOTGUN) { + pickupweapon = IT_SHOTGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_shells > AMMO_MAXSHELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_SHELLS_WPN; + } + else pickupammo = AMMO_SHELLS_WPN; + other.ammo_shells = other.ammo_shells + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_UPGRADE_SSG) { + pickupweapon = IT_UPGRADE_SSG; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.moditems & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.moditems & pickupweapon) { + if (other.ammo_shells > AMMO_MAXSHELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_SHELLS_WPN; + } + else pickupammo = AMMO_SHELLS_WPN; + other.ammo_shells = other.ammo_shells + pickupammo; + // Update serverflag and highlight as MOD weapon + update_configflag(SVR_UPDSSG, TRUE); + moditem = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SUPER_SHOTGUN) { + pickupweapon = IT_SUPER_SHOTGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_shells > AMMO_MAXSHELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_SHELLS_WPN; + } + else pickupammo = AMMO_SHELLS_WPN; + other.ammo_shells = other.ammo_shells + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_NAILGUN) { + pickupweapon = IT_NAILGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_nails > AMMO_MAXNAILS*0.5) pickupammo = 0; + else pickupammo = AMMO_NAILS_WPN; + } + else pickupammo = AMMO_NAILS_WPN; + other.ammo_nails = other.ammo_nails + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SUPER_NAILGUN) { + pickupweapon = IT_SUPER_NAILGUN; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_nails > AMMO_MAXNAILS*0.5) pickupammo = 0; + else pickupammo = AMMO_NAILS_WPN; + } + else pickupammo = AMMO_NAILS_WPN; + other.ammo_nails = other.ammo_nails + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_GRENADE_LAUNCHER) { + pickupweapon = IT_GRENADE_LAUNCHER; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_rockets > AMMO_MAXROCKETS*0.5) pickupammo = 0; + else pickupammo = AMMO_ROCKETS_WPN; + } + else pickupammo = AMMO_ROCKETS_WPN; + other.ammo_rockets = other.ammo_rockets + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_ROCKET_LAUNCHER) { + pickupweapon = IT_ROCKET_LAUNCHER; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_rockets > AMMO_MAXROCKETS*0.5) pickupammo = 0; + else pickupammo = AMMO_ROCKETS_WPN; + } + else pickupammo = AMMO_ROCKETS_WPN; + other.ammo_rockets = other.ammo_rockets + pickupammo; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_UPGRADE_LG) { + pickupweapon = IT_UPGRADE_LG; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.moditems & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.moditems & pickupweapon) { + if (other.ammo_cells > AMMO_MAXCELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_CELLS_WPN; + } + else pickupammo = AMMO_CELLS_WPN; + other.ammo_cells = other.ammo_cells + pickupammo; + // Update serverflag and highlight as MOD weapon + update_configflag(SVR_UPDLG, TRUE); + moditem = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_LIGHTNING) { + pickupweapon = IT_LIGHTNING; + // Deathmatch players cannot constantly pickup weapons + if (deathmatch > 0 && other.items & pickupweapon) return; + // Coop players can use weapon spawns as ammo dispensers + if (coop > 0 && other.items & pickupweapon) { + if (other.ammo_cells > AMMO_MAXCELLS*0.5) pickupammo = 0; + else pickupammo = AMMO_CELLS_WPN; + } + else pickupammo = AMMO_CELLS_WPN; + other.ammo_cells = other.ammo_cells + pickupammo; + } + //---------------------------------------------------------------------- + else return; + + if (self.classtype == CT_UPGRADE_AXE && other.moditems & IT_UPGRADE_AXE) + sprint (other, "You got another axe to grind\n"); + else if (self.classtype == CT_SUPER_SHOTGUN && other.moditems & IT_UPGRADE_SSG) + sprint (other, "You got a handful of Shells\n"); + else if (self.classtype == CT_UPGRADE_SSG && other.moditems & IT_UPGRADE_SSG) + sprint (other, "You got triple barrel boomstick\n"); + else if (self.classtype == CT_LIGHTNING && other.moditems & IT_UPGRADE_LG) + sprint (other, "You got some AAA batteries\n"); + else if (self.classtype == CT_UPGRADE_LG && other.moditems & IT_UPGRADE_LG) + sprint (other, "You got another burst of plasma\n"); + else { + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + } + // weapon touch sound + sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Make sure no ammo is over limits + bound_other_ammo (other); + + // Stop the player switching to weapons already got + if (deathmatch > 0) { + // Check for new shadow axe and SG and skip weapon switch + if (moditem && pickupweapon == IT_UPGRADE_AXE && other.moditems & pickupweapon) pickupweapon = FALSE; + else if (pickupweapon == IT_SHOTGUN && other.items & pickupweapon) pickupweapon = FALSE; + // Stop switching to a lower tier weapon (DM Rules) + // if (DM_RankForWeapon(other.weapon) < DM_RankForWeapon(new)) new = FALSE; + } + + // Skip any weapon switch if no new weapon + if (pickupweapon != FALSE) { + // change to the weapon and add to inventory + other.items = other.items | pickupweapon; + if (moditem) other.moditems = other.moditems | pickupweapon; + + // Check for best weapon (DM only) and switch to it! + if (deathmatch) DM_Weapon (other.weapon, pickupweapon); + else other.weapon = pickupweapon; + W_SetCurrentAmmo(other); + } + + // Setup respawn for co-op + if (coop > 0 && self.respawn_time > 0) { + self.respawn_time = RESPAWN_COOP; + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); + // Triggers events work once in co-op + if (coop > 0) { self.target = ""; self.target2 = ""; } +}; +*/ +/*====================================================================== + WEAPONS +======================================================================*/ +void() weapon_start = +{ + self.classgroup = CG_WEAPON; + self.touch2 = weapon_touch; + self.bbmins = VEC_WPNS_MIN; + self.bbmaxs = VEC_WPNS_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_WEAPON; + + item_start (); +}; + +/*====================================================================== +/*QUAKED weapon_upgrade_axe (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shadaxe.mdl"); } +Shadow Axe, extra dmg and gib zombies +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Shadow Axe, extra dmg and gib zombies + +======================================================================*/ +void() weapon_upgrade_axe = +{ + self.mdl = MODEL_GWEAP_UPAXE; + precache_model (self.mdl); + self.weapon = IT_UPGRADE_AXE; + self.skin = 4; + self.classtype = CT_UPGRADE_AXE; + self.netname = "Shadow Axe"; + if (self.upgrade_axe != 0) self.upgrade_axe = FALSE; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_upgrade_ssg (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shot3.mdl"); } +The Widowmaker Shotgun, extra dmg, triple shot +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +The Widowmaker Shotgun, extra dmg, triple shot + +======================================================================*/ +void() weapon_upgrade_ssg = +{ + self.mdl = MODEL_GWEAP_UPSSG; + precache_model (self.mdl); + self.weapon = IT_UPGRADE_SSG; + self.classtype = CT_UPGRADE_SSG; + self.netname = "Widowmaker Shotgun"; + if (self.upgrade_ssg != 0) self.upgrade_ssg = FALSE; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_shells = world.deventity.ammo_shells + AMMO_SHELLS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_upgrade_lg (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_plasma.mdl"); } +The Plasma Gun, direct & splashdamage +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +The Plasma Gun, direct & splashdamage + +======================================================================*/ +void() weapon_upgrade_lg = +{ + self.mdl = MODEL_GWEAP_UPLG; + precache_model (self.mdl); + self.weapon = IT_UPGRADE_LG; + self.classtype = CT_UPGRADE_LG; + self.netname = "Plasma Gun"; + if (self.upgrade_lg != 0) self.upgrade_lg = FALSE; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_cells = world.deventity.ammo_cells + AMMO_CELLS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_shotgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shotgun.mdl"); } +Single barrel Shotgun +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Single barrel Shotgun + +======================================================================*/ +void() weapon_shotgun = +{ + self.mdl = MODEL_GWEAP_SG; + precache_model (self.mdl); + self.weapon = IT_SHOTGUN; + self.classtype = CT_SHOTGUN; + self.netname = "Sawn-off Shotgun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_shells = world.deventity.ammo_shells + AMMO_SHELLS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_supershotgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_shot.mdl"); } +Super Shotgun +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Super Shotgun + +======================================================================*/ +void() weapon_supershotgun = +{ + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + if (query_configflag(SVR_UPDSSG)) { weapon_upgrade_ssg(); return; } + + self.mdl = MODEL_GWEAP_SSG; + precache_model (self.mdl); + precache_model (MODEL_GWEAP_UPSSG); // New Shotgun (pre-cache) + self.weapon = IT_SUPER_SHOTGUN; + self.classtype = CT_SUPER_SHOTGUN; + self.netname = "Double-barrelled Shotgun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_shells = world.deventity.ammo_shells + AMMO_SHELLS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_nailgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_nail.mdl"); } +Perforator (Nailgun) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Perforator (Nailgun) + +======================================================================*/ +void() weapon_nailgun = +{ + self.mdl = MODEL_GWEAP_NG; + precache_model (self.mdl); + self.weapon = IT_NAILGUN; + self.classtype = CT_NAILGUN; + self.netname = "Nailgun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_nails = world.deventity.ammo_nails + AMMO_NAILS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_supernailgun (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_nail2.mdl"); } +Super Perforator (Super Nailgun) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Super Perforator (Super Nailgun) + +======================================================================*/ +void() weapon_supernailgun = +{ + self.mdl = MODEL_GWEAP_SNG; + precache_model (self.mdl); + self.weapon = IT_SUPER_NAILGUN; + self.classtype = CT_SUPER_NAILGUN; + self.netname = "Super Nailgun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_nails = world.deventity.ammo_nails + AMMO_NAILS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_grenadelauncher (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_rock.mdl"); } +Grenade Launcher +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Grenade Launcher + +======================================================================*/ +void() weapon_grenadelauncher = +{ + self.mdl = MODEL_GWEAP_GL; + precache_model (self.mdl); + self.weapon = IT_GRENADE_LAUNCHER; + self.classtype = CT_GRENADE_LAUNCHER; + self.netname = "Grenade Launcher"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_rockets = world.deventity.ammo_rockets + AMMO_ROCKETS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_rocketlauncher (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_rock2.mdl"); } +Rocket Launcher +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Rocket Launcher + +======================================================================*/ +void() weapon_rocketlauncher = +{ + self.mdl = MODEL_GWEAP_RL; + precache_model (self.mdl); + self.weapon = IT_ROCKET_LAUNCHER; + self.classtype = CT_ROCKET_LAUNCHER; + self.netname = "Rocket Launcher"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_rockets = world.deventity.ammo_rockets + AMMO_ROCKETS_WPN; + weapon_start(); +}; + +/*====================================================================== +/*QUAKED weapon_lightning (0 0.5 0.8) (-16 -16 0) (16 16 56) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/g_light.mdl"); } +Thunderbolt Cannon +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Thunderbolt Cannon + +======================================================================*/ +void() weapon_lightning = +{ + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + if (query_configflag(SVR_UPDLG)) { weapon_upgrade_lg(); return; } + + self.mdl = MODEL_GWEAP_LG; + precache_model (self.mdl); + self.weapon = IT_LIGHTNING; + self.classtype = CT_LIGHTNING; + self.netname = "Thunderbolt"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_cells = world.deventity.ammo_cells + AMMO_CELLS_WPN; + weapon_start(); +}; + +/*====================================================================== + AMMO +======================================================================*/ +/*void() ammo_touch = +{ + local float best; + + //---------------------------------------------------------------------- + if (self.classtype == CT_AMMOSHELLS) { + if (other.ammo_shells >= AMMO_MAXSHELLS) return; + other.ammo_shells = other.ammo_shells + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMONAILS) { + if (other.ammo_nails >= AMMO_MAXNAILS) return; + other.ammo_nails = other.ammo_nails + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOROCKETS) { + if (other.ammo_rockets >= AMMO_MAXROCKETS) return; + other.ammo_rockets = other.ammo_rockets + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOCELLS) { + if (other.ammo_cells >= AMMO_MAXCELLS) return; + other.ammo_cells = other.ammo_cells + self.aflag; + } + + // Check/cap ammo limits + bound_other_ammo (other); + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // if the player was using his best weapon, + // change up to the new one if better + best = W_BestWeapon(other); + + // change to a better weapon if appropriate + if ( other.weapon == best ) { + other.weapon = W_BestWeapon(other); + W_SetCurrentAmmo (other); + } + + // if changed current ammo, update it + W_SetCurrentAmmo(other); + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; +*/ +/*====================================================================== + Setup all Ammo with global parameters +======================================================================*/ +void() item_ammo_setup = +{ + self.frame = 0; + self.touch2 = ammo_touch; + self.classgroup = CG_AMMOITEM; + self.bbmins = VEC_AMMO_MIN; + self.bbmaxs = VEC_AMMO_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_AMMO; + + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + // Move the new centered ammo models to match old ammo origin + // The default is to move all ammo items to suit original id maps + if (!query_configflag(SVR_ITEMOFFSET)) { + self.oldorigin = self.origin + '16 16 0'; + setorigin(self, self.oldorigin); + } + + // Override the world theme skin type + if (self.skin_override > 0 && self.skin_override < 3) + self.skin = self.skin_override - 1; + // Switch to medieval (wood) skin for medieval/metal theme maps + else if (world.worldtype < 2) self.skin = 1; + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + // Setup lid attachment entity (defined in item setup) + if (self.spawnflags & A_LID) { + self.attachment = spawn(); + self.attachment.owner = self; + setorigin(self.attachment, self.origin); + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + } + + // Check for coop errors + item_coopcheck(); + item_start (); +}; + +/*====================================================================== +/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_shells (0 .5 .8) (-16 -16 0) (16 16 32) BIG LID x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/ammo_shells0.mdl"); } +20 or 40 Shells +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for LID (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +LID : Extra LID model positioned with box +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +20 or 40 Shells for the Shotgun (SG), SuperShotgun (SSG) and Upgrade + +======================================================================*/ +void() item_shells = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ad171/ammo_shells1.mdl"; + self.headmdl = "progs/ad171/ammo_lidlarge.mdl"; + if (self.aflag < 1) self.aflag = AMMO_SHELLS_LGR; + } + else { + self.mdl = "progs/ad171/ammo_shells0.mdl"; + self.headmdl = "progs/ad171/ammo_lidsmall.mdl"; + if (self.aflag < 1) self.aflag = AMMO_SHELLS_SML; + } + self.ammo_shells = self.aflag; + + precache_model (self.mdl); + precache_model (self.headmdl); + self.classtype = CT_AMMOSHELLS; + self.netname = "box of shells"; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = FALSE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_spikes (0 .5 .8) (-16 -16 0) (16 16 32) BIG LID x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/ammo_nails0.mdl"); } +25 or 50 Spikes +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for LID (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +LID : Extra LID model positioned with box +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +25 or 50 Spikes for the Perforator (NG) and Super Perforator (SNG) + +======================================================================*/ +void() item_spikes = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ad171/ammo_nails1.mdl"; + self.headmdl = "progs/ad171/ammo_lidlarge.mdl"; + if (self.aflag < 1) self.aflag = AMMO_NAILS_LGR; + } + else { + self.mdl = "progs/ad171/ammo_nails0.mdl"; + self.headmdl = "progs/ad171/ammo_lidsmall.mdl"; + if (self.aflag < 1) self.aflag = AMMO_NAILS_SML; + } + self.ammo_nails = self.aflag; + precache_model (self.mdl); + precache_model (self.headmdl); + self.classtype = CT_AMMONAILS; + self.netname = "box of nails"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = FALSE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_rockets (0 .5 .8) (-16 -16 0) (16 16 32) BIG x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/ammo_rockets0.mdl"); } +5 or 10 Rockets +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for box of ammo (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +5 or 10 Rockets for the Grenade (GL) or Rocket Launcher (RL) + +======================================================================*/ +void() item_rockets = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ad171/ammo_rockets1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_ROCKETS_LGR; + } + else { + self.mdl = "progs/ad171/ammo_rockets0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_ROCKETS_SML; + } + self.ammo_rockets = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOROCKETS; + self.netname = "box of rockets"; + self.spawnflags = self.spawnflags - (self.spawnflags & A_LID); + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = TRUE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_cells (0 .5 .8) (-16 -16 0) (16 16 32) BIG x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/ammo_battery0.mdl"); } +6 or 12 Medieval Battery +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +6 or 12 Medieval Battery (cells) for the Thunderbolt (LG) + +======================================================================*/ +void() item_cells = +{ + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ad171/ammo_battery1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_LGR; + } + else { + self.mdl = "progs/ad171/ammo_battery0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_SML; + } + self.ammo_cells = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOCELLS; + self.netname = "battery"; + self.spawnflags = self.spawnflags - (self.spawnflags & A_LID); + self.respawn_style = PARTICLE_BURST_GREEN + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + self.frame_override = FALSE; + item_ammo_setup(); +}; + +/*====================================================================== + KEYS (Silver, Gold and Custom) +======================================================================*/ +void() key_touchbindmsg = +{ + sound (self.enemy, CHAN_VOICE, SOUND_TALK, 1, ATTN_NORM); + centerprint(self.enemy, "Press 'i' Key to open Inventory\nTo see what \bArcane keys\b you have!\n"); +}; + + +void() key_touch = +{ + // Check if the player has the custom key already? + if (self.classtype == CT_CUSTOMKEY) { + if (other.moditems & self.moditems) return; + } + else { + // Check if the player has the silver/gold key already? + if ( other.items & self.items ) return; + } + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Add key to player inventory (items / customkey) + if (self.moditems > 0) { + other.moditems = other.moditems | self.moditems; + // Store the key netname on the player/client for door ref later + if (self.moditems & IT_CKEY1) other.ckeyname1 = self.netname; + else if (self.moditems & IT_CKEY2) other.ckeyname2 = self.netname; + else if (self.moditems & IT_CKEY3) other.ckeyname3 = self.netname; + else other.ckeyname4 = self.netname; + } + // Add silver/gold key to player inventory + else other.items = other.items | self.items; + + // Setup respawn for co-op + if (coop > 0 && self.respawn_time > 0) { + self.respawn_time = RESPAWN_COOP; + self.spawnflags = self.spawnflags | ITEM_RESPAWN; + } + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); + // Triggers events work once in co-op + if (coop > 0) self.target = ""; + + // Warn player about new key binding for inventory (first time only) + if (self.moditems > 0 && other.ckeyhint == FALSE) { + self.enemy = other; // Store for later + other.ckeyhint = TRUE; // Only works once + self.think = key_touchbindmsg; + self.nextthink = time + 3; + } +}; + +//---------------------------------------------------------------------- +void() key_setup = +{ + if (self.noise == "") { + if (self.worldtype == 1) self.noise = "misc/runekey.wav"; + else if (self.worldtype == 2) self.noise = "misc/basekey.wav"; + else self.noise = "misc/medkey.wav"; + } + precache_sound (self.noise); + + self.touch2 = key_touch; + self.classgroup = CG_KEY; + self.bbmins = VEC_KEYS_MIN; + self.bbmaxs = VEC_KEYS_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_KEY; + + // Check for coop errors + item_coopcheck(); + item_start(); +}; + +/*====================================================================== +/*QUAKED item_key1 (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/key_silver.mdl"); } +SILVER key, changes based on worldtype on worldspawn +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +SILVER key, changes based on worldtype on worldspawn + +======================================================================*/ +void() item_key1 = +{ + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + if (self.worldtype == 0) { + self.mdl = "progs/ad171/key_medieval.mdl"; // progs/w_s_key.mdl + self.netname = "silver key"; + } + else if (self.worldtype == 1) { + self.mdl = "progs/ad171/key_runic.mdl"; // progs/m_s_key.mdl + self.netname = "silver runekey"; + } + else if (self.worldtype == 2) { + self.mdl = "progs/ad171/key_base.mdl"; // progs/b_s_key.mdl + self.netname = "silver keycard"; + } + + precache_model (self.mdl); + self.skin = 2; + self.items = IT_KEY1; + self.classtype = CT_SILVERKEY; + self.part_active = PARTICLE_STYLE_KEYSILVER; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 20'; + key_setup(); +}; + +/*====================================================================== +/*QUAKED item_key2 (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/key_gold.mdl"); } +GOLD key, changes based on worldtype on worldspawn +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +GOLD key, changes based on worldtype on worldspawn + +======================================================================*/ +void() item_key2 = +{ + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + if (self.worldtype == 0) { + self.mdl = "progs/ad171/key_medieval.mdl"; // progs/w_g_key.mdl + self.netname = "gold key"; + } + if (self.worldtype == 1) { + self.mdl = "progs/ad171/key_runic.mdl"; // progs/m_g_key.mdl + self.netname = "gold runekey"; + } + if (self.worldtype == 2) { + self.mdl = "progs/ad171/key_base.mdl"; // progs/b_g_key.mdl + self.netname = "gold keycard"; + } + + precache_model (self.mdl); + self.skin = 6; + self.items = IT_KEY2; + self.classtype = CT_GOLDKEY; + self.part_active = PARTICLE_STYLE_KEYGOLD; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 20'; + key_setup(); +}; + +/*====================================================================== +/*QUAKED item_keyx (0 .5 .8) (-16 -16 -24) (16 16 32) CKEY1 CKEY2 CKEY3 CKEY4 RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/key_medieval.mdl"); } +Custom key +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +mdl : model name to load/display (progs/model.mdl) +netname : XXX Part of pickup string "You got the XXX" +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +Ckey1 : Custom Key type 1 +Ckey2 : Custom Key type 2 +Ckey3 : Custom Key type 3 +Ckey4 : Custom Key type 4 +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Custom key + +======================================================================*/ +void() item_keyx = +{ + // Check for any self worldtype override + if (!self.worldtype) self.worldtype = world.worldtype; + + // Can't have a custom key without a custom model!?! + if (self.mdl == "") { + dprint("\b[CUSTOM KEY]\b Missing model\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + precache_model (self.mdl); + + // Setup custom key reference number (must exist) + if (self.spawnflags & ITEM_CKEY2) self.moditems = IT_CKEY2; + else if (self.spawnflags & ITEM_CKEY3) self.moditems = IT_CKEY3; + else if (self.spawnflags & ITEM_CKEY4) self.moditems = IT_CKEY4; + else self.moditems = IT_CKEY1; + + self.classtype = CT_CUSTOMKEY; + if (self.netname == "") self.netname = "custom key"; + self.items = IT_KEY1 | IT_KEY2; + if (self.exactskin > 0) self.skin = self.exactskin; + + // Check for any AD defined particle effects + if (self.message2 == "KEYGOLD") self.part_active = PARTICLE_STYLE_KEYGOLD; + else if (self.message2 == "KEYSILVER") self.part_active = PARTICLE_STYLE_KEYSILVER; + else if (self.message2 == "KEYRED") self.part_active = PARTICLE_STYLE_KEYRED; + else if (self.message2 == "KEYGREEN") self.part_active = PARTICLE_STYLE_KEYGREEN; + else if (self.message2 == "KEYPURPLE") self.part_active = PARTICLE_STYLE_KEYPURPLE; + else if (self.message2 == "KEYWHITE") self.part_active = PARTICLE_STYLE_KEYWHITE; + else self.part_active = 0; + + // Default respawn parameters, clear message2 just in case + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_CENTER; + if (!self.respawn_ofs) self.respawn_ofs = '0 0 20'; + self.message2 = ""; + + key_setup(); +}; + +/*====================================================================== +/*QUAKED item_custom (0 .5 .8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/key_base.mdl"); } +Custom Pickup Item +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +mdl : model name to load/display (progs/model.mdl) +netname : XXX Part of pickup string "You got the XXX" +noise1 : Custom pickup sound (def=weapons/lock4.wav) +pos1 : Pickup bounding box minimum (def=-16 -16 -24) +pos2 : Pickup bounding box maximum (def=16 16 32) +bodyfadeaway : Model will fade away on pickup +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +part_active : = 1 Enable particle burst on pickup +part_ofs : Particle Origin Offset (def='0 0 0') +part_tcount : Particle Quantity (def=20) +part_life : Particle Life Time (def=2s) +part_style : 1=yellow, 2=green, 3=red, 4=blue, 5=purple, 6=fire, 7=white +part_movetype : 2=center, 3=up, 4=shockwave, 5=skull, 6=lost, 7=minotaur +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Custom Pickup Item + +======================================================================*/ +void() item_custom_touch = +{ + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Check for a particle pickup burst (can be blocked) + if (self.part_style > 0 && !(self.spawnflags & ITEM_NOEFFECTS)) + misc_particle_burst_use(); + + // Once only, fade away function + if (self.bodyfadeaway == TRUE) { + self.use = self.touch = SUB_Null; + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; + self.wait = self.delay = 0; + } + else { + // Do not remove/respawn in co-op + if (!coop) { + item_finished(); + check_item_respawn(); + } + } + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_custom = +{ + if (self.mdl == "") self.mdl = MODEL_BROKEN; + if (self.noise == "") self.noise = "weapons/lock4.wav"; + precache_model (self.mdl); + precache_sound (self.noise); + + self.classtype = CT_CUSTOMITEM; + // Essentially this item is used like a key + // pickup, collect and trigger an event + self.classgroup = CG_KEY; + if (self.netname == "") self.netname = "Custom Item"; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_KEY; + + // Check for a particle burst setup + if (self.part_active == TRUE) misc_particle_burst_setup(); + self.part_active = 0; // Must clear this afterward + + // Setup random rotation, will be ignored if spinning model + if (self.angles_y == 0 && query_configflag(SVR_ITEMROTATE) == FALSE ) + self.angles_y = rint(random()*359); + + // Setup different skin options + if (self.exactskin > 0) self.skin = self.exactskin; + else if (self.randomskin > 1) self.skin = rint(random()*(self.randomskin-1)); + if (self.skin < 0) self.skin = 0; // Double check no negatives + + self.touch2 = item_custom_touch; + if (CheckZeroVector(self.pos1)) self.bbmins = VEC_KEYS_MIN; + else self.bbmins = self.pos1; + if (CheckZeroVector(self.pos2)) self.bbmaxs = VEC_KEYS_MAX; + else self.bbmaxs = self.pos2; + + item_start(); +}; + +/*====================================================================== +/*QUAKED item_sigil (0 0.5 0.8) (-16 -16 -24) (16 16 32) Ep1 Ep2 Ep3 Ep4 RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/key_rune1.mdl"); } +End of episode sigil / rune +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +EP1 : Episode 1 Rune +EP2 : Episode 2 Rune +EP3 : Episode 3 Rune +EP4 : Episode 4 Rune +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +End of episode sigil. If the player is in possession of a sigil, then the next time +the player changes levels, all func_episodegate entities for that episode will appear. +This is used to block access to slipgates that lead to episodes that the player has +already completed. If the player is in possession of the item_sigil for all four +episodes, then the func_bossgate entity will NOT appear. This is used to grant +access to the final boss once the player has completed all episodes. + +======================================================================*/ +void() sigil_touch = +{ + if (query_configflag(self.customkey)) return; + + centerprint (other, "You got the rune!"); + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Add rune to server! not player + update_configflag(self.customkey, TRUE); + + // DP has special effect for sigil being picked up + if (ext_dppart) pointparticles(particleeffectnum(DPP_SIGILPICKUP), self.origin, '0 0 0', 1); + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + // This odd classname assignment does nothing, old code + //self.classname = string_null; + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_sigil = +{ + if (!self.spawnflags) { + dprint("\b[SIGIL]\b No Rune type selected!?!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Based on what spawn key is selected, update model/spawnflag + // This will make sure only one rune is selected at once + // Also allow for the spawnflags to have other parameters + if (self.spawnflags & SVR_RUNE_KEY1) { + self.mdl = "progs/ad171/key_rune1.mdl"; + self.customkey = SVR_RUNE_KEY1; + } + else if (self.spawnflags & SVR_RUNE_KEY2) { + self.mdl = "progs/ad171/key_rune2.mdl"; + self.customkey = SVR_RUNE_KEY2; + } + else if (self.spawnflags & SVR_RUNE_KEY3) { + self.mdl = "progs/ad171/key_rune3.mdl"; + self.customkey = SVR_RUNE_KEY3; + } + else if (self.spawnflags & SVR_RUNE_KEY4) { + self.mdl = "progs/ad171/key_rune4.mdl"; + self.customkey = SVR_RUNE_KEY4; + } + + precache_model (self.mdl); + if (self.noise == "") self.noise = "misc/runekey.wav"; + precache_sound (self.noise); + + self.touch2 = sigil_touch; + self.classtype = CT_RUNEKEY; + self.classgroup = CG_RUNE; + self.part_active = PARTICLE_STYLE_SIGIL; + self.bbmins = VEC_KEYS_MIN; + self.bbmaxs = VEC_KEYS_MAX; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_RUNE; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + + // Check for coop errors + item_coopcheck(); + item_start(); +}; + +/*====================================================================== +/*QUAKED item_artifact_tomeofpower (0 .5 .8) (-16 -16 -24) (16 16 32) x x x x x FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/key_tome.mdl"); } +Custom event trigger +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : trigger targets to fire when item touched +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +noise : Custom pickup sound +-------- SPAWNFLAGS -------- +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Custom event trigger + +======================================================================*/ +void() tomeofpower_touch = +{ + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // This is a trigger once condition (regardless of coop) + item_finished(); + + activator = other; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() item_artifact_tomeofpower = +{ + self.mdl = "progs/ad171/artifact_tome.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "misc/medkey.wav"; + precache_sound (self.noise); + + self.classtype = CT_ARTTOME; + self.classgroup = CG_ARTIFACT; + self.moditems = IT_ARTTOME; + self.netname = "Tome of Power"; + + self.touch2 = tomeofpower_touch; + self.bbmins = VEC_POWR_MIN; + self.bbmaxs = VEC_POWR_MAX; + self.part_active = PARTICLE_STYLE_TOMEOFP; + item_start(); +}; + +/*====================================================================== + setup all artifacts with similiar configurations +======================================================================*/ +void() artifact_setup = +{ + self.touch2 = artifact_touch; + self.classgroup = CG_ARTIFACT; + self.bbmins = VEC_POWR_MIN; + self.bbmaxs = VEC_POWR_MAX; + + // Allow for custom artifact timer + if (self.cnt < 1) self.cnt = POWERUP_TIMER; + + // Setup skin override + if (self.exactskin < 1) self.exactskin = 0; + self.skin = self.exactskin; + + // Setup artifact default respawn timers + if (self.respawn_time == 0) { + if (self.classtype == CT_ARTPENT || self.classtype == CT_ARTINVS || + self.classtype == CT_ARTSHARP || self.classtype == CT_ARTPIERCE ) + self.respawn_time = RESPAWN_ARTIFACT2; + else self.respawn_time = RESPAWN_ARTIFACT1; + } + + item_start (); +}; + +/*====================================================================== +/*QUAKED item_artifact_envirosuit (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_envsuit.mdl"); } +Player takes no damage from water or slime for 30 seconds +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +exactskin : 0=Original, 1=Green, 2=Brown, 3=Aqua, 4=Blue +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player takes no damage from water or slime for 30 seconds +Immume from Wraith Healing Debuff but take small damage instead + +======================================================================*/ +void() item_artifact_envirosuit = +{ + // cshifts 0,255,0,20 + self.mdl = "progs/ad171/artifact_envsuit.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTSUIT1; + self.noise1 = SOUND_ARTSUIT2; + precache_sound (self.noise); + precache_sound (self.noise1); + self.netname = "Environment Suit"; + self.items = IT_SUIT; + self.classtype = CT_ARTSUIT; + self.part_active = PARTICLE_STYLE_SUIT; + self.respawn_style = PARTICLE_BURST_GREEN + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 28'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_wetsuit (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_wetsuit.mdl"); } +Player takes no damage from water for 5 mins (300s) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +exactskin : 0=Original, 1=Green, 2=Brown, 3=Aqua, 4=Blue +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 300s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player takes no damage from water for 5 mins (300s) +Immume from Wraith Healing Debuff but take small damage instead + +======================================================================*/ +void() item_artifact_wetsuit = +{ + // cshifts 0,255,0,20 + self.mdl = "progs/ad171/artifact_wetsuit.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTWETS1; + self.noise1 = SOUND_ARTWETS2; + self.noise2 = SOUND_ARTWETS3; + self.noise3 = SOUND_ARTWETS3B; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + self.netname = "Wet Suit"; + self.items = 0; + self.moditems = IT_ARTWETSUIT; + self.classtype = CT_ARTWETSUIT; + self.part_active = PARTICLE_STYLE_WETSUIT; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 28'; + if (self.cnt < 1) self.cnt = 300; + if (self.exactskin < 1) self.exactskin = 4; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_invulnerability (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_pent.mdl"); } +Player is invulnerable for 30 seconds +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player is invulnerable for 30 seconds +Immume from Wraith Healing Debuff + +======================================================================*/ +void() item_artifact_invulnerability = +{ + // cshifts 255,255,0,30 + self.mdl = "progs/ad171/artifact_pent.mdl"; // Originally - progs/invulner.mdl + precache_model (self.mdl); + self.noise = SOUND_ARTPENT1; + self.noise1 = SOUND_ARTPENT2; + self.noise2 = SOUND_ARTPENT3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Pentagram of Protection"; + self.items = IT_INVULNERABILITY; + self.classtype = CT_ARTPENT; + self.part_active = PARTICLE_STYLE_PENT; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_invisibility (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_invis.mdl"); } +Player is invisible for 30 seconds +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Player is invisible for 30 seconds + +======================================================================*/ +void() item_artifact_invisibility = +{ + // cshifts 100,100,100,100 + self.mdl = "progs/ad171/artifact_invis.mdl"; // Originally - progs/invisibl.mdl + precache_model (self.mdl); + self.noise = SOUND_ARTINV1; + self.noise1 = SOUND_ARTINV2; + self.noise2 = SOUND_ARTINV3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Ring of Shadows"; + self.items = IT_INVISIBILITY; + self.classtype = CT_ARTINVS; + self.part_active = PARTICLE_STYLE_SRING; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 6'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_super_damage (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_quad.mdl"); } +The next attack from the player will do 4x damage +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +The next attack from the player will do 4x damage + +======================================================================*/ +void() item_artifact_super_damage = +{ + // cshifts 0,0,255,30 + self.mdl = "progs/ad171/artifact_quad.mdl"; // Originally - progs/quaddama.mdl + precache_model (self.mdl); + self.noise = SOUND_ARTQUAD1; + self.noise1 = SOUND_ARTQUAD2; + self.noise2 = SOUND_ARTQUAD3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Quad Damage"; + self.items = IT_QUAD; + self.classtype = CT_ARTQUAD; + self.part_active = PARTICLE_STYLE_QUAD; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_sharp_shooter (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_sharp.mdl"); } +Reduces the bullet spread of all Shotguns +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Reduces the bullet spread of all Shotguns + +======================================================================*/ +void() item_artifact_sharp_shooter = +{ + self.mdl = "progs/ad171/artifact_sharp.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTSHARP1; + self.noise1 = SOUND_ARTSHARP2; + self.noise2 = SOUND_ARTSHARP3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Sharp Shooter"; + self.items = IT_QUAD; + self.moditems = IT_ARTSHARP; + self.classtype = CT_ARTSHARP; + self.part_active = PARTICLE_STYLE_SHARP; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +/*====================================================================== +/*QUAKED item_artifact_nail_piercer (0 0.5 0.8) (-16 -16 -24) (16 16 32) x x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/artifact_piercer.mdl"); } +All nail attacks will travel through monsters +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count: Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +cnt : Duration override of artifact (default = 30s) +-------- SPAWNFLAGS -------- +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +All nail attacks will travel through monsters + +======================================================================*/ +void() item_artifact_nail_piercer = +{ + self.mdl = "progs/ad171/artifact_piercer.mdl"; + precache_model (self.mdl); + self.noise = SOUND_ARTNAILP1; + self.noise1 = SOUND_ARTNAILP2; + self.noise2 = SOUND_ARTNAILP3; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Nail Piercer"; + self.items = IT_QUAD; + self.moditems = IT_ARTPIERCE; + self.classtype = CT_ARTPIERCE; + self.part_active = PARTICLE_STYLE_PIERCE; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +//====================================================================== +// ITEM BACKPACKS +// * Dropped from monsters and players +// * Can be setup as an item with random ammo/armour +// * Will monitor ground below so can fall further +// +//====================================================================== +float(entity backent, string backtext1, string backtext2, float backcomma) BackpackText = +{ + if (backcomma > 0) sprint (backent, ", "); + if (backtext1 != "") sprint (backent, backtext1); + if (backtext2 != "") sprint (backent, backtext2); + return 1; +}; + +//---------------------------------------------------------------------- +void() BackpackTouch = +{ + local string s; + local float pickupweapon, acount; + + acount = 0; + sprint (other, "You get "); + + //---------------------------------------------------------------------- + // A Coop player can pickup all of the weapons + // dropped by previous player (go through list) + //---------------------------------------------------------------------- + if (coop > 0) { + if (self.moditems & IT_UPGRADE_AXE && !(other.moditems & IT_UPGRADE_AXE)) { + pickupweapon = IT_UPGRADE_AXE; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "ShadowAxe", "", acount); + other.moditems = other.moditems | pickupweapon; + update_configflag(SVR_UPDAXE, TRUE); + } + + if (self.items & IT_SHOTGUN && !(other.items & IT_SHOTGUN)) { + pickupweapon = IT_SHOTGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "SG", "", acount); + } + + if (self.moditems & IT_UPGRADE_SSG && !(other.moditems & IT_UPGRADE_SSG)) { + pickupweapon = IT_UPGRADE_SSG; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "WidowMaker", "", acount); + other.moditems = other.moditems | pickupweapon; + update_configflag(SVR_UPDSSG, TRUE); + } + else if (self.items & IT_SUPER_SHOTGUN && !(other.items & IT_SUPER_SHOTGUN)) { + pickupweapon = IT_SUPER_SHOTGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "SSG", "", acount); + } + + if (self.items & IT_NAILGUN && !(other.items & IT_NAILGUN)) { + pickupweapon = IT_NAILGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "NG", "", acount); + } + if (self.items & IT_LAVA_NAILGUN && !(other.items & IT_LAVA_NAILGUN)) { + pickupweapon = IT_LAVA_NAILGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "LAVANG", "", acount); + } + if (self.items & IT_SUPER_NAILGUN && !(other.items & IT_SUPER_NAILGUN)) { + pickupweapon = IT_SUPER_NAILGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "SNG", "", acount); + } + if (self.items & IT_LAVA_SUPER_NAILGUN && !(other.items & IT_LAVA_SUPER_NAILGUN)) { + pickupweapon = IT_LAVA_SUPER_NAILGUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "LAVASNG", "", acount); + } + if (self.items & IT_GRENADE_LAUNCHER && !(other.items & IT_GRENADE_LAUNCHER)) { + pickupweapon = IT_GRENADE_LAUNCHER; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "GL", "", acount); + } + if (self.items & IT_MULTI_GRENADE && !(other.items & IT_MULTI_GRENADE)) { + pickupweapon = IT_MULTI_GRENADE; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "MULTIGL", "", acount); + } + if (self.items & IT_ROCKET_LAUNCHER && !(other.items & IT_ROCKET_LAUNCHER)) { + pickupweapon = IT_ROCKET_LAUNCHER; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "RL", "", acount); + } + if (self.items & IT_MULTI_ROCKET && !(other.items & IT_MULTI_ROCKET)) { + pickupweapon = IT_MULTI_ROCKET; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "MULTIRL", "", acount); + } + if (self.items & IT_PLASMA_GUN && !(other.items & IT_PLASMA_GUN)) { + pickupweapon = IT_PLASMA_GUN; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "PLASMALG", "", acount); + } + + if (self.items2 & IT2_PROXIMITY_GUN && !(other.items2 & IT2_PROXIMITY_GUN)) { + pickupweapon = IT2_PROXIMITY_GUN; + other.items2 = other.items2 | pickupweapon; + acount = BackpackText(other, "PROX", "", acount); + } + if (self.items2 & IT2_LASER_CANNON && !(other.items2 & IT2_LASER_CANNON)) { + pickupweapon = IT2_LASER_CANNON; + other.items2 = other.items2 | pickupweapon; + acount = BackpackText(other, "LASERC", "", acount); + } + if (self.items2 & IT2_MJOLNIR && !(other.items2 & IT2_MJOLNIR)) { + pickupweapon = IT2_MJOLNIR; + other.items2 = other.items2 | pickupweapon; + acount = BackpackText(other, "MJOL", "", acount); + } + + if (self.items & IT_EXTRA_WEAPON && !(other.items & IT_EXTRA_WEAPON)) { + pickupweapon = IT_EXTRA_WEAPON; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "XBOW", "", acount); + } + + if (self.moditems & IT_UPGRADE_LG && !(other.moditems & IT_UPGRADE_LG)) { + pickupweapon = IT_UPGRADE_LG; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "PLASMAGUN", "", acount); + other.moditems = other.moditems | pickupweapon; + update_configflag(SVR_UPDLG, TRUE); + } + else if (self.items & IT_LIGHTNING && !(other.items & IT_LIGHTNING)) { + pickupweapon = IT_LIGHTNING; + other.items = other.items | pickupweapon; + acount = BackpackText(other, "LG", "", acount); + } + } + // DM backpacks have only one weapon + else { + // Setup name of weapon first + if (self.items & IT_LIGHTNING && self.moditems & IT_UPGRADE_LG) + self.netname = "Plasma Gun"; + else if (self.items & IT_LIGHTNING) self.netname = "Thunderbolt"; + else if (self.items & IT_ROCKET_LAUNCHER) self.netname = "Rocket Launcher"; + else if (self.items & IT_MULTI_GRENADE) self.netname = "Multi-Grenade Launcher"; + else if (self.items & IT_MULTI_ROCKET) self.netname = "Multi-Rocket Launcher"; + else if (self.items & IT_PLASMA_GUN) self.netname = "Plasma Lightning Gun"; + else if (self.items & IT_GRENADE_LAUNCHER) self.netname = "Grenade Launcher"; + else if (self.items & IT_SUPER_NAILGUN) self.netname = "Super Nailgun"; + else if (self.items & IT_NAILGUN) self.netname = "Nailgun"; + else if (self.items & IT_SUPER_SHOTGUN && self.moditems & IT_UPGRADE_SSG) + self.netname = "Widow Maker Shotgun"; + else if (self.items & IT_SUPER_SHOTGUN) self.netname = "Double-barrelled Shotgun"; + else if (self.items & IT_SHOTGUN) self.netname = "Shotgun"; + else if (self.items & IT_AXE && self.moditems & IT_UPGRADE_AXE) + self.netname = "Shadow Axe"; + else if (self.items & IT_AXE) self.netname = "Axe"; + else self.netname = ""; + + if (self.items2 & IT2_PROXIMITY_GUN) self.netname = "Proximity Gun"; + else if (self.items2 & IT2_LASER_CANNON) self.netname = "Laser Cannon"; + else if (self.items2 & IT2_MJOLNIR) self.netname = "Mjolnir's Hammer"; + + // Check if the player has the weapon already? + if ((other.items & self.items) == 0 && self.netname != "") { + other.items = other.items | self.items; + other.moditems = other.moditems | self.moditems; + acount = BackpackText(other, "the", self.netname, acount); + } + } + + //---------------------------------------------------------------------- + // Calculate random amounts of ammo + //---------------------------------------------------------------------- + if (self.count > 0) { + if (self.spawnflags & BACKPACK_SHELLS) self.ammo_shells = rint(1 + random()*self.count); + if (self.spawnflags & BACKPACK_NAILS) self.ammo_nails = rint(1 + random()*self.count); + if (self.spawnflags & BACKPACK_ROCKETS) self.ammo_rockets = rint(1 + random()*self.count); + if (self.spawnflags & BACKPACK_CELLS) self.ammo_cells = rint(1 + random()*self.count); + if (self.armortype == 1) self.armorvalue = rint(1 + random()*self.count); + } + + //---------------------------------------------------------------------- + // Give ammo to player + //---------------------------------------------------------------------- + if (self.ammo_shells > 0) { + other.ammo_shells = other.ammo_shells + self.ammo_shells; + other.items = other.items | IT_SHELLS; + s = ftos(self.ammo_shells); + acount = BackpackText(other, s, " shells", acount); + } + if (self.ammo_nails > 0) { + other.ammo_nails = other.ammo_nails + self.ammo_nails; + other.items = other.items | IT_NAILS; + s = ftos(self.ammo_nails); + acount = BackpackText(other, s, " nails", acount); + } + if (self.ammo_rockets > 0) { + other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; + other.items = other.items | IT_ROCKETS; + s = ftos(self.ammo_rockets); + acount = BackpackText(other, s, " rockets", acount); + } + if (self.ammo_cells > 0) { + other.ammo_cells = other.ammo_cells + self.ammo_cells; + other.items = other.items | IT_CELLS; + s = ftos(self.ammo_cells); + acount = BackpackText(other, s, " cells", acount); + } + if (self.ammo_plasma > 0) { + other.ammo_plasma = other.ammo_plasma + self.ammo_plasma; + other.items2 = other.items2 | IT2_PLASMA_AMMO; + s = ftos(self.ammo_plasma); + acount = BackpackText(other, s, " plasma", acount); + } + if (self.ammo_lava_nails > 0) { + other.ammo_lava_nails = other.ammo_lava_nails + self.ammo_lava_nails; + other.items2 = other.items2 | IT2_LAVA_NAILS; + s = ftos(self.ammo_lava_nails); + acount = BackpackText(other, s, " lava nails", acount); + } + if (self.ammo_multi_rockets > 0) { + other.ammo_multi_rockets = other.ammo_multi_rockets + self.ammo_multi_rockets; + other.items2 = other.items2 | IT2_MULTI_ROCKETS; + s = ftos(self.ammo_multi_rockets); + acount = BackpackText(other, s, " multi-rockets", acount); + } + + //---------------------------------------------------------------------- + // Check for armor in backpack + //---------------------------------------------------------------------- + if (self.armorvalue > 0 && deathmatch == 0) { + // For coop backpacks can be dropped from players + // These can contain huge amounts of armour and needed + // to be treated as upgrade/replace, not the shard system + if (coop > 0 && self.items & IT_ALLARMOR) { + if (other.armortype*other.armorvalue < self.armortype*self.armorvalue) { + other.armortype = self.armortype; + other.armorvalue = self.armorvalue; + other.items = other.items - (other.items & IT_ALLARMOR); + other.items = other.items + (self.items & IT_ALLARMOR); + acount = BackpackText(other, "armor upgraded", "", acount); + } + } + else { + // For Singleplayer backpack items can contain shards + // Shards add to the armour value and can go above limit + // If no armour present (add a green jacket) + other.armorvalue = other.armorvalue + self.armorvalue; + // Does the player have any armor already? + if (other.armortype == 0 ) { + // No armor present, give green with armor shards + other.armortype = ARMOR_GRN_TYPE; + other.items2 = other.items2 | IT2_ARMOR1; + } + if (self.armorvalue > 0) { + s = ftos(self.armorvalue); + acount = BackpackText(other, s, " armor shards", acount); + } + } + } + + //---------------------------------------------------------------------- + // Check for Silver/Gold/Custom keys if coop active + //---------------------------------------------------------------------- + if (coop > 0) { + if (self.items & IT_KEY1) { + other.items = other.items | IT_KEY1; + acount = BackpackText(other, "Silver Key", "", acount); + } + if (self.items & IT_KEY2) { + other.items = other.items | IT_KEY2; + acount = BackpackText(other, "Gold Key", "", acount); + } + if (self.moditems & IT_CKEY1) { + other.moditems = other.moditems | IT_CKEY1; + other.ckeyname1 = self.ckeyname1; + acount = BackpackText(other, self.ckeyname1, "", acount); + } + if (self.moditems & IT_CKEY2) { + other.moditems = other.moditems | IT_CKEY2; + other.ckeyname2 = self.ckeyname2; + acount = BackpackText(other, self.ckeyname2, "", acount); + } + if (self.moditems & IT_CKEY3) { + other.moditems = other.moditems | IT_CKEY3; + other.ckeyname3 = self.ckeyname3; + acount = BackpackText(other, self.ckeyname3, "", acount); + } + if (self.moditems & IT_CKEY4) { + other.moditems = other.moditems | IT_CKEY4; + other.ckeyname4 = self.ckeyname4; + acount = BackpackText(other, self.ckeyname4, "", acount); + } + } + + //---------------------------------------------------------------------- + // Check for Powerups if coop active + //---------------------------------------------------------------------- + if (coop > 0) { + if (self.items & IT_INVISIBILITY) { + other.items = other.items | IT_INVISIBILITY; + acount = BackpackText(other, "InvRing", "", acount); + other.invisible_finished = self.invisible_finished; + other.invisible_time = self.invisible_time; + other.invisible_sound = self.invisible_sound; + } + if (self.items & IT_SUIT) { + other.items = other.items | IT_SUIT; + acount = BackpackText(other, "EnvSuit", "", acount); + other.radsuit_finished = self.radsuit_finished; + other.rad_time = self.rad_time; + } + if (self.items & IT_QUAD) { + other.items = other.items | IT_QUAD; + acount = BackpackText(other, "QuadDam", "", acount); + other.super_damage_finished = self.super_damage_finished; + other.super_time = self.super_time; + other.super_sound = self.super_sound; + } + if (self.moditems & IT_ARTSHARP) { + other.moditems = other.moditems | IT_ARTSHARP; + acount = BackpackText(other, "ShpShoot", "", acount); + other.sharpshoot_finished = self.sharpshoot_finished; + other.sharpshoot_time = self.sharpshoot_time; + other.sharpshooter_sound = self.sharpshooter_sound; + } + if (self.moditems & IT_ARTWETSUIT) { + other.moditems = other.moditems | IT_ARTWETSUIT; + acount = BackpackText(other, "WetSuit", "", acount); + other.wetsuit_finished = self.wetsuit_finished; + other.wetsuit_time = self.wetsuit_time; + other.wetsuit_sound = self.wetsuit_sound; + } + if (self.moditems & IT_ARTPIERCE) { + other.moditems = other.moditems | IT_ARTPIERCE; + acount = BackpackText(other, "Piercer", "", acount); + other.nailpiercer_finished = self.nailpiercer_finished; + other.nailpiercer_time = self.nailpiercer_time; + other.nailpiercer_sound = self.nailpiercer_sound; + } + } + + sprint (other, " from a backpack\n"); + if (self.perms & IT_CHAINSAW) { + sound (other, CHAN_ITEM, "weapons/sawidle.wav", 1, ATTN_NORM); + } else { + sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); + } + stuffcmd (other, "bf\n"); + + // Check ammo limts, change to best weapon and set ammo type + bound_other_ammo (other); + if (deathmatch) other.weapon = W_BestWeapon(other); + W_SetCurrentAmmo (other); + + // Random ammo backpacks are actual items + if (self.classtype == CT_AMMORANDOM) { + // hide item and check for respawn + item_finished(); + check_item_respawn(); + } + // Temporary backpack + else remove(self); +}; + +//---------------------------------------------------------------------- +void() DropBackpack = +{ + local entity item; + + //---------------------------------------------------------------------- + // Check for player because of other items + if (self.classtype != CT_PLAYER && self.classtype != CT_MONGREMLIN) { + if (!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells + self.ammo_lava_nails + self.ammo_plasma + self.ammo_multi_rockets)) + return; // nothing in it + } + + item = spawn(); + item.classtype = CT_AMMOPACK; + item.classgroup = CG_AMMOITEM; + item.classname = "item_backpack"; + item.origin = self.origin - '0 0 20'; + + //---------------------------------------------------------------------- + // Pyro Enforcers drop armor shards instead!!! + //---------------------------------------------------------------------- + if (self.classtype == CT_MONPYRO || self.classtype == CT_MONFUMIGATOR) + item.armorvalue = rint(1 + random() * self.ammo_shells); + else { + // Everything else drops ammo + item.ammo_shells = self.ammo_shells; + item.ammo_nails = self.ammo_nails; + item.ammo_rockets = self.ammo_rockets; + item.ammo_cells = self.ammo_cells; + item.ammo_lava_nails = self.ammo_lava_nails; + item.ammo_plasma = self.ammo_plasma; + item.ammo_multi_rockets = self.ammo_multi_rockets; + } + + //---------------------------------------------------------------------- + // Reset backpack inventory before any test + item.items = item.moditems = item.customkey = 0; + + //---------------------------------------------------------------------- + // If player dropping backpack check for extra stuff + if (self.classtype == CT_PLAYER || self.classtype == CT_MONGREMLIN) { + // Copy over items for coop players to pickup + if (coop > 0 && self.classtype != CT_MONGREMLIN) { + // Copy all items + keys + item.items = self.items; + item.moditems = self.moditems; + item.customkey = self.customkey; + // Copy current armour type + value + item.armortype = self.armortype; + item.armorvalue = self.armorvalue; + + // Copy over custom key netnames + if (self.moditems & IT_CKEY1) item.ckeyname1 = self.ckeyname1; + if (self.moditems & IT_CKEY2) item.ckeyname2 = self.ckeyname2; + if (self.moditems & IT_CKEY3) item.ckeyname3 = self.ckeyname3; + if (self.moditems & IT_CKEY4) item.ckeyname4 = self.ckeyname4; + + //---------------------------------------------------------------------- + // Copy over any powerup timers + // Cannot die with invulnerability so not checked! + if (coop_artifacts == TRUE) { + if (self.items & IT_INVISIBILITY) { + item.invisible_finished = self.invisible_finished; + item.invisible_time = self.invisible_time; + item.invisible_sound = self.invisible_sound; + } + if (self.items & IT_SUIT) { + item.radsuit_finished = self.radsuit_finished; + item.rad_time = self.rad_time; + } + if (self.items & IT_QUAD) { + item.super_damage_finished = self.super_damage_finished; + item.super_time = self.super_time; + item.super_sound = self.super_sound; + } + if (self.moditems & IT_ARTSHARP) { + item.sharpshoot_finished = self.sharpshoot_finished; + item.sharpshoot_time = self.sharpshoot_time; + item.sharpshooter_sound = self.sharpshooter_sound; + } + if (self.moditems & IT_ARTWETSUIT) { + item.wetsuit_finished = self.wetsuit_finished; + item.wetsuit_time = self.wetsuit_time; + item.wetsuit_sound = self.wetsuit_sound; + } + if (self.moditems & IT_ARTPIERCE) { + item.nailpiercer_finished = self.nailpiercer_finished; + item.nailpiercer_time = self.nailpiercer_time; + item.nailpiercer_sound = self.nailpiercer_sound; + } + } + } + //---------------------------------------------------------------------- + // Default is DM only, current weapon only + else { + // Check for any special MOD weapons + if (self.weapon == IT_AXE && self.moditems & IT_UPGRADE_AXE) + item.moditems = IT_UPGRADE_AXE; + else if (self.weapon == IT_SUPER_SHOTGUN && self.moditems & IT_UPGRADE_SSG) + item.moditems = IT_UPGRADE_SSG; + else if (self.weapon == IT_LIGHTNING && self.moditems & IT_UPGRADE_LG) + item.moditems = IT_UPGRADE_LG; + // Copy over current weapon ONLY to backpack + if (self.weapon == IT2_LASER_CANNON || self.weapon == IT2_PROXIMITY_GUN || self.weapon == IT2_MJOLNIR) { + item.items2 = self.weapon; + } else { + item.items = self.weapon; + } + } + } + + // Give the backpack some random toss! + item.velocity_z = 300; + item.velocity_x = -100 + (random() * 200); + item.velocity_y = -100 + (random() * 200); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + setmodel (item, MODEL_BACKPACK); + setsize (item, '-16 -16 0', '16 16 56'); + item.touch = item_touch; + item.touch2 = BackpackTouch; + item.skin = 0; + + //---------------------------------------------------------------------- + // 1=green, 2=blue, 3=red, 4=golden, 5=swampy, 6=white, 7=flesh + // green=shells, blue=cells, red=rockets + //---------------------------------------------------------------------- + if (self.classtype == CT_MONDEFENDER) item.skin = 1; + else if (self.classtype == CT_MONARMYGRENADE) item.skin = 1; + else if (self.classtype == CT_MONARMYPLASMA) item.skin = 2; + else if (self.classtype == CT_MONELIMATOR) item.skin = 2; + else if (self.classtype == CT_MONCENTURION) item.skin = 2; + else if (self.classtype == CT_MONARMYROCKET) item.skin = 3; + else if (self.classtype == CT_MONPYRO) item.skin = 4; + else if (self.classtype == CT_MONFUMIGATOR) item.skin = 5; + else if (self.classtype == CT_MONENFORCER) item.skin = 7; + + // Default = remove after 2 minutes, stay if coop active + if (coop == 0) item.item_expired = time + 120; + else item.item_expired = 0; + + item.item_flrcheck = fabs(item.mins_z) + 16; + item.think = item_thinkloop; // Check floor + item.nextthink = time + 0.3; // Let backpack drop first +}; + +/*====================================================================== +/*QUAKED item_backpack (0 .5 .8) (-16 -16 0) (16 16 56) SHELLS NAILS ROCKETS CELLS RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/w_backpack.mdl"); } +Backpack with random/exact amount of ammo +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +count : random amount of ammo to give (works with spawnflags) +ammo_shells : exact amount of shells +ammo_nails : exact amount of spikes +ammo_rockets : exact amount of rockets +ammo_cells : exact amount of cells +armorvalue : armor shards (gives green armor if none present) +armortype : 1 = random amount of armor shards (uses count) +exactskin : 0=Original, 1=green, 2=blue, 3=red, 4=yellow, 5=swamp, 6=white, 7=pale +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +SHELLS : ammo for SG / SSG / RG +NAILS : ammo for NG / SNG +ROCKETS : ammo for GL / RL +CELLS : ammo for LG +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Backpack with random/exact amount of ammo +Cannot be used to drop weapons or armour! + +======================================================================*/ +void() item_backpack_setup = +{ + // Empty netname for backpack routine + self.netname = ""; + self.origin = self.origin + '0 0 12'; + + // reset frame, weapon and armour type, but not value + self.frame = self.weapon = self.items = 0; + self.frame_override = self.frame_box = 0; + + // Make sure the ammo/armor quantites are NOT negative! + if (self.ammo_shells < 0) self.ammo_shells = 0; + if (self.ammo_nails < 0) self.ammo_nails = 0; + if (self.ammo_rockets < 0) self.ammo_rockets = 0; + if (self.ammo_cells < 0) self.ammo_cells = 0; + if (self.ammo_lava_nails < 0) self.ammo_lava_nails = 0; + if (self.ammo_multi_rockets < 0) self.ammo_multi_rockets = 0; + if (self.ammo_plasma < 0) self.ammo_plasma = 0; + if (self.ammo_bolts < 0) self.ammo_bolts = 0; + if (self.ammo_poison < 0) self.ammo_poison = 0; + if (self.armorvalue < 0) self.armorvalue = 0; + + // Check if exact skin is within range + if(self.exactskin < 0 || self.exactskin > 7) self.exactskin = 0; + self.skin = self.exactskin; + + // Check for random ammo setup (uses spawnflags) + if (self.spawnflags & BACKPACK_SHELLS) self.ammo_shells = -1; + if (self.spawnflags & BACKPACK_NAILS) self.ammo_nails = -1; + if (self.spawnflags & BACKPACK_ROCKETS) self.ammo_rockets = -1; + if (self.spawnflags & BACKPACK_CELLS) self.ammo_cells = -1; + if (self.armortype == 1) self.armorvalue = -1; + else self.armortype = 0; + + // setup random quantity (default = 5) + if (self.ammo_shells < 0 || self.ammo_nails < 0 || + self.ammo_rockets < 0 || self.ammo_cells < 0 || + self.armorvalue < 0) { + if (!self.count) self.count = 5; + } + // No random ammo required, reset count + else self.count = 0; + + // Check backpack has ammo to pickup + if (self.ammo_shells == 0 && self.ammo_nails == 0 && + self.ammo_rockets == 0 && self.ammo_cells == 0 && + self.armorvalue == 0) { + dprint("\b[BACKPACK]\b is empty, removing\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + item_start (); +}; + +//---------------------------------------------------------------------- +void() item_backpack = +{ + self.mdl = MODEL_BACKPACK; + precache_model (self.mdl); + + self.classtype = CT_AMMORANDOM; + self.classgroup = CG_AMMOITEM; + self.bbmins = '-16 -16 -12'; + self.bbmaxs = '16 16 32'; + self.part_active = PARTICLE_STYLE_BACKPACK; + if (self.respawn_time == 0) self.respawn_time = RESPAWN_BACKPACK; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 12'; + self.touch2 = BackpackTouch; + + // Double checking all the different ammo combinations can be + // time consuming, delay spawn the backpack instead + self.think = item_backpack_setup; + self.nextthink = time + 0.1 + random(); +}; + +// if (world.devdata & DEV_AMMO_N_HEALTH) senddevdata(self); +void(entity e) senddevdata { + if (!world.deventity) return; + + world.deventity.health = world.deventity.health + e.healamount; + world.deventity.ammo_shells = world.deventity.ammo_shells + e.ammo_shells; + world.deventity.ammo_nails = world.deventity.ammo_nails + e.ammo_nails; + world.deventity.ammo_rockets = world.deventity.ammo_rockets + e.ammo_rockets; + world.deventity.ammo_cells = world.deventity.ammo_cells + e.ammo_cells; + world.deventity.ammo_lava_nails = world.deventity.ammo_lava_nails + e.ammo_lava_nails; + world.deventity.ammo_multi_rockets = world.deventity.ammo_multi_rockets + e.ammo_multi_rockets; + world.deventity.ammo_plasma = world.deventity.ammo_plasma + e.ammo_plasma; + world.deventity.ammo_bolts = world.deventity.ammo_bolts + e.ammo_bolts; + world.deventity.ammo_poison = world.deventity.ammo_poison + e.ammo_poison; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/items_drake.qc b/QC_other/QC_keep/items_drake.qc new file mode 100644 index 00000000..66098672 --- /dev/null +++ b/QC_other/QC_keep/items_drake.qc @@ -0,0 +1,145 @@ +// Used by decapitation code to give headless "body double" the loot. +void(entity from, entity to) Pack_Copy = +{ + to.arsenal = from.arsenal; + to.war = from.war; + to.healamount = from.healamount; + to.healtype = from.healtype; + to.ammo_shells = from.ammo_shells; + to.ammo_nails = from.ammo_nails; + to.ammo_rockets = from.ammo_rockets; + to.ammo_cells = from.ammo_cells; + to.ammo_super = from.ammo_super; + to.ammo_multi_rockets = from.ammo_multi_rockets; + to.ammo_lava_nails = from.ammo_lava_nails; + to.ammo_plasma = from.ammo_plasma; + to.ammo_bolts = from.ammo_bolts; + to.ammo_poison = from.ammo_poison; +}; + +float(entity who) Pack_Empty = { + return (who.arsenal+who.war+who.healamount+who.healtype+who.ammo_shells + +who.ammo_nails+who.ammo_rockets+who.ammo_cells+who.ammo_super + +who.ammo_multi_rockets+who.ammo_lava_nails+who.ammo_plasma+who.ammo_bolts + +who.ammo_poison); +}; + +//============ +// --> QUAKED item_artifact_optimizer (0 .5 .8) (-16 -16 -24) (16 16 32) +// Buffs melee damage and gives +// life leech -- permanently. +//============ + +void () item_artifact_berserker = { + self.mdl = "progs/drake/zerkhelm.mdl"; + precache_model (self.mdl); + self.noise = "items/zerkhelm.wav"; + precache_sound (self.noise); + self.netname = "Berserker Helm"; + self.items = 0; + self.classtype = CT_ARTBERSERK; + self.part_active = PARTICLE_STYLE_PENT; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +//============ +// --> QUAKED item_artifact_equalizer (0 .5 .8) (-16 -16 -24) (16 16 32) +// Nailguns fire two nails at the price +// of one -- permanently. +// +// Also fills nails to the maximum. +//============ + +void () item_artifact_equalizer = { + self.mdl = "progs/drake/gemini.mdl"; + precache_model (self.mdl); + self.noise = "items/equalize.wav"; + precache_sound (self.noise); + self.netname = "Twin Shot"; + self.items = 0; + self.classtype = CT_ARTEQUALIZER; + self.part_active = PARTICLE_STYLE_SRING; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_nails = world.deventity.ammo_nails + AMMO_MAXNAILS; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +//============ +// --> QUAKED item_artifact_levitation (0 .5 .8) (-16 -16 -24) (16 16 32) +// Gives the player limited flying ability +//============ +void () item_artifact_levitation = { + self.mdl = "progs/drake/levitate.mdl"; + precache_model (self.mdl); + self.noise = "items/levitate.wav"; + self.noise1 = "ambience/wingget.wav"; + self.noise2 = "ambience/wingend.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Boots of Levitation"; + self.items = 0; + self.classtype = CT_ARTLEVITATION; + self.part_active = PARTICLE_STYLE_TOMEOFP; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +// Original classname in Zerstorer. +// Note: Replaced Zerstorer's Dark-Angel Wings with Boots of Levitation. +//void() item_wings = {self.classname = "item_artifact_levitation"; item_artifact_levitation(); }; + + +//============ +// --> QUAKED item_artifact_optimizer (0 .5 .8) (-16 -16 -24) (16 16 32) +// Shotguns fire faster -- permanently. +// +// Also fills shells to the maximum. +//============ +void() item_artifact_optimizer = { + self.mdl = "progs/drake/shotty.mdl"; + precache_model (self.mdl); + self.noise = "items/optimize.wav"; + precache_sound (self.noise); + self.netname = "Shotgun Optimizer"; + self.items = 0; + self.classtype = CT_ARTOPTIMIZER; + self.part_active = PARTICLE_STYLE_ARMOR; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_shells = world.deventity.ammo_shells + AMMO_MAXSHELLS; + artifact_setup(); +}; + + +//============ +// --> QUAKED item_sigil_bane (0 .5 .8) (-16 -16 -24) (16 16 32) +// Unique item for nsoe5. Pick up to activate final fight with Bane. +//============ +void() item_sigil_bane = { + self.mdl = "progs/drake/end_bane.mdl"; + precache_model (self.mdl); + self.noise = "misc/runekey.wav"; + precache_sound (self.noise); + self.netname = "seal of Bane!"; + self.items = 0; + self.classtype = CT_SIGILBANE; + self.part_active = PARTICLE_STYLE_SIGIL; + self.respawn_style = PARTICLE_BURST_PURPLE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +void() weapon_blaster = { + self.mdl = "progs/w_blaster.mdl"; // set by world.qc, mapper can pick to use AD or original axe + precache_model (self.mdl); + //self.weapon = IT_BLASTER; + self.classtype = CT_BLASTERWEP; + self.netname = "Laser Blaster"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_shells = world.deventity.ammo_shells + AMMO_SHELLS_WPN; //TODO: change to cells? + weapon_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/items_keep.qc b/QC_other/QC_keep/items_keep.qc new file mode 100644 index 00000000..d13c6cd0 --- /dev/null +++ b/QC_other/QC_keep/items_keep.qc @@ -0,0 +1,970 @@ +//---------------------------------------------------------------------- +void() weapon_touch = { + local float best, new; + local float leave, moditem, use2, useperms; + + // if the player was using his best weapon + // change up to the new one if better + best = W_BestWeapon(other); + + use2 = FALSE; //bit to set if checking against self.items2 + useperms = FALSE; // diddo for checking against self.perms + // Deathmatch/coop switch + if (deathmatch == 2 || coop) leave = TRUE; + else leave = FALSE; + + new = -1; + //---------------------------------------------------------------------- + if (self.classtype == CT_AXE) { + new = IT_AXE; + } + //---------------------------------------------------------------------- + if (self.classtype == CT_UPGRADE_AXE) { + if (leave && (other.moditems & IT_UPGRADE_AXE) ) return; + update_configflag(SVR_UPDAXE, TRUE); + moditem = TRUE; + new = IT_UPGRADE_AXE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SHOTGUN) { + if (self.perms & IT_BLASTER) other.ammo_shells = other.ammo_shells + AMMO_SHELLS_WPN; + if (leave && (other.items & IT_SHOTGUN) ) return; + new = IT_SHOTGUN; + if (!(self.perms & IT_BLASTER)) other.ammo_shells = other.ammo_shells + AMMO_SHELLS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_BLASTERWEP) { + if (leave && (other.items & IT_SHOTGUN) ) return; + new = IT_SHOTGUN; + other.ammo_shells = other.ammo_shells + AMMO_SHELLS_WPN; + other.perms = other.perms | IT_BLASTER; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AXE) { + if (leave && (other.items & IT_AXE) ) return; + new = IT_AXE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_UPGRADE_SSG) { + if (leave && (other.moditems & IT_UPGRADE_SSG) ) return; + update_configflag(SVR_UPDSSG, TRUE); + moditem = TRUE; + new = IT_UPGRADE_SSG; + other.ammo_shells = other.ammo_shells + AMMO_SHELLS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SUPER_SHOTGUN) { + if (leave && (other.items & IT_SUPER_SHOTGUN) ) return; + new = IT_SUPER_SHOTGUN; + other.ammo_shells = other.ammo_shells + AMMO_SHELLS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_NAILGUN) { + if (leave && (other.items & IT_NAILGUN) ) return; + new = IT_NAILGUN; + other.ammo_nails = other.ammo_nails + AMMO_NAILS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_SUPER_NAILGUN) { + if (leave && (other.items & IT_SUPER_NAILGUN) ) return; + new = IT_SUPER_NAILGUN; + other.ammo_nails = other.ammo_nails + AMMO_NAILS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_GRENADE_LAUNCHER) { + if (leave && (other.items & IT_GRENADE_LAUNCHER) ) return; + new = IT_GRENADE_LAUNCHER; + other.ammo_rockets = other.ammo_rockets + AMMO_ROCKETS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_ROCKET_LAUNCHER) { + if (leave && (other.items & IT_ROCKET_LAUNCHER) ) return; + new = IT_ROCKET_LAUNCHER; + other.ammo_rockets = other.ammo_rockets + AMMO_ROCKETS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_MULTI_GRENADE) { + if (leave && (other.items & IT_MULTI_GRENADE) ) return; + new = IT_MULTI_GRENADE; + other.ammo_multi_rockets = other.ammo_multi_rockets + AMMO_MULTI_ROCKETS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_MULTI_ROCKET) { + if (leave && (other.items & IT_MULTI_ROCKET) ) return; + new = IT_MULTI_ROCKET; + other.ammo_multi_rockets = other.ammo_multi_rockets + AMMO_MULTI_ROCKETS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_CHAINLIGHTGUN) { + if (leave && (other.items2 & IT2_CHAINLIGHTNING) ) return; + new = IT2_CHAINLIGHTNING; + other.ammo_cells = other.ammo_cells + AMMO_CELLS_WPN; + use2 = TRUE; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_CHAINSAW) { + if (leave && (other.perms & IT_CHAINSAW) ) return; + new = IT_AXE; + other.perms = other.perms | IT_CHAINSAW; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_UPGRADE_LG) { + if (leave && (other.moditems & IT_UPGRADE_LG) ) return; + update_configflag(SVR_UPDLG, TRUE); + moditem = TRUE; + new = IT_UPGRADE_LG; + other.ammo_cells = other.ammo_cells + AMMO_CELLS_WPN; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_LIGHTNING) { + if (leave && (other.items & IT_LIGHTNING) ) return; + new = IT_LIGHTNING; + other.ammo_cells = other.ammo_cells + AMMO_CELLS_WPN; + } + else if (self.classtype == CT_EXTRA_WEAPON) { + if (leave && (other.items & IT_EXTRA_WEAPON) ) return; + other.ammo_bolts = other.ammo_bolts + AMMO_BOLTS_WPN; + new = IT_EXTRA_WEAPON; + } + else if (self.classtype == CT_LAVANG) { + if (leave && (other.items & IT_LAVA_NAILGUN) ) return; + new = IT_LAVA_NAILGUN; + other.ammo_lava_nails = other.ammo_lava_nails + AMMO_LAVA_NAILS_WPN; + } + else if (self.classtype == CT_LAVASNG) { + if (leave && (other.items & IT_LAVA_SUPER_NAILGUN) ) return; + new = IT_LAVA_SUPER_NAILGUN; + other.ammo_lava_nails = other.ammo_lava_nails + AMMO_LAVA_NAILS_WPN; + } + else if (self.classtype == CT_PLASMAGUN) { + if (leave && (other.items & IT_PLASMA_GUN) ) return; + new = IT_PLASMA_GUN; + other.ammo_plasma = other.ammo_plasma + AMMO_PLASMA_WPN; + } + else if (self.classtype == CT_PROXIMITY_GUN) { + if (leave && (other.items2 & IT2_PROXIMITY_GUN) ) return; + new = IT2_PROXIMITY_GUN; + other.ammo_rockets = other.ammo_rockets + AMMO_ROCKETS_WPN; + use2 = TRUE; + } + else if (self.classtype == CT_LASER_CANNON) { + if (leave && (other.items2 & IT2_LASER_CANNON) ) return; + new = IT2_LASER_CANNON; + other.ammo_cells = other.ammo_cells + AMMO_CELLS_WPN; + use2 = TRUE; + } + else if (self.classtype == CT_MJOLNIR) { + if (leave && (other.items2 & IT2_MJOLNIR) ) return; + new = IT2_MJOLNIR; + other.ammo_cells = other.ammo_cells + AMMO_CELLS_WPN; + use2 = TRUE; + } + else if (self.classtype == CT_GRAPPLE) { + if (leave && (other.items2 & IT2_GRAPPLE) ) return; + new = IT2_GRAPPLE; + use2 = TRUE; + } + else if (self.classtype == CT_WAND) { + if (leave && (other.items2 & IT2_CROSS) ) return; + new = IT2_CROSS; + use2 = TRUE; + } + //---------------------------------------------------------------------- + else return; + + if (self.classtype == CT_UPGRADE_AXE && other.moditems & IT_UPGRADE_AXE) + sprint (other, "You got another axe to grind\n"); + else if (self.classtype == CT_SUPER_SHOTGUN && other.moditems & IT_UPGRADE_SSG) + sprint (other, "You got a handful of Shells\n"); + else if (self.classtype == CT_UPGRADE_SSG && other.moditems & IT_UPGRADE_SSG) + sprint (other, "You got triple barrel boomstick\n"); + else if (self.classtype == CT_LIGHTNING && other.moditems & IT_UPGRADE_LG) + sprint (other, "You got some AAA batteries\n"); + else if (self.classtype == CT_UPGRADE_LG && other.moditems & IT_UPGRADE_LG) + sprint (other, "You got another burst of plasma\n"); + else { + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + } + // weapon touch sound + if (self.classtype == CT_CHAINSAW) { + sound (other, CHAN_ITEM, "weapons/sawidle.wav", 1, ATTN_NORM); + } else { + sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); + } + stuffcmd (other, "bf\n"); + + // Make sure no ammo is over limits + bound_other_ammo (other); + + // Stop the player switching to weapons already got + if (!deathmatch) { + // Check for new shadow axe and SG and skip weapon switch + if (moditem && new == IT_UPGRADE_AXE && other.moditems & new) new = -1; + else if (new == IT_SHOTGUN && other.items & new) new = -1; + // Stop switching to a lower tier weapon (DM Rules) + // if (DM_RankForWeapon(other.weapon) < DM_RankForWeapon(new)) new = -1; + } + + // Skip any weapon switch if no new weapon + if (new != -1 || moditem) { + // change to the weapon and add to inventory + if (!moditem) { + if (use2) { + other.items2 = other.items2 | new; + } else { + if (useperms) { + other.perms = other.perms | new; + } else { + other.items = other.items | new; + } + } + } + if (moditem) { + other.moditems = other.moditems | new; + if (moditem == IT_UPGRADE_LG) other.items = other.items | IT_LIGHTNING; // give lightning just in case + if (moditem == IT_UPGRADE_AXE || self.perms & IT_CHAINSAW) other.items = other.items | IT_AXE; // give axe just in case + if (moditem == IT_UPGRADE_SSG) other.items = other.items | IT_SUPER_SHOTGUN; // give super shot gun just in case + } + + // Check for best weapon (DM only) and switch to it! + if (deathmatch) { + DM_Weapon(new); + } else { + if (moditem == IT_UPGRADE_AXE || self.perms & IT_CHAINSAW) { + other.weapon = IT_AXE; + } else { + if (moditem == IT_UPGRADE_SSG) { + other.weapon = IT_SUPER_SHOTGUN; + } else { + if (moditem == IT_UPGRADE_LG) { + other.weapon = IT_LIGHTNING; + } else { + if (new == IT2_CROSS) { + other.weapon = IT2_CROSS; + } else { + other.weapon = new; + } + } + } + } + } + //W_SetCurrentAmmo(other); + } + W_SetCurrentAmmo(other); + + // If co-op active, exit + if (leave == TRUE) { + // Make sure any targets on the weapon are fired for co-op + // This is basically a run once check using state as a flag + // Ideally no weapon should use important target triggers! + // Code idea from Bengt Jardrup + if (self.state == FALSE) { + self.state = TRUE; + activator = other; + SUB_UseTargets (); + } + return; + } + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +void() weapon_grapple = { + self.mdl = "progs/drake/g_grpple.mdl"; + precache_model (self.mdl); + self.weapon = IT2_GRAPPLE; + self.classtype = CT_GRAPPLE; + self.netname = "Grapple"; + weapon_start(); +}; + +void() weapon_chainsaw = { + self.mdl = "progs/drake/g_saw.mdl"; + precache_model (self.mdl); + self.classtype = CT_CHAINSAW; + self.netname = "Chainsaw"; + weapon_start(); +}; + +void() weapon_axe = { + self.mdl = g_axemodel; // set by world.qc, mapper can pick to use AD or original axe + precache_model (self.mdl); + self.weapon = IT_AXE; + self.classtype = CT_AXE; + self.netname = "Axe"; + weapon_start(); +}; + +void() weapon_mjolnir = { + self.mdl = MODEL_GWEAP_MJOL; + precache_model (self.mdl); + self.weapon = IT2_MJOLNIR; + self.classtype = CT_MJOLNIR; + self.netname = "Mjolnir's Hammer"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_cells = world.deventity.ammo_cells + AMMO_CELLS_WPN; + weapon_start(); +}; + +void() weapon_wand = { + self.mdl = MODEL_GWEAP_WAND; + precache_model (self.mdl); + self.weapon = IT2_CROSS; + self.classtype = CT_WAND; + self.netname = "Magic Wand"; + weapon_start(); +}; + +void () weapon_crossbow = { + self.mdl = "progs/g_crossbow.mdl"; + precache_model(self.mdl); + self.weapon = IT_EXTRA_WEAPON; + self.classtype = CT_EXTRA_WEAPON; + self.netname = "Crossbow"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_bolts = world.deventity.ammo_bolts + AMMO_BOLTS_WPN; + weapon_start(); +}; + +void() weapon_lava_nailgun = { + self.mdl = MODEL_GWEAP_LNG; + precache_model (self.mdl); + self.weapon = IT_LAVA_NAILGUN; + self.classtype = CT_LAVANG; + self.netname = "Lava Nailgun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_lava_nails = world.deventity.ammo_lava_nails + AMMO_LAVA_NAILS_WPN; + weapon_start(); +}; + +void() weapon_lava_super_nailgun = { + self.mdl = MODEL_GWEAP_LSNG; + precache_model (self.mdl); + self.weapon = IT_LAVA_SUPER_NAILGUN; + self.classtype = CT_LAVASNG; + self.netname = "Lava Super Nailgun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_lava_nails = world.deventity.ammo_lava_nails + AMMO_LAVA_NAILS_WPN; + weapon_start(); +}; + +void() weapon_proximity_gun = { + self.mdl = MODEL_GWEAP_PROX; + precache_model (self.mdl); + self.weapon = IT2_PROXIMITY_GUN; + self.classtype = CT_PROXIMITY_GUN; + self.netname = "Proximity Grenade Launcher"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_rockets = world.deventity.ammo_rockets + AMMO_ROCKETS_WPN; + weapon_start(); +}; + +void () weapon_laser_gun = { + self.mdl = MODEL_GWEAP_LASER; + precache_model (self.mdl); + self.weapon = IT2_LASER_CANNON; + self.classtype = CT_LASER_CANNON; + self.netname = "Laser Cannon"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_cells = world.deventity.ammo_cells + AMMO_CELLS_WPN; + weapon_start(); +}; + +void () weapon_multi_grenade = { + self.mdl = "progs/g_rock.mdl"; + precache_model (self.mdl); + self.skin = 2; + self.weapon = IT_MULTI_GRENADE; + self.classtype = CT_MULTI_GRENADE; + self.netname = "Multi-Grenade Launcher"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_multi_rockets = world.deventity.ammo_multi_rockets + AMMO_MULTI_ROCKETS_WPN; + weapon_start(); +}; + +void () weapon_multi_rocket = { + self.mdl = "progs/g_rock2.mdl"; + self.skin = 1; + precache_model (self.mdl); + self.weapon = IT_MULTI_ROCKET; + self.classtype = CT_MULTI_ROCKET; + self.netname = "Multi-Rocket Launcher"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_multi_rockets = world.deventity.ammo_multi_rockets + AMMO_MULTI_ROCKETS_WPN; + weapon_start(); +}; + +void () weapon_plasmalightning = { + self.mdl = "progs/g_light.mdl"; + self.skin = 1; + precache_model (self.mdl); + self.weapon = IT_PLASMA_GUN; + self.classtype = CT_PLASMAGUN; + self.netname = "Plasma Thunderbolt"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_plasma = world.deventity.ammo_plasma + AMMO_PLASMA_WPN; + weapon_start(); +}; + +void () weapon_chain_lightning = { + self.mdl = "progs/drake/g_light2.mdl"; + precache_model (self.mdl); + self.weapon = IT2_CHAINLIGHTNING; + self.classtype = CT_CHAINLIGHTGUN; + self.netname = "Chain Lightning Gun"; + if (world.devdata & DEV_AMMO_N_HEALTH) world.deventity.ammo_cells = world.deventity.ammo_cells + AMMO_CELLS_WPN; + weapon_start(); +}; + +/*====================================================================== + AMMO +======================================================================*/ +void() ammo_touch = { + //local float best; + + // if the player was using his best weapon, + // change up to the new one if better + //best = W_BestWeapon(other); + + //---------------------------------------------------------------------- + if (self.classtype == CT_AMMOSHELLS) { + if (other.ammo_shells >= AMMO_MAXSHELLS) return; + other.ammo_shells = other.ammo_shells + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMONAILS) { + if (other.ammo_nails >= AMMO_MAXNAILS) return; + other.ammo_nails = other.ammo_nails + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOROCKETS) { + if (other.ammo_rockets >= AMMO_MAXROCKETS) return; + other.ammo_rockets = other.ammo_rockets + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOCELLS) { + if (other.ammo_cells >= AMMO_MAXCELLS) return; + other.ammo_cells = other.ammo_cells + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOPLASMA) { + if (other.ammo_plasma >= AMMO_MAXPLASMA) return; + other.ammo_plasma = other.ammo_plasma + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOMULTIROCKETS) { + if (other.ammo_multi_rockets >= AMMO_MAXMULTIROCKETS) return; + other.ammo_multi_rockets = other.ammo_multi_rockets + self.aflag; + } + //---------------------------------------------------------------------- + else if (self.classtype == CT_AMMOLAVANAILS) { + if (other.ammo_lava_nails >= AMMO_MAXLAVANAILS) return; + other.ammo_lava_nails = other.ammo_lava_nails + self.aflag; + } + else if (self.classtype == CT_AMMOPOISON) { + if (other.ammo_poison >= AMMO_MAXPOISON) return; + other.ammo_poison = other.ammo_poison + self.aflag; + } + else if (self.classtype == CT_AMMOBOLTS) { + if (other.ammo_bolts >= AMMO_MAXBOLTS) return; + other.ammo_bolts = other.ammo_bolts + self.aflag; + } + + // Check/cap ammo limits + bound_other_ammo (other); + + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other, "\n"); + sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Commented out. Don't auto switch weapons, people hate it. -Qmaster + // change to a better weapon if appropriate + //if ( other.weapon == best ) { + // other.weapon = W_BestWeapon(other); + // W_SetCurrentAmmo (other); + //} + + // if changed current ammo, update it + W_SetCurrentAmmo(other); + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +void() item_lava_spikes ={ + if (self.spawnflags & A_LARGE) { + self.mdl = "maps/b_lnail1.bsp"; + if (self.aflag < 1) self.aflag = AMMO_NAILS_LGR; + } + else { + self.mdl = "maps/b_lnail0.bsp"; + if (self.aflag < 1) self.aflag = AMMO_NAILS_SML; + } + self.ammo_lava_nails = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOLAVANAILS; + self.netname = "box of lava nails"; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + item_ammo_setup(); +}; + +void() item_multi_rockets = { + if (self.spawnflags & A_LARGE) { + self.mdl = "maps/b_mrock1.bsp"; + if (self.aflag < 1) self.aflag = AMMO_ROCKETS_LGR; + } + else { + self.mdl = "maps/b_mrock0.bsp"; + if (self.aflag < 1) self.aflag = AMMO_ROCKETS_SML; + } + self.ammo_multi_rockets = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOMULTIROCKETS; + self.netname = "box of multi rockets"; + if (self.spawnflags & A_LID) self.spawnflags = self.spawnflags - A_LID; + self.frame_override = TRUE; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + item_ammo_setup(); +}; + +/*====================================================================== +/*QUAKED item_plasma (0 .5 .8) (0 0 0) (32 32 32) BIG + +/*QUAKED item_plasma (0 .5 .8) (-16 -16 0) (16 16 32) BIG x x x RESPAWN FLOAT STARTOFF NOEFFECTS NOT_EASY NOT_NORMAL NOT_HARD NOT_DM +{ model(":progs/ad171/ammo_cells0.mdl"); } +6 or 12 Cells +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +frame_box : special animation frame number for box of ammo (1-7) +skin_override : Override world type 1=Base Green, 2=Medieval Wood +aflag : Ammo quantity override +upgrade_ssg : = 1 will only spawn if shotgun upgrade active on server +upgrade_axe : = 1 will only spawn if axe upgrade active on server +upgrade_lg : = 1 will only spawn if lightning gun upgrade active on server +message : centerprint message when item is picked up +respawn_time : time to wait before respawning (=-1 instant) +respawn_count : Total amount of times to respawn (counts down to zero) +respawn_trig : = 1 Wait for trigger before respawning +-------- SPAWNFLAGS -------- +BIG : Double Ammo and different model +RESPAWN : Can respawn after being picked up +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +6 or 12 Cells for the Thunderbolt (LG) + +======================================================================*/ +void() item_plasma = { + if (self.spawnflags & A_LARGE) { + self.mdl = "maps/b_plas1.bsp"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_LGR; + } + else { + self.mdl = "maps/b_plas0.bsp"; + if (self.aflag < 1) self.aflag = AMMO_CELLS_SML; + } + self.ammo_plasma = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOPLASMA; + self.netname = "box of cells"; + if (self.spawnflags & A_LID) self.spawnflags = self.spawnflags - A_LID; + self.frame_override = TRUE; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + item_ammo_setup(); +}; + +void() item_bolts = { + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_bolts1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_BOLTS_LGR; + } else { + self.mdl = "progs/ammo_bolts0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_BOLTS_SML; + } + self.ammo_bolts = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOBOLTS; + self.netname = "box of crossbow bolts"; + self.skin = 0; + self.skin_override = 0; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + item_ammo_setup(); +}; + +void() item_poison = { + if (self.spawnflags & A_LARGE) { + self.mdl = "progs/ammo_poison1.mdl"; + if (self.aflag < 1) self.aflag = AMMO_POISON_LGR; + } else { + self.mdl = "progs/ammo_poison0.mdl"; + if (self.aflag < 1) self.aflag = AMMO_POISON_SML; + } + self.ammo_poison = self.aflag; + + precache_model (self.mdl); + self.classtype = CT_AMMOPOISON; + self.netname = "box of poison"; + self.skin = 0; + self.skin_override = 0; + self.respawn_style = PARTICLE_BURST_WHITE + PARTICLE_BURST_RING; + self.respawn_ofs = '0 0 24'; + self.respawn_effect = TRUE; + item_ammo_setup(); +}; + +/*====================================================================== + ARTIFACTS (suit, pent, invis, quad) +======================================================================*/ +void() artifact_touch = { + entity pl; + //---------------------------------------------------------------------- + // Existing artifacts + //---------------------------------------------------------------------- + if (self.classtype == CT_ARTSUIT) { + other.rad_time = TRUE; + other.radsuit_finished = time + self.cnt; + ResetDebuffBurning(other); + ResetDebuffPoisoned(other); + } + else if (self.classtype == CT_ARTPENT) { + other.invincible_time = TRUE; + other.invincible_finished = time + self.cnt; + ResetDebuffSystem(other); + } + else if (self.classtype == CT_ARTINVS) { + other.invisible_time = TRUE; + other.invisible_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTQUAD) { + other.super_time = TRUE; + other.super_damage_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTSHARP) { + other.sharpshoot_time = TRUE; + other.sharpshoot_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTPIERCE) { + other.nailpiercer_time = TRUE; + other.nailpiercer_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTPSHIELD) { + other.shield_time = TRUE; + other.shield_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTGRAVBELT) { + other.antigrav_time = TRUE; + other.antigrav_finished = time + self.cnt; + other.gravity = 0.25; // This is where the magic happens! See client_power.qc for how it goes back to 1. + } + else if (self.classtype == CT_ARTWETSUIT) { + other.wetsuit_time = TRUE; + other.wetsuit_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTEMPATHY) { + other.empathy_time = TRUE; + other.empathy_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTTHERMSUIT) { + other.therm_time = TRUE; + other.therm_finished = time + self.cnt; + ResetDebuffBurning(other); + } + else if (self.classtype == CT_ARTTRINITY) { + other.trinity_time = 1; + other.trinity_start = 1; + other.trinity_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTCROSS) { + other.cross_time = 1; + other.cross_start = 1; + other.cross_finished = time + self.cnt; + } + else if (self.classtype == CT_ARTBERSERK) { + other.perms = other.perms | POW_VAMPIRE; + if (other.health < 100) other.health = 100; // full heal + } + else if (self.classtype == CT_ARTEQUALIZER) { + other.perms = other.perms | POW_DOUBLE; + other.ammo_nails = AMMO_MAXNAILS; // max out nails ammo + if (other.ammo_lava_nails < (AMMO_MAXLAVANAILS * 0.5)) other.ammo_lava_nails = AMMO_MAXLAVANAILS * 0.5; // fill lava nails up to half + + // if changed current ammo, update it + W_SetCurrentAmmo(other); + } + else if (self.classtype == CT_ARTLEVITATION) { + other.wing_time = 1; + other.wing_finished = time + 45; + } + else if (self.classtype == CT_ARTOPTIMIZER) { + other.perms = other.perms | POW_SHOTTYMAN; + other.ammo_shells = AMMO_MAXSHELLS; // max out nails ammo + } + else if (self.classtype == CT_SIGILBANE) { + // Give all players 250 health + pl = find (world, classname, "player"); + while (pl) { + pl.health = HEAL_MEGAMAX; + pl = find (pl, classname, "player"); + } + } + else return; + + //---------------------------------------------------------------------- + // Pickup sound and initial screen flash + //---------------------------------------------------------------------- + sprint (other, "You got the "); + sprint (other, self.netname); + sprint (other,"\n"); + sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + stuffcmd (other, "bf\n"); + + // Update player item flags (regular + mod) + other.items = other.items | self.items; + other.items2 = other.items2 | self.items2; + other.moditems = other.moditems | self.moditems; + + // hide item and check for respawn + item_finished(); + check_item_respawn(); + + activator = other; + SUB_UseTargets(); +}; + +void () item_powerup_shield = { + self.mdl = "progs/rogue/shield.mdl"; + precache_model (self.mdl); + self.noise = "shield/pickup.wav"; + self.noise1 = "shield/hit.wav"; + self.noise2 = "shield/fadeout.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_model ("progs/rogue/shield.mdl"); + self.netname = "Power Shield"; + self.items = IT_QUAD; + self.items2 = IT2_SHIELD; + self.classtype = CT_ARTPSHIELD; + self.part_active = PARTICLE_STYLE_PENT; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +void () item_powerup_belt = { + self.mdl = "progs/rogue/beltup.mdl"; + precache_model (self.mdl); + self.noise = "belt/pickup.wav"; + self.noise1 = "belt/use.wav"; + self.noise2 = "belt/fadeout.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Anti-Grav Belt"; + self.items = IT_QUAD; + self.classtype = CT_ARTGRAVBELT; + self.part_active = PARTICLE_STYLE_QUAD; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + self.cnt = 45; + artifact_setup(); +}; + +void () item_artifact_empathy_shields = { + self.mdl = "progs/hipnotic/empathy.mdl"; + precache_model (self.mdl); + self.noise = "hipitems/empathy.wav"; + self.noise1 = "hipitems/empathy2.wav"; + self.noise2 = "items/suit2.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Empathy Shield"; + self.items2 = HIP_IT2_EMPATHY_SHIELDS; + self.classtype = CT_ARTEMPATHY; + self.part_active = PARTICLE_STYLE_SRING; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 6'; + artifact_setup(); +}; + +void () item_artifact_lavasuit = { + self.mdl = "progs/suit2.mdl"; + precache_model (self.mdl); + self.noise = "items/suit.wav"; + self.noise1 = "items/suit2.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + self.netname = "Thermal Protection Suit"; + self.skin = 1; + self.classtype = CT_ARTTHERMSUIT; + self.part_active = PARTICLE_STYLE_PENT; + self.respawn_style = PARTICLE_BURST_RED + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 6'; + artifact_setup(); +}; + +void() item_artifact_trinity = { + self.mdl = "progs/quoth2pt2full/trinity.mdl"; + precache_model (self.mdl); + self.noise = "items2/trintake.wav"; + self.noise1 = "items2/trinuse.wav"; + self.noise2 = "items2/trinend.wav"; + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); + self.netname = "Trinity"; + self.items = IT_QUAD; + self.items2 = IT2_TRINITY; + self.classtype = CT_ARTTRINITY; + self.part_active = PARTICLE_STYLE_SRING; + self.respawn_style = PARTICLE_BURST_YELLOW + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 6'; + artifact_setup(); +}; + +void() item_artifact_cross = { + self.mdl = "progs/quoth2pt2full/cross.mdl"; + precache_model (self.mdl); + self.noise = "items2/crostake.wav"; + self.noise2 = "items2/crosend.wav"; + precache_sound (self.noise); + precache_sound (self.noise2); + self.netname = "Cross of Deflection"; + self.items = IT_QUAD; + self.classtype = CT_ARTCROSS; + self.part_active = PARTICLE_STYLE_QUAD; + self.respawn_style = PARTICLE_BURST_BLUE + PARTICLE_BURST_CENTER; + self.respawn_ofs = '0 0 16'; + artifact_setup(); +}; + +void() item_artifact_random = { + local float rnd; + + rnd = random() * 100; + if (rnd < 5) + item_artifact_envirosuit(); + else if (rnd < 10) + item_artifact_invisibility(); + else if (rnd < 15) + item_artifact_invulnerability(); + else if (rnd < 20) + item_artifact_cross(); + else if (rnd < 25) + item_artifact_empathy_shields(); + else if (rnd < 30) + item_artifact_nail_piercer(); + else if (rnd < 35) + item_artifact_sharp_shooter(); + else if (rnd < 40) + item_artifact_super_damage(); + else if (rnd < 45) + item_artifact_trinity(); + else if (rnd < 50) + item_artifact_wetsuit(); + else + item_backpack(); +}; + +void () horn_touch = { + if ( (other.classname != "player") ) return ; + + self.solid = SOLID_NOT; + self.model = string_null; + sprint (other,"You got the Horn of Conjuring\n"); + sound (other,CHAN_VOICE,self.noise,TRUE,ATTN_NONE); + stuffcmd (other,"bf\n"); + activator = other; + other.horn_active = TRUE; + SUB_UseTargets (); + other.horn_active = FALSE; +}; + +void () item_artifact_horn = { + if (deathmatch) { remove(self); return; } + + self.touch2 = horn_touch; + self.mdl = "progs/hipnotic/horn.mdl"; + precache_model ("progs/hipnotic/horn.mdl"); + precache_sound ("hipitems/horn.wav"); + setmodel (self,self.mdl); + self.noise = "hipitems/horn.wav"; + self.classtype = CT_ARTHORN; + setsize (self,VEC_HULL_MIN,VEC_HULL_MAX); + item_start (); +}; + +// Can't touch dis! +void () item_taunt = { + if ( (self.model) ) { + precache_model (self.model); + setmodel(self,self.model); + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + } else { + objerror("No model for item_taunt"); + } +}; + +// HACK alert +// meh, including this here to be nice, from Drake. This is an item_taunt and it should have a push trigger and a killtarget to remove this and the trigger after jumping +void () item_pushup = { + self.model = "progs/drake/wings2.mdl"; + item_taunt(); +} + + +/* +=============================================================================== +item_circuitboard from Rubicon 2 by ijed, MFX, & Hrimfaxi +=============================================================================== +*/ + +void () circuitboard_touch = { + if (other.classname != "player") + return; + + if (other.health <= 0) + return; + + stuffcmd (other, "bf\n"); + centerprint (other, "You got the 17-centimeter Fromitz board!"); + sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + activator = other; + SUB_UseTargets (); + remove (self); +}; + +/*QUAKED item_circuitboard (0 .5 .8) (-16 -16 -24) (16 16 32) +collectible circuit board thing +*/ + +void () item_circuitboard = { + self.mdl = "progs/fromitz.mdl"; + precache_model ("progs/fromitz.mdl"); + setmodel (self, "progs/fromitz.mdl"); + precache_sound ("items/protect.wav"); + self.noise = "items/protect.wav"; + self.touch2 = circuitboard_touch; + setsize (self, '-16 -16 -24', VEC_HULL_MAX); + self.classtype = CT_CIRCUIT; + item_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/lights.qc b/QC_other/QC_keep/lights.qc new file mode 100644 index 00000000..06aafb6e --- /dev/null +++ b/QC_other/QC_keep/lights.qc @@ -0,0 +1,809 @@ +/*====================================================================== + LIGHT ENTITIES (used by compiler) +======================================================================*/ +float LIGHT_STARTOFF = 1; +float LIGHT_NOSOUND = 2; +float LIGHT_NOSTATIC = 4; +float LIGHT_FLAMEOFF = 2; +float LIGHT_CANDLESHADOW = 8; +float LIGHT_SWITCHFADE = 16; +float LIGHT_NOEFFECTS = 128; + +// To help reduce signon buffer size, allow for light entities +// to be delay spawned (especially light models like candles) +// Cannot use target key because compiler uses it for light styles +.string lighttarget; + +//---------------------------------------------------------------------- +void() play_light_sound = +{ + if (!self.owner) return; + if (self.owner.estate & ESTATE_BLOCK) return; + + self.think = play_light_sound; + self.nextthink = time + self.owner.waitmin; + sound (self, CHAN_VOICE, self.owner.noise, self.owner.volume, ATTN_STATIC); +}; + +//---------------------------------------------------------------------- +void() setup_light_sound = +{ + if (!self.volume) self.volume = 0.5; + if ( !(self.spawnflags & LIGHT_NOSOUND) && self.noise != "" ) { + if (self.targetname) { + self.attachment = spawn(); + self.attachment.owner = self; + setorigin(self.attachment, self.origin); + self.attachment.nextthink = time + 1; + self.attachment.think = play_light_sound; + } + else { + ambientsound (self.origin, self.noise, self.volume, ATTN_QUIET); + } + } +}; + +//---------------------------------------------------------------------- +void() setup_light_static = +{ + // Cannot have static entities and particle emitters! + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) return; + if ( !(self.spawnflags & LIGHT_NOSTATIC) ) makestatic (self); +}; + +//---------------------------------------------------------------------- +void(float pe_style) setup_light_particle = +{ + if (self.spawnflags & LIGHT_NOEFFECTS) return; + // Spawn particle emitter if particles active and not blocked + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES ) { + self.part_active = pe_style; + if (self.spawnflags & LIGHT_STARTOFF) self.lip = PARTICLE_START_OFF; + else self.lip = PARTICLE_START_ON; + self.part_emitter = spawn_pemitter(self, self, self.part_active, self.lip); + } +}; + +//---------------------------------------------------------------------- +void() light_part_emitter_on = +{ + if (self.part_emitter) { + if (ext_dppart && self.part_emitter.state == STATE_OFF) + pointparticles(particleeffectnum(DPP_BURSTFLAME), self.origin, '0 0 0', 1); + misc_particle_on(self.part_emitter); + } + if (self.attachment) { + self.attachment.think = play_light_sound; + self.attachment.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() light_on = +{ + self.estate = ESTATE_ON; + if (self.mdl) setmodel (self, self.mdl); + lightstyle(self.style, "m"); + light_part_emitter_on(); +}; + +//---------------------------------------------------------------------- +void() light_off = +{ + self.estate = ESTATE_OFF; + if (self.mdl) self.model = ""; + lightstyle(self.style, "a"); + if (self.attachment) + sound (self.attachment, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_STATIC); +}; + +/*====================================================================== +/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF x x x x x x x +Non-displayed light +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +style : 0 = normal +1 = flicker (first variety) +2 = slow strong pulse +3 = candle (first variety) +4 = fast strobe +5 = gentle pulse +6 = flicker (second variety) +7 = candle (second variety) +8 = candle (third variety) +9 = slow strobe +10 = flourescent flicker +11 = slow pulse, not fading to black +styles 32-62 are assigned by the light program for switchable lights + +_color : Light color - R/G/B (def='1 1 1') +wait : Fade distance multiplier (def=1) +delay : Attenuation 0=Linear, 1=inverse, 2=Squared, 3=NoFalloff, 4=Minlight, 5=Good Ambient + +mangle : Spotlight direction +angle : Spotlight cone angle (def=40) + +_dirt : Dirt map (override) +_dirtscale : Dirt scale (override) +_deviance : Deviance +_samples : No. of Deviance lights (def=16) +_surface : Surface light texture name +_surface_offset : Surface light offset (def=2) +_softangle : Spotlight soft angle (def=0) +_anglescale : Light angle scale (def=0.5) +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +Non-displayed light. If targeted, it will toggle between on or off + +======================================================================*/ +void() light = +{ + // If no targetname then inert light, safe to remove + if (self.targetname == "") { + remove(self); + return; + } + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } +}; + +/*====================================================================== +/*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF NO_SOUND x x x x x x +Non-displayed light. Makes steady fluorescent humming sound +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +-------- NOTES -------- +Non-displayed light. Makes steady fluorescent humming sound + +======================================================================*/ +void() light_fluoro = +{ + self.noise = "ambience/fl_hum1.wav"; + precache_sound (self.noise); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + + setup_light_sound(); +}; + +/*====================================================================== +/*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8) x NO_SOUND x x x x x x +Non-displayed light. Makes sparking, broken fluorescent sound +-------- KEYS -------- +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +NO_SOUND : No ambient sound +-------- NOTES -------- +Non-displayed light. Makes sparking, broken fluorescent sound + +======================================================================*/ +void() light_fluorospark = +{ + self.noise = "ambience/buzz1.wav"; + precache_sound (self.noise); + + if (!self.style) self.style = 10; + setup_light_sound(); +}; + +/*====================================================================== +/*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF x NO_STATIC x x x X x +Sphere globe light (sprite) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Sphere globe light (sprite) + +======================================================================*/ +void() light_globe = +{ + self.mdl = "progs/s_light.spr"; + precache_model (self.mdl); + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +/*====================================================================== +/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF NO_SOUND NO_STATIC x x x x x +Short wall torch +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Short wall torch + +======================================================================*/ +void() light_torch_on = +{ + self.frame = 0; + self.estate = ESTATE_ON; + lightstyle(self.style, "m"); + light_part_emitter_on(); +}; + +//---------------------------------------------------------------------- +void() light_torch_off = +{ + self.frame = 1; + self.estate = ESTATE_OFF; + lightstyle(self.style, "a"); + if (self.attachment) + sound (self.attachment, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_STATIC); +}; + +//---------------------------------------------------------------------- +void() light_torch_small_walltorch = +{ + self.mdl = "progs/flame.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMET); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_torch_on; + self.estate_off = light_torch_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +/*====================================================================== +/*QUAKED light_flame_large_yellow (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF NO_SOUND NO_STATIC x x x x x +Large yellow flame +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Large yellow flame + +======================================================================*/ +void() light_flame_large_yellow = +{ + self.mdl = "progs/flame2.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + // If DP engine active remove candle model shadow + if (engine == ENG_DPEXT) self.effects = self.effects + EF_NOSHADOW; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.frame = 1; // Switch to frame group 2 (larger flame) + if (!self.alpha) self.alpha = 0.8; + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMEL); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +/*====================================================================== +/*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) LIGHTOFF NO_SOUND NO_STATIC x x x X x +Small yellow flames +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +NO_SOUND : No ambient sound +NO_STATIC : Will not turn into static entity +-------- NOTES -------- +Small yellow flames. + +======================================================================*/ +void() light_flame_small_yellow = +{ + self.mdl = "progs/flame2.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + self.part_active = PARTICLE_STYLE_FLAMES; + if (!self.waitmin) self.waitmin = 2.165; + + // If DP engine active remove candle model shadow + if (engine == ENG_DPEXT) self.effects = self.effects + EF_NOSHADOW; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + if (!self.alpha) self.alpha = 0.8; + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMES); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; +//Duplicate (small yellow flame) +void() light_flame_small_white = { light_flame_small_yellow(); }; + +/*====================================================================== +/*QUAKED light_postlight (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF x x x x x x x +light post (from Quoth) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +light post (from Quoth) +======================================================================*/ +void() light_postlight = +{ + self.mdl = "progs/misc_lightpost.mdl"; + precache_model (self.mdl); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +/*====================================================================== +/*QUAKED light_tubelight (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF x x x x x x x +light Tube (from Quoth) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +light Tube (from Quoth) +======================================================================*/ +void() light_tubelight = +{ + self.mdl = "progs/misc_lighttube.mdl"; + precache_model (self.mdl); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +/*====================================================================== +/*QUAKED light_fixture1 (0 .5 0) (-10 -10 -20) (10 10 20) LIGHTOFF x x x x x x x +light Fixture (from Rubicon) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +light : sets brightness, 300 is default +fixangle : angle the model should be facing; set it to face away from the wall +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +-------- NOTES -------- +light Fixture (from Rubicon) +======================================================================*/ +void() light_fixture1 = +{ + self.mdl = "progs/misc_fixture1.mdl"; + precache_model (self.mdl); + self.angles_y = self.fixangle; + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +/*====================================================================== +/*QUAKED light_candle (0 1 0) (-4 -4 -16) (4 4 16) LIGHTOFF FLAMEOFF x SHADOW x x x x +Wide variety of Candles (from Rogue Software) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : 0=random angle, 1-360=specific +height : size of candle 1=short, 2=medium, 3=regular, -1=random +t_width : width of candle 1=regular, 2=fat, 3=thin, -1=random +lip : Moves model down to ground plane (default = 16) +light : sets brightness, 300 is default +-------- SPAWNFLAGS -------- +LIGHTOFF : Starts off and waits for trigger +FLAMEOFF : The candle is displayed off (no light/flame) +SHADOW : Turn on shadows in DP engine +-------- NOTES -------- +Wide variety of Candles (from Rogue Software) + +======================================================================*/ +void() light_candle_on = +{ + self.estate = ESTATE_ON; + self.frame = 1 + (self.t_width-1)*2; + lightstyle(self.style, "m"); +}; + +//---------------------------------------------------------------------- +void() light_candle_off = +{ + self.estate = ESTATE_OFF; + self.frame = (self.t_width-1)*2; + lightstyle(self.style, "a"); +}; +//---------------------------------------------------------------------- +void() light_candle_setup = +{ + // Setup model and no world interaction + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + // If DP engine active remove candle model shadow + if (engine == ENG_DPEXT && !(self.spawnflags & LIGHT_CANDLESHADOW)) + self.effects = self.effects + EF_NOSHADOW; + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y <= 0) self.angles_y = rint(random()*359); + + // Setup light + if (self.spawnflags & LIGHT_FLAMEOFF) { + self.estate = ESTATE_OFF; + self.frame = (self.t_width-1)*2; + } + + // Is switchable light style defined? + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_candle_on; + self.estate_off = light_candle_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + // Check for static option, after switchable lights + else if (self.spawnflags & ENT_SPNSTATIC) makestatic(self); +}; + +//---------------------------------------------------------------------- +void() light_candle = +{ + // Cannot have randomly selected models for prechache + // Quickload will re-run all spawn functions and try to select + // a different candle model which is not precached + precache_model ("progs/misc_candle1.mdl"); + precache_model ("progs/misc_candle2.mdl"); + precache_model ("progs/misc_candle3.mdl"); + + // Check for size 1=small, 2=medium, 3=regular (def), -1=random + if (self.height < 0) self.height = 1 + rint(random()*2); + if (self.height == 1) self.mdl = "progs/misc_candle1.mdl"; + else if (self.height == 2) self.mdl = "progs/misc_candle2.mdl"; + else self.mdl = "progs/misc_candle3.mdl"; + + // Check for width 1=regular (def), 2=fat, 3=thin, -1=random + // The models are split up into three groups of off/on + if (self.t_width < 0) self.t_width = 1 + rint(random()*2); + else if (self.t_width == 0 || self.t_width > 3) self.t_width = 1; + + self.modelindex = 0; + self.model = string_null; // hide bmodel surface + self.frame = 1 + (self.t_width-1)*2; // Def = on state + self.movetype = MOVETYPE_NONE; // Create baseline + self.solid = SOLID_NOT; + self.nextthink = 0; + + // The model should not be setup flush to floor because it is a light + // source and will look really odd, setup entity 16 units above floor + // and the "lip" key will move it back down again + if (!self.lip) self.lip = 16; + self.origin_z = self.origin_z - self.lip; + + // Check for static entity option first + if (self.spawnflags & ENT_SPNSTATIC) light_candle_setup(); + else { + // Check for spawn delay on model (signon buffer issues) + // Code left so light_candles can be switched on/off + if (self.lighttarget != "" && !self.style) { + self.targetname = self.lighttarget; + // Use the entity state system for max compatibility + self.estate = ESTATE_OFF; + self.use = entity_state_use; + self.estate_on = light_candle_setup; + } + else light_candle_setup(); + } +}; + + +//---------------------------------------------------------------------- +void() light_flame_brazier_short = +{ + self.mdl = "progs/brazshrt.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMET); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_torch_on; + self.estate_off = light_torch_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +//---------------------------------------------------------------------- +void() light_flame_brazier_tall = +{ + self.mdl = "progs/braztall.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMET); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_torch_on; + self.estate_off = light_torch_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +//---------------------------------------------------------------------- +void() light_torch_long_walltorch = +{ + self.mdl = "progs/longtrch.mdl"; + precache_model (self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMET); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_torch_on; + self.estate_off = light_torch_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + +void () light_lantern = { + self.mdl = "progs/lantern.mdl"; + precache_model (self.mdl); + self.angles_y = self.fixangle; + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +void () light_lantern2 = { + self.mdl = "progs/misc_lantern.mdl"; + precache_model(self.mdl); + if (self.noise == "") self.noise = "ambience/fire1.wav"; + precache_sound (self.noise); + if (!self.waitmin) self.waitmin = 2.165; + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) + self.angles_y = rint(random()*359); + + setup_light_sound(); + setup_light_particle(PARTICLE_STYLE_FLAMET); + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_torch_on; + self.estate_off = light_torch_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setup_light_static(); +}; + + +//=============================================================================== +//light_beacon +//=============================================================================== +/*QUAKED light_beacon (0 1 0) (-8 -8 -36) (8 8 8) BLINKING +floor-mounted flashing red beacon +Default light value is 300 +Default style is 0 +Flags: +1 : "Blinking" if you want the beacon to blink (Set style to "16" to match the skin animation.) */ + +void() light_beacon = { + if (self.spawnflags & 1) self.skin = 1; + + self.mdl = "progs/beacon.mdl"; + precache_model (self.mdl); + self.angles_y = self.fixangle; + + if (self.style >= 32) { + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = light_on; + self.estate_off = light_off; + if (self.spawnflags & LIGHT_STARTOFF) self.estate_off(); + else self.estate_on(); + } + else setmodel (self, self.mdl); +}; + +void() bug_bob = { + self.nextthink = time + 0.1; + self.think = bug_bob; + if (self.multiplier > 1) self.multiplier = self.multiplier - 0.15; + if (self.multiplier < 1) self.multiplier = 1; + self.velocity = self.velocity * 0.8 + (self.oldorigin - self.origin) * 0.2; + if (random() < 0.030000 && self.ltime < time) { + self.ltime = time + 6; + self.multiplier = 4.5; + } + self.velocity = normalize(self.velocity); + self.velocity = self.velocity * ((20 + random() * 8) * self.multiplier); +}; + +void() make_bugs = { + local entity bug; + local vector svec; + bug = spawn(); + bug.oldorigin = self.origin; + bug.movetype = MOVETYPE_NOCLIP; + bug.solid = SOLID_NOT; + bug.velocity_x = 20 + random() * -40; + bug.velocity_y = 20 + random() * -40; + bug.velocity_z = 20 + random() * -40; + bug.nextthink = time + 0.1; + bug.think = bug_bob; + bug.classname = "lightchunk"; + bug.frame = 0; + bug.cnt = 0; + if (self.count > 1) + setmodel(bug, "progs/marshsm.spr"); + else + setmodel(bug, "progs/marsh.spr"); + + bug.frame = self.col; + svec_x = 20 + random() * -40; + svec_y = 20 + random() * -40; + svec_z = 20 + random() * -40; + svec = self.origin + svec; + setorigin(bug, svec); + setsize(bug, VEC_ORIGIN, VEC_ORIGIN); + if (self.count < 5) { + self.nextthink = time + 0.1; + self.think = make_bugs; + } else { + remove(self); + } + self.count = self.count + 1; +}; + +void() light_marsh = { + precache_model("progs/marsh.spr"); + precache_model("progs/marshsm.spr"); + make_bugs(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/math.qc b/QC_other/QC_keep/math.qc new file mode 100644 index 00000000..818d57b7 --- /dev/null +++ b/QC_other/QC_keep/math.qc @@ -0,0 +1,445 @@ +//========================================================================== +// Math + +// PM: Moved here because some engines support builtin math functions. +// (e.g., DarkPlaces). + +//float(float a, float b) QC_Min = {if (a < b) return a; return b;} +//float(float a, float b) QC_Max = {if (a > b) return a; return b;} + +// DISABLED -- Unused at the moment. +// Return a number 'n' to the 'exp' power. +// Called easy because it only accepts positive integer powers. +// FIXME: This works only with integers. Add floating type support. +//float(float n, float exp) QC_Power = +//{ +// local float loop; +// local float total; +// +// exp = floor(exp); +// loop = fabs(exp); +// if (!exp) +// return 1; +// total = n; +// while (loop > 1) +// { +// total = total * n; +// loop = loop - 1; +// } +// if (exp < 0) +// { +// if (total) +// total = 1 / total; +// else // Infinity. +// total = 16777215; // Highest number we can use. +// } +// return total; +//}; + +// FIXME: If DarkPlaces, use builtin. +// Returns a vector where x = cosine and y = sine of 'theta'. +vector(float theta) CoSine = +{ + local vector tx, ty, tz, vec; + + tx = v_forward; ty = v_right; tz = v_up; // Save old makevectors. + vec = '0 1 0' * theta; + makevectors (vec); + + vec_x = v_forward_x; // cos + vec_y = v_forward_y; // sin + vec_z = 0; + + v_forward = tx; v_right = ty; v_up = tz; // Restore old makevectors. + return vec; +}; + +// Returns a vector where x = cosine, y = sine, and z = tangent of 'theta'. +vector(float theta) CoST = +{ + local vector vec; + local float inf, qcsin, qccos; + + vec = CoSine (theta); + +// 'inf' represents infinity. Since a finite number is needed, set 'inf' +// to the highest possible value allowed to be returned. The value chosen +// is one million. I could go for broke by using ten million or even +// 16777215, the latter is all 24 bits on, instead. However doing so +// causes rollover problems if a result of 'inf' that high gets added +// or multiplied by other numbers higher than one. One million is +// sufficiently high and allows for some wiggle room. + inf = 1000000; + qccos = vec_x * inf; + qcsin = vec_y * inf; + if (fabs(qccos) < 1) + { // Avoid division by zero. + if (qccos < 0) + qccos = -1; + else + qccos = 1; + } + vec_z = qcsin / qccos; // tan + + return vec; +}; + +// Trigonometric functions. +// Note: Should use builtin when available. +float(float t) SUB_cos = {local vector v; v = CoSine(t); return v_x;}; +float(float t) SUB_sin = {local vector v; v = CoSine(t); return v_y;}; +float(float t) SUB_tan = {local vector v; v = CoST(t); return v_z;}; +// FIXME: Do we need the inverse functions (asin, acos, atan) too? + +// a = dividend, n = divisor. +float(float a, float n) modulo = +{ + if (n) + return a - n * floor(a/n); + return INFINITY; +}; + + +// DISABLED -- Like anglemod, except the range is -180 <= x < 180. +//float(float v) angle180 = +//{ +// v = v - (floor(v/360) * 360); +// if (v >= 180) +// v = v - 360; +// return v; +//}; + +// DISABLED -- Bit shift. +loop does n <<= loop, -loop does n >>= loop. +//float(float n, float loop) bit_shift = +//{ +// if (loop > 0) +// { while (loop > 0) +// {n = n * 2; loop = loop - 1;} +// } +// else if (loop < 0) +// { while (loop < 0) +// {n = n / 2; loop = loop + 1;} +// } +// return n; +//}; + +// Fixed version of 'vectoangles'. +// Note 8/4/2010: Fixed by what standard? Some need it, some don't. +vector(vector dir) Vangles = +{ + dir = vectoangles(dir); + dir_x = anglemod(0 - dir_x); // 'vectoangles' reverses pitch -- fix it! + return dir; +}; + + +//========================================================================== +// Points + +// Returns a point relative to entity 'e'. Vector 'a' adds to e's absmins. +// a: '0 0 0' = mins, '0.5 0.5 0.5' = midpoint, '1 1 1' = maxs. +vector(entity e, vector a) Anypoint = +{ + local vector v; + +// v = e.origin + e.mins; // Was e.absmin. + v = e.absmin; + v_x = v_x + e.size_x * a_x; + v_y = v_y + e.size_y * a_y; + v_z = v_z + e.size_z * a_z; + return v; +}; + +// Returns the center of the entity 'e'. +vector(entity e) Midpoint = {return e.origin + (e.mins + e.maxs)*0.5;}; + +// Returns upper-mid point of a creature, or center of an object. +// Used for aiming by NPCs. +vector(entity e) Aimpoint = +{ + if (e.flags & FLx_CREATURE) + return Anypoint (e, '0.5 0.5 0.7'); + return Midpoint (e); +}; + + +//========================================================================== +// Vectors + +//- - - - - - - - - +// Calculates outgoing vector when bouncing off a surface. +// Variation of SV_ClipVelocity. +// +// dir = inbound vector. +// norm = trace_plane_normal. +// ob = overbounce. Use 1.5 for grenades, 2 for HipLaser. +// stop = stop_epsilon. 0.1 in C code, but use 0 for HipLaser. +//- - - - - - - - - +vector(vector dir, vector norm, float ob, float stop) Vec_Reflect = +{ + local float ddot; // Double dot product, or dot * 2. + + ddot = dir * norm * ob; // 'ob' for overbounce. Was 2. + dir_x = dir_x - (norm_x * ddot); + if (fabs(dir_x) < stop) + dir_x = 0; + dir_y = dir_y - (norm_y * ddot); + if (fabs(dir_y) < stop) + dir_y = 0; + dir_z = dir_z - (norm_z * ddot); + if (fabs(dir_z) < stop) + dir_z = 0; + return dir; +}; + +//- - - - - - - - - - - - - - - - - - - +// Direction Vector Change + +// Originally in 'mirv.qc'. Placed here now that other rocket attacks +// use them. Specifically, rocketters' rockets and players' hydra missile. + +//------------------------------------------------------------------------// +// This returns a unit vector whose direction points toward end if it +// is within theta degrees of dir. If not, the vector returned will +// a direction somewhere between dir and the ideal vector. +// +// Similar to 'ai_turn', but for three dimensions. +// +// NOTE: Assumes (0 <= theta <= 180). +//------------------------------------------------------------------------// +vector(vector dir, vector start, vector end, float theta) Dir_GotoIdeal = +{ + local vector trig; + local vector v1, v2; + local float dist, dot; + local float qccos, qcsin; + + v1 = dir; + v2 = end - start; + dist = vlen(v2); + v2 = normalize(v2); + + dot = v1 * v2; + trig = CoSine(theta); + qccos = trig_x; + qcsin = trig_y; + if (dot < qccos) + { // Endpoint not in the cone. Calculate a new vector toward the + // endpoint that is within the cone. + local vector vx, vy, vz; + local float side, up; + + // Get the three vectors that make up dir. + dir = vectoangles (dir); + dir_x = 0 - dir_x; + makevectors (dir); + vx = v_forward; vy = v_right; vz = v_up; + + // Project, from start, to the point where the endpoint is + // neither ahead nor behind it. + dist = dist * dot; + start = start + v1*dist; + + // Get the dot products of the horizontal and vertical vectors. + dir = normalize(end - start); + side = dir * vy; + up = dir * vz; + + dir = vy*side + vz*up; + dist = vlen(dir); + if (dist == 0) + { // Can't use zero vector, so create a random unit vector. + theta = random() * 360; + trig = CoSine(theta); + dir = vy*trig_x + vz*trig_y; + } + else + { // Make sure we have a unit vector. + dir = normalize(dir); + } + + // Calculate the final vector. The result is already normalized. + dir = vx*qccos + dir*qcsin; + } + else + { // Endpoint is within the cone, so simply take its vector. + dir = v2; + } + + return dir; +}; + +//------------------------------------------------------------------------// +// This changes a directional vector. +// Useful for things that need drunken or spiraling paths. +// +// 'ang1' affects forward vector. +// 'ang2' affects side (right and up) vectors. +//------------------------------------------------------------------------// +vector(vector dir, float ang1, float ang2) Dir_Change = +{ + local vector trig; + + dir = Vangles (dir); + makevectors (dir); + +// Get a vector perpendicular to its direction vector. + trig = CoSine(ang2); + dir = v_right*trig_x + v_up*trig_y; + +// Calculate new direction. + trig = CoSine(ang1); + dir = v_forward*trig_x + dir*trig_y; + + return dir; +}; + +//------------------------------------------------------------------------// +// This randomly changes a vector's path. Used by drunken missiles. +// +// NOTE: Assumes (0 <= theta <= 180). +//------------------------------------------------------------------------// +vector(vector dir, float ang) Dir_Randomize = +{ + local float a1, a2; + + a1 = random()*ang; + a2 = random()*360; // Random angle for perpendicular vector. + return Dir_Change (dir, a1, a2); +}; + + +//========================================================================== +// Randomizers + +// Emulate 'P_Random' from Doom/Heretic source. +// Returns an integer from 0 to 255. +float() prandom = {return (random() * 256) & 255;}; + +//// DISABLED -- Returns a random number between two values. +//float(float lo, float hi) rvalue = {return lo + random() * (hi - lo);}; + + +//========================================================================== +// Damage + +// Damage when hit by a rocket directly. Emulates 100-120 when d = 120. +float(float d) SUB_RandomDamage = {return d / 6 * (5 + random());}; + +// Damage when hit by melee attack. Typical amount is the sum of three +// random calls multiplied by a given number. +float(float mx) SUB_MeleeDamage = +{ + local float d; + + d = random(); + d = d + random(); + d = d + random(); + return d * mx; +}; + +//- - - - - - - - - +// Calculates damage as done in T_RadiusDamage, except for some checks that +// enforce a minimum damage so that the target struck will take damage. +// +// With: +// T_RadiusDamage(self, self.owner, dmg, world); +// A low powered grenade (from an ogre) would cause no damage (or even pain) +// to the target struck if said target was fat enough. +// +// With: +// points = damage calculated by this function, SUB_ExploDamage. +// T_Damage (other, self, self.owner, points); +// T_RadiusDamage (self, self.owner, dmg, world); +// Target struck will take damage. +//- - - - - - - - - +float(entity targ, entity inflictor, float d) SUB_ExploDamage = +{ + local float lo, dist; + local vector org; + + org = Midpoint (targ); + dist = vlen(inflictor.origin - org); + if (dist > d + 40) // Don't use distances greater than the maximum + dist = d + 40; // possible. Helps keep damage higher. + + lo = ceil(d*0.1); // Target will take minimum of 10% damage. + d = d - (0.5 * dist); + if (d < lo) + return lo; // Target takes minimum damage. + return d; +}; + +// DISABLED -- Unused. +//// Calculate an entity's effective health from both its armor and health. +//float(entity ent) ArmoredHealth = +//{ +// if (ent.armorvalue) +// if (ent.armortype) +// { +// local float points, maxed; +// +// points = ent.health + ent.armorvalue; +// if (ent.armortype < 1) +// { maxed = ent.health / (1 - ent.armortype); +// if (points > maxed) +// return maxed; +// } +// return points; +// } +// return ent.health; // Unarmored. +//}; + + +//========================================================================== +// Bits and Bytes + +//======================================================================== +// World of the 24-bit or 3 byte parm. +//----------------------------------------------------------------- +// 7 6 5 4 3 2 1 0 +//----------------------------------------------------------------- +// 128 64 32 16 8 4 2 1 +// 32768 16384 8192 4096 2048 1024 512 256 +// 8388608 4194304 2097152 1048576 524288 262144 131072 65536 +// +// Byte1 = bits 0-7. Byte2 = bits 8-15. Byte3 = bits 16-23. +// = 255 = 65280 = 16711680 +// +// Bit24 = 16777216 +//------------------------------------------------------------------------ +float(float byte1, float byte2, float byte3) parms_pack = +{ + byte1 = byte1 & 255; + byte2 = (byte2 & 255) * 256; + byte3 = (byte3 & 255) * 65536; + return (byte1 + byte2 + byte3); +}; + +float(float pac, float byte) parms_unpack = +{ + if (byte == 1) + return (pac & 255); + if (byte == 2) + return (pac & 65280) / 256; + if (byte == 3) + return (pac & 16711680) / 65536; + return 0; +}; + + +//========================================================================== +// Other + +// Returns gravity multiplier for 'self'. Used by jumping monsters. +float() Gs = +{ + local float g; + + g = cvar("sv_gravity") / 800; + if (self.gravity) + g = g * self.gravity; + return g; +}; + +float SQRT2 = 1.4142; // The square root of 2. diff --git a/QC_other/QC_keep/mathlib.qc b/QC_other/QC_keep/mathlib.qc new file mode 100644 index 00000000..4793685f --- /dev/null +++ b/QC_other/QC_keep/mathlib.qc @@ -0,0 +1,551 @@ +/*====================================================================== + MATHLIB STUFF + + Originally created by FrikaC + Some functions provided by Kashua & LordHavoc & Preach + +======================================================================*/ + +// for speed... +float pi = 3.14159265; +float OneEightyOverPi = 57.29577; +float PiOverOneEighty = 0.017453; + +float() crandom = { return 2*(random() - 0.5); }; + +// You can set the accuracy of mathlib by changing this value. +// If unset, it defaults to 0.001 +float mathlib_accuracy; //accuracy of sqrt & pow + +// Definition/list of all math functions +float(float num) mathlib_sqrt; +float(float num) mathlib_sin; +float(float num) mathlib_cos; +float(float a, float b) mathlib_fast_pow; +float (float number, float exp) mathlib_bitshift; +float(float a, float b) mod; +float(float v) anglemod; +float (float y1, float y2) angcomp; +float (float a, float b) mathlib_min; +float (float a, float b) mathlib_max; +float(float minimum, float val, float maximum) mathlib_bound; +vector() mathlib_randomvec; +float (float num) rad2deg; +float (float num) deg2rad; +float(float theta) mathlib_tan; +float(float y, float x) mathlib_atan2; + +/*---------------------------------------------------------------------- +Will return 0/1 if bitflag is present in bitvalue +----------------------------------------------------------------------*/ +float(float bitvalue, float bitflag) mathlib_bitvalue = +{ + return floor( (bitvalue & bitflag) / bitflag); +}; + +/*---------------------------------------------------------------------- +square root +----------------------------------------------------------------------*/ +float(float num) mathlib_sqrt = +{ + local float apr; + + //this sets a level of accuracy, it's a global float + if(mathlib_accuracy <= 0) mathlib_accuracy = 0.001; + + if (num < mathlib_accuracy) return 0; + if (num>1) apr = num; + else apr = 1; + do { + apr = (num + (apr * apr)) / (2 * apr); + } + while (fabs((apr * apr) - num) > (num * mathlib_accuracy)); + return apr; +}; + +/*---------------------------------------------------------------------- +sine +----------------------------------------------------------------------*/ +float(float num) mathlib_sin = +{ + local vector ang,vf,vu,vr; + + vf = v_forward; + vu = v_up; + vr = v_right; + + ang = '0 1 0' * num; + makevectors(ang); + num = v_forward_y; + + v_forward = vf; + v_up = vu; + v_right = vr; + + return num; +}; + +/*---------------------------------------------------------------------- +cosine +----------------------------------------------------------------------*/ +float(float num) mathlib_cos = +{ + local vector ang,vf,vu,vr; + + vf = v_forward; + vu = v_up; + vr = v_right; + + ang = '0 1 0' * num; + makevectors(ang); + num = v_forward_x; + + v_forward = vf; + v_up = vu; + v_right = vr; + + return num; +}; + +/*---------------------------------------------------------------------- +pow + +raise to a power + +you ought not use this if the power you're raising to is constant +ie, just use r * r * r for cubing, it's a lot faster +----------------------------------------------------------------------*/ +float(float a, float b) mathlib_fast_pow = +{ + local float fb, n, bit, factor; + + fb = fabs(b); + bit = 1; + n = 1; + factor = a; + while (bit <= fb) + { + if (fb&bit) + n = n * factor; + factor = factor * factor; + bit = bit * 2; + } + if (b < 0) + return 1/n; + else + return n; +}; + +float(float a, float b) mathlib_pow = +{ + local float e1,e2,f,i; + + if (mathlib_accuracy <= 0) + mathlib_accuracy = 0.001; + if (fabs(rint(b) - b) <= mathlib_accuracy) + return mathlib_fast_pow(a, rint(b)); + + f = (a - 1) / (a + 1); + //this is the first trick + //we're essentially doing exp(b*log(a)) + //but the power series for log (1+x) is only defined for small x + //however log x = 2 * arctanh((x-1)/(x+1)) which will converge for any x we choose + + e1 = 0; + e2 = 2 * f; + i = 1; + f = f * f; + + // this calculates successive terms of arctanh + //when the absolute value of a term drops + //below accuracy we call it a day + //note that this doesn't actually mean + //the output is accurate to 0.001, there's no + //direct bound on accuracy + while(fabs(e2) > mathlib_accuracy) + { + e1 = e1 + e2; + e2 = e2 * f * ((2 * i) - 1) / ((2 * i) + 1); + i = i + 1; + } + + f = e2 = e1 * b; + e1 = 1; + i = 1; + //same idea, this is the exponential function + //which has a nice power series + //same comments about accuracy apply, except + //the rapid decay of terms mean it's probably + //close to the true value of exp f, if not pow(a,b) + while(fabs(e2) > mathlib_accuracy) + { + e1 = e1 + e2; + i = i + 1; + e2 = e2 * f / i; + } + return e1; +} ; + +/*---------------------------------------------------------------------- +Bitshift +----------------------------------------------------------------------*/ +float (float number, float exp) mathlib_bitshift = +{ + local float bit, fexp; + bit = 1; + fexp = fabs(exp); + number = rint(number); + + while (bit <= fexp) { + if (fexp & bit) { + if (exp > 0) number = number * bit * 2; + else number = floor(number / (bit * 2)); + } + bit = bit * 2; + } + return number; +}; +/*---------------------------------------------------------------------- +Remainder + +Similar to C's % operator, but deals with +negative numbers differently. +----------------------------------------------------------------------*/ +float(float a, float b) mod = +{ + return a - (floor(a / b) * b); +}; + +/*---------------------------------------------------------------------- +mathlib_anglemod + +faster version of id's anglemod +----------------------------------------------------------------------*/ +float(float v) anglemod = +{ + return v - floor(v/360) * 360; +}; + +//---------------------------------------------------------------------- +// Original version from ai.qc +/*float(float v) anglemod = +{ + while (v >= 360) + v = v - 360; + while (v < 0) + v = v + 360; + return v; +}; +*/ + +/*---------------------------------------------------------------------- +angcomp (part of FrikBot) + +subtracts one angle from another +----------------------------------------------------------------------*/ +float (float y1, float y2) angcomp = +{ + y1 = anglemod(y1); + y2 = anglemod(y2); + + local float answer; + answer = y1 - y2; + if (answer > 180) + answer = answer - 360; + else if (answer < -180) + answer = answer + 360; + return answer; +}; + +/*---------------------------------------------------------------------- +min +Returns the lesser of two (or more) numbers +----------------------------------------------------------------------*/ +float (float a, float b) mathlib_min = +{ + if (a<b) + return a; + else + return b; +}; + +float (float a, float b, float c) mathlib_min3 = +{ + if (a<b) + { + if (c<a) + return c; + else + return a; + } + else + { + if (c<b) + return c; + else + return b; + } +}; + +float (float a, float b, float c, float d) mathlib_min4 = +{ + return mathlib_min(mathlib_min3(a,b,c),d); +}; +float (float a, float b, float c, float d, float e) mathlib_min5 = +{ + return mathlib_min3(mathlib_min3(a,b,c),d,e); +}; +float (float a, float b, float c, float d, float e, float f) mathlib_min6 = +{ + return mathlib_min(mathlib_min3(a,b,c), mathlib_min3(d,e,f)); +}; +float (float a, float b, float c, float d, float e, float f, float g) mathlib_min7 = +{ + return mathlib_min3(mathlib_min3(a,b,c), mathlib_min3(d,e,f), g); +}; +float (float a, float b, float c, float d, float e, float f, float g, float h) mathlib_min8 = +{ + return mathlib_min3(mathlib_min3(a,b,c), mathlib_min3(d,e,f), mathlib_min(g, h)); +}; + +/*---------------------------------------------------------------------- +max +Returns the greater of two (or more) numbers +----------------------------------------------------------------------*/ +float (float a, float b) mathlib_max = +{ + if (a>b) + return a; + else + return b; +}; +float (float a, float b, float c) mathlib_max3 = +{ + if (a>b) + { + if (c>a) + return c; + else + return a; + } + else + { + if (c>b) + return c; + else + return b; + } +}; +float (float a, float b, float c, float d) mathlib_max4 = +{ + return mathlib_max(mathlib_max3(a,b,c),d); +}; +float (float a, float b, float c, float d, float e) mathlib_max5 = +{ + return mathlib_max3(mathlib_max3(a,b,c),d,e); +}; +float (float a, float b, float c, float d, float e, float f) mathlib_max6 = +{ + return mathlib_max(mathlib_max3(a,b,c), mathlib_max3(d,e,f)); +}; +float (float a, float b, float c, float d, float e, float f, float g) mathlib_max7 = +{ + return mathlib_max3(mathlib_max3(a,b,c), mathlib_max3(d,e,f), g); +}; +float (float a, float b, float c, float d, float e, float f, float g, float h) mathlib_max8 = +{ + return mathlib_max3(mathlib_max3(a,b,c), mathlib_max3(d,e,f), mathlib_max(g, h)); +}; + +/*---------------------------------------------------------------------- +bound +Returns a number bound to certain limits +----------------------------------------------------------------------*/ +float(float minimum, float val, float maximum) mathlib_bound = +{ + if (val<minimum) + val=minimum; + else if (val>minimum) + val=maximum; + return val; +}; + +/*---------------------------------------------------------------------- +randomvec +Returns a random vector of length < 1 +----------------------------------------------------------------------*/ +vector () mathlib_randomvec = +{ + local vector v; + do + { + v_x = random() * 2 - 1; + v_y = random() * 2 - 1; + v_z = random() * 2 - 1; + } + while(vlen(v) > 1); + return v; +}; + +/*---------------------------------------------------------------------- +Radians <--> Degrees + +Simple functions that convert radians to +degrees. +----------------------------------------------------------------------*/ +float (float num) rad2deg = { return num*OneEightyOverPi; }; +float (float num) deg2rad = { return num*PiOverOneEighty; }; + +/*---------------------------------------------------------------------- +TAN +Changes v_forward, v_right, v_up +----------------------------------------------------------------------*/ +float(float theta) mathlib_tan = +{ + local vector ang; //temporary used to calculate trig values + ang = '0 0 0'; + ang_y = theta; //assign theta to the yaw to simplify reasoning + makevectors(ang); + return v_forward_y / v_forward_x; +}; + +/*---------------------------------------------------------------------- +Inverse TAN +----------------------------------------------------------------------*/ +float(float y, float x) mathlib_atan2 = +{ + local vector ang; //temporary used to calculate trig values + ang = '0 0 0'; + ang_x = x; + ang_y = y; + return vectoyaw(ang); +}; + +/* ********************************************************* + +!!!FTEQCC or FrikQCC only code follows !!! + +This code allows the engine to accelerate math functions + +If not needed, you can simply delete the rest of the file +and call the mathlib functions above directly. + +It checks for the extensions DP_QC_MINMAXBOUND, +DP_QC_RANDOMVEC, DP_QC_SINCOSSQRTPOW, EXT_BITSHIFT + +********************************************************* */ +/* +var float (float num) sqrt; +var float (float num) sin; +var float (float num) cos; +var float (float num, float exp) pow; +var float (float number, float exp) bitshift; +var float (float a, float b) min; +var float (float a, float b, float c) min3; +var float (float a, float b, float c, float d) min4; +var float (float a, float b, float c, float d, float e) min5; +var float (float a, float b, float c, float d, float e, float f) min6; +var float (float a, float b, float c, float d, float e, float f, float g) min7; +var float (float a, float b, float c, float d, float e, float f, float g, float h) min8; +var float (float a, float b) max; +var float (float a, float b, float c) max3; +var float (float a, float b, float c, float d) max4; +var float (float a, float b, float c, float d, float e) max5; +var float (float a, float b, float c, float d, float e, float f) max6; +var float (float a, float b, float c, float d, float e, float f, float g) max7; +var float (float a, float b, float c, float d, float e, float f, float g, float h) max8; +var float (float minimum, float val, float maximum) bound; +var vector() randomvec; + +float(float val) ext_sin = #60; +float(float val) ext_cos = #61; +float(float val) ext_sqrt = #62; +vector() ext_randomvec = #91; +float(float a, float b) ext_min = #94; +float(float a, float b, float c) ext_min3 = #94; +float(float a, float b, float c, float d) ext_min4 = #94; +float(float a, float b, float c, float d, float e) ext_min5 = #94; +float(float a, float b, float c, float d, float e, float f) ext_min6 = #94; +float(float a, float b, float c, float d, float e, float f, float g) ext_min7 = #94; +float(float a, float b, float c, float d, float e, float f, float g, float h) ext_min8 = #94; +float(float a, float b) ext_max = #95; +float(float a, float b, float c) ext_max3 = #95; +float(float a, float b, float c, float d) ext_max4 = #95; +float(float a, float b, float c, float d, float e) ext_max5 = #95; +float(float a, float b, float c, float d, float e, float f) ext_max6 = #95; +float(float a, float b, float c, float d, float e, float f, float g) ext_max7 = #95; +float(float a, float b, float c, float d, float e, float f, float g, float h) ext_max8 = #95; +float(float minimum, float val, float maximum) ext_bound = #96; +float(float a, float b) ext_pow = #97; +float(float number, float quantity) ext_bitshift = #218; + +// This is DP extension, may need to comment out if already defined. +float(string s) checkextension = #99; + +// The engine sin/cos builtins use radians rather than degrees. This is less useful, so convert +float(float val) wrap_sin = { return ext_sin(val*PiOverOneEighty); }; +float(float val) wrap_cos = { return ext_cos(val*PiOverOneEighty); }; + +// this must be called in worldspawn before using any above functions +void () MathlibCheckBuiltins = +{ + local float checkext; + + sqrt = mathlib_sqrt; + cos = mathlib_cos; + sin = mathlib_sin; + pow = mathlib_pow; + randomvec = mathlib_randomvec; + min = mathlib_min; + min3 = mathlib_min3; + min4 = mathlib_min4; + min5 = mathlib_min5; + min6 = mathlib_min6; + min7 = mathlib_min7; + min8 = mathlib_min8; + max = mathlib_max; + max3 = mathlib_max3; + max4 = mathlib_max4; + max5 = mathlib_max5; + max6 = mathlib_max6; + max7 = mathlib_max7; + max8 = mathlib_max8; + bound = mathlib_bound; + bitshift = mathlib_bitshift; + checkext = cvar("pr_checkextension"); + if (checkext) + { + if (checkextension("DP_QC_SINCOSSQRTPOW")) + { + sqrt = ext_sqrt; + cos = wrap_cos; + sin = wrap_sin; + pow = ext_pow; + } + + if (checkextension("DP_QC_RANDOMVEC")) + randomvec = ext_randomvec; + if (checkextension("DP_QC_MINMAXBOUND")) + { + min = ext_min; + min3 = ext_min3; + min4 = ext_min4; + min5 = ext_min5; + min6 = ext_min6; + min7 = ext_min7; + min8 = ext_min8; + max = ext_max; + max3 = ext_max3; + max4 = ext_max4; + max5 = ext_max5; + max6 = ext_max6; + max7 = ext_max7; + max8 = ext_max8; + bound = ext_bound; + } + if (checkextension("EXT_BITSHIFT")) + bitshift = ext_bitshift; + } +}; +*/ + diff --git a/QC_other/QC_keep/misc.qc b/QC_other/QC_keep/misc.qc new file mode 100644 index 00000000..e6f90a3f --- /dev/null +++ b/QC_other/QC_keep/misc.qc @@ -0,0 +1,1495 @@ +/*====================================================================== + MISC ENTITIES +======================================================================*/ +float MISC_STARTOFF = 1; // Start OFF (use DELAY instead!) + +float MISC_FBALLSLIME = 32; // Slime green fire ball +float MISC_DRIPSILENT = 2; // misc_drip has no sound on splash +float MISC_DRIPBLOOD = 16; // blood red drips +float MISC_DRIPSLIME = 32; // slime green drips +float MISC_SMOKENODPMDL = 2; // Do not draw smoke model +float MISC_SMOKENODPFX = 4; // Do not produce any DP smoke effects +float MISC_SPARKBLUE = 2; // misc_spark produces Blue sparks +float MISC_SPARKPALE = 4; // misc_spark produces Pale Yellow sparks +float MISC_SPARKRED = 8; // misc_spark produces Red sparks +float MISC_COLLISION = 2; // misc_model has collision enabled +float MISC_MOVEMENT = 4; // misc_model can be moved around +float MISC_SHAKEVIEWONLY = 2; // No velocity movement + +float MISC_EXPLBOX_MAX = 5; // Maximum amount of skins available + +/*====================================================================== +/*QUAKED misc_explobox (0 0.5 0.8) (-16 -16 0) (16 16 64) x x x x x FLOAT STARTOFF +{ model(":progs/ad171/explode_box1.mdl"); } +Large exploding box +-------- KEYS -------- +target : trigger events when box explodes +skin_override : 0=original, 1=rubicon2, 3=plasma, 4=toxic, 5-6=wood +noise : Explosion sound (def=weapons/r_exp3.wav) +health : Amount of health before exploding (def=15) +dmg : Override radius damage (def=160) +-------- SPAWNFLAGS -------- +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Large exploding box + +/*QUAKED misc_explobox2 (0 0.5 0.8) (-16 -16 0) (16 16 32) x x x x x FLOAT STARTOFF +{ model(":progs/ad171/explode_box2.mdl"); } +Small exploding box +-------- KEYS -------- +target : trigger events when box explodes +skin_override : 0=original, 1=rubicon2, 3=plasma, 4=toxic, 5-6=wood +noise : Explosion sound (def=weapons/r_exp3.wav) +health : Amount of health before exploding (def=15) +dmg : Override radius damage (def=160) +-------- SPAWNFLAGS -------- +FLOAT : No drop to floor test +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Small exploding box + +/*QUAKED func_explobox (0 0.5 0.8) ? x x x x x x STARTOFF x +Exploding box (bmodel) +-------- KEYS -------- +target : trigger events when box explodes +noise : Explosion sound (def=weapons/r_exp3.wav) +health : Amount of health before exploding (def=15) +dmg : Override radius damage (def=160) +_dirt : -1 = will be excluded from dirtmapping +_minlight : Minimum light level for any surface of the brush model +_mincolor : Minimum light color for any surface (def='1 1 1' RGB) +_shadow : Will cast shadows on other models and itself +_shadowself : Will cast shadows on itself +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Exploding box (bmodel) + +======================================================================*/ + +// Animate model skin slowly = 0.3s +//---------------------------------------------------------------------- +void() misc_ebox_0 = [0, misc_ebox_0] { + if (self.attack_finished < time) { + self.lefty = 1 - self.lefty; + self.skin = self.lefty + (self.skin_override * 2); + self.nextthink = time + MODEL_ANIM_SPEED; + } +}; +void(string gibname, float dm) throwpolypgib; + +//---------------------------------------------------------------------- +void() misc_explod_delay = { + // Explosive damage and sound+fx + T_RadiusDamage (self, self, self.dmg, world, DAMAGEALL); + + // Particle explosion drifting upward + particle_explode(self.origin, 50+random()*50, 1, self.part_style, PARTICLE_BURST_UPWARD); + + // Play original explosion sound + //sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + // Special type (hard-coded) of particle explosion + // that only works if particle count=255 :) + particle (self.origin, '0 0 0', 0, 255); + + // Check for any explosion triggers + if (self.target != "") trigger_strs(self.target, other); + + self.origin = self.origin + '0 0 32'; + if (self.classname == "misc_biobox_l" || self.classname == "misc_biobox_s") { + SpawnExplosion(EXPLODE_POISON_MED, self.origin, self.noise); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -50); + throwpolypgib("progs/polypgib.mdl", -50); + throwpolypgib("progs/polypgib.mdl", -60); + throwpolypgib("progs/polypgib.mdl", -60); + throwpolypgib("progs/polypgib.mdl", -75); + throwpolypgib("progs/polypgib.mdl", -75); + } else { + if (self.classname == "misc_plasmabox_l" || self.classname == "misc_plasmabox_s") { + particle_explode(self.origin, 50+random()*50, 2, PARTICLE_BURST_BLUE, PARTICLE_BURST_UPWARD); + SpawnExplosion(EXPLODE_PLASMA_BIG, self.origin, self.noise); + } else { + SpawnExplosion(EXPLODE_SMALL, self.origin, self.noise); + } + } + entity_hide(self); +}; + +// Blow up the box +//---------------------------------------------------------------------- +void() misc_explod_fire = +{ + local entity ent_explode; + + if (self.attack_finished > time) return; + self.attack_finished = time + LARGE_TIMER; + + // Save origin for later + if (self.bsporigin) self.oldorigin = bmodel_origin(self); + else self.oldorigin = self.origin; + + // Switch off everything + self.estate_off(); + + // Stop recursive loops with T_RadiusDamage + // Delay each explosion so its not all at once + // Spawn the explosion/dmg/fx as a new entity + // func_explode does not want to set correct origin + ent_explode = spawn(); + setorigin(ent_explode, self.oldorigin); + ent_explode.noise = self.noise; + ent_explode.classname = self.classname; // inherit classname for special type checks + ent_explode.dmg = self.dmg; + ent_explode.think = misc_explod_delay; + ent_explode.nextthink = 0.01 + random()*0.1; +}; + +//---------------------------------------------------------------------- +void() misc_explobox_use = +{ + // If box is setup off, switch on first + if (self.spawnflags & ENT_STARTOFF) { + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.estate_on(); + } + // No toggle function, just blow it up! + else misc_explod_fire(); +}; + +//---------------------------------------------------------------------- +void() misc_explobox_on = +{ + // If the box has exploded, do nothing + if (self.attack_finished > time) return; + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + self.estate = ESTATE_ON; + if (self.bsporigin) { + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + } + else { + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_NONE; + } + setmodel (self, self.mdl); + // Set skin unless using special misc_biobox or plasmabox from Quoth + if (self.classname != "misc_biobox_l" || self.classname != "misc_biobox_s" || self.classname != "misc_plasmabox_l" || self.classname != "misc_plasmabox_s") { + self.skin = self.skin_override*2; + } + setsize(self, self.bbmins, self.bbmaxs); + + self.th_die = misc_explod_fire; + self.takedamage = DAMAGE_AIM; + + self.nextthink = time + 0.1; + self.think = misc_ebox_0; +}; + +//---------------------------------------------------------------------- +void() misc_explobox_off = +{ + self.estate = ESTATE_OFF; + self.solid = SOLID_NOT; + self.model = ""; + self.takedamage = DAMAGE_NO; + self.th_die = SUB_Null; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() misc_explobox_setup = +{ + if (self.noise == "") self.noise = SOUND_REXP3; + precache_sound (self.noise); + + self.classtype = CT_EXPLO_BOX; + self.classgroup = CG_MISCENT; + if (self.health < 1) self.health = 15; // ID def = 20 + if (!self.dmg) self.dmg = 160; + // Check and setup default box skin + // 0=Original, 1=rubicon2, 3=plasma, 4=toxic + if (self.skin_override < 1 || self.skin_override > MISC_EXPLBOX_MAX) + self.skin_override = 0; + + // Setup particle explosion colour + if (self.skin_override == 2) self.part_style = PARTICLE_BURST_BLUE; + else if (self.skin_override == 3) self.part_style = PARTICLE_BURST_GREEN; + else self.part_style = PARTICLE_BURST_WHITE; + + // Setup exploding model + if (self.bsporigin) { + self.mdl = self.model; // Save model for later + setmodel (self, self.mdl); // set size and link into world + self.bbmins = self.mins; // Save bmodel bounds for later + self.bbmaxs = self.maxs; + } + else { + // Query console variable 'temp1' for model upgrade option. + // Cannot use global vars because they don't exist at this point + // Move the new centered exploding models to match old box origin + // The default is to move all boxes to suit original id maps + if (!query_configflag(SVR_ITEMOFFSET) && self.classname != "misc_biobox_l" && self.classname != "misc_biobox_s" && self.classname != "misc_plasmabox_l" && self.classname != "misc_plasmabox_s") { + self.oldorigin = self.origin + '16 16 0'; + setorigin(self, self.oldorigin); + } + + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0 || (self.angles_y == 0 && !query_configflag(SVR_ITEMROTATE)) ) { + if (self.classname != "misc_biobox_l" && self.classname != "misc_biobox_s" && self.classname != "misc_plasmabox_l" && self.classname != "misc_plasmabox_s") { + self.angles_y = rint(random()*359); + } + } + + // Temporarily enable model/bbox for collision test + // Finalize box location (check drop to floor) + if( !(self.spawnflags & ITEM_FLOATING) ) { + setmodel (self, self.mdl); + setsize(self, self.bbmins, self.bbmaxs); + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_TOSS; + self.origin_z = self.origin_z + 6; + droptofloor(); + if (pointcontents(self.origin) == CONTENT_SOLID) { + dprint ("\n\b[ExplBox]\b "); dprint (self.classname); + dprint (" stuck at ("); dprint (vtos(self.origin)); dprint (")\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_explobox_on; + self.estate_off = misc_explobox_off; + self.estate_use = misc_explobox_use; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() misc_explobox = +{ + self.mdl = "progs/ad171/explode_box1.mdl"; // maps/b_explob.bsp + precache_model (self.mdl); + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 64'; + misc_explobox_setup(); +}; + +void() misc_explobox2 = +{ + self.mdl = "progs/ad171/explode_box2.mdl"; // maps/b_explob2.bsp + precache_model (self.mdl); + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 32'; + misc_explobox_setup(); +}; + +//---------------------------------------------------------------------- +void () func_explobox = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.mdl = self.model; // Brushwork version + self.bsporigin = TRUE; // bmodel object + self.angles = '0 0 0'; // Make sure no angle twist + // Cannot be setup floating (always remove flag) + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_FLOATING); + misc_explobox_setup(); +}; + +//====================================================================== +/*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8) x x x x x SLIME STARTOFF x +Lava Balls, with damage on impact +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +speed : vertical speed (default 1000) +dmg : impact damage (default 5) +delay : base time between spawning fireballs (default 3) +wait : random time default 5 (= time + self.delay + (random() x self.wait) ) +-------- SPAWNFLAGS -------- +SLIME : Green slime version (smoke trail) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Lava Balls, with damage on impact +*/ +//====================================================================== +void() misc_lavaball_fly; +void() misc_lavaball_reset = +{ + self.touch = SUB_Null; + self.flags = 0; + self.model = ""; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity = self.avelocity = '0 0 0'; + self.nextthink = time + self.delay + (random() * self.wait); + self.think = misc_lavaball_fly; +}; + +//---------------------------------------------------------------------- +void() misc_lavaball_touch = +{ + self.touch = SUB_Null; + if (other.takedamage) T_Damage (other, self, self, self.dmg, DAMARMOR); + misc_lavaball_reset(); +}; + +//---------------------------------------------------------------------- +void() misc_lavaball_fly = +{ + if (self.estate & ESTATE_BLOCK) return; + + setmodel (self, self.mdl); + setorigin (self, self.oldorigin); + // Remove all fly/onground flags + self.flags = 0; + + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_TOSS; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + self.velocity_x = (random() * 100) - 50; + self.velocity_y = (random() * 100) - 50; + self.velocity_z = self.speed + (random() * 200); + + self.nextthink = time + 5; + self.think = misc_lavaball_reset; + self.touch = misc_lavaball_touch; +}; + +//---------------------------------------------------------------------- +void() misc_lavaball_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + self.delay + (random() * self.wait); + self.think = misc_lavaball_fly; +}; + +//---------------------------------------------------------------------- +void() misc_fireball = +{ + if (self.spawnflags & MISC_FBALLSLIME) self.mdl = MODEL_PROJ_SLIME; + else self.mdl = MODEL_PROJ_LAVA; + precache_model (self.mdl); + self.classtype = CT_FIREBALL; + self.classgroup = CG_MISCENT; + self.oldorigin = self.origin; + if (self.speed <= 0) self.speed = 1000; + if (self.dmg <= 0) { + if (self.spawnflags & MISC_FBALLSLIME) + self.dmg = 10; //half damage for slime balls + else + self.dmg = 20; + } + if (self.wait <= 0) self.wait = 5; + if (self.delay <= 0) self.delay = 3; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_lavaball_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +void() misc_slimeball = { + self.spawnflags = self.spawnflags | MISC_FBALLSLIME; + self.classname = "misc_fireball"; + misc_fireball(); +}; + +/*====================================================================== +/*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x +sprite based bubble that floats upward +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +sprite based bubble that floats upward + +======================================================================*/ +void() misc_bubble_bob; +void() misc_bubble_remove = +{ + if (other.classtype == self.classtype) return; + remove(self); +}; + +//---------------------------------------------------------------------- +void() misc_bubble_split = +{ + local entity bubble; + + bubble = spawn(); + bubble.classname = self.classname; + bubble.classtype = CT_BUBBLE; + bubble.classgroup = CG_TEMPENT; + setmodel (bubble, self.mdl); + setorigin (bubble, self.origin); + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_NOT; + bubble.velocity = self.velocity; + bubble.nextthink = time + 0.5; + bubble.think = misc_bubble_bob; + bubble.touch = misc_bubble_remove; + + bubble.frame = 1; + bubble.cnt = 10; + setsize (bubble, '-8 -8 -8', '8 8 8'); + + self.frame = 1; // Smaller bubble + self.cnt = 10; + if (self.waterlevel != 3) remove (self); +}; + +//---------------------------------------------------------------------- +void() misc_bubble_bob = +{ + local float rnd1, rnd2, rnd3; + + self.cnt = self.cnt + 1; + if (self.cnt == 4) misc_bubble_split(); + if (self.cnt == 20) { remove(self); return; } + + rnd1 = self.velocity_x + (-10 + (random() * 20)); + rnd2 = self.velocity_y + (-10 + (random() * 20)); + rnd3 = self.velocity_z + 10 + random() * 10; + + if (rnd1 > 10) rnd1 = 5; + if (rnd1 < -10) rnd1 = -5; + + if (rnd2 > 10) rnd2 = 5; + if (rnd2 < -10) rnd2 = -5; + + if (rnd3 < 10) rnd3 = 15; + if (rnd3 > 30) rnd3 = 25; + + self.velocity_x = rnd1; + self.velocity_y = rnd2; + self.velocity_z = rnd3; + + self.nextthink = time + 0.5; + self.think = misc_bubble_bob; +}; + +//---------------------------------------------------------------------- +void() misc_bubble_spawn = +{ + local entity bubble; + if (self.estate & ESTATE_BLOCK) return; + + bubble = spawn(); + bubble.classname = self.classname; + bubble.classtype = CT_BUBBLE; + bubble.classgroup = CG_TEMPENT; + bubble.owner = self; + setmodel (bubble, self.mdl); + setorigin (bubble, self.origin); + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_NOT; + bubble.velocity = '0 0 15'; + bubble.nextthink = time + 0.5; + bubble.think = misc_bubble_bob; + bubble.touch = misc_bubble_remove; + + bubble.frame = bubble.cnt = 0; + setsize (bubble, '-8 -8 -8', '8 8 8'); + self.nextthink = time + random() + 0.5; + self.think = misc_bubble_spawn; +}; + +// Map hack entry point +void() make_bubbles = { + self.mdl = SBUBBLE_DROWN; + misc_bubble_spawn(); +}; + +//---------------------------------------------------------------------- +void() misc_bubble_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + 1 + random(); + self.think = misc_bubble_spawn; +}; + +//---------------------------------------------------------------------- +void() air_bubbles = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = SBUBBLE_DROWN; + precache_model (self.mdl); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_bubble_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +/*============================================================================= + FX drips (based on code from RRP by ijed) + - Rewritten to not keep spawning endless entities + - Modified to have on/off/toggle state + +/*QUAKED misc_drip (0 .5 .8) (-8 -8 -8) (8 8 8) x SILENT x x BLOOD SLIME STARTOFF x +Falling water drip with splash and sound +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +wait : random time between drips (=random() + self.wait) +-------- SPAWNFLAGS -------- +BLOOD : Blood red drips +SLIME : Slime green drips +SILENT : Don't make any drip sound (good for multiple drips) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Falling water drip with splash and sound + +=============================================================================*/ +void() misc_drip_spawn; +void() misc_drip_reset = +{ + self.touch = SUB_Null; + self.frame = self.flags = 0; + setmodel (self, ""); + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity = self.avelocity = '0 0 0'; + self.nextthink = time + random() + self.wait; + self.think = misc_drip_spawn; +}; + +//---------------------------------------------------------------------- +// splash animation (runs at 20fps) +void() s_splash1 = [0, s_splash2] {self.nextthink = time+0.05;}; +void() s_splash2 = [1, s_splash3] {self.nextthink = time+0.05;}; +void() s_splash3 = [2, s_splash4] {self.nextthink = time+0.05;}; +void() s_splash4 = [3, s_splash5] {self.nextthink = time+0.05;}; +void() s_splash5 = [4, s_splash6] {self.nextthink = time+0.05;}; +void() s_splash6 = [5, misc_drip_reset] {self.nextthink = time+0.05;}; + +//---------------------------------------------------------------------- +void() misc_drip_touch = +{ + self.touch = SUB_Null; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + // If water below, shift origin to water surface + if (self.cnt) self.origin = self.pos1; + setorigin(self, self.origin + '0 0 12'); + + // play a random drip sound + if (!(self.spawnflags & MISC_DRIPSILENT)) { + self.lip = random() * 3; + if (self.lip < 1) sound (self, CHAN_AUTO, self.noise1, 1, ATTN_STATIC); + else if (self.lip < 2) sound (self, CHAN_AUTO, self.noise2, 1, ATTN_STATIC); + else sound (self, CHAN_AUTO, self.noise3, 1, ATTN_STATIC); + } + + // small particle effect when hitting something + particle (self.origin+'0 0 1', '0 0 0.5', self.aflag+random()*4, 5+random()*5); + // Switch to splash sprite and animate for 5 frames + setmodel (self, self.headmdl); + s_splash1(); +}; + +//---------------------------------------------------------------------- +// Keep checking while falling for liquid impact +//---------------------------------------------------------------------- +void() misc_drip_water = +{ + if (self.attack_finished < time) misc_drip_reset(); + // Extremely simplified water surface check (pre-calculated) + if (self.origin_z < self.pos1_z) misc_drip_touch(); + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Setup new drip and wait for touch/death/water +//---------------------------------------------------------------------- +void() misc_drip_spawn = +{ + // Is the entity OFF or BLOCKED? + if (self.estate & ESTATE_BLOCK) return; + + // Move drip to start position and setup sprite + setorigin (self, self.oldorigin); + setmodel (self, self.mdl); + self.solid = SOLID_TRIGGER; + if (self.cnt) self.movetype = MOVETYPE_NOCLIP; + else self.movetype = MOVETYPE_FLY; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity_z = -map_gravity; + + // Drip only lasts 3s, don't want to travel forever + self.think = misc_drip_reset; + self.nextthink = time + 3; + self.touch = misc_drip_touch; + + // Is there any water underneath drip? + if (self.cnt) { + self.attack_finished = self.nextthink; + self.nextthink = time + 0.1; + self.think = misc_drip_water; + } +}; + +//---------------------------------------------------------------------- +void() misc_drip_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + random() + self.wait; + self.think = misc_drip_spawn; +}; + +//---------------------------------------------------------------------- +void() misc_drip = +{ + // Pick type of drip sprite based on spawnflags + if (self.spawnflags & MISC_DRIPBLOOD) { + self.mdl = SBLOOD_DRIP; + self.headmdl = SBLOOD_SPLASH; + self.aflag = 64; + } + else if (self.spawnflags & MISC_DRIPSLIME) { + self.mdl = SSLIME_DRIP; + self.headmdl = SSLIME_SPLASH; + self.aflag = 48; + } + else { + self.mdl = SWATER_DRIP; + self.headmdl = SWATER_SPLASH; + self.aflag = 0; + } + // Default cache - water + precache_model (self.mdl); + precache_model (self.headmdl); + + self.noise1 = "misc/drip1.wav"; + self.noise2 = "misc/drip2.wav"; + self.noise3 = "misc/drip3.wav"; + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + // default frequency to 3 seconds + if (self.wait <= 0) self.wait = 3; + + self.classtype = CT_MISCDRIP; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + + // Check point content for wierd setups (inside liquids/solids) + self.height = pointcontents(self.origin); + if (self.height < CONTENT_SOLID) { + dprint ("\b[MISCDRIP]\b Spawned inside liquid!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // If flush against a ceiling, move slightly down + else if (self.height == CONTENT_SOLID) { + self.origin_z = self.origin_z - 2; + } + + // Setup drip particle in the correct start location + self.oldorigin = self.origin; + setorigin(self, self.origin); + + // Find out bottom (world) position first + self.pos1 = self.origin; + traceline (self.pos1, self.pos1 + '0 0 -4096', TRUE, self); + self.pos2 = trace_endpos; + + // Only do loop test if water exists below + self.count = 8; + if (trace_inwater) self.cnt = TRUE; + else self.count = 0; + + // Binary divide the distance to find water surface + while (self.count > 0) { + // Break out early from loop if <8 from water surface + if (fabs(self.pos2_z-self.pos1_z) < 8) self.count = 0; + // Calculate midway point between origin and endtrace + self.pos3 = self.pos1; + self.pos3_z = self.pos1_z + ((self.pos2_z - self.pos1_z)*0.5); + + // Test which half has water and shift top/bottom positions + traceline (self.pos1, self.pos3, TRUE, self); + if (trace_inwater) self.pos2 = self.pos3; + else self.pos1 = self.pos3; + // Only loop a limited amount of times + self.count = self.count - 1; + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_drip_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +// Re-direct to correct entity name +void() fx_drip = { misc_drip(); }; + +//====================================================================== +/*QUAKED misc_smoke (.5 .5 .75) (-8 -8 -8) (8 8 192) x NODPMDL NODPFX x x x STARTOFF x +Smoke model (+DP only smoke effect) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angles : 'pitch roll yaw' up/down, angle, tilt left/right +exactskin : 0=Gunsmoke, 1=Soot, 2=Steam, 3=Toxin, 4=Plague, 5=Incense, 6=Lithium, 7=Flames +alpha : alpha value for model (def=0.65) +wait : time between generation of smoke particles (def=0.1, min=0.01) +delay : random amount of time delay ( time = wait + delay x random() ) +height : Percentage of velocity distance travelled (def=1, range=0-1+) +-------- SPAWNFLAGS -------- +NODPMDL : Do not draw smoke model in DP engine +NODPFX : Do not draw DP smoke particle effect +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Smoke model, +DP only smoke effect (wait/delay/height DP only) +angles = 'pitch roll yaw' up/down, angle, tilt left/right +up/left = negative value, down/right = positive value + +======================================================================*/ +void() misc_smoke_model = +{ + self.count = self.count + 1; + if (self.count > 59) self.count = 0; + self.frame = self.count; + self.think = misc_smoke_model; + self.nextthink = time + 0.1; +}; + +void() misc_smoke_on = +{ + self.estate = ESTATE_ON; + + // Switch on particle emitter if was setup + if (self.part_emitter) misc_particle_on(self.part_emitter); + + // Restore model/size/skin + if (self.mdl != "") { + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.skin = self.exactskin; + self.count = rint(random()*59); + misc_smoke_model(); + } +}; + +//---------------------------------------------------------------------- +void() misc_smoke_off = +{ + self.estate = ESTATE_OFF; + // Turn off model if setup + if (self.mdl != "") self.model = ""; +}; + +//---------------------------------------------------------------------- +void() misc_smoke_setup = +{ + // If target is setup, calculate new facing angle + if (self.target != "") { + if (!self.movetarget) + self.movetarget = find(world, targetname, self.target); + + if (self.movetarget) { + // Check for a Bmodel object (special origin) + if (self.movetarget.bsporigin) self.dest1 = bmodel_origin(self.movetarget); + else self.dest1 = self.movetarget.origin; + // Calculate facing angle towards target + self.movedir = normalize(self.dest1 - self.origin); + self.angles = vectoangles(self.movedir); + self.angles_y = self.angles_y + 180; + // Update velocity direction for DP effect + if (self.part_emitter) self.part_emitter.dpp_vel = self.movedir*self.height; + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_smoke_on; + self.estate_off = misc_smoke_off; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +//---------------------------------------------------------------------- +void() misc_smoke = +{ + self.mdl = "progs/misc_smoke.mdl"; + precache_model (self.mdl); + + self.classtype = CT_MISCSMOKE; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (!self.exactskin) self.exactskin = 0; // Default = 0 + if (self.wait < 0.1) self.wait = 0.1; + if (self.delay <= 0) self.delay = 0.1; + if (self.height <= 0) self.height = 0.5 + random()*0.5; + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) { + // Originally had ef_additive but produced sorting errors + self.effects = self.effects + EF_NOSHADOW; + } + else { + // Setup alpha for non DP engines + if (!self.alpha) self.alpha = 0.5+random()*0.25; + } + + // Calculate smoke particle movedir from angles + makevectors(self.angles); + self.movedir = v_up; + + // Setup some random Y axis rotation if nothing set + if (CheckZeroVector(self.angles)) self.angles_y = rint(random()*360); + + // DP particle effects active? + if (ext_dppart) { + // Remove the model if spawnflag set + if (self.spawnflags & MISC_SMOKENODPMDL) self.mdl = ""; + + // Spawn particle emitter if particles active and not blocked + if (query_configflag(SVR_PARTICLES) && !(self.spawnflags & MISC_SMOKENODPFX) ) { + self.part_active = PARTICLE_STYLE_SMOKE; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) + self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_OFF); + else self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_ON); + } + } + + // Setup target and delay starting model animation + self.nextthink = time + 0.1 + (rint(random()*10) * 0.1); + self.think = misc_smoke_setup; +}; + +/*====================================================================== + spark effect (based on code from Rubicon2 by JohnFitz) + - Modified to have on/off/toggle state via triggers + - extended parameters for angle/speed/custom sounds + +/*QUAKED misc_spark (.5 .75 .5) (-8 -8 -8) (8 8 8) x BLUE PALE RED x x STARTOFF x +Produces a burst of sparks at random intervals +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : If target is a light, will be switched on/off in sync +wait : time delay between bursts Def=2, spark once=-1 +cnt : number of sparks in burst (0.5 + random() x 0.5) Def=16 +angle : direction of sparks to follow, use "360" for 0 +fixangle: 1 = Random Y axis direction of sparks +speed : velocity speed of sparks (def=40) +height : random velocity modifier (def=+/-20) +sounds : 1=sparks, 4=silent, 5=custom +noise : custom sound for sparks +-------- SPAWNFLAGS -------- +BLUE : sparks are blue in colour (def=yellow) +PALE : sparks are pale yellow in colour (def=yellow) +RED : sparks are red in colour (def=yellow) +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Produces a burst of sparks at random intervals +If targeting a light, it must start switched off (lights spawnflag=1) + +======================================================================*/ + +void() misc_sparks_fade1 = [0, misc_sparks_fade2] {self.alpha = 0.8; self.nextthink = time + 0.05;}; +void() misc_sparks_fade2 = [0, misc_sparks_fade3] {self.alpha = 0.6; self.nextthink = time + 0.05;}; +void() misc_sparks_fade3 = [0, misc_sparks_fade4] {self.alpha = 0.4; self.nextthink = time + 0.05;}; +void() misc_sparks_fade4 = [0, SUB_Remove] {self.alpha = 0.2; self.nextthink = time + 0.05;}; + +//---------------------------------------------------------------------- +void() misc_spark_spawn; +void() misc_spark_switchoff = +{ + // Always switch off trigger (lights) + SUB_UseTargets(); + + // Is the entity OFF or BLOCKED? + if (self.estate & ESTATE_BLOCK) return; + // Only spark once (wait for trigger) + if (self.wait > 0) { + self.think = misc_spark_spawn; + self.nextthink = time + self.wait + (random()*self.wait); + } +} + +//---------------------------------------------------------------------- +void() misc_spark_spawn = +{ + local float loopvar; + local entity spark; + + // Is the entity OFF or BLOCKED? + if (self.estate & ESTATE_BLOCK) return; + + // Check for random rotation, most be set for whole batch + // otherwise the sparks will all go in different directions + if (self.fixangle > 0) { + self.angles = '0 0 0'; + self.angles_y = rint(random()*360); + makevectors (self.angles); + self.movedir = v_forward; + } + + // Work out how many sparks to spawn + loopvar = (0.5 + random()*0.5)*self.cnt; + while (loopvar > 0) { + spark = spawn(); + spark.classtype = CT_TEMPSPARK; + spark.classgroup = CG_TEMPENT; + spark.owner = self; + spark.movetype = MOVETYPE_BOUNCE; + spark.solid = SOLID_TRIGGER; + setmodel (spark, self.mdl); + setorigin (spark, self.origin); + setsize (spark, VEC_ORIGIN, VEC_ORIGIN); + spark.gravity = 0.3; + spark.velocity = vecrand(0,self.height,TRUE); + spark.velocity = spark.velocity + (self.movedir * self.speed); + spark.avelocity = '300 300 300'; + spark.nextthink = time + 0.5 + 1.5*random(); + spark.think = misc_sparks_fade1; + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) spark.effects = spark.effects + EF_NOSHADOW; + + // Some brightness variety + if (random() < 0.33) spark.skin = 0; + else if (random() < 0.5) spark.skin = 1; + else spark.skin = 2; + + // Alternative colours (blue, pale yellow & red) + if (self.spawnflags & MISC_SPARKBLUE) spark.skin = spark.skin + 3; + else if (self.spawnflags & MISC_SPARKPALE) spark.skin = spark.skin + 6; + else if (self.spawnflags & MISC_SPARKRED) spark.skin = spark.skin + 9; + + loopvar = loopvar - 1; + } + // Play any spark sound and switch ON any target lights + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_STATIC); + + // Is there any target(s) to switch on + if (self.target) { + SUB_UseTargets(); + // Setup timer to switch off + self.nextthink = time + 0.1 + random() * 0.2; + self.think = misc_spark_switchoff; + } + else { + // Only spark once (wait for trigger) + if (self.wait > 0) { + self.nextthink = time + 0.2 + self.wait + (random()*self.wait); + self.think = misc_spark_spawn; + } + } +}; + +//---------------------------------------------------------------------- +void() misc_spark_on = +{ + self.estate = ESTATE_ON; + self.nextthink = time + 0.1 + random(); + self.think = misc_spark_spawn; +}; + +//---------------------------------------------------------------------- +void() misc_spark = +{ + self.mdl = "progs/ad171/misc_spark.mdl"; + precache_model (self.mdl); + if (self.sounds == 1) self.noise = "misc/spark.wav"; + if (self.noise != "") precache_sound (self.noise); + + self.classtype = CT_MISCSPARK; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (!self.wait) self.wait = 2; // -1 = spark once and turn off + if (!self.cnt) self.cnt = 16; + if (!self.speed) self.speed = 40; + if (!self.height) self.height = 20; + self.estate = ESTATE_OFF; + + // Always convert 0 angle to 360 for setmovedir function + if (CheckZeroVector(self.angles)) self.angles = '0 360 0'; + self.mangle = self.angles; + SetMovedir(); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_spark_on; + if (self.spawnflags & (MISC_STARTOFF | ENT_STARTOFF)) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +Screen Shake (based on code from RRP by ijed/supa) + - Modified to have on/off/toggle state + - added extra sound options + +/*QUAKED misc_shake (.5 .5 .9) (-16 -16 -8) (16 16 8) x VIEWONLY x x x x x x +Shake players view and/or velocity around center of entity +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +count : radius of shake (def = 200) +wait : duration of shake (def = 2s) +dmg : strength at center (def = 200) +sounds : 1=loud rumble (no default) +noise1 : noise to play when starting to shake +noise2 : noise to play when stopping +-------- SPAWNFLAGS -------- +VIEWONLY : Shakes the view, but player movement is not affected +-------- NOTES -------- +Shake players view and/or velocity around center of entity. +Always starts off, requires triggers to activate + +======================================================================*/ +void() misc_shake_think = +{ + local entity plyr; + local float d; + + // Is the shaking over? + if (self.attack_finished < time || self.estate & ESTATE_BLOCK) { + if (self.noise2) sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + // Check state before changing it, entity may be disabled + if (self.estate == ESTATE_ON) self.estate = ESTATE_OFF; + return; + } + + // Create a list of entities to check for players + plyr = findradius(self.origin, self.count); + while(plyr) { + // Only shake players (clients) + if (plyr.flags & FL_CLIENT) { + // Scale effect by distance + d = vlen(self.origin - plyr.origin); + d = (self.count - d)/self.count; + + if (d > 0) { + // shake up the view + plyr.punchangle_x = -1 * (random() + (0.025*self.dmg*d)); + + // push the player around + if (plyr.flags & FL_ONGROUND && !(self.spawnflags & MISC_SHAKEVIEWONLY)) { + d = self.dmg*d; + plyr.velocity_x = plyr.velocity_x + (random()*d*2 - d); + plyr.velocity_y = plyr.velocity_y + (random()*d*2 - d); + plyr.velocity_z = plyr.velocity_z + (random()*d); + } + } + } + // Find next entity in chain + plyr = plyr.chain; + } + + // keep shaking! + self.nextthink = time + 0.1; + self.think = misc_shake_think; +}; + +//---------------------------------------------------------------------- +void() misc_shake_on = +{ + self.estate = ESTATE_ON; + + // Play earthquake LOOP sound + if (self.noise1) sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.attack_finished = time + self.wait; + + // keep checking for players to shake! + self.nextthink = time + 0.1; + self.think = misc_shake_think; +}; + +//---------------------------------------------------------------------- +void() misc_shake = +{ + if (self.sounds == 1) { + self.noise1 = "misc/rumbleloop.wav"; + self.noise2 = "misc/rumbleoff.wav"; + } + else { + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + } + precache_sound (self.noise1); + precache_sound (self.noise2); + + self.classtype = CT_MISCSHAKE; + self.classgroup = CG_MISCENT; + if (!self.dmg) self.dmg = 120; + if (self.count <= 0) self.count = 200; + if (self.wait <= 0) self.wait = 2; + self.attack_finished = 0; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_shake_on; + self.estate = ESTATE_OFF; +}; + +void misc_model(); +//---------------------------------------------------------------------- +// Allows GTK editors to work with Q1 assets easier +void() misc_gtkmodel = { misc_model(); }; + +//====================================================================== +// All dead bodies use the same on/off states +//====================================================================== +void() misc_deadbody_on = +{ + if (self.gibbed == TRUE) return; + + self.estate = ESTATE_ON; // Show entity + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + setmodel(self,self.mdl); // Show model + setsize (self, self.bbmins, self.bbmaxs); + self.bodyonflr = MON_ONFLR; // Let Shadow Axe interact +}; + +//---------------------------------------------------------------------- +void() misc_deadbody_off = +{ + if (self.gibbed == TRUE) return; + + self.estate = ESTATE_OFF; // Hide entity + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + setmodel(self,""); // Show model + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.bodyonflr = ""; // No Shadows Axe interaction +}; + +//---------------------------------------------------------------------- +void() misc_deadbody_setup = +{ + self.classtype = CT_MISCMODEL; + self.classgroup = CG_MISCENT; + self.oldorigin = self.origin; // Store for later + + self.takedamage = DAMAGE_NO; // No projectile interaction + self.deadflag = DEAD_DEAD; // Body is really dead! + self.health = self.max_health = -1; + self.blockudeath = TRUE; // Body is dead, no human death noise + self.gibbed = FALSE; // Still in one piece! + + // Check for random rotation + if (self.angles_y < 0) self.angles_y = rint(random()*360); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_deadbody_on; + self.estate_off = misc_deadbody_off; + if (self.spawnflags & ENT_STARTOFF) entity_state_off(); + else entity_state_on(); +}; + +/*====================================================================== +/*QUAKED misc_player (1 .5 .25) (-16 -16 -24) (16 16 32) x x x x x x STARTOFF x +Dead Player MDL for poses +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +frame : body pose (49=on back, 67-69=against wall, 60/84/93=face down, 102=on side) +exactskin : -1= Random, 0-1 Original, 2-3 Green, 4-5 Yellow, 6-7 Red +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Dead Player MDL for poses +*/ +/*====================================================================== +/*QUAKED misc_demon (1 .5 .25) (-32 -32 -24) (32 32 64) x x x x x x STARTOFF x +Dead demon/fiend for poses +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +frame : body pose (53=on back - def) +exactskin : -1= Random, 0= Original, 1= Green +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Dead demon/fiend for poses +*/ +/*====================================================================== +/*QUAKED misc_dknight (0.75 0.25 0) (-16 -16 -24) (16 16 40) x x x x x x STARTOFF x +Dead Death Knight for poses +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +frame : body pose (223=on front, 237-243=on back - def) +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +Dead Death Knight for poses +*/ + +//---------------------------------------------------------------------- +void() misc_player = +{ + self.mdl = "progs/player.mdl"; // Standard player model + self.gib1mdl = "progs/ad171/w_soldiergun.mdl"; // Unique weapon + self.gib2mdl = "progs/ad171/gib_soldfoot1.mdl"; // Upright foot + self.gib3mdl = "progs/ad171/gib_soldfoot2.mdl"; // Fallen down foot + precache_model (self.mdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + self.gib1sound = GIB_IMPACT_WOOD; + + // uses short red knight bounding box + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + monster_bbox(); + + // Setup random/exact skin choices + if (self.exactskin < 0) self.exactskin = rint(0.5 + random()*7); + if (self.exactskin > 7) self.exactskin = 7; + self.skin = self.exactskin; + + misc_deadbody_setup(); +}; + +//---------------------------------------------------------------------- +void() misc_demon = +{ + self.mdl = "progs/mon_demon.mdl"; + self.headmdl = "progs/h_demon.mdl"; + self.gib1mdl = "progs/ad171/gib_dmleg1.mdl"; // Left leg + self.gib2mdl = "progs/ad171/gib_dmleg2.mdl"; // Right leg + self.gib3mdl = "progs/ad171/gib_dmtail.mdl"; // Tail + self.gib4mdl = "progs/ad171/gib_dmclaw1.mdl"; // Claw 1 + self.gib5mdl = "progs/ad171/gib_dmclaw2.mdl"; // Claw 2 + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); // Always precache extra models + precache_model (self.gib5mdl); // regardless if picked or not + + // Randomly swap in demon claws instead of legs + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + if (random() < 0.5) self.gib2mdl = self.gib5mdl; + + // Setup bounding box based on presets + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + monster_bbox(); + + // Default pose for dead demons + if (self.frame < 0) self.frame = 0; + if (self.frame == 0) self.frame = 53; + + // Setup random/exact skin choices + if (self.exactskin < 0) { + if (random() < 0.5) self.exactskin = 0; + else self.exactskin = 1; + } + if (self.exactskin > 1) self.exactskin = 1; + self.skin = self.exactskin; + // Sync gib model skin to demon skin + self.gib1skin = self.gib2skin = self.gib3skin = self.skin; + + misc_deadbody_setup(); +}; + +//---------------------------------------------------------------------- +void() misc_dknight = +{ + self.mdl = "progs/ad171/mon_dknight.mdl"; // New Hell Knight + self.headmdl = "progs/ad171/h_dknight.mdl"; + self.gib1mdl = "progs/ad171/w_dknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib1mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + // Setup bounding box based on presets + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + monster_bbox(); + + // Default pose for dead death knights + if (self.frame < 0) self.frame = 0; + if (self.frame == 0) self.frame = 243; + + misc_deadbody_setup(); +}; + +/*====================================================================== +/*QUAKED misc_builtineffect (0 .5 .8) (-8 -8 -8) (8 8 8) x +Spawns a builtin particle effect, will toggle if active +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : destination of effect (self -> target) +wait : time between firing of effect (def=0) +delay : random time between firing of effect (def=0s) +count : type of effect to fire + 0=TE_SPIKE (def), 1=TE_SUPERSPIKE, 2=TE_GUNSHOT, + 3=TE_EXPLOSION (sprites), 4=TE_TAREXPLOSION (purple ver) + 5=TE_LIGHTNING1 (Shambler ver), 6=TE_LIGHTNING2 (Player ver) + 7=TE_WIZSPIKE, 8=TE_KNIGHTSPIKE, 9=TE_LIGHTNING3 (boss ver) + 10=TE_LAVASPLASH (boss wakeup), 11=TE_TELEPORT (sparkles) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Spawns a builtin particle effect, will toggle if active +Always starts off, requires triggers to activate + +======================================================================*/ +void() misc_builtineffects_fire = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) self.state = STATE_OFF; + if (self.state == STATE_OFF) return; + + // Play builtin effects at target/self location + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, self.count); + + self.pos2 = self.origin; + + // If lightning effect (self -> target) + if (self.count == TE_LIGHTNING1 || self.count == TE_LIGHTNING2 || + self.count == TE_LIGHTNING3) { + + // Check if target is a Bmodel? (different origin location) + if (self.movetarget.bsporigin) self.pos1 = bmodel_origin(self.movetarget); + else self.pos1 = self.movetarget.origin; + + // The lightning model is made from 30 unit sections stitched together + // reduce the vector length down to 30 unit chunks so it does not + // poke through the destination object + self.pos2 = self.pos1 - self.origin; + self.t_width = vlen(self.pos2); + if (self.t_width > 30) self.t_length = floor(self.t_width / 30) * 30; + else self.t_length = self.t_width; + self.pos2 = normalize(self.pos2); + self.pos2 = self.origin + (self.pos2 * self.t_length); + + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + WriteCoord (MSG_BROADCAST, self.pos2_x); + WriteCoord (MSG_BROADCAST, self.pos2_y); + WriteCoord (MSG_BROADCAST, self.pos2_z); + + // The effect sounds have to come after the write commands + // otherwise the engine will get confused and think the protocol + // has changed, there is an exact format for effects + if (self.count == TE_TELEPORT) { + self.lip = rint(random()*5); + if (self.lip == 0) sound (self.movetarget, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + else if (self.lip == 1) sound (self.movetarget, CHAN_VOICE, "misc/r_tele2.wav", 1, ATTN_NORM); + else if (self.lip == 2) sound (self.movetarget, CHAN_VOICE, "misc/r_tele3.wav", 1, ATTN_NORM); + else if (self.lip == 3) sound (self.movetarget, CHAN_VOICE, "misc/r_tele4.wav", 1, ATTN_NORM); + else sound (self.movetarget, CHAN_VOICE, "misc/r_tele5.wav", 1, ATTN_NORM); + } + else if (self.count == TE_LIGHTNING1 || self.count == TE_LIGHTNING2 || + self.count == TE_LIGHTNING3) { + // Play lightning sound (LG weapon hit) + // Stop the sound constantly playing + if (self.waitmin < time) { + sound (self.movetarget, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.waitmin = time + 0.6; + } + } + else if (self.count == TE_LAVASPLASH) + sound (self.movetarget, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + else if (self.count == TE_EXPLOSION || self.count == TE_TAREXPLOSION) + // Play original explosion sound + sound(self.movetarget, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + + // Continuous mode? + if (self.wait > 0) { + self.think = misc_builtineffects_fire; + self.nextthink = time + self.wait + random()*self.delay; + } + // Fire once and switch off + else self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects_use = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) return; + + // Toggle shooter on/off + if (self.state == STATE_OFF) self.state = STATE_ON; + else self.state = STATE_OFF; + + misc_builtineffects_fire(); +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects_reset = +{ + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects_setup = +{ + // Find any target destinations + if (self.target != "") self.movetarget = find(world, targetname, self.target); + else self.movetarget = self; + + // Lightning effects need source and target to work + // Check target is valid before trying to setup this effect + if (self.count == TE_LIGHTNING1 || self.count == TE_LIGHTNING2 || + self.count == TE_LIGHTNING3 && !self.movetarget) { + dprint("\b[MISC_EFFECTS]\b Missing target for lightning\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = misc_builtineffects_use; + self.estate_reset = misc_builtineffects_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() misc_builtineffects = +{ + // Precache sounds for effects + if (self.count == TE_LAVASPLASH) precache_sound ("boss1/out1.wav"); + + self.classtype = CT_PARTICLEEMIT; + if (self.wait < 0) self.wait = 0; + if (self.delay < 0) self.delay = 0; + if (!self.count) self.count = 0; // def=TE_SPIKE + + self.think = misc_builtineffects_setup; + self.nextthink = time + 0.1 + random(); +}; diff --git a/QC_other/QC_keep/misc_corpses.qc b/QC_other/QC_keep/misc_corpses.qc new file mode 100644 index 00000000..3a402a91 --- /dev/null +++ b/QC_other/QC_keep/misc_corpses.qc @@ -0,0 +1,168 @@ +void() corpse_flayed1 = { + precache_model("progs/corpse_flay.mdl"); + setmodel(self, "progs/corpse_flay.mdl"); + self.frame = 0; + self.skin = 0; +}; + +void() corpse_flayed2 = { + precache_model("progs/corpse_flay.mdl"); + setmodel(self, "progs/corpse_flay.mdl"); + self.frame = 0; + self.skin = 1; +}; + +void() corpse_flayed3 = { + precache_model("progs/corpse_flay.mdl"); + setmodel(self, "progs/corpse_flay.mdl"); + self.frame = 2; + self.skin = 2; +}; + +void() corpse_flayed4 = { + precache_model("progs/corpse_flay.mdl"); + setmodel(self, "progs/corpse_flay.mdl"); + self.frame = 1; + self.skin = 1; +}; + +void() corpse_lynched1 = { + precache_model("progs/corpse_lynch.mdl"); + setmodel(self, "progs/corpse_lynch.mdl"); + self.frame = 0; + self.skin = 0; +}; + +void() corpse_lynched2 = { + precache_model("progs/corpse_lynch.mdl"); + setmodel(self, "progs/corpse_lynch.mdl"); + self.frame = 0; + self.skin = 0; +}; + +void() corpse_lynched3 = { + precache_model("progs/corpse_lynch.mdl"); + setmodel(self, "progs/corpse_lynch.mdl"); + self.frame = 1; + self.skin = 2; +}; + +void() corpse_crucified1 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 7; + self.frame = 9; + makestatic(self); +}; + +void() corpse_crucified2 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 8; + self.frame = 10; + makestatic(self); +}; + +void() corpse_impaled_back1 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 0; + self.frame = 0; + makestatic(self); +}; + +void() corpse_impaled_back2 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 1; + self.frame = 0; + makestatic(self); +}; + +void() corpse_impaled_back3 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 2; + self.frame = 1; + makestatic(self); +}; + +void() corpse_impaled_front1 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 0; + self.frame = 2; + makestatic(self); +}; + +void() corpse_impaled_front2 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 1; + self.frame = 2; + makestatic(self); +}; + +void() corpse_impaled_front3 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 3; + self.frame = 3; + makestatic(self); +}; + +void() corpse_impaled_horizontal1 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 0; + self.frame = 4; + makestatic(self); +}; + +void() corpse_impaled_horizontal2 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 1; + self.frame = 4; + makestatic(self); +}; + +void() corpse_impaled_horizontal3 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 4; + self.frame = 5; + makestatic(self); +}; + +void() corpse_impaled_horizontal4 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 5; + self.frame = 6; + makestatic(self); +}; + +void() corpse_impaled_vertical1 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 0; + self.frame = 7; + makestatic(self); +}; + +void() corpse_impaled_vertical2 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 1; + self.frame = 7; + makestatic(self); +}; + +void() corpse_impaled_vertical3 = { + precache_model("progs/corpse_imp.mdl"); + setmodel(self, "progs/corpse_imp.mdl"); + self.skin = 6; + self.frame = 8; + makestatic(self); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_drake.qc b/QC_other/QC_keep/misc_drake.qc new file mode 100644 index 00000000..2a9438e8 --- /dev/null +++ b/QC_other/QC_keep/misc_drake.qc @@ -0,0 +1,81 @@ +// This spawns a gib from the blood fountain. +// Taken from Zerstorer and adapted to Drake. +void(string gibname, vector av) FtGib = { + local vector vel; + + vel_x = (random() * 100) - 50; + vel_y = (random() * 100) - 50; + vel_z = self.speed + (random() * 200); + Gib_Spawn (self.origin, gibname, vel, av, 0, 0, TRUE, -1); +}; + +void() gibs_fly = { + local float rnum; + + rnum = random(); + if (rnum < 0.15) + { + FtGib ("progs/gib1.mdl", '100 200 300'); //Zer uses gib4.mdl. + FtGib ("progs/gib2.mdl", '200 100 300'); + FtGib ("progs/gib3.mdl", '100 200 300'); + FtGib ("progs/h_player.mdl", '300 200 100'); + + sound (self, CHAN_AUTO, "gibfnt/gf_sbig.wav", 1, ATTN_NORM); + } + else if (rnum < 0.45) + FtGib ("progs/gib1.mdl", '100 200 300'); + else if (rnum < 0.85) + FtGib ("progs/gib2.mdl", '100 200 300'); //Zer uses gib4.mdl. + else + FtGib ("progs/gib3.mdl", '100 200 300'); + + if (random() < 0.5) + sound (self, CHAN_VOICE, "gibfnt/gf_sprt1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "gibfnt/gf_sprt2.wav", 1, ATTN_NORM); + + self.nextthink = time + (random() * 5) + 3; + self.think = gibs_fly; +}; + +void() gibft_use = { + if (self.nextthink == 0) { + self.nextthink = time + self.delay; + self.think = gibs_fly; + } else if (self.lefty) + self.nextthink = 0; + else + remove (self); +}; + +//============ +// --> QUAKED misc_gibft (0 .5 .8) (-8 -8 -8) (8 8 8) +// Gib Fountain -- Zerstorer style. +//============ +void() misc_gibft = { + precache_model ("progs/gib1.mdl"); + precache_model ("progs/gib2.mdl"); + precache_model ("progs/gib3.mdl"); + precache_model ("progs/h_player.mdl"); + precache_sound ("gibfnt/gf_sprt1.wav"); + precache_sound ("gibfnt/gf_sprt2.wav"); + precache_sound ("gibfnt/gf_plop.wav"); + precache_sound ("gibfnt/gf_sbig.wav"); + //self.classname = "blood"; + if (!self.wait) self.wait = 2; + self.nextthink = time + (random() * self.wait); + self.think = gibs_fly; + + if (!self.speed) self.speed = 1000; + if (!self.dmg) self.dmg = 5; + if (!self.delay) self.delay = 0.5; + + if (self.targetname) { + self.lefty = self.spawnflags & 4; + if (self.spawnflags & ENT_STARTOFF) { + self.nextthink = 0; // Start off. + self.think = SUB_Null; + } + self.use = gibft_use; + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_globalstate.qc b/QC_other/QC_keep/misc_globalstate.qc new file mode 100644 index 00000000..37b947ed --- /dev/null +++ b/QC_other/QC_keep/misc_globalstate.qc @@ -0,0 +1,23 @@ +// State flags stored in defskeep.qc +// Client parms decoding and encoding save global state + +void () envglobal_use = { + globalstate = (globalstate | self.stateflags); // Activate global state bit +}; + +void () env_global = { + if (self.stateflags <= 0) return; // do nothing, go idle + self.use = envglobal_use; +}; + +void () logic_auto_think = { + if (self.use) self.use(); + SUB_UseTargets(); + self.think = self.use = SUB_Null; // go idle + self.nextthink = time + 0.100; +}; + +void () logic_auto = { + self.think = logic_auto_think; + self.nextthink = time + 0.6 + self.delay; // Give at least a little more than 0.5s to start all other entities before firing targets +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_keep.qc b/QC_other/QC_keep/misc_keep.qc new file mode 100644 index 00000000..fdabdc8e --- /dev/null +++ b/QC_other/QC_keep/misc_keep.qc @@ -0,0 +1,310 @@ +void () effect_teleport_use = { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_TELEPORT); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + sound (self,CHAN_VOICE,"misc/r_tele1.wav",TRUE,ATTN_NORM); +}; + +void () effect_teleport = { + precache_sound ("misc/r_tele1.wav"); + self.use = effect_teleport_use; +}; + +void() effect_pulse_launch = { + local entity missile; + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "pulse"; + missile.velocity = self.movedir * self.speed; + missile.touch = SUB_Remove; + missile.nextthink = time + 5; + missile.think = SUB_Remove; + missile.effects = EF_DIMLIGHT; + setmodel(missile, "progs/s_null.spr"); + setsize(missile, VEC_ORIGIN, VEC_ORIGIN); + setorigin(missile, self.origin); +}; + +void() effect_pulse_loop = { + if (self.wait > 0) self.nextthink = time + self.wait; + self.think = effect_pulse_loop; + effect_pulse_launch(); + if (self.wait == CONTENT_EMPTY) { + SUB_Remove(); + return; + } +}; + +void() effect_pulse_start = { + self.nextthink = time + self.delay; + self.think = effect_pulse_loop; +}; + +void() effect_pulse = { + precache_model("progs/s_null.spr"); + SetMovedir(); + if (!(self.speed)) self.speed = 400; + if (!(self.delay)) self.delay = 0.1; + if (!(self.wait)) self.wait = 1; + self.nextthink = time + self.delay; + if (self.targetname) { + self.think = SUB_Null; + self.use = effect_pulse_start; + return; + } + self.think = effect_pulse_loop; +}; + +void() info_effect_pulse = { + effect_pulse(); +}; + +void() shaker_think = { + self.nextthink = time + self.lip; + self.think = shaker_think; + if (self.ltime > time) { + self.spawnmaster.punchangle_x = (time - self.ltime) * random() * self.multiplier; + self.spawnmaster.punchangle_y = (time - self.ltime) * random() * self.multiplier; + self.spawnmaster.punchangle_z = (time - self.ltime) * random() * self.multiplier; + } + if (self.ltime < time) SUB_Remove(); +}; + +void() shake_use = { + local entity qent; + qent = spawn(); + qent.owner = self; + qent.movetype = MOVETYPE_NONE; + qent.solid = SOLID_NOT; + qent.spawnmaster = activator; + qent.nextthink = time + self.lip; + qent.think = shaker_think; + qent.multiplier = self.multiplier; + qent.lip = self.lip; + qent.duration = time + self.duration; + qent.ltime = time + self.ltime; + setsize(qent, VEC_ORIGIN, VEC_ORIGIN); + setorigin(qent, self.origin); +}; + +void() info_screenshake = { + if (!(self.ltime)) self.ltime = 1; + if (!(self.lip)) self.lip = 0.010000; + if (!(self.multiplier)) self.multiplier = 0.000500; + self.use = shake_use; +}; + +void(entity e, float magnitude, float interval, float mult) shake_player = { + local entity qent; + qent = spawn(); + qent.owner = self; + qent.movetype = MOVETYPE_NONE; + qent.solid = SOLID_NOT; + qent.spawnmaster = e; + qent.nextthink = time + 0.1; + qent.think = shaker_think; + qent.ltime = time + magnitude; + qent.lip = interval; + qent.multiplier = mult; + setsize(qent, VEC_ORIGIN, VEC_ORIGIN); + setorigin(qent, e.origin); +}; + +void() bombthink = { + T_RadiusDamage(self, self.owner, 512, world,DAMAGEALL); + self.frame = self.frame + 1; + if (self.frame == 24) spawn_big_explosion(self.origin, 0); + if (self.frame > 25) { + SUB_Remove(); + return; + } + self.think = bombthink; + self.nextthink = time + 0.1; +}; + +void() ringthink = { + self.nextthink = time + 0.1; + self.think = ringthink; + self.frame = self.frame + 1; + if (self.frame > 20) SUB_Remove(); +}; + +void() ringprethink = { + self.nextthink = time + 0.1; + self.think = ringthink; + self.avelocity = '0 0 200'; + setmodel(self, "progs/shockwave.mdl"); +}; + +void() W_Bomb = { + local entity bomb; + local entity t; + local float dist; + local entity ring; + if (coop == 1 && self.gotbomb != -1) self.gotbomb = 1; + bomb = spawn(); + bomb.solid = SOLID_NOT; + setsize(bomb, VEC_ORIGIN, VEC_ORIGIN); + setorigin(bomb, self.origin); + setmodel(bomb, "progs/boom.mdl"); + bomb.think = bombthink; + bomb.nextthink = time + 0.1; + bomb.owner = self; + bomb.effects = EF_BRIGHTLIGHT + 32; + bomb.glow_color = 239; + bomb.glow_size = 1000; + if (cvar("pr_checkextension")) { + if (checkextension("DP_TE_CUSTOMFLASH")) { + te_customflash(self.origin, 1000, 5, '1 0.6 0.6'); + bomb.effects = 32; + } + } + spawn_big_explosion(self.origin,1); + t = findradius(self.origin, 10000); + while (t) { + if (t.classname == "player") { + dist = vlen(self.origin - t.origin); + if (dist < 700) { + shake_player(t, 2.5, 0.010000, 8); + } else { + if (dist < 1200) { + shake_player(t, 1, 0.010000, 7); + } else { + shake_player(t, 0.5, 0.010000, 10); + } + } + } + t = t.chain; + } + ring = spawn(); + setorigin(ring, self.origin); + ring.think = ringprethink; + ring.nextthink = time + 0.3; + ring.movetype = MOVETYPE_FLY; + ring.effects = 32; + ring = spawn(); + setorigin(ring, self.origin); + ring.think = ringprethink; + ring.nextthink = time + 0.3; + ring.movetype = MOVETYPE_FLY; + ring.effects = 32; + ring.angles = '0 90 0'; + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z); + if (self.invincible_finished) { + self.items = self.items - IT_INVULNERABILITY; + self.invincible_time = 0; + self.invincible_finished = 0; + } + if (self.cross_finished) { + //self.items2 = self.items2 - IT2_CROSS; + self.cross_finished = 0; + self.cross_time = 0; + self.cross_start = 2; + stuffcmd(self, "v_cshift 0 0 0 0\n"); + } + T_RadiusDamage(bomb, self, 512, self,DAMAGEALL); + T_Damage(self, self, self, -666,DAMARMOR); + self.velocity_z = 700; + sound(self, CHAN_AUTO, "weapons/bombfar.wav", 1, ATTN_NONE); + sound(self, CHAN_AUTO, "weapons/bomb.wav", 1, 0.7); +}; + +void() info_bomb = { + precache_sound("weapons/bomb.wav"); + precache_sound("weapons/bombfar.wav"); + precache_model("progs/v_bomb.mdl"); + precache_model("progs/smlexp.spr"); + precache_model("progs/bigexp.spr"); + precache_model("progs/boom.mdl"); + precache_model("progs/shockwave.mdl"); + self.use = W_Bomb; +}; + +void() splash_think = { + local vector vec; + local float variance; + variance = vlen(self.movedir) / 2; + vec_x = self.movedir_x - variance + random() * variance * 2; + vec_y = self.movedir_y - variance + random() * variance * 2; + vec_z = self.movedir_z - variance + random() * variance * 2; + particle (self.origin, vec, self.col, self.volume); + self.nextthink = time + self.wait; +} + + +/*QUAKED misc_splash (0 .5 .8) (-8 -8 -8) (8 8 8) +Produces a continuous particle splash for waterfalls +"color" color of particles. 0 through 15, corresponds to a row of the quake palette. (default 0) +"movedir" average movement vector of particles (default 0 0 4) +"wait" time between particle generation cycles. (default 0.1) +"volume" density of particles. (default 10) +*/ +void() misc_splash = { + if (!self.wait) self.wait = 0.1; + if (!self.movedir) self.movedir = '0 0 4'; + if (!self.volume) self.volume = 10; + self.col = self.col * 16; + self.nextthink = time + self.wait; + self.think = splash_think; +}; + +float FLAG_REDORANGE = 1; +float FLAG_YELLOW = 2; +float FLAG_BLUE = 4; +float FLAG_WHITE = 8; +float FLAG_DARKRED = 16; + +void () light_globecolor = { + + if ( (self.spawnflags & FLAG_REDORANGE) ) { + + precache_model ("progs/s_light2.spr"); + setmodel (self,"progs/s_light2.spr"); + makestatic (self); + + } + if ( (self.spawnflags & FLAG_YELLOW) ) { + + precache_model ("progs/s_light3.spr"); + setmodel (self,"progs/s_light3.spr"); + makestatic (self); + + } + if ( (self.spawnflags & FLAG_BLUE) ) { + + precache_model ("progs/s_light4.spr"); + setmodel (self,"progs/s_light4.spr"); + makestatic (self); + + } + if ( (self.spawnflags & FLAG_WHITE) ) { + + precache_model ("progs/s_light5.spr"); + setmodel (self,"progs/s_light5.spr"); + makestatic (self); + + } + if ( (self.spawnflags & FLAG_DARKRED) ) { + + precache_model ("progs/s_light6.spr"); + setmodel (self,"progs/s_light6.spr"); + makestatic (self); + + } + if ( (self.spawnflags & FALSE) ) { + + precache_model ("progs/s_light.spr"); + setmodel (self,"progs/s_light.spr"); + makestatic (self); + + } + +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_props.qc b/QC_other/QC_keep/misc_props.qc new file mode 100644 index 00000000..e15c6c3a --- /dev/null +++ b/QC_other/QC_keep/misc_props.qc @@ -0,0 +1,202 @@ +/*====================================================================== +QUAKED misc_model (1 .5 .25) (-16 -16 -16) (16 16 16) x COLLISION x x x x STARTOFF x +MDL files that can be setup with specific frame/skin and animate groups +-------- KEYS -------- +mdl : specify model to load, full path (progs/ad171/misc_candle1.mdl) falls back to model if mdl not present +targetname : toggle state (use trigger ent for exact state) +angle : facing angle (-1 = random position) +angles : 'pitch roll yaw' up/down, angle, tilt left/right +ideal_yaw : = 1 Setup model with random Y axis rotation +pos1 : used for selection of frame(s) has several setups + X=0, Y=0, Z=exact frame number + X->Y, Z=0 Randomly pick a frame from the X,Y range + X->Y, Z=-1 Animate between the X,Y range, can forward or backward setup +pos2 : used for the selection of skin(s) has several setups + X=0, Y=0, Z=exact skin number + X->Y, Z=0 Randomly pick a skin from the X,Y range +-------- SPAWNFLAGS -------- +COLLISION : model bbox collision enabled +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +MDL files that can be setup with specific frame/skin and animate groups + +======================================================================*/ +float MISC_STATIC = 1; + +void() misc_model_loop = +{ + if (self.estate & ESTATE_BLOCK) return; + + self.height = self.height + self.lip; + if (self.lip > 0 && self.height > self.pos1_y) self.height = self.pos1_x; + else if (self.lip < 0 && self.height < self.pos1_y) self.height = self.pos1_x; + + self.frame = self.height; + self.think = misc_model_loop; + self.nextthink = time + self.speed; +}; + +//---------------------------------------------------------------------- +void() misc_model_on = +{ + // Check if there is any spawn/on delay setup + // Useful for delay spawning models on to platform/doors + if (self.delay > 0) { + // Feed back into this function + self.think = misc_model_on; + self.nextthink = time + self.delay; + // The delay only works once + self.delay = 0; + return; + } + + self.estate = ESTATE_ON; + + setmodel (self, self.mdl); + // Restore model/size and check if collision needed + if (self.spawnflags & MISC_COLLISION) { + self.solid = SOLID_BBOX; + setsize (self, self.mins , self.maxs); + } + else setsize (self, VEC_ORIGIN, VEC_ORIGIN); + setorigin(self, self.oldorigin + self.view_ofs); + + if (self.spawnflags & MISC_MOVEMENT) { + // Turn misc model into an item (can work with plats/doors) + self.movetype = MOVETYPE_TOSS; + self.solid = SOLID_TRIGGER; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + self.velocity = '0 0 0'; + // Make sure the misc model starts on the ground + self.origin_z = self.origin_z + 6; + if (!droptofloor()) { + dprint ("\n\b[Model]\b "); dprint (self.mdl); + dprint (" stuck at ("); dprint (vtos(self.origin)); dprint (")\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // Make sure no touch function is active + self.touch = SUB_Null; + } + + // Setup skin number (range or exact) + self.skin = self.pos2_z; + + // Check to see if we should make this static + if (self.spawnflags & ENT_SPNSTATIC) { + if (self.pos1_z) + self.frame = self.pos1_z; + + makestatic(self); + } else { + // Check for manual animation loops + if (self.pos1_z == -1) { + self.height = self.pos1_x; + if (self.pos1_x < self.pos1_y) self.lip = 1; + else self.lip = -1; + // Manually animate model + misc_model_loop(); + } else self.frame = self.pos1_z; // Exact frame number + } +}; + +//---------------------------------------------------------------------- +void() misc_model_off = +{ + // Turn off model/world interaction + self.estate = ESTATE_OFF; + self.model = string_null; + self.solid = SOLID_NOT; +}; + +//---------------------------------------------------------------------- +void() misc_model = { + // Is the model defined using the noise key? + if (!self.mdl) { + if (self.model != "") { + self.mdl = self.model; // if .model was accidentally used and mdl is not set, use .model instead + } else { + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + precache_model (self.mdl); + self.classtype = CT_MISCMODEL; + self.classgroup = CG_MISCENT; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.oldorigin = self.origin; // Store for later + + // Override angles with mangle + if (!self.mangle) { + // Setting the angle key in the editor to UP/DOWN = random rotation + if (self.angles_y < 0) self.angles_y = rint(random()*360); + self.mangle = self.angles; // Save for later + } + + if (!self.speed) self.speed = 0.1; // Manual animation tick speed + + // Has a frame range been defined? + if (self.pos1_x != self.pos1_y) { + // Make sure the range is the right way around + // X has to be the lowest number of the two (X/Y) + if (self.pos1_x > self.pos1_y) { + self.frame_box = self.pos1_x; + self.pos1_x = self.pos1_y; + self.pos1_y = self.frame_box; + } + // Randomly pick frame number from a range? + // Work out random different and add to X base + if (self.pos1_z == 0) { + // Double check lower limit is not negative + if (self.pos1_x < 0) self.pos1_x = 0; + // Work out random range first and then add to base + self.frame_box = fabs(self.pos1_y - self.pos1_x); + self.pos1_z = self.pos1_x + rint(random()*self.frame_box); + // Double check the frame is within the specified range + if (self.pos1_z < self.pos1_x) self.pos1_z = self.pos1_x; + if (self.pos1_z > self.pos1_y) self.pos1_z = self.pos1_y; + } + // Manual frame animation required + else self.pos1_z = -1; + } else { + // If no exact frame bas specified, reset frame to default = 0 + if (self.pos1_z < 1) self.pos1 = '0 0 0'; + } + + // Has a skin range been defined? + if (self.pos2_x != self.pos2_y) { + self.pos2_z = rint( random() * fabs(self.pos2_y - self.pos2_x) ); + } else { + // If no exact frame bas specified, reset frame to default = 0 + if (self.pos2_z < 1) self.pos2 = '0 0 0'; + } + + // Cannot have static and movement at the same time! + if (self.spawnflags & MISC_MOVEMENT) { + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_SPNSTATIC); + } + + // Setup random rotation + if (self.ideal_yaw > 0 && query_configflag(SVR_ITEMROTATE) == FALSE ) + self.angles_y = rint(random()*359); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = misc_model_on; + self.estate_off = misc_model_off; + if (self.spawnflags & ENT_STARTOFF) entity_state_off(); + else entity_state_on(); +}; + +// Make quoth users happy! +void () mapobject_custom = { + misc_model(); +}; + +void () misc_misc = { + misc_model(); +}; diff --git a/QC_other/QC_keep/misc_quoth.qc b/QC_other/QC_keep/misc_quoth.qc new file mode 100644 index 00000000..c8a473cd --- /dev/null +++ b/QC_other/QC_keep/misc_quoth.qc @@ -0,0 +1,49 @@ +void () misc_biobox_l = { + self.mdl = "progs/b_bio_l.bsp"; + precache_model (self.mdl); + precache_model ("progs/polypgib.mdl"); + precache_sound ("boglord/slime_explode.wav"); + self.noise = "boglord/slime_explode.wav"; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 64'; + self.dmg = 80; + self.skin_override = 3; // Green particle burst + misc_explobox_setup(); +}; + +void () misc_biobox_s = { + self.mdl = "progs/b_bio_s.bsp"; + precache_model (self.mdl); + precache_model ("progs/polypgib.mdl"); + precache_sound ("boglord/slime_explode.wav"); + self.noise = "boglord/slime_explode.wav"; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 32'; + self.dmg = 80; + self.skin_override = 3; // Green particle burst + misc_explobox_setup(); +}; + +void () misc_plasmabox_l = { + self.mdl = "progs/b_plas_l.bsp"; + precache_model (self.mdl); + precache_sound ("weapons/lg_explode2.wav"); + self.noise = "weapons/lg_explode2.wav"; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 64'; + self.dmg = 200; + self.skin_override = 2; // Blue particle burst + misc_explobox_setup(); +}; + +void () misc_plasmabox_s = { + self.mdl = "progs/b_plas_s.bsp"; + precache_model (self.mdl); + precache_sound ("weapons/lg_explode2.wav"); + self.noise = "weapons/lg_explode2.wav"; + self.bbmins = '-16 -16 0'; + self.bbmaxs = '16 16 32'; + self.dmg = 200; + self.skin_override = 2; // Blue particle burst + misc_explobox_setup(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_rubicon2.qc b/QC_other/QC_keep/misc_rubicon2.qc new file mode 100644 index 00000000..d89573ea --- /dev/null +++ b/QC_other/QC_keep/misc_rubicon2.qc @@ -0,0 +1,199 @@ +/*============================================================================== + +Rubicon 2 code by john fitzgibbons + +Files created for rubicon 2: +- rubicon2.qc + * misc_flag animated hanging banner + * misc_sparks spark emitter +- dread.qc * monster_dreadnaught soldier with flame thrower +- floyd.qc * monster_floyd automaton enemy +- centurion.qc * monster_centurion air centurion +- turret.qc * func_turret defense turret + +Files modified for rubicon 2 (search for "johnfitz" to find each modified bit): + +- ai.qc * modified pain_forward() so floyd animations look better + * added new sight sounds: floyd, dread + * fixed monsters attacking intermission camera +- buttons.qc * added "movedir" key -- use it to set a button's move vector directly +- client.qc * added new obituaries + * removed axe and shotgun from default items in SetNewParms() but only on certain maps + * added code for impulse 666 (resurrection cheat) + * fixed armor absorbs drowning damage + * added ladder movement code + * added burning player code +- combat.qc * modified T_Damage() so that armour won't protect you from drowning damage +- defs.qc * added new fields and constants + * changed IT_EXTRA_WEAPON to IT_NO_WEAPON +- doors.qc * fixed unlock sound not being played on keyed doors + * added "movedir" key -- use it to set a door's move vector directly +- items.qc * weapon_axe + * weapon_shotgun +- fish.qc * fixed fish staying solid too long after death +- misc.qc * fixed ambient sounds consume edicts + * ambient_general +- monsters.qc * fixed fish count twice towards total_monsters +- plats.qc * added "retrigger" flag to func_train -- train will wait to be retriggered at each path_corner + * more func_train sound options +- player.qc * added player hurt sounds: steam(smoke), flame +- progs.src * added lines to compile the new .qc files +- triggers.qc * trigger_setskill is now targetable +- weapons.qc * added code for having no weapons (IT_NO_WEAPON) + * added code to make a clanking sound when hitting damagable brushmodels with axe + * fixed impulsecommands() called even though impulse = 0 + * added new cheats (impulse 252, 253, 254 = ring, biosuit, pent) +- world.qc * fixed sounds for cheats not being precached + * added lightstyles 12 through 15 + +Files added for rubicon2: + +- hiprot.qc * info_rotate + * func_movewall + * func_rotate_door + * func_rotate_entity + * func_rotate_train + * path_rotate + * rotate_object + * added sounds 4 = screechy metal for func_rotate_door + +==============================================================================*/ + +/* +=============================================================================== +misc_flag +=============================================================================== +*/ + +/*QUAKED misc_flag (1 0 0) (-8 -8 -8) (8 8 8) NOT_ANIMATED BIG +A hanging banner, gently waving in the wind. Normal dimensions: 64 wide by 144 long. + +Flags: +"Not Animated" Banner is not animated. +"Big" Banner is twice as big: 128 wide by 288 long. +*/ +void () misc_flag = +{ + precache_model ("progs/flag.mdl"); + setmodel (self, "progs/flag.mdl"); + self.frame = (self.spawnflags & 3); + makestatic (self); +}; + +/* +=============================================================================== +misc_sparks +=============================================================================== +*/ + +void() sparks_fade1 = [0, sparks_fade2] {self.alpha = 0.8; self.nextthink = time + 0.05;}; +void() sparks_fade2 = [0, sparks_fade3] {self.alpha = 0.6; self.nextthink = time + 0.05;}; +void() sparks_fade3 = [0, sparks_fade4] {self.alpha = 0.4; self.nextthink = time + 0.05;}; +void() sparks_fade4 = [0, SUB_Remove] {self.alpha = 0.2; self.nextthink = time + 0.05;}; + +void() sparks_use = +{ + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + else + self.spawnflags = self.spawnflags + ENT_STARTOFF; +}; + +void() make_sparks; + +void() spark_turnofflight = +{ + SUB_UseTargets(); + self.think = make_sparks; + self.nextthink = time + (random() + 0.5)*self.wait - 0.15; +} + +void() make_sparks = +{ + + if (self.spawnflags & ENT_STARTOFF) + { + self.nextthink = time + 0.1; + self.think = make_sparks; + } + else + { + local float i; + i = -0.25*self.cnt + random()*0.5*self.cnt; + while (i < self.cnt) + { + + local entity spark; + spark = spawn(); + spark.owner = self; + setmodel (spark, "progs/spark.mdl"); + setorigin (spark, self.origin); + spark.movetype = MOVETYPE_BOUNCE; + spark.solid = SOLID_TRIGGER; + spark.gravity = 0.3; + spark.velocity_x = -40 + random() * 80; + spark.velocity_y = -40 + random() * 80; + spark.velocity_z = -40 + random() * 80; + spark.avelocity = '3000 3000 3000'; + spark.nextthink = time + 0.5 + 1.5*random(); + spark.think = sparks_fade1; + spark.classname = "spark"; + + if (random() < 0.33) + spark.skin = 0; + else if (random() < 0.5) + spark.skin = 1; + else + spark.skin = 2; + + if (self.spawnflags & SPARKS_PALE) + spark.skin = spark.skin + 6; + else if (self.spawnflags & SPARKS_BLUE) + spark.skin = spark.skin + 3; + + setsize (spark, '0 0 0', '0 0 0'); + i = i + 1; + } + if (self.sounds == 1) + sound (self, CHAN_AUTO, "misc/spark.wav", 1, ATTN_STATIC); + SUB_UseTargets(); + self.nextthink = time + 0.1 + random() * 0.1; + self.think = spark_turnofflight; + + } + +}; + +/*QUAKED misc_sparks (0 .5 .8) (-8 -8 -8) (8 8 8) START_OFF SPARKS_BLUE SPARKS_PALE +Produces a burst of yellow sparks at random intervals. If targeted, it will toggle between on or off. If it targets a light, that light will flash allong with each burst of sparks. Note: targeted lights should be set to START_OFF. + +SPARKS_BLUE: sparks are blue in color + +SPARKS_PALE: sparks are pale yellow in color + +Keys: + +"wait" is the average delay between bursts (variance is 1/2 wait). Default is 2. + +"cnt" is the average number of sparks in a burst (variance is 1/4 cnt). Default is 15. + +"sounds" +0) no sound +1) sparks +*/ +void() misc_sparks = +{ + precache_model ("progs/spark.mdl"); + precache_sound ("misc/spark.wav"); + + if (!self.movedir) + self.movedir = '0 0 -30'; + if (!self.wait) + self.wait = 2; + if (!self.cnt) + self.cnt = 15; + + self.use = sparks_use; + self.nextthink = time + random()*0.1; + self.think = make_sparks; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_targetdummy.qc b/QC_other/QC_keep/misc_targetdummy.qc new file mode 100644 index 00000000..6d0a8346 --- /dev/null +++ b/QC_other/QC_keep/misc_targetdummy.qc @@ -0,0 +1,417 @@ +/*====================================================================== +/*QUAKED misc_targetdummy (0 .5 .5) (-32 -32 -24) (32 32 64) KNIGHT WIZARD OGRE HELL_KNIGHT ZOMBIE DEMON SHALRATH SHAMBLER +Target practice dummy +------- KEYS -------- +noise1 : Targetnumber tracking weapon used +noise2 : Targetnumber tracking enemy distance +noise3 : Targetnumber tracking damage +noise4 : Targetnumber tracking % efficency +wait : Impact marker removal time (def=2) +-------- SPAWNFLAGS -------- +KNIGHT : Knight model +WIZARD : Wizard model +OGRE : Ogre model +HELL_KNIGHT : Hell Knight model +ZOMBIE : Zombie model +DEMON : Demon model +SHALRATH : Shalrath model +SHAMBLER : Shambler model +------- NOTES -------- +Target practice dummy + +======================================================================*/ +float MISC_TARGKNIGHT = 1; +float MISC_TARGWIZARD = 2; +float MISC_TARGOGRE = 4; +float MISC_TARGHELLKNIGHT = 8; +float MISC_TARGZOMBIE = 16; +float MISC_TARGDEMON = 32; +float MISC_TARGSHALRATH = 64; +float MISC_TARGSHAMBLER = 128; + +//---------------------------------------------------------------------- +void(float tvalue, string tdstr) misc_targetdummy_trigger = +{ + local entity tdfind, tself, tother; + if (tdstr == "") return; + + self.targetnumber = tvalue; + tdfind = find(world, targetname, tdstr); + if (tdfind.classtype == CT_TARGETNUMBER) { + tself = self; tother = other; + self = tdfind; other = tself; + self.use(); + self = tself; other = tother; + } +}; + +//---------------------------------------------------------------------- +void() misc_targetdummy_stand = +{ + // Cycle around standing animation + self.frame = self.frame + 1; + if (self.frame == self.pos1_y) self.frame = self.pos1_x; + self.nextthink = time + 0.1; + + // Check for any accumulating damage totals + if (self.attack_finished < time) { + dprint("Wpn ("); + if (self.weapon & IT_SHOTGUN) { + if (self.perms & IT_BLASTER) { + dprint("Laser Blaster"); + } else { + dprint("Shotgun"); + } + } + else if (self.weapon & IT_SUPER_SHOTGUN && self.moditems & IT_UPGRADE_SSG) + dprint("Shotgun Upgrade"); + else if (self.weapon & IT_SUPER_SHOTGUN) dprint("Super Shotgun"); + else if (self.weapon & IT_NAILGUN) dprint("Nail Gun"); + else if (self.weapon & IT_SUPER_NAILGUN) dprint("Super Nail Gun"); + else if (self.weapon & IT_GRENADE_LAUNCHER) dprint("Grenade Launcher"); + else if (self.weapon & IT_ROCKET_LAUNCHER) dprint("Rocket Launcher"); + else if (self.weapon & IT_LIGHTNING && self.moditems & IT_UPGRADE_LG) + dprint("Lightning Upgrade"); + else if (self.weapon & IT_LIGHTNING) dprint("Lightning Gun"); + else dprint("Unknown"); + dprint(") Dist ("); dprint(ftos(self.enemydist)); + dprint(") Dmg ("); dprint(ftos(self.dmg)); + dprint(") % ("); + if (self.weapon & IT_SHOTGUN || self.weapon & IT_SUPER_SHOTGUN) { + if (self.weapon & IT_SHOTGUN) self.cnt = self.dmg / 28; + else if (self.moditems & IT_UPGRADE_SSG) self.cnt = self.dmg / 84; + else self.cnt = self.dmg / 56; + self.cnt = self.cnt * 100; + } + else self.cnt = 100; + dprint(ftos(self.cnt)); + dprint(")\n"); + + misc_targetdummy_trigger(self.weapon, self.noise1); + misc_targetdummy_trigger(self.enemydist, self.noise2); + misc_targetdummy_trigger(self.dmg, self.noise3); + misc_targetdummy_trigger(self.cnt, self.noise4); + + // Reset health, damage timer and total + self.health = self.max_health; + self.attack_finished = LARGE_TIMER; + self.dmg = 0; + } +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) misc_targetdummy_pain = +{ + // want all damage to go through pain function, reset timer + self.pain_finished = 0; + + // Play a pain sound every second + if (self.pain_check < time) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_check = time + 1; + } + + // If the attacker is a player, record details + if (attacker.flags & FL_CLIENT) { + self.weapon = attacker.weapon; + self.items = attacker.items; + self.moditems = attacker.moditems; + self.enemydist = range_distance(attacker, TRUE); + } + else self.weapon = self.enemydist = 0; + + // The damage value is different depending on projectile type + if (inflictor.classgroup == CG_PROJSHELLS) self.dmg = damage; + else self.dmg = self.dmg + damage; + // reset timer for accumulating damage over time + self.attack_finished = time + 0.5; + + // Spawn a marker to show impact location + // Will remove self after certain amount of time + newmis = spawn(); + newmis.classtype = CT_DEVMARKER; + newmis.movetype = MOVETYPE_NONE; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_IMPACT); + // Randomize between 8 yellow skins + newmis.skin = rint(random()*7); + // Take projectile impact location + setorigin(newmis, inflictor.origin); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.think = SUB_Remove; + newmis.nextthink = time + self.wait; +}; + +//---------------------------------------------------------------------- +void() misc_targetdummy = +{ + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.spawnflags & MISC_TARGKNIGHT) { + self.mdl = "progs/mon_knight.mdl"; + self.headmdl = "progs/ad171/targd_short.mdl"; + self.pain_sound = "knight/khurt.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_SHORT; + self.pos1 = '0 9 0'; // stand1-9 + } + else if (self.spawnflags & MISC_TARGWIZARD) { + self.mdl = "progs/wizard.mdl"; + self.headmdl = "progs/ad171/targd_tall.mdl"; + self.pain_sound = "wizard/wpain.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_TALL; + self.pos1 = '0 8 0'; // hover1-8 + } + else if (self.spawnflags & MISC_TARGOGRE) { + self.mdl = "progs/ogre.mdl"; + self.headmdl = "progs/ad171/targd_wide.mdl"; + self.pain_sound = "ogre/ogpain1.wav"; + self.t_width = TRUE; + self.bboxtype = BBOX_WIDE; + self.pos1 = '0 9 0'; // stand1-9 + } + else if (self.spawnflags & MISC_TARGHELLKNIGHT) { + self.mdl = "progs/ad171/mon_hknight.mdl"; + self.headmdl = "progs/ad171/targd_tall.mdl"; + self.pain_sound = "hknight/pain1.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_TALL; + self.pos1 = '0 9 0'; // stand1-9 + } + else if (self.spawnflags & MISC_TARGZOMBIE) { + self.mdl = "progs/ad171/mon_zombie.mdl"; + self.headmdl = "progs/ad171/targd_short.mdl"; + self.pain_sound = "zombie/z_pain.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_SHORT; + self.pos1 = '0 15 0'; // stand 1-15 + } + else if (self.spawnflags & MISC_TARGDEMON) { + self.mdl = "progs/demon.mdl"; + self.headmdl = "progs/ad171/targd_wide.mdl"; + self.pain_sound = "demon/dpain1.wav"; + self.t_width = TRUE; + self.bboxtype = BBOX_WIDE; + self.pos1 = '0 13 0'; // stand 1-13 + } + else if (self.spawnflags & MISC_TARGSHALRATH) { + self.mdl = "progs/ad171/mon_shalrath.mdl"; + self.headmdl = "progs/ad171/targd_wide.mdl"; + self.pain_sound = "shalrath/pain.wav"; + self.t_width = TRUE; + self.bboxtype = BBOX_WIDE; + self.pos1 = '0 1 0'; // stand 1 + } + else if (self.spawnflags & MISC_TARGSHAMBLER) { + self.mdl = "progs/shambler.mdl"; + self.headmdl = "progs/ad171/targd_massive.mdl"; + self.pain_sound = "shambler/shurt2.wav"; + self.t_width = FALSE; + self.bboxtype = BBOX_MASSIVE; + self.pos1 = '0 17 0'; // stand1-17 + self.resist_rockets = 0.5; + } + else { remove(self); return; } + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_sound (self.pain_sound); + precache_model (MODEL_IMPACT); // Impact model marker + + self.classtype = CT_TARGETDUMMY; + self.classgroup = CG_MONSTERS; + self.health = self.max_health = 100000; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_NONE; + self.movespeed = 0; // Never move monster + if (self.wait < 1) self.wait = 2; // impact marker removal time + self.pain_finished = 0; // Always reset this + self.pain_flinch = 1; // Always pass flinch test + self.dmg = 0; // Accumulated damage per frame + self.attack_finished = LARGE_TIMER; // Reset timer for checks + self.view_ofs = '0 0 24'; // Default monster offset + self.takedamage = DAMAGE_AIM; // Always take damage + + monster_bbox(); // Setup bounding box + setmodel(self, self.mdl); // Display model + setsize (self, self.bbmins, self.bbmaxs); // Update bbox + + // Spawn projectile bounding box visual marker + self.attachment = spawn(); + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + setmodel(self.attachment, self.headmdl); + setorigin(self.attachment, self.origin-self.view_ofs); + self.attachment.alpha = 0.3; + + // Spawn Hull2 bounding box visual marker + if (self.t_width) { + self.noise = "progs/targd_hull2.mdl"; + precache_model(self.noise); + self.attachment2 = spawn(); + self.attachment2.solid = SOLID_NOT; + self.attachment2.movetype = MOVETYPE_NONE; + setmodel(self.attachment2, self.noise); + setorigin(self.attachment2, self.origin-self.view_ofs); + self.attachment2.alpha = 0.15; + } + + // Intercept all AI states + self.th_pain = misc_targetdummy_pain; + self.th_stand = misc_targetdummy_stand; + self.th_walk = misc_targetdummy_stand; + self.th_run = misc_targetdummy_stand; + self.th_melee = misc_targetdummy_stand; + + // Stand around and wait for the pain! + self.think = self.th_stand; + self.nextthink = time + 0.5 + random(); +}; + +/*====================================================================== +/*QUAKED misc_targetnumber (.5 .5 0) (-4 -4 -8) (4 4 8) x +target number to display ingame +------- KEYS -------- +targetname : required for numbers to updated +pos1 : X= top digit quantity, Y=Lower digit quantity +-------- SPAWNFLAGS -------- +------- NOTES -------- +target number to display ingame + +======================================================================*/ +void() misc_targetnumber_dispno = +{ + local float str_counter, str_pow, str_result, str_low; + + str_counter = self.pos1_x; // Upper number length + str_pow = pow10(self.pos1_x); // Setup initial base 10 power for checking + + // If number larger than fixed length? - truncate number + if (self.count > str_pow) + self.count = self.count - (floor(self.count / str_pow) * str_pow); + + // Loop through lower part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + str_result = floor(self.count / str_pow); + + if (str_counter == 4) self.tno8.skin = str_result; + else if (str_counter == 3) self.tno7.skin = str_result; + else if (str_counter == 2) self.tno6.skin = str_result; + else if (str_counter == 1) self.tno5.skin = str_result; + + // remove top part of number, decrease str length counter + self.count = self.count - (str_result * str_pow); + str_counter = str_counter - 1; + } + + // Shift the lower part of the number upwards + str_low = str_counter = self.pos1_y; + str_pow = pow10(self.pos1_y); + while (str_low > 0) { + self.count = self.count * 10; + str_low = str_low - 1; + } + + // Loop through lower part of number + while(str_counter > 0) { + // Move down one pow digit + str_pow = str_pow / 10; + + // Divide number by pow to get divider + str_result = floor(self.count / str_pow); + + if (str_counter == 3) self.tno3.skin = str_result; + else if (str_counter == 2) self.tno2.skin = str_result; + else if (str_counter == 1) self.tno1.skin = str_result; + + // remove top part of number, decrease str length counter + self.count = self.count - (str_result * str_pow); + str_counter = str_counter - 1; + } +}; + +//---------------------------------------------------------------------- +void() misc_targetnumber_use = +{ + self.count = fabs(other.targetnumber); + misc_targetnumber_dispno(); +}; + +//---------------------------------------------------------------------- +entity(float offset, float startno) misc_targetnumber_spawn = +{ + local entity tnoent; + tnoent = spawn(); + tnoent.classtype = CT_TARGETNUMBER; + tnoent.solid = SOLID_NOT; + tnoent.movetype = MOVETYPE_NONE; + makevectors(self.angles); + setmodel(tnoent, self.mdl); + setorigin(tnoent, self.origin + v_right*(8*offset)); + setsize(tnoent, VEC_ORIGIN, VEC_ORIGIN); + tnoent.skin = startno; + tnoent.angles = self.angles; + return tnoent; +}; + +//---------------------------------------------------------------------- +void() misc_targetnumber = +{ + self.mdl = "progs/misc_digit.mdl"; + precache_model (self.mdl); + + self.classtype = CT_TARGETNUMBER; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + // Setup lower part of number (1-3 decimal places, 4=dot always) + if (self.pos1_y > 0) { + if (self.pos1_y == 1) + self.tno1 = misc_targetnumber_spawn(0, 0); + else if (self.pos1_y == 2) { + self.tno1 = misc_targetnumber_spawn(0, 0); + self.tno2 = misc_targetnumber_spawn(1, 0); + } + else { + self.pos1_y = 3; + self.tno1 = misc_targetnumber_spawn(0, 0); + self.tno2 = misc_targetnumber_spawn(1, 0); + self.tno3 = misc_targetnumber_spawn(2, 0); + } + // Decimal place is always tno4 + self.tno4 = misc_targetnumber_spawn(self.pos1_y, 10); + self.pos1_z = self.pos1_y +1; + } + else self.pos1_z = 0; + + // Setup upper part of number (1-4 digits only, min 1 digit) + if (self.pos1_x < 1) self.pos1_x = 1; + if (self.pos1_x == 1) + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + else if (self.pos1_x == 2) { + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + self.tno6 = misc_targetnumber_spawn(self.pos1_z+1, 0); + } + else if (self.pos1_x == 3) { + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + self.tno6 = misc_targetnumber_spawn(self.pos1_z+1, 0); + self.tno7 = misc_targetnumber_spawn(self.pos1_z+2, 0); + } + else { + self.pos1_x = 4; + self.tno5 = misc_targetnumber_spawn(self.pos1_z, 0); + self.tno6 = misc_targetnumber_spawn(self.pos1_z+1, 0); + self.tno7 = misc_targetnumber_spawn(self.pos1_z+2, 0); + self.tno8 = misc_targetnumber_spawn(self.pos1_z+3, 0); + } + + // Setup trigger function for number update + if (self.targetname != "") self.use = misc_targetnumber_use; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/misc_textbook.qc b/QC_other/QC_keep/misc_textbook.qc new file mode 100644 index 00000000..bc6ebdf4 --- /dev/null +++ b/QC_other/QC_keep/misc_textbook.qc @@ -0,0 +1,664 @@ +/*====================================================================== + Story books +======================================================================*/ +// Closed +$frame closed1 closed2 closed3 closed4 closed5 closed6 closed7 closed8 closed9 closed10 + +// Idle B - looking around turning left and then right (based on closed) +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 idleb9 idleb10 +$frame idleb11 idleb12 idleb13 idleb14 idleb15 idleb16 idleb17 idleb18 idleb19 idleb20 + +// Idle C - spin around 360 degrees (based on closed) +$frame idlec1 idlec2 idlec3 idlec4 idlec5 idlec6 idlec7 idlec8 idlec9 idlec10 +$frame idlec11 idlec12 idlec13 idlec14 idlec15 idlec16 idlec17 idlec18 idlec19 idlec20 + +// Opening (closed -> open) +$frame opening1 opening2 opening3 opening4 opening5 opening6 opening7 opening8 opening9 opening10 + +// Open +$frame open1 open2 open3 open4 open5 open6 open7 open8 open9 open10 + +void() book_closed1; +void(float fadedir) info_book_fadesetup; + +//---------------------------------------------------------------------- +float MISCBOOK_NOMODEL = 1; // Will not use any model and particles +float MISCBOOK_PLINTH1 = 2; // setup and spawn on plinth1 +float MISCBOOK_PLINTH2 = 4; // setup and spawn on plinth2 +float MISCBOOK_STORY = 8; // setup book as part of story +float MISCBOOK_COLLISION = 16; // Use bounding box collision for plinth +float MISCBOOK_ANGLEONLY = 32; // Will only work when standing infront of entity +float MISCBOOK_NOEFFECTS = 128; // Disable particles and effects + +float MISCBOOK_FADEOUT = 192; // Background density while reading books +float MISCBOOK_LOOPADVANCE = 0.01; + +float MISCBOOK_CLOSED = 1; +float MISCBOOK_OPENING = 2; +float MISCBOOK_CLOSING = 4; +float MISCBOOK_OPEN = 8; +float MISCBOOK_STAYOPEN = 16; + +//---------------------------------------------------------------------- +// Idle B - looking around turning left and then right (based on closed) +//---------------------------------------------------------------------- +void() book_idleb1 = [$idleb1, book_idleb2 ] {}; +void() book_idleb2 = [$idleb2, book_idleb3 ] {}; +void() book_idleb3 = [$idleb3, book_idleb4 ] {}; +void() book_idleb4 = [$idleb4, book_idleb5 ] {}; +void() book_idleb5 = [$idleb5, book_idleb6 ] {}; +void() book_idleb6 = [$idleb6, book_idleb7 ] {}; +void() book_idleb7 = [$idleb7, book_idleb8 ] {}; +void() book_idleb8 = [$idleb8, book_idleb9 ] {}; +void() book_idleb9 = [$idleb9, book_idleb10 ] {}; +void() book_idleb10 = [$idleb10, book_idleb11 ] {}; +void() book_idleb11 = [$idleb11, book_idleb12 ] {}; +void() book_idleb12 = [$idleb12, book_idleb13 ] {}; +void() book_idleb13 = [$idleb13, book_idleb14 ] {}; +void() book_idleb14 = [$idleb14, book_idleb15 ] {}; +void() book_idleb15 = [$idleb15, book_idleb16 ] {}; +void() book_idleb16 = [$idleb16, book_idleb17 ] {}; +void() book_idleb17 = [$idleb17, book_idleb18 ] {}; +void() book_idleb18 = [$idleb18, book_idleb19 ] {}; +void() book_idleb19 = [$idleb19, book_idleb20 ] {}; +void() book_idleb20 = [$idleb20, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Idle C - spin around 360 degrees (based on closed) +//---------------------------------------------------------------------- +void() book_idlec1 = [$idlec1, book_idlec2 ] {}; +void() book_idlec2 = [$idlec2, book_idlec3 ] {}; +void() book_idlec3 = [$idlec3, book_idlec4 ] {}; +void() book_idlec4 = [$idlec4, book_idlec5 ] {}; +void() book_idlec5 = [$idlec5, book_idlec6 ] {}; +void() book_idlec6 = [$idlec6, book_idlec7 ] {}; +void() book_idlec7 = [$idlec7, book_idlec8 ] {}; +void() book_idlec8 = [$idlec8, book_idlec9 ] {}; +void() book_idlec9 = [$idlec9, book_idlec10 ] {}; +void() book_idlec10 = [$idlec10, book_idlec11 ] {}; +void() book_idlec11 = [$idlec11, book_idlec12 ] {}; +void() book_idlec12 = [$idlec12, book_idlec13 ] {}; +void() book_idlec13 = [$idlec13, book_idlec14 ] {}; +void() book_idlec14 = [$idlec14, book_idlec15 ] {}; +void() book_idlec15 = [$idlec15, book_idlec16 ] {}; +void() book_idlec16 = [$idlec16, book_idlec17 ] {}; +void() book_idlec17 = [$idlec17, book_idlec18 ] {}; +void() book_idlec18 = [$idlec18, book_idlec19 ] {}; +void() book_idlec19 = [$idlec19, book_idlec20 ] {}; +void() book_idlec20 = [$idlec20, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Book closed +//---------------------------------------------------------------------- +void() book_closed1 = [$closed1, book_closed2 ] {self.state = MISCBOOK_CLOSED; + if (random() < 0.1 && self.search_time < time) { + self.search_time = time + 2 + (random()*5); + self.lefty = 1 - self.lefty; + if (self.lefty > 0) book_idleb1(); // Turn left and right + else book_idlec1(); // spin around + } +}; +void() book_closed2 = [$closed2, book_closed3 ] {}; +void() book_closed3 = [$closed3, book_closed4 ] {}; +void() book_closed4 = [$closed4, book_closed5 ] {}; +void() book_closed5 = [$closed5, book_closed6 ] {}; +void() book_closed6 = [$closed6, book_closed7 ] {}; +void() book_closed7 = [$closed7, book_closed8 ] {}; +void() book_closed8 = [$closed8, book_closed9 ] {}; +void() book_closed9 = [$closed9, book_closed10 ] {}; +void() book_closed10 = [$closed10, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Book closing (open -> close) +//---------------------------------------------------------------------- +void() book_closing1 = [$opening10, book_closing2 ] { + self.state = MISCBOOK_CLOSING; + // make sure book idles don't start straight away + self.search_time = time + 2 + (random()*5); +}; +void() book_closing2 = [$opening9, book_closing3 ] {}; +void() book_closing3 = [$opening8, book_closing4 ] {}; +void() book_closing4 = [$opening7, book_closing5 ] {}; +void() book_closing5 = [$opening6, book_closing6 ] {}; +void() book_closing6 = [$opening5, book_closing7 ] {}; +void() book_closing7 = [$opening4, book_closing8 ] {}; +void() book_closing8 = [$opening3, book_closing9 ] {}; +void() book_closing9 = [$opening2, book_closing10 ] {}; +void() book_closing10= [$opening1, book_closed1 ] {}; + +//---------------------------------------------------------------------- +// Book always open (final stage of book) +//---------------------------------------------------------------------- +void() book_stayopen1 = [$open1, book_stayopen2 ] {self.state = MISCBOOK_STAYOPEN;}; +void() book_stayopen2 = [$open2, book_stayopen3 ] {}; +void() book_stayopen3 = [$open3, book_stayopen4 ] {}; +void() book_stayopen4 = [$open4, book_stayopen5 ] {}; +void() book_stayopen5 = [$open5, book_stayopen6 ] {}; +void() book_stayopen6 = [$open6, book_stayopen7 ] {}; +void() book_stayopen7 = [$open7, book_stayopen8 ] {}; +void() book_stayopen8 = [$open8, book_stayopen9 ] {}; +void() book_stayopen9 = [$open9, book_stayopen10 ] {}; +void() book_stayopen10 = [$open10, book_stayopen1 ] {}; + +//---------------------------------------------------------------------- +// Players has walked away, decide what to do with the book +//---------------------------------------------------------------------- +void() book_finish = +{ + info_book_fadesetup(-1); + // Clear client centerprint suppression + if (self.enemy.flags & FL_CLIENT) { + self.enemy.suppressCenterPrint = FALSE; + centerprint(self.enemy, ""); + } + if (self.pain_finished > 0) book_stayopen1(); + else book_closing1(); +}; + +//---------------------------------------------------------------------- +// Book is open (waiting to close) +//---------------------------------------------------------------------- +void() book_open1 = [$open1, book_open2 ] {self.state = MISCBOOK_OPEN;}; +void() book_open2 = [$open2, book_open3 ] {if (self.wait < time) book_finish();}; +void() book_open3 = [$open3, book_open4 ] {}; +void() book_open4 = [$open4, book_open5 ] {if (self.wait < time) book_finish();}; +void() book_open5 = [$open5, book_open6 ] {}; +void() book_open6 = [$open6, book_open7 ] {if (self.wait < time) book_finish();}; +void() book_open7 = [$open7, book_open8 ] {}; +void() book_open8 = [$open8, book_open9 ] {if (self.wait < time) book_finish();}; +void() book_open9 = [$open9, book_open10 ] {}; +void() book_open10= [$open10, book_open1 ] {if (self.wait < time) book_finish();}; + +//---------------------------------------------------------------------- +// Book opening (closed -> open) +//---------------------------------------------------------------------- +void() book_opening1 = [$opening1, book_opening2 ] {self.state = MISCBOOK_OPENING;}; +void() book_opening2 = [$opening2, book_opening3 ] {}; +void() book_opening3 = [$opening3, book_opening4 ] {}; +void() book_opening4 = [$opening4, book_opening5 ] {}; +void() book_opening5 = [$opening5, book_opening6 ] {}; +void() book_opening6 = [$opening6, book_opening7 ] {}; +void() book_opening7 = [$opening7, book_opening8 ] {}; +void() book_opening8 = [$opening8, book_opening9 ] {}; +void() book_opening9 = [$opening9, book_opening10 ] {}; +void() book_opening10 = [$opening10, book_open1 ] {}; + +//---------------------------------------------------------------------- +void() info_book_fade = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Fade direction needs to be -1 or +1 (0.48s fade time) + self.lip = self.lip + (self.height * 4); + // Check if fade has reached 0 or max screen fade value + if (self.lip <= 0) self.lip = 0; + else if (self.lip >= MISCBOOK_FADEOUT) self.lip = MISCBOOK_FADEOUT; + else self.nextthink = time + MISCBOOK_LOOPADVANCE; + + // Only update the screen if the debuff system is NOT active + // and the client does NOT have any powerups active + if (!self.enemy.cshift_upd && self.enemy.items & ALL_ITARTIFACTS == 0) { + // Change screen background density (makes text easier to read) + stuffcmd(self.enemy, "v_cshift 0 0 0 "); + stuffcmd(self.enemy, ftos(self.lip)); + stuffcmd(self.enemy, "\n"); + } +}; + +//---------------------------------------------------------------------- +void(float fadedir) info_book_fadesetup = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Is the fade controller setup? + if (self.attachment) { + // Double check if screen fade is setup already + if (fadedir > 0 && self.attachment.lip == MISCBOOK_FADEOUT) return; + if (fadedir < 0 && self.attachment.lip == 0) return; + + // Copy over client and fadedir to controller + self.attachment.enemy = self.enemy; + self.attachment.height = fadedir; + self.attachment.think = info_book_fade; + self.attachment.nextthink = time + MISCBOOK_LOOPADVANCE; + self.attachment.ltime = self.attachment.nextthink; + } +}; + +//---------------------------------------------------------------------- +void() info_book_displaystory = +{ + // is this book part of a storyline? + // The controller has been setup/validated already + if (self.spawnflags & MISCBOOK_STORY) { + // Check controller once! + self.spawnflags = self.spawnflags - (self.spawnflags & MISCBOOK_STORY); + + if (self.attachment.estate == ESTATE_OFF) { + self.message = "Story controller broken!\n\n"; + } + else { + // Copy over story chapter + self.message = self.attachment.oldenemy.message; + self.message2 = self.attachment.oldenemy.message2; + self.message3 = self.attachment.oldenemy.message3; + self.message4 = self.attachment.oldenemy.message4; + } + + // Work out which centerprint to use + if (self.message3 != "" && self.message4 != "") self.cnt = 2; + else if (self.message3 != "") self.cnt = 1; + else self.cnt = 0; + + // Move controller on to next story chapter + if (self.attachment.height < self.attachment.count) { + self.attachment.count = self.attachment.count + 1; + self.attachment.oldenemy = self.attachment.oldenemy.oldenemy; + } + } + + // Suppress any other centerprint messages and show story + self.enemy.suppressCenterPrint = TRUE; + // Check for any additional strings and use correct centerprint + // The engine function will merge several strings together + if (self.cnt == 1) centerprint_msg3(self.enemy, self.message, self.message2, self.message3); + else if (self.cnt == 2) centerprint_msg4(self.enemy, self.message, self.message2, self.message3, self.message4); + else centerprint_msg(self.enemy, self.message, self.message2); + + // Check for any additional trigger events + if (self.target != "") { + trigger_strs(self.target, self.enemy); + self.target = ""; + } +}; + +//---------------------------------------------------------------------- +void() info_book_touch = +{ + local float book_yaw, book_angle1, book_angle2, play_yaw, play_angle; + + if (self.estate & ESTATE_BLOCK) return; + if (intermission_running) return; // intermission or finale + if ( !(other.flags & FL_CLIENT) ) return; + if (other.health < 1) return; + + // Store player entity for later use + self.enemy = other; + + if (self.spawnflags & MISCBOOK_ANGLEONLY) { + // Check the players facing direction against book angle direction + // make sure the player angle is never negative, + 360 just in case + play_angle = anglemod(self.enemy.v_angle_y+360); + // Work out angle cone based on book angle direction + // Use previously defined angles for viewing angle of book + book_yaw = fabs(self.v_angle_y - self.v_angle_x); + book_angle1 = anglemod(self.angles_y + 180 + (360-book_yaw)); + book_angle2 = anglemod(self.angles_y + 180 + book_yaw); + // Is the players angle outside the book's viewing range? + if (play_angle < book_angle1 || play_angle > book_angle2) return; + } + + // The angle at the which the book is facing the player + // book_yaw = vectoyaw(self.enemy.origin - self.origin); + // book_angle = anglemod((self.angles_y - book_yaw) + 0); + // The angle the player is facing towards the book (45 = forward) + play_yaw = vectoyaw(self.origin - self.enemy.origin); + play_angle = anglemod((self.enemy.v_angle_y - play_yaw) + 45); + + // Is the player looking at the book? + if (play_angle > self.v_angle_x && play_angle < self.v_angle_y) { + // Is the book closed? + if (self.state == MISCBOOK_CLOSED) { + self.wait = time + 1.3; + book_opening1(); + } + // Is the book currently open and been read before? + else if (self.state == MISCBOOK_STAYOPEN) { + info_book_fadesetup(1); + self.wait = time + 0.3; + self.attack_finished = time + 0.2; + book_open1(); + } + // Has the book just opened and never been read before? + else if (self.state == MISCBOOK_OPEN && self.pain_finished == FALSE) { + self.pain_finished = TRUE; + info_book_fadesetup(1); + self.wait = time + 0.3; + self.attack_finished = time + 0.2; + if (self.part_emitter) misc_particle_update(self.part_emitter, PARTICLE_STYLE_OPENBOOK); + info_book_displaystory(); + } + // Is the book open and ready for a story? + else if (self.state == MISCBOOK_OPEN) { + info_book_fadesetup(1); + self.wait = time + 0.3; + if (self.attack_finished < time) { + self.attack_finished = time + 0.2; + info_book_displaystory(); + } + } + } +}; + +//---------------------------------------------------------------------- +void() info_book_on = +{ + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + if ( !(self.spawnflags & MISCBOOK_NOMODEL) ) { + setmodel (self, self.mdl); + self.skin = self.exactskin; + } + + // Make sure particle emitter is turned on + if (self.part_emitter) misc_particle_on(self.part_emitter); + + // Setup touch trigger and function + self.touch = info_book_touch; + setsize (self, self.pos1, self.pos2); + + // If no model, don't need book animations + attachment models + if ( !(self.spawnflags & MISCBOOK_NOMODEL) ) { + // Check for any plinth models + if (self.attachment2) { + // Use bounding box coillsion? + if (self.spawnflags & MISCBOOK_COLLISION) self.attachment2.solid = SOLID_BBOX; + else self.attachment2.solid = SOLID_NOT; + setmodel (self.attachment2, self.noise1); + } + + // Setup book in correct animation state + self.search_time = time + 5 + (random()*5); // delay idle animation + if (self.state == MISCBOOK_CLOSED) book_closed1(); + else book_stayopen1(); + } +}; + +//---------------------------------------------------------------------- +void() info_book_off = +{ + self.estate = ESTATE_OFF; + self.solid = SOLID_NOT; + setmodel (self, ""); + + // Stop any touch/animations + self.touch = self.think = SUB_Null; + + // Check if the screen is faded? + if (self.attachment) { + if (self.attachment.lip != 0) { + self.attachment.lip = 0; + if (!self.enemy.cshift_upd && self.enemy.items & ALL_ITARTIFACTS == 0) { + stuffcmd(self.enemy, "v_cshift 0 0 0 0\n"); + } + } + } + + // If any plinth exists, turn that off as well + if (self.attachment2) { + setmodel(self.attachment2, ""); + self.attachment2.solid = SOLID_NOT; + } +}; + +//---------------------------------------------------------------------- +void() info_book_setup = +{ + // Setup book fade controller + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_CONTROL; + self.attachment.movetype = MOVETYPE_NONE; + setorigin(self.attachment,self.origin + '0 0 32'); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Check for plinth and spawn/setup + if (self.mdl != "" && self.noise1 != "") { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_MISCMODEL; + self.attachment2.movetype = MOVETYPE_NONE; + + // Trace downward to find the ground and place plinth + traceline (self.origin, self.origin + '0 0 -512', TRUE, self); + self.origin = trace_endpos + '0 0 32'; + setorigin(self.attachment2, self.origin); + self.attachment2.angles = self.angles; + + // Plinth2 has flat surface which conflicts with book angle + if (self.spawnflags & MISCBOOK_PLINTH2) self.origin = self.origin + '0 0 4'; + } + + // Check for random skin options + if (self.randomskin > 1) + self.exactskin = rint(random()*(self.randomskin-1)); + // The particle colours are based on the book skin + if (self.exactskin < 1) self.exactskin = 0; + if (self.exactskin >= 6) self.style = MISCBOOK_RED; + else if (self.exactskin >= 4) self.style = MISCBOOK_BLUE; + else self.style = MISCBOOK_GREEN; + + // Default viewing angle is min 30 and max 60 looking at origin + if (CheckZeroVector(self.v_angle)) self.v_angle = '30 60 0'; + if (self.angles_y == 0) self.angles_y = 360; + + // Check for story book setup first + // Story is supplied from story system when book is opened + if (self.spawnflags & MISCBOOK_STORY) { + // Reset all storybook message strings + self.message = "Waiting for story!"; + self.message2 = ""; + self.message3 = ""; self.message4 = ""; + self.cnt = 0; + self.attachment = find(world, targetname, self.target2); + // Is this entity a storybook controller? + if (!self.attachment || self.attachment.classtype != CT_STORYCONTROL) + { + dprint("\b[STORYBOOK]\b Missing controller!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + } + else { + // setup default message for testing + if (self.message == "") self.message = "\b--[ Dark Elder Magic ]--\b\n\n"; + if (self.message2 == "") self.message2 = "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import.\n"; + + // Check for additional strings to display + // This is to fix quark editor limit of 128 characters per string + if (self.message3 != "" && self.message4 != "") self.cnt = 2; + else if (self.message3 != "") self.cnt = 1; + else self.cnt = 0; + } + + // Spawn particle emitter if particles active and not blocked + if ( !(self.spawnflags & MISCBOOK_NOMODEL) ) { + self.part_active = PARTICLE_STYLE_BOOK; + if (self.spawnflags & ENT_STARTOFF) self.count = PARTICLE_START_OFF; + else self.count = PARTICLE_START_ON; + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) { + if (!(self.spawnflags & MISCBOOK_NOEFFECTS) && self.part_active > 0) + self.part_emitter = spawn_pemitter(self, self, self.part_active, self.count); + } + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = info_book_on; + self.estate_off = info_book_off; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +/*====================================================================== +/*QUAKED misc_textbook (0 0.5 0.5) (-16 -16 -8) (16 16 8) NOMODEL PLINTH1 PLINTH2 STORY COLLISION ANGLEONLY STARTOFF NOEFFECTS +Display custom text messages +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : trigger event when book is opened (only works once) +target2 : name of story controller (only works with spawnflag) +angle : facing angle for model or direction player must be standing +v_angle : The viewing angle the book is active (def=30,60,0) +exactskin : skin number for book (1-8, Brown1/2,Green1/2,Blue1/2,Red1/2) +pos1 : Touch trigger minimin size (def=-48 -48 -32) +pos2 : Touch trigger maximum size (def=48 48 32) +message : header message +message2 : Body Text 1 (need to add linefeeds) +message3 : Body Text 2 (displayed after message2) +message4 : Body Text 3 (displayed after message3) +-------- SPAWNFLAGS -------- +NOMODEL : Will not use book model + particles +PLINTH1 : Setup book on top of plinth1 model +PLINTH2 : Setup book on top of plinth2 model +STORY : Book is part of a story (use target2) +COLLISION : Use bounding box collision for plinth +ANGLEONLY : Will only work when standing infront of entity (angle key) +STARTOFF : Starts off and waits for trigger +NOEFFECTS : No particle or effects active +-------- NOTES -------- +Display custom text messages +Maximum size of message is 1024 characters, 256 is the original limit + +======================================================================*/ +void() misc_textbook = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.classtype = CT_STORYBOOK; + // Setup large bounding box for touch trigger + if (CheckZeroVector(self.pos1)) self.pos1 = '-48 -48 -32'; + if (CheckZeroVector(self.pos2)) self.pos2 = '48 48 32'; + self.takedamage = DAMAGE_NO; // No damage from anything + + if (self.spawnflags & MISCBOOK_NOMODEL) { + self.mdl = ""; + self.state = MISCBOOK_STAYOPEN; // no book animation + self.pain_finished = TRUE; // No read delay + } + else { + self.state = MISCBOOK_CLOSED; // Current state + self.pain_finished = FALSE; // Book not read yet + // Default medieval book + self.mdl = "progs/ad171/misc_textbook.mdl"; + precache_model (self.mdl); + self.noise1 = ""; + // Check for any predefined plinth model setups + if (self.spawnflags & MISCBOOK_PLINTH1) { + self.noise1 = "progs/ad171/misc_plinth1.mdl"; + precache_model(self.noise1); + } + else if (self.spawnflags & MISCBOOK_PLINTH2) { + self.noise1 = "progs/ad171/misc_plinth2.mdl"; + precache_model(self.noise1); + } + } + + // Don't spawn straight away + self.nextthink = time + 0.1 + random()*0.4; + self.think = info_book_setup; +}; + +/*====================================================================== +/*QUAKED misc_textstory (0 0.5 1.0) (-16 -16 -8) (16 16 8) x +Text Book Story Chapters +-------- KEYS -------- +targetname : name of current chapter +target : name of next chapter +message : header message +message2 : Body Text 1 (need to add linefeeds) +message3 : Body Text 2 (displayed after message2) +message4 : Body Text 3 (displayed after message3) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Text Book Story Chapters + +/*QUAKED misc_textstoryctrl (0 0.1 1.0) (-16 -16 -8) (16 16 8) x +Text Book Story Controller +-------- KEYS -------- +targetname : name of controller for story +target : name of first chapter +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Text Book Story Controller + +======================================================================*/ +void() info_bookcont_setup = +{ + local entity storychap, prevchap; + + // Is there any story chapters? + storychap = find(world, targetname, self.target); + if (!storychap) { + dprint("\b[STORYCTRL]\b Missing start chapter!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Can only link to story chapter entities + if (storychap.classtype != CT_STORYCHAPTER) { + dprint("\b[STORYCTRL]\b First chapter wrong entity!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Setup controller + prevchap = self; // Start controller at chapter 1 + self.count = 0; // Total chapters in story + self.height = 1; // Current chapter in story + + // Work through list + while (storychap) { + // Visual debug for chapters + spawn_marker(storychap.origin, SPNMARK_BLUE); + + // Link chapters and move forward + prevchap.oldenemy = storychap; + prevchap = storychap; + self.count = self.count + 1; + + // Check for next target in chain + if (prevchap.target == "") storychap = world; + else storychap = find(world, targetname, prevchap.target); + } + // Point final chapter at itself + prevchap.oldenemy = prevchap; + + // Controller finally active + self.estate = ESTATE_ON; + // Visual debug for controller + spawn_marker(self.origin, SPNMARK_GREEN); + // Console message for chapters found + dprint("\b[STORYCTRL]\b Chapters found ("); + dprint(ftos(self.count)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +void() misc_textstoryctrl = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.classtype = CT_STORYCONTROL; + // Start in disabled state until chapters setup + self.estate = ESTATE_OFF; + + if (self.target == "") { + dprint("\b[STORYCTRL]\b Missing story start!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Wait for chapter and books to spawn first + self.nextthink = time + 1 + random(); + self.think = info_bookcont_setup; +}; + +//---------------------------------------------------------------------- +void() misc_textstory = +{ + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.classtype = CT_STORYCHAPTER; +}; diff --git a/QC_other/QC_keep/mon_anaconda.qc b/QC_other/QC_keep/mon_anaconda.qc new file mode 100644 index 00000000..4ff94943 --- /dev/null +++ b/QC_other/QC_keep/mon_anaconda.qc @@ -0,0 +1,865 @@ +void anacdoom_1(); +void anacdoom_2(); +void anacdoom_3(); +void anacdoom_4(); + +float ANAC_NOINTERMISSION = 2; + +void() Puke_Touch = { + local vector org; + if (other == self.owner) return; + if (pointcontents(self.origin) == CONTENT_SKY) { remove(self); return; } + org = self.origin - MOVETYPE_NOCLIP * normalize(self.velocity); + SpawnBlood(other,org, self.velocity * 0.2, 15); + T_Damage(other, self, self.owner, MOVETYPE_BOUNCE,DAMARMOR); + T_RadiusDamage(self, self.owner, SVC_INTERMISSION, other,DAMAGEALL); + self.origin = self.origin - MOVETYPE_NOCLIP * normalize(self.velocity); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z); + BecomeExplosion(); +}; + +void(vector p) anac_missile = { + local vector offang,org,vec,d; + + offang = vectoangles(self.enemy.origin - self.origin); + makevectors(offang); + org = self.origin + p_x * v_forward + p_y * v_right + p_z * '0 0 1'; + d = self.enemy.origin; + vec = normalize(d - org); + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.angles = vectoangles(vec); + newmis.classname = "spike"; + newmis.think = SUB_Remove; + newmis.nextthink = time + TE_LIGHTNING2; + setorigin(newmis, org); + setmodel(newmis, "progs/drake/s_explod.spr"); + newmis.avelocity = '200 100 300'; + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vec * 800; + newmis.touch = Puke_Touch; +}; + +void() Bite_Touch = { + local vector org; + if (other == self.owner) return; + if (pointcontents(self.origin) == CONTENT_SKY) { remove(self); return; } + + org = self.origin - MOVETYPE_NOCLIP * normalize(self.velocity); + if (other.health) { + SpawnBlood(other,org, self.velocity * 0.2, 15); + T_Damage(other, self, self.owner, SVC_INTERMISSION,DAMARMOR); + sound(self, CHAN_VOICE, "demon/dhit2.wav", ATTN_NORM, ATTN_IDLE); + self.gib1mdl = "progs/gib1.mdl"; + ThrowGib(11, 1); + } else { + remove(self); + return; + } + remove(self); +}; + +void(float offset) AnacMissile = { + local vector offang; + local vector org; + local vector vec; + offang = vectoangles(self.enemy.origin - self.origin); + offang_y = offang_y + offset * MOVETYPE_TOSS; + makevectors(offang); + org = self.origin - SVC_INTERMISSION * normalize(self.velocity); + vec = normalize(v_forward); + vec_z = MSG_BROADCAST - vec_z + (random() - 0.5) * 0.1; + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.angles = vectoangles(vec); + newmis.classname = "spike"; + setorigin(newmis, org); + newmis.classname = "LaunchSpike"; + setmodel(newmis, "progs/spike2.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.avelocity = '200 100 300'; + newmis.velocity = vec * 1000; + sound(self, CHAN_WEAPON, "doors/airdoor2.wav", CHAN_WEAPON, ATTN_NORM); + newmis.touch = Bite_Touch; + newmis.nextthink = time + 0.2; + newmis.think = SUB_Remove; +}; + +void() anac_stand1 = [79, anac_stand1] { ai_stand(); }; + +void() anac_fall = [80, anac_fall1] {}; +void() anac_fall1 = [81, anac_fall2] +{ +}; +void() anac_fall2 = [82, anac_fall3] +{ +}; +void() anac_fall3 = [83, anac_fall4] +{ +}; +void() anac_fall4 = [84, anac_fall5] +{ +}; +void() anac_fall5 = [85, anac_down] +{ + sound(self, CHAN_WEAPON, "boss1/out1.wav", CHAN_WEAPON, ATTN_NORM); +}; +void() anac_fall6 = [86, anac_fall7] +{ +}; +void() anac_fall7 = [87, anac_fall8] +{ +}; + +void() anac_fall8 = [88, anac_fall9] +{ +}; + +void() anac_fall9 = [89, anac_stand1] +{ +}; + +void() anac_rise = [0, anac_rise02] { sound(self, CHAN_WEAPON, "boss1/out1.wav", CHAN_WEAPON, ATTN_NORM); }; +void() anac_rise02 = [1, anac_rise03] { sound(self, CHAN_VOICE, "boss1/sight1.wav", ATTN_NORM, ATTN_NORM); }; +void() anac_rise03 = [2, anac_rise04] {}; +void() anac_rise04 = [3, anac_rise05] {}; +void() anac_rise05 = [4, anac_rise06] {}; +void() anac_rise06 = [5, anac_rise07] {}; +void() anac_rise07 = [6, anac_rise08] {}; +void() anac_rise08 = [7, anac_rise09] {}; +void() anac_rise09 = [8, anac_rise10] {}; +void() anac_rise10 = [9, anac_rise11] {}; +void() anac_rise11 = [10, anac_rise12] {}; +void() anac_rise12 = [11, anac_rise13] {}; +void() anac_rise13 = [12, anac_rise14] {}; +void() anac_rise14 = [13, anac_rise15] {}; +void() anac_rise15 = [14, anac_rise16] {}; +void() anac_rise16 = [15, anac_rise17] {}; +void() anac_rise17 = [16, anac_run] { self.th_run = anac_run; }; + +void() anac_walk01 = [89, anac_walk01] +{ + ai_walk(MOVETYPE_BOUNCE); +}; + +void() anac_run = [17, anac_run01] +{ + ai_walk(20); +}; + +void() anac_run01 = [18, anac_run02] +{ + ai_walk(20); +}; + +void() anac_run02 = [19, anac_run03] +{ + ai_walk(20); +}; + +void() anac_run03 = [20, anac_run04] +{ + ai_walk(20); +}; + +void() anac_run04 = [21, anac_run05] +{ + ai_walk(20); +}; + +void() anac_run05 = [22, anac_run06] +{ + ai_walk(20); +}; + +void() anac_run06 = [23, anac_run07] +{ + ai_walk(20); +}; + +void() anac_run07 = [24, anac_run08] +{ + ai_walk(20); +}; + +void() anac_run08 = [25, anac_run09] +{ + ai_walk(20); +}; + +void() anac_run09 = [26, anac_run10] +{ + ai_walk(20); +}; + +void() anac_run10 = [27, anac_run11] +{ + ai_walk(20); +}; + +void() anac_run11 = [28, anac_run12] +{ + ai_walk(20); +}; + +void() anac_run12 = [29, anac_run13] +{ + ai_walk(20); +}; + +void() anac_run13 = [30, anac_run14] +{ + ai_walk(20); +}; + +void() anac_run14 = [31, anac_run15] +{ + ai_walk(20); +}; + +void() anac_run15 = [32, anac_run16] +{ + ai_walk(20); +}; + +void() anac_run16 = [33, anac_run17] +{ + ai_walk(MSG_BROADCAST); +}; + +void() anac_run17 = [34, anac_run18] +{ + ai_walk(MSG_BROADCAST); +}; + +void() anac_run18 = [35, anac_run19] +{ + ai_walk(MSG_BROADCAST); +}; + +void() anac_run19 = [36, anac_hmmm] +{ + ai_walk(MSG_BROADCAST); +}; + +void() anac_run20 = [37, anac_run21] +{ + ai_run(MSG_BROADCAST); +}; + +void() anac_run21 = [38, anac_run22] +{ + ai_run(MSG_BROADCAST); +}; + +void() anac_run22 = [39, anac_run23] +{ + ai_run(MSG_BROADCAST); +}; + +void() anac_run23 = [40, anac_run24] +{ + ai_run(MSG_BROADCAST); +}; + +void() anac_run24 = [41, anac_run25] +{ + ai_run(MSG_BROADCAST); +}; + +void() anac_run25 = [42, anac_run26] +{ + ai_run(MSG_BROADCAST); +}; + +void() anac_run26 = [43, anac_run27] +{ + ai_run(20); +}; + +void() anac_run27 = [44, anac_run28] +{ + ai_run(20); +}; + +void() anac_run28 = [45, anac_run29] +{ + ai_run(20); +}; + +void() anac_run29 = [46, anac_run30] +{ + ai_run(20); +}; + +void() anac_run30 = [47, anac_run] +{ + ai_run(20); +}; + +void() anac_hmmm = +{ + if (self.enemy.health <= MSG_BROADCAST) + { + anac_fall(); + } + else + { + anac_run20(); + } +}; + +void() anac_attk = [108, anac_attk1] +{ + ai_face(); + sound(self, CHAN_VOICE, "hknight/idle.wav", ATTN_NORM, ATTN_NORM); +}; + +void() anac_attk1 = [109, anac_attk2] +{ + ai_face(); +}; + +void() anac_attk2 = [110, anac_attk3] +{ + ai_face(); +}; + +void() anac_attk3 = [111, anac_attk4] +{ + ai_face(); + ai_forward(TE_LIGHTNING1); +}; + +void() anac_attk4 = [112, anac_attk5] +{ + ai_face(); + ai_forward(MOVETYPE_BOUNCE); +}; + +void() anac_attk5 = [113, anac_attk6] +{ + ai_face(); + ai_forward(MOVETYPE_BOUNCE); +}; + +void() anac_attk6 = [114, anac_attk7] +{ + ai_face(); + ai_forward(MOVETYPE_BOUNCE); +}; + +void() anac_attk7 = [115, anac_attk8] +{ + ai_face(); + ai_forward(MOVETYPE_BOUNCE); +}; + +void() anac_attk8 = [116, anac_attk9] +{ + anac_missile('100 0 200'); + sound(self, CHAN_VOICE, "boss2/pop2.wav", ATTN_NORM, ATTN_NONE); + ai_face(); + ai_forward(20); +}; + +void() anac_attk9 = [117, anac_attk10] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk10 = [118, anac_attk11] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk11 = [119, anac_attk12] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk12 = [120, anac_attk13] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk13 = [121, anac_attk14] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk14 = [122, anac_attk15] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk15 = [123, anac_attk16] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(20); +}; + +void() anac_attk16 = [124, anac_attk17] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(MOVETYPE_BOUNCE); +}; + +void() anac_attk17 = [125, anac_attk18] +{ + anac_missile('100 0 200'); + ai_face(); + ai_forward(TE_LIGHTNING1); +}; + +void() anac_attk18 = [126, anac_attk19] +{ + anac_missile('100 0 200'); + ai_face(); +}; + +void() anac_attk19 = [127, anac_attk20] +{ + anac_missile('100 0 200'); + ai_face(); +}; + +void() anac_attk20 = [128, anac_attk21] +{ + anac_missile('100 0 200'); + ai_face(); +}; + +void() anac_attk21 = [129, anac_attk22] +{ + anac_missile('100 0 200'); + ai_face(); +}; + +void() anac_attk22 = [130, anac_attk23] +{ + ai_face(); +}; + +void() anac_attk23 = [131, anac_attk24] +{ + ai_face(); +}; + +void() anac_attk24 = [132, anac_run] +{ + ai_face(); +}; + +void() anac_eat = [90, anac_eat1] +{ + ai_charge(SVC_INTERMISSION); + ai_face(); + sound(self, CHAN_VOICE, "hknight/idle.wav", ATTN_NORM, ATTN_NORM); + sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", CHAN_WEAPON, ATTN_NORM); +}; + +void() anac_eat1 = [91, anac_eat2] +{ + ai_charge(-20); + ai_face(); +}; + +void() anac_eat2 = [92, anac_eat3] +{ + ai_charge(-20); + ai_face(); +}; + +void() anac_eat3 = [93, anac_eat4] +{ + ai_charge(-10); + ai_face(); + AnacMissile(ATTN_NONE); + AnacMissile(ATTN_NORM); + AnacMissile(CONTENT_EMPTY); + AnacMissile(CHAN_VOICE); + AnacMissile(CONTENT_SOLID); +}; + +void() anac_eat4 = [94, anac_eat5] +{ + ai_charge(-10); + ai_face(); +}; + +void() anac_eat5 = [95, anac_eat6] +{ + ai_charge(-10); + ai_face(); +}; + +void() anac_eat6 = [96, anac_eat7] +{ + ai_charge(MOVETYPE_BOUNCE); + ai_face(); +}; + +void() anac_eat7 = [97, anac_eat8] +{ + ai_charge(MOVETYPE_BOUNCE); + ai_face(); +}; + +void() anac_eat8 = [98, anac_eat9] +{ + ai_charge(MOVETYPE_BOUNCE); + ai_face(); +}; + +void() anac_eat9 = [99, anac_eat10] +{ + ai_charge(-10); + ai_face(); + sound(self, CHAN_VOICE, "hknight/idle.wav", ATTN_NORM, ATTN_NORM); + sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", CHAN_WEAPON, ATTN_NORM); +}; + +void() anac_eat10 = [100, anac_eat11] +{ + ai_charge(-10); + ai_face(); +}; + +void() anac_eat11 = [101, anac_eat12] +{ + ai_charge(-10); + ai_face(); +}; + +void() anac_eat12 = [102, anac_eat13] +{ + ai_charge(-10); + ai_face(); + AnacMissile(ATTN_NONE); + AnacMissile(ATTN_NORM); + AnacMissile(CONTENT_EMPTY); +}; + +void() anac_eat13 = [103, anac_eat14] +{ + ai_charge(-10); + ai_face(); +}; + +void() anac_eat14 = [104, anac_eat15] +{ + ai_charge(-10); + ai_face(); +}; + +void() anac_eat15 = [105, anac_eat16] +{ + ai_charge(MOVETYPE_BOUNCE); + ai_face(); +}; + +void() anac_eat16 = [106, anac_eat17] +{ + ai_charge(MOVETYPE_BOUNCE); + ai_face(); +}; + +void() anac_eat17 = [107, anac_run] +{ + ai_charge(MOVETYPE_BOUNCE); + ai_face(); +}; + +void(entity inflictor, entity attacker, float damage) anac_pain01 = { return; }; // no response to pain + +void() anac_die = [10, anac_die] +{ + anacdoom_1(); +}; + +void() anac_doom = [4, anac_doom02] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "m"); +}; + +void() anac_doom02 = [5, anac_doom03] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "k"); +}; + +void() anac_doom03 = [6, anac_doom04] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "k"); +}; + +void() anac_doom04 = [5, anac_doom05] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "i"); +}; + +void() anac_doom05 = [6, anac_doom06] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "g"); +}; + +void() anac_doom06 = [4, anac_doom07] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "e"); +}; + +void() anac_doom07 = [5, anac_doom08] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "a"); +}; + +void() anac_doom08 = [6, anac_doom09] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "c"); +}; + +void() anac_doom09 = [5, anac_doom10] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "e"); +}; + +void() anac_doom10 = [4, anac_doom11] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "i"); +}; + +void() anac_doom11 = [5, anac_doom12] +{ + ai_pain(ATTN_NORM); + lightstyle(ATTN_NONE, "m"); +}; + +void() anac_doom12 = [6, anac_doom12] { + anacdoom_4(); + lightstyle(ATTN_NONE, "m"); +}; + +void() anacdoom_1 = { + /* + local entity pos; + local entity pl; + local entity timer; + + + if (!(self.spawnflags & ANAC_NOINTERMISSION)) { + intermission_exittime = time + 10000000; + intermission_running = ATTN_NORM; + pos = find(world, classname, "info_intermission"); + if (!pos) error("no info_intermission"); + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, ""); + pl = find(world, classname, "player"); + pl.angles = pos.mangle; + pl.takedamage = DAMAGE_NO; + pl.solid = SOLID_NOT; + pl.movetype = MOVETYPE_NONE; + pl.modelindex = MOVETYPE_NONE; + setorigin(pl, pos.origin); + pl = find(pl, classname, "player"); + } + timer = spawn(); + timer.nextthink = time; + timer.think = anacdoom_2;*/ +}; + +void() anacdoom_2 = { + local vector o; + + o = annie.origin - '0 100 0'; + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord(MSG_BROADCAST, o_x); + WriteCoord(MSG_BROADCAST, o_y); + WriteCoord(MSG_BROADCAST, o_z); + self.nextthink = time + 1.5; + self.nextthink = time; + self.think = anacdoom_3; +}; + +void() anacdoom_3 = { + annie.think = anac_doom; + sound(annie, CHAN_VOICE, "boss2/death.wav", ATTN_NORM, ATTN_NONE); + lightstyle(ATTN_NONE, "abcdefghijklmlkjihgfedcb"); +}; + +void() anacdoom_4 = { + local vector oldo; + local float x,y,z,r; + + oldo = self.origin; + sound(self, CHAN_VOICE, "boss2/pop2.wav", ATTN_NORM, ATTN_NONE); + z = 16; + self.gib1mdl = annie.gib1mdl; + self.gib2mdl = annie.gib2mdl; + self.gib3mdl = annie.gib3mdl; + while (z <= 144) { + x = -64; + while (x <= 64) { + y = -64; + while (y <= 64) { + self.origin_x = oldo_x + x; + self.origin_y = oldo_y + y; + self.origin_z = oldo_z + z; + r = random(); + if (r < 0.3) { + ThrowGib(11, 1); + } else { + if (r < 0.6) { + ThrowGib(12, 1); + } else { + ThrowGib(13, 1); + } + } + y = y + 32; + } + x = x + 32; + } + z = z + 96; + } + if (!(self.spawnflags & ANAC_NOINTERMISSION)) { + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "Congratulations, soldier...\nYou've single handedly destroyed the\nvile Anaconda beast and all her\nspawn... Good work..\n\n-CREDITS-\nQUAKE(r) is a registered\ntrademark of Id Software, Inc.\nQUAKE(r) Scrag,Rottfish,Ogre characters\n& Textures included within this product\n(c)1996 Id Software, Inc.\nAll Rights reserved.\nLevel design: S.Thoms aka. MAGICMAN\nAnaconda skin: L.Pope\nSnakeman skin: C.Bolin\nSnakeModels+Code: S.Y.Tan aka. BUBBAH\nLevel Concept by:\nPrecision Entertainment, Inc.\n"); + } + remove(self); + WriteByte(MSG_ALL, SVC_CDTRACK); + WriteByte(MSG_ALL, TE_EXPLOSION); + WriteByte(MSG_ALL, TE_EXPLOSION); + lightstyle(ATTN_NONE, "z"); +}; + +void() anac_explode1 = [133, anac_explode2] { self.takedamage = DAMAGE_NO; }; +void() anac_explode2 = [133, anac_explode2] { + T_RadiusDamage(self, self, 20, world,DAMAGEALL); + sound(self, CHAN_VOICE, "blob/death1.wav", ATTN_NORM, ATTN_NORM); + self.origin = self.origin - MOVETYPE_NOCLIP * normalize(self.velocity); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z); + BecomeExplosion(); + if (!(self.spawnflags & ANAC_NOINTERMISSION)) { + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "Congratulations, soldier...\nAs the Anaconda's Huge body\nslithers lifeless\naway from this earth,\nyou must agree, that this\nmother of snakemen,\nthis vile devilthing,\nwas a pretty tough cookie\n\nJump through the slipgate to exit\nthis mission...\n\nGood work.\n\nLevel design: MAGICMAN\nAnaconda skin: POPE\nSnakeman skin: BOLIN\nSnakeModels + Coding: BUBBAH\n"); + } +}; + +void() anac_awake = { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z); + self.yaw_speed = 20; + anac_rise(); +}; + +void() anac_down = { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z); + self.yaw_speed = 20; + anac_fall6(); +}; + +void() check_anac = { + local vector dist; + local float d; + dist = self.enemy.origin - self.origin; + d = vlen(dist); + if (d < 250) { + anac_eat(); + } else { + anac_attk(); + } +}; + +void() monster_anac = { + if (deathmatch) { remove(self); return; } + precache_sound2("blob/death1.wav"); + precache_sound2("boss1/out1.wav"); + precache_sound2("boss1/sight1.wav"); + precache_sound2("hknight/idle.wav"); + precache_sound2("demon/dhit2.wav"); + precache_sound2("enforcer/enfstop.wav"); + precache_sound2("zombie/z_shot1.wav"); + precache_sound2("items/damage2.wav"); + precache_sound2("doors/airdoor2.wav"); + precache_sound2("boss2/pop2.wav"); + precache_sound2("boss2/death.wav"); + precache_model2("progs/anaconda/anaconda.mdl"); + precache_model2("progs/drake/s_explod.spr"); + precache_model2("progs/spike2.mdl"); + precache_model("progs/gib1.mdl"); + self.gib1mdl = "progs/gib1.mdl"; + precache_model("progs/gib2.mdl"); + self.gib2mdl = "progs/gib2.mdl"; + precache_model("progs/gib3.mdl"); + self.gib3mdl = "progs/gib3.mdl"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.mdl = "progs/anaconda/anaconda.mdl"; + self.sight_sound = "boss1/sight1.wav"; + if (!self.bboxtype) self.bboxtype = BBOX_ANACONDA; + if (self.health < 1) self.health = 1700; + self.th_stand = anac_stand1; + self.th_walk = anac_walk01; + self.th_run = anac_awake; + self.th_pain = anac_pain01; + self.th_missile = check_anac; + self.th_melee = check_anac; + self.th_die = anac_die; + self.bossflag = TRUE; + annie = self; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was killed by a giant anaconda\n"; + + if(!self.classtype) self.classtype = CT_MONANACONDA; + if (!self.classgroup) self.classgroup = CG_BOSS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_archer.qc b/QC_other/QC_keep/mon_archer.qc new file mode 100644 index 00000000..8078e820 --- /dev/null +++ b/QC_other/QC_keep/mon_archer.qc @@ -0,0 +1,767 @@ +/* +============================================================================== + +ARCHER + +============================================================================== +*/ + +$cd id1/models/archer +$origin 0 0 24 +$base base +$skin skin + +$frame backup1 backup2 backup3 backup4 backup5 backup6 backup7 backup8 + +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 deathA11 deathA12 deathA13 deathA14 deathA15 +$frame deathA16 deathA17 deathA18 deathA19 deathA20 deathA21 deathA22 + +$frame draw1 draw2 draw3 draw4 draw5 draw6 draw7 draw8 draw9 draw10 +$frame draw11 draw12 draw13 + +//$frame duck1 duck2 duck3 duck4 duck5 duck6 duck7 duck8 duck9 duck10 +//$frame duck11 duck12 duck13 duck14 + +$frame fire1 fire2 fire3 fire4 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 pain9 pain10 +$frame pain11 pain12 pain13 pain14 pain15 pain16 + +$frame patrol1 patrol2 patrol3 patrol4 patrol5 patrol6 patrol7 patrol8 +$frame patrol9 patrol10 patrol11 patrol12 patrol13 patrol14 patrol15 +$frame patrol16 patrol17 patrol18 patrol19 patrol20 patrol21 patrol22 + +$frame redraw1 redraw2 redraw3 redraw4 redraw5 redraw6 redraw7 redraw8 +$frame redraw9 redraw10 redraw11 redraw12 + +$frame tranA1 tranA2 tranA3 tranA4 tranA5 tranA6 tranA7 tranA8 tranA9 +$frame tranA10 tranA11 tranA12 tranA13 + +$frame tranB1 tranB2 tranB3 tranB4 tranB5 tranB6 tranB7 tranB8 tranB9 +$frame tranB10 tranB11 tranB12 tranB13 tranB14 tranB15 tranB16 + +//$frame tranC1 tranC2 tranC3 tranC4 tranC5 tranC6 tranC7 tranC8 tranC9 tranC10 + +//$frame tranD1 tranD2 tranD3 tranD4 tranD5 tranD6 tranD7 tranD8 tranD9 + +$frame waitA1 waitA2 waitA3 waitA4 waitA5 waitA6 waitA7 waitA8 waitA9 waitA10 +$frame waitA11 waitA12 waitA13 waitA14 waitA15 waitA16 waitA17 waitA18 + +$frame waitB1 waitB2 waitB3 waitB4 waitB5 waitB6 waitB7 waitB8 waitB9 +$frame waitB10 waitB11 waitB12 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +// SoE: Vorpal Sword +$frame decap1 decap2 decap3 decap4 decap5 decap6 decap7 decap8 decap9 decap10 +$frame decap11 decap12 decap13 decap14 decap15 decap16 decap17 + +//============================================================================= + +//- - - - - - - - - +// Model is based on the archer from Hexen2. AI used is mostly Quake's +// with bit of Hexen2's. Fancy moves such as ducking and sidestepping +// are NOT used, since it is so un-Quake (and I simply want a medieval +// style grunt/enforcer). Holding his shot after drawing the bow, +// along with much of the shooting AI, was ported over. +// +// -- Patrick Martin +//- - - - - - - - - + +// Check if the archer has a clear shot to his target. +float() archer_check_shot = { + local vector spot1, spot2; + local entity targ; + + targ = self.enemy; + + makevectors (self.angles); + spot1 = self.origin + v_forward*16 + v_right*8 + v_up*24; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, ARROW_FLY, self); + + if (trace_ent != targ) + { + // Didn't hit the intended target. Either something else blocked + // the scan, or the scan was complete and could not hit the target. + // Standard 1.06 progs would just return FALSE. + if (trace_fraction < 1) + { // don't have a clear shot + //if (DontHurtMe (trace_ent)) + return FALSE; // Don't shoot whoever is in line of fire. + + // Otherwise, whoever is in the way is a potential enemy and + // hitting him instead of the intended target with missile + // attacks is still useful. + } + else + { // Target is non-solid. It could be a wraith, downed zombie, + // or something in spectator mode. Attack only if target is + // a ghost. + if (targ.takedamage != DAMAGE_AIM) + return FALSE; + //if (!IsGhost (targ)) + //return FALSE; +// Commented out because those with no mindex should have DAMAGE_NO too. +// if (!targ.modelindex) +// return FALSE; + } + } + + // PM: Added alert support so that some monsters can see and attack + // through water like players can. + // FIXME: Is the 'fish check' necessary here? + if (trace_inopen) + if (trace_inwater) + if (!(self.ryuflags & RYU_ALERT)) // PM: Alert support. + return FALSE; // sight line crossed contents + + return TRUE; +}; + +// Basically a copy of CheckAttack except for spot1 and spot2 in the +// traceline check. +void() ArcherCheckAttack = { + if (enemy_range == RANGE_FAR) + return; // Don't call traceline again when we don't need to. + if (!archer_check_shot ()) + return; + if (time < self.attack_finished) + return; + + local float chance; + + if (enemy_range == RANGE_MELEE) + { + chance = 0.9; + self.attack_finished = 0; + } + else if (enemy_range == RANGE_NEAR) + chance = 0.4; + else if (enemy_range == RANGE_MID) + chance = 0.1; + else //if (enemy_range == RANGE_LONG) // PM: New range! + chance = 0.04; +// else +// chance = 0; + + if (random () < chance) { + chance = 2*random(); + self.th_missile (); + SUB_AttackFinished (chance); + return; + } + + return; +}; + + +//============================================================================= + +float() archer_lord = {return (self.classname == "monster_archer_lord");}; + +void(vector st, float up) M_FireAkArrow = { + local vector org, dir; + local entity targ; + local float type; + + if (archer_lord ()) + targ = self.enemy; + else + targ = world; + + makevectors (self.angles); + org = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + dir = Aimpoint (self.enemy); + dir = Maim_Line (org, dir, AKARROW_SPEED_FLY, targ, '0 0 0'); + + // Note: Magic arrows can hit ghosts, but normal arrows cannot. + if (archer_lord ()) { + //if (IsGhost (self.enemy)) + // {type = 2; up = 0;} // Auto upgrade to hit ghosts. + //else + //{ + type = 1; + if (up) // Upgrade check. + { // Check: Don't upgrade arrow if hitting wrong target is likely. + // Used to stop blue arrows from hitting and moving monsters around + // by hitting them with a weaker arrow instead. + traceline (org, org + dir*2048, ARROW_FLY, self); + + if ((trace_ent == self.enemy) || !(trace_ent.flags & FLx_CREATURE)) + type = 2; // Upgrade arrow to the next type. + } + //} + } else { + // In Hexen2, grunt arrow damage is the same regardless of type. + // Therefore, do not upgrade arrows for them in Drake. + type = self.skin & 1; + } + + // In Hexen2, 0=green, 1=red, 2=gold. + if (type & 1) + sound (self, CHAN_WEAPON, "archer/arrowr.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "archer/arrowg.wav", 1, ATTN_NORM); + + AkArrow_Launch (org, dir, type); +}; + +// STAND - - - - - - - - - - - - - - - - +void() archer_stand1 =[ $waitA1, archer_stand2 ] {ai_stand();}; +void() archer_stand2 =[ $waitA2, archer_stand3 ] {ai_stand();}; +void() archer_stand3 =[ $waitA3, archer_stand4 ] {ai_stand();}; +void() archer_stand4 =[ $waitA4, archer_stand5 ] {ai_stand();}; +void() archer_stand5 =[ $waitA5, archer_stand6 ] {ai_stand();}; +void() archer_stand6 =[ $waitA6, archer_stand7 ] {ai_stand();}; +void() archer_stand7 =[ $waitA7, archer_stand8 ] {ai_stand();}; +void() archer_stand8 =[ $waitA8, archer_stand9 ] {ai_stand();}; +void() archer_stand9 =[ $waitA9, archer_stand10 ] {ai_stand();}; +void() archer_stand10 =[ $waitA10, archer_stand11 ] {ai_stand();}; +void() archer_stand11 =[ $waitA11, archer_stand12 ] {ai_stand();}; +void() archer_stand12 =[ $waitA12, archer_stand13 ] {ai_stand();}; +void() archer_stand13 =[ $waitA13, archer_stand14 ] {ai_stand();}; +void() archer_stand14 =[ $waitA14, archer_stand15 ] {ai_stand();}; +void() archer_stand15 =[ $waitA15, archer_stand16 ] {ai_stand();}; +void() archer_stand16 =[ $waitA16, archer_stand17 ] {ai_stand();}; +void() archer_stand17 =[ $waitA17, archer_stand18 ] {ai_stand();}; +void() archer_stand18 =[ $waitA18, archer_stand1 ] {ai_stand();}; + +// WALK - - - - - - - - - - - - - - - - +void() archer_draw = {sound (self, CHAN_WEAPON, "archer/draw.wav", 1, ATTN_NORM);}; + +void() archer_growl = +{ + if (random() < 0.1) + { + if (archer_lord ()) + { + if (random() < 0.7) + sound (self, CHAN_VOICE, "archer/growl2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "archer/growl3.wav", 1, ATTN_NORM); + } + else + sound (self, CHAN_VOICE, "archer/growl.wav", 1, ATTN_NORM); + } +}; + +void() archer_walk1 =[ $patrol2, archer_walk2 ] {archer_growl(); ai_walk(2);}; +void() archer_walk2 =[ $patrol4, archer_walk3 ] {ai_walk(3);}; +void() archer_walk3 =[ $patrol6, archer_walk4 ] {ai_walk(6);}; +void() archer_walk4 =[ $patrol8, archer_walk5 ] {ai_walk(6);}; +void() archer_walk5 =[ $patrol10, archer_walk6 ] {monster_footstep(FALSE); ai_walk(4);}; +void() archer_walk6 =[ $patrol12, archer_walk7 ] {ai_walk(1);}; +void() archer_walk7 =[ $patrol14, archer_walk8 ] {ai_walk(3);}; +void() archer_walk8 =[ $patrol16, archer_walk9 ] {ai_walk(4);}; +void() archer_walk9 =[ $patrol18, archer_walk10 ] {ai_walk(4);}; +void() archer_walk10 =[ $patrol20, archer_walk11 ] {ai_walk(4);}; +void() archer_walk11 =[ $patrol22, archer_walk1 ] {monster_footstep(FALSE); ai_walk(2);}; + +// RUN - - - - - - - - - - - - - - - - - +void() archer_run1 =[ $walk2, archer_run2 ] {archer_growl(); ai_run(4);}; +void() archer_run2 =[ $walk4, archer_run3 ] {ai_run(8);}; +void() archer_run3 =[ $walk6, archer_run4 ] {ai_run(10);}; +void() archer_run4 =[ $walk8, archer_run5 ] {monster_footstep(FALSE); ai_run(9);}; +void() archer_run5 =[ $walk10, archer_run6 ] {ai_run(4);}; +void() archer_run6 =[ $walk12, archer_run7 ] {ai_run(8);}; +void() archer_run7 =[ $walk14, archer_run8 ] {ai_run(10);}; +void() archer_run8 =[ $walk16, archer_run1 ] {monster_footstep(FALSE); ai_run(9);}; + +// ATTACK - - - - - - - - - - - - - - - +float ARCHER_CLOSE = 200; +float ARCHER_FAR = 500; + +void() archer_fire1; + +float() archer_face = +{ +// SoE: Normal archers use stupid old enforcer AI. + if (soul_evil) + { + if (archer_lord ()) + if (!visible (self.enemy)) + {self.think = archer_run1; return FALSE;} + ai_face(); + return TRUE; + } + +// Emulate Hexen2 behavior. + if (visible (self.enemy)) + {ai_face(); return TRUE;} + else + {self.think = archer_run1; return FALSE;} +}; + +void() archer_hold = +{ +// SoE: Make archer grunts emulate Quake enforcers better. + if (soul_evil) + { + if (!archer_lord ()) + { + self.shots_left = !self.shots_left; + archer_fire1 (); + return; + } + } + +//- - - - - - - - - - - - - - - - - - - +// Animate the archer. + local float chance, dist, r; + + r = 1; + dist = vlen (self.enemy.origin - self.origin); + chance = infront (self.enemy); + if ( chance && ((dist <= ARCHER_CLOSE) || (dist > ARCHER_FAR)) ) + { + if (dist <= ARCHER_CLOSE) + { // Enemy too close -- backup. + if ( self.frame == $backup1 ) + {self.frame = $backup2; ai_back(1);} + else if ( self.frame == $backup2 ) + {self.frame = $backup3; ai_back(1);} + else if ( self.frame == $backup3 ) + {self.frame = $backup4; ai_back(2);} + else if ( self.frame == $backup4 ) + {self.frame = $backup5; ai_back(1);} + else if ( self.frame == $backup5 ) + {self.frame = $backup6; ai_back(2);} + else if ( self.frame == $backup6 ) + {self.frame = $backup7; ai_back(4);} + else if ( self.frame == $backup7 ) + {self.frame = $backup8; ai_back(4); r = 0;} + else + {self.frame = $backup1; ai_back(2);} + } + else + { // Enemy should be closer -- advance. + if ( self.frame == $backup8 ) + {self.frame = $backup7; ai_forward(4);} + else if ( self.frame == $backup7 ) + {self.frame = $backup6; ai_forward(4);} + else if ( self.frame == $backup6 ) + {self.frame = $backup5; ai_forward(2);} + else if ( self.frame == $backup5 ) + {self.frame = $backup4; ai_forward(1);} + else if ( self.frame == $backup4 ) + {self.frame = $backup3; ai_forward(2);} + else if ( self.frame == $backup3 ) + {self.frame = $backup2; ai_forward(2);} + else if ( self.frame == $backup2 ) + {self.frame = $backup1; ai_forward(1); r = 0;} + else + {self.frame = $backup8; ai_forward(2);} + } + } + else + { // Enemy is either within ideal distance or behind archer -- stay. + if ( ( self.frame >= $waitB2 ) && ( self.frame <= $waitB10 ) ) + self.frame = self.frame + 2; + else + {self.frame = $waitB2; r = 0;} + } + self.nextthink = time + 0.1; + self.think = archer_hold; +//- - - - - - - - - - - - - - - - - - - + +// Don't shoot blindly if enemy is confirmed to be dead. +// Doing so might hit other monsters (behind target) we'd rather not anger. + if (self.enemy.health <= 0) + if (self.enemy.deadflag >= DEAD_DEAD) + {self.think = archer_run1; return;} + + if (!archer_face ()) + return; // Thinking set to th_run by call to function. + +// Borrowing v_forward from the prior call to makevectors in 'infront'... + if (!chance) + { // See if the target is still not infront after elevation is gone. + local vector spot; + + spot = self.enemy.origin; + spot_z = self.origin_z; + spot = normalize(spot - self.origin); + if (spot * v_forward <= 0.3) + return; // Target is really not infront. + } + + if (r) + { // Random hold algorithm from Hexen2. + chance = (skill * 0.05) + (self.skin * 0.10); + if (random() >= chance) + return; + } + + if (!archer_check_shot ()) + { // Something got in the way. Abort shot then move. + sound (self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + self.think = archer_run1; + return; + } + +// Hexen2: 40% chance to automatically shoot in melee. +// In Hexen, this is done before random and shot checks. +// Here in Quake, do this after checking shot because it is possible for +// thin monsters to squeeze between the archer and target even in melee range. + enemy_range = range(self.enemy); + if (enemy_range < RANGE_NEAR) + if (random() < 0.4) + { + archer_fire1 (); + return; + } + + if (!archer_lord ()) + { // Grunts don't always shoot immediately. + if (enemy_range == RANGE_MELEE) + chance = 1; + else if (enemy_range == RANGE_NEAR) + chance = 0.7; + else if (enemy_range == RANGE_MID) + chance = 0.6; + else + chance = 0.5; + + if (random() >= chance) + return; + } + + archer_fire1 (); +}; + +void() archer_redraw1 =[ $redraw2, archer_redraw2 ] {archer_face();}; +void() archer_redraw2 =[ $redraw4, archer_redraw3 ] {archer_face();}; +void() archer_redraw3 =[ $redraw6, archer_redraw4 ] {archer_face();}; +void() archer_redraw4 =[ $redraw8, archer_redraw5 ] {archer_face(); archer_draw();}; +void() archer_redraw5 =[ $redraw10, archer_redraw6 ] {archer_face();}; +void() archer_redraw6 =[ $redraw11, archer_redraw7 ] {archer_face();}; +void() archer_redraw7 =[ $redraw12, archer_hold ] {archer_face();}; + +// Advancing attack +void() archer_attack1 =[ $tranA2, archer_attack2 ] {archer_face(); ai_forward(8);}; +void() archer_attack2 =[ $tranA4, archer_attack3 ] {archer_face(); ai_forward(7);}; +void() archer_attack3 =[ $tranA6, archer_attack4 ] {archer_face(); ai_forward(6); archer_draw();}; +void() archer_attack4 =[ $tranA8, archer_attack5 ] {archer_face(); ai_forward(4);}; +void() archer_attack5 =[ $tranA10, archer_attack6 ] {archer_face(); monster_footstep(FALSE); ai_forward(5);}; +void() archer_attack6 =[ $tranA12, archer_attack7 ] {archer_face();}; +void() archer_attack7 =[ $tranA13, archer_hold ] {archer_face();}; + +// Retreating attack +void() archer_attackb1 =[ $draw2, archer_attackb2 ] {archer_face();}; +void() archer_attackb2 =[ $draw4, archer_attackb3 ] {archer_face(); ai_back(4);}; +void() archer_attackb3 =[ $draw6, archer_attackb4 ] {archer_face(); ai_back(6);}; +void() archer_attackb4 =[ $draw8, archer_attackb5 ] {archer_face(); ai_back(7); archer_draw();}; +void() archer_attackb5 =[ $draw10, archer_attackb6 ] {archer_face(); ai_back(8);}; +void() archer_attackb6 =[ $draw12, archer_attackb7 ] {archer_face(); monster_footstep(FALSE); ai_back(4);}; +void() archer_attackb7 =[ $draw13, archer_hold ] {archer_face();}; + +void() archer_attack = +{ + if (enemy_range < RANGE_MID) // Range set by CheckAttack. + archer_attackb1 (); // Step back. + else + archer_attack1 (); // Step forward. +}; + +void() archer_fire1 =[ $fire2, archer_fire2 ] {ai_face(); + local float chance, up; + + // Check for upgrade chance. + chance = (0.5 - (range(self.enemy) * 0.2)); + if (chance < 0) + up = chance = 0; + else + up = (random() < chance); // Upgrade arrow type if TRUE. + + // Launch! + M_FireAkArrow ('16 8 24', up); + + // Normal Hexen2 refire check. + if (self.enemy.health <= 0) + chance = 0; // Enemy is dead. + else { + chance = chance + (skill * 0.1); + if (!archer_lord ()) chance = chance - 0.3; + } +// SoE: Grunts emulate enforcer ai. + if (soul_evil) { + if (!archer_lord ()) { + if (self.shots_left) + chance = 2; + else + chance = 0; + } + } +//- - - - - - - - - + + if (random() < chance) + self.think = archer_redraw5; + else + SUB_CheckRefire (archer_redraw5); +}; +void() archer_fire2 =[ $fire4, archer_fire3 ] {ai_face();}; +// The rest is a transition scene from fire to run. +void() archer_fire3 =[ $tranB2, archer_fire4 ] {ai_run(3);}; +void() archer_fire4 =[ $tranB4, archer_fire5 ] {ai_run(10);}; +void() archer_fire5 =[ $tranB6, archer_fire6 ] {ai_run(12);}; +void() archer_fire6 =[ $tranB8, archer_fire7 ] {ai_run(8);}; +void() archer_fire7 =[ $tranB10, archer_fire8 ] {monster_footstep(FALSE); ai_run(3);}; +void() archer_fire8 =[ $tranB12, archer_fire9 ] {ai_run(8);}; +void() archer_fire9 =[ $tranB14, archer_fire10 ] {ai_run(11);}; +void() archer_fire10 =[ $tranB16, archer_run1 ] {ai_run(8);}; + +// PAIN - - - - - - - - - - - - - - - - +// Counter means counterattack here. Use at end of pain anims. +void() archer_counter = +{ + if (self.enemy) + if (visible (self.enemy)) + if (infront (self.enemy)) + if (archer_check_shot ()) + self.think = archer_fire1; +}; + +// This first pain anim is Quake-style flinching. Not found in Hexen2. +void() archer_pain1 =[ $pain1, archer_pain2 ] {}; +void() archer_pain2 =[ $pain2, archer_pain3 ] {}; +void() archer_pain3 =[ $pain3, archer_pain4 ] {}; +void() archer_pain4 =[ $pain2, archer_pain5 ] {}; +void() archer_pain5 =[ $pain1, archer_run1 ] {}; + +// The rest are redraw pain anims as per Hexen2. +void() archer_painb1 =[ $pain2, archer_painb2 ] {}; +void() archer_painb2 =[ $pain4, archer_painb3 ] {}; +void() archer_painb3 =[ $pain6, archer_painb4 ] {}; +void() archer_painb4 =[ $pain8, archer_painb5 ] {}; +void() archer_painb5 =[ $pain10, archer_painb6 ] {monster_footstep(FALSE);}; +void() archer_painb6 =[ $pain12, archer_painb7 ] {ai_face(); archer_draw();}; +void() archer_painb7 =[ $pain14, archer_painb8 ] {ai_face();}; +void() archer_painb8 =[ $pain16, archer_hold ] {ai_face(); archer_counter();}; + +// Note: Do not use redraw functions as a pain anim because the archer can +// short-curcuit the anim if no enemy is seen, and we don't want to let him. +// Update: Use redraw sequence after the second frame. +void() archer_painc1 =[ $redraw2, archer_painc2 ] {}; +void() archer_painc2 =[ $redraw4, archer_redraw3 ] {}; +//void() archer_painc3 =[ $redraw6, archer_painc4 ] {ai_face();}; +//void() archer_painc4 =[ $redraw8, archer_painc5 ] {ai_face(); archer_draw();}; +//void() archer_painc5 =[ $redraw10, archer_painc6 ] {ai_face();}; +//void() archer_painc6 =[ $redraw11, archer_painc7 ] {ai_face();}; +//void() archer_painc7 =[ $redraw12, archer_hold ] {ai_face(); archer_counter();}; + +void(entity inflictor, entity attacker, float damage) archer_pain = { + // don't make multiple pain sounds right after each other + // Note: Archers redraw bow during this time in Hexen2. Don't do it here. + if (self.pain_finished > time) + return; + + self.pain_finished = time + 1; + if (archer_lord ()) { + sound (self, CHAN_VOICE, "archer/pain2.wav", 1, ATTN_NORM); + // The archer looks like a hell knight, so give him the same no-flinch, + // but only if he is a lord class. + if (random()*30 > damage) + return; // didn't flinch + } else + sound (self, CHAN_VOICE, "archer/pain.wav", 1, ATTN_NORM); + + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + if (self.fighting) // In case enemy is set to master during follow AI. + if (self.enemy) + { // In Hexen2, both redraw and pain anims redraw the bow. + // Here, in Quake, do not always allow a redraw. + damage = random(); + if (damage < 0.25) + archer_painc1 (); + else if (damage < 0.5) + archer_painb1 (); + else + archer_pain1 (); + return; + } + archer_pain1 (); + attacker = attacker; // FrikQcc warning squelch! +}; + +// DEATH - - - - - - - - - - - - - - - - +void() archer_decap1 =[ $decap1, archer_decap2 ] {ai_back(3); blood_spray('0 0 27', 1);}; +void() archer_decap2 =[ $decap3, archer_decap3 ] {ai_back(9); blood_spray('-7 -1 26', 2);}; +void() archer_decap3 =[ $decap5, archer_decap4 ] {blood_spray('-4 -1 23', 1); self.solid = SOLID_NOT; DropBackpack(); }; +void() archer_decap4 =[ $decap7, archer_decap5 ] {}; //blood_spray('0 1 16', 1);}; +void() archer_decap5 =[ $decap9, archer_decap6 ] {blood_spray('2 0 8', -1);}; +void() archer_decap6 =[ $decap11, archer_decap7 ] {}; +void() archer_decap7 =[ $decap13, archer_decap8 ] {}; +void() archer_decap8 =[ $decap15, archer_decap9 ] {}; +void() archer_decap9 =[ $decap17, archer_decap9 ] {}; + +void() archer_die1 =[ $deathA2, archer_die2 ] {ai_back(3);}; +void() archer_die2 =[ $deathA4, archer_die3 ] {ai_back(2);}; +void() archer_die3 =[ $deathA6, archer_die4 ] {ai_back(2); self.solid = SOLID_NOT; DropBackpack(); }; +void() archer_die4 =[ $deathA8, archer_die5 ] {ai_back(4);}; +void() archer_die5 =[ $deathA10, archer_die6 ] {ai_back(1);}; +void() archer_die6 =[ $deathA12, archer_die7 ] {}; +void() archer_die7 =[ $deathA14, archer_die8 ] {}; +void() archer_die8 =[ $deathA16, archer_die9 ] {}; +void() archer_die9 =[ $deathA18, archer_die10 ] {}; +void() archer_die10 =[ $deathA20, archer_die11 ] { +// PM: Archer death sound split into two files. Play part 2. + if (self.flags & FL_ONGROUND && !(archer_lord())) sound (self, CHAN_AUTO, "archer/crash.wav", 1, ATTN_NORM); +}; +void() archer_die11 =[ $deathA22, archer_die11 ] {}; + +void() archer_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + //if (Shattered ()) return; + //if (Decapitated ()) { monster_decap ('0 0 27', archer_decap1); return; } + + // Clear weapon sound + sound (self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + + // regular death + if (!self.gibbed) { + if (archer_lord ()) + sound (self, CHAN_VOICE, "archer/death2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "archer/death.wav", 1, ATTN_NORM); + archer_die1 (); + } +}; + +// REVIVE - - - - - - - - - - - - - - - +void() archer_revive1 =[ $deathA20, archer_revive2 ] {}; +void() archer_revive2 =[ $deathA18, archer_revive3 ] {}; +void() archer_revive3 =[ $deathA16, archer_revive4 ] {}; +void() archer_revive4 =[ $deathA14, archer_revive5 ] {}; +void() archer_revive5 =[ $deathA12, archer_revive6 ] {}; +void() archer_revive6 =[ $deathA10, archer_revive7 ] {}; +void() archer_revive7 =[ $deathA8, archer_revive8 ] {}; +void() archer_revive8 =[ $deathA6, archer_revive9 ] {}; +void() archer_revive9 =[ $deathA4, archer_revive10 ] {}; +void() archer_revive10 =[ $deathA2, archer_run1 ] {}; + +// OTHER - - - - - - - - - - - - - - - - +void(float hello) archer_sight = { + if (archer_lord ()) { + if (hello) + sound (self, CHAN_VOICE, "archer/growl2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "archer/sight2.wav", 1, ATTN_NORM); + } else { + if (hello) + sound (self, CHAN_VOICE, "archer/growl.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "archer/sight.wav", 1, ATTN_NORM); + } +}; + +//============ +// --> QUAKED monster_archer (1 0 0) (-16 -16 -24) (16 16 40) Ambush +//============ +void() monster_archer = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/drake/archer.mdl"; + self.headmdl = "progs/drake/h_archer.mdl"; + precache_model ("progs/drake/arrow.mdl"); // Replaced 'akarrow.mdl'. + precache_model ("progs/drake/archer.mdl"); + precache_model ("progs/drake/h_archer.mdl"); + + precache_sound ("archer/draw.wav"); + precache_sound ("archer/arrow1.wav"); + precache_sound ("archer/arrow2.wav"); + precache_sound ("archer/arrow3.wav"); + precache_sound ("archer/arrowbrk.wav"); + precache_sound ("archer/arrowg.wav"); // Type 0 and 2 arrows. + precache_sound ("archer/arrowr.wav"); // Type 1 arrows. + precache_sound ("archer/death.wav"); + precache_sound ("archer/growl.wav"); + precache_sound ("archer/pain.wav"); + precache_sound ("archer/sight.wav"); + precache_sound ("archer/crash.wav"); + precache_sound ("archer/death2.wav"); + precache_sound ("archer/growl2.wav"); + precache_sound ("archer/growl3.wav"); + precache_sound ("archer/pain2.wav"); + precache_sound ("archer/sight2.wav"); + precache_sound ("archer/explode.wav"); + + // Hexen2 archers have 80 health. (Lords have 325 health.) + // Note: Hexen2 archers gibbed at -30 hp. Since the archers have armor + // similar to Quake knights, use -40 hp instead. + if (self.classname == "monster_archer_lord") { + // Archer Lord. + self.skin = 1; + self.ryuflags = self.ryuflags | RYU_ALERT; // From Dragons. + if (soul_evil) + monster_purse (3, 0.75, 0.25); + + if (self.health < 1) self.health = 325; + self.gibhealth = -40; + if (self.deathstring == "") self.deathstring = " was assassinated by an Assassin\n"; + } else { + // Grunt class. + self.skin = 0; + if (soul_evil) + monster_purse (2, 0.5, 0); + + if (self.health < 1) self.health = 80; + self.gibhealth = -40; + if (self.deathstring == "") self.deathstring = " was skewered by an Archer\n"; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + + self.gibbed = FALSE; + self.pain_flinch = 40; + self.pain_longanim = TRUE; + self.steptype = FS_TYPEMEDIUM; + self.mass = MASS_MEDIUM; + self.th_stand = archer_stand1; + self.th_walk = archer_walk1; + self.th_run = archer_run1; + self.th_missile = archer_attack; + self.th_pain = archer_pain; + self.th_die = archer_die; + self.th_sight = archer_sight; + self.th_checkattack = ArcherCheckAttack; + self.th_revive = archer_revive1; + self.th_spawn = monster_archer; + + self.attack_state = AS_FLANKING; + //if (!soul_evil || (self.skin == 1)) + //{ // Archer/Assassin of Bane. + // self.family = FAM_BANE; + // self.xfl = XFL_ARMORED; //| XFL_METALHEAD; + //} + +// As SoE enforcer replacements, give them ammo to drop. + if (soul_evil) + self.ammo_bolts = 2; + //monster_guns (0, 0, 20, 0, 0); + //self.family = self.family | FAM_ARCHER; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.classtype = CT_MONARCHER; + self.classgroup = CG_KNIGHT; + self.classmove = MON_MOVEWALK; + + monster_start (); +}; + +//============ +// --> QUAKED monster_archer_lord (1 0 0) (-16 -16 -24) (16 16 40) Ambush +//============ +void() monster_archer_lord = { monster_archer (); }; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_armagon.qc b/QC_other/QC_keep/mon_armagon.qc new file mode 100644 index 00000000..95a49de9 --- /dev/null +++ b/QC_other/QC_keep/mon_armagon.qc @@ -0,0 +1,691 @@ +float ATTN_ARMAGON = 0.500; +float SERVO_VOLUME = 0.500; + +void () T_ArmaMissileTouch = { + local float damg; + + if ( (other == self.owner) ) + return ; + + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + damg = (50.000 + (random () * 20.000)); + if ( other.health ) { + if ( (other.classname == "monster_shambler") ) + damg = (damg * 0.500); + + T_Damage (other,self,self.owner,damg,DAMARMOR); + } + T_RadiusDamage (self,self.owner,40.000,other,DAMAGEALL); + self.origin = (self.origin - (FL_CLIENT * normalize (self.velocity))); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + BecomeExplosion (); +}; + +void (float ofs, float turn) armagon_launch_missile = { + local vector src; + local vector vec; + local vector targ; + local vector ang; + local entity missile; + local float dist; + + ang = self.angles; + ang_y = (ang_y + self.fixangle); + if ( (turn == TRUE) ) { + ang_y = (ang_y + 165.000); + } else { + if ( (turn == FL_SWIM) ) + ang_y = (ang_y - 165.000); + } + makevectors (ang); + src = (((self.origin + '0.000 0.000 66.000') + (v_right * ofs)) + (v_forward * 84.000)); + targ = (self.enemy.origin + self.enemy.view_ofs); + if ( (skill != FALSE) ) { + dist = vlen ((targ - src)); + targ = (targ + (self.enemy.velocity * (dist / 1000.000))); + } + vec = (targ - src); + vec = normalize (vec); + dist = (vec * v_forward); + if ( (dist < self.worldtype) ) + vec = v_forward; + + self.effects = (self.effects | EF_MUZZLEFLASH); + sound (self,CHAN_WEAPON,"weapons/sgun1.wav",TRUE,ATTN_NORM); + self.punchangle_x = CONTENT_SOLID; + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "missile"; + missile.velocity = (vec * 1000.000); + missile.angles = vectoangles (vec); + missile.touch = T_ArmaMissileTouch; + missile.nextthink = (time + MOVETYPE_FLY); + missile.think = SUB_Remove; + setmodel (missile,"progs/missile.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,src); +}; + +void (float ofs) armagon_launch_laser = { + local vector src; + local vector vec; + local vector targ; + local float dist; + local vector ang; + + ang = self.angles; + ang_y = (ang_y + self.fixangle); + makevectors (ang); + src = (((self.origin + '0.000 0.000 66.000') + (v_right * ofs)) + (v_forward * 84.000)); + targ = (self.enemy.origin + self.enemy.view_ofs); + if ( (skill != FALSE) ) { + dist = vlen ((targ - src)); + targ = (targ + (self.enemy.velocity * (dist / 1000.000))); + } + vec = (targ - src); + vec = normalize (vec); + dist = (vec * v_forward); + if ( (dist < self.worldtype) ) + vec = v_forward; + + self.effects = (self.effects | EF_MUZZLEFLASH); + HIP_LaunchLaser (src,vec,FALSE); +}; + +void (float angdelta, float delta) armagon_turn = { + if ( (fabs (angdelta) < MOVETYPE_BOUNCE) ) { + self.fixangle = delta; + } else { + if ( (angdelta > MOVETYPE_FLY) ) { + self.fixangle = (self.fixangle + MOVETYPE_FLYMISSILE); + } else { + if ( (angdelta < CONTENT_LAVA) ) { + self.fixangle = (self.fixangle - MOVETYPE_FLYMISSILE); + } else { + self.fixangle = delta; + } + } + } +}; + +void () armagon_overleft1; +void () armagon_overright1; + +void () armagon_think = { + local float delta; + local float angdelta; + local float r; + + setorigin (self.trigger_field,self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = (self.trigger_field.angles_y + self.fixangle); + enemy_yaw = vectoyaw ((self.enemy.origin - self.origin)); + self.ideal_yaw = enemy_yaw; + delta = (self.ideal_yaw - self.angles_y); + self.cnt = FALSE; + if ( (delta > 180.000) ) + delta = (delta - 360.000); + + if ( (delta < -180.000) ) + delta = (delta + 360.000); + + if ( (fabs (delta) > 90.000) ) { + delta = FALSE; + self.cnt = TRUE; + } + angdelta = (delta - self.fixangle); + armagon_turn (angdelta,delta); + if ( (self.health < FALSE) ) + return ; + + if ( (time > self.super_time) ) { + self.super_time = (time + MOVETYPE_WALK); + if ( (random () < 0.500) ) { + r = random (); + if ( (r < 0.250) ) { + sound (self,CHAN_VOICE,"armagon/idle1.wav",TRUE,ATTN_ARMAGON); + } else { + if ( (r < 0.500) ) { + sound (self,CHAN_VOICE,"armagon/idle2.wav",TRUE,ATTN_ARMAGON); + } else { + if ( (r < 0.750) ) { + sound (self,CHAN_VOICE,"armagon/idle3.wav",TRUE,ATTN_ARMAGON); + } else { + sound (self,CHAN_VOICE,"armagon/idle4.wav",TRUE,ATTN_ARMAGON); + } + } + } + } + } +}; + +void () armagon_walkthink = { + local float delta; + local float angdelta; + local entity client; + local float r; + + setorigin (self.trigger_field,self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = (self.trigger_field.angles_y + self.fixangle); + ChangeYaw (); + delta = FALSE; + self.cnt = FALSE; + if ( (delta > 180.000) ) + delta = (delta - 360.000); + + if ( (delta < -180.000) ) + delta = (delta + 360.000); + + if ( (fabs (delta) > 90.000) ) { + delta = FALSE; + self.cnt = TRUE; + } + angdelta = (delta - self.fixangle); + armagon_turn (angdelta,delta); + if ( (self.health < FALSE) ) + return ; + + if ( (time > self.super_time) ) { + self.super_time = (time + MOVETYPE_WALK); + if ( (random () < 0.500) ) { + r = random (); + if ( (r < 0.250) ) { + sound (self,CHAN_VOICE,"armagon/idle1.wav",TRUE,ATTN_ARMAGON); + } else { + if ( (r < 0.500) ) { + sound (self,CHAN_VOICE,"armagon/idle2.wav",TRUE,ATTN_ARMAGON); + } else { + if ( (r < 0.750) ) { + sound (self,CHAN_VOICE,"armagon/idle3.wav",TRUE,ATTN_ARMAGON); + } else { + sound (self,CHAN_VOICE,"armagon/idle4.wav",TRUE,ATTN_ARMAGON); + } + } + } + } + } + client = checkclient (); + if ( !client ) + return ; + + if ( visible (client) ) { + self.enemy = client; + FoundTarget (); + } +}; + +void () armagon_overleft_think = { + local float delta; + local float angdelta; + + ChangeYaw (); + walkmove (self.angles_y,14.000); + setorigin (self.trigger_field,self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = (self.trigger_field.angles_y + self.fixangle); + if ( (self.count == FALSE) ) { + enemy_yaw = vectoyaw ((self.enemy.origin - self.origin)); + self.ideal_yaw = enemy_yaw; + delta = ((self.ideal_yaw - self.angles_y) - 165.000); + if ( (delta > 180.000) ) + delta = (delta - 360.000); + + if ( (delta < -180.000) ) + delta = (delta + 360.000); + + angdelta = (delta - self.fixangle); + } else { + if ( (self.count == TRUE) ) { + armagon_launch_missile (40.000,TRUE); + return ; + } else { + delta = FALSE; + angdelta = (delta - self.fixangle); + } + } + armagon_turn (angdelta,delta); +}; + +void () armagon_overright_think = { + local float delta; + local float angdelta; + + ChangeYaw (); + walkmove (self.angles_y,14.000); + setorigin (self.trigger_field,self.origin); + self.trigger_field.angles = self.angles; + self.trigger_field.frame = self.frame; + self.trigger_field.angles_y = (self.trigger_field.angles_y + self.fixangle); + if ( (self.count == FALSE) ) { + enemy_yaw = vectoyaw ((self.enemy.origin - self.origin)); + self.ideal_yaw = enemy_yaw; + delta = ((self.ideal_yaw - self.angles_y) + 165.000); + if ( (delta > 180.000) ) + delta = (delta - 360.000); + + if ( (delta < -180.000) ) + delta = (delta + 360.000); + + angdelta = (delta - self.fixangle); + } else { + if ( (self.count == TRUE) ) { + armagon_launch_missile (-40.000,FL_SWIM); + return ; + } else { + delta = FALSE; + angdelta = (delta - self.fixangle); + } + } + armagon_turn (angdelta,delta); +}; + +void () armagon_stand_attack; + +void () armagon_stand1 = [ 64.000, armagon_stand2 ] { ai_stand (); armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand2 = [ 65.000, armagon_stand3 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand3 = [ 66.000, armagon_stand4 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand4 = [ 67.000, armagon_stand5 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand5 = [ 68.000, armagon_stand6 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand6 = [ 69.000, armagon_stand7 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand7 = [ 70.000, armagon_stand8 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand8 = [ 71.000, armagon_stand9 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand9 = [ 72.000, armagon_stand10 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand10 = [ 73.000, armagon_stand11 ] { ai_stand (); armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand11 = [ 74.000, armagon_stand12 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand12 = [ 75.000, armagon_stand13 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand13 = [ 76.000, armagon_stand14 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand14 = [ 77.000, armagon_stand15 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand15 = [ 78.000, armagon_stand16 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand16 = [ 79.000, armagon_stand17 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand17 = [ 80.000, armagon_stand18 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand18 = [ 81.000, armagon_stand19 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand19 = [ 82.000, armagon_stand20 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_stand20 = [ 83.000, armagon_stand1 ] { ai_stand (); armagon_think (); self.nextthink = (time + 0.200); }; + +void () armagon_walk1 = [ 0.000, armagon_walk2 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk2 = [ 1.000, armagon_walk3 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk3 = [ 2.000, armagon_walk4 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk4 = [ 3.000, armagon_walk5 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk5 = [ 4.000, armagon_walk6 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk6 = [ 5.000, armagon_walk7 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk7 = [ 6.000, armagon_walk8 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk8 = [ 7.000, armagon_walk9 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk9 = [ 8.000, armagon_walk10 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk10 = [ 9.000, armagon_walk11 ] { movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk11 = [ 10.000, armagon_walk12 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); movetogoal (14.000); armagon_walkthink (); }; +void () armagon_walk12 = [ 11.000, armagon_walk1 ] { movetogoal (14.000); armagon_walkthink (); }; + +void () armagon_run1 = [ 0.000, armagon_run2 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run2 = [ 1.000, armagon_run3 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run3 = [ 2.000, armagon_run4 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run4 = [ 3.000, armagon_run5 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run5 = [ 4.000, armagon_run6 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run6 = [ 5.000, armagon_run7 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run7 = [ 6.000, armagon_run8 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run8 = [ 7.000, armagon_run9 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run9 = [ 8.000, armagon_run10 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run10 = [ 9.000, armagon_run11 ] { ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run11 = [ 10.000, armagon_run12 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); ChangeYaw (); ai_run (14.000); armagon_think (); }; +void () armagon_run12 = [ 11.000, armagon_run1 ] { + local float delta; + + ChangeYaw (); + ai_run (14.000); + armagon_think (); + if ( ((self.cnt == TRUE) && (time > self.attack_finished)) ) { + delta = (self.ideal_yaw - self.angles_y); + if ( (delta > 180.000) ) + delta = (delta - 360.000); + + if ( (delta < -180.000) ) + delta = (delta + 360.000); + + if ( (delta > FALSE) ) { + self.think = armagon_overleft1; + } else { + self.think = armagon_overright1; + } + return ; + } + if ( (self.lefty == TRUE) ) { + self.lefty = FALSE; + self.think = self.th_missile; + } +}; + +void () armagon_watk1 = [ 12.000, armagon_watk2 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk2 = [ 13.000, armagon_watk3 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk3 = [ 14.000, armagon_watk4 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk4 = [ 15.000, armagon_watk5 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk5 = [ 16.000, armagon_watk6 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk6 = [ 17.000, armagon_watk7 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); armagon_launch_missile (40.000,FALSE); }; +void () armagon_watk7 = [ 18.000, armagon_watk8 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk8 = [ 19.000, armagon_watk9 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk9 = [ 20.000, armagon_watk10 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk10 = [ 21.000, armagon_watk11 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_watk11 = [ 22.000, armagon_watk13 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); armagon_launch_missile (-40.000,FALSE); }; + +void () armagon_watk13 = [ 23.000, armagon_run1 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); SUB_AttackFinished (TRUE); }; + +void () armagon_wlaseratk1 = [ 12.000, armagon_wlaseratk2 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk2 = [ 13.000, armagon_wlaseratk3 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk3 = [ 14.000, armagon_wlaseratk4 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk4 = [ 15.000, armagon_wlaseratk5 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk5 = [ 16.000, armagon_wlaseratk6 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk6 = [ 17.000, armagon_wlaseratk7 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); armagon_launch_laser (40.000); }; +void () armagon_wlaseratk7 = [ 18.000, armagon_wlaseratk8 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk8 = [ 19.000, armagon_wlaseratk9 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk9 = [ 20.000, armagon_wlaseratk10 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk10 = [ 21.000, armagon_wlaseratk11 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); }; +void () armagon_wlaseratk11 = [ 22.000, armagon_wlaseratk13 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); armagon_launch_laser (-40.000); }; +void () armagon_wlaseratk13 = [ 23.000, armagon_run1 ] { ChangeYaw (); walkmove (self.angles_y,14.000); armagon_think (); SUB_AttackFinished (TRUE); }; + +void () armagon_overleft1 = [ 25.000, armagon_overleft2 ] { self.count = FALSE; armagon_overleft_think (); }; +void () armagon_overleft2 = [ 26.000, armagon_overleft3 ] { armagon_overleft_think (); }; +void () armagon_overleft3 = [ 27.000, armagon_overleft4 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); armagon_overleft_think (); }; +void () armagon_overleft4 = [ 28.000, armagon_overleft5 ] { armagon_overleft_think (); }; +void () armagon_overleft5 = [ 29.000, armagon_overleft6 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); armagon_overleft_think (); }; +void () armagon_overleft6 = [ 30.000, armagon_overleft7 ] { armagon_overleft_think (); }; +void () armagon_overleft7 = [ 31.000, armagon_overleft8 ] { armagon_overleft_think (); }; +void () armagon_overleft8 = [ 32.000, armagon_overleft9 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); armagon_overleft_think (); }; +void () armagon_overleft9 = [ 33.000, armagon_overleft10 ] { armagon_overleft_think (); }; +void () armagon_overleft10 = [ 34.000, armagon_overleft11 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); armagon_overleft_think (); }; +void () armagon_overleft11 = [ 35.000, armagon_overleft12 ] { self.count = TRUE; armagon_overleft_think (); }; +void () armagon_overleft12 = [ 36.000, armagon_overleft13 ] { self.count = FL_SWIM; armagon_overleft_think (); }; +void () armagon_overleft13 = [ 37.000, armagon_overleft14 ] { armagon_overleft_think (); }; +void () armagon_overleft14 = [ 38.000, armagon_overleft15 ] { armagon_overleft_think (); }; +void () armagon_overleft15 = [ 39.000, armagon_run1 ] { armagon_overleft_think (); SUB_AttackFinished (TRUE); }; + +void () armagon_overright1 = [ 40.000, armagon_overright2 ] { self.count = FALSE; armagon_overright_think (); }; +void () armagon_overright2 = [ 41.000, armagon_overright3 ] { armagon_overright_think (); }; +void () armagon_overright3 = [ 42.000, armagon_overright4 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); armagon_overright_think (); }; +void () armagon_overright4 = [ 43.000, armagon_overright5 ] { armagon_overright_think (); }; +void () armagon_overright5 = [ 44.000, armagon_overright6 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); self.count = TRUE; armagon_overright_think (); }; +void () armagon_overright6 = [ 45.000, armagon_overright7 ] { self.count = FL_SWIM; armagon_overright_think (); }; +void () armagon_overright7 = [ 46.000, armagon_overright8 ] { armagon_overright_think (); }; +void () armagon_overright8 = [ 47.000, armagon_overright9 ] { sound (self,MOVETYPE_PUSH,"armagon/servo.wav",SERVO_VOLUME,ATTN_ARMAGON); armagon_overright_think (); }; +void () armagon_overright9 = [ 48.000, armagon_overright10 ] { armagon_overright_think (); }; +void () armagon_overright10 = [ 49.000, armagon_overright11 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); armagon_overright_think (); }; +void () armagon_overright11 = [ 50.000, armagon_overright12 ] { armagon_overright_think (); }; +void () armagon_overright12 = [ 51.000, armagon_run1 ] { armagon_overright_think (); SUB_AttackFinished (TRUE); }; + +void () armagon_plant1 = [ 64.000, armagon_plant1 ] { armagon_stand_attack (); armagon_think (); }; + +void () armagon_stop1 = [ 84.000, armagon_stop2 ] { armagon_think (); }; +void () armagon_stop2 = [ 85.000, armagon_plant1 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); armagon_think (); }; + +void () armagon_satk1 = [ 52.000, armagon_satk2 ] { armagon_think (); }; +void () armagon_satk2 = [ 53.000, armagon_satk3 ] { armagon_think (); }; +void () armagon_satk3 = [ 54.000, armagon_satk4 ] { armagon_think (); }; +void () armagon_satk4 = [ 55.000, armagon_satk5 ] { armagon_think (); }; +void () armagon_satk5 = [ 56.000, armagon_satk6 ] { armagon_think (); }; +void () armagon_satk6 = [ 57.000, armagon_satk7 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); armagon_think (); }; +void () armagon_satk7 = [ 58.000, armagon_satk8 ] { armagon_think (); }; +void () armagon_satk8 = [ 59.000, armagon_satk9 ] { armagon_think (); }; +void () armagon_satk9 = [ 60.000, armagon_satk10 ] { armagon_think (); armagon_launch_missile (40.000,FALSE); armagon_launch_missile (-40.000,FALSE); }; +void () armagon_satk10 = [ 61.000, armagon_satk11 ] { armagon_think (); }; +void () armagon_satk11 = [ 60.000, armagon_satk12 ] { armagon_think (); armagon_launch_missile (40.000,FALSE); armagon_launch_missile (-40.000,FALSE); }; +void () armagon_satk12 = [ 61.000, armagon_satk13 ] { armagon_think (); }; +void () armagon_satk13 = [ 60.000, armagon_satk14 ] { armagon_think (); armagon_launch_missile (40.000,FALSE); armagon_launch_missile (-40.000,FALSE); }; +void () armagon_satk14 = [ 61.000, armagon_satk15 ] { armagon_think (); }; +void () armagon_satk15 = [ 62.000, armagon_satk16 ] { armagon_think (); }; +void () armagon_satk16 = [ 63.000, armagon_plant1 ] { armagon_think (); SUB_AttackFinished (0.300); }; + +void () armagon_slaser1 = [ 52.000, armagon_slaser2 ] { armagon_think (); }; +void () armagon_slaser2 = [ 53.000, armagon_slaser3 ] { armagon_think (); }; +void () armagon_slaser3 = [ 54.000, armagon_slaser4 ] { armagon_think (); }; +void () armagon_slaser4 = [ 55.000, armagon_slaser5 ] { armagon_think (); }; +void () armagon_slaser5 = [ 56.000, armagon_slaser6 ] { armagon_think (); }; +void () armagon_slaser6 = [ 57.000, armagon_slaser7 ] { sound (self,MOVETYPE_TOSS,"armagon/footfall.wav",TRUE,ATTN_ARMAGON); armagon_think (); }; +void () armagon_slaser7 = [ 58.000, armagon_slaser8 ] { armagon_think (); }; +void () armagon_slaser8 = [ 59.000, armagon_slaser9 ] { armagon_think (); }; +void () armagon_slaser9 = [ 60.000, armagon_slaser10 ] { armagon_think (); armagon_launch_laser (40.000); armagon_launch_laser (-40.000); }; +void () armagon_slaser10 = [ 61.000, armagon_slaser11 ] { armagon_think (); }; +void () armagon_slaser11 = [ 60.000, armagon_slaser12 ] { armagon_think (); armagon_launch_laser (40.000); armagon_launch_laser (-40.000); }; +void () armagon_slaser12 = [ 61.000, armagon_slaser13 ] { armagon_think (); }; +void () armagon_slaser13 = [ 60.000, armagon_slaser14 ] { armagon_think (); armagon_launch_laser (40.000); armagon_launch_laser (-40.000); }; +void () armagon_slaser14 = [ 61.000, armagon_slaser15 ] { armagon_think (); }; +void () armagon_slaser15 = [ 60.000, armagon_slaser16 ] { armagon_think (); armagon_launch_laser (40.000); armagon_launch_laser (-40.000); }; +void () armagon_slaser16 = [ 61.000, armagon_slaser17 ] { armagon_think (); }; +void () armagon_slaser17 = [ 60.000, armagon_slaser18 ] { armagon_think (); armagon_launch_laser (40.000); armagon_launch_laser (-40.000); }; +void () armagon_slaser18 = [ 61.000, armagon_slaser19 ] { armagon_think (); }; +void () armagon_slaser19 = [ 62.000, armagon_slaser20 ] { armagon_think (); }; +void () armagon_slaser20 = [ 63.000, armagon_plant1 ] { armagon_think (); SUB_AttackFinished (0.300); }; + +void () armagon_body_explode1; + +void () armagon_die1 = [ 84.000, armagon_die2 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die2 = [ 85.000, armagon_die3 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die3 = [ 86.000, armagon_die4 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die4 = [ 87.000, armagon_die5 ] { armagon_think (); multi_explosion ((self.origin + '0.000 0.000 48.000'),48.000,10,6,0.300,0.300); sound (self,CHAN_AUTO,"armagon/death.wav",TRUE,ATTN_NONE); self.nextthink = (time + 0.200); }; +void () armagon_die5 = [ 88.000, armagon_die6 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die6 = [ 89.000, armagon_die7 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die7 = [ 90.000, armagon_die8 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die8 = [ 91.000, armagon_die9 ] { armagon_think (); self.nextthink = (time + FL_SWIM); }; +void () armagon_die9 = [ 92.000, armagon_die10 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die10 = [ 93.000, armagon_die11 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die11 = [ 94.000, armagon_die12 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die12 = [ 95.000, armagon_die13 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die13 = [ 96.000, armagon_die14 ] { armagon_think (); self.nextthink = (time + 0.200); }; +void () armagon_die14 = [ 97.000, armagon_die14 ] { + local entity body; + + armagon_think (); + multi_explosion ((self.origin + '0.000 0.000 80.000'),20.000,MOVETYPE_BOUNCE,MOVETYPE_WALK,0.100,0.500); + self.nextthink = CONTENT_EMPTY; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + setsize (self,VEC_HULL2_MIN,'32.000 32.000 32.000'); + self.flags = FALSE; + self.gorging = TRUE; + self.wait = (time + MOVETYPE_FLY); + body = self.trigger_field; + body.nextthink = CONTENT_EMPTY; + self.movetype = MOVETYPE_NONE; + body.takedamage = DAMAGE_NO; + body.solid = SOLID_NOT; + body.think = armagon_body_explode1; + body.nextthink = (time + 0.100); + body.gorging = TRUE; +}; + +void () armagon_body_explode2 = { + sound (self,CHAN_AUTO,"drake/misc/longexpl.wav",TRUE,ATTN_ARMAGON); + self.think = armagon_body_explode2; + self.movetype = MOVETYPE_NONE; + setmodel (self,"progs/drake/s_explod.spr"); + self.solid = SOLID_NOT; + self.nextthink = (time + 0.100); + s_explode1 (); +}; + +void () armagon_body_explode1 = { + self.think = armagon_body_explode1; + self.nextthink = (time + 0.100); + if ( (self.cnt == FALSE) ) + self.count = FALSE; + + if ( (self.cnt < 25.000) ) { + if ( (self.cnt > self.count) ) { + ThrowGib (1,1); + self.count = (self.cnt + TRUE); + } + self.cnt = (self.cnt + TRUE); + } else { + self.cnt = FALSE; + self.think = armagon_body_explode2; + } +}; + +void (entity inflictor, entity attacker, float damage) armagon_pain = { + if ( (self.health <= FALSE) ) return ; + if ( (damage < 25.000) ) return ; + if ( (self.pain_finished > time) ) return ; + + self.pain_finished = (time + FL_SWIM); + sound (self,CHAN_VOICE,"armagon/pain.wav",TRUE,ATTN_NORM); +}; + +void () armagon_missile_attack = { + if ( (random () < 0.500) ) armagon_watk1 (); + else armagon_wlaseratk1 (); +}; + +void () armagon_repulse_attack = { + local entity head; + local vector dir; + + armagon_think (); + if ( (self.state == FALSE) ) { + SUB_AttackFinished (0.500); + sound (self,CHAN_BODY,"armagon/repel.wav",TRUE,ATTN_NORM); + self.state = TRUE; + return ; + } else { + if ( (self.state == TRUE) ) { + head = findradius (self.origin,300.000); + while ( head ) { + if ( (!(head.flags & FL_NOTARGET) && (head.flags & FL_CLIENT)) ) { + visible (head); + if ( (visible (head) && (head.health > FALSE)) ) { + dir = (head.origin - (self.origin - '0.000 0.000 24.000')); + dir = normalize (dir); + head.velocity = (head.velocity + (dir * 1500)); + } + } + head = head.chain; + } + T_RadiusDamage (self,self,60.000,self,DAMAGEALL); + self.state = FALSE; + SUB_AttackFinished (0.100); + } + } +}; + +void () armagon_stand_attack = { + local vector spot1; + local vector spot2; + + spot1 = (self.origin + self.view_ofs); + spot2 = (self.enemy.origin + self.enemy.view_ofs); + traceline (spot1,spot2,FALSE,self); + if ( (trace_ent != self.enemy) ) { armagon_run1 (); return; } + if ( (trace_inopen && trace_inwater) ) { armagon_run1 (); return; } + if ( (time < self.attack_finished) ) return ; + if ( ((vlen ((spot2 - spot1)) < 200) && (self.enemy.classname == "player")) ) { armagon_repulse_attack (); return; } + self.state = FALSE; + if ( (vlen ((spot2 - spot1)) > 450.000) ) { armagon_run1 (); return; } + if ( (random () < 0.500) ) + armagon_satk1 (); + else + armagon_slaser1 (); + if ( (self.cnt == TRUE) ) { armagon_run1 (); return; } +}; +float () ArmagonCheckAttack = { + local vector spot1; + local vector spot2; + local entity targ; + local float ang; + local float delta; + local float dist; + + self.lefty = FALSE; + targ = self.enemy; + spot1 = (self.origin + self.view_ofs); + spot2 = (targ.origin + targ.view_ofs); + traceline (spot1,spot2,FALSE,self); + if ( ((trace_ent != targ) && !self.charmed) ) return (FALSE); + if ( (trace_inopen && trace_inwater) ) return (FALSE); + if ( (time < self.attack_finished) ) return (FALSE); + + ang = (self.angles_y + self.fixangle); + delta = (self.ideal_yaw - ang); + dist = vlen ((spot2 - spot1)); + if ( (((fabs (delta) > MOVETYPE_BOUNCE) && (dist > 200)) || (self.enemy.classname != "player")) ) return ( FALSE ); + if ( (dist < 400.000) ) { self.th_melee (); return ( TRUE ); } + self.lefty = TRUE; + return ( FALSE ); +}; + +void () monster_armagon = { + local entity body; + + if ( deathmatch ) { + remove (self); + return ; + } + self.lefty = FALSE; + precache_model ("progs/hipnotic/armabody.mdl"); + precache_model ("progs/hipnotic/armalegs.mdl"); + precache_model ("progs/missile.mdl"); + precache_sound ("armagon/footfall.wav"); + precache_sound ("armagon/servo.wav"); + precache_sound ("armagon/death.wav"); + precache_sound ("armagon/pain.wav"); + precache_sound ("armagon/repel.wav"); + precache_sound ("armagon/sight.wav"); + precache_sound ("armagon/idle1.wav"); + precache_sound ("armagon/idle2.wav"); + precache_sound ("armagon/idle3.wav"); + precache_sound ("armagon/idle4.wav"); + precache_sound ("enforcer/enfstop.wav"); + precache_sound ("hipweap/laserg.wav"); + precache_sound ("hipweap/laserric.wav"); + precache_sound ("drake/misc/longexpl.wav"); + precache_sound ("drake/misc/shortexp.wav"); + body = spawn (); + body.origin = self.origin; + body.origin = (body.origin - '0.000 0.000 64.000'); + self.solid = SOLID_SLIDEBOX; + self.fixangle = FALSE; + self.movetype = MOVETYPE_STEP; + body.solid = SOLID_NOT; + body.movetype = MOVETYPE_STEP; + self.trigger_field = body; + body.trigger_field = self; + setmodel (body,"progs/hipnotic/armabody.mdl"); + self.mdl = "progs/hipnotic/armalegs.mdl"; + setmodel (self,self.mdl); + setsize (self,'-48.000 -48.000 -24.000','48.000 48.000 84.000'); + self.bboxtype = BBOX_ARMAGON; + setorigin (self,self.origin); + setorigin (body,body.origin); + self.yaw_speed = 9; + self.health = 3000.000; + self.worldtype = 0.850; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 0.5; + + self.gibhealth = -1000000; + self.gibbed = FALSE; + self.state = FALSE; + self.super_time = FALSE; + self.endtime = FALSE; + self.th_stand = armagon_stand1; + self.th_walk = armagon_walk1; + self.th_run = armagon_run1; + self.th_die = armagon_die1; + self.th_missile = armagon_missile_attack; + self.th_melee = armagon_stop1; + self.th_pain = armagon_pain; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was outgunned by Armagon\n"; + + monster_start (); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_axegrunt.qc b/QC_other/QC_keep/mon_axegrunt.qc new file mode 100644 index 00000000..5b16e0b8 --- /dev/null +++ b/QC_other/QC_keep/mon_axegrunt.qc @@ -0,0 +1,284 @@ +/* +============================================================================== + +AXE GRUNT +Suitable replacement for knight in base maps. Grunts a lot. + +============================================================================== +*/ + +$cd id1/models/player_4 +$origin 0 -6 24 +$base base +$skin skin + +// +// running +// +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 + +// +// standing +// +$frame stand1 stand2 stand3 stand4 stand5 +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 + + +// +// pain +// +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 +$frame pain1 pain2 pain3 pain4 pain5 pain6 + + +// +// death +// + +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 +$frame axdeth7 axdeth8 axdeth9 +$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 +$frame deatha9 deatha10 deatha11 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 +$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 +$frame deathd8 deathd9 +$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 +$frame deathe8 deathe9 + +// +// attacks +// +$frame nailatt1 nailatt2 +$frame light1 light2 +$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 +$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + + +void() axeg_stand1 =[ $axstnd1, axeg_stand2 ] {ai_stand();}; +void() axeg_stand2 =[ $axstnd2, axeg_stand3 ] {ai_stand();}; +void() axeg_stand3 =[ $axstnd3, axeg_stand4 ] {ai_stand();}; +void() axeg_stand4 =[ $axstnd4, axeg_stand5 ] {ai_stand();}; +void() axeg_stand5 =[ $axstnd5, axeg_stand6 ] {ai_stand();}; +void() axeg_stand6 =[ $axstnd6, axeg_stand7 ] {ai_stand();}; +void() axeg_stand7 =[ $axstnd7, axeg_stand8 ] {ai_stand();}; +void() axeg_stand8 =[ $axstnd8, axeg_stand9 ] {ai_stand();}; +void() axeg_stand9 =[ $axstnd9, axeg_stand10 ] {ai_stand();}; +void() axeg_stand10 =[ $axstnd10, axeg_stand11 ] {ai_stand();}; +void() axeg_stand11 =[ $axstnd11, axeg_stand12 ] {ai_stand();}; +void() axeg_stand12 =[ $axstnd12, axeg_stand1 ] {ai_stand();}; + +void() axeg_run1 =[ $axrun1, axeg_run2 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); +ai_run(25);}; +void() axeg_run2 =[ $axrun2, axeg_run3 ] {ai_run(18); monster_footstep(FALSE);}; +void() axeg_run3 =[ $axrun3, axeg_run4 ] {ai_run(12);}; +void() axeg_run4 =[ $axrun4, axeg_run5 ] {ai_run(25);}; +void() axeg_run5 =[ $axrun5, axeg_run6 ] {ai_run(18);monster_footstep(FALSE);}; +void() axeg_run6 =[ $axrun6, axeg_run1 ] {ai_run(12);}; + +//=========================================================================== + +void( vector dir ) axeg_chop = +{ + local vector delta, toss; + local float ldmg; + + if (!self.enemy) + return; // removed before stroke + + ai_charge_side(); + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 60) + return; + if (!CanDamage (self.enemy, self)) + return; + ldmg = (random() + random() + random()) * 2; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + toss = v_forward * dir_x + v_right * dir_y + v_up * dir_z; + self.enemy.velocity = self.enemy.velocity + toss; +} + + +void() axe_runatka1 =[ $axatt1, axe_runatka2 ] { +if (random() > 0.5) + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +else + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +ai_charge(30); +}; +void() axe_runatka2 =[ $axatt2, axe_runatka3 ] {ai_charge(20);}; +void() axe_runatka3 =[ $axatt3, axe_runatka4 ] {ai_charge(10); axeg_chop('0 0 0');}; +void() axe_runatka4 =[ $axatt4, axe_runatka5 ] {axeg_chop('50 -20 10');}; +void() axe_runatka5 =[ $axatt5, axe_runatka6 ] {axeg_chop('100 -40 10');}; +void() axe_runatka6 =[ $axatt6, axeg_run1 ] {ai_charge_side();}; + +void() axe_runatkb1 =[ $axattb1, axe_runatkb2 ] { +if (random() > 0.5) + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +else + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +ai_charge(30); +}; +void() axe_runatkb2 =[ $axattb2, axe_runatkb3 ] {ai_charge(20);}; +void() axe_runatkb3 =[ $axattb3, axe_runatkb4 ] {ai_charge(10); axeg_chop('0 0 0');}; +void() axe_runatkb4 =[ $axattb4, axe_runatkb5 ] {axeg_chop('40 75 10');}; +void() axe_runatkb5 =[ $axattb5, axe_runatkb6 ] {axeg_chop('80 150 20');}; +void() axe_runatkb6 =[ $axattb6, axeg_run1 ] {ai_charge_side();}; + +void() axe_runatkc1 =[ $axattc1, axe_runatkc2 ] { +if (random() > 0.5) + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +else + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +ai_charge(30); +}; +void() axe_runatkc2 =[ $axattc2, axe_runatkc3 ] {ai_charge(20);}; +void() axe_runatkc3 =[ $axattc3, axe_runatkc4 ] {ai_charge(10); axeg_chop('0 0 0');}; +void() axe_runatkc4 =[ $axattc4, axe_runatkc5 ] {axeg_chop('60 0 10');}; +void() axe_runatkc5 =[ $axattc5, axe_runatkc6 ] {axeg_chop('120 0 20');}; +void() axe_runatkc6 =[ $axattc6, axeg_run1 ] {ai_charge_side();}; + +void() axe_runatkd1 =[ $axattd1, axe_runatkd2 ] { +if (random() > 0.5) + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +else + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +ai_charge(30); +}; +void() axe_runatkd2 =[ $axattd2, axe_runatkd3 ] {ai_charge(20);}; +void() axe_runatkd3 =[ $axattd3, axe_runatkd4 ] {ai_charge(10); axeg_chop('0 0 0');}; +void() axe_runatkd4 =[ $axattd4, axe_runatkd5 ] {axeg_chop('30 -75 100');}; +void() axe_runatkd5 =[ $axattd5, axe_runatkd6 ] {axeg_chop('60 -150 200');}; +void() axe_runatkd6 =[ $axattd6, axeg_run1 ] {ai_charge_side();}; + +void() axeg_atk = +{ + local float r; + if (self.pain_finished > time) + return; + r = random(); + + if (r < 0.25) + axe_runatka1(); + else if (r < 0.5) + axe_runatkb1(); + else if (r < 0.75) + axe_runatkc1(); + else + axe_runatkd1(); +}; + + +//=========================================================================== + + +void() axeg_pain1 =[ $axpain1, axeg_pain2 ] {ai_painforward(0);}; +void() axeg_pain2 =[ $axpain2, axeg_pain3 ] {ai_painforward(-1);}; +void() axeg_pain3 =[ $axpain3, axeg_pain4 ] {ai_painforward(-2);}; +void() axeg_pain4 =[ $axpain4, axeg_pain5 ] {}; +void() axeg_pain5 =[ $axpain5, axeg_pain6 ] {}; +void() axeg_pain6 =[ $axpain6, axeg_run1 ] {}; + +void(entity inflictor, entity attacker, float damage) axeg_pain = { + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + if (self.pain_check > 0) { + self.pain_finished = time + 0.75; + self.axhitme = 0; + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + axeg_pain1(); + } +}; + +//=========================================================================== + + + +void() axeg_die1 =[ $axdeth1, axeg_die2 ] {}; +void() axeg_die2 =[ $axdeth2, axeg_die3 ] {monster_check_gib();}; +void() axeg_die3 =[ $axdeth3, axeg_die4 ] {monster_check_gib(); self.solid = SOLID_NOT;}; +void() axeg_die4 =[ $axdeth4, axeg_die5 ] {}; +void() axeg_die5 =[ $axdeth5, axeg_die6 ] {}; +void() axeg_die6 =[ $axdeth6, axeg_die7 ] {}; +void() axeg_die7 =[ $axdeth7, axeg_die8 ] {}; +void() axeg_die8 =[ $axdeth8, axeg_die9 ] {monster_death_postcheck();}; +void() axeg_die9 =[ $axdeth9, axeg_die9 ] {monster_deadbody_check();}; + +void() axeg_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + axeg_die1(); // Backward/side + } +}; + +/*QUAKED monster_axegrunt (1 0 0) (-16 -16 -24) (16 16 40) Ambush +*/ +void() monster_axegrunt = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/axegrunt.mdl"; + self.headmdl = "progs/h_guard.mdl"; + self.gib1mdl = "progs/gib1.mdl"; + self.gib2mdl = "progs/gib2.mdl"; + self.gib3mdl = "progs/gib3.mdl"; + precache_model ("progs/axegrunt.mdl"); + precache_model ("progs/h_guard.mdl"); + + precache_sound ("knight/kdeath.wav"); + precache_sound ("knight/khurt.wav"); + precache_sound ("knight/ksight.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + precache_sound ("knight/idle.wav"); + precache_sound ("player/udeath.wav"); // gib death + self.gib1sound = GIB_IMPACT_WOOD; + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.pain_sound = "knight/khurt.wav"; + self.sight_sound = "knight/ksight.wav"; + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 75; + self.gibhealth = -35; // Easy to gib + self.gibbed = FALSE; // Still together + self.pain_flinch = 20; // Easy to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEMEDIUM; // Average feet + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = axeg_stand1; +// self.th_walk = axe_walk1; + self.th_run = axeg_run1; + self.th_melee = axeg_atk; + self.th_pain = axeg_pain; + self.th_die = axeg_die; + + self.classtype = CT_MONARMYAXE; + self.classgroup = CG_ARMY; + self.classmove = MON_MOVEWALK; + + if (self.deathstring == "") self.deathstring = " was axed by an Axe Grunt\n"; + + monster_start (); +}; diff --git a/QC_other/QC_keep/mon_axeman.qc b/QC_other/QC_keep/mon_axeman.qc new file mode 100644 index 00000000..e1a760ea --- /dev/null +++ b/QC_other/QC_keep/mon_axeman.qc @@ -0,0 +1,190 @@ +$cd /coe/progs/axeman +$origin 0 -6 24 +$base base +$skin skin + +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 +$frame axstand1 axstand2 axstand3 axstand4 axstand5 axstand6 +$frame axstand7 axstand8 axstand9 axstand10 axstand11 axstand12 +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 axdeth7 axdeth8 axdeth9 +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + +float axeman_type; + +void() axe_stand1 =[$axstand1,axe_stand2] {ai_stand(); }; +void() axe_stand2 =[$axstand2,axe_stand3] {ai_stand(); }; +void() axe_stand3 =[$axstand3,axe_stand4] {ai_stand(); }; +void() axe_stand4 =[$axstand4,axe_stand5] {ai_stand(); }; +void() axe_stand5 =[$axstand5,axe_stand6] {ai_stand(); }; +void() axe_stand6 =[$axstand6,axe_stand7] {ai_stand(); }; +void() axe_stand7 =[$axstand7,axe_stand8] {ai_stand(); }; +void() axe_stand8 =[$axstand8,axe_stand9] {ai_stand(); }; +void() axe_stand9 =[$axstand9,axe_stand10] {ai_stand(); }; +void() axe_stand10 =[$axstand10,axe_stand11] {ai_stand(); }; +void() axe_stand11 =[$axstand11,axe_stand12] {ai_stand(); }; +void() axe_stand12 =[$axstand12,axe_stand1] {ai_stand(); }; + +void() axe_walk1 =[$axrun1,axe_walk2] { if (random() < 0.2) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_IDLE); ai_walk(10); }; +void() axe_walk2 =[$axrun2,axe_walk3] {ai_walk(10); }; +void() axe_walk3 =[$axrun3,axe_walk4] {ai_walk(15); }; +void() axe_walk4 =[$axrun4,axe_walk5] {ai_walk(10); }; +void() axe_walk5 =[$axrun5,axe_walk6] {ai_walk(10); }; +void() axe_walk6 =[$axrun6,axe_walk1] {ai_walk(15); }; + + +void() axe_run1 =[$axrun1,axe_run2] { if (random() < 0.2) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_IDLE); ai_run(24); }; +void() axe_run2 =[$axrun2,axe_run3] {ai_run(45); }; +void() axe_run3 =[$axrun3,axe_run4] {ai_run(31); }; +void() axe_run4 =[$axrun4,axe_run5] {ai_run(20); }; +void() axe_run5 =[$axrun5,axe_run6] {ai_run(36); }; +void() axe_run6 =[$axrun6,axe_run1] {ai_run(45); }; + +void() axe_atk1 =[$axatt1,axe_atk2] { sound (self, CHAN_WEAPON, "axeman/axe1.wav", 1, ATTN_NORM); ai_charge(0); }; +void() axe_atk2 =[$axatt2,axe_atk3] {ai_charge(28); ai_melee(); }; +void() axe_atk3 =[$axatt3,axe_atk4] {ai_charge(16); ai_melee(); }; +void() axe_atk4 =[$axatt4,axe_atk5] {ai_charge(0); ai_melee(); }; +void() axe_atk5 =[$axatt5,axe_atk6] {ai_charge(6); }; +void() axe_atk6 =[$axatt6,axe_run1] {ai_charge(8); }; + +void() axe_atkb1 =[$axattb1,axe_atk2] { sound (self, CHAN_WEAPON, "axeman/axe1.wav", 1, ATTN_NORM); ai_charge(0); }; +void() axe_atkb2 =[$axattb2,axe_atk3] {ai_charge(28); ai_melee(); }; +void() axe_atkb3 =[$axattb3,axe_atk4] {ai_charge(16); ai_melee(); }; +void() axe_atkb4 =[$axattb4,axe_atkb5] {ai_charge(0); }; +void() axe_atkb5 =[$axattb5,axe_atkb6] {ai_charge(6); }; +void() axe_atkb6 =[$axattb6,axe_run1] {ai_charge(8); }; + +void() axe_atkc1 =[$axatt1,axe_atkc2] { sound (self, CHAN_WEAPON, "axeman/axe1.wav", 1, ATTN_NORM); ai_charge(0); }; +void() axe_atkc2 =[$axattc2,axe_atkc3] {ai_charge(28); }; +void() axe_atkc3 =[$axattc3,axe_atkc4] {ai_charge(16); ai_melee(); }; +void() axe_atkc4 =[$axattc4,axe_atkc5] {ai_charge(0); ai_melee(); }; +void() axe_atkc5 =[$axattc5,axe_atkc6] {ai_charge(6); }; +void() axe_atkc6 =[$axattc6,axe_run1] {ai_charge(8); }; + +void() axe_atkd1 =[$axattd1,axe_atkd2] { sound (self, CHAN_WEAPON, "axeman/axe1.wav", 1, ATTN_NORM); ai_charge(0); }; +void() axe_atkd2 =[$axattd2,axe_atkd3] {ai_charge(28); ai_melee(); }; +void() axe_atkd3 =[$axattd3,axe_atkd4] {ai_charge(16); ai_melee(); }; +void() axe_atkd4 =[$axattd4,axe_atkd5] {ai_charge(0); }; +void() axe_atkd5 =[$axattd5,axe_atkd6] {ai_charge(6); }; +void() axe_atkd6 =[$axattd6,axe_run1] {ai_charge(8); }; + +void() axe_atk = { + axeman_type = axeman_type + 1; + + if (axeman_type == 1) + axe_atkb1(); + else if (axeman_type == 2) + axe_atkd1(); + else if (axeman_type == 3) { + if (random() < 0.5) + axe_atkc1(); + else + axe_atk1(); + axeman_type = 0; + } +}; + +void() axe_pain1 =[$axpain1,axe_pain2] {ai_painforward(0); }; +void() axe_pain2 =[$axpain2,axe_pain3] {ai_painforward(6); }; +void() axe_pain3 =[$axpain3,axe_pain4] {ai_painforward(8); }; +void() axe_pain4 =[$axpain4,axe_pain5] {ai_painforward(4); }; +void() axe_pain5 =[$axpain5,axe_pain6] {ai_painforward(2); }; +void() axe_pain6 =[$axpain6,axe_run1] {}; + +void(entity inflictor, entity attacker, float damage) axe_pain = { + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + axe_pain1 (); + self.pain_finished = time + 1; +}; + +void() axe_die1 =[$axdeth1,axe_die2] {monster_check_gib(); }; +void() axe_die2 =[$axdeth2,axe_die3] {monster_check_gib(); }; +void() axe_die3 =[$axdeth3,axe_die4] {self.solid = SOLID_NOT; }; +void() axe_die4 =[$axdeth4,axe_die5] {}; +void() axe_die5 =[$axdeth5,axe_die6] {}; +void() axe_die6 =[$axdeth6,axe_die7] {}; +void() axe_die7 =[$axdeth7,axe_die8] {}; +void() axe_die8 =[$axdeth8,axe_die9] {monster_death_postcheck(); }; +void() axe_die9 =[$axdeth9,axe_die9] {}; + +void() axe_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + axe_die1 (); + } +}; + +// monster_axeman (1 0 0) (-16 -16 -24) (16 16 40) Ambush, Ferocious axe-wielding maniac :) + +void() monster_ax = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_axeman.mdl"; + self.headmdl = "progs/h_knight.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + precache_sound ("axeman/adeath1.wav"); + precache_sound ("axeman/axe1.wav"); + precache_sound ("axeman/axe2.wav"); + + self.gib1sound = GIB_IMPACT_METALA; + self.idle_sound = "dguard/idle.wav"; + precache_sound ("dguard/idle.wav"); + + self.pain_sound = "dguard/pain1.wav"; + precache_sound ("dguard/pain1.wav"); + + self.sight_sound = "dknight/dfury_grunt4.wav"; + precache_sound ("dknight/dfury_grunt4.wav"); + + self.death_sound = "dguard/death2.wav"; + precache_sound (self.death_sound); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 300; + self.gibhealth = -35; + self.gibbed = FALSE; + self.pain_flinch = 40; + self.pain_timeout = 1.5; // Higher than a knight + self.weapon = IT_AXE; + self.steptype = FS_TYPEHEAVY; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = axe_stand1; + self.th_walk = axe_walk1; + self.th_run = axe_run1; + self.th_melee = axe_atk; + self.th_pain = axe_pain; + self.th_die = axe_die; + + self.classtype = CT_MONDKNIGHT; + self.classgroup = CG_DKNIGHT; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") { + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was felled by an Axeman\n"; + } else { + if (self.deathstring == "") self.deathstring = " was scalped by an Axe Knight\n"; + if (self.skin) {if (self.deathstring == "") self.deathstring = " was bushwhacked by a Forest Thug\n"; } + } + } + + monster_start (); +}; + +void() monster_axeman = { monster_ax(); }; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_bandit.qc b/QC_other/QC_keep/mon_bandit.qc new file mode 100644 index 00000000..60b85349 --- /dev/null +++ b/QC_other/QC_keep/mon_bandit.qc @@ -0,0 +1,1182 @@ +/* +============================================================================== + +SOLDIER / PLAYER + +============================================================================== +*/ + +$cd id1/models/soldier3 +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 + +$frame load1 load2 load3 load4 load5 load6 load7 load8 load9 load10 load11 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 shoot9 + +$frame prowl_1 prowl_2 prowl_3 prowl_4 prowl_5 prowl_6 prowl_7 prowl_8 +$frame prowl_9 prowl_10 prowl_11 prowl_12 prowl_13 prowl_14 prowl_15 prowl_16 +$frame prowl_17 prowl_18 prowl_19 prowl_20 prowl_21 prowl_22 prowl_23 prowl_24 + +// Extended scenes - - - - - - - - - - - +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame decapb1 decapb2 decapb3 decapb4 decapb5 decapb6 decapb7 decapb8 +$frame decapb9 decapb10 decapb11 + +$frame runb1 runb2 runb3 runb4 runb5 runb6 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 + +$frame standb1 standb2 standb3 standb4 standb5 standb6 +//- - - - - - - - - - - - - - - - - - - + +/* +============================================================================== +SOLDIER CODE +============================================================================== +*/ + +// Update 6/7/2011: Skins. +//float SKIN_ARMY_GRUNT = 0; +float SKIN_ARMY_ROCKET = 1; +float SKIN_ARMY_ELITE = 2; +float SKIN_ARMY_ELITE_RED = 3; +float SKIN_ARMY_CYBORG = 4; + +//=========== +// SoldierCheckAttack +// +// The player is in view, so decide to move or launch an attack +// Returns FALSE if movement should continue +//============ +float() SoldierCheckAttack = +{ + local vector spot1, spot2; + local entity targ; + local float chance; + +// PM: Check these first to avoid unnecessary traceline calls. + if (time < self.attack_finished) + return FALSE; + if (enemy_range == RANGE_FAR) + return FALSE; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + // PM: Changed 3rd parm from FALSE to variable due to possible + // fat flymissile arrows. + traceline (spot1, spot2, self.height, self); + + if (self.ryuflags & RYU_REBEL) + { // Special AI for rebel archers in nsoe2. + if (trace_fraction < 1) + { // don't have a clear shot + if (DontHurtMe (trace_ent)) + return FALSE; // Don't shoot whoever is in line of fire. + + // Otherwise, whoever is in the way is a potential enemy. + } + else + { // Target is non-solid. It could be a wraith, downed zombie, + // or something in spectator mode. + // Unlike dragons, attack only if the target really is a ghost. + if (targ.takedamage != DAMAGE_AIM) + return FALSE; + if (!IsGhost (targ)) + return FALSE; + } + // Alert is assumed to be on for rebels. + + // missile attack + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else + chance = 0.4; // Rebels are good marksmen, and must fire often. + } + else + { // Standard grunt AI. + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + // PM: Grunts are stupid, so never shoot if something is in the way. + if (trace_ent != targ) + return FALSE; // don't have a clear shot + + // missile attack + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else if (enemy_range == RANGE_NEAR) + chance = 0.4; + else if (enemy_range == RANGE_MID) + chance = 0.05; + else if (enemy_range == RANGE_LONG) // PM: NEW! + chance = 0.01; + else + chance = 0; + } + + if (random () < chance) + { + if (self.ryuflags & RYU_REBEL) + chance = 2 * random(); + else if ((self.classname == "monster_soldier") || (self.classname == "monster_army_rocket")) + chance = 2 * random(); + else + chance = 1 + random(); + self.th_missile (); + SUB_AttackFinished (chance); + if (random() < 0.3) + self.lefty = !self.lefty; + + return TRUE; + } + + return FALSE; +}; + + +//============================================================================= + +void() army_idle_sound = +{ + if (random() < 0.2) + { + if (self.classname == "monster_goblin") + { + if (random() < 0.7) + sound (self, CHAN_VOICE, "goblin/idle1.wav", 1, ATTN_IDLE); + else + sound (self, CHAN_VOICE, "goblin/idle2.wav", 1, ATTN_IDLE); + } + else if (self.classname == "monster_bandit") + { + if (!(self.ryuflags & RYU_REBEL)) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); + } + else + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); + } +}; + +// STAND - - - - - - - - - - - - - - - - +void() army_stand1 =[ $stand1, army_stand2 ] {ai_stand();}; +void() army_stand2 =[ $stand2, army_stand3 ] {ai_stand();}; +void() army_stand3 =[ $stand3, army_stand4 ] {ai_stand();}; +void() army_stand4 =[ $stand4, army_stand5 ] {ai_stand();}; +void() army_stand5 =[ $stand5, army_stand6 ] {ai_stand();}; +void() army_stand6 =[ $stand6, army_stand7 ] {ai_stand();}; +void() army_stand7 =[ $stand7, army_stand8 ] {ai_stand();}; +void() army_stand8 =[ $stand8, army_stand1 ] {ai_stand();}; + +// Alternative scene for super grunt. +void() army_standb1 =[ $standb1, army_standb2 ] {ai_stand();}; +void() army_standb2 =[ $standb2, army_standb3 ] {ai_stand();}; +void() army_standb3 =[ $standb3, army_standb4 ] {ai_stand();}; +void() army_standb4 =[ $standb4, army_standb5 ] {ai_stand();}; +void() army_standb5 =[ $standb5, army_standb6 ] {ai_stand();}; +void() army_standb6 =[ $standb6, army_standb7 ] {ai_stand();}; +void() army_standb7 =[ $standb1, army_standb1 ] {ai_stand();}; + +// WALK - - - - - - - - - - - - - - - - +void() army_walk1 =[ $prowl_1, army_walk2 ] {army_idle_sound(); ai_walk(1);}; +void() army_walk2 =[ $prowl_2, army_walk3 ] {ai_walk(1);}; +void() army_walk3 =[ $prowl_3, army_walk4 ] {ai_walk(1);}; +void() army_walk4 =[ $prowl_4, army_walk5 ] {ai_walk(1);}; +void() army_walk5 =[ $prowl_5, army_walk6 ] {ai_walk(2);}; +void() army_walk6 =[ $prowl_6, army_walk7 ] {ai_walk(3);}; +void() army_walk7 =[ $prowl_7, army_walk8 ] {ai_walk(4);}; +void() army_walk8 =[ $prowl_8, army_walk9 ] {ai_walk(4);}; +void() army_walk9 =[ $prowl_9, army_walk10 ] {ai_walk(2);}; +void() army_walk10 =[ $prowl_10, army_walk11 ] {ai_walk(2);}; +void() army_walk11 =[ $prowl_11, army_walk12 ] {ai_walk(2);}; +void() army_walk12 =[ $prowl_12, army_walk13 ] {M_Step(); ai_walk(1);}; +void() army_walk13 =[ $prowl_13, army_walk14 ] {ai_walk(0);}; +void() army_walk14 =[ $prowl_14, army_walk15 ] {ai_walk(1);}; +void() army_walk15 =[ $prowl_15, army_walk16 ] {ai_walk(1);}; +void() army_walk16 =[ $prowl_16, army_walk17 ] {ai_walk(1);}; +void() army_walk17 =[ $prowl_17, army_walk18 ] {ai_walk(3);}; +void() army_walk18 =[ $prowl_18, army_walk19 ] {ai_walk(3);}; +void() army_walk19 =[ $prowl_19, army_walk20 ] {ai_walk(3);}; +void() army_walk20 =[ $prowl_20, army_walk21 ] {ai_walk(3);}; +void() army_walk21 =[ $prowl_21, army_walk22 ] {ai_walk(2);}; +void() army_walk22 =[ $prowl_22, army_walk23 ] {ai_walk(1);}; +void() army_walk23 =[ $prowl_23, army_walk24 ] {ai_walk(1);}; +void() army_walk24 =[ $prowl_24, army_walk1 ] {M_Step(); ai_walk(1);}; + +// Alternative scene for super grunt. +void() army_walkb1 =[ $walk1, army_walkb2 ] { + if (random() < 0.1) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); + ai_walk(5); +}; +void() army_walkb2 =[ $walk2, army_walkb3 ] {M_Step(); ai_walk(5);}; +void() army_walkb3 =[ $walk3, army_walkb4 ] {ai_walk(4);}; +void() army_walkb4 =[ $walk4, army_walkb5 ] {ai_walk(2);}; +void() army_walkb5 =[ $walk5, army_walkb6 ] {ai_walk(8);}; +void() army_walkb6 =[ $walk6, army_walkb7 ] {ai_walk(5);}; +void() army_walkb7 =[ $walk7, army_walkb8 ] {M_Step(); ai_walk(8);}; +void() army_walkb8 =[ $walk8, army_walkb9 ] {ai_walk(4);}; +void() army_walkb9 =[ $walk9, army_walkb10 ] {ai_walk(3);}; +void() army_walkb10 =[ $walk10, army_walkb11 ] {ai_walk(6);}; +void() army_walkb11 =[ $walk11, army_walkb1 ] {ai_walk(6);}; + +// RUN - - - - - - - - - - - - - - - - - +void() army_run1 =[ $run1, army_run2 ] {army_idle_sound(); ai_run(11);}; +void() army_run2 =[ $run2, army_run3 ] {ai_run(15);}; +void() army_run3 =[ $run3, army_run4 ] {M_Step(); ai_run(10);}; +void() army_run4 =[ $run4, army_run5 ] {ai_run(10);}; +void() army_run5 =[ $run5, army_run6 ] {ai_run(8);}; +void() army_run6 =[ $run6, army_run7 ] {ai_run(15);}; +void() army_run7 =[ $run7, army_run8 ] {M_Step(); ai_run(10);}; +void() army_run8 =[ $run8, army_run1 ] {ai_run(8);}; + +// For super grunt. +void() army_runb1 =[ $runb1, army_runb2 ] { + if (random() < 0.1) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_IDLE); + ai_run(20); +}; +void() army_runb2 =[ $runb2, army_runb3 ] {ai_run(16);}; +void() army_runb3 =[ $runb3, army_runb4 ] {M_Step(); ai_run(9);}; +void() army_runb4 =[ $runb4, army_runb5 ] {ai_run(20);}; +void() army_runb5 =[ $runb5, army_runb6 ] {M_Step(); ai_run(16);}; +void() army_runb6 =[ $runb6, army_runb1 ] {ai_run(9);}; + +// Rocketter special movement. +void(float d) army_back = {ai_face (); ai_back (d);}; +void() army_back1 =[ $run1, army_back2 ] {army_idle_sound(); army_back(11);}; +void() army_back2 =[ $run2, army_back3 ] {army_back(15);}; +void() army_back3 =[ $run3, army_back4 ] {M_Step(); army_back(10);}; +void() army_back4 =[ $run4, army_back5 ] {army_back(10);}; +void() army_back5 =[ $run5, army_back6 ] {army_back(8);}; +void() army_back6 =[ $run6, army_back7 ] {army_back(15);}; +void() army_back7 =[ $run7, army_back8 ] {M_Step(); army_back(10);}; +void() army_back8 =[ $run8, army_run ] {army_back(8);}; + +void() army_run = +{ + if (self.skin >= SKIN_ARMY_ELITE) //(self.classname == "monster_soldier") + {army_runb1(); return;} + army_run1 (); +}; + +// ATTACK - - - - - - - - - - - - - - - +void() army_fire = +{ + local vector org, dir, err; + + ai_face (); + + makevectors (self.angles); + if (self.war & WARx_USES_SHELLS) + { + // fire somewhat behind the player, so a dodging player is harder to hit + org = self.origin; + dir = self.enemy.origin - self.enemy.velocity*0.2; + } + else + { + dir = (v_forward*12) + (v_right*7) + (v_up*14); + org = self.origin + dir; + dir = self.enemy.origin + dir; + } + if (self.war & WARx_AI_RAPID_FIRE) + err = '1.2 0.9 0'; + else + err = '0 0 0'; + if (self.classname == "monster_army_rocket") + if (self.war == WAR_SIDEWINDER) + { // Emulate rocketter's missile. + if (!visible (self.enemy)) + dir = self.dest; + M_AccelRocket (org, dir); + M_Reload (2); // Quoth enforces two second delay, usually. + return; + } + if (self.classname == "monster_army_cyborg") + { +// FIXME: This uses direction instead of aimpoint. Update attack code. +// For now, Qexpo is near, and I have more urgent things to fix. +// Here's a hack to keep things running until I can fix this properly. + if ((self.war == WAR_SUPER_NAILGUN) || (self.war == WAR_BLASTER)) + { + local float frac; + + self.effects = self.effects | EF_MUZZLEFLASH; + frac = 1 - ((self.shots_left - 1) / self.shots_max); //Frac_ShotDown (); + dir = Maim_LineEx (org, dir, 1000, self.enemy, err, frac); + if (self.war == WAR_SUPER_NAILGUN) + { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + launch_superspike (org, dir); + } + else + { + sound (self, CHAN_WEAPON, "me/me_fire1.wav", 1, ATTN_NORM); + Needle_Launch (org, dir, 3); + } + M_Reload (0.1); + + return; + } + } + M_Attack (self.war, org, dir, world, err, TRUE); +}; + +// Fire start. +void() army_fires = +{ + local float ls; + + ls = FALSE; + if (self.war & WARx_SHAFT) + if (self.ammo_cells > 0) + if (!self.punked) + ls = TRUE; + army_fire(); + if (ls) // Play thunder if firing a lightning weapon. + M_Lstart(); +}; +//---------------- +void() army_face = +{ + ai_face (); + if (self.skin == SKIN_ARMY_CYBORG) + ai_run_strafe(16); + else if (self.skin >= SKIN_ARMY_ELITE) + ai_run_strafe(8); +}; +void() army_reload1 =[ $load1, army_reload2 ] {}; +void() army_reload2 =[ $load2, army_reload3 ] {ai_back(2);}; +void() army_reload3 =[ $load3, army_reload4 ] {ai_back(2);}; +void() army_reload4 =[ $load4, army_reload5 ] {}; +void() army_reload5 =[ $load5, army_reload6 ] {}; +void() army_reload6 =[ $load6, army_reload7 ] {ai_forward(3);}; +void() army_reload7 =[ $load7, army_reload8 ] {ai_forward(1);}; +void() army_reload8 =[ $load8, army_reload9 ] {sound (self, CHAN_WEAPON, "weapons/lock4.wav", 1, ATTN_NORM);}; +void() army_reload9 =[ $load9, army_reload10 ] {}; +void() army_reload10 =[ $load10, army_reload11 ] {}; +void() army_reload11 =[ $load11, army_run ] {}; +//---------------- +void() army_atk1 =[ $shoot1, army_atk2 ] {army_face();}; +void() army_atk2 =[ $shoot2, army_atk3 ] {army_face();}; +void() army_atk3 =[ $shoot3, army_atk4 ] {army_face();}; +void() army_atk4 =[ $shoot4, army_atk5 ] {army_face();}; +void() army_atk5 =[ $shoot5, army_atk6 ] {army_face();army_fires();}; +void() army_atk6 =[ $shoot6, army_atk7 ] {army_face();}; +void() army_atk7 =[ $shoot7, army_atk8 ] {army_face();SUB_CheckRefire (army_atk1);}; +void() army_atk8 =[ $shoot8, army_atk9 ] {army_face();}; +void() army_atk9 =[ $shoot9, army_run ] {army_face();}; +//---------------- +//void() army_atkb8; +void() army_atkb1 =[ $shoot1, army_atkb2 ] {army_face();}; +void() army_atkb2 =[ $shoot2, army_atkb3 ] {army_face();}; +void() army_atkb3 =[ $shoot3, army_atkb4 ] {army_face();}; +void() army_atkb4 =[ $shoot4, army_atkb5 ] {army_face();}; +void() army_atkb5 =[ $shoot5, army_atkb6 ] {army_face();army_fires();}; +void() army_atkb6 =[ $shoot4, army_atkb7 ] {army_face();army_fire();}; +void() army_atkb7 =[ $shoot5, army_atkb8 ] {army_face();army_fire();SUB_CheckRefire (army_atkb6);}; +void() army_atkb8 =[ $shoot4, army_run ] {army_face();}; +//---------------- +void() army_clip; +void() army_stop =[ $shoot4, army_run ] { +// if (self.count >= 5) +// {self.count = 0; army_reload1 (); return;} + if (self.skin != SKIN_ARMY_CYBORG) + if (random() < 0.25) + {army_reload1 (); return;} + army_face(); +}; +void() army_atkc1 =[ $shoot1, army_atkc2 ] {army_face();}; +void() army_atkc2 =[ $shoot2, army_atkc3 ] {army_face();}; +void() army_atkc3 =[ $shoot3, army_atkc5 ] {army_face();}; +void() army_atkc4 =[ $shoot4, army_atkc5 ] {army_face();}; +void() army_atkc5 =[ $shoot5, army_atkc6 ] {army_face(); army_fires(); army_clip();}; +void() army_atkc6 =[ $shoot4, army_atkc7 ] {army_face(); army_fire(); army_clip();}; +void() army_atkc7 =[ $shoot5, army_atkc6 ] {army_face(); army_fire(); army_clip();}; +void() army_echo = +{ + self.shots_left = 2; + if ( self.frame == $shoot5 ) + army_atkc6 (); + else + army_atkc7 (); +}; +void() army_clip = +{ + if (self.shots_left > 0) + self.shots_left = self.shots_left - 1; + + M_Break (army_stop); + if (self.shots_left < 1) + { + self.think = army_stop; + SUB_CheckRefire (army_echo); + } +}; +//---------------- +float() army_abort = +{ + if ((self.war & WARx_USES_ROCKETS) || (self.war == WAR_PLASMA_GUN)) + { + local float dist; + + if (self.war == WAR_CRUISE_MISSILE) + dist = 120; // Still too short, but alas... + else if ((self.war == WAR_ROCKET_LAUNCHER) || (self.war == WAR_GRENADE_LAUNCHER)) + dist = 100; + else + dist = 80; + if (InMeleeRange (dist)) + return TRUE; // Too close. + } + return FALSE; +}; +void() army_rem = +{ + if (visible (self.enemy)) + self.dest = self.enemy.origin; +}; +void() army_load1 =[ $load1, army_load2 ] {ai_face(); army_rem();}; +void() army_load2 =[ $load2, army_load3 ] {ai_face(); ai_back(2); army_rem();}; +void() army_load3 =[ $load3, army_load4 ] {ai_face(); ai_back(2); army_rem();}; +void() army_load4 =[ $load4, army_load5 ] {ai_face(); army_rem();}; +void() army_load5 =[ $load5, army_load6 ] {ai_face(); army_rem();}; +void() army_load6 =[ $load6, army_load7 ] {ai_face(); ai_forward(3); army_rem();}; +void() army_load7 =[ $load7, army_load8 ] {ai_face(); ai_forward(1); army_rem();}; +void() army_load8 =[ $load8, army_load9 ] {ai_face(); army_rem(); sound (self, CHAN_WEAPON, "weapons/lock4.wav", 1, ATTN_NORM);}; +void() army_load9 =[ $load9, army_load10 ] {ai_face(); army_rem();}; +void() army_load10 =[ $load10, army_load11 ] {ai_face(); army_rem();}; +void() army_load11 =[ $load11, army_atk5 ] {ai_face(); army_rem(); +// Short curcuit check for rocketter. + if (self.classname == "monster_army_rocket") + { // FIXME: Clear shot, like archer lords. + if (army_abort ()) + self.think = army_back1; + } +}; +//---------------- +void() army_fatk1 =[ $shoot2, army_fatk2 ] {army_face();}; +void() army_fatk2 =[ $shoot3, army_atk5 ] {army_face();}; +//---------------- +void() army_fatkb1 =[ $shoot2, army_fatkb2 ] {army_face();}; +void() army_fatkb2 =[ $shoot3, army_atkb5 ] {army_face();}; +//---------------- +void() army_fatkc1 =[ $shoot2, army_fatkc2 ] {army_face();}; +void() army_fatkc2 =[ $shoot3, army_atkc5 ] {army_face();}; +//---------------- +void() army_attack = +{ + local float fast; + local float ow; + +// FIXME: Attack code in 'mong.qc' needs a revision. + if (self.skin == SKIN_ARMY_CYBORG) + {fast = TRUE; self.shots_max = self.shots_left = 3;} + else if (self.skin >= SKIN_ARMY_ELITE) //(self.classname == "monster_soldier") + {fast = TRUE; self.shots_left = 4;} + else + {fast = FALSE; self.shots_left = 3;} + + ow = self.war; + M_SelectGun (); + if (ow == self.war) + self.count = self.count + 1; + if (self.war & WARx_USES_ROCKETS) + { + if (self.classname == "monster_army_rocket") + { // Emulate Rocketter AI. + if (army_abort ()) + {army_back1 (); return;} // Too close. + } + army_load1 (); + } + else if (self.skin == SKIN_ARMY_CYBORG) + { + if (self.war & (WARx_AI_RAPID_FIRE | WAR_BLASTER)) + army_atkc2(); + else if (self.war) + army_fatk1 (); + } + else if (fast) + { + if (self.war & WARx_AI_RAPID_FIRE) + army_atkc2(); //fatkb1 (); + else if (self.war) + army_fatk1 (); + } + else if (self.war & WARx_AI_RAPID_FIRE) + army_atkb1 (); + else if (self.war || self.ammo_shells) + army_atk1 (); +// No weapon?! Leave the think function alone. +}; + + +// PAIN - - - - - - - - - - - - - - - - +void() army_pain1 =[ $pain1, army_pain2 ] {}; +void() army_pain2 =[ $pain2, army_pain3 ] {}; +void() army_pain3 =[ $pain3, army_pain4 ] {}; +void() army_pain4 =[ $pain4, army_pain5 ] {}; +void() army_pain5 =[ $pain5, army_pain6 ] {}; +void() army_pain6 =[ $pain6, army_run ] {ai_back(1);}; + +void() army_painb1 =[ $painb1, army_painb2 ] {}; +void() army_painb2 =[ $painb2, army_painb3 ] {ai_forward(13);}; +void() army_painb3 =[ $painb3, army_painb4 ] {ai_forward(9);}; +void() army_painb4 =[ $painb4, army_painb5 ] {}; +void() army_painb5 =[ $painb5, army_painb6 ] {}; +void() army_painb6 =[ $painb6, army_painb7 ] {}; +void() army_painb7 =[ $painb7, army_painb8 ] {}; +void() army_painb8 =[ $painb8, army_painb9 ] {}; +void() army_painb9 =[ $painb9, army_painb10 ] {}; +void() army_painb10 =[ $painb10, army_painb11 ] {}; +void() army_painb11 =[ $painb11, army_painb12 ] {}; +void() army_painb12 =[ $painb12, army_painb13 ] {ai_back(2);}; +void() army_painb13 =[ $painb13, army_painb14 ] {}; +void() army_painb14 =[ $painb14, army_run ] {}; + +void() army_painc1 =[ $painc1, army_painc2 ] {}; +void() army_painc2 =[ $painc2, army_painc3 ] {ai_back(1);}; +void() army_painc3 =[ $painc3, army_painc4 ] {}; +void() army_painc4 =[ $painc4, army_painc5 ] {}; +void() army_painc5 =[ $painc5, army_painc6 ] {ai_forward(1);}; +void() army_painc6 =[ $painc6, army_painc7 ] {ai_forward(1);}; +void() army_painc7 =[ $painc7, army_painc8 ] {}; +void() army_painc8 =[ $painc8, army_painc9 ] {ai_back(1);}; +void() army_painc9 =[ $painc9, army_painc10 ] {ai_forward(4);}; +void() army_painc10 =[ $painc10, army_painc11 ] {ai_forward(3);}; +void() army_painc11 =[ $painc11, army_painc12 ] {ai_forward(6);}; +void() army_painc12 =[ $painc12, army_painc13 ] {ai_forward(8);}; +void() army_painc13 =[ $painc13, army_run ] {}; + +void(entity attacker, float damage) army_pain = +{ + if (self.pain_finished > time) + return; + + if (SUB_IgnorePain ()) + { + self.pain_finished = time + 0.6; + sound (self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); + return; + } + + local float r; + + r = random(); + + if ((r < 0.2) || (skill >= 3)) + { + self.pain_finished = time + 0.6; + army_pain1 (); + sound (self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); + } + else if (r < 0.6) + { + self.pain_finished = time + 1.1; + army_painb1 (); + sound (self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + } + else + { + self.pain_finished = time + 1.1; + army_painc1 (); + sound (self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + } + damage = damage; attacker = attacker; // FrikQcc warning squelch! +}; + +void(entity attacker, float damage) army_rocket_pain = +{ + if ( (( self.frame >= $load1 ) && ( self.frame <= $load11 )) + || (( self.frame >= $shoot1 ) && ( self.frame <= $shoot9 )) ) + return; // Cannot flinch during an attack. + + army_pain (attacker, damage); +}; + + +// DEATH - - - - - - - - - - - - - - - - +void() army_decap1 =[ $deathb1, army_decap2 ] {blood_spray('-8 0 24', 1);}; +void() army_decap2 =[ $deathb2, army_decap3 ] {blood_spray('-16 0 21', 2);}; +void() army_decap3 =[ $deathb3, army_decap4 ] {blood_spray('-22 0 21', 1);monster_drop();}; +void() army_decap4 =[ $deathb4, army_decap5 ] {blood_spray('-23 0 14', 1);}; +void() army_decap5 =[ $deathb5, army_decap6 ] {}; +void() army_decap6 =[ $deathb6, army_decap7 ] {}; +void() army_decap7 =[ $deathb7, army_decap8 ] {}; +void() army_decap8 =[ $deathb8, army_decap9 ] {}; +void() army_decap9 =[ $deathb9, decap_end ] {}; + +void() army_decapb1 =[ $decapb1, army_decapb2 ] {blood_spray('-11 0 23', 1);}; +void() army_decapb2 =[ $decapb2, army_decapb3 ] {ai_back(5); blood_spray('-16 0 21', 2);}; +void() army_decapb3 =[ $decapb3, army_decapb4 ] {monster_drop();ai_back(4); blood_spray('-19 -1 18', 1);}; +void() army_decapb4 =[ $decapb4, army_decapb5 ] {ai_back(13); blood_spray('-22 0 15', 1);}; +void() army_decapb5 =[ $decapb5, army_decapb6 ] {ai_back(3);}; +void() army_decapb6 =[ $decapb6, army_decapb7 ] {ai_back(4);}; +void() army_decapb7 =[ $decapb7, army_decapb8 ] {}; +void() army_decapb8 =[ $decapb8, army_decapb9 ] {}; +void() army_decapb9 =[ $decapb9, army_decapb10 ] {}; +void() army_decapb10 =[ $decapb10, army_decapb11 ] {}; +void() army_decapb11 =[ $decapb11, decap_end ] {}; + +void() army_die1 =[ $death1, army_die2 ] {}; +void() army_die2 =[ $death2, army_die3 ] {}; +void() army_die3 =[ $death3, army_die4 ] {monster_drop();}; +void() army_die4 =[ $death4, army_die5 ] {}; +void() army_die5 =[ $death5, army_die6 ] {}; +void() army_die6 =[ $death6, army_die7 ] {}; +void() army_die7 =[ $death7, army_die8 ] {}; +void() army_die8 =[ $death8, army_die9 ] {}; +void() army_die9 =[ $death9, army_die10 ] {}; +void() army_die10 =[ $death10, monster_end ] {}; + +void() army_cdie1 =[ $deathc1, army_cdie2 ] {}; +void() army_cdie2 =[ $deathc2, army_cdie3 ] {ai_back(5);}; +void() army_cdie3 =[ $deathc3, army_cdie4 ] {monster_drop();ai_back(4);}; +void() army_cdie4 =[ $deathc4, army_cdie5 ] {ai_back(13);}; +void() army_cdie5 =[ $deathc5, army_cdie6 ] {ai_back(3);}; +void() army_cdie6 =[ $deathc6, army_cdie7 ] {ai_back(4);}; +void() army_cdie7 =[ $deathc7, army_cdie8 ] {}; +void() army_cdie8 =[ $deathc8, army_cdie9 ] {}; +void() army_cdie9 =[ $deathc9, army_cdie10 ] {}; +void() army_cdie10 =[ $deathc10, army_cdie11 ] {}; +void() army_cdie11 =[ $deathc11, monster_end ] {}; + +float(float dm) army_gib = +{ + if (self.health < self.gib_health) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowHead ("progs/h_guard.mdl", dm); + return TRUE; + } + return FALSE; +}; + +void() army_die = +{ + if (Shattered ()) + return; + if (Decapitated ()) + { + if (random() < 0.5) + monster_decap ('-8 0 24', army_decap1); + else + monster_decap ('-11 0 23', army_decapb1); + return; + } +// check for gib + if (army_gib (self.health)) + return; + +// regular death + sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); + if (random() < 0.5) + army_die1 (); + else + army_cdie1 (); +}; + +// REVIVE - - - - - - - - - - - - - - - +void() army_revive1 =[ $death9, army_revive2 ] {}; +void() army_revive2 =[ $death8, army_revive3 ] {}; +void() army_revive3 =[ $death7, army_revive4 ] {}; +void() army_revive4 =[ $death6, army_revive5 ] {}; +void() army_revive5 =[ $death5, army_revive6 ] {}; +void() army_revive6 =[ $death4, army_revive7 ] {}; +void() army_revive7 =[ $death3, army_revive8 ] {}; +void() army_revive8 =[ $death2, army_revive9 ] {}; +void() army_revive9 =[ $death1, army_run ] {}; + +void() army_revivec1 =[ $deathc10, army_revivec2 ] {}; +void() army_revivec2 =[ $deathc9, army_revivec3 ] {}; +void() army_revivec3 =[ $deathc8, army_revivec4 ] {}; +void() army_revivec4 =[ $deathc7, army_revivec5 ] {}; +void() army_revivec5 =[ $deathc6, army_revivec6 ] {}; +void() army_revivec6 =[ $deathc5, army_revivec7 ] {}; +void() army_revivec7 =[ $deathc4, army_revivec8 ] {}; +void() army_revivec8 =[ $deathc3, army_revivec9 ] {}; +void() army_revivec9 =[ $deathc2, army_revivec10 ] {}; +void() army_revivec10 =[ $deathc1, army_run ] {}; + +void() army_revive = +{ + if ( self.frame == $deathc11 ) + army_revivec1 (); + else + army_revive1 (); +}; + + +//============================================================================= + +// OTHER - - - - - - - - - - - - - - - - +void() monster_bandit; + +void(float hello) army_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "soldier/sight1.wav", 1, ATTN_NORM); +}; + +void() army_cache = +{ + precache_model ("progs/soldier.mdl"); + precache_model ("progs/h_guard.mdl"); + precache_model ("progs/gib1.mdl"); + precache_model ("progs/gib2.mdl"); + precache_model ("progs/gib3.mdl"); + + precache_sound ("soldier/death1.wav"); + precache_sound ("soldier/idle.wav"); + precache_sound ("soldier/pain1.wav"); + precache_sound ("soldier/pain2.wav"); + precache_sound ("soldier/sight1.wav"); + precache_sound ("weapons/guncock.wav"); // Was 'soldier/sattck1.wav'. + + precache_sound ("player/udeath.wav"); // gib death +}; + +//============ +// QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush Elite +//============ +void() monster_army = +{ +// Tronyn: Goblins + if (medieval) + { + if (soul_evil) + {self.skin = 1; self.classname = "monster_goblin";} + else + {self.skin = 0; self.classname = "monster_bandit";} + monster_bandit (); + return; + } +//- - - - - - - - - + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + army_cache (); + } + + local float hp, guns; + + if (self.spawnflags & 2) + { // Elite soldier. + self.skin = SKIN_ARMY_ELITE; + self.classname = "monster_soldier"; +// DISABLED -- Was always ambush in OUM. +// self.spawnflags = self.spawnflags | 1; + } + + // FIXME: Finalize cyborg weapon. + if (self.skin == SKIN_ARMY_CYBORG) + {hp = 200; guns = WAR_SUPER_NAILGUN;} //BLASTER;} + else if (self.skin == SKIN_ARMY_ELITE_RED) + {hp = 100; guns = WAR_SUPER_SHOTGUN;} + else if (self.skin == SKIN_ARMY_ELITE) + {hp = 90; guns = WAR_NAILGUN;} // OUM uses 90. I'd use 75... + else if (self.skin == SKIN_ARMY_ROCKET) + {hp = 60; guns = WAR_SIDEWINDER;} + else // Default to standard grunt. + {self.skin = 0; hp = 30; guns = WAR_SHOTGUN;} + + monster_form ("progs/soldier.mdl", '-16 -16 -24', '16 16 40', hp, -35); + self.mdl_head = "progs/h_guard.mdl"; + self.mass = MASS_MEDIUM; + + if (self.skin >= SKIN_ARMY_ELITE) + { + self.attack_state = AS_FLANKING; + self.th_stand = army_standb1; + self.th_walk = army_walkb1; + } + else + { + self.th_stand = army_stand1; + self.th_walk = army_walk1; + } + self.th_run = army_run; + self.th_missile = army_attack; //army_atk1; + self.th_pain = army_pain; + self.th_die = army_die; + //- - - - - - - - + self.th_check = SoldierCheckAttack; + self.th_sight = army_sight; + self.th_gib = army_gib; + self.th_revive = army_revive; + self.th_spawn = monster_army; + + self.height = FALSE; + self.family = FAM_ARMY; + if (self.skin == SKIN_ARMY_ROCKET) + { + self.th_melee = army_attack; // Spam rockets or run away. + self.th_pain = army_rocket_pain; + self.th_check = world.null_func; + } + else if (self.skin == SKIN_ARMY_CYBORG) + self.th_check = world.null_func; + else if (!self.skin) + self.ryuflags = RYU_INSANE; + + monster_guns (guns, 0, 0, 0, 0); + + if (soul_evil) + monster_purse (2, 0.2, 0); + + monster_start (); +}; + +// Variant cleaner soldier. +void() monster_soldier = {self.skin = SKIN_ARMY_ELITE; monster_army ();}; + +// Quoth's rocketeer. +void() monster_army_rocket = {self.skin = SKIN_ARMY_ROCKET; monster_army ();}; + +// Quoth's rocketeer. +void() monster_army_cyborg = {self.skin = SKIN_ARMY_CYBORG; monster_army ();}; + + +//============================================================================ +// BANDIT / GOBLIN (Soldier variant armed with a bow.) +//============================================================================ + +// ATTACK - - - - - - - - - - - - - - - +void() bandit_fire = +{ + local vector org, dir; + local float artype; + + ai_face (); + + makevectors (self.angles); + dir = (v_forward*9) + (v_right*6) + (v_up*16); + org = self.origin + dir; + dir = self.enemy.origin + dir; +// if (ARROW_FLY) + dir = Maim_Line (org, dir, AKARROW_SPEED_FLY, world, '0 0 0'); +// else +// dir = Maim_Toss (org, dir, AKARROW_SPEED_TOSS, 200, world, '0 0 0'); + + sound (self, CHAN_WEAPON, "archer/arrowg.wav", 1, ATTN_NORM); + // PM: Assumes skin is 0 or 1. If 2+, rewrite! + if (self.ryuflags & RYU_REBEL) + artype = 0; // Rebel arrows are stronger. + else + artype = 4 + (self.skin & 1); + AkArrow_Launch (org, dir, artype); +}; + +// SoE: Check if shot is blocked. Used by rebel to avoid friendly fire. +void() bandit_short = +{ + if (self.ryuflags & RYU_REBEL) + { + local vector p1, p2; + + p1 = self.origin + self.view_ofs; + p2 = self.enemy.origin + self.enemy.view_ofs; + + traceline (p1, p2, ARROW_FLY, self); + if (trace_ent != self.enemy) + if (trace_fraction < 1) + if (trace_ent.flags & FLx_CREATURE) + if (DontHurtMe (trace_ent)) + { + StopSound (self, CHAN_WEAPON); + self.think = army_run1; + } + } +}; + +// SoE: Shoot scene modified from shooting a gun to drawing a bow. +void() bandit_atk1 =[ $shoot1, bandit_atk2 ] {ai_face();}; +void() bandit_atk2 =[ $shoot2, bandit_atk3 ] {ai_face(); sound (self, CHAN_WEAPON, "archer/draw.wav", 1, ATTN_NORM);}; +void() bandit_atk3 =[ $shoot3, bandit_atk4 ] {ai_face();}; +void() bandit_atk4 =[ $shoot4, bandit_atk5 ] {ai_face();}; +void() bandit_atk5 =[ $shoot5, bandit_atk6 ] {ai_face();}; +void() bandit_atk6 =[ $shoot5, bandit_atk7 ] {ai_face();bandit_short();}; +void() bandit_atk7 =[ $shoot6, bandit_atk8 ] {ai_face();bandit_fire();}; +void() bandit_atk8 =[ $shoot7, army_run1 ] {ai_face(); + if (self.ryuflags & RYU_REBEL) + { // Rebels have their own refire check. + if (self.enemy.health > 0) + { + if (random() < 0.4) + { // If shot cannot hit enemy, stop. + local vector p1, p2; + + p1 = self.origin + self.view_ofs; + p2 = self.enemy.origin + self.enemy.view_ofs; + + traceline (p1, p2, ARROW_FLY, self); + if (trace_ent == self.enemy) + { // Refire. + if (self.attack_finished) + self.attack_finished = self.attack_finished + 0.5; + self.think = bandit_atk4; + return; + } + } + } + } + else + SUB_CheckRefire (bandit_atk3); +}; +//void() bandit_atk8 =[ $shoot8, bandit_atk9 ] {ai_face();}; +//void() bandit_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +// PAIN - - - - - - - - - - - - - - - - +void(entity attacker, float damage) bandit_pain = +{ + if (self.pain_finished > time) + return; + + if (SUB_IgnorePain ()) + { + self.pain_finished = time + 0.6; + if (self.classname == "monster_bandit") + sound (self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "goblin/pain1.wav", 1, ATTN_NORM); + return; // No pain anims in Nightmare. + } + + local float r; + local float p1, p2; + + r = random(); + if (self.ryuflags & RYU_REBEL) + {p1 = 0.85; p2 = 0.925;} + else + {p1 = 0.2; p2 = 0.6;} + + if ((r < p1) || (skill >= 3)) + { + self.pain_finished = time + 0.6; + army_pain1 (); + if (self.classname == "monster_bandit") + sound (self, CHAN_VOICE, "soldier/pain1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "goblin/pain1.wav", 1, ATTN_NORM); + } + else if (r < p2) + { + self.pain_finished = time + 1.1; + army_painb1 (); + if (self.classname == "monster_bandit") + sound (self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "goblin/pain1.wav", 1, ATTN_NORM); + } + else + { + self.pain_finished = time + 1.1; + army_painc1 (); + if (self.classname == "monster_bandit") + sound (self, CHAN_VOICE, "soldier/pain2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "goblin/pain2.wav", 1, ATTN_NORM); + } + damage = damage; attacker = attacker; // FrikQcc warning squelch! +}; + +// DEATH - - - - - - - - - - - - - - - - +float(float dm) bandit_gib = +{ + if (self.health < self.gib_health) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowHead ("progs/h_bandit.mdl", dm); + return TRUE; + } + return FALSE; +}; + +void() bandit_die = +{ + if (Shattered ()) + return; + if (Decapitated ()) + { + if (random() < 0.5) + monster_decap ('-8 0 24', army_decap1); + else + monster_decap ('-11 0 23', army_decapb1); + return; + } +// check for gib + if (bandit_gib (self.health)) + return; + +// regular death + if (self.classname == "monster_bandit") + sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); + else + { + if (random() < 0.5) + sound (self, CHAN_VOICE, "goblin/death1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "goblin/death2.wav", 1, ATTN_NORM); + } + if (random() < 0.5) + army_die1 (); + else + army_cdie1 (); +}; + + +// OTHER - - - - - - - - - - - - - - - - +void(float hello) bandit_sight = +{ + if (self.classname == "monster_bandit") + { + if (!hello) + sound (self, CHAN_VOICE, "soldier/sight1.wav", 1, ATTN_NORM); + else if (!(self.ryuflags & RYU_REBEL)) + sound (self, CHAN_VOICE, "soldier/idle.wav", 1, ATTN_NORM); + return; + } + if (hello) + sound (self, CHAN_VOICE, "goblin/idle1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "goblin/sight1.wav", 1, ATTN_NORM); +}; + +void() bandar_cache = +{ + precache_model ("progs/drake/arrow.mdl"); + precache_model ("progs/drake/bandit.mdl"); + precache_model ("progs/drake/h_bandit.mdl"); + + precache_sound ("archer/arrow1.wav"); + precache_sound ("archer/arrow2.wav"); + precache_sound ("archer/arrow3.wav"); + precache_sound ("archer/arrowbrk.wav"); + precache_sound ("archer/arrowg.wav"); + precache_sound ("archer/draw.wav"); +// precache_sound ("player/udeath.wav"); // gib death +}; + +void() bandit_cache = +{ + bandar_cache (); + precache_sound ("soldier/death1.wav"); + precache_sound ("soldier/idle.wav"); + precache_sound ("soldier/pain1.wav"); + precache_sound ("soldier/pain2.wav"); + precache_sound ("soldier/sight1.wav"); +}; + +void() goblin_cache = +{ + bandar_cache (); + precache_sound ("goblin/death1.wav"); + precache_sound ("goblin/death2.wav"); + precache_sound ("goblin/idle1.wav"); + precache_sound ("goblin/idle2.wav"); + precache_sound ("goblin/pain1.wav"); + precache_sound ("goblin/pain2.wav"); + precache_sound ("goblin/sight1.wav"); +}; + +//============ +// QUAKED monster_bandit (1 0 0) (-16 -16 -24) (16 16 40) Ambush +//============ +void() monster_bandit = +{ + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + if (self.skin) + goblin_cache (); + else + bandit_cache (); + } + + monster_form ("progs/bandit.mdl", '-16 -16 -24', '16 16 40', 30, -35); + self.mdl_head = "progs/h_bandit.mdl"; + self.mass = MASS_MEDIUM; + + self.th_stand = army_stand1; // Same frames as base grunt. + self.th_walk = army_walk1; + self.th_run = army_run1; + self.th_missile = bandit_atk1; + self.th_pain = bandit_pain; + self.th_die = bandit_die; + //- - - - - - - - + self.th_check = SoldierCheckAttack; + self.th_sight = bandit_sight; + self.th_gib = bandit_gib; + self.th_revive = army_revive; + self.th_spawn = monster_bandit; + + self.height = 2; + self.ryuflags = RYU_INSANE; + if (soul_evil) + monster_guns (0, 0, 10, 0, 0); + monster_purse (2, 0.2, 0); // Bandits may drop some coins. +// SoE: Modified stats for nsoe2 rebel fighters. + + if (self.deathstring == "") self.deathstring = " was shot by a Bandit\n"; + + if (self.classname == "monster_goblin") { + if (self.deathstring == "") self.deathstring = " was shot by a Goblin\n"; + } + + if (!self.skin && (self.spawnflags & SPAWN_WHITE) && !self.spawned) + { + if (self.health < 100) + {self.health = self.max_health = 100;} + self.ryuflags = RYU_ALERT | RYU_REBEL; + if (self.deathstring == "") self.deathstring = " was shot by friendly fire\n"; + } + + + + +//- - - - - - - - - + + monster_start (); +}; + +void() monster_goblin = {self.skin = 1; monster_bandit ();}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/mon_bane.qc b/QC_other/QC_keep/mon_bane.qc new file mode 100644 index 00000000..5e1166fe --- /dev/null +++ b/QC_other/QC_keep/mon_bane.qc @@ -0,0 +1,2152 @@ +/* +============================================================================== + +KNIGHT + +============================================================================== +*/ + +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +$frame decap1 decap2 decap3 decap4 decap5 decap6 decap7 decap8 +$frame decap9 decap10 decap11 decap12 + +$frame decapb1 decapb2 decapb3 decapb4 decapb5 decapb6 decapb7 decapb8 +$frame decapb9 + + +//- - - - - - - - - +float SKIN_HELL_KNIGHT = 0; +float SKIN_HELL_KNIGHT2 = 1; +float SKIN_HELL_LORD = 2; +float SKIN_HKBOSS = 3; +float SKIN_BANE = 4; +float SKIN_BANE_GRAY = 5; +float SKIN_DARK_LORD = 6; + +float DARKLORD_NEAR = 250; +//- - - - - - - - - +void() hknight_char_a1; +void() hknight_char_b1; // PM: Enabled unused charge anim. +void() hknight_run1; +void() hk_idle_sound; + +vector(float offset) hknight_shot_dir = +{ + local vector vec; +// local vector vx, vy, vz; + +// PM: The shots tend to choke up if enemy is directly above or below the +// attacking knight. Could either be a bug or working as intended. + vec = vectoangles (self.enemy.origin - self.origin); + vec_y = vec_y + offset * 6; + + makevectors (vec); +// vx = v_forward; vy = v_right; vz = v_up; + +// set missile direction + vec = normalize (v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + vec = Maim_Scatter (vec, '0 0 0'); // Added for invisibility. + +// v_forward = vx; v_right = vy; v_up = vz; + return vec; +}; + +void(float offset) hknight_shot = +{ + local vector org, vec; + + vec = hknight_shot_dir (offset); // Also calls 'makevectors'. + + if (( self.frame >= $magicb1 ) && ( self.frame <= $magicb13 )) + org = self.origin + (v_forward * 16) + (v_up * 20); + else + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + + if (self.classname == "monster_bane") + { + KnightBall_Launch (org, vec); + newmis.dmg = 60; + newmis.style = newmis.style | DF_SAFE; + newmis.velocity = vec*600; + if (( self.frame == $magicb6 ) || ( self.frame == $magicc6 )) + sound (self, CHAN_WEAPON, "weapons/mirv1.wav", 1, ATTN_NORM); + } + else if (self.classname == "monster_dark_lord") + { + NecroBolt_Launch (org, vec); + } + else + { + local float sped; + + if (cranked) + sped = 450; // PM: Faster missiles. + else + sped = 300; + Knightspike_Launch (org, vec, sped); + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + } +}; + +void() CheckForCharge = +{ +// check for mad charge + if (!enemy_vis) + return; + if (time < self.attack_finished) + return; + if ( fabs(self.origin_z - self.enemy.origin_z) > 20) + return; // too much height change + if ( vlen (self.origin - self.enemy.origin) < 80) + return; // use regular attack +//- - - - - - - - - + if (!self.fighting) + return; // PM: Don't charge if not fighting anyone. +// if (!self.enemy) +// return; // PM: In case world origin is near and in sight. +//- - - - - - - - - + +// charge +// PM: Moved self.attack_finished to the 'knight_char_*1' functions. + if (self.classname == "monster_hkboss") + { // Emulate old behavior. + self.shots_left = 3; // Replaced 'currentammo' with 'shots_*'. + hknight_char_b1 (); + return; + } + if (random() < 0.25) + { // char_b* scene has 6 frames. + self.shots_left = random() * 4; // Swing from 1 to 4 times. + self.shots_left = ceil(self.shots_left); + hknight_char_b1 (); // PM: Unused, more damaging attack anim. + } + else + hknight_char_a1 (); +}; + +// PM: Removed 'void() CheckContinueCharge'. + +//=========================================================================== +// STAND + +void() hknight_stand1 =[ $stand1, hknight_stand2 ] {ai_stand();}; +void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();}; +void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();}; +void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();}; +void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();}; +void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();}; +void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();}; +void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();}; +void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();}; + +//=========================================================================== +// WALK + +void() hk_idle_sound = +{ + if (random() < 0.2) + { + if (self.classname == "monster_bane") + { + sound (self, CHAN_VOICE, "bane/growl.wav", 1, ATTN_NORM); + return; + } + if (self.classname == "monster_dark_lord") // FIXME: Find sfx. + return; + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + } +}; + +void() hknight_walk1 =[ $walk1, hknight_walk2 ] {hk_idle_sound(); ai_walk(2);}; +void() hknight_walk2 =[ $walk2, hknight_walk3 ] {M_Step(); ai_walk(5);}; +void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);}; +void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);}; +void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);}; +void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);}; +void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);}; +void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);}; +void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);}; +void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);}; +void() hknight_walk11 =[ $walk11, hknight_walk12 ] {ai_walk(3);}; +void() hknight_walk12 =[ $walk12, hknight_walk13 ] {M_Step(); ai_walk(4);}; +void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);}; +void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);}; +void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);}; +void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);}; +void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);}; +void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);}; +void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);}; +void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// RUN + +// Checks if the Bane can use a nearby dead body. +void() bane_magicd1; +void() bane_magice1; +void(float d) hk_run = +{ + if (self.classname == "monster_bane") + { + d = d * 2; + + if (!self.waitmax) + { + if (ai_medic (d)) + { + // Hack: Set attack_finished higher than time so + // that CheckForCharge fails, which would otherwise + // bypass ritual anim. +// if ( self.frame == $run1 ) + self.attack_finished = time + 0.2; + bane_magicd1 (); + return; + } + + if (self.search_time + 5 < time) + if (self.enemy) + if (!visible (self.enemy)) + { // Teleport to the enemy. +// if ( self.frame == $run1 ) + self.attack_finished = time + 0.2; + self.search_time = time; //+ 5; + bane_magice1 (); + return; + } + } + } + ai_run (d); +}; +void() hknight_run1 =[ $run1, hknight_run2 ] {if (self.classname == "monster_dark_lord") {self.th_run(); return;}hk_idle_sound(); hk_run(20); CheckForCharge();}; +void() hknight_run2 =[ $run2, hknight_run3 ] {M_Step(); hk_run(25);}; +void() hknight_run3 =[ $run3, hknight_run4 ] {hk_run(18);}; +void() hknight_run4 =[ $run4, hknight_run5 ] {hk_run(16);}; +void() hknight_run5 =[ $run5, hknight_run6 ] {hk_run(14);}; +void() hknight_run6 =[ $run6, hknight_run7 ] {M_Step(); hk_run(25);}; +void() hknight_run7 =[ $run7, hknight_run8 ] {hk_run(21);}; +void() hknight_run8 =[ $run8, hknight_run1 ] {hk_run(13);}; + +//============================================================================ +// PAIN + +// Makes the Bane gray and ghostly. Called by 'painc' and 'magice' series. +void() bane_gray = +{ + if (self.health <= self.waitmin) + { // Set up clone magic. + self.health = self.waitmin; // Yes, reset health. + self.waitmax = // If lower than min, then max too. + self.waitmin = 0; // Cannot use clone trick again. + self.cnt = skill; // Number of clones to spawn. + if (cranked) + self.cnt = self.cnt + 1; + } + else + self.cnt = 0; + // Now the Bane becomes a phantom as he shadow walks. + self.touch = SUB_Null; // In case of jump attack. + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + self.skin = SKIN_BANE_GRAY; // Use grayscale Bane. +}; + +// Taking a hint from the axeman... +// Update: Removed 'ai_forward(6);' from first frame to stop stack overflow. +void() bane_pain1 =[ $pain1, bane_pain2 ] {}; +void() bane_pain2 =[ $pain2, bane_pain3 ] {ai_forward(8);}; +void() bane_pain3 =[ $pain4, bane_pain4 ] {ai_forward(4);}; +void() bane_pain4 =[ $pain5, hknight_run1 ] {ai_forward(2);}; + +void() bane_painb1=[ $pain1, bane_pain3 ] {}; + +// This pain makes the Bane pull the log trick from Naruto, +// only leave behind a fading image of the Bane instead of a log. +void() bane_painc1=[ $pain1, bane_magice9 ] +{ + bane_gray(); + bane_shadow(); + self.nextthink = time + 0.5; + self.modelindex = 0; + EntryPoint_Spawn (self, self.enemy, self.enemy.origin, EntryPoint_Random); +}; + +void() hknight_pain1 =[ $pain1, hknight_pain2 ] {}; // Sound already done in pain func. +void() hknight_pain2 =[ $pain2, hknight_pain3 ] {}; +void() hknight_pain3 =[ $pain3, hknight_pain4 ] {}; +void() hknight_pain4 =[ $pain4, hknight_pain5 ] {}; +void() hknight_pain5 =[ $pain5, hknight_run1 ] {}; + +void() hkfast_pain1 =[ $pain1, hknight_pain4 ] {}; + +//============================================================================ +// DEATH + +// PM: Beware -- With ai_forward on the first kill frame, T_Damage may be +// called at least twice on touch kills! +void() hknight_decap1 =[ $decap1, hknight_decap2 ] {ai_forward(10); blood_spray('-2 0 28', 1);}; +void() hknight_decap2 =[ $decap2, hknight_decap3 ] {ai_forward(8); blood_spray('-3 0 26', 2);}; +void() hknight_decap3 =[ $decap3, hknight_decap4 ] {monster_drop(); ai_forward(7); blood_spray('-3 0 17', 1);}; +void() hknight_decap4 =[ $decap4, hknight_decap5 ] {}; +void() hknight_decap5 =[ $decap5, hknight_decap6 ] {}; +void() hknight_decap6 =[ $decap6, hknight_decap7 ] {}; +void() hknight_decap7 =[ $decap7, hknight_decap8 ] {blood_spray('8 -1 11', -1);}; +void() hknight_decap8 =[ $decap8, hknight_decap9 ] {ai_forward(10);}; +void() hknight_decap9 =[ $decap9, hknight_decap10 ] {ai_forward(11);}; +void() hknight_decap10 =[ $decap10, hknight_decap11 ] {}; +void() hknight_decap11 =[ $decap11, hknight_decap12 ] {}; +void() hknight_decap12 =[ $decap12, decap_end ] {}; + +void() hknight_decapb1 =[ $decapb1, hknight_decapb2 ] {blood_spray('-3 0 33', 1);}; +void() hknight_decapb2 =[ $decapb2, hknight_decapb3 ] {blood_spray('-12 0 32', 2);}; +void() hknight_decapb3 =[ $decapb3, hknight_decapb4 ] {blood_spray('-17 0 23', 1); monster_drop();}; +void() hknight_decapb4 =[ $decapb4, hknight_decapb5 ] {blood_spray('-19 0 12', 1);}; +void() hknight_decapb5 =[ $decapb5, hknight_decapb6 ] {}; +void() hknight_decapb6 =[ $decapb6, hknight_decapb7 ] {}; +void() hknight_decapb7 =[ $decapb7, hknight_decapb8 ] {}; +void() hknight_decapb8 =[ $decapb8, hknight_decapb9 ] {}; +void() hknight_decapb9 =[ $decapb9, decap_end ] {}; + +void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);}; +void() hknight_die2 =[ $death2, hknight_die3 ] {ai_forward(8);}; +void() hknight_die3 =[ $death3, hknight_die4 ] {monster_drop(); ai_forward(7);}; +void() hknight_die4 =[ $death4, hknight_die5 ] {}; +void() hknight_die5 =[ $death5, hknight_die6 ] {}; +void() hknight_die6 =[ $death6, hknight_die7 ] {}; +void() hknight_die7 =[ $death7, hknight_die8 ] {}; +void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);}; +void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);}; +void() hknight_die10 =[ $death10, hknight_die11 ] {}; +void() hknight_die11 =[ $death11, hknight_die12 ] {}; +void() hknight_die12 =[ $death12, monster_end ] {}; + +void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {}; +void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {}; +void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] {monster_drop();}; +void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {}; +void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {}; +void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {}; +void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {}; +void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {}; +void() hknight_dieb9 =[ $deathb9, monster_end ] {}; + +float(float dm) hknight_gib = +{ +// check for gib + if (self.health < self.gib_health) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowHead ("progs/h_hellkn.mdl", dm); + return TRUE; + } + return FALSE; +}; + +void() hknight_die = +{ +// check for gib + if (Shattered ()) + return; + if (self.th_gib) + { + if (Decapitated ()) + { + if (random() < 0.5) + monster_decap ('-2 0 28', hknight_decap1); + else + monster_decap ('-3 0 33', hknight_decapb1); + return; + } + if (hknight_gib (self.health)) + return; + } + +// regular death + if (self.classname == "monster_hell_lord") + sound (self, CHAN_VOICE, "archer/death2.wav", 1, ATTN_NORM); + else if (self.classname == "monster_bane") + { + if (self.skin == SKIN_BANE_GRAY) + self.skin = SKIN_BANE; + sound (self, CHAN_VOICE, "bane/death.wav", 1, ATTN_NONE); + } + else + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) + hknight_die1 (); + else + hknight_dieb1 (); +}; + +float BANE_CHAT = 1; +float BANE_RAGE = 2; +float BANE_CLONE = 4; + +// Broadcast message to players as if the Bane was a client. +void(string text) Bane_Speaks = +{ + local entity pl; + + pl = find(world, classname, "player"); + while (pl) + { + sound (pl, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + pl = find(pl, classname, "player"); + } + bprint (text); +}; + +void() bane_die = +{ +// ... You win... for now. (Ôèå Âáîåº ®®® Ùïõ ÷éî®®® æïò îï÷®) +// ... I'll be back! (Ôèå Âáîåº ®®® Éàìì âå âáãë¡) +// ... I will return! (Ôèå Âáîåº ®®® É ÷éìì òåôõòî¡) +// ... We will meet again! (Ôèå Âáîåº ®®® ×å ÷éìì íååô áçáéî¡) +// Update: New taunts hinting of nsoe6. + if (random() < 0.5) // ... I still have the runes! + Bane_Speaks ("Ôèå Âáîåº ®®® É óôéìì èáöå ôèå òõîåó¡\n"); + else // ... You have not won yet! + Bane_Speaks ("Ôèå Âáîåº ®®® Ùïõ èáöå îïô ÷ïî ùåô¡\n"); + hknight_die (); +}; + + +//============================================================================ + +// REVIVE - - - - - - - - - - - - - - - +void() hknight_revive1 =[ $death11, hknight_revive2 ] {}; +void() hknight_revive2 =[ $death10, hknight_revive3 ] {}; +void() hknight_revive3 =[ $death9, hknight_revive4 ] {}; +void() hknight_revive4 =[ $death8, hknight_revive5 ] {}; +void() hknight_revive5 =[ $death7, hknight_revive6 ] {}; +void() hknight_revive6 =[ $death6, hknight_revive7 ] {}; +void() hknight_revive7 =[ $death5, hknight_revive8 ] {}; +void() hknight_revive8 =[ $death4, hknight_revive9 ] {}; +void() hknight_revive9 =[ $death3, hknight_revive10 ] {}; +void() hknight_revive10 =[ $death2, hknight_revive11 ] {}; +void() hknight_revive11 =[ $death1, hknight_revive12 ] {}; +void() hknight_revive12 =[ $stand1, hknight_run1 ] {}; + +void() hknight_reviveb1 =[ $deathb8, hknight_reviveb2 ] {}; +void() hknight_reviveb2 =[ $deathb7, hknight_reviveb3 ] {}; +void() hknight_reviveb3 =[ $deathb6, hknight_reviveb4 ] {}; +void() hknight_reviveb4 =[ $deathb5, hknight_reviveb5 ] {}; +void() hknight_reviveb5 =[ $deathb4, hknight_reviveb6 ] {}; +void() hknight_reviveb6 =[ $deathb3, hknight_reviveb7 ] {}; +void() hknight_reviveb7 =[ $deathb2, hknight_reviveb8 ] {}; +void() hknight_reviveb8 =[ $deathb1, hknight_revive12 ] {}; + +void() hknight_revive = +{ + if ( self.frame == $deathb9 ) + hknight_reviveb1 (); + else //if ( self.frame == $death10 ) + hknight_revive1 (); +}; + + +//============================================================================ +// BANE JUMP + +void() Bane_JumpTouch; +void(float d) hk_charge; + +// We need these first three jump frame functions in case the Bane +// needs to jump again without selecting other random attacks. +void() bane_jump1 =[ $char_a1, bane_jump2 ] {hk_charge(20); + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); +}; +void() bane_jump2 =[ $char_a2, bane_jump3 ] {hk_charge(18);}; +void() bane_jump3 =[ $char_a3, bane_jump4 ] {hk_charge(16);}; +void() bane_jump4 =[ $char_a4, bane_jump5 ] +{ + if (self.health <= 0) + {self.touch = SUB_Null; self.think = hknight_die1; return;} + + local float g; + + g = cvar("sv_gravity") / 800; + + ai_face(); + // Bane is a bbeg, so don't bother with invisibility shenanigans. + // Ditto for the dark lord. + self.touch = Bane_JumpTouch; + makevectors (self.angles); + self.velocity = (v_forward * 600) + ('0 0 250' * g); + self.flags = self.flags - (self.flags & FL_ONGROUND); +}; +// Standard demon jumps reach level ground in about 0.5 sec in normal g. +void() bane_jump5 =[ $char_a5, bane_jump6 ] {self.nextthink = time + 0.5;}; +// If three seconds pass, assume stuck then jump again. +void() bane_jump6 =[ $char_a6, bane_jump1 ] {self.nextthink = time + 3;}; +void() bane_jump7 =[ $char_a8, hknight_char_a10 ] {}; + +void() Bane_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) + return; + + if (other.takedamage) + { + if ( vlen(self.velocity) > 400 ) + { + ldmg = 40 + 10*random(); + T_Damage (other, self, self, ldmg); + if (self.health <= 0) + return; // PM: Killed by thorns (empathy shields). + if (( self.frame == $char_a4 ) || ( self.frame == $char_a5 )) + { + self.frame = $char_a6; // Go to a stab frame. + sound (self, CHAN_WEAPON, "weapons/axhit.wav", 1, ATTN_NORM); + } + } + } + + if (!checkbottom(self)) + { + if (self.flags & FL_ONGROUND) + { // jump randomly to not get hung up +//dprint ("popjump\n"); + self.touch = SUB_Null; + self.think = bane_jump1; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = bane_jump7; + self.nextthink = time + 0.1; +}; + +float() CheckBaneJump = +{ + local vector dist; + local float d; + +// FIXME: Check if jump will land on solid ground. + +// Elevation check done in CheckForCharge. +// d = self.enemy.origin_z + self.enemy.mins_z; +// if (self.origin_z + self.mins_z > d + 0.75 * self.enemy.size_z) +// return FALSE; // Target is too low. +// if (self.origin_z + self.maxs_z < d + 0.25 * self.enemy.size_z) +// return FALSE; // Target is too high. + + dist = self.enemy.origin - self.origin; + dist_z = 0; + d = vlen(dist); + if (d < 100) + return FALSE; // Target is too close. +// if (d > 200) +// if (random() < 0.9) +// return FALSE; + if (d > 1000) + return FALSE; // Target is too far away. + return TRUE; +}; + +/* DISABLED +// 8/9/10: Jumping anim. +void() hknight_jumptouch = +{ +// If it is the Bane attacking, use its attack code instead. + if (self.enemy) + if (self.enemy == other) + if ((self.classname == "monster_bane") || (self.classname == "monster_dark_lord")) + { + self.touch = Bane_JumpTouch; + Bane_JumpTouch (); + return; + } + + if (self.health <= 0) + return; + + self.touch = SUB_Null; + self.think = hknight_run6; + self.nextthink = time + 0.1; +}; +// velocity and onground assumed to be set by jump trigger. +void() hknight_jump1 =[ $char_a4, hknight_jump2 ] {self.touch = hknight_jumptouch;}; +void() hknight_jump2 =[ $char_a5, hknight_run6 ] {self.nextthink = time + 3;}; +*/ + +//============================================================================ +// BANE AI + +void() bane_strafe = +{ + if (self.classname == "monster_bane") + { + // Strafing distance was defined by movedist, which could be + // anything. Drake has removed movedist, and since this progs + // is based on Drake, set distance here. + + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); + bane_shadow (); // Shadow trails, like shadow kick. + ai_run_strafe (20); // Player walk speed. + } +}; + +void() hk_face = {ai_face(); bane_strafe();}; + +//============================================================================ +// ATTACK #1 (Modified for Lightning Airstrike) + +// Here for incidental damage in case enemy runs up to melee range while +// the sword is coming down during the magica animation. +void() magica_sword_chop = +{ + local float ldmg, side; + local vector delta; + + ai_face (); + // movement done elsewhere. + + delta = self.enemy.origin - self.origin; + + if (!InMeleeRange (80)) // 100 is too long. + return; + if (!CanDamage (self.enemy, self)) + return; + if (self.classname != "monster_bane") + if (self.classname != "monster_dark_lord") + if (IsGhost (self.enemy)) + return; // Not allowed to hit wraith. + + sound (self, CHAN_WEAPON, "weapons/axhit.wav", 1, ATTN_NORM); + makevectors (self.angles); + ldmg = 20 + 10*random(); // Player normally does 20 damage with axe. + side = crandom() * 50; + delta = (side * v_right) + (50 * v_up); + + T_NewDamage (self.enemy, self, self, ldmg, 0, "melee"); + SpawnMeatSpray (self.origin + v_forward*16, delta, self.enemy.bloodtype); +}; + +// Bane summons a thunderstorm. +void() bane_magica1 =[ $magica1, bane_magica2 ] {bane_storm( $magica1, $magica13 ); hk_face();}; +void() bane_magica2 =[ $magica2, bane_magica3 ] {hk_face();}; +void() bane_magica3 =[ $magica3, bane_magica4 ] {hk_face();}; +void() bane_magica4 =[ $magica4, bane_magica5 ] {hk_face();}; +void() bane_magica5 =[ $magica5, bane_magica6 ] {hk_face();}; +void() bane_magica6 =[ $magica6, bane_magica7 ] {hk_face();}; +void() bane_magica7 =[ $magica7, bane_magica8 ] {hk_face();}; +void() bane_magica8 =[ $magica8, bane_magica9 ] {hk_face();}; +void() bane_magica9 =[ $magica9, bane_magica10 ] {hk_face(); magica_sword_chop();}; +void() bane_magica10 =[ $magica10, hknight_magica11 ] {hk_face();}; +//void() bane_magica10 =[ $magica10, bane_magica11 ] {hk_face();}; +//void() bane_magica11 =[ $magica11, bane_magica12 ] {hk_face();}; +//void() bane_magica12 =[ $magica12, bane_magica13 ] {hk_face();}; +//void() bane_magica13 =[ $magica13, bane_magica14 ] {hk_face();}; +//void() bane_magica14 =[ $magica14, hknight_run1 ] {hk_face();}; + +void() darklord_magica1 =[ $magica1, darklord_magica2 ] {hk_face();}; +void() darklord_magica2 =[ $magica2, darklord_magica3 ] {hk_face();}; +void() darklord_magica3 =[ $magica3, darklord_magica4 ] {hk_face();}; +void() darklord_magica4 =[ $magica4, darklord_magica5 ] {hk_face();}; +void() darklord_magica5 =[ $magica5, darklord_magica6 ] {hk_face(); + ReflectorShield (self); + sound(self, 6, "items/protect.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; // Uninterruptable by this point. +}; +void() darklord_magica6 =[ $magica6, darklord_magica7 ] {hk_face();}; +void() darklord_magica7 =[ $magica7, darklord_magica8 ] {hk_face();}; +void() darklord_magica8 =[ $magica8, darklord_magica9 ] {hk_face();}; +void() darklord_magica9 =[ $magica9, darklord_magica10 ] {hk_face(); magica_sword_chop();}; +void() darklord_magica10 =[ $magica10, hknight_magica11 ] {hk_face(); + makevectors (self.angles); + M_Slam (self.origin + v_forward*46); + self.waitmin = time + 5; +}; + +// Hell Lords rain meteors down. +void() lord_meteor = {boss_meteor('50 0 100', 300, FALSE, FALSE);}; +void() lord_magica7 =[ $magica7, lord_magica8 ] {hk_face(); lord_meteor();}; +void() lord_magica8 =[ $magica8, lord_magica9 ] {hk_face(); if (skill >= 3) lord_meteor();}; +void() lord_magica9 =[ $magica9, lord_magica10 ] {hk_face(); magica_sword_chop();}; +void() lord_magica10 =[ $magica10, hknight_magica11 ] {hk_face();}; + +// Cranked Hell Knights summon a bolt of lightning as a pillar. +// Should launch a vacuum wave instead like in anime or J-style games, +// but that may not look so great in Quake. So, use lightning for now. +void() hknight_magica1 =[ $magica1, hknight_magica2 ] {hk_face();}; +void() hknight_magica2 =[ $magica2, hknight_magica3 ] {hk_face();}; +void() hknight_magica3 =[ $magica3, hknight_magica4 ] {hk_face();}; +void() hknight_magica4 =[ $magica4, hknight_magica5 ] {hk_face();}; +void() hknight_magica5 =[ $magica5, hknight_magica6 ] {hk_face();}; +void() hknight_magica6 =[ $magica6, hknight_magica7 ] {hk_face(); + if (self.classname == "monster_hell_lord") + self.think = lord_magica7; +}; +//void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);}; +//void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);}; +//void() hknight_magica9 =[ $magica9, hknight_magica10 ] {hknight_shot(0);}; +//void() hknight_magica10 =[ $magica10, hknight_magica11 ] {hknight_shot(1);}; +//void() hknight_magica11 =[ $magica11, hknight_magica12 ] {hknight_shot(2);}; +//void() hknight_magica12 =[ $magica12, hknight_magica13 ] {hknight_shot(3);}; +void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hk_face();}; +void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hk_face();}; +void() hknight_magica9 =[ $magica9, hknight_magica10 ] {hk_face(); magica_sword_chop(); M_Lightwall ();}; +void() hknight_magica10 =[ $magica10, hknight_magica11 ] {hk_face();}; +void() hknight_magica11 =[ $magica11, hknight_magica12 ] {hk_face();}; +void() hknight_magica12 =[ $magica12, hknight_magica13 ] {hk_face();}; +void() hknight_magica13 =[ $magica13, hknight_magica14 ] {hk_face();}; +void() hknight_magica14 =[ $magica14, hknight_run1 ] {hk_face();}; + +//============================================================================ +// ATTACK #2 (Modified for Fireball) + +// Hell Lords launches more magic missiles. Bane launches more fireballs. +void() lord_magicb6 =[ $magicb6, lord_magicb7 ] {hknight_shot(0); bane_strafe();}; +void() lord_magicb7 =[ $magicb7, lord_magicb8 ] {hknight_shot(-1); bane_strafe();}; +void() lord_magicb8 =[ $magicb8, lord_magicb9 ] {hknight_shot(0); bane_strafe();}; +void() lord_magicb9 =[ $magicb9, lord_magicb10 ] {hknight_shot(1); bane_strafe();}; +void() lord_magicb10 =[ $magicb10, hknight_magicb11 ] {hknight_shot(0); bane_strafe();}; + +void() darklord_magicb6 =[ $magicb6, darklord_magicb7 ] {hk_face();}; +void() darklord_magicb7 =[ $magicb7, darklord_magicb8 ] {hk_face();}; +void() darklord_magicb8 =[ $magicb8, darklord_magicb9 ] {hk_face(); hknight_shot(0); + local vector org; + + makevectors (self.angles); + org = self.origin + (v_forward*16) + (v_right*2) + (v_up*24); + MakeFancy (org, X32_STAR_RED, 2); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "plasma/fire.wav", 1, ATTN_NORM); +// SUB_AttackFinished (3); + M_Reload (3); // Three second delay before next salvo in non-NM. +}; +void() darklord_magicb9 =[ $magicb9, darklord_magicb10 ] {hk_face(); hknight_shot(-1);}; +void() darklord_magicb10 =[ $magicb10, hknight_magicb11 ] {hk_face(); hknight_shot(1);}; + +// Hell Knights launch a single fireball to the ground, like in Quoth. +void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {hk_face();}; +void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {hk_face();}; +void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {hk_face();}; +void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {hk_face();}; +void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {hk_face(); +if (self.classname == "monster_dark_lord") + {self.think = darklord_magicb6; return;} +// Update 6/18/2011: If hell knight uses this, use hell lord missiles. +if (self.classname != "monster_hkboss") + self.think = lord_magicb6; +}; +void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {hk_face();}; +//void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);}; +//void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);}; +//void() hknight_magicb9 =[ $magicb9, hknight_magicb10 ] {hknight_shot(0);}; +//void() hknight_magicb10 =[ $magicb10, hknight_magicb11 ] {hknight_shot(1);}; +//void() hknight_magicb11 =[ $magicb11, hknight_magicb12 ] {hknight_shot(2);}; +//void() hknight_magicb12 =[ $magicb12, hknight_magicb13 ] {hknight_shot(3);}; +void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hk_face();}; +void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hk_face();}; +void() hknight_magicb9 =[ $magicb9, hknight_magicb10 ] {hk_face(); +// if (self.classname == "monster_hkboss") + M_Shal30 ('12 2 24'); // Vore bomb as in Rapture (and others). +// else +// M_FireKnight ('12 2 24', TRUE); +}; +void() hknight_magicb10 =[ $magicb10, hknight_magicb11 ] {hk_face();}; +void() hknight_magicb11 =[ $magicb11, hknight_magicb12 ] {hk_face();}; +void() hknight_magicb12 =[ $magicb12, hknight_magicb13 ] {hk_face();}; +void() hknight_magicb13 =[ $magicb13, hknight_run1 ] {hk_face(); +if (self.classname == "monster_dark_lord") + SUB_CheckRefire (hknight_magicb1); +}; + +//============================================================================ +// ATTACK #3 (Standard) + +void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {hk_face();}; +void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {hk_face();}; +void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {hk_face();}; +void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {hk_face();}; +void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {hk_face();}; +void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2); bane_strafe();}; +void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1); bane_strafe();}; +void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0); bane_strafe();}; +void() hknight_magicc9 =[ $magicc9, hknight_magicc10 ] {hknight_shot(1); bane_strafe();}; +void() hknight_magicc10 =[ $magicc10, hknight_magicc11 ] {hknight_shot(2); bane_strafe();}; +void() hknight_magicc11 =[ $magicc11, hknight_run1 ] {hknight_shot(3); bane_strafe();}; + +//============================================================================ +// ATTACK #4 (Firewall -- Used by Hell Lords) +void() hknight_magicd1 =[ $magica1, hknight_magicd2 ] {hk_face();}; +void() hknight_magicd2 =[ $magica14, hknight_magicd3 ] {hk_face();}; +void() hknight_magicd3 =[ $magica13, hknight_magicd4 ] {hk_face();}; +void() hknight_magicd4 =[ $magica12, hknight_magicd5 ] {hk_face();}; +void() hknight_magicd5 =[ $magica11, hknight_magicd6 ] {hk_face(); sound (self, CHAN_WEAPON, "weapons/fwalltap.wav", 1, ATTN_NORM);}; +void() hknight_magicd6 =[ $magica10, hknight_magicd7 ] {hk_face();}; +void() hknight_magicd7 =[ $magica9, hknight_magicd8 ] {hk_face(); M_Firewall();}; +void() hknight_magicd8 =[ $magica8, hknight_magicd9 ] {hk_face();}; +void() hknight_magicd9 =[ $magica4, hknight_magicd10 ] {hk_face();}; +void() hknight_magicd10 =[ $magica3, hknight_magicd11 ] {hk_face();}; +void() hknight_magicd11 =[ $magica2, hknight_magicd12 ] {hk_face();}; +void() hknight_magicd12 =[ $magica1, hknight_run1 ] {hk_face();}; + +//============================================================================ +// ATTACK #5 (Wrath Summoning -- Used by Dark Lords) + +void() monster_wrath; +void() wrath_grow1; + +// FIXME: Wrath summoning uses old code that needs updating. +void() dk_shield; +void() darklord_magicd1 =[ $magica1, darklord_magicd2 ] {hk_face();}; +void() darklord_magicd2 =[ $magica14, darklord_magicd3 ] {hk_face();}; +void() darklord_magicd3 =[ $magica13, darklord_magicd4 ] {hk_face();}; +void() darklord_magicd4 =[ $magica12, darklord_magicd5 ] {hk_face();}; +void() darklord_magicd5 =[ $magica11, darklord_magicd6 ] {hk_face();}; +void() darklord_magicd6 =[ $magica10, darklord_magicd7 ] {hk_face();}; +void() darklord_magicd7 =[ $magica9, hknight_magicd8 ] {hk_face(); SpawnMonster_Horde(ID_MP2_WRATH, 3); dk_shield();}; + +//============================================================================ +// ATTACK #6 (Monster Resurrection -- Bane exclusive) + +void() bane_magicd1 =[ $magica1, bane_magicd2 ] {ai_ritual();}; +void() bane_magicd2 =[ $magica14, bane_magicd3 ] {ai_ritual();}; +void() bane_magicd3 =[ $magica13, bane_magicd4 ] {ai_ritual();}; +void() bane_magicd4 =[ $magica12, bane_magicd5 ] {ai_ritual();}; +void() bane_magicd5 =[ $magica11, bane_magicd6 ] {ai_ritual();}; +void() bane_magicd6 =[ $magica10, bane_magicd7 ] {ai_ritual();}; +void() bane_magicd7 =[ $magica9, bane_magicd8 ] {ai_ritual();}; +void() bane_magicd8 =[ $magica8, bane_magicd12 ] {ai_ritual(); self.fallen = world;}; +//void() bane_magicd9 =[ $magica7, bane_magicd10 ] {}; +//void() bane_magicd10 =[ $magica6, bane_magicd11 ] {}; +//void() bane_magicd11 =[ $magica5, bane_magicd12 ] {}; +void() bane_magicd12 =[ $magica4, bane_magicd13 ] {}; +void() bane_magicd13 =[ $magica3, bane_magicd14 ] {}; +void() bane_magicd14 =[ $magica2, bane_magicd15 ] {}; +void() bane_magicd15 =[ $magica1, hknight_run1 ] {}; + +//============================================================================ +// ATTACK #7 (Teleportation and Cloning -- also Bane exclusive) + +void() bane_magice1 =[ $magicb1, bane_magice2 ] {bane_gray(); hk_face();}; +void() bane_magice2 =[ $magicb2, bane_magice3 ] {hk_face();}; +void() bane_magice3 =[ $magicb3, bane_magice4 ] {hk_face();}; +void() bane_magice4 =[ $magicb4, bane_magice5 ] {hk_face();}; +void() bane_magice5 =[ $magicb5, bane_magice6 ] {hk_face();}; +void() bane_magice6 =[ $magicb6, bane_magice7 ] {hk_face();}; +void() bane_magice7 =[ $magicb7, bane_magice8 ] {hk_face();}; +void() bane_magice8 =[ $magicb8, bane_magice9 ] {hk_face(); +// Disappear then teleport. + self.nextthink = time + 1; + self.modelindex = 0; + if (self.cnt > 0) + EntryPoint_Spawn (self, self, self.origin, EntryPoint_Random); + else + { if (!EntryPoint_Spawn (self, self.enemy, self.enemy.origin, EntryPoint_LongRandom)) + EntryPoint_Spawn (self, self, self.origin, EntryPoint_Random); + } +}; +void() bane_magice9 =[ $magicb8, bane_magice10 ] {self.alpha = 0.2; + self.modelindex = self.mindex2; + hk_face(); + if (self.cnt > 0) + { + self.cnt = self.cnt - 1; // Do before cloning. + // Don't let the clones spawn more clones. + if (self.master.classname != self.classname) + clone_spawn(); // Only the master can clone himself. + } +}; +void() bane_magice10 =[ $magicb8, bane_magice11 ] {self.alpha = 0.4; hk_face();}; +void() bane_magice11 =[ $magicb9, bane_magice12 ] {self.alpha = 0.6; hk_face();}; +void() bane_magice12 =[ $magicb10, bane_magice13 ] {self.alpha = 0.8; hk_face();}; +void() bane_magice13 =[ $magicb11, bane_magice14 ] {self.alpha = 0; hk_face(); + if (self.cnt < 1) + { if (walkmove (0, 0)) + { + self.takedamage = DAMAGE_AIM; + self.solid = SOLID_SLIDEBOX; + self.skin = SKIN_BANE; + // Last minute feature: The Bane speaks! + if (!self.master) + if (self.height) + { + if (self.height & BANE_CLONE) + { + if (random() < 0.5) // Die, maggot! + Bane_Speaks ("Ôèå Âáîåº Äéå¬ íáççïô¡\n"); + else // Now die! + Bane_Speaks ("Ôèå Âáîåº Îï÷ äéå¡\n"); + } + else if (self.height & BANE_RAGE) + { + if (random() < 0.5) // Behold my power! + Bane_Speaks ("Ôèå Âáîåº Âåèïìä¬ íù ðï÷åò¡\n"); + else // Feel my wrath! + Bane_Speaks ("Ôèå Âáîåº Æååì íù ÷òáôè¡\n"); + } + self.height = BANE_CHAT; + } + return; + } + } +// Either not done cloning, or unable to move at current location. +// Either way, use dimensional travel magic again. + self.think = bane_magice8; +}; +void() bane_magice14 =[ $magicb12, bane_magice15 ] {hk_face();}; +void() bane_magice15 =[ $magicb13, hknight_run1 ] {hk_face();}; + +//=========================================================================== + +void() hknight_magic = +{ +// if (cranked && (random() < 0.25)) +// hknight_magica1 (); +// else + hknight_magicc1 (); +}; + +void() lord_magic = +{ + local float r; + local float add, opt; + + add = 1; + opt = 2; + + if (M_FirewallCheck ()) // In fire.qc. + opt = opt + 1; + // Using 50 and 100 as sides of a right triangle, hypotenuse is 111.8. + if (M_MeteorCheck ('50 0 112')) // In boss.qc. Was '50 -50 100'. + {add = 0; opt = opt + 1;} + + r = random() * opt + add; + if (r <= 1) + hknight_magica1 (); // Meteor + else if (r <= 2) + hknight_magicb1 (); // Magic missile straight + else if (r <= 3) + hknight_magicc1 (); // Magic missile spread + else + hknight_magicd1 (); // Firewall +}; + +// FIXME: Is this done aside from missing corpse scan/use? +void() darklord_magic = +{ +// Todo: +// If close, use slam, charge, or melee. +// else, shoot or summon. + local float dist; + +// FIXME: Check for corpses to make wraths from. +// if (self.pets < skill) +// if (random() < 0.1) +// if (random() < (skill - self.pets) * 0.1) + if (self.spawnflags & 2) + if (self.pets < 1) + if (self.waitmax < time) + {darklord_magicd1 (); return;} + +// Attacking... + dist = vlen(self.enemy.origin - self.origin); + if (dist <= DARKLORD_NEAR) + { + if (self.waitmin < time) + {darklord_magica1(); return;} // Thor's hand. + CheckForCharge (); + if (( self.frame == $char_a1 ) || ( self.frame == $char_b1 )) + return; + } + hknight_magicb1 (); // Magic missile straight +}; + +void() hkboss_magic = +{ +// Pattern: 1 pillar, 2 bombs, 1 spray. +// Old behavior should be magica->magicb->magicc, but it seemed to favor B? + local float r; + + r = AddOne() & 3; + if (!r) + hknight_magica1 (); + else if (r != 3) + hknight_magicb1 (); + else + hknight_magicc1 (); +}; + +void() bane_magic = +{ +// PM: Jumping done at charge anim. However... +// If enemy is low enough that CheckForCharge would abort, then we can +// check for jumping. We want the Bane to occasionally jump down toward +// the enemy, much like old SoE. +// Update: If enemy is above, try to teleport to higher ground occasionally. + if (random() < 0.25) + if (CheckBaneJump ()) + { + if (self.origin_z - self.enemy.origin_z > 20) + {bane_jump1 (); return;} + if (!self.waitmax) // Only if using new AI. + if (self.enemy.origin_z - self.origin_z > 20) + {bane_magice1 (); return;} + } + +// Check for thunderstorm. + if (!self.waitmax) + if (skill >= 1) + if (!bane_has_storm ()) + if (random() < 0.5) + if (UpIsSky (self.enemy.origin)) + {bane_magica1 (); return;} // Start a thunderstorm! + +// Spray some fireballs. + if (random() <= 0.5) + hknight_magicb1 (); + else + hknight_magicc1 (); +}; + +//=========================================================================== + +void(float side) bane_melee = +{ + if (self.classname != "monster_bane") + if (self.classname != "monster_dark_lord") + return; + + local float ldmg; + local vector delta; + + ai_face (); + // movement done elsewhere. + + delta = self.enemy.origin - self.origin; + + if (!InMeleeRange (80)) // 100 is too long. + return; + if (!CanDamage (self.enemy, self)) + return; + // Let the Bane hit ghosts. He's just that badass. + // Update: Dark Lord is Bane-Lite, at least in human form... + + sound (self, CHAN_WEAPON, "bane/hit.wav", 1, ATTN_NORM); + makevectors (self.angles); + ldmg = 10 + 5*random(); + if (side) + delta = side * v_right; + else + { + side = crandom() * 50; + delta = (side * v_right) + (50 * v_up); + } + + T_NewDamage (self.enemy, self, self, ldmg, DF_SCAR, "vorpal"); + SpawnMeatSpray (self.origin + v_forward*16, delta, self.enemy.bloodtype); +}; + +void(float d) hk_charge = +{ + if ((self.classname == "monster_bane") || (self.classname == "monster_dark_lord")) + { + local float dist; + + dist = d * 2; + if (!QC_CloseEnough (dist)) + d = dist; // Move double speed. + } + ai_charge (d); +}; +// PM: Added sounds like in my old Cranked mod. +void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] +{ +// PM: Don't use 'SUB_AttackFinished' because it won't be set on Nightmare, +// which results in a charge lock for the knight. In other words, don't let +// him forget his magic. + self.attack_finished = time + 2; //SUB_AttackFinished (2); + hk_charge(20); + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); +}; +void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {M_Step(); hk_charge(25);}; +void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {hk_charge(18);}; +void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] +{ +// The bane may jump instead. Now is the best time to check. +// Update 3/27/09: Allow dark lord the priviledge too. + if ((self.classname == "monster_bane") || (self.classname == "monster_dark_lord")) + if (CheckBaneJump ()) + if (random() < 0.5) + { + bane_jump4 (); + return; + } + hk_charge(16); +}; +void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {hk_charge(14);}; +void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {M_Step(); hk_charge(20); bane_melee(0); ai_melee();}; +void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {hk_charge(21); ai_melee();}; +void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {hk_charge(13); ai_melee();}; +void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {hk_charge(20); ai_melee();}; +void() hknight_char_a10 =[ $char_a10, hknight_char_a11 ] {M_Step(); hk_charge(20); ai_melee();}; +void() hknight_char_a11 =[ $char_a11, hknight_char_a12 ] {hk_charge(18); ai_melee();}; +void() hknight_char_a12 =[ $char_a12, hknight_char_a13 ] {hk_charge(16); + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + bane_melee(200); +}; +void() hknight_char_a13 =[ $char_a13, hknight_char_a14 ] {hk_charge(14);}; +void() hknight_char_a14 =[ $char_a14, hknight_char_a15 ] {M_Step(); hk_charge(25);}; +void() hknight_char_a15 =[ $char_a15, hknight_char_a16 ] {hk_charge(21);}; +void() hknight_char_a16 =[ $char_a16, hknight_run1 ] {hk_charge(13);}; + +//=========================================================================== + +void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] +{ + self.attack_finished = time + 1; // PM: Don't use SUB_AttackFinished. + knight_sword_sound(); M_Step(); hk_charge(23); bane_melee(0); ai_melee(); +}; +void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {hk_charge(17); ai_melee();}; +void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {hk_charge(12); ai_melee();}; +void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {M_Step(); hk_charge(22); ai_melee();}; +void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {hk_charge(18); ai_melee();}; +void() hknight_char_b6 =[ $char_b6, hknight_run1 ] {hk_charge(8); ai_melee(); + if (vlen (self.origin - self.enemy.origin) < 80) + self.shots_left = 0; // Close enough for melee. + else + { + self.shots_left = self.shots_left - 1; + if (self.shots_left > 0) + self.think = hknight_char_b1; + } +}; + +//=========================================================================== + +void() bane_slice1 =[ $slice1, bane_slice2 ] {hk_charge(9);}; +void() bane_slice2 =[ $slice3, bane_slice3 ] {M_Step(); hk_charge(19);}; +void() bane_slice3 =[ $slice5, bane_slice4 ] {hk_charge(11); bane_melee(-200); ai_melee();}; +void() bane_slice4 =[ $slice6, bane_slice5 ] {hk_charge(15); ai_melee();}; +void() bane_slice5 =[ $slice7, bane_slice6 ] {M_Step(); hk_charge(8); ai_melee();}; +void() bane_slice6 =[ $slice9, bane_slice7 ] {hk_charge(2); ai_melee();}; +void() bane_slice7 =[ $slice10, hknight_run1 ] {hk_charge(3);}; + +void() hknight_slice1 =[ $slice1, hknight_slice2 ] {hk_charge(9);}; +void() hknight_slice2 =[ $slice2, hknight_slice3 ] {hk_charge(6);}; +void() hknight_slice3 =[ $slice3, hknight_slice4 ] {M_Step(); hk_charge(13);}; +void() hknight_slice4 =[ $slice4, hknight_slice5 ] {hk_charge(4);}; +void() hknight_slice5 =[ $slice5, hknight_slice6 ] {hk_charge(7); bane_melee(-200); ai_melee();}; +void() hknight_slice6 =[ $slice6, hknight_slice7 ] {hk_charge(15); ai_melee();}; +void() hknight_slice7 =[ $slice7, hknight_slice8 ] {M_Step(); hk_charge(8); ai_melee();}; +void() hknight_slice8 =[ $slice8, hknight_slice9 ] {hk_charge(2); ai_melee();}; +void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();}; +void() hknight_slice10 =[ $slice10, hknight_run1 ] {hk_charge(3);}; + +//=========================================================================== + +void() bane_smash1 =[ $smash2, bane_smash2 ] {hk_charge(14);}; +void() bane_smash2 =[ $smash4, bane_smash3 ] {M_Step(); hk_charge(20);}; +void() bane_smash3 =[ $smash5, bane_smash4 ] {hk_charge(10); bane_melee(0); ai_melee();}; +void() bane_smash4 =[ $smash6, bane_smash5 ] {hk_charge(7); ai_melee();}; +void() bane_smash5 =[ $smash7, bane_smash6 ] {hk_charge(12); ai_melee();}; +void() bane_smash6 =[ $smash8, bane_smash7 ] {hk_charge(2); ai_melee();}; +void() bane_smash7 =[ $smash9, bane_smash8 ] {M_Step(); hk_charge(3); ai_melee();}; +void() bane_smash8 =[ $smash11, hknight_run1 ] {hk_charge(0);}; + +void() hknight_smash1 =[ $smash1, hknight_smash2 ] {hk_charge(1);}; +void() hknight_smash2 =[ $smash2, hknight_smash3 ] {hk_charge(13);}; +void() hknight_smash3 =[ $smash3, hknight_smash4 ] {hk_charge(9);}; +void() hknight_smash4 =[ $smash4, hknight_smash5 ] {M_Step(); hk_charge(11);}; +void() hknight_smash5 =[ $smash5, hknight_smash6 ] {hk_charge(10); bane_melee(0); ai_melee();}; +void() hknight_smash6 =[ $smash6, hknight_smash7 ] {hk_charge(7); ai_melee();}; +void() hknight_smash7 =[ $smash7, hknight_smash8 ] {hk_charge(12); ai_melee();}; +void() hknight_smash8 =[ $smash8, hknight_smash9 ] {hk_charge(2); ai_melee();}; +void() hknight_smash9 =[ $smash9, hknight_smash10 ] {M_Step(); hk_charge(3); ai_melee();}; +void() hknight_smash10 =[ $smash10, hknight_smash11 ] {hk_charge(0);}; // Skipped in Neh. +void() hknight_smash11 =[ $smash11, hknight_run1 ] {hk_charge(0);}; + +//============================================================================ + +void() bane_watk1 =[ $w_attack1, bane_watk2 ] {hk_charge(2);}; +void() bane_watk2 =[ $w_attack5, bane_watk3 ] {bane_melee(0); ai_melee();}; +void() bane_watk3 =[ $w_attack7, bane_watk4 ] {hk_charge(1);}; +void() bane_watk4 =[ $w_attack8, bane_watk5 ] {hk_charge(4);}; +void() bane_watk5 =[ $w_attack9, bane_watk6 ] {hk_charge(5);}; +void() bane_watk6 =[ $w_attack10, bane_watk7 ] {hk_charge(3); ai_melee();}; +void() bane_watk7 =[ $w_attack11, bane_watk8 ] {M_Step(); hk_charge(2); ai_melee();}; +void() bane_watk8 =[ $w_attack13, bane_watk9 ] {hk_charge(2); ai_melee();}; +void() bane_watk9 =[ $w_attack14, bane_watk10 ] {hk_charge(0);}; +void() bane_watk10 =[ $w_attack16, bane_watk11 ] {hk_charge(1); + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +}; +void() bane_watk11 =[ $w_attack18, bane_watk12 ] {hk_charge(4); bane_melee(200); ai_melee();}; +void() bane_watk12 =[ $w_attack19, bane_watk13 ] {hk_charge(4); ai_melee();}; +void() bane_watk13 =[ $w_attack20, bane_watk14 ] {hk_charge(6);}; +void() bane_watk14 =[ $w_attack22, hknight_run1] {hk_charge(10);}; + +// Nehahra skipped every even frame in the scene. +void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {hk_charge(2);}; +void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {hk_charge(0);}; +void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {hk_charge(0);}; +void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {ai_melee();}; +void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_melee();}; +void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_melee();}; +void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {hk_charge(1);}; +void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {hk_charge(4);}; +void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {hk_charge(5);}; +void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {hk_charge(3); bane_melee(0); ai_melee();}; +void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {M_Step(); hk_charge(2); ai_melee();}; +void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {hk_charge(2); ai_melee();}; +void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {hk_charge(0);}; +void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {hk_charge(0);}; +void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {hk_charge(0); + // PM: Something from my old Cranked mod. + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +}; +void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {hk_charge(1);}; +void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {hk_charge(1); bane_melee(200); ai_melee();}; +void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {hk_charge(3); ai_melee();}; +void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {hk_charge(4); ai_melee();}; +void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {hk_charge(6);}; +void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {hk_charge(7);}; +void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {hk_charge(3);}; + +//============================================================================ + +void(entity attacker, float damage) hknight_pain = +{ + if (self.pain_finished > time) + return; + + if (self.classname == "monster_hell_lord") + sound (self, CHAN_VOICE, "archer/pain2.wav", 1, ATTN_NORM); + else if (self.classname == "monster_dark_lord") + sound (self, CHAN_VOICE, "darklord/pain.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; + + // Removed mandatory pain anim after five seconds. + + if (random()*30 > damage) + return; // didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + if (self.classname == "monster_dark_lord") + { + if (self.lip > time) + return; // Too soon to flinch. + self.lip = time + 3; // Give him time to use magic. + + self.waitmax = 0; // Raise shield again ASAP! + + if (!self.mirror_finished) + self.effects = self.effects - (self.effects & EF_BRIGHTFIELD); + } + +// Update: Quicker pain for lords. + if ((self.classname == "monster_hell_lord") || (self.classname == "monster_dark_lord")) + if (random() < 0.5) + {hkfast_pain1 (); return;} + + hknight_pain1 (); + attacker = attacker; // FrikQcc warning squelch! +}; + +void(entity attacker, float damage) bane_pain = +{ +// Shadow clone magic check. + if (!self.waitmax) + { + if (self.health <= self.waitmin) // Does Bane have the ace in the hole? + if ((self.enemy == attacker) || (self.oldenemy == attacker)) // Is Bane fighting his enemy? + if (self.touch != Bane_JumpTouch) // Is Bane not locked in motion? + if (self.classname != self.master.classname) // Is Bane real? + if (walkmove (0, 0)) // Can the Bane move? + { //"Bushin no Kage!\n" + if (self.height) + self.height = self.height | BANE_CLONE; + sound (self, CHAN_VOICE, "bane/pain.wav", 1, ATTN_NORM); + // Cloning will take a while, so no need to add to pain_finished. + bane_painc1(); + return; + } + } + else + { + if (self.health <= self.waitmax) + if (self.touch != Bane_JumpTouch) // Is Bane not locked in motion? + if (self.classname != self.master.classname) // Is Bane real? + if (walkmove (0, 0)) // Can the Bane move? + { // The kid gloves come off. + self.health = self.waitmax; + self.waitmax = 0; + if (self.height) + self.height = self.height | BANE_RAGE; + sound (self, CHAN_VOICE, "bane/pain.wav", 1, ATTN_NORM); + bane_painc1(); + return; + } + } +//- - - - - - - - - + +// Normal pain code. + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, "bane/pain.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.touch == Bane_JumpTouch) + return; // Don't interrupt attack anim. +//- - - - - - - - - +// Teleport check. + if (!self.waitmax) + if (self.enemy) + if (walkmove (0, 0)) + { + // If caught in deadly environment, warp out! + if (self.h2otype <= CONTENT_SLIME) + if (!attacker) // Attacker is world when damaged by slime/lava. + {bane_painc1 (); return;} + // Warp occasionally. + if (random() < 0.1) + {bane_painc1 (); return;} + } +//- - - - - - - - - + if (random()*30 > damage) + return; // didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + if (random() < 0.5) + bane_pain1 (); + else + bane_painb1 (); +}; + +// Update 1/7/10: Moved hknight_type to globals.qc. + +void() hknight_melee = +{ + local float fast; + + hknight_type = hknight_type + 1; + + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); + fast = 1; + if (!SUB_QuickAttack ()) + if (self.classname == "monster_hell_knight") + fast = 0; + if (fast) + { + if (hknight_type == 1) + bane_slice1 (); + else if (hknight_type == 2) + bane_smash1 (); + else if (hknight_type == 3) + { + bane_watk1 (); + hknight_type = 0; + } + return; + } + + if (hknight_type == 1) + hknight_slice1 (); + else if (hknight_type == 2) + hknight_smash1 (); + else if (hknight_type == 3) + { + hknight_watk1 (); + hknight_type = 0; + } +}; + +//============================================================================== + +void() bane_win = +{ +// Update: Changed from ATTN_NORM to ATTN_NONE for level-wide low laugh. + sound (self, CHAN_VOICE, "bane/laugh.wav", 1, ATTN_NONE); +// DISABLED -- Player can't really listen if he's dead. +// if (self.height) +// if (!self.master) // Death is only the beginning. +// bprint ("Ôèå Âáîåº Äåáôè éó ïîìù ôèå âåçéîîéîç®\n"); + + monster_sow (); +}; + +void() bane_void = +{ + monster_void (); + sound (self, CHAN_VOICE, "bane/death.wav", 1, ATTN_NONE); +}; + +void(float hello) bane_sight = +{ + if (!hello) + sound (self, CHAN_VOICE, "bane/sight.wav", 1, 0.5); +}; +void(float hello) bane_hello = +{ + if (self.enemy.classname == "player") + { + if (world.model == "maps/soe1m5.bsp") + { // Thou dare challenge me?! + Bane_Speaks ("Ôèå Âáîåº Ôèïõ äáòå ãèáììåîçå íå¿¡\n"); + } + else + { + if (random() < 0.5) // Vengeance shall be mine! + Bane_Speaks ("Ôèå Âáîåº Öåîçåáîãå óèáìì âå íéîå¡\n"); + else // Welcome to thy doom! + Bane_Speaks ("Ôèå Âáîåº ×åìãïíå ôï ôèù äïïí¡\n"); + } + self.th_sight = bane_sight; + } + bane_sight (hello); +}; + +void(float hello) lord_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "archer/sight2.wav", 1, ATTN_NORM); +}; + +void(float hello) hknight_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "hknight/sight1.wav", 1, ATTN_NORM); +}; + +// Files common to all of the hell knight variants. +void() hk_cache = +{ + precache_model ("progs/hknight.mdl"); + precache_model ("progs/k_spike.mdl"); + precache_model ("progs/h_hellkn.mdl"); + + precache_sound ("hknight/attack1.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound ("hknight/slash1.wav"); + precache_sound ("hknight/idle.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + +// precache_sound ("hknight/death1.wav"); +// precache_sound ("hknight/pain1.wav"); +// precache_sound ("hknight/sight1.wav"); +}; + +// Classic, standard hell knight. +void() hknight_cache = +{ + hk_cache (); + + precache_sound ("hknight/death1.wav"); + precache_sound ("hknight/pain1.wav"); + precache_sound ("hknight/sight1.wav"); +}; + +// Tougher and meaner red version with fire magic. +void() hklord_cache = +{ + hk_cache (); + + precache_model ("progs/lavaball.mdl"); + + // Borrow sounds from archer lords. + // Update: Don't use growl2.wav or growl3.wav. + precache_sound ("archer/death2.wav"); + precache_sound ("archer/pain2.wav"); + precache_sound ("archer/sight2.wav"); + precache_sound ("boss1/throw.wav"); + precache_sound ("weapons/fwall.wav"); + precache_sound ("weapons/fwallhit.wav"); + precache_sound ("weapons/fwalltap.wav"); +}; + +// For Rapture's hkboss. +void() hkboss_cache = +{ + hknight_cache (); + + precache_model ("progs/v_spike.mdl"); // Used by hkboss. + precache_sound ("hkboss/iceball.wav"); // Used by hkboss. +}; + +// Prototypes... +void() monster_axeman; +//============ +// QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush Lord +//============ +void() monster_hell_knight = +{ + local float look; + +// SoE: sf 1 upgrades, sf 2 is ambush. + if (!respawning) + { + if (soul_evil) + { + look = self.spawnflags & 1; + if (look) + { + self.spawnflags = self.spawnflags - 1; + if (self.classname != "monster_hkboss") + self.classname = "monster_hell_lord"; + } + if (self.spawnflags & 2) + self.spawnflags = (self.spawnflags - 2) | 1; +//- - - - - - - - - +// SoE Indian Summer Hack. + if (look) + { // nsoe1 and nsoe2 have too many Hell Lords -- downgrade some of them! + if (world.model == "maps/nsoe1.bsp") + { + AddOne(); // Also called by item_health -- gross! + if ((gloat == 2) || (gloat == 3)) // First two knights. + self.classname = "monster_hell_knight"; + else if ((gloat == 8) || (gloat == 9)) + { // No lords on Easy. + if (cvar("skill") == 0) + self.classname = "monster_hell_knight"; + } + else if (gloat == 12) + {self.classname = "monster_axeman"; monster_axeman(); return;} + } + else if (world.model == "maps/nsoe2.bsp") + { + AddOne(); + if ((gloat == 13) || (gloat == 14)) // Near Sha'Vile. + {self.classname = "monster_axeman"; monster_axeman(); return;} + // 1 = City entrance, 4-5 = Outside near nailgun, 16-17 = Chapel + if ((gloat == 0) || (gloat == 1) || (gloat == 4) || (gloat == 5) || + (gloat == 16) || (gloat == 17)) + self.classname = "monster_hell_knight"; + } + } +//- - - - - - - - - + } + else + { + if (self.spawnflags & 2) + if (self.classname != "monster_hkboss") + self.classname = "monster_hell_lord"; + } + } +//- - - - - - - - - + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + if (self.classname == "monster_hkboss") + hkboss_cache (); + else if (self.classname == "monster_hell_lord") + hklord_cache (); + else + hknight_cache (); + } + + if (self.classname == "monster_hell_lord") + { + if (soul_evil) + monster_purse (3, 0.75, 0.25); + self.skin = SKIN_HELL_LORD; + self.th_missile = lord_magic; + self.th_sight = lord_sight; + // Originally 500 health, too much. + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 400, -40); + } + else if (self.classname == "monster_hkboss") + { + if (soul_evil) + monster_purse (5, 0.75, 0.25); + self.skin = SKIN_HKBOSS; + self.th_missile = hkboss_magic; + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 900, -40); + } + else + { + if (soul_evil) + { + monster_purse (3, 0.5, 0); + self.skin = (random() * 2) & 1; + } + else + self.skin = self.skin & 1; // First two only. + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 250, -40); + } + self.mdl_head = "progs/h_hellkn.mdl"; + self.mass = MASS_MEDIUM; + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = hknight_run1; + if (!self.th_missile) + self.th_missile = hknight_magic; // Was 'hknight_magicc1' + self.th_melee = hknight_melee; + self.th_pain = hknight_pain; + self.th_die = hknight_die; + //- - - - - - - - +// self.th_jump = hknight_jump1; + if (!self.th_sight) + self.th_sight = hknight_sight; + self.th_revive = hknight_revive; + self.th_gib = hknight_gib; + self.th_spawn = monster_hell_knight; + + self.family = FAM_BANE; + self.xfl = XFL_ARMORED; + self.hittype = HIT_METAL; + + monster_start (); +}; + +void() monster_hell_lord = {monster_hell_knight ();}; +void() monster_lord = + {self.classname = "monster_hell_lord"; monster_hell_knight ();}; + +// For Rapture. +void() monster_hkboss = {monster_hell_knight ();}; + +//========================================================================== +// The Bane (SoE Big Bad Evil Guy, Hell Knight boss variant) +//========================================================================== +float() BaneCheckAttack = +{ +// Here so Bane can destroy downed zombies and what not. + if (enemy_range == RANGE_MELEE) + if (infront (self.enemy)) + if (CanDamage (self.enemy, self)) + {self.th_melee (); return TRUE;} + +// Use bog standard. + return CheckAttack(); +}; + +// In case Bane gets aggravated during teleportation... +void() bane_run = +{ + if (self.skin == SKIN_BANE_GRAY) + bane_painc1 (); // Restart shadow walk. + else + hknight_run1 (); +}; + +void() bane_cache = +{ +// Bane - - - - - - + precache_model ("progs/hknight.mdl"); + precache_model ("progs/drake/k_ball.mdl"); // Bane fireball. + precache_model ("progs/h_hellkn.mdl"); + + precache_sound ("ambience/thunder1.wav"); + precache_sound ("ambience/thunder2.wav"); + precache_sound ("bane/death.wav"); + precache_sound ("bane/growl.wav"); + precache_sound ("bane/hit.wav"); + precache_sound ("bane/laugh.wav"); + precache_sound ("bane/pain.wav"); + precache_sound ("bane/sight.wav"); + precache_sound ("bane/thunder.wav"); + precache_sound ("hknight/slash1.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("misc/dsslop.wav"); + precache_sound ("weapons/axhit.wav"); +//- - - - - - - - - +}; + +void() monster_bane = +{ + local float sklv; + + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + bane_cache (); + } + + // Update: Make it very hard but possible to gib/behead the Bane. + self.skin = SKIN_BANE; + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 2000, -90); + self.mdl_head = "progs/h_hellkn.mdl"; + self.mass = MASS_MEDIUM; + sklv = cvar("skill"); + if (sklv < 1) + self.waitmin = self.waitmax = -1; // No clones or rage on Easy. + else if (sklv < 2) + { + self.waitmin = floor(self.health / 4); // Clones with 500 health. + self.waitmax = floor(self.health / 2); // Rage at half hp. + } + else + { + self.waitmax = self.health / 3; + self.waitmin = floor(self.waitmax); // Clones with 666 health. + self.waitmax = floor(self.waitmax * 2); // Rage at 66% hp. + } + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = bane_run; //hknight_run1; + self.th_missile = bane_magic; + self.th_melee = hknight_melee; + self.th_pain = bane_pain; + self.th_die = hknight_die; + //- - - - - - - - +// self.th_jump = hknight_jump1; + self.th_sight = bane_sight; + self.th_check = BaneCheckAttack; + self.th_gib = hknight_gib; + self.th_win = bane_win; + self.th_void = bane_void; + self.th_spawn = monster_bane; + +// SoE Hack: Disable the Bane's new powers in soe1m5. + self.height = 0; + if (!self.spawned) + { + if (self.spawnflags & 2) + { + self.height = BANE_CHAT; // The Bane speaks! + self.waitmin = self.waitmax = -1; // No clones or rage. + self.th_sight = bane_hello; + } + else if (world.model == "maps/nsoe5.bsp") + { + self.height = BANE_CHAT; // The Bane speaks! + self.th_die = bane_die; + self.th_sight = bane_hello; + } + } + + self.family = FAM_BANE; + self.xfl = XFL_ARMORED | XFL_BOSS; // Don't dare hit the king! + self.ryuflags = RYU_ALERT | RYU_INSANE; + self.hittype = HIT_METAL; + if (soul_evil) + monster_purse (20, 1, 0.5); + + monster_start (); +}; + + +//========================================================================== +// The Dark Lord (Wraith in Black Armor, a bit like Tolkien's Nazgul) +// +// Update 5/??/2011: Now includes a two-stage version similar to +// Dracula in (early) Castlevania, the human form and beast form. +//========================================================================== + +void(float d) dk_slow; +void(float d) dk_fast; + +void() darklord_run1 =[ $walk1, darklord_run2 ] {dk_slow(2);}; +void() darklord_run2 =[ $walk2, darklord_run3 ] {M_Step(); dk_slow(5);}; +void() darklord_run3 =[ $walk3, darklord_run4 ] {dk_slow(5);}; +void() darklord_run4 =[ $walk4, darklord_run5 ] {dk_slow(4);}; +void() darklord_run5 =[ $walk5, darklord_run6 ] {dk_slow(4);}; +void() darklord_run6 =[ $walk6, darklord_run7 ] {dk_slow(2);}; +void() darklord_run7 =[ $walk7, darklord_run8 ] {dk_slow(2);}; +void() darklord_run8 =[ $walk8, darklord_run9 ] {dk_slow(3);}; +void() darklord_run9 =[ $walk9, darklord_run10 ] {dk_slow(3);}; +void() darklord_run10 =[ $walk10, darklord_run11 ] {dk_slow(4);}; +void() darklord_run11 =[ $walk11, darklord_run12 ] {dk_slow(3);}; +void() darklord_run12 =[ $walk12, darklord_run13 ] {M_Step(); dk_slow(4);}; +void() darklord_run13 =[ $walk13, darklord_run14 ] {dk_slow(6);}; +void() darklord_run14 =[ $walk14, darklord_run15 ] {dk_slow(2);}; +void() darklord_run15 =[ $walk15, darklord_run16 ] {dk_slow(2);}; +void() darklord_run16 =[ $walk16, darklord_run17 ] {dk_slow(4);}; +void() darklord_run17 =[ $walk17, darklord_run18 ] {dk_slow(3);}; +void() darklord_run18 =[ $walk18, darklord_run19 ] {dk_slow(3);}; +void() darklord_run19 =[ $walk19, darklord_run20 ] {dk_slow(3);}; +void() darklord_run20 =[ $walk20, darklord_run1 ] {dk_slow(2);}; +//void() darklord_run20 =[ $walk20, darklord_run21 ] {dk_slow(2);}; +//void() darklord_run21 =[ $walk20, darklord_run2 ] {dk_slow(2);}; + +void() darklord_fast1 =[ $run1, darklord_fast2 ] {hk_idle_sound(); dk_fast(20);}; +void() darklord_fast2 =[ $run2, darklord_fast3 ] {M_Step(); dk_fast(25);}; +void() darklord_fast3 =[ $run3, darklord_fast4 ] {dk_fast(18);}; +void() darklord_fast4 =[ $run4, darklord_fast5 ] {dk_fast(16);}; +void() darklord_fast5 =[ $run5, darklord_fast6 ] {dk_fast(14);}; +void() darklord_fast6 =[ $run6, darklord_fast7 ] {M_Step(); dk_fast(25);}; +void() darklord_fast7 =[ $run7, darklord_fast8 ] {dk_fast(21);}; +void() darklord_fast8 =[ $run8, darklord_fast1 ] {dk_fast(13);}; + +void() dk_shield = +{ + if (self.pets < 1) // FIXME: Check for wraths. + { + if (self.flags & FL_GODMODE) + { + self.flags = self.flags - FL_GODMODE; //(self.flags & FL_GODMODE); + self.waitmax = time + 10; // Give player time to attack. + } + if (!self.mirror_finished) + self.effects = self.effects - (self.effects & EF_BRIGHTFIELD); + } + else + { + if (!(self.flags & FL_GODMODE)) + { + self.flags = self.flags | FL_GODMODE; + ReflectorShield (self); + sound(self, 6, "items/protect.wav", 1, ATTN_NORM); + } + } +}; + +void(float d) dk_slow = +{ + if (!self.fighting) + {darklord_fast1 (); return;} + if (self.enemy) + if (!visible (self.enemy)) + {darklord_fast1 (); return;} + dk_shield (); + ai_run(d); +}; +void(float d) dk_fast = +{ + if (self.fighting) + if (self.enemy) + if (visible (self.enemy)) + {darklord_run1 (); return;} + dk_shield (); + ai_run(d); +}; + +//=========================================================================== + +void(float d) dk_charge = +{ +// bane_shadow (); + hk_charge(d*2); +}; + +void() dk_idle_sound = +{ + if (random() < 0.2) + sound (self, CHAN_VOICE, "darklord/idle1.wav", 1, ATTN_NORM); +// if (random() < 0.5) +// sound (self, CHAN_VOICE, "darklord/sword1.wav", 1, ATTN_NORM); +// else +// sound (self, CHAN_VOICE, "darklord/sword2.wav", 1, ATTN_NORM); +}; + +void() darklord_slice1 =[ $slice1, darklord_slice2 ] {dk_idle_sound(); dk_charge(9);}; +void() darklord_slice2 =[ $slice3, darklord_slice3 ] {M_Step(); dk_charge(19);}; +void() darklord_slice3 =[ $slice5, darklord_slice4 ] {dk_charge(11); bane_melee(-200); ai_melee();}; +void() darklord_slice4 =[ $slice6, darklord_slice5 ] {dk_charge(15); ai_melee();}; +void() darklord_slice5 =[ $slice7, darklord_slice6 ] {M_Step(); dk_charge(8); ai_melee();}; +void() darklord_slice6 =[ $slice9, darklord_slice7 ] {dk_charge(2); ai_melee();}; +void() darklord_slice7 =[ $slice10, hknight_run1 ] {dk_charge(3);}; + +void() darklord_smash1 =[ $smash2, darklord_smash2 ] {dk_idle_sound(); dk_charge(14);}; +void() darklord_smash2 =[ $smash4, darklord_smash3 ] {M_Step(); dk_charge(20);}; +void() darklord_smash3 =[ $smash5, darklord_smash4 ] {dk_charge(10); bane_melee(0); ai_melee();}; +void() darklord_smash4 =[ $smash6, darklord_smash5 ] {dk_charge(7); ai_melee();}; +void() darklord_smash5 =[ $smash7, darklord_smash6 ] {dk_charge(12); ai_melee();}; +void() darklord_smash6 =[ $smash8, darklord_smash7 ] {dk_charge(2); ai_melee();}; +void() darklord_smash7 =[ $smash9, darklord_smash8 ] {M_Step(); dk_charge(3); ai_melee();}; +void() darklord_smash8 =[ $smash11, hknight_run1 ] {dk_charge(0);}; + +void() darklord_watk1 =[ $w_attack1, darklord_watk2 ] {dk_idle_sound(); dk_charge(2);}; +void() darklord_watk2 =[ $w_attack5, darklord_watk3 ] {bane_melee(0); ai_melee();}; +void() darklord_watk3 =[ $w_attack7, darklord_watk4 ] {dk_charge(1);}; +void() darklord_watk4 =[ $w_attack8, darklord_watk5 ] {dk_charge(4);}; +void() darklord_watk5 =[ $w_attack9, darklord_watk6 ] {dk_charge(5);}; +void() darklord_watk6 =[ $w_attack10, darklord_watk7 ] {dk_charge(3); ai_melee();}; +void() darklord_watk7 =[ $w_attack11, darklord_watk8 ] {M_Step(); dk_charge(2); ai_melee();}; +void() darklord_watk8 =[ $w_attack13, darklord_watk9 ] {dk_charge(2); ai_melee();}; +void() darklord_watk9 =[ $w_attack14, darklord_watk10 ] {dk_charge(0);}; +void() darklord_watk10 =[ $w_attack16, darklord_watk11 ] {dk_charge(1); + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +}; +void() darklord_watk11 =[ $w_attack18, darklord_watk12 ] {dk_charge(4); bane_melee(200); ai_melee();}; +void() darklord_watk12 =[ $w_attack19, darklord_watk13 ] {dk_charge(4); ai_melee();}; +void() darklord_watk13 =[ $w_attack20, darklord_watk14 ] {dk_charge(6);}; +void() darklord_watk14 =[ $w_attack22, hknight_run1] {dk_charge(10);}; + +void() darklord_melee = +{ + if (self.waitmin < time) + {darklord_magica1(); return;} + + hknight_type = hknight_type + 1; + + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); + if (hknight_type == 1) + darklord_slice1 (); + else if (hknight_type == 2) + darklord_smash1 (); + else if (hknight_type == 3) + { + darklord_watk1 (); + hknight_type = 0; + } +}; + +//============================================================================ + +void() darklord_thebeast; // Look in 'dragon.qc'. + +void() darklord_fall1 =[ $decap1, darklord_fall2 ] {ai_forward(10);}; +void() darklord_fall2 =[ $decap2, darklord_fall3 ] {ai_forward(8);}; +void() darklord_fall3 =[ $decap3, darklord_fall4 ] {monster_drop(); ai_forward(7);}; +void() darklord_fall4 =[ $decap4, darklord_fall5 ] {}; +void() darklord_fall5 =[ $decap5, darklord_fall6 ] {}; +void() darklord_fall6 =[ $decap6, darklord_fall7 ] {}; +void() darklord_fall7 =[ $decap7, darklord_fall8 ] {}; +void() darklord_fall8 =[ $decap8, darklord_fall9 ] {ai_forward(10);}; +void() darklord_fall9 =[ $decap9, darklord_fall10 ] {ai_forward(11);}; +void() darklord_fall10 =[ $decap10, darklord_fall11 ] {}; +void() darklord_fall11 =[ $decap11, darklord_fall12 ] {}; +void() darklord_fall12 =[ $decap12, darklord_thebeast ] +{ + Quake_Level (0, self.origin, 5); + self.nextthink = time + 3; +}; + +void(entity attacker, float damage) darklord_pain = +{ + if (self.max_health - self.health >= 1000) + { // Took enough damage to die. So feign death before transforming. + local vector st; + + // Become immune to damage and reset health. + self.flags = self.flags | FL_GODMODE; + self.health = self.max_health - 1000; + + // Reset some things. + self.th_stand = + self.th_walk = + self.th_run = darklord_thebeast; + self.th_melee = + self.th_missile = + self.th_pain = SUB_Null; + + SUB_RemovePowerups (); + + // Fake death. + sound (self, CHAN_VOICE, "darklord/death.wav", 1, ATTN_NORM); + + makevectors (self.angles); + st = '-2 0 28'; + st = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + Rocket_Explosion2 (st, 32, 5); + darklord_fall1 (); + + return; + } + +// Proceed as usual. + hknight_pain (attacker, damage); +}; + +//============================================================================ + +// Note: The dark lord's helmet explodes when destroyed. +void() darklord_die1 =[ $decap1, darklord_die2 ] {ai_forward(10);}; +void() darklord_die2 =[ $decap2, darklord_die3 ] {ai_forward(8);}; +void() darklord_die3 =[ $decap3, darklord_die4 ] {monster_drop(); ai_forward(7);}; +void() darklord_die4 =[ $decap4, darklord_die5 ] {}; +void() darklord_die5 =[ $decap5, darklord_die6 ] {}; +void() darklord_die6 =[ $decap6, darklord_die7 ] {}; +void() darklord_die7 =[ $decap7, darklord_die8 ] {}; +void() darklord_die8 =[ $decap8, darklord_die9 ] {ai_forward(10);}; +void() darklord_die9 =[ $decap9, darklord_die10 ] {ai_forward(11);}; +void() darklord_die10 =[ $decap10, darklord_die11 ] {}; +void() darklord_die11 =[ $decap11, darklord_die12 ] {}; +void() darklord_die12 =[ $decap12, monster_end ] {}; + +void() darklord_dieb1 =[ $decapb1, darklord_dieb2 ] {}; +void() darklord_dieb2 =[ $decapb2, darklord_dieb3 ] {}; +void() darklord_dieb3 =[ $decapb3, darklord_dieb4 ] {monster_drop();}; +void() darklord_dieb4 =[ $decapb4, darklord_dieb5 ] {}; +void() darklord_dieb5 =[ $decapb5, darklord_dieb6 ] {}; +void() darklord_dieb6 =[ $decapb6, darklord_dieb7 ] {}; +void() darklord_dieb7 =[ $decapb7, darklord_dieb8 ] {}; +void() darklord_dieb8 =[ $decapb8, darklord_dieb9 ] {}; +void() darklord_dieb9 =[ $decapb9, monster_end ] {}; + +void() darklord_die = +{ +// check for gib +// if (Shattered ()) +// return; + +// regular death + local vector st; + + sound (self, CHAN_VOICE, "darklord/death.wav", 1, ATTN_NORM); + + if (random() > 0.5) + {st = '-2 0 28'; darklord_die1 ();} + else + {st = '-3 0 33'; darklord_dieb1 ();} + makevectors (self.angles); + st = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + Rocket_Explosion2 (st, 32, 5); +}; + +void(float hello) darklord_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "darklord/idle1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "darklord/sight.wav", 1, ATTN_NORM); +}; + +void() dark_lord_cache = +{ +// Bane - - - - - - + precache_model ("progs/hknight.mdl"); + precache_model ("progs/r_bolt.mdl"); + // The dark lord's head explodes when killed, so no head gib needed. + + precache_sound ("bane/hit.wav"); + precache_sound ("darklord/death.wav"); + precache_sound ("darklord/idle1.wav"); + precache_sound ("darklord/pain.wav"); + precache_sound ("darklord/sight.wav"); + precache_sound ("darklord/death.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("items/protect.wav"); // Powerup sound + precache_sound ("plasma/explode.wav"); + precache_sound ("plasma/fire.wav"); + precache_sound ("weapons/axhit.wav"); + precache_sound ("skullwiz/gate.wav"); // For wrath summoning. +//- - - - - - - - - +}; + +// FIXME: Where do I put this aside from here? +void() dragon_doe_cache; + +//============ +// --> QUAKED monster_dark_lord (1 0 0) (-16 -16 -24) (16 16 40) Ambush Guardian Beast +// Guardian version can raise a shield and summon wraths. +// Beast version has 4000+ hp and morphs into a dragon when damaged enough. +// The boss flags can stack! +//============ +void() monster_dark_lord = +{ + local float hp; + +// FIXME: Test -- good to go? Remove? +//self.spawnflags = self.spawnflags | 4; + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + dark_lord_cache (); + wrath_cache (); + if (self.spawnflags & 4) + dragon_doe_cache (); + } + + if (self.spawnflags & 4) + hp = 4000 + (500 * cvar("skill")); + else + hp = 1000; + + self.skin = SKIN_DARK_LORD; + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', hp, 0); + self.mass = MASS_MEDIUM; + + // Takes reduced damage from lightning and cold. + self.resist_cold = 0.5; + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = darklord_run1; //hknight_run1; + self.th_missile = darklord_magic; //lord_magic; + self.th_melee = darklord_melee; //hknight_melee; + if (self.spawnflags & 4) + self.th_pain = darklord_pain; // Checks for stage change. + else + self.th_pain = hknight_pain; + self.th_die = darklord_die; + //- - - - - - - - +// self.th_jump = hknight_jump1; + self.th_sight = darklord_sight; + self.th_spawn = monster_dark_lord; + self.th_check = BaneCheckAttack; + // As a wraith bound in armor, it cannot be gibbed. + + self.bloodtype = 0 - BLOOD_DARK; // Less blood and no gibs. + self.family = FAM_BANE | FAM_UNDEAD; + self.xfl = XFL_ARMORED; + if (self.spawnflags & 6) + self.xfl = XFL_BOSS; + self.ryuflags = RYU_ALERT | RYU_INSANE; + self.hittype = HIT_METAL; + if (soul_evil) + monster_purse (20, 1, 0.5); + + if (self.deathstring == "") self.deathstring = " fell before a Dark Lord\n"; + + monster_start (); +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/mon_baron.qc b/QC_other/QC_keep/mon_baron.qc new file mode 100644 index 00000000..b98ea537 --- /dev/null +++ b/QC_other/QC_keep/mon_baron.qc @@ -0,0 +1,1544 @@ +/* +============================================================================== + +BARON + +============================================================================== +*/ + +$cd progs/baron +$origin 0 0 24 +$base base +$skin base + +$frame wave1 wave2 wave3 wave4 wave5 wave6 wave7 wave8 wave9 wave10 wave11 + +$frame point1 point2 point3 point4 point5 point6 point7 point8 point9 +$frame point10 point11 + +$frame crstand1 crstand2 crstand3 crstand4 crstand5 crstand6 crstand7 +$frame crstand8 crstand9 crstand10 crstand11 crstand12 crstand13 crstand14 +$frame crstand15 crstand16 crstand17 crstand18 crstand19 + +$frame paina1 paina2 paina3 + +$frame diea1 diea2 diea3 diea4 diea5 diea6 + +$frame dieb1 dieb2 dieb3 dieb4 dieb5 dieb6 + +$frame run1 run2 run3 run4 run5 run6 + +$frame draw1 draw2 draw3 draw4 draw5 + +$frame smack1 smack2 smack3 smack4 smack5 smack6 smack7 smack8 smack9 +$frame smack10 smack11 smack12 + +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 idle9 idle10 idle11 +$frame idle12 idle13 idle14 idle15 idle16 idle17 idle18 idle19 idle20 + +$frame painb1 painb2 painb3 painb4 + +$frame blam1 blam2 blam3 blam4 blam5 blam6 + +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 + +$frame taunt1 taunt2 taunt3 taunt4 taunt5 taunt6 taunt7 taunt8 taunt9 + +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +// SoE: Decapitation +$frame decap1 decap2 decap3 decap4 decap5 decap6 + +$frame decapb1 decapb2 decapb3 decapb4 decapb5 decapb6 + + +//========================================================================== + +//- - - - - - - - - +// This file has been adapted to Drake/SoE. +// +// Frames: +// 0 - 10 Wave (with sword on back -- idle taunt?) +// 11 - 21 Point (super missile attack for Rapture baron) +// 22 - 40 Crouch Stand +// 41 - 43 Pain #1 +// 44 - 49 Death #1 +// 50 - 55 Death #2 +// 56 - 61 Run +// 62 - 66 Sword Draw +// 67 - 78 Smack -- melee punch attack +// 79 - 98 Stand +// 99 - 102 Pain #2 +// 103 - 108 Blam -- melee sword attack +// 109 - 115 Magic Missile attack +// 116 - 124 Taunt +// 125 - 130 Jump +//- - - - - - - - - + +//.float nojump; // Don't jump if TRUE; + +// Spawnflags +float BSF_NO_JUMP = 4; // Disables jumping. + +// Elements +// +// PM: Kept due to legacy. +// Ordered by Horoscopes? +// e.g., Ares=Fire, Taurus=Earth, Gemini=Air, Cancer=Water. +float BARON_FIRE = 1; +float BARON_EARTH = 2; +float BARON_AIR = 3; +float BARON_WATER = 4; + + +//========================================================================== +// Stand + +// FALSE = sword in scabbard, TRUE = sword in hand. +float() baron_sword_drawn = +{ +// if ( self.frame == $draw1 ) +// return FALSE; + if ( self.frame <= $wave11 ) + return FALSE; + if ( self.frame >= $idle1 ) + if ( self.frame <= $idle20 ) + return FALSE; + + return TRUE; +}; + +// PM: Unsheath sound is loud, so keep the volume down. +void() baron_draw_sound = + {sound (self, CHAN_WEAPON, "weapons/unsheath.wav", 0.5, ATTN_IDLE);}; + +void() baron_idle_sound = +{ + if (!(self.spawnflags & 1)) // Only if not in ambush mode. + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); +}; + +void() baron_idle1 =[ $draw5, baron_idle2 ] {ai_stand();}; +void() baron_idle2 =[ $draw4, baron_idle3 ] {ai_stand();}; +void() baron_idle3 =[ $draw3, baron_idle4 ] {sound (self, CHAN_WEAPON, "weapons/sheath.wav", 0.5, ATTN_IDLE); ai_stand();}; +void() baron_idle4 =[ $draw2, baron_idle5 ] {ai_stand();}; +void() baron_idle5 =[ $draw1, baron_idle6 ] {ai_stand();}; +void() baron_idle6 =[ $idle1, baron_idle7 ] {ai_stand();}; +void() baron_idle7 =[ $idle2, baron_idle8 ] {ai_stand();}; +void() baron_idle8 =[ $idle3, baron_idle9 ] {ai_stand();}; +void() baron_idle9 =[ $idle4, baron_idle10 ] {ai_stand();}; +void() baron_idle10 =[ $idle5, baron_idle11 ] {ai_stand();}; +void() baron_idle11 =[ $idle6, baron_idle12 ] {ai_stand();}; +void() baron_idle12 =[ $idle7, baron_idle13 ] {ai_stand();}; +void() baron_idle13 =[ $idle8, baron_idle14 ] {ai_stand();}; +void() baron_idle14 =[ $idle9, baron_idle15 ] {ai_stand();}; +void() baron_idle15 =[ $idle10, baron_idle16 ] {ai_stand();}; +void() baron_idle16 =[ $idle11, baron_idle17 ] {baron_idle_sound(); ai_stand();}; +void() baron_idle17 =[ $idle12, baron_idle18 ] {ai_stand();}; +void() baron_idle18 =[ $idle13, baron_idle19 ] {ai_stand();}; +void() baron_idle19 =[ $idle14, baron_idle20 ] {ai_stand();}; +void() baron_idle20 =[ $idle15, baron_idle21 ] {ai_stand();}; +void() baron_idle21 =[ $idle16, baron_idle22 ] {ai_stand();}; +void() baron_idle22 =[ $idle17, baron_idle23 ] {ai_stand();}; +void() baron_idle23 =[ $idle18, baron_idle24 ] {ai_stand();}; +void() baron_idle24 =[ $idle19, baron_idle25 ] {ai_stand();}; +void() baron_idle25 =[ $idle20, baron_idle26 ] {ai_stand();}; +void() baron_idle26 =[ $idle19, baron_idle27 ] {ai_stand();}; +void() baron_idle27 =[ $idle18, baron_idle28 ] {ai_stand();}; +void() baron_idle28 =[ $idle17, baron_idle29 ] {ai_stand();}; +void() baron_idle29 =[ $idle16, baron_idle30 ] {ai_stand();}; +void() baron_idle30 =[ $idle15, baron_idle31 ] {ai_stand();}; +void() baron_idle31 =[ $idle14, baron_idle32 ] {ai_stand();}; +void() baron_idle32 =[ $idle13, baron_idle33 ] {ai_stand();}; +void() baron_idle33 =[ $idle12, baron_idle34 ] {ai_stand();}; +void() baron_idle34 =[ $idle11, baron_idle35 ] {baron_idle_sound(); ai_stand();}; +void() baron_idle35 =[ $idle10, baron_idle36 ] {ai_stand();}; +void() baron_idle36 =[ $idle9, baron_idle37 ] {ai_stand();}; +void() baron_idle37 =[ $idle8, baron_idle38 ] {ai_stand();}; +void() baron_idle38 =[ $idle7, baron_idle39 ] {ai_stand();}; +void() baron_idle39 =[ $idle6, baron_idle40 ] {ai_stand();}; +void() baron_idle40 =[ $idle5, baron_idle41 ] {ai_stand();}; +void() baron_idle41 =[ $idle4, baron_idle42 ] {ai_stand();}; +void() baron_idle42 =[ $idle3, baron_idle43 ] {ai_stand();}; +void() baron_idle43 =[ $idle2, baron_idle6 ] {ai_stand();}; + +void() baron_stand = +{ + if (baron_sword_drawn ()) + baron_idle1 (); // Put sword away. + else + baron_idle6 (); +}; + + +//========================================================================== +// Walk + +// Since baron model does not have a proper walk scene, animate the +// run scene at half speed. +void() baron_walk1 =[ $draw1, baron_walk2 ] {baron_draw_sound(); ai_turn();}; +void() baron_walk2 =[ $draw2, baron_walk3 ] {ai_turn();}; +void() baron_walk3 =[ $draw3, baron_walk4 ] {ai_turn();}; +void() baron_walk4 =[ $draw4, baron_walk5 ] {ai_turn();}; +void() baron_walk5 =[ $draw5, baron_walk6 ] {ai_turn();}; +void() baron_walk6 =[ $run1, baron_walk7 ] {monster_footstep(FALSE); ai_walk(6);}; +void() baron_walk7 =[ $run1, baron_walk8 ] {ai_walk(6);}; +void() baron_walk8 =[ $run2, baron_walk9 ] {ai_walk(6);}; +void() baron_walk9 =[ $run2, baron_walk10 ] {ai_walk(6);}; +void() baron_walk10 =[ $run3, baron_walk11 ] {ai_walk(6);}; +void() baron_walk11 =[ $run3, baron_walk12 ] {ai_walk(6);}; +void() baron_walk12 =[ $run4, baron_walk13 ] {monster_footstep(FALSE); ai_walk(6);}; +void() baron_walk13 =[ $run4, baron_walk14 ] {ai_walk(6);}; +void() baron_walk14 =[ $run5, baron_walk15 ] {ai_walk(6);}; +void() baron_walk15 =[ $run5, baron_walk16 ] {ai_walk(6);}; +void() baron_walk16 =[ $run6, baron_walk17 ] {ai_walk(6);}; +void() baron_walk17 =[ $run6, baron_walk6 ] {ai_walk(6);}; + +void() baron_walk = +{ + if (baron_sword_drawn ()) + baron_walk6 (); // Start jogging. + else + baron_walk1 (); // Draw sword then move. +}; + + +//========================================================================== +// Victory + +void() baron_look6 =[ $crstand1, baron_look6 ] +{ + WalkFrame_Add ( $crstand1, 1, 18 ); + if (self.walkframe == 18) + self.think = monster_sow; + ai_stand (); +}; + +void() baron_owned1 =[ $point1, baron_owned1 ] +{ + WalkFrame_Add ( $point1, 1, 10 ); + if (self.walkframe == 10) + self.think = monster_sow; + ai_stand (); +}; + +void() baron_win = +{ + if (baron_sword_drawn ()) + { + local float r; + + r = random(); + if (r >= 0.3) + { + if (r < 0.6) + { sound (self, CHAN_VOICE, "baron/idle.wav", 1, ATTN_NORM); + self.walkframe = 5; + baron_look6 (); + } + else + { self.walkframe = 0; + baron_owned1 (); + } + return; + } + } + monster_sow (); +}; + + +//========================================================================== +// Run + +// PM: Baron model was designed to run 12 pixels per frame, +// but since Nehahra had fast barons, double the speed to 24. +// Update: Source diving reveals 32 was used by Nehahra. +float BARON_SPEED = 32; + +void() baron_run1 =[ $draw1, baron_run2 ] {baron_draw_sound(); ai_face();}; +void() baron_run2 =[ $draw2, baron_run3 ] {ai_face();}; +void() baron_run3 =[ $draw3, baron_run4 ] {ai_face();}; +void() baron_run4 =[ $draw4, baron_run5 ] {ai_face();}; +void() baron_run5 =[ $draw5, baron_run6 ] {ai_face();}; +void() baron_run6 =[ $run1, baron_run7 ] {monster_footstep(FALSE); ai_run(BARON_SPEED);}; +void() baron_run7 =[ $run2, baron_run8 ] {ai_run(BARON_SPEED);}; +void() baron_run8 =[ $run3, baron_run9 ] {ai_run(BARON_SPEED);}; +void() baron_run9 =[ $run4, baron_run10 ] {monster_footstep(FALSE); ai_run(BARON_SPEED);}; +void() baron_run10 =[ $run5, baron_run11 ] {ai_run(BARON_SPEED);}; +void() baron_run11 =[ $run6, baron_run6 ] {ai_run(BARON_SPEED);}; + +void() baron_run = +{ + if (baron_sword_drawn ()) + baron_run6 (); // Start running. + else + baron_run1 (); // Draw sword then move. +}; + + +//========================================================================== +// Melee + +void() baron_sword = +{ + local float damage; + local float deep; + + if (!self.enemy) + return; // removed before stroke + if (!CanDamage (self.enemy, self)) + return; + + // In Nehahra, ai_melee then chainsaw(0) were called. + deep = InMeleeRange (60); // Simulate ai_melee range. + ai_charge (10); // As per ogre in Nehahra source. + + if (!deep) + if (!InMeleeRange (100)) + return; + //if (!self.level) // Elemental bosses can hit, but not moogles. + //if (IsGhost (self.enemy)) + //return; // Not allowed to hit wraith. + +// Rapture hits once with the sword. Nehahra (and Drake) hit four times. +// For Rapture damage, divide by four. + if (self.level) + damage = 8; // Rapture boss. + else + damage = 4; +// Update: Emulate Nehahra damage. + damage = SUB_MeleeDamage(damage); + if (deep) + damage = damage + SUB_MeleeDamage(3); + T_Damage (self.enemy, self, self, damage,DAMARMOR); +}; + +void() baron_skip1 =[ $blam4, baron_blam5 ] {ai_charge(6);}; +void() baron_skip2 =[ $blam4, baron_blam10 ] {ai_charge(6);}; + +// Update: Nehahra used ai_charge(3). My guess of 2 was close, but wrong. +void() baron_blam1 =[ $blam1, baron_blam2 ] {ai_charge(3);}; +void() baron_blam2 =[ $blam2, baron_blam3 ] {ai_charge(3); if (cranked || self.level) self.think = baron_skip1;}; +void() baron_blam3 =[ $blam3, baron_blam4 ] {ai_charge(3);}; +void() baron_blam4 =[ $blam4, baron_blam5 ] {ai_charge(3);}; +void() baron_blam5 =[ $blam5, baron_blam6 ] {ai_charge(3); baron_sword();}; +void() baron_blam6 =[ $blam6, baron_blam7 ] {ai_charge(3); baron_sword();}; +void() baron_blam7 =[ $blam5, baron_blam8 ] {ai_charge(3); if (cranked || self.level) self.think = baron_skip2;}; +void() baron_blam8 =[ $blam4, baron_blam9 ] {ai_charge(3);}; +void() baron_blam9 =[ $blam3, baron_blam10 ] {ai_charge(3);}; +void() baron_blam10 =[ $blam2, baron_blam11 ] {ai_charge(3); baron_sword();}; +void() baron_blam11 =[ $blam1, baron_run ] {ai_charge(3); baron_sword();}; + +void() baron_meat = +{ + local vector org; + + makevectors (self.angles); + org = self.origin + v_forward*16; + SpawnMeatSprayDrake (org, v_right * 150, self.enemy.bloodtype); + SpawnMeatSprayDrake (org, v_right * -150, self.enemy.bloodtype); +}; + +void() baron_throw1; +void() baron_fist = +{ + local vector delta; + + ai_face (); + walkmove (self.ideal_yaw, 12); // allow a little closing + + delta = self.enemy.origin - self.origin; + + // Check if fist can hit. + if (!InMeleeRange (80)) // Nehahra uses 100 -- too far! + return; + if (!CanDamage (self.enemy, self)) + return; + if (!self.enemy.takedamage) // For mega-enforcer. + return; + //if (!self.level) // Elemental bosses can hit, but not moogles. + //if (IsGhost (self.enemy)) // For wraith. + //return; + + // Fist connects. +// local vector org; + local vector dir; + local float damage; + + if (self.level) + damage = SUB_MeleeDamage (45); // Max damage of 135! o_O + else + { // In Nehahra, baron had damage set to 1d11+10, but was overriden + // by 1d5+10. Bug or intended? Since his sword does so much more + // damage, I'll make it do 1d10+10. + damage = random()*10 + 10; // 10-20 damage. + } + + if (random() < 0.1) // Me: 0.2, Neh: 0.1. + { + // Crushing blow -- Knockback the target! + local float up; + + up = 350; //random() * 100 + 250; + dir = normalize (self.enemy.origin - self.origin); + dir = dir * 400; //(random() * 100 + 200); + if (self.enemy.flags & FLx_CREATURE) + { + self.enemy.velocity = self.enemy.velocity + dir; + if (self.enemy.flags & FL_ONGROUND) + { + self.enemy.flags = self.enemy.flags - FL_ONGROUND; + self.enemy.velocity_z = up; + } + } + + // Unlike Nehahra, do extended anim only on a hit. + if (!cranked && !self.level) // Bosses won't dally around. + self.think = baron_throw1; + } + + // Inflict the damage. + sound (self, CHAN_WEAPON, "baron/smash.wav", 1, ATTN_NORM); + T_Damage (self.enemy, self, self, damage,DAMARMOR); + + // Throw a piece of meat. + baron_meat (); +}; + +void() baron_throw1 =[ $smack11, baron_throw2 ] {ai_face();}; +void() baron_throw2 =[ $smack12, baron_throw3 ] {ai_face();}; +void() baron_throw3 =[ $smack11, baron_throw4 ] {ai_face();}; +void() baron_throw4 =[ $smack10, baron_throw5 ] {ai_face();}; +void() baron_throw5 =[ $smack9, baron_throw6 ] {ai_face();}; +void() baron_throw6 =[ $smack8, baron_throw7 ] {ai_face();}; +void() baron_throw7 =[ $smack7, baron_throw8 ] {ai_face();}; +void() baron_throw8 =[ $smack6, baron_throw9 ] {ai_face();}; +void() baron_throw9 =[ $smack5, baron_throw10 ] {ai_face();}; +void() baron_throw10 =[ $smack4, baron_throw11 ] {ai_face();}; +void() baron_throw11 =[ $smack3, baron_throw12 ] {ai_face();}; +void() baron_throw12 =[ $smack2, baron_throw13 ] {ai_face();}; +void() baron_throw13 =[ $smack1, baron_run ] {ai_face();}; + +void() baron_smack1 =[ $smack1, baron_smack2 ] {ai_charge(2);}; +void() baron_smack2 =[ $smack2, baron_smack3 ] {ai_charge(2);}; +void() baron_smack3 =[ $smack3, baron_smack4 ] {ai_charge(2);}; +void() baron_smack4 =[ $smack4, baron_smack5 ] {ai_charge(2);}; +void() baron_smack5 =[ $smack5, baron_smack6 ] {ai_charge(2);}; +void() baron_smack6 =[ $smack6, baron_smack7 ] {ai_charge(2);}; +void() baron_smack7 =[ $smack7, baron_smack8 ] {ai_charge(2);}; +void() baron_smack8 =[ $smack8, baron_smack9 ] {ai_charge(2);}; +void() baron_smack9 =[ $smack9, baron_smack10 ] {ai_charge(12); baron_fist();}; +void() baron_smack10 =[ $smack10, baron_smack11 ] {ai_charge(2);}; +void() baron_smack11 =[ $smack11, baron_smack12 ] {ai_charge(2);}; +void() baron_smack12 =[ $smack12, baron_run ] {ai_charge(2);}; + +void() baron_fasts1 =[ $smack1, baron_fasts2 ] {ai_charge(6);}; +void() baron_fasts2 =[ $smack3, baron_fasts3 ] {ai_charge(4);}; +void() baron_fasts3 =[ $smack6, baron_smack7 ] {ai_charge(2);}; + +void() baron_melee = +{ + if (self.state) + { + if (cranked || self.level) + self.think = baron_fasts1; + else + self.think = baron_smack1; + } + else + self.think = baron_blam1; + self.state = !self.state; + + sound (self, CHAN_WEAPON, "baron/woosh.wav", 1, ATTN_NORM); + self.think (); +}; + + +//========================================================================== +// Special + +// Returns TRUE if baron can summon an earth elemental. +// This only checks if summoning is allowed; nothing gets spawned here. +float() BaronGolem_Check = {return (/*self.pets*/0 < ceil(skill / 2) + 1);}; + +//========================================================================== +// Missile + +void(vector start, vector dir, float sped) Baron_Ice_Launch = +{ + Ice_Launch (start, dir, sped); + newmis.delay = time + 5; + newmis.dmg = 18; //random() * 5 + 15; +}; + +void() Baron_Ice = +{ + local vector org, dir, err, base; + local float loop, sped; + + sound (self, CHAN_WEAPON, "imp/shard.wav", 1, ATTN_NORM); + +// Note: Rapture uses '6 6 0'. + err = '6 4.5 0'; // arctan(err) = '0.105 0.0787 0'. + loop = random() * 3 + 6; + base = self.enemy.origin; + makevectors (self.angles); + org = self.origin + v_forward*16 + v_right*2 + v_up*20; + base = normalize (base - self.origin); // Like enforcers. + while (loop > 0) + { + loop = loop - 1; + sped = random() * 100 + 830; + if (!loop) + err = '0 0 0'; // Last shot in loop uses unaltered velocity. + dir = Maim_Scatter (base, err); + Baron_Ice_Launch (org, dir, sped); + } +}; + +void() Earth_Touch = +{ + //if (Reflected ()) + //return; + + if (other.takedamage) + { + spawn_touchblood (other, self, self.dmg); + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + } else { + spawn_touchblood (other, self, self.dmg); // Rock chunks. + sound (self, CHAN_AUTO, "baron/e_hit.wav", 1, ATTN_NORM); + } + remove (self); +}; + +void(vector start, vector dir, float sped) Earth_Launch = +{ + newmis = spawn (); + newmis.master = newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.classname = "earth"; +// set missile speed + newmis.speed = sped; + newmis.velocity = dir * sped; + newmis.avelocity_x = crandom() * 500; + newmis.avelocity_y = crandom() * 500; + newmis.avelocity_z = crandom() * 500; + newmis.angles = vectoangles(newmis.velocity); +// set missile damage + newmis.dmg = random() * 5 + 40; +// set missile special stuff + newmis.dest = dir; +// set missile duration + newmis.touch = Earth_Touch; + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + + if (random() < 0.5) + setmodel (newmis, "progs/rubble1.mdl"); + else + setmodel (newmis, "progs/rubble3.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + setorigin (newmis, start); +}; + +// Shoots a spray of rock chunks at the enemy. +void() Baron_Earth = +{ + local vector org, dir, err, base; + local float loop, sped; + + sound (self, CHAN_WEAPON, "misc/wallbrk.wav", 1, ATTN_NORM); + +// Note: Rapture uses '6 6 0'. + err = '6 6 0'; + loop = random() * 3 + 5; + base = self.enemy.origin; + makevectors (self.angles); + org = self.origin + v_forward*16 + v_right*2 + v_up*20; + base = normalize (base - self.origin); // Like enforcers. + while (loop > 0) + { + loop = loop - 1; + sped = random() * 100 + 830; + if (!loop) + err = '0 0 0'; // Last shot in loop uses unaltered velocity. + dir = Maim_Scatter (base, err); + Earth_Launch (org, dir, sped); + } +}; + +//- - - - - - - - - +// Geyser stuff. +float GEYSER_MOVE = 50; + +void(vector spot) QuakeWave = + {ShockWave (spot, RING_QUAKE, 5, "progs/drake/s_wave.spr");}; + +void() Geyser_Erupt = +{ + local entity swap; + local vector org, dir, trig; + local float loop, sped; + local float ang, qcos, qsin; + +// Trace down to find endpoint...In case the ground was moved or deleted, + traceline (self.origin + '0 0 1', self.origin - '0 0 2047', TRUE, self); + if (trace_fraction == 1) + return; // No ground to erupt from. + org = trace_endpos + '0 0 1'; + setorigin (self, org); + + T_RadiusDamage (self, self.owner, 60, world, DAMAGEALL); + sound (self, CHAN_WEAPON, "misc/wallbrk.wav", 1, ATTN_NORM); + QuakeWave (self.origin); + +// Do rock spray from below. + swap = self; + self = self.owner; + + loop = random() * 3 + 5; + while (loop > 0) + { + // Find cosine and sine of offset angle. + ang = random() * 30 + 60; // 60-90 degrees, 90 is straight up. + trig = CoSine (ang); + qcos = trig_x; + qsin = trig_y; + + dir = '0 0 0'; + dir_y = random() * 360; + makevectors (dir); + dir = (v_forward * qcos) + (v_up * qsin); + sped = random() * 100 + 500; //830; + + Earth_Launch (org, dir, sped); + newmis.movetype = MOVETYPE_TOSS; + newmis.master = newmis.owner = self; + + loop = loop - 1; + } + + self = swap; + remove (self); +}; + +void() Geyser_NextThink = +{ + self.nextthink = time + 0.05; + if (self.delay <= self.nextthink) + { + self.nextthink = self.delay; + self.think = Geyser_Erupt; + } +}; + +void() Geyser_Think = +{ + local vector spot; + + self.distance = self.distance + GEYSER_MOVE; + spot = self.oldorigin + (self.movedir * self.distance); +// traceline (spot, spot - '0 0 600', TRUE, self); + spot_z = self.origin_z; + traceline (spot + '0 0 1', spot - '0 0 1027', TRUE, self); + if (trace_fraction < 1) + HalfWave (trace_endpos + '0 0 2', RING2_QUAKE, 3, "progs/s_wave2.spr"); + + Geyser_NextThink (); +}; + +void() Baron_Geyser = +{ +// If target is within 'droptofloor' distance, spawn a geyser at his feet. + traceline (self.enemy.origin, self.enemy.origin - '0 0 256', TRUE, self); + if (trace_fraction == 1) + return; + + newmis = spawn(); + setorigin (newmis, trace_endpos + '0 0 1'); + + newmis.owner = self; + newmis.enemy = self.enemy; + + newmis.oldorigin = self.origin; + newmis.movedir = normalize (self.enemy.origin - self.origin); + newmis.distance = 0; + + newmis.delay = vlen(self.enemy.origin - self.origin) / (GEYSER_MOVE * 20) + time; + newmis.think = Geyser_Think; + SUB_Think (newmis, Geyser_NextThink); +}; +//- - - - - - - - - + +// Lifts all enemies and their missiles in front of baron up into the air. +void() Baron_Air = +{ + local entity head; + local vector ang; + local float damage; + local float str; + local float hit; + +// Update: Hit self.enemy, his allies, and their missiles. +// Old code hit self.enemy only. + head = nextent (world); //self.enemy; + while (head) + { + if (head.modelindex) + if (head.solid != SOLID_NOT) + if (head.touch != Gib_Touch) // Hack to prevent heads from flying. + { + if (head.flags & FLx_CREATURE) + hit = 1; + else if (IsMissile (head)) + hit = 2; + else + hit = 0; + + if (hit) + { + if (infront (head)) + if (visible (head)) + { + str = random(); + damage = str * 5 + 10; + if (hit == 1) + { + //if (!Ally_Check (head, self)) + //{ + ang = '0 0 0'; + ang_y = random() * 360; + ang = vectoangles(ang); + ang_z = str * 250 + 250; + head.velocity = ang; + head.flags = head.flags - (head.flags & FL_ONGROUND); + //} + //else + // hit = 0; + } + else + { // Check owner for missile control, not who launched. + //if (!Ally_Check (head.owner, self)) + Missile_Up (head); + //else + // hit = 0; + } + if (hit) + { + Particle_Gust (head); // Show some dust. + T_Damage (head, self, self, damage,DAMARMOR); + // Was "baron/woosh.wav". + sound (head, 7, "skullwiz/push.wav", 1, ATTN_NORM); + } + } + } + } + head = nextent (head); + } +}; + +// Replaced lightning bolt with plasma/ball lightning. +void(vector st) M_FireBaronPlasma = +{ + local vector p1, p2, dir; + local entity targ; + + targ = world; + makevectors (self.angles); + p1 = self.origin + (v_forward * st_x) + (v_right * st_y) + (v_up * st_z); + p2 = Aimpoint (self.enemy); + dir = Maim_Line (p1, p2, 1000, targ, '0 0 0'); + + self.effects = self.effects | EF_MUZZLEFLASH; +// DISABLED -- Sound played in the previous frame. +// sound (self, CHAN_WEAPON, "plasma/fire.wav", 1, ATTN_NORM); + + RyuPlasma_Launch (p1, dir, 1000, 60); +}; + +//- - - - - - - - - +void() baron_slam = +{ + local vector org, org2, dir; + + makevectors (self.angles); + org = self.origin + (v_forward*32) + (v_right*12); + traceline (org, org - '0 0 42', TRUE, self); + org2 = trace_endpos; + if ((trace_fraction < 1) || (pointcontents(org2) == CONTENT_SOLID)) + { + sound (self, CHAN_WEAPON, "weapons/fwalltap.wav", 1, ATTN_NORM); + if (self.level == BARON_FIRE) + { + HalfWave (org2 + '0 0 4', RING_FIRE, 2, "progs/drake/s_wave.spr"); + self.effects = self.effects | EF_MUZZLEFLASH; + org = org + self.view_ofs; + org2 = self.origin + self.view_ofs; + dir = self.enemy.origin + self.enemy.view_ofs; + dir = Maim_Line (org2, dir, SPEED_FIREWALL, world, '0 0 0'); + Firewall_Spawn (org, dir, TRUE, self.enemy); + newmis.dmg = 120; + } + else + { + self.waitmax = time + 5; // Don't spam. + if (self.level == BARON_WATER) + IceMine_Spawn (self.dest); + else if (self.level == BARON_AIR) + Tornado_Spawn (self.dest); + else + { + QuakeWave (org2 + '0 0 4'); + Quake_Attack (org); + Baron_Geyser (); + } + } + } +}; +void() baron_slam1 =[ $smack1, baron_slam2 ] {sound (self, CHAN_WEAPON, "baron/woosh.wav", 1, ATTN_NORM); ai_charge(2); self.dest = self.enemy.origin;}; +void() baron_slam2 =[ $smack2, baron_slam3 ] {ai_charge(2);}; +void() baron_slam3 =[ $smack3, baron_slam4 ] {ai_charge(2);}; +void() baron_slam4 =[ $smack4, baron_slam5 ] {ai_charge(2);}; +void() baron_slam5 =[ $smack5, baron_slam6 ] {ai_charge(2);}; +void() baron_slam6 =[ $smack6, baron_slam7 ] {ai_charge(2);}; +void() baron_slam7 =[ $smack7, baron_slam8 ] {ai_charge(2);}; +void() baron_slam8 =[ $smack8, baron_slam9 ] {ai_charge(2);}; +void() baron_slam9 =[ $smack9, baron_slam10 ] {ai_charge(12); baron_slam();}; +void() baron_slam10 =[ $smack10, baron_slam11 ] {ai_charge(2);}; +void() baron_slam11 =[ $smack11, baron_slam12 ] {ai_charge(2);}; +void() baron_slam12 =[ $smack12, baron_run ] {ai_charge(2);}; + +//- - - - - - - - - +void() baron_cast1 =[ $magica7, baron_cast2 ] {sound (self, CHAN_WEAPON, "baron/woosh.wav", 1, ATTN_NORM); ai_face(); self.dest = self.enemy.origin;}; +void() baron_cast2 =[ $magica6, baron_cast3 ] {ai_face();if (self.level == BARON_FIRE) self.nextthink = time + 0.2;}; +void() baron_cast3 =[ $magica5, baron_cast4 ] {ai_face();if (self.level == BARON_FIRE) self.nextthink = time + 0.2;}; +void() baron_cast4 =[ $magica4, baron_cast5 ] {ai_face();if (self.level == BARON_FIRE) self.nextthink = time + 0.2;}; +void() baron_cast5 =[ $magica3, baron_cast6 ] {ai_face(); + if (self.level == BARON_WATER) + RainStorm (self.enemy, self, 18, 20, 0, TRUE, RainStorm_Ice); + else if (self.level == BARON_FIRE) + Fireworks (self, self.dest, 90, 60, DF_SAFE, "fire"); + else if (self.level == BARON_EARTH) + { + //if (BaronGolem_Check ()) + //if (!SpawnMonster_Attack (self, CT_MONGOLEM)) + //{ + // if (visible (self.enemy)) // FIXME: ??? + // SpawnMonster (self, self.origin, CT_MONGOLEM, EntryPoint_Fan); + //} + } + else + { // Lightnign bolt from the sky. + LightZero_Set (20, 1, -4); + Thunderstrike (self, self.dest, 80); + } + self.dest = self.enemy.origin; +}; +void() baron_cast6 =[ $magica2, baron_cast7 ] {ai_face();}; +void() baron_cast7 =[ $magica1, baron_run ] {ai_face();}; + +//- - - - - - - - - +void() baron_point1 =[ $point1, baron_point2 ] {ai_face(); +// Set fireball counter. + if (self.level) + { // Rapture/Unforgiven elemental bosses. + if (self.level == BARON_FIRE) // 8/24/10: Emulate the cyberdemon. + self.shots_max = 3; //random() * 4; + else + self.shots_max = 1; + } + else // Nehahra/Drake version. 1 on Easy/Normal, 1-2 on Hard/NM. + self.shots_max = random() * (skill + 1) / 2; + self.shots_left = self.shots_max = ceil(self.shots_max); +}; +void() baron_point2 =[ $point2, baron_point3 ] {ai_face();}; +void() baron_point3 =[ $point3, baron_point4 ] {ai_face();}; +void() baron_point4 =[ $point4, baron_point5 ] {ai_face();}; +void() baron_point5 =[ $point5, baron_point6 ] {ai_face(); + if (self.level == BARON_AIR) + sound (self, CHAN_WEAPON, "plasma/fire.wav", 1, ATTN_NORM); +}; +void() baron_point6 =[ $point6, baron_point7 ] {ai_face(); + if (self.level == BARON_EARTH) + Baron_Earth(); //'16 2 20'); + else if (self.level == BARON_AIR) + M_FireBaronPlasma ('16 2 20'); + else if (self.level == BARON_WATER) + Baron_Ice(); //'16 2 20'); + else + M_FireKnight('16 2 20', FALSE); + self.dest = self.enemy.origin; + self.shots_left = self.shots_left - 1; + if (self.shots_left > 0) + if (self.enemy) + if (visible (self.enemy)) + { // Got more shots left, and target is still in sight. + self.think = baron_point3; + return; + } + self.shots_left = self.shots_max = 0; // Done firing. +}; +void() baron_point7 =[ $point7, baron_point8 ] {ai_face();}; +void() baron_point8 =[ $point8, baron_point9 ] {ai_face();}; +void() baron_point9 =[ $point9, baron_point10 ] {ai_face();}; +void() baron_point10 =[ $point10, baron_point11 ] {ai_face();}; +void() baron_point11 =[ $point11, baron_run ] {ai_face();}; + +//- - - - - - - - - +//void(float offset) hknight_shot; + +// SoE/Rapture: Don't use hknight_shot like in Drake because of the +// various changes required for Tronyn's modified knights. +// The basic shot code is otherwise the same as the hell knights'. +void(float offset) baron_shot = +{ + local vector offang, org, vec; + + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 6; + + makevectors (offang); +// PM: No need to check hell knight frames for different start point. + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + +// set missile speed + vec = normalize (v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + vec = Maim_Scatter (vec, '0 0 0'); // Added for invisibility. + +// PM: No need to check classnames like Bane, hell knight, hell lord, etc. + if (self.level == BARON_EARTH) { + launch_projectile (org, vec, CT_PROJ_SNG, SPEED_PLAYSPIKE); + // Old damage was 15, but use superspike's 18. + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + } + else if (self.level == BARON_WATER) + { + Baron_Ice_Launch (org, vec, 600); + sound (self, CHAN_WEAPON, "baron/icefire.wav", 1, ATTN_NORM); + } + else + { // Use offset as speed. + if (self.level == BARON_FIRE) + offset = 500; + else if (cranked) + offset = 450; // PM: Faster missiles. + else + offset = 300; + self.attack_speed = SPEED_HKSPIKE + ( skill * SPEED_HKSKILL); + launch_projectile (org, vec, CT_PROJ_HKN, self.attack_speed); + if (self.level == BARON_FIRE) + newmis.dmg = 20; + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + } +}; + +void() baron_air1 =[ $magica4, baron_air2 ] {ai_face(); + Baron_Air(); + self.waitmax = time + 1; // To prevent unfair lightning strike combo. +}; +void() baron_air2 =[ $magica5, baron_air3 ] {ai_face();}; +void() baron_air3 =[ $magica6, baron_magica7 ] {ai_face();}; + +// Use triangle pattern instead of Nehahra's off-center one. +// Me: 0, -1 1, -2 0 2. Neh: 0, -1 -2, 0 1. +void() baron_magica1 =[ $magica1, baron_magica2 ] {ai_face();}; +void() baron_magica2 =[ $magica2, baron_magica3 ] {ai_face();}; +void() baron_magica3 =[ $magica3, baron_magica4 ] {ai_face(); + if (self.level == BARON_AIR) + self.think = baron_air1; +}; +void() baron_magica4 =[ $magica4, baron_magica5 ] {ai_face(); baron_shot(0);}; +void() baron_magica5 =[ $magica5, baron_magica6 ] {ai_face(); baron_shot(-1); baron_shot(1);}; +void() baron_magica6 =[ $magica6, baron_magica7 ] {ai_face(); baron_shot(-2); baron_shot(2); + if (self.level) + baron_shot(0); // Extra shot for boss. +}; +void() baron_magica7 =[ $magica7, baron_run ] {ai_face();}; + +void() baron_magic = +{ + if (self.level) + { + local float r; + local float opt; + + opt = 2; + if (self.level == BARON_AIR) + { + local float add, yes; + + opt = 1; + add = 1; + yes = 0; + + if (!super_active) + if (self.waitmax < time) // Don't combo from gust. + if (random() < 0.5) //0.33) + {baron_slam1(); return;} + + if (self.waitmax < time) + if (UpIsSky (self.enemy.origin)) + opt = opt + 1; + if (self.h2olevel < 2) + {add = 0; opt = opt + 1; yes = 1;} + + r = random() * opt + add; + if ((r <= 1) && yes) + baron_point1(); + else if (r <= 2) + baron_magica1(); + else + baron_cast1(); + return; + } + if (self.level == BARON_WATER) + { + opt = 3; + if (!super_active) + opt = opt + 1; + + r = random() * opt; + if (r <= 1) + baron_point1(); + else if (r <= 2) + baron_magica1(); + else if (r <= 3) + baron_slam1(); + else + baron_cast1(); + return; + } + if ((self.level == BARON_FIRE) || (self.level == BARON_EARTH)) + { + if (self.waitmax < time) + { + if (!super_active) + if (random() < 0.5) //0.33) + if ((self.level != BARON_EARTH) || BaronGolem_Check ()) + {baron_cast1(); return;} + if (self.level == BARON_EARTH) + { + if (Grounded (self.enemy)) // Enemy hurt by quake? + opt = opt + 1; + } + else + { + if (M_FirewallCheck ()) + opt = opt + 1; + } + } + + r = random() * opt; + if (r <= 1) + baron_point1(); + else if (r <= 2) + baron_magica1(); + else + baron_slam1(); + return; + } + } + +// Nehahra style baron, with some Drake stuff. +// SoE: Barons need a special attack to make them unique among Banes' army. +// Update 5/3/2010: Keep nsoe barons for Drake. + if (random() < 0.333) + baron_point1 (); // Fireball + else + baron_magica1 (); // Classic missile spray +}; + +// NOTE: Much of the jump code was cut-and-paste from 'demon.qc'. + +// Note: Drake adds a leaping slash attack for the baron, similar to the +// Barbarian Leap Attack skill from Diablo 2. Thus, the jump animation +// sequence as a bit different than Nehahra. +void() baron_jumptouch; + +void() baron_jump1 =[ $jump6, baron_jump2 ] {ai_face(); self.waitmin = 5;}; +void() baron_jump2 =[ $jump5, baron_jump3 ] {ai_face();}; +void() baron_jump3 =[ $jump4, baron_jump4 ] +{ + ai_face(); +// Not in Nehahra, but I like it so it stays. + if (range(self.enemy) == RANGE_MELEE) + { + self.think = baron_melee; // Abort jump and smackdown enemy. + } + else if (!FacingIdeal()) + { + // Not facing the right way... delay the jump or abort. + self.waitmin = self.waitmin - 1; + if (self.waitmin > 0) + self.think = baron_jump3; + else + self.think = baron_magic; // Abort jump and fling some magic. + } +}; +void() baron_jump4 =[ $jump3, baron_jump5 ] +{ + local float sped, up; + +// Update: Use Nehahra's values. + sped = 400; // Player = 320. + up = 300; // Player = 270. +// Note: If player cannot control his jumping, neither should human NPCs. + + ai_face(); + + // Make the jump; + self.touch = baron_jumptouch; + makevectors (self.angles); +// self.origin_z = self.origin_z + 1; + self.velocity = v_forward * sped; + self.velocity_z = self.velocity_z + up; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.nextthink = time + 0.2; +}; +void() baron_jump5 =[ $jump2, baron_jump6 ] {self.nextthink = time + 0.2;}; +void() baron_jump6 =[ $jump1, baron_jump7 ] {self.nextthink = time + 3;}; +void() baron_jump7 =[ $jump4, baron_jump4 ] {}; + +void() baron_land1 =[ $jump4, baron_land2 ] {}; +void() baron_land2 =[ $jump5, baron_land3 ] {}; +void() baron_land3 =[ $jump6, baron_run ] {}; + +// Jump initiated by trigger. +void() baron_tjump =[ $jump3, baron_jump5 ] +{ + self.touch = baron_jumptouch; + // velocity and onground assumed to be set by jump trigger. + self.nextthink = time + 0.2; +}; + +void() baron_jumptouch = +{ + if (self.health <= 0) + return; + +//- - - - - - - - - +// PM: Check for leaping slash attack. + if ( self.frame != $blam6 ) + if (other) + if (other == self.enemy) // Hurt only the intended target. + { + if ( vlen(self.velocity) > 300 ) + { + local float ldmg; + + if (self.level) + ldmg = 40 + 10*random(); // Boss version. + else + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg,DAMARMOR); + if (self.health <= 0) + return; // PM: Killed by thorns (empathy shields). + + if (( self.frame == $jump2 ) || ( self.frame == $jump3 )) + { // Got an early hit. + self.nextthink = time + 3; + self.think = baron_jump7; + } + baron_meat (); + self.frame = $blam6; // Go to a stab frame. + sound (self, CHAN_WEAPON, "weapons/axhit.wav", 1, ATTN_NORM); + } + } +//- - - - - - - - - + if (!checkbottom(self)) + { + if (self.flags & FL_ONGROUND) + { // jump randomly to not get hung up +//dprint ("popjump\n"); + self.touch = SUB_Null; + self.think = baron_jump4; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + if ( self.frame == $blam6 ) + { // We smacked the target with the leaping slash. + self.state = TRUE; // Follow up with fist smash. + self.think = baron_blam7; + } + else + { + self.think = baron_land1; + // PM: If we landed close to our enemy, go directly to melee. + if (self.enemy) + if (CanDamage (self.enemy, self)) + if (InMeleeRange (100)) + { + sound (self, CHAN_WEAPON, "baron/woosh.wav", 1, ATTN_NORM); + self.state = TRUE; + self.think = baron_blam6; + } + } + self.nextthink = time + 0.1; +}; + +// Ripped from Nehahra's ai2_tracetoss, adapted to Drake. +float(vector ang, float sped, vector add) baron_tracejump = { + local vector vel, end; + local float pc; + + makevectors (ang); + vel = (v_forward * sped) + add; + // Nehahra engine had a builtin 'tracetoss' function. + // Here, use my QC version. It was made for projectiles, but it'll do. + TraceToss (self.origin, vel, FALSE, self, 3); + + end = trace_endpos; + if (self.enemy) + if (trace_ent) + if (trace_ent != self.enemy) + if (trace_ent.classname != self.classname) + return FALSE; // Hit something, but not the target. + if (self.enemy.origin_z - end_z > 150) + return FALSE; // Too low. + traceline (end, end - '0 0 400', FALSE, self); + if (trace_fraction == 1) + return FALSE; // Can't find ground. + pc = pointcontents (trace_endpos); + if (pc <= CONTENT_WATER) + return FALSE; // Jumped into water or worse. + + return TRUE; // Go! +}; + +void() baron_missile = { + if (!(self.spawnflags & BSF_NO_JUMP)) + if (range(self.enemy) != RANGE_MELEE) // range check not in Nehahra. + if (random() < 0.3) // Me: 0.2, Nehahra/Rapture: 0.3. + if (baron_tracejump (self.angles, 400, '0 0 300')) + {baron_jump1 (); return;} + + baron_magic(); +}; + + +//========================================================================== +// Pain + +void() baron_paina1 =[ $paina3, baron_paina2 ] {}; +void() baron_paina2 =[ $paina2, baron_paina3 ] {}; +void() baron_paina3 =[ $paina1, baron_run ] {}; + +void() baron_painb1 =[ $painb1, baron_painb2 ] {}; +void() baron_painb2 =[ $painb2, baron_painb3 ] {}; +void() baron_painb3 =[ $painb3, baron_painb4 ] {}; +void() baron_painb4 =[ $painb4, baron_run ] {}; + +void(entity inflictor, entity attacker, float damage) baron_pain = { + if (self.pain_finished > time) + return; + + self.pain_finished = time + 1; + sound (self, CHAN_VOICE, "baron/bpain1.wav", 1, ATTN_NORM); + if (self.touch == baron_jumptouch) + return; // can't flinch while jumping + if ((random() * 30) > damage) // Me: 40, Neh: 30. I'll go 30. + return; // didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + if (random() < 0.4) // Me: 0.5, Neh: 0.4. + baron_paina1 (); + else + baron_painb1 (); + + attacker = attacker; // Appease FrikQcc. +}; + + +//========================================================================== +// Death + +// SOLID_NOT used to be set at the fifth death frame. +// Now it is set as in Nehahra. +void() baron_decap1 =[ $decap1, baron_decap2 ] {blood_spray ('-5 14 22', 1);}; +void() baron_decap2 =[ $decap2, baron_decap3 ] {blood_spray ('3 9 18', 2); ai_forward(2);}; +void() baron_decap3 =[ $decap3, baron_decap4 ] {blood_spray ('-6 6 18', 1); ai_back(2);}; +void() baron_decap4 =[ $decap4, baron_decap5 ] {blood_spray ('-16 -10 13', 1); ai_back(6);}; +void() baron_decap5 =[ $decap5, baron_decap6 ] {ai_back(2);}; +void() baron_decap6 =[ $decap6, baron_decap6 ] {ai_back(8);}; + +void() baron_decapb1 =[ $decapb1, baron_decapb2 ] {blood_spray ('4 4 28', 1);}; +void() baron_decapb2 =[ $decapb2, baron_decapb3 ] {blood_spray ('7 2 24', 1);}; +void() baron_decapb3 =[ $decapb3, baron_decapb4 ] {blood_spray ('0 3 15', 1);ai_forward(7);}; +void() baron_decapb4 =[ $decapb4, baron_decapb5 ] {blood_spray ('4 4 6', 1);}; +void() baron_decapb5 =[ $decapb5, baron_decapb6 ] {blood_spray ('3 4 5', -1); ai_forward(20);}; +void() baron_decapb6 =[ $decapb6, baron_decapb6 ] {ai_forward(2);}; + +void() baron_diea1 =[ $diea1, baron_diea2 ] {}; +void() baron_diea2 =[ $diea2, baron_diea3 ] {ai_forward(2); monster_check_gib(); self.solid = SOLID_NOT;}; +void() baron_diea3 =[ $diea3, baron_diea4 ] {ai_back(2); monster_check_gib();}; +void() baron_diea4 =[ $diea4, baron_diea5 ] {ai_back(6);}; +void() baron_diea5 =[ $diea5, baron_diea6 ] {ai_back(2); monster_death_postcheck();}; +void() baron_diea6 =[ $diea6, baron_diea6 ] {ai_back(8); monster_deadbody_check();}; + +void() baron_dieb1 =[ $dieb1, baron_dieb2 ] {}; +void() baron_dieb2 =[ $dieb2, baron_dieb3 ] {monster_check_gib(); self.solid = SOLID_NOT;}; +void() baron_dieb3 =[ $dieb3, baron_dieb4 ] {ai_forward(7); monster_check_gib();}; +void() baron_dieb4 =[ $dieb4, baron_dieb5 ] {}; +void() baron_dieb5 =[ $dieb5, baron_dieb6 ] {ai_forward(20); monster_death_postcheck();}; +void() baron_dieb6 =[ $dieb6, baron_dieb6 ] {ai_forward(2); monster_deadbody_check();}; + +void() baron_die = { + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "baron/death.wav", 1, ATTN_NORM); + if (random() < 0.5) // Nehahra uses 0.3. + baron_diea1 (); + else + baron_dieb1 (); + } +}; + + +//========================================================================== +// Revive + +void() baron_revivea1 =[ $diea5, baron_revivea2 ] {}; +void() baron_revivea2 =[ $diea4, baron_revivea3 ] {}; +void() baron_revivea3 =[ $diea3, baron_revivea4 ] {}; +void() baron_revivea4 =[ $diea2, baron_revivea5 ] {}; +void() baron_revivea5 =[ $diea1, baron_run6 ] {}; + +void() baron_reviveb1 =[ $dieb5, baron_reviveb2 ] {}; +void() baron_reviveb2 =[ $dieb4, baron_reviveb3 ] {}; +void() baron_reviveb3 =[ $dieb3, baron_reviveb4 ] {}; +void() baron_reviveb4 =[ $dieb2, baron_reviveb5 ] {}; +void() baron_reviveb5 =[ $dieb1, baron_run6 ] {}; + +void() baron_revive = +{ + if ( self.frame == $dieb6 ) + baron_reviveb1 (); + else + baron_revivea1 (); +}; + + +//========================================================================== +// Other + +float() BaronBossCheckAttack = +{ +// If target is not in LOS, use an attack that doesn't care about line-of-fire. +// This will harass a player that tries to hide and spam grenades from a +// safe spot. + if (enemy_range <= RANGE_MID) + if (time >= self.attack_finished) + if (self.waitmax < time) // Use only after a delay. + if (random() < 0.01) // Use infrequently. + { +//dprint("harass!\n"); + local float r; + + r = random(); + if (self.level == BARON_FIRE) + { + baron_cast1 (); + } + else if (self.level == BARON_EARTH) + { + if ((r < 0.5) && !super_active && Grounded (self.enemy)) + baron_slam1(); + else if (BaronGolem_Check ()) + baron_cast1(); + else + return FALSE; + } + else if (self.level == BARON_AIR) + { + if (UpIsSky (self.enemy.origin)) + { + if ((r < 0.5) && !super_active) + baron_slam1(); + else + baron_cast1(); + } + else if (!super_active) + baron_slam1(); + else + return FALSE; + } + else if (self.level == BARON_WATER) + { + if ((r < 0.5) && !super_active) + baron_cast1(); + else + baron_slam1(); + } + else + return FALSE; + SUB_AttackFinished (2*r); + return TRUE; + } + return FALSE; +}; + +//============ +// --> QUAKED monster_baron (1 0 0) (-16 -16 -24) (16 16 40) Ambush x Nojump +//============ +void() monster_baron = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/drake/baron.mdl"; + // Baron files are derived from the Rapture pack. + precache_model ("progs/drake/baron.mdl"); + precache_model ("progs/drake/h_baron.mdl"); + precache_model ("progs/drake/k_ball.mdl"); + precache_model ("progs/k_spike.mdl"); + + precache_sound ("baron/bpain1.wav"); + precache_sound ("baron/death.wav"); + precache_sound ("baron/fireball.wav"); + precache_sound ("baron/idle.wav"); // Win only. + precache_sound ("baron/sight.wav"); + precache_sound ("baron/smash.wav"); + precache_sound ("baron/woosh.wav"); + precache_sound ("hknight/attack1.wav"); + precache_sound ("hknight/idle.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound ("weapons/sheath.wav"); + precache_sound ("weapons/unsheath.wav"); + +// Elemental boss barons, for Rapture maps. + precache_model ("progs/drake/ice.mdl"); +// precache_model ("progs/drake/iceball.mdl"); + precache_model ("progs/drake/plasma.mdl"); + precache_model ("progs/drake/rubble1.mdl"); + precache_model ("progs/drake/rubble2.mdl"); + precache_model ("progs/drake/rubble3.mdl"); + precache_model ("progs/drake/s_wave2.spr"); + precache_model ("progs/drake/smoke.mdl"); + precache_model ("progs/drake/flame2.mdl"); + +// precache_sound ("ambience/wind2.wav"); // Tornado +// precache_sound ("ambience/suck1.wav"); // Tornado + precache_sound ("bane/thunder.wav"); // Lightning Storm + precache_sound ("baron/e_hit.wav"); + precache_sound ("baron/icefire.wav"); + precache_sound ("baron/tornado.wav"); // Tornado + precache_sound ("dragon/icehit.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("imp/shard.wav"); + precache_sound ("misc/quake.wav"); + precache_sound ("misc/quakeend.wav"); + precache_sound ("misc/wallbrk.wav"); + precache_sound ("nemesant/bigboom.wav"); + precache_sound ("plasma/explode.wav"); + precache_sound ("plasma/fire.wav"); + precache_sound ("skullwiz/push.wav"); + precache_sound ("weapons/fwall.wav"); + precache_sound ("weapons/fwallhit.wav"); + precache_sound ("weapons/fwalltap.wav"); + precache_sound ("weapons/freeze.wav"); // Ice Mine + + precache_model ("progs/drake/akarrow.mdl"); + precache_model ("progs/drake/hk_golem.mdl"); + precache_model ("progs/drake/h_hkolem.mdl"); + precache_model ("progs/drake/st_gib1.mdl"); + precache_model ("progs/drake/st_gib2.mdl"); + precache_model ("progs/drake/st_gib3.mdl"); + + precache_sound ("golem/death.wav"); + precache_sound ("golem/sight.wav"); + precache_sound ("golem/step.wav"); + precache_sound ("hknight/grunt.wav"); + precache_sound ("hknight/slash1.wav"); + precache_sound ("misc/wallbrk.wav"); + precache_sound ("shambler/smack.wav"); + precache_sound ("weapons/mirv1.wav"); // In case MIRV is forbidden. + precache_model ("progs/drake/s_wave.spr"); + precache_model ("progs/drake/s_expbig.spr"); + precache_model ("progs/drake/s_fancy.spr"); + + self.sight_sound = "baron/sight.wav"; + + if (self.level) { + //self.purse_x = (self.level & 3) + 5; + //self.xfl = self.xfl | XFL_BOSS; + self.bossflag = TRUE; + // Set default health for Rapture's elemental barons. + if (self.health < 1) { + if (self.level == BARON_WATER) { + self.health = 1000; + if (self.deathstring == "") self.deathstring = " was liquidated by the Water Baron\n"; + } else if (self.level == BARON_FIRE) { + self.health = 1400; + if (self.deathstring == "") self.deathstring = " was scorched by the Fire Baron\n"; + } else if (self.level == BARON_EARTH) { + self.health = 1900; + if (self.deathstring == "") self.deathstring = " was buried by the Earth Baron\n"; + self.mass = MASS_SUPER; // Is one with the earth. + } else if (self.level == BARON_AIR) { + self.health = 2200; + if (self.deathstring == "") self.deathstring = " was blown away by the Wind Baron\n"; + } + } else { + //if (cvar("skill") >= 1) + // self.th_harass = BaronBossCheckAttack; + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " became a Baron's thrill kill\n"; + } else { + if (self.deathstring == "") self.deathstring = " was ruled by a Baron\n"; + } + } + } else { + if (self.health < 1) self.health = 500; + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " became a Baron's thrill kill\n"; + } else { + if (self.deathstring == "") self.deathstring = " was ruled by a Baron\n"; + } + } + // Nehahra pegs gib_health at -50. Was -40 before I saw Nehahra source. + self.gibhealth = -50; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + self.headmdl = "progs/drake/h_baron.mdl"; + self.mass = MASS_HEAVY; // Really big, buff badass human. + + self.th_stand = baron_stand; + self.th_walk = baron_walk; + self.th_run = baron_run; + self.th_melee = baron_melee; + self.th_missile = baron_missile; + self.th_pain = baron_pain; + self.th_die = baron_die; + self.th_jump = baron_tjump; + self.blockudeath = FALSE;// Humanoid death sound + + self.hittype = HIT_METAL; + self.state = FALSE; // Use sword as the first attack. + self.xfl = XFL_ARMORED; + //self.purse = '3 0.75 0.25'; + //self.hittype = HIT_METAL; + + //if (soul_evil) + // monster_purse (self.purse_x, self.purse_y, self.purse_z); + //else + // self.purse = '0 0 0'; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.classtype = CT_MONBARON; + self.classgroup = CG_DCAPTAIN; + self.classmove = MON_MOVEWALK; + + monster_start (); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_boil.qc b/QC_other/QC_keep/mon_boil.qc new file mode 100644 index 00000000..83b95b7c --- /dev/null +++ b/QC_other/QC_keep/mon_boil.qc @@ -0,0 +1,458 @@ +/*============================================================================== +BOIL/BOMB model by Ijed, QC/Gameplay by Sock +==============================================================================*/ + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame explode1 explode2 explode3 explode4 explode5 explode6 +$frame explode7 explode8 explode9 + +$frame hobA1 hobA2 hobA3 hobA4 hobA5 hobA6 hobA7 hobA8 hobA9 hobA10 + +$frame hobB1 hobB2 hobB3 hobB4 hobB5 hobB6 hobB7 hobB8 hobB9 hobB10 + +//============================================================================= +void() boil_stand1 = [ $stand1, boil_stand2 ] {monster_idle_sound(); ai_stand();} +void() boil_stand2 = [ $stand2, boil_stand3 ] {ai_stand();}; +void() boil_stand3 = [ $stand3, boil_stand4 ] {ai_stand();}; +void() boil_stand4 = [ $stand4, boil_stand5 ] {ai_stand();}; +void() boil_stand5 = [ $stand5, boil_stand6 ] {ai_stand();}; +void() boil_stand6 = [ $stand6, boil_stand7 ] {ai_stand();}; +void() boil_stand7 = [ $stand7, boil_stand8 ] {ai_stand();}; +void() boil_stand8 = [ $stand8, boil_stand9 ] {ai_stand();}; +void() boil_stand9 = [ $stand9, boil_stand10 ] {ai_stand();}; +void() boil_stand10 = [ $stand10, boil_stand11 ] {ai_stand();}; +void() boil_stand11 = [ $stand11, boil_stand12 ] {ai_stand();}; +void() boil_stand12 = [ $stand12, boil_stand13 ] {ai_stand();}; +void() boil_stand13 = [ $stand13, boil_stand14 ] {ai_stand();}; +void() boil_stand14 = [ $stand14, boil_stand15 ] {ai_stand();}; +void() boil_stand15 = [ $stand15, boil_stand16 ] {ai_stand();}; +void() boil_stand16 = [ $stand16, boil_stand1 ] {ai_stand();}; + +//============================================================================= +void() boil_walk1 = [ $walk1, boil_walk2 ] { + monster_idle_sound(); ai_walk(0);}; +void() boil_walk2 = [ $walk2, boil_walk3 ] {monster_footstep(TRUE);ai_walk(3);}; +void() boil_walk3 = [ $walk3, boil_walk4 ] {ai_walk(4);}; +void() boil_walk4 = [ $walk4, boil_walk5 ] {ai_walk(3);}; +void() boil_walk5 = [ $walk5, boil_walk6 ] {ai_walk(3);}; +void() boil_walk6 = [ $walk6, boil_walk7 ] {ai_walk(2);}; +void() boil_walk7 = [ $walk7, boil_walk8 ] {ai_walk(1);}; +void() boil_walk8 = [ $walk8, boil_walk9 ] {ai_walk(2);}; + +void() boil_walk9 = [ $walk9, boil_walk10 ] {ai_walk(0);}; +void() boil_walk10 = [ $walk10, boil_walk11 ] {monster_footstep(TRUE);ai_walk(3);}; +void() boil_walk11 = [ $walk11, boil_walk12 ] {ai_walk(1);}; +void() boil_walk12 = [ $walk12, boil_walk13 ] {ai_walk(2);}; +void() boil_walk13 = [ $walk13, boil_walk14 ] {ai_walk(3);}; +void() boil_walk14 = [ $walk14, boil_walk15 ] {ai_walk(3);}; +void() boil_walk15 = [ $walk15, boil_walk16 ] {ai_walk(2);}; +void() boil_walk16 = [ $walk16, boil_walk1 ] {ai_walk(2);}; + +//---------------------------------------------------------------------- +// Used for testing run animation speed and sliding feet problems +//---------------------------------------------------------------------- +/*void() boil_walk1 = [ $run1, boil_walk2 ] {monster_footstep(TRUE);ai_walk(4);}; +void() boil_walk2 = [ $run2, boil_walk3 ] {monster_idle_sound(); ai_walk(16);}; +void() boil_walk3 = [ $run3, boil_walk4 ] {ai_walk(8);}; +void() boil_walk4 = [ $run4, boil_walk5 ] {ai_walk(4);}; +void() boil_walk5 = [ $run5, boil_walk6 ] {monster_footstep(TRUE);ai_walk(4);}; +void() boil_walk6 = [ $run6, boil_walk7 ] {ai_walk(16);}; +void() boil_walk7 = [ $run7, boil_walk8 ] {ai_walk(8);}; +void() boil_walk8 = [ $run8, boil_walk1 ] {ai_walk(4);};*/ + +//============================================================================ +void() boil_run1 = [ $run1, boil_run2 ] {monster_footstep(TRUE);ai_run(4);}; +void() boil_run2 = [ $run2, boil_run3 ] {monster_idle_sound(); ai_run(16);}; +void() boil_run3 = [ $run3, boil_run4 ] {ai_run(8);}; +void() boil_run4 = [ $run4, boil_run5 ] {ai_run(4);}; +void() boil_run5 = [ $run5, boil_run6 ] {monster_footstep(TRUE);ai_run(4);}; +void() boil_run6 = [ $run6, boil_run7 ] {ai_run(16);}; +void() boil_run7 = [ $run7, boil_run8 ] {ai_run(8);}; +void() boil_run8 = [ $run8, boil_run1 ] {ai_run(4);}; + +//====================================================================== +// Running Boil Explosive Attack +//====================================================================== +void() boil_expl1 = [ $explode1, boil_expl2 ] {ai_face(); + sound (self, CHAN_VOICE, "zombie/boil_windup.wav", 1, ATTN_NORM);}; +void() boil_expl2 = [ $explode2, boil_expl3 ] {ai_face();}; +void() boil_expl3 = [ $explode3, boil_expl4 ] {ai_face();}; +void() boil_expl4 = [ $explode4, boil_expl5 ] {ai_face();}; +void() boil_expl5 = [ $explode5, boil_expl6 ] {ai_face();}; +void() boil_expl6 = [ $explode6, boil_expl7 ] {ai_face();}; +void() boil_expl7 = [ $explode7, boil_expl8 ] {ai_face();}; +void() boil_expl8 = [ $explode8, boil_expl9 ] {ai_face();}; +void() boil_expl9 = [ $explode9, boil_expl9 ] { + T_Damage (self, self, self, self.health+1, NOARMOR); +}; + +//====================================================================== +// Stationary Boil - Nailed to the floor or wall +//====================================================================== +void() boil_suicide = +{ + if (self.health < 1) return; + self.use = SUB_Null; + // Make sure current enemy is the cause of the damage + T_Damage (self, self, self.enemy, self.health+1, NOARMOR); +}; + +//---------------------------------------------------------------------- +void() boil_checktarget = +{ + local entity client; + + // Should never have an active enemy + self.enemy = self.goalentity = world; + + // Get the obvious exception(s) done first + if (self.health < 1) return; + if (intermission_running) return; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return; + if (client.flags & FL_NOTARGET) return; + if (client.items & IT_INVISIBILITY) return; + + // Check if the player is visible? + enemy_vis = visible(client); + if (!enemy_vis) return; + + // Store client/player for later damage + self.enemy = client; + + // Is the player within range to blow up? + self.enemydist = range_distance(client, FALSE); + if (self.enemydist < self.t_width) self.th_melee(); +}; + +//---------------------------------------------------------------------- +void() boil_squirtblood = +{ + if (self.waitmin < time) { + self.waitmin = time + self.wait + random() * self.wait; + sound (self, CHAN_WEAPON, "zombie/boil_squirt.wav", 1, ATTN_IDLE); + + SpawnProjectileMeat(self,self.origin,self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + // Randomly spawn an extra gib of flesh + if (random() < 0.25) SpawnProjectileMeat(self,self.origin,self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + } +}; + +//---------------------------------------------------------------------- +void() boil_hoba1 = [ $hobA1, boil_hoba2 ] { + self.nextthink = self.nextthink + random()*0.2; + monster_idle_sound();boil_squirtblood();boil_checktarget(); +}; +void() boil_hoba2 = [ $hobA2, boil_hoba3 ] {boil_checktarget();}; +void() boil_hoba3 = [ $hobA3, boil_hoba4 ] { + self.nextthink = self.nextthink + random()*0.2; + boil_checktarget();}; +void() boil_hoba4 = [ $hobA2, boil_hoba1 ] {boil_checktarget();}; + +//---------------------------------------------------------------------- +void() boil_HexpA1 = [ $hobA2, boil_HexpA2 ] { + sound (self, CHAN_VOICE, "zombie/boil_windup.wav", 1, ATTN_NORM);}; +void() boil_HexpA2 = [ $hobA3, boil_HexpA3 ] {}; +void() boil_HexpA3 = [ $hobA4, boil_HexpA4 ] {}; +void() boil_HexpA4 = [ $hobA5, boil_HexpA5 ] {}; +void() boil_HexpA5 = [ $hobA6, boil_HexpA6 ] {}; +void() boil_HexpA6 = [ $hobA7, boil_HexpA7 ] {}; +void() boil_HexpA7 = [ $hobA8, boil_HexpA8 ] {}; +void() boil_HexpA8 = [ $hobA9, boil_HexpA9 ] {}; +void() boil_HexpA9 = [ $hobA10, boil_HexpA9 ] {boil_suicide();}; + +//---------------------------------------------------------------------- +void() boil_hobb1 = [ $hobB1, boil_hobb2 ] { + self.nextthink = self.nextthink + random()*0.2; + monster_idle_sound();boil_squirtblood();boil_checktarget(); +}; +void() boil_hobb2 = [ $hobB2, boil_hobb3 ] {boil_checktarget();}; +void() boil_hobb3 = [ $hobB3, boil_hobb4 ] { + self.nextthink = self.nextthink + random()*0.2; + boil_checktarget();}; +void() boil_hobb4 = [ $hobB2, boil_hobb1 ] {boil_checktarget();}; + +//---------------------------------------------------------------------- +void() boil_HexpB1 = [ $hobB2, boil_HexpB2 ] { + sound (self, CHAN_VOICE, "zombie/boil_windup.wav", 1, ATTN_NORM);}; +void() boil_HexpB2 = [ $hobB3, boil_HexpB3 ] {}; +void() boil_HexpB3 = [ $hobB4, boil_HexpB4 ] {}; +void() boil_HexpB4 = [ $hobB5, boil_HexpB5 ] {}; +void() boil_HexpB5 = [ $hobB6, boil_HexpB6 ] {}; +void() boil_HexpB6 = [ $hobB7, boil_HexpB7 ] {}; +void() boil_HexpB7 = [ $hobB8, boil_HexpB8 ] {}; +void() boil_HexpB8 = [ $hobB9, boil_HexpB9 ] {}; +void() boil_HexpB9 = [ $hobB10, boil_HexpB9 ] {boil_suicide();}; + +//====================================================================== +// NO PAIN +//====================================================================== +void(entity inflictor, entity attacker, float take) boil_pain = +{ + // Spawn some grey particles and chunk of meat + SpawnProjectileSmoke(self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + SpawnProjectileMeat(self,self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + // Random chance of more smokey meat + if (random() < 0.5) { + SpawnProjectileSmoke(self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + SpawnProjectileMeat(self,self.origin, self.brkvelbase_x, self.brkvelbase_y, self.brkvelbase_z); + } + + // No special animation + return; +}; + +//============================================================================ +void() boil_explode = { + // Needs special version of radius damage function (T_RadiusDamage) + // Boss monsters are always immune to this kind of damage + // Needs to do infighting damage before T_Damage function + // There is no rocket resistance to this kind damage! + // Must pass on self.enemy so that any death triggers work properly + // + self.enemytarget = findradius(self.origin, self.death_dmg+40); + // Loop through chain list + while(self.enemytarget) { + // Ignore self and world and can never damage bosses + if (self.enemytarget != world && self.enemytarget != self && self.enemytarget.bossflag == 0) { + // Check for any breakables which are prone to explosive damage + if (ai_foundbreakable(self.enemy, self.enemytarget,TRUE) && + self.enemytarget.brktrigmissile != 0) { + trigger_ent(self.enemytarget, self.enemy); + } + else { + // Can be damaged and NOT immune to radius (splash) damage + if (self.enemytarget.takedamage > 0 && self.enemytarget.noradiusdmg == 0) { + // Make sure monsters take more damage + if (self.enemytarget.flags & FL_MONSTER) + self.dmg = self.death_dmg * self.infightextra; + else { + // Use original radius formula for non monsters + self.pos1 = self.enemytarget.origin + (self.enemytarget.mins + self.enemytarget.maxs)*0.5; + self.dmg = 0.5*vlen (self.origin - self.pos1); + if (self.dmg < 0) self.dmg = 0; + self.dmg = self.death_dmg - self.dmg; + } + + if (self.dmg > 0 && self.enemytarget.health > 0) { + // Need CanDamage to check for anything blocking LoS + if (CanDamage (self.enemytarget, self)) + // Pass on self.enemy so death triggers fire correctly + T_Damage (self.enemytarget, self, self.enemy, self.dmg, DAMARMOR); + // make sure to check for poisonous and apply debuff + if (self.dmg > 0 && self.poisonous == TRUE) PoisonDeBuff(self.enemytarget); + } + } + } + } + // Move forward in chain to next entity + self.enemytarget = self.enemytarget.chain; + } + + /*---------------------------------------------------------------------- + // I really liked this idea of the boil destroying any monster + // bodies lying closeby, BUT this is a serious processor drain + // on maps with a huge amount of monsters. + // Every monster that dies is marked and left on the floor and + // this function would search them all everytime a boil explodes! + // + // The code below works fine, BUT it should only be enabled + // for maps with small amount of available monsters + //---------------------------------------------------------------------- + + // Check for any nearby dead/lying bodies + self.enemytarget = find(world, bodyonflr, MON_ONFLR); + self.dmg = self.death_dmg * self.infightextra; + // restrict size of dead body search list + self.count = 64; + + // Cycle through list of "marked" dead bodies + // These entities cannot be found by a findradius command + // They are setup nonsolid and have to be checked manually + while (self.enemytarget) { + // Work out how close the body is to the boil + self.enemydist = vlen(self.origin - self.enemytarget.origin); + if (self.enemydist < self.death_dmg+40) { + // Use shadow axe gib function (moved to ai_gib) + monster_flrbody_gib(self.enemytarget, self.dmg); + } + // Only check the first xx dead bodies in the list + self.count = self.count - 1; + if (self.count < 1) self.enemytarget = world; + else self.enemytarget = find(self.enemytarget, bodyonflr, MON_ONFLR); + } + */ + + // Show classic grenade explosion effect + // Switch explosions effect based on poison flag + if (self.poisonous) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 51); + WriteByte (MSG_BROADCAST, 8); + } + else { + // Show classic grenade explosion effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } +}; + +//---------------------------------------------------------------------- +void() boil_die = +{ + // Upward fountain of gibs + self.max_health = MON_GIBFOUNTAIN; + monster_death_precheck(); + // New gib + loud explosion sound + sound (self, CHAN_AUTO, "zombie/boil_explode.wav", 1, ATTN_NORM); + // Delay the t_radius explosion for one frame + // Just in case several are standing next to each other + // otherwise there will be a runaway crash loop + self.think = boil_explode; + self.nextthink = time + 0.1; +}; + + +/*====================================================================== + QUAKED monster_boil (1 0 0) (-16 -16 -24) (16 16 32) +======================================================================*/ +void() monster_boil = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_boil.mdl"; + precache_model (self.mdl); + + self.idle_sound = "zombie/boil_idle1.wav"; + self.idle_sound2 = "zombie/boil_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.sight_sound = "zombie/boil_sight.wav"; + precache_sound (self.sight_sound); + self.pain_sound = SOUND_EMPTY; + precache_sound ("zombie/boil_squirt.wav"); + precache_sound ("zombie/boil_windup.wav"); + precache_sound ("zombie/boil_explode.wav"); + + precache_poisongibs(); // precache gibs + if (self.poisonous) self.gibtype = GIBTYPE_POISON; + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 40; + self.gibhealth = -60; // Never used + self.gibbed = FALSE; // In one piece + self.pain_flinch = 10; // Has gib splash + self.steptype = FS_TYPESLOW; // Tiny feet + self.gibondeath = TRUE; // Always blow up! + self.blockudeath = TRUE; // No humanoid death sound + if (self.death_dmg < 1) self.death_dmg = DAMAGE_BOIL; + if (self.infightextra < 1) self.infightextra = 16; + + self.attack_instant = 1; // Start moving right away + + // Setup timer for flesh gib squirting from body + if (self.wait < 1) self.wait = 4; + self.waitmin = time + self.wait + random() * self.wait; + // Randomly pick one from the first four skins + // 0=flesh, 1=brown, 2=green1, 3=green2, 4=flesh + if (!self.exactskin) self.randomskin = 4; + self.brkvelbase = '200 50 150'; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // All boils die the same way + self.th_checkattack = BoilCheckAttack; + self.th_pain = boil_pain; + self.th_die = boil_die; + + self.classtype = CT_MONBOIL; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEWALK; + + // Setup random hobble animation + if (self.spawnflags & ( MON_BOIL_HOBBLED | MON_BOIL_HANGING)) { + // A = Crossed legs, B = Straight legs + if (random() < 0.5) { + self.th_stand = self.th_walk = self.th_run = boil_hoba1; + self.th_melee = boil_HexpA1; + } + else { + self.th_stand = self.th_walk = self.th_run = boil_hobb1; + self.th_melee = boil_HexpB1; + } + // No movement, turret mode + self.movespeed = -1; + // The stationary boil cannot start angry at anything + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SPAWN_ANGRY); + self.angrytarget = ""; + // Instantly blow up when triggered + self.think1 = boil_suicide; + // Cannot have sight sound, its nailed to wall/floor! + self.sight_sound = SOUND_EMPTY; + // Allow for override on exploding trigger radius + if (self.t_width < 1) self.t_width = MONAI_HOBBLEBOIL; + } + + // Hobbled hanging upside down on wall? + if (self.spawnflags & MON_BOIL_HANGING) { + // Make sure angle is within range (0-360) + if (self.angles_y < 0) self.angles_y = 360; + // Calculate opposite facing direction + self.movedir = '0 0 0'; + self.movedir_y = anglemod(self.angles_y + 180); + // Calculate upward vector and rotate monster + makevectors(self.angles); + self.angles = self.movedir + vectoangles(v_up); + // Pull monster away from wall + self.origin = self.origin + v_forward*10; + // Allow monster to float and no ground check + self.classmove = MON_MOVEFLY; + self.flags = self.flags | FL_FLY; + // Setup squirt distance for blood + self.brkvelbase = '100 50 150'; + } + // Hobbled legs with spikes (ground pose) + else if (self.spawnflags & MON_BOIL_HOBBLED) { + // Check for random floor rotation and setup no movment + if (self.angles_y < 0) self.angles_y = rint(random()*360); + // Setup squirt distance for blood + self.brkvelbase = '100 300 100'; + } + else { + // Allow for override on exploding trigger radius + if (self.t_width < 1) self.t_width = MONAI_MELEEBOIL; + // Default stand, walk & run + self.th_stand = boil_stand1; + self.th_walk = boil_walk1; + self.th_run = boil_run1; + self.th_melee = boil_expl1; + } + + if (self.deathstring == "") self.deathstring = " was blown away by a Boil\n"; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_bossboglord.qc b/QC_other/QC_keep/mon_bossboglord.qc new file mode 100644 index 00000000..3fba07d3 --- /dev/null +++ b/QC_other/QC_keep/mon_bossboglord.qc @@ -0,0 +1,573 @@ +/*============================================================================== +BOG LORD (Based on Shambler) +==============================================================================*/ + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 + +$frame run1 run2 run3 run4 run5 run6 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 + +$frame swingr1 swingr2 swingr3 swingr4 swingr5 +$frame swingr6 swingr7 swingr8 swingr9 + +$frame swingl1 swingl2 swingl3 swingl4 swingl5 +$frame swingl6 swingl7 swingl8 swingl9 + +$frame magic1 magic2 magic3 magic4 magic5 +$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 + +//====================================================================== +void() bogl_stand1 =[ $stand1, bogl_stand2 ] {monster_idle_sound();ai_stand();}; +void() bogl_stand2 =[ $stand2, bogl_stand3 ] {ai_stand();}; +void() bogl_stand3 =[ $stand3, bogl_stand4 ] {ai_stand();}; +void() bogl_stand4 =[ $stand4, bogl_stand5 ] {ai_stand();}; +void() bogl_stand5 =[ $stand5, bogl_stand6 ] {ai_stand();}; +void() bogl_stand6 =[ $stand6, bogl_stand7 ] {ai_stand();}; +void() bogl_stand7 =[ $stand7, bogl_stand8 ] {ai_stand();}; +void() bogl_stand8 =[ $stand8, bogl_stand9 ] {ai_stand();}; +void() bogl_stand9 =[ $stand9, bogl_stand10] {ai_stand();}; +void() bogl_stand10 =[ $stand10, bogl_stand11] {ai_stand();}; +void() bogl_stand11 =[ $stand11, bogl_stand12] {ai_stand();}; +void() bogl_stand12 =[ $stand12, bogl_stand13] {ai_stand();}; +void() bogl_stand13 =[ $stand13, bogl_stand14] {ai_stand();}; +void() bogl_stand14 =[ $stand14, bogl_stand15] {ai_stand();}; +void() bogl_stand15 =[ $stand15, bogl_stand16] {ai_stand();}; +void() bogl_stand16 =[ $stand16, bogl_stand17] {ai_stand();}; +void() bogl_stand17 =[ $stand17, bogl_stand1 ] {ai_stand();}; + +//====================================================================== +void() bogl_walk1 =[ $walk1, bogl_walk2 ] {monster_idle_sound(); ai_walk(10);}; +void() bogl_walk2 =[ $walk2, bogl_walk3 ] {monster_footstep(FALSE); ai_walk(9);}; +void() bogl_walk3 =[ $walk3, bogl_walk4 ] {ai_walk(9);}; +void() bogl_walk4 =[ $walk4, bogl_walk5 ] {ai_walk(5);}; +void() bogl_walk5 =[ $walk5, bogl_walk6 ] {ai_walk(6);}; +void() bogl_walk6 =[ $walk6, bogl_walk7 ] {ai_walk(12);}; +void() bogl_walk7 =[ $walk7, bogl_walk8 ] {monster_footstep(FALSE); ai_walk(8);}; +void() bogl_walk8 =[ $walk8, bogl_walk9 ] {ai_walk(3);}; +void() bogl_walk9 =[ $walk9, bogl_walk10] {ai_walk(13);}; +void() bogl_walk10 =[ $walk10, bogl_walk11] {ai_walk(9);}; +void() bogl_walk11 =[ $walk11, bogl_walk12] {ai_walk(7);}; +void() bogl_walk12 =[ $walk12, bogl_walk1 ] {ai_walk(7);}; + +//====================================================================== +void() bogl_run1 =[ $run1, bogl_run2 ] {monster_idle_sound(); ai_run(20);}; +void() bogl_run2 =[ $run2, bogl_run3 ] {monster_footstep(FALSE); ai_run(24);}; +void() bogl_run3 =[ $run3, bogl_run4 ] {ai_run(20);}; +void() bogl_run4 =[ $run4, bogl_run5 ] {ai_run(20);}; +void() bogl_run5 =[ $run5, bogl_run6 ] {monster_footstep(FALSE); ai_run(24);}; +void() bogl_run6 =[ $run6, bogl_run1 ] {ai_run(20);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() bogl_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.alpha = 0.85; + } + if (!self.attachment2) { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_ATTACHMENT; + self.attachment2.alpha = 0.85; + } + + if (!self.attachment3) { + self.attachment3 = spawn(); + self.attachment3.owner = self; + self.attachment3.classtype = CT_ATTACHMENT; + self.attachment3.alpha = 1.0; + } +}; + +//---------------------------------------------------------------------- +void() bogl_finish_attachment = +{ + if (self.attachment) setmodel(self.attachment, ""); + if (self.attachment2) setmodel(self.attachment2, ""); + if (self.attachment3) setmodel(self.attachment3, ""); +}; + +//---------------------------------------------------------------------- +void() bogl_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } + if (self.attachment2) { + self.attachment2.think = SUB_Remove; + self.attachment2.nextthink = time + 0.1; + } + if (self.attachment3) { + self.attachment3.think = SUB_Remove; + self.attachment3.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - overhead SMASH/slime +//====================================================================== +void(vector leftofs, vector rightofs) bogl_throwslime = +{ + local vector org, btarg, dir, avel; + + // Finished with growing balls of slime + bogl_finish_attachment(); + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + makevectors(self.angles); + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_BLORDBALL + (skill * SPEED_BLORDSKILL); + + // Fire left hand off center and at players feet + org = self.origin + attack_vector(leftofs); + btarg =self.enemy.origin + v_right*8 - v_up*8; + dir = normalize(btarg - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_BLORD, self.attack_speed); + + // Fire right hand off center and at players feet + org = self.origin + attack_vector(rightofs); + btarg =self.enemy.origin - v_right*8 - v_up*8; + dir = normalize(btarg - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_BLORD, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float sbframe, float chfeet) bogl_slimeball = +{ + local vector org; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) bogl_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (sbframe == 0) { + setorigin(self.attachment, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment, MODEL_PROJ_BLORD2B); + else setmodel(self.attachment, MODEL_PROJ_BLORD1B); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + setorigin(self.attachment2, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment2, MODEL_PROJ_BLORD2B); + else setmodel(self.attachment2, MODEL_PROJ_BLORD1B); + setsize (self.attachment2, VEC_ORIGIN, VEC_ORIGIN); + self.attachment2.movetype = MOVETYPE_NONE; + self.attachment2.solid = SOLID_NOT; + } + + // Move+Turn towards enemy and make vector + ai_charge(chfeet); + makevectors(self.angles); + + // Generate attachment in hand (left) + org = self.origin + attack_vector(leftofs); + setorigin(self.attachment, org); + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = sbframe; + + // Generate attachment in hand (right) + org = self.origin + attack_vector(rightofs); + setorigin(self.attachment2, org); + self.attachment2.angles_y = rint(random()*359); + self.attachment2.frame = sbframe; +}; + +//---------------------------------------------------------------------- +void() bogl_smash1 =[ $smash1, bogl_smash2 ] { ai_charge(2); + // Cycle around the melee sounds + self.meleeattack = self.meleeattack + 1; + if (self.meleeattack > 2) self.meleeattack = 0; + // Never play the same melee sound twice + if (self.meleeattack == 0) { + sound (self, CHAN_VOICE, "boglord/melee1.wav", 1, ATTN_NORM);} + else if (self.meleeattack == 1) { + sound (self, CHAN_VOICE, "boglord/melee2.wav", 1, ATTN_NORM);} + else {sound (self, CHAN_VOICE, "boglord/melee3.wav", 1, ATTN_NORM);} +}; +void() bogl_smash2 =[ $smash2, bogl_smash3 ] {monster_footstep(FALSE); + bogl_slimeball('21 70 60','32 -53 64',0,6);}; +void() bogl_smash3 =[ $smash3, bogl_smash4 ] { + bogl_slimeball('-5 66 102','2 -58 104',1,6);}; +void() bogl_smash4 =[ $smash4, bogl_smash5 ] { + bogl_slimeball('-34 48 122','-34 -48 124',2,5);}; +void() bogl_smash5 =[ $smash5, bogl_smash6 ] { + bogl_slimeball('-58 30 114','-60 -30 114',3,4);}; +void() bogl_smash6 =[ $smash6, bogl_smash7 ] { + bogl_slimeball('-58 20 109','-62 -17 110',4,1);}; +void() bogl_smash7 =[ $smash7, bogl_smash8 ] { + bogl_slimeball('-24 20 114','-26 -14 124',5,0);}; +void() bogl_smash8 =[ $smash8, bogl_smash9 ] { + bogl_slimeball('32 24 108','42 -18 108',6,0);}; +void() bogl_smash9 =[ $smash9, bogl_smash10] { + bogl_throwslime('32 24 108','42 -18 108');}; +void() bogl_smash10 =[ $smash10, bogl_smash11] {ai_charge(0);}; +void() bogl_smash11 =[ $smash11, bogl_smash12] {ai_charge(5);}; +void() bogl_smash12 =[ $smash12, bogl_run1 ] {ai_charge(4);}; + +//====================================================================== +// RANGE ATTACK 2 - Projectile Lightning attack +//====================================================================== +void() bogl_lightning = +{ + local vector org, dir, vec; + if (self.health < 1) return; + + ai_face (); + self.effects = self.effects | EF_MUZZLEFLASH; + + // Setup skill based attack speed + self.attack_speed = SPEED_BLORDBOLT + (skill * SPEED_BLORDSKILL); + sound (self, CHAN_WEAPON, "boglord/bolt_fire.wav", 1, ATTN_NORM); + + // Aim around player + makevectors (self.angles); + org = self.pos3 + vecrand(10,10,1); + vec = v_right*(crandom()*(20+random()*50)); + dir = normalize((self.enemy.origin + vec) - org); + launch_projectile(org, dir, CT_PROJ_BLBOLT, self.attack_speed); + + org = self.pos3 + vecrand(10,10,1); + vec = v_right*(crandom()*(20+random()*50)); + dir = normalize((self.enemy.origin + vec) - org); + launch_projectile(org, dir, CT_PROJ_BLBOLT, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float sbframe) bogl_casting = +{ + local vector dir, tang; + local float midpoint; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) bogl_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (sbframe == 0) { + setorigin(self.attachment, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment, MODEL_PROJ_BLORDBEAM2); + else setmodel(self.attachment, MODEL_PROJ_BLORDBEAM1); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.frame = 1; + + setorigin(self.attachment2, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment2, MODEL_PROJ_BLORDBEAM2); + else setmodel(self.attachment2, MODEL_PROJ_BLORDBEAM1); + setsize (self.attachment2, VEC_ORIGIN, VEC_ORIGIN); + self.attachment2.movetype = MOVETYPE_NONE; + self.attachment2.solid = SOLID_NOT; + self.attachment2.frame = 1; + + setorigin(self.attachment3, self.origin); + if (self.spawnflags & MON_BOGL_STRONG) + setmodel(self.attachment3, MODEL_PROJ_BLORD2B); + else setmodel(self.attachment3, MODEL_PROJ_BLORD1B); + setsize (self.attachment3, VEC_ORIGIN, VEC_ORIGIN); + self.attachment3.movetype = MOVETYPE_NONE; + self.attachment3.solid = SOLID_NOT; + } + + // Turn toward enemy + ai_face(); + makevectors(self.angles); + + // Work out each hand position + self.pos1 = self.origin + attack_vector(leftofs); + self.pos2 = self.origin + attack_vector(rightofs); + dir = normalize(self.pos2 - self.pos1); + tang = vectoangles(dir); + // Calculate the mid point between the hands for the orb + midpoint = vlen(self.pos2 - self.pos1) * 0.5; + self.pos3 = self.pos1 + (dir*midpoint); + + // Move beam sections into place along vector + setorigin(self.attachment, self.pos1+(dir*16)); + setorigin(self.attachment2, self.pos2-(dir*16)); + self.attachment.angles = self.attachment2.angles = tang; + + // Place orb in the center of the electricity + setorigin(self.attachment3, self.pos3); + self.attachment3.angles_y = rint(random()*359); + self.attachment3.frame = sbframe+8; + + particle_explode(self.pos1, 5+random()*5, 1, self.part_style, PARTICLE_BURST_LOSTUP); + particle_explode(self.pos2, 5+random()*5, 1, self.part_style, PARTICLE_BURST_LOSTUP); +}; + +//---------------------------------------------------------------------- +void() bogl_magic1 =[ $magic1, bogl_magic2 ] {ai_face(); + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "boglord/attack2.wav", 1, ATTN_NORM);}; +void() bogl_magic2 =[ $magic2, bogl_magic3 ] { + bogl_casting('0 53 86','21 -10 102',0);}; +void() bogl_magic3 =[ $magic3, bogl_magic4 ] { + bogl_casting('-16 50 95','11 0 108',1);}; +void() bogl_magic4 =[ $magic4, bogl_magic5 ] {monster_footstep(FALSE); + bogl_casting('-28 48 100','6 3 110',2);}; +void() bogl_magic5 =[ $magic5, bogl_magic6 ] { + bogl_casting('-3 34 119','19 -15 110',3);}; +void() bogl_magic6 =[ $magic6, bogl_magic9 ] {bogl_lightning(); + // Finished with growing ball of energy + bogl_finish_attachment(); + SpawnExplosion(self.part_life, self.pos3, "boglord/slime_explode.wav"); +}; +void() bogl_magic9 =[ $magic9, bogl_magic10 ] {bogl_lightning();}; +void() bogl_magic10 =[ $magic10, bogl_magic11 ] {bogl_lightning();monster_footstep(FALSE);}; +void() bogl_magic11 =[ $magic11, bogl_magic12 ] { + if (skill == SKILL_NIGHTMARE) bogl_lightning();}; +void() bogl_magic12 =[ $magic12, bogl_run1 ] {}; + +//============================================================================ +void() bogl_tetherattack = +{ + // Completely randomize tether attack chance 50/50 + // Both attacks have different advantages with different + // skill levels, might as well make it equal chance + if (random() > 0.5) self.th_melee(); + else self.th_missile(); +}; + +//============================================================================ +void() bogl_pain1 =[ $pain1, bogl_pain2 ] {}; +void() bogl_pain2 =[ $pain2, bogl_pain3 ] {}; +void() bogl_pain3 =[ $pain3, bogl_pain4 ] {}; +void() bogl_pain4 =[ $pain4, bogl_pain5 ] {}; +void() bogl_pain5 =[ $pain5, bogl_pain6 ] {}; +void() bogl_pain6 =[ $pain6, bogl_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) bogl_pain = +{ + // Finish with all attachments + bogl_finish_attachment(); + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) bogl_pain1 (); + } +}; + +//============================================================================ +// Classic death pose! Dead Boggy! +//============================================================================ +void() bogl_death1 =[ $death1, bogl_death2 ] {}; +void() bogl_death2 =[ $death2, bogl_death3 ] {monster_check_gib();}; +void() bogl_death3 =[ $death3, bogl_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() bogl_death4 =[ $death4, bogl_death5 ] {}; +void() bogl_death5 =[ $death5, bogl_death6 ] {}; +void() bogl_death6 =[ $death6, bogl_death7 ] {}; +void() bogl_death7 =[ $death7, bogl_death8 ] {}; +void() bogl_death8 =[ $death8, bogl_death9 ] {}; +void() bogl_death9 =[ $death9, bogl_death10 ] {}; +void() bogl_death10 =[ $death10, bogl_death11 ] {monster_death_postcheck();}; +void() bogl_death11 =[ $death11, bogl_death11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() bogl_die = +{ + // Finish and remove all attachments + bogl_finish_attachment(); + bogl_remove_attachment(); + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "boglord/death1.wav", 1, ATTN_NORM); + bogl_death1 (); + } + else { + //Explosion for gib death! + T_RadiusDamage (self, self, self.dmg, world, DAMAGEALL); + // Sprite/Particle based explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + // Play original explosion sound or replacement + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + } +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() bogl_wakeup1 =[ $smash7, bogl_wakeup2 ] {}; +void() bogl_wakeup2 =[ $smash8, bogl_wakeup3 ] { + sound (self, CHAN_VOICE, "boglord/melee3.wav", 1, ATTN_NORM);}; +void() bogl_wakeup3 =[ $smash9, bogl_wakeup4 ] {}; +void() bogl_wakeup4 =[ $smash10, bogl_wakeup5 ] {}; +void() bogl_wakeup5 =[ $smash11, bogl_wakeup6 ] {}; +void() bogl_wakeup6 =[ $smash12, bogl_run1 ] {}; + +/*====================================================================== +QUAKED monster_boglord (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_boglord = +{ + if (deathmatch) { remove(self); return; } + + // One model, two different skins + self.mdl = "progs/ad171/mon_bossboglord.mdl"; + + // Detect version types + if (self.spawnflags & MON_BOGL_STRONG) { + // Unique models for blood trail on model flag + self.headmdl = "progs/ad171/h_boglordb.mdl"; // +2 skins + self.gib1mdl = "progs/ad171/gib_blclaw1b.mdl"; // Left claw + self.gib2mdl = "progs/ad171/gib_blclaw2b.mdl"; // Right claw + self.gib3mdl = "progs/ad171/gib_blfoot1b.mdl"; // foot + self.gib4mdl = "progs/ad171/gib_blfoot2b.mdl"; // foot + self.part_style = PARTICLE_BURST_RED; + self.part_life = EXPLODE_MED; + if (self.health < 1) self.health = 2000; + self.poisonous = FALSE; // Cannot be poisonous + self.exactskin = 1; // Dark red/purple + if (self.deathstring == "") self.deathstring = " was toasted by a Fire Shambler\n"; + } + else { + // Unique models for wizard trail on model flags + self.headmdl = "progs/ad171/h_boglord.mdl"; // +2 skins + self.gib1mdl = "progs/ad171/gib_blclaw1.mdl"; // Left claw + self.gib2mdl = "progs/ad171/gib_blclaw2.mdl"; // Right claw + self.gib3mdl = "progs/ad171/gib_blfoot1.mdl"; // foot + self.gib4mdl = "progs/ad171/gib_blfoot2.mdl"; // foot + self.poisonous = TRUE; // Green vulcan blood! + self.gibtype = GIBTYPE_POISON; // Liquid Poison + self.part_style = PARTICLE_BURST_YELLOW; + self.part_life = EXPLODE_POISON_MED; + if (self.health < 1) self.health = 1200; + self.exactskin = 0; // Swampy green + if (self.deathstring == "") self.deathstring = " was obliterated by The Bog Lord\n"; + } + + // Precache model + unique particle trail + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // All extra/projectiles (both types) + precache_model (MODEL_PROJ_BLORD1B); // Slime ball + precache_model (MODEL_PROJ_BLORD2B); // Fire ball + precache_model (MODEL_PROJ_BLORD1S); // Floor blobs + precache_model (MODEL_PROJ_BLORDBEAM1); // Lightning between hands + precache_model (MODEL_PROJ_BLORDBEAM2); + precache_model (MODEL_PROJ_BLORDBOLT1); // Large Bolt Projectile + precache_model (MODEL_PROJ_BLORDBOLT2); + + self.idle_sound = "boglord/idle1.wav"; + self.idle_sound2 = "boglord/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("boglord/death1.wav"); + self.pain_sound = "boglord/pain1.wav"; + self.pain_sound2 = "boglord/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("boglord/melee1.wav"); + precache_sound ("boglord/melee2.wav"); + precache_sound ("boglord/melee3.wav"); + precache_sound ("boglord/bolt_fire.wav"); + + // Slime arc attack (not used anymore) + precache_sound ("boglord/attack2.wav"); + precache_sound ("boglord/slime_explode.wav"); + precache_sound ("boglord/slime_miss.wav"); + + precache_poisongibs(); // precache gibs + + // Melee attacks no longer used anymore + //self.meleehitsound = "boglord/smack.wav"; + //precache_sound (self.meleehitsound); + + self.sight_sound = "boglord/sight.wav"; + precache_sound (self.sight_sound); + precache_sound ("boglord/thud.wav"); + precache_sound ("boglord/bangdoor1.wav"); + precache_sound ("boglord/bangdoor2.wav"); + + precache_poisongibs(); // precache gibs + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 80'; + self.bboxtype = BBOX_CUSTOM; // Custom size + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.gibhealth = -60; + self.gibbed = FALSE; // Starts complete + self.pain_flinch = 400; // Really low chance of pain + self.pain_timeout = 2; // long pause on pain + self.infightextra = 8; // Does not like infighting + self.steptype = FS_TYPELARGE; // Large stomping feet + self.blockudeath = TRUE; // No player gib sound + self.tetherturn = TRUE; // Always turn towards enemy + self.tetherpause = 0.9; // Rarely pauses to attacks + self.dmg = 40; // Radius dmg for gibondeath + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0.75; + + self.th_checkattack = BogLordCheckAttack; + self.th_stand = bogl_stand1; + self.th_walk = bogl_walk1; + self.th_run = bogl_run1; + self.th_melee = bogl_smash1; + self.th_missile = bogl_magic1; + self.th_pain = bogl_pain; + self.th_die = bogl_die; + self.th_wakeup = bogl_wakeup1; + self.th_tether = bogl_tetherattack; + + self.classtype = CT_MONBOGLORD; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_bosseidolon.qc b/QC_other/QC_keep/mon_bosseidolon.qc new file mode 100644 index 00000000..dac3beca --- /dev/null +++ b/QC_other/QC_keep/mon_bosseidolon.qc @@ -0,0 +1,1088 @@ +/*============================================================================== +Eidolon Demon from Hexen2 / Altar of Storms MOD +==============================================================================*/ +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 + +$frame spell1 spell2 spell3 spell4 spell5 spell6 spell7 spell8 +$frame spell9 spell10 spell11 spell12 spell13 spell14 spell15 spell16 +$frame spell17 spell18 spell19 spell20 + +$frame howl1 howl2 howl3 howl4 howl5 howl6 howl7 howl8 +$frame howl9 howl10 howl11 howl12 howl13 howl14 howl15 howl16 +$frame howl17 howl18 howl19 howl20 howl21 howl22 howl23 howl24 +$frame howl25 howl26 howl27 howl28 + +$frame crouch1 crouch2 crouch3 crouch4 crouch5 crouch6 crouch7 crouch8 +$frame crouch9 crouch10 crouch11 crouch12 crouch13 crouch14 crouch15 crouch16 +$frame crouch17 crouch18 crouch19 crouch20 crouch21 crouch22 crouch23 crouch24 +$frame crouch25 crouch26 crouch27 crouch28 crouch29 crouch30 + +$frame crWait1 crWait2 crWait3 crWait4 crWait5 crWait6 crWait7 crWait8 +$frame crWait9 crWait10 crWait11 crWait12 crWait13 crWait14 crWait15 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 +$frame grow9 grow10 grow11 grow12 grow13 grow14 grow15 grow16 +$frame grow17 grow18 grow19 grow20 grow21 grow22 grow23 grow24 + +$frame breath1 breath2 breath3 breath4 breath5 breath6 breath7 breath8 +$frame breath9 breath10 breath11 breath12 breath13 breath14 breath15 breath16 +$frame breath17 breath18 breath19 breath20 breath21 breath22 breath23 breath24 +$frame breath25 breath26 breath27 breath28 breath29 breath30 breath31 breath32 +$frame breath33 breath34 breath35 breath36 breath37 breath38 breath39 breath40 +$frame breath41 breath42 breath43 + +$frame power1 power2 power3 power4 power5 power6 power7 power8 +$frame power9 power10 power11 power12 power13 power14 power15 power16 +$frame power17 power18 power19 power20 + +$frame painA1 painA2 painA3 painA4 painA5 painA6 painA7 painA8 painA9 +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 painB14 painB15 painB16 +$frame painB17 painB18 painB19 painB20 + +float EIDOLON_PHASE1 = 1; // Trapped in cage +float EIDOLON_PHASE2 = 2; // Fighting + +//====================================================================== +// Global functions +//====================================================================== +// Work out angle difference between player and boss +//---------------------------------------------------------------------- +float(vector targorg, float angdiff) eidolon_angcheck = +{ + self.ideal_yaw = vectoyaw(targorg - self.origin); + if ((self.ideal_yaw - angdiff) > self.angles_y) return TRUE; + else if ((self.ideal_yaw + angdiff)<self.angles_y) return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Need own find player function because of arena size +// Also setup all parameters ready to start combat quicker +//---------------------------------------------------------------------- +float() eidolon_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // Stage 1 is trapped, boss cannot attack or run + if (self.style == EIDOLON_PHASE1) return FALSE; + + // Move straight into run+attack + self.nextthink = time + 0.1; + self.think = self.th_run; // Start running + SUB_AttackFinished (1); // wait a while before first attack + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() eidolon_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP reached next wave, walk to center and fire targets +//---------------------------------------------------------------------- +float() eidolon_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") { + self.attachment2 = find(world, targetname, self.noise); + if (self.attachment2.classtype == CT_MONEIDOLONWAVE) { + // Spawn any adds to keep player busy + if (self.attachment2.target != "") + trigger_strs(self.attachment2.target, self); + + // Turn around and fire at crystal + self.th_jump(); + } + } + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + eidolon_WaveSetupHP(); // Reset trigger/hp + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Eidolon game play logic +//---------------------------------------------------------------------- +void() EidolonCheckAttack = +{ + // Check for boss wave trigger events + if (eidolon_WaveCheck() == TRUE) return; + + //---------------------------------------------------------------------- + // Check the tether system + //---------------------------------------------------------------------- + self.t_length = vlen(self.origin - self.movelast.origin); + self.t_width = vlen(self.enemy.origin - self.movelast.origin); + // Is the boss at maximum range? + if (self.t_length > MONAI_MAXEIDO) { + // Can the boss see the player? + if (enemy_vis) self.attack_state = AS_MELEE; + else { + // At max range + cannot see player, exit combat + self.enemytarget = self.enemy; + self.enemy = world; + self.goalentity = self.movetarget = self.movelast; + self.attack_state = AS_STRAIGHT; + self.think = self.th_walk; + } + return; + } + + //---------------------------------------------------------------------- + // Check Melee range and constantly fire + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_CLOSEEIDO) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // Range attacks (Boulder + Rock Storm) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + // Intense rock storm attack + if (self.enemydist < MONAI_MEDIUMEIDO && random() < 0.75) { + // Skill 0=3s, 1=2.25s, 2=1.5s, 3=0.75s + self.attack_speed = (4 - skill) * 0.75; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MELEE; + return; + } + // Large boulder attack + else { + // Skill 0=4s, 1=3s, 2=2s, 3=1s + self.attack_speed = (4 - skill) * 1; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MISSILE; + return; + } + } +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() eidolon_idle = +{ + // Do nothing if dead + if (self.health < 1) return; + if (self.walkframe == 1) monster_idle_sound(); + self.nextthink = time + 0.05; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 14) self.walkframe = 0; + self.frame = $stand1 + self.walkframe; + + // Keep looking for a player + eidolon_FindTarget (); + + if (self.style == EIDOLON_PHASE1) { + // Slow animation speed, trapped inside cage + self.nextthink = time + 0.1; + // Found a player, now track them around the room + if (self.enemy.flags & FL_CLIENT) { + if (eidolon_angcheck(self.enemy.origin, 60)) + self.think = self.th_walk; + } + } +}; + +//---------------------------------------------------------------------- +void() eidolon_stand1 = [ $stand1, eidolon_idle ] {self.walkframe = 0;}; + +//====================================================================== +// There is only one set of animations for walk and run and +// the only different is the final AI state (walk/run) +// This is a hexen2 model so it should run at 20fps not 10fps +//---------------------------------------------------------------------- +float EIDOLON_WALK = 2; +float EIDOLON_RUN = 4; + +//---------------------------------------------------------------------- +void(float fstate) eidolon_move = +{ + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.05; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 23) self.walkframe = 0; + self.frame = $walk1 + self.walkframe; + + // Check for any special frame events + if (self.frame == $walk1) monster_idle_sound(); + if (self.frame == $walk2 || self.frame == $walk14) + monster_footstep(FALSE); + + // Phase 1 (caged) uses walk to turn around + if (self.style == EIDOLON_PHASE1) { + // Wrong angle difference? keep turning + if (eidolon_angcheck(self.enemy.origin, 10)) ChangeYaw(); + else { + // Close the beginning or the end of the animation? + if (self.walkframe < 4 || self.walkframe > 20) + self.think = self.th_stand; + } + } + // Phase 2 (free) walking back to center + else if (self.style == EIDOLON_PHASE2 && fstate == EIDOLON_WALK) { + // Check for player + if (eidolon_FindTarget ()) return; + + // Calculate distance to origin location (notouch function) + self.enemydist = vlen(self.movelast.origin - self.origin); + // Reached origin point yet? + if (self.enemydist < MONAI_SPAWNEIDO) { + // Still remember the old player? + if (self.enemytarget.flags & FL_CLIENT) { + self.enemy = self.enemytarget; + self.enemytarget = world; + } + // Keep turning towards old player + if (eidolon_angcheck(self.enemy.origin, 10)) ChangeYaw(); + else self.think = self.th_stand; + } + // Still not reached center + else movetogoal(6); + } + // Time to walk or run? + else if (fstate == EIDOLON_RUN && self.enemy) ai_run(6); +}; + +//---------------------------------------------------------------------- +void() eidolon_walk1 = [ $walk1, eidolon_walk1 ] {eidolon_move(EIDOLON_WALK);}; +void() eidolon_run1 = [ $walk1, eidolon_run1 ] {eidolon_move(EIDOLON_RUN);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() eidolon_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_EIDO1; + } +}; + +//---------------------------------------------------------------------- +void() eidolon_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() eidolon_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//====================================================================== +// ATTACK A - Fire large explosive rock (grenade) +// Animation - Spell, put right hand up and infront +//====================================================================== +void(vector rockofs) Fire_attackA = +{ + local float foffset, offset, shotcount; + local vector org, sorg, dir, offang, avel; + + // Finished with growing rock + eidolon_finish_attachment(); + + if (!self.enemy) return; + if (self.health < 1) return; + + makevectors(self.angles); + org = self.origin + attack_vector(rockofs); + self.effects = self.effects | EF_MUZZLEFLASH; + + // create an arc of rockets fanning outwards from source + foffset = 8; + offset = -foffset; shotcount = 3; + while (shotcount > 0) { + // based angle of projectiles on straight line between source and target + offang = vectoangles ((self.enemy.origin-'0 0 24') - org); + offang_y = offang_y + offset; + makevectors (offang); + + // Randomly spawn projectiles around central point + sorg = org + v_up * (5 + random() * 10); + + // Straight line velocity from source to target + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; // Slight wiggle up/down + avel = vecrand(100,200,FALSE); + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_EIDOROCK + (skill * SPEED_EIDOSKILL) + random()*10; + Launch_Missile (sorg, dir, avel, CT_PROJ_EIDO1, self.attack_speed ); + offset = offset + foffset; + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +void(vector rockofs, float rockframe) Setup_attackA = +{ + local vector org; + + // Check if attachment has been setup yet + if (!self.attachment) eidolon_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (rockframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 0; + + // Start throwing rock sound + sound (self, CHAN_WEAPON, "eidolon/attacka.wav", 1, ATTN_NORM); + } + + // Turn towards enemy and update model attachment + // The offset is based on the Eidolon facing forward + makevectors(self.angles); + org = self.origin + attack_vector(rockofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = rockframe; + // Random explosion like particles from ball as it grows + particle_explode(self.attachment.origin, 10+random()*10, 0.5+random(), PARTICLE_BURST_WHITE, 0); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackA2 = { + // Do nothing if dead + if (self.health < 0) return; + + self.nextthink = time + 0.05; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 19) self.think = self.th_run; + self.frame = $spell1 + self.walkframe; + + // Keep turning towards the player + if (self.frame < $spell14) ai_face(); + + // Check the state of the projectile (grow/fire) + if (self.frame == $spell4) Setup_attackA('60 18 64',0); + else if (self.frame == $spell5) Setup_attackA('62 18 68',1); + else if (self.frame == $spell6) Setup_attackA('64 18 72',2); + else if (self.frame == $spell7) Setup_attackA('68 18 78',3); + else if (self.frame == $spell8) Setup_attackA('72 18 86',4); + else if (self.frame == $spell9) Setup_attackA('74 18 96',5); + else if (self.frame == $spell10) Setup_attackA('70 18 104',6); + else if (self.frame == $spell11) Setup_attackA('72 18 112',7); + else if (self.frame == $spell12) Setup_attackA('73 18 112',7); + else if (self.frame == $spell13) Fire_attackA('73 18 112'); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackA1 = [ $spell1, eidolon_attackA2 ] {ai_face(); + self.pain_finished = time + 1.5; + self.walkframe = 0; +}; + +//====================================================================== +// ATTACK B - Drops rocks randomly from above player +// Animation - Howl, raise arms up and then pull down +//====================================================================== +void() eidolon_attackB1 = +{ +}; + +//====================================================================== +// ATTACK C - Projectile vomit rocks and dust at the player +// Animation - breathe, swings arms back and push head forward +//====================================================================== +void(vector rockofs) Fire_attackC = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + makevectors(self.angles); + // Spawn a mist of particles where projectiles came from + org = self.origin + attack_vector(rockofs) + v_right*(crandom()*8) + v_up*(crandom()*16); + + dir = normalize(self.enemy.origin - org); + particle_explode(org, 5 + rint(random()*5), 2, PARTICLE_BURST_WHITE, PARTICLE_BURST_UPWARD); + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_EIDOSPIKE + (skill * SPEED_EIDOSKILLSP); + + launch_projectile (org, dir, CT_PROJ_GROCK, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackC2 = { + // Do nothing if dead + if (self.health < 0) return; + + self.nextthink = time + 0.05; + // Keep turning towards the player + ai_face(); + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 43) self.think = self.th_run; + self.frame = $breath1 + self.walkframe; + + // Start demon roar and then rocks!?! + if (self.frame == $breath4) + sound (self, CHAN_WEAPON, "eidolon/attackc.wav", 1, ATTN_NORM); + + // Rock breath!?! + if (self.frame > $breath17 && self.frame < $breath35) + Fire_attackC('56 0 44'); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackC1 = [ $breath1, eidolon_attackC2 ] {ai_face(); + self.pain_finished = time + 2; + self.walkframe = 0; +}; + +//====================================================================== +// ATTACK D - Throw a bunch of rocks upward towards the player +// Animation - death/grow, crouch down and swing arms upward +//====================================================================== +void() eidolon_attackD1 = +{ +}; + +//====================================================================== +// ATTACK E - Summon monsters from blocks of stone +// Animation - power, lean head back, put hands up right infront +//====================================================================== +void(vector rockofs, float rockframe) Setup_attackE = +{ + local vector org; + + // Check if attachment has been setup yet + if (!self.attachment) eidolon_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (rockframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 1; + + // Start long growl + sound (self, CHAN_VOICE, "eidolon/attacke.wav", 1, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + } + + if (rockframe == 7) { + // Goodbye little rock! + eidolon_finish_attachment(); + // Wakeup crystal and golems + if (self.attachment2.target2 != "") + trigger_strs(self.attachment2.target2, self); + } + else { + // Turn towards enemy and update model attachment + // The offset is based on the Eidolon facing forward + makevectors(self.angles); + org = self.origin + attack_vector(rockofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = rockframe; + // Random explosion like particles from ball as it grows + particle_explode(self.attachment.origin, 10+random()*10, 0.5+random(), PARTICLE_BURST_BLUE, 0); + + // Generate the lightning effect + self.effects = self.effects | EF_MUZZLEFLASH; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.attachment.origin_x); + WriteCoord (MSG_BROADCAST, self.attachment.origin_y); + WriteCoord (MSG_BROADCAST, self.attachment.origin_z); + WriteCoord (MSG_BROADCAST, self.attachment2.origin_x); + WriteCoord (MSG_BROADCAST, self.attachment2.origin_y); + WriteCoord (MSG_BROADCAST, self.attachment2.origin_z); + } +}; + +//---------------------------------------------------------------------- +void() eidolon_attackE_firing = { + self.nextthink = time + 0.1; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + // is the lightning spell finished? + if (self.walkframe > 19) { + self.think = self.th_run; + self.walkframe = 0; + Resist_ChangeType(self, FALSE); + self.takedamage = DAMAGE_YES; + self.goalentity = self.enemy; + } + self.frame = $power1 + self.walkframe; + + // Check the state of the projectile (grow/fire) + if (self.frame == $power7) Setup_attackE('68 16 84',0); + else if (self.frame == $power8) Setup_attackE('72 16 92',1); + else if (self.frame == $power9) Setup_attackE('74 16 94',2); + else if (self.frame == $power10) Setup_attackE('76 16 98',3); + else if (self.frame == $power11) Setup_attackE('76 16 102',4); + else if (self.frame == $power12) Setup_attackE('78 16 104',5); + else if (self.frame == $power13) Setup_attackE('80 16 104',7); +} + +//---------------------------------------------------------------------- +void() eidolon_attackE2 = [ $power1, eidolon_attackE_firing ] { + self.walkframe = 0; +}; + +//---------------------------------------------------------------------- +void() eidolon_attackE_turning = { + self.nextthink = time + 0.05; + + // Turn towards the power crystal + if (eidolon_angcheck(self.attachment2.origin,5)) ChangeYaw(); + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 23) { + self.think = eidolon_attackE2; + self.walkframe = 0; + } + self.frame = $walk1 + self.walkframe; + + // Check for any special frame events + if (self.frame == $walk2 || self.frame == $walk14) + monster_footstep(FALSE); + + // Move slowly closer to crystal or backward! + self.enemydist = range_distance(self.attachment2, FALSE); + if (self.enemydist > MONAI_CLOSEEIDO) movetogoal(6); + else walkmove (self.ideal_yaw - 180, 3); +}; + +//---------------------------------------------------------------------- +void() eidolon_attackE1 = [ $walk1, eidolon_attackE_turning ] { + Resist_ChangeType(self, TRUE); + self.takedamage = DAMAGE_NO; + self.goalentity = self.attachment2; + self.yaw_speed = 6; // Turning slowly + self.walkframe = 0; // Reset animation counter + + // Check angle difference betweem boss and crystal + // If within 5 degree's tolerance, skip turning + if (!eidolon_angcheck(self.attachment2.origin,5)) + self.think = eidolon_attackE2; +}; + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void() eidolon_painA2 = +{ + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.1; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 8) { + self.frame = $painA8; + self.think = eidolon_run1; + } + else self.frame = $painA1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() eidolon_painB2 = +{ + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.05; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 19) { + self.frame = $painB20; + self.think = eidolon_run1; + } + else self.frame = $painB1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() eidolon_painA1 = [ $painA1, eidolon_painA2 ] {self.walkframe = 0;}; +void() eidolon_painB1 = [ $painB1, eidolon_painB2 ] {self.walkframe = 0;}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) eidolon_pain = +{ + // Finish with all attachments + eidolon_finish_attachment(); + + // Check for boss wave trigger events + if (eidolon_WaveCheck() == TRUE) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.7) eidolon_painA1 (); // Short recoil + else { + eidolon_painB1 (); // Long recoil + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +// Oh no rocky has died!?! +//============================================================================ +void() eidolon_explode = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // No more Boss! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_PLASMA_BIG, self.origin, "eidolon/explode_death.wav"); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(11, 10 + rint(random()*10)); // Small Golem rock + ThrowGib(12, 10 + rint(random()*10)); // Large Golem rock + ThrowGib(4, 5 + rint(random()*3)); // Some flesh bits + ThrowGib(5, 5 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() eidolon_die2 = +{ + self.nextthink = time + 0.1; + if (self.frame == $crouch3) self.solid = SOLID_NOT; + + // Keep moveing the animation frame forward + if (self.walkframe < 30) { + self.walkframe = self.walkframe + 1; + self.frame = $crouch1 + self.walkframe; + } + else { + // Make sure final frame is set + self.frame = $crouch30; + + // Spawn implosion effect + if (random() < 0.5) + particle_implode(self.origin, 20+random()*20, 100, 100, PARTICLE_BURST_WHITE); + // Spawn particle smoke and explosive smoke + else { + SpawnProjectileSmoke(self.origin, 150, 100, 300); + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_WHITE); + } + + // Check for any random lightning strikes outward + if (random() < 0.5) { + self.pos1 = self.origin - '0 0 16'; + self.pos2 = vecrand(0,50,TRUE); + self.pos2_z = 25 + random()*25; // Always up! + self.pos3 = normalize(self.pos2); + traceline(self.pos1, self.pos1 + self.pos3 * 600, FALSE, self); + + // Create lightning bolt + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Play some arching lightning sounds + if (random() < 0.5) { + if (random() < 0.5) sound (self, CHAN_BODY, "eidolon/elec_arch1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "eidolon/elec_arch2.wav", 1, ATTN_NORM); + } + } + + // Cycle through end phase + self.lip = self.lip + 1; + self.nextthink = time + 0.1; // Slow down to regular time + if (self.lip == 26) sound (self, CHAN_AUTO, "eidolon/implode_death.wav", 1, ATTN_NONE); + if (self.lip > 40) eidolon_explode(); + } +}; + +//---------------------------------------------------------------------- +void() eidolon_die1 = [ $crouch1, eidolon_die2 ] { + self.walkframe = self.lip = 0; +}; + +//---------------------------------------------------------------------- +void() eidolon_die = +{ + self.deadflag = DEAD_DEAD; // the rock finally crashed + self.effects = 0; // Remove effects on death + eidolon_finish_attachment(); // Remove any attachments + eidolon_remove_attachment(); + + sound (self, CHAN_VOICE, "eidolon/death.wav", 1, ATTN_NORM); + eidolon_die1 (); +}; + +//====================================================================== +// Roar and break free from cage! +//====================================================================== +void() eidolon_free2 = +{ + // Do nothing if dead + if (self.health < 0) return; + + self.nextthink = time + 0.1; + + // Keep moveing the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 27) { + self.yaw_speed = 20; // Average Speed + Resist_ChangeType(self, FALSE); // Default resistance + self.think = self.th_run; // Start running! + } + self.frame = $howl1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() eidolon_free1 = [ $howl1, eidolon_free2 ] { + self.takedamage = DAMAGE_YES; // Enable resistance effects + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + self.walkframe = 0; +}; + +//====================================================================== +// Setup Eidolon after trigger event +//====================================================================== +void() eidolon_wakeup = +{ + self.use = SUB_Null; // No more triggers + self.style = EIDOLON_PHASE2; // Free to fight + + // Restore all think functions + self.th_stand = eidolon_stand1; + self.th_walk = eidolon_walk1; + self.th_run = eidolon_run1; + self.th_melee = eidolon_attackC1; + self.th_missile = eidolon_attackA1; + self.th_jump = eidolon_attackE1; + self.th_pain = eidolon_pain; + self.th_die = eidolon_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + + // Time for Eidolon to break free! + self.think = eidolon_free1; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() eidolon_start = +{ + self.use = SUB_Null; // Suppress trigger events + self.style = EIDOLON_PHASE1; // Trapped in cage + self.flags = FL_MONSTER; // Reset flag (no user settings) + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + setorigin(self, self.origin); + + self.yaw_speed = 6; // Really slow while in cage + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.pain_longanim = FALSE; // No axe advantage + self.takedamage = DAMAGE_NO; // Immune to damage + + self.gibhealth = -1000; // Special death sequence + self.pain_finished = self.attack_finished = 0; + + // Setup Ammo Resistance + self.resist_shells = self.resist_cells = 0; + self.resist_nails = self.resist_rockets = 0.75; + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 5; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + eidolon_WaveSetupHP(); + + // default = No think functions + self.th_checkattack = EidolonCheckAttack; + self.th_stand = self.th_walk = self.th_run = SUB_Null; + self.th_missile = self.th_die = SUB_Null; + self.th_pain = SUB_Null_pain; + + // Check there is space for Eidolon to spawn + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Tether point, save for later + self.movelast = spawn(); + self.movelast.owner = self; + self.movelast.classtype = CT_MONEIDOLON; + self.movelast.movetype = MOVETYPE_NONE; + self.movelast.solid = SOLID_NOT; + self.movelast.origin = self.origin; + setsize (self.movelast, VEC_ORIGIN, VEC_ORIGIN); + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; + + // Can only stand around and walk on the spot + self.th_stand = eidolon_stand1; + self.th_walk = self.th_run = eidolon_walk1; + + // Wait for trigger event to be free from cage + self.think = self.th_stand; + self.nextthink = time + 0.1; + self.use = eidolon_wakeup; +}; + +/*====================================================================== + QUAKED monster_eidolon (1 0 0) (-32 -32 -24) (32 32 128) +======================================================================*/ +void() monster_eidolon = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bosseidolon.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_EIDO1); + precache_model (MODEL_PROJ_GROCK1); + precache_model (MODEL_PROJ_GROCK2); + + self.gib1mdl = MODEL_PROJ_GROCK1; // small golem rock + self.gib2mdl = MODEL_PROJ_GROCK2; // medium golem rock + self.gib1frame = self.gib2frame = 9; + + // sight/pain/death sounds + self.idle_sound = "eidolon/idle1.wav"; + self.idle_sound2 = "eidolon/idle2.wav"; + self.pain_sound = "eidolon/pain.wav"; + self.sight_sound = "eidolon/sight.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.pain_sound); + precache_sound (self.sight_sound); + + // Final death sequence + precache_sound ("eidolon/death.wav"); + precache_sound ("eidolon/explode_death.wav"); + precache_sound ("eidolon/implode_death.wav"); + precache_sound ("eidolon/elec_arch1.wav"); + precache_sound ("eidolon/elec_arch2.wav"); + + // Attack A - Throw Boulder - range attack + precache_sound ("eidolon/attacka.wav"); + precache_sound ("eidolon/rock_hit1.wav"); + precache_sound ("eidolon/rock_hit2.wav"); + + // Attack C - Rockstorm - range attack + precache_sound ("eidolon/attackc.wav"); + precache_sound (SOUND_IMP_ROCK1); + precache_sound (SOUND_IMP_ROCK2); + precache_sound (SOUND_IMP_ROCK3); + precache_sound (SOUND_IMP_ROCK4); + + // Attack E - Lightning at summoning crystal - range attack + precache_sound ("eidolon/attacke.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 128'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.health = self.max_health = MEGADEATH; + self.pain_finished = time + LARGE_TIMER; + self.takedamage = DAMAGE_NO; // Immune to damage + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // 1/2 Shambler level + self.pain_timeout = 2; // Stop constant pain + self.infightextra = 3; // Crazy damage, noinfighting + self.skin = 1; // New rocky skin + + // Custom feet sounds + self.stepc1 = "eidolon/footstep1.wav"; + self.stepc2 = "eidolon/footstep2.wav"; + self.stepc3 = "eidolon/footstep3.wav"; + self.stepc4 = "eidolon/footstep4.wav"; + self.stepc5 = "eidolon/footstep1.wav"; + precache_sound (self.stepc1); + precache_sound (self.stepc2); + precache_sound (self.stepc3); + precache_sound (self.stepc4); + precache_sound (self.stepc5); + self.steptype = FS_TYPECUSTOM; + + self.classtype = CT_MONEIDOLON; + self.classgroup = CG_STONE; + self.classmove = MON_MOVEWALK; + self.style = 0; + if (self.deathstring == "") self.deathstring = " was pulverized by the Sculptor\n"; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[EIDO_BOSS]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + total_monsters = total_monsters + 1; + self.use = eidolon_start; +}; + +/*====================================================================== +/*QUAKED monster_eidolon_wavetrig (0.75 0.25 1) (-32 -32 -4) (32 32 4) x +Target for boss lightning wave event +-------- KEYS -------- +targetname : name of wave event (links to noise key on boss) +target : trigger name of adds to spawn +target2 : trigger name of crystal event +noise : targetname of collision entity +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Target for boss lightning wave event + +======================================================================*/ +void() monster_eidolon_wavetrig = +{ + self.classtype = CT_MONEIDOLONWAVE; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); +}; + diff --git a/QC_other/QC_keep/mon_bossfiretop.qc b/QC_other/QC_keep/mon_bossfiretop.qc new file mode 100644 index 00000000..cc5cd59b --- /dev/null +++ b/QC_other/QC_keep/mon_bossfiretop.qc @@ -0,0 +1,374 @@ +/*============================================================================== +Chthon (Firetop Mountain Version) +==============================================================================*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +//=========================================================================== +void(float ftop_mode) ftop_track = +{ + // Find a player + if (self.enemy == world) { + self.enemy = find(world, classname, "player"); + // reset enemy if no player found! + if (!self.enemy) self.enemy = world; + } + + // Check for any no combat conditions + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.health < 1) self.enemy = world; + + // Got an enemy? + // Either attack or turn towards + if (self.enemy) { + if (ftop_mode == TRUE) self.th_missile(); + else ai_face(); + } + + // Update particle effect around base of Chthon + makevectors(self.angles); + particle_debuff(self.origin+v_forward*32, 96, rint(10+random()*40), PARTICLE_BURST_FIRE); +}; + +//---------------------------------------------------------------------- +void() ftop_idle1 =[ $walk1, ftop_idle2 ] {ftop_track(TRUE);}; +void() ftop_idle2 =[ $walk2, ftop_idle3 ] {ftop_track(TRUE);}; +void() ftop_idle3 =[ $walk3, ftop_idle4 ] {ftop_track(TRUE);}; +void() ftop_idle4 =[ $walk4, ftop_idle5 ] {ftop_track(TRUE);}; +void() ftop_idle5 =[ $walk5, ftop_idle6 ] {ftop_track(TRUE);}; +void() ftop_idle6 =[ $walk6, ftop_idle7 ] {ftop_track(TRUE);}; +void() ftop_idle7 =[ $walk7, ftop_idle8 ] {ftop_track(TRUE);}; +void() ftop_idle8 =[ $walk8, ftop_idle9 ] {ftop_track(TRUE);}; +void() ftop_idle9 =[ $walk9, ftop_idle10 ] {ftop_track(TRUE);}; +void() ftop_idle10 =[ $walk10, ftop_idle11 ] {ftop_track(TRUE);}; +void() ftop_idle11 =[ $walk11, ftop_idle12 ] {ftop_track(TRUE);}; +void() ftop_idle12 =[ $walk12, ftop_idle13 ] {ftop_track(TRUE);}; +void() ftop_idle13 =[ $walk13, ftop_idle14 ] {ftop_track(TRUE);}; +void() ftop_idle14 =[ $walk14, ftop_idle15 ] {ftop_track(TRUE);}; +void() ftop_idle15 =[ $walk15, ftop_idle16 ] {ftop_track(TRUE);}; +void() ftop_idle16 =[ $walk16, ftop_idle17 ] {ftop_track(TRUE);}; +void() ftop_idle17 =[ $walk17, ftop_idle18 ] {ftop_track(TRUE);}; +void() ftop_idle18 =[ $walk18, ftop_idle19 ] {ftop_track(TRUE);}; +void() ftop_idle19 =[ $walk19, ftop_idle20 ] {ftop_track(TRUE);}; +void() ftop_idle20 =[ $walk20, ftop_idle21 ] {ftop_track(TRUE);}; +void() ftop_idle21 =[ $walk21, ftop_idle22 ] {ftop_track(TRUE);}; +void() ftop_idle22 =[ $walk22, ftop_idle23 ] {ftop_track(TRUE);}; +void() ftop_idle23 =[ $walk23, ftop_idle24 ] {ftop_track(TRUE);}; +void() ftop_idle24 =[ $walk24, ftop_idle25 ] {ftop_track(TRUE);}; +void() ftop_idle25 =[ $walk25, ftop_idle26 ] {ftop_track(TRUE);}; +void() ftop_idle26 =[ $walk26, ftop_idle27 ] {ftop_track(TRUE);}; +void() ftop_idle27 =[ $walk27, ftop_idle28 ] {ftop_track(TRUE);}; +void() ftop_idle28 =[ $walk28, ftop_idle29 ] {ftop_track(TRUE);}; +void() ftop_idle29 =[ $walk29, ftop_idle30 ] {ftop_track(TRUE);}; +void() ftop_idle30 =[ $walk30, ftop_idle31 ] {ftop_track(TRUE);}; +void() ftop_idle31 =[ $walk31, ftop_idle1 ] {ftop_track(TRUE);}; + +//=========================================================================== +void(vector orgofs) ftop_fire = +{ + local vector offang, org, vec, dir, mdest, avel; + local float projlen; + + // No enemy or dead? + if (!self.enemy) return; + if (self.enemy.health < 1) return; + + sound (self, CHAN_WEAPON, "chthon/attack1.wav", 1, ATTN_NORM); + offang = vectoangles (self.enemy.origin - self.origin); + makevectors (offang); + org = self.origin + attack_vector(orgofs); + + // Skill level adjustment (easy=250, normal=300, hard=350, nm=400) + self.attack_speed = SPEED_LAVABALL + (skill*SPEED_LAVASKILL); + + // Lead the missile on hard mode (This formula is not perfect) + // There are plenty of missiles that go in strange directions, + // especially if the player strafes a lot from side to side. + if (skill > SKILL_NORMAL) { + projlen = vlen(self.enemy.origin - org) / self.attack_speed; + vec = self.enemy.velocity; + vec_z = 0; + mdest = self.enemy.origin + projlen * vec; + } + else mdest = self.enemy.origin; + + dir = normalize (mdest - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_FIRETOP, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() ftop_attack1 =[ $attack1, ftop_attack2 ] {ftop_track(FALSE);}; +void() ftop_attack2 =[ $attack2, ftop_attack3 ] {ftop_track(FALSE);}; +void() ftop_attack3 =[ $attack3, ftop_attack4 ] {ftop_track(FALSE);}; +void() ftop_attack4 =[ $attack4, ftop_attack5 ] {ftop_track(FALSE);}; +void() ftop_attack5 =[ $attack5, ftop_attack6 ] {ftop_track(FALSE);}; +void() ftop_attack6 =[ $attack6, ftop_attack7 ] {ftop_track(FALSE);}; +void() ftop_attack7 =[ $attack7, ftop_attack8 ] {ftop_track(FALSE);}; +void() ftop_attack8 =[ $attack8, ftop_attack9 ] {ftop_fire('100 50 250');}; +void() ftop_attack9 =[ $attack9, ftop_attack10 ] {ftop_track(FALSE);}; +void() ftop_attack10=[ $attack10, ftop_attack11 ] {ftop_track(FALSE);}; +void() ftop_attack11=[ $attack11, ftop_attack12 ] {ftop_track(FALSE);}; +void() ftop_attack12=[ $attack12, ftop_attack13 ] {ftop_track(FALSE);}; +void() ftop_attack13=[ $attack13, ftop_attack14 ] {ftop_track(FALSE);}; +void() ftop_attack14=[ $attack14, ftop_attack15 ] {ftop_track(FALSE);}; +void() ftop_attack15=[ $attack15, ftop_attack16 ] {ftop_track(FALSE);}; +void() ftop_attack16=[ $attack16, ftop_attack17 ] {ftop_track(FALSE);}; +void() ftop_attack17=[ $attack17, ftop_attack18 ] {ftop_track(FALSE);}; +void() ftop_attack18=[ $attack18, ftop_attack19 ] {ftop_track(FALSE);}; +void() ftop_attack19=[ $attack19, ftop_attack20 ] {ftop_fire('100 -50 250');}; +void() ftop_attack20=[ $attack20, ftop_attack21 ] {ftop_track(FALSE);}; +void() ftop_attack21=[ $attack21, ftop_attack22 ] {ftop_track(FALSE);}; +void() ftop_attack22=[ $attack22, ftop_attack23 ] {ftop_track(FALSE);}; +void() ftop_attack23=[ $attack23, ftop_attack1 ] {ftop_track(FALSE); + // If no enemy go back to idling in a pool of lava! + if (self.enemy == world) self.think = self.th_stand; +}; + +//---------------------------------------------------------------------- +void() ftop_lightning = +{ + if (!self.movetarget2) return; + if (!self.movetarget3) return; + + self.pos1 = self.movetarget2.origin; + self.pos2 = self.movetarget3.origin; + + // compensate for length of bolt + self.pos2 = self.pos2 - normalize(self.pos2 - self.pos1) * 100; + + // Generate the lightning effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING3); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.pos1_x); + WriteCoord (MSG_BROADCAST, self.pos1_y); + WriteCoord (MSG_BROADCAST, self.pos1_z); + WriteCoord (MSG_BROADCAST, self.pos2_x); + WriteCoord (MSG_BROADCAST, self.pos2_y); + WriteCoord (MSG_BROADCAST, self.pos2_z); +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) ftop_pain = { + self.health = self.max_health; +}; + +//---------------------------------------------------------------------- +void() ftop_death1 = [$death1, ftop_death2] { + ftop_lightning(); + sound (self, CHAN_VOICE, "chthon/death1.wav", 1, ATTN_NORM); + if (self.noise3 != "") trigger_strs(self.noise3, self); +}; +void() ftop_death2 = [$death2, ftop_death3] {ftop_lightning();}; +void() ftop_death3 = [$death3, ftop_death4] {ftop_lightning();}; +void() ftop_death4 = [$death4, ftop_death5] {}; +void() ftop_death5 = [$death5, ftop_death6] {}; +void() ftop_death6 = [$death6, ftop_death7] {}; +void() ftop_death7 = [$death7, ftop_death8] {}; +void() ftop_death8 = [$death8, ftop_death9] {}; +void() ftop_death9 = [$death9, ftop_death10] { + sound (self, CHAN_BODY, "chthon/lavasplash.wav", 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +}; +void() ftop_death10 = [$death9, ftop_death11] { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + entity_hide(self); +}; +void() ftop_death11 = { remove(self); }; + +//---------------------------------------------------------------------- +void() ftop_shocka1 =[ $shocka1, ftop_shocka2 ] {ftop_lightning();}; +void() ftop_shocka2 =[ $shocka2, ftop_shocka3 ] {ftop_lightning();}; +void() ftop_shocka3 =[ $shocka3, ftop_shocka4 ] {ftop_lightning();}; +void() ftop_shocka4 =[ $shocka4, ftop_shocka5 ] {ftop_lightning();}; +void() ftop_shocka5 =[ $shocka5, ftop_shocka6 ] {ftop_lightning();}; +void() ftop_shocka6 =[ $shocka6, ftop_shocka7 ] {ftop_lightning();}; +void() ftop_shocka7 =[ $shocka7, ftop_shocka8 ] {ftop_lightning();}; +void() ftop_shocka8 =[ $shocka8, ftop_shocka9 ] {ftop_lightning();}; +void() ftop_shocka9 =[ $shocka9, ftop_shocka10 ] {ftop_lightning();}; +void() ftop_shocka10 =[ $shocka10, ftop_death1 ] {ftop_lightning(); + if (self.attack_finished > time) self.think = ftop_shocka1;}; + +//---------------------------------------------------------------------- +void() ftop_shockb1 =[ $shockb1, ftop_shockb2 ] {ftop_lightning();}; +void() ftop_shockb2 =[ $shockb2, ftop_shockb3 ] {ftop_lightning();}; +void() ftop_shockb3 =[ $shockb3, ftop_shockb4 ] {ftop_lightning();}; +void() ftop_shockb4 =[ $shockb4, ftop_shockb5 ] {ftop_lightning();}; +void() ftop_shockb5 =[ $shockb5, ftop_shockb6 ] {ftop_lightning();}; +void() ftop_shockb6 =[ $shockb6, ftop_shockb7 ] {ftop_lightning();}; +void() ftop_shockb7 =[ $shockb1, ftop_shockb8 ] {ftop_lightning();}; +void() ftop_shockb8 =[ $shockb2, ftop_shockb9 ] {ftop_lightning();}; +void() ftop_shockb9 =[ $shockb3, ftop_shockb10 ] {ftop_lightning();}; +void() ftop_shockb10 =[ $shockb4, ftop_death1 ] {ftop_lightning(); + if (self.attack_finished > time) self.think = ftop_shockb1;}; + +//---------------------------------------------------------------------- +void() ftop_shockc1 =[ $shockc1, ftop_shockc2 ] {ftop_lightning();}; +void() ftop_shockc2 =[ $shockc2, ftop_shockc3 ] {ftop_lightning();}; +void() ftop_shockc3 =[ $shockc3, ftop_shockc4 ] {ftop_lightning();}; +void() ftop_shockc4 =[ $shockc4, ftop_shockc5 ] {ftop_lightning();}; +void() ftop_shockc5 =[ $shockc5, ftop_shockc6 ] {ftop_lightning();}; +void() ftop_shockc6 =[ $shockc6, ftop_shockc7 ] {ftop_lightning();}; +void() ftop_shockc7 =[ $shockc7, ftop_shockc8 ] {ftop_lightning();}; +void() ftop_shockc8 =[ $shockc8, ftop_shockc9 ] {ftop_lightning();}; +void() ftop_shockc9 =[ $shockc9, ftop_shockc10 ] {ftop_lightning();}; +void() ftop_shockc10 =[ $shockc10, ftop_death1 ] {ftop_lightning(); + if (self.attack_finished > time) self.think = ftop_shockc1;}; + +//---------------------------------------------------------------------- +void() ftop_deathsequence = +{ + self.use = SUB_Null; + self.enemy = world; + self.takedamage = DAMAGE_NO; + + // Find electrode start/end points + if (self.noise1 != "") + self.movetarget2 = find(world, targetname, self.noise1); + if (self.noise2 != "") + self.movetarget3 = find(world, targetname, self.noise2); + + sound (self, CHAN_WEAPON, "misc/power.wav", 1, ATTN_NORM); + sound (self, CHAN_VOICE, "chthon/pain1.wav", 1, ATTN_NORM); + + self.attack_finished = time + 1.5; + self.lip = random(); + if (self.lip < 0.3) ftop_shocka1(); + else if (self.lip < 0.6) ftop_shockb1(); + else ftop_shockc1(); +}; + +//=========================================================================== +void() ftop_rise1 =[ $rise1, ftop_rise2 ] { + sound (self, CHAN_WEAPON, "chthon/lavasplash.wav", 1, ATTN_NORM);}; +void() ftop_rise2 =[ $rise2, ftop_rise3 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM);}; +void() ftop_rise3 =[ $rise3, ftop_rise4 ] {}; +void() ftop_rise4 =[ $rise4, ftop_rise5 ] {}; +void() ftop_rise5 =[ $rise5, ftop_rise6 ] {}; +void() ftop_rise6 =[ $rise6, ftop_rise7 ] {}; +void() ftop_rise7 =[ $rise7, ftop_rise8 ] {}; +void() ftop_rise8 =[ $rise8, ftop_rise9 ] {}; +void() ftop_rise9 =[ $rise9, ftop_rise10 ] {}; +void() ftop_rise10 =[ $rise10, ftop_rise11 ] {}; +void() ftop_rise11 =[ $rise11, ftop_rise12 ] {}; +void() ftop_rise12 =[ $rise12, ftop_rise13 ] {}; +void() ftop_rise13 =[ $rise13, ftop_rise14 ] {}; +void() ftop_rise14 =[ $rise14, ftop_rise15 ] {}; +void() ftop_rise15 =[ $rise15, ftop_rise16 ] {}; +void() ftop_rise16 =[ $rise16, ftop_rise17 ] {}; +void() ftop_rise17 =[ $rise17, ftop_attack1 ] { + self.takedamage = DAMAGE_YES; + self.th_stand = ftop_idle1; + self.th_run = ftop_attack1; + self.th_missile = ftop_attack1; + self.th_pain = ftop_pain; + self.th_die = ftop_deathsequence; +}; + +//---------------------------------------------------------------------- +void() ftop_wakeup = +{ + self.skin = 1; // Dark lava skin + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.velocity = '0 0 0'; + self.flags = FL_MONSTER; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.enemy = activator; // Setup trigger enemy + self.use = ftop_deathsequence; // Final death trigger event + + // DP particle spark and smoke effect to Chthon, originally done by Seven + if (ext_dppart) self.traileffectnum = particleeffectnum("TR_BOSSCHTHON"); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + ftop_rise1 (); +}; + +/*====================================================================== + QUAKED monster_firetopboss (1 0.25 0.25) (-128 -128 -24) (128 128 256) +======================================================================*/ +void() monster_firetopboss = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bosschthon.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_LAVA); + + precache_sound ("chthon/attack1.wav"); + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("misc/power.wav"); + + self.pain_sound = "chthon/pain1.wav"; + precache_sound ("chthon/pain1.wav"); + precache_sound ("chthon/death1.wav"); + + // Rise from lava roar + splash + self.sight_sound = "chthon/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("chthon/lavasplash.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-128 -128 -24'; // has own entity setup + self.bbmaxs = '128 128 256'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.health = self.max_health = MEGADEATH; + self.takedamage = DAMAGE_NO; + self.classtype = CT_MONFIRETOP; + self.classgroup = CG_BOSS; + self.infightextra = 8; + self.pain_ignore = 1; + self.yaw_speed = 20; + + if (self.deathstring == "") self.deathstring = " was destroyed by the Firetop Guardian\n"; + + // Always reset Ammo Resistance to be consistent + // The shamblers infront of the boss are suppose to be killed + // by the boss and they fire lightning (cell damage) + // If the boss is 100% ammo resist == no infighting + // The health is reset everytime pain is received + self.resist_shells = self.resist_nails = 1; + self.resist_rockets = self.resist_cells = 0.9; + + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + total_monsters = total_monsters + 1; + self.use = ftop_wakeup; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_bossicegolem.qc b/QC_other/QC_keep/mon_bossicegolem.qc new file mode 100644 index 00000000..c9d2fc36 --- /dev/null +++ b/QC_other/QC_keep/mon_bossicegolem.qc @@ -0,0 +1,1173 @@ +/*============================================================================== +ICE GOLEM (Heavily Inspired by Ne_Ruins MOD) (Hexen2 Model) +==============================================================================*/ + +// (000) standing still with heavy breathing +$frame wait1 wait2 wait3 wait4 wait5 wait6 wait7 wait8 +$frame wait9 wait10 wait11 wait12 wait13 wait14 wait15 wait16 +$frame wait17 wait18 wait19 wait20 wait21 wait22 + +// (022) Transfer B +$frame tranB1 tranB2 tranB3 tranB4 tranB5 tranB6 tranB7 tranB8 +$frame tranB9 tranB10 tranB11 tranB12 tranB13 + +// (035) statue to walking +$frame birth1 birth2 birth3 birth4 birth5 birth6 birth7 birth8 +$frame birth9 birth10 birth11 birth12 birth13 birth14 birth15 birth16 + +// (051) Really slow walk +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 +$frame walk25 walk26 walk27 walk28 walk29 walk30 walk31 walk32 +$frame walk33 walk34 + +// (085) Running +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 +$frame run17 run18 run19 run20 run21 run22 run23 run24 + +// (109) Right Fist Punch +$frame punch1 punch2 punch3 punch4 punch5 punch6 punch7 punch8 +$frame punch9 punch10 punch11 punch12 punch13 punch14 punch15 punch16 +$frame punch17 punch18 punch19 punch20 punch21 punch22 punch23 punch24 + +// (133) Right Fist Pound ground +$frame pound1 pound2 pound3 pound4 pound5 pound6 pound7 pound8 +$frame pound9 pound10 pound11 pound12 pound13 pound14 pound15 pound16 +$frame pound17 pound18 pound19 pound20 pound21 pound22 pound23 pound24 + +// (157) Death Forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 + +// (179) Magic attack from torso +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 magic13 magic14 magic15 magic16 +$frame magic17 magic18 magic19 magic20 magic21 magic22 magic23 magic24 + +// (203) Stomp Foot on ground +$frame stomp1 stomp2 stomp3 stomp4 stomp5 stomp6 stomp7 stomp8 +$frame stomp9 stomp10 stomp11 stomp12 stomp13 stomp14 stomp15 stomp16 +$frame stomp17 stomp18 stomp19 stomp20 stomp21 stomp22 stomp23 stomp24 + +// (227) Rush forward and knock player away +$frame knock1 knock2 knock3 knock4 knock5 knock6 knock7 knock8 +$frame knock9 knock10 knock11 knock12 knock13 knock14 knock15 knock16 +$frame knock17 knock18 knock19 knock20 knock21 knock22 knock23 knock24 + +float ICEG_PHASE1 = 1; // Frozen in Ice +float ICEG_PHASE2 = 2; // Fighting +float ICEG_PHASE3 = 3; // Busting Columns +float ICEG_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() iceg_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() iceg_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP reached next wave, turn and fire at targets +//---------------------------------------------------------------------- +float() iceg_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") { + self.attachment2 = find(world, targetname, self.noise); + if (self.attachment2.classtype == CT_MONICEGOLEMWAVE) { + // Spawn any adds to keep player busy + if (self.attachment2.target != "") + trigger_strs(self.attachment2.target, self); + + // Turn around and blow up breakables + self.th_jump(); + } + } + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + iceg_WaveSetupHP(); // Reset trigger/hp + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check the tether system +//---------------------------------------------------------------------- +float() iceg_CheckTether = +{ + self.t_length = vlen(self.origin - self.movelast.origin); + // Check the most obvious first, inside tether range? + if (self.t_length < self.tetherrange) return FALSE; + else { + // If player or tether close to each other? + if (infront(self.movelast) && infront(self.enemy) ) + return FALSE; + // Stop moving around + else return TRUE; + } +}; + +//---------------------------------------------------------------------- +// Quick check for stomp/melee + fast range attack +//---------------------------------------------------------------------- +void() iceg_CheckCombo = +{ + if (self.health < 1) return; + if (self.enemy.health < 1) return; + if (skill < SKILL_NORMAL) return; + + // If the enemy is visible, quickly go for range attack + if (visxray(self.enemy, self.attack_offset, self.enemy.view_ofs, TRUE)) { + self.attack_finished = time + ((4-skill)*0.5) + random(); + // Skip forward in magic attack + self.think = self.th_charge; + } +}; + +//---------------------------------------------------------------------- +// Ice Golem game play logic +//---------------------------------------------------------------------- +void() IcegCheckAttack = +{ + //---------------------------------------------------------------------- + // Check Melee range and constantly fire + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEEICEG) { + self.attack_finished = time + 1; + self.attack_state = AS_MELEE; + return; + } + // Walk around a bit + if (time < self.attack_finished) return; + + //---------------------------------------------------------------------- + // Floor stomp attack + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_STOMPICEG && random() < 0.5) { + self.attack_finished = time + ((4-skill)*0.5) + random() + random(); + self.th_slide (); + return; + } + + //---------------------------------------------------------------------- + // Range attacks (O Rings + Ceiling Rubble) + //---------------------------------------------------------------------- + if (!enemy_vis) return; + + // Does the monster have a clear shot to the player? + // sightline can be blocked by other monsters + if (!visblocked_wide(self.enemy, self.attack_offset, self.enemy.view_ofs)) { + self.attack_finished = time + ((4-skill)*0.6) + random() + random(); + self.attack_state = AS_MISSILE; + } +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() iceg_idleframe = +{ + // Do nothing if dead + if (self.health < 1) return; + if (self.walkframe == 0) monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 20) self.walkframe = 0; + self.frame = $wait1 + self.walkframe; + self.think = iceg_idleframe; + // Tick slower for idle + self.nextthink = time + 0.1; + + // Keep looking for a player + iceg_FindTarget (); +}; + +//---------------------------------------------------------------------- +void() iceg_stand1 = {self.walkframe = 0; iceg_idleframe();}; + +//============================================================================ +void() iceg_walkframe = +{ + // Do nothing if dead + if (self.health < 1) return; + + // Default walk speed (very slow) + self.lip = 5; + // Check for any special frame events + if (self.walkframe == 0 || self.walkframe == 16) { + self.lip = 0; + monster_footstep(FALSE); + } + else if (self.walkframe == 1 || self.walkframe == 17) self.lip = 4; + else if (self.walkframe == 7 || self.walkframe == 24) + monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 33) self.walkframe = 0; + self.frame = $walk1 + self.walkframe; + self.think = iceg_walkframe; + // Hexen 2 models are designed for lower time cycle + self.nextthink = time + 0.05; + + // Keep looking for a player + iceg_FindTarget (); + + // Any feet movement? + if (self.lip > 0) { + // Check for tether system (cutom version) + if (self.movelast) { + if (iceg_CheckTether()) movetogoal(self.lip); + } + else movetogoal(self.lip); + } +}; + +//---------------------------------------------------------------------- +void() iceg_walk1 = { self.walkframe = 0; iceg_walkframe(); }; + +//============================================================================ +void() iceg_runframe = +{ + if (self.style != ICEG_PHASE2) return; + if (self.health < 1) return; + + // Check for boss wave trigger events + if (iceg_WaveCheck() == TRUE) {self.th_jump(); return;} + + // Default run speed (very slow) + self.lip = 8; + // Check for any special frame events + if (self.walkframe == 0 || self.walkframe == 12) { + self.lip = 0; + monster_footstep(FALSE); + } + else if (self.walkframe == 1 || self.walkframe == 13) self.lip = 6; + else if (self.walkframe == 6 || self.walkframe == 17) + monster_idle_sound(); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 23) self.walkframe = 0; + self.frame = $run1 + self.walkframe; + self.think = iceg_runframe; + // Hexen 2 models are designed for lower time cycle + self.nextthink = time + 0.05; + + // Check for tether system (cutom version) + if (self.movelast) { + if (iceg_CheckTether()) ai_run(0); + else ai_run(self.lip); + } + else ai_run(self.lip); +}; + +//---------------------------------------------------------------------- +void() iceg_run1 = { self.walkframe = 0; iceg_runframe(); }; + +//============================================================================ +// MELEE - knockback the player with swipe +//============================================================================ +void(float dist) iceg_mcharge = { + ai_charge(dist); + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() iceg_knock1 = [ $knock1, iceg_knock2 ] {iceg_mcharge(5);}; +void() iceg_knock2 = [ $knock2, iceg_knock3 ] {iceg_mcharge(6);}; +void() iceg_knock3 = [ $knock3, iceg_knock4 ] {iceg_mcharge(7);}; +void() iceg_knock4 = [ $knock4, iceg_knock5 ] {iceg_mcharge(8);}; +void() iceg_knock5 = [ $knock5, iceg_knock6 ] {iceg_mcharge(9);}; +void() iceg_knock6 = [ $knock7, iceg_knock7 ] {iceg_mcharge(10);}; +void() iceg_knock7 = [ $knock6, iceg_knock8 ] {iceg_mcharge(9);}; +void() iceg_knock8 = [ $knock8, iceg_knock9 ] {iceg_mcharge(8);}; +void() iceg_knock9 = [ $knock9, iceg_knock10 ] {iceg_mcharge(7);}; +void() iceg_knock10 = [ $knock10, iceg_knock11 ] {iceg_mcharge(6);}; +void() iceg_knock11 = [ $knock11, iceg_knock12 ] {iceg_mcharge(5);monster_footstep(FALSE);}; +void() iceg_knock12 = [ $knock12, iceg_knock13 ] {iceg_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() iceg_knock13 = [ $knock13, iceg_knock14 ] {iceg_mcharge(4);}; +void() iceg_knock14 = [ $knock14, iceg_knock15 ] {iceg_mcharge(3);}; +void() iceg_knock15 = [ $knock15, iceg_knock16 ] {iceg_mcharge(2);}; +void() iceg_knock16 = [ $knock16, iceg_knock17 ] {iceg_mcharge(1); + self.meleehitsound = "golem/melee_punch.wav"; + self.meleecontact = TRUE;ai_meleesmash(30); + // If punch made contact, lift the enemy off ground + if (self.meleecontact == FALSE) { + self.pos1 = self.enemy.origin - self.origin; + self.pos1_z = 0; + self.pos1 = normalize(self.pos1); + self.enemy.velocity = self.enemy.velocity + self.pos1 * 400; + self.enemy.velocity_z = self.enemy.velocity_z + 250; + self.enemy.flags = self.enemy.flags - (self.enemy.flags & FL_ONGROUND); + } + self.meleecontact = FALSE; +}; +void() iceg_knock17 = [ $knock17, iceg_knock18 ] {iceg_mcharge(1);}; +void() iceg_knock18 = [ $knock18, iceg_knock19 ] {iceg_mcharge(2);}; +void() iceg_knock19 = [ $knock19, iceg_knock20 ] {iceg_mcharge(3);}; +void() iceg_knock20 = [ $knock20, iceg_knock21 ] {iceg_mcharge(4);}; +void() iceg_knock21 = [ $knock21, iceg_knock22 ] {iceg_mcharge(5);}; +void() iceg_knock22 = [ $knock22, iceg_knock23 ] {iceg_mcharge(5);}; +void() iceg_knock23 = [ $knock23, iceg_knock24 ] {iceg_mcharge(5);}; +void() iceg_knock24 = [ $knock24, iceg_run1 ] {iceg_mcharge(5); + // Check for combo Melee+quick range + iceg_CheckCombo(); +}; + +//============================================================================ +// RANGE ATTACK (ICE SHARDS == rockets) +// Total shards to fire is based on skill level +// easy=3, normal=3, hard=4, nm=5 +//============================================================================ +void() iceg_shardanimate = +{ + // manually animate + self.frame = self.frame + 1; + self.lip = 1 - (self.frame / 11); + self.lip = self.lip * 0.5; + // Gradualy fade out + self.alpha = self.lip; + // Hit animaton frame boundary? + if (self.frame > 10) entity_remove(self, 0.1); + else self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() iceg_shardtrail = +{ + local entity oring; + + // Spawn a temporary entity + oring = spawn(); + oring.owner = self; + oring.solid = SOLID_NOT; // No interaction with world + oring.movetype = MOVETYPE_NONE; // Static item, no movement + + // move to current projectile location + setmodel(oring, MODEL_PROJ_RINGBLAST); + setsize(oring, VEC_ORIGIN, VEC_ORIGIN); + setorigin(oring, self.origin); + oring.alpha = 0.5; + oring.skin = 3; + + // Match orientiation and start Oring animation + self.pos2 = normalize(self.velocity); + oring.angles = vectoangles(self.pos2); + oring.think = iceg_shardanimate; + oring.nextthink = time + 0.1; + + // Has the DP particle trail been setup yet? + if (!self.pain_finished) { + // only run this once + self.pain_finished = TRUE; + // Re-use plasma trail + if (ext_dppart) { + self.traileffectnum = particleeffectnum(DPP_TRPLASMA); + self.effects = 0; + } + } + else { + // Classic (fitz/qs) engine particles only + if (!ext_dppart) { + self.oldorigin = crandom() * '1 1 1'; + // Silver colour + self.lip = 40 + rint(random()*8); + particle (self.origin, self.oldorigin, self.lip, 8 + rint(random()*8)); + // Yellow colour + self.lip = 198 + rint(random()*4); + particle (self.origin, self.oldorigin, self.lip, 4 + rint(random()*4)); + } + } + + // Keep looping for O rings trails + self.think = iceg_shardtrail; + self.nextthink = time + 0.05 + random()*0.05; +}; + +//---------------------------------------------------------------------- +void(entity targ) iceg_icestorm = +{ + local float zpart; + local vector org, targ_org, dir, yrand, zrand; + + // No enemy or dead? stop firing + if (!targ) return; + if (self.health < 1) return; + + // Play random firing sound + self.lip = random(); + if (self.lip < 0.3) + sound (self, CHAN_WEAPON, "golem/iceshard1.wav", 1, ATTN_IDLE); + else if (self.lip < 0.6) + sound (self, CHAN_WEAPON, "golem/iceshard2.wav", 1, ATTN_IDLE); + else + sound (self, CHAN_WEAPON, "golem/iceshard3.wav", 1, ATTN_IDLE); + + // Make sure facing the right direction + ai_face(); + makevectors(self.angles); + + // Check if enemy is bmodel or point entity + if (targ.bsporigin) targ_org = bmodel_origin(targ); + else targ_org = targ.origin; + + // Spawn a mist of particles where projectiles came from + org = self.origin + attack_vector('20 0 64'); + zpart = 20 + rint(random()*20); + particle_explode(org, zpart, 1+random(), PARTICLE_BURST_BLUE, PARTICLE_BURST_UPWARD); + + // Randomly spawn projectiles from golems chest + yrand = (crandom()*10)*v_right; + zrand = (crandom()*10)*v_up; + org = self.origin + attack_vector(self.attack_offset) + yrand + zrand; + + // Add some right/left bias to the final destination + dir = (targ_org - org) + (v_right*(crandom()*50)); + dir = normalize (dir); + + // Variable speed based on skill level + self.attack_speed = SPEED_ICEGSHARD + (skill * SPEED_ICEGSKILL); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_ICEG1, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() iceg_magtime = {self.nextthink = time + 0.05;}; + +void() iceg_magic1 = [ $magic1, iceg_magic2 ] {iceg_magtime();ai_face(); + self.pain_finished = time + 1.5; + sound (self, CHAN_WEAPON, "golem/icestorm.wav", 1, ATTN_NORM); +}; +void() iceg_magic2 = [ $magic2, iceg_magic3 ] {iceg_magtime();}; +void() iceg_magic3 = [ $magic3, iceg_magic4 ] {iceg_magtime();ai_face();}; +void() iceg_magic4 = [ $magic4, iceg_magic5 ] {iceg_magtime();}; +void() iceg_magic5 = [ $magic5, iceg_magic6 ] {iceg_magtime();ai_face();}; +void() iceg_magic6 = [ $magic6, iceg_magic7 ] {iceg_magtime();ai_face();}; +void() iceg_magic7 = [ $magic7, iceg_magic8 ] {iceg_magtime();ai_face();}; +void() iceg_magic8 = [ $magic8, iceg_magic9 ] {iceg_magtime();}; +void() iceg_magic9 = [ $magic9, iceg_magic10 ] {iceg_magtime();ai_face();}; +void() iceg_magic10 = [ $magic10, iceg_magic11 ] {iceg_magtime();ai_face();}; +void() iceg_magic11 = [ $magic11, iceg_magic12 ] {iceg_magtime();ai_face();}; +void() iceg_magic12 = [ $magic12, iceg_magic13 ] {iceg_magtime();ai_face();}; +void() iceg_magic13 = [ $magic13, iceg_magic14 ] {iceg_magtime();iceg_icestorm(self.enemy);}; +void() iceg_magic14 = [ $magic14, iceg_magic15 ] {iceg_magtime();ai_face();}; +void() iceg_magic15 = [ $magic15, iceg_magic16 ] {iceg_magtime();iceg_icestorm(self.enemy);}; +void() iceg_magic16 = [ $magic16, iceg_magic17 ] {iceg_magtime();ai_face();}; +void() iceg_magic17 = [ $magic17, iceg_magic18 ] {iceg_magtime();iceg_icestorm(self.enemy);}; +void() iceg_magic18 = [ $magic18, iceg_magic19 ] {iceg_magtime();ai_face();}; +void() iceg_magic19 = [ $magic19, iceg_magic20 ] {iceg_magtime();ai_face(); + if (skill > SKILL_NORMAL) iceg_icestorm(self.enemy); +}; +void() iceg_magic20 = [ $magic20, iceg_magic21 ] {iceg_magtime();ai_face();}; +void() iceg_magic21 = [ $magic21, iceg_magic22 ] {iceg_magtime();ai_face(); + if (skill > SKILL_HARD) iceg_icestorm(self.enemy); +}; +void() iceg_magic22 = [ $magic22, iceg_magic23 ] {iceg_magtime();}; +void() iceg_magic23 = [ $magic23, iceg_magic24 ] {iceg_magtime();}; +void() iceg_magic24 = [ $magic24, iceg_run1 ] {iceg_magtime();}; + +//============================================================================ +// RANGE ATTACK (Stomp ground and drop debris from ceiling) +//============================================================================ +void() iceg_ceilingrubble = +{ + // No enemy or dead? + if (!self.enemy) return; + if (self.health < 1) return; + + // Trace a line up from the enemy/player + traceline(self.enemy.origin, self.enemy.origin+'0 0 1024', TRUE, self.enemy); + self.pos2 = trace_endpos; + // is there any space for rubble? + if (vlen(self.enemy.origin - self.pos2) < 64) return; + + // Spawn a func_breakable_spawner entity + // Manually setup all parameters + // All sounds/models pre-cached with ice golem + self.attachment = spawn(); + // Move the emitter slightly down from ceiling + self.attachment.origin = trace_endpos - self.dest2; + + self.attachment.owner = self; + self.attachment.style = BTYPE_ROCK; + self.attachment.brkimpsound = BTYPE_ROCK; + self.attachment.brkobjects = BTYPE_ROCK; + self.attachment.brkvelbase = self.brkvelbase; + self.attachment.brkveladd = self.brkveladd; + self.attachment.brkavel = 200; + self.attachment.brkfade = self.brkfade; + self.attachment.noise = SOUND_BRK_ROCK; + self.attachment.noise1 = SOUND_IMP_ROCK1; + self.attachment.noise2 = SOUND_IMP_ROCK2; + self.attachment.brkimpqty = 2; + + // Allow for custom rubble bmodels + self.attachment.brkobj1 = self.brkobj1; + self.attachment.brkobj2 = self.brkobj2; + self.attachment.brkobjqty = 2; + self.attachment.pos1 = self.dest1; + self.attachment.cnt = 5 + random() * 5; + self.attachment.count = 5 + random() * 5; + self.attachment.movedir = '0 -2 0'; + self.attachment.angles = '0 0 0'; + + // Check if the boss has dmg key set for rubble damage + if (self.dmg > 0) self.attachment.spawnflags = BREAK_MOVEDIR | BREAK_DAMAGE; + else self.attachment.spawnflags = BREAK_MOVEDIR; + if (self.dmg > 0) self.attachment.dmg = self.dmg; + else self.attachment.dmg = 2; + + // Default entity stuff (type/movement etc) + self.attachment.classtype = CT_FUNCBREAKSPN; + self.attachment.classgroup = CG_BREAKABLE; + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.brkvol = self.brkvol; + self.attachment.think = funcbreakable_use; + self.attachment.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() iceg_footstomp = {self.nextthink = time + 0.05;}; + +//---------------------------------------------------------------------- +void() iceg_stomp1 = [ $stomp1, iceg_stomp2 ] {iceg_footstomp(); + self.pain_finished = time + self.pain_timeout;}; +void() iceg_stomp2 = [ $stomp2, iceg_stomp3 ] {iceg_footstomp(); + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_IDLE);}; +void() iceg_stomp3 = [ $stomp3, iceg_stomp4 ] {iceg_footstomp();}; +void() iceg_stomp4 = [ $stomp4, iceg_stomp5 ] {iceg_footstomp();}; +void() iceg_stomp5 = [ $stomp5, iceg_stomp6 ] {iceg_footstomp();monster_idle_sound();}; +void() iceg_stomp6 = [ $stomp6, iceg_stomp7 ] {iceg_footstomp();}; +void() iceg_stomp7 = [ $stomp7, iceg_stomp8 ] {iceg_footstomp();}; +void() iceg_stomp8 = [ $stomp8, iceg_stomp9 ] {iceg_footstomp();}; +void() iceg_stomp9 = [ $stomp9, iceg_stomp10 ] {iceg_footstomp();}; +void() iceg_stomp10 = [ $stomp10, iceg_stomp11 ] {iceg_footstomp();}; +void() iceg_stomp11 = [ $stomp11, iceg_stomp12 ] {iceg_footstomp();}; +void() iceg_stomp12 = [ $stomp12, iceg_stomp13 ] {iceg_footstomp();}; +void() iceg_stomp13 = [ $stomp13, iceg_stomp14 ] { + iceg_footstomp(); self.meleehitsound = "golem/groundslam.wav"; + ai_shockwave(MONAI_STOMPIMPACT, MONAI_STOMPDAMAGE, MONAI_STOMPICERADIUS, MONAI_STOMPFORWARD, MONAI_STOMPUP); + // spawn ceiling rubble above player/enemy + iceg_ceilingrubble(); +}; +void() iceg_stomp14 = [ $stomp14, iceg_stomp15 ] {iceg_footstomp();}; +void() iceg_stomp15 = [ $stomp15, iceg_stomp16 ] {iceg_footstomp();}; +void() iceg_stomp16 = [ $stomp16, iceg_stomp17 ] {iceg_footstomp();monster_idle_sound();}; +void() iceg_stomp17 = [ $stomp17, iceg_stomp18 ] {iceg_footstomp();}; +void() iceg_stomp18 = [ $stomp18, iceg_stomp19 ] {iceg_footstomp();}; +void() iceg_stomp19 = [ $stomp19, iceg_stomp20 ] {iceg_footstomp();}; +void() iceg_stomp20 = [ $stomp20, iceg_stomp21 ] {iceg_footstomp();}; +void() iceg_stomp21 = [ $stomp21, iceg_stomp22 ] {iceg_footstomp();}; +void() iceg_stomp22 = [ $stomp22, iceg_stomp23 ] {iceg_footstomp();}; +void() iceg_stomp23 = [ $stomp23, iceg_stomp24 ] {iceg_footstomp();}; +void() iceg_stomp24 = [ $stomp24, iceg_run1 ] {iceg_footstomp(); + monster_footstep(FALSE); + // Check for combo Stomp+quick range + iceg_CheckCombo(); +}; + +//============================================================================ +// WAVE BOUNDARY - destroy some objects and spawn adds +//============================================================================ +void() iceg_aiturn = +{ + // turn towards a target if one exists + if (self.enemytarget) { + // Check if enemy target is bmodel or point entity + if (self.enemytarget.bsporigin) + self.pos1 = bmodel_origin(self.enemytarget); + else self.pos1 = self.enemytarget.origin; + // Force turn towards new target + self.ideal_yaw = vectoyaw(self.pos1 - self.origin); + ChangeYaw (); + + // Check angle difference + if ((self.ideal_yaw - 10) > self.angles_y) self.attack_elev = TRUE; + else if ((self.ideal_yaw + 10)<self.angles_y) self.attack_elev = TRUE; + else self.attack_elev = FALSE; + } +}; + +//---------------------------------------------------------------------- +void() iceg_waveface = { + // Hexen 2 quicktime! + self.nextthink = time + 0.05; + iceg_aiturn(); +}; + +//---------------------------------------------------------------------- +void() iceg_waveb1 = [ $magic1, iceg_waveb2 ] {iceg_waveface();}; +void() iceg_waveb2 = [ $magic2, iceg_waveb3 ] {iceg_waveface();}; +void() iceg_waveb3 = [ $magic3, iceg_waveb4 ] {iceg_waveface();}; +void() iceg_waveb4 = [ $magic4, iceg_waveb5 ] {iceg_waveface();}; +void() iceg_waveb5 = [ $magic5, iceg_waveb6 ] {iceg_waveface();}; +void() iceg_waveb6 = [ $magic6, iceg_waveb7 ] {iceg_waveface();}; +void() iceg_waveb7 = [ $magic7, iceg_waveb8 ] {iceg_waveface();}; +void() iceg_waveb8 = [ $magic8, iceg_waveb9 ] {iceg_waveface();}; +void() iceg_waveb9 = [ $magic9, iceg_waveb10 ] {iceg_waveface();}; + +// Fire at first target +void() iceg_waveb10 = [ $magic10, iceg_waveb11 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb11 = [ $magic11, iceg_waveb12 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb12 = [ $magic12, iceg_waveb13 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb13 = [ $magic13, iceg_waveb14 ] {iceg_waveface(); + if (self.enemytarget) { + iceg_icestorm(self.enemytarget); + // Trigger the target entity + trigger_ent(self.enemytarget, self); + // Find next target and turn towards it + self.enemytarget = find(world, targetname, self.attachment2.noise2); + } +}; + +// Start turning towards next target +void() iceg_waveb14 = [ $magic14, iceg_waveb15 ] {iceg_waveface();}; +void() iceg_waveb15 = [ $magic15, iceg_waveb16 ] {iceg_waveface();}; +void() iceg_waveb16 = [ $magic16, iceg_waveb17 ] {iceg_waveface();}; + +// Fire at second target +void() iceg_waveb17 = [ $magic17, iceg_waveb18 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb18 = [ $magic18, iceg_waveb19 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb19 = [ $magic19, iceg_waveb20 ] {iceg_waveface(); + if (self.enemytarget) iceg_icestorm(self.enemytarget);}; +void() iceg_waveb20 = [ $magic20, iceg_waveb21 ] {iceg_waveface(); + if (self.enemytarget) { + iceg_icestorm(self.enemytarget); + // Trigger the target entity + trigger_ent(self.enemytarget, self); + } +}; + +// Stop turning +void() iceg_waveb21 = [ $magic21, iceg_waveb22 ] {iceg_waveface();}; +void() iceg_waveb22 = [ $magic22, iceg_waveb23 ] {iceg_waveface();}; +void() iceg_waveb23 = [ $magic23, iceg_waveb24 ] {iceg_waveface();}; +void() iceg_waveb24 = [ $magic24, iceg_run1 ] { + self.style = ICEG_PHASE2; + Resist_ChangeType(self, FALSE); + iceg_waveface(); + // Pause before next attack + self.pain_finished = self.attack_finished = time + 2; +}; + +//---------------------------------------------------------------------- +void() iceg_turnframe = +{ + // Do nothing if dead + if (self.health < 1) return; + + // Check for any special frame events + if (self.walkframe == 0 || self.walkframe == 16) monster_footstep(FALSE); + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.walkframe > 33) self.walkframe = 0; + self.frame = $walk1 + self.walkframe; + // Hexen 2 models are designed for lower time cycle + self.nextthink = time + 0.05; + + // Facing the first target? + iceg_aiturn(); + if (self.attack_elev == FALSE) self.think = iceg_waveb1; + else self.think = iceg_turnframe; +}; + +//---------------------------------------------------------------------- +void() iceg_waveboundary = +{ + // Find a target to aim at (columns to blow up) + self.enemytarget = find(world, targetname, self.attachment2.noise1); + // First target seems to be dead + if (!self.enemytarget) { + self.enemytarget = find(world, targetname, self.attachment2.noise2); + // Second target is missing, try current enemy + if (!self.enemytarget) self.enemytarget = self.enemy; + } + + // If nothing to shoot at, back to running! + if (!self.enemytarget) { + // Back to running! + self.think = self.th_run; + self.nextthink = time + 0.1; + } + else { + // Time to blow stuff up, switch on resistance and roar! + self.style = ICEG_PHASE3; + Resist_ChangeType(self, TRUE); + sound (self, CHAN_WEAPON, "golem/icestorm.wav", 1, ATTN_NORM); + // Start turning towards target (using walk animation) + self.walkframe = 0; + iceg_turnframe(); + } +}; + +//============================================================================ +// PAIN (no pain animations) +//============================================================================ +void(entity inflictor, entity attacker, float damage) iceg_pain = +{ + // Check for boss wave trigger events + if (iceg_WaveCheck() == TRUE) {self.th_jump(); return;} + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } +}; + +//============================================================================ +// DEATH : Time to melt the heavy water GOLEM! +//============================================================================ +void() iceg_fadeout = +{ + self.origin_z = self.origin_z - 0.2; // Slowly sink into the ground (melting) + self.alpha = 1 - ((time - self.ltime) / 1); + if (random() < 0.1) SpawnProjectileSmoke(self.origin, 200, 100, 100); + if (self.alpha <= 0) entity_hide(self); + else self.nextthink = time + FADEMODEL_TIME; +}; + +//---------------------------------------------------------------------- +void() iceg_startfade = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // Setup ready for fade away ice->water + self.frame = $death22; + self.alpha = 0.99; + self.ltime = time + 2; + self.think = iceg_fadeout; + iceg_fadeout(); +}; + +//---------------------------------------------------------------------- +void(float fdist) iceg_brk = +{ + if (fdist > 0) ai_forward(fdist); + if (random() < 0.2) SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (random() < 0.4) SpawnProjectileSmoke(self.origin, 300, 50, 150); + if (random() < 0.6) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.3) ThrowGib(11, 1); // Small Golem rock +}; + +//---------------------------------------------------------------------- +void() iceg_death1 = [ $death1, iceg_death2 ] {iceg_brk(0);}; +void() iceg_death2 = [ $death2, iceg_death3 ] {iceg_brk(0);}; +void() iceg_death3 = [ $death3, iceg_death4 ] {iceg_brk(2);}; +void() iceg_death4 = [ $death4, iceg_death5 ] {iceg_brk(5);}; +void() iceg_death5 = [ $death5, iceg_death6 ] {iceg_brk(5);}; +void() iceg_death6 = [ $death6, iceg_death7 ] {iceg_brk(10);}; +void() iceg_death7 = [ $death7, iceg_death8 ] {iceg_brk(12);monster_footstep(FALSE);}; +void() iceg_death8 = [ $death8, iceg_death9 ] {iceg_brk(10);}; +void() iceg_death9 = [ $death9, iceg_death10] {iceg_brk(0);}; +void() iceg_death10 = [ $death10, iceg_death11] {iceg_brk(0);}; +void() iceg_death11 = [ $death11, iceg_death12] {iceg_brk(0);}; +void() iceg_death12 = [ $death12, iceg_death13] {iceg_brk(0);}; +void() iceg_death13 = [ $death13, iceg_death14] {iceg_brk(0);}; +void() iceg_death14 = [ $death14, iceg_death15] {iceg_brk(0);}; +void() iceg_death15 = [ $death15, iceg_death16] {iceg_brk(4);}; +void() iceg_death16 = [ $death16, iceg_death17] {iceg_brk(4);}; +void() iceg_death17 = [ $death17, iceg_death18] {iceg_brk(4);}; +void() iceg_death18 = [ $death18, iceg_death19] {iceg_brk(4);}; +void() iceg_death19 = [ $death19, iceg_death20] {iceg_brk(4);}; +void() iceg_death20 = [ $death20, iceg_death21] {iceg_brk(4);}; +void() iceg_death21 = [ $death21, iceg_death22] {iceg_brk(4);}; +void() iceg_death22 = [ $death22, iceg_startfade] { + self.nextthink = time + 4 + random()*4; + self.velocity = '0 0 0'; + self.movetype = MOVETYPE_NONE; +}; + +//---------------------------------------------------------------------- +void() iceg_die = +{ + self.deadflag = DEAD_DEAD; // Nour bites the dust + self.effects = 0; // Remove effects on death + self.style = ICEG_PHASE4; // Heavy Water + self.max_health = MON_GIBEXPLOSION; + + sound (self, CHAN_BODY, "golem/death.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; + iceg_death1 (); +}; + +//============================================================================ +// Wakeup From Statue form +//============================================================================ +void() iceg_birth = { + if (random() < 0.4) SpawnProjectileSmoke(self.origin, 200, 100, 100); + if (random() < 0.8) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.1) ThrowGib(11, 1); // Small Golem rock + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() iceg_wake1 =[ $birth1, iceg_wake2 ] { + self.use = SUB_Null; // No more triggers + self.style = ICEG_PHASE2; // Free to fight + self.yaw_speed = 20 + (skill * 4); // Really Fast Speed + + // Setup player focus + if (activator.flags & FL_CLIENT) { + self.goalentity = self.enemy = activator; + } + else self.enemy = world; + + // Restore all think functions + self.th_stand = iceg_stand1; + self.th_walk = iceg_walk1; + self.th_run = iceg_run1; + self.th_melee = iceg_knock1; + self.th_missile = iceg_magic1; + self.th_updmissile = iceg_shardtrail; + self.th_charge = iceg_magic7; + self.th_slide = iceg_stomp1; + self.th_jump = iceg_waveboundary; + self.th_pain = iceg_pain; + self.th_die = iceg_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + + iceg_birth(); + sound (self, CHAN_BODY, "golem/wakestatue.wav", 1, ATTN_NORM); +}; +void() iceg_wake2 =[ $birth2, iceg_wake3 ] {iceg_birth();ai_forward(2);}; +void() iceg_wake3 =[ $birth3, iceg_wake4 ] {iceg_birth();ai_forward(3);}; +void() iceg_wake4 =[ $birth4, iceg_wake5 ] {iceg_birth();ai_forward(4);}; +void() iceg_wake5 =[ $birth5, iceg_wake6 ] {iceg_birth();ai_forward(3);}; +void() iceg_wake6 =[ $birth6, iceg_wake7 ] {iceg_birth();ai_forward(3);}; +void() iceg_wake7 =[ $birth7, iceg_wake8 ] {iceg_birth();ai_forward(1);}; +void() iceg_wake8 =[ $birth8, iceg_wake9 ] {iceg_birth();monster_footstep(FALSE);}; +void() iceg_wake9 =[ $birth9, iceg_wake10 ] {iceg_birth();}; +void() iceg_wake10 =[ $birth10, iceg_wake11 ] {iceg_birth();}; +void() iceg_wake11 =[ $birth11, iceg_wake12 ] {iceg_birth();monster_idle_sound();}; +void() iceg_wake12 =[ $birth12, iceg_wake13 ] {iceg_birth();}; +void() iceg_wake13 =[ $birth13, iceg_wake14 ] {iceg_birth();}; +void() iceg_wake14 =[ $birth14, iceg_wake15 ] {iceg_birth();}; +void() iceg_wake15 =[ $birth15, iceg_wake16 ] {iceg_birth();}; +void() iceg_wake16 =[ $birth16, iceg_tranB1 ] {iceg_birth();}; + +void() iceg_tranB1 = [ $tranB1, iceg_tranB2 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + iceg_birth(); + ai_forward(8); +}; +void() iceg_tranB2 = [ $tranB2, iceg_tranB3 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB3 = [ $tranB3, iceg_tranB4 ] {iceg_birth();ai_forward(5);monster_idle_sound();}; +void() iceg_tranB4 = [ $tranB4, iceg_tranB5 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB5 = [ $tranB5, iceg_tranB6 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB6 = [ $tranB6, iceg_tranB7 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB7 = [ $tranB7, iceg_tranB8 ] {iceg_birth();ai_forward(5);monster_idle_sound();}; +void() iceg_tranB8 = [ $tranB8, iceg_tranB9 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB9 = [ $tranB9, iceg_tranB10 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB10 = [ $tranB10, iceg_tranB11 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB11 = [ $tranB11, iceg_tranB12 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB12 = [ $tranB12, iceg_tranB13 ] {iceg_birth();ai_forward(5);}; +void() iceg_tranB13 = [ $tranB13, iceg_tranB13 ] { + monster_footstep(FALSE); + self.takedamage = DAMAGE_YES; // Can take damage + self.style = ICEG_PHASE2; // Time to fight! + Resist_ChangeType(self,FALSE); // restore resistance + self.walkframe = 13; // Mid way through set + iceg_runframe(); +}; + +//====================================================================== +// Setup Ice Golem after trigger event +//====================================================================== +void() iceg_setup = +{ + self.use = SUB_Null; // No more triggers + self.style = ICEG_PHASE1; // Bursting intro sequence + self.flags = FL_MONSTER; // Reset flag + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.no_liquiddmg = TRUE; // no slime/lava damage + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.pain_longanim = FALSE; // No axe advantage + self.takedamage = DAMAGE_NO; // No damage, statue time + self.noinfighting = TRUE; // No infighting + self.skin = 1; // Frozen skin + + self.blockudeath = TRUE; // No humanoid death + self.bleedcolour = 16; // Brown dust/dirt + self.meleerange = MONAI_MELEEGOLEM; + self.attack_offset = '10 0 112'; // Ice storm + + self.gibhealth = -1000; // Special death sequence + self.gibbed = FALSE; // Still in one piece + self.pain_finished = self.attack_finished = LARGE_TIMER; + + // Setup Ammo Resistance + self.resist_shells = self.resist_cells = 0; + self.resist_nails = self.resist_rockets = 0.75; + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 5; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + iceg_WaveSetupHP(); + + // default = No think functions + self.th_checkattack = IcegCheckAttack; + self.th_stand = self.th_walk = self.th_run = SUB_Null; + self.th_missile = self.th_die = SUB_Null; + self.th_pain = SUB_Null_pain; + + // Check there is space for Ice Golem to spawn + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Find the tether marker (must be path_corner) + if (self.tethertarget != "") { + self.movelast = find(world,targetname,self.tethertarget); + if (self.movelast.classtype != CT_PATHCORNER) { + dprint("\b[ICEG]\b Tether marker not path_corner!\n"); + spawn_marker(self.movelast.origin, SPNMARK_YELLOW); + self.movelast = world; + } + else spawn_marker(self.movelast.origin, SPNMARK_GREEN); + // Setup default tetherrange + if (!self.tetherrange) self.tetherrange = MONAI_MAXICEG; + } + // Make sure tethertarget is blank + self.tethertarget = ""; + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; + + // Wait for trigger event to be wakeup + self.use = iceg_wake1; +}; + +/*====================================================================== +QUAKED monster_icegolem (1 0.2 0) (-32 -32 -24) (32 32 128) +======================================================================*/ +void() monster_icegolem = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bossicegolem.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_RINGSHOCK); // Ground shockwave + precache_model (MODEL_PROJ_RINGBLAST); // Ice ring shockwave + precache_model (MODEL_PROJ_GROCK1); // Golem rocks + precache_model (MODEL_PROJ_GROCK2); + precache_model (MODEL_PROJ_GSHARD); // Ice shards + + self.gib1mdl = MODEL_PROJ_GROCK1; // small golem rock + self.gib2mdl = MODEL_PROJ_GROCK2; // medium golem rock + self.gib1frame = self.gib2frame = 9; + + // Idle1a-1b (long sound) idle2a-2b (short sound) + self.idle_sound = "golem/idle1a.wav"; + self.idle_sound2 = "golem/idle1b.wav"; + self.idle_soundcom = "golem/idle2a.wav"; + self.idle_soundcom2 = "golem/idle2b.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + // Break free of statue pose + precache_sound ("golem/wakestatue.wav"); + + // Several melee smack sounds and giant ground slam + precache_sound ("golem/melee_swipe.wav"); + precache_sound ("golem/melee_punch.wav"); + precache_sound ("golem/melee_pound.wav"); + precache_sound ("golem/groundslam.wav"); + + // Used for ceiling rubble breakables + precache_sound (SOUND_BRK_ROCK); + precache_sound (SOUND_IMP_ROCK1); + precache_sound (SOUND_IMP_ROCK2); + if (self.brkobj1 == "") self.brkobj1 = MODEL_BRK_ROCK1A; + precache_model (self.brkobj1); + if (self.brkobj2 == "") self.brkobj2 = MODEL_BRK_ROCK1B; + precache_model (self.brkobj2); + + // Additional rubble emitter parameters + if (CheckZeroVector(self.dest1)) self.dest1 = '80 8 1'; + if (CheckZeroVector(self.dest2)) self.dest2 = '0 0 16'; + if (CheckZeroVector(self.brkvol)) self.brkvol = '160 160 8'; + if (CheckZeroVector(self.brkvelbase)) self.brkvelbase = '0 0 50'; + if (CheckZeroVector(self.brkveladd)) self.brkveladd = '100 100 100'; + if (self.brkfade <= 0) self.brkfade = 4; + + // Ice Storm - range attack + precache_sound ("golem/icestorm.wav"); + precache_sound ("golem/iceshard1.wav"); + precache_sound ("golem/iceshard2.wav"); + precache_sound ("golem/iceshard3.wav"); + precache_sound ("golem/iceshard_impact.wav"); + precache_model (SEXP_ICE_BIG); // Shard impact (ne_ruin) + + self.pain_sound = "golem/pain1.wav"; + self.pain_sound2 = "golem/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("golem/death.wav"); + + // Roar! + self.sight_sound = "golem/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 128'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.steptype = FS_TYPEGIANT; // Giant sound + self.health = self.max_health = MEGADEATH; + + self.classtype = CT_MONICEGOLEM; + self.classgroup = CG_STONE; + self.classmove = MON_MOVEWALK; + self.style = 0; + + if (self.deathstring == "") self.deathstring = " was shattered by the Ice Golem\n"; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[ICEGOLEM]\b Missing targetname name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + + total_monsters = total_monsters + 1; + self.use = iceg_setup; +}; + +/*====================================================================== +/*QUAKED monster_icegolem_wavetrig (0.75 0.25 1) (-32 -32 -8) (32 32 8) x +Target for boss column smash wave event +-------- KEYS -------- +targetname : name of wave event (links to noise key on boss) +target : trigger name of adds to spawn +noise1 : trigger name of column 1 +noise2 : trigger name of column 2 +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Target for boss column smash wave event + +======================================================================*/ +void() monster_icegolem_wavetrig = +{ + self.classtype = CT_MONICEGOLEMWAVE; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.takedamage = DAMAGE_NO; + setsize (self, VEC_ORIGIN, VEC_ORIGIN); +}; diff --git a/QC_other/QC_keep/mon_bossidchthon.qc b/QC_other/QC_keep/mon_bossidchthon.qc new file mode 100644 index 00000000..45a7df97 --- /dev/null +++ b/QC_other/QC_keep/mon_bossidchthon.qc @@ -0,0 +1,494 @@ +/*============================================================================== +Chthon (ID software Version) +==============================================================================*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +entity le1, le2; +float lightning_end; + +//=========================================================================== +void() idchthon_tracking = +{ + // Find a player + if (!self.enemy) { + self.enemy = find(world, classname, "player"); + if (!self.enemy) self.enemy = world; + } + + // Check for any no combat conditions + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.health < 1) self.enemy = world; + if (self.enemy) self.th_missile(); +}; + +//---------------------------------------------------------------------- +void() idchthon_idle1 =[ $walk1, idchthon_idle2 ] {idchthon_tracking();}; +void() idchthon_idle2 =[ $walk2, idchthon_idle3 ] {}; +void() idchthon_idle3 =[ $walk3, idchthon_idle4 ] {}; +void() idchthon_idle4 =[ $walk4, idchthon_idle5 ] {}; +void() idchthon_idle5 =[ $walk5, idchthon_idle6 ] {}; +void() idchthon_idle6 =[ $walk6, idchthon_idle7 ] {}; +void() idchthon_idle7 =[ $walk7, idchthon_idle8 ] {}; +void() idchthon_idle8 =[ $walk8, idchthon_idle9 ] {}; +void() idchthon_idle9 =[ $walk9, idchthon_idle10 ] {}; +void() idchthon_idle10 =[ $walk10, idchthon_idle11 ] {idchthon_tracking();}; +void() idchthon_idle11 =[ $walk11, idchthon_idle12 ] {}; +void() idchthon_idle12 =[ $walk12, idchthon_idle13 ] {}; +void() idchthon_idle13 =[ $walk13, idchthon_idle14 ] {}; +void() idchthon_idle14 =[ $walk14, idchthon_idle15 ] {}; +void() idchthon_idle15 =[ $walk15, idchthon_idle16 ] {}; +void() idchthon_idle16 =[ $walk16, idchthon_idle17 ] {}; +void() idchthon_idle17 =[ $walk17, idchthon_idle18 ] {}; +void() idchthon_idle18 =[ $walk18, idchthon_idle19 ] {}; +void() idchthon_idle19 =[ $walk19, idchthon_idle20 ] {}; +void() idchthon_idle20 =[ $walk20, idchthon_idle21 ] {}; +void() idchthon_idle21 =[ $walk21, idchthon_idle22 ] {idchthon_tracking();}; +void() idchthon_idle22 =[ $walk22, idchthon_idle23 ] {}; +void() idchthon_idle23 =[ $walk23, idchthon_idle24 ] {}; +void() idchthon_idle24 =[ $walk24, idchthon_idle25 ] {}; +void() idchthon_idle25 =[ $walk25, idchthon_idle26 ] {}; +void() idchthon_idle26 =[ $walk26, idchthon_idle27 ] {}; +void() idchthon_idle27 =[ $walk27, idchthon_idle28 ] {}; +void() idchthon_idle28 =[ $walk28, idchthon_idle29 ] {}; +void() idchthon_idle29 =[ $walk29, idchthon_idle30 ] {}; +void() idchthon_idle30 =[ $walk30, idchthon_idle31 ] {}; +void() idchthon_idle31 =[ $walk31, idchthon_idle1 ] {idchthon_tracking();}; + +//=========================================================================== +void(vector orgofs) idchthon_missile = +{ + local vector offang, org, vec, dir, mdest, avel; + local float projlen; + + // No enemy, player dead or intermission? + if (!self.enemy || self.enemy.health < 1 || intermission_running > 0) { + self.th_stand(); + return; + } + + sound (self, CHAN_WEAPON, "chthon/attack1.wav", 1, ATTN_NORM); + offang = vectoangles (self.enemy.origin - self.origin); + makevectors (offang); + org = self.origin + attack_vector(orgofs); + + // Skill level adjustment (easy=250, normal=300, hard=350, nm=400) + self.attack_speed = SPEED_LAVABALL + (skill*SPEED_LAVASKILL); + + // Lead the missile on hard mode (This formula is not perfect) + // There are plenty of missiles that go in strange directions, + // especially if the player strafes a lot from side to side. + if (skill > SKILL_NORMAL) { + projlen = vlen(self.enemy.origin - org) / self.attack_speed; + vec = self.enemy.velocity; + vec_z = 0; + mdest = self.enemy.origin + projlen * vec; + } + else mdest = self.enemy.origin; + + dir = normalize (mdest - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_LAVA, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() idchthon_face = +{ + // Find a player + if (!self.enemy) { + self.enemy = find(world, classname, "player"); + if (!self.enemy) self.enemy = world; + } + + // Check for any no combat conditions + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.health < 1) self.enemy = world; + if (self.enemy) ai_face(); +}; + +//---------------------------------------------------------------------- +void() idchthon_missile1 =[ $attack1, idchthon_missile2 ] {idchthon_face();}; +void() idchthon_missile2 =[ $attack2, idchthon_missile3 ] {idchthon_face();}; +void() idchthon_missile3 =[ $attack3, idchthon_missile4 ] {idchthon_face();}; +void() idchthon_missile4 =[ $attack4, idchthon_missile5 ] {idchthon_face();}; +void() idchthon_missile5 =[ $attack5, idchthon_missile6 ] {idchthon_face();}; +void() idchthon_missile6 =[ $attack6, idchthon_missile7 ] {idchthon_face();}; +void() idchthon_missile7 =[ $attack7, idchthon_missile8 ] {idchthon_face();}; +void() idchthon_missile8 =[ $attack8, idchthon_missile9 ] {idchthon_face();}; +void() idchthon_missile9 =[ $attack9, idchthon_missile10 ] {idchthon_missile('100 100 200');}; +void() idchthon_missile10 =[ $attack10, idchthon_missile11 ] {idchthon_face();}; +void() idchthon_missile11 =[ $attack11, idchthon_missile12 ] {idchthon_face();}; +void() idchthon_missile12 =[ $attack12, idchthon_missile13 ] {idchthon_face();}; +void() idchthon_missile13 =[ $attack13, idchthon_missile14 ] {idchthon_face();}; +void() idchthon_missile14 =[ $attack14, idchthon_missile15 ] {idchthon_face();}; +void() idchthon_missile15 =[ $attack15, idchthon_missile16 ] {idchthon_face();}; +void() idchthon_missile16 =[ $attack16, idchthon_missile17 ] {idchthon_face();}; +void() idchthon_missile17 =[ $attack17, idchthon_missile18 ] {idchthon_face();}; +void() idchthon_missile18 =[ $attack18, idchthon_missile19 ] {idchthon_face();}; +void() idchthon_missile19 =[ $attack19, idchthon_missile20 ] {idchthon_face();}; +void() idchthon_missile20 =[ $attack20, idchthon_missile21 ] {idchthon_missile('100 -100 200');}; +void() idchthon_missile21 =[ $attack21, idchthon_missile22 ] {idchthon_face();}; +void() idchthon_missile22 =[ $attack22, idchthon_missile23 ] {idchthon_face();}; +void() idchthon_missile23 =[ $attack23, idchthon_missile1 ] {idchthon_face();}; + +//---------------------------------------------------------------------- +void() idchthon_rise1 =[ $rise1, idchthon_rise2 ] {}; +void() idchthon_rise2 =[ $rise2, idchthon_rise3 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM);}; +void() idchthon_rise3 =[ $rise3, idchthon_rise4 ] {}; +void() idchthon_rise4 =[ $rise4, idchthon_rise5 ] {ai_face();}; +void() idchthon_rise5 =[ $rise5, idchthon_rise6 ] {}; +void() idchthon_rise6 =[ $rise6, idchthon_rise7 ] {ai_face();}; +void() idchthon_rise7 =[ $rise7, idchthon_rise8 ] {}; +void() idchthon_rise8 =[ $rise8, idchthon_rise9 ] {ai_face();}; +void() idchthon_rise9 =[ $rise9, idchthon_rise10 ] {}; +void() idchthon_rise10 =[ $rise10, idchthon_rise11 ] {ai_face();}; +void() idchthon_rise11 =[ $rise11, idchthon_rise12 ] {}; +void() idchthon_rise12 =[ $rise12, idchthon_rise13 ] {ai_face();}; +void() idchthon_rise13 =[ $rise13, idchthon_rise14 ] {}; +void() idchthon_rise14 =[ $rise14, idchthon_rise15 ] {ai_face();}; +void() idchthon_rise15 =[ $rise15, idchthon_rise16 ] {}; +void() idchthon_rise16 =[ $rise16, idchthon_rise17 ] {ai_face();}; +void() idchthon_rise17 =[ $rise17, idchthon_missile1 ] {}; + +//---------------------------------------------------------------------- +void() idchthon_awake = +{ + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_NO; + self.velocity = '0 0 0'; + + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + if (skill == SKILL_EASY) self.health = 1; + else self.health = 3; + self.enemy = activator; + + // DP particle spark and smoke effect to Chthon + // original idea by Seven, green version added later by me + if (ext_dppart) self.traileffectnum = particleeffectnum(self.dpp_name); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + sound (self, CHAN_WEAPON, "chthon/lavasplash.wav", 1, ATTN_NORM); + idchthon_rise1 (); +}; + +//=========================================================================== +void() idchthon_shocka1 =[ $shocka1, idchthon_shocka2 ] {}; +void() idchthon_shocka2 =[ $shocka2, idchthon_shocka3 ] {}; +void() idchthon_shocka3 =[ $shocka3, idchthon_shocka4 ] {}; +void() idchthon_shocka4 =[ $shocka4, idchthon_shocka5 ] {}; +void() idchthon_shocka5 =[ $shocka5, idchthon_shocka6 ] {}; +void() idchthon_shocka6 =[ $shocka6, idchthon_shocka7 ] {}; +void() idchthon_shocka7 =[ $shocka7, idchthon_shocka8 ] {}; +void() idchthon_shocka8 =[ $shocka8, idchthon_shocka9 ] {}; +void() idchthon_shocka9 =[ $shocka9, idchthon_shocka10 ] {}; +void() idchthon_shocka10 =[ $shocka10, idchthon_missile1 ] {}; + +//---------------------------------------------------------------------- +void() idchthon_shockb1 =[ $shockb1, idchthon_shockb2 ] {}; +void() idchthon_shockb2 =[ $shockb2, idchthon_shockb3 ] {}; +void() idchthon_shockb3 =[ $shockb3, idchthon_shockb4 ] {}; +void() idchthon_shockb4 =[ $shockb4, idchthon_shockb5 ] {}; +void() idchthon_shockb5 =[ $shockb5, idchthon_shockb6 ] {}; +void() idchthon_shockb6 =[ $shockb6, idchthon_shockb7 ] {}; +void() idchthon_shockb7 =[ $shockb1, idchthon_shockb8 ] {}; +void() idchthon_shockb8 =[ $shockb2, idchthon_shockb9 ] {}; +void() idchthon_shockb9 =[ $shockb3, idchthon_shockb10 ] {}; +void() idchthon_shockb10 =[ $shockb4, idchthon_missile1 ] {}; + +//---------------------------------------------------------------------- +void() idchthon_shockc1 =[ $shockc1, idchthon_shockc2 ] {}; +void() idchthon_shockc2 =[ $shockc2, idchthon_shockc3 ] {}; +void() idchthon_shockc3 =[ $shockc3, idchthon_shockc4 ] {}; +void() idchthon_shockc4 =[ $shockc4, idchthon_shockc5 ] {}; +void() idchthon_shockc5 =[ $shockc5, idchthon_shockc6 ] {}; +void() idchthon_shockc6 =[ $shockc6, idchthon_shockc7 ] {}; +void() idchthon_shockc7 =[ $shockc7, idchthon_shockc8 ] {}; +void() idchthon_shockc8 =[ $shockc8, idchthon_shockc9 ] {}; +void() idchthon_shockc9 =[ $shockc9, idchthon_shockc10 ] {}; +void() idchthon_shockc10 =[ $shockc10, idchthon_death1 ] {}; + +//---------------------------------------------------------------------- +void() lightning_fire = +{ + local vector p1, p2; + + // done here, put the terminals back up + if (time >= lightning_end) { + self = le1; + func_door_go_down (); + self = le2; + func_door_go_down (); + return; + } + + p1 = (le1.mins + le1.maxs) * 0.5; + p1_z = le1.absmin_z - 16; + + p2 = (le2.mins + le2.maxs) * 0.5; + p2_z = le2.absmin_z - 16; + + // compensate for length of bolt + p2 = p2 - normalize(p2-p1)*100; + + self.nextthink = time + 0.1; + self.think = lightning_fire; + + WriteByte (MSG_ALL, SVC_TEMPENTITY); + WriteByte (MSG_ALL, TE_LIGHTNING3); + WriteEntity (MSG_ALL, world); + WriteCoord (MSG_ALL, p1_x); + WriteCoord (MSG_ALL, p1_y); + WriteCoord (MSG_ALL, p1_z); + WriteCoord (MSG_ALL, p2_x); + WriteCoord (MSG_ALL, p2_y); + WriteCoord (MSG_ALL, p2_z); +}; + +//---------------------------------------------------------------------- +void() lightning_use = +{ + if (lightning_end >= time + 1) return; + + le1 = find( world, target, "lightning"); + le2 = find( le1, target, "lightning"); + if (!le1 || !le2) { + dprint ("\b[CHTHON]\b missing lightning targets\n"); + return; + } + + // Check for lightning block alignment + if ( + (le1.state != STATE_TOP && le1.state != STATE_BOTTOM) + || (le2.state != STATE_TOP && le2.state != STATE_BOTTOM) + || (le1.state != le2.state) ) + { return; } + + // don't let the electrodes go back up until the bolt is done + le1.nextthink = -1; + le2.nextthink = -1; + lightning_end = time + 1; + + sound (self, CHAN_VOICE, "misc/power.wav", 1, ATTN_NORM); + lightning_fire (); + + // advance the boss pain if down + self = find (world, classname, "monster_boss"); + if (!self) return; + self.enemy = activator; + if (le1.state == STATE_TOP && self.health > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.health = self.health - 1; + if (self.health >= 2) idchthon_shocka1(); + else if (self.health == 1) idchthon_shockb1(); + else if (self.health == 0) idchthon_shockc1(); + } +}; + +//=========================================================================== +void() idchthon_death1 = [$death1, idchthon_death2] { +sound (self, CHAN_VOICE, "chthon/death1.wav", 1, ATTN_NORM);}; +void() idchthon_death2 = [$death2, idchthon_death3] {}; +void() idchthon_death3 = [$death3, idchthon_death4] {}; +void() idchthon_death4 = [$death4, idchthon_death5] {}; +void() idchthon_death5 = [$death5, idchthon_death6] {}; +void() idchthon_death6 = [$death6, idchthon_death7] {}; +void() idchthon_death7 = [$death7, idchthon_death8] {}; +void() idchthon_death8 = [$death8, idchthon_death9] {}; +void() idchthon_death9 = [$death9, idchthon_death10] { + sound (self, CHAN_BODY, "chthon/lavasplash.wav", 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +}; +// No plans to support map hacks anymore, function name changed +void() idchthon_death10 = [$death9, idchthon_death10] { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + SUB_UseTargets (); + entity_hide(self); +}; + +/*====================================================================== + QUAKED monster_boss (1 0 0) (-128 -128 -24) (128 128 256) +======================================================================*/ +void() monster_boss = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bosschthon.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_LAVA); + + // Attack/throw/electric sound + precache_sound ("chthon/attack1.wav"); + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("misc/power.wav"); + + self.pain_sound = "chthon/pain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("chthon/death1.wav"); + + // Rise from lava roar + splash + self.sight_sound = "chthon/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("chthon/lavasplash.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-80 -80 -24'; // has own entity setup + self.bbmaxs = '80 80 256'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.health = 3; + self.takedamage = DAMAGE_NO; // Cannot be damaged + self.bouncegrenade = TRUE; // Grenades bounce off! + self.dpp_name = "TR_BOSSCHTHON";// Lava smoke and sparks + self.yaw_speed = 20; // Fast turner + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 1; + self.resist_rockets = self.resist_cells = 1; + + self.th_stand = idchthon_idle1; + self.th_walk = idchthon_idle1; + self.th_run = idchthon_idle1; + self.th_missile = idchthon_missile1; + + self.classtype = CT_MONIDCHTHON; + self.classgroup = CG_BOSS; + + if (self.deathstring == "") self.deathstring = " was blown apart by Chthon\n"; + + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + // Does not go through monster spawn functions + total_monsters = total_monsters + 1; + self.use = idchthon_awake; +}; + +/*====================================================================== +/*QUAKED event_lightning (0 1 1) (-16 -16 -16) (16 16 16) x +Just for boss level. Used for killing Cthon. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Just for boss level. Used for killing Cthon. +======================================================================*/ +void() event_lightning = +{ + self.use = lightning_use; +}; + +/*====================================================================== +/*QUAKED misc_teleporttrain (0 0.5 0.8) (-8 -8 -8) (8 8 8) x +This is used for the final boss ONLY +Flying ball needed to teleport kill Shub-Niggurath +-------- KEYS -------- +-------- SPAWNFLAGS -------- +-------- NOTES -------- +This is used for the final boss ONLY +Flying ball needed to teleport kill Shub-Niggurath +Originallu used bmodel train functions, setup to work like +the shalrath homing missile + +======================================================================*/ +void() teleporttrain_next; +void() teleporttrain_target = +{ + local vector dir; + + if (self.target != "") { + // Find next target entity + self.enemy = find (world, targetname, self.target); + if (self.enemy) { + // Work out distance and angle to turn towards + dir = normalize(self.enemy.origin - self.origin); + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.velocity = dir * self.speed; + + // Shift target to next target in the entity chain + self.target = self.enemy.target; + self.nextthink = time + 0.1; + self.think = teleporttrain_next; + return; + } + } + // No target or entity to follow, full stop + self.velocity = '0 0 0'; + self.enemy = world; +}; + +//---------------------------------------------------------------------- +void() teleporttrain_next = +{ + if (!self.enemy) return; + + // Work out how close to the next target (self.enemy) + self.t_length = vlen(self.enemy.origin - self.origin); + if (self.t_length < 64) teleporttrain_target(); + else { + // Keep checking + self.nextthink = time + 0.1; + self.think = teleporttrain_next; + } +}; + +//---------------------------------------------------------------------- +void() misc_teleporttrain = +{ + self.mdl = "progs/teleport.mdl"; + precache_model (self.mdl); + + self.solid = SOLID_TRIGGER; + // Push movetype cannot rotate, fly can + // self.movetype = MOVETYPE_PUSH; + self.movetype = MOVETYPE_FLY; + self.use = teleporttrain_target; + self.avelocity = vecrand(50,250,FALSE); + + setmodel (self, self.mdl); + setsize (self, VEC_ORIGIN , VEC_ORIGIN); + + if (!self.speed) self.speed = 100; + if (self.target == "") { + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } +}; diff --git a/QC_other/QC_keep/mon_bossidshub.qc b/QC_other/QC_keep/mon_bossidshub.qc new file mode 100644 index 00000000..f6d143cf --- /dev/null +++ b/QC_other/QC_keep/mon_bossidshub.qc @@ -0,0 +1,279 @@ +/*============================================================================== +OLD ONE / Shub-Niggurath (ID software Version) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 idle14 idle15 idle16 +$frame idle17 idle18 idle19 idle20 idle21 idle22 idle23 idle24 +$frame idle25 idle26 idle27 idle28 idle29 idle30 idle31 idle32 +$frame idle33 idle34 idle35 idle36 idle37 idle38 idle39 idle40 +$frame idle41 idle42 idle43 idle44 idle45 idle46 + +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 +$frame shake16 shake17 shake18 shake19 shake20 + +void() finale_1; +void() finale_2; +void() finale_3; +void() finale_4; +entity shub; + +//=========================================================================== +void() idshub_idle1 =[ $idle1, idshub_idle2 ] {}; +void() idshub_idle2 =[ $idle2, idshub_idle3 ] {}; +void() idshub_idle3 =[ $idle3, idshub_idle4 ] {}; +void() idshub_idle4 =[ $idle4, idshub_idle5 ] {}; +void() idshub_idle5 =[ $idle5, idshub_idle6 ] {}; +void() idshub_idle6 =[ $idle6, idshub_idle7 ] {}; +void() idshub_idle7 =[ $idle7, idshub_idle8 ] {}; +void() idshub_idle8 =[ $idle8, idshub_idle9 ] {}; +void() idshub_idle9 =[ $idle9, idshub_idle10 ] {}; +void() idshub_idle10 =[ $idle10, idshub_idle11 ] {}; +void() idshub_idle11 =[ $idle11, idshub_idle12 ] {}; +void() idshub_idle12 =[ $idle12, idshub_idle13 ] {}; +void() idshub_idle13 =[ $idle13, idshub_idle14 ] {}; +void() idshub_idle14 =[ $idle14, idshub_idle15 ] {}; +void() idshub_idle15 =[ $idle15, idshub_idle16 ] {}; +void() idshub_idle16 =[ $idle16, idshub_idle17 ] {}; +void() idshub_idle17 =[ $idle17, idshub_idle18 ] {}; +void() idshub_idle18 =[ $idle18, idshub_idle19 ] {}; +void() idshub_idle19 =[ $idle19, idshub_idle20 ] {}; +void() idshub_idle20 =[ $idle20, idshub_idle21 ] {}; +void() idshub_idle21 =[ $idle21, idshub_idle22 ] {}; +void() idshub_idle22 =[ $idle22, idshub_idle23 ] {}; +void() idshub_idle23 =[ $idle23, idshub_idle24 ] {}; +void() idshub_idle24 =[ $idle24, idshub_idle25 ] {}; +void() idshub_idle25 =[ $idle25, idshub_idle26 ] {}; +void() idshub_idle26 =[ $idle26, idshub_idle27 ] {}; +void() idshub_idle27 =[ $idle27, idshub_idle28 ] {}; +void() idshub_idle28 =[ $idle28, idshub_idle29 ] {}; +void() idshub_idle29 =[ $idle29, idshub_idle30 ] {}; +void() idshub_idle30 =[ $idle30, idshub_idle31 ] {}; +void() idshub_idle31 =[ $idle31, idshub_idle32 ] {}; +void() idshub_idle32 =[ $idle32, idshub_idle33 ] {}; +void() idshub_idle33 =[ $idle33, idshub_idle34 ] {}; +void() idshub_idle34 =[ $idle34, idshub_idle35 ] {}; +void() idshub_idle35 =[ $idle35, idshub_idle36 ] {}; +void() idshub_idle36 =[ $idle36, idshub_idle37 ] {}; +void() idshub_idle37 =[ $idle37, idshub_idle38 ] {}; +void() idshub_idle38 =[ $idle38, idshub_idle39 ] {}; +void() idshub_idle39 =[ $idle39, idshub_idle40 ] {}; +void() idshub_idle40 =[ $idle40, idshub_idle41 ] {}; +void() idshub_idle41 =[ $idle41, idshub_idle42 ] {}; +void() idshub_idle42 =[ $idle42, idshub_idle43 ] {}; +void() idshub_idle43 =[ $idle43, idshub_idle44 ] {}; +void() idshub_idle44 =[ $idle44, idshub_idle45 ] {}; +void() idshub_idle45 =[ $idle45, idshub_idle46 ] {}; +void() idshub_idle46 =[ $idle46, idshub_idle1 ] {}; + +//=========================================================================== +void() idshub_pain1 = [ $shake1, idshub_pain2 ] { lightstyle(0, "m");}; +void() idshub_pain2 = [ $shake2, idshub_pain3 ] { lightstyle(0, "k");}; +void() idshub_pain3 = [ $shake3, idshub_pain4 ] { lightstyle(0, "k");}; +void() idshub_pain4 = [ $shake4, idshub_pain5 ] { lightstyle(0, "i");}; +void() idshub_pain5 = [ $shake5, idshub_pain6 ] { lightstyle(0, "g");}; +void() idshub_pain6 = [ $shake6, idshub_pain7 ] { lightstyle(0, "e");}; +void() idshub_pain7 = [ $shake7, idshub_pain8 ] { lightstyle(0, "c");}; +void() idshub_pain8 = [ $shake8, idshub_pain9 ] { lightstyle(0, "a");}; +void() idshub_pain9 = [ $shake9, idshub_pain10 ] {lightstyle(0, "c");}; +void() idshub_pain10 =[ $shake10, idshub_pain11 ] {lightstyle(0, "e");}; + +void() idshub_pain11 =[ $shake11, idshub_pain12 ] {lightstyle(0, "g");}; +void() idshub_pain12 =[ $shake12, idshub_pain13 ] {lightstyle(0, "i");}; +void() idshub_pain13 =[ $shake13, idshub_pain14 ] {lightstyle(0, "k");}; +void() idshub_pain14 =[ $shake14, idshub_pain15 ] {lightstyle(0, "m");}; +void() idshub_pain15 =[ $shake15, idshub_pain16 ] {lightstyle(0, "m"); +self.cnt = self.cnt + 1; if (self.cnt < 3) self.think = idshub_pain1; }; + +void() idshub_pain16 =[ $shake16, idshub_pain17 ] {lightstyle(0, "g");}; +void() idshub_pain17 =[ $shake17, idshub_pain18 ] {lightstyle(0, "c");}; +void() idshub_pain18 =[ $shake18, idshub_pain19 ] {lightstyle(0, "b");}; +void() idshub_pain19 =[ $shake19, idshub_pain20 ] {lightstyle(0, "a");}; +void() idshub_pain20 =[ $shake20, idshub_pain20 ] {finale_4();}; + +//============================================================================ +// Final thrash, explosion and on screen text waffle +//============================================================================ +void() finale_1 = +{ + intermission_running = INTERMISSION_ENDGAME; //End of the game! + intermission_exittime = time + 100000; // never allow exit + + // find the intermission spot + self.owner = find (world, classname, "info_intermission"); + if (!self.owner) dprint("Cannot find info_intermission"); + + // Find misc teleport thing and remove it + self.enemy = find (world, classname, "misc_teleporttrain"); + if (!self.enemy) dprint("Cannot find teleporttrain"); + else remove (self.enemy); + + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, ""); + + // Cycle through all players and reset them as below + self.enemy = find (world, classname, "player"); + while (self.enemy != world) { + self.enemy.view_ofs = '0 0 0'; + self.enemy.angles = self.enemy.v_angle = self.owner.mangle; + self.enemy.fixangle = TRUE; // turn this way immediately + self.enemy.map = self.map; + self.enemy.nextthink = time + 0.5; + self.enemy.takedamage = DAMAGE_NO; + self.enemy.solid = SOLID_NOT; + self.enemy.movetype = MOVETYPE_NONE; + self.enemy.modelindex = 0; + setorigin (self.enemy, self.owner.origin); + self.enemy = find (self.enemy, classname, "player"); + } + + self.nextthink = time + 0.3; + self.think = finale_2; + self.count = 10; +}; + +//---------------------------------------------------------------------- +// Randomnly spawn 10 teleporter sparkle effects +//---------------------------------------------------------------------- +void() finale_2 = +{ + if (self.count < 0) finale_3(); + else { + sound (self, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM); + + // start a teleport splash inside shub + self.view_ofs_x = crandom()*50; + self.view_ofs_y = -100; + self.view_ofs_z = random()*100; + self.oldorigin = self.origin + self.view_ofs; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, self.oldorigin_x); + WriteCoord (MSG_BROADCAST, self.oldorigin_y); + WriteCoord (MSG_BROADCAST, self.oldorigin_z); + + self.count = self.count - 1; + self.nextthink = time + random()*0.5; + self.think = finale_2; + } +}; + +//---------------------------------------------------------------------- +void() finale_3 = +{ + // start shub thrashing wildly + sound (self, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NORM); + lightstyle(0, "abcdefghijklmlkjihgfedcb"); + idshub_pain1(); +}; + +//---------------------------------------------------------------------- +// Called after thrash animation (last frame) +//---------------------------------------------------------------------- +void() finale_4 = +{ + // Play exploding sound + sound (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM); + self.oldorigin = self.origin; + + // Setup temp entity for directional force for gibs + self.movelast = spawn(); + self.movelast.oldorigin = self.origin - '0 0 -300'; + setorigin (self.movelast, self.movelast.oldorigin); + setmodel (self.movelast, MODEL_BROKEN); + self.enemy = self.movelast; + + // loop through old one x/y/z space and throw tons of meat chunks + self.count = 16; + while (self.count > 0) { + self.view_ofs = vecrand(0,64,TRUE); // random xyz volume loc + self.view_ofs_z = 50 + random()*200; // Extra lift up + self.origin = self.oldorigin + self.view_ofs; // Move origin around + self.health = 0 - random()*200; // Velocity boast + + self.lip = random(); + if (self.lip < 0.1) ThrowGib(1, 1); + else if (self.lip < 0.3) ThrowGib(2, 1); + else if (self.lip < 0.5) ThrowGib(4, 1+random()*3); + else ThrowGib(5, 1+random()*3); + + self.count = self.count - 1; + } + // start the end text + WriteByte (MSG_ALL, SVC_FINALE); + WriteString (MSG_ALL, "Congratulations and well done! You have\nbeaten the hideous Shub-Niggurath, and\nher hundreds of ugly changelings and\nmonsters. You have proven that your\nskill and your cunning are greater than\nall the powers of Quake. You are the\nmaster now. Id Software salutes you."); + + // put a player model down + self.oldorigin = self.oldorigin - '32 264 0'; + setorigin (self.movelast, self.oldorigin); + setmodel (self.movelast, MODEL_PLAYER); + self.movelast.angles = '0 290 0'; + self.movelast.frame = 1; + + remove(self); + + // switch cd track + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 3); + lightstyle(0, "m"); +}; + +//============================================================================ +void (entity inflictor, entity attacker, float damage) idshub_nopain = +{ + self.health = self.max_health; +}; + +/*============================================================================ + QUAKED monster_oldone (1 0 0) (-16 -16 -24) (16 16 32) +============================================================================*/ +void() monster_oldone = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/oldone.mdl"; + precache_model (self.mdl); + + // idle/sight not used + precache_sound ("boss2/idle.wav"); + precache_sound ("boss2/sight.wav"); + + // finale_3/finale_4 stages + precache_sound ("boss2/death.wav"); + precache_sound ("boss2/pop2.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-96 -96 -24'; // has own entity setup + self.bbmaxs = '96 96 192'; + self.bboxtype = BBOX_CUSTOM; // Custom BBox size + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.no_liquiddmg = TRUE; // no slime/lava damage + self.gibbed = FALSE; // Still in one piece + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 1; + self.resist_rockets = self.resist_cells = 1; + + if (self.deathstring == "") self.deathstring = " became one with Shub-Niggurath\n"; + + self.classtype = CT_MONIDSHUB; + self.classgroup = CG_BOSS; + self.health = self.max_health = 40000; // kill by telefrag + self.think = idshub_idle1; + self.nextthink = time + 0.1; + self.takedamage = DAMAGE_YES; + self.th_pain = idshub_nopain; + self.th_die = finale_1; + shub = self; + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + total_monsters = total_monsters + 1; +}; + diff --git a/QC_other/QC_keep/mon_bosslichfiend.qc b/QC_other/QC_keep/mon_bosslichfiend.qc new file mode 100644 index 00000000..3874ed26 --- /dev/null +++ b/QC_other/QC_keep/mon_bosslichfiend.qc @@ -0,0 +1,560 @@ +/*============================================================================== +Lich Fiend from RMQ Project +==============================================================================*/ +$frame brokenmesh + +// Sway from left to right +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 stand20 + +// Slow walk with upright frame +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 + +// Running with rigid shoulders, crouched down +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 + +// Running with asymmetrical frame, left arm lower +$frame runB1 runB2 runB3 runB4 runB5 runB6 runB7 runB8 +$frame runB9 runB10 runB11 runB12 runB13 + +// RangeA = left and right melee swing OR throw fireballs +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 swing8 +$frame swing9 swing10 swing11 swing12 swing13 swing14 swing15 swing16 +$frame swing17 swing18 swing19 swing20 + +// RangeB = lift arms above head summoning sphere/voreballs +$frame sphere1 sphere2 sphere4 sphere5 sphere6 sphere7 sphere8 +$frame sphere9 sphere10 sphere11 sphere12 sphere13 sphere14 sphere15 +$frame sphere16 sphere17 sphere18 sphere19 sphere20 sphere21 sphere22 +$frame sphere23 sphere24 sphere25 + +// RangeC = crounch and rise up with arms outstretched (summon fiends) +$frame summon1 summon2 summon3 summon4 summon5 summon6 summon7 summon8 +$frame summon9 summon10 summon11 summon12 summon13 summon14 summon15 summon16 +$frame summon17 summon18 summon19 summon20 summon21 summon22 summon23 summon24 +$frame summon25 summon26 summon27 summon28 summon29 summon30 + +// SpellB - Lift off ground with arms outstretched (regen/airstrike) +$frame regen1 regen2 regen3 regen4 regen5 regen6 regen7 regen8 +$frame regen9 regen10 regen11 regen12 regen13 regen14 regen15 +$frame regen16 regen17 regen18 regen19 regen20 regen21 regen22 +$frame regen23 regen24 regen25 regen26 regen27 regen28 regen29 +$frame regen30 regen31 regen32 regen33 + +float LFIEND_PHASE1 = 1; // At the altar +float LFIEND_PHASE2 = 2; // Fighting +float LFIEND_PHASE3 = 3; // Spawning mode +float LFIEND_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() lfiend_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() lfiend_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP reached next wave, spawn more fiends +//---------------------------------------------------------------------- +float() lfiend_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + self.th_jump(); // Summon fiends + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + lfiend_WaveSetupHP(); // Reset trigger/hp + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check the tether system +//---------------------------------------------------------------------- +float() lfiend_CheckTether = +{ + self.t_length = vlen(self.origin - self.movelast.origin); + // Check the most obvious first, inside tether range? + if (self.t_length < MONAI_MAXLFIEND) return FALSE; + else { + // If player or tether close to each other? + if ( infront(self.movelast) && infront(self.enemy) ) + return FALSE; + // Stop moving around + else return TRUE; + } +}; + +//---------------------------------------------------------------------- +// Boss Fiend game play logic +//---------------------------------------------------------------------- +void() LfiendCheckAttack = +{ + //---------------------------------------------------------------------- + // Check Melee range and start clawing at the player + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEELFIEND) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // Range attacks (Fireballs, Giant Spheres and Firestorms) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + // Quick fireball attacks + if (self.enemydist < MONAI_CLOSELFIEND && random() < 0.75) { + // Skill 0=3s, 1=2.25s, 2=1.5s, 3=0.75s + self.attack_speed = (4 - skill) * 0.75; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MISSILE; + return; + } + // Summon giant sphere of Doom! + else { + // Skill 0=4s, 1=3s, 2=2s, 3=1s + self.attack_speed = (4 - skill) * 1; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_JUMP; + return; + } + } +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() lfiend_stand1 =[ $stand1, lfiend_stand2] {monster_idle_sound();ai_stand();}; +void() lfiend_stand2 =[ $stand2, lfiend_stand3] {ai_stand();}; +void() lfiend_stand3 =[ $stand3, lfiend_stand4] {ai_stand();}; +void() lfiend_stand4 =[ $stand4, lfiend_stand5] {ai_stand();}; +void() lfiend_stand5 =[ $stand5, lfiend_stand6] {ai_stand();}; +void() lfiend_stand6 =[ $stand6, lfiend_stand7] {ai_stand();}; +void() lfiend_stand7 =[ $stand7, lfiend_stand8] {ai_stand();}; +void() lfiend_stand8 =[ $stand8, lfiend_stand9] {ai_stand();}; +void() lfiend_stand9 =[ $stand9, lfiend_stand10] {ai_stand();}; +void() lfiend_stand10 =[ $stand10, lfiend_stand11] {ai_stand();}; +void() lfiend_stand11 =[ $stand11, lfiend_stand12] {ai_stand();}; +void() lfiend_stand12 =[ $stand12, lfiend_stand13] {ai_stand();}; +void() lfiend_stand13 =[ $stand13, lfiend_stand14] {ai_stand();}; +void() lfiend_stand14 =[ $stand14, lfiend_stand15] {ai_stand();}; +void() lfiend_stand15 =[ $stand15, lfiend_stand16] {ai_stand();}; +void() lfiend_stand16 =[ $stand16, lfiend_stand17] {ai_stand();}; +void() lfiend_stand17 =[ $stand17, lfiend_stand18] {ai_stand();}; +void() lfiend_stand18 =[ $stand18, lfiend_stand19] {ai_stand();}; +void() lfiend_stand19 =[ $stand19, lfiend_stand20] {ai_stand();}; +void() lfiend_stand20 =[ $stand20, lfiend_stand1] {ai_stand();}; + +//====================================================================== +void() lfiend_walk1 =[ $walk1, lfiend_walk2] {monster_idle_sound();ai_walk(8);}; +void() lfiend_walk2 =[ $walk2, lfiend_walk3] {ai_walk(8);}; +void() lfiend_walk3 =[ $walk3, lfiend_walk4] {ai_walk(8);}; +void() lfiend_walk4 =[ $walk4, lfiend_walk5] {ai_walk(8);}; +void() lfiend_walk5 =[ $walk5, lfiend_walk6] {ai_walk(8);}; +void() lfiend_walk6 =[ $walk6, lfiend_walk7] {ai_walk(8);}; +void() lfiend_walk7 =[ $walk7, lfiend_walk8] {ai_walk(8);}; +void() lfiend_walk8 =[ $walk8, lfiend_walk9] {ai_walk(8);}; +void() lfiend_walk9 =[ $walk9, lfiend_walk10] {ai_walk(8);}; +void() lfiend_walk10 =[ $walk10, lfiend_walk11] {ai_walk(8);}; +void() lfiend_walk11 =[ $walk11, lfiend_walk12] {ai_walk(8);}; +void() lfiend_walk12 =[ $walk12, lfiend_walk13] {ai_walk(8);}; +void() lfiend_walk13 =[ $walk13, lfiend_walk14] {ai_walk(8);}; +void() lfiend_walk14 =[ $walk14, lfiend_walk15] {ai_walk(8);}; +void() lfiend_walk15 =[ $walk15, lfiend_walk16] {ai_walk(8);}; +void() lfiend_walk16 =[ $walk16, lfiend_walk17] {ai_walk(8);}; +void() lfiend_walk17 =[ $walk17, lfiend_walk1] {ai_walk(8);}; + +//====================================================================== +void() lfiend_run1 =[ $run1, lfiend_run2] {monster_idle_sound();ai_run(8);}; +void() lfiend_run2 =[ $run2, lfiend_run3] {ai_run(8);}; +void() lfiend_run3 =[ $run3, lfiend_run4] {ai_run(8);}; +void() lfiend_run4 =[ $run4, lfiend_run5] {ai_run(8);}; +void() lfiend_run5 =[ $run5, lfiend_run6] {ai_run(8);}; +void() lfiend_run6 =[ $run6, lfiend_run7] {ai_run(8);}; +void() lfiend_run7 =[ $run7, lfiend_run8] {ai_run(8);}; +void() lfiend_run8 =[ $run8, lfiend_run9] {ai_run(8);}; +void() lfiend_run9 =[ $run9, lfiend_run10] {ai_run(8);}; +void() lfiend_run10 =[ $run10, lfiend_run1] {ai_run(8);}; + +//---------------------------------------------------------------------- +void() lfiend_runB1 =[ $runB1, lfiend_runB2] {monster_idle_sound();ai_run(8);}; +void() lfiend_runB2 =[ $runB2, lfiend_runB3] {ai_run(8);}; +void() lfiend_runB3 =[ $runB3, lfiend_runB4] {ai_run(8);}; +void() lfiend_runB4 =[ $runB4, lfiend_runB5] {ai_run(8);}; +void() lfiend_runB5 =[ $runB5, lfiend_runB6] {ai_run(8);}; +void() lfiend_runB6 =[ $runB6, lfiend_runB7] {ai_run(8);}; +void() lfiend_runB7 =[ $runB7, lfiend_runB8] {ai_run(8);}; +void() lfiend_runB8 =[ $runB8, lfiend_runB9] {ai_run(8);}; +void() lfiend_runB9 =[ $runB9, lfiend_runB10] {ai_run(8);}; +void() lfiend_runB10 =[ $runB10, lfiend_runB11] {ai_run(8);}; +void() lfiend_runB11 =[ $runB11, lfiend_runB12] {ai_run(8);}; +void() lfiend_runB12 =[ $runB12, lfiend_runB13] {ai_run(8);}; +void() lfiend_runB13 =[ $runB13, lfiend_runB1] {ai_run(8);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() lfiend_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + } +}; + +//---------------------------------------------------------------------- +void() lfiend_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() lfiend_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//====================================================================== +// ATTACK A - Double swing/swipe melee attack +// Animation - RangeA = left and right melee swing +//====================================================================== +void() lfiend_attackA1 = {}; + +//====================================================================== +// ATTACK B - Fire a couple of fireballs +// Animation - RangeA = throw fireballs +//====================================================================== +void() lfiend_attackB1 = {}; + +//====================================================================== +// ATTACK C - Sphere of Doom above head! +// Animation - RangeB = lift arms above head summoning sphere/voreballs +//====================================================================== +void() lfiend_attackC1 = {}; + +//====================================================================== +// ATTACK D - Summon Fiends +// Animation - RangeC = crounch and rise up with arms outstretched +//====================================================================== +void() lfiend_attackD1 = {}; + +//====================================================================== +// ATTACK E - Regen/Air Strike +// Animation - Lift off ground with arms outstretched +//====================================================================== + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void() lfiend_painA1 = [ $runB1, lfiend_painA2 ] {}; +void() lfiend_painA2 = [ $runB2, lfiend_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) lfiend_pain = +{ + // Finish with all attachments + lfiend_finish_attachment(); + + // Check for boss wave trigger events + if (lfiend_WaveCheck() == TRUE) {self.th_jump(); return;} + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + lfiend_painA1 (); // Short recoil + } + } +}; + +//============================================================================ +// The Reaper comes for Slenderman! +//============================================================================ +void() lfiend_explode = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // No more Boss! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_PLASMA_BIG, self.origin, "lfiend/explode_death.wav"); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(4, 10 + rint(random()*3)); + ThrowGib(5, 10 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() lfiend_die1 = [ $regen1, lfiend_die2 ] {}; +void() lfiend_die2 = [ $regen2, lfiend_die3 ] {}; +void() lfiend_die3 = [ $regen3, lfiend_die4 ] {self.solid = SOLID_NOT;}; +void() lfiend_die4 = [ $regen4, lfiend_die5 ] {}; +void() lfiend_die5 = [ $regen5, lfiend_die6 ] {}; +void() lfiend_die6 = [ $regen6, lfiend_die7 ] {}; +void() lfiend_die7 = [ $regen7, lfiend_die8 ] {}; +void() lfiend_die8 = [ $regen8, lfiend_die9 ] {}; +void() lfiend_die9 = [ $regen9, lfiend_die10 ] {}; +void() lfiend_die10 = [ $regen10, lfiend_die11 ] {}; +void() lfiend_die11 = [ $regen11, lfiend_die12 ] {}; +void() lfiend_die12 = [ $regen12, lfiend_die13 ] {}; +void() lfiend_die13 = [ $regen13, lfiend_die14 ] {}; +void() lfiend_die14 = [ $regen14, lfiend_die15 ] {}; +void() lfiend_die15 = [ $regen15, lfiend_die15 ] {}; + +//---------------------------------------------------------------------- +void() lfiend_die = +{ + self.deadflag = DEAD_DEAD; // Boss Fiend super dead + self.effects = 0; // Remove effects on death + lfiend_finish_attachment(); // Remove any attachments + lfiend_remove_attachment(); + + sound (self, CHAN_VOICE, "lfiend/death.wav", 1, ATTN_NORM); + lfiend_die1 (); +}; + +//====================================================================== +// SPECIAL PHASES +//====================================================================== +void() lfiend_altar1 = {}; + +//---------------------------------------------------------------------- +void() lfiend_rise1 = {}; + +//====================================================================== +// Setup Fiend after trigger event +//====================================================================== +void() lfiend_awake = +{ + self.use = SUB_Null; + self.style = LFIEND_PHASE1; // Teleport in + self.flags = FL_MONSTER; // Reset flag + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.takedamage = DAMAGE_NO; // Still immune to damage + self.yaw_speed = 20; // Average Speed + self.velocity = '0 0 0'; // Make sure stationary + self.pain_longanim = FALSE; // No axe advantage + self.noinfighting = TRUE; // No infighting + self.count = skill+1; // Total amount of minions + + // Setup Ammo Resistance + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0.75; + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 5; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + lfiend_WaveSetupHP(); + + // Restore all think functions + self.th_checkattack = LfiendCheckAttack; + self.th_stand = lfiend_stand1; + self.th_walk = lfiend_walk1; + self.th_run = lfiend_run1; + self.th_melee = lfiend_attackA1; + self.th_missile = lfiend_attackB1; + self.th_jump = lfiend_attackD1; + self.th_pain = lfiend_pain; + self.th_die = lfiend_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + self.gibhealth = -1000; // Special death sequence + + // Setup player focus + if (activator.flags & FL_CLIENT) { + self.goalentity = self.enemy = activator; + } + else self.enemy = world; + + // Check there is space for Lich Fiend to spawn + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; +}; + +/*====================================================================== + QUAKED monster_lichfiend (1 0 0) (-32 -32 -24) (32 32 128) +======================================================================*/ +void() monster_lichfiend = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bossfiend.mdl"; + precache_model (self.mdl); + + // Typical idle, pain and sight sounds + self.idle_sound = "lfiend/idle1.wav"; + self.idle_sound2 = "lfiend/idle2.wav"; + self.pain_sound = "lfiend/pain.wav"; + self.sight_sound = "lfiend/sight.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.pain_sound); + precache_sound (self.sight_sound); + precache_sound ("lfiend/death.wav"); + precache_sound ("lfiend/explode_death.wav"); + precache_sound ("lfiend/implode_death.wav"); + precache_sound ("lfiend/elec_arch1.wav"); + precache_sound ("lfiend/elec_arch2.wav"); + + // Attack A - Melee + // Attack C - Fireball + // Attack C - Sphere + // Attack D - Summon + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bbmins = '-32 -32 -24'; // Special Size + self.bbmaxs = '32 32 80'; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.health = self.max_health = MEGADEATH; + self.pain_finished = time + LARGE_TIMER; + self.gibbed = FALSE; // Still in one piece + + self.pain_flinch = 200; // 1/2 Shambler level + self.pain_timeout = 2; // Stop constant pain + self.steptype = FS_TYPELARGE; // Shambler feet + + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.takedamage = DAMAGE_NO; // Immune to damage + if (self.deathstring == "") self.deathstring = " was shredded by the Lich Fiend\n"; + + self.classtype = CT_MONLICHFIEND; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + self.style = 0; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[LICHFIEND]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + + total_monsters = total_monsters + 1; + self.use = lfiend_awake; +}; diff --git a/QC_other/QC_keep/mon_bossnour.qc b/QC_other/QC_keep/mon_bossnour.qc new file mode 100644 index 00000000..01514b64 --- /dev/null +++ b/QC_other/QC_keep/mon_bossnour.qc @@ -0,0 +1,1111 @@ +/*============================================================================== +Nouronihar (Based on a monster by Lunaran) +==============================================================================*/ +// Original wizard idle +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 + +// Leaning forward flying pose +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 +$frame fly9 fly10 fly11 fly12 fly13 + +// A = Short recoil to right, B = Long recoil to left +$frame paina1 paina2 paina3 paina4 paina5 paina6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 + +// Very quick fall down backward death +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +// A - Typical spit/spike firing from all arms +$frame shota1 shota2 shota3 shota4 shota5 shota6 shota7 shota8 +$frame shota9 shota10 shota11 + +// B - Long spit/spike firing from all arms +$frame shotb1 shotb2 shotb3 shotb4 shotb5 shotb6 shotb7 shotb8 +$frame shotb9 shotb10 shotb11 shotb12 shotb13 shotb14 shotb15 shotb16 shotb17 + +// C - Slowly flick all arms upward (big attack) +$frame shotc1 shotc2 shotc3 shotc4 shotc5 shotc6 shotc7 shotc8 +$frame shotc9 shotc10 shotc11 shotc12 shotc13 shotc14 shotc15 shotc16 +$frame shotc17 shotc18 shotc19 shotc20 shotc21 shotc22 shotc23 + +// Rise upward and flee from the scene +$frame flee1 flee2 flee3 flee4 flee5 flee6 flee7 flee8 +$frame flee9 flee10 flee11 flee12 flee13 flee14 flee15 flee16 +$frame flee17 flee18 + +// Long reveal of extra arms, pretending to be wizard at first +$frame reveal1 reveal2 reveal3 reveal4 reveal5 reveal6 reveal7 reveal8 +$frame reveal9 reveal10 reveal11 reveal12 reveal13 reveal14 reveal15 reveal16 +$frame reveal17 reveal18 reveal19 reveal20 reveal21 reveal22 reveal23 reveal24 +$frame reveal25 reveal26 reveal27 reveal28 reveal29 reveal30 reveal31 reveal32 +$frame reveal33 reveal34 reveal35 reveal36 + +float NOUR_PHASE1 = 1; // Burst through floor +float NOUR_PHASE2 = 2; // Fighting +float NOUR_PHASE3 = 3; // Frenzy mode +float NOUR_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() nour_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() nour_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP has reached next boss wave trigger event +//---------------------------------------------------------------------- +float() nour_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + nour_WaveSetupHP(); + self.style = NOUR_PHASE3; // Frenzy mode + return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check the tether system +//---------------------------------------------------------------------- +float() nour_CheckTether = +{ + self.t_length = vlen(self.origin - self.movelast.origin); + // Check the most obvious first, inside tether range? + if (self.t_length < MONAI_MAXNOUR) return FALSE; + else { + // If player or tether close to each other? + if (infront(self.movelast) && infront(SUB_entEnemyTarget()) ) + return FALSE; + // Stop moving around + else return TRUE; + } +}; + +//---------------------------------------------------------------------- +// Nour game play logic +//---------------------------------------------------------------------- +void() NourCheckAttack = +{ + //---------------------------------------------------------------------- + // setup enemytarget if one is not active + //---------------------------------------------------------------------- + if (self.enemy.classtype != CT_ENEMYTARGET) { + SUB_setupEnemyTarget(self.enemy, self.height, MONAI_ABOVETIMER); + if (self.enemytarget) self.enemy = self.enemytarget; + } + + //---------------------------------------------------------------------- + // Check Melee range and constantly fire + //---------------------------------------------------------------------- + if (self.enemydist < MONAI_MELEENOUR) { + self.attack_state = AS_MELEE; + return; + } + + //---------------------------------------------------------------------- + // Range attacks (Spit and Bomb) + //---------------------------------------------------------------------- + // Only range attack if cooldown has finished + if (time > self.attack_finished) { + // Fast/intense nail/spit attack + if (self.enemydist < MONAI_CLOSENOUR) { + // Skill 0=3s, 1=2.25s, 2=1.5s, 3=0.75s + self.attack_speed = (4 - skill) * 0.75; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MELEE; + return; + } + // Large rocket bomb attack with floor damage + else { + // Skill 0=4s, 1=3s, 2=2s, 3=1s + self.attack_speed = (4 - skill) * 1; + self.attack_finished = time + self.attack_speed + random(); + self.attack_state = AS_MISSILE; + return; + } + } + + //---------------------------------------------------------------------- + // Maintain distance (strafe) + //---------------------------------------------------------------------- + if (enemy_range >= RANGE_MID || !enemy_vis) { + if (self.attack_state != AS_STRAIGHT) self.attack_state = AS_STRAIGHT; + } + else self.attack_state = AS_SLIDING; +}; + +//====================================================================== +// MONSTER STATES (stand, walk run, attack, pain and death! +//====================================================================== +void() nour_stand1 =[ $idle1, nour_stand2] {monster_idle_sound();ai_stand();}; +void() nour_stand2 =[ $idle2, nour_stand3] {ai_stand();}; +void() nour_stand3 =[ $idle3, nour_stand4] {ai_stand();}; +void() nour_stand4 =[ $idle4, nour_stand5] {ai_stand();}; +void() nour_stand5 =[ $idle5, nour_stand6] {ai_stand();}; +void() nour_stand6 =[ $idle6, nour_stand7] {ai_stand();}; +void() nour_stand7 =[ $idle7, nour_stand8] {ai_stand();}; +void() nour_stand8 =[ $idle8, nour_stand9] {ai_stand();}; +void() nour_stand9 =[ $idle9, nour_stand10] {ai_stand();}; +void() nour_stand10 =[ $idle10, nour_stand11] {ai_stand();}; +void() nour_stand11 =[ $idle11, nour_stand1] {ai_stand();}; + +//====================================================================== +void() nour_walk1 =[ $idle1, nour_walk2] {monster_idle_sound();ai_walk(8);}; +void() nour_walk2 =[ $idle2, nour_walk3] {ai_walk(8);}; +void() nour_walk3 =[ $idle3, nour_walk4] {ai_walk(8);}; +void() nour_walk4 =[ $idle4, nour_walk5] {ai_walk(8);}; +void() nour_walk5 =[ $idle5, nour_walk6] {ai_walk(8);}; +void() nour_walk6 =[ $idle6, nour_walk7] {ai_walk(8);}; +void() nour_walk7 =[ $idle7, nour_walk8] {ai_walk(8);}; +void() nour_walk8 =[ $idle8, nour_walk9] {ai_walk(8);}; +void() nour_walk9 =[ $idle9, nour_walk10] {ai_walk(8);}; +void() nour_walk10 =[ $idle10, nour_walk11] {ai_walk(8);}; +void() nour_walk11 =[ $idle11, nour_walk1] {ai_walk(8);}; + +//====================================================================== +void() nour_slideframe = +{ + if (self.style != NOUR_PHASE2) return; + if (self.health < 1) return; + + // Check for boss wave trigger events + if (nour_WaveCheck() == TRUE) {self.th_jump(); return;} + + if (self.walkframe == 0) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 10) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = nour_slideframe; + + // Setup current animation frame + self.frame = $idle1 + self.walkframe; + self.ideal_yaw = vectoyaw(SUB_orgEnemyTarget() - self.origin); + + // Check the tether system + if (nour_CheckTether()) ai_run(0); + else ai_run(8); +}; + +//---------------------------------------------------------------------- +void() nour_slide1 = {self.walkframe = 0; nour_slideframe();}; + +//====================================================================== +// RUN state - chasing the player +//====================================================================== +void() nour_runframe = +{ + if (self.style != NOUR_PHASE2) return; + if (self.health < 1) return; + + // Check for boss wave trigger events + if (nour_WaveCheck() == TRUE) {self.th_jump(); return;} + + if (self.walkframe == 0) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 12) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = nour_runframe; + + // Setup current animation frame + self.frame = $fly1 + self.walkframe; + self.ideal_yaw = vectoyaw(SUB_orgEnemyTarget() - self.origin); + + // Check the tether system + if (nour_CheckTether()) ai_run(0); + else ai_run(16); +}; + +//---------------------------------------------------------------------- +void() nour_run1 = {self.walkframe = 0; nour_runframe();}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() nour_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_NOUR2B; + self.attachment.alpha = 0.85; + } +}; + +//---------------------------------------------------------------------- +void() nour_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() nour_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//====================================================================== +// ATTACK A - Fire multiple spit/spikes +// Block pain function from interrupting magic attack +//====================================================================== +void(vector offset) nour_spike = +{ + local vector dtarget, starget, ftarget, sorg, forg, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_NOURSPIKE + (skill * SPEED_NOURSKILL); + + ai_face(); + // Work out direction line from self to enemy + dtarget = SUB_orgEnemyTarget() - self.origin; + dtarget = vectoangles(dtarget); + makevectors (dtarget); + + // Work out correct source/target origins + starget = self.origin + v_forward * 16 + v_up * offset_z; + ftarget = SUB_orgEnemyTarget() + '0 0 16'; + + // Add left/right offset + sorg = starget + v_right * offset_x; + forg = ftarget + v_right * offset_x; + dir = normalize(forg - sorg); + launch_projectile (sorg, dir, CT_PROJ_NOUR1, self.attack_speed); + + sorg = starget - v_right * offset_x; + forg = ftarget - v_right * offset_x; + dir = normalize(forg - sorg); + launch_projectile (sorg, dir, CT_PROJ_NOUR1, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() nour_atta1 =[ $shota1, nour_atta2] {ai_face(); + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "nour/attack1.wav", 1, ATTN_NORM); +}; +void() nour_atta2 =[ $shota2, nour_atta3] {ai_face();}; +void() nour_atta3 =[ $shota3, nour_atta4] {ai_face();}; +void() nour_atta4 =[ $shota4, nour_atta5] {nour_spike('24,0,16');}; +void() nour_atta5 =[ $shota5, nour_atta6] {nour_spike('20 0 8');}; +void() nour_atta6 =[ $shota6, nour_atta7] {nour_spike('16 0 0');}; +void() nour_atta7 =[ $shota7, nour_atta8] {nour_spike('12 0 -8');}; +void() nour_atta8 =[ $shota8, nour_atta9] {nour_spike('8 0 -16');}; +void() nour_atta9 =[ $shota9, nour_atta10] {}; +void() nour_atta10 =[ $shota10, nour_atta11] {}; +void() nour_atta11 =[ $shota11, nour_run1] {}; + +//====================================================================== +// ATTACK B - Fire one large blob (grenade) of spit +//====================================================================== +void(vector bombofs) Fire_NourBomb = +{ + local vector org, torg, ang, dir, avel; + + // Finished with bomb effect + nour_finish_attachment(); + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "nour/attack1.wav", 1, ATTN_NORM); + + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(bombofs); + torg = SUB_orgEnemyTarget(); + + self.attack_speed = SPEED_NOURBOMB; + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, org, torg, self.attack_speed); + ang = vectoangles(torg - org); + ang_x = -self.attack_elev; + makevectors (ang); + dir = v_forward * self.attack_speed; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_NOUR2); +}; + +//---------------------------------------------------------------------- +void(vector bombofs, float bombframe) Setup_NourBomb = +{ + local vector org; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) nour_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (bombframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 0; + + // Start growing bomb sound + sound (self, CHAN_WEAPON, "nour/attack2.wav", 1, ATTN_NORM); + } + + // Turn towards enemy and update model attachment + // The offset is based on the nour facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(bombofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = bombframe; + // Random explosion like particles from ball as it grows + particle_explode(self.attachment.origin, 10+random()*10, 0.5+random(), PARTICLE_BURST_YELLOW, 0); +}; + +//---------------------------------------------------------------------- +void() nour_attb1 =[ $shotb1, nour_attb2] {ai_face(); + self.pain_finished = time + 1.5; +}; +void() nour_attb2 =[ $shotb2, nour_attb3] {ai_face();}; +void() nour_attb3 =[ $shotb3, nour_attb4] {ai_face();}; +void() nour_attb4 =[ $shotb4, nour_attb5] {ai_face();}; +void() nour_attb5 =[ $shotb5, nour_attb6] {Setup_NourBomb('24 0 0',0);}; +void() nour_attb6 =[ $shotb6, nour_attb7] {Setup_NourBomb('24 0 -2',1);}; +void() nour_attb7 =[ $shotb7, nour_attb8] {Setup_NourBomb('24 0 -4',2);}; +void() nour_attb8 =[ $shotb8, nour_attb9] {Setup_NourBomb('24 0 -8',3);}; +void() nour_attb9 =[ $shotb9, nour_attb10] {Setup_NourBomb('24 0 -12',4);}; +void() nour_attb10 =[ $shotb10, nour_attb11] {Setup_NourBomb('24 0 -16',5);}; +void() nour_attb11 =[ $shotb11, nour_attb12] {Setup_NourBomb('24 0 -12',6);}; +void() nour_attb12 =[ $shotb12, nour_attb13] {Fire_NourBomb('24 0 -12');}; +void() nour_attb13 =[ $shotb13, nour_attb14] {}; +void() nour_attb14 =[ $shotb14, nour_attb15] {}; +void() nour_attb15 =[ $shotb15, nour_attb16] {}; +void() nour_attb16 =[ $shotb16, nour_attb17] {ai_face();}; +void() nour_attb17 =[ $shotb17, nour_run1] {ai_face();}; + +//====================================================================== +// ATTACK C - Summon wizards around boss +//====================================================================== +void() Spawn_NourFog = +{ + // Randomly pick from teleport sounds + self.lip = random() * 5; + if (self.lip < 1) self.noise = "misc/r_tele1.wav"; + else if (self.lip < 2) self.noise = "misc/r_tele2.wav"; + else if (self.lip < 3) self.noise = "misc/r_tele3.wav"; + else if (self.lip < 4) self.noise = "misc/r_tele4.wav"; + else self.noise = "misc/r_tele5.wav"; + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Show ID teleport particle effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); +}; + +//---------------------------------------------------------------------- +// Fire random plasma spikes while summoning wizard minions +//---------------------------------------------------------------------- +void(vector minofs) Fire_NourPlasma = +{ + local vector org; + + makevectors(self.angles); + org = self.origin + attack_vector(minofs); + self.pos2 = vecrand(0,50,TRUE); + self.pos3 = normalize(self.pos2); + self.attack_speed = SPEED_NOURSPIKE + (random() * SPEED_NOURSKILL); + launch_plasma(org, self.pos3, CT_PROJ_PLASMA, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector minofs) Spawn_NourMin = +{ + // Finished with bomb effect + nour_finish_attachment(); + Fire_NourPlasma(minofs); + + if (!self.enemy) return; + if (self.health < 1) return; + + // Cycle through spawn targets and spawn Tfog + Wizard + self.lip = self.count; + while(self.lip > 0) { + self.attachment3.think = Spawn_NourFog; + self.attachment3.nextthink = time + 0.01 + random()*0.3; + + // If the spawn locaiton all clear, spawn something! + self.pos1 = self.attachment3.origin; + self.aflag = find_minionspace(self.pos1); + if (self.aflag == TRUE) { + // Check for any spawnflags on spawn point + if (random() < 0.5) + minion_wizard(self.pos1, self.enemy, MON_WIZARD_ABOVE); + else minion_wizard(self.pos1, self.enemy, 0); + } + + // Next spawn point + self.attachment3 = self.attachment3.entchain; + self.lip = self.lip - 1; + } +}; + +//---------------------------------------------------------------------- +void(vector minofs, float minframe) Setup_NourMin = +{ + local vector org; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) nour_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (minframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 1; + + // Start Spawning sound + sound (self, CHAN_WEAPON, "nour/attack2.wav", 1, ATTN_NORM); + } + + // The offset is based on the nour facing forward + makevectors(self.angles); + org = self.origin + attack_vector(minofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.angles_x = random()*360; + self.attachment.frame = minframe; + // Slowly suck in particles to energy ball + particle_implode(org, 20+random()*20, 75, 75, PARTICLE_BURST_BLUE); + + // Cycle through spawn targets and fire Lightning per frame + self.lip = self.count; + while(self.lip > 0) { + // Traceline from spawn point to random direction + self.pos1 = self.attachment3.origin - org; + self.pos2 = vecrand(0,50,TRUE); + self.pos3 = normalize(self.pos1 + self.pos2); + traceline(org, org + self.pos3 * 600, FALSE, self); + + // Create lightning bolt from source to target + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self.attachment3); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Play some arching lightning sounds + if (random() < 0.5) { + if (random() < 0.5) sound (self.attachment3, CHAN_BODY, "nour/elec_arch1.wav", 1, ATTN_NORM); + else sound (self.attachment3, CHAN_BODY, "nour/elec_arch2.wav", 1, ATTN_NORM); + } + + // Next spawn point + self.attachment3 = self.attachment3.entchain; + self.lip = self.lip - 1; + } + + // Generate a random bolt of electricity + Fire_NourPlasma(minofs); +}; + +//---------------------------------------------------------------------- +void() nour_attc1 =[ $shotc1, nour_attc2] {ai_face(); + // Block all damage while summoning stuff + Resist_ChangeType(self, TRUE); + + // Reset attack state so it does not keep spawning + self.attack_state = AS_STRAIGHT; + self.lip = self.count; + while (self.lip > 0) { + self.cnt = 4; // Try 4 times, no infinite loops + while (self.cnt > 0) { + // Work out 2 empty spaces around Nour for minions + self.pos2 = vecrand(0,200,TRUE); + self.pos2_z = 16; // Spawn higher than boss + self.pos1 = self.origin + self.pos2; + // Check for available space for mininon + self.aflag = find_minionspace(self.pos1); + self.cnt = self.cnt - 1; + // Space is right, save origin + if (self.aflag == TRUE) self.cnt = -10; + } + // Found space, store origin for later + if (self.cnt == -10) self.attachment3.origin = self.pos1; + else self.attachment3.origin = self.origin; + + // Next spawn point + self.attachment3 = self.attachment3.entchain; + self.lip = self.lip - 1; + } +}; +void() nour_attc2 =[ $shotc2, nour_attc3] {ai_face();}; +void() nour_attc3 =[ $shotc3, nour_attc4] {ai_face();}; +void() nour_attc4 =[ $shotc4, nour_attc5] {Setup_NourMin('24 0 -24',0);}; +void() nour_attc5 =[ $shotc5, nour_attc6] {Setup_NourMin('24 0 -24',1);}; +void() nour_attc6 =[ $shotc6, nour_attc7] {Setup_NourMin('24 0 -22',2);}; +void() nour_attc7 =[ $shotc7, nour_attc8] {Setup_NourMin('24 0 -20',3);}; +void() nour_attc8 =[ $shotc8, nour_attc9] {Setup_NourMin('24 0 -16',4);}; +void() nour_attc9 =[ $shotc9, nour_attc10] {Setup_NourMin('24 0 -16',5);}; +void() nour_attc10 =[ $shotc10, nour_attc11] {Setup_NourMin('24 0 -12',6);}; +void() nour_attc11 =[ $shotc11, nour_attc12] {Setup_NourMin('24 0 -8',6);}; +void() nour_attc12 =[ $shotc12, nour_attc13] {Setup_NourMin('24 0 -4',7);}; +void() nour_attc13 =[ $shotc13, nour_attc14] {Setup_NourMin('24 0 -2',7);}; +void() nour_attc14 =[ $shotc14, nour_attc15] {Spawn_NourMin('24 0 0');}; +void() nour_attc15 =[ $shotc15, nour_attc16] {Fire_NourPlasma('24 0 0');}; +void() nour_attc16 =[ $shotc16, nour_attc17] {}; +void() nour_attc17 =[ $shotc17, nour_attc18] {}; +void() nour_attc18 =[ $shotc18, nour_attc19] {}; +void() nour_attc19 =[ $shotc19, nour_attc20] {}; +void() nour_attc20 =[ $shotc20, nour_attc21] {}; +void() nour_attc21 =[ $shotc21, nour_attc22] {}; +void() nour_attc22 =[ $shotc22, nour_attc23] {ai_face();}; +void() nour_attc23 =[ $shotc23, nour_run1] {ai_face(); + // Restore ammo resistance to default + Resist_ChangeType(self, FALSE); + self.style = NOUR_PHASE2; // Fight mode +}; + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void() nour_paina1 = [ $paina1, nour_paina2 ] {}; +void() nour_paina2 = [ $paina2, nour_paina3 ] {}; +void() nour_paina3 = [ $paina3, nour_paina4 ] {}; +void() nour_paina4 = [ $paina4, nour_paina5 ] {}; +void() nour_paina5 = [ $paina5, nour_paina6 ] {}; +void() nour_paina6 = [ $paina6, nour_run1 ] {}; + +//---------------------------------------------------------------------- +void() nour_painb1 = [ $painb1, nour_painb2 ] {}; +void() nour_painb2 = [ $painb2, nour_painb3 ] {}; +void() nour_painb3 = [ $painb3, nour_painb4 ] {}; +void() nour_painb4 = [ $painb4, nour_painb5 ] {}; +void() nour_painb5 = [ $painb5, nour_painb6 ] {}; +void() nour_painb6 = [ $painb6, nour_painb7 ] {}; +void() nour_painb7 = [ $painb7, nour_painb8 ] {}; +void() nour_painb8 = [ $painb8, nour_painb9 ] {}; +void() nour_painb9 = [ $painb9, nour_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) nour_pain = +{ + // Finish with all attachments + nour_finish_attachment(); + + // Check for boss wave trigger events + if (nour_WaveCheck() == TRUE) {self.th_jump(); return;} + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.8) nour_paina1 (); // Short recoil right + else { + nour_painb1 (); // Long recoil left + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +// Death comes to us all, even Nour! +//============================================================================ +void() nour_explode = +{ + // Check for any final trigger events + if (self.message2 != "") trigger_strs(self.message2,self); + + // No more Nour! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_PLASMA_BIG, self.origin, "nour/explode_death.wav"); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(11, 2); // Left Arm + ThrowGib(12, 2); // Right Arm + ThrowGib(13, 1); // Tail + ThrowGib(4, 10 + rint(random()*3)); + ThrowGib(5, 10 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() nour_die1 = [ $death1, nour_die2 ] {}; +void() nour_die2 = [ $death2, nour_die3 ] {}; +void() nour_die3 = [ $death3, nour_die4 ] {self.solid = SOLID_NOT;}; +void() nour_die4 = [ $death4, nour_die5 ] {}; +void() nour_die5 = [ $death5, nour_die6 ] {}; +void() nour_die6 = [ $death6, nour_die7 ] {}; +void() nour_die7 = [ $death7, nour_die8 ] {}; +void() nour_die8 = [ $death8, nour_die9 ] {self.lip = 0;}; +void() nour_die9 = [ $death9, nour_die9 ] { + // Spawn implosion effect + if (random() < 0.5) + particle_implode(self.origin, 20+random()*20, 100, 100, PARTICLE_BURST_BLUE); + // Spawn particle smoke and explosive smoke + else { + SpawnProjectileSmoke(self.origin, 150, 100, 300); + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_BLUE); + } + + // Check for any random lightning strikes outward + if (random() < 0.5) { + self.pos1 = self.origin - '0 0 16'; + self.pos2 = vecrand(0,50,TRUE); + self.pos2_z = 25 + random()*25; // Always up! + self.pos3 = normalize(self.pos2); + traceline(self.pos1, self.pos1 + self.pos3 * 600, FALSE, self); + + // Create lightning bolt + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Play some arching lightning sounds + if (random() < 0.5) { + if (random() < 0.5) sound (self, CHAN_BODY, "nour/elec_arch1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "nour/elec_arch2.wav", 1, ATTN_NORM); + } + } + // Check for a random bolt of plasma + if (random() < 0.2) Fire_NourPlasma('0 0 -16'); + + // Cycle through end phase + self.lip = self.lip + 1; + if (self.lip == 26) sound (self, CHAN_AUTO, "nour/implode_death.wav", 1, ATTN_NONE); + if (self.lip == 40) nour_explode(); +}; + +//---------------------------------------------------------------------- +void() nour_die = +{ + self.deadflag = DEAD_DEAD; // Nour bites the dust + self.effects = 0; // Remove effects on death + nour_finish_attachment(); // Remove any attachments + nour_remove_attachment(); + + sound (self, CHAN_VOICE, "nour/death.wav", 1, ATTN_NORM); + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + nour_die1 (); +}; + +//====================================================================== +// REVEAL PHASE (coming out of the ground) +//====================================================================== +void() nour_revealframe = +{ + // Beginning of animation block + if (self.walkframe == 3) + sound (self, CHAN_BODY, "nour/reveal.wav", 1, ATTN_NORM); + else if (self.walkframe == 23) + sound (self, CHAN_VOICE, "nour/idle1.wav", 1, ATTN_NORM); + + // Work out remaining distance to go + self.movedir = self.movetarget2.origin - self.origin; + self.t_length = vlen(self.movedir); + // Calc initial velocity boast (burst action) + self.lip = (self.pausetime - time) / 3.6; + self.t_width = 1 + (self.lip/2); + + // If time or distance too small, stop moving + if (self.lip < 0.1 || self.t_length < 2) { + self.velocity = '0 0 0'; + } + // Update velocity every frame + else self.velocity = self.movedir * self.t_width; + + // Turn towards player + if (self.enemy) ai_face(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + self.nextthink = time + 0.1; + // Time to exit reveal? + if (self.walkframe > 35) { + self.walkframe = 0; // Reset just in case + self.height = MONAI_ABOVEDIST; // Enemytarget distance above + self.movetype = MOVETYPE_STEP; // back to regular movement + self.takedamage = DAMAGE_AIM; // Can take damage + self.style = NOUR_PHASE2; // Time to fight! + Resist_ChangeType(self,FALSE); // restore resistance + self.think = nour_run1; // Straight to running + self.frame = $fly1; + FoundHuntTarget(FALSE); // make sure tracking player + } + else { + self.think = nour_revealframe; + // Setup current animation frame + self.frame = $reveal1 + self.walkframe; + } +}; + +//---------------------------------------------------------------------- +void() nour_reveal1 = { + self.pausetime = time + 3.6; + self.walkframe = 0; + nour_revealframe(); +}; + +//====================================================================== +// Create wizard minion entity chain +// Entities are created so that the spawning space can be tested +// before spawning the minions for possible collisions +//====================================================================== +float() nour_minionsetup = +{ + local entity min_prev, min_first; + + self.lip = self.count; + min_prev = min_first = world; + + // Cycle through minion list + while(self.lip > 0) { + newmis = spawn(); + newmis.origin = self.origin; + newmis.owner = self; + // Is this the first pass through loop? + if (!min_first) min_first = newmis; + // Any previous entities created? + if (!min_prev) min_prev = newmis; + else { + // Link previous to current entity + // and move previous forward in chain + min_prev.entchain = newmis; + min_prev = newmis; + } + // Keep on looping + self.lip = self.lip - 1; + } + // Close loop + if (min_first) { + newmis.entchain = min_first; + self.attachment3 = min_first; + return FALSE; + } + else return TRUE; +}; + +//====================================================================== +// Setup Nour after trigger event +//====================================================================== +void() nour_awake = +{ + self.use = SUB_Null; // No more triggers + self.style = NOUR_PHASE1; // Bursting intro sequence + self.flags = FL_MONSTER | FL_FLY; // Reset flag + monster_bbox(); // Setup bounding box + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_FLY; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.takedamage = DAMAGE_NO; // Still immune to damage + self.yaw_speed = 20; // Average Speed + self.velocity = '0 0 0'; // Make sure stationary + self.pain_longanim = FALSE; // No axe advantage + self.noinfighting = TRUE; // No infighting + self.count = skill+1; // Total amount of minions + // skill modifier : Easy = 1, Normal = 2, Hard/NM = 3 + if (self.count > 3) self.count = 3; + // Setup minion chain entity system + if (nour_minionsetup()) { + dprint("\b[NOUR]\b Cannot create minion chain!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Setup Ammo Resistance + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 1; + + //Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + Resist_ChangeType(self,TRUE); // resist everything + + // Setup boss waves and overall health + self.bosswave = 1; + self.bosswavetotal = 4; + self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + nour_WaveSetupHP(); + + // Restore all think functions + self.th_checkattack = NourCheckAttack; + self.th_stand = nour_stand1; + self.th_walk = nour_walk1; + self.th_run = nour_run1; + self.th_slide = nour_slide1; + self.th_melee = nour_atta1; + self.th_missile = nour_attb1; + self.th_jump = nour_attc1; + self.th_pain = nour_pain; + self.th_die = nour_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + self.gibhealth = -1000; // Special death sequence + + // Setup player focus + if (activator.flags & FL_CLIENT) { + self.goalentity = self.enemy = activator; + } + else self.enemy = world; + + // Trigger all spawning events + trigger_strs(self.message, self); + self.message = ""; + + // Find spawning (move) destination + self.movetarget2 = find(world,targetname,self.message2); + if (!self.movetarget2) { + dprint("\b[NOUR]\b Missing spawn destination!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + + // Make sure all death triggers are setup ready + self.message2 = self.target; + self.target = self.target2 = self.deathtarget = ""; + + // Check for tether system (special target field) + if (self.tethertarget == "") { + dprint("\b[NOUR]\b Missing tether marker!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + entity_hide(self); + return; + } + // Find the tether marker (must be path_corner) + self.movelast = find(world,targetname,self.tethertarget); + if (self.movelast.classtype != CT_PATHCORNER) { + dprint("\b[NOUR]\b Tether marker not path_corner!\n"); + spawn_marker(self.movelast.origin, SPNMARK_YELLOW); + self.movelast = world; + } + // Make sure tethertarget is blank + self.tethertarget = ""; + + // Time to rise from the ground + nour_reveal1(); +}; + +/*====================================================================== + QUAKED monster_nouronihar (1 0 0) (-16 -16 -24) (16 16 40) +======================================================================*/ +void() monster_nour = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bossnour.mdl"; + self.headmdl = "progs/h_wizard.mdl"; + self.gib1mdl = "progs/ad171/gib_wzarm1.mdl"; // Left arm/stump + self.gib2mdl = "progs/ad171/gib_wzarm2.mdl"; // Right arm/stump + self.gib3mdl = "progs/ad171/gib_wztail.mdl"; // Tail section + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_WIZ); // Originally progs/w_spike.mdl + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (MODEL_PROJ_NOUR1); // Spit + precache_model (MODEL_PROJ_NOUR2B); // Growing ball + precache_model (MODEL_PROJ_NOUR2P); // Warping projectile + precache_model (MODEL_PROJ_NOUR2S); // Explosive pieces + precache_model (MODEL_PROJ_NOUR3); // Lightning bolt + precache_model (SBURST_POISON); // Poison Burst + + // sight/pain/death sounds + self.idle_sound = "nour/idle1.wav"; + self.pain_sound = "nour/pain.wav"; + self.sight_sound = "nour/sight.wav"; + precache_sound (self.idle_sound); + precache_sound (self.pain_sound); + precache_sound (self.sight_sound); + precache_sound ("nour/reveal.wav"); + + // Final death sequence + precache_sound ("nour/death.wav"); + precache_sound ("nour/explode_death.wav"); + precache_sound ("nour/elec_arch1.wav"); + precache_sound ("nour/elec_arch2.wav"); + precache_sound ("nour/implode_death.wav"); + + // Attack A - Wizard style spit + // Attack B - Large explosive ball + precache_sound ("nour/attack1.wav"); + precache_sound ("nour/attack2.wav"); + precache_sound ("nour/explode2.wav"); + precache_sound ("nour/bounce.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.bboxtype = BBOX_WIDE; // Wraith Body + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.health = self.max_health = MEGADEATH; + self.pain_finished = LARGE_TIMER; + self.no_liquiddmg = TRUE; // no slime/lava damage + self.gibbed = FALSE; // Still in one piece + + self.pain_flinch = 200; // Strong Wizard level + self.pain_timeout = 2; // Stop constant pain + self.steptype = FS_FLYING; // No foot sound + + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.takedamage = DAMAGE_NO; // Immune to damage + + self.classtype = CT_MONNOUR; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + self.style = 0; + if (self.deathstring == "") self.deathstring = " was picked apart by the Scragmother\n"; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[NOUR]\b Missing targetname name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + // Missing spawn trigger + if (self.message == "") { + dprint("\b[NOUR]\b Missing spawn (message) trigger!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + // Missing rise path corner + if (self.message2 == "") { + dprint("\b[NOUR]\b Missing spawn (message2) path corner!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + + total_monsters = total_monsters + 1; + self.use = nour_awake; +}; diff --git a/QC_other/QC_keep/mon_bossxxchthon.qc b/QC_other/QC_keep/mon_bossxxchthon.qc new file mode 100644 index 00000000..e473018c --- /dev/null +++ b/QC_other/QC_keep/mon_bossxxchthon.qc @@ -0,0 +1,565 @@ +/*============================================================================== +Chthon (Custom Version) +==============================================================================*/ +$frame rise1 rise2 rise3 rise4 rise5 rise6 rise7 rise8 rise9 rise10 +$frame rise11 rise12 rise13 rise14 rise15 rise16 rise17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 +$frame walk16 walk17 walk18 walk19 walk20 walk21 walk22 +$frame walk23 walk24 walk25 walk26 walk27 walk28 walk29 walk30 walk31 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 +$frame attack16 attack17 attack18 attack19 attack20 attack21 attack22 +$frame attack23 + +$frame shocka1 shocka2 shocka3 shocka4 shocka5 shocka6 shocka7 shocka8 +$frame shocka9 shocka10 + +$frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6 + +$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 +$frame shockc9 shockc10 + +float CHTHON_PHASE1 = 1; // Rising from Lava +float CHTHON_PHASE2 = 2; // Fighting +float CHTHON_PHASE3 = 3; // Frenzy mode +float CHTHON_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() xxchthon_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + if (!infront(client)) return FALSE; + + // Finally found something + self.enemy = client; + self.oldorigin = self.origin; // Save origin + self.goalentity = self.enemy; // Focus on enemy + // Setup turning angle towards new enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries +//---------------------------------------------------------------------- +void() xxchthon_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP has reached next boss wave trigger event +//---------------------------------------------------------------------- +float() xxchthon_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + xxchthon_WaveSetupHP(); + self.style = CHTHON_PHASE3; // Frenzy mode + return TRUE; + } + return FALSE; +}; + +//=========================================================================== +// IDLE state - waiting for player +//=========================================================================== +void() xxchthon_idleframe = +{ + // Get the obvious exception(s) done first + if (self.health < 1) return; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 30) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = xxchthon_idleframe; + + // Setup current animation frame + self.frame = $walk1 + self.walkframe; + + // Check for HP trigger event + if (xxchthon_WaveCheck() == TRUE) self.th_jump(); + // Keep checking for players + else if (xxchthon_FindTarget()) self.th_missile(); +}; + +//---------------------------------------------------------------------- +void() xxchthon_idle ={ self.walkframe = 0; xxchthon_idleframe(); }; + +//=========================================================================== +// ATTACK 1 - Constant fireballs +//=========================================================================== +void(vector orgofs) xxchthon_missile = +{ + local vector offang, org, vec, dir, mdest, avel; + local float projlen; + + // No enemy or player dead? + if (!self.enemy) return; + + sound (self, CHAN_WEAPON, "chthon/attack1.wav", 1, ATTN_NORM); + offang = vectoangles (self.enemy.origin - self.origin); + makevectors (offang); + org = self.origin + attack_vector(orgofs); + + // Skill level adjustment + self.attack_speed = self.pos1_x + (skill*self.pos1_y); + + // Lead the missile on hard mode (This formula is not perfect) + // There are plenty of missiles that go in strange directions, + // especially if the player strafes a lot from side to side. + if (skill > SKILL_HARD) { + projlen = vlen(self.enemy.origin - org) / self.attack_speed; + vec = self.enemy.velocity; + vec_z = 0; + mdest = self.enemy.origin + projlen * vec; + } + else mdest = self.enemy.origin; + + dir = normalize (mdest - org); + avel = vecrand(100,200,FALSE); + Launch_Missile (org, dir, avel, CT_PROJ_CHTHON, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() xxchthon_attackframe = +{ + // Get the obvious exception(s) done first + if (self.health < 1) return; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 7) xxchthon_missile('100 100 200'); + else if (self.walkframe == 18) xxchthon_missile('100 -100 200'); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 22) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = xxchthon_attackframe; + + // Setup current animation frame + self.frame = $attack1 + self.walkframe; + + // Check for HP trigger event + if (xxchthon_WaveCheck() == TRUE) self.th_jump(); + // Keep checking for players + else { + // Keep checking for player and turning towards them + // Check for any no combat conditions + if (self.enemy.health < 1) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + + // No enemy? back to idle, else keep turning + if (!self.enemy) self.th_stand(); + else ai_face(); + } +}; + +//---------------------------------------------------------------------- +void() xxchthon_attack ={ self.walkframe = 0; xxchthon_attackframe(); }; + +//============================================================================ +// Re-using the original shock animations for end of wave event +//============================================================================ +void() xxchthon_shakeattack = +{ + local vector org, ang, dir, avel; + + // Custom grenade firing speed + self.attack_speed = self.pos3_x; + + // Shoot grenades from top of shub + makevectors(self.angles); + org = self.origin + attack_vector(self.dest2); + + // Randomly shoot grenades in any directions + ang = '0 0 0'; + ang_y = rint(random()*360); + makevectors(ang); + // Use classic grenade angle system, not Z aware + dir = v_forward * self.attack_speed; + dir_z = self.pos3_y; + + // A bit of random spin and fire! + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_CHTHON2); +}; + +//---------------------------------------------------------------------- +void() xxchthon_shakeframe = +{ + // Randomnly fire grenades outward + if (random() < 0.75) xxchthon_shakeattack(); + + // Keep on looping around + self.nextthink = time + 0.1; + self.think = xxchthon_shakeframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 9) { + self.walkframe = 0; + self.count = self.count + 1; + self.inpain = self.inpain + 1; + + // has chthon looped around 3 times? + if (self.count > 1) { + Resist_ChangeType(self, FALSE); + self.style = CHTHON_PHASE2; + // Straight back to throwing fireballs! + self.think = self.th_missile; + } + } + + // Update current frames (2 sets of animations) + if (self.inpain == 0) self.frame = $shocka1 + self.walkframe; + else self.frame = $shockc1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() xxchthon_shake = +{ + // Start roaring and shaking + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + Resist_ChangeType(self, TRUE); + self.walkframe = self.count = self.inpain = 0; + xxchthon_shakeframe(); +}; + +//============================================================================ +// PAIN and DEATH +//============================================================================ +void(entity inflictor, entity attacker, float damage) xxchthon_pain = +{ + + // Check for boss wave trigger events + if (xxchthon_WaveCheck() == TRUE) {self.th_jump(); return;} + self.pain_finished = time + 2 + random()*2; + + // Spawn particle/smoke damage + SpawnProjectileSmoke(inflictor.origin, 200, 50, 150); + if (damage > 30) SpawnProjectileSmoke(inflictor.origin, 200, 50, 250); + // The pain sound not linked to animation, so less useful + if (random() < 0.2 && damage > 30) + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); +}; + +//============================================================================ +// DEATH - Fall down and explode +//============================================================================ +void() xxchthon_lavasplash = +{ + sound (self, CHAN_BODY, "chthon/lavasplash.wav", 1, ATTN_NORM); + if (ext_dppart) { + // Two different types of liquid splash (only DP) + if (self.spawnflags & MON_CHTHON_GREEN) + pointparticles(particleeffectnum("TE_SLIMESPLASH"), self.origin, '0 0 0', 1); + else + pointparticles(particleeffectnum("TE_LAVASPLASH"), self.origin, '0 0 0', 1); + } + else { + // Classic Fitz/QS engine effects (hard coded) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } +}; + +//---------------------------------------------------------------------- +void() xxchthon_explode = +{ + // No more Boss! + entity_hide(self); + + // Gib explosive fountain!?! + self.max_health = MON_GIBEXPLOSION; + ThrowGib(11, 15 + rint(random()*10)); // lava explosions +}; + +//---------------------------------------------------------------------- +void() xxchthon_explosion = +{ + // Pick random location above/center of chthin + self.oldorigin = self.origin + vecrand(0,100,TRUE); + self.oldorigin_z = self.origin_z + 50 + random()*100; + + // Spawn smoke, explosion and lava gib! + SpawnProjectileSmoke(self.oldorigin, 100, 400, 100); + if (random() < 0.5) self.lip = EXPLODE_MED; + else self.lip = EXPLODE_BIG; + SpawnExplosion(self.lip, self.oldorigin, ""); + ThrowGib(11, 1); +}; + +//---------------------------------------------------------------------- +void() xxchthon_death1 = [$death1, xxchthon_death2] {}; +void() xxchthon_death2 = [$death2, xxchthon_death3] {xxchthon_explosion();}; +void() xxchthon_death3 = [$death3, xxchthon_death4] {xxchthon_explosion();}; +void() xxchthon_death4 = [$death4, xxchthon_death5] {xxchthon_explosion();}; +void() xxchthon_death5 = [$death5, xxchthon_death6] {xxchthon_explosion();}; +void() xxchthon_death6 = [$death6, xxchthon_death7] {xxchthon_explosion();}; +void() xxchthon_death7 = [$death7, xxchthon_death8] {xxchthon_explosion();}; +void() xxchthon_death8 = [$death8, xxchthon_death9] {xxchthon_explosion();}; +void() xxchthon_death9 = [$death9, xxchthon_explode] {xxchthon_lavasplash();}; + +//---------------------------------------------------------------------- +void() xxchthon_die = +{ + self.style = CHTHON_PHASE4; // Game Over for Chthon! + self.deadflag = DEAD_DEAD; // the rock finally crashed + self.effects = 0; // Remove effects on death + self.solid = SOLID_NOT; // no longer need to block + self.max_health = MON_GIBEXPLOSION; + + sound (self, CHAN_VOICE, "chthon/death1.wav", 1, ATTN_NORM); + xxchthon_death1 (); +}; + +//============================================================================ +// RISE up from the swirling liquid +//============================================================================ +void() xxchthon_rise1 =[ $rise1, xxchthon_rise2 ] {xxchthon_lavasplash();}; +void() xxchthon_rise2 =[ $rise2, xxchthon_rise3 ] { + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM);}; +void() xxchthon_rise3 =[ $rise3, xxchthon_rise4 ] {}; +void() xxchthon_rise4 =[ $rise4, xxchthon_rise5 ] {ai_face();}; +void() xxchthon_rise5 =[ $rise5, xxchthon_rise6 ] {}; +void() xxchthon_rise6 =[ $rise6, xxchthon_rise7 ] {ai_face();}; +void() xxchthon_rise7 =[ $rise7, xxchthon_rise8 ] {}; +void() xxchthon_rise8 =[ $rise8, xxchthon_rise9 ] {ai_face();}; +void() xxchthon_rise9 =[ $rise9, xxchthon_rise10 ] {}; +void() xxchthon_rise10 =[ $rise10, xxchthon_rise11 ] {ai_face();}; +void() xxchthon_rise11 =[ $rise11, xxchthon_rise12 ] {}; +void() xxchthon_rise12 =[ $rise12, xxchthon_rise13 ] {ai_face();}; +void() xxchthon_rise13 =[ $rise13, xxchthon_rise14 ] {}; +void() xxchthon_rise14 =[ $rise14, xxchthon_rise15 ] {ai_face();}; +void() xxchthon_rise15 =[ $rise15, xxchthon_rise16 ] {}; +void() xxchthon_rise16 =[ $rise16, xxchthon_rise17 ] {ai_face();}; +void() xxchthon_rise17 =[ $rise17, xxchthon_attack ] { + self.style = CHTHON_PHASE2; // Start fighting + self.takedamage = DAMAGE_AIM; +}; + +//====================================================================== +// Setup Chthon after trigger event +//====================================================================== +void() xxchthon_awake = +{ + self.use = SUB_Null; // No more triggers + self.style = CHTHON_PHASE1; // Rising from Lava + self.flags = FL_MONSTER; // Reset flag (no user settings) + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.takedamage = DAMAGE_NO; // Still immune to damage + self.yaw_speed = 20; // Average Speed + self.velocity = '0 0 0'; // Make sure stationary + self.pain_longanim = FALSE; // No axe advantage + self.noinfighting = TRUE; // No infighting + + Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + + // Setup boss waves and overall health + if (self.bosswave < 1) self.bosswavetotal = 5; + else self.bosswavetotal = self.bosswave; + + // Always start bosswave at 1 + self.bosswave = 1; + if (self.bosswaveqty < 1) self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + xxchthon_WaveSetupHP(); + + // Restore all think functions + self.th_stand = xxchthon_idle; + self.th_walk = xxchthon_idle; + self.th_run = xxchthon_idle; + self.th_missile = xxchthon_attack; + self.th_jump = xxchthon_shake; + self.th_pain = xxchthon_pain; + self.th_die = xxchthon_die; + + self.pain_finished = time + 3; // Make pain go away + self.attack_finished = time + 2; // Reset attack system + self.gibhealth = -1000; // Special death sequence + self.enemy = activator; + + // DP particle spark and smoke effect to Chthon + // original idea by Seven, green version added later by me + if (ext_dppart) self.traileffectnum = particleeffectnum(self.dpp_name); + + // Time to rise from lava + xxchthon_rise1 (); +}; + +/*====================================================================== + QUAKED monster_chthon (1 0 0) (-128 -128 -24) (128 128 256) +======================================================================*/ +void() monster_chthon = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_bosschthon.mdl"; + precache_model (self.mdl); + precache_model(MODEL_PROJ_CHTHON1); + + // Final explosion (10 distorted balls of lava/slime) + self.gib1mdl = MODEL_PROJ_CHTHON1; + self.gib1frame = 9; + + // Load up slime version and switch gibs + if (self.spawnflags & MON_CHTHON_GREEN) { + self.skin = self.gib1skin = 2; + precache_model (MODEL_PROJ_SLIME); + self.dpp_name = "TR_BOSSCHTHONGRN"; + self.gibtype = GIBTYPE_POISON; + self.poisonous = TRUE; + if (self.deathstring == "") self.deathstring = " was blown apart by Poison Chthon\n"; + } + else { + // Check for new red/fire skin + if (self.spawnflags & MON_CHTHON_RED) { + self.skin = self.gib1skin = 1; + if (self.deathstring == "") self.deathstring = " was blown apart by Blood Chthon\n"; + } else { + if (self.deathstring == "") self.deathstring = " was blown apart by Chthon\n"; + } + precache_model (MODEL_PROJ_LAVA); + self.dpp_name = "TR_BOSSCHTHON"; + } + + self.idle_sound = "chthon/idle1.wav"; + precache_sound (self.idle_sound); + + // Attack/throw/electric sound + precache_sound ("chthon/attack1.wav"); + precache_sound ("weapons/rocket1i.wav"); + precache_sound ("chthon/bounce.wav"); + + self.pain_sound = "chthon/pain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("chthon/death1.wav"); + + // Rise from lava roar + splash + self.sight_sound = "chthon/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("chthon/lavasplash.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-80 -80 -24'; // has own entity setup + self.bbmaxs = '80 80 256'; + self.bboxtype = BBOX_CUSTOM; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + self.health = self.max_health = MEGADEATH; + self.pain_finished = LARGE_TIMER; + self.no_liquiddmg = TRUE; // no slime/lava damage + self.gibbed = FALSE; // Still in one piece + + self.pain_flinch = 400; // Shambler level + self.pain_timeout = 2; // Stop constant pain + + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.takedamage = DAMAGE_NO; // Immune to damage + if (self.deathstring == "") self.deathstring = " was blown apart by Chthon\n"; + + // Setup projectile speed (250 + 50*skill) + if (CheckZeroVector(self.pos1)) self.pos1 = '250 50 0'; + // Setup projectile damage (Base + Random, Splash) + if (CheckZeroVector(self.pos2)) self.pos2 = DAMAGE_RLPLAYER; + // Attack 2 - Setup projectile speed, splash damage + if (CheckZeroVector(self.pos3)) self.pos3 = '300 500 40'; + // Attack 2 - Spawn location (offset from origin) + if (CheckZeroVector(self.dest2)) self.dest2 = '0 0 96'; + + self.classtype = CT_MONXXCHTHON; + self.classgroup = CG_BOSS; + self.style = 0; + + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[CHTHON]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + // Does not go through monster spawn functions + total_monsters = total_monsters + 1; + self.use = xxchthon_awake; +}; diff --git a/QC_other/QC_keep/mon_bossxxshub.qc b/QC_other/QC_keep/mon_bossxxshub.qc new file mode 100644 index 00000000..2a647b2e --- /dev/null +++ b/QC_other/QC_keep/mon_bossxxshub.qc @@ -0,0 +1,529 @@ +/*============================================================================== +OLD ONE / Shub-Niggurath (ID software Version) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 idle14 idle15 idle16 +$frame idle17 idle18 idle19 idle20 idle21 idle22 idle23 idle24 +$frame idle25 idle26 idle27 idle28 idle29 idle30 idle31 idle32 +$frame idle33 idle34 idle35 idle36 idle37 idle38 idle39 idle40 +$frame idle41 idle42 idle43 idle44 idle45 idle46 + +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 +$frame shake16 shake17 shake18 shake19 shake20 + +float SHUB_PHASE1 = 1; // Waiting for a trigger event +float SHUB_PHASE2 = 2; // Fighting +float SHUB_PHASE3 = 3; // Frenzy mode +float SHUB_PHASE4 = 4; // Death + +//====================================================================== +// Global functions +//====================================================================== +// Special streamlined player find function +//---------------------------------------------------------------------- +float() xxshub_FindTarget = +{ + local entity client; + + // Get the obvious exception(s) done first + if (self.health < 1) return FALSE; + if (intermission_running) return FALSE; + + // Find a client in current PVS + client = checkclient (); + + // Go through all the exception(s) + if (!client) return FALSE; + if (!(client.flags & FL_CLIENT)) return FALSE; + if (client.flags & FL_NOTARGET) return FALSE; + if (client.items & IT_INVISIBILITY) return FALSE; + + // Check range and visibility of player + enemy_vis = visible(client); + if (!enemy_vis) return FALSE; + + // Finally found something + self.enemy = client; + self.goalentity = self.enemy; + + // We have a winner! + return TRUE; +}; + +//---------------------------------------------------------------------- +// Setup wave HP and trigger boundaries (one function to be consistent) +//---------------------------------------------------------------------- +void() xxshub_WaveSetupHP = +{ + // Is there anymore boss waves left? + if (self.bosswave >= self.bosswavetotal) { + // Only one wave left (death is final trigger) + self.health = self.bosswaveqty; + self.bosswavetrig = -1000; + } + else { + // Multiple waves are still left (reset hp+trigger) + // Always reset HP to stop high DPS weapons trashing waves boundaries + self.health = ((self.bosswavetotal - self.bosswave) + 1) * self.bosswaveqty; + // The wave trigger is always one wave lower + self.bosswavetrig = self.health - self.bosswaveqty; + } + // Debug messages for wave and health + dprint("\b[BOSS]\b Wave ("); dprint(ftos(self.bosswave)); + dprint(" / "); dprint(ftos(self.bosswavetotal)); + dprint(") HP ("); dprint(ftos(self.health)); + dprint(") Trig ("); dprint(ftos(self.bosswavetrig)); + dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Check if HP has reached next boss wave trigger event +//---------------------------------------------------------------------- +float() xxshub_WaveCheck = +{ + // Check for boss wave boundary event + if (self.health > 1 && self.health < self.bosswavetrig) { + // Check for wave boundary triggers + self.noise = ""; + if (self.bosswave == 1) self.noise = self.noise1; + else if(self.bosswave == 2) self.noise = self.noise2; + else if(self.bosswave == 3) self.noise = self.noise3; + else if(self.bosswave == 4) self.noise = self.noise4; + + // Is there any trigger for the wave boundary? + if (self.noise != "") trigger_strs(self.noise, self); + + // Update Boss wave parameters (next wave!) + self.bosswave = self.bosswave + 1; + xxshub_WaveSetupHP(); // Reset trigger/hp + self.style = SHUB_PHASE3; // Frenzy mode + return TRUE; + } + return FALSE; +}; + +//=========================================================================== +// IDLE state - flailing arms (only state really) +//=========================================================================== +void() xxshub_idleframe = +{ + // Get the obvious exception(s) done first + if (self.health < 1) return; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 12) monster_idle_sound(); + else if (self.walkframe == 24) monster_idle_sound(); + else if (self.walkframe == 36) monster_idle_sound(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 45) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = xxshub_idleframe; + + // Setup current animation frame + self.frame = $idle1 + self.walkframe; + + // Check for HP trigger event + if (xxshub_WaveCheck() == TRUE) self.th_missile(); + + // Check for combat event + if (self.style == SHUB_PHASE2) { + // Check for any no combat conditions + if (self.enemy.health < 1) self.enemy = world; + else if (intermission_running > 0) self.enemy = world; + else if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + + // If no enemy, keep looking + if (!self.enemy) xxshub_FindTarget(); + // Check for attack 1 - Homing Missile + if (self.enemy) self.th_melee(); + } +}; + +//---------------------------------------------------------------------- +void() xxshub_idle ={ self.walkframe = 0; xxshub_idleframe(); }; + +//============================================================================ +// Attack 1 : Fire Shub Homing Missile +//============================================================================ +void() xxshub_attack1 = +{ + // Check sightline to player + if (visblocked(self.enemy)) return; + if (time < self.attack_finished) return; + + SUB_AttackFinished (2 + 2*random()); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "shub/attack1.wav", 1, ATTN_NORM); + + // Skill level adjustment + self.attack_speed = self.pos1_x + (skill*self.pos1_y); + // Spawn from front of Shub + Launch_HomingMissile (self.dest1, '0 0 10', CT_PROJ_SHUB1, self.attack_speed); +}; + +//============================================================================ +// Attack 2 : shake and spam grenades (end of wave event) +//============================================================================ +void() xxshub_shakeattack = +{ + local vector org, dir, ang, avel; + + // Custom grenade firing speed + self.attack_speed = self.pos3_x; + + // Shoot grenades from top of shub + makevectors(self.angles); + org = self.origin + attack_vector(self.dest2); + + // Randomly shoot grenades in any directions + ang = '0 0 0'; + ang_y = rint(random()*360); + makevectors(ang); + dir = v_forward * self.attack_speed; + dir_z = self.pos3_y; + + // Bit of random spin and fire grenade + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_SHUB2); +}; + +//---------------------------------------------------------------------- +void() xxshub_shakeframe = +{ + // Randomnly fire grenades outward + if (random() < 0.5) xxshub_shakeattack(); + + if (self.walkframe == 0) { + sound (self, CHAN_WEAPON, "shub/attack2.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + } + + // Keep on looping around + self.nextthink = time + 0.1; + self.think = xxshub_shakeframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 14) { + self.walkframe = 0; + self.count = self.count + 1; + + // has shub looped around 3 times? + if (self.count > 2) { + // Slight attack pause after the shake + self.attack_finished = time + 2 + 2*random(); + Resist_ChangeType(self, FALSE); + self.style = SHUB_PHASE2; + self.think = self.th_stand; + } + } + + // Update frame and keep on shaking! + else self.frame = $shake1 + self.walkframe; +}; + +//---------------------------------------------------------------------- +void() xxshub_attack2 = +{ + Resist_ChangeType(self, TRUE); + self.walkframe = self.count = 0; + xxshub_shakeframe(); +}; + +//============================================================================ +// PAIN (ignored, just keeps on firing) +//============================================================================ +void(entity inflictor, entity attacker, float damage) xxshub_pain = +{ + // Shub been hit, wakeup and start attacking + if (self.style == SHUB_PHASE1) {self.use(); return;} + self.pain_finished = time + 2 + random()*2; + + // Check for boss wave trigger events + if (xxshub_WaveCheck() == TRUE) {self.th_missile(); return;} + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + // Spawn particle/smoke damage + SpawnProjectileSmoke(inflictor.origin, 200, 50, 150); + if (damage > 30) SpawnProjectileSmoke(inflictor.origin, 200, 50, 250); + // random pick sound + if (random() < 0.5) + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } +}; + +//=========================================================================== +// FINAL DEATH - shake it baby and explode +//=========================================================================== +void() xxshub_explode = +{ + // No more Boss! + entity_hide(self); + + // Blue ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_BIG, self.origin, "shub/explode_death.wav"); + + // Gib explosive fountain!?! + ThrowGib(11, 10 + rint(random()*10)); // large blobs + ThrowGib(4, 5 + rint(random()*3)); // Some flesh bits + ThrowGib(5, 10 + rint(random()*3)); +}; + +//---------------------------------------------------------------------- +void() xxshub_deathframe = +{ + // Throw debris out from top of shub + self.pos3 = vecrand(100,100,TRUE); + self.pos3_z = 128 + random()*128; + SpawnProjectileSmoke(self.origin+self.pos3, 200, 50, 150); + // Random chance of gib + explosion + if (random() < 0.25) + SpawnExplosion(EXPLODE_MED, self.origin+self.pos3, SOUND_REXP3); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 15 && self.count < 3) { + self.walkframe = 0; + self.count = self.count + 1; + } + + if (self.walkframe > 19) xxshub_explode(); + // Update frame and keep on shaking! + else { + self.frame = $shake1 + self.walkframe; + // Keep on looping around + self.nextthink = time + 0.1; + self.think = xxshub_deathframe; + } +}; + +//---------------------------------------------------------------------- +void() xxshub_die = +{ + self.style = SHUB_PHASE4; // Game Over for Shub! + self.deadflag = DEAD_DEAD; // the rock finally crashed + self.effects = 0; // Remove effects on death + self.solid = SOLID_NOT; // no longer need to block + self.max_health = MON_GIBEXPLOSION; + + sound (self, CHAN_VOICE, "shub/death1.wav", 1, ATTN_NORM); + self.walkframe = self.count = 0; + xxshub_deathframe(); +}; + +//---------------------------------------------------------------------- +// Switch Shub into a fighting stance +//---------------------------------------------------------------------- +void() xxshub_wakeup = +{ + // Time to fight! + self.use = SUB_Null; // No more triggers + self.style = SHUB_PHASE2; // Start fighting + + Resist_ChangeType(self, FALSE); // Default resistance + + // Wakeup sound + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_NORM); + + // Restore pain thresholds and timers + self.pain_flinch = 400; // Shambler level + self.pain_timeout = 2; // Stop constant pain + + // Wait for wakeup sound to finish before combat + self.pain_finished = time + 2 + random()*2; + self.attack_finished = time + 2; + + // Check for player (use activator) + if (activator.flags & FL_CLIENT) self.enemy = activator; +}; + +//---------------------------------------------------------------------- +// Setup Shub after trigger event +//---------------------------------------------------------------------- +void() xxshub_start = +{ + self.use = SUB_Null; // Suppress trigger events + self.style = SHUB_PHASE1; // Waiting for combat trigger + self.flags = FL_MONSTER; // Reset flag (no user settings) + if (self.spawnflags & MON_SHUB_UPSIDE) self.flags = self.flags | FL_FLY; + else self.flags = self.flags | FL_ONGROUND; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + self.yaw_speed = 0; // No turning speed + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.pain_longanim = FALSE; // No axe advantage + self.takedamage = DAMAGE_AIM; // Can receive damage + self.pain_flinch = 1; // Pain is a start trigger + + self.movespeed = 1; // Shub does not move! + self.noinfighting = TRUE; // No infighting + self.gibhealth = -1000; // Special death sequence + self.pain_finished = self.attack_finished = 0; + + Resist_CheckRange(self); // Double check values + Resist_Save(self); // Save for Later + // Allow for a damage trigger (spawnflag option only) + if (!(self.spawnflags & MON_SHUB_DMGTRIG)) + Resist_ChangeType(self, TRUE); + + // Setup boss waves and overall health + if (self.bosswave < 1) self.bosswavetotal = 5; + else self.bosswavetotal = self.bosswave; + + // Always start bosswave at 1 + self.bosswave = 1; + if (self.bosswaveqty < 1) self.bosswaveqty = 500; + self.max_health = self.bosswavetotal * self.bosswaveqty; + // Setup boss wave HP + trigger event + xxshub_WaveSetupHP(); + + // Restore all think functions + self.th_stand = xxshub_idle; + self.th_walk = xxshub_idle; + self.th_run = xxshub_idle; + self.th_melee = xxshub_attack1; + self.th_missile = xxshub_attack2; + self.th_pain = xxshub_pain; + self.th_die = xxshub_die; + + // Wait for trigger to start attacking + self.use = xxshub_wakeup; + self.th_stand(); +}; + +/*============================================================================ + QUAKED monster_shub (1 0 0) (-128 -128 -24) (128 128 512) +============================================================================*/ +void() monster_shub = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/oldone.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_SHUB1); // Large Homing Missile + precache_model (MODEL_PROJ_SHUB2); // Large blob of blood + + // Final explosionm and grenades for attack 2 + self.gib1mdl = MODEL_PROJ_SHUB2; + self.gib1frame = 9; + + self.idle_sound = "shub/idle1.wav"; + self.idle_sound2 = "shub/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Att1 : Homing missile + // Att2 : Grenade spam + precache_sound ("shub/attack1.wav"); + precache_sound ("shub/attack2.wav"); + precache_sound ("shub/bounce.wav"); + + self.pain_sound = "shub/pain1.wav"; + self.pain_sound2 = "shub/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("shub/death1.wav"); + precache_sound ("shub/explode_death.wav"); + + self.sight_sound = "shub/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + // Use to be 128 square, reduced size to help with + // radius/splash damage being more effective + self.bbmins = '-96 -96 -24'; // has own entity setup + self.bbmaxs = '96 96 192'; + self.bboxtype = BBOX_CUSTOM; // Custom BBox size + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + self.health = self.max_health = MEGADEATH; + self.pain_finished = LARGE_TIMER; + self.no_liquiddmg = TRUE; // no slime/lava damage + self.idlemoreoften = TRUE; // More frequent idle sounds + self.gibbed = FALSE; // Still in one piece + + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + self.takedamage = DAMAGE_NO; // Immune to damage + + // Attack 1 - Setup projectile speed (200 + 20*skill) + if (CheckZeroVector(self.pos1)) self.pos1 = '200 20 0'; + // Attack 1 - Setup projectile damage (Base + Random, Splash) + if (CheckZeroVector(self.pos2)) self.pos2 = '0 0 40'; + // Attack 2 - Setup projectile speed, splash damage + if (CheckZeroVector(self.pos3)) self.pos3 = '300 500 40'; + + // Attack 1 - Spawn location (offset from origin) + if (CheckZeroVector(self.dest1)) self.dest1 = '0 0 128'; + // Attack 2 - Spawn location (offset from origin) + if (CheckZeroVector(self.dest2)) self.dest2 = '0 0 128'; + + if (self.spawnflags & MON_SHUB_UPSIDE) { + self.bbmins = '-96 -96 -192'; // up side down version + self.bbmaxs = '96 96 24'; + } + + self.classtype = CT_MONXXSHUB; + self.classgroup = CG_BOSS; + self.style = 0; + if (self.deathstring == "") self.deathstring = " became one with Shub-Niggurath\n"; + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[SHUB]\b Missing trigger name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Does not go through monster spawn functions + total_monsters = total_monsters + 1; + + // Default is no spawn delay, wait for trigger + if (!(self.spawnflags & MON_SPAWN_DELAY)) { + self.nextthink = time + 0.1 + random()*0.4; + self.think = xxshub_start; + } + else self.use = xxshub_start; +}; + +/*============================================================================ + QUAKED monster_shubupsd (1 0 0) (-128 -128 -24) (128 128 512) +============================================================================*/ +void() monster_shubupsd = +{ + if (deathmatch) { remove(self); return; } + + // Attack 2 - Setup projectile speed, splash damage + if (CheckZeroVector(self.pos3)) self.pos3 = '600 0 40'; + self.angles_x = 180; + self.angles_y = anglemod(self.angles_y + 180); + self.spawnflags = self.spawnflags | MON_SHUB_UPSIDE; + if (self.deathstring == "") self.deathstring = " became one with Shub-Niggurath in the Upside-Down\n"; + monster_shub(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_centroid.qc b/QC_other/QC_keep/mon_centroid.qc new file mode 100644 index 00000000..8ba816d6 --- /dev/null +++ b/QC_other/QC_keep/mon_centroid.qc @@ -0,0 +1,489 @@ +float () ScourgeCheckAttack = { + local vector spot1; + local vector spot2; + local entity targ; + local float chance; + + targ = self.enemy; + spot1 = (self.origin + self.view_ofs); + spot2 = (targ.origin + targ.view_ofs); + if ( (vlen ((spot1 - spot2)) <= 100.000) ) { + if ( CanDamage (self.enemy,self) ) { + self.attack_state = AS_MELEE; + return ( TRUE ); + } + } + if ( (time < self.attack_finished) ) + return ( FALSE ); + + if ( !enemy_vis ) + return ( FALSE ); + + chance = (spot2_z - spot1_z); + if ( (chance > 64) ) { + return ( FALSE ); + } else { + if ( (chance < -200.000) ) + return ( FALSE ); + } + if ( (vlen ((spot1 - spot2)) > 1000.000) ) + return ( FALSE ); + + if ( (vlen ((spot1 - spot2)) < 150) ) + return ( FALSE ); + + traceline (spot1,spot2,FALSE,self); + if ( (trace_inopen && trace_inwater) ) + return ( FALSE ); + + if ( (trace_ent != targ) ) + return ( FALSE ); + + self.attack_state = AS_MISSILE; + SUB_AttackFinished ((2 + (2 * random ()))); + return ( TRUE ); +}; + +void (float ox) SCOURGE_FireSpikes = { + local vector src; + local vector vec; + + ai_face (); + makevectors (self.angles); + src = (((self.origin - '0.000 0.000 19.000') + (v_right * ox)) + (v_forward * 14.000)); + vec = (self.enemy.origin - src); + vec = normalize (vec); + sound (self,CHAN_WEAPON,"weapons/rocket1i.wav",TRUE,ATTN_NORM); + launch_projectile(src,vec,CT_PROJ_NG,600); + self.attack_finished = (time + 0.200); +}; + +void () Attack_With_Tail = { + local float ldmg; + local vector delta; + + ai_face (); + delta = (self.enemy.origin - self.origin); + if ( (vlen (delta) > 100.000) ) + return ; + + if ( !CanDamage (self.enemy,self) ) + return ; + + ldmg = (((random () + random ()) + random ()) * 15.000); + T_Damage (self.enemy,self,self,ldmg,DAMARMOR); + sound (self,CHAN_WEAPON,"shambler/smack.wav",TRUE,ATTN_NORM); + SpawnMeatSpray (self.enemy,self,50); +}; + +void () ScourgeTriggerThink; +void () ScourgeTriggerTouch; + +void () scourge_think = { + local entity trig; + + if ( !self.state ) { + trig = spawn (); + trig.angles = VEC_ORIGIN; + trig.solid = SOLID_TRIGGER; + setsize (trig,'-64.000 -64.000 -24.000','64.000 64.000 64.000'); + trig.takedamage = DAMAGE_NO; + trig.movetype = MOVETYPE_NONE; + trig.modelindex = FALSE; + trig.model = ""; + trig.lastvictim = self; + trig.think = ScourgeTriggerThink; + trig.touch = ScourgeTriggerTouch; + trig.nextthink = ((time + 0.100) + random ()); + setorigin (trig,self.origin); + self.lastvictim = trig; + self.state = TRUE; + } + if ( ((self.spawnsilent == FALSE) && (self.spawnmulti == TRUE)) ) { + sound (self,CHAN_BODY,"misc/null.wav",TRUE,ATTN_IDLE); + } else { + if ( ((self.spawnsilent == TRUE) && (self.spawnmulti == FALSE)) ) + sound (self,CHAN_BODY,"scourge/walk.wav",TRUE,ATTN_IDLE); + } + self.spawnmulti = self.spawnsilent; +}; + +void (float dist) ai_right = { walkmove ((self.angles_y + 90.000),dist); }; +void (float dist) ai_left = { walkmove ((self.angles_y + 270.000),dist); }; +void () ai_turn_in_place = { + local float delta; + + self.nextthink = (time + 0.100); + enemy_yaw = vectoyaw ((self.enemy.origin - self.origin)); + delta = fabs ((self.angles_y - enemy_yaw)); + if ( (delta > MIN_ANGLE_DELTA) ) { + self.ideal_yaw = enemy_yaw; + ChangeYaw (); + } else { + self.think = self.th_run; + } +}; + +void () scourge_stand1 = [ 0.000, scourge_stand2 ] { ai_stand (); scourge_think (); self.spawnsilent = FALSE;}; +void () scourge_stand2 = [ 1.000, scourge_stand3 ] { ai_stand (); scourge_think (); }; +void () scourge_stand3 = [ 2.000, scourge_stand4 ] { ai_stand (); scourge_think ();}; +void () scourge_stand4 = [ 3.000, scourge_stand5 ] { ai_stand (); scourge_think (); }; +void () scourge_stand5 = [ 4.000, scourge_stand6 ] { ai_stand (); scourge_think (); }; +void () scourge_stand6 = [ 5.000, scourge_stand7 ] { ai_stand (); scourge_think (); }; +void () scourge_stand7 = [ 6.000, scourge_stand8 ] { ai_stand (); scourge_think (); }; +void () scourge_stand8 = [ 7.000, scourge_stand9 ] { ai_stand (); scourge_think (); }; +void () scourge_stand9 = [ 8.000, scourge_stand10 ] { ai_stand (); scourge_think (); }; +void () scourge_stand10 = [ 9.000, scourge_stand11 ] { ai_stand (); scourge_think (); }; +void () scourge_stand11 = [ 10.000, scourge_stand12 ] { ai_stand (); scourge_think (); }; +void () scourge_stand12 = [ 11.000, scourge_stand1 ] { ai_stand (); scourge_think (); }; + +void () scourge_walk1 = [ 12.000, scourge_walk2 ] { + if ( (random () < 0.100) ) + sound (self,CHAN_VOICE,"scourge/idle.wav",TRUE,ATTN_IDLE); + + self.spawnsilent = TRUE; + scourge_think (); + ai_walk (8); +}; +void () scourge_walk2 = [ 13.000, scourge_walk3 ] { ai_walk (8); }; +void () scourge_walk3 = [ 14.000, scourge_walk4 ] { ai_walk (8); }; +void () scourge_walk4 = [ 15.000, scourge_walk5 ] { ai_walk (8);}; +void () scourge_walk5 = [ 16.000, scourge_walk6 ] { ai_walk (8);}; +void () scourge_walk6 = [ 17.000, scourge_walk1 ] { ai_walk (8); }; + +void () scourge_run1 = [ 12.000, scourge_run2 ] { + if ( (random () < 0.100) ) + sound (self,CHAN_VOICE,"scourge/idle.wav",TRUE,ATTN_IDLE); + self.spawnsilent = TRUE; + scourge_think (); + ai_run (18.000); }; +void () scourge_run2 = [ 13.000, scourge_run3 ] { scourge_think (); ai_run (14.000); }; +void () scourge_run3 = [ 14.000, scourge_run4 ] { ai_run (14.000); }; +void () scourge_run4 = [ 15.000, scourge_run5 ] { ai_run (14.000); }; +void () scourge_run5 = [ 16.000, scourge_run6 ] { ai_run (14.000); }; +void () scourge_run6 = [ 17.000, scourge_run1 ] { ai_run (14.000); }; + +void () scourge_strafeleft1 = [ 12.000, scourge_strafeleft2 ] { self.spawnsilent = TRUE; scourge_think (); ai_left (20.000); }; +void () scourge_strafeleft2 = [ 13.000, scourge_strafeleft3 ] { ai_left (20.000); }; +void () scourge_strafeleft3 = [ 14.000, scourge_strafeleft4 ] { ai_left (20.000); }; +void () scourge_strafeleft4 = [ 15.000, scourge_strafeleft5 ] { ai_left (14.000); }; +void () scourge_strafeleft5 = [ 16.000, scourge_strafeleft6 ] { ai_left (14.000); }; +void () scourge_strafeleft6 = [ 17.000, scourge_run1 ] { ai_left (14.000); }; + +void () scourge_straferight1 = [ 12.000, scourge_straferight2 ] { self.spawnsilent = TRUE; scourge_think (); ai_right (20.000); }; +void () scourge_straferight2 = [ 13.000, scourge_straferight3 ] { ai_right (20.000); }; +void () scourge_straferight3 = [ 14.000, scourge_straferight4 ] { ai_right (20.000); }; +void () scourge_straferight4 = [ 15.000, scourge_straferight5 ] { ai_right (14.000); }; +void () scourge_straferight5 = [ 16.000, scourge_straferight6 ] { ai_right (14.000); }; +void () scourge_straferight6 = [ 17.000, scourge_run1 ] { ai_right (14.000); }; + +void () scourge_turn1 = [ 12.000, scourge_turn2 ] { self.spawnsilent = TRUE; scourge_think (); ai_turn_in_place (); }; +void () scourge_turn2 = [ 13.000, scourge_turn3 ] { ai_turn_in_place (); }; +void () scourge_turn3 = [ 14.000, scourge_turn4 ] { ai_turn_in_place (); }; +void () scourge_turn4 = [ 15.000, scourge_turn5 ] { ai_turn_in_place (); }; + +void () scourge_turn5 = [ 16.000, scourge_turn6 ] { + + ai_turn_in_place (); + +}; + +void () scourge_turn6 = [ 17.000, scourge_turn1 ] { + + ai_turn_in_place (); + +}; + +void () scourge_atk1 = [ 18.000, scourge_atk2 ] { + + self.spawnsilent = FALSE; + scourge_think (); + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (40.000); + +}; + +void () scourge_atk2 = [ 19.000, scourge_atk3 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (-56.000); + +}; + +void () scourge_atk3 = [ 18.000, scourge_atk4 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (-40.000); + +}; + +void () scourge_atk4 = [ 19.000, scourge_atk5 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (56.000); + +}; + +void () scourge_atk5 = [ 18.000, scourge_atk6 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (40.000); + +}; + +void () scourge_atk6 = [ 19.000, scourge_atk7 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (-56.000); + +}; + +void () scourge_atk7 = [ 18.000, scourge_atk8 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (-40.000); + +}; + +void () scourge_atk8 = [ 19.000, scourge_run1 ] { + + self.effects = (self.effects | EF_MUZZLEFLASH); + SCOURGE_FireSpikes (56.000); + SUB_AttackFinished ((MOVETYPE_STEP * random ())); + +}; + +void () scourge_melee1 = [ 20.000, scourge_melee2 ] { + + self.spawnsilent = FALSE; + scourge_think (); + ai_charge (MOVETYPE_WALK); + +}; + +void () scourge_melee2 = [ 21.000, scourge_melee3 ] { + + ai_charge (MOVETYPE_WALK); + +}; + +void () scourge_melee3 = [ 22.000, scourge_melee4 ] { + + ai_charge (FL_SWIM); + +}; + +void () scourge_melee4 = [ 23.000, scourge_melee5 ] { + + ai_charge (FL_SWIM); + +}; + +void () scourge_melee5 = [ 24.000, scourge_melee6 ] { + + sound (self,CHAN_WEAPON,"scourge/tailswng.wav",TRUE,ATTN_NORM); + ai_charge (MOVETYPE_WALK); + +}; + +void () scourge_melee6 = [ 25.000, scourge_melee7 ] { + + ai_charge (TRUE); + +}; + +void () scourge_melee7 = [ 26.000, scourge_melee8 ] { + + Attack_With_Tail (); + +}; + +void () scourge_melee8 = [ 27.000, scourge_melee9 ] { + + ai_face (); + +}; + +void () scourge_melee9 = [ 28.000, scourge_melee10 ] { + + ai_face (); + +}; + +void () scourge_melee10 = [ 29.000, scourge_melee11 ] { + + ai_face (); + +}; + +void () scourge_melee11 = [ 30.000, scourge_run1 ] { + + ai_face (); + SUB_CheckRefire (scourge_melee1); + +}; + +void () scourge_pain1 = [ 31.000, scourge_pain2 ] { + + self.spawnsilent = FALSE; + scourge_think (); + +}; + +void () scourge_pain2 = [ 32.000, scourge_pain3 ] { + + +}; + +void () scourge_pain3 = [ 33.000, scourge_pain4 ] { + + +}; + +void () scourge_pain4 = [ 34.000, scourge_pain5 ] { + + +}; + +void () scourge_pain5 = [ 35.000, scourge_run1 ] { + + +}; + +void (entity inflictor, entity attacker, float damage) scourge_pain = { + if ( (self.pain_finished > time) ) + return ; + + sound (self,CHAN_VOICE,"scourge/pain.wav",TRUE,ATTN_NORM); + self.pain_finished = (time + FL_SWIM); + scourge_pain1 (); +}; + +void () scourge_die1 = [ 36.000, scourge_die2 ] { self.spawnsilent = FALSE; scourge_think (); }; +void () scourge_die2 = [ 37.000, scourge_die3 ] {}; +void () scourge_die3 = [ 38.000, scourge_die4 ] { self.solid = SOLID_NOT; }; +void () scourge_die4 = [ 39.000, scourge_die5 ] {}; +void () scourge_die5 = [ 40.000, scourge_die5 ] {}; + +void () scourge_die = { + remove (self.lastvictim); + self.spawnsilent = FALSE; + scourge_think (); + if ( (self.health < -35.000) ) { + sound (self,CHAN_VOICE,"player/udeath.wav",TRUE,ATTN_NORM); + ThrowHead (); + ThrowGib (1,1); + ThrowGib (2,1); + ThrowGib (3,1); + return ; + + } + sound (self,CHAN_VOICE,"scourge/pain2.wav",TRUE,ATTN_NORM); + scourge_die1 (); +}; + +void () scourge_melee = { scourge_melee1 (); SUB_AttackFinished ((FL_SWIM * random ())); }; + +void () ScourgeTriggerThink = { + local entity targ; + + if ( (self.lastvictim.health <= FALSE) ) { + remove (self); + return ; + } + targ = self.lastvictim; + makevectors (targ.angles); + setorigin (self,(targ.origin + (v_forward * 300.000))); + self.nextthink = (time + 0.100); +}; + +void () ScourgeTriggerTouch = { + local entity targ; + local entity tempent; + local vector dir; + + if ( (other.flags & (FL_MONSTER | FL_CLIENT)) ) + return ; + + if ( (other.movetype != MOVETYPE_FLYMISSILE) ) + return ; + + targ = self.lastvictim; + if ( (targ.health <= FALSE) ) { + remove (self); + return ; + } + dir = (targ.origin - other.origin); + dir = normalize (dir); + if ( ((dir * normalize (other.velocity)) < 0.800) ) + return ; + + if ( (time > self.duration) ) { + tempent = self; + self = targ; + if ( (random () < 0.500) ) { + scourge_strafeleft1 (); + } else { + scourge_straferight1 (); + } + self.duration = (time + 1.500); + } + self = tempent; +}; + +void () monster_scourge = { + if ( deathmatch ) { remove (self); return ; } + + self.mdl = "progs/hipnotic/mon_scor.mdl"; + precache_model2 ("progs/hipnotic/mon_scor.mdl"); + + self.headmdl = "progs/hipnotic/h_scourg.mdl"; + precache_model2 ("progs/hipnotic/h_scourg.mdl"); + + precache_model2 ("progs/hipnotic/laser.mdl"); + precache_model2 ("progs/ad171/s_light.mdl"); + precache_model2 ("progs/spike.mdl"); + precache_sound ("misc/null.wav"); + precache_sound ("scourge/idle.wav"); + precache_sound ("scourge/pain.wav"); + precache_sound ("scourge/pain2.wav"); + precache_sound ("scourge/sight.wav"); + precache_sound ("scourge/tailswng.wav"); + precache_sound ("scourge/walk.wav"); + precache_sound2 ("shambler/smack.wav"); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_FLAT; + setsize (self,'-32.000 -32.000 -24.000','32.000 32.000 22.000'); + if (self.health < 1) self.health = 300.000; + self.gibhealth = -20; + self.gibbed = FALSE; + self.pain_flinch = 50; + self.yaw_speed = 30; // Very fast turning (def=20) + self.steptype = FS_TYPELIGHT; + self.blockudeath = TRUE; // No humanoid death sound + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = scourge_stand1; + self.th_walk = scourge_walk1; + self.th_run = scourge_run1; + self.th_pain = scourge_pain; + self.th_die = scourge_die; + self.th_melee = scourge_melee; + self.th_missile = scourge_atk1; + self.yaw_speed = 60.000; + self.attack_state = AS_SLIDING; + self.state = FALSE; + + self.classtype = CT_MONSCORPION; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + if (self.deathstring == "") self.deathstring = " was stung by a Centroid\n"; + + monster_start (); +}; diff --git a/QC_other/QC_keep/mon_centurion.qc b/QC_other/QC_keep/mon_centurion.qc new file mode 100644 index 00000000..668bed70 --- /dev/null +++ b/QC_other/QC_keep/mon_centurion.qc @@ -0,0 +1,329 @@ +/*============================================================================= +CENTURION - Originally from Rubicon2 by John Fitzgibbons +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 + +void() centurionhover = +{ + if (self.waitmin < time) { + self.waitmin = time + 4 + random()*4; + sound(self, CHAN_ITEM, "enforcer/cent_hover.wav", 1, ATTN_IDLE); + } +}; + +//============================================================================ +void() cent_stand1 =[ $stand1, cent_stand2 ] { + centurionhover();monster_idle_sound();ai_stand();}; +void() cent_stand2 =[ $stand2, cent_stand3 ] {ai_stand();}; +void() cent_stand3 =[ $stand3, cent_stand4 ] {ai_stand();}; +void() cent_stand4 =[ $stand4, cent_stand5 ] {ai_stand();}; +void() cent_stand5 =[ $stand5, cent_stand6 ] {ai_stand();}; +void() cent_stand6 =[ $stand6, cent_stand7 ] {ai_stand();}; +void() cent_stand7 =[ $stand7, cent_stand8 ] {ai_stand();}; +void() cent_stand8 =[ $stand8, cent_stand1 ] {ai_stand();}; + +//============================================================================ +void() cent_walk1 =[ $stand1, cent_walk2 ] { + centurionhover();monster_idle_sound();ai_walk(4);}; +void() cent_walk2 =[ $stand2, cent_walk3 ] {ai_walk(4);}; +void() cent_walk3 =[ $stand3, cent_walk4 ] {ai_walk(4);}; +void() cent_walk4 =[ $stand4, cent_walk5 ] {ai_walk(4);}; +void() cent_walk5 =[ $stand5, cent_walk6 ] {ai_walk(4);}; +void() cent_walk6 =[ $stand6, cent_walk7 ] {ai_walk(4);}; +void() cent_walk7 =[ $stand7, cent_walk8 ] {ai_walk(4);}; +void() cent_walk8 =[ $stand8, cent_walk1 ] {ai_walk(4);}; + +//============================================================================ +void() cent_run1 =[ $stand1, cent_run2 ] { + centurionhover();monster_idle_sound(); + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(8);}; +void() cent_run2 =[ $stand2, cent_run3 ] {ai_run(8);}; +void() cent_run3 =[ $stand3, cent_run4 ] {ai_run(8);}; +void() cent_run4 =[ $stand4, cent_run5 ] {ai_run(8);}; +void() cent_run5 =[ $stand5, cent_run6 ] {ai_run(8);}; +void() cent_run6 =[ $stand6, cent_run7 ] {ai_run(8);}; +void() cent_run7 =[ $stand7, cent_run8 ] {ai_run(8);}; +void() cent_run8 =[ $stand8, cent_run1 ] {ai_run(8);}; + +//============================================================================ +void() cent_fire = +{ + local vector org, vec; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, SOUND_PLASMA_FIRE, 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + // Fire plasma projectile at players feet + vec = SUB_orgEnemyTarget() - '0 0 12'; + vec = normalize(vec - self.origin); + + launch_plasma(org, vec, CT_PROJ_PLASMA, SPEED_PLASMA); +}; + +//---------------------------------------------------------------------- +void() cent_atk1 =[ $attack1, cent_atk2 ] { + sound (self, CHAN_WEAPON, "enforcer/elim_pg_load.wav", 1, ATTN_NORM);}; +void() cent_atk2 =[ $attack2, cent_atk3 ] {ai_face();}; +void() cent_atk3 =[ $attack3, cent_atk4 ] {ai_face();}; +void() cent_atk4 =[ $attack4, cent_atk5 ] {ai_face();}; +void() cent_atk5 =[ $attack5, cent_atk6 ] {ai_face();}; +void() cent_atk6 =[ $attack6, cent_atk7 ] {ai_face(); + if (self.health > 0) cent_fire();}; +void() cent_atk7 =[ $attack7, cent_atk8 ] {}; +void() cent_atk8 =[ $attack8, cent_atk9 ] {}; +void() cent_atk9 =[ $attack5, cent_atk10 ] {ai_face();}; +void() cent_atk10 =[ $attack6, cent_atk11 ] {ai_face(); + if (self.health > 0) cent_fire();}; +void() cent_atk11 =[ $attack7, cent_atk12 ] {}; +void() cent_atk12 =[ $attack8, cent_atk13 ] {}; +void() cent_atk13 =[ $attack9, cent_atk14 ] {ai_face();}; +void() cent_atk14 =[ $attack10, cent_run1 ] {ai_face();SUB_CheckRefire (cent_atk1);}; + +//============================================================================ +void() cent_paina1 =[ $paina1, cent_paina2 ] {}; +void() cent_paina2 =[ $paina2, cent_paina3 ] {}; +void() cent_paina3 =[ $paina3, cent_paina4 ] {}; +void() cent_paina4 =[ $paina4, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void() cent_painb1 =[ $painb1, cent_painb2 ] {}; +void() cent_painb2 =[ $painb2, cent_painb3 ] {}; +void() cent_painb3 =[ $painb3, cent_painb4 ] {}; +void() cent_painb4 =[ $painb4, cent_painb5 ] {}; +void() cent_painb5 =[ $painb5, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void() cent_painc1 =[ $painc1, cent_painc2 ] {}; +void() cent_painc2 =[ $painc2, cent_painc3 ] {}; +void() cent_painc3 =[ $painc3, cent_painc4 ] {}; +void() cent_painc4 =[ $painc4, cent_painc5 ] {}; +void() cent_painc5 =[ $painc5, cent_painc6 ] {}; +void() cent_painc6 =[ $painc6, cent_painc7 ] {}; +void() cent_painc7 =[ $painc7, cent_painc8 ] {}; +void() cent_painc8 =[ $painc8, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void() cent_paind1 =[ $paind1, cent_paind2 ] {}; +void() cent_paind2 =[ $paind2, cent_paind3 ] {}; +void() cent_paind3 =[ $paind3, cent_paind4 ] {}; +void() cent_paind4 =[ $paind4, cent_paind5 ] {ai_painforward(2);}; +void() cent_paind5 =[ $paind5, cent_paind6 ] {ai_painforward(1);}; +void() cent_paind6 =[ $paind6, cent_paind7 ] {}; +void() cent_paind7 =[ $paind7, cent_paind8 ] {}; +void() cent_paind8 =[ $paind8, cent_paind9 ] {}; +void() cent_paind9 =[ $paind9, cent_paind10 ] {}; +void() cent_paind10=[ $paind10, cent_paind11 ] {}; +void() cent_paind11=[ $paind11, cent_paind12 ] {ai_painforward(1);}; +void() cent_paind12=[ $paind12, cent_paind13 ] {ai_painforward(1);}; +void() cent_paind13=[ $paind13, cent_paind14 ] {ai_painforward(1);}; +void() cent_paind14=[ $paind14, cent_paind15 ] {}; +void() cent_paind15=[ $paind15, cent_paind16 ] {}; +void() cent_paind16=[ $paind16, cent_paind17 ] {ai_pain(1);}; +void() cent_paind17=[ $paind17, cent_paind18 ] {ai_pain(1);}; +void() cent_paind18=[ $paind18, cent_paind19 ] {}; +void() cent_paind19=[ $paind19, cent_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) cent_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random (); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + // Not using long pain animation (need to be agile) + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (self.lip < 0.3) cent_paina1 (); + else if (self.lip < 0.6) cent_painb1 (); + else cent_painc1 (); + } + } +}; + +//============================================================================ +// Every death frame spawn some smoke and detect impact! +void() cent_crash = +{ + if (self.state) { + // Spawn projectile smoke trails or smoke sprites + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 150, 50, 150); + else { + self.oldorigin = self.origin + vecrand(0,32,TRUE); + SpawnExplosion(EXPLODE_BURST_SMOKE, self.oldorigin, ""); + } + // Once on ground, thud sound and no more smoke + if (self.flags & FL_ONGROUND) { + sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + self.state = FALSE; + } + } +}; + +//---------------------------------------------------------------------- +void() cent_die1 =[ $death1, cent_die2 ] {cent_crash();}; +void() cent_die2 =[ $death2, cent_die3 ] {monster_check_gib();cent_crash();}; +void() cent_die3 =[ $death3, cent_die4 ] {monster_check_gib(); +self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();cent_crash();}; +void() cent_die4 =[ $death4, cent_die5 ] {cent_crash();}; +void() cent_die5 =[ $death5, cent_die6 ] {cent_crash();}; +void() cent_die6 =[ $death6, cent_die7 ] {cent_crash();}; +void() cent_die7 =[ $death7, cent_die8 ] {cent_crash();}; +void() cent_die8 =[ $death8, cent_die9 ] {cent_crash();}; +void() cent_die9 =[ $death9, cent_die10 ] {cent_crash();}; +void() cent_die10 =[ $death10, cent_die11 ] {cent_crash();}; +void() cent_die11 =[ $death11, cent_die12 ] {cent_crash();}; +void() cent_die12 =[ $death12, cent_die13 ] {cent_crash();}; +void() cent_die13 =[ $death13, cent_die14 ] {monster_death_postcheck();cent_crash();}; +void() cent_die14 =[ $death14, cent_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() cent_fdie1 =[ $fdeath1, cent_fdie2 ] {cent_crash();}; +void() cent_fdie2 =[ $fdeath2, cent_fdie3 ] {monster_check_gib();cent_crash();}; +void() cent_fdie3 =[ $fdeath3, cent_fdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();cent_crash();}; +void() cent_fdie4 =[ $fdeath4, cent_fdie5 ] {cent_crash();}; +void() cent_fdie5 =[ $fdeath5, cent_fdie6 ] {cent_crash();}; +void() cent_fdie6 =[ $fdeath6, cent_fdie7 ] {cent_crash();}; +void() cent_fdie7 =[ $fdeath7, cent_fdie8 ] {cent_crash();}; +void() cent_fdie8 =[ $fdeath8, cent_fdie9 ] {cent_crash();}; +void() cent_fdie9 =[ $fdeath9, cent_fdie10 ] {cent_crash();}; +void() cent_fdie10 =[ $fdeath10, cent_fdie11 ] {monster_death_postcheck();cent_crash();}; +void() cent_fdie11 =[ $fdeath11, cent_fdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() cent_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Kill hoverboard sound + sound(self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_IDLE); + + // regular death + if (!self.gibbed) { + self.state = TRUE; + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + // Make sure Centurion falls to the ground (like wizards) + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + // Spawn a big sprite explosion + sound + SpawnExplosion(EXPLODE_BIG, self.origin, SOUND_REXP3); + if (random() > 0.5) cent_die1 (); + else cent_fdie1 (); + } +}; + +/*====================================================================== + QUAKED monster_centurion (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_centurion = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_centurion.mdl"; + self.headmdl = "progs/ad171/h_centurion.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_PLASMA); + + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/elim_pg_load.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + // Originally from rubicon2 (re-processed) + precache_sound ("enforcer/cent_hover.wav"); + precache_sound (GIB_SOUND_WOOD); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_PLASMAGRN); + } + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = -35; + self.gibbed = FALSE; + self.yaw_speed = 35; // Can turn really fast + self.pain_flinch = 60; // high pain tolerance + self.pain_longanim = FALSE; // Not using D pain, too slow + self.steptype = FS_FLYING; // Silent feet + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + if (!self.exactskin) self.randomskin = 6; + self.ammo_cells = rint(random()*3); + self.attack_offset = '28 8.5 24'; + if (self.deathstring == "") self.deathstring = " was vaporized by a Centurion\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = CenturionCheckAttack; + self.th_stand = cent_stand1; + self.th_walk = cent_walk1; + self.th_run = cent_run1; + self.th_pain = cent_pain; + self.th_die = cent_die; + self.th_missile = cent_atk1; + + self.classtype = CT_MONCENTURION; + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEFLY; + if (self.deathstring == "") self.deathstring = " was vaporized by a Centurion\n"; + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_cyber.qc b/QC_other/QC_keep/mon_cyber.qc new file mode 100644 index 00000000..6996ba27 --- /dev/null +++ b/QC_other/QC_keep/mon_cyber.qc @@ -0,0 +1,278 @@ +//============================================================================== +//CYBERDEMON +$origin 0 0 64 +$base base +$skin skin +$frame stand1 stand2 stand3 stand4 stand5 stand6 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// CyberDemonFireMissile +// Adapted for Drake. +void() CyberDemonFireMissile = { + local vector dir, org; + + if (!self.enemy) return; + if (self.health < 1) return; + + // check for enemy origin (based on sight test) + // if cannot see enemy fire at last known location + ai_trackenemy(); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "cyber/cybfire.wav", 1, ATTN_NORM); + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(self.attack_track - org); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_CYBER, 1000); + self.attack_finished = time + 0.8; +}; + +// STAND -- (PM: Originally had stand1 only. Use MF's unused frames. +void() cyber_stand1 =[ $stand1, cyber_stand2 ] {ai_stand();}; +void() cyber_stand2 =[ $stand2, cyber_stand3 ] {ai_stand();}; +void() cyber_stand3 =[ $stand3, cyber_stand4 ] {ai_stand();}; +void() cyber_stand4 =[ $stand4, cyber_stand5 ] {ai_stand();}; +void() cyber_stand5 =[ $stand5, cyber_stand6 ] {ai_stand();}; +void() cyber_stand6 =[ $stand6, cyber_stand7 ] {ai_stand();}; +void() cyber_stand7 =[ $stand5, cyber_stand8 ] {ai_stand();}; +void() cyber_stand8 =[ $stand4, cyber_stand9 ] {ai_stand();}; +void() cyber_stand9 =[ $stand3, cyber_stand10 ] {ai_stand();}; +void() cyber_stand10 =[ $stand2, cyber_stand1 ] {ai_stand();}; + +// WALK/RUN - - - - - - - - - - - - - - +void(float mad) cyber_anim = { + if ((self.walkframe < 0) || (self.walkframe >= 7)) + self.walkframe = 0; + + self.frame = $walk1 + self.walkframe; + self.walkframe = self.walkframe + 1; + + // Update 12/30/09: Change hoof timings to match Doom. + if (self.flags & FL_ONGROUND) + { // Footstep. + if ( self.frame == $walk1 ) + sound (self, 6, "cyber/cybhoof.wav", 1, ATTN_NORM); + else if ( self.frame == $walk6 ) + sound (self, 6, "cyber/cybmet.wav", 1, ATTN_NORM); + } + + // Update 7/24/09: Cyber moves 16 every 3 frames in Doom, and Doom ran + // at 35 fps. 16 * 35 / 3 = ~186.666... per second. Was 16, now 18. + if (mad) { + ai_run (18); + if (prandom() < 3) + sound (self, CHAN_VOICE, "cyber/cybidle.wav", 1, ATTN_IDLE); + } else + ai_walk (18); +}; + +void() cyber_reset = { + if (( self.frame < $walk1 ) || ( self.frame > $walk7 )) self.walkframe = 0; +}; + +void() cyber_walk2 =[ $walk1, cyber_walk2 ] {cyber_anim(FALSE);}; +void() cyber_walk1 = {cyber_reset(); cyber_walk2();}; + +void() cyber_run2 =[ $walk1, cyber_run2 ] {cyber_anim(TRUE);}; +void() cyber_run1 = {cyber_reset(); cyber_run2();}; + + +// ATTACK + +// The original cyber patch skipped attacks if enemy was invisible or dead. +// In the older Dooms, the cyberdemon always shoots three rockets (unless +// interrupted by pain or death), even if enemy is invisible or dead. + +// Update 12/30/09: Timing closer to Doom. +// Frames in Doom is 6/shoot/24/shoot/24/shoot/12. Doom runs at 35 fps. +void() cyber_missile1 =[ $shoot1, cyber_missile2 ] {ai_face(); self.shots_left = 3;}; +void() cyber_missile2 =[ $shoot3, cyber_missile3 ] {ai_face();}; +void() cyber_missile3 =[ $shoot4, cyber_missile4 ] {ai_face(); + CyberDemonFireMissile(); + self.shots_left = self.shots_left - 1; +}; +void() cyber_missile4 =[ $shoot4, cyber_missile5 ] {ai_face();}; +void() cyber_missile5 =[ $shoot5, cyber_missile6 ] {ai_face();}; +void() cyber_missile6 =[ $shoot6, cyber_missile7 ] { if (self.shots_left < 1) {self.frame = $shoot1; self.think = cyber_run1;} ai_face(); }; +void() cyber_missile7 =[ $shoot7, cyber_missile8 ] {ai_face();}; +void() cyber_missile8 =[ $shoot8, cyber_missile2 ] {ai_face();}; + + // PAIN + // Pain duration was 10/35 in Doom2. 10/35 = 0.285714... +void() cyber_pain1 =[ $shoot3, cyber_pain2 ] {self.nextthink = time + 0.1857;}; // Could be T+0.2. +void() cyber_pain2 =[ $shoot1, cyber_run1 ] {}; + +void(entity inflictor, entity attacker, float damage) cyber_pain = { + // Monsters in Doom are allowed to attack anytime after taking damage. + self.attack_finished = 0; // We're awake now! (reactiontime = 0) + + // Don't make multiple pain sounds right after each other. + // PM: However, that was the case in Doom, so make sure the time is minimal. + if (self.pain_finished > time) return; + + // In Doom, the cyberdemon did show pain. However, the chance of that + // happening was 20/255 per attack. In addition, the stun/interruption + // lasted a little over a fourth of a second. + + // To keep Mr. C. faithful to his incarnation in Doom, the Nightmare + // no pain rules of Drake (which mirrors Quake2's) are not used here. + if (prandom() < 20) { + sound (self, CHAN_VOICE, "cyber/cybpain.wav", 1, ATTN_NORM); + self.pain_finished = time + 0.1; // Just one frame. + self.ryuflags = self.ryuflags | RYU_JUSTHIT; + cyber_pain1(); + } +}; + +// DEATH +// Modified SpawnExplosion to use Drake's Tent functions. +// Also, use Rogue's TE_EXPLOSION2 effect for fewer particles per explosion. +//void(vector p) SpawnExplosion = {Rocket_Explosion2 (p, 96, 16);}; + +void() cyber_die1 =[ $walk1, cyber_die2 ] { + // In Doom, the cyderdemon death cry was heard everywhere at full volume. + sound (self, 7, "cyber/cybdie.wav", 1, ATTN_NONE); + ai_back(3); +}; +void() cyber_die2 =[ $walk2, cyber_die3 ] {ai_back(3);}; +void() cyber_die3 =[ $walk3, cyber_die4 ] {ai_back(3);}; +void() cyber_die4 =[ $walk4, cyber_die5 ] {ai_back(3);}; +void() cyber_die5 =[ $walk5, cyber_die6 ] {ai_back(3);}; +void() cyber_die6 =[ $walk6, cyber_die7 ] {ai_back(3);}; +void() cyber_die7 =[ $walk7, cyber_die8 ] {ai_back(3);}; +void() cyber_die8 =[ $walk1, cyber_die9 ] {ai_back(3); + sound (self, 5, "cyber/servo.wav", 1, ATTN_NORM); +}; +void() cyber_die9 =[ $shoot1, cyber_die10 ] +{ ai_back(3); + SpawnExplosion (EXPLODE_MED,self.origin + '0 20 60',"weapons/r_exp3a.wav"); +}; +void() cyber_die10 =[ $shoot2, cyber_die11 ] {ai_back(3);}; +void() cyber_die11 =[ $shoot2, cyber_die12 ] { ai_back(3); SpawnExplosion(EXPLODE_MED,self.origin + '0 -20 -40',"weapons/r_exp3a.wav"); }; +void() cyber_die12 =[ $shoot3, cyber_die13 ] { sound (self, CHAN_VOICE, "cyber/cybdie.wav", 1, ATTN_NORM); ai_back(3); }; +void() cyber_die13 =[ $shoot3, cyber_die14 ] { + SpawnExplosion(EXPLODE_MED,self.origin + '-20 0 20',"weapons/r_exp3a.wav"); + SpawnExplosion(EXPLODE_MED,self.origin + '20 0 20',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 -20 20',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 20 20',""); + ai_back(3); +}; +void() cyber_die14 =[ $shoot3, cyber_die15 ] {ai_back(3);}; +void() cyber_die15 =[ $shoot2, cyber_die16 ] { + SpawnExplosion(EXPLODE_MED,self.origin + '-20 0 40',""); + SpawnExplosion(EXPLODE_MED,self.origin + '20 0 40',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 -20 40',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 20 40',""); + ai_back(2); +}; +void() cyber_die16 =[ $shoot2, cyber_die17 ] { ai_back(3); }; +void() cyber_die17 =[ $shoot3, cyber_die18 ] { ai_back(1); + SpawnExplosion(EXPLODE_MED,self.origin + '-10 0 70',""); + SpawnExplosion(EXPLODE_MED,self.origin + '10 0 70',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 -10 70',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 10 70',""); +}; +void() cyber_die18 =[ $shoot3, cyber_die18 ] { + self.solid = SOLID_NOT; + // Update 1/4/10: Add some explosive eye candy. + newmis = spawn(); + setsize (newmis, '0 0 0', '0 0 0'); + setorigin (newmis, self.origin + '0 0 24'); + SUB_Think (newmis, BecomeTheBigFire); + SUB_Think (newmis, FlameWave); + Quake_Self (300, 0, self.origin, 0, 0.5); + SpawnExplosion(EXPLODE_MED,self.origin + '-10 0 40',"weapons/r_exp3a.wav"); + SpawnExplosion(EXPLODE_MED,self.origin + '10 0 40',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 -10 40',""); + SpawnExplosion(EXPLODE_MED,self.origin + '0 10 40',""); + sound (self, 5, "cyber/boom.wav", 1, ATTN_NORM); + ThrowHead(); + ThrowGib (13,1); + ThrowGib (12,5); + ThrowGib (11,1); + // Stop thinking and hide entity (prevent wraith_death15 loop) + self.nextthink = LARGE_TIMER; + self.think = SUB_Null; + entity_hide(self); +}; + +//============ +// --> QUAKED monster_cyberdemon (1 0 0) (-32 -32 -24) (32 32 64) Ambush +//============ +void() monster_cyberdemon = { + if (deathmatch) { remove(self); return; } + + precache_model ("progs/drake/cyber.mdl"); + precache_model ("progs/drake/h_cyber.mdl"); + precache_model ("progs/drake/leg_gib.mdl"); + precache_model ("progs/missile.mdl"); + precache_model ("progs/drake/s_expbig.spr"); + precache_model ("progs/drake/s_wave.spr"); + precache_model ("progs/gib1.mdl"); + precache_model ("progs/gib3.mdl"); + precache_sound ("soldier/rocket_hit.wav"); + precache_sound ("cyber/cybsee.wav"); + precache_sound ("cyber/cybdie.wav"); + precache_sound ("cyber/cybhoof.wav"); + precache_sound ("cyber/cybpain.wav"); + precache_sound ("cyber/cybmet.wav"); + precache_sound ("cyber/cybfire.wav"); + precache_sound ("cyber/cybidle.wav"); + precache_sound ("cyber/boom.wav"); + precache_sound ("cyber/servo.wav"); + + self.headmdl = "progs/drake/h_cyber.mdl"; + self.gib1mdl = "progs/gib1.mdl"; + self.gib2mdl = "progs/gib3.mdl"; + self.gib3mdl = "progs/drake/leg_gib.mdl"; + + // Note: In Doom, cyberdemon had width 40 and height 110. + // Shambler hullbox is width 32 and height 88. + + self.mdl = "progs/drake/cyber.mdl"; + if (self.bboxtype < 1) self.bboxtype = BBOX_CYBER; + if (self.health < 1) self.health = 4000; // Health in classic Doom (and Doom3 for that matter) is 4000. + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.mass = 0; // Was MASS_SUPER. Now set to immovable. + self.blockudeath = TRUE; // no humanoid death sound + self.th_stand = cyber_stand1; + self.th_walk = cyber_walk1; + self.th_run = cyber_run1; + self.th_die = cyber_die1; + // Update 12/30/2009: Removed melee now that Doom style movement is in. + self.th_missile = cyber_missile1; + self.th_pain = cyber_pain; + self.sight_sound = "cyber/cybsee.wav"; + //self.th_checkattack = DoomCheckAttack; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.th_updmissile = army_rocket_think; // Update flying rocket + + // Immune to all splash damage as in Doom. + // Also, immune to burning because his model is too big (i.e., looks bad). + // Has boss flag because its Heretic counterpart, the Maulotaur, has it. + //self.xfl = XFL_FIREANGEL | XFL_NO_BURN | XFL_BOSS; + + // PM: I don't think Doom has yaw speeds, and monsters can turn 180 degrees at any given moment. + self.yaw_speed = 60; // Fast, but not instant turning. + self.attack_offset = '31 -20 36'; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.classtype = CT_MONCYBERDEMON; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " dances the cyberboogie with a Cyberdemon\n"; + } else { + if (self.deathstring == "") self.deathstring = " was splattered by a Cyberdemon\n"; + } + + monster_start (); +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/mon_dchampion.qc b/QC_other/QC_keep/mon_dchampion.qc new file mode 100644 index 00000000..58b96894 --- /dev/null +++ b/QC_other/QC_keep/mon_dchampion.qc @@ -0,0 +1,104 @@ +/*============================================================================== +KNIGHT +==============================================================================*/ +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +// 000-008 +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +// 009-028 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +// 029-036 +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// 037-041 +$frame pain1 pain2 pain3 pain4 pain5 + +// 042-053 +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// 054-062 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +// 063-078 +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +// 079-092 +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +// 093-105 +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// 106-111 +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// 112-121 +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +// 122-132 +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +// 133-154 +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +// 155-165 +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +//---------------------------------------------------------------------- +// ben - 08/04/03 - a champion knight always strides into battle - never runs. +void() hknight_stride1 =[ $walk1, hknight_stride2 ] {monster_idle_sound();ai_run(2);}; +void() hknight_stride2 =[ $walk2, hknight_stride3 ] {ai_run(5);}; +void() hknight_stride3 =[ $walk3, hknight_stride4 ] {ai_run(5);}; +void() hknight_stride4 =[ $walk4, hknight_stride5 ] {ai_run(4);}; +void() hknight_stride5 =[ $walk5, hknight_stride6 ] {ai_run(4);}; +void() hknight_stride6 =[ $walk6, hknight_stride7 ] {ai_run(2);}; +void() hknight_stride7 =[ $walk7, hknight_stride8 ] {ai_run(2);}; +void() hknight_stride8 =[ $walk8, hknight_stride9 ] {ai_run(3);}; +void() hknight_stride9 =[ $walk9, hknight_stride10 ] {ai_run(3);}; +void() hknight_stride10 =[ $walk10, hknight_stride11 ] {ai_run(4);}; +void() hknight_stride11 =[ $walk11, hknight_stride12 ] {ai_run(3);}; +void() hknight_stride12 =[ $walk12, hknight_stride13 ] {ai_run(4);}; +void() hknight_stride13 =[ $walk13, hknight_stride14 ] {ai_run(6);}; +void() hknight_stride14 =[ $walk14, hknight_stride15 ] {ai_run(2);}; +void() hknight_stride15 =[ $walk15, hknight_stride16 ] {ai_run(2);}; +void() hknight_stride16 =[ $walk16, hknight_stride17 ] {ai_run(4);}; +void() hknight_stride17 =[ $walk17, hknight_stride18 ] {ai_run(3);}; +void() hknight_stride18 =[ $walk18, hknight_stride19 ] {ai_run(3);}; +void() hknight_stride19 =[ $walk19, hknight_stride20 ] {ai_run(3);}; +void() hknight_stride20 =[ $walk20, hknight_stride1 ] {ai_run(2);}; + +void() hknight_champion_magic = { +// a champion has a choice of two missile attacks - a faster version of the standard attack, +// and a vore-style homing missile. eventually he will be able to teleport. + + local float chance; + + chance = random(); + + if (chance < 0.6) + hknight_magicc1(); + + else + hknight_magicb1(); +}; + +void() monster_hell_knight_champion { +if (self.deathstring == "") self.deathstring = " was conquered by a Champion Death Knight\n"; +monster_hell_knight(); +} \ No newline at end of file diff --git a/QC_other/QC_keep/mon_dcrossbow.qc b/QC_other/QC_keep/mon_dcrossbow.qc new file mode 100644 index 00000000..a023e599 --- /dev/null +++ b/QC_other/QC_keep/mon_dcrossbow.qc @@ -0,0 +1,731 @@ +/*============================================================================== +CROSSBOW KNIGHT (low health, good range attack) +==============================================================================*/ +$cd id1/models/dcrossbow +$origin 0 0 24 +$base base +$skin skin + +// (001 - 010) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 + +// (011 - 032) Stand idle - Look left and right checking for the player +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 standA13 standA14 standA15 standA16 +$frame standA17 standA18 standA19 standA20 standA21 standA22 + +// (033 - 052) Stand idle - lift crossbow up and look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 + +// (053 - 082) Stand idle - check out crossbow up close +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 standD21 standD22 standD23 standD24 +$frame standD25 standD26 standD27 standD28 standD29 standD30 + +// (083 - 103) Stand idle - Lower crossbow and scratch back +$frame standE1 standE2 standE3 standE4 standE5 standE6 standE7 standE8 +$frame standE9 standE10 standE11 standE12 standE13 standE14 standE15 standE16 +$frame standE17 standE18 standE19 standE20 standE21 + +// (104 - 114) Stand idle - Dust off the crossbow +$frame standF1 standF2 standF3 standF4 standF5 standF6 standF7 standF8 +$frame standF9 standF10 standF11 + +// (115 - 128) Default walk - strong walk with crossbow infront +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (129 - 134) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (135 - 146) Slice (stationary one hand slashing attack) (file=SWING) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 + +// (147 - 161) Smash (chop overhead to ground) (file=CHOP) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (162 - 168) Turret ready (brings crossbow up to shoulder height) +$frame tready1 tready2 tready3 tready4 tready5 tready6 tready7 + +// (169 - 174) Turret hold (keeps crossbow up high) +$frame thold1 thold2 thold3 thold4 thold5 thold6 + +// (175 - 193) Turret fire (fires crossbow and reload) (19 frames now) +// Removed - 4,6,8,10, 17,19,21,23, 25,27,29,31 +$frame tfire1 tfire2 tfire3 tfire5 tfire7 +$frame tfire9 tfire11 tfire12 tfire13 tfire14 tfire15 tfire16 +$frame tfire18 tfire20 tfire22 tfire24 +$frame tfire26 tfire28 tfire30 + +// (194 - 201) Turret stop (lower crossbow to relaxed position) +$frame tstop1 tstop2 tstop3 tstop4 tstop5 tstop6 tstop7 tstop8 + +// (202 - 209) Turret slide (strafe side to side movement, crossbow up high) +$frame tslide1 tslide2 tslide3 tslide4 tslide5 tslide6 tslide7 tslide8 + +// Pain animations A = Slow (210 - 214), D = Stagger (215 - 225) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (226 - 236) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 + +// (237 - 256) Death backwards with cool crossbow wobble +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 deathb15 deathb16 +$frame deathb17 deathb18 deathb19 deathb20 + +void() dcrossbow_hold1; +void() dcrossbow_slide1; +void() dcrossbow_checkmelee; +void() dcrossbow_crossbow_sound; +float CROSS_DOWN = 1; +float CROSS_UP = 2; +float CROSS_TIMEOUT = 1; + +//=========================================================================== +void() dcrossbow_standA1 =[ $standA1, dcrossbow_standA2 ] {ai_stand();}; +void() dcrossbow_standA2 =[ $standA2, dcrossbow_standA3 ] {ai_stand();}; +void() dcrossbow_standA3 =[ $standA3, dcrossbow_standA4 ] {ai_stand();}; +void() dcrossbow_standA4 =[ $standA4, dcrossbow_standA5 ] {ai_stand();}; +void() dcrossbow_standA5 =[ $standA5, dcrossbow_standA6 ] {ai_stand();}; +void() dcrossbow_standA6 =[ $standA6, dcrossbow_standA7 ] {ai_stand();}; +void() dcrossbow_standA7 =[ $standA7, dcrossbow_standA8 ] {ai_stand();}; +void() dcrossbow_standA8 =[ $standA8, dcrossbow_standA9 ] {ai_stand();}; +void() dcrossbow_standA9 =[ $standA9, dcrossbow_standA10 ] {ai_stand();}; +void() dcrossbow_standA10 =[ $standA10, dcrossbow_standA11 ] {ai_stand();}; +void() dcrossbow_standA11 =[ $standA11, dcrossbow_standA12 ] {ai_stand();}; +void() dcrossbow_standA12 =[ $standA12, dcrossbow_standA13 ] {ai_stand();}; +void() dcrossbow_standA13 =[ $standA13, dcrossbow_standA14 ] {ai_stand();}; +void() dcrossbow_standA14 =[ $standA14, dcrossbow_standA15 ] {ai_stand();}; +void() dcrossbow_standA15 =[ $standA15, dcrossbow_standA16 ] {ai_stand();}; +void() dcrossbow_standA16 =[ $standA16, dcrossbow_standA17 ] {ai_stand();}; +void() dcrossbow_standA17 =[ $standA17, dcrossbow_standA18 ] {ai_stand();}; +void() dcrossbow_standA18 =[ $standA18, dcrossbow_standA19 ] {ai_stand();}; +void() dcrossbow_standA19 =[ $standA19, dcrossbow_standA20 ] {ai_stand();}; +void() dcrossbow_standA20 =[ $standA20, dcrossbow_standA21 ] {ai_stand();}; +void() dcrossbow_standA21 =[ $standA21, dcrossbow_standA22 ] {ai_stand();}; +void() dcrossbow_standA22 =[ $standA22, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standB1 =[ $standB1, dcrossbow_standB2 ] {ai_stand();}; +void() dcrossbow_standB2 =[ $standB2, dcrossbow_standB3 ] {ai_stand();}; +void() dcrossbow_standB3 =[ $standB3, dcrossbow_standB4 ] {ai_stand();}; +void() dcrossbow_standB4 =[ $standB4, dcrossbow_standB5 ] {ai_stand();}; +void() dcrossbow_standB5 =[ $standB5, dcrossbow_standB6 ] {ai_stand();}; +void() dcrossbow_standB6 =[ $standB6, dcrossbow_standB7 ] {ai_stand();}; +void() dcrossbow_standB7 =[ $standB7, dcrossbow_standB8 ] {ai_stand();}; +void() dcrossbow_standB8 =[ $standB8, dcrossbow_standB9 ] {ai_stand();}; +void() dcrossbow_standB9 =[ $standB9, dcrossbow_standB10 ] {ai_stand();}; +void() dcrossbow_standB10 =[ $standB10, dcrossbow_standB11 ] {ai_stand();}; +void() dcrossbow_standB11 =[ $standB11, dcrossbow_standB12 ] {ai_stand();}; +void() dcrossbow_standB12 =[ $standB12, dcrossbow_standB13 ] {ai_stand();}; +void() dcrossbow_standB13 =[ $standB13, dcrossbow_standB14 ] {ai_stand();}; +void() dcrossbow_standB14 =[ $standB14, dcrossbow_standB15 ] {ai_stand();}; +void() dcrossbow_standB15 =[ $standB15, dcrossbow_standB16 ] {ai_stand();}; +void() dcrossbow_standB16 =[ $standB16, dcrossbow_standB17 ] {ai_stand();}; +void() dcrossbow_standB17 =[ $standB17, dcrossbow_standB18 ] {ai_stand();}; +void() dcrossbow_standB18 =[ $standB18, dcrossbow_standB19 ] {ai_stand();}; +void() dcrossbow_standB19 =[ $standB19, dcrossbow_standB20 ] {ai_stand();}; +void() dcrossbow_standB20 =[ $standB20, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standC1 =[ $tready1, dcrossbow_standC2 ] {ai_stand();}; +void() dcrossbow_standC2 =[ $tready2, dcrossbow_standC3 ] {ai_stand();}; +void() dcrossbow_standC3 =[ $tready3, dcrossbow_standC4 ] {ai_stand();}; +void() dcrossbow_standC4 =[ $tready4, dcrossbow_standC5 ] {ai_stand();}; +void() dcrossbow_standC5 =[ $tready5, dcrossbow_standC6 ] {ai_stand();}; +void() dcrossbow_standC6 =[ $tready6, dcrossbow_standC7 ] {ai_stand();}; +void() dcrossbow_standC7 =[ $tready7, dcrossbow_standC8 ] {ai_stand();}; +void() dcrossbow_standC8 =[ $thold1, dcrossbow_standC9 ] {ai_stand();}; +void() dcrossbow_standC9 =[ $thold2, dcrossbow_standC10 ] {ai_stand();}; +void() dcrossbow_standC10 =[ $thold3, dcrossbow_standC11 ] {ai_stand();}; +void() dcrossbow_standC11 =[ $thold4, dcrossbow_standC12 ] {ai_stand();}; +void() dcrossbow_standC12 =[ $thold5, dcrossbow_standC13 ] {ai_stand();}; +void() dcrossbow_standC13 =[ $thold6, dcrossbow_standC14 ] {ai_stand();}; +void() dcrossbow_standC14 =[ $tstop1, dcrossbow_standC15 ] {ai_stand();}; +void() dcrossbow_standC15 =[ $tstop2, dcrossbow_standC16 ] {ai_stand();}; +void() dcrossbow_standC16 =[ $tstop3, dcrossbow_standC17 ] {ai_stand();}; +void() dcrossbow_standC17 =[ $tstop4, dcrossbow_standC18 ] {ai_stand();}; +void() dcrossbow_standC18 =[ $tstop5, dcrossbow_standC19 ] {ai_stand();}; +void() dcrossbow_standC19 =[ $tstop6, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standD1 =[ $standD1, dcrossbow_standD2 ] {ai_stand();}; +void() dcrossbow_standD2 =[ $standD2, dcrossbow_standD3 ] {ai_stand();}; +void() dcrossbow_standD3 =[ $standD3, dcrossbow_standD4 ] {ai_stand();}; +void() dcrossbow_standD4 =[ $standD4, dcrossbow_standD5 ] {ai_stand();}; +void() dcrossbow_standD5 =[ $standD5, dcrossbow_standD6 ] {ai_stand();}; +void() dcrossbow_standD6 =[ $standD6, dcrossbow_standD7 ] {ai_stand();}; +void() dcrossbow_standD7 =[ $standD7, dcrossbow_standD8 ] {ai_stand();}; +void() dcrossbow_standD8 =[ $standD8, dcrossbow_standD9 ] {ai_stand();}; +void() dcrossbow_standD9 =[ $standD9, dcrossbow_standD10 ] {ai_stand();}; +void() dcrossbow_standD10 =[ $standD10, dcrossbow_standD11 ] {ai_stand();}; +void() dcrossbow_standD11 =[ $standD11, dcrossbow_standD12 ] {ai_stand();}; +void() dcrossbow_standD12 =[ $standD12, dcrossbow_standD13 ] {ai_stand();}; +void() dcrossbow_standD13 =[ $standD13, dcrossbow_standD14 ] {ai_stand();}; +void() dcrossbow_standD14 =[ $standD14, dcrossbow_standD15 ] {ai_stand();}; +void() dcrossbow_standD15 =[ $standD15, dcrossbow_standD16 ] {ai_stand();}; +void() dcrossbow_standD16 =[ $standD16, dcrossbow_standD17 ] {ai_stand();}; +void() dcrossbow_standD17 =[ $standD17, dcrossbow_standD18 ] {ai_stand();}; +void() dcrossbow_standD18 =[ $standD18, dcrossbow_standD19 ] {ai_stand();}; +void() dcrossbow_standD19 =[ $standD19, dcrossbow_standD20 ] {ai_stand();}; +void() dcrossbow_standD20 =[ $standD20, dcrossbow_standD21 ] {ai_stand();}; +void() dcrossbow_standD21 =[ $standD21, dcrossbow_standD22 ] {ai_stand();}; +void() dcrossbow_standD22 =[ $standD22, dcrossbow_standD23 ] {ai_stand();}; +void() dcrossbow_standD23 =[ $standD23, dcrossbow_standD24 ] {ai_stand();}; +void() dcrossbow_standD24 =[ $standD24, dcrossbow_standD25 ] {ai_stand();}; +void() dcrossbow_standD25 =[ $standD25, dcrossbow_standD26 ] {ai_stand();}; +void() dcrossbow_standD26 =[ $standD26, dcrossbow_standD27 ] {ai_stand();}; +void() dcrossbow_standD27 =[ $standD27, dcrossbow_standD28 ] {ai_stand();}; +void() dcrossbow_standD28 =[ $standD28, dcrossbow_standD29 ] {ai_stand();}; +void() dcrossbow_standD29 =[ $standD29, dcrossbow_standD30 ] {ai_stand();}; +void() dcrossbow_standD30 =[ $standD30, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standE1 =[ $standE1, dcrossbow_standE2 ] {ai_stand();}; +void() dcrossbow_standE2 =[ $standE2, dcrossbow_standE3 ] {ai_stand();}; +void() dcrossbow_standE3 =[ $standE3, dcrossbow_standE4 ] {ai_stand();}; +void() dcrossbow_standE4 =[ $standE4, dcrossbow_standE5 ] {ai_stand();}; +void() dcrossbow_standE5 =[ $standE5, dcrossbow_standE6 ] {ai_stand();}; +void() dcrossbow_standE6 =[ $standE6, dcrossbow_standE7 ] {ai_stand();}; +void() dcrossbow_standE7 =[ $standE7, dcrossbow_standE8 ] {ai_stand();}; +void() dcrossbow_standE8 =[ $standE8, dcrossbow_standE9 ] {ai_stand();}; +void() dcrossbow_standE9 =[ $standE9, dcrossbow_standE10 ] {ai_stand();}; +void() dcrossbow_standE10 =[ $standE10, dcrossbow_standE11 ] {ai_stand();}; +void() dcrossbow_standE11 =[ $standE11, dcrossbow_standE12 ] {ai_stand();}; +void() dcrossbow_standE12 =[ $standE12, dcrossbow_standE13 ] {ai_stand();}; +void() dcrossbow_standE13 =[ $standE13, dcrossbow_standE14 ] {ai_stand();}; +void() dcrossbow_standE14 =[ $standE14, dcrossbow_standE15 ] {ai_stand();}; +void() dcrossbow_standE15 =[ $standE15, dcrossbow_standE16 ] {ai_stand();}; +void() dcrossbow_standE16 =[ $standE16, dcrossbow_standE17 ] {ai_stand();}; +void() dcrossbow_standE17 =[ $standE17, dcrossbow_standE18 ] {ai_stand();}; +void() dcrossbow_standE18 =[ $standE18, dcrossbow_standE19 ] {ai_stand();}; +void() dcrossbow_standE19 =[ $standE19, dcrossbow_standE20 ] {ai_stand();}; +void() dcrossbow_standE20 =[ $standE20, dcrossbow_standE21 ] {ai_stand();}; +void() dcrossbow_standE21 =[ $standE21, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_standF1 =[ $standF1, dcrossbow_standF2 ] {ai_stand();}; +void() dcrossbow_standF2 =[ $standF2, dcrossbow_standF3 ] {ai_stand();}; +void() dcrossbow_standF3 =[ $standF3, dcrossbow_standF4 ] {ai_stand();}; +void() dcrossbow_standF4 =[ $standF4, dcrossbow_standF5 ] {ai_stand();}; +void() dcrossbow_standF5 =[ $standF5, dcrossbow_standF6 ] {ai_stand();}; +void() dcrossbow_standF6 =[ $standF6, dcrossbow_standF7 ] {ai_stand();}; +void() dcrossbow_standF7 =[ $standF7, dcrossbow_standF8 ] {ai_stand();}; +void() dcrossbow_standF8 =[ $standF8, dcrossbow_standF9 ] {ai_stand();}; +void() dcrossbow_standF9 =[ $standF9, dcrossbow_standF10 ] {ai_stand();}; +void() dcrossbow_standF10 =[ $standF10, dcrossbow_standF11 ] {ai_stand();}; +void() dcrossbow_standF11 =[ $standF11, dcrossbow_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dcrossbow_stand1 =[ $stand1, dcrossbow_stand2 ] {monster_idle_sound();ai_stand();}; +void() dcrossbow_stand2 =[ $stand2, dcrossbow_stand3 ] {ai_stand();}; +void() dcrossbow_stand3 =[ $stand3, dcrossbow_stand4 ] {ai_stand();}; +void() dcrossbow_stand4 =[ $stand4, dcrossbow_stand5 ] {ai_stand();}; +void() dcrossbow_stand5 =[ $stand5, dcrossbow_stand6 ] {ai_stand();}; +void() dcrossbow_stand6 =[ $stand6, dcrossbow_stand7 ] {ai_stand();}; +void() dcrossbow_stand7 =[ $stand7, dcrossbow_stand8 ] {ai_stand();}; +void() dcrossbow_stand8 =[ $stand8, dcrossbow_stand9 ] {ai_stand();}; +void() dcrossbow_stand9 =[ $stand9, dcrossbow_stand10 ] {ai_stand();}; +void() dcrossbow_stand10 =[ $stand10, dcrossbow_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*6);} + self.lip = self.lefty; + if (self.lip < 1) self.think = dcrossbow_standE1; // Scratch back + else if (self.lip < 2) self.think = dcrossbow_standD1; // Look at weapon + else if (self.lip < 3) self.think = dcrossbow_standC1; // Ready, steady, hold! + else if (self.lip < 4) self.think = dcrossbow_standF1; // Dust off crossbow + else if (self.lip < 5) self.think = dcrossbow_standA1; // Look around + else self.think = dcrossbow_standB1; // Hold crossbow up + } + ai_stand(); +}; + +//=========================================================================== +void() dcrossbow_walk1 =[ $walk1, dcrossbow_walk2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_walk(2);}; +void() dcrossbow_walk2 =[ $walk2, dcrossbow_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dcrossbow_walk3 =[ $walk3, dcrossbow_walk4 ] {ai_walk(5);}; +void() dcrossbow_walk4 =[ $walk4, dcrossbow_walk5 ] {ai_walk(4);}; +void() dcrossbow_walk5 =[ $walk5, dcrossbow_walk6 ] {ai_walk(4);}; +void() dcrossbow_walk6 =[ $walk6, dcrossbow_walk7 ] {ai_walk(2);}; +void() dcrossbow_walk7 =[ $walk7, dcrossbow_walk8 ] {ai_walk(2);}; +void() dcrossbow_walk8 =[ $walk8, dcrossbow_walk9 ] {ai_walk(3); monster_footstep(FALSE);}; +void() dcrossbow_walk9 =[ $walk9, dcrossbow_walk10] {ai_walk(3);}; +void() dcrossbow_walk10 =[ $walk10, dcrossbow_walk11] {ai_walk(4);}; +void() dcrossbow_walk11 =[ $walk11, dcrossbow_walk12 ] {ai_walk(3);}; +void() dcrossbow_walk12 =[ $walk12, dcrossbow_walk13 ] {ai_walk(4);}; +void() dcrossbow_walk13 =[ $walk13, dcrossbow_walk14 ] {ai_walk(6);}; +void() dcrossbow_walk14 =[ $walk14, dcrossbow_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// 6 frames instead of 8 frames (skipping 3rd/7th timing of original) + +void() dcrossbow_run1 =[ $run1, dcrossbow_run2 ] { monster_idle_sound(); + self.idlebusy = FALSE; ai_run (16);}; +void() dcrossbow_run2 =[ $run2, dcrossbow_run3 ] {ai_run(20);}; +void() dcrossbow_run3 =[ $run3, dcrossbow_run4 ] {ai_run(7);}; +void() dcrossbow_run4 =[ $run4, dcrossbow_run5 ] {ai_run(16);}; +void() dcrossbow_run5 =[ $run5, dcrossbow_run6 ] {ai_run(20);}; +void() dcrossbow_run6 =[ $run6, dcrossbow_run1 ] {ai_run(6);}; + +//=========================================================================== +// FINISHING (STOP) - exit point for the range attack logic +// STOP - lower crossbow and then run / hunt player +void() dcrossbow_stop1 =[ $tstop1, dcrossbow_stop2 ] {self.weaponstate = CROSS_UP;}; +void() dcrossbow_stop2 =[ $tstop2, dcrossbow_stop3 ] {}; +void() dcrossbow_stop3 =[ $tstop3, dcrossbow_stop4 ] {}; +void() dcrossbow_stop4 =[ $tstop4, dcrossbow_stop5 ] {}; +void() dcrossbow_stop5 =[ $tstop5, dcrossbow_stop6 ] {}; +void() dcrossbow_stop6 =[ $tstop6, dcrossbow_stop7 ] {}; +void() dcrossbow_stop7 =[ $tstop7, dcrossbow_run1 ] {self.weaponstate = CROSS_DOWN;}; + +//=========================================================================== +void() dcrossbow_shot = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/crossbow_fire.wav", 1, ATTN_NORM); + + // Skill level adjustment + self.attack_speed = SPEED_DCROSS + (skill*SPEED_BOLTSKILL); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + //It certainly was really cool to write the code for tracking and + //lots of fun to watch how the AI adapts to the player movement, + //but as a player it just feels cheap and unfair! + //- The tracking feature is now just a spawnflag option + if (self.spawnflags & MON_DCROSSTRACK) dir = normalize(self.attack_track - org); + else dir = normalize(self.enemy.origin - org); + + // Fire projectile at player + launch_projectile (org, dir, CT_PROJ_BOLT1, self.attack_speed); +}; + +//---------------------------------------------------------------------------- +// FIRE - fires crossbow and reload +// Trimmed down from 32 frames to 20 (now 2s reload time) +// Removed - 4,6,8,10, 17,19,21,23, 25,27,29,31 +//---------------------------------------------------------------------------- +void() dcrossbow_fire1 =[ $tfire1, dcrossbow_fire2 ] {dcrossbow_shot();}; +void() dcrossbow_fire2 =[ $tfire2, dcrossbow_fire3 ] {ai_face();}; +void() dcrossbow_fire3 =[ $tfire3, dcrossbow_fire5 ] {ai_face();}; +void() dcrossbow_fire5 =[ $tfire5, dcrossbow_fire7 ] {}; +void() dcrossbow_fire7 =[ $tfire7, dcrossbow_fire9 ] {}; +void() dcrossbow_fire9 =[ $tfire9, dcrossbow_fire11] {}; +void() dcrossbow_fire11 =[ $tfire11, dcrossbow_fire12] {}; +void() dcrossbow_fire12 =[ $tfire12, dcrossbow_fire13] {}; +void() dcrossbow_fire13 =[ $tfire13, dcrossbow_fire14] {}; +void() dcrossbow_fire14 =[ $tfire14, dcrossbow_fire15] {}; +void() dcrossbow_fire15 =[ $tfire15, dcrossbow_fire16] { + sound (self, CHAN_WEAPON, "weapons/crossbow_rdy.wav", 1, ATTN_NORM);}; +void() dcrossbow_fire16 =[ $tfire16, dcrossbow_fire18] {}; +void() dcrossbow_fire18 =[ $tfire18, dcrossbow_fire20] {}; +void() dcrossbow_fire20 =[ $tfire20, dcrossbow_fire22] {}; +void() dcrossbow_fire22 =[ $tfire22, dcrossbow_fire24] {}; +void() dcrossbow_fire24 =[ $tfire24, dcrossbow_fire26] {}; +void() dcrossbow_fire26 =[ $tfire26, dcrossbow_fire28] {ai_face();}; +void() dcrossbow_fire28 =[ $tfire28, dcrossbow_fire30] {ai_face();}; +void() dcrossbow_fire30 =[ $tfire30, dcrossbow_hold1] {ai_face(); + self.weaponswitch = time + CROSS_TIMEOUT; // Don't exit straight away +}; + +//=========================================================================== +void() dcrossbow_checkattack = +{ + local float boltspeed; + + // Always return if monster is dead! + if (self.health < 1) return; + + // Check to see if enemy is dead? back to run/hunt cycle + if (self.enemy.health < 1) dcrossbow_stop1(); + else { + // is the enemy visible? (liquid check) + if (visible(self.enemy)) { + self.weaponswitch = time + CROSS_TIMEOUT; + // Is the enemy blocked by another enemy? + if (!visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) { + // Is the enemy within melee range? + if (ai_checkmelee(MONAI_MELEEKNIGHT)) self.th_melee(); + else { + // Skill level adjustment for bolt speed + boltspeed = SPEED_DCROSS + (skill*SPEED_BOLTSKILL); + self.attack_track = SUB_Tracking(self.attack_track, self.attack_offset, self.enemy, boltspeed); + + // Chance of attack? start out low and get better chance+tracking over time + self.attack_chance = self.attack_chance + 0.2; + if (random() < self.attack_chance) dcrossbow_fire1(); + } + } + } + else { + // Have not see player for a while, stop wating and hunt for them + if (self.weaponswitch < time+0.1) dcrossbow_stop1(); + else { + // If cannot see player try strafe side to side first before hunt mode + if (self.attack_state == AS_MISSILE) self.think = dcrossbow_slide1; + } + } + } +}; + +//---------------------------------------------------------------------------- +// SLIDE - strafe side to side movement, crossbow up high +void() dcrossbow_slide1 =[ $tslide1, dcrossbow_slide2 ] {ai_run_slide(4); + self.attack_state = AS_SLIDING; // Update type of attack + self.attack_chance = 0.5; // higher chance to attack because moving + self.attack_track = self.enemy.origin; // reset enemy origin ready for tracking + dcrossbow_checkattack(); // Start tracking the player +}; +void() dcrossbow_slide2 =[ $tslide2, dcrossbow_slide3 ] {ai_run_slide(6);dcrossbow_checkattack();}; +void() dcrossbow_slide3 =[ $tslide3, dcrossbow_slide4 ] {ai_run_slide(4);dcrossbow_checkattack();}; +void() dcrossbow_slide4 =[ $tslide4, dcrossbow_slide5 ] {ai_run_slide(2);dcrossbow_checkattack();monster_footstep(FALSE);}; +void() dcrossbow_slide5 =[ $tslide5, dcrossbow_slide6 ] {ai_run_slide(4);dcrossbow_checkattack();}; +void() dcrossbow_slide6 =[ $tslide6, dcrossbow_slide7 ] {ai_run_slide(6);dcrossbow_checkattack();}; +void() dcrossbow_slide7 =[ $tslide7, dcrossbow_slide8 ] {ai_run_slide(4);dcrossbow_checkattack();}; +void() dcrossbow_slide8 =[ $tslide8, dcrossbow_slide1 ] {ai_run_slide(2); + if (!visblocked_wide(self.enemy, '0 0 28', '0 0 0')) self.think = dcrossbow_hold1; + else dcrossbow_checkattack(); +}; + +//---------------------------------------------------------------------------- +// STARTING (SLIDE) - brings crossbow up to shoulder height +void() dcrossbow_slideup1 =[ $tready1, dcrossbow_slideup2 ] {ai_face(); + self.weaponstate = CROSS_DOWN; // Crossbow animation state + self.lefty = rint(random()); // Randomize strafe direction +}; +void() dcrossbow_slideup2 =[ $tready2, dcrossbow_slideup3 ] {}; +void() dcrossbow_slideup3 =[ $tready3, dcrossbow_slideup4 ] {ai_face();}; +void() dcrossbow_slideup4 =[ $tready4, dcrossbow_slideup5 ] {}; +void() dcrossbow_slideup5 =[ $tready5, dcrossbow_slideup6 ] {ai_face();}; +void() dcrossbow_slideup6 =[ $tready6, dcrossbow_slideup7 ] {monster_footstep(FALSE);}; +void() dcrossbow_slideup7 =[ $tready7, dcrossbow_slide1 ] {ai_face(); + self.weaponswitch = time + CROSS_TIMEOUT; // Don't exit straight away + self.weaponstate = CROSS_UP; // Crossbow animation in correct state for slide/hold +}; + +//---------------------------------------------------------------------------- +void() dcrossbow_checkslide = +{ + if (self.weaponstate == CROSS_DOWN) dcrossbow_slideup1(); + else dcrossbow_slide1(); +}; + +//---------------------------------------------------------------------------- +// HOLD - keeps crossbow up high and wait to fire at player +// Random chance to slide to the side instead of being a stationary target +void() dcrossbow_hold1 =[ $thold1, dcrossbow_hold2 ] {ai_face(); + self.attack_state = AS_MISSILE; // Update type of attack + // Quick fire coming from melee attack, otherwise slow build up + if (self.attack_chance < 0) self.attack_chance = 0.5; + else self.attack_chance = 0; // Initial chance of attack is low + self.attack_track = self.enemy.origin; // reset enemy origin ready for tracking + dcrossbow_checkattack(); +}; +void() dcrossbow_hold2 =[ $thold2, dcrossbow_hold3 ] {dcrossbow_checkattack();}; +void() dcrossbow_hold3 =[ $thold3, dcrossbow_hold4 ] {ai_face();dcrossbow_checkattack();}; +void() dcrossbow_hold4 =[ $thold4, dcrossbow_hold5 ] {dcrossbow_checkattack();}; +void() dcrossbow_hold5 =[ $thold5, dcrossbow_hold6 ] {ai_face();dcrossbow_checkattack();}; +void() dcrossbow_hold6 =[ $thold6, dcrossbow_hold1 ] { + if (random() < 0.5) self.think = dcrossbow_slide1; + else dcrossbow_checkattack(); +}; + +//---------------------------------------------------------------------------- +// STARTING (HOLD) - brings crossbow up to shoulder height +void() dcrossbow_ready1 =[ $tready1, dcrossbow_ready2 ] {ai_face(); + self.weaponstate = CROSS_DOWN; // Crossbow animation state + self.lefty = rint(random()); // Randomize strafe direction +}; +void() dcrossbow_ready2 =[ $tready2, dcrossbow_ready3 ] {}; +void() dcrossbow_ready3 =[ $tready3, dcrossbow_ready4 ] {ai_face();}; +void() dcrossbow_ready4 =[ $tready4, dcrossbow_ready5 ] {}; +void() dcrossbow_ready5 =[ $tready5, dcrossbow_ready6 ] {ai_face();}; +void() dcrossbow_ready6 =[ $tready6, dcrossbow_ready7 ] {monster_footstep(FALSE);}; +void() dcrossbow_ready7 =[ $tready7, dcrossbow_hold1 ] {ai_face(); + self.weaponswitch = time + CROSS_TIMEOUT; // Don't exit straight away + self.weaponstate = CROSS_UP; // Crossbow animation in correct state for slide/hold +}; + +//=========================================================================== +// Cycle between melee attacks +// Attack 1 - Slice (stationary one hand slashing attack) +// Attack 2 - Smash (chop overhead to ground) +//---------------------------------------------------------------------- +void() dcrossbow_slice1 =[ $slice2, dcrossbow_slice2 ] {self.weaponstate = CROSS_DOWN;ai_face();}; +void() dcrossbow_slice2 =[ $slice3, dcrossbow_slice3 ] {ai_face(); dcrossbow_crossbow_sound();}; +void() dcrossbow_slice3 =[ $slice4, dcrossbow_slice4 ] {ai_face();}; +void() dcrossbow_slice4 =[ $slice5, dcrossbow_slice5 ] {ai_melee();}; +void() dcrossbow_slice5 =[ $slice6, dcrossbow_slice6 ] {self.meleecontact=TRUE;ai_meleesmash(15);}; +void() dcrossbow_slice6 =[ $slice7, dcrossbow_slice7 ] {ai_melee();self.meleecontact=FALSE;}; +void() dcrossbow_slice7 =[ $slice8, dcrossbow_slice8 ] {}; +void() dcrossbow_slice8 =[ $slice9, dcrossbow_slice9 ] {}; +void() dcrossbow_slice9 =[ $slice10, dcrossbow_slice10 ] {}; +void() dcrossbow_slice10 =[ $slice11, dcrossbow_slice11 ] {ai_face();}; +void() dcrossbow_slice11 =[ $slice12, dcrossbow_slice1 ] {dcrossbow_checkmelee();}; + +//---------------------------------------------------------------------- +// Knight - 11 frames (skipped (1, 11, 14, 15) +void() dcrossbow_smash1 =[ $smash2, dcrossbow_smash2 ] {self.weaponstate = CROSS_DOWN;ai_charge(1);}; +void() dcrossbow_smash2 =[ $smash3, dcrossbow_smash3 ] {ai_charge(7);}; +void() dcrossbow_smash3 =[ $smash4, dcrossbow_smash4 ] {monster_footstep(FALSE); ai_charge(4);}; +void() dcrossbow_smash4 =[ $smash5, dcrossbow_smash5 ] {ai_face();}; +void() dcrossbow_smash5 =[ $smash6, dcrossbow_smash6 ] {dcrossbow_crossbow_sound(); ai_charge(3);}; +void() dcrossbow_smash6 =[ $smash7, dcrossbow_smash7 ] {ai_charge(4);ai_melee();}; +void() dcrossbow_smash7 =[ $smash8, dcrossbow_smash8 ] {monster_footstep(FALSE);self.meleecontact=TRUE;ai_meleesmash(15);}; +void() dcrossbow_smash8 =[ $smash9, dcrossbow_smash9 ] {ai_charge(3);ai_melee();self.meleecontact=FALSE;}; +void() dcrossbow_smash9 =[ $smash10, dcrossbow_smash10 ] {ai_charge(1);}; +void() dcrossbow_smash10 =[ $smash12, dcrossbow_smash11 ] {ai_charge(1);}; +void() dcrossbow_smash11 =[ $smash13, dcrossbow_smash1 ] {dcrossbow_checkmelee();}; + +//---------------------------------------------------------------------- +void() dcrossbow_melee = +{ + // Cycle between different melee attacks + self.meleeattack = self.meleeattack + 1; + if (self.meleeattack == 1) dcrossbow_slice1(); + else { dcrossbow_smash1(); self.meleeattack = 0; } +}; + +//---------------------------------------------------------------------- +void() dcrossbow_checkmelee = +{ + // Always return if monster is dead! + if (self.health < 1) return; + + // Check to see if enemy is dead? back to run/hunt cycle + if (self.enemy.health < 1) ai_run(0); + else { + // Is the enemy within melee range? + // If not then do a quick hipshot at the player + if (!ai_checkmelee(MONAI_MELEEKNIGHT)) { + self.attack_chance = -1; // Start with higher percentage + dcrossbow_ready1(); // Raise up crossbow ready + } + else dcrossbow_melee(); + } +}; + +//============================================================================ +void() dcrossbow_painA1 =[ $painA1, dcrossbow_painA2 ] {self.weaponstate = CROSS_DOWN;}; +void() dcrossbow_painA2 =[ $painA2, dcrossbow_painA3 ] {}; +void() dcrossbow_painA3 =[ $painA3, dcrossbow_painA4 ] {}; +void() dcrossbow_painA4 =[ $painA4, dcrossbow_painA5 ] {}; +void() dcrossbow_painA5 =[ $painA5, dcrossbow_run1 ] {}; +//---------------------------------------------------------------------- +void() dcrossbow_painD1 =[ $painD1, dcrossbow_painD2 ] {self.weaponstate = CROSS_DOWN;}; +void() dcrossbow_painD2 =[ $painD2, dcrossbow_painD3 ] {}; +void() dcrossbow_painD3 =[ $painD3, dcrossbow_painD4 ] {}; +void() dcrossbow_painD4 =[ $painD4, dcrossbow_painD5 ] {monster_footstep(FALSE);}; +void() dcrossbow_painD5 =[ $painD5, dcrossbow_painD6 ] {}; +void() dcrossbow_painD6 =[ $painD6, dcrossbow_painD7 ] {}; +void() dcrossbow_painD7 =[ $painD7, dcrossbow_painD8 ] {}; +void() dcrossbow_painD8 =[ $painD8, dcrossbow_painD9 ] {monster_footstep(FALSE);}; +void() dcrossbow_painD9 =[ $painD9, dcrossbow_painD10 ] {}; +void() dcrossbow_painD10=[ $painD10, dcrossbow_painD11 ] {}; +void() dcrossbow_painD11=[ $painD11, dcrossbow_run1 ] {}; +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dcrossbow_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) dcrossbow_painA1 (); // classic, body recoil + else { + dcrossbow_painD1 (); // Cool stumble, hand over mouth + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dcrossbow_painD1 (); + } + } +}; + +//============================================================================ +void() dcrossbow_die1 =[ $death1, dcrossbow_die2 ] {ai_forward(10);}; +void() dcrossbow_die2 =[ $death2, dcrossbow_die3 ] {monster_check_gib();ai_forward(8);}; +void() dcrossbow_die3 =[ $death3, dcrossbow_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dcrossbow_die4 =[ $death4, dcrossbow_die5 ] {}; +void() dcrossbow_die5 =[ $death5, dcrossbow_die6 ] {}; +void() dcrossbow_die6 =[ $death6, dcrossbow_die7 ] {}; +void() dcrossbow_die7 =[ $death7, dcrossbow_die8 ] {}; +void() dcrossbow_die8 =[ $death8, dcrossbow_die9 ] {ai_forward(10); + sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM);}; +void() dcrossbow_die9 =[ $death9, dcrossbow_die10 ] {ai_forward(11);}; +void() dcrossbow_die10 =[ $death10, dcrossbow_die11 ] {monster_death_postcheck();}; +void() dcrossbow_die11 =[ $death11, dcrossbow_die11 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dcrossbow_dieb1 =[ $deathb1, dcrossbow_dieb2 ] {}; +void() dcrossbow_dieb2 =[ $deathb2, dcrossbow_dieb3 ] {monster_check_gib();}; +void() dcrossbow_dieb3 =[ $deathb3, dcrossbow_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dcrossbow_dieb4 =[ $deathb4, dcrossbow_dieb5 ] {}; +void() dcrossbow_dieb5 =[ $deathb5, dcrossbow_dieb6 ] {}; +void() dcrossbow_dieb6 =[ $deathb6, dcrossbow_dieb7 ] {}; +void() dcrossbow_dieb7 =[ $deathb7, dcrossbow_dieb8 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM);}; +void() dcrossbow_dieb8 =[ $deathb8, dcrossbow_dieb9 ] {}; +void() dcrossbow_dieb9 =[ $deathb9, dcrossbow_dieb10 ] {}; +void() dcrossbow_dieb10 =[ $deathb10, dcrossbow_dieb11 ] {}; +void() dcrossbow_dieb11 =[ $deathb11, dcrossbow_dieb12 ] {}; +void() dcrossbow_dieb12 =[ $deathb12, dcrossbow_dieb13 ] {}; +void() dcrossbow_dieb13 =[ $deathb13, dcrossbow_dieb14 ] {}; +void() dcrossbow_dieb14 =[ $deathb14, dcrossbow_dieb15 ] {}; +void() dcrossbow_dieb15 =[ $deathb15, dcrossbow_dieb16 ] {}; +void() dcrossbow_dieb16 =[ $deathb16, dcrossbow_dieb17 ] {}; +void() dcrossbow_dieb17 =[ $deathb17, dcrossbow_dieb18 ] {}; +void() dcrossbow_dieb18 =[ $deathb18, dcrossbow_dieb19 ] {}; +void() dcrossbow_dieb19 =[ $deathb19, dcrossbow_dieb20 ] {monster_death_postcheck();}; +void() dcrossbow_dieb20 =[ $deathb20, dcrossbow_dieb20 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dcrossbow_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Clear weapon sound + sound (self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + if (random() > 0.5) dcrossbow_die1 (); + else dcrossbow_dieb1 (); + } +}; + +//============================================================================ +void() dcrossbow_crossbow_sound = +{ + sound (self, CHAN_WEAPON, "weapons/crossbow_swipe.wav", 1, ATTN_NORM); +}; + +/*====================================================================== +QUAKED monster_dcrossbow (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dcrossbow = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_dcrossbow.mdl"; // crossbow guy + self.headmdl = "progs/ad171/h_dguard.mdl"; + self.gib1mdl = "progs/ad171/w_dcrossbow.mdl"; // Unique weapon + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_BOLT1); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "dknight/dcross_idle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "dknight/dcross_idlecom.wav"; + precache_sound (self.idle_soundcom); + + self.pain_sound = "knight/khurt.wav"; + precache_sound (self.pain_sound); + precache_sound ("knight/kdeath.wav"); + + // Crossbow and bolt sounds + precache_sound ("weapons/bolt_hit1.wav"); + precache_sound ("weapons/bolt_hit2.wav"); + precache_sound ("weapons/bolt_hit3.wav"); + precache_sound ("weapons/bolt_hit4.wav"); + precache_sound ("weapons/crossbow_fire.wav"); + precache_sound ("weapons/crossbow_swipe.wav"); + + // Heavy wood sound + self.meleehitsound = "weapons/crossbow_hit1.wav"; + precache_sound (self.meleehitsound); + + self.sight_sound = "weapons/crossbow_rdy.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model ("progs/ad171/proj_bolt2.mdl"); // Green poison bolt + self.skin = self.exactskin = 1; // Greener Green+++ Skin!?! + if (self.deathstring == "") self.deathstring = " was skewered by a Poisonous Crossbow Knight\n"; + } else { + if (self.deathstring == "") self.deathstring = " was skewered by a Crossbow Knight\n"; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 75; + self.gibhealth = -25; // Can be gib from a rocket/grenade + self.gibbed = FALSE; + self.pain_flinch = 40; + self.pain_longanim = TRUE; + self.steptype = FS_TYPEMEDIUM; + self.weaponstate = CROSS_DOWN; // Maintain crossbow state + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEFRONT; // Smash attack + self.attack_offset = '20 12 28'; // Where to fire bolt from + + // check for sniper mode, no distance checks for attacks + if (self.spawnflags & MON_DCROSSSNIPER) + self.enemymaxdist = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DCrossCheckAttack; + self.th_stand = dcrossbow_stand1; + self.th_walk = dcrossbow_walk1; + self.th_run = dcrossbow_run1; + self.th_melee = dcrossbow_melee; + self.th_missile = dcrossbow_ready1; + self.th_slide = dcrossbow_checkslide; + self.th_pain = dcrossbow_pain; + self.th_die = dcrossbow_die; + + self.hittype = HIT_METAL; + + self.classtype = CT_MONDCROSS; + self.classgroup = CG_KNIGHT; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_deathguard.qc b/QC_other/QC_keep/mon_deathguard.qc new file mode 100644 index 00000000..99fde8c3 --- /dev/null +++ b/QC_other/QC_keep/mon_deathguard.qc @@ -0,0 +1,374 @@ +float() DGuardCheckAttack; + +void() deathguard_hit = { + if (vlen(self.enemy.origin - self.origin) > 100) { + if (random() < 0.5) { + sound(self, CHAN_WEAPON, "dguard/slmiss1.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_WEAPON, "dguard/slmiss2.wav", 1, ATTN_NORM); + } + return; + } + sound(self, CHAN_WEAPON, "dguard/slhit.wav", 1, ATTN_NORM); + T_Damage(self.enemy, self, self, 30,DAMARMOR); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); +}; + +void() deathguard_slash1 = [79, deathguard_slash2] { sound(self, CHAN_VOICE, "dguard/slash.wav", 1, ATTN_NORM); ai_face(); ai_forward(1); }; +void() deathguard_slash2 = [80, deathguard_slash3] { ai_face(); ai_forward(1); }; +void() deathguard_slash3 = [81, deathguard_slash4] { ai_face(); ai_forward(1); monster_footstep(FALSE); }; +void() deathguard_slash4 = [82, deathguard_slash5] { ai_face(); ai_forward(1); }; +void() deathguard_slash5 = [83, deathguard_slash6] { ai_face(); ai_forward(1); }; +void() deathguard_slash6 = [84, deathguard_slash7] { ai_face(); ai_forward(1); }; +void() deathguard_slash7 = [85, deathguard_slash8] { ai_face(); ai_forward(1); }; +void() deathguard_slash8 = [86, deathguard_slash9] { ai_face(); ai_forward(1); }; +void() deathguard_slash9 = [87, deathguard_slash10] { ai_face(); ai_forward(1); monster_footstep(FALSE); }; +void() deathguard_slash10 = [88, deathguard_slash11] { ai_face(); deathguard_hit(); ai_forward(1); }; +void() deathguard_slash11 = [89, deathguard_slash12] { ai_face(); }; +void() deathguard_slash12 = [90, deathguard_slash13] { ai_face(); }; +void() deathguard_slash13 = [91, deathguard_slash14] { ai_face(); }; +void() deathguard_slash14 = [92, deathguard_run1] { ai_face(); }; + +void(float dmgamount) dg_slice = { + if (vlen(self.enemy.origin - self.origin) > 100) + return; + + T_Damage(self.enemy, self, self, dmgamount,DAMARMOR); + + // Check for poisonous blades! + if (self.poisonous) PoisonDeBuff(self.enemy); +}; + +void() deathguard_charge1 = [106, deathguard_charge2] { + ai_charge(24); + if (random() < 0.5) { + sound(self, CHAN_VOICE, "knight/sword1.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_VOICE, "knight/sword2.wav", 1, ATTN_NORM); + } +}; +void() deathguard_charge2 = [107, deathguard_charge3] { ai_charge(29); }; +void() deathguard_charge3 = [108, deathguard_charge4] { ai_charge(22); monster_footstep(FALSE); }; +void() deathguard_charge4 = [109, deathguard_charge5] { ai_charge(20); dg_slice(1); }; +void() deathguard_charge5 = [110, deathguard_charge6] { ai_charge(18); dg_slice(3); }; +void() deathguard_charge6 = [111, deathguard_run1] { ai_charge(20); dg_slice(2); }; + +void() deathguard_slowcharge1 = [112, deathguard_slowcharge2] { + ai_charge(TE_BEAM); + if (random() < 0.5) { + sound(self, CHAN_VOICE, "knight/sword1.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_VOICE, "knight/sword2.wav", 1, ATTN_NORM); + } +}; +void() deathguard_slowcharge2 = [113, deathguard_slowcharge3] { ai_charge(14); }; +void() deathguard_slowcharge3 = [114, deathguard_slowcharge4] { ai_charge(19); }; +void() deathguard_slowcharge4 = [115, deathguard_slowcharge5] { ai_charge(17); }; +void() deathguard_slowcharge5 = [116, deathguard_slowcharge6] { ai_charge(12); dg_slice(2); }; +void() deathguard_slowcharge6 = [117, deathguard_slowcharge7] { ai_charge(8); dg_slice(4); }; +void() deathguard_slowcharge7 = [118, deathguard_slowcharge8] { ai_charge(10); dg_slice(2); monster_footstep(FALSE); }; +void() deathguard_slowcharge8 = [119, deathguard_slowcharge9] { ai_charge(6);}; +void() deathguard_slowcharge9 = [120, deathguard_slowcharge10] { ai_charge(3); }; +void() deathguard_slowcharge10 = [121, deathguard_run1] { ai_charge(2); }; + +void() dg_fireball_touch = { + local vector org; + + if (other == self.owner) + return; + + if (pointcontents(self.origin) == CONTENT_SKY) { + remove(self); + return; + } + org = self.origin - 8 * normalize(self.velocity); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteCoord(MSG_BROADCAST, org_x); + WriteCoord(MSG_BROADCAST, org_y); + WriteCoord(MSG_BROADCAST, org_z); + sound(self, CHAN_VOICE, "dguard/hit.wav", 1, ATTN_NORM); + T_RadiusDamage(self, self.owner, 40, other,DAMAGEALL); + T_Damage(other, self, self.owner, 27 + 2 * random(),DAMARMOR); + if (other.classname != "player") { + if (other.classname == "monster_zombie" || other.classname == "monster_zombiek" || other.classname == "monster_zombiep") + T_Damage(other, self, self.owner, 120,DAMARMOR); // gib zombies! + } + remove(self); +}; + +void() deathguard_shot = { + local vector org; + local vector vec; + local vector spot1; + local vector spot2; + local entity targ; + + targ = self.enemy; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline(spot1, spot2, 0, self); + if (trace_ent != targ) { + self.think = self.th_run; + return; + } + hknight_shot(0); + newmis.mdl = "progs/quoth2pt2full/fireball.mdl"; + org = self.origin + '0 0 24'; + setmodel(newmis, "progs/quoth2pt2full/fireball.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin(newmis, org); + if (visible(self.enemy)) { + vec = self.enemy.origin - '0 0 16'; + vec = normalize(vec - org); + } else { + vec = self.oldenemyorigin - '0 0 16'; + vec = normalize(vec - org); + } + newmis.velocity = vec * 900; + newmis.angles = vectoangles(newmis.velocity); + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + newmis.touch = dg_fireball_touch; + newmis.classname = "dguardfireball"; +}; + +void() deathguard_fire1 = [93, deathguard_fire2] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire2 = [94, deathguard_fire3] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire3 = [95, deathguard_fire4] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire4 = [96, deathguard_fire5] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire5 = [97, deathguard_fire6] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire6 = [98, deathguard_fire7] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire7 = [99, deathguard_fire8] { ai_shotcheck(); ai_face(); }; +void() deathguard_fire8 = [100, deathguard_fire9] { ai_shotcheck(); ai_face(); sound(self, CHAN_VOICE, "dknight/dserg_magic.wav", 1, ATTN_NORM); }; +void() deathguard_fire9 = [101, deathguard_fire10] { ai_shotcheck(); ai_face(); deathguard_shot(); }; +void() deathguard_fire10 = [102, deathguard_fire11] { ai_face(); }; +void() deathguard_fire11 = [103, deathguard_fire12] { ai_face(); }; +void() deathguard_fire12 = [104, deathguard_fire13] { ai_face(); }; +void() deathguard_fire13 = [105, deathguard_run1] { ai_face(); }; + +void() deathguard_stand1 = [0, deathguard_stand2] { ai_stand(); }; +void() deathguard_stand2 = [1, deathguard_stand3] { ai_stand(); }; +void() deathguard_stand3 = [2, deathguard_stand4] { ai_stand(); }; +void() deathguard_stand4 = [3, deathguard_stand5] { ai_stand(); }; +void() deathguard_stand5 = [4, deathguard_stand6] { ai_stand(); }; +void() deathguard_stand6 = [5, deathguard_stand7] { ai_stand(); }; +void() deathguard_stand7 = [6, deathguard_stand8] { ai_stand(); }; +void() deathguard_stand8 = [7, deathguard_stand9] { ai_stand(); }; +void() deathguard_stand9 = [8, deathguard_stand1] { ai_stand(); }; + +void() deathguard_walk1 = [9, deathguard_walk2] { monster_idle_sound(); ai_walk(2); }; +void() deathguard_walk2 = [10, deathguard_walk3] { ai_walk(5); }; +void() deathguard_walk3 = [11, deathguard_walk4] { ai_walk(5); }; +void() deathguard_walk4 = [12, deathguard_walk5] { ai_walk(4); }; +void() deathguard_walk5 = [13, deathguard_walk6] { ai_walk(4); }; +void() deathguard_walk6 = [14, deathguard_walk7] { ai_walk(2); }; +void() deathguard_walk7 = [15, deathguard_walk8] { ai_walk(2); }; +void() deathguard_walk8 = [16, deathguard_walk9] { ai_walk(3); }; +void() deathguard_walk9 = [17, deathguard_walk10] { ai_walk(3); }; +void() deathguard_walk10 = [18, deathguard_walk11] { ai_walk(4); }; +void() deathguard_walk11 = [19, deathguard_walk12] { ai_walk(3); monster_footstep(FALSE); }; +void() deathguard_walk12 = [20, deathguard_walk13] { ai_walk(4); }; +void() deathguard_walk13 = [21, deathguard_walk14] { ai_walk(6); }; +void() deathguard_walk14 = [22, deathguard_walk15] { ai_walk(2); }; +void() deathguard_walk15 = [23, deathguard_walk16] { ai_walk(2); }; +void() deathguard_walk16 = [24, deathguard_walk17] { ai_walk(4); }; +void() deathguard_walk17 = [25, deathguard_walk18] { ai_walk(3); }; +void() deathguard_walk18 = [26, deathguard_walk19] { ai_walk(3); }; +void() deathguard_walk19 = [27, deathguard_walk20] { ai_walk(3); }; +void() deathguard_walk20 = [28, deathguard_walk1] { ai_walk(2); monster_footstep(FALSE); }; + +void() deathguard_run1 = [29, deathguard_run2] { monster_idle_sound(); ai_run(24); }; +void() deathguard_run2 = [30, deathguard_run3] { ai_run(29); monster_footstep(FALSE); }; +void() deathguard_run3 = [31, deathguard_run4] { ai_run(22); }; +void() deathguard_run4 = [32, deathguard_run5] { ai_run(20); }; +void() deathguard_run5 = [33, deathguard_run6] { ai_run(18); monster_footstep(FALSE); }; +void() deathguard_run6 = [34, deathguard_run7] { ai_run(29); }; +void() deathguard_run7 = [35, deathguard_run8] { ai_run(25); }; +void() deathguard_run8 = [36, deathguard_run1] { ai_run(17); }; +void() deathguard_pain1 = [37, deathguard_pain2] { sound(self, CHAN_VOICE, "dguard/pain1.wav", 1, ATTN_NORM); }; +void() deathguard_pain2 = [38, deathguard_pain3]{monster_footstep(FALSE);}; +void() deathguard_pain3 = [39, deathguard_pain4]{}; +void() deathguard_pain4 = [40, deathguard_pain5]{}; +void() deathguard_pain5 = [41, deathguard_run1] {}; + +void() deathguard_die1 = [42, deathguard_die2] { ai_forward(10); sound(self, CHAN_VOICE, "dguard/death2.wav", 1, ATTN_NORM); }; +void() deathguard_die2 = [43, deathguard_die3] { monster_check_gib(); ai_forward(8); }; +void() deathguard_die3 = [44, deathguard_die4] { monster_check_gib(); ai_forward(7); }; +void() deathguard_die4 = [45, deathguard_die5] { self.solid = SOLID_NOT; }; +void() deathguard_die5 = [46, deathguard_die6] { self.nextthink = time + 0.2; }; +void() deathguard_die6 = [47, deathguard_die7] { self.nextthink = time + 0.2; }; +void() deathguard_die7 = [48, deathguard_die8] { self.nextthink = time + 0.2; }; +void() deathguard_die8 = [49, deathguard_die9] { ai_forward(10); }; +void() deathguard_die9 = [50, deathguard_die10] { ai_forward(11); }; +void() deathguard_die10 = [51, deathguard_die11] {}; +void() deathguard_die11 = [52, deathguard_die12] {monster_death_postcheck();}; +void() deathguard_die12 = [53, deathguard_die12] { self.nextthink = time + 0.1; }; + +void() deathguard_dieb1 = [54, deathguard_dieb2] { sound(self, CHAN_VOICE, "dguard/death1.wav", 1, ATTN_NORM); }; +void() deathguard_dieb2 = [55, deathguard_dieb3] { monster_check_gib(); }; +void() deathguard_dieb3 = [56, deathguard_dieb4] { monster_check_gib(); }; +void() deathguard_dieb4 = [57, deathguard_dieb5] { self.solid = SOLID_NOT;}; +void() deathguard_dieb5 = [58, deathguard_dieb6] {}; +void() deathguard_dieb6 = [59, deathguard_dieb7] {}; +void() deathguard_dieb7 = [60, deathguard_dieb8] {}; +void() deathguard_dieb8 = [61, deathguard_dieb9] {monster_death_postcheck(); }; +void() deathguard_dieb9 = [62, deathguard_dieb9] { self.nextthink = time + 0.1; }; + +void() deathguard_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + if (random() > 0.5) { + deathguard_die1(); + } else { + deathguard_dieb1(); + } + } +}; + +void(entity inflictor, entity attacker, float damage) deathguard_pain = { + if (self.pain_finished > time) + return; + + if (random() > 0.5) { + sound(self, CHAN_VOICE, "dguard/pain1.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_VOICE, "dguard/pain2.wav", 1, ATTN_NORM); + } + if (random() * 30 > damage) + return; + + self.pain_finished = time + 5; + deathguard_pain1(); +}; + +void() deathguard_melee = { deathguard_slash1(); }; + +void() monster_deathguard = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/quoth2pt2full/dguard.mdl"; + precache_model(self.mdl); + self.headmdl = "progs/quoth2pt2full/h_dguard.mdl"; + precache_model(self.headmdl); + precache_model("progs/quoth2pt2full/fireball.mdl"); + self.gib1sound = GIB_IMPACT_METALA; + self.idle_sound = "dguard/idle.wav"; + precache_sound(self.idle_sound); + precache_sound("dguard/fire.wav"); + precache_sound("dknight/dserg_magic.wav"); + precache_sound("dguard/death1.wav"); + precache_sound("dguard/death2.wav"); + precache_sound("dguard/pain1.wav"); + precache_sound("dguard/pain2.wav"); + precache_sound("dguard/sight1.wav"); + precache_sound("dguard/sight2.wav"); + precache_sound("dguard/sight3.wav"); + precache_sound("dguard/sight4.wav"); + precache_sound("dguard/hit.wav"); + precache_sound("dguard/slash.wav"); + precache_sound("knight/sword1.wav"); + precache_sound("knight/sword2.wav"); + precache_sound("dguard/slhit.wav"); + precache_sound("dguard/slmiss1.wav"); + precache_sound("dguard/slmiss2.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 200; + self.gibhealth = -50; + self.gibbed = FALSE; + self.pain_flinch = 40; + self.steptype = FS_TYPEMEDIUM; + self.hittype = HIT_METAL; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = deathguard_stand1; + self.th_walk = deathguard_walk1; + self.th_run = deathguard_run1; + self.th_melee = deathguard_slash1; + self.th_missile = deathguard_fire1; + self.th_pain = deathguard_pain; + self.th_die = deathguard_die; + + self.classtype = CT_MONDGUARD; + self.classgroup = CG_KNIGHT; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = "was slaughtered by a Death Brigade Death Guard\n"; + + monster_start(); +}; + +void() monster_death_guard = { + self.classname = "monster_deathguard"; + monster_deathguard(); +}; + +float() DGuardCheckAttack = { + local vector spot1; + local vector spot2; + local entity targ; + local float chance; + local float dgdist; + targ = self.enemy; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline(spot1, spot2, 0, self); + if (trace_ent != targ) + { + return 0; + } + if (trace_inopen && trace_inwater) + { + return 0; + } + dgdist = vlen(self.enemy.origin - self.origin); + if (dgdist < 100) + { + self.th_melee(); + return 1; + } + else + { + if (dgdist < 190 && dgdist > 140) + { + deathguard_charge1(); + return 1; + } + } + if (time < self.attack_finished) + { + return 0; + } + if (enemy_range == RANGE_FAR) + { + return 0; + } + if (dgdist < 300) + { + return 0; + } + else + { + if (dgdist >= 300) + { + chance = 0.5; + } + } + if (random() < chance) + { + self.th_missile(); + SUB_AttackFinished(1.4 * random() + 0.8); + return 1; + } + return 0; +}; + diff --git a/QC_other/QC_keep/mon_demon.qc b/QC_other/QC_keep/mon_demon.qc new file mode 100644 index 00000000..0d27c3ca --- /dev/null +++ b/QC_other/QC_keep/mon_demon.qc @@ -0,0 +1,340 @@ +/*============================================================================== +DEMON +==============================================================================*/ +$cd id1/models/demon3 +$scale 0.8 +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +$frame run1 run2 run3 run4 run5 run6 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 +$frame leap11 leap12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 + +$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 +$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 + +//============================================================================ +void() demon1_stand1 =[ $stand1, demon1_stand2 ] {monster_idle_sound(); ai_stand();}; +void() demon1_stand2 =[ $stand2, demon1_stand3 ] {ai_stand();}; +void() demon1_stand3 =[ $stand3, demon1_stand4 ] {ai_stand();}; +void() demon1_stand4 =[ $stand4, demon1_stand5 ] {ai_stand();}; +void() demon1_stand5 =[ $stand5, demon1_stand6 ] {ai_stand();}; +void() demon1_stand6 =[ $stand6, demon1_stand7 ] {ai_stand();}; +void() demon1_stand7 =[ $stand7, demon1_stand8 ] {ai_stand();}; +void() demon1_stand8 =[ $stand8, demon1_stand9 ] {ai_stand();}; +void() demon1_stand9 =[ $stand9, demon1_stand10 ] {ai_stand();}; +void() demon1_stand10 =[ $stand10, demon1_stand11 ] {ai_stand();}; +void() demon1_stand11 =[ $stand11, demon1_stand12 ] {ai_stand();}; +void() demon1_stand12 =[ $stand12, demon1_stand13 ] {ai_stand();}; +void() demon1_stand13 =[ $stand13, demon1_stand1 ] {ai_stand();}; + +//============================================================================ +void() demon1_walk1 =[ $walk1, demon1_walk2 ] { + monster_footstep(FALSE); monster_idle_sound(); ai_walk(8);}; +void() demon1_walk2 =[ $walk2, demon1_walk3 ] {ai_walk(6);}; +void() demon1_walk3 =[ $walk3, demon1_walk4 ] {ai_walk(6);}; +void() demon1_walk4 =[ $walk4, demon1_walk5 ] {ai_walk(7);}; +void() demon1_walk5 =[ $walk5, demon1_walk6 ] {monster_footstep(FALSE); ai_walk(4);}; +void() demon1_walk6 =[ $walk6, demon1_walk7 ] {ai_walk(6);}; +void() demon1_walk7 =[ $walk7, demon1_walk8 ] {ai_walk(10);}; +void() demon1_walk8 =[ $walk8, demon1_walk1 ] {ai_walk(10);}; + +//============================================================================ +void() demon1_run1 =[ $run1, demon1_run2 ] {monster_idle_sound(); ai_run(20);}; +void() demon1_run2 =[ $run2, demon1_run3 ] {monster_footstep(FALSE); ai_run(15);}; +void() demon1_run3 =[ $run3, demon1_run4 ] {ai_run(36);}; +void() demon1_run4 =[ $run4, demon1_run5 ] {ai_run(20);}; +void() demon1_run5 =[ $run5, demon1_run6 ] {monster_footstep(FALSE); ai_run(15);}; +void() demon1_run6 =[ $run6, demon1_run1 ] {ai_run(36);}; + +//=========================================================================== +// Melee damage function, called from animation frame set +// Standardized layout (matching ai_melee (ai.qc) +// Added each claw attack checks enemy distance (before no check) +// Added z depth check on attacks +/- 64 units +// Added claw miss sound (borrowed HK slash sound) +// Changed some explicit values to constant variables +//=========================================================================== +void(float side) Demon_Claw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + walkmove (self.ideal_yaw, 12); // Get extra close to enemy target + ai_damagebreakable(20); // Damage any breakables + + // Moved the check for melee distance to here with takedamage + // If the demon is outside of melee range then need miss swipe sound + // same goes for enemies that cannot be damaged (world geo mostly) + if (!ai_checkmelee(MONAI_MELEEDEMON) || !self.enemy.takedamage) { + // Melee claw miss sound + if (random() < 0.5) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + } + else { + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Melee claw hit sound + sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); + ldmg = 10 + 5*random(); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +void() demon1_atta1 =[ $attacka1, demon1_atta2 ] {ai_charge(4);}; +void() demon1_atta2 =[ $attacka2, demon1_atta3 ] {monster_footstep(FALSE); ai_charge(0);}; +void() demon1_atta3 =[ $attacka3, demon1_atta4 ] {ai_charge(0);}; +void() demon1_atta4 =[ $attacka4, demon1_atta5 ] {ai_charge(1);}; +void() demon1_atta5 =[ $attacka5, demon1_atta6 ] {ai_charge(2); Demon_Claw(150);}; +void() demon1_atta6 =[ $attacka6, demon1_atta7 ] {ai_charge(1);}; +void() demon1_atta7 =[ $attacka7, demon1_atta8 ] {ai_charge(6);}; +void() demon1_atta8 =[ $attacka8, demon1_atta9 ] {ai_charge(8);}; +void() demon1_atta9 =[ $attacka9, demon1_atta10] {ai_charge(4);}; +void() demon1_atta10 =[ $attacka10, demon1_atta11] {monster_footstep(FALSE); ai_charge(2);}; +void() demon1_atta11 =[ $attacka11, demon1_atta12] {Demon_Claw(-150);}; +void() demon1_atta12 =[ $attacka12, demon1_atta13] {ai_charge(5);}; +void() demon1_atta13 =[ $attacka13, demon1_atta14] {ai_charge(8);}; +void() demon1_atta14 =[ $attacka14, demon1_atta15] {ai_charge(4);}; +void() demon1_atta15 =[ $attacka15, demon1_run1] {ai_charge(4);}; + +//=========================================================================== +// JumpTouch setup from animation frame set +// Changed so that it does not keep going in a loop +// * Demon will jump again if stuck (only 2 jumps) +//=========================================================================== +void() Demon_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(50); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + + // Keep track of how many times touched the same object + if (self.jumptouch == other) self.jump_flag = time + MONAI_JUMPTIMEOUT; + self.jumptouch = other; // Keep track of touch target + + // Do not damage other demons with jump attacks + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 40 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + SpawnMeatSpray(self, other, FALSE); + SpawnMeatSpray(self, other, FALSE); + SpawnMeatSpray(self, other, FALSE); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + } + } + + // Is the demon floating in the air? + if (!checkbottom(self)) { + // Is the demon standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() demon1_jump1 =[ $leap1, demon1_jump2 ] {ai_face(); + self.jump_flag = time; // No jump time limits + sound (self, CHAN_VOICE, "demon/djump.wav", 1, ATTN_NORM); +}; +void() demon1_jump2 =[ $leap2, demon1_jump3 ] {ai_face();}; +void() demon1_jump3 =[ $leap3, demon1_jump4 ] {ai_face();}; +void() demon1_jump4 =[ $leap4, demon1_jump5 ] { + ai_face(); + self.jump_flag = time; // No jump time limits + self.touch = Demon_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 600 + '0 0 250'; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() demon1_jump5 =[ $leap5, demon1_jump6 ] {}; +void() demon1_jump6 =[ $leap6, demon1_jump7 ] {}; +void() demon1_jump7 =[ $leap7, demon1_jump8 ] {}; +void() demon1_jump8 =[ $leap8, demon1_jump9 ] {}; +void() demon1_jump9 =[ $leap9, demon1_jump10 ] {}; +void() demon1_jump10 =[ $leap10, demon1_jump1 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = demon1_jump3; + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() demon1_jump11 =[ $leap11, demon1_jump12] {monster_footstep(FALSE); }; +void() demon1_jump12 =[ $leap12, demon1_run1 ] {ai_resetangles();}; + +/*====================================================================== + PAIN +========================================================================*/ +void() demon1_pain1 =[ $pain1, demon1_pain2 ] {}; +void() demon1_pain2 =[ $pain2, demon1_pain3 ] {}; +void() demon1_pain3 =[ $pain3, demon1_pain4 ] {}; +void() demon1_pain4 =[ $pain4, demon1_pain5 ] {}; +void() demon1_pain5 =[ $pain5, demon1_pain6 ] {}; +void() demon1_pain6 =[ $pain6, demon1_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) demon1_pain = +{ + if (self.touch == Demon_JumpTouch) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) demon1_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + demon1_pain1 (); + } + } +}; + +//============================================================================ +void() demon1_death1 =[ $death1, demon1_death2 ] {}; +void() demon1_death2 =[ $death2, demon1_death3 ] {monster_check_gib();}; +void() demon1_death3 =[ $death3, demon1_death4 ] {monster_check_gib(); +self.solid = SOLID_NOT;}; +void() demon1_death4 =[ $death4, demon1_death5 ] {}; +void() demon1_death5 =[ $death5, demon1_death6 ] {}; +void() demon1_death6 =[ $death6, demon1_death7 ] {}; +void() demon1_death7 =[ $death7, demon1_death8 ] {}; +void() demon1_death8 =[ $death8, demon1_death9 ] {monster_death_postcheck();}; +void() demon1_death9 =[ $death9, demon1_death9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() demon1_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "demon/ddeath.wav", 1, ATTN_NORM); + demon1_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_demon1 = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_demon.mdl"; + self.headmdl = "progs/h_demon.mdl"; + self.gib1mdl = "progs/ad171/gib_dmleg1.mdl"; // Left leg + self.gib2mdl = "progs/ad171/gib_dmleg2.mdl"; // Right leg + self.gib3mdl = "progs/ad171/gib_dmtail.mdl"; // Tail + self.gib4mdl = "progs/ad171/gib_dmclaw1.mdl"; // Claw 1 + self.gib5mdl = "progs/ad171/gib_dmclaw2.mdl"; // Claw 2 + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); // Always precache extra models + precache_model (self.gib5mdl); // regardless if picked or not + + // Randomly swap in demon claws instead of legs + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + if (random() < 0.5) self.gib2mdl = self.gib5mdl; + + self.idle_sound = "demon/idle1.wav"; + precache_sound (self.idle_sound); + + self.pain_sound = "demon/dpain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("demon/ddeath.wav"); + + precache_sound ("demon/dhit2.wav"); + precache_sound ("demon/djump.wav"); + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + + self.sight_sound = "demon/sight2.wav"; + precache_sound (self.sight_sound); + + // Precache extra green small gibs + if (self.poisonous) { + precache_poisongibs(); + self.gibtype = GIBTYPE_POISON; + self.exactskin = 3; + self.gib1skin = self.gib2skin = self.gib3skin = 1; + if (self.deathstring == "") self.deathstring = " was eviscerated by a Poisonous Fiend\n"; + } else { + if (self.deathstring == "") self.deathstring = " was eviscerated by a Fiend\n"; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 300; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 200; // takes alot to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // High pain threshold + self.steptype = FS_TYPESLOW; // Tiny feet/nails + self.blockudeath = TRUE; // no humanoid death sound + self.meleeoffset = '32 0 10'; // Claw attack offset + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DemonCheckAttack; + self.th_stand = demon1_stand1; + self.th_walk = demon1_walk1; + self.th_run = demon1_run1; + self.th_melee = demon1_atta1; // one of two attacks + self.th_jump = demon1_jump1; // jump attack + self.th_jumpexit = demon1_jump11; + self.th_pain = demon1_pain; + self.th_die = demon1_die; + + self.classtype = CT_MONDEMON; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_dfury.qc b/QC_other/QC_keep/mon_dfury.qc new file mode 100644 index 00000000..a459703d --- /dev/null +++ b/QC_other/QC_keep/mon_dfury.qc @@ -0,0 +1,830 @@ +/*============================================================================== +FURY KNIGHT (one more night) +==============================================================================*/ +$cd id1/models/dfury +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default Stand - LEFT Sword forward +$frame standL1 standL2 standL3 standL4 standL5 standL6 standL7 standL8 +$frame standL9 standL10 standL11 standL12 + +// (013 - 019) Switch dual swords LEFT -> RIGHT +$frame standLR1 standLR2 standLR3 standLR4 standLR5 standLR6 standLR7 + +// (020 - 031) Default Stand - RIGHT Sword forward +$frame standR1 standR2 standR3 standR4 standR5 standR6 standR7 standR8 +$frame standR9 standR10 standR11 standR12 + +// (032 - 038) Switch dual swords RIGHT -> LEFT +$frame standRL1 standRL2 standRL3 standRL4 standRL5 standRL6 standRL7 + +// (039 - 050) Stand idle - Quick look around (MUST following left sword idle) +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 + +// (051 - 070) Stand idle - checking sword (MUST following left sword idle) +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 + +// (071 - 084) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (085 - 090) Default run +$frame run1 run2 run3 run4 run5 run6 + +// Pain animations A = Slow D = Stagger +// (091 - 095) (096 - 111) +$frame painA1 painA2 painA3 painA4 painA5 + +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 +$frame painD9 painD10 painD11 painD12 painD13 painD14 painD15 painD16 + +// (112 - 125) Forward dual sword Slice +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 + +// (126 - 140) Forward dual sword Lunge +$frame lunge1 lunge2 lunge3 lunge4 lunge5 lunge6 lunge7 lunge8 +$frame lunge9 lunge10 lunge11 lunge12 lunge13 lunge14 lunge15 + +// (141 - 164) Charging attack A - swinging swords left to right infront +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 w_attack23 w_attack24 + +// (165 - 172) Right Swing +$frame rswing1 rswing2 rswing3 rswing4 rswing5 rswing6 rswing7 rswing8 + +// (173 - 180) Left Swing +$frame lswing1 lswing2 lswing3 lswing4 lswing5 lswing6 lswing7 lswing8 + +// (181 - 195) Smash (chop overhead to ground) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (196 - 211) MagicA - Swords lock together infront (missile attack) +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 magica15 magica16 + +// (212 - 224) MagicB - Swords Swipe downwards infront (enable bullet shield) +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// (225 - 241) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 death17 + +// (242 - 255) Death back +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 + +void() dfury_standL1; +void() dfury_magic; +void() dfury_sword_sound; // Sword swipe sounds +void(float soundtype) dfury_grunt_sound; // Grunting while attacking + +// Different types of grunting sounds +float DFURY_SOUND_PULLAPART = 1; +float DFURY_SOUND_OVERSMASH = 2; +float DFURY_SOUND_JUMP = 3; +float DFURY_SOUND_LRFURY = 4; +float DFURY_SOUND_RUNSWING = 5; +float DFURY_SOUND_OPTIONAL = 6; + +//---------------------------------------------------------------------- +void() dfury_standB1 =[ $standB1, dfury_standB2 ] {ai_stand();}; +void() dfury_standB2 =[ $standB2, dfury_standB3 ] {ai_stand();}; +void() dfury_standB3 =[ $standB3, dfury_standB4 ] {ai_stand();}; +void() dfury_standB4 =[ $standB4, dfury_standB5 ] {ai_stand();}; +void() dfury_standB5 =[ $standB5, dfury_standB6 ] {ai_stand();}; +void() dfury_standB6 =[ $standB6, dfury_standB7 ] {ai_stand();}; +void() dfury_standB7 =[ $standB7, dfury_standB8 ] {ai_stand();}; +void() dfury_standB8 =[ $standB8, dfury_standB9 ] {ai_stand();self.nextthink = self.nextthink + random()*0.2;}; +void() dfury_standB9 =[ $standB9, dfury_standB10 ] {ai_stand();self.nextthink = self.nextthink + random()*0.2;}; +void() dfury_standB10 =[ $standB10, dfury_standB11 ] {ai_stand();self.nextthink = self.nextthink + random()*0.2;}; +void() dfury_standB11 =[ $standB11, dfury_standB12 ] {ai_stand();}; +void() dfury_standB12 =[ $standB12, dfury_standL1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standC1 =[ $standC1, dfury_standC2 ] {ai_stand();}; +void() dfury_standC2 =[ $standC2, dfury_standC3 ] {ai_stand();}; +void() dfury_standC3 =[ $standC3, dfury_standC4 ] {ai_stand();}; +void() dfury_standC4 =[ $standC4, dfury_standC5 ] {ai_stand();}; +void() dfury_standC5 =[ $standC5, dfury_standC6 ] {ai_stand();}; +void() dfury_standC6 =[ $standC6, dfury_standC7 ] {ai_stand();}; +void() dfury_standC7 =[ $standC7, dfury_standC8 ] {ai_stand();}; +void() dfury_standC8 =[ $standC8, dfury_standC9 ] {ai_stand();}; +void() dfury_standC9 =[ $standC9, dfury_standC10 ] {ai_stand();}; +void() dfury_standC10 =[ $standC10, dfury_standC11 ] {ai_stand();}; +void() dfury_standC11 =[ $standC11, dfury_standC12 ] {ai_stand();}; +void() dfury_standC12 =[ $standC12, dfury_standC13 ] {ai_stand();}; +void() dfury_standC13 =[ $standC13, dfury_standC14 ] {ai_stand();}; +void() dfury_standC14 =[ $standC14, dfury_standC15 ] {ai_stand();}; +void() dfury_standC15 =[ $standC15, dfury_standC16 ] {ai_stand();}; +void() dfury_standC16 =[ $standC16, dfury_standC17 ] {ai_stand();}; +void() dfury_standC17 =[ $standC17, dfury_standC18 ] {ai_stand();}; +void() dfury_standC18 =[ $standC18, dfury_standC19 ] {ai_stand();}; +void() dfury_standC19 =[ $standC19, dfury_standC20 ] {ai_stand();}; +void() dfury_standC20 =[ $standC20, dfury_standL1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standRL1 =[ $standRL1, dfury_standRL2 ] {ai_stand();}; +void() dfury_standRL2 =[ $standRL2, dfury_standRL3 ] {ai_stand();}; +void() dfury_standRL3 =[ $standRL3, dfury_standRL4 ] {ai_stand();}; +void() dfury_standRL4 =[ $standRL4, dfury_standRL5 ] {ai_stand();}; +void() dfury_standRL5 =[ $standRL5, dfury_standRL6 ] {ai_stand();}; +void() dfury_standRL6 =[ $standRL6, dfury_standRL7 ] {ai_stand();}; +void() dfury_standRL7 =[ $standRL7, dfury_standL1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standR1 =[ $standR1, dfury_standR2 ] {monster_idle_sound(); + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) + self.think = dfury_standRL1; // Switch weapon stance + ai_stand(); +}; +void() dfury_standR2 =[ $standR2, dfury_standR3 ] {ai_stand();}; +void() dfury_standR3 =[ $standR3, dfury_standR4 ] {ai_stand();}; +void() dfury_standR4 =[ $standR4, dfury_standR5 ] {ai_stand();}; +void() dfury_standR5 =[ $standR5, dfury_standR6 ] {ai_stand();}; +void() dfury_standR6 =[ $standR6, dfury_standR7 ] {monster_idle_sound(); ai_stand();}; +void() dfury_standR7 =[ $standR7, dfury_standR8 ] {ai_stand();}; +void() dfury_standR8 =[ $standR8, dfury_standR9 ] {ai_stand();}; +void() dfury_standR9 =[ $standR9, dfury_standR10 ] {ai_stand();}; +void() dfury_standR10=[ $standR10, dfury_standR11 ] {ai_stand();}; +void() dfury_standR11=[ $standR11, dfury_standR12 ] {ai_stand();}; +void() dfury_standR12=[ $standR12, dfury_standR1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standLR1 =[ $standLR1, dfury_standLR2 ] {ai_stand();}; +void() dfury_standLR2 =[ $standLR2, dfury_standLR3 ] {ai_stand();}; +void() dfury_standLR3 =[ $standLR3, dfury_standLR4 ] {ai_stand();}; +void() dfury_standLR4 =[ $standLR4, dfury_standLR5 ] {ai_stand();}; +void() dfury_standLR5 =[ $standLR5, dfury_standLR6 ] {ai_stand();}; +void() dfury_standLR6 =[ $standLR6, dfury_standLR7 ] {ai_stand();}; +void() dfury_standLR7 =[ $standLR7, dfury_standR1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() dfury_standL1 =[ $standL1, dfury_standL2 ] {monster_idle_sound(); + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) { + // Slow down the repeating of idle animations + self.weaponswitch = time + 1 + random()*3; + self.idlebusy = TRUE; + + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + + if (self.lip < 2) self.think = dfury_standC1; // Look at weapon + else if (self.lip == 2) self.think = dfury_standB1; // Look around + else self.think = dfury_standLR1; // Switch weapon stance + } + ai_stand(); +}; +void() dfury_standL2 =[ $standL2, dfury_standL3 ] {ai_stand();}; +void() dfury_standL3 =[ $standL3, dfury_standL4 ] {ai_stand();}; +void() dfury_standL4 =[ $standL4, dfury_standL5 ] {ai_stand();}; +void() dfury_standL5 =[ $standL5, dfury_standL6 ] {ai_stand();}; +void() dfury_standL6 =[ $standL6, dfury_standL7 ] {ai_stand();}; +void() dfury_standL7 =[ $standL7, dfury_standL8 ] {ai_stand();}; +void() dfury_standL8 =[ $standL8, dfury_standL9 ] {ai_stand();}; +void() dfury_standL9 =[ $standL9, dfury_standL10 ] {ai_stand();}; +void() dfury_standL10=[ $standL10, dfury_standL11 ] {ai_stand();}; +void() dfury_standL11=[ $standL11, dfury_standL12 ] {ai_stand();}; +void() dfury_standL12=[ $standL12, dfury_standL1 ] {ai_stand();}; + +//=========================================================================== +void() dfury_walk1 =[ $walk1, dfury_walk2 ] { monster_idle_sound(); + self.idlebusy = FALSE; ai_walk(2);}; +void() dfury_walk2 =[ $walk2, dfury_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dfury_walk3 =[ $walk3, dfury_walk4 ] {ai_walk(5);}; +void() dfury_walk4 =[ $walk4, dfury_walk5 ] {ai_walk(4);}; +void() dfury_walk5 =[ $walk5, dfury_walk6 ] {ai_walk(4);}; +void() dfury_walk6 =[ $walk6, dfury_walk7 ] {ai_walk(2);}; +void() dfury_walk7 =[ $walk7, dfury_walk8 ] {ai_walk(2);}; +void() dfury_walk8 =[ $walk8, dfury_walk9 ] {monster_footstep(FALSE); ai_walk(3);}; +void() dfury_walk9 =[ $walk9, dfury_walk10] {ai_walk(3);}; +void() dfury_walk10=[ $walk10, dfury_walk11] {ai_walk(4);}; +void() dfury_walk11=[ $walk11, dfury_walk12] {ai_walk(3);}; +void() dfury_walk12=[ $walk12, dfury_walk13] {ai_walk(4);}; +void() dfury_walk13=[ $walk13, dfury_walk14] {ai_walk(6);}; +void() dfury_walk14=[ $walk14, dfury_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// 6 frames instead of 8 frames (skipping 3rd/7th timing of original) +void() dfury_run1 =[ $run1, dfury_run2 ] {monster_idle_sound(); + self.idlebusy = FALSE;ai_run (22); }; +void() dfury_run2 =[ $run2, dfury_run3 ] {monster_footstep(FALSE); ai_run(27);}; +void() dfury_run3 =[ $run3, dfury_run4 ] {ai_run(18);}; +void() dfury_run4 =[ $run4, dfury_run5 ] {ai_run(16);}; +void() dfury_run5 =[ $run5, dfury_run6 ] {monster_footstep(FALSE); ai_run(27);}; +void() dfury_run6 =[ $run6, dfury_run1 ] {ai_run(15);}; + +//=========================================================================== +// Melee Attack 1 - Slice (bring swords together and pull apart) +void() dfury_slice1 =[ $slice2, dfury_slice2 ] {dfury_grunt_sound(DFURY_SOUND_PULLAPART);ai_charge(9);}; +void() dfury_slice2 =[ $slice3, dfury_slice3 ] {ai_charge(10); dfury_sword_sound();}; +void() dfury_slice3 =[ $slice4, dfury_slice4 ] {ai_charge(17);}; +void() dfury_slice4 =[ $slice5, dfury_slice5 ] {monster_footstep(FALSE); ai_charge(4);}; +void() dfury_slice5 =[ $slice6, dfury_slice6 ] {ai_charge(11); dfury_sword_sound(); ai_melee();}; +void() dfury_slice6 =[ $slice7, dfury_slice7 ] {ai_charge(19); ai_melee();}; +void() dfury_slice7 =[ $slice8, dfury_slice8 ] {ai_charge(12); ai_melee();}; +void() dfury_slice8 =[ $slice9, dfury_slice9 ] {ai_charge(6); ai_melee();}; +void() dfury_slice9 =[ $slice11, dfury_slice10 ] {monster_footstep(FALSE); ai_melee();}; +void() dfury_slice10 =[ $slice13, dfury_slice11 ] {ai_charge(0);}; +void() dfury_slice11 =[ $slice14, dfury_run1 ] {monster_footstep(FALSE); ai_charge(7);}; + +//---------------------------------------------------------------------- +// Melee Attack 2 - Smash (both swords chop overhead to ground) +void() dfury_smash1 =[ $smash2, dfury_smash2 ] {ai_charge(1);}; +void() dfury_smash2 =[ $smash3, dfury_smash3 ] {ai_charge(13);}; +void() dfury_smash3 =[ $smash4, dfury_smash4 ] {ai_charge(9); monster_footstep(FALSE);}; +void() dfury_smash4 =[ $smash5, dfury_smash5 ] {ai_charge(11);}; +void() dfury_smash5 =[ $smash6, dfury_smash6 ] {dfury_grunt_sound(DFURY_SOUND_OVERSMASH);ai_charge(10);}; +void() dfury_smash6 =[ $smash7, dfury_smash7 ] {ai_charge(7); dfury_sword_sound();}; +void() dfury_smash7 =[ $smash8, dfury_smash8 ] {ai_charge(12); monster_footstep(FALSE);}; +void() dfury_smash8 =[ $smash9, dfury_smash9 ] {ai_charge(2);self.meleecontact = TRUE; ai_meleesmash(40);}; +void() dfury_smash9 =[ $smash10, dfury_smash10 ] {ai_charge(3); ai_melee();self.meleecontact = FALSE;}; +void() dfury_smash10 =[ $smash12, dfury_smash11 ] {ai_charge(0);}; +void() dfury_smash11 =[ $smash13, dfury_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +// Melee Attack 4a - Single Right Swing (fast attack) +void() dfury_lswing3; +void() dfury_rswing1 =[ $rswing2, dfury_rswing3 ] {ai_charge(2);}; +void() dfury_rswing3 =[ $rswing3, dfury_rswing4 ] {dfury_grunt_sound(DFURY_SOUND_LRFURY);ai_charge(5);}; +void() dfury_rswing4 =[ $rswing4, dfury_rswing5 ] {ai_charge(8);ai_melee();monster_footstep(FALSE);}; +void() dfury_rswing5 =[ $rswing5, dfury_rswing6 ] {ai_charge(7);ai_melee();}; +void() dfury_rswing6 =[ $rswing6, dfury_rswing7 ] {ai_charge(5);ai_melee(); dfury_sword_sound();}; +void() dfury_rswing7 =[ $rswing7, dfury_rswing8 ] {ai_charge(2);monster_footstep(FALSE);}; +void() dfury_rswing8 =[ $rswing8, dfury_run1 ] {ai_charge(1); + if (ai_checkmelee(MONAI_MELEEFRONT) && self.enemy.health > 0) self.think = dfury_lswing3; +}; + +//---------------------------------------------------------------------- +// Melee Attack 4a - Single Right Swing (fast attack) +void() dfury_lswing1 =[ $lswing2, dfury_lswing3 ] {ai_charge(2);}; +void() dfury_lswing3 =[ $lswing3, dfury_lswing4 ] {dfury_grunt_sound(DFURY_SOUND_OPTIONAL);ai_charge(5);}; +void() dfury_lswing4 =[ $lswing4, dfury_lswing5 ] {ai_charge(8);ai_melee();monster_footstep(FALSE);}; +void() dfury_lswing5 =[ $lswing5, dfury_lswing6 ] {ai_charge(7);ai_melee();}; +void() dfury_lswing6 =[ $lswing6, dfury_lswing7 ] {ai_charge(5);ai_melee(); dfury_sword_sound();}; +void() dfury_lswing7 =[ $lswing7, dfury_lswing8 ] {ai_charge(2);monster_footstep(FALSE);}; +void() dfury_lswing8 =[ $lswing8, dfury_run1 ] {ai_charge(1); + if (ai_checkmelee(MONAI_MELEEFRONT) && self.enemy.health > 0) self.think = dfury_rswing3; +}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - Lunge forward (leaving ground) and do heavy damage +void() dfury_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(30); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the fury knight floating in the air? + if (!checkbottom(self)) { + // Is the fury knight standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() dfury_lunge1 =[ $lunge1, dfury_lunge2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPFURYTIME; + dfury_grunt_sound(DFURY_SOUND_JUMP); +}; +void() dfury_lunge2 =[ $lunge2, dfury_lunge3 ] {ai_face();}; +void() dfury_lunge3 =[ $lunge3, dfury_lunge4 ] {ai_face();}; +void() dfury_lunge4 =[ $lunge4, dfury_lunge5 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPFURYTIME; + self.touch = dfury_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 500 + '0 0 250'; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +void() dfury_lunge5 =[ $lunge5, dfury_lunge6 ] {}; +void() dfury_lunge6 =[ $lunge6, dfury_lunge7 ] {}; +void() dfury_lunge7 =[ $lunge7, dfury_lunge8 ] {}; +void() dfury_lunge8 =[ $lunge8, dfury_lunge8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = dfury_lunge4; // Keep jumping + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +// Landed with thrush attack +void() dfury_lunge9 =[ $lunge9, dfury_lunge10 ] {ai_melee();}; +void() dfury_lunge10 =[ $lunge10, dfury_lunge11 ] {ai_charge(5);ai_melee();}; +void() dfury_lunge11 =[ $lunge11, dfury_lunge12 ] {ai_charge(4);ai_melee();dfury_sword_sound();}; +void() dfury_lunge12 =[ $lunge12, dfury_lunge13 ] {ai_charge(1);ai_melee();}; +void() dfury_lunge13 =[ $lunge13, dfury_lunge14 ] {ai_charge(1);ai_melee();monster_footstep(FALSE);}; +void() dfury_lunge14 =[ $lunge14, dfury_lunge15 ] {ai_charge(1);}; +void() dfury_lunge15 =[ $lunge15, dfury_run1 ] {ai_resetangles(); + // If close enough starting swinging left+right ELSE return to run cycle + if (ai_checkmelee(MONAI_MELEEFRONT) && self.enemy.health > 0) self.think = dfury_rswing3; +}; + +//---------------------------------------------------------------------- +// Melee Attack 5 - W_Attack (two handed slashing attack) +// Identical frame set (Hell Knight / Death Knight) +// Speed boost (+16 charge) to all frames, fast charging attack! + +void() dfury_watk1 =[ $w_attack2, dfury_watk3 ] {ai_charge(18);monster_footstep(FALSE);}; +void() dfury_watk3 =[ $w_attack3, dfury_watk4 ] {ai_charge(18);}; +void() dfury_watk4 =[ $w_attack4, dfury_watk5 ] {ai_charge(18);}; +void() dfury_watk5 =[ $w_attack5, dfury_watk6 ] {ai_charge(18);dfury_grunt_sound(DFURY_SOUND_RUNSWING);}; +void() dfury_watk6 =[ $w_attack6, dfury_watk7 ] {ai_charge(18);}; +void() dfury_watk7 =[ $w_attack7, dfury_watk8 ] {ai_charge(19);monster_footstep(FALSE);}; +void() dfury_watk8 =[ $w_attack8, dfury_watk9 ] {ai_charge(22);dfury_sword_sound();ai_melee();}; +void() dfury_watk9 =[ $w_attack9, dfury_watk10] {ai_charge(23);ai_melee(); }; +void() dfury_watk10=[ $w_attack10,dfury_watk11] {ai_charge(21); ai_melee();}; +void() dfury_watk11=[ $w_attack11,dfury_watk12] {ai_charge(19);}; +void() dfury_watk12=[ $w_attack12,dfury_watk13] {ai_charge(19);}; +void() dfury_watk13=[ $w_attack13,dfury_watk14] {ai_charge(18);}; +void() dfury_watk14=[ $w_attack14,dfury_watk15] {ai_charge(18);dfury_grunt_sound(DFURY_SOUND_OPTIONAL);}; +void() dfury_watk15=[ $w_attack15,dfury_watk16] {ai_charge(18);}; +void() dfury_watk16=[ $w_attack16,dfury_watk17] {ai_charge(19);dfury_sword_sound();ai_melee();}; +void() dfury_watk17=[ $w_attack17,dfury_watk18] {ai_charge(19); monster_footstep(FALSE); ai_melee();}; +void() dfury_watk18=[ $w_attack18,dfury_watk19] {ai_charge(21); ai_melee();}; +void() dfury_watk19=[ $w_attack19,dfury_watk20] {ai_charge(22);}; +void() dfury_watk20=[ $w_attack20,dfury_watk21] {ai_charge(24);}; +void() dfury_watk21=[ $w_attack21,dfury_watk22] {ai_charge(25);}; +void() dfury_watk22=[ $w_attack22,dfury_run1 ] {ai_charge(21); + // this is a long animations set for chasing the player + // Quick check if within melee range, close melee range or random magic attack! + if (self.enemy.health > 0) { + if (ai_checkmelee(MONAI_MELEEFRONT)) self.think = dfury_rswing3; + else if (ai_checkmelee(MONAI_JUMPFURYNEAR)) self.think = dfury_slice1; + else if (random() < 0.3) self.think = dfury_magic; + } +}; + +//---------------------------------------------------------------------- +void() dfury_melee = +{ + // Use heavy overhead smash for monsters + if (self.enemy.flags & FL_MONSTER) dfury_smash1(); + else { + // Make sure next attack is different to previous (randomly while loop) + self.lip = self.meleeattack; + while (self.lip == self.meleeattack) { self.lip = rint(random()*2); } + self.meleeattack = self.lip; + if (self.meleeattack == 0) dfury_lswing1(); // Quick left + else if (self.meleeattack == 1) dfury_rswing1(); // Quick right + else dfury_smash1(); // Overhead smash + } +}; + +//=========================================================================== +// Magic attacks (glowing swords) +//=========================================================================== +// Magic Attack A - Spray of spikes from raised up swords +//---------------------------------------------------------------------- +void(float offset) dfury_magica_shot = +{ + local float shotcount; + local vector soffset, dir, offang; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Single sound per volley of bullets + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + // Randomize quantity each time called + if (random() < 0.5) shotcount = 2; + else shotcount = 3; + + // based angle of projectiles on straight line between source and target + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 6; // Arc offset + makevectors (offang); + + while (shotcount > 0) { + // Randomly spawn projectiles up and down sword length + soffset = v_forward * 20 + v_up * random() * 20; + + // Double check that missile is not blocked by any world geo + if (!visxray(self.enemy, soffset, '0 0 0', TRUE)) soffset = soffset + '0 0 24'; + soffset = self.origin + soffset; + + // Straight line velocity from source to target + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; // Slight wiggle up/down + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_DFURYSPIKE + (skill * SPEED_DFURYSKILL) + random()*10; + launch_projectile (soffset, dir, CT_PROJ_FURY2, self.attack_speed); + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +// Magic Attack B - 3 x rockets launched in an arc +//---------------------------------------------------------------------- +void() dfury_magicb_shot = +{ + local float offset, shotcount; + local vector soffset, dir, offang, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Single sound for all rockets fired + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + // create an arc of rockets fanning outwards from source + offset = -4; shotcount = 3; + while (shotcount > 0) { + // based angle of projectiles on straight line between source and target + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset; + makevectors (offang); + + // Randomly spawn projectiles around central point + soffset = v_forward * 20 + v_up * (5 + random() * 10); + + // Double check that missile is not blocked by any world geo + if (!visxray(self.enemy, soffset, '0 0 0', TRUE)) soffset = soffset + '0 0 24'; + soffset = self.origin + soffset; + + // Straight line velocity from source to target + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; // Slight wiggle up/down + avel = vecrand(100,200,FALSE); + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_DFURYSPIKE + (skill * SPEED_DFURYSKILL) + random()*10; + Launch_Missile (soffset, dir, avel, CT_PROJ_FURY1, self.attack_speed ); + offset = offset + 4; + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +void() dfury_attachment_finish = +{ + if (self.state) { + self.state = FALSE; + self.alpha = 0.1; + setmodel(self, ""); + } +}; + +//---------------------------------------------------------------------- +void(float skincolor) dfury_attachment_setup = +{ + if (self.attachment && !self.attachment.state) { + self.attachment.state = TRUE; + setmodel(self.attachment, self.weaponglow); + self.attachment.alpha = 0.1; + self.attachment.skin = skincolor; + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.nextthink = time + 0.15; + self.attachment.think = dfury_attachment_finish; + } +}; + +//---------------------------------------------------------------------- +void() dfury_attachment_update = +{ + if (self.attachment && self.attachment.state) { + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = self.frame; + self.attachment.alpha = 0.3 + random()*0.7; + self.attachment.nextthink = time + 0.15; + self.attachment.think = dfury_attachment_finish; + } +}; + +//---------------------------------------------------------------------- +// Magic Attack A - Spray of spikes from raised up swords +// Block pain function from interrupting magic attack +void() dfury_magica1 =[ $magica2, dfury_magica2 ] {ai_face();self.pain_finished = time + 2;}; +void() dfury_magica2 =[ $magica3, dfury_magica3 ] {ai_face();}; +void() dfury_magica3 =[ $magica4, dfury_magica4 ] {ai_face();}; +void() dfury_magica4 =[ $magica5, dfury_magica5 ] {ai_face();}; +void() dfury_magica5 =[ $magica6, dfury_magica6 ] {ai_charge(2);dfury_attachment_setup(0);}; +void() dfury_magica6 =[ $magica7, dfury_magica7 ] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica7 =[ $magica8, dfury_magica8 ] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica8 =[ $magica9, dfury_magica9 ] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica9 =[ $magica10, dfury_magica10] {ai_charge(2);dfury_attachment_update();}; +void() dfury_magica10 =[ $magica11, dfury_magica11] {dfury_attachment_update();dfury_magica_shot(-3);}; +void() dfury_magica11 =[ $magica12, dfury_magica12] {dfury_attachment_update();dfury_magica_shot(-1);}; +void() dfury_magica12 =[ $magica13, dfury_magica13] {dfury_attachment_update();dfury_magica_shot(0);}; +void() dfury_magica13 =[ $magica14, dfury_magica14] {dfury_attachment_update();dfury_magica_shot(1);}; +void() dfury_magica14 =[ $magica15, dfury_magica15] {dfury_attachment_update();dfury_magica_shot(2);}; +void() dfury_magica15 =[ $magica16, dfury_run1] {}; + +//---------------------------------------------------------------------- +// Magic Attack B - 3 x rockets launched in an arc +// Block pain function from interrupting magic attack +void() dfury_magicb1 =[ $magicb1, dfury_magicb2 ] {self.pain_finished = time + 2;}; +void() dfury_magicb2 =[ $magicb2, dfury_magicb3 ] {ai_face();dfury_attachment_setup(1);}; +void() dfury_magicb3 =[ $magicb3, dfury_magicb4 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb4 =[ $magicb4, dfury_magicb5 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb5 =[ $magicb5, dfury_magicb6 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb6 =[ $magicb6, dfury_magicb7 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb7 =[ $magicb7, dfury_magicb8 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb8 =[ $magicb8, dfury_magicb9 ] {ai_face();dfury_attachment_update();}; +void() dfury_magicb9 =[ $magicb9, dfury_magicb10] {ai_face();dfury_attachment_update();dfury_magicb_shot();}; +void() dfury_magicb10 =[ $magicb10, dfury_magicb11] {dfury_attachment_update();}; +void() dfury_magicb11 =[ $magicb11, dfury_magicb12] {}; +void() dfury_magicb12 =[ $magicb12, dfury_magicb13] {}; +void() dfury_magicb13 =[ $magica13, dfury_run1] {}; + +//---------------------------------------------------------------------- +// MagicB is explosive so only use if there is range available +// Otherwise randomly pick between the two types (spikes/rockets) +//---------------------------------------------------------------------- +void() dfury_magic = +{ + SUB_AttackFinished (2 + random()); + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_JUMPFURYNEAR) dfury_magica1(); + else { + if (random() < 0.2) dfury_magica1(); + else dfury_magicb1(); + } +}; + +//============================================================================ +void() dfury_painA1 =[ $painA1, dfury_painA2 ] {}; +void() dfury_painA2 =[ $painA2, dfury_painA3 ] {}; +void() dfury_painA3 =[ $painA3, dfury_painA4 ] {}; +void() dfury_painA4 =[ $painA4, dfury_painA5 ] {}; +void() dfury_painA5 =[ $painA5, dfury_run1 ] {}; + +//---------------------------------------------------------------------- +void() dfury_painD1 =[ $painD1, dfury_painD2 ] {}; +void() dfury_painD2 =[ $painD2, dfury_painD3 ] {}; +void() dfury_painD3 =[ $painD3, dfury_painD4 ] {}; +void() dfury_painD4 =[ $painD4, dfury_painD5 ] {monster_footstep(FALSE); }; +void() dfury_painD5 =[ $painD5, dfury_painD6 ] {}; +void() dfury_painD6 =[ $painD6, dfury_painD7 ] {}; +void() dfury_painD7 =[ $painD7, dfury_painD8 ] {}; +void() dfury_painD8 =[ $painD8, dfury_painD9 ] {monster_footstep(FALSE); }; +void() dfury_painD9 =[ $painD9, dfury_painD10 ] {}; +void() dfury_painD10 =[ $painD10, dfury_painD11 ] {}; +void() dfury_painD11 =[ $painD11, dfury_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dfury_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.9) dfury_painA1 (); // classic, body recoil + else { + dfury_painD1 (); // Cool stumble + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dfury_painD1 (); + } + } +}; + +//============================================================================ +void() dfury_die1 =[ $death2, dfury_die2 ] {ai_forward(10);}; +void() dfury_die2 =[ $death3, dfury_die3 ] {monster_check_gib();ai_forward(8);}; +void() dfury_die3 =[ $death4, dfury_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dfury_die4 =[ $death5, dfury_die5 ] {}; +void() dfury_die5 =[ $death6, dfury_die6 ] {}; +void() dfury_die6 =[ $death7, dfury_die7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dfury_die7 =[ $death8, dfury_die8 ] {}; +void() dfury_die8 =[ $death9, dfury_die9 ] {ai_forward(10);}; +void() dfury_die9 =[ $death10, dfury_die10 ] {ai_forward(11);}; +void() dfury_die10 =[ $death11, dfury_die11 ] {}; +void() dfury_die11 =[ $death12, dfury_die12 ] {}; +void() dfury_die12 =[ $death13, dfury_die13 ] {}; +void() dfury_die13 =[ $death14, dfury_die14 ] {}; +void() dfury_die14 =[ $death15, dfury_die15 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dfury_die15 =[ $death16, dfury_die16 ] {monster_death_postcheck();}; +void() dfury_die16 =[ $death17, dfury_die16 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dfury_dieb1 =[ $deathb1, dfury_dieb2 ] {}; +void() dfury_dieb2 =[ $deathb2, dfury_dieb3 ] {monster_check_gib();}; +void() dfury_dieb3 =[ $deathb3, dfury_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dfury_dieb4 =[ $deathb4, dfury_dieb5 ] {}; +void() dfury_dieb5 =[ $deathb5, dfury_dieb6 ] {}; +void() dfury_dieb6 =[ $deathb6, dfury_dieb7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dfury_dieb7 =[ $deathb7, dfury_dieb8 ] {}; +void() dfury_dieb8 =[ $deathb8, dfury_dieb9 ] {}; +void() dfury_dieb9 =[ $deathb9, dfury_dieb10] {}; +void() dfury_dieb10=[ $deathb10, dfury_dieb11] {}; +void() dfury_dieb11=[ $deathb11, dfury_dieb12] {}; +void() dfury_dieb12=[ $deathb12, dfury_dieb13] {}; +void() dfury_dieb13=[ $deathb13, dfury_dieb14] {monster_death_postcheck();}; +void() dfury_dieb14=[ $deathb14, dfury_dieb14] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dfury_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) dfury_die1 (); + else dfury_dieb1 (); + } +}; + +//============================================================================ +void() dfury_sword_sound = +{ + self.weaponstate = random(); + if (self.weaponstate < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.weaponstate < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.weaponstate < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +//============================================================================ +void(float soundtype) dfury_grunt_sound = +{ + if (soundtype == DFURY_SOUND_PULLAPART) + sound (self, CHAN_WEAPON, "dknight/dfury_grunt3.wav", 1, ATTN_NORM); + else if (soundtype == DFURY_SOUND_OVERSMASH) + sound (self, CHAN_WEAPON, "dknight/dfury_grunt4.wav", 1, ATTN_NORM); + else if (soundtype == DFURY_SOUND_JUMP) + sound (self, CHAN_WEAPON, "dknight/dfury_leap.wav", 1, ATTN_NORM); + else { + if (soundtype == DFURY_SOUND_OPTIONAL && random() < 0.8) return; + self.weaponstate = random(); + self.weaponswitch = 0.6 + random()*0.4; + if (self.weaponstate < 0.25) sound (self, CHAN_WEAPON, "dknight/dfury_grunt1.wav", self.weaponswitch, ATTN_NORM); + else if (self.weaponstate < 0.5) sound (self, CHAN_WEAPON, "dknight/dfury_grunt2.wav", self.weaponswitch, ATTN_NORM); + else if (self.weaponstate < 0.75) sound (self, CHAN_WEAPON, "dknight/dfury_grunt3.wav", self.weaponswitch, ATTN_NORM); + else sound (self, CHAN_WEAPON, "dknight/dfury_grunt4.wav", self.weaponswitch, ATTN_NORM); + } +}; + +/*====================================================================== +QUAKED monster_dfury (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dfury = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_dfury.mdl"; + self.headmdl = "progs/ad171/h_dfury.mdl"; + self.weaponglow = "progs/ad171/mon_dfury_glow.mdl"; + self.gib1mdl = "progs/ad171/w_dfurysword1.mdl"; // Unique sword L + self.gib2mdl = "progs/ad171/w_dfurysword2.mdl"; // Unique sword R + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.weaponglow); // Glowing magical swords + precache_model (MODEL_PROJ_FURY1); // Vore spike ball with smoke trail + precache_model (MODEL_PROJ_FURY2); // Wizard spit with smoke trail + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib3skin = 2; + self.gib1sound = self.gib2sound = GIB_IMPACT_METALA; + + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + precache_sound ("hknight/death1.wav"); + self.pain_sound = "hknight/pain1.wav"; + precache_sound (self.pain_sound); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + // Double sword swipe (like death knight++) + self.sight_sound = "dknight/dfury_sight.wav"; + precache_sound (self.sight_sound); + + // Heavy thud sound + self.meleehitsound = GIB_SOUND_HEAVY2; + precache_sound (self.meleehitsound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // New grunt sounds during combat + precache_sound ("dknight/dfury_grunt1.wav"); + precache_sound ("dknight/dfury_grunt2.wav"); + precache_sound ("dknight/dfury_grunt3.wav"); + precache_sound ("dknight/dfury_grunt4.wav"); + precache_sound ("dknight/dfury_leap.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_SHALGRN); // Green voreball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 400; + self.gibhealth = -50; + self.gibbed = FALSE; + self.pain_flinch = 80; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // High pain level + if (!self.infightextra) self.infightextra = 2; // 2x infighting dmg + self.steptype = FS_TYPEMEDIUM; + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEFRONT; // Smash attack + self.meleeoffset = '24 0 16'; // Jump attack offset + self.attack_offset = '20 0 10'; // Average of both attacks + if (self.deathstring == "") self.deathstring = " was sliced by a Fury Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DFuryCheckAttack; + self.th_stand = dfury_standL1; + self.th_walk = dfury_walk1; + self.th_run = dfury_run1; + self.th_melee = dfury_melee; + self.th_missile = dfury_magic; + self.th_pain = dfury_pain; + self.th_die = dfury_die; + self.th_jump = dfury_lunge1; + self.th_jumpexit = dfury_lunge9; + self.th_charge = dfury_watk1; + self.th_slide = dfury_slice1; + self.hittype = HIT_METAL; + + self.meleeattack = rint(random()*5); + self.weaponswitch = time + 5; + + self.classtype = CT_MONDFURY; + self.classgroup = CG_DCAPTAIN; + self.classmove = MON_MOVEWALK; + + // Setup magic glowing sword effect + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setorigin(self.attachment, self.origin); + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_dguard.qc b/QC_other/QC_keep/mon_dguard.qc new file mode 100644 index 00000000..1a45cd92 --- /dev/null +++ b/QC_other/QC_keep/mon_dguard.qc @@ -0,0 +1,537 @@ +/*============================================================================== +DEATH GUARD (low health) +==============================================================================*/ +$cd id1/models/dguard +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// (013 - 024) Stand idle - Shoulder hunch +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 + +// (025 - 048) Stand idle - Quick look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 + +// (049 - 072) Stand idle - checking sword +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 + +// (073 - 095) Stand idle - poke sword at the ground +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 standD21 standD22 standD23 + +// (096 - 109) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (110 - 115) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (116 - 130) Slice (one hand slashing run attack) (file=swing) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 slice15 + +// (131 - 145) Smash (chop overhead to ground) (file=chop) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (146 - 167) W_Attack (two handed slashing attack) (file=slash) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 + +// Pain animations A = Slow (168 - 172), D = Stagger (173 - 183) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (184 - 195) Charging attack A - swinging sword left to right infront (file=char) +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 + +// (196 - 207) Death FORWARD +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 deathA11 deathA12 + +// (208 - 227) Death BACKWARD - with cool sword wobble +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 deathB15 deathB16 +$frame deathB17 deathB18 deathB19 deathB20 + +// (228 - 241) Death FORWARD - more dramatic, platoon like +$frame deathC1 deathC2 deathC3 deathC4 deathC5 deathC6 deathC7 deathC8 +$frame deathC9 deathC10 deathC11 deathC12 deathC13 deathC14 + +// (242 - 256) Death SIDEWAYS - Similiar to original knights +$frame deathD1 deathD2 deathD3 deathD4 deathD5 deathD6 deathD7 deathD8 +$frame deathD9 deathD10 deathD11 deathD12 deathD13 deathD14 deathD15 + +void() dguard_sword_sound; + +//=========================================================================== +void() dguard_standA1 =[ $standA1, dguard_standA2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standA2 =[ $standA2, dguard_standA3 ] {ai_stand();}; +void() dguard_standA3 =[ $standA3, dguard_standA4 ] {ai_stand();}; +void() dguard_standA4 =[ $standA4, dguard_standA5 ] {ai_stand();}; +void() dguard_standA5 =[ $standA5, dguard_standA6 ] {ai_stand();}; +void() dguard_standA6 =[ $standA6, dguard_standA7 ] {ai_stand();}; +void() dguard_standA7 =[ $standA7, dguard_standA8 ] {ai_stand();}; +void() dguard_standA8 =[ $standA8, dguard_standA9 ] {ai_stand();}; +void() dguard_standA9 =[ $standA9, dguard_standA10 ] {ai_stand();}; +void() dguard_standA10 =[ $standA10, dguard_standA11 ] {ai_stand();}; +void() dguard_standA11 =[ $standA11, dguard_standA12 ] {ai_stand();}; +void() dguard_standA12 =[ $standA12, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_standB1 =[ $standB1, dguard_standB2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standB2 =[ $standB2, dguard_standB3 ] {ai_stand();}; +void() dguard_standB3 =[ $standB3, dguard_standB4 ] {ai_stand();}; +void() dguard_standB4 =[ $standB4, dguard_standB5 ] {ai_stand();}; +void() dguard_standB5 =[ $standB5, dguard_standB6 ] {ai_stand();}; +void() dguard_standB6 =[ $standB6, dguard_standB7 ] {ai_stand();}; +void() dguard_standB7 =[ $standB7, dguard_standB8 ] {ai_stand();}; +void() dguard_standB8 =[ $standB8, dguard_standB9 ] {ai_stand();}; +void() dguard_standB9 =[ $standB9, dguard_standB10 ] {ai_stand();}; +void() dguard_standB10 =[ $standB10, dguard_standB11 ] {ai_stand();}; +void() dguard_standB11 =[ $standB11, dguard_standB12 ] {ai_stand();}; +void() dguard_standB12 =[ $standB12, dguard_standB13 ] {ai_stand();}; +void() dguard_standB13 =[ $standB13, dguard_standB14 ] {ai_stand();}; +void() dguard_standB14 =[ $standB14, dguard_standB15 ] {ai_stand();}; +void() dguard_standB15 =[ $standB15, dguard_standB16 ] {ai_stand();}; +void() dguard_standB16 =[ $standB16, dguard_standB17 ] {ai_stand();}; +void() dguard_standB17 =[ $standB17, dguard_standB18 ] {ai_stand();}; +void() dguard_standB18 =[ $standB18, dguard_standB19 ] {ai_stand();}; +void() dguard_standB19 =[ $standB19, dguard_standB20 ] {ai_stand();}; +void() dguard_standB20 =[ $standB20, dguard_standB21 ] {ai_stand();}; +void() dguard_standB21 =[ $standB21, dguard_standB22 ] {ai_stand();}; +void() dguard_standB22 =[ $standB22, dguard_standB23 ] {ai_stand();}; +void() dguard_standB23 =[ $standB23, dguard_standB24 ] {ai_stand();}; +void() dguard_standB24 =[ $standB24, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_standC1 =[ $standC1, dguard_standC2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standC2 =[ $standC2, dguard_standC3 ] {ai_stand();}; +void() dguard_standC3 =[ $standC3, dguard_standC4 ] {ai_stand();}; +void() dguard_standC4 =[ $standC4, dguard_standC5 ] {ai_stand();}; +void() dguard_standC5 =[ $standC5, dguard_standC6 ] {ai_stand();}; +void() dguard_standC6 =[ $standC6, dguard_standC7 ] {ai_stand();}; +void() dguard_standC7 =[ $standC7, dguard_standC8 ] {ai_stand();}; +void() dguard_standC8 =[ $standC8, dguard_standC9 ] {ai_stand();}; +void() dguard_standC9 =[ $standC9, dguard_standC10 ] {ai_stand();}; +void() dguard_standC10 =[ $standC10, dguard_standC11 ] {ai_stand();}; +void() dguard_standC11 =[ $standC11, dguard_standC12 ] {ai_stand();}; +void() dguard_standC12 =[ $standC12, dguard_standC13 ] {ai_stand();}; +void() dguard_standC13 =[ $standC13, dguard_standC14 ] {ai_stand();}; +void() dguard_standC14 =[ $standC14, dguard_standC15 ] {ai_stand();}; +void() dguard_standC15 =[ $standC15, dguard_standC16 ] {ai_stand();}; +void() dguard_standC16 =[ $standC16, dguard_standC17 ] {ai_stand();}; +void() dguard_standC17 =[ $standC17, dguard_standC18 ] {ai_stand();}; +void() dguard_standC18 =[ $standC18, dguard_standC19 ] {ai_stand();}; +void() dguard_standC19 =[ $standC19, dguard_standC20 ] {ai_stand();}; +void() dguard_standC20 =[ $standC20, dguard_standC21 ] {ai_stand();}; +void() dguard_standC21 =[ $standC21, dguard_standC22 ] {ai_stand();}; +void() dguard_standC22 =[ $standC22, dguard_standC23 ] {ai_stand();}; +void() dguard_standC23 =[ $standC23, dguard_standC24 ] {ai_stand();}; +void() dguard_standC24 =[ $standC24, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_standD1 =[ $standD1, dguard_standD2 ] { + self.idlebusy = TRUE; ai_stand();}; +void() dguard_standD2 =[ $standD2, dguard_standD3 ] {ai_stand();}; +void() dguard_standD3 =[ $standD3, dguard_standD4 ] {ai_stand();}; +void() dguard_standD4 =[ $standD4, dguard_standD5 ] {ai_stand();}; +void() dguard_standD5 =[ $standD5, dguard_standD6 ] {ai_stand();}; +void() dguard_standD6 =[ $standD6, dguard_standD7 ] {ai_stand();}; +void() dguard_standD7 =[ $standD7, dguard_standD8 ] {ai_stand();}; +void() dguard_standD8 =[ $standD8, dguard_standD9 ] {ai_stand();}; +void() dguard_standD9 =[ $standD9, dguard_standD10 ] {ai_stand();}; +void() dguard_standD10 =[ $standD10, dguard_standD11 ] {ai_stand();}; +void() dguard_standD11 =[ $standD11, dguard_standD12 ] {ai_stand();}; +void() dguard_standD12 =[ $standD12, dguard_standD13 ] {ai_stand();}; +void() dguard_standD13 =[ $standD13, dguard_standD14 ] {ai_stand();}; +void() dguard_standD14 =[ $standD14, dguard_standD15 ] {ai_stand();}; +void() dguard_standD15 =[ $standD15, dguard_standD16 ] {ai_stand();}; +void() dguard_standD16 =[ $standD16, dguard_standD17 ] {ai_stand();}; +void() dguard_standD17 =[ $standD17, dguard_standD18 ] {ai_stand();}; +void() dguard_standD18 =[ $standD18, dguard_standD19 ] {ai_stand();}; +void() dguard_standD19 =[ $standD19, dguard_standD20 ] {ai_stand();}; +void() dguard_standD20 =[ $standD20, dguard_standD21 ] {ai_stand();}; +void() dguard_standD21 =[ $standD21, dguard_standD22 ] {ai_stand();}; +void() dguard_standD22 =[ $standD22, dguard_standD23 ] {ai_stand();}; +void() dguard_standD23 =[ $standD23, dguard_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dguard_stand1 =[ $stand1, dguard_stand2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_stand();}; +void() dguard_stand2 =[ $stand2, dguard_stand3 ] {ai_stand();}; +void() dguard_stand3 =[ $stand3, dguard_stand4 ] {ai_stand();}; +void() dguard_stand4 =[ $stand4, dguard_stand5 ] {ai_stand();}; +void() dguard_stand5 =[ $stand5, dguard_stand6 ] {ai_stand();}; +void() dguard_stand6 =[ $stand6, dguard_stand7 ] {ai_stand();}; +void() dguard_stand7 =[ $stand7, dguard_stand8 ] {ai_stand();}; +void() dguard_stand8 =[ $stand8, dguard_stand9 ] {ai_stand();}; +void() dguard_stand9 =[ $stand9, dguard_stand10 ] {ai_stand();}; +void() dguard_stand10 =[ $stand10, dguard_stand11 ] {ai_stand();}; +void() dguard_stand11 =[ $stand11, dguard_stand12 ] {ai_stand();}; +void() dguard_stand12 =[ $stand12, dguard_stand1 ] { + if (random() < MON_IDLE_ANIMATION) { + self.lip = random(); + if (self.lip < 0.2) self.think = dguard_standD1; // Poke the ground + else if (self.lip < 0.4) self.think = dguard_standC1; // Look at weapon + else if (self.lip < 0.7) self.think = dguard_standA1; // Shoulder hunch + else self.think = dguard_standB1; // Look around + } + ai_stand(); +}; + +//=========================================================================== +void() dguard_walk1 =[ $walk1, dguard_walk2 ] { monster_footstep(FALSE); +self.idlebusy = FALSE; monster_idle_sound(); ai_walk(2);}; +void() dguard_walk2 =[ $walk2, dguard_walk3 ] {ai_walk(5);}; +void() dguard_walk3 =[ $walk3, dguard_walk4 ] {ai_walk(5);}; +void() dguard_walk4 =[ $walk4, dguard_walk5 ] {ai_walk(4);}; +void() dguard_walk5 =[ $walk5, dguard_walk6 ] {ai_walk(4);}; +void() dguard_walk6 =[ $walk6, dguard_walk7 ] {ai_walk(2);}; +void() dguard_walk7 =[ $walk7, dguard_walk8 ] {ai_walk(2);}; +void() dguard_walk8 =[ $walk8, dguard_walk9 ] {ai_walk(3); monster_footstep(FALSE);}; +void() dguard_walk9 =[ $walk9, dguard_walk10 ] {ai_walk(3);}; +void() dguard_walk10 =[ $walk10, dguard_walk11 ] {ai_walk(4);}; +void() dguard_walk11 =[ $walk11, dguard_walk12 ] {ai_walk(3);}; +void() dguard_walk12 =[ $walk12, dguard_walk13 ] {ai_walk(4);}; +void() dguard_walk13 =[ $walk13, dguard_walk14 ] {ai_walk(6);}; +void() dguard_walk14 =[ $walk14, dguard_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// 6 frames instead of 8 frames (16, 20, 7, 16, 20, 6) Missing 13+14 +// Added timing of 3rd/7th back to other frames + +void() dguard_run1 =[ $run1, dguard_run2 ] { + self.idlebusy = FALSE; monster_idle_sound(); ai_run (20); }; +void() dguard_run2 =[ $run2, dguard_run3 ] {monster_footstep(FALSE); ai_run(24);}; +void() dguard_run3 =[ $run3, dguard_run4 ] {ai_run(12);}; +void() dguard_run4 =[ $run4, dguard_run5 ] {ai_run(20);}; +void() dguard_run5 =[ $run5, dguard_run6 ] {monster_footstep(FALSE); ai_run(24);}; +void() dguard_run6 =[ $run6, dguard_run1 ] {ai_run(12);}; + +//=========================================================================== +// Melee Attack 1a - Slice (one hand slashing run attack) +// Knight - 11 frames (skipped 1, 6, 12, 15) + +void() dguard_runatk1 =[ $slice2, dguard_runatk2 ] {ai_charge(20);}; +void() dguard_runatk2 =[ $slice3, dguard_runatk3 ] {ai_charge_side();}; +void() dguard_runatk3 =[ $slice4, dguard_runatk4 ] {monster_footstep(FALSE); ai_charge_side();}; +void() dguard_runatk4 =[ $slice5, dguard_runatk5 ] {ai_charge_side(); dguard_sword_sound();}; +void() dguard_runatk5 =[ $slice7, dguard_runatk6 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatk6 =[ $slice8, dguard_runatk7 ] {ai_melee_side();}; +void() dguard_runatk7 =[ $slice9, dguard_runatk8 ] {ai_melee_side();}; +void() dguard_runatk8 =[ $slice10, dguard_runatk9 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatk9 =[ $slice11, dguard_runatk10 ] {ai_melee_side();}; +void() dguard_runatk10 =[ $slice13, dguard_runatk11 ] {monster_footstep(FALSE); ai_charge_side();}; +void() dguard_runatk11 =[ $slice14, dguard_run1 ] {ai_charge(10);}; + +//=========================================================================== +// Melee Attack 1b - Charging attack A - swinging sword left to right infront +// Knight - 11 frames (skipped 1) + +void() dguard_runatkB1 =[ $char_a2, dguard_runatkB2 ] {monster_footstep(FALSE); ai_charge(20); dguard_sword_sound();}; +void() dguard_runatkB2 =[ $char_a3, dguard_runatkB3 ] {ai_charge_side();}; +void() dguard_runatkB3 =[ $char_a4, dguard_runatkB4 ] {ai_charge_side();}; +void() dguard_runatkB4 =[ $char_a5, dguard_runatkB5 ] {monster_footstep(FALSE); ai_charge_side();}; +void() dguard_runatkB5 =[ $char_a6, dguard_runatkB6 ] {ai_melee_side();}; +void() dguard_runatkB6 =[ $char_a7, dguard_runatkB7 ] {ai_melee_side(); dguard_sword_sound();}; +void() dguard_runatkB7 =[ $char_a8, dguard_runatkB8 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatkB8 =[ $char_a9, dguard_runatkB9 ] {ai_melee_side();}; +void() dguard_runatkB9 =[ $char_a10, dguard_runatkB10 ] {ai_melee_side();}; +void() dguard_runatkB10=[ $char_a11, dguard_runatkB11 ] {monster_footstep(FALSE); ai_melee_side();}; +void() dguard_runatkB11=[ $char_a12, dguard_run1 ] {ai_charge(10);}; + +//=========================================================================== +// Melee Attack 2a - Smash (chop overhead to ground) +// Knight - 11 frames (skipped (1, 11, 14, 15) + +void() dguard_atk1 =[ $smash2, dguard_atk2 ] {ai_charge(0);}; +void() dguard_atk2 =[ $smash3, dguard_atk3 ] {ai_charge(7);}; +void() dguard_atk3 =[ $smash4, dguard_atk4 ] {monster_footstep(FALSE); ai_charge(4);}; +void() dguard_atk4 =[ $smash5, dguard_atk5 ] {ai_charge(0);}; +void() dguard_atk5 =[ $smash6, dguard_atk6 ] {ai_charge(3);}; +void() dguard_atk6 =[ $smash7, dguard_atk7 ] {ai_charge(4); ai_melee(); dguard_sword_sound();}; +void() dguard_atk7 =[ $smash8, dguard_atk8 ] {monster_footstep(FALSE); ai_charge(1); ai_melee();}; +void() dguard_atk8 =[ $smash9, dguard_atk9 ] {ai_charge(3); ai_melee();}; +void() dguard_atk9 =[ $smash10, dguard_atk10] {ai_charge(1);}; +void() dguard_atk10=[ $smash12, dguard_atk11] {ai_charge(1);}; +void() dguard_atk11=[ $smash13, dguard_run1 ] {ai_charge(5);}; + +//============================================================================ +// Melee Attack 2b - W_Attack (two handed slashing attack) + +void() dguard_atkB1 =[ $w_attack2, dguard_atkB2 ] {monster_footstep(FALSE); ai_charge(0);}; +void() dguard_atkB2 =[ $w_attack3, dguard_atkB3 ] {ai_charge(7);}; +void() dguard_atkB3 =[ $w_attack4, dguard_atkB4 ] {ai_charge(4);}; +void() dguard_atkB4 =[ $w_attack5, dguard_atkB5 ] {ai_charge(0);}; +void() dguard_atkB5 =[ $w_attack6, dguard_atkB6 ] {ai_charge(3); dguard_sword_sound();}; +void() dguard_atkB6 =[ $w_attack7, dguard_atkB7 ] {monster_footstep(FALSE); ai_charge(4); ai_melee();}; +void() dguard_atkB7 =[ $w_attack8, dguard_atkB8 ] {ai_charge(1); ai_melee();}; +void() dguard_atkB8 =[ $w_attack9, dguard_atkB9 ] {ai_charge(3); ai_melee();}; +void() dguard_atkB9 =[ $w_attack10, dguard_atkB10] {ai_charge(1);}; +void() dguard_atkB10= [ $w_attack11, dguard_atkB11] {ai_charge(1);}; +void() dguard_atkB11 =[ $w_attack12, dguard_atkB12 ] {ai_charge(0);}; +void() dguard_atkB12 =[ $w_attack13, dguard_atkB13 ] {ai_charge(7);}; +void() dguard_atkB13 =[ $w_attack14, dguard_atkB14 ] {ai_charge(4);}; +void() dguard_atkB14 =[ $w_attack15, dguard_atkB15 ] {ai_charge(0); dguard_sword_sound();}; +void() dguard_atkB15 =[ $w_attack16, dguard_atkB16 ] {ai_charge(3);}; +void() dguard_atkB16 =[ $w_attack17, dguard_atkB17 ] {monster_footstep(FALSE); ai_charge(4); ai_melee();}; +void() dguard_atkB17 =[ $w_attack18, dguard_atkB18 ] {ai_charge(1); ai_melee();}; +void() dguard_atkB18 =[ $w_attack19, dguard_atkB19 ] {ai_charge(3); ai_melee();}; +void() dguard_atkB19 =[ $w_attack20, dguard_atkB20] {ai_charge(1);}; +void() dguard_atkB20=[ $w_attack21, dguard_atkB21] {ai_charge(1);}; +void() dguard_atkB21=[ $w_attack22, dguard_run1 ] {ai_charge(5);}; + +//============================================================================ +// Cycle between melee attacks +// Attack 1a - Slice (one hand slashing run attack) +// Attack 1b - Char_A (swinging sword left to right infront) +// Attack 2a - Smash (chop overhead to ground) +// Attack 2b - W_Attack (two handed slashing attack) + +void() dguard_melee = +{ + local float len; + + // decide if now is a good swing time + len = vlen(self.enemy.origin + self.enemy.view_ofs - (self.origin + self.view_ofs)); + + // Close melee attack 1a, 1b (slice and char_a) + if ( len < MONAI_MELEEKNIGHT ) { + // Randomly pick between attacks + if (random() > 0.5) dguard_atk1(); + else dguard_atkB1(); + } + // Running attack 2a, 2b (smash, w_attack (2x attacks in one)) + else { + if (random() > 0.5) dguard_runatk1(); + else dguard_runatkB1(); + } +}; + +//============================================================================ +void() dguard_painA1 =[ $painA1, dguard_painA2 ] {}; +void() dguard_painA2 =[ $painA2, dguard_painA3 ] {}; +void() dguard_painA3 =[ $painA3, dguard_painA4 ] {}; +void() dguard_painA4 =[ $painA4, dguard_painA5 ] {}; +void() dguard_painA5 =[ $painA5, dguard_run1 ] {}; +//---------------------------------------------------------------------- +void() dguard_painD1 =[ $painD1, dguard_painD2 ] {}; +void() dguard_painD2 =[ $painD2, dguard_painD3 ] {}; +void() dguard_painD3 =[ $painD3, dguard_painD4 ] {}; +void() dguard_painD4 =[ $painD4, dguard_painD5 ] {monster_footstep(FALSE);}; +void() dguard_painD5 =[ $painD5, dguard_painD6 ] {}; +void() dguard_painD6 =[ $painD6, dguard_painD7 ] {}; +void() dguard_painD7 =[ $painD7, dguard_painD8 ] {}; +void() dguard_painD8 =[ $painD8, dguard_painD9 ] {monster_footstep(FALSE);}; +void() dguard_painD9 =[ $painD9, dguard_painD10 ] {}; +void() dguard_painD10=[ $painD10, dguard_painD11 ] {}; +void() dguard_painD11=[ $painD11, dguard_run1 ] {}; +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dguard_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.85) dguard_painA1 (); // classic, body recoil + else { + dguard_painD1 (); // Cool stumble, hand over mouth + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +void() dguard_dieA1 =[ $deathA1, dguard_dieA2 ] {ai_forward(5);}; +void() dguard_dieA2 =[ $deathA2, dguard_dieA3 ] {monster_check_gib();ai_forward(8);}; +void() dguard_dieA3 =[ $deathA3, dguard_dieA4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dguard_dieA4 =[ $deathA4, dguard_dieA5 ] {}; +void() dguard_dieA5 =[ $deathA5, dguard_dieA6 ] {}; +void() dguard_dieA6 =[ $deathA6, dguard_dieA7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dguard_dieA7 =[ $deathA7, dguard_dieA8 ] {}; +void() dguard_dieA8 =[ $deathA8, dguard_dieA9 ] {ai_forward(10);}; +void() dguard_dieA9 =[ $deathA9, dguard_dieA10 ] {ai_forward(11);}; +void() dguard_dieA10 =[ $deathA10, dguard_dieA11 ] {}; +void() dguard_dieA11 =[ $deathA11, dguard_dieA12 ] {monster_death_postcheck();}; +void() dguard_dieA12 =[ $deathA12, dguard_dieA12 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dguard_dieB1 =[ $deathB1, dguard_dieB2 ] {}; +void() dguard_dieB2 =[ $deathB2, dguard_dieB3 ] {monster_check_gib();}; +void() dguard_dieB3 =[ $deathB3, dguard_dieB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dguard_dieB4 =[ $deathB4, dguard_dieB5 ] {}; +void() dguard_dieB5 =[ $deathB5, dguard_dieB6 ] {}; +void() dguard_dieB6 =[ $deathB6, dguard_dieB7 ] {}; +void() dguard_dieB7 =[ $deathB7, dguard_dieB8 ] {}; +void() dguard_dieB8 =[ $deathB8, dguard_dieB9 ] {}; +void() dguard_dieB9 =[ $deathB9, dguard_dieB10 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dguard_dieB10 =[ $deathB10, dguard_dieB11 ] {}; +void() dguard_dieB11 =[ $deathB11, dguard_dieB12 ] {}; +void() dguard_dieB12 =[ $deathB12, dguard_dieB13 ] {}; +void() dguard_dieB13 =[ $deathB13, dguard_dieB14 ] {}; +void() dguard_dieB14 =[ $deathB14, dguard_dieB15 ] {}; +void() dguard_dieB15 =[ $deathB15, dguard_dieB16 ] {}; +void() dguard_dieB16 =[ $deathB16, dguard_dieB17 ] {}; +void() dguard_dieB17 =[ $deathB17, dguard_dieB18 ] {}; +void() dguard_dieB18 =[ $deathB18, dguard_dieB19 ] {}; +void() dguard_dieB19 =[ $deathB19, dguard_dieB20 ] {monster_death_postcheck();}; +void() dguard_dieB20 =[ $deathB20, dguard_dieB20 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dguard_dieC1 =[ $deathC1, dguard_dieC2 ] {ai_forward(5);}; +void() dguard_dieC2 =[ $deathC2, dguard_dieC3 ] {monster_check_gib();ai_forward(8);}; +void() dguard_dieC3 =[ $deathC3, dguard_dieC4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dguard_dieC4 =[ $deathC4, dguard_dieC5 ] {}; +void() dguard_dieC5 =[ $deathC5, dguard_dieC6 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dguard_dieC6 =[ $deathC6, dguard_dieC7 ] {}; +void() dguard_dieC7 =[ $deathC7, dguard_dieC8 ] {}; +void() dguard_dieC8 =[ $deathC8, dguard_dieC9 ] {ai_forward(10);}; +void() dguard_dieC9 =[ $deathC9, dguard_dieC10 ] {ai_forward(11);}; +void() dguard_dieC10 =[ $deathC10, dguard_dieC11 ] {}; +void() dguard_dieC11 =[ $deathC11, dguard_dieC12 ] {}; +void() dguard_dieC12 =[ $deathC12, dguard_dieC13 ] {}; +void() dguard_dieC13 =[ $deathC13, dguard_dieC14 ] {monster_death_postcheck();}; +void() dguard_dieC14 =[ $deathC14, dguard_dieC14 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +// The sideways death happens to quick and looks odd when finished +// Skipping this death sequence +void() dguard_dieD1 =[ $deathD1, dguard_dieD2 ] {}; +void() dguard_dieD2 =[ $deathD2, dguard_dieD3 ] {monster_check_gib();}; +void() dguard_dieD3 =[ $deathD3, dguard_dieD4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dguard_dieD4 =[ $deathD4, dguard_dieD5 ] {}; +void() dguard_dieD5 =[ $deathD5, dguard_dieD6 ] {}; +void() dguard_dieD6 =[ $deathD6, dguard_dieD7 ] {}; +void() dguard_dieD7 =[ $deathD7, dguard_dieD8 ] {}; +void() dguard_dieD8 =[ $deathD8, dguard_dieD9 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dguard_dieD9 =[ $deathD9, dguard_dieD10 ] {}; +void() dguard_dieD10 =[ $deathD10, dguard_dieD11 ] {}; +void() dguard_dieD11 =[ $deathD11, dguard_dieD12 ] {}; +void() dguard_dieD12 =[ $deathD12, dguard_dieD13 ] {}; +void() dguard_dieD13 =[ $deathD13, dguard_dieD14 ] {}; +void() dguard_dieD14 =[ $deathD14, dguard_dieD15 ] {monster_death_postcheck();}; +void() dguard_dieD15 =[ $deathD15, dguard_dieD15 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dguard_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "knight/kdeath.wav", 1, ATTN_NORM); + if (random() > 0.75) dguard_dieC1 (); // Forward - platoon like + else if (random() > 0.5) dguard_dieA1 (); // Forward - standard + else dguard_dieB1 (); // Backward - standard + } +}; + +//============================================================================ +void() dguard_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +/*====================================================================== +QUAKED monster_dguard (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dguard = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_dguard.mdl"; + self.headmdl = "progs/ad171/h_dguard.mdl"; // Large head + self.gib1mdl = "progs/ad171/w_dguardsword.mdl"; // Unique sword + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "knight/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("knight/kdeath.wav"); + self.pain_sound = "knight/khurt.wav"; + precache_sound (self.pain_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.sight_sound = "knight/ksight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 30; + self.gibhealth = -35; + self.gibbed = FALSE; + self.pain_flinch = 20; + self.steptype = FS_TYPEMEDIUM; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = dguard_stand1; + self.th_walk = dguard_walk1; + self.th_run = dguard_run1; + self.th_melee = dguard_melee; + self.th_pain = dguard_pain; + self.th_die = dguard_die; + self.hittype = HIT_METAL; + if (self.deathstring == "") self.deathstring = "was chopped up by a Death Guard\n"; + + self.classtype = CT_MONDGUARD; + self.classgroup = CG_KNIGHT; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_dknight.qc b/QC_other/QC_keep/mon_dknight.qc new file mode 100644 index 00000000..54483696 --- /dev/null +++ b/QC_other/QC_keep/mon_dknight.qc @@ -0,0 +1,766 @@ +/*============================================================================== +DEATH KNIGHT +==============================================================================*/ +$cd id1/models/dknight +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// (013 - 024) Stand idle - Shoulder hunch +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 + +// (025 - 048) Stand idle - Quick look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 + +// (049 - 072) Stand idle - checking sword +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 + +// (073 - 092) Stand idle - scratching chin +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 + +// (093 - 106) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (107 - 112) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (113 - 127) Slice (one hand slashing run attack) (file=SWING) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 slice15 + +// (128 - 142) Smash (chop overhead to ground) (file=CHOP) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (143 - 164) W_Attack (two handed slashing attack) (file=SLASH) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 + +// (165 - 178) MagicC - Typical magic range attack (file=SWEEPCAST) +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 magicc12 magicc13 magicc14 + +// Pain animations A = Slow (179 - 183), D = Stagger (184 - 194) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (194 - 206) Charging attack A - swinging sword left to right infront +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 + +// (207 - 212) Charging attack B - rotating sword left to right infront +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// (212 - 224) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// (225 - 244) Death backwards with cool sword wobble +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 deathb15 deathb16 +$frame deathb17 deathb18 deathb19 deathb20 + +// magica and magicb missing + +void() dknight_sword_sound; // Sword swipe sounds +void() dknight_ghost_particle; // Ghost particles +void() dknight_ghost_glow; // Secondary ghost glow + +//=========================================================================== +void() dk_stand = { + if (self.spawnflags & MON_GHOST_ONLY) { + if (self.movetype != MOVETYPE_NONE) self.movetype = MOVETYPE_NONE; + dknight_ghost_particle(); + dknight_ghost_glow(); + } + else ai_stand(); +}; + +//---------------------------------------------------------------------- +void() dknight_standA1 =[ $standA1, dknight_standA2 ] {dk_stand();}; +void() dknight_standA2 =[ $standA2, dknight_standA3 ] {dk_stand();}; +void() dknight_standA3 =[ $standA3, dknight_standA4 ] {dk_stand();}; +void() dknight_standA4 =[ $standA4, dknight_standA5 ] {dk_stand();}; +void() dknight_standA5 =[ $standA5, dknight_standA6 ] {dk_stand();}; +void() dknight_standA6 =[ $standA6, dknight_standA7 ] {dk_stand();}; +void() dknight_standA7 =[ $standA7, dknight_standA8 ] {dk_stand();}; +void() dknight_standA8 =[ $standA8, dknight_standA9 ] {dk_stand();}; +void() dknight_standA9 =[ $standA9, dknight_standA10] {dk_stand();}; +void() dknight_standA10=[ $standA10, dknight_standA11] {dk_stand();}; +void() dknight_standA11=[ $standA11, dknight_standA12] {dk_stand();}; +void() dknight_standA12=[ $standA12, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_standB1 =[ $standB1, dknight_standB2 ] {dk_stand();}; +void() dknight_standB2 =[ $standB2, dknight_standB3 ] {dk_stand();}; +void() dknight_standB3 =[ $standB3, dknight_standB4 ] {dk_stand();}; +void() dknight_standB4 =[ $standB4, dknight_standB5 ] {dk_stand();}; +void() dknight_standB5 =[ $standB5, dknight_standB6 ] {dk_stand();}; +void() dknight_standB6 =[ $standB6, dknight_standB7 ] {dk_stand();}; +void() dknight_standB7 =[ $standB7, dknight_standB8 ] {dk_stand();}; +void() dknight_standB8 =[ $standB8, dknight_standB9 ] {dk_stand();}; +void() dknight_standB9 =[ $standB9, dknight_standB10] {dk_stand();}; +void() dknight_standB10=[ $standB10, dknight_standB11] {dk_stand();}; +void() dknight_standB11=[ $standB11, dknight_standB12] {dk_stand();}; +void() dknight_standB12=[ $standB12, dknight_standB13] {dk_stand();}; +void() dknight_standB13=[ $standB13, dknight_standB14] {dk_stand();}; +void() dknight_standB14=[ $standB14, dknight_standB15] {dk_stand();}; +void() dknight_standB15=[ $standB15, dknight_standB16] {dk_stand();}; +void() dknight_standB16=[ $standB16, dknight_standB17] {dk_stand();}; +void() dknight_standB17=[ $standB17, dknight_standB18] {dk_stand();}; +void() dknight_standB18=[ $standB18, dknight_standB19] {dk_stand();}; +void() dknight_standB19=[ $standB19, dknight_standB20] {dk_stand();}; +void() dknight_standB20=[ $standB20, dknight_standB21] {dk_stand();}; +void() dknight_standB21=[ $standB21, dknight_standB22] {dk_stand();}; +void() dknight_standB22=[ $standB22, dknight_standB23] {dk_stand();}; +void() dknight_standB23=[ $standB23, dknight_standB24] {dk_stand();}; +void() dknight_standB24=[ $standB24, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_standC1 =[ $standC1, dknight_standC2 ] {dk_stand();}; +void() dknight_standC2 =[ $standC2, dknight_standC3 ] {dk_stand();}; +void() dknight_standC3 =[ $standC3, dknight_standC4 ] {dk_stand();}; +void() dknight_standC4 =[ $standC4, dknight_standC5 ] {dk_stand();}; +void() dknight_standC5 =[ $standC5, dknight_standC6 ] {dk_stand();}; +void() dknight_standC6 =[ $standC6, dknight_standC7 ] {dk_stand();}; +void() dknight_standC7 =[ $standC7, dknight_standC8 ] {dk_stand();}; +void() dknight_standC8 =[ $standC8, dknight_standC9 ] {dk_stand();}; +void() dknight_standC9 =[ $standC9, dknight_standC10] {dk_stand();}; +void() dknight_standC10=[ $standC10, dknight_standC11] {dk_stand();}; +void() dknight_standC11=[ $standC11, dknight_standC12] {dk_stand();}; +void() dknight_standC12=[ $standC12, dknight_standC13] {dk_stand();}; +void() dknight_standC13=[ $standC13, dknight_standC14] {dk_stand();}; +void() dknight_standC14=[ $standC14, dknight_standC15] {dk_stand();}; +void() dknight_standC15=[ $standC15, dknight_standC16] {dk_stand();}; +void() dknight_standC16=[ $standC16, dknight_standC17] {dk_stand();}; +void() dknight_standC17=[ $standC17, dknight_standC18] {dk_stand();}; +void() dknight_standC18=[ $standC18, dknight_standC19] {dk_stand();}; +void() dknight_standC19=[ $standC19, dknight_standC20] {dk_stand();}; +void() dknight_standC20=[ $standC20, dknight_standC21] {dk_stand();}; +void() dknight_standC21=[ $standC21, dknight_standC22] {dk_stand();}; +void() dknight_standC22=[ $standC22, dknight_standC23] {dk_stand();}; +void() dknight_standC23=[ $standC23, dknight_standC24] {dk_stand();}; +void() dknight_standC24=[ $standC24, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_standD1 =[ $standD1, dknight_standD2 ] {dk_stand();}; +void() dknight_standD2 =[ $standD2, dknight_standD3 ] {dk_stand();}; +void() dknight_standD3 =[ $standD3, dknight_standD4 ] {dk_stand();}; +void() dknight_standD4 =[ $standD4, dknight_standD5 ] {dk_stand();}; +void() dknight_standD5 =[ $standD5, dknight_standD6 ] {dk_stand();}; +void() dknight_standD6 =[ $standD6, dknight_standD7 ] {dk_stand();}; +void() dknight_standD7 =[ $standD7, dknight_standD8 ] {dk_stand();}; +void() dknight_standD8 =[ $standD8, dknight_standD9 ] {dk_stand();}; +void() dknight_standD9 =[ $standD9, dknight_standD10] {dk_stand();}; +void() dknight_standD10=[ $standD10, dknight_standD11] {dk_stand();}; +void() dknight_standD11=[ $standD11, dknight_standD12] {dk_stand();}; +void() dknight_standD12=[ $standD12, dknight_standD13] {dk_stand();}; +void() dknight_standD13=[ $standD13, dknight_standD14] {dk_stand();}; +void() dknight_standD14=[ $standD14, dknight_standD15] {dk_stand();}; +void() dknight_standD15=[ $standD15, dknight_standD16] {dk_stand();}; +void() dknight_standD16=[ $standD16, dknight_standD17] {dk_stand();}; +void() dknight_standD17=[ $standD17, dknight_standD18] {dk_stand();}; +void() dknight_standD18=[ $standD18, dknight_standD19] {dk_stand();}; +void() dknight_standD19=[ $standD19, dknight_standD20] {dk_stand();}; +void() dknight_standD20=[ $standD20, dknight_stand1 ] {dk_stand();}; + +//---------------------------------------------------------------------- +void() dknight_stand1 =[ $stand1, dknight_stand2 ] {monster_idle_sound();dk_stand();}; +void() dknight_stand2 =[ $stand2, dknight_stand3 ] {dk_stand();}; +void() dknight_stand3 =[ $stand3, dknight_stand4 ] {dk_stand();}; +void() dknight_stand4 =[ $stand4, dknight_stand5 ] {dk_stand();}; +void() dknight_stand5 =[ $stand5, dknight_stand6 ] {dk_stand();}; +void() dknight_stand6 =[ $stand6, dknight_stand7 ] {dk_stand();}; +void() dknight_stand7 =[ $stand7, dknight_stand8 ] {dk_stand();}; +void() dknight_stand8 =[ $stand8, dknight_stand9 ] {dk_stand();}; +void() dknight_stand9 =[ $stand9, dknight_stand10 ] {dk_stand();}; +void() dknight_stand10 =[ $stand10, dknight_stand11 ] {dk_stand();}; +void() dknight_stand11 =[ $stand11, dknight_stand12 ] {dk_stand();}; +void() dknight_stand12 =[ $stand12, dknight_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + if (self.lip < 1) self.think = dknight_standD1; // Scratch chin + else if (self.lip < 2) self.think = dknight_standC1; // Look at weapon + else if (self.lip < 3) self.think = dknight_standA1; // Shoulder hunch + else self.think = dknight_standB1; // Look around + } +}; + +//=========================================================================== +void(float dist) dk_walk = { + if (self.spawnflags & MON_GHOST_ONLY) { + if (self.movetype != MOVETYPE_STEP) self.movetype = MOVETYPE_STEP; + movetogoal (dist); + dknight_ghost_particle(); + dknight_ghost_glow(); + + // Find out if the ghost is close enough to next path corner + // The ghost is not a monster, negative health and no body! + // The path_corner touch function won't work with ghosts + self.enemydist = range_distance(self.goalentity, FALSE); + if (self.enemydist < 64) { + // Check for any new targets to walk toward + if (self.goalentity.target != "") { + self.movetarget = find(world, targetname, self.goalentity.target); + if (self.movetarget) { + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + return; + } + } + } + // It seems its time to stand around! + self.th_stand(); + // Check for any path corner event triggers + if (self.goalentity.corner_event) + trigger_strs(self.goalentity.corner_event, self); + } + } + // Default walk for regular knights + else ai_walk(dist); +}; + +//---------------------------------------------------------------------- +void() dknight_walk1 =[ $walk1, dknight_walk2 ] {self.idlebusy = FALSE; + monster_idle_sound(); dk_walk(2);}; +void() dknight_walk2 =[ $walk2, dknight_walk3 ] {monster_footstep(FALSE);dk_walk(5);}; +void() dknight_walk3 =[ $walk3, dknight_walk4 ] {dk_walk(5);}; +void() dknight_walk4 =[ $walk4, dknight_walk5 ] {dk_walk(4);}; +void() dknight_walk5 =[ $walk5, dknight_walk6 ] {dk_walk(4);}; +void() dknight_walk6 =[ $walk6, dknight_walk7 ] {dk_walk(2);}; +void() dknight_walk7 =[ $walk7, dknight_walk8 ] {dk_walk(2);}; +void() dknight_walk8 =[ $walk8, dknight_walk9 ] {monster_footstep(FALSE); dk_walk(3);}; +void() dknight_walk9 =[ $walk9, dknight_walk10 ] {dk_walk(3);}; +void() dknight_walk10 =[ $walk10, dknight_walk11 ] {dk_walk(4);}; +void() dknight_walk11 =[ $walk11, dknight_walk12 ] {dk_walk(3);}; +void() dknight_walk12 =[ $walk12, dknight_walk13 ] {dk_walk(4);}; +void() dknight_walk13 =[ $walk13, dknight_walk14 ] {dk_walk(6);}; +void() dknight_walk14 =[ $walk14, dknight_walk1 ] {dk_walk(2);}; + +//=========================================================================== +void() dknight_run1 =[ $run1, dknight_run2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_run (20); CheckForCharge(); }; +void() dknight_run2 =[ $run2, dknight_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() dknight_run3 =[ $run3, dknight_run4 ] {ai_run(16);}; +void() dknight_run4 =[ $run4, dknight_run5 ] {ai_run(14);}; +void() dknight_run5 =[ $run5, dknight_run6 ] {monster_footstep(FALSE); ai_run(25);}; +void() dknight_run6 =[ $run6, dknight_run1 ] {ai_run(13);}; + +//=========================================================================== +// Charging attack A - swinging sword left to right infront +// Hell Knight - 16 frames / Death Knight - 12 frames +// Death Knight is faster (-4 frames will cycle damage frames quicker) +// Damage Frames - Hell Knight (6-11, Total 6) Death Knight (6-10, Total 5) + +void() dknight_char_a1 =[ $char_a1, dknight_char_a2 ] {ai_charge(20); dknight_sword_sound();}; +void() dknight_char_a2 =[ $char_a2, dknight_char_a3 ] {monster_footstep(FALSE); ai_charge(25);ai_melee(); }; +void() dknight_char_a3 =[ $char_a3, dknight_char_a4 ] {ai_charge(18);ai_melee(); }; +void() dknight_char_a4 =[ $char_a4, dknight_char_a5 ] {ai_charge(16);}; +void() dknight_char_a5 =[ $char_a5, dknight_char_a6 ] {monster_footstep(FALSE); ai_charge(14);}; +void() dknight_char_a6 =[ $char_a6, dknight_char_a7 ] {ai_charge(20); ai_melee();}; +void() dknight_char_a7 =[ $char_a7, dknight_char_a8 ] {ai_charge(21); ai_melee(); dknight_sword_sound();}; +void() dknight_char_a8 =[ $char_a8, dknight_char_a9 ] {monster_footstep(FALSE); ai_charge(13); ai_melee();}; +void() dknight_char_a9 =[ $char_a9, dknight_char_a10 ] {ai_charge(20); ai_melee();}; +void() dknight_char_a10=[ $char_a10, dknight_char_a11 ] {ai_charge(20); ai_melee();}; +void() dknight_char_a11=[ $char_a11, dknight_char_a12 ] {monster_footstep(FALSE); ai_charge(18);}; +void() dknight_char_a12=[ $char_a12, dknight_run1 ] {ai_charge(16);}; + +//---------------------------------------------------------------------- +// Identical frame set (Hell Knight / Death Knight) + +void() dknight_char_b1 =[ $char_b1, dknight_char_b2 ] { + CheckContinueCharge (); ai_charge(23); ai_melee(); dknight_sword_sound();}; +void() dknight_char_b2 =[ $char_b2, dknight_char_b3 ] {monster_footstep(FALSE); ai_charge(17); ai_melee();}; +void() dknight_char_b3 =[ $char_b3, dknight_char_b4 ] {ai_charge(12); ai_melee();}; +void() dknight_char_b4 =[ $char_b4, dknight_char_b5 ] {ai_charge(22); ai_melee();}; +void() dknight_char_b5 =[ $char_b5, dknight_char_b6 ] {monster_footstep(FALSE); ai_charge(18); ai_melee();}; +void() dknight_char_b6 =[ $char_b6, dknight_char_b1 ] {ai_charge(8); ai_melee();}; + +//=========================================================================== +// Melee Attack 1 - Slice (one hand slashing run attack) +// Hell Knight - 10 frames / Death Knight - 15 frames (skipped 1, 3, 12, 15) +// Death Knight - trimmed frames so melee attack 1 and 2 the same + +void() dknight_slice1 =[ $slice2, dknight_slice2 ] {ai_charge(9);}; +void() dknight_slice2 =[ $slice4, dknight_slice3 ] {monster_footstep(FALSE); ai_charge(6);}; +void() dknight_slice3 =[ $slice5, dknight_slice4 ] {ai_charge(13);}; +void() dknight_slice4 =[ $slice6, dknight_slice5 ] {ai_charge(4); dknight_sword_sound();}; +void() dknight_slice5 =[ $slice7, dknight_slice6 ] {monster_footstep(FALSE); ai_charge(7); ai_melee();}; +void() dknight_slice6 =[ $slice8, dknight_slice7 ] {ai_charge(15); ai_melee();}; +void() dknight_slice7 =[ $slice9, dknight_slice8 ] {ai_charge(8); ai_melee();}; +void() dknight_slice8 =[ $slice10, dknight_slice9 ] {monster_footstep(FALSE); ai_charge(2); ai_melee();}; +void() dknight_slice9 =[ $slice11, dknight_slice10 ] {ai_melee();}; +void() dknight_slice10 =[ $slice13, dknight_slice11 ] {monster_footstep(FALSE); ai_charge(0);}; +void() dknight_slice11 =[ $slice14, dknight_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +// Melee Attack 2 - Smash (chop overhead to ground) +// Hell Knight - 11 frames / Death Knight - 15 frames (skipped (1, 11, 14, 15) +// Death Knight frames trimmed down to match Hell Knight (damage ratio) + +void() dknight_smash1 =[ $smash2, dknight_smash2 ] {ai_charge(1);}; +void() dknight_smash2 =[ $smash3, dknight_smash3 ] {ai_charge(13);}; +void() dknight_smash3 =[ $smash4, dknight_smash4 ] {monster_footstep(FALSE); ai_charge(9);}; +void() dknight_smash4 =[ $smash5, dknight_smash5 ] {ai_charge(11);dknight_sword_sound();}; +void() dknight_smash5 =[ $smash6, dknight_smash6 ] {ai_charge(10);}; +void() dknight_smash6 =[ $smash7, dknight_smash7 ] {ai_charge(7); ai_melee();}; +void() dknight_smash7 =[ $smash8, dknight_smash8 ] {monster_footstep(FALSE); ai_charge(12); ai_melee();}; +void() dknight_smash8 =[ $smash9, dknight_smash9 ] {ai_charge(2); ai_melee();}; +void() dknight_smash9 =[ $smash10, dknight_smash10 ] {ai_charge(3); ai_melee();}; +void() dknight_smash10 =[ $smash12, dknight_smash11 ] {ai_charge(0);ai_melee();}; +void() dknight_smash11 =[ $smash13, dknight_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - W_Attack (two handed slashing attack) +// Identical frame set (Hell Knight / Death Knight) + +void() dknight_watk1 =[ $w_attack1, dknight_watk2 ] {ai_charge(2);}; +void() dknight_watk2 =[ $w_attack2, dknight_watk3 ] {monster_footstep(FALSE); ai_charge(0);}; +void() dknight_watk3 =[ $w_attack3, dknight_watk4 ] {ai_charge(0);}; +void() dknight_watk4 =[ $w_attack4, dknight_watk5 ] {ai_charge(0); dknight_sword_sound();}; +void() dknight_watk5 =[ $w_attack5, dknight_watk6 ] {ai_melee();}; +void() dknight_watk6 =[ $w_attack6, dknight_watk7 ] {ai_melee();}; +void() dknight_watk7 =[ $w_attack7, dknight_watk8 ] {monster_footstep(FALSE); ai_charge(1);}; +void() dknight_watk8 =[ $w_attack8, dknight_watk9 ] {ai_charge(4);}; +void() dknight_watk9 =[ $w_attack9, dknight_watk10 ] {ai_charge(5);}; +void() dknight_watk10 =[ $w_attack10, dknight_watk11 ] {ai_charge(3); ai_melee();}; +void() dknight_watk11 =[ $w_attack11, dknight_watk12 ] {ai_charge(2); ai_melee();}; +void() dknight_watk12 =[ $w_attack12, dknight_watk13 ] {ai_charge(2); ai_melee();}; +void() dknight_watk13 =[ $w_attack13, dknight_watk14 ] {ai_charge(0);}; +void() dknight_watk14 =[ $w_attack14, dknight_watk15 ] {ai_charge(0);}; +void() dknight_watk15 =[ $w_attack15, dknight_watk16 ] {ai_charge(0); dknight_sword_sound();}; +void() dknight_watk16 =[ $w_attack16, dknight_watk17 ] {ai_charge(1);}; +void() dknight_watk17 =[ $w_attack17, dknight_watk18 ] {monster_footstep(FALSE); ai_charge(1); ai_melee();}; +void() dknight_watk18 =[ $w_attack18, dknight_watk19 ] {ai_charge(3); ai_melee();}; +void() dknight_watk19 =[ $w_attack19, dknight_watk20 ] {ai_charge(4); ai_melee();}; +void() dknight_watk20 =[ $w_attack20, dknight_watk21 ] {ai_charge(6);}; +void() dknight_watk21 =[ $w_attack21, dknight_watk22 ] {ai_charge(7);}; +void() dknight_watk22 =[ $w_attack22, dknight_run1 ] {ai_charge(3);}; + +//============================================================================ +// Cycle between 3 melee attacks +// Attack 1 - Slice (one hand slashing run attack) +// Attack 2 - Smash (chop overhead to ground) +// Attack 3 - W_Attack (two handed slashing attack) + +//---------------------------------------------------------------------- +void() dknight_melee = +{ + self.meleeattack = self.meleeattack + 1; + + if (self.meleeattack == 1) dknight_slice1 (); + else if (self.meleeattack == 2) dknight_smash1 (); + else { + dknight_watk1 (); + self.meleeattack = 0; + } +}; + +//=========================================================================== +// Hell Knight - 11 frames / Death Knight - 14 frames (skipped 1, 10,14) +// Death Knight frames trimmed down to match Hell Knight (damage ratio) + +void() dknight_magicc1 =[ $magicc2, dknight_magicc2 ] {ai_face();}; +void() dknight_magicc2 =[ $magicc3, dknight_magicc3 ] {ai_face();}; +void() dknight_magicc3 =[ $magicc4, dknight_magicc4 ] {ai_face();}; +void() dknight_magicc4 =[ $magicc5, dknight_magicc5 ] {ai_face();}; +void() dknight_magicc5 =[ $magicc6, dknight_magicc6 ] {ai_face();}; +void() dknight_magicc6 =[ $magicc7, dknight_magicc7 ] {hknight_shot(-2);}; +void() dknight_magicc7 =[ $magicc8, dknight_magicc8 ] {hknight_shot(-1);}; +void() dknight_magicc8 =[ $magicc9, dknight_magicc9 ] {hknight_shot(0);}; +void() dknight_magicc9 =[ $magicc11, dknight_magicc10] {hknight_shot(1);}; +void() dknight_magicc10 =[ $magicc12, dknight_magicc11] {hknight_shot(2);}; +void() dknight_magicc11 =[ $magicc13, dknight_run1] {hknight_shot(3);}; + +//============================================================================ +void() dknight_painA1 =[ $painA1, dknight_painA2 ] {}; +void() dknight_painA2 =[ $painA2, dknight_painA3 ] {}; +void() dknight_painA3 =[ $painA3, dknight_painA4 ] {}; +void() dknight_painA4 =[ $painA4, dknight_painA5 ] {}; +void() dknight_painA5 =[ $painA5, dknight_run1 ] {}; + +//---------------------------------------------------------------------- +void() dknight_painD1 =[ $painD1, dknight_painD2 ] {}; +void() dknight_painD2 =[ $painD2, dknight_painD3 ] {}; +void() dknight_painD3 =[ $painD3, dknight_painD4 ] {}; +void() dknight_painD4 =[ $painD4, dknight_painD5 ] {monster_footstep(FALSE); }; +void() dknight_painD5 =[ $painD5, dknight_painD6 ] {}; +void() dknight_painD6 =[ $painD6, dknight_painD7 ] {}; +void() dknight_painD7 =[ $painD7, dknight_painD8 ] {}; +void() dknight_painD8 =[ $painD8, dknight_painD9 ] {monster_footstep(FALSE); }; +void() dknight_painD9 =[ $painD9, dknight_painD10 ] {}; +void() dknight_painD10 =[ $painD10, dknight_painD11 ] {}; +void() dknight_painD11 =[ $painD11, dknight_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dknight_pain = +{ + if (self.spawnflags & MON_GHOST_ONLY) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) dknight_painA1 (); // classic, body recoil + else { + dknight_painD1 (); // Cool stumble, hand over mouth + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dknight_painD1 (); + } + } +}; + +//============================================================================ +void() dknight_die1 =[ $death1, dknight_die2 ] {ai_forward(10);}; +void() dknight_die2 =[ $death2, dknight_die3 ] {monster_check_gib();ai_forward(8);}; +void() dknight_die3 =[ $death3, dknight_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dknight_die4 =[ $death4, dknight_die5 ] {}; +void() dknight_die5 =[ $death5, dknight_die6 ] {}; +void() dknight_die6 =[ $death6, dknight_die7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM);}; +void() dknight_die7 =[ $death7, dknight_die8 ] {}; +void() dknight_die8 =[ $death8, dknight_die9 ] {ai_forward(10);}; +void() dknight_die9 =[ $death9, dknight_die10 ] {ai_forward(11);}; +void() dknight_die10 =[ $death10, dknight_die11 ] {}; +void() dknight_die11 =[ $death11, dknight_die12 ] {monster_death_postcheck();}; +void() dknight_die12 =[ $death12, dknight_die12 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dknight_dieb1 =[ $deathb1, dknight_dieb2 ] {}; +void() dknight_dieb2 =[ $deathb2, dknight_dieb3 ] {monster_check_gib();}; +void() dknight_dieb3 =[ $deathb3, dknight_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dknight_dieb4 =[ $deathb4, dknight_dieb5 ] {}; +void() dknight_dieb5 =[ $deathb5, dknight_dieb6 ] {}; +void() dknight_dieb6 =[ $deathb6, dknight_dieb7 ] {}; +void() dknight_dieb7 =[ $deathb7, dknight_dieb8 ] {}; +void() dknight_dieb8 =[ $deathb8, dknight_dieb9 ] {}; +void() dknight_dieb9 =[ $deathb9, dknight_dieb10 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_METALB, 1, ATTN_NORM);}; +void() dknight_dieb10 =[ $deathb10, dknight_dieb11 ] {}; +void() dknight_dieb11 =[ $deathb11, dknight_dieb12 ] {}; +void() dknight_dieb12 =[ $deathb12, dknight_dieb13 ] {}; +void() dknight_dieb13 =[ $deathb13, dknight_dieb14 ] {}; +void() dknight_dieb14 =[ $deathb14, dknight_dieb15 ] {}; +void() dknight_dieb15 =[ $deathb15, dknight_dieb16 ] {}; +void() dknight_dieb16 =[ $deathb16, dknight_dieb17 ] {}; +void() dknight_dieb17 =[ $deathb17, dknight_dieb18 ] {}; +void() dknight_dieb18 =[ $deathb18, dknight_dieb19 ] {}; +void() dknight_dieb19 =[ $deathb19, dknight_dieb20 ] {monster_death_postcheck();}; +void() dknight_dieb20 =[ $deathb20, dknight_dieb20 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dknight_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) dknight_die1 (); + else dknight_dieb1 (); + } +}; + + +//============================================================================ +// The Death Knight ghost system (this is not a monster) +//============================================================================ +void() dknight_ghostnull = {}; +//---------------------------------------------------------------------- +void() dknight_ghost_glow = +{ + if (self.attachment) { + self.attachment.frame = self.frame; + setorigin(self.attachment, self.origin); + if (random() < 0.5) self.attachment.alpha = 0.02; + else self.attachment.alpha = 0.05; + self.attachment.angles = self.angles; + self.attachment.velocity = self.velocity; + } +}; +//---------------------------------------------------------------------- +void() dknight_ghost_particle = +{ + self.alpha = 0.5 + (0.1*random()); + self.pos1 = '0 0 0'; + self.pos1_x = crandom()*16; + self.pos1_y = crandom()*16; + self.pos1_z = crandom()*24; + if (random() < 0.5) + particle_explode(self.origin+self.pos1, 2, 1, PARTICLE_BURST_WHITE, PARTICLE_BURST_LOSTUP); + if (self.idletimer < time) { + self.idletimer = time + 7 + (random() * 3); + self.lefty = 1 - self.lefty; + if (self.lefty) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_sound2, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +// The use function is for triggering the ghost to move +void() dknight_ghost_use = { + // Check for a delay target route (using target2) + if (self.estate == ESTATE_ON && self.target2 != "") { + self.target = self.target2; + self.target2 = ""; + self.estate = ESTATE_OFF; + } + // Always go to an on state + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() dknight_ghost_fade = +{ + if (self.estate == ESTATE_ON) return; + self.alpha = self.alpha - FADEMODEL_TIME; + + if (self.alpha <= 0) setmodel (self, ""); + else self.nextthink = time + FADEMODEL_TIME; +}; +//---------------------------------------------------------------------- +void() dknight_ghost_off = { + // Block if already off + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + particle_explode(self.origin+'0 0 -20', 75, 2, PARTICLE_BURST_FIRE, PARTICLE_BURST_UPWARD); + self.flags = self.effects = 0; // Always reset + self.takedamage = DAMAGE_NO; // No pain/death triggers + self.movetype = MOVETYPE_NONE; // Stationary + self.solid = SOLID_NOT; // no world interaction + setsize (self, VEC_ORIGIN, VEC_ORIGIN); // No size, no impact + self.velocity = self.avelocity = '0 0 0'; // Reset velocity + if (self.attachment) { + self.attachment.movetype = MOVETYPE_NONE; // Stationary + self.attachment.solid = SOLID_NOT; // no world interaction + setmodel(self.attachment,""); + self.attachment.velocity = '0 0 0'; + } + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.think = dknight_ghost_fade; + self.nextthink = time + FADEMODEL_TIME; +} + +//---------------------------------------------------------------------- +void() dknight_ghost_on = { + // Block if already ON + if (self.estate == ESTATE_ON) return; + + self.estate = ESTATE_ON; + particle_explode(self.origin, 30, 2, PARTICLE_BURST_WHITE, PARTICLE_BURST_SKULLUP); + self.flags = self.effects = 0; // Always reset + self.takedamage = DAMAGE_NO; // No pain/death triggers + self.movetype = MOVETYPE_NONE; // Regular walking + self.solid = SOLID_NOT; // no world interaction + setmodel(self, self.mdl); // Setup model + if (self.exactskin) self.skin = self.exactskin; + if (CheckZeroVector(self.bbmins)) monster_bbox(); + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + self.velocity = self.avelocity = '0 0 0'; // Reset velocity + + // Setup ghost glow effect + if (!self.attachment) self.attachment = spawn(); + self.attachment.movetype = MOVETYPE_NOCLIP; // No movement + self.attachment.solid = SOLID_NOT; // no world interaction + setmodel(self.attachment, self.headmdl); + setsize(self.attachment,VEC_ORIGIN, VEC_ORIGIN); + setorigin(self.attachment, self.origin); + + // Check for any targets to walk toward + if (self.target != "") { + self.movetarget = find(world, targetname, self.target); + if (self.movetarget) { + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + self.th_walk(); + return; + } + } + } + // No valid target, just stand around + self.movetarget = self.goalentity = world; + self.th_stand(); +} + +//============================================================================ +void() dknight_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +/*====================================================================== +QUAKED monster_dknight (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dknight = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_dknight.mdl"; // New Hell Knight + self.headmdl = "progs/ad171/h_dknight.mdl"; + self.gib1mdl = "progs/ad171/w_dknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_HKN); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib1mdl); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_HKNGRN); + } + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the + // filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + // Always precache these stone gib models + precache_stonegibs(); + + self.sight_sound = "hknight/sight1.wav"; + precache_sound (self.sight_sound); + + self.pain_sound = "hknight/pain1.wav"; + self.death_sound = "hknight/death1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 250; + self.gibhealth = -40; + self.gibbed = FALSE; + self.pain_flinch = 40; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 1.5; // Higher than a knight + self.steptype = FS_TYPEHEAVY; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // randomize last melee attack + self.meleeattack = rint(random()*3); + + self.classtype = CT_MONDKNIGHT; + self.classgroup = CG_DKNIGHT; + self.classmove = MON_MOVEWALK; + + self.hittype = HIT_METAL; + + // Special ghost prop, stands around or walks + if (self.spawnflags & MON_GHOST_ONLY) { + self.headmdl = "progs/ad171/mon_dknight_glow.mdl"; + precache_model (self.headmdl); + + self.idle_sound = "dknight/ghost_idle1.wav"; + self.idle_sound2 = "dknight/ghost_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.steptype = FS_FLYING; + self.exactskin = 2; + self.alpha = 0.1; + self.nomonstercount = TRUE; + self.gibhealth = MON_NEVERGIB; + self.health = LARGE_TIMER; + self.yaw_speed = 20; + + self.th_stand = dknight_stand1; + self.th_walk = dknight_walk1; + self.th_run = dknight_walk1; + + // The ghost is a scenery prop, not a monster + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = dknight_ghost_on; + self.estate_off = dknight_ghost_off; + self.estate_use = dknight_ghost_use; + + // Always start off and wait for a trigger + self.estate = ESTATE_OFF; + self.takedamage = DAMAGE_NO; // No pain/death triggers + self.movetype = MOVETYPE_NONE; // Stationary + self.solid = SOLID_NOT; // no world interaction + setmodel (self, ""); // invisible + } else { + self.th_stand = dknight_stand1; + self.th_walk = dknight_walk1; + self.th_run = dknight_run1; + self.th_melee = dknight_melee; + self.th_charge = dknight_char_a1; + self.th_missile = dknight_magicc1; + self.th_pain = dknight_pain; + self.th_die = dknight_die; + if (self.deathstring == "") self.deathstring = " was cleaved by a Death Knight\n"; + // Start monster (default) + monster_start(); + } +}; + +//---------------------------------------------------------------------- +void() monster_dknightghost = +{ + self.spawnflags = MON_GHOST_ONLY; + monster_dknight(); +}; diff --git a/QC_other/QC_keep/mon_dlord.qc b/QC_other/QC_keep/mon_dlord.qc new file mode 100644 index 00000000..755e625e --- /dev/null +++ b/QC_other/QC_keep/mon_dlord.qc @@ -0,0 +1,478 @@ +void () dlord_move1; +void () dlord_run1; +void () dlord_idle_sound; + +void() dguard_hit = { + if (vlen(self.enemy.origin - self.origin) > 100) { + if (random() < 0.5) { + sound(self, CHAN_WEAPON, "dguard/slmiss1.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_WEAPON, "dguard/slmiss2.wav", 1, ATTN_NORM); + } + return; + } + sound(self, CHAN_WEAPON, "dguard/slhit.wav", 1, ATTN_NORM); + T_Damage(self.enemy, self, self, 30,DAMARMOR); + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); +}; + +void(void() thinkst) SUB_DLordCheckRefire = { + local vector spot1; + local vector spot2; + local entity targ; + + if (self.dlord_firecnt > 30) { + self.dlord_firecnt = 0; + return; + } + targ = self.enemy; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline(spot1, spot2, 0, self); + if (trace_ent == targ) + self.dlord_playervis = time + 0.8; + + if (trace_ent != targ && self.dlord_playervis < time) + return; + + self.think = thinkst; +}; + +void(float dist) ai_dlord_run = { + movedist = dist; + if (self.enemy.health <= 0) { + self.enemy = world; + if (self.oldenemy.health > 0) { + self.enemy = self.oldenemy; + HuntTarget(); + } else { + if (self.movetarget) { + self.th_walk(); + } else { + self.th_stand(); + } + return; + } + } + self.show_hostile = time + 1; + enemy_vis = visible(self.enemy); + if (enemy_vis) + self.search_time = time + 5; + + if (coop && self.search_time < time) { + if (FindTarget()) + return; + } + enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + if (self.attack_state == AS_MISSILE) { + ai_run_missile(); + return; + } + if (self.attack_state == AS_MELEE) { + ai_run_melee(); + return; + } + CheckAttack(); + + + if (enemy_vis) + self.dlord_searchtime = time + 2 + 2 * random(); + + if (enemy_vis && self.th_run != dlord_move1) { + self.th_run = dlord_move1; + self.think = self.th_run; + } else { + if (!enemy_vis && self.th_run != dlord_run1 && self.dlord_searchtime < time) { + self.th_run = dlord_run1; + self.think = self.th_run; + } + } + movetogoal(dist); +}; + +void() dlord_shot_think = { + if (self.enemy.health < 1) + return; + + self.velocity = self.velocity * 0.4 + (self.enemy.origin - (self.origin + '0 0 -12')) * 0.6; + self.velocity = normalize(self.velocity); + self.velocity = self.velocity * 750; + self.nextthink = time + 0.1; + self.think = dlord_shot_think; +}; + +void(float offset) dlord_shot = { + local vector offang; + local vector org; + local vector vec; + + if (visible(self.enemy)) + self.oldorigin = self.enemy.origin; + + if (visible(self.enemy)) { + offang = vectoangles(self.enemy.origin - self.origin); + } else { + offang = vectoangles(self.oldorigin - self.origin); + } + offang_y = offang_y + offset * 6; + makevectors(offang); + org = self.origin + '0 0 24' + v_forward * 20; + vec = normalize(v_forward); + vec_z = 0 - vec_z + (random() - 0.5) * 0.2; + hknight_shot(offset); + newmis.classname = "knightspike"; + setmodel(newmis, "progs/quoth2pt2full/dspike.mdl"); + newmis.enemy = self.enemy; + if (visible(self.enemy)) { + newmis.think = dlord_shot_think; + } else { + newmis.think = SUB_Null; + } + newmis.nextthink = time + 0.1; + newmis.avelocity = '500 500 500'; + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vec * 750; +}; + +void() shieldon = { + self.shield = 1; + self.effects = EF_BRIGHTFIELD; + self.takedamage = DAMAGE_YES; +}; + +void() shieldoff = { + self.shield = 0; + self.effects = 0; + self.takedamage = DAMAGE_AIM; +}; + +void() dlord_stand1 = [0, dlord_stand2] { ai_stand(); }; +void() dlord_stand2 = [1, dlord_stand3] { ai_stand(); }; +void() dlord_stand3 = [2, dlord_stand4] { ai_stand(); }; +void() dlord_stand4 = [3, dlord_stand5] { ai_stand(); }; +void() dlord_stand5 = [4, dlord_stand6] { ai_stand(); }; +void() dlord_stand6 = [5, dlord_stand7] { ai_stand(); }; +void() dlord_stand7 = [6, dlord_stand8] { ai_stand(); }; +void() dlord_stand8 = [7, dlord_stand9] { ai_stand(); }; +void() dlord_stand9 = [8, dlord_stand1] { ai_stand(); }; + +void() dlord_walk1 = [9, dlord_walk2] { dlord_idle_sound(); ai_walk(2); }; +void() dlord_walk2 = [10, dlord_walk3] { ai_walk(5); }; +void() dlord_walk3 = [11, dlord_walk4] { ai_walk(5); }; +void() dlord_walk4 = [12, dlord_walk5] { ai_walk(4); }; +void() dlord_walk5 = [13, dlord_walk6] { ai_walk(4); }; +void() dlord_walk6 = [14, dlord_walk7] { ai_walk(2); }; +void() dlord_walk7 = [15, dlord_walk8] { ai_walk(2); }; +void() dlord_walk8 = [16, dlord_walk9] { ai_walk(3); }; +void() dlord_walk9 = [17, dlord_walk10] { ai_walk(3); }; +void() dlord_walk10 = [18, dlord_walk11] { ai_walk(4); }; +void() dlord_walk11 = [19, dlord_walk12] { ai_walk(3); }; +void() dlord_walk12 = [20, dlord_walk13] { ai_walk(4); }; +void() dlord_walk13 = [21, dlord_walk14] { ai_walk(6); }; +void() dlord_walk14 = [22, dlord_walk15] { ai_walk(2); }; +void() dlord_walk15 = [23, dlord_walk16] { ai_walk(2); }; +void() dlord_walk16 = [24, dlord_walk17] { ai_walk(4); }; +void() dlord_walk17 = [25, dlord_walk18] { ai_walk(3); }; +void() dlord_walk18 = [26, dlord_walk19] { ai_walk(3); }; +void() dlord_walk19 = [27, dlord_walk20] { ai_walk(3); }; +void() dlord_walk20 = [28, dlord_walk1] { ai_walk(2); }; + +void() dlord_move1 = [9, dlord_move2] { ai_dlord_run(2 * 1.5); shieldon(); }; +void() dlord_move2 = [10, dlord_move3] { ai_dlord_run(5 * 1.5); }; +void() dlord_move3 = [11, dlord_move4] { ai_dlord_run(5 * 1.5); }; +void() dlord_move4 = [12, dlord_move5] { ai_dlord_run(4 * 1.5); }; +void() dlord_move5 = [13, dlord_move6] { ai_dlord_run(4 * 1.5); }; +void() dlord_move6 = [14, dlord_move7] { ai_dlord_run(2 * 1.5); }; +void() dlord_move7 = [15, dlord_move8] { ai_dlord_run(2 * 1.5); }; +void() dlord_move8 = [16, dlord_move9] { ai_dlord_run(3 * 1.5); }; +void() dlord_move9 = [17, dlord_move10] { ai_dlord_run(3 * 1.5); }; +void() dlord_move10 = [18, dlord_move11] { ai_dlord_run(4 * 1.5); }; +void() dlord_move11 = [19, dlord_move12] { ai_dlord_run(3 * 1.5); }; +void() dlord_move12 = [20, dlord_move13] { ai_dlord_run(4 * 1.5); }; +void() dlord_move13 = [21, dlord_move14] { ai_dlord_run(6 * 1.5); }; +void() dlord_move14 = [22, dlord_move15] { ai_dlord_run(2 * 1.5); }; +void() dlord_move15 = [23, dlord_move16] { ai_dlord_run(2 * 1.5); }; +void() dlord_move16 = [24, dlord_move17] { ai_dlord_run(4 * 1.5); }; +void() dlord_move17 = [25, dlord_move18] { ai_dlord_run(3 * 1.5); }; +void() dlord_move18 = [26, dlord_move19] { ai_dlord_run(3 * 1.5); }; +void() dlord_move19 = [27, dlord_move20] { ai_dlord_run(3 * 1.5); }; +void() dlord_move20 = [28, dlord_move1] { ai_dlord_run(2 * 1.5); dlord_idle_sound(); }; + +void() dlord_run1 = [29, dlord_run2] { dlord_idle_sound(); ai_dlord_run(20); }; +void() dlord_run2 = [30, dlord_run3] { ai_dlord_run(25); }; +void() dlord_run3 = [31, dlord_run4] { ai_dlord_run(18); }; +void() dlord_run4 = [32, dlord_run5] { ai_dlord_run(16); }; +void() dlord_run5 = [33, dlord_run6] { ai_dlord_run(14); }; +void() dlord_run6 = [34, dlord_run7] { ai_dlord_run(25); }; +void() dlord_run7 = [35, dlord_run8] { ai_dlord_run(21); }; +void() dlord_run8 = [36, dlord_run1] { ai_dlord_run(13); }; + +void() dlord_pain1 = [37, dlord_pain2] { sound(self, CHAN_VOICE, "dlord/pain.wav", 1, ATTN_NORM); shieldon(); }; +void() dlord_pain2 = [38, dlord_pain3] {}; +void() dlord_pain3 = [39, dlord_pain4] {}; +void() dlord_pain4 = [40, dlord_pain5] {}; +void() dlord_pain5 = [41, dlord_move1] {}; + +void() dlord_die1 = [42, dlord_die2] { ai_forward(10); }; +void() dlord_die2 = [43, dlord_die3] { ai_forward(8); }; +void() dlord_die3 = [44, dlord_die4] { self.solid = SOLID_NOT; ai_forward(7); }; +void() dlord_die4 = [45, dlord_die5] {}; +void() dlord_die5 = [46, dlord_die6] {}; +void() dlord_die6 = [47, dlord_die7] {}; +void() dlord_die7 = [48, dlord_die8] {}; +void() dlord_die8 = [49, dlord_die9] { ai_forward(10); }; +void() dlord_die9 = [50, dlord_die10]{ ai_forward(11); }; +void() dlord_die10 = [51, dlord_die11] {}; +void() dlord_die11 = [52, dlord_die12] { monster_death_postcheck(); }; +void() dlord_die12 = [53, dlord_die12] {}; + +void() dlord_dieb1 = [54, dlord_dieb2] {}; +void() dlord_dieb2 = [55, dlord_dieb3] {}; +void() dlord_dieb3 = [56, dlord_dieb4] { self.solid = SOLID_NOT; }; +void() dlord_dieb4 = [57, dlord_dieb5] {}; +void() dlord_dieb5 = [58, dlord_dieb6] {}; +void() dlord_dieb6 = [59, dlord_dieb7] {}; +void() dlord_dieb7 = [60, dlord_dieb8] {}; +void() dlord_dieb8 = [61, dlord_dieb9] { monster_death_postcheck();}; +void() dlord_dieb9 = [62, dlord_dieb9] {}; + +void() dlord_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + self.effects = 0; + if (!self.gibbed) { + sound(self, CHAN_VOICE, "dlord/death.wav", 1, ATTN_NORM); + if (random() > 0.5) {dlord_die1(); + } else { dlord_dieb1();} + } +}; + +void(float vertoffset) dlord_light = { + local vector org; + local vector dir; + local vector offang; + local vector org2; + + offang_z = offang_z + vertoffset; + makevectors(offang); + self.effects = self.effects | EF_MUZZLEFLASH; + ai_face(); + org = self.origin + offang; + org2 = self.origin + '0 0 20'; + dir = self.enemy.origin + '0 0 16' - org2; + dir = normalize(dir); + traceline(org, self.origin + dir * 200, 1, self); + WriteByte(0, SVC_TEMPENTITY); + WriteByte(0, TE_LIGHTNING2); + WriteEntity(0, self); + WriteCoord(0, org_x); + WriteCoord(0, org_y); + WriteCoord(0, org_z); + WriteCoord(0, trace_endpos_x); + WriteCoord(0, trace_endpos_y); + WriteCoord(0, trace_endpos_z); + LightningDamage(org, trace_endpos, self, 5); +}; + +void() dlord_magicd1 = [93, dlord_magicd2] { ai_face(); shieldoff(); }; +void() dlord_magicd2 = [94, dlord_magicd3] { ai_face(); }; +void() dlord_magicd3 = [95, dlord_magicd4] { ai_face(); }; +void() dlord_magicd4 = [96, dlord_magicd5] { ai_face(); }; +void() dlord_magicd5 = [97, dlord_magicd6] { ai_face(); }; +void() dlord_magicd6 = [98, dlord_magicd7] { ai_face(); }; +void() dlord_magicd7 = [99, dlord_magicd8] { ai_face(); }; +void() dlord_magicd8 = [100, dlord_magicd9] { ai_face(); shieldoff(); }; +void() dlord_magicd9 = [101, dlord_magicd10] { + local float temprnd; + + ai_face(); + temprnd = random(); + if (temprnd < 0.4) { + dlord_shot(0); + } else { + if (temprnd <= 0.7) { + dlord_shot(CONTENT_EMPTY); + } else { + dlord_shot(1); + } + } + sound(self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + self.dlord_firecnt = self.dlord_firecnt + 1; + shieldoff(); + SUB_DLordCheckRefire(dlord_magicd8); +}; +void() dlord_magicd10 = [102, dlord_magicd11] { ai_face(); }; +void() dlord_magicd11 = [103, dlord_magicd12] { ai_face(); }; +void() dlord_magicd12 = [104, dlord_magicd13] { ai_face(); }; +void() dlord_magicd13 = [105, dlord_move1] { ai_face(); }; + +void() dlord_magica1 = [79, dlord_magica2] { ai_face(); shieldoff(); }; +void() dlord_magica2 = [80, dlord_magica3] { ai_face(); shieldoff(); }; +void() dlord_magica3 = [81, dlord_magica4] { ai_face(); shieldoff(); }; +void() dlord_magica4 = [82, dlord_magica5] { ai_face(); shieldoff(); }; +void() dlord_magica5 = [83, dlord_magica6] { ai_face(); shieldoff(); }; +void() dlord_magica6 = [84, dlord_magica7] { ai_face(); shieldoff(); }; +void() dlord_magica7 = [85, dlord_magica8] { dlord_light(40); sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); shieldoff(); }; +void() dlord_magica8 = [86, dlord_magica9] { dlord_light(25); shieldoff(); }; +void() dlord_magica9 = [87, dlord_magica10] { dlord_light(0); dguard_hit(); shieldoff(); }; +void() dlord_magica10 = [88, dlord_magica11] { dlord_light(-20); shieldoff(); }; +void() dlord_magica11 = [89, dlord_magica12] { dlord_light(-24); shieldoff(); }; +void() dlord_magica12 = [90, dlord_magica13] { dlord_light(-14); shieldoff(); }; +void() dlord_magica13 = [91, dlord_magica14] { ai_face(); }; +void() dlord_magica14 = [92, dlord_move1] { ai_face(); }; + +void() dlord_char_a1 = [63, dlord_char_a2] { ai_charge(20); }; +void() dlord_char_a2 = [64, dlord_char_a3] { ai_charge(25); }; +void() dlord_char_a3 = [65, dlord_char_a4] { ai_charge(18); }; +void() dlord_char_a4 = [66, dlord_char_a5] { ai_charge(16); }; +void() dlord_char_a5 = [67, dlord_char_a6] { ai_charge(14); }; +void() dlord_char_a6 = [68, dlord_char_a7] { ai_charge(20); ai_melee(); }; +void() dlord_char_a7 = [69, dlord_char_a8] { ai_charge(21); ai_melee(); }; +void() dlord_char_a8 = [70, dlord_char_a9] { ai_charge(13); ai_melee(); }; +void() dlord_char_a9 = [71, dlord_char_a10] { ai_charge(20); ai_melee(); }; +void() dlord_char_a10 = [72, dlord_char_a11] { ai_charge(20); ai_melee(); }; +void() dlord_char_a11 = [73, dlord_char_a12] { ai_charge(18); ai_melee(); }; +void() dlord_char_a12 = [74, dlord_char_a13] { ai_charge(16); }; +void() dlord_char_a13 = [75, dlord_char_a14] { ai_charge(14); }; +void() dlord_char_a14 = [76, dlord_char_a15] { ai_charge(25); }; +void() dlord_char_a15 = [77, dlord_char_a16] { ai_charge(21); }; +void() dlord_char_a16 = [78, dlord_run1] { ai_charge(13); }; + +void() dlord_slice1 = [112, dlord_slice2] { ai_charge(9); }; +void() dlord_slice2 = [113, dlord_slice3] { ai_charge(6); }; +void() dlord_slice3 = [114, dlord_slice4] { ai_charge(13); }; +void() dlord_slice4 = [115, dlord_slice5] { ai_charge(4); }; +void() dlord_slice5 = [116, dlord_slice6] { ai_charge(TE_WIZSPIKE); ai_melee(); }; +void() dlord_slice6 = [117, dlord_slice7] { ai_charge(15); ai_melee(); }; +void() dlord_slice7 = [118, dlord_slice8] { ai_charge(SECRET_NO_SHOOT); ai_melee(); }; +void() dlord_slice8 = [119, dlord_slice9] { ai_charge(2); ai_melee(); }; +void() dlord_slice9 = [120, dlord_slice10] { ai_melee(); }; +void() dlord_slice10 = [121, dlord_run1] { ai_charge(3); }; + +void() dlord_smash1 = [122, dlord_smash2] { ai_charge(1); }; +void() dlord_smash2 = [123, dlord_smash3] { ai_charge(13); }; +void() dlord_smash3 = [124, dlord_smash4] { ai_charge(9); }; +void() dlord_smash4 = [125, dlord_smash5] { ai_charge(TE_TELEPORT); }; +void() dlord_smash5 = [126, dlord_smash6] { ai_charge(TE_LAVASPLASH); ai_melee(); }; +void() dlord_smash6 = [127, dlord_smash7] { ai_charge(TE_WIZSPIKE); ai_melee(); }; +void() dlord_smash7 = [128, dlord_smash8] { ai_charge(TE_EXPLOSION2); ai_melee(); }; +void() dlord_smash8 = [129, dlord_smash9] { ai_charge(2); ai_melee(); }; +void() dlord_smash9 = [130, dlord_smash10] { ai_charge(3); ai_melee(); }; +void() dlord_smash10 = [131, dlord_smash11] { ai_charge(0); }; +void() dlord_smash11 = [132, dlord_run1] { ai_charge(0); }; + +void() dlord_watk1 = [133, dlord_watk2] { ai_charge(2); }; +void() dlord_watk2 = [134, dlord_watk3] { ai_charge(0); }; +void() dlord_watk3 = [135, dlord_watk4] { ai_charge(0); }; +void() dlord_watk4 = [136, dlord_watk5] { ai_melee(); }; +void() dlord_watk5 = [137, dlord_watk6] { ai_melee(); }; +void() dlord_watk6 = [138, dlord_watk7] { ai_melee(); }; +void() dlord_watk7 = [139, dlord_watk8] { ai_charge(1); }; +void() dlord_watk8 = [140, dlord_watk9] { ai_charge(4); }; +void() dlord_watk9 = [141, dlord_watk10] { ai_charge(5); }; +void() dlord_watk10 = [142, dlord_watk11] { ai_charge(3); ai_melee(); }; +void() dlord_watk11 = [143, dlord_watk12] { ai_charge(2); ai_melee(); }; +void() dlord_watk12 = [144, dlord_watk13] { ai_charge(2); ai_melee(); }; +void() dlord_watk13 = [145, dlord_watk14] { ai_charge(0); }; +void() dlord_watk14 = [146, dlord_watk15] { ai_charge(0); }; +void() dlord_watk15 = [147, dlord_watk16] { ai_charge(0); }; +void() dlord_watk16 = [148, dlord_watk17] { ai_charge(1); }; +void() dlord_watk17 = [149, dlord_watk18] { ai_charge(1); ai_melee(); }; +void() dlord_watk18 = [150, dlord_watk19] { ai_charge(3); ai_melee(); }; +void() dlord_watk19 = [151, dlord_watk20] { ai_charge(4); ai_melee(); }; +void() dlord_watk20 = [152, dlord_watk21] { ai_charge(6); }; +void() dlord_watk21 = [153, dlord_watk22] { ai_charge(TE_WIZSPIKE); }; +void() dlord_watk22 = [154, dlord_run1] { ai_charge(3); }; + +void() dlord_idle_sound = { + if (random() < 0.2) + sound(self, CHAN_VOICE, "dlord/idle.wav", 1, ATTN_NORM); +}; + +void(entity inflictor, entity attacker, float damage) dlord_pain = { + if (self.pain_finished > time) + return; + + sound(self, CHAN_VOICE, "dlord/pain.wav", 1, ATTN_NORM); + if (random() * 50 > damage) + return; + + self.pain_finished = time + TE_EXPLOSION2; + dlord_pain1(); +}; + +void() magic_choice = { + local vector dist; + local float d; + dist = self.enemy.origin - self.origin; + dist_z = 0; + d = vlen(dist); + if (d < 200) { + if (random() <= 0.4 || self.ltime < time) { + self.ltime = time + 5; + shieldon(); + dlord_magica1(); + } + } else { + if (d >= 200) { + if (random() <= 0.6 || self.ltime < time) { + self.ltime = time + 3; + shieldon(); + dlord_magicd1(); + } + } + } +}; + +void() monster_death_lord = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_hknight.mdl"; + precache_model2("progs/ad171/mon_hknight.mdl"); + precache_model("progs/quoth2pt2full/dspike.mdl"); + self.headmdl = "progs/h_hellkn.mdl"; + precache_model2("progs/h_hellkn.mdl"); + precache_sound("hknight/attack1.wav"); + precache_sound("dlord/death.wav"); + precache_sound("dlord/pain.wav"); + precache_sound("dlord/sight.wav"); + precache_sound("dlord/idle.wav"); + precache_sound("knight/sword1.wav"); + precache_sound("knight/sword2.wav"); + precache_sound("dguard/slhit.wav"); + precache_sound("dguard/slmiss1.wav"); + precache_sound("dguard/slmiss2.wav"); + self.th_stand = dlord_stand1; + self.th_walk = dlord_walk1; + self.th_run = dlord_move1; + self.th_melee = dlord_magica1; + self.th_missile = magic_choice; + self.th_pain = dlord_pain; + self.th_die = dlord_die; + self.skin = 7; + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 400; + self.gibhealth = -60; + self.gibbed = FALSE; + self.pain_flinch = 80; // Take a lot to go into pain + self.pain_timeout = 2; // Shambler like pain level + self.infightextra = 2; // Double damage to other monsters + self.steptype = FS_TYPEHEAVY; // Heavy Player feet + self.hittype = HIT_METAL; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was executed by a Death Lord\n"; + + self.classtype = CT_MONHELLK; + self.classgroup = CG_DCAPTAIN; + self.classmove = MON_MOVEWALK; + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_dog.qc b/QC_other/QC_keep/mon_dog.qc new file mode 100644 index 00000000..58514761 --- /dev/null +++ b/QC_other/QC_keep/mon_dog.qc @@ -0,0 +1,456 @@ +/*============================================================================== +DOG +==============================================================================*/ +$cd id1/models/dog +$origin 0 0 24 +$base base +$skin skin + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 deathb9 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 +$frame painb9 painb10 painb11 painb12 painb13 painb14 painb15 painb16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 + +$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +// Idle 1 - Growling +$frame idlea1 idlea2 idlea3 idlea4 idlea5 idlea6 idlea7 idlea8 +$frame idlea9 idlea10 idlea11 idlea12 idlea13 idlea14 idlea15 idlea16 +$frame idlea17 idlea18 + +// Idle 2 - Sniffing ground +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 +$frame idleb9 idleb10 idleb11 idleb12 idleb13 idleb14 + +// Walk B - walking and sniffing +$frame walkb1 walkb2 walkb3 walkb4 walkb5 walkb6 walkb7 walkb8 + +// Idle 3 - Howling at the moon +$frame idlec1 idlec2 idlec3 idlec4 idlec5 idlec6 idlec7 idlec8 +$frame idlec9 idlec10 idlec11 idlec12 idlec13 idlec14 + +void() dog_walkb1; + +//============================================================================ +void() dog_idlea1 =[ $idlea1, dog_idlea2 ] {self.idlebusy = TRUE; + monster_idle_sound(); ai_stand();}; +void() dog_idlea2 =[ $idlea2, dog_idlea3 ] {ai_stand();}; +void() dog_idlea3 =[ $idlea3, dog_idlea4 ] {ai_stand();}; +void() dog_idlea4 =[ $idlea4, dog_idlea5 ] {ai_stand();}; +void() dog_idlea5 =[ $idlea5, dog_idlea6 ] {ai_stand();}; +void() dog_idlea6 =[ $idlea6, dog_idlea7 ] {ai_stand();}; +void() dog_idlea7 =[ $idlea7, dog_idlea8 ] {ai_stand();}; +void() dog_idlea8 =[ $idlea8, dog_idlea9 ] {ai_stand();}; +void() dog_idlea9 =[ $idlea9, dog_idlea10 ] {ai_stand();}; +void() dog_idlea10=[ $idlea10, dog_idlea11 ] {ai_stand();}; +void() dog_idlea11=[ $idlea11, dog_idlea12 ] {ai_stand();}; +void() dog_idlea12=[ $idlea12, dog_idlea13 ] {ai_stand();}; +void() dog_idlea13=[ $idlea13, dog_idlea14 ] {ai_stand();}; +void() dog_idlea14=[ $idlea14, dog_idlea15 ] {ai_stand();}; +void() dog_idlea15=[ $idlea15, dog_idlea16 ] {ai_stand();}; +void() dog_idlea16=[ $idlea16, dog_idlea17 ] {ai_stand();}; +void() dog_idlea17=[ $idlea17, dog_idlea18 ] {ai_stand();}; +void() dog_idlea18=[ $idlea18, dog_stand1 ] {ai_stand();}; + +//============================================================================ +void() dog_idleb1 =[ $idleb1, dog_idleb2 ] {self.idlebusy = TRUE; + monster_idle_sound(); ai_stand();}; +void() dog_idleb2 =[ $idleb2, dog_idleb3 ] {ai_stand();}; +void() dog_idleb3 =[ $idleb3, dog_idleb4 ] {ai_stand();}; +void() dog_idleb4 =[ $idleb4, dog_idleb5 ] {ai_stand();}; +void() dog_idleb5 =[ $idleb5, dog_idleb6 ] {ai_stand();}; +void() dog_idleb6 =[ $idleb6, dog_idleb7 ] {ai_stand();}; +void() dog_idleb7 =[ $idleb7, dog_idleb8 ] {ai_stand();}; +void() dog_idleb8 =[ $idleb8, dog_idleb9 ] {ai_stand();}; +void() dog_idleb9 =[ $idleb9, dog_idleb10 ] {ai_stand();}; +void() dog_idleb10=[ $idleb10, dog_idleb11 ] {ai_stand();}; +void() dog_idleb11=[ $idleb11, dog_idleb12 ] {ai_stand();}; +void() dog_idleb12=[ $idleb12, dog_idleb13 ] {ai_stand();}; +void() dog_idleb13=[ $idleb13, dog_idleb14 ] {ai_stand();}; +void() dog_idleb14=[ $idleb14, dog_stand1 ] {ai_stand();}; + +//============================================================================ +void() dog_idlec1 =[ $idlec1, dog_idlec2 ] {self.idlebusy = TRUE; + monster_idle_sound(); ai_stand();}; +void() dog_idlec2 =[ $idlec2, dog_idlec3 ] {ai_stand();}; +void() dog_idlec3 =[ $idlec3, dog_idlec4 ] {ai_stand();}; +void() dog_idlec4 =[ $idlec4, dog_idlec5 ] {ai_stand();}; +void() dog_idlec5 =[ $idlec5, dog_idlec6 ] {ai_stand();}; +void() dog_idlec6 =[ $idlec6, dog_idlec7 ] {ai_stand();}; +void() dog_idlec7 =[ $idlec7, dog_idlec8 ] {ai_stand();}; +void() dog_idlec8 =[ $idlec8, dog_idlec9 ] {ai_stand();}; +void() dog_idlec9 =[ $idlec9, dog_idlec10 ] {ai_stand();}; +void() dog_idlec10=[ $idlec10, dog_idlec11 ] {ai_stand();}; +void() dog_idlec11=[ $idlec11, dog_idlec12 ] {ai_stand();}; +void() dog_idlec12=[ $idlec12, dog_idlec13 ] {ai_stand();}; +void() dog_idlec13=[ $idlec13, dog_idlec14 ] {ai_stand();}; +void() dog_idlec14=[ $idlec14, dog_stand1 ] {ai_stand();}; + +//============================================================================ +void() dog_stand1 =[ $stand1, dog_stand2 ] {self.idlebusy = FALSE; ai_stand();}; +void() dog_stand2 =[ $stand2, dog_stand3 ] {ai_stand();}; +void() dog_stand3 =[ $stand3, dog_stand4 ] {ai_stand();}; +void() dog_stand4 =[ $stand4, dog_stand5 ] {ai_stand();}; +void() dog_stand5 =[ $stand5, dog_stand6 ] {ai_stand();}; +void() dog_stand6 =[ $stand6, dog_stand7 ] {ai_stand();}; +void() dog_stand7 =[ $stand7, dog_stand8 ] {ai_stand();}; +void() dog_stand8 =[ $stand8, dog_stand9 ] {ai_stand();}; +void() dog_stand9 =[ $stand9, dog_stand1 ] { + if (random() < MON_IDLE_ANIMATION) { + self.lip = random(); + if (self.lip < 0.2) self.think = dog_idlec1; // Howling at moon + else if (self.lip < 0.4) self.think = dog_idleb1; // sniff ground + else self.think = dog_idlea1; // Growling + } + ai_stand(); +}; + +//============================================================================ +void() dog_walk1 =[ $walk1 , dog_walk2 ] {monster_idle_sound(); ai_walk(8);}; +void() dog_walk2 =[ $walk2 , dog_walk3 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walk3 =[ $walk3 , dog_walk4 ] {ai_walk(8);}; +void() dog_walk4 =[ $walk4 , dog_walk5 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walk5 =[ $walk5 , dog_walk6 ] {ai_walk(8);}; +void() dog_walk6 =[ $walk6 , dog_walk7 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walk7 =[ $walk7 , dog_walk8 ] {ai_walk(8);}; +void() dog_walk8 =[ $walk8 , dog_walk1 ] { + // Random chance the dog will sniff the ground when walking/patrolling + if (random() < MON_IDLE_ANIMATION) self.think = dog_walkb1; + monster_footstep(FALSE); ai_walk(8); +}; + +//---------------------------------------------------------------------- +void() dog_walkb1 =[ $walkb1 , dog_walkb2 ] {self.idlebusy = TRUE; monster_idle_sound();ai_walk(8);}; +void() dog_walkb2 =[ $walkb2 , dog_walkb3 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walkb3 =[ $walkb3 , dog_walkb4 ] {ai_walk(8);}; +void() dog_walkb4 =[ $walkb4 , dog_walkb5 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walkb5 =[ $walkb5 , dog_walkb6 ] {ai_walk(8);}; +void() dog_walkb6 =[ $walkb6 , dog_walkb7 ] {monster_footstep(FALSE); ai_walk(8);}; +void() dog_walkb7 =[ $walkb7 , dog_walkb8 ] {ai_walk(8);}; +void() dog_walkb8 =[ $walkb8 , dog_walk1 ] {monster_footstep(FALSE); ai_walk(8);}; + +//============================================================================ +void() dog_run1 =[ $run1 , dog_run2 ] {monster_idle_sound(); ai_run(16);}; +void() dog_run2 =[ $run2 , dog_run3 ] {monster_footstep(FALSE); ai_run(32);}; +void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);}; +void() dog_run4 =[ $run4 , dog_run5 ] {monster_footstep(FALSE); ai_run(20);}; +void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);}; +void() dog_run6 =[ $run6 , dog_run7 ] {ai_run(32);}; +void() dog_run7 =[ $run7 , dog_run8 ] {monster_footstep(FALSE); ai_run(16);}; +void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);}; +void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);}; +void() dog_run10 =[ $run10 , dog_run11 ] {monster_footstep(FALSE); ai_run(20);}; +void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);}; +void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);}; + +//=========================================================================== +// melee - dog_bite +// Standardized layout (matching ai_melee (aisubs.qc) +// Added z depth check on attacks +/- 64 units +// Added extra blood (touch version, no arc) +// Changed some explicit values to constant variables +//=========================================================================== +void() dog_bite = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEDOG)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + // Dog bite is nasty damage + ldmg = (random() + random() + random()) * 8; + if (self.classname == "monster_hell_hound") ldmg = ldmg + 5; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Spawn some blood from mouth + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() dog_atta1 =[ $attack1, dog_atta2 ] {ai_charge(10);}; +void() dog_atta2 =[ $attack2, dog_atta3 ] {ai_charge(10);}; +void() dog_atta3 =[ $attack3, dog_atta4 ] {ai_charge(10);}; +void() dog_atta4 =[ $attack4, dog_atta5 ] { +sound (self, CHAN_VOICE, "dog/dattack1.wav", 1, ATTN_NORM); +dog_bite();}; +void() dog_atta5 =[ $attack5, dog_atta6 ] {ai_charge(10);}; +void() dog_atta6 =[ $attack6, dog_atta7 ] {ai_charge(10);}; +void() dog_atta7 =[ $attack7, dog_atta8 ] {monster_footstep(FALSE);ai_charge(10);}; +void() dog_atta8 =[ $attack8, dog_run1 ] {ai_charge(10);}; + +//============================================================================ +// range - springy feet +//============================================================================ +void() Dog_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + + // Keep track of how many times touched the same object + if (self.jumptouch == other) self.jump_flag = time + MONAI_JUMPTIMEOUT; + self.jumptouch = other; // Keep track of touch target + + // Do not damage other dogs with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 10 + 10*random(); + if (self.classname == "monster_hell_hound") ldmg = ldmg + 10; + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self.enemy, self.enemy, ldmg*3); + } + } + + // Is the dog floating in the air? + if (!checkbottom(self)) { + // Is the dog standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() dog_leap1 =[ $leap1, dog_leap2 ] {ai_face();}; +void() dog_leap2 =[ $leap2, dog_leap3 ] { + ai_face(); + self.jump_flag = time; // No jump time limits + self.touch = Dog_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 300 + '0 0 200'; + if (self.classname == "monster_hell_hound") self.velocity = v_forward * 600 + ('0 0 200' * Gs()); + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() dog_leap3 =[ $leap3, dog_leap4 ] {}; +void() dog_leap4 =[ $leap4, dog_leap5 ] {}; +void() dog_leap5 =[ $leap5, dog_leap6 ] {}; +void() dog_leap6 =[ $leap6, dog_leap6 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = dog_leap2; + } + self.oldorigin = self.origin; +}; +void() dog_leap7 =[ $leap7, dog_leap8 ] {monster_footstep(FALSE);}; +void() dog_leap8 =[ $leap8, dog_leap9 ] {monster_footstep(FALSE);}; +void() dog_leap9 =[ $leap9, dog_run1 ] {ai_resetangles();}; + +/*====================================================================== + PAIN +========================================================================*/ +void() dog_pain1 =[ $pain1 , dog_pain2 ] {}; +void() dog_pain2 =[ $pain2 , dog_pain3 ] {}; +void() dog_pain3 =[ $pain3 , dog_pain4 ] {}; +void() dog_pain4 =[ $pain4 , dog_pain5 ] {}; +void() dog_pain5 =[ $pain5 , dog_pain6 ] {}; +void() dog_pain6 =[ $pain6 , dog_run1 ] {monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() dog_painb1 =[ $painb1 , dog_painb2 ] {}; +void() dog_painb2 =[ $painb2 , dog_painb3 ] {}; +void() dog_painb3 =[ $painb3 , dog_painb4 ] {ai_pain(4);}; +void() dog_painb4 =[ $painb4 , dog_painb5 ] {ai_pain(12);}; +void() dog_painb5 =[ $painb5 , dog_painb6 ] {ai_pain(12);}; +void() dog_painb6 =[ $painb6 , dog_painb7 ] {ai_pain(2);}; +void() dog_painb7 =[ $painb7 , dog_painb8 ] {}; +void() dog_painb8 =[ $painb8 , dog_painb9 ] {ai_pain(4);}; +void() dog_painb9 =[ $painb9 , dog_painb10 ] {}; +void() dog_painb10 =[ $painb10 , dog_painb11 ] {ai_pain(10);}; +void() dog_painb11 =[ $painb11 , dog_painb12 ] {monster_footstep(FALSE);}; +void() dog_painb12 =[ $painb12 , dog_painb13 ] {monster_footstep(FALSE);}; +void() dog_painb13 =[ $painb13 , dog_painb14 ] {}; +void() dog_painb14 =[ $painb14 , dog_painb15 ] {}; +void() dog_painb15 =[ $painb15 , dog_painb16 ] {}; +void() dog_painb16 =[ $painb16 , dog_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dog_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() > 0.5) dog_pain1 (); + else { + dog_painb1 (); // roll over + self.pain_finished = time + 2; // long animation + } + } + } +}; + +//============================================================================ +void() dog_die1 =[ $death1, dog_die2 ] {}; +void() dog_die2 =[ $death2, dog_die3 ] {monster_check_gib();}; +void() dog_die3 =[ $death3, dog_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dog_die4 =[ $death4, dog_die5 ] {}; +void() dog_die5 =[ $death5, dog_die6 ] {}; +void() dog_die6 =[ $death6, dog_die7 ] {}; +void() dog_die7 =[ $death7, dog_die8 ] {}; +void() dog_die8 =[ $death8, dog_die9 ] {monster_death_postcheck();}; +void() dog_die9 =[ $death9, dog_die9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {}; +void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {monster_check_gib();}; +void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {}; +void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {}; +void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {}; +void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {}; +void() dog_dieb8 =[ $deathb8, dog_dieb9 ] {monster_death_postcheck();}; +void() dog_dieb9 =[ $deathb9, dog_dieb9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() dog_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); + + if (random() > 0.5) dog_die1 (); + else dog_dieb1 (); + } +}; + +void(vector start, vector dir, float sped, float up, float damage) Ryu_Fire; + +void(vector st) Dog_Fire = { + local vector dir, spot; + + makevectors (self.angles); + spot = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + dir = Maim_Line (spot, self.enemy.origin, 1000, world, '1.2 0.9 0'); + Ryu_Fire (spot, dir, 1000, 0, 0); +}; + +void() dog_fire1 =[ $attack1, dog_fire2 ] {ai_face();}; +void() dog_fire2 =[ $attack3, dog_fire3 ] {ai_face(); sound (self, CHAN_WEAPON, "dragon/fire.wav", 1, ATTN_NORM); Dog_Fire('25 2 6');}; +void() dog_fire3 =[ $attack3, dog_fire4 ] {ai_face(); Dog_Fire('25 2 6');}; +void() dog_fire4 =[ $attack2, dog_fire5 ] {ai_face(); Dog_Fire('25 2 2');}; +void() dog_fire5 =[ $attack1, dog_run1 ] {ai_face();}; + +// Hell hounds' missile function. +void() dog_missile = { + if (vlen(self.enemy.origin - self.origin) < 200) + dog_leap1 (); + else + dog_fire1 (); +}; + +/*====================================================================== +/*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush +======================================================================*/ +void() monster_dog = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_dog.mdl"; + if (self.classname == "monster_hell_hound") self.mdl = "progs/dog.mdl"; + self.headmdl = "progs/h_dog.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + + self.idle_sound = "dog/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("dog/dattack1.wav"); + precache_sound ("dog/ddeath.wav"); + self.pain_sound = "dog/dpain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("dragon/fire.wav"); + precache_sound ("dragon/firehit.wav"); + + self.sight_sound = "dog/dsight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = '-32 -32 -24'; // Original mega large bbox + self.idmaxs = '32 32 40'; + if (self.bboxtype < 1) self.bboxtype = BBOX_DOG; + if (self.health < 1) self.health = 25; + if (self.classname == "monster_hell_hound") { + self.classtype = CT_MONHELLHOUND; + self.th_missile = dog_missile; + self.health = self.health + 125; //def = 150 + self.pain_flinch = 50; // Med response to pain + } else { + self.pain_flinch = 10; // Easy response to pain + self.classtype = CT_MONDOG; + } + self.gibhealth = -35; + self.gibbed = FALSE; + self.steptype = FS_TYPESLOW; // Tiny feet + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '24 0 10'; // Bite attack offset + self.mass = MASS_LIGHT; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was mauled by a Rottweiler\n"; + + self.th_checkattack = DogCheckAttack; + self.th_stand = dog_stand1; + self.th_walk = dog_walk1; + self.th_run = dog_run1; + self.th_pain = dog_pain; + self.th_die = dog_die; + self.th_melee = dog_atta1; + self.th_jump = dog_leap1; + self.th_jumpexit = dog_leap8; + + self.classgroup = CG_DOG; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +void () monster_hell_hound = { + self.skin = 3; + if (self.deathstring == "") self.deathstring = " was eaten by a Hell Hound\n"; + monster_dog(); +}; diff --git a/QC_other/QC_keep/mon_dragon.qc b/QC_other/QC_keep/mon_dragon.qc new file mode 100644 index 00000000..741baf21 --- /dev/null +++ b/QC_other/QC_keep/mon_dragon.qc @@ -0,0 +1,645 @@ +void () dragon_fireball; +void () dragon_melee1; +float DDIE_FALLING = 1.000; +float DDIE_STOPPED = 2.000; +float DDIE_EXPLODED = 3.000; +float DT_ROOM_A = 1.000; +float DT_ROOM_B = 2.000; +float DT_ROOM_C = 4.000; +float DRAGON_ROGUE = 2; + +void (string gibname, float dm) AccelerateGib = { + local entity new; + local float offset1; + + new = spawn (); + new.origin = self.origin; + setmodel (new,gibname); + setsize (new,'-8.000 -8.000 -8.000','8.000 8.000 8.000'); + new.velocity = (-1.250 * self.velocity); + makevectors (new.velocity); + offset1 = ((random () * 300.000) - 150.000); + new.velocity = (new.velocity + (v_right * offset1)); + offset1 = ((random () * 300.000) - 150.000); + new.velocity = (new.velocity + (v_up * offset1)); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = (random () * 600.000); + new.avelocity_y = (random () * 600.000); + new.avelocity_z = (random () * 600.000); + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = ((time + 10) + (random () * 10)); + new.frame = FALSE; + new.flags = FALSE; +}; + +void (float gibCount) ViolentDeath = { + while ( (gibCount > FALSE) ) { + AccelerateGib (GIB1_BLOOD,(-4 * gibCount)); + AccelerateGib (GIB2_BLOOD,(-6 * gibCount)); + AccelerateGib (GIB3_BLOOD,(-8 * gibCount)); + gibCount = (gibCount - 3); + } +}; + +void () dragon_stop_attack = { + if (self.dragonAttacking == FALSE) + return ; + + self.attack_finished = (time + (random () * FL_SWIM) ); + self.dragonAttacking = FALSE; + traceline (self.origin,self.movetarget.origin,TRUE,world); + if ( (trace_fraction == TRUE) ) + return ; + else + bprint ("Error: Dragon cannot get to next target!\n"); +}; + +void () dragon_check_attack = { + local vector vec; + local float dot; + + if ( (self.dragonAttacking == TRUE) ) + return ; + + if ( (self.th_missile == SUB_Null) ) + return ; + + if ( (self.attack_finished > time) ) + return ; + + if ( (self.enemy.health < FALSE) ) + self.enemy = world; + + if ( (self.enemy.flags & FL_NOTARGET) ) + return ; + + if ( (self.enemy == world) ) { + FindTarget (); + } else { + makevectors (self.angles); + vec = normalize ((self.enemy.origin - self.origin)); + dot = (vec * v_forward); + if ( (dot > 0.300) ) { + traceline (self.origin,self.enemy.origin,TRUE,world); + if ( (trace_fraction == TRUE) ) { + dot = vlen ((self.enemy.origin - self.origin)); + if ( (dot < 350.000) ) { + self.dragonAttacking = TRUE; + self.think = dragon_melee1; + return ; + } else { + self.dragonAttacking = TRUE; + self.think = self.th_missile; + } + } + } + } +}; + +void (float dist) dragon_move = { + local vector moveDir; + local vector moveAngles; + local float leftTurn; + local float rightTurn; + local float turnOffset; + local entity oldEnemy; + + if ( (self.health < TRUE) ) { remove (self); return ; } + if ( (self.dragonAttacking == FALSE) ) + dragon_check_attack (); + + oldEnemy = self.enemy; + if ( (self.dragonAttacking == FALSE) ) { + moveDir = (self.movetarget.origin - self.origin); + moveAngles = vectoangles (moveDir); + self.enemy = self.movetarget; + } else { + moveDir = (self.enemy.origin - self.origin); + moveAngles = vectoangles (moveDir); + } + turnOffset = (self.angles_y - moveAngles_y); + if ( (turnOffset != FALSE) ) { + turnOffset = (180.000 - self.angles_y); + leftTurn = (anglemod ((moveAngles_y + turnOffset)) - 180.000); + rightTurn = (180.000 - anglemod ((moveAngles_y + turnOffset))); + if ( (leftTurn < FALSE) ) { + leftTurn = 360.000; + } else { + if ( (rightTurn < FALSE) ) + rightTurn = 360.000; + } + self.yaw_speed = MOVETYPE_BOUNCE; + if ( (rightTurn < 180.000) ) { + if ( (self.yaw_speed < rightTurn) ) { + self.angles_y = (self.angles_y - self.yaw_speed); + } else { + self.angles_y = moveAngles_y; + } + if ( (rightTurn > MOVETYPE_FLY) ) { + self.angles_z = (self.angles_z + MOVETYPE_FLY); + if ( (self.angles_z > SVC_INTERMISSION) ) + self.angles_z = SVC_INTERMISSION; + } + turnOffset = rightTurn; + } else { + if ( (self.yaw_speed < rightTurn) ) { + self.angles_y = (self.angles_y + self.yaw_speed); + } else { + self.angles_y = moveAngles_y; + } + if ( (leftTurn > MOVETYPE_FLY) ) { + self.angles_z = (self.angles_z - MOVETYPE_FLY); + if ( (self.angles_z < -30.000) ) + self.angles_z = -30.000; + } + turnOffset = leftTurn; + } + } else { + if ( (self.angles_z != FALSE) ) { + if ( (self.angles_z < CONTENT_LAVA) ) { + self.angles_z = (self.angles_z + MOVETYPE_FLY); + } else { + if ( (self.angles_z < MOVETYPE_FLY) ) { + self.angles_z = FALSE; + } else { + if ( (self.angles_z > MOVETYPE_FLY) ) + self.angles_z = (self.angles_z - MOVETYPE_FLY); + } + } + } + } + if ( (moveDir_z > MOVETYPE_FLY) ) { + setorigin (self,(self.origin + '0.000 0.000 5.000')); + } else { + if ( (moveDir_z < CONTENT_LAVA) ) + setorigin (self,(self.origin - '0.000 0.000 5.000')); + } + moveAngles = self.origin; + walkmove (self.angles_y,dist); + if ( (moveAngles == self.origin) ) + movetogoal (dist); + + self.enemy = oldEnemy; +}; + +void () dragon_stand1 = [ 1.000, dragon_walk1 ] {}; + +void () dragon_walk1; +void () dragon_walk3; +void () dragon_walk5; +void () dragon_walk7; +void () dragon_walk9; +void () dragon_walk11; +void () dragon_walk13; + +void () dragon_atk_a1 = [ 43.000, dragon_atk_a2 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_a2 = [ 44.000, dragon_atk_a3 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_a3 = [ 45.000, dragon_walk5 ] { dragon_move (17.000); dragon_fireball (); dragon_stop_attack (); }; + +void () dragon_atk_b1 = [ 46.000, dragon_atk_b2 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_b2 = [ 47.000, dragon_atk_b3 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_b3 = [ 48.000, dragon_walk7 ] { dragon_move (17.000); dragon_fireball (); dragon_stop_attack (); }; + +void () dragon_atk_c1 = [ 49.000, dragon_atk_c2 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_c2 = [ 50.000, dragon_atk_c3 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_c3 = [ 51.000, dragon_walk9 ] { dragon_move (17.000); dragon_fireball (); dragon_stop_attack (); }; + +void () dragon_atk_d1 = [ 52.000, dragon_atk_d2 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_d2 = [ 53.000, dragon_atk_d3 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_d3 = [ 54.000, dragon_walk11 ] { dragon_move (17.000); dragon_fireball (); dragon_stop_attack (); }; + +void () dragon_atk_e1 = [ 55.000, dragon_atk_e2 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_e2 = [ 56.000, dragon_atk_e3 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_e3 = [ 57.000, dragon_walk13 ] { dragon_move (17.000); dragon_fireball (); dragon_stop_attack (); }; + +void () dragon_atk_f1 = [ 58.000, dragon_atk_f2 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_f2 = [ 59.000, dragon_atk_f3 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_f3 = [ 60.000, dragon_atk_f4 ] { dragon_move (17.000); dragon_fireball (); }; +void () dragon_atk_f4 = [ 60.000, dragon_walk3 ] { dragon_move (17.000); dragon_fireball (); dragon_stop_attack (); }; + +void () dragon_walk1 = [ 1.000, dragon_walk2 ] { + if ( self.dragonAttacking ) + dragon_stop_attack (); + + self.th_missile = dragon_atk_a1; + self.dragonPainSequence = TRUE; + dragon_move (17.000); + if ( (random () < 0.200) ) + sound (self,CHAN_VOICE,"dragon/active.wav",TRUE,ATTN_IDLE); +}; +void () dragon_walk2 = [ 2.000, dragon_walk3 ] { self.th_missile = SUB_Null; dragon_move (17.000); }; +void () dragon_walk3 = [ 3.000, dragon_walk4 ] { self.th_missile = dragon_atk_b1; dragon_move (17.000); self.dragonPainSequence = 2; }; +void () dragon_walk4 = [ 4.000, dragon_walk5 ] { self.th_missile = SUB_Null; dragon_move (17.000); }; +void () dragon_walk5 = [ 5.000, dragon_walk6 ] { self.th_missile = dragon_atk_c1; dragon_move (17.000); self.dragonPainSequence = 3; }; +void () dragon_walk6 = [ 6.000, dragon_walk7 ] { self.th_missile = SUB_Null; dragon_move (17.000); }; +void () dragon_walk7 = [ 7.000, dragon_walk8 ] { self.th_missile = dragon_atk_d1; dragon_move (17.000); self.dragonPainSequence = 4; }; +void () dragon_walk8 = [ 8.000, dragon_walk9 ] { self.th_missile = SUB_Null; dragon_move (17.000); }; +void () dragon_walk9 = [ 9.000, dragon_walk10 ] { self.th_missile = dragon_atk_e1; dragon_move (17.000); self.dragonPainSequence = 5; }; +void () dragon_walk10 = [ 10.000, dragon_walk11 ] { self.th_missile = SUB_Null; dragon_move (17.000); }; +void () dragon_walk11 = [ 11.000, dragon_walk12 ] { self.th_missile = dragon_atk_f1; dragon_move (17.000); self.dragonPainSequence = 6; }; +void () dragon_walk12 = [ 12.000, dragon_walk13 ] { self.th_missile = SUB_Null; dragon_move (17.000); }; +void () dragon_walk13 = [ 13.000, dragon_walk1 ] { self.th_missile = SUB_Null; dragon_move (17.000); self.dragonPainSequence = 1; }; + +void () FireballTouch = { + local vector org; + local vector rndpos; + local float partcnt; + local float partcolor; + + if (other == self.owner) + return ; + + org = self.origin; + org_z = (org_z+8); + T_Damage (other,self,self.owner,3,DAMARMOR); + sound (self,CHAN_WEAPON,"misc/quakeend.wav",TRUE,ATTN_NORM); + partcnt = 40; + partcolor = 232; + while ( partcnt > FALSE ) { + rndpos = org; + rndpos_x = (rndpos_x + (random () * 32) ); + rndpos_y = (rndpos_y + (random () * 32) ); + rndpos_z = (rndpos_z + (random () * 32) ); + if ( (partcnt < 16) ) { + rndpos_z = (rndpos_z + 4); + partcolor = 228; + } + if ( (partcnt < 8) ) { + rndpos_z = (rndpos_z + 8); + partcolor = 224; + } + particle (rndpos,VEC_ORIGIN,partcolor,3); + partcnt = (partcnt - TRUE); + } + remove (self); +}; + +void (vector org, vector dir) launch_fireball = { + local entity fireball; + local float fireSpeed; + + self.effects = (self.effects | EF_MUZZLEFLASH); + fireball = spawn (); + fireball.owner = self; + fireball.movetype = MOVETYPE_FLYMISSILE; + fireball.solid = SOLID_BBOX; + fireball.classname = "fireball"; + setmodel (fireball,"progs/k_spike.mdl"); + setorigin (fireball,org); + setsize (fireball,VEC_ORIGIN,VEC_ORIGIN); + fireSpeed = ((random () * 400.000) + 200.000); + fireball.velocity = (dir * fireSpeed); + fireball.avelocity = '0.000 0.000 300.000'; + fireball.angles = vectoangles (fireball.velocity); + fireball.enemy = self.enemy; + fireball.touch = FireballTouch; + fireball.nextthink = (time + MOVETYPE_TOSS); + fireball.think = SUB_Remove; +}; + +void () dragon_fireball = { + local float fireCount; + local vector org; + local vector dir; + local float distortion; + local float vdistortion; + + sound (self,CHAN_VOICE,"dragon/active.wav",TRUE,ATTN_NORM); + makevectors (self.angles); + org = ((self.origin + (v_forward * 112.000)) + (v_up * FL_MONSTER)); + dir = normalize ((self.enemy.origin - org)); + particle (org,VEC_ORIGIN,224,32); + if ( (random () > 0.5) ) + fireCount = 30; + else + fireCount = 40; + + while ( (fireCount > FALSE) ) { + if ( (random () > 0.8) ) + distortion = ((random () - 0.500) * 0.800); + else + distortion = ((random () - 0.500) * 0.250); + + if ( (random () > 0.8) ) + vdistortion = ((random () - 0.500) * 0.800); + else + vdistortion = ((random () - 0.500) * 0.250); + + dir = normalize ((self.enemy.origin - org)); + makevectors (dir); + dir = (dir + (v_right * distortion)); + dir = (dir + (v_up * vdistortion)); + launch_fireball (org,dir); + fireCount = (fireCount - TRUE); + } +}; + +void () dragon_tail_touch = { + local vector delta; + local float tailDamage; + + if (!self.enemy) + return ; + + if (!CanDamage(self.enemy,self)) + return ; + + ai_charge (10); + delta = (self.enemy.origin - self.origin); + tailDamage = vlen (delta); + if ( (vlen (delta) > 150.000) ) + return ; + + tailDamage = ((random () * 30) + 15); + T_Damage (self.enemy,self,self,tailDamage,DAMARMOR); +}; + +void () dragon_tail = { + local float dist; + local vector dir; + + if (!self.enemy) + return ; + + if ( !CanDamage (self.enemy,self) ) + return ; + + dragon_move (10); + dir = (self.enemy.origin - self.origin); + dist = vlen (dir); + if (dist <= 150.000) { + T_Damage (self.enemy,self,self,18,DAMARMOR); + dir = normalize (dir); + self.enemy.velocity = (dir * 500.000); + self.enemy.velocity_z = 350.000; + } + dragon_stop_attack (); +}; + +void () dragon_melee1 = [ 20.000, dragon_melee2 ] { dragon_move (12); }; +void () dragon_melee2 = [ 21.000, dragon_melee3 ] { dragon_move (12); }; +void () dragon_melee3 = [ 22.000, dragon_melee4 ] { dragon_move (12); }; +void () dragon_melee4 = [ 23.000, dragon_melee5 ] { dragon_move (12); }; +void () dragon_melee5 = [ 24.000, dragon_melee6 ] { dragon_move (12); }; +void () dragon_melee6 = [ 25.000, dragon_melee7 ] { dragon_move (12); }; +void () dragon_melee7 = [ 26.000, dragon_melee8 ] { dragon_move (12); }; +void () dragon_melee8 = [ 27.000, dragon_melee9 ] { dragon_move (12); }; +void () dragon_melee9 = [ 28.000, dragon_melee10 ] { dragon_move (12); }; +void () dragon_melee10 = [ 29.000, dragon_melee11 ] { dragon_tail (); }; +void () dragon_melee11 = [ 30.000, dragon_melee12 ] { dragon_move (10); }; +void () dragon_melee12 = [ 31.000, dragon_melee13 ] { dragon_move (10); }; +void () dragon_melee13 = [ 32.000, dragon_walk1 ] { dragon_move (10); }; + +void () dragon_painA1 = [ 62.000, dragon_painA2 ] { dragon_move (12); }; +void () dragon_painA2 = [ 63.000, dragon_painA3 ] { dragon_move (12); }; +void () dragon_painA3 = [ 64.000, dragon_walk5 ] { dragon_move (12); }; + +void () dragon_painB1 = [ 65.000, dragon_painB2 ] { dragon_move (12); }; +void () dragon_painB2 = [ 66.000, dragon_painB3 ] { dragon_move (12); }; +void () dragon_painB3 = [ 67.000, dragon_walk7 ] { dragon_move (12); }; + +void () dragon_painC1 = [ 68.000, dragon_painC2 ] { dragon_move (12); }; +void () dragon_painC2 = [ 69.000, dragon_painC3 ] { dragon_move (12); }; +void () dragon_painC3 = [ 70.000, dragon_walk9 ] { dragon_move (12); }; + +void () dragon_painD1 = [ 71.000, dragon_painD2 ] { dragon_move (12); }; +void () dragon_painD2 = [ 72.000, dragon_painD3 ] { dragon_move (12); }; +void () dragon_painD3 = [ 73.000, dragon_walk11 ] { dragon_move (12); }; + +void () dragon_painE1 = [ 74.000, dragon_painE2 ] { dragon_move (12); }; +void () dragon_painE2 = [ 75.000, dragon_painE3 ] { dragon_move (12); }; +void () dragon_painE3 = [ 76.000, dragon_walk13 ] { dragon_move (12); }; + +void () dragon_painF1 = [ 77.000, dragon_painF2 ] { dragon_move (12); }; +void () dragon_painF2 = [ 78.000, dragon_painF3 ] { dragon_move (12); }; +void () dragon_painF3 = [ 79.000, dragon_walk2 ] { dragon_move (12); }; + +void (entity inflictor, entity attacker, float damage) dragon_pain = { + local float r; + + if (self.pain_finished > time) + return ; + + r = random (); + if ( (r < 0.250) ) { + dragon_stop_attack (); + sound (self,CHAN_VOICE,"dragon/pain.wav",TRUE,ATTN_NORM); + self.pain_finished = (time + 2); + if ( (self.dragonPainSequence == 1) ) { + self.think = dragon_painA1; + } else { + if ( (self.dragonPainSequence == 2) ) { + self.think = dragon_painF1; + } else { + if ( (self.dragonPainSequence == 3) ) { + self.think = dragon_painE1; + } else { + if ( (self.dragonPainSequence == 4) ) { + self.think = dragon_painD1; + } else { + if ( (self.dragonPainSequence == 5) ) { + self.think = dragon_painC1; + } else { + if ( (self.dragonPainSequence == 6) ) + self.think = dragon_painB1; + + } + } + } + } + } + } +}; + +void () dragon_boom2 = { + self.velocity = self.dragonLastVelocity; + ViolentDeath (15); + self.target = "dragondoor"; + SUB_UseTargets (); + remove (self); +}; + +void () dragon_boom1 = { + if (self.dragonDeathState > DDIE_STOPPED) + return ; + + self.dragonDeathState = DDIE_EXPLODED; + ThrowGib (11,1); + ThrowGib (12,1); + ThrowGib (13,1); + sound (self,CHAN_BODY,"player/tornoff2.wav",TRUE,ATTN_NONE); + self.think = dragon_boom2; + self.nextthink = (time + 0.100); +}; + +void () dragon_explode = { + if (self.dragonDeathState > DDIE_FALLING) + return ; + + if ( ((vlen (self.velocity) < 100.000) || (self.flags & FL_INWATER)) ) { + self.dragonDeathState = DDIE_STOPPED; + dragon_boom1 (); + } else { + makevectors (self.angles); + self.velocity = (self.velocity - (40 * v_up)); + self.dragonLastVelocity = self.velocity; + } +}; + +void () dragon_squish = { + if ( (other.classname == "player") ) { + self.classname = "monster_dragon_dead"; + self.deathstring = " was squashed by the Dragon\n"; + T_Damage (other,self,self,200.000,DAMARMOR); + } + if ( (other == world) ) { + self.velocity = VEC_ORIGIN; + dragon_explode (); + } +}; + +void () dragon_death1 = [ 80.000, dragon_death2 ] { + if ( (self.dragonDeathState > FALSE) ) + return ; + + self.dragonDeathState = DDIE_FALLING; + self.use = SUB_Null; + makevectors (self.angles); + self.velocity = ((300.000 * v_forward) - (40 * v_up)); + self.flags = (self.flags - (self.flags & FL_ONGROUND)); + setsize (self,VEC_HULL_MIN,VEC_HULL_MAX); + self.touch = dragon_squish; + sound (self,CHAN_VOICE,"dragon/death.wav",TRUE,ATTN_NONE); + self.dragonAttacking = FALSE; +}; +void () dragon_death2 = [ 81.000, dragon_death3 ] { dragon_explode (); }; +void () dragon_death3 = [ 82.000, dragon_death4 ] { dragon_explode (); }; +void () dragon_death4 = [ 83.000, dragon_death5 ] { dragon_explode (); }; +void () dragon_death5 = [ 84.000, dragon_death6 ] { dragon_explode (); }; +void () dragon_death6 = [ 85.000, dragon_death7 ] { dragon_explode (); }; +void () dragon_death7 = [ 86.000, dragon_death8 ] { dragon_explode (); }; +void () dragon_death8 = [ 87.000, dragon_death9 ] { dragon_explode (); }; +void () dragon_death9 = [ 88.000, dragon_death10 ] { dragon_explode (); }; +void () dragon_death10 = [ 89.000, dragon_death11 ] { dragon_explode (); }; +void () dragon_death11 = [ 90.000, dragon_death12 ] { dragon_explode (); }; +void () dragon_death12 = [ 91.000, dragon_death13 ] { dragon_explode (); }; +void () dragon_death13 = [ 92.000, dragon_death14 ] { dragon_explode (); }; +void () dragon_death14 = [ 93.000, dragon_death15 ] { dragon_explode (); }; +void () dragon_death15 = [ 94.000, dragon_death16 ] { dragon_explode (); }; +void () dragon_death16 = [ 95.000, dragon_death17 ] { dragon_explode (); }; +void () dragon_death17 = [ 96.000, dragon_death18 ] { dragon_explode (); }; +void () dragon_death18 = [ 97.000, dragon_death19 ] { dragon_explode (); }; +void () dragon_death19 = [ 98.000, dragon_death20 ] { dragon_explode (); }; +void () dragon_death20 = [ 99.000, dragon_death21 ] { dragon_explode (); }; +void () dragon_death21 = [ 100.000, dragon_death21 ] { ViolentDeath (39.000); SUB_UseTargets (); remove (self); }; + +void () dragon_use = { + if ( (self.health < TRUE) ) { self.use = SUB_Null; return ; } + + self.th_stand = dragon_walk1; + self.th_walk = dragon_walk1; + self.think = dragon_walk1; + self.nextthink = (time + 0.100); +}; + +void () dragon_activate = { + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = (self.angles * '0.000 1.000 0.000'); + if ( !self.yaw_speed ) + self.yaw_speed = 10; // Slow turner + + self.view_ofs = '0.000 0.000 25.000'; + self.flags = (self.flags | FL_FLY); + self.flags = (self.flags | FL_MONSTER); + if ( !walkmove (FALSE,FALSE) ) { + dprint ("flymonster in wall!\n"); + dprint (self.classname); + dprint (" at "); + dprint (vtos (self.origin)); + dprint ("\n"); + } + if ( self.target ) { + self.movetarget = find (world,targetname,self.target); + self.goalentity = self.movetarget; + if ( !self.movetarget ) { + dprint ("Monster can't find target at "); + dprint (vtos (self.origin)); + dprint ("\n"); + } + } + if ( self.targetname ) + self.use = dragon_use; + else + dragon_use (); +}; + +void () monster_dragon = { + if ( deathmatch ) { remove (self); return ; } + + self.mdl = "progs/drake/dragon.mdl"; + precache_model ("progs/drake/dragon.mdl"); + precache_model ("progs/quoth2pt2full/fireball.mdl"); + self.gib1mdl = "progs/drake/drggib01.mdl"; + self.gib2mdl = "progs/drake/drggib02.mdl"; + self.gib3mdl = "progs/drake/drggib03.mdl"; + precache_model ("progs/drake/drggib01.mdl"); + precache_model ("progs/drake/drggib02.mdl"); + precache_model ("progs/drake/drggib03.mdl"); + precache_sound ("dragon/see.wav"); + precache_sound ("dragon/active.wav"); + precache_sound ("dragon/attack.wav"); + precache_sound ("misc/quakeend.wav"); + precache_sound ("misc/quakeend.wav"); + precache_sound ("dragon/pain.wav"); + precache_sound ("dragon/death.wav"); + self.dragonInRoom = DT_ROOM_A; + self.dragonInTransit = FALSE; + self.dragonAttacking = FALSE; + self.playerInRoom = DT_ROOM_A; + self.playerInTransit = FALSE; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self,"progs/drake/dragon.mdl"); + setsize (self,VEC_HULL2_MIN,VEC_HULL2_MAX); + if (self.health < 1) self.health = 4000; + if (self.target == "") self.target = "dragondoor"; + self.th_run = dragon_walk1; + self.th_pain = dragon_pain; + self.th_die = dragon_death1; + self.dragonPainSequence = TRUE; + total_monsters = (total_monsters + TRUE); + self.nextthink = (self.nextthink + 0.100); + if (self.deathstring == "") self.deathstring = " was annihilated by the Dragon\n"; + self.think = dragon_activate; +}; + +void () dragon_corner_touch = { + if (other.movetarget != self) + return ; + + if (other.classname != "monster_dragon") + return ; + + other.movetarget = find (world,targetname,self.target); + other.goalentity = other.movetarget; + other.target = self.target; + if (!other.movetarget) + objerror ("dragon_corner: no target found"); +}; + +void () dragon_corner = { + if ( !self.targetname ) + objerror ("dragon_corner: no targetname"); + + if ( !self.target ) + objerror ("dragon_corner: no target"); + + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + self.touch = dragon_corner_touch; + self.modelindex = FALSE; + self.model = ""; + setsize (self,'-16.000 -16.000 -16.000','16.000 16.000 16.000'); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_drole.qc b/QC_other/QC_keep/mon_drole.qc new file mode 100644 index 00000000..02d570a4 --- /dev/null +++ b/QC_other/QC_keep/mon_drole.qc @@ -0,0 +1,496 @@ +/*============================================================================== +DROLE (Heavily inspired by Drole from Quoth - Kell/Necros/Preach) +==============================================================================*/ +// Stand idle - Tentacle eye looks left +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 standA13 standA14 standA15 standA16 +$frame standA17 standA18 standA19 standA20 standA21 standA22 standA23 standA24 +$frame standA25 standA26 standA27 standA28 standA29 standA30 + +// Stand idle - Tentacle eye looks around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 +$frame standB25 standB26 standB27 standB28 standB29 standB30 standB31 standB32 +$frame standB33 standB34 standB35 standB36 standB37 standB38 standB39 standB40 + +// Stand idle - Swings arms back and forth +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 +$frame standC25 standC26 standC27 standC28 standC29 standC30 + +// Fireball attack +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 magic9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 + +// Jump up 1-5, 6=flying +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame clawR1 clawR2 clawR3 clawR4 clawR5 clawR6 clawR7 clawR8 +$frame clawR9 clawR10 clawR11 clawR12 clawR13 clawR14 clawR15 clawR16 + +$frame clawL1 clawL2 clawL3 clawL4 clawL5 clawL6 clawL7 clawL8 +$frame clawL9 clawL10 clawL11 clawL12 clawL13 clawL14 clawL15 clawL16 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 death23 death24 +$frame death25 death26 + +$frame base1 base2 base3 + +//============================================================================ +void() drole_standA1 =[ $standA1, drole_standA2 ] {monster_idle_sound(); ai_stand();}; +void() drole_standA2 =[ $standA2, drole_standA3 ] {ai_stand();}; +void() drole_standA3 =[ $standA3, drole_standA4 ] {ai_stand();}; +void() drole_standA4 =[ $standA4, drole_standA5 ] {ai_stand();}; +void() drole_standA5 =[ $standA5, drole_standA6 ] {ai_stand();}; +void() drole_standA6 =[ $standA6, drole_standA7 ] {ai_stand();}; +void() drole_standA7 =[ $standA7, drole_standA8 ] {ai_stand();}; +void() drole_standA8 =[ $standA8, drole_standA9 ] {ai_stand();}; +void() drole_standA9 =[ $standA9, drole_standA10 ] {ai_stand();}; +void() drole_standA10 =[ $standA10, drole_standA11 ] {ai_stand();}; +void() drole_standA11 =[ $standA11, drole_standA12 ] {ai_stand();}; +void() drole_standA12 =[ $standA12, drole_standA13 ] {ai_stand();}; +void() drole_standA13 =[ $standA13, drole_standA14 ] {ai_stand();}; +void() drole_standA14 =[ $standA14, drole_standA15 ] {ai_stand();}; +void() drole_standA15 =[ $standA15, drole_standA16 ] {ai_stand();}; +void() drole_standA16 =[ $standA16, drole_standA17 ] {ai_stand();}; +void() drole_standA17 =[ $standA17, drole_standA18 ] {ai_stand();}; +void() drole_standA18 =[ $standA18, drole_standA19 ] {ai_stand();}; +void() drole_standA19 =[ $standA19, drole_standA20 ] {ai_stand();}; +void() drole_standA20 =[ $standA20, drole_standA21 ] {ai_stand();}; +void() drole_standA21 =[ $standA21, drole_standA22 ] {ai_stand();}; +void() drole_standA22 =[ $standA22, drole_standA23 ] {ai_stand();}; +void() drole_standA23 =[ $standA23, drole_standA24 ] {ai_stand();}; +void() drole_standA24 =[ $standA24, drole_standA25 ] {ai_stand();}; +void() drole_standA25 =[ $standA25, drole_standA26 ] {ai_stand();}; +void() drole_standA26 =[ $standA26, drole_standA27 ] {ai_stand();}; +void() drole_standA27 =[ $standA27, drole_standA28 ] {ai_stand();}; +void() drole_standA28 =[ $standA28, drole_standA29 ] {ai_stand();}; +void() drole_standA29 =[ $standA29, drole_standA30 ] {ai_stand();}; +void() drole_standA30 =[ $standA30, drole_standC1 ] {ai_stand();}; + +//============================================================================ +void() drole_standB1 =[ $standB1, drole_standB2 ] {monster_idle_sound(); ai_stand();}; +void() drole_standB2 =[ $standB2, drole_standB3 ] {ai_stand();}; +void() drole_standB3 =[ $standB3, drole_standB4 ] {ai_stand();}; +void() drole_standB4 =[ $standB4, drole_standB5 ] {ai_stand();}; +void() drole_standB5 =[ $standB5, drole_standB6 ] {ai_stand();}; +void() drole_standB6 =[ $standB6, drole_standB7 ] {ai_stand();}; +void() drole_standB7 =[ $standB7, drole_standB8 ] {ai_stand();}; +void() drole_standB8 =[ $standB8, drole_standB9 ] {ai_stand();}; +void() drole_standB9 =[ $standB9, drole_standB10 ] {ai_stand();}; +void() drole_standB10 =[ $standB10, drole_standB11 ] {ai_stand();}; +void() drole_standB11 =[ $standB11, drole_standB12 ] {ai_stand();}; +void() drole_standB12 =[ $standB12, drole_standB13 ] {ai_stand();}; +void() drole_standB13 =[ $standB13, drole_standB14 ] {ai_stand();}; +void() drole_standB14 =[ $standB14, drole_standB15 ] {ai_stand();}; +void() drole_standB15 =[ $standB15, drole_standB16 ] {ai_stand();}; +void() drole_standB16 =[ $standB16, drole_standB17 ] {ai_stand();}; +void() drole_standB17 =[ $standB17, drole_standB18 ] {ai_stand();}; +void() drole_standB18 =[ $standB18, drole_standB19 ] {ai_stand();}; +void() drole_standB19 =[ $standB19, drole_standB20 ] {ai_stand();}; +void() drole_standB20 =[ $standB20, drole_standB21 ] {ai_stand();}; +void() drole_standB21 =[ $standB21, drole_standB22 ] {ai_stand();}; +void() drole_standB22 =[ $standB22, drole_standB23 ] {ai_stand();}; +void() drole_standB23 =[ $standB23, drole_standB24 ] {ai_stand();}; +void() drole_standB24 =[ $standB24, drole_standB25 ] {ai_stand();}; +void() drole_standB25 =[ $standB25, drole_standB26 ] {ai_stand();}; +void() drole_standB26 =[ $standB26, drole_standB27 ] {ai_stand();}; +void() drole_standB27 =[ $standB27, drole_standB28 ] {ai_stand();}; +void() drole_standB28 =[ $standB28, drole_standB29 ] {ai_stand();}; +void() drole_standB29 =[ $standB29, drole_standB30 ] {ai_stand();}; +void() drole_standB30 =[ $standB30, drole_standB31 ] {ai_stand();}; +void() drole_standB31 =[ $standB31, drole_standB32 ] {ai_stand();}; +void() drole_standB32 =[ $standB32, drole_standB33 ] {ai_stand();}; +void() drole_standB33 =[ $standB33, drole_standB34 ] {ai_stand();}; +void() drole_standB34 =[ $standB34, drole_standB35 ] {ai_stand();}; +void() drole_standB35 =[ $standB35, drole_standB36 ] {ai_stand();}; +void() drole_standB36 =[ $standB36, drole_standB37 ] {ai_stand();}; +void() drole_standB37 =[ $standB37, drole_standB38 ] {ai_stand();}; +void() drole_standB38 =[ $standB38, drole_standB39 ] {ai_stand();}; +void() drole_standB39 =[ $standB39, drole_standB40 ] {ai_stand();}; +void() drole_standB40 =[ $standB40, drole_standC1 ] {ai_stand();}; + +//============================================================================ +void() drole_standC1 =[ $standC1, drole_standC2 ] {monster_idle_sound(); ai_stand();}; +void() drole_standC2 =[ $standC2, drole_standC3 ] {ai_stand();}; +void() drole_standC3 =[ $standC3, drole_standC4 ] {ai_stand();}; +void() drole_standC4 =[ $standC4, drole_standC5 ] {ai_stand();}; +void() drole_standC5 =[ $standC5, drole_standC6 ] {ai_stand();}; +void() drole_standC6 =[ $standC6, drole_standC7 ] {ai_stand();}; +void() drole_standC7 =[ $standC7, drole_standC8 ] {ai_stand();}; +void() drole_standC8 =[ $standC8, drole_standC9 ] {ai_stand();}; +void() drole_standC9 =[ $standC9, drole_standC10 ] {ai_stand();}; +void() drole_standC10 =[ $standC10, drole_standC11 ] {ai_stand();}; +void() drole_standC11 =[ $standC11, drole_standC12 ] {ai_stand();}; +void() drole_standC12 =[ $standC12, drole_standC13 ] {ai_stand();}; +void() drole_standC13 =[ $standC13, drole_standC14 ] {ai_stand();}; +void() drole_standC14 =[ $standC14, drole_standC15 ] {ai_stand();}; +void() drole_standC15 =[ $standC15, drole_standC16 ] {ai_stand();}; +void() drole_standC16 =[ $standC16, drole_standC17 ] {ai_stand();}; +void() drole_standC17 =[ $standC17, drole_standC18 ] {ai_stand();}; +void() drole_standC18 =[ $standC18, drole_standC19 ] {ai_stand();}; +void() drole_standC19 =[ $standC19, drole_standC20 ] {ai_stand();}; +void() drole_standC20 =[ $standC20, drole_standC21 ] {ai_stand();}; +void() drole_standC21 =[ $standC21, drole_standC22 ] {ai_stand();}; +void() drole_standC22 =[ $standC22, drole_standC23 ] {ai_stand();}; +void() drole_standC23 =[ $standC23, drole_standC24 ] {ai_stand();}; +void() drole_standC24 =[ $standC24, drole_standC25 ] {ai_stand();}; +void() drole_standC25 =[ $standC25, drole_standC26 ] {ai_stand();}; +void() drole_standC26 =[ $standC26, drole_standC27 ] {ai_stand();}; +void() drole_standC27 =[ $standC27, drole_standC28 ] {ai_stand();}; +void() drole_standC28 =[ $standC28, drole_standC29 ] {ai_stand();}; +void() drole_standC29 =[ $standC29, drole_standC30 ] {ai_stand();}; +void() drole_standC30 =[ $standC30, drole_standC1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + self.lefty = random(); + if (self.lefty < 0.3) self.think = drole_standA1; + else if (self.lefty < 0.6) self.think = drole_standB1; + else self.think = drole_standC1; + } + ai_stand(); +}; + +//============================================================================ +void() drole_walk1 =[ $walk1, drole_walk2 ] {monster_footstep(FALSE); +monster_idle_sound(); ai_walk(10);}; +void() drole_walk2 =[ $walk2, drole_walk3 ] {ai_walk(9);}; +void() drole_walk3 =[ $walk3, drole_walk4 ] {ai_walk(9);}; +void() drole_walk4 =[ $walk4, drole_walk5 ] {ai_walk(5);}; +void() drole_walk5 =[ $walk5, drole_walk6 ] {monster_footstep(FALSE); ai_walk(6);}; +void() drole_walk6 =[ $walk6, drole_walk7 ] {ai_walk(12);}; +void() drole_walk7 =[ $walk7, drole_walk8 ] {ai_walk(8);}; +void() drole_walk8 =[ $walk8, drole_walk1 ] {ai_walk(3);}; + +//============================================================================ +// Drole's have two run speeds, regular and rage +// * each run type uses different animation sets +// * once the drole is enraged there is no going back +// * moved the health trigger to a percentage (custom HP) +//============================================================================ +void() drole_run; + +void() drole_rage1 = [ $run1, drole_rage2 ] {monster_idle_sound();ai_run(27);}; +void() drole_rage2 = [ $run2, drole_rage3 ] {ai_run(26);}; +void() drole_rage3 = [ $run3, drole_rage4 ] {ai_run(30);}; +void() drole_rage4 = [ $run4, drole_rage5 ] {monster_footstep(FALSE); ai_run(28);}; +void() drole_rage5 = [ $run5, drole_rage6 ] {ai_run(27);}; +void() drole_rage6 = [ $run6, drole_rage7 ] {ai_run(26);}; +void() drole_rage7 = [ $run7, drole_rage8 ] {ai_run(30);}; +void() drole_rage8 = [ $run8, drole_run ] {monster_footstep(FALSE); ai_run(28);}; + +//---------------------------------------------------------------------- +void() drole_run1 = [ $walk1, drole_run2 ] {monster_footstep(FALSE); ai_run(15);}; +void() drole_run2 = [ $walk2, drole_run3 ] {monster_idle_sound();ai_run(14);}; +void() drole_run3 = [ $walk3, drole_run4 ] {ai_run(14);}; +void() drole_run4 = [ $walk4, drole_run5 ] {ai_run(10);}; +void() drole_run5 = [ $walk5, drole_run6 ] {monster_footstep(FALSE); ai_run(11);}; +void() drole_run6 = [ $walk6, drole_run7 ] {ai_run(17);}; +void() drole_run7 = [ $walk7, drole_run8 ] {ai_run(13);}; +void() drole_run8 = [ $walk8, drole_run ] {ai_run(8);}; + +//---------------------------------------------------------------------- +void() drole_run = +{ + if (self.attack_rage) drole_rage1(); + else drole_run1(); +}; + +//=========================================================================== +// MELEE ATTACK - Double claws +//=========================================================================== +void(float side) drole_claw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + ai_damagebreakable(50); // Damage any breakables + + if (!ai_checkmelee(MONAI_MELEEDROLE1) || !self.enemy.takedamage) { + // Melee claw miss sound + sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM); + } + else { + // Melee claw hit sound + if (random() < 0.5) sound (self, CHAN_WEAPON, "drole/strike1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "drole/strike2.wav", 1, ATTN_NORM); + ldmg = 12 + 6*random(); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +void(float ragespd) drole_charge = +{ + if (self.attack_rage) ai_charge(ragespd); + else ai_charge(rint(ragespd*0.7)); +} + +//---------------------------------------------------------------------- +void() drole_clawL1; +//---------------------------------------------------------------------- +void() drole_clawR1 = [ $clawR1, drole_clawR2 ] {drole_charge(27);}; +void() drole_clawR2 = [ $clawR2, drole_clawR3 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawR3 = [ $clawR3, drole_clawR4 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawR4 = [ $clawR4, drole_clawR5 ] {drole_charge(28);}; +void() drole_clawR5 = [ $clawR5, drole_clawR6 ] {drole_charge(27); +drole_claw(-250);}; +void() drole_clawR6 = [ $clawR6, drole_clawR7 ] {drole_charge(26);}; +void() drole_clawR7 = [ $clawR7, drole_clawR8 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawR8 = [ $clawR8, drole_clawR9 ] {drole_charge(28);}; +void() drole_clawR9 = [ $clawR9, drole_clawR10 ] {drole_charge(27);}; +void() drole_clawR10 = [ $clawR10, drole_clawR11 ] {drole_charge(26);}; +void() drole_clawR11 = [ $clawR11, drole_clawR12 ] {monster_footstep(FALSE);drole_charge(30); +drole_claw(-250);}; +void() drole_clawR12 = [ $clawR12, drole_clawR13 ] {drole_charge(28);}; +void() drole_clawR13 = [ $clawR13, drole_clawR14 ] {drole_charge(27);}; +void() drole_clawR14 = [ $clawR14, drole_clawR15 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawR15 = [ $clawR15, drole_clawR16 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawR16 = [ $clawR16, drole_run ] {drole_charge(28); + if (random() < 0.5 && ai_checkmelee(MONAI_MELEEDROLE2) && + self.enemy.health > 0 && visible(self.enemy)) drole_clawL1(); +}; + +//---------------------------------------------------------------------- +void() drole_clawL1 = [ $clawL1, drole_clawL2 ] {drole_charge(27);}; +void() drole_clawL2 = [ $clawL2, drole_clawL3 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawL3 = [ $clawL3, drole_clawL4 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawL4 = [ $clawL4, drole_clawL5 ] {drole_charge(28);}; +void() drole_clawL5 = [ $clawL5, drole_clawL6 ] {drole_charge(27); +drole_claw(250);}; +void() drole_clawL6 = [ $clawL6, drole_clawL7 ] {drole_charge(26);}; +void() drole_clawL7 = [ $clawL7, drole_clawL8 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawL8 = [ $clawL8, drole_clawL9 ] {drole_charge(28);}; +void() drole_clawL9 = [ $clawL9, drole_clawL10 ] {drole_charge(27);}; +void() drole_clawL10 = [ $clawL10, drole_clawL11 ] {drole_charge(26);}; +void() drole_clawL11 = [ $clawL11, drole_clawL12 ] {monster_footstep(FALSE);drole_charge(30); +drole_claw(250);}; +void() drole_clawL12 = [ $clawL12, drole_clawL13 ] {drole_charge(28);}; +void() drole_clawL13 = [ $clawL13, drole_clawL14 ] {drole_charge(27);}; +void() drole_clawL14 = [ $clawL14, drole_clawL15 ] {drole_charge(26); +sound (self, CHAN_WEAPON, "drole/swipe.wav", 1, ATTN_NORM);}; +void() drole_clawL15 = [ $clawL15, drole_clawL16 ] {monster_footstep(FALSE);drole_charge(30);}; +void() drole_clawL16 = [ $clawL16, drole_run ] {drole_charge(28); + if (random() < 0.5 && ai_checkmelee(MONAI_MELEEDROLE2) && + self.enemy.health > 0 && visible(self.enemy)) drole_clawR1(); +}; + +//---------------------------------------------------------------------- +void() drole_melee = +{ + if (random() < 0.5) drole_clawR1(); + else drole_clawL1(); +}; + +//============================================================================ +// RANGE ATTACK - Fireball (rocket) +// * The trick to drole rockets is that they start really slow +// * Over time (4 frames) the rocket speeds up (linked to animation) +// * requires special projectile and new th_updmissile function +// * Has a different explosion sound (does not play rocket default) +// +//============================================================================ +void() drole_rocket1 = [ 1, drole_rocket2 ] {self.nextthink = time + 0.2;}; +void() drole_rocket2 = [ 2, drole_rocket3 ] {self.velocity = self.velocity * 1.5;}; +void() drole_rocket3 = [ 3, drole_rocket4 ] {self.velocity = self.velocity * 1.5;}; +void() drole_rocket4 = [ 3, SUB_Remove ] { + self.nextthink = time + 5; + if (skill == SKILL_EASY) self.velocity = self.velocity * 3.5; + else self.velocity = self.velocity * 4.5; +}; + +//---------------------------------------------------------------------- +void() drole_fire = +{ + local vector org, dir, avel; + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + self.attack_speed = 80; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize((self.enemy.origin+'0 0 -8') - org); + avel = avel = vecrand(100,200,FALSE); + + Launch_Missile (org, dir, avel, CT_PROJ_DROLE, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() drole_magic1 = [ $magic1, drole_magic2 ] {ai_face(); +sound(self, CHAN_WEAPON, "drole/fire.wav", 1, ATTN_NORM);}; +void() drole_magic2 = [ $magic2, drole_magic3 ] {ai_face();}; +void() drole_magic3 = [ $magic3, drole_magic4 ] {ai_face();}; +void() drole_magic4 = [ $magic4, drole_magic5 ] {drole_fire();}; +void() drole_magic5 = [ $magic5, drole_magic6 ] {ai_face();}; +void() drole_magic6 = [ $magic6, drole_magic7 ] {ai_face();}; +void() drole_magic7 = [ $magic7, drole_magic8 ] {ai_face();}; +void() drole_magic8 = [ $magic8, drole_magic9 ] {ai_face();}; +void() drole_magic9 = [ $magic9, drole_run ] {ai_face();}; + +//============================================================================ +void() drole_pain1 = [ $pain1, drole_pain2 ] {ai_back(8);}; +void() drole_pain2 = [ $pain2, drole_pain3 ] {ai_back(10);}; +void() drole_pain3 = [ $pain3, drole_pain4 ] {ai_back(10);}; +void() drole_pain4 = [ $pain4, drole_pain5 ] {ai_back(8);}; +void() drole_pain5 = [ $pain5, drole_pain6 ] {ai_back(6);}; +void() drole_pain6 = [ $pain6, drole_run ] {ai_back(4);}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) drole_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (self.attack_rage) sound (self, CHAN_VOICE, "drole/enrage.wav", 0.5, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) drole_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + drole_pain1 (); + } + } +}; + +//============================================================================ +void() drole_death1 = [ $death1, drole_death2 ] {}; +void() drole_death2 = [ $death2, drole_death3 ] {monster_check_gib();}; +void() drole_death3 = [ $death3, drole_death4 ] {monster_check_gib(); +self.solid = SOLID_NOT;}; +void() drole_death4 = [ $death4, drole_death5 ] {}; +void() drole_death5 = [ $death5, drole_death6 ] {}; +void() drole_death6 = [ $death6, drole_death7 ] {}; +void() drole_death7 = [ $death7, drole_death8 ] {}; +void() drole_death8 = [ $death8, drole_death9 ] {}; +void() drole_death9 = [ $death9, drole_death10 ] {}; +void() drole_death10 = [ $death10, drole_death11 ] {}; +void() drole_death11 = [ $death11, drole_death12 ] {}; +void() drole_death12 = [ $death12, drole_death13 ] {}; +void() drole_death13 = [ $death13, drole_death14 ] {}; +void() drole_death14 = [ $death14, drole_death15 ] {}; +void() drole_death15 = [ $death15, drole_death16 ] {}; +void() drole_death16 = [ $death16, drole_death17 ] {}; +void() drole_death17 = [ $death17, drole_death18 ] {}; +void() drole_death18 = [ $death18, drole_death19 ] {}; +void() drole_death19 = [ $death19, drole_death20 ] {}; +void() drole_death20 = [ $death20, drole_death21 ] {}; +void() drole_death21 = [ $death21, drole_death22 ] {}; +void() drole_death22 = [ $death22, drole_death23 ] {}; +void() drole_death23 = [ $death23, drole_death24 ] {}; +void() drole_death24 = [ $death24, drole_death25 ] {}; +void() drole_death25 = [ $death25, drole_death26 ] {monster_death_postcheck();}; +void() drole_death26 = [ $death26, drole_death26 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() drole_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "drole/death.wav", 1, ATTN_NORM); + drole_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_drole (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_drole = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_drole.mdl"; + self.headmdl = "progs/ad171/h_drole.mdl"; + self.gib1mdl = "progs/ad171/gib_drolearm1.mdl"; // Top arm (pose 1) + self.gib2mdl = "progs/ad171/gib_drolearm2.mdl"; // Top arm (pose 2) + self.gib3mdl = "progs/ad171/gib_droleleg1.mdl"; // stretched out leg + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (MODEL_PROJ_DROLE); // growing fireball + + self.idle_sound = "drole/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("drole/enrage.wav"); // sight2.wav + precache_sound ("drole/death.wav"); + self.pain_sound = "drole/pain.wav"; + precache_sound (self.pain_sound); + + precache_sound ("drole/fire.wav"); // Launch rockets + precache_sound ("drole/r_explode.wav"); // unique explosion sound + precache_sound ("drole/strike1.wav"); // melee impacts + precache_sound ("drole/strike2.wav"); + precache_sound ("drole/swipe.wav"); // Missed melee + + self.sight_sound = "drole/sight.wav"; + precache_sound (self.sight_sound); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_DROLEGRN); // growing poisonball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 500; + self.gibhealth = -60; // Hard to gib + self.gibbed = FALSE; + self.pain_flinch = 200; // takes alot to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // High pain threshold + self.steptype = FS_TYPEHEAVY; // heavy feet + self.blockudeath = TRUE; // no humanoid death sound + self.attack_offset = '0 0 34'; // Middle of chest + if (self.deathstring == "") self.deathstring = " was decimated by a Drole\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DroleCheckAttack; + self.th_stand = drole_standC1; + self.th_walk = drole_walk1; + self.th_run = drole_run; + self.th_melee = drole_melee; // Claw attack + self.th_missile = drole_magic1; // Fireball incoming! + self.th_updmissile = drole_rocket1; // Update flying rocket + self.th_pain = drole_pain; + self.th_die = drole_die; + + self.classtype = CT_MONDROLE; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_drone.qc b/QC_other/QC_keep/mon_drone.qc new file mode 100644 index 00000000..fcf45395 --- /dev/null +++ b/QC_other/QC_keep/mon_drone.qc @@ -0,0 +1,448 @@ +void() DLaser_Touch = { + local vector org; + if (other == self.owner) return; + + if (pointcontents(self.origin) == CONTENT_SKY) { remove(self); return; } + sound(self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + org = self.origin - FL_CLIENT * normalize(self.velocity); + if (other.health) { + SpawnBlood(other,org, self.velocity * 0.2, 15); + T_Damage(other, self, self.owner, MOVETYPE_BOUNCE, DAMARMOR); + } else { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_GUNSHOT); + WriteCoord(MSG_BROADCAST, org_x); + WriteCoord(MSG_BROADCAST, org_y); + WriteCoord(MSG_BROADCAST, org_z); + } + remove(self); +}; + +void(vector org, vector vec) LaunchDLaser = +{ + if (self.classname == "monster_drone") + { + sound(self, CHAN_WEAPON, "drone/enfire.wav", 1, ATTN_NORM); + } + vec = normalize(vec); + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLY; + newmis.solid = SOLID_BBOX; + setmodel(newmis, "progs/laser.mdl"); + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin(newmis, org); + newmis.velocity = vec * 600; + newmis.angles = vectoangles(newmis.velocity); + newmis.nextthink = time + MOVETYPE_FLY; + newmis.think = SUB_Remove; + newmis.touch = DLaser_Touch; +}; + +void(float offset) drone_fire = { + local vector org; + local float ouch; + local float ouch1; + ouch = MOVETYPE_STEP - skill; + ouch1 = MOVETYPE_STEP * random(); + if (self.ammo_shells < ouch && ouch1 < ouch && self.health < 200) { + sound(self, CHAN_VOICE, "drone/drngasp.wav", 0.6, ATTN_NORM); + self.ammo_shells = self.ammo_shells + 1; + return; + } + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors(self.angles); + org = self.origin + v_forward * SVC_INTERMISSION + '-5 15 0'; + LaunchDLaser(org, self.enemy.origin + v_right * offset - self.origin); + SUB_AttackFinished(MOVETYPE_STEP); +}; + +void() drn_stand1 = [18, drn_stand2] { + ai_stand(); +}; + +void() drn_stand2 = [19, drn_stand3] +{ + ai_stand(); +}; + +void() drn_stand3 = [20, drn_stand4] +{ + ai_stand(); +}; + +void() drn_stand4 = [21, drn_stand5] +{ + ai_stand(); + if (self.spawnflags & 1) + { + drn_stand5(); + } + if (crandom() > 0.5) + { + sound(self, CHAN_VOICE, "drone/drnidle.wav", 0.6, ATTN_NORM); + } +}; + +void() drn_stand5 = [22, drn_stand6] +{ + ai_stand(); +}; + +void() drn_stand6 = [23, drn_stand7] +{ + ai_stand(); +}; + +void() drn_stand7 = [24, drn_stand8] +{ + ai_stand(); +}; + +void() drn_stand8 = [25, drn_stand9] +{ + ai_stand(); +}; + +void() drn_stand9 = [26, drn_stand10] +{ + ai_stand(); +}; + +void() drn_stand10 = [18, drn_stand1] +{ + ai_stand(); + if (self.spawnflags & 1) + { + drn_stand1(); + } + if (crandom() > 0.5) + { + if (crandom() > 0.5) + { + sound(self, CHAN_VOICE, "drone/drnidle2.wav", 0.6, ATTN_NORM); + } + else + { + sound(self, CHAN_VOICE, "drone/drnidle.wav", 0.6, ATTN_NORM); + } + } +}; + +void() drn_walk1 = [18, drn_walk2] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk2 = [19, drn_walk3] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk3 = [20, drn_walk4] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk4 = [21, drn_walk5] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk5 = [22, drn_walk6] +{ + ai_walk(FL_CLIENT); + if (self.spawnflags & 1) + { + drn_walk6(); + } + if (crandom() > 0.5) + { + sound(self, CHAN_VOICE, "drone/drnidle.wav", 0.6, ATTN_NORM); + } +}; + +void() drn_walk6 = [23, drn_walk7] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk7 = [24, drn_walk8] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk8 = [25, drn_walk9] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk9 = [26, drn_walk10] +{ + ai_walk(FL_CLIENT); +}; + +void() drn_walk10 = [18, drn_walk1] +{ + ai_walk(FL_CLIENT); + if (self.spawnflags & 1) + { + drn_walk1(); + } + if (crandom() > 0.5) + { + if (crandom() > 0.5) + { + sound(self, CHAN_VOICE, "drone/drnidle2.wav", 0.6, ATTN_NORM); + } + else + { + sound(self, CHAN_VOICE, "drone/drnidle.wav", 0.6, ATTN_NORM); + } + } +}; + +void() drn_runa1 = [18, drn_runa2] +{ + ai_run(13); +}; + +void() drn_runa2 = [19, drn_runa3] +{ + ai_run(13); +}; + +void() drn_runa3 = [20, drn_runa4] +{ + ai_run(13); +}; + +void() drn_runa4 = [21, drn_runa5] +{ + ai_run(13); +}; + +void() drn_runa5 = [22, drn_runa6] +{ + ai_run(13); + if (crandom() > 0.5) + { + if (self.health < 200) + { + sound(self, CHAN_VOICE, "drone/drngasp.wav", 0.6, ATTN_NORM); + } + else + { + sound(self, CHAN_VOICE, "drone/drnhunt.wav", 1, ATTN_NORM); + } + } +}; + +void() drn_runa6 = [23, drn_runa7] +{ + ai_run(13); +}; + +void() drn_runa7 = [24, drn_runa8] +{ + ai_run(13); +}; +void() drn_runa8 = [25, drn_runa9] { ai_run(13); }; +void() drn_runa9 = [26, drn_runa10] { ai_run(13); }; + +void() drn_runa10 = [18, drn_run] { + ai_run(13); + if (crandom() > 0.5) { + if (self.health < 100) { + sound(self, CHAN_VOICE, "drone/drngasp2.wav", 0.6, ATTN_NORM); + } else { + sound(self, CHAN_VOICE, "drone/drnhunt.wav", 1, ATTN_NORM); + } + } +}; + +void() drn_runb1 = [18, drn_runb2] { ai_run_slide(13); }; +void() drn_runb2 = [19, drn_runb3] { ai_run_slide(13); }; +void() drn_runb3 = [20, drn_runb4] { ai_run_slide(13); }; +void() drn_runb4 = [21, drn_runb5] { ai_run_slide(13); }; +void() drn_runb5 = [22, drn_runb6] { ai_run_slide(13); if (crandom() > 0.5) sound(self, CHAN_VOICE, "drone/drnhunt.wav", 1, ATTN_NORM); }; +void() drn_runb6 = [23, drn_runb7] { ai_run_slide(13); }; +void() drn_runb7 = [24, drn_runb8] { ai_run_slide(13); }; +void() drn_runb8 = [25, drn_runb9] { ai_run_slide(13); }; +void() drn_runb9 = [26, drn_runb10]{ ai_run_slide(13); }; +void() drn_runb10 = [18, drn_run] { ai_run_slide(13); if (crandom() > 0.5) sound(self, CHAN_VOICE, "drone/drnhunt.wav", 1, ATTN_NORM); }; + +void() drn_run = { + if (random() < 0.5) + drn_runa1(); + else + drn_runb1(); +}; + +void() drn_atta1 = [12, drn_atta2] { ai_face(); drone_fire(125); }; +void() drn_atta2 = [13, drn_atta3] { ai_face(); drone_fire(75); }; +void() drn_atta3 = [14, drn_atta4] { ai_face(); drone_fire(25); }; +void() drn_atta4 = [15, drn_atta5] { ai_face(); drone_fire(0); }; +void() drn_atta5 = [16, drn_atta6] { ai_face(); drone_fire(-25); }; +void() drn_atta6 = [17, drn_atta7] { ai_face(); drone_fire(-75); }; +void() drn_atta7 = [1, drn_atta8] { ai_face(); drone_fire(-125); self.ammo_shells = 0; }; +void() drn_atta8 = [2, drn_atta9] { ai_face(); }; +void() drn_atta9 = [3, drn_atta10] { ai_face(); }; +void() drn_atta10 = [4, drn_atta11] { ai_face(); }; +void() drn_atta11 = [5, drn_atta12] { ai_face(); }; +void() drn_atta12 = [6, drn_atta13] { ai_face(); }; +void() drn_atta13 = [7, drn_atta14] { ai_face(); }; +void() drn_atta14 = [8, drn_atta15] { ai_face(); }; +void() drn_atta15 = [9, drn_atta16] { ai_face(); }; +void() drn_atta16 = [10, drn_atta17] { ai_face(); }; +void() drn_atta17 = [10, drn_atta18] { ai_face(); }; + +void() drn_atta18 = [10, drn_run] {ai_face();}; +void() drn_paina1 = [28, drn_paina2] {}; +void() drn_paina2 = [29, drn_paina3] {}; +void() drn_paina3 = [30, drn_paina4] {}; +void() drn_paina4 = [31, drn_paina5] {}; +void() drn_paina5 = [31, drn_run] {}; + +void() drn_painb1 = [33, drn_painb2] {}; +void() drn_painb2 = [34, drn_painb3] {}; +void() drn_painb3 = [35, drn_painb4] {}; +void() drn_painb4 = [36, drn_painb5] {}; +void() drn_painb5 = [36, drn_run] {}; + +void(entity inflictor, entity attacker, float damage) drn_pain = { + if (random() > 0.75) { + sound(self, CHAN_VOICE, "drone/drnpain2.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_VOICE, "drone/drnpain.wav", 1, ATTN_NORM); + } + ThrowGib(13,rint(random() * 2)); + + if (random() > 0.5) { + drn_paina1(); + } else { + drn_painb1(); + } +}; + +void() drn_die1 = [32, drn_die2] { + self.takedamage = DAMAGE_NO; + sound(self, CHAN_VOICE, "drone/drndeth.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; // No world colision + self.movetype = MOVETYPE_FLY; // Free velocity movement + self.velocity_x = -200 + 400 * random(); + self.velocity_y = -200 + 400 * random(); + self.velocity_z = 200 * random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + + // Spawn dust and sprite explosion + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.origin, "jim/explode_minor.wav"); + SpawnProjectileSmoke(self.origin, 150, 50, 150); +}; +void() drn_die2 = [28, drn_die3] {}; +void() drn_die3 = [29, drn_die4] {}; +void() drn_die4 = [30, drn_die5] {}; +void() drn_die5 = [31, drn_die6] {}; +void() drn_die6 = [32, drn_die7] {}; +void() drn_die7 = [0, drn_die7] { + self.touch = SUB_Null; + + // Final fireworks! + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnExplosion(EXPLODE_BIG, self.origin, "jim/explode_major.wav"); + T_RadiusDamage(self, self, 80, world, DAMAGEALL); + + monster_check_gib(); + entity_hide(self); +}; + +void() DroneTouch = { if (other.takedamage) drn_die7(); }; + +void() monster_drone = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/drone1.mdl"; + precache_model("progs/drone1.mdl"); + + self.headmdl = "progs/drngib1.mdl"; + self.gib1mdl = "progs/drngib2.mdl"; + self.gib2mdl = "progs/drngib3.mdl"; + self.gib3mdl = "progs/spike.mdl"; + precache_model("progs/drngib1.mdl"); + precache_model("progs/drngib2.mdl"); + precache_model("progs/drngib3.mdl"); + precache_model("progs/spike.mdl"); + if (random() < 0.5) self.gib2mdl = string_null; + self.gib1sound = GIB_IMPACT_METALA; + + precache_model("progs/laser.mdl"); + + self.idle_sound = "drone/drnidle2.wav"; + self.idle_sound2 = "drone/drnidle.wav"; + precache_sound2("drone/drnidle2.wav"); + precache_sound2("drone/drnidle.wav"); + + self.sight_sound = "drone/drnwake.wav"; + precache_sound2("drone/drnwake.wav"); + precache_sound2("drone/drnhunt.wav"); + precache_sound2("drone/enfire.wav"); + precache_sound2("drone/drnpain.wav"); + precache_sound2("drone/drnpain2.wav"); + + precache_sound2("jim/explode_minor.wav"); + precache_sound2("jim/explode_major.wav"); + precache_sound2("drone/drngasp.wav"); + precache_sound2("drone/drngasp2.wav"); + precache_sound2("drone/drndeth.wav"); + self.death_sound = "drone/drndeth.wav"; + + precache_sound2("enforcer/enfstop.wav"); + + if (self.health < 1) self.health = 100; + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 30; // Sometimes flinch + self.steptype = FS_FLYING; // Silent feet + self.pain_longanim = FALSE; // No long pain animation + self.blockudeath = TRUE; // No humanoid death sound + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + self.oldorigin = self.origin; // Used for wing angles + self.idlebusy = 0; // Rotate gun idle states + self.idlereverse = FALSE; // Reverse direction for idle + self.attack_offset = '20 0 -10'; // front of laser/rocket + self.gibondeath = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 0.5; + + self.hittype = HIT_METAL; + self.touch = DroneTouch; + self.effects = EF_DIMLIGHT; + self.th_stand = drn_stand1; + self.th_walk = drn_walk1; + self.th_run = drn_run; + self.th_missile = drn_atta1; + self.th_pain = drn_pain; + self.th_die = drn_die1; + self.ammo_shells = 0; + + self.classtype = CT_MONJIM; + self.classgroup = CG_ROBOT; + self.classmove = MON_MOVEFLY; + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was drilled by a Drone\n"; + } else { + if (self.deathstring == "") self.deathstring = " was lazed by a Drone\n"; + } + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_dsergeant.qc b/QC_other/QC_keep/mon_dsergeant.qc new file mode 100644 index 00000000..5d7f6e91 --- /dev/null +++ b/QC_other/QC_keep/mon_dsergeant.qc @@ -0,0 +1,628 @@ +/*============================================================================== +DEATH SERGEANT (hell knights ++) +==============================================================================*/ +$cd id1/models/dsergeant +$origin 0 0 24 +$base base +$skin skin + +// (001 - 012) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// (013 - 024) Stand idle - Shoulder hunch +$frame standA1 standA2 standA3 standA4 standA5 standA6 standA7 standA8 +$frame standA9 standA10 standA11 standA12 + +// (025 - 048) Stand idle - Quick look around +$frame standB1 standB2 standB3 standB4 standB5 standB6 standB7 standB8 +$frame standB9 standB10 standB11 standB12 standB13 standB14 standB15 standB16 +$frame standB17 standB18 standB19 standB20 standB21 standB22 standB23 standB24 + +// (049 - 072) Stand idle - checking flail +$frame standC1 standC2 standC3 standC4 standC5 standC6 standC7 standC8 +$frame standC9 standC10 standC11 standC12 standC13 standC14 standC15 standC16 +$frame standC17 standC18 standC19 standC20 standC21 standC22 standC23 standC24 + +// (073 - 103) Stand idle - big sigh +$frame standD1 standD2 standD3 standD4 standD5 standD6 standD7 standD8 +$frame standD9 standD10 standD11 standD12 standD13 standD14 standD15 standD16 +$frame standD17 standD18 standD19 standD20 standD21 standD22 standD23 standD24 +$frame standD25 standD26 standD27 standD28 standD29 standD30 standD31 + +// (104 - 117) Default walk - typical hell knight stride +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +// (118 - 123) Default run +$frame run1 run2 run3 run4 run5 run6 + +// (124 - 138) Slice (one hand slashing run attack) (file=SWING) +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 +$frame slice9 slice10 slice11 slice12 slice13 slice14 slice15 + +// (139 - 153) Smash (chop overhead to ground) (file=CHOP) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 +$frame smash9 smash10 smash11 smash12 smash13 smash14 smash15 + +// (154 - 175) W_Attack (two handed slashing attack) (file=SLASH) +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 w_attack8 +$frame w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 w_attack15 w_attack16 +$frame w_attack17 w_attack18 w_attack19 w_attack20 w_attack21 w_attack22 + +// (176 - 189) MagicC - Typical magic range attack (file=SWEEPCAST) +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 magicc12 magicc13 magicc14 + +// Pain animations A = Slow (190 - 194), D = Stagger (195 - 205) +$frame painA1 painA2 painA3 painA4 painA5 +$frame painD1 painD2 painD3 painD4 painD5 painD6 painD7 painD8 painD9 painD10 painD11 + +// (206 - 217) Charging attack A - swinging sword left to right infront +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 + +// (218 - 223) Charging attack B - rotating sword left to right infront +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// (224 - 235) Death forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// (236 - 255) Death backwards with cool sword wobble +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 deathb12 deathb13 deathb14 deathb15 deathb16 +$frame deathb17 deathb18 deathb19 deathb20 + +void() dsergeant_sword_sound; // Sword swipe sounds +void(float soundtype) dsergeant_grunt_sound; + +// Different types of grunting sounds +float DSERG_SOUND_SIDESWING = 1; +float DSERG_SOUND_OVERSMASH = 2; +float DSERG_SOUND_RUNSWING = 3; + +//=========================================================================== + +void() dsergeant_standA1 =[ $standA1, dsergeant_standA2 ] {ai_stand();}; +void() dsergeant_standA2 =[ $standA2, dsergeant_standA3 ] {ai_stand();}; +void() dsergeant_standA3 =[ $standA3, dsergeant_standA4 ] {ai_stand();}; +void() dsergeant_standA4 =[ $standA4, dsergeant_standA5 ] {ai_stand();}; +void() dsergeant_standA5 =[ $standA5, dsergeant_standA6 ] {ai_stand();}; +void() dsergeant_standA6 =[ $standA6, dsergeant_standA7 ] {ai_stand();}; +void() dsergeant_standA7 =[ $standA7, dsergeant_standA8 ] {ai_stand();}; +void() dsergeant_standA8 =[ $standA8, dsergeant_standA9 ] {ai_stand();}; +void() dsergeant_standA9 =[ $standA9, dsergeant_standA10 ] {ai_stand();}; +void() dsergeant_standA10 =[ $standA10, dsergeant_standA11 ] {ai_stand();}; +void() dsergeant_standA11 =[ $standA11, dsergeant_standA12 ] {ai_stand();}; +void() dsergeant_standA12 =[ $standA12, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dsergeant_standB1 =[ $standB1, dsergeant_standB2 ] {ai_stand();}; +void() dsergeant_standB2 =[ $standB2, dsergeant_standB3 ] {ai_stand();}; +void() dsergeant_standB3 =[ $standB3, dsergeant_standB4 ] {ai_stand();}; +void() dsergeant_standB4 =[ $standB4, dsergeant_standB5 ] {ai_stand();}; +void() dsergeant_standB5 =[ $standB5, dsergeant_standB6 ] {ai_stand();}; +void() dsergeant_standB6 =[ $standB6, dsergeant_standB7 ] {ai_stand();}; +void() dsergeant_standB7 =[ $standB7, dsergeant_standB8 ] {ai_stand();}; +void() dsergeant_standB8 =[ $standB8, dsergeant_standB9 ] {ai_stand();}; +void() dsergeant_standB9 =[ $standB9, dsergeant_standB10 ] {ai_stand();}; +void() dsergeant_standB10 =[ $standB10, dsergeant_standB11 ] {ai_stand();}; +void() dsergeant_standB11 =[ $standB11, dsergeant_standB12 ] {ai_stand();}; +void() dsergeant_standB12 =[ $standB12, dsergeant_standB13 ] {ai_stand();}; +void() dsergeant_standB13 =[ $standB13, dsergeant_standB14 ] {ai_stand();}; +void() dsergeant_standB14 =[ $standB14, dsergeant_standB15 ] {ai_stand();}; +void() dsergeant_standB15 =[ $standB15, dsergeant_standB16 ] {ai_stand();}; +void() dsergeant_standB16 =[ $standB16, dsergeant_standB17 ] {ai_stand();}; +void() dsergeant_standB17 =[ $standB17, dsergeant_standB18 ] {ai_stand();}; +void() dsergeant_standB18 =[ $standB18, dsergeant_standB19 ] {ai_stand();}; +void() dsergeant_standB19 =[ $standB19, dsergeant_standB20 ] {ai_stand();}; +void() dsergeant_standB20 =[ $standB20, dsergeant_standB21 ] {ai_stand();}; +void() dsergeant_standB21 =[ $standB21, dsergeant_standB22 ] {ai_stand();}; +void() dsergeant_standB22 =[ $standB22, dsergeant_standB23 ] {ai_stand();}; +void() dsergeant_standB23 =[ $standB23, dsergeant_standB24 ] {ai_stand();}; +void() dsergeant_standB24 =[ $standB24, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dsergeant_standC1 =[ $standC1, dsergeant_standC2 ] {ai_stand();}; +void() dsergeant_standC2 =[ $standC2, dsergeant_standC3 ] {ai_stand();}; +void() dsergeant_standC3 =[ $standC3, dsergeant_standC4 ] {ai_stand();}; +void() dsergeant_standC4 =[ $standC4, dsergeant_standC5 ] {ai_stand();}; +void() dsergeant_standC5 =[ $standC5, dsergeant_standC6 ] {ai_stand();}; +void() dsergeant_standC6 =[ $standC6, dsergeant_standC7 ] {ai_stand();}; +void() dsergeant_standC7 =[ $standC7, dsergeant_standC8 ] {ai_stand();}; +void() dsergeant_standC8 =[ $standC8, dsergeant_standC9 ] {ai_stand();}; +void() dsergeant_standC9 =[ $standC9, dsergeant_standC10 ] {ai_stand();}; +void() dsergeant_standC10 =[ $standC10, dsergeant_standC11 ] {ai_stand();}; +void() dsergeant_standC11 =[ $standC11, dsergeant_standC12 ] {ai_stand();}; +void() dsergeant_standC12 =[ $standC12, dsergeant_standC13 ] {ai_stand();}; +void() dsergeant_standC13 =[ $standC13, dsergeant_standC14 ] {ai_stand();}; +void() dsergeant_standC14 =[ $standC14, dsergeant_standC15 ] {ai_stand();}; +void() dsergeant_standC15 =[ $standC15, dsergeant_standC16 ] {ai_stand();}; +void() dsergeant_standC16 =[ $standC16, dsergeant_standC17 ] {ai_stand();}; +void() dsergeant_standC17 =[ $standC17, dsergeant_standC18 ] {ai_stand();}; +void() dsergeant_standC18 =[ $standC18, dsergeant_standC19 ] {ai_stand();}; +void() dsergeant_standC19 =[ $standC19, dsergeant_standC20 ] {ai_stand();}; +void() dsergeant_standC20 =[ $standC20, dsergeant_standC21 ] {ai_stand();}; +void() dsergeant_standC21 =[ $standC21, dsergeant_standC22 ] {ai_stand();}; +void() dsergeant_standC22 =[ $standC22, dsergeant_standC23 ] {ai_stand();}; +void() dsergeant_standC23 =[ $standC23, dsergeant_standC24 ] {ai_stand();}; +void() dsergeant_standC24 =[ $standC24, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +// skipped 7 frames to reduce the animation down to 2.4s (10fps) +void() dsergeant_standD1 =[ $standD1, dsergeant_standD2 ] {ai_stand(); + sound (self, CHAN_VOICE, "dknight/dserg_hbreath.wav", 1, ATTN_IDLE);}; +void() dsergeant_standD2 =[ $standD2, dsergeant_standD3 ] {ai_stand();}; +void() dsergeant_standD3 =[ $standD4, dsergeant_standD4 ] {ai_stand();}; +void() dsergeant_standD4 =[ $standD6, dsergeant_standD5 ] {ai_stand();}; +void() dsergeant_standD5 =[ $standD8, dsergeant_standD6 ] {ai_stand();}; +void() dsergeant_standD6 =[ $standD9, dsergeant_standD7 ] {ai_stand();}; +void() dsergeant_standD7 =[ $standD10, dsergeant_standD8 ] {ai_stand();}; +void() dsergeant_standD8 =[ $standD11, dsergeant_standD9 ] {ai_stand();}; +void() dsergeant_standD9 =[ $standD12, dsergeant_standD10 ] {ai_stand();}; +void() dsergeant_standD10 =[ $standD13, dsergeant_standD11 ] {ai_stand();}; +void() dsergeant_standD11 =[ $standD14, dsergeant_standD12 ] {ai_stand();}; +void() dsergeant_standD12 =[ $standD15, dsergeant_standD13 ] {ai_stand();}; +void() dsergeant_standD13 =[ $standD16, dsergeant_standD14 ] {ai_stand();}; +void() dsergeant_standD14 =[ $standD17, dsergeant_standD15 ] {ai_stand();}; +void() dsergeant_standD15 =[ $standD19, dsergeant_standD16 ] {ai_stand();}; +void() dsergeant_standD16 =[ $standD21, dsergeant_standD17 ] {ai_stand();}; +void() dsergeant_standD17 =[ $standD23, dsergeant_standD18 ] {ai_stand();}; +void() dsergeant_standD18 =[ $standD24, dsergeant_standD19 ] {ai_stand();}; +void() dsergeant_standD19 =[ $standD25, dsergeant_standD20 ] {ai_stand();}; +void() dsergeant_standD20 =[ $standD26, dsergeant_standD21 ] {ai_stand();}; +void() dsergeant_standD21 =[ $standD27, dsergeant_standD22 ] {ai_stand();}; +void() dsergeant_standD22 =[ $standD28, dsergeant_standD23 ] {ai_stand();}; +void() dsergeant_standD23 =[ $standD29, dsergeant_standD24 ] {ai_stand();}; +void() dsergeant_standD24 =[ $standD30, dsergeant_stand1 ] {ai_stand();}; + +//=========================================================================== +void() dsergeant_stand1 =[ $stand1, dsergeant_stand2 ] {monster_idle_sound();ai_stand();}; +void() dsergeant_stand2 =[ $stand2, dsergeant_stand3 ] {ai_stand();}; +void() dsergeant_stand3 =[ $stand3, dsergeant_stand4 ] {ai_stand();}; +void() dsergeant_stand4 =[ $stand4, dsergeant_stand5 ] {ai_stand();}; +void() dsergeant_stand5 =[ $stand5, dsergeant_stand6 ] {ai_stand();}; +void() dsergeant_stand6 =[ $stand6, dsergeant_stand7 ] {ai_stand();}; +void() dsergeant_stand7 =[ $stand7, dsergeant_stand8 ] {ai_stand();}; +void() dsergeant_stand8 =[ $stand8, dsergeant_stand9 ] {ai_stand();}; +void() dsergeant_stand9 =[ $stand9, dsergeant_stand10 ] {ai_stand();}; +void() dsergeant_stand10 =[ $stand10, dsergeant_stand11 ] {ai_stand();}; +void() dsergeant_stand11 =[ $stand11, dsergeant_stand12 ] {ai_stand();}; +void() dsergeant_stand12 =[ $stand12, dsergeant_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + if (self.lip < 1) self.think = dsergeant_standD1; // Big Sigh + else if (self.lip < 2) self.think = dsergeant_standC1; // Look at weapon + else if (self.lip < 3) self.think = dsergeant_standA1; // Shoulder hunch + else self.think = dsergeant_standB1; // Look around + } + ai_stand();}; + +//=========================================================================== +void() dsergeant_walk1 =[ $walk1, dsergeant_walk2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_walk(2);}; +void() dsergeant_walk2 =[ $walk2, dsergeant_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() dsergeant_walk3 =[ $walk3, dsergeant_walk4 ] {ai_walk(5);}; +void() dsergeant_walk4 =[ $walk4, dsergeant_walk5 ] {ai_walk(4);}; +void() dsergeant_walk5 =[ $walk5, dsergeant_walk6 ] {ai_walk(4);}; +void() dsergeant_walk6 =[ $walk6, dsergeant_walk7 ] {ai_walk(2);}; +void() dsergeant_walk7 =[ $walk7, dsergeant_walk8 ] {ai_walk(2);}; +void() dsergeant_walk8 =[ $walk8, dsergeant_walk9 ] {monster_footstep(FALSE); ai_walk(3);}; +void() dsergeant_walk9 =[ $walk9, dsergeant_walk10] {ai_walk(3);}; +void() dsergeant_walk10=[ $walk10, dsergeant_walk11] {ai_walk(4);}; +void() dsergeant_walk11=[ $walk11, dsergeant_walk12] {ai_walk(3);}; +void() dsergeant_walk12=[ $walk12, dsergeant_walk13] {ai_walk(4);}; +void() dsergeant_walk13=[ $walk13, dsergeant_walk14] {ai_walk(6);}; +void() dsergeant_walk14=[ $walk14, dsergeant_walk1 ] {ai_walk(2);}; + +//---------------------------------------------------------------------- +void() dsergeant_run1 =[ $run1, dsergeant_run2 ] {monster_idle_sound(); + self.idlebusy = FALSE; ai_run (20); CheckForCharge(); }; +void() dsergeant_run2 =[ $run2, dsergeant_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() dsergeant_run3 =[ $run3, dsergeant_run4 ] {ai_run(16);}; +void() dsergeant_run4 =[ $run4, dsergeant_run5 ] {ai_run(14);}; +void() dsergeant_run5 =[ $run5, dsergeant_run6 ] {monster_footstep(FALSE); ai_run(25);}; +void() dsergeant_run6 =[ $run6, dsergeant_run1 ] {ai_run(13);}; + +//=========================================================================== +void() CheckForSergeantCharge = +{ + self.attack_timer = time + 0.3; + self.height = fabs(self.origin_z - self.enemy.origin_z); + + // If within melee range, go straight to melee + if (ai_checkmelee(MONAI_MELEEFRONT)) { + self.attack_state = AS_MELEE; + self.think = self.th_melee; + } + // Is the player visible or there is a large height difference? + else if (visblocked(self.enemy) || self.height > MONAI_CHARGEZAXIS) { + self.attack_state = AS_STRAIGHT; + self.think = dsergeant_run1; + } +}; + +//---------------------------------------------------------------------- +// Charging attack B - single swing of flail +void() dsergeant_char_b1 =[ $char_b1, dsergeant_char_b2 ] {ai_charge(23); + dsergeant_sword_sound();CheckForSergeantCharge();}; +void() dsergeant_char_b2 =[ $char_b2, dsergeant_char_b3 ] {ai_charge(17); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_b3 =[ $char_b3, dsergeant_char_b4 ] {ai_charge(12); + CheckForSergeantCharge();}; +void() dsergeant_char_b4 =[ $char_b4, dsergeant_char_b5 ] {ai_charge(22); + self.meleecontact = TRUE;ai_meleesmash(20);CheckForSergeantCharge();}; +void() dsergeant_char_b5 =[ $char_b5, dsergeant_char_b6 ] {ai_charge(18); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_b6 =[ $char_b6, dsergeant_char_b1 ] {ai_charge(8); + CheckForSergeantCharge();}; + +//---------------------------------------------------------------------- +// Charging attack A - swinging flail left to right infront +void() dsergeant_char_a1 =[ $char_a1, dsergeant_char_a2 ] {ai_charge(20); + dsergeant_sword_sound();CheckForSergeantCharge();}; +void() dsergeant_char_a2 =[ $char_a2, dsergeant_char_a3 ] {ai_charge(25); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a3 =[ $char_a3, dsergeant_char_a4 ] {ai_charge(18); + self.meleecontact = TRUE;ai_meleesmash(20);CheckForSergeantCharge();}; +void() dsergeant_char_a4 =[ $char_a4, dsergeant_char_a5 ] {ai_charge(16); + CheckForSergeantCharge();}; +void() dsergeant_char_a5 =[ $char_a5, dsergeant_char_a6 ] {ai_charge(14); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a6 =[ $char_a6, dsergeant_char_a7 ] {ai_charge(20); + CheckForSergeantCharge();}; +void() dsergeant_char_a7 =[ $char_a7, dsergeant_char_a8 ] {ai_charge(21); + dsergeant_sword_sound();CheckForSergeantCharge();}; +void() dsergeant_char_a8 =[ $char_a8, dsergeant_char_a9 ] {ai_charge(13); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a9 =[ $char_a9, dsergeant_char_a10] { ai_charge(20); + self.meleecontact = TRUE;ai_meleesmash(20);CheckForSergeantCharge();}; +void() dsergeant_char_a10=[ $char_a10,dsergeant_char_a11] {ai_charge(20); + CheckForSergeantCharge();}; +void() dsergeant_char_a11=[ $char_a11,dsergeant_char_a12] {ai_charge(18); + monster_footstep(FALSE);CheckForSergeantCharge();}; +void() dsergeant_char_a12=[ $char_a12,dsergeant_char_b1 ] {ai_charge(16); + CheckForSergeantCharge();}; + +//---------------------------------------------------------------------- +void() dsergeant_charging = +{ + if (random() < 0.35) dsergeant_char_a1 (); // Slow left+right swing + else dsergeant_char_b1 (); // fast spin around head +}; + +//=========================================================================== +// Melee Attack 1 - Slice (one hand swinging run attack) +void() dsergeant_slice1 =[ $slice2, dsergeant_slice2 ] {ai_charge(9);}; +void() dsergeant_slice2 =[ $slice4, dsergeant_slice3 ] {ai_charge(6);monster_footstep(FALSE);}; +void() dsergeant_slice3 =[ $slice5, dsergeant_slice4 ] {ai_charge(13);}; +void() dsergeant_slice4 =[ $slice6, dsergeant_slice5 ] {ai_charge(4); + dsergeant_grunt_sound(DSERG_SOUND_SIDESWING);}; +void() dsergeant_slice5 =[ $slice7, dsergeant_slice6 ] {ai_charge(7);monster_footstep(FALSE);}; +void() dsergeant_slice6 =[ $slice8, dsergeant_slice7 ] {ai_charge(15);dsergeant_sword_sound();}; +void() dsergeant_slice7 =[ $slice9, dsergeant_slice8 ] {ai_charge(8); + self.meleecontact = TRUE;ai_meleesmash(30);}; +void() dsergeant_slice8 =[ $slice10, dsergeant_slice9 ] {ai_charge(2);monster_footstep(FALSE);}; +void() dsergeant_slice9 =[ $slice11, dsergeant_slice10 ] {ai_charge(0);}; +void() dsergeant_slice10 =[ $slice13, dsergeant_slice11 ] {ai_charge(0);monster_footstep(FALSE);}; +void() dsergeant_slice11 =[ $slice14, dsergeant_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +// Melee Attack 2 - Smash (chop overhead to ground) +void() dsergeant_smash1 =[ $smash2, dsergeant_smash3 ] {ai_charge(1);}; +void() dsergeant_smash3 =[ $smash3, dsergeant_smash4 ] {ai_charge(13);}; +void() dsergeant_smash4 =[ $smash4, dsergeant_smash5 ] {ai_charge(9);monster_footstep(FALSE);}; +void() dsergeant_smash5 =[ $smash5, dsergeant_smash6 ] {ai_charge(11); + dsergeant_grunt_sound(DSERG_SOUND_OVERSMASH);}; +void() dsergeant_smash6 =[ $smash6, dsergeant_smash7 ] {ai_charge(10);dsergeant_sword_sound();}; +void() dsergeant_smash7 =[ $smash7, dsergeant_smash8 ] {ai_charge(7);}; +void() dsergeant_smash8 =[ $smash8, dsergeant_smash9 ] {ai_charge(12); +self.meleecontact = TRUE;ai_meleesmash(30);monster_footstep(FALSE);}; +void() dsergeant_smash9 =[ $smash9, dsergeant_smash10 ] {ai_charge(2);}; +void() dsergeant_smash10 =[ $smash10, dsergeant_smash11 ] {ai_charge(3);}; +void() dsergeant_smash11 =[ $smash11, dsergeant_smash12 ] {ai_charge(0);}; +void() dsergeant_smash12 =[ $smash12, dsergeant_smash13 ] {ai_charge(0);}; +void() dsergeant_smash13 =[ $smash13, dsergeant_smash14 ] {ai_charge(0);}; +void() dsergeant_smash14 =[ $smash14, dsergeant_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - W_Attack (two handed swinging attack) +void() dsergeant_watk1 =[ $w_attack1, dsergeant_watk2 ] {ai_charge(2);}; +void() dsergeant_watk2 =[ $w_attack2, dsergeant_watk3 ] {ai_charge(0);monster_footstep(FALSE);}; +void() dsergeant_watk3 =[ $w_attack3, dsergeant_watk4 ] {ai_charge(0);}; +void() dsergeant_watk4 =[ $w_attack4, dsergeant_watk5 ] {ai_charge(0);dsergeant_sword_sound();}; +void() dsergeant_watk5 =[ $w_attack5, dsergeant_watk6 ] {ai_charge(0); + dsergeant_grunt_sound(DSERG_SOUND_RUNSWING);}; +void() dsergeant_watk6 =[ $w_attack6, dsergeant_watk7 ] {ai_charge(0);}; +void() dsergeant_watk7 =[ $w_attack7, dsergeant_watk8 ] {ai_charge(1); + self.meleecontact = TRUE;ai_meleesmash(20);monster_footstep(FALSE);}; +void() dsergeant_watk8 =[ $w_attack8, dsergeant_watk9 ] {ai_charge(4);}; +void() dsergeant_watk9 =[ $w_attack9, dsergeant_watk10] {ai_charge(5);}; +void() dsergeant_watk10=[ $w_attack10,dsergeant_watk11] {ai_charge(3);}; +void() dsergeant_watk11=[ $w_attack11,dsergeant_watk12] {ai_charge(2);}; +void() dsergeant_watk12=[ $w_attack12,dsergeant_watk13] {ai_charge(2);}; +void() dsergeant_watk13=[ $w_attack13,dsergeant_watk14] {ai_charge(0);}; +void() dsergeant_watk14=[ $w_attack14,dsergeant_watk15] {ai_charge(0); + dsergeant_grunt_sound(DSERG_SOUND_RUNSWING);}; +void() dsergeant_watk15=[ $w_attack15,dsergeant_watk16] {ai_charge(0);dsergeant_sword_sound();}; +void() dsergeant_watk16=[ $w_attack16,dsergeant_watk17] {ai_charge(1);monster_footstep(FALSE);}; +void() dsergeant_watk17=[ $w_attack17,dsergeant_watk18] {ai_charge(1); + self.meleecontact = TRUE;ai_meleesmash(20);}; +void() dsergeant_watk18=[ $w_attack18,dsergeant_watk19] {ai_charge(3);}; +void() dsergeant_watk19=[ $w_attack19,dsergeant_watk20] {ai_charge(4);}; +void() dsergeant_watk20=[ $w_attack20,dsergeant_watk21] {ai_charge(6);}; +void() dsergeant_watk21=[ $w_attack21,dsergeant_watk22] {ai_charge(7);}; +void() dsergeant_watk22=[ $w_attack22,dsergeant_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +void() dsergeant_melee = +{ + self.meleeattack = random(); + if (self.meleeattack < 0.4) dsergeant_slice1 (); + else if (self.meleeattack < 0.9) dsergeant_smash1 (); + else dsergeant_watk1 (); +}; + +//=========================================================================== +// Death Sergeant Homing Missile Attack +//=========================================================================== +void() SergMissile = +{ + if (!self.enemy) return; + if (self.health < 1) return; + // Removing a fired homing missiles looks weird + //if (!visxray(self.enemy, self.attack_offset, '0 0 10', FALSE)) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "dknight/dserg_magic.wav", 1, ATTN_NORM); + self.attack_speed = SPEED_SERGMISSILE + (skill * SPEED_SERGSKILL); + Launch_HomingMissile (self.attack_offset, '0 0 10', CT_PROJ_SERG, self.attack_speed); +}; + +//---------------------------------------------------------------------- +// Hell Knight - 11 frames / Death Knight - 14 frames (skipped 1, 10,14) +// Death Knight frames trimmed down to match Hell Knight (damage ratio) +// Block pain function from interrupting magic attack +void() dsergeant_magicc1 =[ $magicc2, dsergeant_magicc2 ] {ai_face(); + SUB_AttackFinished (2 + random()*2); + self.pain_finished = time + 1; +}; +void() dsergeant_magicc2 =[ $magicc3, dsergeant_magicc3 ] {ai_face();}; +void() dsergeant_magicc3 =[ $magicc4, dsergeant_magicc4 ] {ai_face();}; +void() dsergeant_magicc4 =[ $magicc5, dsergeant_magicc5 ] {ai_face();}; +void() dsergeant_magicc5 =[ $magicc6, dsergeant_magicc6 ] {ai_face();}; +void() dsergeant_magicc6 =[ $magicc7, dsergeant_magicc7 ] {ai_face();}; +void() dsergeant_magicc7 =[ $magicc8, dsergeant_magicc8 ] {ai_face();}; +void() dsergeant_magicc8 =[ $magicc9, dsergeant_magicc9 ] {SergMissile();}; +void() dsergeant_magicc9 =[ $magicc11, dsergeant_magicc10] {ai_face();}; +void() dsergeant_magicc10 =[ $magicc12, dsergeant_magicc11] {ai_face();}; +void() dsergeant_magicc11 =[ $magicc13, dsergeant_run1] {ai_face();}; + +//============================================================================ + +void() dsergeant_painA1 =[ $painA1, dsergeant_painA2 ] {}; +void() dsergeant_painA2 =[ $painA2, dsergeant_painA3 ] {}; +void() dsergeant_painA3 =[ $painA3, dsergeant_painA4 ] {}; +void() dsergeant_painA4 =[ $painA4, dsergeant_painA5 ] {}; +void() dsergeant_painA5 =[ $painA5, dsergeant_run1 ] {}; +//---------------------------------------------------------------------- +// Not used, too slow for the segeant +void() dsergeant_painD1 =[ $painD1, dsergeant_painD2 ] {}; +void() dsergeant_painD2 =[ $painD2, dsergeant_painD3 ] {}; +void() dsergeant_painD3 =[ $painD3, dsergeant_painD4 ] {}; +void() dsergeant_painD4 =[ $painD4, dsergeant_painD5 ] {monster_footstep(FALSE);}; +void() dsergeant_painD5 =[ $painD5, dsergeant_painD6 ] {}; +void() dsergeant_painD6 =[ $painD6, dsergeant_painD7 ] {}; +void() dsergeant_painD7 =[ $painD7, dsergeant_painD8 ] {}; +void() dsergeant_painD8 =[ $painD8, dsergeant_painD9 ] {monster_footstep(FALSE);}; +void() dsergeant_painD9 =[ $painD9, dsergeant_painD10 ] {}; +void() dsergeant_painD10 =[ $painD10, dsergeant_painD11 ] {}; +void() dsergeant_painD11 =[ $painD11, dsergeant_run1 ] {}; +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) dsergeant_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) dsergeant_painA1 (); // classic, body recoil + else { + dsergeant_painD1 (); // Cool stumble + self.pain_finished = time + 2; // long animation + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.1; + self.axhitme = 0; + dsergeant_painD1 (); + } + } +}; + +//============================================================================ + +void() dsergeant_die1 =[ $death1, dsergeant_die2 ] {ai_forward(10);}; +void() dsergeant_die2 =[ $death2, dsergeant_die3 ] {monster_check_gib();ai_forward(8);}; +void() dsergeant_die3 =[ $death3, dsergeant_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() dsergeant_die4 =[ $death4, dsergeant_die5 ] {}; +void() dsergeant_die5 =[ $death5, dsergeant_die6 ] {}; +void() dsergeant_die6 =[ $death6, dsergeant_die7 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_CHAIN, 1, ATTN_NORM);}; +void() dsergeant_die7 =[ $death7, dsergeant_die8 ] {}; +void() dsergeant_die8 =[ $death8, dsergeant_die9 ] {ai_forward(10);}; +void() dsergeant_die9 =[ $death9, dsergeant_die10 ] {ai_forward(11);}; +void() dsergeant_die10 =[ $death10, dsergeant_die11 ] {}; +void() dsergeant_die11 =[ $death11, dsergeant_die12 ] {monster_death_postcheck();}; +void() dsergeant_die12 =[ $death12, dsergeant_die12 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dsergeant_dieb1 =[ $deathb1, dsergeant_dieb2 ] {}; +void() dsergeant_dieb2 =[ $deathb2, dsergeant_dieb3 ] {monster_check_gib();}; +void() dsergeant_dieb3 =[ $deathb3, dsergeant_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() dsergeant_dieb4 =[ $deathb4, dsergeant_dieb5 ] {}; +void() dsergeant_dieb5 =[ $deathb5, dsergeant_dieb6 ] {}; +void() dsergeant_dieb6 =[ $deathb6, dsergeant_dieb7 ] {}; +void() dsergeant_dieb7 =[ $deathb7, dsergeant_dieb8 ] {}; +void() dsergeant_dieb8 =[ $deathb8, dsergeant_dieb9 ] {}; +void() dsergeant_dieb9 =[ $deathb9, dsergeant_dieb10 ] { + sound (self, CHAN_WEAPON, GIB_SOUND_CHAIN, 1, ATTN_NORM);}; +void() dsergeant_dieb10 =[ $deathb10, dsergeant_dieb11 ] {}; +void() dsergeant_dieb11 =[ $deathb11, dsergeant_dieb12 ] {}; +void() dsergeant_dieb12 =[ $deathb12, dsergeant_dieb13 ] {}; +void() dsergeant_dieb13 =[ $deathb13, dsergeant_dieb14 ] {}; +void() dsergeant_dieb14 =[ $deathb14, dsergeant_dieb15 ] {}; +void() dsergeant_dieb15 =[ $deathb15, dsergeant_dieb16 ] {}; +void() dsergeant_dieb16 =[ $deathb16, dsergeant_dieb17 ] {}; +void() dsergeant_dieb17 =[ $deathb17, dsergeant_dieb18 ] {}; +void() dsergeant_dieb18 =[ $deathb18, dsergeant_dieb19 ] {}; +void() dsergeant_dieb19 =[ $deathb19, dsergeant_dieb20 ] {monster_death_postcheck();}; +void() dsergeant_dieb20 =[ $deathb20, dsergeant_dieb20 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() dsergeant_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) dsergeant_die1 (); + else dsergeant_dieb1 (); + } +}; + +//============================================================================ +void() dsergeant_sword_sound = +{ + self.meleecontact = TRUE; + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +//============================================================================ +void(float soundtype) dsergeant_grunt_sound = +{ + if (soundtype == DSERG_SOUND_SIDESWING) + sound (self, CHAN_WEAPON, "dknight/dfury_grunt2.wav", 1, ATTN_NORM); + else if (soundtype == DSERG_SOUND_OVERSMASH) + sound (self, CHAN_WEAPON, "dknight/dfury_leap.wav", 1, ATTN_NORM); + else { + self.weaponswitch = 0.6 + random()*0.4; + if (random() < 0.5) sound (self, CHAN_WEAPON, "dknight/dfury_grunt3.wav", self.weaponswitch, ATTN_NORM); + else sound (self, CHAN_WEAPON, "dknight/dfury_grunt4.wav", self.weaponswitch, ATTN_NORM); + } +}; + +/*====================================================================== +QUAKED monster_dsergeant (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_dsergeant = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_dsergeant.mdl"; // Blue badass! + self.headmdl = "progs/ad171/h_dknight.mdl"; + self.gib1mdl = "progs/ad171/w_blueflail.mdl"; // Unique weapon + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_SERG); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib2skin = self.gib3skin = 3; // Sergeant skin + self.gib1sound = GIB_IMPACT_CHAIN; + + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + // Special extra sounds + precache_sound ("dknight/dserg_hbreath.wav"); // Special long sigh (idle animation) + precache_sound ("dknight/dserg_magic.wav"); // New Spike ball launch sound + precache_sound ("hknight/death1.wav"); + self.pain_sound = "hknight/pain1.wav"; + precache_sound (self.pain_sound); + + // Jingle, Jangle of the flail chain + self.sight_sound = "dknight/dserg_sight.wav"; + precache_sound (self.sight_sound); + + // Heavy thud sound + self.meleehitsound = GIB_SOUND_HEAVY2; + precache_sound (self.meleehitsound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // New grunt sounds during combat + precache_sound ("dknight/dfury_grunt2.wav"); + precache_sound ("dknight/dfury_grunt3.wav"); + precache_sound ("dknight/dfury_grunt4.wav"); + precache_sound ("dknight/dfury_leap.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_SHALGRN); // Green voreball + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 400; // Shalrath level + self.gibhealth = -60; + self.gibbed = FALSE; + self.pain_flinch = 80; // Take a lot to go into pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // Shambler like pain level + self.infightextra = 2; // Double damage to other monsters + self.steptype = FS_TYPEHEAVY; // Heavy Player feet + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEFRONT; // Smash attack + self.attack_offset = '0 0 10'; + if (self.deathstring == "") self.deathstring = " was crushed by a Blue Flail Knight\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = DSergeantCheckAttack; + self.th_stand = dsergeant_stand1; + self.th_walk = dsergeant_walk1; + self.th_run = dsergeant_run1; + self.th_melee = dsergeant_melee; + self.th_missile = dsergeant_magicc1; + self.th_pain = dsergeant_pain; + self.th_die = dsergeant_die; + self.th_charge = dsergeant_charging; + + self.meleeattack = rint(random()*3); // randomize last melee attack + self.hittype = HIT_METAL; + self.classtype = CT_MONDSERG; + self.classgroup = CG_DCAPTAIN; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_eel.qc b/QC_other/QC_keep/mon_eel.qc new file mode 100644 index 00000000..4ea9d215 --- /dev/null +++ b/QC_other/QC_keep/mon_eel.qc @@ -0,0 +1,322 @@ +$frame eswim1 eswim2 eswim3 eswim4 eswim5 eswim6 + +$frame edeath1 edeath2 edeath3 edeath4 edeath5 edeath6 edeath7 edeath8 +$frame edeath9 edeath10 edeath11 edeath12 edeath13 edeath14 edeath15 + +void (entity inflictor, entity attacker, float damage) eel_pain1; + +void () eel_pitch_change = { + if ( (pointcontents (self.origin) != CONTENT_WATER) ) { + droptofloor (); + T_Damage (self,world,world,MOVETYPE_TOSS,DAMARMOR); + return ; + } + if ( (time < self.delay) ) + return ; + + if ( (self.weapon > MOVETYPE_BOUNCE) ) + self.weapon = -10.000; + + if ( (self.weapon < FALSE) ) { + self.angles_x = (self.angles_x - 1.500); + } else { + if ( (self.weapon > FALSE) ) + self.angles_x = (self.angles_x + 1.500); + } + self.weapon = (self.weapon + TRUE); +}; + +void () eel_stand1 = [ 0.000, eel_stand2 ] { + ai_stand (); + eel_pitch_change (); +}; +void () eel_stand2 = [ 1.000, eel_stand3 ] { + ai_stand (); + eel_pitch_change (); +}; +void () eel_stand3 = [ 2.000, eel_stand4 ] { + ai_stand (); + eel_pitch_change (); +}; +void () eel_stand4 = [ 3.000, eel_stand5 ] { + ai_stand (); + eel_pitch_change (); +}; +void () eel_stand5 = [ 4.000, eel_stand6 ] { + ai_stand (); + eel_pitch_change (); +}; +void () eel_stand6 = [ 5.000, eel_stand1 ] { + ai_stand (); + eel_pitch_change (); +}; + +void () eel_walk1 = [ 0.000, eel_walk2 ] { + if ( (random () < 0.200) ) + sound (self,CHAN_VOICE,"eel/eactive1.wav",TRUE,ATTN_IDLE); + + ai_walk (MOVETYPE_TOSS); + eel_pitch_change (); +}; +void () eel_walk2 = [ 1.000, eel_walk3 ] { + ai_walk (MOVETYPE_TOSS); + eel_pitch_change (); +}; +void () eel_walk3 = [ 2.000, eel_walk4 ] { + ai_walk (MOVETYPE_TOSS); + eel_pitch_change (); +}; +void () eel_walk4 = [ 3.000, eel_walk5 ] { + ai_walk (MOVETYPE_TOSS); + eel_pitch_change (); +}; +void () eel_walk5 = [ 4.000, eel_walk6 ] { + ai_walk (MOVETYPE_TOSS); + eel_pitch_change (); +}; +void () eel_walk6 = [ 5.000, eel_walk1 ] { + ai_walk (MOVETYPE_TOSS); + eel_pitch_change (); +}; + +void () eel_run1 = [ 0.000, eel_run2 ] { + if ( (random () < 0.400) ) + sound (self,CHAN_VOICE,"eel/eactive1.wav",TRUE,ATTN_IDLE); + + ai_run (MOVETYPE_BOUNCE); + eel_pitch_change (); +}; +void () eel_run2 = [ 1.000, eel_run3 ] { + ai_run (MOVETYPE_BOUNCE); + eel_pitch_change (); +}; +void () eel_run3 = [ 2.000, eel_run4 ] { + ai_run (MOVETYPE_BOUNCE); + eel_pitch_change (); +}; +void () eel_run4 = [ 3.000, eel_run5 ] { + ai_run (MOVETYPE_BOUNCE); + eel_pitch_change (); +}; +void () eel_run5 = [ 4.000, eel_run6 ] { + ai_run (MOVETYPE_BOUNCE); + eel_pitch_change (); +}; +void () eel_run6 = [ 5.000, eel_run1 ] { + ai_run (MOVETYPE_BOUNCE); + eel_pitch_change (); +}; + + +//============================================================================ +// RANGE - Plasma from mouth +//============================================================================ +void() eel_plasma = +{ + local vector org, dir; + + // Check if can fire bolt of plasma + if (visblocked_wide(self.enemy, self.attack_offset, '0 0 0')) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_EELBOLT + (skill * SPEED_EELSKILL); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(self.enemy.origin - self.origin); + + launch_plasma(org, dir, CT_PROJ_PLASMA, self.attack_speed); +}; + +void () eel_melee = { + local float attackOK; + + attackOK = TRUE; + traceline (self.origin,self.enemy.origin,FALSE,self); + if ( (trace_ent != self.enemy) ) + attackOK = FALSE; + + if ( (trace_inopen && trace_inwater) ) + attackOK = FALSE; + + if ( attackOK ) + T_EELZap (self,self,45.000, world, DAMAGEALL); + + self.skin = FALSE; + self.effects = FALSE; +}; + +void () eel_attack1 = [ 0.000, eel_attack2 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack2 = [ 1.000, eel_attack3 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack3 = [ 2.000, eel_attack4 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack4 = [ 3.000, eel_attack5 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack5 = [ 4.000, eel_attack6 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack6 = [ 5.000, eel_attack7 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack7 = [ 0.000, eel_attack8 ] { + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack8 = [ 1.000, eel_attack9 ] { + self.effects = EF_DIMLIGHT; + self.skin = TRUE; + ai_charge (FL_CLIENT); + eel_pitch_change (); + sound (self,CHAN_WEAPON,"eel/eatt1.wav",TRUE,ATTN_NORM); +}; +void () eel_attack9 = [ 2.000, eel_attack10 ] { + self.skin = FL_SWIM; + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack10 = [ 3.000, eel_attack11 ] { + self.skin = MOVETYPE_WALK; + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack11 = [ 4.000, eel_attack12 ] { + self.effects = EF_BRIGHTLIGHT; + self.skin = MOVETYPE_STEP; + ai_charge (FL_CLIENT); + eel_pitch_change (); +}; +void () eel_attack12 = [ 5.000, eel_run1 ] { + self.skin = MOVETYPE_FLY; + eel_melee (); +}; + +void() eel_attack2_1 = [ $eswim1, eel_attack2_2 ] {self.skin = 1;ai_face(); + sound (self, CHAN_VOICE, "eel/attack1.wav", 1, ATTN_NORM);}; +void() eel_attack2_2 = [ $eswim2, eel_attack2_3 ] {self.skin = 2;ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH;}; +void() eel_attack2_3 = [ $eswim3, eel_attack2_4 ] {self.skin = 3;ai_face();}; +void() eel_attack2_4 = [ $eswim4, eel_attack2_5 ] {self.skin = 4;ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH;}; +void() eel_attack2_5 = [ $eswim5, eel_attack2_6 ] {self.skin = 5;ai_face();}; +void() eel_attack2_6 = [ $eswim6, eel_attack2_7 ] { + self.skin = 4; ai_face(); eel_plasma();}; +void() eel_attack2_7 = [ $eswim1, eel_attack2_8 ] {self.skin = 5;}; +void() eel_attack2_8 = [ $eswim2, eel_attack2_9 ] {self.skin = 4;}; +void() eel_attack2_9 = [ $eswim3, eel_attack2_10 ] {self.skin = 3;}; +void() eel_attack2_10 = [ $eswim4, eel_attack2_11 ] {self.skin = 2;}; +void() eel_attack2_11 = [ $eswim5, eel_attack2_12 ] {self.skin = 1;ai_face();}; +void() eel_attack2_12 = [ $eswim6, eel_run1 ] {self.skin = 0;ai_face();}; + +void () eel_death1 = [ 6.000, eel_death2 ] { + self.skin = FALSE; + self.effects = FALSE; + sound (self,CHAN_VOICE,"eel/edie3r.wav",TRUE,ATTN_NORM); +}; + +void () eel_death2 = [ 7.000, eel_death3 ] { monster_check_gib(); }; +void () eel_death3 = [ 8.000, eel_death4 ] { monster_check_gib(); }; +void () eel_death4 = [ 9.000, eel_death5 ] {}; +void () eel_death5 = [ 8.000, eel_death6 ] {}; +void () eel_death6 = [ 7.000, eel_death7 ] {}; +void () eel_death7 = [ 6.000, eel_death8 ] {}; +void () eel_death8 = [ 7.000, eel_death9 ] {}; +void () eel_death9 = [ 8.000, eel_death10 ] {}; +void () eel_death10 = [ 9.000, eel_death11 ] {}; +void () eel_death11 = [ 10.000, eel_death12 ] { self.flags = (self.flags - FL_SWIM); }; +void () eel_death12 = [ 11.000, eel_death13 ] {}; +void () eel_death13 = [ 12.000, eel_death14 ] {}; +void () eel_death14 = [ 13.000, eel_death15 ] {}; +void () eel_death15 = [ 14.000, eel_death16 ] { droptofloor (); }; +void () eel_death16 = [ 15.000, eel_death16 ] { + self.solid = SOLID_NOT; + monster_death_postcheck(); +}; + +void () eel_death = { + if (pointcontents(self.origin) == CONTENT_WATER) self.gravity = 0.25; + monster_death_precheck(); + if (!self.gibbed) { eel_death1 (); } +}; + +void (entity inflictor, entity attacker, float damage) eel_pain1 = [ 6.000, eel_pain2 ] { + if ( (self.pain_finished > time) ) + return ; + + self.pain_finished = (time + TRUE); + sound (self,CHAN_VOICE,"eel/epain3.wav",TRUE,ATTN_NORM); + self.skin = FALSE; +}; +void () eel_pain2 = [ 7.000, eel_pain3 ] {}; +void () eel_pain3 = [ 8.000, eel_pain4 ] {}; +void () eel_pain4 = [ 9.000, eel_pain5 ] {}; +void () eel_pain5 = [ 8.000, eel_pain6 ] {}; +void () eel_pain6 = [ 7.000, eel_pain7 ] {}; +void () eel_pain7 = [ 6.000, eel_run1 ] {}; + +void () monster_eel = { + if ( deathmatch ) { remove(self); return ; } + + self.mdl = "progs/ad171/mon_eel.mdl"; + self.headmdl = "progs/ad171/eelgib.mdl"; + precache_model (self.mdl); + precache_model ("progs/ad171/eelgib.mdl"); + precache_model ("progs/ad171/gib1.mdl"); + precache_model ("progs/ad171/proj_plasma.mdl"); + precache_sound ("eel/edie3r.wav"); + precache_sound ("eel/epain3.wav"); + precache_sound ("eel/eactive1.wav"); + precache_sound ("eel/eatt1.wav"); + precache_sound ("eel/eelc5.wav"); + precache_sound ("eel/attack1.wav"); + + // Check for poisonous entity flag + if (self.poisonous) { + precache_poisongibs(); // precache gibs + self.gibtype = GIBTYPE_POISON; // Poisonous blood trails + precache_model (MODEL_PROJ_PLASMAGRN); + } + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_EEL; + if (self.health < 1) self.health = 60; + self.gibhealth = -25; + self.gibbed = FALSE; + self.blockudeath = TRUE; + self.pain_flinch = 10; // Easy response to pain + self.steptype = FS_FLYING; // It has fins!?! + + // Check for water sightline wakeup + if (self.spawnflags & MON_LIQUIDBLOCK) self.liquidblock = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = eel_stand1; + self.th_walk = eel_walk1; + self.th_run = eel_run1; + self.th_die = eel_death; + self.th_pain = eel_pain1; + self.th_melee = eel_attack1; + self.th_missile = eel_attack2_1; + + self.classtype = CT_MONEEL; + self.classgroup = CG_FISH; + self.classmove = MON_MOVESWIM; + if (self.deathstring == "") self.deathstring = " was electrified by an Eel\n"; + + monster_start (); +}; diff --git a/QC_other/QC_keep/mon_enforcer.qc b/QC_other/QC_keep/mon_enforcer.qc new file mode 100644 index 00000000..6ba9aa28 --- /dev/null +++ b/QC_other/QC_keep/mon_enforcer.qc @@ -0,0 +1,577 @@ +/*============================================================================== +ENFORCER +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 + +//============================================================================ +void() enf_stand1 =[ $stand1, enf_stand2 ] {monster_idle_sound(); ai_stand();}; +void() enf_stand2 =[ $stand2, enf_stand3 ] {ai_stand();}; +void() enf_stand3 =[ $stand3, enf_stand4 ] {ai_stand();}; +void() enf_stand4 =[ $stand4, enf_stand5 ] {ai_stand();}; +void() enf_stand5 =[ $stand5, enf_stand6 ] {ai_stand();}; +void() enf_stand6 =[ $stand6, enf_stand7 ] {ai_stand();}; +void() enf_stand7 =[ $stand7, enf_stand1 ] {ai_stand();}; + +//============================================================================ +void() enf_walk1 =[ $walk1, enf_walk2 ] {monster_idle_sound(); ai_walk(2);}; +void() enf_walk2 =[ $walk2, enf_walk3 ] {monster_footstep(FALSE); ai_walk(4);}; +void() enf_walk3 =[ $walk3, enf_walk4 ] {ai_walk(4);}; +void() enf_walk4 =[ $walk4, enf_walk5 ] {ai_walk(3);}; +void() enf_walk5 =[ $walk5, enf_walk6 ] {ai_walk(1);}; +void() enf_walk6 =[ $walk6, enf_walk7 ] {ai_walk(2);}; +void() enf_walk7 =[ $walk7, enf_walk8 ] {ai_walk(2);}; +void() enf_walk8 =[ $walk8, enf_walk9 ] {ai_walk(1);}; +void() enf_walk9 =[ $walk9, enf_walk10 ] {ai_walk(2);}; +void() enf_walk10 =[ $walk10, enf_walk11 ] {monster_footstep(FALSE); ai_walk(4);}; +void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);}; +void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);}; +void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);}; +void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);}; +void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);}; +void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);}; + +float MEGA_ENF = 2; + +float ULTRA_ENF = 4; +void enforcer_updateshield(); +void menf_ratk1(); +void menf_zatk1(); +void menf_gatk1(); +void menf_atk1(); +void enf_atk1(); + +//============================================================================ +void() enf_run1 =[ $run1, enf_run2 ] {monster_idle_sound(); ai_run(18); }; +void() enf_run2 =[ $run2, enf_run3 ] {ai_run(14); enforcer_updateshield(); }; +void() enf_run3 =[ $run3, enf_run4 ] {monster_footstep(FALSE); ai_run(7); enforcer_updateshield(); }; +void() enf_run4 =[ $run4, enf_run5 ] {ai_run(12); enforcer_updateshield(); }; +void() enf_run5 =[ $run5, enf_run6 ] {ai_run(14); enforcer_updateshield(); }; +void() enf_run6 =[ $run6, enf_run7 ] {ai_run(14); enforcer_updateshield(); }; +void() enf_run7 =[ $run7, enf_run8 ] {monster_footstep(FALSE); ai_run(7); enforcer_updateshield(); }; +void() enf_run8 =[ $run8, enf_run1 ] {ai_run(11); enforcer_updateshield(); }; + +void() enforcer_attack = { + local float edist; + edist = vlen(self.enemy.origin - self.origin); + if (self.spawnflags & ULTRA_ENF) { + if (random() < edist / 768 - 0.15) + menf_ratk1(); + else + menf_zatk1(); + } else if (self.spawnflags & MEGA_ENF) { + if (edist < 768 && random() > 0.5) + menf_gatk1(); + else + menf_atk1(); + } else { + enf_atk1(); + } +}; + +//============================================================================ +// - Basic enforcer (laser attack) +//---------------------------------------------------------------------- +void() enforcer_fire = +{ + local vector org, vec; + + if (!self.enemy) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + launch_projectile(org, vec, CT_PROJ_LASER, SPEED_LASER); +}; + +//---------------------------------------------------------------------- +void() enf_atk1 =[ $attack1, enf_atk2 ] {}; +void() enf_atk2 =[ $attack2, enf_atk3 ] {monster_footstep(FALSE);ai_face();}; +void() enf_atk3 =[ $attack3, enf_atk4 ] {ai_face();}; +void() enf_atk4 =[ $attack4, enf_atk5 ] {ai_face();}; +void() enf_atk5 =[ $attack5, enf_atk6 ] {ai_face();}; +void() enf_atk6 =[ $attack6, enf_atk7 ] { + if (self.health > 0) enforcer_fire();}; +void() enf_atk7 =[ $attack7, enf_atk8 ] {}; +void() enf_atk8 =[ $attack8, enf_atk9 ] {}; +void() enf_atk9 =[ $attack5, enf_atk10 ] {ai_face();}; +void() enf_atk10 =[ $attack6, enf_atk11 ] {ai_face(); + if (self.health > 0) enforcer_fire();}; +void() enf_atk11 =[ $attack7, enf_atk12 ] {}; +void() enf_atk12 =[ $attack8, enf_atk13 ] {}; +void() enf_atk13 =[ $attack9, enf_atk14 ] {ai_face();}; +void() enf_atk14 =[ $attack10, enf_run1 ] {ai_face();SUB_CheckRefire (enf_atk1);}; + +//============================================================================ +// - Defender enforcer (ssg/gl attack) +//---------------------------------------------------------------------- +void() defender_ssg = +{ + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/def_ssg_fire.wav", 1, ATTN_NORM); + + // Choose between a projectile or hit-scan system + if (query_configflag(SVR_SHOTGPROJ)) + FireBullets (QUANTITY_DEFENDER, SPREAD_DEF); + else { + Launch_Shells(QUANTITY_DEFENDER, SPREAD_DEF, CT_PROJ_SG); + Launch_ShellCasing(2); + } +}; + +//---------------------------------------------------------------------- +void() def_atkssg1 =[ $attack1, def_atkssg2 ] { + sound (self, CHAN_WEAPON, "enforcer/def_ssg_load.wav", 1, ATTN_NORM);}; +void() def_atkssg2 =[ $attack2, def_atkssg3 ] {monster_footstep(FALSE);ai_face();}; +void() def_atkssg3 =[ $attack3, def_atkssg4 ] {ai_face();}; +void() def_atkssg4 =[ $attack4, def_atkssg5 ] {ai_face();}; +void() def_atkssg5 =[ $attack5, def_atkssg6 ] {ai_face();}; +void() def_atkssg6 =[ $attack6, def_atkssg7 ] {ai_face(); + if (self.health > 0) defender_ssg();}; +void() def_atkssg7 =[ $attack7, def_atkssg8 ] {}; +void() def_atkssg8 =[ $attack8, def_atkssg9 ] {}; +void() def_atkssg9 =[ $attack9, def_atkssg10] {ai_face();}; +void() def_atkssg10=[ $attack10, enf_run1 ] {SUB_CheckRefire (def_atkssg1);}; + +//---------------------------------------------------------------------- +void() def_atkgl1 =[ $attack1, def_atkgl2 ] {ai_face();}; +void() def_atkgl2 =[ $attack2, def_atkgl3 ] {monster_footstep(FALSE);ai_face();}; +void() def_atkgl3 =[ $attack3, def_atkgl4 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() def_atkgl4 =[ $attack4, def_atkgl5 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() def_atkgl5 =[ $attack5, def_atkgl6 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() def_atkgl6 =[ $attack6, def_atkgl7 ] {ai_face(); + makevectors(self.angles); + self.pos1 = self.origin + attack_vector(self.attack_offset); + MonsterFireGrenade(self.pos1, self.enemy.origin); +}; +void() def_atkgl7 =[ $attack7, def_atkgl8 ] {}; +void() def_atkgl8 =[ $attack8, def_atkgl9 ] {}; +void() def_atkgl9 =[ $attack9, def_atkgl10] {ai_face();}; +void() def_atkgl10=[ $attack10, enf_run1 ]{ai_face();}; + + +//============================================================================ +// - Eliminator enforcer (plasma attack) +//---------------------------------------------------------------------- +void() eliminator_fire = +{ + local vector org, vec; + + if (!self.enemy) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + launch_plasma(org, vec, CT_PROJ_PLASMA, SPEED_PLASMA); +}; + +//---------------------------------------------------------------------- +void() elim_atk1 =[ $attack1, elim_atk2 ] { + sound (self, CHAN_WEAPON, "enforcer/elim_pg_load.wav", 1, ATTN_NORM);}; +void() elim_atk2 =[ $attack2, elim_atk3 ] {monster_footstep(FALSE);ai_face();}; +void() elim_atk3 =[ $attack3, elim_atk4 ] {ai_face();}; +void() elim_atk4 =[ $attack4, elim_atk5 ] {ai_face();}; +void() elim_atk5 =[ $attack5, elim_atk6 ] {ai_face();}; +void() elim_atk6 =[ $attack6, elim_atk7 ] {ai_face(); + if (self.health > 0) eliminator_fire();}; +void() elim_atk7 =[ $attack7, elim_atk8 ] {}; +void() elim_atk8 =[ $attack8, elim_atk9 ] {}; +void() elim_atk9 =[ $attack5, elim_atk10 ] {ai_face();}; +void() elim_atk10 =[ $attack6, elim_atk11 ] {ai_face(); + if (self.health > 0) eliminator_fire();}; +void() elim_atk11 =[ $attack7, elim_atk12 ] {}; +void() elim_atk12 =[ $attack8, elim_atk13 ] {}; +void() elim_atk13 =[ $attack9, elim_atk14 ] {ai_face();}; +void() elim_atk14 =[ $attack10, enf_run1 ] {ai_face();SUB_CheckRefire (elim_atk1);}; + +//============================================================================ +void() enf_paina1 =[ $paina1, enf_paina2 ] {}; +void() enf_paina2 =[ $paina2, enf_paina3 ] {}; +void() enf_paina3 =[ $paina3, enf_paina4 ] {}; +void() enf_paina4 =[ $paina4, enf_run1 ] {}; + +//---------------------------------------------------------------------- +void() enf_painb1 =[ $painb1, enf_painb2 ] {}; +void() enf_painb2 =[ $painb2, enf_painb3 ] {}; +void() enf_painb3 =[ $painb3, enf_painb4 ] {}; +void() enf_painb4 =[ $painb4, enf_painb5 ] {}; +void() enf_painb5 =[ $painb5, enf_run1 ] { enforcer_updateshield(); }; + +//---------------------------------------------------------------------- +void() enf_painc1 =[ $painc1, enf_painc2 ] {}; +void() enf_painc2 =[ $painc2, enf_painc3 ] {monster_footstep(FALSE);}; +void() enf_painc3 =[ $painc3, enf_painc4 ] {}; +void() enf_painc4 =[ $painc4, enf_painc5 ] {}; +void() enf_painc5 =[ $painc5, enf_painc6 ] { enforcer_updateshield(); }; +void() enf_painc6 =[ $painc6, enf_painc7 ] { enforcer_updateshield(); }; +void() enf_painc7 =[ $painc7, enf_painc8 ] { enforcer_updateshield(); }; +void() enf_painc8 =[ $painc8, enf_run1 ] { enforcer_updateshield(); }; + +//---------------------------------------------------------------------- +void() enf_paind1 =[ $paind1, enf_paind2 ] {}; +void() enf_paind2 =[ $paind2, enf_paind3 ] {}; +void() enf_paind3 =[ $paind3, enf_paind4 ] {monster_footstep(FALSE);}; +void() enf_paind4 =[ $paind4, enf_paind5 ] {ai_painforward(2);}; +void() enf_paind5 =[ $paind5, enf_paind6 ] {ai_painforward(1);}; +void() enf_paind6 =[ $paind6, enf_paind7 ] {}; +void() enf_paind7 =[ $paind7, enf_paind8 ] {}; +void() enf_paind8 =[ $paind8, enf_paind9 ] {}; +void() enf_paind9 =[ $paind9, enf_paind10 ] {}; +void() enf_paind10 =[ $paind10, enf_paind11 ] { enforcer_updateshield(); }; +void() enf_paind11 =[ $paind11, enf_paind12 ] {ai_painforward(1); enforcer_updateshield(); }; +void() enf_paind12 =[ $paind12, enf_paind13 ] {ai_painforward(1); enforcer_updateshield(); }; +void() enf_paind13 =[ $paind13, enf_paind14 ] {ai_painforward(1); enforcer_updateshield(); }; +void() enf_paind14 =[ $paind14, enf_paind15 ] { enforcer_updateshield(); }; +void() enf_paind15 =[ $paind15, enf_paind16 ] { enforcer_updateshield(); }; +void() enf_paind16 =[ $paind16, enf_paind17 ] {ai_pain(1); enforcer_updateshield(); }; +void() enf_paind17 =[ $paind17, enf_paind18 ] {ai_pain(1); enforcer_updateshield(); }; +void() enf_paind18 =[ $paind18, enf_paind19 ] { enforcer_updateshield(); }; +void() enf_paind19 =[ $paind19, enf_run1 ] { enforcer_updateshield(); }; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) enf_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random (); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (self.lip < 0.2) enf_paina1 (); + else if (self.lip < 0.4) enf_painb1 (); + else if (self.lip < 0.7) enf_painc1 (); + else { + self.pain_finished = time + 2; + enf_paind1 (); + } + } + // The new axe forces monsters into long pain animations + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.9; + self.axhitme = 0; + enf_paind1 (); + } + } +}; + +//============================================================================ +void() enf_die1 =[ $death1, enf_die2 ] {}; +void() enf_die2 =[ $death2, enf_die3 ] {monster_check_gib();}; +void() enf_die3 =[ $death3, enf_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);}; +void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);}; +void() enf_die6 =[ $death6, enf_die7 ] {}; +void() enf_die7 =[ $death7, enf_die8 ] {}; +void() enf_die8 =[ $death8, enf_die9 ] {}; +void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);}; +void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);}; +void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);}; +void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);}; +void() enf_die13 =[ $death13, enf_die14 ] {monster_death_postcheck();}; +void() enf_die14 =[ $death14, enf_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] {}; +void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {monster_check_gib();}; +void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {}; +void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {}; +void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {}; +void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {}; +void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {}; +void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {}; +void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {monster_death_postcheck();}; +void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() enf_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) enf_die1 (); + else enf_fdie1 (); + } +}; + +/*====================================================================== + QUAKED monster_enforcer (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_base_enforcer = +{ + local float r; + + self.mdl = "progs/mon_enforcer.mdl"; + self.headmdl = "progs/h_enforcer.mdl"; + self.gib1mdl = "progs/ad171/w_enforcergun.mdl"; // Unique weapon + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + + if (self.classtype == CT_MONENF_ULTRA) { + self.pain_sound = "enforcer/ue_pain1.wav"; + r = random(); + if (r < 0.5) + self.pain_sound2 = "enforcer/ue_pain2.wav"; + else + self.pain_sound2 = "enforcer/ue_pain3.wav"; + } else { + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + } + self.gib1sound = GIB_IMPACT_WOOD; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + self.gibhealth = -35; + self.gibbed = FALSE; + self.pain_flinch = 20; // low pain threshold + if (self.classtype == CT_MONENF_ULTRA) self.pain_flinch = 80; // high pain threshhold + if (self.classtype == CT_MONENF_MEGA) self.pain_flinch = 50; // medium pain threshold + self.pain_longanim = TRUE; // Long pain animation for axe + self.steptype = FS_TYPEHEAVY; // heavy player + self.attack_offset = '28 8.5 16'; // End of Gun + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.classtype == CT_MONELIMATOR) self.resist_cells = 0.5; + if (self.classtype == CT_MONDEFENDER) self.resist_rockets = 0.5; + if (self.classtype == CT_MONENF_MEGA) self.resist_cells = 0.75; + + self.th_stand = enf_stand1; + self.th_walk = enf_walk1; + self.th_run = enf_run1; + self.th_pain = enf_pain; + self.th_die = enf_die; + + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEWALK; + monster_start(); +}; + +void enforcer_spawnshieldfx(); + +//---------------------------------------------------------------------- +void() monster_enforcer = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONENFORCER; + precache_model (MODEL_PROJ_LASER); // Originally - progs/laser.mdl + precache_model2 ("progs/enforcer.mdl"); + + precache_model2 ("progs/h_mega.mdl"); + + precache_model2 ("progs/laser.mdl"); + + precache_model2 ("progs/laser2.mdl"); + + precache_model2 ("progs/k_spike.mdl"); + precache_model2 ("progs/missile.mdl"); + precache_sound2 ("enforcer/death1.wav"); + + precache_sound2 ("enforcer/enfire.wav"); + + precache_sound2 ("enforcer/enfstop.wav"); + + precache_sound2 ("enforcer/idle1.wav"); + + precache_sound2 ("enforcer/pain1.wav"); + + precache_sound2 ("enforcer/pain2.wav"); + + precache_sound2 ("enforcer/sight1.wav"); + + precache_sound2 ("enforcer/sight2.wav"); + + precache_sound2 ("enforcer/sight3.wav"); + + precache_sound2 ("enforcer/sight4.wav"); + + precache_sound2 ("enforcer/me_fire1.wav"); + + precache_sound2 ("enforcer/ue_fire1.wav"); + + precache_sound2 ("items/protect3.wav"); + + + precache_sound2 ("enforcer/ue_die1.wav"); + + precache_sound2 ("enforcer/ue_die2.wav"); + + precache_sound2 ("enforcer/ue_die3.wav"); + + precache_sound2 ("enforcer/ue_site1.wav"); + + precache_sound2 ("enforcer/ue_site2.wav"); + + precache_sound2 ("enforcer/ue_site3.wav"); + + precache_sound2 ("enforcer/ue_site4.wav"); + + precache_sound2 ("enforcer/ue_site5.wav"); + + precache_sound2 ("enforcer/ue_pain1.wav"); + + precache_sound2 ("enforcer/ue_pain2.wav"); + + precache_sound2 ("enforcer/ue_pain3.wav"); + + if (self.spawnflags & ULTRA_ENF) { + if (self.health < 1) self.health = 400; + self.skin = 12; + enforcer_spawnshieldfx(); + self.classtype = CT_MONENF_ULTRA; + if (self.deathstring == "") self.deathstring = " was vaporized by an Ultra-enforcer\n"; + } else { + if (self.spawnflags & MEGA_ENF) { + if (self.health < 1) self.health = 200; + self.skin = 11; + self.classtype = CT_MONENF_MEGA; + if (self.deathstring == "") self.deathstring = " was vaporized by a Mega-enforcer\n"; + } else { + if (self.health < 1) self.health = 80; + self.exactskin = rint((random()*3)-0.5); + if (self.deathstring == "") self.deathstring = " was blasted by an Enforcer\n"; + } + } + self.ammo_cells = rint(1 + random()*2); + self.gib1skin = 0; + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Projectile fire and impact (used in projectiles) + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + + //self.th_missile = enf_atk1; + self.th_missile = enforcer_attack; + + monster_base_enforcer(); +}; + +//---------------------------------------------------------------------- +void() monster_defender = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONDEFENDER; + precache_model (MODEL_PROJ_GRENADE); + + if (self.health < 1) self.health = 100; + self.ammo_shells = rint(4 + random()*4); + self.exactskin = 3 + rint((random()*3)-0.5); + self.gib1skin = 1; + + self.idle_sound = "enforcer/def_idle1.wav"; + self.idle_sound2 = "enforcer/def_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + self.sight_sound = "enforcer/def_sight1.wav"; + precache_sound (self.sight_sound); + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/def_ssg_load.wav"); + precache_sound ("enforcer/def_ssg_fire.wav"); + + self.th_missile = def_atkgl1; + self.th_melee = def_atkssg1; + self.th_checkattack = DefenderCheckAttack; + // Grenade bounce off body + self.bouncegrenade = TRUE; + if (self.deathstring == "") self.deathstring = " was destroyed by a Defender\n"; + + monster_base_enforcer(); +}; + +//---------------------------------------------------------------------- +void() monster_eliminator = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONELIMATOR; + precache_model (MODEL_PROJ_PLASMA); + + if (self.health < 1) self.health = 120; + self.ammo_cells = rint(2 + random()*2); + self.exactskin = 6 + rint((random()*3)-0.5); + self.gib1skin = 2; + + self.idle_sound = "enforcer/elim_idle1.wav"; + self.idle_sound2 = "enforcer/elim_idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + self.sight_sound = "enforcer/elim_sight1.wav"; + precache_sound (self.sight_sound); + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/elim_pg_load.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + self.th_missile = elim_atk1; + self.th_checkattack = EliminatorCheckAttack; + if (self.deathstring == "") self.deathstring = " was assasinated by a Eliminator\n"; + + monster_base_enforcer(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_enforcers_lunaran.qc b/QC_other/QC_keep/mon_enforcers_lunaran.qc new file mode 100644 index 00000000..fb1e6fbc --- /dev/null +++ b/QC_other/QC_keep/mon_enforcers_lunaran.qc @@ -0,0 +1,320 @@ +/*============================================================================== +ENFORCER +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 +//============================================================================ + +void menf_ratk9(); + +void() enforcer_shieldthink = { + if (self.owner.health <= 0) + { + remove(self); + return; + } + local float strength, i; + local vector offset, org; + + org = self.owner.origin; + + self.angles = '0 0 0'; + self.origin = org; // apparently I'm not supposed to do that + + strength = floor( self.owner.armorvalue / 8 ); + + if (strength > 0) { + for (i = 0; i < 5; i++) { + self.angles_x = time * 140; + self.angles_y = 360 * (i / 5); + makevectors(self.angles); + offset = v_forward * 20 + v_up * 3 + org; +// particle (offset + '0 0 -24', '0 0 0', 227 + strength*2, strength); + particle (offset, v_forward * 2, 227 + strength*2, strength); +// particle (offset + '0 0 40', '0 0 0', 227 + strength*2, strength); + } + } + self.nextthink = time + 0.1; +} + +void() enforcer_spawnshieldfx = { + local entity shieldfx; + shieldfx = spawn(); +// bprint ("Shield spawnded!\n"); + shieldfx.owner = self; + shieldfx.movetype = MOVETYPE_NONE; + setorigin (shieldfx, self.origin); + setsize( shieldfx, '0 0 0', '0 0 0'); + shieldfx.nextthink = time + 0.05; + shieldfx.think = enforcer_shieldthink; +} + +void() enforcer_updateshield = { + if (self.spawnflags & ULTRA_ENF) { + self.armorvalue = self.armorvalue + 2 + skill; + if (self.armorvalue > 30) + self.armorvalue = 30; +// bprint (ftos(self.armorvalue)); +// bprint ("\n"); + } +} + +// Yoinked from Zer + +void() particlethink = +{ + if (self.wait < time) + remove(self); + particle (self.origin, self.oldorigin, 10, 4); + particle (self.origin, self.oldorigin, 46, 6); + self.nextthink = time + 0.05; +}; + +void() enforcer_fireparticlebeam = +{ +local vector org, mep; +local entity missile; +local vector lead, spot; +local float go, dot; + + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors (self.angles); + + org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16'; + + sound (self, CHAN_WEAPON, "enforcer/me_fire1.wav", 1, ATTN_NORM); + + go = vlen(self.enemy.origin - org) / 400; + mep = self.enemy.velocity; + mep_z = 0; + spot = self.enemy.origin + mep * go; + + traceline(org, spot, FALSE, world); + if (trace_fraction < 0.8 || vlen(self.origin - self.enemy.origin) > 768) { + // Not a clear lead shot, shoot at player + spot = self.enemy.origin; + } + dot = (normalize(spot - org) * v_forward); + if ( dot < 0.75 ) { + // Too wacky an angle, just shoot at player + spot = self.enemy.origin; + } + lead = normalize(spot - org); + + missile = spawn (); + missile.owner = self; + missile.enemy = self.enemy; + missile.movetype = MOVETYPE_FLY; + missile.solid = SOLID_BBOX; + missile.effects = EF_DIMLIGHT; + + setmodel (missile, "progs/laser2.mdl"); + setorigin (missile, org); + setsize (missile, '0 0 0', '0 0 0'); + + missile.velocity = lead * 500; + missile.angles = vectoangles(missile.velocity); + missile.touch = Laser2_Touch; + + missile.wait = time + 5; + missile.nextthink = time + 0.05; + missile.think = particlethink; +}; + +void() enforcer_missiletouch = +{ + local float damg; + + if (other == self.owner) + return; // don't explode on owner + if (pointcontents(self.origin) == CONTENT_SKY) { + remove(self); + return; + } + + damg = 50 + random()*20; + if (other.health) + { + if (other.classname == "monster_enforcer") + damg = damg * 0.5; // not so rough on compatriots + T_Damage (other, self, self.owner, damg , DAMARMOR); + } + T_RadiusDamage (self, self.owner, damg, other, IGNORECLASS); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + BecomeExplosion (); +}; + +void() enforcer_firerocket = +{ + local vector org; + local entity missile; + local vector mep; + local vector lead, spot; + local float go; + + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors (self.angles); + + org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16'; + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + + go = vlen(self.enemy.origin - org) / 500; + mep = self.enemy.velocity; + mep_z = 0; + spot = self.enemy.origin + mep * go; + + traceline(org, spot, FALSE, world); + if (trace_fraction < 0.8) + { + //dprint("Not a clear lead shot, shoot at player.\n"); + spot = self.enemy.origin; + } + + lead = normalize(spot - org); + traceline(org, spot, FALSE, world); + if ( trace_fraction < 0.8 ) { + // Something got in the way, skip it + menf_ratk9(); + return; + } + + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "missile"; + + setmodel (missile, "progs/missile.mdl"); + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + v_forward*12 + '0 0 8'); + missile.velocity = lead * 400; + missile.angles = vectoangles(missile.velocity); + + missile.touch = enforcer_missiletouch; + +// set missile duration + missile.nextthink = time + 5; + missile.think = SUB_Remove; +}; + +void(float offset) enforcer_fireknight = +{ + local vector offang; + local vector org, vec; + + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 4; + + makevectors (offang); + + org = self.origin + self.mins + self.size*0.5 + v_forward * 12; + +// set missile speed + vec = normalize (v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + + self.attack_speed = SPEED_HKSPIKE + ( skill * SPEED_HKSKILL); + + launch_projectile (org, vec, CT_PROJ_ENFHKN, self.attack_speed); + //launch_spike (org, vec); + //newmis.classname = "knightspike"; + //newmis.touch = Laser2_Touch; + //setmodel (newmis, "progs/k_spike.mdl"); + //setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + //newmis.velocity = vec*400; + //sound (self, CHAN_WEAPON, "enforcer/ue_fire1.wav", 1, ATTN_NORM); + +}; + +void() menf_atk1 =[ $attack1, menf_atk2 ] {ai_face(); }; +void() menf_atk2 =[ $attack2, menf_atk3 ] {ai_face(); }; +void() menf_atk3 =[ $attack3, menf_atk4 ] {ai_face(); }; +void() menf_atk4 =[ $attack4, menf_atk5 ] {ai_face(); }; +void() menf_atk5 =[ $attack5, menf_atk6 ] {ai_face(); }; +void() menf_atk6 =[ $attack6, menf_atk7 ] {ai_face(); enforcer_fireparticlebeam(); }; +void() menf_atk7 =[ $attack7, menf_atk8 ] {ai_face(); }; +void() menf_atk8 =[ $attack5, menf_atk9 ] {ai_face(); }; +void() menf_atk9 =[ $attack6, menf_atk10 ] {ai_face(); enforcer_fireparticlebeam(); }; +void() menf_atk10 =[ $attack7, menf_atk11 ] {ai_face();}; +void() menf_atk11 =[ $attack5, menf_atk12 ] {ai_face();}; +void() menf_atk12 =[ $attack6, menf_atk13 ] {enforcer_fireparticlebeam(); }; +void() menf_atk13 =[ $attack7, menf_atk14 ] {ai_face();}; +void() menf_atk14 =[ $attack8, menf_atk15 ] {ai_face(); }; +void() menf_atk15 =[ $attack9, menf_atk16 ] {ai_face(); }; +void() menf_atk16 =[ $attack10, enf_run1 ] {ai_face(); SUB_CheckRefire (menf_atk1);}; + +void() menf_zatk1 =[ $attack1, menf_zatk2 ] {ai_face(); enforcer_updateshield(); }; +void() menf_zatk2 =[ $attack2, menf_zatk3 ] {ai_face(); enforcer_updateshield(); }; +void() menf_zatk3 =[ $attack3, menf_zatk4 ] {ai_face(); enforcer_updateshield(); }; +void() menf_zatk4 =[ $attack4, menf_zatk5 ] {ai_face(); enforcer_updateshield(); }; +void() menf_zatk5 =[ $attack5, menf_zatk6 ] {ai_face();}; +void() menf_zatk6 =[ $attack6, menf_zatk7 ] {enforcer_fireknight(-3); }; +void() menf_zatk7 =[ $attack7, menf_zatk8 ] {enforcer_fireknight(-2); }; +void() menf_zatk8 =[ $attack6, menf_zatk9 ] {enforcer_fireknight(-1); }; +void() menf_zatk9 =[ $attack5, menf_zatk10 ] {enforcer_fireknight(0); }; +void() menf_zatk10 =[ $attack6, menf_zatk11 ] {enforcer_fireknight(1); }; +void() menf_zatk11 =[ $attack7, menf_zatk12 ] {enforcer_fireknight(2); }; +void() menf_zatk12 =[ $attack6, menf_zatk13 ] {enforcer_fireknight(3); }; +void() menf_zatk13 =[ $attack8, menf_zatk14 ] {ai_face();}; +void() menf_zatk14 =[ $attack9, menf_zatk15 ] {ai_face(); enforcer_updateshield(); }; +void() menf_zatk15 =[ $attack10, enf_run1 ] {ai_face(); enforcer_updateshield(); SUB_CheckRefire (menf_zatk1);}; + +void() menf_gatk1 =[ $attack1, menf_gatk2 ] {ai_face();}; +void() menf_gatk2 =[ $attack2, menf_gatk3 ] {ai_face();}; +void() menf_gatk3 =[ $attack3, menf_gatk4 ] {ai_face(); MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() menf_gatk4 =[ $attack4, menf_gatk5 ] {ai_face();self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() menf_gatk5 =[ $attack5, menf_gatk6 ] {ai_face();self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() menf_gatk6 =[ $attack6, menf_gatk7 ] {ai_face(); makevectors(self.angles); + self.pos1 = self.origin + attack_vector(self.attack_offset); + MonsterFireGrenade(self.pos1, self.enemy.origin);}; +void() menf_gatk7 =[ $attack7, menf_gatk8 ] {ai_face();}; +void() menf_gatk8 =[ $attack8, menf_gatk9 ] {ai_face();}; +void() menf_gatk9 =[ $attack9, menf_gatk10 ] {ai_face();}; +void() menf_gatk10 =[ $attack10, enf_run1 ] {ai_face(); SUB_CheckRefire (menf_gatk1);}; + +void() menf_ratk1 =[ $attack1, menf_ratk2 ] {ai_face(); enforcer_updateshield(); }; +void() menf_ratk2 =[ $attack2, menf_ratk3 ] {ai_face(); enforcer_updateshield(); }; +void() menf_ratk3 =[ $attack3, menf_ratk4 ] {ai_face(); enforcer_updateshield(); }; +void() menf_ratk4 =[ $attack4, menf_ratk5 ] {ai_face();}; +void() menf_ratk5 =[ $attack5, menf_ratk6 ] {ai_face();}; +void() menf_ratk6 =[ $attack6, menf_ratk7 ] {ai_face(); enforcer_firerocket();}; +void() menf_ratk7 =[ $attack7, menf_ratk8 ] {ai_face();}; +void() menf_ratk8 =[ $attack8, menf_ratk9 ] {ai_face();}; +void() menf_ratk9 =[ $attack9, menf_ratk10 ] {ai_face(); enforcer_updateshield(); }; +void() menf_ratk10 =[ $attack10, enf_run1 ] {ai_face(); enforcer_updateshield(); SUB_CheckRefire (menf_ratk1);}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_fish.qc b/QC_other/QC_keep/mon_fish.qc new file mode 100644 index 00000000..101a53b6 --- /dev/null +++ b/QC_other/QC_keep/mon_fish.qc @@ -0,0 +1,273 @@ +/*============================================================================== +FISH FISH FISHY! (remade version by ijed) +==============================================================================*/ + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 +$frame attack8 attack9 attack10 attack11 attack12 attack13 attack14 +$frame attack15 attack16 attack17 attack18 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 + +$frame swim1 swim2 swim3 swim4 swim5 swim6 swim7 swim8 +$frame swim9 swim10 swim11 swim12 swim13 swim14 swim15 swim16 +$frame swim17 swim18 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 pain9 + +// Duplicate set of animations for a smaller scaled down version +$frame attackS1 attackS2 attackS3 attackS4 attackS5 attackS6 attackS7 +$frame attackS8 attackS9 attackS10 attackS11 attackS12 attackS13 attackS14 +$frame attackS15 attackS16 attackS17 attackS18 + +$frame deathS1 deathS2 deathS3 deathS4 deathS5 deathS6 deathS7 deathS8 +$frame deathS9 deathS10 deathS11 deathS12 deathS13 deathS14 deathS15 deathS16 +$frame deathS17 deathS18 deathS19 deathS20 deathS21 + +$frame swimS1 swimS2 swimS3 swimS4 swimS5 swimS6 swimS7 swimS8 +$frame swimS9 swimS10 swimS11 swimS12 swimS13 swimS14 swimS15 swimS16 +$frame swimS17 swimS18 + +$frame painS1 painS2 painS3 painS4 painS5 painS6 painS7 painS8 painS9 + +float FISH_STAND = 1; +float FISH_WALK = 2; +float FISH_RUN = 4; + +//============================================================================ +void() f_swim = { + // Do nothing if dead + if (self.health < 1) return; + + self.nextthink = time + 0.1; + if (self.walkframe == 1) monster_idle_sound(); + + // Keep moving the animation frame forward + if (self.state == FISH_RUN) self.walkframe = self.walkframe + 2; + else self.walkframe = self.walkframe + 1; + // Setup small/large frames + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $swimS1 + self.walkframe; + else self.frame = $swim1 + self.walkframe; + // Loop around animation block + if (self.walkframe > 17) self.walkframe = 0; + + if (self.state == FISH_STAND) ai_stand(); + else if (self.state == FISH_WALK) ai_walk(self.move_state_y); + else ai_run(self.move_state_z); +}; + +//---------------------------------------------------------------------- +void() f_stand1 = [ $swim1, f_swim ] { ai_stand();}; +void() f_standS1 = [ $swimS1, f_swim ] { ai_stand(); }; + +void() f_stand = { + self.walkframe = 0; self.state = FISH_STAND; + if (self.spawnflags & MON_FISH_SMALL) f_standS1(); + else f_stand1(); +}; + +//---------------------------------------------------------------------- +void() f_walk1 = [ $swim1, f_swim ] { ai_walk(self.move_state_y);}; +void() f_walkS1 = [ $swimS1, f_swim ] { ai_walk(self.move_state_y);}; + +void() f_walk = { + self.walkframe = 0; self.state = FISH_WALK; + if (self.spawnflags & MON_FISH_SMALL) f_walkS1(); + else f_walk1(); +}; + +//---------------------------------------------------------------------- +void() f_run1 = [ $swim1, f_swim ] { ai_run(self.move_state_z);}; +void() f_runS1 = [ $swimS1, f_swim ] { ai_run(self.move_state_z);}; + +void() f_run = { + self.walkframe = 0; self.state = FISH_RUN; + if (self.spawnflags & MON_FISH_SMALL) f_runS1(); + else f_run1(); +}; + +//============================================================================ +void() fish_melee = +{ + local float ldmg; + + if (!self.enemy) return; // removed before stroke + ai_damagebreakable(5); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEFISH)) return; // Too far away + + // Fish bites man! + ldmg = (random() + random()) * 3; + sound (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() f_attack2 = { + // Do nothing if dead + if (self.health < 1) return; + self.nextthink = time + 0.1; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $attackS1 + self.walkframe; + else self.frame = $attack1 + self.walkframe; + + // Setup special frame attacks + if (self.walkframe > 17) self.think = self.th_run; + if (self.walkframe == 2 || self.walkframe == 8 || self.walkframe == 14) + fish_melee(); + else ai_charge(self.move_state_y); +}; + +//---------------------------------------------------------------------- +void() f_attack1 = [ $attack1, f_attack2 ] {}; +void() f_attackS1 = [ $attackS1, f_attack2 ] {}; + +void() f_attack = { + self.walkframe = 0; + ai_charge(self.move_state_y); + if (self.spawnflags & MON_FISH_SMALL) f_attackS1(); + else f_attack1(); +}; + +//============================================================================ +void() f_pain2 = { + self.nextthink = time + 0.1; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $painS1 + self.walkframe; + else self.frame = $pain1 + self.walkframe; + + if (self.walkframe > 8) self.think = self.th_run; + if (self.walkframe > 1) ai_pain(self.move_state_y/2); +}; + +void() f_pain1 = [ $pain1, f_pain2 ] {}; +void() f_painS1 = [ $painS1, f_pain2 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) fish_pain = +{ + if (self.health < 1) return; + self.walkframe = 0; + if (self.spawnflags & MON_FISH_SMALL) f_painS1(); + else f_pain1(); +}; + +//============================================================================ +void() f_deathend = { monster_deadbody_check(); }; + +//---------------------------------------------------------------------- +void() f_death2 = { + self.nextthink = time + 0.1; + + // Keep moving the animation frame forward + self.walkframe = self.walkframe + 1; + if (self.spawnflags & MON_FISH_SMALL) + self.frame = $deathS1 + self.walkframe; + else self.frame = $death1 + self.walkframe; + + // Keep moving the animation frame forward + if (self.walkframe < 3) monster_check_gib(); + if (self.walkframe > 2) self.solid = SOLID_NOT; + if (self.walkframe == 19) monster_death_postcheck(); + if (self.walkframe > 19) f_deathend(); +}; + +void() f_death1 = [ $death1, f_death2 ] {}; +void() f_deathS1 = [ $deathS1, f_death2 ] {}; + +//---------------------------------------------------------------------- +void() fish_die = +{ + // If fish in water, reduce self gravity to pretend to slowly sink + if (pointcontents(self.origin) == CONTENT_WATER) self.gravity = 0.25; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + self.walkframe = 0; + sound (self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM); + if (self.spawnflags & MON_FISH_SMALL) f_deathS1(); + else f_death1(); + } +}; + +/*====================================================================== +QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_fish = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_fish.mdl"; // Using new model + precache_model (self.mdl); + + self.idle_sound = "fish/idle.wav"; + self.sight_sound = self.idle_sound; + precache_sound (self.idle_sound); + + precache_sound ("fish/death.wav"); + precache_sound ("fish/bite.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.gibhealth = -10; + self.gibbed = FALSE; + self.pain_flinch = 1; // Always in pain + self.steptype = FS_FLYING; // It has fins!?! + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '24 0 -8'; // Bite attack offset + if (!self.exactskin) self.randomskin = 4; + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was fed to the Rotfish\n"; + } else { + if (self.deathstring == "") self.deathstring = " sleeps with the fishies\n"; + } + + // Check for water sightline wakeup + if (self.spawnflags & MON_LIQUIDBLOCK) self.liquidblock = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Tiny fish are easier to kill + if (self.spawnflags & MON_FISH_SMALL) { + if (self.bboxtype < 1) self.bboxtype = BBOX_FISHS; + if (self.health < 1) self.health = 15; + // The small fish moving really fast looks odd + // reverted speed and movement back to original + //self.move_state = '0 12 16'; + self.move_state = '0 8 12'; + } + else { + if (self.bboxtype < 1) self.bboxtype = BBOX_FISH; + if (self.health < 1) self.health = 25; + self.move_state = '0 8 12'; + } + + self.th_stand = f_stand; + self.th_walk = f_walk; + self.th_run = f_run; + self.th_die = fish_die; + self.th_pain = fish_pain; + self.th_melee = f_attack; + + self.classtype = CT_MONFISH; + self.classgroup = CG_FISH; + self.classmove = MON_MOVESWIM; + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_floyd.qc b/QC_other/QC_keep/mon_floyd.qc new file mode 100644 index 00000000..770701f1 --- /dev/null +++ b/QC_other/QC_keep/mon_floyd.qc @@ -0,0 +1,536 @@ + /*============================================================================= + +monster_floyd (Automaton) +code by john fitzgibbons + +==============================================================================*/ +$skin floyd +$skin asleep + +$frame skin +$frame idle1 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 attack9 +$frame paina1 paina2 paina3 paina4 paina5 paina6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 painc11 painc12 painc13 painc14 +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 death10 death11 death12 death13 death14 death15 death16 + +/* +================ +stand, walk, run +================ +*/ + +float FLOYD_ROLLING = 2; + +float FLOYD_ASLEEP = 4; + +void () floyd_sleep = [84, floyd_sleep] {ai_stand ();}; + +void () floyd_idle1 = [$idle1, floyd_idle1] { + if (random () < 0.02) + sound (self, CHAN_VOICE, "floyd/idle.wav", 1, ATTN_IDLE); + ai_stand (); +}; +void () floyd_walk1 = [$walk1, floyd_walk2] +{ + if (random () < 0.2) + sound (self, CHAN_VOICE, "floyd/idle.wav", 1, ATTN_IDLE); + ai_walk (1.875); +}; +void () floyd_walk2 = [$walk2, floyd_walk3] {ai_walk (1.875);}; +void () floyd_walk3 = [$walk3, floyd_walk4] {ai_walk (1.875);}; +void () floyd_walk4 = [$walk4, floyd_walk5] {ai_walk (1.875);}; +void () floyd_walk5 = [$walk5, floyd_walk6] {ai_walk (1.875);}; +void () floyd_walk6 = [$walk6, floyd_walk7] {ai_walk (1.875);}; +void () floyd_walk7 = [$walk7, floyd_walk8] {ai_walk (1.875);}; +void () floyd_walk8 = [$walk8, floyd_walk9] {ai_walk (1.875);}; +void () floyd_walk9 = [$walk9, floyd_walk10] {ai_walk (1.875);}; +void () floyd_walk10 = [$walk10, floyd_walk11] {ai_walk (1.875);}; +void () floyd_walk11 = [$walk11, floyd_walk12] {ai_walk (1.875);}; +void () floyd_walk12 = [$walk12, floyd_walk13] {ai_walk (1.875);}; +void () floyd_walk13 = [$walk13, floyd_walk14] {ai_walk (1.875);}; +void () floyd_walk14 = [$walk14, floyd_walk15] {ai_walk (1.875);}; +void () floyd_walk15 = [$walk15, floyd_walk16] {ai_walk (1.875);}; +void () floyd_walk16 = [$walk16, floyd_walk1] {ai_walk (1.875);}; + +void () floyd_run1 = [$run1, floyd_run2] {ai_run (3.75);}; +void () floyd_run2 = [$run2, floyd_run3] {ai_run (3.75);}; +void () floyd_run3 = [$run3, floyd_run4] {ai_run (3.75);}; +void () floyd_run4 = [$run4, floyd_run5] {ai_run (3.75);}; +void () floyd_run5 = [$run5, floyd_run6] {ai_run (3.75);}; +void () floyd_run6 = [$run6, floyd_run7] {ai_run (3.75);}; +void () floyd_run7 = [$run7, floyd_run8] {ai_run (3.75);}; +void () floyd_run8 = [$run8, floyd_run1] {ai_run (3.75);}; + +/* +================ +attack +================ +*/ + +void() FLaser_Touch = +{ + local vector org; + + if (other == self.owner) + return; // don't explode on owner + + if (pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + org = self.origin - 10*normalize(self.velocity); + + if (other.health) + { + SpawnBlood (other, org, self.velocity*0.2, 15); + T_Damage (other, self, self.owner, 15, DAMARMOR); + } + else + { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + } + + remove(self); +}; + +void(vector org, vector vec) FLaunchLaser = +{ + //local vector vec; + + if (self.classname == "monster_floyd") + sound (self, CHAN_WEAPON, "floyd/fire.wav", 1, ATTN_NORM); + + + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLY; + newmis.solid = SOLID_BBOX; + newmis.effects = EF_DIMLIGHT; + + setmodel (newmis, "progs/flaser.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + + setorigin (newmis, org); + + vec = normalize(vec); + newmis.velocity = vec * 800; + newmis.angles = vectoangles(newmis.velocity); + + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + newmis.touch = FLaser_Touch; +}; + +void(float muzzle) floyd_fire = +{ + local vector org; + + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors (self.angles); + + org = self.origin + v_forward * 30 + '0 0 28' + v_right * muzzle; + + FLaunchLaser(org, self.enemy.origin - self.origin - '0 0 12'); +}; + +void() floyd_ready1 =[ $run1, floyd_ready2 ] {ai_face();}; +void() floyd_ready2 =[ $run2, floyd_ready3 ] {ai_face();}; +void() floyd_ready3 =[ $run3, floyd_ready4 ] {ai_face();}; +void() floyd_ready4 =[ $run4, floyd_attack1 ] {ai_face(); + if (!clean_shot (self.enemy)) self.think = floyd_run5; //abort if shot is blocked by monster or wall +}; +void() floyd_attack1 =[ $attack1, floyd_attack2 ] {floyd_fire(6);}; +void() floyd_attack2 =[ $attack2, floyd_attack3 ] {ai_face();}; +void() floyd_attack3 =[ $attack3, floyd_attack4 ] {ai_face();}; +void() floyd_attack4 =[ $attack4, floyd_attack5 ] {floyd_fire(0);}; +void() floyd_attack5 =[ $attack5, floyd_attack6 ] {ai_face();}; +void() floyd_attack6 =[ $attack6, floyd_attack7 ] {ai_face();}; +void() floyd_attack7 =[ $attack7, floyd_attack8 ] {floyd_fire(-6);}; +void() floyd_attack8 =[ $attack8, floyd_attack9 ] {ai_face();}; +void() floyd_attack9 =[ $attack9, floyd_run1 ] { ai_face(); SUB_CheckRefire (floyd_attack1); }; + +/* +================ +pain +================ +*/ + +void () floyd_paina1 = [$paina1, floyd_paina2] {}; +void () floyd_paina2 = [$paina2, floyd_paina3] {}; +void () floyd_paina3 = [$paina3, floyd_paina4] {}; +void () floyd_paina4 = [$paina4, floyd_paina5] {}; +void () floyd_paina5 = [$paina5, floyd_paina6] {}; +void () floyd_paina6 = [$paina6, floyd_run1] {}; + +void () floyd_painb1 = [$painb1, floyd_painb2] {}; +void () floyd_painb2 = [$painb2, floyd_painb3] {}; +void () floyd_painb3 = [$painb3, floyd_painb4] {}; +void () floyd_painb4 = [$painb4, floyd_painb5] {}; +void () floyd_painb5 = [$painb5, floyd_painb6] {}; +void () floyd_painb6 = [$painb6, floyd_painb7] {}; +void () floyd_painb7 = [$painb7, floyd_painb8] {}; +void () floyd_painb8 = [$painb8, floyd_painb9] {}; +void () floyd_painb9 = [$painb9, floyd_painb10] {}; +void () floyd_painb10 = [$painb10, floyd_run1] {}; + +void () floyd_painc1 = [$painc1, floyd_painc2] {}; +void () floyd_painc2 = [$painc2, floyd_painc3] {}; +void () floyd_painc3 = [$painc3, floyd_painc4] {}; +void () floyd_painc4 = [$painc4, floyd_painc5] {}; +void () floyd_painc5 = [$painc5, floyd_painc6] {}; +void () floyd_painc6 = [$painc6, floyd_painc7] {}; +void () floyd_painc7 = [$painc7, floyd_painc8] {ai_painforward(1.25);}; +void () floyd_painc8 = [$painc8, floyd_painc9] {ai_painforward(1.25);}; +void () floyd_painc9 = [$painc9, floyd_painc10] {ai_painforward(1.25);}; +void () floyd_painc10 = [$painc10, floyd_painc11] {ai_painforward(1.25);}; +void () floyd_painc11 = [$painc11, floyd_painc12] {ai_painforward(1.25);}; +void () floyd_painc12 = [$painc12, floyd_painc13] {ai_painforward(1.25);}; +void () floyd_painc13 = [$painc13, floyd_painc14] {ai_painforward(1.25);}; +void () floyd_painc14 = [$painc14, floyd_run1] {ai_painforward(1.25);}; + +void(entity inflictor, entity attacker, float damage) floyd_pain = { + local float d; + + if (self.pain_finished > time) + return; + + if (random()*150 > damage) + return; // didn't flinch + + sound (self, CHAN_VOICE, "floyd/pain.wav", 1, ATTN_NORM); + + if (self.spawnflags & FLOYD_ROLLING) + return; + + d = anglemod(self.angles_y - self.ideal_yaw); + + if (d > 90 && d < 270) { + //lurch forward if hit in the back + floyd_painc1 (); + self.pain_finished = time + 2; + } else { + if (random() < 0.4) { + floyd_paina1 (); + self.pain_finished = time + 1; + } else { + floyd_painb1 (); + self.pain_finished = time + 2; + } + } + +}; + +/* +================ +death +================ +*/ + +void(string gibname, float dm) ThrowFloydHead = { + local entity head; + head = spawn(); + head.origin = self.origin; + setmodel (head, gibname); + head.frame = 0; + head.nextthink = -1; + head.movetype = MOVETYPE_BOUNCE; + head.takedamage = DAMAGE_NO; + head.solid = SOLID_NOT; + setsize (head, '-16 -16 0', '16 16 32'); + head.velocity = VelocityForDamage (dm); + head.origin_z = self.origin_z + 32; + head.angles_y = self.angles_y; + head.flags = self.flags - (self.flags & FL_ONGROUND); + head.avelocity = crandom() * '0 600 0'; +}; + +void(string gibname, float dm) ThrowFloydGib = +{ + local entity new; + new = spawn(); + new.origin_x = self.origin_x - 16 + random()*32; + new.origin_y = self.origin_y - 16 + random()*32; + new.origin_z = self.origin_z - 32 + random()*64; + setmodel (new, gibname); + setsize (new, '0 0 0', '0 0 0'); + new.velocity_x = crandom() * 400; + new.velocity_y = crandom() * 400; + new.velocity_z = 200 + random() * 400; + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_NOT; + new.avelocity_x = random()*600; + new.avelocity_y = random()*600; + new.avelocity_z = random()*600; + new.think = SUB_Remove; + new.ltime = time; + new.nextthink = time + 10 + random()*10; + new.flags = 0; +}; + +void () floyd_explode = { + local float gibs; + + T_RadiusDamage (self, self, 100, world, DAMAGEALL); + if (self.health > -50) self.health = -50; + if (!(self.spawnflags & FLOYD_ROLLING)) //don't throw head if you're on your back, cuz it looks funny + ThrowFloydHead ("progs/h_floyd.mdl", self.health); + + //gibs + gibs = 8; + while (gibs > 0) { + ThrowFloydGib (self.gib1mdl, self.health); + gibs = gibs - 1; + } + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + BecomeExplosion (); +} + +void () floyd_death2 = [$death2, floyd_death3] {ai_painforward(-3.33);}; +void () floyd_death3 = [$death3, floyd_death4] {ai_painforward(-3.34);}; +void () floyd_death4 = [$death4, floyd_death5] {ai_painforward(-3.33);}; +void () floyd_death5 = [$death5, floyd_death6] {ai_painforward(-5);}; +void () floyd_death6 = [$death6, floyd_death7] {ai_painforward(-5);}; +void () floyd_death7 = [$death7, floyd_death8] {ai_painforward(-8);}; +void () floyd_death8 = [$death8, floyd_death9] {ai_painforward(-8);}; +void () floyd_death9 = [$death9, floyd_death10] {ai_painforward(-8);}; +void () floyd_death10 = [$death10, floyd_death11] {ai_painforward(-8);}; +void () floyd_death11 = [$death11, floyd_death12] {}; +void () floyd_death12 = [$death12, floyd_death13] {}; +void () floyd_death13 = [$death13, floyd_death14] {}; +void () floyd_death14 = [$death14, floyd_death15] {}; +void () floyd_death15 = [$death15, floyd_explode] {self.spawnflags = FLOYD_ROLLING; self.takedamage = DAMAGE_NO;}; + +void() floyd_die = { + //check for gib + if (self.health < self.gibhealth || random() > 0.75 || self.spawnflags & FLOYD_ROLLING) { + self.takedamage = DAMAGE_NO; + floyd_explode(); + } else { + sound (self, CHAN_VOICE, "floyd/death.wav", 1, ATTN_NORM); + floyd_death2 (); //skip $death1, which is the idle frame + } +}; + +void () floyd_roll = { + self.frame = self.frame + 1; + + if (self.frame > $death15 || self.frame < $death10) + self.frame = $death10; + + self.think = floyd_roll; + self.nextthink = time + 0.1; +} + +/* +================ +this chunk of code figures out rolling floyd's ideal bounding box no matter at what angle he's placed. +================ +*/ + +vector (vector testmoos, float testang, float testradius, float minmax) test_moos_angle = { + local vector testangs, floyd_moos; + floyd_moos = testmoos; + testangs = '0 0 0'; + testangs_y = testang; + makevectors(testangs); + v_forward_y = v_forward_y * testradius; + v_forward_x = v_forward_x * testradius; + if (minmax == 1) //1 for maxes, 0 for mins + { + if (v_forward_y > floyd_moos_y) floyd_moos_y = v_forward_y; + if (v_forward_x > floyd_moos_x) floyd_moos_x = v_forward_x; + } else { + if (v_forward_y < floyd_moos_y) floyd_moos_y = v_forward_y; + if (v_forward_x < floyd_moos_x) floyd_moos_x = v_forward_x; + } + return floyd_moos; +} + +vector (entity floyd) get_floyd_mins = +{ + local float feetyaw; + local vector floyd_mins; + + floyd_mins = '0 0 -24'; + feetyaw = anglemod(floyd.angles_y); + + floyd_mins = test_moos_angle(floyd_mins, feetyaw + 17.4, 38, 0); //foot + floyd_mins = test_moos_angle(floyd_mins, feetyaw + 180 - 17.4, 38, 0); //shoulder + floyd_mins = test_moos_angle(floyd_mins, feetyaw + 180, 40, 0); //head + floyd_mins = test_moos_angle(floyd_mins, feetyaw + 180 + 17.4, 38, 0); //shoulder + floyd_mins = test_moos_angle(floyd_mins, feetyaw + 360 - 17.4, 38, 0); //foot + + return floyd_mins; +} + +vector (entity floyd) get_floyd_maxs = { + local float feetyaw; + local vector floyd_maxs; + + floyd_maxs = '0 0 12'; + feetyaw = anglemod(floyd.angles_y); + + floyd_maxs = test_moos_angle(floyd_maxs, feetyaw + 17.4, 38, 1); //foot + floyd_maxs = test_moos_angle(floyd_maxs, feetyaw + 180 - 17.4, 38, 1); //shoulder + floyd_maxs = test_moos_angle(floyd_maxs, feetyaw + 180, 40, 1); //head + floyd_maxs = test_moos_angle(floyd_maxs, feetyaw + 180 + 17.4, 38, 1); //shoulder + floyd_maxs = test_moos_angle(floyd_maxs, feetyaw + 360 - 17.4, 38, 1); //foot + + return floyd_maxs; +} + +void () floyd_wake1 = [84, floyd_wake2] {}; +void () floyd_wake2 = [83, floyd_wake3] {}; +void () floyd_wake3 = [82, floyd_wake4] {}; +void () floyd_wake4 = [81, floyd_idle1] { + if (self.enemy) { + monster_sightsound(); + FoundHuntTarget(TRUE); + self.think = self.th_run; + self.nextthink = time + 0.1; + } else self.think = self.th_stand; +}; + + +void() floyd_awake = { + self.spawnstatue = FALSE; // No longer stationary + self.use = SUB_Null; // no re-trigger + self.spawnflags = self.spawnflags - FLOYD_ASLEEP; + self.skin = 0; + self.th_stand = floyd_idle1; + self.th_walk = floyd_walk1; + self.th_run = floyd_run1; + self.th_pain = floyd_pain; + self.th_missile = floyd_ready1; + self.pain_flinch = self.health; + self.pain_timeout = 2; + self.pain_finished = time + self.pain_timeout; + self.flags = self.flags | FL_MONSTER; + self.think = floyd_wake1; + self.nextthink = time + 0.1; +}; + +void(entity inflictor, entity attacker, float damage) floyd_painawake = { + floyd_awake(); +} + +//============================================================================= + +/*QUAKED monster_floyd (1 0 0) (-32 -32 -24) (32 32 64) AMBUSH ROLLING ASLEEP +Automaton, 200 health points. + +AMBUSH: floyd will only wake up on really seeing the player, not another monster getting angry. + +ROLLING: floyd is on his back and helpless. explodes after taking 50 damage. + +ASLEEP: floyd will not respond to anything unless he is shot or his targetname is triggered. +*/ + +void() monster_floyd = { + if (deathmatch) { remove(self); return; } + + precache_model2("progs/floyd.mdl"); + precache_model2("progs/flaser.mdl"); + precache_model2("progs/h_floyd.mdl"); + precache_model2("progs/floydgib1.mdl"); + + precache_sound2("floyd/idle.wav"); + precache_sound2("floyd/sight.wav"); + precache_sound2("floyd/pain.wav"); + precache_sound2("floyd/fire.wav"); + precache_sound2("floyd/death.wav"); + precache_sound2("enforcer/enfstop.wav"); + + self.mdl = "progs/floyd.mdl"; + self.headmdl = "progs/h_floyd.mdl"; + self.gib1mdl = "progs/floydgib1.mdl"; + if (self.health < 1) self.health = 200; + self.gibhealth = -35; + + // Common specialty settings for FLOYD_ROLLING or FLOYD_ASLEEP spawnflags + self.skin = 0; + self.movetype = MOVETYPE_STEP; + self.solid = SOLID_SLIDEBOX; + self.th_die = floyd_die; + self.no_liquiddmg = TRUE; // Immune to slime/lava + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.classtype = CT_MONFLOYD; + self.classgroup = CG_ROBOT; + + self.hittype = HIT_METAL; + + if (self.spawnflags & FLOYD_ROLLING) { + setmodel(self, "progs/floyd.mdl"); + setsize(self, get_floyd_mins(self), get_floyd_maxs(self)); + self.health = 75; + self.th_stand = floyd_roll; + self.th_walk = floyd_roll; + self.th_run = floyd_roll; + self.th_pain = floyd_pain; + self.takedamage = DAMAGE_AIM; + self.flags = self.flags | FL_MONSTER; + total_monsters = total_monsters + 1; + if (self.deathstring == "") self.deathstring = " rolled on the floor with an Automaton\n"; + self.pausetime = 99999999; + self.th_stand (); + } else if (self.spawnflags & FLOYD_ASLEEP) { + setmodel(self, "progs/floyd.mdl"); + if (!self.bboxtype) self.bboxtype = BBOX_GIANT; + setsize(self, '-24 -24 -24', '24 24 64'); + self.skin = 1; + self.th_stand = floyd_sleep; + self.th_run = floyd_sleep; + self.th_pain = floyd_painawake; + self.flags = self.flags | FL_MONSTER; + self.think1 = floyd_awake; + self.pain_longanim = FALSE; // resistant to shadow axe + self.spawnstatue = TRUE; + self.reset_health = self.health; + self.ideal_yaw = self.angles * '0 1 0'; + if (!self.yaw_speed) self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + self.flags = self.flags | FL_MONSTER; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was made obsolete by an awoken Automaton\n"; + + monster_start(); + self.takedamage = DAMAGE_AIM; + } else { + //normal operation + if (!self.bboxtype) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 200; + self.gibhealth = -35; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + self.th_stand = floyd_idle1; + self.th_walk = floyd_walk1; + self.th_pain = floyd_pain; + self.th_run = floyd_run1; + self.th_missile = floyd_ready1; + if (self.deathstring == "") self.deathstring = " was made obsolete by an Automaton\n"; + + self.classmove = MON_MOVEWALK; + + monster_start(); + } +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_freddie.qc b/QC_other/QC_keep/mon_freddie.qc new file mode 100644 index 00000000..5f79e255 --- /dev/null +++ b/QC_other/QC_keep/mon_freddie.qc @@ -0,0 +1,558 @@ +/*============================================================================== +FREDDIE (Edie from Quoth - Kell/Necros/Preach) +==============================================================================*/ +// Run/Walk same animation +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 + +// Run and fire nail/laser gun at same time +$frame rfire1 rfire2 rfire3 rfire4 rfire5 rfire6 rfire7 rfire8 +$frame rfire9 rfire10 rfire11 rfire12 rfire13 rfire14 rfire15 rfire16 + +// Stand and fire nail/laser gun +$frame sfire1 sfire2 sfire3 sfire4 sfire5 sfire6 sfire7 sfire8 +$frame sfire9 sfire10 sfire11 sfire12 sfire13 sfire14 sfire15 sfire16 +$frame sfire17 sfire18 sfire19 sfire20 sfire21 sfire22 sfire23 sfire24 +$frame sfire25 sfire26 sfire27 sfire28 + +// Pain forward +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 +$frame pain9 pain10 pain11 pain12 + +// Pain Backward (short) +$frame painb1 painb2 painb3 painb4 painb5 + +// Quick forward swing of chainsaw arm +$frame fswing1 fswing2 fswing3 fswing4 fswing5 fswing6 fswing7 fswing8 +$frame fswing9 fswing10 fswing11 + +// Quick smack with elbow of chainsaw arm +$frame fswinge1 fswinge2 fswinge3 fswinge4 fswinge5 fswinge6 fswinge7 +$frame fswinge8 fswinge9 fswinge10 + +// Slow back swing of chainsaw arm (left to right) +$frame bswing1 bswing2 bswing3 bswing4 bswing5 bswing6 bswing7 bswing8 +$frame bswing9 bswing10 bswing11 bswing12 bswing13 bswing14 + +// Extremely long death animation! +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 death23 death24 +$frame death25 death26 death27 death28 death29 death30 death31 death32 +$frame death33 death34 death35 + +// Export frames (ignored) +$frame base1 base2 + +// Standing / idle animation +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +//============================================================================ +void() fred_stand1 =[ $stand1, fred_stand2 ] {monster_idle_sound(); ai_stand();}; +void() fred_stand2 =[ $stand2, fred_stand3 ] {ai_stand();}; +void() fred_stand3 =[ $stand3, fred_stand4 ] {ai_stand();}; +void() fred_stand4 =[ $stand4, fred_stand5 ] {ai_stand();}; +void() fred_stand5 =[ $stand5, fred_stand6 ] {ai_stand();}; +void() fred_stand6 =[ $stand6, fred_stand7 ] {ai_stand();}; +void() fred_stand7 =[ $stand7, fred_stand8 ] {ai_stand();}; +void() fred_stand8 =[ $stand8, fred_stand1 ] {ai_stand();}; + +//============================================================================ +void() fred_walk1 = [ $run1, fred_walk2 ] {monster_idle_sound(); ai_walk(20);}; +void() fred_walk2 = [ $run2, fred_walk3 ] {monster_footstep(FALSE);ai_walk(16);}; +void() fred_walk3 = [ $run3, fred_walk4 ] {ai_walk(1);}; +void() fred_walk4 = [ $run4, fred_walk5 ] {ai_walk(2);}; +void() fred_walk5 = [ $run5, fred_walk6 ] {ai_walk(4);}; +void() fred_walk6 = [ $run6, fred_walk7 ] {ai_walk(8);}; +void() fred_walk7 = [ $run7, fred_walk8 ] {ai_walk(4);}; +void() fred_walk8 = [ $run8, fred_walk9 ] {ai_walk(16);}; +void() fred_walk9 = [ $run9, fred_walk10 ] {ai_walk(20);}; +void() fred_walk10 = [ $run10, fred_walk11 ] {monster_footstep(FALSE);ai_walk(16);}; +void() fred_walk11 = [ $run11, fred_walk12 ] {ai_walk(1);}; +void() fred_walk12 = [ $run12, fred_walk13 ] {ai_walk(2);}; +void() fred_walk13 = [ $run13, fred_walk14 ] {ai_walk(4);}; +void() fred_walk14 = [ $run14, fred_walk15 ] {ai_walk(8);}; +void() fred_walk15 = [ $run15, fred_walk16 ] {ai_walk(4);}; +void() fred_walk16 = [ $run16, fred_walk1 ] {ai_walk(16);}; + +//=========================================================================== +// RANGE ATTACK - Fires spikes or laser bolts +//=========================================================================== +void(vector weapofs) fred_fireweapon = +{ + local vector org, dir, vec; + if (self.health < 1) return; + + // Lit up that barrel + self.effects = self.effects | EF_MUZZLEFLASH; + // Nail and laser use the same firing speed + self.attack_speed = SPEED_FREDDIEPROJ + (skill * SPEED_FREDDIESKILL); + // turn and face your enemy! + makevectors (self.angles); + org = self.origin + attack_vector(weapofs); + + // The mini burst mode (run+fire) can do tracking + if (self.attack_timer && skill > SKILL_NORMAL) { + // More precise fire, track player velocity + // Reset the tracking on first shot, get better over time + if (self.cnt == 1) + self.attack_track = SUB_Tracking(self.enemy.origin, weapofs, self.enemy, self.attack_speed); + else self.attack_track = SUB_Tracking(self.attack_track, weapofs, self.enemy, self.attack_speed); + dir = normalize(self.attack_track - org); + } + else { + // Standard mode spray bullets at player + vec = v_right*(crandom()*(20+random()*50)); + dir = normalize((self.enemy.origin + vec) - org); + } + + // Switch projectile type based on spawnflag + if (self.spawnflags & MON_FREDDIE_LASER) { + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_LASER, self.attack_speed); + } + else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_MONNG, self.attack_speed); + } +}; + +// Start the initial wind up of the weapon first +//---------------------------------------------------------------------- +void() fred_sfire1 = [ $sfire1, fred_sfire2 ] {ai_face(); + self.pain_finished = time + 0.5 + (skill*0.5); + sound (self, CHAN_WEAPON, "freddie/stfire.wav", 1, ATTN_NORM);}; +void() fred_sfire2 = [ $sfire2, fred_sfire3 ] {ai_face();}; +void() fred_sfire3 = [ $sfire3, fred_sfire4 ] {ai_face();}; +void() fred_sfire4 = [ $sfire4, fred_sfire5 ] {ai_face();}; +void() fred_sfire5 = [ $sfire5, fred_sfire6 ] {ai_face();monster_footstep(FALSE);}; +void() fred_sfire6 = [ $sfire6, fred_sfire7 ] {ai_face();}; +void() fred_sfire7 = [ $sfire7, fred_sfire8 ] {ai_face();}; +void() fred_sfire8 = [ $sfire8, fred_sfire9 ] {ai_face(); + self.cnt = 0; + // Vary bullet burst based on skill + self.attack_chance = 4 + skill*2; +}; + +// Fire the weapon in bursts +//---------------------------------------------------------------------- +void(vector weapofs) fred_standfire = +{ + // Always check AI health before locking in function + if (self.health < 1) return; + + // Turn before offset check + ai_face(); + + // If no enemy or enemy dead then stop attack + if (!self.enemy || self.enemy.health < 1) self.cnt = 10; + // Check if can see enemy? (use weapon offset) + else if (visxray(self.enemy, weapofs, '0 0 0', FALSE)) + self.cnt = self.cnt + 1; + // Reset counter and keep firing + else self.cnt = 0; + + // If fired a burst of bullets at enemy, stop loop + if (self.cnt > self.attack_chance) self.think = self.th_charge; + else fred_fireweapon(weapofs); +}; + +// Cycle through barrel firing +// Easy = 7 shots, Normal = 11 shots, Hard/NM = 15 shots +//---------------------------------------------------------------------- +void() fred_sfire9 = [ $sfire9, fred_sfire10 ] {fred_standfire('45 -10 20');}; +void() fred_sfire10 = [ $sfire10, fred_sfire11 ] {fred_standfire('45 -10 20');}; +void() fred_sfire11 = [ $sfire11, fred_sfire12 ] {fred_standfire('45 -10 22');}; +void() fred_sfire12 = [ $sfire12, fred_sfire13 ] {fred_standfire('45 -10 22');}; +void() fred_sfire13 = [ $sfire13, fred_sfire14 ] {fred_standfire('45 -12 23');}; +void() fred_sfire14 = [ $sfire14, fred_sfire15 ] {fred_standfire('42 -12 25');}; +void() fred_sfire15 = [ $sfire15, fred_sfire16 ] {fred_standfire('42 -14 23'); + // Always double check health before changing think + if (self.health > 0 && skill == SKILL_EASY) self.think = self.th_charge;}; +void() fred_sfire16 = [ $sfire16, fred_sfire17 ] {fred_standfire('38 -14 27');}; +void() fred_sfire17 = [ $sfire17, fred_sfire18 ] {fred_standfire('38 -17 26');}; +void() fred_sfire18 = [ $sfire18, fred_sfire19 ] {fred_standfire('36 -17 28');}; +void() fred_sfire19 = [ $sfire19, fred_sfire20 ] {fred_standfire('36 -17 26'); + // Always double check health before changing think + if (self.health > 0 && skill == SKILL_NORMAL) self.think = self.th_charge;}; +void() fred_sfire20 = [ $sfire20, fred_sfire21 ] {fred_standfire('30 -17 28');}; +void() fred_sfire21 = [ $sfire21, fred_sfire22 ] {fred_standfire('30 -18 25');}; +void() fred_sfire22 = [ $sfire22, fred_sfire23 ] {fred_standfire('25 -18 27');}; +void() fred_sfire23 = [ $sfire23, fred_sfire24 ] {fred_standfire('25 -18 27');}; + +// Finish the wind down of weapon +void() fred_sfire24 = [ $sfire24, fred_sfire25 ] {}; +void() fred_sfire25 = [ $sfire25, fred_sfire26 ] {}; +void() fred_sfire26 = [ $sfire26, fred_sfire27 ] {}; +void() fred_sfire27 = [ $sfire27, fred_run ] {}; + +//============================================================================ +// freddie has a run while firing and can switch seamless +// between the two if the player is within sight +//============================================================================ +void() fred_runframe = +{ + // If dead, no more updates + if (self.health < 1) return; + // If enemy is dead or missing no firing + if (!self.enemy || self.enemy.health < 1) self.attack_timer = FALSE; + + if (self.attack_timer) self.frame = $rfire1 + self.walkframe; + else self.frame = $run1 + self.walkframe; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 1) monster_footstep(FALSE); + else if (self.walkframe == 10) monster_footstep(FALSE); + + if (self.walkframe == 0) {self.distance = 24;self.attack_offset = '50 -20 32';} + else if (self.walkframe == 1) {self.distance = 19;self.attack_offset = '43 -18 33';} + else if (self.walkframe == 2) {self.distance = 1;self.attack_offset = '53 -20 27';} + else if (self.walkframe == 3) {self.distance = 2;self.attack_offset = '47 -19 31';} + else if (self.walkframe == 4) {self.distance = 5;self.attack_offset = '54 -17 29';} + else if (self.walkframe == 5) {self.distance = 10;self.attack_offset = '47 -17 35';} + else if (self.walkframe == 6) {self.distance = 5;self.attack_offset = '53 -15 32';} + else if (self.walkframe == 7) {self.distance = 5;self.attack_offset = '47 -15 36';} + else if (self.walkframe == 8) {self.distance = 24;self.attack_offset = '50 -13 32';} + else if (self.walkframe == 9) {self.distance = 19;self.attack_offset = '46 -15 33';} + else if (self.walkframe == 10) {self.distance = 1;self.attack_offset = '51 -14 33';} + else if (self.walkframe == 11) {self.distance = 2;self.attack_offset = '47 -14 32';} + else if (self.walkframe == 12) {self.distance = 5;self.attack_offset = '52 -14 33';} + else if (self.walkframe == 13) {self.distance = 10;self.attack_offset = '47 -14 36';} + else if (self.walkframe == 14) {self.distance = 5;self.attack_offset = '49 -14 35';} + else if (self.walkframe == 15) {self.distance = 5;self.attack_offset = '45 -15 34';} + + // Run + Fire time? + if (self.attack_timer) { + // Keep turning towards the enemy + ai_face(); + // Fire a small burst at the enemy + self.cnt = self.cnt + 1; + if (self.cnt > 2) self.attack_timer = FALSE; + else fred_fireweapon(self.attack_offset); + } + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 15) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = fred_runframe; + + ai_run(self.distance); +}; + +//---------------------------------------------------------------------- +void() fred_run = { self.walkframe = 0; fred_runframe(); }; + +//=========================================================================== +// MELEE ATTACK - Various back and forth blade arm attacks +//=========================================================================== +void(float side) fred_blade = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_damagebreakable(20); // Damage any breakables + if (!ai_checkmelee(self.meleerange)) return; // Too far away + + // Can the target bleed? - generate blood + if (!CanDamage (self.enemy, self)) return; + + sound (self, CHAN_WEAPON, "freddie/mangle.wav", 1, ATTN_NORM); + ldmg = (random() + random() + random()) * 20; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + SpawnMeatSpray (self, self.enemy, side); +}; + +// Alternative ending of melee attack (chance of extra damage) +//---------------------------------------------------------------------- +void() fred_bswing1 = [ $bswing1, fred_bswing2 ] {ai_faceforward(20); + sound (self, CHAN_WEAPON, "freddie/sawstart.wav", 1, ATTN_NORM);}; +void() fred_bswing2 = [ $bswing2, fred_bswing3 ] {ai_faceforward(12);}; +void() fred_bswing3 = [ $bswing3, fred_bswing4 ] {ai_faceforward(4);}; +void() fred_bswing4 = [ $bswing4, fred_bswing5 ] {ai_faceforward(2);monster_footstep(FALSE);}; +void() fred_bswing5 = [ $bswing5, fred_bswing6 ] {ai_faceforward(6);fred_blade(200);}; +void() fred_bswing6 = [ $bswing6, fred_bswing7 ] {ai_faceforward(4);}; +void() fred_bswing7 = [ $bswing7, fred_bswing8 ] {ai_faceforward(4);}; +void() fred_bswing8 = [ $bswing8, fred_bswing9 ] {ai_faceforward(8);}; +void() fred_bswing9 = [ $bswing9, fred_bswing10 ] {ai_faceforward(8);monster_footstep(FALSE);}; +void() fred_bswing10 = [ $bswing10, fred_bswing11 ] {ai_faceforward(8);}; +void() fred_bswing11 = [ $bswing11, fred_bswing12 ] {ai_faceforward(8);}; +void() fred_bswing12 = [ $bswing12, fred_bswing13 ] {ai_faceforward(12);}; +void() fred_bswing13 = [ $bswing13, fred_bswing14 ] {ai_faceforward(10);}; +void() fred_bswing14 = [ $bswing14, fred_run ] {ai_faceforward(10);}; + +// Start of melee attack +//---------------------------------------------------------------------- +void() fred_fswing1 = [ $fswing1, fred_fswing2 ] {ai_faceforward(8); + sound (self, CHAN_WEAPON, "freddie/sawstart.wav", 1, ATTN_NORM);}; +void() fred_fswing2 = [ $fswing2, fred_fswing3 ] {ai_faceforward(16); monster_footstep(FALSE);}; +void() fred_fswing3 = [ $fswing3, fred_fswing4 ] {ai_faceforward(10); + self.nextthink = time + 0.09;}; +void() fred_fswing4 = [ $fswing4, fred_fswing5 ] {ai_faceforward(4); + self.nextthink = time + 0.08; monster_footstep(FALSE);}; +void() fred_fswing5 = [ $fswing5, fred_fswing6 ] {ai_faceforward(2); + self.nextthink = time + 0.07;}; +void() fred_fswing6 = [ $fswing6, fred_fswing7 ] {ai_faceforward(1); + self.nextthink = time + 0.07;}; +void() fred_fswing7 = [ $fswing7, fred_fswing8 ] {ai_faceforward(1); + self.nextthink = time + 0.06;}; +void() fred_fswing8 = [ $fswing8, fred_fswing9 ] {ai_faceforward(2);fred_blade(-200); + self.nextthink = time + 0.05;}; +void() fred_fswing9 = [ $fswing9, fred_fswing10 ] {ai_faceforward(2);}; +void() fred_fswing10 = [ $fswing10, fred_fswing11 ] {ai_faceforward(2);}; +void() fred_fswing11 = [ $fswing11, fred_fswinge1 ] { + // Always check for enemy and health before changing think + if (self.enemy && self.enemy.health > 1 && self.health > 0) { + // Check if within range to do a second (back) swing attack + if (ai_checkmelee(self.meleerange)) self.think = fred_bswing1; + } +}; + +// End of melee attack +//---------------------------------------------------------------------- +void() fred_fswinge1 = [ $fswinge1, fred_fswinge2 ] {ai_faceforward(2);}; +void() fred_fswinge2 = [ $fswinge2, fred_fswinge3 ] {ai_faceforward(2);}; +void() fred_fswinge3 = [ $fswinge3, fred_fswinge4 ] {ai_faceforward(3);}; +void() fred_fswinge4 = [ $fswinge4, fred_fswinge5 ] {ai_faceforward(4);}; +void() fred_fswinge5 = [ $fswinge5, fred_fswinge6 ] {ai_faceforward(8);}; +void() fred_fswinge6 = [ $fswinge6, fred_fswinge7 ] {ai_faceforward(12);}; +void() fred_fswinge7 = [ $fswinge7, fred_fswinge8 ] {ai_faceforward(16);}; +void() fred_fswinge8 = [ $fswinge8, fred_fswinge9 ] {ai_faceforward(12);}; +void() fred_fswinge9 = [ $fswinge9, fred_fswinge10 ] {ai_faceforward(16);}; +void() fred_fswinge10 = [ $fswinge10, fred_run ] { + ai_faceforward(16);monster_footstep(FALSE);}; + +//============================================================================ +void() fred_pain1 = [ $pain1, fred_pain2 ] {}; +void() fred_pain2 = [ $pain2, fred_pain3 ] {ai_pain(10);}; +void() fred_pain3 = [ $pain3, fred_pain4 ] {ai_pain(9);}; +void() fred_pain4 = [ $pain4, fred_pain5 ] {ai_pain(4);}; +void() fred_pain5 = [ $pain5, fred_pain6 ] {}; +void() fred_pain6 = [ $pain6, fred_pain7 ] {}; +void() fred_pain7 = [ $pain7, fred_pain8 ] {}; +void() fred_pain8 = [ $pain8, fred_pain9 ] {}; +void() fred_pain9 = [ $pain9, fred_pain10 ] {}; +void() fred_pain10 = [ $pain10, fred_pain11 ] {}; +void() fred_pain11 = [ $pain11, fred_pain12 ] {}; +void() fred_pain12 = [ $pain12, fred_run ] {}; + +//---------------------------------------------------------------------- +void() fred_painb1 = [ $painb1, fred_painb2 ] {}; +void() fred_painb2 = [ $painb2, fred_painb3 ] {}; +void() fred_painb3 = [ $painb3, fred_painb4 ] {}; +void() fred_painb4 = [ $painb4, fred_painb5 ] {}; +void() fred_painb5 = [ $painb5, fred_run ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) fred_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.2) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_finished = time + 3 + random()*2; + fred_pain1(); + } + else { + sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.pain_finished = time + 2 + random()*2; + fred_painb1(); + } + } +}; + +//============================================================================ +void() fred_death1 = [ $death1, fred_death2 ] {}; +void() fred_death2 = [ $death2, fred_death3 ] {monster_check_gib();}; +void() fred_death3 = [ $death3, fred_death4 ] {monster_check_gib(); +self.solid = SOLID_NOT;}; +void() fred_death4 = [ $death4, fred_death5 ] {}; +void() fred_death5 = [ $death5, fred_death6 ] {}; +void() fred_death6 = [ $death6, fred_death7 ] {}; +void() fred_death7 = [ $death7, fred_death8 ] {}; +void() fred_death8 = [ $death8, fred_death9 ] {}; +void() fred_death9 = [ $death9, fred_death10 ] {}; +void() fred_death10 = [ $death10, fred_death11 ] {}; +void() fred_death11 = [ $death11, fred_death12 ] {}; +void() fred_death12 = [ $death12, fred_death13 ] {}; +void() fred_death13 = [ $death13, fred_death14 ] {}; +void() fred_death14 = [ $death14, fred_death15 ] {}; +void() fred_death15 = [ $death15, fred_death16 ] {}; +void() fred_death16 = [ $death16, fred_death17 ] {}; +void() fred_death17 = [ $death17, fred_death18 ] {}; +void() fred_death18 = [ $death18, fred_death19 ] {}; +void() fred_death19 = [ $death19, fred_death20 ] {}; +void() fred_death20 = [ $death20, fred_death21 ] {}; +void() fred_death21 = [ $death21, fred_death22 ] {}; +void() fred_death22 = [ $death22, fred_death23 ] {}; +void() fred_death23 = [ $death23, fred_death24 ] {}; +void() fred_death24 = [ $death24, fred_death25 ] {}; +void() fred_death25 = [ $death25, fred_death26 ] {}; +void() fred_death26 = [ $death26, fred_death27 ] {}; +void() fred_death27 = [ $death27, fred_death28 ] {}; +void() fred_death28 = [ $death28, fred_death29 ] {}; +void() fred_death29 = [ $death29, fred_death30 ] {}; +void() fred_death30 = [ $death30, fred_death31 ] {}; +void() fred_death31 = [ $death31, fred_death32 ] {}; +void() fred_death32 = [ $death32, fred_death33 ] {}; +void() fred_death33 = [ $death33, fred_death34 ] {}; +void() fred_death34 = [ $death34, fred_death35 ] {monster_death_postcheck();}; +void() fred_death35 = [ $death35, fred_death35 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() fred_explode = +{ + // no more FREDDIE! + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // ID style explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Sprite + Dust + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + + // Regular blood like gibs + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + ThrowGib(25, 1); + // Metal and custom body parts + self.gibtype = GIBTYPE_METAL; + ThrowGib(11, 1 + rint(random()*2)); + ThrowGib(12, 2 + rint(random()*2)); + ThrowGib(13, 2 + rint(random()*2)); +}; + +//---------------------------------------------------------------------- +void() fred_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "freddie/death.wav", 1, ATTN_NORM); + fred_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_freddie (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_freddie = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_freddie.mdl"; // was edie.mdl + self.headmdl = "progs/h_ogre.mdl"; // ID ogre + self.gib1mdl = "progs/ad171/gib_freddiejunk.mdl"; // wreckage.mdl + self.gib2mdl = "progs/ad171/gib_metal1.mdl"; // Breakable metal + self.gib3mdl = "progs/ad171/gib_metal3.mdl"; // Breakable metal + + precache_model (self.mdl); + precache_model (self.headmdl); // ID Ogre head + // Gib Junk - 0=Axle, 1=bolt, 2=chip, 3=wing + precache_model (self.gib1mdl); // Multiple chunks of junk + self.gib1frame = 3; // 4 frames choose from + precache_model (self.gib2mdl); // Generic metal1_2 + precache_model (self.gib3mdl); // Generic metal1_2 + + self.idle_sound = "freddie/idle1.wav"; + precache_sound (self.idle_sound); + + // Melee sounds, swing and impact + precache_sound("freddie/sawstart.wav"); + precache_sound("freddie/mangle.wav"); + + // Default attack - red glowing nails + precache_model (MODEL_PROJ_NGRED); + precache_sound("freddie/stfire.wav"); + + // Alternative attack - lasers!?! + if (self.spawnflags & MON_FREDDIE_LASER) { + precache_model (MODEL_PROJ_LASER); + precache_sound("seeker/range_laser.wav"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + } + + precache_sound ("freddie/death.wav"); + self.death_sound = "seeker/explode_major.wav"; + precache_sound (self.death_sound); + self.pain_sound = "freddie/pain.wav"; + self.pain_sound2 = "freddie/painshrt.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.sight_sound = "freddie/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 500; + self.gibhealth = -80; // Hard to gib + self.gibbed = FALSE; + self.pain_flinch = 200; // takes alot to pain + self.pain_longanim = FALSE; // cannot be chopped with shadow axe + if (!self.infightextra) self.infightextra = 2; // 2x infighting dmg + self.meleerange = MONAI_MELEEFREDDIE; // Blade range + if (self.death_dmg < 1) self.death_dmg = DAMAGE_FREDDIE; + self.pain_timeout = 2; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.attack_offset = '0 0 0'; // Run + Gun vector + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was exterminated by Freddie\n"; + + // Custom feet sounds (specific order) + self.stepc1 = "freddie/step.wav"; + self.stepc2 = "freddie/step2.wav"; + self.stepc3 = "freddie/step.wav"; + self.stepc4 = "freddie/step2.wav"; + self.stepc5 = "freddie/step3.wav"; + precache_sound (self.stepc1); + precache_sound (self.stepc2); + precache_sound (self.stepc5); + self.steptype = FS_TYPECUSTOM; + + self.th_checkattack = FreddieCheckAttack; + self.th_stand = fred_stand1; + self.th_walk = fred_walk1; + self.th_run = fred_run; + self.th_melee = fred_fswing1; // Blade arm + self.th_missile = fred_sfire1; // Spike/Laser bolts + self.th_charge = fred_sfire24; // End of barrel weapon + self.th_pain = fred_pain; + self.th_die = fred_die; + self.th_gibdie = fred_explode; + + self.hittype = HIT_METAL; + + self.classtype = CT_MONFREDDIE; + self.classgroup = CG_OGRE; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +// Re-direct all Quoth Edie requests to Freddie! +void() monster_edie = { monster_freddie(); } diff --git a/QC_other/QC_keep/mon_gargoyle.qc b/QC_other/QC_keep/mon_gargoyle.qc new file mode 100644 index 00000000..0d97a13d --- /dev/null +++ b/QC_other/QC_keep/mon_gargoyle.qc @@ -0,0 +1,583 @@ +/*============================================================================== +GARGOYLE / IMP (Hexen2 Model) +==============================================================================*/ +// Fall on back to ground +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +// Single attack routine, fling fireball +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 attack16 +$frame attack17 attack18 attack19 attack20 attack21 + +// Classic idle +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 +$frame fly9 fly10 fly11 fly12 fly13 fly14 fly15 fly16 +$frame fly17 fly18 fly19 fly20 + +// Special minion grow animation +// Removed excessive frames (0.05 timing) +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +// Move from perch to flying (can be reversed) +$frame flyup1 flyup2 flyup3 flyup4 flyup5 flyup6 flyup7 flyup8 +$frame flyup9 flyup10 flyup11 flyup12 flyup13 flyup14 flyup15 flyup16 +$frame flyup17 flyup18 flyup19 flyup20 flyup21 flyup22 flyup23 + +// Idle animation for perching (sitting down) +$frame perch1 perch2 perch3 perch4 perch5 perch6 perch7 perch8 +$frame perch9 perch10 perch11 perch12 perch13 perch14 perch15 perch16 +$frame perch17 perch18 perch19 perch20 perch21 perch22 perch23 perch24 + +// Going into a nosedive +$frame swoop1 swoop2 swoop3 swoop4 swoop5 swoop6 swoop7 swoop8 +$frame swoop9 swoop10 swoop11 swoop12 swoop13 swoop14 swoop15 swoop16 +$frame swoop17 swoop18 swoop19 swoop20 + +// Swooshing through the air! +$frame swooploop1 swooploop2 swooploop3 swooploop4 + +// Nose up, back to fly idling +$frame swoopend1 swoopend2 swoopend3 swoopend4 swoopend5 swoopend6 swoopend7 swoopend8 +$frame swoopend9 swoopend10 swoopend11 swoopend12 swoopend13 swoopend14 swoopend15 + +// Alternative to stop swooping +$frame swoopout1 swoopout2 swoopout3 swoopout4 swoopout5 swoopout6 swoopout7 swoopout8 +$frame swoopout9 swoopout10 swoopout11 swoopout12 swoopout13 swoopout14 swoopout15 + +void() gargoylewings = +{ sound(self, CHAN_ITEM, "gargoyle/wings1.wav", 1, ATTN_IDLE); }; +void() garg_fbfinish; + +//====================================================================== +void() garg_idle1 =[ $fly2, garg_idle2 ] {monster_idle_sound();ai_stand();}; +void() garg_idle2 =[ $fly4, garg_idle3 ] {ai_stand();}; +void() garg_idle3 =[ $fly6, garg_idle4 ] {gargoylewings();ai_stand();}; +void() garg_idle4 =[ $fly8, garg_idle5 ] {ai_stand();}; +void() garg_idle5 =[ $fly10, garg_idle6 ] {ai_stand();}; +void() garg_idle6 =[ $fly12, garg_idle7 ] {ai_stand();}; +void() garg_idle7 =[ $fly14, garg_idle8 ] {ai_stand();}; +void() garg_idle8 =[ $fly16, garg_idle9 ] {ai_stand();}; +void() garg_idle9 =[ $fly18, garg_idle10 ] {ai_stand();}; +void() garg_idle10 =[ $fly20, garg_idle1 ] {ai_stand();}; + +//====================================================================== +void() garg_walk1 =[ $fly1, garg_walk2 ] {monster_idle_sound();ai_walk(8);}; +void() garg_walk2 =[ $fly3, garg_walk3 ] {ai_walk(8);}; +void() garg_walk3 =[ $fly5, garg_walk4 ] {gargoylewings();ai_walk(8);}; +void() garg_walk4 =[ $fly7, garg_walk5 ] {ai_walk(8);}; +void() garg_walk5 =[ $fly9, garg_walk6 ] {ai_walk(8);}; +void() garg_walk6 =[ $fly11, garg_walk7 ] {ai_walk(8);}; +void() garg_walk7 =[ $fly13, garg_walk8 ] {ai_walk(8);}; +void() garg_walk8 =[ $fly15, garg_walk9 ] {ai_walk(8);}; +void() garg_walk9 =[ $fly17, garg_walk10 ] {ai_walk(8);}; +void() garg_walk10 =[ $fly19, garg_walk1 ] {ai_walk(8);}; + +//====================================================================== +void() garg_run1 =[ $fly1, garg_run2 ] {monster_idle_sound(); + if (self.attachment && self.attachment.state == STATE_ON) garg_fbfinish(); + // Switch direction of strafing (random duration) + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(4); +}; +void() garg_run2 =[ $fly3, garg_run3 ] {ai_run(5);}; +void() garg_run3 =[ $fly5, garg_run4 ] {gargoylewings(); ai_run(6);}; +void() garg_run4 =[ $fly7, garg_run5 ] {ai_run(7);}; +void() garg_run5 =[ $fly9, garg_run6 ] {ai_run(8);}; +void() garg_run6 =[ $fly11, garg_run7 ] {ai_run(4);}; +void() garg_run7 =[ $fly13, garg_run8 ] {ai_run(5);}; +void() garg_run8 =[ $fly15, garg_run9 ] {ai_run(6);}; +void() garg_run9 =[ $fly17, garg_run10 ] {ai_run(7);}; +void() garg_run10 =[ $fly19, garg_run1 ] {ai_run(8);}; + +//============================================================================ +// Range attack +//============================================================================ +void() garg_fbthrow = +{ + local vector org, dir; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(SUB_orgEnemyTarget() - org); + self.attack_speed = SPEED_GARGMISSILE + (skill * SPEED_GARGSKILL); + + Launch_Missile (org, dir, '0 0 0', CT_PROJ_GARG, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() garg_fbfinish = +{ + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void(float fbframe, vector fbofs) garg_fbupdate = +{ + if (self.health < 1) return; + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_GARGBALL; + self.attachment.alpha = 0.85; + } + + if (fbframe == 0) { + self.attachment.state = STATE_ON; + self.pain_finished = time + 1.5; //don't go into pain whilst firing + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + sound (self, CHAN_WEAPON, "gargoyle/attack1.wav", 1, ATTN_NORM); + } + + ai_face(); // Turn towards enemy + makevectors(self.angles); + self.attachment.origin = self.origin + v_forward*fbofs_x + v_right*fbofs_y; + self.attachment.origin_z = self.attachment.origin_z + fbofs_z; + setorigin(self.attachment, self.attachment.origin); + self.attachment.angles = self.angles; + self.attachment.frame = fbframe; +}; + +//---------------------------------------------------------------------- +// Original offset position for gargoyle fireball (designed for a sprite) +// 10 16 0, 4 24 2, -7 28 15, -25 26 28, -38 12 45, -38 9 45, -17 36 30, 24 16 10 +// Changed the offset to match the new model instead +// Positioned the fireball to match the hand orientation +//---------------------------------------------------------------------- +void() garg_fire1 =[ $attack2, garg_fire2 ] {garg_fbupdate(0,'10 16 -2');}; +void() garg_fire2 =[ $attack4, garg_fire3 ] {garg_fbupdate(2,'0 20 -2');}; +void() garg_fire3 =[ $attack6, garg_fire4 ] {garg_fbupdate(3,'-6 23 6');gargoylewings();}; +void() garg_fire4 =[ $attack8, garg_fire5 ] {garg_fbupdate(4,'-16 26 18');}; +void() garg_fire5 =[ $attack10, garg_fire6 ] {garg_fbupdate(5,'-29 18 38');}; +void() garg_fire6 =[ $attack12, garg_fire7 ] {garg_fbupdate(4,'-34 9 45');}; +void() garg_fire7 =[ $attack14, garg_fire8 ] {garg_fbupdate(3,'-32 22 38');}; +void() garg_fire8 =[ $attack16, garg_fire9 ] {garg_fbfinish();garg_fbthrow();}; +void() garg_fire9 =[ $attack18, garg_fire10 ] {ai_face();monster_idle_sound();}; +void() garg_fire10 =[ $attack20, garg_run1 ] {ai_face(); + // If enemy really close, goto into a frenzy of fireball attacks + self.enemydist = range_distance(SUB_entEnemyTarget(), FALSE); + if (SUB_healthEnemyTarget() > 0 && self.enemydist < MON_RANGE_CLOSE) self.think = garg_fire1; + else self.attack_state = AS_STRAIGHT; +}; + +//============================================================================ +// PERCH + WAKEUP +//============================================================================ +void() garg_perch1 =[ $perch2, garg_perch2 ] {monster_idle_sound();ai_stand();}; +void() garg_perch2 =[ $perch4, garg_perch3 ] {ai_stand();}; +void() garg_perch3 =[ $perch6, garg_perch4 ] {ai_stand();}; +void() garg_perch4 =[ $perch8, garg_perch5 ] {ai_stand();}; +void() garg_perch5 =[ $perch10, garg_perch6 ] {ai_stand();}; +void() garg_perch6 =[ $perch12, garg_perch7 ] {ai_stand();}; +void() garg_perch7 =[ $perch14, garg_perch8 ] {ai_stand();}; +void() garg_perch8 =[ $perch16, garg_perch9 ] {ai_stand();}; +void() garg_perch9 =[ $perch18, garg_perch10 ] {ai_stand();}; +void() garg_perch10=[ $perch20, garg_perch11 ] {ai_stand();}; +void() garg_perch11=[ $perch22, garg_perch12 ] {ai_stand();}; +void() garg_perch12=[ $perch24, garg_perch1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +// Sightsound and very quick animation while moving forward +void() garg_wakeup1 =[ $flyup2, garg_wakeup2 ] {}; +void() garg_wakeup2 =[ $flyup4, garg_wakeup3 ] {ai_forward(4);}; +void() garg_wakeup3 =[ $flyup6, garg_wakeup4 ] {ai_forward(8);}; +void() garg_wakeup4 =[ $flyup14, garg_wakeup5 ] {ai_forward(8);gargoylewings();}; +void() garg_wakeup5 =[ $flyup16, garg_wakeup6 ] {ai_forward(4);}; +void() garg_wakeup6 =[ $flyup20, garg_run1 ] { + self.spawnstatue = FALSE; // No longer stationary + self.th_stand = garg_idle1; // Restore all think state functions + self.th_walk = garg_walk1; + self.th_run = garg_run1; + self.th_missile = garg_fire1; + monster_targets(); // Find target (angry/path_corner) + self.nextthink = time + 0.1;// Next frame +}; + +//---------------------------------------------------------------------- +void() gargoyle_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + self.takedamage = DAMAGE_AIM; // Can receive damage + self.use = SUB_Null; // no re-trigger + + // Only call wakeup function once + self.th_walk = self.th_run = SUB_Null; + + // No longer need statue spawnflag, remove it + if (self.spawnflags & MON_STATUE) + self.spawnflags = self.spawnflags - MON_STATUE; + + // No longer need perch spawnflag, remove it + if (self.spawnflags & MON_GARGOYLE_PERCH) + self.spawnflags = self.spawnflags - MON_GARGOYLE_PERCH; + + // Allow gargoyle to fly up, no more ground checks + if (!(self.flags & FL_FLY)) self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_STEP; + // self.movetype = MOVETYPE_FLY; // Original setup + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + garg_wakeup1(); +}; + +//---------------------------------------------------------------------- +void() gargoyle_statue = +{ + if (random() < MON_IDLE_SOUND) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + + self.think = gargoyle_statue; + self.nextthink = time + 5 + random()*5; +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() gargoyle_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() gargoyle_grow1 = [ $grow1, gargoyle_grow2 ] {}; +void() gargoyle_grow2 = [ $grow2, gargoyle_grow3 ] {gargoyle_growangle();}; +void() gargoyle_grow3 = [ $grow3, gargoyle_grow4 ] {gargoyle_growangle();}; +void() gargoyle_grow4 = [ $grow4, gargoyle_grow5 ] {gargoyle_growangle();}; +void() gargoyle_grow5 = [ $grow5, gargoyle_grow6 ] {gargoyle_growangle();}; +void() gargoyle_grow6 = [ $grow6, gargoyle_grow7 ] {gargoyle_growangle();}; +void() gargoyle_grow7 = [ $grow7, gargoyle_grow8 ] {gargoyle_growangle();}; +void() gargoyle_grow8 = [ $grow8, gargoyle_grow9 ] {gargoyle_growangle();}; +void() gargoyle_grow9 = [ $grow9, gargoyle_grow10] {gargoyle_growangle();}; +void() gargoyle_grow10= [ $grow10, garg_run1 ] { + // Is the gargoyle stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = garg_idle1; + self.th_walk = garg_walk1; + self.th_run = garg_run1; + self.th_missile = garg_fire1; + } +}; +//---------------------------------------------------------------------------- +void() gargoyle_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + gargoyle_grow1(); +}; + +//============================================================================ +// The gargoyle does not have a specific pain animation +// - Kinn created one from the death animation (Marcher progs) +void() garg_pain1 =[ $death3, garg_pain2 ] {}; +void() garg_pain2 =[ $death4, garg_pain3 ] {}; +void() garg_pain3 =[ $death3, garg_pain4 ] {}; +void() garg_pain4 =[ $death2, garg_pain5 ] {}; +void() garg_pain5 =[ $death1, garg_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) garg_pain = +{ + // Check for perching gargoyles, need special wakeup + if (self.spawnflags & MON_GARGOYLE_PERCH) gargoyle_wakeup(); + // Statues don't feel pain! + else if (self.spawnflags & MON_STATUE) return; + else { + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // make sure any fireball is hidden + if (self.attachment) garg_fbfinish(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + garg_pain1 (); + } + } + } +}; + +//============================================================================ +void() garg_death1 =[ $death1, garg_death2 ] {}; +void() garg_death2 =[ $death3, garg_death3 ] {monster_check_gib();}; +void() garg_death3 =[ $death5, garg_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() garg_death4 =[ $death7, garg_death5 ] {}; +void() garg_death5 =[ $death9, garg_death6 ] {}; +void() garg_death6 =[ $death11, garg_death7 ] {}; +void() garg_death7 =[ $death13, garg_death8 ] {monster_death_postcheck();}; +void() garg_death8 =[ $death14, garg_death8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() garg_die = +{ + // Statues don't die! + if (self.spawnflags & MON_STATUE) return; + + // Make sure any wings sound is silenced + sound (self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_NORM); + + // Check for perching gargoyles, need to blow up in gibs + // In an awkward pose that does not go well into death animations + if (self.spawnflags & MON_GARGOYLE_PERCH) self.gibondeath = TRUE; + + // If creating a Fireball, make it explode! + if (self.attachment) { + if (self.attachment.state == STATE_ON) { + self.gibondeath = TRUE; + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + particle_explode(self.origin-'0 0 16', 50+random()*50, 2, PARTICLE_BURST_FIRE, PARTICLE_BURST_UPWARD); + makevectors(self.angles); + self.oldorigin = self.origin + v_forward*8; + SpawnExplosion(EXPLODE_BIG, self.oldorigin, SOUND_REXP3); + } + // make sure any fireball is hidden + garg_fbfinish(); + } + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // If not gibbed, then drop to ground + if (!self.gibbed) { + sound (self, CHAN_VOICE, "gargoyle/death1.wav", 1, ATTN_NORM); + self.flags = FL_MONSTER; // reset all flag conditions + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + garg_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_gargoyle (0.8 0 0.2) (-16 -16 -24) (16 16 40) AMBUSH STATUE PERCH NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/ad171/mon_gargoyle.mdl"); } +Gargoyle, 120 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +STATUE : Stone statue until triggered (always starts in a perched position) +PERCH : Start in a sitting down, place 44 units out from perching edge, 4 units higher + +======================================================================*/ +void() setup_gargoyle; +void() monster_gargoyle = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_gargoyle.mdl"; + if (self.classtype == CT_MONGARGOYLE_MINI) + self.mdl = "progs/mon_impling.mdl"; + + self.headmdl = "progs/ad171/h_gargoyle.mdl"; + self.gib1mdl = "progs/ad171/gib_gargwing1.mdl"; // Left wing + self.gib2mdl = "progs/ad171/gib_gargwing2.mdl"; // Right wing + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GARGBALL); // FB growing 8 frames + precache_model (MODEL_PROJ_GARGOYLE); // red/smoke wiz projectile + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + + self.idle_sound = "gargoyle/idle1.wav"; + self.idle_soundcom = "gargoyle/perch1.wav"; + self.idle_soundcom2 = "gargoyle/perch2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + precache_sound ("gargoyle/attack1.wav"); // Doom imp fireball! + precache_sound ("gargoyle/swoop1.wav"); + precache_sound ("gargoyle/swoop2.wav"); + precache_sound ("gargoyle/swoop1hit.wav"); + precache_sound ("gargoyle/wings1.wav"); + + self.pain_sound = "gargoyle/pain75.wav"; + self.pain_sound2 = "gargoyle/pain100.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("gargoyle/death1.wav"); + + self.sight_sound = "gargoyle/sight1.wav"; + precache_sound (self.sight_sound); + + // Cache gargoyle is a special class used for precache only + if (self.classtype != CT_CACHEGARGOYLE) setup_gargoyle(); +}; + +//---------------------------------------------------------------------------- +void() monster_minotaurminion = { + self.classtype = CT_CACHEGARGOYLE; + monster_gargoyle(); +}; + +void() monster_imp = { +if (self.deathstring == "") self.deathstring = " was incinerated by an Imp\n"; +monster_gargoyle(); +}; + +void() monster_impling = { + self.classtype = CT_MONGARGOYLE_MINI; + if (self.deathstring == "") self.deathstring = " was incinerated by an Impling\n"; + monster_gargoyle(); +}; + +//---------------------------------------------------------------------------- +void() setup_gargoyle = +{ + // Randomize gib parts + if (random() < 0.5) self.gib1mdl = string_null; + else if (random() < 0.5) self.gib2mdl = string_null; + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.classtype == CT_MONGARGOYLE_MINI) { + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; // Tiny imp + if (self.health < 1) self.health = 80; + } else { + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; // Normal gargoyle + if (self.health < 1) self.health = 120; + } + self.gibhealth = -70; // Need a powerful weapon to GIB + self.gibbed = FALSE; // no falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + self.attack_offset = '16 28 22'; // fireball start location + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was burned by a Gargoyle\n"; + + self.th_checkattack = GargoyleCheckAttack; + self.th_pain = garg_pain; + self.th_die = garg_die; + + if(!self.classtype) self.classtype = CT_MONGARGOYLE; + if (!self.classgroup) self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + // Fix double spawnflags problem - default to statue + if (self.spawnflags & MON_STATUE && self.spawnflags & MON_GARGOYLE_PERCH) { + dprint("\b[GARGOYLE]\b Cannot be perch and statue!\n"); + self.spawnflags = self.spawnflags - MON_GARGOYLE_PERCH; + } + + //---------------------------------------------------------------------- + // Perched Gargoyles have special idle animation + idle sounds + // The AI needs to be setup 40 units forward and 24 units up + // to be positioned feet flat on perch surface + if (self.spawnflags & MON_GARGOYLE_PERCH) { + self.th_stand = self.th_walk = garg_perch1; + self.th_run = self.th_missile = gargoyle_wakeup; + } + //---------------------------------------------------------------------- + // Statue Gargoyles setup in perch position with statue idle sounds + // Randomly picks a frame position from perch animation set + else if (self.spawnflags & MON_STATUE) { + // Setup stone idle sounds + self.idle_sound = "statue/idle1.wav"; + self.idle_sound2 = "statue/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = gargoyle_statue; // Stone idle pose + self.think1 = gargoyle_wakeup; // Wakeup statue angry at player + self.skin = 1; // Stone like skin + self.gib1skin = self.gib2skin = 1; + //self.resist_nails = 0.5; // Stone resistance + // Work out random starting pose + self.pos1_x = $perch1; + self.pos1_y = $perch24; + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = rint(self.pos1_x + random() * self.pos1_z); + } + //---------------------------------------------------------------------- + // Special spawning minion need to start spinning + else if (self.classtype == CT_MINIONGARGOYLE) { + self.th_stand = self.th_walk = self.th_run = gargoyle_grow; + self.th_missile = SUB_Null; + } + //---------------------------------------------------------------------- + // Default gargoyle setup + else { + self.th_stand = garg_idle1; + self.th_walk = garg_walk1; + self.th_run = garg_run1; + self.th_missile = garg_fire1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn gargoyles (requires monster_minotaurminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_gargoyle = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + // Self = minotaur, there is no egg + update_minioncount(self, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_gargoyle"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self; // Spawner Parent Link + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONGARGOYLE; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = 0; + minion.classgroup = CG_DEMON; // Don't turn on master + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + // Adopt parameters from host spawner + minion.infightextra = self.infightextra; + + minion.mdl = "progs/ad171/mon_gargoyle.mdl"; + minion.headmdl = "progs/ad171/h_gargoyle.mdl"; + minion.gib1mdl = "progs/ad171/gib_gargwing1.mdl"; // Left wing + minion.gib2mdl = "progs/ad171/gib_gargwing2.mdl"; // Right wing + + minion.pain_sound = "gargoyle/pain75.wav"; + minion.pain_sound2 = "gargoyle/pain100.wav"; + minion.idle_sound = "gargoyle/idle1.wav"; + minion.idle_soundcom = "gargoyle/perch1.wav"; + minion.idle_soundcom2 = "gargoyle/perch2.wav"; + minion.sight_sound = "gargoyle/sight1.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_gargoyle; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_gaunt.qc b/QC_other/QC_keep/mon_gaunt.qc new file mode 100644 index 00000000..c53bebd3 --- /dev/null +++ b/QC_other/QC_keep/mon_gaunt.qc @@ -0,0 +1,440 @@ +/*============================================================================== + GAUNT (Originally from Quoth - Kell/Necros/Preach) + - Big thank you to necros for the code base for this monster +==============================================================================*/ + +// (000) Perched on a ledge (idling) +$frame perch1 perch2 perch3 perch4 perch5 perch6 perch7 perch8 +$frame perch9 perch10 perch11 perch12 perch13 perch14 perch15 perch16 + +// (016) Lift off from perch position +$frame launch1 launch2 launch3 launch4 launch5 launch6 launch7 launch8 + +// (024) Idling in mid air +$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 +$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 hover16 +$frame hover17 hover18 hover19 hover20 + +// (044) range attack (lightning/plasma) +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 attack16 +$frame attack17 attack18 attack19 attack20 + +// (064) Start of dive attack +$frame swoopStart1 swoopStart2 swoopStart3 swoopStart4 +$frame swoopStart5 swoopStart6 swoopStart7 swoopStart8 + +// (072) Looped version of dive attack +$frame swoop1 swoop2 swoop3 swoop4 swoop5 + +// (077) Something, not sure what +$frame drop1 drop2 drop3 drop4 drop5 + +// (082) Swing wing around infront +$frame painA1 painA2 painA3 painA4 painA5 painA6 + +// (088) Knock head backward +$frame painB1 painB2 painB3 painB4 painB5 + +// (093) Fall backwards +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 + +// (101) Fall forward +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 + +void() gauntwings = +{ sound(self, CHAN_ITEM, "gaunt/wings1.wav", 1, ATTN_IDLE); }; +void() gaunt_elecfinish; + +//============================================================================ +void() gaunt_idle1 = [ $hover1, gaunt_idle2 ] {monster_idle_sound();ai_stand();}; +void() gaunt_idle2 = [ $hover2, gaunt_idle3 ] {ai_stand();}; +void() gaunt_idle3 = [ $hover3, gaunt_idle4 ] {ai_stand();}; +void() gaunt_idle4 = [ $hover4, gaunt_idle5 ] {ai_stand();}; +void() gaunt_idle5 = [ $hover5, gaunt_idle6 ] {gauntwings();ai_stand();}; +void() gaunt_idle6 = [ $hover6, gaunt_idle7 ] {ai_stand();}; +void() gaunt_idle7 = [ $hover7, gaunt_idle8 ] {ai_stand();}; +void() gaunt_idle8 = [ $hover8, gaunt_idle9 ] {ai_stand();}; +void() gaunt_idle9 = [ $hover9, gaunt_idle10 ] {ai_stand();}; +void() gaunt_idle10 = [ $hover10, gaunt_idle11 ] {ai_stand();}; +void() gaunt_idle11 = [ $hover11, gaunt_idle12 ] {ai_stand();}; +void() gaunt_idle12 = [ $hover12, gaunt_idle13 ] {ai_stand();}; +void() gaunt_idle13 = [ $hover13, gaunt_idle14 ] {ai_stand();}; +void() gaunt_idle14 = [ $hover14, gaunt_idle15 ] {ai_stand();}; +void() gaunt_idle15 = [ $hover15, gaunt_idle16 ] {gauntwings();ai_stand();}; +void() gaunt_idle16 = [ $hover16, gaunt_idle17 ] {ai_stand();}; +void() gaunt_idle17 = [ $hover17, gaunt_idle18 ] {ai_stand();}; +void() gaunt_idle18 = [ $hover18, gaunt_idle19 ] {ai_stand();}; +void() gaunt_idle19 = [ $hover19, gaunt_idle20 ] {ai_stand();}; +void() gaunt_idle20 = [ $hover20, gaunt_idle1 ] {ai_stand();}; + +//============================================================================ +void() gaunt_walk1 = [ $hover1, gaunt_walk2 ] {monster_idle_sound();ai_walk(8);}; +void() gaunt_walk2 = [ $hover2, gaunt_walk3 ] {ai_walk(8);}; +void() gaunt_walk3 = [ $hover3, gaunt_walk4 ] {gauntwings();ai_walk(8);}; +void() gaunt_walk4 = [ $hover4, gaunt_walk5 ] {ai_walk(8);}; +void() gaunt_walk5 = [ $hover5, gaunt_walk6 ] {ai_walk(8);}; +void() gaunt_walk6 = [ $hover6, gaunt_walk7 ] {ai_walk(8);}; +void() gaunt_walk7 = [ $hover7, gaunt_walk8 ] {ai_walk(8);}; +void() gaunt_walk8 = [ $hover8, gaunt_walk9 ] {ai_walk(8);}; +void() gaunt_walk9 = [ $hover9, gaunt_walk10 ] {ai_walk(8);}; +void() gaunt_walk10 = [ $hover10, gaunt_walk11 ] {ai_walk(8);}; +void() gaunt_walk11 = [ $hover11, gaunt_walk12 ] {ai_walk(8);}; +void() gaunt_walk12 = [ $hover12, gaunt_walk13 ] {ai_walk(8);}; +void() gaunt_walk13 = [ $hover13, gaunt_walk14 ] {ai_walk(8);}; +void() gaunt_walk14 = [ $hover14, gaunt_walk15 ] {ai_walk(8);}; +void() gaunt_walk15 = [ $hover15, gaunt_walk16 ] {gauntwings();ai_walk(8);}; +void() gaunt_walk16 = [ $hover16, gaunt_walk17 ] {ai_walk(8);}; +void() gaunt_walk17 = [ $hover17, gaunt_walk18 ] {ai_walk(8);}; +void() gaunt_walk18 = [ $hover18, gaunt_walk19 ] {ai_walk(8);}; +void() gaunt_walk19 = [ $hover19, gaunt_walk20 ] {ai_walk(8);}; +void() gaunt_walk20 = [ $hover20, gaunt_walk1 ] {ai_walk(8);}; + +//============================================================================ +void() gaunt_run1 = [ $hover1, gaunt_run2 ] {monster_idle_sound(); + if (self.attachment && self.attachment.state == STATE_ON) gaunt_elecfinish(); + // Switch direction of strafing (random duration) + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(8); +}; +void() gaunt_run2 = [ $hover2, gaunt_run3 ] {ai_run(8);}; +void() gaunt_run3 = [ $hover3, gaunt_run4 ] {ai_run(8);}; +void() gaunt_run4 = [ $hover4, gaunt_run5 ] {ai_run(8);}; +void() gaunt_run5 = [ $hover5, gaunt_run6 ] {gauntwings();ai_run(8);}; +void() gaunt_run6 = [ $hover6, gaunt_run7 ] {ai_run(8);}; +void() gaunt_run7 = [ $hover7, gaunt_run8 ] {ai_run(8);}; +void() gaunt_run8 = [ $hover8, gaunt_run9 ] {ai_run(8);}; +void() gaunt_run9 = [ $hover9, gaunt_run10 ] {ai_run(8);}; +void() gaunt_run10 = [ $hover10, gaunt_run11 ] {ai_run(8);}; +void() gaunt_run11 = [ $hover11, gaunt_run12 ] {ai_run(8);}; +void() gaunt_run12 = [ $hover12, gaunt_run13 ] {ai_run(8);}; +void() gaunt_run13 = [ $hover13, gaunt_run14 ] {ai_run(8);}; +void() gaunt_run14 = [ $hover14, gaunt_run15 ] {ai_run(8);}; +void() gaunt_run15 = [ $hover15, gaunt_run16 ] {gauntwings();ai_run(8);}; +void() gaunt_run16 = [ $hover16, gaunt_run17 ] {ai_run(8);}; +void() gaunt_run17 = [ $hover17, gaunt_run18 ] {ai_run(8);}; +void() gaunt_run18 = [ $hover18, gaunt_run19 ] {ai_run(8);}; +void() gaunt_run19 = [ $hover19, gaunt_run20 ] {ai_run(8);}; +void() gaunt_run20 = [ $hover20, gaunt_run1 ] {ai_run(8);}; + +//============================================================================ +// RANGE - Plasma from arc infront +//============================================================================ +void() gaunt_plasma = +{ + local vector org, dir; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "gaunt/plasma_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(SUB_orgEnemyTarget() - self.origin); + self.attack_speed = SPEED_GAUNTBOLT + (skill * SPEED_GAUNTSKILL); + + launch_plasma(org, dir, CT_PROJ_PLASMA, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() gaunt_elecfinish = +{ + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void(float elecframe) gaunt_elecupdate = +{ + if (self.health < 1) return; + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = self.weaponglow; + } + + if (elecframe == 0) { + self.attachment.state = STATE_ON; + self.pain_finished = time + 1.2; //don't go into pain whilst firing + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + sound (self, CHAN_WEAPON, "gaunt/plasma_start.wav", 1, ATTN_NORM); + } + + ai_face(); // Turn towards enemy + makevectors(self.angles); + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = elecframe; +}; + +//---------------------------------------------------------------------- +void() gaunt_fire1 = [ $attack1, gaunt_fire2 ] {gaunt_elecupdate(0);}; +void() gaunt_fire2 = [ $attack2, gaunt_fire3 ] {gaunt_elecupdate(1);}; +void() gaunt_fire3 = [ $attack3, gaunt_fire4 ] {gaunt_elecupdate(2);}; +void() gaunt_fire4 = [ $attack4, gaunt_fire5 ] {gaunt_elecupdate(3);}; +void() gaunt_fire5 = [ $attack5, gaunt_fire6 ] {gaunt_elecupdate(4);gauntwings();}; +void() gaunt_fire6 = [ $attack6, gaunt_fire7 ] {gaunt_elecupdate(5);gaunt_plasma();}; +void() gaunt_fire7 = [ $attack7, gaunt_fire8 ] {gaunt_elecupdate(6);}; +void() gaunt_fire8 = [ $attack8, gaunt_fire9 ] {gaunt_elecupdate(7);gaunt_plasma();}; +void() gaunt_fire9 = [ $attack9, gaunt_fire10 ] {gaunt_elecupdate(8);}; +void() gaunt_fire10 = [ $attack10, gaunt_fire11 ] {ai_face(); + if (skill > SKILL_NORMAL) gaunt_plasma(); + gaunt_elecfinish();}; +void() gaunt_fire11 = [ $attack11, gaunt_fire12 ] {}; +void() gaunt_fire12 = [ $attack12, gaunt_fire13 ] {}; +void() gaunt_fire13 = [ $attack13, gaunt_fire14 ] {}; +void() gaunt_fire14 = [ $attack14, gaunt_fire15 ] {}; +void() gaunt_fire15 = [ $attack15, gaunt_fire16 ] {gauntwings();}; +void() gaunt_fire16 = [ $attack16, gaunt_fire17 ] {}; +void() gaunt_fire17 = [ $attack17, gaunt_fire18 ] {}; +void() gaunt_fire18 = [ $attack18, gaunt_fire19 ] {ai_face();}; +void() gaunt_fire19 = [ $attack19, gaunt_fire20 ] {ai_face();}; +void() gaunt_fire20 = [ $attack20, gaunt_run1 ] {}; + +//============================================================================ +// PERCH + WAKEUP +//============================================================================ +void() gaunt_perch1 = [ $perch1, gaunt_perch2 ] {monster_idle_sound();ai_stand();}; +void() gaunt_perch2 = [ $perch2, gaunt_perch3 ] {ai_stand();}; +void() gaunt_perch3 = [ $perch3, gaunt_perch4 ] {ai_stand();}; +void() gaunt_perch4 = [ $perch4, gaunt_perch5 ] {ai_stand();}; +void() gaunt_perch5 = [ $perch5, gaunt_perch6 ] {ai_stand();}; +void() gaunt_perch6 = [ $perch6, gaunt_perch7 ] {ai_stand();}; +void() gaunt_perch7 = [ $perch7, gaunt_perch8 ] {ai_stand();}; +void() gaunt_perch8 = [ $perch8, gaunt_perch9 ] {ai_stand();}; +void() gaunt_perch9 = [ $perch9, gaunt_perch10 ] {ai_stand();}; +void() gaunt_perch10 = [ $perch10, gaunt_perch11 ] {ai_stand();}; +void() gaunt_perch11 = [ $perch11, gaunt_perch12 ] {ai_stand();}; +void() gaunt_perch12 = [ $perch12, gaunt_perch13 ] {ai_stand();}; +void() gaunt_perch13 = [ $perch13, gaunt_perch14 ] {ai_stand();}; +void() gaunt_perch14 = [ $perch14, gaunt_perch15 ] {ai_stand();}; +void() gaunt_perch15 = [ $perch15, gaunt_perch16 ] {ai_stand();}; +void() gaunt_perch16 = [ $perch16, gaunt_perch1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +// Sightsound and very quick animation while moving forward +void() gaunt_wakeup1 = [ $launch1, gaunt_wakeup2 ] {monster_sightsound();}; +void() gaunt_wakeup2 = [ $launch2, gaunt_wakeup3 ] {ai_forward(4);}; +void() gaunt_wakeup3 = [ $launch3, gaunt_wakeup4 ] {ai_forward(4);}; +void() gaunt_wakeup4 = [ $launch4, gaunt_wakeup5 ] {ai_forward(4);}; +void() gaunt_wakeup5 = [ $launch5, gaunt_wakeup6 ] {ai_forward(4);}; +void() gaunt_wakeup6 = [ $launch6, gaunt_wakeup7 ] {gauntwings();ai_forward(4);}; +void() gaunt_wakeup7 = [ $launch7, gaunt_wakeup8 ] {ai_forward(4);}; +void() gaunt_wakeup8 = [ $launch8, gaunt_run1 ] { + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + self.spawnstatue = FALSE; // No longer stationary + self.th_stand = gaunt_idle1; // Restore all think state functions + self.th_walk = gaunt_walk1; + self.th_run = gaunt_run1; + self.th_missile = gaunt_fire1; +}; + +//---------------------------------------------------------------------- +void() gaunt_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + self.takedamage = DAMAGE_AIM; // Can receive damage + self.use = SUB_Null; // no re-trigger + + // Only call wakeup function once + self.th_walk = self.th_run = SUB_Null; + + // No longer need perch spawnflag, remove it + if (self.spawnflags & MON_GAUNT_PERCH) + self.spawnflags = self.spawnflags - MON_GAUNT_PERCH; + + // Allow gaunt to fly up, no more ground checks + if (!(self.flags & FL_FLY)) self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_FLY; + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + gaunt_wakeup1(); +}; + +//============================================================================ +// PAIN +//============================================================================ +// Long - Swing wing around infront +void() gaunt_painA1 =[ $painA1, gaunt_painA2 ] {}; +void() gaunt_painA2 =[ $painA2, gaunt_painA3 ] {}; +void() gaunt_painA3 =[ $painA3, gaunt_painA4 ] {}; +void() gaunt_painA4 =[ $painA4, gaunt_painA5 ] {}; +void() gaunt_painA5 =[ $painA5, gaunt_painA6 ] {}; +void() gaunt_painA6 =[ $painA6, gaunt_run1 ] {}; + +// Short - Knock head backward +void() gaunt_painB1 =[ $painB1, gaunt_painB2 ] {}; +void() gaunt_painB2 =[ $painB2, gaunt_painB3 ] {}; +void() gaunt_painB3 =[ $painB3, gaunt_painB4 ] {}; +void() gaunt_painB4 =[ $painB4, gaunt_painB5 ] {}; +void() gaunt_painB5 =[ $painB5, gaunt_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) gaunt_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // make sure any electricity is hidden + if (self.attachment) gaunt_elecfinish(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + if (self.lip < 0.4) gaunt_painB1(); // Long + else gaunt_painA1(); // Short + } + } +}; + +//============================================================================ +void() gaunt_deathA1 = [ $deathA1, gaunt_deathA2 ] {}; +void() gaunt_deathA2 = [ $deathA2, gaunt_deathA3 ] {monster_check_gib();}; +void() gaunt_deathA3 = [ $deathA3, gaunt_deathA4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() gaunt_deathA4 = [ $deathA4, gaunt_deathA5 ] {}; +void() gaunt_deathA5 = [ $deathA5, gaunt_deathA6 ] {}; +void() gaunt_deathA6 = [ $deathA6, gaunt_deathA7 ] {}; +void() gaunt_deathA7 = [ $deathA7, gaunt_deathA8 ] {monster_death_postcheck();}; +void() gaunt_deathA8 = [ $deathA8, gaunt_deathA8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() gaunt_deathB1 = [ $deathB1, gaunt_deathB2 ] {}; +void() gaunt_deathB2 = [ $deathB2, gaunt_deathB3 ] {monster_check_gib();}; +void() gaunt_deathB3 = [ $deathB3, gaunt_deathB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() gaunt_deathB4 = [ $deathB4, gaunt_deathB5 ] {}; +void() gaunt_deathB5 = [ $deathB5, gaunt_deathB6 ] {}; +void() gaunt_deathB6 = [ $deathB6, gaunt_deathB7 ] {}; +void() gaunt_deathB7 = [ $deathB7, gaunt_deathB8 ] {monster_death_postcheck();}; +void() gaunt_deathB8 = [ $deathB8, gaunt_deathB8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() gaunt_die = +{ + // Check for perching gaunt, need to blow up in gibs + // In an awkward pose that does not go well into death animations + if (self.spawnflags & MON_GAUNT_PERCH) self.gibondeath = TRUE; + + // Make sure any wings sound is silenced + sound (self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_NORM); + + // If casting electricity, make it explode! + if (self.attachment) { + if (self.attachment.state == STATE_ON) { + self.gibondeath = TRUE; + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + particle_explode(self.origin-'0 0 16', 50+random()*50, 2, PARTICLE_BURST_BLUE, PARTICLE_BURST_UPWARD); + makevectors(self.angles); + self.oldorigin = self.origin + v_forward*8; + SpawnExplosion(EXPLODE_PLASMA_BIG, self.oldorigin, SOUND_REXP3); + } + // make sure any electricity is hidden + gaunt_elecfinish(); + } + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "gaunt/death.wav", 1, ATTN_NORM); + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + if (random() < 0.5) gaunt_deathA1(); + else gaunt_deathB1(); + } +}; + +/*====================================================================== +QUAKED monster_gaunt (1 0.2 0) (-16 -16 -24) (16 16 24) +======================================================================*/ +void() monster_gaunt = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_gaunt.mdl"; + self.headmdl = "progs/ad171/h_gaunt.mdl"; + self.weaponglow = "progs/ad171/mon_gaunt_elec.mdl"; + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.weaponglow); // Lightning effect + precache_model (MODEL_PROJ_GAPLASMA); // Plasma spike/bolt + + self.idle_sound = "gaunt/idle1.wav"; + self.idle_sound2 = "gaunt/idle3.wav"; + self.idle_soundcom = "gaunt/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + precache_sound ("gaunt/wings1.wav"); + precache_sound ("gaunt/plasma_start.wav"); + precache_sound ("gaunt/plasma_fire.wav"); + + self.pain_sound = "gaunt/pain.wav"; + precache_sound (self.pain_sound); + precache_sound ("gaunt/death.wav"); + + self.sight_sound = "gaunt/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = -70; // Need a powerful weapon to GIB + self.gibbed = FALSE; // no falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.height = MONAI_ABOVEDIST; // Enemytarget distance above + self.attack_offset = '8 0 -4'; // Plasma start location + + self.th_checkattack = GauntCheckAttack; + self.th_pain = gaunt_pain; + self.th_die = gaunt_die; + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was blasted by a Gaunt\n"; + } else { + if (self.deathstring == "") self.deathstring = " was charred by a Gaunt\n"; + } + + //---------------------------------------------------------------------- + // Perched Gaunt have special idle animation + idle sounds + if (self.spawnflags & MON_GAUNT_PERCH) { + self.th_stand = self.th_walk = gaunt_perch1; + self.th_run = self.th_missile = gaunt_wakeup; + } + //---------------------------------------------------------------------- + // Default gaunt setup + else { + self.th_stand = gaunt_idle1; + self.th_walk = gaunt_walk1; + self.th_run = gaunt_run1; + self.th_missile = gaunt_fire1; + } + + if(!self.classtype) self.classtype = CT_MONGAUNT; + if (!self.classgroup) self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_golem.qc b/QC_other/QC_keep/mon_golem.qc new file mode 100644 index 00000000..3456b2a0 --- /dev/null +++ b/QC_other/QC_keep/mon_golem.qc @@ -0,0 +1,723 @@ +/*============================================================================== +GOLEM (From Ne_Ruins MOD) (Hexen2 Model) +==============================================================================*/ + +// (000) standing still with heavy breathing +$frame wait1 wait2 wait3 wait4 wait5 wait6 wait7 wait8 +$frame wait9 wait10 wait11 wait12 wait13 wait14 wait15 wait16 +$frame wait17 wait18 wait19 wait20 wait21 wait22 + +// (022) Transfer B +$frame tranB1 tranB2 tranB3 tranB4 tranB5 tranB6 tranB7 tranB8 +$frame tranB9 tranB10 tranB11 tranB12 tranB13 + +// (035) statue to walking +$frame birth1 birth2 birth3 birth4 birth5 birth6 birth7 birth8 +$frame birth9 birth10 birth11 birth12 birth13 birth14 birth15 birth16 + +// (051) Really slow walk +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 +$frame walk25 walk26 walk27 walk28 walk29 walk30 walk31 walk32 +$frame walk33 walk34 + +// (085) Running +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 +$frame run17 run18 run19 run20 run21 run22 run23 run24 + +// (109) Right Fist Punch +$frame punch1 punch2 punch3 punch4 punch5 punch6 punch7 punch8 +$frame punch9 punch10 punch11 punch12 punch13 punch14 punch15 punch16 +$frame punch17 punch18 punch19 punch20 punch21 punch22 punch23 punch24 + +// (133) Right Fist Pound ground +$frame pound1 pound2 pound3 pound4 pound5 pound6 pound7 pound8 +$frame pound9 pound10 pound11 pound12 pound13 pound14 pound15 pound16 +$frame pound17 pound18 pound19 pound20 pound21 pound22 pound23 pound24 + +// (157) Death Forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 + +// (179) Magic attack from torso +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 magic13 magic14 magic15 magic16 +$frame magic17 magic18 magic19 magic20 magic21 magic22 magic23 magic24 + +// (203) Stomp Foot on ground +$frame stomp1 stomp2 stomp3 stomp4 stomp5 stomp6 stomp7 stomp8 +$frame stomp9 stomp10 stomp11 stomp12 stomp13 stomp14 stomp15 stomp16 +$frame stomp17 stomp18 stomp19 stomp20 stomp21 stomp22 stomp23 stomp24 + +// (227) Rush forward and knock player away +$frame knock1 knock2 knock3 knock4 knock5 knock6 knock7 knock8 +$frame knock9 knock10 knock11 knock12 knock13 knock14 knock15 knock16 +$frame knock17 knock18 knock19 knock20 knock21 knock22 knock23 knock24 + +//============================================================================ +void() golem_stand1 =[ $wait1, golem_stand2 ] {monster_idle_sound();ai_stand();}; +void() golem_stand2 =[ $wait2, golem_stand3 ] {ai_stand();}; +void() golem_stand3 =[ $wait3, golem_stand4 ] {ai_stand();}; +void() golem_stand4 =[ $wait4, golem_stand5 ] {ai_stand();}; +void() golem_stand5 =[ $wait5, golem_stand6 ] {ai_stand();}; +void() golem_stand6 =[ $wait6, golem_stand7 ] {ai_stand();}; +void() golem_stand7 =[ $wait7, golem_stand8 ] {ai_stand();}; +void() golem_stand8 =[ $wait8, golem_stand9 ] {ai_stand();}; +void() golem_stand9 =[ $wait9, golem_stand10 ] {ai_stand();}; +void() golem_stand10 =[ $wait10, golem_stand11 ] {ai_stand();}; +void() golem_stand11 =[ $wait11, golem_stand12 ] {ai_stand();}; +void() golem_stand12 =[ $wait12, golem_stand13 ] {ai_stand();}; +void() golem_stand13 =[ $wait13, golem_stand14 ] {ai_stand();}; +void() golem_stand14 =[ $wait14, golem_stand15 ] {ai_stand();}; +void() golem_stand15 =[ $wait15, golem_stand16 ] {ai_stand();}; +void() golem_stand16 =[ $wait16, golem_stand17 ] {ai_stand();}; +void() golem_stand17 =[ $wait17, golem_stand18 ] {ai_stand();}; +void() golem_stand18 =[ $wait18, golem_stand19 ] {ai_stand();}; +void() golem_stand19 =[ $wait19, golem_stand20 ] {ai_stand();}; +void() golem_stand20 =[ $wait20, golem_stand21 ] {ai_stand();}; +void() golem_stand21 =[ $wait21, golem_stand1 ] {ai_stand();}; + +//============================================================================ +void() golem_ai_walk = { + if (self.frame == $walk1 || self.frame == $walk17) + { ai_walk(0); monster_footstep(FALSE); } + else if (self.frame == $walk2 || self.frame == $walk18) ai_walk(1); + else ai_walk(2); + self.nextthink = time + 0.05; + if (self.frame == $walk8 || self.frame == $walk25) monster_idle_sound(); +}; + +void() golem_walk1 =[ $walk1, golem_walk2 ] {golem_ai_walk();}; +void() golem_walk2 =[ $walk2, golem_walk3 ] {golem_ai_walk();}; +void() golem_walk3 =[ $walk3, golem_walk4 ] {golem_ai_walk();}; +void() golem_walk4 =[ $walk4, golem_walk5 ] {golem_ai_walk();}; +void() golem_walk5 =[ $walk5, golem_walk6 ] {golem_ai_walk();}; +void() golem_walk6 =[ $walk6, golem_walk7 ] {golem_ai_walk();}; +void() golem_walk7 =[ $walk7, golem_walk8 ] {golem_ai_walk();}; +void() golem_walk8 =[ $walk8, golem_walk9 ] {golem_ai_walk();}; +void() golem_walk9 =[ $walk9, golem_walk10 ] {golem_ai_walk();}; +void() golem_walk10 =[ $walk10, golem_walk11 ] {golem_ai_walk();}; +void() golem_walk11 =[ $walk11, golem_walk12 ] {golem_ai_walk();}; +void() golem_walk12 =[ $walk12, golem_walk13 ] {golem_ai_walk();}; +void() golem_walk13 =[ $walk13, golem_walk14 ] {golem_ai_walk();}; +void() golem_walk14 =[ $walk14, golem_walk15 ] {golem_ai_walk();}; +void() golem_walk15 =[ $walk15, golem_walk16 ] {golem_ai_walk();}; +void() golem_walk16 =[ $walk16, golem_walk17 ] {golem_ai_walk();}; +void() golem_walk17 =[ $walk17, golem_walk18 ] {golem_ai_walk();}; +void() golem_walk18 =[ $walk18, golem_walk19 ] {golem_ai_walk();}; +void() golem_walk19 =[ $walk19, golem_walk20 ] {golem_ai_walk();}; +void() golem_walk20 =[ $walk20, golem_walk21 ] {golem_ai_walk();}; +void() golem_walk21 =[ $walk21, golem_walk22 ] {golem_ai_walk();}; +void() golem_walk22 =[ $walk22, golem_walk23 ] {golem_ai_walk();}; +void() golem_walk23 =[ $walk23, golem_walk24 ] {golem_ai_walk();}; +void() golem_walk24 =[ $walk24, golem_walk25 ] {golem_ai_walk();}; +void() golem_walk25 =[ $walk25, golem_walk26 ] {golem_ai_walk();}; +void() golem_walk26 =[ $walk26, golem_walk27 ] {golem_ai_walk();}; +void() golem_walk27 =[ $walk27, golem_walk28 ] {golem_ai_walk();}; +void() golem_walk28 =[ $walk28, golem_walk29 ] {golem_ai_walk();}; +void() golem_walk29 =[ $walk29, golem_walk30 ] {golem_ai_walk();}; +void() golem_walk30 =[ $walk30, golem_walk31 ] {golem_ai_walk();}; +void() golem_walk31 =[ $walk31, golem_walk32 ] {golem_ai_walk();}; +void() golem_walk32 =[ $walk32, golem_walk33 ] {golem_ai_walk();}; +void() golem_walk33 =[ $walk33, golem_walk34 ] {golem_ai_walk();}; +void() golem_walk34 =[ $walk34, golem_walk1 ] {golem_ai_walk();}; + +//============================================================================ +void() golem_ai_run = { + if (self.frame == $run1 || self.frame == $run13) + { ai_run(0); monster_footstep(FALSE); } + else if (self.frame == $run2 || self.frame == $run14) ai_run(3); + else ai_run(5); + self.nextthink = time + 0.05; + if (self.frame == $run7 || self.frame == $run18) monster_idle_sound(); +}; + +void() golem_run1 =[ $run1, golem_run2 ] {golem_ai_run();}; +void() golem_run2 =[ $run2, golem_run3 ] {golem_ai_run();}; +void() golem_run3 =[ $run3, golem_run4 ] {golem_ai_run();}; +void() golem_run4 =[ $run4, golem_run5 ] {golem_ai_run();}; +void() golem_run5 =[ $run5, golem_run6 ] {golem_ai_run();}; +void() golem_run6 =[ $run6, golem_run7 ] {golem_ai_run();}; +void() golem_run7 =[ $run7, golem_run8 ] {golem_ai_run();}; +void() golem_run8 =[ $run8, golem_run9 ] {golem_ai_run();}; +void() golem_run9 =[ $run9, golem_run10 ] {golem_ai_run();}; +void() golem_run10 =[ $run10, golem_run11 ] {golem_ai_run();}; +void() golem_run11 =[ $run11, golem_run12 ] {golem_ai_run();}; +void() golem_run12 =[ $run12, golem_run13 ] {golem_ai_run();}; +void() golem_run13 =[ $run13, golem_run14 ] {golem_ai_run();}; +void() golem_run14 =[ $run14, golem_run15 ] {golem_ai_run();}; +void() golem_run15 =[ $run15, golem_run16 ] {golem_ai_run();}; +void() golem_run16 =[ $run16, golem_run17 ] {golem_ai_run();}; +void() golem_run17 =[ $run17, golem_run18 ] {golem_ai_run();}; +void() golem_run18 =[ $run18, golem_run19 ] {golem_ai_run();}; +void() golem_run19 =[ $run19, golem_run20 ] {golem_ai_run();}; +void() golem_run20 =[ $run20, golem_run21 ] {golem_ai_run();}; +void() golem_run21 =[ $run21, golem_run22 ] {golem_ai_run();}; +void() golem_run22 =[ $run22, golem_run23 ] {golem_ai_run();}; +void() golem_run23 =[ $run23, golem_run1 ] {golem_ai_run();}; + +//============================================================================ +// MELEE - Punch or Pound the ground with fist +//============================================================================ +void(float dist) golem_mcharge = { ai_charge(dist);self.nextthink = time + 0.05;}; + +//---------------------------------------------------------------------- +void() golem_punch1 = [ $punch1, golem_punch2 ] {golem_mcharge(5);}; +void() golem_punch2 = [ $punch2, golem_punch3 ] {golem_mcharge(5);}; +void() golem_punch3 = [ $punch3, golem_punch4 ] {golem_mcharge(5);}; +void() golem_punch4 = [ $punch4, golem_punch5 ] {golem_mcharge(5);}; +void() golem_punch5 = [ $punch5, golem_punch6 ] {golem_mcharge(5);}; +void() golem_punch6 = [ $punch6, golem_punch7 ] {golem_mcharge(5);}; +void() golem_punch7 = [ $punch7, golem_punch8 ] {golem_mcharge(5);}; +void() golem_punch8 = [ $punch8, golem_punch9 ] {golem_mcharge(5);}; +void() golem_punch9 = [ $punch9, golem_punch10 ] {golem_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() golem_punch10 = [ $punch10, golem_punch11 ] {golem_mcharge(4);}; +void() golem_punch11 = [ $punch11, golem_punch12 ] {golem_mcharge(3);monster_footstep(FALSE);}; +void() golem_punch12 = [ $punch12, golem_punch13 ] {golem_mcharge(2); + self.meleehitsound = "golem/melee_pound.wav"; + self.meleecontact = TRUE;ai_meleesmash(20); + self.meleecontact = FALSE; +}; +void() golem_punch13 = [ $punch13, golem_punch14 ] {golem_mcharge(1);}; +void() golem_punch14 = [ $punch14, golem_punch15 ] {golem_mcharge(1);}; +void() golem_punch15 = [ $punch15, golem_punch16 ] {golem_mcharge(1);}; +void() golem_punch16 = [ $punch16, golem_punch17 ] {golem_mcharge(1);}; +void() golem_punch17 = [ $punch17, golem_punch18 ] {golem_mcharge(2);}; +void() golem_punch18 = [ $punch18, golem_punch19 ] {golem_mcharge(3);}; +void() golem_punch19 = [ $punch19, golem_punch20 ] {golem_mcharge(4);}; +void() golem_punch20 = [ $punch20, golem_punch21 ] {golem_mcharge(5);}; +void() golem_punch21 = [ $punch21, golem_punch22 ] {golem_mcharge(5);}; +void() golem_punch22 = [ $punch22, golem_punch23 ] {golem_mcharge(5);}; +void() golem_punch23 = [ $punch23, golem_punch24 ] {golem_mcharge(5);}; +void() golem_punch24 = [ $punch24, golem_run1 ] {golem_mcharge(5);monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() golem_pound1 = [ $pound1, golem_pound2 ] {golem_mcharge(5);}; +void() golem_pound2 = [ $pound2, golem_pound3 ] {golem_mcharge(5);}; +void() golem_pound3 = [ $pound3, golem_pound4 ] {golem_mcharge(5);}; +void() golem_pound4 = [ $pound4, golem_pound5 ] {golem_mcharge(5);}; +void() golem_pound5 = [ $pound5, golem_pound6 ] {golem_mcharge(5);}; +void() golem_pound6 = [ $pound6, golem_pound7 ] {golem_mcharge(5);}; +void() golem_pound7 = [ $pound7, golem_pound8 ] {golem_mcharge(5);}; +void() golem_pound8 = [ $pound8, golem_pound9 ] {golem_mcharge(5);}; +void() golem_pound9 = [ $pound9, golem_pound10 ] {golem_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() golem_pound10 = [ $pound10, golem_pound11 ] {golem_mcharge(4);}; +void() golem_pound11 = [ $pound11, golem_pound12 ] {golem_mcharge(3);monster_footstep(FALSE);}; +void() golem_pound12 = [ $pound12, golem_pound13 ] {golem_mcharge(2); + self.meleehitsound = "golem/melee_pound.wav"; + self.meleecontact = TRUE;ai_meleesmash(40); + self.meleecontact = FALSE; +}; +void() golem_pound13 = [ $pound13, golem_pound14 ] {golem_mcharge(1);}; +void() golem_pound14 = [ $pound14, golem_pound15 ] {golem_mcharge(1);}; +void() golem_pound15 = [ $pound15, golem_pound16 ] {golem_mcharge(1);}; +void() golem_pound16 = [ $pound16, golem_pound17 ] {golem_mcharge(1);}; +void() golem_pound17 = [ $pound17, golem_pound18 ] {golem_mcharge(2);}; +void() golem_pound18 = [ $pound18, golem_pound19 ] {golem_mcharge(3);}; +void() golem_pound19 = [ $pound19, golem_pound20 ] {golem_mcharge(4);}; +void() golem_pound20 = [ $pound20, golem_pound21 ] {golem_mcharge(5);}; +void() golem_pound21 = [ $pound21, golem_pound22 ] {golem_mcharge(5);}; +void() golem_pound22 = [ $pound22, golem_pound23 ] {golem_mcharge(5);}; +void() golem_pound23 = [ $pound23, golem_pound24 ] {golem_mcharge(5);}; +void() golem_pound24 = [ $pound24, golem_run1 ] {golem_mcharge(5);monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() golem_knock1 = [ $knock1, golem_knock2 ] {golem_mcharge(5);}; +void() golem_knock2 = [ $knock2, golem_knock3 ] {golem_mcharge(6);}; +void() golem_knock3 = [ $knock3, golem_knock4 ] {golem_mcharge(7);}; +void() golem_knock4 = [ $knock4, golem_knock5 ] {golem_mcharge(8);}; +void() golem_knock5 = [ $knock5, golem_knock6 ] {golem_mcharge(9);}; +void() golem_knock6 = [ $knock7, golem_knock7 ] {golem_mcharge(10);}; +void() golem_knock7 = [ $knock6, golem_knock8 ] {golem_mcharge(9);}; +void() golem_knock8 = [ $knock8, golem_knock9 ] {golem_mcharge(8);}; +void() golem_knock9 = [ $knock9, golem_knock10 ] {golem_mcharge(7);}; +void() golem_knock10 = [ $knock10, golem_knock11 ] {golem_mcharge(6);}; +void() golem_knock11 = [ $knock11, golem_knock12 ] {golem_mcharge(5);monster_footstep(FALSE);}; +void() golem_knock12 = [ $knock12, golem_knock13 ] {golem_mcharge(5); + sound (self, CHAN_VOICE, "golem/melee_swipe.wav", 1, ATTN_IDLE);}; +void() golem_knock13 = [ $knock13, golem_knock14 ] {golem_mcharge(4);}; +void() golem_knock14 = [ $knock14, golem_knock15 ] {golem_mcharge(3);}; +void() golem_knock15 = [ $knock15, golem_knock16 ] {golem_mcharge(2);}; +void() golem_knock16 = [ $knock16, golem_knock17 ] {golem_mcharge(1); + self.meleehitsound = "golem/melee_punch.wav"; + self.meleecontact = TRUE;ai_meleesmash(30); + // If punch made contact, lift the enemy off ground + if (self.meleecontact == FALSE) { + self.pos1 = self.enemy.origin - self.origin; + self.pos1_z = 0; + self.pos1 = normalize(self.pos1); + self.enemy.velocity = self.enemy.velocity + self.pos1 * 400; + self.enemy.velocity_z = self.enemy.velocity_z + 250; + self.enemy.flags = self.enemy.flags - (self.enemy.flags & FL_ONGROUND); + } + self.meleecontact = FALSE; +}; +void() golem_knock17 = [ $knock17, golem_knock18 ] {golem_mcharge(1);}; +void() golem_knock18 = [ $knock18, golem_knock19 ] {golem_mcharge(2);}; +void() golem_knock19 = [ $knock19, golem_knock20 ] {golem_mcharge(3);}; +void() golem_knock20 = [ $knock20, golem_knock21 ] {golem_mcharge(4);}; +void() golem_knock21 = [ $knock21, golem_knock22 ] {golem_mcharge(5);}; +void() golem_knock22 = [ $knock22, golem_knock23 ] {golem_mcharge(5);}; +void() golem_knock23 = [ $knock23, golem_knock24 ] {golem_mcharge(5);}; +void() golem_knock24 = [ $knock24, golem_run1 ] { + golem_mcharge(5); + // Double check enemy is still alive? + if (self.enemy.health > 1) { + // If the enemy is visible, quickly go for range attack + if (!visblocked_wide(self.enemy, '0 0 34', '0 0 24')) { + SUB_AttackFinished (2 + 2*random()); + self.think = self.th_missile; + } + } +}; + +//---------------------------------------------------------------------- +void() golem_footstomp = {self.nextthink = time + 0.05;}; + +void() golem_stomp1 = [ $stomp1, golem_stomp2 ] {golem_footstomp(); + self.pain_finished = time + self.pain_timeout;}; +void() golem_stomp2 = [ $stomp2, golem_stomp3 ] {golem_footstomp(); + sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_IDLE);}; +void() golem_stomp3 = [ $stomp3, golem_stomp4 ] {golem_footstomp();}; +void() golem_stomp4 = [ $stomp4, golem_stomp5 ] {golem_footstomp();}; +void() golem_stomp5 = [ $stomp5, golem_stomp6 ] {golem_footstomp();monster_idle_sound();}; +void() golem_stomp6 = [ $stomp6, golem_stomp7 ] {golem_footstomp();}; +void() golem_stomp7 = [ $stomp7, golem_stomp8 ] {golem_footstomp();}; +void() golem_stomp8 = [ $stomp8, golem_stomp9 ] {golem_footstomp();}; +void() golem_stomp9 = [ $stomp9, golem_stomp10 ] {golem_footstomp();}; +void() golem_stomp10 = [ $stomp10, golem_stomp11 ] {golem_footstomp();}; +void() golem_stomp11 = [ $stomp11, golem_stomp12 ] {golem_footstomp();}; +void() golem_stomp12 = [ $stomp12, golem_stomp13 ] {golem_footstomp();}; +void() golem_stomp13 = [ $stomp13, golem_stomp14 ] { + golem_footstomp(); self.meleehitsound = "golem/groundslam.wav"; + ai_shockwave(MONAI_STOMPIMPACT, MONAI_STOMPDAMAGE, MONAI_STOMPRADIUS, MONAI_STOMPFORWARD, MONAI_STOMPUP); +}; +void() golem_stomp14 = [ $stomp14, golem_stomp15 ] {golem_footstomp();}; +void() golem_stomp15 = [ $stomp15, golem_stomp16 ] {golem_footstomp();}; +void() golem_stomp16 = [ $stomp16, golem_stomp17 ] {golem_footstomp();monster_idle_sound();}; +void() golem_stomp17 = [ $stomp17, golem_stomp18 ] {golem_footstomp();}; +void() golem_stomp18 = [ $stomp18, golem_stomp19 ] {golem_footstomp();}; +void() golem_stomp19 = [ $stomp19, golem_stomp20 ] {golem_footstomp();}; +void() golem_stomp20 = [ $stomp20, golem_stomp21 ] {golem_footstomp();}; +void() golem_stomp21 = [ $stomp21, golem_stomp22 ] {golem_footstomp();}; +void() golem_stomp22 = [ $stomp22, golem_stomp23 ] {golem_footstomp();}; +void() golem_stomp23 = [ $stomp23, golem_stomp24 ] {golem_footstomp();}; +void() golem_stomp24 = [ $stomp24, golem_run1 ] { + golem_footstomp(); monster_footstep(FALSE); + // Double check enemy is still alive? + // Make sure golem can do range attacks (melee only ver exists) + if (self.enemy.health > 1 && !(self.spawnflags & MON_GOLEM_MELEEONLY)) { + // If the enemy is visible, quickly go for range attack + if (!visblocked_wide(self.enemy, '0 0 34', '0 0 24')) { + SUB_AttackFinished (2 + 2*random()); + self.think = self.th_missile; + } + } +}; + + +//---------------------------------------------------------------------- +void() golem_melee = +{ + if (self.enemy.flags & FL_MONSTER) golem_knock1(); + else { + self.meleeattack = random(); + if (self.meleeattack < 0.2) golem_knock1(); + else if (self.meleeattack < 0.6) golem_punch1(); + else golem_pound1(); + } +} + +//============================================================================ +// RANGE - ROCK STORM from Torso +//============================================================================ +void() golem_rockstorm = +{ + local float shotcount, zpart; + local vector org, dir, yrand, zrand; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Make sure facing the right direction + ai_face(); + makevectors(self.angles); + + // Spawn a mist of particles where projectiles came from + org = self.origin + v_forward*20; + zpart = 25 + rint(random()*25); + particle_explode(org, zpart, 2, PARTICLE_BURST_WHITE, PARTICLE_BURST_UPWARD); + + // Randomize quantity each time called + if (random() < 0.5) shotcount = 2; + else shotcount = 3; + + while (shotcount > 0) { + // Randomly spawn projectiles from golems chest + yrand = (crandom()*30)*v_right; + zrand = (crandom()*30)*v_up; + org = self.origin + attack_vector(self.attack_offset) + yrand + zrand; + + // Straight line velocity from source to target + dir = (self.enemy.origin - org) + (v_right*(crandom()*50)); + dir = normalize (dir); + + // Variable speed based on skill level with extra random spice + self.attack_speed = SPEED_GOLEMSPIKE + (skill * SPEED_GOLEMSKILL) + random()*10; + launch_projectile (org, dir, CT_PROJ_GROCK, self.attack_speed); + shotcount = shotcount - 1; + } +}; + +//---------------------------------------------------------------------- +void() golem_magtime = {self.nextthink = time + 0.05;}; + +void() golem_magic1 = [ $magic1, golem_magic2 ] {golem_magtime();ai_face(); + self.pain_finished = time + 1.5; + sound (self, CHAN_WEAPON, "golem/rockstorm.wav", 1, ATTN_NORM); +}; +void() golem_magic2 = [ $magic2, golem_magic3 ] {golem_magtime();}; +void() golem_magic3 = [ $magic3, golem_magic4 ] {golem_magtime();ai_face();}; +void() golem_magic4 = [ $magic4, golem_magic5 ] {golem_magtime();}; +void() golem_magic5 = [ $magic5, golem_magic6 ] {golem_magtime();ai_face();}; +void() golem_magic6 = [ $magic6, golem_magic7 ] {golem_magtime();}; +void() golem_magic7 = [ $magic7, golem_magic8 ] {golem_magtime();ai_face();}; +void() golem_magic8 = [ $magic8, golem_magic9 ] {golem_magtime();}; +void() golem_magic9 = [ $magic9, golem_magic10 ] {golem_magtime();ai_face();}; +void() golem_magic10 = [ $magic10, golem_magic11 ] {golem_magtime();}; +void() golem_magic11 = [ $magic11, golem_magic12 ] {golem_magtime();ai_face();}; +void() golem_magic12 = [ $magic12, golem_magic13 ] {golem_magtime();}; +void() golem_magic13 = [ $magic13, golem_magic14 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic14 = [ $magic14, golem_magic15 ] {golem_magtime();}; +void() golem_magic15 = [ $magic15, golem_magic16 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic16 = [ $magic16, golem_magic17 ] {golem_magtime();}; +void() golem_magic17 = [ $magic17, golem_magic18 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic18 = [ $magic18, golem_magic19 ] {golem_magtime();}; +void() golem_magic19 = [ $magic19, golem_magic20 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic20 = [ $magic20, golem_magic21 ] {golem_magtime();}; +void() golem_magic21 = [ $magic21, golem_magic22 ] {golem_magtime();golem_rockstorm();}; +void() golem_magic22 = [ $magic22, golem_magic23 ] {golem_magtime();}; +void() golem_magic23 = [ $magic23, golem_magic24 ] {golem_magtime();}; +void() golem_magic24 = [ $magic24, golem_run1 ] {golem_magtime();}; + +//============================================================================ +// PAIN +//============================================================================ +// Short & fast pain animation +void() golem_painA1 =[ $birth8, golem_painA2 ] {}; +void() golem_painA2 =[ $birth10, golem_painA3 ] {}; +void() golem_painA3 =[ $birth12, golem_painA4 ] {}; +void() golem_painA4 =[ $birth14, golem_painA5 ] {}; +void() golem_painA5 =[ $birth16, golem_run1 ] {}; + +// Long slow pain animation +void() golem_painB1 =[ $birth8, golem_painB2 ] {}; +void() golem_painB2 =[ $birth9, golem_painB3 ] {}; +void() golem_painB3 =[ $birth10, golem_painB4 ] {}; +void() golem_painB4 =[ $birth11, golem_painB5 ] {}; +void() golem_painB5 =[ $birth12, golem_painB6 ] {}; +void() golem_painB6 =[ $birth13, golem_painB7 ] {}; +void() golem_painB7 =[ $birth14, golem_painB8 ] {}; +void() golem_painB8 =[ $birth15, golem_painB9 ] {}; +void() golem_painB9 =[ $birth16, golem_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) golem_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1) { + if (self.lip < 0.4) golem_painB1(); // Long + else golem_painA1(); // Short + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + self.pain_finished = time + 0.9; + golem_painB1 (); + } + } +}; + +//============================================================================ +void() golem_death1 = [ $death1, golem_death2 ] {}; +void() golem_death2 = [ $death2, golem_death3 ] {}; +void() golem_death3 = [ $death3, golem_death4 ] {ai_forward(1);self.solid = SOLID_NOT;}; +void() golem_death4 = [ $death4, golem_death5 ] {ai_forward(3);}; +void() golem_death5 = [ $death5, golem_death6 ] {ai_forward(3);}; +void() golem_death6 = [ $death6, golem_death7 ] {ai_forward(6);}; +void() golem_death7 = [ $death7, golem_death8 ] {ai_forward(8);monster_footstep(FALSE);}; +void() golem_death8 = [ $death8, golem_death9 ] {ai_forward(6);}; +void() golem_death9 = [ $death9, golem_death10] {}; +void() golem_death10 = [ $death10, golem_death11] {}; +void() golem_death11 = [ $death11, golem_death12] {}; +void() golem_death12 = [ $death12, golem_death13] {}; +void() golem_death13 = [ $death13, golem_death14] {}; +void() golem_death14 = [ $death14, golem_death15] {}; +void() golem_death15 = [ $death15, golem_death16] {ai_forward(2);}; +void() golem_death16 = [ $death16, golem_death17] {ai_forward(2);}; +void() golem_death17 = [ $death17, golem_death18] {ai_forward(2);}; +void() golem_death18 = [ $death18, golem_death19] {ai_forward(2);}; +void() golem_death19 = [ $death19, golem_death20] {ai_forward(2);}; +void() golem_death20 = [ $death20, golem_death21] {ai_forward(2);}; +void() golem_death21 = [ $death21, golem_death22] {ai_forward(2);monster_death_postcheck();}; +void() golem_death22 = [ $death22, golem_death22] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() golem_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Spawn some extra rubble before dying + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 300, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 250); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "golem/death.wav", 1, ATTN_NORM); + golem_death1 (); + } +}; + +//============================================================================ +// Wakeup From Statue form +//============================================================================ +void() golem_birth = { + if (random() < 0.8) SpawnProjectileSmoke(self.origin, 200, 50, 250); + self.nextthink = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() golem_wakefinished = +{ + // No longer need statue spawnflag, remove it + if (self.spawnflags & MON_STATUE) + self.spawnflags = self.spawnflags - MON_STATUE; + self.spawnstatue = FALSE; // No longer stationary + + self.th_stand = golem_stand1; // Idling on feet + self.th_walk = golem_walk1; // Walking + self.th_run = golem_run1; // Running + self.th_melee = golem_melee; // Fist attack + // Check for melee + stomp attack only version + if (!(self.spawnflags & MON_GOLEM_MELEEONLY)) + self.th_missile = golem_magic1; + self.th_slide = golem_stomp1; // Floor stomp + self.th_pain = golem_pain; // Stumble and pain + self.th_die = golem_die; // Face meets floor + self.takedamage = DAMAGE_AIM; // Can receive damage + monster_targets(); // Check for targets + golem_birth(); // more rubble +}; + +//---------------------------------------------------------------------- +void() golem_wake1 =[ $birth1, golem_wake2 ] {golem_birth(); + sound (self, CHAN_BODY, "golem/wakestatue.wav", 1, ATTN_NORM);}; +void() golem_wake2 =[ $birth2, golem_wake3 ] {golem_birth();ai_forward(2);}; +void() golem_wake3 =[ $birth3, golem_wake4 ] {golem_birth();ai_forward(3);}; +void() golem_wake4 =[ $birth4, golem_wake5 ] {golem_birth();ai_forward(4);}; +void() golem_wake5 =[ $birth5, golem_wake6 ] {golem_birth();ai_forward(3);}; +void() golem_wake6 =[ $birth6, golem_wake7 ] {golem_birth();ai_forward(3);}; +void() golem_wake7 =[ $birth7, golem_wake8 ] {golem_birth();ai_forward(1);}; +void() golem_wake8 =[ $birth8, golem_wake9 ] {golem_birth();monster_footstep(FALSE);}; +void() golem_wake9 =[ $birth9, golem_wake10 ] {golem_birth();}; +void() golem_wake10 =[ $birth10, golem_wake11 ] {golem_birth();}; +void() golem_wake11 =[ $birth11, golem_wake12 ] {golem_birth();monster_idle_sound();}; +void() golem_wake12 =[ $birth12, golem_wake13 ] {golem_birth();}; +void() golem_wake13 =[ $birth13, golem_wake14 ] {golem_birth();}; +void() golem_wake14 =[ $birth14, golem_wake15 ] {golem_birth();}; +void() golem_wake15 =[ $birth15, golem_wake16 ] {golem_birth();}; +void() golem_wake16 =[ $birth16, golem_tranB1 ] {golem_birth();}; + +void() golem_tranB1 = [ $tranB1, golem_tranB2 ] {golem_birth();ai_forward(5);}; +void() golem_tranB2 = [ $tranB2, golem_tranB3 ] {golem_birth();ai_forward(5);}; +void() golem_tranB3 = [ $tranB3, golem_tranB4 ] {golem_birth();ai_forward(5);monster_idle_sound();}; +void() golem_tranB4 = [ $tranB4, golem_tranB5 ] {golem_birth();ai_forward(5);}; +void() golem_tranB5 = [ $tranB5, golem_tranB6 ] {golem_birth();ai_forward(5);}; +void() golem_tranB6 = [ $tranB6, golem_tranB7 ] {golem_birth();ai_forward(5);}; +void() golem_tranB7 = [ $tranB7, golem_tranB8 ] {golem_birth();ai_forward(5);monster_idle_sound();}; +void() golem_tranB8 = [ $tranB8, golem_tranB9 ] {golem_birth();ai_forward(5);}; +void() golem_tranB9 = [ $tranB9, golem_tranB10 ] {golem_birth();ai_forward(5);}; +void() golem_tranB10 = [ $tranB10, golem_tranB11 ] {golem_birth();ai_forward(5);}; +void() golem_tranB11 = [ $tranB11, golem_tranB12 ] {golem_birth();ai_forward(5);}; +void() golem_tranB12 = [ $tranB12, golem_tranB13 ] {golem_birth();ai_forward(5);}; +void() golem_tranB13 = [ $tranB13, golem_run14 ] {golem_wakefinished(); monster_footstep(FALSE);}; + +//---------------------------------------------------------------------- +void() golem_wakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + + // Only call wakeup function once + self.use = SUB_Null; + self.th_stand = self.th_walk = self.th_run = SUB_Null; + self.skin = 0; // Glowing eyes! + golem_wake1(); +}; + +//---------------------------------------------------------------------- +void() golem_statue = +{ + local float targ_angle, new_frame; + + // Check for sudden death! + if (self.health < 0) return; + + if (random() < MON_IDLE_SOUND && self.pos1_z > 1) { + new_frame = TRUE; + self.oldenemy = checkclient(); + if (self.oldenemy.flags & FL_CLIENT) { + targ_angle = viewangle(self.origin, self.oldenemy.origin, 0, TRUE, self.oldenemy.v_angle_y); + if (targ_angle < 135 || targ_angle > 225) new_frame = FALSE; + } + self.lip = self.pos1_x + rint(random()*self.pos1_z); + if (new_frame) { + sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + self.frame = self.lip; + } + } + + self.think = golem_statue; + self.nextthink = time + 5 + random()*5; +}; + +/*====================================================================== +QUAKED monster_golem (1 0.2 0) (-16 -16 -24) (16 16 24) +======================================================================*/ +void() monster_golem = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_golem.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_RINGSHOCK); + precache_model (MODEL_PROJ_GROCK1); + precache_model (MODEL_PROJ_GROCK2); + + self.gibtype = GIBTYPE_STONE; // Stoney gibs! + self.gib1mdl = MODEL_PROJ_GROCK1; // small golem rock + self.gib2mdl = MODEL_PROJ_GROCK2; // medium golem rock + self.gib1frame = self.gib2frame = 9; + + // Idle1a-1b (long sound) idle2a-2b (short sound) + self.idle_sound = "golem/idle1a.wav"; + self.idle_sound2 = "golem/idle1b.wav"; + self.idle_soundcom = "golem/idle2a.wav"; + self.idle_soundcom2 = "golem/idle2b.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + // Break free of statue pose + precache_sound ("golem/wakestatue.wav"); + + // Several melee smack sounds and giant ground slam + precache_sound ("golem/melee_swipe.wav"); + precache_sound ("golem/melee_punch.wav"); + precache_sound ("golem/melee_pound.wav"); + precache_sound ("golem/groundslam.wav"); + + // Rockstorm - range attack + precache_sound ("golem/rockstorm.wav"); + precache_sound (SOUND_IMP_ROCK1); + precache_sound (SOUND_IMP_ROCK2); + precache_sound (SOUND_IMP_ROCK3); + precache_sound (SOUND_IMP_ROCK4); + + self.pain_sound = "golem/pain1.wav"; + self.pain_sound2 = "golem/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound ("golem/death.wav"); + + // Roar! + self.sight_sound = "golem/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GOLEM; + if (self.health < 1) self.health = 500; + self.gibhealth = -60; // Same as shambler + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // Demon level + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // Does not repeat pain + self.infightextra = 3; // Triple damage to other monsters + self.steptype = FS_TYPEGIANT; // Giant sound + self.blockudeath = TRUE; // No humanoid death + self.bleedcolour = 16; // Brown dust/dirt + self.no_liquiddmg = TRUE; // Immune to slime/lava + self.meleerange = MONAI_MELEEGOLEM; + self.attack_offset = '10 0 30'; // Rock storm + + self.th_checkattack = GolemCheckAttack; + self.th_die = golem_die; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0; + + //---------------------------------------------------------------------- + // Detect statues and setup different parameters + // Tougher skin, less pain, heavy feet etc + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + // statues can change position when the player is not looking + // Specify a start/finish frame using pos1 or use frame + if (!self.pos1_x) { + self.pos1_x = $magic1; // Default pose (wakeup) + self.pos1_y = $magic24; + } + // A frame has been specified, create a small range from that + if (self.frame > 0) { + self.pos1_x = self.pos1_y = self.frame; + } + // Work out range, make sure no negative values + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = self.pos1_x; // Setup frame / pose + + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = golem_statue; // Stone idle sound + self.think1 = golem_wakeup; // Wakeup statue angry at player + self.skin = 1; // Statue skin (+grey, no eyes) + } + else { + self.th_stand = golem_stand1; + self.th_walk = golem_walk1; + self.th_run = golem_run1; + self.th_melee = golem_melee; + // Check for melee + stomp attack only version + if (!(self.spawnflags & MON_GOLEM_MELEEONLY)) + self.th_missile = golem_magic1; + self.th_slide = golem_stomp1; + self.th_pain = golem_pain; + } + + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was crushed by a Golem\n"; + } else { + if (self.deathstring == "") self.deathstring = " was terminated by a Golem\n"; + } + + self.hittype = HIT_STONE; + self.classtype = CT_MONGOLEM; + self.classgroup = CG_STONE; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_gremlin.qc b/QC_other/QC_keep/mon_gremlin.qc new file mode 100644 index 00000000..facf0ce5 --- /dev/null +++ b/QC_other/QC_keep/mon_gremlin.qc @@ -0,0 +1,1391 @@ +entity () GremlinFindVictim; +float () GremlinFindTarget; +float () GremlinCheckNoAmmo; +void () gremlin_glook1; +void () Gremlin_JumpTouch; +void () Gremlin_FlipTouch; +void (float side) Gremlin_Melee; +void (float side) Gremlin_Gorge; +float () GremlinWeaponAttack; + +float (float ammo) gremlin_ammo_steal = { + float take = 0; + if (ammo > GREMLIN_AMMO_TAKE) { + take = GREMLIN_AMMO_TAKE; + } else { + take = ammo; + } + return take; +}; + +void () gremlin_steal_shells = { + float amount = gremlin_ammo_steal(self.enemy.ammo_shells); + self.enemy.ammo_shells = (self.enemy.ammo_shells - amount); + self.ammo_shells = (self.ammo_shells + amount); + self.items = (self.items | IT_SHELLS); + self.currentammo = self.ammo_shells; +}; + +void () gremlin_steal_nails = { + float amount = gremlin_ammo_steal(self.enemy.ammo_nails); + self.enemy.ammo_nails = (self.enemy.ammo_nails - amount); + self.ammo_nails = (self.ammo_nails + amount); + self.items = (self.items | IT_NAILS); + self.currentammo = self.ammo_nails; +}; + +void () gremlin_steal_rockets = { + float amount = gremlin_ammo_steal(self.enemy.ammo_rockets); + self.enemy.ammo_rockets = (self.enemy.ammo_rockets - amount); + self.ammo_rockets = (self.ammo_rockets + amount); + self.items = (self.items | IT_ROCKETS); + self.currentammo = self.ammo_rockets; +}; + +void () gremlin_steal_cells = { + float amount = gremlin_ammo_steal(self.enemy.ammo_cells); + self.enemy.ammo_cells = (self.enemy.ammo_cells - amount); + self.ammo_cells = (self.ammo_cells + amount); + self.items = (self.items | IT_CELLS); + self.currentammo = self.ammo_cells; +}; + +void () gremlin_steal_bolts = { + float amount = gremlin_ammo_steal(self.enemy.ammo_bolts); + self.enemy.ammo_bolts = (self.enemy.ammo_bolts - amount); + self.ammo_bolts = (self.ammo_bolts + amount); + self.items2 = (self.items2 | IT2_BOLTS); + self.currentammo = self.ammo_bolts; +}; + +void () gremlin_steal_poison = { + float amount = gremlin_ammo_steal(self.enemy.ammo_poison); + self.enemy.ammo_poison = (self.enemy.ammo_poison - amount); + self.ammo_poison = (self.ammo_poison + amount); + self.items2 = (self.items2 | IT2_POISON); + self.currentammo = self.ammo_poison; +}; + +void () gremlin_steal_multi_rockets = { + float amount = gremlin_ammo_steal(self.enemy.ammo_multi_rockets); + self.enemy.ammo_multi_rockets = (self.enemy.ammo_multi_rockets - amount); + self.ammo_multi_rockets = (self.ammo_multi_rockets + amount); + self.items2 = (self.items2 | IT2_MULTI_ROCKETS); + self.currentammo = self.ammo_multi_rockets; +}; + +void () gremlin_steal_lava_nails = { + float amount = gremlin_ammo_steal(self.enemy.ammo_lava_nails); + self.enemy.ammo_lava_nails = (self.enemy.ammo_lava_nails - amount); + self.ammo_lava_nails = (self.ammo_lava_nails + amount); + self.items2 = (self.items2 | IT2_LAVA_NAILS); + self.currentammo = self.ammo_lava_nails; +}; + +void () gremlin_steal_plasma = { + float amount = gremlin_ammo_steal(self.enemy.ammo_plasma); + self.enemy.ammo_plasma = (self.enemy.ammo_plasma - amount); + self.ammo_plasma = (self.ammo_plasma + amount); + self.items2 = (self.items2 | IT2_PLASMA_AMMO); + self.currentammo = self.ammo_plasma; +}; + +float () GremlinAttemptWeaponSteal = { + local entity tempself, victim; + local float wep; + + if (self.stoleweapon) return ( FALSE ); // already stole a weapon + if (!(self.enemy.flags & FL_CLIENT)) return ( FALSE ); // only steal from players + if ((vlen(self.enemy.origin - self.origin)) > 100.000) return ( FALSE ); // not within 100 units + if (random () < 0.500) return ( FALSE ); // 50% chance + + wep = self.enemy.weapon; + if (wep == FALSE || wep == IT_AXE || wep == IT2_MJOLNIR) return ( FALSE ); + + if (wep != IT2_PROXIMITY_GUN && wep != IT2_LASER_CANNON) { + self.enemy.items = (self.enemy.items - (self.enemy.items & wep)); + self.items = 0; + self.items2 = 0; + self.items = (self.items | wep); + } else { + if (wep == IT2_PROXIMITY_GUN || wep == IT2_LASER_CANNON) { + self.enemy.items2 = (self.enemy.items2 - (self.enemy.items2 & wep)); + self.items = 0; + self.items2 = 0; + self.items2 = (self.items2 | wep); + } else { + return (FALSE); + } + } + + self.weapon = wep; + + // Take ammo along with the gun and sprint it to console + if (wep == IT_SHOTGUN) { + gremlin_steal_shells(); + sprint (victim,"Gremlin stole your Shotgun\n"); + } + if (wep == IT_SUPER_SHOTGUN) { + gremlin_steal_shells(); + if (self.enemy.moditems & IT_UPGRADE_SSG) { + self.moditems = self.moditems | IT_UPGRADE_SSG; + sprint (victim,"Gremlin stole your Widowmaker!\n"); + } else { + sprint (victim,"Gremlin stole your Double-Barrel Shotgun\n"); + } + } + if (wep == IT_NAILGUN) { + gremlin_steal_nails(); + sprint (victim,"Gremlin stole your Nailgun\n"); + } + if (wep == IT_LAVA_NAILGUN) { + gremlin_steal_lava_nails(); + sprint (victim,"Gremlin stole your Lava Nailgun\n"); + } + if (wep == IT_SUPER_NAILGUN) { + gremlin_steal_nails(); + sprint (victim,"Gremlin stole your Perforator\n"); + } + if (wep == IT_LAVA_SUPER_NAILGUN) { + gremlin_steal_lava_nails(); + sprint (victim,"Gremlin stole your Lava Perforator!\n"); + } + if (wep == IT_GRENADE_LAUNCHER) { + gremlin_steal_rockets(); + sprint (victim,"Gremlin stole your Grenade Launcher\n"); + } + if (wep == IT2_PROXIMITY_GUN) { + gremlin_steal_rockets(); + sprint (victim,"Gremlin stole your Proximity Gun\n"); + } + if (wep == IT_MULTI_GRENADE) { + gremlin_steal_multi_rockets(); + sprint (victim,"Gremlin stole your Multi-Grenade Launcher\n"); + } + if (wep == IT_ROCKET_LAUNCHER) { + gremlin_steal_rockets(); + sprint (victim,"Gremlin stole your Rocket Launcher\n"); + } + if (wep == IT_MULTI_ROCKET) { + gremlin_steal_multi_rockets(); + sprint (victim,"Gremlin stole your Multi-Rocket Launcher!\n"); + } + if (wep == IT_LIGHTNING) { + gremlin_steal_cells(); + if (self.enemy.moditems & IT_UPGRADE_LG) { + self.moditems = self.moditems | IT_UPGRADE_LG; + sprint (victim,"Gremlin stole your Plasma Gun!\n"); + } else { + sprint (victim,"Gremlin stole your Thunderbolt\n"); + } + } + if (wep == IT_PLASMA_GUN) { + gremlin_steal_plasma(); + sprint (victim,"Gremlin stole your Plasma Lightning Gun\n"); + } + if (wep == IT_EXTRA_WEAPON) { + if (self.enemy.ammo_poison > FALSE) { + gremlin_steal_poison(); + } else { + gremlin_steal_bolts(); + } + sprint (victim,"Gremlin stole your Crossbow\n"); + } + if (wep == IT2_LASER_CANNON) { + gremlin_steal_cells(); + sprint (victim,"Gremlin stole your Laser Cannon\n"); + } + + tempself = self; + self = self.enemy; // switch to player we are stealing from + self.weapon = W_BestWeapon (self); // force switch to next best weapon + W_SetCurrentAmmo (self); // check ammo now that we stole some + self = tempself; // back to gremlin + self.stoleweapon = TRUE; + self.attack_finished = time; + if ( (random () > 0.650) ) + self.lastvictim = self.enemy; + else + self.lastvictim = self; + + victim = GremlinFindVictim (); + if ( (victim != world) ) { + self.enemy = victim; + FoundTarget (); + self.attack_finished = time; + self.search_time = (time + TRUE); + } + return (TRUE); +}; + +float () GremlinFindTarget = { + local entity head; + local entity gorge; + local float dist; + local float result; + + if ( ((self.stoleweapon == FALSE) && (time > self.wait)) ) { + self.wait = (time + TRUE); + dist = 2000.000; + gorge = world; + head = nextent (world); + while ( (head != world) ) { + if ( ((head.health < TRUE) && (head.flags & (FL_MONSTER | FL_CLIENT))) ) { + result = fabs ((head.origin_z - self.origin_z)); + if ( (((visible (head) && (result < 80.000)) && (head.gorging == FALSE)) && (visible_distance < dist)) ) { + dist = visible_distance; + gorge = head; + } + } + head = nextent (head); + } + if ( ((gorge != world) && (dist < (700.000 * random ()))) ) { + self.oldenemy = self.enemy; + self.gorging = TRUE; + self.enemy = gorge; + self.search_time = (time + MOVETYPE_STEP); + FoundTarget (); + return ( TRUE ); + } + } else { + if ( self.stoleweapon ) { + head = GremlinFindVictim (); + if ( (head != world) ) { + self.enemy = head; + FoundTarget (); + self.attack_finished = time; + self.search_time = (time + FL_SWIM); + return ( TRUE ); + } + } + } + result = FindTarget (); + self.search_time = (time + FL_SWIM); + return ( result ); +}; + +void (float dist) gremlin_walk = { + movedist = dist; + if ( GremlinFindTarget () ) + return ; + + movetogoal (dist); +}; + +void () gremlin_stand = { + if ( FindTarget () ) + return ; + + if ( (time > self.pausetime) ) { + self.th_walk (); + return ; + } +}; + +void (float dist) gremlin_run = { + local float r; + local vector d; + local vector ang; + local float done; + local vector end; + local float c; + + if ( (self.watertype == CONTENT_LAVA) ) + T_Damage (self,world,world,2000.000,DAMARMOR); + + movedist = dist; + if ( self.stoleweapon ) + self.frame = ((self.frame + 164.000) - 29.000); + + if ( self.gorging ) { + traceline (self.origin,self.enemy.origin,TRUE,self); + if ( (trace_fraction != TRUE) ) { + self.gorging = FALSE; + return ; + } + if ( !visible (self.enemy) ) { + self.gorging = FALSE; + return ; + } + r = vlen ((self.enemy.origin - self.origin)); + if ( (r < 130.000) ) { + ai_face (); + if ( (r < 45.000) ) { + self.th_melee (); + self.attack_state = AS_STRAIGHT; + return ; + } else { + if ( (walkmove (self.angles_y,dist) == FALSE) ) { + self.gorging = FALSE; + return ; + } + } + return ; + } + movetogoal (dist); + } else { + if ( (random () > 0.970) ) { + if ( GremlinFindTarget () ) + return ; + } + if ( self.stoleweapon ) { + if ( ((self.enemy.health < FALSE) && (self.enemy.classname == "player")) ) { + gremlin_glook1 (); + return ; + } + if ( !GremlinCheckNoAmmo () ) { + if ( (self.t_length == TRUE) ) { + remove (self.trigger_field); + self.goalentity = self.enemy; + self.t_length = FALSE; + } + return ; + } + r = vlen ((self.enemy.origin - self.origin)); + d = normalize ((self.origin - self.enemy.origin)); + if ( (self.t_length == FALSE) ) { + if (r < 150) { + self.trigger_field = spawn (); + setsize (self.trigger_field,'-1.000 -1.000 -1.000','1.000 1.000 1.000'); + self.t_length = TRUE; + } + } + if ( (self.t_length == TRUE) ) { + if ( (r > 250.000) ) { + remove (self.trigger_field); + self.goalentity = self.enemy; + self.t_length = FALSE; + } else { + if ( (r < 160.000) ) { + ang = vectoangles (d); + done = FALSE; + c = FALSE; + while ( (done == FALSE) ) { + makevectors (ang); + end = (self.enemy.origin + (v_forward * 350.000)); + traceline (self.enemy.origin,end,FALSE,self); + if ( (trace_fraction == TRUE) ) { + traceline (self.origin,end,FALSE,self); + if ( (trace_fraction == TRUE) ) + done = TRUE; + } + ang_y = anglemod ((ang_y + 36.000)); + c = (c + TRUE); + if ( (c == MOVETYPE_BOUNCE) ) + done = TRUE; + } + setorigin (self.trigger_field,end); + } + self.goalentity = self.trigger_field; + self.ideal_yaw = vectoyaw (normalize ((self.goalentity.origin - self.origin))); + ChangeYaw (); + movetogoal (dist); + self.nextthink = (time + 0.100); + return ; + } + } + } + ai_run (dist); + self.nextthink = (time + 0.100); + } +}; + +void () gremlin_stand1 = [ 0.000, gremlin_stand2 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand2 = [ 1.000, gremlin_stand3 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand3 = [ 2.000, gremlin_stand4 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand4 = [ 3.000, gremlin_stand5 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand5 = [ 4.000, gremlin_stand6 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand6 = [ 5.000, gremlin_stand7 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand7 = [ 6.000, gremlin_stand8 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand8 = [ 7.000, gremlin_stand9 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand9 = [ 8.000, gremlin_stand10 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand10 = [ 9.000, gremlin_stand11 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand11 = [ 10.000, gremlin_stand12 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand12 = [ 11.000, gremlin_stand13 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand13 = [ 12.000, gremlin_stand14 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand14 = [ 13.000, gremlin_stand15 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand15 = [ 14.000, gremlin_stand16 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand16 = [ 15.000, gremlin_stand17 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; +void () gremlin_stand17 = [ 16.000, gremlin_stand1 ] { gremlin_stand (); self.nextthink = (time + 0.200); }; + +void () gremlin_walk1 = [ 17.000, gremlin_walk2 ] { + if ( (random () < 0.100) ) + sound (self,CHAN_VOICE,"grem/idle.wav",TRUE,ATTN_IDLE); + + gremlin_walk (FL_CLIENT); +}; +void () gremlin_walk2 = [ 18.000, gremlin_walk3 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk3 = [ 19.000, gremlin_walk4 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk4 = [ 20.000, gremlin_walk5 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk5 = [ 21.000, gremlin_walk6 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk6 = [ 22.000, gremlin_walk7 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk7 = [ 23.000, gremlin_walk8 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk8 = [ 24.000, gremlin_walk9 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk9 = [ 25.000, gremlin_walk10 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk10 = [ 26.000, gremlin_walk11 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk11 = [ 27.000, gremlin_walk12 ] { gremlin_walk (FL_CLIENT); }; +void () gremlin_walk12 = [ 28.000, gremlin_walk1 ] { gremlin_walk (FL_CLIENT); }; + +void () gremlin_run1 = [ 29.000, gremlin_run2 ] { + if ( (random () < 0.100) ) + sound (self,CHAN_VOICE,"grem/idle.wav",TRUE,ATTN_IDLE); + + gremlin_run (FALSE); +}; +void () gremlin_run2 = [ 30.000, gremlin_run3 ] { gremlin_run (FL_CLIENT);}; +void () gremlin_run3 = [ 31.000, gremlin_run4 ] { gremlin_run (STAT_TOTALMONSTERS); }; +void () gremlin_run4 = [ 32.000, gremlin_run5 ] { gremlin_run (FL_INWATER); }; +void () gremlin_run5 = [ 33.000, gremlin_run6 ] { gremlin_run (FL_INWATER); }; +void () gremlin_run6 = [ 34.000, gremlin_run7 ] { gremlin_run (STAT_TOTALMONSTERS); }; +void () gremlin_run7 = [ 35.000, gremlin_run8 ] { gremlin_run (FL_CLIENT); }; +void () gremlin_run8 = [ 36.000, gremlin_run9 ] { gremlin_run (FALSE); }; +void () gremlin_run9 = [ 37.000, gremlin_run10 ] { gremlin_run (FL_CLIENT); }; +void () gremlin_run10 = [ 38.000, gremlin_run11 ] { gremlin_run (STAT_TOTALMONSTERS); }; +void () gremlin_run11 = [ 39.000, gremlin_run12 ] { gremlin_run (FL_INWATER); }; +void () gremlin_run12 = [ 40.000, gremlin_run13 ] { gremlin_run (FL_INWATER); }; +void () gremlin_run13 = [ 41.000, gremlin_run14 ] { gremlin_run (STAT_TOTALMONSTERS); }; +void () gremlin_run14 = [ 42.000, gremlin_run15 ] { gremlin_run (FL_CLIENT); }; +void () gremlin_run15 = [ 43.000, gremlin_run1 ] { gremlin_run (FALSE); }; + +void () gremlin_jump1 = [ 44.000, gremlin_jump2 ] { ai_face (); }; +void () gremlin_jump2 = [ 45.000, gremlin_jump3 ] { ai_face (); }; +void () gremlin_jump3 = [ 46.000, gremlin_jump4 ] { ai_face (); }; +void () gremlin_jump4 = [ 47.000, gremlin_jump5 ] { ai_face (); }; +void () gremlin_jump5 = [ 48.000, gremlin_jump6 ] { + ai_face (); + if ( (self.flags & FL_ONGROUND) ) { + self.touch = Gremlin_JumpTouch; + makevectors (self.angles); + self.origin_z = (self.origin_z + TRUE); + self.velocity = ((v_forward * 300.000) + '0.000 0.000 300.000'); + self.flags = (self.flags - FL_ONGROUND); + } else { + gremlin_run1 (); + } +}; +void () gremlin_jump6 = [ 49.000, gremlin_jump7 ] {}; +void () gremlin_jump7 = [ 50.000, gremlin_jump8 ] {}; +void () gremlin_jump8 = [ 51.000, gremlin_jump9 ] {}; +void () gremlin_jump9 = [ 52.000, gremlin_jump10 ] {}; +void () gremlin_jump10 = [ 53.000, gremlin_jump11 ] {}; +void () gremlin_jump11 = [ 54.000, gremlin_jump1 ] { self.nextthink = (time + MOVETYPE_WALK); }; +void () gremlin_jump12 = [ 55.000, gremlin_jump13 ] {}; +void () gremlin_jump13 = [ 56.000, gremlin_jump14 ] {}; +void () gremlin_jump14 = [ 57.000, gremlin_jump15 ] {}; +void () gremlin_jump15 = [ 58.000, gremlin_jump16 ] {}; +void () gremlin_jump16 = [ 59.000, gremlin_run1 ] {}; + +void () gremlin_shot1 = [ 135.000, gremlin_shot2 ] {}; +void () gremlin_shot2 = [ 136.000, gremlin_shot3 ] {}; +void () gremlin_shot3 = [ 137.000, gremlin_shot4 ] {}; +void () gremlin_shot4 = [ 138.000, gremlin_shot5 ] {}; +void () gremlin_shot5 = [ 139.000, gremlin_shot6 ] {}; +void () gremlin_shot6 = [ 140.000, gremlin_run1 ] {}; + +void () GremlinFireSpikes = { + local vector dir; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + if (self.ammo_nails > 1 && self.weapon == IT_SUPER_NAILGUN) { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 2; + self.ammo_nails = self.ammo_nails - 2; + launch_projectile ((self.origin + '0 0 16'), dir, CT_PROJ_SNG, SPEED_PLAYSPIKE); + } else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 1; + self.ammo_nails = self.ammo_nails - 1; + launch_projectile ((self.origin + '0 0 16'), dir, CT_PROJ_NG, SPEED_PLAYSPIKE); + } +}; + +void () GremlinFireLavaSpikes = { + local vector dir; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + if (self.ammo_lava_nails > 1 && self.weapon == IT_LAVA_SUPER_NAILGUN) { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 2; + self.ammo_lava_nails = self.ammo_lava_nails - 2; + launch_projectile ((self.origin + '0 0 16'), dir, CT_PROJ_LAVASNG, SPEED_PLAYSPIKE); + } else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 1; + self.ammo_lava_nails = self.ammo_lava_nails - 1; + launch_projectile ((self.origin + '0 0 16'), dir, CT_PROJ_LAVANG, SPEED_PLAYSPIKE); + } +}; + +void () gremlin_nail1 = [ 135.000, gremlin_nail2 ] {GremlinFireSpikes();}; +void () gremlin_nail2 = [ 135.000, gremlin_nail3 ] {GremlinFireSpikes();}; +void () gremlin_nail3 = [ 135.000, gremlin_nail4 ] {GremlinFireSpikes();}; +void () gremlin_nail4 = [ 135.000, gremlin_nail5 ] {GremlinFireSpikes();}; +void () gremlin_nail5 = [ 135.000, gremlin_nail6 ] {GremlinFireSpikes();}; +void () gremlin_nail6 = [ 135.000, gremlin_nail7 ] {GremlinFireSpikes();}; +void () gremlin_nail7 = [ 135.000, gremlin_nail8 ] {GremlinFireSpikes();}; +void () gremlin_nail8 = [ 135.000, gremlin_run1 ] {GremlinFireSpikes();}; + +void () gremlin_lava_nail1 = [ 135.000, gremlin_lava_nail2 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail2 = [ 135.000, gremlin_lava_nail3 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail3 = [ 135.000, gremlin_lava_nail4 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail4 = [ 135.000, gremlin_lava_nail5 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail5 = [ 135.000, gremlin_lava_nail6 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail6 = [ 135.000, gremlin_lava_nail7 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail7 = [ 135.000, gremlin_lava_nail8 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_nail8 = [ 135.000, gremlin_run1 ] {GremlinFireLavaSpikes(); sound (self, CHAN_WEAPON, "lavagun/snail.wav", 1, ATTN_NORM);}; + +void () gremlin_snail1 = [ 135.000, gremlin_snail2 ] {GremlinFireSpikes();}; +void () gremlin_snail2 = [ 135.000, gremlin_snail3 ] {GremlinFireSpikes();}; +void () gremlin_snail3 = [ 135.000, gremlin_snail4 ] {GremlinFireSpikes();}; +void () gremlin_snail4 = [ 135.000, gremlin_snail5 ] {GremlinFireSpikes();}; +void () gremlin_snail5 = [ 135.000, gremlin_snail6 ] {GremlinFireSpikes();}; +void () gremlin_snail6 = [ 135.000, gremlin_snail7 ] {GremlinFireSpikes();}; +void () gremlin_snail7 = [ 135.000, gremlin_snail8 ] {GremlinFireSpikes();}; +void () gremlin_snail8 = [ 135.000, gremlin_run1 ] {GremlinFireSpikes();}; + +void () gremlin_lava_snail1 = [ 135.000, gremlin_lava_snail2 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail2 = [ 135.000, gremlin_lava_snail3 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail3 = [ 135.000, gremlin_lava_snail4 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail4 = [ 135.000, gremlin_lava_snail5 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail5 = [ 135.000, gremlin_lava_snail6 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail6 = [ 135.000, gremlin_lava_snail7 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail7 = [ 135.000, gremlin_lava_snail8 ] {GremlinFireLavaSpikes();}; +void () gremlin_lava_snail8 = [ 135.000, gremlin_run1 ] {GremlinFireLavaSpikes(); sound (self, CHAN_WEAPON, "lavagun/snail.wav", 1, ATTN_NORM);}; + +void () GremlinFireLaser = { + local vector org, dir; + + self.currentammo = self.ammo_cells = self.ammo_cells - 1; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + sound (self,CHAN_WEAPON,"hipweap/laserg.wav",TRUE,ATTN_NORM); + self.attack_finished = time + 0.9; + + org = self.origin + '0 0 16'; + HIP_LaunchLaser (org,dir,TRUE); +}; + +void () gremlin_laser1 = [ 135.000, gremlin_laser2 ] {GremlinFireLaser(); self.attack_finished = (time + 0.100);}; +void () gremlin_laser2 = [ 135.000, gremlin_run1 ] {GremlinFireLaser(); self.attack_finished = (time + 0.100);}; + +void () GremlinFireLightning = { + local vector org; + local vector dir; + local float cells; + + if ( (self.watertype <= CONTENT_WATER) ) { + cells = self.ammo_cells; + self.ammo_cells = FALSE; + discharged = TRUE; + T_RadiusDamage (self,self,(35.000 * cells),world,DAMAGEALL); + discharged = FALSE; + return ; + } + self.effects = (self.effects | EF_MUZZLEFLASH); + ai_face (); + self.ammo_cells = self.ammo_cells - 1; + self.currentammo = self.currentammo - 1; + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + org = (self.origin + '0.000 0.000 16.000'); + dir = ((self.enemy.origin + '0.000 0.000 16.000') - org); + dir = normalize (dir); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + traceline (org,(self.origin + (dir * 600.000)),TRUE,self); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST,self); + WriteCoord (MSG_BROADCAST,org_x); + WriteCoord (MSG_BROADCAST,org_y); + WriteCoord (MSG_BROADCAST,org_z); + WriteCoord (MSG_BROADCAST,trace_endpos_x); + WriteCoord (MSG_BROADCAST,trace_endpos_y); + WriteCoord (MSG_BROADCAST,trace_endpos_z); + LightningDamage (org,trace_endpos+ (dir * MOVETYPE_STEP),self,SVC_INTERMISSION); +}; + +void () gremlin_light1 = [ 135.000, gremlin_light2 ] {GremlinFireLightning();}; +void () gremlin_light2 = [ 135.000, gremlin_light3 ] {GremlinFireLightning();}; +void () gremlin_light3 = [ 135.000, gremlin_light4 ] {GremlinFireLightning();}; +void () gremlin_light4 = [ 135.000, gremlin_light5 ] {GremlinFireLightning();}; +void () gremlin_light5 = [ 135.000, gremlin_run1 ] {GremlinFireLightning(); }; + +void () gremlin_grenade1 = [ 135.000, gremlin_grenade2 ] { self.effects = (self.effects | EF_MUZZLEFLASH); MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_grenade2 = [ 136.000, gremlin_grenade3 ] {self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_grenade3 = [ 137.000, gremlin_grenade4 ] {self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_grenade4 = [ 138.000, gremlin_grenade5 ] {MonsterFireGrenade(self.origin, self.enemy.origin); self.currentammo = self.currentammo - 1; self.ammo_rockets = self.ammo_rockets -1;}; +void () gremlin_grenade5 = [ 139.000, gremlin_grenade6 ] {}; +void () gremlin_grenade6 = [ 140.000, gremlin_run1 ] {}; + + +void () gremlin_prox1 = [ 135.000, gremlin_prox2 ] { self.effects = (self.effects | EF_MUZZLEFLASH); MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_prox2 = [ 136.000, gremlin_prox3 ] {self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_prox3 = [ 137.000, gremlin_prox4 ] {self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_prox4 = [ 138.000, gremlin_prox5 ] {MonsterFireGrenade(self.origin, self.enemy.origin);self.currentammo = self.currentammo - 1; self.ammo_rockets = self.ammo_rockets -1;}; +void () gremlin_prox5 = [ 139.000, gremlin_prox6 ] {}; +void () gremlin_prox6 = [ 140.000, gremlin_run1 ] {}; + +void () gremlin_multi_grenade1 = [ 135.000, gremlin_multi_grenade2 ] { self.effects = (self.effects | EF_MUZZLEFLASH); MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_multi_grenade2 = [ 136.000, gremlin_multi_grenade3 ] {self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_multi_grenade3 = [ 137.000, gremlin_multi_grenade4 ] {self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void () gremlin_multi_grenade4 = [ 138.000, gremlin_multi_grenade5 ] {MonsterFireGrenade(self.origin, self.enemy.origin);self.currentammo = self.currentammo - 1; self.ammo_multi_rockets = self.ammo_multi_rockets -1;}; +void () gremlin_multi_grenade5 = [ 139.000, gremlin_multi_grenade6 ] {}; +void () gremlin_multi_grenade6 = [ 140.000, gremlin_run1 ] {}; + +void () GremlinFireRocket = { + local vector dir; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 1; + self.ammo_rockets = self.ammo_rockets - 1; + Launch_Missile ((self.origin + '0 0 16'), dir, '0 0 0', CT_PROJ_ARMY, SPEED_RLPLAYER); +}; + +void () gremlin_rocket1 = [ 135.000, gremlin_rocket2 ] {}; +void () gremlin_rocket2 = [ 136.000, gremlin_rocket3 ] {}; +void () gremlin_rocket3 = [ 137.000, gremlin_rocket4 ] {}; +void () gremlin_rocket4 = [ 138.000, gremlin_rocket5 ] {GremlinFireRocket();}; +void () gremlin_rocket5 = [ 139.000, gremlin_rocket6 ] {}; +void () gremlin_rocket6 = [ 140.000, gremlin_run1 ] {}; + +void () GremlinFireMultiRocket = { + local vector dir; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 1; + self.ammo_multi_rockets = self.ammo_multi_rockets - 1; + MultiRocketLaunch (-10.000,FL_SWIM); + MultiRocketLaunch (CONTENT_LAVA,MOVETYPE_WALK); + MultiRocketLaunch (MOVETYPE_FLY,FALSE); + MultiRocketLaunch (MOVETYPE_BOUNCE,TRUE); +}; + +void () gremlin_multi_rocket1 = [ 135.000, gremlin_multi_rocket2 ] {}; +void () gremlin_multi_rocket2 = [ 136.000, gremlin_multi_rocket3 ] {}; +void () gremlin_multi_rocket3 = [ 137.000, gremlin_multi_rocket4 ] {}; +void () gremlin_multi_rocket4 = [ 138.000, gremlin_multi_rocket5 ] {GremlinFireMultiRocket();}; +void () gremlin_multi_rocket5 = [ 139.000, gremlin_multi_rocket6 ] {}; +void () gremlin_multi_rocket6 = [ 140.000, gremlin_run1 ] {}; + +void () GremlinFirePlasma = { + local vector org, dir; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + org = self.origin + '0.000 0.000 16.000'; + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo - 1; + self.ammo_cells = self.ammo_cells - 1; + launch_plasma (org, dir, CT_PROJ_PLASMA, SPEED_PLAYPLASMA); +}; + +void () gremlin_plasma1 = [135.000, gremlin_plasma2] {GremlinFirePlasma();}; +void () gremlin_plasma2 = [135.000, gremlin_run1] {GremlinFirePlasma();}; + +void () GremlinFirePlasmaGun = { + local vector dir; + local entity missile; + + if (self.attack_finished > time) return; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + sound (missile,CHAN_WEAPON,"plasma/flight.wav",TRUE,ATTN_NORM); + self.currentammo = self.currentammo - 1; + sound (self,CHAN_WEAPON,"plasma/fire.wav",0.500,ATTN_NORM); + self.punchangle_x = CONTENT_SOLID; + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "plasma"; + makevectors (self.v_angle); + missile.velocity = aim (self,1250); + missile.velocity = (missile.velocity * 1250); + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = PlasmaTouch; + setmodel (missile,"progs/plasma.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,((self.origin + (v_forward * FL_CLIENT)) + '0.000 0.000 16.000')); + sound (missile,CHAN_WEAPON,"plasma/flight.wav",TRUE,ATTN_NORM); + missile.think = PlasmaGroundOut; + missile.nextthink = (time + MOVETYPE_FLY); + self.attack_finished = time + 0.8; +}; + +void () gremlin_plasmalight1 = [135.000, gremlin_run1] {GremlinFirePlasmaGun();}; + +void () GremlinFireCrossbow = { + local vector org, dir; + + self.currentammo = self.ammo_bolts = self.ammo_bolts - 1; + + dir = normalize ((self.enemy.origin - self.origin)); + self.v_angle = vectoangles (dir); + makevectors (self.v_angle); + dir = ((dir + ((crandom () * 0.100) * v_right)) + ((crandom () * 0.100) * v_up)); + dir = normalize (dir); + sound (self, CHAN_WEAPON, "weapons/crossbow_fire.wav", 1, ATTN_NORM); + self.attack_finished = time + 0.9; + + org = self.origin + '0 0 16'; + if (self.ammo_poison > 0) { + launch_projectile (org, dir, CT_PROJ_BOLT2, SPEED_DCROSS + (skill*SPEED_BOLTSKILL)); + } else { + launch_projectile (org, dir, CT_PROJ_BOLT1, SPEED_DCROSS + (skill*SPEED_BOLTSKILL)); + } +}; + +void () gremlin_crossbow1 = [ 135.000, gremlin_crossbow2 ] {}; +void () gremlin_crossbow2 = [ 136.000, gremlin_crossbow3 ] {}; +void () gremlin_crossbow3 = [ 137.000, gremlin_crossbow4 ] {}; +void () gremlin_crossbow4 = [ 138.000, gremlin_crossbow5 ] { GremlinFireCrossbow(); }; +void () gremlin_crossbow5 = [ 139.000, gremlin_crossbow6 ] {}; +void () gremlin_crossbow6 = [ 140.000, gremlin_run1 ] {}; + +void () gremlin_lunge1 = [ 124.000, gremlin_lunge2 ] { ai_charge (FALSE); }; +void () gremlin_lunge2 = [ 125.000, gremlin_lunge3 ] { ai_charge (FALSE); }; +void () gremlin_lunge3 = [ 126.000, gremlin_lunge4 ] { ai_charge (FALSE); }; +void () gremlin_lunge4 = [ 127.000, gremlin_lunge5 ] { ai_charge (FALSE); }; +void () gremlin_lunge5 = [ 128.000, gremlin_lunge6 ] { ai_charge (FALSE); }; +void () gremlin_lunge6 = [ 129.000, gremlin_lunge7 ] { ai_charge (FALSE); }; +void () gremlin_lunge7 = [ 130.000, gremlin_lunge8 ] { ai_charge (15.000); }; +void () gremlin_lunge8 = [ 131.000, gremlin_lunge9 ] { ai_charge (FALSE); Gremlin_Melee (FALSE); }; +void () gremlin_lunge9 = [ 132.000, gremlin_lunge10 ] { ai_charge (FALSE); }; +void () gremlin_lunge10 = [ 133.000, gremlin_lunge11 ] { ai_charge (FALSE); }; +void () gremlin_lunge11 = [ 134.000, gremlin_run1 ] { ai_charge (FALSE); }; + +void () gremlin_claw1 = [ 60.000, gremlin_claw2 ] { ai_charge (FALSE); }; +void () gremlin_claw2 = [ 61.000, gremlin_claw3 ] { ai_charge (FALSE); }; +void () gremlin_claw3 = [ 62.000, gremlin_claw4 ] { ai_charge (FALSE); }; +void () gremlin_claw4 = [ 63.000, gremlin_claw5 ] { ai_charge (FALSE); }; +void () gremlin_claw5 = [ 64.000, gremlin_claw6 ] { ai_charge (FALSE); }; +void () gremlin_claw6 = [ 65.000, gremlin_claw7 ] { ai_charge (FALSE); Gremlin_Melee (200); }; +void () gremlin_claw7 = [ 66.000, gremlin_claw8 ] { ai_charge (15.000); }; +void () gremlin_claw8 = [ 67.000, gremlin_claw9 ] { ai_charge (FALSE); }; +void () gremlin_claw9 = [ 68.000, gremlin_claw10 ] { ai_charge (FALSE); }; +void () gremlin_claw10 = [ 69.000, gremlin_claw11 ] { ai_charge (FALSE); }; +void () gremlin_claw11 = [ 70.000, gremlin_run1 ] { ai_charge (FALSE); }; + +void () gremlin_gorge1 = [ 71.000, gremlin_gorge2 ] { ai_charge (TRUE); }; +void () gremlin_gorge2 = [ 72.000, gremlin_gorge3 ] { ai_charge (TRUE); }; +void () gremlin_gorge3 = [ 73.000, gremlin_gorge4 ] { ai_charge (FL_SWIM); }; +void () gremlin_gorge4 = [ 74.000, gremlin_gorge5 ] { ai_charge (FALSE); }; +void () gremlin_gorge5 = [ 75.000, gremlin_gorge6 ] { ai_charge (FALSE); }; +void () gremlin_gorge6 = [ 76.000, gremlin_gorge7 ] { ai_charge (FALSE); Gremlin_Gorge (200); }; +void () gremlin_gorge7 = [ 77.000, gremlin_gorge8 ] { ai_charge (FALSE); }; +void () gremlin_gorge8 = [ 78.000, gremlin_gorge9 ] { ai_charge (FALSE); Gremlin_Gorge (-200.000); }; +void () gremlin_gorge9 = [ 79.000, gremlin_gorge10 ] { ai_charge (FALSE); }; +void () gremlin_gorge10 = [ 80.000, gremlin_gorge11 ] { ai_charge (FALSE); }; +void () gremlin_gorge11 = [ 81.000, gremlin_gorge12 ] { ai_charge (FALSE); }; +void () gremlin_gorge12 = [ 82.000, gremlin_gorge13 ] { ai_charge (FALSE); }; +void () gremlin_gorge13 = [ 83.000, gremlin_gorge1 ] { ai_charge (FALSE); }; + +void () gremlin_look1 = [ 90.000, gremlin_look2 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look2 = [ 91.000, gremlin_look3 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look3 = [ 92.000, gremlin_look4 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look4 = [ 93.000, gremlin_look5 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look5 = [ 94.000, gremlin_look6 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look6 = [ 95.000, gremlin_look7 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look7 = [ 96.000, gremlin_look8 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look8 = [ 97.000, gremlin_look9 ] { self.nextthink = (time + 0.200); }; +void () gremlin_look9 = [ 98.000, gremlin_run1 ] { + if ( (self.oldenemy.health > FALSE) ) { + self.enemy = self.oldenemy; + HuntTarget (); + } else { + if ( self.movetarget ) { + self.th_walk (); + } else { + self.th_stand (); + } + } +}; + +void () gremlin_glook1 = [ 141.000, gremlin_glook2 ] {}; +void () gremlin_glook2 = [ 142.000, gremlin_glook3 ] {}; +void () gremlin_glook3 = [ 143.000, gremlin_glook4 ] {}; +void () gremlin_glook4 = [ 144.000, gremlin_glook5 ] {}; +void () gremlin_glook5 = [ 145.000, gremlin_glook6 ] {}; +void () gremlin_glook6 = [ 146.000, gremlin_glook7 ] {}; +void () gremlin_glook7 = [ 147.000, gremlin_glook8 ] {}; +void () gremlin_glook8 = [ 148.000, gremlin_glook9 ] {}; +void () gremlin_glook9 = [ 149.000, gremlin_glook10 ] {}; +void () gremlin_glook10 = [ 150.000, gremlin_glook11 ] {}; +void () gremlin_glook11 = [ 151.000, gremlin_glook12 ] {}; +void () gremlin_glook12 = [ 152.000, gremlin_glook13 ] {}; +void () gremlin_glook13 = [ 153.000, gremlin_glook14 ] {}; +void () gremlin_glook14 = [ 154.000, gremlin_glook15 ] {}; +void () gremlin_glook15 = [ 155.000, gremlin_glook16 ] {}; +void () gremlin_glook16 = [ 156.000, gremlin_glook17 ] {}; +void () gremlin_glook17 = [ 157.000, gremlin_glook18 ] {}; +void () gremlin_glook18 = [ 158.000, gremlin_glook19 ] {}; +void () gremlin_glook19 = [ 159.000, gremlin_glook20 ] {}; +void () gremlin_glook20 = [ 160.000, gremlin_glook20 ] { + DropBackpack (); + self.stoleweapon = FALSE; + if ( (self.oldenemy.health > FALSE) ) { + self.enemy = self.oldenemy; + HuntTarget (); + } else { + if ( self.movetarget ) { + self.th_walk (); + } else { + self.th_stand (); + } + } +}; + +void () gremlin_pain1 = [ 100.000, gremlin_pain2 ] { ai_back (MOVETYPE_STEP); }; +void () gremlin_pain2 = [ 101.000, gremlin_pain3 ] { ai_back (MOVETYPE_STEP); }; +void () gremlin_pain3 = [ 102.000, gremlin_pain4 ] { ai_back (FL_SWIM); }; +void () gremlin_pain4 = [ 103.000, gremlin_run1 ] {}; +void () gremlin_gunpain1 = [ 161.000, gremlin_gunpain2 ] { ai_back (MOVETYPE_STEP); }; +void () gremlin_gunpain2 = [ 162.000, gremlin_gunpain3 ] { ai_back (FL_SWIM); }; +void () gremlin_gunpain3 = [ 163.000, gremlin_run1 ] {}; + +void (entity inflictor, entity attacker, float damage) gremlin_pain = { + local float r; + + if ( (random () < 0.800) ) { + self.gorging = FALSE; + self.enemy = attacker; + FoundTarget (); + } + if ( (self.touch == Gremlin_JumpTouch) ) + return ; + + if ( (self.pain_finished > time) ) + return ; + + self.pain_finished = (time + TRUE); + r = random (); + if ( (r < 0.330) ) { + sound (self,CHAN_VOICE,"grem/pain1.wav",TRUE,ATTN_NORM); + } else { + if ( (r < 0.660) ) { + sound (self,CHAN_VOICE,"grem/pain2.wav",TRUE,ATTN_NORM); + } else { + sound (self,CHAN_VOICE,"grem/pain3.wav",TRUE,ATTN_NORM); + } + } + if (self.stoleweapon) { + gremlin_gunpain1 (); + } else { + gremlin_pain1 (); + } +}; + +void () gremlin_spawn1 = [ 84.000, gremlin_spawn2 ] { self.nextthink = (time + 0.300); self.th_pain = SUB_Null_pain; }; +void () gremlin_spawn2 = [ 85.000, gremlin_spawn3 ] { self.nextthink = (time + 0.300); }; +void () gremlin_spawn3 = [ 86.000, gremlin_spawn4 ] { self.nextthink = (time + 0.300); }; +void () gremlin_spawn4 = [ 87.000, gremlin_spawn5 ] { self.nextthink = (time + 0.300); }; +void () gremlin_spawn5 = [ 88.000, gremlin_spawn6 ] { self.nextthink = (time + 0.300); }; +void () gremlin_spawn6 = [ 89.000, gremlin_run1 ] { self.th_pain = gremlin_pain; }; + +void () gremlin_die1 = [ 104.000, gremlin_die2 ] { sound (self,CHAN_VOICE,"grem/death.wav",TRUE,ATTN_NORM); }; +void () gremlin_die2 = [ 105.000, gremlin_die3 ] { ai_forward (FL_SWIM); }; +void () gremlin_die3 = [ 106.000, gremlin_die4 ] { ai_forward (TRUE); }; +void () gremlin_die4 = [ 107.000, gremlin_die5 ] { ai_forward (FL_SWIM); }; +void () gremlin_die5 = [ 108.000, gremlin_die6 ] { ai_forward (TRUE); }; +void () gremlin_die6 = [ 109.000, gremlin_die7 ] { self.solid = SOLID_NOT; }; +void () gremlin_die7 = [ 110.000, gremlin_die8 ] { ai_forward (FL_SWIM); }; +void () gremlin_die8 = [ 111.000, gremlin_die9 ] { ai_forward (TRUE); }; +void () gremlin_die9 = [ 112.000, gremlin_die10 ] { ai_forward (FL_SWIM);}; +void () gremlin_die10 = [ 113.000, gremlin_die11 ] { ai_forward (TRUE); }; +void () gremlin_die11 = [ 114.000, gremlin_die12 ] { ai_forward (FL_SWIM); }; +void () gremlin_die12 = [ 115.000, gremlin_die12 ] {}; + +void () gremlin_gib = { + sound (self,CHAN_VOICE,"player/udeath.wav",TRUE,ATTN_NORM); + ThrowHead (); + ThrowGib (1,1); + ThrowGib (1,1); + ThrowGib (1,1); +}; + +void () gremlin_flip1 = [ 116.000, gremlin_flip2 ] { + ai_face (); + makevectors (self.angles); + self.origin_z = (self.origin_z + TRUE); + self.velocity = ('0.000 0.000 350.000' - (v_forward * 200)); + if ( (self.flags & FL_ONGROUND) ) + self.flags = (self.flags - FL_ONGROUND); + + sound (self,CHAN_VOICE,"grem/death.wav",TRUE,ATTN_NORM); +}; +void () gremlin_flip2 = [ 117.000, gremlin_flip3 ] { ai_face (); }; +void () gremlin_flip3 = [ 118.000, gremlin_flip4 ] {}; +void () gremlin_flip4 = [ 119.000, gremlin_flip5 ] {}; +void () gremlin_flip5 = [ 120.000, gremlin_flip6 ] {}; +void () gremlin_flip6 = [ 121.000, gremlin_flip7 ] { self.touch = Gremlin_FlipTouch; }; +void () gremlin_flip7 = [ 122.000, gremlin_gib ] { self.nextthink = (time + MOVETYPE_WALK); }; +void () gremlin_flip8 = [ 123.000, gremlin_flip8 ] { self.solid = SOLID_NOT; }; + +void () gremlin_die = { + local vector vec; + local float dot; + + if ( self.items || self.items2 ) { + DropBackpack (); + self.stoleweapon = FALSE; + } + makevectors (self.angles); + vec = normalize ((damage_attacker.origin - self.origin)); + dot = (vec * v_forward); + if ( (self.health < -35.000) ) { + sound (self,CHAN_VOICE,"player/udeath.wav",TRUE,ATTN_NORM); + ThrowHead (); + ThrowGib (1,1); + ThrowGib (1,1); + ThrowGib (1,1); + return ; + } else { + if ( (((dot > 0.700) && (random () < 0.500)) && (self.flags & FL_ONGROUND)) ) { + gremlin_flip1 (); + return ; + } + } + gremlin_die1 (); +}; + +void () Gremlin_MeleeAttack = { + local float num; + + if (self.gorging) { + gremlin_gorge1 (); + } else { + if ( (self.stoleweapon == TRUE) ) { + objerror ("gremlin meleeing with stolen weapon"); + } else { + if ( ((self.enemy.flags & FL_CLIENT) && (random () < 0.400)) ) { + if ( GremlinAttemptWeaponSteal () ) + return ; + } + } + num = random (); + if ( (num < 0.300) ) { + gremlin_claw1 (); + } else { + if ( (num < 0.600) ) { + gremlin_lunge1 (); + } else { + gremlin_claw1 (); + } + } + } +}; + +float () GremlinCheckNoAmmo = { + if ( (self.currentammo > FALSE) ) { + return (TRUE); + } else { + self.stoleweapon = FALSE; + return (FALSE); + } +}; +entity () GremlinFindVictim = { + local entity head; + local entity selected; + local float dist; + local float head_dist; + + self.search_time = (time + TRUE); + selected = world; + dist = 1000.000; + head = findradius (self.origin,1000.000); + while ( head ) { + if ( (!(head.flags & FL_NOTARGET) && ((head.flags & FL_MONSTER) || (head.flags & FL_CLIENT))) ) { + visible (head); + if ( ((visible (head) && (head.health > FALSE)) && (head != self)) ) { + head_dist = vlen ((head.origin - self.origin)); + if ( (head == self.lastvictim) ) + head_dist = (head_dist * FL_SWIM); + + if ( (head.flags & FL_CLIENT) ) + head_dist = (head_dist / 1.500); + + if ( (head.classname == self.classname) ) + head_dist = (head_dist * 1.500); + + if ( (head_dist < dist) ) { + selected = head; + dist = head_dist; + } + } + } + head = head.chain; + } + self.lastvictim = selected; + return ( selected ); +}; + +float () GremlinWeaponAttack = { + if (!GremlinCheckNoAmmo()) + return (FALSE); + + self.show_hostile = (time + TRUE); + if (self.weapon == IT_SHOTGUN) { + gremlin_shot1 (); + W_FireShotgun(); + SUB_AttackFinished(TRUE); + } else { + if ( (self.weapon == IT_SUPER_SHOTGUN) ) { + gremlin_shot1 (); + W_FireSuperShotgun (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_NAILGUN) ) { + gremlin_nail1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_LAVA_NAILGUN) ) { + gremlin_lava_nail1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_SUPER_NAILGUN) ) { + gremlin_snail1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_LAVA_SUPER_NAILGUN) ) { + gremlin_lava_snail1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_GRENADE_LAUNCHER) ) { + gremlin_grenade1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT2_PROXIMITY_GUN) ) { + gremlin_prox1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_MULTI_GRENADE) ) { + gremlin_multi_grenade1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_ROCKET_LAUNCHER) ) { + gremlin_rocket1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_MULTI_ROCKET) ) { + gremlin_multi_rocket1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_LIGHTNING) ) { + if (self.moditems & IT_UPGRADE_LG) { + gremlin_plasma1(); + } else { + gremlin_light1 (); + sound (self,CHAN_AUTO,"weapons/lstart.wav",TRUE,ATTN_NORM); + } + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_PLASMA_GUN) ) { + gremlin_plasmalight1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT2_LASER_CANNON) ) { + gremlin_laser1 (); + SUB_AttackFinished (TRUE); + } else { + if ( (self.weapon == IT_EXTRA_WEAPON) ) { + gremlin_crossbow1 (); + SUB_AttackFinished (TRUE); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return ( TRUE ); +}; + +void () Gremlin_MissileAttack = { + if ( self.stoleweapon ) { + if ( GremlinWeaponAttack () ) { + return ; + } else { + if ( ((random () < 0.100) && (self.flags & FL_ONGROUND)) ) { + gremlin_jump1 (); + return ; + } + } + } + if ( (self.flags & FL_ONGROUND) ) + gremlin_jump1 (); // jumpy little buggers +}; + +void() GremlinCheckAttack; + +void () gremlin_setup = { + self.mdl = "progs/hipnotic/grem.mdl"; + self.headmdl = "progs/hipnotic/h_grem.mdl"; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.items = FALSE; + self.items2 = FALSE; + setmodel (self,"progs/hipnotic/grem.mdl"); + setsize (self,VEC_HULL_MIN,VEC_HULL_MAX); + self.health = 100.000; + self.pain_flinch = 50; + self.max_health = 101.000; + self.yaw_speed = 40.000; + self.th_stand = gremlin_stand1; + self.th_walk = gremlin_walk1; + self.th_run = gremlin_run1; + self.th_die = gremlin_die; + self.th_melee = Gremlin_MeleeAttack; + self.th_missile = Gremlin_MissileAttack; + self.th_checkattack = GremlinCheckAttack; + self.th_pain = gremlin_pain; + self.takedamage = DAMAGE_AIM; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if(!self.classtype) self.classtype = CT_MONGREMLIN; + if (!self.classgroup) self.classgroup = CG_MONSTERS; // Same team as fiends, droles, minotaurs, boglords, lichfiend, hephaestus + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was outsmarted by a Gremlin\n"; + + monster_start(); +}; + +void () monster_gremlin = { + if ( deathmatch ) { remove (self); return; } + + self.mdl = "progs/hipnotic/grem.mdl"; + self.headmdl = "progs/hipnotic/h_grem.mdl"; + precache_model ("progs/hipnotic/grem.mdl"); + precache_model ("progs/hipnotic/h_grem.mdl"); + precache_sound ("grem/death.wav"); + precache_sound ("grem/attack.wav"); + precache_sound ("demon/djump.wav"); + precache_sound ("demon/dhit2.wav"); + precache_sound ("grem/pain1.wav"); + precache_sound ("grem/pain2.wav"); + precache_sound ("grem/pain3.wav"); + precache_sound ("grem/idle.wav"); + precache_sound ("grem/sight1.wav"); + precache_sound ("enforcer/enfstop.wav"); + + gremlin_setup(); +}; + +void () GremlinCheckAttack = { + local vector spot1; + local vector spot2; + local entity targ; + local float chance; + + targ = self.enemy; + if ( (time < self.attack_finished) ) + return; + + spot1 = self.origin; + spot2 = targ.origin; + if ( ((vlen ((spot2 - spot1)) <= 90.000) && (self.stoleweapon == FALSE)) ) { + self.attack_state = AS_MELEE; + return; + } + chance = (0.030 + self.stoleweapon); + //if ( (random () < chance) ) { + if (self.stoleweapon) { + self.attack_state = AS_MISSILE; + return; + } + return; +}; + +void (float side) Gremlin_Melee = { + local float ldmg; + local vector delta; + + ai_face (); + delta = (self.enemy.origin - self.origin); + if ( (vlen (delta) > 100.000) ) + return ; + + if ( !CanDamage (self.enemy,self) ) + return ; + + sound (self,CHAN_WEAPON,"grem/attack.wav",TRUE,ATTN_NORM); + ldmg = (MOVETYPE_BOUNCE + (MOVETYPE_FLY * random ())); + T_Damage (self.enemy,self,self,ldmg,DAMARMOR); + SpawnMeatSpray (self,self.enemy,side); +}; + + +void (entity targ, entity inflictor, entity attacker, float damage) Gremlin_Damage_Corpse = { + if ( (targ.flags & FL_GODMODE) ) + return ; + + if ( (targ.invincible_finished >= time) ) { + if ( (self.invincible_sound < time) ) { + sound (targ,CHAN_ITEM,"items/protect3.wav",TRUE,ATTN_NORM); + self.invincible_sound = (time + FL_SWIM); + } + return ; + } + if ( (((teamplay == TRUE) && (targ.team > FALSE)) && (targ.team == attacker.team)) ) + return ; + + targ.health = (targ.health - damage); +}; + + +void () Gremlin_Split = { + local entity grem; + local entity temp; + local entity head; + local float done; + local vector ang; + local float c; + local vector pos; + local float proceed; + + done = FALSE; + c = FALSE; + ang = self.angles; + while ( (done == FALSE) ) { + makevectors (ang); + pos = (self.origin + (80.000 * v_forward)); + head = findradius (pos,35.000); + proceed = TRUE; + while ( head ) { + if ( ((head.health > FALSE) && (head.flags & (FL_MONSTER | FL_CLIENT))) ) + proceed = FALSE; + + head = head.chain; + } + traceline (self.origin,pos,FALSE,self); + if ( ((trace_fraction == TRUE) && (proceed == TRUE)) ) { + traceline (self.origin,(pos - '40.000 40.000 0.000'),FALSE,self); + if ( (trace_fraction == TRUE) ) { + traceline (self.origin,(pos + '40.000 40.000 0.000'),FALSE,self); + if ( (trace_fraction == TRUE) ) { + traceline (self.origin,(pos + '0.000 0.000 64.000'),FALSE,self); + if ( (trace_fraction == TRUE) ) { + traceline (self.origin,(pos - '0.000 0.000 64.000'),FALSE,self); + if ( (trace_fraction != TRUE) ) + done = TRUE; + } + } + } + } + if ( (done == FALSE) ) { + ang_y = (ang_y + 36.000); + c = (c + TRUE); + if ( (c == MOVETYPE_BOUNCE) ) + return ; + } + } + grem = spawn (); + setorigin (grem,pos); + temp = self; + self = grem; + gremlin_setup(); + gremlin_spawn1 (); + self.enemy = world; + self.gorging = FALSE; + self = temp; + update_hud_totals(HUD_MONSTERS); +}; + +void (float side) Gremlin_Gorge = { + local float ldmg; + local vector delta; + local entity temp; + + delta = (self.enemy.origin - self.origin); + sound (self,CHAN_WEAPON,"demon/dhit2.wav",TRUE,ATTN_NORM); + ldmg = (MOVETYPE_PUSH + (MOVETYPE_FLY * random ())); + Gremlin_Damage_Corpse (self.enemy,self,self,ldmg); + SpawnMeatSpray (self, self.enemy,side); + if ( (self.enemy.health < -200.000) ) { + if ( (self.enemy.gorging == FALSE) ) { + self.enemy.gorging = TRUE; + sound (self,CHAN_VOICE,"player/udeath.wav",TRUE,ATTN_NORM); + temp = self; + self = self.enemy; + monster_ThrowGib(); + self = temp; + ldmg = (150 + (100.000 * random ())); + T_Heal (self,ldmg,FALSE); + Gremlin_Split (); + } + self.enemy = world; + self.gorging = FALSE; + gremlin_look1 (); + } +}; + +void () Gremlin_JumpTouch = { + if ( (self.health <= FALSE) ) + return ; + + if ( !checkbottom (self) ) { + if ( (self.flags & FL_ONGROUND) ) { + self.touch = SUB_Null; + self.think = gremlin_jump1; + self.nextthink = (time + 0.100); + } + return ; + } + self.touch = SUB_Null; + self.think = gremlin_jump12; + self.nextthink = (time + 0.100); +}; + +void () Gremlin_FlipTouch = { + if ( !checkbottom (self) ) { + if ( (self.flags & FL_ONGROUND) ) { + self.touch = SUB_Null; + self.think = gremlin_flip1; + self.nextthink = (time + 0.100); + } + return ; + } + self.touch = SUB_Null; + self.think = gremlin_flip8; + self.nextthink = (time + 0.100); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_gug.qc b/QC_other/QC_keep/mon_gug.qc new file mode 100644 index 00000000..b3dfbfe9 --- /dev/null +++ b/QC_other/QC_keep/mon_gug.qc @@ -0,0 +1,936 @@ +void() gug_shake_think = { + self.nextthink = time + 0.010000; + self.think = gug_shake_think; + self.spawnmaster.punchangle_x = (time - self.ltime) * random() * 10; + self.spawnmaster.punchangle_y = (time - self.ltime) * random() * 10; + self.spawnmaster.punchangle_z = (time - self.ltime) * random() * 10; + if (self.ltime < time) + SUB_Remove(); +}; + +void(float stime, entity eshake) gug_screen_shake = { + local entity qent; + qent = spawn(); + qent.owner = self; + qent.movetype = MOVETYPE_NONE; + qent.solid = SOLID_NOT; + qent.spawnmaster = eshake; + qent.nextthink = time + 0.010000; + qent.think = gug_shake_think; + qent.ltime = time + stime; + setsize(qent, VEC_ORIGIN, VEC_ORIGIN); + setorigin(qent, self.origin); +}; + +float(float num) mrandom = { return 0.5 * num - num * random(); }; + +float() CheckGugAttack = { + local vector spot1; + local vector spot2; + local entity targ; + local float chance; + local float dist; + + if (!visible(self.enemy) && self.carry_time > 8 && self.t_width < time) { + self.th_novis(); + return 1; + } + dist = vlen(self.enemy.origin - self.origin); + targ = self.enemy; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline(spot1, spot2, 0, self); + if (trace_ent != targ) + return 0; + + if (trace_inopen && trace_inwater) + return 0; + + if (dist < 170) { + self.th_melee(); + return 1; + } + + if (time < self.attack_finished) + return 0; + + if (dist > 1200) + return 0; + + if (dist >= 600) { + chance = 0.9; + self.attack_finished = 0; + } else { + if (dist >= 400) { + chance = 0.8; + } else { + if (dist >= 250) { + chance = 0.8; + } else { + if (dist >= 170) { + chance = 0.2; + } else { + chance = 0; + } + } + } + } + if (random() < chance) { + self.th_missile(); + SUB_AttackFinished(2.3 + 0.3 * random()); + return 1; + } + return 0; +}; + +void(float dist) ai_gug_run = { + if (!visible(self.enemy)) + self.carry_time = self.carry_time + 0.1; + + if (visible(self.enemy)) + self.carry_time = 0; + + movedist = dist; + if (self.enemy.health <= 0) { + self.enemy = world; + if (self.oldenemy.health > 0) { + self.enemy = self.oldenemy; + HuntTarget(); + } else { + if (self.movetarget) { + self.th_walk(); + } else { + self.th_stand(); + } + return; + } + } + self.show_hostile = time + 1; + enemy_vis = visible(self.enemy); + if (enemy_vis) + self.search_time = time + 5; + + if (coop && self.search_time < time) { + if (FindTarget()) + return; + } + enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + if (self.attack_state == AS_MISSILE) { + ai_run_missile(); + return; + } + if (self.attack_state == AS_MELEE) { + ai_run_melee(); + return; + } + if (CheckGugAttack()) + return; + + ai_shotcheck(); + movetogoal(dist); +}; + +void() gug_stand1 = [2, gug_stand2] { ai_stand(); }; +void() gug_stand2 = [3, gug_stand3] { ai_stand(); }; +void() gug_stand3 = [4, gug_stand4] { ai_stand(); }; +void() gug_stand4 = [5, gug_stand5] { ai_stand(); }; +void() gug_stand5 = [6, gug_stand6]{ ai_stand(); }; +void() gug_stand6 = [7, gug_stand7]{ai_stand();}; +void() gug_stand7 = [8, gug_stand8]{ai_stand();}; +void() gug_stand8 = [9, gug_stand9]{ai_stand();}; +void() gug_stand9 = [10, gug_stand10]{ai_stand();}; +void() gug_stand10 = [11, gug_stand11]{ai_stand();}; +void() gug_stand11 = [12, gug_stand12]{ai_stand();}; +void() gug_stand12 = [13, gug_stand13]{ai_stand();}; +void() gug_stand13 = [14, gug_stand14]{ai_stand();}; +void() gug_stand14 = [15, gug_stand15]{ai_stand();}; +void() gug_stand15 = [16, gug_stand16]{ai_stand();}; +void() gug_stand16 = [17, gug_stand17]{ai_stand();}; +void() gug_stand17 = [18, gug_stand18]{ai_stand();}; +void() gug_stand18 = [19, gug_stand19]{ai_stand();}; +void() gug_stand19 = [20, gug_stand20]{ai_stand();}; +void() gug_stand20 = [21, gug_choosestand]{ai_stand();}; +void() gug_stand21 = [22, gug_stand22]{ai_stand();}; +void() gug_stand22 = [23, gug_stand23]{ai_stand();}; +void() gug_stand23 = [24, gug_stand24]{ai_stand();}; +void() gug_stand24 = [25, gug_stand25]{ai_stand();}; +void() gug_stand25 = [26, gug_stand26]{ai_stand();}; +void() gug_stand26 = [27, gug_stand27]{ai_stand();}; +void() gug_stand27 = [28, gug_stand28]{ai_stand();}; +void() gug_stand28 = [29, gug_stand29]{ai_stand();}; +void() gug_stand29 = [30, gug_stand30]{ai_stand();}; +void() gug_stand30 = [31, gug_stand31]{ai_stand();}; +void() gug_stand31 = [32, gug_stand32]{ai_stand();}; +void() gug_stand32 = [33, gug_stand33]{ai_stand();}; +void() gug_stand33 = [34, gug_stand34]{ai_stand();}; +void() gug_stand34 = [35, gug_stand35]{ ai_stand();}; +void() gug_stand35 = [36, gug_stand36]{ai_stand();}; +void() gug_stand36 = [37, gug_stand37]{ai_stand();}; +void() gug_stand37 = [38, gug_stand38]{ai_stand();}; +void() gug_stand38 = [39, gug_stand39]{ai_stand();}; +void() gug_stand39 = [40, gug_stand40]{ai_stand();}; +void() gug_stand40 = [41, gug_choosestand]{ai_stand();}; +void() gug_stand41 = [42, gug_stand42]{ai_stand();}; +void() gug_stand42 = [43, gug_stand43]{ai_stand();}; +void() gug_stand43 = [44, gug_stand44]{ai_stand();}; +void() gug_stand44 = [45, gug_stand45]{ai_stand();}; +void() gug_stand45 = [46, gug_stand46]{ai_stand();}; +void() gug_stand46 = [47, gug_stand47]{ai_stand();}; +void() gug_stand47 = [48, gug_stand48]{ai_stand();}; +void() gug_stand48 = [49, gug_stand49]{ai_stand();}; +void() gug_stand49 = [50, gug_stand50]{ai_stand();}; +void() gug_stand50 = [51, gug_stand51]{ai_stand();}; +void() gug_stand51 = [52, gug_stand52]{ai_stand();}; +void() gug_stand52 = [53, gug_stand53]{ai_stand();}; +void() gug_stand53 = [54, gug_stand54]{ai_stand();}; +void() gug_stand54 = [55, gug_stand55]{ai_stand();}; +void() gug_stand55 = [56, gug_stand56]{ai_stand();}; +void() gug_stand56 = [57, gug_stand57]{ai_stand();}; +void() gug_stand57 = [58, gug_stand58]{ai_stand();}; +void() gug_stand58 = [59, gug_stand59]{ai_stand();}; +void() gug_stand59 = [60, gug_stand60]{ai_stand();}; +void() gug_stand60 = [61, gug_choosestand]{ai_stand();}; +void() gug_stand61 = [62, gug_stand62]{ai_stand();}; +void() gug_stand62 = [63, gug_stand63]{ai_stand();}; +void() gug_stand63 = [64, gug_stand64]{ai_stand();}; +void() gug_stand64 = [65, gug_stand65]{ai_stand();}; +void() gug_stand65 = [66, gug_stand66]{ai_stand();}; +void() gug_stand66 = [67, gug_stand67]{ai_stand();}; +void() gug_stand67 = [68, gug_stand68]{ai_stand();}; +void() gug_stand68 = [69, gug_stand69]{ai_stand();}; +void() gug_stand69 = [70, gug_stand70]{ai_stand();}; +void() gug_stand70 = [71, gug_stand71]{ai_stand();}; +void() gug_stand71 = [72, gug_stand72]{ai_stand();}; +void() gug_stand72 = [73, gug_stand73]{ai_stand();}; +void() gug_stand73 = [74, gug_stand74]{ai_stand();}; +void() gug_stand74 = [75, gug_stand75]{ai_stand();}; +void() gug_stand75 = [76, gug_stand76]{ai_stand();}; +void() gug_stand76 = [77, gug_stand77]{ai_stand();}; +void() gug_stand77 = [78, gug_stand78]{ai_stand();}; +void() gug_stand78 = [79, gug_stand79]{ai_stand();}; +void() gug_stand79 = [80, gug_stand80]{ai_stand();}; +void() gug_stand80 = [81, gug_choosestand]{ai_stand();}; + +void() gug_choosestand = { + local float rnd; + if (random() < 0.3) + sound(self, CHAN_FEET, self.idle_sound, 1, 0.7); + + rnd = random(); + if (rnd < 0.25) { + gug_stand1(); + } else { + if (rnd < 0.5) { + gug_stand21(); + } else { + if (rnd < 0.75) { + gug_stand41(); + } else { + gug_stand61(); + } + } + } +}; + +void() gug_step_sound = { + local float rnd; + local entity head; + + rnd = random(); + if (rnd < 0.25) { + sound(self, CHAN_FEET, "gug/step1.wav", 1, 0.7); + } else { + if (rnd < 0.5) { + sound(self, CHAN_FEET, "gug/step2.wav", 1, 0.7); + } else { + if (rnd < 0.75) { + sound(self, CHAN_FEET, "gug/step3.wav", 1, 0.7); + } else { + sound(self, CHAN_FEET, "gug/step4.wav", 1, 0.7); + } + } + } + head = find(self.enemy, classname, "player"); + if (head.classname == "player" && vlen(head.origin - self.origin) < 150) + gug_screen_shake(0.2, head); +}; + +void() gug_walk1 = [82, gug_walk2] { ai_walk(8); gug_step_sound(); }; +void() gug_walk2 = [83, gug_walk3] { ai_walk(8); }; +void() gug_walk3 = [84, gug_walk4] { ai_walk(7); }; +void() gug_walk4 = [85, gug_walk5] { ai_walk(6); }; +void() gug_walk5 = [86, gug_walk6] { ai_walk(5); }; +void() gug_walk6 = [87, gug_walk7] { ai_walk(4); }; +void() gug_walk7 = [88, gug_walk8] { ai_walk(3); }; +void() gug_walk8 = [89, gug_walk9] { ai_walk(2); }; +void() gug_walk9 = [90, gug_walk10] { ai_walk(8); gug_step_sound(); }; +void() gug_walk10 = [91, gug_walk11] { ai_walk(8); }; +void() gug_walk11 = [92, gug_walk12] { ai_walk(7); }; +void() gug_walk12 = [93, gug_walk13] { ai_walk(6); }; +void() gug_walk13 = [94, gug_walk14] { ai_walk(5); }; +void() gug_walk14 = [95, gug_walk15] { ai_walk(4); }; +void() gug_walk15 = [96, gug_walk16] { ai_walk(3); }; +void() gug_walk16 = [97, gug_walk1] { ai_walk(2); }; + +void() gug_run1 = [98, gug_run2] { ai_gug_run(22); gug_step_sound(); }; +void() gug_run2 = [99, gug_run3] { ai_gug_run(20); }; +void() gug_run3 = [100, gug_run4] { ai_gug_run(18); }; +void() gug_run4 = [101, gug_run5] { ai_gug_run(16); }; +void() gug_run5 = [102, gug_run6] { ai_gug_run(22); gug_step_sound(); }; +void() gug_run6 = [103, gug_run7] { ai_gug_run(20); }; +void() gug_run7 = [104, gug_run8] { ai_gug_run(18); }; +void() gug_run8 = [105, gug_run1] { ai_gug_run(16); }; + +void(float dist, float yawspd) ai_gug_swing = { + self.yaw_speed = yawspd; + ai_face(); + movetogoal(dist); + self.yaw_speed = 15; +}; + +void() gug_dummy_think = { + self.owner.gug_slapped = 0; + self.owner.spawnmaster = world; + self.owner.velocity = self.velocity; + self.nextthink = time + 0.1; + self.think = SUB_Remove; +}; + +void(float dist, float power, float clawdmg, float stime) gug_hit = { + local float edist; + local entity head; + local vector vec; + local vector vec2; + local vector vecA; + local vector vecB; + local entity dummy; + + head = findradius(self.origin, dist); + while (head) { + if (visible(head) && (head.flags & FL_CLIENT || (head.flags & FL_MONSTER)) && head != self && head.health > 0) { + makevectors(self.angles); + vec = v_forward * 100; + vec2 = head.origin - self.origin; + vec2 = normalize(vec2); + vec2 = vec2 * 100; + vecA = self.origin + vec; + vecB = self.origin + vec2; + edist = vlen(vecA - vecB); + if (edist < 100) { + vec = head.origin - self.origin; + vec = normalize(vec); + vec = vec * power; + vec_z = 330; + if (head.classname == "monster_shambler") { + vec = vec * 0.3; + } else { + if (head.classname == "monster_drole") { + vec = vec * 0.4; + } else { + if (head.classname == "monster_shalrath") { + vec = vec * 0.7; + } else { + if (head.classname == "monster_gug") { + vec = vec * 0.1; + } else { + if (head.classname == "monster_cyaegha" || head.classname == "monster_vermis" || head.classname == "monster_edie") { + vec = vec * 0; + } + } + } + } + } + if (head == self.enemy) { + T_Damage(head, self, self, clawdmg,DAMARMOR); + } else { + T_Damage(head, self, self, clawdmg * 0.25,DAMARMOR); + } + if (self.gug_slapped == 0) { + sound(self, CHAN_WEAPON, "shambler/smack.wav", 1, ATTN_NORM); + self.gug_slapped = 1; + } + if (head.classname == "player") { + head.gug_slapped = 1; + if (head.health <= 0) { + head.velocity = head.velocity + vec; + } else { + dummy = spawn(); + setsize(dummy, VEC_HULL_MIN, '16 16 40'); + setorigin(dummy, head.origin + '0 0 1'); + dummy.movetype = MOVETYPE_TOSS; + dummy.nextthink = time + 0.1; + dummy.think = gug_dummy_think; + dummy.touch = gug_dummy_think; + dummy.owner = head; + dummy.classname = "dummy"; + head.spawnmaster = dummy; + if (dummy.flags & FL_ONGROUND) + dummy.flags = dummy.flags - FL_ONGROUND; + + dummy.velocity = head.velocity * 0.5 + vec; + if (vlen(dummy.velocity) > 600) { + dummy.velocity = normalize(dummy.velocity); + dummy.velocity = dummy.velocity * 600; + } + if (head.velocity_z > 400) + dummy.velocity_z = 400; + } + } else { + if (head.flags & FL_ONGROUND) + head.flags = head.flags - FL_ONGROUND; + + head.velocity = head.velocity + vec * 1; + } + } + } + head = head.chain; + } + self.gug_slapped = 0; +}; + +void() gug_swingl1 = [106, gug_swingl2] { ai_gug_swing(22, 25); gug_step_sound(); }; +void() gug_swingl2 = [107, gug_swingl3] { ai_gug_swing(20, 26); }; +void() gug_swingl3 = [108, gug_swingl4] { ai_gug_swing(18, 25); sound(self, CHAN_WEAPON, "gug/throw.wav", 1, ATTN_NORM); }; +void() gug_swingl4 = [109, gug_swingl5] { ai_gug_swing(16, 25); }; +void() gug_swingl5 = [110, gug_swingl6] { ai_gug_swing(18, 24); gug_step_sound(); }; +void() gug_swingl6 = [111, gug_swingl7] { ai_gug_swing(16, 24); }; +void() gug_swingl7 = [112, gug_swingl8] { ai_gug_swing(14, 25); }; +void() gug_swingl8 = [113, gug_swingl9] { ai_gug_swing(10, 25); gug_hit(150, 300, 35, 0.6); }; +void() gug_swingl9 = [114, gug_swingl10] { ai_gug_swing(6, 10); }; +void() gug_swingl10 = [115, gug_swingl11] { ai_gug_swing(2, 11); }; +void() gug_swingl11 = [116, gug_swingl12] { ai_gug_swing(1, 10); }; +void() gug_swingl12 = [117, gug_swingl13] { ai_gug_swing(1, 12); }; +void() gug_swingl13 = [118, gug_swingl14] { + local float dist; + + ai_gug_swing(1, 11); + dist = vlen(self.enemy.origin - self.origin); + if (dist > 170) + self.think = gug_run1; +}; +void() gug_swingl14 = [119, gug_swingl15] { ai_gug_swing(1, 14); sound(self, CHAN_BODY, "gug/throw.wav", 1, ATTN_NORM); }; +void() gug_swingl15 = [120, gug_swingl16] { ai_gug_swing(1, 25); }; +void() gug_swingl16 = [121, gug_swingl17] { ai_gug_swing(2, 27); }; +void() gug_swingl17 = [122, gug_swingl18] { ai_gug_swing(22, 28); gug_step_sound(); }; +void() gug_swingl18 = [123, gug_swingl19] { ai_gug_swing(20, 27); gug_hit(150, 500, 45, 0.9); }; +void() gug_swingl19 = [124, gug_swingl20] { ai_gug_swing(18, 26); }; +void() gug_swingl20 = [125, gug_swingl21] { ai_gug_swing(16, 22); }; +void() gug_swingl21 = [126, gug_swingl22] { ai_gug_swing(22, 21); gug_step_sound(); }; +void() gug_swingl22 = [127, gug_swingl23] { ai_gug_swing(20, 21); }; +void() gug_swingl23 = [128, gug_run1] { ai_gug_swing(18, 20); }; + +void() gug_swingr1 = [129, gug_swingr2] { ai_gug_swing(22, 25); gug_step_sound(); }; +void() gug_swingr2 = [130, gug_swingr3] { ai_gug_swing(20, 26); }; +void() gug_swingr3 = [131, gug_swingr4] { ai_gug_swing(18, 25); sound(self, CHAN_BODY, "gug/throw.wav", 1, ATTN_NORM); }; +void() gug_swingr4 = [132, gug_swingr5] { ai_gug_swing(16, 25); }; +void() gug_swingr5 = [133, gug_swingr6] { ai_gug_swing(18, 24); gug_step_sound(); }; +void() gug_swingr6 = [134, gug_swingr7] { ai_gug_swing(16, 24); }; +void() gug_swingr7 = [135, gug_swingr8] { ai_gug_swing(14, 25); }; +void() gug_swingr8 = [136, gug_swingr9] { ai_gug_swing(10, 25); gug_hit(150, 300, 35, 0.6); }; +void() gug_swingr9 = [137, gug_swingr10] { ai_gug_swing(6, 10); }; +void() gug_swingr10 = [138, gug_swingr11] { ai_gug_swing(2, 11); }; +void() gug_swingr11 = [139, gug_swingr12] { ai_gug_swing(1, 10); }; +void() gug_swingr12 = [140, gug_swingr13] { ai_gug_swing(1, 12); }; +void() gug_swingr13 = [141, gug_swingr14] { + local float dist; + + ai_gug_swing(1, 11); + dist = vlen(self.enemy.origin - self.origin); + if (dist > 170) { + self.think = gug_run1; + } +}; +void() gug_swingr14 = [142, gug_swingr15] { ai_gug_swing(1, 14); sound(self, CHAN_WEAPON, "gug/throw.wav", 1, ATTN_NORM); }; +void() gug_swingr15 = [143, gug_swingr16] { ai_gug_swing(1, 25); }; +void() gug_swingr16 = [144, gug_swingr17] { ai_gug_swing(2, 27); }; +void() gug_swingr17 = [145, gug_swingr18] { ai_gug_swing(22, 28); gug_step_sound(); }; +void() gug_swingr18 = [146, gug_swingr19] { ai_gug_swing(20, 27); gug_hit(150, 500, 45, 0.9); }; +void() gug_swingr19 = [147, gug_swingr20] { ai_gug_swing(18, 26); }; +void() gug_swingr20 = [148, gug_swingr21] { ai_gug_swing(16, 22); }; +void() gug_swingr21 = [149, gug_swingr22] { ai_gug_swing(22, 21); gug_step_sound(); }; +void() gug_swingr22 = [150, gug_swingr23] { ai_gug_swing(20, 21); }; +void() gug_swingr23 = [151, gug_run1] { ai_gug_swing(18, 20); }; + +void() bile_expl1 = [0, bile_expl2] {}; +void() bile_expl2 = [1, bile_expl3] {}; +void() bile_expl3 = [2, bile_expl4] {}; +void() bile_expl4 = [3, bile_expl5] {}; +void() bile_expl5 = [4, bile_expl6] {}; +void() bile_expl6 = [5, SUB_Remove] {}; + +void() BecomeBileExplosion = { + self.movetype = MOVETYPE_NONE; + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + setmodel(self, "progs/greenexp.spr"); + self.solid = SOLID_NOT; + bile_expl1(); +}; + +void() BileFragTouch = { + local vector org; + + if (other == self.owner) + return; + + if (pointcontents(self.origin) == CONTENT_SKY) { + remove(self); + return; + } + org = self.origin - 8 * normalize(self.velocity); + if (other.takedamage) { + T_Damage(other, self, self.owner, 20,DAMARMOR); + T_RadiusDamage(self, self.owner, 60, other,DAMAGEALL); + } else { + if (self.nextthink > time) + return; + + T_RadiusDamage(self, self.owner, 60, world,DAMAGEALL); + } + WriteByte(0, SVC_TEMPENTITY); + WriteByte(0, 12); + WriteCoord(0, org_x); + WriteCoord(0, org_y); + WriteCoord(0, org_z); + WriteByte(0, 240); + WriteByte(0, AS_MELEE); + sound(self, CHAN_WEAPON, "gug/bile.wav", 0.5 + 0.5 * random(), 0.8); + BecomeBileExplosion(); +}; + +void() BileBombTouch = { + local vector org; + local float bcnt; + local entity missile; + + if (other == self.owner) + return; + + if (pointcontents(self.origin) == CONTENT_SKY) { + remove(self); + return; + } + org = self.origin - 8 * normalize(self.velocity); + if (other.takedamage) { + T_Damage(other, self, self.owner, 25,DAMARMOR); + T_RadiusDamage(self, self.owner, 85, other,DAMAGEALL); + } else { + T_RadiusDamage(self, self.owner, 85, world,DAMAGEALL); + } + while (bcnt < 5) { + bcnt = bcnt + 1; + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + makevectors(self.angles); + missile.velocity_x = mrandom(1000); + missile.velocity_y = mrandom(1000); + missile.velocity_z = 250 + 100 * random(); + missile.avelocity = '300 300 300'; + missile.angles = vectoangles(missile.velocity); + missile.touch = BileFragTouch; + missile.owner = self.owner; + missile.nextthink = time + 0.2 + 0.4 * random(); + missile.think = BileFragTouch; + setmodel(missile, "progs/bilefrag.mdl"); + setsize(missile, VEC_ORIGIN, VEC_ORIGIN); + setorigin(missile, self.origin); + } + WriteByte(0, SVC_TEMPENTITY); + WriteByte(0, 12); + WriteCoord(0, org_x); + WriteCoord(0, org_y); + WriteCoord(0, org_z); + WriteByte(0, 240); + WriteByte(0, AS_MELEE); + sound(self, CHAN_WEAPON, "gug/bile.wav", 1, 0.8); + BecomeBileExplosion(); +}; + +void() BileBombThink = { + local entity missile; + local float spd; + local float t; + local vector vec; + local vector org; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.angles = vectoangles(self.velocity); + makevectors(self.angles); + while (t < 2) { + missile = spawn(); + missile.owner = self.owner; + missile.movetype = MOVETYPE_TOSS; + missile.solid = SOLID_BBOX; + spd = vlen(self.velocity); + org = self.origin; + vec = self.velocity; + if (t == 0) { + vec = vec + v_right * (spd * 0.3); + } else { + vec = vec - v_right * (spd * 0.3); + } + vec = normalize(vec); + vec = vec * spd; + missile.velocity = vec; + missile.avelocity = '300 300 300'; + missile.touch = BileBombTouch; + setmodel(missile, "progs/bilebomb.mdl"); + setsize(missile, VEC_ORIGIN, VEC_ORIGIN); + setorigin(missile, org); + t = t + 1; + } + SUB_Remove(); +}; + +void() gug_bilebomb = { + local entity missile; + local float dist; + local float spd; + local float t; + local vector vec; + local vector org; + local vector d; + + dist = vlen(self.enemy.origin - self.origin); + self.effects = self.effects | EF_MUZZLEFLASH; + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_TOSS; + missile.solid = SOLID_BBOX; + spd = 1000 / (850 / dist); + makevectors(self.angles); + org = self.origin; + t = vlen(self.enemy.origin - org) / spd; + vec = self.enemy.velocity; + vec_z = 0; + d = self.enemy.origin + t * vec; + vec = normalize(d - org); + missile.velocity = vec; + missile.velocity_z = 0; + missile.velocity = missile.velocity * spd; + t = self.enemy.origin_z - org_z; + t = 250 + 1.3 * t; + missile.velocity_z = t; + missile.avelocity = '300 300 300'; + missile.angles = vectoangles(missile.velocity); + missile.touch = BileBombTouch; + missile.nextthink = time + 0.3; + missile.think = BileBombThink; + missile.enemy = self.enemy; + setmodel(missile, "progs/bilebomb.mdl"); + setsize(missile, VEC_ORIGIN, VEC_ORIGIN); + setorigin(missile, self.origin + '0 0 75'); +}; + +void() gug_bile1 = [152, gug_bile3] { ai_face(); }; +void() gug_bile3 = [153, gug_bile5] { ai_face(); }; +void() gug_bile5 = [154, gug_bile12] { ai_face(); }; +void() gug_bile12 = [155, gug_bile13] { ai_face(); }; +void() gug_bile13 = [156, gug_bile14] { ai_face(); }; +void() gug_bile14 = [157, gug_bile15] { gug_bilebomb(); self.pain_finished = time + 1.3; }; +void() gug_bile15 = [158, gug_bile16] {}; +void() gug_bile16 = [159, gug_bile17] {}; +void() gug_bile17 = [160, gug_bile18] {}; +void() gug_bile18 = [161, gug_bile19] {}; +void() gug_bile19 = [162, gug_bile20] {}; +void() gug_bile20 = [163, gug_bile21] {}; +void() gug_bile21 = [164, gug_bile22] {}; +void() gug_bile22 = [165, gug_bile23] {}; +void() gug_bile23 = [166, gug_bile24] {}; +void() gug_bile24 = [167, gug_bile25] {}; +void() gug_bile25 = [168, gug_bile26] {}; +void() gug_bile26 = [169, gug_run1] {}; + +void() gug_quake_think = { + local float points; + local entity head; + local vector org; + + self.nextthink = time + 0.080000; + self.think = gug_quake_think; + head = findradius(self.origin, 800); + while (head) { + if (head.classname != "monster_gug") { + if (head.takedamage == DAMAGE_AIM && !(head.flags & FL_FLY)) { + org = head.origin + (head.mins + head.maxs) * 0.5; + points = 0.010000 * vlen(self.origin - org); + if (points < 0) + points = 0; + + points = TE_LIGHTNING3 - points; + if (points > 0) { + head.punchangle_x = (time - self.ltime) * random() * 4; + head.punchangle_y = (time - self.ltime) * random() * 4; + head.punchangle_z = (time - self.ltime) * random() * 4; + if (head.flags & FL_ONGROUND) { + if (head.flags & FL_MONSTER) + head.flags = head.flags - FL_ONGROUND; + + head.velocity = head.velocity + random() * '0 0 150'; + } + } + } + } + head = head.chain; + } + if (self.ltime < time) + SUB_Remove(); +}; + +void(float stime) gug_quake = { + local entity qent; + + self.t_width = time + 4.5; + sound(self, CHAN_AUTO, "gug/gquake.wav", 1, ATTN_NONE); + qent = spawn(); + qent.owner = self; + qent.movetype = MOVETYPE_NONE; + qent.solid = SOLID_NOT; + qent.spawnmaster = self.enemy; + qent.nextthink = time + 0.1; + qent.think = gug_quake_think; + qent.ltime = time + stime; + qent.classname = "gug_quake"; + self.spawnmaster = qent; + setsize(qent, VEC_ORIGIN, VEC_ORIGIN); + setorigin(qent, self.origin); +}; + +void() gug_quake_damage = { + local float points; + local entity head; + local vector org; + + head = findradius(self.origin, 800); + while (head) { + if (head.classname != "monster_gug") { + if (head.takedamage == DAMAGE_AIM && !(head.flags & FL_FLY)) { + org = head.origin + (head.mins + head.maxs) * 0.5; + points = 0.010000 * vlen(self.origin - org); + if (points < 0) + points = 0; + + points = TE_LIGHTNING3 - points; + if (points > 0) { + if (head.classname == "player") { + if (self.enemy.health <= points && !(self.enemy.flags & FL_GODMODE) && self.enemy.invincible_finished < time) + self.enemy.deathtype = "quake"; + + T_Damage(head, self, self, points,DAMARMOR); + } else { + if (CanDamage(head, self)) + T_Damage(head, self.spawnmaster, self.spawnmaster, points,DAMARMOR); + } + } + } + } + head = head.chain; + } +}; + +void() gug_quake1 = [170, gug_quake2] { ai_face(); }; +void() gug_quake2 = [171, gug_quake3] { ai_face(); }; +void() gug_quake3 = [172, gug_quake4] { ai_face(); }; +void() gug_quake4 = [173, gug_quake5] { ai_face(); }; +void() gug_quake5 = [174, gug_quake6] { ai_face(); }; +void() gug_quake6 = [175, gug_quake7] { ai_face(); }; +void() gug_quake7 = [176, gug_quake8] {}; +void() gug_quake8 = [177, gug_quake9] {}; +void() gug_quake9 = [178, gug_quake10] { + gug_quake(3.3); + gug_quake_damage(); + self.pain_finished = time + 1.6; +}; + +void() gug_quake10 = [179, gug_quake11] {}; +void() gug_quake11 = [180, gug_quake12] { gug_quake_damage(); }; +void() gug_quake12 = [181, gug_quake13] {}; +void() gug_quake13 = [182, gug_quake14] { gug_quake_damage(); }; +void() gug_quake14 = [183, gug_quake15] {}; +void() gug_quake15 = [184, gug_quake16] { gug_quake_damage(); }; +void() gug_quake16 = [185, gug_quake17] {}; +void() gug_quake17 = [186, gug_quake18] { gug_quake_damage(); }; +void() gug_quake18 = [187, gug_quake19] {}; +void() gug_quake19 = [188, gug_quake20] {}; +void() gug_quake20 = [189, gug_quake21] {}; +void() gug_quake21 = [190, gug_quake22] {}; +void() gug_quake22 = [191, gug_quake23] {}; +void() gug_quake23 = [192, gug_quake24] {}; +void() gug_quake24 = [193, gug_run1] {}; + +void() gug_death1 = [200, gug_death2] {}; +void() gug_death2 = [201, gug_death3] { monster_check_gib(); }; +void() gug_death3 = [202, gug_death4] { monster_check_gib(); }; +void() gug_death4 = [203, gug_death5] { self.solid = SOLID_NOT; }; +void() gug_death5 = [204, gug_death6] {}; +void() gug_death6 = [205, gug_death7] {}; +void() gug_death7 = [206, gug_death8] {}; +void() gug_death8 = [207, gug_death9] {}; +void() gug_death9 = [208, gug_death10] {}; +void() gug_death10 = [209, gug_death11] {}; +void() gug_death11 = [210, gug_death12] {}; +void() gug_death12 = [211, gug_death13] {}; +void() gug_death13 = [212, gug_death14] {}; +void() gug_death14 = [213, gug_death15] {}; +void() gug_death15 = [214, gug_death16] {}; +void() gug_death16 = [215, gug_death17] {}; +void() gug_death17 = [216, gug_death18] {}; +void() gug_death18 = [217, gug_death19] {}; +void() gug_death19 = [218, gug_death20] {}; +void() gug_death20 = [219, gug_death21] {}; +void() gug_death21 = [220, gug_death22] {}; +void() gug_death22 = [221, gug_death23] {}; +void() gug_death23 = [222, gug_death24] {}; +void() gug_death24 = [223, gug_death25] {}; +void() gug_death25 = [224, gug_death26] { + local entity head; + + head = findradius(self.origin, 550); + while (head) { + if (head.flags & FL_CLIENT) + gug_screen_shake(0.4, head); // mybody makes quakes when I die! + + head = head.chain; + } +}; +void() gug_death26 = [225, gug_death27] {}; +void() gug_death27 = [226, gug_death28] {}; +void() gug_death28 = [227, gug_death29] {}; +void() gug_death29 = [228, gug_death30] {}; +void() gug_death30 = [229, gug_death31] {}; +void() gug_death31 = [230, gug_death32] {}; +void() gug_death32 = [231, gug_death33] {}; +void() gug_death33 = [232, gug_death34] {}; +void() gug_death34 = [233, gug_death35] {}; +void() gug_death35 = [234, gug_death36] {}; +void() gug_death36 = [235, gug_death37] {}; +void() gug_death37 = [236, gug_death38] {}; +void() gug_death38 = [237, gug_death39] {}; +void() gug_death39 = [238, gug_death40] {}; +void() gug_death40 = [239, gug_death41] { monster_death_postcheck(); }; +void() gug_death41 = [240, gug_death41] {}; + +void() gug_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound(self, CHAN_VOICE, "gug/death.wav", 1, 0.5); + gug_death1(); + } +}; + +void() gug_melee = { + sound(self, CHAN_VOICE, "gug/swipe.wav", 1, ATTN_NORM); + if (self.state == 0) + self.state = ceil(2 * random()); + + if (self.state == 1) { + self.state = 2; + gug_swingl1(); + } else { + if (self.state == 2) { + self.state = 1; + gug_swingr1(); + } + } +}; + +void() gug_missile = { + local float dist; + + dist = vlen(self.enemy.origin - self.origin); + if (random() < 0.8 || self.t_width > time) { + gug_bile1(); + sound(self, CHAN_BODY, "gug/bileatk.wav", 1, 0.7); + } else { + sound(self, CHAN_BODY, "gug/quakeatk.wav", 1, 0.7); + gug_quake1(); + } + return; +}; + +void() gug_pain1 = [194, gug_pain2] { ai_pain(8); }; +void() gug_pain2 = [195, gug_pain3] { ai_pain(7); }; +void() gug_pain3 = [196, gug_pain4] { ai_pain(6); }; +void() gug_pain4 = [197, gug_pain5] { ai_pain(5); }; +void() gug_pain5 = [198, gug_pain6] { ai_pain(0); }; +void() gug_pain6 = [199, gug_run1] { ai_pain(0); }; + +void(entity inflictor, entity attacker, float damage) gug_pain = { + if (self.health <= 0) + return; + + if (self.pain_finished > time) + return; + + if (random() * 400 > damage && damage > 55) + return; + + sound(self, CHAN_VOICE, "gug/pain.wav", 1, ATTN_NORM); + self.pain_finished = time + AS_MELEE; + gug_pain1(); +}; + +void() monster_gug = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/gug.mdl"; + precache_model("progs/gug.mdl"); + precache_model("progs/bilebomb.mdl"); + precache_model("progs/bilefrag.mdl"); + precache_model("progs/greenexp.spr"); + precache_sound("gug/step1.wav"); + precache_sound("gug/step2.wav"); + precache_sound("gug/step3.wav"); + precache_sound("gug/step4.wav"); + precache_sound("gug/pain.wav"); + precache_sound("gug/sight.wav"); + precache_sound("gug/death.wav"); + self.idle_sound = "gug/idle.wav"; + precache_sound("gug/idle.wav"); + precache_sound("gug/bileatk.wav"); + precache_sound("gug/swipe.wav"); + precache_sound("gug/quakeatk.wav"); + precache_sound("gug/bile.wav"); + precache_sound("gug/gquake.wav"); + precache_sound("gug/throw.wav"); + precache_sound("shambler/smack.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GOLEM; + if (self.health < 1) self.health = 1000; + self.gibhealth = -150; + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // Demon level + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 0; + + self.th_stand = gug_stand1; + self.th_walk = gug_walk1; + self.th_run = gug_run1; + self.th_die = gug_die; + self.th_melee = gug_melee; + self.th_missile = gug_missile; + self.th_novis = gug_quake1; + self.th_pain = gug_pain; + self.yaw_speed = 15; // Slow turner + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was obliterated by a Gug\n"; + } else { + if (self.deathstring == "") self.deathstring = " was squashed by a Gug\n"; + } + + self.classtype = CT_MONGUG; + self.classgroup = CG_BOSS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_hknight.qc b/QC_other/QC_keep/mon_hknight.qc new file mode 100644 index 00000000..e599cc40 --- /dev/null +++ b/QC_other/QC_keep/mon_hknight.qc @@ -0,0 +1,853 @@ +/*============================================================================== +KNIGHT +==============================================================================*/ +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +// 000-008 +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +// 009-028 +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +// 029-036 +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// 037-041 +$frame pain1 pain2 pain3 pain4 pain5 + +// 042-053 +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// 054-062 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +// 063-078 +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +// 079-092 +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +// 093-105 +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +// 106-111 +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +// 112-121 +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +// 122-132 +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +// 133-154 +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +// 155-165 +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +void() hknight_sword_sound; +void() knight_statue; +void() hknight_champion_magic; + +//=========================================================================== +void() hknight_stand1 =[ $stand1, hknight_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();}; +void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();}; +void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();}; +void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();}; +void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();}; +void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();}; +void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();}; +void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();}; + +//=========================================================================== +void() hknight_walk1 =[ $walk1, hknight_walk2 ] {monster_idle_sound(); ai_walk(2);}; +void() hknight_walk2 =[ $walk2, hknight_walk3 ] {monster_footstep(FALSE);ai_walk(5);}; +void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);}; +void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);}; +void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);}; +void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);}; +void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);}; +void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);}; +void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);}; +void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);}; +void() hknight_walk11 =[ $walk11, hknight_walk12 ] {monster_footstep(FALSE); ai_walk(3);}; +void() hknight_walk12 =[ $walk12, hknight_walk13 ] {ai_walk(4);}; +void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);}; +void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);}; +void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);}; +void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);}; +void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);}; +void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);}; +void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);}; +void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);}; + +//=========================================================================== +void() CheckForCharge = +{ + // There are 4 conditions to keep charging + // Can see player, no attack timer, similar Z axis and outside melee range + // Nightmare skill level can lock HK in constant charging (no attack timer) + enemy_vis = visible(self.enemy); + if (!enemy_vis) return; + if (time < self.attack_finished) return; + if (self.movespeed < 0) return; + if (self.tetherlock) return; + // Only charge at player if ground height < 20 + if ( fabs(self.origin_z - self.enemy.origin_z) > MONAI_CHARGEZAXIS) return; + if (ai_checkmelee(MONAI_MELEEKNIGHT)) return; + + SUB_AttackFinished (2); + + // Used a pre-defined charge routine (th_charge) so that + // hell and death knights can share the same function + if (self.th_charge) self.th_charge(); + else self.th_run(); +}; + +//---------------------------------------------------------------------- +void() hknight_run1 =[ $run1, hknight_run2 ] {monster_idle_sound(); + ai_run (20); CheckForCharge(); }; +void() hknight_run2 =[ $run2, hknight_run3 ] {monster_footstep(FALSE); ai_run(25);}; +void() hknight_run3 =[ $run3, hknight_run4 ] {ai_run(18);}; +void() hknight_run4 =[ $run4, hknight_run5 ] {ai_run(16);}; +void() hknight_run5 =[ $run5, hknight_run6 ] {ai_run(14);}; +void() hknight_run6 =[ $run6, hknight_run7 ] {monster_footstep(FALSE); ai_run(25);}; +void() hknight_run7 =[ $run7, hknight_run8 ] {ai_run(21);}; +void() hknight_run8 =[ $run8, hknight_run1 ] {ai_run(13);}; + +//---------------------------------------------------------------------- +void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] {ai_charge(20);}; +void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {monster_footstep(FALSE); ai_charge(25);}; +void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {ai_charge(18);}; +void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] {ai_charge(16);hknight_sword_sound();}; +void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {ai_charge(14);}; +void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {monster_footstep(FALSE); ai_charge(20); ai_melee();}; +void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {ai_charge(21); ai_melee();}; +void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {ai_charge(13); ai_melee();}; +void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {ai_charge(20); ai_melee();}; +void() hknight_char_a10=[ $char_a10, hknight_char_a11 ] {monster_footstep(FALSE); ai_charge(20); ai_melee();}; +void() hknight_char_a11=[ $char_a11, hknight_char_a12 ] {ai_charge(18); ai_melee();}; +void() hknight_char_a12=[ $char_a12, hknight_char_a13 ] {ai_charge(16);}; +void() hknight_char_a13=[ $char_a13, hknight_char_a14 ] {ai_charge(14);}; +void() hknight_char_a14=[ $char_a14, hknight_char_a15 ] {monster_footstep(FALSE);ai_charge(25);}; +void() hknight_char_a15=[ $char_a15, hknight_char_a16 ] {ai_charge(21);}; +void() hknight_char_a16=[ $char_a16, hknight_run1 ] {ai_charge(13);}; + +//---------------------------------------------------------------------- +// Never used, only called from hknight_char_b +//---------------------------------------------------------------------- +void() CheckContinueCharge = +{ + if (time > self.attack_finished) { + SUB_AttackFinished (3); + self.th_run(); + return; // done charging + } +}; + +void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] +{CheckContinueCharge (); ai_charge(23); ai_melee();}; +void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {hknight_sword_sound(); ai_charge(17); ai_melee();}; +void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {ai_charge(12); ai_melee();}; +void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {monster_footstep(FALSE); ai_charge(22); ai_melee();}; +void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {ai_charge(18); ai_melee();}; +void() hknight_char_b6 =[ $char_b6, hknight_char_b1 ] {ai_charge(8); ai_melee();}; + +//=========================================================================== +void() hknight_slice1 =[ $slice1, hknight_slice2 ] {ai_charge(9);}; +void() hknight_slice2 =[ $slice2, hknight_slice3 ] {ai_charge(6);}; +void() hknight_slice3 =[ $slice3, hknight_slice4 ] {monster_footstep(FALSE); ai_charge(13);}; +void() hknight_slice4 =[ $slice4, hknight_slice5 ] {hknight_sword_sound(); ai_charge(4);}; +void() hknight_slice5 =[ $slice5, hknight_slice6 ] {ai_charge(7); ai_melee();}; +void() hknight_slice6 =[ $slice6, hknight_slice7 ] {ai_charge(15); ai_melee();}; +void() hknight_slice7 =[ $slice7, hknight_slice8 ] {monster_footstep(FALSE); ai_charge(8); ai_melee();}; +void() hknight_slice8 =[ $slice8, hknight_slice9 ] {ai_charge(2); ai_melee();}; +void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();}; +void() hknight_slice10 =[ $slice10, hknight_run1 ] {ai_charge(3);}; + +//---------------------------------------------------------------------- +void() hknight_smash1 =[ $smash1, hknight_smash2 ] {ai_charge(1);}; +void() hknight_smash2 =[ $smash2, hknight_smash3 ] {ai_charge(13);}; +void() hknight_smash3 =[ $smash3, hknight_smash4 ] {hknight_sword_sound(); ai_charge(9);}; +void() hknight_smash4 =[ $smash4, hknight_smash5 ] {monster_footstep(FALSE); ai_charge(11);}; +void() hknight_smash5 =[ $smash5, hknight_smash6 ] {ai_charge(10); ai_melee();}; +void() hknight_smash6 =[ $smash6, hknight_smash7 ] {ai_charge(7); ai_melee();}; +void() hknight_smash7 =[ $smash7, hknight_smash8 ] {ai_charge(12); ai_melee();}; +void() hknight_smash8 =[ $smash8, hknight_smash9 ] {ai_charge(2); ai_melee();}; +void() hknight_smash9 =[ $smash9, hknight_smash10 ] {monster_footstep(FALSE); ai_charge(3); ai_melee();}; +void() hknight_smash10 =[ $smash10, hknight_smash11 ] {ai_charge(0);}; +void() hknight_smash11 =[ $smash11, hknight_run1 ] {ai_charge(0);}; + +//---------------------------------------------------------------------- +void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {ai_charge(2);}; +void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {ai_charge(0);}; +void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {ai_charge(0);}; +void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {hknight_sword_sound(); ai_melee();}; +void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_melee();}; +void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_melee();}; +void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {ai_charge(1);}; +void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {ai_charge(4);}; +void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {ai_charge(5);}; +void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {ai_charge(3); ai_melee();}; +void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {monster_footstep(FALSE); ai_charge(2); ai_melee();}; +void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {ai_charge(2); ai_melee();}; +void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {ai_charge(0);}; +void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {hknight_sword_sound(); ai_charge(0);}; +void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {ai_charge(0);}; +void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {ai_charge(1);}; +void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {ai_charge(1); ai_melee();}; +void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {ai_charge(3); ai_melee();}; +void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {ai_charge(4); ai_melee();}; +void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {ai_charge(6);}; +void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {ai_charge(7);}; +void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {monster_footstep(FALSE); ai_charge(3);}; + +//============================================================================ +// Cycle between 3 melee attacks +// Attack 1 - Slice (one hand slashing run attack) +// Attack 2 - Smash (chop overhead to ground) +// Attack 3 - W_Attack (two handed slashing attack) + +//---------------------------------------------------------------------- +void() hknight_melee = +{ + self.meleeattack = self.meleeattack + 1; + + if (self.meleeattack == 1) hknight_slice1 (); + else if (self.meleeattack == 2) hknight_smash1 (); + else { + hknight_watk1 (); + self.meleeattack = 0; + } +}; + +//============================================================================ +void(float offset) hknight_shot = +{ + local vector offang; + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + + self.attack_speed = SPEED_HKSPIKE + ( skill * SPEED_HKSKILL); + offang = vectoangles (self.enemy.origin - self.origin); + offang_y = offang_y + offset * 6; + makevectors (offang); + + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + dir = normalize (v_forward); + dir_z = 0 - dir_z + (random() - 0.5)*0.1; + + launch_projectile (org, dir, CT_PROJ_HKN, self.attack_speed); +}; +//---------------------------------------------------------------------- +// Magic attack A (over head attack) - not used +void() hknight_magica1 =[ $magica1, hknight_magica2 ] {ai_face();}; +void() hknight_magica2 =[ $magica2, hknight_magica3 ] {ai_face();}; +void() hknight_magica3 =[ $magica3, hknight_magica4 ] {ai_face();}; +void() hknight_magica4 =[ $magica4, hknight_magica5 ] {ai_face();}; +void() hknight_magica5 =[ $magica5, hknight_magica6 ] {ai_face();}; +void() hknight_magica6 =[ $magica6, hknight_magica7 ] {ai_face();}; +void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);}; +void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);}; +void() hknight_magica9 =[ $magica9, hknight_magica10] {hknight_shot(0);}; +void() hknight_magica10 =[ $magica10, hknight_magica11] {hknight_shot(1);}; +void() hknight_magica11 =[ $magica11, hknight_magica12] {hknight_shot(2);}; +void() hknight_magica12 =[ $magica12, hknight_magica13] {hknight_shot(3);}; +void() hknight_magica13 =[ $magica13, hknight_magica14] {ai_face();}; +void() hknight_magica14 =[ $magica14, hknight_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +// Magic attack B (pointing sword) - not used +void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {ai_face();}; +void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {ai_face();}; +void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {ai_face();}; +void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {ai_face();}; +void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {ai_face();}; +void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {ai_face();}; +void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);}; +void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);}; +void() hknight_magicb9 =[ $magicb9, hknight_magicb10] {hknight_shot(0);}; +void() hknight_magicb10 =[ $magicb10, hknight_magicb11] {hknight_shot(1);}; +void() hknight_magicb11 =[ $magicb11, hknight_magicb12] {hknight_shot(2);}; +void() hknight_magicb12 =[ $magicb12, hknight_magicb13] {hknight_shot(3);}; +void() hknight_magicb13 =[ $magicb13, hknight_run1] {ai_face();}; + +//---------------------------------------------------------------------- +// Magic attack C (swing sword in arc) +void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {ai_face();}; +void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {ai_face();}; +void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {ai_face();}; +void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {ai_face();}; +void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {ai_face();}; +void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2);}; +void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1);}; +void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0);}; +void() hknight_magicc9 =[ $magicc9, hknight_magicc10] {hknight_shot(1);}; +void() hknight_magicc10 =[ $magicc10, hknight_magicc11] {hknight_shot(2);}; +void() hknight_magicc11 =[ $magicc11, hknight_run1] {hknight_shot(3);}; + +//============================================================================ +// Special setup - Hell Knight firing electricity at target +//---------------------------------------------------------------------- +void() hknight_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = self.weaponglow; + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + } +}; + +//---------------------------------------------------------------------- +void() hknight_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//---------------------------------------------------------------------- +void() hknight_pointfire = +{ + local vector hkp_start, hkp_rand, hkp_end; + + // Make sure the knight is alive + if (self.health < 1) return; + + // Time for a new LG hit sound? + if (self.t_width < time) { + // Lower volume and attenuation just in case of several together + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 0.75, ATTN_IDLE); + self.t_width = time + 0.6; + } + + // Update animation frames (default = MagicB6-11) + self.frame = self.frame + self.pos3_z; + if (self.frame < self.pos3_x) self.frame = self.pos3_y; + if (self.frame > self.pos3_y) self.frame = self.pos3_x; + + // Turn the Knight towards lightning target + self.ideal_yaw = vectoyaw(self.movetarget.origin - self.origin); + ChangeYaw (); + // Work out start point of lightning bolt + makevectors(self.angles); + + // Work out starting point for lightning on sword + hkp_start = v_forward*self.pos1_x + v_right*self.pos1_y + v_up*self.pos1_z; + hkp_rand = v_forward * (self.pos2_x * random()); + hkp_rand = hkp_rand + v_right * (self.pos2_y * random()); + hkp_rand = hkp_rand + v_up * (self.pos2_z * random()); + hkp_start = hkp_start + self.origin + hkp_rand; + + // Check for any random target origin variance + if (self.t_length > 0) { + hkp_end = vecrand(0,self.t_length,1); + hkp_end = hkp_end + self.movetarget.origin; + } + // Default (0) = exact target position + else hkp_end = self.movetarget.origin; + + // Update sword with lightning visuals + if (self.attachment) { + setorigin(self.attachment, self.origin); + self.attachment.frame = self.frame; + self.attachment.angles = self.angles; + // Allow for no sword effect by going over max and reset + self.attachment.alpha = self.attachment.alpha + random(); + if (self.attachment.alpha > 1) self.attachment.alpha = 0.01; + // The four skins are randomly setup already + self.lip = self.attachment.skin + 1; + if (self.lip > 3) self.lip = 0; + self.attachment.skin = self.lip; + // Draw paticles on sword where lightning starts + particle_explode(hkp_start, 2, 1, PARTICLE_BURST_BLUE, PARTICLE_BURST_LOSTUP); + } + + // Create lightning bolt + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, hkp_start_x); + WriteCoord (MSG_BROADCAST, hkp_start_y); + WriteCoord (MSG_BROADCAST, hkp_start_z); + WriteCoord (MSG_BROADCAST, hkp_end_x); + WriteCoord (MSG_BROADCAST, hkp_end_y); + WriteCoord (MSG_BROADCAST, hkp_end_z); + + // Can the lightning damage things? + if (self.dmg > 0) + LightningDamage (hkp_start, hkp_end, self, self.dmg); + + // Keep Looping + self.think = self.th_run; + self.nextthink = time + 0.1; + +}; + +//---------------------------------------------------------------------- +void() hknight_pointsetup = +{ + // Find Lightning bolt target + self.movetarget = find(world, targetname, self.target); + if (!self.movetarget) { + dprint("\b[HKNIGHT]\b Pointing knight invalid target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // Start pointing lightning sword! + else { + // Save pain threshold and timeout for later + self.finaldest_x = self.pain_flinch; + self.finaldest_y = self.pain_timeout; + // Reset all pain parameters so it always happens + self.pain_flinch = self.pain_timeout = 0; + self.pain_finished = self.pain_ignore = 0; + self.infightextra = self.noinfighting = 0; + // Stop other monsters attacking pointy knights + self.flags = self.flags - (self.flags & FL_MONSTER); + self.enemy = world; + // Create glowing sword and start pointing + hknight_create_attachment(); + self.th_run(); + } +}; + +//============================================================================ +void() hknight_pain1 =[ $pain1, hknight_pain2 ] {}; +void() hknight_pain2 =[ $pain2, hknight_pain3 ] {}; +void() hknight_pain3 =[ $pain3, hknight_pain4 ] {}; +void() hknight_pain4 =[ $pain4, hknight_pain5 ] {}; +void() hknight_pain5 =[ $pain5, hknight_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) hknight_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) hknight_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.5; + self.axhitme = 0; + hknight_pain1 (); + } + } +}; + +//============================================================================ +void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);}; +void() hknight_die2 =[ $death2, hknight_die3 ] {monster_check_gib();ai_forward(8);}; +void() hknight_die3 =[ $death3, hknight_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; ai_forward(7);}; +void() hknight_die4 =[ $death4, hknight_die5 ] {}; +void() hknight_die5 =[ $death5, hknight_die6 ] {}; +void() hknight_die6 =[ $death6, hknight_die7 ] {}; +void() hknight_die7 =[ $death7, hknight_die8 ] {}; +void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);}; +void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);}; +void() hknight_die10 =[ $death10, hknight_die11 ] {}; +void() hknight_die11 =[ $death11, hknight_die12 ] {monster_death_postcheck();}; +void() hknight_die12 =[ $death12, hknight_die12 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {}; +void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {monster_check_gib();}; +void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {}; +void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {}; +void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {}; +void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {}; +void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {monster_death_postcheck();}; +void() hknight_dieb9 =[ $deathb9, hknight_dieb9 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() hknight_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + // Make sure attachments are removed + hknight_remove_attachment(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) hknight_die1 (); // Forward - standard + else hknight_dieb1 (); // Backward - standard + } +}; + +//============================================================================ +void() hknight_sword_sound = +{ + self.lip = random(); + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); +}; + +//============================================================================ +// Used by stone knights to wakup and attack the player +//---------------------------------------------------------------------- +void() hknight_aistates = +{ + self.th_stand = hknight_stand1; // Idling on feet + self.th_walk = hknight_walk1; // Walking + self.th_run = hknight_run1; // Running + self.th_melee = hknight_melee; // Sword attack + if (self.classname == "monster_hell_knight_champion") { + self.th_missile = hknight_champion_magic; + } else { + self.th_missile = hknight_magicc1; // Fire spikes + } + self.th_charge = hknight_char_a1; // Run + melee + self.th_pain = hknight_pain; // Stumble and pain + self.th_die = hknight_die; // Face meets floor +}; + +//---------------------------------------------------------------------- +void() hknight_wakeup = +{ + if (self.health < 0) return; // Check for sudden death! + + self.use = SUB_Null; // no re-trigger + self.takedamage = DAMAGE_AIM; // Can receive damage + self.spawnstatue = FALSE; // No longer stationary + + hknight_aistates(); // Restore AI state functions + monster_targets(); // Check for targets +}; + +//---------------------------------------------------------------------- +// Restore pointy lightning knights to normal hell knights +//---------------------------------------------------------------------- +void() hknight_pointwakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + // Always reset health+max back to default + self.health = self.max_health = self.reset_health; + // Fire any trigger event when breaking pointy pose + if (self.target2 != "") { + trigger_strs(self.target2, self.enemy); + self.target2 = ""; // Trigger once + } + + // Restore pain threshold and timeout + self.pain_flinch = self.finaldest_x; + self.pain_timeout = self.finaldest_y; + self.pain_finished = time + 2; + self.flags = self.flags | FL_MONSTER; + + // Restore the nail resistance if setup to be a statue skin + if (self.spawnflags & MON_STATUE) self.resist_nails = 0.2; + + hknight_remove_attachment(); // Remove glowing sword + hknight_aistates(); // Restore AI state functions + // Check for any enemy target? + if (self.enemy) { + monster_sightsound(); // Sword sounds! + FoundHuntTarget(TRUE); // Setup goals and targets + self.think = self.th_run; // Move to running + } + else self.think = self.th_stand; // Stand around + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +// Special pain function for pointy lightning knights +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) hknight_pointpain = +{ + self.pain_finished = 0; + if (!(attacker.flags & FL_CLIENT)) return; + self.enemy = attacker; + hknight_pointwakeup(); +}; + +//---------------------------------------------------------------------- +// Special use/trigger function for pointy lightning knights +//---------------------------------------------------------------------- +void() hknight_pointuse = +{ + // Check for enemy/health/player exceptions + if (self.enemy) return; + if (self.health < 1) return; + if (activator.items & IT_INVISIBILITY) return; + if (activator.flags & FL_NOTARGET) return; + + // Trigger once + self.use = SUB_Null; + // Is the trigger the player? + if (activator.flags & FL_CLIENT) self.enemy = activator; + else self.enemy = world; + hknight_pointwakeup(); +}; + +/*====================================================================== + QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_hell_knight = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_hknight.mdl"; // Original ID Knight + extra skins + self.headmdl = "progs/h_hellkn.mdl"; + self.gib1mdl = "progs/ad171/w_hknightsword.mdl"; // Unique sword + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_HKN); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + // Firing of magic spikes (first 0.1s must loop) + precache_sound ("hknight/attack1.wav"); + + // TE_KNIGHTSPIKE = Magic spike hitting the wall + // Has got to be in this location because the + // filename is hardcoded (engine.exe) + precache_sound ("hknight/hit.wav"); + + // Always precache these stone gib models + precache_stonegibs(); + + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + self.idle_sound = "statue/idle1.wav"; + self.idle_sound2 = "statue/idle2.wav"; + self.idle_soundcom = "statue/comidle.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + self.pain_sound = "statue/hurt.wav"; + self.death_sound = "statue/death.wav"; + self.sight_sound = "statue/sight.wav"; + self.gib1skin = 1; // Stoney sword + self.gibtype = GIBTYPE_STONE; // Stoney gibs! + self.gib2mdl = self.gib3mdl = string_null; + } + else { + self.idle_sound = "hknight/idle.wav"; + precache_sound (self.idle_sound); + + self.pain_sound = "hknight/pain1.wav"; + self.death_sound = "hknight/death1.wav"; + self.sight_sound = "hknight/sight1.wav"; + } + // Cannot have if precache statements, precache duplicates as well + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + precache_sound (self.sight_sound); + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.classname == "monster_hell_knight_champion") { + if (self.health < 1) self.health = 350; + if (self.skin == 0) self.skin = 3; + } else { + if (self.health < 1) self.health = 250; + } + self.gibhealth = -40; + self.gibbed = FALSE; + self.pain_flinch = 40; // Medium pain threshold + self.pain_timeout = 1.5; // Higher than a knight + self.steptype = FS_TYPEHEAVY; // Heavy player + self.meleeattack = rint(random()*3); // randomize last melee attack + self.th_die = hknight_die; // Face meets floor + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.hittype = HIT_METAL; + + //---------------------------------------------------------------------- + // Special lightning point knight (metal/stone skins) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_POINT_KNIGHT) { + self.weaponglow = "progs/ad171/mon_hknight_glow.mdl"; + precache_model (self.weaponglow); // Glowing magical swords + if (self.spawnflags & MON_STATUE) { + self.classgroup = CG_STONE; // Stone hates metal! + self.skin = 1; // Stone skin + self.pain_flinch = 60; // Doubled + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // high pain threshold + self.no_liquiddmg = TRUE; // Immune to slime/lava + } + self.th_stand = hknight_pointsetup; // Find target before shoot + self.th_run = hknight_pointfire; // Keep Looping + self.th_pain = hknight_pointpain; // Release from pointing + self.think1 = hknight_pointuse; // Special trigger event + self.reset_health = self.health; // Save for later + self.health = MEGADEATH; // Should be impossible to kill + if (self.t_length < 0) self.t_length = 5; // Random target factor + if (self.dmg < 0) self.dmg = 5; // Contact damage + + // Setup default pose start pos + random modifier + if (CheckZeroVector(self.pos1)) self.pos1 = '20 0 24'; + if (CheckZeroVector(self.pos2)) self.pos2 = '30 0 2'; + // Setup default animation pose (magicB6 - magicB11) + if (CheckZeroVector(self.pos3)) self.pos3 = '98 103 1'; + } + //---------------------------------------------------------------------- + // Detect statues and setup different parameters + // Tougher skin, less pain, heavy feet etc + //---------------------------------------------------------------------- + else if (self.spawnflags & MON_STATUE) { + if (self.classname == "monster_hell_knight_champion") { + self.classgroup = CG_DKNIGHT; // Classic tincan! + hknight_aistates(); + self.classtype = CT_MONHELLK; + self.classmove = MON_MOVEWALK; + monster_start(); + return; // champion knights can't be statues! + } + self.classgroup = CG_STONE; // Stone hates metal! + self.hittype = HIT_STONE; + self.resist_nails = 0.5; // Tough skin for nails + self.skin = 1; // Stone skin + self.pain_flinch = 60; // Doubled + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // high pain threshold + self.no_liquiddmg = TRUE; // Immune to slime/lava + if (self.deathstring == "") self.deathstring = " was smashed by a Stone Death Knight\n"; + + // Allow knights to start with a stone skin, but not be frozen! + if (self.spawnflags & MON_NOTFROZEN) { + self.spawnflags = self.spawnflags - MON_STATUE; + hknight_aistates(); // setup AI state functions + } + else { + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = knight_statue; // Stone idle sound + self.think1 = hknight_wakeup; // Wakeup function when triggered + + // statues can change position when the player is not looking + // Specify a start/finish frame using pos1 or use frame + if (!self.pos1_x) { + self.pos1_x = $w_attack1; // Default pose (attacking) + self.pos1_y = $w_attack15; + } + // A frame has been specified, create a small range from that + if (self.frame > 0) { + self.pos1_x = self.pos1_y = self.frame; + } + // Work out range, make sure no negative values + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = self.pos1_x; // Setup frame / pose + } + } + else { + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.classgroup = CG_DKNIGHT; // Classic tincan! + hknight_aistates(); // setup AI state functions + } + if (self.deathstring == "") self.deathstring = " was slain by a Death Knight\n"; + self.classtype = CT_MONHELLK; + self.classmove = MON_MOVEWALK; + monster_start(); +}; + +//====================================================================== +/*QUAKED monster_hell_pointknight (0.75 0.5 0) (-16 -16 -24) (16 16 40) AMBUSH STATUE x NOSIGHT NOIDLE NOGFX STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/ad171/mon_hknight.mdl"); } +Special Electricity Pointing Hell Knight +-------- KEYS -------- +targetname : monster/trigger name +target : target for electricity +target2 : trigger to fire when electricity stopped +pos1 : XYZ offset to start lightning (uses v_forward/v_right/v_up) +pos2 : XYZ random offset to start lightning (uses v_forward/v_right/v_up) +pos3 : Animation lightning frame set (Start/Finish/Direction) +t_length : random wobble to electricity target origin (0=def 5) +dmg : amount of contact damage with electricity (0=def 5) +health : Override default health settings +deathtarget : entity to trigger upon death (useful if target field already in use) +health : Override default health settings +upgrade_ssg : 1 = will only spawn if shotgun upgrade active on server +upgrade_axe : 1 = will only spawn if axe upgrade active on server +upgrade_lg : 1 = will only spawn if lightning gun upgrade active on server +nomonstercount : will not be included in any monster count functionality +no_zaware : All Z Aware projectiles will be disabled +bboxtype : Change bbox 1=Tiny,4=Short,5=Tall,7=Wide,8=Giant,10=Massive +gibondeath : 1 = always explode in a shower of gibs on death +bodyfadeaway : Time (secs) before body/head will fade away (default=0) +-------- SPAWNFLAGS -------- +AMBUSH : the monster will only wake up on seeing the player, not by another monster +STATUE : Stone statue skin +NOSIGHT : No sight sound +NOIDLE : No idle sound +NOGFX : No spawn effect or sound when triggered +STARTOFF : Trigger Spawn +-------- NOTES -------- +Special Electricity Pointing Hell Knight*/ +//====================================================================== +void() monster_hell_pointknight = +{ + // Setup with new special spawnflag (not mapper controlled) + self.spawnflags = self.spawnflags | MON_POINT_KNIGHT; + // remove notfrozen and angry, always start/spawn firing lightning + self.spawnflags = self.spawnflags - (self.spawnflags & MON_NOTFROZEN); + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SPAWN_ANGRY); + + if (self.deathstring == "") self.deathstring = " was cleaved by an Electrical Death Knight\n"; + // If not target setup then stop! + if (self.target == "") { + dprint("\b[HKNIGHT]\b Pointing knight needs target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // Loop back through existing hell knight function + else monster_hell_knight(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_hlord.qc b/QC_other/QC_keep/mon_hlord.qc new file mode 100644 index 00000000..2edf565e --- /dev/null +++ b/QC_other/QC_keep/mon_hlord.qc @@ -0,0 +1,2158 @@ +/* +============================================================================== + +KNIGHT + +============================================================================== +*/ + +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + +$frame decap1 decap2 decap3 decap4 decap5 decap6 decap7 decap8 +$frame decap9 decap10 decap11 decap12 + +$frame decapb1 decapb2 decapb3 decapb4 decapb5 decapb6 decapb7 decapb8 +$frame decapb9 + + +//- - - - - - - - - +float SKIN_HELL_KNIGHT = 0; +float SKIN_HELL_KNIGHT2 = 1; +float SKIN_HELL_LORD = 2; +float SKIN_HKBOSS = 3; +float SKIN_BANE = 4; +float SKIN_BANE_GRAY = 5; +float SKIN_DARK_LORD = 6; + +float DARKLORD_NEAR = 250; +//- - - - - - - - - +void() hknight_char_a1; +void() hknight_char_b1; // PM: Enabled unused charge anim. +void() hknight_run1; +void() hk_idle_sound; + +vector(float offset) hknight_shot_dir = +{ + local vector vec; +// local vector vx, vy, vz; + +// PM: The shots tend to choke up if enemy is directly above or below the +// attacking knight. Could either be a bug or working as intended. + vec = vectoangles (self.enemy.origin - self.origin); + vec_y = vec_y + offset * 6; + + makevectors (vec); +// vx = v_forward; vy = v_right; vz = v_up; + +// set missile direction + vec = normalize (v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + vec = Maim_Scatter (vec, '0 0 0'); // Added for invisibility. + +// v_forward = vx; v_right = vy; v_up = vz; + return vec; +}; + +void(float offset) hknight_shot = +{ + local vector org, vec; + + vec = hknight_shot_dir (offset); // Also calls 'makevectors'. + + if (( self.frame >= $magicb1 ) && ( self.frame <= $magicb13 )) + org = self.origin + (v_forward * 16) + (v_up * 20); + else + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + + if (self.classname == "monster_bane") + { + KnightBall_Launch (org, vec); + newmis.dmg = 60; + newmis.style = newmis.style | DF_SAFE; + newmis.velocity = vec*600; + if (( self.frame == $magicb6 ) || ( self.frame == $magicc6 )) + sound (self, CHAN_WEAPON, "weapons/mirv1.wav", 1, ATTN_NORM); + } + else if (self.classname == "monster_dark_lord") + { + NecroBolt_Launch (org, vec); + } + else + { + local float sped; + + if (cranked) + sped = 450; // PM: Faster missiles. + else + sped = 300; + Knightspike_Launch (org, vec, sped); + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + } +}; + +void() CheckForCharge = +{ +// check for mad charge + if (!enemy_vis) + return; + if (time < self.attack_finished) + return; + if ( fabs(self.origin_z - self.enemy.origin_z) > 20) + return; // too much height change + if ( vlen (self.origin - self.enemy.origin) < 80) + return; // use regular attack +//- - - - - - - - - + if (!self.fighting) + return; // PM: Don't charge if not fighting anyone. +// if (!self.enemy) +// return; // PM: In case world origin is near and in sight. +//- - - - - - - - - + +// charge +// PM: Moved self.attack_finished to the 'knight_char_*1' functions. + if (self.classname == "monster_hkboss") + { // Emulate old behavior. + self.shots_left = 3; // Replaced 'currentammo' with 'shots_*'. + hknight_char_b1 (); + return; + } + if (random() < 0.25) + { // char_b* scene has 6 frames. + self.shots_left = random() * 4; // Swing from 1 to 4 times. + self.shots_left = ceil(self.shots_left); + hknight_char_b1 (); // PM: Unused, more damaging attack anim. + } + else + hknight_char_a1 (); +}; + +// PM: Removed 'void() CheckContinueCharge'. + +//=========================================================================== +// STAND + +void() hknight_stand1 =[ $stand1, hknight_stand2 ] {ai_stand();}; +void() hknight_stand2 =[ $stand2, hknight_stand3 ] {ai_stand();}; +void() hknight_stand3 =[ $stand3, hknight_stand4 ] {ai_stand();}; +void() hknight_stand4 =[ $stand4, hknight_stand5 ] {ai_stand();}; +void() hknight_stand5 =[ $stand5, hknight_stand6 ] {ai_stand();}; +void() hknight_stand6 =[ $stand6, hknight_stand7 ] {ai_stand();}; +void() hknight_stand7 =[ $stand7, hknight_stand8 ] {ai_stand();}; +void() hknight_stand8 =[ $stand8, hknight_stand9 ] {ai_stand();}; +void() hknight_stand9 =[ $stand9, hknight_stand1 ] {ai_stand();}; + +//=========================================================================== +// WALK + +void() hk_idle_sound = +{ + if (random() < 0.2) + { + if (self.classname == "monster_bane") + { + sound (self, CHAN_VOICE, "bane/growl.wav", 1, ATTN_NORM); + return; + } + if (self.classname == "monster_dark_lord") // FIXME: Find sfx. + return; + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + } +}; + +void() hknight_walk1 =[ $walk1, hknight_walk2 ] {hk_idle_sound(); ai_walk(2);}; +void() hknight_walk2 =[ $walk2, hknight_walk3 ] {M_Step(); ai_walk(5);}; +void() hknight_walk3 =[ $walk3, hknight_walk4 ] {ai_walk(5);}; +void() hknight_walk4 =[ $walk4, hknight_walk5 ] {ai_walk(4);}; +void() hknight_walk5 =[ $walk5, hknight_walk6 ] {ai_walk(4);}; +void() hknight_walk6 =[ $walk6, hknight_walk7 ] {ai_walk(2);}; +void() hknight_walk7 =[ $walk7, hknight_walk8 ] {ai_walk(2);}; +void() hknight_walk8 =[ $walk8, hknight_walk9 ] {ai_walk(3);}; +void() hknight_walk9 =[ $walk9, hknight_walk10 ] {ai_walk(3);}; +void() hknight_walk10 =[ $walk10, hknight_walk11 ] {ai_walk(4);}; +void() hknight_walk11 =[ $walk11, hknight_walk12 ] {ai_walk(3);}; +void() hknight_walk12 =[ $walk12, hknight_walk13 ] {M_Step(); ai_walk(4);}; +void() hknight_walk13 =[ $walk13, hknight_walk14 ] {ai_walk(6);}; +void() hknight_walk14 =[ $walk14, hknight_walk15 ] {ai_walk(2);}; +void() hknight_walk15 =[ $walk15, hknight_walk16 ] {ai_walk(2);}; +void() hknight_walk16 =[ $walk16, hknight_walk17 ] {ai_walk(4);}; +void() hknight_walk17 =[ $walk17, hknight_walk18 ] {ai_walk(3);}; +void() hknight_walk18 =[ $walk18, hknight_walk19 ] {ai_walk(3);}; +void() hknight_walk19 =[ $walk19, hknight_walk20 ] {ai_walk(3);}; +void() hknight_walk20 =[ $walk20, hknight_walk1 ] {ai_walk(2);}; + +//=========================================================================== +// RUN + +// Checks if the Bane can use a nearby dead body. +void() bane_magicd1; +void() bane_magice1; +void(float d) hk_run = +{ + if (self.classname == "monster_bane") + { + d = d * 2; + + if (!self.waitmax) + { + if (ai_medic (d)) + { + // Hack: Set attack_finished higher than time so + // that CheckForCharge fails, which would otherwise + // bypass ritual anim. +// if ( self.frame == $run1 ) + self.attack_finished = time + 0.2; + bane_magicd1 (); + return; + } + + if (self.search_time + 5 < time) + if (self.enemy) + if (!visible (self.enemy)) + { // Teleport to the enemy. +// if ( self.frame == $run1 ) + self.attack_finished = time + 0.2; + self.search_time = time; //+ 5; + bane_magice1 (); + return; + } + } + } + ai_run (d); +}; +void() hknight_run1 =[ $run1, hknight_run2 ] {if (self.classname == "monster_dark_lord") {self.th_run(); return;}hk_idle_sound(); hk_run(20); CheckForCharge();}; +void() hknight_run2 =[ $run2, hknight_run3 ] {M_Step(); hk_run(25);}; +void() hknight_run3 =[ $run3, hknight_run4 ] {hk_run(18);}; +void() hknight_run4 =[ $run4, hknight_run5 ] {hk_run(16);}; +void() hknight_run5 =[ $run5, hknight_run6 ] {hk_run(14);}; +void() hknight_run6 =[ $run6, hknight_run7 ] {M_Step(); hk_run(25);}; +void() hknight_run7 =[ $run7, hknight_run8 ] {hk_run(21);}; +void() hknight_run8 =[ $run8, hknight_run1 ] {hk_run(13);}; + +//============================================================================ +// PAIN + +// Makes the Bane gray and ghostly. Called by 'painc' and 'magice' series. +void() bane_gray = +{ + if (self.health <= self.waitmin) + { // Set up clone magic. + self.health = self.waitmin; // Yes, reset health. + self.waitmax = // If lower than min, then max too. + self.waitmin = 0; // Cannot use clone trick again. + self.cnt = skill; // Number of clones to spawn. + if (cranked) + self.cnt = self.cnt + 1; + } + else + self.cnt = 0; + // Now the Bane becomes a phantom as he shadow walks. + self.touch = SUB_Null; // In case of jump attack. + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + self.skin = SKIN_BANE_GRAY; // Use grayscale Bane. +}; + +// Taking a hint from the axeman... +// Update: Removed 'ai_forward(6);' from first frame to stop stack overflow. +void() bane_pain1 =[ $pain1, bane_pain2 ] {}; +void() bane_pain2 =[ $pain2, bane_pain3 ] {ai_forward(8);}; +void() bane_pain3 =[ $pain4, bane_pain4 ] {ai_forward(4);}; +void() bane_pain4 =[ $pain5, hknight_run1 ] {ai_forward(2);}; + +void() bane_painb1=[ $pain1, bane_pain3 ] {}; + +// This pain makes the Bane pull the log trick from Naruto, +// only leave behind a fading image of the Bane instead of a log. +void() bane_painc1=[ $pain1, bane_magice9 ] +{ + bane_gray(); + bane_shadow(); + self.nextthink = time + 0.5; + self.modelindex = 0; + EntryPoint_Spawn (self, self.enemy, self.enemy.origin, EntryPoint_Random); +}; + +void() hknight_pain1 =[ $pain1, hknight_pain2 ] {}; // Sound already done in pain func. +void() hknight_pain2 =[ $pain2, hknight_pain3 ] {}; +void() hknight_pain3 =[ $pain3, hknight_pain4 ] {}; +void() hknight_pain4 =[ $pain4, hknight_pain5 ] {}; +void() hknight_pain5 =[ $pain5, hknight_run1 ] {}; + +void() hkfast_pain1 =[ $pain1, hknight_pain4 ] {}; + +//============================================================================ +// DEATH + +// PM: Beware -- With ai_forward on the first kill frame, T_Damage may be +// called at least twice on touch kills! +void() hknight_decap1 =[ $decap1, hknight_decap2 ] {ai_forward(10); blood_spray('-2 0 28', 1);}; +void() hknight_decap2 =[ $decap2, hknight_decap3 ] {ai_forward(8); blood_spray('-3 0 26', 2);}; +void() hknight_decap3 =[ $decap3, hknight_decap4 ] {monster_drop(); ai_forward(7); blood_spray('-3 0 17', 1);}; +void() hknight_decap4 =[ $decap4, hknight_decap5 ] {}; +void() hknight_decap5 =[ $decap5, hknight_decap6 ] {}; +void() hknight_decap6 =[ $decap6, hknight_decap7 ] {}; +void() hknight_decap7 =[ $decap7, hknight_decap8 ] {blood_spray('8 -1 11', -1);}; +void() hknight_decap8 =[ $decap8, hknight_decap9 ] {ai_forward(10);}; +void() hknight_decap9 =[ $decap9, hknight_decap10 ] {ai_forward(11);}; +void() hknight_decap10 =[ $decap10, hknight_decap11 ] {}; +void() hknight_decap11 =[ $decap11, hknight_decap12 ] {}; +void() hknight_decap12 =[ $decap12, decap_end ] {}; + +void() hknight_decapb1 =[ $decapb1, hknight_decapb2 ] {blood_spray('-3 0 33', 1);}; +void() hknight_decapb2 =[ $decapb2, hknight_decapb3 ] {blood_spray('-12 0 32', 2);}; +void() hknight_decapb3 =[ $decapb3, hknight_decapb4 ] {blood_spray('-17 0 23', 1); monster_drop();}; +void() hknight_decapb4 =[ $decapb4, hknight_decapb5 ] {blood_spray('-19 0 12', 1);}; +void() hknight_decapb5 =[ $decapb5, hknight_decapb6 ] {}; +void() hknight_decapb6 =[ $decapb6, hknight_decapb7 ] {}; +void() hknight_decapb7 =[ $decapb7, hknight_decapb8 ] {}; +void() hknight_decapb8 =[ $decapb8, hknight_decapb9 ] {}; +void() hknight_decapb9 =[ $decapb9, decap_end ] {}; + +void() hknight_die1 =[ $death1, hknight_die2 ] {ai_forward(10);}; +void() hknight_die2 =[ $death2, hknight_die3 ] {ai_forward(8);}; +void() hknight_die3 =[ $death3, hknight_die4 ] {monster_drop(); ai_forward(7);}; +void() hknight_die4 =[ $death4, hknight_die5 ] {}; +void() hknight_die5 =[ $death5, hknight_die6 ] {}; +void() hknight_die6 =[ $death6, hknight_die7 ] {}; +void() hknight_die7 =[ $death7, hknight_die8 ] {}; +void() hknight_die8 =[ $death8, hknight_die9 ] {ai_forward(10);}; +void() hknight_die9 =[ $death9, hknight_die10 ] {ai_forward(11);}; +void() hknight_die10 =[ $death10, hknight_die11 ] {}; +void() hknight_die11 =[ $death11, hknight_die12 ] {}; +void() hknight_die12 =[ $death12, monster_end ] {}; + +void() hknight_dieb1 =[ $deathb1, hknight_dieb2 ] {}; +void() hknight_dieb2 =[ $deathb2, hknight_dieb3 ] {}; +void() hknight_dieb3 =[ $deathb3, hknight_dieb4 ] {monster_drop();}; +void() hknight_dieb4 =[ $deathb4, hknight_dieb5 ] {}; +void() hknight_dieb5 =[ $deathb5, hknight_dieb6 ] {}; +void() hknight_dieb6 =[ $deathb6, hknight_dieb7 ] {}; +void() hknight_dieb7 =[ $deathb7, hknight_dieb8 ] {}; +void() hknight_dieb8 =[ $deathb8, hknight_dieb9 ] {}; +void() hknight_dieb9 =[ $deathb9, monster_end ] {}; + +float(float dm) hknight_gib = +{ +// check for gib + if (self.health < self.gib_health) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowHead ("progs/h_hellkn.mdl", dm); + return TRUE; + } + return FALSE; +}; + +void() hknight_die = +{ +// check for gib + if (Shattered ()) + return; + if (self.th_gib) + { + if (Decapitated ()) + { + if (random() < 0.5) + monster_decap ('-2 0 28', hknight_decap1); + else + monster_decap ('-3 0 33', hknight_decapb1); + return; + } + if (hknight_gib (self.health)) + return; + } + +// regular death + if (self.classname == "monster_hell_lord") + sound (self, CHAN_VOICE, "archer/death2.wav", 1, ATTN_NORM); + else if (self.classname == "monster_bane") + { + if (self.skin == SKIN_BANE_GRAY) + self.skin = SKIN_BANE; + sound (self, CHAN_VOICE, "bane/death.wav", 1, ATTN_NONE); + } + else + sound (self, CHAN_VOICE, "hknight/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) + hknight_die1 (); + else + hknight_dieb1 (); +}; + +float BANE_CHAT = 1; +float BANE_RAGE = 2; +float BANE_CLONE = 4; + +// Broadcast message to players as if the Bane was a client. +void(string text) Bane_Speaks = +{ + local entity pl; + + pl = find(world, classname, "player"); + while (pl) + { + sound (pl, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); + pl = find(pl, classname, "player"); + } + bprint (text); +}; + +void() bane_die = +{ +// ... You win... for now. (Ôèå Âáîåº ®®® Ùïõ ÷éî®®® æïò îï÷®) +// ... I'll be back! (Ôèå Âáîåº ®®® Éàìì âå âáãë¡) +// ... I will return! (Ôèå Âáîåº ®®® É ÷éìì òåôõòî¡) +// ... We will meet again! (Ôèå Âáîåº ®®® ×å ÷éìì íååô áçáéî¡) +// Update: New taunts hinting of nsoe6. + if (random() < 0.5) // ... I still have the runes! + Bane_Speaks ("Ôèå Âáîåº ®®® É óôéìì èáöå ôèå òõîåó¡\n"); + else // ... You have not won yet! + Bane_Speaks ("Ôèå Âáîåº ®®® Ùïõ èáöå îïô ÷ïî ùåô¡\n"); + hknight_die (); +}; + + +//============================================================================ + +// REVIVE - - - - - - - - - - - - - - - +void() hknight_revive1 =[ $death11, hknight_revive2 ] {}; +void() hknight_revive2 =[ $death10, hknight_revive3 ] {}; +void() hknight_revive3 =[ $death9, hknight_revive4 ] {}; +void() hknight_revive4 =[ $death8, hknight_revive5 ] {}; +void() hknight_revive5 =[ $death7, hknight_revive6 ] {}; +void() hknight_revive6 =[ $death6, hknight_revive7 ] {}; +void() hknight_revive7 =[ $death5, hknight_revive8 ] {}; +void() hknight_revive8 =[ $death4, hknight_revive9 ] {}; +void() hknight_revive9 =[ $death3, hknight_revive10 ] {}; +void() hknight_revive10 =[ $death2, hknight_revive11 ] {}; +void() hknight_revive11 =[ $death1, hknight_revive12 ] {}; +void() hknight_revive12 =[ $stand1, hknight_run1 ] {}; + +void() hknight_reviveb1 =[ $deathb8, hknight_reviveb2 ] {}; +void() hknight_reviveb2 =[ $deathb7, hknight_reviveb3 ] {}; +void() hknight_reviveb3 =[ $deathb6, hknight_reviveb4 ] {}; +void() hknight_reviveb4 =[ $deathb5, hknight_reviveb5 ] {}; +void() hknight_reviveb5 =[ $deathb4, hknight_reviveb6 ] {}; +void() hknight_reviveb6 =[ $deathb3, hknight_reviveb7 ] {}; +void() hknight_reviveb7 =[ $deathb2, hknight_reviveb8 ] {}; +void() hknight_reviveb8 =[ $deathb1, hknight_revive12 ] {}; + +void() hknight_revive = +{ + if ( self.frame == $deathb9 ) + hknight_reviveb1 (); + else //if ( self.frame == $death10 ) + hknight_revive1 (); +}; + + +//============================================================================ +// BANE JUMP + +void() Bane_JumpTouch; +void(float d) hk_charge; + +// We need these first three jump frame functions in case the Bane +// needs to jump again without selecting other random attacks. +void() bane_jump1 =[ $char_a1, bane_jump2 ] {hk_charge(20); + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); +}; +void() bane_jump2 =[ $char_a2, bane_jump3 ] {hk_charge(18);}; +void() bane_jump3 =[ $char_a3, bane_jump4 ] {hk_charge(16);}; +void() bane_jump4 =[ $char_a4, bane_jump5 ] +{ + if (self.health <= 0) + {self.touch = SUB_Null; self.think = hknight_die1; return;} + + local float g; + + g = cvar("sv_gravity") / 800; + + ai_face(); + // Bane is a bbeg, so don't bother with invisibility shenanigans. + // Ditto for the dark lord. + self.touch = Bane_JumpTouch; + makevectors (self.angles); + self.velocity = (v_forward * 600) + ('0 0 250' * g); + self.flags = self.flags - (self.flags & FL_ONGROUND); +}; +// Standard demon jumps reach level ground in about 0.5 sec in normal g. +void() bane_jump5 =[ $char_a5, bane_jump6 ] {self.nextthink = time + 0.5;}; +// If three seconds pass, assume stuck then jump again. +void() bane_jump6 =[ $char_a6, bane_jump1 ] {self.nextthink = time + 3;}; +void() bane_jump7 =[ $char_a8, hknight_char_a10 ] {}; + +void() Bane_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) + return; + + if (other.takedamage) + { + if ( vlen(self.velocity) > 400 ) + { + ldmg = 40 + 10*random(); + T_Damage (other, self, self, ldmg); + if (self.health <= 0) + return; // PM: Killed by thorns (empathy shields). + if (( self.frame == $char_a4 ) || ( self.frame == $char_a5 )) + { + self.frame = $char_a6; // Go to a stab frame. + sound (self, CHAN_WEAPON, "weapons/axhit.wav", 1, ATTN_NORM); + } + } + } + + if (!checkbottom(self)) + { + if (self.flags & FL_ONGROUND) + { // jump randomly to not get hung up +//dprint ("popjump\n"); + self.touch = SUB_Null; + self.think = bane_jump1; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + self.think = bane_jump7; + self.nextthink = time + 0.1; +}; + +float() CheckBaneJump = +{ + local vector dist; + local float d; + +// FIXME: Check if jump will land on solid ground. + +// Elevation check done in CheckForCharge. +// d = self.enemy.origin_z + self.enemy.mins_z; +// if (self.origin_z + self.mins_z > d + 0.75 * self.enemy.size_z) +// return FALSE; // Target is too low. +// if (self.origin_z + self.maxs_z < d + 0.25 * self.enemy.size_z) +// return FALSE; // Target is too high. + + dist = self.enemy.origin - self.origin; + dist_z = 0; + d = vlen(dist); + if (d < 100) + return FALSE; // Target is too close. +// if (d > 200) +// if (random() < 0.9) +// return FALSE; + if (d > 1000) + return FALSE; // Target is too far away. + return TRUE; +}; + +/* DISABLED +// 8/9/10: Jumping anim. +void() hknight_jumptouch = +{ +// If it is the Bane attacking, use its attack code instead. + if (self.enemy) + if (self.enemy == other) + if ((self.classname == "monster_bane") || (self.classname == "monster_dark_lord")) + { + self.touch = Bane_JumpTouch; + Bane_JumpTouch (); + return; + } + + if (self.health <= 0) + return; + + self.touch = SUB_Null; + self.think = hknight_run6; + self.nextthink = time + 0.1; +}; +// velocity and onground assumed to be set by jump trigger. +void() hknight_jump1 =[ $char_a4, hknight_jump2 ] {self.touch = hknight_jumptouch;}; +void() hknight_jump2 =[ $char_a5, hknight_run6 ] {self.nextthink = time + 3;}; +*/ + +//============================================================================ +// BANE AI + +void() bane_strafe = +{ + if (self.classname == "monster_bane") + { + // Strafing distance was defined by movedist, which could be + // anything. Drake has removed movedist, and since this progs + // is based on Drake, set distance here. + + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); + bane_shadow (); // Shadow trails, like shadow kick. + ai_run_strafe (20); // Player walk speed. + } +}; + +void() hk_face = {ai_face(); bane_strafe();}; + +//============================================================================ +// ATTACK #1 (Modified for Lightning Airstrike) + +// Here for incidental damage in case enemy runs up to melee range while +// the sword is coming down during the magica animation. +void() magica_sword_chop = +{ + local float ldmg, side; + local vector delta; + + ai_face (); + // movement done elsewhere. + + delta = self.enemy.origin - self.origin; + + if (!InMeleeRange (80)) // 100 is too long. + return; + if (!CanDamage (self.enemy, self)) + return; + if (self.classname != "monster_bane") + if (self.classname != "monster_dark_lord") + if (IsGhost (self.enemy)) + return; // Not allowed to hit wraith. + + sound (self, CHAN_WEAPON, "weapons/axhit.wav", 1, ATTN_NORM); + makevectors (self.angles); + ldmg = 20 + 10*random(); // Player normally does 20 damage with axe. + side = crandom() * 50; + delta = (side * v_right) + (50 * v_up); + + T_NewDamage (self.enemy, self, self, ldmg, 0, "melee"); + SpawnMeatSpray (self.origin + v_forward*16, delta, self.enemy.bloodtype); +}; + +// Bane summons a thunderstorm. +void() bane_magica1 =[ $magica1, bane_magica2 ] {bane_storm( $magica1, $magica13 ); hk_face();}; +void() bane_magica2 =[ $magica2, bane_magica3 ] {hk_face();}; +void() bane_magica3 =[ $magica3, bane_magica4 ] {hk_face();}; +void() bane_magica4 =[ $magica4, bane_magica5 ] {hk_face();}; +void() bane_magica5 =[ $magica5, bane_magica6 ] {hk_face();}; +void() bane_magica6 =[ $magica6, bane_magica7 ] {hk_face();}; +void() bane_magica7 =[ $magica7, bane_magica8 ] {hk_face();}; +void() bane_magica8 =[ $magica8, bane_magica9 ] {hk_face();}; +void() bane_magica9 =[ $magica9, bane_magica10 ] {hk_face(); magica_sword_chop();}; +void() bane_magica10 =[ $magica10, hknight_magica11 ] {hk_face();}; +//void() bane_magica10 =[ $magica10, bane_magica11 ] {hk_face();}; +//void() bane_magica11 =[ $magica11, bane_magica12 ] {hk_face();}; +//void() bane_magica12 =[ $magica12, bane_magica13 ] {hk_face();}; +//void() bane_magica13 =[ $magica13, bane_magica14 ] {hk_face();}; +//void() bane_magica14 =[ $magica14, hknight_run1 ] {hk_face();}; + +void() darklord_magica1 =[ $magica1, darklord_magica2 ] {hk_face();}; +void() darklord_magica2 =[ $magica2, darklord_magica3 ] {hk_face();}; +void() darklord_magica3 =[ $magica3, darklord_magica4 ] {hk_face();}; +void() darklord_magica4 =[ $magica4, darklord_magica5 ] {hk_face();}; +void() darklord_magica5 =[ $magica5, darklord_magica6 ] {hk_face(); + ReflectorShield (self); + sound(self, 6, "items/protect.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; // Uninterruptable by this point. +}; +void() darklord_magica6 =[ $magica6, darklord_magica7 ] {hk_face();}; +void() darklord_magica7 =[ $magica7, darklord_magica8 ] {hk_face();}; +void() darklord_magica8 =[ $magica8, darklord_magica9 ] {hk_face();}; +void() darklord_magica9 =[ $magica9, darklord_magica10 ] {hk_face(); magica_sword_chop();}; +void() darklord_magica10 =[ $magica10, hknight_magica11 ] {hk_face(); + makevectors (self.angles); + M_Slam (self.origin + v_forward*46); + self.waitmin = time + 5; +}; + +// Hell Lords rain meteors down. +void() lord_meteor = {boss_meteor('50 0 100', 300, FALSE, FALSE);}; +void() lord_magica7 =[ $magica7, lord_magica8 ] {hk_face(); lord_meteor();}; +void() lord_magica8 =[ $magica8, lord_magica9 ] {hk_face(); if (skill >= 3) lord_meteor();}; +void() lord_magica9 =[ $magica9, lord_magica10 ] {hk_face(); magica_sword_chop();}; +void() lord_magica10 =[ $magica10, hknight_magica11 ] {hk_face();}; + +// Cranked Hell Knights summon a bolt of lightning as a pillar. +// Should launch a vacuum wave instead like in anime or J-style games, +// but that may not look so great in Quake. So, use lightning for now. +void() hknight_magica1 =[ $magica1, hknight_magica2 ] {hk_face();}; +void() hknight_magica2 =[ $magica2, hknight_magica3 ] {hk_face();}; +void() hknight_magica3 =[ $magica3, hknight_magica4 ] {hk_face();}; +void() hknight_magica4 =[ $magica4, hknight_magica5 ] {hk_face();}; +void() hknight_magica5 =[ $magica5, hknight_magica6 ] {hk_face();}; +void() hknight_magica6 =[ $magica6, hknight_magica7 ] {hk_face(); + if (self.classname == "monster_hell_lord") + self.think = lord_magica7; +}; +//void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hknight_shot(-2);}; +//void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hknight_shot(-1);}; +//void() hknight_magica9 =[ $magica9, hknight_magica10 ] {hknight_shot(0);}; +//void() hknight_magica10 =[ $magica10, hknight_magica11 ] {hknight_shot(1);}; +//void() hknight_magica11 =[ $magica11, hknight_magica12 ] {hknight_shot(2);}; +//void() hknight_magica12 =[ $magica12, hknight_magica13 ] {hknight_shot(3);}; +void() hknight_magica7 =[ $magica7, hknight_magica8 ] {hk_face();}; +void() hknight_magica8 =[ $magica8, hknight_magica9 ] {hk_face();}; +void() hknight_magica9 =[ $magica9, hknight_magica10 ] {hk_face(); magica_sword_chop(); M_Lightwall ();}; +void() hknight_magica10 =[ $magica10, hknight_magica11 ] {hk_face();}; +void() hknight_magica11 =[ $magica11, hknight_magica12 ] {hk_face();}; +void() hknight_magica12 =[ $magica12, hknight_magica13 ] {hk_face();}; +void() hknight_magica13 =[ $magica13, hknight_magica14 ] {hk_face();}; +void() hknight_magica14 =[ $magica14, hknight_run1 ] {hk_face();}; + +//============================================================================ +// ATTACK #2 (Modified for Fireball) + +// Hell Lords launches more magic missiles. Bane launches more fireballs. +void() lord_magicb6 =[ $magicb6, lord_magicb7 ] {hknight_shot(0); bane_strafe();}; +void() lord_magicb7 =[ $magicb7, lord_magicb8 ] {hknight_shot(-1); bane_strafe();}; +void() lord_magicb8 =[ $magicb8, lord_magicb9 ] {hknight_shot(0); bane_strafe();}; +void() lord_magicb9 =[ $magicb9, lord_magicb10 ] {hknight_shot(1); bane_strafe();}; +void() lord_magicb10 =[ $magicb10, hknight_magicb11 ] {hknight_shot(0); bane_strafe();}; + +void() darklord_magicb6 =[ $magicb6, darklord_magicb7 ] {hk_face();}; +void() darklord_magicb7 =[ $magicb7, darklord_magicb8 ] {hk_face();}; +void() darklord_magicb8 =[ $magicb8, darklord_magicb9 ] {hk_face(); hknight_shot(0); + local vector org; + + makevectors (self.angles); + org = self.origin + (v_forward*16) + (v_right*2) + (v_up*24); + MakeFancy (org, X32_STAR_RED, 2); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "plasma/fire.wav", 1, ATTN_NORM); +// SUB_AttackFinished (3); + M_Reload (3); // Three second delay before next salvo in non-NM. +}; +void() darklord_magicb9 =[ $magicb9, darklord_magicb10 ] {hk_face(); hknight_shot(-1);}; +void() darklord_magicb10 =[ $magicb10, hknight_magicb11 ] {hk_face(); hknight_shot(1);}; + +// Hell Knights launch a single fireball to the ground, like in Quoth. +void() hknight_magicb1 =[ $magicb1, hknight_magicb2 ] {hk_face();}; +void() hknight_magicb2 =[ $magicb2, hknight_magicb3 ] {hk_face();}; +void() hknight_magicb3 =[ $magicb3, hknight_magicb4 ] {hk_face();}; +void() hknight_magicb4 =[ $magicb4, hknight_magicb5 ] {hk_face();}; +void() hknight_magicb5 =[ $magicb5, hknight_magicb6 ] {hk_face(); +if (self.classname == "monster_dark_lord") + {self.think = darklord_magicb6; return;} +// Update 6/18/2011: If hell knight uses this, use hell lord missiles. +if (self.classname != "monster_hkboss") + self.think = lord_magicb6; +}; +void() hknight_magicb6 =[ $magicb6, hknight_magicb7 ] {hk_face();}; +//void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hknight_shot(-2);}; +//void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hknight_shot(-1);}; +//void() hknight_magicb9 =[ $magicb9, hknight_magicb10 ] {hknight_shot(0);}; +//void() hknight_magicb10 =[ $magicb10, hknight_magicb11 ] {hknight_shot(1);}; +//void() hknight_magicb11 =[ $magicb11, hknight_magicb12 ] {hknight_shot(2);}; +//void() hknight_magicb12 =[ $magicb12, hknight_magicb13 ] {hknight_shot(3);}; +void() hknight_magicb7 =[ $magicb7, hknight_magicb8 ] {hk_face();}; +void() hknight_magicb8 =[ $magicb8, hknight_magicb9 ] {hk_face();}; +void() hknight_magicb9 =[ $magicb9, hknight_magicb10 ] {hk_face(); +// if (self.classname == "monster_hkboss") + M_Shal30 ('12 2 24'); // Vore bomb as in Rapture (and others). +// else +// M_FireKnight ('12 2 24', TRUE); +}; +void() hknight_magicb10 =[ $magicb10, hknight_magicb11 ] {hk_face();}; +void() hknight_magicb11 =[ $magicb11, hknight_magicb12 ] {hk_face();}; +void() hknight_magicb12 =[ $magicb12, hknight_magicb13 ] {hk_face();}; +void() hknight_magicb13 =[ $magicb13, hknight_run1 ] {hk_face(); +if (self.classname == "monster_dark_lord") + SUB_CheckRefire (hknight_magicb1); +}; + +//============================================================================ +// ATTACK #3 (Standard) + +void() hknight_magicc1 =[ $magicc1, hknight_magicc2 ] {hk_face();}; +void() hknight_magicc2 =[ $magicc2, hknight_magicc3 ] {hk_face();}; +void() hknight_magicc3 =[ $magicc3, hknight_magicc4 ] {hk_face();}; +void() hknight_magicc4 =[ $magicc4, hknight_magicc5 ] {hk_face();}; +void() hknight_magicc5 =[ $magicc5, hknight_magicc6 ] {hk_face();}; +void() hknight_magicc6 =[ $magicc6, hknight_magicc7 ] {hknight_shot(-2); bane_strafe();}; +void() hknight_magicc7 =[ $magicc7, hknight_magicc8 ] {hknight_shot(-1); bane_strafe();}; +void() hknight_magicc8 =[ $magicc8, hknight_magicc9 ] {hknight_shot(0); bane_strafe();}; +void() hknight_magicc9 =[ $magicc9, hknight_magicc10 ] {hknight_shot(1); bane_strafe();}; +void() hknight_magicc10 =[ $magicc10, hknight_magicc11 ] {hknight_shot(2); bane_strafe();}; +void() hknight_magicc11 =[ $magicc11, hknight_run1 ] {hknight_shot(3); bane_strafe();}; + +//============================================================================ +// ATTACK #4 (Firewall -- Used by Hell Lords) +void() hknight_magicd1 =[ $magica1, hknight_magicd2 ] {hk_face();}; +void() hknight_magicd2 =[ $magica14, hknight_magicd3 ] {hk_face();}; +void() hknight_magicd3 =[ $magica13, hknight_magicd4 ] {hk_face();}; +void() hknight_magicd4 =[ $magica12, hknight_magicd5 ] {hk_face();}; +void() hknight_magicd5 =[ $magica11, hknight_magicd6 ] {hk_face(); sound (self, CHAN_WEAPON, "weapons/fwalltap.wav", 1, ATTN_NORM);}; +void() hknight_magicd6 =[ $magica10, hknight_magicd7 ] {hk_face();}; +void() hknight_magicd7 =[ $magica9, hknight_magicd8 ] {hk_face(); M_Firewall();}; +void() hknight_magicd8 =[ $magica8, hknight_magicd9 ] {hk_face();}; +void() hknight_magicd9 =[ $magica4, hknight_magicd10 ] {hk_face();}; +void() hknight_magicd10 =[ $magica3, hknight_magicd11 ] {hk_face();}; +void() hknight_magicd11 =[ $magica2, hknight_magicd12 ] {hk_face();}; +void() hknight_magicd12 =[ $magica1, hknight_run1 ] {hk_face();}; + +//============================================================================ +// ATTACK #5 (Wrath Summoning -- Used by Dark Lords) + +void() monster_wrath; +void() wrath_grow1; + +// FIXME: Wrath summoning uses old code that needs updating. +void() dk_shield; +void() darklord_magicd1 =[ $magica1, darklord_magicd2 ] {hk_face();}; +void() darklord_magicd2 =[ $magica14, darklord_magicd3 ] {hk_face();}; +void() darklord_magicd3 =[ $magica13, darklord_magicd4 ] {hk_face();}; +void() darklord_magicd4 =[ $magica12, darklord_magicd5 ] {hk_face();}; +void() darklord_magicd5 =[ $magica11, darklord_magicd6 ] {hk_face();}; +void() darklord_magicd6 =[ $magica10, darklord_magicd7 ] {hk_face();}; +void() darklord_magicd7 =[ $magica9, hknight_magicd8 ] {hk_face(); SpawnMonster_Horde(ID_MP2_WRATH, 3); dk_shield();}; + +//============================================================================ +// ATTACK #6 (Monster Resurrection -- Bane exclusive) + +void() bane_magicd1 =[ $magica1, bane_magicd2 ] {ai_ritual();}; +void() bane_magicd2 =[ $magica14, bane_magicd3 ] {ai_ritual();}; +void() bane_magicd3 =[ $magica13, bane_magicd4 ] {ai_ritual();}; +void() bane_magicd4 =[ $magica12, bane_magicd5 ] {ai_ritual();}; +void() bane_magicd5 =[ $magica11, bane_magicd6 ] {ai_ritual();}; +void() bane_magicd6 =[ $magica10, bane_magicd7 ] {ai_ritual();}; +void() bane_magicd7 =[ $magica9, bane_magicd8 ] {ai_ritual();}; +void() bane_magicd8 =[ $magica8, bane_magicd12 ] {ai_ritual(); self.fallen = world;}; +//void() bane_magicd9 =[ $magica7, bane_magicd10 ] {}; +//void() bane_magicd10 =[ $magica6, bane_magicd11 ] {}; +//void() bane_magicd11 =[ $magica5, bane_magicd12 ] {}; +void() bane_magicd12 =[ $magica4, bane_magicd13 ] {}; +void() bane_magicd13 =[ $magica3, bane_magicd14 ] {}; +void() bane_magicd14 =[ $magica2, bane_magicd15 ] {}; +void() bane_magicd15 =[ $magica1, hknight_run1 ] {}; + +//============================================================================ +// ATTACK #7 (Teleportation and Cloning -- also Bane exclusive) + +void() bane_magice1 =[ $magicb1, bane_magice2 ] {bane_gray(); hk_face();}; +void() bane_magice2 =[ $magicb2, bane_magice3 ] {hk_face();}; +void() bane_magice3 =[ $magicb3, bane_magice4 ] {hk_face();}; +void() bane_magice4 =[ $magicb4, bane_magice5 ] {hk_face();}; +void() bane_magice5 =[ $magicb5, bane_magice6 ] {hk_face();}; +void() bane_magice6 =[ $magicb6, bane_magice7 ] {hk_face();}; +void() bane_magice7 =[ $magicb7, bane_magice8 ] {hk_face();}; +void() bane_magice8 =[ $magicb8, bane_magice9 ] {hk_face(); +// Disappear then teleport. + self.nextthink = time + 1; + self.modelindex = 0; + if (self.cnt > 0) + EntryPoint_Spawn (self, self, self.origin, EntryPoint_Random); + else + { if (!EntryPoint_Spawn (self, self.enemy, self.enemy.origin, EntryPoint_LongRandom)) + EntryPoint_Spawn (self, self, self.origin, EntryPoint_Random); + } +}; +void() bane_magice9 =[ $magicb8, bane_magice10 ] {self.alpha = 0.2; + self.modelindex = self.mindex2; + hk_face(); + if (self.cnt > 0) + { + self.cnt = self.cnt - 1; // Do before cloning. + // Don't let the clones spawn more clones. + if (self.master.classname != self.classname) + clone_spawn(); // Only the master can clone himself. + } +}; +void() bane_magice10 =[ $magicb8, bane_magice11 ] {self.alpha = 0.4; hk_face();}; +void() bane_magice11 =[ $magicb9, bane_magice12 ] {self.alpha = 0.6; hk_face();}; +void() bane_magice12 =[ $magicb10, bane_magice13 ] {self.alpha = 0.8; hk_face();}; +void() bane_magice13 =[ $magicb11, bane_magice14 ] {self.alpha = 0; hk_face(); + if (self.cnt < 1) + { if (walkmove (0, 0)) + { + self.takedamage = DAMAGE_AIM; + self.solid = SOLID_SLIDEBOX; + self.skin = SKIN_BANE; + // Last minute feature: The Bane speaks! + if (!self.master) + if (self.height) + { + if (self.height & BANE_CLONE) + { + if (random() < 0.5) // Die, maggot! + Bane_Speaks ("Ôèå Âáîåº Äéå¬ íáççïô¡\n"); + else // Now die! + Bane_Speaks ("Ôèå Âáîåº Îï÷ äéå¡\n"); + } + else if (self.height & BANE_RAGE) + { + if (random() < 0.5) // Behold my power! + Bane_Speaks ("Ôèå Âáîåº Âåèïìä¬ íù ðï÷åò¡\n"); + else // Feel my wrath! + Bane_Speaks ("Ôèå Âáîåº Æååì íù ÷òáôè¡\n"); + } + self.height = BANE_CHAT; + } + return; + } + } +// Either not done cloning, or unable to move at current location. +// Either way, use dimensional travel magic again. + self.think = bane_magice8; +}; +void() bane_magice14 =[ $magicb12, bane_magice15 ] {hk_face();}; +void() bane_magice15 =[ $magicb13, hknight_run1 ] {hk_face();}; + +//=========================================================================== + +void() hknight_magic = +{ +// if (cranked && (random() < 0.25)) +// hknight_magica1 (); +// else + hknight_magicc1 (); +}; + +void() lord_magic = +{ + local float r; + local float add, opt; + + add = 1; + opt = 2; + + if (M_FirewallCheck ()) // In fire.qc. + opt = opt + 1; + // Using 50 and 100 as sides of a right triangle, hypotenuse is 111.8. + if (M_MeteorCheck ('50 0 112')) // In boss.qc. Was '50 -50 100'. + {add = 0; opt = opt + 1;} + + r = random() * opt + add; + if (r <= 1) + hknight_magica1 (); // Meteor + else if (r <= 2) + hknight_magicb1 (); // Magic missile straight + else if (r <= 3) + hknight_magicc1 (); // Magic missile spread + else + hknight_magicd1 (); // Firewall +}; + +// FIXME: Is this done aside from missing corpse scan/use? +void() darklord_magic = +{ +// Todo: +// If close, use slam, charge, or melee. +// else, shoot or summon. + local float dist; + +// FIXME: Check for corpses to make wraths from. +// if (self.pets < skill) +// if (random() < 0.1) +// if (random() < (skill - self.pets) * 0.1) + if (self.spawnflags & 2) + if (self.pets < 1) + if (self.waitmax < time) + {darklord_magicd1 (); return;} + +// Attacking... + dist = vlen(self.enemy.origin - self.origin); + if (dist <= DARKLORD_NEAR) + { + if (self.waitmin < time) + {darklord_magica1(); return;} // Thor's hand. + CheckForCharge (); + if (( self.frame == $char_a1 ) || ( self.frame == $char_b1 )) + return; + } + hknight_magicb1 (); // Magic missile straight +}; + +void() hkboss_magic = +{ +// Pattern: 1 pillar, 2 bombs, 1 spray. +// Old behavior should be magica->magicb->magicc, but it seemed to favor B? + local float r; + + r = AddOne() & 3; + if (!r) + hknight_magica1 (); + else if (r != 3) + hknight_magicb1 (); + else + hknight_magicc1 (); +}; + +void() bane_magic = +{ +// PM: Jumping done at charge anim. However... +// If enemy is low enough that CheckForCharge would abort, then we can +// check for jumping. We want the Bane to occasionally jump down toward +// the enemy, much like old SoE. +// Update: If enemy is above, try to teleport to higher ground occasionally. + if (random() < 0.25) + if (CheckBaneJump ()) + { + if (self.origin_z - self.enemy.origin_z > 20) + {bane_jump1 (); return;} + if (!self.waitmax) // Only if using new AI. + if (self.enemy.origin_z - self.origin_z > 20) + {bane_magice1 (); return;} + } + +// Check for thunderstorm. + if (!self.waitmax) + if (skill >= 1) + if (!bane_has_storm ()) + if (random() < 0.5) + if (UpIsSky (self.enemy.origin)) + {bane_magica1 (); return;} // Start a thunderstorm! + +// Spray some fireballs. + if (random() <= 0.5) + hknight_magicb1 (); + else + hknight_magicc1 (); +}; + +//=========================================================================== + +void(float side) bane_melee = +{ + if (self.classname != "monster_bane") + if (self.classname != "monster_dark_lord") + return; + + local float ldmg; + local vector delta; + + ai_face (); + // movement done elsewhere. + + delta = self.enemy.origin - self.origin; + + if (!InMeleeRange (80)) // 100 is too long. + return; + if (!CanDamage (self.enemy, self)) + return; + // Let the Bane hit ghosts. He's just that badass. + // Update: Dark Lord is Bane-Lite, at least in human form... + + sound (self, CHAN_WEAPON, "bane/hit.wav", 1, ATTN_NORM); + makevectors (self.angles); + ldmg = 10 + 5*random(); + if (side) + delta = side * v_right; + else + { + side = crandom() * 50; + delta = (side * v_right) + (50 * v_up); + } + + T_NewDamage (self.enemy, self, self, ldmg, DF_SCAR, "vorpal"); + SpawnMeatSpray (self.origin + v_forward*16, delta, self.enemy.bloodtype); +}; + +void(float d) hk_charge = +{ + if ((self.classname == "monster_bane") || (self.classname == "monster_dark_lord")) + { + local float dist; + + dist = d * 2; + if (!QC_CloseEnough (dist)) + d = dist; // Move double speed. + } + ai_charge (d); +}; +// PM: Added sounds like in my old Cranked mod. +void() hknight_char_a1 =[ $char_a1, hknight_char_a2 ] +{ +// PM: Don't use 'SUB_AttackFinished' because it won't be set on Nightmare, +// which results in a charge lock for the knight. In other words, don't let +// him forget his magic. + self.attack_finished = time + 2; //SUB_AttackFinished (2); + hk_charge(20); + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); +}; +void() hknight_char_a2 =[ $char_a2, hknight_char_a3 ] {M_Step(); hk_charge(25);}; +void() hknight_char_a3 =[ $char_a3, hknight_char_a4 ] {hk_charge(18);}; +void() hknight_char_a4 =[ $char_a4, hknight_char_a5 ] +{ +// The bane may jump instead. Now is the best time to check. +// Update 3/27/09: Allow dark lord the priviledge too. + if ((self.classname == "monster_bane") || (self.classname == "monster_dark_lord")) + if (CheckBaneJump ()) + if (random() < 0.5) + { + bane_jump4 (); + return; + } + hk_charge(16); +}; +void() hknight_char_a5 =[ $char_a5, hknight_char_a6 ] {hk_charge(14);}; +void() hknight_char_a6 =[ $char_a6, hknight_char_a7 ] {M_Step(); hk_charge(20); bane_melee(0); ai_melee();}; +void() hknight_char_a7 =[ $char_a7, hknight_char_a8 ] {hk_charge(21); ai_melee();}; +void() hknight_char_a8 =[ $char_a8, hknight_char_a9 ] {hk_charge(13); ai_melee();}; +void() hknight_char_a9 =[ $char_a9, hknight_char_a10 ] {hk_charge(20); ai_melee();}; +void() hknight_char_a10 =[ $char_a10, hknight_char_a11 ] {M_Step(); hk_charge(20); ai_melee();}; +void() hknight_char_a11 =[ $char_a11, hknight_char_a12 ] {hk_charge(18); ai_melee();}; +void() hknight_char_a12 =[ $char_a12, hknight_char_a13 ] {hk_charge(16); + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + bane_melee(200); +}; +void() hknight_char_a13 =[ $char_a13, hknight_char_a14 ] {hk_charge(14);}; +void() hknight_char_a14 =[ $char_a14, hknight_char_a15 ] {M_Step(); hk_charge(25);}; +void() hknight_char_a15 =[ $char_a15, hknight_char_a16 ] {hk_charge(21);}; +void() hknight_char_a16 =[ $char_a16, hknight_run1 ] {hk_charge(13);}; + +//=========================================================================== + +void() hknight_char_b1 =[ $char_b1, hknight_char_b2 ] +{ + self.attack_finished = time + 1; // PM: Don't use SUB_AttackFinished. + knight_sword_sound(); M_Step(); hk_charge(23); bane_melee(0); ai_melee(); +}; +void() hknight_char_b2 =[ $char_b2, hknight_char_b3 ] {hk_charge(17); ai_melee();}; +void() hknight_char_b3 =[ $char_b3, hknight_char_b4 ] {hk_charge(12); ai_melee();}; +void() hknight_char_b4 =[ $char_b4, hknight_char_b5 ] {M_Step(); hk_charge(22); ai_melee();}; +void() hknight_char_b5 =[ $char_b5, hknight_char_b6 ] {hk_charge(18); ai_melee();}; +void() hknight_char_b6 =[ $char_b6, hknight_run1 ] {hk_charge(8); ai_melee(); + if (vlen (self.origin - self.enemy.origin) < 80) + self.shots_left = 0; // Close enough for melee. + else + { + self.shots_left = self.shots_left - 1; + if (self.shots_left > 0) + self.think = hknight_char_b1; + } +}; + +//=========================================================================== + +void() bane_slice1 =[ $slice1, bane_slice2 ] {hk_charge(9);}; +void() bane_slice2 =[ $slice3, bane_slice3 ] {M_Step(); hk_charge(19);}; +void() bane_slice3 =[ $slice5, bane_slice4 ] {hk_charge(11); bane_melee(-200); ai_melee();}; +void() bane_slice4 =[ $slice6, bane_slice5 ] {hk_charge(15); ai_melee();}; +void() bane_slice5 =[ $slice7, bane_slice6 ] {M_Step(); hk_charge(8); ai_melee();}; +void() bane_slice6 =[ $slice9, bane_slice7 ] {hk_charge(2); ai_melee();}; +void() bane_slice7 =[ $slice10, hknight_run1 ] {hk_charge(3);}; + +void() hknight_slice1 =[ $slice1, hknight_slice2 ] {hk_charge(9);}; +void() hknight_slice2 =[ $slice2, hknight_slice3 ] {hk_charge(6);}; +void() hknight_slice3 =[ $slice3, hknight_slice4 ] {M_Step(); hk_charge(13);}; +void() hknight_slice4 =[ $slice4, hknight_slice5 ] {hk_charge(4);}; +void() hknight_slice5 =[ $slice5, hknight_slice6 ] {hk_charge(7); bane_melee(-200); ai_melee();}; +void() hknight_slice6 =[ $slice6, hknight_slice7 ] {hk_charge(15); ai_melee();}; +void() hknight_slice7 =[ $slice7, hknight_slice8 ] {M_Step(); hk_charge(8); ai_melee();}; +void() hknight_slice8 =[ $slice8, hknight_slice9 ] {hk_charge(2); ai_melee();}; +void() hknight_slice9 =[ $slice9, hknight_slice10 ] {ai_melee();}; +void() hknight_slice10 =[ $slice10, hknight_run1 ] {hk_charge(3);}; + +//=========================================================================== + +void() bane_smash1 =[ $smash2, bane_smash2 ] {hk_charge(14);}; +void() bane_smash2 =[ $smash4, bane_smash3 ] {M_Step(); hk_charge(20);}; +void() bane_smash3 =[ $smash5, bane_smash4 ] {hk_charge(10); bane_melee(0); ai_melee();}; +void() bane_smash4 =[ $smash6, bane_smash5 ] {hk_charge(7); ai_melee();}; +void() bane_smash5 =[ $smash7, bane_smash6 ] {hk_charge(12); ai_melee();}; +void() bane_smash6 =[ $smash8, bane_smash7 ] {hk_charge(2); ai_melee();}; +void() bane_smash7 =[ $smash9, bane_smash8 ] {M_Step(); hk_charge(3); ai_melee();}; +void() bane_smash8 =[ $smash11, hknight_run1 ] {hk_charge(0);}; + +void() hknight_smash1 =[ $smash1, hknight_smash2 ] {hk_charge(1);}; +void() hknight_smash2 =[ $smash2, hknight_smash3 ] {hk_charge(13);}; +void() hknight_smash3 =[ $smash3, hknight_smash4 ] {hk_charge(9);}; +void() hknight_smash4 =[ $smash4, hknight_smash5 ] {M_Step(); hk_charge(11);}; +void() hknight_smash5 =[ $smash5, hknight_smash6 ] {hk_charge(10); bane_melee(0); ai_melee();}; +void() hknight_smash6 =[ $smash6, hknight_smash7 ] {hk_charge(7); ai_melee();}; +void() hknight_smash7 =[ $smash7, hknight_smash8 ] {hk_charge(12); ai_melee();}; +void() hknight_smash8 =[ $smash8, hknight_smash9 ] {hk_charge(2); ai_melee();}; +void() hknight_smash9 =[ $smash9, hknight_smash10 ] {M_Step(); hk_charge(3); ai_melee();}; +void() hknight_smash10 =[ $smash10, hknight_smash11 ] {hk_charge(0);}; // Skipped in Neh. +void() hknight_smash11 =[ $smash11, hknight_run1 ] {hk_charge(0);}; + +//============================================================================ + +void() bane_watk1 =[ $w_attack1, bane_watk2 ] {hk_charge(2);}; +void() bane_watk2 =[ $w_attack5, bane_watk3 ] {bane_melee(0); ai_melee();}; +void() bane_watk3 =[ $w_attack7, bane_watk4 ] {hk_charge(1);}; +void() bane_watk4 =[ $w_attack8, bane_watk5 ] {hk_charge(4);}; +void() bane_watk5 =[ $w_attack9, bane_watk6 ] {hk_charge(5);}; +void() bane_watk6 =[ $w_attack10, bane_watk7 ] {hk_charge(3); ai_melee();}; +void() bane_watk7 =[ $w_attack11, bane_watk8 ] {M_Step(); hk_charge(2); ai_melee();}; +void() bane_watk8 =[ $w_attack13, bane_watk9 ] {hk_charge(2); ai_melee();}; +void() bane_watk9 =[ $w_attack14, bane_watk10 ] {hk_charge(0);}; +void() bane_watk10 =[ $w_attack16, bane_watk11 ] {hk_charge(1); + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +}; +void() bane_watk11 =[ $w_attack18, bane_watk12 ] {hk_charge(4); bane_melee(200); ai_melee();}; +void() bane_watk12 =[ $w_attack19, bane_watk13 ] {hk_charge(4); ai_melee();}; +void() bane_watk13 =[ $w_attack20, bane_watk14 ] {hk_charge(6);}; +void() bane_watk14 =[ $w_attack22, hknight_run1] {hk_charge(10);}; + +// Nehahra skipped every even frame in the scene. +void() hknight_watk1 =[ $w_attack1, hknight_watk2 ] {hk_charge(2);}; +void() hknight_watk2 =[ $w_attack2, hknight_watk3 ] {hk_charge(0);}; +void() hknight_watk3 =[ $w_attack3, hknight_watk4 ] {hk_charge(0);}; +void() hknight_watk4 =[ $w_attack4, hknight_watk5 ] {ai_melee();}; +void() hknight_watk5 =[ $w_attack5, hknight_watk6 ] {ai_melee();}; +void() hknight_watk6 =[ $w_attack6, hknight_watk7 ] {ai_melee();}; +void() hknight_watk7 =[ $w_attack7, hknight_watk8 ] {hk_charge(1);}; +void() hknight_watk8 =[ $w_attack8, hknight_watk9 ] {hk_charge(4);}; +void() hknight_watk9 =[ $w_attack9, hknight_watk10 ] {hk_charge(5);}; +void() hknight_watk10 =[ $w_attack10, hknight_watk11 ] {hk_charge(3); bane_melee(0); ai_melee();}; +void() hknight_watk11 =[ $w_attack11, hknight_watk12 ] {M_Step(); hk_charge(2); ai_melee();}; +void() hknight_watk12 =[ $w_attack12, hknight_watk13 ] {hk_charge(2); ai_melee();}; +void() hknight_watk13 =[ $w_attack13, hknight_watk14 ] {hk_charge(0);}; +void() hknight_watk14 =[ $w_attack14, hknight_watk15 ] {hk_charge(0);}; +void() hknight_watk15 =[ $w_attack15, hknight_watk16 ] {hk_charge(0); + // PM: Something from my old Cranked mod. + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +}; +void() hknight_watk16 =[ $w_attack16, hknight_watk17 ] {hk_charge(1);}; +void() hknight_watk17 =[ $w_attack17, hknight_watk18 ] {hk_charge(1); bane_melee(200); ai_melee();}; +void() hknight_watk18 =[ $w_attack18, hknight_watk19 ] {hk_charge(3); ai_melee();}; +void() hknight_watk19 =[ $w_attack19, hknight_watk20 ] {hk_charge(4); ai_melee();}; +void() hknight_watk20 =[ $w_attack20, hknight_watk21 ] {hk_charge(6);}; +void() hknight_watk21 =[ $w_attack21, hknight_watk22 ] {hk_charge(7);}; +void() hknight_watk22 =[ $w_attack22, hknight_run1 ] {hk_charge(3);}; + +//============================================================================ + +void(entity attacker, float damage) hknight_pain = +{ + if (self.pain_finished > time) + return; + + if (self.classname == "monster_hell_lord") + sound (self, CHAN_VOICE, "archer/pain2.wav", 1, ATTN_NORM); + else if (self.classname == "monster_dark_lord") + sound (self, CHAN_VOICE, "darklord/pain.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "hknight/pain1.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; + + // Removed mandatory pain anim after five seconds. + + if (random()*30 > damage) + return; // didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + if (self.classname == "monster_dark_lord") + { + if (self.lip > time) + return; // Too soon to flinch. + self.lip = time + 3; // Give him time to use magic. + + self.waitmax = 0; // Raise shield again ASAP! + + if (!self.mirror_finished) + self.effects = self.effects - (self.effects & EF_BRIGHTFIELD); + } + +// Update: Quicker pain for lords. + if ((self.classname == "monster_hell_lord") || (self.classname == "monster_dark_lord")) + if (random() < 0.5) + {hkfast_pain1 (); return;} + + hknight_pain1 (); + attacker = attacker; // FrikQcc warning squelch! +}; + +void(entity attacker, float damage) bane_pain = +{ +// Shadow clone magic check. + if (!self.waitmax) + { + if (self.health <= self.waitmin) // Does Bane have the ace in the hole? + if ((self.enemy == attacker) || (self.oldenemy == attacker)) // Is Bane fighting his enemy? + if (self.touch != Bane_JumpTouch) // Is Bane not locked in motion? + if (self.classname != self.master.classname) // Is Bane real? + if (walkmove (0, 0)) // Can the Bane move? + { //"Bushin no Kage!\n" + if (self.height) + self.height = self.height | BANE_CLONE; + sound (self, CHAN_VOICE, "bane/pain.wav", 1, ATTN_NORM); + // Cloning will take a while, so no need to add to pain_finished. + bane_painc1(); + return; + } + } + else + { + if (self.health <= self.waitmax) + if (self.touch != Bane_JumpTouch) // Is Bane not locked in motion? + if (self.classname != self.master.classname) // Is Bane real? + if (walkmove (0, 0)) // Can the Bane move? + { // The kid gloves come off. + self.health = self.waitmax; + self.waitmax = 0; + if (self.height) + self.height = self.height | BANE_RAGE; + sound (self, CHAN_VOICE, "bane/pain.wav", 1, ATTN_NORM); + bane_painc1(); + return; + } + } +//- - - - - - - - - + +// Normal pain code. + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, "bane/pain.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.touch == Bane_JumpTouch) + return; // Don't interrupt attack anim. +//- - - - - - - - - +// Teleport check. + if (!self.waitmax) + if (self.enemy) + if (walkmove (0, 0)) + { + // If caught in deadly environment, warp out! + if (self.h2otype <= CONTENT_SLIME) + if (!attacker) // Attacker is world when damaged by slime/lava. + {bane_painc1 (); return;} + // Warp occasionally. + if (random() < 0.1) + {bane_painc1 (); return;} + } +//- - - - - - - - - + if (random()*30 > damage) + return; // didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + if (random() < 0.5) + bane_pain1 (); + else + bane_painb1 (); +}; + +// Update 1/7/10: Moved hknight_type to globals.qc. + +void() hknight_melee = +{ + local float fast; + + hknight_type = hknight_type + 1; + + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); + fast = 1; + if (!SUB_QuickAttack ()) + if (self.classname == "monster_hell_knight") + fast = 0; + if (fast) + { + if (hknight_type == 1) + bane_slice1 (); + else if (hknight_type == 2) + bane_smash1 (); + else if (hknight_type == 3) + { + bane_watk1 (); + hknight_type = 0; + } + return; + } + + if (hknight_type == 1) + hknight_slice1 (); + else if (hknight_type == 2) + hknight_smash1 (); + else if (hknight_type == 3) + { + hknight_watk1 (); + hknight_type = 0; + } +}; + +//============================================================================== + +void() bane_win = +{ +// Update: Changed from ATTN_NORM to ATTN_NONE for level-wide low laugh. + sound (self, CHAN_VOICE, "bane/laugh.wav", 1, ATTN_NONE); +// DISABLED -- Player can't really listen if he's dead. +// if (self.height) +// if (!self.master) // Death is only the beginning. +// bprint ("Ôèå Âáîåº Äåáôè éó ïîìù ôèå âåçéîîéîç®\n"); + + monster_sow (); +}; + +void() bane_void = +{ + monster_void (); + sound (self, CHAN_VOICE, "bane/death.wav", 1, ATTN_NONE); +}; + +void(float hello) bane_sight = +{ + if (!hello) + sound (self, CHAN_VOICE, "bane/sight.wav", 1, 0.5); +}; +void(float hello) bane_hello = +{ + if (self.enemy.classname == "player") + { + if (world.model == "maps/soe1m5.bsp") + { // Thou dare challenge me?! + Bane_Speaks ("Ôèå Âáîåº Ôèïõ äáòå ãèáììåîçå íå¿¡\n"); + } + else + { + if (random() < 0.5) // Vengeance shall be mine! + Bane_Speaks ("Ôèå Âáîåº Öåîçåáîãå óèáìì âå íéîå¡\n"); + else // Welcome to thy doom! + Bane_Speaks ("Ôèå Âáîåº ×åìãïíå ôï ôèù äïïí¡\n"); + } + self.th_sight = bane_sight; + } + bane_sight (hello); +}; + +void(float hello) lord_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "archer/sight2.wav", 1, ATTN_NORM); +}; + +void(float hello) hknight_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "hknight/sight1.wav", 1, ATTN_NORM); +}; + +// Files common to all of the hell knight variants. +void() hk_cache = +{ + precache_model ("progs/hknight.mdl"); + precache_model ("progs/k_spike.mdl"); + precache_model ("progs/h_hellkn.mdl"); + + precache_sound ("hknight/attack1.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound ("hknight/slash1.wav"); + precache_sound ("hknight/idle.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + +// precache_sound ("hknight/death1.wav"); +// precache_sound ("hknight/pain1.wav"); +// precache_sound ("hknight/sight1.wav"); +}; + +// Classic, standard hell knight. +void() hknight_cache = +{ + hk_cache (); + + precache_sound ("hknight/death1.wav"); + precache_sound ("hknight/pain1.wav"); + precache_sound ("hknight/sight1.wav"); +}; + +// Tougher and meaner red version with fire magic. +void() hklord_cache = +{ + hk_cache (); + + precache_model ("progs/lavaball.mdl"); + + // Borrow sounds from archer lords. + // Update: Don't use growl2.wav or growl3.wav. + precache_sound ("archer/death2.wav"); + precache_sound ("archer/pain2.wav"); + precache_sound ("archer/sight2.wav"); + precache_sound ("boss1/throw.wav"); + precache_sound ("weapons/fwall.wav"); + precache_sound ("weapons/fwallhit.wav"); + precache_sound ("weapons/fwalltap.wav"); +}; + +// For Rapture's hkboss. +void() hkboss_cache = +{ + hknight_cache (); + + precache_model ("progs/v_spike.mdl"); // Used by hkboss. + precache_sound ("hkboss/iceball.wav"); // Used by hkboss. +}; + +// Prototypes... +void() monster_axeman; +//============ +// QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush Lord +//============ +void() monster_hell_knight = +{ + local float look; + +// SoE: sf 1 upgrades, sf 2 is ambush. + if (!respawning) + { + if (soul_evil) + { + look = self.spawnflags & 1; + if (look) + { + self.spawnflags = self.spawnflags - 1; + if (self.classname != "monster_hkboss") + self.classname = "monster_hell_lord"; + } + if (self.spawnflags & 2) + self.spawnflags = (self.spawnflags - 2) | 1; +//- - - - - - - - - +// SoE Indian Summer Hack. + if (look) + { // nsoe1 and nsoe2 have too many Hell Lords -- downgrade some of them! + if (world.model == "maps/nsoe1.bsp") + { + AddOne(); // Also called by item_health -- gross! + if ((gloat == 2) || (gloat == 3)) // First two knights. + self.classname = "monster_hell_knight"; + else if ((gloat == 8) || (gloat == 9)) + { // No lords on Easy. + if (cvar("skill") == 0) + self.classname = "monster_hell_knight"; + } + else if (gloat == 12) + {self.classname = "monster_axeman"; monster_axeman(); return;} + } + else if (world.model == "maps/nsoe2.bsp") + { + AddOne(); + if ((gloat == 13) || (gloat == 14)) // Near Sha'Vile. + {self.classname = "monster_axeman"; monster_axeman(); return;} + // 1 = City entrance, 4-5 = Outside near nailgun, 16-17 = Chapel + if ((gloat == 0) || (gloat == 1) || (gloat == 4) || (gloat == 5) || + (gloat == 16) || (gloat == 17)) + self.classname = "monster_hell_knight"; + } + } +//- - - - - - - - - + } + else + { + if (self.spawnflags & 2) + if (self.classname != "monster_hkboss") + self.classname = "monster_hell_lord"; + } + } +//- - - - - - - - - + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + if (self.classname == "monster_hkboss") + hkboss_cache (); + else if (self.classname == "monster_hell_lord") + hklord_cache (); + else + hknight_cache (); + } + + if (self.classname == "monster_hell_lord") + { + if (soul_evil) + monster_purse (3, 0.75, 0.25); + self.skin = SKIN_HELL_LORD; + self.th_missile = lord_magic; + self.th_sight = lord_sight; + // Originally 500 health, too much. + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 400, -40); + } + else if (self.classname == "monster_hkboss") + { + if (soul_evil) + monster_purse (5, 0.75, 0.25); + self.skin = SKIN_HKBOSS; + self.th_missile = hkboss_magic; + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 900, -40); + } + else + { + if (soul_evil) + { + monster_purse (3, 0.5, 0); + self.skin = (random() * 2) & 1; + } + else + self.skin = self.skin & 1; // First two only. + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 250, -40); + } + self.mdl_head = "progs/h_hellkn.mdl"; + self.mass = MASS_MEDIUM; + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = hknight_run1; + if (!self.th_missile) + self.th_missile = hknight_magic; // Was 'hknight_magicc1' + self.th_melee = hknight_melee; + self.th_pain = hknight_pain; + self.th_die = hknight_die; + //- - - - - - - - +// self.th_jump = hknight_jump1; + if (!self.th_sight) + self.th_sight = hknight_sight; + self.th_revive = hknight_revive; + self.th_gib = hknight_gib; + self.th_spawn = monster_hell_knight; + + self.family = FAM_BANE; + self.xfl = XFL_ARMORED; + self.hittype = HIT_METAL; + + monster_start (); +}; + +void() monster_hell_lord = {monster_hell_knight ();}; +void() monster_lord = + {self.classname = "monster_hell_lord"; monster_hell_knight ();}; + +// For Rapture. +void() monster_hkboss = {monster_hell_knight ();}; + +//========================================================================== +// The Bane (SoE Big Bad Evil Guy, Hell Knight boss variant) +//========================================================================== +float() BaneCheckAttack = +{ +// Here so Bane can destroy downed zombies and what not. + if (enemy_range == RANGE_MELEE) + if (infront (self.enemy)) + if (CanDamage (self.enemy, self)) + {self.th_melee (); return TRUE;} + +// Use bog standard. + return CheckAttack(); +}; + +// In case Bane gets aggravated during teleportation... +void() bane_run = +{ + if (self.skin == SKIN_BANE_GRAY) + bane_painc1 (); // Restart shadow walk. + else + hknight_run1 (); +}; + +void() bane_cache = +{ +// Bane - - - - - - + precache_model ("progs/hknight.mdl"); + precache_model ("progs/drake/k_ball.mdl"); // Bane fireball. + precache_model ("progs/h_hellkn.mdl"); + + precache_sound ("ambience/thunder1.wav"); + precache_sound ("ambience/thunder2.wav"); + precache_sound ("bane/death.wav"); + precache_sound ("bane/growl.wav"); + precache_sound ("bane/hit.wav"); + precache_sound ("bane/laugh.wav"); + precache_sound ("bane/pain.wav"); + precache_sound ("bane/sight.wav"); + precache_sound ("bane/thunder.wav"); + precache_sound ("hknight/slash1.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("misc/dsslop.wav"); + precache_sound ("weapons/axhit.wav"); +//- - - - - - - - - +}; + +void() monster_bane = +{ + local float sklv; + + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + bane_cache (); + } + + // Update: Make it very hard but possible to gib/behead the Bane. + self.skin = SKIN_BANE; + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', 2000, -90); + self.mdl_head = "progs/h_hellkn.mdl"; + self.mass = MASS_MEDIUM; + sklv = cvar("skill"); + if (sklv < 1) + self.waitmin = self.waitmax = -1; // No clones or rage on Easy. + else if (sklv < 2) + { + self.waitmin = floor(self.health / 4); // Clones with 500 health. + self.waitmax = floor(self.health / 2); // Rage at half hp. + } + else + { + self.waitmax = self.health / 3; + self.waitmin = floor(self.waitmax); // Clones with 666 health. + self.waitmax = floor(self.waitmax * 2); // Rage at 66% hp. + } + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = bane_run; //hknight_run1; + self.th_missile = bane_magic; + self.th_melee = hknight_melee; + self.th_pain = bane_pain; + self.th_die = hknight_die; + //- - - - - - - - +// self.th_jump = hknight_jump1; + self.th_sight = bane_sight; + self.th_check = BaneCheckAttack; + self.th_gib = hknight_gib; + self.th_win = bane_win; + self.th_void = bane_void; + self.th_spawn = monster_bane; + +// SoE Hack: Disable the Bane's new powers in soe1m5. + self.height = 0; + if (!self.spawned) + { + if (self.spawnflags & 2) + { + self.height = BANE_CHAT; // The Bane speaks! + self.waitmin = self.waitmax = -1; // No clones or rage. + self.th_sight = bane_hello; + } + else if (world.model == "maps/nsoe5.bsp") + { + self.height = BANE_CHAT; // The Bane speaks! + self.th_die = bane_die; + self.th_sight = bane_hello; + } + } + + self.family = FAM_BANE; + self.xfl = XFL_ARMORED | XFL_BOSS; // Don't dare hit the king! + self.ryuflags = RYU_ALERT | RYU_INSANE; + self.hittype = HIT_METAL; + if (soul_evil) + monster_purse (20, 1, 0.5); + + monster_start (); +}; + + +//========================================================================== +// The Dark Lord (Wraith in Black Armor, a bit like Tolkien's Nazgul) +// +// Update 5/??/2011: Now includes a two-stage version similar to +// Dracula in (early) Castlevania, the human form and beast form. +//========================================================================== + +void(float d) dk_slow; +void(float d) dk_fast; + +void() darklord_run1 =[ $walk1, darklord_run2 ] {dk_slow(2);}; +void() darklord_run2 =[ $walk2, darklord_run3 ] {M_Step(); dk_slow(5);}; +void() darklord_run3 =[ $walk3, darklord_run4 ] {dk_slow(5);}; +void() darklord_run4 =[ $walk4, darklord_run5 ] {dk_slow(4);}; +void() darklord_run5 =[ $walk5, darklord_run6 ] {dk_slow(4);}; +void() darklord_run6 =[ $walk6, darklord_run7 ] {dk_slow(2);}; +void() darklord_run7 =[ $walk7, darklord_run8 ] {dk_slow(2);}; +void() darklord_run8 =[ $walk8, darklord_run9 ] {dk_slow(3);}; +void() darklord_run9 =[ $walk9, darklord_run10 ] {dk_slow(3);}; +void() darklord_run10 =[ $walk10, darklord_run11 ] {dk_slow(4);}; +void() darklord_run11 =[ $walk11, darklord_run12 ] {dk_slow(3);}; +void() darklord_run12 =[ $walk12, darklord_run13 ] {M_Step(); dk_slow(4);}; +void() darklord_run13 =[ $walk13, darklord_run14 ] {dk_slow(6);}; +void() darklord_run14 =[ $walk14, darklord_run15 ] {dk_slow(2);}; +void() darklord_run15 =[ $walk15, darklord_run16 ] {dk_slow(2);}; +void() darklord_run16 =[ $walk16, darklord_run17 ] {dk_slow(4);}; +void() darklord_run17 =[ $walk17, darklord_run18 ] {dk_slow(3);}; +void() darklord_run18 =[ $walk18, darklord_run19 ] {dk_slow(3);}; +void() darklord_run19 =[ $walk19, darklord_run20 ] {dk_slow(3);}; +void() darklord_run20 =[ $walk20, darklord_run1 ] {dk_slow(2);}; +//void() darklord_run20 =[ $walk20, darklord_run21 ] {dk_slow(2);}; +//void() darklord_run21 =[ $walk20, darklord_run2 ] {dk_slow(2);}; + +void() darklord_fast1 =[ $run1, darklord_fast2 ] {hk_idle_sound(); dk_fast(20);}; +void() darklord_fast2 =[ $run2, darklord_fast3 ] {M_Step(); dk_fast(25);}; +void() darklord_fast3 =[ $run3, darklord_fast4 ] {dk_fast(18);}; +void() darklord_fast4 =[ $run4, darklord_fast5 ] {dk_fast(16);}; +void() darklord_fast5 =[ $run5, darklord_fast6 ] {dk_fast(14);}; +void() darklord_fast6 =[ $run6, darklord_fast7 ] {M_Step(); dk_fast(25);}; +void() darklord_fast7 =[ $run7, darklord_fast8 ] {dk_fast(21);}; +void() darklord_fast8 =[ $run8, darklord_fast1 ] {dk_fast(13);}; + +void() dk_shield = +{ + if (self.pets < 1) // FIXME: Check for wraths. + { + if (self.flags & FL_GODMODE) + { + self.flags = self.flags - FL_GODMODE; //(self.flags & FL_GODMODE); + self.waitmax = time + 10; // Give player time to attack. + } + if (!self.mirror_finished) + self.effects = self.effects - (self.effects & EF_BRIGHTFIELD); + } + else + { + if (!(self.flags & FL_GODMODE)) + { + self.flags = self.flags | FL_GODMODE; + ReflectorShield (self); + sound(self, 6, "items/protect.wav", 1, ATTN_NORM); + } + } +}; + +void(float d) dk_slow = +{ + if (!self.fighting) + {darklord_fast1 (); return;} + if (self.enemy) + if (!visible (self.enemy)) + {darklord_fast1 (); return;} + dk_shield (); + ai_run(d); +}; +void(float d) dk_fast = +{ + if (self.fighting) + if (self.enemy) + if (visible (self.enemy)) + {darklord_run1 (); return;} + dk_shield (); + ai_run(d); +}; + +//=========================================================================== + +void(float d) dk_charge = +{ +// bane_shadow (); + hk_charge(d*2); +}; + +void() dk_idle_sound = +{ + if (random() < 0.2) + sound (self, CHAN_VOICE, "darklord/idle1.wav", 1, ATTN_NORM); +// if (random() < 0.5) +// sound (self, CHAN_VOICE, "darklord/sword1.wav", 1, ATTN_NORM); +// else +// sound (self, CHAN_VOICE, "darklord/sword2.wav", 1, ATTN_NORM); +}; + +void() darklord_slice1 =[ $slice1, darklord_slice2 ] {dk_idle_sound(); dk_charge(9);}; +void() darklord_slice2 =[ $slice3, darklord_slice3 ] {M_Step(); dk_charge(19);}; +void() darklord_slice3 =[ $slice5, darklord_slice4 ] {dk_charge(11); bane_melee(-200); ai_melee();}; +void() darklord_slice4 =[ $slice6, darklord_slice5 ] {dk_charge(15); ai_melee();}; +void() darklord_slice5 =[ $slice7, darklord_slice6 ] {M_Step(); dk_charge(8); ai_melee();}; +void() darklord_slice6 =[ $slice9, darklord_slice7 ] {dk_charge(2); ai_melee();}; +void() darklord_slice7 =[ $slice10, hknight_run1 ] {dk_charge(3);}; + +void() darklord_smash1 =[ $smash2, darklord_smash2 ] {dk_idle_sound(); dk_charge(14);}; +void() darklord_smash2 =[ $smash4, darklord_smash3 ] {M_Step(); dk_charge(20);}; +void() darklord_smash3 =[ $smash5, darklord_smash4 ] {dk_charge(10); bane_melee(0); ai_melee();}; +void() darklord_smash4 =[ $smash6, darklord_smash5 ] {dk_charge(7); ai_melee();}; +void() darklord_smash5 =[ $smash7, darklord_smash6 ] {dk_charge(12); ai_melee();}; +void() darklord_smash6 =[ $smash8, darklord_smash7 ] {dk_charge(2); ai_melee();}; +void() darklord_smash7 =[ $smash9, darklord_smash8 ] {M_Step(); dk_charge(3); ai_melee();}; +void() darklord_smash8 =[ $smash11, hknight_run1 ] {dk_charge(0);}; + +void() darklord_watk1 =[ $w_attack1, darklord_watk2 ] {dk_idle_sound(); dk_charge(2);}; +void() darklord_watk2 =[ $w_attack5, darklord_watk3 ] {bane_melee(0); ai_melee();}; +void() darklord_watk3 =[ $w_attack7, darklord_watk4 ] {dk_charge(1);}; +void() darklord_watk4 =[ $w_attack8, darklord_watk5 ] {dk_charge(4);}; +void() darklord_watk5 =[ $w_attack9, darklord_watk6 ] {dk_charge(5);}; +void() darklord_watk6 =[ $w_attack10, darklord_watk7 ] {dk_charge(3); ai_melee();}; +void() darklord_watk7 =[ $w_attack11, darklord_watk8 ] {M_Step(); dk_charge(2); ai_melee();}; +void() darklord_watk8 =[ $w_attack13, darklord_watk9 ] {dk_charge(2); ai_melee();}; +void() darklord_watk9 =[ $w_attack14, darklord_watk10 ] {dk_charge(0);}; +void() darklord_watk10 =[ $w_attack16, darklord_watk11 ] {dk_charge(1); + sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); +}; +void() darklord_watk11 =[ $w_attack18, darklord_watk12 ] {dk_charge(4); bane_melee(200); ai_melee();}; +void() darklord_watk12 =[ $w_attack19, darklord_watk13 ] {dk_charge(4); ai_melee();}; +void() darklord_watk13 =[ $w_attack20, darklord_watk14 ] {dk_charge(6);}; +void() darklord_watk14 =[ $w_attack22, hknight_run1] {dk_charge(10);}; + +void() darklord_melee = +{ + if (self.waitmin < time) + {darklord_magica1(); return;} + + hknight_type = hknight_type + 1; + + sound (self, CHAN_WEAPON, "hknight/slash1.wav", 1, ATTN_NORM); + if (hknight_type == 1) + darklord_slice1 (); + else if (hknight_type == 2) + darklord_smash1 (); + else if (hknight_type == 3) + { + darklord_watk1 (); + hknight_type = 0; + } +}; + +//============================================================================ + +void() darklord_thebeast; // Look in 'dragon.qc'. + +void() darklord_fall1 =[ $decap1, darklord_fall2 ] {ai_forward(10);}; +void() darklord_fall2 =[ $decap2, darklord_fall3 ] {ai_forward(8);}; +void() darklord_fall3 =[ $decap3, darklord_fall4 ] {monster_drop(); ai_forward(7);}; +void() darklord_fall4 =[ $decap4, darklord_fall5 ] {}; +void() darklord_fall5 =[ $decap5, darklord_fall6 ] {}; +void() darklord_fall6 =[ $decap6, darklord_fall7 ] {}; +void() darklord_fall7 =[ $decap7, darklord_fall8 ] {}; +void() darklord_fall8 =[ $decap8, darklord_fall9 ] {ai_forward(10);}; +void() darklord_fall9 =[ $decap9, darklord_fall10 ] {ai_forward(11);}; +void() darklord_fall10 =[ $decap10, darklord_fall11 ] {}; +void() darklord_fall11 =[ $decap11, darklord_fall12 ] {}; +void() darklord_fall12 =[ $decap12, darklord_thebeast ] +{ + Quake_Level (0, self.origin, 5); + self.nextthink = time + 3; +}; + +void(entity attacker, float damage) darklord_pain = +{ + if (self.max_health - self.health >= 1000) + { // Took enough damage to die. So feign death before transforming. + local vector st; + + // Become immune to damage and reset health. + self.flags = self.flags | FL_GODMODE; + self.health = self.max_health - 1000; + + // Reset some things. + self.th_stand = + self.th_walk = + self.th_run = darklord_thebeast; + self.th_melee = + self.th_missile = + self.th_pain = SUB_Null; + + SUB_RemovePowerups (); + + // Fake death. + sound (self, CHAN_VOICE, "darklord/death.wav", 1, ATTN_NORM); + + makevectors (self.angles); + st = '-2 0 28'; + st = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + Rocket_Explosion2 (st, 32, 5); + darklord_fall1 (); + + return; + } + +// Proceed as usual. + hknight_pain (attacker, damage); +}; + +//============================================================================ + +// Note: The dark lord's helmet explodes when destroyed. +void() darklord_die1 =[ $decap1, darklord_die2 ] {ai_forward(10);}; +void() darklord_die2 =[ $decap2, darklord_die3 ] {ai_forward(8);}; +void() darklord_die3 =[ $decap3, darklord_die4 ] {monster_drop(); ai_forward(7);}; +void() darklord_die4 =[ $decap4, darklord_die5 ] {}; +void() darklord_die5 =[ $decap5, darklord_die6 ] {}; +void() darklord_die6 =[ $decap6, darklord_die7 ] {}; +void() darklord_die7 =[ $decap7, darklord_die8 ] {}; +void() darklord_die8 =[ $decap8, darklord_die9 ] {ai_forward(10);}; +void() darklord_die9 =[ $decap9, darklord_die10 ] {ai_forward(11);}; +void() darklord_die10 =[ $decap10, darklord_die11 ] {}; +void() darklord_die11 =[ $decap11, darklord_die12 ] {}; +void() darklord_die12 =[ $decap12, monster_end ] {}; + +void() darklord_dieb1 =[ $decapb1, darklord_dieb2 ] {}; +void() darklord_dieb2 =[ $decapb2, darklord_dieb3 ] {}; +void() darklord_dieb3 =[ $decapb3, darklord_dieb4 ] {monster_drop();}; +void() darklord_dieb4 =[ $decapb4, darklord_dieb5 ] {}; +void() darklord_dieb5 =[ $decapb5, darklord_dieb6 ] {}; +void() darklord_dieb6 =[ $decapb6, darklord_dieb7 ] {}; +void() darklord_dieb7 =[ $decapb7, darklord_dieb8 ] {}; +void() darklord_dieb8 =[ $decapb8, darklord_dieb9 ] {}; +void() darklord_dieb9 =[ $decapb9, monster_end ] {}; + +void() darklord_die = +{ +// check for gib +// if (Shattered ()) +// return; + +// regular death + local vector st; + + sound (self, CHAN_VOICE, "darklord/death.wav", 1, ATTN_NORM); + + if (random() > 0.5) + {st = '-2 0 28'; darklord_die1 ();} + else + {st = '-3 0 33'; darklord_dieb1 ();} + makevectors (self.angles); + st = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + Rocket_Explosion2 (st, 32, 5); +}; + +void(float hello) darklord_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "darklord/idle1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "darklord/sight.wav", 1, ATTN_NORM); +}; + +void() dark_lord_cache = +{ +// Bane - - - - - - + precache_model ("progs/hknight.mdl"); + precache_model ("progs/r_bolt.mdl"); + // The dark lord's head explodes when killed, so no head gib needed. + + precache_sound ("bane/hit.wav"); + precache_sound ("darklord/death.wav"); + precache_sound ("darklord/idle1.wav"); + precache_sound ("darklord/pain.wav"); + precache_sound ("darklord/sight.wav"); + precache_sound ("darklord/death.wav"); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("items/protect.wav"); // Powerup sound + precache_sound ("plasma/explode.wav"); + precache_sound ("plasma/fire.wav"); + precache_sound ("weapons/axhit.wav"); + precache_sound ("skullwiz/gate.wav"); // For wrath summoning. +//- - - - - - - - - +}; + +// FIXME: Where do I put this aside from here? +void() dragon_doe_cache; + +//============ +// --> QUAKED monster_dark_lord (1 0 0) (-16 -16 -24) (16 16 40) Ambush Guardian Beast +// Guardian version can raise a shield and summon wraths. +// Beast version has 4000+ hp and morphs into a dragon when damaged enough. +// The boss flags can stack! +//============ +void() monster_dark_lord = +{ + local float hp; + +// FIXME: Test -- good to go? Remove? +//self.spawnflags = self.spawnflags | 4; + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + dark_lord_cache (); + wrath_cache (); + if (self.spawnflags & 4) + dragon_doe_cache (); + } + + if (self.spawnflags & 4) { + hp = 4000 + (500 * cvar("skill")); + if (self.deathstring == "") self.deathstring = " fell before a Beastly Dark Lord\n"; + } else { + if (self.deathstring == "") self.deathstring = " fell before a Dark Lord\n"; + hp = 1000; + } + + self.skin = SKIN_DARK_LORD; + monster_form ("progs/hknight.mdl", '-16 -16 -24', '16 16 40', hp, 0); + self.mass = MASS_MEDIUM; + + // Takes reduced damage from lightning and cold. + self.resist_cold = 0.5; + + self.th_stand = hknight_stand1; + self.th_walk = hknight_walk1; + self.th_run = darklord_run1; //hknight_run1; + self.th_missile = darklord_magic; //lord_magic; + self.th_melee = darklord_melee; //hknight_melee; + if (self.spawnflags & 4) + self.th_pain = darklord_pain; // Checks for stage change. + else + self.th_pain = hknight_pain; + self.th_die = darklord_die; + //- - - - - - - - +// self.th_jump = hknight_jump1; + self.th_sight = darklord_sight; + self.th_spawn = monster_dark_lord; + self.th_check = BaneCheckAttack; + // As a wraith bound in armor, it cannot be gibbed. + + self.bloodtype = 0 - BLOOD_DARK; // Less blood and no gibs. + + self.family = FAM_BANE | FAM_UNDEAD; + self.xfl = XFL_ARMORED; + if (self.spawnflags & 6) { + self.deathstring = " fell before a Guardian Dark Lord\n"; + self.xfl = XFL_BOSS; + } + self.ryuflags = RYU_ALERT | RYU_INSANE; + self.hittype = HIT_METAL; + if (soul_evil) + monster_purse (20, 1, 0.5); + + + + monster_start (); +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/mon_hogre.qc b/QC_other/QC_keep/mon_hogre.qc new file mode 100644 index 00000000..cbd25b37 --- /dev/null +++ b/QC_other/QC_keep/mon_hogre.qc @@ -0,0 +1,486 @@ +/*============================================================================== +HUNTER OGRE +==============================================================================*/ +$cd id1/models/hogre_c +$origin 0 0 24 +$base base +$skin base + +// (000) Default stand +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// (008) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// (020) Walking (alternative) +$frame walkB1 walkB2 walkB3 walkB4 walkB5 walkB6 walkB7 walkB8 +$frame walkB9 walkB10 walkB11 walkB12 + +// (032) Running (classic pose) +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// (040) Swing (sideways attack) +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +// (054) Smash (Overarm attack) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +// (068) Thrust (Forward attack) +$frame thrust1 thrust2 thrust3 thrust4 thrust5 thrust6 thrust7 thrust8 +$frame thrust9 thrust10 thrust11 thrust12 thrust13 thrust14 + +// (082) Turret idle (Turret mode) +$frame turidle1 turidle2 turidle3 turidle4 +$frame turidle5 turidle6 turidle7 turidle8 + +// (090) Shoot (GL attack - chainsaw down) +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// (098) Shootpain (turret mode) +$frame turpainA1 turpainA2 turpainA3 turpainA4 turpainA5 + +// (103) Shoot (GL attack - chainsaw up) +$frame shootB1 shootB2 shootB3 shootB4 shootB5 shootB6 shootB7 shootB8 + +// (111) painA - Quick backwards flex +$frame painA1 painA2 painA3 painA4 painA5 + +// (116) painB - Stagger backwards +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 + +// (129) painC - Fall down +$frame painC1 painC2 painC3 painC4 painC5 painC6 painC7 painC8 +$frame painC9 painC10 painC11 painC12 painC13 painC14 painC15 painC16 painC17 + +// (146) TurretWake (Turret mode) +$frame turwake1 turwake2 turwake3 turwake4 + +// (150) TurretRelease (Turret mode) +$frame turrel1 turrel2 turrel3 turrel4 + +// (154) deathSilly (comedy death) +$frame deathS1 deathS2 deathS3 deathS4 deathS5 deathS6 deathS7 deathS8 +$frame deathS9 deathS10 + +// (164) deathA (Forward) +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 + +// (174) deathB (Backward) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 + +void(float soundtype) hogre_sound; + +//====================================================================== +void() hogre_stand1 =[ $stand1, hogre_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hogre_stand2 =[ $stand2, hogre_stand3 ] {ai_stand();}; +void() hogre_stand3 =[ $stand3, hogre_stand4 ] {ai_stand();}; +void() hogre_stand4 =[ $stand4, hogre_stand5 ] {ai_stand();}; +void() hogre_stand5 =[ $stand5, hogre_stand6 ] {ai_stand();}; +void() hogre_stand6 =[ $stand6, hogre_stand7 ] {ai_stand();}; +void() hogre_stand7 =[ $stand7, hogre_stand8 ] {ai_stand();}; +void() hogre_stand8 =[ $stand8, hogre_stand1 ] {ai_stand();}; + +//====================================================================== +void() hogre_walkB1 =[ $walkB1, hogre_walkB2 ] {ai_walk(4);}; +void() hogre_walkB2 =[ $walkB2, hogre_walkB3 ] {ai_walk(6);}; +void() hogre_walkB3 =[ $walkB3, hogre_walkB4 ] {monster_idle_sound(); ai_walk(6);}; +void() hogre_walkB4 =[ $walkB4, hogre_walkB5 ] {ai_walk(4);}; +void() hogre_walkB5 =[ $walkB5, hogre_walkB6 ] {monster_footstep(FALSE); ai_walk(0);}; +void() hogre_walkB6 =[ $walkB6, hogre_walkB7 ] {ai_walk(0);}; +void() hogre_walkB7 =[ $walkB7, hogre_walkB8 ] {ai_walk(6);}; +void() hogre_walkB8 =[ $walkB8, hogre_walkB9 ] {ai_walk(7); hogre_sound(1);}; +void() hogre_walkB9 =[ $walkB9, hogre_walkB10 ] {ai_walk(6);}; +void() hogre_walkB10=[ $walkB10, hogre_walkB11 ] {ai_walk(2);}; +void() hogre_walkB11=[ $walkB11, hogre_walkB12 ] {monster_footstep(FALSE);ai_walk(0);}; +void() hogre_walkB12=[ $walkB12, hogre_walk1 ] {ai_walk(4);}; + +//====================================================================== +void() hogre_walk1 =[ $walk1, hogre_walk2 ] {ai_walk(4);}; +void() hogre_walk2 =[ $walk2, hogre_walk3 ] {ai_walk(4);}; +void() hogre_walk3 =[ $walk3, hogre_walk4 ] {monster_idle_sound(); ai_walk(4);}; +void() hogre_walk4 =[ $walk4, hogre_walk5 ] {ai_walk(4);}; +void() hogre_walk5 =[ $walk5, hogre_walk6 ] {ai_walk(4);}; +void() hogre_walk6 =[ $walk6, hogre_walk7 ] {monster_footstep(FALSE); ai_walk(4);}; +void() hogre_walk7 =[ $walk7, hogre_walk8 ] {ai_walk(4);}; +void() hogre_walk8 =[ $walk8, hogre_walk9 ] {ai_walk(4);}; +void() hogre_walk9 =[ $walk9, hogre_walk10] {ai_walk(4); if (random() < 0.1) hogre_sound(1);}; +void() hogre_walk10 =[ $walk10, hogre_walk11] {ai_walk(4);}; +void() hogre_walk11 =[ $walk11, hogre_walk12] {ai_walk(3);}; +void() hogre_walk12 =[ $walk12, hogre_walk1 ] {monster_footstep(FALSE); + if (random() < 0.05) self.think = hogre_walkB1; // Alternative walk + ai_walk(4);}; + +//====================================================================== +void() hogre_run1 =[ $run1, hogre_run2 ] {monster_idle_sound(); ai_run(8);}; +void() hogre_run2 =[ $run2, hogre_run3 ] {monster_footstep(FALSE); ai_run(13);}; +void() hogre_run3 =[ $run3, hogre_run4 ] {ai_run(13);}; +void() hogre_run4 =[ $run4, hogre_run5 ] {ai_run(13);}; +void() hogre_run5 =[ $run5, hogre_run6 ] {ai_run(8);}; +void() hogre_run6 =[ $run6, hogre_run7 ] {monster_footstep(FALSE); ai_run(16);}; +void() hogre_run7 =[ $run7, hogre_run8 ] {ai_run(18);}; +void() hogre_run8 =[ $run8, hogre_run1 ] {ai_run(13);}; + +/*====================================================================== + chainsaw (use version in mon_ogre.qc) +======================================================================*/ +void() hogre_swing1 =[ $swing1, hogre_swing2 ] {ai_charge(10);hogre_sound(2);}; +void() hogre_swing2 =[ $swing2, hogre_swing3 ] {ai_charge(10);}; +void() hogre_swing3 =[ $swing3, hogre_swing4 ] {ai_charge(6);}; +void() hogre_swing4 =[ $swing4, hogre_swing5 ] {ai_charge(6);}; +void() hogre_swing5 =[ $swing5, hogre_swing6 ] {ai_charge(7); chainsaw(0,1);self.angles_y = self.angles_y + random()*25;}; +void() hogre_swing6 =[ $swing6, hogre_swing7 ] {ai_forward(7); chainsaw(200,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing7 =[ $swing7, hogre_swing8 ] {ai_forward(4); chainsaw(0,1);monster_footstep(FALSE); self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing8 =[ $swing8, hogre_swing9 ] {ai_forward(4); chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing9 =[ $swing9, hogre_swing10 ] {ai_forward(4); chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing10=[ $swing10, hogre_swing11 ] {ai_forward(4); chainsaw(-200,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing11=[ $swing11, hogre_swing12 ] {ai_forward(4); chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() hogre_swing12=[ $swing12, hogre_swing13 ] {ai_face();}; +void() hogre_swing13=[ $swing13, hogre_swing14 ] {ai_face();}; +void() hogre_swing14=[ $swing14, hogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_smash1 =[ $smash1, hogre_smash2 ] {ai_charge(9);hogre_sound(2);}; +void() hogre_smash2 =[ $smash2, hogre_smash3 ] {ai_charge(9);}; +void() hogre_smash3 =[ $smash3, hogre_smash4 ] {monster_footstep(FALSE); ai_charge(9);}; +void() hogre_smash4 =[ $smash4, hogre_smash5 ] {ai_charge(12);}; +void() hogre_smash5 =[ $smash5, hogre_smash6 ] {ai_charge(12);}; +void() hogre_smash6 =[ $smash6, hogre_smash7 ] {ai_charge(5); chainsaw(0,1); monster_footstep(FALSE);}; +void() hogre_smash7 =[ $smash7, hogre_smash8 ] {ai_charge(5); chainsaw(0,1);}; +void() hogre_smash8 =[ $smash8, hogre_smash9 ] {ai_face(); chainsaw(0,1);}; +void() hogre_smash9 =[ $smash9, hogre_smash10 ] {ai_face(); chainsaw(0,1);}; +void() hogre_smash10=[ $smash10, hogre_smash11 ] {ai_face(); chainsaw(0,1);}; +void() hogre_smash11=[ $smash11, hogre_smash12 ] {ai_face(); chainsaw(0,1); +self.nextthink = self.nextthink + random()*0.2;}; // slight variation +void() hogre_smash12=[ $smash12, hogre_smash13 ] {ai_face();}; +void() hogre_smash13=[ $smash13, hogre_smash14 ] {ai_face();}; +void() hogre_smash14=[ $smash14, hogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_thrust1 =[ $thrust1, hogre_thrust2 ] {ai_charge(12);hogre_sound(2);}; +void() hogre_thrust2 =[ $thrust2, hogre_thrust3 ] {ai_charge(12);}; +void() hogre_thrust3 =[ $thrust3, hogre_thrust4 ] {ai_charge(15);}; +void() hogre_thrust4 =[ $thrust4, hogre_thrust5 ] {ai_charge(7);}; +void() hogre_thrust5 =[ $thrust5, hogre_thrust6 ] {ai_charge(14);monster_footstep(FALSE);}; +void() hogre_thrust6 =[ $thrust6, hogre_thrust7 ] {ai_charge(13);chainsaw(0,2);}; +void() hogre_thrust7 =[ $thrust7, hogre_thrust8 ] {ai_charge(15);chainsaw(0,1.75);}; +void() hogre_thrust8 =[ $thrust8, hogre_thrust9 ] {ai_charge(11);chainsaw(0,1.5);}; +void() hogre_thrust9 =[ $thrust9, hogre_thrust10 ] {ai_charge(11);chainsaw(0,1.25);}; +void() hogre_thrust10 =[ $thrust10, hogre_thrust11 ] {ai_face();chainsaw(0,1);}; +void() hogre_thrust11 =[ $thrust11, hogre_thrust12 ] {ai_face();chainsaw(0,1);}; +void() hogre_thrust12 =[ $thrust12, hogre_thrust13 ] {ai_face();}; +void() hogre_thrust13 =[ $thrust13, hogre_thrust14 ] {ai_face();}; +void() hogre_thrust14 =[ $thrust14, hogre_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_melee = +{ + self.lip = random(); + if (self.lip < 0.2 && skill > SKILL_NORMAL) hogre_thrust1(); + else if (self.lip < 0.4) hogre_smash1(); + else hogre_swing1(); +}; + +/*====================================================================== + OgreFireGrenade (use version in mon_ogre.qc) +======================================================================*/ +void() hogre_shoot1 =[ $shootB1, hogre_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogre_shoot2 =[ $shootB2, hogre_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogre_shoot3 =[ $shootB3, hogre_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogre_shoot4 =[ $shootB4, hogre_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() hogre_shoot5 =[ $shootB5, hogre_shoot6 ] {ai_face();}; +void() hogre_shoot6 =[ $shootB6, hogre_shoot7 ] {ai_face();}; +void() hogre_shoot7 =[ $shootB7, hogre_run1 ] {ai_face();}; + +//====================================================================== +// painA - Quick backwards flex +//---------------------------------------------------------------------- +void() hogre_painA1 =[ $painA1, hogre_painA2 ] {}; +void() hogre_painA2 =[ $painA2, hogre_painA3 ] {}; +void() hogre_painA3 =[ $painA3, hogre_painA4 ] {}; +void() hogre_painA4 =[ $painA4, hogre_painA5 ] {}; +void() hogre_painA5 =[ $painA5, hogre_run1 ] {}; + +//---------------------------------------------------------------------- +// painB - Stagger backwards +//---------------------------------------------------------------------- +void() hogre_painB1 =[ $painB1, hogre_painB2 ] {ai_pain(7);}; +void() hogre_painB2 =[ $painB2, hogre_painB3 ] {ai_pain(5);}; +void() hogre_painB3 =[ $painB3, hogre_painB4 ] {}; +void() hogre_painB4 =[ $painB4, hogre_painB5 ] {monster_footstep(FALSE); }; +void() hogre_painB5 =[ $painB5, hogre_painB6 ] {}; +void() hogre_painB6 =[ $painB6, hogre_painB7 ] {ai_forward(2);}; +void() hogre_painB7 =[ $painB7, hogre_painB8 ] {ai_forward(2);}; +void() hogre_painB8 =[ $painB8, hogre_painB9 ] {ai_forward(2);}; +void() hogre_painB9 =[ $painB9, hogre_painB10 ] {ai_forward(2);}; +void() hogre_painB10 =[ $painB10, hogre_painB11 ] {ai_forward(2);}; +void() hogre_painB11 =[ $painB11, hogre_painB12 ] {ai_forward(2);}; +void() hogre_painB12 =[ $painB12, hogre_painB13 ] {ai_forward(2);}; +void() hogre_painB13 =[ $painB13, hogre_run1 ] {monster_footstep(FALSE); ai_forward(2);}; + +//---------------------------------------------------------------------- +// painC - Fall down +//---------------------------------------------------------------------- +void() hogre_painC1 =[ $painC1, hogre_painC2 ] {ai_pain(5);}; +void() hogre_painC2 =[ $painC2, hogre_painC3 ] {ai_pain(2);}; +void() hogre_painC3 =[ $painC3, hogre_painC4 ] {}; +void() hogre_painC4 =[ $painC4, hogre_painC5 ] {}; +void() hogre_painC5 =[ $painC5, hogre_painC6 ] {hogre_sound(3);}; // Ogre hits floor +void() hogre_painC6 =[ $painC6, hogre_painC7 ] {}; +void() hogre_painC7 =[ $painC7, hogre_painC8 ] {}; +void() hogre_painC8 =[ $painC8, hogre_painC9 ] {}; +void() hogre_painC9 =[ $painC9, hogre_painC10 ] {}; +void() hogre_painC10=[ $painC10, hogre_painC11 ] {monster_footstep(FALSE);}; +void() hogre_painC11=[ $painC11, hogre_painC12 ] {}; +void() hogre_painC12=[ $painC12, hogre_painC13 ] {}; +void() hogre_painC13=[ $painC13, hogre_painC14 ] {monster_footstep(FALSE);ai_forward(3);}; +void() hogre_painC14=[ $painC14, hogre_painC15 ] {ai_forward(4);}; +void() hogre_painC15=[ $painC15, hogre_painC16 ] {ai_forward(4);}; +void() hogre_painC16=[ $painC16, hogre_painC17 ] {ai_forward(5);}; +void() hogre_painC17=[ $painC17, hogre_run1 ] {ai_forward(4);}; + +//====================================================================== +void(entity inflictor, entity attacker, float damage) hogre_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.65) hogre_painA1 (); + else if (self.lip < 0.85) { + self.pain_finished = time + 2; + // Stagger backwards + hogre_painB1 (); + } + else { + self.pain_finished = time + 2; + // Fall on the floor + hogre_painC1 (); + } + } + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.3; + hogre_painC1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.7; + hogre_painB1 (); // Stagger backwards + } + } + } +}; + +//---------------------------------------------------------------------- +// (146 - 155) deathSilly (comedy death) +//---------------------------------------------------------------------- +void() hogre_dieS1 =[ $deathS1, hogre_dieS2 ] {ai_forward(14);}; +void() hogre_dieS2 =[ $deathS2, hogre_dieS3 ] {monster_check_gib();ai_forward(14);}; +void() hogre_dieS3 =[ $deathS3, hogre_dieS4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogre_dieS4 =[ $deathS4, hogre_dieS5 ] {ai_forward(1);}; +void() hogre_dieS5 =[ $deathS5, hogre_dieS6 ] {ai_forward(1);}; +void() hogre_dieS6 =[ $deathS6, hogre_dieS7 ] {ai_forward(1);}; +void() hogre_dieS7 =[ $deathS7, hogre_dieS8 ] {}; +void() hogre_dieS8 =[ $deathS8, hogre_dieS9 ] {hogre_sound(3);}; // Chainsaw hits floor +void() hogre_dieS9 =[ $deathS9, hogre_dieS10] {monster_death_postcheck();}; +void() hogre_dieS10=[ $deathS10, hogre_dieS10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +// (156 - 165) deathA (Forward) +//---------------------------------------------------------------------- +void() hogre_dieA1 =[ $deathA1, hogre_dieA2 ] {ai_forward(14);}; +void() hogre_dieA2 =[ $deathA2, hogre_dieA3 ] {monster_check_gib();ai_forward(14);}; +void() hogre_dieA3 =[ $deathA3, hogre_dieA4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogre_dieA4 =[ $deathA4, hogre_dieA5 ] {ai_forward(1);}; +void() hogre_dieA5 =[ $deathA5, hogre_dieA6 ] {ai_forward(1);}; +void() hogre_dieA6 =[ $deathA6, hogre_dieA7 ] {ai_forward(1);}; +void() hogre_dieA7 =[ $deathA7, hogre_dieA8 ] {}; +void() hogre_dieA8 =[ $deathA8, hogre_dieA9 ] {hogre_sound(3);}; // Chainsaw hits floor +void() hogre_dieA9 =[ $deathA9, hogre_dieA10] {monster_death_postcheck();}; +void() hogre_dieA10=[ $deathA10, hogre_dieA10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +// (166 - 179) deathB (Backward) +//---------------------------------------------------------------------- +void() hogre_dieB1 =[ $deathB1, hogre_dieB2 ] {ai_back(4);}; +void() hogre_dieB2 =[ $deathB2, hogre_dieB3 ] {monster_check_gib();ai_back(10);}; +void() hogre_dieB3 =[ $deathB3, hogre_dieB4 ] {monster_check_gib();ai_back(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogre_dieB4 =[ $deathB4, hogre_dieB5 ] {ai_back(1);}; +void() hogre_dieB5 =[ $deathB5, hogre_dieB6 ] {}; +void() hogre_dieB6 =[ $deathB6, hogre_dieB7 ] {}; +void() hogre_dieB7 =[ $deathB7, hogre_dieB8 ] {ai_back(1);}; +void() hogre_dieB8 =[ $deathB8, hogre_dieB9 ] {ai_back(1);}; +void() hogre_dieB9 =[ $deathB9, hogre_dieB10] {hogre_sound(3);}; // Chainsaw +void() hogre_dieB10=[ $deathB10, hogre_dieB11] {}; +void() hogre_dieB11=[ $deathB11, hogre_dieB12] {}; +void() hogre_dieB12=[ $deathB12, hogre_dieB13] {}; +void() hogre_dieB13=[ $deathB13, hogre_dieB14] {monster_death_postcheck();}; +void() hogre_dieB14=[ $deathB14, hogre_dieB14] {monster_deadbody_check();}; + +//====================================================================== +void() hogre_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + self.lip = random(); + if (self.lip < 0.05) hogre_dieS1(); + else if (self.lip < 0.5) hogre_dieA1(); + else hogre_dieB1(); + } +}; + +//============================================================================ +void(float soundtype) hogre_sound = +{ + if (soundtype == 1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + else if (soundtype == 2) sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + else if (soundtype == 3) sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + else if (soundtype == 4) sound (self, CHAN_WEAPON, "ogre/ogleap.wav", 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() hogre_wakeup1a =[ $smash7, hogre_wakeup2a ] {monster_sightsound();}; +void() hogre_wakeup2a =[ $smash6, hogre_wakeup3a ] {}; +void() hogre_wakeup3a =[ $smash8, hogre_wakeup4a ] {}; +void() hogre_wakeup4a =[ $smash9, hogre_wakeup5a ] {}; +void() hogre_wakeup5a =[ $smash10, hogre_wakeup6a ] {}; +void() hogre_wakeup6a =[ $smash11, hogre_wakeup7a ] {}; +void() hogre_wakeup7a =[ $smash12, hogre_wakeup8a ] {}; +void() hogre_wakeup8a =[ $smash13, hogre_wakeup9a ] {}; +void() hogre_wakeup9a =[ $smash14, hogre_run1 ] {}; + +void() hogre_wakeup1b =[ $thrust7, hogre_wakeup2b ] {monster_sightsound();}; +void() hogre_wakeup2b =[ $thrust6, hogre_wakeup3b ] {}; +void() hogre_wakeup3b =[ $thrust8, hogre_wakeup4b ] {}; +void() hogre_wakeup4b =[ $thrust9, hogre_wakeup5b ] {}; +void() hogre_wakeup5b =[ $thrust10, hogre_wakeup6b ] {}; +void() hogre_wakeup6b =[ $thrust11, hogre_wakeup7b ] {}; +void() hogre_wakeup7b =[ $thrust12, hogre_wakeup8b ] {}; +void() hogre_wakeup8b =[ $thrust13, hogre_wakeup9b ] {}; +void() hogre_wakeup9b =[ $thrust14, hogre_run1 ] {}; + +void() hogre_wakeup1 = { + if (random() < 0.7) hogre_wakeup1a(); // More over head swing than thrust + else hogre_wakeup1b(); +}; + +/*====================================================================== +/*QUAKED monster_hogre (0.5 0.75 0) (-32 -32 -24) (32 32 64) AMBUSH x METAL NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/ad171/mon_hogre.mdl"); } +Ogre, 200 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +METAL : Chain mail metal armour and +100HP +-------- NOTES -------- + +======================================================================*/ +void() monster_hogre = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_hogre.mdl"; // New Ogre Model + self.headmdl = "progs/ad171/h_hogre.mdl"; + self.gib1mdl = "progs/ad171/w_chainsaw.mdl"; // Chainsaw + self.gib2mdl = "progs/ad171/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/ad171/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/ad171/w_ogregl.mdl"; // Grenade Launcher + + precache_model ("progs/ogre.mdl"); // Precache for upgrade + precache_model ("progs/h_ogre.mdl"); // Load/Quickload need this + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdrag.wav"); // Chainsaw scrap on floor sound + precache_sound ("ogre/ogdth.wav"); // Death sound + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); // Pain + + precache_sound ("ogre/ogsawatk.wav"); // Attack + precache_sound ("ogre/ogleap.wav"); // Leap Attack + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; + self.pain_longanim = TRUE; + self.steptype = FS_TYPESLOW; + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + + + // Standard ogre health 200 with metal+ option + if (self.health < 1) self.health = 200; + if (self.spawnflags & MON_HOGRE_METAL) { + self.health = self.health + MON_HOGRE_METUPG; + if (self.deathstring == "") self.deathstring = " was blown up by an armored Ogre Hunter\n"; + self.skin = 1; + } else { + if (self.deathstring == "") self.deathstring = " was blown up by an Ogre Hunter\n"; + } + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = hogre_stand1; + self.th_walk = hogre_walk1; + self.th_run = hogre_run1; + self.th_die = hogre_die; + self.th_melee = hogre_melee; + self.th_missile = hogre_shoot1; + self.th_pain = hogre_pain; + self.th_wakeup = hogre_wakeup1; + + self.ammo_rockets = 2; + self.classtype = CT_MONHOGRE; // new style hunter ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_hogreham.qc b/QC_other/QC_keep/mon_hogreham.qc new file mode 100644 index 00000000..8917b28b --- /dev/null +++ b/QC_other/QC_keep/mon_hogreham.qc @@ -0,0 +1,470 @@ +/*============================================================================== +HUNTER OGRE - Hammer Time +==============================================================================*/ +$cd id1/models/hogre_ham +$origin 0 0 24 +$base base +$skin base + +// Default stand +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// Running (classic pose) +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// Swing (sideways attack) +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +// Smash (Overarm attack) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +// Thrust (Forward attack) +$frame slam1 slam2 slam3 slam4 slam5 slam6 slam7 slam8 +$frame slam9 slam10 slam11 slam12 slam13 slam14 slam15 slam16 slam17 + +// turretidle (turret mode) +$frame turidle1 turidle2 turidle3 turidle4 +$frame turidle5 turidle6 turidle7 turidle8 + +// Shoot (GL attack) +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// Shootpain (turret mode) +$frame turpainA1 turpainA2 turpainA3 turpainA4 turpainA5 + +// painA - Quick backwards flex +$frame painA1 painA2 painA3 painA4 painA5 + +// painB - Stagger backwards +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 + +// painC - Fall down +$frame painC1 painC2 painC3 painC4 painC5 painC6 painC7 painC8 +$frame painC9 painC10 painC11 painC12 painC13 painC14 painC15 painC16 painC17 + +// turretWake (turret mode) +$frame turwake1 turwake2 turwake3 turwake4 + +// turretRelease (turret mode) +$frame turrel1 turrel2 turrel3 turrel4 + +// deathA (Forward) +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 + +// deathB (Backward) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 + +void(float soundtype) hogreham_sound; + +//============================================================================ +void() hogreham_stand1 =[ $stand1, hogreham_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hogreham_stand2 =[ $stand2, hogreham_stand3 ] {ai_stand();}; +void() hogreham_stand3 =[ $stand3, hogreham_stand4 ] {ai_stand();}; +void() hogreham_stand4 =[ $stand4, hogreham_stand5 ] {ai_stand();}; +void() hogreham_stand5 =[ $stand5, hogreham_stand6 ] {ai_stand();}; +void() hogreham_stand6 =[ $stand6, hogreham_stand7 ] {ai_stand();}; +void() hogreham_stand7 =[ $stand7, hogreham_stand8 ] {ai_stand();}; +void() hogreham_stand8 =[ $stand8, hogreham_stand1 ] {ai_stand();}; + +//============================================================================ +void() hogreham_walk1 =[ $walk1, hogreham_walk2 ] {ai_walk(4);}; +void() hogreham_walk2 =[ $walk2, hogreham_walk3 ] {ai_walk(4);}; +void() hogreham_walk3 =[ $walk3, hogreham_walk4 ] {monster_idle_sound(); ai_walk(4);}; +void() hogreham_walk4 =[ $walk4, hogreham_walk5 ] {ai_walk(4);}; +void() hogreham_walk5 =[ $walk5, hogreham_walk6 ] {ai_walk(4);}; +void() hogreham_walk6 =[ $walk6, hogreham_walk7 ] {monster_footstep(FALSE); ai_walk(4);}; +void() hogreham_walk7 =[ $walk7, hogreham_walk8 ] {ai_walk(4);}; +void() hogreham_walk8 =[ $walk8, hogreham_walk9 ] {ai_walk(4);}; +void() hogreham_walk9 =[ $walk9, hogreham_walk10 ] {ai_walk(4);}; +void() hogreham_walk10 =[ $walk10, hogreham_walk11 ] {ai_walk(4);}; +void() hogreham_walk11 =[ $walk11, hogreham_walk12 ] {ai_walk(4);}; +void() hogreham_walk12 =[ $walk12, hogreham_walk1 ] {monster_footstep(FALSE);ai_walk(3);}; + +//============================================================================ +void() hogreham_run1 =[ $run1, hogreham_run2 ] {monster_idle_sound(); ai_run(8);}; +void() hogreham_run2 =[ $run2, hogreham_run3 ] {monster_footstep(FALSE); ai_run(13);}; +void() hogreham_run3 =[ $run3, hogreham_run4 ] {ai_run(13);}; +void() hogreham_run4 =[ $run4, hogreham_run5 ] {ai_run(13);}; +void() hogreham_run5 =[ $run5, hogreham_run6 ] {ai_run(8);}; +void() hogreham_run6 =[ $run6, hogreham_run7 ] {monster_footstep(FALSE); ai_run(16);}; +void() hogreham_run7 =[ $run7, hogreham_run8 ] {ai_run(18);}; +void() hogreham_run8 =[ $run8, hogreham_run1 ] {ai_run(13);}; + +//============================================================================ +// ogreham_melee(float melee_attack, float side) - defined in aisubs.qc +//---------------------------------------------------------------------- +void() hogreham_swing1 =[ $swing1, hogreham_swing2 ] {ai_charge(4);}; +void() hogreham_swing2 =[ $swing2, hogreham_swing3 ] {ai_charge(8);hogreham_sound(4);}; +void() hogreham_swing3 =[ $swing3, hogreham_swing4 ] {ai_charge(8);}; +void() hogreham_swing4 =[ $swing4, hogreham_swing5 ] {ai_charge(8);}; +void() hogreham_swing5 =[ $swing5, hogreham_swing6 ] {ai_charge(12);}; +void() hogreham_swing6 =[ $swing6, hogreham_swing7 ] {ai_forward(14); + self.meleehitsound = GIB_SOUND_HEAVY; + self.meleecontact = TRUE;ai_meleesmash(20);self.meleecontact = FALSE; +}; +void() hogreham_swing7 =[ $swing7, hogreham_swing8 ] {ai_forward(7);monster_footstep(FALSE);}; +void() hogreham_swing8 =[ $swing8, hogreham_swing9 ] {ai_forward(3);}; +void() hogreham_swing9 =[ $swing9, hogreham_swing10 ] {ai_forward(3);}; +void() hogreham_swing10 =[ $swing10, hogreham_swing11 ] {ai_forward(3);}; +void() hogreham_swing11 =[ $swing11, hogreham_swing12 ] {ai_forward(3);}; +void() hogreham_swing12 =[ $swing12, hogreham_swing13 ] {ai_face();monster_footstep(FALSE);}; +void() hogreham_swing13 =[ $swing13, hogreham_swing14 ] {ai_face();}; +void() hogreham_swing14 =[ $swing14, hogreham_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogreham_smash1 =[ $smash1, hogreham_smash2 ] {ai_charge(10);}; +void() hogreham_smash2 =[ $smash2, hogreham_smash3 ] {ai_charge(10);hogreham_sound(4);}; +void() hogreham_smash3 =[ $smash3, hogreham_smash4 ] {ai_charge(10);}; +void() hogreham_smash4 =[ $smash4, hogreham_smash5 ] {ai_charge(8);}; +void() hogreham_smash5 =[ $smash5, hogreham_smash6 ] {ai_charge(6);}; +void() hogreham_smash6 =[ $smash6, hogreham_smash7 ] {ai_face();}; +void() hogreham_smash7 =[ $smash7, hogreham_smash8 ] {ai_face();}; +void() hogreham_smash8 =[ $smash8, hogreham_smash9 ] {ai_face();monster_footstep(FALSE);}; +void() hogreham_smash9 =[ $smash9, hogreham_smash10 ] {ai_face();}; +void() hogreham_smash10 =[ $smash10, hogreham_smash11 ] {ai_face(); + self.meleehitsound = GIB_SOUND_HEAVY; + self.meleecontact = TRUE;ai_meleesmash(30);self.meleecontact = FALSE; + makevectors (self.angles); // Put impact infront of ogre + self.finalangle = self.origin + (v_forward * 56) + (-v_up * 22); + particle_explode(self.finalangle, 24, 0.5, PARTICLE_BURST_FIRE, PARTICLE_BURST_SHOCKWAVE); + sound (self, CHAN_WEAPON, "ogre/ham_hit.wav", 1, ATTN_IDLE); +}; +void() hogreham_smash11 =[ $smash11, hogreham_smash12 ] {}; +void() hogreham_smash12 =[ $smash12, hogreham_smash13 ] {}; +void() hogreham_smash13 =[ $smash13, hogreham_smash14 ] {ai_face();}; +void() hogreham_smash14 =[ $smash14, hogreham_run1 ] {ai_face();}; + +/*============================================================================ + Special new ground slam attack - knockback shockwave +============================================================================*/ +//---------------------------------------------------------------------- +// Slow wind up animation (impact frame - 13) so it is easier to spot +// Pain animations are suppressed so that the attack always happens +//---------------------------------------------------------------------- +void() hogreham_slam1 =[ $slam1, hogreham_slam2 ] {ai_charge(2);}; +void() hogreham_slam2 =[ $slam2, hogreham_slam3 ] {ai_charge(2);}; +void() hogreham_slam3 =[ $slam3, hogreham_slam4 ] {ai_charge(2);}; +void() hogreham_slam4 =[ $slam4, hogreham_slam5 ] {ai_charge(2);}; +void() hogreham_slam5 =[ $slam5, hogreham_slam6 ] {ai_charge(3);}; +void() hogreham_slam6 =[ $slam6, hogreham_slam7 ] {ai_charge(3);}; +void() hogreham_slam7 =[ $slam7, hogreham_slam8 ] {ai_face();}; +void() hogreham_slam8 =[ $slam8, hogreham_slam9 ] {ai_face();}; +void() hogreham_slam9 =[ $slam9, hogreham_slam10 ] {ai_charge(6); + // Chance of ogre roar (sightsight) instead of weapon swipe + if (random() < 0.2) sound (self, CHAN_VOICE, self.sight_sound, 1, ATTN_IDLE); + else hogreham_sound(4); +}; +void() hogreham_slam10 =[ $slam10, hogreham_slam11 ] {ai_charge(8);}; +void() hogreham_slam11 =[ $slam11, hogreham_slam12 ] {ai_charge(8);}; +void() hogreham_slam12 =[ $slam12, hogreham_slam13 ] {ai_charge(4);}; +void() hogreham_slam13 =[ $slam13, hogreham_slam14 ] { + ai_chargenoturn(4); self.meleehitsound = "ogre/ham_wave.wav"; + ai_shockwave(MONAI_HAMMERIMPACT, MONAI_HAMMERDAMAGE, MONAI_HAMMERRADIUS, MONAI_HAMMERFORWARD, MONAI_HAMMERUP); +}; +void() hogreham_slam14 =[ $slam14, hogreham_slam15 ] {ai_chargenoturn(3);}; +void() hogreham_slam15 =[ $slam15, hogreham_slam16 ] {}; +void() hogreham_slam16 =[ $slam16, hogreham_slam17 ] {}; +void() hogreham_slam17 =[ $slam17, hogreham_run1 ] { + // Double check enemy is still alive? + if (self.enemy.health > 1) { + // If the enemy is visible, quickly fire a grenade at them + if (visxray(self.enemy, self.view_ofs, self.enemy.view_ofs, FALSE)) { + self.attack_state = AS_MISSILE; + self.think = self.th_missile; + } + } +}; + +//---------------------------------------------------------------------- +void() hogreham_melee = +{ + // Hammer ogres don't get interrupted with pain for melee + self.pain_finished = time + 2; + if (self.spawnflags & MON_HOGRE_METAL) hogreham_slam1(); + else { + self.lip = random(); + if (self.lip < 0.5) hogreham_smash1(); + else hogreham_swing1(); + } +}; + +/*============================================================================ + OgreFireGrenade (use version in mon_ogre.qc) +============================================================================*/ +void() hogreham_shoot1 =[ $shoot1, hogreham_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogreham_shoot2 =[ $shoot2, hogreham_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogreham_shoot3 =[ $shoot3, hogreham_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogreham_shoot4 =[ $shoot4, hogreham_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() hogreham_shoot5 =[ $shoot5, hogreham_shoot6 ] {ai_face();}; +void() hogreham_shoot6 =[ $shoot6, hogreham_shoot7 ] {ai_face();}; +void() hogreham_shoot7 =[ $shoot7, hogreham_run1 ] {ai_face();}; + +//============================================================================ +// painA - Quick backwards flex +//---------------------------------------------------------------------- +void() hogreham_painA1 =[ $painA1, hogreham_painA2 ] {}; +void() hogreham_painA2 =[ $painA2, hogreham_painA3 ] {}; +void() hogreham_painA3 =[ $painA3, hogreham_painA4 ] {}; +void() hogreham_painA4 =[ $painA4, hogreham_painA5 ] {}; +void() hogreham_painA5 =[ $painA5, hogreham_run1 ] {}; + +//---------------------------------------------------------------------- +// painB - Stagger backwards +//---------------------------------------------------------------------- +void() hogreham_painB1 =[ $painB1, hogreham_painB2 ] {ai_pain(7);}; +void() hogreham_painB2 =[ $painB2, hogreham_painB3 ] {ai_pain(5);}; +void() hogreham_painB3 =[ $painB3, hogreham_painB4 ] {}; +void() hogreham_painB4 =[ $painB4, hogreham_painB5 ] {monster_footstep(FALSE); }; +void() hogreham_painB5 =[ $painB5, hogreham_painB6 ] {}; +void() hogreham_painB6 =[ $painB6, hogreham_painB7 ] {ai_forward(2);}; +void() hogreham_painB7 =[ $painB7, hogreham_painB8 ] {ai_forward(2);}; +void() hogreham_painB8 =[ $painB8, hogreham_painB9 ] {ai_forward(2);}; +void() hogreham_painB9 =[ $painB9, hogreham_painB10] {ai_forward(2);}; +void() hogreham_painB10=[ $painB10, hogreham_painB11] {ai_forward(2);}; +void() hogreham_painB11=[ $painB11, hogreham_painB12] {ai_forward(2);}; +void() hogreham_painB12=[ $painB12, hogreham_painB13] {ai_forward(2);}; +void() hogreham_painB13=[ $painB13, hogreham_run1 ] {monster_footstep(FALSE); ai_forward(2);}; + +//---------------------------------------------------------------------- +// painC - Fall down +//---------------------------------------------------------------------- +void() hogreham_painC1 =[ $painC1, hogreham_painC2 ] {ai_pain(5);}; +void() hogreham_painC2 =[ $painC2, hogreham_painC3 ] {ai_pain(2);}; +void() hogreham_painC3 =[ $painC3, hogreham_painC4 ] {}; +void() hogreham_painC4 =[ $painC4, hogreham_painC5 ] {}; +void() hogreham_painC5 =[ $painC5, hogreham_painC6 ] {hogreham_sound(3);}; // Ogre hits floor +void() hogreham_painC6 =[ $painC6, hogreham_painC7 ] {}; +void() hogreham_painC7 =[ $painC7, hogreham_painC8 ] {}; +void() hogreham_painC8 =[ $painC8, hogreham_painC9 ] {}; +void() hogreham_painC9 =[ $painC9, hogreham_painC10 ] {}; +void() hogreham_painC10=[ $painC10, hogreham_painC11 ] {monster_footstep(FALSE);}; +void() hogreham_painC11=[ $painC11, hogreham_painC12 ] {}; +void() hogreham_painC12=[ $painC12, hogreham_painC13 ] {}; +void() hogreham_painC13=[ $painC13, hogreham_painC14 ] {monster_footstep(FALSE);ai_forward(3);}; +void() hogreham_painC14=[ $painC14, hogreham_painC15 ] {ai_forward(4);}; +void() hogreham_painC15=[ $painC15, hogreham_painC16 ] {ai_forward(4);}; +void() hogreham_painC16=[ $painC16, hogreham_painC17 ] {ai_forward(5);}; +void() hogreham_painC17=[ $painC17, hogreham_run1 ] {ai_forward(4);}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) hogreham_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.65) hogreham_painA1 (); + else if (self.lip < 0.85) { + self.pain_finished = time + 2; + // Stagger backwards + hogreham_painB1 (); + } + else { + self.pain_finished = time + 2; + // Fall on the floor + hogreham_painC1 (); + } + } + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.3; + hogre_painC1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.7; + hogre_painB1 (); // Stagger backwards + } + } + } +}; + +//============================================================================ +void() hogreham_dieA1 =[ $deathA1, hogreham_dieA2 ] {ai_forward(14);}; +void() hogreham_dieA2 =[ $deathA2, hogreham_dieA3 ] {monster_check_gib();ai_forward(14);}; +void() hogreham_dieA3 =[ $deathA3, hogreham_dieA4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogreham_dieA4 =[ $deathA4, hogreham_dieA5 ] {ai_forward(1);}; +void() hogreham_dieA5 =[ $deathA5, hogreham_dieA6 ] {ai_forward(1);}; +void() hogreham_dieA6 =[ $deathA6, hogreham_dieA7 ] {ai_forward(1);}; +void() hogreham_dieA7 =[ $deathA7, hogreham_dieA8 ] {hogreham_sound(3);}; // Hammer hits floor +void() hogreham_dieA8 =[ $deathA8, hogreham_dieA9 ] {}; +void() hogreham_dieA9 =[ $deathA9, hogreham_dieA10 ] {monster_death_postcheck();}; +void() hogreham_dieA10 =[ $deathA10, hogreham_dieA10 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() hogreham_dieB1 =[ $deathB1, hogreham_dieB2 ] {ai_back(4);}; +void() hogreham_dieB2 =[ $deathB2, hogreham_dieB3 ] {monster_check_gib();ai_back(10);}; +void() hogreham_dieB3 =[ $deathB3, hogreham_dieB4 ] {monster_check_gib();ai_back(3);}; +void() hogreham_dieB4 =[ $deathB4, hogreham_dieB5 ] {ai_back(1); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogreham_dieB5 =[ $deathB5, hogreham_dieB6 ] {}; +void() hogreham_dieB6 =[ $deathB6, hogreham_dieB7 ] {}; +void() hogreham_dieB7 =[ $deathB7, hogreham_dieB8 ] {ai_back(1);}; +void() hogreham_dieB8 =[ $deathB8, hogreham_dieB9 ] {ai_back(1);}; +void() hogreham_dieB9 =[ $deathB9, hogreham_dieB10 ] {hogreham_sound(3);}; // Hammer hits floor +void() hogreham_dieB10 =[ $deathB10, hogreham_dieB11 ] {}; +void() hogreham_dieB11 =[ $deathB11, hogreham_dieB12 ] {}; +void() hogreham_dieB12 =[ $deathB12, hogreham_dieB13 ] {}; +void() hogreham_dieB13 =[ $deathB13, hogreham_dieB14 ] {monster_death_postcheck();}; +void() hogreham_dieB14 =[ $deathB14, hogreham_dieB14 ] {monster_deadbody_check();}; +//---------------------------------------------------------------------- +void() hogreham_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + self.lip = random(); + if (self.lip < 0.5) hogreham_dieA1(); + else hogreham_dieB1(); + } +}; + +//============================================================================ +void(float soundtype) hogreham_sound = +{ + if (soundtype == 1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + else if (soundtype == 2) sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + else if (soundtype == 3) sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + else if (soundtype == 4) sound (self, CHAN_VOICE, "ogre/ham_swipe.wav", 1, ATTN_IDLE); +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() hogreham_wakeup1a =[ $smash7, hogreham_wakeup2a ] {monster_sightsound();}; +void() hogreham_wakeup2a =[ $smash6, hogreham_wakeup3a ] {}; +void() hogreham_wakeup3a =[ $smash8, hogreham_wakeup4a ] {}; +void() hogreham_wakeup4a =[ $smash9, hogreham_wakeup5a ] {}; +void() hogreham_wakeup5a =[ $smash10, hogreham_wakeup6a ] {}; +void() hogreham_wakeup6a =[ $smash11, hogreham_wakeup7a ] {}; +void() hogreham_wakeup7a =[ $smash12, hogreham_wakeup8a ] {}; +void() hogreham_wakeup8a =[ $smash13, hogreham_wakeup9a ] {}; +void() hogreham_wakeup9a =[ $smash14, hogreham_run1 ] {}; + +/*====================================================================== +/*QUAKED monster_hogreham (0.5 0.75 0) (-32 -32 -24) (32 32 64) AMBUSH x METAL NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/ad171/mon_hogreham.mdl"); } +Ogre, 300 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +METAL : Full plate metal armour and +100HP +-------- NOTES -------- + +======================================================================*/ +void() monster_hogreham = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_hogreham.mdl"; // New Ogre Model + self.headmdl = "progs/ad171/h_hogreham.mdl"; // Large head + self.gib1mdl = "progs/ad171/w_ogreham.mdl"; // Ogre Hammer (3 skins) + self.gib2mdl = "progs/ad171/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/ad171/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/ad171/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (MODEL_PROJ_RINGSHOCK); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + self.gib1sound = GIB_IMPACT_WOOD; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdrag.wav"); // Chainsaw scrap on floor sound + precache_sound ("ogre/ogdth.wav"); // Death sound + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); // Pain + + precache_sound ("ogre/ogsawatk.wav"); // Attack + precache_sound ("ogre/ham_swipe.wav"); // hammer swipe + precache_sound ("ogre/ham_hit.wav"); // hammer hit ground + precache_sound ("ogre/ham_wave.wav"); // hammer shockwave + + self.meleehitsound = GIB_SOUND_HEAVY; + precache_sound (self.meleehitsound); // hammer hit + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + + // Upgraded ogre health 300 with metal+ option + if (self.health < 1) self.health = 300; + if (self.spawnflags & MON_HOGRE_METAL) { + self.health = self.health + MON_HOGRE_METUPG; + if (self.deathstring == "") self.deathstring = " was pulverized by an armored Hammer Ogre\n"; + // Always drop hammer, make sure correct skin + self.gib1skin = 1; + self.skin = 1; + } else { + if (self.deathstring == "") self.deathstring = " was pulverized by a Hammer Ogre\n"; + // Random chance to switch GL for hammer + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + } + + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 100; + self.pain_timeout = 2; // High pain resistance + self.pain_longanim = FALSE; + self.steptype = FS_TYPEHEAVY; + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEBLUNTOGRE; // Hammer range + self.movespeed = 0; // Cannot be turret + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreHamCheckAttack; + self.th_stand = hogreham_stand1; + self.th_walk = hogreham_walk1; + self.th_run = hogreham_run1; + self.th_die = hogreham_die; + self.th_melee = hogreham_melee; + self.th_missile = hogreham_shoot1; + self.th_pain = hogreham_pain; + self.th_wakeup = hogreham_wakeup1a; + + self.ammo_rockets = 4; + self.classtype = CT_MONHOGREHAM; // new style hunter ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_hogremac.qc b/QC_other/QC_keep/mon_hogremac.qc new file mode 100644 index 00000000..badbdc87 --- /dev/null +++ b/QC_other/QC_keep/mon_hogremac.qc @@ -0,0 +1,497 @@ +/*============================================================================== +HUNTER OGRE - Mace variant +==============================================================================*/ +$cd id1/models/hogremac_c +$origin 0 0 24 +$base base +$skin base + +// (000) Default stand +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// (008) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// (020) Walking (alternative) +$frame walkB1 walkB2 walkB3 walkB4 walkB5 walkB6 walkB7 walkB8 +$frame walkB9 walkB10 walkB11 walkB12 + +// (032) Running (classic pose) +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// (040) Swing (sideways attack) +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +// (054) Smash (Overarm attack) +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +// (082) Leap (swing arm over and leap forward) +//$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 +//$frame leap9 leap10 leap11 leap12 leap13 leap14 leap15 + +// () Turret idle (Turret mode) +$frame turidle1 turidle2 turidle3 turidle4 +$frame turidle5 turidle6 turidle7 turidle8 + +// () Shoot (GL attack - chainsaw down) +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 + +// () Shootpain (turret mode) +$frame turpainA1 turpainA2 turpainA3 turpainA4 turpainA5 + +// () painA - Quick backwards flex +$frame painA1 painA2 painA3 painA4 painA5 + +// () painB - Stagger backwards +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 painB12 painB13 + +// () painC - Fall down +$frame painC1 painC2 painC3 painC4 painC5 painC6 painC7 painC8 +$frame painC9 painC10 painC11 painC12 painC13 painC14 painC15 painC16 painC17 + +// () turretWake (turret mode) +$frame turwake1 turwake2 turwake3 turwake4 + +// () turretRelease (turret mode) +$frame turrel1 turrel2 turrel3 turrel4 + +// () deathA (Forward) +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 + +// () deathB (Backward) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 deathB13 deathB14 + +void(float soundtype) hogremac_sound; + +//====================================================================== +void() hogremac_stand1 =[ $stand1, hogremac_stand2 ] {monster_idle_sound(); ai_stand();}; +void() hogremac_stand2 =[ $stand2, hogremac_stand3 ] {ai_stand();}; +void() hogremac_stand3 =[ $stand3, hogremac_stand4 ] {ai_stand();}; +void() hogremac_stand4 =[ $stand4, hogremac_stand5 ] {ai_stand();}; +void() hogremac_stand5 =[ $stand5, hogremac_stand6 ] {ai_stand();}; +void() hogremac_stand6 =[ $stand6, hogremac_stand7 ] {ai_stand();}; +void() hogremac_stand7 =[ $stand7, hogremac_stand8 ] {ai_stand();}; +void() hogremac_stand8 =[ $stand8, hogremac_stand1 ] {ai_stand();}; + +//====================================================================== +void() hogremac_walkB1 =[ $walkB1, hogremac_walkB2 ] {ai_walk(4);}; +void() hogremac_walkB2 =[ $walkB2, hogremac_walkB3 ] {ai_walk(6);}; +void() hogremac_walkB3 =[ $walkB3, hogremac_walkB4 ] {monster_idle_sound(); ai_walk(6);}; +void() hogremac_walkB4 =[ $walkB4, hogremac_walkB5 ] {ai_walk(4);}; +void() hogremac_walkB5 =[ $walkB5, hogremac_walkB6 ] {monster_footstep(FALSE); ai_walk(0);}; +void() hogremac_walkB6 =[ $walkB6, hogremac_walkB7 ] {ai_walk(0);}; +void() hogremac_walkB7 =[ $walkB7, hogremac_walkB8 ] {ai_walk(6);}; +void() hogremac_walkB8 =[ $walkB8, hogremac_walkB9 ] {ai_walk(7); + if (random() < 0.1) hogremac_sound(1);}; +void() hogremac_walkB9 =[ $walkB9, hogremac_walkB10] {ai_walk(6);}; +void() hogremac_walkB10 =[ $walkB10, hogremac_walkB11] {ai_walk(2);}; +void() hogremac_walkB11 =[ $walkB11, hogremac_walkB12] {monster_footstep(FALSE);ai_walk(0);}; +void() hogremac_walkB12 =[ $walkB12, hogremac_walk1 ] {ai_walk(0);}; + +//====================================================================== +void() hogremac_walk1 =[ $walk1, hogremac_walk2 ] {ai_walk(4);}; +void() hogremac_walk2 =[ $walk2, hogremac_walk3 ] {ai_walk(4);}; +void() hogremac_walk3 =[ $walk3, hogremac_walk4 ] {monster_idle_sound(); ai_walk(4);}; +void() hogremac_walk4 =[ $walk4, hogremac_walk5 ] {ai_walk(4);}; +void() hogremac_walk5 =[ $walk5, hogremac_walk6 ] {ai_walk(4);}; +void() hogremac_walk6 =[ $walk6, hogremac_walk7 ] {monster_footstep(FALSE); ai_walk(4);}; +void() hogremac_walk7 =[ $walk7, hogremac_walk8 ] {ai_walk(4);}; +void() hogremac_walk8 =[ $walk8, hogremac_walk9 ] {ai_walk(4);}; +void() hogremac_walk9 =[ $walk9, hogremac_walk10] {ai_walk(4); + if (random() < 0.1) hogremac_sound(1);}; +void() hogremac_walk10 =[ $walk10, hogremac_walk11] {ai_walk(4);}; +void() hogremac_walk11 =[ $walk11, hogremac_walk12] {ai_walk(3);}; +void() hogremac_walk12 =[ $walk12, hogremac_walk1 ] {monster_footstep(FALSE); + if (random() < 0.05) self.think = hogremac_walkB1; + ai_walk(4);}; + +//====================================================================== +void() hogremac_run1 =[ $run1, hogremac_run2 ] {monster_idle_sound(); ai_run(8);}; +void() hogremac_run2 =[ $run2, hogremac_run3 ] {monster_footstep(FALSE); ai_run(13);}; +void() hogremac_run3 =[ $run3, hogremac_run4 ] {ai_run(13);}; +void() hogremac_run4 =[ $run4, hogremac_run5 ] {ai_run(13);}; +void() hogremac_run5 =[ $run5, hogremac_run6 ] {ai_run(8);}; +void() hogremac_run6 =[ $run6, hogremac_run7 ] {monster_footstep(FALSE); ai_run(16);}; +void() hogremac_run7 =[ $run7, hogremac_run8 ] {ai_run(18);}; +void() hogremac_run8 =[ $run8, hogremac_run1 ] {ai_run(13);}; + +/*====================================================================== + New Mace attack +======================================================================*/ +void() hogremac_swing1 =[ $swing1, hogremac_swing2 ] {ai_charge(10);}; +void() hogremac_swing2 =[ $swing2, hogremac_swing3 ] {ai_charge(10);hogremac_sound(4);}; +void() hogremac_swing3 =[ $swing3, hogremac_swing4 ] {ai_charge(6);}; +void() hogremac_swing4 =[ $swing4, hogremac_swing5 ] {ai_charge(6);}; +void() hogremac_swing5 =[ $swing5, hogremac_swing6 ] {ai_charge(7);}; +void() hogremac_swing6 =[ $swing6, hogremac_swing7 ] {ai_forward(7); + self.meleecontact = TRUE;ai_meleesmash(20);self.meleecontact = FALSE;}; +void() hogremac_swing7 =[ $swing7, hogremac_swing8 ] {ai_forward(4);monster_footstep(FALSE);}; +void() hogremac_swing8 =[ $swing8, hogremac_swing9 ] {ai_forward(4);}; +void() hogremac_swing9 =[ $swing9, hogremac_swing10 ] {ai_forward(4);}; +void() hogremac_swing10=[ $swing10, hogremac_swing11 ] {ai_forward(4);}; +void() hogremac_swing11=[ $swing11, hogremac_swing12 ] {ai_forward(4);}; +void() hogremac_swing12=[ $swing12, hogremac_swing13 ] {ai_face();monster_footstep(FALSE);}; +void() hogremac_swing13=[ $swing13, hogremac_swing14 ] {ai_face();}; +void() hogremac_swing14=[ $swing14, hogremac_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogremac_smash1 =[ $smash1, hogremac_smash2 ] {ai_charge(9);}; +void() hogremac_smash2 =[ $smash2, hogremac_smash3 ] {ai_charge(9);hogreham_sound(1);}; +void() hogremac_smash3 =[ $smash3, hogremac_smash4 ] {ai_charge(9);}; +void() hogremac_smash4 =[ $smash4, hogremac_smash5 ] {ai_charge(12);}; +void() hogremac_smash5 =[ $smash5, hogremac_smash6 ] {ai_charge(12);}; +void() hogremac_smash6 =[ $smash6, hogremac_smash7 ] {ai_charge(5);}; +void() hogremac_smash7 =[ $smash7, hogremac_smash8 ] {ai_charge(5);}; +void() hogremac_smash8 =[ $smash8, hogremac_smash9 ] {ai_face();monster_footstep(FALSE);}; +void() hogremac_smash9 =[ $smash9, hogremac_smash10 ] {ai_face();}; +void() hogremac_smash10=[ $smash10, hogremac_smash11 ] {ai_face(); + self.meleecontact = TRUE;ai_meleesmash(30);self.meleecontact = FALSE; + makevectors (self.angles); // Put impact infront of ogre + self.finalangle = self.origin + (v_forward * 56) + (-v_up * 22); + particle_explode(self.finalangle, 24, 0.5, PARTICLE_BURST_FIRE, PARTICLE_BURST_SHOCKWAVE); + sound (self, CHAN_WEAPON, "ogre/ham_hit.wav", 1, ATTN_IDLE); +}; +void() hogremac_smash11=[ $smash11, hogremac_smash12 ] {}; +void() hogremac_smash12=[ $smash12, hogremac_smash13 ] {}; +void() hogremac_smash13=[ $smash13, hogremac_smash14 ] {ai_face();}; +void() hogremac_smash14=[ $smash14, hogremac_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogremac_melee = +{ + // Mace ogres don't get interrupted with pain for melee + self.pain_finished = time + 2; + self.lip = random(); + if (self.lip < 0.5) hogremac_smash1(); + else hogremac_swing1(); +}; + +/*====================================================================== + Jump forward (leaving ground) and do heavy damage +====================================================================== +void() hogre_leap11; +void() hogre_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(30); // Damage any breakables + + self.touch = SUB_Null; // No more touching + self.think = hogre_leap11; // Exit frame + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() hogre_leap1 =[ $leap1, hogre_leap2 ] {ai_charge(5);hogre_sound(4); + self.jump_flag = time + MONAI_JUMPHOGRETIME; + self.pain_finished = time + 1;}; +void() hogre_leap2 =[ $leap2, hogre_leap3 ] {ai_charge(12);}; +void() hogre_leap3 =[ $leap3, hogre_leap4 ] {ai_charge(12);}; +void() hogre_leap4 =[ $leap4, hogre_leap5 ] {ai_charge(15);}; +void() hogre_leap5 =[ $leap5, hogre_leap6 ] {ai_charge(7);}; +void() hogre_leap6 =[ $leap6, hogre_leap7 ] {ai_charge(14);}; +void() hogre_leap7 =[ $leap7, hogre_leap8 ] {ai_charge(13); + self.touch = hogre_JumpTouch; + makevectors (self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 350 + '0 0 200'; + if (self.flags & FL_ONGROUND) self.flags = self.flags - FL_ONGROUND; +}; +void() hogre_leap8 =[ $leap8, hogre_leap9 ] {ai_face();}; // Inflight frames +void() hogre_leap9 =[ $leap9, hogre_leap10] {ai_face();}; +void() hogre_leap10=[ $leap10,hogre_leap10] {ai_face();}; + +//---------------------------------------------------------------------- +void() hogre_leap11 =[ $leap11, hogre_leap12 ] {chainsaw(0,2);}; +void() hogre_leap12 =[ $leap12, hogre_leap13 ] {chainsaw(0,1.75);}; +void() hogre_leap13 =[ $leap13, hogre_leap14 ] {chainsaw(0,1.5);}; +void() hogre_leap14 =[ $leap14, hogre_leap15 ] {}; +void() hogre_leap15 =[ $leap15, hogre_run1 ] {}; +*/ + +/*====================================================================== + OgreFireGrenade (use version in mon_ogre.qc) +======================================================================*/ +void() hogremac_shoot1 =[ $shoot1, hogremac_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogremac_shoot2 =[ $shoot2, hogremac_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogremac_shoot3 =[ $shoot3, hogremac_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() hogremac_shoot4 =[ $shoot4, hogremac_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() hogremac_shoot5 =[ $shoot5, hogremac_shoot6 ] {ai_face();}; +void() hogremac_shoot6 =[ $shoot6, hogremac_shoot7 ] {ai_face();}; +void() hogremac_shoot7 =[ $shoot7, hogremac_run1 ] {ai_face();}; + +//====================================================================== +// painA - Quick backwards flex +//---------------------------------------------------------------------- +void() hogremac_painA1 =[ $painA1, hogremac_painA2 ] {}; +void() hogremac_painA2 =[ $painA2, hogremac_painA3 ] {}; +void() hogremac_painA3 =[ $painA3, hogremac_painA4 ] {}; +void() hogremac_painA4 =[ $painA4, hogremac_painA5 ] {}; +void() hogremac_painA5 =[ $painA5, hogremac_run1 ] {}; + +//---------------------------------------------------------------------- +// painB - Stagger backwards +//---------------------------------------------------------------------- +void() hogremac_painB1 =[ $painB1, hogremac_painB2 ] {ai_pain(7);}; +void() hogremac_painB2 =[ $painB2, hogremac_painB3 ] {ai_pain(5);}; +void() hogremac_painB3 =[ $painB3, hogremac_painB4 ] {}; +void() hogremac_painB4 =[ $painB4, hogremac_painB5 ] {monster_footstep(FALSE); }; +void() hogremac_painB5 =[ $painB5, hogremac_painB6 ] {}; +void() hogremac_painB6 =[ $painB6, hogremac_painB7 ] {ai_forward(2);}; +void() hogremac_painB7 =[ $painB7, hogremac_painB8 ] {ai_forward(2);}; +void() hogremac_painB8 =[ $painB8, hogremac_painB9 ] {ai_forward(2);}; +void() hogremac_painB9 =[ $painB9, hogremac_painB10 ] {ai_forward(2);}; +void() hogremac_painB10=[ $painB10, hogremac_painB11 ] {ai_forward(2);}; +void() hogremac_painB11=[ $painB11, hogremac_painB12 ] {ai_forward(2);}; +void() hogremac_painB12=[ $painB12, hogremac_painB13 ] {ai_forward(2);}; +void() hogremac_painB13=[ $painB13, hogremac_run1 ] {monster_footstep(FALSE); ai_forward(2);}; + +//---------------------------------------------------------------------- +// painC - Fall down +//---------------------------------------------------------------------- +void() hogremac_painC1 =[ $painC1, hogremac_painC2 ] {ai_pain(5);}; +void() hogremac_painC2 =[ $painC2, hogremac_painC3 ] {ai_pain(2);}; +void() hogremac_painC3 =[ $painC3, hogremac_painC4 ] {}; +void() hogremac_painC4 =[ $painC4, hogremac_painC5 ] {}; +void() hogremac_painC5 =[ $painC5, hogremac_painC6 ] {hogremac_sound(3);}; // Ogre hits floor +void() hogremac_painC6 =[ $painC6, hogremac_painC7 ] {}; +void() hogremac_painC7 =[ $painC7, hogremac_painC8 ] {}; +void() hogremac_painC8 =[ $painC8, hogremac_painC9 ] {}; +void() hogremac_painC9 =[ $painC9, hogremac_painC10] {}; +void() hogremac_painC10=[ $painC10, hogremac_painC11] {monster_footstep(FALSE);}; +void() hogremac_painC11=[ $painC11, hogremac_painC12] {}; +void() hogremac_painC12=[ $painC12, hogremac_painC13] {}; +void() hogremac_painC13=[ $painC13, hogremac_painC14] {monster_footstep(FALSE);ai_forward(3);}; +void() hogremac_painC14=[ $painC14, hogremac_painC15] {ai_forward(4);}; +void() hogremac_painC15=[ $painC15, hogremac_painC16] {ai_forward(4);}; +void() hogremac_painC16=[ $painC16, hogremac_painC17] {ai_forward(5);}; +void() hogremac_painC17=[ $painC17, hogremac_run1 ] {ai_forward(4);}; + +//====================================================================== +void(entity inflictor, entity attacker, float damage) hogremac_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.65) hogremac_painA1 (); + else if (self.lip < 0.85) { + self.pain_finished = time + 2; + // Stagger backwards + hogremac_painB1 (); + } + else { + self.pain_finished = time + 2; + // Fall on the floor + hogremac_painC1 (); + } + } + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.3; + hogremac_painC1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.7; + hogremac_painB1 (); // Stagger backwards + } + } + } +}; + +//---------------------------------------------------------------------- +// deathA (Forward) +//---------------------------------------------------------------------- +void() hogremac_dieA1 =[ $deathA1, hogremac_dieA2 ] {ai_forward(14);}; +void() hogremac_dieA2 =[ $deathA2, hogremac_dieA3 ] {monster_check_gib();ai_forward(14);}; +void() hogremac_dieA3 =[ $deathA3, hogremac_dieA4 ] {monster_check_gib();ai_forward(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogremac_dieA4 =[ $deathA4, hogremac_dieA5 ] {ai_forward(1);}; +void() hogremac_dieA5 =[ $deathA5, hogremac_dieA6 ] {ai_forward(1);}; +void() hogremac_dieA6 =[ $deathA6, hogremac_dieA7 ] {ai_forward(1);}; +void() hogremac_dieA7 =[ $deathA7, hogremac_dieA8 ] {}; +void() hogremac_dieA8 =[ $deathA8, hogremac_dieA9 ] {hogremac_sound(3);}; // Chainsaw hits floor +void() hogremac_dieA9 =[ $deathA9, hogremac_dieA10 ] {monster_death_postcheck();}; +void() hogremac_dieA10 =[ $deathA10, hogremac_dieA10 ] {}; + +//---------------------------------------------------------------------- +// deathB (Backward) +//---------------------------------------------------------------------- +void() hogremac_dieB1 =[ $deathB1, hogremac_dieB2 ] {ai_back(4);}; +void() hogremac_dieB2 =[ $deathB2, hogremac_dieB3 ] {monster_check_gib();ai_back(10);}; +void() hogremac_dieB3 =[ $deathB3, hogremac_dieB4 ] {monster_check_gib();ai_back(3); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); }; +void() hogremac_dieB4 =[ $deathB4, hogremac_dieB5 ] {ai_back(1);}; +void() hogremac_dieB5 =[ $deathB5, hogremac_dieB6 ] {}; +void() hogremac_dieB6 =[ $deathB6, hogremac_dieB7 ] {}; +void() hogremac_dieB7 =[ $deathB7, hogremac_dieB8 ] {ai_back(1);}; +void() hogremac_dieB8 =[ $deathB8, hogremac_dieB9 ] {ai_back(1);}; +void() hogremac_dieB9 =[ $deathB9, hogremac_dieB10] {hogremac_sound(3);}; // Chainsaw hits floor +void() hogremac_dieB10=[ $deathB10, hogremac_dieB11] {}; +void() hogremac_dieB11=[ $deathB11, hogremac_dieB12] {}; +void() hogremac_dieB12=[ $deathB12, hogremac_dieB13] {}; +void() hogremac_dieB13=[ $deathB13, hogremac_dieB14] {monster_death_postcheck();}; +void() hogremac_dieB14=[ $deathB14, hogremac_dieB14] {}; + +//====================================================================== +void() hogremac_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + if (self.lip < 0.5) hogremac_dieA1(); + else hogremac_dieB1(); + } +}; + +//============================================================================ +void(float soundtype) hogremac_sound = +{ + if (soundtype == 1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); + else if (soundtype == 2) sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + else if (soundtype == 3) sound (self, CHAN_WEAPON, GIB_SOUND_WOOD, 1, ATTN_NORM); + else if (soundtype == 4) sound (self, CHAN_VOICE, "ogre/ham_swipe.wav", 1, ATTN_IDLE); +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() hogremac_wakeup1a =[ $smash7, hogremac_wakeup2a ] {monster_sightsound();}; +void() hogremac_wakeup2a =[ $smash6, hogremac_wakeup3a ] {}; +void() hogremac_wakeup3a =[ $smash8, hogremac_wakeup4a ] {}; +void() hogremac_wakeup4a =[ $smash9, hogremac_wakeup5a ] {}; +void() hogremac_wakeup5a =[ $smash10, hogremac_wakeup6a ] {}; +void() hogremac_wakeup6a =[ $smash11, hogremac_wakeup7a ] {}; +void() hogremac_wakeup7a =[ $smash12, hogremac_wakeup8a ] {}; +void() hogremac_wakeup8a =[ $smash13, hogremac_wakeup9a ] {}; +void() hogremac_wakeup9a =[ $smash14, hogremac_run1 ] {}; + +/*====================================================================== +/*QUAKED monster_hogremac (0.5 0.75 0) (-32 -32 -24) (32 32 64) AMBUSH x METAL NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +{ model(":progs/ad171/mon_hogremac.mdl"); } +Ogre, 200 health points. +-------- KEYS -------- +-------- SPAWNFLAGS -------- +METAL : Chain mail metal armour and +100HP +-------- NOTES -------- + +======================================================================*/ +void() monster_hogremac = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_hogremac.mdl"; // New Ogre Model + self.headmdl = "progs/ad171/h_hogre.mdl"; // Large Head + self.gib1mdl = "progs/ad171/w_ogremac.mdl"; // Heavy Mace + self.gib2mdl = "progs/ad171/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/ad171/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/ad171/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdrag.wav"); // Chainsaw scrap on floor sound + precache_sound ("ogre/ogdth.wav"); // Death sound + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); // Pain + + precache_sound ("ogre/ogsawatk.wav"); // Attack + precache_sound ("ogre/ham_swipe.wav"); // mace swipe + precache_sound ("ogre/ham_hit.wav"); // mace hit ground + + self.meleehitsound = GIB_SOUND_HEAVY; + precache_sound (self.meleehitsound); // mace hit + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + + // Standard ogre health 200 with metal+ option + if (self.health < 1) self.health = 200; + if (self.spawnflags & MON_HOGRE_METAL) { + if (self.deathstring == "") self.deathstring = " was smashed by an armored Mace Ogre\n"; + self.health = self.health + MON_HOGRE_METUPG; + self.skin = 1; + } else { + if (self.deathstring == "") self.deathstring = " was smashed by a Mace Ogre\n"; + } + + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; + self.pain_longanim = TRUE; + self.steptype = FS_TYPEMEDIUM; + self.meleecontact = FALSE; // Smash contact + self.meleerange = MONAI_MELEEBLUNTOGRE; // Blunt mace attack + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = hogremac_stand1; + self.th_walk = hogremac_walk1; + self.th_run = hogremac_run1; + self.th_die = hogremac_die; + self.th_melee = hogremac_melee; + self.th_missile = hogremac_shoot1; +// self.th_jump = hogre_leap1; + self.th_pain = hogremac_pain; + self.th_wakeup = hogremac_wakeup1a; + + self.ammo_rockets = 2; + self.classtype = CT_MONHOGREMAC; // new style hunter ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_invis_sw.qc b/QC_other/QC_keep/mon_invis_sw.qc new file mode 100644 index 00000000..c8fd73ad --- /dev/null +++ b/QC_other/QC_keep/mon_invis_sw.qc @@ -0,0 +1,117 @@ +void () sword_stand1 = [ 0.000, sword_stand1 ] { ai_stand (); }; + +void () sword_run1 = [ 1.000, sword_run2 ] { + self.effects = EF_DIMLIGHT; + ai_run (14); +}; +void () sword_run2 = [ 2.000, sword_run3 ] { ai_run (14); }; +void () sword_run3 = [ 3.000, sword_run4 ] { ai_run (14); }; +void () sword_run4 = [ 4.000, sword_run5 ] { ai_run (14); }; +void () sword_run5 = [ 5.000, sword_run6 ] { ai_run (14); }; +void () sword_run6 = [ 6.000, sword_run7 ] { ai_run (14); }; +void () sword_run7 = [ 7.000, sword_run8 ] { ai_run (14); }; +void () sword_run8 = [ 8.000, sword_run1 ] { ai_run (14); }; + +void () sword_atk1 = [ 9.000, sword_atk2 ] { + sound (self,FALSE,"knight/sword1.wav",TRUE,TRUE); + ai_charge (14); +}; +void () sword_atk2 = [ 10.000, sword_atk3 ] { ai_charge (14); }; +void () sword_atk3 = [ 11.000, sword_atk4 ] { ai_charge (14); }; +void () sword_atk4 = [ 12.000, sword_atk5 ] { ai_charge (14); }; +void () sword_atk5 = [ 13.000, sword_atk6 ] { ai_melee (); }; +void () sword_atk6 = [ 14.000, sword_atk7 ] { ai_melee (); }; +void () sword_atk7 = [ 15.000, sword_atk8 ] { ai_melee (); }; +void () sword_atk8 = [ 16.000, sword_atk9 ] { ai_charge (14); }; +void () sword_atk9 = [ 17.000, sword_atk10 ] { ai_charge (14); }; +void () sword_atk10 = [ 18.000, sword_run1 ] { ai_charge (14); }; + +void () sword_die1 = [ 19.000, sword_die2 ] {}; +void () sword_die2 = [ 20.000, sword_die3 ] { monster_check_gib(); }; +void () sword_die3 = [ 21.000, sword_die4 ] { self.solid = SOLID_NOT; monster_check_gib(); }; +void () sword_die4 = [ 22.000, sword_die5 ] {}; +void () sword_die5 = [ 23.000, sword_die6 ] {}; +void () sword_die6 = [ 24.000, sword_die7 ] {}; +void () sword_die7 = [ 25.000, sword_die8 ] { sound (self,TRUE,"player/axhit2.wav",0.500,ATTN_NORM); }; +void () sword_die8 = [ 26.000, sword_die9 ] {}; +void () sword_die9 = [ 27.000, sword_die10 ] { monster_death_postcheck(); }; +void () sword_die10 = [ 28.000, sword_die10 ] {}; + +void () sword_dieb1 = [ 29.000, sword_dieb2 ] {}; +void () sword_dieb2 = [ 30.000, sword_dieb3 ] { monster_check_gib(); }; +void () sword_dieb3 = [ 31.000, sword_dieb4 ] { self.solid = SOLID_NOT; monster_check_gib(); }; +void () sword_dieb4 = [ 32.000, sword_dieb5 ] {}; +void () sword_dieb5 = [ 33.000, sword_dieb6 ] {}; +void () sword_dieb6 = [ 34.000, sword_dieb7 ] {}; +void () sword_dieb7 = [ 35.000, sword_dieb8 ] { sound (self,TRUE,"player/axhit2.wav",0.500,ATTN_NORM); }; +void () sword_dieb8 = [ 36.000, sword_dieb9 ] {}; +void () sword_dieb9 = [ 37.000, sword_dieb10 ] {}; +void () sword_dieb10 = [ 38.000, sword_dieb11 ] { monster_death_postcheck(); }; +void () sword_dieb11 = [ 39.000, sword_dieb11 ] {}; + +void () sword_die = { + monster_death_precheck(); + if (!self.gibbed) { + if ( (random () < 0.500) ) { + sword_die1 (); + } else { + sword_dieb1 (); + } + } +}; + +void () sword_pause = { + self.th_run = sword_run1; + self.think = sword_run1; + self.nextthink = (time + self.delay); + self.delay = FALSE; +}; + +void (entity inflictor,entity attacker, float damage) sword_pain = { + self.th_run = sword_run1; + self.think = sword_run1; + self.nextthink = (time + 0.100); + self.delay = FALSE; + self.th_pain = SUB_Null_pain; +}; + +void () monster_sword = { + if (deathmatch) { remove (self); return; } + + self.mdl = "progs/rogue/mon_sword.mdl"; + precache_model (self.mdl); + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/ksight.wav"); + precache_sound ("player/axhit2.wav"); + + self.sight_sound = "knight/ksight.wav"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 150; + self.gibhealth = -1000000; + self.gibbed = FALSE; + self.steptype = FS_FLYING; + + if ( !self.delay ) + self.delay = 0.1; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.classtype = CT_MONINVISSWORD; + self.classgroup = CG_DKNIGHT; + self.classmove = MON_MOVEWALK; + self.hittype = HIT_METAL; + + self.th_stand = sword_stand1; + self.th_walk = sword_stand1; + self.th_run = sword_pause; + self.th_melee = sword_atk1; + self.th_die = sword_die; + self.th_pain = sword_pain; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was slit open by a Phantom Swordsman\n"; + monster_start (); +}; diff --git a/QC_other/QC_keep/mon_jim.qc b/QC_other/QC_keep/mon_jim.qc new file mode 100644 index 00000000..71fd590d --- /dev/null +++ b/QC_other/QC_keep/mon_jim.qc @@ -0,0 +1,579 @@ +/*============================================================================== +Jim (Heavily inspired by bob from Quoth - Kell/Necros/Preach) +New models, skins and animations, code +==============================================================================*/ +// Slight movement of wings +$frame idle1 idle2 idle3 idle4 idle5 idle6 + +// Twist wings backward and evil eyes +$frame idle7 idle8 idle9 idle10 idle11 idle12 + +// Wobble gun (+/- 5 degrees) and evil eyes +$frame idle13 idle14 idle15 idle16 idle17 idle18 + +// Idle while gun is point left or right +$frame idleleft1 idleleft2 idleleft3 idleleft4 idleleft5 idleleft6 +$frame idleright1 idleright2 idleright3 idleright4 idleright5 idleright6 + +// Idle and turn gun left or right 30 degrees +$frame idleturnl1 idleturnl2 idleturnl3 idleturnl4 idleturnl5 idleturnl6 +$frame idleturnr1 idleturnr2 idleturnr3 idleturnr4 idleturnr5 idleturnr6 + +// Custom wing movements for combat +$frame movedn1 movedn2 movedn3 movedn4 movedn5 movedn6 +$frame moveup1 moveup2 moveup3 moveup4 moveup5 moveup6 + +// Flap wings and get angry eyes +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +// Downward spiral with twisted wings +$frame zdeath1 zdeath2 zdeath3 zdeath4 zdeath5 zdeath6 + +float JS_IDLE = 0; // Default state +float JS_IDLE2 = 1; // Special idle (stationary) +float JS_IDLE3 = 2; // Special idle (stationary) +float JS_IDLELEFT = 3; // Looking left +float JS_IDLERIGHT = 4; // Looking right +float JS_TURNLEFT = 5; // Turning left (not looped) +float JS_TURNRIGHT = 6; // Turning right (not looped) +float JS_DOWN = 7; // Combat move +float JS_UP = 8; // Combat move +float JS_PAIN = 9; // Resets current animation +float JS_DYING = 10; // Final animation + +// Size of each animation block +float JS_ANIMBLOCK = 6; + +//====================================================================== +// Update Jim every frame with skin/sound updates +// fstate (see above for animation block details) +//====================================================================== +void(float fstate) jim_update = +{ + // If jim is dead, no more updates + if (self.health < 1) return; + + // Update ther gun idle (buzzing) sound + if (self.t_width < time) { + self.t_width = time + 0.9; + // Play on auto channel so it overlaps with existing sound + sound (self, CHAN_AUTO, "jim/gunidle2.wav", 0.3, ATTN_WEAPON); + } + + // Time for an idle sound? + if (self.idletimer < time) monster_idle_sound(); + + // Jim has a glowing gun and eye skin feature! + if (self.t_length < time) { + self.t_length = time + 0.2; + self.exactskin = self.exactskin + 1; + if (self.exactskin > 2) self.exactskin = 0; + self.skin = self.exactskin; + } + + // In combat? + if (self.enemy) { + self.idlebusy = FALSE; + if (fstate == JS_IDLE) { + if (self.origin_z > self.oldorigin_z) fstate = JS_UP; + else if (self.origin_z < self.oldorigin_z) fstate = JS_DOWN; + } + } + else { + // At beginning of frame block and reversing? + if (self.count == 0 && self.idlereverse) { + if (self.idlebusy == JS_TURNLEFT || self.idlebusy == JS_TURNRIGHT) { + self.idlebusy = JS_IDLE; + self.idlereverse = FALSE; + self.waitmin = time + 2 + random() * 4; + } + } + // At end of frame block and going forward? + else if (self.count == JS_ANIMBLOCK-1 && !self.idlereverse) { + // Staring forward, doing nothing + if (self.idlebusy == JS_IDLE && self.waitmin < time) { + // Only start idle animations if stationary + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.idletimer < time) monster_idle_sound(); + self.lip = random(); + if (self.lip < 0.3) self.idlebusy = JS_TURNLEFT; + else if (self.lip < 0.6) self.idlebusy = JS_TURNRIGHT; + else if (self.lip < 0.8) self.idlebusy = JS_IDLE2; + else self.idlebusy = JS_IDLE3; + } + } + // Return from wing flex, gun swing idle animations + else if (self.idlebusy == JS_IDLE2 || self.idlebusy == JS_IDLE3) { + self.idlebusy = JS_IDLE; + self.waitmin = time + 2 + random() * 4; + } + // Turning eyes/gun in left direction + else if (self.idlebusy == JS_TURNLEFT) { + self.idlebusy = JS_IDLELEFT; + self.waitmin = time + 2 + random() * 4; + } + // Turning eyes/gun to right direction + else if (self.idlebusy == JS_TURNRIGHT) { + self.idlebusy = JS_IDLERIGHT; + self.waitmin = time + 2 + random() * 4; + } + // Looking left and randomly think about returning + else if (self.idlebusy == JS_IDLELEFT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = JS_TURNLEFT; + self.idlereverse = TRUE; + } + } + // Looking right and randomly think about returning + else if (self.idlebusy == JS_IDLERIGHT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = JS_TURNRIGHT; + self.idlereverse = TRUE; + } + } + } + + // Change the movement type so that jim can easily move up/down + // using velocity, forced origin movement is really jerky! + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.attack_timer < time) { + self.attack_timer = time + 1; + if (self.lip < 1) self.lip = 1; + else self.lip = -1; + self.velocity_z = 2 * self.lip; + } + } + } + + // Check frame direction and update counter + if (self.idlereverse) self.count = self.count - 1; + else self.count = self.count + 1; + if (self.count >= JS_ANIMBLOCK) self.count = 0; + if (self.count < 0) self.count = JS_ANIMBLOCK-1; + + // Busy with an idle animation? + if (self.idlebusy > 0) fstate = self.idlebusy; + // Update frame animation block with frame counter + self.frame = fstate * JS_ANIMBLOCK + self.count; + // Store current origin position + self.oldorigin = self.origin; +}; + +//====================================================================== +// All stand, walk and run functions are condensed down to one entry +// because the robot has a constant skin/sound update that has to +// happen at specific intervals +// +void() jim_stand1 =[ $idle1, jim_stand1 ] { + // Standing idle has gentle bobbing up and down + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_FLY; + jim_update(JS_IDLE); ai_stand();}; +void() jim_walk1 =[ $idle1, jim_walk1 ] { + // Movement is steps, not velocity + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + jim_update(JS_IDLE); ai_walk(8);}; +void() jim_run1 =[ $idle1, jim_run1 ] { + // Movement is steps, only velocity when firing weapon + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + jim_update(JS_IDLE); + ai_run(16);}; + +//====================================================================== +// Range (LASERS or ROCKETS) +//====================================================================== +void() jim_laser = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + // Always make sure there is no monster or obstacle in the way + if ( visxray(self.enemy, self.attack_offset, '0 0 12', FALSE) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Aim high to catch jumping players + dir = SUB_orgEnemyTarget() + '0 0 12'; + vec = normalize(dir - org); + // Variable laser speed, original unit was just 800 every skill + self.attack_speed = SPEED_JIMPROJ + (skill * SPEED_JIMPROJSKILL); + launch_projectile(org, vec, CT_PROJ_LASER, self.attack_speed); +}; + +//---------------------------------------------------------------------- +// Straight aim rocket, no pre-calculation or steering (skill based speed) +//---------------------------------------------------------------------- +void() jim_rocket = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + // Always make sure there is no monster or obstacle in the way + if ( visxray(self.enemy, self.attack_offset, '0 0 -12', FALSE) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "jim/rocket_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Aim low to catch players with splash damage + dir = SUB_orgEnemyTarget() - '0 0 12'; + vec = normalize(dir - org); + + // Variable rocket speed, matching laser (very nasty) + self.attack_speed = SPEED_JIMPROJ + (skill * SPEED_JIMPROJSKILL); + Launch_Missile (org, vec, '0 0 0', CT_PROJ_JIM2, self.attack_speed); +}; + +//---------------------------------------------------------------------------- +void(float vspeed) jim_vel = { + // Turn and face enemy and update attack velocity + ai_face(); self.velocity = self.attack_track * vspeed; +}; + +//---------------------------------------------------------------------------- +// Calculate new attack vector for firing lasers at the player +//---------------------------------------------------------------------------- +void() jim_attack = +{ + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_FLY; + makevectors(self.angles); + // Always fly upwards away from the player + self.pos1 = v_up * (50 + random() * 100); + // Randomly pick a left or right strafe direction + self.pos2 = v_right * (crandom() * 200); + // Always try to back away from the player + self.pos3 = v_forward * (random() * 100); + + // Merge all the randomness together + self.attack_track = self.pos1 + self.pos2 + self.pos3; + // Check nothing is in the way, estimate vector of attack + traceline(self.origin, self.origin+self.attack_track, FALSE, self); +}; + +//---------------------------------------------------------------------------- +void() jim_fire1 =[ $idle1, jim_fire2 ] {jim_update(JS_IDLE); + if (self.classtype == CT_MONJIM) + sound (self, CHAN_WEAPON, "jim/laser_load.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "jim/rocket_load.wav", 1, ATTN_NORM); +}; +void() jim_fire2 =[ $idle1, jim_fire3 ] {jim_update(JS_IDLE);jim_attack(); + if (skill < SKILL_HARD) jim_vel(0.4); + else jim_vel(1.5); +}; +void() jim_fire3 =[ $idle1, jim_fire4 ] { + jim_update(JS_IDLE); if (skill < SKILL_HARD) jim_vel(0.6);}; +void() jim_fire4 =[ $idle1, jim_fire5 ] { jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(0.8);}; +void() jim_fire5 =[ $idle1, jim_fire6 ] {jim_update(JS_IDLE);jim_vel(1.0);}; +void() jim_fire6 =[ $idle1, jim_fire7 ] { + jim_update(JS_IDLE); if (skill < SKILL_HARD) jim_vel(1.2); + if (self.classtype == CT_MONJIM) jim_laser(); + else jim_rocket(); +}; +void() jim_fire7 =[ $idle1, jim_fire8 ] {jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(1.4); + if (self.classtype == CT_MONJIM) jim_laser(); +}; +void() jim_fire8 =[ $idle1, jim_fire9 ] {jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(1.3); + if (self.classtype == CT_MONJIM && skill >= SKILL_NORMAL) jim_laser(); +}; +void() jim_fire9 =[ $idle1, jim_fire10] {jim_update(JS_IDLE); + if (skill < SKILL_HARD) jim_vel(1.1); + if (self.classtype == CT_MONJIM && skill >= SKILL_HARD) jim_laser(); +}; +void() jim_fire10 =[ $idle1, jim_fire11]{jim_update(JS_IDLE);jim_vel(0.5);}; +void() jim_fire11 =[ $idle1, jim_run1 ] {jim_update(JS_IDLE); + // Chance of bob instantly firing again + if (random() < 0.8) SUB_AttackFinished( 1 + random() ); + else SUB_AttackFinished( 1 + random()*0.5 ); +}; + +//============================================================================ +// ROBOT PAIN!?! +//============================================================================ +void() jim_inpain = +{ + // Keep cycling the pain animation + self.think = jim_inpain; + self.nextthink = time + 0.1; + + // Start of pain cycle + if (self.inpain == 0) { + // Spawn a pile of sparks and dust falling down + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + self.pos1 = '0 0 0'; + self.pos1_x = random() * self.lefty; // Pitch away from dmg + self.pos1_z = crandom() * -10; // Roll left / right + } + // Finished, back to combat + else if (self.inpain >= 5) { + // reset pitch/roll + self.angles_x = self.angles_z = 0; + self.think = self.th_run; + } + else { + // Keep moving in the pitch/roll direction + self.pos1 = self.pos1 * 1.2; + self.angles = self.angles + self.pos1; + } + + // Update pain frame + jim_update(JS_PAIN); + // Next pain animation + self.inpain = self.inpain + 1; +}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) jim_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Stop any ai_run velocity and reset movetype + self.velocity = '0 0 0'; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.inpain = 0; + + // Work out which direction the damage came from (enemy) + if (infront(attacker)) self.lefty = 10; // Hit from infront + else self.lefty = -10; // Hit from behind + + jim_inpain(); +}; + +//============================================================================ +// SLOW DYING ROBOT!?! +//============================================================================ +void() jim_dying2; +void() jim_is_dead; + +//---------------------------------------------------------------------------- +void() jim_dying1 = +{ + // Setup correct death frame + self.frame = JS_DYING + self.cnt; + self.cnt = self.cnt + 1; + + // Start spinning the robot out of control + // This update works with avelocity to create spiral effect + makevectors(self.angles); + self.velocity = (v_forward * 300) + (v_up * -30); + // Keep spinning out of control (constant direction) + if (self.lefty == 1) self.angles_y = (self.angles_y + 10); + else self.angles_y = (self.angles_y - 10); + + // Spawn some extra smoke trails + if (random() < 0.3) SpawnProjectileSmoke(self.origin, 150, 50, 150); + + // Keep looping round + self.think = jim_dying1; + self.nextthink = time + 0.1; + + // Next frame/function? + if (self.cnt > 3) { + self.think = jim_dying2; // Next function + self.waitmin = time + 1; // Setup timer for next part + self.cnt = 0; // Reset death animation + } +}; + +//---------------------------------------------------------------------------- +void() jim_dying2 = +{ + // Setup correct death frame + self.frame = JS_DYING + self.cnt; + self.cnt = self.cnt + 1; + if (self.cnt > 5) self.cnt = 0; + + // Medium explosion + sound OR smoke projectile trail + if (random() > 0.7) SpawnExplosion(EXPLODE_MED, self.origin, "jim/explode_minor.wav"); + else if (random() < 0.3) SpawnProjectileSmoke(self.origin, 150, 50, 150); + + // Turn down towards the ground + makevectors(self.angles); + self.solid = SOLID_BBOX; // Collision + touch + // Slow down the velocity to accent the spinning + self.velocity = (self.velocity * 0.2) + ((v_forward * 100) * 0.8); + self.velocity = normalize(self.velocity) * 300; + self.velocity_z = self.velocity_z - 200; + // Keep spinning out of control (constant direction) + if (self.lefty == 1) self.angles_y = (self.angles_y + 10); + else self.angles_y = (self.angles_y - 10); + + // Keep looping round + self.nextthink = time + 0.1; + if (self.waitmin < time) self.think = jim_is_dead; + else self.think = jim_dying2; +}; + +//---------------------------------------------------------------------------- +void() jim_is_dead = +{ + self.think = self.touch = SUB_Null; + + // Final fireworks! + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnExplosion(EXPLODE_BIG, self.origin, "jim/explode_major.wav"); + + // Goto final resting place + entity_hide(self); +}; + + +//---------------------------------------------------------------------------- +void() jim_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Flush every sound channel to kill gun buzzing sound + sound(self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_ITEM, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_FEET, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_EXTRA1, SOUND_EMPTY, 1, ATTN_NORM); + sound(self, CHAN_EXTRA2, SOUND_EMPTY, 1, ATTN_NORM); + + // Special explosive death event + // First function creates the upward spiral (negative avelocity) + // Second function accents the spiral (1s forward movement) + // Third final impact (touch function goes here as well) + // + sound (self, CHAN_VOICE, "jim/death1.wav", 1, ATTN_NORM); + self.solid = SOLID_NOT; // No world colision + self.movetype = MOVETYPE_FLY; // Free velocity movement + self.touch = jim_is_dead; // still can touch stuff + self.cnt = 0; // Death frame 0 + // The avelocity works better when negative (twisting upward) + self.avelocity_x = (random() * 50) - 100; + self.avelocity_y = (random() * 50) - 100; + self.avelocity_z = (random() * 50) - 100; + + // Decide which direction to spin + if (random() < 0.5) self.lefty = 1; + else self.lefty = 0; + + // Spawn dust and sprite explosion + particle_dust(self.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.origin, "jim/explode_minor.wav"); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + + jim_dying1(); +}; + +/*====================================================================== +/*QUAKED monster_jim (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_jim = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_JIM_ROCKET) self.mdl = "progs/ad171/mon_jimrock.mdl"; + else self.mdl = "progs/ad171/mon_jim.mdl"; + precache_model (self.mdl); + + // death/pain/attack sounds + precache_sound("jim/death1.wav"); + self.pain_sound = "jim/pain1.wav"; + self.pain_sound2 = "jim/pain2.wav"; + precache_sound(self.pain_sound); + precache_sound(self.pain_sound2); + + precache_sound("jim/explode_minor.wav"); + precache_sound("jim/explode_major.wav"); + precache_sound("jim/gunidle2.wav"); // Long buzzing sound + + self.sight_sound = "jim/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 30; // Sometimes flinch + self.steptype = FS_FLYING; // Silent feet + self.pain_longanim = FALSE; // No long pain animation + self.blockudeath = TRUE; // No humanoid death sound + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + self.oldorigin = self.origin; // Used for wing angles + self.idlebusy = 0; // Rotate gun idle states + self.idlereverse = FALSE; // Reverse direction for idle + self.attack_offset = '20 0 -10'; // front of laser/rocket + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = JimCheckAttack; + self.th_stand = jim_stand1; + self.th_walk = jim_walk1; + self.th_run = jim_run1; + self.th_pain = jim_pain; + self.th_die = jim_die; + self.th_missile = jim_fire1; + + self.classgroup = CG_ROBOT; + self.classmove = MON_MOVEFLY; + + self.hittype = HIT_METAL; + + if (self.spawnflags & MON_JIM_ROCKET) { + self.classtype = CT_MONJIMROCKET; + if (self.health < 1) self.health = 50; + + // Classic idle sound + new variant + self.idle_sound = "jim/idle1.wav"; + self.idle_sound2 = "jim/idle3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Projectile fire and impact (used in projectiles) + precache_sound("jim/rocket_load.wav"); // Wind up + precache_sound("jim/rocket_fire.wav"); // Fire + precache_sound("jim/rocket_hit.wav"); // Impact + if (self.deathstring == "") self.deathstring = " was blown away by Jim\n"; + } + else { + self.classtype = CT_MONJIM; + if (self.health < 1) self.health = 100; + + // Classic idle sound + new variant + self.idle_sound = "jim/idle1.wav"; + self.idle_sound2 = "jim/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + // Projectile fire and impact (used in projectiles) + precache_model (MODEL_PROJ_LASER); // Enforcer laser model + precache_sound("jim/laser_load.wav"); // Wind up + precache_sound ("enforcer/enfire.wav"); // Fire + precache_sound ("enforcer/enfstop.wav"); // Impact + if (self.deathstring == "") self.deathstring = " was cauterized by Jim\n"; + } + + monster_start(); +}; + +// Re-direct all Quoth Bob requests to Jim! +void() monster_bob = { + if (self.deathstring == "") self.deathstring = " was zapped by a Bob-bot\n"; + monster_jim(); +} diff --git a/QC_other/QC_keep/mon_knight.qc b/QC_other/QC_keep/mon_knight.qc new file mode 100644 index 00000000..abaf54b2 --- /dev/null +++ b/QC_other/QC_keep/mon_knight.qc @@ -0,0 +1,506 @@ +/*============================================================================== +KNIGHT +==============================================================================*/ +$cd id1/models/knight +$origin 0 0 24 +$base base +$skin badass3 + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8 + +$frame runattack1 runattack2 runattack3 runattack4 runattack5 +$frame runattack6 runattack7 runattack8 runattack9 runattack10 +$frame runattack11 + +$frame pain1 pain2 pain3 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 +$frame painb10 painb11 + +//$frame attackdummy +$frame attackb1 attackb2 attackb3 attackb4 attackb5 +$frame attackb6 attackb7 attackb8 attackb9 attackb10 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 deathb10 deathb11 + +// New - standing idleA - look left +$frame idlea1 idlea2 idlea3 idlea4 idlea5 idlea6 idlea7 idlea8 +$frame idlea9 idlea10 idlea11 idlea12 idlea13 idlea14 idlea15 idlea16 + +// New - standing idleB - look right +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 +$frame idleb9 idleb10 idleb11 idleb12 idleb13 idleb14 + +// New - Standing to standing upright +$frame attnin1 attnin2 attnin3 attnin4 + +// Standing upright +$frame attn1 attn2 attn3 attn4 + +// New - Standing upright to standing +$frame attnout1 attnout2 attnout3 attnout4 + +// Standing to Knee down +$frame kneeldn1 kneeldn2 kneeldn3 kneeldn4 kneeldn5 kneeldn6 +$frame kneeldn7 kneeldn8 kneeldn9 + +// New - Kneeling idle +$frame kneel1 kneel2 kneel3 kneel4 kneel5 kneel6 + +// New - Kneeling down to Standing up +$frame kneelup1 kneelup2 kneelup3 kneelup4 kneelup5 kneelup6 +$frame kneelup7 kneelup8 kneelup9 kneelup10 kneelup11 + +// New - Kneeling down to running +$frame kneelrun1 kneelrun2 kneelrun3 kneelrun4 kneelrun5 +$frame kneelrun6 kneelrun7 kneelrun8 + +void() knight_sword_sound; +void() knight_walk1; +void() knight_run1; + +//=========================================================================== +void() knight_idlea1 =[ $idlea1, knight_idlea2 ] {ai_stand();}; +void() knight_idlea2 =[ $idlea2, knight_idlea3 ] {ai_stand();}; +void() knight_idlea3 =[ $idlea3, knight_idlea4 ] {ai_stand();}; +void() knight_idlea4 =[ $idlea4, knight_idlea5 ] {ai_stand();}; +void() knight_idlea5 =[ $idlea5, knight_idlea6 ] {ai_stand();}; +void() knight_idlea6 =[ $idlea6, knight_idlea7 ] {ai_stand();}; +void() knight_idlea7 =[ $idlea7, knight_idlea8 ] {ai_stand();}; +void() knight_idlea8 =[ $idlea8, knight_idlea9 ] {ai_stand();}; +void() knight_idlea9 =[ $idlea9, knight_idlea10 ] {ai_stand();}; +void() knight_idlea10 =[ $idlea10, knight_idlea11 ] {ai_stand();}; +void() knight_idlea11 =[ $idlea11, knight_idlea12 ] {ai_stand();}; +void() knight_idlea12 =[ $idlea12, knight_idlea13 ] {ai_stand();}; +void() knight_idlea13 =[ $idlea13, knight_idlea14 ] {ai_stand();}; +void() knight_idlea14 =[ $idlea14, knight_idlea15 ] {ai_stand();}; +void() knight_idlea15 =[ $idlea15, knight_idlea16 ] {ai_stand();}; +void() knight_idlea16 =[ $idlea16, knight_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_idleb1 =[ $idleb1, knight_idleb2 ] {ai_stand();}; +void() knight_idleb2 =[ $idleb2, knight_idleb3 ] {ai_stand();}; +void() knight_idleb3 =[ $idleb3, knight_idleb4 ] {ai_stand();}; +void() knight_idleb4 =[ $idleb4, knight_idleb5 ] {ai_stand();}; +void() knight_idleb5 =[ $idleb5, knight_idleb6 ] {ai_stand();}; +void() knight_idleb6 =[ $idleb6, knight_idleb7 ] {ai_stand();}; +void() knight_idleb7 =[ $idleb7, knight_idleb8 ] {ai_stand();}; +void() knight_idleb8 =[ $idleb8, knight_idleb9 ] {ai_stand();}; +void() knight_idleb9 =[ $idleb9, knight_idleb10 ] {ai_stand();}; +void() knight_idleb10 =[ $idleb10, knight_idleb11 ] {ai_stand();}; +void() knight_idleb11 =[ $idleb11, knight_idleb12 ] {ai_stand();}; +void() knight_idleb12 =[ $idleb12, knight_idleb13 ] {ai_stand();}; +void() knight_idleb13 =[ $idleb13, knight_idleb14 ] {ai_stand();}; +void() knight_idleb14 =[ $idleb14, knight_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_kneelup1 =[ $kneelup1, knight_kneelup2 ] {ai_stand();}; +void() knight_kneelup2 =[ $kneelup2, knight_kneelup3 ] {ai_stand();}; +void() knight_kneelup3 =[ $kneelup3, knight_kneelup4 ] {ai_stand();}; +void() knight_kneelup4 =[ $kneelup4, knight_kneelup5 ] {ai_stand();}; +void() knight_kneelup5 =[ $kneelup5, knight_kneelup6 ] {ai_stand();}; +void() knight_kneelup6 =[ $kneelup6, knight_kneelup7 ] {ai_stand();}; +void() knight_kneelup7 =[ $kneelup7, knight_kneelup8 ] {ai_stand();}; +void() knight_kneelup8 =[ $kneelup8, knight_kneelup9 ] {ai_stand();}; +void() knight_kneelup9 =[ $kneelup9, knight_kneelup10] {ai_stand();}; +void() knight_kneelup10=[ $kneelup10, knight_kneelup11] {ai_stand();}; +void() knight_kneelup11=[ $kneelup11, knight_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_kneel1 =[ $kneel1, knight_kneel2 ] {ai_stand();monster_idle_sound();}; +void() knight_kneel2 =[ $kneel2, knight_kneel3 ] {ai_stand();}; +void() knight_kneel3 =[ $kneel3, knight_kneel4 ] {ai_stand();}; +void() knight_kneel4 =[ $kneel4, knight_kneel5 ] {ai_stand();}; +void() knight_kneel5 =[ $kneel5, knight_kneel6 ] {ai_stand();}; +void() knight_kneel6 =[ $kneel6, knight_kneel1 ] {ai_stand(); + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) + self.think = knight_kneelup1; // Start standing up +}; + +//---------------------------------------------------------------------- +void() knight_kneeldn1 =[ $kneeldn1, knight_kneeldn2 ] {ai_stand();}; +void() knight_kneeldn2 =[ $kneeldn2, knight_kneeldn3 ] {ai_stand();}; +void() knight_kneeldn3 =[ $kneeldn3, knight_kneeldn4 ] {ai_stand();}; +void() knight_kneeldn4 =[ $kneeldn4, knight_kneeldn5 ] {ai_stand();}; +void() knight_kneeldn5 =[ $kneeldn5, knight_kneeldn6 ] {ai_stand();}; +void() knight_kneeldn6 =[ $kneeldn6, knight_kneeldn7 ] {ai_stand();}; +void() knight_kneeldn7 =[ $kneeldn7, knight_kneeldn8 ] {ai_stand();}; +void() knight_kneeldn8 =[ $kneeldn8, knight_kneeldn9 ] {ai_stand();}; +void() knight_kneeldn9 =[ $kneeldn9, knight_kneel1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_attn1 =[ $attn1, knight_attn2 ] {ai_stand();monster_idle_sound();}; +void() knight_attn2 =[ $attn2, knight_attn3 ] {ai_stand();}; +void() knight_attn3 =[ $attn3, knight_attn4 ] {ai_stand();}; +void() knight_attn4 =[ $attn4, knight_attn1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();monster_idle_sound();}; +void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();}; +void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();}; +void() knight_stand4 =[ $stand4, knight_stand5 ] {ai_stand();}; +void() knight_stand5 =[ $stand5, knight_stand6 ] {ai_stand();}; +void() knight_stand6 =[ $stand6, knight_stand7 ] {ai_stand();}; +void() knight_stand7 =[ $stand7, knight_stand8 ] {ai_stand();}; +void() knight_stand8 =[ $stand8, knight_stand9 ] {ai_stand();}; +void() knight_stand9 =[ $stand9, knight_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION && self.weaponswitch < time) { + // Slow down the repeating of idle animations + self.weaponswitch = time + 1 + random()*3; + self.idlebusy = TRUE; + + self.lefty = 1 - self.lefty; + if (self.lefty == 1) self.think = knight_idlea1; // Look left + else self.think = knight_idleb1; // Look right + } +}; + +//=========================================================================== +void() knight_walk1 =[ $walk1, knight_walk2 ] { + monster_footstep(FALSE); monster_idle_sound(); ai_walk(3);}; +void() knight_walk2 =[ $walk2, knight_walk3 ] {ai_walk(2);}; +void() knight_walk3 =[ $walk3, knight_walk4 ] {ai_walk(3);}; +void() knight_walk4 =[ $walk4, knight_walk5 ] {ai_walk(4);}; +void() knight_walk5 =[ $walk5, knight_walk6 ] {ai_walk(3);}; +void() knight_walk6 =[ $walk6, knight_walk7 ] {ai_walk(3);}; +void() knight_walk7 =[ $walk7, knight_walk8 ] {ai_walk(3);}; +void() knight_walk8 =[ $walk8, knight_walk9 ] {monster_footstep(FALSE); ai_walk(4);}; +void() knight_walk9 =[ $walk9, knight_walk10 ] {ai_walk(3);}; +void() knight_walk10 =[ $walk10, knight_walk11 ] {ai_walk(3);}; +void() knight_walk11 =[ $walk11, knight_walk12 ] {ai_walk(2);}; +void() knight_walk12 =[ $walk12, knight_walk13 ] {ai_walk(3);}; +void() knight_walk13 =[ $walk13, knight_walk14 ] {ai_walk(4);}; +void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);}; + +//=========================================================================== +void() knight_run1 =[ $runb1, knight_run2 ] {monster_idle_sound(); ai_run(16);}; +void() knight_run2 =[ $runb2, knight_run3 ] {monster_footstep(FALSE); ai_run(20);}; +void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);}; +void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);}; +void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);}; +void() knight_run6 =[ $runb6, knight_run7 ] {monster_footstep(FALSE); ai_run(20);}; +void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);}; +void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);}; + +//============================================================================ +void() knight_runatk1 =[ $runattack1, knight_runatk2 ] { ai_charge(20); }; +void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side();}; +void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side();}; +void() knight_runatk4 =[ $runattack4, knight_runatk5 ] {knight_sword_sound(); ai_charge_side();}; +void() knight_runatk5 =[ $runattack5, knight_runatk6 ] {ai_melee_side();}; +void() knight_runatk6 =[ $runattack6, knight_runatk7 ] {monster_footstep(FALSE); ai_melee_side();}; +void() knight_runatk7 =[ $runattack7, knight_runatk8 ] {ai_melee_side();}; +void() knight_runatk8 =[ $runattack8, knight_runatk9 ] {ai_melee_side();}; +void() knight_runatk9 =[ $runattack9, knight_runatk10 ] {ai_melee_side();}; +void() knight_runatk10 =[ $runattack10, knight_runatk11 ] {monster_footstep(FALSE); ai_charge_side();}; +void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10);}; + +//---------------------------------------------------------------------- +void() knight_atk1 =[ $attackb1, knight_atk2 ] {ai_charge(0);}; +void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);}; +void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4);}; +void() knight_atk4 =[ $attackb4, knight_atk5 ] {knight_sword_sound(); ai_charge(0);}; +void() knight_atk5 =[ $attackb5, knight_atk6 ] {monster_footstep(FALSE); ai_charge(3);}; +void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();}; +void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();}; +void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3); ai_melee();}; +void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1);}; +void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);}; + +//============================================================================= +void() knight_melee = +{ + if (ai_checkmelee(MONAI_MELEEKNIGHT)) knight_atk1 (); + else knight_runatk1 (); +}; + +//=========================================================================== +void() knight_pain1 =[ $pain1, knight_pain2 ] {}; +void() knight_pain2 =[ $pain2, knight_pain3 ] {}; +void() knight_pain3 =[ $pain3, knight_run1 ] {}; + +void() knight_painb1 =[ $painb1, knight_painb2 ] {ai_painforward(0);}; +void() knight_painb2 =[ $painb2, knight_painb3 ] {ai_painforward(3);}; +void() knight_painb3 =[ $painb3, knight_painb4 ] {}; +void() knight_painb4 =[ $painb4, knight_painb5 ] {monster_footstep(FALSE);}; +void() knight_painb5 =[ $painb5, knight_painb6 ] {ai_painforward(2);}; +void() knight_painb6 =[ $painb6, knight_painb7 ] {ai_painforward(4);}; +void() knight_painb7 =[ $painb7, knight_painb8 ] {ai_painforward(2);}; +void() knight_painb8 =[ $painb8, knight_painb9 ] {ai_painforward(5);monster_footstep(FALSE);}; +void() knight_painb9 =[ $painb9, knight_painb10 ] {ai_painforward(5);}; +void() knight_painb10 =[ $painb10, knight_painb11 ] {ai_painforward(0);}; +void() knight_painb11 =[ $painb11, knight_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) knight_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) knight_pain1 (); // classic, body recoil + else { + self.pain_finished = time + 2; // long animation + knight_painb1 (); // Cool stumble, hand over mouth + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + self.pain_finished = time + 1.1; + knight_painb1 (); + } + } +}; + +//============================================================================ +void() knight_die1 =[ $death1, knight_die2 ] {}; +void() knight_die2 =[ $death2, knight_die3 ] {monster_check_gib();}; +void() knight_die3 =[ $death3, knight_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() knight_die4 =[ $death4, knight_die5 ] {}; +void() knight_die5 =[ $death5, knight_die6 ] {}; +void() knight_die6 =[ $death6, knight_die7 ] {}; +void() knight_die7 =[ $death7, knight_die8 ] {}; +void() knight_die8 =[ $death8, knight_die9 ] {}; +void() knight_die9 =[ $death9, knight_die10] {monster_death_postcheck();}; +void() knight_die10=[ $death10, knight_die10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() knight_dieb1 =[ $deathb1, knight_dieb2 ] {}; +void() knight_dieb2 =[ $deathb2, knight_dieb3 ] {monster_check_gib();}; +void() knight_dieb3 =[ $deathb3, knight_dieb4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() knight_dieb4 =[ $deathb4, knight_dieb5 ] {}; +void() knight_dieb5 =[ $deathb5, knight_dieb6 ] {}; +void() knight_dieb6 =[ $deathb6, knight_dieb7 ] {}; +void() knight_dieb7 =[ $deathb7, knight_dieb8 ] {}; +void() knight_dieb8 =[ $deathb8, knight_dieb9 ] {}; +void() knight_dieb9 =[ $deathb9, knight_dieb10] {}; +void() knight_dieb10 = [ $deathb10, knight_dieb11] {monster_death_postcheck();}; +void() knight_dieb11 = [ $deathb11, knight_dieb11] {monster_deadbody_check();}; + +//============================================================================ +void() knight_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + if (random() > 0.5) knight_die1 (); // Forward - standard + else knight_dieb1 (); // Backward - standard + } +}; + +//============================================================================ +void() knight_sword_sound = +{ + if (random() > 0.5) sound (self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); +}; + +//============================================================================ +void() knight_aistates = +{ + self.th_stand = knight_stand1; // Idling on feet + self.th_walk = knight_walk1; // Walking + self.th_run = knight_run1; // Running + self.th_melee = knight_melee; // Sword attack + self.th_pain = knight_pain; // Stumble and pain + self.th_die = knight_die; // Face meets floor +}; + +//---------------------------------------------------------------------- +void() knight_wakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + + self.use = SUB_Null; // no re-trigger + self.takedamage = DAMAGE_AIM; // Can receive damage + self.spawnstatue = FALSE; // No longer stationary + + knight_aistates(); // Restore AI state functions + monster_targets(); // Check for targets +}; + +//---------------------------------------------------------------------- +void() knight_statue = +{ + local float targ_angle, new_frame; + + // Check for sudden death! + if (self.health < 0) return; + + if (random() < MON_IDLE_SOUND && self.pos1_z > 1) { + new_frame = TRUE; + self.oldenemy = checkclient(); + if (self.oldenemy.flags & FL_CLIENT) { + targ_angle = viewangle(self.origin, self.oldenemy.origin, 0, TRUE, self.oldenemy.v_angle_y); + if (targ_angle < 135 || targ_angle > 225) new_frame = FALSE; + } + self.lip = self.pos1_x + rint(random()*self.pos1_z); + if (new_frame) { + sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + self.frame = self.lip; + } + } + + self.think = knight_statue; + self.nextthink = time + 5 + random()*5; +}; + +/*====================================================================== + QUAKED monster_knight (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_knight = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_knight.mdl"; + self.headmdl = "progs/h_knight.mdl"; // Large head + self.gib1mdl = "progs/ad171/w_knightsword.mdl"; // Unique sword + self.gib2mdl = "progs/ad171/gib_knfoot_l.mdl"; // left foot + self.gib3mdl = "progs/ad171/gib_knfoot_r.mdl"; // right foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_METALA; + if (random() < 0.5) self.gib2mdl = ""; + if (random() < 0.5) self.gib3mdl = ""; + + if (self.deathstring == "") self.deathstring = " was slashed by a Knight\n"; + + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + self.idle_sound = "statue/idle1.wav"; + self.idle_sound2 = "statue/idle2.wav"; + self.idle_soundcom = "statue/comidle.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + self.sight_sound = "statue/sight.wav"; + self.pain_sound = "statue/hurt.wav"; + self.death_sound = "statue/death.wav"; + self.gib1skin = 1; // Stoney sword + self.gibtype = GIBTYPE_STONE; // Stoney gibs! + self.gib2mdl = self.gib3mdl = string_null; + } + else { + self.idle_sound = "knight/idle.wav"; + precache_sound (self.idle_sound); + + self.sight_sound = "knight/ksight.wav"; + self.pain_sound = "knight/khurt.wav"; + self.death_sound = "knight/kdeath.wav"; + } + + // Cannot have if precache statements, precache duplicates as well + precache_sound (self.sight_sound); + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + + precache_sound ("knight/sword1.wav"); + precache_sound ("knight/sword2.wav"); + + // Always precache these stone gib models + precache_stonegibs(); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 75; + self.gibhealth = -40; + self.gibbed = FALSE; + self.pain_flinch = 20; + self.pain_longanim = TRUE; + self.steptype = FS_TYPEMEDIUM; + self.skin = 0; + self.th_die = knight_die; // Face meets floor + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.hittype = HIT_METAL; + + //---------------------------------------------------------------------- + // Detect statues and setup different parameters + // Tougher skin, less pain, heavy feet etc + //---------------------------------------------------------------------- + if (self.spawnflags & MON_STATUE) { + self.classgroup = CG_STONE; // Stone hates metal! + self.resist_nails = 0.5; // Tough skin for nails + if (!self.exactskin) self.exactskin = 4; // Stone skin + self.pain_flinch = 40; // Doubled + self.pain_longanim = FALSE; // resistant to shadow axe + self.pain_timeout = 2; // HK pain threshold + self.steptype = FS_TYPEHEAVY; // heavy stone feet! + self.no_liquiddmg = TRUE; // Immune to slime/lava + if (self.deathstring == "") self.deathstring = " was smashed by a Stone Knight\n"; + self.hittype = HIT_STONE; + + // Allow knights to start with a stone skin, but not be frozen! + if (self.spawnflags & MON_NOTFROZEN) { + self.spawnflags = self.spawnflags - MON_STATUE; + knight_aistates(); // setup AI state functions + } + else { + self.spawnstatue = TRUE; // Start as a statue + self.th_stand = knight_statue; // Stone idle sound + self.think1 = knight_wakeup; // Wakeup function when triggered + + // statues can change position when the player is not looking + // Specify a start/finish frame using pos1 or use frame + if (!self.pos1_x) { + self.pos1_x = $attackb1; // Default pose (attacking) + self.pos1_y = $attackb10; + } + // A frame has been specified, create a small range from that + if (self.frame > 0) { + self.pos1_x = self.pos1_y = self.frame; + } + // Work out range, make sure no negative values + self.pos1_z = fabs(self.pos1_y - self.pos1_x); + self.frame = self.pos1_x; // Setup frame / pose + } + } + else { + // The new knight model by Lunaran has 4 available skins to + // choose from. The local option will always override the + // worldspawn option. + // Added -1 option which will randomly pick a skin + if (self.exactskin < 0) self.randomskin = 4; + if (!self.exactskin && world.knight_defskin > 0) + self.exactskin = world.knight_defskin; + + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.classgroup = CG_KNIGHT; // Classic tincan! + knight_aistates(); // setup AI state functions + } + + self.classtype = CT_MONKNIGHT; + self.classmove = MON_MOVEWALK; + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_lavaman.qc b/QC_other/QC_keep/mon_lavaman.qc new file mode 100644 index 00000000..dd6ade2f --- /dev/null +++ b/QC_other/QC_keep/mon_lavaman.qc @@ -0,0 +1,348 @@ +void (float AttackNumber) lavaman_missile; + +void () lavaman_hunt = { + local entity possibleEnemy; + local vector viewPoint; + + if ( (self.enemy.health <= FALSE) ) { + viewPoint = (self.origin + '0.000 0.000 96.000'); + possibleEnemy = find (self.enemy,classname,"player"); + traceline (viewPoint,possibleEnemy.origin,TRUE,world); + if ( (trace_fraction == TRUE) ) + self.enemy = possibleEnemy; + } + if ( self.enemy ) { + ai_face (); + self.movetarget = self.enemy; + self.goalentity = self.enemy; + } +}; + +void () lavaman_rise1 = [ 0.000, lavaman_rise2 ] { sound (self,CHAN_WEAPON,"boss1/out1.wav",TRUE,ATTN_NORM); }; +void () lavaman_rise2 = [ 1.000, lavaman_rise3 ] { sound (self,CHAN_VOICE,"boss1/sight1.wav",TRUE,ATTN_NORM); }; +void () lavaman_rise3 = [ 2.000, lavaman_rise4 ] {}; +void () lavaman_rise4 = [ 3.000, lavaman_rise5 ] {}; +void () lavaman_rise5 = [ 4.000, lavaman_rise6 ] {}; +void () lavaman_rise6 = [ 5.000, lavaman_rise7 ] {}; +void () lavaman_rise7 = [ 6.000, lavaman_rise8 ] {}; +void () lavaman_rise8 = [ 7.000, lavaman_rise9 ] {}; +void () lavaman_rise9 = [ 8.000, lavaman_rise10 ] {}; +void () lavaman_rise10 = [ 9.000, lavaman_rise11 ] {}; +void () lavaman_rise11 = [ 10.000, lavaman_rise12 ] {}; +void () lavaman_rise12 = [ 11.000, lavaman_rise13 ] {}; +void () lavaman_rise13 = [ 12.000, lavaman_rise14 ] {}; +void () lavaman_rise14 = [ 13.000, lavaman_rise15 ] {}; +void () lavaman_rise15 = [ 14.000, lavaman_rise16 ] {}; +void () lavaman_rise16 = [ 15.000, lavaman_rise17 ] {}; +void () lavaman_rise17 = [ 16.000, lavaman_fire1 ] {}; + +void () lavaman_fire1; + +void () lavaman_stand = { + //if ( self.enemy ) { + // LavaManCheckAttack (); + //} else { + // lavaman_hunt (); + //} + ai_stand (); +}; + +void () lavaman_idle1 = [ 17.000, lavaman_idle2 ] { + if ( (random () < 0.200) ) + sound (self,CHAN_VOICE,"boss1/sight1.wav",TRUE,ATTN_NORM); +}; + +void () lavaman_idle2 = [ 18.000, lavaman_idle3 ] { lavaman_stand (); }; +void () lavaman_idle3 = [ 19.000, lavaman_idle4 ] { lavaman_stand (); }; +void () lavaman_idle4 = [ 20.000, lavaman_idle5 ] { lavaman_stand (); }; +void () lavaman_idle5 = [ 21.000, lavaman_idle6 ] { lavaman_stand (); }; +void () lavaman_idle6 = [ 20.000, lavaman_idle7 ] { lavaman_stand (); }; +void () lavaman_idle7 = [ 19.000, lavaman_idle8 ] { lavaman_stand (); }; +void () lavaman_idle8 = [ 18.000, lavaman_idle9 ] { lavaman_stand (); }; +void () lavaman_idle9 = [ 17.000, lavaman_idle1 ] { lavaman_stand (); }; + +void () lavaman_walk = { + //if ( self.enemy ) { + // LavaManCheckAttack (); + //} else { + // lavaman_hunt (); + //} + ai_walk (FL_SWIM); +}; + +void () lavaman_walk1 = [ 17.000, lavaman_walk2 ] { lavaman_walk (); }; +void () lavaman_walk2 = [ 18.000, lavaman_walk3 ] { lavaman_walk (); }; +void () lavaman_walk3 = [ 19.000, lavaman_walk4 ] { lavaman_walk (); }; +void () lavaman_walk4 = [ 20.000, lavaman_walk5 ] { lavaman_walk (); }; +void () lavaman_walk5 = [ 21.000, lavaman_walk6 ] { lavaman_walk (); }; +void () lavaman_walk6 = [ 22.000, lavaman_walk7 ] { lavaman_walk (); }; +void () lavaman_walk7 = [ 23.000, lavaman_walk8 ] { lavaman_walk (); }; +void () lavaman_walk8 = [ 24.000, lavaman_walk9 ] { lavaman_walk (); }; +void () lavaman_walk9 = [ 25.000, lavaman_walk10 ] { lavaman_walk (); }; +void () lavaman_walk10 = [ 26.000, lavaman_walk11 ] { lavaman_walk (); }; +void () lavaman_walk11 = [ 27.000, lavaman_walk12 ] { lavaman_walk (); }; +void () lavaman_walk12 = [ 28.000, lavaman_walk13 ] { lavaman_walk (); }; +void () lavaman_walk13 = [ 29.000, lavaman_walk14 ] { lavaman_walk (); }; +void () lavaman_walk14 = [ 30.000, lavaman_walk15 ] { lavaman_walk (); }; +void () lavaman_walk15 = [ 31.000, lavaman_walk16 ] { lavaman_walk (); }; +void () lavaman_walk16 = [ 32.000, lavaman_walk17 ] { lavaman_walk (); }; +void () lavaman_walk17 = [ 33.000, lavaman_walk18 ] { lavaman_walk (); }; +void () lavaman_walk18 = [ 34.000, lavaman_walk19 ] { lavaman_walk (); }; +void () lavaman_walk19 = [ 35.000, lavaman_walk20 ] { lavaman_walk (); }; +void () lavaman_walk20 = [ 36.000, lavaman_walk21 ] { lavaman_walk (); }; +void () lavaman_walk21 = [ 37.000, lavaman_walk22 ] { lavaman_walk (); }; +void () lavaman_walk22 = [ 38.000, lavaman_walk23 ] { lavaman_walk (); }; +void () lavaman_walk23 = [ 39.000, lavaman_walk24 ] { lavaman_walk (); }; +void () lavaman_walk24 = [ 40.000, lavaman_walk25 ] { lavaman_walk (); }; +void () lavaman_walk25 = [ 41.000, lavaman_walk26 ] { lavaman_walk (); }; +void () lavaman_walk26 = [ 42.000, lavaman_walk27 ] { lavaman_walk (); }; +void () lavaman_walk27 = [ 43.000, lavaman_walk28 ] { lavaman_walk (); }; +void () lavaman_walk28 = [ 44.000, lavaman_walk29 ] { lavaman_walk (); }; +void () lavaman_walk29 = [ 45.000, lavaman_walk30 ] { lavaman_walk (); }; +void () lavaman_walk30 = [ 46.000, lavaman_walk31 ] { lavaman_walk (); }; +void () lavaman_walk31 = [ 47.000, lavaman_walk1 ] {}; + +void () lavaman_run = { + //if ( self.enemy ) { + // LavaManCheckAttack (); + //} else { + // lavaman_hunt (); + //} + ai_run (FL_SWIM); +}; + +void () lavaman_run1 = [ 17.000, lavaman_run2 ] { lavaman_run (); }; +void () lavaman_run2 = [ 18.000, lavaman_run3 ] { lavaman_run (); }; +void () lavaman_run3 = [ 19.000, lavaman_run4 ] { lavaman_run (); }; +void () lavaman_run4 = [ 20.000, lavaman_run5 ] { lavaman_run (); }; +void () lavaman_run5 = [ 21.000, lavaman_run6 ] { lavaman_run (); }; +void () lavaman_run6 = [ 22.000, lavaman_run7 ] { lavaman_run (); }; +void () lavaman_run7 = [ 23.000, lavaman_run8 ] { lavaman_run (); }; +void () lavaman_run8 = [ 24.000, lavaman_run9 ] { lavaman_run (); }; +void () lavaman_run9 = [ 25.000, lavaman_run10 ] { lavaman_run (); }; +void () lavaman_run10 = [ 26.000, lavaman_run11 ] { lavaman_run (); }; +void () lavaman_run11 = [ 27.000, lavaman_run12 ] { lavaman_run (); }; +void () lavaman_run12 = [ 28.000, lavaman_run13 ] { lavaman_run (); }; +void () lavaman_run13 = [ 29.000, lavaman_run14 ] { lavaman_run (); }; +void () lavaman_run14 = [ 30.000, lavaman_run15 ] { lavaman_run (); }; +void () lavaman_run15 = [ 31.000, lavaman_run16 ] { lavaman_run (); }; +void () lavaman_run16 = [ 32.000, lavaman_run17 ] { lavaman_run (); }; +void () lavaman_run17 = [ 33.000, lavaman_run18 ] { lavaman_run (); }; +void () lavaman_run18 = [ 34.000, lavaman_run19 ] { lavaman_run (); }; +void () lavaman_run19 = [ 35.000, lavaman_run20 ] { lavaman_run (); }; +void () lavaman_run20 = [ 36.000, lavaman_run21 ] { lavaman_run (); }; +void () lavaman_run21 = [ 37.000, lavaman_run22 ] { lavaman_run (); }; +void () lavaman_run22 = [ 38.000, lavaman_run23 ] { lavaman_run (); }; +void () lavaman_run23 = [ 39.000, lavaman_run24 ] { lavaman_run (); }; +void () lavaman_run24 = [ 40.000, lavaman_run25 ] { lavaman_run (); }; +void () lavaman_run25 = [ 41.000, lavaman_run26 ] { lavaman_run (); }; +void () lavaman_run26 = [ 42.000, lavaman_run27 ] { lavaman_run (); }; +void () lavaman_run27 = [ 43.000, lavaman_run28 ] { lavaman_run (); }; +void () lavaman_run28 = [ 44.000, lavaman_run29 ] { lavaman_run (); }; +void () lavaman_run29 = [ 45.000, lavaman_run30 ] { lavaman_run (); }; +void () lavaman_run30 = [ 46.000, lavaman_run31 ] { lavaman_run (); }; +void () lavaman_run31 = [ 47.000, lavaman_run1 ] {}; + +void () lavaman_fire1 = [ 57.000, lavaman_fire2 ] { ai_face (); }; +void () lavaman_fire2 = [ 58.000, lavaman_fire3 ] { ai_charge (TRUE); }; +void () lavaman_fire3 = [ 59.000, lavaman_fire4 ] { ai_face (); }; +void () lavaman_fire4 = [ 60.000, lavaman_fire5 ] { ai_face (); }; +void () lavaman_fire5 = [ 61.000, lavaman_fire6 ] { ai_charge (TRUE); }; +void () lavaman_fire6 = [ 62.000, lavaman_fire7 ] { ai_face (); }; +void () lavaman_fire7 = [ 63.000, lavaman_fire8 ] { lavaman_missile (TRUE); }; +void () lavaman_fire8 = [ 64.000, lavaman_fire9 ] { ai_face (); }; +void () lavaman_fire9 = [ 65.000, lavaman_fire10 ] { ai_face (); }; +void () lavaman_fire10 = [ 66.000, lavaman_fire11 ] { ai_charge (TRUE); }; +void () lavaman_fire11 = [ 67.000, lavaman_fire12 ] { ai_face (); }; +void () lavaman_fire12 = [ 68.000, lavaman_fire13 ] { ai_charge (TRUE); }; +void () lavaman_fire13 = [ 69.000, lavaman_fire14 ] { ai_face (); }; +void () lavaman_fire14 = [ 70.000, lavaman_fire15 ] { ai_face (); }; +void () lavaman_fire15 = [ 71.000, lavaman_fire16 ] { ai_charge (TRUE); }; +void () lavaman_fire16 = [ 72.000, lavaman_fire17 ] { ai_charge (TRUE); }; +void () lavaman_fire17 = [ 73.000, lavaman_fire18 ] { ai_face (); }; +void () lavaman_fire18 = [ 74.000, lavaman_fire19 ] { lavaman_missile (FL_SWIM); }; +void () lavaman_fire19 = [ 75.000, lavaman_fire20 ] { ai_face (); }; +void () lavaman_fire20 = [ 76.000, lavaman_fire21 ] { ai_face (); }; +void () lavaman_fire21 = [ 77.000, lavaman_fire22 ] { ai_face (); }; +void () lavaman_fire22 = [ 78.000, lavaman_fire23 ] { ai_charge (TRUE); }; +void () lavaman_fire23 = [ 79.000, lavaman_run1 ] {}; + +void () lavaman_shocka1 = [ 80.000, lavaman_shocka2 ] {}; +void () lavaman_shocka2 = [ 81.000, lavaman_shocka3 ] {}; +void () lavaman_shocka3 = [ 82.000, lavaman_shocka4 ] {}; +void () lavaman_shocka4 = [ 83.000, lavaman_shocka5 ] {}; +void () lavaman_shocka5 = [ 84.000, lavaman_shocka6 ] {}; +void () lavaman_shocka6 = [ 85.000, lavaman_shocka7 ] {}; +void () lavaman_shocka7 = [ 86.000, lavaman_shocka8 ] {}; +void () lavaman_shocka8 = [ 87.000, lavaman_shocka9 ] {}; +void () lavaman_shocka9 = [ 88.000, lavaman_shocka10 ] {}; +void () lavaman_shocka10 = [ 89.000, lavaman_run1 ] {}; + +void (entity inflictor, entity attacker, float damage) lavaman_pain = { + if ( (self.pain_finished > time) ) + return ; + + if ( (random () < 0.050) ) { + self.pain_finished = (time + FL_SWIM); + lavaman_shocka1 (); + } +}; + +void () lavaman_death1 = [ 48.000, lavaman_death2 ] { sound (self,CHAN_VOICE,"boss1/death.wav",TRUE,ATTN_NORM); }; +void () lavaman_death2 = [ 49.000, lavaman_death3 ] {}; +void () lavaman_death3 = [ 50.000, lavaman_death4 ] {}; +void () lavaman_death4 = [ 51.000, lavaman_death5 ] {}; +void () lavaman_death5 = [ 52.000, lavaman_death6 ] {}; +void () lavaman_death6 = [ 53.000, lavaman_death7 ] { self.solid = SOLID_NOT; }; +void () lavaman_death7 = [ 54.000, lavaman_death8 ] {}; +void () lavaman_death8 = [ 55.000, lavaman_death9 ] {}; +void () lavaman_death9 = [ 56.000, lavaman_death10 ] { + sound (self,CHAN_BODY,"boss1/out1.wav",TRUE,ATTN_NORM); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); +}; +void () lavaman_death10 = [ 56.000, lavaman_death10 ] { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + SUB_UseTargets (); + remove (self); +}; + +void () lavaman_touch = { + local float damg; + + if ( (other == self.owner) ) + return ; + + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + damg = 40; + if ( other.health ) { + if ( (other.classname == "monster_shambler") ) + damg = (damg * 0.500); + + T_Damage (other,self,self.owner,damg, DAMARMOR); + } + T_RadiusDamage (self,self.owner,40,world,DAMAGEALL); + self.origin = (self.origin - (FL_CLIENT * normalize (self.velocity))); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + BecomeExplosion (); +}; + +void (float AttackNumber) lavaman_missile = { + local entity fireball; + local vector org; + local vector vec; + local vector d; + local float t; + + makevectors (self.angles); + if ( (AttackNumber == TRUE) ) { + org = (((self.origin + (v_forward * 40)) + (v_right * 65.000)) + (v_up * 130.000)); + } else { + if ( (AttackNumber == FL_SWIM) ) + org = (((self.origin + (v_forward * 40)) - (v_right * 75.000)) + (v_up * 125.000)); + } + d = self.enemy.origin; + t = vlen ((d - org)); + t = (t / 380.000); + if ( (t > 1.750) ) + t = 1.750; + + if ( (t < TRUE) ) + t = TRUE; + + vec = normalize ((d - org)); + fireball = spawn (); + fireball.owner = self; + fireball.movetype = MOVETYPE_BOUNCE; + fireball.solid = SOLID_BBOX; + fireball.angles = vectoangles (vec); + fireball.touch = lavaman_touch; + fireball.classname = "lavaman_ball"; + fireball.skin = 0; + setmodel (fireball,MODEL_PROJ_LAVA); + setsize (fireball,VEC_ORIGIN,VEC_ORIGIN); + setorigin (fireball,org); + fireball.velocity = ((vec * 600.000) * t); + fireball.velocity_z = (fireball.velocity_z + (200.000 * t)); + fireball.avelocity = '200.000 100.000 300.000'; + fireball.think = SUB_Remove; + fireball.nextthink = (time + MOVETYPE_TOSS); + sound (self,CHAN_WEAPON,"boss1/throw.wav",TRUE,ATTN_NORM); + if ( (self.enemy.health <= FALSE) ) + lavaman_idle1 (); +}; + +void () lavaman_awake = { + self.takedamage = DAMAGE_AIM; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.ideal_yaw = (self.angles * '0.000 1.000 0.000'); + //setsize (self,'-24 -24 -24','24 24 64'); + self.view_ofs = '0.000 0.000 48.000'; + self.th_stand = lavaman_idle1; + self.th_walk = lavaman_walk1; + self.th_run = lavaman_run1; + self.th_missile = lavaman_fire1; + self.th_pain = lavaman_pain; + self.th_die = lavaman_death1; + self.th_melee = lavaman_fire1; + self.attack_offset = (self.origin + '0.000 0.000 96.000'); + self.th_checkattack = LavaManCheckAttack; + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + lavaman_rise1 (); +}; + +void () monster_lava_man = { + if ( deathmatch ) { remove(self); return; } + + self.mdl = "progs/rogue/mon_lavaman.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_LAVA); + precache_sound ("boss1/out1.wav"); + precache_sound ("boss1/sight1.wav"); + precache_sound ("boss1/throw.wav"); + precache_sound ("boss1/pain.wav"); + precache_sound ("boss1/death.wav"); + + self.sight_sound = "boss1/sight1.wav"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 1500; + if (self.yaw_speed < 1) self.yaw_speed = 20.000; // Lumbering turn + self.gibhealth = MON_NEVERGIB; + self.gibbed = FALSE; + self.pain_flinch = 80; + self.blockudeath = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = lavaman_awake; + self.th_walk = lavaman_awake; + self.th_run = lavaman_awake; + + self.classtype = CT_MONLAVAMAN; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + droptofloor(); + self.origin = self.origin + '0 0 32'; + if (self.deathstring == "") self.deathstring = " fries in Hephaestus' fury\n"; + monster_start (); +}; diff --git a/QC_other/QC_keep/mon_lostsoul.qc b/QC_other/QC_keep/mon_lostsoul.qc new file mode 100644 index 00000000..972704c2 --- /dev/null +++ b/QC_other/QC_keep/mon_lostsoul.qc @@ -0,0 +1,640 @@ +/*============================================================================== +LOST SOUL +==============================================================================*/ + +// moving jaw up and down (talking) +$frame idle1 idle2 idle3 idle4 idle5 idle6 + +// Tilt head backwards to look up +$frame idleB1 idleB2 idleB3 idleB4 idleB5 idleB6 + +// Tilt head downwards to look below +$frame idleF1 idleF2 idleF3 idleF4 idleF5 idleF6 + +// Keep looking left or right +$frame idleleft1 idleleft2 idleleft3 idleleft4 idleleft5 idleleft6 +$frame idleright1 idleright2 idleright3 idleright4 idleright5 idleright6 + +// Turn head left or right 30 degrees +$frame idleturnl1 idleturnl2 idleturnl3 idleturnl4 idleturnl5 idleturnl6 +$frame idleturnr1 idleturnr2 idleturnr3 idleturnr4 idleturnr5 idleturnr6 + +// mouth wide open and head tilted back +$frame charge1 charge2 charge3 charge4 charge5 charge6 + +// obvious chewing motion +$frame chew1 chew2 chew3 chew4 chew5 chew6 + +// mouth open and rotated Backward or Forward +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame pain7 pain8 pain9 pain10 pain11 pain12 + +// Spawning from nothing +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +float LOST_IDLE = 0; // Default state +float LOST_IDLEB = 1; // Looking UP +float LOST_IDLEF = 2; // Looking DOWN +float LOST_IDLELEFT = 3; // Looking left +float LOST_IDLERIGHT = 4; // Looking right +float LOST_TURNLEFT = 5; // Turning left (not looped) +float LOST_TURNRIGHT = 6; // Turning right (not looped) +float LOST_CHARGE = 7; // Mouth wide open and charging +float LOST_MELEE = 8; // Mouth chomping open/close +float LOST_PAINB = 9; // Roll backwards +float LOST_PAINF = 10; // Roll forward + +// Size of each animation block +float LOST_ANIMBLOCK = 6; + +// Different states and fire particle quantity +float LOST_STATE_STAND = 2; +float LOST_STATE_WALK = 4; +float LOST_STATE_GUARD = 3; +float LOST_STATE_RUN = 5; +float LOST_STATE_PAIN = 6; + +//====================================================================== +// Update Lost Souls every frame with velocity movements and glow eyes! +// fstate (see above for animation block details) +//====================================================================== +void(float fstate) lost_update = +{ + // If Lost is dead, no more updates + if (self.health < 1) return; + + // Time for an idle sound? (run only) + if (self.idletimer < time && self.state == LOST_STATE_RUN) + monster_idle_sound(); + + // Update glowing eyes! (skin types = 0,1,2,3,2,1) + if (self.t_length < time) { + // fire particle quantity linked to AI state + particle_explode(self.origin+'0 0 12', self.state, 1, PARTICLE_BURST_YELLOW, PARTICLE_BURST_LOSTUP); + self.t_length = time + 0.2; + self.exactskin = self.exactskin + 1; + if (self.exactskin > 5) self.exactskin = 0; + self.skin = self.exactskin; + } + + // While standing still or guarding, gently float up and down + if (self.state == LOST_STATE_STAND || self.state == LOST_STATE_GUARD) { + // While standing around idle, gently move up and down + // using velocity, forced origin movement is really jerky! + if (self.velocity_x == 0 && self.velocity_y == 0) { + if (self.attack_timer < time) { + self.attack_timer = time + 1; + if (self.lip < 1) self.lip = 1; + else self.lip = -1; + self.velocity_z = 2 * self.lip; + } + } + } + + // Lost sight of enemy during combat, wait and look around + if (self.state == LOST_STATE_GUARD) { + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + if (random() < 0.5) self.lefty = 1; + else self.lefty = -1; + self.avelocity = '0 0 0'; + self.avelocity_y = self.lefty*50; + self.attack_sidestep = 0; + self.attack_sidedeny = rint(4 + random()*4); + } + + // Keep increasing rotation angle velocity + self.attack_sidestep = self.attack_sidestep + 1; + if (self.attack_sidestep > self.attack_sidedeny) self.avelocity = '0 0 0'; + else self.avelocity_y = self.avelocity_y * 1.25; + + // Check lost idle timer after combat + if (self.lostenemy && self.losttimer < time) { + self.losttimer = LARGE_TIMER; + if (self.lostenemy.health < 0) self.lostenemy = world; + else { + // Restore previous enemy and start hunting + self.enemy = self.lostenemy; + self.think = self.th_run; + self.state = LOST_STATE_RUN; + // Setup goals and DO NOT warn other monsters + FoundHuntTarget(FALSE); + } + } + } + + // Work through all the different AI states + if (self.state == LOST_STATE_STAND || self.state == LOST_STATE_WALK) { + // At beginning of frame block and reversing? + if (self.count == 0 && self.idlereverse) { + if (self.idlebusy == LOST_TURNLEFT || self.idlebusy == LOST_TURNRIGHT) { + self.idlebusy = LOST_IDLE; + self.idlereverse = FALSE; + self.waitmin = time + 2 + random() * 4; + } + } + // At end of frame block and going forward? + else if (self.count == LOST_ANIMBLOCK-1 && !self.idlereverse) { + // Always reset turn left/right animation while walking + if (self.state == LOST_STATE_WALK) { + if (self.idlebusy == LOST_IDLELEFT) { + self.idlebusy = LOST_TURNLEFT; + self.idlereverse = TRUE; + } + else if (self.idlebusy == LOST_IDLERIGHT) { + self.idlebusy = LOST_TURNRIGHT; + self.idlereverse = TRUE; + } + // Return from all other idle animations + else { + self.idlebusy = LOST_IDLE; + self.waitmin = time + 2 + random() * 4; + } + } + // Idle animation designed for standing around + else { + if (self.idlebusy == LOST_IDLE && self.waitmin < time) { + // Randonly pick an idle animation (difference stand/walk) + self.lip = random(); + if (self.lip < 0.4) self.idlebusy = LOST_TURNLEFT; + else if (self.lip < 0.6) self.idlebusy = LOST_TURNRIGHT; + else if (self.lip < 0.8) self.idlebusy = LOST_IDLEB; + else self.idlebusy = LOST_IDLEF; + } + // Return from opening/closing mouth idle animations + else if (self.idlebusy == LOST_IDLEB || self.idlebusy == LOST_IDLEF) { + self.idlebusy = LOST_IDLE; + self.waitmin = time + 2 + random() * 4; + } + // Turning head left direction + else if (self.idlebusy == LOST_TURNLEFT) { + self.idlebusy = LOST_IDLELEFT; + self.waitmin = time + 2 + random() * 4; + } + // Turning head right direction + else if (self.idlebusy == LOST_TURNRIGHT) { + self.idlebusy = LOST_IDLERIGHT; + self.waitmin = time + 2 + random() * 4; + } + // Looking left and randomly think about returning + else if (self.idlebusy == LOST_IDLELEFT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = LOST_TURNLEFT; + self.idlereverse = TRUE; + } + } + // Looking right and randomly think about returning + else if (self.idlebusy == LOST_IDLERIGHT) { + if (self.waitmin < time && random() < 0.5) { + self.idlebusy = LOST_TURNRIGHT; + self.idlereverse = TRUE; + } + } + } + } + } + else { + // All other states (RUN, PAIN, GUARD) + // Reset any previous idle animations + self.idlereverse = FALSE; + self.idlebusy = FALSE; + } + + // Check frame direction and update counter + if (self.idlereverse) self.count = self.count - 1; + else self.count = self.count + 1; + if (self.count >= LOST_ANIMBLOCK) self.count = 0; + if (self.count < 0) self.count = LOST_ANIMBLOCK-1; + + // Busy with an idle animation? + if (self.idlebusy > 0) fstate = self.idlebusy; + // Update frame animation block with frame counter + self.frame = fstate * LOST_ANIMBLOCK + self.count; + // Store current origin position + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------------- +void() lost_flymode = +{ + self.solid = SOLID_SLIDEBOX; // Reset just in case + self.movetype = MOVETYPE_FLY; // Turn body into projectile + // make sure onground is not set, cannot use velocity otherwise + self.flags = self.flags - (self.flags & FL_ONGROUND); +}; + +//---------------------------------------------------------------------------- +void() lost_stepmode = +{ + self.velocity = '0 0 0'; // Back to regular movement + self.avelocity = '0 0 0'; // Cancel any rotation velocity + self.angles_x = self.angles_z = 0; // Reset any X/Y angles + self.solid = SOLID_SLIDEBOX; // Always reset + self.movetype = MOVETYPE_STEP; // Back to discreet movement +}; + +//====================================================================== +// All stand, walk and run functions are condensed down to one entry +// so that the lost souls can move dynamic and have skin updates +// +void() lost_stand1 = [ $idle1, lost_stand1 ] { + if (self.state != LOST_STATE_GUARD) self.state = LOST_STATE_STAND; + lost_flymode(); // allow velocity updates + lost_update(LOST_IDLE); // Update skin + velocity + ai_stand(); +}; +void() lost_guard1 = { self.state = LOST_STATE_GUARD; lost_stand1(); }; + +void() lost_walk1 = [ $idle1, lost_walk1 ] { + self.state = LOST_STATE_WALK; + lost_stepmode(); // back to discreet step mode + lost_update(LOST_IDLE); // Update skin + ai_walk(8); +}; +void() lost_run1 = [ $idle1, lost_run1 ] { + self.state = LOST_STATE_RUN; + lost_stepmode(); // back to discreet step mode + lost_update(LOST_IDLE); // Update skin + ai_run(8); +}; + +//============================================================================ +// Range Charge attack +//============================================================================ +void() lost_charge_touch = +{ + // Stop anymore touching + self.touch = SUB_Null; + self.think = self.th_run; + + // Do not damage other souls with charge attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + T_Damage (other, self, self, DAMAGE_LOSTCHARGE, DAMARMOR); + spawn_touchblood (self, other, DAMAGE_LOSTCHARGE*3); + + // If touched a player, nudge them backwards + if (other.flags & FL_CLIENT) { + self.lostsearch = FALSE; + makevectors (self.angles); + other.velocity = other.velocity + (v_forward * 200 + '0 0 50'); + } + } +}; + +//---------------------------------------------------------------------------- +void() lost_charge1 = +{ + // Play hiss sound, sighted enemy, charging + sound (self, CHAN_WEAPON, "lostsoul/charge.wav", 1, ATTN_NORM); + + self.count = 0; // reset start of animation block + lost_flymode(); // allow velocity updates + lost_update(LOST_CHARGE); // Update skin + // Stop tracking if easy/normal skill + if (skill < SKILL_HARD) self.lostsearch = FALSE; + + self.cnt = 0; // reset speed updates + self.attack_speed = SPEED_LOSTSTART; // Initial speed + self.pos1 = SUB_orgEnemyTarget() + '0 0 12'; // Aim towards head + self.pos2 = normalize(self.pos1 - self.origin); // Vector direction + self.touch = lost_charge_touch; // Damage/end function + self.velocity = self.pos2 * self.attack_speed; // Launch body missile! + self.angles = vectoangles(self.velocity); // Turn straight away + + self.think = self.th_charge; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() lost_charge2 = +{ + if (self.health < 1) return; + lost_update(LOST_CHARGE); + self.nextthink = time + 0.1; + + self.cnt = self.cnt + 1; // speed updates + if (self.cnt > 12) self.think = self.th_run; // End of charge attack + // Keep travelling forward regardless of enemy + else { + // Keep increasing speed every 0.1s (check for max speed) + if (self.attack_speed < SPEED_LOSTMAX) + self.attack_speed = self.attack_speed + SPEED_LOSTCHARGE; + self.velocity = self.pos2 * self.attack_speed; + self.think = self.th_charge; + } +}; + +//====================================================================== +// MELEE ATTACK - Biting +//====================================================================== +void() lost_bite = +{ + local float ldmg; + local entity enemy_targ; + + enemy_targ = SUB_entEnemyTarget(); + + if (!enemy_targ) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEELOSTSOUL)) return; // Too far away + + // Can the target bleed? + if (enemy_targ.takedamage < 1) return; + + sound (self, CHAN_WEAPON, "lostsoul/bite.wav", 1, ATTN_NORM); + + // Lost Soul bite is very weak + ldmg = (random() + random() + random()) * 3; + T_Damage (enemy_targ, self, self, ldmg, DAMARMOR); + + // Spawn blood at mouth of Lost Soul + spawn_touchblood (self, enemy_targ, ldmg*3); +}; + +//---------------------------------------------------------------------------- +void() lost_melee2 = +{ + if (self.health < 1) return; + lost_update(LOST_MELEE); // Update skin + self.cnt = self.cnt + 1; // Next frame + + // Check for bite attack + if (self.cnt == 3) lost_bite(); + + // End of melee attack? + if (self.cnt >= 5) { + // One chop of the jaws and then fly away time + self.think = self.th_run; + + // Check if enemy is still within range for another chop! +// if (ai_checkmelee(MONAI_MELEELOSTSOUL) && SUB_healthEnemyTarget() > 0) +// self.think = self.th_melee; +// else self.think = self.th_run; + } + else self.think = lost_melee2; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() lost_melee1 = +{ + self.count = 0; // reset start of animation block + self.cnt = 0; // Reset bite frame counter + lost_flymode(); // stay in flymode just in case collison probs + lost_update(LOST_MELEE); // Update skin + + self.think = lost_melee2; + self.nextthink = time + 0.1; +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() lost_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() lost_grow1 = [ $grow1, lost_grow2 ] {}; +void() lost_grow2 = [ $grow2, lost_grow3 ] {lost_growangle();}; +void() lost_grow3 = [ $grow3, lost_grow4 ] {lost_growangle();}; +void() lost_grow4 = [ $grow4, lost_grow5 ] {lost_growangle();}; +void() lost_grow5 = [ $grow5, lost_grow6 ] {lost_growangle();}; +void() lost_grow6 = [ $grow6, lost_grow7 ] {lost_growangle();}; +void() lost_grow7 = [ $grow7, lost_grow8 ] {lost_growangle();}; +void() lost_grow8 = [ $grow8, lost_grow9 ] {lost_growangle();}; +void() lost_grow9 = [ $grow9, lost_grow10] {lost_growangle();}; +void() lost_grow10= [ $grow10, lost_run1 ] { + // Is the lost stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + self.state = LOST_STATE_RUN; + self.count = 0; + lost_update(LOST_IDLE); // Update skin + + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = lost_stand1; + self.th_altstand = lost_guard1; + self.th_walk = lost_walk1; + self.th_run = lost_run1; + self.th_melee = lost_melee1; + self.th_missile = lost_charge1; + self.th_charge = lost_charge2; + + // Start charging at player if not dead and got an enemy + if (self.health > 0 && self.enemy) { + ai_face(); + self.think = self.th_missile; + } + } +}; + +//---------------------------------------------------------------------------- +void() lost_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + lost_stepmode(); + lost_grow1(); +}; + +//============================================================================ +// PAIN in the head! +//============================================================================ +void() lost_inpain = +{ + // Update pain frame + lost_update(self.attack_rage); + + // Next pain animation + self.inpain = self.inpain + 1; + if (self.inpain >= 5) self.think = self.th_run; + else self.think = lost_inpain; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) lost_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + if (self.state != LOST_STATE_PAIN) { + // Stop all velocity and reset movetype + lost_stepmode(); + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + } + + // Work out which direction the damage came from (enemy) + if (infront(attacker)) self.attack_rage = LOST_PAINB; // Hit from infront + else self.attack_rage = LOST_PAINF; // Hit from behind + + self.state = LOST_STATE_PAIN; + // Reset pain and current frame counter + self.inpain = self.count = 0; + lost_inpain(); +}; + +//============================================================================ +void() lost_die1 = [ $pain1, lost_die2 ] {}; +void() lost_die2 = [ $pain2, lost_die2 ] { + // Lost souls explode when they die + T_RadiusDamage (self, self, DAMAGE_LOSTSOUL, world, DAMAGEALL); + if (random() < 0.5) self.lip = EXPLODE_SMALL; + else if (random() < 0.9) self.lip = EXPLODE_MED; + else self.lip = EXPLODE_BIG; + SpawnExplosion(self.lip, self.origin, "lostsoul/death.wav"); + // Goto final resting place + entity_remove(self, 0.1); +}; + +//---------------------------------------------------------------------- +void() lost_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Make sure body does not drop to the ground + self.flags = self.flags | FL_FLY; + self.takedamage = DAMAGE_NO; + lost_die1(); +}; + +/*====================================================================== +QUAKED monster_lostsoul (1 0.2 0) (-16 -16 -24) (16 16 24) +======================================================================*/ +void() setup_lostsoul; +void() monster_lostsoul = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_lostsoul.mdl"; + precache_model (self.mdl); + + self.idle_sound = "lostsoul/idle1.wav"; + self.idle_sound2 = "lostsoul/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("lostsoul/charge.wav"); // charge hiss/scream + precache_sound ("lostsoul/bite.wav"); // chomp with teeth + + self.pain_sound = "lostsoul/pain1.wav"; + precache_sound (self.pain_sound); + precache_sound ("lostsoul/death.wav"); + + // Cache lost soul is a special class used for precache only + if (self.classtype != CT_CACHELOSTSOUL) setup_lostsoul(); +}; + +//---------------------------------------------------------------------------- +void() monster_skullwizminion = { + self.classtype = CT_CACHELOSTSOUL; + monster_lostsoul(); +}; + +//---------------------------------------------------------------------------- +void() setup_lostsoul = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + if (self.health < 1) self.health = 30; + self.yaw_speed = 35; // Really fast at turning + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 10; // Always go into pain + self.blockudeath = TRUE; // no humanoid death sound + self.steptype = FS_FLYING; // Silent feet + self.pain_longanim = FALSE; // No long pain animation + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + self.meleeattack = time + 4; // no rotation at spawn + self.mangle = self.angles; // idle rotate left/right + self.idlebusy = 0; // Tilt/turn head animations + self.idlereverse = FALSE; // Reverse direction for idle + self.exactskin = rint(random()*5); // Randomize eye glow + self.lostenemy = world; // Setup old enemy + self.losttimer = LARGE_TIMER; // Stop lost timer + self.lostsearch = FALSE; // Not searching for an enemy + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = LostCheckAttack; + self.th_pain = lost_pain; + self.th_die = lost_die; + if (self.deathstring == "") self.deathstring = " was found by a Lost Soul\n"; + + //---------------------------------------------------------------------- + // Special spawning minion need to start spinning + if (self.classtype == CT_MINIONLOSTSOUL) { + self.th_stand = self.th_walk = self.th_run = lost_grow; + self.th_missile = SUB_Null; + } + //---------------------------------------------------------------------- + // Default lost soul setup + else { + self.th_stand = lost_stand1; + self.th_altstand = lost_guard1; + self.th_walk = lost_walk1; + self.th_run = lost_run1; + self.th_melee = lost_melee1; + self.th_missile = lost_charge1; + self.th_charge = lost_charge2; + } + + self.classtype = CT_MONLOSTSOUL; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn lost souls (requires monster_skullwizminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_lostsoul = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + // Self = skull wizard, there is no egg + update_minioncount(self, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_lostsoul"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self; // Spawner Parent Link + + minion.effects = minion.flags = 0; // make sure are blank + minion.classtype = CT_MINIONLOSTSOUL; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = 0; + minion.classgroup = CG_WIZARD; // Don't turn on master + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + minion.mdl = "progs/mon_lostsoul.mdl"; + + minion.pain_sound = "lostsoul/pain1.wav"; + minion.idle_sound = "lostsoul/idle1.wav"; + minion.idle_sound2 = "lostsoul/idle2.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_lostsoul; +}; diff --git a/QC_other/QC_keep/mon_minotaur.qc b/QC_other/QC_keep/mon_minotaur.qc new file mode 100644 index 00000000..bb1fbce0 --- /dev/null +++ b/QC_other/QC_keep/mon_minotaur.qc @@ -0,0 +1,792 @@ +/*============================================================================== +MINOTAUR (Hexen2 model by Raven Software) (The Shuffler from Marcher MOD) +also known as "The Nethergoat: Spawnmaster of the Elder World" +==============================================================================*/ + +// Slap RIGHT - 7, 9, 11, 13, 15, 17 +// Slap LEFT - 19, 21, 23, 1, 3, 5 +$frame bwalk1 bwalk2 bwalk3 bwalk4 bwalk5 bwalk6 bwalk7 bwalk8 +$frame bwalk9 bwalk10 bwalk11 bwalk12 bwalk13 bwalk14 bwalk15 bwalk16 +$frame bwalk17 bwalk18 bwalk19 bwalk20 bwalk21 bwalk22 bwalk23 bwalk24 + +// (024) Charging - Head down +$frame charge1 charge2 charge3 charge4 charge5 charge6 charge7 charge8 +$frame charge9 charge10 charge11 charge12 + +// (036) Fall forward onto knees +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 death22 death23 death24 +$frame death25 + +// (061) Charging - swiping arm and biting +$frame gore1 gore2 gore3 gore4 gore5 gore6 gore7 gore8 +$frame gore9 gore10 gore11 gore12 + +// (073) Stationary - howl at the moon +$frame howl1 howl2 howl3 howl4 howl5 howl6 howl7 howl8 +$frame howl9 howl10 howl11 howl12 howl13 howl14 howl15 howl16 +$frame howl17 howl18 howl19 howl20 howl21 howl22 howl23 howl24 +$frame howl25 howl26 howl27 howl28 howl29 howl30 howl31 howl32 +$frame howl33 howl34 howl35 howl36 + +// (109) Small leap/jump +$frame jump1 jump2 jump3 jump4 jump5 jump6 jump7 jump8 +$frame jump9 jump10 jump11 jump12 jump13 jump14 jump15 jump16 +$frame jump17 jump18 jump19 jump20 jump21 jump22 jump23 jump24 + +// (133) Quick pain flinch backward +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 + +// (141) Stationary - shake head/arms +$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8 +$frame shake9 shake10 shake11 shake12 shake13 shake14 shake15 shake16 +$frame shake17 shake18 shake19 shake20 + +// (161) Stationary - fire projectile +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 magic13 magic14 magic15 magic16 +$frame magic17 magic18 magic19 magic20 magic21 magic22 magic23 magic24 +$frame magic25 magic26 magic27 magic28 magic29 magic30 magic31 magic32 + +// Looks terrible, not used +// (193) Slide sideways (LEFT) +// (198) Slide sideways (RIGHT) +$frame slideL1 slideL2 slideL3 slideL4 slideL5 +$frame slideR1 slideR2 slideR3 slideR4 slideR5 + +// (203) Idle/wait +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 stand20 stand21 stand22 stand23 stand24 + +// (227) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 + +//============================================================================ +void() mino_stand1 =[ $stand1, mino_stand2 ] {monster_idle_sound();ai_stand();}; +void() mino_stand2 =[ $stand3, mino_stand3 ] {ai_stand();}; +void() mino_stand3 =[ $stand5, mino_stand4 ] {ai_stand();}; +void() mino_stand4 =[ $stand7, mino_stand5 ] {ai_stand();}; +void() mino_stand5 =[ $stand9, mino_stand6 ] {ai_stand();}; +void() mino_stand6 =[ $stand11, mino_stand7 ] {ai_stand();}; +void() mino_stand7 =[ $stand13, mino_stand8 ] {ai_stand();}; +void() mino_stand8 =[ $stand15, mino_stand9 ] {ai_stand();}; +void() mino_stand9 =[ $stand17, mino_stand10 ] {ai_stand();}; +void() mino_stand10 =[ $stand19, mino_stand11 ] {ai_stand();}; +void() mino_stand11 =[ $stand21, mino_stand12 ] {ai_stand();}; +void() mino_stand12 =[ $stand23, mino_stand1 ] {ai_stand();}; + +//============================================================================ +void() mino_walk1 =[ $walk1, mino_walk2 ] {monster_idle_sound();ai_walk(12);}; +void() mino_walk2 =[ $walk3, mino_walk3 ] {ai_walk(12);}; +void() mino_walk3 =[ $walk5, mino_walk4 ] {ai_walk(9);}; +void() mino_walk4 =[ $walk7, mino_walk5 ] {ai_walk(10);monster_footstep(FALSE);}; +void() mino_walk5 =[ $walk9, mino_walk6 ] {ai_walk(4);}; +void() mino_walk6 =[ $walk11, mino_walk7 ] {ai_walk(9);}; +void() mino_walk7 =[ $walk13, mino_walk8 ] {ai_walk(12);}; +void() mino_walk8 =[ $walk15, mino_walk9 ] {ai_walk(12);}; +void() mino_walk9 =[ $walk17, mino_walk10 ] {ai_walk(9);}; +void() mino_walk10 =[ $walk19, mino_walk11 ] {ai_walk(10);monster_footstep(FALSE);}; +void() mino_walk11 =[ $walk21, mino_walk12 ] {ai_walk(4);}; +void() mino_walk12 =[ $walk23, mino_walk1 ] {ai_walk(9);}; + +//============================================================================ +// Charge/run/gore! +//============================================================================ +void() mino_run; + +void() mino_rage1 =[ $charge2, mino_rage2 ] {monster_idle_sound();ai_run(34);}; +void() mino_rage2 =[ $charge4, mino_rage3 ] {ai_run(28);monster_footstep(FALSE);}; +void() mino_rage3 =[ $charge6, mino_rage4 ] {ai_run(26);}; +void() mino_rage4 =[ $charge8, mino_rage5 ] {ai_run(34);}; +void() mino_rage5 =[ $charge10, mino_rage6 ] {ai_run(28);monster_footstep(FALSE);}; +void() mino_rage6 =[ $charge12, mino_run ] {ai_run(26);}; + +//---------------------------------------------------------------------- +void() mino_run1 =[ $walk1, mino_run2 ] {monster_idle_sound();ai_run(12);}; +void() mino_run2 =[ $walk3, mino_run3 ] {ai_run(12);}; +void() mino_run3 =[ $walk5, mino_run4 ] {ai_run(9);}; +void() mino_run4 =[ $walk7, mino_run5 ] {ai_run(10);monster_footstep(FALSE);}; +void() mino_run5 =[ $walk9, mino_run6 ] {ai_run(4);}; +void() mino_run6 =[ $walk11, mino_run7 ] {ai_run(9);}; +void() mino_run7 =[ $walk13, mino_run8 ] {ai_run(12);}; +void() mino_run8 =[ $walk15, mino_run9 ] {ai_run(12);}; +void() mino_run9 =[ $walk17, mino_run10 ] {ai_run(9);}; +void() mino_run10 =[ $walk19, mino_run11 ] {ai_run(10);monster_footstep(FALSE);}; +void() mino_run11 =[ $walk21, mino_run12 ] {ai_run(4);}; +void() mino_run12 =[ $walk23, mino_run ] {ai_run(9);}; + +//---------------------------------------------------------------------- +void() mino_run = +{ + if (self.attack_rage) mino_rage1(); + else mino_run1(); +}; + +//---------------------------------------------------------------------- +// Short howl animation to switch to rage mode +//---------------------------------------------------------------------- +void() mino_howl1 =[ $howl1, mino_howl2 ] { + sound (self, CHAN_WEAPON, "minotaur/attack1long.wav", 1, ATTN_NORM);}; +void() mino_howl2 =[ $howl3, mino_howl3 ] {}; +void() mino_howl3 =[ $howl5, mino_howl4 ] {}; +void() mino_howl4 =[ $howl7, mino_howl5 ] {}; +void() mino_howl5 =[ $howl9, mino_howl6 ] {}; +void() mino_howl6 =[ $howl19, mino_howl7 ] {}; +void() mino_howl7 =[ $howl21, mino_howl8 ] {}; +void() mino_howl8 =[ $howl23, mino_howl9 ] {}; +void() mino_howl9 =[ $howl25, mino_howl10 ] {}; +void() mino_howl10 =[ $howl27, mino_howl11 ] {}; +void() mino_howl11 =[ $howl29, mino_howl12 ] {}; +void() mino_howl12 =[ $howl31, mino_run ] {}; + +//============================================================================ +// MELEE ATTACK (claws) +//============================================================================ +void(float side) mino_claw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + ai_damagebreakable(50); // Damage any breakables + + if (!ai_checkmelee(MONAI_MELEEMINOTAUR) || !self.enemy.takedamage) { + // Melee claw miss sound + sound (self, CHAN_WEAPON, "minotaur/swipe.wav", 1, ATTN_NORM); + } + else { + // Melee claw hit sound + if (self.lefty) sound (self, CHAN_WEAPON, "minotaur/strike1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "minotaur/strike2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; + ldmg = 12 + 6*random(); + // Rage attack is once per animation frame, more deadly + if (self.attack_rage) ldmg = ldmg*2; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +// Slap LEFT - 19, 21, 23, 1, 3, 5 +// Slap RIGHT - 7, 9, 11, 13, 15, 17 +void() mino_slapL1 =[ $bwalk19, mino_slapL2 ] {ai_charge(10);monster_footstep(FALSE);}; +void() mino_slapL2 =[ $bwalk21, mino_slapL3 ] {ai_charge(4);}; +void() mino_slapL3 =[ $bwalk23, mino_slapL4 ] {ai_charge(9);}; +void() mino_slapL4 =[ $bwalk1, mino_slapL5 ] {ai_charge(12);mino_claw(-250);}; +void() mino_slapL5 =[ $bwalk3, mino_slapL6 ] {ai_charge(12);}; +void() mino_slapL6 =[ $bwalk5, mino_slapR1 ] {ai_charge(9);}; + +void() mino_slapR1 =[ $bwalk7, mino_slapR2 ] {ai_charge(10);monster_footstep(FALSE);}; +void() mino_slapR2 =[ $bwalk9, mino_slapR3 ] {ai_charge(4);}; +void() mino_slapR3 =[ $bwalk11, mino_slapR4 ] {ai_charge(9);}; +void() mino_slapR4 =[ $bwalk13, mino_slapR5 ] {ai_charge(12);mino_claw(250);}; +void() mino_slapR5 =[ $bwalk15, mino_slapR6 ] {ai_charge(12);}; +void() mino_slapR6 =[ $bwalk17, mino_run ] {ai_charge(9); + // Check if enemy is close, alive and visible before doing more melee + if (random() < 0.5 && ai_checkmelee(MONAI_MELEEMINOTAUR) && + self.enemy.health > 0 && visible(self.enemy)) self.think = mino_slapL1; +}; + +//---------------------------------------------------------------------- +// Rage melee attack +void() mino_gore1 =[ $gore2, mino_gore2 ] {ai_charge(34);}; +void() mino_gore2 =[ $gore4, mino_gore3 ] {ai_charge(28);monster_footstep(FALSE);}; +void() mino_gore3 =[ $gore6, mino_gore4 ] {ai_charge(26);mino_claw(-250);}; +void() mino_gore4 =[ $gore8, mino_gore5 ] {ai_charge(34);}; +void() mino_gore5 =[ $gore10, mino_gore6 ] {ai_charge(28);monster_footstep(FALSE);}; +void() mino_gore6 =[ $gore12, mino_run ] {ai_charge(26);}; + +//---------------------------------------------------------------------- +void() mino_melee = +{ + // Switch to a faster more deadly melee attack if in rage mode + if (self.attack_rage) mino_gore1(); + else { + // Randomly start left or right and then loop + if (random() < 0.5) mino_slapR1(); + else mino_slapL1(); + } +}; + +//============================================================================ +// JUMP ATTACK - pre-rage only +//============================================================================ +void() mino_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(30); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + + // Keep track of how many times touched the same object + if (self.jumptouch == other) self.jump_flag = time + MONAI_JUMPTIMEOUT; + self.jumptouch = other; // Keep track of touch target + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 20 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the minotaur floating in the air? + if (!checkbottom(self)) { + // Is the minotaur standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() mino_jump1 =[ $jump1, mino_jump2 ] { + self.jump_flag = time + MONAI_JUMPMINOTIME; + // Use combat idle grunt sounds (can get annoying otherwise) + if (random() < 0.5) sound (self, CHAN_VOICE, self.idle_soundcom, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_soundcom2, 1, ATTN_NORM); +}; +void() mino_jump2 =[ $jump3, mino_jump3 ] {ai_face();}; +void() mino_jump3 =[ $jump5, mino_jump4 ] {ai_face();}; +void() mino_jump4 =[ $jump7, mino_jump5 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPMINOTIME; + self.touch = mino_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * 450 + '0 0 250'; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() mino_jump5 =[ $jump9, mino_jump6 ] {ai_face();}; +void() mino_jump6 =[ $jump11, mino_jump7 ] {}; +void() mino_jump7 =[ $jump13, mino_jump8 ] {ai_face();}; +void() mino_jump8 =[ $jump15, mino_jump8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = mino_jump4; // Keep jumping + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() mino_jump10 =[ $jump19, mino_jump12 ] {ai_charge(8);monster_footstep(FALSE);}; +void() mino_jump12 =[ $jump23, mino_run ] {ai_charge(10);ai_resetangles(); + // If close enough start melee ELSE return to run cycle + if (ai_checkmelee(MONAI_MELEEMINOTAUR) && self.enemy.health > 0) + self.think = mino_melee; +}; + +//============================================================================ +// RANGE ATTACK - Plasma Bolts (rocket) +//============================================================================ +void() minotaur_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_MBALL; + } + if (!self.attachment2) { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_ATTACHMENT; + self.attachment2.mdl = MODEL_PROJ_MBALL; + } +}; + +//---------------------------------------------------------------------- +void() minotaur_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } + if (self.attachment2) { + setmodel(self.attachment2, ""); + self.attachment2.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() minotaur_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } + if (self.attachment2) { + self.attachment2.think = SUB_Remove; + self.attachment2.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void(entity handent, vector orgofs, float dbframe) minotaur_handball = +{ + local vector org; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + handent.state = STATE_ON; + setorigin(handent, self.origin); + setmodel(handent, handent.mdl); + setsize (handent, VEC_ORIGIN, VEC_ORIGIN); + handent.movetype = MOVETYPE_NONE; + handent.solid = SOLID_NOT; + handent.skin = self.exactskin; + handent.alpha = 0.85; + } + + // Generate attachment in hand (left) + // makevectors set in previous function (minotaur_hands) + org = self.origin + attack_vector(orgofs); + setorigin(handent, org); + handent.angles_y = rint(random()*359); + handent.frame = dbframe; +}; + +//---------------------------------------------------------------------- +// There is a ball for each hand with different origins +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float dbframe) minotaur_hands = +{ + if (self.health < 1) return; + + // Keep turning towards enemy + ai_face(); + makevectors(self.angles); + + // Generate a ball in each hand + minotaur_handball(self.attachment, leftofs, dbframe); + minotaur_handball(self.attachment2, rightofs, dbframe); +}; + +//---------------------------------------------------------------------- +// Fire a volley of plasma/poison bolts at the enemy +//---------------------------------------------------------------------- +void(vector orgofs, float angofs) minotaur_fire = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_MINOBOLT + (skill * SPEED_MINOSKILL); + makevectors(self.angles); + org = self.origin + attack_vector(orgofs); + dir = (self.enemy.origin - org) + (v_right*(angofs*30)); + dir = normalize (dir); + + // The spawning minotaur has poison spikes instead + if (self.spawnflags & MON_MINOTAUR_MINIONS) + launch_projectile(org, dir, CT_PROJ_MPOISON, self.attack_speed); + else { + // Projectile behaves like plasma (light/trail/impact effects) + // The correct projectile model is switched in launch function + launch_plasma(org, dir, CT_PROJ_PLASMA, self.attack_speed); + } +}; + +//---------------------------------------------------------------------- +// Main projectile plasma/poison attack of both types of minotaur +//---------------------------------------------------------------------- +void() mino_magic1 =[ $magic1, mino_magic2 ] {ai_face(); + if (random() < 3) sound (self, CHAN_BODY, "minotaur/attack1start.wav", 1, ATTN_NORM);}; +void() mino_magic2 =[ $magic3, mino_magic3 ] {minotaur_hands('34 0 44','-20 30 20',0);}; +void() mino_magic3 =[ $magic5, mino_magic4 ] {minotaur_hands('30 -12 64','-20 44 28',1);}; +void() mino_magic4 =[ $magic7, mino_magic5 ] {minotaur_hands('15 -16 88','-10 56 48',2);}; +void() mino_magic5 =[ $magic9, mino_magic6 ] {minotaur_hands('0 -40 80','-10 48 76',3);}; +void() mino_magic6 =[ $magic11, mino_magic7 ] {minotaur_hands('16 -36 72','-12 44 80',4);}; +void() mino_magic7 =[ $magic13, mino_magic8 ] {minotaur_hands('36 -20 56','24 32 68',5);}; + +void() mino_magic8 =[ $magic15, mino_magic9 ] { + sound (self, CHAN_WEAPON, "minotaur/bolt_fire.wav", 1, ATTN_NORM); + minotaur_hands('40 -3 46','40 1 44',6);minotaur_fire('40 0 45',-2);}; +void() mino_magic9 =[ $magic17, mino_magic10 ] {ai_back(8); + minotaur_hands('32 -2 44','32 2 44',5);minotaur_fire('32 0 44',-1);}; +void() mino_magic10 =[ $magic19, mino_magic11 ] {ai_back(4); + minotaur_hands('20 0 48','20 2 46',4);minotaur_fire('20 0 47',0);}; +void() mino_magic11 =[ $magic21, mino_magic12 ] {ai_forward(4);monster_footstep(FALSE); + minotaur_hands('28 0 50','28 2 48',3);minotaur_fire('28 0 49',1);}; +void() mino_magic12 =[ $magic23, mino_magic13 ] {ai_forward(8); + minotaur_hands('44 0 46','44 2 44',2);minotaur_fire('44 0 45',2);}; + +void() mino_magic13 =[ $magic25, mino_magic14 ] { + // Remove hand attachments and setup particle explosion + // Create a cloud of particles which slowly raise upwards + minotaur_finish_attachment(); + ai_face(); + makevectors(self.angles); + self.finalangle = self.origin + (v_forward * 44) + (v_up * 32); + // Spawn a mist of blue/green particles where projectiles came from + particle_explode(self.finalangle, 50, 3, self.part_style, PARTICLE_BURST_MINOTAUR); + // Random chance of final growl at player + if (random() < 0.3) sound (self, CHAN_BODY, "minotaur/attack1end.wav", 1, ATTN_NORM); +}; +void() mino_magic14 =[ $magic27, mino_magic15 ] {}; +void() mino_magic15 =[ $magic29, mino_magic16 ] {ai_face();}; +void() mino_magic16 =[ $magic31, mino_run ] {ai_face();}; + +//---------------------------------------------------------------------- +// Spawn particles from body that float upwards during summons +//---------------------------------------------------------------------- +void() mino_sumeffect = +{ particle_debuff(self.origin+'0 0 64', 16, rint(4+random()*4), PARTICLE_BURST_GREEN);}; + +//---------------------------------------------------------------------- +// Display a green ball where the gargoyle is spawning +//---------------------------------------------------------------------- +void(float dbframe) mino_sumball = +{ + // Double check the space checks worked + if (self.aflag == FALSE) return; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.pos2); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = self.exactskin; + } + + // rotate and fade the ball as it grows + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = dbframe; + self.attachment.lip = 0.3 + ((7-dbframe) * 0.1); + self.attachment.alpha = self.attachment.lip; + particle_explode(self.pos2, 5+random()*10, 3, self.part_style, PARTICLE_BURST_MINOTAUR); +}; + +//---------------------------------------------------------------------- +// Raise up head and howl at the sky and spawn green particles from body +// Always check if there is space to spawn a gargoyle first +// Block monster pain function so that the summons is completed +//---------------------------------------------------------------------- +void() mino_summon1 =[ $howl1, mino_summon2 ] {ai_face();self.pain_finished = time + 2;}; +void() mino_summon2 =[ $howl3, mino_summon3 ] {ai_face();}; +void() mino_summon3 =[ $howl5, mino_summon4 ] {ai_face();mino_sumeffect(); + sound (self, CHAN_BODY, "minotaur/attack1long.wav", 1, ATTN_NORM);}; +void() mino_summon4 =[ $howl7, mino_summon5 ] {mino_sumeffect();}; +void() mino_summon5 =[ $howl9, mino_summon6 ] {mino_sumeffect();}; +void() mino_summon6 =[ $howl11, mino_summon7 ] {mino_sumeffect();}; +void() mino_summon7 =[ $howl13, mino_summon8 ] {mino_sumeffect(); + // Find out if there is enough space to spawn a gargoyle + // Findradius version + makevectors(self.angles); + self.pos1 = self.origin + self.view_ofs + v_forward*64 + v_up*32; + self.aflag = find_minionspace(self.pos1); + + // If the spawn locaiton all clear, spawn something! + if (self.aflag == TRUE) { + minion_gargoyle(self.pos1, self.enemy); + self.pos2 = self.pos1 - '0 0 16'; // Origin of gargoyle + mino_sumball(0); + } +}; +void() mino_summon8 =[ $howl15, mino_summon9 ] {mino_sumeffect();mino_sumball(1);}; +void() mino_summon9 =[ $howl17, mino_summon10 ] {mino_sumeffect();mino_sumball(2);}; +void() mino_summon10 =[ $howl19, mino_summon11 ] {mino_sumeffect();mino_sumball(3);}; +void() mino_summon11 =[ $howl21, mino_summon12 ] {mino_sumeffect();mino_sumball(4);}; +void() mino_summon12 =[ $howl23, mino_summon13 ] {mino_sumeffect();mino_sumball(5);}; +void() mino_summon13 =[ $howl25, mino_summon14 ] {mino_sumeffect();mino_sumball(6);}; +void() mino_summon14 =[ $howl27, mino_summon15 ] {mino_sumeffect();mino_sumball(7);}; +void() mino_summon15 =[ $howl29, mino_summon16 ] {minotaur_finish_attachment(); + if (self.aflag == TRUE) particle_explode(self.pos1, 50, 3, self.part_style, PARTICLE_BURST_MINOTAUR);}; +void() mino_summon16 =[ $howl31, mino_summon17 ] {}; +void() mino_summon17 =[ $howl33, mino_summon18 ] {ai_face();}; +void() mino_summon18 =[ $howl35, mino_run ] {ai_face();SUB_AttackFinished (1 + 2*random());}; + +//---------------------------------------------------------------------- +// Both type of minotaurs go through the same magic function +//---------------------------------------------------------------------- +void() mino_magic = +{ + local entity miniondef; + + // Make sure the attachments are setup ready + minotaur_create_attachment(); + + if (self.spawnflags & MON_MINOTAUR_MINIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_minotaurminion"); + if (miniondef.classtype == CT_CACHEGARGOYLE) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[MINOTAUR]\b Cannot find minion template!\n"); + self.spawnflags = self.spawnflags - MON_MINOTAUR_MINIONS; + } + } + + // Is the target the player or monster? + if (self.enemy.flags & FL_CLIENT) { + if (self.spawnflags & MON_MINOTAUR_MINIONS) { + // has the gargoyle limit been reached? + if (query_minionactive(self) == TRUE) mino_summon1(); + else { + if (self.minion_baseattack > 0 ) mino_magic1(); + else mino_run(); + } + } + // White Minotaur attacks with plasma + else mino_magic1(); + + } + // Always attack monsters with plasma/poison projectiles + else mino_magic1(); +}; + +//============================================================================ +// CHARGE ATTACK - just been hit with a long pain animation (pre-rage only) +//============================================================================ +void(float dist) mino_chargecheck = +{ + // turn, face and pursue enemy + ai_charge(dist); + // Close enough for melee combat? + if (ai_checkmelee(MONAI_MELEEMINOTAUR)) self.th_melee(); + // Enemy dead? run out of stamina or enemy not infront? + if (self.enemy.health < 1) self.think = mino_run; + else if (self.attack_finished < time) self.think = mino_run; + else if (!infront(self.enemy)) self.think = mino_run; +}; + +//---------------------------------------------------------------------- +void() mino_charge1 =[ $charge1, mino_charge2 ] {mino_chargecheck(34);}; +void() mino_charge2 =[ $charge3, mino_charge3 ] {mino_chargecheck(28);monster_footstep(FALSE);}; +void() mino_charge3 =[ $charge5, mino_charge4 ] {mino_chargecheck(26);}; +void() mino_charge4 =[ $charge7, mino_charge5 ] {mino_chargecheck(34);}; +void() mino_charge5 =[ $charge9, mino_charge6 ] {mino_chargecheck(28);monster_footstep(FALSE);}; +void() mino_charge6 =[ $charge11, mino_charge1 ] {mino_chargecheck(26);}; + +//---------------------------------------------------------------------- +void() mino_charge = +{ + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.attack_finished = time + 2 + random(); + mino_charge1(); +}; + +//============================================================================ +// (133) Quick pain flinch backward +void() mino_pain1 = [ $pain1, mino_pain2 ] {}; +void() mino_pain2 = [ $pain2, mino_pain3 ] {}; +void() mino_pain3 = [ $pain3, mino_pain4 ] {}; +void() mino_pain4 = [ $pain4, mino_pain5 ] {}; +void() mino_pain5 = [ $pain5, mino_pain6 ] {}; +void() mino_pain6 = [ $pain6, mino_pain7 ] {}; +void() mino_pain7 = [ $pain7, mino_pain8 ] {}; +void() mino_pain8 = [ $pain8, mino_run ] {}; + +//---------------------------------------------------------------------- +// (141) Stationary - shake head/arms +// Block the pain and then start charging like crazy +void() mino_shake1 = [ $shake1, mino_shake2 ] {self.pain_finished = time + 2;}; +void() mino_shake2 = [ $shake3, mino_shake3 ] {}; +void() mino_shake3 = [ $shake5, mino_shake4 ] {}; +void() mino_shake4 = [ $shake7, mino_shake5 ] {}; +void() mino_shake5 = [ $shake9, mino_shake6 ] {}; +void() mino_shake6 = [ $shake11, mino_shake7 ] {}; +void() mino_shake7 = [ $shake13, mino_shake8 ] {}; +void() mino_shake8 = [ $shake15, mino_shake9 ] {}; +void() mino_shake9 = [ $shake17, mino_shake10 ] {}; +void() mino_shake10 = [ $shake19, mino_run ] { + // If pre-rage and can see enemy, start chasing + if (self.attack_rage == FALSE && infront(self.enemy)) self.think = mino_charge; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) mino_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + minotaur_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random(); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Minion spawning minotaur always goes short pain cycle + if (self.spawnflags & MON_MINOTAUR_MINIONS) mino_pain1(); + else { + if (self.lip < 0.4) mino_pain1(); + else mino_shake1(); + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.8; + self.axhitme = 0; + mino_pain1(); + } + } +}; + +//============================================================================ +void() mino_death1 = [ $death1, mino_death2 ] {}; +void() mino_death2 = [ $death3, mino_death3 ] {ai_forward(2);monster_check_gib();}; +void() mino_death3 = [ $death5, mino_death4 ] {ai_forward(4);monster_check_gib(); +self.solid = SOLID_NOT;}; +void() mino_death4 = [ $death7, mino_death5 ] {ai_forward(8);}; +void() mino_death5 = [ $death9, mino_death6 ] {ai_forward(10);}; +void() mino_death6 = [ $death11, mino_death7 ] {ai_forward(11);}; +void() mino_death7 = [ $death13, mino_death8 ] {ai_forward(11);}; +void() mino_death8 = [ $death15, mino_death9 ] {ai_forward(10);}; +void() mino_death9 = [ $death17, mino_death10 ] {ai_forward(8);}; +void() mino_death10 = [ $death19, mino_death11 ] {ai_forward(4);}; +void() mino_death11 = [ $death21, mino_death12 ] {ai_forward(7);}; +void() mino_death12 = [ $death23, mino_death13 ] {ai_forward(4);}; +void() mino_death13 = [ $death25, mino_death14 ] {monster_death_postcheck();}; +void() mino_death14 = [ $death25, mino_death14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() mino_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + minotaur_remove_attachment(); + //delete_minionspace(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "minotaur/death.wav", 1, ATTN_NORM); + mino_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_minotaur (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_minotaur = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_minotaur.mdl"; + self.headmdl = "progs/ad171/h_minotaur.mdl"; // Large head + self.gib1mdl = "progs/ad171/gib_minoclaw1.mdl"; // Left claw + self.gib2mdl = "progs/ad171/gib_minoclaw2.mdl"; // Right claw + self.gib3mdl = "progs/ad171/gib_minoleg1.mdl"; // foot + self.gib4mdl = "progs/ad171/gib_minoleg2.mdl"; // foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_MBALL); // Creating attachment + precache_model (MODEL_PROJ_MPLASMA); // Plasma bolt + precache_model (MODEL_PROJ_MPOISON); // Poison bolt + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // Randomly swap claws and legs around + self.lip = random(); + if (self.lip < 0.25) self.gib1mdl = self.gib4mdl; + else if (self.lip < 0.5) self.gib2mdl = self.gib4mdl; + else if (self.lip < 0.75) self.gib3mdl = self.gib4mdl; + + self.idle_sound = "minotaur/idle1.wav"; + self.idle_sound2 = "minotaur/idle2.wav"; + self.idle_soundcom = "minotaur/idle1com.wav"; + self.idle_soundcom2 = "minotaur/idle2com.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + precache_sound ("minotaur/swipe.wav"); // claw misses + precache_sound ("minotaur/strike1.wav"); // claw hit1 + precache_sound ("minotaur/strike2.wav"); // claw hit2 + + precache_sound ("minotaur/attack1start.wav"); // Short roar + precache_sound ("minotaur/attack1end.wav"); // Short roar + precache_sound ("minotaur/attack1long.wav"); // Enter rage mode + precache_sound ("minotaur/bolt_fire.wav"); // fire projectile + precache_sound (SOUND_PLASMA_HIT); // impact sounds + + precache_sound ("minotaur/death.wav"); + self.pain_sound = "minotaur/pain1.wav"; + self.pain_sound2 = "minotaur/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.sight_sound = "minotaur/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) self.health = 500; + self.gibhealth = -60; // Same as Shambler + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 200; // Demon level + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // Does not repeat pain + // Double damage to other monsters + if (!self.infightextra) self.infightextra = 2; + self.steptype = FS_TYPELARGE; // Giant sound + self.blockudeath = TRUE; // No humanoid death + self.part_style = PARTICLE_BURST_BLUE; + if (self.deathstring == "") self.deathstring = " was gored by a Minotaur\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; self.resist_cells = 0.5; + + self.th_checkattack = MinotaurCheckAttack; + self.th_stand = mino_stand1; + self.th_walk = mino_walk1; + self.th_run = mino_run; + self.th_melee = mino_melee; + self.th_missile = mino_magic; + self.th_pain = mino_pain; + self.th_die = mino_die; + self.th_jump = mino_jump1; + self.th_jumpexit = mino_jump10; + self.th_charge = mino_howl1; + + self.classtype = CT_MONMINOTAUR; + self.classgroup = CG_DEMON; + self.classmove = MON_MOVEWALK; + + // Special darker version for gargoyle spawner + // Update all gib models and check/set poison debuff + if (self.spawnflags & MON_MINOTAUR_MINIONS) { + self.exactskin = 1; // Black skin + yellow eyes + if (self.poisonous < 0) self.poisonous = FALSE; // Poison debuff + else self.poisonous = TRUE; + self.gib1skin = self.gib2skin = self.gib3skin = 1; + self.part_style = PARTICLE_BURST_GREEN; + // Reduce minions down to 3, gargoyles are tougher to kill + if (!self.minion_maxcount) self.minion_maxcount = 3; + } + + monster_start(); +}; + +void() monster_shuffler = { + if (self.deathstring == "") self.deathstring = " was gored by a Gauroch\n"; // from Kinn + monster_minotaur(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_morph.qc b/QC_other/QC_keep/mon_morph.qc new file mode 100644 index 00000000..6dfeb234 --- /dev/null +++ b/QC_other/QC_keep/mon_morph.qc @@ -0,0 +1,626 @@ +$skin aztec + +$skin pharoah + +$skin roman + +$skin florskin + +$frame mfstand1 +//$frame mfup01 mfup02 mfup03 mfup04 mfup05 mfup06 +//$frame mfup07 mfup08 mfup09 mfup10 mfup11 mfup12 + +$frame start01 start02 start03 start04 start05 start06 +$frame start07 start08 start09 start10 start11 start12 +$frame start13 start14 start15 start16 start17 start18 + +$frame start19 start20 start21 start22 start23 start24 + +$frame start25 start26 start27 start28 start29 start30 start31 + +$frame mfrun01 mfrun02 mfrun03 mfrun04 mfrun05 mfrun06 +$frame mfrun07 mfrun08 mfrun09 mfrun10 mfrun11 +$frame mfwlk01 mfwlk02 mfwlk03 mfwlk04 mfwlk05 mfwlk06 mfwlk07 mfwlk08 +$frame mfwlk09 mfwlk10 mfwlk11 mfwlk12 mfwlk13 + +$frame mfata01 mfata02 mfata03 mfata04 mfata05 +$frame mfata06 mfata07 mfata08 mfata09 + +$frame mfatb01 mfatb02 mfatb03 mfatb04 mfatb05 mfatb06 + +$frame mfatb07 mfatb08 mfatb09 mfatb10 mfatb11 + +$frame mfatc01 mfatc02 mfatc03 mfatc04 mfatc05 mfatc06 + +$frame mfatc07 mfatc08 mfatc09 mfatc10 mfatc11 mfatc12 +$frame mfatc13 mfatc14 mfatc15 mfatc16 + +$frame mfknck01 mfknck02 mfknck03 mfknck04 mfknck05 mfknck06 +$frame mfknck07 mfknck08 mfknck09 mfknck10 mfknck11 mfknck12 + +$frame mfpain01 mfpain02 mfpain03 mfpain04 mfpain05 +$frame mfpain06 mfpain07 mfpain08 mfpain09 mfpain10 +$frame mfpbin01 mfpbin02 mfpbin03 mfpbin04 mfpbin05 +$frame mfpbin06 mfpbin07 +$frame mfdth01 mfdth02 mfdth03 mfdth04 mfdth05 +$frame mfdth06 mfdth07 mfdth08 mfdth09 mfdth10 +$frame mfdth11 mfdth12 mfdth13 mfdth14 mfdth15 +$frame mfdth16 mfdth17 mfdth18 mfdth19 mfdth20 +$frame mfdth21 + +float MORPH_AZTEC = 2; + +float MORPH_EGYPT = 4; + +float MORPH_GREEK = 8; + + +void() morph_minionspawn; + +void() morph_use; +void() morph_phased; + +entity () morph_find_dest = { + local entity furthestDest; + local entity bestDest; + local entity curDest; + local entity thePlayer; + local float theDist; + local float curDist; + local float dot; + local vector curVector; + + furthestDest = world; + bestDest = world; + theDist = FALSE; + thePlayer = find (world,classname,"player"); + curDest = world; + makevectors (thePlayer.angles); + while ( TRUE ) { + curDest = find (curDest,classname,"info_morph_destination"); + if ( (curDest == world) ) { + if ( (bestDest != world) ) + return ( bestDest ); + + return ( furthestDest ); + } + if ( isSpawnPointEmpty (curDest) ) { + curVector = (curDest.origin - thePlayer.origin); + curDist = vlen (curVector); + curVector = normalize (curVector); + dot = (curVector * v_forward); + if ( (dot > 0.600) ) { + if ( (curDist > 150.000) ) + bestDest = curDest; + } + if ( (curDist > theDist) ) { + furthestDest = curDest; + theDist = curDist; + } + } + } + return ( world ); +}; + +void() morph_stand1 = [ $mfstand1, morph_stand1 ] { ai_stand(); }; + + +void() morph_walk1 = [ $mfwlk01, morph_walk2 ] { ai_walk(3); }; +void() morph_walk2 = [ $mfwlk02, morph_walk3 ] { ai_walk(2); }; +void() morph_walk3 = [ $mfwlk03, morph_walk4 ] { ai_walk(4); }; +void() morph_walk4 = [ $mfwlk04, morph_walk5 ] { ai_walk(5); }; +void() morph_walk5 = [ $mfwlk05, morph_walk6 ] { ai_walk(5); }; +void() morph_walk6 = [ $mfwlk06, morph_walk7 ] { ai_walk(4); }; + +void() morph_walk7 = [ $mfwlk07, morph_walk8 ] { ai_walk(2); }; +void() morph_walk8 = [ $mfwlk08, morph_walk9 ] { ai_walk(3); }; +void() morph_walk9 = [ $mfwlk09, morph_walk10 ] { ai_walk(4); }; +void() morph_walk10 = [ $mfwlk10, morph_walk11 ] { ai_walk(5); }; +void() morph_walk11 = [ $mfwlk11, morph_walk12 ] { ai_walk(5); }; +void() morph_walk12 = [ $mfwlk12, morph_walk13 ] { ai_walk(4); }; +void() morph_walk13 = [ $mfwlk13, morph_walk1 ] { ai_walk(3); }; + +void() morph_run1 = [ $mfrun01, morph_run2 ] { ai_run( 7); }; +void() morph_run2 = [ $mfrun02, morph_run3 ] { ai_run(11); }; +void() morph_run3 = [ $mfrun03, morph_run4 ] { ai_run(16); }; +void() morph_run4 = [ $mfrun04, morph_run5 ] { ai_run(16); }; +void() morph_run5 = [ $mfrun05, morph_run6 ] { ai_run(11); }; +void() morph_run6 = [ $mfrun06, morph_run7 ] { ai_run( 7); }; + +void() morph_run7 = [ $mfrun07, morph_run8 ] { ai_run(11); }; +void() morph_run8 = [ $mfrun08, morph_run9 ] { ai_run(15); }; + +void() morph_run9 = [ $mfrun09, morph_run10 ] { ai_run(19); }; +void() morph_run10 =[ $mfrun10, morph_run11 ] { ai_run(15); }; + +void() morph_run11 =[ $mfrun11, morph_run1 ] { ai_run(11); }; + +void() morph_stab2 = { + local float dist; + local float attackDamage; + local vector org, dir; + + +if (!self.enemy) return; + if (!CanDamage (self.enemy, self)) return; + + ai_face(); + dir = self.enemy.origin - self.origin + self.enemy.view_ofs; + dist = vlen ( dir ); + dir = normalize ( dir ); + makevectors (self.angles); + + if ( dist <= 90 ) { + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + attackDamage = (random() * 10) + 20; + T_Damage (self.enemy, self, self, attackDamage,DAMARMOR); + SpawnBlood (self.enemy, self.enemy.origin, v_forward * 150, 14); + } else { + self.effects = self.effects | EF_MUZZLEFLASH; + org = self.origin + v_forward * 80 + v_right * 4 + '0 0 4'; + launch_projectile(org, dir, CT_PROJ_LASER, SPEED_LASER); + if ( dist ) { + launch_projectile(org, (dir + v_right * 0.04), CT_PROJ_LASER, SPEED_LASER); + launch_projectile(org, (dir + v_right * 0.04), CT_PROJ_LASER, SPEED_LASER); + + } else { + launch_projectile(org, (dir + v_right * 0.10), CT_PROJ_LASER, SPEED_LASER); + launch_projectile(org, (dir + v_right * 0.10), CT_PROJ_LASER, SPEED_LASER); + } + + } +}; + + +void() morph_attack01 = [ $mfatb01, morph_attack02 ] {ai_face();}; +void() morph_attack02 = [ $mfatb02, morph_attack03 ] {ai_face();}; +void() morph_attack03 = [ $mfatb03, morph_attack04 ] {ai_face();}; +void() morph_attack04 = [ $mfatb04, morph_attack05 ] {ai_face();}; +void() morph_attack05 = [ $mfatb05, morph_attack06 ] {ai_face();}; +void() morph_attack06 = [ $mfatb06, morph_attack07 ] {ai_face();}; +void() morph_attack07 = [ $mfatb07, morph_attack08 ] {morph_stab2();}; +void() morph_attack08 = [ $mfatb08, morph_attack09 ] {ai_face();}; +void() morph_attack09 = [ $mfatb09, morph_attack10 ] {ai_face();}; +void() morph_attack10 = [ $mfatb10, morph_attack11 ] {ai_face();}; +void() morph_attack11 = [ $mfatb11, morph_attack12 ] {ai_face();}; +void() morph_attack12 = [ $mfatb01, morph_run1 ] {ai_face();}; + +void() morph_bigattack01 = [ $mfatc01, morph_bigattack02 ] { ai_face(); }; +void() morph_bigattack02 = [ $mfatc02, morph_bigattack03 ] { ai_face(); }; + +void() morph_bigattack03 = [ $mfatc03, morph_bigattack04 ] { ai_face(); }; + +void() morph_bigattack04 = [ $mfatc04, morph_bigattack05 ] { ai_face(); }; + +void() morph_bigattack05 = [ $mfatc05, morph_bigattack06 ] { ai_face(); }; + +void() morph_bigattack06 = [ $mfatc06, morph_bigattack07 ] { ai_face(); }; +void() morph_bigattack07 = [ $mfatc07, morph_bigattack08 ] { ai_face(); }; + +void() morph_bigattack08 = [ $mfatc08, morph_bigattack09 ] { ai_face(); }; +void() morph_bigattack09 = [ $mfatc09, morph_bigattack10 ] { ai_face(); }; + +void() morph_bigattack10 = [ $mfatc10, morph_bigattack11 ] { morph_stab2(); }; +void() morph_bigattack11 = [ $mfatc11, morph_bigattack12 ] { ai_face(); }; +void() morph_bigattack12 = [ $mfatc12, morph_bigattack13 ] { ai_face(); }; + +void() morph_bigattack13 = [ $mfatc13, morph_bigattack14 ] { ai_face(); }; + +void() morph_bigattack14 = [ $mfatc14, morph_bigattack15 ] { ai_face(); }; + +void() morph_bigattack15 = [ $mfatc15, morph_bigattack16 ] { ai_face(); }; + +void() morph_bigattack16 = [ $mfatc16, morph_bigattack17 ] { ai_face(); }; + +void() morph_bigattack17 = [ $mfatc01, morph_run1 ] { ai_face(); }; + + + +void() morph_smack = { + local vector delta; + local float ldmg; + + if (!self.enemy) return; + if (!CanDamage (self.enemy, self)) return; + + ai_face(); + delta = self.enemy.origin - self.origin; + if (vlen(delta) > 100) return; + + ldmg = (random() * 10) + 10; + T_Damage (self.enemy, self, self, ldmg,DAMARMOR); + + makevectors (self.angles); + + self.enemy.velocity = v_forward * 100 + '0 0 100'; +}; + + + +void() morph_knockback01 = [ $mfknck01, morph_knockback02 ] { ai_face(); }; + +void() morph_knockback02 = [ $mfknck02, morph_knockback03 ] { ai_face(); }; + +void() morph_knockback03 = [ $mfknck03, morph_knockback04 ] { ai_face(); }; + +void() morph_knockback04 = [ $mfknck04, morph_knockback05 ] { ai_face(); }; + +void() morph_knockback05 = [ $mfknck05, morph_knockback06 ] { ai_face(); }; + +void() morph_knockback06 = [ $mfknck06, morph_knockback07 ] { ai_face(); }; + +void() morph_knockback07 = [ $mfknck07, morph_knockback08 ] { ai_face(); }; + +void() morph_knockback08 = [ $mfknck08, morph_knockback09 ] { ai_face(); }; + +void() morph_knockback09 = [ $mfknck09, morph_knockback10 ] { morph_smack(); }; + +void() morph_knockback10 = [ $mfknck10, morph_knockback11 ] { ai_face(); }; + +void() morph_knockback11 = [ $mfknck11, morph_knockback12 ] { ai_face(); }; + +void() morph_knockback12 = [ $mfknck12, morph_run1 ] { ai_face(); }; + + + +void() morph_attack = +{ + + local float attackChoice; + + + +attackChoice = random(); + + +if (attackChoice < 0.50) + + morph_bigattack01(); + else if (attackChoice < 0.75) + + morph_attack01(); + + else + + morph_knockback01(); + +}; + + + +void() morph_fire = { + local vector org, dir; + + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + makevectors (self.angles); + org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16'; + dir = normalize ( self.enemy.origin - self.origin ) ; + launch_projectile(org, dir, CT_PROJ_LASER, SPEED_LASER); + if ( vlen (self.enemy.origin - self.origin) > 400 ) { + launch_projectile(org, (dir + v_right * 0.04), CT_PROJ_LASER, SPEED_LASER); + launch_projectile(org, (dir + v_right * 0.04), CT_PROJ_LASER, SPEED_LASER); + + } else { + launch_projectile(org, (dir + v_right * 0.10), CT_PROJ_LASER, SPEED_LASER); + launch_projectile(org, (dir + v_right * 0.10), CT_PROJ_LASER, SPEED_LASER); + } + +}; + +void() morph_fire1 = [ $mfata01, morph_fire2 ] {ai_face();}; +void() morph_fire2 = [ $mfata02, morph_fire3 ] {ai_face();}; +void() morph_fire3 = [ $mfata03, morph_fire4 ] {ai_face();}; +void() morph_fire4 = [ $mfata04, morph_fire5 ] {morph_fire();}; +void() morph_fire5 = [ $mfata05, morph_fire6 ] {ai_face();}; +void() morph_fire6 = [ $mfata06, morph_fire7 ] {ai_face();}; +void() morph_fire7 = [ $mfata07, morph_fire8 ] {ai_face();}; +void() morph_fire8 = [ $mfata08, morph_fire9] {ai_face();}; +void() morph_fire9 = [ $mfata09, morph_run1 ] {ai_face();}; + +void() morph_painA1 = [ $mfpain01, morph_painA2 ] {}; +void() morph_painA2 = [ $mfpain02, morph_painA3 ] {}; +void() morph_painA3 = [ $mfpain03, morph_painA4 ] {}; +void() morph_painA4 = [ $mfpain04, morph_painA5 ] {}; +void() morph_painA5 = [ $mfpain05, morph_painA6 ] {}; +void() morph_painA6 = [ $mfpain06, morph_painA7 ] {}; +void() morph_painA7 = [ $mfpain07, morph_painA8 ] {}; +void() morph_painA8 = [ $mfpain08, morph_painA9 ] {}; +void() morph_painA9 = [ $mfpain09, morph_painA10 ] {}; +void() morph_painA10 = [ $mfpain10, morph_run1 ] { morph_minionspawn(); }; + + +void() morph_painB1 = [ $mfpbin01, morph_painB2 ] {}; +void() morph_painB2 = [ $mfpbin02, morph_painB3 ] {}; +void() morph_painB3 = [ $mfpbin03, morph_painB4 ] {}; +void() morph_painB4 = [ $mfpbin04, morph_painB5 ] {}; +void() morph_painB5 = [ $mfpbin05, morph_painB6 ] {}; +void() morph_painB6 = [ $mfpbin06, morph_painB7 ] {}; +void() morph_painB7 = [ $mfpbin07, morph_run1 ] { morph_minionspawn(); }; + + +void(entity inflictor, entity attacker, float damage) morph_pain = { + + local float painChoice; + + + if (random() > 0.1) { + morph_minionspawn(); + return; + } + + + +if (self.pain_finished > time) return; + + if (random() > 0.25) + return; + + + painChoice = random(); + self.pain_finished = time + 2; + sound (self, CHAN_VOICE, "guard/pain1.wav", 1, ATTN_NORM ); + + if ( painChoice > 0.6) + self.think = morph_painB1; + + else + self.think = morph_painA1; + + + self.nextthink = time + 0.1; + +}; + + + +void() morph_die1 = [ $mfdth01, morph_die2 ] {}; +void() morph_die2 = [ $mfdth02, morph_die3 ] {}; +void() morph_die3 = [ $mfdth03, morph_die4 ] {}; +void() morph_die4 = [ $mfdth04, morph_die5 ] {}; +void() morph_die5 = [ $mfdth05, morph_die6 ] {}; +void() morph_die6 = [ $mfdth06, morph_die7 ] {}; +void() morph_die7 = [ $mfdth07, morph_die8 ] {}; +void() morph_die8 = [ $mfdth08, morph_die9 ] {}; +void() morph_die9 = [ $mfdth09, morph_die10 ] { self.skin = self.skin + 1; }; + +void() morph_die10 = [ $mfdth10, morph_die11 ] {}; + +void() morph_die11 = [ $mfdth11, morph_die12 ] {}; +void() morph_die12 = [ $mfdth12, morph_die13 ] {}; +void() morph_die13 = [ $mfdth13, morph_die14 ] {}; +void() morph_die14 = [ $mfdth14, morph_die15 ] {}; + +void() morph_die15 = [ $mfdth15, morph_die16 ] {}; + +void() morph_die16 = [ $mfdth16, morph_die17 ] {}; + +void() morph_die17 = [ $mfdth17, morph_die18 ] {}; +void() morph_die18 = [ $mfdth18, morph_die19 ] {}; +void() morph_die19 = [ $mfdth19, morph_die20 ] {}; + +void() morph_die20 = [ $mfdth20, morph_die21 ] {}; + +void() morph_die21 = [ $mfdth21, morph_die21 ] { remove(self); }; + +void() morph_die = { + sound ( self, CHAN_VOICE, "guard/death.wav", 1, ATTN_NORM); + + self.solid = SOLID_NOT; + self.think = morph_die1; + self.nextthink = time + 0.1; +}; + + + + +void() morph_wake1 = [ $start01, morph_wake2 ] { sound ( self, CHAN_VOICE, "guard/see1.wav", 1, ATTN_NORM ); + }; +void() morph_wake2 = [ $start02, morph_wake3 ] {}; +void() morph_wake3 = [ $start03, morph_wake4 ] {}; +void() morph_wake4 = [ $start04, morph_wake5 ] {}; +void() morph_wake5 = [ $start05, morph_wake6 ] {}; +void() morph_wake6 = [ $start06, morph_wake7 ] {}; +void() morph_wake7 = [ $start07, morph_wake8 ] {}; +void() morph_wake8 = [ $start08, morph_wake9 ] {}; +void() morph_wake9 = [ $start09, morph_wake10 ] {}; +void() morph_wake10 = [ $start10, morph_wake11 ] {}; +void() morph_wake11 = [ $start11, morph_wake12 ] {}; +void() morph_wake12 = [ $start12, morph_wake13 ] {}; +void() morph_wake13 = [ $start13, morph_wake14 ] {}; +void() morph_wake14 = [ $start14, morph_wake15 ] {}; +void() morph_wake15 = [ $start15, morph_wake16 ] { self.skin = 1; }; +void() morph_wake16 = [ $start16, morph_wake17 ] {}; +void() morph_wake17 = [ $start17, morph_wake18 ] {}; +void() morph_wake18 = [ $start18, morph_wake20 ] {}; +//void() morph_wake18 = [ $start18, morph_wake19 ] {}; +//void() morph_wake19 = [ $start19, morph_wake20 ] {}; +void() morph_wake20 = [ $start20, morph_wake21 ] {}; +void() morph_wake21 = [ $start21, morph_wake22 ] {}; +void() morph_wake22 = [ $start22, morph_wake23 ] {}; +void() morph_wake23 = [ $start23, morph_wake24 ] {}; +void() morph_wake24 = [ $start24, morph_wake25 ] {}; +void() morph_wake25 = [ $start25, morph_wake26 ] {}; +void() morph_wake26 = [ $start26, morph_wake27 ] {}; +void() morph_wake27 = [ $start27, morph_wake28 ] {}; +void() morph_wake28 = [ $start28, morph_wake29 ] {}; +void() morph_wake29 = [ $start29, morph_wake30 ] {}; +void() morph_wake30 = [ $start30, morph_wake31 ] {}; +void() morph_wake31 = [ $start31, morph_stand1 ] { + +self.solid = SOLID_SLIDEBOX; + self.takedamage = DAMAGE_AIM; + self.skin = self.skin - 1; + if ( self.owner ) { + self.enemy = self.owner.enemy; + self.movetarget = self.owner.movetarget; + self.goalentity = self.owner.goalentity; + self.think = morph_run1; + self.nextthink = time + 0.1; + } +}; + + +void() morph_setup = { + + self.classname = "monster_morph"; + if (self.spawnflags & MORPH_AZTEC) { + self.mdl = "progs/rogue/mon_morph_az.mdl"; // Aztec + + } + else if (self.spawnflags & MORPH_EGYPT) { + self.mdl = "progs/rogue/mon_morph_eg.mdl"; // Egyptian + } + else if (self.spawnflags & MORPH_GREEK) + { + self.mdl = "progs/rogue/mon_morph_gr.mdl"; // greek + + } + else + self.mdl = "progs/rogue/mon_morph_eg.mdl"; + // Default to Egyptian + + if (self.owner) + self.mdl = self.owner.mdl; + + self.pain_sound = "guard/pain1.wav"; + self.sight_sound = "guard/see1.wav"; + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + + self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + self.frame = $start01; + self.effects = self.effects | EF_DIMLIGHT; + if (self.health < 1) self.health = 2000; + if ( self.owner ) { + self.effects = 0; + self.health = 200; + self.spawnflags = self.owner.spawnflags; + } + + if (!self.minion_maxcount) self.minion_maxcount = 3; + self.gibhealth = MON_NEVERGIB; // Never gib + self.gibbed = FALSE; // In one piece + self.pain_flinch = 35; + self.steptype = FS_TYPEHEAVY; + self.movespeed = 1; // Can never be a turret + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Morphs have special animation movement sets + // Need extra parameters for their morphing ability + // Can be setup to start "phased" out and surprise the player, morphing up from the ground + self.idlebusy = SKULLW_STAND; + if (self.height == 0) self.height = SKULLW_HEIGHT; + if (self.distmin == 0) self.distmin = SKULLW_DISTMIN; + if (self.distmax == 0) self.distmax = SKULLW_DISTMAX; + if (!self.bodyphased) self.bodyphased = MONAI_SKULLWSOLID; + else self.bodyphased = MONAI_SKULLWINVIS; + + self.th_pain = morph_pain; + self.th_die = morph_die; + if (self.targetname) self.use = morph_use; + + // Does the morph start "phased" out? + // Need to intercept idle/combat functions + if (self.bodyphased == MONAI_SKULLWINVIS) { + self.takedamage = DAMAGE_NO; // Can't hurt it when morphing + self.skin = 2; + + self.th_stand = morph_phased; + self.th_walk = morph_phased; + self.th_run = morph_wake1; + self.th_missile = morph_wake1; + self.th_melee = morph_wake1; + } else { + self.takedamage = DAMAGE_AIM; + self.skin = 0; + self.th_stand = morph_stand1; + self.th_walk = morph_walk1; + self.th_run = morph_run1; + self.th_missile = morph_fire1; + self.th_melee = morph_attack; + } + + self.classtype = CT_MONMORPH; + self.classgroup = CG_BOSS; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was crushed by a Guardian\n"; + + monster_start(); +}; + + +void() morph_use = { + self.enemy = activator; + if ( self.delay ) { + self.think = morph_wake1; + self.nextthink = time + self.delay; + } else { + self.think = morph_wake1; + self.nextthink = time + 0.1; + } +}; + + +void() morph_minionspawn = { + + local entity theDest; + local entity theChild; + + + if (self.owner) return; + + if (self.childrenSpawned > self.minion_maxcount) return; + + +theDest = morph_find_dest(); + if (theDest == world) return; + + + theChild = spawn(); + theChild.model = self.model; + theChild.angles = theDest.mangle; + theChild.mangle = theDest.mangle; + theChild.owner = self; + + theChild.enemy = self.enemy; + theChild.movetarget = self.movetarget; + theChild.goalentity = self.goalentity; + setorigin (theChild, theDest.origin); + theChild.think = morph_setup; + theChild.nextthink = time + 0.1 + random()*0.2; +}; + +void() morph_phased = { + self.nextthink = time + 0.1; // Keep looking for player + self.think = morph_phased; // Keep looping + ai_stand(); // Keep looking +}; + +// monster_morph (1 0 0) (-16 -16 -24) (16 16 32) Ambush Aztec Egyptian Greek The morphing monster. +// Select the look of the monster (Aztec,Greek,Egyptian). +void() monster_morph = { + if (deathmatch) { remove(self); return; } + + precache_model ("progs/rogue/mon_morph_gr.mdl"); + precache_model ("progs/rogue/mon_morph_az.mdl"); + precache_model ("progs/rogue/mon_morph_eg.mdl"); + precache_model ("progs/laser.mdl"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("guard/death.wav"); + + precache_sound ("guard/pain1.wav"); + + precache_sound ("guard/see1.wav"); + + + morph_setup(); +}; + +void() info_morph_destination = {}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_mummy.qc b/QC_other/QC_keep/mon_mummy.qc new file mode 100644 index 00000000..ebab684f --- /dev/null +++ b/QC_other/QC_keep/mon_mummy.qc @@ -0,0 +1,411 @@ +void () mummy_stand1 = [ 0.000, mummy_stand2 ] { ai_stand (); }; +void () mummy_stand2 = [ 1.000, mummy_stand3 ] { ai_stand (); }; +void () mummy_stand3 = [ 2.000, mummy_stand4 ] { ai_stand (); }; +void () mummy_stand4 = [ 3.000, mummy_stand5 ] { ai_stand (); }; +void () mummy_stand5 = [ 4.000, mummy_stand6 ] { ai_stand (); }; +void () mummy_stand6 = [ 5.000, mummy_stand7 ] { ai_stand (); }; +void () mummy_stand7 = [ 6.000, mummy_stand8 ] { ai_stand (); }; +void () mummy_stand8 = [ 7.000, mummy_stand9 ] { ai_stand (); }; +void () mummy_stand9 = [ 8.000, mummy_stand10 ] { ai_stand (); }; +void () mummy_stand10 = [ 9.000, mummy_stand11 ] { ai_stand (); }; +void () mummy_stand11 = [ 10.000, mummy_stand12 ] { ai_stand (); }; +void () mummy_stand12 = [ 11.000, mummy_stand13 ] { ai_stand (); }; +void () mummy_stand13 = [ 12.000, mummy_stand14 ] { ai_stand (); }; +void () mummy_stand14 = [ 13.000, mummy_stand15 ] { ai_stand (); }; +void () mummy_stand15 = [ 14.000, mummy_stand1 ] { ai_stand (); }; + +void () mummy_walk1 = [ 15.000, mummy_walk2 ] { ai_walk (0); }; +void () mummy_walk2 = [ 16.000, mummy_walk3 ] { ai_walk (3); }; +void () mummy_walk3 = [ 17.000, mummy_walk4 ] { ai_walk (5); }; +void () mummy_walk4 = [ 18.000, mummy_walk5 ] { ai_walk (4); }; +void () mummy_walk5 = [ 19.000, mummy_walk6 ] { ai_walk (2); }; +void () mummy_walk6 = [ 20.000, mummy_walk7 ] { ai_walk (0); }; +void () mummy_walk7 = [ 21.000, mummy_walk8 ] { ai_walk (0); }; +void () mummy_walk8 = [ 22.000, mummy_walk9 ] { ai_walk (0); }; +void () mummy_walk9 = [ 23.000, mummy_walk10 ] { ai_walk (0); }; +void () mummy_walk10 = [ 24.000, mummy_walk11 ] { ai_walk (0); }; +void () mummy_walk11 = [ 25.000, mummy_walk12 ] { ai_walk (3); }; +void () mummy_walk12 = [ 26.000, mummy_walk13 ] { ai_walk (4); }; +void () mummy_walk13 = [ 27.000, mummy_walk14 ] { ai_walk (2); }; +void () mummy_walk14 = [ 28.000, mummy_walk15 ] { ai_walk (0); }; +void () mummy_walk15 = [ 29.000, mummy_walk16 ] { ai_walk (0); }; +void () mummy_walk16 = [ 30.000, mummy_walk17 ] { ai_walk (0); }; +void () mummy_walk17 = [ 31.000, mummy_walk18 ] { ai_walk (0); }; +void () mummy_walk18 = [ 32.000, mummy_walk19 ] { ai_walk (0); }; +void () mummy_walk19 = [ 33.000, mummy_walk1 ] { + ai_walk (0); + if ( (random () < 0.200) ) + sound (self,CHAN_VOICE,"zombie/z_idle.wav",TRUE,ATTN_IDLE); +}; + +void () mummy_run1 = [ 34.000, mummy_run2 ] { + ai_run (2); + self.inpain = FALSE; +}; +void () mummy_run2 = [ 35.000, mummy_run3 ] { ai_run (2); }; +void () mummy_run3 = [ 36.000, mummy_run4 ] { ai_run (0); }; +void () mummy_run4 = [ 37.000, mummy_run5 ] { ai_run (2); }; +void () mummy_run5 = [ 38.000, mummy_run6 ] { ai_run (4); }; +void () mummy_run6 = [ 39.000, mummy_run7 ] { ai_run (6); }; +void () mummy_run7 = [ 40.000, mummy_run8 ] { ai_run (8); }; +void () mummy_run8 = [ 41.000, mummy_run9 ] { ai_run (8); }; +void () mummy_run9 = [ 42.000, mummy_run10 ] { ai_run (4); }; +void () mummy_run10 = [ 43.000, mummy_run11 ] { ai_run (0); }; +void () mummy_run11 = [ 44.000, mummy_run12 ] { ai_run (0); }; +void () mummy_run12 = [ 45.000, mummy_run13 ] { ai_run (0); }; +void () mummy_run13 = [ 46.000, mummy_run14 ] { ai_run (4); }; +void () mummy_run14 = [ 47.000, mummy_run15 ] { ai_run (8); }; +void () mummy_run15 = [ 48.000, mummy_run16 ] { ai_run (12); }; +void () mummy_run16 = [ 49.000, mummy_run17 ] { ai_run (14); }; +void () mummy_run17 = [ 50.000, mummy_run18 ] { ai_run (6); }; +void () mummy_run18 = [ 51.000, mummy_run1 ] { + ai_run (16); + if ( (random () < 0.200) ) + sound (self,CHAN_VOICE,"zombie/z_idle.wav",TRUE,ATTN_IDLE); + + if ( (random () > 0.800) ) + sound (self,CHAN_VOICE,"zombie/z_idle1.wav",TRUE,ATTN_IDLE); +}; + +void () mummyGrenadeTouch = { + local float mummyDamage; + + if ( (other == self.owner) ) + return; + + if ( other.takedamage ) { + mummyDamage = (15 + (random () * 15)); + T_Damage (other,self,self.owner,mummyDamage,DAMARMOR); + sound (self,CHAN_WEAPON,"zombie/z_hit.wav",TRUE,ATTN_NORM); + remove (self); + return; + } + sound (self,CHAN_WEAPON,"zombie/z_miss.wav",TRUE,ATTN_NORM); + self.velocity = VEC_ORIGIN; + self.avelocity = VEC_ORIGIN; + self.touch = SUB_Remove; +}; + +void (vector st) mummyFireGrenade = { + local entity missile; + local vector org; + + sound (self,CHAN_WEAPON,"zombie/z_shot1.wav",TRUE,ATTN_NORM); + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + org = (((self.origin + (st_x * v_forward)) + (st_y * v_right)) + ((st_z - 24.000) * v_up)); + makevectors (self.angles); + missile.velocity = normalize ((self.enemy.origin - org)); + missile.velocity = (missile.velocity * 600.000); + missile.velocity_z = 200.000; + missile.avelocity = '3000.000 1000.000 2000.000'; + missile.touch = mummyGrenadeTouch; + missile.nextthink = (time + 2.500); + missile.think = SUB_Remove; + setmodel (missile,"progs/zom_gib.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,org); +}; + +void () mummy_atta1 = [ 52.000, mummy_atta2 ] { ai_face (); }; +void () mummy_atta2 = [ 53.000, mummy_atta3 ] { ai_face (); }; +void () mummy_atta3 = [ 54.000, mummy_atta4 ] { ai_face (); }; +void () mummy_atta4 = [ 55.000, mummy_atta5 ] { ai_face (); }; +void () mummy_atta5 = [ 56.000, mummy_atta6 ] { ai_face (); }; +void () mummy_atta6 = [ 57.000, mummy_atta7 ] { ai_face (); }; +void () mummy_atta7 = [ 58.000, mummy_atta8 ] { ai_face (); }; +void () mummy_atta8 = [ 59.000, mummy_atta9 ] { ai_face (); }; +void () mummy_atta9 = [ 60.000, mummy_atta10 ] { ai_face (); }; +void () mummy_atta10 = [ 61.000, mummy_atta11 ] { ai_face (); }; +void () mummy_atta11 = [ 62.000, mummy_atta12 ] { ai_face (); }; +void () mummy_atta12 = [ 63.000, mummy_atta13 ] { ai_face (); }; +void () mummy_atta13 = [ 64.000, mummy_run1 ] { + ai_face (); + mummyFireGrenade ('-10.000 -22.000 30.000'); +}; + +void () mummy_attb1 = [ 65.000, mummy_attb2 ] { ai_face (); }; +void () mummy_attb2 = [ 66.000, mummy_attb3 ] { ai_face (); }; +void () mummy_attb3 = [ 67.000, mummy_attb4 ] { ai_face (); }; +void () mummy_attb4 = [ 68.000, mummy_attb5 ] { ai_face (); }; +void () mummy_attb5 = [ 69.000, mummy_attb6 ] { ai_face (); }; +void () mummy_attb6 = [ 70.000, mummy_attb7 ] { ai_face (); }; +void () mummy_attb7 = [ 71.000, mummy_attb8 ] { ai_face (); }; +void () mummy_attb8 = [ 72.000, mummy_attb9 ] { ai_face (); }; +void () mummy_attb9 = [ 73.000, mummy_attb10 ] { ai_face (); }; +void () mummy_attb10 = [ 74.000, mummy_attb11 ] { ai_face (); }; +void () mummy_attb11 = [ 75.000, mummy_attb12 ] { ai_face (); }; +void () mummy_attb12 = [ 76.000, mummy_attb13 ] { ai_face (); }; +void () mummy_attb13 = [ 77.000, mummy_attb14 ] { ai_face (); }; +void () mummy_attb14 = [ 77.000, mummy_run1 ] { + ai_face (); + mummyFireGrenade ('-10.000 -24.000 29.000'); +}; + +void () mummy_attc1 = [ 79.000, mummy_attc2 ] { ai_face (); }; +void () mummy_attc2 = [ 80.000, mummy_attc3 ] { ai_face (); }; +void () mummy_attc3 = [ 81.000, mummy_attc4 ] { ai_face (); }; +void () mummy_attc4 = [ 82.000, mummy_attc5 ] { ai_face (); }; +void () mummy_attc5 = [ 83.000, mummy_attc6 ] { ai_face (); }; +void () mummy_attc6 = [ 84.000, mummy_attc7 ] { ai_face (); }; +void () mummy_attc7 = [ 85.000, mummy_attc8 ] { ai_face (); }; +void () mummy_attc8 = [ 86.000, mummy_attc9 ] { ai_face (); }; +void () mummy_attc9 = [ 87.000, mummy_attc10 ] { ai_face (); }; +void () mummy_attc10 = [ 88.000, mummy_attc11 ] { ai_face (); }; +void () mummy_attc11 = [ 89.000, mummy_attc12 ] { ai_face (); }; +void () mummy_attc12 = [ 90.000, mummy_run1 ] { + ai_face (); + mummyFireGrenade ('-12.000 -19.000 29.000'); +}; + +void () mummy_missile = { + local float r; + + r = random (); + if ( (r < 0.300) ) { + mummy_atta1 (); + } else { + if ( (r < 0.600) ) { + mummy_attb1 (); + } else { + mummy_attc1 (); + } + } +}; + +void () mummy_paina1 = [ 91.000, mummy_paina2 ] { sound (self,CHAN_VOICE,"zombie/z_pain.wav",TRUE,ATTN_NORM); }; +void () mummy_paina2 = [ 92.000, mummy_paina3 ] { ai_painforward (3); }; +void () mummy_paina3 = [ 93.000, mummy_paina4 ] { ai_painforward (1); }; +void () mummy_paina4 = [ 94.000, mummy_paina5 ] { ai_pain (1); }; +void () mummy_paina5 = [ 95.000, mummy_paina6 ] { ai_pain (3); }; +void () mummy_paina6 = [ 96.000, mummy_paina7 ] { ai_pain (1); }; +void () mummy_paina7 = [ 97.000, mummy_paina8 ] {}; +void () mummy_paina8 = [ 98.000, mummy_paina9 ] {}; +void () mummy_paina9 = [ 99.000, mummy_paina10 ] {}; +void () mummy_paina10 = [ 100.000, mummy_paina11 ] {}; +void () mummy_paina11 = [ 101.000, mummy_paina12 ] {}; +void () mummy_paina12 = [ 102.000, mummy_run1 ] {}; + +void () mummy_painb1 = [ 103.000, mummy_painb2 ] { sound (self,CHAN_VOICE,"zombie/z_pain1.wav",TRUE,ATTN_NORM); }; +void () mummy_painb2 = [ 104.000, mummy_painb3 ] { ai_pain (2); }; +void () mummy_painb3 = [ 105.000, mummy_painb4 ] { ai_pain (8); }; +void () mummy_painb4 = [ 106.000, mummy_painb5 ] { ai_pain (6); }; +void () mummy_painb5 = [ 107.000, mummy_painb6 ] { ai_pain (2); }; +void () mummy_painb6 = [ 108.000, mummy_painb7 ] {}; +void () mummy_painb7 = [ 109.000, mummy_painb8 ] {}; +void () mummy_painb8 = [ 110.000, mummy_painb9 ] {}; +void () mummy_painb9 = [ 111.000, mummy_painb10 ] { sound (self,CHAN_BODY,"zombie/z_fall.wav",TRUE,ATTN_NORM); }; +void () mummy_painb10 = [ 112.000, mummy_painb11 ] {}; +void () mummy_painb11 = [ 113.000, mummy_painb12 ] {}; +void () mummy_painb12 = [ 114.000, mummy_painb13 ] {}; +void () mummy_painb13 = [ 115.000, mummy_painb14 ] {}; +void () mummy_painb14 = [ 116.000, mummy_painb15 ] {}; +void () mummy_painb15 = [ 117.000, mummy_painb16 ] {}; +void () mummy_painb16 = [ 118.000, mummy_painb17 ] {}; +void () mummy_painb17 = [ 119.000, mummy_painb18 ] {}; +void () mummy_painb18 = [ 120.000, mummy_painb19 ] {}; +void () mummy_painb19 = [ 121.000, mummy_painb20 ] {}; +void () mummy_painb20 = [ 122.000, mummy_painb21 ] {}; +void () mummy_painb21 = [ 123.000, mummy_painb22 ] {}; +void () mummy_painb22 = [ 124.000, mummy_painb23 ] {}; +void () mummy_painb23 = [ 125.000, mummy_painb24 ] {}; +void () mummy_painb24 = [ 126.000, mummy_painb25 ] {}; +void () mummy_painb25 = [ 127.000, mummy_painb26 ] { ai_painforward (1); }; +void () mummy_painb26 = [ 128.000, mummy_painb27 ] {}; +void () mummy_painb27 = [ 129.000, mummy_painb28 ] {}; +void () mummy_painb28 = [ 130.000, mummy_run1 ] {}; + +void () mummy_painc1 = [ 131.000, mummy_painc2 ] { sound (self,CHAN_VOICE,"zombie/z_pain1.wav",TRUE,ATTN_NORM); }; +void () mummy_painc2 = [ 132.000, mummy_painc3 ] {}; +void () mummy_painc3 = [ 133.000, mummy_painc4 ] { ai_pain (3); }; +void () mummy_painc4 = [ 134.000, mummy_painc5 ] { ai_pain (1); }; +void () mummy_painc5 = [ 135.000, mummy_painc6 ] {}; +void () mummy_painc6 = [ 136.000, mummy_painc7 ] {}; +void () mummy_painc7 = [ 137.000, mummy_painc8 ] {}; +void () mummy_painc8 = [ 138.000, mummy_painc9 ] {}; +void () mummy_painc9 = [ 139.000, mummy_painc10 ] {}; +void () mummy_painc10 = [ 140.000, mummy_painc11 ] {}; +void () mummy_painc11 = [ 141.000, mummy_painc12 ] { ai_painforward (1); }; +void () mummy_painc12 = [ 142.000, mummy_painc13 ] { ai_painforward (1); }; +void () mummy_painc13 = [ 143.000, mummy_painc14 ] {}; +void () mummy_painc14 = [ 144.000, mummy_painc15 ] {}; +void () mummy_painc15 = [ 145.000, mummy_painc16 ] {}; +void () mummy_painc16 = [ 146.000, mummy_painc17 ] {}; +void () mummy_painc17 = [ 147.000, mummy_painc18 ] {}; +void () mummy_painc18 = [ 148.000, mummy_run1 ] {}; + +void () mummy_paind1 = [ 149.000, mummy_paind2 ] { sound (self,CHAN_VOICE,"zombie/z_pain.wav",TRUE,ATTN_NORM); }; +void () mummy_paind2 = [ 150.000, mummy_paind3 ] {}; +void () mummy_paind3 = [ 151.000, mummy_paind4 ] {}; +void () mummy_paind4 = [ 152.000, mummy_paind5 ] {}; +void () mummy_paind5 = [ 153.000, mummy_paind6 ] {}; +void () mummy_paind6 = [ 154.000, mummy_paind7 ] {}; +void () mummy_paind7 = [ 155.000, mummy_paind8 ] {}; +void () mummy_paind8 = [ 156.000, mummy_paind9 ] {}; +void () mummy_paind9 = [ 157.000, mummy_paind10 ] { ai_pain (1); }; +void () mummy_paind10 = [ 158.000, mummy_paind11 ] {}; +void () mummy_paind11 = [ 159.000, mummy_paind12 ] {}; +void () mummy_paind12 = [ 160.000, mummy_paind13 ] {}; +void () mummy_paind13 = [ 161.000, mummy_run1 ] {}; + +void () mummy_paine1 = [ 162.000, mummy_paine2 ] { sound (self,CHAN_VOICE,"zombie/z_pain.wav",TRUE,ATTN_NORM); }; +void () mummy_paine2 = [ 163.000, mummy_paine3 ] { ai_pain (8); }; +void () mummy_paine3 = [ 164.000, mummy_paine4 ] { ai_pain (5); }; +void () mummy_paine4 = [ 165.000, mummy_paine5 ] { ai_pain (3); }; +void () mummy_paine5 = [ 166.000, mummy_paine6 ] { ai_pain (1); }; +void () mummy_paine6 = [ 167.000, mummy_paine7 ] { ai_pain (2); }; +void () mummy_paine7 = [ 168.000, mummy_paine8 ] { ai_pain (1); }; +void () mummy_paine8 = [ 169.000, mummy_paine9 ] { ai_pain (1); }; +void () mummy_paine9 = [ 170.000, mummy_paine10 ] { ai_pain (2); }; +void () mummy_paine10 = [ 171.000, mummy_paine11 ] { + sound (self,CHAN_BODY,"zombie/z_fall.wav",TRUE,ATTN_NORM); + self.solid = SOLID_NOT; +}; +void () mummy_paine11 = [ 172.000, mummy_paine12 ] { self.nextthink = (self.nextthink + 5); }; +void () mummy_paine12 = [ 173.000, mummy_paine13 ] { + sound (self,CHAN_VOICE,"zombie/z_idle.wav",TRUE,ATTN_IDLE); + setsize (self,VEC_HULL_MIN,VEC_HULL_MAX); + self.solid = SOLID_SLIDEBOX; + if ( !walkmove (FALSE,FALSE) ) { + self.think = mummy_paine11; + self.solid = SOLID_NOT; + return ; + } +}; +void () mummy_paine13 = [ 174.000, mummy_paine14 ] {}; +void () mummy_paine14 = [ 175.000, mummy_paine15 ] {}; +void () mummy_paine15 = [ 176.000, mummy_paine16 ] {}; +void () mummy_paine16 = [ 177.000, mummy_paine17 ] {}; +void () mummy_paine17 = [ 178.000, mummy_paine18 ] {}; +void () mummy_paine18 = [ 179.000, mummy_paine19 ] {}; +void () mummy_paine19 = [ 180.000, mummy_paine20 ] {}; +void () mummy_paine20 = [ 181.000, mummy_paine21 ] {}; +void () mummy_paine21 = [ 182.000, mummy_paine22 ] {}; +void () mummy_paine22 = [ 183.000, mummy_paine23 ] {}; +void () mummy_paine23 = [ 184.000, mummy_paine24 ] {}; +void () mummy_paine24 = [ 185.000, mummy_paine25 ] {}; +void () mummy_paine25 = [ 186.000, mummy_paine26 ] { ai_painforward (5); }; +void () mummy_paine26 = [ 187.000, mummy_paine27 ] { ai_painforward (3); }; +void () mummy_paine27 = [ 188.000, mummy_paine28 ] { ai_painforward (1); }; +void () mummy_paine28 = [ 189.000, mummy_paine29 ] { ai_pain (1); }; +void () mummy_paine29 = [ 190.000, mummy_paine30 ] {}; +void () mummy_paine30 = [ 191.000, mummy_run1 ] {}; + +void () mummy_die = { + self.health = -35.000; + sound (self,CHAN_VOICE,"zombie/z_gib.wav",TRUE,ATTN_NORM); + ThrowHead(); + ThrowGib (1,2); + ThrowGib (2,2); + ThrowGib (3,2); + self.gibbed = TRUE; +}; + +void (entity inflictor, entity attacker, float take) mummy_pain = { + local float r; + + if ( (self.pain_finished > time) ) + return ; + + r = random (); + if ( (r > 0.240) ) + return ; + + self.pain_finished = (time + 2.500); + if ( (r < 0.060) ) { + mummy_paina1 (); + } else { + if ( (r < 0.120) ) { + mummy_painb1 (); + } else { + if ( (r < 0.180) ) { + mummy_painc1 (); + } else { + mummy_paind1 (); + } + } + } +}; + +void () mummy_sleep = [ 172.000, mummy_sleep ] { ai_stand (); }; + +void () mummy_wake = { + self.th_stand = mummy_stand1; + self.th_walk = mummy_walk1; + self.th_pain = mummy_pain; + self.th_run = mummy_run1; + self.th_missile = mummy_missile; + mummy_paine12 (); +}; + +void (entity inflictor, entity attacker, float damage) mummy_wake_pain = { mummy_wake (); }; + +float MUMMY_STRONG = 4.000; + +void () monster_mummy = { + if ( deathmatch ) { remove (self); return; } + + self.mdl = "progs/rogue/mon_mummy.mdl"; + precache_model (self.mdl); + self.headmdl = "progs/h_zombie.mdl"; + precache_model (self.headmdl); + precache_model ("progs/zom_gib.mdl"); + precache_sound ("zombie/z_idle.wav"); + precache_sound ("zombie/z_idle1.wav"); + precache_sound ("zombie/z_shot1.wav"); + precache_sound ("zombie/z_gib.wav"); + precache_sound ("zombie/z_pain.wav"); + precache_sound ("zombie/z_pain1.wav"); + precache_sound ("zombie/z_fall.wav"); + precache_sound ("zombie/z_miss.wav"); + precache_sound ("zombie/z_hit.wav"); + precache_sound ("zombie/idle_w2.wav"); + + self.pain_sound = "zombie/z_pain.wav"; + self.pain_sound2 = "zombie/z_pain1.wav"; + self.sight_sound = "zombie/z_idle.wav"; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.bboxtype = BBOX_SHORT; + if ( (self.spawnflags & MUMMY_STRONG) ) { + if (self.health < 1) self.health = 1000.000; + } else { + if (self.health < 1) self.health = 500.000; + } + self.gibhealth = -60; + self.gibbed = FALSE; + self.pain_flinch = MONAI_ZOMBIEHGH_DAM; + self.steptype = FS_TYPEDRAG; + self.altsteptype = FS_TYPEDRAG; + self.pain_timeout = -5; + self.inpain = 0; + self.count = 0; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = mummy_stand1; + self.th_walk = mummy_walk1; + self.th_run = mummy_run1; + self.th_pain = mummy_pain; + self.th_die = mummy_die; + self.th_missile = mummy_missile; + self.classtype = CT_MONMUMMY; + self.classgroup = CG_ZOMBIE; + self.classmove = MON_MOVEWALK; + if ( (self.spawnflags & 4) ) { + setsize (self,VEC_HULL_MIN,'16.000 16.000 -16.000'); + self.solid = SOLID_NOT; + self.th_stand = mummy_sleep; + self.th_run = mummy_wake; + self.th_walk = mummy_wake; + self.th_pain = mummy_wake_pain; + self.th_missile = mummy_wake; + } + + if (self.deathstring == "") self.deathstring = " was mummified by a Mummy\n"; + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_necro.qc b/QC_other/QC_keep/mon_necro.qc new file mode 100644 index 00000000..f0bd1490 --- /dev/null +++ b/QC_other/QC_keep/mon_necro.qc @@ -0,0 +1,1297 @@ +/* +============================================================================== + +NECROMANCER + +============================================================================== +*/ + +$cd id1/models/necro +$origin 0 0 24 +$base base +$skin skin + +$frame deathA1 deathA2 deathA3 deathA4 deathA5 deathA6 deathA7 deathA8 +$frame deathA9 deathA10 deathA11 deathA12 deathA13 deathA14 deathA15 +$frame deathA16 deathA17 deathA18 deathA19 deathA20 + +$frame decap1 decap2 decap3 decap4 decap5 decap6 decap7 decap8 decap9 decap10 +$frame decap11 decap12 decap13 decap14 decap15 decap16 decap17 decap18 +$frame decap19 decap20 + +$frame Hatak1 Hatak2 Hatak3 Hatak4 Hatak5 Hatak6 Hatak7 Hatak8 + +$frame Hpain1 Hpain2 Hpain3 Hpain4 Hpain5 Hpain6 Hpain7 Hpain8 + +$frame Hrun1 Hrun2 Hrun3 Hrun4 Hrun5 Hrun6 Hrun7 Hrun8 Hrun9 Hrun10 +$frame Hrun11 Hrun12 + +$frame Hwait1 Hwait2 Hwait3 Hwait4 Hwait5 Hwait6 Hwait7 Hwait8 Hwait9 Hwait10 +$frame Hwait11 Hwait12 + +$frame Siatak1 Siatak2 Siatak3 Siatak4 Siatak5 Siatak6 Siatak7 Siatak8 +$frame Siatak9 Siatak10 Siatak11 Siatak12 + +$frame Sipain1 Sipain2 Sipain3 Sipain4 Sipain5 Sipain6 Sipain7 Sipain8 + +$frame Sirun1 Sirun2 Sirun3 Sirun4 Sirun5 Sirun6 Sirun7 Sirun8 Sirun9 Sirun10 +$frame Sirun11 Sirun12 + +$frame Siwait1 Siwait2 Siwait3 Siwait4 Siwait5 Siwait6 Siwait7 Siwait8 +$frame Siwait9 Siwait10 Siwait11 Siwait12 + +$frame Statak1 Statak2 Statak3 Statak4 Statak5 Statak6 Statak7 Statak8 + +$frame Stpain1 Stpain2 Stpain3 Stpain4 Stpain5 Stpain6 Stpain7 Stpain8 + +$frame Strun1 Strun2 Strun3 Strun4 Strun5 Strun6 Strun7 Strun8 Strun9 Strun10 +$frame Strun11 Strun12 + +$frame Stwait1 Stwait2 Stwait3 Stwait4 Stwait5 Stwait6 Stwait7 Stwait8 +$frame Stwait9 Stwait10 Stwait11 Stwait12 + +//============================================================================= + +// Used by self.height. +float NECRO_ACOLYTE = 1; +float NECRO_SORCERER = 2; +float NECRO_WARLOCK = 3; + +// Used by self.worldtype. NSA = Necro Special Attack. +float NSA_CURSE = 1; +float NSA_CORPSE_EXPLOSION = 2; +float NSA_SUMMON_GOLEM = 3; +float NSA_SUMMON_IMPS = 4; + +float NECRO_MAX_IMPS = 5; // Maximum imps. + +float CORPSE_EXPLOSION_RADIUS = 200; + +void() necro_activate_special; + +float() necro_boss = {return (self.classname == "monster_necromancer");}; + +//============================================================================= + +// Alternate thinking for necrobolts. Used by necromancer boss. +void() NecroBolt_Summon = +{ + if (self.delay <= time) + if (self.master.flags & FLx_CREATURE) + if (self.enemy) + if (visible (self.enemy)) + { + if (count_petclass(self.master, "monster_imp") < NECRO_MAX_IMPS) + { + if (SpawnMonster_Point (self.master, self.origin, ID_IMP_KINN)) + { + remove (self); + return; + } + } + } + NecroBolt_Think (); +}; + +void() acolyte_fire = +{ + local vector org, dir; + + makevectors (self.angles); + org = self.origin + v_forward*14 - v_right*8 + v_up*12; // '14 -2 19' + dir = normalize (self.enemy.origin - self.origin); + NecroSnake_Launch (org, dir, 600); +}; + +// 'hits' is number of bounces the shot begins with. Used to change the +// number of bounces allowed before exploding. With no bounces (hits = 0), +// the fireball may bounce up to the nemesant standard of three times without +// exploding. What 'hits' does is change the bounces to 3 - hits. +void(float hits) sorcerer_fire = + {M_FireSmart ('8 -5 12'); newmis.count = hits;}; + +void(vector st) warlock_fire = +{ + local vector org, dir, vec; + local entity targ; // Lead shots toward this target. + + sound (self, CHAN_WEAPON, "necro/att_w.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + + targ = world; + + makevectors (self.angles); + // old st was '12 7 26'. + org = self.origin + v_forward*st_x + v_right*st_y + v_up*st_z; + + vec = Midpoint (self.enemy); + vec_z = self.enemy.absmin_z + self.enemy.size_z*0.7; + + if (skill >= 2) // In Hard/NM, aim at the enemy's feet occasionally. + { + if (org_z > self.enemy.absmin_z) + if (random() < 0.2) + if (vlen(vec - org) < 450) + vec_z = self.enemy.absmin_z; // Aim for the feet. +// DISABLED -- Warlock is dangerous enough without leading. +// if (random() < 0.1) +// targ = self.enemy; + } + MakeFancy (org, X32_STAR_RED, 2); + dir = Maim_Line (org, vec, 600, targ, '0 0 0'); + NecroBolt_Launch (org, dir); +// Update: Secondary bolts from necro boss can spawn monsters. + if (necro_boss ()) + if ( self.frame == $Hatak8 ) + newmis.think = NecroBolt_Summon; +}; + + +//============================================================================= + +// STAND - - - - - - - - - - - - - - - - +void() necro_idlesound = +{ +// PM: Replaced fwiz code with nemesants'. This is due to replaced sounds. + if (self.waitmin < time) + { + local float wr; + + // Use voice channel instead of auto -- don't want slain magi talking. + wr = random(); + if (wr > 0.7) + sound (self, CHAN_VOICE, "necro/idle1.wav", 1, ATTN_NORM); + else if (wr < 0.3) + sound (self, CHAN_VOICE, "necro/idle2.wav", 1, ATTN_NORM); + self.waitmin = time + 10; + } +}; + +// CoE Acolyte +void() necro1_stand1 =[ $Siwait1, necro1_stand2 ] {necro_idlesound(); ai_stand();}; +void() necro1_stand2 =[ $Siwait2, necro1_stand3 ] {ai_stand();}; +void() necro1_stand3 =[ $Siwait3, necro1_stand4 ] {ai_stand();}; +void() necro1_stand4 =[ $Siwait4, necro1_stand5 ] {ai_stand();}; +void() necro1_stand5 =[ $Siwait5, necro1_stand6 ] {ai_stand();}; +void() necro1_stand6 =[ $Siwait6, necro1_stand7 ] {ai_stand();}; +void() necro1_stand7 =[ $Siwait7, necro1_stand8 ] {ai_stand();}; +void() necro1_stand8 =[ $Siwait8, necro1_stand9 ] {ai_stand();}; +void() necro1_stand9 =[ $Siwait9, necro1_stand10 ] {ai_stand();}; +void() necro1_stand10 =[ $Siwait10, necro1_stand11 ] {ai_stand();}; +void() necro1_stand11 =[ $Siwait11, necro1_stand12 ] {ai_stand();}; +void() necro1_stand12 =[ $Siwait12, necro1_stand1 ] {ai_stand();}; + +// CoE Sorcerer +void() necro2_stand1 =[ $Stwait1, necro2_stand2 ] {necro_idlesound(); ai_stand();}; +void() necro2_stand2 =[ $Stwait2, necro2_stand3 ] {ai_stand();}; +void() necro2_stand3 =[ $Stwait3, necro2_stand4 ] {ai_stand();}; +void() necro2_stand4 =[ $Stwait4, necro2_stand5 ] {ai_stand();}; +void() necro2_stand5 =[ $Stwait5, necro2_stand6 ] {ai_stand();}; +void() necro2_stand6 =[ $Stwait6, necro2_stand7 ] {ai_stand();}; +void() necro2_stand7 =[ $Stwait7, necro2_stand8 ] {ai_stand();}; +void() necro2_stand8 =[ $Stwait8, necro2_stand9 ] {ai_stand();}; +void() necro2_stand9 =[ $Stwait9, necro2_stand10 ] {ai_stand();}; +void() necro2_stand10 =[ $Stwait10, necro2_stand11 ] {ai_stand();}; +void() necro2_stand11 =[ $Stwait11, necro2_stand12 ] {ai_stand();}; +void() necro2_stand12 =[ $Stwait12, necro2_stand1 ] {ai_stand();}; + +// CoE Warlock +void() necro3_stand1 =[ $Hwait1, necro3_stand2 ] {necro_idlesound(); ai_stand();}; +void() necro3_stand2 =[ $Hwait2, necro3_stand3 ] {ai_stand();}; +void() necro3_stand3 =[ $Hwait3, necro3_stand4 ] {ai_stand();}; +void() necro3_stand4 =[ $Hwait4, necro3_stand5 ] {ai_stand();}; +void() necro3_stand5 =[ $Hwait5, necro3_stand6 ] {ai_stand();}; +void() necro3_stand6 =[ $Hwait6, necro3_stand7 ] {ai_stand();}; +void() necro3_stand7 =[ $Hwait7, necro3_stand8 ] {ai_stand();}; +void() necro3_stand8 =[ $Hwait8, necro3_stand9 ] {ai_stand();}; +void() necro3_stand9 =[ $Hwait9, necro3_stand10 ] {ai_stand();}; +void() necro3_stand10 =[ $Hwait10, necro3_stand11 ] {ai_stand();}; +void() necro3_stand11 =[ $Hwait11, necro3_stand12 ] {ai_stand();}; +void() necro3_stand12 =[ $Hwait12, necro3_stand1 ] {ai_stand();}; + +// WALK - - - - - - - - - - - - - - - - +void() necro1_walk1 =[ $Sirun1, necro1_walk2 ] {necro_idlesound(); M_Step(); ai_walk(8);}; +void() necro1_walk2 =[ $Sirun2, necro1_walk3 ] {ai_walk(8);}; +void() necro1_walk3 =[ $Sirun3, necro1_walk4 ] {ai_walk(8);}; +void() necro1_walk4 =[ $Sirun4, necro1_walk5 ] {ai_walk(8);}; +void() necro1_walk5 =[ $Sirun5, necro1_walk6 ] {ai_walk(8);}; +void() necro1_walk6 =[ $Sirun6, necro1_walk7 ] {ai_walk(8);}; +void() necro1_walk7 =[ $Sirun7, necro1_walk8 ] {M_Step(); ai_walk(8);}; +void() necro1_walk8 =[ $Sirun8, necro1_walk9 ] {ai_walk(8);}; +void() necro1_walk9 =[ $Sirun9, necro1_walk10 ] {ai_walk(8);}; +void() necro1_walk10 =[ $Sirun10, necro1_walk11 ] {ai_walk(8);}; +void() necro1_walk11 =[ $Sirun11, necro1_walk12 ] {ai_walk(8);}; +void() necro1_walk12 =[ $Sirun12, necro1_walk1 ] {ai_walk(8);}; + +void() necro2_walk1 =[ $Strun1, necro2_walk2 ] {necro_idlesound(); M_Step(); ai_walk(8);}; +void() necro2_walk2 =[ $Strun2, necro2_walk3 ] {ai_walk(8);}; +void() necro2_walk3 =[ $Strun3, necro2_walk4 ] {ai_walk(8);}; +void() necro2_walk4 =[ $Strun4, necro2_walk5 ] {ai_walk(8);}; +void() necro2_walk5 =[ $Strun5, necro2_walk6 ] {ai_walk(8);}; +void() necro2_walk6 =[ $Strun6, necro2_walk7 ] {ai_walk(8);}; +void() necro2_walk7 =[ $Strun7, necro2_walk8 ] {M_Step(); ai_walk(8);}; +void() necro2_walk8 =[ $Strun8, necro2_walk9 ] {ai_walk(8);}; +void() necro2_walk9 =[ $Strun9, necro2_walk10 ] {ai_walk(8);}; +void() necro2_walk10 =[ $Strun10, necro2_walk11 ] {ai_walk(8);}; +void() necro2_walk11 =[ $Strun11, necro2_walk12 ] {ai_walk(8);}; +void() necro2_walk12 =[ $Strun12, necro2_walk1 ] {ai_walk(8);}; + +void() necro3_walk1 =[ $Hrun1, necro3_walk2 ] {necro_idlesound(); M_Step(); ai_walk(8);}; +void() necro3_walk2 =[ $Hrun2, necro3_walk3 ] {ai_walk(8);}; +void() necro3_walk3 =[ $Hrun3, necro3_walk4 ] {ai_walk(8);}; +void() necro3_walk4 =[ $Hrun4, necro3_walk5 ] {ai_walk(8);}; +void() necro3_walk5 =[ $Hrun5, necro3_walk6 ] {ai_walk(8);}; +void() necro3_walk6 =[ $Hrun6, necro3_walk7 ] {ai_walk(8);}; +void() necro3_walk7 =[ $Hrun7, necro3_walk8 ] {M_Step(); ai_walk(8);}; +void() necro3_walk8 =[ $Hrun8, necro3_walk9 ] {ai_walk(8);}; +void() necro3_walk9 =[ $Hrun9, necro3_walk10 ] {ai_walk(8);}; +void() necro3_walk10 =[ $Hrun10, necro3_walk11 ] {ai_walk(8);}; +void() necro3_walk11 =[ $Hrun11, necro3_walk12 ] {ai_walk(8);}; +void() necro3_walk12 =[ $Hrun12, necro3_walk1 ] {ai_walk(8);}; + +// RUN - - - - - - - - - - - - - - - - +// Casting scenes are used when necro uses special abilities such as +// teleportation, shielding, or summoning. +void() necro_face = +{ + if (self.worldtype) + { // Attempting a special atttack. + if (self.fallen) + ai_ritual (); + else if (!self.enemy) + return; + } + ai_face (); +}; + +void() necro1_cast1 =[ $Siatak1, necro1_cast2 ] {ai_face();}; +void() necro1_cast2 =[ $Siatak5, necro1_cast3 ] {ai_face();}; +void() necro1_cast3 =[ $Siatak6, necro1_cast4 ] {ai_face(); self.nextthink = time + 0.2;}; +void() necro1_cast4 =[ $Siatak11, necro1_cast5 ] {ai_face(); necro_activate_special();}; +void() necro1_cast5 =[ $Siatak12, necro1_run1 ] {ai_face();}; + +void() necro2_cast1 =[ $Statak1, necro2_cast2 ] {ai_face();}; +void() necro2_cast2 =[ $Statak2, necro2_cast3 ] {ai_face();}; +void() necro2_cast3 =[ $Statak5, necro2_cast4 ] {ai_face();}; +void() necro2_cast4 =[ $Statak6, necro2_cast5 ] {ai_face();}; +void() necro2_cast5 =[ $Statak7, necro2_cast6 ] {ai_face(); necro_activate_special();}; +void() necro2_cast6 =[ $Statak8, necro2_run1 ] {ai_face();}; + +void() necro3_cast1 =[ $Hatak1, necro3_cast2 ] {ai_face();}; +void() necro3_cast2 =[ $Hatak2, necro3_cast3 ] {ai_face();}; +void() necro3_cast3 =[ $Hatak7, necro3_cast4 ] {ai_face();}; +void() necro3_cast4 =[ $Hatak8, necro3_run1 ] {ai_face(); necro_activate_special();}; + +void() necro_cast = +{ + if (self.height == NECRO_ACOLYTE) + necro1_cast1(); + else if (self.height == NECRO_SORCERER) + necro2_cast1(); + else //if (self.height == NECRO_WARLOCK) + necro3_cast1(); +}; + +float RANGE_NECROSHIELD = 150; +float DELAY_NECROSHIFT = 1.5; // Can't teleport to dodge missiles. + +float(vector org) necro_clear = +{ + local entity head; + + head = findradius(org, 120); + while (head) + { + if (head.flags & FLx_CREATURE) + if (head != self) + if (Ally_Check (head, self)) + return FALSE; + + head = head.chain; + } + return TRUE; +}; + +// 'drop': 0 = No bomb, 1 = drop bomb, 2 = teleport only when attacking. +float(entity targ, vector spot, float drop) necro_teleport = +{ + local vector org; + local float bomb; + +// Check if the necro can drop a bomb near an enemy. + bomb = FALSE; + if (drop) + { + if (self.enemy) + if (InMeleeRange (120)) + if (CanDamage (self.enemy, self)) + bomb = TRUE; + if (drop == 2) + if (!bomb) + return FALSE; + } + +// Do teleportation routine. + org = self.origin; + if (EntryPoint_Spawn (self, targ, spot, EntryPoint_Random)) + { + // Necro successfully teleported away. + self.waitmax = time + DELAY_NECROSHIFT; + if (bomb) + { // Make sure necro and friends are a safe distance away before + // dropping a explosive rune as a time bomb. + if (vlen(org - self.origin) > 120) + if (necro_clear (org)) + NecroBomb (org); + } + spawn_tfog (org); + spawn_tfog (self.origin); + self.fallen = world; + self.worldtype = 0; + necro_cast (); + } + return FALSE; +}; + +// Called when teleporting away from an attack. +float() necro_teledef = +{ + if (self.waitmax <= time) // Don't spam teleport as a defense. + return necro_teleport (self.enemy, self.origin, FALSE); + return FALSE; +}; + +// Look for enemy missiles infront of the necro. We don't care which +// missile is found, just whether or not any are found, so return T or F. +float() necro_find = +{ + if (self.enemy) + { + local entity head; + + head = findradius (self.origin, RANGE_NECROSHIELD); + while (head) + { // If missile came from enemy, or targets the necro, take it + // if the missile is infront of the necro. + if (IsMissile (head)) + if ((head.master == self.enemy) || (head.enemy == self)) + if (visible (head)) + if (infront (head)) + return TRUE; + head = head.chain; + } + } + return FALSE; +}; + +// Searches for missiles to defend against. If none are found, then move. +// Called by sorcerer and warlock. Update: Called by acolyte code now +// because necro boss starts in acolyte mode. +void() necro_run = +{ + if (!self.mirror_finished) + self.effects = self.effects - (self.effects & EF_BRIGHTFIELD); + +// Sorcerer and warlock modes have special defenses. + if (self.height >= NECRO_SORCERER) + if (necro_find ()) + { + if (self.height == NECRO_SORCERER) + { // Sorcerer -- Teleport to random nearby point. + if (necro_teledef ()) + return; + // Made it here? Teleportation failed, so just move. + } + else if (self.height == NECRO_WARLOCK) + { // Warlock -- Raise shields if practical to do so. + // Do NOT raise shields if the following apply: + // 1) Enemy is too close. + // 2) Necro is in a deadly environment (e.g., in lava). + if (vlen(self.enemy.origin - self.origin) > (RANGE_NECROSHIELD + self.enemy.maxs_x)) + if (self.h2otype >= CONTENT_WATER) + if ((self.h2otype != CONTENT_WATER) || (self.h2olevel < 3)) + { + self.fallen = world; + self.worldtype = 0; + ReflectorShield (self); // Turn on shield. + necro3_cast1 (); + return; + } + // Necro boss may teleport instead if shield cannot be raised. + if (necro_boss ()) + if (necro_teledef ()) + return; + } + // At this point, no special defense was activated. + } +// No defense activated, so move. + local float d; + + d = 16; + if (necro_boss ()) + { + // Boss may teleport to enemy. + if (self.search_time + 5 < time) + { + local entity targ; + + targ = world; + if (self.enemy) + targ = self.enemy; + else if (!self.fighting) + targ = self.master; + + if (targ) + if (!visible (targ)) + if (necro_teleport (targ, targ.origin, TRUE)) + { // Teleport to the enemy. + self.search_time = time; //+ 5; + return; + } + } + // Didn't teleport, so run. +// DISABLED -- With teleport, faster run seems to be a liability for necro. +// if (!QC_CloseEnough (d * 2)) +// d = d * 2; + } +// Move. All running frames use the same speed. + ai_run(d); +}; + +// Update: Acolytes use necro_run() instead of ai_run(16) since the +// necro boss uses all three necro modes. +void() necro1_run1 =[ $Sirun1, necro1_run2 ] {necro_idlesound(); M_Step(); necro_run();}; +void() necro1_run2 =[ $Sirun3, necro1_run3 ] {necro_run();}; +void() necro1_run3 =[ $Sirun5, necro1_run4 ] {necro_run();}; +void() necro1_run4 =[ $Sirun7, necro1_run5 ] {M_Step(); necro_run();}; +void() necro1_run5 =[ $Sirun9, necro1_run6 ] {necro_run();}; +void() necro1_run6 =[ $Sirun11, necro1_run1 ] {necro_run();}; + +void() necro2_run1 =[ $Strun1, necro2_run2 ] {necro_idlesound(); M_Step(); necro_run();}; +void() necro2_run2 =[ $Strun3, necro2_run3 ] {necro_run();}; +void() necro2_run3 =[ $Strun5, necro2_run4 ] {necro_run();}; +void() necro2_run4 =[ $Strun7, necro2_run5 ] {M_Step(); necro_run();}; +void() necro2_run5 =[ $Strun9, necro2_run6 ] {necro_run();}; +void() necro2_run6 =[ $Strun11, necro2_run1 ] {necro_run();}; + +void() necro3_run1 =[ $Hrun1, necro3_run2 ] {necro_idlesound(); M_Step(); necro_run();}; +void() necro3_run2 =[ $Hrun3, necro3_run3 ] {necro_run();}; +void() necro3_run3 =[ $Hrun5, necro3_run4 ] {necro_run();}; +void() necro3_run4 =[ $Hrun7, necro3_run5 ] {M_Step(); necro_run();}; +void() necro3_run5 =[ $Hrun9, necro3_run6 ] {necro_run();}; +void() necro3_run6 =[ $Hrun11, necro3_run1 ] {necro_run();}; + +// ATTACK - - - - - - - - - - - - - - - +void() ai_repel; // In 'nemesant.qc'. + +float() necro_encore = +{ + if (necro_boss ()) + return TRUE; + + if (cranked || (skill >= 3)) + return TRUE; + if (skill >= 2) + if (random() < 0.25) + return TRUE; + return FALSE; +}; + +void() necro_run_check = +{ // PM: Hack for non-specials. + if (self.height == NECRO_SORCERER) + self.think = necro2_run1; + else if (self.height == NECRO_WARLOCK) + self.think = necro3_run1; +}; + +// PM: Sped up acolyte's swings due to frame rate differences between +// Quake and Hexen2. +void() necro1_melee1 =[ $Siatak2, necro1_melee2 ] {ai_charge(3); + if (necro_boss ()) + self.cnt = 2; // Extra swings. + else + self.cnt = 0; +}; +void() necro1_melee2 =[ $Siatak4, necro1_melee3 ] { + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); + ai_charge(0); ai_melee(); +}; +void() necro1_melee3 =[ $Siatak6, necro1_melee4 ] {ai_charge(3); ai_melee();}; +void() necro1_melee4 =[ $Siatak8, necro1_melee5 ] {ai_charge(2); ai_melee(); + if (self.enemy.health > 0) + if (self.cnt > 0) + if (InMeleeRange (80)) + { // Interrupt for a new attack, much like Zeal. + self.cnt = self.cnt - 1; + self.think = necro1_melee2; + return; + } + self.cnt = 0; +}; +void() necro1_melee5 =[ $Siatak10, necro1_melee6 ] {ai_charge(1);}; +void() necro1_melee6 =[ $Siatak12, necro1_run1 ] {ai_charge(0); necro_run_check();}; +void() necro1_melee = +{ + if (InMeleeRange (80)) + necro1_melee1 (); + else + { + if (necro_boss ()) + if (random() < 0.2) + { // In case the boss gets stuck, let him make some potshots. + if (self.th_missile) + self.th_missile (); + return; + } + ai_charge (16); // Not close enough -- continue march. + } +}; + +void() necro1_attack1 =[ $Siatak1, necro1_attack2 ] {ai_face();}; +void() necro1_attack2 =[ $Siatak5, necro1_attack3 ] {ai_face(); self.cnt = 0;}; +void() necro1_attack3 =[ $Siatak6, necro1_attack4 ] {ai_face(); + if (!self.cnt) + { // Set refire count. + if (necro_boss ()) + self.cnt = random() * 3 & 3 + 1; + else if (necro_encore ()) + self.cnt = 1; + } + if (self.cnt) + sound (self, CHAN_WEAPON, "necro/att_a2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "necro/att_a.wav", 1, ATTN_NORM); + acolyte_fire(); +// Make small poison cloud. 'makevectors' called in above function. + local vector org; + org = self.origin + v_forward*14 - v_right*8 + v_up*12; + MakeFancy (org, X32_CLOUD_GREEN + 1, 3); +}; +void() necro1_attack4 =[ $Siatak6, necro1_attack5 ] {ai_face(); + if (self.cnt) + { + acolyte_fire(); + self.cnt = self.cnt - 1; + if (self.cnt) + self.think = necro1_attack3; + } +}; +void() necro1_attack5 =[ $Siatak11, necro1_attack6 ] {ai_face(); acolyte_fire();}; +void() necro1_attack6 =[ $Siatak12, necro1_run1 ] {ai_face();}; + +float() sorcerer_tele = +{ +//- - - - - - - - - +// The main purpose of this teleportation check is to increase distance +// between the enemy and the necro. Otherwise, enemies that reach the +// necro can layeth the smackdown on him. +//- - - - - - - - - + return necro_teleport (self.enemy, self.origin, 2); +}; +void() necro2_attack1 =[ $Statak1, necro2_attack2 ] {ai_face();}; +void() necro2_attack2 =[ $Statak2, necro2_attack3 ] {ai_face();}; +void() necro2_attack3 =[ $Statak3, necro2_attack4 ] {ai_face(); + if (!sorcerer_tele ()) + sorcerer_fire(2); +}; +void() necro2_attack4 =[ $Statak4, necro2_attack5 ] {ai_face();}; +void() necro2_attack5 =[ $Statak5, necro2_attack6 ] {ai_face(); + if (necro_encore ()) + sorcerer_fire(3); +}; +void() necro2_attack6 =[ $Statak6, necro2_attack7 ] {ai_face();}; +void() necro2_attack7 =[ $Statak7, necro2_attack8 ] {ai_face();}; +void() necro2_attack8 =[ $Statak8, necro2_run1 ] {ai_face();}; + +float() necro4_gangup = +{ + local entity head; + + head = findradius (self.origin, 120); + while (head) + { + if (head.enemy == self) + if (self.enemy != head) + if (CanDamage (head, self)) + return TRUE; + head = head.chain; + } + return FALSE; +}; +void() necro3_attack1 =[ $Hatak1, necro3_attack2 ] {ai_face();}; +void() necro3_attack2 =[ $Hatak2, necro3_attack3 ] {ai_face();}; +void() necro3_attack3 =[ $Hatak4, necro3_attack4 ] {ai_face(); + if (InMeleeRange (80)) + if (!(self.enemy.flags & (FL_FLY | FL_SWIM))) + { + if (necro_boss ()) + { // Boss escapes instead if ganged-up by more enemies. + if (necro4_gangup ()) + if (sorcerer_tele ()) + return; + } + ai_repel (); + return; + } +// Shoving won't work, so zap the target instead. + if (necro_boss ()) + { // Update: Boss may teleport away instead. + if (sorcerer_tele ()) + return; + } + warlock_fire('12 9 27'); +}; +void() necro3_attack4 =[ $Hatak6, necro3_attack5 ] {ai_face();}; +void() necro3_attack5 =[ $Hatak8, necro3_run1 ] {ai_face(); + if (necro_encore ()) + warlock_fire('14 8 27'); +}; +void() necro3_melee = +{ +// If necro is not close enough to repel target, he will zap the enemy +// continuously with bolts, which is a bit overkill. Instead, charge +// most of the time. + if (!InMeleeRange (80)) + if (random() < 0.6) // 40% chance per frame to attack. + {ai_charge (16); return;} + necro3_attack1 (); +}; + +void() necro_activate_special = +{ + local float wtype; + local float loop; + + wtype = self.worldtype; + if (!wtype) + return; + + if (wtype == NSA_CURSE) + { // Curses have a duration of ten seconds. + if (self.enemy.flags & FL_MONSTER) + { // Special cases for some monsters. + if (self.enemy.xfl & XFL_ZOMBIE) + { // Supress zombie immortality so any damage can kill zombies. + T_Curse (self.enemy, self, CURSE_ARMOR, 10); + return; + } + // If target is mad at a friend of necro, try to redirect its rage. + if (Align_Match (self.enemy.enemy, self)) + if (T_Confuse (self.enemy, self)) + return; + } + // Invoke one of several nasty status effects. + T_Curse (self.enemy, self, 0, 10); + return; + } + + if (wtype == NSA_SUMMON_GOLEM) + { // If necro cannot summon a golem near an enemy, summon one near + // himself. High-flying targets often prevent telebomb summoning. + if (!SpawnMonster_Attack (self, ID_GOLEM_KNIGHT)) + SpawnMonster (self, self.origin, ID_GOLEM_KNIGHT, EntryPoint_Fan); + return; + } + + if (wtype == NSA_SUMMON_IMPS) + { + loop = NECRO_MAX_IMPS - count_petclass(self, "monster_imp"); + if (loop > self.height) + loop = self.height; + SpawnMonster_Horde (ID_IMP_KINN, loop); + return; + } + + if (wtype == NSA_CORPSE_EXPLOSION) + { + if (self.fallen.th_gib) + if (self.fallen.deadflag == DEAD_DEAD) + { + local entity swap; + local float sfx; + + sfx = random() * 4 & 3; + + swap = self; + self = self.fallen; + self.health = self.gib_health - 1; + if (self.th_gib (-50)) + { + local float damage, rgb; + + rgb = ((fabs(self.bloodtype) / 16) & 15) * 16; + damage = self.max_health * (random() * 0.4 + 0.6) * 0.2; //120 + Tent_Explosion2 (self.origin, rgb, 16); + if (sfx == 1) + sound (self, CHAN_AUTO, "necro/pop1.wav", 1, ATTN_NORM); + else if (sfx == 2) + sound (self, CHAN_AUTO, "necro/pop2.wav", 1, ATTN_NORM); + else if (sfx == 3) + sound (self, CHAN_AUTO, "necro/pop3.wav", 1, ATTN_NORM); + else + sound (self, CHAN_AUTO, "necro/pop4.wav", 1, ATTN_NORM); + T_RadiusDamage_II (self, swap, damage, self, DF_FIRE|DF_ROCKET|DF_SAFE, "corpse", CORPSE_EXPLOSION_RADIUS, 0); + } + self = swap; + } + self.fallen = world; + self.worldtype = 0; + return; + } +}; + +void() necro4_attack = +{ + local entity head; + local float safe, yes; + + self.worldtype = 0; + safe = !InMeleeRange(80); + +// Check for cursing. + if (safe) + { + if (self.height >= NECRO_SORCERER) // Not in acolyte mode. + if (!self.enemy.curse_type) + if (random() < 0.5) + { + self.worldtype = NSA_CURSE; + sound (self, CHAN_AUTO, "necro/curse.wav", 1, ATTN_NORM); + necro_cast (); + return; + } + } +// Check for corpse explosion. + if (safe) + { + if (self.pets >= self.height) + yes = 1; + else if (self.pets) + yes = 0.75; + else + yes = 0.5; + } + else + yes = 0.25; + if (random() < yes) + { + if (self.height >= NECRO_SORCERER) // Not in acolyte mode. + { + self.fallen = world; + head = QC_FindRadius (self.enemy.origin, CORPSE_EXPLOSION_RADIUS); + while (head) + { + if (head.th_gib) + if (head.deadflag == DEAD_DEAD) + if (infront (head)) + { + traceline (self.origin + self.view_ofs, head.origin, TRUE, self); + if (trace_fraction == 1) + { + if (CanDamage (self.enemy, head)) + { // Seek the corpse with the highest max health, + // since damage is based on max health. + if (head.max_health > self.fallen.max_health) + self.fallen = head; + } + } + } + head = head.chain; + } + if (self.fallen) + { + self.worldtype = NSA_CORPSE_EXPLOSION; + sound (self, CHAN_AUTO, "necro/pop.wav", 1, ATTN_NORM); + necro_cast (); + return; + } + } + } +// Check for summoning. + if (safe) + { + if (random() < 0.75) + { + // Check for golem. Do only in warlock mode. + if (self.height == NECRO_WARLOCK) + { + yes = 1; + head = find(world, classname, "monster_golem"); + while (head) + { + if (head.master == self) + { + if (head.deadflag < DEAD_DEAD) + { + yes = 0; // Already have a golem out. + if (self.enemy) + if (!IsDead (head)) + if (!visible (head)) + if (!visible2 (self.enemy, head)) + { // Unsummon current, and summon new one. + T_Kill (head, self, self, head.gib_health - 1, "impulse"); + if (head.health <= 0) // Confirm destruction. + self.worldtype = NSA_SUMMON_GOLEM; + } + } + } + if (yes) + head = find(head, classname, "monster_golem"); + else + head = world; + } + if (yes) + self.worldtype = NSA_SUMMON_GOLEM; + } + // Check for imps. + if (!self.worldtype) + { + if (random() < 0.75) + { + if (count_petclass(self, "monster_imp") < 2) //self.height) + self.worldtype = NSA_SUMMON_IMPS; + } + } + // Now see if necro will summon something. + if (self.worldtype) + { + sound (self, CHAN_AUTO, "necro/summon.wav", 1, ATTN_NORM); + necro_cast (); + return; + } + } + } +// Just blast the enemy. + if (self.height == NECRO_ACOLYTE) + necro1_attack1 (); + else if (self.height == NECRO_SORCERER) + necro2_attack1 (); + else + necro3_attack1 (); +}; + +// PAIN - - - - - - - - - - - - - - - - +void(void() skip) necro_skip = {if (random() < 0.5) skip();}; + +// Check for an escape during pain. +void() necro_telepain = +{ + if (necro_boss ()) + { + if (self.enemy) + { + if ((random() < 0.25) || (self.h2otype <= CONTENT_SLIME)) + necro_teleport (self.enemy, self.origin, TRUE); + } + } +}; + +void() necro1_pain1 =[ $Sipain1, necro1_pain2 ] {necro_skip(necro1_pain2);}; +void() necro1_pain2 =[ $Sipain2, necro1_pain3 ] {}; +void() necro1_pain3 =[ $Sipain3, necro1_pain4 ] {}; +void() necro1_pain4 =[ $Sipain4, necro1_pain5 ] {}; +void() necro1_pain5 =[ $Sipain5, necro1_pain6 ] {necro_skip(necro1_pain6);}; +void() necro1_pain6 =[ $Sipain6, necro1_pain7 ] {}; +void() necro1_pain7 =[ $Sipain7, necro1_pain8 ] {}; +void() necro1_pain8 =[ $Sipain8, necro1_run1 ] {necro_run_check();}; + +void() necro2_pain1 =[ $Stpain1, necro2_pain2 ] {necro_skip(necro2_pain2);}; +void() necro2_pain2 =[ $Stpain2, necro2_pain3 ] {}; +void() necro2_pain3 =[ $Stpain3, necro2_pain4 ] {necro_skip(necro2_pain4);}; +void() necro2_pain4 =[ $Stpain4, necro2_pain5 ] {}; +void() necro2_pain5 =[ $Stpain5, necro2_pain6 ] {necro_skip(necro2_pain6);}; +void() necro2_pain6 =[ $Stpain6, necro2_pain7 ] {}; +void() necro2_pain7 =[ $Stpain7, necro2_pain8 ] {necro_skip(necro2_pain8);}; +void() necro2_pain8 =[ $Stpain8, necro2_run1 ] {necro_telepain();}; + +void() necro3_pain1 =[ $Hpain2, necro3_pain2 ] {}; +void() necro3_pain2 =[ $Hpain3, necro3_pain3 ] {necro_skip(necro3_pain3);}; +void() necro3_pain3 =[ $Hpain4, necro3_pain4 ] {}; +void() necro3_pain4 =[ $Hpain6, necro3_pain5 ] {}; +void() necro3_pain5 =[ $Hpain7, necro3_pain6 ] {necro_skip(necro3_pain6);}; +void() necro3_pain6 =[ $Hpain8, necro3_run1 ] {necro_telepain();}; + +// Named (foo)switch as C's switch. +void() necro_painswitch = +{ + if (self.height == NECRO_ACOLYTE) + necro1_pain1 (); +// else if (( self.frame >= $Siatak1 ) && ( self.frame <= $Siwait12 )) +// necro1_pain1 (); + else if (self.height == NECRO_SORCERER) + necro2_pain1 (); + else //if (self.height == NECRO_WARLOCK) + necro3_pain1 (); +}; + +// Check for weapon breakage and update ai accordingly. +// As weapon breaks, the necro uses stronger moves. Only boss should use. +float() Necro_WeaponBroke = +{ + local vector org, vel, spin; + local float head, shaft; + +// Check which parts need to break. + head = shaft = FALSE; + if (self.height < NECRO_WARLOCK) + { + if (self.health <= self.max_health / 2) + shaft = TRUE; + if (self.height < NECRO_SORCERER) + { + if (self.health <= self.max_health * 5 / 6) + head = TRUE; + else if (!shaft) + return FALSE; // Nothing broke. + } + else if (!shaft) + return FALSE; // Nothing broke. + } + else + return FALSE; // Weapon already broke! + + makevectors (self.angles); + +// Sickle head. + if (head) + { + sound (self, CHAN_AUTO, "misc/metalbrk.wav", 1, ATTN_NORM); + + vel = VelocityForDamage (0); + spin_x = random()*600; + spin_y = random()*600; + spin_z = random()*600; + org = self.origin + v_forward*17 + v_right*20 + v_up*31; // '16.57 19.78 30.68' + Gib_Spawn (org, "progs/nec_rod1.mdl", vel, spin, 0, 0, 0, TRUE); + if (!shaft) + { + self.height = NECRO_SORCERER; + self.th_stand = necro2_stand1; + self.th_walk = necro2_walk1; + self.th_run = necro2_run1; + self.th_missile = necro4_attack; + self.th_melee = necro4_attack; + } + } + +// Shaft. + if (shaft) + { + sound (self, CHAN_AUTO, "misc/woodbrk.wav", 1, ATTN_NORM); + + vel = VelocityForDamage (0); + vel = vel + v_right*50; + spin_x = random()*600; + spin_y = random()*600; + spin_z = random()*600; + org = self.origin + v_forward*15 + v_right*10 + v_up*25; + Gib_Spawn (org, "progs/nec_rod2.mdl", vel, spin, 0, 0, 0, TRUE); + + vel = VelocityForDamage (0); + vel = vel - v_right*50; + spin_x = random()*600; + spin_y = random()*600; + spin_z = random()*600; + org = self.origin + v_forward*15 - v_right*7 + v_up*15; // '14.12 9.67 24.54' + Gib_Spawn (org, "progs/nec_rod3.mdl", vel, spin, 0, 0, 0, TRUE); + + self.height = NECRO_WARLOCK; + self.th_stand = necro3_stand1; + self.th_walk = necro3_walk1; + self.th_run = necro3_run1; + self.th_missile = necro4_attack; + self.th_melee = necro4_attack; + } + + return TRUE; +}; + +void(entity attacker, float damage) necro_pain = +{ +// Update: Check for evolution/weapon breakage for boss necro. + if (necro_boss ()) + if (Necro_WeaponBroke ()) + { // Must go into pain for weapon breaking effects to look right. + self.pain_finished = time + 1; + sound (self, CHAN_VOICE, "necro/pain1.wav", 1, ATTN_NORM); + necro_painswitch (); + return; + } +//- - - - - - - - - + + if (self.pain_finished > time) + return; // Don't make multiple pain sounds right after each other. + + sound (self, CHAN_VOICE, "necro/pain1.wav", 1, ATTN_NORM); + self.pain_finished = time + 1; // time + 0.5 is too short. + + if (random()*50 > damage) // Was flat 40. + return; // Didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + +// Will go into a pain anim, so turn off the shield if it is on. + if (!self.mirror_finished) + self.effects = self.effects - (self.effects & EF_BRIGHTFIELD); + + necro_painswitch (); + + attacker = attacker; // Appease FrikQcc! +}; + +// DEATH - - - - - - - - - - - - - - - - +// Special decapitation code. +void() necro_decap1 =[ $decap2, necro_decap2 ] {blood_spray('0 0 28', 1);}; +void() necro_decap2 =[ $decap4, necro_decap3 ] {blood_spray('-9 0 29', 2);}; +void() necro_decap3 =[ $decap6, necro_decap4 ] {blood_spray('-12 0 26', 1); monster_drop();}; +void() necro_decap4 =[ $decap8, necro_decap5 ] {}; +void() necro_decap5 =[ $decap10, necro_decap6 ] {}; +void() necro_decap6 =[ $decap12, necro_decap7 ] {}; +void() necro_decap7 =[ $decap14, necro_decap8 ] {blood_spray('7 -1 24', -1);}; +void() necro_decap8 =[ $decap16, necro_decap9 ] {ai_forward(4);}; +void() necro_decap9 =[ $decap18, necro_decap10 ] {ai_forward(4);}; +void() necro_decap10 =[ $decap19, necro_decap11 ] {ai_forward(1);}; +void() necro_decap11 =[ $decap20, decap_end ] {ai_forward(1);}; +// Yes, use monster_remove to dispose of the body since the necro is a +// head gib. The think function should be safe enough for body to use. +// Update: decap_end used instead so body doesn't vanish instantly. + +// Standard death functions. +void() necro_die1 =[ $deathA2, necro_die2 ] {}; +void() necro_die2 =[ $deathA4, necro_die3 ] {}; +void() necro_die3 =[ $deathA6, necro_die4 ] {monster_drop();}; +void() necro_die4 =[ $deathA8, necro_die5 ] {}; +void() necro_die5 =[ $deathA10, necro_die6 ] {}; +void() necro_die6 =[ $deathA12, necro_die7 ] {}; +void() necro_die7 =[ $deathA14, necro_die8 ] {}; +void() necro_die8 =[ $deathA16, necro_die9 ] {ai_forward(4);}; +void() necro_die9 =[ $deathA18, necro_die10 ] {ai_forward(4);}; +void() necro_die10 =[ $deathA19, necro_die11 ] {ai_forward(1);}; +void() necro_die11 =[ $deathA20, monster_end ] {ai_forward(1);}; + +float(float dm) necro_gib = +{ + if (self.health < self.gib_health) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowHead ("progs/h_necro.mdl", dm); + return TRUE; + } + return FALSE; +}; + +void() necro_die = +{ +// Note: Wand may be a handgun in the final release, so don't let the +// sorcerer drop his wand. + +// Now to our death animation... +//- - - - - + if (Shattered ()) + return; + if (Decapitated ()) + { + monster_decap ('0 0 28', necro_decap1); + return; + } +//- - - - - + if (necro_gib (self.health)) + return; + + if (random() < 0.5) + sound (self, CHAN_VOICE, "necro/death1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "necro/death2.wav", 1, ATTN_NORM); + necro_die1 (); +}; + +// REVIVE - - - - - - - - - - - - - - - +void() necro_revive1 =[ $deathA19, necro_revive2 ] {}; +void() necro_revive2 =[ $deathA18, necro_revive3 ] {}; +void() necro_revive3 =[ $deathA16, necro_revive4 ] {}; +void() necro_revive4 =[ $deathA14, necro_revive5 ] {}; +void() necro_revive5 =[ $deathA12, necro_revive6 ] {}; +void() necro_revive6 =[ $deathA10, necro_revive7 ] {}; +void() necro_revive7 =[ $deathA8, necro_revive8 ] {}; +void() necro_revive8 =[ $deathA6, necro_revive9 ] {}; +void() necro_revive9 =[ $deathA4, necro_revive10 ] {}; +void() necro_revive10 =[ $deathA2, necro_revive11 ] {}; +void() necro_revive11 = {self.th_run();}; + +// OTHER - - - - - - - - - - - - - - - - +void(float hello) necro_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "necro/idle1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "necro/sight1.wav", 1, ATTN_NORM); +}; + +void() necro_cache = +{ + precache_model ("progs/necro.mdl"); + precache_model ("progs/h_necro.mdl"); + // Removed "progs/blood.mdl" precache since most can get beheaded. + precache_model ("progs/r_bolt.mdl"); + precache_model ("progs/smartbal.mdl"); + precache_model ("progs/w_spike.mdl"); + precache_model ("progs/nec_rune.mdl"); + // Removed "progs/drake/g_wand.mdl" because sorcs don't drop their wands anymore. + + precache_sound ("curse/x_armor.wav"); + precache_sound ("necro/att_a.wav"); + precache_sound ("necro/att_a2.wav"); + precache_sound ("necro/att_w.wav"); + precache_sound ("necro/death1.wav"); + precache_sound ("necro/death2.wav"); + precache_sound ("necro/idle1.wav"); + precache_sound ("necro/idle2.wav"); + precache_sound ("necro/pain1.wav"); + precache_sound ("necro/sight1.wav"); + precache_sound ("nemesant/frblfly.wav"); +// precache_sound ("plasma/explode.wav"); + precache_sound ("skullwiz/push.wav"); +}; + +void() necro_boss_cache = +{ + necro_cache (); + precache_model ("progs/nec_rod1.mdl"); + precache_model ("progs/nec_rod2.mdl"); + precache_model ("progs/nec_rod3.mdl"); + precache_model ("progs/drake/s_spark.spr"); + + precache_sound ("curse/x_armor.wav"); + precache_sound ("curse/x_damage.wav"); + precache_sound ("curse/x_muddle.wav"); + precache_sound ("curse/x_slow.wav"); + precache_sound ("curse/x_weaken.wav"); + precache_sound ("misc/metalbrk.wav"); + precache_sound ("misc/woodbrk.wav"); + precache_sound ("necro/curse.wav"); + precache_sound ("necro/pop.wav"); + precache_sound ("necro/pop1.wav"); + precache_sound ("necro/pop2.wav"); + precache_sound ("necro/pop3.wav"); + precache_sound ("necro/pop4.wav"); + precache_sound ("necro/summon.wav"); +}; + +//============ +// --> QUAKED monster_necromancer (1 0 0) (-16 -16 -24) (16 16 40) Ambush +//============ +void() monster_necromancer = +{ + local float nec, hp; + + if (self.classname == "monster_acolyte") { + nec = NECRO_ACOLYTE; hp = 150; + if (self.deathstring == "") self.deathstring = " was humiliated by an Acolyte\n"; + } else if (self.classname == "monster_sorcerer") { + if (self.deathstring == "") self.deathstring = " was bested by a Sorcerer\n"; + nec = NECRO_SORCERER; hp = 300; + } else if (self.classname == "monster_warlock") { + if (self.deathstring == "") self.deathstring = " was no match for a Warlock\n"; + nec = NECRO_WARLOCK; hp = 450;} + } else { + if (self.deathstring == "") self.deathstring = " was snuffed by a Necromancer\n"; + nec = 0; hp = 1800; + } + + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + necro_cache (); + if (!nec) + { + necro_boss_cache (); + imp_cache (); + kolem_cache (); + } + } + + monster_form ("progs/necro.mdl", '-16 -16 -24', '16 16 40', hp, -40); + self.mdl_head = "progs/h_necro.mdl"; // Gremlin shenanigans. + self.mass = MASS_MEDIUM; + + if (nec) + { + if (nec == NECRO_ACOLYTE) + { // Acolyte + self.th_stand = necro1_stand1; + self.th_walk = necro1_walk1; + self.th_run = necro1_run1; + self.th_missile = necro1_attack1; + self.th_melee = necro1_melee; + } + else if (nec == NECRO_SORCERER) + { // Sorcerer + self.th_stand = necro2_stand1; + self.th_walk = necro2_walk1; + self.th_run = necro2_run1; + self.th_missile = necro2_attack1; + self.th_melee = necro2_attack1; + } + else //if (nec == NECRO_WARLOCK) + { // Warlock + self.th_stand = necro3_stand1; + self.th_walk = necro3_walk1; + self.th_run = necro3_run1; + self.th_missile = necro3_attack1; + self.th_melee = necro3_melee; + } + self.th_revive = necro_revive1; + + self.height = nec; + self.purse = '1 0.5 0.5'; // max = 1, 50% for 1, 50% gem. + self.purse_x = 1 + nec; + } + else + { // Necromancer boss + self.skin = 1; + self.classname = "monster_necromancer"; + self.height = NECRO_ACOLYTE; // Start in acolyte mode. + self.ryuflags = RYU_ALERT; + self.purse = '20 1 0.5'; + self.xfl = XFL_BOSS; + + self.th_stand = necro1_stand1; + self.th_walk = necro1_walk1; + self.th_run = necro1_run1; + self.th_missile = necro4_attack; //necro1_attack1; + self.th_melee = necro1_melee; + } + self.th_pain = necro_pain; + self.th_die = necro_die; + //- - - - - - - - + self.th_sight = necro_sight; + self.th_gib = necro_gib; + self.th_spawn = monster_necromancer; + + self.family = FAM_NECRO; + self.waitmax = 0; // Teleport delay, similar to nemesant. + if (soul_evil) + monster_purse (self.purse_x, self.purse_y, self.purse_z); + else + self.purse = '0 0 0'; + + monster_start (); +}; + +void() monster_acolyte = {monster_necromancer ();}; +void() monster_sorcerer = {monster_necromancer ();}; +void() monster_warlock = {monster_necromancer ();}; + +// Coven of Ebony entities. +void() monster_fragwiz = + {self.classname = "monster_acolyte"; monster_necromancer ();}; +void() monster_sorceror = // PM: Spelled 'sorcerer' NOT 'sorceror'. + {self.classname = "monster_sorcerer"; monster_necromancer ();}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/mon_ogre.qc b/QC_other/QC_keep/mon_ogre.qc new file mode 100644 index 00000000..b625e2b7 --- /dev/null +++ b/QC_other/QC_keep/mon_ogre.qc @@ -0,0 +1,780 @@ +/*============================================================================== +OGRE +==============================================================================*/ + +$cd id1/models/ogre_c +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame painb1 painb2 painb3 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 paind14 paind15 paind16 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 death12 +$frame death13 death14 + +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 + + +//====================================================================== +void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();}; +void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();}; +void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();}; +void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();}; +void() ogre_stand5 =[ $stand5, ogre_stand6 ] {monster_idle_sound(); ai_stand();}; +void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();}; +void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();}; +void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();}; +void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();}; + +//====================================================================== +void() ogre_walk1 =[ $walk1, ogre_walk2 ] {monster_footstep(FALSE); ai_walk(3);}; +void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);}; +void() ogre_walk3 =[ $walk3, ogre_walk4 ] {monster_idle_sound(); ai_walk(2);}; +void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);}; +void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);}; +void() ogre_walk6 =[ $walk6, ogre_walk7 ] {ai_walk(5); +if (random() < 0.1) sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);}; +void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);}; +void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);}; +void() ogre_walk9 =[ $walk9, ogre_walk10 ] {monster_footstep(FALSE); ai_walk(3);}; +void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);}; +void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);}; +void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);}; +void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);}; +void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);}; +void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);}; +void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);}; + +//====================================================================== +void() ogre_run1 =[ $run1, ogre_run2 ] {monster_idle_sound(); ai_run(9);}; +void() ogre_run2 =[ $run2, ogre_run3 ] {monster_footstep(FALSE);ai_run(12);}; +void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);}; +void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);}; +void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);}; +void() ogre_run6 =[ $run6, ogre_run7 ] {monster_footstep(FALSE);ai_run(4);}; +void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);}; +void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);}; + +/*====================================================================== + Range - Grenades (uses generic attack function in projectiles.qc) + Nail - Alternative firemode (based on nail ogre from Marcher Fortress) +======================================================================*/ +void() OgreFireADNails = +{ + local vector org, dir, vec; + local float loopvar; + + // Check for death? + if (self.health < 1) return; + loopvar = 0; + + // Light up face, setup projectile speed and play fire sound + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_NAILOGREPROJ + (skill * SPEED_NAILOGRESKILL); + sound(self, CHAN_WEAPON, "ogre/nail_fire.wav", 1, ATTN_NORM); + + // turn and face your enemy! + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Loop through the nail burst (all at once) + while (loopvar < self.attack_count) { + // Random circle spread pattern + vec = (crandom()*20)*v_right + (crandom()*20)*v_up; + dir = normalize((self.enemy.origin + vec) - org); + // Generate a red hot nail projectile + launch_projectile(org, dir, CT_PROJ_MONNG, self.attack_speed); + loopvar = loopvar + 1; + } +}; + +//---------------------------------------------------------------------- +void() ogre_adnail1 =[ $shoot1, ogre_adnail2 ] {ai_face();}; +void() ogre_adnail2 =[ $shoot2, ogre_adnail3 ] {ai_face();}; +void() ogre_adnail3 =[ $shoot2, ogre_adnail4 ] {ai_face();}; +void() ogre_adnail4 =[ $shoot3, ogre_adnail5 ] {ai_face();OgreFireADNails();}; +void() ogre_adnail5 =[ $shoot4, ogre_adnail6 ] {}; +void() ogre_adnail6 =[ $shoot5, ogre_adnail7 ] {}; +void() ogre_adnail7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +/*====================================================================== + MELEE - Chainsaw +======================================================================*/ +void(float side, float dmgmultipler) chainsaw = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_damagebreakable(20); // Damage any breakables + if (!ai_checkmelee(self.meleerange)) return; // Too far away + + // Can the target bleed? - generate blood + if (!CanDamage (self.enemy, self)) return; + + ldmg = (random() + random() + random()) * (4*dmgmultipler); + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + SpawnMeatSpray (self, self.enemy, side); +}; + +//---------------------------------------------------------------------- +void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11);}; +void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);}; +void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);}; +void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);}; +void() ogre_swing5 =[ $swing5, ogre_swing6 ] {monster_footstep(FALSE); + ai_charge(9); chainsaw(0,1);self.angles_y = self.angles_y + random()*25;}; +void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0,1);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);}; +void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);}; +void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);}; + +//---------------------------------------------------------------------- +void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6);}; +void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);}; +void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);}; +void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);}; +void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);}; +void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0,1);}; +void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0,1);}; +void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0,1);}; +void() ogre_smash9 =[ $smash9, ogre_smash10 ] {monster_footstep(FALSE); ai_charge(13); chainsaw(0,1);}; +void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1,1);}; +void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0,1); +self.nextthink = self.nextthink + random()*0.2;}; // slight variation +void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge(0);}; +void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);}; +void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);}; + +//---------------------------------------------------------------------- +void() ogre_melee = +{ + sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); + if (random() > 0.5) ogre_smash1 (); + else ogre_swing1 (); +}; + +/*====================================================================== + Range - Grenades (uses generic attack function in projectiles.qc) +======================================================================*/ +void() ogre_shoot1 =[ $shoot1, ogre_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() ogre_shoot2 =[ $shoot2, ogre_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() ogre_shoot3 =[ $shoot2, ogre_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() ogre_shoot4 =[ $shoot3, ogre_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() ogre_shoot5 =[ $shoot4, ogre_shoot6 ] {}; +void() ogre_shoot6 =[ $shoot5, ogre_shoot7 ] {}; +void() ogre_shoot7 =[ $shoot6, ogre_run1 ] {ai_face();}; + + +/*====================================================================== + Range - Multi-Grenades (uses generic attack function in projectiles.qc) +======================================================================*/ +void() ogre_multi_shoot1 =[ $shoot1, ogre_multi_shoot2 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() ogre_multi_shoot2 =[ $shoot2, ogre_multi_shoot3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() ogre_multi_shoot3 =[ $shoot2, ogre_multi_shoot4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() ogre_multi_shoot4 =[ $shoot3, ogre_multi_shoot5 ] {ai_face(); + MonsterFireGrenade(self.origin, self.enemy.origin);}; +void() ogre_multi_shoot5 =[ $shoot4, ogre_multi_shoot6 ] {}; +void() ogre_multi_shoot6 =[ $shoot5, ogre_multi_shoot7 ] {}; +void() ogre_multi_shoot7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +//====================================================================== +// Lots of different pain animations (falling over is a classic +//====================================================================== +void() ogre_pain1 =[ $pain1, ogre_pain2 ] {}; +void() ogre_pain2 =[ $pain2, ogre_pain3 ] {}; +void() ogre_pain3 =[ $pain3, ogre_pain4 ] {}; +void() ogre_pain4 =[ $pain4, ogre_pain5 ] {}; +void() ogre_pain5 =[ $pain5, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_painb1 =[ $painb1, ogre_painb2 ] {}; +void() ogre_painb2 =[ $painb2, ogre_painb3 ] {}; +void() ogre_painb3 =[ $painb3, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_painc1 =[ $painc1, ogre_painc2 ] {}; +void() ogre_painc2 =[ $painc2, ogre_painc3 ] {}; +void() ogre_painc3 =[ $painc3, ogre_painc4 ] {}; +void() ogre_painc4 =[ $painc4, ogre_painc5 ] {}; +void() ogre_painc5 =[ $painc5, ogre_painc6 ] {}; +void() ogre_painc6 =[ $painc6, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_paind1 =[ $paind1, ogre_paind2 ] {}; +void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);}; +void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);}; +void() ogre_paind4 =[ $paind4, ogre_paind5 ] {monster_footstep(FALSE);ai_pain(4);}; +void() ogre_paind5 =[ $paind5, ogre_paind6 ] {}; +void() ogre_paind6 =[ $paind6, ogre_paind7 ] {}; +void() ogre_paind7 =[ $paind7, ogre_paind8 ] {}; +void() ogre_paind8 =[ $paind8, ogre_paind9 ] {}; +void() ogre_paind9 =[ $paind9, ogre_paind10 ] {}; +void() ogre_paind10=[ $paind10, ogre_paind11 ] {monster_footstep(FALSE);}; +void() ogre_paind11=[ $paind11, ogre_paind12 ] {}; +void() ogre_paind12=[ $paind12, ogre_paind13 ] {monster_footstep(FALSE);}; +void() ogre_paind13=[ $paind13, ogre_paind14 ] {}; +void() ogre_paind14=[ $paind14, ogre_paind15 ] {}; +void() ogre_paind15=[ $paind15, ogre_paind16 ] {}; +void() ogre_paind16=[ $paind16, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void() ogre_paine1 =[ $paine1, ogre_paine2 ] {}; +void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);}; +void() ogre_paine3 =[ $paine3, ogre_paine4 ] {monster_footstep(FALSE);ai_pain(9);}; +void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);}; +void() ogre_paine5 =[ $paine5, ogre_paine6 ] {}; +void() ogre_paine6 =[ $paine6, ogre_paine7 ] {}; +void() ogre_paine7 =[ $paine7, ogre_paine8 ] {}; +void() ogre_paine8 =[ $paine8, ogre_paine9 ] {}; +void() ogre_paine9 =[ $paine9, ogre_paine10 ] {}; +void() ogre_paine10=[ $paine10, ogre_paine11 ] {}; +void() ogre_paine11=[ $paine11, ogre_paine12 ] {}; +void() ogre_paine12=[ $paine12, ogre_paine13 ] {}; +void() ogre_paine13=[ $paine13, ogre_paine14 ] {}; +void() ogre_paine14=[ $paine14, ogre_paine15 ] {}; +void() ogre_paine15=[ $paine15, ogre_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) ogre_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.25) ogre_pain1 (); + else if (self.lip < 0.5) ogre_painb1 (); + else if (self.lip < 0.75) ogre_painc1 (); + else if (self.lip < 0.88) { + // Fall down to the ground + ogre_paind1 (); + self.pain_finished = time + 2; + } + else { + // Stagger backwards + ogre_paine1 (); + self.pain_finished = time + 2; + } + } + if (self.pain_check == 2) { + self.axhitme = 0; + if (random() < 0.5) { + self.pain_finished = time + 1.6; + ogre_paind1 (); // Fall to ground + } + else { + self.pain_finished = time + 1.5; + ogre_paine1 (); // Stagger backwards + } + } + } +}; + +//====================================================================== +// DIE Ogre DIE!?! +//====================================================================== +void() ogre_die1 =[ $death1, ogre_die2 ] {}; +void() ogre_die2 =[ $death2, ogre_die3 ] {monster_check_gib();}; +void() ogre_die3 =[ $death3, ogre_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() ogre_die4 =[ $death4, ogre_die5 ] {}; +void() ogre_die5 =[ $death5, ogre_die6 ] {}; +void() ogre_die6 =[ $death6, ogre_die7 ] {}; +void() ogre_die7 =[ $death7, ogre_die8 ] {}; +void() ogre_die8 =[ $death8, ogre_die9 ] {}; +void() ogre_die9 =[ $death9, ogre_die10 ] {}; +void() ogre_die10 =[ $death10, ogre_die11 ] {}; +void() ogre_die11 =[ $death11, ogre_die12 ] {}; +void() ogre_die12 =[ $death12, ogre_die13 ] {}; +void() ogre_die13 =[ $death13, ogre_die14 ] {monster_death_postcheck();}; +void() ogre_die14 =[ $death14, ogre_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {}; +void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {monster_check_gib();ai_forward(5);}; +void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);}; +void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);}; +void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);}; +void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);}; +void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {}; +void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {monster_death_postcheck();}; +void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() ogre_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + self.lip = random(); + if (self.lip < 0.5) ogre_die1(); + else ogre_bdie1(); + } +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() ogre_wakeup1 =[ $smash7, ogre_wakeup2] {monster_sightsound();}; +void() ogre_wakeup2 =[ $smash6, ogre_wakeup3] {}; +void() ogre_wakeup3 =[ $smash8, ogre_wakeup4] {}; +void() ogre_wakeup4 =[ $smash9, ogre_wakeup5 ] {}; +void() ogre_wakeup5 =[ $smash10, ogre_wakeup6 ] {}; +void() ogre_wakeup6 =[ $smash11, ogre_wakeup7 ] {}; +void() ogre_wakeup7 =[ $smash12, ogre_wakeup8 ] {}; +void() ogre_wakeup8 =[ $smash13, ogre_wakeup9 ] {}; +void() ogre_wakeup9 =[ $smash14, ogre_run1 ] {}; + +//====================================================================== +// From the crazy mind of Madfox, comes fishing ogre!?! +//====================================================================== +float OGREFISH_FISHY = 0; +float OGREFISH_FISHING = 19; +float OGREFISH_CATCH = 79; +float ANIMATION_OGREFLAP = 18; +float ANIMATION_OGREFISH = 59; +float ANIMATION_OGRECATCH = 25; + +//---------------------------------------------------------------------- +// Special idle animation - Flappy the fish waggles tail +//---------------------------------------------------------------------- +void() ogre_flappyfish = +{ + // If dead, no more updates + if (self.health < 1) return; + + self.nextthink = time + 0.1; + self.frame = OGREFISH_FISHY + self.walkframe; + + // Check for special frame conditions + if (self.walkframe == 0) + sound (self, CHAN_VOICE, "ogre/ogrefish_flappy.wav", 1, ATTN_NORM); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > ANIMATION_OGREFLAP) { + self.walkframe = 0; + self.think = self.th_altstand; + } + else self.think = ogre_flappyfish; +}; + +//---------------------------------------------------------------------- +// Special idle animation - Ogre finally catches something! +//---------------------------------------------------------------------- +void() ogre_catchfish = +{ + // If dead, no more updates + if (self.health < 1) return; + + self.nextthink = time + 0.1; + self.frame = OGREFISH_CATCH + self.walkframe; + + // Check for special frame conditions + if (self.walkframe == 6) + sound (self, CHAN_VOICE, "ogre/ogrefish_out.wav", 1, ATTN_NORM); + if (self.walkframe == 24) + sound (self, CHAN_VOICE, "ogre/ogrefish_in.wav", 1, ATTN_NORM); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > ANIMATION_OGRECATCH) { + self.walkframe = 0; + self.think = self.th_altstand; + } + else self.think = ogre_catchfish; +}; + +//---------------------------------------------------------------------- +void() ogre_fishing = +{ + // If dead, no more updates + if (self.health < 1) return; + + self.idlebusy = FALSE; + self.nextthink = time + 0.1; + self.frame = OGREFISH_FISHING + self.walkframe; + + // Check for fishing idle animations + if (self.walkframe == 0) { + self.lip = random(); + // Finally caught a fish? + if (self.lip < 0.1) { + self.think = ogre_catchfish; + self.idlebusy = TRUE; + } + // Flappy the fish gasping for air + else if (self.lip < 0.2) { + self.think = ogre_flappyfish; + self.idlebusy = TRUE; + } + // Classic ogre idle + water + else if (self.lip < 0.3) + sound (self, CHAN_VOICE, "ogre/ogrefish_idle.wav", 1, ATTN_NORM); + } + + if (self.idlebusy == FALSE) { + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > ANIMATION_OGREFISH) self.walkframe = 0; + self.think = ogre_fishing; + } +}; + +//---------------------------------------------------------------------- +// Re-using fall down pain animation +//---------------------------------------------------------------------- +void() ogre_fishd6 =[ $paind6, ogre_fishd7 ] {}; +void() ogre_fishd7 =[ $paind7, ogre_fishd8 ] {}; +void() ogre_fishd8 =[ $paind8, ogre_fishd9 ] {}; +void() ogre_fishd9 =[ $paind9, ogre_fishd10 ] {}; +void() ogre_fishd10=[ $paind10, ogre_fishd11 ] {monster_footstep(FALSE);}; +void() ogre_fishd11=[ $paind11, ogre_fishd12 ] {}; +void() ogre_fishd12=[ $paind12, ogre_fishd13 ] {monster_footstep(FALSE);}; +void() ogre_fishd13=[ $paind13, ogre_fishd14 ] {}; +void() ogre_fishd14=[ $paind14, ogre_fishd15 ] {}; +void() ogre_fishd15=[ $paind15, ogre_fishd16 ] {}; +void() ogre_fishd16=[ $paind16, ogre_run1 ] { + // Restore pain/damage functionality + self.flags = self.flags | FL_MONSTER; + self.health = self.max_health; + + // Fishing ogre is wearing a grenade bounce shirt! + self.takedamage = DAMAGE_YES; + self.noradiusdmg = FALSE; + self.use = monster_use; + + // Does not feel much pain and attacks more often + self.pain_flinch = 200; + self.pain_timeout = 3; + + // Restore animation/game logic + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_melee = ogre_melee; + self.th_missile = ogre_shoot1; + self.th_pain = ogre_pain; + self.th_die = ogre_die; +}; + +//---------------------------------------------------------------------- +void() ogre_fishwakeup = { + self.use = SUB_Null; // Stop re-triggering + monster_sightsound(); // Classic wakeup sound + + // Make sure no more pain or damage + self.takedamage = DAMAGE_NO; + self.pain_finished = time + 2; + + // Check for model in original ogre position + // This is to save the space for the returning ogre + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.solid = SOLID_NOT; + self.attachment.movetype = MOVETYPE_NONE; + } + + // Check for any wakeup triggers + if (self.target2 != "") { + trigger_strs(self.target2, self); + self.target2 = ""; + } + + // Shift ogre into pain (on floor) state + setmodel(self, self.mdl); + self.frame = $paind6; // Has to be set after model change + setorigin(self, self.pos1); + setsize (self, self.bbmins, self.bbmaxs); + ogre_fishd6(); +}; + +//---------------------------------------------------------------------- +void(entity inf, entity att, float dam) ogre_fishpain = {ogre_fishwakeup();}; +void() ogre_fishdie = {}; + +//---------------------------------------------------------------------- +void() ogre_fishsetup = +{ + // Take direct damage only and grenades bounce! + self.takedamage = DAMAGE_YES; + self.noradiusdmg = TRUE; + self.health = MEGADEATH; + self.use = ogre_fishwakeup; + + // Create a temporary entity to fill up space behind ogre + // Prevent anthing getting in the way when ogre wakes up + if (!self.attachment) { + self.attachment = spawn(); + setmodel(self.attachment, MODEL_EMPTY); + setorigin(self.attachment, self.origin); + setsize (self.attachment, self.bbmins, self.bbmaxs); + self.attachment.solid = SOLID_BBOX; + self.attachment.movetype = MOVETYPE_STEP; + } + + setmodel(self, self.weaponglow); // Setup fishing model pose + self.pos1 = self.origin; // Save current origin for later + + // Move ogre into fishing animation position + makevectors(self.angles); + self.pos2 = self.origin + attack_vector('36 0 -24'); + setorigin(self, self.pos2); + // Got to reset bounding box after model change + setsize (self, self.bbmins, self.bbmaxs); + self.walkframe = 0; + ogre_fishing(); +}; + +/*====================================================================== + QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_ogre_precache = +{ + self.mdl = "progs/ad171/mon_ogre.mdl"; // Rogue Ogre + self.headmdl = "progs/h_ogre.mdl"; + self.gib1mdl = "progs/ad171/w_chainsaw.mdl"; // Chainsaw + self.gib2mdl = "progs/ad171/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/ad171/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/ad171/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // Load additional models/sounds for nail ogre + if (self.spawnflags & MON_OGRE_NAIL) { + // Default attack - red glowing nails + precache_model (MODEL_PROJ_NGRED); + precache_sound("ogre/nail_fire.wav"); + // Default amount of nails to burst fire (5x9=45dmg) + if (self.attack_count < 1) self.attack_count = 5; + } + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdth.wav"); + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); + + precache_sound ("ogre/ogdrag.wav"); + precache_sound ("ogre/ogsawatk.wav"); + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); +}; + +//---------------------------------------------------------------------- +void() monster_ogre = +{ + if (deathmatch) { remove(self); return; } + + // Precache basic ogre models and sounds + monster_ogre_precache(); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; // Low pain flinch + self.pain_longanim = TRUE; // Can be chopped with shadow axe + self.steptype = FS_TYPESLOW; // Small sounding feet + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + self.no_zaware = TRUE; + + // Standard ogre health 200 with green+ option + if (self.health < 1) self.health = 200; + if (self.spawnflags & MON_OGRE_GREEN) { + if (self.deathstring == "") self.deathstring = " was destroyed by an armored Ogre\n"; + self.health = self.health + MON_OGRE_GRNUPG; + self.skin = 1; + } else { + if (self.deathstring == "") self.deathstring = " was destroyed by an Ogre\n"; + } + + if (self.spawnflags & OGRE_MULTI) { + if (!self.ammo_multi_rockets) self.ammo_multi_rockets = 2; + self.skin = 2; // multi overrides green skin, though health benefit still exists + self.th_missile = ogre_multi_shoot1; + } else { + // Always not zware + if (!self.ammo_rockets) self.ammo_rockets = 2; // Default ammo drop + + // Switch attack types + if (self.spawnflags & MON_OGRE_NAIL) self.th_missile = ogre_adnail1; + else self.th_missile = ogre_shoot1; + } + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_melee = ogre_melee; + + self.th_pain = ogre_pain; + self.th_die = ogre_die; + self.th_wakeup = ogre_wakeup1; + + self.classtype = CT_MONOGRE; // Old style ogre + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +//---------------------------------------------------------------------- +void() monster_ogre_marksman = { + if (self.deathstring == "") self.deathstring = " was blasted by a marksman Ogre\n"; + monster_ogre (); +}; + +//---------------------------------------------------------------------- +void() monster_ogre_fishing = +{ + if (deathmatch) { remove(self); return; } + + // Precache basic ogre models and sounds + monster_ogre_precache(); + + // Extra fishing ogre precache stuff + self.weaponglow = "progs/ad171/mon_ogrefish.mdl"; + precache_model (self.weaponglow); + precache_sound ("ogre/ogrefish_out.wav"); + precache_sound ("ogre/ogrefish_in.wav"); + precache_sound ("ogre/ogrefish_idle.wav"); + precache_sound ("ogre/ogrefish_flappy.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 1; // Pain is the wakeup trigger + self.pain_longanim = FALSE; // Cannot be chopped with shadow axe + self.steptype = FS_TYPESLOW; // Small sounding feet + self.no_zaware = FALSE; // Fishing ogre has perfect aim! + self.bouncegrenade = TRUE; // Grenades bounce off! + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + self.exactskin = 0; // Skin defined by spawnflag + self.noinfighting = TRUE; // No infighting + self.pain_ignore = TRUE; // Will not wake up from monsters + self.movespeed = 0; // This is not a turret + self.lip = 0; + if (self.deathstring == "") self.deathstring = " was reeled in by a Fishing Ogre\n"; + + // Remove spawnflag options not needed for this monster + if (self.spawnflags & MON_OGRE_GREEN) self.lip = self.lip | MON_OGRE_GREEN; + if (self.spawnflags & MON_SPAWN_NOGFX) self.lip = self.lip | MON_SPAWN_NOGFX; + if (self.spawnflags & MON_SPAWN_DELAY) self.lip = self.lip | MON_SPAWN_DELAY; + self.spawnflags = self.lip; + + // Special event monster has unique HP setup + if (self.spawnflags & MON_OGRE_GREEN) { + self.ammo_rockets = 6; // Tons of rockets! + self.health = 350; // Much stronger + self.skin = 1; // Green (Rogue) skin + } + else { + self.ammo_rockets = 4; // More rockets than fish! + self.health = 150; // Lower HP than regular + } + + // Fishing ogre can never uses nails, grenades only + self.spawnflags = self.spawnflags - (self.spawnflags & MON_OGRE_NAIL); + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0.5; // Rocket resistance + self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = self.th_walk = self.th_run = ogre_fishsetup; + self.th_altstand = ogre_fishing; + self.th_pain = ogre_fishpain; + self.th_die = ogre_fishdie; + + self.classtype = CT_MONOGREFISH; + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +void() monster_ogre_multi = { + self.spawnflags = self.spawnflags | OGRE_MULTI; + monster_ogre(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_ogreflak.qc b/QC_other/QC_keep/mon_ogreflak.qc new file mode 100644 index 00000000..952eec84 --- /dev/null +++ b/QC_other/QC_keep/mon_ogreflak.qc @@ -0,0 +1,256 @@ +// Flak ogre - from Kinn +float MONOGRE_LAVAFLAK = 4; + +$cd id1/models/ogre_c +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame painb1 painb2 painb3 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 paind14 paind15 paind16 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 death12 +$frame death13 death14 + +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 + +//BDW 31/08/00 - evil, nasty red-hot nail cluster-bomb attack... +void() FlakDoDamage = { + self.origin = self.oldenemy.origin + self.oldorigin; //get correct gib direction + T_Damage(self.oldenemy, self, self.owner, self.oldenemy.spikecount,DAMARMOR); + self.oldenemy.spikecount = 0; + remove(self); +}; + +void() FlakTouch = { + if (other.solid == SOLID_TRIGGER) + return; + + if (pointcontents(self.origin) == CONTENT_SKY) { + remove(self); + return; + } + + // hit something that bleeds + if (other.takedamage) { + spawn_touchblood(self, other, self.dmg); + sound(self, CHAN_VOICE, "weapons/skotch.wav", 1, ATTN_NORM); + + // not the first one... + if (other.spikecount) { + other.spikecount = other.spikecount + self.dmg; + remove(self); + return; + } + + // the first one... + other.spikecount = self.dmg; + + // stick around for a little while... + self.velocity = '0 0 0'; + self.solid = SOLID_NOT; + self.touch = SUB_Null; + self.model = string_null; + self.oldorigin = self.origin - other.origin; //displacement from enemy origin (its gonna move next frame) + self.oldenemy = other; + self.think = FlakDoDamage; + self.nextthink = time + 0.05; + return; + } + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_SUPERSPIKE); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + //bit of a hack + if (self.spawnflags & MONSTER_FLAK_OGRE) { + remove(self); + return; + } + + self.dmg = self.dmg - 5; //gets weaker with each bounce. also stops them getting stuck in world. + if (self.dmg <= 0) { + remove(self); + return; + } + self.velocity = self.velocity * 0.5; //reduce crazy ricochets + self.movetype = MOVETYPE_BOUNCE; +}; + +void() BDW_OgreFireFlak = { + local float flakcount; + local vector dir, ang; + local entity flak; + + flakcount = 8; + self.effects = self.effects | EF_MUZZLEFLASH; + if (self.spawnflags & MONOGRE_LAVAFLAK) { + sound(self, CHAN_WEAPON, "ogre/wnalfire_lava.wav", 1, ATTN_NORM); + } else { + sound(self, CHAN_WEAPON, "ogre/wnalfire.wav", 1, ATTN_NORM); + } + ang = vectoangles(self.enemy.origin - self.origin); + makevectors(ang); + + while (flakcount > 0) { + //tighter spread... + dir = v_forward*10 + crandom()*v_right + crandom()*v_up; + dir = normalize(dir); + dir_z = dir_z * -1; + dir = dir*800; + + flak = spawn(); + flak.owner = self; + //flymissile is a bit too all-seeing for this gun... + flak.movetype = MOVETYPE_FLY; + //flak.movetype = MOVETYPE_FLYMISSILE; + flak.solid = SOLID_BBOX; + flak.flags = 8192; + flak.touch = FlakTouch; + flak.angles = vectoangles(dir); + flak.velocity = dir; + flak.think = SUB_Remove; + flak.nextthink = time + 6; + + flak.spawnflags = MONSTER_FLAK_OGRE; //this is a hack to tell FlakTouch that it came from an ogre + + if (self.spawnflags & MONOGRE_LAVAFLAK) { + setmodel(flak, "progs/flak.mdl"); + flak.dmg = 8; + } else { + setmodel(flak, "progs/spike.mdl"); + flak.dmg = 4; + } + setsize(flak, '0 0 0', '0 0 0'); + setorigin(flak, self.origin + '0 0 16'); + flakcount = flakcount - 1; + } +}; + +/*====================================================================== + Range - Flak (uses nails) +======================================================================*/ +void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();}; +void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();}; +void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();}; +void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();BDW_OgreFireFlak();}; +void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();}; +void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();}; +void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +void() monster_ogre_spikeshooter = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_ogre.mdl"; // Rogue Ogre + self.headmdl = "progs/h_ogre.mdl"; + self.gib1mdl = "progs/ad171/w_chainsaw.mdl"; // Chainsaw + self.gib2mdl = "progs/ad171/gib_ogfoot1.mdl"; // Left foot + self.gib3mdl = "progs/ad171/gib_ogfoot2.mdl"; // Right foot + self.gib4mdl = "progs/ad171/w_ogregl.mdl"; // Grenade Launcher + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_GRENADE); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1mdl = self.gib4mdl; + + self.idle_sound = "ogre/ogidle.wav"; + precache_sound (self.idle_sound); + self.idle_soundcom = "ogre/ogidle2.wav"; + precache_sound (self.idle_soundcom); + + precache_sound ("ogre/ogdth.wav"); + self.pain_sound = "ogre/ogpain1.wav"; + precache_sound (self.pain_sound); + + precache_sound ("ogre/ogdrag.wav"); + precache_sound ("ogre/ogsawatk.wav"); + + self.sight_sound = "ogre/ogwake.wav"; + precache_sound (self.sight_sound); + + precache_model("progs/flak.mdl"); + precache_model("progs/spike.mdl"); + precache_sound("ogre/wnalfire.wav"); + precache_sound("ogre/wnalfire_lava.wav"); + precache_sound("weapons/skotch.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + self.gibhealth = -80; + self.gibbed = FALSE; + self.pain_flinch = 30; + self.pain_longanim = TRUE; + self.steptype = FS_TYPESLOW; + self.meleerange = MONAI_MELEEOGRE; // Chainsaw range + self.no_zaware = FALSE; + self.skin = 1; + if (self.health < 1) self.health = 200; + if (self.spawnflags & MONOGRE_LAVAFLAK) { + self.health = self.health + MON_OGRE_GRNUPG; + } + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = OgreCheckAttack; + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_die = ogre_die; + self.th_melee = ogre_melee; + self.th_missile = ogre_nail1; + self.th_pain = ogre_pain; + self.th_wakeup = ogre_wakeup1; + if (self.deathstring == "") self.deathstring = " was skotched by a Flak Ogre\n"; + + self.ammo_nails = 10; + self.classtype = CT_MONOGRE; // Old style ogres + self.classgroup = CG_OGRE; // One big happy ogre family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +void () monster_ogre_flak = { + monster_ogre_spikeshooter(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_polyp.qc b/QC_other/QC_keep/mon_polyp.qc new file mode 100644 index 00000000..c6994e3c --- /dev/null +++ b/QC_other/QC_keep/mon_polyp.qc @@ -0,0 +1,606 @@ +void () polyp_float1; +void (entity inflictor, entity attacker, float damage) polyp_wake1; +void () polyp_wake1_prethink = {local entity blank; local float blankf; polyp_wake1(blank,blank,blankf); }; +void (entity inflictor, entity attacker, float damage) polyp_pain; +void () polyp_walkfly1; +void () polyp_visible1; +void () polyp_missile; +void () polyp_die1; +void () polyp_idie1; +void () polyp_jump5; + +void() polypcheckdist = { + local vector dist; + local float d; + local vector oldorg; + local vector reqvel; + local float speedmulti; + local float d2; + + oldorg = self.origin; + self.velocity = VEC_ORIGIN; + self.polyp_speed = self.polyp_speed * 0.95; + if (self.polyp_speed < 14) + self.polyp_speed = 35; + + self.attack_state = AS_STRAIGHT; + dist = self.enemy.origin - self.origin; + dist_z = 0; + d = vlen(dist); + d2 = 0; + if (d < 200 && visible(self.enemy)) { + self.attack_state = AS_SLIDING; + ai_run(self.polyp_speed * -1.5); + d2 = fabs(self.polyp_speed * -1.5) + 2; + } else { + if (d < 200 && !visible(self.enemy)) { + ai_run(self.polyp_speed); + d2 = fabs(self.polyp_speed); + } else { + if (d > 200 && d <= 400) { + ai_run(self.polyp_speed * (d / 400)); + self.attack_state = AS_SLIDING; + d2 = fabs(self.polyp_speed * (d / 400)) + 2; + ai_run(self.polyp_speed); + self.attack_state = AS_STRAIGHT; + d2 = d2 + fabs(self.polyp_speed); + } else { + if (d >= 400) { + ai_run(self.polyp_speed * 2); + d2 = fabs(self.polyp_speed * 2); + } + } + } + } + d = vlen(self.origin - oldorg); + if (d <= d2) { + self.movetype = MOVETYPE_FLY; + speedmulti = vlen(self.origin - oldorg); + reqvel = normalize(self.origin - oldorg) * speedmulti * TE_WIZSPIKE; + setorigin(self, oldorg); + self.velocity = reqvel; + } +}; + +void() PolypFoundTarget = { + if (self.enemy.classname == "player") + { + sight_entity = self; + sight_entity_time = time; + } + self.show_hostile = time + 1; + self.goalentity = self.enemy; + //SightSound(); + if (self.startonground == 1) { + self.think = polyp_wake1_prethink; + } else { + self.think = self.th_run; + } + self.nextthink = time + 0.1; +}; + +float() PolypFindTarget = { + local entity client; + local float r; + + if (sight_entity_time >= time - 0.1 && !(self.spawnflags & AS_MELEE)) { + client = sight_entity; + if (client.enemy == self.enemy) + return 0; + } + else + { + client = checkclient(); + if (!client) + { + return 0; + } + } + if (client == self.enemy) + { + return 0; + } + if (client.flags & FL_NOTARGET) + { + return 0; + } + if (client.items & IT_INVISIBILITY) + { + return 0; + } + r = range(client); + if (r == RANGE_FAR) + { + return 0; + } + if (!visible(client)) + { + return 0; + } + if (r == RANGE_NEAR) + { + if (client.show_hostile < time && !infront(client)) + { + return 0; + } + } + else + { + if (r == RANGE_MID) + { + if (!infront(client)) + { + return 0; + } + } + } + self.enemy = client; + if (self.enemy.classname != "player") + { + self.enemy = self.enemy.enemy; + if (self.enemy.classname != "player") + { + self.enemy = world; + return 0; + } + } + PolypFoundTarget(); + return 1; +}; + +void() ai_polyp_stand = +{ + if (PolypFindTarget()) + { + return; + } +}; + +void(float dist) ai_polyp_walk = { + movedist = dist; + if (PolypFindTarget()) + return; + + movetogoal(dist); +}; + +void() ai_polyp_turn = { + if (PolypFindTarget()) + return; + + ChangeYaw(); +}; + +void() polyp_stand0 = [10, polyp_stand1] +{ + setmodel(self, "progs/polyp.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.view_ofs = '0 0 -8'; + self.th_stand = polyp_float1; + self.origin_z = self.origin_z + 1; + droptofloor(); +}; + +void() polyp_stand1 = [0, polyp_stand2] {ai_polyp_stand();}; +void() polyp_stand2 = [1, polyp_stand3] {ai_polyp_stand();}; +void() polyp_stand3 = [2, polyp_stand4] {ai_polyp_stand();}; +void() polyp_stand4 = [3, polyp_stand5] {ai_polyp_stand();}; +void() polyp_stand5 = [4, polyp_stand6] {ai_polyp_stand();}; +void() polyp_stand6 = [5, polyp_stand7] {ai_polyp_stand();}; +void() polyp_stand7 = [6, polyp_stand8] {ai_polyp_stand();}; +void() polyp_stand8 = [7, polyp_stand9] {ai_polyp_stand();}; +void() polyp_stand9 = [8, polyp_stand10] {ai_polyp_stand();}; +void() polyp_stand10 = [9, polyp_stand11] {ai_polyp_stand();}; +void() polyp_stand11 = [10, polyp_stand1] {ai_polyp_stand();}; + +void(entity inflictor, entity attacker, float damage) polyp_wake1 = [133, polyp_wake2] {self.th_pain = polyp_pain;}; +void() polyp_wake2 = [134, polyp_wake3] {}; +void() polyp_wake3 = [135, polyp_wake4] {}; +void() polyp_wake4 = [136, polyp_wake5] {}; +void() polyp_wake5 = [137, polyp_wake6] {}; +void() polyp_wake6 = [138, polyp_wake7] {self.movetype = MOVETYPE_FLY;self.flags = self.flags - (self.flags & FL_ONGROUND);self.velocity = '0 0 25';}; +void() polyp_wake7 = [139, polyp_wake8] {self.velocity = '0 0 50';}; +void() polyp_wake8 = [140, polyp_wake9] {self.velocity = '0 0 175';}; +void() polyp_wake9 = [141, polyp_wake10] {self.velocity = '0 0 125';}; +void() polyp_wake10 = [142, polyp_wake11] {self.velocity = '0 0 75';}; +void() polyp_wake11 = [143, polyp_wake12] {self.velocity = '0 0 50';}; +void() polyp_wake12 = [144, polyp_wake13] {self.velocity = '0 0 25';}; +void() polyp_wake13 = [145, polyp_wake14] {self.velocity = '0 0 15';}; +void() polyp_wake14 = [146, polyp_hover1] { + self.count = time + 2 + 1 * random(); + self.movetype = MOVETYPE_STEP; + self.velocity = VEC_ORIGIN; + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.th_pain = polyp_pain; + self.th_walk = polyp_walkfly1; + self.flags = self.flags | FL_FLY; +}; + +void() polyp_float1 = [153, polyp_float2] { + setmodel(self, "progs/polyp.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.count = time + 2 + 1 * random(); + ai_stand(); + if (random() < 0.05) + sound(self, CHAN_VOICE, "polyp/idle.wav", 1, AS_MELEE); +}; +void() polyp_float2 = [154, polyp_float3] {self.count = time + 2 + 1 * random();ai_stand();}; +void() polyp_float3 = [155, polyp_float4] {self.count = time + 2 + 1 * random();ai_stand();}; +void() polyp_float4 = [156, polyp_float1] {self.count = time + 2 + 1 * random();ai_stand();}; + +void() polyp_walk1 = [11, polyp_walk2] { + self.velocity = VEC_ORIGIN; + ai_turn(); + self.flags = self.flags - (self.flags & FL_FLY); + setmodel(self, "progs/polyp.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.velocity = VEC_ORIGIN; +}; +void() polyp_walk2 = [12, polyp_walk3] { ai_polyp_turn(); }; +void() polyp_walk3 = [13, polyp_walk4] { ai_polyp_turn(); }; +void() polyp_walk4 = [14, polyp_walk5] { ai_polyp_turn(); }; +void() polyp_walk5 = [15, polyp_walk6] { ai_polyp_turn(); }; +void() polyp_walk6 = [16, polyp_walk7] { ai_polyp_turn(); }; +void() polyp_walk7 = [17, polyp_walk8] { ai_polyp_turn(); }; +void() polyp_walk8 = [18, polyp_walk9] { ai_polyp_turn(); }; +void() polyp_walk9 = [19, polyp_walk10] { ai_polyp_turn(); }; +void() polyp_walk10 = [20, polyp_walk11] { ai_polyp_turn(); }; +void() polyp_walk11 = [21, polyp_walk12] { ai_polyp_walk(2); }; +void() polyp_walk12 = [22, polyp_walk13] { ai_polyp_walk(2); }; +void() polyp_walk13 = [23, polyp_walk14] { ai_polyp_walk(2); }; +void() polyp_walk14 = [24, polyp_walk15] { ai_polyp_walk(2); }; +void() polyp_walk15 = [25, polyp_walk16]{ ai_polyp_walk(2); }; +void() polyp_walk16 = [26, polyp_walk17]{ ai_polyp_walk(2); }; +void() polyp_walk17 = [27, polyp_walk18]{ ai_polyp_walk(2); }; +void() polyp_walk18 = [28, polyp_walk19]{ ai_polyp_walk(2); }; +void() polyp_walk19 = [29, polyp_walk20]{ ai_polyp_walk(2); }; +void() polyp_walk20 = [30, polyp_walk21]{ ai_polyp_walk(2); }; +void() polyp_walk21 = [31, polyp_walk22]{ ai_polyp_walk(2); }; +void() polyp_walk22 = [32, polyp_walk23]{ ai_polyp_walk(2); }; +void() polyp_walk23 = [33, polyp_walk24]{ ai_polyp_walk(2); }; +void() polyp_walk24 = [34, polyp_walk25] { ai_polyp_walk(2); }; +void() polyp_walk25 = [35, polyp_walk1] { ai_polyp_walk(2); }; + +void() polyp_walkfly1 = [153, polyp_walkfly2] { + ai_walkfly(6); + setmodel(self, "progs/polyp.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.velocity = VEC_ORIGIN; +}; +void() polyp_walkfly2 = [154, polyp_walkfly3] { ai_walkfly(6); }; +void() polyp_walkfly3 = [155, polyp_walkfly4] { ai_walkfly(6); }; +void() polyp_walkfly4 = [156, polyp_walkfly1] { ai_walkfly(6); }; + +void() polyp_invisible_sound = { + if (self.ltime < time) { + sound(self, CHAN_VOICE, "polyp/idle2.wav", 1, 1.5); + self.ltime = time + 1; + } + return; +}; + +void() polyp_ihover0 = [0, polyp_ihover1] { + setmodel(self, "progs/s_null.spr"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + polypcheckdist(); +}; +void() polyp_ihover1 = [0, polyp_ihover2] { + polypcheckdist(); + polyp_invisible_sound(); + if (self.count < time) + self.think = polyp_visible1; +}; +void() polyp_ihover2 = [0, polyp_ihover3] {polypcheckdist();polyp_invisible_sound();}; +void() polyp_ihover3 = [0, polyp_ihover4] {polypcheckdist();polyp_invisible_sound();}; +void() polyp_ihover4 = [0, polyp_ihover1]{polypcheckdist();polyp_invisible_sound();}; + +void() polyp_visible1 = [0, polyp_visible2] { + local vector org; + + self.statevis = 0; + org = self.origin; + sound(self, CHAN_AUTO, "polyp/decloak.wav", 1, ATTN_NORM); + setmodel(self, "progs/polyp_t3.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.count = time + 2 + 2 * random(); + self.th_missile = polyp_missile; + self.th_die = polyp_die1; + self.th_run = polyp_hover1; +}; +void() polyp_visible2 = [0, polyp_visible3] {setmodel(self, "progs/polyp_t2.mdl");setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);}; +void() polyp_visible3 = [0, polyp_hover0a]{setmodel(self, "progs/polyp_t1.mdl");setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);}; + +void() polyp_invisible = [0, polyp_invisible2] { + local vector org; + + self.statevis = 1; + org = self.origin; + sound(self, CHAN_AUTO, "polyp/cloak.wav", 1, ATTN_NORM); + setmodel(self, "progs/polyp_t1.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + self.th_missile = SUB_Null; + self.th_run = SUB_Null; + self.th_die = polyp_idie1; + self.count = time + 2 + 2 * random(); +}; +void() polyp_invisible2 = [0, polyp_invisible3]{setmodel(self, "progs/polyp_t2.mdl");setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);}; +void() polyp_invisible3 = [0, polyp_ihover0]{setmodel(self, "progs/polyp_t3.mdl");setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);}; + +void() polyp_hover0 = [156, polyp_hover1] { + local vector dist; + local float d; + + self.count = time + 2 + 2 * random(); + polypcheckdist(); + dist = self.enemy.origin - self.origin; + d = vlen(dist); + if (d > 256) + self.count = 0; +}; + +void() polyp_hover0a = [153, polyp_hover2] { + setmodel(self, "progs/polyp.mdl"); + setsize(self, VEC_HULL_MIN, VEC_HULL_MAX); + polypcheckdist(); + if (self.count < time) + self.think = polyp_invisible; +}; + +void() polyp_hover1 = [153, polyp_hover2] { + if (self.flags & FL_ONGROUND) + self.flags = self.flags - (self.flags & FL_ONGROUND); + + polypcheckdist(); + if (self.count < time) + self.think = polyp_invisible; +}; +void() polyp_hover2 = [154, polyp_hover3] { polypcheckdist(); }; +void() polyp_hover3 = [155, polyp_hover4] { polypcheckdist(); }; +void() polyp_hover4 = [156, polyp_hover1] { polypcheckdist(); }; + +void() airthink = { + local entity head; + + self.nextthink = time + 0.1; + self.cnt = self.cnt + 1; + if (self.cnt >= 5) { + self.think = SUB_Remove; + } else { + self.think = airthink; + } + head = findradius(self.origin, self.cnt * 22); + while (head) { + if (head.takedamage == DAMAGE_AIM && visible(head)) + T_Damage(head, self, self.owner, 1,DAMARMOR); + + head = head.chain; + } +}; + +void() airtouch = { + WriteByte(0, SVC_TEMPENTITY); + WriteByte(0, TE_GUNSHOT); + WriteCoord(0, self.origin_x); + WriteCoord(0, self.origin_y); + WriteCoord(0, self.origin_z); + if (other.takedamage == DAMAGE_AIM) { + other.velocity = other.velocity + self.velocity * 0.4 + '0 0 70'; + if (random() < 0.4) + T_Damage(other, self, self.owner, 1,DAMARMOR); + } + SUB_Remove(); + return; +}; + +void() polyp_air = { + local entity missile; + local vector vec; + + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "airchunk"; + vec = normalize(self.enemy.origin - self.origin); + missile.velocity = normalize(vec); + missile.velocity = missile.velocity * 750; + missile.angles = vectoangles(self.enemy.origin - self.origin); + missile.touch = airtouch; + missile.nextthink = time + 0.1; + missile.think = airthink; + setmodel(missile, "progs/air.mdl"); + setsize(missile, VEC_ORIGIN, VEC_ORIGIN); + setorigin(missile, self.origin + v_forward * SECRET_NO_SHOOT + '0 0 16'); +}; + +void() polyp_air1 = [153, polyp_air2] { + if (self.count < time) + self.think = polyp_invisible; + + ai_face(); + polyp_air(); + sound(self, CHAN_WEAPON, "polyp/blast.wav", 1, ATTN_NORM); +}; +void() polyp_air2 = [154, polyp_air3] {ai_face();polyp_air();}; +void() polyp_air3 = [155, polyp_air4] {ai_face();polyp_air();}; +void() polyp_air4 = [156, polyp_air5] {ai_face();polyp_air();}; +void() polyp_air5 = [155, polyp_hover1] {ai_face();polyp_air();}; + +void() polyp_fly1 = [153, polyp_fly2] {}; +void() polyp_fly2 = [154, polyp_fly3] {}; +void() polyp_fly3 = [155, polyp_fly4] {}; +void() polyp_fly4 = [156, polyp_fly1] { + self.cnt = self.cnt + 1; + if (self.cnt == SECRET_1ST_DOWN) + polyp_jump5(); +}; + +void() polyp_jump1 = [147, polyp_jump2] {ai_face();}; +void() polyp_jump2 = [148, polyp_jump3] {ai_face();}; +void() polyp_jump3 = [149, polyp_jump4]{ai_face();}; +void() polyp_jump4 = [150, polyp_jump5]{ai_face();}; +void() polyp_jump5 = [151, polyp_jump6] { + self.movetype = MOVETYPE_BOUNCE; + self.touch = Tar_JumpTouch; + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 600 + '0 0 200'; + self.velocity_z = self.velocity_z + random() * 150; + if (self.flags & FL_ONGROUND) + self.flags = self.flags - FL_ONGROUND; + + self.cnt = 0; +}; +void() polyp_jump6 = [152, polyp_fly1] {}; + +void() pgibtouch = { + self.think = SUB_Remove; + self.nextthink = time + random() * 5; + if (other.takedamage == DAMAGE_AIM) { + sound(self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + T_Damage(other, self, self.owner.owner, 5,DAMARMOR); + SUB_Remove(); + } +}; + +void(string gibname, float dm) throwpolypgib = { + local entity new; + + new = spawn(); + new.origin = self.origin; + setmodel(new, gibname); + setsize(new, VEC_ORIGIN, VEC_ORIGIN); + new.classname = "polypgib"; + new.velocity = VelocityForDamage(dm); + new.movetype = MOVETYPE_BOUNCE; + new.solid = SOLID_BBOX; + new.avelocity_x = random() * 600; + new.avelocity_y = random() * 600; + new.avelocity_z = random() * 600; + new.think = SUB_Remove; + new.nextthink = time + 5 + random() * 5; + new.touch = pgibtouch; + new.frame = 0; +}; + +void() polyp_die1 = [157, polyp_die2] { + self.nextthink = time + 0.2; + self.velocity = VEC_ORIGIN; +}; +void() polyp_die2 = [157, polyp_hover1] { + sound(self, CHAN_VOICE, "polyp/gibsplt1.wav", 1, ATTN_NORM); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -50); + throwpolypgib("progs/polypgib.mdl", -50); + throwpolypgib("progs/polypgib.mdl", -60); + throwpolypgib("progs/polypgib.mdl", -60); + throwpolypgib("progs/polypgib.mdl", -75); + throwpolypgib("progs/polypgib.mdl", -75); + SUB_Remove(); +}; + +void() polyp_idie1 = [0, polyp_idie2] { + self.takedamage = DAMAGE_NO; + self.nextthink = time + 0.2; + self.velocity = VEC_ORIGIN; +}; +void() polyp_idie2 = [0, polyp_hover1] { + sound(self, CHAN_VOICE, "polyp/gibsplt1.wav", 1, ATTN_NORM); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -40); + throwpolypgib("progs/polypgib.mdl", -50); + throwpolypgib("progs/polypgib.mdl", -50); + throwpolypgib("progs/polypgib.mdl", -60); + throwpolypgib("progs/polypgib.mdl", -60); + throwpolypgib("progs/polypgib.mdl", -75); + throwpolypgib("progs/polypgib.mdl", -75); + SUB_Remove(); +}; + +void() polyp_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + self.takedamage = DAMAGE_NO; + if (random() < 0.5) + polyp_die1(); + else + polyp_idie1(); +}; + +void() polyp_missile = { + if (self.fly_sound > time) + return; + + if (random() < 0.3) + return; + + self.fly_sound = time + 1.4; + polyp_air1(); +}; + +void(entity inflictor, entity attacker, float damage) polyp_pain = { + if (self.statevis == 1) { + polyp_visible1(); + } else { + return; + } +}; + +void() monster_polyp = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/polyp.mdl"; + precache_model("progs/polyp.mdl"); + precache_model("progs/polyp_t1.mdl"); + precache_model("progs/polyp_t2.mdl"); + precache_model("progs/polyp_t3.mdl"); + precache_model("progs/s_null.spr"); + precache_model("progs/polypgib.mdl"); + precache_model("progs/air.mdl"); + precache_sound("polyp/idle2.wav"); + precache_sound("zombie/z_hit.wav"); + precache_sound("polyp/cloak.wav"); + precache_sound("polyp/decloak.wav"); + precache_sound("polyp/gibsplt1.wav"); + precache_sound("polyp/blast.wav"); + precache_sound("polyp/sight.wav"); + precache_sound("polyp/idle.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + if (self.health < 1) self.health = 150; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 20; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was popped by a polyp\n"; + + self.th_run = polyp_hover0; + self.th_missile = polyp_missile; + self.th_die = polyp_die1; + self.yaw_speed = SVC_INTERMISSION; + if (self.startonground == 1) { + self.th_pain = polyp_wake1; + self.th_stand = polyp_stand0; + self.th_walk = polyp_walk1; + } else { + self.th_pain = polyp_pain; + self.th_stand = polyp_float1; + self.th_walk = polyp_walkfly1; + } + + self.classtype = CT_MONPOLYP; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEFLY; + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_pyro.qc b/QC_other/QC_keep/mon_pyro.qc new file mode 100644 index 00000000..0d8b83a0 --- /dev/null +++ b/QC_other/QC_keep/mon_pyro.qc @@ -0,0 +1,487 @@ +/*============================================================================= +PYRO - Originally from Rubicon2 by John Fitzgibbons +FUMIGATOR - Green/Poison version of the Pyro +==============================================================================*/ +$cd id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 attack10 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +$frame fdeath1 fdeath2 fdeath3 fdeath4 fdeath5 fdeath6 fdeath7 fdeath8 +$frame fdeath9 fdeath10 fdeath11 + +$frame paina1 paina2 paina3 paina4 + +$frame painb1 painb2 painb3 painb4 painb5 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 + +//---------------------------------------------------------------------- +void() pyro_soundreset = +{ + //turn off flame sound + if (self.attack_finished > time) + sound (self, CHAN_WEAPON, self.noise4, 1, ATTN_NORM); + //play sound anyway to be sure the channel is silent + else sound (self, CHAN_WEAPON, SOUND_EMPTY, 0, ATTN_NORM); +}; + +//============================================================================ +void() pyro_stand1 =[ $stand1, pyro_stand2 ] {monster_idle_sound(); ai_stand();}; +void() pyro_stand2 =[ $stand2, pyro_stand3 ] {ai_stand();}; +void() pyro_stand3 =[ $stand3, pyro_stand4 ] {ai_stand();}; +void() pyro_stand4 =[ $stand4, pyro_stand5 ] {ai_stand();}; +void() pyro_stand5 =[ $stand5, pyro_stand6 ] {ai_stand();}; +void() pyro_stand6 =[ $stand6, pyro_stand7 ] {ai_stand();}; +void() pyro_stand7 =[ $stand7, pyro_stand1 ] {ai_stand();}; + +//============================================================================ +void() pyro_walk1 =[ $walk1, pyro_walk2 ] {monster_idle_sound();ai_walk(2);}; +void() pyro_walk2 =[ $walk2, pyro_walk3 ] {monster_footstep(FALSE); ai_walk(4);}; +void() pyro_walk3 =[ $walk3, pyro_walk4 ] {ai_walk(4);}; +void() pyro_walk4 =[ $walk4, pyro_walk5 ] {ai_walk(3);}; +void() pyro_walk5 =[ $walk5, pyro_walk6 ] {ai_walk(1);}; +void() pyro_walk6 =[ $walk6, pyro_walk7 ] {ai_walk(2);}; +void() pyro_walk7 =[ $walk7, pyro_walk8 ] {ai_walk(2);}; +void() pyro_walk8 =[ $walk8, pyro_walk9 ] {ai_walk(1);}; +void() pyro_walk9 =[ $walk9, pyro_walk10 ] {ai_walk(2);}; +void() pyro_walk10 =[ $walk10, pyro_walk11 ] {monster_footstep(FALSE); ai_walk(4);}; +void() pyro_walk11 =[ $walk11, pyro_walk12 ] {ai_walk(4);}; +void() pyro_walk12 =[ $walk12, pyro_walk13 ] {ai_walk(1);}; +void() pyro_walk13 =[ $walk13, pyro_walk14 ] {ai_walk(2);}; +void() pyro_walk14 =[ $walk14, pyro_walk15 ] {ai_walk(3);}; +void() pyro_walk15 =[ $walk15, pyro_walk16 ] {ai_walk(4);}; +void() pyro_walk16 =[ $walk16, pyro_walk1 ] {ai_walk(2);}; + +//============================================================================ +float pyro_RUN_SPEED = 1.5; +void() pyro_run1 =[ $run1, pyro_run2 ] {monster_idle_sound(); ai_run(18 * pyro_RUN_SPEED);}; +void() pyro_run2 =[ $run2, pyro_run3 ] {ai_run(14 * pyro_RUN_SPEED);}; +void() pyro_run3 =[ $run3, pyro_run4 ] {ai_run(7 * pyro_RUN_SPEED);}; +void() pyro_run4 =[ $run4, pyro_run5 ] {ai_run(12 * pyro_RUN_SPEED);}; +void() pyro_run5 =[ $run5, pyro_run6 ] {ai_run(14 * pyro_RUN_SPEED);}; +void() pyro_run6 =[ $run6, pyro_run7 ] {ai_run(14 * pyro_RUN_SPEED);}; +void() pyro_run7 =[ $run7, pyro_run8 ] {ai_run(7 * pyro_RUN_SPEED);}; +void() pyro_run8 =[ $run8, pyro_run1 ] {ai_run(11 * pyro_RUN_SPEED);}; + +//============================================================================ +// - Pyro enforcer (FIRE FIRE FIRE!) +//---------------------------------------------------------------------- +void() pyroflame_touch = +{ + if (other == self.owner) return; + if (other.solid == SOLID_TRIGGER) return; + if (other.health < 1) return; + if (other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + if (other.classtype == self.owner.classtype) return; // Pyro proof! + + // Stop still if hit world, carry on if burning something + if (other != world) self.velocity = self.movedir; + else self.velocity = '0 0 0'; + + // Block sprite burst from damage again + self.attack_finished = time + 1; + + // Check owner is a Pyro? + if (self.owner.classtype == CT_MONPYRO) { + // damage and debuff are same function + ApplyFireDmg(other, DAMAGE_PYROFLAME, DAMAGE_MONFLAME); + } + else { + // Can only poison the player + if (other.flags & FL_CLIENT) { + // Check if player is posioned already? + if (other.poisoned) T_Damage (other, self, self, DAMAGE_FUMPOISON, DAMARMOR); + // Make sure player is posioned + else PoisonDeBuff(other); + } + // Poison anything else (very quick death, high damage) + else T_Damage (other, self, self, DAMAGE_MONFLAME, DAMARMOR); + } +}; + +//---------------------------------------------------------------------- +void() pyroflame_think = +{ + self.cnt = self.cnt + 1; + if (self.cnt > 6) remove(self); + else { + self.frame = self.cnt; + // Randomly drift upwards and slow down forward movement + self.velocity_z = self.velocity_z + 10 + (random() * 20); + self.velocity = self.velocity - (self.movedir * 0.125); + self.nextthink = time + 0.1; + } +} + +//---------------------------------------------------------------------- +void(vector org, vector dir) pyroflame_spawn = +{ + local vector variance; + local float roll, pointc; + + newmis = spawn(); + newmis.classtype = CT_TEMPSTREAM; + newmis.classname = "PBurst"; + newmis.owner = self; + newmis.frame = newmis.cnt = 0; + + // Extra wide flame contact if fighting a monster + if (self.enemy.flags & FL_MONSTER) newmis.movetype = MOVETYPE_FLYMISSILE; + else newmis.movetype = MOVETYPE_FLY; // Standard flame size + newmis.solid = SOLID_TRIGGER; // collision, touch required + + // The Pyro and Fumigator have different flame types + // Pyro = fire, Fum = Poison + //----------------------------------------------- + if (self.classtype == CT_MONPYRO) { + // Switch particles between fire and smoke based on contents + pointc = pointcontents(self.origin); + if (pointc <= CONTENT_WATER) { + if (ext_dppart) { + // Use special DP smoke and empty sprite for collision + pointparticles(particleeffectnum(DPP_PYROFLAME2), org, dir, 1); + setmodel (newmis, SBURST_FLAMEDP); + } + else setmodel (newmis, SBURST_SMOKE); + } + else { + if (ext_dppart) { + // Use special DP flames and empty sprite for collision + pointparticles(particleeffectnum(DPP_PYROFLAME1), org, dir, 1); + setmodel (newmis, SBURST_FLAMEDP); + } + else setmodel (newmis, SBURST_FLAME); + } + } + else { + if (ext_dppart) { + // Use special DP flames and empty sprite for collision + pointparticles(particleeffectnum(DPP_PYROFLAME3), org, dir, 1); + setmodel (newmis, SBURST_POISONDP); + } + else setmodel (newmis, SBURST_POISON); + } + + setorigin (newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + // Work out forward speed (tweak based on skill level) + variance = vecrand(0,10,TRUE); // +/- 10 on all axis + newmis.attack_speed = SPEED_PYROFLAME + skill * SPEED_PYROSKILL; + newmis.movedir = (dir * newmis.attack_speed) + '0 0 -50' + variance; + newmis.velocity = newmis.movedir; + + // Roll the flames from side to side towards the target + roll = 350 + random() * 20; + newmis.angles_z = anglemod(roll); + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) newmis.effects = newmis.effects + EF_NOSHADOW; + + newmis.nextthink = time + 0.1; + newmis.think = pyroflame_think; + newmis.touch = pyroflame_touch; +}; + +//---------------------------------------------------------------------- +void() pyro_fire = +{ + local vector org, dir, targ_org; + + if (self.health < 1) return; + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + // point the flames at the feet of the player + if (self.enemy.flags & FL_CLIENT) targ_org = self.enemy.origin - '0 0 20'; + else targ_org = self.enemy.origin - self.enemy.view_ofs; + dir = normalize(targ_org - self.origin); + pyroflame_spawn(org, dir); +}; + +//---------------------------------------------------------------------- +void() pyro_atk1 =[ $attack1, pyro_atk2 ] {ai_face();}; +void() pyro_atk2 =[ $attack3, pyro_atk3 ] {ai_face();}; +void() pyro_atk3 =[ $attack5, pyro_atk4 ] {ai_face(); + sound (self, CHAN_WEAPON, self.noise3, 1, ATTN_NORM); // ON + pyro_fire(); + self.attack_finished = time + 0.3; +}; +void() pyro_atk4 =[ $attack5, pyro_atk5 ] {ai_face(); + pyro_fire(); + if (self.attack_finished > time || + (range(self.enemy) == RANGE_MELEE && self.enemy.health > 0) ) + self.think = pyro_atk4; +}; +void() pyro_atk5 =[ $attack10, pyro_run1 ] {ai_face(); + sound (self, CHAN_WEAPON, self.noise4, 1, ATTN_NORM); // OFF + SUB_CheckRefire (pyro_atk1); +}; + +//============================================================================ +void() pyro_paina1 =[ $paina1, pyro_paina2 ] {}; +void() pyro_paina2 =[ $paina2, pyro_paina3 ] {}; +void() pyro_paina3 =[ $paina3, pyro_paina4 ] {}; +void() pyro_paina4 =[ $paina4, pyro_run1 ] {}; + +//---------------------------------------------------------------------- +void() pyro_painb1 =[ $painb1, pyro_painb2 ] {}; +void() pyro_painb2 =[ $painb2, pyro_painb3 ] {}; +void() pyro_painb3 =[ $painb3, pyro_painb4 ] {}; +void() pyro_painb4 =[ $painb4, pyro_painb5 ] {}; +void() pyro_painb5 =[ $painb5, pyro_run1 ] {}; + +//---------------------------------------------------------------------- +void() pyro_painc1 =[ $painc1, pyro_painc2 ] {}; +void() pyro_painc2 =[ $painc2, pyro_painc3 ] {}; +void() pyro_painc3 =[ $painc3, pyro_painc4 ] {}; +void() pyro_painc4 =[ $painc4, pyro_painc5 ] {}; +void() pyro_painc5 =[ $painc5, pyro_painc6 ] {}; +void() pyro_painc6 =[ $painc6, pyro_painc7 ] {}; +void() pyro_painc7 =[ $painc7, pyro_painc8 ] {}; +void() pyro_painc8 =[ $painc8, pyro_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) pyro_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + pyro_soundreset(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + self.lip = random (); + if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + // Not using long pain animation (need to be agile) + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (self.lip < 0.3) pyro_paina1 (); + else if (self.lip < 0.6) pyro_painb1 (); + else pyro_painc1 (); + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.8; + self.axhitme = 0; + pyro_painc1 (); + } + } +}; + +//============================================================================ +void() pyro_die1 =[ $death1, pyro_die2 ] {}; +void() pyro_die2 =[ $death2, pyro_die3 ] {monster_check_gib();}; +void() pyro_die3 =[ $death3, pyro_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() pyro_die4 =[ $death4, pyro_die5 ] {ai_forward(14);}; +void() pyro_die5 =[ $death5, pyro_die6 ] {ai_forward(2);}; +void() pyro_die6 =[ $death6, pyro_die7 ] {}; +void() pyro_die7 =[ $death7, pyro_die8 ] {}; +void() pyro_die8 =[ $death8, pyro_die9 ] {}; +void() pyro_die9 =[ $death9, pyro_die10 ] {ai_forward(3);}; +void() pyro_die10 =[ $death10, pyro_die11 ] {ai_forward(5);}; +void() pyro_die11 =[ $death11, pyro_die12 ] {ai_forward(5);}; +void() pyro_die12 =[ $death12, pyro_die13 ] {ai_forward(5);}; +void() pyro_die13 =[ $death13, pyro_die14 ] {monster_death_postcheck();}; +void() pyro_die14 =[ $death14, pyro_die14 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() pyro_fdie1 =[ $fdeath1, pyro_fdie2 ] {}; +void() pyro_fdie2 =[ $fdeath2, pyro_fdie3 ] {monster_check_gib();}; +void() pyro_fdie3 =[ $fdeath3, pyro_fdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() pyro_fdie4 =[ $fdeath4, pyro_fdie5 ] {}; +void() pyro_fdie5 =[ $fdeath5, pyro_fdie6 ] {}; +void() pyro_fdie6 =[ $fdeath6, pyro_fdie7 ] {}; +void() pyro_fdie7 =[ $fdeath7, pyro_fdie8 ] {}; +void() pyro_fdie8 =[ $fdeath8, pyro_fdie9 ] {}; +void() pyro_fdie9 =[ $fdeath9, pyro_fdie10 ] {}; +void() pyro_fdie10 =[ $fdeath10, pyro_fdie11 ] {monster_death_postcheck();}; +void() pyro_fdie11 =[ $fdeath11, pyro_fdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() pyro_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + pyro_soundreset(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); + if (random() > 0.5) pyro_die1 (); + else pyro_fdie1 (); + } +}; + +/*====================================================================== + QUAKED monster_pyro (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_pyro = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_pyro.mdl"; + self.headmdl = "progs/ad171/h_pyro.mdl"; + self.gib1mdl = "progs/ad171/w_enforcergun.mdl"; // Unique weapon + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + self.gib1skin = 3; + + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Extra sound/sprite assets (from Rubicon2 MOD) + self.noise3 = "enforcer/pyro_flameon.wav"; + self.noise4 = "enforcer/pyro_flameoff.wav"; + precache_sound (self.noise3); + precache_sound (self.noise4); + precache_model (SBURST_FLAME); // Flame on + precache_model (SBURST_SMOKE); // Underwater + precache_model (SBURST_FLAMEDP); // DP Collision + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 100; + self.gibhealth = -35; + self.gibbed = FALSE; + self.yaw_speed = 35; // Can turn really fast + self.pain_flinch = 100; // extremely high pain tolerance + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEHEAVY; // heavy feet + self.attack_offset = '24 8.5 16'; // End of Gun + self.ammo_shells = 4; // drops armor shards instead + if (!self.exactskin) self.randomskin = 4; + + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = PyroCheckAttack; + self.th_stand = pyro_stand1; + self.th_walk = pyro_walk1; + self.th_run = pyro_run1; + self.th_pain = pyro_pain; + self.th_die = pyro_die; + self.th_melee = pyro_atk1; + self.th_missile = pyro_atk1; // For monster_turret function + + self.classtype = CT_MONPYRO; + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was toasted by a Pyro\n"; + monster_start(); +}; + +/*====================================================================== + QUAKED monster_fumigator (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_fumigator = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_fumigator.mdl"; + self.headmdl = "progs/ad171/h_pyro.mdl"; + self.gib1mdl = "progs/ad171/w_enforcergun.mdl"; // Unique weapon + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + self.gib1sound = GIB_IMPACT_WOOD; + self.gib1skin = 4; + + precache_sound ("enforcer/death1.wav"); + self.pain_sound = "enforcer/pain1.wav"; + self.pain_sound2 = "enforcer/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + self.idle_sound = "enforcer/idle1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "enforcer/sight1.wav"; + precache_sound (self.sight_sound); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + // Extra sound/sprite assets (from Rubicon2 MOD) + self.noise3 = "enforcer/fum_poisonon.wav"; + self.noise4 = "enforcer/fum_poisonoff.wav"; + precache_sound (self.noise3); + precache_sound (self.noise4); + precache_model (SBURST_POISON); // Poison on + precache_model (SBURST_POISONDP); // DP Collision + + precache_poisongibs(); // precache gibs + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 100; + self.gibhealth = -35; + self.gibbed = FALSE; + self.yaw_speed = 35; // Can turn really fast + self.pain_flinch = 100; // extremely high pain tolerance + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEHEAVY; // heavy feet + self.attack_offset = '24 8.5 16'; // End of Gun + self.ammo_shells = 4; // drops armor shards instead + self.poisonous = TRUE; // Oh yeah! Poison! + self.gibtype = GIBTYPE_POISON; // Poison gibs! + self.no_liquiddmg = TRUE; // Immune to slime/lava + if (!self.exactskin) self.randomskin = 4; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = 0; self.resist_nails = 0.5; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = PyroCheckAttack; + self.th_stand = pyro_stand1; + self.th_walk = pyro_walk1; + self.th_run = pyro_run1; + self.th_pain = pyro_pain; + self.th_die = pyro_die; + self.th_melee = pyro_atk1; + self.th_missile = pyro_atk1; // For monster_turret function + + self.classtype = CT_MONFUMIGATOR; + self.classgroup = CG_ENFORCER; + self.classmove = MON_MOVEWALK; + if (self.deathstring == "") self.deathstring = " was choked by a Fumigator\n"; + monster_start(); +}; + +void() monster_dreadnaught = { + if (self.deathstring == "") self.deathstring = " was incinerated by a Dreadnaught\n"; + monster_pyro(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_ryu.qc b/QC_other/QC_keep/mon_ryu.qc new file mode 100644 index 00000000..5307353d --- /dev/null +++ b/QC_other/QC_keep/mon_ryu.qc @@ -0,0 +1,1778 @@ +// DRAGON (The Qtest/Drake version) +$cd progs/dragon +$origin 0 0 24 +$base base +$skin skin +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 +$frame painc1 painc2 painc3 painc4 painc5 painc6 +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 +$frame death10 death11 death12 death13 +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 +$frame decap1 decap2 decap3 decap4 decap5 decap6 decap7 decap8 decap9 +$frame decap10 decap11 decap12 decap13 +$frame decapb1 decapb2 decapb3 decapb4 decapb5 decapb6 + +//------------------------------------------------------------------------// +// The dragon hovers in place. If a water-fearing dragon is +// underwater, it will escape the pool if possible. +// +// The dragon glides along its path. Like ryu_stand(), a +// water-fearing dragon will try to escape from any body of +// water if it is placed in one. +//------------------------------------------------------------------------// +void(float dist) ryu_idle = +{ + if (Ryu_HatesWater ()) + { + if (self.h2olevel) + { + if (Ryu_LeaveWater (self.speed)) + return; + // Dragon could not rise toward air. If in walk mode, increase + // speed in the hope of finding another way toward air faster. + if (dist) // In walk mode. + dist = self.speed; + } + } + + ryu_untilt (); // Undo any angle changes due to evasion. + + // Don't move if guarding. + if (Ryu_InGuardMode ()) return; + + if (dist) safe_goal (dist); +}; + +void() ryu_stand = { + if (FindTarget ()) + return; + + ryu_idle (0); // This will eject the dragon from water. + //ai_pet_stay (); +}; + +void() ryu_walk = { + if (self.master) // Warning: 'self.master == self' causes weirdness. + { + if (self.ryuflags & RYU_PATROL) + { + if (!FindTarget ()) // check for noticing a player + { + ryu_idle (0); // If underwater, get out! + //ai_pet_patrol (SPEED_RYU_MIN); + } + } + else + self.th_run (); // Override walk and run after master. + return; + } + + if (FindTarget ()) + return; + + ryu_idle (SPEED_RYU_MIN); +}; + +//------------------------------------------------------------------------// +// This checks whether the dragon is allowed to attack its target +// when one is in air while the other is in liquid. +//------------------------------------------------------------------------// +float() Ryu_BlockCrossfire = { + if (self.th_missile) + { + local float elements; + + elements = self.ryuflags & RYU_ELEMENTS; + if (elements == RYU_USE_LITE) + return FALSE; // Shoot lightning into water to fry targets. + else if (elements == RYU_USE_ICE) + { // Don't shoot ice if either endpoint is in lava. + if (self.h2otype == CONTENT_LAVA) + if (self.h2olevel > 1) + return TRUE; // Mouth in lava. + if (self.enemy.h2otype == CONTENT_LAVA) + //if (self.enemy.h2olevel == 3) + return TRUE; // Target covered under lava. + } + // Check alert AFTER element check. + if (self.ryuflags & RYU_ALERT) + return FALSE; // Smart enough to aim through water. + } + // Cannot attack at all. + return TRUE; +}; + +//------------------------------------------------------------------------// +// This checks if the dragon's target can be seen. This is different +// from the original visible() function in that some dragons can see +// a swimming target through the water. +//------------------------------------------------------------------------// +float(entity targ) ryu_visible = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, TRUE, self); // see through other monsters + + // Some dragons can see targets through liquid while others cannot. + if (trace_inopen) + if (trace_inwater) + if (Ryu_BlockCrossfire ()) + if (vlen(self.enemy.origin - self.origin) > 120) + return FALSE; + + return (trace_fraction == 1); +}; + +//------------------------------------------------------------------------// +// The dragon rotates in place (via multiple calls to this function) +// until it faces its opponent. Upon facing an opponent, the dragon +// will launch an attack. +//------------------------------------------------------------------------// +void() ryu_run_attack = +{ + // Rotate to face opponent. + self.ideal_yaw = enemy_yaw; + ChangeYaw (); + + // Check if dragon is facing opponent. If so, attack! + if (FacingIdeal ()) + { + self.attack_state = AS_STRAIGHT; + + // Check for melee attack first. + if (enemy_range == RANGE_MELEE) + if (self.th_melee) + { + self.th_melee (); + return; + } + + // Not close enough for melee, so shoot instead if possible. + if (self.th_missile) + if (!Ryu_NoShot (self)) + { + //if (!IsGhost (self.enemy)) + //{ + self.th_missile (); + return; + // } + } + } + + if (Ryu_InGuardMode ()) + return; // Guarding -- don't move. + + // Break off the attack if a projectile or some other danger is nearby. + if (Ryu_DetectDanger (self.speed)) + self.attack_state = AS_STRAIGHT; +}; + +//------------------------------------------------------------------------// +// This checks if the dragon is able to attack the target. +//------------------------------------------------------------------------// +float() Draco_CanAttackTarget = +{ + if (!enemy_vis) + return FALSE; // Standard. Must see the target. + if (!self.enemy.takedamage) + return FALSE; // In case mega-enforcer shields stays on long. + // Don't let water-hating dragons get stuck trying to shoot zombies + // that are underwater to death -- it is useless. + if (Ryu_HatesWater ()) + if (self.enemy.xfl & XFL_ZOMBIE) // Anyone harmed only by scar. + if (!self.h2olevel) + if (self.enemy.h2olevel > 2) + return FALSE; + + return TRUE; +}; + +//------------------------------------------------------------------------// +// This is the dragons' version of 'ai_pet_follow'. +//------------------------------------------------------------------------// +void(float dist) ryu_follow = +{ + // Running while not in combat, so treat this like walking. + if (FindTarget ()) + return; + + ryu_untilt (); // Undo any angle changes due to evasion. + + // If the dragon does not like water, stay away from it. + if (Ryu_GetOutOfWater (self.speed)) + return; + + //ai_pet_follow (dist); +}; + +//------------------------------------------------------------------------// +// The dragon is flying around while fighting. It may attack, +// dodge missiles, or just simply move toward the opponent at +// normal running speed. +//------------------------------------------------------------------------// +void() ryu_run = +{ + local float guarding, standby; + local float dist; + + dist = self.speed; + + guarding = Ryu_InGuardMode (); + if (guarding) + standby = 1; + else + standby = 5; // Standard. + +//- - - - - - - - - - - - - - + if (!self.fighting) + if (self.master) + {ryu_follow (dist); return;} + +// see if the enemy is dead + if (self.enemy.health <= 0) + if (ai_run_kill ()) + return; +//- - - - - - - - - - - - - - + +// DISABLED: Monsters reveal themselves only when waking up or attacking. +// This change was done due to the new alignment rules. +// self.show_hostile = time + 1; // wake up other monsters + +// check knowledge of enemy + enemy_vis = ryu_visible(self.enemy); + if (enemy_vis) + self.search_time = time + 5; + +// look for other targets if current target is unavailable. +// Do this in single-player and DM because of minions and their alignment. + if (self.search_time < time) + { + // Hasn't seen enemy in a while. Get out of strafe mode. + if (self.attack_state == AS_SLIDING) + self.attack_state = AS_STRAIGHT; + + if (FindTarget ()) + return; + + if (self.master) + if (self.enemy != self.master) + {ai_run_done(); return;} // Stop chase and return to master. + } + +// enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + + if (self.attack_state == AS_MELEE) + {ryu_run_attack (); return;} + + if (guarding) + { // If in guard mode, hover in place and face the enemy before attack. + ryu_untilt (); + if (enemy_vis) + { + self.attack_state = AS_STRAIGHT; + self.ideal_yaw = enemy_yaw; + ChangeYaw (); + DragonCheckAttack (); + } + return; + } + + // Hunt mode. + if (enemy_vis) + DragonCheckAttack (); + + // Avoid projectiles or other threats. + //if (!ImmuneToDamage (self)) + if (Ryu_DetectDanger (self.speed)) + return; + + ryu_untilt (); // Undo any angle changes due to evasion. + + // If the dragon does not like water, stay away from it. + if (Ryu_GetOutOfWater (self.speed)) + return; + +// Check if dragon is in strafe mode. + if (self.attack_state == AS_SLIDING) + { + // Set enemy to world for the first move so dragon stays at same + // altitude. Dragon should not sink toward enemy if it is trying + // to fly up and away for whatever reason. + local entity e; + + e = self.enemy; + self.enemy = world; + safe_goal (dist); + self.enemy = e; + + Ryu_VerticalSlide (dist, self.enemy); + return; + } + +// head straight in + // Fast, larger dragons sometimes have trouble closing in for melee. + // In close range, check if normal speed is too fast. If so, fly in + // at minimum speed. + dist = self.speed; + if (enemy_range == RANGE_NEAR) + if (QC_CloseEnough (dist)) + dist = SPEED_RYU_MIN; + safe_goal (dist); +}; + + +//////////////////////////////////////////////////////////////////////////// +// 1.4. Wyrm AI // +// // +// Special AI for huge (full Qtest-sized) boss dragons. // +//////////////////////////////////////////////////////////////////////////// + +// Movement when not on a path. +void() wyrm_glide = +{ + local entity swap; + local float sped, ofs, left; + +// Fly at walk speed when idle or run speed when mad at someone. + sped = 20; + if (self.enemy) + if (!(self.spawnflags & SPAWN_SLOW)) + sped = 32; + +// Change angles. + ofs = anglemod(self.angles_y - self.ideal_yaw); + if (ofs >= 180) + {left = 1; ofs = ofs - 360;} + else + left = 0; + ChangeYaw (); + if (fabs(ofs) <= self.yaw_speed) + {ryu_untilt (); left = 1;} + else + {ryu_tilt (left, 32); left = 0; sped = 20;} + +// Forward movement. + swap = self.enemy; + self.enemy = world; +//- - - - - - - - - + if (!self.th_move (self.angles_y, sped)) + { // Something got in the way. + if (left) + self.ideal_yaw = anglemod(self.ideal_yaw + 180); + } +//- - - - - - - - - + self.enemy = swap; +}; + +// Normal move. +void(entity targ) wyrm_move = +{ + local entity swap, oe; + local float sped, ofs, left, oy, nopath; + local vector ang; + + if (self.movetarget) + nopath = FALSE; + else + nopath = TRUE; + + sped = 20; + if (self.enemy) + if (!(self.spawnflags & SPAWN_SLOW)) + if (targ != self.enemy) // Attacking if FALSE. + sped = 32; + + self.goalentity = targ; // In case we need 'movetogoal'. + self.ideal_yaw = vectoyaw(targ.origin - self.origin); + + // Remember previous angles in case we need to change them back. + ang = self.angles; + oy = self.ideal_yaw; +// Change angles. + ofs = anglemod(self.angles_y - self.ideal_yaw); + if (ofs >= 180) + {left = 1; ofs = ofs - 360;} + else + left = 0; + ChangeYaw (); + if (fabs(ofs) <= self.yaw_speed) + ryu_untilt (); + else + {ryu_tilt (left, sped); sped = 20;} + +// Forward movement. + swap = self.enemy; + if (nopath || (targ != self.enemy)) + self.enemy = world; + + oe = self.enemy; + if (!self.th_move (self.angles_y, sped)) + { // Something got in the way. + if (!self.enemy) + { // Restore previous angles then bump around with movetogoal. + self.ideal_yaw = oy; + self.angles = ang; + self.th_goal (sped); + ryu_untilt (); + } + } + self.enemy = oe; // In case of change by trigger_hurt and the like. + +// Vertical movement. Must have a path to be allowed. + if (!nopath) + if (targ) // If FALSE, no target to follow. + if (!self.enemy) // If FALSE, done already with builtin move. + { + left = targ.origin_z - self.origin_z; + if (left > 8) + left = 8; + else if (left < -8) + left = -8; + ai_up (left); + } + + self.enemy = swap; +}; + +// Checks if a target is inview for the wyrm. +float(entity targ) wyrm_inview = +{ + local vector spot1, spot2; + + if (targ.health <= 0) + return FALSE; // Dead or the world -- No target! + if (!targ.modelindex) + return FALSE; // sf64 and/or eth wraith. Treat as non-existant. + if (targ != self.enemy) + { + if (targ.flags & FL_NOTARGET) + return FALSE; // Target has stealth. + // This is boss AI, so ignore invisibility ring. + } + +// Is the target in front of the dragon? + makevectors (self.angles); + spot1 = targ.origin; + spot1_z = self.origin_z; // Ignore elevation difference. + spot1 = normalize (spot1 - self.origin); + if (spot1 * v_forward < 0) // Was <= 0.3. + return FALSE; // In the rear. + +// Can the dragon see the target? + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, TRUE, self); + // This is a boss -- cross contents won't save you, mwahaha! + if (trace_fraction != 1) + return FALSE; // Cannot see target. + + // Note: Don't bother checking for friendly fire. Attacks tend + // to spread out a bit, so a simple traceline check won't cut it. + // Besides, the boss doesn't care about small fry getting in the way. + + return TRUE; // "Rebel base in range!" -- Star Wars. +}; + +// TRUE = Dragon roared and won't attack, FALSE = May attack. +// Roaring stops dragon from attacking instantly, unless in Nightmare. +float(entity targ) wyrm_see_new = +{ + if (!self.enemy) + { // Found an enemy, so roar. + self.enemy = targ; // Must do before warning other monsters. + monster_sightsound(); + if (skill < 3) + return TRUE; // Just roar only. + } + else + { // Replace oldenemy with previous enemy. + if (self.enemy != targ) + self.oldenemy = self.enemy; + } + self.enemy = targ; + return FALSE; +}; + +// Scan for an enemy to attack. +void() wyrm_scan = +{ + // Update enemy list if target dies. + if (self.enemy) + { + if (self.enemy.health <= 0) + { + self.attack_finished = 0; + if (self.enemy.classname == "player") + if (self.enemy.enemy == self) + { // Killed a PC, so gloat for a moment. + if (self.th_win) + self.th_win (); + } + if (self.oldenemy.health <= 0) + self.enemy = world; + else + self.enemy = self.oldenemy; + self.oldenemy = world; + } + } + + if (cutscene) + return; // Don't search for targets during a cutscene. + +// NOTE: As a wyrm, check for enemies only. +// Don't bother checking for players to serve even if good aligned. +// What the latter means is an NPC wyrm must be triggered to ally with PC. + // Check for missile attack. + if (self.attack_finished <= time) + { + local entity targ, seen; + + seen = world; + /*if (self.alignment == GOOD) + { +// targ = CheckTarget (blacky); +// if (wyrm_inview (targ)) +// {if (wyrm_see_new (targ)) return; seen = targ;} +// if (!seen) + { + targ = findradius (self.origin, 2000); + while (targ) + { + if (targ.alignment == EVIL) + if (targ.health > 0) + if (wyrm_inview (targ)) + {if (wyrm_see_new (targ)) return; seen = targ;} + if (seen) + targ = world; + else + targ = targ.chain; + } + } + if (!seen) + { + // No bad guy to fry? Check for rogues. Don't waste time + // with clients even if commanded by a player in deathmatch. + targ = CheckTarget (whitey); + if (!UnitedWeStand (targ)) + { // Ally turned bad? + if (wyrm_inview (targ)) + {if (wyrm_see_new (targ)) return; seen = targ;} + } + } + }*/ + //else + //{ // Check for a player first, then npc next. + // Don't use checkclient because wyrm attacks are checked only + // in one frame once per animation cycle. + targ = RandomPlayer (); + if (targ != self.enemy) // If FALSE, check targ later. + if (wyrm_inview (targ)) + {if (wyrm_see_new (targ)) return; seen = targ;} + // Divide attacks between pcs and npcs when applicable. + if (!seen || (random() < 0.5)) + { + targ = CheckTarget (self.enemy); // FIXME: Use findradius? + if (wyrm_inview (targ)) + {if (wyrm_see_new (targ)) return; seen = targ;} + } + //} + + if (!seen) + { // No fresh meat? Check its current targets. + if (self.enemy) + { + if (!wyrm_inview (self.enemy)) + { // Current enemy not found. + targ = world; + if (self.oldenemy) + if (wyrm_inview (self.oldenemy)) + targ = self.enemy; + if (targ) + { // Secondary enemy found, so swap targets. + self.enemy = self.oldenemy; + self.oldenemy = targ; + } + else + { // No targets handy. If target is still visible, + // dragon has a small chance to fire anyway. + if (random() < (1 - (self.yaw_speed * 0.02))) + return; + if (!visible (self.enemy)) + return; + } + } + } + } + + if (self.enemy) + { + if (self.th_missile) + self.think = self.th_missile; + } + } +}; + + +//////////////////////////////////////////////////////////////////////////// +// 2.1. Dragon Attacks // +//////////////////////////////////////////////////////////////////////////// + +//- - - - - - - - - - - - - - - - - - - +// NOTE: Use of fields normally unused (by monsters) in standard Quake. +// Mod-makers beware! If other custom code uses these fields, +// make sure they do not interfere with their use by the dragons. +// +// .worldtype = attack type dragon will use; like .weapon for clients. +// .count = max shots per salvo; like .ammo_shells for clients. +// .height = shot damage. +// .volume = shots remaining in a salvo. +// +// Update 9/3/09: count/volume replaced buy shots_max/shots_left. +// +// NOTE #2: There are even more such recycled fields further below. +//- - - - - - - - - - - - - - - - - - - + +//========================================================================== +// Dragon Melee + +//------------------------------------------------------------------------// +// This returns the point of the dragon's mouth relative to its origin. +// All frames from 8 to 16 are part of the attack scene. +//------------------------------------------------------------------------// +vector() Ryu_Offset = +{ + local float fr; + + // HACK: If nightshade, convert its frames to dragon frames. + if (self.classname == "monster_nightshade") + fr = self.frame - 7; // Nightshade appears only as medium-sized. + else + fr = self.frame; + +// Now find where the dragon's mouth is. +// FIXME: Wyrm spawn? + if (self.maxs_x > 96) + { // Wyrm drake/dragon2.mdl. Assumes +20. + fr = self.frame; // Define 'fr'! + + if (fr==16) return '88 -9 2'; if (fr==15) return '92 -7 20'; + if (fr==14) return '94 -1 32'; if (fr==13) return '86 -1 36'; +// if (fr==12) return '72 -1 48'; if (fr==11) return '80 -1 32'; +// if (fr==10) return '94 -1 24'; + return '96 -1 20'; + } +// if (self.flags & FL_MONSTER) + { // Half-scale drake/dragon1.mdl. Assumes +2. + if (fr==16) return '43 -5 -6'; if (fr==15) return '46 -3 2'; + if (fr==14) return '47 -1 8'; if (fr==13) return '41 -1 12'; +// if (fr==12) return '35 -1 17'; if (fr==11) return '39 -1 10'; +// if (fr==10) return '46 -1 4'; + return '47 -1 3'; + } +}; + +//------------------------------------------------------------------------// +// The dragon makes a bite attack. +//------------------------------------------------------------------------// +void() Ryu_Bite = { + // Check if the bite attack can hit. + if (!InMeleeRange (RYU_RANGE_MELEE)) + return; + if (!CanDamage (self.enemy, self)) + return; + if (!self.enemy.takedamage) // For mega-enforcer. + return; + + // Bite attack is successful. + local vector org; // Location of dragon's head. + local vector dir; // Velocity of meat chunk. + local float damage; + + org = Ryu_Offset (); + + // Inflict the damage. Scar damage hurts and kills zombies. + // Like many of Quake2 monsters' melee attacks, damage ranges from + // x to x+5, while x is a multiple of 5, and damage has a minimum of 5. + // Note: x = ((maxs_x / 16) - 1 + random + cranked) * 5. + // Update 4/23/2009: Do 15-20 damage for standard. Wyrms multiply damage. + damage = 15 + random()*5; + if (cranked) + damage = damage + 5; + if (self.spawnflags & SPAWN_WYRM) // Moot since wyrms can't bite. + damage = damage * 4; + sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); + T_Damage (self.enemy, self, self, damage,DAMARMOR); + + // Throw a piece of meat from the dragon's head (mouth). + makevectors (self.angles); + org = self.origin + (v_forward*org_x) + (v_right*org_y) + (v_up*org_z); + dir = (random() * -50) * v_forward; + dir = dir + ((random() * 200 - 100) * v_right); + SpawnMeatSprayDrake (org, dir, self.enemy.bloodtype); +}; + + +//========================================================================== +// Dragon Aiming +//------------------------------------------------------------------------// +// This returns the spot where a projectile will strike. Dragons +// will shoot at the spot where the target is currently standing. +//------------------------------------------------------------------------// +vector() Ryu_TargetPoint = { + local vector end; + + // If the dragon has no enemy, aim straight ahead. + if (self.enemy) { + end = Midpoint (self.enemy); + + // If target is in water and not the dragon, aim at the head. + if (self.enemy.h2olevel >= 2) + if (self.h2olevel < 2) + end_z = end_z + (self.enemy.maxs_z * 0.5); + + return end; + } + // Aiming on its own... Aim forward and slightly downward. + makevectors (self.angles); + return (self.origin + v_forward*1024 - '0 0 16'); +}; + + +//========================================================================== +// Missile Attacks + +//------------------------------------------------------------------------// +// This creates a fireball shot by a dragon. Used by both PCs and NPCs. +//------------------------------------------------------------------------// +void(vector start, vector dir, float sped, float up, float damage) Ryu_Fire = { + if (damage) { + // Big super fireball. + Meteor_Launch (self, start, dir, sped, damage); + newmis.delay = time + 2.5; // Same fuse as a grenade. + newmis.movetype = MOVETYPE_TOSS; + } else { + // Normal fireball. + // Fuse is (10 * reach / speed) + 1. If speed is double the reach, + // duration is 6 frames. Fade anim is 3 frames, so the pre-fade + // duration is 3 frames. + // NOTE: Don't use self.height for damage here because of PC use. + Fireball_Launch (self, start, dir, sped, 9); + newmis.delay = time + 0.3; + newmis.noise = "dragon/firehit.wav"; + if (Fireball_InWater (newmis)) + return; + } + // Note: Make sure the damage flags field is same one used in 'fire.qc'. + newmis.style = newmis.style | DF_SAFE; // Harmless to attacker. + if (newmis.movetype == MOVETYPE_TOSS) { + newmis.velocity_z = newmis.velocity_z + up; + dir = normalize (newmis.velocity); + newmis.angles = vectoangles(dir) + '90 0 0'; + } + if (self.flags & FL_CLIENT) + SUB_Flash (); // Don't light up custom muzzle flashes in Qrack. + else + self.effects = self.effects | EF_MUZZLEFLASH; +}; + +//------------------------------------------------------------------------// +// Ryu_Multishot (formerly Ryu_Ice) +// +// This creates a shotgun burst of ice (or whatever). +// +// The family of the Ps explained: +// p1 = Origin of attack, generally out of one of the attacker's orifices. +// p2 = Endpoint 1, generally where the target is when attack is launched. +// p3 = Endpoint 2, where the target is predicted to be after some time. +// p4 = Endpoint 3, a point chosen somewhere between p2 and p3. Aim here! +//------------------------------------------------------------------------// +void(vector p1, vector p2, float sped, float damage, entity targ, float shots, float atype) Ryu_Multishot = { + local float bomb; + local float sped2; // New speed for hellball. + local float frac, loop; + local vector dir, err, p3, p4; + + // Extra stuff for more multishot types. + bomb = atype & RYU_BOMB; + atype = atype & RYU_ELEMENTS; + + // Begin old multishot stuff. + err = '6 4.5 0'; // For ice dragon, 5x the spread as fire spray. + p3 = Aim_Lead (p1, p2, sped, targ); + + loop = floor(shots); + while (loop > 0) { + loop = loop - 1; // Do first because we use 'loop - 1' in calcs. + if (loop) { + frac = 1 - (loop / shots); + if (self.spawnflags & SPAWN_SLOW) + frac = frac * 0.5; // Can't fully track if slow. + p4 = p2 + ((p3 - p2) * frac); + sped2 = sped * (random() / 3 + 1); // Boost speed by up to 33%. + } else { + // Aim final shot on target. + err = '0 0 0'; + p4 = p3; + sped2 = sped; + } + traceline (p1, p4, TRUE, self); + if (trace_fraction < 1) + p4 = p2; // Point is blocked, so don't lead. + + // Calculate aim vector. + if ( bomb && (atype != RYU_USE_LITE) ) + dir = Aim_Toss (p1, p4, sped2, 200, world); + else + dir = normalize (p4 - p1); + dir = Maim_Scatter (dir, err); + + if (atype & RYU_ELEMENTS == RYU_USE_ICE) { + // Ice spray. + if (bomb) + { // Explosive iceballs. + Iceball_Toss (p1, dir, sped2, self.height); + newmis.velocity_z = newmis.velocity_z + 200; + } + else + { // Ice shards. Default damage is 9, so raise it if too weak. + Ice_Launch (p1, dir, sped2); // Use 'sped' for same speed. + newmis.delay = time + 0.7; // Total duration. Was 0.8. + } + if (newmis.dmg < damage) + newmis.dmg = damage; + } + else if (bomb) + { + if (atype == RYU_USE_FIRE) + Ryu_Fire (p1, dir, sped2, 200, self.height); + else if (atype == RYU_USE_LITE) + RyuPlasma_Launch (p1, dir, sped2, self.height); + else if (atype == RYU_USE_ACID) + { + Acidball_Launch (p1, dir, sped2, self.height); + newmis.velocity_z = newmis.velocity_z + 200; + } + } + // ELSE unknown attack type and do nothing. + } +}; + + +//========================================================================== +// Missile Spawning + +//------------------------------------------------------------------------// +// This spawns a missile at the dragon's mouth then launches said +// missile at the target. The missile cast varies by type. +//------------------------------------------------------------------------// +void() Ryu_Shot_Fire = { + local entity targ; // Use shot leading if targ != world; + local vector dir; // Vector from 'start' to 'end'. + local vector start; // Location of dragon's mouth. + local vector end; // Place where projectile will strike. + local float sped; // Missile speed or lightning bolt range. + local float frac; // Lead coefficient. 0 = no lead, 1 = perfect. + +// As with players, pay ammo cost first then attack. + if (self.shots_left < 1) + return; // Out of ammo. + + // Calculate lead coefficient. The value begins at or close to zero at + // the start of the salvo, then the value increases with each successive + // shot until it reaches one at the final shot. + frac = Frac_ShotDown(); // Lowers 'shots_left', pays ammo cost. + if (self.spawnflags & SPAWN_SLOW) + frac = frac * 0.5; // Can't fully track if slow. + + targ = self.enemy; + // Shot speed varies by dragon size -- bigger is faster. + // Faster because of gravity or short range. + // Note: Proper speed is ((maxs_x / 16) * 100) + 600. + // Update 4/23/2009: 1000 for dragons, 1200 for wyrms. + // Speed may be increased by another 66%, so limit + // speed to 1200 so that it cannot exceed 2000. + if (self.spawnflags & SPAWN_WYRM) + sped = 1200; + else + sped = 1000; + + makevectors (self.angles); + + // Find the location of the dragon's mouth (or head). + start = Ryu_Offset (); + start = self.origin + (v_forward * start_x) + (v_right * start_y) + + (v_up * start_z); + end = Ryu_TargetPoint (); // Get the spot where dragon is aiming at. + + // Select an attack. + if (self.worldtype == RYU_USE_FIRE) { + sped = sped * 1.25; // Fire spray shots are 25% faster. + dir = Maim_LineEx (start, end, sped, targ, '1.2 0.9 0', frac); + Ryu_Fire (start, dir, sped, 200, 0); + if (self.height > 9) + newmis.dmg = self.height; // Extra damage. + if ( !self.shots_left || (self.shots_left == (self.shots_max - 1)) ) + newmis.effects = newmis.effects | EF_DIMLIGHT; + } else if (self.worldtype == RYU_USE_ACID) { + dir = Maim_TossEx (start, end, sped, 200, targ, '0 0 0', frac); + Acid_Toss (start, dir, sped); + if (self.height > 9) + newmis.dmg = self.height; // Extra damage. + } else if (self.worldtype == RYU_USE_LITE) { + // Check for discharge, just like Thunderbolt-wielding player. + self.effects = self.effects | EF_MUZZLEFLASH; + if (self.h2olevel > 1) { + // Dragon is deep enough in water so discharge. + // Note: Discharge is weak, so just fizzle harmlessly. + sound (self, CHAN_WEAPON, "misc/power.wav", 1, ATTN_NORM); + self.shots_left = 0; + return; + } + sped = RYU_RANGE_BEST; + + // Dragon will aim bolt behind the target during the early frames + // of a salvo. This is done to reduce damage from an otherwise + // unavoidable attack. An exception is made if the target is in + // the water, in which case, the aim becomes perfect (or rather + // the error calcuation is skipped) to simulate water conductivity. + if (self.enemy) + if (self.enemy.h2olevel < 2) + end = end - (self.enemy.velocity * ((1 - frac) * 0.2)); + + dir = Maim_Line (start, end, 0, world, '0 0 0'); // Insta-hit. + end = start + (dir * sped); + + // Create the bolt of lightning. + LightningBolt2 (start, end, self, self.height); + } else { + // Multiple shot attacks. + if (self.worldtype & RYU_BOMB) + { // Super shots + if (!(self.ryuflags & RYU_ALERT)) // Leading is unfairly hard, + targ = world; // so don't unless cranked. + if (self.worldtype & RYU_ELEMENTS == RYU_USE_LITE) + sped = sped - 200; // Treat as one size less. + } + else if (self.worldtype & RYU_ELEMENTS == RYU_USE_ICE) + sped = sped * 1.25; + else + return; // Invalid attack type. + self.shots_left = 0; // Launch all shots in one burst. + Ryu_Multishot (start, end, sped, self.height, targ, self.shots_max, self.worldtype); + } +}; + +// Used for delayed calls to Ryu_Shot_Fire by Ryu_Shot. +void() Ryu_Shot_Think = { + if (self.owner.health > 0) + SUB_Think (self.owner, Ryu_Shot_Fire); + + remove (self); +}; + +// This calls the dragon's missile spawning function now or later. +// If delayed, a dummy entity to spawned to call the delayed function +// at the time designated by 'pause'. +void(float pause) Ryu_Shot = { + local entity echo; + if (pause) { + echo = spawn(); + echo.owner = self; + echo.nextthink = time + pause; + echo.think = Ryu_Shot_Think; + } else + Ryu_Shot_Fire (); +}; + + +//////////////////////////////////////////////////////////////////////////// +// 3.1. Sounds // +//////////////////////////////////////////////////////////////////////////// +void() ryu_sfx_fly = { + // Not while Quad is sounding. + if (self.super_sound < time) { + if (self.h2olevel <= 1) // Not while in the water. + sound (self, CHAN_BODY, "dragon/fly.wav", 1, ATTN_NORM); + else if ((self.h2otype == CONTENT_WATER) || (self.h2otype == CONTENT_SLIME)) + sound (self, CHAN_BODY, "dragon/flywater.wav", 1, ATTN_NORM); + } +}; + +void() ryu_sfx_fire = { + local float type; + + type = self.worldtype & RYU_ELEMENTS; + if (type == RYU_USE_FIRE) + sound (self, CHAN_WEAPON, "dragon/fire.wav", 1, ATTN_NORM); + else if (type == RYU_USE_ACID) + sound (self, CHAN_WEAPON, "dragon/acid.wav", 1, ATTN_NORM); + else if (type == RYU_USE_LITE) { + if (self.worldtype & RYU_BOMB) + sound (self, CHAN_WEAPON, "weapons/lstart.wav", 1, ATTN_NORM); + else { + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + } + } + else if (type == RYU_USE_ICE) + sound (self, CHAN_WEAPON, "imp/shard.wav", 1, ATTN_NORM); +}; + +void() ryu_sfx_idle = {sound (self, CHAN_VOICE, "dragon/idle1.wav", 1, ATTN_NORM);}; + +//////////////////////////////////////////////////////////////////////////// +// 3.2. Animation // +//////////////////////////////////////////////////////////////////////////// +//============ +// MOVEMENT +//============ +//------------------------------------------------------------------------// +// Fly animation forward. Used for stand, walk, and run anims. +// +// Stand = Dragon hovers in place. +// Walk = The dragon slowly glides along its path. +// Run = The dragon flies quickly toward the enemy. +//------------------------------------------------------------------------// +void() wyrm_fly_anim = { + local float fadd; + + if ((self.frame > 7) || (self.walkframe >= 13)) + fadd = self.walkframe = 0; + else if (self.walkframe >= 7) + fadd = 14 - self.walkframe; + else + fadd = self.walkframe; + + self.frame = $fly1 + fadd; + self.walkframe = self.walkframe + 1; + + if ( self.frame == $fly8 ) + ryu_sfx_fly (); +}; + +void() ryu_stand1 =[ $fly1, ryu_stand1 ] {wyrm_fly_anim(); ryu_stand();}; +void() ryu_walk1 =[ $fly1, ryu_walk1 ] {wyrm_fly_anim(); ryu_walk();}; +void() ryu_run1 =[ $fly1, ryu_run1 ] {wyrm_fly_anim(); ryu_run();}; + +void() wyrm_fly =[ $fly1, wyrm_fly ] { + wyrm_fly_anim(); + + // Custom move and attack AI. + if (self.movetarget) + wyrm_move (self.movetarget); + else + wyrm_glide (); + + if ( self.frame == $fly1 ) wyrm_scan (); +}; + +void() wyrm_start = { + if (self.movetarget.classname != "path_corner") { + self.movetarget = world; + self.ideal_yaw = self.angles_y; + } + + self.th_stand = self.th_walk = self.th_run = wyrm_fly; + wyrm_fly (); +}; + +void() wyrm_go = { + if (self.ryuflags & RYU_PATH) + wyrm_fly (); + else + ryu_run1 (); +}; + + +//============ +// ATTACKS +//============ +void() dragon_bite1 =[ $attack1, dragon_bite2 ] {W_ShowHostile(); ryu_melee();}; +void() dragon_bite2 =[ $attack2, dragon_bite3 ] {ryu_melee();}; +void() dragon_bite3 =[ $attack3, dragon_bite4 ] {ryu_melee();}; +void() dragon_bite4 =[ $attack4, dragon_bite5 ] {ryu_melee();}; +void() dragon_bite5 =[ $attack5, dragon_bite6 ] {ryu_melee();}; +void() dragon_bite6 =[ $attack6, dragon_bite7 ] {ryu_melee();}; +void() dragon_bite7 =[ $attack7, dragon_bite8 ] {ryu_melee();}; +void() dragon_bite8 =[ $attack8, dragon_bite9 ] {ryu_melee();}; +void() dragon_bite9 =[ $attack9, dragon_bite10 ] {ryu_melee(); ryu_sfx_fly (); Ryu_Bite ();}; +void() dragon_bite10 =[ $attack8, dragon_bite11 ] {ryu_melee();}; +void() dragon_bite11 =[ $attack7, dragon_bite12 ] {ryu_melee();}; +void() dragon_bite12 =[ $attack6, dragon_bite13 ] {ryu_melee();}; +void() dragon_bite13 =[ $attack5, dragon_bite14 ] {ryu_melee();}; +void() dragon_bite14 =[ $attack4, dragon_bite15 ] {ryu_melee();}; +void() dragon_bite15 =[ $attack3, dragon_bite16 ] {ryu_melee();}; +void() dragon_bite16 =[ $attack2, dragon_bite17 ] {ryu_melee(); Ryu_Bite ();}; +void() dragon_bite17 =[ $attack1, ryu_go ] {ryu_melee(); self.attack_state = AS_STRAIGHT; self.walkframe = 0;}; + +float(float chance) Ryu_CanBite = { + // Check if missile attack is effective or not. + if (!self.th_missile) + return TRUE; // Can't shoot. + if (Ryu_NoShot (self)) + return TRUE; // Not allowed to fire. + if (self.enemy.solid <= SOLID_TRIGGER) + return TRUE; // Missile attacks pass through non-solid enemies. + + if (Ryu_BlockCrossfire ()) { + // Not allowed to see into water, so check contents. + traceline (self.origin, self.enemy.origin, TRUE, self); + if (trace_inopen) + if (trace_inwater) + return TRUE; // Can't see through water. + } + + // Now check if the dragon really wants to bite. + if (random() < chance) + if (InMeleeRange (RYU_RANGE_MELEE)) + return TRUE; + + // Don't bite -- fire away instead. + return FALSE; +}; + +//------------------------------------------------------------------------// +// Melee attack start. About midway into the animation, the dragon +// decides whether to bite or to shoot something. This is used by +// smart dragons to foil the 'run in-and-out' strategy used by players. +// (Also called 'shambler dance' by the authors of Quoth.) +// +// That is, run in to trigger melee attack, then run away to make said +// attack whiff. +//------------------------------------------------------------------------// +void() dragon_strike = { + local float chance; + + if (self.inpain >= time) { + // Dragon wants to circle-strafe and shoot. + self.attack_state = AS_SLIDING; + if (random() < 0.5) self.lefty = !self.lefty; + chance = 0; + } else { + // Try to close in. High chance of bite. Always bite zombies + // or anyone else who is hurt only by scar damage. + self.attack_state = AS_STRAIGHT; + if (Ryu_KeepAway (self.enemy)) + chance = 0; // Always shoot if trying to get away. + else if (self.enemy.xfl & XFL_ZOMBIE) + chance = 1; // Bite causes scar damage. + else + chance = 0.8; // Standard. + } + + // If dragon can bite the target, do it. + if (Ryu_CanBite (chance)) + dragon_bite1 (); + else + self.th_missile (); // Shoot at target. Assumes th_missile exists. +}; + +//------------------------------------------------------------------------// +// This makes the dragon decide whether or not to use meteor instead +// of fire spray. +//------------------------------------------------------------------------// +float() Ryu_UseSpecial = { + local float atype; + + if (self.spawnflags & SPAWN_WYRM) + return TRUE; // Big enough to spam multiple destructive blasts. + + // Smaller dragons choose between several small shots or one big blast. + // Most small shots are faster and fatter but have limited range. + // Big shots are either slower or bound by gravity, but cause high damage + // and splash. A spray of small shots is preferable to one big shot, + // so if the enemy is in range and not a zombie, spray away! + atype = self.worldtype & RYU_ELEMENTS; + if (atype == RYU_USE_FIRE) { + // If water is in the way, shoot meteors to penetrate it. + if (self.h2olevel >= 2) + return TRUE; // Underwater. Only meteors are effective. + if (self.enemy) + if (self.enemy.h2olevel >= 3) + return TRUE; // Target is underwater. + } + if (self.enemy) { + // If enemy is a zombie or too far away, lob big shots. + if (self.enemy.xfl & XFL_ZOMBIE) { + // Zombies need high damage to kill. + if (atype != RYU_USE_FIRE) // Fire causes scar damage. + return TRUE; + } + + // All acid shots have same flight. + if (atype != RYU_USE_ACID) { + if (vlen(self.enemy.origin - self.origin) > RYU_RANGE_BEST) + return TRUE; + } + } + return FALSE; // Spray small shots. +}; + +//------------------------------------------------------------------------// +// This selects the attack used based on type. +//------------------------------------------------------------------------// +void() Ryu_SetAttack = { + local float shots; + local float element; + local float fts; // Frames To Shoot. + local float multi; // Multishot attack if TRUE. + +// Select attack type. + element = self.worldtype = self.ryuflags & RYU_ELEMENTS; + if (Ryu_UseSpecial ()) self.worldtype = self.worldtype | RYU_BOMB; + +// Select attack based on type and change the thinking logic accordingly. +//- - - - - - - - - - - - - - - - - - - +// Recycled field alert! +// .wait = time to add between shots in a salvo. +// .delay = time between an attack function call and the attack itself. +//- - - - - - - - - - - - - - - - - - - + if (self.worldtype & RYU_BOMB) { + if (self.spawnflags & SPAWN_WYRM) + shots = 4; + else + shots = 1; + if (element == RYU_USE_LITE) + self.height = 40; + else + self.height = 80; + if (cranked) // Increase damage by 50% if true. + self.height = self.height * 3 / 2; + + self.shots_max = self.shots_left = shots; + self.wait = 0.6 / shots; + self.delay = 0.3; + } else { + // Generic projectile attacks + if (cranked) + shots = 12; + else + shots = 8; + + fts = 6; + multi = FALSE; + if (self.worldtype == RYU_USE_LITE) { + shots = ((shots / 2) & 255) + ((random() * 2 * (shots & 1)) & 1); + self.height = 10; // Same damage as shambler bolt. + if (shots > 12) {self.height = shots; shots = 10; fts = 5;} + } else { + // Damage. + self.height = 9; + // Special: If too many shots, cap number and increase damage. + if (self.worldtype == RYU_USE_FIRE) + {if (shots > 18) {self.height = shots / 2; shots = 18;}} + else + {if (shots > 9) {self.height = shots; shots = 9;}} + // Ice check. + if (self.worldtype == RYU_USE_ICE) + multi = TRUE; + } + // Shots. + self.shots_max = self.shots_left = shots; + // Rate of fire. + if (shots > fts) + self.wait = fts / 10 / shots; + else + self.wait = 0.1; + // Attack delay. + // Note: Multishot attacks launches all ammo in an instant, so treat + // them as single-shot. + if ((self.shots_left <= 1) || multi) + self.delay = 0.3; // $attack9 + else if (self.shots_left <= 2) + self.delay = 0.2; // $attack8 + else if (self.shots_left <= 4) + self.delay = 0.1; // $attack7 + else + self.delay = 0; // $attack6 + } +}; + +// Standard missile attack for dragons. +void() ryu_rapid_fire = { + if (!self.wait) + self.wait = 0.1; // Do this to avoid infinite loop. + else if (self.wait < 0.01) + self.wait = 0.01; // 10 shots per frame max -- spamtastic. + + // Note: Start _click with 0.1 or higher to delay attack. + // 0.1 is for ten frames per second, the default animation rate. + while (self.delay < 0.1) { + if (self.shots_left == self.shots_max) ryu_sfx_fire(); // Play sound on the first shot. + Ryu_Shot (self.delay); // Spawn the attack. + self.delay = self.delay + self.wait; + } + self.delay = self.delay - 0.1; +}; + +void() dragon_ranged = { + if (self.ryuflags & RYU_PATH) + wyrm_move (self.enemy); + else + ryu_missile (); +}; +void() dragon_missile1 =[ $attack1, dragon_missile2 ] { + W_ShowHostile (); + if (!(self.ryuflags & RYU_PATH)) + Ryu_StrafeOption (); + dragon_ranged(); +}; +void() dragon_missile2 =[ $attack2, dragon_missile3 ] {dragon_ranged();}; +void() dragon_missile3 =[ $attack3, dragon_missile4 ] {dragon_ranged();}; +void() dragon_missile4 =[ $attack4, dragon_missile5 ] {dragon_ranged();}; +void() dragon_missile5 =[ $attack5, dragon_missile6 ] {dragon_ranged();}; +void() dragon_missile6 =[ $attack6, dragon_missile7 ] {dragon_ranged(); Ryu_SetAttack(); ryu_rapid_fire();}; +void() dragon_missile7 =[ $attack7, dragon_missile8 ] {dragon_ranged(); ryu_rapid_fire();}; +void() dragon_missile8 =[ $attack8, dragon_missile9 ] {dragon_ranged(); ryu_rapid_fire();}; +void() dragon_missile9 =[ $attack9, dragon_missile10 ] {dragon_ranged(); ryu_sfx_fly(); ryu_rapid_fire();}; +void() dragon_missile10 =[ $attack8, dragon_missile11 ] {dragon_ranged(); ryu_rapid_fire();}; +void() dragon_missile11 =[ $attack7, dragon_missile12 ] {dragon_ranged(); ryu_rapid_fire();}; +void() dragon_missile12 =[ $attack6, dragon_missile13 ] {dragon_ranged();}; +void() dragon_missile13 =[ $attack5, dragon_missile14 ] {dragon_ranged();}; +void() dragon_missile14 =[ $attack4, dragon_missile15 ] {dragon_ranged();}; +void() dragon_missile15 =[ $attack3, dragon_missile16 ] {dragon_ranged();}; +void() dragon_missile16 =[ $attack2, dragon_missile17 ] {dragon_ranged();}; +void() dragon_missile17 =[ $attack1, ryu_go ] { + dragon_ranged(); + if (self.ryuflags & RYU_PATH) + self.attack_finished = time + (1.2 * (3 - skill)); + self.walkframe = 0; +}; + +void() dragon_pain1 =[ $pain1, dragon_pain2 ] {ryu_untilt();}; +void() dragon_pain2 =[ $pain2, dragon_pain3 ] {ryu_untilt();}; +void() dragon_pain3 =[ $pain3, dragon_pain4 ] {ryu_untilt();}; +void() dragon_pain4 =[ $pain4, dragon_pain5 ] {ryu_untilt();}; +void() dragon_pain5 =[ $pain5, dragon_pain6 ] {ryu_untilt();}; +void() dragon_pain6 =[ $pain6, ryu_go ] {ryu_untilt();}; + +void() dragon_painb1 =[ $painb1, dragon_painb2 ] {ryu_untilt();}; +void() dragon_painb2 =[ $painb2, dragon_painb3 ] {ryu_untilt();}; +void() dragon_painb3 =[ $painb3, dragon_painb4 ] {ryu_untilt();}; +void() dragon_painb4 =[ $painb4, dragon_painb5 ] {ryu_untilt();}; +void() dragon_painb5 =[ $painb5, dragon_painb6 ] {ryu_untilt();}; +void() dragon_painb6 =[ $painb6, ryu_go ] {ryu_untilt();}; + +void() dragon_painc1 =[ $painc1, dragon_painc2 ] {ryu_untilt();}; +void() dragon_painc2 =[ $painc2, dragon_painc3 ] {ryu_untilt();}; +void() dragon_painc3 =[ $painc3, dragon_painc4 ] {ryu_untilt();}; +void() dragon_painc4 =[ $painc4, dragon_painc5 ] {ryu_untilt();}; +void() dragon_painc5 =[ $painc5, dragon_painc6 ] {ryu_untilt();}; +void() dragon_painc6 =[ $painc6, ryu_go ] {ryu_untilt();}; + +void(entity inflictor, entity attacker, float damage) wyrm_pain = { + local float r; // Multi-purpose number. + local string sfx; + + if (self.pain_finished > time) return; + + self.pain_finished = time + 1; + + if (self.ryuflags & RYU_PATH) { + // Wyrm: Spin toward attacker if not on a path. + // Do only if it can show pain at this time. + if (!self.movetarget) // Must not have a path to follow. + if (attacker) + if (self.enemy == attacker) + if (self.attack_finished <= time) // Don't spin if it can't attack. + if (visible (attacker)) + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + } + + r = 400; + sfx = "dragon/pain1.wav"; + sound (self, CHAN_VOICE, sfx, 1, ATTN_NORM); + if ((random() * r) > damage) + return; // didn't flinch + if (damage < self.health * 0.01) // FIXME: Use max_health instead? + return; // Damage dealt is too low to cause flinching. + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + self.inpain = time + 2; // Strafe soon after pain. + self.attack_state = AS_STRAIGHT; + self.attack_finished = 0; // can attack anytime now! + self.walkframe = 0; // Reset fly anim. + + // Choose one of three pain scenes. + r = random(); + if (r < 0.4) + dragon_pain1 (); + else if (r < 0.7) // Was 0.8 in older Dragons. + dragon_painb1 (); + else + dragon_painc1 (); +}; + +void() dragon_die1 =[ $death1, dragon_die2 ] {}; +void() dragon_die2 =[ $death2, dragon_die3 ] {monster_check_gib();}; +void() dragon_die3 =[ $death3, dragon_die4 ] {monster_check_gib(); self.solid = SOLID_NOT; }; +void() dragon_die4 =[ $death4, dragon_die5 ] {}; +void() dragon_die5 =[ $death5, dragon_die6 ] {/*monster_drop();*/}; +void() dragon_die6 =[ $death6, dragon_die7 ] {}; +void() dragon_die7 =[ $death7, dragon_die8 ] {}; +void() dragon_die8 =[ $death8, dragon_die9 ] {}; +void() dragon_die9 =[ $death9, dragon_die10 ] {}; +void() dragon_die10 =[ $death10, dragon_die11 ] {}; +void() dragon_die11 =[ $death11, dragon_die12 ] {}; +void() dragon_die12 =[ $death12, dragon_die13 ] {monster_death_postcheck();}; +void() dragon_die13 =[ $death13, dragon_die13 ] { monster_deadbody_check(); }; + +void() dragon_dieb1 =[ $deathb1, dragon_dieb2 ] {}; +void() dragon_dieb2 =[ $deathb2, dragon_dieb3 ] {monster_check_gib();}; +void() dragon_dieb3 =[ $deathb3, dragon_dieb4 ] {monster_check_gib(); self.solid = SOLID_NOT; }; +void() dragon_dieb4 =[ $deathb4, dragon_dieb5 ] {}; +void() dragon_dieb5 =[ $deathb5, dragon_dieb6 ] {/*monster_drop();*/monster_death_postcheck();}; +void() dragon_dieb6 =[ $deathb6, dragon_dieb6 ] { monster_deadbody_check(); }; + +void() dragon_die = { + monster_death_precheck(); + + // Snap tilt angles back to zero now. + self.angles_x = self.angles_z = 0; + + if (!self.gibbed) { + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + sound (self, CHAN_VOICE, "dragon/death1.wav", 1, ATTN_NORM); + if (random() < 0.5) { + // Shove it up a little for the fallback death anim. + self.velocity_z = 250 + 100*random(); + dragon_die1 (); + } else + dragon_dieb1 (); + } +}; + +//========================================================================== + +void() wyrm_explode = { + local entity swap; + local vector org; + local vector vx, vy, vz; + + // Lavasplash particles form a box with a size of 270x270x64. + // 135 * 1.4142 = 190.9188. So use 160 damage for explosion radius of 200. + // Damage first, then effects. + T_RadiusDamage (self, self, 160, self, DAMAGEALL); + sound (self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + Tent_Point (TE_LAVASPLASH, self.origin - '0 0 32'); + + // The big fireball at the center. + swap = self; + self = spawn(); + setorigin (self, swap.origin + '0 0 24'); + WarpExplosion (); + self = swap; + + // Spawn dragon parts. + self.health = -99; // Some gibs get some velocity. + + org = self.origin; + makevectors (self.angles); + vx = v_forward; vy = v_right; vz = v_up; + + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + // Throw dragon parts first. + // They will be thrown from a point relative to the body instead of randomly. + // Since we do not want to update corpse origin, don't use setorigin. + self.origin = org - vy*72 - vz*20; + ThrowIt ("progs/drake/dr2_lw.mdl", self.health, GIB_SKIN_MATCH); + self.origin = org + vy*72 - vz*20; + ThrowIt ("progs/drake/dr2_rw.mdl", self.health, GIB_SKIN_MATCH); + if ( self.frame == $deathb6 ) + self.origin = org - vx*72 - vz*20; + else + self.origin = org + vx*72 - vz*20; + ThrowIt ("progs/drake/dr2_tail.mdl", self.health, GIB_SKIN_MATCH); + self.origin = org; // Restore origin. + + // Throw random meat chunks. + ThrowGib (2, 5); + ThrowGib (3, 2); + + // Throw the head. Now we can set origin for real. + if ( self.frame == $deathb6 ) + org = org + (vx * 88); + else + org = org - (vx * 88); + setorigin (self, org); + ThrowHead (); +}; + +void() ryu_go = { + if (self.ryuflags & RYU_PATH) + wyrm_fly (); + else + ryu_run1 (); +}; + +void() wyrm_countdown = { + if (self.cnt > 0) + self.cnt = self.cnt - 1; + else + self.think = wyrm_explode; +}; + +void() wyrm_die1 =[ $death1, wyrm_die2 ] {}; +void() wyrm_die2 =[ $death2, wyrm_die3 ] {}; +void() wyrm_die3 =[ $death3, wyrm_die4 ] {}; +void() wyrm_die4 =[ $death4, wyrm_die5 ] {}; +void() wyrm_die5 =[ $death5, wyrm_die6 ] {/*monster_drop();*/}; +void() wyrm_die6 =[ $death6, wyrm_die7 ] {death_puff();}; +void() wyrm_die7 =[ $death7, wyrm_die8 ] {}; +void() wyrm_die8 =[ $death8, wyrm_die9 ] {}; +void() wyrm_die9 =[ $death9, wyrm_die10 ] {}; +void() wyrm_die10 =[ $death10, wyrm_die11 ] {}; +void() wyrm_die11 =[ $death11, wyrm_die12 ] {death_puff();}; +void() wyrm_die12 =[ $death12, wyrm_die13 ] {}; +void() wyrm_die13 =[ $death13, wyrm_die14 ] {death_puff(); self.nextthink = time + 0.2;}; +void() wyrm_die14 =[ $death13, wyrm_die15 ] {death_puff(); self.nextthink = time + 0.3;}; +void() wyrm_die15 =[ $death13, wyrm_die16 ] {death_puff(); self.nextthink = time + 0.2;}; +void() wyrm_die16 =[ $death13, wyrm_die16 ] {death_puff(); wyrm_countdown();}; + +void() wyrm_dieb1 =[ $deathb1, wyrm_dieb2 ] {}; +void() wyrm_dieb2 =[ $deathb2, wyrm_dieb3 ] {}; +void() wyrm_dieb3 =[ $deathb3, wyrm_dieb4 ] {}; +void() wyrm_dieb4 =[ $deathb4, wyrm_dieb5 ] {}; +void() wyrm_dieb5 =[ $deathb5, wyrm_dieb6 ] {/*monster_drop();*/}; +void() wyrm_dieb6 =[ $deathb6, wyrm_dieb7 ] {death_puff(); self.nextthink = time + 0.5;}; +void() wyrm_dieb7 =[ $deathb6, wyrm_dieb8 ] {death_puff(); self.nextthink = time + 0.4;}; +void() wyrm_dieb8 =[ $deathb6, wyrm_dieb9 ] {death_puff(); self.nextthink = time + 0.3;}; +void() wyrm_dieb9 =[ $deathb6, wyrm_dieb10 ] {death_puff(); self.nextthink = time + 0.2;}; +void() wyrm_dieb10 =[ $deathb6, wyrm_dieb10 ] {death_puff(); wyrm_countdown();}; + +// Special death for the dragon king. +void() wyrm_die = { + monster_death_precheck(); + + // Snap tilt angles back to zero now. + self.angles_x = self.angles_z = 0; + + // No gib check, no decapitation, just a simple death scene. + // Well, it is like Shub's with an initial dying anim then the big kaboom. + self.cnt = (random() * 10 + 5) & 15; // Extra explosions before last. + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + // The wyrm is a boss, so use full volume. + sound (self, CHAN_VOICE, "dragon/death1.wav", 1, ATTN_NONE); + if (random() < 0.5) { + // Shove it up a little for the fallback death anim. + self.velocity_z = 250 + 100*random(); + wyrm_die1 (); + } + else + wyrm_dieb1 (); +}; + +//========================================================================== + +//============ +// REVIVE +//============ +void() dragon_revive1 =[ $death12, dragon_revive2 ] {}; +void() dragon_revive2 =[ $death11, dragon_revive3 ] {}; +void() dragon_revive3 =[ $death10, dragon_revive4 ] {}; +void() dragon_revive4 =[ $death9, dragon_revive5 ] {}; +void() dragon_revive5 =[ $death8, dragon_revive6 ] {}; +void() dragon_revive6 =[ $death7, dragon_revive7 ] {}; +void() dragon_revive7 =[ $death6, dragon_revive8 ] {}; +void() dragon_revive8 =[ $death5, dragon_revive9 ] {}; +void() dragon_revive9 =[ $death4, dragon_revive10 ] {}; +void() dragon_revive10 =[ $death3, dragon_revive11 ] {}; +void() dragon_revive11 =[ $death2, dragon_revive12 ] {}; +void() dragon_revive12 =[ $death1, ryu_run ] {}; + +void() dragon_reviveb1 =[ $deathb5, dragon_reviveb2 ] {}; +void() dragon_reviveb2 =[ $deathb4, dragon_reviveb3 ] {}; +void() dragon_reviveb3 =[ $deathb3, dragon_reviveb4 ] {}; +void() dragon_reviveb4 =[ $deathb2, dragon_pain4 ] {}; + +void() dragon_revive = { + // Choose revive scene based on current frame. + self.flags = (self.flags - (self.flags & FL_ONGROUND)) | FL_FLY; + if ( self.frame == $deathb6 ) + dragon_reviveb1 (); + else + dragon_revive1 (); +}; + +void() dragon_win = { ryu_sfx_idle(); monster_sow(); }; + +float RYUSKIN_RED = 0; +float RYUSKIN_GREEN = 1; +float RYUSKIN_BLUE = 2; +float RYUSKIN_WHITE = 3; +float RYUSKIN_GOLD = 4; // Kept only for Soul of Evil. + +//============ +// --> QUAKED monster_ryu (1 0 0) (-56 -56 -24) (56 56 56) Ambush Boss Fast Slow +//============ +void() monster_ryu = { + local float powlevel, element, evade; + if (deathmatch) { remove(self); return; } + + precache_model ("progs/drake/dr1_head.mdl"); // Gib (head) + precache_model ("progs/drake/dr1_lw.mdl"); // Gib (left wing) + precache_model ("progs/drake/dr1_rw.mdl"); // Gib (right wing) + precache_model ("progs/drake/dr1_tail.mdl"); // Gib (tail) + precache_model ("progs/drake/dragon1.mdl"); // Qtest dragon (various sizes) + precache_model ("progs/drake/acidbal1.mdl"); // Bile bomb + precache_model ("progs/drake/flame2.mdl"); // Flames + precache_model ("progs/drake/flame2a.mdl"); // Flames + precache_model ("progs/drake/ice.mdl"); // Ice Shard + precache_model ("progs/drake/iceball.mdl"); // Ice Ball + precache_model ("progs/drake/plasma.mdl"); // Plasma ball + precache_model ("progs/drake/s_wave2.spr"); // Ice bolt ripple + precache_model ("progs/ad171/proj_wiz.mdl"); // Acid shot + precache_sound ("demon/dhit2.wav"); + precache_sound ("dragon/acid.wav"); + precache_sound ("dragon/death1.wav"); + precache_sound ("dragon/fire.wav"); + precache_sound ("dragon/firehit.wav"); + precache_sound ("dragon/fly.wav"); + precache_sound ("dragon/flywater.wav"); + precache_sound ("dragon/icehit.wav"); + precache_sound ("dragon/idle1.wav"); + precache_sound ("dragon/pain1.wav"); + precache_sound ("dragon/sight1.wav"); + precache_sound ("imp/shard.wav"); + precache_sound ("misc/power.wav"); // Discharge & Fizzle + precache_sound ("weapons/shatter.wav"); + precache_sound ("wizard/hit.wav"); + precache_sound ("plasma/explode.wav"); + precache_model ("progs/drake/dr2_head.mdl"); // Gib (head) + precache_model ("progs/drake/dr2_lw.mdl"); // Gib (left wing) + precache_model ("progs/drake/dr2_rw.mdl"); // Gib (right wing) + precache_model ("progs/drake/dr2_tail.mdl"); // Gib (tail) + precache_model ("progs/drake/dragon2.mdl"); // Qtest dragon (full-sized) + precache_model ("progs/drake/warp2.mdl"); // Big explosion + precache_sound ("boss1/out1.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound ("nemesant/bigboom.wav"); + + self.gib1mdl = "progs/drake/dr1_lw.mdl"; + self.gib2mdl = "progs/drake/dr1_rw.mdl"; + self.gib3mdl = "progs/drake/dr1_tail.mdl"; + + if (self.skin == RYUSKIN_GREEN) self.ryuflags = RYU_USE_ACID; + else if (self.skin == RYUSKIN_BLUE) self.ryuflags = RYU_USE_LITE; + else if (self.skin == RYUSKIN_WHITE) self.ryuflags = RYU_USE_ICE; + else self.ryuflags = RYU_USE_FIRE; //self.skin == RYUSKIN_RED + + // Ryu Elemental stats based on elemental type. + evade = TRUE; + element = self.ryuflags & RYU_ELEMENTS; + if (element == RYU_USE_ACID) { + /*ent.resist_acid = 0.5;*/ evade = FALSE; + if (self.deathstring == "") self.deathstring = " was melted by a Dragon\n"; + } else if (element == RYU_USE_LITE) { + self.resist_cells = 0.5; + if (self.deathstring == "") self.deathstring = " was blasted by a Dragon\n"; + } else if (element == RYU_USE_ICE) { + /*self.resist_cold = 0.5; self.resist_fire = -0.5;*/ evade = FALSE; + if (self.deathstring == "") self.deathstring = " was iced by a Dragon\n"; + } else { + // Default to fire. + element=RYU_USE_FIRE; + /*self.resist_fire = 0.5; + self.resist_cold = -0.5;*/ + if (self.deathstring == "") self.deathstring = " was fried by a Dragon\n"; + } + + // Set water evasion flag. + if (evade) { self.ryuflags = self.ryuflags | RYU_NO_WATER; } else { self.ryuflags = self.ryuflags - (self.ryuflags & RYU_NO_WATER); } + + self.ryuflags = self.ryuflags - (self.ryuflags & RYU_ELEMENTS); // Set breath attack flags. + self.ryuflags = self.ryuflags | element; + + // Fast = more alert -- better dodging and aiming. + // Slow = slower speed, poor tracking. + if (self.spawnflags & SPAWNx_SKILL == SPAWNx_SKILL) + powlevel = cvar("skill"); // Conflict -- let skill decide. + else if (self.spawnflags & SPAWN_FAST) + powlevel = 2; + else if (self.spawnflags & SPAWN_SLOW) + powlevel = 0; + else + powlevel = 1; + + if (cranked) powlevel = powlevel + 1; // Just increase awareness. + + // Set speed. + if (powlevel) { + self.spawnflags = self.spawnflags - (self.spawnflags & SPAWN_SLOW); + if (powlevel >= 2) + self.ryuflags = self.ryuflags | RYU_ALERT; + self.speed = 32; + } else + self.speed = 20; + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + + if (self.spawnflags & SPAWN_WYRM) { + self.headmdl = "progs/drake/dr2_head.mdl"; + self.mdl = "progs/drake/dragon2.mdl"; + self.th_stand = self.th_walk = self.th_run = wyrm_start; + self.ryuflags = self.ryuflags | RYU_PATH; + if (self.bboxtype < 1) self.bboxtype = BBOX_WYRM; + if (self.health < 1) self.health = 3000; + self.gibhealth = MON_NEVERGIB; + self.th_die = wyrm_die; + self.bossflag = TRUE; + self.classtype = CT_MONWYRM; + } else { + self.headmdl = "progs/drake/dr1_head.mdl"; + self.mdl = "progs/drake/dragon1.mdl"; + self.th_stand = ryu_stand1; + self.th_walk = ryu_walk1; + self.th_run = ryu_run1; + self.th_die = dragon_die; + self.th_melee = dragon_strike; + self.th_revive = dragon_revive; + if (self.bboxtype < 1) self.bboxtype = BBOX_RYU; + if (self.health < 1) self.health = 750; + self.gibhealth = -90; + if (!self.yaw_speed) self.yaw_speed = 20; // Same as walkmonster. + } + + self.sight_sound = "dragon/sight1.wav"; + self.th_missile = dragon_missile1; + self.th_pain = wyrm_pain; + self.th_checkattack = DragonCheckAttack; + self.th_win = dragon_win; + self.th_move = Wyrm_WalkMove; + self.th_goal = QC_MoveToGoal; + + //self.xfl = XFL_IMMUNITY | XFL_GHOST_BANE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if(!self.classtype) self.classtype = CT_MONRYU; + if (!self.classgroup) self.classgroup = CG_DRAGON; + self.classmove = MON_MOVEFLY; + + monster_start (); +}; + +void() monster_ryu_wyrm = { + self.spawnflags = self.spawnflags | SPAWN_WYRM; + self.classname = "monster_ryu"; + if (self.deathstring == "") self.deathstring = " was obliterated by a Wyrm Dragon\n"; + monster_ryu(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_scorpion.qc b/QC_other/QC_keep/mon_scorpion.qc new file mode 100644 index 00000000..134c0055 --- /dev/null +++ b/QC_other/QC_keep/mon_scorpion.qc @@ -0,0 +1,537 @@ +/*============================================================================== +Scorpion (Hexen2 model by Raven Software) +==============================================================================*/ +$frame attackA1 attackA2 attackA3 attackA4 attackA5 attackA6 attackA7 +$frame attackA8 attackA9 attackA10 attackA11 attackA12 attackA13 attackA14 +$frame attackA15 attackA16 attackA17 attackA18 attackA19 attackA20 attackA21 +$frame attackA22 attackA23 attackA24 attackA25 + +$frame attackB1 attackB2 attackB3 attackB4 attackB5 attackB6 attackB7 +$frame attackB8 attackB9 attackB10 attackB11 attackB12 attackB13 attackB14 +$frame attackB15 attackB16 attackB17 attackB18 attackB19 attackB20 attackB21 +$frame attackB22 attackB23 attackB24 attackB25 attackB26 attackB27 + +$frame attackC1 attackC2 attackC3 attackC4 attackC5 attackC6 attackC7 +$frame attackC8 attackC9 attackC10 attackC11 attackC12 attackC13 attackC14 +$frame attackC15 attackC16 attackC17 attackC18 attackC19 attackC20 attackC21 +$frame attackC22 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 death21 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8 +$frame pain9 pain10 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame ready1 ready2 ready3 ready4 ready5 ready6 ready7 ready8 +$frame ready9 ready10 ready11 + +$frame step1 step2 step3 step4 + +$frame stop1 stop2 stop3 stop4 stop5 stop6 stop7 stop8 stop9 + +$frame wake1 wake2 wake3 wake4 wake5 wake6 wake7 wake8 +$frame wake9 wake10 wake11 wake12 wake13 wake14 wake15 wake16 +$frame wake17 wake18 wake19 wake20 wake21 wake22 wake23 wake24 +$frame wake25 wake26 wake27 wake28 wake29 wake30 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +//====================================================================== +void() pinch_idle1 =[ $ready6, pinch_idle2 ] {monster_idle_sound();ai_stand();}; +void() pinch_idle2 =[ $ready7, pinch_idle3 ] {ai_stand();}; +void() pinch_idle3 =[ $ready8, pinch_idle4 ] {ai_stand();}; +void() pinch_idle4 =[ $ready9, pinch_idle5 ] {ai_stand();}; +void() pinch_idle5 =[ $ready10, pinch_idle6 ] {ai_stand();}; +void() pinch_idle6 =[ $ready11, pinch_idle7 ] {ai_stand();}; +void() pinch_idle7 =[ $ready10, pinch_idle8 ] {ai_stand();}; +void() pinch_idle8 =[ $ready9, pinch_idle9 ] {ai_stand();}; +void() pinch_idle9 =[ $ready8, pinch_idle10 ] {ai_stand();}; +void() pinch_idle10=[ $ready7, pinch_idle1 ] {ai_stand();}; + +//====================================================================== +void() pinch_walk1 =[ $walk2, pinch_walk2 ] {monster_idle_sound();ai_walk(3);}; +void() pinch_walk2 =[ $walk4, pinch_walk3 ] {monster_footstep(FALSE); ai_walk(2);}; +void() pinch_walk3 =[ $walk6, pinch_walk4 ] {ai_walk(3);}; +void() pinch_walk4 =[ $walk8, pinch_walk5 ] {ai_walk(4);}; +void() pinch_walk5 =[ $walk10, pinch_walk6 ] {ai_walk(3);}; +void() pinch_walk6 =[ $walk12, pinch_walk7 ] {monster_footstep(FALSE); ai_walk(2);}; +void() pinch_walk7 =[ $walk14, pinch_walk8 ] {ai_walk(3);}; +void() pinch_walk8 =[ $walk16, pinch_walk1 ] {ai_walk(4);}; + +//====================================================================== +void() pinch_run1 =[ $walk1, pinch_run2 ] {monster_idle_sound();ai_run(5);}; +void() pinch_run2 =[ $walk3, pinch_run3 ] {monster_footstep(FALSE); ai_run(4);}; +void() pinch_run3 =[ $walk5, pinch_run4 ] {ai_run(5);}; +void() pinch_run4 =[ $walk7, pinch_run5 ] {ai_run(6);}; +void() pinch_run5 =[ $walk9, pinch_run6 ] {ai_run(5);}; +void() pinch_run6 =[ $walk11, pinch_run7 ] {monster_footstep(FALSE); ai_run(4);}; +void() pinch_run7 =[ $walk13, pinch_run8 ] {ai_run(5);}; +void() pinch_run8 =[ $walk15, pinch_run1 ] {ai_run(6);}; + +//====================================================================== +// BITE Melee Range +//====================================================================== +void(float side) pinch_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESCORPION)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (self.meleeattack < 1) sound(self, CHAN_WEAPON, "scorpion/clawattack1.wav", TRUE, TRUE); + else sound(self, CHAN_WEAPON, "scorpion/clawattack2.wav", TRUE, TRUE); + self.meleeattack = 1 - self.meleeattack; + + // Scorpion claw + ldmg = (random() + random() + random()) * 4; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); +}; + +//---------------------------------------------------------------------- +void() pinch_claw1 =[ $attackB2, pinch_claw2 ] {ai_face();}; +void() pinch_claw2 =[ $attackB4, pinch_claw3 ] {ai_face();}; +void() pinch_claw3 =[ $attackB6, pinch_claw4 ] {ai_face();}; +void() pinch_claw4 =[ $attackB8, pinch_claw5 ] {pinch_melee(-100);}; +void() pinch_claw5 =[ $attackB10, pinch_claw6 ] {ai_face();}; +void() pinch_claw6 =[ $attackB12, pinch_claw7 ] {ai_face();}; +void() pinch_claw7 =[ $attackB14, pinch_claw8 ] {pinch_melee(100);}; +void() pinch_claw8 = [ $attackB16, pinch_claw9 ] {}; +void() pinch_claw9 = [ $attackB18, pinch_claw10 ] {}; +void() pinch_claw10 =[ $attackB20, pinch_run1 ] {}; + +//============================================================================ +// TAIL FUNCTION (range) +//============================================================================ +float TAILOFFSET = 8; + +//---------------------------------------------------------------------- +void() pinch_tailsound = +{ + if (self.meleeattack < 1) sound(self, CHAN_WEAPON, "scorpion/tailfire1.wav", TRUE, TRUE); + else sound(self, CHAN_WEAPON, "scorpion/tailfire2.wav", TRUE, TRUE); + self.meleeattack = 1 - self.meleeattack; +}; + +//---------------------------------------------------------------------- +void(vector tailofs) pinch_tailspike = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + pinch_tailsound(); + self.attack_speed = SPEED_SCORPTAIL + (skill * SPEED_SCORPSKILL); + makevectors(self.angles); + + // Generate spike at final animation position + org = self.origin + attack_vector(tailofs); + dir = self.enemy.origin + v_right*(TAILOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_SCORP, self.attack_speed+random()*25); + + dir = self.enemy.origin; + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_SCORP, self.attack_speed+random()*25); + + dir = self.enemy.origin - v_right*(TAILOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, CT_PROJ_SCORP, self.attack_speed+random()*25); +} + +//---------------------------------------------------------------------- +void() pinch_tail1 =[ $attackA2, pinch_tail2 ] {ai_face(); + if (self.lefty < 1) sound (self, CHAN_VOICE, "scorpion/tailattack1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "scorpion/tailattack2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; +}; +void() pinch_tail2 =[ $attackA4, pinch_tail3 ] {ai_face();}; +void() pinch_tail3 =[ $attackA6, pinch_tail4 ] {ai_face();}; +void() pinch_tail4 =[ $attackA8, pinch_tail5 ] {ai_face();}; +void() pinch_tail5 =[ $attackA10, pinch_tail6 ] {ai_face();}; +void() pinch_tail6 =[ $attackA12, pinch_tail7 ] {ai_face();pinch_tailsound();}; +void() pinch_tail7 =[ $attackA14, pinch_tail8 ] {pinch_tailspike('32 8 14');}; +void() pinch_tail8 = [ $attackA16, pinch_tail9 ] {pinch_tailsound();}; +void() pinch_tail9 = [ $attackA18, pinch_tail10 ] {ai_face();}; +void() pinch_tail10 =[ $attackA20, pinch_tail11 ] {}; +void() pinch_tail11 =[ $attackA22, pinch_run1 ] {ai_face();}; + +//============================================================================ +// JUMP FUNCTION (range) +//============================================================================ +void() pinch_jumptouch = +{ + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; //Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other scorpions with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + sound (self, CHAN_VOICE, "scorpion/jumphit.wav", 1, ATTN_NORM); + BleedDeBuff(other); + spawn_touchblood (self, self.enemy, 100); + } + + // Is the scorpion floating in the air? + if (!checkbottom(self)) { + // Is the scorpion standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() pinch_leap1 =[ $attackC1, pinch_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPSCORPTIME; + if (self.lefty < 1) sound (self, CHAN_VOICE, "scorpion/jumpattack1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "scorpion/jumpattack2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; +}; +void() pinch_leap2 =[ $attackC3, pinch_leap3 ] {ai_face(); }; +void() pinch_leap3 =[ $attackC5, pinch_leap4 ] {ai_face(); + // This is a crazy idea, throw the scorpion like a grenade! + // Using the same logic as the ogre grenade zware system + self.attack_speed = 575 + random()*50; + // Aiming the scorpion at the players head (+24 z axis) + self.pos2 = self.enemy.origin + '0 0 24'; + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.pos2, self.attack_speed); + self.pos1 = vectoangles(self.pos2 - self.origin); + self.pos1_x = -self.attack_elev; + makevectors (self.pos1); + self.velocity = v_forward * self.attack_speed; + self.jump_flag = time + MONAI_JUMPSCORPTIME; + self.touch = pinch_jumptouch; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() pinch_leap4 =[ $attackC7, pinch_leap5 ] {ai_face();}; +void() pinch_leap5 =[ $attackC8, pinch_leap6 ] {ai_face();}; +void() pinch_leap6 =[ $attackC9, pinch_leap8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = pinch_leap3; + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() pinch_leap8 =[ $attackC10, pinch_leap9 ] {ai_charge(4);}; +void() pinch_leap9 =[ $attackC11, pinch_leap10] {ai_charge(4);}; +void() pinch_leap10 =[ $attackC12, pinch_leap11] {ai_charge(4);}; +void() pinch_leap11 =[ $attackC14, pinch_leap12] {ai_charge(4);}; +void() pinch_leap12 =[ $attackC16, pinch_leap13] {ai_charge(4);}; +void() pinch_leap13 =[ $attackC18, pinch_leap14] { + if (ai_checkmelee(MONAI_MELEESCORPION) && self.enemy.health > 0) + self.think = pinch_claw2; +}; +void() pinch_leap14 =[ $attackC20, pinch_run1 ] {}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() pinch_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() pinch_grow1 = [ $grow1, pinch_grow2 ] {}; +void() pinch_grow2 = [ $grow2, pinch_grow3 ] {pinch_growangle();}; +void() pinch_grow3 = [ $grow3, pinch_grow4 ] {pinch_growangle();}; +void() pinch_grow4 = [ $grow4, pinch_grow5 ] {pinch_growangle();}; +void() pinch_grow5 = [ $grow5, pinch_grow6 ] {pinch_growangle();}; +void() pinch_grow6 = [ $grow6, pinch_grow7 ] {pinch_growangle();}; +void() pinch_grow7 = [ $grow7, pinch_grow8 ] {pinch_growangle();}; +void() pinch_grow8 = [ $grow8, pinch_grow9 ] {pinch_growangle();}; +void() pinch_grow9 = [ $grow9, pinch_grow10] {pinch_growangle();}; +void() pinch_grow10= [ $grow10, pinch_run1 ] { + // Is the scorpion stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = pinch_idle1; + self.th_walk = pinch_walk1; + self.th_run = pinch_run1; + self.th_melee = pinch_claw1; + self.th_missile = pinch_tail1; + } +}; + +//---------------------------------------------------------------------------- +void() pinch_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + pinch_grow1(); +}; + +//============================================================================ +void() pinch_painA1 =[ $pain1, pinch_painA2 ] {}; +void() pinch_painA2 =[ $pain3, pinch_painA3 ] {}; +void() pinch_painA3 =[ $pain5, pinch_painA4 ] {}; +void() pinch_painA4 =[ $pain7, pinch_painA5 ] {}; +void() pinch_painA5 =[ $pain9, pinch_run1 ] {}; + +void() pinch_painB1 =[ $pain2, pinch_painB2 ] {}; +void() pinch_painB2 =[ $pain4, pinch_painB3 ] {}; +void() pinch_painB3 =[ $pain6, pinch_painB4 ] {}; +void() pinch_painB4 =[ $pain8, pinch_painB5 ] {}; +void() pinch_painB5 =[ $pain10,pinch_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) pinch_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1 || self.pain_check == 2) { + // Different types of pain animations based on current attack + if (random() < 0.5) pinch_painA1(); + else pinch_painB1(); + } + } +}; + +//============================================================================ +void() pinch_die1 =[ $death1, pinch_die2 ] {}; +void() pinch_die2 =[ $death3, pinch_die3 ] {monster_check_gib();}; +void() pinch_die3 =[ $death5, pinch_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() pinch_die4 =[ $death7, pinch_die5 ] {}; +void() pinch_die5 =[ $death9, pinch_die6 ] {}; +void() pinch_die6 =[ $death11, pinch_die7 ] {}; +void() pinch_die7 =[ $death13, pinch_die8 ] {}; +void() pinch_die8 =[ $death15, pinch_die9 ] {}; +void() pinch_die9 =[ $death17, pinch_die10] {}; +void() pinch_die10 =[ $death19, pinch_die11] {monster_death_postcheck();}; +void() pinch_die11 =[ $death21, pinch_die11] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() pinch_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "scorpion/death1.wav", 1, ATTN_NORM); + pinch_die1(); + } +}; + +/*====================================================================== +/*QUAKED monster_scorpion (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() setup_scorpion; +void() monster_scorpion = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_scorpion.mdl"; + self.headmdl = "progs/ad171/h_scorpion.mdl"; // Front Jaws + self.gib1mdl = "progs/ad171/gib_scorpleg.mdl"; // Single Leg + self.gib2mdl = "progs/ad171/gib_scorptail.mdl"; // Tail + Sting + self.gib3mdl = "progs/ad171/gib_scorpclaw.mdl"; // Claw + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + // Random chance of 2 claws, or 2 legs + if (random() < 0.5) self.gib2mdl = self.gib3mdl; + else if (random() < 0.5) self.gib2mdl = self.gib1mdl; + + // IDLE/COMBAT and SIGHT sounds + if (self.spawnflags & MON_SCORPION_STINGER) { + self.idle_sound = "scorpion/idle1.wav"; + self.idle_sound2 = "scorpion/idle2.wav"; + self.sight_sound = "scorpion/sight1.wav"; + + precache_sound("scorpion/jumpattack1.wav"); + precache_sound("scorpion/jumpattack2.wav"); + precache_sound("scorpion/jumphit.wav"); + if (self.health < 1) self.health = 120; + self.gibhealth = -25; + self.idlemoreoften = TRUE; // More creepy idle sounds + self.exactskin = 3; // Black skin + } + else { + precache_model (MODEL_PROJ_SCORP); // Large green spike + self.idle_sound = "scorpion/warning1.wav"; + self.idle_sound2 = "scorpion/warning2.wav"; + self.sight_sound = "scorpion/hiss.wav"; + + precache_sound("scorpion/tailfire1.wav"); + precache_sound("scorpion/tailfire2.wav"); + precache_sound("scorpion/tailattack1.wav"); + precache_sound("scorpion/tailattack2.wav"); + if (self.health < 1) self.health = 80; + self.gibhealth = -20; + if (!self.exactskin) self.exactskin = rint((random()*3)-0.5); + } + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.sight_sound); + + // death/pain/attack sounds + precache_sound("scorpion/death1.wav"); + self.pain_sound = "scorpion/pain1.wav"; + self.pain_sound2 = "scorpion/pain2.wav"; + precache_sound(self.pain_sound); + precache_sound(self.pain_sound2); + + precache_sound("scorpion/clawattack1.wav"); + precache_sound("scorpion/clawattack2.wav"); + + // Cache scorpion is a special class used for precache only + if (self.classtype != CT_CACHESCORPION) setup_scorpion(); +}; + +//---------------------------------------------------------------------------- +void() monster_wraithminion2 = { + self.classtype = CT_CACHESCORPION; + monster_scorpion(); +}; + +//---------------------------------------------------------------------------- +void() setup_scorpion = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.yaw_speed = 30; // Very fast turning (def=20) + self.steptype = FS_TYPELIGHT; + self.pain_longanim = FALSE; // No long pain animation + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '32 0 10'; // Claw attack offset + self.attack_offset = '32 8 14'; // Nail attack offset + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = ScorpionCheckAttack; + self.th_pain = pinch_pain; + self.th_die = pinch_die; + + // Special spawning minion need to start spinning + if (self.classtype == CT_MINIONSCORPION) { + self.th_stand = self.th_walk = self.th_run = pinch_grow; + self.th_melee = self.th_missile = SUB_Null; + } + else { + self.th_stand = pinch_idle1; + self.th_walk = pinch_walk1; + self.th_run = pinch_run1; + self.th_melee = pinch_claw1; + // Black stinger jumps and regulars range attack + if (self.spawnflags & MON_SCORPION_STINGER) { + self.th_jump = pinch_leap1; + self.th_jumpexit = pinch_leap8; + } + else self.th_missile = pinch_tail1; + + } + + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was stung by a Scorpion\n"; + } else { + if (self.deathstring == "") self.deathstring = " was jabbed by a Scorpion\n"; + } + + self.gib1skin = self.gib2skin = self.gib3skin = self.exactskin; + if(!self.classtype) self.classtype = CT_MONSCORPION; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn scorpion (requires monster_scorpionspawn entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_scorpion = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + update_minioncount(self.owner, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_scorpion"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self.owner; // Spawner Parent Link + self.owner = minion; // Stop gibs interacting with minion + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONSCORPION; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + minion.spawnflags = 0; + + minion.mdl = "progs/ad171/mon_scorpion.mdl"; + minion.headmdl = "progs/ad171/h_scorpion.mdl"; // Front Jaws + minion.gib1mdl = "progs/ad171/gib_scorpleg.mdl"; // Single Leg + minion.gib2mdl = "progs/ad171/gib_scorptail.mdl"; // Tail + Sting + minion.gib3mdl = "progs/ad171/gib_scorpclaw.mdl"; // Claw + minion.exactskin = rint((random()*3)-0.5); + minion.gibhealth = -20; + minion.health = 80; + + minion.idle_sound = "scorpion/warning1.wav"; + minion.idle_sound2 = "scorpion/warning2.wav"; + minion.sight_sound = "scorpion/hiss.wav"; + + minion.pain_sound = "spider/pain1.wav"; + minion.pain_sound2 = "spider/pain2.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_scorpion; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_seeker.qc b/QC_other/QC_keep/mon_seeker.qc new file mode 100644 index 00000000..abc8c506 --- /dev/null +++ b/QC_other/QC_keep/mon_seeker.qc @@ -0,0 +1,803 @@ +/*============================================================================== +Seeker (Heavily inspired by Hunter from RRP - ijed) +==============================================================================*/ +// Slow moving run/walk animation +$frame run1 run2 run3 run4 run5 run6 run7 run8 +$frame run9 run10 run11 run12 run13 run14 run15 run16 run17 run18 run19 + +// stationary fire range attack (Not used) +$frame fire1 fire2 fire3 fire4 fire5 fire6 fire7 fire8 +$frame fire9 fire10 fire11 fire12 fire13 fire14 fire15 fire16 +$frame fire17 fire18 fire19 fire20 fire21 fire22 fire23 fire24 +$frame fire25 fire26 fire27 fire28 fire29 fire30 + +// right arm punch +$frame punch1 punch2 punch3 punch4 punch5 punch6 punch7 punch8 +$frame punch9 punch10 + +// fall backwards and die +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +// Stationary classic idle +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 + +// Run with LEFT arm missing +$frame runL1 runL2 runL3 runL4 runL5 runL6 runL7 runL8 +$frame runL9 runL10 runL11 runL12 runL13 runL14 runL15 runL16 +$frame runL17 runL18 runL19 + +// Run with RIGHT arm missing +$frame runR1 runR2 runR3 runR4 runR5 runR6 runR7 runR8 +$frame runR9 runR10 runR11 runR12 runR13 runR14 runR15 runR16 +$frame runR17 runR18 runR19 + +// Attack with LEFT arm missing +$frame fireL1 fireL2 fireL3 fireL4 fireL5 fireL6 fireL7 fireL8 +$frame fireL9 fireL10 fireL11 + +// Attack with RIGHT arm missing +$frame fireR1 fireR2 fireR3 fireR4 fireR5 fireR6 fireR7 fireR8 +$frame fireR9 fireR10 fireR11 + +// Attack with BOTH arms active (NEW) +$frame fireB1 fireB2 fireB3 fireB4 fireB5 fireB6 fireB7 fireB8 +$frame fireB9 fireB10 fireB11 + +// Death with LEFT arm missing +$frame deathL1 deathL2 deathL3 deathL4 deathL5 deathL6 deathL7 deathL8 +$frame deathL9 deathL10 deathL11 deathL12 + +// Death with RIGHT arm missing +$frame deathR1 deathR2 deathR3 deathR4 deathR5 deathR6 deathR7 deathR8 +$frame deathR9 deathR10 deathR11 deathR12 + +// Death with BOTH arm missing (special event) +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 deathB8 +$frame deathB9 deathB10 deathB11 deathB12 + +// Death with HEAD missing (special event) +$frame deathH1 deathH2 deathH3 deathH4 deathH5 deathH6 deathH7 deathH8 +$frame deathH9 deathH10 deathH11 deathH12 + +// Idle with LEFT arm missing +$frame standL1 standL2 standL3 standL4 standL5 standL6 standL7 standL8 +$frame standL9 standL10 standL11 standL12 standL13 standL14 standL15 standL16 +$frame standL17 standL18 standL19 + +// Idle with RIGHT arm missing +$frame standR1 standR2 standR3 standR4 standR5 standR6 standR7 standR8 +$frame standR9 standR10 standR11 standR12 standR13 standR14 standR15 standR16 +$frame standR17 standR18 standR19 + +float SEEKER_ARMS_BOTH = 0; +float SEEKER_ARMS_LEFT = 1; +float SEEKER_ARMS_RIGHT = 2; +float SEEKER_ARMSLESS = 3; +float SEEKER_HEADLESS = 4; + +float SEEKER_IDLE = 0; +float SEEKER_WALK = 1; +float SEEKER_FIRE = 2; +float SEEKER_DIE = 3; + +//============================================================================ +// Spark effect from missing arm joint +// Low chance out of combat (idle state) +//============================================================================ +void() seek_sparks_fade1 = [0, seek_sparks_fade2] {self.alpha = 0.8; self.nextthink = time + 0.05;}; +void() seek_sparks_fade2 = [0, seek_sparks_fade3] {self.alpha = 0.6; self.nextthink = time + 0.05;}; +void() seek_sparks_fade3 = [0, seek_sparks_fade4] {self.alpha = 0.4; self.nextthink = time + 0.05;}; +void() seek_sparks_fade4 = [0, SUB_Remove] {self.alpha = 0.2; self.nextthink = time + 0.05;}; + +void() seek_spark = +{ + local float loopvar; + local entity spark; + + if (self.state == SEEKER_ARMS_BOTH) return; + // Less chance of sparks when not in combat + if (random() > 0.1 && !self.enemy) return; + if (random() > 0.4 && self.enemy) return; + + // Light flash and sparky sound + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_BODY, self.noise3, 1, ATTN_STATIC); + makevectors (self.angles); + + // Change origin and spark direction for each arm + if (self.state == SEEKER_ARMS_LEFT) { + self.pos1 = self.origin + attack_vector('-4 -30 48'); + self.pos2 = -v_right*25; + } + else { + self.pos1 = self.origin + attack_vector('-4 30 48'); + self.pos2 = v_right*25; + } + + // Work out how many sparks to spawn + loopvar = rint(5 + random()*5); + while (loopvar > 0) { + spark = spawn(); + spark.classtype = CT_TEMPSPARK; + spark.classgroup = CG_TEMPENT; + spark.owner = self; + spark.movetype = MOVETYPE_BOUNCE; + spark.solid = SOLID_TRIGGER; + setmodel (spark, self.noise2); + setorigin (spark, self.pos1); + setsize (spark, VEC_ORIGIN, VEC_ORIGIN); + spark.skin = rint(random()*3); + spark.gravity = 0.3; + spark.velocity = vecrand(0,25,TRUE); + spark.velocity = spark.velocity + self.pos2; + spark.avelocity = '300 300 300'; + spark.nextthink = time + 0.5 + 1.5*random(); + spark.think = seek_sparks_fade1; + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) spark.effects = spark.effects + EF_NOSHADOW; + + // Keep looping for more sparks + loopvar = loopvar - 1; + } +}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() seek_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + } +}; + +//---------------------------------------------------------------------- +void() seek_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() seek_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +} + +//---------------------------------------------------------------------- +void() seek_setup_attachment = +{ + // Check if attachment has been setup yet + if (!self.attachment) seek_create_attachment(); + self.attachment.state = STATE_ON; + setmodel(self.attachment, self.weaponglow); + self.attachment.skin = 0; +} + +//---------------------------------------------------------------------- +void() seek_update_attachment = +{ + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = self.frame; + self.attachment.alpha = 0.3 + random()*0.7; +}; + +//============================================================================ +void() seek_standframe = +{ + // type of animation state + self.attack_timer = SEEKER_IDLE; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $standL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $standR1 + self.walkframe; + else self.frame = $stand1 + self.walkframe; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + else if (self.walkframe == 4) seek_spark(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 18) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = seek_standframe; + + if (self.spawnflags & MON_SEEK_SHIELD) seek_update_attachment(); + else ai_stand(); +}; + +//---------------------------------------------------------------------- +void() seek_stand = { + self.walkframe = 0; + if (self.spawnflags & MON_SEEK_SHIELD) seek_setup_attachment(); + seek_standframe(); +}; + +//============================================================================ +void() seek_walkframe = +{ + // If dead, no more updates + if (self.health < 1) return; + + // type of animation state + self.attack_timer = SEEKER_WALK; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $runL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $runR1 + self.walkframe; + else self.frame = $run1 + self.walkframe; + + // Beginning of animation block + if (self.walkframe == 0) monster_idle_sound(); + if (self.walkframe == 2 || self.walkframe == 12) monster_footstep(FALSE); + if (self.walkframe == 4) seek_spark(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe > 18) self.walkframe = 0; + self.nextthink = time + 0.1; + self.think = seek_walkframe; + + if (self.walkframe == 1) self.distance = 0; + else if (self.walkframe == 2) self.distance = 5; + else if (self.walkframe == 3) self.distance = 5; + else if (self.walkframe == 4) self.distance = 15; + else if (self.walkframe == 5) self.distance = 5; + + else if (self.walkframe == 6) self.distance = 7; + else if (self.walkframe == 7) self.distance = 12; + else if (self.walkframe == 8) self.distance = 7; + else if (self.walkframe == 9) self.distance = 5; + else if (self.walkframe == 10) self.distance = 3; + + else if (self.walkframe == 11) self.distance = 0; + else if (self.walkframe == 12) self.distance = 5; + else if (self.walkframe == 13) self.distance = 5; + else if (self.walkframe == 14) self.distance = 15; + else if (self.walkframe == 15) self.distance = 3; + + else if (self.walkframe == 16) self.distance = 7; + else if (self.walkframe == 17) self.distance = 12; + else if (self.walkframe == 18) self.distance = 7; + else if (self.walkframe == 0) self.distance = 8; + + if (self.lefty == FALSE) ai_walk(self.distance); + else ai_run(self.distance*2); +}; + +//---------------------------------------------------------------------- +void() seek_walk = { self.walkframe = 0; self.lefty = FALSE; seek_walkframe(); }; +void() seek_run = { self.walkframe = 0; self.lefty = TRUE; seek_walkframe(); }; + +//============================================================================ +// Melee attack +//============================================================================ +void() seek_punch = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + ai_face (); // Turn towards enemy target + ai_damagebreakable(50); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESEEKER)) return;// Too far away + + // Melee hit sound + sound (self, CHAN_WEAPON, "seeker/punch1.wav", 1, ATTN_NORM); + ldmg = (random() + random() + random()) * 20; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, -150); + SpawnMeatSpray (self, self.enemy, -150); +}; + +//---------------------------------------------------------------------- +void() seek_melee1 = [ $punch1, seek_melee2 ] {ai_face(); + self.pain_finished = time + 1; // Block pain animation + sound (self, CHAN_VOICE, "seeker/melee1.wav", 1, ATTN_NORM);}; +void() seek_melee2 = [ $punch2, seek_melee3 ] {ai_charge(15);}; +void() seek_melee3 = [ $punch3, seek_melee4 ] {ai_charge(20);}; +void() seek_melee4 = [ $punch4, seek_melee5 ] {ai_charge(25);}; +void() seek_melee5 = [ $punch5, seek_melee6 ] {ai_charge(30);}; +void() seek_melee6 = [ $punch6, seek_melee7 ] {ai_charge(30);}; +void() seek_melee7 = [ $punch7, seek_melee8 ] {ai_charge(30);seek_punch();}; +void() seek_melee8 = [ $punch8, seek_melee9 ] {}; +void() seek_melee9 = [ $punch9, seek_melee10 ] {}; +void() seek_melee10 = [ $punch10, seek_run ] {}; + +//============================================================================ +// Range attack - 3 rockets from each arm +//============================================================================ +void(vector leftofs, vector rightofs) seek_attack = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + // Setup different speeds for projectiles (rockets/laz0rs) + if (self.weaponstate == TRUE) + self.attack_speed = SPEED_SEEKLAZ + (skill * SPEED_SEEKLAZSKILL); + else + self.attack_speed = SPEED_SEEKROCK + (skill * SPEED_SEEKROCKSKILL); + + // turn and face your enemy! + ai_face(); + makevectors (self.angles); + + // Does the LEFT arm exist? + if (self.state == SEEKER_ARMS_BOTH || self.state == SEEKER_ARMS_LEFT) { + // Fire left arm rocket + org = self.origin + attack_vector(leftofs); + // Fire rocket slightly to the LEFT of player + vec = v_right*(10+random()*10); + dir = normalize((self.enemy.origin + vec) - org); + // Double check nothing (world/monsters) is blocking the rocket + if (visxray(self.enemy, leftofs, '0 0 0', FALSE)) { + if (self.weaponstate == TRUE) { + if (skill > SKILL_NORMAL) { + sound (self, CHAN_WEAPON, SOUND_PLASMA_FIRE, 1, ATTN_NORM); + launch_plasma(org, dir, CT_PROJ_PLASMA, self.attack_speed); + } + else { + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_LASER, self.attack_speed); + } + } + else { + sound (self, CHAN_WEAPON, "seeker/rocket_fire.wav", 1, ATTN_NORM); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_SEEKER, self.attack_speed); + } + } + } + + // Does the RIGHT arm exist? + if (self.state == SEEKER_ARMS_BOTH || self.state == SEEKER_ARMS_RIGHT) { + org = self.origin + attack_vector(rightofs); + // Fire rocket slightly to the RIGHT of player + vec = v_right*(10+random()*10); + dir = normalize((self.enemy.origin - vec) - org); + // Double check nothing (world/monsters) is blocking the rocket + if (visxray(self.enemy, rightofs, '0 0 0', FALSE)) { + if (self.weaponstate == TRUE) { + if (skill > SKILL_NORMAL) { + sound (self, CHAN_WEAPON, SOUND_PLASMA_FIRE, 1, ATTN_NORM); + launch_plasma(org, dir, CT_PROJ_PLASMA, self.attack_speed); + } + else { + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + launch_projectile(org, dir, CT_PROJ_LASER, self.attack_speed); + } + } + else { + sound (self, CHAN_WEAPON, "seeker/rocket_fire.wav", 1, ATTN_NORM); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_SEEKER, self.attack_speed); + } + } + } +}; + +//---------------------------------------------------------------------- +void() seek_fireframe = +{ + // If dead, no more updates + if (self.health < 1) return; + + // type of animation state + self.attack_timer = SEEKER_FIRE; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $fireL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $fireR1 + self.walkframe; + else self.frame = $fireB1 + self.walkframe; + + // Animation trigger events + if (self.walkframe == 0) { + // Work out which attack to do? lasers or rockets + self.enemydist = range_distance(self.enemy, TRUE); + if (self.enemydist < MONAI_RANGESWSEEKER) { + // Upgrade lasers to plasma with hard skill+ + if (skill > SKILL_NORMAL) + sound (self, CHAN_VOICE, "seeker/range_plasma.wav", 1, ATTN_NORM); + // Lasers at close range ONLY + else sound (self, CHAN_VOICE, "seeker/range_laser.wav", 1, ATTN_NORM); + self.weaponstate = TRUE; + } + else { + sound (self, CHAN_VOICE, "seeker/range_rocket.wav", 1, ATTN_NORM); + self.weaponstate = FALSE; + } + } + else if (self.walkframe == 5) seek_attack('40 33 30','25 -23 25'); + else if (self.walkframe == 7) seek_attack('33 30 28','23 -30 25'); + else if (self.walkframe == 9) seek_attack('33 36 27','35 -26 26'); + else ai_face(); + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + self.nextthink = time + 0.1; + if (self.walkframe > 10) self.think = seek_run; + else self.think = seek_fireframe; +}; + +//---------------------------------------------------------------------- +void() seek_fire = { self.walkframe = 0; seek_fireframe(); }; + +//============================================================================ +// This robot does not feel pain, just exploding debris +//============================================================================ +void() seek_arm_explode = +{ + particle_dust(self.pos2, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.pos2, "seeker/explode_major.wav"); + SpawnProjectileSmoke(self.pos2, 150, 50, 150); + SpawnProjectileSmoke(self.pos2, 150, 50, 150); + SpawnProjectileSmoke(self.pos2, 150, 50, 150); + // Throw 2 small metal blob + arm + self.gib1origin = self.gib2origin = self.pos2; + ThrowGib(11, 2); + ThrowGib(12, 1); + + // Make sure previous function is restored so correct + // arm animation is setup after one has been destroyed + if (self.attack_timer == SEEKER_WALK) self.think = seek_walkframe; + else if (self.attack_timer == SEEKER_FIRE) self.think = seek_fireframe; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) seek_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + + // There are no checks for shadow axe damage (pain_check = 1/2) + if (self.state == SEEKER_ARMS_BOTH) { + // Check for the chance to blow one of the arms off + self.pos1_x = self.health / self.max_health; + self.pos1_y = skill / 10; + self.pos1_z = self.pos1_x + self.pos1_y; +// dprint("Damage ("); dprint(ftos(damage)); +// dprint(") Chance ("); dprint(ftos(self.pos1_z)); +// dprint(")\n"); + + // Check for body damage and total damage done + // Is there a chance one of the arms will fall off? + if (damage > 25 && random() > self.pos1_z) { + if (random() > 0.5) { + self.state = SEEKER_ARMS_LEFT; + makevectors (self.angles); + self.pos2 = self.origin + attack_vector('0 -35 44'); + seek_arm_explode(); + } + else { + self.state = SEEKER_ARMS_RIGHT; + makevectors (self.angles); + self.pos2 = self.origin + attack_vector('0 35 44'); + seek_arm_explode(); + } + } + else { + // Spawn dust and sprite explosion + particle_dust(inflictor.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + } + } + else { + // Once down to one arm, just sparks and dust + particle_dust(inflictor.origin, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + SpawnProjectileSmoke(inflictor.origin, 150, 50, 150); + } + } +}; + +//============================================================================ +void() seek_explode = +{ + // Hide and Seek + entity_hide(self); + + // Regular ID particle explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Classic sprite/DP explosion + SpawnExplosion(EXPLODE_BIG, self.origin, "seeker/explode_major.wav"); + SpawnProjectileSmoke(self.origin, 150, 150, 150); + SpawnProjectileSmoke(self.origin, 150, 150, 150); + SpawnProjectileSmoke(self.origin, 150, 150, 150); + + // Throw a couple of random body pieces + if (random() < 0.5) ThrowGib(11, 1); + else ThrowGib(11, 2); + // Lets throw our arms in the air like we don't care! + if (self.state != SEEKER_ARMSLESS) ThrowGib(12, 1); + // Spew random metal1_2 rubble up + ThrowGib(13, 5 + rint(random()*5)); + ThrowGib(14, 5 + rint(random()*5)); + // If head still on shoulders, throw that as well! + if (self.state != SEEKER_HEADLESS) ThrowGib(25, 1); +}; + +//---------------------------------------------------------------------- +void() seek_dieframe = +{ + // type of animation state + self.attack_timer = SEEKER_DIE; + + if (self.walkframe == 2) self.solid = SOLID_NOT; + + // Check for arm status + if (self.state == SEEKER_ARMS_LEFT) self.frame = $deathL1 + self.walkframe; + else if (self.state == SEEKER_ARMS_RIGHT) self.frame = $deathR1 + self.walkframe; + else if (self.state == SEEKER_ARMSLESS) self.frame = $deathB1 + self.walkframe; + else if (self.state == SEEKER_HEADLESS) self.frame = $deathH1 + self.walkframe; + else self.frame = $death1 + self.walkframe; + + // Move frame forward, check for conditions + self.walkframe = self.walkframe + 1; + if (self.walkframe < 12) { + self.nextthink = time + 0.1; + self.think = seek_dieframe; + } + else { + // Explode after a while + self.nextthink = time + 3 + random()*2; + self.think = seek_explode; + } + + // Spawn some extra smoke trails + if (self.walkframe > 1 && random() < 0.5) { + // make sure the origin is coming out of the mech body + self.pos1 = self.origin + (crandom()*'16 16 0') + (random()*'0 0 24'); + SpawnProjectileSmoke(self.pos1, 200, 250, 100); + SpawnProjectileSmoke(self.pos1, 200, 250, 100); + if (random() < 0.5) + SpawnExplosion(EXPLODE_MED, self.pos1, "seeker/explode_minor.wav"); + } +}; + +//---------------------------------------------------------------------- +void() seek_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Long death sound with comedy bing at the end! + sound (self, CHAN_VOICE, "seeker/death1.wav", 1, ATTN_NORM); + // reset custom origins for body/arm gib parts + self.gib1origin = self.gib2origin = '0 0 0'; + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // Spawn dust and sprite explosion from chest area + makevectors(self.angles); + self.pos1 = self.origin + attack_vector('8 0 24'); + particle_dust(self.pos1, 10+random()*10, PARTICLE_BURST_YELLOW); + SpawnExplosion(EXPLODE_BIG, self.pos1, "seeker/explode_major.wav"); + SpawnProjectileSmoke(self.pos1, 200, 250, 100); + + // Random chance of head flying off body with both arms! + if (self.state == SEEKER_ARMS_BOTH && random() > 0.6) { + self.state = SEEKER_HEADLESS; + ThrowGib(25, 1); + } + // Random chance that remaining left/right arm falls off + else if (self.state < SEEKER_ARMSLESS && random() > 0.9) { + self.state = SEEKER_ARMSLESS; + ThrowGib(12, 1); + } + + // Start death sequence + self.walkframe = 0; + seek_dieframe (); +}; + +//============================================================================ +void() seek_shield = +{ + // Setup particle emitter for shield effect + self.part_active = PARTICLE_STYLE_FFIELD; + self.spr_frame = PARTICLE_BURST_BLUE; + self.part_vol = '24 24 32'; // Bounding box volume + self.part_limit = 100; // Large amount of particles + self.part_life = 4; // Longer lifetime + self.part_ofs = '0 0 32'; // Move up from monster origin + self.part_vel = '0 0 4'; // Move up from monster origin + self.part_emitter = spawn_pemitter(self, self, self.part_active, PARTICLE_START_ON); + seek_stand(); +}; + +//---------------------------------------------------------------------- +void() seek_wakeup = +{ + // Check for sudden death! + if (self.health < 0) return; + + self.use = SUB_Null; // no re-trigger + seek_finish_attachment(); // Remove shield + spawnflag + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SEEK_SHIELD); + + // Switch off shield sound + sound (self, CHAN_WEAPON, "ambience/power_off.wav", 1, ATTN_NORM); + // Switch OFF any particle emitter + if (self.part_emitter) misc_particle_off(self.part_emitter); + + // Check for any trigger off events (trigger_once) + if (self.target2 != "") trigger_strs(self.target2, self); + self.target2 = ""; + + // Restore all think functions + self.th_stand = seek_stand; + self.th_walk = seek_walk; + self.th_run = seek_run; + self.th_melee = seek_melee1; // Punch attack + self.th_missile = seek_fire; // Rockets incoming! + self.th_pain = seek_pain; + self.th_die = seek_die; + self.takedamage = DAMAGE_YES; // Can receive damage + monster_targets(); // Check for targets +}; + +/*====================================================================== +QUAKED monster_seeker (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_seeker = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_seeker.mdl"; + self.headmdl = "progs/ad171/h_seeker.mdl"; + self.weaponglow = "progs/ad171/mon_seeker_glow.mdl"; + // 4 poses 0=generic blob, 1=generic square, 2=generic blob2, 3=arm + self.gib1mdl = "progs/ad171/gib_seekchunk.mdl"; // types 0-2 + self.gib2mdl = "progs/ad171/gib_seekarm.mdl"; // arm only + self.gib3mdl = "progs/ad171/gib_metal1.mdl"; // Breakable metal + self.gib4mdl = "progs/ad171/gib_metal3.mdl"; // Breakable metal + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.weaponglow); // Glowing blue shield + precache_model (self.gib1mdl); // gib chunks + precache_model (self.gib2mdl); // Arms + precache_model (self.gib3mdl); // Generic metal1_2 + precache_model (self.gib4mdl); // Generic metal1_2 + self.gib1frame = 2; // 3 frames choose from + self.gibtype = GIBTYPE_METAL; // Metal impact sounds + + self.idle_sound = "seeker/idle1.wav"; + self.idle_sound2 = "seeker/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + self.pain_sound = "seeker/pain1.wav"; + self.pain_sound2 = "seeker/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("seeker/death1.wav"); + precache_sound ("seeker/explode_minor.wav"); + precache_sound ("seeker/explode_major.wav"); + // Power off sound for shield setup + precache_sound ("ambience/power_off.wav"); + + // Range attack 1 - rockets + precache_sound("seeker/range_rocket.wav"); + precache_sound("seeker/rocket_fire.wav"); + precache_sound("seeker/rocket_hit.wav"); + // Range attack 2 - lasers + precache_model (MODEL_PROJ_LASER); + precache_sound("seeker/range_laser.wav"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + // Range attack 3 - plasma + precache_model (MODEL_PROJ_PLASMA); + precache_sound ("seeker/range_plasma.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + // Melee attack - giant punch + precache_sound ("seeker/melee1.wav"); + precache_sound ("seeker/punch1.wav"); + + // Sparking from broken arm + self.noise2 = "progs/ad171/misc_spark.mdl"; + self.noise3 = "misc/spark.wav"; + precache_model (self.noise2); + precache_sound (self.noise3); + + self.sight_sound = "seeker/sight1.wav"; + precache_sound (self.sight_sound); + + // Check for any custom arm setups + if (self.state < SEEKER_ARMS_LEFT || self.state > SEEKER_ARMS_RIGHT) + self.state = SEEKER_ARMS_BOTH; // Both arms are active + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_GIANT; + if (self.health < 1) { + // if spawns with one arm, start with less HP + if (self.state == SEEKER_ARMS_BOTH) self.health = 500; + else self.health = 400; + } + + if (self.deathstring == "") self.deathstring = " was destroyed by a Seeker\n"; + + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Starts in one piece + self.pain_flinch = 400; // takes alot to pain + self.pain_timeout = 2; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.pain_longanim = FALSE; // cannot be chopped with shadow axe + if (self.death_dmg < 1) self.death_dmg = DAMAGE_SEEKER; + self.bouncegrenade = TRUE; // Grenades bounce + self.bleedcolour = MON_BCOLOR_WHITE; // Grey dust + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0.5; self.resist_cells = 0; + + // Custom feet sounds (specific order) + self.stepc1 = "seeker/footstep1.wav"; + self.stepc2 = "seeker/footstep2.wav"; + self.stepc3 = "seeker/footstep1.wav"; + self.stepc4 = "seeker/footstep2.wav"; + self.stepc5 = "seeker/footstep3.wav"; + precache_sound (self.stepc1); + precache_sound (self.stepc2); + precache_sound (self.stepc3); + precache_sound (self.stepc4); + precache_sound (self.stepc5); + self.steptype = FS_TYPECUSTOM; + self.hittype = HIT_METAL; + + if (self.spawnflags & MON_SEEK_SHIELD) { + self.th_stand = seek_shield; // Setup Shield + self.think1 = seek_wakeup; // Wakeup function when triggered + } + else { + self.th_stand = seek_stand; + self.th_walk = seek_walk; + self.th_run = seek_run; + self.th_melee = seek_melee1; // Punch attack + self.th_missile = seek_fire; // Rockets incoming! + self.th_pain = seek_pain; + self.th_die = seek_die; + } + + self.th_checkattack = SeekerCheckAttack; + self.classtype = CT_MONSEEKER; + self.classgroup = CG_ROBOT; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_sentinel.qc b/QC_other/QC_keep/mon_sentinel.qc new file mode 100644 index 00000000..eecfb864 --- /dev/null +++ b/QC_other/QC_keep/mon_sentinel.qc @@ -0,0 +1,208 @@ +void () sentinel_check_height = { + //if (self.origin_z > self.enemy.origin_z) { + // if above the enemy + // if ((self.origin_z - self.enemy.origin_z) > 16) ai_down(4); + //} else { + // if ((self.enemy.origin_z - self.origin_z) > 16) ai_up(4); + //} +}; + +void() SentinelFire = { + local vector vec, org; + + sentinel_check_height(); + + if (self.attack_finished < time) { + if (self.enemy == world || !enemy_vis) return; + if (self.spawnflags & 4) { + sound (self, CHAN_WEAPON, "sentinel/nail.wav", 1, ATTN_NORM); + } else { + sound (self, CHAN_WEAPON, "sentinel/laser.wav", 1, ATTN_NORM); + } + self.attack_finished = time + self.wait; + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + if (self.spawnflags & 4) { + launch_projectile(org, vec, CT_PROJ_SNG, SPEED_TRAPSPIKE); + } else { + launch_projectile(org, vec, CT_PROJ_LASER, SPEED_LASER); + } + } +}; + +void() sentinel_writhe1 =[0, sentinel_writhe2 ] {monster_idle_sound();ai_stand();}; +void() sentinel_writhe2 =[1, sentinel_writhe3 ] {ai_stand();}; +void() sentinel_writhe3 =[2, sentinel_writhe4 ] {ai_stand();}; +void() sentinel_writhe4 =[3, sentinel_writhe5 ] {ai_stand();}; +void() sentinel_writhe5 =[4, sentinel_writhe6 ] {ai_stand();}; +void() sentinel_writhe6 =[5, sentinel_writhe7 ] {ai_stand();}; +void() sentinel_writhe7 =[6, sentinel_writhe8 ] {ai_stand();}; +void() sentinel_writhe8 =[7, sentinel_writhe9 ] {ai_stand();}; +void() sentinel_writhe9 =[8, sentinel_writhe10 ] {ai_stand();}; +void() sentinel_writhe10 =[9, sentinel_writhe1 ] {ai_stand();}; + +void() sentinel_run1 =[0, sentinel_run2 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run2 =[1, sentinel_run3 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run3 =[2, sentinel_run4 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run4 =[3, sentinel_run5 ] {SentinelFire();monster_idle_sound(); ai_runfly(8);}; +void() sentinel_run5 =[4, sentinel_run6 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run6 =[5, sentinel_run7 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run7 =[6, sentinel_run8 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run8 =[7, sentinel_run9 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run9 =[8, sentinel_run10 ] {SentinelFire();ai_runfly(8);}; +void() sentinel_run10 =[9, sentinel_run1 ] {SentinelFire();ai_runfly(8);}; + +void() sentinel_attack1 =[9, sentinel_run1 ] {SentinelFire();}; +//void() sentinel_attack2 =[1, sentinel_attack3 ] {SentinelFire();}; +//void() sentinel_attack3 =[2, sentinel_attack4 ] {SentinelFire();}; +//void() sentinel_attack4 =[3, sentinel_attack5 ] {SentinelFire();}; +//void() sentinel_attack5 =[4, sentinel_attack6 ] {SentinelFire();}; +//void() sentinel_attack6 =[5, sentinel_attack7 ] {SentinelFire();}; +//void() sentinel_attack7 =[6, sentinel_attack8 ] {SentinelFire();}; +//void() sentinel_attack8 =[7, sentinel_attack9 ] {SentinelFire();}; +//void() sentinel_attack9 =[8, sentinel_attack10 ] {SentinelFire();}; +//void() sentinel_attack10 =[9, sentinel_run1 ] {SentinelFire();}; + +void() sentinel_pain1 = [10, sentinel_pain2] {}; +void() sentinel_pain2 = [10, sentinel_pain3] {}; +void() sentinel_pain3 = [10, sentinel_pain4] {}; +void() sentinel_pain4 = [10, sentinel_pain5] {}; +void() sentinel_pain5 = [10, sentinel_pain6] {}; +void() sentinel_pain6 = [15, sentinel_writhe1] {}; + +void(entity inflictor, entity attacker, float damage) sentinel_pain = { + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + sentinel_pain1(); + self.pain_finished = time + 2; + } +}; + +void(entity own) sentinel_death_fx = { + local entity puff; + local vector vrand; + + puff = spawn(); + puff.owner = own; + puff.solid = SOLID_NOT; + puff.touch = SUB_Null; + puff.movetype = MOVETYPE_NONE; + puff.velocity = '0 0 0'; + puff.frame = 21; + puff.idleweaponframe = 34; + vrand_x = (crandom()*16); + vrand_y = (crandom()*16); + vrand_z = (crandom()*16); + puff.origin = own.origin + vrand; + puff.mdl = "progs/quoth2pt2full/s_vp_pll.spr"; + setmodel(puff,"progs/quoth2pt2full/s_vp_pll.spr"); + puff.think = BDW_SpriteGenericPlayOnce; + puff.nextthink = time + 0.05; +}; + +void(entity own) sentinel_death_fx2 = { + local entity puff; + local vector vrand; + + puff = spawn(); + puff.owner = own; + puff.solid = SOLID_NOT; + puff.touch = SUB_Null; + puff.movetype = MOVETYPE_NONE; + puff.velocity = '0 0 0'; + puff.frame = 35; + puff.idleweaponframe = 51; + vrand_x = (crandom()*16); + vrand_y = (crandom()*16); + vrand_z = (crandom()*16); + puff.origin = own.origin + vrand; + puff.mdl = "progs/quoth2pt2full/s_vp_pll.spr"; + setmodel(puff,"progs/quoth2pt2full/s_vp_pll.spr"); + puff.think = BDW_SpriteGenericPlayOnce; + puff.nextthink = time + 0.15; +}; + +void() sentinel_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + sound (self, CHAN_VOICE, "", 1, ATTN_NORM); + self.solid = SOLID_NOT; + SpawnProjectileSmoke(self.origin, 150, 50, 150); + SpawnProjectileSmoke(self.origin, 150, 50, 150); + sentinel_death_fx(self); + sentinel_death_fx2(self); + + ThrowGib(11,1); + ThrowGib(12,2); + self.think = SUB_Remove; + self.nextthink = time + 0.100; +}; + +void() monster_sentinel = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/quoth2pt2full/sentinel.mdl"; + precache_model("progs/quoth2pt2full/sentinel.mdl"); + precache_model("progs/ad171/proj_laz.mdl"); + precache_model("progs/quoth2pt2full/gib.mdl"); + precache_model("progs/quoth2pt2full/wreckage.mdl"); + precache_model("progs/quoth2pt2full/s_vp_pll.spr"); + + precache_sound("enforcer/enfire.wav"); + precache_sound("enforcer/enfstop.wav"); + precache_sound("sentinel/laser.wav"); + precache_sound("sentinel/nail.wav"); + precache_sound("sentinel/widle1.wav"); + precache_sound("sentinel/widle2.wav"); + precache_sound("sentinel/wpain.wav"); + precache_sound("sentinel/wsight.wav"); + precache_sound("misc/null.wav"); + + self.gib1mdl = "progs/quoth2pt2full/gib.mdl"; + self.gib2mdl = "progs/quoth2pt2full/wreckage.mdl"; + + self.sight_sound = "sentinel/wsight.wav"; + self.idle_sound = "sentinel/widle1.wav"; + self.idle_sound2 = "sentinel/widle2.wav"; + self.pain_sound = "sentinel/wpain.wav"; + self.pain_flinch = 75; + self.gibondeath = TRUE; + self.attack_offset = '0 0 16'; + if (self.wait <= 0) self.wait = 0.2; + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 150; + + if (self.spawnflags & 4) { + self.skin = 1; + } + + if (self.deathstring == "") self.deathstring = " was scorched by a Sentinel\n"; + self.th_run = sentinel_run1; + self.th_walk = sentinel_writhe1; + self.th_stand = sentinel_writhe1; + self.th_missile = sentinel_attack1; + self.th_pain = sentinel_pain; + self.th_die = sentinel_die; + self.height = -16; + + self.hittype = HIT_METAL; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0; + self.resist_cells = 0; + + self.classtype = CT_MONSENTINEL; + self.classgroup = CG_ROBOT; // One big happy ogre family! + self.classmove = MON_MOVEFLY; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_shade.qc b/QC_other/QC_keep/mon_shade.qc new file mode 100644 index 00000000..174d4e46 --- /dev/null +++ b/QC_other/QC_keep/mon_shade.qc @@ -0,0 +1,908 @@ +//========================================================================== +// shade.qc -- by Patrick Martin +//-------------------------------------------------------------------------- +// Nightshade, a.k.a. the wraith dragon. +// +// The nightshade shares some of the code and files used by the dragons. +// However, it is treated as a separate monster. +// +// In addition, the nightshade has its own model. It is derived from +// the dragon model, but most of the scenes are different. +// The spawn scene is placed first so the phasing effects animate +// properly on Quake engines that support frame interpolation. +// +// Frames: +// 0 - 6 Form +// 7 - 14 Hover +// 15 - 23 Attack (for melee or missile) +// 24 - 29 Pain #1 +// 30 - 35 Pain #2 +// 36 - 41 Pain #3 +// 42 - 59 Aether +// 60 - 77 Death +// +// Update: With Nehahra-style wraiths added, the medium dragon is the +// only size that looks good with all of the other ghosts. +// +// NOTE: Should be compiled *after* "zombie.qc" and "ryu*.qc" files. +// +//========================================================================== +$cd progs/shade +$origin 0 0 24 +$base base +$skin skin + +$frame form1 form2 form3 form4 form5 form6 form7 +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 +$frame attack1 attack2 attack3 attack4 attack5 attack6 +$frame attack7 attack8 attack9 +$frame pain1 pain2 pain3 pain4 pain5 pain6 +$frame painb1 painb2 painb3 painb4 painb5 painb6 +$frame painc1 painc2 painc3 painc4 painc5 painc6 + +//$frame aether1 aether2 aether3 aether4 aether5 aether6 aether7 aether8 +//$frame aether9 aether10 aether11 aether12 aether13 aether14 aether15 +//$frame aether16 aether17 aether18 + +$frame nova1 nova2 nova3 nova4 nova5 nova6 nova7 nova8 nova9 nova10 +$frame nova11 nova12 nova13 nova14 nova15 nova16 nova17 nova18 + +//////////////////////////////////////////////////////////////////////////// +// 1. Nightshade AI // +//////////////////////////////////////////////////////////////////////////// +//========================================================================== +// Nightshade Combat +//------------------------------------------------------------------------// +// Check if an attack can be made. +//------------------------------------------------------------------------// +void() Shade_CheckAttack = { + if (enemy_range > RANGE_MID) + { // Nightshade cannot attack from long range (1000+). + self.attack_state = AS_STRAIGHT; // Don't fly too far away. + return; + } + + local vector spot1, spot2; + local entity targ; + local float chance; + local float pause; + + targ = self.enemy; + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + // FIXME: Add wall check here if necessary. Currently, + // enemy_vis in dark_run does this already... + + // Check if attack is blocked by creature. + // If so, flag it so dragon may try to move around it vertically. + traceline (spot1, spot2, FALSE, self); + if ((trace_ent != targ) && (trace_fraction < 1)) + { + targ = trace_ent; + if (targ) + if (targ.solid == SOLID_SLIDEBOX) + if (targ.health) + self.attack_state = AS_SLIDING; + + return; + } + + // If target is reachable within melee range, so attack if possible. + if (enemy_range == RANGE_MELEE) + if (self.th_melee) + if (CanDamage (targ, self)) + { + self.attack_state = AS_MELEE; + return; + } + +// missile attack + // Check if nightshade can shoot. + if (!self.th_missile) + { + self.attack_state = AS_STRAIGHT; + return; + } + //if (IsGhost (self.enemy)) + //{ // Missiles can't hit. + // self.attack_state = AS_STRAIGHT; + // return; + //} + + // Check if allowed to attack. + if (time < self.attack_finished) + return; + + // Determine the chance that the nightshade will attack. + if (enemy_range == RANGE_MELEE) + {self.attack_finished = 0; chance = 0.9;} + else if (enemy_range == RANGE_NEAR) // Short range (120-500) + chance = 0.2; + else //if (enemy_range == RANGE_MID) // Medium range (500-1000) + chance = 0.05; + + if (random () < chance) + { + self.th_missile (); + pause = random() * 2 + 1; + SUB_AttackFinished (pause); + return; + } + + // If the function made it this far, the nightshade moves on. + return; +}; + + +//========================================================================== +// Vertical Movement +// +// Noclip movement means the nightshade does not need any clip prevention +// functions (walls, water, or whatever). Therefore, the nightshade have +// its own movement functions, generally simpler than those used by the +// dragon. +//========================================================================== + +// This lets the nightshade slide vertically away from some entity. +void(float dist, entity ent) Shade_VerticalSlide = +{ +// Fly away from goal. +// Note: Don't bother with the extra checks dragons go through. + if (ent.origin_z <= self.origin_z) + self.velocity_z = self.velocity_z + (dist * 10); + else + self.velocity_z = self.velocity_z - (dist * 10); +}; + +// This finds the best path to avoid danger, then moves the monster +// along the path. +void(float dist, entity ent) Shade_FindBestPath = +{ + local float yaw; + local entity targ; + + yaw = vectoyaw (ent.origin - self.origin); + yaw = Ryu_ChangeCourse (yaw - self.angles_y); + // Ghost monsters cannot be blocked. + +// Set new course and head in that direction if possible. +// Formerly 'Shade_Dodge (self.angles_y + yaw, dist, ent);'. +// void(float newyaw, float dist, entity threat) Shade_Dodge = +// This forces the nightshade to dodge the threat entity. + yaw = self.angles_y + yaw; + +// Strafe away from the detected danger. + noclip_move (yaw, dist); + + targ = self.goalentity; + +// Face its goal. + self.ideal_yaw = vectoyaw (targ.origin - self.origin); + ChangeYaw (); + +// Next, check if the monster should slide vertically away from its goal. + if (targ != ent) + { + // For elevation, if dragon is between the goal and threat entity, + // don't slide vertically away from goal. + local float tz, sz; + + tz = targ.origin_z; + sz = self.origin_z + self.view_ofs_z; + if (tz < sz) + {if (sz < ent.origin_z) return;} + else if (tz > sz) + {if (sz > ent.origin_z) return;} + } + Shade_VerticalSlide (dist, targ); +}; + + +// Close in on the opponent. +void() dark_melee = { + ai_face(); + movetogoal (SPEED_RYU_MIN); +}; + +// Face and close in on the opponent while attacking. +void() dark_missile = { + ai_face(); + if (!QC_CloseEnough (SPEED_RYU_MIN)) // Don't pass through goal. + walkmove (self.angles_y, SPEED_RYU_MIN); +}; + +//------------------------------------------------------------------------// +// The dragon rotates in place (via multiple calls to this function) +// until it faces its opponent. Upon facing an opponent, the dragon +// will launch an attack. +//------------------------------------------------------------------------// +void() dark_run_attack = { + // Rotate to face opponent. + self.ideal_yaw = enemy_yaw; + ChangeYaw (); + + // Check if facing opponent. If so, attack! + if (FacingIdeal ()) + { + self.attack_state = AS_STRAIGHT; + if (enemy_range == RANGE_MELEE) + if (self.th_melee) + {self.th_melee (); return;} + if (self.th_missile) + {self.th_missile (); return;} // Switch back to missile attack. + } + + // Break off the attack if too close to another nightshade. + //if (Shade_AvoidGhost (self.speed)) + // self.attack_state = AS_STRAIGHT; +}; + +//- - - - - - - - - +// 'souls' function for nightshade. +void() dark_souls = {ai_face (); self.gorging = TRUE;}; +//- - - - - - - - - + +//------------------------------------------------------------------------// +// The dragon is flying around while fighting. It may attack, +// dodge missiles, or just simply move toward the opponent at +// normal running speed. +//------------------------------------------------------------------------// +void() dark_run = { + if (self.enemy.health <= 0) return; + + // check knowledge of enemy + enemy_vis = visible (self.enemy); + if (enemy_vis) + self.search_time = time + 5; + + if (self.search_time < time) { + // Hasn't seen enemy in a while. Get out of strafe mode. + if (self.attack_state == AS_SLIDING) + self.attack_state = AS_STRAIGHT; + + // Look for other players. Do this in single player as well + // in coop/dm because good monsters act like extra players. + if (FindTarget ()) + return; + + //if (self.master) + // if (self.enemy != self.master) + // {ai_run_done(); return;} // Stop chase and return to master. + } + + // Check for attack. +// enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + + if (self.attack_state == AS_MELEE) + {dark_run_attack (); return;} + + if (enemy_vis) + Shade_CheckAttack (); + //if (Shade_AvoidGhost (self.speed)) // Avoid other nightshades. + //return; + + //- - - - - - - - - + // Head straight in... + // + // Faster, larger nightshade may have trouble closing in for melee. + // If stalled, fly in at minimum speed to move in. + // + // Since velocity movement is done in the prethink phase of each frame, + // the velocity set in this frame does not take effect until next frame, + // which means the movement code must be different from the dragon. + //- - - - - - - - - + if (self.velocity == '0 0 0') + movetogoal (SPEED_RYU_MIN); + else + movetogoal (self.speed); + + // Check if in strafe mode. + if (self.attack_state == AS_SLIDING) + { + Shade_VerticalSlide (self.speed, self.enemy); + if (pointcontents (self.origin) == CONTENT_SOLID) + self.attack_state = AS_STRAIGHT; + } +}; + + +//////////////////////////////////////////////////////////////////////////// +// 2. Pawns -- Zombies // +//////////////////////////////////////////////////////////////////////////// + +//========================================================================== +// Nightshade Projectile Attack + +float MAX_ZOMBIES = 5; + +//------------------------------------------------------------------------// +// This tries to create a zombie. If successful, it then sends it off. +//------------------------------------------------------------------------// +void() Shade_MeatSummon = +{ + //if (self.master) + //if (!IsDead (self.master)) + //if (self.master.pets < MAX_ZOMBIES) + //if (self.master.enemy) + //if (self.flags & FL_ONGROUND) + //SpawnMonster_Point (self.master, self.origin + '0 0 41', ID_ZOMBIE); + remove (self); +}; + +//------------------------------------------------------------------------// +// This checks if a missed shot is on the ground. If not, the shot +// is removed. Otherwise, it remains for a few seconds before it is +// removed permanently or it becomes a zombie. +//------------------------------------------------------------------------// +void() Shade_MeatMiss = +{ + if (!(self.flags & FL_ONGROUND)) + {remove (self); return;} // Didn't touch ground, remove it. + +// Let the missile's blood trail fade before spawning a monster. + self.avelocity = '0 0 0'; // On the ground -- stop spinning. + self.nextthink = time + 2; // Lay dormant for a moment before growth. + if (self.cnt) + self.think = Shade_MeatSummon; + else + self.think = SUB_Remove; +}; + +//------------------------------------------------------------------------// +// A gib inflicts damage on contact. If the gib misses, it may +// form into a zombie later. +//------------------------------------------------------------------------// +void() Shade_MeatTouch = +{ + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + //if (Reflected ()) + //return; + + // hit something that bleeds + if (other.takedamage) + { + spawn_touchblood (self, other, 10); + T_Damage (other, self, self.owner, 10,DAMARMOR); + remove (self); + } + else + { + // Make a little splat. + sound (self, CHAN_WEAPON, "wizard/hit.wav", 1, ATTN_NORM); + spawn_touchblood (self, other, 10); + + // Make the shot non-solid and check if it can become a zombie. + // Call rest of touch code a frame later because the onground flag + // is never on. + self.solid = SOLID_NOT; + self.touch = SUB_Null; + self.nextthink = 0.01; + self.think = Shade_MeatMiss; + } +}; + +//------------------------------------------------------------------------// +// The nightshade shoots a bloody gib at its target. +//------------------------------------------------------------------------// +void() Shade_Meat = +{ + local vector org; // Location of dragon's mouth. + local vector dir; // Vector from 'org' to gib target. + local vector vec, vy; + local float mx; // Length of dir, which is 0 <= x <= 1. + local float sped; // Missile speed. + local float up; // Extra up speed. + local float loop, spread, arc; + + up = 200; + sped = 800; // Dragons use 'height * 200 + 800'. + org = '50 -5 -7'; + + makevectors(self.angles); + vy = v_right; + org = self.origin + (v_forward*org_x) + (v_right*org_y) + (v_up*org_z); + dir = self.enemy.origin + self.enemy.view_ofs; + dir = Maim_Toss (org, dir, sped, up, world, '0 0 0'); + mx = vlen(dir); + + sound (self, CHAN_WEAPON, "shade/spawn.wav", 1, ATTN_NORM); + +// Fire # of shots equal to max zombies. + arc = 0.06; + loop = 5; + spread = (loop - 1) * arc; +// if (!(loop & 1)) +// { // Even number of shots, so shoot the extra to either left or right. +// if ((time * 10) & 1) // Use instead of 'random() < 0.5'? +// spread = spread - arc; +// else +// spread = spread + arc; +// } + while (loop > 0) + { + vec = dir + (vy * spread); + vec = normalize(vec) * mx; + + // Shoot some meat. Change some properties to allow some freaky magic. + Meat_Launch (org, vec); + newmis.movetype = MOVETYPE_TOSS; + newmis.master = self; + newmis.velocity = vec * sped; + newmis.velocity_z = newmis.velocity_z + up; + newmis.touch = Shade_MeatTouch; + newmis.nextthink = time + 6; // Same as spikes. + newmis.cnt = loop & 1; // Spawn monster (0=no, 1=yes) + + spread = spread - arc - arc; + loop = loop - 1; + } +}; + + +//////////////////////////////////////////////////////////////////////////// +// 3. Animation // +//////////////////////////////////////////////////////////////////////////// + +//========================================================================== +// Movement Scenes + +//////////////////////////////////////////////////////////////////////////// +// When the nightshade is phased out, it is invisible and invincible. // +// The .takedamage field is used to determine whether the nightshade // +// is phased in or out. // +//////////////////////////////////////////////////////////////////////////// + +// Sets the nightshade's alpha. +void(float mx) shade_alpha = { self.alpha = mx; }; + +// Set the nightshade's speed. It gets faster when hurt -- "Now I'm angry!" +void() shadow_speed = //{self.speed = 24;}; +{ + local float sped; + + if (self.max_health >= 1) + { + sped = 1 - (self.health / self.max_health); + if (sped < 0) + sped = 0; + sped = (sped * 16) & 15; + } + else + sped = 0; + self.speed = 20 + sped; +}; + +//------------------------------------------------------------------------// +// This lets the nightshade make spooky noises as it drifts. +// Assumes the nightshade has phased out and is not attacking. +//------------------------------------------------------------------------// +void() shade_sfx_idle = +{ + if (self.waitmin < time) + if (random() < 0.01) + { + local float r; + + r = random (); + if (r < 0.5) + sound (self, CHAN_VOICE, "shade/idle.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "shade/taunt.wav", 1, ATTN_NORM); + + // Don't make any more noise for a while. + self.waitmin = time + 3; + } +}; + +//------------------------------------------------------------------------// +// This changes the nightshade model. Size must be reset after the +// model change each time. +//------------------------------------------------------------------------// +void(float in) shadow_phase = +{ + if (in) + { // Phase in. + shade_alpha(0.7); + //self.modelindex = self.mindex2; + self.takedamage = DAMAGE_AIM; + } + else { + // Phase out. + shade_alpha (0.01); + //self.modelindex = 0; + self.takedamage = DAMAGE_NO; + } +}; + +//------------------------------------------------------------------------// +// The nightshade phases out and remains in place, totally silent. +//------------------------------------------------------------------------// +// STAND - - - - - - - - - - - - - - - - +void() shade_stand = { + //if (self.spawnflags & SPAWN_SOUL) + //if (Wraith_FindSoul ()) + //{self.th_run(); return;} + ai_stand(); +}; +void() shadow_stand1 =[ $form7, shadow_stand2 ] {shade_alpha (0.7); shade_stand();}; +void() shadow_stand2 =[ $form6, shadow_stand3 ] {shade_alpha (0.6); shade_stand();}; +void() shadow_stand3 =[ $form5, shadow_stand4 ] {shade_alpha (0.5); shade_stand();}; +void() shadow_stand4 =[ $form4, shadow_stand5 ] {shade_alpha (0.4); shade_stand();}; +void() shadow_stand5 =[ $form3, shadow_stand6 ] {shade_alpha (0.3); shade_stand();}; +void() shadow_stand6 =[ $form2, shadow_stand7 ] {shade_alpha (0.2); shade_stand();}; +void() shadow_stand7 =[ $form1, shadow_stand8 ] {shade_alpha (0.1); shade_stand();}; +void() shadow_stand8 =[ $form1, shadow_stand9 ] {/*shadow_phase (FALSE);*/ shade_alpha(0.7); shade_stand();}; +void() shadow_stand9 =[ $form1, shadow_stand9 ] {shade_stand();}; + +void() shadow_stand = +{ + if (self.takedamage) + shadow_stand1(); + else + shadow_stand8(); +}; + +//------------------------------------------------------------------------// +// The nightshade phases out and moves along its path. +//------------------------------------------------------------------------// +// WALK - - - - - - - - - - - - - - - - +void(float d) shade_walk = +{ + //if (self.spawnflags & SPAWN_SOUL) + //if (Wraith_FindSoul ()) + //{self.th_run(); return;} + ai_walk(d); +}; +void() shadow_walk1 =[ $form7, shadow_walk2 ] {shade_alpha (0.7); shade_walk(8);}; +void() shadow_walk2 =[ $form6, shadow_walk3 ] {shade_alpha (0.6); shade_walk(8);}; +void() shadow_walk3 =[ $form5, shadow_walk4 ] {shade_alpha (0.5); shade_walk(8);}; +void() shadow_walk4 =[ $form4, shadow_walk5 ] {shade_alpha (0.4); shade_walk(8);}; +void() shadow_walk5 =[ $form3, shadow_walk6 ] {shade_alpha (0.3); shade_walk(8);}; +void() shadow_walk6 =[ $form2, shadow_walk7 ] {shade_alpha (0.2); shade_walk(8);}; +void() shadow_walk7 =[ $form1, shadow_walk8 ] {shade_alpha (0.1); shade_walk(8);}; +void() shadow_walk8 =[ $form1, shadow_walk9 ] {/*shadow_phase (FALSE);*/ shade_alpha(0.7); shade_walk(8);}; +void() shadow_walk9 =[ $form1, shadow_walk9 ] {shade_walk(8); shade_sfx_idle ();}; + +void() shadow_walk = +{ + if (self.takedamage) + shadow_walk1(); + else + shadow_walk8(); +}; + +//------------------------------------------------------------------------// +// Run animation. The nightshade flies quickly to find and close in +// on its target. +//------------------------------------------------------------------------// +// RUN - - - - - - - - - - - - - - - - - +void() shade_sfx_fly = +{ + if (self.super_sound < time) // Not while Quad is sounding. + { + if (self.h2olevel <= 1) // Not while in the water. + sound (self, CHAN_BODY, "shade/fly.wav", 1, ATTN_NORM); + else if ((self.h2otype == CONTENT_WATER) || (self.h2otype == CONTENT_SLIME)) + sound (self, CHAN_BODY, "dragon/flywater.wav", 1, ATTN_NORM); + } +}; + + +//void() shadow_form1 =[ $form1, shadow_form2 ] {/*shadow_phase (TRUE);*/ shade_alpha (0.1); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_form2 =[ $form2, shadow_form3 ] {shade_alpha (0.2); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_form3 =[ $form3, shadow_form4 ] {shade_alpha (0.3); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_form4 =[ $form4, shadow_form5 ] {shade_alpha (0.4); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_form5 =[ $form5, shadow_form6 ] {shade_alpha (0.5); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_form6 =[ $form6, shadow_form7 ] {shade_alpha (0.6); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_form7 =[ $form7, shadow_run1 ] {shade_alpha (0.7); ai_run(self.speed);/*dark_run();*/}; +// +//void() shadow_run1 =[ $fly1, shadow_run2 ] {shade_alpha (0.7); shadow_speed(); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run2 =[ $fly2, shadow_run3 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run3 =[ $fly3, shadow_run4 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run4 =[ $fly4, shadow_run5 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run5 =[ $fly5, shadow_run6 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run6 =[ $fly6, shadow_run7 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run7 =[ $fly7, shadow_run8 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run8 =[ $fly8, shadow_run9 ] {shade_sfx_fly(); ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run9 =[ $fly7, shadow_run10 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run10 =[ $fly6, shadow_run11 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run11 =[ $fly5, shadow_run12 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run12 =[ $fly4, shadow_run13 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run13 =[ $fly3, shadow_run14 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run14 =[ $fly2, shadow_run1 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run14 =[ $fly2, shadow_run15 ] {ai_run(self.speed);/*dark_run();*/}; +//void() shadow_run15 =[ $fly1, shadow_run2 ] {ai_run(self.speed);/*dark_run();*/}; + +void() shadow_form1 =[ $form1, shadow_form2 ] {shadow_phase (TRUE); shade_alpha (0.1); dark_run();}; +void() shadow_form2 =[ $form2, shadow_form3 ] {shade_alpha (0.2); dark_run();}; +void() shadow_form3 =[ $form3, shadow_form4 ] {shade_alpha (0.3); dark_run();}; +void() shadow_form4 =[ $form4, shadow_form5 ] {shade_alpha (0.4); dark_run();}; +void() shadow_form5 =[ $form5, shadow_form6 ] {shade_alpha (0.5); dark_run();}; +void() shadow_form6 =[ $form6, shadow_form7 ] {shade_alpha (0.6); dark_run();}; +void() shadow_form7 =[ $form7, shadow_run1 ] {shade_alpha (0.7); dark_run();}; +void() shadow_run1 =[ $fly1, shadow_run2 ] {shade_alpha (0.7); shadow_speed(); dark_run();}; +void() shadow_run2 =[ $fly2, shadow_run3 ] {dark_run();}; +void() shadow_run3 =[ $fly3, shadow_run4 ] {dark_run();}; +void() shadow_run4 =[ $fly4, shadow_run5 ] {dark_run();}; +void() shadow_run5 =[ $fly5, shadow_run6 ] {dark_run();}; +void() shadow_run6 =[ $fly6, shadow_run7 ] {dark_run();}; +void() shadow_run7 =[ $fly7, shadow_run8 ] {dark_run();}; +void() shadow_run8 =[ $fly8, shadow_run9 ] {shade_sfx_fly(); dark_run();}; +void() shadow_run9 =[ $fly7, shadow_run10 ] {dark_run();}; +void() shadow_run10 =[ $fly6, shadow_run11 ] {dark_run();}; +void() shadow_run11 =[ $fly5, shadow_run12 ] {dark_run();}; +void() shadow_run12 =[ $fly4, shadow_run13 ] {dark_run();}; +void() shadow_run13 =[ $fly3, shadow_run14 ] {dark_run();}; +void() shadow_run14 =[ $fly2, shadow_run1 ] {dark_run();}; +//void() shadow_run14 =[ $fly2, shadow_run15 ] {dark_run();}; +//void() shadow_run15 =[ $fly1, shadow_run2 ] {dark_run();}; + +void() shadow_form = +{ + if (self.takedamage) + shadow_run1(); // Already phased in. + else + shadow_form1(); // Materialize. +}; + +// ATTACK - - - - - - - - - - - - - - - +//------------------// +// Melee attacks! // +//------------------// +void() shadow_bite1 =[ $attack1, shadow_bite2 ] {dark_melee();}; +void() shadow_bite2 =[ $attack2, shadow_bite3 ] {dark_melee();}; +void() shadow_bite3 =[ $attack3, shadow_bite4 ] {dark_melee();}; +void() shadow_bite4 =[ $attack4, shadow_bite5 ] {dark_melee();}; +void() shadow_bite5 =[ $attack5, shadow_bite6 ] {dark_melee();}; +void() shadow_bite6 =[ $attack6, shadow_bite7 ] {dark_melee();}; +void() shadow_bite7 =[ $attack7, shadow_bite8 ] {dark_melee();}; +void() shadow_bite8 =[ $attack8, shadow_bite9 ] {dark_melee();}; +void() shadow_bite9 =[ $attack9, shadow_bite10 ] {shade_sfx_fly(); dark_melee();Ryu_Bite();}; +void() shadow_bite10 =[ $attack8, shadow_bite11 ] {dark_melee();}; +void() shadow_bite11 =[ $attack7, shadow_bite12 ] {dark_melee();}; +void() shadow_bite12 =[ $attack6, shadow_bite13 ] {dark_melee();}; +void() shadow_bite13 =[ $attack5, shadow_bite14 ] {dark_melee();}; +void() shadow_bite14 =[ $attack4, shadow_bite15 ] {dark_melee();}; +void() shadow_bite15 =[ $attack3, shadow_bite16 ] {dark_melee();}; +void() shadow_bite16 =[ $attack2, shadow_bite17 ] {dark_melee(); Ryu_Bite();}; +void() shadow_bite17 =[ $attack1, shadow_run1 ] {dark_melee(); self.attack_state = AS_STRAIGHT;}; + +void() shadow_strike = +{ + shade_alpha (0.7); + self.attack_state = AS_STRAIGHT; // Nightshade does not strafe. + + // If path crosses contents, use only the bite. + traceline(self.origin, self.enemy.origin, TRUE, self); + if (trace_inopen) + if (trace_inwater) + {shadow_bite1(); return;} + + // If close enough, it may bite or shoot. + if (random() < 0.8) + if (InMeleeRange (120)) + {shadow_bite1(); return;} + + // Fire away instead. + self.th_missile(); +}; + +//--------------------// +// Missile attacks! // +//--------------------// +void() shadow_missile1 =[ $attack1, shadow_missile2 ] +{ + if (!self.takedamage) + shadow_phase (TRUE); // FIXME: Fire command hack! + shade_alpha (0.7); + self.attack_state = AS_STRAIGHT; // Never strafe + + dark_missile(); +}; +void() shadow_missile2 =[ $attack2, shadow_missile3 ] {dark_missile();}; +void() shadow_missile3 =[ $attack3, shadow_missile4 ] {dark_missile();}; +void() shadow_missile4 =[ $attack4, shadow_missile5 ] {dark_missile();}; +void() shadow_missile5 =[ $attack5, shadow_missile6 ] {dark_missile();}; +void() shadow_missile6 =[ $attack6, shadow_missile7 ] {dark_missile();}; +void() shadow_missile7 =[ $attack7, shadow_missile8 ] {dark_missile();}; +void() shadow_missile8 =[ $attack8, shadow_missile9 ] {dark_missile();}; +void() shadow_missile9 =[ $attack9, shadow_missile10 ] {dark_missile();shade_sfx_fly();Shade_Meat();}; +void() shadow_missile10 =[ $attack8, shadow_missile11 ] {dark_missile();}; +void() shadow_missile11 =[ $attack7, shadow_missile12 ] {dark_missile();}; +void() shadow_missile12 =[ $attack6, shadow_missile13 ] {dark_missile();}; +void() shadow_missile13 =[ $attack5, shadow_missile14 ] {dark_missile();}; +void() shadow_missile14 =[ $attack4, shadow_missile15 ] {dark_missile();}; +void() shadow_missile15 =[ $attack3, shadow_missile16 ] {dark_missile();}; +void() shadow_missile16 =[ $attack2, shadow_missile17 ] {dark_missile();}; +void() shadow_missile17 =[ $attack1, shadow_run1 ] {dark_missile();}; + + +// PAIN - - - - - - - - - - - - - - - - +void() shadow_pain1 =[ $pain1, shadow_pain2 ] {}; +void() shadow_pain2 =[ $pain2, shadow_pain3 ] {}; +void() shadow_pain3 =[ $pain3, shadow_pain4 ] {}; +void() shadow_pain4 =[ $pain4, shadow_pain5 ] {}; +void() shadow_pain5 =[ $pain5, shadow_pain6 ] {}; +void() shadow_pain6 =[ $pain6, shadow_run1 ] {}; + +void() shadow_painb1 =[ $painb1, shadow_painb2 ] {}; +void() shadow_painb2 =[ $painb2, shadow_painb3 ] {}; +void() shadow_painb3 =[ $painb3, shadow_painb4 ] {}; +void() shadow_painb4 =[ $painb4, shadow_painb5 ] {}; +void() shadow_painb5 =[ $painb5, shadow_painb6 ] {}; +void() shadow_painb6 =[ $painb6, shadow_run1 ] {}; + +void() shadow_painc1 =[ $painc1, shadow_painc2 ] {}; +void() shadow_painc2 =[ $painc2, shadow_painc3 ] {}; +void() shadow_painc3 =[ $painc3, shadow_painc4 ] {}; +void() shadow_painc4 =[ $painc4, shadow_painc5 ] {}; +void() shadow_painc5 =[ $painc5, shadow_painc6 ] {}; +void() shadow_painc6 =[ $painc6, shadow_run1 ] {}; + +void(entity inflictor, entity attacker, float damage) shadow_pain = { + local float r, r1, r2; + + // Same size, standard pain. + if (self.pain_finished > time) + return; + + // Pain sounds. + self.pain_finished = time + 0.5; + if (random() < 0.5) + sound (self, CHAN_VOICE, "shade/pain.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "shade/pain2.wav", 1, ATTN_NORM); + + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + if (self.waitmin > time) + { + if ((random() * 400) > damage) + return; // didn't flinch + } + // Will go into pain... + self.waitmin = time + 5; + shade_alpha (0.7); // Reset alpha if it was fading. + self.pain_finished = time + 0.5; + self.attack_state = AS_STRAIGHT; + self.attack_finished = 0; // can attack anytime now! + + self.velocity = '0 0 0'; // Stop right now! + + // Choose a pain scene. + r = random(); + r1 = 0.4; + r2 = 0.7; // Was 0.8. + { // Standard pain. + if (r < r1) + shadow_pain1(); + else if (r < r2) + shadow_painb1(); + else + shadow_painc1(); + } +}; + +// DEATH - - - - - - - - - - - - - - - - +void() shadow_boom = { +// The nightshade releases its pawns and is forever destroyed. + self.alpha = 1; + self.deadflag = DEAD_DEAD; + //monster_drop (); + //Pets_Free (self); + + // Go boom. + T_RadiusDamage (self, self, 100, world, DAMAGEALL); // wrath=80, tarbaby=120. + Rocket_Explosion2 (self.origin, 32, 5); +}; +void() shadow_die1 =[ $nova1, shadow_die2 ] {}; +void() shadow_die2 =[ $nova2, shadow_die3 ] {}; +void() shadow_die3 =[ $nova3, shadow_die4 ] {}; +void() shadow_die4 =[ $nova4, shadow_die5 ] {}; +void() shadow_die5 =[ $nova5, shadow_die6 ] {}; +void() shadow_die6 =[ $nova6, shadow_die7 ] {}; +void() shadow_die7 =[ $nova7, shadow_die8 ] {}; +void() shadow_die8 =[ $nova8, shadow_die10 ] {}; +// Skip frame $nova9. +void() shadow_die10 =[ $nova10, shadow_die11 ] {}; +void() shadow_die11 =[ $nova11, shadow_die12 ] {}; +void() shadow_die12 =[ $nova12, shadow_die13 ] {}; +void() shadow_die13 =[ $nova13, shadow_die14 ] {}; +void() shadow_die14 =[ $nova14, shadow_die15 ] {}; +void() shadow_die15 =[ $nova15, shadow_die16 ] {}; +void() shadow_die16 =[ $nova16, shadow_die17 ] {}; +void() shadow_die17 =[ $nova17, shadow_die18 ] {shadow_boom();}; +void() shadow_die18 =[ $nova18, monster_rod ] {}; + +void() shadow_die_delayed = { + // If nightshade is invisible, Quake may not reveal it after movetype gets + // set to none below, unless we update the entity somehow. Setorigin will + // force Quake to update the entity. + // Update: Don't 'setorigin' during a touch frame. + //setorigin (self, self.origin); + shadow_die1 (); +}; +void() shadow_die = { + //monster_death_precheck(); + + //if (!self.gibbed) { + self.frame = $nova1; + // Delay call to scene start because we use setorigin which may break links. + self.nextthink = 0.01; + self.think = shadow_die_delayed; + + self.alpha = 0.7; + self.movetype = MOVETYPE_NONE; // Freeze monster in place. + if (random() < 0.5) + sound (self, CHAN_VOICE, "shade/death2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "shade/death.wav", 1, ATTN_NORM); + //} +}; + +//============ +// --> QUAKED monster_nightshade (1 0 0) (-32 -32 -24) (32 32 32) Ambush x Souls +//============ +void() monster_nightshade = { + precache_model ("progs/drake/shade.mdl"); + precache_model ("progs/drake/soul.mdl"); + precache_model ("progs/drake/dr1_head.mdl"); // Gib (head) + + precache_sound ("demon/dhit2.wav"); + precache_sound ("dragon/flywater.wav"); + precache_sound ("shade/death.wav"); + precache_sound ("shade/death2.wav"); + precache_sound ("shade/fly.wav"); + precache_sound ("shade/idle.wav"); + precache_sound ("shade/moan.wav"); + precache_sound ("shade/pain.wav"); + precache_sound ("shade/pain2.wav"); + precache_sound ("shade/screech.wav"); + precache_sound ("shade/sing.wav"); + precache_sound ("shade/spawn.wav"); + precache_sound ("shade/taunt.wav"); + precache_sound ("wizard/hit.wav"); // used by C code, so don't sound2 + precache_sound ("wraith/soul.wav"); + + self.sight_sound = "shade/sing.wav"; + + self.mdl = "progs/drake/shade.mdl"; + self.headmdl = "progs/drake/dr1_head.mdl"; + self.skin = 0; // Fix legacy code from early versions of Dragons. + //self.pets = 0; // Starts with no minions, so set to zero. + self.ryuflags = 0; // Make sure it's zero so it doesn't use water AI. + self.waitmin = 0; // Pain sound timestamp. + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHADE; + if (self.health < 1) self.health = 600; + self.gibhealth = MON_NEVERGIB; + self.alpha = 0.7; + self.th_stand = shadow_stand; + self.th_walk = shadow_walk; + self.th_run = shadow_form1; + self.th_melee = shadow_strike; + self.th_missile = shadow_missile1; + self.th_pain = shadow_pain; + self.th_die = shadow_die; + self.th_checkattack = Shade_CheckAttack; + self.gibondeath = TRUE; + if (self.deathstring == "") self.deathstring = " was etherialized by a Nightshade\n"; + + shadow_speed (); + //shadow_phase(TRUE); + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if(!self.classtype) self.classtype = CT_MONSHADE; + if (!self.classgroup) self.classgroup = CG_DRAGON; + self.classmove = MON_MOVEFLY; + + monster_start (); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_shalrath.qc b/QC_other/QC_keep/mon_shalrath.qc new file mode 100644 index 00000000..f3dbe967 --- /dev/null +++ b/QC_other/QC_keep/mon_shalrath.qc @@ -0,0 +1,372 @@ +/*============================================================================== +SHAL-RATH (VORE) +==============================================================================*/ +$cd id1/models/shalrath +$origin 0 0 24 +$base base +$skin skin +$scale 0.7 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 + +//============================================================================ +// This is no stand idle! just uses frame 1 of walk +//============================================================================ +void() shal_stand =[ $walk1, shal_stand ] {ai_stand();}; + +//============================================================================ +void() shal_walk1 =[ $walk2, shal_walk2 ] {monster_idle_sound(); ai_walk(6);}; +void() shal_walk2 =[ $walk3, shal_walk3 ] {ai_walk(4);}; +void() shal_walk3 =[ $walk4, shal_walk4 ] {monster_footstep(FALSE); ai_walk(0);}; +void() shal_walk4 =[ $walk5, shal_walk5 ] {ai_walk(0);}; +void() shal_walk5 =[ $walk6, shal_walk6 ] {ai_walk(0);}; +void() shal_walk6 =[ $walk7, shal_walk7 ] {monster_footstep(FALSE); ai_walk(0);}; +void() shal_walk7 =[ $walk8, shal_walk8 ] {ai_walk(5);}; +void() shal_walk8 =[ $walk9, shal_walk9 ] {ai_walk(6);}; +void() shal_walk9 =[ $walk10, shal_walk10 ] {ai_walk(5);}; +void() shal_walk10 =[ $walk11, shal_walk11 ] {monster_footstep(FALSE); ai_walk(0);}; +void() shal_walk11 =[ $walk12, shal_walk12 ] {ai_walk(4);}; +void() shal_walk12 =[ $walk1, shal_walk1 ] {ai_walk(5);}; + +//============================================================================ +// run = walk (identical frames and movement speed!) +void() shal_run1 =[ $walk2, shal_run2 ] {monster_idle_sound(); ai_run(6);}; +void() shal_run2 =[ $walk3, shal_run3 ] {ai_run(4);}; +void() shal_run3 =[ $walk4, shal_run4 ] {monster_footstep(FALSE); ai_run(0);}; +void() shal_run4 =[ $walk5, shal_run5 ] {ai_run(0);}; +void() shal_run5 =[ $walk6, shal_run6 ] {ai_run(0);}; +void() shal_run6 =[ $walk7, shal_run7 ] {monster_footstep(FALSE); ai_run(0);}; +void() shal_run7 =[ $walk8, shal_run8 ] {ai_run(5);}; +void() shal_run8 =[ $walk9, shal_run9 ] {ai_run(6);}; +void() shal_run9 =[ $walk10, shal_run10 ] {monster_footstep(FALSE); ai_run(5);}; +void() shal_run10 =[ $walk11, shal_run11 ] {ai_run(0);}; +void() shal_run11 =[ $walk12, shal_run12 ] {ai_run(4);}; +void() shal_run12 =[ $walk1, shal_run1 ] {ai_run(5);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() shalrath_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_SBALL; + self.attachment.alpha = 0.85; + } +}; + +//---------------------------------------------------------------------- +void() shalrath_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() shalrath_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - Homing Missile Attack +//====================================================================== +void() ShalMissile = +{ + // Check if there is a clear line of sight + // The original behaviour is ruined by this final check + // Baiting shalraths to fire will generate more voreballs flying + // around and projectiles to dodge, best leave this working + //if ( !(visxray(self.enemy, '0 8 20', '0 0 10', FALSE)) ) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM); + self.attack_speed = SPEED_SHALMISSILE + (skill * SPEED_SHALSKILL); + // Original vector location 0 0 10, new 0 8 36 + Launch_HomingMissile ('0 8 20', '0 0 10', CT_PROJ_SHAL, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void(vector hmofs, float hmframe) Setup_ShalHome = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (hmframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, MODEL_PROJ_SHOME); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + } + // Double check for pain interruption + else if (self.attachment.state == STATE_OFF) return; + + // Turn towards enemy and update model attachment + // The offset is based on the shalrath facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(hmofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.frame = hmframe; +}; + +//---------------------------------------------------------------------- +// it would have been cool to have the homing missile form slowing in the +// shalrath hand but the animation is just weird, the arm bends backward +// into a really strange position which makes the forming missile look +// terrible, restricted the grow function to later frames only +// 2 24 18, -8 24 18, -18 22 17, -28 18 16 (arm swings round and back) +// -26 12 20, -18 10 30, 12 8 36 ( arms swings up and forward) +// +void() shal_attack1 =[ $attack1, shal_attack2 ] {ai_face(); + sound (self, CHAN_WEAPON, "shalrath/attack.wav", 1, ATTN_NORM);}; +void() shal_attack2 =[ $attack2, shal_attack3 ] {ai_face();}; +void() shal_attack3 =[ $attack3, shal_attack4 ] {ai_face();}; +void() shal_attack4 =[ $attack4, shal_attack5 ] {ai_face();}; +void() shal_attack5 =[ $attack5, shal_attack6 ] {ai_face();}; +void() shal_attack6 =[ $attack6, shal_attack7 ] {Setup_ShalHome('-26 12 20',0);}; +void() shal_attack7 =[ $attack7, shal_attack8 ] {Setup_ShalHome('-18 10 30',2);}; +void() shal_attack8 =[ $attack8, shal_attack9 ] {Setup_ShalHome('12 8 36',7);}; +void() shal_attack9 =[ $attack9, shal_attack10] {shalrath_finish_attachment();ShalMissile();}; +void() shal_attack10 =[ $attack10, shal_attack11] {}; +void() shal_attack11 =[ $attack11, shal_run1 ] {}; + +//====================================================================== +// RANGE ATTACK 2 - spawn voreling minion (optional) +// +// Creates a ball of green goo and throws it towards the player +// Once the ball has landed, hatch/explode and create baby voreling +//====================================================================== +void(vector eggofs, float eggframe) Setup_ShalrathEgg = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (eggframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, MODEL_PROJ_SBALL); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "shalrath/attack3.wav", 1, ATTN_NORM); + } + // Double check for pain interruption + else if (self.attachment.state == STATE_OFF) return; + + // Turn towards enemy and update model attachment + // The offset is based on the shalrath facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(eggofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.frame = eggframe; +}; + +//---------------------------------------------------------------------- +void() shal_minion1 =[ $attack1, shal_minion2 ] {ai_face();}; +void() shal_minion2 =[ $attack2, shal_minion3 ] {Setup_ShalrathEgg('2 24 18',0);}; +void() shal_minion3 =[ $attack3, shal_minion4 ] {Setup_ShalrathEgg('-8 24 18',1);}; +void() shal_minion4 =[ $attack4, shal_minion5 ] {Setup_ShalrathEgg('-18 22 17',1);}; +void() shal_minion5 =[ $attack5, shal_minion6 ] {Setup_ShalrathEgg('-28 18 16',2);}; +void() shal_minion6 =[ $attack6, shal_minion7 ] {Setup_ShalrathEgg('-26 12 20',3);}; +void() shal_minion7 =[ $attack7, shal_minion8 ] {Setup_ShalrathEgg('-18 10 30',4);}; +void() shal_minion8 =[ $attack8, shal_minion9 ] {Setup_ShalrathEgg('12 8 36',5);}; +void() shal_minion9 =[ $attack9, shal_minion10] {shalrath_finish_attachment();Create_Egg('12 8 36');}; +void() shal_minion10 =[ $attack10, shal_minion11] {}; +void() shal_minion11 =[ $attack11, shal_run1 ] {}; + +//---------------------------------------------------------------------- +void() shal_magic = +{ + local entity miniondef; + + // Make sure the attachments are setup ready + shalrath_create_attachment(); + + if (self.spawnflags & MON_SHALRATH_MINIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_shalrathminion"); + if (miniondef.classtype == CT_CACHEVORELING) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[SHALRATH]\b Cannot find minion template!\n"); + self.spawnflags = self.spawnflags - MON_SHALRATH_MINIONS; + } + } + + // Is the target the player or monster? + if (self.enemy.flags & FL_CLIENT) { + if (self.spawnflags & MON_SHALRATH_MINIONS) { + // This is an odd location for an melee check but the shalrath has + // no melee function and any check (ShalCheckAttack) done is for + // long range and moving backwards if attacking is blocked + // If the shalrath is a minion spawner and the player is too close + // then use the old base attack (voreballs) this can be switched off + // + self.enemydist = range_distance(self.enemy, TRUE); + // If the player is too close (melee distance) try old base attack + if (self.minion_baseattack > 0 && self.enemydist < MON_RANGE_MELEE) shal_attack1(); + else { + // has the voreling limit been reached? + if (query_minionactive(self) == TRUE) shal_minion1(); + else self.think = self.th_run; + } + } + // Only has one type of attack, homing missiles + else shal_attack1(); + + } + // Attack monsters with Homing Missiles + else shal_attack1(); +}; + +//============================================================================ +void() shal_pain1 =[ $pain1, shal_pain2 ] {}; +void() shal_pain2 =[ $pain2, shal_pain3 ] {shalrath_finish_attachment();}; +void() shal_pain3 =[ $pain3, shal_pain4 ] {}; +void() shal_pain4 =[ $pain4, shal_pain5 ] {}; +void() shal_pain5 =[ $pain5, shal_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) shal_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Hide any attachments + shalrath_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) shal_pain1(); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.5; + self.axhitme = 0; + shal_pain1(); + } + } +}; + +//============================================================================ +void() shal_death1 =[ $death1, shal_death2 ] {}; +void() shal_death2 =[ $death2, shal_death3 ] {monster_check_gib();}; +void() shal_death3 =[ $death3, shal_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() shal_death4 =[ $death4, shal_death5 ] {}; +void() shal_death5 =[ $death5, shal_death6 ] {}; +void() shal_death6 =[ $death6, shal_death7 ] {monster_death_postcheck();}; +void() shal_death7 =[ $death7, shal_death7 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() shal_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // Make sure any attachments are removed + shalrath_remove_attachment(); + + // Normal death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM); + shal_death1(); + } +}; + +/*====================================================================== + QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) Ambush +======================================================================*/ +void() monster_shalrath = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_shalrath.mdl"; // Extra skin + self.headmdl = "progs/ad171/h_shalrath.mdl"; // Matching new skin + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_SHAL); // Original - progs/v_spike.mdl + precache_model (MODEL_PROJ_SHOME); // Homing missile growing 8 frames + precache_model (MODEL_PROJ_SBALL); // ball growing 8 frames + precache_model (MODEL_PROJ_SEGG); // ball turned into egg + precache_model (MODEL_PROJ_SSHELL); // Gibs from Egg + + self.idle_sound = "shalrath/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("shalrath/death.wav"); + self.pain_sound = "shalrath/pain.wav"; + precache_sound (self.pain_sound); + + precache_sound ("shalrath/attack.wav"); // Start of attack + precache_sound ("shalrath/attack2.wav"); // Firing missile + precache_sound ("shalrath/attack3.wav"); // Minions + precache_sound ("shalrath/bounce.wav"); // Egg bounce + + self.sight_sound = "shalrath/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + self.idmins = VEC_HULL2_MIN; // -32 -32 -24, 32 32 64 + self.idmaxs = VEC_HULL2_MAX; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 400; + self.gibhealth = -90; // Rarely gib (explosives required) + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 70; // take a lot of damage before pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 3; // Really high pain tolerance + self.steptype = FS_TYPELIGHT; // Light tap feet + self.blockudeath = TRUE; // no humanoid death sound + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was exploded by a Vore\n"; + + self.th_checkattack = ShalCheckAttack; + self.th_stand = shal_stand; + self.th_walk = shal_walk1; + self.th_run = shal_run1; + self.th_missile = shal_magic; + self.th_pain = shal_pain; + self.th_die = shal_die; + + // Special green skin for spider wraiths + if (self.spawnflags & MON_SHALRATH_MINIONS) self.exactskin = 2; + + self.classtype = CT_MONSHAL; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_shambler.qc b/QC_other/QC_keep/mon_shambler.qc new file mode 100644 index 00000000..960e3bdf --- /dev/null +++ b/QC_other/QC_keep/mon_shambler.qc @@ -0,0 +1,480 @@ +/*============================================================================== +SHAMBLER +==============================================================================*/ +$cd id1/models/shams +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 +$frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 + +$frame run1 run2 run3 run4 run5 run6 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 + +$frame swingr1 swingr2 swingr3 swingr4 swingr5 +$frame swingr6 swingr7 swingr8 swingr9 + +$frame swingl1 swingl2 swingl3 swingl4 swingl5 +$frame swingl6 swingl7 swingl8 swingl9 + +$frame magic1 magic2 magic3 magic4 magic5 +$frame magic6 magic7 magic8 magic9 magic10 magic11 magic12 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 + +void() sham_swingr1; + +//====================================================================== +void() sham_stand1 =[ $stand1, sham_stand2 ] {ai_stand();}; +void() sham_stand2 =[ $stand2, sham_stand3 ] {ai_stand();}; +void() sham_stand3 =[ $stand3, sham_stand4 ] {ai_stand();}; +void() sham_stand4 =[ $stand4, sham_stand5 ] {ai_stand();}; +void() sham_stand5 =[ $stand5, sham_stand6 ] {ai_stand();}; +void() sham_stand6 =[ $stand6, sham_stand7 ] {ai_stand();}; +void() sham_stand7 =[ $stand7, sham_stand8 ] {ai_stand();}; +void() sham_stand8 =[ $stand8, sham_stand9 ] {ai_stand();}; +void() sham_stand9 =[ $stand9, sham_stand10] {ai_stand();}; +void() sham_stand10 =[ $stand10, sham_stand11] {ai_stand();}; +void() sham_stand11 =[ $stand11, sham_stand12] {ai_stand();}; +void() sham_stand12 =[ $stand12, sham_stand13] {ai_stand();}; +void() sham_stand13 =[ $stand13, sham_stand14] {ai_stand();}; +void() sham_stand14 =[ $stand14, sham_stand15] {ai_stand();}; +void() sham_stand15 =[ $stand15, sham_stand16] {ai_stand();}; +void() sham_stand16 =[ $stand16, sham_stand17] {ai_stand();}; +void() sham_stand17 =[ $stand17, sham_stand1 ] {ai_stand();}; + +//====================================================================== +void() sham_walk1 =[ $walk1, sham_walk2 ] {monster_idle_sound(); ai_walk(10);}; +void() sham_walk2 =[ $walk2, sham_walk3 ] {monster_footstep(FALSE); ai_walk(9);}; +void() sham_walk3 =[ $walk3, sham_walk4 ] {ai_walk(9);}; +void() sham_walk4 =[ $walk4, sham_walk5 ] {ai_walk(5);}; +void() sham_walk5 =[ $walk5, sham_walk6 ] {ai_walk(6);}; +void() sham_walk6 =[ $walk6, sham_walk7 ] {ai_walk(12);}; +void() sham_walk7 =[ $walk7, sham_walk8 ] {monster_footstep(FALSE); ai_walk(8);}; +void() sham_walk8 =[ $walk8, sham_walk9 ] {ai_walk(3);}; +void() sham_walk9 =[ $walk9, sham_walk10] {ai_walk(13);}; +void() sham_walk10 =[ $walk10, sham_walk11] {ai_walk(9);}; +void() sham_walk11 =[ $walk11, sham_walk12] {ai_walk(7);}; +void() sham_walk12 =[ $walk12, sham_walk1 ] {ai_walk(7);}; + +//====================================================================== +void() sham_run1 =[ $run1, sham_run2 ] {monster_idle_sound(); ai_run(20);}; +void() sham_run2 =[ $run2, sham_run3 ] {monster_footstep(FALSE); ai_run(24);}; +void() sham_run3 =[ $run3, sham_run4 ] {ai_run(20);}; +void() sham_run4 =[ $run4, sham_run5 ] {ai_run(20);}; +void() sham_run5 =[ $run5, sham_run6 ] {monster_footstep(FALSE); ai_run(24);}; +void() sham_run6 =[ $run6, sham_run1 ] {ai_run(20);}; + +//====================================================================== +// MELEE ATTACK 1 - Claw and Smash +// Merged shambler melee attacks (over head smash and side claw) +// Standardized to test vlen and zaxis height difference better +//====================================================================== +float SHAM_MSMASH = 1; +float SHAM_MCLAW = 2; + +//---------------------------------------------------------------------- +void(float melee_attack, float side) sham_meleeattack = +{ + local float ldmg, dmg_multiplier; + + if (!self.enemy) return; // Something to fight? + ai_damagebreakable(40); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESHAM)) return;// Too far away + dmg_multiplier = 1; + + // Get closer to enemy + if (melee_attack == SHAM_MSMASH) ai_charge(0); // Stationary attack + else if (melee_attack == SHAM_MCLAW) ai_charge(10); // Swing forward + + // Can the target bleed? - generate red/green blood + if (!CanDamage (self.enemy, self)) return; + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Shambler over head claw smash to ground (slow and high damage) + // If this is infighting do more damage as it will look more impressive + // Also if this damage is enough to kill in a single blow, gib for effect + if (melee_attack == SHAM_MSMASH) { + sound (self, CHAN_VOICE, self.meleehitsound, 1, ATTN_NORM); + if (self.enemy.flags & FL_MONSTER) dmg_multiplier = dmg_multiplier * 2; + ldmg = (random() + random() + random()) * (40*dmg_multiplier); + if (self.enemy.health < ldmg) ldmg = ldmg*3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); + } + // Shambler side swipe (left/right and half damage) + else if (melee_attack == SHAM_MCLAW) { + sound (self, CHAN_VOICE, self.meleehitsound, 1, ATTN_NORM); + ldmg = (random() + random() + random()) * 20; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + SpawnMeatSpray (self, self.enemy, side); + } +}; + +//---------------------------------------------------------------------- +void() sham_smash1 =[ $smash1, sham_smash2 ] { +sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); ai_charge(2);}; +void() sham_smash2 =[ $smash2, sham_smash3 ] {monster_footstep(FALSE); ai_charge(6);}; +void() sham_smash3 =[ $smash3, sham_smash4 ] {ai_charge(6);}; +void() sham_smash4 =[ $smash4, sham_smash5 ] {ai_charge(5);}; +void() sham_smash5 =[ $smash5, sham_smash6 ] {ai_charge(4);}; +void() sham_smash6 =[ $smash6, sham_smash7 ] {ai_charge(1);}; +void() sham_smash7 =[ $smash7, sham_smash8 ] {ai_charge(0);}; +void() sham_smash8 =[ $smash8, sham_smash9 ] {ai_charge(0);}; +void() sham_smash9 =[ $smash9, sham_smash10 ] {ai_charge(0);}; +void() sham_smash10 =[ $smash10, sham_smash11 ] {sham_meleeattack(SHAM_MSMASH,0);}; +void() sham_smash11 =[ $smash11, sham_smash12 ] {ai_charge(5);}; +void() sham_smash12 =[ $smash12, sham_run1 ] {ai_charge(4);}; + +//---------------------------------------------------------------------- +void() sham_swingl1 =[ $swingl1, sham_swingl2 ] { +sound (self, CHAN_VOICE, "shambler/melee2.wav", 1, ATTN_NORM); ai_charge(5);}; +void() sham_swingl2 =[ $swingl2, sham_swingl3 ] {monster_footstep(FALSE); ai_charge(3);}; +void() sham_swingl3 =[ $swingl3, sham_swingl4 ] {ai_charge(7);}; +void() sham_swingl4 =[ $swingl4, sham_swingl5 ] {ai_charge(3);}; +void() sham_swingl5 =[ $swingl5, sham_swingl6 ] {ai_charge(7);}; +void() sham_swingl6 =[ $swingl6, sham_swingl7 ] {ai_charge(9);}; +void() sham_swingl7 =[ $swingl7, sham_swingl8 ] {ai_charge(5); sham_meleeattack(SHAM_MCLAW,250);}; +void() sham_swingl8 =[ $swingl8, sham_swingl9 ] {ai_charge(4);}; +void() sham_swingl9 =[ $swingl9, sham_run1 ] { ai_charge(8); +if (ai_checkmelee(MONAI_MELEESHAM) && self.enemy.health > 0) self.think = sham_swingr1;}; + +//---------------------------------------------------------------------- +void() sham_swingr1 =[ $swingr1, sham_swingr2 ] { +sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); ai_charge(1);}; +void() sham_swingr2 =[ $swingr2, sham_swingr3 ] {monster_footstep(FALSE); ai_charge(8);}; +void() sham_swingr3 =[ $swingr3, sham_swingr4 ] {ai_charge(14);}; +void() sham_swingr4 =[ $swingr4, sham_swingr5 ] {ai_charge(7);}; +void() sham_swingr5 =[ $swingr5, sham_swingr6 ] {ai_charge(3);}; +void() sham_swingr6 =[ $swingr6, sham_swingr7 ] {ai_charge(6);}; +void() sham_swingr7 =[ $swingr7, sham_swingr8 ] {ai_charge(6); sham_meleeattack(SHAM_MCLAW,-250);}; +void() sham_swingr8 =[ $swingr8, sham_swingr9 ] {ai_charge(3);}; +void() sham_swingr9 =[ $swingr9, sham_run1 ] { ai_charge(10); +if (ai_checkmelee(MONAI_MELEESHAM) && self.enemy.health > 0) self.think = sham_swingl1;}; + +//---------------------------------------------------------------------- +void() sham_melee = +{ + self.meleeattack = random(); + // Try to start with a smash + if (self.meleeattack > 0.6 || self.health == self.max_health) sham_smash1 (); + else if (self.meleeattack > 0.3) sham_swingr1 (); + else sham_swingl1 (); +}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() sham_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.alpha = 0.85; + } +}; + +//---------------------------------------------------------------------- +void() sham_finish_attachment = +{ + if (self.attachment) setmodel(self.attachment, ""); +}; + +//---------------------------------------------------------------------- +void() sham_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - classic hitscan lightning +//====================================================================== +void() sham_lightning = +{ + local vector org, dir; + if (self.health < 1) return; + + ai_face (); + self.effects = self.effects | EF_MUZZLEFLASH; + sham_finish_attachment(); + + makevectors(self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = self.enemy.origin + '0 0 16' - org; + dir = normalize (dir); + + // Trace direct line of lightning infront of shambler + traceline (org, self.origin + dir*MONAI_SHAMRANGE, TRUE, self); + + // Display lightning model segments + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + // Check for any breakables first + if (ai_foundbreakable(self, trace_ent, FALSE)) { + T_Damage (trace_ent, self, self, 80, DAMARMOR); + } + // Standard player lightning damage function + else LightningDamage (org, trace_endpos, self, 10); +}; + +//---------------------------------------------------------------------- +void(vector leftofs, vector rightofs, float litframe) sham_casting = +{ + local vector dir; + local float litpoint; + if (self.health < 1) return; + + // Check if attachment has been setup yet + if (!self.attachment) sham_create_attachment(); + + // Frame 0 is start of the sequence (move everything into place) + if (litframe == 0) { + setorigin(self.attachment, self.origin); + setmodel(self.attachment, MODEL_PROJ_SHAMLIT); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + } + + // Turn toward enemy + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + + // Place orb in the center of the electricity + setorigin(self.attachment, self.origin); + self.attachment.angles = self.angles; + self.attachment.frame = litframe; + + // Work out each hand position + makevectors(self.angles); + self.pos1 = self.origin + attack_vector(leftofs); + self.pos2 = self.origin + attack_vector(rightofs); + + // Spawn some particles randomly along the lighting beam + dir = normalize(self.pos2 - self.pos1); + litpoint = vlen(self.pos2 - self.pos1) * random(); + self.pos3 = self.pos1 + (dir*litpoint); + particle_explode(self.pos3, 5+random()*5, 0.2+random(), PARTICLE_BURST_BLUE, PARTICLE_BURST_SKULLUP); +}; + +//---------------------------------------------------------------------- +void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face(); + sound (self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);}; +void() sham_magic2 =[ $magic2, sham_magic3 ] { + sham_casting('0 43 61','16 -4 75',0);}; +void() sham_magic3 =[ $magic3, sham_magic3b ] {ai_face(); + sham_casting('-16 42 69','7 0 80',1);}; +void() sham_magic3b =[ $magic3, sham_magic4 ] {ai_face(); + sham_casting('-14 38 68','8 6 78',2);}; +void() sham_magic4 =[ $magic4, sham_magic5 ] {monster_footstep(FALSE); + sham_casting('-22 35 75','6 3 80',3);}; +void() sham_magic5 =[ $magic5, sham_magic6 ] { + sham_casting('-3 26 88','19 -9 81',4);}; +void() sham_magic6 =[ $magic6, sham_magic9 ] {sham_lightning(); +sound (self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM);}; +void() sham_magic9 =[ $magic9, sham_magic10 ] {sham_lightning();}; +void() sham_magic10=[ $magic10,sham_magic11 ] {sham_lightning();monster_footstep(FALSE);}; +void() sham_magic11=[ $magic11,sham_magic12 ] { + if (skill == SKILL_NIGHTMARE) sham_lightning();}; +void() sham_magic12 =[ $magic12, sham_run1] {}; + +//============================================================================ +void() sham_pain1 =[ $pain1, sham_pain2 ] {}; +void() sham_pain2 =[ $pain2, sham_pain3 ] {}; +void() sham_pain3 =[ $pain3, sham_pain4 ] {}; +void() sham_pain4 =[ $pain4, sham_pain5 ] {}; +void() sham_pain5 =[ $pain5, sham_pain6 ] {}; +void() sham_pain6 =[ $pain6, sham_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) sham_pain = +{ + // Finish with all attachments + sham_finish_attachment(); + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) sham_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + sham_pain1 (); + } + } +}; + +//============================================================================ +void() sham_death1 =[ $death1, sham_death2 ] {}; +void() sham_death2 =[ $death2, sham_death3 ] {monster_check_gib();}; +void() sham_death3 =[ $death3, sham_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() sham_death4 =[ $death4, sham_death5 ] {}; +void() sham_death5 =[ $death5, sham_death6 ] {}; +void() sham_death6 =[ $death6, sham_death7 ] {}; +void() sham_death7 =[ $death7, sham_death8 ] {}; +void() sham_death8 =[ $death8, sham_death9 ] {}; +void() sham_death9 =[ $death9, sham_death10 ] {}; +void() sham_death10 =[ $death10, sham_death11 ] {monster_death_postcheck();}; +void() sham_death11 =[ $death11, sham_death11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() sham_die = +{ + // Finish and remove all attachments + sham_finish_attachment(); + sham_remove_attachment(); + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + +// regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM); + sham_death1 (); + } +}; + +//---------------------------------------------------------------------- +// Special wakeup animation for attacking/breaking something infront +// The monster should be setup facing the right direction before call +// Starts in large overhead swing downwards (no damage checks) +//---------------------------------------------------------------------- +void() sham_wakeup1 =[ $smash7, sham_wakeup2 ] { + sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM);}; +void() sham_wakeup2 =[ $smash9, sham_wakeup3 ] {}; +void() sham_wakeup3 =[ $smash10, sham_wakeup4 ] {}; +void() sham_wakeup4 =[ $smash11, sham_wakeup5 ] {}; +void() sham_wakeup5 =[ $smash12, sham_run1 ] {}; + +/*====================================================================== +QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush +======================================================================*/ +void() monster_shambler = +{ + if (deathmatch) { remove(self); return; } + + if (self.poisonous) { + self.mdl = "progs/ad171/mon_shambler.mdl"; + self.headmdl = "progs/ad171/h_shambler.mdl"; // Large head + self.gib1mdl = "progs/ad171/gib_blclaw1.mdl"; // Left claw + self.gib2mdl = "progs/ad171/gib_blclaw2.mdl"; // Right claw + self.gib3mdl = "progs/ad171/gib_blfoot1.mdl"; // foot + self.gib4mdl = "progs/ad171/gib_blfoot2.mdl"; // foot + if (self.deathstring == "") self.deathstring = " was smashed by a Poisonous Shambler\n"; + } + else { + self.mdl = "progs/ad171/mon_shambler.mdl"; + self.headmdl = "progs/ad171/h_shambler.mdl"; // Large head + self.gib1mdl = "progs/ad171/gib_shclaw1.mdl"; // Left claw + self.gib2mdl = "progs/ad171/gib_shclaw2.mdl"; // Right claw + self.gib3mdl = "progs/ad171/gib_shfoot1.mdl"; // foot + self.gib4mdl = "progs/ad171/gib_shfoot2.mdl"; // foot + if (self.deathstring == "") self.deathstring = " was smashed by a Shambler\n"; + } + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_SHAMLIT); + precache_model ("progs/s_light.mdl"); + precache_model ("progs/bolt.mdl"); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + precache_model (self.gib4mdl); + + // Randomly swap claws and feet around + self.lip = random(); + if (self.lip < 0.25) self.gib1mdl = self.gib4mdl; + else if (self.lip < 0.5) self.gib2mdl = self.gib4mdl; + else if (self.lip < 0.75) self.gib3mdl = self.gib4mdl; + + self.idle_sound = "shambler/sidle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("shambler/sdeath.wav"); + self.pain_sound = "shambler/shurt2.wav"; + precache_sound (self.pain_sound); + + precache_sound ("shambler/sattck1.wav"); + precache_sound ("shambler/sboom.wav"); + precache_sound ("shambler/melee1.wav"); + precache_sound ("shambler/melee2.wav"); + + self.meleehitsound = "shambler/smack.wav"; + precache_sound (self.meleehitsound); + + self.sight_sound = "shambler/ssight.wav"; + precache_sound (self.sight_sound); + + // Precache extra green small gibs + if (self.poisonous) { + precache_poisongibs(); + self.gibtype = GIBTYPE_POISON; + self.exactskin = 1; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_MASSIVE; + if (self.health < 1) self.health = 600; + self.gibhealth = -60; + self.gibbed = FALSE; // In one peice + self.pain_flinch = 400; // Really low chance of pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.pain_timeout = 2; // Long pause on pain + self.steptype = FS_TYPELARGE; // Large stomping feet + self.blockudeath = TRUE; // No player gib sound + self.attack_offset = '0 0 40'; // Between hands + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = 0.5; self.resist_cells = 0; + + self.th_checkattack = ShamCheckAttack; + self.th_stand = sham_stand1; + self.th_walk = sham_walk1; + self.th_run = sham_run1; + self.th_die = sham_die; + self.th_melee = sham_melee; + self.th_missile = sham_magic1; + self.th_pain = sham_pain; + self.th_wakeup = sham_wakeup1; + + self.classtype = CT_MONSHAM; + self.classgroup = CG_SHAM; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_skullwiz.qc b/QC_other/QC_keep/mon_skullwiz.qc new file mode 100644 index 00000000..7e882e7f --- /dev/null +++ b/QC_other/QC_keep/mon_skullwiz.qc @@ -0,0 +1,922 @@ +/*============================================================================== +SKULL WIZARD (Hexen2 model by Raven Software) +==============================================================================*/ + +// Fall backwards, vanish and robes fall down +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 + +// Summon minion +$frame summon1 summon2 summon3 summon4 summon5 summon6 summon7 summon8 +$frame summon9 summon10 summon11 summon12 summon13 summon14 summon15 summon16 +$frame summon17 summon18 summon19 summon20 summon21 summon22 summon23 summon24 +$frame summon25 summon26 summon27 summon28 summon29 summon30 + +// Pain A +$frame painA1 painA2 painA3 painA4 painA5 painA6 painA7 painA8 +$frame painA9 painA10 painA11 painA12 + +// Transition - Move from upright to crouch +$frame transA1 transA2 transA3 transA4 transA5 transA6 transA7 transA8 +$frame transA9 transA10 transA11 transA12 + +// Cast fireball spell (frame 12 - fire) +$frame spellA1 spellA2 spellA3 spellA4 spellA5 spellA6 spellA7 spellA8 +$frame spellA9 spellA10 spellA11 spellA12 spellA13 spellA14 spellA15 + +// Cast teleport spell (touching book) +$frame spellB1 spellB2 spellB3 spellB4 spellB5 spellB6 spellB7 spellB8 +$frame spellB9 spellB10 spellB11 spellB12 spellB13 spellB14 spellB15 + +// Transition - Move from crouch to upright +$frame transB1 transB2 transB3 transB4 transB5 transB6 transB7 + +// Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 stand16 +$frame stand17 stand18 stand19 + +// Default walk - very slow +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 +$frame walk17 walk18 walk19 walk20 walk21 walk22 walk23 walk24 + +// Teleport +$frame tele1 tele2 tele3 tele4 tele5 tele6 tele7 tele8 tele9 + +float SKULLW_STAND = 1; +float SKULLW_WALK = 2; +float SKULLW_HEIGHT = 96; +float SKULLW_DISTMIN = 256; +float SKULLW_DISTMAX = 512; + +//============================================================================ +void() skullw_stand1 =[ $stand1, skullw_stand2 ] { +self.idlebusy=SKULLW_STAND; monster_idle_sound();ai_stand();}; +void() skullw_stand2 =[ $stand18, skullw_stand3 ] {ai_stand();}; +void() skullw_stand3 =[ $stand16, skullw_stand4 ] {ai_stand();}; +void() skullw_stand4 =[ $stand14, skullw_stand5 ] {ai_stand();}; +void() skullw_stand5 =[ $stand12, skullw_stand6 ] {ai_stand();}; +void() skullw_stand6 =[ $stand3, skullw_stand7 ] {ai_stand();}; +void() skullw_stand7 =[ $stand5, skullw_stand8 ] {ai_stand();}; +void() skullw_stand8 =[ $stand7, skullw_stand9 ] {ai_stand();}; +void() skullw_stand9 =[ $stand9, skullw_stand10 ] {ai_stand();}; +void() skullw_stand10 =[ $stand11, skullw_stand11 ] {ai_stand();}; +void() skullw_stand11 =[ $stand13, skullw_stand12 ] {ai_stand();}; +void() skullw_stand12 =[ $stand15, skullw_stand13 ] {ai_stand();}; +void() skullw_stand13 =[ $stand17, skullw_stand14 ] {ai_stand();}; +void() skullw_stand14 =[ $stand19, skullw_stand1 ] {ai_stand();}; + +//============================================================================ +void() skullw_walk1 =[ $walk1, skullw_walk2 ] {monster_footstep(FALSE); +self.idlebusy=SKULLW_WALK; monster_idle_sound();ai_walk(2);}; +void() skullw_walk2 =[ $walk3, skullw_walk3 ] {ai_walk(5);}; +void() skullw_walk3 =[ $walk4, skullw_walk4 ] {ai_walk(5);}; +void() skullw_walk4 =[ $walk5, skullw_walk5 ] {ai_walk(4);}; +void() skullw_walk5 =[ $walk7, skullw_walk6 ] {ai_walk(4);}; +void() skullw_walk6 =[ $walk8, skullw_walk7 ] {ai_walk(2);}; +void() skullw_walk7 =[ $walk9, skullw_walk8 ] {ai_walk(2);}; +void() skullw_walk8 =[ $walk11, skullw_walk9 ] {ai_walk(2);}; +void() skullw_walk9 =[ $walk12, skullw_walk10 ] {monster_footstep(FALSE); ai_walk(2);}; +void() skullw_walk10 =[ $walk13, skullw_walk11 ] {ai_walk(5);}; +void() skullw_walk11 =[ $walk15, skullw_walk12 ] {ai_walk(5);}; +void() skullw_walk12 =[ $walk16, skullw_walk13 ] {ai_walk(4);}; +void() skullw_walk13 =[ $walk17, skullw_walk14 ] {ai_walk(4);}; +void() skullw_walk14 =[ $walk19, skullw_walk15 ] {ai_walk(2);}; +void() skullw_walk15 =[ $walk20, skullw_walk16 ] {ai_walk(2);}; +void() skullw_walk16 =[ $walk22, skullw_walk1 ] {ai_walk(3);}; + +//============================================================================ +// WALK -> STAND +void() skullw_transA1 =[ $transA5, skullw_transA2 ] {}; +void() skullw_transA2 =[ $transA7, skullw_transA3 ] {}; +void() skullw_transA3 =[ $transA9, skullw_transA4 ] {}; +void() skullw_transA4 =[ $transA11, skullw_stand1 ] {}; + +// STAND -> WALK +void() skullw_transB1 =[ $transB3, skullw_transB2 ] {}; +void() skullw_transB2 =[ $transB5, skullw_transB3 ] {}; +void() skullw_transB3 =[ $transB7, skullw_walk1 ] {}; + +//---------------------------------------------------------------------- +void() skullw_stand = +{ + if (self.idlebusy == SKULLW_WALK) skullw_transA1(); + else skullw_stand1(); +}; + +//---------------------------------------------------------------------- +void() skullw_walk = +{ + if (self.idlebusy == SKULLW_STAND) skullw_transB1(); + else skullw_walk1(); +}; + +//============================================================================ +void() skullw_run1 =[ $stand1, skullw_run2 ] {ai_face(); + monster_idle_sound();ai_run(0);}; +void() skullw_run2 =[ $stand18, skullw_run3 ] {ai_face();ai_run(0);}; +void() skullw_run3 =[ $stand16, skullw_run4 ] {ai_run(0);}; +void() skullw_run4 =[ $stand14, skullw_run5 ] {ai_run(0);}; +void() skullw_run5 =[ $stand12, skullw_run6 ] {ai_face();ai_run(0);}; +void() skullw_run6 =[ $stand3, skullw_run7 ] {ai_face();ai_run(0);}; +void() skullw_run7 =[ $stand5, skullw_run8 ] {ai_run(0);}; +void() skullw_run8 =[ $stand7, skullw_run9 ] {ai_run(0);}; +void() skullw_run9 =[ $stand9, skullw_run10] {ai_face();ai_run(0);}; +void() skullw_run10=[ $stand11, skullw_run11] {ai_face();ai_run(0);}; +void() skullw_run11=[ $stand13, skullw_run12] {ai_run(0);}; +void() skullw_run12=[ $stand15, skullw_run13] {ai_run(0);}; +void() skullw_run13=[ $stand17, skullw_run14] {ai_run(0);}; +void() skullw_run14=[ $stand19, skullw_run1 ] {ai_run(0);}; + +//============================================================================ +// MELEE - Teleportation +//============================================================================ +void() skullw_tfin1 =[ $tele9, skullw_tfin2 ] { + self.velocity = '0 0 0'; + // Always phase in facing the enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.angles_y = self.ideal_yaw; + sound (self, CHAN_AUTO, "skullwiz/blinkin.wav", 1, ATTN_NORM); +}; +void() skullw_tfin2 =[ $tele7, skullw_tfin3 ] {ai_face();}; +void() skullw_tfin3 =[ $tele5, skullw_tfin4 ] {ai_face();}; +void() skullw_tfin4 =[ $tele3, skullw_tfin5 ] {ai_face();}; +void() skullw_tfin5 =[ $tele1, skullw_run1 ] {ai_face(); + self.bodyphased = MONAI_SKULLWSOLID; + self.takedamage = DAMAGE_AIM; +}; + +//---------------------------------------------------------------------- +// Find new teleport location +//---------------------------------------------------------------------- +void() skullw_blink = { + local float dist, edist, blinkfinished, blinkcount; + local vector org, org_ofs, angle_vec; + + blinkfinished = TRUE; blinkcount = 0; + org = angle_vec = org_ofs = '0 0 0'; + org_ofs_z = self.height; + self.oldorigin = self.origin; + + // Trace upwards to find ceiling or maximum teleport height + traceline(self.origin, self.origin+org_ofs, TRUE, self); + org_ofs = trace_endpos; + + // Loop around for possible locations + while(blinkfinished) { + blinkcount = blinkcount + 1; // next loop + angle_vec_y = random() * 360; // Random direction + makevectors(angle_vec); // make vector + + // Generate random angle and trace teleport direction + dist = self.distmin + (random() * self.distmax); + org = org_ofs + (v_forward * dist); + traceline(org_ofs, org, TRUE, self); + + // Check distance is far enough away from enemy + // Move away from any walls (traceline is surface contact) + dist = vlen(trace_endpos - org_ofs) - 32; + org = org_ofs + (v_forward * dist); + edist = vlen(self.enemy.origin - org); + + // Is the enemy far enough away? + if (edist > MONAI_MELEESKULLW) { + // Trace down to floor below new point + traceline(org, org - '0 0 512', TRUE, self); + org = trace_endpos + self.view_ofs; + + // The teleport fuction is working with a radius command + // and this will ignore walls and just find any position + // in all directions. This can lead to the skull wizard + // teleporting behind walls or other parts of the map! + // This can be prevent in two ways: + // 1) linesight between skull wizard and player + // - can leads to less interesting locations (always insight) + // 2) linesight between new location and old + // - This allows skull wizard to teleport around corner + // and still be within the same area! + // + // Trace through monsters and check trace fraction + traceline(org, self.origin, TRUE, self); + if (trace_fraction == 1) blinkfinished = FALSE; + } + + // Been looping too long, back to original location + if (blinkcount > 10) { + blinkfinished = FALSE; + org = self.origin; + } + } + + // Move to new location + self.solid = SOLID_SLIDEBOX; // Standard monster movement + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + setorigin(self, org); // move to new location + + // Test if new location is solid? + if (!walkmove (0, 0)) { + self.solid = SOLID_NOT; // No world interaction yet + setmodel(self,""); // Turn off model + setorigin(self, self.oldorigin); // restore original location + self.nextthink = time + 1; // Keep checking + self.think = skullw_blink; + } + else skullw_tfin1(); +}; + +//---------------------------------------------------------------------- +// Cycle around teleport chain lists instead +//---------------------------------------------------------------------- +void() skullw_waitforlink = +{ + self.nextthink = time + 0.5 + random(); + self.think = skullw_waitforlink; + setorigin(self, self.movelast.origin); // move to new location + self.enemydist = range_distance(self.enemy, FALSE); + + // Is the enemy too close or dead? + if (self.enemydist > self.movelast.distance || self.enemy.health < 1) { + // Move to new location + self.solid = SOLID_SLIDEBOX; // Standard monster movement + setmodel(self, self.mdl); // Setup model + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + // Test if new location is solid? + if (!walkmove (0, 0)) { + self.solid = SOLID_NOT; // No world interaction yet + setmodel(self,""); // Turn off model + } + else skullw_tfin1(); + } +}; + +//---------------------------------------------------------------------- +void() skullw_checkblinklist = { + // Does the blink list exist already? + if (self.movelast.classtype != CT_SKULLTELEPORT) { + self.movelast = find(world,targetname,self.target2); + // Does the entity chain exist? + if (self.movelast.classtype == CT_SKULLTELEPORT) + skullw_waitforlink(); + else { + // target2 is not valid, do regular teleport + self.target2 = ""; + skullw_blink(); + } + } + else { + // Move forward in chain and try next spawn location + self.movelast = self.movelast.enemy; + skullw_waitforlink(); + } +}; + +//---------------------------------------------------------------------- +// touch book and phase out +//---------------------------------------------------------------------- +void() skullw_tele1 =[ $spellB3, skullw_tele2 ] { + self.pain_finished = time + 1; // no pain during teleportation + if (random() < 0.5) sound (self, CHAN_VOICE, "skullwiz/blinkspk1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "skullwiz/blinkspk2.wav", 1, ATTN_NORM); +}; +void() skullw_tele2 =[ $spellB5, skullw_tele3 ] {}; +void() skullw_tele3 =[ $spellB7, skullw_tele4 ] {}; +void() skullw_tele4 =[ $spellB9, skullw_tele6 ] {}; +void() skullw_tele6 =[ $spellB13, skullw_tele8 ] {}; +void() skullw_tele8 =[ $tele1, skullw_tele9 ] { + self.takedamage = DAMAGE_NO; // No damage or impact, phasing out + self.solid = SOLID_NOT; + self.bodyphased = MONAI_SKULLWINVIS; + particle_explode(self.origin, 100, 1, self.part_style, PARTICLE_BURST_SKULLUP); + sound (self, CHAN_VOICE, "skullwiz/blinkout.wav", 1, ATTN_NORM); +}; +void() skullw_tele9 =[ $tele3, skullw_tele10 ] {}; +void() skullw_tele10=[ $tele5, skullw_tele11 ] {}; +void() skullw_tele11=[ $tele7, skullw_tele12 ] {}; +void() skullw_tele12=[ $tele9, skullw_tele13 ] {}; +void() skullw_tele13 = { + setmodel(self,""); + // Check if a chain list has been defined + if (self.target2 != "") skullw_checkblinklist(); + else skullw_blink(); +}; + +//============================================================================ +// Rocket Skull Attack (Regular) +//============================================================================ +void(vector orgofs) skullw_fire = +{ + local vector org, dir; + local float proj_type; + + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + if (random() < 0.5) sound (self, CHAN_WEAPON, "skullwiz/skull1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "skullwiz/skull2.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(orgofs); + dir = normalize(self.enemy.origin - org); + + self.attack_speed = SPEED_SWIZMISSILE + (skill * SPEED_SWIZSKILL); + if (self.spawnflags & MON_SKULLWIZ_GUARDIAN) proj_type = CT_PROJ_SKULLWP; + else proj_type = CT_PROJ_SKULLW; + Launch_Missile (org, dir, '0 0 0', proj_type, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() skullw_attack1 =[ $spellA3, skullw_attack2 ] { +sound (self, CHAN_VOICE, "skullwiz/attack.wav", 1, ATTN_NORM);}; +void() skullw_attack2 =[ $spellA5, skullw_attack3 ] {ai_face();}; +void() skullw_attack3 =[ $spellA7, skullw_attack4 ] {ai_face();}; +void() skullw_attack4 =[ $spellA10, skullw_attack5 ] {ai_face();}; +void() skullw_attack5 =[ $spellA11, skullw_attack6 ] {ai_face();}; +void() skullw_attack6 =[ $spellA12, skullw_attack7 ] {skullw_fire('30 0 16');}; +void() skullw_attack7 =[ $spellA13, skullw_attack8 ] {}; +void() skullw_attack8 =[ $spellA15, skullw_run1 ] {}; + +//============================================================================ +// Poison Skull Attack (Guardians) +//============================================================================ +void() skullw_poison_touch = +{ + if (other.solid == SOLID_TRIGGER) return; + if (other.classtype == CT_TEMPSTREAM) return; + if (other.health > 0) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 1; + self.model = ""; + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() skullw_poison_think = +{ + // Randomly drift upwards and slow down forward movement + self.velocity_z = self.velocity_z + 10 + (random() * 20); + self.velocity = self.velocity - (self.velocity * 0.125); + + self.frame = self.frame + 1; + if (self.frame > self.count) SUB_Remove(); + else self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() skullw_guardian = +{ + local float poison_loop; + local vector poison_angles, org, dir; + + // Remove projectile + entity_remove(self, 1); + // Play explosion sound + sound (self, CHAN_WEAPON, "skullwiz/poison_hit.wav", 1, ATTN_NORM); + + // Apply any direct damage and poison effect + if (other.takedamage) { + T_Damage (other, self, self.owner, DAMAGE_SWIZPOISON, DAMARMOR); + if (other.flags & FL_CLIENT) PoisonDeBuff(other); + } + + poison_loop = 0; + poison_angles = '0 0 0'; + + while (poison_loop < 360) { + newmis = spawn(); + newmis.classtype = CT_TEMPSTREAM; + newmis.movetype = MOVETYPE_FLY; // Fly, no gravity + newmis.solid = SOLID_TRIGGER; + setmodel(newmis, SBURST_POISON); + + org = self.origin; + org_z = org_z + (crandom() * 24); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + poison_angles_y = poison_loop; + makevectors(poison_angles); + dir = vecrand(0,50,FALSE); + dir = dir + (v_forward * (400 + random() * 50)); + newmis.velocity = dir; + newmis.count = 6; + newmis.frame = rint(random()*2); + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) newmis.effects = newmis.effects + EF_NOSHADOW; + + newmis.think = skullw_poison_think; + newmis.touch = skullw_poison_touch; + newmis.nextthink = time + 0.1; + + poison_loop = poison_loop + rint(random()*15); + } +}; + +//============================================================================ +// SUMMON MINION - Purple magic ball +//============================================================================ +void() skullw_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_SWBALL; + } +}; + +//---------------------------------------------------------------------- +void() skullw_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() skullw_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +// Display a purple ball in the hand of the skull wizard +//---------------------------------------------------------------------- +void(vector orgofs, float dbframe) skullw_sumball = +{ + local vector org; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.pos2); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = 0; + self.attachment.alpha = 0.85; + } + + // Generate attachment in hand (left) + makevectors(self.angles); + org = self.origin + attack_vector(orgofs); + setorigin(self.attachment, org); + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = dbframe; + + // Create particles inside of skull wizard robes floating up + // once lost soul is spawning, then switch particle location + if (self.aflag == TRUE) particle_explode(self.pos2, 3, 1, self.part_style, PARTICLE_BURST_MINOTAUR); + // Need to cut down on particles, too much visual noise + // else particle_debuff(self.origin, 16, rint(4+random()*4), self.part_style); +}; + +//---------------------------------------------------------------------- +// Raise hand up to the sky and spawn purple particles from body +// Always check if there is space to spawn a lost soul first +// Block monster pain function so that the summons is completed +//---------------------------------------------------------------------- +void() skullw_summon1 =[ $summon1, skullw_summon2 ] { + ai_face();self.pain_finished = time + 2;}; +void() skullw_summon2 =[ $summon3, skullw_summon3 ] { + ai_face();skullw_sumball('22 -2 6',0);}; +void() skullw_summon3 =[ $summon5, skullw_summon4 ] { + ai_face(); skullw_sumball('23 -3 7',1); + sound (self, CHAN_BODY, "skullwiz/summon.wav", 1, ATTN_NORM); + /* The touch trigger is created early (4 frames) so its gets + // a chance for a client to touch its bounding box + // This is a giant trigger area to catch speedy players + makevectors(self.angles); + self.pos1 = self.origin + self.view_ofs + v_forward*64 + v_up*16; + setup_minionspace(self.pos1, '-32 -32 -32', '32 32 32'); */ +}; +void() skullw_summon4 =[ $summon7, skullw_summon5 ] {skullw_sumball('24 -4 9',2);}; +void() skullw_summon5 =[ $summon9, skullw_summon6 ] {skullw_sumball('26 -4 10',3);}; +void() skullw_summon6 =[ $summon11, skullw_summon7 ] {skullw_sumball('26 -4 12',3);}; +void() skullw_summon7 =[ $summon13, skullw_summon8 ] { + // Find out if there is enough space to spawn a lost soul + // This is really a tricky thing to test for ... + // * pointcontents only checks against world space + // * walkmove does not work properly on the lower plane face + // * touch triggers only work when something touches not inside + // * findradius will find a lot of entities depending on radius + + // Touch trigger version + //self.aflag = test_minionspace(); + + // Findradius version + makevectors(self.angles); + self.pos1 = self.origin + self.view_ofs + v_forward*64 + v_up*16; + self.aflag = find_minionspace(self.pos1); + + // If the spawn locaiton all clear, spawn something! + if (self.aflag == TRUE) { + minion_lostsoul(self.pos1, self.enemy); + self.pos2 = self.pos1 - '0 0 16'; // Where to spawn particles + skullw_sumball('26 -4 14',4); + } +}; +void() skullw_summon8 =[ $summon15, skullw_summon9 ] {skullw_sumball('26 -4 16',4);}; +void() skullw_summon9 =[ $summon17, skullw_summon10 ] {skullw_sumball('26 -4 19',4);}; +void() skullw_summon10 =[ $summon19, skullw_summon11 ] {skullw_sumball('26 -5 23',4);}; +void() skullw_summon11 =[ $summon21, skullw_summon12 ] {skullw_sumball('26 -6 30',3);}; +void() skullw_summon12 =[ $summon23, skullw_summon13 ] {skullw_sumball('19 -7 32',1);}; +void() skullw_summon13 =[ $summon25, skullw_summon14 ] {skullw_finish_attachment(); + if (self.aflag == TRUE) particle_explode(self.pos1, 15, 2, self.part_style, PARTICLE_BURST_MINOTAUR);}; +void() skullw_summon14 =[ $summon27, skullw_summon15 ] {ai_face();}; +void() skullw_summon15 =[ $summon29, skullw_run1 ] { + ai_face();SUB_AttackFinished (1 + 2*random());}; + +//---------------------------------------------------------------------- +// Both type of skull wizards go through the same magic function +//---------------------------------------------------------------------- +void() skullw_magic = +{ + local entity miniondef; + + // Make sure the attachments are setup ready + skullw_create_attachment(); + + if (self.spawnflags & MON_SKULLWIZ_MINIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_skullwizminion"); + if (miniondef.classtype == CT_CACHELOSTSOUL) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[SKULLWIZ]\b Cannot find minion template!\n"); + self.spawnflags = self.spawnflags - MON_SKULLWIZ_MINIONS; + } + } + + // Is the target the player or monster? + if (self.enemy.flags & FL_CLIENT) { + if (self.spawnflags & MON_SKULLWIZ_MINIONS) { + // has the lost soul limit been reached? + if (query_minionactive(self) == TRUE) skullw_summon1(); + else { + if (self.minion_baseattack > 0 ) skullw_attack1(); + else skullw_run1(); + } + } + // Red Skull wizards attacks with skull rockets + else skullw_attack1(); + + } + // Always attack monsters with skull rockets + else skullw_attack1(); +}; + +//============================================================================ +void() skullw_phased = { + self.nextthink = time + 0.1; // Keep looking for player + self.think = skullw_phased; // Keep looping + if (random() < 0.02) + particle_explode(self.origin, rint(10+random()*10), 1, self.part_style, PARTICLE_BURST_SKULLUP); + monster_idle_sound(); // High chance of idle sound + ai_stand(); // Keep looking +}; + +//---------------------------------------------------------------------- +void() skullw_wakeup = +{ + // Reset all monster state functions back to default + self.th_stand = skullw_stand; + self.th_walk = skullw_walk; + self.th_run = skullw_run1; + self.th_missile = skullw_magic; + self.th_melee = skullw_tele1; + self.th_updmissile = skullw_guardian; + + // Temporarily restore model/bound box + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel(self, self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + + // Can the skull wizard move? + if (!walkmove (0, 0)) { + // Something blocking, teleport elsewhere + self.solid = SOLID_NOT; + setmodel(self,""); + self.nextthink = time + 0.1; + self.think = skullw_blink; + } + else skullw_tfin1(); +}; + +//============================================================================ +// Short body recoil (6 frames) +void() skullw_painA1 =[ $painA2, skullw_painA2 ] {}; +void() skullw_painA2 =[ $painA4, skullw_painA3 ] {}; +void() skullw_painA3 =[ $painA6, skullw_painA4 ] {}; +void() skullw_painA4 =[ $painA8, skullw_painA5 ] {}; +void() skullw_painA5 =[ $painA10, skullw_painA6 ] {}; +void() skullw_painA6 =[ $painA12, skullw_run1 ] {}; + +// Long expanded out version (10 frames) +void() skullw_painB1 =[ $painA2, skullw_painB3 ] {}; +void() skullw_painB3 =[ $painA3, skullw_painB4 ] {}; +void() skullw_painB4 =[ $painA4, skullw_painB5 ] {}; +void() skullw_painB5 =[ $painA5, skullw_painB6 ] {}; +void() skullw_painB6 =[ $painA6, skullw_painB7 ] {}; +void() skullw_painB7 =[ $painA7, skullw_painB8 ] {}; +void() skullw_painB8 =[ $painA8, skullw_painB9 ] {}; +void() skullw_painB9 =[ $painA9, skullw_painB10 ] {}; +void() skullw_painB10 =[ $painA10, skullw_painB11 ] {}; +void() skullw_painB11 =[ $painA11, skullw_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) skullw_pain = +{ + // Cannot feel pain when phased out + if (self.bodyphased == MONAI_SKULLWINVIS) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + skullw_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + if (random() < 0.85) skullw_painA1(); // classic, body recoil + else skullw_painB1(); // Really long version + } + } +}; + +//============================================================================ +void() skullw_fadeaway = +{ + // sound (self, CHAN_BODY, "skullwiz/fadeaway.wav", 1, ATTN_NORM); + // Particle burst upwards as robes fade away + particle_explode(self.origin, 100, 3, self.part_style, PARTICLE_BURST_SKULLUP); + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() skullw_explode = +{ + self.health = MON_NOGIBVELOCITY; // Low gib directional modifier + particle_explode(self.origin, 100, 3, PARTICLE_BURST_WHITE, PARTICLE_BURST_SKULLUP); + self.gib2skin = self.exactskin; // Update book skin + ThrowGib(11,1); ThrowGib(12,1); // Throw head and book +}; + +//---------------------------------------------------------------------- +void() skullw_death1 =[ $death2, skullw_death2 ] {ai_face();}; +void() skullw_death2 =[ $death3, skullw_death3 ] {ai_face();}; +void() skullw_death3 =[ $death4, skullw_death4 ] {ai_face();self.solid = SOLID_NOT;}; +void() skullw_death4 =[ $death5, skullw_death5 ] {ai_face();}; +void() skullw_death5 =[ $death6, skullw_death6 ] {skullw_explode();}; +void() skullw_death6 =[ $death7, skullw_death7 ] {}; +void() skullw_death7 =[ $death8, skullw_death8 ] {}; +void() skullw_death8 =[ $death9, skullw_death9 ] {}; +void() skullw_death9 =[ $death10, skullw_death10 ] {}; +void() skullw_death10 =[ $death11, skullw_death11 ] {}; +void() skullw_death11 =[ $death12, skullw_death12 ] {}; +void() skullw_death12 =[ $death13, skullw_death13 ] {}; +void() skullw_death13 =[ $death14, skullw_death14 ] {}; +void() skullw_death14 =[ $death15, skullw_death14] { + // Random timer for robes to fade away + self.think = skullw_fadeaway; + self.nextthink = time + 8 + random() * 8; +}; + +//---------------------------------------------------------------------- +void() skullw_die = +{ + // Play fade away/death sound + sound (self, CHAN_VOICE, "skullwiz/death.wav", 1, ATTN_NORM); + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + skullw_remove_attachment(); + + // Special death, Instantly vaporize cloak + // This is really a gib death without the gibs! + if (self.health < -40) { + // Typical Grenade explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + SpawnExplosion(EXPLODE_MED, self.origin, SOUND_REXP3); + + self.health = MON_NOGIBVELOCITY; // Low gib directional modifier + self.gib2skin = self.exactskin; // Update book skin + ThrowGib(11,1); ThrowGib(12,1); // Throw head and book + entity_hide(self); + } + // Regular death, collapse and fade away + else { + // Large particle explosion upwards + particle_explode(self.origin, 100, 3, self.part_style, PARTICLE_BURST_SKULLUP); + skullw_death1(); + } +}; + +/*====================================================================== +QUAKED monster_skullwiz (0.5 0 1) (-16 -16 -24) (16 16 40) +======================================================================*/ +void() monster_skullwiz = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_skullwiz.mdl"; + precache_model (self.mdl); + precache_model (MODEL_PROJ_SWSKULL); // explosive flaming skull + precache_model (MODEL_PROJ_SWSKULLP); // explosive poison skull + precache_model (MODEL_PROJ_SWBALL); // Purple minion ball + precache_model (SBURST_POISON); // Poison explosion + + self.gib1mdl = "progs/ad171/h_skullwiz.mdl"; // Skull head + self.gib2mdl = "progs/ad171/w_skullbook.mdl"; // Unique book item + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + + self.idle_sound = "skullwiz/idle1.wav"; + self.idle_sound2 = "skullwiz/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("skullwiz/death.wav"); + self.pain_sound = "skullwiz/pain1.wav"; + self.pain_sound2 = "skullwiz/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("skullwiz/attack.wav"); // fire spell + precache_sound ("skullwiz/skull1.wav"); // Screaming skull attack + precache_sound ("skullwiz/skull2.wav"); + precache_sound ("skullwiz/summon.wav"); + precache_sound ("skullwiz/poison_hit.wav"); // Guardian Explosion + + precache_sound ("skullwiz/blinkspk1.wav"); // Talk casting blink spell + precache_sound ("skullwiz/blinkspk2.wav"); + precache_sound ("skullwiz/blinkout.wav"); // Sound of blink animation + precache_sound ("skullwiz/blinkin.wav"); + + self.sight_sound = "skullwiz/sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 120; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 50; // Armour strength robes! + self.steptype = FS_TYPEMEDIUM; // Humanoid footsteps + self.pain_longanim = FALSE; // No long pain animation + + // Skull wizards have special animation movement sets + // Need extra parameters for their teleporting ability + // Can be setup to start phased out and surprise the player + self.idlebusy = SKULLW_STAND; + if (self.height == 0) self.height = SKULLW_HEIGHT; + if (self.distmin == 0) self.distmin = SKULLW_DISTMIN; + if (self.distmax == 0) self.distmax = SKULLW_DISTMAX; + if (!self.bodyphased) self.bodyphased = MONAI_SKULLWSOLID; + else self.bodyphased = MONAI_SKULLWINVIS; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SkullWizCheckAttack; + self.th_pain = skullw_pain; + self.th_die = skullw_die; + + // Does the skull wizard start phased out? + // Need to intercept idle/combat functions + if (self.bodyphased == MONAI_SKULLWINVIS) { + self.th_stand = skullw_phased; + self.th_walk = skullw_phased; + self.th_run = skullw_wakeup; + self.th_missile = skullw_wakeup; + self.th_melee = skullw_wakeup; + } + else { + self.th_stand = skullw_stand; + self.th_walk = skullw_walk; + self.th_run = skullw_run1; + self.th_missile = skullw_magic; + self.th_melee = skullw_tele1; + self.th_updmissile = skullw_guardian; + } + + self.classtype = CT_MONSKULLW; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEWALK; + + // Special black robes for skull spawner + if (self.spawnflags & MON_SKULLWIZ_MINIONS) { + self.health = self.health * 1.5; // 150% HP + if (!self.exactskin) self.exactskin = 2; // Black robes + } + // Special green robes for rune guardians + else if (self.spawnflags & MON_SKULLWIZ_GUARDIAN) { + self.health = self.health * 2; // 200% HP + if (!self.exactskin) self.exactskin = 3; // Green rboes + } + + if (self.deathstring == "") self.deathstring = " was blown apart by a Skull Wizard\n"; + + // Make sure the particles match the skin + if (self.exactskin == 1) self.part_style = PARTICLE_BURST_GREEN; + else if (self.exactskin == 2) self.part_style = PARTICLE_BURST_PURPLE; + else if (self.exactskin == 3) self.part_style = PARTICLE_BURST_GREEN; + else if (self.exactskin == 4) self.part_style = PARTICLE_BURST_WHITE; + else self.part_style = PARTICLE_BURST_RED; + + monster_start(); +}; + +/*====================================================================== +/*QUAKED info_skullwiz_destination (0.6 0 0.8) (-16 -16 -24) (16 16 40) x +Teleport destination for skull wizard ONLY +-------- KEYS -------- +targetname : part of a chain group (required) +target : next destination in the chain +distance : Minimum distance enemy needs to be before spawning +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Teleport destination for skull wizard ONLY + +======================================================================*/ +void() info_skullwiz_link = +{ + local entity currlink, master; + local float loopcondition; + + // Teleport destination already been linked + if (self.enemy) return; + + // The master entity is the start of the chain + // the currlink is a link in the chain + master = self; + loopcondition = TRUE; + + while (loopcondition) + { + // Setup next link to master and find next link + self.enemy = master; + currlink = find(world, targetname, self.target); + // reached end of list? + if (!currlink || currlink == master) + loopcondition = FALSE; + else { + // Move forward in the chain + self.enemy = currlink; + self = currlink; + } + } +}; + +//---------------------------------------------------------------------- +void() info_skullwiz_destination = +{ + // All teleportation points need to be part of a chain + // Otherwise the skull Wizard would have to use findradius + // which is expensive if lots of entities are around + if (self.targetname == "" || self.target == "") { + dprint("\b[SKULLWIZ_DEST]\b missing target or targetname\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + self.classtype = CT_SKULLTELEPORT; + self.mangle = self.angles; + // Setup minimum player spawn distance + if (self.distance <=0) self.distance = MONAI_MELEESKULLW; + // Setup if the destination is active or not + self.state = FALSE; + + // Check for targetname->target loops + if (self.targetname == self.target) { + self.enemy = self; + self.owner = self; + } + else { + // Wait for all targets to spawn + self.think = info_skullwiz_link; + self.nextthink = time + 0.2 + random(); + } +}; + diff --git a/QC_other/QC_keep/mon_snakeman.qc b/QC_other/QC_keep/mon_snakeman.qc new file mode 100644 index 00000000..252ece42 --- /dev/null +++ b/QC_other/QC_keep/mon_snakeman.qc @@ -0,0 +1,289 @@ +void(float offset) SnakeMissile; + +void() snake_stand = [9, snake_stand2] { ai_stand(); }; +void() snake_stand2 = [10, snake_stand3] { ai_stand(); }; +void() snake_stand3 = [11, snake_stand4] { ai_stand(); }; +void() snake_stand4 = [12, snake_stand5] { ai_stand(); }; +void() snake_stand5 = [13, snake_stand6] { ai_stand(); }; +void() snake_stand6 = [14, snake_stand7] { ai_stand(); }; +void() snake_stand7 = [15, snake_stand8] { ai_stand(); }; + +void() snake_stand8 = [14, snake_stand9] { ai_stand(); }; +void() snake_stand9 = [13, snake_stand10] { ai_stand(); }; +void() snake_stand10 = [12, snake_stand11] { ai_stand(); }; +void() snake_stand11 = [11, snake_stand12] { ai_stand(); }; +void() snake_stand12 = [10, snake_stand] { ai_stand(); }; + +void() snake_walk1 = [0, snake_walk2] { + if (random() < 0.2) sound(self, CHAN_VOICE, "snakeman/idle.wav", 1, ATTN_IDLE); + ai_walk(FL_SWIM); +}; +void() snake_walk2 = [1, snake_walk3] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk3 = [2, snake_walk4] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk4 = [3, snake_walk5] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk5 = [4, snake_walk6] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk6 = [5, snake_walk7] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk7 = [6, snake_walk8] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk8 = [7, snake_walk9] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk9 = [8, snake_walk10] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk10 = [9, snake_walk11] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk11 = [10, snake_walk12] { ai_walk(MOVETYPE_WALK); }; +void() snake_walk12 = [11, snake_walk13] { ai_walk(FL_SWIM); }; +void() snake_walk13 = [12, snake_walk14] { ai_walk(FL_SWIM); }; +void() snake_walk14 = [13, snake_walk15] { ai_walk(FL_SWIM); }; +void() snake_walk15 = [14, snake_walk16] { ai_walk(1); }; +void() snake_walk16 = [15, snake_walk1] { ai_walk(1); }; + +void() snake_run1 = [0, snake_run2] +{ + if (self.health < 0) return; + if (self.wait2) { + sound(self, CHAN_VOICE, "snakeman/sight.wav", 1, ATTN_IDLE); + self.wait2 = FALSE; + } else { + if (random() < 0.2) sound(self, CHAN_VOICE, "snakeman/idle.wav", 1, ATTN_IDLE); + } + self.attack_state = AS_SLIDING; + + ai_run(FL_CLIENT); +}; + +void() snake_run2 = [2, snake_run3] +{ + ai_run(MOVETYPE_FLYMISSILE); +}; + +void() snake_run3 = [4, snake_run4] +{ + ai_run(MOVETYPE_TOSS); +}; + +void() snake_run4 = [6, snake_run5] +{ + ai_run(MOVETYPE_FLYMISSILE); +}; + +void() snake_run5 = [8, snake_run6] +{ + self.attack_state = AS_STRAIGHT; + ai_face(); +}; + +void() snake_run6 = [10, snake_run7] +{ + ai_run(15); +}; + +void() snake_run7 = [12, snake_run8] +{ + ai_run(12); +}; + +void() snake_run8 = [14, snake_run1] +{ + ai_run(15); +}; + +void() snake_attack1 = [16, snake_attack6] { + sound(self, CHAN_VOICE, "snakeman/idle.wav", 1, ATTN_NORM); + ai_face(); +}; + +void() snake_attack6 = [21, snake_attack7] { + ai_run_slide(12); + SnakeMissile(FL_SWIM); + SnakeMissile(CONTENT_SOLID); +}; + +void() snake_attack7 = [22, snake_attack8] { + ai_run_slide(12); + SnakeMissile(1); + SnakeMissile(CONTENT_EMPTY); +}; + +void() snake_attack8 = [23, snake_attack9] { + ai_run_slide(12); + SnakeMissile(0); + SnakeMissile(0); +}; + +void() snake_attack9 = [24, snake_attack10] { + ai_run_slide(12); + SnakeMissile(0); + SnakeMissile(0); +}; + +void() snake_attack10 = [25, snake_run1] { + ai_run_slide(12); + SnakeMissile(0); + SnakeMissile(0); + SUB_CheckRefire(snake_attack1); +}; + +void() snake_pain1 = [26, snake_pain2] +{ +}; + +void() snake_pain2 = [27, snake_pain3] +{ +}; + +void() snake_pain3 = [28, snake_pain4] +{ +}; + +void() snake_pain4 = [29, snake_pain5] +{ +}; + +void() snake_pain5 = [30, snake_pain6] +{ +}; + +void() snake_pain6 = [31, snake_pain7] +{ +}; + +void() snake_pain7 = [32, snake_run1] +{ +}; + +void() snake_bpain1 = [52, snake_bpain2]{}; +void() snake_bpain2 = [53, snake_bpain3]{}; +void() snake_bpain3 = [54, snake_bpain4]{}; +void() snake_bpain4 = [55, snake_bpain5]{}; +void() snake_bpain5 = [56, snake_bpain6]{}; +void() snake_bpain6 = [57, snake_bpain7]{}; +void() snake_bpain7 = [58, snake_run1]{}; + +void() snake_death1 = [36, snake_death3] {}; +void() snake_death3 = [37, snake_death4] {monster_check_gib();}; +void() snake_death4 = [38, snake_death5] { + monster_check_gib(); + self.solid = SOLID_NOT; +}; +void() snake_death5 = [39, snake_death6] {}; +void() snake_death6 = [40, snake_death7] {}; +void() snake_death7 = [41, snake_death8] {}; +void() snake_death8 = [42, snake_death9] {}; +void() snake_death9 = [43, snake_death10] { self.ammo_nails = 15; DropBackpack();}; +void() snake_death10 = [44, snake_death11] {}; +void() snake_death11 = [45, snake_death12] {monster_death_postcheck();}; +void() snake_death12 = [45, snake_death12] { monster_deadbody_check(); }; + +void() snake_dead1 = [46, snake_dead2]{}; +void() snake_dead2 = [47, snake_dead3] {monster_check_gib();}; +void() snake_dead3 = [48, snake_dead4] { + monster_check_gib(); + self.solid = SOLID_NOT; +}; +void() snake_dead4 = [49, snake_dead5] { self.ammo_nails = 15; DropBackpack(); }; +void() snake_dead5 = [50, snake_dead6] {monster_death_postcheck();}; +void() snake_dead6 = [51, snake_dead6] { monster_deadbody_check(); }; + +void(entity inflictor, entity attacker, float damage) snake_pain = { + if (self.pain_finished > time) return; + + sound(self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); + self.velocity_x = -50 - 50 * random(); + self.velocity_y = 0; + self.velocity_z = MOVETYPE_FLY + FL_SWIM * random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.pain_finished = time + MOVETYPE_WALK; + if (random() > 0.5) + snake_pain1(); + else + snake_bpain1(); +}; + +void() snake_die = { + monster_death_precheck(); + self.enemy = world; + + self.pain_finished = time + LARGE_TIMER; + if (self.gibbed) { + // Throw extra gibs + ThrowHead(); //2nd uzi + ThrowGib(12,1); + return; + } + + if (!self.gibbed) { + + self.movetype = MOVETYPE_BOUNCE; + self.velocity_x = -50 + 100 * random(); + self.velocity_y = -50 + 100 * random(); + self.velocity_z = FL_SWIM + FL_SWIM * random(); + self.avelocity_x = -20 + 40 * random(); + self.avelocity_y = -200 + 400 * random(); + self.avelocity_z = 0; + self.flags = self.flags - (self.flags & FL_ONGROUND); + sound(self, CHAN_VOICE, "snakeman/pain2.wav", 1, ATTN_NORM); + if (random() > 0.5) { + snake_death1(); + } else { + snake_dead1(); + } + } +}; + +void(float offset) SnakeMissile = { + local vector offang, org, vec; + + self.effects = self.effects | EF_MUZZLEFLASH; + offang = vectoangles(self.enemy.origin - self.origin); + offang_y = offang_y + offset * MOVETYPE_TOSS; + makevectors(offang); + org = self.origin - SVC_INTERMISSION * normalize(self.velocity); + vec = normalize(v_forward); + vec_z = 0 - vec_z + (random() - 0.5) * 0.1; + launch_projectile(org, vec, CT_PROJ_NG, SPEED_PLAYSPIKE); + sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); +}; + +void() monster_snakeman = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/snakeman.mdl"; + self.headmdl = "progs/uzi.mdl"; + precache_model2("progs/snakeman.mdl"); + precache_model2("progs/k_spike.mdl"); + precache_model2("progs/uzi.mdl"); + self.gib1mdl = "progs/gib1.mdl"; + precache_model("progs/gib1.mdl"); + self.gib2mdl = "progs/gib2.mdl"; + precache_model("progs/gib2.mdl"); + self.gib3mdl = "progs/gib3.mdl"; + precache_model("progs/gib3.mdl"); + precache_sound2("snakeman/idle.wav"); + precache_sound2("snakeman/sight.wav"); + precache_sound2("snakeman/pain2.wav"); + precache_sound2("snakeman/idle.wav"); + precache_sound2("ogre/ogpain1.wav"); + precache_sound2("snakeman/pain2.wav"); + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 200; + self.gibhealth = -25; // easy to gib + self.pain_flinch = 60; + self.th_stand = snake_stand; + self.th_walk = snake_walk1; + self.th_run = snake_run1; + self.th_die = snake_die; + self.th_pain = snake_pain; + self.th_missile = snake_attack1; + self.blockudeath = TRUE; // No humanoid death sound + self.wait2 = TRUE; // have not played sight sound yet + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was hosed by a Snakeman\n"; + + if(!self.classtype) self.classtype = CT_MONSNAKEMAN; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_soldier.qc b/QC_other/QC_keep/mon_soldier.qc new file mode 100644 index 00000000..ff4c6372 --- /dev/null +++ b/QC_other/QC_keep/mon_soldier.qc @@ -0,0 +1,508 @@ +/*============================================================================== +SOLDIER / PLAYER +==============================================================================*/ +$cd id1/models/soldier3 +$origin 0 -6 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 + +$frame load1 load2 load3 load4 load5 load6 load7 load8 load9 load10 load11 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 shoot7 shoot8 shoot9 + +$frame walk_1 walk_2 walk_3 walk_4 walk_5 walk_6 walk_7 walk_8 +$frame walk_9 walk_10 walk_11 walk_12 walk_13 walk_14 walk_15 walk_16 +$frame walk_17 walk_18 walk_19 walk_20 walk_21 walk_22 walk_23 walk_24 + +void() army_fire; + +//====================================================================== +void() army_stand1 =[ $stand1, army_stand2 ] {monster_idle_sound(); ai_stand();}; +void() army_stand2 =[ $stand2, army_stand3 ] {ai_stand();}; +void() army_stand3 =[ $stand3, army_stand4 ] {ai_stand();}; +void() army_stand4 =[ $stand4, army_stand5 ] {ai_stand();}; +void() army_stand5 =[ $stand5, army_stand6 ] {ai_stand();}; +void() army_stand6 =[ $stand6, army_stand7 ] {ai_stand();}; +void() army_stand7 =[ $stand7, army_stand8 ] {ai_stand();}; +void() army_stand8 =[ $stand8, army_stand1 ] {ai_stand();}; + +//====================================================================== +void() army_walk1 =[ $walk_1, army_walk2 ] {monster_footstep(FALSE);ai_walk(1);}; +void() army_walk2 =[ $walk_2, army_walk3 ] {monster_idle_sound();ai_walk(1);}; +void() army_walk3 =[ $walk_3, army_walk4 ] {ai_walk(1);}; +void() army_walk4 =[ $walk_4, army_walk5 ] {ai_walk(1);}; +void() army_walk5 =[ $walk_5, army_walk6 ] {ai_walk(2);}; +void() army_walk6 =[ $walk_6, army_walk7 ] {ai_walk(3);}; +void() army_walk7 =[ $walk_7, army_walk8 ] {ai_walk(4);}; +void() army_walk8 =[ $walk_8, army_walk9 ] {ai_walk(4);}; +void() army_walk9 =[ $walk_9, army_walk10 ] {ai_walk(2);}; +void() army_walk10 =[ $walk_10, army_walk11 ] {ai_walk(2);}; +void() army_walk11 =[ $walk_11, army_walk12 ] {ai_walk(2);}; +void() army_walk12 =[ $walk_12, army_walk13 ] {monster_footstep(FALSE);ai_walk(1);}; +void() army_walk13 =[ $walk_13, army_walk14 ] {ai_walk(0);}; +void() army_walk14 =[ $walk_14, army_walk15 ] {ai_walk(1);}; +void() army_walk15 =[ $walk_15, army_walk16 ] {ai_walk(1);}; +void() army_walk16 =[ $walk_16, army_walk17 ] {ai_walk(1);}; +void() army_walk17 =[ $walk_17, army_walk18 ] {ai_walk(3);}; +void() army_walk18 =[ $walk_18, army_walk19 ] {ai_walk(3);}; +void() army_walk19 =[ $walk_19, army_walk20 ] {ai_walk(3);}; +void() army_walk20 =[ $walk_20, army_walk21 ] {ai_walk(3);}; +void() army_walk21 =[ $walk_21, army_walk22 ] {ai_walk(2);}; +void() army_walk22 =[ $walk_22, army_walk23 ] {ai_walk(1);}; +void() army_walk23 =[ $walk_23, army_walk24 ] {ai_walk(1);}; +void() army_walk24 =[ $walk_24, army_walk1 ] {ai_walk(1);}; + +//====================================================================== +void() army_run1 =[ $run1, army_run2 ] {monster_idle_sound();ai_run(11);}; +void() army_run2 =[ $run2, army_run3 ] {monster_footstep(FALSE);ai_run(15);}; +void() army_run3 =[ $run3, army_run4 ] {ai_run(10);}; +void() army_run4 =[ $run4, army_run5 ] {ai_run(10);}; +void() army_run5 =[ $run5, army_run6 ] {ai_run(8);}; +void() army_run6 =[ $run6, army_run7 ] {monster_footstep(FALSE);ai_run(15);}; +void() army_run7 =[ $run7, army_run8 ] {ai_run(10);}; +void() army_run8 =[ $run8, army_run1 ] {ai_run(8);}; + +// Move backwards to create some space to fire a rocket +void() army_runback1 =[ $run8, army_runback2 ] {ai_backface(8);}; +void() army_runback2 =[ $run7, army_runback3 ] {ai_backface(10);}; +void() army_runback3 =[ $run6, army_runback4 ] {monster_footstep(FALSE);ai_backface(15);}; +void() army_runback4 =[ $run5, army_runback5 ] {ai_backface(8);}; +void() army_runback5 =[ $run4, army_runback6 ] {ai_backface(10);}; +void() army_runback6 =[ $run3, army_runback7 ] {ai_backface(10);}; +void() army_runback7 =[ $run2, army_runback8 ] {monster_footstep(FALSE);ai_backface(15);}; +void() army_runback8 =[ $run1, army_run1 ] {ai_backface(11);}; + +//====================================================================== +void() army_fire = +{ + if (!self.enemy) return; + if (self.health < 1) return; + + ai_face(); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "soldier/sattck1.wav", 1, ATTN_NORM); + + // Choose between a projectile or hit-scan system + if (query_configflag(SVR_SHOTGPROJ)) + FireBullets (QUANTITY_GRUNT, SPREAD_GRUNT); + else { + Launch_Shells(QUANTITY_GRUNT, SPREAD_GRUNT, CT_PROJ_SG); + Launch_ShellCasing(1); + } +}; + +//---------------------------------------------------------------------- +void() army_atk1 =[ $shoot1, army_atk2 ] {ai_face();}; +void() army_atk2 =[ $shoot2, army_atk3 ] {ai_face();}; +void() army_atk3 =[ $shoot3, army_atk4 ] {ai_face();}; +void() army_atk4 =[ $shoot4, army_atk5 ] {ai_face();}; +void() army_atk5 =[ $shoot5, army_atk6 ] {ai_face();army_fire();}; +void() army_atk6 =[ $shoot6, army_atk7 ] {}; +void() army_atk7 =[ $shoot7, army_atk8 ] {ai_face();SUB_CheckRefire (army_atk1);}; +void() army_atk8 =[ $shoot8, army_atk9 ] {}; +void() army_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +//====================================================================== +void() army_fire_rocket = +{ + local vector org, dir; + + if (!self.enemy) return; + if (self.health < 1) return; + + // check for enemy origin (based on sight test) + // if cannot see enemy fire at last known location + ai_trackenemy(); + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "soldier/rocket_fire.wav", 1, ATTN_NORM); + + self.attack_speed = 250; + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + dir = normalize(self.attack_track - org); + + Launch_Missile (org, dir, '0 0 0', CT_PROJ_ARMY, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() army_rocket_think = +{ + // Only do a limited amount of updates to the missile + self.count = self.count + 1; + if (self.count < (5+skill)) { + // Keep ticking (slowly) + self.nextthink = time + 0.1; + // If enemy active, track them down (slow turn) + if (self.enemy && self.count < 5) { + // Speed up and steer towards enemy + self.attack_speed = self.attack_speed + 100; + self.attack_track = normalize(self.enemy.origin - self.origin); + self.velocity = self.attack_track * self.attack_speed; + self.angles = vectoangles(self.velocity); + } + // Fire at original location + else self.velocity = self.velocity * 1.15; + } + else { + // Remove missile after a while + self.nextthink = time + LIFE_ROCKET; + self.think = SUB_Remove; + } +}; + +//---------------------------------------------------------------------- +void() army_rocket_atk1 =[ $load1, army_load2 ] {ai_face(); + self.pain_finished = time + 1.3; + self.attack_track = self.enemy.origin; + sound (self, CHAN_WEAPON, "soldier/rocket_load.wav", 1, ATTN_NORM);}; +void() army_load2 =[ $load2, army_load3 ] {ai_trackenemy();}; +void() army_load3 =[ $load3, army_load4 ] {ai_trackenemy();}; +void() army_load4 =[ $load4, army_load5 ] {ai_trackenemy();}; +void() army_load5 =[ $load5, army_load6 ] {ai_trackenemy();}; +void() army_load6 =[ $load6, army_load7 ] {ai_trackenemy();}; +void() army_load7 =[ $load7, army_load8 ] {ai_trackenemy();}; +void() army_load8 =[ $load8, army_load9 ] {ai_trackenemy();}; +void() army_load9 =[ $load9, army_load10 ] {ai_trackenemy();}; +void() army_load10 =[ $load10,army_load11 ] {ai_trackenemy();}; +void() army_load11 =[ $load11,army_atkr5 ] {ai_trackenemy();}; +void() army_atkr5 =[ $shoot5,army_atkr6 ] {army_fire_rocket();}; +void() army_atkr6 =[ $shoot6,army_atkr7 ] {}; +void() army_atkr7 =[ $shoot7,army_atkr8 ] {SUB_CheckRefire (army_rocket_atk1);}; +void() army_atkr8 =[ $shoot8,army_atkr9 ] {}; +void() army_atkr9 =[ $shoot9,army_run1 ] {ai_face();}; + +//====================================================================== +void() army_grenade_atk1 =[ $shoot1, army_grenade_atk2 ] {ai_face();}; +void() army_grenade_atk2 =[ $shoot2, army_grenade_atk3 ] {ai_face(); + MonsterGrenadeSound(); self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed);}; +void() army_grenade_atk3 =[ $shoot3, army_grenade_atk4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed);}; +void() army_grenade_atk4 =[ $shoot4, army_grenade_atk5 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed);}; +void() army_grenade_atk5 =[ $shoot5, army_grenade_atk6 ] {ai_face(); + makevectors(self.angles); + self.pos1 = self.origin + attack_vector(self.attack_offset); + MonsterFireGrenade(self.pos1, self.enemy.origin); +}; +void() army_grenade_atk6 =[ $shoot6, army_grenade_atk7 ] {}; +void() army_grenade_atk7 =[ $shoot7, army_grenade_atk8 ] {ai_face();}; +void() army_grenade_atk8 =[ $shoot8, army_grenade_atk9 ] {}; +void() army_grenade_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +//====================================================================== +void() army_plasma_fire = +{ + local vector org, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + vec = normalize(self.enemy.origin - self.origin); + + launch_plasma(org, vec, CT_PROJ_PLASMA, SPEED_PLASMA); +}; + +//---------------------------------------------------------------------- +void() army_plasma_atk1 =[ $shoot1, army_plasma_atk2 ] { + self.pain_finished = time + 1.3; + sound (self, CHAN_WEAPON, "enforcer/elim_pg_load.wav", 1, ATTN_NORM);}; +void() army_plasma_atk2 =[ $shoot2, army_plasma_atk3 ] {ai_face();}; +void() army_plasma_atk3 =[ $shoot3, army_plasma_atk4 ] {ai_face();}; +void() army_plasma_atk4 =[ $shoot4, army_plasma_atk5 ] {ai_face();}; +void() army_plasma_atk5 =[ $shoot5, army_plasma_atk6 ] {ai_face();army_plasma_fire();}; +void() army_plasma_atk6 =[ $shoot6, army_plasma_atk7 ] {}; +void() army_plasma_atk7 =[ $shoot7, army_plasma_atk8 ] {ai_face();SUB_CheckRefire (army_plasma_atk1);}; +void() army_plasma_atk8 =[ $shoot8, army_plasma_atk9 ] {}; +void() army_plasma_atk9 =[ $shoot9, army_run1 ] {ai_face();}; + +//====================================================================== +void() army_pain1 =[ $pain1, army_pain2 ] {}; +void() army_pain2 =[ $pain2, army_pain3 ] {}; +void() army_pain3 =[ $pain3, army_pain4 ] {}; +void() army_pain4 =[ $pain4, army_pain5 ] {}; +void() army_pain5 =[ $pain5, army_pain6 ] {}; +void() army_pain6 =[ $pain6, army_run1 ] {ai_pain(1);}; + +//---------------------------------------------------------------------- +void() army_painb1 =[ $painb1, army_painb2 ] {}; +void() army_painb2 =[ $painb2, army_painb3 ] {ai_painforward(13);}; +void() army_painb3 =[ $painb3, army_painb4 ] {ai_painforward(9);}; +void() army_painb4 =[ $painb4, army_painb5 ] {}; +void() army_painb5 =[ $painb5, army_painb6 ] {}; +void() army_painb6 =[ $painb6, army_painb7 ] {}; +void() army_painb7 =[ $painb7, army_painb8 ] {}; +void() army_painb8 =[ $painb8, army_painb9 ] {}; +void() army_painb9 =[ $painb9, army_painb10] {}; +void() army_painb10=[ $painb10, army_painb11] {}; +void() army_painb11=[ $painb11, army_painb12] {monster_footstep(FALSE);}; +void() army_painb12=[ $painb12, army_painb13] {ai_pain(2);}; +void() army_painb13=[ $painb13, army_painb14] {}; +void() army_painb14=[ $painb14, army_run1 ] {}; + +//---------------------------------------------------------------------- +void() army_painc1 =[ $painc1, army_painc2 ] {}; +void() army_painc2 =[ $painc2, army_painc3 ] {ai_pain(1);}; +void() army_painc3 =[ $painc3, army_painc4 ] {}; +void() army_painc4 =[ $painc4, army_painc5 ] {}; +void() army_painc5 =[ $painc5, army_painc6 ] {ai_painforward(1);}; +void() army_painc6 =[ $painc6, army_painc7 ] {ai_painforward(1);}; +void() army_painc7 =[ $painc7, army_painc8 ] {}; +void() army_painc8 =[ $painc8, army_painc9 ] {ai_pain(1);}; +void() army_painc9 =[ $painc9, army_painc10] {monster_footstep(FALSE); ai_painforward(4);}; +void() army_painc10=[ $painc10, army_painc11] {ai_painforward(3);}; +void() army_painc11=[ $painc11, army_painc12] {ai_painforward(6);}; +void() army_painc12=[ $painc12, army_painc13] {ai_painforward(8);}; +void() army_painc13=[ $painc13, army_run1] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) army_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + self.lip = random(); + if (self.lip < 0.2) { + self.pain_finished = time + 0.6; + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + army_pain1(); + } + else if (self.lip < 0.6) { + self.pain_finished = time + 1.1; + sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + army_painb1(); + } + else { + self.pain_finished = time + 1.1; + sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + army_painc1(); + } + } + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 1.3; + self.axhitme = 0; + // Pick a random pain sound + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + // Pick a random long pain animation + if (random() < 0.5) army_painb1(); + else army_painc1(); + } + } +}; + +//====================================================================== +void() army_die1 =[ $death1, army_die2 ] {}; +void() army_die2 =[ $death2, army_die3 ] {monster_check_gib();}; +void() army_die3 =[ $death3, army_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack();}; +void() army_die4 =[ $death4, army_die5 ] {}; +void() army_die5 =[ $death5, army_die6 ] {}; +void() army_die6 =[ $death6, army_die7 ] {}; +void() army_die7 =[ $death7, army_die8 ] {}; +void() army_die8 =[ $death8, army_die9 ] {}; +void() army_die9 =[ $death9, army_die10 ] {monster_death_postcheck();}; +void() army_die10 =[ $death10, army_die10 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() army_cdie1 =[ $deathc1, army_cdie2 ] {}; +void() army_cdie2 =[ $deathc2, army_cdie3 ] {monster_check_gib();ai_back(5);}; +void() army_cdie3 =[ $deathc3, army_cdie4 ] {monster_check_gib(); + self.solid = SOLID_NOT; if (!self.gibbed) DropBackpack(); ai_back(4);}; +void() army_cdie4 =[ $deathc4, army_cdie5 ] {ai_back(13);}; +void() army_cdie5 =[ $deathc5, army_cdie6 ] {ai_back(3);}; +void() army_cdie6 =[ $deathc6, army_cdie7 ] {ai_back(4);}; +void() army_cdie7 =[ $deathc7, army_cdie8 ] {}; +void() army_cdie8 =[ $deathc8, army_cdie9 ] {}; +void() army_cdie9 =[ $deathc9, army_cdie10 ] {}; +void() army_cdie10 =[ $deathc10, army_cdie11 ] {monster_death_postcheck();}; +void() army_cdie11 =[ $deathc11, army_cdie11 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() army_die = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "soldier/death1.wav", 1, ATTN_NORM); + if (random() < 0.5) army_die1 (); // Forward + else army_cdie1 (); // Backward/side + } +}; + +/*====================================================================== +/*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_army = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_soldier.mdl"; + self.headmdl = "progs/ad171/h_soldier.mdl"; + self.gib1mdl = "progs/ad171/w_soldiergun.mdl"; // Unique weapon + self.gib2mdl = "progs/ad171/gib_soldfoot1.mdl"; // Upright foot + self.gib3mdl = "progs/ad171/gib_soldfoot2.mdl"; // Fallen down foot + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.gib1sound = GIB_IMPACT_WOOD; + if (random() < 0.5) self.gib1skin = 1; // Bloody weapon + if (random() < 0.5) self.gib2mdl = string_null; + if (random() < 0.5) self.gib3mdl = string_null; + + self.idle_sound = "soldier/idle.wav"; + precache_sound (self.idle_sound); + + precache_sound ("soldier/death1.wav"); + self.pain_sound = "soldier/pain1.wav"; + self.pain_sound2 = "soldier/pain2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("player/udeath.wav"); // gib death + + self.sight_sound = "soldier/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 30; + self.gibhealth = -35; // Easy to gib + self.gibbed = FALSE; // Still together + self.pain_flinch = 20; // Easy to pain + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.steptype = FS_TYPEMEDIUM; // Average feet + self.attack_offset = '12 8 12'; // End of Gun + if (self.deathstring == "") self.deathstring = " was shot by a Grunt\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SoldierCheckAttack; + self.th_stand = army_stand1; + self.th_walk = army_walk1; + self.th_run = army_run1; + if (!self.th_missile) self.th_missile = army_atk1; + self.th_pain = army_pain; + self.th_die = army_die; + + if (!self.classtype) { + self.classtype = CT_MONARMY; + if (self.ammo_shells < 1) self.ammo_shells = rint(2 + random()*4); + precache_sound ("soldier/sattck1.wav"); + // If no skin override is defined, pick a random one instead + if (!self.exactskin) self.randomskin = 4; + } + self.classgroup = CG_ARMY; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +//---------------------------------------------------------------------- +void() monster_army_rocket = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONARMYROCKET; + if (self.health < 1) self.health = 45; + // There are two red jacket skins to pick from + if (random() < 0.5) self.exactskin = 4; + else self.exactskin = 5; + if (random() < 0.35 && self.ammo_rockets < 1) self.ammo_rockets = 1; + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("soldier/rocket_load.wav"); + precache_sound ("soldier/rocket_fire.wav"); + precache_sound ("soldier/rocket_hit.wav"); + + self.th_missile = army_rocket_atk1; + self.th_updmissile = army_rocket_think; // Update flying rocket + self.th_melee = army_runback1; + if (self.deathstring == "") self.deathstring = " was blown up by a Rocketeer\n"; + + monster_army(); +}; + +//---------------------------------------------------------------------- +void() monster_army_grenade = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONARMYGRENADE; + precache_model (MODEL_PROJ_GRENADE); + + if (self.health < 1) self.health = 60; + // There are two green jacket skins to pick from + if (random() < 0.5) self.exactskin = 6; + else self.exactskin = 7; + if (random() < 0.35 && self.ammo_rockets < 1) self.ammo_rockets = 1; + + self.th_missile = army_grenade_atk1; + self.th_melee = army_runback1; + // Grenade bounce off body + self.bouncegrenade = TRUE; + if (self.deathstring == "") self.deathstring = " was pineappled by a Grenadier\n"; + + monster_army(); +}; + +//---------------------------------------------------------------------- +void() monster_army_plasma = +{ + if (deathmatch) { remove(self); return; } + + self.classtype = CT_MONARMYPLASMA; + precache_model (MODEL_PROJ_PLASMA); + + if (self.health < 1) self.health = 75; + // There are two blue jacket skins to pick from + if (random() < 0.5) self.exactskin = 8; + else self.exactskin = 9; + if (random() < 0.35 && self.ammo_cells < 1) self.ammo_cells = 1; + + // Extra load/fire sounds (from Quoth MOD) + precache_sound ("enforcer/elim_pg_load.wav"); + precache_sound (SOUND_PLASMA_FIRE); + precache_sound (SOUND_PLASMA_HIT); + + self.th_missile = army_plasma_atk1; + if (self.deathstring == "") self.deathstring = " was fried by an Electrocutioner\n"; + + monster_army(); +}; diff --git a/QC_other/QC_keep/mon_spider.qc b/QC_other/QC_keep/mon_spider.qc new file mode 100644 index 00000000..3489614d --- /dev/null +++ b/QC_other/QC_keep/mon_spider.qc @@ -0,0 +1,734 @@ +/*============================================================================== +SPIDER (Hexen2 model by Raven Software) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 + +$frame idleup1 idleup2 idleup3 idleup4 idleup5 idleup6 idleup7 idleup8 +$frame idleup9 idleup10 idleup11 idleup12 idleup13 + +$frame drop1 drop2 drop3 drop4 drop5 drop6 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +// Lift spider up on to back legs +$frame atkup1 atkup2 atkup3 atkup4 atkup5 atkup6 atkup7 atkup8 +$frame atkup9 atkup10 atkup11 atkup12 + +// Forward attacking (looping) +$frame atkloop1 atkloop2 atkloop3 atkloop4 atkloop5 atkloop6 atkloop7 atkloop8 +$frame atkloop9 atkloop10 + +// Jumping up +$frame jump1 jump2 jump3 jump4 jump5 jump6 jump7 jump8 +$frame jump9 jump10 jump11 jump12 jump13 jump14 jump15 jump16 + +// on all legs (pain backwards) +$frame paindown1 paindown2 paindown3 paindown4 paindown5 paindown6 paindown7 paindown8 +$frame paindown9 paindown10 + +// On back legs (pain backwards) +$frame painup1 painup2 painup3 painup4 painup5 painup6 painup7 painup8 + +// roll over death on back (looks odd) +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 death16 +$frame death17 death18 death19 death20 + +//====================================================================== +void() spider_idle1 =[ $idle1, spider_idle2 ] {monster_idle_sound();ai_stand();}; +void() spider_idle2 =[ $idle2, spider_idle3 ] {ai_stand();}; +void() spider_idle3 =[ $idle3, spider_idle4 ] {ai_stand();}; +void() spider_idle4 =[ $idle4, spider_idle5 ] {ai_stand();}; +void() spider_idle5 =[ $idle5, spider_idle6 ] {ai_stand();}; +void() spider_idle6 =[ $idle6, spider_idle7 ] {ai_stand();}; +void() spider_idle7 =[ $idle7, spider_idle8 ] {ai_stand();}; +void() spider_idle8 =[ $idle8, spider_idle9 ] {ai_stand();}; +void() spider_idle9 =[ $idle9, spider_idle10 ] {ai_stand();}; +void() spider_idle10 =[ $idle10, spider_idle11 ] {ai_stand();}; +void() spider_idle11 =[ $idle11, spider_idle12 ] {ai_stand();}; +void() spider_idle12 =[ $idle12, spider_idle13 ] {ai_stand();}; +void() spider_idle13 =[ $idle13, spider_idle1 ] {ai_stand();}; + +//====================================================================== +void() spider_walk1 =[ $walk1, spider_walk2 ] {monster_idle_sound();ai_walk(4);}; +void() spider_walk2 =[ $walk3, spider_walk3 ] {monster_footstep(FALSE); ai_walk(3);}; +void() spider_walk3 =[ $walk5, spider_walk4 ] {ai_walk(4);}; +void() spider_walk4 =[ $walk7, spider_walk5 ] {ai_walk(5);}; +void() spider_walk5 =[ $walk9, spider_walk6 ] {ai_walk(4);}; +void() spider_walk6 =[ $walk11, spider_walk7 ] {monster_footstep(FALSE); ai_walk(3);}; +void() spider_walk7 =[ $walk13, spider_walk8 ] {ai_walk(4);}; +void() spider_walk8 =[ $walk15, spider_walk1 ] {ai_walk(5);}; + +//====================================================================== +void() spider_runpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + if (self.jump_flag < time) self.th_run(); + // Is the enemy too close? no more pausing, fight! + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_RUNPAUSE) self.th_run(); +}; + +//---------------------------------------------------------------------- +void() spider_runp1 =[ $idle1, spider_runp2 ] {spider_runpause();}; +void() spider_runp2 =[ $idle2, spider_runp3 ] {spider_runpause();}; +void() spider_runp3 =[ $idle3, spider_runp4 ] {spider_runpause();}; +void() spider_runp4 =[ $idle4, spider_runp5 ] {spider_runpause();}; +void() spider_runp5 =[ $idle5, spider_runp6 ] {spider_runpause();}; +void() spider_runp6 =[ $idle6, spider_runp7 ] {spider_runpause();}; +void() spider_runp7 =[ $idle7, spider_runp8 ] {spider_runpause();}; +void() spider_runp8 =[ $idle8, spider_runp9 ] {spider_runpause();}; +void() spider_runp9 =[ $idle9, spider_runp10 ] {spider_runpause();}; +void() spider_runp10 =[ $idle10,spider_runp11 ] {spider_runpause();}; +void() spider_runp11 =[ $idle11,spider_runp12 ] {spider_runpause();}; +void() spider_runp12 =[ $idle12,spider_runp13 ] {spider_runpause();}; +void() spider_runp13 =[ $idle13,spider_runp1 ] {spider_runpause();}; + +//---------------------------------------------------------------------- +void(float dist) spider_checkpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + // make spider run in bursts of speed (reset every run animation cycle) + self.movespeed = self.movespeed + 1; + // Do run code to check for enemies + ai_run(dist + self.movespeed); + + // Check if target is too close? + if (self.enemydist < MONAI_RUNPAUSE) return; + // Random chance to stop and pause running + if (self.movespeed > 7 && random() < 0.2) { + self.jump_flag = time + random(); + self.think = spider_runp1; + } +}; + +//---------------------------------------------------------------------- +void() spider_run1 =[ $walk1, spider_run2 ] {self.movespeed = 0; monster_idle_sound();spider_checkpause(8);}; +void() spider_run2 =[ $walk3, spider_run3 ] {monster_footstep(FALSE); spider_checkpause(6);}; +void() spider_run3 =[ $walk5, spider_run4 ] {spider_checkpause(8);}; +void() spider_run4 =[ $walk7, spider_run5 ] {spider_checkpause(10);}; +void() spider_run5 =[ $walk9, spider_run6 ] {spider_checkpause(8);}; +void() spider_run6 =[ $walk11, spider_run7 ] {monster_footstep(FALSE); spider_checkpause(6);}; +void() spider_run7 =[ $walk13, spider_run8 ] {spider_checkpause(8);}; +void() spider_run8 =[ $walk15, spider_run1 ] {spider_checkpause(10);}; + +//====================================================================== +void() spider_slide1 =[ $walk1, spider_slide2 ] {ai_run_slide(6); monster_idle_sound();}; +void() spider_slide2 =[ $walk3, spider_slide3 ] {ai_run_slide(4);}; +void() spider_slide3 =[ $walk5, spider_slide4 ] {ai_run_slide(6);}; +void() spider_slide4 =[ $walk7, spider_slide5 ] {ai_run_slide(4);}; +void() spider_slide5 =[ $walk9, spider_slide6 ] {ai_run_slide(6);}; +void() spider_slide6 =[ $walk11, spider_slide7 ] {ai_run_slide(4);}; +void() spider_slide7 =[ $walk13, spider_slide8 ] {ai_run_slide(6);}; +void() spider_slide8 =[ $walk15, spider_run1 ] {ai_run(4);}; + +//====================================================================== +// SPIDER 2 - ACID SPIT FUNCTIONS (range) +//====================================================================== +void(float sideang) spider_spitacid = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "spider/hiss2.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire spit in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_SPIDER; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_SPID); +}; + +//---------------------------------------------------------------------- +void() spider_spit1 =[ $atkup1, spider_spit2 ] {ai_face();}; +void() spider_spit2 =[ $atkup5, spider_spit3 ] {ai_face();}; +void() spider_spit3 =[ $atkup7, spider_spit4 ] {ai_face();}; +void() spider_spit4 =[ $atkup9, spider_spit5 ] {ai_face();}; +void() spider_spit5 =[ $atkup11, spider_spit6 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_SPIDER); }; +void() spider_spit6 =[ $atkloop1, spider_spit7 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SPIDER); }; +void() spider_spit7 =[ $atkloop3, spider_spit8 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SPIDER); }; +void() spider_spit8 = [ $atkloop5, spider_spit9 ] {spider_spitacid(-0.1);}; +void() spider_spit9 = [ $atkloop7, spider_spit10 ] {spider_spitacid(0);}; +void() spider_spit10 =[ $atkloop9, spider_spit11 ] {spider_spitacid(0.1);}; +void() spider_spit11 =[ $atkup7, spider_spit12] {}; +void() spider_spit12 =[ $atkup5, spider_run1 ] {}; + +//====================================================================== +// BITE - Both spider types can bite if within range +//====================================================================== +void() spider_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESPIDER)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_WEAPON, "spider/attackmunch.wav", TRUE, TRUE); + else sound(self, CHAN_WEAPON, "spider/attacktear.wav", TRUE, TRUE); + + // Spider bite is very weak + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Check for poisonous attribute (generally green spider) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // Spawn blood at mouth of spider + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() spider_bite1 =[ $atkup1, spider_bite2 ] {ai_face();}; +void() spider_bite2 =[ $atkup5, spider_bite3 ] {ai_face();}; +void() spider_bite3 =[ $atkup7, spider_bite4 ] {ai_face();}; +void() spider_bite4 =[ $atkup9, spider_bite5 ] {ai_face();}; +void() spider_bite5 =[ $atkup11, spider_bite6 ] {ai_face();}; +// Start bite attack loop +void() spider_bite6 =[ $atkloop1, spider_bite7 ] {ai_face();}; +void() spider_bite7 =[ $atkloop3, spider_bite8 ] {ai_face();}; +void() spider_bite8 = [ $atkloop5, spider_bite9 ] {spider_melee();}; +void() spider_bite9 = [ $atkloop7, spider_bite10 ] {}; +void() spider_bite10 =[ $atkloop9, spider_bite11 ] { + if (ai_checkmelee(MONAI_MELEESPIDER) && self.enemy.health > 0) self.think = spider_bite6;}; +// Exit bite attack loop +void() spider_bite11 =[ $atkup7, spider_bite12] {}; +void() spider_bite12 =[ $atkup5, spider_run1 ] {}; + +//============================================================================ +// SPIDER 1 - JUMP FUNCTION (range) +//============================================================================ +void() Spider_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other spiders with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self.enemy, self.enemy, ldmg*3); + } + } + + // Is the spider floating in the air? + if (!checkbottom(self)) { + // Is the spider standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() spider_leap1 =[ $jump1, spider_leap2 ] { ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + monster_idle_sound(); +}; +void() spider_leap2 =[ $jump3, spider_leap3 ] {ai_face();}; +void() spider_leap3 =[ $jump5, spider_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = Spider_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPSPIDERDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; +void() spider_leap4 =[ $jump7, spider_leap5 ] {}; +void() spider_leap5 =[ $jump8, spider_leap6 ] {}; +void() spider_leap6 =[ $jump9, spider_leap7 ] {}; +void() spider_leap7 =[ $jump10, spider_leap8 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = spider_leap3; + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() spider_leap8 =[ $jump11, spider_leap9 ] {monster_footstep(FALSE);}; +void() spider_leap9 =[ $jump13, spider_leap10] {monster_footstep(FALSE);}; +void() spider_leap10=[ $jump15, spider_run1 ] {ai_resetangles();}; + +//====================================================================== +// CEILING SPIDERS - Idle/Drop/Touch/Land functions +//====================================================================== +void() spider_idleup1 =[ $idleup1, spider_idleup2 ] {monster_idle_sound();ai_stand();}; +void() spider_idleup2 =[ $idleup2, spider_idleup3 ] {ai_stand();}; +void() spider_idleup3 =[ $idleup3, spider_idleup4 ] {ai_stand();}; +void() spider_idleup4 =[ $idleup4, spider_idleup5 ] {ai_stand();}; +void() spider_idleup5 =[ $idleup5, spider_idleup6 ] {ai_stand();}; +void() spider_idleup6 =[ $idleup6, spider_idleup7 ] {ai_stand();}; +void() spider_idleup7 =[ $idleup7, spider_idleup8 ] {ai_stand();}; +void() spider_idleup8 =[ $idleup8, spider_idleup9 ] {ai_stand();}; +void() spider_idleup9 =[ $idleup9, spider_idleup10 ] {ai_stand();}; +void() spider_idleup10 =[ $idleup10, spider_idleup11 ] {ai_stand();}; +void() spider_idleup11 =[ $idleup11, spider_idleup12 ] {ai_stand();}; +void() spider_idleup12 =[ $idleup12, spider_idleup13 ] {ai_stand();}; +void() spider_idleup13 =[ $idleup13, spider_idleup1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() spider_droptouch = +{ + // Check if landed on something that is not the ground? + if (!checkbottom(self)) { + // Is the spider standing on something? + if (self.flags & FL_ONGROUND) { + self.flags = self.flags - FL_ONGROUND; + self.origin_z = self.origin_z + 8; + setorigin(self, self.origin); // raise up + self.attack_timer = time + 1; // reset timer + + makevectors (self.angles); + self.velocity = v_forward * 100 + '0 0 200'; + } + return; + } + + // No more flying, back to running + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setsize(self, self.bbmins, self.bbmaxs); + self.view_ofs = '0 0 24'; // Restore view offset + + self.touch = SUB_Null; // No more jump touching + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + + // Restore all think state functions (spider is off the ceiling) + self.th_stand = spider_idle1; + self.th_walk = spider_walk1; + self.th_run = spider_run1; + self.th_slide = spider_slide1; + self.th_melee = spider_bite1; + + // Spider 1 and 2 have different range attacks + if (self.spawnflags & MON_SPIDER_LARGE) self.th_missile = spider_spit1; + else self.th_jump = spider_leap1; + + // Back to running or standing around! + if (!self.enemy) self.think = self.th_stand; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() spider_drop1 =[ $drop1, spider_drop2 ] {}; +void() spider_drop2 =[ $drop2, spider_drop3 ] {}; +void() spider_drop3 =[ $drop3, spider_drop4 ] {}; +void() spider_drop4 =[ $drop4, spider_drop5 ] {}; +void() spider_drop5 =[ $drop5, spider_drop6 ] {}; +void() spider_drop6 =[ $drop6, spider_drop6 ] { + if (self.attack_timer < time || self.velocity_z == 0) spider_droptouch(); +}; + +//---------------------------------------------------------------------------- +void() spider_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // Only call wakeup function once + self.th_walk = self.th_run = self.th_slide = SUB_Null; + + // No longer need cling to ceiling spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SPIDER_CEILING); + + self.flags = FL_MONSTER; // reset flags + + if (engine == ENG_FITZ) self.origin_z = self.origin_z - 8; + else self.origin_z = self.origin_z - 32; // Unstick from ceiling + setorigin(self, self.origin); // Move down slightly + + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.solid = SOLID_SLIDEBOX; + self.attack_timer = time + 1; // Stuck timer + + self.classmove = MON_MOVEWALK; // Back to walking/running + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + + makevectors (self.angles); // Move towards face direction + self.velocity = v_forward * 50; // Slight nudge forward + + self.touch = spider_droptouch; // Touch something? + if (!self.jump_flag) + self.jump_flag = time + 1 + random()*2; // Don't jump straight away + spider_drop1(); // Turn around, cat tricks! +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() spider_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() spider_grow1 = [ $grow1, spider_grow2 ] {}; +void() spider_grow2 = [ $grow2, spider_grow3 ] {spider_growangle();}; +void() spider_grow3 = [ $grow3, spider_grow4 ] {spider_growangle();}; +void() spider_grow4 = [ $grow4, spider_grow5 ] {spider_growangle();}; +void() spider_grow5 = [ $grow5, spider_grow6 ] {spider_growangle();}; +void() spider_grow6 = [ $grow6, spider_grow7 ] {spider_growangle();}; +void() spider_grow7 = [ $grow7, spider_grow8 ] {spider_growangle();}; +void() spider_grow8 = [ $grow8, spider_grow9 ] {spider_growangle();}; +void() spider_grow9 = [ $grow9, spider_grow10] {spider_growangle();}; +void() spider_grow10= [ $grow10, spider_run1 ] { + // Is the spider stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = spider_idle1; + self.th_walk = spider_walk1; + self.th_run = spider_run1; + self.th_slide = spider_slide1; + self.th_melee = spider_bite1; + // Spider 1 and 2 have different range attacks + if (self.spawnflags & MON_SPIDER_LARGE) self.th_missile = spider_spit1; + else { + self.th_jump = spider_leap1; + self.th_jumpexit = spider_leap9; + } + } +}; + +//---------------------------------------------------------------------------- +void() spider_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + spider_grow1(); +}; + +//============================================================================ +void() spider_paind1 =[ $paindown1, spider_paind2 ] {}; +void() spider_paind2 =[ $paindown3, spider_paind3 ] {}; +void() spider_paind3 =[ $paindown5, spider_paind4 ] {}; +void() spider_paind4 =[ $paindown7, spider_paind5 ] {}; +void() spider_paind5 =[ $paindown9, spider_run1 ] {}; + +//---------------------------------------------------------------------------- +// Front legs up (in melee or missile attack) +void() spider_painu1 =[ $painup1, spider_painu2 ] {}; +void() spider_painu2 =[ $painup3, spider_painu3 ] {}; +void() spider_painu3 =[ $painup5, spider_painu4 ] {}; +void() spider_painu4 =[ $painup6, spider_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) spider_pain = +{ + // Has the spider been hit while on the ceiling? + if (self.spawnflags & MON_SPIDER_CEILING) { + self.pain_finished = time + 1; + spider_wakeup(); + return; + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1 || self.pain_check == 2) { + if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.4; + self.axhitme = 0; + } + // Different types of pain animations based on current attack + if ( self.frame > $atkup8 && self.frame < $atkloop10 ) spider_painu1(); + else spider_paind1(); + } + } +}; + +//============================================================================ +void() spider_die1 =[ $death1, spider_die2 ] {}; +void() spider_die2 =[ $death3, spider_die3 ] {monster_check_gib();}; +void() spider_die3 =[ $death5, spider_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() spider_die4 =[ $death7, spider_die5 ] {}; +void() spider_die5 =[ $death9, spider_die6 ] {}; +void() spider_die6 =[ $death11, spider_die7 ] {}; +void() spider_die7 =[ $death13, spider_die8 ] {}; +void() spider_die8 =[ $death15, spider_die9 ] {}; +void() spider_die9 =[ $death17, spider_die10] {monster_death_postcheck();}; +void() spider_die10 =[ $death19, spider_die10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() spider_die = +{ + // Spiders are small, gibs don't bounce far + self.max_health = MON_NOGIBVELOCITY; + + // Has the spider died while on the ceiling? + if (self.spawnflags & MON_SPIDER_CEILING) + self.gibondeath = TRUE; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "spider/death1.wav", 1, ATTN_NORM); + spider_die1(); + } +}; + +/*====================================================================== +/*QUAKED monster_spider (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() setup_spider; +void() monster_spider = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_SPIDER_LARGE) { + self.mdl = "progs/ad171/mon_spiderg.mdl"; + self.headmdl = "progs/ad171/h_spiderg.mdl"; // Front Jaws + self.gib1mdl = "progs/ad171/gib_spidlegg.mdl"; // Single Leg + self.gib2mdl = "progs/ad171/gib_spidbodyg.mdl"; // Back Body + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (MODEL_PROJ_SPID); // Spit Projectile + } + if (!(self.spawnflags & MON_SPIDER_LARGE) || + self.classtype == CT_CACHESPIDER) { + self.mdl = "progs/ad171/mon_spiderb.mdl"; + self.headmdl = "progs/ad171/h_spiderb.mdl"; // Front Jaws + self.gib1mdl = "progs/ad171/gib_spidlegb.mdl"; // Single Leg + self.gib2mdl = "progs/ad171/gib_spidbodyb.mdl"; // Back Body + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + } + + // Head/Body and Special GIB models + self.gib1frame = 9; + + // IDLE/COMBAT and SIGHT sounds + self.idle_sound = "spider/idle1.wav"; + self.idle_sound2 = "spider/hiss2.wav"; + self.idle_soundcom = "spider/idle1.wav"; + self.idle_soundcom2 = "spider/hiss3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + + // death/pain/attack sounds + precache_sound("spider/death1.wav"); + self.pain_sound = "spider/pain1.wav"; + self.pain_sound2 = "spider/pain2.wav"; + precache_sound(self.pain_sound); + precache_sound(self.pain_sound2); + + precache_sound("spider/miss.wav"); + precache_sound("spider/attackmunch.wav"); + precache_sound("spider/attacktear.wav"); + precache_sound("spider/jumpland.wav"); + + self.sight_sound = "spider/hiss1.wav"; + precache_sound (self.sight_sound); + + // Cache spider is a special class sed for precache only + if (self.classtype != CT_CACHESPIDER) setup_spider(); +}; + +//---------------------------------------------------------------------------- +void() monster_wraithminion = { + self.classtype = CT_CACHESPIDER; + self.spawnflags = MON_SPIDER_LARGE; // Precache both spiders + monster_spider(); +}; + +//---------------------------------------------------------------------------- +void() setup_spider = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.steptype = FS_TYPELIGHT; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '24 0 20'; // Bite attack offset + self.attack_offset = '14 0 8'; // Used by green spider, at jaws + + self.movespeed = 1; // Can never be a turret + if (self.deathstring == "") self.deathstring = " was bitten by a Spider\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SpiderCheckAttack; + self.th_pain = spider_pain; + self.th_die = spider_die; + + if(!self.classtype) self.classtype = CT_MONSPIDER; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + // Setup green/brown spider difference + if (self.spawnflags & MON_SPIDER_LARGE) { + if (self.health < 1) self.health = 75; + self.gibhealth = -25; + if (self.poisonous < 0) self.poisonous = FALSE; + else self.poisonous = TRUE; + self.th_missile = spider_spit1; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = spider_leap1; + self.th_jumpexit = spider_leap9; + } + + //---------------------------------------------------------------------- + // Ceiling spiders have special idle animation (rotated) + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SPIDER_CEILING) { + self.th_stand = self.th_walk = spider_idleup1; + self.th_run = self.th_slide = spider_wakeup; + self.th_melee = self.th_missile = self.th_jump = spider_wakeup; + // th_pain and th_die functions understand ceiling spiders + } + // Special spawning minion need to start spinning + else if (self.classtype == CT_MINIONSPIDER) { + self.th_stand = self.th_walk = self.th_run = spider_grow; + self.th_melee = self.th_slide = SUB_Null; + self.th_missile = self.th_jump = SUB_Null; + } + // Default spider behaviour functions + else { + self.th_stand = spider_idle1; + self.th_walk = spider_walk1; + self.th_run = spider_run1; + self.th_melee = spider_bite1; + self.th_slide = spider_slide1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn spiders (requires monster_spiderspawn entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_spider = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + update_minioncount(self.owner, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_spider"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self.owner; // Spawner Parent Link + self.owner = minion; // Stop gibs interacting with minion + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONSPIDER; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + if (random() < 0.2) minion.spawnflags = MON_SPIDER_LARGE; + else minion.spawnflags = 0; + + if (minion.spawnflags & MON_SPIDER_LARGE) { + minion.mdl = "progs/ad171/mon_spiderg.mdl"; + minion.headmdl = "progs/ad171/h_spiderg.mdl"; // Front Jaws + minion.gib1mdl = "progs/ad171/gib_spidlegg.mdl"; // Single Leg + minion.gib2mdl = "progs/ad171/gib_spidbodyg.mdl"; // Back Body + } + else { + minion.mdl = "progs/ad171/mon_spiderb.mdl"; + minion.headmdl = "progs/ad171/h_spiderb.mdl"; // Front Jaws + minion.gib1mdl = "progs/ad171/gib_spidlegb.mdl"; // Single Leg + minion.gib2mdl = "progs/ad171/gib_spidbodyb.mdl"; // Back Body + } + + minion.gib1frame = 9; + minion.idle_sound = "spider/idle1.wav"; + minion.idle_sound2 = "spider/hiss2.wav"; + minion.idle_soundcom = "spider/idle1.wav"; + minion.idle_soundcom2 = "spider/hiss3.wav"; + minion.sight_sound = "spider/hiss1.wav"; + minion.pain_sound = "spider/pain1.wav"; + minion.pain_sound2 = "spider/pain2.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_spider; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_spikemine.qc b/QC_other/QC_keep/mon_spikemine.qc new file mode 100644 index 00000000..0678e412 --- /dev/null +++ b/QC_other/QC_keep/mon_spikemine.qc @@ -0,0 +1,128 @@ +void () spikemine_Home = { + local entity head; + local entity selected; + local float cur_dist; + local float head_dist; + local vector dir; + local vector vtemp; + + self.frame = (self.frame + TRUE); + if ( (self.frame == MOVETYPE_FLYMISSILE) ) + self.frame = FALSE; + + self.nextthink = (time + 0.200); + self.think = spikemine_Home; + if ( (self.search_time < time) ) { + selected = world; + cur_dist = 2000.000; + head = findradius (self.origin,2000.000); + while ( head ) { + if ( (!(head.flags & FL_NOTARGET) && (head.flags & FL_CLIENT)) ) { + visible (head); + if ( (visible (head) && (head.health > FALSE)) ) { + head_dist = vlen ((head.origin - self.origin)); + if ( (head_dist < cur_dist) ) { + selected = head; + cur_dist = head_dist; + } + } + } + head = head.chain; + } + if ( (selected != world) ) + sound (self,CHAN_VOICE,"hipitems/spikmine.wav",TRUE,ATTN_NORM); + + self.enemy = selected; + self.search_time = (time + 1.300); + } + if ( (self.enemy == world) ) { + sound (self,CHAN_VOICE,"misc/null.wav",TRUE,ATTN_NORM); + self.velocity = VEC_ORIGIN; + return ; + } + vtemp = (self.enemy.origin + '0.000 0.000 10.000'); + dir = normalize ((vtemp - self.origin)); + if ( infront (self.enemy) ) { + self.velocity = (dir * ((skill * 50.000) + 50.000)); + } else { + self.velocity = (dir * ((skill * 50.000) + 150)); + } +}; + +void () spikemine_Touch = { + if ( (self.health > FALSE) ) { + if (other.classname == "trap_spike_mine" || other.classname == "monster_spikemine") + return ; + + if (other.classname == "missile") + return ; + + if (other.classname == "grenade") + return ; + + if (other.classname == "hiplaser") + return ; + + if (other.classname == "proximity_grenade") + return ; + + T_Damage (self,self,self,(self.health + MOVETYPE_BOUNCE),DAMARMOR); + } + T_RadiusDamage (self,self,45.000,world,DAMAGEALL); + sound (self,CHAN_WEAPON,"weapons/r_exp3.wav",TRUE,ATTN_NORM); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + sound (self,CHAN_VOICE,"misc/null.wav",TRUE,ATTN_NORM); + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + setmodel (self,"progs/drake/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1 (); +}; + +void () spike_mine_first_think = { + self.think = spikemine_Home; + self.nextthink = (time + 0.100); + self.search_time = FALSE; + self.takedamage = DAMAGE_AIM; + self.use = monster_use; +}; + +void () monster_spikemine = { + if ( deathmatch ) { remove (self); return ; } + + precache_model ("progs/hipnotic/mon_spikmine.mdl"); + precache_sound ("weapons/r_exp3.wav"); + precache_sound ("hipitems/spikmine.wav"); + precache_sound ("misc/null.wav"); + setmodel (self,"progs/hipnotic/mon_spikmine.mdl"); + setsize (self,'-16 -16 -24', '16 16 16'); //MonTiny + self.classname = "trap_spike_mine"; + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_FLYMISSILE; + self.avelocity = '-50.000 100.000 150.000'; + if (self.health < 1) self.health = 200; + self.frame = FALSE; + self.think = spike_mine_first_think; + self.touch = spikemine_Touch; + self.th_die = spikemine_Touch; + self.th_stand = spikemine_Home; + self.th_walk = spikemine_Home; + self.th_run = spikemine_Home; + self.th_melee = spikemine_Home; + self.th_missile = spikemine_Home; + self.nextthink = (time + 0.200); + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + if (self.deathstring == "") self.deathstring = " was obliterated by a Spikemine\n"; + total_monsters = (total_monsters + TRUE); + self.flags = (self.flags | FL_MONSTER); + //self.deathtype = "was blasted by a spike mine"; +}; + +void () trap_spike_mine = { + if (self.deathstring == "") self.deathstring = " was obliterated by a Spikemine\n"; + monster_spikemine(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_srvomech.qc b/QC_other/QC_keep/mon_srvomech.qc new file mode 100644 index 00000000..acc1360f --- /dev/null +++ b/QC_other/QC_keep/mon_srvomech.qc @@ -0,0 +1,1365 @@ +/* +============================================================================== + +SERVOMECH, MONSTER +by Carl Glave (General WarT) +============================================================================== +*/ + +// the servomech lasers +void(vector src, vector dir, float lsrdamage) FireLaser = +{ + local vector vel, org; + local vector src; + + traceline (src, src + dir*2048, FALSE, self); + + + org = trace_endpos - dir*4; + + if (trace_ent.takedamage && trace_ent != self) + { + vel = normalize(dir + v_up*crandom() + v_right*crandom()); + vel = vel + 2*trace_plane_normal; + vel = vel * 200; + + T_Damage (trace_ent, self, self, lsrdamage); + SpawnBlood (org, vel*0.2, lsrdamage, trace_ent); + } + else if(trace_fraction != 1) + { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + } + + // draw in the laser using the temp entity for a + // Shambler's lightning with a new model + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING1); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, src_x); + WriteCoord (MSG_BROADCAST, src_y); + WriteCoord (MSG_BROADCAST, src_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); +}; + +//======================================================================= + +float(float pitch) servobod_frame = +{return 15 + floor(pitch/5.3333);}; + +float(float pitch) servobod_fireframe = +{return 46 + floor(pitch/5.3333);}; + +float(float pitch) servobod_rightfireframe = +{return 77 + floor(pitch/5.3333);}; + +float(float pitch) servobod_leftfireframe = +{return 108 + floor(pitch/5.3333);}; + +float SERVOBOD_NONE = 0; +float SERVOBOD_BOTH = 1; +float SERVOBOD_RIGHT = 2; +float SERVOBOD_LEFT = 3; + +void() servo_bodthink = +{ + local entity bod, tmpent; + local vector tmpvec; + + bod = self.aiment; + bod.skin = self.skin; // incase of beam weapon + + setorigin(bod, self.origin + self.pos1); + + tmpent = self; + self = bod; + + if(tmpent.enemy) + { + if(visible(tmpent.enemy)) + { +// tmpvec = vectoangles((tmpent.enemy.origin + tmpent.enemy.view_ofs) - (self.origin + '0 0 16')); + tmpvec = vectoangles(tmpent.enemy.origin - (self.origin + '0 0 16')); + self.ideal_yaw = tmpvec_y; + if(tmpvec_x > 180) + { + tmpvec_x = 360 - tmpvec_x; + if(tmpvec_x > 80) + tmpvec_x = 80; + } + else + { + tmpvec_x = tmpvec_x * -1; + if(tmpvec_x < -80) + tmpvec_x = -80; + } + self.search_time = time + 2; + } + else if(self.search_time < time) + { + self.ideal_yaw = tmpent.angles_y; + tmpvec = '0 0 0'; + } + + if(tmpvec_x > self.rotate_type) + { + if(tmpvec_x > (self.rotate_type + 6)) + self.rotate_type = self.rotate_type + 6; + else + self.rotate_type = tmpvec_x; + } + else if(tmpvec_x < self.rotate_type) + { + if(tmpvec_x < (self.rotate_type - 6)) + self.rotate_type = self.rotate_type - 6; + else + self.rotate_type = tmpvec_x; + } + } + else if(self.invisible_time < time || fabs(self.ideal_yaw - tmpent.ideal_yaw) > 35) + { + self.ideal_yaw = tmpent.ideal_yaw + crandom()*35; + self.rotate_type = 0; + self.invisible_time = time + 1 + random()*3; + } + + if(self.attack_state) + { + if(self.attack_state == SERVOBOD_BOTH) + self.frame = servobod_fireframe(self.rotate_type); + else if(self.attack_state == SERVOBOD_RIGHT) + self.frame = servobod_rightfireframe(self.rotate_type); + else if(self.attack_state == SERVOBOD_LEFT) + self.frame = servobod_leftfireframe(self.rotate_type); + self.attack_state = SERVOBOD_NONE; + } + else + self.frame = servobod_frame(self.rotate_type); + + ChangeYaw(); + + self = tmpent; +}; + +//======================================================================= + +void() servo_stand =[ 0, servo_stand] +{ai_stand(); self.pos1 = '0 0 0'; servo_bodthink();}; + +//======================================================================= + +void() servo_walk1 =[ 1, servo_walk2] +{ai_walk(5);self.pos1 = '0 0 11.4'; servo_bodthink();}; +void() servo_walk2 =[ 2, servo_walk3] +{ai_walk(6);self.pos1 = '0 0 11.8'; servo_bodthink();}; +void() servo_walk3 =[ 3, servo_walk4] +{ai_walk(7);self.pos1 = '0 0 11.3'; servo_bodthink();}; +void() servo_walk4 =[ 4, servo_walk5] +{ai_walk(3);self.pos1 = '0 0 9.5'; servo_bodthink();}; +void() servo_walk5 =[ 5, servo_walk6] +{ai_walk(3);self.pos1 = '0 0 8.2'; servo_bodthink();}; +void() servo_walk6 =[ 6, servo_walk7] +{FootFall("mech/mechstep.wav", 0.3, 1, 0.8);ai_walk(2);self.pos1 = '0 0 5.4'; servo_bodthink();}; +void() servo_walk7 =[ 7, servo_walk8] +{ai_walk(3);self.pos1 = '0 0 9.6'; servo_bodthink();}; +void() servo_walk8 =[ 8, servo_walk9] +{ai_walk(6);self.pos1 = '0 0 10.7'; servo_bodthink();}; +void() servo_walk9 =[ 9, servo_walk10] +{ai_walk(5);self.pos1 = '0 0 10.8'; servo_bodthink();}; +void() servo_walk10 =[ 10, servo_walk11] +{ai_walk(4);self.pos1 = '0 0 11.8'; servo_bodthink();}; +void() servo_walk11 =[ 11, servo_walk12] +{ai_walk(7);self.pos1 = '0 0 11.9'; servo_bodthink();}; +void() servo_walk12 =[ 12, servo_walk13] +{ai_walk(7);self.pos1 = '0 0 11.3'; servo_bodthink();}; +void() servo_walk13 =[ 13, servo_walk14] +{ai_walk(3);self.pos1 = '0 0 9.6'; servo_bodthink();}; +void() servo_walk14 =[ 14, servo_walk15] +{ai_walk(3);self.pos1 = '0 0 8.3'; servo_bodthink();}; +void() servo_walk15 =[ 15, servo_walk16] +{FootFall("mech/mechstep.wav", 0.3, 1, 0.8);ai_walk(2);self.pos1 = '0 0 5.8'; servo_bodthink();}; +void() servo_walk16 =[ 16, servo_walk17] +{ai_walk(3);self.pos1 = '0 0 9.6'; servo_bodthink();}; +void() servo_walk17 =[ 17, servo_walk18] +{ai_walk(6);self.pos1 = '0 0 10.7'; servo_bodthink();}; +void() servo_walk18 =[ 18, servo_walk1] +{ai_walk(4);self.pos1 = '0 0 10.8'; servo_bodthink();}; + +//======================================================================= +void() servo_stillrun; + +void() servo_run1 =[ 1, servo_run2] +{ + ai_run(9); + self.pos1 = '0 0 11.4'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run2 =[ 3, servo_run3] +{ + ai_run(13); + self.pos1 = '0 0 11.3'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run3 =[ 5, servo_run4] +{ + ai_run(6); + self.pos1 = '0 0 8.2'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run4 =[ 7, servo_run5] +{ + FootFall("mech/mechstep.wav", 0.3, 1, 1); + ai_run(5); + self.pos1 = '0 0 9.6'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run5 =[ 9, servo_run6] +{ + ai_run(11); + self.pos1 = '0 0 10.8'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run6 =[ 11, servo_run7] +{ + ai_run(11); + self.pos1 = '0 0 11.9'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run7 =[ 13, servo_run8] +{ + ai_run(10); + self.pos1 = '0 0 9.6'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run8 =[ 15, servo_run9] +{ + FootFall("mech/mechstep.wav", 0.3, 1, 1); + ai_run(5); + self.pos1 = '0 0 5.8'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; +void() servo_run9 =[ 17, servo_run1] +{ + ai_run(9); + self.pos1 = '0 0 10.7'; + servo_bodthink(); + if(enemy_range == RANGE_MELEE) + if(enemy_vis) + self.think = servo_stillrun; +}; + +void() servo_stillrun =[ 0, servo_stillrun] +{ + ai_run(0); + self.pos1 = '0 0 0'; + servo_bodthink(); + if(enemy_range != RANGE_MELEE) + self.think = servo_run1; + if(!enemy_vis) + self.think = servo_run1; +}; + +//======================================================================= + +void(entity attacker, float damage) servo_pain= +{ + local float tmpflt; + + if(self.pain_finished < time) + { + self.aiment.rotate_type = self.aiment.rotate_type + crandom() * damage * 0.3; + if(self.aiment.rotate_type < -80) + self.aiment.rotate_type = -80; + else if(self.aiment.rotate_type > 80) + self.aiment.rotate_type = 80; + + servo_bodthink(); + self.pain_finished = time + 1 + random()*2; + } +}; + +//======================================================================= + +void() servo_die1 =[ 0, servo_die2] {self.nextthink = time + 1;}; +void() servo_die2 =[ 1, servo_die3] {}; +void() servo_die3 =[ 2, servo_die4] {}; +void() servo_die4 =[ 3, servo_die5] {}; +void() servo_die5 =[ 4, servo_die6] {}; +void() servo_die6 =[ 5, servo_die7] {}; +void() servo_die7 =[ 6, servo_die8] {}; +void() servo_die8 =[ 7, servo_die9] +{sound (self, CHAN_VOICE, "mech/metal.wav", 1, ATTN_NORM);}; +void() servo_die9 =[ 8, servo_die10] {}; +void() servo_die10 =[ 9, servo_die11] {}; +void() servo_die11 =[ 10, servo_die12] {}; +void() servo_die12 =[ 11, servo_die13] +{sound (self, CHAN_VOICE, "mech/metal.wav", 0.75, ATTN_NORM);}; +void() servo_die13 =[ 12, servo_die14] {}; +void() servo_die14 =[ 13, servo_die15] +{sound (self, CHAN_VOICE, "mech/metal.wav", 0.5, ATTN_NORM);}; +void() servo_die15 =[ 14, servo_die16] {}; +void() servo_die16 =[ 15, servo_die17] +{sound (self, CHAN_VOICE, "mech/metal.wav", 0.25, ATTN_NORM);}; +void() servo_die17 =[ 15, servo_die17] {}; + +void() servo_gibbed1 =[ 16, servo_gibbed2] {self.nextthink = time + 1;}; +void() servo_gibbed2 =[ 17, servo_gibbed3] {}; +void() servo_gibbed3 =[ 18, servo_gibbed4] {}; +void() servo_gibbed4 =[ 19, servo_gibbed5] {}; +void() servo_gibbed5 =[ 20, servo_gibbed6] {}; +void() servo_gibbed6 =[ 21, servo_gibbed7] +{ + local vector tmpvec; + local entity tmpself; + + tmpself = self; + makevectors(self.angles); + tmpvec = self.origin + v_forward*16; + + self = spawn(); + setorigin(self, tmpvec); + BecomeBigExplosion(); + + self = spawn(); + setorigin(self, tmpvec); + self.angles = tmpself.angles; + self.skin = tmpself.skin; + ThrowHead("progs/h_servo.mdl", -100); + self.velocity = v_forward*300 + '0 0 250'; + sound (self, CHAN_VOICE, "drake/misc/shortexp.wav", 1, ATTN_NORM); +}; +void() servo_gibbed7 =[ 22, servo_gibbed8] {}; +void() servo_gibbed8 =[ 23, servo_gibbed9] {}; +void() servo_gibbed9 =[ 24, servo_gibbed10] +{sound (self, CHAN_VOICE, "mech/metal.wav", 0.75, ATTN_NORM);}; +void() servo_gibbed10 =[ 25, servo_gibbed11] {}; +void() servo_gibbed11 =[ 26, servo_gibbed12] {}; +void() servo_gibbed12 =[ 27, servo_gibbed13] {}; +void() servo_gibbed13 =[ 28, servo_gibbed14] {}; +void() servo_gibbed14 =[ 29, servo_gibbed15] {}; +void() servo_gibbed15 =[ 30, servo_gibbed16] {}; +void() servo_gibbed16 =[ 31, servo_gibbed17] {}; +void() servo_gibbed17 =[ 32, servo_gibbed18] {}; +void() servo_gibbed18 =[ 33, servo_gibbed19] {}; +void() servo_gibbed19 =[ 34, servo_gibbed20] +{sound (self, CHAN_VOICE, "mech/metal.wav", 0.5, ATTN_NORM);}; +void() servo_gibbed20 =[ 35, servo_gibbed21] {}; +void() servo_gibbed21 =[ 36, servo_gibbed22] {}; +void() servo_gibbed22 =[ 37, servo_gibbed23] {}; +void() servo_gibbed23 =[ 38, servo_gibbed24] +{sound (self, CHAN_VOICE, "mech/metal.wav", 0.25, ATTN_NORM);}; +void() servo_gibbed24 =[ 38, servo_gibbed24] {}; + +void() servo_die = +{ + self.solid = SOLID_NOT; + sound (self, CHAN_VOICE, "mech/pow_dn.wav", 1, ATTN_NORM); + remove(self.aiment); + setmodel(self, "progs/servodie.mdl"); + +// check for gib + if (self.health < -40 || random() < 0.1) + { + servo_gibbed1(); + return; + } + + servo_die1(); +}; + +//======================================================================= + +void() servo_attack= +{ + local vector dir, org; + + dir = self.enemy.origin - (self.enemy.velocity*0.2 + self.enemy.velocity*0.3*random()); + + org = self.aiment.angles; + org_x = org_x + self.aiment.rotate_type; + makevectors(org); + + org = self.aiment.origin + v_forward*37 + '0 0 16'; + if(self.lefty) + { + dir = normalize (dir - (self.aiment.origin + '0 0 16' - v_right*18)); + org = org - v_right*18; + self.aiment.attack_state = SERVOBOD_LEFT; + } + else + { + dir = normalize (dir - (self.aiment.origin + '0 0 16' + v_right*18)); + org = org + v_right*18; + self.aiment.attack_state = SERVOBOD_RIGHT; + } + self.lefty = 1 - self.lefty; + + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + FireLaser(org, dir, 2); +}; + +void() servo_vollyattack= +{ + servo_attack(); + servo_attack(); + self.aiment.attack_state = SERVOBOD_BOTH; +}; + +//======================================================================= + +float(entity targ) ServoInfront= +{ + local vector vec; + local float dot; + + vec = self.aiment.angles; + vec_x = vec_x + self.aiment.rotate_type; + makevectors (vec); + vec = normalize (targ.origin - self.aiment.origin); + dot = vec * v_forward; + + if ( dot > 0.7) + { + return TRUE; + } + return FALSE; +}; + +float() ServomechCheckAttack= +{ + local vector spot1, spot2; + local entity targ; + local float chance; + + targ = self.enemy; + + if(!ServoInfront(self.enemy)) + return FALSE; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, FALSE, self); + + if (trace_ent != targ) + return FALSE; // don't have a clear shot + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (time < self.attack_finished) + return FALSE; + + if (enemy_range == RANGE_MELEE) + { + self.th_missile (); + SUB_AttackFinished (0.2); + return TRUE; + } + + if (enemy_range == RANGE_FAR) + chance = 0.05; + else if (enemy_range == RANGE_NEAR) + chance = 0.3; + else if (enemy_range == RANGE_MID) + chance = 0.15; + else + return FALSE; + + if (random () < chance) + { + self.th_missile (); + SUB_AttackFinished (0.2); + return TRUE; + } + + return FALSE; +}; + +//======================================================================= + +void() monster_servomech = +{ + local entity bodent; + + if (deathmatch) + { + remove(self); + return; + } + + precache_model ("progs/servobod.mdl"); + precache_model ("progs/servoleg.mdl"); + precache_model ("progs/servodie.mdl"); + precache_model ("progs/h_servo.mdl"); + + precache_sound ("mech/mechstep.wav"); + precache_sound ("mech/pow_up.wav"); + precache_sound ("mech/pow_dn.wav"); + precache_sound ("mech/metal.wav"); + precache_sound ("drake/misc/shortexp.wav"); + precache_sound ("enforcer/enfire.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/servoleg.mdl"); + + setsize (self, '-32 -32 -48', '32 32 28'); + self.health = 500; + self.pos1 = '0 0 0'; + self.yaw_speed = 30; + self.view_ofs = '0 0 12'; + if(!self.skin) + self.skin = 1; + + self.th_stand = servo_stand; + self.th_walk = servo_walk1; + self.th_run = servo_run1; + self.th_die = servo_die; + self.th_melee = servo_vollyattack; + self.th_missile = servo_attack; + self.th_pain = servo_pain; + + +// ### Added for Custents all affecting gravity + if(!self.gravity) + self.gravity = 1; + else + self.gravity = ((self.gravity - 1) / 100); +// ### + + // setup upper body entity + bodent = spawn(); + bodent.solid = SOLID_NOT; + bodent.movetype = MOVETYPE_NONE; + setmodel (bodent, "progs/servobod.mdl"); + setorigin(bodent, self.origin); + bodent.angles = self.angles; + bodent.yaw_speed = 10; + bodent.rotate_type = 0; + bodent.skin = self.skin; + self.aiment = bodent; + + walkmonster_start(); +}; + + +/* +============================================================================== + +SERVOMECH, CONTROLLABLE + +============================================================================== +*/ + +void(entity targent) cservo_control_on= +{ + local entity targcam; + + targcam = self.movetarget; + + targent.rcam = targcam; + targcam.owner = targent; + targent.weaponmodel = "progs/frame.mdl"; + + dummy_setup(targent,self.walkframe, self.invincible_finished); + + msg_entity = targent; + WriteByte (MSG_ONE, SVC_SETVIEWANGLES); + WriteAngle( MSG_ONE, self.aiment.angles_x); + WriteAngle( MSG_ONE, self.aiment.angles_y); + WriteAngle( MSG_ONE, self.aiment.angles_z); + stuffcmd(targent, "exec mech.cfg\n"); + stuffcmd(targent, "wait\n"); + targent.camofs = '0 160 40'; + sprint(targent, "Press F7 to Toggle the Apoc Cam\n"); + + sound (self, CHAN_VOICE, "mech/pow_up.wav", 1, ATTN_NORM); +}; + +void(entity targent) cservo_control_off= +{ + local entity targcam, tmpent; + + targcam = self.movetarget; + + dummy_remove(targent); + + targent.rcam = world; + targcam.owner = world; + + targent.camofs = '0 64 30'; + if(targent.cament) + { + msg_entity = targent; + WriteByte (MSG_ONE, SVC_SETVIEWPORT); + WriteEntity (MSG_ONE, targent.cament); + stuffcmd(targent, "cl_bob 0; wait\n"); + } + else + { + tmpent = self; + self = targent; + W_SetCurrentAmmo(); + self = tmpent; + } + + stuffcmd(targent, "exec config.cfg\n"); + stuffcmd(targent, "wait\n"); + stuffcmd(targent, "exec autoexec.cfg\n"); + stuffcmd(targent, "wait\n"); +}; + +//======================================================================= + +void() cservo_attack; +void() cservo_stand; +void() cservo_think= +{ + local entity contplyr, temp; + + contplyr = self.movetarget.owner; + if(contplyr) + { + if(contplyr.deadflag != DEAD_NO) + cservo_control_off(contplyr); + else if(contplyr.rcam != self.movetarget) + { + self.movetarget.owner = world; + self.style = 0; + cservo_stand(); + } + // this is done to make Quake use the proper VIS information for the view + else + { + setorigin(contplyr, self.movetarget.origin); + // check is external camera adjustment is needed + if(contplyr.cament) + { + temp = self; + self = contplyr; + Cam_position(); + self = temp; + } + } + } + + if (self.flags & FL_GODMODE) + { + if (!(contplyr.flags & FL_GODMODE)) + self.flags = self.flags - FL_GODMODE; + } + else if (contplyr.flags & FL_GODMODE) + self.flags = self.flags | FL_GODMODE; + + if(self.attack_state) + { + cservo_attack(); + self.attack_state = 0; + } +}; + +//======================================================================= + +void() cservo_attack= +{ + if(self.attack_finished > time) + return; + local vector dir, org, fireang, targ; + + fireang = self.aiment.angles; + fireang_x = self.aiment.rotate_type; // scale down a bit for proper alignment + makevectors(fireang); + + org = self.aiment.origin + v_forward*38 + v_up*17; + + if(self.lefty) + { + traceline(org - v_forward*16 - v_right*8, org + v_forward*2048 - v_right*8, FALSE, self.aiment); + targ = trace_endpos; + org = org - v_right*18; + self.aiment.attack_state = SERVOBOD_LEFT; + self.aiment.frame = servobod_leftfireframe(self.aiment.rotate_type); + } + else + { + traceline(org - v_forward*16 + v_right*8, org + v_forward*2048 + v_right*8, FALSE, self.aiment); + targ = trace_endpos; + org = org + v_right*18; + self.aiment.attack_state = SERVOBOD_RIGHT; + self.aiment.frame = servobod_rightfireframe(self.aiment.rotate_type); + } + self.lefty = 1 - self.lefty; + + dir = normalize(targ - org); + FireLaser(org, dir, 4); + + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + + self.attack_finished = time + 0.15; + self.movetarget.owner.attack_finished = time + 1; + self.show_hostile = time + 1; +}; + +//======================================================================= + +void() cservo_bodthink = +{ + local entity bod, tmpent, contplyr; + local vector tmpvec, viewang; + + bod = self.aiment; + bod.skin = self.skin; + + droptofloor(); + + setorigin(bod, self.origin + self.pos1); + + tmpent = self; + self = bod; + contplyr = self.movetarget.owner; + + if(contplyr) + { + tmpvec = contplyr.v_angle; + self.ideal_yaw = tmpvec_y; + if(tmpvec_x > self.rotate_type) + { + if(tmpvec_x > (self.rotate_type + 6)) + self.rotate_type = self.rotate_type + 6; + else + self.rotate_type = tmpvec_x; + } + else if(tmpvec_x < self.rotate_type) + { + if(tmpvec_x < (self.rotate_type - 6)) + self.rotate_type = self.rotate_type - 6; + else + self.rotate_type = tmpvec_x; + } + } + + if(self.attack_state) + { + if(self.attack_state == SERVOBOD_BOTH) + self.frame = servobod_fireframe(self.rotate_type); + else if(self.attack_state == SERVOBOD_RIGHT) + self.frame = servobod_rightfireframe(self.rotate_type); + else if(self.attack_state == SERVOBOD_LEFT) + self.frame = servobod_leftfireframe(self.rotate_type); + self.attack_state = SERVOBOD_NONE; + } + else + self.frame = servobod_frame(self.rotate_type); + + ChangeYaw(); + + // position the cockpit and camera + tmpvec = self.angles; + tmpvec_x = self.rotate_type; + self.movetarget.angles = tmpvec; + self.movetarget.angles_x = self.movetarget.angles_x * -1; + makevectors(tmpvec); + tmpvec = self.origin + v_forward*5 + v_up*16; + setorigin(self.movetarget, tmpvec); + + self = tmpent; +}; + +//======================================================================= + +void() cservo_stand =[ 0, cservo_stand] +{self.pos1 = '0 0 0'; cservo_bodthink();cservo_think();}; + +void() cservo_run1 =[ 1, cservo_run2] +{walkmove(self.ideal_yaw, 9);self.pos1 = '0 0 11.4';cservo_bodthink();cservo_think();}; +void() cservo_run2 =[ 3, cservo_run3] +{walkmove(self.ideal_yaw, 13);self.pos1 = '0 0 11.3';cservo_bodthink();cservo_think();}; +void() cservo_run3 =[ 5, cservo_run4] +{walkmove(self.ideal_yaw, 6);self.pos1 = '0 0 8.2';cservo_bodthink();cservo_think();}; +void() cservo_run4 =[ 7, cservo_run5] +{FootFall("mech/mechstep.wav", 0.3, 1, 1);walkmove(self.ideal_yaw, 5);self.pos1 = '0 0 9.6';cservo_bodthink();cservo_think();}; +void() cservo_run5 =[ 9, cservo_run6] +{walkmove(self.ideal_yaw, 11);self.pos1 = '0 0 10.8';cservo_bodthink();cservo_think();}; +void() cservo_run6 =[ 11, cservo_run7] +{walkmove(self.ideal_yaw, 11);self.pos1 = '0 0 11.9';cservo_bodthink();cservo_think();}; +void() cservo_run7 =[ 13, cservo_run8] +{walkmove(self.ideal_yaw, 10);self.pos1 = '0 0 9.6';cservo_bodthink();cservo_think();}; +void() cservo_run8 =[ 15, cservo_run9] +{FootFall("mech/mechstep.wav", 0.3, 1, 1);walkmove(self.ideal_yaw, 5);self.pos1 = '0 0 5.8';cservo_bodthink();cservo_think();}; +void() cservo_run9 =[ 17, cservo_run1] +{walkmove(self.ideal_yaw, 9);self.pos1 = '0 0 10.7';cservo_bodthink();cservo_think();}; + +void() cservo_walk1 =[ 1, cservo_walk2] +{walkmove(self.ideal_yaw, 5);self.pos1 = '0 0 11.4'; cservo_bodthink();cservo_think();}; +void() cservo_walk2 =[ 2, cservo_walk3] +{walkmove(self.ideal_yaw, 6);self.pos1 = '0 0 11.8'; cservo_bodthink();cservo_think();}; +void() cservo_walk3 =[ 3, cservo_walk4] +{walkmove(self.ideal_yaw, 7);self.pos1 = '0 0 11.3'; cservo_bodthink();cservo_think();}; +void() cservo_walk4 =[ 4, cservo_walk5] +{walkmove(self.ideal_yaw, 3);self.pos1 = '0 0 9.5'; cservo_bodthink();cservo_think();}; +void() cservo_walk5 =[ 5, cservo_walk6] +{walkmove(self.ideal_yaw, 3);self.pos1 = '0 0 8.2'; cservo_bodthink();cservo_think();}; +void() cservo_walk6 =[ 6, cservo_walk7] +{walkmove(self.ideal_yaw, 3);FootFall("mech/mechstep.wav", 0.3, 1, 0.8);self.pos1 = '0 0 5.4'; cservo_bodthink();cservo_think();}; +void() cservo_walk7 =[ 7, cservo_walk8] +{walkmove(self.ideal_yaw, 6);self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_walk8 =[ 8, cservo_walk9] +{walkmove(self.ideal_yaw, 5);self.pos1 = '0 0 10.7'; cservo_bodthink();cservo_think();}; +void() cservo_walk9 =[ 9, cservo_walk10] +{walkmove(self.ideal_yaw, 4);self.pos1 = '0 0 10.8'; cservo_bodthink();cservo_think();}; +void() cservo_walk10 =[ 10, cservo_walk11] +{walkmove(self.ideal_yaw, 3);self.pos1 = '0 0 11.8'; cservo_bodthink();cservo_think();}; +void() cservo_walk11 =[ 11, cservo_walk12] +{walkmove(self.ideal_yaw, 3);self.pos1 = '0 0 11.9'; cservo_bodthink();cservo_think();}; +void() cservo_walk12 =[ 12, cservo_walk13] +{walkmove(self.ideal_yaw, 7);self.pos1 = '0 0 11.3'; cservo_bodthink();cservo_think();}; +void() cservo_walk13 =[ 13, cservo_walk14] +{walkmove(self.ideal_yaw, 7);self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_walk14 =[ 14, cservo_walk15] +{walkmove(self.ideal_yaw, 3);self.pos1 = '0 0 8.3'; cservo_bodthink();cservo_think();}; +void() cservo_walk15 =[ 15, cservo_walk16] +{walkmove(self.ideal_yaw, 3);FootFall("mech/mechstep.wav", 0.3, 1, 0.8);self.pos1 = '0 0 5.8'; cservo_bodthink();cservo_think();}; +void() cservo_walk16 =[ 16, cservo_walk17] +{walkmove(self.ideal_yaw, 3);self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_walk17 =[ 17, cservo_walk18] +{walkmove(self.ideal_yaw, 6);self.pos1 = '0 0 10.7'; cservo_bodthink();cservo_think();}; +void() cservo_walk18 =[ 18, cservo_walk1] +{walkmove(self.ideal_yaw, 4);self.pos1 = '0 0 10.8'; cservo_bodthink();cservo_think();}; + +void() cservo_back1 =[ 18, cservo_back2] +{walkmove(self.ideal_yaw+180, 4);self.pos1 = '0 0 10.8'; cservo_bodthink();cservo_think();}; +void() cservo_back2 =[ 17, cservo_back3] +{walkmove(self.ideal_yaw+180, 6);self.pos1 = '0 0 10.7'; cservo_bodthink();cservo_think();}; +void() cservo_back3 =[ 16, cservo_back4] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_back4 =[ 15, cservo_back5] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 5.8'; cservo_bodthink();cservo_think();}; +void() cservo_back5 =[ 14, cservo_back6] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 8.3'; cservo_bodthink();cservo_think();}; +void() cservo_back6 =[ 13, cservo_back7] +{walkmove(self.ideal_yaw+180, 7);FootFall("mech/mechstep.wav", 0.3, 1, 0.8);self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_back7 =[ 12, cservo_back8] +{walkmove(self.ideal_yaw+180, 7);self.pos1 = '0 0 11.3'; cservo_bodthink();cservo_think();}; +void() cservo_back8 =[ 11, cservo_back9] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 11.9'; cservo_bodthink();cservo_think();}; +void() cservo_back9 =[ 10, cservo_back10] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 11.8'; cservo_bodthink();cservo_think();}; +void() cservo_back10 =[ 9, cservo_back11] +{walkmove(self.ideal_yaw+180, 4);self.pos1 = '0 0 10.8'; cservo_bodthink();cservo_think();}; +void() cservo_back11 =[ 8, cservo_back12] +{walkmove(self.ideal_yaw+180, 5);self.pos1 = '0 0 10.7'; cservo_bodthink();cservo_think();}; +void() cservo_back12 =[ 7, cservo_back13] +{walkmove(self.ideal_yaw+180, 6);self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_back13 =[ 6, cservo_back14] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 5.4'; cservo_bodthink();cservo_think();}; +void() cservo_back14 =[ 5, cservo_back15] +{walkmove(self.ideal_yaw+180, 3);self.pos1 = '0 0 8.2'; cservo_bodthink();cservo_think();}; +void() cservo_back15 =[ 4, cservo_back16] +{walkmove(self.ideal_yaw+180, 3);FootFall("mech/mechstep.wav", 0.3, 1, 0.8);self.pos1 = '0 0 9.5'; cservo_bodthink();cservo_think();}; +void() cservo_back16 =[ 3, cservo_back17] +{walkmove(self.ideal_yaw+180, 7);self.pos1 = '0 0 11.3'; cservo_bodthink();cservo_think();}; +void() cservo_back17 =[ 2, cservo_back18] +{walkmove(self.ideal_yaw+180, 6);self.pos1 = '0 0 11.8'; cservo_bodthink();cservo_think();}; +void() cservo_back18 =[ 1, cservo_back1] +{walkmove(self.ideal_yaw+180, 5);self.pos1 = '0 0 11.4'; cservo_bodthink();cservo_think();}; + +void() cservo_turn1 =[ 1, cservo_turn2] +{self.pos1 = '0 0 11.4'; cservo_bodthink();cservo_think();}; +void() cservo_turn2 =[ 2, cservo_turn3] +{self.pos1 = '0 0 11.8'; cservo_bodthink();cservo_think();}; +void() cservo_turn3 =[ 3, cservo_turn4] +{self.pos1 = '0 0 11.3'; cservo_bodthink();cservo_think();}; +void() cservo_turn4 =[ 4, cservo_turn5] +{self.pos1 = '0 0 9.5'; cservo_bodthink();cservo_think();}; +void() cservo_turn5 =[ 5, cservo_turn6] +{self.pos1 = '0 0 8.2'; cservo_bodthink();cservo_think();}; +void() cservo_turn6 =[ 6, cservo_turn7] +{FootFall("mech/mechstep.wav", 0.3, 1, 0.8);self.pos1 = '0 0 5.4'; cservo_bodthink();cservo_think();}; +void() cservo_turn7 =[ 7, cservo_turn8] +{self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_turn8 =[ 8, cservo_turn9] +{self.pos1 = '0 0 10.7'; cservo_bodthink();cservo_think();}; +void() cservo_turn9 =[ 9, cservo_turn10] +{self.pos1 = '0 0 10.8'; cservo_bodthink();cservo_think();}; +void() cservo_turn10 =[ 10, cservo_turn11] +{self.pos1 = '0 0 11.8'; cservo_bodthink();cservo_think();}; +void() cservo_turn11 =[ 11, cservo_turn12] +{self.pos1 = '0 0 11.9'; cservo_bodthink();cservo_think();}; +void() cservo_turn12 =[ 12, cservo_turn13] +{self.pos1 = '0 0 11.3'; cservo_bodthink();cservo_think();}; +void() cservo_turn13 =[ 13, cservo_turn14] +{self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_turn14 =[ 14, cservo_turn15] +{self.pos1 = '0 0 8.3'; cservo_bodthink();cservo_think();}; +void() cservo_turn15 =[ 15, cservo_turn16] +{FootFall("mech/mechstep.wav", 0.3, 1, 0.8);self.pos1 = '0 0 5.8'; cservo_bodthink();cservo_think();}; +void() cservo_turn16 =[ 16, cservo_turn17] +{self.pos1 = '0 0 9.6'; cservo_bodthink();cservo_think();}; +void() cservo_turn17 =[ 17, cservo_turn18] +{self.pos1 = '0 0 10.7'; cservo_bodthink();cservo_think();}; +void() cservo_turn18 =[ 18, cservo_turn1] +{self.pos1 = '0 0 10.8'; cservo_bodthink();cservo_think();}; + +//======================================================================= + +void(entity attacker, float damage) cservo_pain= +{ + local float tmpflt; + + if(self.pain_finished < time) + { + self.aiment.rotate_type = self.aiment.rotate_type + crandom() * damage * 0.3; + if(self.aiment.rotate_type < -80) + self.aiment.rotate_type = -80; + else if(self.aiment.rotate_type > 80) + self.aiment.rotate_type = 80; + + cservo_bodthink(); + self.pain_finished = time + 2 + random()*2; + + // display servomech status to controller + if(self.movetarget.owner) + { + tmpflt = self.health / 8; + + if(tmpflt > 90) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 100% "); + else if(tmpflt > 80) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 90% "); + else if(tmpflt > 70) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 80% "); + else if(tmpflt > 60) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 70% "); + else if(tmpflt > 50) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 60% "); + else if(tmpflt > 40) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 50% "); + else if(tmpflt > 30) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 40% "); + else if(tmpflt > 20) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 30% "); + else if(tmpflt > 10) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 20% "); + else if(tmpflt > 0) + centerprint(self.movetarget.owner, "\n\n\n\nServomech at 10% "); + else + centerprint(self.movetarget.owner, "\n\n\n\nServomech destroyed... "); + } + } +}; + +void() cservo_die= +{ + if(self.movetarget.owner) + cservo_control_off(self.movetarget.owner); + + remove(self.movetarget); + self.targetname = string_null; + + servo_die(); +}; + +//======================================================================= + +void() cservo_apply_controlls= +{ + local entity stemp; + local float tmpflt; + + stemp = self; + self = self.rcam.spawnmaster; + + if(stemp.impulse == 248) // stop using the mech + { + cservo_control_off(stemp); + self = stemp; + return; + } + + if(stemp.impulse == 247) // run forward + { + if(self.style != 4) + { + self.think = cservo_run1; + self.style = 4; + } + stemp.impulse = 0; + } + else if(stemp.impulse == 240) // walk forward + { + if(self.style != 1) + { + self.think = cservo_walk1; + self.style = 1; + } + stemp.impulse = 0; + } + else if(stemp.impulse == 241) // walk backwards + { + if(self.style != 2) + { + self.think = cservo_back1; + self.style = 2; + } + stemp.impulse = 0; + } + else if(stemp.impulse == 242) // turn left + { + self.angles_y = self.angles_y + 80*frametime; + self.angles_y = anglemod(self.angles_y); + self.ideal_yaw = self.angles_y; + if(self.style == 0) + { + self.think = cservo_turn1; + self.style = 3; + } + } + else if(stemp.impulse == 243) // turn right + { + self.angles_y = self.angles_y - 80*frametime; + self.angles_y = anglemod(self.angles_y); + self.ideal_yaw = self.angles_y; + if(self.style == 0) + { + self.think = cservo_turn1; + self.style = 3; + } + } + else if(stemp.impulse == 244) // straighten legs + { + tmpflt = fabs(self.ideal_yaw - stemp.v_angle *'0 1 0'); + if(tmpflt > 10 && tmpflt < 350) + { + self.ideal_yaw = stemp.v_angle *'0 1 0'; + ChangeYaw(); + self.ideal_yaw = self.angles_y; + if(self.style == 0) + { + self.think = cservo_turn1; + self.style = 3; + } + } + else + { + self.ideal_yaw = stemp.v_angle *'0 1 0'; + self.angles_y = self.ideal_yaw; + if(self.style == 3) + { + self.think = cservo_stand; + self.style = 0; + } + stemp.impulse = 0; + } + } + else if(stemp.impulse == 245) // stop + { + self.think = cservo_stand; + self.style = 0; + stemp.impulse = 0; + } + else if(stemp.impulse == 246) // stop turning + { + if(self.style == 3) + { + self.think = cservo_stand; + self.style = 0; + } + stemp.impulse = 0; + } + else if(stemp.impulse == APOCCAM_IMPULSE) // allow toggling the Apoc Cam + Cam_toggle(); + + if(stemp.button0) + self.attack_state = 1; + + self = stemp; + self.frame = 0; +}; + +//======================================================================= + +//entity currcheckmech; // the current controlled servomech to check for attacking. + +// now also has added targeting for the assasin and the mech +// so that bugs will attack them as well +void() cmech_attselect= +{ + self.nextthink = time + 0.1; + + while(1) + { + checkmech = find(checkmech, classname, "controlled_servomech"); + if(!checkmech) + return; + +// if(checkmech.classname == "controlled_servomech") + if(checkmech.movetarget.owner.flags & FL_CLIENT) + return; +// if(checkmech.enemy.classname == "controlled_servomech") + if(checkmech.show_hostile > time && random() > 0.25) + return; + } + +}; + + +//======================================================================= +void() cservo_setup= +{ + local entity tmpent; + + self.origin_z = self.origin_z + 1; // raise off floor a bit + droptofloor(); + + if (!walkmove(0,0)) + { + dprint ("controllable servomech in wall at: "); + dprint (vtos(self.origin)); + dprint ("\n"); + } + + self.takedamage = DAMAGE_AIM; + + if(!self.targetname) + { + cservo_stand(); + self.think = SUB_Null; + remove(self.movetarget); + } + else + { + cservo_stand(); + self.nextthink = self.nextthink + random()*0.5; + } +}; + +void() func_servomech= +{ + local entity bodent, legsent, pitent; + local entity cmechatt; + + precache_model ("progs/servobod.mdl"); + precache_model ("progs/servoleg.mdl"); + precache_model ("progs/servodie.mdl"); + precache_model ("progs/h_servo.mdl"); + precache_model ("progs/csm_cpit.mdl"); + precache_model ("progs/frame.mdl"); + precache_model ("progs/s_null.spr"); + + precache_sound ("mech/mechstep.wav"); + precache_sound ("mech/pow_up.wav"); + precache_sound ("mech/pow_dn.wav"); + precache_sound ("mech/metal.wav"); + precache_sound ("drake/misc/shortexp.wav"); + precache_sound ("enforcer/enfire.wav"); + + // setup the self.as the legs + setorigin(self, self.origin); + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/servoleg.mdl"); + self.classname = "controlled_servomech"; + setsize (self, '-32 -32 -48', '32 32 28'); + self.health = 800; + self.pos1 = '0 0 0'; + self.angles = self.angles; + self.ideal_yaw = self.angles_y; + self.yaw_speed = 10; + self.view_ofs = '0 0 12'; + self.hittype = HIT_METAL; + + self.th_die = cservo_die; + self.th_pain = cservo_pain; + +// ### Added for Custents all affecting gravity + if(!self.gravity) + self.gravity = 1; + else + self.gravity = ((self.gravity - 1) / 100); +// ### + + // setup upper body entity + bodent = spawn(); + bodent.solid = SOLID_NOT; + bodent.movetype = MOVETYPE_NONE; + setmodel (bodent, "progs/servobod.mdl"); + setorigin(bodent, self.origin); + bodent.angles = self.angles; + bodent.ideal_yaw = self.ideal_yaw; + bodent.view_ofs = '0 0 12'; + bodent.yaw_speed = 10; + bodent.rotate_type = 0; + bodent.skin = self.skin; + bodent.hittype = HIT_METAL; + + + // setup cockpit entity + pitent = spawn(); + pitent.solid = SOLID_NOT; + pitent.movetype = MOVETYPE_NONE; + setmodel(pitent, "progs/csm_cpit.mdl"); + pitent.classname = "mech_cockpit"; + pitent.angles = bodent.angles; + pitent.spawnflags = RCAM_ALOWIMP; + + + // link the entities together + self.aiment = bodent; + self.movetarget = pitent; + bodent.movetarget = pitent; + bodent.owner = self; + pitent.spawnmaster = self; + + self.nextthink = self.nextthink + random()*0.4; + self.think = cservo_setup; + + // generate an entity to select controllable servomechs to be checked for attacks + // like checkclient + cmechatt = find(world, classname, "cmech_attackselector"); + if(!cmechatt) + { + cmechatt = spawn(); + cmechatt.classname = "cmech_attackselector"; + cmechatt.think = cmech_attselect; + cmechatt.nextthink = time + 1; + } +}; + +//======================================================================= + +void() trigger_servomech_use= +{ + local entity contmech; + + contmech = find(world, targetname, self.target); + while(contmech) + { + if(!contmech.movetarget.owner) + { + contmech.walkframe = self.walkframe; + contmech.invincible_finished = self.invincible_finished; + self = contmech; + cservo_control_on(activator); + return; + } + contmech = find(contmech, targetname, self.target); + } + sprint(activator, "No servomech responded.\n"); +}; + +void() trigger_servomech= +{ + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + if(self.spawnflags & 1) + self.walkframe = 0; + else + self.walkframe = 1; + + if(self.spawnflags & 2) + self.invincible_finished = 1; + else + self.invincible_finished = 0; + + self.use = trigger_servomech_use; +}; + +//======================================================================= + +/* +FindMechTarget + +Used to make monsters check for attackable, player controlled servomechs +*/ +float() FindMechTarget= +{ + local entity client; + local float r; + + client = checkmech; + if (!client) + return FALSE; + + if (client == self.enemy) + return FALSE; + + r = range (client); + if (r == RANGE_FAR) + return FALSE; + + if (!visible (client)) + return FALSE; + + if (client.enemy.classname == "controlled_servomech") + { + if (r == RANGE_MID) + { + if (client.show_hostile < time && !infront (client)) + return FALSE; + } + else + { + if(client.show_hostile < time) + return FALSE; + } + } + else + { + if (client.show_hostile < time && !infront (client)) + return FALSE; + } + +// +// got one +// + self.enemy = client; + + if (self.enemy.classname != "controlled_servomech") + { + self.enemy = self.enemy.enemy; + if (self.enemy.classname != "controlled_servomech") + { + self.enemy = world; + return FALSE; + } + } + + FoundTarget (); + + return TRUE; +}; diff --git a/QC_other/QC_keep/mon_supergrunt.qc b/QC_other/QC_keep/mon_supergrunt.qc new file mode 100644 index 00000000..de428747 --- /dev/null +++ b/QC_other/QC_keep/mon_supergrunt.qc @@ -0,0 +1,609 @@ +void() SGruntCheckAttack; + +// running +// a stupid, lurching hopscotch-type maneouvre... + +void() sgrunt_run1 = [92, sgrunt_run2] {ai_run(20);}; +void() sgrunt_run2 = [93, sgrunt_run3] {monster_footstep(FALSE); ai_run(25);}; +void() sgrunt_run3 = [94, sgrunt_run4] {ai_run(6);}; +void() sgrunt_run4 = [95, sgrunt_run5] {ai_run(9);}; +void() sgrunt_run5 = [96, sgrunt_run6] {ai_run(20);}; +void() sgrunt_run6 = [97, sgrunt_run7] {monster_footstep(FALSE); ai_run(25);}; +void() sgrunt_run7 = [98, sgrunt_run8] {ai_run(3);}; +void() sgrunt_run8 = [99, sgrunt_run1] {ai_run(7);}; + +// standing +// stand50-stand71 is a standing loop. + +void() sgrunt_stand = +{ + if ((self.frame < 50) || (self.frame >= 71)) + self.frame = 50; + + else + self.frame = self.frame + 1; + + self.think = sgrunt_stand; + self.nextthink = time + 0.1; + ai_stand(); // always put this at the end of the function otherwise things get really messed up. +}; + +// walking + +void() sgrunt_swagger1 = [74, sgrunt_swagger2 ] +{ + if (random() < 0.1) + sound (self, CHAN_VOICE, "sgrunt/infidle1.wav", 1, ATTN_IDLE); + + ai_walk(7); +}; +void() sgrunt_swagger2 = [75, sgrunt_swagger3 ] {ai_walk(5);}; +void() sgrunt_swagger3 = [76, sgrunt_swagger4 ] {ai_walk(5);}; +void() sgrunt_swagger4 = [77, sgrunt_swagger5 ] {ai_walk(6);}; +void() sgrunt_swagger5 = [78, sgrunt_swagger6 ] {ai_walk(5); monster_footstep(FALSE);}; +void() sgrunt_swagger6 = [79, sgrunt_swagger7 ] {ai_walk(6);}; +void() sgrunt_swagger7 = [80, sgrunt_swagger8 ] {ai_walk(6);}; +void() sgrunt_swagger8 = [81, sgrunt_swagger9 ] {ai_walk(5);}; +void() sgrunt_swagger9 = [82, sgrunt_swagger10 ] {ai_walk(5);}; +void() sgrunt_swagger10 = [83, sgrunt_swagger11 ] {ai_walk(5);}; +void() sgrunt_swagger11 = [84, sgrunt_swagger12 ] {ai_walk(5);}; +void() sgrunt_swagger12 = [85, sgrunt_swagger1 ] {ai_walk(6);}; + +// firing +// attak1-attak15 is the firing anim. +// in q2, he is frozen on attak11 whilst firing. + +void() sgrunt_fire12; + +float() ai_face_last = +{ + if ( (visible(self.enemy)) || (self.enemy.origin == '0 0 0') ) { + ai_face(); + return TRUE; + } + + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); + return FALSE; +}; +/* +void() SpawnSGruntMuzzleFlash = +{ + local entity new; + + new = spawn(); + + new.owner = self; + + new.cnt = 0; // used to keep track of positioning + + new.solid = SOLID_NOT; + new.movetype = MOVETYPE_NONE; + new.angles = self.angles; + + new.think = SUB_Remove; // just in case it gets left behind + new.nextthink = time + 0.2; + + setmodel(new, "progs/sgrflash.mdl"); + setsize(new, '0 0 0', '0 0 0'); + setorigin(new, self.origin); + + self.trigger_field = new; // for want of a better variable +}; + +void() SGruntMuzzleFlash = +{ + local float f, f1; + local vector ofs; + local entity t; + + t = self.trigger_field; + f = t.cnt; + + makevectors(self.angles); + + ofs = v_forward*36; + + if (f == 0) + ofs = ofs + v_right*9 + '0 0 24'; + else if (f == 1) + ofs = ofs + v_right*6 + '0 0 22'; + else if (f == 2) + ofs = ofs + v_right*6 + '0 0 19'; + else if (f == 3) + ofs = ofs + v_right*9 + '0 0 17'; + else if (f == 4) + ofs = ofs + v_right*12 + '0 0 19'; + else + ofs = ofs + v_right*12 + '0 0 22'; + + t.angles = self.angles; + setorigin(t, self.origin + ofs); + + f1 = f + 1; + if (f1 > 5) + f1 = 0; + + t.cnt = f1; + t.nextthink = time + 0.2; // don't want to remove it yet +}; +*/ + +void() sgrunt_plasma_touch ={ + if (other == self.owner) return; + + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + if (pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + +// hit something that bleeds + if (other.takedamage) + { + spawn_touchblood (self, other, 6); + T_Damage (other, self, self.owner, 6, DAMARMOR); + } + + // do sprite explosion + + self.origin = self.origin - 8*normalize(self.velocity); + + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; + self.solid = SOLID_NOT; + + self.think = BDW_SpriteGenericPlayOnce; + self.nextthink = time + 0.05; + + self.frame = 0; + self.idleweaponframe = 6; + setmodel(self, "progs/s_plasgx.spr"); + + // make sound + sound(self, CHAN_VOICE, "weapons/plasexpl.wav", 1, ATTN_NORM); +}; + +void(vector org, vector dir) sgrunt_spawn_plasma = +{ + local entity plasma; + local float f; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound(self, CHAN_WEAPON, "sgrunt/hovatck1.wav", 1, ATTN_NORM); + + plasma = spawn(); + plasma.classname = "plasma"; + plasma.owner = self; + plasma.movetype = MOVETYPE_FLYMISSILE; + plasma.solid = SOLID_BBOX; + plasma.touch = sgrunt_plasma_touch; + plasma.velocity = dir*750; + plasma.think = BDW_SpriteGenericLoop; + plasma.nextthink = time + 0.05; + + // randomise the starting frame... + f = random()*6; // 0 < f < 6 + f = ceil(f); // 1 <= f <=6 + f = f - 1; // 0 <= f <= 5 + + plasma.frame = f; + plasma.idleweaponframe = 6; + + setmodel(plasma, "progs/s_plasgr.spr"); + setsize(plasma, VEC_ORIGIN, VEC_ORIGIN); + setorigin(plasma, org); +}; + +void(vector ofs) sgrunt_death_plasma = +{ + local vector org, dir; + + makevectors(self.angles); + + org = self.origin + v_forward*ofs_x + v_right*ofs_y; + org_z = org_z + ofs_z; + + dir = org - (self.origin + '0 0 24' + v_right*5); + dir = normalize(dir); + + sgrunt_spawn_plasma(org, dir); +}; + +void(float o_r, float o_z) sgrunt_plasma_launch = +{ + local vector ofs, dir; + local entity en; + local float t; + + // lead the player + if (ai_face_last()) + { + en = self.enemy; + t = (vlen(en.origin - self.origin)) / 750; // rough calculation of time to reach enemy + + dir = en.velocity * t * 0.5; // 0.5 tones it down a bit + dir_z = 0; // jumping produces sillyness + dir = dir + en.origin; + dir = normalize(dir - self.origin); + } + else + dir = normalize(self.enemy.origin - self.origin); + + makevectors(self.angles); + // do a hyberblaster-style offset cycle + ofs = v_forward*36 + v_right*o_r; + ofs_z = ofs_z + o_z; + + dir = dir + crandom()*0.05*v_right + crandom()*0.05*v_up; // give it a bit of spread. FIXME: spread based on skill? + dir = normalize(dir); // FIXME: is this necessary? + + sgrunt_spawn_plasma(self.origin + ofs, dir); + + self.cnt = self.cnt - 1; + + if (self.cnt <= 0) + self.think = sgrunt_fire12; +}; + +void() sgrunt_plasma1 = [194, sgrunt_plasma2] {sgrunt_plasma_launch(9, 24);}; +void() sgrunt_plasma2 = [194, sgrunt_plasma3] {sgrunt_plasma_launch(6, 22);}; +void() sgrunt_plasma3 = [194, sgrunt_plasma4] {sgrunt_plasma_launch(6, 19);}; +void() sgrunt_plasma4 = [194, sgrunt_plasma5] {sgrunt_plasma_launch(9, 17);}; +void() sgrunt_plasma5 = [194, sgrunt_plasma6] {sgrunt_plasma_launch(12, 19);}; +void() sgrunt_plasma6 = [194, sgrunt_plasma1] {sgrunt_plasma_launch(12, 22);}; + +void() sgrunt_fire_loop = [194, sgrunt_fire_loop] +{ + local vector dir; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound(self, CHAN_WEAPON, "sgrunt/infatck1.wav", 1, ATTN_NORM); + + // fire somewhat behind the player, so a dodging player is harder to hit + if (ai_face_last()) + { + dir = self.enemy.origin - self.enemy.velocity*0.2; + dir = normalize (dir - self.origin); + } + else + dir = normalize(self.enemy.origin - self.origin); + + FireBullets (4, SPREAD_GRUNT); + + self.cnt = self.cnt - 1; + + if (self.cnt <= 0) { + self.think = sgrunt_fire12; + } +}; + +void() sgrunt_fire1 = [184, sgrunt_fire2] {ai_face_last();ai_forward(5);}; +void() sgrunt_fire2 = [185, sgrunt_fire3] {ai_face_last();ai_back(1);}; +void() sgrunt_fire3 = [186, sgrunt_fire4] {ai_face_last();ai_back(1);}; +void() sgrunt_fire4 = [187, sgrunt_fire5] {ai_face_last();sound(self, CHAN_WEAPON, "sgrunt/infatck3.wav", 1, ATTN_NORM);}; +void() sgrunt_fire5 = [188, sgrunt_fire6] {ai_face_last();ai_back(1);}; +void() sgrunt_fire6 = [189, sgrunt_fire7] {ai_face_last();ai_forward(1);}; +void() sgrunt_fire7 = [190, sgrunt_fire8] {ai_face_last();ai_forward(1);}; +void() sgrunt_fire8 = [191, sgrunt_fire9] {ai_face_last();ai_forward(2);}; +void() sgrunt_fire9 = [192, sgrunt_fire10] {ai_face_last();ai_back(2);}; +void() sgrunt_fire10 = [193, sgrunt_fire11] {ai_face_last();ai_back(4);}; +void() sgrunt_fire11 = [194, sgrunt_fire12] { + ai_forward(1); + self.cnt = 10 + random()*10; // number of shots to fire + self.cnt = rint(self.cnt); + if (self.monsterflags & MF_COMMANDER) + sgrunt_plasma1(); + else + sgrunt_fire_loop(); +}; +void() sgrunt_fire12 = [195, sgrunt_fire13] {ai_face();ai_forward(6);}; +void() sgrunt_fire13 = [196, sgrunt_fire14] {ai_face();ai_back(1);}; +void() sgrunt_fire14 = [197, sgrunt_fire15] {ai_face();ai_back(2);}; +void() sgrunt_fire15 = [198, sgrunt_run1] { + local vector spot1, spot2; + local float r; + + ai_face(); + ai_back(4); + +// check for automatic refire based on skill level, but if enemy is quite close +// then give time to move in for a melee attack... + if (random() < 0.25*skill) + { + spot1 = self.origin + self.view_ofs; + spot2 = self.enemy.origin + self.enemy.view_ofs; + + r = vlen(spot1 - spot2); + if (r > 250) + { + if (visible(self.enemy)) + { + self.think = sgrunt_fire1; + return; + } + } + } + self.attack_finished = time + 1 + random()*2; +}; + +void() sgrunt_wallop = { + local vector delta; + local float ldmg; + + if (!self.enemy) + return; + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 60) + return; + if (!CanDamage(self.enemy, self)) + return; + + ldmg = (random() + random() + random()) * 20; + T_Damage (self.enemy, self, self, ldmg,DAMARMOR); + sound (self, CHAN_WEAPON, "sgrunt/melee2.wav", 1, ATTN_NORM); +}; + +void() sgrunt_smash1 = [199, sgrunt_smash2] {ai_face();ai_forward(3);}; +void() sgrunt_smash2 = [200, sgrunt_smash3] {ai_face();ai_back(7);sound(self, CHAN_WEAPON, "sgrunt/infatck2.wav", 1, ATTN_NORM);}; +void() sgrunt_smash3 = [201, sgrunt_smash4] {ai_face();ai_forward(1);}; +void() sgrunt_smash4 = [202, sgrunt_smash5] {ai_face();ai_forward(9);}; +void() sgrunt_smash5 = [203, sgrunt_smash6] {ai_face();ai_forward(6);}; +void() sgrunt_smash6 = [204, sgrunt_smash7] {ai_face();ai_forward(9);sgrunt_wallop();}; +void() sgrunt_smash7 = [205, sgrunt_smash8] {ai_face();ai_back(7);}; +void() sgrunt_smash8 = [206, sgrunt_run1] {ai_face();ai_back(4);}; + + +void() sgrunt_damage_skin = { + if (self.health <= 175) + self.skin = 1; + else + self.skin = 0; +}; + +void() sgrunt_paina1 = [100, sgrunt_paina2] {ai_back(4);}; +void() sgrunt_paina2 = [101, sgrunt_paina3] {ai_back(2);}; +void() sgrunt_paina3 = [102, sgrunt_paina4] {ai_back(2);}; +void() sgrunt_paina4 = [103, sgrunt_paina5] {ai_back(2);}; +void() sgrunt_paina5 = [104, sgrunt_paina6] {ai_back(1);}; +void() sgrunt_paina6 = [105, sgrunt_paina7] {ai_forward(1);}; +void() sgrunt_paina7 = [106, sgrunt_paina8] {ai_back(1);}; +void() sgrunt_paina8 = [107, sgrunt_paina9] {ai_forward(1);}; +void() sgrunt_paina9 = [108, sgrunt_paina10] {ai_forward(7);}; +void() sgrunt_paina10 = [109, sgrunt_run1] {ai_forward(2);}; + +void() sgrunt_painb1 = [110, sgrunt_painb2] {ai_back(3);}; +void() sgrunt_painb2 = [111, sgrunt_painb3] {ai_back(4);}; +void() sgrunt_painb3 = [112, sgrunt_painb4] {}; +void() sgrunt_painb4 = [113, sgrunt_painb5] {ai_back(1);}; +void() sgrunt_painb5 = [114, sgrunt_painb6] {ai_back(2);}; +void() sgrunt_painb6 = [115, sgrunt_painb7] {}; +void() sgrunt_painb7 = [116, sgrunt_painb8] {}; +void() sgrunt_painb8 = [117, sgrunt_painb9] {ai_forward(2);}; +void() sgrunt_painb9 = [118, sgrunt_painb10] {ai_forward(6);}; +void() sgrunt_painb10 = [119, sgrunt_run1] {ai_forward(2);}; + +void(entity inflictor, entity attacker, float damage) sgrunt_pain = { + sgrunt_damage_skin(); + + if (self.pain_finished > time) + //if (NotAGoonSlapper(attacker)) + // return; + + if (random()*200 > damage) + //if (NotAGoonSlapper(attacker)) + // return; // didn't flinch + + self.pain_finished = time + 2; + + if (random() < 0.5) { + sound(self, CHAN_VOICE, "sgrunt/infpain1.wav", 1, ATTN_NORM); + sgrunt_paina1(); + } else { + sound(self, CHAN_VOICE, "sgrunt/infpain2.wav", 1, ATTN_NORM); + sgrunt_painb1(); + } +}; + +void() sgrunt_die1 = [125, sgrunt_die2] {ai_back(5);}; +void() sgrunt_die2 = [126, sgrunt_die3] {monster_check_gib();}; +void() sgrunt_die3 = [127, sgrunt_die4] {monster_check_gib();}; +void() sgrunt_die4 = [128, sgrunt_die5] {ai_back(1);}; +void() sgrunt_die5 = [129, sgrunt_die6] {ai_back(5);}; +void() sgrunt_die6 = [130, sgrunt_die7] {}; +void() sgrunt_die7 = [131, sgrunt_die8] {}; +void() sgrunt_die8 = [132, sgrunt_die9] {}; +void() sgrunt_die9 = [133, sgrunt_die10] {ai_back(1);}; +void() sgrunt_die10 = [134, sgrunt_die11] {ai_forward(4);}; +void() sgrunt_die11 = [135, sgrunt_die12] {ai_forward(1);}; +void() sgrunt_die12 = [136, sgrunt_die13] {ai_forward(1);}; +void() sgrunt_die13 = [137, sgrunt_die14] {ai_back(2);}; +void() sgrunt_die14 = [138, sgrunt_die15] {ai_forward(2);}; +void() sgrunt_die15 = [139, sgrunt_die16] {ai_forward(2);}; +void() sgrunt_die16 = [140, sgrunt_die17] {ai_forward(7);self.solid = SOLID_NOT;DropBackpack();}; +void() sgrunt_die17 = [141, sgrunt_die18] {ai_forward(9);}; +void() sgrunt_die18 = [142, sgrunt_die19] {ai_forward(6);BDW_BodyDropSound();}; +void() sgrunt_die19 = [143, sgrunt_die20] {ai_back(3);monster_death_postcheck();}; +void() sgrunt_die20 = [144, sgrunt_die20] {monster_deadbody_check();}; + +//note that plasma offsets on the death anim. are currently based on the centre of the barrel... +//if you've got time, you could do a cyclical movement, like normal firing mode + +void() sgrunt_bdie1 = [145, sgrunt_bdie2] {}; +void() sgrunt_bdie2 = [146, sgrunt_bdie3] {ai_forward(2);monster_check_gib();}; +void() sgrunt_bdie3 = [147, sgrunt_bdie4] {ai_forward(6);monster_check_gib();}; +void() sgrunt_bdie4 = [148, sgrunt_bdie5] {ai_back(1);}; +void() sgrunt_bdie5 = [149, sgrunt_bdie6] {}; +void() sgrunt_bdie6 = [150, sgrunt_bdie7] {ai_forward(2);}; +void() sgrunt_bdie7 = [151, sgrunt_bdie8] {ai_forward(1);}; +void() sgrunt_bdie8 = [152, sgrunt_bdie9] {ai_forward(5);sgrunt_death_plasma('17 6 -2');}; //fire start +void() sgrunt_bdie9 = [153, sgrunt_bdie10] {ai_forward(4);sgrunt_death_plasma('24 2 16');}; +void() sgrunt_bdie10 = [154, sgrunt_bdie11] {sgrunt_death_plasma('22 5 20');}; +void() sgrunt_bdie11 = [155, sgrunt_bdie12] {ai_back(2);sgrunt_death_plasma('21 9 23');}; +void() sgrunt_bdie12 = [156, sgrunt_bdie13] {ai_back(3);sgrunt_death_plasma('21 11 25');}; +void() sgrunt_bdie13 = [157, sgrunt_bdie14] {ai_back(3);sgrunt_death_plasma('20 15 28');}; +void() sgrunt_bdie14 = [158, sgrunt_bdie15] {ai_back(1);sgrunt_death_plasma('17 18 30');}; +void() sgrunt_bdie15 = [159, sgrunt_bdie16] {ai_back(2);sgrunt_death_plasma('15 20 32');}; +void() sgrunt_bdie16 = [160, sgrunt_bdie17] {sgrunt_death_plasma('14 24 30');}; +void() sgrunt_bdie17 = [161, sgrunt_bdie18] {ai_forward(2);sgrunt_death_plasma('11 27 27');}; +void() sgrunt_bdie18 = [162, sgrunt_bdie19] {ai_forward(3);sgrunt_death_plasma('17 22 26');}; +void() sgrunt_bdie19 = [163, sgrunt_bdie20] {ai_forward(4);sgrunt_death_plasma('18 19 24');}; +void() sgrunt_bdie20 = [164, sgrunt_bdie21] {ai_back(12);self.solid = SOLID_NOT;DropBackpack();sgrunt_death_plasma('13 18 35');}; +void() sgrunt_bdie21 = [165, sgrunt_bdie22] {ai_back(9);sgrunt_death_plasma('-2 18 38');}; +void() sgrunt_bdie22 = [166, sgrunt_bdie23] {ai_back(10);sgrunt_death_plasma('-15 15 28');}; +void() sgrunt_bdie23 = [167, sgrunt_bdie24] {ai_back(10);BDW_BodyDropSound();sgrunt_death_plasma('-27 16 12');}; //fire end +void() sgrunt_bdie24 = [168, sgrunt_bdie25] {ai_forward(5);monster_death_postcheck();}; +void() sgrunt_bdie25 = [169, sgrunt_bdie25] {monster_deadbody_check();}; + +void() sgrunt_die = { + local vector org; + local float gibcount; + + self.skin = 0; + monster_death_precheck(); + + if (!self.gibbed) { + sgrunt_damage_skin(); + + // regular death + sound(self, CHAN_VOICE, "gibs/ut2gib1.wav", 1, ATTN_NORM); + + // head explodes on death... + makevectors(self.angles); + org = self.origin + '0 0 40' - v_forward*8; + + // todo: put explosion sprite here? + + gibcount = 6; + while (gibcount > 0) { + SpawnMeatSpray (self, self, (250*crandom())); + gibcount = gibcount - 1; + } + + if (random() < 0.5) + sgrunt_die1(); + else + sgrunt_bdie1(); + } +}; + +void() monster_super_grunt = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/sgrunt.mdl"; + self.headmdl = "progs/head2.mdl"; + precache_model("progs/sgrunt.mdl"); + precache_model("progs/head2.mdl"); + precache_model("progs/s_plasgr.spr"); // super grunt commander plasma shot + precache_model("progs/s_plasgx.spr"); // super grunt commander plasma explosion + + //precache_sound ("sgrunt/infdeth1.wav"); + //precache_sound ("sgrunt/infdeth2.wav"); + precache_sound ("sgrunt/infidle1.wav"); + precache_sound ("sgrunt/infpain1.wav"); + precache_sound ("sgrunt/infpain2.wav"); + precache_sound ("sgrunt/infsght1.wav"); + precache_sound ("sgrunt/infsrch1.wav"); + precache_sound ("sgrunt/infatck1.wav"); + precache_sound ("sgrunt/infatck2.wav"); + precache_sound ("sgrunt/infatck3.wav"); + precache_sound ("sgrunt/melee2.wav"); + precache_sound ("sgrunt/hovatck1.wav"); + + precache_sound ("gibs/ut2gib1.wav"); + precache_sound ("weapons/plasexpl.wav"); + + if (random() < 0.5) + self.sight_sound = "sgrunt/infsght1.wav"; + else + self.sight_sound = "sgrunt/infsrch1.wav"; + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + + setmodel (self, "progs/sgrunt.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + if (self.health < 1) self.health = 350; + self.gibhealth = -60; + self.th_stand = sgrunt_stand; + self.th_walk = sgrunt_swagger1; + self.th_run = sgrunt_run1; + self.th_melee = sgrunt_smash1; + self.th_missile = sgrunt_fire1; + self.th_pain = sgrunt_pain; + self.th_die = sgrunt_die; + if (self.ammo_cells < 1) self.ammo_cells = 10; + self.th_checkattack = SGruntCheckAttack; + + self.monsterflags = self.monsterflags | MF_COMMANDER; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + if (self.deathstring == "") self.deathstring = " was slaughtered by a Sergeant\n"; + + self.classtype = CT_MONSUPERGRUNT; + self.classgroup = CG_ARMY; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + +/* +=========== +SGruntCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +void() SGruntCheckAttack = { + local vector spot1, spot2; + local entity targ; + local float r; + + targ = self.enemy; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + if (enemy_range == RANGE_MELEE) { + r = vlen(spot1 - spot2); + if (r < 80) // needs to be really close + { + if (CanDamage (self.enemy, self)) + { + self.attack_state = AS_MELEE; + return; + } + } + } + + if (time < self.attack_finished) return; + + if (!enemy_vis) return; + +// see if any entities are in the way of the shot + traceline (spot1, spot2, FALSE, self); + + if (trace_ent != targ) return; // don't have a clear shot + + // ben - air/water check is implicit in enemy_vis + //if (trace_inopen && trace_inwater) + // return; + +// missile attack + + //if (enemy_range == RANGE_FAR) + // return; + + self.attack_state = AS_MISSILE; + //SUB_AttackFinished (3 + 3*random()); +}; + diff --git a/QC_other/QC_keep/mon_swampling.qc b/QC_other/QC_keep/mon_swampling.qc new file mode 100644 index 00000000..5a6f64da --- /dev/null +++ b/QC_other/QC_keep/mon_swampling.qc @@ -0,0 +1,612 @@ +/*============================================================================== +SWAMPLINGS (Based on Voreling from Quoth - Kell/Necros/Preach) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 + +$frame idleup1 idleup2 idleup3 idleup4 idleup5 idleup6 + +$frame drop1 drop2 drop3 drop4 drop5 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame walk1 walk2 walk3 walk4 walk5 + +$frame run1 run2 run3 run4 + +// Jumping up +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +// Bite attack +$frame bite1 bite2 bite3 bite4 bite5 bite6 bite7 + +// Extremely short pain set +$frame pain1 pain2 + +// fall over and die +$frame death1 death2 death3 death4 death5 death6 + +// body flies up and then back to the ground +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 + +// Not used, modelling templates +$frame base1 base2 + +//====================================================================== +void() swampling_idle1 =[ $idle1, swampling_idle2 ] {monster_idle_sound();ai_stand();}; +void() swampling_idle2 =[ $idle2, swampling_idle3 ] {ai_stand();}; +void() swampling_idle3 =[ $idle3, swampling_idle4 ] {ai_stand();}; +void() swampling_idle4 =[ $idle4, swampling_idle5 ] {ai_stand();}; +void() swampling_idle5 =[ $idle5, swampling_idle6 ] {ai_stand();}; +void() swampling_idle6 =[ $idle6, swampling_idle7 ] {ai_stand();}; +void() swampling_idle7 =[ $idle7, swampling_idle8 ] {ai_stand();}; +void() swampling_idle8 =[ $idle8, swampling_idle9 ] {ai_stand();}; +void() swampling_idle9 =[ $idle9, swampling_idle10] {ai_stand();}; +void() swampling_idle10=[ $idle10,swampling_idle11] {ai_stand();}; +void() swampling_idle11=[ $idle11,swampling_idle12] {ai_stand();}; +void() swampling_idle12=[ $idle12,swampling_idle13] {ai_stand();}; +void() swampling_idle13=[ $idle13,swampling_idle1 ] {ai_stand();}; + +//====================================================================== +void() swampling_walk1 =[ $walk1, swampling_walk2 ] {monster_idle_sound();ai_walk(4);}; +void() swampling_walk2 =[ $walk2, swampling_walk3 ] {monster_footstep(FALSE); ai_walk(3);}; +void() swampling_walk3 =[ $walk3, swampling_walk4 ] {ai_walk(4);}; +void() swampling_walk4 =[ $walk4, swampling_walk5 ] {ai_walk(5);}; +void() swampling_walk5 =[ $walk5, swampling_walk1 ] {ai_walk(5);}; + +//====================================================================== +void() swampling_runpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + if (self.jump_flag < time) self.th_run(); + // Is the enemy too close? no more pausing, fight! + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_RUNPAUSE) self.th_run(); +}; + +//---------------------------------------------------------------------- +void() swampling_runp1 =[ $idle1, swampling_runp2 ] {swampling_runpause();}; +void() swampling_runp2 =[ $idle2, swampling_runp3 ] {swampling_runpause();}; +void() swampling_runp3 =[ $idle3, swampling_runp4 ] {swampling_runpause();}; +void() swampling_runp4 =[ $idle4, swampling_runp5 ] {swampling_runpause();}; +void() swampling_runp5 =[ $idle5, swampling_runp6 ] {swampling_runpause();}; +void() swampling_runp6 =[ $idle6, swampling_runp7 ] {swampling_runpause();}; +void() swampling_runp7 =[ $idle7, swampling_runp8 ] {swampling_runpause();}; +void() swampling_runp8 =[ $idle8, swampling_runp9 ] {swampling_runpause();}; +void() swampling_runp9 =[ $idle9, swampling_runp10 ] {swampling_runpause();}; +void() swampling_runp10 =[ $idle10,swampling_runp11 ] {swampling_runpause();}; +void() swampling_runp11 =[ $idle11,swampling_runp12 ] {swampling_runpause();}; +void() swampling_runp12 =[ $idle12,swampling_runp13 ] {swampling_runpause();}; +void() swampling_runp13 =[ $idle13,swampling_runp1 ] {swampling_runpause();}; + +//---------------------------------------------------------------------- +void(float dist) swampling_checkpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + // make swamplings run in bursts of speed (reset every run animation cycle) + self.movespeed = self.movespeed + 1; + // Do run code to check for enemies + ai_run(dist + self.movespeed); + if (self.enemydist < MONAI_RUNPAUSE) return; // Too close + + // Random chance to stop and pause running + if (self.movespeed > 7 && random() < 0.2) { + self.jump_flag = time + random(); + self.think = swampling_runp1; + } +}; + +//---------------------------------------------------------------------- +void() swampling_run1 =[ $run1, swampling_run2 ] {self.movespeed = 0; + monster_idle_sound(); + swampling_checkpause(8); + // swamplings have constant problems with weird angles (X/Z) + // Just keep resetting them so they move normally + ai_resetangles(); +}; +void() swampling_run2 =[ $run2, swampling_run3 ] {monster_footstep(FALSE); swampling_checkpause(6);}; +void() swampling_run3 =[ $run3, swampling_run4 ] {swampling_checkpause(8);}; +void() swampling_run4 =[ $run4, swampling_run5 ] {swampling_checkpause(10);}; +void() swampling_run5 =[ $run1, swampling_run6 ] {swampling_checkpause(8);}; +void() swampling_run6 =[ $run2, swampling_run7 ] {monster_footstep(FALSE); swampling_checkpause(6);}; +void() swampling_run7 =[ $run3, swampling_run8 ] {swampling_checkpause(8);}; +void() swampling_run8 =[ $run4, swampling_run1 ] {swampling_checkpause(10);}; + +//====================================================================== +void() swampling_slide1 =[ $walk1, swampling_slide2 ] {ai_run_slide(6); monster_idle_sound();}; +void() swampling_slide2 =[ $walk2, swampling_slide3 ] {ai_run_slide(4);}; +void() swampling_slide3 =[ $walk3, swampling_slide4 ] {ai_run_slide(6);}; +void() swampling_slide4 =[ $walk4, swampling_slide5 ] {ai_run_slide(4);}; +void() swampling_slide5 =[ $walk5, swampling_run1 ] {ai_run(4);}; + +//====================================================================== +// swampling 2 - POISON SPIT FUNCTIONS (range) +//====================================================================== +void(float sideang) swampling_spitacid = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "swampling/spit4.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire spit in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_SWAMPLING; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_SWAMP); +}; + +//---------------------------------------------------------------------- +void() swampling_spit1 = [ $pain1, swampling_spit2 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_SWAMPLING); }; +void() swampling_spit2 = [ $pain2, swampling_spit3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SWAMPLING); }; +void() swampling_spit3 = [ $bite1, swampling_spit4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_SWAMPLING); }; +void() swampling_spit4 = [ $bite2, swampling_spit5 ] {swampling_spitacid(-0.1);}; +void() swampling_spit5 = [ $bite3, swampling_spit6 ] {swampling_spitacid(0);}; +void() swampling_spit6 = [ $bite4, swampling_spit7 ] {swampling_spitacid(0.1);}; +void() swampling_spit7 = [ $bite5, swampling_spit8 ] {}; +void() swampling_spit8 = [ $bite6, swampling_spit9 ] {}; +void() swampling_spit9 = [ $bite7, swampling_run1 ] {}; + +//====================================================================== +// BITE +//====================================================================== +void() swampling_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESWAMPLING)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_VOICE, "swampling/attackmunch.wav", TRUE, TRUE); + else sound(self, CHAN_VOICE, "swampling/attacktear.wav", TRUE, TRUE); + + // Check for poisonous attribute (new poison version) + if (self.poisonous) PoisonDeBuff(self.enemy); + + // swampling bite is very weak + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn some touch blood + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() swampling_bite1 =[ $bite1, swampling_bite2 ] {ai_face();}; +// Start bite attack loop +void() swampling_bite2 =[ $bite2, swampling_bite3 ] {ai_face();}; +void() swampling_bite3 =[ $bite3, swampling_bite4 ] {ai_face();}; +void() swampling_bite4 = [ $bite4, swampling_bite5 ] {swampling_melee();}; +void() swampling_bite5 = [ $bite5, swampling_bite6 ] {}; +void() swampling_bite6 =[ $bite6, swampling_bite7 ] { + if (ai_checkmelee(MONAI_MELEESWAMPLING) && self.enemy.health > 0) self.think = swampling_bite2;}; +// Exit bite attack loop +void() swampling_bite7 =[ $bite7, swampling_run1 ] {}; + +//============================================================================ +// JUMP FUNCTION (range) +//============================================================================ +void() swampling_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other swamplings with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the swampling floating in the air? + if (!checkbottom(self)) { + // Is the swampling standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() swampling_leap1 =[ $jump1, swampling_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + monster_idle_sound(); +}; +void() swampling_leap2 =[ $jump2, swampling_leap3 ] {ai_face();}; +void() swampling_leap3 =[ $jump3, swampling_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = swampling_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPSWAMPLINGDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() swampling_leap4 =[ $jump4, swampling_leap5 ] {}; +void() swampling_leap5 =[ $jump5, swampling_leap6 ] {}; +void() swampling_leap6 =[ $jump6, swampling_leap7 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = swampling_leap3; + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() swampling_leap7 =[ $jump3, swampling_leap8 ] {monster_footstep(FALSE);}; +void() swampling_leap8 =[ $jump2, swampling_leap9 ] {monster_footstep(FALSE);}; +void() swampling_leap9 =[ $jump1, swampling_run1 ] {ai_resetangles();}; + +//====================================================================== +// CEILING swamplingS - Idle/Drop/Touch/Land functions +//====================================================================== +void() swampling_idleup1 =[ $idleup1, swampling_idleup2] {monster_idle_sound();ai_stand();}; +void() swampling_idleup2 =[ $idleup2, swampling_idleup3] {ai_stand();}; +void() swampling_idleup3 =[ $idleup3, swampling_idleup4] {ai_stand();}; +void() swampling_idleup4 =[ $idleup4, swampling_idleup5] {ai_stand();}; +void() swampling_idleup5 =[ $idleup5, swampling_idleup6] {ai_stand();}; +void() swampling_idleup6 =[ $idleup6, swampling_idleup1] {ai_stand();}; + +//---------------------------------------------------------------------- +void() swampling_droptouch = +{ + // Check if landed on something that is not the ground? + if (!checkbottom(self)) { + // Is the swampling standing on something? + if (self.flags & FL_ONGROUND) { + self.flags = self.flags - FL_ONGROUND; + self.origin_z = self.origin_z + 8; + setorigin(self, self.origin); // raise up + self.attack_timer = time + 1; // reset timer + + makevectors (self.angles); + self.velocity = v_forward * 100 + '0 0 200'; + } + return; + } + + // No more flying, back to running + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setsize(self, self.bbmins, self.bbmaxs); + + // Reset view offset (based on bbox height) + self.view_ofs = '0 0 0'; + self.view_ofs_z = self.maxs_z*0.5; + + self.touch = SUB_Null; // No more jump touching + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + + // Restore all think state functions (swampling is off the ceiling) + self.th_stand = swampling_idle1; + self.th_walk = swampling_walk1; + self.th_run = swampling_run1; + self.th_slide = swampling_slide1; + self.th_melee = swampling_bite1; + + // swampling 1 and 2 have different range attacks + if (self.spawnflags & MON_SWAMPLING_LARGE) self.th_missile = swampling_spit1; + else self.th_jump = swampling_leap1; + + // Back to running or standing around! + if (!self.enemy) self.think = self.th_stand; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() swampling_drop1 =[ $drop1, swampling_drop2 ] {}; +void() swampling_drop2 =[ $drop2, swampling_drop3 ] {}; +void() swampling_drop3 =[ $drop3, swampling_drop4 ] {}; +void() swampling_drop4 =[ $drop4, swampling_drop5 ] {}; +void() swampling_drop5 =[ $drop5, swampling_drop5 ] { + if (self.attack_timer < time || self.velocity_z == 0) swampling_droptouch(); +}; + +//---------------------------------------------------------------------------- +void() swampling_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // Only call wakeup function once + self.th_walk = self.th_run = self.th_slide = SUB_Null; + + // No longer need cling to ceiling spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_SWAMPLING_CEILING); + + self.flags = FL_MONSTER; // reset flags + + if (engine == ENG_FITZ) self.origin_z = self.origin_z - 8; + else self.origin_z = self.origin_z - 32; // Unstick from ceiling + setorigin(self, self.origin); // Move down slightly + + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.solid = SOLID_SLIDEBOX; + self.attack_timer = time + 1; // Stuck timer + + self.classmove = MON_MOVEWALK; // Back to walking/running + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + + makevectors (self.angles); // Move towards face direction + self.velocity = v_forward * 50; // Slight nudge forward + + self.touch = swampling_droptouch; // Touch something? + if (!self.jump_flag) + self.jump_flag = time + 1 + random()*2; // Don't jump straight away + swampling_drop1(); // Turn around, cat tricks! +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() swampling_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() swampling_grow1 = [ $grow1, swampling_grow2 ] {}; +void() swampling_grow2 = [ $grow2, swampling_grow3 ] {swampling_growangle();}; +void() swampling_grow3 = [ $grow3, swampling_grow4 ] {swampling_growangle();}; +void() swampling_grow4 = [ $grow4, swampling_grow5 ] {swampling_growangle();}; +void() swampling_grow5 = [ $grow5, swampling_grow6 ] {swampling_growangle();}; +void() swampling_grow6 = [ $grow6, swampling_grow7 ] {swampling_growangle();}; +void() swampling_grow7 = [ $grow7, swampling_grow8 ] {swampling_growangle();}; +void() swampling_grow8 = [ $grow8, swampling_grow9 ] {swampling_growangle();}; +void() swampling_grow9 = [ $grow9, swampling_grow10] {swampling_growangle();}; +void() swampling_grow10= [ $grow10, swampling_run1 ] { + // Is the swampling stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = swampling_idle1; + self.th_walk = swampling_walk1; + self.th_run = swampling_run1; + self.th_slide = swampling_slide1; + self.th_melee = swampling_bite1; + // swampling 1 and 2 have different range attacks + if (self.spawnflags & MON_SWAMPLING_LARGE) self.th_missile = swampling_spit1; + else { + self.th_jump = swampling_leap1; + self.th_jumpexit = swampling_leap7; + } + } +}; +//---------------------------------------------------------------------------- +void() swampling_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + swampling_grow1(); +}; + +//============================================================================ +void() swampling_pain1 =[ $pain1, swampling_pain2 ] {}; +void() swampling_pain2 =[ $pain2, swampling_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) swampling_pain = +{ + // Has the swampling been hit while on the ceiling? + if (self.spawnflags & MON_SWAMPLING_CEILING) { + self.pain_finished = time + 1; + swampling_wakeup(); + return; + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1) swampling_pain1(); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.2; + self.axhitme = 0; + swampling_pain1(); + } + } +}; + +//============================================================================ +void() swampling_die1 =[ $death1, swampling_die2 ] {}; +void() swampling_die2 =[ $death2, swampling_die3 ] {monster_check_gib();}; +void() swampling_die3 =[ $death3, swampling_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() swampling_die4 =[ $death4, swampling_die5 ] {}; +void() swampling_die5 =[ $death5, swampling_die6 ] {monster_death_postcheck();}; +void() swampling_die6 =[ $death6, swampling_die6 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() swampling_dieB1 =[ $deathB1, swampling_dieB2 ] {}; +void() swampling_dieB2 =[ $deathB2, swampling_dieB3 ] {monster_check_gib();}; +void() swampling_dieB3 =[ $deathB3, swampling_dieB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() swampling_dieB4 =[ $deathB4, swampling_dieB5 ] {}; +void() swampling_dieB5 =[ $deathB5, swampling_dieB6 ] {}; +void() swampling_dieB6 =[ $deathB6, swampling_dieB7 ] {monster_death_postcheck();}; +void() swampling_dieB7 =[ $deathB7, swampling_dieB7 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() swampling_die = +{ + // swamplings are small, gibs don't bounce far + self.max_health = MON_NOGIBVELOCITY; + + // Has the swampling died while on the ceiling? + if (self.spawnflags & MON_SWAMPLING_CEILING) + self.gibondeath = TRUE; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "swampling/death.wav", 1, ATTN_NORM); + if (random() < 0.6) swampling_die1(); + else swampling_dieB1(); + } +}; + +/*====================================================================== +/*QUAKED monster_swampling (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() monster_swampling = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_SWAMPLING_LARGE) { + self.mdl = "progs/ad171/mon_swamplingp.mdl"; + self.gib1mdl = "progs/ad171/gib_swamplegp.mdl"; // Single Leg + } + else { + self.mdl = "progs/ad171/mon_swampling.mdl"; + self.gib1mdl = "progs/ad171/gib_swampleg.mdl"; // Single Leg + } + + precache_model (self.mdl); + precache_model (self.gib1mdl); + precache_model (MODEL_PROJ_SWAMP); // Spit Projectile + + // IDLE/COMBAT and SIGHT sounds + self.idle_sound = "swampling/idle1.wav"; + self.idle_sound2 = "swampling/idle3.wav"; + self.idle_soundcom = "swampling/idle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + // death/pain/attack sounds + precache_sound("swampling/death.wav"); + self.pain_sound = "swampling/pain3.wav"; + precache_sound(self.pain_sound); + + precache_sound("swampling/miss.wav"); // Spit misses + precache_sound("swampling/spit4.wav"); // Spit attack + precache_sound("swampling/attackmunch.wav"); + precache_sound("swampling/attacktear.wav"); + precache_sound("swampling/jumpland.wav"); + + self.sight_sound = "swampling/sight2.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.steptype = FS_TYPELIGHT; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '20 0 0'; // Bite attack offset + self.attack_offset = '14 0 8'; // Used by large swampling, at jaws + self.movespeed = 1; // Can never be a turret + self.poisonous = TRUE; // Always poisonous + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was bitten by a Swampling\n"; + + self.th_checkattack = SwamplingCheckAttack; + self.th_pain = swampling_pain; + self.th_die = swampling_die; + + self.classtype = CT_MONSWAMPLING; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + // Setup light/dark green swampling difference + if (self.spawnflags & MON_SWAMPLING_LARGE) { + if (self.health < 1) self.health = 60; + self.gibhealth = -25; + self.th_missile = swampling_spit1; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = swampling_leap1; + self.th_jumpexit = swampling_leap7; + } + + //---------------------------------------------------------------------- + // Ceiling swamplings have special idle animation + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SWAMPLING_CEILING) { + self.th_stand = self.th_walk = swampling_idleup1; + self.th_run = self.th_slide = swampling_wakeup; + self.th_melee = self.th_missile = self.th_jump = swampling_wakeup; + // th_pain and th_die functions understand ceiling swamplings + } + // Default swampling behaviour functions + else { + self.th_stand = swampling_idle1; + self.th_walk = swampling_walk1; + self.th_run = swampling_run1; + self.th_melee = swampling_bite1; + self.th_slide = swampling_slide1; + } + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_tarbaby.qc b/QC_other/QC_keep/mon_tarbaby.qc new file mode 100644 index 00000000..6847a05b --- /dev/null +++ b/QC_other/QC_keep/mon_tarbaby.qc @@ -0,0 +1,272 @@ +/*============================================================================== +BLOB (annoying) +==============================================================================*/ +$cd id1/models/tarbaby +$origin 0 0 24 +$base base + +$skin skin + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 +$frame walk20 walk21 walk22 walk23 walk24 walk25 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13 +$frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23 +$frame run24 run25 + +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +$frame fly1 fly2 fly3 fly4 + +$frame exp + +void() tbaby_jump1; +void() tbaby_jump5; + +//============================================================================ +void() tbaby_stand1 =[ $walk1, tbaby_stand2 ] {ai_stand();}; +void() tbaby_stand2 =[ $walk2, tbaby_stand3 ] {ai_stand();}; +void() tbaby_stand3 =[ $walk3, tbaby_stand4 ] {ai_stand();}; +void() tbaby_stand4 =[ $walk4, tbaby_stand5 ] {ai_stand();}; +void() tbaby_stand5 =[ $walk5, tbaby_stand6 ] {ai_stand(); +self.nextthink = 0.1 + random()*0.3;}; +void() tbaby_stand6 =[ $walk4, tbaby_stand7 ] {ai_stand();}; +void() tbaby_stand7 =[ $walk3, tbaby_stand8 ] {ai_stand();}; +void() tbaby_stand8 =[ $walk2, tbaby_stand1 ] {ai_stand(); +self.nextthink = 0.1 + random()*0.3;}; + +void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();}; + +//============================================================================ +void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();monster_idle_sound();}; +void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();}; +void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();}; +void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();}; +void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();}; +void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_turn();}; +void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_turn();}; +void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_turn();}; +void() tbaby_walk9 =[ $walk9, tbaby_walk10] {ai_turn();}; +void() tbaby_walk10=[ $walk10, tbaby_walk11] {ai_turn();}; +void() tbaby_walk11=[ $walk11, tbaby_walk12] {ai_walk(2);}; +void() tbaby_walk12=[ $walk12, tbaby_walk13] {ai_walk(2);}; +void() tbaby_walk13=[ $walk13, tbaby_walk14] {ai_walk(2);}; +void() tbaby_walk14=[ $walk14, tbaby_walk15] {ai_walk(2);}; +void() tbaby_walk15=[ $walk15, tbaby_walk16] {ai_walk(2);}; +void() tbaby_walk16=[ $walk16, tbaby_walk17] {ai_walk(2);}; +void() tbaby_walk17=[ $walk17, tbaby_walk18] {ai_walk(2);}; +void() tbaby_walk18=[ $walk18, tbaby_walk19] {ai_walk(2);}; +void() tbaby_walk19=[ $walk19, tbaby_walk20] {ai_walk(2);}; +void() tbaby_walk20=[ $walk20, tbaby_walk21] {ai_walk(2);}; +void() tbaby_walk21=[ $walk21, tbaby_walk22] {ai_walk(2);}; +void() tbaby_walk22=[ $walk22, tbaby_walk23] {ai_walk(2);}; +void() tbaby_walk23=[ $walk23, tbaby_walk24] {ai_walk(2);}; +void() tbaby_walk24=[ $walk24, tbaby_walk25] {ai_walk(2);}; +void() tbaby_walk25=[ $walk25, tbaby_walk1 ] {ai_walk(2);}; + +//============================================================================ +void() tbaby_run1 =[ $run1, tbaby_run2 ] {ai_face();}; +void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();}; +void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();}; +void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();}; +void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();}; +void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();}; +void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_face();}; +void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_face();}; +void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_face();}; +void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_face();}; +void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);}; +void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(2);}; +void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(2);}; +void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(2);}; +void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_run(2);}; +void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_run(2);}; +void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);}; +void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(2);}; +void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(2);}; +void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(2);}; +void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(2);}; +void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);}; +void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);}; +void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(2);}; +void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(2);}; + +//============================================================================ +void() Tar_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + + if (other.takedamage && other.classname != self.classname) { + if ( vlen(self.velocity) > 400 ) { + ldmg = 10 + 10*random(); + // Can only poison the player + if (other.flags & FL_CLIENT && self.poisonous) { + // Check if player is posioned already? + if (other.poisoned) T_Damage (other, self, self, ldmg * 0.25, DAMARMOR); + // Make sure player is posioned + else PoisonDeBuff(other); + } + // Everything else gets the usual tarbaby thump! + else T_Damage (other, self, self, ldmg, DAMARMOR); + sound (self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM); + } + } + else + sound (self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); + + // Is the tarbaby floating in the air? + if (!checkbottom(self)) { + // Is the tarbaby standing on something? + if (self.flags & FL_ONGROUND) { + self.touch = SUB_Null; + self.think = tbaby_run1; + self.movetype = MOVETYPE_STEP; + self.nextthink = time + 0.1; + } + return; // not on ground yet + } + + self.touch = SUB_Null; + if (self.spawnflags & MON_TARBYLESSJUMP) { + // RRP - Ijed (reduce constant jumping around like id version) + // Skill percentage Easy 0% = never jump, Nightmare 60% = good chance + if (random() > skill / 5) self.think = tbaby_run1; + else self.think = tbaby_jump1; + } + // Original ID behaviour, constantly jump around like crazy + else self.think = self.th_jump; + self.nextthink = time + 0.1; +}; + +//============================================================================ +void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {}; +void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {}; +void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {}; +void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] { + self.cnt = self.cnt + 1; + if (self.cnt == 4) { + tbaby_jump5 (); + } +}; + +//============================================================================ +void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();}; +void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();}; +void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();}; +void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();}; +void() tbaby_jump5 =[ $jump5, tbaby_jump6 ] +{ + self.movetype = MOVETYPE_BOUNCE; + self.touch = Tar_JumpTouch; + makevectors (self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * 600 + '0 0 200'; + self.velocity_z = self.velocity_z + random()*150; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.cnt = 0; +}; +void() tbaby_jump6 =[ $jump6, tbaby_fly1 ] {}; + +//============================================================================ +void(entity inflictor, entity attacker, float damage) tbaby_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + } +}; + +//============================================================================= +void() tbaby_die1 =[ $exp, tbaby_die2 ] {}; +void() tbaby_die2 =[ $exp, tbaby_run1 ] { + // Tarbabies explode when they die + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + sound (self, CHAN_BODY, "blob/death1.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); // Hard coded explosion + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + // Sprite explosion for Fitz engines + // Check for DP particle system as visuals is done with TE_TAREXPLOSION + if (!ext_dppart) SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + else sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + // Hide monster, do not remove, still playing sound + entity_hide(self); +}; + +//---------------------------------------------------------------------- +void() tbaby_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + self.takedamage = DAMAGE_NO; + tbaby_die1(); +}; + +//============================================================================= +//QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush x Lessjump +//============================================================================= +void() monster_tarbaby = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_tarbaby.mdl"; + self.headmdl = string_null; + precache_model (self.mdl); + + self.idle_sound = "blob/sight1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = self.idle_sound; + self.pain_sound = self.idle_sound; + + precache_sound ("blob/death1.wav"); + + precache_sound ("blob/hit1.wav"); + precache_sound ("blob/land1.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 80; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 20; + + // Allow for extra functionality (death damage and poison) + if (self.death_dmg < 1) self.death_dmg = DAMAGE_TARBABY; + if (self.poisonous < 1) self.poisonous = FALSE; + else self.poisonous = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was slimed by a Spawn\n"; + + self.th_checkattack = SpawnCheckAttack; + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + self.th_jump = tbaby_jump1; + self.th_melee = tbaby_jump1; + self.th_pain = tbaby_pain; + self.th_die = tbaby_die; + + self.classtype = CT_MONSPAWN; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_tarbabymitosis.qc b/QC_other/QC_keep/mon_tarbabymitosis.qc new file mode 100644 index 00000000..ad754c9b --- /dev/null +++ b/QC_other/QC_keep/mon_tarbabymitosis.qc @@ -0,0 +1,106 @@ +void(entity inflictor, entity attacker, float damage) tbaby_mitosis; + +void() tbaby_checknew = { + if (!walkmove(0,0)) { remove(self); return; } + + self.enemy = self.enemy; + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + self.th_missile = tbaby_jump1; + self.th_melee = tbaby_jump1; + self.th_die = tbaby_die1; + self.origin_z = self.origin_z + 1; // raise off floor a bit + droptofloor(); + + if (!walkmove(0,0)) { self.owner.th_pain = tbaby_mitosis; remove(self); return; } + + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + if (!self.yaw_speed) self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + self.use = monster_use; + self.flags = self.flags | FL_MONSTER; + if (self.deathstring == "") self.deathstring = " was slimed by a Fresh Spawn\n"; + self.pausetime = 99999999; + self.th_stand (); + self.nextthink = self.nextthink + random()*0.5; + total_monsters = total_monsters + 1; + + WriteByte (MSG_BROADCAST, SVC_UPDATESTAT); + WriteByte (MSG_BROADCAST, STAT_TOTALMONSTERS); + WriteLong (MSG_BROADCAST, total_monsters); +}; + +void(entity inflictor, entity attacker, float damage) tbaby_mitosis = { + local entity newSpawn; + + if ( random() < 0.35 ) { + newSpawn = spawn(); + newSpawn.classname = self.classname; + newSpawn.movetype = MOVETYPE_STEP; + setsize (newSpawn, '-16 -16 -24', '16 16 40'); + newSpawn.health = 80; + //if (self.skin == 1) + //newSpawn.health = 60; + //else if (self.skin == 2) + newSpawn.health = 100; + + newSpawn.owner = self; + self.th_pain = SUB_Null_pain; + setmodel (newSpawn, self.owner.mdl); + newSpawn.solid = SOLID_SLIDEBOX; + newSpawn.skin = self.skin; + setorigin (newSpawn, self.origin); + newSpawn.think = tbaby_checknew; + newSpawn.nextthink = time + 0.5; + sound (newSpawn, CHAN_VOICE, "blob/mytosis.wav", 1, ATTN_NORM); + } +}; + +void() monster_tarbaby_mitosis = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/mon_tarbaby.mdl"; + self.headmdl = string_null; + precache_model (self.mdl); + self.idle_sound = "blob/sight1.wav"; + precache_sound (self.idle_sound); + self.sight_sound = self.idle_sound; + self.pain_sound = self.idle_sound; + precache_sound ("blob/death1.wav"); + precache_sound ("blob/hit1.wav"); + precache_sound ("blob/land1.wav"); + precache_sound ("blob/sight1.wav"); + precache_sound ("blob/mytosis.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 100; + if (self.skin < 0) self.skin = 1; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; + self.pain_flinch = 20; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was slimed by a Mitosis Spawn\n"; + + self.th_checkattack = SpawnCheckAttack; + self.th_stand = tbaby_stand1; + self.th_walk = tbaby_walk1; + self.th_run = tbaby_run1; + self.th_jump = tbaby_jump1; + self.th_melee = tbaby_jump1; + self.th_pain = tbaby_mitosis; + self.th_die = tbaby_die; + + self.classtype = CT_MONSPAWN; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_trog.qc b/QC_other/QC_keep/mon_trog.qc new file mode 100644 index 00000000..9225d2f3 --- /dev/null +++ b/QC_other/QC_keep/mon_trog.qc @@ -0,0 +1,910 @@ +/* +============================================================================ + +NEMESANT +(Zerstorer's Troglodyte. Also the original Qtest shal-rath.) + +============================================================================ +*/ + +$cd /progs/nemesant +$origin 0 0 24 +$base base +$skin skin + +$frame float1 float2 float3 float4 float5 float6 float7 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 attack14 attack15 + +$frame attackb1 attackb2 attackb3 attackb4 attackb5 attackb6 attackb7 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 +$frame death10 death11 death12 death13 death14 death15 death16 death17 + +$frame decap1 decap2 decap3 decap4 decap5 decap6 decap7 decap8 decap9 +$frame decap10 decap11 decap12 decap13 decap14 decap15 decap16 decap17 + + +//========================================================================== +// Warp Magic + +// Update 6/2/09: Circles and Explosion moved to fx.qc. +// Used by multiple effects. + +// Copied from Zerstorer code. +void() DoCircles = { +local vector startpos, drag, dragto; +local float delta; + +// Update 6/6/10: Fizzle check. +// Assumes the nemesant is the attacker. If not, change the conditions! + if (( self.owner.frame >= $pain1 ) || (self.owner.health < 1)) { + // The spell fizzles! + super_active = 0; + sound (self, CHAN_WEAPON, SOUND_EMPTY, 1, ATTN_NORM); + if (self.trigger_field) // Remove the explosion entity. + remove (self.trigger_field); + remove (self); + return; + } + + delta = self.count * 3; + if (self.dmg == 1) { + startpos = self.origin + '0 0 24'; + setorigin (self, self.origin + '0 0 8'); + } else { + startpos = self.origin - '0 0 24'; + setorigin (self, self.origin - '0 0 8'); + } + DrawCircleXY(self.origin, 84 - delta, 105); + DrawCircleXY(startpos, 64 - delta, 232); + self.count = self.count - self.dmg; + if (self.count == 6) { + super_active = 0; // Done spamming particles. + remove (self); + return; + } + if (self.count == 0) + self.dmg = -1; + if (vlen(self.enemy.origin - self.origin) <= 250) { + dragto = self.origin; + dragto_z = self.enemy.origin_z; + drag = normalize (dragto - self.enemy.origin); + drag = drag*250; + self.enemy.velocity = self.enemy.velocity + drag; + } + + self.nextthink = time + 0.12; +}; + +void() TrogWarpMagic = { +// Moved all explosion effects into a separate function so other code +// can use it. + WarpExplosion (); + +// Damage stuff from the circle magic. + if (self.enemy) { + T_RadiusDamage (self, self.owner, 120, self.owner, DAMAGEALL); + if (vlen(self.enemy.origin - self.origin) <= 120) { + //- - - - - - - - - + // For those immune to splash damage, inflict minor damage. + // This is not unlike a Doom2 arch-vile vs. cyberdemon matchup. + if (self.enemy.xfl & XFL_FIREANGEL) + if (self.enemy != self.owner) + T_Damage (self.enemy, self, self.owner, 20, DAMARMOR); + //- - - - - - - - - + if (self.enemy.mass && (self.enemy.mass <= MASS_SUPER)) + { + self.enemy.flags = self.enemy.flags - (self.enemy.flags & FL_ONGROUND); + self.enemy.velocity_x = (random() * 400) - 200; + self.enemy.velocity_y = (random() * 400) - 200; + self.enemy.velocity_z = (random() * 300) + 400; + if (self.enemy.mass == MASS_SUPER) + self.enemy.velocity = self.enemy.velocity * 0.5; + } + } + } +}; + +void() StartTrogMagic = +{ +// ** Mutual exclusion for trog magic attack so that we +// don't overflow space! + super_active = 1; // Global defined in defs*.qc. + + local entity Mcircle, Tboom; + local vector spot; + +// Particle circle drawing entity. + spot = self.enemy.origin - '0 0 12'; + Mcircle = spawn(); + Mcircle.movetype = MOVETYPE_NONE; + Mcircle.solid = SOLID_NOT; + Mcircle.owner = self; + Mcircle.count = 5; + Mcircle.dmg = 1; + Mcircle.enemy = self.enemy; + Mcircle.touch = SUB_Null; + Mcircle.nextthink = time + 0.01; + Mcircle.think = DoCircles; +// setmodel (Mcircle, ""); +// setsize (Mcircle, '0 0 0', '0 0 0'); + setorigin (Mcircle, spot); + sound (Mcircle, CHAN_WEAPON, "nemesant/charge.wav", 1, ATTN_NORM); + +// Explosion entity. + spot = self.enemy.origin + '0 0 24'; + Tboom = spawn(); + Tboom.movetype = MOVETYPE_NONE; + Tboom.solid = SOLID_NOT; + Tboom.owner = self; + Tboom.enemy = self.enemy; +// Tboom.angles = VEC_ORIGIN; + Tboom.touch = SUB_Null; + Tboom.nextthink = time + 1.1; + Tboom.think = TrogWarpMagic; +// setmodel (Tboom, ""); +// setsize (Tboom, '0 0 0', '0 0 0'); + setorigin (Tboom, spot); + +// Link the two together. + Mcircle.trigger_field = Tboom; +}; + + +//========================================================================== +// Normal Attacks + +// Used by necromancer and nemesant to shove an enemy away. +// Note: Skullwiz version use different velocity and damage methods. +void() ai_repel = +{ + if (!self.enemy) + return; // No one to attack. + if (!InMeleeRange (120)) + return; + if (!CanDamage (self.enemy, self)) + return; + + // Note: Different than Armagon's because we ignore elevation. + local vector dir; + + dir = self.enemy.origin; + dir_z = self.origin_z; // Only interested in xy-plane, so ignore z. + dir = normalize(dir - self.origin); + dir = dir * 1000; + dir_z = 120; // Add a little up to overcome normal gravity. +// Send the enemy flying. + if (self.enemy.mass && (self.enemy.mass <= MASS_SUPER)) + { + self.enemy.flags = self.enemy.flags - (self.enemy.flags & FL_ONGROUND); + self.enemy.velocity = self.enemy.velocity + dir; + } +// Do the damage. + sound (self, CHAN_WEAPON, "skullwiz/push.wav", 1, ATTN_NORM); + T_Damage (self.enemy, self, self, 20, DAMARMOR); +}; + +// Returns the point of one of its hands. +vector(float left) Nemesant_Hand = +{ + makevectors (self.angles); + if (left) // TRUE = use left hand, FALSE = use right hand. + return (self.origin + (v_forward*16) - (v_right*10) + (v_up*30)); + return (self.origin - (v_forward*16) + (v_right*12) + (v_up*45)); +}; + +// This sends a bolt of lightning at an enemy, similar to the shamblers'. +void() Nemesant_Bolt = +{ +// Assume not in water and don't check for discharge. + local vector p1, p2; + + p1 = Nemesant_Hand (TRUE); // This will call makevectors as well. + p2 = self.enemy.origin + '0 0 16'; + p2 = Maim_Line (p1, p2, 0, self.enemy, '0 0 0'); + p2 = p1 + p2*600; + + self.effects = self.effects | EF_MUZZLEFLASH; + + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + LightningBolt2 (p1, p2, self, 10); +}; + +//- - - - - - - - - +// Magic missile sidewinding tracking code. +void() nemes_track = +{ + if (self.delay <= time) + {remove (self); return;} + + local vector vec; // Multi-purpose vector. + local float up, old; + + up = (self.cnt & 7) * 45; + up = SUB_sin(up) * 5; // Other sidewinder code uses cosine. + self.cnt = self.cnt + 1; + + vec = self.enemy.origin + self.enemy.view_ofs; +// if (1) +// Sidewind_Go (vec + ('0 0 4' * up), self.speed); +// else + { // Alternate sidewinding code for more controlled spiraling. + vec = vectoangles(vec - self.origin); + //- - - - - - - - - - + old = self.angles_y; + self.ideal_yaw = vec_x + up; + self.angles_y = self.angles_x; + ChangeYaw (); + self.angles_x = self.angles_y; + self.angles_y = old; + //- - - - - - - - - - + self.ideal_yaw = vec_y + self.lefty; + ChangeYaw (); + if (MatchingIdeal ()) + self.lefty = 0 - self.lefty; + + vec = self.angles; + vec_x = 0 - vec_x; + makevectors (vec); + self.velocity = v_forward * self.speed; + } + + self.nextthink = time + 0.1; +}; + +// Spawns each magic missile launched by the nemesant. +void(float ofs, float up, vector vec) nemes_shot = +{ + hknight_shot(ofs); + setorigin (newmis, vec); + newmis.velocity = normalize(newmis.velocity) * 600; + if (self.enemy) + { // Setup for homing sidewinders. + newmis.enemy = self.enemy; + newmis.cnt = up; + newmis.lefty = ofs * 20; + newmis.speed = 450; + newmis.yaw_speed = 20; + newmis.delay = newmis.nextthink; + newmis.nextthink = time + 0.1; + newmis.think = nemes_track; + } +}; + +// Shoots a salvo of magic missiles at an enemy. +void() Nemesant_Missiles = +{ + local vector p1; + + p1 = Nemesant_Hand (TRUE); + self.effects = self.effects | EF_MUZZLEFLASH; +// Three shots, one per finger. Left, center, and right. +// Note: 2nd parm -- 0,2,4 for sin. 6,0,2 for cos. + nemes_shot(-1,0,p1); nemes_shot(0.5,2,p1); nemes_shot(1,4,p1); +}; +//- - - - - - - - - + +// Lobs its trademark bouncing seeker fireball. +// In Drake, more monsters copy and use this attack. +void() Nemesant_FireBall = {M_FireSmart ('16 12 45');}; + + +//========================================================================== +// Movement and Teleportation + +// PM: Teleport code mostly rewritten from the original. +void() tele_attack = +{ + local vector org, delta; + + delta = self.enemy.origin - self.origin; + if (vlen(delta) < 100) + return; // Too close to the enemy. + + org = self.origin; // Remember this point for fog spawning. + if (random() < 0.5) + { // Standard Zerstorer AI. + local vector enor; + + // Distance was originally 70, but thats too short vs. fat monsters. + // Dist = 70 vs. players, 90 vs. ogre/shambler, 110+ vs. even fatter. + delta_z = 0; // Ignore elevation difference. + delta = normalize(delta) * (self.enemy.maxs_x * 1.25 + 50); + enor = self.enemy.origin + '0 0 32'; + + // Aim behind target, and if that fails, aim in front of target. + if (!EntryPoint_Spawn (self, self.enemy, enor + delta, EntryPoint_One)) + if (!EntryPoint_Spawn (self, self.enemy, enor - delta, EntryPoint_One)) + return; + } + else + { // Custom -- teleport to random spot within range_near. + if (!EntryPoint_Spawn (self, self, org, EntryPoint_Random)) + return; + } +// Teleport is a success. + self.angles_y = vectoyaw(self.enemy.origin - self.origin); + if (!self.invisible_finished) + { // Fog only if visible. + spawn_tfog (org); // Before + spawn_tfog (self.origin); // After + } + // Zerstorer has after first, before second. + + // Replaced 'super_*' with 'waitmax' because monsters use powerups. + self.waitmax = time + 2; + self.attack_finished = 0; // PM: This lets mage attack now. +}; + +void() check_tele = +{ +local entity head; + + if (!self.enemy) + return; + if (self.enemy.health <= 0) + return; + if (self.waitmax > time) + return; + + head = findradius(self.origin, 150); + while (head) + { +//- - - - - - - - - + // Update: Drake uses self.master for true ownership, since + // reflection code changes owner when used. + if (head.master == self.enemy) + if (IsMissile (head)) + {tele_attack(); return;} +//- - - - - - - - - + head = head.chain; + } +}; + + +//========================================================================== +// Frames + +void() nemes_idlesound = +{ + if (self.waitmin < time) + { + local float wr; + + // Use voice channel instead of auto -- don't want slain magi talking. + wr = random(); + if (wr > 0.7) + sound (self, CHAN_VOICE, "nemesant/tidle1.wav", 1, ATTN_NORM); + else if (wr < 0.3) + sound (self, CHAN_VOICE, "nemesant/tidle2.wav", 1, ATTN_NORM); + self.waitmin = time + 10; + } +}; + +// STAND - - - - - - - - - - - - - - - - +void() nemes_stand1 =[ $float1, nemes_stand2 ] {ai_stand(); + if (!(self.spawnflags & 1)) // Chant ominously if not in ambush mode. + nemes_idlesound(); +}; +void() nemes_stand2 =[ $float2, nemes_stand3 ] {ai_stand();}; +void() nemes_stand3 =[ $float3, nemes_stand4 ] {ai_stand();}; +void() nemes_stand4 =[ $float4, nemes_stand5 ] {ai_stand();}; +void() nemes_stand5 =[ $float5, nemes_stand6 ] {ai_stand();}; +void() nemes_stand6 =[ $float6, nemes_stand7 ] {ai_stand();}; +void() nemes_stand7 =[ $float7, nemes_stand1 ] {ai_stand();}; + +// WALK - - - - - - - - - - - - - - - - +void() nemes_walk1 =[ $float1, nemes_walk2 ] {ai_walk(8); nemes_idlesound();}; +void() nemes_walk2 =[ $float2, nemes_walk3 ] {ai_walk(8);}; +void() nemes_walk3 =[ $float3, nemes_walk4 ] {ai_walk(8);}; +void() nemes_walk4 =[ $float4, nemes_walk5 ] {ai_walk(8);}; +void() nemes_walk5 =[ $float5, nemes_walk6 ] {ai_walk(8);}; +void() nemes_walk6 =[ $float6, nemes_walk7 ] {ai_walk(8);}; +void() nemes_walk7 =[ $float7, nemes_walk1 ] {ai_walk(8);}; + +// RUN - - - - - - - - - - - - - - - - - +void() nemes_side1 =[ $float1, nemes_side2 ] {ai_run(8); nemes_idlesound(); check_tele();}; +void() nemes_side2 =[ $float2, nemes_side3 ] {ai_run(8);}; +void() nemes_side3 =[ $float3, nemes_side4 ] {ai_run(8); check_tele();}; +void() nemes_side4 =[ $float4, nemes_side5 ] {ai_run(8);}; +void() nemes_side5 =[ $float5, nemes_side6 ] {ai_run(8); check_tele();}; +void() nemes_side6 =[ $float6, nemes_side7 ] {ai_run(8);}; +void() nemes_side7 =[ $float7, nemes_side1 ] {ai_run(8); check_tele();}; + +void() nemes_run1 =[ $float1, nemes_run2 ] {ai_run(16); nemes_idlesound(); check_tele();}; +void() nemes_run2 =[ $float2, nemes_run3 ] {ai_run(16);}; +void() nemes_run3 =[ $float3, nemes_run4 ] {ai_run(16); check_tele();}; +void() nemes_run4 =[ $float4, nemes_run5 ] {ai_run(16);}; +void() nemes_run5 =[ $float5, nemes_run6 ] {ai_run(16); check_tele();}; +void() nemes_run6 =[ $float6, nemes_run7 ] {ai_run(16);}; +void() nemes_run7 =[ $float7, nemes_run1 ] {ai_run(16); check_tele();}; + +// ATTACK - - - - - - - - - - - - - - - +void() TrogAttackFinished = +{ + if (self.attack_finished) // Repel hack -- set at zero bypasses delay. + SUB_AttackFinished (2); + if (enemy_range >= RANGE_MID || !enemy_vis) + {self.attack_state = AS_STRAIGHT; self.think = nemes_run1;} + else + {self.attack_state = AS_SLIDING; self.think = nemes_side1;} +}; + +void() nemes_fast1 =[ $attackb1, nemes_fast2 ] {ai_face();}; +void() nemes_fast2 =[ $attackb2, nemes_fast3 ] {ai_face();}; +void() nemes_fast3 =[ $attackb3, nemes_fast4 ] {ai_face();}; +void() nemes_fast4 =[ $attackb4, nemes_fast5 ] {ai_face();}; +void() nemes_fast5 =[ $attackb5, nemes_fast6 ] { + local float dist, boss, mask; + + ai_face(); + sound (self, CHAN_VOICE, "nemesant/frblatck.wav", 1, ATTN_NORM); + if (self.waitmin < time + 1) self.waitmin = time + 1; + + // The mage has more options when not bound by Zerstorer mode. + dist = vlen(self.enemy.origin - self.origin); + //zot = FALSE; + + // Update 6/6/10: Only the boss version can shoot lightning. + boss = FALSE; + if (self.classname != "monster_nemesant") boss = TRUE; + + //if (boss) + //if (IsGhost (self.enemy)) + // if ( !((dist > 600) || (self.h2olevel == 3)) ) + // zot = TRUE; + + // If TRUE, Only lightning is effective, at least in Drake. + //if (zot) { + //Nemesant_Bolt (); + //self.nextthink = time + 0.2; + //} else { + // Use standard book of tricks. + if ((dist <= 120) && (self.enemy.flags & FL_ONGROUND)) { + // Try to push enemy away from melee. + ai_repel (); + self.attack_finished = 0; // Don't delay for next attack. + } else { + // Use pattern like Dracula in Castlevania: SotN. + // Launch three fireballs then magic missiles. + // Update: Attack counter is shared by all. + mask = AddOne() & 3; + if (mask == 3) { + // Use magic missiles sometimes if enemy is not immune. + if (!(self.enemy.armortype == ARMOR_RED_TYPE)) { + Nemesant_Missiles (); + return; + } + } else if (!mask && boss) { + // The boss gets to shoot lightning every fourth shot. + // Must be inrange and out of the water. + if ( !((dist > 600) || (self.waterlevel == 3)) ) { + Nemesant_Bolt (); + self.nextthink = time + 0.2; + return; + } + } + Nemesant_FireBall (); // The original. + } + //} +}; +void() nemes_fast6 =[ $attackb6, nemes_fast7 ] {ai_face();}; +void() nemes_fast7 =[ $attackb2, nemes_fast8 ] {ai_face();}; +void() nemes_fast8 =[ $attackb1, nemes_run1 ] {ai_face(); TrogAttackFinished();}; + +// FIXME: Merge spark functions. Possibly with the yakmens' too. +void(vector st) nemes_sparks = +{ + local vector side; + + makevectors (self.angles); + side = v_right * st_y; + st = self.origin + v_forward*st_x + v_up*st_z; + particle (st + side, '0 0 50', 145, 10); + particle (st - side, '0 0 50', 145, 10); +}; +void() nemes_summon1 =[ $attack1, nemes_summon2 ] {ai_face(); nemes_sparks('0 35 22');}; +void() nemes_summon2 =[ $attack3, nemes_summon3 ] {ai_face(); nemes_sparks('-2 31 15');}; +void() nemes_summon3 =[ $attack5, nemes_summon4 ] {ai_face(); nemes_sparks('-14 30 15');}; +void() nemes_summon4 =[ $attack7, nemes_summon5 ] {ai_face(); nemes_sparks('-15 32 25');}; +void() nemes_summon5 =[ $attack9, nemes_summon6 ] {ai_face(); nemes_sparks('-15 31 28');}; +void() nemes_summon6 =[ $attack10, nemes_summon7 ] {ai_face(); nemes_sparks('12 27 30');}; +void() nemes_summon7 =[ $attack11, nemes_summon8 ] {ai_face(); nemes_sparks('22 3 30'); +// DISABLED -- Vores as part of this boss fight is harsh. +// if (!self.pets) +// if (random() < 0.5) +// if (self.health < (self.max_health / 2)) +// if (SpawnMonster (self, self.origin, ID_SHALRATH_CLASSIC, EntryPoint_Fan)) +// return; + + //if (self.pets < 3) + // SpawnMonster_Horde (ID_WIZARD_SCRAG, 3); + //else + //SpawnMonster_Horde (CT_MONWIZARD, 2); +}; +void() nemes_summon8 =[ $attack13, nemes_summon9 ] {ai_face();}; +void() nemes_summon9 =[ $attack14, nemes_summon10 ] {ai_face();}; +void() nemes_summon10 =[ $attack15, nemes_run1 ] {ai_face(); TrogAttackFinished();}; + +void(vector st) nemes_sparks2 = +{ + local vector side; + + makevectors (self.angles); + side = v_right * st_y; + st = self.origin + v_forward*st_x + v_up*st_z; + particle (st + side, '0 0 50', 241, 10); + particle (st - side, '0 0 50', 241, 10); +}; +void() nemes_inviso1 =[ $attack1, nemes_inviso2 ] {ai_face(); nemes_sparks2('0 35 22');}; +void() nemes_inviso2 =[ $attack3, nemes_inviso3 ] {ai_face(); nemes_sparks2('-2 31 15');}; +void() nemes_inviso3 =[ $attack5, nemes_inviso4 ] {ai_face(); nemes_sparks2('-14 30 15');}; +void() nemes_inviso4 =[ $attack7, nemes_inviso5 ] {ai_face(); nemes_sparks2('-15 32 25');}; +void() nemes_inviso5 =[ $attack9, nemes_inviso6 ] {ai_face(); nemes_sparks2('-15 31 28');}; +void() nemes_inviso6 =[ $attack10, nemes_inviso7 ] {ai_face(); nemes_sparks2('12 27 30');}; +void() nemes_inviso7 =[ $attack11, nemes_inviso8 ] {ai_face(); nemes_sparks2('22 3 30'); + sound (self, CHAN_VOICE, "nemesant/frblatck.wav", 1, ATTN_NORM); + spawn_tfog (self.origin); + self.invisible_finished = time + 10; +}; +void() nemes_inviso8 =[ $attack13, nemes_inviso9 ] {ai_face();}; +void() nemes_inviso9 =[ $attack14, nemes_inviso10 ] {ai_face();}; +void() nemes_inviso10 =[ $attack15, nemes_run1 ] {ai_face(); TrogAttackFinished();}; + +void() nemes_sboom1 =[ $attack1, nemes_sboom2 ] {ai_face();}; +void() nemes_sboom2 =[ $attack2, nemes_sboom3 ] {ai_face();}; +void() nemes_sboom3 =[ $attack3, nemes_sboom4 ] {ai_face();}; +void() nemes_sboom4 =[ $attack4, nemes_sboom5 ] +{ ai_face(); + if (super_active) // Someone else started it first -- use alt. instead. + {self.think = nemes_fast1; return;} + StartTrogMagic(); +}; +void() nemes_sboom5 =[ $attack5, nemes_sboom6 ] {ai_face();}; +void() nemes_sboom6 =[ $attack6, nemes_sboom7 ] {ai_face();}; +void() nemes_sboom7 =[ $attack7, nemes_sboom8 ] {ai_face();}; +void() nemes_sboom8 =[ $attack8, nemes_sboom9 ] {ai_face();}; +void() nemes_sboom9 =[ $attack9, nemes_sboom10 ] {ai_face();}; +void() nemes_sboom10 =[ $attack10, nemes_sboom11 ] {ai_face();}; +void() nemes_sboom11 =[ $attack11, nemes_sboom12 ] {ai_face();}; +void() nemes_sboom12 =[ $attack12, nemes_sboom13 ] {ai_face();}; +void() nemes_sboom13 =[ $attack13, nemes_sboom14 ] {ai_face();}; +void() nemes_sboom14 =[ $attack14, nemes_sboom15 ] {ai_face();}; +void() nemes_sboom15 =[ $attack15, nemes_run1 ] {ai_face(); TrogAttackFinished();}; + +void() Nemesant_Attack = +{ +// Boss version has other tricks it can use. + if (self.xfl & XFL_BOSS) + if (random() < 0.5) + { + // If hurt badly enough, cast invisibility sometimes. + if (!self.invisible_finished) + if (self.health <= self.max_health / 2) + if (random() < 0.5) + {nemes_inviso1 (); return;} + // Summon monsters to fight. + if (self.count <= 1) + {nemes_summon1 (); return;} + } +//- - - - - - - - - +// Use quick attack instead of super attack if... +// 1) Someone is using super attack now (only one at a time, please). +// 2) Enemy is off the ground (player gets sucked in unfairly). +// 3) Enemy is invisible (mage cannot pinpoint enemy). +// NOTE: Zerstorer didn't check for invisibility. +// +// If super attack is available, always use it if nothing else can hurt +// the enemy, which includes ghosts and zombies. +// +// Assuming no special conditions, chances of attack paths are as follows. +// 70% chance of A -- fast magic +// 30% chance of B -- super magic +//- - - - - - - - - + local float fast; + + if ((random() < 0.7) || !(self.enemy.flags & FL_ONGROUND) + || self.enemy.form_active || super_active + || (self.enemy.items & IT_INVISIBILITY) || self.enemy.invisible_finished) + { + fast = 1; + // Allow exceptions if nothing else is effective. + if (!super_active) + { + if (self.enemy.classname == "monster_zombie") + fast = 0; + //else if (IsGhost (self.enemy)) + // fast = 0; + // FIXME: Should we add reflection too? + } + } + else + fast = 0; + + if (fast) + nemes_fast1 (); + else + nemes_sboom1 (); +}; + +// PAIN - - - - - - - - - - - - - - - - +void() nemes_pain1 =[ $pain1, nemes_pain2 ] {}; +void() nemes_pain2 =[ $pain2, nemes_pain3 ] {}; +void() nemes_pain3 =[ $pain3, nemes_pain4 ] {}; +void() nemes_pain4 =[ $pain4, nemes_pain5 ] {}; +void() nemes_pain5 =[ $pain5, nemes_pain6 ] {}; +void() nemes_pain6 =[ $pain6, nemes_run1 ] {}; + +void(entity inflictor, entity attacker, float damage) nemes_pain = +{ + if (self.pain_finished > time) + return; + if (( self.frame >= $attack1 ) && ( self.frame <= $attack15 )) + { // Casting the big spell, so be resistant to pain like the arch-vile. + if (prandom() > 10) + return; // Failed to break its concentration. + } + + self.pain_finished = time + 0.5; + + sound (self, CHAN_VOICE, "nemesant/tpain.wav", 1, ATTN_NORM); + if (random()*70 > damage) + return; // didn't flinch + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + if (self.classname != "monster_nemesant") + { // Make boss versions harder to flinch and stunlock. + if (self.lip > time) + return; // Too soon to flinch. + self.lip = time + 2; + } + + self.attack_finished = 0; // So mage can counterattack after recovery. + nemes_pain1 (); + attacker = attacker; // FrikQcc warning squelch! +}; + +// DEATH - - - - - - - - - - - - - - - - +void() nemes_decap1 =[ $decap1, nemes_decap2 ] {blood_spray('0 0 28', 1); + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); +}; +void() nemes_decap2 =[ $decap2, nemes_decap3 ] {blood_spray('-4 -1 27', 2);}; +void() nemes_decap3 =[ $decap3, nemes_decap4 ] {blood_spray('-6 -1 26', 1); /*monster_drop();*/}; +void() nemes_decap4 =[ $decap4, nemes_decap5 ] {blood_spray('-8 -1 25', 1);}; +void() nemes_decap5 =[ $decap5, nemes_decap6 ] {blood_spray('-11 0 23', 1);}; +void() nemes_decap6 =[ $decap6, nemes_decap7 ] {}; +void() nemes_decap7 =[ $decap7, nemes_decap8 ] {}; +void() nemes_decap8 =[ $decap8, nemes_decap9 ] {}; +void() nemes_decap9 =[ $decap9, nemes_decap10 ] {}; +void() nemes_decap10 =[ $decap10, nemes_decap11 ] {}; +void() nemes_decap11 =[ $decap11, nemes_decap12 ] {}; +void() nemes_decap12 =[ $decap12, nemes_decap13 ] {}; +void() nemes_decap13 =[ $decap13, nemes_decap14 ] {}; +void() nemes_decap14 =[ $decap14, nemes_decap15 ] {}; +void() nemes_decap15 =[ $decap15, nemes_decap16 ] {}; +void() nemes_decap16 =[ $decap16, nemes_decap17 ] {}; +void() nemes_decap17 =[ $decap17, nemes_decap17 ] {}; + +void() nemes_death1 =[ $death1, nemes_death2 ] {}; +void() nemes_death2 =[ $death2, nemes_death3 ] {}; +void() nemes_death3 =[ $death3, nemes_death4 ] {/*monster_drop();*/}; +void() nemes_death4 =[ $death4, nemes_death5 ] {}; +void() nemes_death5 =[ $death5, nemes_death6 ] {}; +void() nemes_death6 =[ $death6, nemes_death7 ] {}; +void() nemes_death7 =[ $death7, nemes_death8 ] {}; +void() nemes_death8 =[ $death8, nemes_death9 ] {}; +void() nemes_death9 =[ $death9, nemes_death10 ] {}; +void() nemes_death10 =[ $death10, nemes_death11 ] {}; +void() nemes_death11 =[ $death11, nemes_death12 ] {}; +void() nemes_death12 =[ $death12, nemes_death13 ] {}; +void() nemes_death13 =[ $death13, nemes_death14 ] {}; +void() nemes_death14 =[ $death14, nemes_death15 ] {}; +void() nemes_death15 =[ $death15, nemes_death16 ] {}; +void() nemes_death16 =[ $death16, nemes_death17 ] {}; +void() nemes_death17 =[ $death17, nemes_death17 ] {}; + +//float(float dm) nemes_gib = +//{ +// if (self.health < self.gibhealth) +// { +// sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + // Zerstorer spawned gib2.mdl * 3. +// ThrowGib ("progs/gib1.mdl", dm); +// ThrowGib ("progs/gib2.mdl", dm); +// ThrowGib ("progs/gib3.mdl", dm); +// ThrowHead ("progs/h_nemes.mdl", dm); +// return TRUE; +// } +// return FALSE; +//}; + +void() nemes_die = +{ + //if (Shattered ()) + // return; + //if (Decapitated ()) + //{ + // monster_decap ('0 0 28', nemes_decap1); + // return; + //} +//- - - - - +// check for gib + //if (self.th_gib) + // if (nemes_gib (self.health)) + // return; + + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 200 + 100*random(); // PM: Used to be 300. + self.flags = self.flags - (self.flags & FL_ONGROUND); + if (random() < 0.5) + sound (self, CHAN_VOICE, "nemesant/tdeath1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "nemesant/tdeath2.wav", 1, ATTN_NORM); + nemes_death1 (); +}; + +// REVIVE - - - - - - - - - - - - - - - +void() nemes_revive1 =[ $death16, nemes_revive2 ] {self.flags = (self.flags - (self.flags & FL_ONGROUND)) | FL_FLY;}; +void() nemes_revive2 =[ $death15, nemes_revive3 ] {}; +void() nemes_revive3 =[ $death14, nemes_revive4 ] {}; +void() nemes_revive4 =[ $death13, nemes_revive5 ] {}; +void() nemes_revive5 =[ $death12, nemes_revive6 ] {}; +void() nemes_revive6 =[ $death11, nemes_revive7 ] {}; +void() nemes_revive7 =[ $death10, nemes_revive8 ] {}; +void() nemes_revive8 =[ $death9, nemes_revive9 ] {}; +void() nemes_revive9 =[ $death8, nemes_revive10 ] {}; +void() nemes_revive10 =[ $death7, nemes_revive11 ] {}; +void() nemes_revive11 =[ $death6, nemes_revive12 ] {}; +void() nemes_revive12 =[ $death5, nemes_revive13 ] {}; +void() nemes_revive13 =[ $death4, nemes_revive14 ] {}; +void() nemes_revive14 =[ $death3, nemes_revive15 ] {}; +void() nemes_revive15 =[ $death2, nemes_revive16 ] {}; +void() nemes_revive16 =[ $death1, nemes_run1 ] {}; + +// OTHER - - - - - - - - - - - - - - - - +void(float hello) nemes_sight = +{ + if (hello) + sound (self, CHAN_VOICE, "nemesant/tpain.wav", 1, ATTN_NORM); + else + { + if (random() < 0.5) + sound (self, CHAN_VOICE, "nemesant/tsight1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "nemesant/tsight2.wav", 1, ATTN_NORM); + } + + if (self.waitmin < time + 2) + self.waitmin = time + 2; +}; + +//============ +// --> QUAKED monster_nemesant (1 0 0) (-16 -16 -24) (16 16 40) Ambush Boss +//============ +void() monster_nemesant = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/drake/nemesant.mdl"; + self.headmdl = "progs/drake/h_nemes.mdl"; + precache_model ("progs/drake/nemesant.mdl"); + precache_model ("progs/drake/h_nemes.mdl"); + precache_model ("progs/k_spike.mdl"); // For sidewinder missiles. + precache_model ("progs/drake/smartbal.mdl"); // Homing bouncing fireball. + precache_model ("progs/drake/warp2.mdl"); // Big explosion. + + precache_sound ("hknight/attack1.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound ("nemesant/frblatck.wav"); + precache_sound ("nemesant/frblfly.wav"); + precache_sound ("nemesant/charge.wav"); + precache_sound ("nemesant/bigboom.wav"); + precache_sound ("nemesant/tdeath1.wav"); + precache_sound ("nemesant/tdeath2.wav"); + precache_sound ("nemesant/tidle1.wav"); + precache_sound ("nemesant/tidle2.wav"); + precache_sound ("nemesant/tpain.wav"); + precache_sound ("nemesant/tsight1.wav"); + precache_sound ("nemesant/tsight2.wav"); + precache_sound ("skullwiz/push.wav"); // Melee attack. + precache_blood (BLOOD_GREEN); + precache_model ("progs/drake/gr_gib2.mdl"); + precache_model ("progs/drake/s_wave.spr"); + precache_model ("progs/drake/s_expbig.spr"); + + precache_model ("progs/wizard.mdl"); + precache_model ("progs/drake/h_drake.mdl"); + precache_model ("progs/h_wizard.mdl"); + precache_model ("progs/w_spike.mdl"); + + precache_sound ("wizard/hit.wav"); // used by c code + precache_sound ("wizard/wattack.wav"); + precache_sound ("wizard/wdeath.wav"); + precache_sound ("wizard/widle1.wav"); + precache_sound ("wizard/widle2.wav"); + precache_sound ("wizard/wpain.wav"); + precache_sound ("wizard/wsight.wav"); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.health < 1) self.health = 280; + self.gibhealth = -40; + self.mass = MASS_HEAVY; + + self.th_stand = nemes_stand1; + self.th_walk = nemes_walk1; + self.th_run = nemes_run1; + self.th_missile = Nemesant_Attack; + self.th_pain = nemes_pain; + self.th_die = nemes_die; + //- - - - - - - - + self.th_sight = nemes_sight; + self.th_spawn = monster_nemesant; + if (self.classname == "monster_nemesant") { + //self.th_gib = nemes_gib; + self.th_revive = nemes_revive1; + //if (soul_evil) + // monster_purse (3, 0.5, 0.5); + } + // ELSE... Boss versions can neither be beheaded nor revived. + //else + //{ + //if (self.classname != "monster_cultlord") + //self.th_gib = nemes_gib; + //if (soul_evil) + // monster_purse (10, 1, 0.5); // 10 items, 50% gem. + //} + + self.waitmin = time + 5; // Wait for idle sounds + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.classtype = CT_MONNEMESANT; + self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + if ( (random () < 0.500) ) { + if (self.deathstring == "") self.deathstring = " was buried by a Nemesant\n"; + } else { + if (self.deathstring == "") self.deathstring = " was hexed by a Nemesant\n"; + } + + monster_start (); +}; + +// SoE entity. +void() monster_trogboss = { + self.lip = 0; + if (self.skin != 2) + self.skin = 1; + self.xfl = XFL_BOSS; + if (!self.health) + self.health = 1600; + + if (self.deathstring == "") self.deathstring = " failed to impress the Master Nemesant\n"; + monster_nemesant (); +}; + +// Original classname from Zerstorer. +void() monster_troglodyte = { + if (world.model == "maps/coe4.bsp") + {self.classname = "monster_trogboss"; monster_trogboss();} +// else if (world.model == "maps/e3secret1.bsp") +// {self.classname = "monster_trogboss"; monster_trogboss();} + else + {self.classname = "monster_nemesant"; monster_nemesant();} +}; + +// Todo (maybe): Add purple mind-flayer version that can rez bad guys. + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/mon_tur.qc b/QC_other/QC_keep/mon_tur.qc new file mode 100644 index 00000000..c2231240 --- /dev/null +++ b/QC_other/QC_keep/mon_tur.qc @@ -0,0 +1,275 @@ +void() start_monster_tur; +void() tur_aim; +void() tur_run; + +void() checkground = { + if (!(self.flags & FL_ONGROUND)) + return; + + if (self.groundentity.solid != SOLID_BSP) { + self.flags = self.flags - (self.flags & FL_ONGROUND); + return; + } +}; + +float() turfindtarget = { + local entity e; + local float r; + local float mr; + self.oldenemy = self.enemy; + if (self.enemy) { + mr = vlen(self.enemy.origin - self.origin); + } else { + mr = 1000; + } + e = find(world, classname, "player"); + while (e) { + if (e.health > 0) { + if (e.team != self.team || teamplay == 0 && visible(e)) { + r = vlen(e.origin - self.origin); + if (r < mr) { + mr = r; + self.enemy = e; + } + } + } + e = find(e, classname, "player"); + } + if (self.enemy != self.oldenemy) return 1; + + return 0; +}; + +void() tur_stand = { + checkground(); + if (!(self.flags & FL_ONGROUND)) T_Damage(self, world, world, 1000,DAMARMOR); + + if (self.state == 1) { + if (!turfindtarget()) { + self.enemy = world; + tur_aim(); + } else { + self.think = tur_run; + self.nextthink = time + 0.1; + return; + } + } + self.think = tur_stand; + self.nextthink = time + 0.1; +}; + +void() tur_walk = { + self.think = tur_stand; + self.nextthink = time + 0.1; +}; + +void() tur_run = { + checkground(); + if (!(self.flags & FL_ONGROUND)) T_Damage(self, world, world, 1000,DAMARMOR); + if (!visible(self.enemy)) self.enemy = world; + if (self.enemy.health < 1) self.enemy = world; + + turfindtarget(); + if (!(self.enemy)) { + self.think = self.th_stand; + self.nextthink = time + 0.1; + return; + } + tur_aim(); + self.think = tur_run; + self.nextthink = time + 0.1; +}; + +void() tur_death = { + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_EXPLOSION); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, self.origin_z); + self.trigger_field.think = SUB_Remove; + self.trigger_field.nextthink = time + 0.1; + if (!deathmatch) { + remove(self); + } else { + setmodel(self, ""); + self.takedamage = 0; + self.think = start_monster_tur; + self.nextthink = time + self.wait; + } +}; + +void() tur_die = { + if (self.health < -90) { + sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowGib(11,1); + ThrowGib(12,1); + ThrowGib(13,1); + } + self.solid = SOLID_NOT; + tur_death(); +}; + +void() tur_aim = { + local vector dir; + local vector vtemp; + local vector org; + local float dist; + + if (self.enemy == world) { + org = self.origin + self.movedir; + } else { + org = self.enemy.origin + (self.enemy.mins + self.enemy.maxs) * 0.5; + vtemp = org + self.enemy.velocity * self.speed; + dist = vlen(vtemp - self.origin); + dist = dist / 600; + self.speed = dist; + org = org + self.enemy.velocity * dist; + } + dir = vectoangles(org - self.origin); + vtemp = VEC_ORIGIN; + vtemp_y = dir_y - self.angles_y; + vtemp_x = dir_x - self.trigger_field.angles_x; + dir = VEC_ORIGIN; + if (vtemp_x < 0) vtemp_x = vtemp_x + 360; + if (vtemp_x > 180) vtemp_x = vtemp_x - 360; + if (vtemp_y < 0) vtemp_y = vtemp_y + 360; + if (vtemp_y > 180) vtemp_y = vtemp_y - 360; + + dir = vtemp; + if (dir_x < -10) dir_x = -10; + if (dir_x > MOVETYPE_BOUNCE) dir_x = MOVETYPE_BOUNCE; + if (dir_y < -10) dir_y = -10; + if (dir_y > MOVETYPE_BOUNCE) dir_y = MOVETYPE_BOUNCE; + + self.trigger_field.angles_x = anglemod(self.trigger_field.angles_x + dir_x); + self.angles_y = anglemod(self.angles_y + dir_y); + self.trigger_field.angles_y = self.angles_y; + if (self.enemy) { + dir = self.trigger_field.angles; + dir_x = 0 - dir_x; + makevectors(dir); + dir = normalize(org - self.origin); + if (dir * v_forward > 0.970000) { + if (time > self.attack_finished) { + traceline(self.origin, org, 1, world); + if (trace_fraction == 1 && dist <= FL_SWIM) self.th_missile(); + } + } + } +}; + +void() tur_launch = { + local vector v1; + if (!(self.ammo_cells)) return; + + self.ammo_cells = self.ammo_cells - 1; + v1 = self.trigger_field.angles; + v1_x = 0 - v1_x; + makevectors(v1); + v1 = v_forward; + if (self.spawnflags & FL_SWIM) { + sound(self, CHAN_WEAPON, "drone/enfire.wav", 1, ATTN_NORM); + if (self.ammo_cells & 1) { + launch_projectile (self.origin + v_right*14, v1, CT_PROJ_LASER, SPEED_LASER); + } else { + launch_projectile (self.origin - v_right*14, v1, CT_PROJ_LASER, SPEED_LASER); + } + self.attack_finished = time + 0.2; + } else { + sound(self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM); + if (self.ammo_cells & 1) { + launch_projectile (self.origin + v_right*14, v1, CT_PROJ_SNG, SPEED_TRAPSPIKE); + } else { + launch_projectile (self.origin - v_right*14, v1, CT_PROJ_SNG, SPEED_TRAPSPIKE); + } + self.attack_finished = time + 0.2; + } +}; + +void() tur_use = +{ + if (self.state == 0) + { + self.state = 1; + } + else + { + self.state = 0; + } + self.think = tur_stand; + self.nextthink = time + 0.1; +}; + +void() start_monster_tur = { + local entity stemp; + + if (deathmatch > 0) + { + if (self.team == 0 || teamplay == 0) + { + remove(self); + return; + } + } + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_TOSS; + self.health = self.max_health; + setmodel(self, "progs/aagba.mdl"); + setsize(self, '-16 -16 -20', '16 16 16'); + self.th_stand = tur_stand; + self.th_walk = tur_walk; + self.th_run = tur_run; + self.th_die = tur_die; + self.th_missile = tur_launch; + setorigin(self, self.oldorigin); + droptofloor(); + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + self.view_ofs = '0 0 1'; + self.flags = self.flags | FL_MONSTER; + stemp = spawn(); + stemp.owner = self; + self.hittype = HIT_METAL; + stemp.takedamage = DAMAGE_NO; + setmodel(stemp, "progs/aagtb.mdl"); + self.trigger_field = stemp; + stemp.angles = self.angles; + setorigin(stemp, self.origin); + self.ammo_cells = self.aflag; + self.th_stand(); +}; + +void() monster_tur = { + local vector v1; + precache_model("progs/aagba.mdl"); + precache_model("progs/aagtb.mdl"); + precache_model2("progs/laser.mdl"); + precache_sound2("drone/enfire.wav"); + precache_sound2("enforcer/enfstop.wav"); + precache_sound("weapons/spike2.wav"); + precache_sound("tur_arm.wav"); + + if (!deathmatch) total_monsters = total_monsters + 1; + + if (self.deathstring == "") self.deathstring = " was blasted by a Turret\n"; + self.gib1mdl = "progs/gib1.mdl"; + self.gib2mdl = "progs/gib2.mdl"; + self.gib3mdl = "progs/gib3.mdl"; + self.oldorigin = self.origin; + if (!(self.health)) self.health = 200; + self.max_health = self.health; + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + + v1 = self.angles_y * '0 1 0' + '-20 0 0'; + makevectors(v1); + self.movedir = v_forward; + if (!(self.ammo_cells)) self.ammo_cells = 5000; + self.aflag = self.ammo_cells; + if (!(self.wait)) self.wait = SVC_INTERMISSION; + if (!(self.state)) self.state = 1; + if (self.targetname) self.use = tur_use; + + self.think = start_monster_tur; + self.nextthink = time + 0.1 + random() * 0.3; +}; + diff --git a/QC_other/QC_keep/mon_turret.qc b/QC_other/QC_keep/mon_turret.qc new file mode 100644 index 00000000..1c83504b --- /dev/null +++ b/QC_other/QC_keep/mon_turret.qc @@ -0,0 +1,576 @@ +/* +============================================================================== +Automated Gun Turret +by Carl Glave aka. General WarT' +for Quake: The Apocalypse +============================================================================== +*/ + +$cd apoc/progs/turret +$origin 0 0 10 +$base base +$skin base + +// The tilt according to the angle of that frame's gun tilt +$frame tilt0 tilt6 tilt12 tilt18 +$frame tilt24 tilt30 tilt36 tilt42 +$frame tilt48 tilt54 tilt60 tilt66 +$frame tilt72 tilt78 tilt84 tilt90 + +$frame retract1 retract2 retract3 retract4 retract5 retract6 retract7 + +//============================================================================= + +// returns the appropriate frame for the passed pitch +float(float pitch) turret_frame= +{return floor(pitch/5.625);}; + +// returns the appropriate frame for while firing +float(float pitch) turret_fireframe= +{return (turret_frame(pitch) + 23);}; + +// Check to see if the turret will fire +float() CheckTurretAttack = +{ + local vector spot1, spot2; + local entity targ; + local float chance; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, FALSE, self); + + if (trace_ent != targ) + return FALSE; // don't have a clear shot + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (time < self.attack_finished) + return FALSE; + + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else if (enemy_range == RANGE_NEAR) + chance = 0.5; + else if (enemy_range == RANGE_MID) + chance = 0.2; + else + chance = 0.05; + + if (random () < chance) + { + self.th_missile(); + if(self.spawnflags & TUR_LASERS) + SUB_AttackFinished (1.5 + 2*random()); + if(self.spawnflags & TUR_ROCKETS) + SUB_AttackFinished (1.5 + 3*random()); + if(self.spawnflags & TUR_PPC) + SUB_AttackFinished (2 + 2*random()); + else + SUB_AttackFinished (1 + 1.5*random()); + return TRUE; + } + + return FALSE; +}; + +void() turret_face = +{ + local vector tmpvec; + local float idealframe; + + tmpvec = vectoangles(self.origin - (self.enemy.origin + self.enemy.view_ofs)); + if(tmpvec_x > self.rotate_type) + { + if(tmpvec_x > (self.rotate_type + 6)) + self.rotate_type = self.rotate_type + 6; + else + self.rotate_type = tmpvec_x; + } + else if(tmpvec_x < self.rotate_type) + { + if(tmpvec_x < (self.rotate_type - 6)) + self.rotate_type = self.rotate_type - 6; + else + self.rotate_type = tmpvec_x; + } + + self.frame = turret_frame(self.rotate_type); + + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); +}; + +//============================================================================= + + + +//============================================================================= + +void() turret_active; +void() turret_ret2; + +void() turret_still = [ $tilt0, turret_still] +{ + self.frame = turret_frame(self.rotate_type); + + FindTarget (); +}; + +void() turret_ret1 = [ $retract1, turret_ret1] +{ + if(self.frame >= 15) + { + turret_ret2(); + return; + } + + self.frame = self.frame + 1; + self.nextthink = time + 0.05; +}; +void() turret_ret2 = [ $retract1, turret_ret3] {self.nextthink = time + 0.05;}; +void() turret_ret3 = [ $retract2, turret_ret4] {self.nextthink = time + 0.05;}; +void() turret_ret4 = [ $retract3, turret_ret5] {self.nextthink = time + 0.05;}; +void() turret_ret5 = [ $retract4, turret_ret6] +{self.solid = SOLID_NOT;self.nextthink = time + 0.05;}; +void() turret_ret6 = [ $retract5, turret_ret7] {self.nextthink = time + 0.05;}; +void() turret_ret7 = [ $retract6, turret_ret8] {self.nextthink = time + 0.05;}; +void() turret_ret8 = [ $retract7, turret_retracted] +{if(!self.currentammo) self.think = SUB_Null;self.nextthink = time + 0.05;}; + +void() turret_unret1 = [ $retract6, turret_unret2] {self.nextthink = time + 0.05;}; +void() turret_unret2 = [ $retract5, turret_unret3] {self.nextthink = time + 0.05;}; +void() turret_unret3 = [ $retract4, turret_unret4] {self.nextthink = time + 0.05;}; +void() turret_unret4 = [ $retract3, turret_unret5] +{ + self.solid = SOLID_SLIDEBOX; + setmodel (self, "progs/turret.mdl"); + self.nextthink = time + 0.05; +}; +void() turret_unret5 = [ $retract2, turret_unret6] {self.nextthink = time + 0.05;}; +void() turret_unret6 = [ $retract1, turret_unret7] {self.nextthink = time + 0.05;}; +void() turret_unret7 = [ $tilt0, turret_unret7] +{ + if(self.frame > (turret_frame(self.rotate_type) + 1)) + self.frame = self.frame - 2; + else + { + self.frame = turret_frame(self.rotate_type); + turret_active(); + } +}; + +void() turret_retracted = [ $retract7, turret_retracted] +{ + if(FindTarget ()) + turret_unret1(); +}; + +void() turret_active = [ $tilt0, turret_active] +{ + enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + + self.frame = turret_frame(self.rotate_type); + + local vector delta; + local float axis; + local float direct, ang_rint, ang_floor, ang_ceil; + +// see if the enemy is dead + if (self.enemy.health <= 0 || self.enemy.deadflag != 0) + { + self.enemy = world; + // FIXME: look all around for other targets + if (self.oldenemy.health > 0) + { + self.enemy = self.oldenemy; + HuntTarget (); + } + else + { + self.th_stand(); + return; + } + } + + self.show_hostile = time + 1; // wake up other monsters + +// check knowledge of enemy + enemy_vis = visible(self.enemy); + if (enemy_vis) + self.search_time = time + 5; + +// look for other coop players + if (coop && self.search_time < time) + { + if (FindTarget ()) + return; + } + + if (self.attack_state == AS_MISSILE || self.attack_state == AS_MELEE) + { + ai_run_missile (); + return; + } + + CheckTurretAttack (); +}; + +//============================================================================= + +void() turret_bullet1 = [ $tilt0, turret_bullet2] +{ + local vector dir; + + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + sound (self, CHAN_WEAPON, "turret/plasbult.wav", 1, ATTN_NORM); + + self.effects = self.effects | EF_MUZZLEFLASH; + + dir = self.enemy.origin - self.enemy.velocity*0.3*random(); + dir = normalize (dir - self.origin); + + FireBullets (2, dir, '0 0 0'); +// FireLaser(self.origin + v_forward*8 + v_right*4, dir, 3, self.color); +// FireLaser(self.origin + v_forward*8 - v_right*4, dir, 3, self.color); +}; +void() turret_bullet2 = [ $tilt0, turret_bullet3] +{turret_face();self.nextthink = time + 0.05;}; +void() turret_bullet3 = [ $tilt0, turret_bullet4] +{ + local vector dir; + + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + sound (self, CHAN_WEAPON, "turret/plasbult.wav", 1, ATTN_NORM); + + self.effects = self.effects | EF_MUZZLEFLASH; + + dir = self.enemy.origin - self.enemy.velocity*0.3*random(); + dir = normalize (dir - self.origin); + + FireBullets (2, dir, '0 0 0'); +// FireLaser(self.origin + v_forward*8 + v_right*4, dir, 3, self.color); +// FireLaser(self.origin + v_forward*8 - v_right*4, dir, 3, self.color); +}; +void() turret_bullet4 = [ $tilt0, turret_bullet5] +{turret_face();self.nextthink = time + 0.05;}; +void() turret_bullet5 = [ $tilt0, turret_active] +{ + local vector dir; + + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + sound (self, CHAN_WEAPON, "turret/plasbult.wav", 1, ATTN_NORM); + + self.effects = self.effects | EF_MUZZLEFLASH; + + dir = self.enemy.origin - self.enemy.velocity*0.3*random(); + dir = normalize (dir - self.origin); + + FireBullets (2, dir, '0 0 0'); +// FireLaser(self.origin + v_forward*8 + v_right*4, dir, 3, self.color); +// FireLaser(self.origin + v_forward*8 - v_right*4, dir, 3, self.color); +}; + +void() turret_laser1 =[ $tilt0, turret_laser2] +{ + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + + newmis = launch_missile("progs/laser.mdl", self.origin, '600 0 0'); + target_missile(newmis, self.enemy.origin, 1); +}; +void() turret_laser2 =[ $tilt0, turret_laser3] {turret_face();}; +void() turret_laser3 =[ $tilt0, turret_laser4] {turret_face();}; +void() turret_laser4 =[ $tilt0, turret_laser5] {turret_face();}; +void() turret_laser5 =[ $tilt0, turret_active] +{ + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + + newmis = launch_missile("progs/laser.mdl", self.origin, '600 0 0'); + target_missile(newmis, self.enemy.origin, 1); +}; + +void() turret_rocket1 =[ $tilt0, turret_active] +{ + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + + newmis = launch_missile("progs/missile.mdl", self.origin, '1000 0 0'); + target_missile(newmis, self.enemy.origin, 1); + setdmg_missile(newmis, 15, 15); +}; + +void() turret_beam1 = [ $tilt0, turret_beam2] +{ + turret_face(); + sound (self, CHAN_WEAPON, "turret/beamchrg.wav", 1, ATTN_NORM); + self.nextthink = time + 0.2; +}; +void() turret_beam2 = [ $tilt0, turret_beam3] +{ + sound (self, CHAN_WEAPON, "turret/beamchrg.wav", 1, ATTN_NORM); + turret_face(); + self.nextthink = time + 0.2; +}; +void() turret_beam3 = [ $tilt0, turret_beam4] +{ + sound (self, CHAN_WEAPON, "turret/beamchrg.wav", 1, ATTN_NORM); + turret_face(); + self.nextthink = time + 0.2; +}; +void() turret_beam4 = [ $tilt0, turret_beam5] +{ + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + +// explode if under water + if (self.waterlevel > 1) + { + beam_water_burst(20); + return; + } + + newmis = spawn(); + newmis.solid = SOLID_NOT; + newmis.movetype = MOVETYPE_FLY; + newmis.currentammo = 10; + setorigin(newmis, self.origin); + newmis.owner = self; + newmis.think = beam_generate; + newmis.nextthink = time + 0.05; +}; +void() turret_beam5 = [ $tilt0, turret_beam6] {turret_face();}; +void() turret_beam6 = [ $tilt0, turret_beam7] {turret_face();}; +void() turret_beam7 = [ $tilt0, turret_active] {turret_face();}; + +void() turret_fire2; +void() turret_fire1 = [ $tilt0, turret_fire2] +{ + turret_face(); + + if(infront(self.enemy)) + self.think = turret_fire2; + self.nextthink = time + 0.05; +}; +void() turret_fire2 = [ $tilt0, turret_fire3] +{ + turret_face(); + self.nextthink = time + 0.05; +}; +void() turret_fire3 = [ $tilt0, turret_fire4] +{ + turret_face(); + self.nextthink = time + 0.05; +}; +void() turret_fire4 = [ $tilt0, turret_fire4] +{ + turret_face(); + + if(self.spawnflags & TUR_LASERS) + turret_laser1(); + else if(self.spawnflags & TUR_ROCKETS) + turret_rocket1(); + else if(self.spawnflags & TUR_PPC) + turret_beam1(); + else + turret_bullet1(); +}; + +//============================================================================= + +void(entity attacker, float damage) turret_pain = +{ + if (self.pain_finished > time) + return; + self.pain_finished = time + 1; + + sound (self, CHAN_VOICE, "turret/beamchrg.wav", 1, ATTN_NORM); + ThrowGib ("progs/turetgib.mdl", 0 - damage); +}; + +void() turret_die= +{ + local entity dedtur; + + self.use = SUB_Null; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + dedtur = spawn(); + dedtur.solid = SOLID_NOT; + dedtur.movetype = MOVETYPE_NONE; + dedtur.angles = self.angles; + setorigin(dedtur, self.origin); + setmodel (dedtur, "progs/dedturet.mdl"); + setsize (self, '-10 -10 -3', '10 10 12'); + dedtur.skin = self.skin; + + ThrowHead ("progs/h_turret.mdl", self.health); + ThrowGib ("progs/turetgib.mdl", self.health); + ThrowGib ("progs/turetgib.mdl", self.health); + ThrowGib ("progs/turetgib.mdl", self.health); + ThrowGib ("progs/turetgib.mdl", self.health); +}; + +void() turret_use= +{ + if(self.currentammo) + { + self.currentammo = FALSE; + if((self.spawnflags & TUR_RETRACT) || (self.spawnflags & TUR_OFFRET)) + turret_ret1(); + else + self.think = SUB_Null; + } + else + { + self.currentammo = TRUE; + if((self.spawnflags & TUR_RETRACT) || (self.spawnflags & TUR_OFFRET)) + turret_unret1(); + else + turret_still(); + } +}; + +void() turret_setup= +{ + local vector endorg; + + traceline(self.origin, self.origin + '0 0 2000', TRUE, self); + + endorg = trace_endpos; + endorg_z = endorg_z - 12; + setorigin(self, endorg); + + // decide how to start according to the spawnflags + if(self.spawnflags & TUR_STARTOFF) + { + if((self.spawnflags & TUR_RETRACT) || (self.spawnflags & TUR_OFFRET)) + { + self.frame = $retract7; + self.solid = SOLID_NOT; + } + else + self.frame = turret_frame(self.rotate_type); + + self.currentammo = FALSE; + self.think = SUB_Null; + } + else + { + if(self.spawnflags & TUR_RETRACT) + { + self.solid = SOLID_NOT; + turret_retracted(); + } + else + turret_still(); + + self.nextthink = self.nextthink + random()*0.5; + } +}; + +void() monster_turret= +{ + precache_model ("progs/turret.mdl"); + precache_model ("progs/h_turret.mdl"); + precache_model ("progs/dedturet.mdl"); + precache_model ("progs/turetgib.mdl"); + + precache_sound ("turret/beamchrg.wav"); + precache_sound ("turret/beammode.wav"); + + if(self.spawnflags & TUR_LASERS) + { + precache_model ("progs/laser.mdl"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + } + else if(self.spawnflags & TUR_LASERS) + { + precache_model ("progs/missile.mdl"); + precache_sound ("weapons/sgun1.wav"); + } + else if(self.spawnflags & TUR_PPC) + { + precache_model ("progs/beam.mdl"); + precache_sound ("turret/beamhit.wav"); + precache_sound ("hipweap/mjolhit.wav"); + } + else + precache_sound ("turret/plasbult.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/turret.mdl"); + if (self.deathstring == "") self.deathstring = " was blasted by a Turret\n"; + + setsize (self, '-12 -12 -6', '12 12 12'); + if(self.health < 1) + self.health = 100; + self.max_health = self.health; + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + if(self.rotate_type < 0 || self.rotate_type > 90) + self.rotate_type = 0; + self.currentammo = TRUE; + + if(self.spawnflags & TUR_RETRACT) + { + self.th_stand = turret_ret1; + self.th_walk = turret_ret1; + } + else + { + self.th_stand = turret_still; + self.th_walk = turret_still; + } + self.th_run = turret_active; + self.th_pain = turret_pain; + self.th_die = turret_die; + self.th_missile = turret_fire1; + + total_monsters = total_monsters + 1; + + self.takedamage = DAMAGE_AIM; + + self.hittype = HIT_METAL; + self.ideal_yaw = self.angles * '0 1 0'; + self.yaw_speed = 30; + self.view_ofs = '0 0 -0.1'; + self.use = turret_use; + + self.flags = self.flags | FL_FLY; + self.flags = self.flags | FL_MONSTER; + self.pausetime = 99999999; + + self.nextthink = self.nextthink + random()*0.5; + self.think = turret_setup; +}; diff --git a/QC_other/QC_keep/mon_vermis.qc b/QC_other/QC_keep/mon_vermis.qc new file mode 100644 index 00000000..c0070954 --- /dev/null +++ b/QC_other/QC_keep/mon_vermis.qc @@ -0,0 +1,1862 @@ +void vermis_wake1(); +void vermis_trans1(); +void vermis_idle1(); + +void() VermisFoundTarget = +{ + if (self.enemy.classname == "player") + { + sight_entity = self; + sight_entity_time = time; + } + self.show_hostile = time + 1; + self.goalentity = self.enemy; + if (self.coiled != 0) + { + self.think = vermis_wake1; + sound(self, CHAN_VOICE, "vermis/sight.wav", 1, 0.4); + } + else + { + self.think = vermis_trans1; + sound(self, CHAN_VOICE, "vermis/sight2.wav", 1, 0.4); + } + self.th_stand = vermis_idle1; + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.nextthink = time + 0.1; + self.shield = 1; +}; + +void() vermis_use = +{ + if (self.enemy) + { + return; + } + if (self.health <= 0) + { + return; + } + if (activator.items & IT_INVISIBILITY) + { + return; + } + if (activator.flags & FL_NOTARGET) + { + return; + } + if (activator.classname != "player") + { + return; + } + self.enemy = activator; + self.nextthink = time + 0.1; + self.think = VermisFoundTarget; +}; + +float() VermisFindTarget = +{ + local entity client; + local float r; + if (sight_entity_time >= time - 0.1 && !(self.spawnflags & AS_MELEE)) + { + client = sight_entity; + if (client.enemy == self.enemy) + { + return 0; + } + } + else + { + client = checkclient(); + if (!client) + { + return 0; + } + } + if (client == self.enemy) + { + return 0; + } + if (client.flags & FL_NOTARGET) + { + return 0; + } + if (client.items & IT_INVISIBILITY) + { + return 0; + } + r = range(client); + if (r == RANGE_FAR) + { + return 0; + } + if (!visible(client)) + { + return 0; + } + if (r == RANGE_NEAR) + { + if (client.show_hostile < time && !infront(client)) + { + return 0; + } + } + else + { + if (r == RANGE_MID) + { + if (!infront(client)) + { + return 0; + } + } + } + self.enemy = client; + if (self.enemy.classname != "player") + { + self.enemy = self.enemy.enemy; + if (self.enemy.classname != "player") + { + self.enemy = world; + return 0; + } + } + VermisFoundTarget(); + return 1; +}; + +void() vermis_start_go = +{ + if (!(self.spawnflags & 64)) + { + self.origin_z = self.origin_z + 1; + } + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + if (!(self.yaw_speed)) + { + self.yaw_speed = 15; + } + self.view_ofs = '0 0 25'; + self.use = vermis_use; + self.flags = self.flags | FL_MONSTER; + self.flags = self.flags | FL_FLY; + self.pausetime = 100000000; + self.th_stand(); + self.nextthink = self.nextthink + random() * 0.5; + if (self.spawnflags & 64 && (self.spawnflags & 128) && !(activator.items & IT_INVISIBILITY) && !(activator.flags & FL_NOTARGET) && activator.classname == "player") + { + self.enemy = activator; + self.nextthink = time + 0.1; + self.think = FoundTarget; + } + if (self.awake == 1 && !(self.enemy.items & IT_INVISIBILITY) && !(self.enemy.flags & FL_NOTARGET) && self.enemy.classname == "player") + { + self.nextthink = time + 0.1; + self.think = FoundTarget; + } +}; + +void() vermis_start = +{ + if (!(self.spawnflags & 64)) + { + self.nextthink = self.nextthink + random() * 0.5; + self.think = vermis_start_go; + } + else + { + vermis_start_go(); + } + total_monsters = total_monsters + 1; +}; + + + +void() ai_vermis_face = +{ + if (visible(self.enemy)) + { + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + } + else + { + self.ideal_yaw = vectoyaw(self.oldenemyorigin - self.origin); + } + ChangeYaw(); +}; + +void() ai_vermis_stand = +{ + if (VermisFindTarget()) + { + return; + } +}; + +float() CheckVermisAttack = +{ + local vector spot1; + local vector spot2; + local entity targ; + local float chance; + local float dist; + targ = self.enemy; + dist = vlen(self.enemy.origin - self.origin); + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline(spot1, spot2, 0, self); + if (trace_inopen && trace_inwater) + { + return 0; + } + if (dist < 340 && self.enemy.movetype != MOVETYPE_FLY) + { + if (self.th_melee) + { + self.th_melee(); + return 1; + } + } + if (!(self.th_missile)) + { + return 0; + } + if (time < self.attack_finished) + { + return 0; + } + chance = 0.9; + if (trace_ent != targ && random() < 0.3) + { + return 0; + } + if (random() < chance) + { + self.th_missile(); + SUB_AttackFinished(2 + 1 * random()); + return 1; + } + return 0; +}; + +void() ai_vermis_run = { + if (self.enemy.health <= 0) { + self.enemy = world; + if (self.oldenemy.health > 0) { + self.enemy = self.oldenemy; + HuntTarget(); + } else { + self.th_stand(); + return; + } + } + self.show_hostile = time + 1; + enemy_vis = visible(self.enemy); + if (enemy_vis) + { + self.search_time = time + 5; + } + if (coop && self.search_time < time) + { + if (FindTarget()) + { + return; + } + } + enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + CheckVermisAttack(); + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_touch = { + if (other.classname == "player") { + T_Damage(other, self, self, AS_MELEE + 2 * random(),DAMARMOR); + self.touch = SUB_Null; + } +}; + +void() vermis_wake_things = { + self.spawnmaxs_z = self.spawnmaxs_z + self.height; + setsize(self, '-64 -64 -512', self.spawnmaxs); + self.touch = vermis_touch; +}; + +void() vermis_coil1 = [2, vermis_coil1] +{ + self.height = 8; +}; + +void() vermis_wake1 = [2, vermis_wake2] +{ + ai_vermis_face(); + self.spawnmaxs = '64 64 -64'; + setsize(self, '-64 -64 -512', self.spawnmaxs); + self.touch = vermis_touch; +}; + +void() vermis_wake2 = [3, vermis_wake3] +{ + ai_vermis_face(); + vermis_wake_things(); + self.coiled = 0; +}; + +void() vermis_wake3 = [4, vermis_wake4] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake4 = [5, vermis_wake5] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake5 = [6, vermis_wake6] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake6 = [7, vermis_wake7] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake7 = [8, vermis_wake8] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake8 = [9, vermis_wake9] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake9 = [10, vermis_wake10] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake10 = [11, vermis_wake11] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake11 = [12, vermis_wake12] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake12 = [13, vermis_wake13] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake13 = [14, vermis_wake14] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake14 = [15, vermis_wake15] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake15 = [16, vermis_wake16] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake16 = [17, vermis_wake17] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake17 = [18, vermis_wake18] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake18 = [19, vermis_wake19] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake19 = [20, vermis_wake20] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake20 = [21, vermis_wake21] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake21 = [22, vermis_wake22] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake22 = [23, vermis_wake23] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake23 = [24, vermis_wake24] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake24 = [25, vermis_wake25] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake25 = [26, vermis_wake26] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake26 = [27, vermis_wake27] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake27 = [28, vermis_wake28] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake28 = [29, vermis_wake29] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake29 = [30, vermis_wake30] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake30 = [31, vermis_wake31] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake31 = [32, vermis_wake32] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake32 = [33, vermis_wake33] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake33 = [34, vermis_wake34] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake34 = [35, vermis_wake35] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake35 = [36, vermis_wake36] +{ + ai_vermis_face(); + vermis_wake_things(); +}; + +void() vermis_wake36 = [37, vermis_wake37] +{ + ai_vermis_face(); +}; + +void() vermis_wake37 = [38, vermis_wake38] +{ + ai_vermis_face(); +}; + +void() vermis_wake38 = [39, vermis_wake39] +{ + ai_vermis_face(); +}; + +void() vermis_wake39 = [40, vermis_wake40] +{ + ai_vermis_face(); +}; + +void() vermis_wake40 = [41, vermis_wake41] +{ + ai_vermis_face(); +}; + +void() vermis_wake41 = [42, vermis_wake42] +{ + ai_vermis_face(); +}; + +void() vermis_wake42 = [43, vermis_wake43] +{ + ai_vermis_face(); +}; + +void() vermis_wake43 = [44, vermis_wake44] +{ + ai_vermis_face(); +}; + +void() vermis_wake44 = [45, vermis_wake45] +{ + ai_vermis_face(); +}; + +void() vermis_wake45 = [46, vermis_wake46] +{ + ai_vermis_face(); +}; + +void() vermis_wake46 = [47, vermis_wake47] +{ + ai_vermis_face(); +}; + +void() vermis_wake47 = [48, vermis_wake48] +{ + ai_vermis_face(); +}; + +void() vermis_wake48 = [49, vermis_wake49] +{ + ai_vermis_face(); +}; + +void() vermis_wake49 = [50, vermis_wake50] +{ + self.th_stand = vermis_idle1; +}; + +void() vermis_wake50 = [51, vermis_run1] +{ + ai_vermis_face(); + self.touch = SUB_Null; +}; + +void() vermis_trans1 = [212, vermis_trans2] +{ + ai_vermis_face(); +}; + +void() vermis_trans2 = [213, vermis_trans3] +{ + ai_vermis_face(); +}; + +void() vermis_trans3 = [214, vermis_trans4] +{ + ai_vermis_face(); +}; + +void() vermis_trans4 = [215, vermis_trans5] +{ + ai_vermis_face(); +}; + +void() vermis_trans5 = [216, vermis_trans21] +{ + ai_vermis_face(); +}; + +void() vermis_trans21 = [22, vermis_trans22] +{ + ai_vermis_face(); +}; + +void() vermis_trans22 = [23, vermis_trans23] +{ + ai_vermis_face(); +}; + +void() vermis_trans23 = [24, vermis_trans24] +{ + ai_vermis_face(); +}; + +void() vermis_trans24 = [25, vermis_trans25] +{ + ai_vermis_face(); +}; + +void() vermis_trans25 = [26, vermis_trans26] +{ + ai_vermis_face(); +}; + +void() vermis_trans26 = [27, vermis_trans27] +{ + ai_vermis_face(); +}; + +void() vermis_trans27 = [28, vermis_trans28] +{ + ai_vermis_face(); +}; + +void() vermis_trans28 = [29, vermis_trans29] +{ + ai_vermis_face(); +}; + +void() vermis_trans29 = [30, vermis_trans30] +{ + ai_vermis_face(); +}; + +void() vermis_trans30 = [31, vermis_trans31] +{ + ai_vermis_face(); +}; + +void() vermis_trans31 = [32, vermis_trans32] +{ + ai_vermis_face(); +}; + +void() vermis_trans32 = [33, vermis_trans33] +{ + ai_vermis_face(); +}; + +void() vermis_trans33 = [34, vermis_trans34] +{ + ai_vermis_face(); +}; + +void() vermis_trans34 = [35, vermis_trans35] +{ + ai_vermis_face(); +}; + +void() vermis_trans35 = [36, vermis_trans36] +{ + ai_vermis_face(); +}; + +void() vermis_trans36 = [37, vermis_trans37] +{ + ai_vermis_face(); +}; + +void() vermis_trans37 = [38, vermis_trans38] +{ + ai_vermis_face(); +}; + +void() vermis_trans38 = [39, vermis_trans39] +{ + ai_vermis_face(); +}; + +void() vermis_trans39 = [40, vermis_trans40] +{ + ai_vermis_face(); +}; + +void() vermis_trans40 = [41, vermis_trans41] +{ + ai_vermis_face(); +}; + +void() vermis_trans41 = [42, vermis_trans42] +{ + ai_vermis_face(); +}; + +void() vermis_trans42 = [43, vermis_trans43] +{ + ai_vermis_face(); +}; + +void() vermis_trans43 = [44, vermis_trans44] +{ + ai_vermis_face(); +}; + +void() vermis_trans44 = [45, vermis_trans45] +{ + ai_vermis_face(); +}; + +void() vermis_trans45 = [46, vermis_trans46] +{ + ai_vermis_face(); +}; + +void() vermis_trans46 = [47, vermis_trans47] +{ + ai_vermis_face(); +}; + +void() vermis_trans47 = [48, vermis_trans48] +{ + ai_vermis_face(); +}; + +void() vermis_trans48 = [49, vermis_trans49] +{ + ai_vermis_face(); +}; + +void() vermis_trans49 = [50, vermis_trans50] +{ + ai_vermis_face(); + self.th_stand = vermis_idle1; +}; + +void() vermis_trans50 = [51, vermis_run1] +{ + ai_vermis_face(); +}; + +void() vermis_idle1 = [52, vermis_idle2] +{ + ai_vermis_stand(); +}; + +void() vermis_idle2 = [53, vermis_idle3] +{ + ai_vermis_stand(); +}; + +void() vermis_idle3 = [54, vermis_idle4] +{ + ai_vermis_stand(); +}; + +void() vermis_idle4 = [55, vermis_idle5] +{ + ai_vermis_stand(); +}; + +void() vermis_idle5 = [56, vermis_idle6] +{ + ai_vermis_stand(); +}; + +void() vermis_idle6 = [57, vermis_idle7] +{ + ai_vermis_stand(); +}; + +void() vermis_idle7 = [58, vermis_idle8] +{ + ai_vermis_stand(); +}; + +void() vermis_idle8 = [59, vermis_idle9] +{ + ai_vermis_stand(); +}; + +void() vermis_idle9 = [60, vermis_idle10] +{ + ai_vermis_stand(); +}; + +void() vermis_idle10 = [61, vermis_idle11] +{ + ai_vermis_stand(); +}; + +void() vermis_idle11 = [62, vermis_idle12] +{ + ai_vermis_stand(); +}; + +void() vermis_idle12 = [63, vermis_idle13] +{ + ai_vermis_stand(); +}; + +void() vermis_idle13 = [64, vermis_idle14] +{ + ai_vermis_stand(); +}; + +void() vermis_idle14 = [65, vermis_idle15] +{ + ai_vermis_stand(); +}; + +void() vermis_idle15 = [66, vermis_idle16] +{ + ai_vermis_stand(); +}; + +void() vermis_idle16 = [67, vermis_idle17] +{ + ai_vermis_stand(); +}; + +void() vermis_idle17 = [68, vermis_idle18] +{ + ai_vermis_stand(); +}; + +void() vermis_idle18 = [69, vermis_idle19] +{ + ai_vermis_stand(); +}; + +void() vermis_idle19 = [70, vermis_idle20] +{ + ai_vermis_stand(); +}; + +void() vermis_idle20 = [71, vermis_idle21] +{ + ai_vermis_stand(); +}; + +void() vermis_idle21 = [70, vermis_idle22] +{ + ai_vermis_stand(); +}; + +void() vermis_idle22 = [69, vermis_idle23] +{ + ai_vermis_stand(); +}; + +void() vermis_idle23 = [68, vermis_idle24] +{ + ai_vermis_stand(); +}; + +void() vermis_idle24 = [67, vermis_idle25] +{ + ai_vermis_stand(); +}; + +void() vermis_idle25 = [66, vermis_idle26] +{ + ai_vermis_stand(); +}; + +void() vermis_idle26 = [65, vermis_idle27] +{ + ai_vermis_stand(); +}; + +void() vermis_idle27 = [64, vermis_idle28] +{ + ai_vermis_stand(); +}; + +void() vermis_idle28 = [63, vermis_idle29] +{ + ai_vermis_stand(); +}; + +void() vermis_idle29 = [62, vermis_idle30] +{ + ai_vermis_stand(); +}; + +void() vermis_idle30 = [61, vermis_idle31] +{ + ai_vermis_stand(); +}; + +void() vermis_idle31 = [60, vermis_idle32] +{ + ai_vermis_stand(); +}; + +void() vermis_idle32 = [59, vermis_idle33] +{ + ai_vermis_stand(); +}; + +void() vermis_idle33 = [58, vermis_idle34] +{ + ai_vermis_stand(); +}; + +void() vermis_idle34 = [57, vermis_idle35] +{ + ai_vermis_stand(); +}; + +void() vermis_idle35 = [56, vermis_idle36] +{ + ai_vermis_stand(); +}; + +void() vermis_idle36 = [55, vermis_idle37] +{ + ai_vermis_stand(); +}; + +void() vermis_idle37 = [54, vermis_idle38] +{ + ai_vermis_stand(); +}; + +void() vermis_idle38 = [53, vermis_idle1] +{ + ai_vermis_stand(); +}; + +void() vermis_run1 = [92, vermis_run2] +{ + ai_vermis_run(); +}; + +void() vermis_run2 = [93, vermis_run3] +{ + ai_vermis_run(); +}; + +void() vermis_run3 = [94, vermis_run4] +{ + ai_vermis_run(); +}; + +void() vermis_run4 = [95, vermis_run5] +{ + ai_vermis_run(); +}; + +void() vermis_run5 = [96, vermis_run6] +{ + ai_vermis_run(); +}; + +void() vermis_run6 = [97, vermis_run7] +{ + ai_vermis_run(); +}; + +void() vermis_run7 = [98, vermis_run8] +{ + ai_vermis_run(); +}; + +void() vermis_run8 = [99, vermis_run9] +{ + ai_vermis_run(); +}; + +void() vermis_run9 = [100, vermis_run10] +{ + ai_vermis_run(); +}; + +void() vermis_run10 = [101, vermis_run11] +{ + ai_vermis_run(); +}; + +void() vermis_run11 = [102, vermis_run12] +{ + ai_vermis_run(); +}; + +void() vermis_run12 = [103, vermis_run13] +{ + ai_vermis_run(); +}; + +void() vermis_run13 = [104, vermis_run14] +{ + ai_vermis_run(); +}; + +void() vermis_run14 = [105, vermis_run15] +{ + ai_vermis_run(); +}; + +void() vermis_run15 = [106, vermis_run16] +{ + ai_vermis_run(); +}; + +void() vermis_run16 = [107, vermis_run17] +{ + ai_vermis_run(); +}; + +void() vermis_run17 = [108, vermis_run18] +{ + ai_vermis_run(); +}; + +void() vermis_run18 = [109, vermis_run19] +{ + ai_vermis_run(); +}; + +void() vermis_run19 = [110, vermis_run20] +{ + ai_vermis_run(); +}; + +void() vermis_run20 = [111, vermis_run21] +{ + ai_vermis_run(); +}; + +void() vermis_run21 = [112, vermis_run22] +{ + ai_vermis_run(); +}; + +void() vermis_run22 = [113, vermis_run23] +{ + ai_vermis_run(); +}; + +void() vermis_run23 = [114, vermis_run24] +{ + ai_vermis_run(); +}; + +void() vermis_run24 = [115, vermis_run25] +{ + ai_vermis_run(); +}; + +void() vermis_run25 = [116, vermis_run26] +{ + ai_vermis_run(); +}; + +void() vermis_run26 = [117, vermis_run27] +{ + ai_vermis_run(); +}; + +void() vermis_run27 = [118, vermis_run28] +{ + ai_vermis_run(); +}; + +void() vermis_run28 = [119, vermis_run29] +{ + ai_vermis_run(); +}; + +void() vermis_run29 = [120, vermis_run30] +{ + ai_vermis_run(); +}; + +void() vermis_run30 = [121, vermis_run1] +{ + ai_vermis_run(); +}; + +void() vermis_spore_explode = +{ + T_RadiusDamage(self, self.owner, 55, other,DAMAGEALL); + if (other) + { + T_Damage(other, self, self.owner, 24 + 2 * random(),DAMARMOR); + } + sound(self, CHAN_VOICE, "vermis/pop.wav", 0.6, 1.5); + WriteByte(0, SVC_TEMPENTITY); + WriteByte(0, TE_TAREXPLOSION); + WriteCoord(0, self.origin_x); + WriteCoord(0, self.origin_y); + WriteCoord(0, self.origin_z); + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + SUB_Remove(); +}; + +void() vermis_spore_touch = +{ + local float rndsnd; + if (other == self.owner) + { + return; + } + if (other.takedamage == DAMAGE_AIM) + { + vermis_spore_explode(); + return; + } + rndsnd = random(); + if (rndsnd < 0.33) + { + sound(self, CHAN_VOICE, "vermis/splash1.wav", 1, 1.7); + } + else + { + if (rndsnd < 0.66) + { + sound(self, CHAN_VOICE, "vermis/splash2.wav", 1, 1.7); + } + else + { + sound(self, CHAN_VOICE, "vermis/splash3.wav", 1, 1.7); + } + } + if (self.velocity == VEC_ORIGIN) + { + self.avelocity = VEC_ORIGIN; + } + if (self.lip == 0) + { + self.ltime = time + 0.3 + 0.4 * random(); + self.movetype = MOVETYPE_BOUNCE; + } + self.lip = 1; +}; + +void() vermis_spore_think = +{ + if (self.ltime < time) + { + vermis_spore_explode(); + } + self.nextthink = time + 0.1; + self.think = vermis_spore_think; +}; + +void(float xoff, float yoff, float zoff) vermis_shoot = +{ + local entity missile; + local vector org; + local float t; + local vector d; + local vector vec; + local float dist; + local float numspores; + if (visible(self.enemy)) + { + dist = vlen(self.enemy.origin - self.origin); + } + else + { + dist = vlen(self.oldenemyorigin - self.origin); + } + if (dist < 450) + { + numspores = 5; + } + else + { + if (dist < 800) + { + numspores = 8; + } + else + { + numspores = TE_BEAM; + } + } + if (numspores == 0) + { + numspores = 1; + } + self.effects = self.effects | EF_MUZZLEFLASH; + while (numspores > 0) + { + missile = spawn(); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + makevectors(self.angles); + org = self.origin + v_right * xoff + v_forward * yoff + v_up * zoff; + if (visible(self.enemy)) + { + t = vlen(self.enemy.origin - org) / 1800; + vec = self.enemy.velocity; + vec_z = 0; + d = self.enemy.origin + t * vec; + vec = normalize(d - org); + missile.velocity = vec; + } + else + { + missile.velocity = normalize(self.oldenemyorigin - org); + } + missile.velocity = missile.velocity * 600 + (400 * random() - 200) * v_right + (300 * random() - 150) * v_up; + missile.avelocity = '297 324 333'; + missile.angles = vectoangles(missile.velocity); + missile.touch = vermis_spore_touch; + missile.nextthink = time + 0.1; + missile.think = vermis_spore_think; + missile.ltime = time + 2; + setmodel(missile, "progs/spore.mdl"); + setsize(missile, VEC_ORIGIN, VEC_ORIGIN); + setorigin(missile, org); + numspores = numspores - 1; + } +}; + +void() vermis_shoot1 = [122, vermis_shoot2] +{ + ai_vermis_face(); + ai_shotcheck(); + sound(self, CHAN_WEAPON, "vermis/spore.wav", 1, 0.5); +}; + +void() vermis_shoot2 = [123, vermis_shoot3] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot3 = [124, vermis_shoot4] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot4 = [125, vermis_shoot5] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot5 = [126, vermis_shoot6] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot6 = [127, vermis_shoot7] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot7 = [128, vermis_shoot8] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot8 = [129, vermis_shoot9] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot9 = [130, vermis_shoot10] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot10 = [131, vermis_shoot11] +{ + ai_vermis_face(); + ai_shotcheck(); + vermis_shoot(0, 209, 73); +}; + +void() vermis_shoot11 = [132, vermis_shoot12] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot12 = [133, vermis_shoot13] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot13 = [134, vermis_shoot14] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot14 = [135, vermis_shoot15] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot15 = [136, vermis_shoot16] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot16 = [137, vermis_shoot17] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot17 = [138, vermis_shoot18] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot18 = [139, vermis_shoot19] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot19 = [140, vermis_shoot20] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_shoot20 = [141, vermis_run1] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void(float xoff, float yoff, float zoff) vermis_grab = +{ + local vector org; + local float dist; + if (self.enemy.flags & FL_MONSTER && !(self.enemy.flags & FL_CLIENT)) + { + T_Damage(self.enemy, self, self.owner, 15 + 5 * random(),DAMARMOR); + } + makevectors(self.angles); + org = self.origin + v_right * xoff + v_forward * yoff + v_up * zoff; + dist = vlen(self.enemy.origin - org); + if (dist < 155) + { + self.enemy.vermis_grabbed = 1; + sound(self, CHAN_VOICE, "vermis/grabbed.wav", 1, 0.5); + T_Damage(self.enemy, self, self, SVC_FINALE + 4 * random(),DAMARMOR); + return; + } + sound(self, CHAN_VOICE, "vermis/grndhit.wav", 1, 0.5); +}; + +void(float xoff, float yoff, float zoff, float xoff2, float yoff2, float zoff2) vermis_move = { + local vector reqvel; + local vector position1; + local vector position2; + local float dist; + makevectors(self.angles); + if (self.enemy.vermis_grabbed != 1) + { + return; + } + if (self.enemy.flags & FL_ONGROUND) + { + self.enemy.flags = self.enemy.flags - FL_ONGROUND; + } + if (xoff == 666) + { + xoff = self.enemy.origin_x; + yoff = self.enemy.origin_y; + zoff = self.enemy.origin_z; + } + position1_x = xoff; + position1_y = yoff; + position1_z = zoff; + position2_x = xoff2; + position2_y = yoff2; + position2_z = zoff2; + position1 = self.origin + v_right * xoff + v_forward * yoff + v_up * zoff; + position2 = self.origin + v_right * xoff2 + v_forward * yoff2 + v_up * zoff2; + setorigin(self.enemy, position1); + self.enemy.oldorigin = self.origin; + dist = vlen(position2 - position1); + reqvel = normalize(position2 - position1) * dist * TE_LAVASPLASH; + self.enemy.velocity = reqvel; + self.enemy.teleport_time = time + 0.2; +}; + +void() dummy_think = +{ + self.owner.vermis_grabbed = 0; + self.owner.spawnmaster = world; + self.owner.velocity = self.velocity; + self.nextthink = time + 0.1; + self.think = SUB_Remove; +}; + +void() vermis_launch = +{ + local entity dummy; + if (self.enemy.vermis_grabbed != 1) + { + return; + } + makevectors(self.angles); + self.enemy.vermis_grabbed = 2; + SUB_AttackFinished(1); + if (self.enemy.health <= 0) + { + self.enemy.velocity = v_forward * 700 + v_up * 50; + } + else + { + dummy = spawn(); + setsize(dummy, VEC_HULL_MIN, '16 16 40'); + setorigin(dummy, self.enemy.origin); + dummy.movetype = MOVETYPE_BOUNCE; + dummy.velocity = v_forward * 700 + v_up * 50; + dummy.nextthink = time + 1; + dummy.think = dummy_think; + dummy.owner = self.enemy; + dummy.classname = "dummy"; + self.enemy.spawnmaster = dummy; + } + if (self.enemy.classname != "player") + { + self.enemy.velocity = v_forward * 700 + v_up * 50; + } + self.vermis_grabbed = time + 2; +}; + +void() vermis_grabmis1 = [217, vermis_grabmis2] +{ + ai_vermis_face(); +}; + +void() vermis_grabmis2 = [217, vermis_run1] +{ + ai_vermis_face(); + SUB_AttackFinished(0.2); +}; + +void() vermis_grab1 = [142, vermis_grab2] +{ + self.drop = self.yaw_speed; + self.yaw_speed = 25; + ai_vermis_face(); + ai_shotcheck(); + sound(self, CHAN_AUTO, "vermis/grab.wav", 1, 0.5); +}; + +void() vermis_grab2 = [143, vermis_grab3] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_grab3 = [144, vermis_grab4] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_grab4 = [145, vermis_grab5] +{ + ai_vermis_face(); + ai_shotcheck(); +}; + +void() vermis_grab5 = [146, vermis_grab6] +{ + ai_vermis_face(); + ai_shotcheck(); + vermis_grab(14, 174, 24); + vermis_move(666, 0, 0, 14, 174, 24); +}; + +void() vermis_grab6 = [147, vermis_grab7] +{ + vermis_move(19, 208, -7, 18, 203, -14); +}; + +void() vermis_grab7 = [148, vermis_grab8] +{ + vermis_move(18, 203, -14, 16, 193, CONTENT_LAVA); +}; + +void() vermis_grab8 = [149, vermis_grab9] +{ + vermis_move(16, 193, CONTENT_LAVA, 14, 182, 11); + if (self.enemy.vermis_grabbed != 1) + { + self.think = vermis_grabmis1; + } +}; + +void() vermis_grab9 = [150, vermis_grab10] +{ + vermis_move(14, 182, 11, 11, 172, 34); +}; + +void() vermis_grab10 = [151, vermis_grab11] +{ + vermis_move(11, 172, 34, 9, 166, 59); +}; + +void() vermis_grab11 = [152, vermis_grab12] +{ + vermis_move(9, 166, 59, 8, 164, 92); +}; + +void() vermis_grab12 = [153, vermis_grab13] +{ + vermis_move(8, 164, 92, 6, 156, 136); +}; + +void() vermis_grab13 = [154, vermis_grab14] +{ + vermis_move(6, 156, 136, 5, 133, 187); +}; + +void() vermis_grab14 = [155, vermis_grab15] +{ + vermis_move(5, 133, 187, 4, 89, 236); +}; + +void() vermis_grab15 = [156, vermis_grab16] +{ + vermis_move(4, 89, 236, 5, SVC_TEMPENTITY, 273); +}; + +void() vermis_grab16 = [157, vermis_grab17] +{ + vermis_move(5, SVC_TEMPENTITY, 273, AS_MELEE, -38, 331); +}; + +void() vermis_grab17 = [158, vermis_grab18] +{ + vermis_move(AS_MELEE, -38, 331, AS_MELEE, -38, 331); +}; + +void() vermis_grab18 = [159, vermis_grab19] +{ + vermis_launch(); +}; + +void() vermis_grab19 = [160, vermis_grab20] {}; +void() vermis_grab20 = [161, vermis_run1] {}; + +void() vermis_melee = { + if (self.vermis_grabbed > time) + return; + + if (!(self.enemy.flags & FL_FLY)) + vermis_grab1(); +}; + +void(entity inflictor, entity attacker, float damage) vermis_pain = { + if (self.shield == 0 && self.coiled != 0) { + self.shield = 1; + vermis_wake1(); + } + if (self.shield == 0 && self.coiled == 0) { + self.shield = 1; + vermis_trans1(); + } + return; +}; + +void() vermis_death1 = [162, vermis_death2] +{ +}; + +void() vermis_death2 = [163, vermis_death3] +{ +}; + +void() vermis_death3 = [164, vermis_death4] +{ +}; + +void() vermis_death4 = [165, vermis_death5] +{ +}; + +void() vermis_death5 = [166, vermis_death6] +{ +}; + +void() vermis_death6 = [167, vermis_death7] +{ +}; + +void() vermis_death7 = [168, vermis_death8] +{ +}; + +void() vermis_death8 = [169, vermis_death9] +{ +}; + +void() vermis_death9 = [170, vermis_death10] +{ +}; + +void() vermis_death10 = [171, vermis_death11] +{ +}; + +void() vermis_death11 = [172, vermis_death12] +{ +}; + +void() vermis_death12 = [173, vermis_death13] +{ +}; + +void() vermis_death13 = [174, vermis_death14] +{ +}; + +void() vermis_death14 = [175, vermis_death15] +{ +}; + +void() vermis_death15 = [176, vermis_death16] +{ +}; + +void() vermis_death16 = [177, vermis_death17] +{ +}; + +void() vermis_death17 = [178, vermis_death18] +{ +}; + +void() vermis_death18 = [179, vermis_death19] +{ +}; + +void() vermis_death19 = [180, vermis_death20] +{ +}; + +void() vermis_death20 = [181, vermis_death21] +{ +}; + +void() vermis_death21 = [182, vermis_death22] +{ +}; + +void() vermis_death22 = [183, vermis_death23] +{ +}; + +void() vermis_death23 = [184, vermis_death24] +{ +}; + +void() vermis_death24 = [185, vermis_death25] +{ +}; + +void() vermis_death25 = [186, vermis_death26] +{ +}; + +void() vermis_death26 = [187, vermis_death27] +{ +}; + +void() vermis_death27 = [188, vermis_death28] +{ +}; + +void() vermis_death28 = [189, vermis_death29] +{ +}; + +void() vermis_death29 = [190, vermis_death30] +{ + self.movetype = MOVETYPE_NOCLIP; +}; + +void() vermis_death30 = [191, vermis_death31] +{ +}; + +void() vermis_death31 = [192, vermis_death32] +{ +}; + +void() vermis_death32 = [193, vermis_death33] +{ +}; + +void() vermis_death33 = [194, vermis_death34] +{ +}; + +void() vermis_death34 = [195, vermis_death35] +{ + self.velocity = '0 0 -10'; +}; + +void() vermis_death35 = [196, vermis_death36] +{ + self.velocity = '0 0 -20'; +}; + +void() vermis_death36 = [197, vermis_death37] +{ + self.velocity = '0 0 -40'; +}; + +void() vermis_death37 = [198, vermis_death38] +{ + self.velocity = '0 0 -80'; +}; + +void() vermis_death38 = [199, vermis_death39] +{ + self.velocity = '0 0 -160'; +}; + +void() vermis_death39 = [200, vermis_death40] +{ + self.velocity = '0 0 -320'; +}; + +void() vermis_death40 = [201, vermis_death41] +{ + self.velocity = '0 0 -400'; +}; + +void() vermis_death41 = [202, vermis_death42] +{ + self.velocity = '0 0 -450'; +}; + +void() vermis_death42 = [203, vermis_death43] +{ +}; + +void() vermis_death43 = [204, vermis_death44] +{ +}; + +void() vermis_death44 = [205, vermis_death45] +{ +}; + +void() vermis_death45 = [206, vermis_death46] +{ +}; + +void() vermis_death46 = [207, vermis_death47] +{ +}; + +void() vermis_death47 = [208, vermis_death48] +{ +}; + +void() vermis_death48 = [209, vermis_death49] {}; +void() vermis_death49 = [210, vermis_death50] {}; +void() vermis_death50 = [211, vermis_death51] {}; +void() vermis_death51 = [210, vermis_death52] {}; +void() vermis_death52 = [209, vermis_death47] { + if (self.inv == 1) + self.think = SUB_Remove; + + self.inv = 1; +}; + +void() vermis_die = { + sound(self, CHAN_WEAPON, "vermis/death.wav", 1, 0); + self.solid = SOLID_NOT; + if (self.enemy) + self.enemy.vermis_grabbed = 0; + + vermis_death1(); +}; + +void() monster_vermis = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/vermis.mdl"; + precache_model("progs/vermis.mdl"); + precache_model2("progs/spore.mdl"); + precache_sound("vermis/grab.wav"); + precache_sound("vermis/death.wav"); + precache_sound("vermis/grabbed.wav"); + precache_sound("vermis/grndhit.wav"); + precache_sound("vermis/spore.wav"); + precache_sound("vermis/pop.wav"); + precache_sound("vermis/splash1.wav"); + precache_sound("vermis/splash2.wav"); + precache_sound("vermis/splash3.wav"); + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_NOCLIP; + setmodel(self, "progs/vermis.mdl"); + self.health = 3000; + if (self.coiled != 0) { + precache_sound("vermis/sight.wav"); + precache_sound("vermis/sight2.wav"); + self.th_stand = vermis_coil1; + setsize(self, '-64 -64 -512', '64 64 -64'); + } else { + precache_sound("vermis/sight2.wav"); + self.th_stand = vermis_idle1; + setsize(self, '-64 -64 -512', '64 64 256'); + } + self.th_run = vermis_run1; + self.th_missile = vermis_shoot1; + self.th_melee = vermis_melee; + self.th_pain = vermis_pain; + self.th_die = vermis_die; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was eradicated by a Vermis\n"; + + self.classtype = CT_MONVERMIS; + self.classgroup = CG_BOSS; + self.classmove = FALSE; + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + vermis_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_virtusboss.qc b/QC_other/QC_keep/mon_virtusboss.qc new file mode 100644 index 00000000..65071554 --- /dev/null +++ b/QC_other/QC_keep/mon_virtusboss.qc @@ -0,0 +1,433 @@ +void(vector p) newboss_missile; + +entity() FindNewBossSpot = { + local entity spot; + local float cyc; + spot = find(world, classname, "info_boss_spot"); + if (spot) + { + cyc = random() * MOVETYPE_STEP; + while (cyc > 1) + { + spot = find(spot, classname, "info_boss_spot"); + if (!spot) + { + spot = find(spot, classname, "info_boss_spot"); + } + cyc = cyc - 1; + } + return spot; + } + return self; +}; + +void() newboss_face = +{ + if (self.enemy.health <= 0 || random() < 0.020000) + { + self.enemy = find(self.enemy, classname, "player"); + if (!(self.enemy)) + { + self.enemy = find(self.enemy, classname, "player"); + } + } + ai_face(); +}; + +void() newboss_rise1 = [1, newboss_rise2] +{ + setmodel(self, self.mdl); + setsize(self, VEC_HULL2_MIN, '32 32 256'); + self.solid = SOLID_SLIDEBOX; + sound(self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM); + newboss_face(); +}; + +void() newboss_rise2 = [2, newboss_rise3] +{ + newboss_face(); +}; + +void() newboss_rise3 = [3, newboss_rise4] +{ + newboss_face(); +}; + +void() newboss_rise4 = [4, newboss_rise5] +{ + newboss_face(); +}; + +void() newboss_rise5 = [5, newboss_rise6] +{ + newboss_face(); +}; + +void() newboss_rise6 = [6, newboss_rise7] +{ + newboss_face(); +}; + +void() newboss_rise7 = [7, newboss_rise8] +{ + newboss_face(); +}; + +void() newboss_rise8 = [8, newboss_missile1] +{ + self.takedamage = DAMAGE_AIM; + self.th_stand(); +}; + +void() newboss_newplace = +{ + local entity newspot; + self.model = string_null; + self.nextthink = time + 1; + self.think = newboss_rise1; + newspot = FindNewBossSpot(); + setorigin(self, newspot.origin); + //self.origin_z = self.origin_z + 24; +}; + +void() newboss_sink1 = [8, newboss_sink2] +{ + self.takedamage = DAMAGE_NO; + setsize(self, VEC_HULL2_MIN, '32 32 0'); +}; + +void() newboss_sink2 = [7, newboss_sink3] +{ +}; + +void() newboss_sink3 = [6, newboss_sink4] +{ +}; + +void() newboss_sink4 = [5, newboss_sink5] +{ +}; + +void() newboss_sink5 = [4, newboss_sink6] +{ +}; + +void() newboss_sink6 = [3, newboss_sink7] +{ +}; + +void() newboss_sink7 = [2, newboss_sink8] +{ +}; + +void() newboss_sink8 = [1, newboss_newplace] +{ + sound(self, CHAN_WEAPON, "boss1/out1.wav", 1, ATTN_NORM); +}; + +void() newboss_idle1 = [16, newboss_idle2] +{ + if (self.enemy.health > 0 && (random() < 0.5 || (skill == MOVETYPE_WALK && random() < 0.8))) + { + newboss_missile1(); + } +}; + +void() newboss_idle2 = [15, newboss_idle3] +{ + newboss_face(); +}; + +void() newboss_idle3 = [14, newboss_idle4] +{ + newboss_face(); +}; + +void() newboss_idle4 = [15, newboss_idle5] +{ + newboss_face(); +}; + +void() newboss_idle5 = [16, newboss_idle6] +{ + newboss_face(); +}; + +void() newboss_idle6 = [8, newboss_idle1] +{ + newboss_face(); +}; + +void() newboss_missile1 = [9, newboss_missile2] +{ + newboss_missile('66 0 180'); +}; + +void() newboss_missile2 = [10, newboss_missile3] +{ + newboss_face(); +}; + +void() newboss_missile3 = [11, newboss_missile4] +{ + newboss_face(); +}; + +void() newboss_missile4 = [12, newboss_missile5] +{ + newboss_face(); +}; + +void() newboss_missile5 = [13, newboss_missile6] +{ + newboss_face(); +}; + +void() newboss_missile6 = [14, newboss_missile7] +{ + newboss_face(); +}; + +void() newboss_missile7 = [15, newboss_missile8] +{ + newboss_face(); +}; + +void() newboss_missile8 = [16, newboss_missile9] +{ + newboss_face(); +}; + +void() newboss_missile9 = [8, newboss_idle1] +{ + newboss_face(); +}; + +void() newboss_hurt1 = [29, newboss_hurt2] +{ +}; + +void() newboss_hurt2 = [30, newboss_hurt3] +{ +}; + +void() newboss_hurt3 = [31, newboss_hurt4] +{ +}; + +void() newboss_hurt4 = [32, newboss_idle1] +{ +}; + +void(entity inflictor, entity attacker, float damage) newboss_damage = { + if (self.health <= 0) { self.th_die(); remove(self); return; } + if (random() < 0.2) { + newboss_sink1(); + return; + } + if (random() * 300 > damage) { + return; + } + if (self.pain_finished > time) { + return; + } + self.pain_finished = time + FL_SWIM; + newboss_hurt1(); +}; + +void() newboss_finale2 = { + if (!(self.spawnflags & 2)) { + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "Designers & Artists:\nIntroduction - Eric Sage\nMunitions Warehouse - Eric Sage\nResearch Lab - John Zwicker\nMax Security Prison - Chris Haire\nUnderground Testing Station - \nKristian Hawkinson\nStation Omega - Eric Sage\nSubway Station - Bryan Baldwin\nThe BackAlleys - Eric Sage\nOffice Park - Sean Conlon\nFinal Confrontation - \nKristian Hawkinson, Eric Sage\nNew Textures - Brenda Lo, Eric Sage\n3D Content - Matt Peckham\nThe Wyrm - Eric Sage, John Zwicker"); + } + remove(self); +}; + +void() newboss_finale = { + local entity pos; + local entity pl; + killed_monsters = killed_monsters + 1; + self.model = string_null; + self.mdl = string_null; + WriteByte(MSG_ALL, SVC_KILLEDMONSTER); + if (!(self.spawnflags & 2)) { + intermission_exittime = time + 10000000; + intermission_running = 1; + pos = find(world, classname, "info_intermission"); + if (!pos) { + pos = find(world, classname, "info_boss_spot"); + } + if (!pos) { + error("no info_intermission"); + } + + WriteByte(MSG_ALL, SVC_FINALE); + WriteString(MSG_ALL, "Congratulations! You have completed the\ndemo episodes created for you\nby Virtus!\nNow your mission is to create\nyour own nightmare!\n"); + pl = find(world, classname, "player"); + while (pl != world) { + pl.view_ofs = VEC_ORIGIN; + pl.angles = pos.mangle; + pl.fixangle = 1; + pl.map = self.map; + pl.nextthink = time + 0.5; + //pl.takedamage = DAMAGE_NO; + pl.solid = SOLID_NOT; + pl.movetype = MOVETYPE_NONE; + pl.modelindex = 0; + setorigin(pl, pos.origin); + pl = find(pl, classname, "player"); + } + } + self.nextthink = time + 20; + self.think = newboss_finale2; +}; + +void() newboss_death1 = [17, newboss_death2] { + sound(self, CHAN_VOICE, "boss1/death.wav", 1, ATTN_NORM); +}; + +void() newboss_death2 = [18, newboss_death3] +{ +}; + +void() newboss_death3 = [19, newboss_death4] +{ +}; + +void() newboss_death4 = [20, newboss_death5] +{ +}; + +void() newboss_death5 = [21, newboss_death6] +{ +}; + +void() newboss_death6 = [22, newboss_death7] +{ +}; + +void() newboss_death7 = [23, newboss_death8] +{ +}; + +void() newboss_death8 = [24, newboss_death9] +{ +}; + +void() newboss_death9 = [25, newboss_death10] +{ +}; + +void() newboss_death10 = [26, newboss_death11] +{ +}; + +void() newboss_death11 = [27, newboss_death12] +{ +}; + +void() newboss_death12 = [28, newboss_death12] +{ + local float z; + z = self.origin_z - 50; + sound(self, CHAN_BODY, "boss1/out1.wav", 1, ATTN_NORM); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, z); + self.use = SUB_Null; + self.th_die = SUB_Null; + self.nextthink = time + 0.2; + self.solid = SOLID_NOT; + self.think = newboss_finale; +}; + +void(vector p) newboss_missile = +{ + local vector offang; + local vector org; + local vector vec; + local vector d; + local float t; + offang = vectoangles(self.enemy.origin - self.origin); + makevectors(offang); + org = self.origin + p_x * v_forward + p_y * v_right + p_z * '0 0 1'; + if (skill > 1) { + t = vlen(self.enemy.origin - org) / 300; + vec = self.enemy.velocity; + vec_z = 0; + d = self.enemy.origin + t * vec; + } else { + d = self.enemy.origin; + } + vec = normalize(d - org); + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.angles = vectoangles(vec); + newmis.classname = "spike"; + newmis.think = SUB_Remove; + newmis.nextthink = time + MOVETYPE_TOSS; + setorigin(newmis, org); + setmodel(newmis, "progs/lavaball.mdl"); + newmis.avelocity = '200 100 300'; + setsize(newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vec * 300; + newmis.classtype = CT_PROJ_FIRETOP; + newmis.touch = Touch_Missile; + sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + if (self.enemy.health <= 0) newboss_idle1(); +}; + +void() newboss_awake = { + local float z; + self.use = SUB_Null; + z = self.origin_z - 50; + self.flags = FL_MONSTER; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_AIM; + self.th_pain = newboss_damage; + setmodel(self, "progs/virtus/newboss.mdl"); + setsize(self, VEC_HULL2_MIN, '32 32 256'); + self.enemy = activator; + self.yaw_speed = 20; + self.th_stand = newboss_missile1; + self.th_run = newboss_missile1; + newboss_rise1(); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord(MSG_BROADCAST, self.origin_x); + WriteCoord(MSG_BROADCAST, self.origin_y); + WriteCoord(MSG_BROADCAST, z); +}; + +void() monster_newboss = { + if (deathmatch) { remove(self); return; } + precache_model("progs/virtus/newboss.mdl"); + precache_model("progs/lavaball.mdl"); + precache_sound("weapons/rocket1i.wav"); + precache_sound("boss1/out1.wav"); + precache_sound("boss1/sight1.wav"); + precache_sound("misc/power.wav"); + precache_sound("boss1/throw.wav"); + precache_sound("boss1/pain.wav"); + precache_sound("boss1/death.wav"); + total_monsters = total_monsters + 1; + self.use = newboss_awake; + self.mdl = "progs/virtus/newboss.mdl"; + if (self.health < 1) self.health = 1800; + self.th_run = SUB_Null; + self.max_health = self.health; + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + if (self.deathstring == "") self.deathstring = " was destroyed by a Virtus Worm\n"; + self.th_die = newboss_death1; + self.th_pain = newboss_damage; + self.classtype = CT_MONVIRTUS; +}; + +void() monster_virtus = { self.classname = "monster_newboss"; monster_newboss(); }; + +void() info_boss_spot = {}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_vomitus.qc b/QC_other/QC_keep/mon_vomitus.qc new file mode 100644 index 00000000..0d32d4bb --- /dev/null +++ b/QC_other/QC_keep/mon_vomitus.qc @@ -0,0 +1,559 @@ +/* +============================================================================== + +VOMITUS + +============================================================================== +*/ + +$cd id1/models/vomitus +$origin 0 0 24 +$base base +$skin skin + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 +$frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 +$frame walk20 walk21 walk22 walk23 walk24 walk25 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8 +$frame attack9 attack10 attack11 attack12 attack13 + +$frame pain1 pain2 pain3 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 death9 +$frame death10 death11 death12 death13 death14 death15 + +//========================================================================== + +// Vomitus attacks are placed here since they may be called during a +// non-attack animation scene. + +// Spews forth a tarbaby. +void() Vomit_Spawn = +{ + local entity parent; + + parent = self; + + self = spawn(); + self.flags = 0; + // Owner set to vomitus so the tarbaby can pass through it if necessary. + self.owner = self.master = parent; + setorigin (self, parent.origin); + self.spawned = TRUE; + self.spawnflags = parent.spawnflags & SPAWN_WHITE; + self.classname = "monster_tarbaby"; + // Monster is spew out of parent's yaw, so face away. + self.angles_x = 0; + self.angles_y = parent.angles_y; + self.angles_z = 0; +// The monster shall appear now. + monster_tarbaby (); + +// Yaw may change during tarbaby ai, change yaw back. + self.angles_y = parent.angles_y; + self.fixangle = TRUE; +// Override normal ai with flying ai, since it is launched out of vomitus. + self.enemy = parent.enemy; + tbaby_birth (); + +// Pet counter, used to enforce limits. + self.xfl = self.xfl | XFL_PET; + parent.pets = parent.pets + 1; + +// Successfully spawned a new creature. + self = parent; +}; + +// Vomits chunks of meat at the enemy. +void(float no) Vomit_Meat = +{ + local vector org, dir, err; + local float side, up; + + err = '0 0 0'; + if (no) + { + if (random() < no) + return; + err_x = 10; + } + side = crandom() * 3; + up = random() * 300; + makevectors (self.angles); + org = self.origin + v_forward*20 + v_right*side - v_up*6; + dir = Maim_Toss (org, self.enemy.origin, 800, up, world, err); + + up = random(); + Meat_Launch (org, dir); + if (up < 0.2) + setmodel (newmis, "progs/gib1.mdl"); + else + { // Bigger gibs... + newmis.dmg = random() * 15 + 15; + if (up < 0.4) + setmodel (newmis, "progs/h_zombie.mdl"); + else if (up < 0.7) + setmodel (newmis, "progs/gib2.mdl"); + else + setmodel (newmis, "progs/gib3.mdl"); + } + setsize (newmis, '0 0 0', '0 0 0'); +}; + +// Vomitus chews on the target. +// Note: This is called during running instead of an attack sequence. +void() vom_melee = +{ + local entity targ; + local float ldmg; + +// if (self.gorging) +// return; // It's food, so don't bite -- just run over it. + + targ = self.enemy; + if (!targ) + return; // removed before stroke + if (!CanDamage (targ, self)) // PM: Added just in case. + return; + if (!infront (targ)) + return; // PM: Unusual -- must be in front of mouth. + if (!InMeleeRange (80)) // PM: Dragons-related. + return; // Vomitus has short range for a fat monster. + //if (IsGhost (targ)) + //return; // Cannot hit wraith. + +//- - - - - - - - - +// Vomitus does the following on a successful attack: +// +// * Inflicts anywhere from 1 to 30 damage. +// * Life leech: 10% of damage inflicted is given back as health to vomitus. +// * 10% of eating the target's current weapon. +//- - - - - - - - - + sound (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM); + // Update 6/17/2011: Removed poison code. + if (random() < 0.1) // Eat the player's weapon on a critical hit. + War_Steal (self, targ, "Vomitus ate your "); + // Heal a little as it feeds on its victim. + ldmg = SUB_MeleeDamage (10); + T_Damage (targ, self, self, ldmg, DAMARMOR); +}; + +float(entity targ) IsZombieDown = +{ + if (targ.classname == "monster_zombie") + if (targ.solid == SOLID_NOT) + if (targ.frame == 172) // paine11. + return TRUE; + return FALSE; +}; + +// Crushes all nearby corpses into edible gibs. +// Any damage done to achieve this is given back as health to vomitus. +void() Vomit_Crush = +{ + local entity head, next, swap; + local float hp, gh; + +// Note: 45 is approximately 32 * sqrt(2). + head = QC_FindRadius (self.origin, 45); // Picks up solid_not. + while (head) + { + next = head.chain; // We may remove head so get the next in line. + + if (head.flags & FLx_CREATURE) + if (head.takedamage) // Corpses can take damage in Drake. + if (head != self) + { + // Crush the body into gibs it can eat. + if (head.deadflag == DEAD_DEAD) + { + if (head.th_gib) + { + gh = head.gib_health - 1; + hp = head.health - gh; + // Modified T_Heal rejects numbers under 1, so no need to fix. + swap = self; + self = head; + self.health = gh; + if (self.th_gib (0)) // Use 0 to minimize gib velocity. + { + self.th_gib = world.null_func; + T_Heal (swap, hp, TRUE); // Can exceed max hp. + } + self = swap; + } + } + else + { + if (IsZombieDown (head)) + { // Devour fallen zombies. + T_Heal (self, head.health, TRUE); + T_Kill (head, self, self, 0, "melee"); + } + } +// if (self.enemy == head) +// {self.enemy = world; self.gorging = FALSE;} + } + head = next; + } +}; + +// TODO: Have vomitus scan for corpses, go to them, and devour them. + +void() ai_vomit_stand = {Vomit_Crush(); ai_stand();}; +void(float dist) ai_vomit_walk = {Vomit_Crush(); ai_walk(dist);}; +void(float dist) ai_vomit_run = +{ + local float close; + + close = QC_CloseEnough (dist); + + Vomit_Crush(); + if (close) + { +// if (self.gorging) +// { +// if (IsDead (self.enemy) && (self.enemy.solid == SOLID_NOT)) +// {walkmove (self.angles_y, dist); return;} +// if (self.enemy.touch == Gib_Touch) +// {walkmove (self.angles_y, dist); return;} +// } +// else + { + // Move over the fallen zombie and crush it for an instakill. + if (IsZombieDown (self.enemy)) + {walkmove (self.angles_y, dist); return;} + // Turn around so it can bite the target while on the run. + if (self.enemy) + ai_face (); + } + } + ai_run(dist); +}; + +//========================================================================== + +// STAND - - - - - - - - - - - - - - - - +void() vom_stand1 =[ $walk1, vom_stand2 ] {ai_vomit_stand();}; +void() vom_stand2 =[ $walk2, vom_stand3 ] {ai_vomit_stand();}; +void() vom_stand3 =[ $walk3, vom_stand4 ] {ai_vomit_stand();}; +void() vom_stand4 =[ $walk4, vom_stand5 ] {ai_vomit_stand();}; +void() vom_stand5 =[ $walk5, vom_stand6 ] {ai_vomit_stand();}; +void() vom_stand6 =[ $walk4, vom_stand7 ] {ai_vomit_stand();}; +void() vom_stand7 =[ $walk3, vom_stand8 ] {ai_vomit_stand();}; +void() vom_stand8 =[ $walk2, vom_stand1 ] {ai_vomit_stand();}; + +// WALK - - - - - - - - - - - - - - - - +void() vom_idle_sfx = +{ +// Yes, use attn_norm instead of attn_idle. + sound (self, CHAN_VOICE, "gibfnt/gf_plop.wav", 1, ATTN_NORM); +}; +void() vom_walk1 =[ $walk1, vom_walk2 ] { + if (random() < 0.5) + vom_idle_sfx(); + ai_vomit_walk(2); +}; // 3 +void() vom_walk2 =[ $walk2, vom_walk3 ] {ai_vomit_walk(2);}; +void() vom_walk3 =[ $walk3, vom_walk4 ] {ai_vomit_walk(2);}; +void() vom_walk4 =[ $walk4, vom_walk5 ] {ai_vomit_walk(2);}; +void() vom_walk5 =[ $walk5, vom_walk6 ] {ai_vomit_walk(2);}; +void() vom_walk6 =[ $walk6, vom_walk7 ] {ai_vomit_walk(2);}; // 2 +void() vom_walk7 =[ $walk7, vom_walk8 ] {ai_vomit_walk(2);}; +void() vom_walk8 =[ $walk8, vom_walk9 ] {ai_vomit_walk(2);}; +void() vom_walk9 =[ $walk9, vom_walk10 ] {ai_vomit_walk(2);}; +void() vom_walk10 =[ $walk10, vom_walk11 ] {ai_vomit_walk(2);}; // 1 +void() vom_walk11 =[ $walk11, vom_walk12 ] {ai_vomit_walk(2);}; +void() vom_walk12 =[ $walk12, vom_walk13 ] {ai_vomit_walk(2);}; +void() vom_walk13 =[ $walk13, vom_walk14 ] {ai_vomit_walk(2);}; +void() vom_walk14 =[ $walk14, vom_walk15 ] {ai_vomit_walk(2);}; +void() vom_walk15 =[ $walk15, vom_walk16 ] {ai_vomit_walk(2);}; +void() vom_walk16 =[ $walk16, vom_walk17 ] {ai_turn();}; +void() vom_walk17 =[ $walk17, vom_walk18 ] {ai_turn();}; +void() vom_walk18 =[ $walk18, vom_walk19 ] {ai_turn();}; +void() vom_walk19 =[ $walk19, vom_walk20 ] {ai_turn();}; +void() vom_walk20 =[ $walk20, vom_walk21 ] {ai_turn();}; +void() vom_walk21 =[ $walk21, vom_walk22 ] {ai_turn();}; +void() vom_walk22 =[ $walk22, vom_walk23 ] {ai_turn();}; +void() vom_walk23 =[ $walk23, vom_walk24 ] {ai_turn();}; +void() vom_walk24 =[ $walk24, vom_walk25 ] {ai_turn();}; +void() vom_walk25 =[ $walk25, vom_walk1 ] {ai_turn();}; + +// RUN - - - - - - - - - - - - - - - - - +void() vom_run1 =[ $run1, vom_run2 ] { + if (random() < 0.2) + vom_idle_sfx(); + ai_vomit_run(4); +}; +void() vom_run2 =[ $run2, vom_run3 ] {ai_vomit_run(4);}; +void() vom_run3 =[ $run3, vom_run4 ] {ai_vomit_run(4);}; +void() vom_run4 =[ $run4, vom_run5 ] {vom_melee(); ai_vomit_run(4);}; +void() vom_run5 =[ $run5, vom_run6 ] {ai_vomit_run(4);}; +void() vom_run6 =[ $run6, vom_run7 ] {ai_vomit_run(4);}; +void() vom_run7 =[ $run7, vom_run8 ] {ai_vomit_run(4);}; +void() vom_run8 =[ $run8, vom_run1 ] {ai_vomit_run(4);}; + +// ATTACK - - - - - - - - - - - - - - - +void() vom_end1 =[ $attack11, vom_end2 ] {ai_face();}; +void() vom_end2 =[ $attack12, vom_end3 ] {ai_face();}; +void() vom_end3 =[ $attack13, vom_run1 ] {ai_face();}; + +void() vom_attack1 =[ $attack1, vom_attack2 ] { + self.pain_finished = time + 1.2; // Ignore pain during attack. + sound (self, CHAN_WEAPON, "gibfnt/gf_sprt1.wav", 1, ATTN_NORM); + ai_face(); +}; +void() vom_attack2 =[ $attack2, vom_attack3 ] {ai_face();}; +void() vom_attack3 =[ $attack3, vom_attack4 ] {ai_face();}; +void() vom_attack4 =[ $attack4, vom_attack5 ] {ai_face();}; +void() vom_attack5 =[ $attack5, vom_attack6 ] {ai_face();}; +void() vom_attack6 =[ $attack6, vom_attack7 ] {ai_face();}; +void() vom_attack7 =[ $attack7, vom_attack8 ] {ai_face();}; +void() vom_attack8 =[ $attack8, vom_attack9 ] {ai_face();}; +void() vom_attack9 =[ $attack9, vom_attack10 ] {ai_face();}; +void() vom_attack10 =[ $attack10, vom_attack11 ] {ai_face(); + if (random() < 0.5) + sound (self, CHAN_WEAPON, "vomitus/flesh1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "vomitus/flesh2.wav", 1, ATTN_NORM); + if (self.skin) + Vomit_Meat(0); + else + { + Vomit_Spawn(); + self.think = vom_end1; + } +}; +void() vom_attack11 =[ $attack11, vom_attack12 ] {ai_face(); Vomit_Meat(0.5);}; +void() vom_attack12 =[ $attack12, vom_attack13 ] {ai_face(); Vomit_Meat(0.5);}; +void() vom_attack13 =[ $attack13, vom_run1 ] {ai_face(); Vomit_Meat(0.5);}; +void() vom_attack = +{ + local float stop; + + stop = FALSE; + if (enemy_range == RANGE_MELEE) + if (random() < 0.5) // Don't auto-vomit all the time. + stop = TRUE; + if (skill < 1) + { // Only one child in Easy. + if (self.pets) + stop = TRUE; + } + else + { // Up to three. + if (self.pets >= 3) + stop = TRUE; + } + +// FIXME: Let blue vomitus spit vermis-like spores. Low priority though. + if (stop) + ai_charge (4); // Cannot vomit anymore for now. + else + vom_attack1 (); // Cough up a tarbaby. +}; + +// PAIN - - - - - - - - - - - - - - - - +void() vom_pain1 =[ $pain1, vom_pain2 ] {}; +void() vom_pain2 =[ $pain2, vom_pain3 ] {}; +void() vom_pain3 =[ $pain3, vom_pain4 ] {}; +void() vom_pain4 =[ $pain2, vom_pain5 ] {}; +void() vom_pain5 =[ $pain1, vom_run1 ] {}; + +void(entity inflictor, entity attacker, float damage) vom_pain = { +// don't make multiple pain sounds right after each other + if (self.pain_finished > time) + return; + + self.pain_finished = time + 2; + sound (self, CHAN_VOICE, "vomitus/groan.wav", 1, ATTN_NORM); + + if (SUB_IgnorePain ()) + return; // No pain anims in Nightmare. + + vom_pain1 (); + attacker = attacker; damage = damage; // Appease FrikQcc. +}; +/* +// DEATH - - - - - - - - - - - - - - - - +float(float dm) vom_gib = +{ +// PM: Don't even think about calling T_RadiusDamage here! +// This is because gib functions may be called by T_Damage, +// which may be called within in T_RadiusDamage loop. + if (self.health < self.gib_health) + { + local float loop; + + sound (self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM); + if (self.skin) + { // Meatwad + Tent_Explosion2 (self.origin, 64, 16); // Last could be an 8. + ThrowGib ("progs/gib1.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib2.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowGib ("progs/gib3.mdl", dm); + ThrowHead ("progs/h_vomit.mdl", dm); + } + else + { // Tar mother + Tent_Point (TE_TAREXPLOSION, self.origin); + while (loop < 5) + { + ThrowGib ("progs/tar_gib.mdl", dm); + loop = loop + 1; + } + ThrowHead ("progs/tar_gib.mdl", dm); + } + return TRUE; + } + return FALSE; +}; +*/ + +void() vom_die1 =[ $death1, vom_die2 ] {}; +void() vom_die2 =[ $death2, vom_die3 ] {}; +void() vom_die3 =[ $death3, vom_die4 ] {}; +void() vom_die4 =[ $death4, vom_die5 ] {}; +void() vom_die5 =[ $death5, vom_die6 ] {}; +void() vom_die6 =[ $death6, vom_die7 ] {/*monster_drop();*/}; +void() vom_die7 =[ $death7, vom_die8 ] {}; +void() vom_die8 =[ $death8, vom_die9 ] {}; +void() vom_die9 =[ $death9, vom_die10 ] {}; +void() vom_die10 =[ $death10, vom_die11 ] {}; +void() vom_die11 =[ $death11, vom_die12 ] {}; +void() vom_die12 =[ $death12, vom_die13 ] {}; +void() vom_die13 =[ $death13, vom_die14 ] {}; +void() vom_die14 =[ $death14, vom_die15 ] {}; +void() vom_die15 =[ $death15, vom_die16 ] {}; +void() vom_die16 =[ $death15, vom_die16 ] { + self.health = self.gib_health - 1; + vom_gib (self.health); // Pop into gibs. +}; + +void() vom_die = +{ + monster_death_precheck(); + //if (Shattered ()) + //return; + +// check for gib + //if (vom_gib (self.health)) + //return; + + sound (self, CHAN_VOICE, "vomitus/death.wav", 1, ATTN_NORM); + vom_die1 (); +}; + +// REVIVE - - - - - - - - - - - - - - - +void() vom_revive1 =[ $death14, vom_revive2 ] {}; +void() vom_revive2 =[ $death13, vom_revive3 ] {}; +void() vom_revive3 =[ $death12, vom_revive4 ] {}; +void() vom_revive4 =[ $death11, vom_revive5 ] {}; +void() vom_revive5 =[ $death10, vom_revive6 ] {}; +void() vom_revive6 =[ $death9, vom_revive7 ] {}; +void() vom_revive7 =[ $death8, vom_revive8 ] {}; +void() vom_revive8 =[ $death7, vom_revive9 ] {}; +void() vom_revive9 =[ $death6, vom_revive10 ] {}; +void() vom_revive10 =[ $death5, vom_revive11 ] {}; +void() vom_revive11 =[ $death4, vom_revive12 ] {}; +void() vom_revive12 =[ $death3, vom_revive13 ] {}; +void() vom_revive13 =[ $death2, vom_revive14 ] {}; +void() vom_revive14 =[ $death1, vom_run1 ] {}; + +// OTHER - - - - - - - - - - - - - - - - +void(float hello) vom_sight = +{ +// No greeting sound. Just croak if mad at something. + if (!hello) + sound (self, CHAN_VOICE, "gibfnt/gf_sbig.wav", 1, ATTN_NORM); +}; + +void() vom_cache = +{ + precache_gluttony (); // Sound when it eats gibs. + + precache_model ("progs/h_vomit.mdl"); + precache_model ("progs/h_zombie.mdl"); + precache_model ("progs/tar_gib.mdl"); + precache_model ("progs/drake/vomitus.mdl"); + precache_model ("progs/zom_gib.mdl"); + + precache_sound ("blob/death1.wav"); + precache_sound ("fish/bite.wav"); + precache_sound ("gibfnt/gf_plop.wav"); + precache_sound ("gibfnt/gf_sbig.wav"); + precache_sound ("gibfnt/gf_sprt1.wav"); + precache_sound ("vomitus/groan.wav"); + precache_sound ("vomitus/death.wav"); + precache_sound ("vomitus/flesh1.wav"); + precache_sound ("vomitus/flesh2.wav"); + precache_sound ("zombie/z_miss.wav"); + precache_sound ("zombie/z_hit.wav"); +}; + +//============ +// --> QUAKED monster_vomit (1 0 0) (-32 -32 -24) (32 32 24) Ambush +// +// Bbox should be '-40 40 -24' to '40 40 24', but then it would need +// multiple bboxs. Since Nehahra used standard shambler size, and +// the shambler is nearly as fat, use that size. +// +// Note to self: Quoth's gug is even fatter, yet it uses shambler bbox. +//============ +void() monster_vomit = +{ + if (!self.spawned) + { + if (noenemies) + {remove (self); return;} + vom_cache (); + tbaby_cache (); // It vomits tarbabies. + } + + // Nehahra used 300 health, but Doom cacodemon has 400. + monster_form ("progs/drake/vomitus.mdl", '-32 -32 -24', '32 32 24', 400, -65); + self.mass = MASS_HEAVY; + + self.th_stand = vom_stand1; + self.th_walk = vom_walk1; + self.th_run = vom_run1; + self.th_missile = vom_attack; + self.th_pain = vom_pain; + self.th_die = vom_die; + + self.th_sight = vom_sight; + self.th_gib = vom_gib; + self.th_revive = vom_revive1; + self.th_spawn = monster_vomit; + if (self.deathstring == "") self.deathstring = " was vomited on by a Vomitus\n"; + + if (!self.yaw_speed) self.yaw_speed = 15; // Slower than normal. + + self.headmdl = "progs/h_vomit.mdl"; + if (!self.skin) + { + self.headmdl = "progs/tar_gib.mdl"; + self.bloodtype = BLOOD_PURPLE; + } + + self.classtype = CT_MONVOMITUS; + self.classgroup = CG_SPAWN; + self.classmove = MON_MOVEWALK; + + monster_start (); +}; + +void() monster_vomitus = {self.classname = "monster_vomit"; monster_vomit();}; + +// Vomitus with meat skin. Looks a bit like Meatwad. +// Now where's Master Shake and Frylock? +void() monster_meatwad = { + self.skin = 1; + self.classname = "monster_vomit"; + monster_vomit(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_voreling.qc b/QC_other/QC_keep/mon_voreling.qc new file mode 100644 index 00000000..171be7ff --- /dev/null +++ b/QC_other/QC_keep/mon_voreling.qc @@ -0,0 +1,672 @@ +/*============================================================================== +VORELINGS (Originally from Quoth - Kell/Necros/Preach) +==============================================================================*/ +$frame idle1 idle2 idle3 idle4 idle5 idle6 idle7 idle8 +$frame idle9 idle10 idle11 idle12 idle13 + +$frame idleup1 idleup2 idleup3 idleup4 idleup5 idleup6 + +$frame drop1 drop2 drop3 drop4 drop5 + +$frame grow1 grow2 grow3 grow4 grow5 grow6 grow7 grow8 grow9 grow10 + +$frame walk1 walk2 walk3 walk4 walk5 + +$frame run1 run2 run3 run4 + +// Jumping up +$frame jump1 jump2 jump3 jump4 jump5 jump6 + +// Bite attack +$frame bite1 bite2 bite3 bite4 bite5 bite6 bite7 + +// Extremely short pain set +$frame pain1 pain2 + +// fall over and die +$frame death1 death2 death3 death4 death5 death6 + +// body flies up and then back to the ground +$frame deathB1 deathB2 deathB3 deathB4 deathB5 deathB6 deathB7 + +// Not used, modelling templates +$frame base1 base2 + +//====================================================================== +void() voreling_idle1 =[ $idle1, voreling_idle2 ] {monster_idle_sound();ai_stand();}; +void() voreling_idle2 =[ $idle2, voreling_idle3 ] {ai_stand();}; +void() voreling_idle3 =[ $idle3, voreling_idle4 ] {ai_stand();}; +void() voreling_idle4 =[ $idle4, voreling_idle5 ] {ai_stand();}; +void() voreling_idle5 =[ $idle5, voreling_idle6 ] {ai_stand();}; +void() voreling_idle6 =[ $idle6, voreling_idle7 ] {ai_stand();}; +void() voreling_idle7 =[ $idle7, voreling_idle8 ] {ai_stand();}; +void() voreling_idle8 =[ $idle8, voreling_idle9 ] {ai_stand();}; +void() voreling_idle9 =[ $idle9, voreling_idle10 ] {ai_stand();}; +void() voreling_idle10 =[ $idle10,voreling_idle11 ] {ai_stand();}; +void() voreling_idle11 =[ $idle11,voreling_idle12 ] {ai_stand();}; +void() voreling_idle12 =[ $idle12,voreling_idle13 ] {ai_stand();}; +void() voreling_idle13 =[ $idle13,voreling_idle1 ] {ai_stand();}; + +//====================================================================== +void() voreling_walk1 =[ $walk1, voreling_walk2 ] {monster_idle_sound();ai_walk(4);}; +void() voreling_walk2 =[ $walk2, voreling_walk3 ] {monster_footstep(FALSE); ai_walk(3);}; +void() voreling_walk3 =[ $walk3, voreling_walk4 ] {ai_walk(4);}; +void() voreling_walk4 =[ $walk4, voreling_walk5 ] {ai_walk(5);}; +void() voreling_walk5 =[ $walk5, voreling_walk1 ] {ai_walk(5);}; + +//====================================================================== +void() voreling_runpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + if (self.jump_flag < time) self.th_run(); + // Is the enemy too close? no more pausing, fight! + self.enemydist = range_distance(self.enemy, FALSE); + if (self.enemydist < MONAI_RUNPAUSE) self.th_run(); +}; + +//---------------------------------------------------------------------- +void() voreling_runp1 =[ $idle1, voreling_runp2 ] {voreling_runpause();}; +void() voreling_runp2 =[ $idle2, voreling_runp3 ] {voreling_runpause();}; +void() voreling_runp3 =[ $idle3, voreling_runp4 ] {voreling_runpause();}; +void() voreling_runp4 =[ $idle4, voreling_runp5 ] {voreling_runpause();}; +void() voreling_runp5 =[ $idle5, voreling_runp6 ] {voreling_runpause();}; +void() voreling_runp6 =[ $idle6, voreling_runp7 ] {voreling_runpause();}; +void() voreling_runp7 =[ $idle7, voreling_runp8 ] {voreling_runpause();}; +void() voreling_runp8 =[ $idle8, voreling_runp9 ] {voreling_runpause();}; +void() voreling_runp9 =[ $idle9, voreling_runp10 ] {voreling_runpause();}; +void() voreling_runp10 =[ $idle10,voreling_runp11 ] {voreling_runpause();}; +void() voreling_runp11 =[ $idle11,voreling_runp12 ] {voreling_runpause();}; +void() voreling_runp12 =[ $idle12,voreling_runp13 ] {voreling_runpause();}; +void() voreling_runp13 =[ $idle13,voreling_runp1 ] {voreling_runpause();}; + +//---------------------------------------------------------------------- +void(float dist) voreling_checkpause = +{ + // Do nothing is not to fight or dead + if (!self.enemy) return; + if (self.health < 1) return; + + // make vorelings run in bursts of speed (reset every run animation cycle) + self.movespeed = self.movespeed + 1; + // Do run code to check for enemies + ai_run(dist + self.movespeed); + if (self.enemydist < MONAI_RUNPAUSE) return; // Too close + + // Random chance to stop and pause running + if (self.movespeed > 7 && random() < 0.2) { + self.jump_flag = time + random(); + self.think = voreling_runp1; + } +}; + +//---------------------------------------------------------------------- +void() voreling_run1 =[ $run1, voreling_run2 ] {self.movespeed = 0; + monster_idle_sound(); + voreling_checkpause(8); + // Vorelings have constant problems with weird angles (X/Z) + // Just keep resetting them so they move normally + ai_resetangles(); +}; +void() voreling_run2 =[ $run2, voreling_run3 ] {monster_footstep(FALSE); voreling_checkpause(6);}; +void() voreling_run3 =[ $run3, voreling_run4 ] {voreling_checkpause(8);}; +void() voreling_run4 =[ $run4, voreling_run5 ] {voreling_checkpause(10);}; +void() voreling_run5 =[ $run1, voreling_run6 ] {voreling_checkpause(8);}; +void() voreling_run6 =[ $run2, voreling_run7 ] {monster_footstep(FALSE); voreling_checkpause(6);}; +void() voreling_run7 =[ $run3, voreling_run8 ] {voreling_checkpause(8);}; +void() voreling_run8 =[ $run4, voreling_run1 ] {voreling_checkpause(10);}; + +//====================================================================== +void() voreling_slide1 =[ $walk1, voreling_slide2 ] {ai_run_slide(6); monster_idle_sound();}; +void() voreling_slide2 =[ $walk2, voreling_slide3 ] {ai_run_slide(4);}; +void() voreling_slide3 =[ $walk3, voreling_slide4 ] {ai_run_slide(6);}; +void() voreling_slide4 =[ $walk4, voreling_slide5 ] {ai_run_slide(4);}; +void() voreling_slide5 =[ $walk5, voreling_run1 ] {ai_run(4);}; + +//====================================================================== +// VORELING 2 - PURPLE SPIT FUNCTIONS (range) +//====================================================================== +void(float sideang) voreling_spitacid = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where bolt is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "voreling/hiss2.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire spit in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_VORELING; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_VORE); +}; + +//---------------------------------------------------------------------- +void() voreling_spit1 = [ $pain1, voreling_spit2 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_VORELING); }; +void() voreling_spit2 = [ $pain2, voreling_spit3 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_VORELING); }; +void() voreling_spit3 = [ $bite1, voreling_spit4 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_VORELING); }; +void() voreling_spit4 = [ $bite2, voreling_spit5 ] {voreling_spitacid(-0.1);}; +void() voreling_spit5 = [ $bite3, voreling_spit6 ] {voreling_spitacid(0);}; +void() voreling_spit6 = [ $bite4, voreling_spit7 ] {voreling_spitacid(0.1);}; +void() voreling_spit7 = [ $bite5, voreling_spit8 ] {}; +void() voreling_spit8 = [ $bite6, voreling_spit9 ] {}; +void() voreling_spit9 = [ $bite7, voreling_run1 ] {}; + +//====================================================================== +// BITE +//====================================================================== +void() voreling_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // Get closer for extra bite + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEEVORELING)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_VOICE, "voreling/attackmunch.wav", TRUE, TRUE); + else sound(self, CHAN_VOICE, "voreling/attacktear.wav", TRUE, TRUE); + + // Voreling bite is very weak + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn some touch blood + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() voreling_bite1 =[ $bite1, voreling_bite2 ] {ai_face();}; +// Start bite attack loop +void() voreling_bite2 =[ $bite2, voreling_bite3 ] {ai_face();}; +void() voreling_bite3 =[ $bite3, voreling_bite4 ] {ai_face();}; +void() voreling_bite4 = [ $bite4, voreling_bite5 ] {voreling_melee();}; +void() voreling_bite5 = [ $bite5, voreling_bite6 ] {}; +void() voreling_bite6 =[ $bite6, voreling_bite7 ] { + if (ai_checkmelee(MONAI_MELEEVORELING) && self.enemy.health > 0) self.think = voreling_bite2;}; +// Exit bite attack loop +void() voreling_bite7 =[ $bite7, voreling_run1 ] {}; + +//============================================================================ +// JUMP FUNCTION (range) +//============================================================================ +void() Voreling_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other vorelings with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the voreling floating in the air? + if (!checkbottom(self)) { + // Is the voreling standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() voreling_leap1 =[ $jump1, voreling_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + monster_idle_sound(); +}; +void() voreling_leap2 =[ $jump2, voreling_leap3 ] {ai_face();}; +void() voreling_leap3 =[ $jump3, voreling_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = Voreling_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPVORELINGDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() voreling_leap4 =[ $jump4, voreling_leap5 ] {}; +void() voreling_leap5 =[ $jump5, voreling_leap6 ] {}; +void() voreling_leap6 =[ $jump6, voreling_leap7 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = voreling_leap3; + } + self.oldorigin = self.origin; +}; +//---------------------------------------------------------------------- +void() voreling_leap7 =[ $jump3, voreling_leap8 ] {monster_footstep(FALSE);}; +void() voreling_leap8 =[ $jump2, voreling_leap9 ] {monster_footstep(FALSE);}; +void() voreling_leap9 =[ $jump1, voreling_run1 ] {ai_resetangles();}; + +//====================================================================== +// CEILING VORELINGS - Idle/Drop/Touch/Land functions +//====================================================================== +void() voreling_idleup1 =[ $idleup1, voreling_idleup2] {monster_idle_sound();ai_stand();}; +void() voreling_idleup2 =[ $idleup2, voreling_idleup3] {ai_stand();}; +void() voreling_idleup3 =[ $idleup3, voreling_idleup4] {ai_stand();}; +void() voreling_idleup4 =[ $idleup4, voreling_idleup5] {ai_stand();}; +void() voreling_idleup5 =[ $idleup5, voreling_idleup6] {ai_stand();}; +void() voreling_idleup6 =[ $idleup6, voreling_idleup1] {ai_stand();}; + +//---------------------------------------------------------------------- +void() voreling_droptouch = +{ + // Check if landed on something that is not the ground? + if (!checkbottom(self)) { + // Is the voreling standing on something? + if (self.flags & FL_ONGROUND) { + self.flags = self.flags - FL_ONGROUND; + self.origin_z = self.origin_z + 8; + setorigin(self, self.origin); // raise up + self.attack_timer = time + 1; // reset timer + + makevectors (self.angles); + self.velocity = v_forward * 100 + '0 0 200'; + } + return; + } + + // No more flying, back to running + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setsize(self, self.bbmins, self.bbmaxs); + self.view_ofs = '0 0 24'; // Restore view offset + + self.touch = SUB_Null; // No more jump touching + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + if (self.enemy.flags & FL_CLIENT) monster_sightsound(); + + // Restore all think state functions (voreling is off the ceiling) + self.th_stand = voreling_idle1; + self.th_walk = voreling_walk1; + self.th_run = voreling_run1; + self.th_slide = voreling_slide1; + self.th_melee = voreling_bite1; + + // Voreling 1 and 2 have different range attacks + if (self.spawnflags & MON_VORELING_LARGE) self.th_missile = voreling_spit1; + else self.th_jump = voreling_leap1; + + // Back to running or standing around! + if (!self.enemy) self.think = self.th_stand; + else self.think = self.th_run; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() voreling_drop1 =[ $drop1, voreling_drop2 ] {}; +void() voreling_drop2 =[ $drop2, voreling_drop3 ] {}; +void() voreling_drop3 =[ $drop3, voreling_drop4 ] {}; +void() voreling_drop4 =[ $drop4, voreling_drop5 ] {}; +void() voreling_drop5 =[ $drop5, voreling_drop5 ] { + if (self.attack_timer < time || self.velocity_z == 0) voreling_droptouch(); +}; + +//---------------------------------------------------------------------------- +void() voreling_wakeup = +{ + // Dead already? + if (self.health < 1) return; + + // Only call wakeup function once + self.th_walk = self.th_run = self.th_slide = SUB_Null; + + // No longer need cling to ceiling spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & MON_VORELING_CEILING); + + self.flags = FL_MONSTER; // reset flags + + if (engine == ENG_FITZ) self.origin_z = self.origin_z - 8; + else self.origin_z = self.origin_z - 32; // Unstick from ceiling + setorigin(self, self.origin); // Move down slightly + + self.movetype = MOVETYPE_TOSS; // Affected by gravity + self.solid = SOLID_SLIDEBOX; + self.attack_timer = time + 1; // Stuck timer + + self.classmove = MON_MOVEWALK; // Back to walking/running + self.pain_finished = time + 1.5; // No pain + SUB_AttackFinished(2 + random()); // No attacking + + makevectors (self.angles); // Move towards face direction + self.velocity = v_forward * 50; // Slight nudge forward + + self.touch = voreling_droptouch; // Touch something? + if (!self.jump_flag) + self.jump_flag = time + 1 + random()*2; // Don't jump straight away + voreling_drop1(); // Turn around, cat tricks! +}; + +//====================================================================== +// MINION - Grow and spin up from nothing +//====================================================================== +void() voreling_growangle = {self.angles_y = self.angles_y + self.lefty;}; +void() voreling_grow1 = [ $grow1, voreling_grow2 ] {}; +void() voreling_grow2 = [ $grow2, voreling_grow3 ] {voreling_growangle();}; +void() voreling_grow3 = [ $grow3, voreling_grow4 ] {voreling_growangle();}; +void() voreling_grow4 = [ $grow4, voreling_grow5 ] {voreling_growangle();}; +void() voreling_grow5 = [ $grow5, voreling_grow6 ] {voreling_growangle();}; +void() voreling_grow6 = [ $grow6, voreling_grow7 ] {voreling_growangle();}; +void() voreling_grow7 = [ $grow7, voreling_grow8 ] {voreling_growangle();}; +void() voreling_grow8 = [ $grow8, voreling_grow9 ] {voreling_growangle();}; +void() voreling_grow9 = [ $grow9, voreling_grow10] {voreling_growangle();}; +void() voreling_grow10= [ $grow10, voreling_run1 ] { + // Is the voreling stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + // Finally spin back to original position + self.angles_y = self.angles_y + self.lefty; + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + + // Restore all think state functions + self.th_stand = voreling_idle1; + self.th_walk = voreling_walk1; + self.th_run = voreling_run1; + self.th_slide = voreling_slide1; + self.th_melee = voreling_bite1; + // Voreling 1 and 2 have different range attacks + if (self.spawnflags & MON_VORELING_LARGE) self.th_missile = voreling_spit1; + else { + self.th_jump = voreling_leap1; + self.th_jumpexit = voreling_leap7; + } + } +}; +//---------------------------------------------------------------------------- +void() voreling_grow = +{ + // Only call wakeup function once + self.th_stand = self.th_walk = self.th_run = SUB_Null; + if (random() < 0.5) self.lefty = 36; + else self.lefty = -36; + monster_sightsound(); + voreling_grow1(); +}; + +//============================================================================ +void() voreling_pain1 =[ $pain1, voreling_pain2 ] {}; +void() voreling_pain2 =[ $pain2, voreling_run1 ] {}; + +//---------------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) voreling_pain = +{ + // Has the voreling been hit while on the ceiling? + if (self.spawnflags & MON_VORELING_CEILING) { + self.pain_finished = time + 1; + voreling_wakeup(); + return; + } + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + self.pain_finished = time + 1; + + if (self.pain_check == 1) voreling_pain1(); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.2; + self.axhitme = 0; + voreling_pain1(); + } + } +}; + +//============================================================================ +void() voreling_die1 =[ $death1, voreling_die2 ] {}; +void() voreling_die2 =[ $death2, voreling_die3 ] {monster_check_gib();}; +void() voreling_die3 =[ $death3, voreling_die4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() voreling_die4 =[ $death4, voreling_die5 ] {}; +void() voreling_die5 =[ $death5, voreling_die6 ] {monster_death_postcheck();}; +void() voreling_die6 =[ $death6, voreling_die6 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() voreling_dieB1 =[ $deathB1, voreling_dieB2 ] {}; +void() voreling_dieB2 =[ $deathB2, voreling_dieB3 ] {monster_check_gib();}; +void() voreling_dieB3 =[ $deathB3, voreling_dieB4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() voreling_dieB4 =[ $deathB4, voreling_dieB5 ] {}; +void() voreling_dieB5 =[ $deathB5, voreling_dieB6 ] {}; +void() voreling_dieB6 =[ $deathB6, voreling_dieB7 ] {monster_death_postcheck();}; +void() voreling_dieB7 =[ $deathB7, voreling_dieB7 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------------- +void() voreling_die = +{ + // Vorelings are small, gibs don't bounce far + self.max_health = MON_NOGIBVELOCITY; + + // Has the voreling died while on the ceiling? + if (self.spawnflags & MON_VORELING_CEILING) + self.gibondeath = TRUE; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, "voreling/death.wav", 1, ATTN_NORM); + if (random() < 0.6) voreling_die1(); + else voreling_dieB1(); + } +}; + +/*====================================================================== +/*QUAKED monster_voreling (1 0 0) (-16 -16 -24) (16 16 24) Ambush +======================================================================*/ +void() setup_voreling; +void() monster_voreling = +{ + if (deathmatch) { remove(self); return; } + + if (self.spawnflags & MON_VORELING_LARGE) { + self.mdl = "progs/ad171/mon_vorelingp.mdl"; + self.gib1mdl = "progs/ad171/gib_vorelegp.mdl"; // Single Leg + + precache_model (self.mdl); + precache_model (self.gib1mdl); + precache_model (MODEL_PROJ_VORE); // Spit Projectile + } + if (!(self.spawnflags & MON_VORELING_LARGE) || + self.classtype == CT_CACHEVORELING) { + self.mdl = "progs/ad171/mon_voreling.mdl"; + self.gib1mdl = "progs/ad171/gib_voreleg.mdl"; // Single Leg + + precache_model (self.mdl); + precache_model (self.gib1mdl); + } + + // IDLE/COMBAT and SIGHT sounds + self.idle_sound = "voreling/idle.wav"; + precache_sound (self.idle_sound); + + // death/pain/attack sounds + precache_sound("voreling/death.wav"); + self.pain_sound = "voreling/pain.wav"; + precache_sound(self.pain_sound); + + precache_sound("voreling/miss.wav"); // Spit misses + precache_sound("voreling/hiss2.wav"); // Spit attack + precache_sound("voreling/attackmunch.wav"); + precache_sound("voreling/attacktear.wav"); + precache_sound("voreling/jumpland.wav"); + + self.sight_sound = "voreling/sight.wav"; + precache_sound (self.sight_sound); + + // Cache voreling is a special class used for precache only + if (self.classtype != CT_CACHEVORELING) setup_voreling(); +}; + +//---------------------------------------------------------------------------- +void() monster_shalrathminion = { + self.classtype = CT_CACHEVORELING; + self.spawnflags = MON_VORELING_LARGE; // Precache both vorelings + monster_voreling(); +}; + +//---------------------------------------------------------------------------- +void() setup_voreling = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; + self.pain_flinch = 10; // Always flinch + self.steptype = FS_TYPELIGHT; + self.pain_longanim = TRUE; // can be chopped with shadow axe + self.blockudeath = TRUE; // No humanoid death sound + self.meleeoffset = '20 0 0'; // Bite attack offset + self.attack_offset = '14 0 8'; // Used by purple voreling, at jaws + self.movespeed = 1; // Can never be a turret + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was nibbled by a Voreling\n"; + + self.th_checkattack = VorelingCheckAttack; + self.th_pain = voreling_pain; + self.th_die = voreling_die; + + if(!self.classtype) self.classtype = CT_MONVORELING; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + // Setup white/purple voreling difference + if (self.spawnflags & MON_VORELING_LARGE) { + if (self.health < 1) self.health = 60; + self.gibhealth = -25; + self.th_missile = voreling_spit1; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = voreling_leap1; + self.th_jumpexit = voreling_leap7; + } + + //---------------------------------------------------------------------- + // Ceiling vorelings have special idle animation + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.spawnflags & MON_VORELING_CEILING) { + self.th_stand = self.th_walk = voreling_idleup1; + self.th_run = self.th_slide = voreling_wakeup; + self.th_melee = self.th_missile = self.th_jump = voreling_wakeup; + // th_pain and th_die functions understand ceiling vorelings + } + // Special spawning minion need to start spinning + else if (self.classtype == CT_MINIONVORELING) { + self.th_stand = self.th_walk = self.th_run = voreling_grow; + self.th_melee = self.th_slide = SUB_Null; + self.th_missile = self.th_jump = SUB_Null; + } + // Default voreling behaviour functions + else { + self.th_stand = voreling_idle1; + self.th_walk = voreling_walk1; + self.th_run = voreling_run1; + self.th_melee = voreling_bite1; + self.th_slide = voreling_slide1; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn vorelings (requires monster_shalrathminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ) minion_voreling = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + update_minioncount(self.owner, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_voreling"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self.owner; // Spawner Parent Link + self.owner = minion; // Stop gibs interacting with minion + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONVORELING; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = 0; + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + if (random() < 0.2) minion.spawnflags = MON_VORELING_LARGE; + else minion.spawnflags = 0; + + if (minion.spawnflags & MON_VORELING_LARGE) { + minion.mdl = "progs/ad171/mon_vorelingp.mdl"; // Purpler horror + minion.gib1mdl = "progs/ad171/gib_vorelegp.mdl"; // Single Leg + } + else { + minion.mdl = "progs/ad171/mon_voreling.mdl"; // Creamy delight + minion.gib1mdl = "progs/ad171/gib_voreleg.mdl"; // Single Leg + } + + minion.idle_sound = "voreling/idle.wav"; + minion.sight_sound = "voreling/sight.wav"; + minion.pain_sound = "voreling/pain.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_voreling; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_wizard.qc b/QC_other/QC_keep/mon_wizard.qc new file mode 100644 index 00000000..5b4cedb7 --- /dev/null +++ b/QC_other/QC_keep/mon_wizard.qc @@ -0,0 +1,365 @@ +/*============================================================================== +WIZARD +==============================================================================*/ + +$cd id1/models/a_wizard +$origin 0 0 24 +$base wizbase +$skin wizbase + +$frame hover1 hover2 hover3 hover4 hover5 hover6 hover7 hover8 +$frame hover9 hover10 hover11 hover12 hover13 hover14 hover15 + +$frame fly1 fly2 fly3 fly4 fly5 fly6 fly7 fly8 fly9 fly10 +$frame fly11 fly12 fly13 fly14 + +$frame magatt1 magatt2 magatt3 magatt4 magatt5 magatt6 magatt7 +$frame magatt8 magatt9 magatt10 magatt11 magatt12 magatt13 + +$frame pain1 pain2 pain3 pain4 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 + +//============================================================================ +void() wiz_stand1 =[ $hover1, wiz_stand2 ] {monster_idle_sound(); ai_stand();}; +void() wiz_stand2 =[ $hover2, wiz_stand3 ] {ai_stand();}; +void() wiz_stand3 =[ $hover3, wiz_stand4 ] {ai_stand();}; +void() wiz_stand4 =[ $hover4, wiz_stand5 ] {ai_stand();}; +void() wiz_stand5 =[ $hover5, wiz_stand6 ] {ai_stand();}; +void() wiz_stand6 =[ $hover6, wiz_stand7 ] {ai_stand();}; +void() wiz_stand7 =[ $hover7, wiz_stand8 ] {ai_stand();}; +void() wiz_stand8 =[ $hover8, wiz_stand1 ] {ai_stand();}; + +//============================================================================ +void() wiz_walk1 =[ $hover1, wiz_walk2 ] {monster_idle_sound(); ai_walk(8);}; +void() wiz_walk2 =[ $hover2, wiz_walk3 ] {ai_walk(8);}; +void() wiz_walk3 =[ $hover3, wiz_walk4 ] {ai_walk(8);}; +void() wiz_walk4 =[ $hover4, wiz_walk5 ] {ai_walk(8);}; +void() wiz_walk5 =[ $hover5, wiz_walk6 ] {ai_walk(8);}; +void() wiz_walk6 =[ $hover6, wiz_walk7 ] {ai_walk(8);}; +void() wiz_walk7 =[ $hover7, wiz_walk8 ] {ai_walk(8);}; +void() wiz_walk8 =[ $hover8, wiz_walk1 ] {ai_walk(8);}; + +//============================================================================ +void() wiz_side1 =[ $hover1, wiz_side2 ] {monster_idle_sound(); ai_run(8);}; +void() wiz_side2 =[ $hover2, wiz_side3 ] {ai_run(8);}; +void() wiz_side3 =[ $hover3, wiz_side4 ] {ai_run(8);}; +void() wiz_side4 =[ $hover4, wiz_side5 ] {ai_run(8);}; +void() wiz_side5 =[ $hover5, wiz_side6 ] {ai_run(8);}; +void() wiz_side6 =[ $hover6, wiz_side7 ] {ai_run(8);}; +void() wiz_side7 =[ $hover7, wiz_side8 ] {ai_run(8);}; +void() wiz_side8 =[ $hover8, wiz_side1 ] {ai_run(8);}; + +//============================================================================ +void() wiz_run1 =[ $fly1, wiz_run2 ] {monster_idle_sound(); ai_run(16);}; +void() wiz_run2 =[ $fly2, wiz_run3 ] {ai_run(16);}; +void() wiz_run3 =[ $fly3, wiz_run4 ] {ai_run(16);}; +void() wiz_run4 =[ $fly4, wiz_run5 ] {ai_run(16);}; +void() wiz_run5 =[ $fly5, wiz_run6 ] {ai_run(16);}; +void() wiz_run6 =[ $fly6, wiz_run7 ] {ai_run(16);}; +void() wiz_run7 =[ $fly7, wiz_run8 ] {ai_run(16);}; +void() wiz_run8 =[ $fly8, wiz_run9 ] {ai_run(16);}; +void() wiz_run9 =[ $fly9, wiz_run10 ] {ai_run(16);}; +void() wiz_run10 =[ $fly10, wiz_run11 ] {ai_run(16);}; +void() wiz_run11 =[ $fly11, wiz_run12 ] {ai_run(16);}; +void() wiz_run12 =[ $fly12, wiz_run13 ] {ai_run(16);}; +void() wiz_run13 =[ $fly13, wiz_run14 ] {ai_run(16);}; +void() wiz_run14 =[ $fly14, wiz_run1 ] {ai_run(16);}; + +//============================================================================ +// Range attack +//============================================================================ +void() WizardAttackFinished = +{ + SUB_AttackFinished(2); + if (enemy_range >= RANGE_MID || !enemy_vis) { + self.attack_state = AS_STRAIGHT; + self.think = wiz_run1; + } + else { + self.attack_state = AS_SLIDING; + self.think = wiz_side1; + } +}; + +//---------------------------------------------------------------------- +// Fire spit missile towards player position +// The missile is setup and defined beforehand +//---------------------------------------------------------------------- +void() Wiz_FastFire = +{ + local vector vec; + local vector dst; + + if (self.owner.health > 0) { + self.owner.effects = self.owner.effects | EF_MUZZLEFLASH; + + makevectors (SUB_angEnemyTarget()); + dst = SUB_orgEnemyTarget() - 13*self.movedir; + + vec = normalize(dst - self.origin); + self.attack_speed = SPEED_WIZSPIKE + (skill * SPEED_WIZSKILL); + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + launch_projectile (self.origin, vec, CT_PROJ_WIZ, self.attack_speed); + newmis.owner = self.owner; + } + + remove (self); +}; + +//---------------------------------------------------------------------- +// Create two spit missiles ready for firing later (delay 0.6, 1.0) +// This code is hoping the player will strafe into the second shot +//---------------------------------------------------------------------- +void() Wiz_StartFast = +{ + local entity missile; + + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + self.v_angle = self.angles; + makevectors (self.angles); + + missile = spawn (); + missile.owner = self; + missile.nextthink = time + 0.6; + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + self.attack_offset + v_forward*14 + v_right*14); + missile.enemy = SUB_entEnemyTarget(); + missile.nextthink = time + 0.8; + missile.think = Wiz_FastFire; + missile.movedir = v_right; + + missile = spawn (); + missile.owner = self; + missile.nextthink = time + 1; + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin + self.attack_offset + v_forward*14 + v_right* -14); + missile.enemy = SUB_entEnemyTarget(); + missile.nextthink = time + 0.3; + missile.think = Wiz_FastFire; + missile.movedir = VEC_ORIGIN - v_right; +}; + +//---------------------------------------------------------------------- +void() wiz_fast1 =[ $magatt1, wiz_fast2 ] {ai_face();Wiz_StartFast();}; +void() wiz_fast2 =[ $magatt2, wiz_fast3 ] {ai_face();}; +void() wiz_fast3 =[ $magatt3, wiz_fast4 ] {ai_face();}; +void() wiz_fast4 =[ $magatt4, wiz_fast5 ] {ai_face();}; +void() wiz_fast5 =[ $magatt5, wiz_fast6 ] {ai_face();}; +void() wiz_fast6 =[ $magatt6, wiz_fast7 ] {ai_face();}; +void() wiz_fast7 =[ $magatt5, wiz_fast8 ] {ai_face();}; +void() wiz_fast8 =[ $magatt4, wiz_fast9 ] {ai_face();}; +void() wiz_fast9 =[ $magatt3, wiz_fast10] {ai_face();}; +void() wiz_fast10=[ $magatt2, wiz_run1 ] {WizardAttackFinished (); ai_face();}; + +//============================================================================ +void() wiz_wakeup =[ $hover1, wiz_run1 ] { + // Is the wizard stuck? cannot move? + if (pointcontents(self.origin) == CONTENT_SOLID) { + // Time to die! + self.health = self.gibhealth; + Killed(self, self); + } + else { + monster_sightsound(); + // Setup goals and warn other monsters + FoundHuntTarget(TRUE); + // Restore all think state functions + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = wiz_fast1; + self.th_slide = wiz_side1; + } +}; + +//============================================================================ +void() wiz_pain1 =[ $pain1, wiz_pain2 ] {}; +void() wiz_pain2 =[ $pain2, wiz_pain3 ] {}; +void() wiz_pain3 =[ $pain3, wiz_pain4 ] {}; +void() wiz_pain4 =[ $pain4, wiz_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) wiz_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) wiz_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.4; + self.axhitme = 0; + wiz_pain1 (); + } + } +}; + +//============================================================================ +void() wiz_death1 =[ $death1, wiz_death2 ] {}; +void() wiz_death2 =[ $death2, wiz_death3 ] {monster_check_gib();}; +void() wiz_death3 =[ $death3, wiz_death4 ] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() wiz_death4 =[ $death4, wiz_death5 ] {}; +void() wiz_death5 =[ $death5, wiz_death6 ] {}; +void() wiz_death6 =[ $death6, wiz_death7 ] {}; +void() wiz_death7 =[ $death7, wiz_death8 ] {monster_death_postcheck();}; +void() wiz_death8 =[ $death8, wiz_death8 ] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() wiz_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + if (!self.gibbed) { + sound (self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM); + self.velocity_x = -200 + 400*random(); + self.velocity_y = -200 + 400*random(); + self.velocity_z = 100 + 100*random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + wiz_death1 (); + } +}; + +/*====================================================================== +QUAKED monster_wizard (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() setup_wizard; +void() monster_wizard = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/wizard.mdl"; + self.headmdl = "progs/h_wizard.mdl"; + self.gib1mdl = "progs/ad171/gib_wzarm1.mdl"; // Left arm/stump + self.gib2mdl = "progs/ad171/gib_wzarm2.mdl"; // Right arm/stump + self.gib3mdl = "progs/ad171/gib_wztail.mdl"; // Tail section + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_WIZ); // Originally progs/w_spike.mdl + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.idle_sound = "wizard/widle1.wav"; + self.idle_sound2 = "wizard/widle2.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + + precache_sound ("wizard/wdeath.wav"); + self.pain_sound = "wizard/wpain.wav"; + precache_sound (self.pain_sound); + + precache_sound ("wizard/hit.wav"); // used by c code + precache_sound ("wizard/wattack.wav"); + + self.sight_sound = "wizard/wsight.wav"; + precache_sound (self.sight_sound); + + // Cache gargoyle is a special class used for precache only + if (self.classtype != CT_CACHEWIZARD) setup_wizard(); +}; + +//---------------------------------------------------------------------------- +void() monster_nourminion = { + self.classtype = CT_CACHEWIZARD; + monster_wizard(); +}; + +//---------------------------------------------------------------------------- +void() setup_wizard = +{ + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 80; + self.gibhealth = -30; + self.pain_flinch = 70; // high pain threshold + self.pain_longanim = TRUE; // Has long pain animation for Shadow Axe + self.blockudeath = TRUE; // no humanoid death sound + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + self.attack_offset = '0 0 30'; // Acid spit start location + + // Allow wizards to keep a certain distance above the enemy + if (self.spawnflags & MON_WIZARD_ABOVE) { + self.th_checkattack = GargoyleCheckAttack; + } + else { + // Default behaviour, really high distance checks + self.th_checkattack = WizardCheckAttack; + self.enemymaxdist = TRUE; + } + self.th_pain = wiz_pain; + self.th_die = wiz_die; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if(!self.classtype) self.classtype = CT_MONWIZARD; + if (!self.classgroup) self.classgroup = CG_WIZARD; + self.classmove = MON_MOVEFLY; + + if (self.classtype == CT_MINIONWIZARD) { + self.th_stand = self.th_walk = self.th_run = wiz_wakeup; + self.th_missile = self.th_slide = wiz_wakeup; + if (self.deathstring == "") self.deathstring = " was wrecked by a Scrag\n"; + } + else { + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = wiz_fast1; + self.th_slide = wiz_side1; + if (self.deathstring == "") self.deathstring = " was scragged by a Scrag\n"; + } + + monster_start(); +}; + +//---------------------------------------------------------------------------- +// A code way to spawn wizards (requires monster_nourminion entity) +//---------------------------------------------------------------------------- +void(vector minion_org, entity minion_targ, float minion_sflag) minion_wizard = +{ + local entity minion; + + // Check if there is space to spawn entity + if (entity_pcontent(minion_org)) return; + + // Self = minotaur, there is no egg + update_minioncount(self, 1); // Update spawn counters + + minion = spawn(); + minion.classname = "monster_wizard"; // For function searching + setorigin(minion, minion_org); // Move to new location + minion.owner = self; // Spawner Parent Link + + minion.effects = minion.flags = 0; // make sure are blank + minion.gibondeath = 1; // Always gib on death + minion.classtype = CT_MINIONWIZARD; // Special minion class + minion.enemy = minion_targ; // Target to attack + minion.spawnflags = minion_sflag; // Spawnflags + minion.classgroup = CG_WIZARD; // Don't turn on master + minion.minion_active = TRUE; // Minion flag + minion.bodyfadeaway = TRUE; // Get rid of body + + minion.mdl = "progs/wizard.mdl"; + minion.headmdl = "progs/h_wizard.mdl"; + minion.gib1mdl = "progs/ad171/gib_wzarm1.mdl"; // Left arm/stump + minion.gib2mdl = "progs/ad171/gib_wzarm2.mdl"; // Right arm/stump + minion.gib3mdl = "progs/ad171/gib_wztail.mdl"; // Tail section + + minion.pain_sound = "wizard/wpain.wav"; + minion.idle_sound = "wizard/widle1.wav"; + minion.idle_sound2 = "wizard/widle2.wav"; + minion.sight_sound = "wizard/wsight.wav"; + + minion.nextthink = time + 0.01; + minion.think = setup_wizard; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_wraith.qc b/QC_other/QC_keep/mon_wraith.qc new file mode 100644 index 00000000..0e365947 --- /dev/null +++ b/QC_other/QC_keep/mon_wraith.qc @@ -0,0 +1,908 @@ +/*============================================================================== +WRAITH from Rogue Expansion Pack +==============================================================================*/ +$skin wrthskin + +// Base animation pose +$frame basepose + +// Walk/Idle pose (strange lerp at the end of frame set) +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 + +// Magic Attack A - Swing arms forward with hand meeting together +$frame magicA1 magicA2 magicA3 magicA4 magicA5 magicA6 magicA7 magicA8 +$frame magicA9 magicA10 magicA11 magicA12 magicA13 magicA14 + +// Magic Attack B - Cup hands around a missile object infront and fire +$frame magicB1 magicB2 magicB3 magicB4 magicB5 magicB6 magicB7 magicB8 +$frame magicB9 magicB10 magicB11 magicB12 magicB13 + +// Magic Attack C - Swing right arm forward firing a projectile +$frame magicC1 magicC2 magicC3 magicC4 magicC5 magicC6 magicC7 magicC8 +$frame magicC9 magicC10 magicC11 magicC12 magicC13 magicC14 magicC15 + +// Pain A - Short flinch backwards +$frame painA1 painA2 painA3 painA4 painA5 painA6 + +// Pain B - Long motion of being hit several times +$frame painB1 painB2 painB3 painB4 painB5 painB6 painB7 painB8 +$frame painB9 painB10 painB11 + +// Death - Shrink down and explode +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 death15 + +float BONEOFFSET = 8; +float WRAITH_ALPHA = 0.7; +float WRAITH_ALPHAFIRE = 1; +float BALL_NAIL_COL1 = 0; // Red +float BALL_NAIL_COL2 = 1; // Sickly yellow +float BALL_SPIDER_COL1 = 1; // Sickly yellow +float BALL_DEBUFF_COL1 = 3; // Glowing yellow/red +float BALL_DEBUFF_COL2 = 3; // Glowing yellow/red +float FADEDEBUFF_TIME = 0.01; // Small amount of time +float WRAITH_SKINBLUE = 0; // Fire wraith +float WRAITH_SKINGREEN = 2; // Spider version +float WRAITH_SKINPURPLE = 4; // Scorpion version + +//====================================================================== +void() wraith_stand1 =[ $stand4, wraith_stand2 ] { monster_idle_sound();ai_stand();}; +void() wraith_stand2 =[ $stand5, wraith_stand3 ] { ai_stand();}; +void() wraith_stand3 =[ $stand6, wraith_stand4 ] { ai_stand();}; +void() wraith_stand4 =[ $stand7, wraith_stand5 ] { ai_stand();}; +void() wraith_stand5 =[ $stand8, wraith_stand6 ] { ai_stand();}; +void() wraith_stand6 =[ $stand9, wraith_stand7 ] { ai_stand();}; +void() wraith_stand7 =[ $stand9, wraith_stand8 ] { ai_stand();}; +void() wraith_stand8 =[ $stand8, wraith_stand9 ] { ai_stand();}; +void() wraith_stand9 =[ $stand7, wraith_stand10 ] { ai_stand();}; +void() wraith_stand10 =[ $stand6, wraith_stand11 ] { ai_stand();}; +void() wraith_stand11 =[ $stand5, wraith_stand12 ] { ai_stand();}; +void() wraith_stand12 =[ $stand4, wraith_stand1 ] { ai_stand();}; + +//====================================================================== +void() wraith_walk1 =[ $stand3, wraith_walk2 ] { monster_idle_sound();ai_walk(8);}; +void() wraith_walk2 =[ $stand4, wraith_walk3 ] { ai_walk(7);}; +void() wraith_walk3 =[ $stand5, wraith_walk4 ] { ai_walk(7);}; +void() wraith_walk4 =[ $stand6, wraith_walk5 ] { ai_walk(6);}; +void() wraith_walk5 =[ $stand7, wraith_walk6 ] { ai_walk(6);}; +void() wraith_walk6 =[ $stand8, wraith_walk7 ] { ai_walk(5);}; +void() wraith_walk7 =[ $stand9, wraith_walk8 ] { ai_walk(5);}; +void() wraith_walk8 =[ $stand10, wraith_walk9 ] { ai_walk(4);}; +void() wraith_walk9 =[ $stand11, wraith_walk10 ] { ai_walk(8);}; +void() wraith_walk10 =[ $stand12, wraith_walk1 ] { ai_walk(8);}; + +//====================================================================== +void() wraith_run1 =[ $stand3, wraith_run2 ] {monster_idle_sound(); + if (self.meleeattack < time) { + self.meleeattack = time + 4 + (random() + random() + random() * 4); + self.lefty = rint(1 - self.lefty); + } + ai_run(8); +}; +void() wraith_run2 =[ $stand4, wraith_run3 ] {ai_run(7);}; +void() wraith_run3 =[ $stand5, wraith_run3 ] {ai_run(7);}; +void() wraith_run4 =[ $stand6, wraith_run3 ] {ai_run(6);}; +void() wraith_run5 =[ $stand7, wraith_run3 ] {ai_run(6);}; +void() wraith_run6 =[ $stand8, wraith_run3 ] {ai_run(5);}; +void() wraith_run7 =[ $stand9, wraith_run3 ] {ai_run(5);}; +void() wraith_run8 =[ $stand10, wraith_run3 ] {ai_run(4);}; +void() wraith_run9 =[ $stand11, wraith_run3 ] {ai_run(8);}; +void() wraith_run10 =[ $stand12, wraith_run3 ] {ai_run(8);}; + +//============================================================================ +// Attachment management (create, finish and delete) +//============================================================================ +void() wraith_create_attachment = +{ + // Are the attachments setup yet? + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.classtype = CT_ATTACHMENT; + self.attachment.mdl = MODEL_PROJ_WBALL; + self.attachment.alpha = 0.85; + } + if (!self.attachment2) { + self.attachment2 = spawn(); + self.attachment2.owner = self; + self.attachment2.classtype = CT_ATTACHMENT; + self.attachment2.mdl = MODEL_PROJ_WBALL; + self.attachment2.alpha = 0.85; + } + if (!self.attachment3) { + self.attachment3 = spawn(); + self.attachment3.owner = self; + self.attachment3.classtype = CT_ATTACHMENT; + self.attachment3.mdl = self.weaponglow; + self.attachment3.alpha = 0.5; + } +}; + +//---------------------------------------------------------------------- +void() wraith_finish_attachment = +{ + if (self.attachment) { + setmodel(self.attachment, ""); + self.attachment.state = STATE_OFF; + } + if (self.attachment2) { + setmodel(self.attachment2, ""); + self.attachment2.state = STATE_OFF; + } + if (self.attachment3) { + setmodel(self.attachment3, ""); + self.attachment3.state = STATE_OFF; + self.attachment3.velocity = '0 0 0'; + } +}; + +//---------------------------------------------------------------------- +void() wraith_remove_attachment = +{ + if (self.attachment) { + self.attachment.think = SUB_Remove; + self.attachment.nextthink = time + 0.1; + } + if (self.attachment2) { + self.attachment2.think = SUB_Remove; + self.attachment2.nextthink = time + 0.1; + } + if (self.attachment3) { + self.attachment3.think = SUB_Remove; + self.attachment3.nextthink = time + 0.1; + } +}; + +//====================================================================== +// FADE OUT TEMPORARY MODELS +// Very quick fade (0.5s) - modified version of model_fade +//====================================================================== +void() debuff_fade = +{ + self.alpha = 0.5 - ((time - self.ltime) / 0.5); + + if (self.alpha < 0.2) { + self.alpha = 0; + self.model = ""; + self.think = SUB_Remove; + self.nextthink = time + 0.1; + return; + } + self.nextthink = time + FADEDEBUFF_TIME; +}; + +//---------------------------------------------------------------------- +// Start fading out (very quick, over 0.5s) +//---------------------------------------------------------------------- +void() wraith_debuff_chunk = +{ + self.think = debuff_fade; + self.nextthink = time + FADEDEBUFF_TIME; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +// Manual animation of ball at end of the debuff particle trail +//---------------------------------------------------------------------- +void() wraith_debuff_shrink = +{ + // Count downwards getting smaller + self.lip = self.frame - 1; + if (self.lip < 0) wraith_debuff_chunk(); + else { + // Check frame number before assigning + // Cannot set models with negative frame numbers + self.frame = self.lip; + self.think = wraith_debuff_shrink; + self.nextthink = time + 0.1; + } +}; + +//====================================================================== +// RANGE ATTACK 1 - Apply debuff to player (hitscan!) +// +// Generate an animated particle trail from 32 unit segments +// Slowly remove segments from source to target +// Generate a ball at target location slowly shrinking +//====================================================================== +void() wraith_fire_touch = +{ + if (other.solid == SOLID_TRIGGER) return; + if (other.classtype == CT_TEMPSTREAM) return; + if (other.health > 0) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 1; + self.model = ""; + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() wraith_fire_think = +{ + // Randomly drift upwards and slow down forward movement + self.velocity_z = self.velocity_z + 10 + (random() * 20); + self.velocity = self.velocity - (self.velocity * 0.125); + + self.frame = self.frame + 1; + if (self.frame > self.count) SUB_Remove(); + else self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void(vector start_org) wraith_debuff_explode = +{ + local float fire_loop; + local vector fire_angles, org, dir; + + fire_loop = 0; + fire_angles = '0 0 0'; + + while (fire_loop < 360) { + newmis = spawn(); + newmis.classtype = CT_TEMPSTREAM; + newmis.movetype = MOVETYPE_FLY; // Fly, no gravity + newmis.solid = SOLID_TRIGGER; + setmodel(newmis, SBURST_FLAME); + + org = start_org; + org_z = org_z + (crandom() * 24); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + fire_angles_y = fire_loop; + makevectors(fire_angles); + dir = vecrand(0,50,FALSE); + dir = dir + (v_forward * (400 + random() * 50)); + newmis.velocity = dir; + newmis.count = 6; + newmis.frame = rint(random()*2); + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) newmis.effects = newmis.effects + EF_NOSHADOW; + + newmis.think = wraith_fire_think; + newmis.touch = wraith_fire_touch; + newmis.nextthink = time + 0.1; + + fire_loop = fire_loop + rint(random()*15); + } +}; + +//---------------------------------------------------------------------- +void() wraith_debuff_trail = +{ + local vector org, orgofs, dir, tvec, tang; + local float tdist, tloop, tcount, tpc; + local entity tent; + + // Starting point of beam matched to wraith animation + makevectors (self.angles); + orgofs = '52 4 6'; + + // Calculate starting point and beam and vector direction + org = self.origin + attack_vector(orgofs); + tvec = SUB_orgEnemyTarget() - org; + // Create facing angle for segments + dir = normalize(tvec); + tang = vectoangles(dir); + + // Check for solid wall very close + tpc = pointcontents(org); + if (tpc == CONTENT_SOLID || tpc == CONTENT_SKY) return; + tpc = pointcontents(org+(dir*16)); + if (tpc == CONTENT_SOLID || tpc == CONTENT_SKY) return; + + // Check for obstacles (geo and monsters) + traceline(org, SUB_orgEnemyTarget(), FALSE, self); + tdist = trace_fraction * vlen(tvec); + if (tdist < 32) return; + tloop = tdist / 32; + tcount = 0; + + //---------------------------------------------------------------------- + // Originally - BleedDeBuff(SUB_entEnemyTarget()); + // New version - Fire explosion + burning + if (trace_ent.flags & FL_CLIENT) { + self.owner = self; // Fix for T_damage inside ApplyFireDmg + ApplyFireDmg(SUB_entEnemyTarget(), DAMAGE_PYROWRAITH, DAMAGE_PYROWRAITH); + } + else if (ai_foundbreakable(self, trace_ent, FALSE)) + T_Damage (trace_ent, self, self, 100, DAMARMOR); + + //---------------------------------------------------------------------- + // Generate particle beam in segments + while(tcount < tloop) { + // Create segment in the middle of 32 segment + tvec = org + (dir* (16 + tcount*32) ); + + // Spawn temporary entity + tent = spawn(); + tent.owner = self; + tent.classtype = CT_PROJ_WBOLT; + setsize (tent, VEC_ORIGIN, VEC_ORIGIN); + tent.movetype = MOVETYPE_FLYMISSILE; // Needs to float up + tent.solid = SOLID_NOT; + + // Special animated particle model (still, slow rotate, fast rotate) + setmodel(tent, MODEL_PROJ_WTRAIL); + setorigin(tent, tvec); + + tent.velocity = -v_up*5; // Slowly drift up to create trail particles + tent.angles = tang; // Rotate segment into place + tent.frame = 2; // Fast rotate animation group + tent.skin = 3; // Flame yellow/red + tcount = tcount + 1; // Next segment + + // Wait around for a while before fading out + tent.think = wraith_debuff_chunk; + tent.nextthink = time + (tcount *0.05); + } + + // Workout final destination of explosion and effects + self.finaldest = tvec+(dir *16); + + //---------------------------------------------------------------------- + // Spawn a ball of plasma at the final destionation + // Shrinking downwards in size over 0.1s frames + tent = spawn(); + tent.owner = self; + tent.classtype = CT_PROJ_WBOLT; + setsize (tent, VEC_ORIGIN, VEC_ORIGIN); + tent.movetype = MOVETYPE_FLYMISSILE;// Needs to float upward + tent.solid = SOLID_NOT; + setmodel(tent, MODEL_PROJ_WBALL); // Initial ball + setorigin(tent, self.finaldest); // Move ball to end of final segment + tent.velocity = -v_up*5; // Slowly drift upwards + tent.avelocity = '100 100 100'; // Slight rotation on all axis + tent.frame = 6; // Start really large + tent.skin = BALL_DEBUFF_COL2; + tent.think = wraith_debuff_shrink; // Animate manually + tent.nextthink = time + 0.1; + + //---------------------------------------------------------------------- + // Generate particle explosion (+ sound effect) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); // hard coded explosion + WriteCoord (MSG_BROADCAST, self.finaldest_x); + WriteCoord (MSG_BROADCAST, self.finaldest_y); + WriteCoord (MSG_BROADCAST, self.finaldest_z); + // Play original explosion sound + sound(tent, CHAN_WEAPON, "drole/r_explode.wav", 1, ATTN_NORM); + + //---------------------------------------------------------------------- + // Large circular flame explosion + wraith_debuff_explode(self.finaldest); +}; + +//---------------------------------------------------------------------- +void(entity handent, vector orgofs, vector orgside, float dbframe) wraith_debuffball = +{ + local vector org; + + // Frame 0 is start of the sequence (move everything into place) + if (dbframe == 0) { + handent.state = STATE_ON; + setorigin(handent, self.origin); + setmodel(handent, handent.mdl); + setsize (handent, VEC_ORIGIN, VEC_ORIGIN); + handent.movetype = MOVETYPE_NONE; + handent.solid = SOLID_NOT; + handent.skin = BALL_DEBUFF_COL1; + } + + // Generate attachment in hand (left) + org = self.origin + v_forward*orgofs_x + orgside*orgofs_y + v_up*orgofs_z; + setorigin(handent, org); + handent.angles_y = rint(random()*359); + handent.frame = dbframe; +}; + +//---------------------------------------------------------------------- +void(vector orgofs, float dbframe) wraith_debuff = +{ + if (self.health < 1) return; + + if (dbframe == 0) { + self.pain_finished = time + 1.1; + sound (self, CHAN_WEAPON, "wraith/attack1.wav", 1, ATTN_NORM); + + // Setup halo/glow models around wraith (5% larger) + setorigin(self.attachment3, self.origin); + setmodel(self.attachment3, self.attachment3.mdl); + setsize (self.attachment3, VEC_ORIGIN, VEC_ORIGIN); + self.attachment3.movetype = MOVETYPE_NONE; + self.attachment3.solid = SOLID_NOT; + } + + // Should be visible during attack cycle + self.skin = self.exactskin + 1; + self.alpha = WRAITH_ALPHAFIRE; + // Particles drifting up slowly from body + particle_explode(self.origin, 20, 2, self.part_style, PARTICLE_BURST_UPWARD); + // Update halo/glow model + self.attachment3.angles = self.angles; + self.attachment3.frame = self.frame; + self.attachment3.velocity = self.velocity; + // Randomly change alpha to make glow flicker + self.attachment3.alpha = 0.1 + random()*0.5; + + + // Keep turning towards enemy + ai_face(); + makevectors(self.angles); + + // Generate a ball in each hand + wraith_debuffball(self.attachment, orgofs, v_right, dbframe); + wraith_debuffball(self.attachment2, orgofs, -v_right, dbframe); +}; + +//---------------------------------------------------------------------- +// RANGE ATTACK 1 - Swing arms forward with hand meeting together +// +// The debuff attack is a hitscan attack but it does have 1s animation +// (backward frames) 30 32 8, 14 46 20, -6 46 28, -12 40 28 +// (forward frames) 0 46 30, 16 42 24, 32 38 20, 48 26 10, 52 14 6, 52 4 6 +void() wraith_debuff1 =[ $magicA1, wraith_magicA2 ] {ai_face();}; +void() wraith_magicA2 =[ $magicA2, wraith_magicA3 ] {ai_face();}; +void() wraith_magicA3 =[ $magicA3, wraith_magicA4 ] {wraith_debuff('30 32 8',0);}; +void() wraith_magicA4 =[ $magicA4, wraith_magicA5 ] {wraith_debuff('14 46 20',1);}; +void() wraith_magicA5 =[ $magicA5, wraith_magicA6 ] {wraith_debuff('-6 46 28',2);}; +void() wraith_magicA6 =[ $magicA6, wraith_magicA7 ] {wraith_debuff('-12 40 28',3);}; +void() wraith_magicA7 =[ $magicA7, wraith_magicA8 ] {wraith_debuff('0 46 30',3);}; +void() wraith_magicA8 =[ $magicA8, wraith_magicA9 ] {wraith_debuff('16 42 24',4);}; +void() wraith_magicA9 =[ $magicA9, wraith_magicA10 ] {wraith_debuff('32 38 20',4);}; +void() wraith_magicA10 =[ $magicA10, wraith_magicA11 ] {wraith_debuff('48 26 10',5);}; +void() wraith_magicA11 =[ $magicA11, wraith_magicA12 ] {wraith_debuff('52 14 6',5);}; +void() wraith_magicA12 =[ $magicA12, wraith_magicA13 ] { + wraith_debuff('52 4 6',6); + wraith_debuff_trail(); + self.skin = self.exactskin; + self.alpha = WRAITH_ALPHA; +}; +void() wraith_magicA13 =[ $magicA13, wraith_magicA14 ] {wraith_finish_attachment();}; +void() wraith_magicA14 =[ $magicA14, wraith_run1 ] {}; + +//====================================================================== +// RANGE ATTACK 2 - Small bone/nail attack (low damage) +// +// Create a ball of blood and throw it towards the player +// Turning the ball into a pile of bones/nails +//====================================================================== +void(vector orgofs, float nbframe) wraith_nailball = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (nbframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + // Setup regular/poison projectile + if (self.spawnflags & MON_WRAITH_SPIDERS) self.attachment.skin = BALL_NAIL_COL2; + else self.attachment.skin = BALL_NAIL_COL1; + + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "wraith/attack2.wav", 1, ATTN_NORM); + } + + // Turn towards enemy and make vector + ai_face(); + makevectors(self.angles); + + // Generate attachment in hand (left) + org = self.origin + attack_vector(orgofs); + setorigin(self.attachment, org); + self.attachment.angles_y = rint(random()*359); + self.attachment.frame = nbframe; +}; + +//---------------------------------------------------------------------- +void(vector boneofs) wraith_firenails = +{ + local vector org, dir; + local float bone_type; + if (self.health < 1) return; + + if (self.spawnflags & MON_WRAITH_SPIDERS) bone_type = CT_PROJ_WPOISON; + else bone_type = CT_PROJ_WBONE; + self.attack_speed = SPEED_WRAITHBONE + (skill * SPEED_WBONESKILL); + makevectors(self.angles); + + // Generate spike/bone at final animation position + org = self.origin + attack_vector(boneofs); + dir = SUB_orgEnemyTarget() + v_right*(BONEOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, bone_type, self.attack_speed+random()*25); + dir = SUB_orgEnemyTarget() - v_right*(BONEOFFSET*3); + dir = normalize(dir - org); + launch_projectile (org, dir, bone_type, self.attack_speed+random()*25); + dir = SUB_orgEnemyTarget() + v_up*BONEOFFSET; + dir = normalize(dir - org); + launch_projectile (org, dir, bone_type, self.attack_speed+random()*25); + dir = SUB_orgEnemyTarget() - v_up*BONEOFFSET; + dir = normalize(dir - org); + launch_projectile (org, dir, bone_type, self.attack_speed+random()*25); +}; + +//---------------------------------------------------------------------- +// RANGE ATTACK 2 - Small bone/nail attack (low damage) +// +// 32 22 0, 29 29 6, 15 33 16, 4 28 24, -6 20 24, -10 16 20, 6 16 14, +// 14 16 10, 54 5 6, 60 4 14 +void() wraith_nails1 =[ $magicC1, wraith_magicC2 ] {ai_face(); + SUB_AttackFinished(1 + random()); // Fire more frequent +}; +void() wraith_magicC2 =[ $magicC2, wraith_magicC3 ] {ai_face();}; +void() wraith_magicC3 =[ $magicC3, wraith_magicC4 ] {wraith_nailball('15 33 16',0);}; +void() wraith_magicC4 =[ $magicC4, wraith_magicC5 ] {wraith_nailball('4 28 24',1);}; +void() wraith_magicC5 =[ $magicC5, wraith_magicC6 ] {wraith_nailball('-6 20 24',2);}; +void() wraith_magicC6 =[ $magicC6, wraith_magicC7 ] {wraith_nailball('-10 16 20',3);}; +void() wraith_magicC7 =[ $magicC7, wraith_magicC8 ] {wraith_nailball('6 16 14',4);}; +void() wraith_magicC8 =[ $magicC8, wraith_magicC9 ] {wraith_nailball('14 16 10',5);}; +void() wraith_magicC9 =[ $magicC9, wraith_magicC10 ] {wraith_nailball('54 5 6',6);}; +void() wraith_magicC10 =[ $magicC10, wraith_magicC11 ] { + wraith_finish_attachment(); + wraith_firenails('60 4 14'); +}; +void() wraith_magicC11 =[ $magicC11, wraith_magicC12 ] {monster_idle_sound();}; +void() wraith_magicC12 =[ $magicC12, wraith_magicC13 ] {}; +void() wraith_magicC13 =[ $magicC13, wraith_magicC14 ] {}; +void() wraith_magicC14 =[ $magicC14, wraith_magicC15 ] {ai_face();}; +void() wraith_magicC15 =[ $magicC15, wraith_run1 ] {ai_face();}; + +//====================================================================== +// RANGE ATTACK 3 - spawn spider minion (optional) +// +// Create a ball of green goo and throw it towards the player +// Once ball has landed, hatch/explode and create spider (brown/green) +//====================================================================== +void(vector eggofs, float eggframe) Setup_WraithEgg = +{ + local vector org; + if (self.health < 1) return; + + // Frame 0 is start of the sequence (move everything into place) + if (eggframe == 0) { + self.attachment.state = STATE_ON; + setorigin(self.attachment, self.origin); + setmodel(self.attachment, self.attachment.mdl); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + self.attachment.skin = BALL_SPIDER_COL1; + + // Present wraith from going into pain during egg cycle + self.pain_finished = time + 1; + sound (self, CHAN_WEAPON, "wraith/attack3.wav", 1, ATTN_NORM); + // Should be visible during spawn minion cycle + self.skin = self.exactskin + 1; + self.alpha = WRAITH_ALPHAFIRE; + } + + // Turn towards enemy and update model attachment + // The offset is based on the wraith facing forward + ai_face(); + makevectors(self.angles); + org = self.origin + attack_vector(eggofs); + setorigin(self.attachment, org); + self.attachment.angles = self.angles; + self.attachment.frame = eggframe; +}; + +//====================================================================== +// RANGE ATTACK 3 - Cup hands around a spider egg infront and fire +// +// Spawn a yellow/green egg ball shape and then drop it towards the player +// The egg is spawned in the middle and moved up/down to generate particles +// 20 2 12, 18 2 12 +void() wraith_minion1 =[ $magicB1, wraith_magicB2 ] {ai_face();}; +void() wraith_magicB2 =[ $magicB2, wraith_magicB3 ] {Setup_WraithEgg('20 2 12',0);}; +void() wraith_magicB3 =[ $magicB3, wraith_magicB4 ] {Setup_WraithEgg('18 2 12',1);}; +void() wraith_magicB4 =[ $magicB4, wraith_magicB5 ] {Setup_WraithEgg('20 2 12',2);}; +void() wraith_magicB5 =[ $magicB5, wraith_magicB6 ] {Setup_WraithEgg('18 2 12',3);}; +void() wraith_magicB6 =[ $magicB6, wraith_magicB7 ] {Setup_WraithEgg('20 2 12',4);}; +void() wraith_magicB7 =[ $magicB7, wraith_magicB8 ] {Setup_WraithEgg('18 2 12',5);}; +void() wraith_magicB8 =[ $magicB8, wraith_magicB9 ] {Setup_WraithEgg('20 2 12',6);}; +void() wraith_magicB9 =[ $magicB9, wraith_magicB10 ] { + self.skin = self.exactskin; // Not glowing anymore + self.alpha = WRAITH_ALPHA; // Fade out + wraith_finish_attachment(); + Create_Egg('20 2 12'); + // Particles drifting up slowly from body + particle_explode(self.origin, 30, 2, self.part_style, PARTICLE_BURST_UPWARD); + +}; +void() wraith_magicB10 =[ $magicB10, wraith_magicB11 ] {}; +void() wraith_magicB11 =[ $magicB11, wraith_magicB12 ] {}; +void() wraith_magicB12 =[ $magicB12, wraith_magicB13 ] {ai_face();}; +void() wraith_magicB13 =[ $magicB13, wraith_run1 ] {ai_face();}; + +//---------------------------------------------------------------------- +void() wraith_magic = +{ + local entity truetarg, miniondef; + + // Make sure the attachments are setup ready + wraith_create_attachment(); + truetarg = SUB_entEnemyTarget(); + + if (self.spawnflags & MON_WRAITH_SPIDERS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_wraithminion"); + if (miniondef.classtype == CT_CACHESPIDER) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[WRAITH]\b Cannot find spider template!\n"); + self.spawnflags = self.spawnflags - MON_WRAITH_SPIDERS; + } + } + if (self.spawnflags & MON_WRAITH_SCORPIONS && !self.minion_active) { + // Check for minion template first + miniondef = find(world,classname,"monster_wraithminion2"); + if (miniondef.classtype == CT_CACHESCORPION) setup_minionsupport(); + else { + // If template no available, warn and remove feature + dprint("\b[WRAITH]\b Cannot find scorpion template!\n"); + self.spawnflags = self.spawnflags - MON_WRAITH_SCORPIONS; + } + } + + // Is the target the player or monster? + if (truetarg.flags & FL_CLIENT) { + if (self.spawnflags & (MON_WRAITH_SPIDERS | MON_WRAITH_SCORPIONS)) { + // Calculate a flat vector to ignore Z axis difference + self.enemydist = range_distance(self.enemy, TRUE); + // If the player is too close (melee distance) try old base attack + if (self.minion_baseattack > 0 && self.enemydist < MON_RANGE_MELEE) wraith_nails1(); + else { + // has the minion limit been reached? + if (query_minionactive(self) == TRUE) wraith_minion1(); + else wraith_nails1(); + } + } + // First ever attack is the fire debuff + else if (self.attack_speed < time) wraith_debuff1(); + // Does the player have the debuff already? + else if (truetarg.burning) wraith_nails1(); + else { + // Greater chance of debuff attack first + if (random() < 0.7) wraith_debuff1(); + else wraith_nails1(); + } + self.attack_speed = LARGE_TIMER; + } + // Always attack monsters with nails + else wraith_nails1(); +}; + +//============================================================================ +// Pain A - Short flinch backwards +void() wraith_painA1 = [ $painA1, wraith_painA2 ] {}; +void() wraith_painA2 = [ $painA2, wraith_painA3 ] {}; +void() wraith_painA3 = [ $painA3, wraith_painA4 ] {}; +void() wraith_painA4 = [ $painA4, wraith_painA5 ] {}; +void() wraith_painA5 = [ $painA5, wraith_painA6 ] {}; +void() wraith_painA6 = [ $painA6, wraith_run1 ] {}; + +//---------------------------------------------------------------------- +// Pain B - Long motion of being hit several times +void() wraith_painB1 = [ $painB1, wraith_painB2 ] {}; +void() wraith_painB2 = [ $painB2, wraith_painB3 ] {}; +void() wraith_painB3 = [ $painB3, wraith_painB4 ] {}; +void() wraith_painB4 = [ $painB4, wraith_painB5 ] {}; +void() wraith_painB5 = [ $painB5, wraith_painB6 ] {}; +void() wraith_painB6 = [ $painB6, wraith_painB7 ] {}; +void() wraith_painB7 = [ $painB7, wraith_painB8 ] {}; +void() wraith_painB8 = [ $painB8, wraith_painB9 ] {}; +void() wraith_painB9 = [ $painB9, wraith_painB10 ] {}; +void() wraith_painB10 = [ $painB10, wraith_painB11 ] {}; +void() wraith_painB11 = [ $painB11, wraith_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) wraith_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Make sure fire wraith skin/alpha is reset on pain/death + self.skin = self.exactskin; + self.alpha = WRAITH_ALPHA; + + // Hide any attachments + wraith_finish_attachment(); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) { + // Randomly pick which pain animation to play + if (random() < 0.85) wraith_painA1 (); + else { + self.pain_finished = time + 2; + wraith_painB1 (); + } + } + // The new axe forces monsters into long pain animations + else if (self.pain_check == 2) { + self.axhitme = 0; + self.pain_finished = time + 2; + wraith_painB1 (); + } + } +}; + +//============================================================================ +void() wraith_death2 =[ $death2, wraith_death3] {}; +void() wraith_death3 =[ $death3, wraith_death4] {}; +void() wraith_death4 =[ $death4, wraith_death5] {}; +void() wraith_death5 =[ $death5, wraith_death7] {}; +void() wraith_death7 =[ $death7, wraith_death9] {}; +void() wraith_death9 =[ $death9, wraith_death11] {}; +void() wraith_death11 =[ $death11, wraith_death13] {}; +void() wraith_death13 =[ $death13, wraith_death15] {}; +void() wraith_death15 =[ $death15, wraith_death15] +{ + // Throw gibs, but create more XY outward velocity + self.max_health = MON_XYGIBVELOCITY; + monster_ThrowGib(); + // Move the explosion up to the middle/top of the body + // Use to be a regular explosion, switched to tarbaby instead + self.origin = self.origin + '0 0 24'; + T_RadiusDamage (self, self, DAMAGE_WRAITH, world, IGNORECLASS); + + // Big purple explosion + if (ext_dppart) + pointparticles(particleeffectnum(DPP_WRAITHEXPLODE), self.origin, '0 0 0', 1); + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); // Hard coded explosion + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + // Play original explosion sound or replacement + sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + // Stop thinking and hide entity (prevent wraith_death15 loop) + self.nextthink = LARGE_TIMER; + self.think = SUB_Null; + entity_hide(self); +}; + +//---------------------------------------------------------------------- +void() wraith_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + self.solid = SOLID_NOT; + sound (self, CHAN_VOICE, "wraith/death1.wav", 1, ATTN_NORM); + + // Make sure fire wraith skin/alpha is reset on pain/death + self.skin = self.exactskin; + self.alpha = WRAITH_ALPHA; + + // Make sure any attachments are removed + wraith_remove_attachment(); + + // Make sure body stays floating up where it finally dies + // and do not drop to the ground (reset by monster_death_use func) + self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_FLY; + wraith_death2(); +}; + +/*====================================================================== +/*QUAKED monster_wraith (1 0 0) (-16 -16 -24) (16 16 32) Ambush +======================================================================*/ +void() monster_wraith = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_wraith.mdl"; + self.weaponglow = "progs/ad171/mon_wraith_glow.mdl"; + self.gib1mdl = "progs/ad171/gib_wraith1.mdl"; // Forearm + self.gib2mdl = "progs/ad171/gib_wraith2.mdl"; // Hand/Claw + self.gib3mdl = "progs/ad171/gib_wraith3.mdl"; // stump? + + precache_model (self.mdl); + precache_model (self.weaponglow); // Glowing halo effect + precache_model (MODEL_PROJ_WTRAIL); // Hitscan blood bolt + precache_model (MODEL_PROJ_WBALL); // ball growing 8 frames + precache_model (MODEL_PROJ_WEGG); // ball turned into egg + precache_model (MODEL_PROJ_WSHELL); // Gibs from Egg + + precache_model (MODEL_PROJ_WBONE); // Bone nails (fire/scorpion) + precache_model (MODEL_PROJ_WPOISON); // Poison nails (spider) + + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (self.gib3mdl); + + self.idle_sound = "wraith/idle1.wav"; + self.idle_sound2 = "wraith/idle2.wav"; + self.idle_soundcom = "wraith/idle3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + precache_sound ("wraith/death1.wav"); + self.pain_sound = "wraith/pain1.wav"; + precache_sound (self.pain_sound); + + precache_sound ("wraith/attack1.wav"); // HITSCAN bolt + precache_sound ("drole/r_explode.wav"); + precache_model (SBURST_FLAME); // Flames + + precache_sound ("wraith/attack2.wav"); // Nail/Bones + precache_sound ("wraith/attack3.wav"); // Minions + precache_sound ("wraith/bounce.wav"); // Egg bounce + + self.sight_sound = "wraith/sight1.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 350; + self.alpha = WRAITH_ALPHA; // Semi transparent + self.yaw_speed = 35; // Can turn really fast + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // not falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + if (self.height == 0) self.height = MONAI_ABOVEDIST; // Custom height + self.frame = 1; // First frame is never used! + + // Hitscan = 52 4 6; Nails = 60 4 14; Egg = 20 2 12; + self.attack_offset = '30 2 8'; // Half way point + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = WraithCheckAttack; + self.th_stand = wraith_stand1; + self.th_walk = wraith_walk1; + self.th_run = wraith_run1; + self.th_missile = wraith_magic; + self.th_pain = wraith_pain; + self.th_die = wraith_die; + + if (self.deathstring == "") self.deathstring = " was shattered by a Wraith\n"; + + // Cannot be both scorpion and spider minion spawner, def=spider + if (self.spawnflags & MON_WRAITH_SCORPIONS && self.spawnflags & MON_WRAITH_SPIDERS) + self.spawnflags = self.spawnflags - MON_WRAITH_SCORPIONS; + + // Setup each wraith type with different skins/particles + if (self.spawnflags & MON_WRAITH_SCORPIONS) { + self.minion_maxcount = 3; // default is usually 5! + self.exactskin = WRAITH_SKINPURPLE; // Purple/Blood skin + self.poisonous = FALSE; // Must be off for scorpion wraith + self.part_style = PARTICLE_BURST_PURPLE; // Purple cloud + } + else if (self.spawnflags & MON_WRAITH_SPIDERS) { + self.exactskin = WRAITH_SKINGREEN; // Poison/Green skin + if (self.poisonous < 0) self.poisonous = FALSE; // Poison debuff + else self.poisonous = TRUE; + self.part_style = PARTICLE_BURST_GREEN; // Poison cloud + } + else { + self.exactskin = WRAITH_SKINBLUE; // Blue/Red skin + self.poisonous = FALSE; // Must be off for fire wraith + self.part_style = PARTICLE_BURST_FIRE; + } + + self.classtype = CT_MONWRAITH; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEFLY; + + monster_start(); +}; diff --git a/QC_other/QC_keep/mon_wrath.qc b/QC_other/QC_keep/mon_wrath.qc new file mode 100644 index 00000000..6cd7aa54 --- /dev/null +++ b/QC_other/QC_keep/mon_wrath.qc @@ -0,0 +1,327 @@ +void () WrathMissileTouch; +void () WrathHome; +void (float AttackNumber) WrathMissile; + +void () wrath_stand1 = [ 1.000, wrath_stand1 ] { + if (random() < 0.1) monster_idle_sound(); + ai_stand (); +}; + +void () wrath_walk01 = [ 1.000, wrath_walk02 ] { monster_idle_sound(); ai_walk (8); }; +void () wrath_walk02 = [ 2.000, wrath_walk03 ] { ai_walk (8); }; +void () wrath_walk03 = [ 3.000, wrath_walk04 ] { ai_walk (8); }; +void () wrath_walk04 = [ 4.000, wrath_walk05 ] { ai_walk (8); }; +void () wrath_walk05 = [ 5.000, wrath_walk06 ] { ai_walk (8); }; +void () wrath_walk06 = [ 6.000, wrath_walk07 ] { ai_walk (8); }; +void () wrath_walk07 = [ 7.000, wrath_walk08 ] { ai_walk (8); }; +void () wrath_walk08 = [ 8.000, wrath_walk09 ] { ai_walk (8); }; +void () wrath_walk09 = [ 9.000, wrath_walk10 ] { ai_walk (8); }; +void () wrath_walk10 = [ 10.000, wrath_walk11 ] { ai_walk (8); }; +void () wrath_walk11 = [ 11.000, wrath_walk12 ] { ai_walk (8); }; +void () wrath_walk12 = [ 12.000, wrath_walk01 ] { ai_walk (8); }; + +void () wrath_run01 = [ 1.000, wrath_run02 ] { monster_idle_sound(); ai_run (12); }; +void () wrath_run02 = [ 2.000, wrath_run03 ] { ai_run (12); }; +void () wrath_run03 = [ 3.000, wrath_run04 ] { ai_run (12); }; +void () wrath_run04 = [ 4.000, wrath_run05 ] { ai_run (12); }; +void () wrath_run05 = [ 5.000, wrath_run06 ] { ai_run (12); }; +void () wrath_run06 = [ 6.000, wrath_run07 ] { ai_run (12); }; +void () wrath_run07 = [ 7.000, wrath_run08 ] { ai_run (12); }; +void () wrath_run08 = [ 8.000, wrath_run09 ] { ai_run (12); }; +void () wrath_run09 = [ 9.000, wrath_run10 ] { ai_run (12); }; +void () wrath_run10 = [ 10.000, wrath_run11 ] { ai_run (12); }; +void () wrath_run11 = [ 11.000, wrath_run12 ] { ai_run (12); }; +void () wrath_run12 = [ 12.000, wrath_run01 ] { ai_run (12); }; + +void () wrath_at_a01 = [ 13.000, wrath_at_a02 ] { ai_charge (12); }; +void () wrath_at_a02 = [ 14.000, wrath_at_a03 ] { ai_charge (12); }; +void () wrath_at_a03 = [ 15.000, wrath_at_a04 ] { ai_charge (12); }; +void () wrath_at_a04 = [ 16.000, wrath_at_a05 ] { ai_charge (12); }; +void () wrath_at_a05 = [ 17.000, wrath_at_a06 ] { ai_charge (12); }; +void () wrath_at_a06 = [ 18.000, wrath_at_a07 ] { ai_charge (12); }; +void () wrath_at_a07 = [ 19.000, wrath_at_a08 ] { ai_charge (12); }; +void () wrath_at_a08 = [ 20.000, wrath_at_a09 ] { ai_charge (12); }; +void () wrath_at_a09 = [ 21.000, wrath_at_a10 ] { ai_charge (12); }; +void () wrath_at_a10 = [ 22.000, wrath_at_a11 ] { ai_charge (12); }; +void () wrath_at_a11 = [ 23.000, wrath_at_a12 ] { WrathMissile (1); }; +void () wrath_at_a12 = [ 24.000, wrath_at_a13 ] { ai_charge (12); }; +void () wrath_at_a13 = [ 25.000, wrath_at_a14 ] { ai_charge (12); }; +void () wrath_at_a14 = [ 26.000, wrath_run01 ] { ai_charge (12); }; + +void () wrath_at_b01 = [ 27.000, wrath_at_b02 ] { ai_charge (12); }; +void () wrath_at_b02 = [ 28.000, wrath_at_b03 ] { ai_charge (12); }; +void () wrath_at_b03 = [ 29.000, wrath_at_b04 ] { ai_charge (12); }; +void () wrath_at_b04 = [ 30.000, wrath_at_b05 ] { ai_charge (12); }; +void () wrath_at_b05 = [ 31.000, wrath_at_b06 ] { ai_charge (12); }; +void () wrath_at_b06 = [ 32.000, wrath_at_b07 ] { WrathMissile (2); }; +void () wrath_at_b07 = [ 33.000, wrath_at_b08 ] { ai_charge (12); }; +void () wrath_at_b08 = [ 34.000, wrath_at_b09 ] { ai_charge (12); }; +void () wrath_at_b09 = [ 35.000, wrath_at_b10 ] { ai_charge (12); }; +void () wrath_at_b10 = [ 36.000, wrath_at_b11 ] { ai_charge (12); }; +void () wrath_at_b11 = [ 37.000, wrath_at_b12 ] { ai_charge (12); }; +void () wrath_at_b12 = [ 38.000, wrath_at_b13 ] { ai_charge (12); }; +void () wrath_at_b13 = [ 39.000, wrath_run01 ] { ai_charge (12); }; + +void () wrath_at_c01 = [ 40.000, wrath_at_c02 ] { ai_charge (12); }; +void () wrath_at_c02 = [ 41.000, wrath_at_c03 ] { ai_charge (12); }; +void () wrath_at_c03 = [ 42.000, wrath_at_c04 ] { ai_charge (12); }; +void () wrath_at_c04 = [ 43.000, wrath_at_c05 ] { ai_charge (12); }; +void () wrath_at_c05 = [ 44.000, wrath_at_c06 ] { ai_charge (12); }; +void () wrath_at_c06 = [ 45.000, wrath_at_c07 ] { ai_charge (12); }; +void () wrath_at_c07 = [ 46.000, wrath_at_c08 ] { WrathMissile (3); }; +void () wrath_at_c08 = [ 47.000, wrath_at_c09 ] { ai_charge (12); }; +void () wrath_at_c09 = [ 48.000, wrath_at_c10 ] { ai_charge (12); }; +void () wrath_at_c10 = [ 49.000, wrath_at_c11 ] { ai_charge (12); }; +void () wrath_at_c11 = [ 50.000, wrath_at_c12 ] { ai_charge (12); }; +void () wrath_at_c12 = [ 51.000, wrath_at_c13 ] { ai_charge (12); }; +void () wrath_at_c13 = [ 52.000, wrath_at_c14 ] { ai_charge (12); }; +void () wrath_at_c14 = [ 53.000, wrath_at_c15 ] { ai_charge (12); }; +void () wrath_at_c15 = [ 54.000, wrath_run01 ] { ai_charge (12); }; + +void () wrath_attack = { + local float r; + + r = random (); + if ( (r < 0.250) ) { + wrath_at_a01 (); + } else { + if ( (r < 0.650) ) { + wrath_at_b01 (); + } else { + wrath_at_c01 (); + } + } + sound (self,CHAN_VOICE,"wrath/watt.wav",TRUE,ATTN_NORM); +}; + +void () wrath_pn_a01 = [ 55.000, wrath_pn_a02 ] {}; +void () wrath_pn_a02 = [ 56.000, wrath_pn_a03 ] {}; +void () wrath_pn_a03 = [ 57.000, wrath_pn_a04 ] {}; +void () wrath_pn_a04 = [ 58.000, wrath_pn_a05 ] {}; +void () wrath_pn_a05 = [ 59.000, wrath_pn_a06 ] {}; +void () wrath_pn_a06 = [ 60.000, wrath_run01 ] {}; + +void () wrath_pn_b01 = [ 61.000, wrath_pn_b02 ] {}; +void () wrath_pn_b02 = [ 62.000, wrath_pn_b03 ] {}; +void () wrath_pn_b03 = [ 63.000, wrath_pn_b04 ] {}; +void () wrath_pn_b04 = [ 64.000, wrath_pn_b05 ] {}; +void () wrath_pn_b05 = [ 65.000, wrath_pn_b06 ] {}; +void () wrath_pn_b06 = [ 66.000, wrath_pn_b07 ] {}; +void () wrath_pn_b07 = [ 67.000, wrath_pn_b08 ] {}; +void () wrath_pn_b08 = [ 68.000, wrath_pn_b09 ] {}; +void () wrath_pn_b09 = [ 69.000, wrath_pn_b10 ] {}; +void () wrath_pn_b10 = [ 70.000, wrath_pn_b11 ] {}; +void () wrath_pn_b11 = [ 71.000, wrath_run01 ] {}; + +void (entity inflictor, entity attacker, float damage) wrath_pain = { + local float r; + + if ( (self.pain_finished > time) ) + return ; + + r = random (); + if ( (r > 0.100) ) { + self.pain_finished = (time + 0.500); + return ; + } + if ( (r < 0.070) ) { + wrath_pn_a01 (); + } else { + wrath_pn_b01 (); + } + self.pain_finished = (time + 3); + sound (self,CHAN_VOICE,"wrath/wpain.wav",TRUE,ATTN_NORM); +}; + +void () wrath_die02 = [ 73.000, wrath_die03 ] {}; +void () wrath_die03 = [ 74.000, wrath_die04 ] {}; +void () wrath_die04 = [ 75.000, wrath_die05 ] {}; +void () wrath_die05 = [ 76.000, wrath_die07 ] {}; +void () wrath_die07 = [ 78.000, wrath_die09 ] {}; +void () wrath_die09 = [ 80.000, wrath_die11 ] {}; +void () wrath_die11 = [ 82.000, wrath_die13 ] {}; +void () wrath_die13 = [ 84.000, wrath_die15 ] {}; +void () wrath_die15 = [ 86.000, wrath_die15 ] { + // Throw gibs, but create more XY outward velocity + self.max_health = MON_XYGIBVELOCITY; + monster_ThrowGib(); + // Move the explosion up to the middle/top of the body + // Use to be a regular explosion, switched to tarbaby instead + self.origin = self.origin + '0 0 24'; + T_RadiusDamage (self, self, 80, world, IGNORECLASS); + + // Big purple explosion + if (ext_dppart) + pointparticles(particleeffectnum(DPP_WRAITHEXPLODE), self.origin, '0 0 0', 1); + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); // Hard coded explosion + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + // Play original explosion sound or replacement + sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + // Stop thinking and hide entity (prevent wraith_death15 loop) + self.nextthink = LARGE_TIMER; + self.think = SUB_Null; + entity_hide(self); +}; + +void () wrath_die01 = { + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + self.solid = SOLID_NOT; + + sound (self,CHAN_VOICE,"wrath/wdthc.wav",TRUE,ATTN_NORM); + + // Make sure body stays floating up where it finally dies + // and do not drop to the ground (reset by monster_death_use func) + self.flags = self.flags | FL_FLY; + self.movetype = MOVETYPE_FLY; + wrath_die02(); +}; + +void () monster_wrath = { + if ( deathmatch ) { remove (self); return; } + + self.mdl = "progs/rogue/wrath.mdl"; + self.gib1mdl = "progs/drake/wrthgib1.mdl"; + self.gib2mdl = "progs/drake/wrthgib2.mdl"; + self.gib3mdl = "progs/drake/wrthgib3.mdl"; + + precache_model ("progs/rogue/wrath.mdl"); + precache_model ("progs/drake/w_ball.mdl"); + precache_model ("progs/drake/wrthgib1.mdl"); + precache_model ("progs/drake/wrthgib2.mdl"); + precache_model ("progs/drake/wrthgib3.mdl"); + precache_sound ("wrath/wsee.wav"); + precache_sound ("wrath/watt.wav"); + + self.pain_sound = "wrath/wpain.wav"; + precache_sound ("wrath/wpain.wav"); + + precache_sound ("wrath/wdthc.wav"); + + self.idle_sound = "wraith/idle1.wav"; + self.idle_sound2 = "wraith/idle2.wav"; + self.idle_soundcom = "wraith/idle3.wav"; + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + precache_sound (self.idle_soundcom); + + self.sight_sound = "wrath/wsee.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 400; + + self.yaw_speed = 35.000; // Can turn really fast + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // not falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.height = MONAI_ABOVEDIST; // Enemytarget distance above + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = wrath_stand1; + self.th_walk = wrath_walk01; + self.th_run = wrath_run01; + self.th_missile = wrath_attack; + self.th_pain = wrath_pain; + self.th_die = wrath_die01; + + self.classtype = CT_MONWRAITH; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEFLY; + if (self.deathstring == "") self.deathstring = " was disintegrated by a Wrath\n"; + + monster_start (); +}; + +void (float AttackNumber) WrathMissile = { + local entity missile; + local vector dir; + local vector org; + local float dist; + local float flytime; + + dir = normalize (((self.enemy.origin + '0.000 0.000 10.000') - self.origin)); + dist = vlen ((self.enemy.origin - self.origin)); + flytime = (dist * 0.002); + if ( (flytime < 0.100) ) + flytime = 0.100; + + self.effects = (self.effects | EF_MUZZLEFLASH); + makevectors (self.angles); + missile = spawn (); + missile.owner = self; + missile.solid = SOLID_BBOX; + missile.movetype = MOVETYPE_FLYMISSILE; + setmodel (missile,"progs/drake/w_ball.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + if ( (AttackNumber == 1) ) { + org = ((self.origin + (v_forward * 20.000)) + (v_up * 12)); + } else { + if ( (AttackNumber == 2) ) { + org = ((self.origin + (v_forward * 18.000)) + (v_up * 10)); + } else { + if ( (AttackNumber == 3) ) { + org = (((self.origin + (v_forward * 12)) + (v_up * 12)) + (v_right * 20.000)); + } else { + if ( (AttackNumber == 4) ) + org = ((self.origin + (v_forward * 20.000)) + (v_up * 16)); + } + } + } + setorigin (missile,org); + missile.velocity = (dir * 400); + missile.avelocity = '300.000 300.000 300.000'; + missile.enemy = self.enemy; + missile.touch = WrathMissileTouch; + missile.nextthink = (time + 0.100); + missile.think = WrathHome; + self.attack_finished = (time + 2); +}; + +void () WrathHome = { + if ( (self.enemy.health < TRUE) ) { + remove (self); + return ; + } + if ( (skill == 3) ) { + ai_track (self.enemy,550.000); + } else { + ai_track (self.enemy,400); + } + self.nextthink = (time + 0.100); + self.think = WrathHome; +}; + +void () WrathMissileTouch = { + if ( (((other == self.owner) || (other.classname == "monster_wrath")) || (other.classname == "monster_super_wrath")) ) { + remove (self); + return ; + } + if ( (other.classname == "monster_zombie") ) + T_Damage (other,self,self,110.000,DAMARMOR); + + T_RadiusDamage (self,self.owner,20.000,world,DAMAGEALL); + sound (self,CHAN_WEAPON,"weapons/r_exp3.wav",TRUE,ATTN_NORM); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + setmodel (self,"progs/drake/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1 (); +}; diff --git a/QC_other/QC_keep/mon_wrath_overlord.qc b/QC_other/QC_keep/mon_wrath_overlord.qc new file mode 100644 index 00000000..3218ee5b --- /dev/null +++ b/QC_other/QC_keep/mon_wrath_overlord.qc @@ -0,0 +1,420 @@ +float (entity thePoint) isSpawnPointEmpty = { + local entity neighbors; + local entity start; + + neighbors = findradius (thePoint.origin,FL_GODMODE); + if ( (neighbors == world) ) + return ( TRUE ); + + start = neighbors; + while ( neighbors ) { + if ( (neighbors != thePoint) ) { + if ( (neighbors.flags & FL_MONSTER) ) { + return ( FALSE ); + } else { + if ( (neighbors.classname == "player") ) { + return ( FALSE ); + } else { + if ( neighbors.think ) + return ( FALSE ); + } + } + } + neighbors = neighbors.chain; + if ( (neighbors == start) ) + return ( TRUE ); + } + return ( TRUE ); +}; + +entity () overlord_find_dest3 = { + local entity furthestDest; + local entity bestDest; + local entity curDest; + local entity thePlayer; + local float theDist; + local float curDist; + local float dot; + local vector curVector; + + furthestDest = world; + bestDest = world; + theDist = FALSE; + thePlayer = find (world,classname,"player"); + curDest = world; + makevectors (thePlayer.angles); + while ( TRUE ) { + curDest = find (curDest,classname,"info_overlord_destination"); + if ( (curDest == world) ) { + if ( (bestDest != world) ) + return ( bestDest ); + + return ( furthestDest ); + } + if ( isSpawnPointEmpty (curDest) ) { + curVector = (curDest.origin - thePlayer.origin); + curDist = vlen (curVector); + curVector = normalize (curVector); + dot = (curVector * v_forward); + if ( (dot > 0.600) ) { + if ( (curDist > 150.000) ) + bestDest = curDest; + } + if ( (curDist > theDist) ) { + furthestDest = curDest; + theDist = curDist; + } + } + } + return ( world ); +}; + +entity () overlord_find_dest = { + local entity curDest; + local entity lastDest; + local float loopCount; + + curDest = find (world,classname,"info_overlord_destination"); + if ( (curDest != world) ) { + lastDest = curDest; + loopCount = (random () * MOVETYPE_FLY); + while ( (loopCount > TRUE) ) { + curDest = nextent (curDest); + curDest = find (curDest,classname,"info_overlord_destination"); + if ( (curDest != world) ) { + if ( isSpawnPointEmpty (curDest) ) { + loopCount = (loopCount - TRUE); + lastDest = curDest; + } else { + curDest = world; + } + } else { + return ( lastDest ); + } + } + return ( curDest ); + } + return ( curDest ); +}; + +void () overlord_teleport = { + local float chance; + local entity theDest; + local vector org; + + if ( !(self.spawnflags & FL_SWIM) ) + return ; + + chance = random (); + if ( (chance > 0.750) ) + return ; + + theDest = overlord_find_dest3 (); + if ( (theDest == world) ) + return ; + + spawn_tfog (self.origin); + makevectors (self.angles); + org = (theDest.origin + (FL_MONSTER * v_forward)); + spawn_tfog (org); + spawn_tdeath (theDest.origin,self); + setorigin (self,theDest.origin); + self.flags = (self.flags - (self.flags & FL_ONGROUND)); +}; + +void () overlord_stand1 = [ 1.000, overlord_stand1 ] { ai_stand (); }; +void () overlord_walk01 = [ 1.000, overlord_walk02 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk02 = [ 2.000, overlord_walk03 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk03 = [ 3.000, overlord_walk04 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk04 = [ 4.000, overlord_walk05 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk05 = [ 5.000, overlord_walk06 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk06 = [ 6.000, overlord_walk07 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk07 = [ 7.000, overlord_walk08 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk08 = [ 8.000, overlord_walk09 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk09 = [ 9.000, overlord_walk10 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk10 = [ 10.000, overlord_walk11 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk11 = [ 11.000, overlord_walk12 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk12 = [ 12.000, overlord_walk13 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk13 = [ 13.000, overlord_walk14 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk14 = [ 14.000, overlord_walk15 ] { ai_walk (FL_CLIENT); }; +void () overlord_walk15 = [ 15.000, overlord_walk01 ] { ai_walk (FL_CLIENT); }; + +void () overlord_run01 = [ 1.000, overlord_run02 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run02 = [ 2.000, overlord_run03 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run03 = [ 3.000, overlord_run04 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run04 = [ 4.000, overlord_run05 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run05 = [ 5.000, overlord_run06 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run06 = [ 6.000, overlord_run07 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run07 = [ 7.000, overlord_run08 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run08 = [ 8.000, overlord_run09 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run09 = [ 9.000, overlord_run10 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run10 = [ 10.000, overlord_run11 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run11 = [ 11.000, overlord_run12 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run12 = [ 12.000, overlord_run13 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run13 = [ 13.000, overlord_run14 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run14 = [ 14.000, overlord_run15 ] { ai_run (STAT_TOTALMONSTERS); }; +void () overlord_run15 = [ 15.000, overlord_run01 ] { ai_run (STAT_TOTALMONSTERS); }; + +void () overlord_smash; + +void () overlord_at_a01 = [ 16.000, overlord_at_a02 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a02 = [ 17.000, overlord_at_a03 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a03 = [ 18.000, overlord_at_a04 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a04 = [ 19.000, overlord_at_a05 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a05 = [ 20.000, overlord_at_a06 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a06 = [ 21.000, overlord_at_a07 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a07 = [ 22.000, overlord_at_a08 ] { overlord_smash ();}; +void () overlord_at_a08 = [ 23.000, overlord_at_a09 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a09 = [ 24.000, overlord_at_a10 ] { ai_charge (STAT_TOTALMONSTERS);}; +void () overlord_at_a10 = [ 25.000, overlord_run01 ] { ai_charge (STAT_TOTALMONSTERS); }; + +void () overlord_at_b01 = [ 26.000, overlord_at_b02 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b02 = [ 27.000, overlord_at_b03 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b03 = [ 28.000, overlord_at_b04 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b04 = [ 29.000, overlord_at_b05 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b05 = [ 30.000, overlord_at_b06 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b06 = [ 31.000, overlord_at_b07 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b07 = [ 32.000, overlord_at_b08 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b08 = [ 33.000, overlord_at_b09 ] { overlord_smash (); }; +void () overlord_at_b09 = [ 34.000, overlord_at_b10 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b10 = [ 35.000, overlord_at_b11 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b11 = [ 36.000, overlord_at_b12 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b12 = [ 37.000, overlord_at_b13 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b13 = [ 38.000, overlord_at_b14 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_b14 = [ 39.000, overlord_run01 ] { ai_charge (STAT_TOTALMONSTERS); }; + +void () overlord_at_c01 = [ 40.000, overlord_at_c02 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c02 = [ 41.000, overlord_at_c03 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c03 = [ 42.000, overlord_at_c04 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c04 = [ 43.000, overlord_at_c05 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c05 = [ 44.000, overlord_at_c06 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c06 = [ 45.000, overlord_at_c07 ] { overlord_smash (); }; +void () overlord_at_c07 = [ 46.000, overlord_at_c08 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c08 = [ 47.000, overlord_at_c09 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c09 = [ 48.000, overlord_at_c10 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c10 = [ 49.000, overlord_at_c11 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c11 = [ 50.000, overlord_at_c12 ] { overlord_smash (); }; +void () overlord_at_c12 = [ 51.000, overlord_at_c13 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c13 = [ 52.000, overlord_at_c14 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_at_c14 = [ 53.000, overlord_run01 ] { ai_charge (STAT_TOTALMONSTERS); }; + +void () overlord_smash = { + local vector delta; + local float smashDmg; + + if ( !self.enemy ) + return ; + + if ( !CanDamage (self.enemy,self) ) + return ; + + ai_charge (MOVETYPE_BOUNCE); + delta = (self.enemy.origin - self.origin); + if ( (vlen (delta) > 100.000) ) + return ; + + smashDmg = (20.000 + (random () * MOVETYPE_BOUNCE)); + sound (self,CHAN_WEAPON,"s_wrath/smash.wav",TRUE,ATTN_NORM); + T_Damage (self.enemy,self,self,smashDmg,DAMARMOR); + delta = normalize (((self.enemy.origin - self.origin) + self.enemy.view_ofs)); + SpawnBlood (self.enemy, (self.enemy.origin - (delta * SVC_INTERMISSION)),(delta * -100.000),smashDmg); +}; + +void () overlord_melee = { + local float r; + + r = random (); + if ( (r < 0.330) ) { + overlord_at_a01 (); + } else { + if ( (r < 0.660) ) { + overlord_at_b01 (); + } else { + overlord_at_c01 (); + } + } +}; + +void () overlord_msl_a01 = [ 54.000, overlord_msl_a02 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a02 = [ 55.000, overlord_msl_a03 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a03 = [ 56.000, overlord_msl_a04 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a04 = [ 57.000, overlord_msl_a05 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a05 = [ 58.000, overlord_msl_a06 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a06 = [ 59.000, overlord_msl_a07 ] { WrathMissile (MOVETYPE_STEP); }; +void () overlord_msl_a07 = [ 60.000, overlord_msl_a08 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a08 = [ 61.000, overlord_msl_a09 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a09 = [ 62.000, overlord_msl_a10 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a10 = [ 63.000, overlord_msl_a11 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a11 = [ 64.000, overlord_msl_a12 ] { ai_charge (STAT_TOTALMONSTERS); }; +void () overlord_msl_a12 = [ 65.000, overlord_run01 ] { overlord_teleport (); }; + +void () overlord_missile = { overlord_msl_a01 (); }; + +void () overlord_pn_a01 = [ 66.000, overlord_pn_a02 ] {}; +void () overlord_pn_a02 = [ 67.000, overlord_pn_a03 ] {}; +void () overlord_pn_a03 = [ 68.000, overlord_pn_a04 ] { overlord_teleport (); }; +void () overlord_pn_a04 = [ 69.000, overlord_pn_a05 ] {}; +void () overlord_pn_a05 = [ 70.000, overlord_pn_a06 ] {}; +void () overlord_pn_a06 = [ 71.000, overlord_pn_a07 ] {}; +void () overlord_pn_a07 = [ 72.000, overlord_run01 ] {}; + +void () overlord_pn_b01 = [ 80.000, overlord_pn_b02 ] {}; +void () overlord_pn_b02 = [ 81.000, overlord_pn_b03 ] {}; +void () overlord_pn_b03 = [ 82.000, overlord_pn_b04 ] { overlord_teleport ();}; +void () overlord_pn_b04 = [ 83.000, overlord_pn_b05 ] {}; +void () overlord_pn_b05 = [ 84.000, overlord_pn_b06 ] {}; +void () overlord_pn_b06 = [ 85.000, overlord_pn_b07 ] {}; +void () overlord_pn_b07 = [ 86.000, overlord_run01 ] {}; + +void (entity inflictor, entity attacker, float damage) overlord_pain = { + local float r; + + if ( (self.pain_finished > time) ) + return ; + + r = random (); + if ( (r > 0.200) ) + return ; + + if ( (r < 0.150) ) { + overlord_pn_a01 (); + } else { + overlord_pn_b01 (); + } + self.pain_finished = (time + FL_SWIM); + sound (self,CHAN_VOICE,"wrath/wpain.wav",TRUE,ATTN_NORM); +}; + +void (string gibName) ol_toss = { + local vector flingVelocity; + local entity myGib; + + makevectors (self.angles); + flingVelocity = ((v_forward * 250.000) + (v_up * 300.000)); + flingVelocity = (flingVelocity + (v_up * ((random () * 100.000) - 50.000))); + flingVelocity = (flingVelocity + (v_right * ((random () * 200.000) - 100.000))); + myGib = StartGib (gibName); + myGib.velocity = flingVelocity; +}; + +void () overlord_die01 = [ 91.000, overlord_die02 ] { self.nextthink = (time + 0.050); }; +void () overlord_die02 = [ 92.000, overlord_die03 ] { self.flags = (self.flags | FL_FLY); self.nextthink = (time + 0.050); }; +void () overlord_die03 = [ 93.000, overlord_die04 ] { self.nextthink = (time + 0.050); }; +void () overlord_die04 = [ 94.000, overlord_die05 ] { self.nextthink = (time + 0.050); }; +void () overlord_die05 = [ 95.000, overlord_die06 ] { self.nextthink = (time + 0.050); }; +void () overlord_die06 = [ 96.000, overlord_die07 ] { self.nextthink = (time + 0.050); }; +void () overlord_die07 = [ 97.000, overlord_die08 ] { self.nextthink = (time + 0.050); }; +void () overlord_die08 = [ 98.000, overlord_die09 ] { self.nextthink = (time + 0.050); }; +void () overlord_die09 = [ 99.000, overlord_die10 ] { self.nextthink = (time + 0.050); }; +void () overlord_die10 = [ 99.000, overlord_die11 ] { self.nextthink = (time + 0.050); }; +void () overlord_die11 = [ 100.000, overlord_die12 ] { self.nextthink = (time + 0.050); }; +void () overlord_die12 = [ 101.000, overlord_die13 ] { self.nextthink = (time + 0.050); }; +void () overlord_die13 = [ 102.000, overlord_die14 ] { self.nextthink = (time + 0.050); }; +void () overlord_die14 = [ 103.000, overlord_die15 ] { self.nextthink = (time + 0.050); }; +void () overlord_die15 = [ 104.000, overlord_die16 ] { self.nextthink = (time + 0.050); }; +void () overlord_die16 = [ 105.000, overlord_die17 ] { self.nextthink = (time + 0.050); }; +void () overlord_die17 = [ 106.000, overlord_die18 ] { + self.model = ""; + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + WriteByte (MSG_BROADCAST,FALSE); + WriteByte (MSG_BROADCAST,MOVETYPE_STEP); + ol_toss ("progs/drake/s_wrtgb2.mdl"); + ol_toss ("progs/drake/s_wrtgb3.mdl"); + ol_toss ("progs/drake/wrthgib1.mdl"); + ol_toss ("progs/drake/wrthgib2.mdl"); + ol_toss ("progs/drake/wrthgib3.mdl"); + self.nextthink = (time + 0.100); +}; + +void () overlord_die18 = [ 107.000, overlord_die19 ] { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + WriteByte (MSG_BROADCAST,FALSE); + WriteByte (MSG_BROADCAST,MOVETYPE_STEP); + ThrowGib(1,2); + ThrowGib(2,2); + ThrowGib(3,2); + self.nextthink = (time + 0.100); +}; + +void () overlord_die19 = [ 107.000, overlord_die19 ] { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + WriteByte (MSG_BROADCAST,FALSE); + WriteByte (MSG_BROADCAST,MOVETYPE_STEP); + ThrowGib(1,2); + ThrowGib(2,2); + ThrowGib(3,2); + remove (self); +}; + +void () monster_super_wrath = { + if ( deathmatch ) { remove (self); return; } + + self.mdl = "progs/rogue/s_wrath.mdl"; + precache_model (self.mdl); + self.gib1mdl = "progs/drake/wrthgib1.mdl"; + self.gib2mdl = "progs/drake/wrthgib2.mdl"; + self.gib3mdl = "progs/drake/wrthgib3.mdl"; + precache_model ("progs/drake/s_wrtgb2.mdl"); + precache_model ("progs/drake/s_wrtgb3.mdl"); + precache_model ("progs/drake/wrthgib1.mdl"); + precache_model ("progs/drake/wrthgib2.mdl"); + precache_model ("progs/drake/wrthgib3.mdl"); + precache_model ("progs/gib1.mdl"); + precache_model ("progs/gib2.mdl"); + precache_model ("progs/gib3.mdl"); + precache_model ("progs/drake/w_ball.mdl"); + precache_sound ("wrath/wsee.wav"); + precache_sound ("wrath/watt.wav"); + self.pain_sound = "wrath/wpain.wav"; + precache_sound ("wrath/wpain.wav"); + precache_sound ("wrath/wdthc.wav"); + precache_sound ("s_wrath/smash.wav"); + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_WIDE; + if (self.health < 1) self.health = 1000.000; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.gibbed = FALSE; // not falling apart + self.pain_flinch = 70; // High pain threshold + self.blockudeath = TRUE; // no humanoid death sound + self.height = MONAI_ABOVEDIST; // Enemytarget distance above + self.pain_finished = FALSE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_stand = overlord_stand1; + self.th_walk = overlord_walk01; + self.th_run = overlord_run01; + self.th_missile = overlord_missile; + self.th_melee = overlord_melee; + self.th_pain = overlord_pain; + self.th_die = overlord_die02; + + self.classtype = CT_MONWRAITH; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEFLY; + if (self.deathstring == "") self.deathstring = " was obliterated by a Wrath Overlord\n"; + + monster_start (); +}; + +void () info_overlord_destination = { + self.mangle = self.angles; + self.angles = VEC_ORIGIN; + self.model = ""; + self.origin = (self.origin + '0.000 0.000 27.000'); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_wspider.qc b/QC_other/QC_keep/mon_wspider.qc new file mode 100644 index 00000000..25d1da8f --- /dev/null +++ b/QC_other/QC_keep/mon_wspider.qc @@ -0,0 +1,194 @@ +void() SpidMissile; + +void() spid_stand = [0, spid_stand] { ai_stand(); }; + +void() spid_walk1 = [0, spid_walk2] { if (random() < 0.2) sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_walk(MOVETYPE_STEP); }; +void() spid_walk2 = [1, spid_walk3] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_walk(MOVETYPE_STEP); }; +void() spid_walk3 = [2, spid_walk4] { ai_walk(MOVETYPE_STEP); }; +void() spid_walk4 = [3, spid_walk5] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_walk(MOVETYPE_STEP); }; +void() spid_walk5 = [4, spid_walk6] { ai_walk(MOVETYPE_STEP); }; +void() spid_walk6 = [5, spid_walk7] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_walk(MOVETYPE_STEP); }; +void() spid_walk7 = [6, spid_walk8] { ai_walk(MOVETYPE_STEP); }; +void() spid_walk8 = [7, spid_walk9] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_walk(MOVETYPE_STEP); }; +void() spid_walk9 = [8, spid_walk10] { ai_walk(MOVETYPE_STEP); }; +void() spid_walk10 = [9, spid_walk1] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_walk(MOVETYPE_STEP); }; + +void() spid_run1 = [0, spid_run2] { if (random() < 0.2) sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_run(12); }; +void() spid_run2 = [2, spid_run3] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); ai_run(12); }; +void() spid_run3 = [4, spid_run4] { ai_run(12); }; +void() spid_run4 = [6, spid_run5] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE);ai_run(12); }; +void() spid_run5 = [8, spid_run6] { ai_run(12); }; +void() spid_run6 = [0, spid_run7] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE);ai_run(12); }; +void() spid_run7 = [2, spid_run8] { ai_run(12); }; +void() spid_run8 = [4, spid_run9] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE);ai_run(12); }; +void() spid_run9 = [6, spid_run10] { ai_run(12); }; +void() spid_run10 = [8, spid_run1] { sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE);ai_run(12); }; + +void() spid_attack1 = [0, spid_attack2] { sound(self, CHAN_VOICE, "spider/fire.wav", 1, ATTN_NORM); ai_charge(12); }; +void() spid_attack2 = [2, spid_attack3] { ai_charge(12); }; +void() spid_attack3 = [4, spid_attack4] { ai_charge(12); }; +void() spid_attack4 = [6, spid_attack5] { ai_charge(12); }; +void() spid_attack5 = [8, spid_attack6] { ai_charge(12); }; +void() spid_attack6 = [0, spid_attack7] { ai_charge(12); }; +void() spid_attack7 = [2, spid_attack8] { ai_charge(12); if (skill > 1) SpidMissile(); }; +void() spid_attack8 = [4, spid_attack9] { ai_charge(12); sound(self, CHAN_VOICE, "spider/tap.wav", 1, ATTN_IDLE); }; +void() spid_attack9 = [6, spid_attack10] { ai_charge(12); }; +void() spid_attack10 = [8, spid_run1] { SpidMissile();}; + +void() spid_pain1 = [20, spid_pain2] {}; +void() spid_pain2 = [21, spid_pain3] {}; +void() spid_pain3 = [22, spid_pain4] {}; +void() spid_pain4 = [23, spid_pain5] {}; +void() spid_pain5 = [24, spid_pain6] {}; +void() spid_pain6 = [25, spid_pain7] {}; +void() spid_pain7 = [26, spid_pain8] {}; +void() spid_pain8 = [27, spid_pain9] {}; +void() spid_pain9 = [28, spid_pain10] {}; +void() spid_pain10 = [29, spid_pain11] {}; +void() spid_pain11 = [30, spid_run1] {}; + +void(entity inflictor, entity attacker, float damage) spid_pain = { + if (self.pain_finished > time) return; + + sound(self, CHAN_VOICE, "spider/pain.wav", 1, ATTN_NORM); + self.velocity_x = -50 - 50 * random(); + self.velocity_y = 0; + self.velocity_z = MIN_CHARMER_DISTANCE + MIN_CHARMER_DISTANCE * random(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.pain_finished = time + MOVETYPE_WALK; + spid_pain1(); + +}; + +void() spid_death1 = [10, spid_death3] {}; +void() spid_death2 = [10, spid_death3] {monster_check_gib();}; +void() spid_death3 = [11, spid_death4] {monster_check_gib(); self.solid = SOLID_NOT; }; +void() spid_death4 = [12, spid_death5] {}; +void() spid_death5 = [13, spid_death6] {}; +void() spid_death6 = [14, spid_death7] {}; +void() spid_death7 = [15, spid_death8] {}; +void() spid_death8 = [16, spid_death9] {}; +void() spid_death9 = [17, spid_death10] {}; +void() spid_death10 = [18, spid_death11] {monster_death_postcheck();}; +void() spid_death11 = [19, spid_death11] {monster_deadbody_check();}; + +void() spid_die = { + monster_death_precheck(); + + if (!self.gibbed) { + sound(self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_x = -50 + 100 * random(); + self.velocity_y = -50 + 100 * random(); + self.velocity_z = 300 + 300 * random(); + self.avelocity_x = -20 + 40 * random(); + self.avelocity_y = -200 + 400 * random(); + self.avelocity_z = 0; + self.flags = self.flags - (self.flags & FL_ONGROUND); + spid_death1(); + + } +}; + +float() CheckSpidJump = { + local vector dist; + local float d; + + if (self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z + 0.75 * self.enemy.size_z) + return 0; + + if (self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z + 0.25 * self.enemy.size_z) + return 0; + + dist = self.enemy.origin - self.origin; + dist_z = 0; + d = vlen(dist); + if (d < 100) return 0; + + if (d > MAX_CHARMER_DISTANCE) + if (random() < 0.5) return 0; + + return 1; +}; + +void() spid_jump = { + if (!FL_ONGROUND) return; + + ai_face(); + makevectors(self.angles); + self.origin_z = self.origin_z + 1; + self.velocity = v_forward * MIN_CHARMER_DISTANCE + '0 0 600'; + if (self.flags & FL_ONGROUND) self.flags = self.flags - FL_ONGROUND; +}; + +void() spid_attack = { + if (CheckSpidJump) + spid_jump(); + + spid_attack1(); +}; + +void() SpidMissile = { + local vector org; + local vector dir; + local vector yrand, zrand; + + ai_face(); + makevectors(self.angles); + org = self.origin + v_forward*20; + + yrand = (crandom()*12)*v_right; + zrand = ((crandom()*4)-16)*v_up; + org = self.origin + attack_vector(self.attack_offset) + yrand + zrand; + + dir = (self.enemy.origin - org); + dir = normalize(dir); + launch_projectile (org, dir, CT_PROJ_WILLY, 300); +}; + +void() monster_wspider = { + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/spider.mdl"; + self.headmdl = "progs/gib2.mdl"; + self.gib1mdl = "progs/ad171/gib_spidlegg.mdl"; // Single Leg + precache_model ("progs/ad171/gib_spidlegg.mdl"); + precache_model ("progs/gib2.mdl"); + precache_model2("progs/spider.mdl"); + precache_model2("progs/sp_spike.mdl"); + precache_sound2("spider/fire.wav"); + precache_sound2("shalrath/attack2.wav"); + precache_sound2("shalrath/death.wav"); + precache_sound2("spider/tap.wav"); + precache_sound2("spider/pain.wav"); + precache_sound2("shalrath/sight.wav"); + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + self.model = "progs/spider.mdl"; + self.bboxtype = BBOX_WILLY; + self.sight_sound = "spider/tap.wav"; + self.pain_sound = "spider/pain.wav"; + + if (self.health < 1) self.health = 200; + self.gibhealth = -90; + self.pain_flinch = 40; + self.th_stand = spid_stand; + self.th_walk = spid_walk1; + self.th_run = spid_run1; + self.th_die = spid_die; + self.th_pain = spid_pain; + self.th_missile = spid_attack1; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was entangled by Willie the Spider\n"; + + self.classtype = CT_MONWILLYSPIDER; + self.classgroup = CG_SPIDER; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_xmas_elf.qc b/QC_other/QC_keep/mon_xmas_elf.qc new file mode 100644 index 00000000..44dc0ff9 --- /dev/null +++ b/QC_other/QC_keep/mon_xmas_elf.qc @@ -0,0 +1,432 @@ +/*============================================================================== +XMAS Elf - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000 - 007) Rocking back and forth on feet +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 + +// (008 - 017) Skipping! (Running) +$frame skip1 skip2 skip3 skip4 skip5 skip6 skip7 skip8 +$frame skip9 skip10 + +// (018 - 029) Walking +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 + +// (030 - 036) Suprise, jump up into the air with legs wide apart +$frame surprise1 surprise2 surprise3 surprise4 surprise5 surprise6 surprise7 + +// (037 - 048) ATTACK - Swing cane around (long version) +$frame magic1 magic2 magic3 magic4 magic5 magic6 magic7 magic8 +$frame magic9 magic10 magic11 magic12 + +// (049 - 056) ATTACK - Jump up and smash cane into ground +$frame jump1 jump2 jump3 jump4 jump5 jump6 jump7 jump8 + +// (057 - 061) ATTACK - Swing cane around (short version) +$frame attack1 attack2 attack3 attack4 attack5 + +// (062 - 066) PAIN - Recoil backward +$frame pain1 pain2 pain3 pain4 pain5 + +// (067 - 078) ATTACK - Fall downward with cane infront +$frame ambush1 ambush2 ambush3 ambush4 ambush5 ambush6 ambush7 ambush8 +$frame ambush9 ambush10 ambush11 ambush12 + +// (079 - 093) DEATH - Backward +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 bdeath7 bdeath8 +$frame bdeath9 bdeath10 bdeath11 bdeath12 bdeath13 bdeath14 bdeath15 + +// (094 - 107) DEATH - Forward +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 death13 death14 + +// (108 - 109) Misc modelling stuff +$frame base1 base2 + +//====================================================================== +void() elf_stand1 = [ $stand1, elf_stand2 ] {monster_idle_sound();ai_stand();}; +void() elf_stand2 = [ $stand2, elf_stand3 ] {ai_stand();}; +void() elf_stand3 = [ $stand3, elf_stand4 ] {ai_stand();}; +void() elf_stand4 = [ $stand4, elf_stand5 ] {ai_stand();}; +void() elf_stand5 = [ $stand5, elf_stand6 ] {ai_stand();}; +void() elf_stand6 = [ $stand6, elf_stand7 ] {ai_stand();}; +void() elf_stand7 = [ $stand7, elf_stand8 ] {ai_stand();}; +void() elf_stand8 = [ $stand8, elf_stand1 ] {ai_stand();}; + +//====================================================================== +void() elf_walk1 = [ $walk1, elf_walk2 ] {monster_idle_sound();ai_walk(10);}; +void() elf_walk2 = [ $walk2, elf_walk3 ] {ai_walk(6);}; +void() elf_walk3 = [ $walk3, elf_walk4 ] {monster_footstep(FALSE);ai_walk(4);}; +void() elf_walk4 = [ $walk4, elf_walk5 ] {ai_walk(0);}; +void() elf_walk5 = [ $walk5, elf_walk6 ] {ai_walk(2);}; +void() elf_walk6 = [ $walk6, elf_walk7 ] {ai_walk(3);}; + +void() elf_walk7 = [ $walk7, elf_walk8 ] {ai_walk(10);}; +void() elf_walk8 = [ $walk8, elf_walk9 ] {ai_walk(6);}; +void() elf_walk9 = [ $walk9, elf_walk10 ] {monster_footstep(FALSE);ai_walk(4);}; +void() elf_walk10 = [ $walk10, elf_walk11 ] {ai_walk(0);}; +void() elf_walk11 = [ $walk11, elf_walk12 ] {ai_walk(2);}; +void() elf_walk12 = [ $walk12, elf_walk1 ] {ai_walk(3);}; + +//====================================================================== +void() elf_run1 = [ $skip1, elf_run2 ] {monster_idle_sound();ai_run(1);}; +void() elf_run2 = [ $skip2, elf_run3 ] {ai_run(6);}; +void() elf_run3 = [ $skip3, elf_run4 ] {ai_run(20);}; +void() elf_run4 = [ $skip4, elf_run5 ] {monster_footstep(FALSE);ai_run(12);}; +void() elf_run5 = [ $skip5, elf_run6 ] {ai_run(8);}; + +void() elf_run6 = [ $skip6, elf_run7 ] {ai_run(1);}; +void() elf_run7 = [ $skip7, elf_run8 ] {ai_run(6);}; +void() elf_run8 = [ $skip8, elf_run9 ] {ai_run(20);}; +void() elf_run9 = [ $skip9, elf_run10 ] {monster_footstep(FALSE);ai_run(12);}; +void() elf_run10 = [ $skip10, elf_run1 ] {ai_run(8);}; + +//====================================================================== +void() elf_slide1 = [ $surprise1, elf_slide2 ] {ai_run_slide(2);monster_idle_sound();}; +void() elf_slide2 = [ $surprise2, elf_slide3 ] {ai_run_slide(4);}; +void() elf_slide3 = [ $surprise3, elf_slide4 ] {ai_run_slide(6);}; +void() elf_slide4 = [ $surprise4, elf_slide5 ] {ai_run_slide(6);}; +void() elf_slide5 = [ $surprise5, elf_slide6 ] {ai_run_slide(4);}; +void() elf_slide6 = [ $surprise6, elf_slide7 ] {ai_run_slide(3);}; +void() elf_slide7 = [ $surprise7, elf_run1 ] {ai_run(2);}; + +//====================================================================== +// ELF 2 - SPRAY MAGIC (Range) +//====================================================================== +void(float sideang) elf_shot = +{ + local vector org, ang, dir, avel; + + if (!self.enemy) return; + if (self.health < 1) return; + + // Flash effect to show where projectile is coming from + self.effects = self.effects | EF_MUZZLEFLASH; + if (sideang < 0) sound (self, CHAN_WEAPON, "xmas/elf/attack1.wav", 1, ATTN_NORM); + + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Create elevation angle and use makevectors to create projectile direction + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; // Negative = upwards angle + makevectors (ang); + // fire magic in arc pattern (sideang) + dir = (v_forward + v_right * sideang) * SPEED_ELF; + + avel = vecrand(100,200,FALSE); + Launch_Grenade(org, dir, avel, CT_PROJ_ELF); +}; + +//---------------------------------------------------------------------- +void() elf_magic1 = [ $magic12, elf_magic2 ] { + sound(self, CHAN_WEAPON, "xmas/elf/magic.wav", 1, ATTN_NORM);}; +void() elf_magic2 = [ $magic11, elf_magic3 ] {ai_face();}; +void() elf_magic3 = [ $magic10, elf_magic4 ] {ai_face();}; +void() elf_magic4 = [ $magic9, elf_magic5 ] {ai_face();}; +void() elf_magic5 = [ $magic8, elf_magic6 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_ELF); }; +void() elf_magic6 = [ $magic7, elf_magic7 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ELF); }; +void() elf_magic7 = [ $magic6, elf_magic8 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ELF); }; +void() elf_magic8 = [ $magic5, elf_magic9 ] {elf_shot(-0.1);}; +void() elf_magic9 = [ $magic4, elf_magic10 ] {elf_shot(0);}; +void() elf_magic10 = [ $magic3, elf_magic11 ] {elf_shot(0.1);}; +void() elf_magic11 = [ $magic2, elf_magic12 ] {}; +void() elf_magic12 = [ $magic1, elf_run1 ] {}; + +//====================================================================== +// ELF 1 - SWING CANE - Both elf types can swing cane if within range +//====================================================================== +void() elf_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); + ai_damagebreakable(10); + if (!ai_checkmelee(MONAI_MELEEELF)) return; + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + if (random() < 0.5) sound(self, CHAN_VOICE, "xmas/elf/cane_hit1.wav", 1, ATTN_NORM); + else sound(self, CHAN_VOICE, "xmas/elf/cane_hit2.wav", 1, ATTN_NORM); + + // Cane Impact (damage 1-9) is very weak + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at cane of elf + spawn_touchblood (self, self.enemy, ldmg*3); +} + +//---------------------------------------------------------------------- +void() elf_cane1 = [ $attack1, elf_cane2 ] {ai_charge(5); + if (random() < 0.5) sound(self, CHAN_WEAPON, "xmas/elf/cane_swipe1.wav", 1, ATTN_NORM); + else sound(self, CHAN_WEAPON, "xmas/elf/cane_swipe2.wav", 1, ATTN_NORM); +}; +void() elf_cane2 = [ $attack2, elf_cane3 ] {ai_charge(5);}; +void() elf_cane3 = [ $attack3, elf_cane4 ] {elf_melee();}; +void() elf_cane4 = [ $attack4, elf_cane5 ] {}; +void() elf_cane5 = [ $attack5, elf_run1 ] { + if (ai_checkmelee(MONAI_MELEEELF) && self.enemy.health > 0) { + if (self.health > 0) self.think = elf_cane1; + } +}; + +//====================================================================== +// ELF 1 - JUMP FUNCTION (range) +//====================================================================== +void() Elf_JumpTouch = +{ + local float ldmg; + + if (self.health <= 0) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.count = self.count + 1; // Total amount of touch jumps + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + // Do not damage other elves with jump attacks + // Prevents packs from killing themselves + if (self.classtype != other.classtype && other.takedamage) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 5 + 5*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + // Spawn some touch blood (no explicit direction) + spawn_touchblood (self.enemy, self.enemy, ldmg*3); + } + } + + // Is the elf floating in the air? + if (!checkbottom(self)) { + // Is the elf standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------------- +void() elf_leap1 =[ $jump1, elf_leap2 ] {ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + if (random() < 0.5) sound(self, CHAN_WEAPON, "xmas/elf/jump1.wav", 1, ATTN_NORM); + else sound(self, CHAN_WEAPON, "xmas/elf/jump2.wav", 1, ATTN_NORM); +}; +void() elf_leap2 =[ $jump2, elf_leap3 ] {ai_face();}; +void() elf_leap3 =[ $jump3, elf_leap4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPTIMEOUT; // Stop jumping so much + self.touch = Elf_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * MONAI_JUMPELFDIST + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; +void() elf_leap4 =[ $jump4, elf_leap5 ] {}; +void() elf_leap5 =[ $jump5, elf_leap6 ] {}; +void() elf_leap6 =[ $jump6, elf_leap7 ] { + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = elf_leap3; + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() elf_leap7 =[ $jump7, elf_leap8] {monster_footstep(FALSE);}; +void() elf_leap8 =[ $jump8, elf_run1] {ai_resetangles();}; + +//====================================================================== +// Elven Pain! +//====================================================================== +void() elf_pain1 = [ $pain1, elf_pain2 ] {}; +void() elf_pain2 = [ $pain2, elf_pain3 ] {}; +void() elf_pain3 = [ $pain3, elf_pain4 ] {}; +void() elf_pain4 = [ $pain4, elf_pain5 ] {}; +void() elf_pain5 = [ $pain5, elf_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) elf_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) elf_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.axhitme = 0; + self.pain_finished = time + 1; + elf_pain1 (); + } + } +}; + +//====================================================================== +// Typical forward/backward death animation +//====================================================================== +void() elf_die1 =[ $death1, elf_die2] {}; +void() elf_die2 =[ $death2, elf_die3] {monster_check_gib();}; +void() elf_die3 =[ $death3, elf_die4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() elf_die4 =[ $death4, elf_die5] {}; +void() elf_die5 =[ $death5, elf_die6] {}; +void() elf_die6 =[ $death6, elf_die7] { + // Drop metal cane sound + sound (self, CHAN_WEAPON, GIB_SOUND_METALA, 1, ATTN_NORM); +}; +void() elf_die7 =[ $death7, elf_die8] {}; +void() elf_die8 =[ $death8, elf_die9] {monster_death_postcheck();}; +void() elf_die9 =[ $death9, elf_die9] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() elf_dieb1 =[ $bdeath1, elf_dieb2] {}; +void() elf_dieb2 =[ $bdeath2, elf_dieb3] {monster_check_gib();}; +void() elf_dieb3 =[ $bdeath3, elf_dieb4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() elf_dieb4 =[ $bdeath4, elf_dieb5] {}; +void() elf_dieb5 =[ $bdeath5, elf_dieb6] {}; +void() elf_dieb6 =[ $bdeath6, elf_dieb7] {}; +void() elf_dieb7 =[ $bdeath7, elf_dieb8] {}; +void() elf_dieb8 =[ $bdeath8, elf_dieb9] {ai_back(4);monster_death_postcheck();}; +void() elf_dieb9 =[ $bdeath9, elf_dieb9] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() elf_die = +{ + // Sync cane to elf skin + self.gib1skin = self.exactskin; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + // Pick a random death sound + if (random() > 0.5) + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, self.death_sound2, 1, ATTN_NORM); + + // Pick a random fall direction + if (random() > 0.5) elf_die1 (); + else elf_dieb1 (); + } +}; + +/*====================================================================== +QUAKED monster_xmas_elf (1 0 0) (-16 -16 -24) (16 16 16) Ambush +======================================================================*/ +void() monster_xmas_elf = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_elf.mdl"; // Crazy Grinning Fool + self.headmdl = "progs/xmas/h_elf.mdl"; // Shrunken Head + self.gib1mdl = "progs/xmas/gib_elfcane.mdl";// Candy Cane + self.gib1sound = GIB_IMPACT_METALA; + + precache_model (self.mdl); + precache_model (self.headmdl); // Grinning Pointy Hat + precache_model (self.gib1mdl); // Sugar Cane + precache_model (MODEL_PROJ_ELF); // Magic ice + + // Idle calm/angry + self.idle_sound = "xmas/elf/idle.wav"; // Lots of giggling + precache_sound (self.idle_sound); + + // Many different sight sounds (2 is very annoying) + self.sight_sound = "xmas/elf/sight1.wav"; // Snarling sound + self.sight_sound2 = "xmas/elf/sight2.wav"; // DIE HUMAN!?! + self.sight_sound3 = "xmas/elf/sight3.wav"; // Screams + self.sight_sound4 = "xmas/elf/sight4.wav"; // Screams + precache_sound (self.sight_sound); + precache_sound (self.sight_sound2); + precache_sound (self.sight_sound3); + precache_sound (self.sight_sound4); + self.sight_count = 4; + + // Elf 1 - Melee/Jump attacks - cane impacts + precache_sound ("xmas/elf/cane_swipe1.wav"); + precache_sound ("xmas/elf/cane_swipe2.wav"); + precache_sound ("xmas/elf/cane_hit1.wav"); + precache_sound ("xmas/elf/cane_hit2.wav"); + precache_sound ("xmas/elf/jump1.wav"); + precache_sound ("xmas/elf/jump2.wav"); + + // Elf 2 - Magic attacks + precache_sound ("xmas/elf/magic.wav"); + precache_sound ("xmas/elf/attack1.wav"); + precache_sound ("xmas/elf/miss.wav"); + + // precache sight, pain and death (changes on type) + self.pain_sound = "xmas/elf/pain.wav"; + self.death_sound = "xmas/elf/death1.wav"; + self.death_sound2 = "xmas/elf/death2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.death_sound); + precache_sound (self.death_sound2); + + if (self.spawnflags & MON_ELF_MAGIC) { + if (self.health < 1) self.health = 75; + self.gibhealth = -25; + self.th_missile = elf_magic1; + self.exactskin = 2; + } + else { + if (self.health < 1) self.health = 30; + self.gibhealth = -20; + self.th_jump = elf_leap1; + self.th_jumpexit = elf_leap7; + // pick a random one instead + if (self.exactskin < 0 || self.exactskin > 1) self.exactskin = 0; + if (self.exactskin == 0 && random() < 0.5) self.exactskin = 1; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TINY; + self.gibbed = FALSE; // Still in one peice + self.blockudeath = TRUE; // No humanoid death sound + self.pain_flinch = 10; // Light pain threshold + self.steptype = FS_TYPELIGHT; // Very light feet + self.meleeoffset = '20 0 20'; // Cane attack offset + self.attack_offset = '10 0 4'; // Magic attack offset + self.poisonous = FALSE; // Not Supported + self.deathstring = " was torn to pieces by a Elf\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = ElfCheckAttack; + self.th_stand = elf_stand1; + self.th_walk = elf_walk1; + self.th_run = elf_run1; + self.th_melee = elf_cane1; + self.th_slide = elf_slide1; + self.th_pain = elf_pain; + self.th_die = elf_die; + + self.classtype = CT_MONELF; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_xmas_raindeer.qc b/QC_other/QC_keep/mon_xmas_raindeer.qc new file mode 100644 index 00000000..40ad4824 --- /dev/null +++ b/QC_other/QC_keep/mon_xmas_raindeer.qc @@ -0,0 +1,317 @@ +/*============================================================================== +XMAS Raindeer - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000 - 003) Rocket attack +$frame rattack1 rattack2 rattack3 rattack4 + +// (004 - 010) Alternative idle animation, scrape feet on floor +$frame idlefeet1 idlefeet2 idlefeet3 idlefeet4 idlefeet5 idlefeet6 idlefeet7 + +// (011 - 014) Fast and Heavy breathing +$frame stand1 stand2 stand3 stand4 + +// (015 - 022) Running/Charge attack +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +// (023 - 023) Static death pose - on altar (need skin 1) +$frame altar1 + +// (024 - 025) Misc modelling stuff +$frame base1 base2 + +//====================================================================== +void() raind_idlefeet1 = [ $idlefeet1, raind_idlefeet2 ] {monster_footstep(FALSE);ai_stand();}; +void() raind_idlefeet2 = [ $idlefeet2, raind_idlefeet3 ] {ai_stand();}; +void() raind_idlefeet3 = [ $idlefeet3, raind_idlefeet4 ] {monster_footstep(FALSE);ai_stand();}; +void() raind_idlefeet4 = [ $idlefeet4, raind_idlefeet5 ] {ai_stand();}; +void() raind_idlefeet5 = [ $idlefeet5, raind_idlefeet6 ] {ai_stand();}; +void() raind_idlefeet6 = [ $idlefeet6, raind_idlefeet7 ] {ai_stand();}; +void() raind_idlefeet7 = [ $idlefeet7, raind_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() raind_stand1 = [ $stand1, raind_stand2 ] { monster_idle_sound();ai_stand();}; +void() raind_stand2 = [ $stand1, raind_stand3 ] {ai_stand();}; +void() raind_stand3 = [ $stand2, raind_stand4 ] {ai_stand();}; +void() raind_stand4 = [ $stand2, raind_stand5 ] {ai_stand();}; +void() raind_stand5 = [ $stand3, raind_stand6 ] {ai_stand();}; +void() raind_stand6 = [ $stand3, raind_stand7 ] {ai_stand();}; +void() raind_stand7 = [ $stand4, raind_stand8 ] {ai_stand();}; +void() raind_stand8 = [ $stand4, raind_stand1 ] { + self.idlebusy = FALSE; + if (random() < MON_IDLE_ANIMATION) self.think = raind_idlefeet1; +}; + +//====================================================================== +void() raind_walk1 = [ $run5, raind_walk2 ] {monster_idle_sound();ai_walk(8);}; +void() raind_walk2 = [ $run6, raind_walk3 ] {ai_walk(5);}; +void() raind_walk3 = [ $run7, raind_walk4 ] {ai_walk(10);}; +void() raind_walk4 = [ $run8, raind_walk5 ] {monster_footstep(FALSE);ai_walk(5);}; +void() raind_walk5 = [ $run1, raind_walk6 ] {ai_walk(8);}; +void() raind_walk6 = [ $run2, raind_walk7 ] {ai_walk(13);}; +void() raind_walk7 = [ $run3, raind_walk8 ] {ai_walk(5);}; +void() raind_walk8 = [ $run4, raind_walk1 ] {monster_footstep(FALSE);ai_walk(8);}; + +//====================================================================== +void() raind_run1 = [ $run5, raind_run2 ] {monster_idle_sound();ai_run(15);}; +void() raind_run2 = [ $run6, raind_run3 ] {ai_run(10);}; +void() raind_run3 = [ $run7, raind_run4 ] {ai_run(20);}; +void() raind_run4 = [ $run8, raind_run5 ] {monster_footstep(FALSE);ai_run(10);}; +void() raind_run5 = [ $run1, raind_run6 ] {ai_run(15);}; +void() raind_run6 = [ $run2, raind_run7 ] {ai_run(25);}; +void() raind_run7 = [ $run3, raind_run8 ] {ai_run(10);}; +void() raind_run8 = [ $run4, raind_run1 ] {monster_footstep(FALSE);ai_run(15);}; + +//====================================================================== +// MELEE : Antler attack +//====================================================================== +void() raind_melee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); + ai_damagebreakable(20); + if (!ai_checkmelee(MONAI_MELEERAINDEER)) return; + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + sound(self, CHAN_WEAPON, "xmas/raindeer/hit.wav", TRUE, TRUE); + + // Antler attack is weak (1-9) + ldmg = (random() + random() + random()) * 3; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at antlers + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() raind_ram1 = [ $rattack1, raind_ram2 ] {ai_charge(10);}; +void() raind_ram2 = [ $rattack2, raind_ram3 ] {raind_melee();}; +void() raind_ram3 = [ $rattack3, raind_ram4 ] {ai_charge(5);}; +void() raind_ram4 = [ $rattack4, raind_run1 ] { + // Check if raindeer is within range to attack again + if (ai_checkmelee(MONAI_MELEERAINDEER) && self.enemy.health > 0) { + if (self.health > 0) self.think = raind_ram1; + } +}; + +//====================================================================== +// RANGE : Rockets from backpack +//====================================================================== +void(vector sideofs) raind_attack = +{ + local vector org, dir, vec; + + if (!self.enemy) return; + if (self.health < 1) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_RAINDROCK + (skill * SPEED_RAINDROCKSKILL); + + // Cycle between attack sounds + if (self.lefty == 0) + sound (self, CHAN_WEAPON, "xmas/raindeer/attack1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "xmas/raindeer/attack2.wav", 1, ATTN_NORM); + self.lefty = 1 - self.lefty; + + // turn and face your enemy! + ai_face(); + makevectors (self.angles); + + org = self.origin + attack_vector(sideofs); + // Fire rocket direction to match raindeer side + vec = v_right*(sideofs_x+(random()*10)); + dir = normalize((self.enemy.origin + vec) - org); + Launch_Missile (org, dir, '0 0 0', CT_PROJ_RAINDEER, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() raind_shoot1 = [ $rattack1, raind_shoot2 ] {ai_face();}; +void() raind_shoot2 = [ $rattack2, raind_shoot3 ] {}; +void() raind_shoot3 = [ $rattack3, raind_shoot4 ] {ai_face();}; +void() raind_shoot4 = [ $rattack4, raind_shoot5 ] { + // Skills - EASY/NORMAL = 1 rocket, HARD/NM = 2 rockets + if (skill < SKILL_HARD) { + self.think = raind_run1; + // Randomize upper side (LEFT=-12 RIGHT=12) + if (random() < 0.5) raind_attack('-2 -12 12'); + else raind_attack('-2 12 12'); + } + else raind_attack('-2 -12 12'); +}; +void() raind_shoot5 = [ $rattack1, raind_shoot6 ] {ai_face();}; +void() raind_shoot6 = [ $rattack2, raind_shoot7 ] {}; +void() raind_shoot7 = [ $rattack3, raind_shoot8 ] {ai_face();}; +void() raind_shoot8 = [ $rattack4, raind_run1 ] { + raind_attack('-2 12 12'); +}; + +//====================================================================== +// PAIN : quick reflection +//====================================================================== +void() raind_pain1 = [ $rattack1, raind_pain2 ] {}; +void() raind_pain2 = [ $rattack2, raind_pain3 ] {ai_pain(4);}; +void() raind_pain3 = [ $rattack3, raind_pain4 ] {}; +void() raind_pain4 = [ $rattack4, raind_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) raind_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + if (self.pain_check == 1) raind_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + raind_pain1 (); + } + } +}; + +//====================================================================== +// DEATH : Its raining raindeer tonight! +//====================================================================== +void() raind_explode = +{ + // no more raindeer! + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // ID style explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (self.death_dmg > 0) + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Sprite + Dust + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + + // Regular blood like gibs + ThrowGib(4, 2 + rint(random()*4)); + ThrowGib(5, 2 + rint(random()*4)); + ThrowGib(25, 1); + ThrowGib(11, 2 + rint(random()*2)); + // Metal backpack + self.gibtype = GIBTYPE_METAL; + ThrowGib(12, rint(random()*2)); +}; + +//---------------------------------------------------------------------- +void() raind_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // There is no death animation + sound (self, CHAN_BODY, self.death_sound, 1, ATTN_NORM); + raind_explode(); +}; + +//---------------------------------------------------------------------- +void() raind_deadbody = +{ + // Setup bounding box based on presets + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + monster_bbox(); + + // Sacrifice pose + skin + self.frame = $altar1; + self.exactskin = self.skin = 1; + self.gib2mdl = self.gib1mdl; + if (random() < 0.5) self.gib3mdl = self.gib1mdl; + if (random() < 0.5) self.gib4mdl = self.gib1mdl; + misc_deadbody_setup(); +}; + +//============================================================================= +//QUAKED monster_xmas_raindeer (0.5 0.75 0) (-16 -16 -24) (16 16 40) Ambush +//============================================================================= +void() monster_xmas_raindeer = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_raindeer.mdl"; // Brown meat + self.headmdl = "progs/xmas/h_raindeer.mdl"; // Bloody meat + self.gib1mdl = "progs/xmas/gib_rdleg1.mdl"; // Bloody stump + self.gib2mdl = "progs/xmas/gib_rdrockpack.mdl"; // Rocket backpack + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_RAIND); // Snowy Rockets + precache_model (self.gib1mdl); // Legs + precache_model (self.gib2mdl); // Rocket Packs + + self.idle_sound = "xmas/raindeer/idle.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "xmas/raindeer/sight.wav"; + precache_sound (self.sight_sound); + + // Alternating rocket firing sound + precache_sound ("xmas/raindeer/attack1.wav"); + precache_sound ("xmas/raindeer/attack2.wav"); + + self.pain_sound = "xmas/raindeer/hit.wav"; + precache_sound (self.pain_sound); + self.death_sound = "xmas/raindeer/death.wav"; + precache_sound (self.death_sound); + + // Dead body version is setup different + if (self.spawnflags & MON_RAINDEER_DEAD) { + raind_deadbody(); return; + } + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + if (self.health < 1) self.health = 200; + if (self.death_dmg < 1) self.death_dmg = DAMAGE_RAINDEER; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.blockudeath = TRUE; // no humanoid death sound + self.gibbed = FALSE; // Still in one piece + self.pain_flinch = 30; // Light pain threshold + self.pain_longanim = FALSE; // No long pain animation + self.steptype = FS_TYPESLOW; // Small sounding feet + self.poisonous = FALSE; // Not Supported + self.meleeoffset = '24 0 20'; // Antler attack offset + self.lefty = 0; // Cycle attack sounds + self.deathstring = " was trampled by a Raindeer\n"; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = RaindeerCheckAttack; + self.th_stand = raind_stand1; + self.th_walk = raind_walk1; + self.th_run = raind_run1; + self.th_melee = raind_ram1; + self.th_missile = raind_shoot1; + self.th_pain = raind_pain; + self.th_die = raind_die; + + self.classtype = CT_MONRAINDEER; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_xmas_santa.qc b/QC_other/QC_keep/mon_xmas_santa.qc new file mode 100644 index 00000000..6ac36c7a --- /dev/null +++ b/QC_other/QC_keep/mon_xmas_santa.qc @@ -0,0 +1,461 @@ +/*============================================================================== +XMAS Santa - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000 - 005) Standing +$frame stand1 stand2 stand3 stand4 stand5 stand6 + +// (006 - 011) Running +$frame run1 run2 run3 run4 run5 run6 + +// (012 - 017) Lounging Evil Santa +$frame lounge1 lounge2 lounge3 lounge4 lounge5 lounge6 + +// (018 - 027) Victory at player's death! +$frame victory1 victory2 victory3 victory4 victory5 victory6 +$frame victory7 victory8 victory9 victory10 + +// (028 - 031) Gun Range attack +$frame attack1 attack2 attack3 attack4 + +// (032 - 041) Sack Melee attack +$frame sack1 sack2 sack3 sack4 sack5 sack6 sack7 sack8 sack9 sack10 + +// (042 - 046) Pain A +$frame painA1 painA2 painA3 painA4 painA5 + +// (047 - 051) Pain B +$frame painB1 painB2 painB3 painB4 painB5 + +// (052 - 061) Death FORWARD (180 spin) +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 + +// (062 - 070) Death BACKWARD (180 spin) +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +// (071 - 077) Sitting Good Santa 1 +$frame sitA1 sitA2 sitA3 sitA4 sitA5 sitA6 sitA7 + +// (078 - 083) Sitting Good Santa 2 +$frame sitB1 sitB2 sitB3 sitB4 sitB5 sitB6 + +// (084 - 086) Misc modelling stuff +$frame base1 base2 base3 + +//====================================================================== +// Sitting down animation (located below model baseline) +// There is no blend animation for this to go from sitting to standing +// Original MOD had this animation as a standing alternative +// Really looked odd when the monster jumped straight to running +/* +void() santa_lounge1 = [ $lounge1, santa_lounge2 ] {monster_idle_sound();ai_stand();}; +void() santa_lounge2 = [ $lounge2, santa_lounge3 ] {ai_stand();}; +void() santa_lounge3 = [ $lounge3, santa_lounge4 ] {ai_stand();}; +void() santa_lounge4 = [ $lounge4, santa_lounge5 ] {ai_stand();}; +void() santa_lounge5 = [ $lounge5, santa_lounge6 ] {ai_stand();}; +void() santa_lounge6 = [ $lounge6, santa_lounge1 ] {ai_stand();}; */ + +//====================================================================== +// A scaled down good santa sitting shaking his head +//====================================================================== +void() santa_seatA1 = [ $sitA1, santa_seatA2 ] {}; +void() santa_seatA2 = [ $sitA2, santa_seatA3 ] {}; +void() santa_seatA3 = [ $sitA3, santa_seatA4 ] {}; +void() santa_seatA4 = [ $sitA4, santa_seatA5 ] {}; +void() santa_seatA5 = [ $sitA5, santa_seatA6 ] {}; +void() santa_seatA6 = [ $sitA6, santa_seatA7 ] {}; +void() santa_seatA7 = [ $sitA7, santa_seatA1 ] {self.th_stand();}; + +//---------------------------------------------------------------------- +void() santa_seatB1 = [ $sitB1, santa_seatB2 ] {}; +void() santa_seatB2 = [ $sitB2, santa_seatB3 ] {}; +void() santa_seatB3 = [ $sitB3, santa_seatB4 ] {}; +void() santa_seatB4 = [ $sitB4, santa_seatB5 ] {}; +void() santa_seatB5 = [ $sitB5, santa_seatB6 ] {}; +void() santa_seatB6 = [ $sitB6, santa_seatB1 ] {self.th_stand();}; + +//---------------------------------------------------------------------- +void() santa_trigger = +{ + // Trigger Once + if (self.waitmin > time) return; + self.waitmin = LARGE_TIMER; + self.use = SUB_Null; + + // "My dear boy, you saved me!" + sound(self, CHAN_WEAPON, self.noise2, 1, ATTN_NORM); + + // Fire all triggers/sounds/messages + SUB_UseTargets(); + + // Fade out santa (+delete model) + self.think = model_fade; + self.nextthink = time + 2 + random(); + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() santa_seated = +{ + // Keep resetting health/touch function + self.health = self.max_health; + self.use = santa_trigger; + if (random() < 0.5) santa_seatA1(); + else santa_seatB1(); +}; + +//====================================================================== +void() santa_stand1 = [ $stand1, santa_stand2 ] {monster_idle_sound();ai_stand();}; +void() santa_stand2 = [ $stand2, santa_stand3 ] {ai_stand();}; +void() santa_stand3 = [ $stand3, santa_stand4 ] {ai_stand();}; +void() santa_stand4 = [ $stand4, santa_stand5 ] {ai_stand();}; +void() santa_stand5 = [ $stand5, santa_stand6 ] {ai_stand();}; +void() santa_stand6 = [ $stand6, santa_stand1 ] {ai_stand();}; + +//====================================================================== +void() santa_walk1 = [ $run1, santa_walk2 ] {monster_idle_sound();ai_walk(15);} +void() santa_walk2 = [ $run2, santa_walk3 ] {ai_walk(17);}; +void() santa_walk3 = [ $run3, santa_walk4 ] {monster_footstep(FALSE);ai_walk(15);}; +void() santa_walk4 = [ $run4, santa_walk5 ] {ai_walk(15);}; +void() santa_walk5 = [ $run5, santa_walk6 ] {ai_walk(17);}; +void() santa_walk6 = [ $run6, santa_walk1 ] {monster_footstep(FALSE);ai_walk(15);}; + +//====================================================================== +void() santa_run1 = [ $run1, santa_run2 ] {monster_idle_sound();ai_run(20);} +void() santa_run2 = [ $run2, santa_run3 ] {ai_run(24);}; +void() santa_run3 = [ $run3, santa_run4 ] {monster_footstep(FALSE);ai_run(20);}; +void() santa_run4 = [ $run4, santa_run5 ] {ai_run(20);}; +void() santa_run5 = [ $run5, santa_run6 ] {ai_run(24);}; +void() santa_run6 = [ $run6, santa_run1 ] {monster_footstep(FALSE);ai_run(20);}; + +//====================================================================== +// MELEE : Sack of Presents +//====================================================================== +void() SantaMelee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_charge(10); // + ai_face() + ai_damagebreakable(50); + if (!ai_checkmelee(MONAI_MELEESANTA)) return; + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + sound(self, CHAN_WEAPON, "xmas/santa/sack_hit.wav", 1, ATTN_NORM); + + // Sack attack is strong (1-60) + ldmg = (random() + random() + random()) * 20; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at sack + spawn_touchblood (self, self.enemy, ldmg*3); + // Lots of blood and gore + SpawnMeatSpray (self, self.enemy, crandom() * 100); + SpawnMeatSpray (self, self.enemy, crandom() * 100); +}; + +//---------------------------------------------------------------------- +void() santa_sack1 = [ $sack1, santa_sack2 ] {ai_face();}; +void() santa_sack2 = [ $sack2, santa_sack3 ] {}; +void() santa_sack3 = [ $sack3, santa_sack4 ] {ai_face();}; +void() santa_sack4 = [ $sack4, santa_sack5 ] {ai_face(); + // This sound is exactly 0.4s long, with hit to complete + sound(self, CHAN_WEAPON, "xmas/santa/sack_swing.wav", 1, ATTN_NORM); +}; +void() santa_sack5 = [ $sack5, santa_sack6 ] {ai_charge(10);}; +void() santa_sack6 = [ $sack6, santa_sack7 ] {ai_charge(10);}; +void() santa_sack7 = [ $sack7, santa_sack8 ] {ai_charge(10);}; +void() santa_sack8 = [ $sack8, santa_sack9 ] {SantaMelee();}; +void() santa_sack9 = [ $sack9, santa_sack10 ] {}; +void() santa_sack10 = [ $sack10, santa_run1 ] { + // Check if snowman is within range to attack again + if (ai_checkmelee(MONAI_MELEESANTA) && self.enemy.health > 0) { + if (self.health > 0) self.think = santa_sack3; + } +}; + +//====================================================================== +// RANGE : Rocket Gun +//====================================================================== +void() Santa_FireSnow = +{ + local vector org, dir, spot1, spot2; + + // Keep adding up projectile counter + self.attack_chance = self.attack_chance + 1; + + // Lit up that barrel + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_SANTAPROJ + (skill * SPEED_SANTASKILL); + sound (self, CHAN_WEAPON, "xmas/santa/fire.wav", 1, ATTN_NORM); + + // Keep tracking enemy origin (similar to wizards) + ai_trackenemy(); + + // Calculate the center of the gun + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + // Work out projectil direction + dir = normalize(self.attack_track - org); + + // Barrel 1 + spot1 = org + v_right*6; + spot2 = normalize((self.attack_track+v_right*6) - spot1); + launch_projectile (spot1, spot2, CT_PROJ_SANTA, self.attack_speed); + + // Barrel 2 + spot1 = org - v_right*6; + spot2 = normalize((self.attack_track-v_right*6) - spot1); + launch_projectile (spot1, spot2, CT_PROJ_SANTA, self.attack_speed); +}; + +//---------------------------------------------------------------------- +void() santa_snow1 = [ $attack1, santa_snow2 ] {ai_trackenemy(); + // First 0.2s is repeatable to get machine gun sound + sound(self, CHAN_WEAPON, "xmas/santa/fire.wav", 1, ATTN_NORM); +}; +void() santa_snow2 = [ $attack2, santa_snow3 ] {ai_trackenemy();}; +void() santa_snow3 = [ $attack3, santa_snow4 ] {Santa_FireSnow();}; +void() santa_snow4 = [ $attack4, santa_run1 ] {ai_trackenemy(); + // Anymore projectiles to fire? + if (self.attack_chance < MONAI_SANTAMAX) { + // Is the player still visible? + if ( visxray(self.enemy, self.attack_offset, '0 0 0', FALSE) ) { + self.attack_timer = time + 0.8; + } + // Is the enemy in view timer still active? + if (self.attack_timer > time) self.think = santa_snow1; + } +}; + +void() santa_snowstart = +{ + self.attack_track = self.enemy.origin; + self.attack_chance = self.attack_timer = 0; + santa_snow1(); +}; + +//====================================================================== +// PAIN : quick reflection +//====================================================================== +void() santa_painA1 = [ $painA1, santa_painA2 ] {}; +void() santa_painA2 = [ $painA2, santa_painA3 ] {}; +void() santa_painA3 = [ $painA3, santa_painA4 ] {}; +void() santa_painA4 = [ $painA4, santa_painA5 ] {}; +void() santa_painA5 = [ $painA5, santa_run1 ] {}; + +//---------------------------------------------------------------------- +void() santa_painB1 = [ $painB1, santa_painB2 ] {}; +void() santa_painB2 = [ $painB2, santa_painB3 ] {}; +void() santa_painB3 = [ $painB3, santa_painB4 ] {}; +void() santa_painB4 = [ $painB4, santa_painB5 ] {}; +void() santa_painB5 = [ $painB5, santa_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) santa_pain = +{ + // Good santa cannot feel pain or die + if (self.spawnflags & MON_SANTA_GOOD) return; + + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1 || self.pain_check == 2) { + // Randomly pick which pain animation to play + if (random() < 0.8) santa_painA1 (); + else { + santa_painB1 (); + self.pain_finished = time + 2; + } + } + } +}; + +//====================================================================== +// Typical forward/backward death animation +//====================================================================== +void() santa_die1 =[ $death1, santa_die2] {}; +void() santa_die2 =[ $death2, santa_die3] {monster_check_gib();}; +void() santa_die3 =[ $death3, santa_die4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() santa_die4 =[ $death4, santa_die5] {}; +void() santa_die5 =[ $death5, santa_die6] {}; +void() santa_die6 =[ $death6, santa_die7] {}; +void() santa_die7 =[ $death7, santa_die8] {}; +void() santa_die8 =[ $death8, santa_die9] {}; +void() santa_die9 =[ $death9, santa_die10] {monster_death_postcheck();}; +void() santa_die10 =[ $death10, santa_die10] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() santa_dieb1 =[ $bdeath1, santa_dieb2] {}; +void() santa_dieb2 =[ $bdeath2, santa_dieb3] {monster_check_gib();}; +void() santa_dieb3 =[ $bdeath3, santa_dieb4] {monster_check_gib(); + self.solid = SOLID_NOT;}; +void() santa_dieb4 =[ $bdeath4, santa_dieb5] {}; +void() santa_dieb5 =[ $bdeath5, santa_dieb6] {}; +void() santa_dieb6 =[ $bdeath6, santa_dieb7] {}; +void() santa_dieb7 =[ $bdeath7, santa_dieb8] {}; +void() santa_dieb8 =[ $bdeath8, santa_dieb9] {ai_back(4);monster_death_postcheck();}; +void() santa_dieb9 =[ $bdeath9, santa_dieb9] {monster_deadbody_check();}; + +//---------------------------------------------------------------------- +void() santa_die = +{ + // Good santa cannot feel pain or die + if (self.spawnflags & MON_SANTA_GOOD) return; + + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // regular death + if (!self.gibbed) { + sound (self, CHAN_VOICE, self.death_sound, 1, ATTN_NORM); + + // Pick a random fall direction + if (random() > 0.5) santa_die1 (); + else santa_dieb1 (); + } +}; + +/*====================================================================== +QUAKED monster_santa (1 0 0) (-16 -16 -24) (16 16 40) Ambush +======================================================================*/ +void() monster_xmas_santa = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_santa.mdl"; // Big Sack Man! + self.headmdl = "progs/xmas/h_santa.mdl"; // Pointy Face + self.gib1mdl = "progs/xmas/gib_santagun.mdl"; + self.gib2mdl = "progs/xmas/gib_santasack.mdl"; + self.gib3mdl = "progs/xmas/gib_snowball.mdl"; // Snowballs + self.gib1sound = GIB_IMPACT_WOOD; + self.gib2sound = GIB_IMPACT_WOOD; + + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (self.gib1mdl); + precache_model (self.gib2mdl); + precache_model (MODEL_PROJ_SNOWBALL); + + // Idle/Sight sounds for GOOD/EVIL santa + if (self.spawnflags & MON_SANTA_GOOD) { + self.idle_sound = "xmas/santa/good_hohoho.wav"; + precache_sound (self.idle_sound); + self.sight_sound = "xmas/santa/good_hohoho.wav"; + precache_sound (self.sight_sound); + // Touch trigger - "My dear boy, you saved me!" + self.noise2 = "xmas/santa/good_saved.wav"; + precache_sound (self.noise2); + } + else { + // Evil santa has combat idle sounds + self.idle_sound = "xmas/santa/hohoho.wav"; // Slow ho-ho-ho + self.idle_sound2 = "xmas/santa/laugh1.wav"; // long laugh + precache_sound (self.idle_sound); + precache_sound (self.idle_sound2); + self.idle_soundcom = "xmas/santa/laugh3_com.wav"; + self.idle_soundcom2 = "xmas/santa/hohoho.wav"; + precache_sound (self.idle_soundcom); + precache_sound (self.idle_soundcom2); + // Sight sounds - "Come sit on santa's lap little human!" + self.sight_sound = "xmas/santa/sight.wav"; + precache_sound (self.sight_sound); + } + + // Attack melee/range + precache_sound ("xmas/santa/sack_swing.wav"); + precache_sound ("xmas/santa/sack_hit.wav"); + precache_sound ("xmas/santa/fire.wav"); + + // precache sight, pain and death (changes on type) + self.pain_sound = "xmas/santa/pain1.wav"; + self.pain_sound2 = "xmas/santa/pain2.wav"; + // Fading out slow ho-ho-ho death sound + self.death_sound = "xmas/santa/death2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound (self.death_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_TALL; + self.bossflag = TRUE; // Boss flag (like FL_MONSTER) + + if (self.health < 1) self.health = 1200; + self.gibhealth = -60; // Difficult to gib + self.blockudeath = TRUE; // no humanoid death sound + self.gibbed = FALSE; // Still in one peice + self.pain_flinch = 200; // Strong pain threshold + self.pain_timeout = 2; // Stop constant pain + self.infightextra = 8; // Does not like infighting + self.pain_longanim = FALSE; // No long pain animation + self.no_liquiddmg = TRUE; // no slime/lava damage + self.steptype = FS_TYPEHEAVY; // Giant boots! + self.poisonous = FALSE; // Not Supported + self.attack_offset = '28 22 26';// End of gun + self.attack_rage = TRUE; // Not in combat yet + self.deathstring = " was wrapped up by Santa\n"; + + // Setup Ammo Resistance + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0.5; + self.reflectlightning = TRUE; // Reflect lightning strikes + self.reflectplasma = TRUE; // Reflect plasma projectiles + + // Pain/Death functions + self.th_pain = santa_pain; + self.th_die = santa_die; + + // Check for GOOD Santa setup? + if (self.spawnflags & MON_SANTA_GOOD) { + // No targetname = no trigger! + if (self.targetname == "") { + dprint("\b[GOOD SANTA]\b Missing targetname name!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + // Setup default rescue message + self.noise = SOUND_EMPTY; + if (self.message == "") + self.message = "You have rescued Santa!\nfrom the claws of hell!\n"; + // Nobody should be trying to kill good santa, WTF!?! + self.resist_shells = self.resist_nails = 1.0; + self.resist_rockets = self.resist_cells = 1.0; + self.nomonstercount = TRUE; + self.health = self.max_health = MEGADEATH; + self.gibhealth = MON_NEVERGIB; + self.exactskin = 1; + // Direct every state to the sit function + self.th_stand = santa_seated; + self.th_walk = santa_seated; + self.th_run = santa_seated; + self.waitmin = 0; + } + else { + // Default EVIL Santa! + self.th_checkattack = SantaCheckAttack; + self.th_stand = santa_stand1; + self.th_walk = santa_walk1; + self.th_run = santa_run1; + self.th_melee = santa_sack1; + self.th_missile = santa_snowstart; + } + + self.classtype = CT_MONSANTA; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_xmas_snowman.qc b/QC_other/QC_keep/mon_xmas_snowman.qc new file mode 100644 index 00000000..b2b86dcc --- /dev/null +++ b/QC_other/QC_keep/mon_xmas_snowman.qc @@ -0,0 +1,297 @@ +/*============================================================================== +XMAS Snowman - From Twisted Christmas Mod by Twisted Matrix +==============================================================================*/ + +// (000) Standing Still +$frame stand1 + +// (001 - 005) Fast Claw attack +$frame claw1 claw2 claw3 claw4 claw5 + +// (006 - 008) Fast Nail Attack +$frame attack1 attack2 attack3 + +// (009 - 010) Misc modelling stuff +$frame base1 base2 + +//====================================================================== +void() snowm_stand1 = [ $stand1, snowm_stand2 ] {monster_idle_sound();ai_stand();} +void() snowm_stand2 = [ $stand1, snowm_stand3 ] {ai_stand();}; +void() snowm_stand3 = [ $stand1, snowm_stand4 ] {ai_stand();}; +void() snowm_stand4 = [ $stand1, snowm_stand5 ] {ai_stand();}; +void() snowm_stand5 = [ $stand1, snowm_stand6 ] {ai_stand();}; +void() snowm_stand6 = [ $stand1, snowm_stand7 ] {ai_stand();}; +void() snowm_stand7 = [ $stand1, snowm_stand8 ] {ai_stand();}; +void() snowm_stand8 = [ $stand1, snowm_stand1 ] {ai_stand();}; + +//====================================================================== +void() snowm_walk1 = [ $stand1, snowm_walk2 ] {monster_idle_sound();ai_walk(0);} +void() snowm_walk2 = [ $stand1, snowm_walk3 ] {ai_walk(0);}; +void() snowm_walk3 = [ $stand1, snowm_walk4 ] {ai_walk(0);}; +void() snowm_walk4 = [ $stand1, snowm_walk5 ] {ai_walk(0);}; +void() snowm_walk5 = [ $stand1, snowm_walk6 ] {ai_walk(0);}; +void() snowm_walk6 = [ $stand1, snowm_walk7 ] {ai_walk(0);}; +void() snowm_walk7 = [ $stand1, snowm_walk8 ] {ai_walk(0);}; +void() snowm_walk8 = [ $stand1, snowm_walk1 ] {ai_walk(0);}; + +//====================================================================== +void() snowm_run1 = [ $stand1, snowm_run2 ] {monster_idle_sound();ai_run(0);} +void() snowm_run2 = [ $stand1, snowm_run3 ] {ai_run(0);}; +void() snowm_run3 = [ $stand1, snowm_run4 ] {ai_run(0);}; +void() snowm_run4 = [ $stand1, snowm_run5 ] {ai_run(0);}; +void() snowm_run5 = [ $stand1, snowm_run6 ] {ai_run(0);}; +void() snowm_run6 = [ $stand1, snowm_run7 ] {ai_run(0);}; +void() snowm_run7 = [ $stand1, snowm_run8 ] {ai_run(0);}; +void() snowm_run8 = [ $stand1, snowm_run1 ] {ai_run(0);}; + +//====================================================================== +// MELEE : Crows Claw +//====================================================================== +void() SnowmMelee = +{ + local float ldmg; + + if (!self.enemy) return; + if (self.health < 1) return; + + ai_damagebreakable(10); // Damage any breakables + if (!ai_checkmelee(MONAI_MELEESNOWMAN)) return; // Too far away + + // Can the target bleed? + if (!self.enemy.takedamage) return; + + sound(self, CHAN_WEAPON, "xmas/snowman/claw.wav", TRUE, TRUE); + + // Claw attack is good (1-15) + ldmg = (random() + random() + random()) * 5; + if (ldmg < 1) ldmg = 1; + T_Damage (self.enemy, self, self, ldmg, DAMARMOR); + + // Spawn blood at claw + spawn_touchblood (self, self.enemy, ldmg*3); +}; + +//---------------------------------------------------------------------- +void() snowm_claw1 = [ $claw1, snowm_claw2 ] {ai_face();}; +void() snowm_claw2 = [ $claw2, snowm_claw3 ] {ai_face();}; +void() snowm_claw3 = [ $claw3, snowm_claw4 ] {ai_face();SnowmMelee();}; +void() snowm_claw4 = [ $claw4, snowm_claw5 ] {}; +void() snowm_claw5 = [ $claw5, snowm_run1 ] { + // Check if snowman is within range to attack again + if (ai_checkmelee(MONAI_MELEESNOWMAN) && self.enemy.health > 0) { + if (self.health > 0) self.think = snowm_claw1; + } +}; + +//====================================================================== +// RANGE : Burst of Nails +//====================================================================== +void() SnowmFireNails = +{ + local vector org, dir, vec; + local float loopvar; + + // Check for death? + if (self.health < 1) return; + loopvar = 0; + + // Light up face, setup projectile speed and play fire sound + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_speed = SPEED_NAILSNOWMPROJ + (skill * SPEED_NAILSNOWMSKILL); + sound(self, CHAN_WEAPON, "xmas/snowman/nail_fire.wav", 1, ATTN_NORM); + + // turn and face your enemy! + makevectors (self.angles); + org = self.origin + attack_vector(self.attack_offset); + + // Loop through the nail burst (all at once) + while (loopvar < self.attack_count) { + // Random circle spread pattern + vec = (crandom()*20)*v_right + (crandom()*20)*v_up; + dir = normalize((self.enemy.origin + vec) - org); + // Generate a red hot nail projectile + launch_projectile(org, dir, CT_PROJ_MONNG, self.attack_speed); + loopvar = loopvar + 1; + } +}; + +//---------------------------------------------------------------------- +void() snowm_nail1 = [ $attack1, snowm_nail2 ] {ai_face();}; +void() snowm_nail2 = [ $attack2, snowm_nail3 ] {ai_face();}; +void() snowm_nail3 = [ $attack3, snowm_nail4 ] {ai_face();SnowmFireNails();}; +void() snowm_nail4 = [ $attack2, snowm_nail5 ] {}; +void() snowm_nail5 = [ $attack1, snowm_run1 ] {ai_face();}; + +//====================================================================== +// PAIN : quick reflection +//====================================================================== +void() snowm_pain1 = [ $claw4, snowm_pain2 ] {}; +void() snowm_pain2 = [ $claw3, snowm_pain3 ] {}; +void() snowm_pain3 = [ $claw2, snowm_pain4 ] {}; +void() snowm_pain4 = [ $claw1, snowm_run1 ] {}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) snowm_pain = +{ + // Check all pain conditions and set up what to do next + monster_pain_check(attacker, damage); + + // Any pain animation/sound required? + if (self.pain_check > 0) { + if (random() < 0.5) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + if (self.pain_check == 1) snowm_pain1 (); + else if (self.pain_check == 2) { + // reset axe hit and setup short pain recovery + self.pain_finished = time + 0.6; + self.axhitme = 0; + snowm_pain1 (); + } + } +}; + +//====================================================================== +// Exploding snowball! +//====================================================================== +void() snowm_explode = +{ + // no more raindeer! + entity_hide (self); + // Make sure gibs go flying up + self.max_health = MON_GIBFOUNTAIN; + self.health = -100; + + // ID style explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (self.death_dmg > 0) + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + + // Sprite + Dust + SpawnExplosion(EXPLODE_BIG, self.origin, self.death_sound); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + SpawnProjectileSmoke(self.origin, 200, 250, 100); + + // No blood or guts! + ThrowGib(25, 1); + ThrowGib(11, 1); + ThrowGib(12, 1); + ThrowGib(13, 8 + rint(random()*8)); + + /*------------------------------------------------------------------- + // The snowball model has a melting animation (6 frames) + // Unfortunately it does look really old and dated, + // its better to let model just fade away. + // + // The final gib is a snowball which has a melting animation + // Setup animation start/finish parameters before throwing + self.gibAnimstart = 1; + self.gibAnimfinal = 5; + self.gibAnimTimer = 2; // timer + (random() * (timer*2)) + ThrowGib(13, 8 + rint(random()*8)); */ +}; + +//---------------------------------------------------------------------- +void() snowm_die = +{ + // Pre-check routine to tidy up extra entities + monster_death_precheck(); + + // There is no death animation + if (random() < 0.5) + sound (self, CHAN_BODY, self.death_sound, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.death_sound2, 1, ATTN_NORM); + snowm_explode(); +}; + +/*====================================================================== +QUAKED monster_snowman (1 0 0) (-16 -16 -24) (16 16 32) Ambush +======================================================================*/ +void() monster_xmas_snowman = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/xmas/mon_snowman.mdl"; // Top Hat Snow + self.headmdl = "progs/xmas/h_snowman.mdl"; // Top Hat + self.gib1mdl = "progs/xmas/gib_snowclaw.mdl"; // Claw + self.gib2mdl = "progs/xmas/gib_snowgun.mdl"; // Nail Gun + self.gib3mdl = "progs/xmas/gib_snowball.mdl"; // Snowballs + self.gib1sound = GIB_IMPACT_WOOD; + self.gib2sound = GIB_IMPACT_METALA; + + precache_model (self.mdl); + precache_model (self.headmdl); // Top Hat + precache_model (self.gib1mdl); // Claw + precache_model (self.gib2mdl); // Gun + precache_model (self.gib3mdl); // Snow-BALLS! + precache_model (MODEL_PROJ_NGRED); // Red Nails (easier to see) + + // Idle calm/angry + self.idle_sound = "xmas/snowman/idle.wav"; // Rustling sound + precache_sound (self.idle_sound); + + // Many different sight sounds + self.sight_sound = "xmas/snowman/sight1.wav"; // Deep voice + self.sight_sound2 = "xmas/snowman/sight2.wav"; // Growling + precache_sound (self.sight_sound); + precache_sound (self.sight_sound2); + self.sight_count = 2; + + // Melee/Range Attacks + // Original version used ice, switched to red nails + // Ice nails are really difficult to see + precache_sound ("xmas/snowman/claw.wav"); + precache_sound ("xmas/snowman/nail_fire.wav"); + + // precache sight, pain and death (changes on type) + self.pain_sound = "xmas/snowman/pain1.wav"; + self.pain_sound2 = "xmas/snowman/pain2.wav"; + self.death_sound = "xmas/snowman/death1.wav"; + self.death_sound2 = "xmas/snowman/death2.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + precache_sound (self.death_sound); + precache_sound (self.death_sound2); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + if (self.health < 1) self.health = 125; + if (self.death_dmg < 1) self.death_dmg = DAMAGE_SNOWMAN; + self.gibhealth = MON_NEVERGIB; // Cannot be gibbed by weapons + self.blockudeath = TRUE; // No humanoid death sound + self.gibbed = FALSE; // Still in one peice + self.pain_flinch = 30; // Light pain threshold + self.pain_longanim = FALSE; // No long pain animation + self.steptype = FS_TYPESLOW; // Small sounding feet + self.poisonous = FALSE; // Not Supported + self.meleeoffset = '24 0 20'; // Claw attack offset + self.attack_offset = '24 0 20'; // Run + Gun vector + self.bleedcolour = MON_BCOLOR_SILVER;// Red is odd for snow + self.deathstring = " was smashed on a Snowman\n"; + + // Default amount of nails to burst fire (5x9=45dmg) + if (self.attack_count < 1) self.attack_count = 5; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + self.th_checkattack = SnowmanCheckAttack; + self.th_stand = snowm_stand1; + self.th_walk = snowm_walk1; + self.th_run = snowm_run1; + self.th_melee = snowm_claw1; + self.th_missile = snowm_nail1; + self.th_pain = snowm_pain; + self.th_die = snowm_die; + + self.classtype = CT_MONSNOWMAN; + self.classgroup = CG_XMAS; + self.classmove = MON_MOVEWALK; + + monster_start(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_zerst.qc b/QC_other/QC_keep/mon_zerst.qc new file mode 100644 index 00000000..ed588a4b --- /dev/null +++ b/QC_other/QC_keep/mon_zerst.qc @@ -0,0 +1,114 @@ +/* +=========================================================================== + +The Zerstörer!! + +=========================================================================== +*/ + +void() Z_idle = +{ + self.frame = self.frame + 1; + self.cnt = self.cnt + 1; + + if (self.frame >= 20) + self.frame = 0; + if (self.cnt > 40) + self.cnt = 0; + + if (self.cnt < 20) + setorigin(self, self.origin + '0 0 1'); + else + setorigin(self, self.origin - '0 0 1'); + + self.think = Z_idle; + self.nextthink = time + 0.1; +}; + + +void() zer_awake = +{ + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_FLY; + setsize (self, '-16 -16 -24', '16 16 54'); + setorigin(self, self.origin); + setmodel (self, "progs/bbg.mdl"); + self.think = Z_idle; + self.nextthink = time + 0.1; + + sound (self, CHAN_AUTO, "boss1/out1.wav", 1, ATTN_NORM); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, (self.origin_z - 8)); +}; + +/*QUAKED monster_zer (1 0 0) (-128 -128 -24) (128 128 256) +*/ +void() monster_zer = +{ + if (deathmatch) + { + remove(self); + return; + } + precache_model ("progs/bbg.mdl"); + precache_sound ("boss1/out1.wav"); + + if (self.deathstring == "") self.deathstring = " was destroyed by the Zerstorer\n"; + + self.use = zer_awake; +}; + +//========================================================================= + +/* Finale explosive stuff */ + +void() do_lavasplash = +{ + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + remove(self); +}; + +void() func_lavasplash = +{ + self.use = do_lavasplash; +}; + +//=============== + +void() do_explode = +{ + //T_RadiusDamage (self, self.owner, 120, world); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + SUB_UseTargets (); + + BecomeExplosion (); +}; + +void() timed_exp = +{ + self.think = do_explode; + self.nextthink = time + self.delay; +}; + +void() func_explode = +{ + self.owner = find(world, classname, "monster_zer"); + if (self.delay) + self.use = timed_exp; + else + self.use = do_explode; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/mon_zmaster.qc b/QC_other/QC_keep/mon_zmaster.qc new file mode 100644 index 00000000..91496f30 --- /dev/null +++ b/QC_other/QC_keep/mon_zmaster.qc @@ -0,0 +1,791 @@ +/* +============================================================================== + +ZOMBIE MASTER + +============================================================================== +*/ + +$cd id1/models/knight2 +$origin 0 0 24 +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 +$frame walk10 walk11 walk12 walk13 walk14 walk15 walk16 walk17 +$frame walk18 walk19 walk20 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame death1 death2 death3 death4 death5 death6 death7 death8 +$frame death9 death10 death11 death12 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame char_a1 char_a2 char_a3 char_a4 char_a5 char_a6 char_a7 char_a8 +$frame char_a9 char_a10 char_a11 char_a12 char_a13 char_a14 char_a15 char_a16 + +$frame magica1 magica2 magica3 magica4 magica5 magica6 magica7 magica8 +$frame magica9 magica10 magica11 magica12 magica13 magica14 + +$frame magicb1 magicb2 magicb3 magicb4 magicb5 magicb6 magicb7 magicb8 +$frame magicb9 magicb10 magicb11 magicb12 magicb13 + +$frame char_b1 char_b2 char_b3 char_b4 char_b5 char_b6 + +$frame slice1 slice2 slice3 slice4 slice5 slice6 slice7 slice8 slice9 slice10 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 smash8 smash9 smash10 +$frame smash11 + +$frame w_attack1 w_attack2 w_attack3 w_attack4 w_attack5 w_attack6 w_attack7 +$frame w_attack8 w_attack9 w_attack10 w_attack11 w_attack12 w_attack13 w_attack14 +$frame w_attack15 w_attack16 w_attack17 w_attack18 w_attack19 w_attack20 +$frame w_attack21 w_attack22 + +$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 +$frame magicc9 magicc10 magicc11 + + +void(float dist) zmaster_run; +void() zmaster_run1; +void() zm_idle_sound; +float() zmaster_find_easy_victim; +float(entity testent) corpse_status; + +//=========================================================================== + +void() zmaster_stand1 =[ $stand1, zmaster_stand2 ] +{ + zmaster_find_easy_victim(); + if(self.effects != 0) + { + sound (self, CHAN_WEAPON, "items/protect2.wav", 1, ATTN_NORM); + self.effects = 0; + } + if(random() < 0.2) + zm_idle_sound(); + ai_stand(); +}; +void() zmaster_stand2 =[ $stand2, zmaster_stand3 ] {ai_stand();}; +void() zmaster_stand3 =[ $stand3, zmaster_stand4 ] {ai_stand();}; +void() zmaster_stand4 =[ $stand4, zmaster_stand5 ] {ai_stand();}; +void() zmaster_stand5 =[ $stand5, zmaster_stand6 ] {ai_stand();}; +void() zmaster_stand6 =[ $stand6, zmaster_stand7 ] {ai_stand();}; +void() zmaster_stand7 =[ $stand7, zmaster_stand8 ] {ai_stand();}; +void() zmaster_stand8 =[ $stand8, zmaster_stand9 ] {ai_stand();}; +void() zmaster_stand9 =[ $stand9, zmaster_stand1 ] {ai_stand();}; + +//=========================================================================== + +void() zmaster_walk1 =[ $walk1, zmaster_walk2 ] +{ + if(self.effects != 0) + { + sound (self, CHAN_WEAPON, "items/protect2.wav", 1, ATTN_NORM); + self.effects = 0; + } + if(random() < 0.2) + zm_idle_sound(); + FootFall("zmaster/echo.wav", 0.2, 1, 0.8); + ai_walk(2); +}; +void() zmaster_walk2 =[ $walk2, zmaster_walk3 ] {ai_walk(5);}; +void() zmaster_walk3 =[ $walk3, zmaster_walk4 ] {ai_walk(5);}; +void() zmaster_walk4 =[ $walk4, zmaster_walk5 ] {ai_walk(4);}; +void() zmaster_walk5 =[ $walk5, zmaster_walk6 ] {ai_walk(4);}; +void() zmaster_walk6 =[ $walk6, zmaster_walk7 ] {ai_walk(2);}; +void() zmaster_walk7 =[ $walk7, zmaster_walk8 ] {ai_walk(2);}; +void() zmaster_walk8 =[ $walk8, zmaster_walk9 ] {ai_walk(3);}; +void() zmaster_walk9 =[ $walk9, zmaster_walk10 ] {ai_walk(3);}; +void() zmaster_walk10 =[ $walk10, zmaster_walk11 ] {ai_walk(4);}; +void() zmaster_walk11 =[ $walk11, zmaster_walk12 ] +{FootFall("zmaster/echo.wav", 0.2, 1, 0.8);ai_walk(3);}; +void() zmaster_walk12 =[ $walk12, zmaster_walk13 ] {ai_walk(4);}; +void() zmaster_walk13 =[ $walk13, zmaster_walk14 ] {ai_walk(6);}; +void() zmaster_walk14 =[ $walk14, zmaster_walk15 ] {ai_walk(2);}; +void() zmaster_walk15 =[ $walk15, zmaster_walk16 ] {ai_walk(2);}; +void() zmaster_walk16 =[ $walk16, zmaster_walk17 ] {ai_walk(4);}; +void() zmaster_walk17 =[ $walk17, zmaster_walk18 ] {ai_walk(3);}; +void() zmaster_walk18 =[ $walk18, zmaster_walk19 ] {ai_walk(3);}; +void() zmaster_walk19 =[ $walk19, zmaster_walk20 ] {ai_walk(3);}; +void() zmaster_walk20 =[ $walk20, zmaster_walk1 ] {ai_walk(2);}; + +//============================================================================ + +void() zmaster_pain1 =[ $pain1, zmaster_pain2 ] +{ + sound (self, CHAN_VOICE, "zmaster/pain.wav", 1, ATTN_NORM); +}; +void() zmaster_pain2 =[ $pain2, zmaster_pain3 ] {}; +void() zmaster_pain3 =[ $pain3, zmaster_pain4 ] {}; +void() zmaster_pain4 =[ $pain4, zmaster_pain5 ] {}; +void() zmaster_pain5 =[ $pain5, zmaster_run1 ] {}; + +//============================================================================ + +void() zmaster_die1 =[ $death1, zmaster_die2 ] {ai_forward(10);}; +void() zmaster_die2 =[ $death2, zmaster_die3 ] {ai_forward(8);}; +void() zmaster_die3 =[ $death3, zmaster_die4 ] +{self.solid = SOLID_NOT;ai_forward(7);}; +void() zmaster_die4 =[ $death4, zmaster_die5 ] {}; +void() zmaster_die5 =[ $death5, zmaster_die6 ] {}; +void() zmaster_die6 =[ $death6, zmaster_die7 ] {}; +void() zmaster_die7 =[ $death7, zmaster_die8 ] {}; +void() zmaster_die8 =[ $death8, zmaster_die9 ] {ai_forward(10);}; +void() zmaster_die9 =[ $death9, zmaster_die10 ] {ai_forward(11);}; +void() zmaster_die10 =[ $death10, zmaster_die11 ] {}; +void() zmaster_die11 =[ $death11, zmaster_die12 ] {}; +void() zmaster_die12 =[ $death12, zmaster_die12 ] {}; + +void() zmaster_dieb1 =[ $deathb1, zmaster_dieb2 ] {}; +void() zmaster_dieb2 =[ $deathb2, zmaster_dieb3 ] {self.solid = SOLID_NOT;}; +void() zmaster_dieb3 =[ $deathb3, zmaster_dieb4 ] {}; +void() zmaster_dieb4 =[ $deathb4, zmaster_dieb5 ] {}; +void() zmaster_dieb5 =[ $deathb5, zmaster_dieb6 ] {}; +void() zmaster_dieb6 =[ $deathb6, zmaster_dieb7 ] {}; +void() zmaster_dieb7 =[ $deathb7, zmaster_dieb8 ] {}; +void() zmaster_dieb8 =[ $deathb8, zmaster_dieb9 ] {}; +void() zmaster_dieb9 =[ $deathb9, zmaster_dieb9 ] {}; + +void() zmaster_die = +{ +// check for gib + if (self.health < -40) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/drake/h_zmastr.mdl", self.health); + ThrowGib ("progs/drake/h_axzomb.mdl", self.health); + ThrowGib ("progs/drake/h_axzomb.mdl", self.health); + ThrowGib ("progs/drake/h_axzomb.mdl", self.health); + ThrowGib ("progs/zom_gib.mdl", self.health); + ThrowGib ("progs/zom_gib.mdl", self.health); + ThrowGib ("progs/zom_gib.mdl", self.health); + return; + } + +// play death sound when not hit by arrow + sound (self, CHAN_VOICE, "zmaster/death.wav", 1, ATTN_NORM); + +// regular death + + if (random() > 0.5) + zmaster_die1 (); + else + zmaster_dieb1 (); +}; + +//============================================================================ + +void() zmaster_seeker_hunt = +{ + self.nextthink = time + 0.1; + // the missiles can only seek for a few seconds + self.gorging = self.gorging + 1; + if(self.gorging > 30) + { + remove(self); + return; + } + + + if(visible(self.enemy)) + target_missile(self, self.enemy.origin, 4); +}; + +void() zmaster_start_seeker = +{ + self.gorging = ceil(random()*20); + self.nextthink = time + 0.01 + random() * 0.5; + self.think = zmaster_seeker_hunt; +}; + +void(float offseth, float offsetv) zmaster_shot = +{ + local entity firemis; + local vector org, vec, dir; + + org = self.origin + v_up * 30 + v_forward * 32; + dir_x = 300; + dir_y = offseth; + dir_z = offsetv; + + firemis = launch_missile("progs/k_spike.mdl", org, dir); + // his missiles start seeking at different times + setup_missile(firemis, 0.2 + random()*2, zmaster_start_seeker, M_Spike_Touch, 1, 1); + target_missile(firemis, self.enemy.origin, 5); + firemis.enemy = self.enemy; + + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); +}; + +// looks for any nearby corpses or zombies to take over +// and goes after the nearest +float() zmaster_find_easy_victim = +{ + local entity victim, enemyold; + local float curr_dist, min_dist, found_one, vdist; + + + enemyold = self.enemy; + min_dist = 1000; + found_one = FALSE; + victim = nextent(world); + while(victim) + { + if (corpse_status(victim)) + { + if(visible(victim)) + { + curr_dist = vlen(self.origin - victim.origin); + if(curr_dist < min_dist) + { + self.enemy = victim; + found_one = TRUE; + min_dist = curr_dist; + } + } + } + else if(victim.classname == "monster_zombie" || + victim.classname == "monster_axzombie") + { + if(victim.owner == world && visible(victim)) + { + curr_dist = vlen(self.origin - victim.origin); + if(curr_dist < min_dist) + { + self.enemy = victim; + found_one = TRUE; + min_dist = curr_dist; + } + } + } + victim = nextent(victim); + } + if(found_one && enemyold != self.enemy) + { + FoundTarget (); + if(self.effects == 0) + { + sound (self, CHAN_WEAPON, "items/protect.wav", 1, ATTN_NORM); + self.effects = EF_BRIGHTFIELD; + } + self.oldenemy = enemyold; + sound (self, CHAN_VOICE, "zmaster/toreturn.wav", 1, ATTN_NORM); + self.currentammo = time + 4; + } + return found_one; +}; + +//=========================================================================== + +void() zmaster_run1 =[ $walk1, zmaster_run2 ] +{zm_idle_sound();FootFall("zmaster/echo.wav", 0.5, 1, 0.8);zmaster_run(2);}; +void() zmaster_run2 =[ $walk2, zmaster_run3 ] {zmaster_run(5);}; +void() zmaster_run3 =[ $walk3, zmaster_run4 ] {zmaster_run(5);}; +void() zmaster_run4 =[ $walk4, zmaster_run5 ] {zmaster_run(4);}; +void() zmaster_run5 =[ $walk5, zmaster_run6 ] {zmaster_run(4);}; +void() zmaster_run6 =[ $walk6, zmaster_run7 ] {zmaster_run(2);}; +void() zmaster_run7 =[ $walk7, zmaster_run8 ] {zmaster_run(2);}; +void() zmaster_run8 =[ $walk8, zmaster_run9 ] {zmaster_run(3);}; +void() zmaster_run9 =[ $walk9, zmaster_run10 ] {zmaster_run(3);}; +void() zmaster_run10 =[ $walk10, zmaster_run11 ] {zmaster_run(4);}; +void() zmaster_run11 =[ $walk11, zmaster_run12 ] +{FootFall("zmaster/echo.wav", 0.5, 1, 0.8);zmaster_run(3);}; +void() zmaster_run12 =[ $walk12, zmaster_run13 ] {zmaster_run(4);}; +void() zmaster_run13 =[ $walk13, zmaster_run14 ] {zmaster_run(6);}; +void() zmaster_run14 =[ $walk14, zmaster_run15 ] {zmaster_run(2);}; +void() zmaster_run15 =[ $walk15, zmaster_run16 ] {zmaster_run(2);}; +void() zmaster_run16 =[ $walk16, zmaster_run17 ] {zmaster_run(4);}; +void() zmaster_run17 =[ $walk17, zmaster_run18 ] {zmaster_run(3);}; +void() zmaster_run18 =[ $walk18, zmaster_run19 ] {zmaster_run(3);}; +void() zmaster_run19 =[ $walk19, zmaster_run20 ] {zmaster_run(3);}; +void() zmaster_run20 =[ $walk20, zmaster_run1 ] {zmaster_run(2);}; + +//============================================================================ + +// Turns the current enemy into a controlled zombie +void() zmaster_zombify = +{ + local entity temp; + local vector shift; + + temp = self; + self = self.enemy; + + self.enemy = world; + + if(self.classname != "monster_zombie" && + self.classname != "monster_axzombie") + { + self.ammo_shells = 0; // death counter + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/axzombie.mdl"); + setsize (self, '-16 -16 -24', '16 16 40'); + + self.takedamage = DAMAGE_AIM; + + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = axzombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; + self.th_melee = zombie_missile; + + self.classname = "monster_axzombie"; + self.max_health = 400; + self.health = self.max_health + 1; + + // make sure it's on the ground + shift = self.origin + '0 0 8'; + setorigin(self, shift); + traceline (self.origin, self.origin + '0 0 -60', TRUE, self); + while(trace_fraction != 1.0) + { + shift = self.origin + '0 0 8'; + setorigin(self, shift); + traceline (self.origin, self.origin + '0 0 -60', TRUE, self); + } + droptofloor(); + + zombie_paine14b(); + } + else + { + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/axzombie.mdl"); + setsize (self, '-16 -16 -24', '16 16 40'); + + self.takedamage = DAMAGE_AIM; + + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = axzombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; + self.th_melee = zombie_missile; + + if(self.classname == "monster_zombie") + { + self.classname = "monster_axzombie"; + self.max_health = 400; + } + self.health = self.max_health + 1; + + zombie_painc8b(); + } + + self.owner = temp; + self.nextthink = time + 2; + self = temp; + self.wait = time + 3 + random()*3; +}; + +//============================================================================ + +void() zmaster_magica1 =[ $magica1, zmaster_magica2 ] +{ + ai_face(); + if(self.effects != EF_BRIGHTFIELD) + sound (self, CHAN_WEAPON, "items/protect.wav", 1, ATTN_NORM); +}; +void() zmaster_magica2 =[ $magica1, zmaster_magica3 ] +{ + ai_face(); + self.effects = EF_BRIGHTFIELD; + self.nextthink = time + 0.25; +}; +void() zmaster_magica3 =[ $magica1, zmaster_magica4 ] {self.nextthink = time + 0.5;ai_face();}; +void() zmaster_magica4 =[ $magica2, zmaster_magica5 ] {self.nextthink = time + 0.15;ai_face();}; +void() zmaster_magica5 =[ $magica3, zmaster_magica6 ] {self.nextthink = time + 0.15;ai_face();}; +void() zmaster_magica6 =[ $magica4, zmaster_magica7 ] {self.nextthink = time + 0.15;ai_face();}; +void() zmaster_magica7 =[ $magica5, zmaster_magica8 ] +{ + sound (self, CHAN_VOICE, "zmaster/energize.wav", 1, ATTN_NORM); + self.nextthink = time + 0.15; + ai_face(); + self.effects = self.effects | EF_DIMLIGHT; +}; +void() zmaster_magica8 =[ $magica6, zmaster_magica9 ] +{ + self.nextthink = time + 1; + ai_face(); +}; +void() zmaster_magica9 =[ $magica7, zmaster_magica10 ] {ai_face();}; +void() zmaster_magica10 =[ $magica8, zmaster_magica11 ] {ai_face();}; +void() zmaster_magica11 =[ $magica9, zmaster_magica12 ] {ai_face();}; +void() zmaster_magica12 =[ $magica10, zmaster_magica13 ] {ai_face();}; +void() zmaster_magica13 =[ $magica11, zmaster_magica14 ] +{ + ai_face(); + + // when gorging != 0, attacking a living creature + if(self.gorging != 0) + { + // don't hit if creature is alive and out of range + if(range(self.enemy) != RANGE_MELEE) + { + self.endtime = 0.1; + return; + } + else + self.endtime = 0.2; + + if(self.enemy.classname != "player") + T_KillDamage(self.enemy, self, self); + else + T_Damage(self.enemy, self, self, 100); + } + else + zmaster_zombify(); + + self.effects = EF_BRIGHTLIGHT + EF_BRIGHTFIELD; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + if(self.gorging != 0) + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + else + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord (MSG_BROADCAST, self.enemy.origin_x); + WriteCoord (MSG_BROADCAST, self.enemy.origin_y); + WriteCoord (MSG_BROADCAST, self.enemy.origin_z); +}; +void() zmaster_magica14 =[ $magica11, zmaster_magica15 ] {}; +void() zmaster_magica15 =[ $magica11, zmaster_magica16 ] +{ + self.effects = EF_DIMLIGHT + EF_BRIGHTFIELD; +}; +void() zmaster_magica16 =[ $magica11, zmaster_magica17 ] +{ + self.nextthink = time + 0.75; +}; +void() zmaster_magica17 =[ $magica12, zmaster_magica18 ] +{ + self.effects = self.effects - EF_DIMLIGHT; + self.nextthink = time + self.endtime; +}; +void() zmaster_magica18 =[ $magica13, zmaster_magica19 ] +{self.nextthink = time + self.endtime;}; +void() zmaster_magica19 =[ $magica14, zmaster_magica20 ] +{self.nextthink = time + self.endtime;}; +void() zmaster_magica20 =[ $magica1, zmaster_magica21 ] +{self.nextthink = time + self.endtime;}; +void() zmaster_magica21 =[ $pain5, zmaster_run1 ] +{ + if(self.endtime == 0.2) + self.nextthink =time + 1; + else + self.nextthink =time + 0.3; +}; + +//============================================================================ + +void() zmaster_magicb1 =[ $magicb1, zmaster_magicb2 ] {ai_face();}; +void() zmaster_magicb2 =[ $magicb2, zmaster_magicb3 ] {ai_face();}; +void() zmaster_magicb3 =[ $magicb3, zmaster_magicb4 ] {ai_face();}; +void() zmaster_magicb4 =[ $magicb4, zmaster_magicb5 ] {ai_face();}; +void() zmaster_magicb5 =[ $magicb5, zmaster_magicb6 ] {ai_face();}; +void() zmaster_magicb6 =[ $magicb6, zmaster_magicb7 ] {ai_face();}; +void() zmaster_magicb7 =[ $magicb7, zmaster_magicb8 ] {ai_face();}; +void() zmaster_magicb8 =[ $magicb8, zmaster_magicb9 ] {ai_face();}; +void() zmaster_magicb9 =[ $magicb9, zmaster_magicb10] +{ + zmaster_shot(0,16); + zmaster_shot(80,16); + zmaster_shot(-80,16); + zmaster_shot(0,80); + zmaster_shot(0,-64); + zmaster_shot(50,80); + zmaster_shot(-50,80); + zmaster_shot(50,-35); + zmaster_shot(-50,-35); +}; +void() zmaster_magicb10 =[ $magicb10, zmaster_magicb11] {ai_face();}; +void() zmaster_magicb11 =[ $magicb11, zmaster_magicb12] {ai_face();}; +void() zmaster_magicb12 =[ $magicb12, zmaster_magicb13] {ai_face();}; +void() zmaster_magicb13 =[ $magicb13, zmaster_run1] {ai_face();}; + +//============================================================================ + +void() zm_idle_sound = +{ + if (random() < 0.2 && self.currentammo < time) + { + if(random() < 0.5) + { + sound (self, CHAN_VOICE, "zmaster/idle1.wav", 1, ATTN_NORM); + self.currentammo = time + 2.5; + } + else + { + sound (self, CHAN_VOICE, "zmaster/idle2.wav", 1, ATTN_NORM); + self.currentammo = time + 1.5; + } + } +}; + +void() zmaster_missile = +{ + if (corpse_status(self.enemy)) + return; + + if(self.gorging > time) + return; + zmaster_magicb1(); + self.gorging = time + 2.5; +}; + +void() zmaster_melee = +{ + if (corpse_status(self.enemy) || + self.enemy.classname == "monster_zombie" || + self.enemy.classname == "monster_axzombie") + { + self.gorging = 0; + zmaster_magica1(); + } + else + { + if(random() < 0.25) + { + self.gorging = time + 5; + zmaster_magica1(); + } + else + { + if(self.gorging > time) + return; + zmaster_magicb1(); + self.gorging = time + 1.5; + } + } +}; + +void(entity attacker, float damage) zmaster_pain = +{ +// monster_beam_skin(); + + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, "zmaster/pain.wav", 1, ATTN_NORM); + + if (time - self.pain_finished > 5) + { // always go into pain frame if it has been a while + zmaster_pain1 (); + self.pain_finished = time + 1; + return; + } + + if (random()*50 > damage) + return; // didn't flinch + + self.pain_finished = time + 2; + zmaster_pain1 (); +}; + +/*QUAKED monster_zombie_master (1 0 0) (-16 -16 -24) (16 16 40) Ambush +*/ +void() monster_zombie_master = +{ + if (deathmatch) + { + remove(self); + return; + } + precache_model2 ("progs/zmaster.mdl"); + precache_model2 ("progs/k_spike.mdl"); + precache_model2 ("progs/h_zmastr.mdl"); + + + precache_sound2 ("hknight/attack1.wav"); + precache_sound2 ("zmaster/death.wav"); + precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2 + precache_sound2 ("hknight/slash1.wav"); + precache_sound2 ("zmaster/idle1.wav"); + precache_sound2 ("zmaster/idle2.wav"); + precache_sound2 ("zmaster/sight.wav"); + precache_sound2 ("zmaster/pain.wav"); + + precache_sound2 ("zmaster/energize.wav"); + precache_sound2 ("zmaster/toreturn.wav"); + precache_sound2 ("zmaster/comnback.wav"); + + precache_sound ("items/protect.wav"); + precache_sound ("items/protect2.wav"); + precache_sound ("items/protect3.wav"); + +// sound prechache for foot steps + precache_sound ("zmaster/echo.wav"); + +// precaches for the controlled zombies + precache_model ("progs/axzombie.mdl"); + precache_model ("progs/h_axzomb.mdl"); + precache_model ("progs/zom_gib.mdl"); + + precache_sound ("zombie/z_idle.wav"); + precache_sound ("zombie/z_idle1.wav"); + precache_sound ("zombie/z_shot1.wav"); + precache_sound ("zombie/z_gib.wav"); + precache_sound ("zombie/z_pain.wav"); + precache_sound ("zombie/z_pain1.wav"); + precache_sound ("zombie/z_fall.wav"); + precache_sound ("zombie/z_miss.wav"); + precache_sound ("zombie/z_hit.wav"); + precache_sound ("zombie/idle_w2.wav"); + +// a clue on how to kill the modified axzombies + precache_sound ("zombie/trick.wav"); + + if (self.deathstring == "") self.deathstring = " joins a Zombie Master's zombie hoard\n"; + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/zmaster.mdl"); + + setsize (self, '-16 -16 -24', '16 16 40'); + self.health = 1250; + self.hittype = HIT_METAL; + self.th_stand = zmaster_stand1; + self.th_walk = zmaster_walk1; + self.th_run = zmaster_run1; + self.th_melee = zmaster_melee; + self.th_missile = zmaster_missile; + self.th_pain = zmaster_pain; + self.th_die = zmaster_die; + + +// ### Added for Custents all affecting gravity + if(!self.gravity) + self.gravity = 1; + else + self.gravity = ((self.gravity - 1) / 100); +// ### + + walkmonster_start (); +}; + +void(float dist) zmaster_run = +{ + local vector delta; + local float axis; + local float direct, ang_rint, ang_floor, ang_ceil, r; + + movedist = dist; + +// a zombie master's first priority is getting more zombies + if(time > self.wait) + { + zmaster_find_easy_victim(); + self.wait = time + 1.5; + } + if(self.effects != 0) + { + if(self.enemy.classname != "monster_zombie" && + self.enemy.classname != "monster_axzombie" && + !corpse_status(self.enemy)) + { + sound (self, CHAN_WEAPON, "items/protect2.wav", 1, ATTN_NORM); + self.effects = 0; + } + } + else if((self.enemy.classname == "monster_zombie" || + self.enemy.classname == "monster_axzombie") && + self.enemy.owner != world) + { + if(self.oldenemy) + { + self.enemy = self.oldenemy; + self.oldenemy = world; + FoundTarget (); + } + } + +// take control of a corpse when close enough + if(corpse_status(self.enemy)) + { + r = vlen(self.enemy.origin - self.origin); + if (r < 80) + { + self.th_melee (); + return; + } + + if(!visible(self.enemy)) + if(visible(self.oldenemy)) + self.enemy = self.oldenemy; + } +// see if the enemy is no longer of interest + if ((self.enemy.classname == "headib") || self.enemy.owner != world) + { + self.enemy = world; + // FIXME: look all around for other targets + if (self.oldenemy.owner != self && + (self.oldenemy.health > 0 || + corpse_status(self.oldenemy))) + { + self.enemy = self.oldenemy; + self.oldenemy = world; + HuntTarget (); + sound (self, CHAN_VOICE, "zmaster/comnback.wav", 1, ATTN_NORM); + self.currentammo = time + 2.5; + } + else + { + if (self.movetarget) + self.th_walk (); + else + self.th_stand (); + return; + } + } + + self.show_hostile = time + 1; // wake up other monsters + +// check knowledge of enemy + enemy_vis = visible(self.enemy); + if (enemy_vis) + self.search_time = time + 5; + +// look for other coop players + enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + + if (CheckAnyAttack ()) + return; // beginning an attack + + // head straight in + movetogoal (dist); // done in C code... +}; + +float(entity testent) corpse_status = +{ + if(testent.classname == "corpse") + return TRUE; + else if ((testent.health <= 0) && (testent.flags & (FL_MONSTER|FL_CLIENT))) + { + if(testent.classname != "headgib") + return TRUE; + } + else if(testent.classname == "player") + { + if(testent.deadflag) + return TRUE; + } + + return FALSE; +}; diff --git a/QC_other/QC_keep/mon_zombie.qc b/QC_other/QC_keep/mon_zombie.qc new file mode 100644 index 00000000..ccd76863 --- /dev/null +++ b/QC_other/QC_keep/mon_zombie.qc @@ -0,0 +1,686 @@ +/*============================================================================== +ZOMBIE +==============================================================================*/ +$cd id1/models/zombie + +$origin 0 0 24 + +$base base +$skin skin + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11 +$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 +$frame run13 run14 run15 run16 run17 run18 + +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11 +$frame atta12 atta13 + +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11 +$frame attb12 attb13 attb14 + +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11 +$frame attc12 + +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10 +$frame paina11 paina12 + +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10 +$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19 +$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10 +$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19 +$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28 +$frame paine29 paine30 + +$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6 + +void(float type) zombie_sound; + +//============================================================================= +void() zombie_stand1 =[ $stand1, zombie_stand2 ] { + zombie_sound(2); self.solid = SOLID_SLIDEBOX; ai_stand(); +}; +void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();}; +void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();}; +void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();}; +void() zombie_stand5 =[ $stand5, zombie_stand6 ] {ai_stand();}; +void() zombie_stand6 =[ $stand6, zombie_stand7 ] {ai_stand();}; +void() zombie_stand7 =[ $stand7, zombie_stand8 ] {ai_stand();}; +void() zombie_stand8 =[ $stand8, zombie_stand9 ] {ai_stand();}; +void() zombie_stand9 =[ $stand9, zombie_stand10 ] {ai_stand();}; +void() zombie_stand10 =[ $stand10, zombie_stand11 ] {ai_stand();}; +void() zombie_stand11 =[ $stand11, zombie_stand12 ] {ai_stand();}; +void() zombie_stand12 =[ $stand12, zombie_stand13 ] {ai_stand();}; +void() zombie_stand13 =[ $stand13, zombie_stand14 ] {ai_stand();}; +void() zombie_stand14 =[ $stand14, zombie_stand15 ] {ai_stand();}; +void() zombie_stand15 =[ $stand15, zombie_stand1 ] {ai_stand();}; + +//============================================================================ +void() zombie_cruc1 = [ $cruc_1, zombie_cruc2 ] {zombie_sound(1);}; +void() zombie_cruc2 = [ $cruc_2, zombie_cruc3 ] { self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc3 = [ $cruc_3, zombie_cruc4 ] { self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] { self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] { self.nextthink = time + 0.1 + random()*0.1;}; +void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] { self.nextthink = time + 0.1 + random()*0.1;}; + +//============================================================================ +void() zombie_walk1 =[ $walk1, zombie_walk2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_walk(0); +}; +void() zombie_walk2 =[ $walk2, zombie_walk3 ] {monster_footstep(TRUE); ai_walk(2);}; +void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);}; +void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);}; +void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);}; +void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);}; +void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);}; +void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);}; +void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);}; +void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);}; +void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);}; +void() zombie_walk12 =[ $walk12, zombie_walk13 ] {monster_footstep(FALSE); ai_walk(2);}; +void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);}; +void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);}; +void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);}; +void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);}; +void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);}; +void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);}; +void() zombie_walk19 =[ $walk19, zombie_walk1 ] {zombie_sound(2);}; + +//============================================================================ +void() zombie_run1 =[ $run1, zombie_run2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_run(1); +}; +void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);}; +void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);}; +void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);}; +void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);}; +void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);}; +void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);}; +void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);}; +void() zombie_run9 =[ $run9, zombie_run10] {monster_footstep(FALSE); ai_run(2);}; +void() zombie_run10 =[ $run10, zombie_run11] {ai_run(0);}; +void() zombie_run11 =[ $run11, zombie_run12] {ai_run(0);}; +void() zombie_run12 =[ $run12, zombie_run13] {ai_run(0);}; +void() zombie_run13 =[ $run13, zombie_run14] {ai_run(2);}; +void() zombie_run14 =[ $run14, zombie_run15] {ai_run(4);}; +void() zombie_run15 =[ $run15, zombie_run16] {ai_run(6);}; +void() zombie_run16 =[ $run16, zombie_run17] {ai_run(7);}; +void() zombie_run17 =[ $run17, zombie_run18] {monster_footstep(FALSE); ai_run(3);}; +void() zombie_run18 =[ $run18, zombie_run1 ] {zombie_sound(3); ai_run(8); }; + +//====================================================================== +// Zombie Range Attack +//====================================================================== +void(vector st) ZombieThrowFlesh = +{ + local vector org, dir, ang, avel; + local float zom_proj; + + // Throw the flesh missle from the hand above the head + org = self.origin + st_x*v_forward + st_y*v_right + (st_z - 24)*v_up; + + // Is Z aware enabled (AI track player much better) + if ( query_configflag(SVR_ZAWARE) || self.no_zaware ) { + makevectors (self.angles); + dir = normalize(self.enemy.origin - org); + dir = dir * SPEED_ZOMBFLESH; + dir_z = ELEV_ZAXIS; + } + else { + // One final angle adjustment (based on actual projectile origin) + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(self.attack_elev, org, self.enemy.origin, self.attack_speed); + ang = vectoangles(self.enemy.origin - org); + ang_x = -self.attack_elev; + makevectors (ang); + dir = v_forward * self.attack_speed; + } + + avel = vecrand(100,200,FALSE); + if (self.classtype == CT_MONZOMBIE) zom_proj = CT_PROJ_FLESH; + else zom_proj = CT_PROJ_FLESHP; + + Launch_Grenade(org, dir, avel, zom_proj); +}; + +//---------------------------------------------------------------------- +void() zombie_atta1 =[ $atta1, zombie_atta2 ] {ai_face();}; +void() zombie_atta2 =[ $atta2, zombie_atta3 ] {ai_face();}; +void() zombie_atta3 =[ $atta3, zombie_atta4 ] {ai_face();}; +void() zombie_atta4 =[ $atta4, zombie_atta5 ] {ai_face();}; +void() zombie_atta5 =[ $atta5, zombie_atta6 ] {ai_face();}; +void() zombie_atta6 =[ $atta6, zombie_atta7 ] {ai_face();}; +void() zombie_atta7 =[ $atta7, zombie_atta8 ] {ai_face();}; +void() zombie_atta8 =[ $atta8, zombie_atta9 ] {ai_face();}; +void() zombie_atta9 =[ $atta9, zombie_atta10 ] {ai_face();}; +void() zombie_atta10 =[ $atta10, zombie_atta11 ] {ai_face(); + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, self.attack_speed); }; +void() zombie_atta11 =[ $atta11, zombie_atta12 ] {ai_face(); + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() zombie_atta12 =[ $atta12, zombie_atta13 ] {ai_face(); + self.attack_speed = SPEED_ZOMBFLESH + (skill * SPEED_ZOMBIESKILL); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, self.attack_speed); }; +void() zombie_atta13 =[ $atta13, zombie_run1 ] {ai_face();ZombieThrowFlesh('-10 -22 30'); }; + +//---------------------------------------------------------------------- +void() zombie_attb1 =[ $attb1, zombie_attb2 ] {ai_face();}; +void() zombie_attb2 =[ $attb2, zombie_attb3 ] {ai_face();}; +void() zombie_attb3 =[ $attb3, zombie_attb4 ] {ai_face();}; +void() zombie_attb4 =[ $attb4, zombie_attb5 ] {ai_face();}; +void() zombie_attb5 =[ $attb5, zombie_attb6 ] {ai_face();}; +void() zombie_attb6 =[ $attb6, zombie_attb7 ] {ai_face();}; +void() zombie_attb7 =[ $attb7, zombie_attb8 ] {ai_face();}; +void() zombie_attb8 =[ $attb8, zombie_attb9 ] {ai_face();}; +void() zombie_attb9 =[ $attb9, zombie_attb10 ] {ai_face();}; +void() zombie_attb10 =[ $attb10, zombie_attb11 ] {ai_face();}; +void() zombie_attb11 =[ $attb11, zombie_attb12 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attb12 =[ $attb12, zombie_attb13 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attb13 =[ $attb13, zombie_attb14 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attb14 =[ $attb13, zombie_run1 ] {ai_face();ZombieThrowFlesh('-10 -24 29');}; + +//---------------------------------------------------------------------- +void() zombie_attc1 =[ $attc1, zombie_attc2 ] {ai_face();}; +void() zombie_attc2 =[ $attc2, zombie_attc3 ] {ai_face();}; +void() zombie_attc3 =[ $attc3, zombie_attc4 ] {ai_face();}; +void() zombie_attc4 =[ $attc4, zombie_attc5 ] {ai_face();}; +void() zombie_attc5 =[ $attc5, zombie_attc6 ] {ai_face();}; +void() zombie_attc6 =[ $attc6, zombie_attc7 ] {ai_face();}; +void() zombie_attc7 =[ $attc7, zombie_attc8 ] {ai_face();}; +void() zombie_attc8 =[ $attc8, zombie_attc9 ] {ai_face();}; +void() zombie_attc9 =[ $attc9, zombie_attc10 ] {ai_face(); + self.attack_elev = SUB_Elevation(ELEV_DEFAULT, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face(); + self.attack_elev = SUB_Elevation(self.attack_elev, self.origin, self.enemy.origin, SPEED_ZOMBFLESH); }; +void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieThrowFlesh('-12 -19 29');}; + +//---------------------------------------------------------------------- +void() zombie_missile = +{ + self.lip = self.meleeattack; + // Don't pick the same attack twice in a row + while (self.lip == self.meleeattack) { + self.lip = rint(random()*3); + } + + self.meleeattack = self.lip; + if (self.meleeattack == 1) zombie_atta1 (); + else if (self.meleeattack == 2) zombie_attb1 (); + else zombie_attc1 (); +}; + +//====================================================================== +// PAIN +//====================================================================== +void() zombie_paina1 =[ $paina1, zombie_paina2 ] {}; +void() zombie_paina2 =[ $paina2, zombie_paina3 ] {ai_painforward(3);}; +void() zombie_paina3 =[ $paina3, zombie_paina4 ] {ai_painforward(1);}; +void() zombie_paina4 =[ $paina4, zombie_paina5 ] {ai_pain(1);}; +void() zombie_paina5 =[ $paina5, zombie_paina6 ] {ai_pain(3);}; +void() zombie_paina6 =[ $paina6, zombie_paina7 ] {ai_pain(1);}; +void() zombie_paina7 =[ $paina7, zombie_paina8 ] {}; +void() zombie_paina8 =[ $paina8, zombie_paina9 ] {}; +void() zombie_paina9 =[ $paina9, zombie_paina10 ] {}; +void() zombie_paina10 =[ $paina10, zombie_paina11 ] {}; +void() zombie_paina11 =[ $paina11, zombie_paina12 ] {}; +void() zombie_paina12 =[ $paina12, zombie_run1 ] {self.inpain = 0;}; + +//---------------------------------------------------------------------- +void() zombie_painc1 =[ $painc1, zombie_painc2 ] {}; +void() zombie_painc2 =[ $painc2, zombie_painc3 ] {}; +void() zombie_painc3 =[ $painc3, zombie_painc4 ] {ai_pain(3);}; +void() zombie_painc4 =[ $painc4, zombie_painc5 ] {ai_pain(1);}; +void() zombie_painc5 =[ $painc5, zombie_painc6 ] {}; +void() zombie_painc6 =[ $painc6, zombie_painc7 ] {}; +void() zombie_painc7 =[ $painc7, zombie_painc8 ] {}; +void() zombie_painc8 =[ $painc8, zombie_painc9 ] {}; +void() zombie_painc9 =[ $painc9, zombie_painc10 ] {}; +void() zombie_painc10 =[ $painc10, zombie_painc11 ] {}; +void() zombie_painc11 =[ $painc11, zombie_painc12 ] {ai_painforward(1);}; +void() zombie_painc12 =[ $painc12, zombie_painc13 ] {ai_painforward(1);}; +void() zombie_painc13 =[ $painc13, zombie_painc14 ] {}; +void() zombie_painc14 =[ $painc14, zombie_painc15 ] {}; +void() zombie_painc15 =[ $painc15, zombie_painc16 ] {}; +void() zombie_painc16 =[ $painc16, zombie_painc17 ] {}; +void() zombie_painc17 =[ $painc17, zombie_painc18 ] {}; +void() zombie_painc18 =[ $painc18, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombie_paind1 =[ $paind1, zombie_paind2 ] {}; +void() zombie_paind2 =[ $paind2, zombie_paind3 ] {}; +void() zombie_paind3 =[ $paind3, zombie_paind4 ] {}; +void() zombie_paind4 =[ $paind4, zombie_paind5 ] {}; +void() zombie_paind5 =[ $paind5, zombie_paind6 ] {}; +void() zombie_paind6 =[ $paind6, zombie_paind7 ] {}; +void() zombie_paind7 =[ $paind7, zombie_paind8 ] {}; +void() zombie_paind8 =[ $paind8, zombie_paind9 ] {}; +void() zombie_paind9 =[ $paind9, zombie_paind10 ] {ai_pain(1);}; +void() zombie_paind10 =[ $paind10, zombie_paind11 ] {}; +void() zombie_paind11 =[ $paind11, zombie_paind12 ] {}; +void() zombie_paind12 =[ $paind12, zombie_paind13 ] {}; +void() zombie_paind13 =[ $paind13, zombie_run1 ] {}; + +//---------------------------------------------------------------------- +// Fall down - B : random pain, E : large amount of damage +//---------------------------------------------------------------------- +void() zombie_painb1 =[ $painb1, zombie_painb2 ] {self.inpain = 2;}; +void() zombie_painb2 =[ $painb2, zombie_painb3 ] {ai_pain(2);}; +void() zombie_painb3 =[ $painb3, zombie_painb4 ] {ai_pain(8);}; +void() zombie_painb4 =[ $painb4, zombie_painb5 ] {ai_pain(6);}; +void() zombie_painb5 =[ $painb5, zombie_painb6 ] {ai_pain(2);}; +void() zombie_painb6 =[ $painb6, zombie_painb7 ] {}; +void() zombie_painb7 =[ $painb7, zombie_painb8 ] {zombie_sound(5);}; +void() zombie_painb8 =[ $painb8, zombie_painb9 ] {self.solid = SOLID_NOT;}; +void() zombie_painb9 =[ $painb9, zombie_painb9 ] { + zombie_onground(MONAI_ZOMBIEUPB);}; + +// Start of get up sequence +void() zombie_painb10 =[ $painb10, zombie_painb11 ] {}; +void() zombie_painb11 =[ $painb11, zombie_painb12 ] {}; +void() zombie_painb12 =[ $painb12, zombie_painb13 ] {}; +void() zombie_painb13 =[ $painb13, zombie_painb14 ] {}; +void() zombie_painb14 =[ $painb14, zombie_painb15 ] {}; +void() zombie_painb15 =[ $painb15, zombie_painb16 ] {}; +void() zombie_painb16 =[ $painb16, zombie_painb17 ] {}; +void() zombie_painb17 =[ $painb17, zombie_painb18 ] {}; +void() zombie_painb18 =[ $painb18, zombie_painb19 ] {}; +void() zombie_painb19 =[ $painb19, zombie_painb20 ] {}; +void() zombie_painb20 =[ $painb20, zombie_painb21 ] {}; +void() zombie_painb21 =[ $painb21, zombie_painb22 ] {}; +void() zombie_painb22 =[ $painb22, zombie_painb23 ] {}; +void() zombie_painb23 =[ $painb23, zombie_painb24 ] {}; +void() zombie_painb24 =[ $painb24, zombie_painb25 ] {}; +void() zombie_painb25 =[ $painb25, zombie_painb26 ] {monster_footstep(FALSE); ai_painforward(1);}; +void() zombie_painb26 =[ $painb26, zombie_painb27 ] {}; +void() zombie_painb27 =[ $painb27, zombie_painb28 ] {}; +void() zombie_painb28 =[ $painb28, zombie_run1 ] { + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +//---------------------------------------------------------------------- +void() zombie_paine1 =[ $paine1, zombie_paine2 ] {self.inpain = 2;}; +void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);}; +void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);}; +void() zombie_paine4 =[ $paine4, zombie_paine5 ] {ai_pain(3);}; +void() zombie_paine5 =[ $paine5, zombie_paine6 ] {ai_pain(1);}; +void() zombie_paine6 =[ $paine6, zombie_paine7 ] {ai_pain(2);}; +void() zombie_paine7 =[ $paine7, zombie_paine8 ] {ai_pain(1);}; +void() zombie_paine8 =[ $paine8, zombie_paine9 ] {ai_pain(1);}; +void() zombie_paine9 =[ $paine9, zombie_paine10 ] {ai_pain(2);}; +void() zombie_paine10 =[ $paine10, zombie_paine11 ] {zombie_sound(5);}; +void() zombie_paine11 =[ $paine11, zombie_paine12 ] {self.solid = SOLID_NOT;}; +void() zombie_paine12 =[ $paine12, zombie_paine12 ] { + zombie_onground(MONAI_ZOMBIEUPE);}; + +// Start of get up sequence +void() zombie_paine13 =[ $paine13, zombie_paine14 ] {}; +void() zombie_paine14 =[ $paine14, zombie_paine15 ] {}; +void() zombie_paine15 =[ $paine15, zombie_paine16 ] {}; +void() zombie_paine16 =[ $paine16, zombie_paine17 ] {}; +void() zombie_paine17 =[ $paine17, zombie_paine18 ] {}; +void() zombie_paine18 =[ $paine18, zombie_paine19 ] {}; +void() zombie_paine19 =[ $paine19, zombie_paine20 ] {}; +void() zombie_paine20 =[ $paine20, zombie_paine21 ] {}; +void() zombie_paine21 =[ $paine21, zombie_paine22 ] {}; +void() zombie_paine22 =[ $paine22, zombie_paine23 ] {}; +void() zombie_paine23 =[ $paine23, zombie_paine24 ] {}; +void() zombie_paine24 =[ $paine24, zombie_paine25 ] {monster_footstep(FALSE);}; +void() zombie_paine25 =[ $paine25, zombie_paine26 ] {ai_painforward(5);}; +void() zombie_paine26 =[ $paine26, zombie_paine27 ] {ai_painforward(3);}; +void() zombie_paine27 =[ $paine27, zombie_paine28 ] {ai_painforward(1);}; +void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);}; +void() zombie_paine29 =[ $paine29, zombie_paine30 ] {}; +void() zombie_paine30 =[ $paine30, zombie_run1 ] { + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +/*====================================================================== + ZOMBIE PAIN + * All damage must come through pain function to reset health + * Be careful blocking zombie pain function with pain_finished + * zombies react in 2 ways, minor pain (a,c,d) and full knockdown (b,e) +======================================================================*/ +void(entity inflictor, entity attacker, float take) zombie_pain = +{ + self.health = self.max_health; // reset health + if (take < MONAI_ZOMBIELOW_DAM) return; // totally ignore + if (self.inpain > 0) return; // in pain animation, do nothing + + zombie_sound(4); // Moan about the pain + self.inpain = 1; // In pain, don't interrupt animation + + //---------------------------------------------------------------------- + // Damage 25-60, drop straight away to ground (SSG, Quad NG) + //---------------------------------------------------------------------- + if (take > MONAI_ZOMBIEHGH_DAM) zombie_paine1(); // 30 frames (12 = on ground) + //---------------------------------------------------------------------- + // Damage 9-25 random pain animation (random chance of knockdown painb) + //---------------------------------------------------------------------- + else { + self.lip = random(); + if (self.lip < 0.25) zombie_paina1 (); // 12 frames (bent over, short) + else if (self.lip < 0.5) zombie_painb1 (); // 28 frames (9 = on ground) + else if (self.lip < 0.75) zombie_painc1 (); // 18 frames (bent over, long) + else zombie_paind1 (); // 13 frames (slight hit) + } +}; + +/*============================================================================= + ZOMBIE WAKEUP (check if can get up) +=============================================================================*/ +void() zombie_wakeup = { + if (self.gibbed) return; // Do nothing dead + + self.use = SUB_Null; // No more using at this point + if (!self.enemy) FindTarget(); // If no enemy, look around? + + // Turn monster collision on and test if can walk forward + self.solid = SOLID_SLIDEBOX; + if (!walkmove (0, 0)) + { + self.inpain = 2; // On ground + self.nextthink = time + 0.1; // Keep checking + self.think = self.th_wakeup; // Same function + self.solid = SOLID_NOT; // No world interaction yet + // Check if something has been blocking the zombie from getting up + // This is a check for weird world/bmodel geo or monster/players + // standing on zombies while on the ground trying to get up! + self.count = self.count + 1; + if (self.count > MONAI_ZOMBGRDBLOCK) { + self.health = self.gibhealth; // Gib time + Killed(self, self); // Register death + return; + } + } + else { + self.bodyonflr = ""; // Body is chop proof! + self.inpain = 1; // Animation not finished + zombie_sound(6); // Wake up sound + self.nextthink = time + 0.1; + self.use = monster_use; // Just in case interruption + if (self.zombieflr == MONAI_ZOMBIEUPB) self.think = zombie_painb10; + else self.think = zombie_paine13; + } +}; + +//---------------------------------------------------------------------- +// Puts the zombie on the floor with a random Yaw rotation +// paintype = 0 Setup on floor with use trigger +// paintype > 0 On floor and waiting to get back up +//---------------------------------------------------------------------- +void(float frameno) zombie_onground = { + self.health = self.max_health; // reset health + self.inpain = 2; // Lying on floor, no pain + self.count = 0; // Reset get up tries + self.solid = SOLID_NOT; // No world interaction + self.bodyonflr = MON_ONFLR; // mark body for the chop + + // Does the zombie start on the ground? + if (frameno == MONAI_ZOMBIEFLR) { + // Do nothing else while on the floor + self.nextthink = self.pausetime; + self.think = SUB_Null; + + // Pick random starting pose + if (random() < 0.5) { + self.zombieflr = MONAI_ZOMBIEUPB; + self.frame = $painb9; + } + else { + self.zombieflr = MONAI_ZOMBIEUPE; + self.frame = $paine12; + } + // If no angle set, Random fall direction + if (self.angles_y < 1) self.angles_y = rint(random()*359); + self.use = self.th_wakeup; + self.fixangle = TRUE; + } + else { + self.zombieflr = frameno; // Wakeup pose for later + // Keep zombies on the ground and check again later + self.nextthink = self.nextthink + MONAI_ZOMBGRDTIMER; + self.think = self.th_wakeup; + } +}; + +/*============================================================================ + All sounds used + 1 = sticking around, crucified + 2 = strutting the stuff (walking) + 3 = running (in slow motion) + 4 = all pain routines (zombie_paina1, _painb1, _painc1, _paind1, _paine1) + 5 = its a knockout! + 6 = get up and moan about it + 7 = fire zombie gib +============================================================================*/ +void(float type) zombie_sound = +{ + // check for gibbed or idle sound block + if (self.health < 1) return; + if (self.spawnflags & MON_SPAWN_NOIDLE && type < 3) return; + + // Random sound check + self.lip = random(); + if (type == 1) { + if (self.lip < 0.1) + sound (self, CHAN_VOICE, "zombie/idle_w2.wav", 1, ATTN_STATIC); + } + else if (type == 2 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + } + else if (type == 3 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + if (self.lip > 0.8) sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 4) { + if (self.lip < 0.25) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } + else if (type == 5) { + sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + } + else if (type == 6) { + if (self.lip < 0.5) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 7) { + sound (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); + } +}; + +//============================================================================ +void() zombie_die = +{ + self.health = self.gibhealth; // Force gib + monster_death_precheck(); +}; + +/*====================================================================== + QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) Crucified ambush FLOOR +If crucified, stick the bounding box 12 pixels back into a wall to look right. +======================================================================*/ +void() monster_zombie = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_zombie.mdl"; + self.headmdl = "progs/h_zombie.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + //precache_model (MODEL_PROJ_FLESH); (world.qc) + + // Stupid ID getting the crucified and ambush back to front on zombies + // Lets fix the problem and reverse the flags to match everything else + if (self.spawnflags & MON_ZOMCRUCIFIED || self.spawnflags & MON_ZOMBAMBUSH) { + self.health = 0; // Temporarily use this float variable + if (self.spawnflags & MON_ZOMCRUCIFIED) self.health = self.health + MON_CRUCIFIED; + if (self.spawnflags & MON_ZOMBAMBUSH) self.health = self.health + MON_AMBUSH; + + // Removed the old bits and then add the new one's + self.spawnflags = self.spawnflags - (self.spawnflags & MON_ZOMIDHACK); + self.spawnflags = self.spawnflags + self.health; + } + + precache_sound ("zombie/z_idle.wav"); // Idle A + precache_sound ("zombie/z_idle1.wav"); // Idle B + precache_sound ("zombie/idle_w2.wav"); // Crucified + + self.pain_sound = "zombie/z_pain.wav"; + self.pain_sound2 = "zombie/z_pain1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("zombie/z_shot1.wav"); // Swipe sound + precache_sound ("zombie/z_fall.wav"); // Impact - floor + precache_sound ("zombie/z_miss.wav"); // Impact - miss + precache_sound ("zombie/z_hit.wav"); // Impact - hit + precache_sound ("zombie/z_gib.wav"); // Death sound + + self.sight_sound = "zombie/z_idle.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.classtype = CT_MONZOMBIE; + self.classgroup = CG_ZOMBIE; // One big happy zombie family! + self.classmove = MON_MOVEWALK; + if (!self.exactskin) self.randomskin = 2; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + // Setup crucified zombies + if (self.spawnflags & MON_CRUCIFIED) { + setmodel(self, self.mdl); + setsize (self, self.bbmins, self.bbmaxs); + zombie_cruc1 (); + } + else { + // Setup zombie ready for placement + self.health = 60; // Basic health (cannot override) + self.gibhealth = -60; // Gib value, not used + self.gibbed = FALSE; // In one piece + self.pain_flinch = MONAI_ZOMBIEHGH_DAM; + self.steptype = FS_TYPESLOW; // Small leg + self.altsteptype = FS_TYPEDRAG; // Clubfoot + self.pain_timeout = -5; // Always go into pain (health reset) + if (!self.movespeed) self.movespeed = 1;// Adjustable speed via skill level + self.inpain = 0; // Zombie starts with no pain lock + self.count = 0; // Reset get up timer + + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; + self.th_wakeup = zombie_wakeup; // Get off floor + + monster_start(); + } +}; + +/*====================================================================== + QUAKED monster_mummy (1 0 0) (-16 -16 -24) (16 16 32) ambush x FLOOR +Poisonous Zombie that explodes poisonous gibs on death +======================================================================*/ +void() monster_zombiep = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_zombie.mdl"; + self.headmdl = "progs/h_zombie.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + precache_model (MODEL_PROJ_FLESHP); + + precache_sound ("zombie/z_idle.wav"); // Idle A + precache_sound ("zombie/z_idle1.wav"); // Idle B + precache_sound ("zombie/idle_w2.wav"); // Crucified + + self.pain_sound = "zombie/z_pain.wav"; + self.pain_sound2 = "zombie/z_pain1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("zombie/z_shot1.wav"); // Swipe sound + precache_sound ("zombie/z_fall.wav"); // Impact - floor + precache_sound ("zombie/z_miss.wav"); // Impact - miss + precache_sound ("zombie/z_hit.wav"); // Impact - hit + precache_sound ("zombie/z_gib.wav"); // Death sound + + self.sight_sound = "zombie/z_idle.wav"; + precache_sound (self.sight_sound); + + precache_poisongibs(); // precache gibs + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.health = 60; // Basic health (cannot override) + self.gibhealth = -60; // Gib value, not used + self.gibbed = FALSE; // In one piece + self.pain_flinch = MONAI_ZOMBIEHGH_DAM; + self.steptype = FS_TYPESLOW; // Small leg + self.altsteptype = FS_TYPEDRAG; // Clubfoot + self.pain_timeout = -5; // Always go into pain (health reset) + self.inpain = 0; // Zombie starts with no pain lock + self.count = 0; // Reset get up timer + self.exactskin = rint(2 + random()); // Mouldly bandages + self.gibtype = GIBTYPE_POISON; // Poison gibs! + self.no_liquiddmg = TRUE; // Immune to slime/lava + if (self.poisonous < 0) self.poisonous = FALSE; // Poison debuff + else self.poisonous = TRUE; + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " joins the Zombies\n"; + + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + self.th_missile = zombie_missile; // Throwing flesh + self.th_wakeup = zombie_wakeup; // Get off floor + + self.classtype = CT_MONMUMMY; + self.classgroup = CG_ZOMBIE; // One big happy zombie family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; + diff --git a/QC_other/QC_keep/mon_zombiek.qc b/QC_other/QC_keep/mon_zombiek.qc new file mode 100644 index 00000000..49184a0f --- /dev/null +++ b/QC_other/QC_keep/mon_zombiek.qc @@ -0,0 +1,814 @@ +/*====================================================================== +Zombie KNIGHT (undead version of original knight) +======================================================================*/ +$cd id1/models/zombiek +$origin 0 0 24 +$base base +$skin skin + +// (001 - 015) Default stand - breathing +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 +$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15 + +// (016 - 029) Default walk dragging left foot +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 +$frame walk9 walk10 walk11 walk12 walk13 walk14 + +// (030 - 040) Default run, fast for a zombie +$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 + +// (041 - 052) Still moving forward +$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 +$frame paina9 paina10 paina11 paina12 + +// (053 - 077) Stagger backwards, long animation +$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 +$frame painb9 painb10 painb11 painb12 painb13 painb14 painb15 painb16 +$frame painb17 painb18 painb19 painb20 painb21 painb22 painb23 painb24 painb25 + +// (078 - 098) Fall down to knees and get back up +$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 +$frame painc9 painc10 painc11 painc12 painc13 painc14 painc15 painc16 +$frame painc17 painc18 painc19 painc20 painc21 + +// (099 - 121) Fall down FORWARD (paind12 = on floor) +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 +$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 +$frame paind17 paind18 paind19 paind20 paind21 paind22 paind23 + +// (122 - 152) Fall down BACKWARD (paine12 = on floor) +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 +$frame paine9 paine10 paine11 paine12 paine13 paine14 paine15 paine16 +$frame paine17 paine18 paine19 paine20 paine21 paine22 paine23 paine24 +$frame paine25 paine26 paine27 paine28 paine29 paine30 paine31 + +// (153 - 171) Melee Attack 1 - Smash (chop overhead to ground) +$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 +$frame atta9 atta10 atta11 atta12 atta13 atta14 atta15 atta16 atta17 atta18 atta19 + +// (172 - 188) Melee Attack 2 - Stationary over arm swing +$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 +$frame attb9 attb10 attb11 attb12 attb13 attb14 attb15 attb16 attb17 + +// (189 - 203) Melee Attack 3 - Stationary sideways swing +$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 +$frame attc9 attc10 attc11 attc12 attc13 attc14 attc15 + +// (204 - 223) idle 2 - scratch brains +$frame idleb1 idleb2 idleb3 idleb4 idleb5 idleb6 idleb7 idleb8 +$frame idleb9 idleb10 idleb11 idleb12 idleb13 idleb14 idleb15 idleb16 +$frame idleb17 idleb18 idleb19 idleb20 + +// (224 - 238) idle 3 - swing head LEFT +$frame idlec1 idlec2 idlec3 idlec4 idlec5 idlec6 idlec7 idlec8 +$frame idlec9 idlec10 idlec11 idlec12 idlec13 idlec14 idlec15 + +// (239 - 253) idle 4 - swing head RIGHT +$frame idled1 idled2 idled3 idled4 idled5 idled6 idled7 idled8 +$frame idled9 idled10 idled11 idled12 idled13 idled14 idled15 + +void(float type) zombiek_sound; +void() zombiek_knockdown; + +//============================================================================= +void() zombiek_standB1 =[ $idleb1, zombiek_standB2 ] {ai_stand();}; +void() zombiek_standB2 =[ $idleb2, zombiek_standB3 ] {ai_stand();}; +void() zombiek_standB3 =[ $idleb3, zombiek_standB4 ] {ai_stand();}; +void() zombiek_standB4 =[ $idleb4, zombiek_standB5 ] {ai_stand();}; +void() zombiek_standB5 =[ $idleb5, zombiek_standB6 ] {ai_stand();}; +void() zombiek_standB6 =[ $idleb6, zombiek_standB7 ] {ai_stand();}; +void() zombiek_standB7 =[ $idleb7, zombiek_standB8 ] {ai_stand();}; +void() zombiek_standB8 =[ $idleb8, zombiek_standB9 ] {ai_stand();}; +void() zombiek_standB9 =[ $idleb9, zombiek_standB10 ] {ai_stand();}; +void() zombiek_standB10 =[ $idleb10, zombiek_standB11 ] {ai_stand();}; +void() zombiek_standB11 =[ $idleb11, zombiek_standB12 ] {ai_stand();}; +void() zombiek_standB12 =[ $idleb12, zombiek_standB13 ] {ai_stand();}; +void() zombiek_standB13 =[ $idleb13, zombiek_standB14 ] {ai_stand();}; +void() zombiek_standB14 =[ $idleb14, zombiek_standB15 ] {ai_stand();}; +void() zombiek_standB15 =[ $idleb15, zombiek_standB16 ] {ai_stand();}; +void() zombiek_standB16 =[ $idleb16, zombiek_standB17 ] {ai_stand();}; +void() zombiek_standB17 =[ $idleb17, zombiek_standB18 ] {ai_stand();}; +void() zombiek_standB18 =[ $idleb18, zombiek_standB19 ] {ai_stand();}; +void() zombiek_standB19 =[ $idleb19, zombiek_standB20 ] {ai_stand();}; +void() zombiek_standB20 =[ $idleb20, zombiek_stand1 ] {ai_stand();}; + +//============================================================================= +void() zombiek_standC1 =[ $idlec1, zombiek_standC2 ] {ai_stand();}; +void() zombiek_standC2 =[ $idlec2, zombiek_standC3 ] {ai_stand();}; +void() zombiek_standC3 =[ $idlec3, zombiek_standC4 ] {ai_stand();}; +void() zombiek_standC4 =[ $idlec4, zombiek_standC5 ] {ai_stand();}; +void() zombiek_standC5 =[ $idlec5, zombiek_standC6 ] {ai_stand();}; +void() zombiek_standC6 =[ $idlec6, zombiek_standC7 ] {ai_stand();}; +void() zombiek_standC7 =[ $idlec7, zombiek_standC8 ] {ai_stand();}; +void() zombiek_standC8 =[ $idlec8, zombiek_standC9 ] {ai_stand();}; +void() zombiek_standC9 =[ $idlec9, zombiek_standC10 ] {ai_stand();}; +void() zombiek_standC10 =[ $idlec10, zombiek_standC11 ] {ai_stand();}; +void() zombiek_standC11 =[ $idlec11, zombiek_standC12 ] {ai_stand();}; +void() zombiek_standC12 =[ $idlec12, zombiek_standC13 ] {ai_stand();}; +void() zombiek_standC13 =[ $idlec13, zombiek_standC14 ] {ai_stand();}; +void() zombiek_standC14 =[ $idlec14, zombiek_standC15 ] {ai_stand();}; +void() zombiek_standC15 =[ $idlec15, zombiek_stand1 ] {ai_stand();}; + +//============================================================================= +void() zombiek_standD1 =[ $idled1, zombiek_standD2 ] {ai_stand();}; +void() zombiek_standD2 =[ $idled2, zombiek_standD3 ] {ai_stand();}; +void() zombiek_standD3 =[ $idled3, zombiek_standD4 ] {ai_stand();}; +void() zombiek_standD4 =[ $idled4, zombiek_standD5 ] {ai_stand();}; +void() zombiek_standD5 =[ $idled5, zombiek_standD6 ] {ai_stand();}; +void() zombiek_standD6 =[ $idled6, zombiek_standD7 ] {ai_stand();}; +void() zombiek_standD7 =[ $idled7, zombiek_standD8 ] {ai_stand();}; +void() zombiek_standD8 =[ $idled8, zombiek_standD9 ] {ai_stand();}; +void() zombiek_standD9 =[ $idled9, zombiek_standD10 ] {ai_stand();}; +void() zombiek_standD10 =[ $idled10, zombiek_standD11 ] {ai_stand();}; +void() zombiek_standD11 =[ $idled11, zombiek_standD12 ] {ai_stand();}; +void() zombiek_standD12 =[ $idled12, zombiek_standD13 ] {ai_stand();}; +void() zombiek_standD13 =[ $idled13, zombiek_standD14 ] {ai_stand();}; +void() zombiek_standD14 =[ $idled14, zombiek_standD15 ] {ai_stand();}; +void() zombiek_standD15 =[ $idled15, zombiek_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() zombiek_standE1 =[ $idlec1, zombiek_standE2 ] {ai_stand();}; +void() zombiek_standE2 =[ $idlec2, zombiek_standE3 ] {ai_stand();}; +void() zombiek_standE3 =[ $idlec3, zombiek_standE4 ] {ai_stand();}; +void() zombiek_standE4 =[ $idlec4, zombiek_standE5 ] {ai_stand();}; +void() zombiek_standE5 =[ $idlec5, zombiek_standE6 ] {ai_stand();}; +void() zombiek_standE6 =[ $idlec6, zombiek_standE7 ] {ai_stand();}; +void() zombiek_standE7 =[ $idlec7, zombiek_standE8 ] {ai_stand();}; +void() zombiek_standE8 =[ $idlec8, zombiek_standE9 ] {ai_stand();}; +void() zombiek_standE9 =[ $idlec9, zombiek_standE10 ] {ai_stand();}; +void() zombiek_standE10 =[ $idlec10, zombiek_standE11 ] {ai_stand();}; +void() zombiek_standE11 =[ $idlec11, zombiek_standE12 ] {ai_stand();}; +void() zombiek_standE12 =[ $idlec12, zombiek_standE13 ] {ai_stand();}; +void() zombiek_standE13 =[ $idlec13, zombiek_standE14 ] {ai_stand();}; +void() zombiek_standE14 =[ $idlec14, zombiek_standE15 ] {ai_stand();}; +void() zombiek_standE15 =[ $idlec15, zombiek_standE16 ] {ai_stand();}; +void() zombiek_standE16 =[ $idled1, zombiek_standE17 ] {ai_stand();}; +void() zombiek_standE17 =[ $idled2, zombiek_standE18 ] {ai_stand();}; +void() zombiek_standE18 =[ $idled3, zombiek_standE19 ] {ai_stand();}; +void() zombiek_standE19 =[ $idled4, zombiek_standE20 ] {ai_stand();}; +void() zombiek_standE20 =[ $idled5, zombiek_standE21 ] {ai_stand();}; +void() zombiek_standE21 =[ $idled6, zombiek_standE22 ] {ai_stand();}; +void() zombiek_standE22 =[ $idled7, zombiek_standE23 ] {ai_stand();}; +void() zombiek_standE23 =[ $idled8, zombiek_standE24 ] {ai_stand();}; +void() zombiek_standE24 =[ $idled9, zombiek_standE25 ] {ai_stand();}; +void() zombiek_standE25 =[ $idled10, zombiek_standE26 ] {ai_stand();}; +void() zombiek_standE26 =[ $idled11, zombiek_standE27 ] {ai_stand();}; +void() zombiek_standE27 =[ $idled12, zombiek_standE28 ] {ai_stand();}; +void() zombiek_standE28 =[ $idled13, zombiek_standE29 ] {ai_stand();}; +void() zombiek_standE29 =[ $idled14, zombiek_standE30 ] {ai_stand();}; +void() zombiek_standE30 =[ $idled15, zombiek_stand1 ] {ai_stand();}; + +//---------------------------------------------------------------------- +void() zombiek_stand1 =[ $stand1, zombiek_stand2 ] {ai_stand();}; +void() zombiek_stand2 =[ $stand2, zombiek_stand3 ] {ai_stand();}; +void() zombiek_stand3 =[ $stand3, zombiek_stand4 ] {ai_stand();}; +void() zombiek_stand4 =[ $stand4, zombiek_stand5 ] {ai_stand();}; +void() zombiek_stand5 =[ $stand5, zombiek_stand6 ] {ai_stand();}; +void() zombiek_stand6 =[ $stand6, zombiek_stand7 ] {ai_stand();}; +void() zombiek_stand7 =[ $stand7, zombiek_stand8 ] {ai_stand();}; +void() zombiek_stand8 =[ $stand8, zombiek_stand9 ] {ai_stand();}; +void() zombiek_stand9 =[ $stand9, zombiek_stand10 ] {ai_stand();}; +void() zombiek_stand10 =[ $stand10, zombiek_stand11 ] {ai_stand();}; +void() zombiek_stand11 =[ $stand11, zombiek_stand12 ] {ai_stand();}; +void() zombiek_stand12 =[ $stand12, zombiek_stand13 ] {ai_stand();}; +void() zombiek_stand13 =[ $stand13, zombiek_stand14 ] {ai_stand();}; +void() zombiek_stand14 =[ $stand14, zombiek_stand15 ] {ai_stand();}; +void() zombiek_stand15 =[ $stand15, zombiek_stand1 ] { + self.idlebusy = FALSE; + self.solid = SOLID_SLIDEBOX; + if (random() < MON_IDLE_ANIMATION) { + self.idlebusy = TRUE; + // Make sure the idle animations don't repeat in a row + self.lefty = self.lip; + while (self.lefty == self.lip) { self.lefty = rint(random()*4);} + self.lip = self.lefty; + if (self.lip < 1) self.think = zombiek_standB1; // Pick brains! + else if (self.lip < 2) self.think = zombiek_standE1; // Look BOTH + else if (self.lip < 3) self.think = zombiek_standC1; // Look LEFT + else self.think = zombiek_standD1; // Look RIGHT + } + ai_stand(); +}; + +//============================================================================ +void() zombiek_walk1 =[ $walk1, zombiek_walk2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_walk(1);}; +void() zombiek_walk2 =[ $walk2, zombiek_walk3 ] {ai_walk(1);}; +void() zombiek_walk3 =[ $walk3, zombiek_walk4 ] {ai_walk(4);}; +void() zombiek_walk4 =[ $walk4, zombiek_walk5 ] {ai_walk(4);}; +void() zombiek_walk5 =[ $walk5, zombiek_walk6 ] {ai_walk(2);}; +void() zombiek_walk6 =[ $walk6, zombiek_walk7 ] {ai_walk(1);}; +void() zombiek_walk7 =[ $walk7, zombiek_walk8 ] {ai_walk(1);}; +void() zombiek_walk8 =[ $walk8, zombiek_walk9 ] {ai_walk(1);monster_footstep(FALSE);}; +void() zombiek_walk9 =[ $walk9, zombiek_walk10] {ai_walk(1);}; +void() zombiek_walk10 =[ $walk10, zombiek_walk11] {ai_walk(1);}; +void() zombiek_walk11 =[ $walk11, zombiek_walk12] {ai_walk(1);}; +void() zombiek_walk12 =[ $walk12, zombiek_walk13] {ai_walk(1);monster_footstep(TRUE);}; // Scrapping Clubfoot +void() zombiek_walk13 =[ $walk13, zombiek_walk14] {ai_walk(1);}; +void() zombiek_walk14 =[ $walk14, zombiek_walk1 ] {zombiek_sound(2);ai_walk(1);}; + +//============================================================================ +void() zombiek_run1 =[ $run1, zombiek_run2 ] { + self.inpain = 0; self.solid = SOLID_SLIDEBOX; ai_run(12);}; +void() zombiek_run2 =[ $run2, zombiek_run3 ] {ai_run(12);}; +void() zombiek_run3 =[ $run3, zombiek_run4 ] {ai_run(13);}; +void() zombiek_run4 =[ $run4, zombiek_run5 ] {ai_run(12);}; +void() zombiek_run5 =[ $run5, zombiek_run6 ] {ai_run(12);monster_footstep(FALSE);}; +void() zombiek_run6 =[ $run6, zombiek_run7 ] {ai_run(12);}; +void() zombiek_run7 =[ $run7, zombiek_run8 ] {ai_run(12);}; +void() zombiek_run8 =[ $run8, zombiek_run9 ] {ai_run(11);}; +void() zombiek_run9 =[ $run9, zombiek_run10 ] {ai_run(14);}; +void() zombiek_run10 =[ $run10, zombiek_run11 ] {ai_run(13);}; +void() zombiek_run11 =[ $run11, zombiek_run1 ] {ai_run(11); + self.steptype = FS_TYPEHEAVY; // Heavy clubfoot + monster_footstep(FALSE); + self.steptype = FS_TYPESLOW; // Normal zombie foot +}; + +//=========================================================================== +// Melee Attack 2 - Stationary over arm swing (17->12 frames) +// Removed frames 1,3,4,5,7 +void() zombiek_attb1 =[ $attb2, zombiek_attb6 ] {ai_face();}; +void() zombiek_attb6 =[ $attb6, zombiek_attb8 ] {ai_face();}; +void() zombiek_attb8 =[ $attb8, zombiek_attb9 ] {ai_face();zombiek_sound(7);}; +void() zombiek_attb9 =[ $attb9, zombiek_attb10] {ai_face();}; +void() zombiek_attb10=[ $attb10, zombiek_attb11] {ai_face();ai_melee();}; +void() zombiek_attb11=[ $attb11, zombiek_attb12] {ai_melee();}; +void() zombiek_attb12=[ $attb12, zombiek_attb13] {ai_melee();}; +void() zombiek_attb13=[ $attb13, zombiek_attb14] {}; +void() zombiek_attb14=[ $attb14, zombiek_attb15] {}; +void() zombiek_attb15=[ $attb15, zombiek_attb16] {}; +void() zombiek_attb16=[ $attb16, zombiek_attb17] {}; +void() zombiek_attb17=[ $attb17, zombiek_run1 ] {}; + +//---------------------------------------------------------------------- +// Melee Attack 3 - Stationary sideways swing (15->12 frames) +// Removed frames 1,3,15 +void() zombiek_attc1 =[ $attc2, zombiek_attc4 ] {ai_face();}; +void() zombiek_attc4 =[ $attc4, zombiek_attc5 ] {ai_face();}; +void() zombiek_attc5 =[ $attc5, zombiek_attc6 ] {zombiek_sound(7); ai_face();}; +void() zombiek_attc6 =[ $attc6, zombiek_attc7 ] {ai_face();}; +void() zombiek_attc7 =[ $attc7, zombiek_attc8 ] {ai_face();ai_melee();}; +void() zombiek_attc8 =[ $attc8, zombiek_attc9 ] {ai_melee();}; +void() zombiek_attc9 =[ $attc9, zombiek_attc10] {ai_melee();}; +void() zombiek_attc10=[ $attc10, zombiek_attc11] {}; +void() zombiek_attc11=[ $attc11, zombiek_attc12] {}; +void() zombiek_attc12=[ $attc12, zombiek_attc13] {}; +void() zombiek_attc13=[ $attc13, zombiek_attc14] {}; +void() zombiek_attc14=[ $attc14, zombiek_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombiek_melee = +{ + ai_face (); // Turn towards enemy target + walkmove (self.ideal_yaw, 20); + + // Randomly select melee attacks + if (random() < 0.5) zombiek_attb1(); // Stationary over arm swing + else zombiek_attc1(); // Stationary sideways swing +}; + +//============================================================================ +// Jump + melee attack +// Melee Attack 1 - Smash, chop overhead to ground (19->10/11 frames) +//============================================================================ +void() zombiek_JumpTouch = +{ + local float ldmg; + + if (self.health < 1) return; + ai_jumpbreakable(20); // Damage any breakables + self.touch = SUB_Null; // No more touching + self.think = self.th_jumpexit; // Exit frame + self.jumptouch = other; // Keep track of touch target + + if ( CanDamage(other, self) ) { + if ( vlen(self.velocity) > 300 ) { + ldmg = 10 + 10*random(); + T_Damage (other, self, self, ldmg, DAMARMOR); + spawn_touchblood (self, self.enemy, ldmg*3); + } + } + + // Is the zombie knight floating in the air? + if (!checkbottom(self)) { + // Is the zombie knight standing on something? + if (self.flags & FL_ONGROUND) { + // Do an extra jump if got the count + if (self.count < 2) self.think = self.th_jump; + } + } + + // Next timer + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() zombiek_jump1 =[ $atta1, zombiek_jump2 ] {ai_charge(12); + self.jump_flag = time + MONAI_JUMPZOMBTIME; + zombiek_sound(3); // Moan about jumping forward +}; +void() zombiek_jump2 =[ $atta2, zombiek_jump3 ] {ai_charge(16);}; +void() zombiek_jump3 =[ $atta3, zombiek_jump4 ] { + ai_face(); + self.jump_flag = time + MONAI_JUMPZOMBTIME; + self.touch = zombiek_JumpTouch; + makevectors (self.angles); + self.velocity = v_forward * (150 + random() * 50) + '0 0 200'; + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.oldorigin = self.origin; +}; + +// Flying through the air waiting to touch something! +void() zombiek_jump4 =[ $atta4, zombiek_jump5 ] {ai_face();}; +void() zombiek_jump5 =[ $atta5, zombiek_jump6 ] {ai_face();}; +void() zombiek_jump6 =[ $atta6, zombiek_jump6 ] {ai_face();}; +void() zombiek_jump7 =[ $atta7, zombiek_jump7 ] {ai_face();}; +void() zombiek_jump8 =[ $atta8, zombiek_jump9 ] {ai_face(); + // Double check monster is still falling? + if (CheckZeroVector(self.velocity) || self.oldorigin == self.origin) { + if (!checkbottom(self)) { + self.ideal_yaw = random() * 360; //random jump angle + self.think = zombiek_jump3; + } + } + self.oldorigin = self.origin; +}; + +//---------------------------------------------------------------------- +void() zombiek_jump15; // Chance of quick animation exit +void() zombiek_jump9 =[ $atta9, zombiek_jump10] {ai_melee();}; +void() zombiek_jump10=[ $atta10, zombiek_jump11] {ai_melee();}; +void() zombiek_jump11=[ $atta11, zombiek_jump12] {}; +void() zombiek_jump12=[ $atta12, zombiek_jump13] { + if (random() < 0.5) self.think = zombiek_jump15;}; // quick recovery +void() zombiek_jump13=[ $atta13, zombiek_jump14] {}; +void() zombiek_jump14=[ $atta14, zombiek_jump16] {}; +void() zombiek_jump15=[ $atta15, zombiek_jump16] {}; +void() zombiek_jump16=[ $atta16, zombiek_jump18] {}; +void() zombiek_jump18=[ $atta18, zombiek_run1 ] {ai_resetangles();}; + +/*====================================================================== + PAIN +========================================================================*/ +void() zombiek_paina1 =[ $paina1, zombiek_paina2 ] {ai_painforward(8);}; +void() zombiek_paina2 =[ $paina2, zombiek_paina3 ] {ai_painforward(3);}; +void() zombiek_paina3 =[ $paina3, zombiek_paina4 ] {ai_painforward(3);}; +void() zombiek_paina4 =[ $paina4, zombiek_paina5 ] {ai_painforward(3);monster_footstep(FALSE);}; +void() zombiek_paina5 =[ $paina5, zombiek_paina6 ] {ai_painforward(3);}; +void() zombiek_paina6 =[ $paina6, zombiek_paina7 ] {ai_painforward(3);}; +void() zombiek_paina7 =[ $paina7, zombiek_paina8 ] {ai_painforward(3);}; +void() zombiek_paina8 =[ $paina8, zombiek_paina9 ] {ai_painforward(3);}; +void() zombiek_paina9 =[ $paina9, zombiek_paina10 ] {ai_painforward(2);monster_footstep(FALSE);}; +void() zombiek_paina10 =[ $paina10, zombiek_paina11 ] {ai_painforward(1);}; +void() zombiek_paina11 =[ $paina11, zombiek_paina12 ] {ai_painforward(2);}; +void() zombiek_paina12 =[ $paina12, zombiek_run1 ] {ai_painforward(1);self.inpain = 0;}; + +//---------------------------------------------------------------------- +void() zombiek_painb1 =[ $painb1, zombiek_painb2 ] {ai_painforward(8);}; +void() zombiek_painb2 =[ $painb2, zombiek_painb3 ] {ai_pain(1);}; +void() zombiek_painb3 =[ $painb3, zombiek_painb4 ] {ai_pain(1);}; +void() zombiek_painb4 =[ $painb4, zombiek_painb5 ] {ai_pain(1);}; +void() zombiek_painb5 =[ $painb5, zombiek_painb6 ] {ai_pain(1);}; +void() zombiek_painb6 =[ $painb6, zombiek_painb7 ] {ai_pain(2);}; +void() zombiek_painb7 =[ $painb7, zombiek_painb8 ] {ai_pain(2);}; +void() zombiek_painb8 =[ $painb8, zombiek_painb9 ] {ai_pain(4);}; +void() zombiek_painb9 =[ $painb9, zombiek_painb10 ] {ai_pain(4);}; +void() zombiek_painb10 =[ $painb10, zombiek_painb11 ] {ai_pain(4);}; +void() zombiek_painb11 =[ $painb11, zombiek_painb12 ] {ai_pain(2);monster_footstep(FALSE);}; +void() zombiek_painb12 =[ $painb12, zombiek_painb13 ] {ai_pain(2);}; +void() zombiek_painb13 =[ $painb13, zombiek_painb14 ] {ai_pain(3);}; +void() zombiek_painb14 =[ $painb14, zombiek_painb15 ] {}; +void() zombiek_painb15 =[ $painb15, zombiek_painb16 ] {}; +void() zombiek_painb16 =[ $painb16, zombiek_painb17 ] {}; +void() zombiek_painb17 =[ $painb17, zombiek_painb18 ] {}; +void() zombiek_painb18 =[ $painb18, zombiek_painb19 ] {ai_painforward(3);}; +void() zombiek_painb19 =[ $painb19, zombiek_painb20 ] {ai_painforward(3);}; +void() zombiek_painb20 =[ $painb20, zombiek_painb21 ] {ai_painforward(3);}; +void() zombiek_painb21 =[ $painb21, zombiek_painb22 ] {ai_painforward(3);}; +void() zombiek_painb22 =[ $painb22, zombiek_painb23 ] {ai_painforward(3);}; +void() zombiek_painb23 =[ $painb23, zombiek_painb24 ] {ai_painforward(3);}; +void() zombiek_painb24 =[ $painb24, zombiek_painb25 ] {ai_painforward(3);}; +void() zombiek_painb25 =[ $painb25, zombiek_run1 ] {ai_painforward(3);}; + +//---------------------------------------------------------------------- +void() zombiek_painc1 =[ $painc1, zombiek_painc2 ] {ai_painforward(8);}; +void() zombiek_painc2 =[ $painc2, zombiek_painc3 ] {ai_painforward(6);}; +void() zombiek_painc3 =[ $painc3, zombiek_painc4 ] {ai_painforward(5);}; +void() zombiek_painc4 =[ $painc4, zombiek_painc5 ] {ai_painforward(7);zombiek_sound(5);}; +void() zombiek_painc5 =[ $painc5, zombiek_painc6 ] {ai_painforward(6);}; +void() zombiek_painc6 =[ $painc6, zombiek_painc7 ] {ai_painforward(3);}; +void() zombiek_painc7 =[ $painc7, zombiek_painc8 ] {ai_painforward(3);}; +void() zombiek_painc8 =[ $painc8, zombiek_painc9 ] {}; +void() zombiek_painc9 =[ $painc9, zombiek_painc10 ] {}; + +// Re-entry point for painD wakeup animation +void() zombiek_painc10 =[ $painc10, zombiek_painc11 ] {}; +void() zombiek_painc11 =[ $painc11, zombiek_painc12 ] {}; +void() zombiek_painc12 =[ $painc12, zombiek_painc13 ] {}; +void() zombiek_painc13 =[ $painc13, zombiek_painc14 ] {}; +void() zombiek_painc14 =[ $painc14, zombiek_painc15 ] {}; +void() zombiek_painc15 =[ $painc15, zombiek_painc16 ] {}; +void() zombiek_painc16 =[ $painc16, zombiek_painc17 ] {}; +void() zombiek_painc17 =[ $painc17, zombiek_painc18 ] {}; +void() zombiek_painc18 =[ $painc18, zombiek_painc19 ] {}; +void() zombiek_painc19 =[ $painc19, zombiek_painc20 ] {monster_footstep(FALSE);}; +void() zombiek_painc20 =[ $painc20, zombiek_painc21 ] {}; +void() zombiek_painc21 =[ $painc21, zombiek_run1 ] {}; + +//---------------------------------------------------------------------- +void() zombiek_paind1 =[ $paind1, zombiek_paind2 ] {self.inpain = 2; ai_painforward(8);}; +void() zombiek_paind2 =[ $paind2, zombiek_paind3 ] {ai_painforward(4);}; +void() zombiek_paind3 =[ $paind3, zombiek_paind4 ] {ai_painforward(4);}; +void() zombiek_paind4 =[ $paind4, zombiek_paind5 ] {ai_painforward(4);}; +void() zombiek_paind5 =[ $paind5, zombiek_paind6 ] {ai_painforward(3);}; +void() zombiek_paind6 =[ $paind6, zombiek_paind7 ] {ai_painforward(2);}; +void() zombiek_paind7 =[ $paind7, zombiek_paind8 ] {ai_painforward(2);}; +void() zombiek_paind8 =[ $paind8, zombiek_paind9 ] {}; +void() zombiek_paind9 =[ $paind9, zombiek_paind10 ] {}; +void() zombiek_paind10 =[ $paind10, zombiek_paind11 ] {zombiek_sound(5);}; +void() zombiek_paind11 =[ $paind11, zombiek_paind12 ] {self.solid = SOLID_NOT;}; +void() zombiek_paind12 =[ $paind12, zombiek_paind12 ] {zombiek_onground(MONAI_ZOMBIEUPD);}; + +// Start of get up sequence +void() zombiek_paind13 =[ $paind13, zombiek_paind14 ] {}; +void() zombiek_paind14 =[ $paind14, zombiek_paind15 ] {}; +void() zombiek_paind15 =[ $paind15, zombiek_paind16 ] {}; +void() zombiek_paind16 =[ $paind16, zombiek_paind17 ] {}; +void() zombiek_paind17 =[ $paind17, zombiek_paind18 ] { + monster_footstep(TRUE);ai_pain(1);}; // Scrapping feet sound while standing up +void() zombiek_paind18 =[ $paind18, zombiek_paind19 ] {ai_pain(1);}; +void() zombiek_paind19 =[ $paind19, zombiek_paind20 ] {ai_pain(1);}; +void() zombiek_paind20 =[ $paind20, zombiek_paind21 ] {ai_pain(1);}; +void() zombiek_paind21 =[ $paind21, zombiek_paind22 ] {ai_pain(1);}; +void() zombiek_paind22 =[ $paind22, zombiek_paind23 ] {ai_pain(2);}; +void() zombiek_paind23 =[ $paind23, zombiek_painw10 ] {ai_pain(2);}; +// Originally re-entry to C, need onfloor check +void() zombiek_painw10 =[ $painc10, zombiek_painw11 ] {}; +void() zombiek_painw11 =[ $painc11, zombiek_painw12 ] {}; +void() zombiek_painw12 =[ $painc12, zombiek_painw13 ] {}; +void() zombiek_painw13 =[ $painc13, zombiek_painw14 ] {}; +void() zombiek_painw14 =[ $painc14, zombiek_painw15 ] {}; +void() zombiek_painw15 =[ $painc15, zombiek_painw16 ] {}; +void() zombiek_painw16 =[ $painc16, zombiek_painw17 ] {}; +void() zombiek_painw17 =[ $painc17, zombiek_painw18 ] {}; +void() zombiek_painw18 =[ $painc18, zombiek_painw19 ] {}; +void() zombiek_painw19 =[ $painc19, zombiek_painw20 ] {monster_footstep(FALSE);}; +void() zombiek_painw20 =[ $painc20, zombiek_painw21 ] {}; +void() zombiek_painw21 =[ $painc21, zombiek_run1 ] { + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +//---------------------------------------------------------------------- +void() zombiek_paine1 =[ $paine1, zombiek_paine2 ] {self.inpain = 2; ai_pain(8);}; +void() zombiek_paine2 =[ $paine2, zombiek_paine3 ] {ai_pain(4);}; +void() zombiek_paine3 =[ $paine3, zombiek_paine4 ] {ai_pain(3);}; +void() zombiek_paine4 =[ $paine4, zombiek_paine5 ] {ai_pain(3);}; +void() zombiek_paine5 =[ $paine5, zombiek_paine6 ] {ai_pain(3);}; +void() zombiek_paine6 =[ $paine6, zombiek_paine7 ] {ai_pain(2);}; +void() zombiek_paine7 =[ $paine7, zombiek_paine8 ] {ai_pain(2);}; +void() zombiek_paine8 =[ $paine8, zombiek_paine9 ] {}; +void() zombiek_paine9 =[ $paine9, zombiek_paine10 ] {}; +void() zombiek_paine10 =[ $paine10, zombiek_paine11 ] {self.solid = SOLID_NOT;}; +void() zombiek_paine11 =[ $paine11, zombiek_paine12 ] {zombiek_sound(5);}; +void() zombiek_paine12 =[ $paine12, zombiek_paine12 ] {zombiek_onground(MONAI_ZOMBIEUPE);}; + +// Start of get up sequence +void() zombiek_paine13 =[ $paine13, zombiek_paine14 ] { + monster_footstep(TRUE); // Scrapping feet sound while standing up +}; +void() zombiek_paine14 =[ $paine14, zombiek_paine15 ] {}; +void() zombiek_paine15 =[ $paine15, zombiek_paine16 ] {}; +void() zombiek_paine16 =[ $paine16, zombiek_paine17 ] {}; +void() zombiek_paine17 =[ $paine18, zombiek_paine18 ] {}; +void() zombiek_paine18 =[ $paine17, zombiek_paine19 ] {}; +void() zombiek_paine19 =[ $paine19, zombiek_paine20 ] { + self.steptype = FS_TYPEHEAVY; // Heavy clubfoot + monster_footstep(FALSE); + self.steptype = FS_TYPESLOW; // Normal zombie foot +}; +void() zombiek_paine20 =[ $paine20, zombiek_paine21 ] {}; +void() zombiek_paine21 =[ $paine21, zombiek_paine22 ] {}; +void() zombiek_paine22 =[ $paine22, zombiek_paine23 ] {}; +void() zombiek_paine23 =[ $paine23, zombiek_paine24 ] {}; +void() zombiek_paine24 =[ $paine24, zombiek_paine25 ] {}; +void() zombiek_paine25 =[ $paine25, zombiek_paine26 ] {}; +void() zombiek_paine26 =[ $paine26, zombiek_paine27 ] {}; +void() zombiek_paine27 =[ $paine27, zombiek_paine28 ] {ai_painforward(3);}; +void() zombiek_paine28 =[ $paine28, zombiek_paine29 ] {ai_painforward(3);}; +void() zombiek_paine29 =[ $paine29, zombiek_paine30 ] {ai_painforward(3);}; +void() zombiek_paine30 =[ $paine30, zombiek_paine31 ] {ai_painforward(3);}; +void() zombiek_paine31 =[ $paine31, zombiek_run1 ] {ai_painforward(3); + // If getting up for the first time (onfloor) check for targets + if (self.spawnflags & MON_ONFLOOR) { + self.spawnflags = self.spawnflags - MON_ONFLOOR; + monster_targets(); + } +}; + +/*====================================================================== + ZOMBIE PAIN + * All damage must come through pain function to reset health + * Be careful blocking zombie pain function with pain_finished + * zombies react in 2 ways, minor pain (a,c,d) and full knockdown (b,e) +======================================================================*/ +void(entity inflictor, entity attacker, float take) zombiek_pain = +{ + self.health = self.max_health; // always reset health + if (take < MONAI_ZOMBIELOW_DAM) return; // totally ignore + if (self.inpain > 0) return; // in pain animation, do nothing + + zombiek_sound(4); // Moan about the pain + self.inpain = 1; // In pain, don't interrupt animation + self.attack_elev = targzone(self, attacker); + + //---------------------------------------------------------------------- + // Damage 25-60, wobble or drop to ground (SSG, Quad NG) + //---------------------------------------------------------------------- + if (take > MONAI_ZOMBIEHGH_DAM) zombiek_knockdown();// ON THE GROUND + //---------------------------------------------------------------------- + // Damage 9-25 random pain animation (random chance of knockdown) + //---------------------------------------------------------------------- + else { + self.lip = random(); + if (self.lip < 0.25) zombiek_paina1 (); // 12 frames (drag foot) + else if (self.lip < 0.5) zombiek_knockdown(); // ON THE GROUND + else if (self.lip < 0.75 && self.attack_elev == TARGET_FRONT) + zombiek_painb1 (); // 25 frames (flail arms backwards) + else zombiek_painc1 (); // 21 frames (fall to knees) + } +}; + +/*============================================================================= + ZOMBIE WAKEUP (check if can get up) +=============================================================================*/ +void() zombiek_wakeup = { + if (self.gibbed) return; // Do nothing dead + + self.use = SUB_Null; // No more using at this point + if (!self.enemy) FindTarget(); // If no enemy, look around? + + // Turn monster collision on and test if can walk forward + self.solid = SOLID_SLIDEBOX; + if (!walkmove (0, 0)) + { + self.inpain = 2; // On ground + self.nextthink = time + 0.1; // Keep checking + self.think = self.th_wakeup; // Same function + self.solid = SOLID_NOT; // No world interaction yet + // Check if something has been blocking the zombie from getting up + // This is a check for weird world/bmodel geo or monster/players + // standing on zombies while on the ground trying to get up! + self.count = self.count + 1; + if (self.count > MONAI_ZOMBGRDBLOCK) { + self.health = self.gibhealth; // Gib time + Killed(self, self); // Register death + return; + } + } + else { + self.bodyonflr = string_null; // Body is chop proof! + self.inpain = 1; // Animation not finished + zombiek_sound(6); // Wake up sound + self.nextthink = time + 0.1; + self.use = monster_use; // Just in case interruption + if (self.zombieflr == MONAI_ZOMBIEUPD) self.think = zombiek_paind13; + else self.think = zombiek_paine13; + } +}; + +//---------------------------------------------------------------------- +// Puts the zombie on the floor with a random Yaw rotation +// IF frameno = MONAI_ZOMBIEFLR Setup on floor with use trigger +// ELSE setup next think timer and wait for opportunity to get back up +//---------------------------------------------------------------------- +void(float frameno) zombiek_onground = { + self.health = self.max_health; // reset health + self.inpain = 2; // Lying on floor, no pain + self.count = 0; // Reset get up tries + self.solid = SOLID_NOT; // No world interaction + self.bodyonflr = MON_ONFLR; // mark body for the chop + + // Does the zombie start on the ground? + if (frameno == MONAI_ZOMBIEFLR) { + // Do nothing else while on the floor + self.nextthink = self.pausetime; + self.think = SUB_Null; + + // Pick random starting pose + if (random() < 0.5) { + self.zombieflr = MONAI_ZOMBIEUPD; + self.frame = $paind12; + } + else { + self.zombieflr = MONAI_ZOMBIEUPE; + self.frame = $paine12; + } + // If no angle set, Random fall direction + if (self.angles_y < 1) self.angles_y = rint(random()*359); + self.use = self.th_wakeup; + self.fixangle = TRUE; + } + else { + // Zombie fall down function defines wake up pose + self.zombieflr = frameno; + // Keep zombies on the ground and check again later + self.nextthink = self.nextthink + MONAI_ZOMBGRDTIMER; + self.think = self.th_wakeup; + } +}; + +//---------------------------------------------------------------------- +// Puts the zombie on the floor based on the angle of attack +// 270-360, 360-90 : Fall forward (3 checks Left, middle, right) +// 180-270, 90-180 : Fall backward +//---------------------------------------------------------------------- +void() zombiek_knockdown = +{ + local float enemy_ang, comp_ang; + + // Work out which direction the damage came from (enemy) + enemy_ang = targangle(self, self.enemy, 0, FALSE); + comp_ang = anglemod(enemy_ang + 45); // Shift clockwise (front cone) + + if (self.debuglvl) { + dprint("Self ("); dprint(ftos(self.angles_y)); + dprint(") Targ ("); dprint(ftos(enemy_ang)); + dprint(") Comp ("); dprint(ftos(comp_ang)); + dprint(")\n"); + } + + // NORTH WEST : 270-315 (fall BACKWARD, reverse force) + if (comp_ang > 315) { + if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the UPPER LEFT\n"); + self.ideal_yaw = anglemod(enemy_ang + 180); + ChangeYaw (); + zombiek_paine1(); + } + // SOUTH WEST : 225-270 (fall FORWARD, side force +45) + else if (comp_ang > 270) { + if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the LOWER LEFT\n"); + self.ideal_yaw = comp_ang; + ChangeYaw (); + zombiek_paind1(); + } + // SOUTH : 135-225 (fall FORWARD) + else if (comp_ang > 180) { + if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the BACK\n"); + self.ideal_yaw = self.angles_y; // Fix for ai_painforward + ChangeYaw (); + zombiek_paind1(); + } + // SOUTH EAST : 90-135 (fall FORWARD, side force -45) + else if (comp_ang > 135) { + if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the LOWER RIGHT\n"); + self.ideal_yaw = anglemod(enemy_ang+315); + ChangeYaw (); + zombiek_paind1(); + } + // NORTH EAST : 45-90 (fall BACKWARD, reverse force) + else if (comp_ang > 90) { + if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the UPPER RIGHT\n"); + self.ideal_yaw = anglemod(enemy_ang + 180); + ChangeYaw (); + zombiek_paine1(); + } + // NORTH : 315-45 (fall BACKWARD) + else { + if (self.debuglvl) dprint("\b[KNOCKDOWN]\b HIT from the FRONT\n"); + zombiek_paine1(); + } +}; + +/*============================================================================ + All sounds used + 2 = strutting the stuff (walking) + 3 = running (in slow motion) + 4 = all pain routines (zombiek_paina1, _painb1, _painc1, _paind1) + 5 = its a knockout! + 6 = get up and moan about it + 7 = sword swipe +============================================================================*/ +void(float type) zombiek_sound = +{ + // check for gibbed or idle sound block + if (self.health < 1) return; + if (self.spawnflags & MON_SPAWN_NOIDLE && type < 3) return; + + // Random sound check + self.lip = random(); + if (type == 2 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) + sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + } + else if (type == 3 && self.idletimer < time) { + self.idletimer = time + 1 + (random()*2); + if (self.lip < 0.2) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + if (self.lip > 0.8) sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 4) { + if (self.lip < 0.25) sound (self, CHAN_VOICE, self.pain_sound, 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_VOICE, self.pain_sound2, 1, ATTN_NORM); + } + else if (type == 5) { + sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM); + } + else if (type == 6) { + if (self.lip < 0.5) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); + else sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); + } + else if (type == 7) { + if (self.lip < 0.25) sound (self, CHAN_WEAPON, "weapons/sword1a.wav", 1, ATTN_NORM); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, "weapons/sword2a.wav", 1, ATTN_NORM); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, "weapons/sword1b.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/sword2b.wav", 1, ATTN_NORM); + } +}; + +//============================================================================ +void() zombiek_die = +{ + self.health = self.gibhealth; // Force gib + monster_death_precheck(); +}; + +/*====================================================================== + QUAKED monster_zombiek (1 0 0) (-16 -16 -24) (16 16 32) Ambush x FLOOR +======================================================================*/ +void() monster_zombiek = +{ + if (deathmatch) { remove(self); return; } + + self.mdl = "progs/ad171/mon_zombiek.mdl"; // Zombie Knight + self.headmdl = "progs/ad171/h_zombiek.mdl"; + precache_model (self.mdl); + precache_model (self.headmdl); + + self.gib1mdl = "progs/ad171/w_knightsword.mdl"; // Unique sword + self.gib1sound = GIB_IMPACT_METALA; + precache_model (self.gib1mdl); + + precache_sound ("zombie/z_idle.wav"); // Idle A + precache_sound ("zombie/z_idle1.wav"); // Idle B + + self.pain_sound = "zombie/z_pain.wav"; + self.pain_sound2 = "zombie/z_pain1.wav"; + precache_sound (self.pain_sound); + precache_sound (self.pain_sound2); + + precache_sound ("zombie/z_fall.wav"); // Impact - floor + precache_sound ("zombie/z_gib.wav"); // Death sound + + // New sword sweep/slash sounds + precache_sound ("weapons/sword1a.wav"); + precache_sound ("weapons/sword1b.wav"); + precache_sound ("weapons/sword2a.wav"); + precache_sound ("weapons/sword2b.wav"); + + // New sight sound, mixture of knight + zombie + self.sight_sound = "zombie/zk_sight.wav"; + precache_sound (self.sight_sound); + + self.solid = SOLID_NOT; // No interaction with world + self.movetype = MOVETYPE_NONE; // Static item, no movement + if (self.bboxtype < 1) self.bboxtype = BBOX_SHORT; + self.health = 60; // Basic health (cannot override) + self.gibhealth = -60; // Gib value, not used + self.gibbed = FALSE; // In one piece + self.pain_flinch = MONAI_ZOMBIEHGH_DAM; + self.steptype = FS_TYPESLOW; // Small leg + self.altsteptype = FS_TYPEDRAG; // Clubfoot + self.pain_timeout = -5; // Always go into pain (health reset) + self.inpain = 0; // Zombie starts with no pain lock + self.count = 0; // Reset get up timer + + // Always reset Ammo Resistance to be consistent + self.resist_shells = self.resist_nails = 0; + self.resist_rockets = self.resist_cells = 0; + + if (self.deathstring == "") self.deathstring = " was cornered by a Zombie Knight\n"; + + self.hittype = HIT_METAL; + self.th_checkattack = ZombiekCheckAttack; + self.th_stand = zombiek_stand1; + self.th_walk = zombiek_walk1; + self.th_run = zombiek_run1; + self.th_melee = zombiek_melee; // two melee attacks (stationary) + self.th_jump = zombiek_jump1; // Leap attack + self.th_jumpexit = zombiek_jump9; // Exit animation for jump + self.th_pain = zombiek_pain; + self.th_die = zombiek_die; + self.th_wakeup = zombiek_wakeup; // Get off floor + + self.classtype = CT_MONZOMBIEK; + self.classgroup = CG_ZOMBIE; // One big happy zombie family! + self.classmove = MON_MOVEWALK; + + monster_start(); +}; diff --git a/QC_other/QC_keep/monsters.qc b/QC_other/QC_keep/monsters.qc new file mode 100644 index 00000000..3daeaf60 --- /dev/null +++ b/QC_other/QC_keep/monsters.qc @@ -0,0 +1,1110 @@ +/*====================================================================== + MONSTER FUNCTIONS +======================================================================*/ +void(entity e) sendmonsterdevdata; + +float MONAI_ZOMBIEFLR = 1; // start on floor +float MONAI_ZOMBIEUPB = 2; // zombie painb - 28 frames (9 = on ground) +float MONAI_ZOMBIEUPD = 4; // knight paind - 35 frames (12 = on ground) +float MONAI_ZOMBIEUPE = 8; // knight + zombie paine - 30 frames (12 = on ground) +float MONAI_ZOMBGRDTIMER = 2; // Zombie onground timer (between checking) +float MONAI_ZOMBGRDBLOCK = 300; // 0.1 * 300 = 30s +float MONAI_ZOMBIELOW_DAM = 9; // Pain threshold for animations +float MONAI_ZOMBIEHGH_DAM = 24; + +void(float frameno) zombie_onground; +void(float frameno) zombiek_onground; + +//---------------------------------------------------------------------- +// Pre-defined bounding boxes for monsters +// Use 'bboxtype' to specify one of these +//---------------------------------------------------------------------- +float BBOX_TINY = 1; // -16 -16 -24, 16 16 16 +float BBOX_SHORT = 4; // -16 -16 -24, 16 16 32 +float BBOX_TALL = 5; // -16 -16 -24, 16 16 40 +float BBOX_WIDE = 7; // -24 -24 -24, 24 24 40 +float BBOX_GIANT = 8; // -24 -24 -24, 24 24 64 +float BBOX_FLAT = 9; // -24 -24 -24, 24 24 22 +float BBOX_MASSIVE = 10; // -32 -32 -24, 32 32 64 +float BBOX_GOLEM = 15; // -24 -24 -24, 24 24 72 +float BBOX_DOG = 20; // -20 -20 -24, 20 20 16 +float BBOX_SHADE = 21; // -64 -64 -24, 64 64 64 +float BBOX_FISH = 25; // -16 -16 -24, 16 16 24 +float BBOX_FISHS = 26; // -12 -12 -16, 12 12 16 +float BBOX_EEL = 27; // -16 -16 -16, 16 16 16 +float BBOX_WYRM = 28; // -112 -112 -24, 112 112 112 +float BBOX_RYU = 29; // -56 -56 -24, 56 56 56 +float BBOX_HYDRA = 30; // -20 -20 -16, 20 20 16 +float BBOX_CUSTOM = 99; // Custom size set already +float BBOX_WILLY = 31; // -32 -32 -24, 32 32 5 +float BBOX_CYBER = 32; // -20 -20 -36, 20 20 74 +float BBOX_ANACONDA = 33; // -32 -32 -16, 32 32 174 + +/*====================================================================== + monster_use - trigger/make angry +======================================================================*/ +void() monster_use = +{ + // Busy with another enemy or dead? + if (self.enemy) return; + if (self.health < 1) return; + + // Spiders/Vorelings can be setup on the ceilings + // need to trigger/drop instead them before anything else + if (self.classtype == CT_MONSPIDER || self.classtype == CT_MONVORELING) { + if (self.spawnflags & MON_SPIDER_CEILING) { + // Start with activator as enemy + self.enemy = activator; + // Work through exceptions + if (activator.classtype != CT_PLAYER) self.enemy = world; + if (activator.items & IT_INVISIBILITY) self.enemy = world; + if (activator.flags & FL_NOTARGET) self.enemy = world; + // Drop from ceiling + self.th_run(); + return; + } + } + + // Player exceptions + if (activator.classtype != CT_PLAYER) return; + if (activator.items & IT_INVISIBILITY) return; + if (activator.flags & FL_NOTARGET) return; + + // Monster angry! Hunt enemy!?! + self.enemy = activator; + + // If wakeup trigger setup do not wait, special animation + // This is really designed to go with a breakable trigger + if (self.wakeuptrigger && self.th_wakeup) { + self.wakeuptrigger = FALSE; // Trigger no longer needed, reset + FoundHuntTarget(TRUE); // Setup goals and warn other monsters + self.th_wakeup(); + } + else { + // delay reaction (wait one frame) so if the monster + // has been teleported the sound is heard correctly + self.nextthink = time + 0.1; + self.think = FoundTarget; + } +}; + +/*====================================================================== + liquid_check + for some reason monsters never take damage from liquids + This functions checks for liquid content and applies a + modifier damage (they die too slow otherwise) + * If a monster is in liquid there is often no way out! + * Moves the content check to the monsters feet (shallow liquid) +======================================================================*/ +void() monster_liquid_check = +{ + local float monster_dmg; + local vector monster_feet; + + // This function is for monsters only (high damage) + if (self.no_liquiddmg) return; + if (query_configflag(SVR_LIQDAM)) return; + if ( !(self.flags & FL_MONSTER)) return; + if (self.health < 1) return; + if (self.liquidcheck > time) return; + + // Reset liquid damage timer + self.liquidcheck = time + LIQUID_TIMER; + + // Check for liquid at monsters feet (bottom of bounding box) + monster_feet = self.origin; + monster_feet_z = monster_feet_z + self.mins_z; + self.liquidbase = pointcontents(monster_feet); + + // Setup standard damage for liquid types + if (self.liquidbase == CONTENT_SLIME) monster_dmg = SLIME_DAMAGE * MON_MULTIPLIER; + else if (self.liquidbase == CONTENT_LAVA) monster_dmg = LAVA_DAMAGE * MON_MULTIPLIER; + else return; + + // Gib monster if about to die + if (self.health < monster_dmg + 5) { + monster_dmg = self.health + 5; + self.gibondeath = 1; + } + + // Liquid damage + self.pain_finished = 0; // Always pain + T_Damage (self, world, world, monster_dmg, DAMARMOR); +}; + +// Applies poison damage if monster has been poisoned +void monster_poisoned_check() = { + local string stemp; + + if (self.poisoned) { + if (self.poisoned_time < time) { + // Reset poisoned tick timer + self.poisoned_time = time + 1; + + self.debuff_qty = DEBUFF_POISON_DMGMON; + if (self.poisoned_qty < self.debuff_qty) self.debuff_qty = self.poisoned_qty; + self.poisoned_qty = self.poisoned_qty - self.debuff_qty; + T_Damage(self,world,world,self.debuff_qty,DAMARMOR); + stemp = ftos(self.debuff_qty); + //dprint("Poison damage applied to monster = "); + //dprint(stemp); + //dprint("\n"); + } + } +}; + +/*====================================================================== + monster_idle_sound + - use one routine so more stuff can be added easily + - easier to add any exceptions this way + - zombies have their own unique idle routine + - tarby added using sight sound +======================================================================*/ +void() monster_idle_sound = +{ + // No monsters, dead and timer not reset? + if ( !(self.flags & FL_MONSTER) ) return; + if (self.health < 1) return; + if (self.idletimer > time) return; + if (self.spawnflags & MON_SPAWN_NOIDLE) return; + + self.idletimer = time + 5 + (random() * 3); + if (!self.idlemoreoften && random() > MON_IDLE_SOUND) return; + + // Is the monster active in combat (special idle sound) + if (self.enemy && self.idle_soundcom != "") { + if (self.idle_soundcom2 != "") { + if (random() < 0.5) sound (self, CHAN_VOICE, self.idle_soundcom, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_soundcom2, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.idle_soundcom, 1, ATTN_NORM); + } + else { + // setup each monster with unique idle sounds (easier and quicker) + if (self.idle_sound2 != "") { + if (random() < 0.5) sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, self.idle_sound2, 1, ATTN_NORM); + } + else sound (self, CHAN_VOICE, self.idle_sound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + monster_sightsound + - Switched sound channel to CHAN_BODY so death always stops it + - Randomnly get sound file cut off using voice channel +======================================================================*/ +void() monster_sightsound = +{ + local float rsnd; + + // No monsters, dead and timer not reset? + if ( !(self.flags & FL_MONSTER) ) return; + if (self.health < 1) return; + if (!self.sight_sound) return; + if (self.spawnflags & MON_SPAWN_NOSIGHT) return; + if (intermission_running > 0) return; // intermission or finale + + // Only do a sight sound when necessary, otherwise it overlaps and gets messy + if (self.sight_timeout < time) { + self.sight_timeout = time + MON_SIGHTSOUND; // Use pre-defined reset values + + rsnd = random(); + // The id enforcer has four sight sounds, which is a bit excessive + // Check through sight strings to find out quantity + if (self.sight_count == 2) { + if (rsnd < 0.5) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.sight_sound2, 1, ATTN_NORM); + } + else if (self.sight_count == 3) { + if (rsnd < 0.3) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else if (rsnd < 0.6) sound (self, CHAN_BODY, self.sight_sound2, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.sight_sound3, 1, ATTN_NORM); + } + else if (self.sight_count == 4) { + if (rsnd < 0.25) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else if (rsnd < 0.5) sound (self, CHAN_BODY, self.sight_sound2, 1, ATTN_NORM); + else if (rsnd < 0.75) sound (self, CHAN_BODY, self.sight_sound3, 1, ATTN_NORM); + else sound (self, CHAN_BODY, self.sight_sound4, 1, ATTN_NORM); + } + + // setup each monster with unique sight sounds (easier and quicker) + // ID code - A bit excessive to have four sight sounds for the enforcer and + // only one for every other monster type! ... somebody sure had a favourite! + else if (self.classtype == CT_MONENFORCER) { + rsnd = random(); + if (rsnd < 0.25) sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + else if (rsnd < 0.5) sound (self, CHAN_BODY, "enforcer/sight2.wav", 1, ATTN_NORM); + else if (rsnd < 0.75) sound (self, CHAN_BODY, "enforcer/sight3.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "enforcer/sight4.wav", 1, ATTN_NORM); + } else if (self.classtype == CT_MONNEMESANT) { + rsnd = random(); + if (rsnd < 0.5) sound (self, CHAN_BODY, "nemesant/tsight1.wav", 1, ATTN_NORM); + else sound (self, CHAN_BODY, "nemesant/tsight2.wav", 1, ATTN_NORM); + } + else sound (self, CHAN_BODY, self.sight_sound, 1, ATTN_NORM); + } +}; + +/*====================================================================== + monster_footstep + This function will play a footstep sound + * Types : Slow, Drag, Light, Medium, Heavy, Large + * called from animation blocks to sync with sound +======================================================================*/ +void(float altfoot) monster_footstep = +{ + local float footstep, footstepnext, footvol; + local string footstepwav; + + if (query_configflag(SVR_FOOTSTEP)) return; // Default(0) = ON + if (self.health < 1) return; + if (self.movetype == MOVETYPE_NOCLIP) return; + if (self.watertype < CONTENT_EMPTY) return; + if (self.steptype == FS_FLYING) return; + + // Wide volume range for player + if (self.flags & FL_CLIENT) footvol = 0.2 + random()*0.6; + // feetsteps need to be louder during combat + else if (self.enemy) footvol = 1; + // Dogs have too many legs making noise, reduce volume + else if (self.classtype == CT_MONDOG) footvol = 0.2 + random()*0.6; + // Slight random volume level out of combat + else footvol = 0.7 + random()*0.3; + + // Decide which foot sound to play, long live clubfoot! + if (altfoot) { + // Switch to ALTernative foot sound + footstep = self.altsteptype; + if (self.altsteplast < 1) self.altsteplast = rint(1 + random()*4); + + // Increase footstep sound index by one + footstepnext = rint(self.altsteplast + 1); + // Every loop around, randomly reset + if (footstepnext > 5) footstepnext = rint(1 + random()*4); + self.altsteplast = footstepnext; + } + else { + // Setup last footstep sound + footstep = self.steptype; + if (self.steplast < 1) self.steplast = rint(1 + random()*4); + + // Player is randomly selected footsteps + if (self.flags & FL_CLIENT) { + // Quake random function is not really super random + // Probably a bad seed starting point for function + // Use 3 randoms to create something more random! + footstepnext = rint(self.steplast + random() + random() + random()); + if (footstepnext > 5) footstepnext = footstepnext - 5; + } + else { + // Increase footstep sound index by one + footstepnext = rint(self.steplast + 1); + // Every loop around, randomly reset + if (footstepnext > 5) footstepnext = rint(1 + random()*4); + } + + // update last footstep index + self.steplast = footstepnext; + } + + // Cycle through all footstep types and work out correct sound file + // All footstep types reduced down to 5 possible choices (speed things up) + // Could store sound files with entity and cycle round quicker, req more memory + // re-checking the sound file every footstep is costly on time + // Luckly most footstep sounds are several frames apart (too noisy as well) + if (footstep == FS_TYPELIGHT) { + // Light heal/ paw sound + if (footstepnext < 2) footstepwav = SOUND_FS_LIGHT1; + else if (footstepnext < 3) footstepwav = SOUND_FS_LIGHT2; + else if (footstepnext < 4) footstepwav = SOUND_FS_LIGHT3; + else if (footstepnext < 5) footstepwav = SOUND_FS_LIGHT4; + else footstepwav = SOUND_FS_LIGHT5; + } + else if (footstep == FS_TYPEMEDIUM) { + // Average foot/boot sound + if (footstepnext < 2) footstepwav = SOUND_FS_MEDIUM1; + else if (footstepnext < 3) footstepwav = SOUND_FS_MEDIUM2; + else if (footstepnext < 4) footstepwav = SOUND_FS_MEDIUM3; + else if (footstepnext < 5) footstepwav = SOUND_FS_MEDIUM4; + else footstepwav = SOUND_FS_MEDIUM5; + } + else if (footstep == FS_TYPEHEAVY) { + // Heavy foot with slight echo + if (footstepnext < 2) footstepwav = SOUND_FS_HEAVY1; + else if (footstepnext < 3) footstepwav = SOUND_FS_HEAVY2; + else if (footstepnext < 4) footstepwav = SOUND_FS_HEAVY3; + else if (footstepnext < 5) footstepwav = SOUND_FS_HEAVY4; + else footstepwav = SOUND_FS_HEAVY5; + } + else if (footstep == FS_TYPELARGE) { + // Large foot with large echo + if (footstepnext < 2) footstepwav = SOUND_FS_LARGE1; + else if (footstepnext < 3) footstepwav = SOUND_FS_LARGE2; + else if (footstepnext < 4) footstepwav = SOUND_FS_LARGE3; + else if (footstepnext < 5) footstepwav = SOUND_FS_LARGE4; + else footstepwav = SOUND_FS_LARGE5; + } + else if (footstep == FS_TYPEGIANT) { + // Giant foot with long echo + if (footstepnext < 2) footstepwav = SOUND_FS_GIANT1; + else if (footstepnext < 3) footstepwav = SOUND_FS_GIANT2; + else if (footstepnext < 4) footstepwav = SOUND_FS_GIANT3; + else if (footstepnext < 5) footstepwav = SOUND_FS_GIANT4; + else footstepwav = SOUND_FS_GIANT5; + } + else if (footstep == FS_TYPECUSTOM) { + // Custom feet sounds (usually boss type creatures) + if (footstepnext < 2) footstepwav = self.stepc1; + else if (footstepnext < 3) footstepwav = self.stepc2; + else if (footstepnext < 4) footstepwav = self.stepc3; + else if (footstepnext < 5) footstepwav = self.stepc4; + else footstepwav = self.stepc5; + } + else if (footstep == FS_TYPEDRAG) { + // Small scraping foot on ground + if (footstepnext < 2) footstepwav = SOUND_FS_DRAG1; + else if (footstepnext < 3) footstepwav = SOUND_FS_DRAG2; + else if (footstepnext < 4) footstepwav = SOUND_FS_DRAG3; + else if (footstepnext < 5) footstepwav = SOUND_FS_DRAG4; + else footstepwav = SOUND_FS_DRAG5; + } + // FS_TYPESLOW (default) + else { + // Souless shoe foot sound + if (footstepnext < 2) footstepwav = SOUND_FS_SLOW1; + else if (footstepnext < 3) footstepwav = SOUND_FS_SLOW2; + else if (footstepnext < 4) footstepwav = SOUND_FS_SLOW3; + else if (footstepnext < 5) footstepwav = SOUND_FS_SLOW4; + else footstepwav = SOUND_FS_SLOW5; + } + + // Play the sound (large feet need to be heard further away) + if (footstep == FS_TYPELARGE) sound (self, CHAN_FEET, footstepwav, footvol, ATTN_FEETL); + else sound (self, CHAN_FEET, footstepwav, footvol, ATTN_FEET); +}; + +//====================================================================== +// PRE/POST CHECK conditions for monster death +//====================================================================== +void() monster_death_precheck = +{ + if (self.flags & FL_MONSTER) { + // Check for minion monster and update parent counters + if (self.owner.minion_active) update_minioncount(self.owner, -1); + + self.deadflag = DEAD_DEAD; // Its dead jim! + self.effects = 0; // Remove effects on death + self.think = SUB_Null; // No more thinking/animation + self.nextthink = -1; // Never fire think + + monster_check_gib(); // Check for gib state + } +}; + +//---------------------------------------------------------------------- +void() monster_fade = +{ + self.think = model_fade; + self.nextthink = time + 0.1; + self.ltime = self.nextthink; +}; + +//---------------------------------------------------------------------- +void() monster_death_postcheck = +{ + local float bodytimer; + + self.blockudeath = TRUE; // Body is dead, no human death noise + if (!self.gibbed) self.bodyonflr = MON_ONFLR; + + // Allow for the dead body/head to touch triggers (void/hurt) + setorigin(self, self.origin); + self.solid = SOLID_TRIGGER; + self.touch = SUB_Null; + + // Check for global or individual body fading mechanic + if (self.bodyfadeaway > 0 || map_bodyfadeaway > 0) { + if (map_bodyfadeaway > 0) bodytimer = map_bodyfadeaway; + else bodytimer = self.bodyfadeaway; + self.pain_finished = time + 10 + random() * bodytimer; + } + // Body sticks around + else self.pain_finished = time + LARGE_TIMER; +}; + +//---------------------------------------------------------------------- +void() monster_deadbody_check = +{ + // Remove/Fade out body if timer is finished + if (self.pain_finished < time) { monster_fade(); return; } + // Exit condition, body no longer has any interaction + if (self.deadflag == DEAD_FINISHED) return; + + // Check for deadflag first, if touched something this will be changed + if (self.deadflag == DEAD_REMOVE || self.deadflag == DEAD_EXPLODE + && self.gibbed == FALSE) { + // make sure touch,solid and body axe interaction are off + self.touch = SUB_Null; + self.solid = SOLID_NOT; + self.bodyonflr = ""; + self.gibhealth = TRUE; + // Only two options available, gib explode or remove + if (self.deadflag == DEAD_EXPLODE) self.think = monster_ThrowGib; + // Replace animation frame group think function + else self.think = SUB_Remove; + self.nextthink = time + 0.1; + // Prevent this function from running again + self.deadflag = DEAD_FINISHED; + } + else { + // Check global map variable first (default = off) + // Check floor below dead body (global function) + if (map_bodyflrcheck == TRUE) + ent_floorcheck(self, FLOOR_TRACE_MONSTER); + + // Keep checking for dead body/head conditions + self.think = monster_deadbody_check; + self.nextthink = time + 0.1; + } +}; + +/*====================================================================== + monster_death_use + - When a mosnter dies, it fires all of its targets with the current + enemy as activator. +======================================================================*/ +void() monster_death_use = +{ + // fall to ground or stop swimming + if (self.flags & FL_FLY) self.flags = self.flags - FL_FLY; + if (self.flags & FL_SWIM) self.flags = self.flags - FL_SWIM; + + // Always use a deathtarget if one defined + if (self.deathtarget != "") { + // Validate deathtarget exists before firing it + self.movelast = find(world, targetname, self.deathtarget); + // Deathtarget valid, switch around and fire targets + if (self.movelast) self.target = self.deathtarget; + } + + // Is there no target defined? + if (self.target == "") return; + + activator = self.enemy; + SUB_UseTargets (); +}; + +/*====================================================================== + monster_paincheck + - Tests all pain conditions and returns what to do + * 0 = Nothing + * 1 = Sound + Animation + * 2 = Sound + Long Animation + * 3 = Sound ONLY +======================================================================*/ +void(entity attacker, float damage) monster_pain_check = +{ + self.pain_check = 0; // Reset pain check + + // already dying, don't go into pain frame + if (self.health < 1) self.pain_check = 0; + // The new axe forces monsters into long pain animations (if they exist) + else if (attacker.moditems & IT_UPGRADE_AXE && self.axhitme && self.pain_longanim) self.pain_check = 2; + // always go into pain frame if it has been a while (first hit = pain) + else if (time - self.pain_finstate > PAIN_ALWAY) self.pain_check = 1; + // Dangerous liquids should kill the monster and keeping them in + // constant pain animations which makes them look better than doing nothing! + else if (self.liquidbase == CONTENT_SLIME || self.liquidbase == CONTENT_LAVA) self.pain_check = 1; + // If being attacked by a world object (shooter, electricity, bmodel) in pain + else if (attacker == world) self.pain_check = 1; + // Random chance to flinch and not ignore the pain (play sound only) + else if (random()* self.pain_flinch > damage ) self.pain_check = 3; + // DEFAULT : pain animation + sound (last condition) + else self.pain_check = 1; +}; + +/*====================================================================== + monster_targets (second part of setup function) + - Checks for any targets to get angry at or stand/walk around +======================================================================*/ +void() monster_targets = +{ + // Reset everything first + self.enemy = self.goalentity = self.movetarget = world; + + //---------------------------------------------------------------------- + // * Monsters can spawn angry at the player/activator + // * the target key can point to a path_corner + // * If the target key points at another monster they will infight + //---------------------------------------------------------------------- + if (self.spawnflags & MON_SPAWN_ANGRY || self.angrytarget) { + // Check if the activator is a player? if not find a player + if (activator.flags & FL_CLIENT) self.enemy = activator; + else self.enemy = checkclient (); + + // Double check enemy is player and has notarget or wearing RoS? + if (self.enemy.flags & FL_CLIENT) { + if (self.enemy.flags & FL_NOTARGET) self.enemy = world; + else if (self.enemy.items & IT_INVISIBILITY) self.enemy = world; + } + // If the activator not a player, reset to world + // Cannot get angry at triggers, use angrytarget for infighting + else self.enemy = world; + + // If an alternative angry target defined, find it and attack! + if (self.angrytarget) { + self.oldenemy = find(world, targetname, self.angrytarget); + // Is the attack target a monster and spawned/active (take damage) + if (self.oldenemy.flags & FL_MONSTER && self.oldenemy.takedamage != DAMAGE_NO) + self.enemy = self.oldenemy; + } + + // Check the enemy is a player/monster and alive + if (self.enemy.flags & (FL_CLIENT | FL_MONSTER) && self.enemy.health > 0 && self.health > 0) { + self.nextthink = time + 0.1; + self.think = FoundTarget; + if (self.health > 0) monster_sightsound (); // Wake up sound + return; + } + } + else { + // If the monster has a target check if path_corner or something to attack? + // Do nothing with patrol paths if spawning angry with the player + if (self.target != "") { + self.movetarget = find(world, targetname, self.target); + // Cannot chase a target if setup as a turret + if (self.movetarget && self.movespeed != -1) { + if (self.movetarget.classtype == CT_PATHCORNER) { + self.goalentity = self.movetarget; + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_walk; + return; + } + } + } + } + + if (activator.flags & FL_CLIENT && activator.horn_active == TRUE) { + self.charmer = activator; + self.charmed = TRUE; + self.effects = (self.effects | EF_DIMLIGHT); + } + + // no angrytarget, enemy or path corner, stand around waiting + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // Stand around +}; + +/*====================================================================== + monster_setup + - Setup monster ready for action +======================================================================*/ +void() monster_spawn = +{ + //---------------------------------------------------------------------- + // Check for Axe / Shotgun / LG upgrade monster spawn exceptions? + if (self.upgrade_axe || self.upgrade_ssg || self.upgrade_lg) { + // Has ANY player (server test not individual) + // picked up the relevant upgrade weapons? + if (self.upgrade_axe && !query_configflag(SVR_UPDAXE) ) return; + if (self.upgrade_ssg && !query_configflag(SVR_UPDSSG) ) return; + if (self.upgrade_lg && !query_configflag(SVR_UPDLG) ) return; + + // Update monster count (not added to monster count until spawned) + total_monsters = total_monsters + 1; + update_hud_totals(HUD_MONSTERS); + } + + //---------------------------------------------------------------------- + if (self.think1) self.use = self.think1; // different use function? + else self.use = monster_use; // default trigger event + self.solid = SOLID_SLIDEBOX; // Standard monster movement + self.movetype = MOVETYPE_STEP; // Standard monster movement + setmodel(self, self.mdl); // Setup model + self.skin = self.skin_override; // Restore any skins + self.frame = self.frame_override; // Restore any frames + setsize (self, self.bbmins, self.bbmaxs); // Restore BB size + + // Restore any effect flags settings (various dlight glows) + if (self.savedeffects > 0) self.effects = self.savedeffects; + + // Should grenades bounce off the body? + if (self.bouncegrenade) self.takedamage = DAMAGE_YES; + else self.takedamage = DAMAGE_AIM; // Can receive damage + + self.velocity = '0 0 0'; // Make sure stationary + self.deadflag = DEAD_NO; // used to stop death re-triggering + self.liquidbase = self.liquidcheck = 0; // Used for liquid content damage + self.dmgcombined = self.dmgtimeframe = 0; // combined damage over 0.1s + if (!self.pain_flinch) self.pain_flinch = self.health; + + // Double check that all ammo resistance are within range + Resist_CheckRange(self); + + // Check for tether system (special target field) + setup_tethersystem(); + + // Long time before first idle sound (except scorpions!) + if (self.classtype == CT_MONSCORPION) self.idletimer = time + 0.1 + random(); + else self.idletimer = time + 4 + (random() * 4); + + // Reset all enemy tracking entities + if (!self.enemy) self.enemy = self.movetarget = self.goalentity = world; + self.pausetime = LARGE_TIMER; + + // Setup pain tolerence level based on current skill level + if (!self.pain_timeout) self.pain_timeout = 1; // Default + if (skill == SKILL_HARD) self.pain_timeout = self.pain_timeout + 1; + if (skill == SKILL_NIGHTMARE) self.pain_timeout = self.pain_timeout + 3; + + //---------------------------------------------------------------------- + // Setup different skin options + //---------------------------------------------------------------------- + if (self.exactskin > 0) self.skin = self.exactskin; + else if (self.randomskin > 1) self.skin = rint(random()*(self.randomskin-1)); + if (self.skin < 0) self.skin = 0; // Double check no negatives + + //---------------------------------------------------------------------- + self.ideal_yaw = self.angles * '0 1 0'; + if (self.classmove == MON_MOVEWALK ) { // Walking Monsters + if (!self.yaw_speed) self.yaw_speed = 20; + } + else if (self.classmove == MON_MOVEFLY ) { // Flying Monsters + if (!self.yaw_speed) self.yaw_speed = 15; + self.flags = self.flags | FL_FLY; + } + else if (self.classmove == MON_MOVESWIM ) { // Swimming Monsters + if (!self.yaw_speed) self.yaw_speed = 10; + self.flags = self.flags | FL_SWIM; + } + + // Not all bounding boxes extend up very high, make sure the view_ofs + // is relevant to where the top of the bounding box is + if (self.view_ofs_z == 0) { + if (self.maxs_z <= MON_VIEWOFS) self.view_ofs_z = self.maxs_z*0.5; + else self.view_ofs_z = MON_VIEWOFS; + } + + //---------------------------------------------------------------------- + // Is the monster a zombie (type) lying on the floor? (starting pose) + // Angles key used for specific facing direction, 0 = random setup + // This function check is before any droptofloor or content checks + // It will allow onfloor monsters to exist in tight spaces, shallow graves + //---------------------------------------------------------------------- + if (self.spawnflags & MON_ONFLOOR && self.classgroup == CG_ZOMBIE) { + if (self.classtype == CT_MONZOMBIEK) zombiek_onground(MONAI_ZOMBIEFLR); + else zombie_onground(MONAI_ZOMBIEFLR); + return; + } + + //---------------------------------------------------------------------- + // Special minions (start small and grow fast) + // CT_MINIONSPIDER, CT_MINIONVORELING, CT_MINIONGARGOYLE + //---------------------------------------------------------------------- + if (self.minion_active) { + self.angles = vectoangles(self.enemy.origin - self.origin); + self.angles_x = self.angles_z = 0; + update_hud_totals(HUD_MONSTERS); + self.pain_finished = time + 1.2; + self.th_stand(); + return; + } + + //---------------------------------------------------------------------- + // Perched Gargoyles have special idle animation (sitting) + // and need to fly up before resuming any normal behaviour + // (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.classtype == CT_MONGARGOYLE && self.spawnflags & MON_GARGOYLE_PERCH) { + self.flags = self.flags | FL_FLY; // Stop any ground checks + self.idletimer = time; // Always start with idle sounds + self.th_stand(); + return; + } + + //---------------------------------------------------------------------- + // Ceiling critters have special idle animation (rotated) + // and need to let go of the ceiling before resuming any + // normal behaviour (most think functions are intercepted) + //---------------------------------------------------------------------- + if (self.classtype == CT_MONSPIDER && self.spawnflags & MON_SPIDER_CEILING || + self.classtype == CT_MONVORELING && self.spawnflags & MON_VORELING_CEILING) { + // Work out where the ceiling is (traceline upwards) + traceline (self.origin, self.origin+'0 0 4096', TRUE, self); + + // Check for empty content before moving + if (pointcontents(trace_endpos) == CONTENT_EMPTY) { + self.flags = self.flags | FL_FLY; // Stop any ground checks + self.classmove = MON_MOVEFLY; // Avoid ground check function + self.origin = trace_endpos; // Move critter to ceiling + setorigin(self, self.origin); + // If the view_ofs is not underneath the critter, no sight + // functions will work (checkclient for example) + self.view_ofs = '0 0 -24'; + self.yaw_speed = 20; // Ground yaw speed + self.idletimer = time; // Always start with idle sounds + setsize(self, '-16 -16 -24', '16 16 0'); + } + else { + dprint("\b[MONSTER]\b Trying to place on ceiling, no space!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + } + + //---------------------------------------------------------------------- + // Check to see if monster (walking) are stuck in geometry + if (self.classmove == MON_MOVEWALK) { + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0,0)) { + // Tempoaraily use lip variable for stuck condition + self.lip = TRUE; + // Some monster placement in the original ID maps NEED original Bounding Boxes + // this is something that cannot be easily fixed, so go back to original BB + // and test the monster placement again + if (CheckZeroVector(self.idmins) == FALSE) { + self.bbmins = self.idmins; self.bbmaxs = self.idmaxs; + setsize (self, self.bbmins, self.bbmaxs); // Restore ID BB size + self.origin_z = self.origin_z + 1; + droptofloor(); + // re-test monster movement using ID Bounding Box + if (walkmove(0,0)) self.lip = FALSE; + } + + // It seems that some mappers want to spawn stuff in mid air + // and let it drop naturally over time (>1 frame) + // check for empty point content at origin as final test + if (pointcontents(self.origin) == CONTENT_EMPTY) self.lip = FALSE; + + // Is the monster stuck with new/old bounding box? + // Stuck monsters contribute towards level monster totals + if (self.lip) { + // If the monster is stuck and delay spawned, gib instead + if (self.spawnflags & MON_SPAWN_DELAY) { + self.health = self.gibhealth; + Killed(self, self); + } + else { + // this condition should be a map spawn event only + dprint ("\b[STUCK]\b "); dprint (self.classname); + dprint (" at "); dprint (vtos(self.origin)); + dprint ("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + } + return; + } + } + } + + //---------------------------------------------------------------------- + // Telefrag (kill) anything at monster position + // Phased monsters cannot telefrag or produce spawn effects + if (!self.bodyphased) { + // New spawn condition via entity key nospawndamage + // This is to prevent excessive damage to breakables + // Monsters can spawn in very wierd situations (inside things) + // if spawning damage is disabled (spawn_tdeath) + if (self.nospawndamage == 0) + spawn_tdeath(self.origin, self); // 50K damage! + + // Don't show spawning effect if delay spawn + nogfx + if (self.spawnflags & MON_SPAWN_DELAY && !(self.spawnflags & MON_SPAWN_NOGFX)) + spawn_tfog(self.origin); + } + + //---------------------------------------------------------------------- + // Hell Knights can be setup to point at a target and fire lightning + // This uses the magicB attack by ID software that was never used + // When the Hell Knight recieves damage from the player or triggered + // will revert back to normal walking/talking/fighting monster! + // ** Has unique use/think function + //---------------------------------------------------------------------- + if (self.classtype == CT_MONHELLK && self.spawnflags & MON_POINT_KNIGHT) { + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // statue function + return; + } + + //---------------------------------------------------------------------- + // Knights, Hell Knights, Golems and Gargoyles can start as statues + // They are frozen in an selected pose and wake up on trigger + // Have different skin, high pain resistance and stone gibs! + // Added double check for statue spawnflag, just in case + // ** Has unique use/think function + //---------------------------------------------------------------------- + if (self.spawnstatue && self.spawnflags & MON_STATUE) { + self.takedamage = DAMAGE_NO; // No damage till wakeup + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // statue function + return; + } + + //---------------------------------------------------------------------- + // Start in special standby mode with a blue halo glowing shield + // Will wait for a trigger before reverted back to normal gameplay + // ** Has unique use/think function + //---------------------------------------------------------------------- + if (self.classtype == CT_MONSEEKER && self.spawnflags & MON_SEEK_SHIELD) { + self.takedamage = DAMAGE_NO; // No damage till wakeup + self.nextthink = time + 0.1 + random()*0.5; + self.think = self.th_stand; // statue function + return; + } + + //---------------------------------------------------------------------- + // Once the skull wizard is setup on the ground, phase out body + //---------------------------------------------------------------------- + if (self.classtype == CT_MONSKULLW && self.bodyphased == MONAI_SKULLWINVIS) { + self.takedamage = DAMAGE_NO; + self.solid = SOLID_NOT; + setmodel(self,""); + } + //---------------------------------------------------------------------- + // No more spawn exception check for targets + monster_targets(); +}; + +//---------------------------------------------------------------------- +// Setup bounding box for monster (based on types) +//---------------------------------------------------------------------- +void() monster_bbox = +{ + if (self.bboxtype == BBOX_CUSTOM) return; + else if (self.bboxtype == BBOX_TINY) + // Lost Soul, Scorpion, Spider, Voreling + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 16'; } + else if (self.bboxtype == BBOX_SHORT) + // Player, Death Guards, Knights, Crossbow Knights, + // Army, Army_Rocket, Army_Grenade, Army_Plasma, Jim + // Zombie, Poison Zombie, Zombie Knight + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 32'; } + else if (self.bboxtype == BBOX_TALL) + // Hell Knight, Death Knight, Fury Knight, Sergeant + // Enforcer, Defender, Eliminator, Pyro, Centurion + // Skull Wizard, Wizard, Gargoyles, Tarbaby, Wraith + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 40'; } + else if (self.bboxtype == BBOX_WIDE) + // Demon, Ogre, Hunter Ogre, _Mace, _Hammer, Shalrath + { self.bbmins = '-24 -24 -24'; self.bbmaxs = '24 24 40'; } + else if (self.bboxtype == BBOX_GIANT) + // Drole, Minotaur, Floyd + { self.bbmins = '-24 -24 -24'; self.bbmaxs = '24 24 64'; } + else if (self.bboxtype == BBOX_MASSIVE) + // Shambler, ID Ogre + { self.bbmins = '-32 -32 -24'; self.bbmaxs = '32 32 64'; } + + // Some monsters are custom sizes + else if (self.bboxtype == BBOX_FLAT) + { self.bbmins = '-24 -24 -24'; self.bbmaxs = '24 24 22'; } + else if (self.bboxtype == BBOX_DOG) + { self.bbmins = '-20 -20 -24'; self.bbmaxs = '20 20 16'; } + else if (self.bboxtype == BBOX_FISH) + { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 24'; } + else if (self.bboxtype == BBOX_FISHS) + { self.bbmins = '-12 -12 -14'; self.bbmaxs = '12 12 14'; } + else if (self.bboxtype == BBOX_EEL) + { self.bbmins = '-16 -16 -16'; self.bbmaxs = '16 16 16'; } + else if (self.bboxtype == BBOX_HYDRA) + { self.bbmins = '-20 -20 -16'; self.bbmaxs = '20 20 16'; } + else if (self.bboxtype == BBOX_SHADE) + { self.bbmins = '-64 -64 -24'; self.bbmaxs = '64 64 64'; } + else if (self.bboxtype == BBOX_GOLEM) + { self.bbmins = '-28 -28 -24'; self.bbmaxs = '28 28 80'; } + else if (self.bboxtype == BBOX_ARMAGON) + { self.bbmins = '-48 -48 -24'; self.bbmaxs = '48 48 84'; } + else if (self.bboxtype == BBOX_WILLY) + { self.bbmins = '-32 -32 -24'; self.bbmaxs = '32 32 5'; } + else if (self.bboxtype == BBOX_WYRM) + { self.bbmins = '-112 -112 -24'; self.bbmaxs = '112 112 112'; } + else if (self.bboxtype == BBOX_RYU) + { self.bbmins = '-56 -56 -24'; self.bbmaxs = '56 56 56'; } + else if (self.bboxtype == BBOX_VERMIS) + { self.bbmins = '-64 -64 -512'; self.bbmaxs = '64 64 256'; } + else if (self.bboxtype == BBOX_CYBER) + { self.bbmins = '-20 -20 -36'; self.bbmaxs = '20 20 74'; } + else if (self.bboxtype == BBOX_ANACONDA) + { self.bbmins = '-32 -32 -16'; self.bbmaxs = '32 32 174'; } + + // default bounding box = TALL + else { self.bbmins = '-16 -16 -24'; self.bbmaxs = '16 16 40'; } +}; + +/*====================================================================== + walkmonster_start + - Main entry point for ALL monster routines +======================================================================*/ +void() monster_start = { + self.flags = FL_MONSTER; // Always reset this flag + self.skin_override = self.skin; // Save for later + self.frame_override = self.frame; + + // Check for spawning conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Warning if effects flag is active before spawning + if (self.effects) { + dprint("\b[MONSTER]\b Effects flag active\n"); + self.savedeffects = self.effects; + } + // Reset effects flag because some engines will show effects + // This is especially obvious for delay spawned monsters + self.effects = 0; + + if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); + + self.oldorigin = self.origin; // Save origin + self.max_health = self.health; // Save max health + if (!self.gibhealth) self.gibhealth = 0 - self.health; // Default gib health + if (self.turrethealth < 0 || self.turrethealth > 1) self.turrethealth = 0.5; + + // Default attack function and class group + if (!self.th_checkattack) self.th_checkattack = CheckAttack; + if (!self.classgroup) self.classgroup = CG_MONSTERS; + + // Setup bounding box based on presets + monster_bbox(); + // Cannot have multiple upgrade restrictions on monsters + remove_duplicate_upgrades(); + + // Cannot delay spawn a monster if nothing can trigger it!?! + if (self.spawnflags & MON_SPAWN_DELAY && self.targetname == "") { + dprint("\b[MONSTER]\b Cannot delay spawn without targetname!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Check for Axe / Shotgun upgrade monster exceptions? + // Don't add these kind of monster to the count until spawned + if (self.upgrade_axe || self.upgrade_ssg || self.upgrade_lg) { + if ( !(self.spawnflags & MON_SPAWN_DELAY) ) { + dprint("\b[MONSTER]\b need spawn delay for axe/shotgun/lg\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + // make sure the monster has no nomonstercount exceptions + if (self.nomonstercount) self.nomonstercount = 0; + } + else { + // Allow mappers to spawn monsters that don't affect monster count + // I know this can be a dangerous if used incorrectly, but good for statues + if (!self.nomonstercount) total_monsters = total_monsters + 1; + else { + dprint("\b[MONSTER]\b ("); dprint(self.targetname); + dprint(") - no monster count\n"); + } + } + + //---------------------------------------------------------------------- + // Detect monster armour map hack + //if (self.armorvalue || self.armortype) { + // This hack really should be stopped, no point upsetting mappers at this point + // self.armorvalue = self.armortype = 0; + // dprint("\b[MAPHACKS]\b Using armor on monsters, use health key instead!\n"); + //} + + if (self.spawnflags & MON_SPAWN_DELAY) { + self.mindex2 = self.modelindex; + setmodel(self, string_null); + self.solid = SOLID_NOT; // No world interaction + self.use = monster_spawn; // Wait for trigger + + if (developer > 0) { + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel(self, MODEL_BROKEN); + if (self.nomonstercount == 1) self.skin = SPNMARK_GREEN; + else self.skin = SPNMARK_BLUE; + self.frame = 0; + } + } + else { + // Variable start delay on all monsters to reduce packet errors + self.nextthink = time + 0.1 + random()*0.4; + self.think = monster_spawn; + } +}; + +//====================================================================== +// Map hacks are not supported in this MOD +// There is no use in pretending otherwise! +//====================================================================== +void() walkmonster_start_go = { remove(self); return; }; +void() flymonster_start_go = { remove(self); return; }; +void() swimmonster_start_go = { remove(self); return; }; + +/*====================================================================== +/*QUAKED monster_x (1 0 0) (x y z) (x y z) AMBUSH x x NOSIGHT NOIDLE NOGFX STARTOFF ANGRY Not_Easy Not_Normal Not_Hard Not_DM +XXX, x health points. +-------- KEYS -------- +targetname : monster/trigger name +target : Starting position or path_corner to walk towards (always define) +target2 : Additional trigger function (need target to be defined as well) +angrytarget : something (monster/player) to get angry at once spawned +deathtarget : entity to trigger upon death (useful if target field already in use) +health : Override default health settings +exactskin : Override default skin selection of 0 (no error checking) +upgrade_ssg : 1 = will only spawn if shotgun upgrade active on server +upgrade_axe : 1 = will only spawn if axe upgrade active on server +upgrade_lg : 1 = will only spawn if lightning gun upgrade active on server +nomonstercount : will not be included in any monster count functionality +infightextra : Damage multiplier for infighting damage +pain_ignore : 1 = Ignore pain when hit by other monsters +noinfighting : Will not react to any infighting (it can look stupid) +no_liquiddmg : Blocks all liquid (slime/lava) damage checks +no_zaware : All Z Aware projectiles will be disabled +bboxtype : Change bbox 1=Tiny,4=Short,5=Tall,7=Wide,8=Giant,10=Massive +gibondeath : 1 = always explode in a shower of gibs on death +bodyfadeaway : Time (secs) before body/head will fade away (default=0) +movespeed : -1 = no movement(turret), =0/1 free movement (default) +turrethealth : = 0.0->1.0; % of HP when monster turret is released +turrettarget : Target(s) to fire when turret % HP is released + +--- Knights --- +frame: statue frame to be frozen in. (default 44) +STATUE : Stone statue until triggered +NOTFROZEN : Will start active (works with statue spawnflag) + +--- Hell Knight --- +frame: statue frame to be frozen in. (default 73) +STATUE : Stone statue until triggered +NOTFROZEN : Will start active (works with statue spawnflag) + +--- Golem --- +frame: statue frame to be frozen in. (default 48) +STATUE : Stone statue until triggered + +--- Tarbaby --- +death_dmg : Damage on Death (def=120) +poisonous : 0=Jump attack (default, 1=Poison attack +exactskin : 0-1=Blue, 2-3=Green1, 4-5=Green2, 6-7=Green3 + +--- Skull Wizards --- +bodyphased : Spawn phased out and wait to see player +bodystatic : Prevents skull wizard from teleporting + +-------- SPAWNFLAGS -------- +AMBUSH : the monster will only wake up on seeing the player, not by another monster +NOSIGHT : No sight sound +NOIDLE : No idle sound +NOGFX : No spawn effect or sound when triggered +STARTOFF : Trigger Spawn +ANGRY : Trigger Spawn angry at the player +-------- NOTES -------- +XXX, x health points. +======================================================================*/ + + +// if (world.devdata & DEV_AMMO_N_HEALTH) sendmonsterdevdata(self); +void(entity e) sendmonsterdevdata { + if (!world.deventity) return; + + world.deventity.enemyhealth = world.deventity.enemyhealth + e.health; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/monsters_drake.qc b/QC_other/QC_keep/monsters_drake.qc new file mode 100644 index 00000000..c54f736c --- /dev/null +++ b/QC_other/QC_keep/monsters_drake.qc @@ -0,0 +1,66 @@ +//- - - - - - - - - +// Set contents of monster's purse. +void(float loop, float drop_chance, float gem_chance) monster_purse = +{ + self.purse = '0 0 0'; + self.purse_z = parms_pack (loop, drop_chance * 100, gem_chance * 100); + while (loop > 0) + { + if (random() < drop_chance) + { + if (random() < gem_chance) + self.purse_y = self.purse_y + 1; // Gem + else + self.purse_x = self.purse_x + 1; // Coin + } + loop = loop - 1; + } +}; + +void() monster_null = +{ + //Burn_Null (self); // Remove any flames burning on self. + // FIXME: This next one shouldn't be called here. (Check wrath*.qc) + //Pets_Free (self); // In case of sudden removal, unlink all pets. + +// Don't let other entities activate corpse as it decays. +// self.solid = SOLID_NOT; + self.use = self.touch = SUB_Null; + self.targetname = ""; + +// Eliminate any possibility of taking more damage. + self.takedamage = DAMAGE_NO; // So corpse cannot be gibbed. + +// Removal sets entity's origin at '0 0 0', and C physics code may play +// splashing sound in the process. Preset entity's water stats at origin +// now it won't splash when (re)moved. + //if (pco <= CONTENT_WATER) + // {self.watertype = pco; self.waterlevel = 1;} + //else + // {self.watertype = CONTENT_EMPTY; self.waterlevel = pco;} +}; + +//================ +// monster_remove +// +// Removes a dead monster from the game, freeing the edict it used. +// Useful for speeding up gameplay. +//================ +void() monster_remove = +{ +// +// SoE: Indian summer requires a custom engine, and all that I know of, +// except Acquire's version of software WinQuake, support alpha/transparency. + // Fade into nothing. Requires engine that supports transparent + // entities, such as DarkPlaces, or else it vanishes without fading. + monster_null (); + if (!self.alpha) + self.alpha = 1; + self.nextthink = time + 0.1; + self.think = monster_fade; +// +//- - - - - - - - - +// DISABLED - Code for standard Quake. +// self.think = monster_erase; +// monster_erase (); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/part_emitter.qc b/QC_other/QC_keep/part_emitter.qc new file mode 100644 index 00000000..2656a640 --- /dev/null +++ b/QC_other/QC_keep/part_emitter.qc @@ -0,0 +1,1351 @@ +/*====================================================================== + Particle EMITTER functions +======================================================================*/ +float(entity pe_ent) misc_particle_style = +{ + pe_ent.start_delay = 1 + (random()*2); // Particle emitter start delay (default) + pe_ent.spr_frame = 1; // Use all sprite frames (Light/Dark) + pe_ent.dpp_name = ""; // DP particle effect name + pe_ent.dpp_wait = 0.1; // Defautlt timer + pe_ent.dpp_rnd = 1; // Random time multiplier + pe_ent.dpp_vel = '0 0 0'; // Velocity direction of particles + pe_ent.part_movetype = MOVETYPE_NOCLIP; + + //---------------------------------------------------------------------- + // Portal Gate + //---------------------------------------------------------------------- + if (pe_ent.part_style == PARTICLE_STYLE_PORTAL) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.spr_frame = 3; // Dark frames + pe_ent.part_limit = 100; // High Amount of particles + pe_ent.part_life = 3; // Long life time + pe_ent.part_ofs = '0 0 0'; // No change + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; + + // If the angle is up or down then it is a special case + if (pe_ent.angles_y == -1) { + pe_ent.part_vel = '0 0 20'; // UP direction + pe_ent.dpp_name = DPP_PORTALUP; // particles flying up + } + else if (pe_ent.angles_y == -2) { + pe_ent.part_vel = '0 0 -20'; // DOWN direction + pe_ent.dpp_name = DPP_PORTALDOWN; // smoke falling down + } + else { + // Setup DP portal effects volume size based on initial emitter angle + if (pe_ent.angles_y == 90 || pe_ent.angles_y == 270) { + if (!pe_ent.part_vol) pe_ent.part_vol = '32 0 48'; // Volume (X/Y/Z) + pe_ent.dpp_name = DPP_PORTALSIDE; + } + else { + if (!pe_ent.part_vol) pe_ent.part_vol = '0 32 48'; // Volume (X/Y/Z) + pe_ent.dpp_name = DPP_PORTALFRONT; // default direction + } + + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.angles); + pe_ent.part_vel = v_forward * 20; // Slow speed away from portal + } + + if (!pe_ent.part_velrand) pe_ent.part_velrand = '10 10 4'; // More X/Y wobble + if (!pe_ent.wakeup_dist) pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 4; // High timer (runs all the time) + if (!pe_ent.spawn_base) pe_ent.spawn_base = 0.1; // Fast Spawn rate + if (!pe_ent.spawn_rand) pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_vel = normalize(pe_ent.part_vel); // Particle direction + } + //---------------------------------------------------------------------- + // Spiral Jumppad pattern + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_JUMPPAD) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 100; // High Amount of particles + pe_ent.part_life = 3; // Long life time + pe_ent.part_ofs = '0 0 0'; // Start below emitter origin + pe_ent.part_velbase = '0 0 12'; // Always go upwards + pe_ent.part_vel = '0 0 32'; // UP direction + pe_ent.part_velrand = '8 8 0'; // Slight wobble + pe_ent.part_vol = '24 24 0'; // Volume around circle pad + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // inside circle volume + pe_ent.wakeup_dist = 1024; // Long range distance + pe_ent.wakeup_timer = 2; // High timer (runs all the time) + pe_ent.spawn_base = 0.05; // Average Spawn rate + pe_ent.spawn_rand = 0.05; // Spawn rate randomness + pe_ent.dpp_name = DPP_JUMPPAD; // streaming up + } + //---------------------------------------------------------------------- + // Circular floor pattern (triggered) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FCIRCLE) { + pe_ent.spr_name1 = PART_TORCH1; + pe_ent.spr_name2 = PART_TORCH2; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 64; // High Amount of particles + pe_ent.part_life = 5; // Long life time + pe_ent.part_ofs = '0 0 1'; // Slightly off floor + pe_ent.part_vel = '0 0 12'; // Slowly move upwards + pe_ent.part_velrand = '4 4 0'; // Slight wobble + // Circle radius/rotation degrees + if (CheckZeroVector(pe_ent.pemit_source.part_vol)) pe_ent.part_vol = '56 17 0'; + pe_ent.part_veltype = PARTICLE_ORIGIN_RANDCIRCLE; + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 0.5; // 4x timer + // Fast spawn rate and randomness + if (!pe_ent.pemit_source.spawn_base) pe_ent.spawn_base = 0.1; // Fast Spawn rate + if (!pe_ent.pemit_source.spawn_rand) pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_FCIRCLE; // Circular floor pattern + pe_ent.dpp_rnd = 0.2; // Random time multiplier + } + //---------------------------------------------------------------------- + // Forcefield + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FFIELD) { + if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_YELLOW) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_YELLOW; + pe_ent.spr_name3 = PART_DOTMED_YELLOW; + pe_ent.dpp_name = DPP_FFIELDPARTY; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_GREEN) { + pe_ent.spr_name1 = PART_DOTSML_LGREEN; + pe_ent.spr_name2 = PART_DOTSML_GREEN; + pe_ent.spr_name3 = PART_DOTMED_GREEN; + pe_ent.dpp_name = DPP_FFIELDPARTG; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_RED) { + pe_ent.spr_name1 = PART_DOTSML_GREY; + pe_ent.spr_name2 = PART_DOTSML_RED; + pe_ent.spr_name3 = PART_DOTMED_RED; + pe_ent.dpp_name = DPP_FFIELDPARTR; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_BLUE) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTMED_BLUE; + pe_ent.dpp_name = DPP_FFIELDPARTB; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_PURPLE) { + pe_ent.spr_name1 = PART_DOTSML_PURP; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTMED_PURP; + pe_ent.dpp_name = DPP_FFIELDPARTP; + } + else if (pe_ent.pemit_source.spr_frame == PARTICLE_BURST_FIRE) { + pe_ent.spr_name1 = PART_TORCH1; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTMED_GREY; + pe_ent.dpp_name = DPP_FFIELDPARTY; + } + else { + pe_ent.spr_name1 = PART_DOTSML_WHITE; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTMED_GREY; + pe_ent.dpp_name = DPP_FFIELDPARTW; + } + + // reset particle sprite frame range to all + pe_ent.spr_frame = 0; + + // Particle quantity should be low, allow customization for volume size + if (!pe_ent.pemit_source.part_limit) pe_ent.part_limit = 25; + else pe_ent.part_limit = pe_ent.pemit_source.part_limit; + if (!pe_ent.pemit_source.part_life) pe_ent.part_life = 2; + else pe_ent.part_life = pe_ent.pemit_source.part_life; + if (!pe_ent.pemit_source.part_ofs) pe_ent.part_ofs = '0 0 0'; + else pe_ent.part_ofs = pe_ent.pemit_source.part_ofs; + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; + if (!pe_ent.part_velrand) pe_ent.part_velrand = '4 4 4'; + // The volume and direction really need to be set before the + // emitter is setup because the volume maybe switched off + if (CheckZeroVector(pe_ent.pemit_source.part_vol)) pe_ent.part_vol = '8 8 8'; + else pe_ent.part_vol = pe_ent.pemit_source.part_vol; + if (CheckZeroVector(pe_ent.pemit_source.part_vel)) pe_ent.part_vel = '0 0 4'; + else pe_ent.part_vel = pe_ent.pemit_source.part_vel; + + if (!pe_ent.pemit_source.wakeup_dist) pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 4; // High timer (runs all the time) + if (!pe_ent.pemit_source.spawn_base) pe_ent.spawn_base = 0.05; // Fast Spawn rate + if (pe_ent.spawn_base < 0.01) pe_ent.spawn_base = 0.01; // Need minimum + if (!pe_ent.pemit_source.spawn_rand) pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_vel = pe_ent.part_vel; + pe_ent.dpp_wait = 0.01; + pe_ent.dpp_rnd = 0.1; + } + + //====================================================================== + // Book Phase 1 - closed + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_BOOK) { + pe_ent.spr_name1 = PART_BOOKRUNE1; + pe_ent.spr_name2 = PART_BOOKRUNE2; + if (random()<0.5) pe_ent.spr_name3 = PART_BOOKRUNE1; + else pe_ent.spr_name3 = PART_BOOKRUNE2; + pe_ent.part_limit = 3; // Very Low + pe_ent.part_life = 7; // Long Life + pe_ent.part_ofs = '0 0 10'; // Top of Book + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_velrot = 45; // Velocity rotation - y + random(y) + pe_ent.part_vol = '1 1 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Close range distance + pe_ent.wakeup_timer = 8; // High timer + pe_ent.spawn_base = 2; // Slow (runs all the time) + pe_ent.spawn_rand = 1; // Spawn rate randomness + if (pe_ent.pemit_source.style == MISCBOOK_BLUE) pe_ent.dpp_name = DPP_BOOKBLUE; + else if (pe_ent.pemit_source.style == MISCBOOK_RED) pe_ent.dpp_name = DPP_BOOKRED; + else pe_ent.dpp_name = DPP_BOOKGOLD; + pe_ent.dpp_wait = 1; // Slow timer + pe_ent.dpp_rnd = 2; // Long pause + } + //---------------------------------------------------------------------- + // Book Phase 2 - open + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_OPENBOOK) { + if (random()<0.5) pe_ent.spr_name1 = PART_BOOKRUNE1; + else pe_ent.spr_name1 = PART_BOOKRUNE2; + + // Setup particle colour based on book type + if (pe_ent.pemit_source.style == MISCBOOK_BLUE) { + if (random() < 0.5) pe_ent.spr_name2 = PART_DOTMED_BLUE; + else pe_ent.spr_name2 = PART_DOTSML_BLUE; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.dpp_name = DPP_OPENBOOKBLUE; + } + else if (pe_ent.pemit_source.style == MISCBOOK_RED) { + if (random() < 0.5) pe_ent.spr_name2 = PART_DOTMED_RED; + else pe_ent.spr_name2 = PART_DOTSML_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_OPENBOOKRED; + } + else { + if (random() < 0.5) pe_ent.spr_name2 = PART_DOTMED_YELLOW; + else pe_ent.spr_name2 = PART_DOTSML_YELLOW; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_OPENBOOKGOLD; + } + pe_ent.part_limit = 30; // Average + pe_ent.part_life = 7; // Long Life + pe_ent.part_ofs = '0 0 4'; // Pages of Book + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_velrot = 45; // Velocity rotation - y + random(y) + pe_ent.part_vol = '8 8 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Close range distance + pe_ent.wakeup_timer = 4; // High timer + pe_ent.spawn_base = 0.1; // Fast (particles) + pe_ent.spawn_rand = 0.3; // Spawn rate randomness + pe_ent.dpp_wait = 0.5; // Fast timer + pe_ent.dpp_rnd = 2; // Long pause + } + //====================================================================== + // Electric Beam Particle Stream (code triggered) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_ELECTRIC) { + pe_ent.spr_name1 = PART_DOTMED_BLUE; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_BLUE; + pe_ent.part_limit = 100; // Maximum particles + pe_ent.part_life = 1; // Short Lifetime + pe_ent.part_ofs = '0 0 0'; // center of target object + pe_ent.part_vel = '50 0 0'; // Speed of particles + pe_ent.part_velrand = '0 0 16'; // Vertical wobble + pe_ent.part_vol = '8 8 8'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 0.2; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_ELECTRIC; // directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + } + //---------------------------------------------------------------------- + // Torches Flames (slow start) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FLAMET) { + pe_ent.start_delay = 3 + (random()*8); + pe_ent.spr_name1 = PART_TORCH1; // Embers - Red/Yellow + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 8; // Minimal amount of particles + pe_ent.part_life = 2; // Short Life + pe_ent.part_ofs = '0 0 12'; // Top of wood + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_vol = '1 1 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + if (pe_ent.pemit_source.wakeup_dist < 1) pe_ent.wakeup_dist = 384; + else pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + if (pe_ent.pemit_source.wakeup_timer < 1) pe_ent.wakeup_timer = 8; + else pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.25; // Spawn rate base (runs all the time) + pe_ent.spawn_rand = 0.25; // Spawn rate randomness + pe_ent.dpp_name = DPP_FLAMET; // smoke and particles floating up + pe_ent.dpp_wait = 1; // Slow timer + } + //---------------------------------------------------------------------- + // Small Flames (slow start) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FLAMES) { + pe_ent.start_delay = 3 + (random()*8); + pe_ent.spr_name1 = PART_TORCH1; // Embers - Red/Yellow + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 8; // Minimal amount of particles + pe_ent.part_life = 2; // Short Life + pe_ent.part_ofs = '0 0 0'; // Bottom of flame + pe_ent.part_vel = '0 0 10'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_vol = '1 1 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + if (pe_ent.pemit_source.wakeup_dist < 1) pe_ent.wakeup_dist = 384; + else pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + if (pe_ent.pemit_source.wakeup_timer < 1) pe_ent.wakeup_timer = 6; + else pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.25; // Spawn rate base (runs all the time) + pe_ent.spawn_rand = 0.25; // Spawn rate randomness + pe_ent.dpp_name = DPP_FLAMES; // smoke and particles floating up + pe_ent.dpp_wait = 1; // Slow timer + } + //---------------------------------------------------------------------- + // Large Flames (high particle count) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_FLAMEL) { + pe_ent.spr_name1 = PART_TORCH1; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 100; // Large amount of active particles + if (pe_ent.pemit_source.part_life < 1) pe_ent.part_life = 8; + else pe_ent.part_life = pe_ent.pemit_source.part_life; + pe_ent.part_ofs = '0 0 0'; // Bottom of flame + pe_ent.part_vel = '0 0 12'; // Fly up + pe_ent.part_velrand = '4 4 0'; // Slight wobble + pe_ent.part_vol = '4 4 0'; // Volume (X/Y/Z) + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + if (pe_ent.pemit_source.wakeup_dist < 1) pe_ent.wakeup_dist = 768; + else pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + if (pe_ent.pemit_source.wakeup_timer < 1) pe_ent.wakeup_timer = 1; + else pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.05; // Frequent (runs all the time) + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_name = DPP_FLAMEL; // smoke and particles floating up + } + //---------------------------------------------------------------------- + // Skill Particle Stream (triggered) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SKILL) { + pe_ent.spr_name1 = PART_DOTMED_RED; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_RED; + pe_ent.part_limit = 35; // Maximum particles + pe_ent.part_life = 2; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + // The angle of the particle entity is using the ANGLE key + makevectors(pe_ent.pemit_source.angles); + pe_ent.part_vel = v_forward * 10; // Slow speed away from skill column + pe_ent.part_vol = '4 4 4'; // Volume (X/Y/Z) + pe_ent.part_velrand = '4 4 8'; // Volume wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Long range distance + pe_ent.wakeup_timer = 1; // Small change on distance timer + pe_ent.spawn_base = 0.01; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + pe_ent.dpp_name = DPP_SKILLPILLAR; // Directional particle stream + pe_ent.dpp_rnd = 0; // NO Random time multiplier + pe_ent.dpp_vel = normalize(v_forward); // Particle direction + } + //---------------------------------------------------------------------- + // Particles raising up around an altar + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_ALTAR) { + if (pe_ent.pemit_source.cnt == 1) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_ALTARGREY; // floating upwards + } + else { + pe_ent.spr_name1 = PART_DOTMED_RED; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_RED; + pe_ent.dpp_name = DPP_ALTARRED; // floating upwards + } + pe_ent.part_limit = 100; // Maximum particles + pe_ent.part_life = 5; // Long life + pe_ent.part_ofs = '0 0 0'; // center of target object + if (CheckZeroVector(pe_ent.pemit_source.part_vel)) pe_ent.part_vel = '0 0 12'; + pe_ent.part_velrand = '4 4 12'; // Slight wobble + pe_ent.part_vol = '64 64 0'; // Volume (X/Y/Z) + if (pe_ent.pemit_source.t_length > 0) + pe_ent.part_vol_x = pe_ent.pemit_source.t_length; + if (pe_ent.pemit_source.t_width > 0) + pe_ent.part_vol_y = pe_ent.pemit_source.t_width; + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Close range distance + pe_ent.wakeup_timer = 4; // High timer + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + } + //---------------------------------------------------------------------- + // DP ONLY - velocity directional smoke + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SMOKE) { + pe_ent.dpp_only = TRUE; + if (pe_ent.pemit_source.exactskin == 0) pe_ent.dpp_name = DPP_VELSMOKEGREY1; + else if (pe_ent.pemit_source.exactskin == 1) pe_ent.dpp_name = DPP_VELSMOKEGREY2; + else if (pe_ent.pemit_source.exactskin == 2) pe_ent.dpp_name = DPP_VELSMOKEWHITE; + else if (pe_ent.pemit_source.exactskin == 3) pe_ent.dpp_name = DPP_VELSMOKETOXIC; + else if (pe_ent.pemit_source.exactskin == 4) pe_ent.dpp_name = DPP_VELSMOKEGREEN; + else if (pe_ent.pemit_source.exactskin == 5) pe_ent.dpp_name = DPP_VELSMOKEPURPLE; + else if (pe_ent.pemit_source.exactskin == 6) pe_ent.dpp_name = DPP_VELSMOKERED; + else if (pe_ent.pemit_source.exactskin == 7) pe_ent.dpp_name = DPP_VELSMOKEFIRE; + pe_ent.dpp_rnd = pe_ent.pemit_source.delay; + pe_ent.dpp_wait = pe_ent.pemit_source.wait; + pe_ent.dpp_vel = pe_ent.pemit_source.movedir * pe_ent.pemit_source.height; + } + //====================================================================== + // Items + //====================================================================== + else if (pe_ent.part_style == PARTICLE_STYLE_RESPAWN) { + pe_ent.start_delay = 0.1; // Particle emitter start delay + pe_ent.spr_name1 = PART_DOTSML_YELLOW; + pe_ent.spr_name2 = PART_DOTSML_GREY; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 25; // Variable, depends on spawn rate + pe_ent.part_life = 1; // Short life time + pe_ent.part_ofs = '0 0 1'; // Custom for each item + pe_ent.part_vel = '0 0 10'; // Slowly move upwards + pe_ent.part_vol = '16 16 0'; // Flat base of model + pe_ent.part_velrand = '4 4 6'; // Slight wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_VOL; // Inside volume + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.05; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_RESPAWN; // Particles floating up, starts slow + pe_ent.dpp_rnd = 0; // NO Random time multiplier + } + //---------------------------------------------------------------------- + // Items - Mega Health + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_MEGAH) { + pe_ent.spr_name1 = PART_DOTSML_WHITE; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 3.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to the top of the key + pe_ent.part_vel = '12 12 4'; // Speed of particles outwards + pe_ent.part_velrand = '0 0 8'; // Slight wobble + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.05; // Fast Spawn rate + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_name = DPP_MEGAH; // Particles drifting out from center + } + //---------------------------------------------------------------------- + // Item - Armor (Green/Yellow/Red) + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_ARMOR) { + if (pe_ent.pemit_source.items & IT2_ARMOR1) { + pe_ent.spr_name1 = PART_DOTSML_LGREEN; + pe_ent.spr_name2 = PART_DOTMED_LGREEN; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_ARMOR1; // Green particles + smoke + } + else if (pe_ent.pemit_source.items & IT2_ARMOR2) { + if (pe_ent.pemit_source.spawnflags & ARMOR_BLUE) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTMED_BLUE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.dpp_name = DPP_ARMOR2BLUE;// Blue particles + smoke + } + else { + pe_ent.spr_name1 = PART_DOTSML_YELLOW; + pe_ent.spr_name2 = PART_DOTMED_YELLOW; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.dpp_name = DPP_ARMOR2; // Yellow particles + smoke + } + } + else { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTMED_RED; + pe_ent.dpp_name = DPP_ARMOR3; // Red particles + smoke + } + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2.75; // Short life time + pe_ent.part_ofs = '0 0 24'; // Move up to middle of Suit + pe_ent.part_vel = '6 6 4'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0.2; // Spawn rate randomness + } + //---------------------------------------------------------------------- + // Item - Silver Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYSILVER) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTSML_BLUE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYSILVER; // Blue particles from top of key + } + //---------------------------------------------------------------------- + // Item - Gold Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYGOLD) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_GOLD; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYGOLD; // Yellow particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic Red Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYRED) { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYRED; // Red particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic Green Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYGREEN) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYGREEN; // Green particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic Purple Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYPURPLE) { + pe_ent.spr_name1 = PART_DOTSML_PURP; + pe_ent.spr_name2 = PART_DOTMED_PURP; + pe_ent.spr_name3 = PART_DOTSML_PURP; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYPURPLE; // Purple particles from top of key + } + //---------------------------------------------------------------------- + // Item - Generic White Key + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_KEYWHITE) { + pe_ent.spr_name1 = PART_DOTSML_GREY; + pe_ent.spr_name2 = PART_DOTMED_GREY; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 20'; // Move up to the top of the key + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_KEYWHITE; // White particles from top of key + } + //---------------------------------------------------------------------- + // Item - Sigil / Rune + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SIGIL) { + pe_ent.spr_name1 = PART_DOTMED_PURP; + pe_ent.spr_name2 = PART_DOTSML_PURP; + pe_ent.spr_name3 = PART_DOTSML_PURP; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center of sigil + pe_ent.part_vel = '8 8 16'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_SIGIL; // Purple particles from center + } + //---------------------------------------------------------------------- + // Item - Custom Backpack + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_BACKPACK) { + pe_ent.spr_name1 = PART_DOTMED_GREY; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 50; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 12'; // Middle of pack + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_BACKPACK; // Grey particles from center + } + //====================================================================== + // Artifacts + //====================================================================== + //---------------------------------------------------------------------- + // Artifact - Environmental Suit + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SUIT) { + pe_ent.spr_name1 = PART_DOTSML_GREEN; + pe_ent.spr_name2 = PART_DOTMED_GREEN; + pe_ent.spr_name3 = PART_DOTSML_YELLOW; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2.75; // Short life time + pe_ent.part_ofs = '0 0 28'; // Move up to belt of Suit (chest=32) + pe_ent.part_vel = '8 8 3'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_SUIT; // Green/Yellow particles from center + pe_ent.dpp_wait = 0.5; // Slow timer + } + //---------------------------------------------------------------------- + // Artifact - Pentagram + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_PENT) { + pe_ent.spr_name1 = PART_DOTSML_RED; + pe_ent.spr_name2 = PART_DOTMED_RED; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center of Pent + pe_ent.part_vel = '12 12 12'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_PENT; // Red/Gold particles from center + pe_ent.dpp_wait = 1; // Slow timer + } + //---------------------------------------------------------------------- + // Artifact - Shadow Ring + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SRING) { + pe_ent.spr_name1 = PART_DOTSML_YELLOW; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_GOLD; + pe_ent.part_limit = 35; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 6'; // Move up to the top of the amulet + pe_ent.part_vel = '8 8 3'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 -12'; // Move downwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0.1; // Spawn rate randomness + pe_ent.dpp_name = DPP_SRING; // White/Gold particles from center + } + //---------------------------------------------------------------------- + // Artifact - Quad Damage + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_QUAD) { + pe_ent.spr_name1 = PART_DOTMED_BLUE; + pe_ent.spr_name2 = PART_DOTSML_WHITE; + pe_ent.spr_name3 = PART_DOTSML_BLUE; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center of quad + pe_ent.part_vel = '10 10 16'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_QUAD; // Blue/White particles from center + } + //---------------------------------------------------------------------- + // Artifact - Tome of Power + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_TOMEOFP) { + pe_ent.spr_name1 = PART_DOTSML_GOLD; + pe_ent.spr_name2 = PART_DOTSML_YELLOW; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2; // Short life time + pe_ent.part_ofs = '0 0 16'; // Lower part of book + pe_ent.part_vel = '16 16 8'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 -4'; // Move downward + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.05; // Fast Spawn rate + pe_ent.spawn_rand = 0.05; // Spawn rate randomness + pe_ent.dpp_name = DPP_TOMEOFP; // Yellow particles + pe_ent.dpp_wait = 0.5; // Slow timer + } + //---------------------------------------------------------------------- + // Artifact - Sharp Shooter + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_SHARP) { + pe_ent.spr_name1 = PART_DOTMED_PURP; + pe_ent.spr_name2 = PART_DOTSML_PURP; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center + pe_ent.part_vel = '10 10 16'; // Speed of particles outwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_SHARP; // Purple particles from center + } + //---------------------------------------------------------------------- + // Artifact - Nail Piercer + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_PIERCE) { + pe_ent.spr_name1 = PART_DOTMED_PURP; + pe_ent.spr_name2 = PART_DOTSML_PURP; + pe_ent.spr_name3 = PART_DOTSML_GREY; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 1.5; // Short life time + pe_ent.part_ofs = '0 0 16'; // Move up to center + pe_ent.part_vel = '8 8 4'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_PIERCE; // Purple particles from center + } + //---------------------------------------------------------------------- + // Artifact - Wet Suit + //---------------------------------------------------------------------- + else if (pe_ent.part_style == PARTICLE_STYLE_WETSUIT) { + pe_ent.spr_name1 = PART_DOTSML_BLUE; + pe_ent.spr_name2 = PART_DOTMED_BLUE; + pe_ent.spr_name3 = PART_DOTSML_WHITE; + pe_ent.part_limit = 75; // High Amount of particles + pe_ent.part_life = 2.75; // Short life time + pe_ent.part_ofs = '0 0 28'; // Move up to belt of Suit (chest=32) + pe_ent.part_vel = '8 8 3'; // Speed of particles outwards + pe_ent.part_velbase = '0 0 12'; // Move upwards + pe_ent.part_veltype = PARTICLE_ORIGIN_CENTER; // Explosion + pe_ent.wakeup_dist = 768; // Mid range distance + pe_ent.wakeup_timer = 1; // Medium timer (runs all the time) + pe_ent.spawn_base = 0.1; // Fast Spawn rate + pe_ent.spawn_rand = 0; // Spawn rate randomness + pe_ent.dpp_name = DPP_WETSUIT; // Blue/White particles raising up + pe_ent.dpp_wait = 0.5; // Slow timer + } + //====================================================================== + // Weather System + //====================================================================== + else if (pe_ent.part_style == PARTICLE_STYLE_WEATHER) { + pe_ent.part_limit = pe_ent.pemit_source.count; + pe_ent.part_vel = '0 0 0'; + pe_ent.part_vel_z = pe_ent.pemit_source.speed; + pe_ent.part_velrand = pe_ent.pemit_source.v_angle; + pe_ent.wakeup_dist = pe_ent.pemit_source.wakeup_dist; + pe_ent.wakeup_timer = pe_ent.pemit_source.wakeup_timer; + pe_ent.spawn_base = 0.1; // Default timer + pe_ent.spawn_rand = 0; // No spawn rate randomness + } + //---------------------------------------------------------------------- + // No style defined - ERROR!!!!! + //---------------------------------------------------------------------- + else { + dprint("\b[PEMITTER]\b Style no ("); dprint(ftos(pe_ent.part_style)); + dprint(") not valid!!!"); + pe_ent.part_style = PARTICLE_STYLE_EMPTY; // empty definition + spawn_marker(pe_ent.origin, SPNMARK_YELLOW);// Visual problem + } + + // return any error conditions; 0=ERROR + return pe_ent.part_style; +}; + +//---------------------------------------------------------------------- +void(entity pe_ent) misc_particle_off = +{ + // Double check dealing with a particle emitter? + if (pe_ent.classtype != CT_PARTICLEEMIT) return; + if (pe_ent.state == STATE_OFF) return; + // The particle emitter is still being setup, remember state for later + if (pe_ent.state == STATE_SETUP) { + pe_ent.spawnflags = PARTICLE_START_OFF; + return; + } + + pe_ent.state = STATE_OFF; + pe_ent.estate = ESTATE_OFF; + // Setup a particle explosion on floor circles when they are triggered off + if (pe_ent.part_style == PARTICLE_STYLE_FCIRCLE) { + particle_ring(pe_ent.origin, '0 0 4', '4 4 16', pe_ent.part_vol_x+8, pe_ent.part_limit, pe_ent.part_life, 4 ); + particle_ring(pe_ent.origin, '0 0 4', '0 0 12', pe_ent.part_vol_x-4, pe_ent.part_limit, pe_ent.part_life, 1 ); + } +}; + +//---------------------------------------------------------------------- +void() misc_particle_use = +{ + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + // If particle still not setup toggle spawnflags instead + if (self.state == STATE_SETUP) { + if (self.spawnflags & PARTICLE_START_ON) self.spawnflags = PARTICLE_START_OFF; + else self.spawnflags = PARTICLE_START_ON; + return; + } + + // Double check for particle style setup correctly + if (self.part_style == PARTICLE_STYLE_EMPTY) return; + + // Toggle shooter on/off + if (self.state == STATE_OFF) { + self.state = STATE_ON; + self.estate = ESTATE_ON; + + // Is DP particles active?) + if (ext_dppart || self.dpp_only && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // decide between particle types + if (self.part_style == PARTICLE_STYLE_FCIRCLE) emitdpp_fcircle(); + else if (self.part_style == PARTICLE_STYLE_WEATHER) { + // Check if particle effects are available from the engine + if (!ext_dpsnow || !ext_dprain) return; + emitepp_weather(); + } + else emitdpp_particle(); + } + // Pixel goodness particles + else { + // Weather effects not supported on Fitz/QS engines + if (self.part_style == PARTICLE_STYLE_WEATHER) return; + else emit_particle(); + } + } + else misc_particle_off(self); +}; + +//---------------------------------------------------------------------- +void(entity pe_ent) misc_particle_on = +{ + // Double check dealing with a particle emitter? + if (pe_ent.classtype != CT_PARTICLEEMIT) return; + if (pe_ent.state == STATE_ON) return; + // The particle emitter is still being setup, remember state for later + if (pe_ent.state == STATE_SETUP) { + pe_ent.spawnflags = PARTICLE_START_ON; + return; + } + + pe_ent.state = STATE_OFF; + pe_ent.think = misc_particle_use; + pe_ent.nextthink = time + TIME_MINTICK; +}; + +//---------------------------------------------------------------------- +void(entity pe_ent, float partemit_style) misc_particle_update = +{ + // Double check dealing with a particle emitter? + if (pe_ent.classtype != CT_PARTICLEEMIT) return; + if (pe_ent.state == STATE_SETUP) return; + if (pe_ent.part_style == PARTICLE_STYLE_EMPTY) return; + + pe_ent.part_style = partemit_style; + if (misc_particle_style(pe_ent) == FALSE) + dprint("\b[MISC_PARTICLE]\b Error updating emitter!"); +}; + +//---------------------------------------------------------------------- +void() misc_particle_switch_on = { misc_particle_on(self); }; +void() misc_particle_switch_off = { misc_particle_off(self); }; +void() misc_particle_switch_disable = { self.state = STATE_OFF; }; + +//---------------------------------------------------------------------- +void() misc_particle_finishsetup = +{ + // Was the particle emitter setup correctly? + if (self.part_style != PARTICLE_STYLE_EMPTY) { + self.circular_angle = 0; // Starting circular angle + self.state = STATE_OFF; // Initial state + self.estate = ESTATE_OFF; + + // Setup entity state wrapper if targetname exists + if (self.targetname != "") self.use = entity_state_use; + else self.use = misc_particle_use; + self.estate_on = misc_particle_switch_on; + self.estate_off = misc_particle_switch_off; + self.estate_disable = misc_particle_switch_disable; + self.estate_use = misc_particle_use; + + // Delay start of particle emitter so if it needs to be switched off + // other functions can catch it and save switching states quickly + if (self.spawnflags & PARTICLE_START_ON) misc_particle_use(); + } +}; + +//---------------------------------------------------------------------- +void() misc_particle_delay = +{ + // If target setup, find it and store entity + if (self.target != "") self.pemit_target = find(world, targetname, self.target); + if (!self.pemit_target) self.target = ""; + + if (!self.start_delay) self.start_delay = 1 + (random()*2); + self.nextthink = time + self.start_delay; + self.think = misc_particle_finishsetup; +}; + +//---------------------------------------------------------------------- +void() misc_particletemplate = { + self.classtype = CT_PARTICLETEMP; + // make sure any sprite assets used are pre-cached ready + if (self.spr_name1 != "") precache_model(self.spr_name1); + if (self.spr_name2 != "") precache_model(self.spr_name2); + if (self.spr_name3 != "") precache_model(self.spr_name3); +}; + +//---------------------------------------------------------------------- +void() misc_particle_copytemplate = +{ + local entity fdest; + + // Cycle through list for TARGET2 template + fdest = find (world, targetname, self.target2); + while(fdest) { + if (fdest.classtype == CT_PARTICLETEMP) { + self.owner = fdest; + fdest = world; + } + else fdest = find(fdest, targetname, self.target2); + } + + // Is the particle template missing? + if (!self.owner) { + dprint("\b[MISC_PARTICLE]\b Missing target template!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Custom particle setup defined in map + self.part_style = PARTICLE_STYLE_CUSTOM; + + // Copy over all the DEFINED data from the template + // Fill in any gaps with default data (based on quad) + if (self.owner.spr_name1) self.spr_name1 = self.owner.spr_name1; + else self.spr_name1 = PART_DOTMED_BLUE; + if (self.owner.spr_name2) self.spr_name2 = self.owner.spr_name2; + else self.spr_name2 = PART_DOTSML_WHITE; + if (self.owner.spr_name3) self.spr_name3 = self.owner.spr_name3; + else self.spr_name3 = PART_DOTSML_BLUE; + + // Particle quantity, life, direction, rotation and volume + if (self.owner.part_movetype) self.part_movetype = self.owner.part_movetype; + else self.part_movetype = MOVETYPE_NOCLIP; + if (self.owner.part_limit) self.part_limit = self.owner.part_limit; + else self.part_limit = 25; + if (self.owner.part_life) self.part_life = self.owner.part_life; + else self.part_life = 1; + if (self.owner.part_ofs) self.part_ofs = self.owner.part_ofs; + else self.part_ofs = '0 0 0'; + if (self.owner.part_veltype) self.part_veltype = self.owner.part_veltype; + else self.part_veltype = PARTICLE_ORIGIN_CENTER; + if (self.owner.part_vel) self.part_vel = self.owner.part_vel; + if (self.owner.part_velbase) self.part_velbase = self.owner.part_velbase; + if (self.owner.part_velrand) self.part_velrand = self.owner.part_velrand; + if (self.owner.part_velrot) self.part_velrot = self.owner.part_velrot; + if (self.owner.part_vol) self.part_vol = self.owner.part_vol; + + // Particle spawn timing and wakeup distance + if (self.owner.wakeup_dist) self.wakeup_dist = self.owner.wakeup_dist; + else self.wakeup_dist = 1024; + if (self.owner.wakeup_timer) self.wakeup_timer = self.owner.wakeup_timer; + else self.wakeup_timer = 1; + if (self.wakeup_timer < TIME_MINTICK) self.wakeup_timer = TIME_MINTICK; + if (self.owner.spawn_base) self.spawn_base = self.owner.spawn_base; + else self.spawn_base = 0.1; + if (self.spawn_base < TIME_MINTICK) self.spawn_base = TIME_MINTICK; + if (self.owner.spawn_rand) self.spawn_rand = self.owner.spawn_rand; + else self.spawn_rand = 0; + + // Particle setup for DarkPlaces + if (self.owner.dpp_name) self.dpp_name = self.owner.dpp_name; + else self.dpp_name = ""; + if (self.owner.dpp_wait) self.dpp_wait = self.owner.dpp_wait; + else self.dpp_wait = 0.1; + if (self.dpp_wait < TIME_MINTICK) self.dpp_wait = TIME_MINTICK; + if (self.owner.dpp_rnd) self.dpp_rnd = self.owner.dpp_rnd; + else self.dpp_rnd = 0; + if (self.owner.dpp_vel) self.dpp_vel = self.owner.dpp_vel; + else self.dpp_vel = '0 0 0'; + + // Setup particle states + misc_particle_delay(); +}; + +//---------------------------------------------------------------------- +void() misc_particle_setup = +{ + // Setup Particle styles (pre-defined) + if (misc_particle_style(self) != PARTICLE_STYLE_EMPTY) + misc_particle_delay(); +}; + +//---------------------------------------------------------------------- +// Entry point for code to spawn particle emitter +// source - starting point for particles +// target - destination (can be self/world to spawn at origin) +// style - type of particle to create (check styles above) +// spawnf - spawnflag values (startoff) +//---------------------------------------------------------------------- +entity(entity pe_source, entity pe_target, float pe_style, float pe_spawnf) spawn_pemitter = +{ + local entity new_pe; + + new_pe = spawn(); + new_pe.classtype = CT_PARTICLEEMIT; + new_pe.state = STATE_SETUP; + new_pe.pemit_source = pe_source; + + if (pe_source != pe_target) new_pe.pemit_target = pe_target; + + // Setup a random number on source entity for linking + // If the source entity is deleted this number will change + gen_unique_no(self); + new_pe.entno_unique = self.entno_unique; + + // Check for bmodel origin first + if (pe_source.bsporigin) new_pe.origin = bmodel_origin(pe_source); + else new_pe.origin = pe_source.origin; + + // Move Particle emitter to source origin + setorigin(new_pe, new_pe.origin); + new_pe.part_style = pe_style; // must use global defs + new_pe.spawnflags = pe_spawnf; // spawnflags are parameters + new_pe.angles = pe_source.angles; // Copy over any angle params + + // Back through emitter function + new_pe.think = misc_particle_setup; + new_pe.nextthink = time + 0.1 + random(); + + return new_pe; +}; + +//---------------------------------------------------------------------- +void() misc_particle = +{ + if (self.spawnflags & ENT_STARTOFF) self.spawnflags = PARTICLE_START_OFF; + else self.spawnflags = PARTICLE_START_ON; + + // Default setup for any particle emitter + self.classtype = CT_PARTICLEEMIT; + self.pemit_source = self; + gen_unique_no(self); + self.state = STATE_SETUP; + // Let state of particle emitter change before finishing setup + if (self.targetname != "") self.use = misc_particle_use; + + // Custom particle setup using template? + if (self.target2 != "") { + self.nextthink = time + 0.1 + random(); + self.think = misc_particle_copytemplate; + return; + } + + // Setup any pre-defined particle types + if (self.message == "ARMOR1") { self.part_style = PARTICLE_STYLE_ARMOR; self.items2 = IT2_ARMOR1; } + else if (self.message == "ARMOR2") { self.part_style = PARTICLE_STYLE_ARMOR; self.items2 = IT2_ARMOR2; } + else if (self.message == "ARMOR3") { self.part_style = PARTICLE_STYLE_ARMOR; self.items2 = IT2_ARMOR3; } + + else if (self.message == "BOOK") self.part_style = PARTICLE_STYLE_BOOK; + else if (self.message == "ELECTRIC") self.part_style = PARTICLE_STYLE_ELECTRIC; + else if (self.message == "FCIRCLE") self.part_style = PARTICLE_STYLE_FCIRCLE; + else if (self.message == "FLAMES") self.part_style = PARTICLE_STYLE_FLAMES; + else if (self.message == "FLAMEL") self.part_style = PARTICLE_STYLE_FLAMEL; + + else if (self.message == "KEYGOLD") self.part_style = PARTICLE_STYLE_KEYGOLD; + else if (self.message == "KEYSILVER") self.part_style = PARTICLE_STYLE_KEYSILVER; + else if (self.message == "KEYRED") self.part_style = PARTICLE_STYLE_KEYRED; + else if (self.message == "KEYGREEN") self.part_style = PARTICLE_STYLE_KEYGREEN; + else if (self.message == "KEYPURPLE") self.part_style = PARTICLE_STYLE_KEYPURPLE; + else if (self.message == "KEYWHITE") self.part_style = PARTICLE_STYLE_KEYWHITE; + else if (self.message == "MEGAH") self.part_style = PARTICLE_STYLE_MEGAH; + else if (self.message == "PENT") self.part_style = PARTICLE_STYLE_PENT; + else if (self.message == "PORTAL") self.part_style = PARTICLE_STYLE_PORTAL; + + else if (self.message == "JUMPPAD") self.part_style = PARTICLE_STYLE_JUMPPAD; + else if (self.message == "QUAD") self.part_style = PARTICLE_STYLE_QUAD; + + else if (self.message == "SIGIL") self.part_style = PARTICLE_STYLE_SIGIL; + else if (self.message == "ALTAR") self.part_style = PARTICLE_STYLE_ALTAR; + else if (self.message == "SKILL") self.part_style = PARTICLE_STYLE_SKILL; + else if (self.message == "SRING") self.part_style = PARTICLE_STYLE_SRING; + else if (self.message == "SUIT") self.part_style = PARTICLE_STYLE_SUIT; + else { + dprint("\b[MISC_PARTICLE]\b Missing particle style!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + return; + } + + // Back through emitter function + self.nextthink = time + 0.1 + random(); + self.think = misc_particle_setup; +}; + +//---------------------------------------------------------------------- +void() misc_particle_burst_use = +{ + particle_explode(self.origin+self.part_ofs, self.count, self.part_life, self.part_style, self.part_movetype); + // Check for temporary continuous mode + if (self.waitmin > 0) { + if (self.pausetime == 0) { + if (!self.waitmin2) self.waitmin2 = 0.1; + self.pausetime = time + self.waitmin; + } + if (self.pausetime > time) { + self.think = misc_particle_burst_use; + self.nextthink = time + self.waitmin2; + } + else self.pausetime = 0; + } +}; + +//---------------------------------------------------------------------- +// This is also used by item_custom in items.qc +//---------------------------------------------------------------------- +void() misc_particle_burst_setup = +{ + // Read tcount from entity, but it cannot be used for constant emitters + // The finish particle system will decrease the tcount directly! + if (!self.pemit_tcount) self.count = 20; + + if (!self.part_life) self.part_life = 2; + if (CheckZeroVector(self.part_ofs)) self.part_ofs = '0 0 0'; + + if (self.part_style == 1) self.part_style = PARTICLE_BURST_YELLOW; + else if (self.part_style == 2) self.part_style = PARTICLE_BURST_GREEN; + else if (self.part_style == 3) self.part_style = PARTICLE_BURST_RED; + else if (self.part_style == 4) self.part_style = PARTICLE_BURST_BLUE; + else if (self.part_style == 5) self.part_style = PARTICLE_BURST_PURPLE; + else if (self.part_style == 6) self.part_style = PARTICLE_BURST_FIRE; + else self.part_style = PARTICLE_BURST_WHITE; + + if (self.part_movetype == 3) self.part_movetype = PARTICLE_BURST_UPWARD; + else if (self.part_movetype == 4) self.part_movetype = PARTICLE_BURST_SHOCKWAVE; + else if (self.part_movetype == 5) self.part_movetype = PARTICLE_BURST_SKULLUP; + else if (self.part_movetype == 6) self.part_movetype = PARTICLE_BURST_LOSTUP; + else if (self.part_movetype == 7) self.part_movetype = PARTICLE_BURST_MINOTAUR; + else self.part_movetype = PARTICLE_BURST_CENTER; +}; + +//---------------------------------------------------------------------- +void() misc_particle_burst = +{ + // Default setup for any particle emitter + self.classtype = CT_PARTICLEEMIT; + self.pemit_source = self; + self.health = LARGE_TIMER; + + misc_particle_burst_setup(); + self.use = misc_particle_burst_use; +}; + +//---------------------------------------------------------------------- +void() misc_weather = +{ + // Setup particle emitter to start on/off + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags | PARTICLE_START_OFF; + else self.spawnflags = self.spawnflags | PARTICLE_START_ON; + + // Default setup for any particle emitter + self.classtype = CT_PARTICLEEMIT; + self.part_style = PARTICLE_STYLE_WEATHER; + self.pemit_source = self; + gen_unique_no(self); + self.state = STATE_SETUP; + + // Find out size of volume brush + InitTrigger(); + // Save the brush bounding box for later + self.bbmins = self.mins; + self.bbmaxs = self.maxs; + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin,0); + + // hide volume, no longer needed + self.solid = SOLID_NOT; + + // Setup default particle count based on volume + // - 10% of the volume size as particle count + if (!self.count) + self.count = rint((vlen(self.bbmaxs - self.bbmins)*0.1)); + + // Change for variable wind change + if (!self.speed) self.speed = 30; + self.attack_speed = time + self.speed + (random()*self.speed); + + // Setup default wind (X/Y) and vertical velocity + if (self.spawnflags & PARTICLE_WEATHER_SNOW) { + if (CheckZeroVector(self.pos1)) self.pos1 = '8 15 0'; // Mostly white + if (CheckZeroVector(self.pos2)) self.pos2 = '100 100 -100'; + } + else { + if (CheckZeroVector(self.pos1)) self.pos1 = '1 15 0'; // grey->white + if (CheckZeroVector(self.pos2)) self.pos2 = '100 100 -500'; + } + + // Particle colour range - Make sure Y > X + if (self.pos1_x > self.pos1_y) { + self.pos1_z = self.pos1_x; + self.pos1_x = self.pos1_y; + self.pos1_y = self.pos1_z; + } + // Work out range of colour + self.pos1_z = rint(self.pos1_y - self.pos1_x); + if (self.pos1_z < 1) self.pos1_z = 1; + + // Create initial wind direction + self.pos3_x = crandom() * self.pos2_x; + self.pos3_y = crandom() * self.pos2_y; + self.pos3_z = self.pos2_z; + + // Back through emitter function + self.nextthink = time + 0.1 + random(); + self.think = misc_particle_setup; +}; + +/*====================================================================== +/*QUAKED misc_particle (0 0.5 0.75) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x +A particle emitter which can be turned on/off (use function) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : destination of effect (self -> target) +target2 : name of a particle template +message : Particle style string (upper case) leave blank for custom + ARMOR1, ARMOR2, ARMOR3, BOOK, ELECTRIC, FCIRCLE, + FLAMES, FLAMEL, KEYGOLD, KEYSILVER, MEGAH, PENT, + PORTAL, QUAD, SIGIL, SKILL, SRING, SUIT +-------- SPAWNFLAGS -------- +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +A particle emitter which can be turned on/off (use function) + +//----------------------------------------------------------------------------- +/*QUAKED misc_particletemplate (0 0.5 0.75) (-8 -8 -8) (8 8 8) x +A particle emitter template +-------- KEYS -------- +targetname : target name reference for misc_particle entities +start_delay : Particle emitter start delay +spr_name1 : sprite name (progs\s_bubble_blue1.spr) +spr_name2 : sprite name (progs\s_bubble_wht.spr) +spr_name3 : sprite name (progs\ad171\s_dotmed_grey.spr) +part_movetype: Movetype of particle (def.qc for movetypes) +part_limit : Maximum amount of particles to emit at once +part_life : Life time particle is active (seconds) +part_ofs : Offset from emitter (XYZ) +part_veltype : Velocity type 1=random, 2=circular +part_vel : Velocity direction (XYZ) +part_velrand : Extra random velocity (need vel type 1) +part_velrot : Velocity rotation (Y axis only) +part_vol : Spawning volume around emitter (XYZ) +cirular_angle: Circular rotation angle +wakeup_dist : Wake up distance for particle emitter +wakeup_timer : How often to check distance check +spawn_base : Spawn rate - base value (seconds) +spawn_rand : Spawn rate - random adjustment (seconds) +dpp_name : DP particle effect name in effectinfo.txt file +dpp_wait : DP particle re-trigger timer +dpp_rnd : DP particle random multiplier for time +dpp_vel : Direction of DP particles to move towards (XYZ) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +A particle emitter template + +//----------------------------------------------------------------------------- +/*QUAKED misc_particle_burst (0 0.5 0.75) (-8 -8 -8) (8 8 8) x +A particle emitter that fires a burst +-------- KEYS -------- +targetname : Trigger Particle Emitter +part_ofs : Particle Origin Offset (def='0 0 0') +part_tcount : Particle Quantity (def=20) +part_life : Particle Life Time (def=2s) +part_style : 1=yellow, 2=green, 3=red, 4=blue, 5=purple, 6=fire, 7=white +part_movetype : 2=center, 3=up, 4=shockwave, 5=skull, 6=lost, 7=minotaur +-------- SPAWNFLAGS -------- +-------- NOTES -------- +A particle emitter that fires a burst + +//----------------------------------------------------------------------------- +/*QUAKED misc_weather (0 0.5 0.75) ? x x SILENT SNOW BLOOD SLIME STARTOFF x +A particle emitter which produces weather effects +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +count : Quantity of particles for volume +speed : Downward velocity (def=300) +v_angle : Random velocity adjustment (def=8 8 150) +wakeup_dist : how close the player needs to be for the weather to work +wakeup_timer : time to keep checking when in standby mode +-------- SPAWNFLAGS -------- +SILENT : Don't make any drip sound (good for multiple drips) +SNOW : White wispy flakes falling +BLOOD : Blood red rain +SLIME : Slime green rain +STARTOFF : Always Starts off and waits for trigger +-------- NOTES -------- +A particle emitter which produces weather effects + +======================================================================*/ diff --git a/QC_other/QC_keep/part_generate.qc b/QC_other/QC_keep/part_generate.qc new file mode 100644 index 00000000..d04aba60 --- /dev/null +++ b/QC_other/QC_keep/part_generate.qc @@ -0,0 +1,920 @@ +/*====================================================================== + Generate PARTICLES + + PRIMARY SPRITE/MODE PARTICLE EMITTER FUNCTION + - Designed for Fitz type engines (retro pixel goodness) + + DPP particle functions + - float(string effectname) particleeffectnum + - -void(entity ent, float effectnum, vector start, vector end) trailparticles + - -void(float effectnum, vector org, vector vel, float howmany) pointparticles + +======================================================================*/ +float() emit_checksource = +{ + // killtarget can easily destroy connections between entities + // Some particle emitter types rely on the source entity connection + // Quake maintains all entities in one list with a number as reference + // If an entity is deleted the entity number can be given to any new + // entity spawned. This is not a reference to the original entity but + // it is just a location in a list. + // To get around this problem any entity that spawns a particle + // emitter will generate an unique number which the emitter will + // keep track of and compare to make sure the connection is valid. + // + // If the connection is broken, destroy particle emitter + if (self.entno_unique != self.pemit_source.entno_unique) + self.part_style = PARTICLE_STYLE_EMPTY; + + if (self.part_style == PARTICLE_STYLE_EMPTY) self.state = STATE_OFF; + // Exception - respawning particle are never blocked! + else if (self.part_style != PARTICLE_STYLE_RESPAWN) { + // Has the particle emitter SOURCE been switched off? + if (self.pemit_source.estate & ESTATE_BLOCK) self.state = STATE_OFF; + } + + // Final check to see if emitter is active or not? + if (self.state == STATE_OFF) { self.estate = ESTATE_OFF; return TRUE; } + else return FALSE; +}; + +//---------------------------------------------------------------------- +void() emitdpp_particle = { + + // Check source entity and style type are valid + if (emit_checksource()) return; + + if (self.pemit_target) { + self.dpp_vel = vectoangles(self.pemit_target.origin - self.pemit_source.origin); + self.dpp_vel_z = 0; + makevectors (self.dpp_vel); + self.dpp_vel = normalize(v_forward); + } + + // Check for volume particle spawning + if (!CheckZeroVector(self.part_vol)) { + + // Check if owner is a Bmodel? (different origin location) + if (self.pemit_source.bsporigin) + self.pos1 = self.pemit_source.origin + bmodel_origin(self.pemit_source); + else self.pos1 = self.pemit_source.origin; + + self.pos1_x = self.pos1_x + ( (random()*(self.part_vol_x*2)) - self.part_vol_x); + self.pos1_y = self.pos1_y + ( (random()*(self.part_vol_y*2)) - self.part_vol_y); + self.pos1_z = self.pos1_z + ( (random()*(self.part_vol_z*2)) - self.part_vol_z); + } + else self.pos1 = self.pemit_source.origin; + + // Generate particles (DP Engine) + // DP particles are designed to go at origin, not origin+offset + pointparticles(particleeffectnum(self.dpp_name), self.pos1, self.dpp_vel, 1); + self.think = emitdpp_particle; + self.nextthink = time + self.dpp_wait + (random() * self.dpp_rnd); +}; + +//---------------------------------------------------------------------- +// Custom setup for Floor Circle particle emitter +//---------------------------------------------------------------------- +void() emitdpp_fcircle = +{ + local float loop_cnt; + local vector circle_vec, circle_org; + + // Check source entity and style type are valid + if (emit_checksource()) return; + + loop_cnt = 4; + while(loop_cnt > 0) { + loop_cnt = loop_cnt - 1; + + circle_vec = '0 0 0'; + circle_vec_y = circle_vec_y + rint(random()*360); + makevectors(circle_vec); + circle_org = self.pemit_source.origin + v_forward * self.part_vol_x; + + // Generate particles (DP Engine) around circumference + pointparticles(particleeffectnum(self.dpp_name), circle_org, self.dpp_vel, 1); + } + + // Draw bright pulse ring texture over the floor pattern + // Only draw this if the circle is the original shape + if (self.part_vol_x == 56) + pointparticles(particleeffectnum(DPP_FCIRCLE_RING), self.pemit_source.origin, '0 0 0', 1); + + self.think = emitdpp_fcircle; + self.nextthink = time + self.dpp_wait + (random() * self.dpp_rnd); +}; + +//====================================================================== +// Particle weather system +//====================================================================== +// splash animation (runs at 20fps) +void() pe_splash1 = [0, pe_splash2] {self.nextthink = time+0.05;}; +void() pe_splash2 = [1, pe_splash3] {self.nextthink = time+0.05;}; +void() pe_splash3 = [2, pe_splash4] {self.nextthink = time+0.05;}; +void() pe_splash4 = [3, pe_splash5] {self.nextthink = time+0.05;}; +void() pe_splash5 = [4, pe_splash6] {self.nextthink = time+0.05;}; +void() pe_splash6 = [5, finish_particle] {self.nextthink = time+0.05;}; + +//---------------------------------------------------------------------- +void() emitepp_weather = +{ + // Check for variable wind direction + if (self.attack_speed < time && self.speed > 0) { + self.attack_speed = time + self.speed + (random()*self.speed); + self.pos3_x = crandom() * self.pos2_x; + self.pos3_y = crandom() * self.pos2_y; + } + + // Work out random colour range + self.t_width = self.pos1_x + random()*self.pos1_z; + // Vary the count by +/- 25% of total + self.t_length = self.count * 0.75 + ((random() * 0.5) * self.count); + // Vary the wind speed by +/- 25% of total + self.pos3_z = self.pos2_z * 0.75 + ((random() * 0.5) * self.pos2_z); + + // DP volume particle system parameters + // vector mins : minimum corner of the cube + // vector maxs : maximum corner of the cube + // vector velocity : velocity of particles + // short count : number of particles + // byte color : 8bit palette color + + // Double check if engine weather systems are enabled + if (query_configflag(SVR_WEATHER)) { + // Wait for any change, slow timer + self.think = emitepp_weather; + self.nextthink = time + 2; + } else { + if (self.spawnflags & PARTICLE_WEATHER_SNOW) + te_particlesnow(self.bbmins, self.bbmaxs, self.pos3, self.t_length, self.t_width); + else te_particlerain(self.bbmins, self.bbmaxs, self.pos3, self.t_length, self.t_width); + self.think = emitepp_weather; + self.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() emit_weather_think = +{ + if (self.origin_z < (self.pos2_z-4)) { + self.movetype = MOVETYPE_NONE; + setorigin(self, self.pos2 + '0 0 12'); + setmodel(self, self.headmdl); + self.velocity = '0 0 0'; + pe_splash1(); + } + else { + self.think = emit_weather_think; + self.nextthink = time + 0.1; + } +}; + +//---------------------------------------------------------------------- +void() emit_weather = +{ + // Check source entity and style type are valid + if (emit_checksource()) return; + + // Setup next particle (loop) + self.think = emit_weather; + + // make sure player distance check is available + if (!self.enemy) self.enemy = find(world, classname, "player"); + if ( !(self.enemy.flags & FL_CLIENT) ) { + self.nextthink = time + 0.1; + return; + } + + // Is the particle emitter close to the player? + if (range_distance(self.enemy, TRUE) < self.wakeup_dist) { + + // Normal think timer, player within range + self.nextthink = time + self.spawn_base + (random()*self.spawn_rand); + + // Is there anymore particles left to spawn? + if (self.pemit_tcount < self.part_limit) { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + self.pemit_tcount = self.pemit_tcount + 1; + part.movetype = self.part_movetype; + setmodel(part, self.spr_name1); + part.headmdl = self.spr_name2; + setsize(part, VEC_ORIGIN, VEC_ORIGIN); + part.velocity_x = self.part_velrand_x * random(); + part.velocity_y = self.part_velrand_y * random(); + part.velocity_z = self.part_velrand_z * random(); + part.velocity = part.velocity + self.part_vel; + part.velocity_z = -part.velocity_z; + + // Pick a random point across the top of volume + part.pos1_x = self.pos1_x * random(); + part.pos1_y = self.pos1_y * random(); + part.pos1_z = 0; + part.pos1 = part.pos1 + self.pos2; + setorigin(part, part.pos1); + + // trace down to find travel distance + traceline (part.pos1, part.pos1 + '0 0 -4096', TRUE, self); + part.pos2 = trace_endpos; + + // Find out if any liquid in the way + if (trace_inwater) self.height = 8; + else self.count = 0; + + // Binary divide the distance to find water surface + while (self.height > 0) { + // Break out early from loop if <8 from water surface + if (fabs(part.pos2_z-part.pos1_z) < 8) self.height = 0; + // Calculate midway point between origin and endtrace + part.pos3 = part.pos1; + part.pos3_z = part.pos1_z + ((part.pos2_z - part.pos1_z)*0.5); + + // Test which half has water and shift top/bottom positions + traceline (part.pos1, part.pos3, TRUE, self); + if (trace_inwater) part.pos2 = part.pos3; + else part.pos1 = part.pos3; + // Only loop a limited amount of times + self.height = self.height - 1; + } + + // Check travel distance + part.think = emit_weather_think; + part.nextthink = time + 0.1; + + } + } + } + else { + // If no player within range of the emitter, slower think timer + self.nextthink = time + self.wakeup_timer + (random()*self.spawn_rand); + } +}; + +//---------------------------------------------------------------------- +void() emit_particle = +{ + local float randno; + local vector angle_vec; + + // Check source entity and style type are valid + if (emit_checksource()) return; + + // Setup next particle (loop) + self.think = emit_particle; + + // make sure player distance check is available + if (!self.enemy) self.enemy = find(world, classname, "player"); + if ( !(self.enemy.flags & FL_CLIENT) ) { + self.nextthink = time + 0.1; + return; + } + + // Is the particle emitter close to the player? + if (range_distance(self.enemy, TRUE) < self.wakeup_dist) { + + // Normal think timer, player within range + self.nextthink = time + self.spawn_base + (random()*self.spawn_rand); + + // Is there anymore particles left to spawn? + if (self.pemit_tcount < self.part_limit) { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + self.pemit_tcount = self.pemit_tcount + 1; + part.movetype = self.part_movetype; // 6=Gravity, 8=Noclip, 10=Bounce + + // Select particle type + randno = random(); + + //---------------------------------------------------------------------- + // Setup SPRITE particle (string and frame no) + //---------------------------------------------------------------------- + if (randno < 0.3) setmodel(part, self.spr_name1); + else if (randno < 0.6) setmodel(part, self.spr_name2); + else setmodel(part, self.spr_name3); + + //---------------------------------------------------------------------- + // Sprite Frame style (1=LIGHT, 2=DARK, 3=ALL) + //---------------------------------------------------------------------- + if (self.spr_frame == 1) part.frame = rint(random()*1.4); + else if (self.spr_frame == 2) part.frame = rint(random()*2); + else part.frame = rint(random()*3.4); + + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + //---------------------------------------------------------------------- + // STARTING POINT (Particle origin - uses MANGLE key) + // + // 0 = Randomly picked from a volume (X/Y/Z) - DEFAULT + // 1 = Circular motion (radius/segment controlled) + // 2 = Randomly pick a point on the circle circumference + // 3 = Spiral in/out from circle circumference + // 5 = Explosion from central point + //---------------------------------------------------------------------- + // Circular motion around emitter (self) + if (self.part_veltype == PARTICLE_ORIGIN_CIRCLE) { + angle_vec = '0 0 0'; + angle_vec_y = angle_vec_y + self.circular_angle; + makevectors(angle_vec); + part.origin = self.origin + v_forward * self.part_vol_x; + setorigin (part, part.origin + self.part_ofs); + self.circular_angle = anglemod(self.circular_angle + self.part_vol_y); + } + // Random circumference point around emitter (self) + else if (self.part_veltype == PARTICLE_ORIGIN_RANDCIRCLE) { + angle_vec = '0 0 0'; + angle_vec_y = angle_vec_y + rint(random()*360); + makevectors(angle_vec); + part.origin = self.origin + v_forward * self.part_vol_x; + setorigin (part, part.origin + self.part_ofs); + } + // Spiral in/out around circumference point (self) + else if (self.part_veltype == PARTICLE_ORIGIN_SPIRAL) { + angle_vec = '0 0 0'; + angle_vec_y = angle_vec_y + self.circular_angle; + makevectors(angle_vec); + if (self.lefty == 0) self.lefty = 1; + self.part_vol_z = self.part_vol_z + self.lefty; + if (self.part_vol_z == 0) self.lefty = 1; + if (self.part_vol_z == self.part_vol_x) self.lefty = -1; + part.origin = self.origin + v_forward * self.part_vol_z; + setorigin (part, part.origin + self.part_ofs); + self.circular_angle = anglemod(self.circular_angle + self.part_vol_y); + } + // Explosion from central point (self) + else if (self.part_veltype == PARTICLE_ORIGIN_CENTER) { + // Always calculate from the center of original object + part.origin = self.pemit_source.origin + self.part_ofs; + setorigin (part, part.origin); + } + // Random volume point around particle (part) + else { + // Check if owner is a Bmodel? (different origin location) + if (self.pemit_source.bsporigin) { + part.pos1 = self.pemit_source.origin + bmodel_origin(self.pemit_source); + part.origin = part.pos1; + // Double check the bmodel volume has been setup correctly (not zero) + // Particle emitters can be started before bmodel has initialized + if (CheckZeroVector(self.part_vol)) self.part_vol = self.pemit_source.size * 0.5; + } + else part.origin = self.pemit_source.origin + self.part_ofs; + + part.origin_x = part.origin_x + ( (random()*(self.part_vol_x*2)) - self.part_vol_x); + part.origin_y = part.origin_y + ( (random()*(self.part_vol_y*2)) - self.part_vol_y); + part.origin_z = part.origin_z + ( (random()*(self.part_vol_z*2)) - self.part_vol_z); + setorigin (part, part.origin); + } + + //---------------------------------------------------------------------- + // VELOCITY (Particle speed/direction - uses ANGLES key) + // + // Initially setup linear velocity + // if PART_VELRAND defined create extra wobble/randomness + // if oldenemy (noise4) specified go towards specific target entity + //---------------------------------------------------------------------- + if (self.pemit_target) { + // Check if finish target is a Bmodel? (different origin location) + if (self.pemit_target.bsporigin) { + part.pos2 = self.pemit_target.origin + bmodel_origin(self.pemit_target); + angle_vec = part.pos2 - part.origin; + } + else + angle_vec = self.pemit_target.origin - part.origin; // Target -> Self + + angle_vec = normalize(angle_vec); // vector unit scale + part.velocity = angle_vec * ( (random()*self.part_vel_x) + self.part_vel_x); + + // Add extra wobble if part_velrand defined + if (self.part_velrand_x > 0 || self.part_velrand_y > 0 || self.part_velrand_z > 0) { + part.velocity_x = part.velocity_x + (random()*(self.part_velrand_x*2)) - self.part_velrand_x; + part.velocity_y = part.velocity_y + (random()*(self.part_velrand_y*2)) - self.part_velrand_y; + part.velocity_z = part.velocity_z + (random()*(self.part_velrand_z*2)) - self.part_velrand_z; + } + } + // Explosion from central point (self) + else if (self.part_veltype == PARTICLE_ORIGIN_CENTER) { + // Setup BASE + CRANDOM (+/-) velocity + part.velocity = '0 0 0'; + part.velocity_x = self.part_vel_x - (random()*(self.part_vel_x*2)); + part.velocity_y = self.part_vel_y - (random()*(self.part_vel_y*2)); + part.velocity_z = self.part_vel_z - (random()*(self.part_vel_z*2)); + part.velocity = part.velocity + self.part_velbase; + } + else { + // Setup BASE + RANDOM (+) velocity + part.velocity = '0 0 0'; + part.velocity_x = random(self.part_vel_x) + self.part_vel_x; + part.velocity_y = random(self.part_vel_y) + self.part_vel_y; + part.velocity_z = random(self.part_vel_z) + self.part_vel_z; + part.velocity = part.velocity + self.part_velbase; + + // Add extra wobble if part_velrand defined + if (self.part_velrand_x > 0 || self.part_velrand_y > 0 || self.part_velrand_z > 0) { + part.velocity_x = part.velocity_x + (random()*(self.part_velrand_x*2)) - self.part_velrand_x; + part.velocity_y = part.velocity_y + (random()*(self.part_velrand_y*2)) - self.part_velrand_y; + part.velocity_z = part.velocity_z + (random()*(self.part_velrand_z*2)) - self.part_velrand_z; + } + } + //---------------------------------------------------------------------- + // ROTATION (Y axis only - uses PART_VELROT key) + // Random Y axis rotation + //---------------------------------------------------------------------- + if (self.part_velrot) { + part.angles = self.enemy.angles; // Rotate the same way first + part.avelocity = '0 0 0'; + part.avelocity_y = self.part_velrot + (random()*self.part_velrot); + } + + // Setup time of death! + part.nextthink = time + random() + self.part_life; + part.think = finish_particle; + } + + } + } + else { + // If no player within range of the emitter, slower think timer + self.nextthink = time + self.wakeup_timer + (random()*self.spawn_rand); + } +}; + +//---------------------------------------------------------------------- +// Pick a particle sprite based on type +//---------------------------------------------------------------------- +void(entity part_ent, float part_style) particle_style = +{ + local float ring_rand; + + ring_rand = random(); + if (ring_rand < 0.4) { + if (part_style & PARTICLE_BURST_YELLOW) setmodel (part_ent, PART_DOTSML_GOLD); + else if (part_style & PARTICLE_BURST_GREEN) setmodel (part_ent, PART_DOTSML_LGREEN); + else if (part_style & PARTICLE_BURST_RED) setmodel (part_ent, PART_DOTSML_GREY); + else if (part_style & PARTICLE_BURST_BLUE) setmodel (part_ent, PART_DOTSML_BLUE); + else if (part_style & PARTICLE_BURST_PURPLE) setmodel (part_ent, PART_DOTSML_PURP); + else if (part_style & PARTICLE_BURST_FIRE) setmodel (part_ent, PART_TORCH1); + else setmodel (part_ent, PART_DOTSML_WHITE); + } + else if (ring_rand < 0.8) { + //---------------------------------------------------------------------- + if (part_style & PARTICLE_BURST_YELLOW) setmodel (part_ent, PART_DOTSML_YELLOW); + else if (part_style & PARTICLE_BURST_GREEN) setmodel (part_ent, PART_DOTSML_GREEN); + else if (part_style & PARTICLE_BURST_RED) setmodel (part_ent, PART_DOTSML_RED); + else if (part_style & PARTICLE_BURST_BLUE) setmodel (part_ent, PART_DOTSML_GREY); + else if (part_style & PARTICLE_BURST_PURPLE) setmodel (part_ent, PART_DOTSML_GREY); + else if (part_style & PARTICLE_BURST_FIRE) setmodel (part_ent, PART_DOTSML_GOLD); + else setmodel (part_ent, PART_DOTSML_GREY); + } + else { + //---------------------------------------------------------------------- + if (part_style & PARTICLE_BURST_YELLOW) setmodel (part_ent, PART_DOTMED_YELLOW); + else if (part_style & PARTICLE_BURST_GREEN) setmodel (part_ent, PART_DOTMED_GREEN); + else if (part_style & PARTICLE_BURST_RED) setmodel (part_ent, PART_DOTMED_RED); + else if (part_style & PARTICLE_BURST_BLUE) setmodel (part_ent, PART_DOTMED_BLUE); + else if (part_style & PARTICLE_BURST_PURPLE) setmodel (part_ent, PART_DOTMED_PURP); + else if (part_style & PARTICLE_BURST_FIRE) setmodel (part_ent, PART_DOTMED_GREY); + else setmodel (part_ent, PART_DOTMED_GREY); + } + // Random frame (sprite) + part.frame = rint(random()*3); +}; + +//---------------------------------------------------------------------- +// Particle ring explosion (used for respawn function) +// ring_org : center of particle ring +// ring_dir : direction for particles to move +// ring_rdir : random wobble for particle direction +// ring_rad : starting point offset (grow/shrink ring size) +// ring_qty : circle division (how many points around circumference) +// ring_time : lifespan of particle (time + random()*time) +// ring_style : particle ring colour (1=yellow, 2=green, 3=red, 4=white) +//---------------------------------------------------------------------- +void(vector ring_org, vector ring_dir, vector ring_rdir, float ring_rad, float ring_qty, float ring_time, float ring_style) particle_ring = +{ + local vector circle_vec, circle_org; + local float ring_loop, ring_angle; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Setup DP particle style based on supplied style + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + if (ring_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_RINGPARTY; + else if (ring_style & PARTICLE_BURST_GREEN) dpp_string = DPP_RINGPARTG; + else if (ring_style & PARTICLE_BURST_RED) dpp_string = DPP_RINGPARTR; + else if (ring_style & PARTICLE_BURST_BLUE) dpp_string = DPP_RINGPARTB; + else if (ring_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_RINGPARTP; + else dpp_string = DPP_RINGPARTW; + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+ring_qty) >= part_max - 1) return; + } + + ring_loop = 0; + ring_angle = 360 / ring_qty; + while (ring_loop < ring_qty) { + // Is the DP particle system active? + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // Work out point on circle circumference using + // the v_forward vector with incremental angles + circle_vec = '0 0 0'; + circle_vec_y = circle_vec_y + (ring_angle * ring_loop); + makevectors(circle_vec); + circle_org = ring_org + (v_forward * ring_rad); + + // Generate particles (DP Engine) + pointparticles(particleeffectnum(dpp_string), circle_org, '0 0 0', 1); + } + else { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + part.movetype = MOVETYPE_NOCLIP; + + // Setup correct particle type (sprite/model) based on ring colour + particle_style(part, ring_style); + + // Work out point on circle circumference using + // the v_forward vector with incremental angles + circle_vec = '0 0 0'; + circle_vec_y = circle_vec_y + (ring_angle * ring_loop); + makevectors(circle_vec); + part.origin = ring_org + (v_forward * ring_rad); + setorigin (part, part.origin); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + // Setup particle velocity with random element + part.velocity_x = ring_dir_x + ( (random()*(ring_rdir_x*2)) - ring_rdir_x); + part.velocity_y = ring_dir_y + ( (random()*(ring_rdir_y*2)) - ring_rdir_y); + part.velocity_z = ring_dir_z + (random()*ring_rdir_z); + + // Setup time of death! + part.nextthink = time + (random()*ring_time) + ring_time; + part.think = finish_particle; + } + } + // Keep on loopin! + ring_loop = ring_loop + 1; + } +}; + +//---------------------------------------------------------------------- +void(entity part_ent, vector part_org, float expl_style) explosion_style = +{ + local vector org_volume, expl_vel; + + // Ogre hammer is a flat floor explosion with particles bouncing + if (expl_style & PARTICLE_BURST_SHOCKWAVE) { + org_volume = '0 0 0'; + org_volume_x = crandom()*16; + org_volume_y = crandom()*16; + part_ent.origin = part_org + org_volume; + setorigin (part_ent, part_ent.origin); + + // Random chance of dead particles that are + // stationary on the ground + if (random() < 0.3) { + part_ent.velocity = '0 0 0'; + if (random() < 0.5) setmodel (part_ent, PART_DOTSML_GREY); + else setmodel (part_ent, PART_DOTMED_GREY); + part_ent.frame = rint(random()*3); + } + else { + // Particles that explode up and out + expl_vel_x = crandom() * 75; + expl_vel_y = crandom() * 75; + expl_vel_z = 150 + random() * 150; + part_ent.velocity = expl_vel; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_TOSS; + part_ent.gravity = 0.75; + part_ent.flags = 0; + } + } + // Skull wizard teleporting = particle burst upwards + else if (expl_style & PARTICLE_BURST_SKULLUP) { + part_ent.origin_x = part_org_x + crandom()*8; + part_ent.origin_y = part_org_y + crandom()*8; + // If skull wizard dead, spawn particles from robes on floor + // Otherwise the particles are being used for a teleport + if (self.health < 0) part_ent.origin_z = part_org_z - MON_VIEWOFS; + else part_ent.origin_z = part_org_z - crandom()*MON_VIEWOFS; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*8; + part_ent.velocity_y = crandom()*8; + part_ent.velocity_z = random()*25; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + // Lost souls fire particles upwards + else if (expl_style & PARTICLE_BURST_LOSTUP) { + part_ent.origin_x = part_org_x + crandom()*4; + part_ent.origin_y = part_org_y + crandom()*4; + part_ent.origin_z = part_org_z; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*4; + part_ent.velocity_y = crandom()*4; + part_ent.velocity_z = random()*10; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + // Minotaur finished plasma attack + else if (expl_style & PARTICLE_BURST_MINOTAUR) { + part_ent.origin_x = part_org_x + crandom()*8; + part_ent.origin_y = part_org_y + crandom()*8; + part_ent.origin_z = part_org_z - crandom()*MON_VIEWOFS; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*8; + part_ent.velocity_y = crandom()*8; + part_ent.velocity_z = random()*35; + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + // Generic particle burst drifting upward + else if (expl_style & PARTICLE_BURST_UPWARD) { + part_ent.origin_x = part_org_x + crandom()*24; + part_ent.origin_y = part_org_y + crandom()*24; + part_ent.origin_z = part_org_z + random()*64; + setorigin (part_ent, part_ent.origin); + part_ent.velocity_x = crandom()*16; + part_ent.velocity_y = crandom()*16; + part_ent.velocity_z = 8+random()*16; + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } + else { + // default = explode outwards in all directions + part_ent.origin = part_org; + setorigin (part_ent, part_ent.origin); + part_ent.velocity = vecrand(0,16,TRUE); + part_ent.avelocity = vecrand(100,200,FALSE); + part_ent.movetype = MOVETYPE_FLY; + part_ent.flags = 0; + } +}; + +/*====================================================================== + Particle Implode + + e_org : center of particle implode + e_qty : quantity of particle burst + e_speed : Particle speed towards center + e_dist : circumference of implosion circle + p_style : sprite style (check function particle_style above) +======================================================================*/ +void(vector e_org, float e_qty, float e_speed, float e_dist, float p_style) particle_implode = +{ + local float e_loop, e_len, e_traveltime; + local vector e_dir, e_vdestdelta, e_finaldest; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+e_qty) >= part_max - 1) return; + + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // Setup DP particle style based on supplied style + if (p_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_BURSTPARTY; + else if (p_style & PARTICLE_BURST_GREEN) dpp_string = DPP_BURSTPARTG; + else if (p_style & PARTICLE_BURST_RED) dpp_string = DPP_BURSTPARTR; + else if (p_style & PARTICLE_BURST_BLUE) dpp_string = DPP_BURSTPARTB; + else if (p_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_BURSTPARTP; + else dpp_string = DPP_BURSTPARTW; + } + // pointparticles(particleeffectnum(dpp_string), e_org, '0 0 0', e_qty); + + e_loop = 0; + while (e_loop < e_qty) { + e_loop = e_loop + 1; // Keep on loopin! + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + particle_style(part, p_style); + + // Work out random direction from origin center + e_dir = normalize(vecrand(0,50,TRUE)); + e_finaldest = e_org + e_dir * (e_dist + random()*50); + + // Calculate distance and time travelled + e_vdestdelta = e_org - e_finaldest; + e_len = vlen(e_vdestdelta); + e_traveltime = e_len / (e_speed + random()*50); + + // Move to outer edge of implosion circle + setorigin(part, e_finaldest); + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + part.movetype = MOVETYPE_NOCLIP; + + // Setup inward velocity and time to kill + part.velocity = e_vdestdelta * (1/e_traveltime); + part.nextthink = time + e_traveltime; + part.think = finish_particle; + } + } +}; + +/*====================================================================== + Particle explosion + + e_org : center of particle explosion + e_qty : quantity of particle burst + e_time : lifespan of particle (time + random()*time) + p_style : sprite style (check function particle_style above) + e_style : explosion style (pre-defined in part_manage.qc) +======================================================================*/ +void(vector e_org, float e_qty, float e_time, float p_style, float e_style) particle_explode = +{ + local float e_loop; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + // Can only have integer particle quantity + e_qty = rint(e_qty); + + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + // DP hammer impact, 1=regular 2=shockwave + if (e_style & PARTICLE_BURST_SHOCKWAVE) { + if (e_style & 1) pointparticles(particleeffectnum(DPP_BURSTSHOCKWAVE1), e_org, '0 0 0', 1); + else pointparticles(particleeffectnum(DPP_BURSTSHOCKWAVE1), e_org, '0 0 0', 1); + } + else { + // Setup DP particle style based on supplied style + if (p_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_BURSTPARTY; + else if (p_style & PARTICLE_BURST_GREEN) dpp_string = DPP_BURSTPARTG; + else if (p_style & PARTICLE_BURST_RED) dpp_string = DPP_BURSTPARTR; + else if (p_style & PARTICLE_BURST_BLUE) dpp_string = DPP_BURSTPARTB; + else if (p_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_BURSTPARTP; + else dpp_string = DPP_BURSTPARTW; + pointparticles(particleeffectnum(dpp_string), e_org, '0 0 0', e_qty); + } + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+e_qty) >= part_max - 1) return; + e_loop = 0; + while (e_loop < e_qty) { + e_loop = e_loop + 1; // Keep on loopin! + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + particle_style(part, p_style); + explosion_style(part, e_org, e_style); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + part.nextthink = ((time + (random() * e_time)) + e_time); + part.think = finish_particle; + } + } + } +}; + +//---------------------------------------------------------------------- +// Slowly rising cloud of particle dots +//---------------------------------------------------------------------- +void(vector debuff_center, float debuff_volsize, float debuff_qty, float debuff_style) particle_debuff = +{ + local float debuff_loop, debuff_time; + local vector debuff_org, debuff_vol; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Setup DP particle style based on supplied style + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + if (debuff_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_RINGPARTY; + else if (debuff_style & PARTICLE_BURST_GREEN) dpp_string = DPP_RINGPARTG; + else if (debuff_style & PARTICLE_BURST_RED) dpp_string = DPP_RINGPARTR; + else if (debuff_style & PARTICLE_BURST_BLUE) dpp_string = DPP_RINGPARTB; + else if (debuff_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_RINGPARTP; + else dpp_string = DPP_RINGPARTW; + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+debuff_qty) >= part_max - 1) return; + } + + debuff_loop = 0; + debuff_time = 2; + + while (debuff_loop < debuff_qty) { + debuff_vol = vecrand(0,debuff_volsize,TRUE); + debuff_org = debuff_center + debuff_vol; + + // Is the DP particle system active? + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) + pointparticles(particleeffectnum(dpp_string), debuff_org, '0 0 0', 1); + else { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + part.movetype = MOVETYPE_NOCLIP; + + // Setup correct particle type (sprite/model) based on ring colour + particle_style(part, debuff_style); + setorigin (part, debuff_org); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + // Setup particle velocity with random element + part.velocity = vecrand(0,2,TRUE); + part.velocity_z = 8 + random()*24; + + // Setup time of death! + part.nextthink = time + (random()*debuff_time) + debuff_time; + part.think = finish_particle; + } + } + // Keep on loopin! + debuff_loop = debuff_loop + 1; + } +}; + +//---------------------------------------------------------------------- +// Falling particle dust/dots +//---------------------------------------------------------------------- +void(vector dust_center, float dust_qty, float dust_style) particle_dust = +{ + local float dust_loop, dust_volsize, dust_time; + local vector dust_org, dust_vol; + local string dpp_string; + + // Have particles been enabled via serverflags? + if (query_configflag(SVR_PARTICLES) != SVR_PARTICLES) return; + + // Setup DP particle style based on supplied style + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) { + if (dust_style & PARTICLE_BURST_YELLOW) dpp_string = DPP_RINGPARTY; + else if (dust_style & PARTICLE_BURST_GREEN) dpp_string = DPP_RINGPARTG; + else if (dust_style & PARTICLE_BURST_RED) dpp_string = DPP_RINGPARTR; + else if (dust_style & PARTICLE_BURST_BLUE) dpp_string = DPP_RINGPARTB; + else if (dust_style & PARTICLE_BURST_PURPLE) dpp_string = DPP_RINGPARTP; + else dpp_string = DPP_RINGPARTW; + } + else { + // Are there any free particles? + // Check for maximim amount of particles available + if ( (part_total+dust_qty) >= part_max - 1) return; + } + + dust_loop = 0; + dust_time = 1; + dust_volsize = 16; + + while (dust_loop < dust_qty) { + dust_vol = vecrand(0,dust_volsize,TRUE); + dust_org = dust_center + dust_vol; + + // Is the DP particle system active? + if (ext_dppart && query_configflag(SVR_SPRPARTON) == FALSE && world.sprite_particles == FALSE) + pointparticles(particleeffectnum(dpp_string), dust_org, '0 0 0', 1); + else { + part = fetch_particle(); + // Only preceed if a particle has been returned + if (part.classtype == CT_PARTICLE) { + part.owner = self; + part.movetype = MOVETYPE_NOCLIP; + part.solid = SOLID_NOT; + + // Setup correct particle type (sprite/model) based on ring colour + particle_style(part, dust_style); + setorigin (part, dust_org); + // Zero size and world interaction + setsize (part, VEC_ORIGIN, VEC_ORIGIN); + + // Setup particle velocity with random element + part.velocity = vecrand(0,35,TRUE); + part.velocity_z = -100 - random()*100; + part.avelocity = '300 300 300'; + + // Setup time of death! + part.nextthink = time + (random()*dust_time) + dust_time; + part.think = finish_particle; + } + } + // Keep on loopin! + dust_loop = dust_loop + 1; + } +}; diff --git a/QC_other/QC_keep/part_manage.qc b/QC_other/QC_keep/part_manage.qc new file mode 100644 index 00000000..701c6bd2 --- /dev/null +++ b/QC_other/QC_keep/part_manage.qc @@ -0,0 +1,498 @@ +//====================================================================== +// Particle System +//====================================================================== +// Particle management +float PARTICLE_MAXENTS = 1024; // Maximum amount of particles active (default) +float PARTICLE_BANK = 64; // How many particle in each setup bank +float PARTICLE_BUFFER = 128; // How many particle to create before unlock +float part_message; // Timer for particle message (every 3s) +entity part_control; // Particle setup entity (drives nextthink) +entity part_start; // Pointers to start/end particle chain +entity part_end; +entity part_free; // Current particle entity +float part_total; // Currently active particles +float part_max; // Maximum active particles +entity part; // Spawning particle emitters and particles + +//---------------------------------------------------------------------- +// Particle emitter parameters +float PARTICLE_START_OFF = 1; // Particle emitter starts OFF +float PARTICLE_START_ON = 2; // Particle emitter starts ON +float PARTICLE_WEATHER_SNOW = 8; // Weather snow - White + +.float particlemax; // Maximum about of ACTIVE particles per map +.entity entchain; // Entity pointer to next entity in chain +.entity part_emitter; // Particle emitter link on any entity +.entity pemit_source; // Source/owner of particle emitter +.entity pemit_target; // Particle emitter target entity +.float target_valid; // Test condition for valid target entity (not self or world) +.float part_style; // Pre-defined particle styles +.float pemit_tcount; // Particle emitter, total active particles +.float part_active; // Is the particle active or not +.float start_delay; // Particle emitter start delay +.float dpp_only; // Is the particle a DPP only effect? +.string dpp_name; // DP particle effect name in effectinfo.txt file +.float dpp_wait; // DP particle re-trigger timer +.float dpp_rnd; // DP particle random multiplier for time +.vector dpp_vel; // Direction of DP particles to move towards + +//---------------------------------------------------------------------- +// Particle style parameters +.string spr_name1; // Sprite string name 1 (uses defs) +.string spr_name2; // Sprite string name 2 +.string spr_name3; // Sprite string name 3 +.float spr_frame; // Sprite frame type 1=all, 2=light, 3=dark +.float part_limit; // Maximum amount of particles to emit +.float part_life; // Life time +.vector part_ofs; // Offset from emitter +.float part_veltype; // Velocity types +.vector part_velbase; // Base velocity (always this direction) +.vector part_vel; // Random Velocity direction (vel+random*vel) +.vector part_velrand; // Extra random velocity wobble +.float part_velrot; // Velocity rotation (Y axis only) +.vector part_vol; // Spawning volume +.float circular_angle; // Circular rotation angle +.float part_movetype; // Movetype of particle +.float wakeup_dist; // Wake up distance for particle emitter +.float wakeup_timer; // How often to check distance check +.float spawn_base; // Spawn rate - base value +.float spawn_rand; // Spawn rate - random adjustment + +// Compiler forward links +void() setup_particleprecache; + +//---------------------------------------------------------------------- +// The particle is finished with, update emitter particle counter +//---------------------------------------------------------------------- +void() finish_particle = +{ + if (self.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_RETURN]\b This is not a particle!?!\n"); + } + else { + if (self.owner.pemit_tcount > 0) + self.owner.pemit_tcount = self.owner.pemit_tcount - 1; + + self.velocity = VEC_ORIGIN; // no more movement + self.avelocity = VEC_ORIGIN; + self.origin = VEC_ORIGIN; + self.part_active = FALSE; // Finished with particle + setmodel(self, ""); // Remove from world + self.owner = world; // No owner anymore + self.skin = self.frame = self.flags = FALSE; + self.gravity = 1; + + // Update active particle total + if (part_total > 1) part_total = part_total - 1; + + if (part_free.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_RETURN]\b Current free particle is wrong classtype!!\n"); + } + else { + // Add particle back into central particle list + self.entchain = part_free.entchain; // link new particle forward in chain + part_free.entchain = self; // link free particle to new particle + + if (part_debug == 2) { + dprint("Return Free ("); dprint(ftos(part_free.cnt)); + dprint(") Next ("); dprint(ftos(part_free.entchain.cnt)); + dprint(")\n"); + } + } + } +}; + +//---------------------------------------------------------------------- +// All requests for particles must go through one function +//---------------------------------------------------------------------- +entity() fetch_particle = +{ + local entity tpart_ret; + tpart_ret = world; // Default - no particle returned + + // Make sure the system has 2 banks of particles setup first! + if (part_control.count < PARTICLE_BUFFER) return tpart_ret; + + // Display particle limits if skill set to a debug number + if (part_debug == 1) { + sprint(client_ent, "CREATE Particle ("); sprint(client_ent, ftos(part_total)); + sprint(client_ent, "/"); sprint(client_ent, ftos(part_max)); + sprint(client_ent, ")\n"); + } + + // Are there any free particles? + if (part_total >= part_max - 1) { + if (part_message < time) { + dprint("\b[PARTICLE]\b current limit ("); dprint(ftos(part_max)); + dprint(") too low!\n"); + part_message = time + 3; // interval console spam + } + } + else { + if (part_free.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_FETCH]\b Current free particle is wrong classtype!!\n"); + } + else if (part_free.entchain.classtype != CT_PARTICLE) { + dprint("\b[PARTICLE_FETCH]\b Next free particle is wrong classtype!!\n"); + dprint("Free ("); dprint(ftos(part_free.cnt)); + dprint(") Ctype ("); dprint(ftos(part_free.classtype)); + dprint(") Next ("); dprint(ftos(part_free.entchain.cnt)); + dprint(") Ctype ("); dprint(ftos(part_free.entchain.classtype)); + dprint(")\n"); + } + else { + tpart_ret = part_free.entchain; // return next free particle + part_free.entchain = tpart_ret.entchain; // Skip forward in the chain + + // Update currently active particle total + part_total = part_total + 1; + tpart_ret.part_active = TRUE; + + if (part_debug == 2) { + dprint("Fetch Free ("); dprint(ftos(part_free.cnt)); + dprint(") return ("); dprint(ftos(tpart_ret.cnt)); + dprint(")\n"); + } + } + } + + return (tpart_ret); +}; + +//---------------------------------------------------------------------- +// Generate a chain of entities (one block at a time) +//---------------------------------------------------------------------- +void() generate_particlechain = +{ + local entity part_prev, part_first; + local float pcount; + + // Reset all variables + part_first = part_prev = part = world; + pcount = 0; + + // Is there anymore particles need to be created? + if (self.count + 1 < part_max) { + dprint("\b[PCHAIN]\b Part bank ("); + dprint(ftos(self.count)); dprint(" / "); + dprint(ftos(part_max)); dprint(")\n"); + + while (pcount < PARTICLE_BANK) { + // Create a new particle entity + part = spawn(); + part.solid = SOLID_NOT; + part.owner = world; + part.part_active = FALSE; + part.classname = "particle"; + part.classtype = CT_PARTICLE; + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) part.effects = part.effects + EF_NOSHADOW; + part.cnt = self.count + pcount; + + pcount = pcount + 1; // Increase loop + + //---------------------------------------------------------------------- + // Link particle chains together + if (part_prev.classtype != CT_PARTICLE) + part_first = part; // NEW CHAIN - setup all entity pointers + else part_prev.entchain = part; // EXISTING CHAIN - Link particles together + + part_prev = part; // Setup previous particle in chain + //---------------------------------------------------------------------- + } + + // Update total particles generated + self.count = self.count + PARTICLE_BANK; + + //---------------------------------------------------------------------- + // Are there any previous banks of particles? + if (part_start.classtype != CT_PARTICLE) { + // NEW BANK - Setup start/end particle and close chain + part_start = part.entchain = part_first; + part_free = part_first.entchain; // Move forward 1 + part_end = part; + } + else { + // EXISTING BANK - Link new bank to existing banks + part_end.entchain = part_first; // Link end and first of new bank together + part.entchain = part_start; // Link current and start together + part_end = part; // Move end of bank forward + } + //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- + // Is there anymore particles need to be created? + if (self.count + 1 < part_max) { + self.think = generate_particlechain; + self.nextthink = time + 0.2; + } +}; + +//---------------------------------------------------------------------- +// Setup particle chain in small banks +//---------------------------------------------------------------------- +void() setup_particlechain = +{ + // Pre-cache all sprites + setup_particleprecache(); + + if (part_control.classtype != CT_PARTICLECONT) { + part_control = spawn(); + part_control.solid = SOLID_NOT; + part_control.classtype = CT_PARTICLECONT; + + dprint("\b[PCHAIN]\b Creating controller\n"); + part_free = part_end = part_start = world; + part_total = part_control.count = 0; + } + // Setup next think + part_control.think = generate_particlechain; + part_control.nextthink = time + 0.3; +}; + +//---------------------------------------------------------------------- +float PARTICLE_ORIGIN_VOL = 0; // Pick random point inside volume +float PARTICLE_ORIGIN_CIRCLE = 1; // Move around circumference of circle +float PARTICLE_ORIGIN_RANDCIRCLE = 2; // Randomly point on circumference +float PARTICLE_ORIGIN_SPIRAL = 3; // Spiral outwards to circumference +float PARTICLE_ORIGIN_CENTER = 5; // Explosion style from center + +//---------------------------------------------------------------------- +// particle BURST explosions +float PARTICLE_BURST_YELLOW = 1; // gold, yellow, yellow +float PARTICLE_BURST_GREEN = 2; // light green, green, green +float PARTICLE_BURST_RED = 4; // grey, red, red +float PARTICLE_BURST_BLUE = 8; // blue, grey, blue +float PARTICLE_BURST_PURPLE = 16; // purple, grey, purple +float PARTICLE_BURST_FIRE = 32; // gold, red, grey (used by ogre) +float PARTICLE_BURST_WHITE = 64; // white, grey, grey + +float PARTICLE_BURST_RING = 256; // Circular particle burst +float PARTICLE_BURST_CENTER = 512; // Central particle burst +float PARTICLE_BURST_UPWARD = 1024; // Drifting upward burst +float PARTICLE_BURST_SHOCKWAVE = 4096; // Floor impact shockwave +float PARTICLE_BURST_SKULLUP = 8192; // Skull wizard teleport +float PARTICLE_BURST_LOSTUP = 16384; // Lost souls particle burn +float PARTICLE_BURST_MINOTAUR = 32768; // Minotaur magic attack over +//---------------------------------------------------------------------- +// Map referenced particles +float PARTICLE_STYLE_CUSTOM = 1; // Custom particle defined in map +float PARTICLE_STYLE_WEATHER = 5; // Various weather type effects +float PARTICLE_STYLE_PORTAL = 10; // White dot/bubbles floating outwards (volume) +float PARTICLE_STYLE_JUMPPAD = 15; // Spiral pattern floating upward +float PARTICLE_STYLE_FCIRCLE = 20; // Yellow dots floating upwards from circle on floor +float PARTICLE_STYLE_FFIELD = 25; // Volume Forcefield custom direction + +// Code referenced particles +float PARTICLE_STYLE_EMPTY = 0; // Particle emitter is dead/broken +float PARTICLE_STYLE_BOOK = 50; // Rotating white runes floating upwards (CLOSED) +float PARTICLE_STYLE_OPENBOOK = 55; // Particle dots based on book colour (OPEN) +float PARTICLE_STYLE_ELECTRIC = 65; // White/blue sparks floating towards target +float PARTICLE_STYLE_FLAMES = 70; // Small Flame Yellow/red embers +float PARTICLE_STYLE_FLAMET = 72; // Small Torch Yellow/red embers +float PARTICLE_STYLE_FLAMEL = 75; // Large Flame and lots of particles +float PARTICLE_STYLE_SMOKE = 80; // DP only effect, velocity driven smoke + +float PARTICLE_STYLE_RESPAWN = 100; // Red/yellow dots spawning from single point +float PARTICLE_STYLE_MEGAH = 105; // Red dot/heal particles from center +float PARTICLE_STYLE_ARMOR = 110; // Green/Yellow/Red dots floating up +float PARTICLE_STYLE_KEYSILVER = 120; // Blue explosion from top of key +float PARTICLE_STYLE_KEYGOLD = 122; // Yellow explosion from top of key +float PARTICLE_STYLE_KEYRED = 124; // Red explosion from top of key +float PARTICLE_STYLE_KEYGREEN = 126; // Green explosion from top of key +float PARTICLE_STYLE_KEYPURPLE = 128; // Purple explosion from top of key +float PARTICLE_STYLE_KEYWHITE = 130; // White explosion from top of key +float PARTICLE_STYLE_SIGIL = 140; // Purple explosion from center of rune +float PARTICLE_STYLE_ALTAR = 145; // Red/yellow dots raising around altar +float PARTICLE_STYLE_SKILL = 150; // Burst of red/yellow from skill column +float PARTICLE_STYLE_BACKPACK = 155; // Grey/White dots from center + +float PARTICLE_STYLE_SUIT = 200; // Green dots rising up +float PARTICLE_STYLE_PENT = 210; // Red/Black dots from center +float PARTICLE_STYLE_SRING = 220; // Yellow dots falling down +float PARTICLE_STYLE_QUAD = 230; // Blue dots from center +float PARTICLE_STYLE_TOMEOFP = 240; // Yellow explosion from skull +float PARTICLE_STYLE_SHARP = 250; // Purple dots from center +float PARTICLE_STYLE_PIERCE = 260; // Purple dots from center +float PARTICLE_STYLE_WETSUIT = 270; // Blue dots rising up + +//---------------------------------------------------------------------- +// Darkplaces custom particles defined in effectinfo.txt +//void(entity gibent, float gibpoison) DPP_blood_trail; + +// DarkPlaces Particles definition block names +// defined in effectinfo.txt (location - root of mod directory) +string DPP_TRBLOOD = "TR_BLOOD"; // Blood TRail for model flag +string DPP_ITSBLOOD = "TR_ITSBLOOD"; // Blood TRail (extra blood) +string DPP_TRSBLOOD = "TR_SBLOOD"; // Stone Blood TRail for model flag +string DPP_TRPBLOOD = "TR_PBLOOD"; // Poison Blood TRail for model flag + +string DPP_TRLASER = "TR_LASER"; // Laser particle TRail + +string DPP_TEEXPLODE = "TE_EXPLOSION"; // Default particle explosion + +string DPP_TRPLASMA = "TR_PLASMA"; // Plasma particle TRail +string DPP_TEPLASMA = "TE_PLASMA"; // Plasma particle explosion +string DPP_TEPLASMABIG = "TE_PLASMABIG";// Plasma Big explosion + +string DPP_TRPOISON = "TR_POISON"; // Poison particle TRail +string DPP_TEPOISON = "TE_POISON"; // Poison particle explosion +string DPP_TEPOISONMED = "TE_POISONBIG";// Poison Medium explosion + +string DPP_TEBSMOKE = "TE_BSMOKE"; // A burst of Smoke/Steam +string DPP_TEBFLAME = "TE_BFLAME"; // A burst of red flame (smoke) +string DPP_TEBPOISON = "TE_BPOISON"; // A burst of green poison (smoke) + +string DPP_PORTALFRONT = "DPP_ITSPORTALFRONT"; // 0,180 angle +string DPP_PORTALSIDE = "DPP_ITSPORTALSIDE"; // 90,270 angle +string DPP_PORTALDOWN = "DPP_ITSPORTALDOWN"; // -2 angle +string DPP_PORTALUP = "DPP_ITSPORTALUP"; // -1 angle +string DPP_FCIRCLE = "DPP_ITSFCIRCLE"; +string DPP_JUMPPAD = "DPP_ITSJUMPPAD"; +string DPP_BOOKBLUE = "DPP_ITSBOOKBLUE"; +string DPP_BOOKRED = "DPP_ITSBOOKRED"; +string DPP_BOOKGOLD = "DPP_ITSBOOKGOLD"; +string DPP_OPENBOOKBLUE = "DPP_ITSOPENBOOKBLUE"; +string DPP_OPENBOOKRED = "DPP_ITSOPENBOOKRED"; +string DPP_OPENBOOKGOLD = "DPP_ITSOPENBOOKGOLD"; +string DPP_ELECTRIC = "DPP_ITSELECTRIC"; +string DPP_FLAMES = "DPP_ITSSFLAME"; +string DPP_FLAMET = "DPP_ITSTFLAME"; +string DPP_FLAMEL = "DPP_ITSLFLAME"; +string DPP_SKILLPILLAR = "DPP_ITSSKILLPILLAR"; +string DPP_ALTARRED = "DPP_ITSALTARRED"; +string DPP_ALTARGREY = "DPP_ITSALTARGREY"; +string DPP_RESPAWN = "DPP_ITSRESPAWN"; +string DPP_MEGAH = "DPP_ITSMEGAH"; +string DPP_ARMOR1 = "DPP_ITSARMOR1"; +string DPP_ARMOR2 = "DPP_ITSARMOR2"; +string DPP_ARMOR2BLUE = "DPP_ITSARMOR2BLUE"; +string DPP_ARMOR3 = "DPP_ITSARMOR3"; +string DPP_WEAPON = "DPP_ITSWEAPON"; +string DPP_KEYSILVER = "DPP_ITSSILVERKEY"; +string DPP_KEYGOLD = "DPP_ITSGOLDKEY"; +string DPP_KEYRED = "DPP_ITSREDKEY"; +string DPP_KEYGREEN = "DPP_ITSGREENKEY"; +string DPP_KEYPURPLE = "DPP_ITSPURPLEKEY"; +string DPP_KEYWHITE = "DPP_ITSWHITEKEY"; +string DPP_SIGIL = "DPP_ITSSIGIL"; +string DPP_BACKPACK = "DPP_ITSBACKPACK"; +string DPP_SUIT = "DPP_ITSSUIT"; +string DPP_PENT = "DPP_ITSPENT"; +string DPP_SRING = "DPP_ITSSRING"; +string DPP_QUAD = "DPP_ITSQUAD"; +string DPP_TOMEOFP = "DPP_ITSTOMEOFP"; +string DPP_SHARP = "DPP_ITSSHARP"; +string DPP_PIERCE = "DPP_ITSPIERCE"; +string DPP_WETSUIT = "DPP_ITSWETSUIT"; + +// Special trigger effects +string DPP_TEVORESPIKE = "TE_VORESPIKE"; +string DPP_WRAITHEXPLODE = "DPP_ITSWRAITHEXPLODE"; +string DPP_INTERACTIVE = "DPP_ITSINTERACTIVE"; +string DPP_BURSTFLAME = "DPP_ITSFLAME_BURST"; +string DPP_FCIRCLE_RING = "DPP_ITSFCIRCLE_RING"; +string DPP_SIGILPICKUP = "DPP_ITSSIGIL_PICKUP"; +string DPP_BURSTSHOCKWAVE1 = "DPP_ITSBURSTSHOCKWAVE1"; +string DPP_BURSTSHOCKWAVE2 = "DPP_ITSBURSTSHOCKWAVE2"; +string DPP_PYROFLAME1 = "DPP_ITSPYROFLAME1"; +string DPP_PYROFLAME2 = "DPP_ITSPYROFLAME2"; +string DPP_PYROFLAME3 = "DPP_ITSPYROFLAME3"; + +// Velocity driven smoke +string DPP_VELSMOKEGREY1 = "DPP_ITSVELSMOKEGREY1"; +string DPP_VELSMOKEGREY2 = "DPP_ITSVELSMOKEGREY2"; +string DPP_VELSMOKEWHITE = "DPP_ITSVELSMOKEWHITE"; +string DPP_VELSMOKETOXIC = "DPP_ITSVELSMOKETOXIC"; +string DPP_VELSMOKEGREEN = "DPP_ITSVELSMOKEGREEN"; +string DPP_VELSMOKEPURPLE = "DPP_ITSVELSMOKEPURPLE"; +string DPP_VELSMOKERED = "DPP_ITSVELSMOKERED"; +string DPP_VELSMOKEFIRE = "DPP_ITSVELSMOKEFIRE"; + +// Respawn effects +string DPP_RINGPARTY = "DPP_ITSPART_RINGY"; +string DPP_RINGPARTG = "DPP_ITSPART_RINGG"; +string DPP_RINGPARTR = "DPP_ITSPART_RINGR"; +string DPP_RINGPARTB = "DPP_ITSPART_RINGB"; +string DPP_RINGPARTP = "DPP_ITSPART_RINGP"; +string DPP_RINGPARTW = "DPP_ITSPART_RINGW"; + +string DPP_BURSTPARTY = "DPP_ITSPART_BURSTY"; +string DPP_BURSTPARTG = "DPP_ITSPART_BURSTG"; +string DPP_BURSTPARTR = "DPP_ITSPART_BURSTR"; +string DPP_BURSTPARTB = "DPP_ITSPART_BURSTB"; +string DPP_BURSTPARTP = "DPP_ITSPART_BURSTP"; +string DPP_BURSTPARTW = "DPP_ITSPART_BURSTW"; +// Forcefield volumes +string DPP_FFIELDPARTY = "DPP_ITSPART_FFIELDY"; +string DPP_FFIELDPARTG = "DPP_ITSPART_FFIELDG"; +string DPP_FFIELDPARTR = "DPP_ITSPART_FFIELDR"; +string DPP_FFIELDPARTB = "DPP_ITSPART_FFIELDB"; +string DPP_FFIELDPARTP = "DPP_ITSPART_FFIELDP"; +string DPP_FFIELDPARTW = "DPP_ITSPART_FFIELDW"; + +//---------------------------------------------------------------------- +// GENERIC particle filename strings +string PART_BUBBLE_BLUE = "progs/ad171/s_bubble_blue1.spr"; +string PART_DOTMED_BLUE = "progs/ad171/s_dotmed_blue.spr"; +string PART_DOTSML_BLUE = "progs/ad171/s_dotsml_blue.spr"; +string PART_DOTMED_DBLUE = "progs/ad171/s_dotmed_dblue.spr"; +string PART_DOTSML_DBLUE = "progs/ad171/s_dotsml_dblue.spr"; +string PART_BUBBLE_YELLOW = "progs/ad171/s_bubble_yell.spr"; +string PART_DOTMED_YELLOW = "progs/ad171/s_dotmed_yell.spr"; +string PART_DOTSML_YELLOW = "progs/ad171/s_dotsml_yell.spr"; +string PART_DOTSML_GOLD = "progs/ad171/s_dotsml_gold.spr"; +string PART_BUBBLE_RED = "progs/ad171/s_bubble_red1.spr"; +string PART_DOTMED_RED = "progs/ad171/s_dotmed_red.spr"; +string PART_DOTSML_RED = "progs/ad171/s_dotsml_red.spr"; +string PART_DOTMED_GREEN = "progs/ad171/s_dotmed_grn.spr"; +string PART_DOTSML_GREEN = "progs/ad171/s_dotsml_grn.spr"; +string PART_DOTMED_LGREEN = "progs/ad171/s_dotmed_lgrn.spr"; +string PART_DOTSML_LGREEN = "progs/ad171/s_dotsml_lgrn.spr"; +string PART_DOTSML_PURP = "progs/ad171/s_dotsml_purp.spr"; +string PART_DOTMED_PURP = "progs/ad171/s_dotmed_purp.spr"; +string PART_BUBBLE_WHITE = "progs/ad171/s_bubble_wht.spr"; +string PART_DOTSML_WHITE = "progs/ad171/s_dotsml_wht.spr"; +string PART_DOTMED_GREY = "progs/ad171/s_dotmed_grey.spr"; +string PART_DOTSML_GREY = "progs/ad171/s_dotsml_grey.spr"; + +// SPECIFIC particle filename strings +string PART_TORCH1 = "progs/ad171/s_dotmed_tor1.spr"; +string PART_TORCH2 = "progs/ad171/s_dotmed_tor2.spr"; +string PART_BOOKRUNE1 = "progs/ad171/s_bookrune1.spr"; +string PART_BOOKRUNE2 = "progs/ad171/s_bookrune2.spr"; + +//---------------------------------------------------------------------- +// Particle sprites +//---------------------------------------------------------------------- +void() setup_particleprecache = +{ + precache_model (PART_TORCH1); // Embers - Red/Yellow + precache_model (PART_TORCH2); // Embers - Red/Yellow + precache_model (PART_BOOKRUNE1); // Celtic Book Runes + precache_model (PART_BOOKRUNE2); // Celtic Book Runes + + precache_model (PART_BUBBLE_BLUE); // Bubbles - Blue + precache_model (PART_DOTMED_BLUE); // Dots - Medium Blue + precache_model (PART_DOTSML_BLUE); // Dots - Small Blue + precache_model (PART_DOTMED_DBLUE); // Dots - Medium Dark Blue + precache_model (PART_DOTSML_DBLUE); // Dots - Small Dark Blue + precache_model (PART_BUBBLE_YELLOW); // Bubbles - Yellow + precache_model (PART_DOTMED_YELLOW); // Dots - Medium Yellow + precache_model (PART_DOTSML_YELLOW); // Dots - Small Yellow + precache_model (PART_DOTSML_GOLD); // Dots - Small Gold + precache_model (PART_BUBBLE_RED); // Bubbles - Red + precache_model (PART_DOTMED_RED); // Dots - Medium Red + precache_model (PART_DOTSML_RED); // Dots - Small Red + precache_model (PART_DOTMED_GREEN); // Dots - Medium Green + precache_model (PART_DOTSML_GREEN); // Dots - Small Green + precache_model (PART_DOTMED_LGREEN); // Dots - Medium Light Green + precache_model (PART_DOTSML_LGREEN); // Dots - Small Light Green + precache_model (PART_DOTSML_PURP); // Dots - Purple/Pink + precache_model (PART_DOTMED_PURP); // Dots - Purple/Pink + precache_model (PART_BUBBLE_WHITE); // Bubbles - White + precache_model (PART_DOTSML_WHITE); // Dots - Small White + precache_model (PART_DOTMED_GREY); // Dots - Medium Grey + precache_model (PART_DOTSML_GREY); // Dots - Small Grey +}; diff --git a/QC_other/QC_keep/player.qc b/QC_other/QC_keep/player.qc new file mode 100644 index 00000000..a9b2d55f --- /dev/null +++ b/QC_other/QC_keep/player.qc @@ -0,0 +1,970 @@ +/*============================================================================== +PLAYER +==============================================================================*/ +$cd id1/models/player_4 +$origin 0 -6 24 +$base base +$skin skin + +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 + +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 + +$frame stand1 stand2 stand3 stand4 stand5 + +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 + +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 +$frame axdeth7 axdeth8 axdeth9 + +$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 +$frame deatha9 deatha10 deatha11 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 + +$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 +$frame deathd8 deathd9 + +$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 +$frame deathe8 deathe9 + +// attacks +$frame nailatt1 nailatt2 +$frame light1 light2 +$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 +$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + +void() player_run; + +// GRAPPLE - - - - - +void() player_grapple4; +void() player_grapple5; + +void (float tomefinTime) W_FireThunderbolt; + +// PM: Changed axe frames to gun frames. +void() player_grapple1 =[ $shotatt2, player_grapple2 ] {self.weaponframe=1; W_FireGrapple();}; +void() player_grapple2 =[ $rockatt5, player_grapple3 ] {self.weaponframe=2;}; +void() player_grapple3 =[ $rockatt6, player_grapple3 ] {self.weaponframe=2; + if (!self.hook || self.hook.count) + {player_grapple5(); return;} // Done. + if (vlen(self.hook.origin - self.origin) >= HOOK_NEAR) + if (self.hook.state) //on_hook) + if (Grapple_Pull_Me ()) + {player_grapple4(); return;} // Time to fly. +}; +void() player_grapple4 =[ $deathc4, player_grapple4 ] {self.weaponframe=2; + if (!self.hook || self.hook.count) + {player_grapple5(); return;} // Done. + if ( (vlen(self.hook.origin - self.origin) < HOOK_NEAR) + || !self.hook.state) //on_hook) + {player_grapple3(); return;} + if (!Grapple_Pull_Me ()) // Did target gain weight all of a sudden? + {player_grapple3(); return;} +}; +void() player_grapple5 =[ $rockatt6, player_run ] {self.weaponframe=1;}; + + +/*============================================================================== +PLAYER AXE + +Frame 0 - Idle LOW +Frame 1 - Idle HIGH + +Axe A Original - 1,2,3,4 New - 3,4,5,7 a3,a4,a5,a7 +Axe B Original - 5,6,7,8 New - 10,11,13,14 b3,b4,b6,b7 +Axe C Original - 1,2,3,4 New - 17,18,20,21 c3,c4,c6,c7 +Axe D Original - 5,6,7,8 New - 24,25,26,28 d3,d4,d5,d7 +Axe E Original - x,x,x,x New - 31,32,34,35 e3,e4,e6,e7 + +============================================================================*/ +void() player_axe1 = [$axatt1, player_axe2 ] {self.weaponframe=1;}; +void() player_axe2 = [$axatt2, player_axe3 ] {self.weaponframe=2;}; +void() player_axe3 = [$axatt3, player_axe4 ] {self.weaponframe=3;W_FireAxe();}; +void() player_axe4 = [$axatt4, player_run ] {self.weaponframe=4;}; + +void() player_axeb1 = [$axattb1, player_axeb2 ] {self.weaponframe=5;}; +void() player_axeb2 = [$axattb2, player_axeb3 ] {self.weaponframe=6;}; +void() player_axeb3 = [$axattb3, player_axeb4 ] {self.weaponframe=7;W_FireAxe();}; +void() player_axeb4 = [$axattb4, player_run ] {self.weaponframe=8;}; + +void() player_axec1 = [$axattc1, player_axec2 ] {self.weaponframe=9;}; +void() player_axec2 = [$axattc2, player_axec3 ] {self.weaponframe=10;}; +void() player_axec3 = [$axattc3, player_axec4 ] {self.weaponframe=11;W_FireAxe();}; +void() player_axec4 = [$axattc4, player_run ] {self.weaponframe=12;}; + +void() player_axed1 = [$axattd1, player_axed2 ] {self.weaponframe=13;}; +void() player_axed2 = [$axattd2, player_axed3 ] {self.weaponframe=14;}; +void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe=15;W_FireAxe();}; +void() player_axed4 = [$axattd4, player_run ] {self.weaponframe=16;}; + +void() player_axee1 = [$axattd1, player_axee2 ] {self.weaponframe=17;}; +void() player_axee2 = [$axattd2, player_axee3 ] {self.weaponframe=18;}; +void() player_axee3 = [$axattd3, player_axee4 ] {self.weaponframe=19;W_FireAxe();}; +void() player_axee4 = [$axattd4, player_run ] {self.weaponframe=20;}; + +void () player_axeold1 = [ 119.000, player_axeold2 ] { self.weaponframe = TRUE; }; +void () player_axeold2 = [ 120.000, player_axeold3 ] { self.weaponframe = FL_SWIM; }; +void () player_axeold3 = [ 121.000, player_axeold4 ] { self.weaponframe = MOVETYPE_WALK; W_FireAxe (); }; +void () player_axeold4 = [ 122.000, player_run ] { self.weaponframe = MOVETYPE_STEP; }; + +void () player_axeoldb1 = [ 125.000, player_axeoldb2 ] { self.weaponframe = MOVETYPE_FLY; }; +void () player_axeoldb2 = [ 126.000, player_axeoldb3 ] { self.weaponframe = MOVETYPE_TOSS; }; +void () player_axeoldb3 = [ 127.000, player_axeoldb4 ] { self.weaponframe = MOVETYPE_PUSH; W_FireAxe (); }; +void () player_axeoldb4 = [ 128.000, player_run ] { self.weaponframe = FL_CLIENT; }; + +void () player_axeoldc1 = [ 131.000, player_axeoldc2 ] { self.weaponframe = TRUE; }; +void () player_axeoldc2 = [ 132.000, player_axeoldc3 ] { self.weaponframe = FL_SWIM; }; +void () player_axeoldc3 = [ 133.000, player_axeoldc4 ] { self.weaponframe = MOVETYPE_WALK; W_FireAxe (); }; +void () player_axeoldc4 = [ 134.000, player_run ] { self.weaponframe = MOVETYPE_STEP; }; + +void () player_axeoldd1 = [ 137.000, player_axeoldd2 ] { self.weaponframe = MOVETYPE_FLY; }; +void () player_axeoldd2 = [ 138.000, player_axeoldd3 ] { self.weaponframe = MOVETYPE_TOSS; }; +void () player_axeoldd3 = [ 139.000, player_axeoldd4 ] { self.weaponframe = MOVETYPE_PUSH; W_FireAxe (); }; +void () player_axeoldd4 = [ 140.000, player_run ] { self.weaponframe = FL_CLIENT; }; + +// MJOLNIR - - - - - +void(float fr, float wf) playham_frame = { + if ( ((self.weapon == IT_AXE && self.perms & IT_CHAINSAW) && mindex_saw) || mindex_hammer ) + self.frame = fr; + + if (wf) { + self.weaponframe=wf; + } else { + if (self.attack_finished <= time + 0.1) + self.weaponframe=0; + else + self.weaponframe=4; + } +}; + +// CHAINSAW - - - - - +void() player_saw1 =[ $light1, player_saw2 ] {playham_frame(26,1); W_FireSaw();}; +void() player_saw2 =[ $light2, player_saw3 ] {playham_frame(27,2); + if (!self.button0) + {player_run ();return;} +}; +void() player_saw3 =[ $light1, player_saw4 ] {playham_frame(26,3); W_FireSaw();}; +void() player_saw4 =[ $light2, player_saw5 ] {playham_frame(27,4); + if (!self.button0) + {player_run ();return;} +}; +void() player_saw5 =[ $light1, player_saw6 ] {playham_frame(26,5); W_FireSaw();}; +void() player_saw6 =[ $light2, player_run ] {playham_frame(27,6);}; + +//============================================================================ +void() player_stand1 =[ $axstnd1, player_stand1 ] { + self.weaponframe=0; + if (self.velocity_x || self.velocity_y) { + self.walkframe=0; + player_run(); + return; + } + + if (self.weapon == IT_AXE) { + if (self.walkframe >= 12) self.walkframe = 0; + self.frame = $axstnd1 + self.walkframe; + } else { + if (self.walkframe >= 5) self.walkframe = 0; + self.frame = $stand1 + self.walkframe; + } + self.walkframe = self.walkframe + 1; +}; + +//============================================================================ +void() player_run =[ $rockrun1, player_run ] { + + // Get out of any weapon animation + self.weaponframe = 0; + // Standing around has different animation sets + if (!self.velocity_x && !self.velocity_y) { + self.walkframe = 0; + player_stand1(); + return; + } + // make sure correct player animation active + if (self.weapon == IT_AXE) { + // Animate the player model. + // Check for chainsaw first because it needs a different player model. + if (self.perms & IT_CHAINSAW) { + // In Zerstorer, when the fifth idle frame was reached, the frame + // looped back to the first and the saw idle sound was played. + // In Drake, the frames are grouped, so play sound periodically. + if (self.saw_time <= time) + if (self.view_ofs != '0 0 0') + { // Volume used to be 1, but Tronyn et.al. wanted it quieter. + // Pity, it was fun loud. + sound (self, CHAN_AUTO, "weapons/sawridle.wav", 0.5, ATTN_NORM); + self.saw_time = time + 0.5; + } + + if (mindex_saw) { + // Animate player model. + if (self.walkframe >= 5) + self.walkframe = 0; + + self.walkframe = self.walkframe + 1; + return; + } + // ELSE... using standard player.mdl instead. + } else { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = $axrun1 + self.walkframe; + } + } + else { + if (self.weapon == IT2_GRAPPLE) { + if (self.hook) + if (self.hook.count) + self.weaponframe = 1; // Hook is still out. + } + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = self.frame + self.walkframe; + } + + + + + + // Check for player feet sound, using velocity & ground flag + if ((self.walkframe == 2 || self.walkframe == 5) && + self.flags & FL_ONGROUND) { + self.cnt = fabs(self.velocity_x + self.velocity_y); + // Need to be moving before feet sounds + if (self.cnt > 50) monster_footstep(FALSE); + } + // Update frame + self.walkframe = self.walkframe + 1; +}; + +//============================================================================ +void() player_run_nofeet =[ $rockrun1, player_run ] { + + // Get out of any weapon animation + self.weaponframe = 0; + // Standing around has different animation sets + if (!self.velocity_x && !self.velocity_y) { + self.walkframe = 0; + player_stand1(); + return; + } + // make sure correct player animation active + if (self.weapon == IT_AXE) { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = $axrun1 + self.walkframe; + } + else { + if (self.walkframe >= 6) self.walkframe = 0; + self.frame = self.frame + self.walkframe; + } + + // Update frame + self.walkframe = self.walkframe + 1; +}; + +//---------------------------------------------------------------------- +void(entity targ) remoteplayer_run = +{ + local entity tself; + tself = self; self = targ; + // This has to run the block above otherwise weaponframe errors + // the animation code "xx = [ $x, x ]" has to be run + // The above code cannot be pasted into this function + // Be careful with this function, it needs a certain layout! + player_run_nofeet(); + self = tself; +}; + + +//============================================================================ +void() player_sgreset = [$shotatt1, player_sg2 ] {self.weaponframe=1;}; + +/* +//============================================================================ +//ZOID-- +void() player_grapple3; +void() player_grapple4; +void() player_grapple5; + +void() player_grapple1 = [$axattd1, player_grapple2 ] + { self.weaponframe=1; W_FireGrapple(); }; +// { self.weaponframe=2; W_FireGrapple(); }; +void() player_grapple2 = [$axattd2, player_grapple3 ] + { self.weaponframe=2; }; +// { self.weaponframe=3; }; +void() player_grapple3 = [$axattd3, player_grapple3 ] + { +// self.weaponframe=3; + self.weaponframe=2; + if (!self.hook_out) { + player_grapple5(); + return; + } + if (vlen(self.hook.origin - self.origin) >= 50) { + if (self.on_hook) { + player_grapple4(); + return; + } + } + }; +void() player_grapple4 = [$deathc4, player_grapple4 ] + { +// self.weaponframe=4; + self.weaponframe=2; + if (!self.hook_out) { + player_grapple5(); + return; + } + if (vlen(self.hook.origin - self.origin) < 50 || !self.on_hook) { + player_grapple3(); + return; + } + }; +void() player_grapple5 = [$axattd4, player_run ] +// {self.weaponframe=5;}; + {self.weaponframe=1;}; +//--ZOID +//============================================================================ +*/ + +void() player_sg1 = [$shotatt1, player_sg2 ] { self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireShotgun (); +}; +void() player_sg2 = [$shotatt2, player_sg3 ] { self.weaponframe=2; }; +void() player_sg3 = [$shotatt3, player_sg4 ] { self.weaponframe=3; }; +void() player_sg4 = [$shotatt4, player_sg5 ] { self.weaponframe=4; }; +void() player_sg5 = [$shotatt5, player_sg1 ] { self.weaponframe=5; }; + +//============================================================================ +void() player_ssgreset = [$shotatt1, player_supersg2 ] {self.weaponframe=1;}; + +void() player_supersg1 = [$shotatt1, player_supersg2 ] { self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireSuperShotgun (); +}; +void() player_supersg2 = [$shotatt2, player_supersg3 ] { self.weaponframe=2; }; +void() player_supersg3 = [$shotatt3, player_supersg4 ] { self.weaponframe=3; }; +void() player_supersg4 = [$shotatt4, player_supersg5 ] { self.weaponframe=4; }; +void() player_supersg5 = [$shotatt5, player_supersg6 ] { self.weaponframe=5; }; +void() player_supersg6 = [$shotatt6, player_supersg1 ] { self.weaponframe=6; + // If player has one shell left, switch to SG after SSG fire animation + if (self.ammo_shells < 2) { forceweaponswitch(0.2); return;}}; + +//============================================================================ +// The Nailgun +//============================================================================ +void(float oframe, float ox) nail_upd = { + if (!self.button0) { player_run(); return; } + self.weaponframe = oframe; + W_FireSpikes (0,ox); +}; + +void() player_nail1 = [$nailatt1, player_nail2 ] {nail_upd(1,2);}; +void() player_nail2 = [$nailatt2, player_nail3 ] {nail_upd(2,-2);}; +void() player_nail3 = [$nailatt1, player_nail4 ] {nail_upd(3,2);}; +void() player_nail4 = [$nailatt2, player_nail5 ] {nail_upd(4,-2);}; +void() player_nail5 = [$nailatt1, player_nail6 ] {nail_upd(5,2);}; +void() player_nail6 = [$nailatt2, player_nail7 ] {nail_upd(6,-2);}; +void() player_nail7 = [$nailatt1, player_nail8 ] {nail_upd(7,2);}; +void() player_nail8 = [$nailatt2, player_nail1 ] {nail_upd(8,-2);}; + +//============================================================================ +// The Lava Nailgun +//============================================================================ +void(float cnt, float ox) W_FireLavaSpikes; + +void(float oframe, float ox) lava_nail_upd = { + if (!self.button0) { player_run(); return; } + self.weaponframe = oframe; + W_FireLavaSpikes (0,ox); +}; + +void() player_lava_nail1 = [$nailatt1, player_lava_nail2 ] {lava_nail_upd(1,2);}; +void() player_lava_nail2 = [$nailatt2, player_lava_nail3 ] {lava_nail_upd(2,-2);}; +void() player_lava_nail3 = [$nailatt1, player_lava_nail4 ] {lava_nail_upd(3,2);}; +void() player_lava_nail4 = [$nailatt2, player_lava_nail5 ] {lava_nail_upd(4,-2);}; +void() player_lava_nail5 = [$nailatt1, player_lava_nail6 ] {lava_nail_upd(5,2);}; +void() player_lava_nail6 = [$nailatt2, player_lava_nail7 ] {lava_nail_upd(6,-2);}; +void() player_lava_nail7 = [$nailatt1, player_lava_nail8 ] {lava_nail_upd(7,2);}; +void() player_lava_nail8 = [$nailatt2, player_lava_nail1 ] {lava_nail_upd(8,-2);}; + +//============================================================================ +// The Super Nailgun +// I really liked the idea of saving the frame number of the SNG +// so that when it stops/starts it remembers where it left off +// Unfortunately the gun is reset to frame 0 - the idle state +// when the weapon is not being fired. +// - SNG projectile offset idea by Kinn +//============================================================================ +void(float oframe, float oz, float ox) snail_upd = { + if (!self.button0) { player_run(); return; } + self.weaponframe = oframe; + W_FireSpikes (oz,ox); +}; + +void() player_snail1 = [$nailatt1, player_snail2 ] {snail_upd(1,8,2.5);}; +void() player_snail2 = [$nailatt2, player_snail3 ] {snail_upd(2,5.5,-3.5);}; +void() player_snail3 = [$nailatt1, player_snail4 ] {snail_upd(3,3,2.5);}; +void() player_snail4 = [$nailatt2, player_snail5 ] {snail_upd(4,9,0);}; +void() player_snail5 = [$nailatt1, player_snail6 ] {snail_upd(5,3,-2.5);}; +void() player_snail6 = [$nailatt2, player_snail7 ] {snail_upd(6,5.5,3.5);}; +void() player_snail7 = [$nailatt1, player_snail8 ] {snail_upd(7,8,-2.5);}; +void() player_snail8 = [$nailatt2, player_snail1 ] {snail_upd(8,2,0);}; + +//============================================================================ +// The Lava Super Nailgun +//============================================================================ +void(float oframe, float oz, float ox) lava_snail_upd = { + if (!self.button0) { player_run(); return; } + self.weaponframe = oframe; + W_FireLavaSpikes (oz,ox); +}; + +void() player_lava_snail1 = [$nailatt1, player_lava_snail2 ] {lava_snail_upd(1,8,2.5);}; +void() player_lava_snail2 = [$nailatt2, player_lava_snail3 ] {lava_snail_upd(2,5.5,-3.5);}; +void() player_lava_snail3 = [$nailatt1, player_lava_snail4 ] {lava_snail_upd(3,3,2.5);}; +void() player_lava_snail4 = [$nailatt2, player_lava_snail5 ] {lava_snail_upd(4,9,0);}; +void() player_lava_snail5 = [$nailatt1, player_lava_snail6 ] {lava_snail_upd(5,3,-2.5);}; +void() player_lava_snail6 = [$nailatt2, player_lava_snail7 ] {lava_snail_upd(6,5.5,3.5);}; +void() player_lava_snail7 = [$nailatt1, player_lava_snail8 ] {lava_snail_upd(7,8,-2.5);}; +void() player_lava_snail8 = [$nailatt2, player_lava_snail1 ] {lava_snail_upd(8,2,0);}; + +//============================================================================ +void() player_plasma1 =[$light1, player_plasma2 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = 1; + W_FirePlasma(); +}; +void() player_plasma2 =[$light2, player_plasma1 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = 1; + W_FirePlasma(); +}; + +//============================================================================ +void() player_light1 =[$light1, player_light2 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = 1; + W_FireLightning(); +}; +void() player_light2 =[$light2, player_light1 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = 1; + W_FireLightning(); +}; + +// SHAFT - - - - - - +void() player_tbolt = { + self.effects = self.effects | EF_MUZZLEFLASH; + + if (!self.button0 || intermission_running) {player_run (); return;} + + self.weaponframe = self.weaponframe + 1; + if (self.weapon == IT2_CHAINLIGHTNING) { + if (self.weaponframe == 17) + self.weaponframe = 1; + } else { + if (self.weaponframe == 5) + self.weaponframe = 1; + } + SuperDamageSound (); + if (self.weapon == IT2_CHAINLIGHTNING) { + if (self.tome_finished) { + player_run (); return; + } else { + W_FireThunderbolt (TRUE); + } + } else { + // Thunderbolt + W_FireThunderbolt (self.tome_finished); + } + self.attack_finished = time + 0.2; +}; + +void() player_chainlight1 =[$light1, player_chainlight2 ] {player_tbolt();}; +void() player_chainlight2 =[$light2, player_chainlight3 ] { + if (!self.tome_finished || (self.weapon != IT2_CHAINLIGHTNING)) + self.think = player_chainlight1; // Do before damage. + player_tbolt(); +}; +void() player_chainlight3 =[$light2, player_chainlight1 ] {player_tbolt();}; + +//============================================================================ +void() player_plasmalight1 =[$light1, player_plasmalight1 ] { + if (!self.button0) { player_run(); return; } + self.weaponframe = self.weaponframe + 1; + if (self.weaponframe >= 5) self.weaponframe = 1; + W_FirePlasmaGun(); +}; + +//============================================================================ +void() player_rockreset =[$rockatt1, player_rocket2 ] {self.weaponframe=1;}; + +void() player_rocket1 =[$rockatt1, player_rocket2 ] { + self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireRocket(); +}; +void() player_rocket2 =[$rockatt2, player_rocket3 ] { self.weaponframe=2;}; +void() player_rocket3 =[$rockatt3, player_rocket4 ] { self.weaponframe=3;}; +void() player_rocket4 =[$rockatt4, player_rocket5 ] { self.weaponframe=4;}; +void() player_rocket5 =[$rockatt5, player_rocket6 ] { self.weaponframe=5;}; +void() player_rocket6 =[$rockatt6, player_rocket1 ] { self.weaponframe=6;}; + +void() player_multi_rocket1 =[$rockatt1, player_multi_rocket2 ] { + self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireMultiRocket(); +}; +void() player_multi_rocket2 =[$rockatt2, player_multi_rocket3 ] { self.weaponframe=2;}; +void() player_multi_rocket3 =[$rockatt3, player_multi_rocket4 ] { self.weaponframe=3;}; +void() player_multi_rocket4 =[$rockatt4, player_multi_rocket5 ] { self.weaponframe=4;}; +void() player_multi_rocket5 =[$rockatt5, player_multi_rocket6 ] { self.weaponframe=5;}; +void() player_multi_rocket6 =[$rockatt6, player_multi_rocket1 ] { self.weaponframe=6;}; + +//============================================================================ +void() player_grenreset =[$rockatt1, player_grenade2 ] {self.weaponframe=1;}; + +void() player_grenade1 =[$rockatt1, player_grenade2 ] { + self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireGrenade(); +}; +void() player_grenade2 =[$rockatt2, player_grenade3 ] { self.weaponframe=2;}; +void() player_grenade3 =[$rockatt3, player_grenade4 ] { self.weaponframe=3;}; +void() player_grenade4 =[$rockatt4, player_grenade5 ] { self.weaponframe=4;}; +void() player_grenade5 =[$rockatt5, player_grenade6 ] { self.weaponframe=5;}; +void() player_grenade6 =[$rockatt6, player_grenade1 ] { self.weaponframe=6;}; + +void() W_FireProximityGrenade; + +void() player_prox_grenade1 =[$rockatt1, player_prox_grenade2 ] { + self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireProximityGrenade(); +}; +void() player_prox_grenade2 =[$rockatt2, player_prox_grenade3 ] { self.weaponframe=2;}; +void() player_prox_grenade3 =[$rockatt3, player_prox_grenade4 ] { self.weaponframe=3;}; +void() player_prox_grenade4 =[$rockatt4, player_prox_grenade5 ] { self.weaponframe=4;}; +void() player_prox_grenade5 =[$rockatt5, player_prox_grenade6 ] { self.weaponframe=5;}; +void() player_prox_grenade6 =[$rockatt6, player_prox_grenade1 ] { self.weaponframe=6;}; + +void() player_multi_grenade1 =[$rockatt1, player_multi_grenade2 ] { + self.weaponframe=1; + if (!self.button0) { player_run(); return; } + W_FireMultiGrenade(); +}; +void() player_multi_grenade2 =[$rockatt2, player_multi_grenade3 ] { self.weaponframe=2;}; +void() player_multi_grenade3 =[$rockatt3, player_multi_grenade4 ] { self.weaponframe=3;}; +void() player_multi_grenade4 =[$rockatt4, player_multi_grenade5 ] { self.weaponframe=4;}; +void() player_multi_grenade5 =[$rockatt5, player_multi_grenade6 ] { self.weaponframe=5;}; +void() player_multi_grenade6 =[$rockatt6, player_multi_grenade1 ] { self.weaponframe=6;}; + +void() player_crossbow1 =[1, player_crossbow2] {self.weaponframe = 1; + if (!self.button0) {player_run(); return; } + if (self.ammo_poison > 0) { + W_Fire_Crossbow_Poison(); + } else { + W_Fire_Crossbow(); + } +}; +void() player_crossbow2 =[2, player_crossbow3] {self.weaponframe = 2;}; +void() player_crossbow3 =[3, player_crossbow4] {self.weaponframe = 3;}; +void() player_crossbow4 =[4, player_crossbow5] {self.weaponframe = 4;}; +void() player_crossbow5 =[5, player_crossbow6] {self.weaponframe = 5;}; +void() player_crossbow6 =[6, player_crossbow7] {self.weaponframe = 6;}; +void() player_crossbow7 =[0, player_crossbow8] {self.weaponframe = 0;}; +void() player_crossbow8 =[0, player_crossbow1] { + self.weaponframe = 0; + if (self.ammo_poison < 1) W_SetCurrentAmmo(self); +}; + +void () player_hammer1 = [ 32.000, player_hammer2 ] { self.weaponframe = 1; }; +void () player_hammer2 = [ 33.000, player_hammer3 ] { self.weaponframe = 2; }; +void () player_hammer3 = [ 34.000, player_hammer4 ] { self.weaponframe = 3; }; +void () player_hammer4 = [ 35.000, player_hammer5 ] { self.weaponframe = 4; + W_FireMjolnir (); }; +void () player_hammer5 = [ 36.000, player_hammer6 ] { self.weaponframe = 4; }; +void () player_hammer6 = [ 37.000, player_run ] { self.weaponframe = 4; }; + +void () player_mjolnir1 = [ 38.000, player_mjolnir2 ] { self.weaponframe = 1; }; +void () player_mjolnir2 = [ 39.000, player_mjolnir3 ] { self.weaponframe = 2; }; +void () player_mjolnir3 = [ 40.000, player_mjolnir4 ] { self.weaponframe = 3; }; +void () player_mjolnir4 = [ 41.000, player_mjolnir5 ] { self.weaponframe = 4; + W_FireMjolnir (); }; +void () player_mjolnir5 = [ 42.000, player_mjolnir6 ] { self.weaponframe = 4; }; +void () player_mjolnir6 = [ 43.000, player_run ] { self.weaponframe = 4; }; + +void () player_laser1 = [ 103.000, player_laser3 ] { self.attack_finished = (time + 0.100); self.weaponframe = 1; self.nextthink = (time + 0.100); + if (!self.button0) {player_run(); return; } + W_FireLaser (0); +}; +void () player_laser2 = [ 104.000, player_laser3 ] { self.attack_finished = (time + 0.100); self.weaponframe = 2; self.nextthink = (time + 0.100); }; +void () player_laser3 = [ 104.000, player_laser1 ] { self.attack_finished = (time + 0.100); self.weaponframe = 4; self.nextthink = (time + 0.100); + if (!self.button0) {player_run(); return; } + W_FireLaser (TRUE); +}; +void () player_laser4 = [ 103.000, player_laser1 ] { self.attack_finished = (time + 0.100); self.weaponframe = 5; self.nextthink = (time + 0.100); }; + +// LASER - - - - - - +// Sets up timings for blaster and auto shotgun. +void() player_startblast = + {self.baha_time = time; self.nextthink = time + 4/30;}; + +void(float fr) player_blaster = +{ + local float am; + + am = self.baha_time + 4/30; + if (am < self.nextthink) // Firing rate can't be faster than T+0.1. + am = self.nextthink; + self.nextthink = self.baha_time = am; + + self.weaponframe = fr; + self.attack_finished = time + 0.2; + W_FireLaser(2); +}; +void() player_blast1 =[ $nailatt1, player_blast2 ] {player_startblast(); player_blaster(1);}; +void() player_blast2 =[ $nailatt2, player_blast3 ] { if (self.attack_finished < time) player_blaster(2);}; // NOTE: Use '0' instead if using old color-swapped shotgun. +void() player_blast3 =[ $nailatt1, player_blast2 ] { if (self.attack_finished < time)player_blaster(1);}; + +// MAGIC - - - - - - +void() player_wand1 =[$nailatt1, player_wand2 ] {self.weaponframe=1; + self.effects = self.effects | EF_MUZZLEFLASH;}; +void() player_wand2 =[$nailatt2, player_wand3 ] {self.weaponframe=2;}; +void() player_wand3 =[$nailatt2, player_wand4 ] {self.weaponframe=3;}; +void() player_wand4 =[$nailatt2, player_wand5 ] {self.weaponframe=4;}; +void() player_wand5 =[$nailatt2, player_run ] {if (!self.button0) player_run();}; + +//---------------------------------------------------------------------- +// Only used for the player when they die +//---------------------------------------------------------------------- +void() misc_bubble_bob; +void() death_bubble_spawn = +{ + local entity bubble; + + if (self.owner.waterlevel != 3) return; + + bubble = spawn(); + bubble.classname = "bubble"; + bubble.solid = SOLID_NOT; + bubble.movetype = MOVETYPE_NOCLIP; + setmodel (bubble, SBUBBLE_DROWN); + bubble.frame = bubble.cnt = 0; + setorigin (bubble, self.owner.origin + '0 0 24'); + setsize (bubble, '-8 -8 -8', '8 8 8'); + bubble.velocity = '0 0 15'; + bubble.nextthink = time + 0.5; + bubble.think = misc_bubble_bob; + + self.nextthink = time + 0.1; + self.think = death_bubble_spawn; + self.air_finished = self.air_finished + 1; + if (self.air_finished >= self.bubble_count) remove(self); +}; + +//---------------------------------------------------------------------- +void(float num_bubbles) death_bubbles = +{ + local entity bubble_spawner; + + bubble_spawner = spawn(); + bubble_spawner.owner = self; + bubble_spawner.air_finished = 0; + bubble_spawner.bubble_count = num_bubbles; + setorigin (bubble_spawner, self.origin); + bubble_spawner.nextthink = time + 0.1; + bubble_spawner.think = death_bubble_spawn; +}; + +//============================================================================ +void() PainSound = +{ + if (self.health < 0) return; + if (self.pain_finished > time) { self.axhitme = 0; return; } + + // don't make multiple pain sounds right after each other + self.pain_finished = time + 0.5; + + if (damage_attacker.classname == "teledeath") { + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + } + // water pain sounds + else if (self.watertype == CONTENT_WATER && self.waterlevel == 3) { + death_bubbles(1); + if (random() > 0.5) sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM); + } + // slime pain sounds + else if (self.watertype == CONTENT_SLIME) { + // FIX ME put in some steam here + if (random() > 0.5) sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + } + else if (self.watertype == CONTENT_LAVA) { + if (random() > 0.5) sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + else sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + } + else { + // ax pain sound + if (self.axhitme == 1) { + self.axhitme = 0; + // Player been hit by an axe (MP thing) + sound (self, CHAN_VOICE, SOUND_AXE_PLAYER, 1, ATTN_NORM); + } + else { + self.lip = rint((random() * 5) + 1); + if (self.lip == 1) self.noise = "player/pain1.wav"; + else if (self.lip == 2) self.noise = "player/pain2.wav"; + else if (self.lip == 3) self.noise = "player/pain3.wav"; + else if (self.lip == 4) self.noise = "player/pain4.wav"; + else if (self.lip == 5) self.noise = "player/pain5.wav"; + else self.noise = "player/pain6.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + } + } +}; + +//============================================================================ +void() player_pain1 = [ $pain1, player_pain2 ] {PainSound();self.weaponframe=0;}; +void() player_pain2 = [ $pain2, player_pain3 ] {}; +void() player_pain3 = [ $pain3, player_pain4 ] {}; +void() player_pain4 = [ $pain4, player_pain5 ] {}; +void() player_pain5 = [ $pain5, player_pain6 ] {}; +void() player_pain6 = [ $pain6, player_run ] {}; + +void() player_axpain1 = [ $axpain1, player_axpain2 ] {PainSound();self.weaponframe=0;}; +void() player_axpain2 = [ $axpain2, player_axpain3 ] {}; +void() player_axpain3 = [ $axpain3, player_axpain4 ] {}; +void() player_axpain4 = [ $axpain4, player_axpain5 ] {}; +void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; +void() player_axpain6 = [ $axpain6, player_run ] {}; + +//============================================================================ +void(entity inflictor, entity attacker, float damage) player_pain = +{ + if (self.weaponframe) return; + if (self.invisible_finished > time) return; // eyes don't have pain frames + if (self.weapon == IT_AXE) player_axpain1 (); + if (self.weapon == IT2_GRAPPLE) + { // No pain while the hook is out. + if (self.hook) + return; + } + else player_pain1 (); +}; + +//============================================================================ +void() player_dead = +{ + self.nextthink = -1; + // allow respawn after a certain time + self.deadflag = DEAD_DEAD; +}; + +//============================================================================ +void() player_diea1 = [ $deatha1, player_diea2 ] {}; +void() player_diea2 = [ $deatha2, player_diea3 ] {}; +void() player_diea3 = [ $deatha3, player_diea4 ] {}; +void() player_diea4 = [ $deatha4, player_diea5 ] {}; +void() player_diea5 = [ $deatha5, player_diea6 ] {}; +void() player_diea6 = [ $deatha6, player_diea7 ] {}; +void() player_diea7 = [ $deatha7, player_diea8 ] {}; +void() player_diea8 = [ $deatha8, player_diea9 ] {}; +void() player_diea9 = [ $deatha9, player_diea10 ] {}; +void() player_diea10 = [ $deatha10, player_diea11 ] {}; +void() player_diea11 = [ $deatha11, player_diea11 ] {player_dead();}; + +void() player_dieb1 = [ $deathb1, player_dieb2 ] {}; +void() player_dieb2 = [ $deathb2, player_dieb3 ] {}; +void() player_dieb3 = [ $deathb3, player_dieb4 ] {}; +void() player_dieb4 = [ $deathb4, player_dieb5 ] {}; +void() player_dieb5 = [ $deathb5, player_dieb6 ] {}; +void() player_dieb6 = [ $deathb6, player_dieb7 ] {}; +void() player_dieb7 = [ $deathb7, player_dieb8 ] {}; +void() player_dieb8 = [ $deathb8, player_dieb9 ] {}; +void() player_dieb9 = [ $deathb9, player_dieb9 ] {player_dead();}; + +void() player_diec1 = [ $deathc1, player_diec2 ] {}; +void() player_diec2 = [ $deathc2, player_diec3 ] {}; +void() player_diec3 = [ $deathc3, player_diec4 ] {}; +void() player_diec4 = [ $deathc4, player_diec5 ] {}; +void() player_diec5 = [ $deathc5, player_diec6 ] {}; +void() player_diec6 = [ $deathc6, player_diec7 ] {}; +void() player_diec7 = [ $deathc7, player_diec8 ] {}; +void() player_diec8 = [ $deathc8, player_diec9 ] {}; +void() player_diec9 = [ $deathc9, player_diec10 ] {}; +void() player_diec10 = [ $deathc10, player_diec11 ] {}; +void() player_diec11 = [ $deathc11, player_diec12 ] {}; +void() player_diec12 = [ $deathc12, player_diec13 ] {}; +void() player_diec13 = [ $deathc13, player_diec14 ] {}; +void() player_diec14 = [ $deathc14, player_diec15 ] {}; +void() player_diec15 = [ $deathc15, player_diec15 ] {player_dead();}; + +void() player_died1 = [ $deathd1, player_died2 ] {}; +void() player_died2 = [ $deathd2, player_died3 ] {}; +void() player_died3 = [ $deathd3, player_died4 ] {}; +void() player_died4 = [ $deathd4, player_died5 ] {}; +void() player_died5 = [ $deathd5, player_died6 ] {}; +void() player_died6 = [ $deathd6, player_died7 ] {}; +void() player_died7 = [ $deathd7, player_died8 ] {}; +void() player_died8 = [ $deathd8, player_died9 ] {}; +void() player_died9 = [ $deathd9, player_died9 ] {player_dead();}; + +void() player_diee1 = [ $deathe1, player_diee2 ] {}; +void() player_diee2 = [ $deathe2, player_diee3 ] {}; +void() player_diee3 = [ $deathe3, player_diee4 ] {}; +void() player_diee4 = [ $deathe4, player_diee5 ] {}; +void() player_diee5 = [ $deathe5, player_diee6 ] {}; +void() player_diee6 = [ $deathe6, player_diee7 ] {}; +void() player_diee7 = [ $deathe7, player_diee8 ] {}; +void() player_diee8 = [ $deathe8, player_diee9 ] {}; +void() player_diee9 = [ $deathe9, player_diee9 ] {player_dead();}; + +void() player_die_ax1 = [ $axdeth1, player_die_ax2 ] {}; +void() player_die_ax2 = [ $axdeth2, player_die_ax3 ] {}; +void() player_die_ax3 = [ $axdeth3, player_die_ax4 ] {}; +void() player_die_ax4 = [ $axdeth4, player_die_ax5 ] {}; +void() player_die_ax5 = [ $axdeth5, player_die_ax6 ] {}; +void() player_die_ax6 = [ $axdeth6, player_die_ax7 ] {}; +void() player_die_ax7 = [ $axdeth7, player_die_ax8 ] {}; +void() player_die_ax8 = [ $axdeth8, player_die_ax9 ] {}; +void() player_die_ax9 = [ $axdeth9, player_die_ax9 ] {player_dead();}; + +//============================================================================ +void() player_death_sound = +{ + // water death sounds + if (self.waterlevel == 3) { + death_bubbles(20); + sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE); + } + else { + self.lip = rint ((random() * 4) + 1); + if (self.lip == 2) self.noise = "player/death2.wav"; + else if (self.lip == 3) self.noise = "player/death3.wav"; + else if (self.lip == 4) self.noise = "player/death4.wav"; + else if (self.lip == 5) self.noise = "player/death5.wav"; + else self.noise = "player/death1.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE); + } +}; + +//============================================================================ +void() player_gib = +{ + // Set all gib/death flags correctly + self.gibbed = TRUE; + self.deadflag = DEAD_DEAD; + self.takedamage = DAMAGE_NO; + self.nextthink = -1; + + // Let the head model bounce around + self.movetype = MOVETYPE_BOUNCE; + setmodel (self, self.headmdl); + setsize (self, '-16 -16 0', '16 16 32'); + self.frame = 0; // Reset frame, head model only has 1 frame + self.height = 1; // Do not remove after model fadeout + + + ThrowGib(1, 1); + ThrowGib(2, 1); + ThrowGib(3, 1); + ThrowGib(4, rint(random()*2)); + ThrowGib(5, 1); + + // Lots of vertical momentum + self.velocity_x = 50 * crandom(); + self.velocity_y = 50 * crandom(); + self.velocity_z = 200 + 100 * random(); + + // Minimal angle rotation + self.avelocity = '0 0 0'; + self.avelocity_y = 200 + random() * 200; + self.angles = '0 0 0'; + self.angles_y = self.ideal_yaw = random() * 360; + + // Play GIB death sound + if (damage_attacker.classname == "teledeath") + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + else if (damage_attacker.classname == "teledeath2") + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + else { + if (random() < 0.5) sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE); + else sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE); + } +}; + +//============================================================================ +void() player_death = +{ + // don't let sbar look bad if a player + if (self.health < -99) self.health = -99; + if (deathmatch || coop) DropBackpack(); + + // Remove all powerup/debuff effects + ResetPowerSystem(self); + ResetDebuffSystem(self); + + self.weaponmodel=""; + self.view_ofs = '0 0 8'; + self.deadflag = DEAD_DYING; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_TOSS; + + // Remove floor/ground flag, time to fly + self.flags = self.flags - (self.flags & FL_ONGROUND); + setorigin(self, self.origin + '0 0 1'); + + // Did the player explode from high damage? + if (self.health < self.gibhealth) player_gib(); + else { + player_death_sound(); + self.angles_x = self.angles_z = 0; + if (self.velocity_z < 10) + self.velocity_z = self.velocity_z + random()*300; + + if (self.weapon == IT_AXE) player_die_ax1 (); + else { + self.lip = 1 + floor(random()*6); + if (self.lip == 1) player_diea1(); + else if (self.lip == 2) player_dieb1(); + else if (self.lip == 3) player_diec1(); + else if (self.lip == 4) player_died1(); + else player_diee1(); + } + } +}; + +//============================================================================ +void() set_suicide_frame = +{ + // used by kill command and diconnect command + if (self.gibbed == TRUE) return; // already gibbed + self.frame = $deatha11; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_TOSS; + self.deadflag = DEAD_DEAD; + self.nextthink = -1; +}; diff --git a/QC_other/QC_keep/precache_keep.qc b/QC_other/QC_keep/precache_keep.qc new file mode 100644 index 00000000..d9c1235e --- /dev/null +++ b/QC_other/QC_keep/precache_keep.qc @@ -0,0 +1,134 @@ +void() precache_poisongibs; + +void() PrecacheAll = { + precache_sound ("hipitems/empathy2.wav"); // Empathy shield sound + precache_sound ("misc/wetsuit.wav"); // Wetsuit noise + precache_sound ("shield/hit.wav"); // Power Shield hit + precache_sound ("shield/fadeout.wav"); // Power Shield fadeout + precache_sound ("belt/use.wav"); // Antigrav ping + precache_sound ("belt/fadeout.wav"); // Antigrav fadeout + precache_sound ("pyro/fstop.wav"); // For dragon fire + precache_sound ("pyro/flame.wav"); // For dragon fire + precache_sound ("weapons/crossbow_fire.wav"); + precache_sound ("hipweap/laserric.wav"); + precache_sound ("hipweap/laserg.wav"); + precache_sound ("hipweap/mjolslap.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("hipweap/mjoltink.wav"); + precache_sound ("hipweap/proxwarn.wav"); + precache_sound ("hipweap/proxbomb.wav"); + precache_sound ("weapons/crossbow_rdy.wav"); + precache_sound ("spider/hiss2.wav"); + precache_sound ("lavagun/snail.wav"); + precache_sound ("boss1/sight1.wav"); + precache_sound ("plasma/explode.wav"); + precache_sound ("plasma/fire.wav"); + precache_sound ("plasma/flight.wav"); + precache_sound ("items2/trinend.wav"); + precache_sound ("items2/crosend.wav"); + precache_sound ("items2/crosuse.wav"); + precache_sound ("items/inv3.wav"); + precache_sound ("items/inv2.wav"); + precache_sound ("items/suit2.wav"); + //precache_sound ("items/suit3.wav"); + precache_sound ("items/wetsuit3.wav"); + precache_sound ("items/wetsuit3out.wav"); + precache_sound ("items/wetsuit2.wav"); + precache_sound ("items/damage2.wav"); + precache_sound ("items/sharp2.wav"); + precache_sound ("items/protect2.wav"); + precache_sound ("items/nailp2.wav"); + precache_sound ("items/sharp3.wav"); + precache_sound ("nour/idle1.wav"); + precache_sound ("weapons/expl1.wav"); + precache_sound ("weapons/shatter.wav"); + precache_sound ("cube/bc_gulp.wav"); + precache_sound ("cube/bc_attck.wav"); + precache_sound ("gibfnt/gf_plop.wav"); + precache_sound ("player/udeath.wav"); + precache_sound ("boss1/out1.wav"); + precache_sound ("nemesant/bigboom.wav"); + precache_sound ("weapons/sawguts.wav"); + precache_sound ("weapons/r_exp3a.wav"); + precache_sound ("items/money.wav"); + precache_sound ("ambience/thunder1.wav"); + precache_sound ("ambience/thunder2.wav"); + precache_sound ("weapons/axhit.wav"); + precache_sound ("items/levitate.wav"); + precache_sound ("ambience/wingend.wav"); + precache_sound ("shambler/smack.wav"); + precache_sound ("weapons/sawguts.wav"); + precache_sound ("weapons/chain1.wav"); + precache_sound ("items/reflect3.wav"); + precache_sound ("zombie/z_hit.wav"); + precache_sound ("weapons/stunfire.wav"); + precache_sound ("weapons/sawidle.wav"); + precache_sound ("weapons/sawatck.wav"); + precache_sound ("weapons/sawridle.wav"); + precache_sound ("weapons/clang.wav"); + precache_sound ("weapons/axhitwal.wav"); + precache_sound ("weapons/bolt_hit1.wav"); + precache_sound ("weapons/bolt_hit4.wav"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("xmas/raindeer/hit.wav"); + + precache_model ("progs/null.mdl"); + //precache_model ("progs/drake/null_256.spr"); + precache_model ("progs/beamhit.spr"); + precache_model ("progs/custents/dring.spr"); + precache_model ("progs/k_spike.mdl"); + precache_model ("progs/drake/s_explod.spr"); + precache_model ("progs/smlexp.spr"); + precache_model ("progs/medexp.spr"); // For dragon fire + precache_model ("progs/hipnotic/lasrspik.mdl"); + precache_model ("progs/hipnotic/proxbomb.mdl"); + precache_model ("progs/g_crossbow.mdl"); + precache_model ("progs/v_crossbow1.mdl"); + precache_model ("progs/v_crossbow2.mdl"); + precache_model ("progs/hipnotic/v_prox.mdl"); + precache_model ("progs/v_plasma2.mdl"); + precache_model ("progs/v_lava.mdl"); + precache_model ("progs/v_lava2.mdl"); + precache_model ("progs/v_multi.mdl"); + precache_model ("progs/v_multi2.mdl"); + precache_model ("progs/hipnotic/v_laserg.mdl"); + precache_model ("progs/hipnotic/v_hammer.mdl"); //mjolnir + precache_model ("progs/hipnotic/playham.mdl"); // player with the hammer + precache_model ("progs/v_ham.mdl"); //warhammer from quoth + precache_model ("progs/drake/v_wand.mdl"); + precache_model ("progs/ad171/proj_bolt1.mdl"); + precache_model ("progs/ad171/proj_bolt2.mdl"); + precache_model ("progs/lspike.mdl"); + precache_model ("progs/rogue/mervup.mdl"); + precache_model ("progs/rockup_d.mdl"); + precache_model ("progs/rockup.mdl"); + precache_model ("progs/plasma.mdl"); + precache_model ("progs/h_shal.mdl"); + precache_model ("progs/drake/ice_cube.mdl"); + precache_model ("progs/drake/iceball.mdl"); + precache_model ("progs/zom_gib.mdl"); + precache_model ("progs/drake/gr_gib.mdl"); + precache_model ("progs/drake/pur_gib.mdl"); + precache_model ("progs/drake/ember.mdl"); + precache_model ("progs/drake/s_spark.spr"); + precache_model ("progs/drake/acidbal1.mdl"); + precache_model ("progs/drake/s_fancy.spr"); + precache_model ("progs/drake/beam.mdl"); // Used by TE_BEAM. + precache_model ("progs/drake/hook.mdl"); + precache_model ("progs/drake/v_grpple.mdl"); + precache_model ("progs/drake/v_light2.mdl"); + precache_model ("progs/drake/v_rocks.mdl"); + precache_model ("progs/drake/v_laserb.mdl"); + precache_model ("progs/drake/v_laserg.mdl"); + precache_model ("progs/drake/v_saw.mdl"); + precache_model ("progs/drake/playham.mdl"); + precache_model ("progs/drake/playham0.mdl"); + precache_model ("progs/drake/playsaw.mdl"); + precache_model ("progs/custents/beam.mdl"); // phase beam + precache_model ("progs/ad171/proj_laz.mdl"); + precache_model ("progs/ad171/proj_gaplasmagrn.mdl"); + precache_model ("progs/ad171/proj_lightning2.mdl"); + precache_model ("progs/ad171/proj_grenadegrn.mdl"); + precache_model ("progs/ad171/proj_swampling.mdl"); + precache_poisongibs(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/progs.dat2keep - Shortcut.lnk b/QC_other/QC_keep/progs.dat2keep - Shortcut.lnk new file mode 100644 index 00000000..f378b687 Binary files /dev/null and b/QC_other/QC_keep/progs.dat2keep - Shortcut.lnk differ diff --git a/QC_other/QC_keep/progs.src b/QC_other/QC_keep/progs.src new file mode 100644 index 00000000..361777b4 --- /dev/null +++ b/QC_other/QC_keep/progs.src @@ -0,0 +1,284 @@ +../progs.dat + +defs.qc +defskeep.qc +defsclass.qc +defsextras.qc +defscustom.qc +defshipnotic.qc +defsnehahra.qc +defsrogue.qc +defsrubicon.qc +defsquoth.qc +defskinn.qc +defsdrake.qc +dpextensions.qc +mathlib.qc +math.qc + +subs.qc +subs_soc.qc +subs_kinn.qc +subs_keep.qc +subs_drake.qc +subs_rubicon.qc +subs_extras.qc +drake_box.qc +//drake_armor.qc +hiprot.qc +estate.qc +globalfog.qc +settings.qc +impulse.qc +breakable.qc +pushable.qc + +part_manage.qc +part_generate.qc +part_emitter.qc + +drake_aim.qc + +ai_drake.qc +ai_doom.qc +ai_blood.qc +ai_gibs.qc +ai_gibskeep.qc +ai_enemytarget.qc +ai_pathcorner.qc +ai_checkattack.qc +ai_tether.qc +fx.qc +fx_nehahra.qc +ai_ammoresist.qc +hiphorn.qc +ai_subs.qc +ai_subskeep.qc +ai_states.qc +ai_combat.qc +ai_combatkeep.qc +ai_minions.qc +ai_fly.qc // from Quoth +fx_drake.qc +drake_cool.qc +drake_fire.qc + +precache_keep.qc +world.qc +client_mapvar.qc +client_debuff.qc +client_power.qc +client.qc +client_obituary.qc +client_camera.qc +client_info.qc +misc_globalstate.qc +monsters.qc +monsters_drake.qc +drake_respawn.qc +items.qc +items_keep.qc +items_drake.qc +projectiles.qc +projectiles_keep.qc +projectiles_drake.qc +weapons.qc +drake_hook.qc +player.qc +triggers_states.qc +triggers.qc +triggers_keep.qc +targets.qc +func.qc +func_doors.qc +func_doorsecret.qc +func_buttons.qc +func_pswitch.qc +func_insvolume.qc +elevatr.qc +func_plats.qc +func_keep.qc +func_trains.qc +misc.qc +misc_keep.qc +misc_quoth.qc +misc_drake.qc +misc_textbook.qc +misc_targetdummy.qc +misc_props.qc +traps.qc +traps_hipnotic.qc +traps_pendulum.qc +traps_sawblade.qc +traps_turret.qc +lights.qc +sounds.qc +soundskeep.qc +misc_rubicon2.qc +versus.qc + +// Monsters +mon_demon.qc +mon_dog.qc +mon_fish.qc +mon_hknight.qc +mon_knight.qc +mon_ogre.qc +mon_enforcer.qc +mon_enforcers_lunaran.qc // Lunaran stuff, located here to inherit $frame references from mon_enforcer.qc +mon_shalrath.qc +mon_shambler.qc +mon_soldier.qc +mon_tarbaby.qc +mon_wizard.qc +mon_zombie.qc + +// AD Monsters +mon_boil.qc +mon_centurion.qc +mon_dcrossbow.qc +mon_dfury.qc +mon_dguard.qc +mon_dknight.qc +mon_swampling.qc + +// Kinn monster, here because of shared frame macros +mon_dchampion.qc + +// AD Monsters continued... +mon_drole.qc +mon_dsergeant.qc +mon_freddie.qc +mon_gargoyle.qc +mon_gaunt.qc +mon_golem.qc +mon_hogre.qc +mon_hogreham.qc +mon_hogremac.qc +mon_jim.qc +mon_lostsoul.qc +mon_minotaur.qc +mon_pyro.qc +mon_scorpion.qc +mon_seeker.qc +mon_skullwiz.qc +mon_spider.qc +mon_voreling.qc +mon_wraith.qc +mon_zombiek.qc + +// Xmas Monsters +mon_xmas_elf.qc +mon_xmas_raindeer.qc +mon_xmas_snowman.qc +mon_xmas_santa.qc + +// AD's ID1 Bosses +mon_bossidchthon.qc +mon_bossidshub.qc +mon_bossxxchthon.qc +mon_bossxxshub.qc + +// AD Bosses +mon_bossboglord.qc +mon_bosseidolon.qc +mon_bossfiretop.qc +mon_bossicegolem.qc +mon_bosslichfiend.qc +mon_bossnour.qc + +// Hipnotic stuff +mon_armagon.qc +mon_centroid.qc +mon_spikemine.qc +mon_gremlin.qc +hiprubbl.qc +hip_part.qc +hip_brk.qc +hip_expl.qc +hipclock.qc + +// Rogue stuff +mon_eel.qc +mon_invis_sw.qc +mon_lavaman.qc +mon_mummy.qc +mon_wrath.qc +mon_wrath_overlord.qc +mon_morph.qc +mon_dragon.qc +mon_tarbabymitosis.qc +earthq.qc + +// Kinn stuff + +mon_ogreflak.qc +mon_supergrunt.qc + +// Quoth stuff +misc_corpses.qc +mon_deathguard.qc +mon_dlord.qc +mon_polyp.qc +mon_gug.qc +mon_vermis.qc +mon_sentinel.qc + +// Rubicon stuff +mon_floyd.qc + +// Drake stuff +mon_archer.qc +mon_baron.qc +ai_ryu.qc +ai_wyrm.qc +mon_ryu.qc +mon_shade.qc +//mon_vomitus.qc +//mon_necro.qc +mon_cyber.qc +//mon_bane.qc +//mon_hlord.qc +wand.qc + +// Zerstorer stuff +mon_trog.qc +//mon_zerst.qc + +// Soul of Evil stuff +mon_axeman.qc + +// Lunaran stuff +mon_axegrunt.qc + +// Operation Urth Majik stuff +mon_drone.qc +mon_tur.qc + +// Custent stuff +//mon_turret.qc +//mon_srvomech.qc +//mon_zmaster.qc + +// Pox's extras_r4 stuff +extras_emitters.qc +//extras_fx.qc +//extras_misc.qc +//extras_train.qc +//extras_triggers.qc +//extras_water.qc + +// Random community stuff +mon_snakeman.qc +mon_wspider.qc +mon_anaconda.qc +mon_virtusboss.qc + +// Keep stuff +qrobotdefs.qc +qrobot.qc + + +//CSQC extensions start here. +//csqc_hud_vanilla.qc +//csqc_scoreboard.qc \ No newline at end of file diff --git a/QC_other/QC_keep/projectiles.qc b/QC_other/QC_keep/projectiles.qc new file mode 100644 index 00000000..be5b9d1c --- /dev/null +++ b/QC_other/QC_keep/projectiles.qc @@ -0,0 +1,1552 @@ +/*====================================================================== + PROJECTILE Systems + + * Bullets (PROJECTILE) + * Nails + * Rockets + * Grenades + * Plasma + +======================================================================*/ +void() Particle_Bullet = +{ + // Is the touch function blocked? + if (self.waitmin > time) return; + if (self.delay < time) entity_remove(self, 1); + else { + if (random() < 0.5) { + self.oldorigin = crandom() * '1 1 1'; + if (random() < 0.8) self.lip = rint(random()*4); + else self.lip = 112 + rint(random()*4); + particle (self.origin, self.oldorigin, self.lip, 1 + rint(random()*2)); + } + self.think = Particle_Bullet; + self.nextthink = time + self.speed; + } +}; + +//---------------------------------------------------------------------- +void() Touch_Bullet = +{ + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + if (self.waitmin > time) return; // bullet touch has been disabled + entity_remove(self, 1); // Setup bullet for removal + + //---------------------------------------------------------------------- + // Hit monster/interactive object, impact blood + //---------------------------------------------------------------------- + if (other.takedamage) { + // Only dead center tracer and pellets do damage + if (self.classtype == CT_PROJ_TRACEPART) self.dmg = 0; + else if (self.classtype == CT_PROJ_TRACE) { + // No extra trace damage for zombies, it will kill them + if (other.classgroup == CG_ZOMBIE) self.dmg = 0; + else self.dmg = DAMAGE_PTSHELL; + } + // Default shell pellet damage + else self.dmg = DAMAGE_PSHELL; + + // Check for breakable/pushable no monster damage + if (ai_immunedamage(self.owner, other)) { + self.dmg = 0; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + // Show bullet resistance as small blood+gunshot+smoke + else if (other.resist_shells > 0) { + self.dmg = Resist_Damage(other, IT_SHELLS, self.dmg); + Resist_Shells(other, self.origin, self.velocity, self.dmg); + } + else { + // Hitting monsters does twice the amount of blood effects + if (other.flags & FL_MONSTER) spawn_touchblood (self, other, self.dmg*2); + else spawn_touchblood (self, other, self.dmg); + } + + if (self.dmg > 0) T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + } + //---------------------------------------------------------------------- + // Hit world/static object, impact particles + //---------------------------------------------------------------------- + else { + // Tracer bullet, dead center and inflight particle emitter + // Originally did no damage, but changed to buff particle SG + if (self.classtype == CT_PROJ_TRACE) { + self.lip = random(); + // NG tink sound or SG ricochet sound (hardcoded client sounds) + if (self.lip < 0.5) sound(self, CHAN_VOICE, "weapons/tink1.wav", random()*0.5, ATTN_LOW); + else if (self.lip < 0.7) sound(self, CHAN_VOICE, "weapons/ric2.wav", random()*0.5, ATTN_LOW); + else sound(self, CHAN_VOICE, "weapons/ric3.wav", random()*0.5, ATTN_LOW); + } + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + } +}; + +//---------------------------------------------------------------------- +void(vector org, vector dir, float proj_type, float proj_speed) Launch_Bullet = +{ + newmis = spawn(); + newmis.owner = self; + newmis.classname = "proj_bullet"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJSHELLS; // Ammo type + //---------------------------------------------------------------------- + // Horrible hack! If the player has the TSG or quad, flag it for zombies + //---------------------------------------------------------------------- + if (self.moditems & IT_UPGRADE_SSG || self.super_damage_finished > 0) + newmis.weapon = TRUE; + + //---------------------------------------------------------------------- + // Switch model collision based on auto aim functionality + // Monsters always use large collision (otherwise infighting would be less) + //---------------------------------------------------------------------- + if (self.classtype == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + } + else newmis.movetype = MOVETYPE_FLYMISSILE; // Default = large collision + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Bullet; // touch function + newmis.waitmin = 0; // Touch function active + + // Particle tracer (true aim, no damage) + if (proj_type == CT_PROJ_TRACE || proj_type == CT_PROJ_TRACEPART) { + newmis.delay = time + LIFE_SHELLS; // Maximum life time + if (self.weapon & IT_SUPER_SHOTGUN) newmis.count = 1; + else newmis.count = 1 + rint(random()*2); // Default particles for SG + newmis.speed = 0.02; // Next function interval (very high tick) + newmis.think = Particle_Bullet; // Particle trail + newmis.nextthink = time + newmis.speed; + } + // SG/SSG shells (scatter effect) + else { + newmis.think = SUB_Remove; + newmis.nextthink = time + LIFE_SHELLS; // Stop projectile going forever + } + + newmis.mdl = MODEL_PROJ_DIAM2; + setmodel(newmis, newmis.mdl); // Diamond model + newmis.frame = random()*15; // Full range of sizes + newmis.skin = 16 + random()*7; // Bright colours + + newmis.velocity = dir * proj_speed; // Constant speed multiplier + newmis.angles = vectoangles(dir); // Create direction angle + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); // Zero size + setorigin (newmis, org); // Move to starting position + newmis.avelocity = vecrand(100,200,FALSE); + +}; + +//---------------------------------------------------------------------- +void(float bullet_count, vector bullet_spread, float bullet_type) Launch_Shells = +{ + local vector src_origin, bullet_dir, spread_dir; + local float bullet_speed, var_speed; + + // Is the player firing the shotgun? + if (self.flags & FL_CLIENT) { + makevectors(self.v_angle); + // Infront of player model and down towards gun + src_origin = self.origin + attack_vector('10 0 8'); + if (bullet_type == CT_PROJ_SG) bullet_speed = SPEED_PLAYERSG; + else bullet_speed = SPEED_PLAYERSSG; + // Either straight line or auto aim assist (builtin function 44) + if (autoaim_cvar < 1) bullet_dir = aim(self, SPEED_PLAYAIM); + else bullet_dir = normalize(v_forward * bullet_speed); + } + else { + makevectors(self.angles); + // At the end of the new soldier gun model + src_origin = self.origin + attack_vector(self.attack_offset); + bullet_speed = SPEED_MONSG + (skill*SPEED_MONSGMULT); + // fire somewhat behind the player, so a dodging player is harder to hit + bullet_dir = self.enemy.origin - self.enemy.velocity*0.2; + bullet_dir = normalize (bullet_dir - self.origin); + } + + // Setup particle emitter/tracer shot (true aim) + Launch_Bullet(src_origin, bullet_dir, CT_PROJ_TRACE, bullet_speed); + // Reduced the amount of visual noise infront of the player + // The projectiles below are particle trail emitters only + // Launch_Bullet(src_origin+(v_right*(crandom()*10)), bullet_dir, CT_PROJ_TRACEPART, bullet_speed + (crandom()*30) ); + // Launch_Bullet(src_origin+(v_right*(crandom()*10)), bullet_dir, CT_PROJ_TRACEPART, bullet_speed + (crandom()*30) ); + + while (bullet_count > 0) { + var_speed = crandom()*10 + bullet_speed; // Slight speed variance + spread_dir = bullet_dir + (crandom()*bullet_spread_x) * v_right + (crandom()*bullet_spread_y) * v_up; + Launch_Bullet(src_origin, spread_dir, bullet_type, var_speed); + + bullet_count = bullet_count - 1; + } +}; + +/*====================================================================== + PLASMA PROJECTILES + * requires special blue/white particle trail + * Has radius and impact touch damage + * used by Eliminator (enforcer), Soldier and Minotaur +======================================================================*/ +void() Particle_Plasma = +{ + // projectile has touched something + if (self.waitmin > time) return; + + // Generate sprite particles? DP not active? + if (random() < 0.5 && !ext_dppart) { + self.oldorigin = crandom() * '1 1 1'; + self.lip = 40 + rint(random()*8); + particle (self.origin, self.oldorigin, self.lip, 4 + rint(random()*4)); + self.lip = 198 + rint(random()*4); + particle (self.origin, self.oldorigin, self.lip, 2 + rint(random()*2)); + } + + // The Player plasma projectile grows over frames + if (self.owner.classtype == CT_PLAYER) { + if (self.attack_finished < time) { + self.frame = self.frame + 1; + if (self.frame < 6) self.attack_finished = time + 0.1; + else self.frame = 6; + } + } + + self.think = Particle_Plasma; + self.nextthink = time + self.speed; +}; + +// Compiler forward reference +void(vector org, vector dir, float proj_type, float proj_speed) launch_plasma; +//---------------------------------------------------------------------- +void() Touch_PlasmaProjectile = +{ + local vector org, vec, dir; + local entity tself; + + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + if (self.waitmin > time) return; // plasma touch has been disabled + entity_remove(self, 1); // Setup plasma for removal + + + if (self.classproj == CT_PLAYER) self.pos1 = DAMAGE_PGPLAYER; + else if (self.classproj == CT_REFLECTLIGHT) self.pos1 = DAMAGE_PGREFLECT; + else if (self.classproj == CT_REFLECTPLASMA) self.pos1 = DAMAGE_PGREFLECT; + else if (self.classproj == CT_MONMINOTAUR) self.pos1 = DAMAGE_PGMINOTAUR; + else if (self.owner.classtype == CT_MONGAUNT) self.pos1 = DAMAGE_PGGAUNT; + else if (self.owner.classtype == CT_PLAYER) self.pos1 = DAMAGE_PGPLAYER; + else if (self.owner.classtype == CT_MONNOUR) self.pos1 = DAMAGE_PGNOUR; + else if (self.owner.classtype == CT_MONGREMLIN) self.pos1 = DAMAGE_PGGREMLIN; + else self.pos1 = DAMAGE_PLASMA; + self.dmg = self.pos1_x + random()*self.pos1_y; + + // Check for breakable/pushable immunity first + if (ai_immunedamage(self.owner, other)) self.pos1 = '0 0 0'; + self.dmg = self.pos1_x + random()*self.pos1_y; + + // Plasma Splashdamage affects everything, check for 0 dmg first + // This will also apply a poisonous debuff from the attacker + if (self.pos1_z > 0) + T_RadiusDamage (self, self.owner, self.pos1_z, world, DAMAGEALL); + + //---------------------------------------------------------------------- + // Hit monster/interactive object, impact blood + //---------------------------------------------------------------------- + if (other.takedamage) { + // Check for breakable/pushable no monster damage + if (ai_immunedamage(self.owner, other)) { + // Using a cut down version of ammo resistance + SpawnExplosion(EXPLODE_BURST_SMOKE, self.origin, SOUND_PLASMA_HIT); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 300, 50, 150); + } + // Check for plasma/cell resistance + else if (other.resist_cells > 0) { + self.dmg = Resist_Damage(other, IT_CELLS, self.dmg); + Resist_Plasma(other, self.origin); + } + else { + // Hitting monsters does twice the amount of blood effects + if (other.flags & FL_MONSTER) spawn_touchblood (self, other, self.dmg*2); + else spawn_touchblood (self, other, self.dmg); + + // Randomly pick between quoth electric and blue explosions + if (random() < 0.3) SpawnExplosion(EXPLODE_PLASMA_SMALL, self.origin, SOUND_REXP3); + else SpawnExplosion(EXPLODE_ELECT_SMALL, self.origin, SOUND_PLASMA_HIT); + } + + // Plasma hits always kill any zombie (1 hit) + if (other.classgroup == CG_ZOMBIE) self.dmg = DAMAGE_ZOMBIECLASS; + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + + } + //---------------------------------------------------------------------- + // Hit world/static object, impact particles + //---------------------------------------------------------------------- + else { + // New special coloured particle explosion (rogue expansion) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 35); + WriteByte (MSG_BROADCAST, 8); + + // Classic quoth electric impact explosion + SpawnExplosion(EXPLODE_ELECT_SMALL, self.origin, SOUND_PLASMA_HIT); + } + + // Check for any plasma reflection? (player only function) + if (self.classproj == CT_PLAYER && other.reflectplasma) { + org = self.origin; + // Random chance that plasma will reflect straight back + if (random() < 0.2 && self.owner) + dir = normalize(self.owner.origin - org); + else { + // Pick random location instead + vec = org + vecrand(0,1000,1); + dir = normalize(vec - org); + } + // Switch around self to make sure reflection happens once + tself = self; self = other; + launch_plasma(org, dir, CT_REFLECTPLASMA, SPEED_REFLECTION); + self = tself; + } + + // Remove plasma bolt + entity_remove(self, 1); +}; + +//---------------------------------------------------------------------- +void(vector org, vector dir, float proj_type, float proj_speed) launch_plasma = +{ + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_plasma"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJCELLS; // Ammo type + + // The player plasma projectile use to be linked to autoaim condition + // Switched to larger collision, so that greater chance to hit enemies + // Monsters always use large collision (otherwise infighting would be less) + //---------------------------------------------------------------------- + if (proj_type == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + } + else { + // Monster get the raw deal, small projectile collision + newmis.movetype = MOVETYPE_FLY; + // Minotaur, Gaunt is rapid fire, don't need glow effect (slow down) + if (proj_type != CT_MONGAUNT && proj_type != CT_MONMINOTAUR) + newmis.effects = EF_DIMLIGHT; + } + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_PlasmaProjectile; + newmis.nextthink = time + LIFE_PROJECTILE; + newmis.think = SUB_Remove; + + // Setup model and special parameters (zombie, boss) + //---------------------------------------------------------------------- + if (proj_type == CT_MONARMYPLASMA) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONELIMATOR) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONCENTURION) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONGAUNT) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_GAPLASMAGRN); + else setmodel (newmis, MODEL_PROJ_GAPLASMA); + } + else if (proj_type == CT_MONEEL) { + if (newmis.poisonous) setmodel (newmis, MODEL_PROJ_PLASMAGRN); + else setmodel (newmis, MODEL_PROJ_PLASMA); + } + else if (proj_type == CT_MONSEEKER) setmodel (newmis, MODEL_PROJ_PLASMA); + else if (proj_type == CT_MONMINOTAUR) setmodel (newmis, MODEL_PROJ_MPLASMA); + else if (proj_type == CT_MONNOUR) setmodel (newmis, MODEL_PROJ_NOUR3); + else if (proj_type == CT_REFLECTLIGHT) setmodel (newmis, MODEL_PROJ_LIGHTNING2); + else if (proj_type == CT_REFLECTPLASMA) { + setmodel (newmis, MODEL_PROJ_PGPLASMA); + newmis.avelocity = vecrand(0,300,TRUE); // randomize avel + newmis.angles_y = rint(random()*360); // Random angle + newmis.frame = 3; // Medium size + } else { + setmodel (newmis, MODEL_PROJ_PGPLASMA); + newmis.attack_finished = time + 0.1; // Update model frame every 0.1s + newmis.avelocity = vecrand(0,300,TRUE); // randomize avel + newmis.angles_y = rint(random()*360); // Random angle + newmis.frame = 0; // Start really small + } + + //---------------------------------------------------------------------- + // Is DP engine active for new particle trail? + if (ext_dppart) { + newmis.traileffectnum = particleeffectnum(DPP_TRPLASMA); + newmis.effects = 0; + // Extra glow and light colour (DP mostly) + //newmis.effects = EF_BLUE; + //newmis.glow_color = 246; // Blue/gold + } + + // Manually generate blue/white particle trail + newmis.count = 1 + rint(random()*2); // Default particles + newmis.speed = 0.02; // Next function interval (very high tick) + newmis.think = Particle_Plasma; // Particle trail + newmis.nextthink = time + newmis.speed; + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.velocity = dir * proj_speed; + if (self.classtype != CT_PLAYER) newmis.angles = vectoangles(dir); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + SMALL PROJECTILES - used all over the place ... + + * player (nailgun, super nailgun) + * Wizards (double spit) + * Hell Knights (magic spray) + * spike shooters (regular, super, laser) + * Enforcers (laser) + * Crossbow Knights (bolts) + * Zombies (flesh) +======================================================================*/ +// Forward compiler reference because of peircing nails function +void(vector org, vector dir, float proj_type, float proj_speed) launch_projectile; + +//---------------------------------------------------------------------- +void() Touch_Projectile = +{ + local vector org, dir, vec; + local float proj_type, proj_speed, old_armortype, old_armorvalue, old_armormask; + local entity tself; + + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // no touching self + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + // No more touch/world interaction + self.touch = SUB_Null; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + + + //---------------------------------------------------------------------- + // Laser impact/stop sound (precached by owner) + if (self.classtype == CT_PROJ_LASER || self.classtype == CT_PROJ_ENFHKN) + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + // Golem rock impact sound (precached by owner) + else if (self.classtype == CT_PROJ_GROCK) { + self.lip = random(); + self.volume = 0.5 + random()*0.5; + if (self.lip < 0.25) sound (self, CHAN_WEAPON, SOUND_IMP_ROCK1, self.volume, ATTN_BREAK); + else if (self.lip < 0.5) sound (self, CHAN_WEAPON, SOUND_IMP_ROCK2, self.volume, ATTN_BREAK); + else if (self.lip < 0.75) sound (self, CHAN_WEAPON, SOUND_IMP_ROCK3, self.volume, ATTN_BREAK); + else sound (self, CHAN_WEAPON, SOUND_IMP_ROCK4, self.volume, ATTN_BREAK); + } + + //---------------------------------------------------------------------- + // hit something that bleeds + if (other.takedamage) { + // SNG spikes are essentially double damage (cheap way of 2 x nails) + if (self.classtype == CT_PROJ_SNG) self.dmg = DAMAGE_SNGSPIKE; + // Reflected nails (can only happen from the player) + else if (self.classtype == CT_PROJ_REFNG) self.dmg = DAMAGE_NGREFSPIKE; + // Bob and enforcer lasers are different + else if (self.owner.classtype == CT_MONJIM) + self.dmg = DAMAGE_BOBLASER + (random() * DAMAGE_BOBLASER); + else if (self.classtype == CT_PROJ_LASER) self.dmg = DAMAGE_LASER; + else if (self.classtype == CT_PROJ_LAVANG) self.dmg = DAMAGE_LAVANGSPIKE; + else if (self.classtype == CT_PROJ_LAVASNG) self.dmg = DAMAGE_LAVASNGSPIKE; + // Special damage and sound effects for crossbow knights + else if (self.classtype == CT_PROJ_BOLT1) { + // hit4 = flesh wound, hit1 = ting sound + if (random() < 0.3) sound (self, CHAN_WEAPON, "weapons/bolt_hit1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/bolt_hit4.wav", 1, ATTN_NORM); + // Reduce the damage if the bolt has hit another dcrossbow knight + if (other.classtype == self.owner.classtype) { + self.dmg = DAMAGE_BOLT0; + } else { + if (self.owner.flags & FL_CLIENT) { + self.dmg = DAMAGE_BOLTPLAYER; + } else { + self.dmg = DAMAGE_BOLT1; + } + } + } + else if (self.classtype == CT_PROJ_BOLT2) { + // hit4 = flesh wound, hit1 = ting sound + if (random() < 0.3) sound (self, CHAN_WEAPON, "weapons/bolt_hit1.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/bolt_hit4.wav", 1, ATTN_NORM); + // Reduce the damage if the bolt has hit another dcrossbow knight + if (other.classtype == self.owner.classtype) self.dmg = DAMAGE_BOLT0; + if (self.owner.flags & FL_CLIENT) { + self.dmg = DAMAGE_BOLTPLAYERP; + } else { + self.dmg = DAMAGE_BOLT1; + } + } + else if (self.classtype == CT_PROJ_BLBOLT) self.dmg = DAMAGE_BOGLORD; + // Zombies have special impact sound + else if (self.classtype == CT_PROJ_FLESH || self.classtype == CT_PROJ_FLESHP) { + sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + self.dmg = DAMAGE_FLESH; + } + // Scorpion spikes cannot hurt other spider types + // This is to prevent the minion scorpion killing other minions + else if (self.classtype == CT_PROJ_SCORP) { + if (other.classgroup == self.owner.classgroup) self.dmg = 0; + else self.dmg = DAMAGE_NGSPIKE; + } + // Rock projectiles cannot hurt stone monsters! + else if (self.classtype == CT_PROJ_GROCK) { + if (other.classgroup == self.owner.classgroup) self.dmg = 0; + else self.dmg = DAMAGE_NGSPIKE; + } + // Default spike damage (nails) + else self.dmg = DAMAGE_NGSPIKE; + + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self.owner, other)) { + // Zero damage and make sure no resistance checks + self.dmg = self.classgroup = 0; + // Remove poisonous effect + self.poisonous = FALSE; + // Show ammo resistance effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 200, 50, 150); + } + + + //---------------------------------------------------------------------- + // Check for poison debuff (using poisonous flag) + if (self.poisonous == TRUE) PoisonDeBuff(other); + + //---------------------------------------------------------------------- + // Check for poison debuff (currently mummy and green spiders) + //if (self.owner.classtype == CT_MONMUMMY || self.owner.classtype == CT_MONSPIDER + // || self.owner.classtype == CT_MONMINOTAUR || self.owner.classtype == CT_MONWRAITH) { + // if (self.owner.poisonous > 0) PoisonDeBuff(other); + //} + + //if (self.classtype == CT_PROJ_BOLT2) { + // PoisonDeBuff(other); + //} + + //---------------------------------------------------------------------- + // Check for NG/SNG nail resistance + if (self.classgroup == CG_PROJNAILS && other.resist_nails > 0) { + self.dmg = Resist_Damage(other, IT_NAILS, self.dmg); + Resist_Nails(other, self.origin); + self.projeffect = 0; + // Check for any nail reflection? + if (other.reflectnails && random() < other.resist_nails) { + org = self.origin; + // Random chance that nail will reflect straight back + if (random() < 0.2 && self.owner) + dir = normalize(self.owner.origin - org); + else { + // Pick random location instead + // Flatten the Z axis so the reflection looks less random + vec = vecrand(0,100,1); + vec_z = random()*25; + vec = vec + org; + dir = normalize(vec - org); + } + // Switch around self to make sure reflection happens once + tself = self; self = other; + launch_projectile(org, dir, CT_PROJ_REFNG, SPEED_REFLECTION); + self = tself; + } + } + //---------------------------------------------------------------------- + // Produce blood particles at impact and apply damage to target + spawn_touchblood (self, other, self.dmg); + + // Ignore armor for lava nails + if (self.classtype == CT_PROJ_LAVANG || self.classtype == CT_PROJ_LAVASNG) { + old_armortype = other.armortype; + old_armorvalue = other.armorvalue; + old_armormask = (other.items2 & ((IT2_ARMOR1 | IT2_ARMOR2) | IT2_ARMOR3)); + other.armortype = FALSE; + other.armorvalue = FALSE; + } + + // Apply the damage + if (self.dmg > 0) T_Damage (other, self, self.owner, self.dmg, DAMARMOR); // Lava nails pierce armor + + // Restore armor after applying lavanail damage + if (self.classtype == CT_PROJ_LAVANG || self.classtype == CT_PROJ_LAVASNG) { + other.armortype = old_armortype; + other.armorvalue = old_armorvalue; + } + + //---------------------------------------------------------------------- + // Nail Piercing affect, move nail through monster + if (self.projeffect & IT_ARTPIERCE) { + // a small pile of gibs! + if (random() < 0.2) SpawnMeatSpray (self, other, crandom() * 100); + // Setup projectile ready for monster tests + self.movetype = MOVETYPE_FLY; + self.solid = SOLID_BBOX; + self.oldorigin = self.origin; + self.count = 0; + + // Loop forward 8 times to find space on the other side + while (self.count < 8) { + // Trace forward from current position + self.finaldest = self.oldorigin + self.finalangle*512; + traceline(self.oldorigin, self.finaldest,FALSE,self); + // Still inside bleeding object? + if (trace_ent == other) + self.oldorigin = self.oldorigin + self.finalangle*16; + // On the other side! + else self.count = 8; + self.count = self.count + 1; + } + // Is the other side free space to spawn? + if (pointcontents(self.oldorigin) == CONTENT_EMPTY) { + tself = self; + org = self.oldorigin; + dir = self.finalangle; + proj_type = self.classtype; + proj_speed = self.speed; + self = self.owner; + // Once a projectile hits an object it is impossible + // to reset its velocity/angles and carry on + // It is easier to create a new projectile and delete + // the currently damaged one instead! + launch_projectile(org, dir, proj_type, proj_speed); + self = tself; + } + } + } + //---------------------------------------------------------------------- + else { + // Some projectiles need to be left lying around for a while + if (self.bodyfadeaway) { + if (self.classtype == CT_PROJ_FLESH || self.classtype == CT_PROJ_FLESHP) + sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_SPID || self.classtype == CT_PROJ_WILLY) + sound (self, CHAN_WEAPON, "spider/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_VORE) + sound (self, CHAN_WEAPON, "voreling/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_ELF) + sound (self, CHAN_WEAPON, "xmas/elf/miss.wav", 1, ATTN_NORM); + else if (self.classtype == CT_PROJ_BOLT1 || self.classtype == CT_PROJ_BOLT2) { + if (random() < 0.5) sound (self, CHAN_WEAPON, "weapons/bolt_hit2.wav", 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, "weapons/bolt_hit3.wav", 1, ATTN_NORM); + } + + self.velocity = self.avelocity = '0 0 0'; + // Straight away make projectiles vanish + self.nextthink = time + 2 + random(); + self.ltime = self.nextthink; + self.think = model_fade; + return; + } + + //---------------------------------------------------------------------- + // Standard engine impact particles and sounds + else { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + + if (self.classtype == CT_PROJ_SNG) WriteByte (MSG_BROADCAST, TE_SUPERSPIKE); + else if (self.classtype == CT_PROJ_LASER) WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + else if (self.classtype == CT_PROJ_GROCK) WriteByte (MSG_BROADCAST, TE_GUNSHOT); + else if (self.classtype == CT_PROJ_WIZ) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_SPID) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_SWAMP) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_WILLY) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_VORE) WriteByte (MSG_BROADCAST, TE_SUPERSPIKE); + else if (self.classtype == CT_PROJ_ELF) WriteByte (MSG_BROADCAST, TE_GUNSHOT); + else if (self.classtype == CT_PROJ_FURY2) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_NOUR1) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_BLBOLT) WriteByte (MSG_BROADCAST, TE_WIZSPIKE); + else if (self.classtype == CT_PROJ_BLBOLT2) WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + else if (self.classtype == CT_PROJ_HKN) WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); + else WriteByte (MSG_BROADCAST, TE_SPIKE); + + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + } + + // Hide projectile and wait for any sounds to finish playing + entity_remove(self,2); +}; + +//---------------------------------------------------------------------- +void(vector org, vector dir, float proj_type, float proj_speed) launch_projectile = +{ + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_nail"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + + if (newmis.classtype == CT_PROJ_NG || newmis.classtype == CT_PROJ_SNG) + newmis.classgroup = CG_PROJNAILS; // Ammo type + else newmis.classgroup = CG_PROJALL; // Ammo type (default) + + // Switch model collision based on auto aim functionality + // Monsters always use large collision (otherwise infighting would be less) + //---------------------------------------------------------------------- + if (self.classtype == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + // Check if the player has the nail piercer effect active + if (self.moditems & IT_ARTPIERCE && newmis.classgroup == CG_PROJNAILS) { + newmis.projeffect = IT_ARTPIERCE; + } + } + // lasers/plasma are small and glowing + else if (proj_type == CT_PROJ_LASER) { + newmis.movetype = MOVETYPE_FLY; + newmis.effects = EF_DIMLIGHT; + } + // Crossbow bolts are small and stick around + else if (proj_type == CT_PROJ_BOLT1 || proj_type == CT_PROJ_BOLT2) { + newmis.movetype = MOVETYPE_FLY; + newmis.bodyfadeaway = TRUE; + } + // Default = large collision + else newmis.movetype = MOVETYPE_FLYMISSILE; + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Projectile; + newmis.nextthink = time + LIFE_PROJECTILE; + newmis.think = SUB_Remove; + newmis.poisonous = newmis.owner.poisonous; + if (proj_type == CT_PROJ_BOLT2) newmis.poisonous = 1; + + // Setup model + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_NG) setmodel (newmis, MODEL_PROJ_NG); + else if (proj_type == CT_PROJ_SNG) setmodel (newmis, MODEL_PROJ_SNG); + else if (proj_type == CT_PROJ_LAVANG || proj_type == CT_PROJ_LAVASNG) setmodel (newmis, "progs/lspike.mdl"); + else if (proj_type == CT_PROJ_REFNG) setmodel (newmis, MODEL_PROJ_NGRED); + // Santa Snowball machine gun! + else if (proj_type == CT_PROJ_SANTA) setmodel (newmis, MODEL_PROJ_SNOWBALL); + // Crossbow Knight has poison/regular bolts + else if (proj_type == CT_PROJ_BOLT1) setmodel (newmis, MODEL_PROJ_BOLT1); + else if (proj_type == CT_PROJ_BOLT2) setmodel (newmis, "progs/ad171/proj_bolt2.mdl"); +// else if (proj_type == CT_PROJ_BLBOLT) setmodel (newmis, MODEL_PROJ_BLORDBOLT); + else if (proj_type == CT_PROJ_HKN) setmodel (newmis, MODEL_PROJ_HKN); + else if (proj_type == CT_PROJ_ENFHKN) setmodel (newmis, MODEL_PROJ_HKN); + else if (proj_type == CT_PROJ_MONNG) setmodel (newmis, MODEL_PROJ_NGRED); + else if (proj_type == CT_PROJ_WIZ) setmodel (newmis, MODEL_PROJ_WIZ); + else if (proj_type == CT_PROJ_MPOISON) setmodel (newmis, MODEL_PROJ_MPOISON); + else if (proj_type == CT_PROJ_WBONE) setmodel (newmis, MODEL_PROJ_WBONE); + else if (proj_type == CT_PROJ_WPOISON) setmodel (newmis, MODEL_PROJ_WPOISON); + else if (proj_type == CT_PROJ_SCORP) setmodel (newmis, MODEL_PROJ_SCORP); + else if (proj_type == CT_PROJ_FURY2) setmodel (newmis, MODEL_PROJ_FURY2); + else if (proj_type == CT_PROJ_NOUR1) setmodel (newmis, MODEL_PROJ_NOUR1); + // Boglord / Fire Shambler nail/lightning attack + else if (proj_type == CT_PROJ_BLBOLT) { + if (self.spawnflags & MON_BOGL_STRONG) { + newmis.classtype = CT_PROJ_BLBOLT2; + setmodel (newmis, MODEL_PROJ_BLORDBOLT2); + } + else setmodel (newmis, MODEL_PROJ_BLORDBOLT1); + } + else if (proj_type == CT_PROJ_WILLY) setmodel (newmis, "progs/sp_spike.mdl"); + else if (proj_type == CT_PROJ_LASER) { + setmodel (newmis, MODEL_PROJ_LASER); + // Is DP engine active for new particle trail? + if (ext_dppart) { + newmis.traileffectnum = particleeffectnum(DPP_TRLASER); + newmis.effects = 0; + } + } + else if (proj_type == CT_PROJ_GROCK) { + if (random() < 0.5) setmodel (newmis, MODEL_PROJ_GROCK1); + else setmodel (newmis, MODEL_PROJ_GROCK2); + newmis.frame = rint(random()*9); + newmis.avelocity = vecrand(0,200,TRUE); + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.speed = proj_speed; + newmis.finalangle = dir; + newmis.velocity = newmis.finalangle * newmis.speed; + newmis.angles = vectoangles(newmis.finalangle); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + This missile touch function is designed for monsters NOT players + * No DIRECT damage, just radius and a lot lower (40 vs 110) + * Half damage to shamblers (inside T_RadiusDamage) + * Will work with homing or direct missile attacks + * checks for breakables that can be destroyed with explosives + * uses default explosion function +======================================================================*/ +void() Touch_HomingMissile = +{ + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self.oldenemy, other)) { + // Show ammo resistance on bmodel + SpawnExplosion(EXPLODE_BURST_SMOKE,self.origin,SOUND_RESIST_ROCKET); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + SpawnProjectileSmoke(self.origin, 200, 50, 250); + SpawnProjectileSmoke(self.origin, 300, 50, 150); + } + else { + if (ai_foundbreakable(self.oldenemy, other, TRUE) && other.brktrigmissile != 0) { + // Found a breakable which is prone to explosive damage + trigger_ent(other, self.oldenemy); + } + else { + // Homing Missiles always kill any zombie class + if (other.classgroup == CG_ZOMBIE) + T_Damage (other, world, world, DAMAGE_ZOMBIECLASS, NOARMOR); + else { + // Missile explosion base/rnd/splash + self.pos1 = '0 0 0'; + if (self.classtype == CT_PROJ_SHUB1) self.pos1 = self.oldenemy.pos2; + // Shalrath/DSerg are using classic voreball damage + else self.pos1_z = DAMAGE_MONROCKET; + + // pre-calculate missile damage + self.dmg = self.pos1_x + (random() * self.pos1_y); + // Check for any rocket ammo resistance + if (other.resist_rockets > 0) { + self.dmg = Resist_Damage(other, IT_ROCKETS, self.dmg); + } + + // Only call T_ functions if there is damage to do! + if (self.dmg > 0 && other.health > 0) + T_Damage (other, self, self.oldenemy, self.dmg, DAMARMOR); + if (self.pos1_z > 0) + // Stop multiple enemies of the same class type (same as wraiths) + // killing themselves with their own homing missiles! + T_RadiusDamage (self, self.oldenemy, self.pos1_z, self.oldenemy, IGNORECLASS); + } + } + + // Rocket resistance is shown with puffs of smoke + if (other.resist_rockets > 0) Resist_Rockets(other, self.origin); + else { + // Use special effect for voreball explosions in DP + if (ext_dppart) { + // DP effect name set before homing missile launched + pointparticles(particleeffectnum(self.dpp_name), self.origin, '0 0 0', 1); + // Play standard explosion sound + sound(self, CHAN_WEAPON, SOUND_REXP3, 1, ATTN_NORM); + } + else { + // Standard voreball explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + // Sprite explosion for Fitz engines + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + } + } + } + // Hide+Delete homing missile, no longer needed + // Wait for any sounds to finish playing + entity_remove(self, 4); +}; + +//---------------------------------------------------------------------- +// Re-direct any map hacks to the new function replacement +void() ShalMissileTouch = { Touch_HomingMissile(); }; + +//---------------------------------------------------------------------- +void() Steer_HomingMissile = +{ + local vector dir, vtemp; + + // If tracking enemies dies or end level? remove homing missiles + if (self.enemy.health < 1) { remove(self); return; } + if (intermission_running > 1) { remove(self); return; } + + vtemp = self.enemy.origin + self.v_angle; + dir = normalize(vtemp - self.origin); + self.velocity = dir * self.attack_speed; + + // After 1s let homing missiles impact on ower + if (self.waitmin < time) self.owner = self; + + // Slow speed update that the missile can steer around corners + // sloppy slow updates allows for a better game experience + self.nextthink = time + 0.2; + self.think = Steer_HomingMissile; +}; + +//---------------------------------------------------------------------- +void(vector orgofs, vector targofs, float proj_type, float proj_speed) Launch_HomingMissile = +{ + local vector org, dir; + local float dist, flytime; + + // Check if there is space to spawn entity + makevectors(self.angles); + org = self.origin + attack_vector(orgofs); + if (entity_pcontent(org)) return; + + newmis = spawn (); + // Owner is always excluded from touch functions, save in oldenemy + // and after one second remove owner so will touch everything + newmis.owner = newmis.oldenemy = self; + newmis.classname = "proj_rocket"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJROCKETS; // Ammo type + + newmis.movetype = MOVETYPE_FLYMISSILE; // Default = large collision + newmis.enemy = self.enemy; // Used for homing target + newmis.v_angle = targofs; // Store for later + + //---------------------------------------------------------------------- + // Aim the missile slightly above enemy + dir = normalize((self.enemy.origin + newmis.v_angle) - org); + dist = vlen (self.enemy.origin - org); + flytime = dist * 0.002; + if (flytime < 0.1) flytime = 0.1; + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_HomingMissile; + newmis.nextthink = flytime + time; + newmis.think = Steer_HomingMissile; + newmis.attack_speed = proj_speed; + // Allow 3s for the homing missile to travel away + newmis.waitmin = time + 3; + + // Setup model for each missile type + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_SHAL) { + setmodel(newmis, MODEL_PROJ_SHAL); + newmis.dpp_name = DPP_TEVORESPIKE; + } + else if (proj_type == CT_PROJ_SERG) { + setmodel(newmis, MODEL_PROJ_SERG); + newmis.dpp_name = DPP_TEEXPLODE; + } + else if (proj_type == CT_PROJ_SHUB1) { + setmodel(newmis, MODEL_PROJ_SHUB1); + newmis.dpp_name = DPP_TEEXPLODE; + // Push the homing missing up from center + makevectors(self.angles); + // The angles key will reverse direction + // for up-side-down Shub + dir = v_up*0.5; + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.velocity = dir * newmis.attack_speed; + newmis.avelocity = vecrand(100,200,FALSE); + newmis.angles = vectoangles(dir); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + ROCKETS + * Half damage to shamblers (T_MissileTouch and T_RadiusDamage) + * checks for breakables that can be destroyed with explosives + * All rockets have direct & radius damage (based on projectile type) +======================================================================*/ +void() Touch_Missile = +{ + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + if (self.oldenemy) { // stop packs of owners killing each other + if (other.classtype == self.oldenemy.classtype) return; } + // Guardian skull wizards have special poison explosion + if (self.classtype == CT_PROJ_SKULLWP) {self.owner.th_updmissile(); return;} + + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self.owner, other)) { + // Show ammo resistance + SpawnExplosion(EXPLODE_BURST_SMOKE,self.origin,SOUND_RESIST_ROCKET); + SpawnProjectileSmoke(self.origin, 200, 50, 150); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 200, 50, 250); + if (random() < 0.5) SpawnProjectileSmoke(self.origin, 300, 50, 150); + } else { + if (ai_foundbreakable(self.owner, other, TRUE) && other.brktrigmissile != 0) { + // Found a breakable which is prone to explosive damage + trigger_ent(other, self.owner); + } + else { + // Stop any updates to the missile velocity + self.nextthink = time + 1; + self.think = SUB_Null; + + // Setup rocket damage (vector = base + random and splash) + if (self.classtype == CT_PROJ_ROCKET) self.pos1 = DAMAGE_RLPLAYER; + else if (self.classtype == CT_PROJ_FURY1) self.pos1 = DAMAGE_RLFURY; + else if (self.classtype == CT_PROJ_LAVA) self.pos1 = DAMAGE_RLPLAYER; + else if (self.classtype == CT_PROJ_FIRETOP) self.pos1 = DAMAGE_RLFIRETOP; + else if (self.classtype == CT_PROJ_CHTHON) self.pos1 = self.owner.pos2; + else if (self.classtype == CT_PROJ_SKULLW) self.pos1 = DAMAGE_RLSKULLW; + else if (self.classtype == CT_PROJ_GARG) self.pos1 = DAMAGE_RLGARG; + else if (self.classtype == CT_PROJ_ARMY) self.pos1 = DAMAGE_RLARMY; + else if (self.classtype == CT_PROJ_CYBER) self.pos1 = DAMAGE_RLCYBER; + else if (self.classtype == CT_PROJ_JIM2) self.pos1 = DAMAGE_RLJIM2; + else if (self.classtype == CT_PROJ_SEEKER) self.pos1 = DAMAGE_RLSEEKER; + else if (self.classtype == CT_PROJ_DROLE) self.pos1 = DAMAGE_RLDROLE; + else if (self.classtype == CT_PROJ_ICEG1) self.pos1 = DAMAGE_RLICEG; + else if (self.classtype == CT_PROJ_EIDO1) self.pos1 = DAMAGE_RLEIDO; + else if (self.classtype == CT_PROJ_SMARTBALL) self.pos1 = DAMAGE_SMARTBALL; + else if (self.classtype == CT_PROJ_BLORD) { + self.pos1 = DAMAGE_RLBLORD; + // Don't spawn gib models at impact (could be solid) + self.oldorigin = self.origin; + self.origin = self.origin - 8*normalize(self.velocity); + // Special gib model, frame and movement pattern + self.gib1mdl = MODEL_PROJ_BLORD1S; + self.gib1frame = 9; + // Throw gib quantity based on skill level + ThrowGib(11, rint(0.5 + random()*3) ); + // Restore origin for rest of rocket impact + self.origin = self.oldorigin; + // Use new poison explosion + self.height = EXPLODE_POISON_MED; + // Poisonous projectiles + if (other.classname == "player") PoisonDeBuff(other); + } + + // pre-calculate rocket damage + self.dmg = self.pos1_x + (random() * self.pos1_y); + // Check for any rocket ammo resistance + if (other.resist_rockets > 0) { + self.dmg = Resist_Damage(other, IT_ROCKETS, self.dmg); + } + + // Only call T_ functions if there is damage to do! + if (self.dmg > 0 && other.health > 0) + T_Damage (other, self, self.owner, self.dmg, DAMARMOR); + if (self.pos1_z > 0) + T_RadiusDamage (self, self.owner, self.pos1_z, other, DAMAGEALL); + } + + // Rocket resistance is shown with puffs of smoke + if (other.resist_rockets > 0) Resist_Rockets(other, self.origin); + else { + //---------------------------------------------------------------------- + // Check for poison debuff (using poisonous flag) + if (self.poisonous == TRUE) { + // Use new poison explosion + self.height = EXPLODE_POISON_MED; + // Poisonous projectiles + PoisonDeBuff(other); + } + + // Move the explosion effect higher up from point of contact + self.origin = self.origin - 8*normalize(self.velocity); + + // Default ID particle explosion for fire explosions + if (self.height < EXPLODE_PLASMA_SMALL) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + + // Play original explosion sound or replacement + if (self.noise == "") self.noise = SOUND_REXP3; + SpawnExplosion(self.height, self.origin, self.noise); + } + } + + // Hide+Delete rocket, no longer needed + entity_remove(self, 1); +}; + +//---------------------------------------------------------------------- +// Re-direct any map hacks to the new function replacement +void() T_MissileTouch = { Touch_Missile(); }; + +//---------------------------------------------------------------------- +void(vector org, vector dir, vector avel, float proj_type, float proj_speed) Launch_Missile = +{ + // Check if there is space to spawn entity + if (entity_pcontent(org)) return; + + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_rocket"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJROCKETS; // Ammo type + + // Player rockets need to take into account autoaim + if (self.classtype == CT_PLAYER) { + if (playerprojsize == 0) + newmis.movetype = MOVETYPE_FLYMISSILE; // Large collision + else newmis.movetype = MOVETYPE_FLY; // Small collision + } + else { + // default monster missile width is thin! + newmis.movetype = MOVETYPE_FLY; + // Horrible exception for the missile touch function + // Gargoyle rockets need to pass through other gargoyles + // otherwise a pack of them would kill each other! + if (self.classtype == CT_MONGARGOYLE) newmis.oldenemy = self; + } + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Missile; + newmis.nextthink = time + LIFE_ROCKET; + newmis.think = SUB_Remove; + newmis.height = EXPLODE_SMALL; + + // Setup model for each missile type + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_ROCKET) setmodel(newmis, MODEL_PROJ_ROCKET); + else if (proj_type == CT_PROJ_GARG) setmodel(newmis, MODEL_PROJ_GARGOYLE); + else if (proj_type == CT_PROJ_SKULLW) setmodel(newmis, MODEL_PROJ_SWSKULL); + else if (proj_type == CT_PROJ_SKULLWP) setmodel(newmis, MODEL_PROJ_SWSKULLP); + else if (proj_type == CT_PROJ_FURY1) setmodel(newmis, MODEL_PROJ_FURY1); + else if (proj_type == CT_PROJ_LAVA) setmodel (newmis, MODEL_PROJ_LAVA); + else if (proj_type == CT_PROJ_FIRETOP) setmodel (newmis, MODEL_PROJ_LAVA); + else if (proj_type == CT_PROJ_CHTHON) { + if (self.spawnflags & MON_CHTHON_GREEN) setmodel (newmis, MODEL_PROJ_SLIME); + else setmodel (newmis, MODEL_PROJ_LAVA); + } + else if (proj_type == CT_PROJ_JIM2) { + setmodel(newmis, MODEL_PROJ_ROCKET); + newmis.noise = "jim/rocket_hit.wav"; + } + else if (proj_type == CT_PROJ_SEEKER) { + setmodel(newmis, MODEL_PROJ_ROCKET); + newmis.noise = "seeker/rocket_hit.wav"; + } + else if (proj_type == CT_PROJ_EIDO1) { + setmodel(newmis, MODEL_PROJ_EIDO1); + newmis.frame = 7; + if (random() < 0.5) newmis.noise = "eidolon/rock_hit1.wav"; + else newmis.noise = "eidolon/rock_hit2.wav"; + if (random() < 0.5) newmis.height = EXPLODE_MED; + } + else if (proj_type == CT_PROJ_ARMY) { + setmodel(newmis, MODEL_PROJ_ROCKET); + newmis.noise = "soldier/rocket_hit.wav"; + newmis.nextthink = time + 0.1; + newmis.think = self.th_updmissile; + // If can see enemy, steer the rocket towards them + if (visible(self.enemy)) newmis.enemy = self.enemy; + } + else if (proj_type == CT_PROJ_CYBER) { + setmodel(newmis, "progs/missile.mdl"); + newmis.noise = "soldier/rocket_hit.wav"; + newmis.nextthink = time + 0.1; + newmis.think = self.th_updmissile; + // If can see enemy, steer the rocket towards them + if (visible(self.enemy)) newmis.enemy = self.enemy; + } + else if (proj_type == CT_PROJ_DROLE) { + setmodel (newmis, MODEL_PROJ_DROLE); + newmis.noise = "drole/r_explode.wav"; + newmis.nextthink = time + 0.025; + newmis.think = self.th_updmissile; + } + else if (proj_type == CT_PROJ_ICEG1) { + setmodel (newmis, MODEL_PROJ_GSHARD); + newmis.noise = "golem/iceshard_impact.wav"; + newmis.height = EXPLODE_ICE_BIG; + newmis.nextthink = time + 0.1; + newmis.think = self.th_updmissile; + newmis.pos1 = self.enemy.origin; + newmis.attack_timer = 0; + } +// else if (proj_type == CT_PROJ_BLORD) { +// setmodel (newmis, MODEL_PROJ_BLORD1B); +// newmis.frame = 7; // Large size +// newmis.noise = "boglord/slime_explode.wav"; +// } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.velocity = dir * proj_speed; + newmis.avelocity = avel; + newmis.angles = vectoangles(newmis.velocity); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, org); +}; + +/*====================================================================== + GRENADES + * Half damage to shamblers (T_MissileTouch and T_RadiusDamage) + * checks for breakables that can be destroyed with explosives + * Grenade damage is based on dmg key (default = player) +======================================================================*/ +void() Explode_Grenade = +{ + // Block touch functions + if (self.state == STATE_DISABLED) return; + self.touch = SUB_Null; + self.state = STATE_DISABLED; + + // Customize damage based on projectile type + if (self.classtype == CT_PROJ_GLMON) self.dmg = DAMAGE_MONGRENADE; + else if (self.classtype == CT_PROJ_MEGG) self.dmg = 0; + else if (self.classtype == CT_PROJ_NOUR2) { + self.dmg = DAMAGE_MONGRENADE; + // Don't spawn gib models at impact (could be solid) + self.oldorigin = self.origin; + self.origin = self.origin - 8*normalize(self.velocity); + // Special gib model, frame and movement pattern + self.gib1mdl = MODEL_PROJ_NOUR2S; + self.gib1sound = GIB_IMPACT_ACID; + self.max_health = MON_GIBFOUNTAIN; + self.gib1frame = 9; + self.gibtype = GIBTYPE_POISON; + // Setup particles from gib on floor + self.gibpartstyle = PARTICLE_BURST_YELLOW; + // Setup damage and impact explosion + self.gib1dmg = rint( 2 + (random() * skill) ); + self.gib1exp = EXPLODE_BURST_POISON; + // Throw gib quantity based on skill level + ThrowGib(11, rint( 1 + random() * (1 + skill) )); + // Restore origin for rest of grenade impact + self.origin = self.oldorigin; + self.noise = "nour/explode2.wav"; + } + else if (!self.dmg) self.dmg = DAMAGE_PLAYGRENADE; + // Rocket resistance is checked in RadiusDamage + T_RadiusDamage (self, self.owner, self.dmg, world, DAMAGEALL); + + // Rocket resistance is shown with puffs of smoke + if (other.resist_rockets > 0) Resist_Rockets(other, self.origin); + else { + // Sprite/Particle based explosion + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + // Play original explosion sound or replacement + SpawnExplosion(EXPLODE_SMALL, self.origin, SOUND_REXP3); + } + // Hide grenade, no longer needed + entity_remove(self, 1); +}; + +//---------------------------------------------------------------------- +void() Touch_Grenade = +{ + if (entity_pcontent(self.origin)) {remove(self); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + // Let minion eggs re-bounce in opposite direction + // Don't want them to explode like grenades + if (self.classtype == CT_PROJ_MEGG && other.takedamage == DAMAGE_AIM) { + if (CheckZeroVector(self.velocity) == FALSE) { + self.angles = vectoangles(self.mangle); + self.angles_y = anglemod(self.angles_y + 180); + self.velocity = -self.mangle; // Reverse direction + self.mangle = self.velocity; // Update new direction + sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + // Reset egg timer if still bouncing a lot + if ( vlen(self.velocity) > 100 ) self.nextthink = time + LIFE_EGG; + } + } + else { + // Hit something that bleeds? + if (other.takedamage == DAMAGE_AIM) {Explode_Grenade(); return;} + // Any monster firing a grenade at a breakable will explode without bounce + if (ai_foundbreakable(self.owner, other, TRUE) && (self.owner.flags & FL_MONSTER)) { + // Found a breakable which is prone to explosive damage + trigger_ent(other, self.owner); + Explode_Grenade(); + return; + } + + // bounce sound and stop spinning + sound (self, CHAN_WEAPON, self.noise, 1, ATTN_NORM); + if (CheckZeroVector(self.velocity)) self.avelocity = '0 0 0'; + } +}; + +//---------------------------------------------------------------------- +// Re-direct any map hacks to the new function replacement +void() OgreGrenadeExplode = { self.classtype = CT_PROJ_GLMON; Explode_Grenade(); }; +void() GrenadeExplode = { self.classtype = CT_PROJ_GLMON; Explode_Grenade(); }; +void() GrenadeTouch = { self.classtype = CT_PROJ_GLMON; Touch_Grenade(); }; + +// Compile forward functions for Launch_Grenade +void() Touch_ShellCasing; +void() MultiGrenadeTouch; +void() MultiGrenadeExplode; +void() ProximityGrenadeTouch; +void() ProximityBomb; +void() ProximityGrenadeExplode; + +//---------------------------------------------------------------------- +void(vector org, vector dir, vector avel, float proj_type) Launch_Grenade = +{ + // Check if there is space to spawn entity + if (entity_pcontent(org)) return; + + newmis = spawn (); + newmis.owner = self; + newmis.classname = "proj_grenade"; // obj name, not really used anymore + newmis.classtype = proj_type; // Class type number, quick identity + newmis.classgroup = CG_PROJROCKETS; // Ammo type + newmis.movetype = MOVETYPE_BOUNCE; + + //---------------------------------------------------------------------- + newmis.solid = SOLID_BBOX; + newmis.touch = Touch_Grenade; + newmis.nextthink = time + LIFE_GRENADE; + newmis.think = Explode_Grenade; + newmis.noise = "weapons/bounce.wav"; + newmis.bbmins = newmis.bbmaxs = VEC_ORIGIN; + + // Setup model for each missile type + //---------------------------------------------------------------------- + // proj_gl is used by the player (separate so easier to change) + if (proj_type == CT_PROJ_GL) setmodel(newmis, MODEL_PROJ_GRENADE); + // proj_glmon is used by any monster firing grenades + else if (proj_type == CT_PROJ_GLMON) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_GRENADEGRN); + else setmodel(newmis, MODEL_PROJ_GRENADE); + } + else if (proj_type == CT_PROJ_FLESH) { + if (newmis.poisonous) setmodel(newmis, MODEL_PROJ_FLESHP); + else setmodel (newmis, MODEL_PROJ_FLESH); + } + else if (proj_type == CT_PROJ_MEGG) { + if (self.classtype == CT_MONWRAITH) { + setmodel( newmis, MODEL_PROJ_WEGG); + newmis.noise = "wraith/bounce.wav"; + } + else if (self.classtype == CT_MONSHAL) { + setmodel( newmis, MODEL_PROJ_SEGG); + newmis.noise = "shalrath/bounce.wav"; + } + newmis.classgroup = CG_MINIONEGG; // Proper group type + newmis.enemy = SUB_entEnemyTarget(); // Make sure got right enemy + newmis.bbmins = VEC_HULLE_MIN; // Small egg size + newmis.bbmaxs = VEC_HULLE_MAX; + newmis.frame = self.attachment.frame; // Current ball size (frame) + newmis.think = Hatch_Egg; // Eventually hatch + newmis.nextthink = time + LIFE_EGG; // Short timer + } + else if (proj_type == CT_PROJ_SPID) { + setmodel (newmis, MODEL_PROJ_SPID); + newmis.frame = rint((random() * 9)); + } + else if (proj_type == CT_PROJ_ELF) { + setmodel (newmis, MODEL_PROJ_ELF); + newmis.frame = rint((random() * 9)); + } + else if (proj_type == CT_PROJ_SWAMP) { + setmodel (newmis, MODEL_PROJ_SWAMP); + newmis.frame = rint((random() * 9)); + } + else if (proj_type == CT_PROJ_VORE) { + setmodel (newmis, MODEL_PROJ_VORE); + newmis.frame = rint((4 + random() * 4)); + } + else if (proj_type == CT_PROJ_NOUR2) { + setmodel (newmis, MODEL_PROJ_NOUR2B); + newmis.skin = self.skin; + newmis.frame = 7; // Large size + newmis.noise = "nour/bounce.wav"; + } + else if (proj_type == CT_PROJ_CHTHON2) { + setmodel (newmis, MODEL_PROJ_CHTHON1); + newmis.skin = self.skin; + newmis.frame = rint((random() * 9)); + newmis.noise = "chthon/bounce.wav"; + newmis.dmg = self.pos3_z; + } + else if (proj_type == CT_PROJ_SHUB2) { + setmodel (newmis, MODEL_PROJ_SHUB2); + newmis.frame = rint((random() * 9)); + newmis.noise = "shub/bounce.wav"; + newmis.dmg = self.pos3_z; + } + else if (proj_type == CT_PROJ_SHELLC) { + setmodel(newmis, MODEL_PROJ_SHELLC); + newmis.touch = Touch_ShellCasing; + newmis.think = model_fade; + newmis.nextthink = time + random() + LIFE_SHELLS; + newmis.ltime = newmis.nextthink; + } + else if (proj_type == CT_PROJ_GLMONMULTI) { + setmodel(newmis, MODEL_PROJ_GRENADEMULTI); + newmis.touch = MultiGrenadeTouch; + newmis.think = MultiGrenadeExplode; + newmis.nextthink = time + 1; + newmis.bbmins = VEC_ORIGIN; + newmis.bbmaxs = VEC_ORIGIN; + newmis.classname = "MultiGrenade"; + } + else if (proj_type == CT_PROJ_GLMONPROX) { + setmodel(newmis, "progs/hipnotic/proxbomb.mdl"); + newmis.touch = ProximityGrenadeTouch; + newmis.think = ProximityBomb; + newmis.delay = ((time + 15.000) + (MOVETYPE_BOUNCE * random ())); + newmis.th_die = ProximityGrenadeExplode; + newmis.nextthink = time + 1; + newmis.bbmins = '-1.000 -1.000 -1.000'; + newmis.bbmaxs = '1.000 1.000 1.000'; + newmis.classname = "ProximityBomb"; + } + + // These projectile fly like grenades but are really spikes! + //---------------------------------------------------------------------- + if (proj_type == CT_PROJ_SPID || proj_type == CT_PROJ_VORE || + proj_type == CT_PROJ_SWAMP || proj_type == CT_PROJ_ELF || + proj_type == CT_PROJ_FLESH) { + newmis.touch = Touch_Projectile; + newmis.nextthink = time + LIFE_PROJECTILE; + newmis.think = SUB_Remove; + newmis.bodyfadeaway = TRUE; + } + + // Standard projectile setup (origin, size and velocity) + //---------------------------------------------------------------------- + newmis.mangle = dir; // Save for later + newmis.velocity = newmis.mangle; + newmis.avelocity = avel; + newmis.angles = vectoangles(newmis.velocity); + setsize (newmis, newmis.bbmins, newmis.bbmaxs); + setorigin (newmis, org); +}; + +//====================================================================== +// Generic functions for firing grenades from monsters +// MonsterGrenadeSound = play generic load grenade sound +// MonsterGrenadeSpeed = return generic attack speed +// MonsterFireGrenade = fire grenade at enemy origin +// +//---------------------------------------------------------------------- +void() MonsterGrenadeSound = +{ sound (self, CHAN_WEAPON, "weapons/gl_loadshort.wav", 0.1+random()*0.5, ATTN_LOW); }; +float() MonsterGrenadeSpeed = +{ return SPEED_MONGRENADE + (skill * SPEED_MONGLSKILL); }; + +//---------------------------------------------------------------------- +void(vector grenade_org, vector grenade_enemyorg) MonsterFireGrenade = +{ + local vector ang, dir, avel; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + + // Is Z aware disabled? + if ( query_configflag(SVR_ZAWARE) || self.no_zaware ) { + makevectors (self.angles); + dir = normalize(grenade_enemyorg - grenade_org); + // Default grenade speed (player = 600) + dir = dir * SPEED_PLAYGRENADE; + dir_z = ELEV_ZAXIS; + } + else { + // Z Aware tracking is ENABLED (AI track player much better) + // One final angle adjustment (based on actual projectile origin) + self.attack_speed = MonsterGrenadeSpeed(); + self.attack_elev = SUB_Elevation(self.attack_elev, grenade_org, grenade_enemyorg, self.attack_speed); + ang = vectoangles(grenade_enemyorg - grenade_org); + ang_x = -self.attack_elev; + makevectors (ang); + dir = v_forward * self.attack_speed; + } + + avel = vecrand(100,200,FALSE); + if (self.spawnflags & OGRE_MULTI || self.weapon == IT_MULTI_GRENADE) { + Launch_Grenade(grenade_org, dir, avel, CT_PROJ_GLMONMULTI); + } else { + if (self.weapon == IT2_PROXIMITY_GUN) { + Launch_Grenade(grenade_org, dir, avel, CT_PROJ_GLMONPROX); + } else { + Launch_Grenade(grenade_org, dir, avel, CT_PROJ_GLMON); + } + } +}; + +/*====================================================================== + Ejecting Shell Casing for SG/SSG/Upgrade +======================================================================*/ +void() Touch_ShellCasing = +{ + if (check_skycontent(self.origin)) {entity_remove(self, 0.1); return;} + if (self.touchedvoid) return; // Marked for removal + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + self.touch = SUB_Null; + if (random() < 0.5) + sound(self, CHAN_VOICE, "weapons/shellc.wav", random()*0.25, ATTN_LOW); +}; + +//---------------------------------------------------------------------- +void(float shell_qty) Launch_ShellCasing = +{ + local vector org, dir, avel; + + if ( self.health < 1 ) return; + if (query_configflag(SVR_SHOTGCASE)) return; + + if (self.flags & FL_CLIENT) makevectors (self.v_angle); + else makevectors (self.angles); + org = self.origin + v_up*10; + + while (shell_qty > 0) { + dir = -v_right*75 + v_forward*(random()*50) + v_up*(100 + random()*100); + avel = vecrand(0,300,TRUE); + Launch_Grenade(org, dir, avel, CT_PROJ_SHELLC); + shell_qty = shell_qty - 1; + } +}; diff --git a/QC_other/QC_keep/projectiles_drake.qc b/QC_other/QC_keep/projectiles_drake.qc new file mode 100644 index 00000000..af7db8b2 --- /dev/null +++ b/QC_other/QC_keep/projectiles_drake.qc @@ -0,0 +1,970 @@ +void() Axe_Watch; +//========================================================================== +// Archer Knight Arrows + +// Update 11/24/09: Constants moved to defs. + +// Magic arrow explosion code. +void() AkArrow_Explode = +{ + self.count = self.count & 3; + sound (self, CHAN_AUTO, "archer/explode.wav", 1, ATTN_NORM); + Colored_Explosion (self.origin, self.count); + BecomeFancy (X80_SPARK_ORANGE + (self.count * 6), 6); +}; + +void() AkArrow_Magic_Touch = +{ +// Other, more powerful and explosive arrow types. + if (self.worldtype) + { + if (other.flags & FLx_CREATURE) + //if (!Ally_Check (other, self.master)) + //if (!HasReflection (other, self.origin, 0)) + if (other.mass && (other.mass <= MASS_SUPER)) + { // Knockback effect. + local float sped; + + sped = self.speed; + if (other.mass == MASS_SUPER) + sped = sped / 2; + other.velocity = other.velocity + (self.movedir * sped); + if (other.flags & FL_ONGROUND) + { + other.flags = other.flags - FL_ONGROUND; + if (other.velocity_z < 150) + other.velocity_z = 150; + } + } + } + T_MissileTouch (); +}; + +// Called when an arrow hits something. +void() AkArrow_Wood_Touch = +{ + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + //if (Reflected ()) + //return; + + self.touch = SUB_Null; // Stack overflow prevention. + if (other.takedamage) + { + spawn_touchblood (self, other, self.dmg); + T_Damage (other, self, self.master, self.dmg,DAMARMOR); + sound (self, CHAN_WEAPON, "archer/arrow1.wav", 1, ATTN_IDLE); + remove (self); + return; + } + if (other.solid != SOLID_BSP) // e.g., shielded mega enforcer. + { // Break on impact. + local vector org; + + org = self.origin - 8*normalize(self.velocity); + sound (self, CHAN_WEAPON, "archer/arrowbrk.wav", 1, ATTN_IDLE); + Tent_Point (TE_GUNSHOT, org); + remove (self); + return; + } +// Imbed into the surface. + if (random() < 0.5) + sound (self, CHAN_WEAPON, "archer/arrow2.wav", 1, ATTN_IDLE); + else + sound (self, CHAN_WEAPON, "archer/arrow3.wav", 1, ATTN_IDLE); + self.movetype = MOVETYPE_NONE; + self.velocity = self.avelocity = '0 0 0'; + // Reset think so arrow sticks in wall for a moment then vanishes. + self.nextthink= time + 1.5; + self.think = SUB_Remove; + self.touch = SUB_Remove; + if (other) + { // Hit something that may move later. Watch the axe... er, arrow. + self.enemy = other; + self.delay = self.nextthink; + self.nextthink = time + 0.100; + self.think = Axe_Watch; + } +}; + +void() AkArrow_Think = +{ + if (self.delay <= time) + {remove (self); return;} + + self.speed = vlen (self.velocity); + self.movedir = self.dest = normalize (self.velocity); + self.angles = vectoangles(self.movedir); + if (self.cnt) + Meteor_Trail (self.cnt, 1, FALSE); + + self.nextthink = time + 0.05; + +// PM: Energy arrows can blast ghosts. + //if (self.worldtype) + //Ghost_Touch (); +}; + +void(vector start, vector dir, float type) AkArrow_Launch = +{ + newmis = spawn (); + newmis.master = newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.classname = "arrow"; +// set missile speed + newmis.movedir = dir; +// if (ARROW_FLY) + { + newmis.speed = AKARROW_SPEED_FLY; + newmis.velocity = dir * newmis.speed; + } +// else +// { +// newmis.speed = AKARROW_SPEED_TOSS; +// newmis.velocity = dir * newmis.speed; +// newmis.velocity_z = newmis.velocity_z + 200; +// newmis.movetype = MOVETYPE_TOSS; +// } + newmis.avelocity = '0 0 0'; + newmis.avelocity_z = newmis.speed; // Makes arrow model spiral. + newmis.angles = vectoangles(newmis.velocity); + newmis.dest = dir; // for 'spawn_touchblood'. +// set missile damage +// Damage: green = 5-7, red = 8-12, gold = 13-17 +// For Quake, do x*3 so that orange = 15-20, gold = 25-35, blue = 40-50 +// Update/Drake: Green = 9, Red = 18, Yellow/Orange = 30. + if (type & 2) + { // Energy arrow. + type = newmis.count = 0; // Was LF_YELLOW. + Laser_Color (newmis, type); + newmis.worldtype = TRUE; // FIXME: Conflict with rocket code. + newmis.dmg = 30; + newmis.think1 = AkArrow_Explode; + // For more explosive arrow types, use safe flag so attacker doesn't + // blow himself up. Arrows don't explode in Hexen2, but I am making + // them so in Drake. + // Update 4/13/2009: Removed lightning flag. + newmis.style = DF_SAFE; + newmis.cnt = newmis.waitmax; + newmis.effects = newmis.effects | EF_DIMLIGHT; + newmis.oldorigin = start; + newmis.skin = ARROW_MAGIC + type; // Yes, use + not |. + } + else + { + newmis.worldtype = FALSE; + newmis.xfl = newmis.xfl | XFL_WIND; + // Normal wooden arrow. + newmis.cnt = 0; + if (type & 4) + newmis.dmg = 9; // Goblin arrow. + else if (type & 1) + newmis.dmg = 18; // Lord arrow. + else + newmis.dmg = 15; // Orc arrow. + newmis.skin = type & 1; + } + newmis.enemy = world; +// set missile duration + newmis.touch = AkArrow_Magic_Touch; + newmis.delay = time + 5; // Total duration + newmis.nextthink = time + 0.1; + newmis.think = AkArrow_Think; + if (!newmis.cnt) + { + newmis.touch = AkArrow_Wood_Touch; +// if (ARROW_FLY) + { + newmis.nextthink = newmis.delay; + newmis.think = SUB_Remove; + } + } + + if (self.classname == "monster_rebel") // FIXME: Crossbow bandit hack. + newmis.frame = 1; + setall (newmis, "progs/drake/arrow.mdl", '0 0 0', '0 0 0', start); +}; + +//========================================================================== +// Throwing Axe + +// This removes the axe if its surface moves or if its been out too long. +// Update: Also called by goblin arrow code for the same purpose. +void() Axe_Watch = +{ + if (self.delay <= time) + remove (self); + else if (vlen (self.enemy.velocity) > 0) + remove (self); // Surface moved, so remove the axe now. + else + self.nextthink = time + 0.100; +}; + +//========================================================================== +// Burst Lightning + +// +// The "Burst" is a form of chain lightning cast at a target. If the +// target is struck, and there are more targets near the one first struck, +// secondary bolts will erupt from the primary target and strike as many +// extra targets as possible. +// +// This form of chain lightning is based from the description of the +// Chain Lightning spell in the 3rd edition of Dungeons and Dragons. +// + +//------------------------------------------------------------------------// +// This returns the endpoint where a bolt of chain lightning should +// strike. The spot returned is usually the center of the target struck. +//------------------------------------------------------------------------// +vector(entity attacker, entity targ, vector start, vector end) + ChainLit_Point = +{ + local vector spot; + + spot = Midpoint (targ); + traceline (start, spot, FALSE, attacker); + if (trace_ent == targ) + { + // We can hit the center. Find the best endpoint of the bolt + // so that it looks good when drawn. This point is located + // between the targer's center and where the bolt hit. + + local vector dir; + local float d_impact, d_ideal, dist; + + dir = spot - start; + d_impact = vlen (spot - trace_endpos); + d_ideal = vlen (dir); + dir = normalize (dir); + // Bolts in beam TEs are drawn in intervals of 30. + dist = floor (d_ideal / 30) * 30; + if (dist >= d_impact) + end = start + dir*dist; + else + { + spot = start + dir*(dist+30); + if (spot_x >= targ.absmin_x) + if (spot_x <= targ.absmax_x) + if (spot_y >= targ.absmin_y) + if (spot_y <= targ.absmax_y) + if (spot_z >= targ.absmin_z) + if (spot_z <= targ.absmax_z) + end = spot; + } + } + + return end; +}; + +// Called within 'BurstLit_Chain' below. +float(entity targ, entity inflictor, entity attacker, float damage, + vector spot, string dtype, float bang) BurstLit_Trace = +{ + local vector end; + + if (targ.flags & FL_CLIENT) + end = targ.origin; // Use origin because of TE beam code for clients. + else + end = Midpoint (targ); + //- - - - - + // Update: Traceline must hit intended target! + // Targets can take damage from one bolt once because they + // can neither stack nor pierce. + // + // Note: Ghost touch code must be called before calling + // this function if ghosts are to be hit. + //- - - - - + traceline (spot, end, FALSE, inflictor); // 3rd was TRUE. + if (trace_ent == targ) + { + // Draw from source point to target point, except for players. + // For players, draw from target point to source point + // because engine always draws from origin in case of player. + if (targ.flags & FL_CLIENT) + Tent_Beam (TE_LIGHTNING2, targ, end, spot); + else + Tent_Beam (TE_LIGHTNING2, targ, spot, end); + if (bang == 2) + sound (inflictor, CHAN_VOICE, "weapons/lstart.wav", 1, ATTN_NORM); + else if (bang) + sound (inflictor, CHAN_VOICE, "weapons/lhit.wav", 1, ATTN_NORM); + end = trace_endpos; // Use where bolt hit for blood spot. + BoltDamage (targ, inflictor, attacker, end, damage, dtype); + return TRUE; + } + return FALSE; +}; + +// Shoots multiple lightning bolts at nearby targets from a common point. +// Used by burst lightning gun. Also used by plasma discharge. +void(entity inflictor, entity attacker, float damage, entity ignore, + vector spot, string dtype, vector pak, float bang) BurstLit_Chain = +{ + local entity head, saved; + local float hits; +// local vector end; + + local float nff, radius, hi; + + nff = pak_x; + radius = pak_y; + hi = pak_z; + + hits = 0; + saved = world; + head = findradius (spot, radius); + while (head) + { + // Notarget/stealth won't save you from discharge. + if (head.takedamage == DAMAGE_AIM) // Was flags & FLx_CREATURE. + if (head != attacker) + if (head != ignore) + if (head.resist_cells < 1) // Don't waste hits on immune targets. + //if (!HasReflection (head, spot, damage)) // Too much work to bounce here, so pass! + //if (!(nff && Ally_Check (head, attacker))) // nff = No Friendly Fire. + { + // Go to the trouble of zapping live, highly vulnerable targets + // first instead of dead or resistant targets. + if (head.deadflag || (head.health <= 0) || (head.resist_cells > 0)) + { // Dead or resistant -- save it for later. + head.chain2 = saved; + saved = head; + } + else if (BurstLit_Trace (head, inflictor, attacker, damage, spot, dtype, bang)) + { + hits = hits + 1; + if (hits >= hi) + return; + } + } + head = head.chain; + } +// Now we zap the saved targets because we ran out of other targets. + while (saved) + { + if (BurstLit_Trace (saved, inflictor, attacker, damage, spot, dtype, bang)) + { + hits = hits + 1; + if (hits >= hi) + return; + } + saved = saved.chain2; + } +}; + +// Fires a fat bolt of lightning, then splits into three thinner bolts +// after hitting a target. +void(vector p1, vector p2, entity attacker, float damage, float reach) + BurstLit_Bolt = +{ +//- - - - - - - - - +// 'inflictor' = Don't hit this entity during the traceline. +// 'src' = From whom the lightning gets drawn from. +// 'targ' = Target by traceline. +//- - - - - - - - - + local entity inflictor, src, targ; + local vector pak; + local float boing; + + pak_x = TRUE; // Friendly fire off. + pak_y = reach; + pak_z = 3; // Max number of targets. + + inflictor = src = attacker; + + //GhostTouch_On (); +//- - - - - - - - - + while (src) + { + // Scan for a hit. + reach = vlen(p2 - p1); + traceline (p1, p2, FALSE, inflictor); +// DISABLED -- Auto-aimed bolts that stray too far to the side look bad. +// if (trace_fraction == 1.0) // Try again with a fatter trace. +// traceline (p1, p2, 2, inflictor); + p2 = trace_endpos; + targ = trace_ent; + + // Check for reflection. + boing = FALSE; + //if (targ) + //if (HasReflection (targ, p2, damage)) + //boing = TRUE; + + // Draw beam. + if (targ.takedamage) // Hit something? Aim bolt at its center. + if (!boing) + p2 = ChainLit_Point (attacker, targ, p1, p2); + Tent_Beam (TE_LIGHTNING1, src, p1, p2); // Use the fat beam. + src = world; // Unless reflected later, end loop when done. + + // Do hit effects and damage. + /*if (boing) + { + ReflectSound (targ); + if (src != lightning) + { + reach = reach - vlen(p2 - p1); // Get remaining dist. + p1 = p2; + p2 = p2 + (normalize(p2 - targ.origin) * reach); + inflictor = targ; + src = lightning; + } + } + else + {*/ + if (targ.takedamage) + { + // Direct hit does full damage and splits the beam. + BoltDamage (targ, inflictor, attacker, p2, damage, "thunderbolt"); + BurstLit_Chain (targ, attacker, damage * 2 / 3, targ, p2, "thunderbolt", pak, FALSE); + } + //} + } +//- - - - - - - - - + //GhostTouch_Off (); +}; + +// Called by exploding plasma balls. Also by Mjolnir. +void() RyuPlasma_Discharge = +{ +// Reference for DoE plasma discharge stats. +// BurstLit_Chain (self, self.owner, 50, world, self.origin, self.classname, '0 320 5', TRUE); + local vector pak; + local string damagetype = ""; + + pak_x = self.style; + pak_y = self.distance; + pak_z = self.count; //5; + + BurstLit_Chain (self, self.owner, (self.dmg*0.5), self.enemy, self.origin, damagetype, pak, TRUE); +}; + +void() RyuPlasma_Explode = +{ + if (!self.dmg) + self.dmg = 100; + if (!self.distance) + self.distance = 320; + if (!self.count) + self.count = 5; + + if (self.enemy) + { + local float dmg1, dmg2; + + dmg1 = (0.8 + random()*0.2) * self.dmg; // Was '80 + random()*20'. + // PM: Add discharge damage to impact damage, then ignore other in + // the discharge call. Saves a hit in the discharge for someone else. + dmg2 = self.dmg * 0.5; + + if (self.enemy.classname == "monster_shambler") + dmg1 = dmg1 * 0.5; // Resists explosion damage. + else if (self.classname == "monster_dragon") + { + if (self.enemy.skin == 2) //SKIN_BLUE + { // Resists electrical damage. + dmg1 = dmg1 * 0.5; + dmg2 = dmg2 * 0.5; + } + } + + T_Damage (self.enemy, self, self.owner, (dmg1 + dmg2), DAMARMOR); + } + // don't do radius damage to the other, because all the damage + // was done in the impact + // Note: Radius damage was 70. + T_RadiusDamage (self, self.owner, self.dmg*0.7, self.enemy, DAMAGEALL); + + sound (self, CHAN_AUTO, "plasma/explode.wav", 1, ATTN_NORM); + self.origin = self.origin - 8*normalize(self.velocity); + setorigin (self, self.origin); // PM: Do it right. + Tent_Explosion2 (self.origin, 244, 3); + RyuPlasma_Discharge (); + + BecomeAnyExplosion (138, 6, "progs/drake/s_fancy.spr"); +}; + +void() RyuPlasma_Touch = +{ + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + + self.enemy = other; + RyuPlasma_Explode (); +}; + +void() RyuPlasma_Think = +{ + local float pc; + + if (self.delay <= time) + {remove (self); return;} + pc = pointcontents(self.origin); + if ((pc <= CONTENT_WATER) && (pc >= CONTENT_LAVA)) + {RyuPlasma_Explode(); return;} + + particle (self.origin, self.velocity * 0.005, 9, self.waitmin); //2 + particle (self.origin, self.velocity * 0.01, 41, self.waitmax); //4 + self.nextthink = time + 0.05; +}; + +void(vector start, vector dir, float sped, float damage) RyuPlasma_Launch = +{ + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.classname = "plasma"; +// set missile speed + newmis.movedir = dir; + newmis.speed = sped; + newmis.velocity = dir * sped; + newmis.avelocity = '300 300 300'; + newmis.angles = vectoangles(newmis.velocity); +// set missile damage + newmis.dmg = damage; + //effects set below. + newmis.distance = damage + 220; // 320 when dmg == 100. + newmis.enemy = world; + newmis.style = FALSE; // TRUE is 'no friendly fire' discharge. + // Note: Mjolnir has a range of 350. +// set missile duration + newmis.touch = RyuPlasma_Touch; + newmis.delay = time + 5; // Total duration. As spikes. + newmis.nextthink = 0.01; + newmis.think = RyuPlasma_Think; + + // Big plasma balls from DoE. + newmis.waitmin = 2; + newmis.waitmax = 4; + newmis.effects = EF_DIMLIGHT; // DoE used EF_BRIGHTLIGHT. + setmodel (newmis, "progs/plasma.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + setorigin (newmis, start); +}; + + +//========================================================================== +// Acid Bomb -- Used by green dragon. + +void() Acidball_Touch = +{ + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + + self.touch = SUB_Null; + self.enemy = other; + + if (!self.dmg) + self.dmg = 120; + + // Don't bother with green dragon acid resistance. + if (self.enemy) // Don't check health, just if there is a target. + { // Someone took a direct hit. + local float damage; + + damage = self.dmg / 6 * (5 + random()); + T_Damage (self.enemy, self, self.owner, damage, DAMARMOR); + } + // Don't do radius damage to the enemy, because all the damage + // was done in the impact. + T_RadiusDamage (self, self.owner, self.dmg, self.enemy,DAMAGEALL); + +// PM: Don't set origin directly during a touch function because of +// possible link scrambling. May cause FitzQuake to crash otherwise. + self.origin = self.origin - 8*normalize(self.velocity); + Tent_Explosion2 (self.origin, 48, 16); + BecomeAnyExplosion (115, 5, "progs/drake/s_fancy.spr"); +}; + +void(vector start, vector dir, float sped, float damage) Acidball_Launch = +{ + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_BBOX; + newmis.classname = "acid"; +// set missile speed + newmis.speed = sped; + newmis.velocity = dir * sped; + newmis.avelocity = '200 100 300'; + newmis.angles = vectoangles(newmis.velocity); +// set missile damage + newmis.dmg = damage; +// set missile special stuff + newmis.dest = dir; +// set missile duration + newmis.touch = Acidball_Touch; + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + + setmodel (newmis, "progs/drake/acidbal1.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + setorigin (newmis, start); +}; + + +//========================================================================== +// Acid -- Used by scrag and green dragon. + +void() Acid_Think = +{ + if (self.delay <= time) + {remove (self); return;} + +// self.angles = normalize (self.velocity); +// self.angles = vectoangles (self.angles); + self.angles = vectoangles (self.velocity); + self.nextthink = time + 0.1; +}; + +void(vector start, vector dir, float sped) Acid_Launch = { launch_projectile(start, dir, CT_PROJ_WIZ, sped); }; + +void(vector start, vector dir, float sped) Acid_Toss = +{ + Acid_Launch (start, dir, sped); + + newmis.movetype = MOVETYPE_TOSS; + newmis.speed = sped; + newmis.velocity = (dir * sped) + '0 0 200'; + newmis.angles = vectoangles (newmis.velocity); + newmis.delay = newmis.nextthink; + newmis.nextthink = time + 0.1; + newmis.think = Acid_Think; +}; + +//========================================================================== +// Meat -- Used by zombie and nightshade (wraith dragon) + +// Formerly 'ZombieGrenadeTouch' +void() Meat_Touch = +{ + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + //if (Reflected ()) + // return; + + if (other.takedamage) + { + if (!self.dmg) + self.dmg = 10; + self.touch = SUB_Null; // Stack overflow prevention. +// if (cranked) +// Poison_Add (other, 1); // Give fatal illness like in movies. + T_Damage (other, self, self.master, self.dmg, DAMARMOR); + sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); + remove (self); + return; + } + sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound + self.velocity = self.avelocity = '0 0 0'; + self.touch = SUB_Remove; +}; + +// This was formerly 'ZombieFireGrenade'. +void(vector start, vector dir) Meat_Launch = +{ + newmis = spawn (); + newmis.master = newmis.owner = self; + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_BBOX; +// newmis.classname = "meat"; +// set missile speed + newmis.speed = 600; + newmis.velocity = dir * 600; + newmis.velocity_z = newmis.velocity_z + 200; // Used to be 200 only. + newmis.avelocity = '3000 1000 2000'; +// set missile damage + newmis.dmg = 10; + if (self.classname == "monster_mummy") + newmis.dmg = random() * 15 + 15; +// set missile duration + newmis.touch = Meat_Touch; + newmis.nextthink = time + 2.5; + newmis.think = SUB_Remove; + + setall (newmis, "progs/zom_gib.mdl", '0 0 0', '0 0 0', start); +}; + +//========================================================================== +// Magic Missiles -- Used by hell knight, baron, and nemesant. + +// Moved to 'weapons.qc'. + + +//========================================================================== +// Rain Storm -- Used by the elemental boss barons. + +//- - - - - - - - - +// Various missile functions for the rainstorm. +void() RainStorm_Ice = +{ +// Use flymissile instead of toss for the missile clip bonus. +// Then set speed to a reasonably fast value to use for terminal velocity. + Ice_Launch (trace_endpos, '0 0 -1', 1000); + newmis.master = newmis.owner = self.owner; + newmis.delay = time + 2.5; + newmis.dmg = self.dmg; +}; + +// DISABLED -- Unused. +//void() RainStorm_Fire = +//{ +// Fireball_Launch (self.owner, trace_endpos, '0 0 -1', 1000, self.dmg); +// newmis.delay = time + 2.5; +// newmis.noise = "hknight/hit.wav"; +// newmis.style = newmis.style | DF_SAFE; +//}; + +// DISABLED -- Unused. +//void() RainStorm_Steel = +//{ +// launch_superspike (trace_endpos, '0 0 -1'); +// newmis.master = newmis.owner = self.owner; +// newmis.nextthink= time + 2.5; +// newmis.dmg = self.dmg; +//}; +//- - - - - - - - - + +void() RainStorm_Think = +{ + if (self.delay <= time) + { + super_active = 0; + remove (self); + return; + } + +// Find a point to spawn a rain drop. + local vector p1, p2, dir; + + p1 = self.enemy.origin; + p2_x = crandom() * self.distance + p1_x; + p2_y = crandom() * self.distance + p1_y; + p2_z = p1_z; + + traceline (p1, p2, TRUE, self); + p2 = trace_endpos; + if (trace_fraction < 1) + { // Move away from the wall a tiny bit. + dir = normalize (p2 - p1); + p2 = p2 - dir*2; + } + traceline (p2, p2 + '0 0 2048', TRUE, self); + // Move endpoint away from the ceiling. + // We can't pass vectors to a void() function, so use trace_endpos. + if (trace_fraction < 1) + trace_endpos = trace_endpos - '0 0 2'; + + if (self.think1) + self.think1 (); + else + {remove (self); return;} + + self.nextthink = time + self.wait; +}; + +// Spawns a missile spawner that drops shots on a target from the ceiling. +void(entity targ, entity attacker, float damage, float fps, float dist, + float limit, void() thinkst) RainStorm = +{ + if (limit) + if (super_active) // FIXME: Check this only if attacker is a monster. + return; + + super_active = 1; // This chews through a lot of edicts. + + if (!fps) + fps = 10; + if (!dist) + dist = 64; + + newmis = spawn(); + setorigin (newmis, '0 0 0'); + + newmis.owner = attacker; + newmis.enemy = targ; + newmis.delay = time + 5; + newmis.think = RainStorm_Think; + newmis.think1 = thinkst; + newmis.dmg = damage; + newmis.wait = 1 / fps; + newmis.distance = dist; + newmis.nextthink= 0.01; +}; + +//========================================================================== +// Knight Fireball -- Used by hell knight and baron. + +void(vector start, vector dir) KnightBall_Launch = +{ + local entity missile; + + missile = spawn (); + missile.master = missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "fireball"; +// set missile speed + missile.speed = 1000; + missile.velocity = dir * 1000; + missile.angles = vectoangles(missile.velocity); + missile.avelocity = '0 0 0'; + missile.avelocity_z = random()*2000 - 1000; +// set missile damage + missile.dmg = 60; + missile.enemy = world; + missile.style = DF_ROCKET; // Shamblers take half damage. +// set missile duration + missile.touch = T_MissileTouch; + missile.nextthink = time + 5; + missile.think = T_MissileExplode; + missile.think1 = Orange_Explosion; + + missile.frame = 2; + setall (missile, "progs/drake/k_ball.mdl", '0 0 0', '0 0 0', start); + + newmis = missile; +}; + +void(vector st, float lo) M_FireKnight = +{ + local vector p1, p2, dir; + local entity targ; + +// if (cranked) +// targ = self.enemy; +// else + targ = world; + makevectors (self.angles); + p1 = self.origin + (v_forward * st_x) + (v_right * st_y) + (v_up * st_z); + p2 = Aimpoint (self.enemy); + if (lo) + p2_z = self.enemy.absmin_z + 1; + dir = Maim_Line (p1, p2, 1000, targ, '0 0 0'); + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_WEAPON, "baron/fireball.wav", 1, ATTN_NORM); + + KnightBall_Launch (p1, dir); +}; + +//================ +// W_FireSaw +//================ +void(entity targ, vector dir) Attack_Saw = +{ + local vector spot; + local vector source, org, vec2; + local float src_dist, dotprod, axedmg; + local entity onflr, tself, tother; + + source = self.origin + '0 0 16'; // Move source point up body + + // See if there are any bodies lying around + onflr = find(world, bodyonflr, MON_ONFLR); + while (onflr) { + src_dist = vlen(source - onflr.origin); + if (src_dist < RANGE_CHOPAXE) { // Is the body close to the player? + org = onflr.origin - '0 0 16'; // move origin close to floor + makevectors (self.v_angle); // Calculate viewing angle + vec2 = normalize (org - self.origin); + dotprod = vec2 * v_forward; + if (dotprod > 0.6) { // Is the body infront of the player + onflr.origin = org; // Move gib closer to floor + onflr.bodyonflr = string_null; // no more body gibbing + tself = self; tother = other; // save self/other + self = onflr; other = tself; // switch around + if (onflr.classgroup == CG_ZOMBIE) { + self.health = 0; + Killed(onflr, tself); + } + else { + self.max_health = MON_NOGIBVELOCITY; // use minimal velocity + monster_ThrowGib(); // throw parts + } + + self = tself; other = tother; // switch back + SpawnBlood (onflr, onflr.origin, '0 0 50', axedmg*4); + return; // Finished + } + } + // See if there are anymore bodies close by + onflr = find(onflr,bodyonflr, MON_ONFLR); + } + + spot = self.origin + '0 0 16'; // 'source' + traceline (spot, spot + dir*64, FALSE, self); + if (trace_fraction == 1.0) + return; + + // This next check is for AI-controlled monsters aiming at 'targ', + // which should equal 'self.enemy'. + if (targ) + if (trace_ent != targ) + return; // Missed target. + + spot = trace_endpos - dir*4; // 'org' + targ = trace_ent; + if (targ.takedamage) { + local vector vec; + local float damage, dflags, pain; + local string dtype; + + dtype = "chainsaw"; // Normal kill. + dflags = DF_SCAR | DF_MELEE; + damage = 40; + if (trace_fraction <= 0.5) { + // Deep hit. + dtype = "saw_decap"; // Chop off the head. + if (targ.xsf & XSF_BODY_DOUBLE) // Chop up flimsy bodies. + if (targ.max_health < 50) + if (targ.health > damage) + damage = targ.health; + } + + // Suck life like Heretic's necro gauntlets. + //if (self.tome_finished) { + // if (damage < 40) + // damage = 40; + // dflags = dflags | DF_LEECH; + //} + + // Blood! + vec = ((random()*300) - 150) * v_right + (100 * v_forward); + SpawnBlood (targ, trace_endpos, '0 0 5', damage); + if (self.weaponframe & 1) + SpawnMeatSprayDrake (self.origin + dir*16, vec, targ.bloodtype); + // Damage! + pain = FeelsPain (targ); + T_Damage (targ, self, self, damage, DAMARMOR); + if (targ.solid != SOLID_BSP) + targ.velocity = targ.velocity * 0.5; + // Sounds. + sound (self, CHAN_WEAPON, "weapons/sawguts.wav", 1, ATTN_NORM); + if (targ.hittype == HIT_METAL || targ.spawnflags & MON_OGRE_GREEN || targ.spawnflags & MON_HOGRE_METAL) + if (pain && (targ.pain_finished > time)) + sound (self, CHAN_AUTO, "weapons/clang.wav", 1, ATTN_NORM); + + if (targ.hittype == HIT_STONE) + if (pain && (targ.pain_finished > time)) + sound (self, CHAN_AUTO, "weapons/axhitwal.wav", 1, ATTN_NORM); + + self.punchangle_x = -8; + } + else + { // Hit wall. + sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); + Tent_Point (TE_GUNSHOT, spot); + } +}; + +void() W_FireSaw = { + if (cutscene || intermission_running) + return; // Abort if in intermission. + makevectors (self.v_angle); + Attack_Saw (world, v_forward); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/projectiles_keep.qc b/QC_other/QC_keep/projectiles_keep.qc new file mode 100644 index 00000000..e68cc259 --- /dev/null +++ b/QC_other/QC_keep/projectiles_keep.qc @@ -0,0 +1,1322 @@ +void (vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion; + +void() big_explosion_think = { + self.frame = self.frame + 1; + if (self.frame > 16) + SUB_Remove(); + + self.nextthink = time + 0.05; + self.think = big_explosion_think; +}; + +void(vector org, float snd) spawn_big_explosion = { + local entity e; + + e = spawn(); + e.movetype = MOVETYPE_NONE; + e.solid = SOLID_NOT; + setmodel(e, "progs/bigexp.spr"); + setorigin(e, org); + if (snd == 1) + sound(e, CHAN_AUTO, "weapons/expl1.wav", 0.2, ATTN_NORM); + + e.alpha = 0.6; + e.effects = 32; + e.nextthink = time + 0.05; + e.think = big_explosion_think; +}; + +void() small_explosion_think = { + self.frame = self.frame + 1; + if (self.frame > 13) + SUB_Remove(); + + self.nextthink = time + 0.05; + self.think = small_explosion_think; +}; + +void(vector org, float snd) spawn_small_explosion = { + local entity e; + + e = spawn(); + e.movetype = MOVETYPE_NONE; + e.solid = SOLID_NOT; + setmodel(e, "progs/smlexp.spr"); + setorigin(e, org); + if (snd == 1) + sound(e, CHAN_AUTO, "weapons/expl1.wav", 0.2, ATTN_NORM); + + e.alpha = 0.6; + e.effects = 32; + e.nextthink = time + 0.05; + e.think = small_explosion_think; +}; + +//----------Hipnotic weapon functions----------------------------------- +void () HIP_LaserTouch = { + local vector org; + local vector spot1; + local vector spot2; + local vector oldvel; + local float r; + + self.owner = world; + self.cnt = (self.cnt + TRUE); + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + oldvel = normalize (self.old_velocity); + spot1 = (self.origin - (FL_INWATER * oldvel)); + spot2 = (self.origin + (FL_INWATER * oldvel)); + traceline (spot1,spot2,FALSE,self); + self.origin = trace_endpos; + org = self.origin; + if ( other.health ) { + if ( (self.lastvictim == other) ) { + self.dmg = (self.dmg / FL_SWIM); + } + spawn_touchblood (self, other, self.dmg); + T_Damage (other,self,self.lastvictim,self.dmg,DAMARMOR); + } else { + if ( ((self.cnt == 3) || (random () < 0.150)) ) { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_GUNSHOT); + WriteCoord (MSG_BROADCAST,org_x); + WriteCoord (MSG_BROADCAST,org_y); + WriteCoord (MSG_BROADCAST,org_z); + } else { + self.dmg = (0.900 * self.dmg); + self.velocity = (oldvel + (FL_SWIM * trace_plane_normal)); + self.velocity = normalize (self.velocity); + self.velocity = (self.speed * self.velocity); + self.old_velocity = self.velocity; + if ( (self.flags & FL_ONGROUND) ) + self.flags = (self.flags - FL_ONGROUND); + + r = random (); + sound (self,CHAN_WEAPON,"hipweap/laserric.wav",TRUE,ATTN_STATIC); + return ; + } + } + sound (self,CHAN_WEAPON,"enforcer/enfstop.wav",TRUE,ATTN_STATIC); + remove (self); +}; + +void () HIP_LaserThink = { + if ( (time > self.attack_finished) ) { remove (self); return; } + if ( (self.flags & FL_ONGROUND) ) + self.flags = (self.flags - FL_ONGROUND); + + self.velocity = self.old_velocity; + self.angles = vectoangles (self.velocity); + self.nextthink = (time + 0.100); +}; + +void (vector org, vector vec, float light) HIP_LaunchLaser = { + if (self.perms | IT_BLASTER && self.weapon == IT_SHOTGUN) { + sound (self,CHAN_WEAPON,"enforcer/enfire.wav",TRUE,ATTN_NORM); + } else { + sound (self,CHAN_WEAPON,"hipweap/laserg.wav",TRUE,ATTN_NORM); + } + vec = normalize (vec); + newmis = spawn (); + newmis.owner = self; + newmis.classname = "hiplaser"; + newmis.lastvictim = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + if ( light ) + newmis.effects = EF_DIMLIGHT; + + if (self.perms | IT_BLASTER && self.weapon == IT_SHOTGUN) { + setmodel (newmis,"progs/ad171/proj_laz.mdl"); + } else { + setmodel (newmis,"progs/hipnotic/lasrspik.mdl"); + } + setsize (newmis,VEC_ORIGIN,VEC_ORIGIN); + setorigin (newmis,org); + newmis.speed = 1000.000; + newmis.dmg = 18.000; + if (self.perms | IT_BLASTER && self.weapon == IT_SHOTGUN) newmis.dmg = 24; // slight boost for blaster to at least match AD shotgun boost + newmis.velocity = (vec * newmis.speed); + newmis.old_velocity = newmis.velocity; + newmis.angles = vectoangles (newmis.velocity); + newmis.avelocity = '0.000 0.000 400.000'; + newmis.nextthink = time; + newmis.attack_finished = (time + MOVETYPE_FLY); + newmis.think = HIP_LaserThink; + newmis.touch = HIP_LaserTouch; + newmis.count = FALSE; +}; + +void (vector p1, vector p2, entity from, float damage) HIP_HammerDamage = { + local entity e1; + local entity e2; + local vector f; + + f = (p2 - p1); + normalize (f); + f_x = (FALSE - f_y); + f_y = f_x; + f_z = FALSE; + f = (f * FL_INWATER); + e2 = world; + e1 = world; + traceline (p1,p2,FALSE,self); + if ( (trace_ent.takedamage && !trace_ent.wetsuit_finished) ) { + particle (trace_endpos,'0.000 0.000 100.000',225.000,(damage * MOVETYPE_STEP)); + T_Damage (trace_ent,from,from,damage,DAMARMOR); + if ( (self.classname == "player") ) { + if ( (other.classname == "player") ) + trace_ent.velocity_z = (trace_ent.velocity_z + 400.000); + } + } + e1 = trace_ent; + traceline ((p1 + f),(p2 + f),FALSE,self); + if ( (((trace_ent != e1) && trace_ent.takedamage) && !trace_ent.wetsuit_finished) ) { + particle (trace_endpos,'0.000 0.000 100.000',225.000,(damage * MOVETYPE_STEP)); + T_Damage (trace_ent,from,from,damage, DAMARMOR); + } + e2 = trace_ent; + traceline ((p1 - f),(p2 - f),FALSE,self); + if ( ((((trace_ent != e1) && (trace_ent != e2)) && trace_ent.takedamage) && !trace_ent.wetsuit_finished) ) { + particle (trace_endpos,'0.000 0.000 100.000',225.000,(damage * MOVETYPE_STEP)); + T_Damage (trace_ent,from,from,damage, DAMARMOR); + } +}; + +void () HIP_LightningThink = { + local vector org; + local vector dst; + local entity head; + local entity selected; + local float cur_dist; + local float head_dist; + local vector vec; + local float dot; + local float oldstate; + local float dam; + local vector end; + + if ( (time > self.delay) ) { + if ( (self.enemy != world) ) + self.enemy.struck_by_mjolnir = FALSE; + + remove (self); + return ; + } + oldstate = self.state; + + // Multi-lightning effect of Mjolnir + if ( (self.state == FALSE) ) { + self.enemy = world; + selected = world; + cur_dist = self.distance; + head = findradius (self.owner.origin,self.distance); + while ( head ) { + if ( (!(head.flags & FL_NOTARGET) && ((head.flags & FL_MONSTER) || (head.flags & FL_CLIENT))) ) { + visible (head); + if ( ((visible (head) && (head != self.owner.owner)) && (head.health > FALSE)) ) { + head_dist = vlen ((head.origin - self.lastvictim.origin)); + if ( ((head_dist < cur_dist) && (head.struck_by_mjolnir == FALSE)) ) { + selected = head; + cur_dist = head_dist; + } + } + } + head = head.chain; + } + if ( (selected != world) ) { + self.state = TRUE; + self.enemy = selected; + self.enemy.struck_by_mjolnir = TRUE; + } else { + makevectors (self.v_angle); + org = self.owner.origin; + end = (org + (v_forward * 200)); + end = (end + (((400.000 * random ()) - 200) * v_right)); + traceline (org,end,TRUE,self); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST,self); + WriteCoord (MSG_BROADCAST,org_x); + WriteCoord (MSG_BROADCAST,org_y); + WriteCoord (MSG_BROADCAST,org_z); + WriteCoord (MSG_BROADCAST,trace_endpos_x); + WriteCoord (MSG_BROADCAST,trace_endpos_y); + WriteCoord (MSG_BROADCAST,trace_endpos_z); + self.nextthink = (time + 0.100); + return ; + } + } + org = self.lastvictim.origin; + dst = (self.enemy.absmin + (0.250 * (self.enemy.absmax - self.enemy.absmin))); + dst = (dst + ((random () * 0.500) * (self.enemy.absmax - self.enemy.absmin))); + traceline (org,dst,TRUE,self.owner.owner); + if ( ((trace_fraction != TRUE) || (self.enemy.health <= FALSE)) ) { + self.enemy.struck_by_mjolnir = FALSE; + self.state = FALSE; + self.nextthink = (time + 0.100); + return ; + } + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST,self); + WriteCoord (MSG_BROADCAST,org_x); + WriteCoord (MSG_BROADCAST,org_y); + WriteCoord (MSG_BROADCAST,org_z); + WriteCoord (MSG_BROADCAST,trace_endpos_x); + WriteCoord (MSG_BROADCAST,trace_endpos_y); + WriteCoord (MSG_BROADCAST,trace_endpos_z); + vec = normalize ((self.enemy.origin - self.owner.origin)); + dot = (vec * self.owner.movedir); + head = self; + self = self.owner.owner; + if ( (oldstate == FALSE) ) { + dam = 80; + } else { + dam = 30; + } + if ( (dot > 0.300) ) { + HIP_HammerDamage (org,trace_endpos,self,dam); + } else { + HIP_HammerDamage (org,trace_endpos,self,(dam * 0.500)); + } + self = head; + self.nextthink = (time + 0.200); +}; + +void (entity prev, entity own, float dst) HIP_SpawnMjolnirLightning = { + local entity light; + + light = spawn (); + light.delay = (time + 0.800); + light.state = FALSE; + light.lastvictim = prev; + light.distance = dst; + light.owner = own; + light.v_angle = self.angles; + light.v_angle_x = FALSE; + light.v_angle_z = FALSE; + light.origin = own.origin; + light.think = HIP_LightningThink; + light.nextthink = time; +}; + +void () HIP_SpawnMjolnirBase = { + local entity light; + + light = spawn (); + light.origin = trace_endpos; + light.flags = FALSE; + light.owner = self; + light.struck_by_mjolnir = TRUE; + light.think = SUB_Remove; + light.nextthink = (time + TRUE); + sound (light,CHAN_AUTO,"hipweap/mjolslap.wav",TRUE,ATTN_NORM); + sound (light,CHAN_WEAPON,"hipweap/mjolhit.wav",TRUE,ATTN_NORM); + makevectors (self.v_angle); + light.movedir = v_forward; + HIP_SpawnMjolnirLightning (light,light,350.000); + HIP_SpawnMjolnirLightning (light,light,350.000); + HIP_SpawnMjolnirLightning (light,light,350.000); + HIP_SpawnMjolnirLightning (light,light,350.000); +}; + +void () HIP_FireMjolnirLightning = { + local float cells; + + if ( (self.waterlevel > TRUE) ) { + cells = self.ammo_cells; + self.ammo_cells = FALSE; + discharged = TRUE; + T_RadiusDamage (self,self,(35.000 * cells),world, DAMAGEALL); + discharged = FALSE; + W_SetCurrentAmmo (self); + return ; + } + self.ammo_cells = (self.ammo_cells - 15.000); + self.currentammo = (self.currentammo - 15.000); + HIP_SpawnMjolnirBase (); +}; + +void () ProximityExplode = { + T_RadiusDamage (self,self.owner,95.000,world, DAMAGEALL); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + BecomeExplosion (); +}; + +void () ProximityGrenadeExplode = { + self.takedamage = DAMAGE_NO; + NumProximityGrenades = (NumProximityGrenades - TRUE); + self.deathtype = "exploding"; + self.nextthink = (time + 0.100); + self.owner = self.lastvictim; + self.think = ProximityExplode; +}; + +void () ProximityGrenadeTouch = { + if ( (other == self) ) + return ; + + if ( (other.classname == self.classname) ) + return ; + + self.movetype = MOVETYPE_TOSS; + if ( (self.state == TRUE) ) + return ; + + if ( (vlen (other.velocity) > FALSE) ) { + ProximityGrenadeExplode (); + self.think (); + return ; + } + if ( (other.takedamage == DAMAGE_AIM) ) { + ProximityGrenadeExplode (); + self.think (); + return ; + } + sound (self,CHAN_WEAPON,"weapons/bounce.wav",TRUE,ATTN_NORM); + self.movetype = MOVETYPE_NONE; + setsize (self,'-8.000 -8.000 -8.000','8.000 8.000 8.000'); + self.state = TRUE; + self.spawnmaster = other; +}; + +void () ProximityBomb = { + local entity head; + local float blowup; + + if ( (((time > self.delay) || (NumProximityGrenades > 64.000)) || (vlen (self.spawnmaster.velocity) > FALSE)) ) { + ProximityGrenadeExplode (); + self.think (); + return ; + } + self.owner = world; + self.takedamage = DAMAGE_YES; + head = findradius (self.origin,140.000); + blowup = FALSE; + while ( head ) { + if ( ((((head != self) && (head.health > FALSE)) && (head.flags & (FL_CLIENT | FL_MONSTER))) && (head.classname != self.classname)) ) + blowup = TRUE; + + if ( ((head.classname == self.classname) && (head.state == FALSE)) ) + blowup = TRUE; + + traceline (self.origin,head.origin,TRUE,self); + if ( (trace_fraction != TRUE) ) + blowup = FALSE; + + if ( (blowup == TRUE) ) { + sound (self,CHAN_WEAPON,"hipweap/proxwarn.wav",TRUE,ATTN_NORM); + ProximityGrenadeExplode (); + self.nextthink = (time + 0.500); + return; + } + head = head.chain; + } + self.nextthink = (time + 0.250); +}; +//---------------------------------------------------------------------- + +//----------Rogue weapon functions-------------------------------------- +void () lavaspike_touch = { + local float old_armortype; + local float old_armorvalue; + local float old_armormask; + + if ( (other == self.owner) ) + return ; + + if ( (other.solid == SOLID_TRIGGER) ) + return ; + + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + if ( other.takedamage ) { + spawn_touchblood (self, other, 9); + if ( (other.classname == "player") ) { + old_armortype = other.armortype; + old_armorvalue = other.armorvalue; + old_armormask = (other.items2 & ((IT2_ARMOR1 | IT2_ARMOR2) | IT2_ARMOR3)); + other.armortype = FALSE; + other.armorvalue = FALSE; + T_Damage (other,self,self.owner,9,DAMARMOR); + other.armortype = old_armortype; + other.armorvalue = old_armorvalue; + other.items2 = (other.items2 | old_armormask); + } else { + if ( (other.classname != "monster_lava_man") ) + T_Damage (other,self,self.owner,15,DAMARMOR); + } + } else { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + if ( (self.classname == "wizspike") ) { + WriteByte (MSG_BROADCAST,TE_WIZSPIKE); + } else { + if ( (self.classname == "knightspike") ) { + WriteByte (MSG_BROADCAST,TE_KNIGHTSPIKE); + } else { + WriteByte (MSG_BROADCAST,TE_SPIKE); + } + } + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + } + remove (self); +}; + +void () superlavaspike_touch = { + local float old_armortype; + + if ( (other == self.owner) ) + return ; + + if ( (other.solid == SOLID_TRIGGER) ) + return ; + + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + if ( other.takedamage ) { + spawn_touchblood (self, other, 18.000); + if ( (other.classname == "player") ) { + old_armortype = other.armortype; + other.armortype = (other.armortype * 0.500); + T_Damage (other,self,self.owner,18.000,DAMARMOR); + if ( (other.armortype != FALSE) ) + other.armortype = old_armortype; + } else { + if ( (other.classname != "monster_lava_man") ) + T_Damage (other,self,self.owner,30,DAMARMOR); + } + } else { + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_SUPERSPIKE); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + } + remove (self); +}; + +void (vector org, vector dir) launch_lava_spike = { + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.angles = vectoangles (dir); + newmis.touch = lavaspike_touch; + newmis.classtype = CT_PROJ_LAVASPIK; + newmis.think = SUB_Remove; + newmis.nextthink = (time + MOVETYPE_TOSS); + setmodel (newmis,"progs/lspike.mdl"); + setsize (newmis,VEC_ORIGIN,VEC_ORIGIN); + setorigin (newmis,org); + newmis.velocity = (dir * 1000.000); +}; + +void () MiniGrenadeExplode = { + if ( (self.owner.classname == "player") ) { + T_RadiusDamage (self,self.owner,90.000,world,DAMAGEALL); + } else { + T_RadiusDamage (self,self.owner,60.000,world,DAMAGEALL); + } + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + //WriteByte (MSG_BROADCAST,230.000); + //WriteByte (MSG_BROADCAST,MOVETYPE_FLY); + BecomeExplosion (); +}; + +void () MultiGrenadeTouch; + +void (float offsetAngle) MiniGrenadeLaunch = { + local entity missile; + local float tempRand; + + missile = spawn (); + missile.owner = self.owner; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "MiniGrenade"; + missile.v_angle = self.v_angle; + missile.v_angle_y = (missile.v_angle_y + offsetAngle); + makevectors (missile.v_angle); + missile.velocity = ((v_forward * 100.000) + (v_up * 400)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_forward)); + tempRand = ((crandom () * 40) - 20.000); + missile.velocity = (missile.velocity + (tempRand * v_right)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_up)); + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = MultiGrenadeTouch; + setmodel (missile,"progs/rogue/mervup.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,self.origin); + missile.nextthink = ((time + TRUE) + (crandom () * 0.500)); + missile.think = MiniGrenadeExplode; +}; + +void () MultiGrenadeExplode = { + MiniGrenadeLaunch (FALSE); + MiniGrenadeLaunch (72.000); + MiniGrenadeLaunch (144.000); + MiniGrenadeLaunch (216.000); + MiniGrenadeLaunch (288.000); + remove (self); +}; + +void () MultiGrenadeTouch = { + if ( (other == self.owner) ) + return ; + + if ( (other.takedamage == DAMAGE_AIM) ) { + if ( (self.classname == "MiniGrenade") ) { + MiniGrenadeExplode (); + } else { + if ( (self.owner.classname == "player") ) { + GrenadeExplode (); + } else { + MiniGrenadeExplode (); + } + } + return ; + } + sound (self,CHAN_WEAPON,"weapons/bounce.wav",TRUE,ATTN_NORM); + if ( (self.velocity == VEC_ORIGIN) ) + self.avelocity = VEC_ORIGIN; +}; + +void () MultiRocketExplode = { + local float damg; + + if (self.owner.classtype == CT_MONGREMLIN) { + damg = 30 + random()*10; + } else { + damg = (60.000 + (random () * 15)); + } + if ( other.health ) + T_Damage (other,self,self.owner,damg,DAMARMOR); + + T_RadiusDamage (self,self.owner,75.000,other,DAMAGEALL); + self.origin = (self.origin - (FL_CLIENT * normalize (self.velocity))); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + BecomeExplosion (); +}; + +void () MultiRocketTouch = { + if ( (other == self.owner) ) + return ; + + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + + MultiRocketExplode (); +}; + +void () HomingMissileThink = { + local vector dir; + + if ( (self.enemy.health < TRUE) ) { + remove (self); + return ; + } + dir = normalize ((self.enemy.origin - self.origin)); + self.velocity = (dir * 1000.000); + self.nextthink = (time + 0.100); + self.think = HomingMissileThink; +}; + +void () HomingMissileAcquire = { + local vector oldVelocity; + local vector aimangle; + + if ( (self.delay < time) ) { + MultiRocketExplode (); + return ; + } + oldVelocity = self.velocity; + makevectors (self.v_angle); + self.velocity = aim (self,1000.000); + self.velocity = (self.velocity * 1000.000); + aimangle = (self.origin + self.velocity); + traceline (self.origin,aimangle,FALSE,self); + if ( (trace_fraction < TRUE) ) { + if ( (trace_ent.flags & FL_MONSTER) ) { + self.enemy = trace_ent; + HomingMissileThink (); + return ; + } + } + self.velocity = oldVelocity; + self.v_angle = vectoangles (self.velocity); + self.angles = self.v_angle; + self.think = HomingMissileAcquire; + self.nextthink = (time + 0.200); +}; + +void (float offset, float frameNum) MultiRocketLaunch = { + local entity missile; + local vector aimangle; + + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "MultiRocket"; + missile.delay = (time + MOVETYPE_STEP); + missile.frame = frameNum; + missile.touch = MultiRocketTouch; + if ( (deathmatch || coop) ) { + setmodel (missile,"progs/rockup_d.mdl"); + } else { + setmodel (missile,"progs/rockup.mdl"); + } + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,((self.origin + (v_forward * FL_CLIENT)) + '0.000 0.000 16.000')); + if ( (coop || deathmatch) ) { + aimangle = self.v_angle; + aimangle_y = (aimangle_y + (offset * 0.660)); + makevectors (aimangle); + missile.velocity = aim (self,1000.000); + missile.velocity = (missile.velocity * 1000.000); + missile.angles = vectoangles (missile.velocity); + missile.think = MultiRocketExplode; + missile.nextthink = (time + 4); + } else { + makevectors (self.v_angle); + missile.velocity = ((v_forward * 1000.000) - ((v_right * offset) * FL_CLIENT)); + missile.angles = vectoangles (missile.velocity); + missile.v_angle = self.v_angle; + aimangle = (missile.origin + missile.velocity); + traceline (missile.origin,aimangle,FALSE,self); + if ( (trace_fraction < TRUE) ) { + if ( (trace_ent.flags & FL_MONSTER) ) { + missile.enemy = trace_ent; + missile.think = HomingMissileThink; + return ; + } + } + missile.think = HomingMissileAcquire; + missile.nextthink = (time + 0.100); + } +}; + +void (vector p1, vector p2, entity from, float damage) PlasmaDamage = { + local entity e1; + local entity e2; + local vector f; + + f = (p2 - p1); + normalize (f); + f_x = (FALSE - f_y); + f_y = f_x; + f_z = FALSE; + f = (f * FL_INWATER); + e2 = world; + e1 = world; + traceline (p1,p2,FALSE,self); + if ( trace_ent.takedamage ) { + particle (trace_endpos,'0.000 0.000 100.000',225.000,(damage * 4)); + T_Damage (trace_ent,from,from.owner,damage,DAMARMOR); + if ( (self.classname == "player") ) { + if ( (other.classname == "player") ) + trace_ent.velocity_z = (trace_ent.velocity_z + 400); + } + } + e1 = trace_ent; + traceline ((p1 + f),(p2 + f),FALSE,self); + if ( ((trace_ent != e1) && trace_ent.takedamage) ) { + particle (trace_endpos,'0.000 0.000 100.000',225.000,(damage * 4)); + T_Damage (trace_ent,from,from.owner,damage,DAMARMOR); + } + e2 = trace_ent; + traceline ((p1 - f),(p2 - f),FALSE,self); + if ( (((trace_ent != e1) && (trace_ent != e2)) && trace_ent.takedamage) ) { + particle (trace_endpos,'0.000 0.000 100.000',225.000,(damage * 4)); + T_Damage (trace_ent,from,from.owner,damage,DAMARMOR); + } +}; + +void (entity current, float doDamage) PlasmaDischarge = { + float dmg; + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST,current); + WriteCoord (MSG_BROADCAST,current.origin_x); + WriteCoord (MSG_BROADCAST,current.origin_y); + WriteCoord (MSG_BROADCAST,current.origin_z); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + sound (self,CHAN_VOICE,"weapons/lhit.wav",TRUE,ATTN_NORM); + if ( (doDamage == TRUE) ) { + if (self.owner.classtype == CT_MONGREMLIN) { + dmg = 20; + } else { + dmg = 50; + } + PlasmaDamage (self.origin,current.origin,self,dmg); + } +}; + +void () PlasmaGroundOut = { + local entity current; + local entity start; + local float monstersHit; + + monstersHit = FALSE; + current = findradius (self.origin,320.000); + start = current; + while ( (monstersHit < 5) ) { + if ( ((current.flags & FL_MONSTER) || (current.classname == "player")) ) { + if ( (current != self.owner) ) { + traceline (self.origin,current.origin,TRUE,world); + if ( (trace_fraction == TRUE) ) { + monstersHit = (monstersHit + TRUE); + PlasmaDischarge (current,TRUE); + } + } + } + current = current.chain; + if ( ((start == current) || !current) ) + return ; + } +}; + +void () PlasmaTouch = { + local float damg,raddmg; + + if ( (other == self.owner) ) + return ; + + if ( (pointcontents (self.origin) == CONTENT_SKY) ) { + remove (self); + return ; + } + damg = (80.000 + (random () * 20.000)); + raddmg = 70; + if (self.owner.classtype == CT_MONGREMLIN) { damg = damg * 0.5; raddmg = 35;} + sound (self,CHAN_WEAPON,"plasma/explode.wav",TRUE,ATTN_NORM); + if ( other.health ) { + T_Damage (other,self,self.owner,damg,DAMARMOR); + } + + + T_RadiusDamage (self,self.owner,raddmg,other,DAMAGEALL); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + WriteByte (MSG_BROADCAST,244.000); + WriteByte (MSG_BROADCAST,MOVETYPE_WALK); + PlasmaGroundOut (); + remove (self); +}; +//---------------------------------------------------------------------- + +void () s_firballexplode5 = [ 5.000, s_firballexplode6 ] {}; +void () s_firballexplode6 = [ 6.000, s_firballexplode7 ] {}; +void () s_firballexplode7 = [ 7.000, s_firballexplode8 ] {}; +void () s_firballexplode8 = [ 8.000, s_firballexplode9 ] {}; +void () s_firballexplode9 = [ 9.000, s_firballexplode10 ] {}; +void () s_firballexplode10 = [ 10.000, s_firballexplode11 ] {}; +void () s_firballexplode11 = [ 11.000, s_firballexplode12 ] {}; +void () s_firballexplode12 = [ 12.000, s_firballexplode13 ] {}; +void () s_firballexplode13 = [ 13.000, SUB_Remove ] {}; + +void () s_firespurtexplode1 = [ 1.000, s_firespurtexplode2 ] {}; +void () s_firespurtexplode2 = [ 2.000, s_firespurtexplode3 ] {}; +void () s_firespurtexplode3 = [ 3.000, s_firespurtexplode4 ] {}; +void () s_firespurtexplode4 = [ 4.000, s_firespurtexplode5 ] {}; +void () s_firespurtexplode5 = [ 5.000, s_firespurtexplode6 ] {}; +void () s_firespurtexplode6 = [ 6.000, s_firespurtexplode7 ] {}; +void () s_firespurtexplode7 = [ 7.000, s_firespurtexplode8 ] {}; +void () s_firespurtexplode8 = [ 8.000, s_firespurtexplode9 ] {}; +void () s_firespurtexplode9 = [ 9.000, s_firespurtexplode10 ] {}; +void () s_firespurtexplode10 = [ 10.000, s_firespurtexplode11 ] {}; +void () s_firespurtexplode11 = [ 11.000, s_firespurtexplode12 ] {}; +void () s_firespurtexplode12 = [ 12.000, s_firespurtexplode13 ] {}; +void () s_firespurtexplode13 = [ 13.000, SUB_Remove ] {}; + +void () BecomeFireSpurt = { + T_RadiusDamage (self,self.owner,40,world,DAMAGEALL); + self.touch = SUB_Null; + setmodel (self,"progs/medexp.spr"); + sound (self,CHAN_WEAPON,"pyro/fstop.wav",TRUE,ATTN_NORM); + s_firespurtexplode1(); +}; + +void () BecomeFireBall = { + T_RadiusDamage (self,self.owner,40,world,DAMAGEALL); + self.touch = SUB_Null; + setmodel (self,"progs/smlexp.spr"); + sound (self,CHAN_WEAPON,"pyro/fstop.wav",TRUE,ATTN_NORM); + s_firballexplode5(); +}; + +void () FireBallVerticalLaunch = { + local entity missile; + local float tempRand; + + missile = spawn (); + missile.owner = self.owner; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "Dragonfire"; + missile.v_angle = self.v_angle; + missile.v_angle_z = (missile.v_angle_z - 90); + makevectors (missile.v_angle); + missile.velocity = ((v_forward * 15) + (v_up * 160)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_forward)); + tempRand = ((crandom () * 40) - 20.000); + missile.velocity = (missile.velocity + (tempRand * v_right)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_up)); + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = BecomeFireBall; + missile.frame = 6; + setmodel (missile,"progs/smlexp.spr"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,self.origin); + missile.nextthink = ((time + TRUE) + (crandom () * 0.500)); + missile.think = BecomeFireBall; +}; + +void (float offsetAngle) FireBallSpurtLaunch = { + local entity missile; + local float tempRand; + + missile = spawn (); + missile.owner = self.owner; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "Dragonfire"; + missile.v_angle = self.v_angle; + missile.v_angle_y = (missile.v_angle_y + offsetAngle); + makevectors (missile.v_angle); + missile.velocity = ((v_forward * 150.000) + (v_up * 2.000)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_forward)); + tempRand = ((crandom () * 40) - 20.000); + missile.velocity = (missile.velocity + (tempRand * v_right)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_up)); + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = BecomeFireSpurt; + missile.frame = 6; + setmodel (missile,"progs/medexp.spr"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,self.origin); + missile.nextthink = ((time + TRUE) + (crandom () * 0.500)); + missile.think = BecomeFireSpurt; +}; + +void (float offsetAngle) MiniFireBallLaunch = { + local entity missile; + local float tempRand; + + missile = spawn (); + missile.owner = self.owner; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "Dragonfire"; + missile.v_angle = self.v_angle; + missile.v_angle_y = (missile.v_angle_y + offsetAngle); + makevectors (missile.v_angle); + missile.velocity = ((v_forward * 100.000) + (v_up * 40)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_forward)); + tempRand = ((crandom () * 40) - 20.000); + missile.velocity = (missile.velocity + (tempRand * v_right)); + tempRand = ((crandom () * 60.000) - 30); + missile.velocity = (missile.velocity + (tempRand * v_up)); + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = BecomeFireBall; + missile.frame = 6; + setmodel (missile,"progs/smlexp.spr"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,self.origin); + missile.nextthink = ((time + TRUE) + (crandom () * 0.500)); + missile.think = BecomeFireBall; +}; + +void () DragonFire_Touch = { + + if (pointcontents(self.origin) == CONTENT_SKY) { + remove(self); + return; + } + if (other.takedamage) + T_Damage (other,self,self.owner,12,DAMARMOR); + + BecomeFireBall(); +}; + +void () DragonFireExplode = { + if (self.ammo_rockets > FALSE) { + T_RadiusDamage (self,self.owner,50,world,DAMAGEALL); + if (self.ammo_rockets == 6) + self.frame = 6; + + if (self.ammo_rockets == 4) + self.frame = 7; + + if (self.ammo_rockets == 3) + self.frame = 8; + + if (self.ammo_rockets == 2) + self.frame = 9; + + self.ammo_rockets = (self.ammo_rockets - TRUE); + self.think = DragonFireExplode; + self.nextthink = (time + 0.250); + } else { + //MiniFireBallLaunch (FALSE); + //MiniFireBallLaunch (72); + //MiniFireBallLaunch (144); + //MiniFireBallLaunch (216); + //MiniFireBallLaunch (288); + //FireBallSpurtLaunch (35); + //FireBallSpurtLaunch (100); + //FireBallSpurtLaunch (192); + //FireBallSpurtLaunch (240); + //FireBallSpurtLaunch (315); + //FireBallVerticalLaunch(); + BecomeFireBall(); + } +}; + +void () Fire_DragonFire = { + self.ammo_rockets = (self.ammo_rockets - TRUE); // REMOVE + self.currentammo = (self.currentammo - TRUE); // REMOVE // REMOVE + sound (self,CHAN_WEAPON,"pyro/flame.wav",TRUE,ATTN_NORM); + newmis = spawn(); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.classname = "Dragonfire"; + newmis.solid = SOLID_NOT; + setmodel (newmis,"progs/smlexp.spr"); + setsize (newmis,VEC_ORIGIN,VEC_ORIGIN); + setorigin (newmis,self.origin); + newmis.frame = 5; + self.punchangle_x = CONTENT_SOLID; + makevectors (self.v_angle); + if ( self.v_angle_x ) { + newmis.velocity = (((v_forward * 600.000) + ((crandom () * v_right) * 10)) + ((crandom () * v_up) * 10)); + } else { + newmis.velocity = aim (self,10000.000); + newmis.velocity = (newmis.velocity * 600.000); + newmis.velocity_z = 200.000; + } + newmis.avelocity = '300.000 300.000 300.000'; + newmis.effects = EF_DIMLIGHT; + newmis.angles = vectoangles (newmis.velocity); + newmis.ammo_rockets = 10; + newmis.touch = DragonFire_Touch; + newmis.nextthink = (time + 0.50); + newmis.think = DragonFireExplode; +}; + +//########################################### +//#### PHASED PLASMA CANNON (BEAM WEAPON) ### +//########################################### +// been tones down so that it doesn't require +// as much stuff as the original did. + +void() beamhit1 = [0, beamhit2] {}; +void() beamhit2 = [1, beamhit3] {}; +void() beamhit3 = [2, beamhit4] {}; +void() beamhit4 = [3, beamhit5] {}; +void() beamhit5 = [4, SUB_Remove] {}; + +void() BecomeBeamHit = +{ + self.movetype = MOVETYPE_NONE; + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel (self, "progs/beamhit.spr"); + self.solid = SOLID_NOT; + beamhit1 (); +}; + +void() beamring1 = [1, beamring2] {self.nextthink = time + 0.05;}; +void() beamring2 = [2, beamring3] {self.nextthink = time + 0.05;}; +void() beamring3 = [4, beamring4] {self.nextthink = time + 0.05;}; +void() beamring4 = [6, beamring5] {self.nextthink = time + 0.05;}; +void() beamring5 = [8, beamring6] {self.nextthink = time + 0.05;}; +void() beamring6 = [10, beamring7] {self.nextthink = time + 0.05;}; +void() beamring7 = [12, beamring8] {self.nextthink = time + 0.05;}; +void() beamring8 = [14, beamring9] {self.nextthink = time + 0.05;}; +void() beamring9 = [16, SUB_Remove] {self.nextthink = time + 0.05;}; + +void() d_beamring1 = [2, d_beamring2] {}; +void() d_beamring2 = [4, d_beamring3] {}; +void() d_beamring3 = [8, d_beamring4] {}; +void() d_beamring4 = [12, d_beamring5] {}; +void() d_beamring5 = [16, SUB_Remove] {}; + +void(vector ringorg) MakeBeamRing = +{ + local entity ringent; + + ringent = spawn(); + ringent.movetype = MOVETYPE_NONE; + setmodel (ringent, "progs/custents/dring.spr"); + ringent.solid = SOLID_NOT; + setorigin(ringent, ringorg); + ringent.angles = '90 0 0'; + ringent.frame = 0; + if(deathmatch) + ringent.think = d_beamring1; + else + { + ringent.nextthink = time + 0.05; + ringent.think = beamring1; + } + + ringent = spawn(); + ringent.movetype = MOVETYPE_NONE; + setmodel (ringent, "progs/custents/dring.spr"); + ringent.solid = SOLID_NOT; + setorigin(ringent, ringorg); + ringent.angles = '-90 0 0'; + ringent.frame = 0; + if(deathmatch) + ringent.think = d_beamring1; + else + { + ringent.nextthink = time + 0.05; + ringent.think = beamring1; + } +}; + +void() beam_touch = +{ + local float totaldmg; + + if (other == self.owner) + return; + + if (other.solid == SOLID_TRIGGER) + return; // trigger field, do nothing + + if (pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + +// hit something that bleeds + if (other.takedamage) + { + totaldmg = self.currentammo * 1.25; + totaldmg = ceil(totaldmg); + // totally decimate the dude if doesn't have enough health + if(other.health <= totaldmg) + { + T_Damage (other, self, self.owner, 99999,DAMARMOR); + if(other.health <= 0) + { + MakeBeamRing(other.origin); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord (MSG_BROADCAST, other.origin_x); + WriteCoord (MSG_BROADCAST, other.origin_y); + WriteCoord (MSG_BROADCAST, other.origin_z); + + remove(self); + return; + } + } + else + T_Damage (other, self, self.owner, totaldmg,DAMARMOR); + } + + sound (self, CHAN_ITEM, "turret/beamhit.wav", 1, ATTN_NORM); + BecomeBeamHit(); +}; + +void(float burstcharge) beam_water_burst= +{ + local entity current; + local float totaldmg; + local vector destvec; + + current = world; + + sound (self, CHAN_WEAPON, "hipweap/mjolhit.wav", 1, ATTN_NORM); + do + { + current = nextent(current); + + if (current.takedamage) + { +// destvec = current.origin + (current.mins + current.maxs)*0.5; + destvec = current.origin; + traceline(self.origin, destvec, TRUE, self); + if(trace_fraction == 1 && current.waterlevel > 0) + { + totaldmg = vlen(self.origin - destvec) * 0.3; + totaldmg = burstcharge * burstcharge / totaldmg; + // check to see if the thing gets killed + if(current.health <= totaldmg) + { + T_Damage (current, self, self, 99999,DAMARMOR); + if(other.health <= 0) + { + MakeBeamRing(other.origin); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord (MSG_BROADCAST, other.origin_x); + WriteCoord (MSG_BROADCAST, other.origin_y); + WriteCoord (MSG_BROADCAST, other.origin_z); + } + } + else + T_Damage (current, self, self, totaldmg,DAMARMOR); + } + } + } while(current); +}; + +void() beam_generate= +{ + local entity beamseg; + + beamseg = spawn (); + beamseg.owner = self.owner; + beamseg.solid = SOLID_BBOX; + setmodel (beamseg, "progs/custents/beam.mdl"); + setsize (beamseg, '0 0 0', '0 0 0'); + makevectors(self.owner.v_angle); + if(self.owner.flags & FL_CLIENT) + { + self.owner.attack_finished = time + 0.5; + setorigin (beamseg, self.owner.origin + v_forward*12 + self.owner.dest2); + beamseg.velocity = aim(self.owner, 800) * 800; + } + else if(self.owner.flags & FL_MONSTER) + { + setorigin (beamseg, self.owner.origin); + beamseg.velocity = normalize(self.owner.enemy.origin - self.owner.origin) * 800; + } + else + { + setorigin (beamseg, self.owner.origin); + beamseg.velocity = self.owner.movedir * 800; + } + + beamseg.angles = vectoangles(beamseg.velocity); + beamseg.speed = 800; + beamseg.classname = "beam"; + beamseg.movetype = MOVETYPE_FLYMISSILE; + beamseg.currentammo = self.currentammo; + beamseg.touch = beam_touch; + beamseg.think = SUB_Remove; + beamseg.nextthink = time + 6; + + sound (self.owner, CHAN_WEAPON, "weapons/lstart.wav", 1, ATTN_NORM); + self.currentammo = self.currentammo / 2; + + if((self.owner.flags & FL_CLIENT) && self.deadflag == DEAD_NO) { + self.owner.punchangle_x = -6; + self.owner.velocity = self.velocity - v_forward * self.currentammo * 2; + } + + if(self.currentammo < 1) + remove(self); + + self.nextthink = time + 0.05; +}; + +void() W_FireBeam = { + // explode if under water + if (self.waterlevel > 1) { + beam_water_burst(self.ammo_cells*2); + self.currentammo = self.ammo_cells = 0; + return; + } + + newmis = spawn(); + newmis.solid = SOLID_NOT; + newmis.movetype = MOVETYPE_FLY; + // amount of damage done is based on how much cell ammo you've got + newmis.currentammo = self.currentammo; + setorigin(newmis, self.origin); + newmis.owner = self; + newmis.think = beam_generate; + newmis.nextthink = time + 0.05; + + // like the damage, the ammo used is according to how much you've got + self.currentammo = self.ammo_cells = floor(self.ammo_cells * 0.75); +}; + +void() Laser2_Touch = + { + + local vector org; + + + +if (other == self.owner) + + return; // don't explode on owner + + + + if (pointcontents(self.origin) == CONTENT_SKY) + { + + remove(self); + + return; + + } + + +sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + + org = self.origin - 8*normalize(self.velocity); + + + if (other.health) +{ + + SpawnBlood (self.enemy, org,v_forward, 9); + + T_Damage (other, self, self.owner, 9, DAMARMOR); + + } + + remove(self); + +}; diff --git a/QC_other/QC_keep/pushable.qc b/QC_other/QC_keep/pushable.qc new file mode 100644 index 00000000..753610bc --- /dev/null +++ b/QC_other/QC_keep/pushable.qc @@ -0,0 +1,575 @@ +/*====================================================================== + Pushables bmodels + + * Looked at the code from Hipnotic Interactive (hip_push.qc) + - It uses a proxy entity for the player to interact with + - Movement is done by constantly updating origin + - Code seems really experimental and a horrible mess + + * Looked at the code from the Nehara mod (push.qc) + - It uses the original bmodel entity with velocity instead + - Has one push sound type and moves XY directions + + * AD solution is inspired by Nehara code + - It uses the original bmodel and velocity movement + - Switches movetype/solid so players can stand on top + - Fades the bmodel (via alpha) so it does not block view + - Works with entity state system, reset very useful if stuck + - Works really close with breakables (target2 triggers) + +======================================================================*/ +float PUSH_DAMAGE = 2; // Can receive damage (from anything) +float PUSH_NOFLRCHECK = 8; // No floor below check for movement +float PUSH_FLOATING = 16; // Start floating on spawn (like items) +float PUSH_NOMONSTER = 32; // Cannot be damaged by monsters + +// Pushable sound/impact types +float PTYPE_ROCK = 1; // Default rock +float PTYPE_WOOD = 2; +float PTYPE_GLASS = 3; +float PTYPE_METAL = 4; +float PTYPE_BRICK = 5; +float PTYPE_CUSTOM = 10; // Custom push sounds + +// Three sounds to randomly pick from 0.5s each +string SOUND_PUSH_ROCK1 = "pushable/rock_m1.wav"; +string SOUND_PUSH_ROCK2 = "pushable/rock_m2.wav"; +string SOUND_PUSH_ROCK3 = "pushable/rock_m3.wav"; +string SOUND_PUSH_WOOD1 = "pushable/wood_m1.wav"; +string SOUND_PUSH_WOOD2 = "pushable/wood_m2.wav"; +string SOUND_PUSH_WOOD3 = "pushable/wood_m3.wav"; +string SOUND_PUSH_GLASS1 = "pushable/glass_m1.wav"; +string SOUND_PUSH_GLASS2 = "pushable/glass_m2.wav"; +string SOUND_PUSH_GLASS3 = "pushable/glass_m3.wav"; +string SOUND_PUSH_METAL1 = "pushable/metal_m1.wav"; +string SOUND_PUSH_METAL2 = "pushable/metal_m2.wav"; +string SOUND_PUSH_METAL3 = "pushable/metal_m3.wav"; +string SOUND_PUSH_BRICK1 = "pushable/brick_m1.wav"; +string SOUND_PUSH_BRICK2 = "pushable/brick_m2.wav"; +string SOUND_PUSH_BRICK3 = "pushable/brick_m3.wav"; + +// Which touch state (used for fading) +float STATE_PUSH = 1; +float STATE_SOLID = 2; + +//====================================================================== +/*QUAKED func_pushable (0 .5 .8) ? x DAMAGE x NOFLRCHECK FLOATING NOMONSTER STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Moveable brushwork (pushable) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +style : sound move/impact types - 1=rock, 2=wood, 3=glass, 4=metal, 5=brick, 10=custom +noise1 : Custom move sound 1 (style=10) +noise2 : Custom move sound 2 +noise3 : Custom move sound 3 +bleedcolour: Impact particle colour (starting point on palette) +target : target(s) to fire when pushable is dead (once only) +deathtarget: target(s) to fire when pushable is dead (once only) +target2 : points to a func_breakable_spawner to trigger on death +message : Message to display when killed by player +message2 : Message to display when touched by player +wait : Time for showing touch/death message (=-1 once, def=2) +health : damage taken before death +death_dmg : will explode on death (reqs health) +speed : pushing speed (def = 1) +waitmin : length of pushable sounds (def=0.5s) +waitmin2 : Alpha value to fade block down to when pushing +-------- SPAWNFLAGS -------- +DAMAGE : Pushable can be damaged or destroyed +NOFLRCHECK: No floor below check for extra velocity +FLOATING : Pushable starts off floating (until touched) +NOMONSTER : Cannot be damaged by monsters +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Moveable brushwork (pushable) +*/ +//====================================================================== + +//---------------------------------------------------------------------- +void() func_pushable_push = +{ + self.movetype = MOVETYPE_STEP; // Default monster move type + self.solid = SOLID_SLIDEBOX; // Discrete movement stepping + self.state = STATE_PUSH; // Can be moved by player +}; + +//---------------------------------------------------------------------- +void() func_pushable_solid = +{ + self.movetype = MOVETYPE_PUSH; // Blocks projectiles + self.solid = SOLID_BSP; // Square bounding box + self.state = STATE_SOLID; // No world interaction + self.inpain = FALSE; // Reset touch flag +}; + +//---------------------------------------------------------------------- +void() func_pushable_movement = +{ + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Block movement if nothing has changed + if (self.oldorigin == self.origin && !self.inpain) return; + self.oldorigin = self.origin; + // Reset touch function flag + self.inpain = FALSE; + + // Check for moving sound + if (self.attack_finished < time && self.state == STATE_PUSH) { + // Random start to setup blending and overlap + self.attack_finished = time + self.waitmin + (random()*self.waitmin); + // Make sure sound WAVs don't repeat in a row + self.lefty = self.meleeattack; + while (self.lefty == self.meleeattack) { + self.lefty = rint(random()*3); + } + // CHAN_AUTO to allow for sound blending + self.meleeattack = self.lefty; + if (self.meleeattack == 1) + sound (self, CHAN_AUTO, self.noise1, 1, ATTN_NORM); + else if (self.meleeattack == 2) + sound (self, CHAN_AUTO, self.noise2, 1, ATTN_NORM); + else sound (self, CHAN_AUTO, self.noise3, 1, ATTN_NORM); + } + + // Remove onground flag so bmodel can move + self.flags = self.flags - (self.flags & FL_ONGROUND); + + // Transfer velocity from player to pushable + // Read velocity from saved touch entity + self.velocity_x = self.finaldest_x * self.speed; + self.velocity_y = self.finaldest_y * self.speed; + + // Enable floor below check? + if (!(self.spawnflags & PUSH_NOFLRCHECK)) { + // Work out push direction + makevectors(self.finalangle); + self.movedir = normalize(v_forward); + self.movedir_z = 0; + + // Work out true min/max for bmodel using origin (offset) + self.bbmins = self.origin + self.mins; + self.bbmaxs = self.origin + self.maxs; + + // Find the middle of the bottom edge + self.move_state = self.bbmins; + self.move_state_x = self.move_state_x + (self.size_x*0.5); + self.move_state_y = self.move_state_y + (self.size_y*0.5); + + // Trace down and see if anything is underneath it + traceline(self.move_state, self.move_state+'0 0 -1024', FALSE, self); + // Work out length of traceline downward + self.t_length = fabs(trace_endpos_z - self.move_state_z); + + // Is there space below middle point? + if (self.t_length > 0) { + // Keep velocity active while ground is missing + self.velocity = self.velocity + (self.movedir*self.t_width); + // Keep looping around until on ground + self.think = func_pushable_movement; + self.nextthink = time + 0.05; + } + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_touch = +{ + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Allow for pushables to stack + if (other.classtype == CT_FUNCPUSHABLE && other.state == STATE_PUSH) { + // Switch to solid block + func_pushable_solid(); + return; + } + + // Only works for the player + if ( !(other.flags & FL_CLIENT) ) return; + + // Touch function is active + self.inpain = TRUE; + + // Keep updating touch condition for fade controller + // Create an overlap for the touch to stop working + self.pain_finished = time + 0.5; + + // Check for a touch message + if (self.message2 != "" && self.idletimer < time) { + if (self.wait > 0) self.idletimer = time + self.wait; + centerprint(other, self.message2); + if (self.wait < 0) self.message2 = ""; + } + + // Slow down the detection of the touching object + // + // This is not an ideal solution, its a horrible hack! + // The touching entity should be consistent with its Z axis + // origin if the entity is not moving up or down. + // For some reason the Z axis is inconsistent +/- 18 units + // Cannot slowdown the touch function because the movement + // of the pushable stutters and looks terrible. + // Touch functions cycle at really high frame rates so + // its easier to slowdown the reading the entity instead! + // + if (self.oldenemy != other || self.meleetimer < time) { + // Save player details for later + self.oldenemy = other; + self.dest1 = self.oldenemy.origin; + self.dest2 = self.oldenemy.view_ofs; + // Slowdown the reading of the touching entity + self.meleetimer = time + 0.01; + } + + self.finalangle = self.oldenemy.angles; + self.finaldest = self.oldenemy.velocity; + + // Setup origin of player (at feet level) + self.pos3 = self.dest1 - self.dest2; + + // Work out true min/max for bmodel using origin (offset) + self.bbmins = self.origin + self.mins; + self.bbmaxs = self.origin + self.maxs; + + // Check if player is above/below pushable + if (self.pos3_z >= self.bbmaxs_z) + func_pushable_solid(); // Stop the bmodel interacting with player + else { + func_pushable_push(); // bmodel can be moved (again) + func_pushable_movement(); // Move the pushable block + } +}; + +//---------------------------------------------------------------------- +void(entity inflictor, entity attacker, float damage) func_pushable_pain = +{ + local float loop_count; + local vector vel; + + // default = Pushables cannot die + if (!(self.spawnflags & PUSH_DAMAGE)) {self.health = MEGADEATH; return;} + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Something is trying to wear down the pushable with damage + // work out facing angle and project particles upward + makevectors(inflictor.angles); + vel = -v_up*2; + while(loop_count < 4) { + particle (inflictor.origin, vel*0.1, self.bleedcolour + rint(random()*7), damage); + loop_count = loop_count + 1; + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_death = +{ + // default = Pushables cannot die + if (!(self.spawnflags & PUSH_DAMAGE)) {self.health = MEGADEATH; return;} + // Block entity state exceptions + if (self.estate & ESTATE_BLOCK) return; + + // Work out current bmodel origin + self.oldorigin = bmodel_origin(self); + + // Check for breakable spawners + if (self.target2 != "") { + self.enemy = find (world, targetname, self.target2); + // Make sure its a breakable spawner ONLY! + if (self.enemy.classtype == CT_FUNCBREAKSPN) { + // Copy over pushable bmodel origin and volume to breakable + self.enemy.origin = self.oldorigin; + setorigin(self.enemy, self.enemy.origin); + self.enemy.brkvol = self.size; + // Use entity which killed pushable for breakable direction + trigger_ent(self.enemy, self.activate); + } + } + + // Check for explosion sprite/particle effect + if (self.death_dmg > 0) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.oldorigin_x); + WriteCoord (MSG_BROADCAST, self.oldorigin_y); + WriteCoord (MSG_BROADCAST, self.oldorigin_z); + + SpawnExplosion(EXPLODE_SMALL, self.oldorigin, SOUND_REXP3); + T_RadiusDamage (self, self, self.death_dmg, world, DAMAGEALL); + } + + // Fire death targets (check DT first, because target can have uses) + if (self.deathtarget != "") trigger_strs(self.deathtarget, self.activate); + if (self.target != "") trigger_strs(self.target, self.activate); + + // Any final words ... + if (self.activate.flags & FL_CLIENT && self.message != "") + centerprint (self.activate, self.message); + + // Fire once condition? + if (self.wait < 0) { + self.target = self.deathtarget = self.message = ""; + } + + // Check for any pushable above? (fake physics) + self.move_state = bmodel_origin(self); + + // Trace up and see if anything is above + traceline(self.move_state, self.move_state + '0 0 1024', FALSE, self); + + // Check for a pushable entity above (but not touching) + if (trace_ent != self && trace_ent.classtype == CT_FUNCPUSHABLE) + trigger_ent(trace_ent, self); + + // Switch off entity instead of hide/remove + // So the pushable can be reset again + self.estate_off(); +}; + +//====================================================================== +// The pushable needs a controller to reach to the touch function +// and to reset the alpha fade if the pushable is not being touched +//====================================================================== +void() pushable_controller_think = +{ + // Keep the controller alive + self.think = pushable_controller_think; + self.nextthink = time + 0.1; + + // Block entity state exceptions + if (self.owner.estate & ESTATE_BLOCK) return; + + // Check if the player is touching the pushable? + // If the player is standing on the block, no alpha + if (self.owner.pain_finished > time && self.owner.state == STATE_PUSH) { + // Is the alpha set the right amount? + if (self.owner.alpha > self.owner.waitmin2) { + self.owner.alpha = self.owner.alpha - 0.01; + self.nextthink = time + FADEMODEL_TIME; + } + } + else { + if (self.owner.alpha < 1.00) { + self.owner.alpha = self.owner.alpha + 0.01; + self.nextthink = time + FADEMODEL_TIME; + } + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_controller_setup = +{ + // Check if controller entity been setup + if (!self.attachment) self.attachment = spawn(); + + // Setup link back to pushable + self.attachment.owner = self; + self.attachment.classtype = CT_CONTROL; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + // Move to pushable bmodel origin location + self.attachment.origin = bmodel_origin(self); + setorigin(self.attachment, self.attachment.origin); + setsize (self.attachment, VEC_ORIGIN, VEC_ORIGIN); + + // Start fade controller think loop + self.attachment.think = pushable_controller_think; + self.attachment.nextthink = time + 0.1; +}; + +//====================================================================== +// Entity state functions +//====================================================================== +void() func_pushable_use = +{ + // Switch on pushable first + if (self.estate == ESTATE_OFF) entity_state_on(); + else { + // Let the pushable move around + func_pushable_push(); + self.flags = self.flags - (self.flags & FL_ONGROUND); + // Push upward using size as force + self.velocity_z = self.t_width; + } +}; + +//---------------------------------------------------------------------- +void() func_pushable_reset = +{ + // If the block starts off(disabled) then do nothing + if (self.spawnflags & ENT_STARTOFF) return; + + // reset to original position + setorigin(self, VEC_ORIGIN); + // Make sure the bmodel drops down, no weird ofset + self.velocity = self.avelocity = '0 0 0'; + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() func_pushable_off = +{ + // Do nothing if pushable is already off + if (self.estate == ESTATE_OFF) return; + + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + // Switch off impact particles + self.takedamage = DAMAGE_NO; +}; + +//---------------------------------------------------------------------- +void() func_pushable_on = +{ + // Do nothing if pushable is already on + if (self.estate == ESTATE_ON) return; + + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + func_pushable_push(); + setmodel (self, self.mdl); + + // Setup touch fade controller + if (!self.attachment) func_pushable_controller_setup(); + + // Switch on impact particles + self.takedamage = DAMAGE_AIM; + // Reset health to spawn + self.health = self.max_health; + + if (!(self.spawnflags & PUSH_FLOATING)) { + // Make sure it drops to ground on spawn + self.origin_z = self.origin_z + 4; + self.flags = self.flags - (self.flags & FL_ONGROUND); + } + else func_pushable_solid(); +}; + +//====================================================================== +// Main entity definition +//====================================================================== +void() func_pushable = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + //------------------------------------------------------------------ + // make sure initial break sound is within range types (def=rock) + if (self.style < PTYPE_ROCK || self.style > PTYPE_CUSTOM) + self.style = PTYPE_ROCK; + + // Medium drag sound with light brown impact particles + if (self.style == PTYPE_WOOD) { + self.noise1 = SOUND_PUSH_WOOD1; + self.noise2 = SOUND_PUSH_WOOD2; + self.noise3 = SOUND_PUSH_WOOD3; + if (self.bleedcolour <= 0) self.bleedcolour = 112; + } + // Light drag sound with light yellow impact particles + else if (self.style == PTYPE_GLASS) { + self.noise1 = SOUND_PUSH_GLASS1; + self.noise2 = SOUND_PUSH_GLASS2; + self.noise3 = SOUND_PUSH_GLASS3; + if (self.bleedcolour <= 0) self.bleedcolour = 96; + } + // Medium drag sound with green/brown impact particles + else if (self.style == PTYPE_METAL) { + self.noise1 = SOUND_PUSH_METAL1; + self.noise2 = SOUND_PUSH_METAL2; + self.noise3 = SOUND_PUSH_METAL3; + if (self.bleedcolour <= 0) self.bleedcolour = 80; + } + // Light drag sound with brown impact particles + else if (self.style == PTYPE_BRICK) { + self.noise1 = SOUND_PUSH_BRICK1; + self.noise2 = SOUND_PUSH_BRICK2; + self.noise3 = SOUND_PUSH_BRICK3; + if (self.bleedcolour <= 0) self.bleedcolour = 80; + } + // Custom sounds with white/grey impact particles + else if (self.style == PTYPE_CUSTOM) { + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + if (self.bleedcolour <= 0) self.bleedcolour = 1; + } + // *** DEFAULT *** + // Heavy drag sound with brown impact particles + else { + self.noise1 = SOUND_PUSH_ROCK1; + self.noise2 = SOUND_PUSH_ROCK2; + self.noise3 = SOUND_PUSH_ROCK3; + if (self.bleedcolour <= 0) self.bleedcolour = 80; + } + + // Cache all sounds + precache_sound (self.noise1); + precache_sound (self.noise2); + precache_sound (self.noise3); + + self.classtype = CT_FUNCPUSHABLE; + self.classgroup = CG_BREAKABLE; + self.bsporigin = TRUE; + self.mdl = self.model; + + // Save starting position and reset angles + self.mangle = self.angles; + self.angles = '0 0 0'; + + // Default parameters and states + if (!self.speed) self.speed = 1; + if (!self.wait) self.wait = 2; + + // Length of dragging sounds + if (!self.waitmin) self.waitmin = 0.5; + // Create halway point for random start + self.waitmin = self.waitmin * 0.5; + // Start with pushing state + self.state = STATE_PUSH; + self.pain_finished = -1; + // Setup default alpha fade (lower) value + if (!self.waitmin2) self.waitmin2 = 0.6; + self.alpha = 1; + + // setup pain/die functions + self.th_pain = func_pushable_pain; + self.th_die = func_pushable_death; + + // The pushable needs to take damage for impact sounds + // to work correctly. Check for health default first + // Pain/death needs to reset health if indestructible + if (self.health <= 0) { + if (self.spawnflags & PUSH_DAMAGE) self.health = 1; + else self.health = MEGADEATH; + } + self.max_health = self.health; + + // Setup the bmodel ready for interaction + func_pushable_solid(); + setmodel(self, self.mdl); + setorigin(self, VEC_ORIGIN); + setsize(self, self.mins, self.maxs); + + // Work out average size of block + self.t_width = rint((self.size_x + self.size_y) * 0.5); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + self.use = entity_state_use; + self.estate_use = func_pushable_use; + self.estate_on = func_pushable_on; + self.estate_off = func_pushable_off; + self.estate_reset = func_pushable_reset; + self.touch = func_pushable_touch; + + // Setup pushable in correct state + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; diff --git a/QC_other/QC_keep/qc_highlight.xml b/QC_other/QC_keep/qc_highlight.xml new file mode 100644 index 00000000..56ed8478 --- /dev/null +++ b/QC_other/QC_keep/qc_highlight.xml @@ -0,0 +1,64 @@ +<NotepadPlus> + <UserLang name="QuakeC" ext="qc" udlVersion="2.1"> + <Settings> + <Global caseIgnored="no" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> + <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> + </Settings> + <KeywordLists> + <Keywords name="Comments">03/* 03/** 04*/ 04*/ 00// 01 02</Keywords> + <Keywords name="Numbers, prefix1"></Keywords> + <Keywords name="Numbers, prefix2"></Keywords> + <Keywords name="Numbers, extras1"></Keywords> + <Keywords name="Numbers, extras2"></Keywords> + <Keywords name="Numbers, suffix1"></Keywords> + <Keywords name="Numbers, suffix2"></Keywords> + <Keywords name="Numbers, range"></Keywords> + <Keywords name="Operators1">( ) [ ] . , ; + - = / * & && | ||</Keywords> + <Keywords name="Operators2"></Keywords> + <Keywords name="Folders in code1, open">{</Keywords> + <Keywords name="Folders in code1, middle"></Keywords> + <Keywords name="Folders in code1, close">}</Keywords> + <Keywords name="Folders in code2, open"></Keywords> + <Keywords name="Folders in code2, middle"></Keywords> + <Keywords name="Folders in code2, close"></Keywords> + <Keywords name="Folders in comment, open"></Keywords> + <Keywords name="Folders in comment, middle"></Keywords> + <Keywords name="Folders in comment, close"></Keywords> + <Keywords name="Keywords1">switch case default if else return do while</Keywords> + <Keywords name="Keywords2">local vector float string void entity nosave</Keywords> + <Keywords name="Keywords3">false true self other world time v_forward v_up v_right frametime force_retouch mapname deathmatch coop teamplay serverflags total_secrets total_monsters found_secrets killed_monsters parm1 parm2 parm3 parm4 parm5 parm6 parm7 parm8 parm9 parm10 parm11 parm12 parm13 parm14 parm15 parm16 trace_allsolid trace_startsolid trace_fraction trace_endpos trace_plane_normal trace_plane_dist trace_ent trace_inopen trace_inwater msg_entity end_sys_globals</Keywords> + <Keywords name="Keywords4">makevectors setorigin setmodel setsize break random sound normalize error objerror vlen vectoyaw spawn remove traceline checkclient find precache_sound precache_model stuffcmd findradius bprint sprint dprint eprint ftos vtos coredump traceon traceoff walkmove droptofloor lightstyle rint floor ceil checkbottom pointcontents fabs aim cvar localcmd nextent particle ChangeYaw vectoangles WriteByte WriteChar WriteShort WriteLong WriteCoord WriteAngle WriteString WriteEntity movetogoal precache_file makestatic changelevel cvar_set centerprint centerprint2 centerprint3 centerprint4 centerprint5 ambientsound precache_model2 precache_sound2 precache_file2 setspawnparms</Keywords> + <Keywords name="Keywords5"></Keywords> + <Keywords name="Keywords6"></Keywords> + <Keywords name="Keywords7"></Keywords> + <Keywords name="Keywords8"></Keywords> + <Keywords name="Delimiters">00" 01 02" 03' 04 05' 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords> + </KeywordLists> + <Styles> + <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="COMMENTS" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="LINE COMMENTS" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="KEYWORDS1" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /> + <WordsStyle name="KEYWORDS2" fgColor="0080FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="KEYWORDS3" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /> + <WordsStyle name="KEYWORDS4" fgColor="800080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /> + <WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /> + <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /> + <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS1" fgColor="A00000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS2" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS3" fgColor="A00000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /> + </Styles> + </UserLang> +</NotepadPlus> \ No newline at end of file diff --git a/QC_other/QC_keep/qrobot.qc b/QC_other/QC_keep/qrobot.qc new file mode 100644 index 00000000..55a97ccb --- /dev/null +++ b/QC_other/QC_keep/qrobot.qc @@ -0,0 +1,1252 @@ +// QMASTER'S QROBOT.QC +//============================================================ +// This is a qoordinate axis robot with programmable points. +// In other words, you specify the points in space that you +// want the robot to move to, up to 50 points but not less +// than 2 points. Syncronization with multiple robots is +// achieved through target-targetname system using synctarg#'s +// where # is the current point the robot is on. More than two +// syncing robots is possible with the func_robot_controller. +// (the controller is really a super trigger_counter that handles +// multiple targetnames, those of the robots targetting it) +// +// You can also specify the duration it will take to get to +// the next point, and the wait time at that point. +// +// Points are relative to the robots current position in space. +// This means that point1 must be the (starting position - the +// last position). This might be confusing, but allows you to +// move the robot freely without worrying about having to +// change the points as you would in an absolute coordinate +// system. +// +// Reason for Existance: +// See awesome usage in my map: Subterranean Mine (engine1.bsp) +// via www.quaddicted.com or celephais.net on Func_msgboard. +// This file is included in that package under the directory \source +// along with a test example map which just so happens to be my +// effects test box for Subterranean Mine +// +// It is my hope that this will be a much more useful func_train +// replacement. This offers the advantage that at sync points +// robots will wait indefinitely until it's mate (which might be +// blocked) arrives at it's corresponding sync point and targets +// the controller that targets both robots. This means that you can +// adjust the wait times at each point and the duration times of +// travel without ever worrying about timing to meet up with another +// robot. Perfect harmony every time! +// +// +// This program brought to you by the letter Q +// and the company Quake Automation Inc, all rights unreserved 1996 (C) +// but not really (C). +// +// Legal: Do whatever you want with this. Please credit me, Qmaster, +// aka W. Josiah Jack, but you don't have to. +// +// +// +// Parameters: +//--------------------- +//.point# vector for next point in space to move to (point1 thru point50) +//.duration# float for time it will take to reach the next point in space (duration1 thru duration50) +//.waitpoint# float for time to wait at the next point in space (waitpoint1 thru waitpoint50) +//.syncpoint# float (TRUE || FALSE) used to set .syncronize value +// I could have just used synctarg# but this lets you test with it on or off like real robots +//.poindex float value for the next point (1-50) +//.syncronize float (TRUE || FALSE) for whether or not to wait for input from other robot once at point +//.synctarg# string for robot to sync with, works like target and allows seemless brush travel for infinite loops +//.syncerbot string for holding the current robot name to sync with +//.curpoint vector for current point to travel to (not there yet) +//.oldcurpoint vector for current point (where we are, or where we were before we started moving) +//.homepoint vector for the starting home point to home it out or determine starting point from initial poindex +//.wait float for initial wait period before moving after triggered or after map spawn, if you want it to wait +//.syncent# entity for holding targets for func_robot_controller (up to 20 robots) +// +//============================================================ +void() robot_thinkgo; +void() robot_use_turnoff; + +void(vector tdest, float ttime, void() func) robot_move= { + local vector vdestdelta; + + self.think1 = func; + self.finaldest = tdest; + self.think = SUB_CalcMoveDone; + + if (tdest == self.origin) { + self.velocity = VEC_ORIGIN; + self.think(); + return; + } + + vdestdelta = tdest - self.origin; + self.nextthink = self.ltime + ttime; + self.velocity = vdestdelta * (1/ttime); // velocity = d * 1/t = d/t but qcc won't take vector/float +}; + +vector(float index) robot_getpoint = { + // I wish I had arrays and switch case statments :( + self.syncerbot = string_null; + + if (index == 1) { + if (self.waitpoint1) + self.wait = self.waitpoint1; + + if (self.duration1) + self.duration = self.duration1; + + if (self.synctarg1) + self.syncerbot = self.synctarg1; + + return self.point1; + } + if (index == 2) { + if (self.waitpoint2) + self.wait = self.waitpoint2; + + if (self.duration2) + self.duration = self.duration2; + + if (self.synctarg2) + self.syncerbot = self.synctarg2; + + return self.point2; + } + if (index == 3) { + if (self.waitpoint3) + self.wait = self.waitpoint3; + + if (self.duration3) + self.duration = self.duration3; + + if (self.synctarg3) + self.syncerbot = self.synctarg3; + + return self.point3; + } + if (index == 4) { + if (self.waitpoint4) + self.wait = self.waitpoint4; + + if (self.duration4) + self.duration = self.duration4; + + if (self.synctarg4) + self.syncerbot = self.synctarg4; + + return self.point4; + } + if (index == 5) { + if (self.waitpoint5) + self.wait = self.waitpoint5; + + if (self.duration5) + self.duration = self.duration5; + + if (self.synctarg5) + self.syncerbot = self.synctarg5; + + return self.point5; + } + if (index == 6) { + if (self.waitpoint6) + self.wait = self.waitpoint6; + + if (self.duration6) + self.duration = self.duration6; + + if (self.synctarg6) + self.syncerbot = self.synctarg6; + + return self.point6; + } + if (index == 7) { + if (self.waitpoint7) + self.wait = self.waitpoint7; + + if (self.duration7) + self.duration = self.duration7; + + if (self.synctarg7) + self.syncerbot = self.synctarg7; + + return self.point7; + } + if (index == 8) { + if (self.waitpoint8) + self.wait = self.waitpoint8; + + if (self.duration8) + self.duration = self.duration8; + + if (self.synctarg8) + self.syncerbot = self.synctarg8; + + return self.point8; + } + if (index == 9) { + if (self.waitpoint9) + self.wait = self.waitpoint9; + + if (self.duration9) + self.duration = self.duration9; + + if (self.synctarg9) + self.syncerbot = self.synctarg9; + + return self.point9; + } + if (index == 10) { + if (self.waitpoint10) + self.wait = self.waitpoint10; + + if (self.duration10) + self.duration = self.duration10; + + if (self.synctarg10) + self.syncerbot = self.synctarg10; + + return self.point10; + } + if (index == 11) { + if (self.waitpoint11) + self.wait = self.waitpoint11; + + if (self.duration11) + self.duration = self.duration11; + + if (self.synctarg11) + self.syncerbot = self.synctarg11; + + return self.point11; + } + if (index == 12) { + if (self.waitpoint12) + self.wait = self.waitpoint12; + + if (self.duration12) + self.duration = self.duration12; + + if (self.synctarg12) + self.syncerbot = self.synctarg12; + + return self.point12; + } + if (index == 13) { + if (self.waitpoint13) + self.wait = self.waitpoint13; + + if (self.duration13) + self.duration = self.duration13; + + if (self.synctarg13) + self.syncerbot = self.synctarg13; + + return self.point13; + } + if (index == 14) { + if (self.waitpoint14) + self.wait = self.waitpoint14; + + if (self.duration14) + self.duration = self.duration14; + + if (self.synctarg14) + self.syncerbot = self.synctarg14; + + return self.point14; + } + if (index == 15) { + if (self.waitpoint15) + self.wait = self.waitpoint15; + + if (self.duration15) + self.duration = self.duration15; + + if (self.synctarg15) + self.syncerbot = self.synctarg15; + + return self.point15; + } + if (index == 16) { + if (self.waitpoint16) + self.wait = self.waitpoint16; + + if (self.duration16) + self.duration = self.duration16; + + if (self.synctarg16) + self.syncerbot = self.synctarg16; + + return self.point16; + } + if (index == 17) { + if (self.waitpoint17) + self.wait = self.waitpoint17; + + if (self.duration17) + self.duration = self.duration17; + + if (self.synctarg17) + self.syncerbot = self.synctarg17; + + return self.point17; + } + if (index == 18) { + if (self.waitpoint18) + self.wait = self.waitpoint18; + + if (self.duration18) + self.duration = self.duration18; + + if (self.synctarg18) + self.syncerbot = self.synctarg18; + + return self.point18; + } + if (index == 19) { + if (self.waitpoint19) + self.wait = self.waitpoint19; + + if (self.duration19) + self.duration = self.duration19; + + if (self.synctarg19) + self.syncerbot = self.synctarg19; + + return self.point19; + } + if (index == 20) { + if (self.waitpoint20) + self.wait = self.waitpoint20; + + if (self.duration20) + self.duration = self.duration20; + + if (self.synctarg20) + self.syncerbot = self.synctarg20; + + return self.point20; + } + if (index == 21) { + if (self.waitpoint21) + self.wait = self.waitpoint21; + + if (self.duration21) + self.duration = self.duration21; + + if (self.synctarg21) + self.syncerbot = self.synctarg21; + + return self.point21; + } + if (index == 22) { + if (self.waitpoint22) + self.wait = self.waitpoint22; + + if (self.duration22) + self.duration = self.duration22; + + if (self.synctarg22) + self.syncerbot = self.synctarg22; + + return self.point22; + } + if (index == 23) { + if (self.waitpoint23) + self.wait = self.waitpoint23; + + if (self.duration23) + self.duration = self.duration23; + + if (self.synctarg23) + self.syncerbot = self.synctarg23; + + return self.point23; + } + if (index == 24) { + if (self.waitpoint24) + self.wait = self.waitpoint24; + + if (self.duration24) + self.duration = self.duration24; + + if (self.synctarg24) + self.syncerbot = self.synctarg24; + + return self.point24; + } + if (index == 25) { + if (self.waitpoint25) + self.wait = self.waitpoint25; + + if (self.duration25) + self.duration = self.duration25; + + if (self.synctarg25) + self.syncerbot = self.synctarg25; + + return self.point25; + } + if (index == 26) { + if (self.waitpoint26) + self.wait = self.waitpoint26; + + if (self.duration26) + self.duration = self.duration26; + + if (self.synctarg26) + self.syncerbot = self.synctarg26; + + return self.point26; + } + if (index == 27) { + if (self.waitpoint27) + self.wait = self.waitpoint27; + + if (self.duration27) + self.duration = self.duration27; + + if (self.synctarg27) + self.syncerbot = self.synctarg27; + + return self.point27; + } + if (index == 28) { + if (self.waitpoint28) + self.wait = self.waitpoint28; + + if (self.duration28) + self.duration = self.duration28; + + if (self.synctarg28) + self.syncerbot = self.synctarg28; + + return self.point28; + } + if (index == 29) { + if (self.waitpoint29) + self.wait = self.waitpoint29; + + if (self.duration29) + self.duration = self.duration29; + + if (self.synctarg29) + self.syncerbot = self.synctarg29; + + return self.point29; + } + if (index == 30) { + if (self.waitpoint30) + self.wait = self.waitpoint30; + + if (self.duration30) + self.duration = self.duration30; + + if (self.synctarg30) + self.syncerbot = self.synctarg30; + + return self.point30; + } + if (index == 31) { + if (self.waitpoint31) + self.wait = self.waitpoint31; + + if (self.duration31) + self.duration = self.duration31; + + if (self.synctarg31) + self.syncerbot = self.synctarg31; + + return self.point31; + } + if (index == 32) { + if (self.waitpoint32) + self.wait = self.waitpoint32; + + if (self.duration32) + self.duration = self.duration32; + + if (self.synctarg32) + self.syncerbot = self.synctarg32; + + return self.point32; + } + if (index == 33) { + if (self.waitpoint33) + self.wait = self.waitpoint33; + + if (self.duration33) + self.duration = self.duration33; + + if (self.synctarg33) + self.syncerbot = self.synctarg33; + + return self.point33; + } + if (index == 34) { + if (self.waitpoint34) + self.wait = self.waitpoint34; + + if (self.duration34) + self.duration = self.duration34; + + if (self.synctarg34) + self.syncerbot = self.synctarg34; + + return self.point34; + } + if (index == 35) { + if (self.waitpoint35) + self.wait = self.waitpoint35; + + if (self.duration35) + self.duration = self.duration35; + + if (self.synctarg35) + self.syncerbot = self.synctarg35; + + return self.point35; + } + if (index == 36) { + if (self.waitpoint36) + self.wait = self.waitpoint36; + + if (self.duration36) + self.duration = self.duration36; + + if (self.synctarg36) + self.syncerbot = self.synctarg36; + + return self.point36; + } + if (index == 37) { + if (self.waitpoint37) + self.wait = self.waitpoint37; + + if (self.duration37) + self.duration = self.duration37; + + if (self.synctarg37) + self.syncerbot = self.synctarg37; + + return self.point37; + } + if (index == 38) { + if (self.waitpoint38) + self.wait = self.waitpoint38; + + if (self.duration38) + self.duration = self.duration28; + + if (self.synctarg38) + self.syncerbot = self.synctarg38; + + return self.point38; + } + if (index == 39) { + if (self.waitpoint39) + self.wait = self.waitpoint39; + + if (self.duration39) + self.duration = self.duration39; + + if (self.synctarg39) + self.syncerbot = self.synctarg39; + + return self.point39; + } + if (index == 40) { + if (self.waitpoint40) + self.wait = self.waitpoint40; + + if (self.duration40) + self.duration = self.duration40; + + if (self.synctarg40) + self.syncerbot = self.synctarg40; + + return self.point40; + } + if (index == 41) { + if (self.waitpoint41) + self.wait = self.waitpoint41; + + if (self.duration41) + self.duration = self.duration41; + + if (self.synctarg41) + self.syncerbot = self.synctarg41; + + return self.point41; + } + if (index == 42) { + if (self.waitpoint42) + self.wait = self.waitpoint42; + + if (self.duration42) + self.duration = self.duration42; + + if (self.synctarg42) + self.syncerbot = self.synctarg42; + + return self.point42; + } + if (index == 43) { + if (self.waitpoint43) + self.wait = self.waitpoint43; + + if (self.duration43) + self.duration = self.duration43; + + if (self.synctarg43) + self.syncerbot = self.synctarg43; + + return self.point43; + } + if (index == 44) { + if (self.waitpoint44) + self.wait = self.waitpoint44; + + if (self.duration44) + self.duration = self.duration44; + + if (self.synctarg44) + self.syncerbot = self.synctarg44; + + return self.point44; + } + if (index == 45) { + if (self.waitpoint45) + self.wait = self.waitpoint45; + + if (self.duration45) + self.duration = self.duration45; + + if (self.synctarg45) + self.syncerbot = self.synctarg45; + + return self.point45; + } + if (index == 46) { + if (self.waitpoint46) + self.wait = self.waitpoint46; + + if (self.duration46) + self.duration = self.duration46; + + if (self.synctarg46) + self.syncerbot = self.synctarg46; + + return self.point46; + } + if (index == 47) { + if (self.waitpoint47) + self.wait = self.waitpoint47; + + if (self.duration47) + self.duration = self.duration47; + + if (self.synctarg47) + self.syncerbot = self.synctarg47; + + return self.point47; + } + if (index == 48) { + if (self.waitpoint48) + self.wait = self.waitpoint48; + + if (self.duration48) + self.duration = self.duration48; + + if (self.synctarg48) + self.syncerbot = self.synctarg48; + + return self.point48; + } + if (index == 49) { + if (self.waitpoint49) + self.wait = self.waitpoint49; + + if (self.duration49) + self.duration = self.duration49; + + if (self.synctarg49) + self.syncerbot = self.synctarg49; + + return self.point49; + } + if (index == 50) { + if (self.waitpoint50) + self.wait = self.waitpoint50; + + if (self.duration50) + self.duration = self.duration50; + + if (self.synctarg50) + self.syncerbot = self.synctarg50; + + return self.point50; + } + + self.wait = FALSE; + self.duration = FL_SWIM; + return VEC_ORIGIN; +}; + +void() robot_use_turnon = { + self.use = robot_use_turnoff; + if (self.wait) { + self.think = robot_thinkgo; + self.nextthink = (self.ltime + self.wait); + self.wait = FALSE; + return; + } + robot_thinkgo(); +}; + +void() robot_use_turnoff = { + self.use = robot_use_turnon; + self.think = SUB_Null; + self.nextthink = -1; +}; + +void() robot_sync_all_targets = { + local string stemp; + + stemp = self.target; + self.target = self.syncerbot; + SUB_UseTargets(); + self.target = stemp; + self.syncerbot = string_null; + return; +}; + +void() robot_wait = { + self.poindex = (self.poindex + 1); + + if (self.syncerbot != string_null) { + robot_sync_all_targets(); + self.use = robot_use_turnon; + self.think = SUB_Null; + return; + } + + if (self.wait != FALSE) { + if (self.wait == -1) { + self.wait = FALSE; + self.use = robot_use_turnon; + self.think = SUB_Null; + self.nextthink = (self.ltime + 0.100); + return; + } + self.think = robot_thinkgo; + self.nextthink = self.ltime + self.wait; + self.wait = FALSE; + return; + } + + robot_thinkgo(); +}; + +vector(vector pnt) robot_relativecoord_get = { + // This function steps through the program until we hit + // the correct starting point then returns it. + + local float indexer; + local vector vtemp; + + for (indexer = TRUE; indexer != self.poindex; indexer = (indexer + TRUE)) { + vtemp = robot_getpoint(indexer+TRUE); + if (vtemp == VEC_ORIGIN) + { + indexer = FALSE; // reset indexer. we reached the end of the program list + continue; // goto end of for loop to increment indexer by 1, execute for loop again + } + pnt = (pnt + vtemp); + } + + if (pnt == VEC_ORIGIN) + pnt = (self.homepoint + robot_getpoint(TRUE)); + + return pnt; +}; + +//================================== +//=====Main Movement Function======= +//================================== +void() robot_thinkgo = { + self.curpoint = robot_getpoint(self.poindex); + if (self.curpoint == VEC_ORIGIN) { + self.poindex = TRUE; + self.curpoint = robot_getpoint(self.poindex); + } + + self.curpoint = (self.curpoint + self.origin); // relative coordinates from robots current location + + if (!self.duration) { + self.duration = TRUE; // prevent possible glitches + } + + self.oldcurpoint = self.curpoint; + robot_move(self.curpoint, self.duration, robot_wait); +}; + +void() info_home = {}; + +//======Our Beloved Coordinate Axis Robot====== +//--------------------------------------------- +void() func_robot = { + local entity targ; + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + self.use = robot_use_turnon; + setmodel (self, self.model); + setsize (self, self.mins , self.maxs); + + if (!self.poindex || self.poindex > 50) + self.poindex = TRUE; + + if (self.homeinfo) { + targ = find (world,targetname,self.homeinfo); + self.homepoint = targ.origin; + } + self.oldcurpoint = robot_relativecoord_get(self.homepoint); + self.curpoint = self.oldcurpoint; + setorigin(self, self.oldcurpoint - self.mins); + self.poindex = (self.poindex + 1); + if (!self.point1) + self.point1 = VEC_ORIGIN; + + if (!self.point2) + self.point2 = '16 16 0'; + + if (!self.duration1) + self.duration1 = 1; + + if (!self.duration2) + self.duration2 = 1; + + if (!self.targetname) { + if (self.wait) { + self.nextthink = self.ltime + self.wait; + self.wait = FALSE; + } else { + self.nextthink = self.ltime + 0.100; + } + + self.use = robot_use_turnoff; + self.think = robot_thinkgo; + } +}; +//---------------------------------------------- +//============================================== + +void() robot_controller_use_targets = { + local entity stemp; + local string temptarget; + local string targname1; + local string targname2; + local string targname3; + local string targname4; + local string targname5; + local string targname6; + local string targname7; + local string targname8; + local string targname9; + local string targname10; + local string targname11; + local string targname12; + local string targname13; + local string targname14; + local string targname15; + local string targname16; + local string targname17; + local string targname18; + local string targname19; + local string targname20; + local float tempdelay; + + if (self.syncent1) { + self.syncent1.use = robot_use_turnon; + targname1 = self.syncent1.targetname; + self.syncent1.targetname = "badjoojoomagumbo"; + } + + if (self.syncent2) { + self.syncent2.use = robot_use_turnon; + targname2 = self.syncent2.targetname; + self.syncent2.targetname = "badjoojoomagumbo"; + } + + if (self.syncent3) { + self.syncent3.use = robot_use_turnon; + targname3 = self.syncent3.targetname; + self.syncent3.targetname = "badjoojoomagumbo"; + } + + if (self.syncent4) { + self.syncent4.use = robot_use_turnon; + targname4 = self.syncent4.targetname; + self.syncent4.targetname = "badjoojoomagumbo"; + } + + if (self.syncent5) { + self.syncent5.use = robot_use_turnon; + targname5 = self.syncent5.targetname; + self.syncent5.targetname = "badjoojoomagumbo"; + } + + if (self.syncent6) { + self.syncent6.use = robot_use_turnon; + targname6 = self.syncent6.targetname; + self.syncent6.targetname = "badjoojoomagumbo"; + } + + if (self.syncent7) { + self.syncent7.use = robot_use_turnon; + targname7 = self.syncent7.targetname; + self.syncent7.targetname = "badjoojoomagumbo"; + } + + if (self.syncent8) { + self.syncent8.use = robot_use_turnon; + targname8 = self.syncent8.targetname; + self.syncent8.targetname = "badjoojoomagumbo"; + } + + if (self.syncent9) { + self.syncent9.use = robot_use_turnon; + targname9 = self.syncent9.targetname; + self.syncent9.targetname = "badjoojoomagumbo"; + } + + if (self.syncent10) + { + self.syncent10.use = robot_use_turnon; + targname10 = self.syncent10.targetname; + self.syncent10.targetname = "badjoojoomagumbo"; + } + + if (self.syncent11) + { + self.syncent11.use = robot_use_turnon; + targname11 = self.syncent11.targetname; + self.syncent11.targetname = "badjoojoomagumbo"; + } + + if (self.syncent12) + { + self.syncent12.use = robot_use_turnon; + targname12 = self.syncent12.targetname; + self.syncent12.targetname = "badjoojoomagumbo"; + } + + if (self.syncent13) + { + self.syncent13.use = robot_use_turnon; + targname13 = self.syncent13.targetname; + self.syncent13.targetname = "badjoojoomagumbo"; + } + + if (self.syncent14) + { + self.syncent14.use = robot_use_turnon; + targname14 = self.syncent14.targetname; + self.syncent14.targetname = "badjoojoomagumbo"; + } + + if (self.syncent15) + { + self.syncent15.use = robot_use_turnon; + targname15 = self.syncent15.targetname; + self.syncent15.targetname = "badjoojoomagumbo"; + } + + if (self.syncent16) + { + self.syncent16.use = robot_use_turnon; + targname16 = self.syncent16.targetname; + self.syncent16.targetname = "badjoojoomagumbo"; + } + + if (self.syncent17) + { + self.syncent17.use = robot_use_turnon; + targname17 = self.syncent17.targetname; + self.syncent17.targetname = "badjoojoomagumbo"; + } + + if (self.syncent18) + { + self.syncent18.use = robot_use_turnon; + targname18 = self.syncent18.targetname; + self.syncent18.targetname = "badjoojoomagumbo"; + } + + if (self.syncent19) + { + self.syncent19.use = robot_use_turnon; + targname19 = self.syncent19.targetname; + self.syncent19.targetname = "badjoojoomagumbo"; + } + + if (self.syncent20) + { + self.syncent20.use = robot_use_turnon; + targname20 = self.syncent20.targetname; + self.syncent20.targetname = "badjoojoomagumbo"; + } + + + // Syncronized start. All together now...GO!! + temptarget = self.target; + self.target = "badjoojoomagumbo"; // because, well, why would you use such a name!?! + tempdelay = self.delay; + self.delay = FALSE; + activator = self.enemy; + SUB_UseTargets(); + self.delay = tempdelay; + self.target = temptarget; + + if (self.syncent1) { + stemp = self; + self = self.syncent1; + self.targetname = targname1; + self = stemp; + } + + if (self.syncent2) { + stemp = self; + self = self.syncent2; + self.targetname = targname2; + self = stemp; + } + + if (self.syncent3) { + stemp = self; + self = self.syncent3; + self.targetname = targname3; + self = stemp; + } + + if (self.syncent4) + { + stemp = self; + self = self.syncent4; + self.targetname = targname4; + self = stemp; + } + + if (self.syncent5) + { + stemp = self; + self = self.syncent5; + self.targetname = targname5; + self = stemp; + } + + if (self.syncent6) + { + stemp = self; + self = self.syncent6; + self.targetname = targname6; + self = stemp; + } + + if (self.syncent7) + { + stemp = self; + self = self.syncent7; + self.targetname = targname7; + self = stemp; + } + + if (self.syncent8) + { + stemp = self; + self = self.syncent8; + self.targetname = targname8; + self = stemp; + } + + if (self.syncent9) + { + stemp = self; + self = self.syncent9; + self.targetname = targname9; + self = stemp; + } + + if (self.syncent10) + { + stemp = self; + self = self.syncent10; + self.targetname = targname10; + self = stemp; + } + + if (self.syncent11) + { + stemp = self; + self = self.syncent11; + self.targetname = targname11; + self = stemp; + } + + if (self.syncent12) + { + stemp = self; + self = self.syncent12; + self.targetname = targname12; + self = stemp; + } + + if (self.syncent13) + { + stemp = self; + self = self.syncent13; + self.targetname = targname13; + self = stemp; + } + + if (self.syncent14) { + stemp = self; + self = self.syncent14; + self.targetname = targname14; + self = stemp; + } + + if (self.syncent15) { + stemp = self; + self = self.syncent15; + self.targetname = targname15; + self = stemp; + } + + if (self.syncent16) { + stemp = self; + self = self.syncent16; + self.targetname = targname16; + self = stemp; + } + + if (self.syncent17) { + stemp = self; + self = self.syncent17; + self.targetname = targname17; + self = stemp; + } + + if (self.syncent18) { + stemp = self; + self = self.syncent18; + self.targetname = targname18; + self = stemp; + } + + if (self.syncent19) { + stemp = self; + self = self.syncent19; + self.targetname = targname19; + self = stemp; + } + + if (self.syncent20) { + stemp = self; + self = self.syncent20; + self.targetname = targname20; + self = stemp; + } + + self.count = self.oldcount; +}; + +void() robot_controller_use = { + self.count = (self.count - TRUE); + + if ((self.oldcount - self.count) == 1) + self.syncent1 = other; + + if ((self.oldcount - self.count) == 2) + self.syncent2 = other; + + if ((self.oldcount - self.count) == 3) + self.syncent3 = other; + + if ((self.oldcount - self.count) == 4) + self.syncent4 = other; + + if ((self.oldcount - self.count) == 5) + self.syncent5 = other; + + if ((self.oldcount - self.count) == 6) + self.syncent6 = other; + + if ((self.oldcount - self.count) == 7) + self.syncent7 = other; + + if ((self.oldcount - self.count) == 8) + self.syncent8 = other; + + if ((self.oldcount - self.count) == 9) + self.syncent9 = other; + + if ((self.oldcount - self.count) == 10) + self.syncent10 = other; + + if ((self.oldcount - self.count) == 11) + self.syncent11 = other; + + if ((self.oldcount - self.count) == 12) + self.syncent12 = other; + + if ((self.oldcount - self.count) == 13) + self.syncent13 = other; + + if ((self.oldcount - self.count) == 14) + self.syncent14 = other; + + if ((self.oldcount - self.count) == 15) + self.syncent15 = other; + + if ((self.oldcount - self.count) == 16) + self.syncent16 = other; + + if ((self.oldcount - self.count) == 17) + self.syncent17 = other; + + if ((self.oldcount - self.count) == 18) + self.syncent18 = other; + + if ((self.oldcount - self.count) == 19) + self.syncent19 = other; + + if ((self.oldcount - self.count) == 20) + self.syncent20 = other; + + if (self.count) + return; + + if (self.count < FALSE) + return; + + self.enemy = activator; + + if (!self.count) { + self.think = robot_controller_use_targets; + self.nextthink = time + self.delay; + } +}; + +void() func_robot_controller = { + if (!self.targetname) return; + + if (!self.count) self.count = 2; + if (!self.delay) self.delay = 0.100; + if (!self.wait) self.wait = 0.100; // Time to reset controller before it accepts input + self.oldcount = self.count; + self.use = robot_controller_use; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/qrobotdefs.qc b/QC_other/QC_keep/qrobotdefs.qc new file mode 100644 index 00000000..37eb64ff --- /dev/null +++ b/QC_other/QC_keep/qrobotdefs.qc @@ -0,0 +1,279 @@ +// Change multi_wait function in triggers.qc to the following to allow for resettable counters: +/* +void () multi_wait = { + + if ( self.max_health ) { + + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + + } + if ( self.classname == "counter" ) { + + self.count = self.oldcount; + } +}; +*/ + +// ================================ +// =======Robot Definitions======== +// ================================ +float COUNTER_RESETS = 2; +.float oldcount; +.string syncerbot; +.string homeinfo; +.float poindex; +.vector curpoint; +.vector homepoint; +.vector oldcurpoint; +.vector point1; +.vector point2; +.vector point3; +.vector point4; +.vector point5; +.vector point6; +.vector point7; +.vector point8; +.vector point9; +.vector point10; +.vector point11; +.vector point12; +.vector point13; +.vector point14; +.vector point15; +.vector point16; +.vector point17; +.vector point18; +.vector point19; +.vector point20; +.vector point21; +.vector point22; +.vector point23; +.vector point24; +.vector point25; +.vector point26; +.vector point27; +.vector point28; +.vector point29; +.vector point30; +.vector point31; +.vector point32; +.vector point33; +.vector point34; +.vector point35; +.vector point36; +.vector point37; +.vector point38; +.vector point39; +.vector point40; +.vector point41; +.vector point42; +.vector point43; +.vector point44; +.vector point45; +.vector point46; +.vector point47; +.vector point48; +.vector point49; +.vector point50; +.float duration1; +.float duration2; +.float duration3; +.float duration4; +.float duration5; +.float duration6; +.float duration7; +.float duration8; +.float duration9; +.float duration10; +.float duration11; +.float duration12; +.float duration13; +.float duration14; +.float duration15; +.float duration16; +.float duration17; +.float duration18; +.float duration19; +.float duration20; +.float duration21; +.float duration22; +.float duration23; +.float duration24; +.float duration25; +.float duration26; +.float duration27; +.float duration28; +.float duration29; +.float duration30; +.float duration31; +.float duration32; +.float duration33; +.float duration34; +.float duration35; +.float duration36; +.float duration37; +.float duration38; +.float duration39; +.float duration40; +.float duration41; +.float duration42; +.float duration43; +.float duration44; +.float duration45; +.float duration46; +.float duration47; +.float duration48; +.float duration49; +.float duration50; +.string synctarg1; +.string synctarg2; +.string synctarg3; +.string synctarg4; +.string synctarg5; +.string synctarg6; +.string synctarg7; +.string synctarg8; +.string synctarg9; +.string synctarg10; +.string synctarg11; +.string synctarg12; +.string synctarg13; +.string synctarg14; +.string synctarg15; +.string synctarg16; +.string synctarg17; +.string synctarg18; +.string synctarg19; +.string synctarg20; +.string synctarg21; +.string synctarg22; +.string synctarg23; +.string synctarg24; +.string synctarg25; +.string synctarg26; +.string synctarg27; +.string synctarg28; +.string synctarg29; +.string synctarg30; +.string synctarg31; +.string synctarg32; +.string synctarg33; +.string synctarg34; +.string synctarg35; +.string synctarg36; +.string synctarg37; +.string synctarg38; +.string synctarg39; +.string synctarg40; +.string synctarg41; +.string synctarg42; +.string synctarg43; +.string synctarg44; +.string synctarg45; +.string synctarg46; +.string synctarg47; +.string synctarg48; +.string synctarg49; +.string synctarg50; +.entity syncent1; +.entity syncent2; +.entity syncent3; +.entity syncent4; +.entity syncent5; +.entity syncent6; +.entity syncent7; +.entity syncent8; +.entity syncent9; +.entity syncent10; +.entity syncent11; +.entity syncent12; +.entity syncent13; +.entity syncent14; +.entity syncent15; +.entity syncent16; +.entity syncent17; +.entity syncent18; +.entity syncent19; +.entity syncent20; +.entity syncent21; +.entity syncent22; +.entity syncent23; +.entity syncent24; +.entity syncent25; +.entity syncent26; +.entity syncent27; +.entity syncent28; +.entity syncent29; +.entity syncent30; +.entity syncent31; +.entity syncent32; +.entity syncent33; +.entity syncent34; +.entity syncent35; +.entity syncent36; +.entity syncent37; +.entity syncent38; +.entity syncent39; +.entity syncent40; +.entity syncent41; +.entity syncent42; +.entity syncent43; +.entity syncent44; +.entity syncent45; +.entity syncent46; +.entity syncent47; +.entity syncent48; +.entity syncent49; +.entity syncent50; +.float waitpoint1; +.float waitpoint2; +.float waitpoint3; +.float waitpoint4; +.float waitpoint5; +.float waitpoint6; +.float waitpoint7; +.float waitpoint8; +.float waitpoint9; +.float waitpoint10; +.float waitpoint11; +.float waitpoint12; +.float waitpoint13; +.float waitpoint14; +.float waitpoint15; +.float waitpoint16; +.float waitpoint17; +.float waitpoint18; +.float waitpoint19; +.float waitpoint20; +.float waitpoint21; +.float waitpoint22; +.float waitpoint23; +.float waitpoint24; +.float waitpoint25; +.float waitpoint26; +.float waitpoint27; +.float waitpoint28; +.float waitpoint29; +.float waitpoint30; +.float waitpoint31; +.float waitpoint32; +.float waitpoint33; +.float waitpoint34; +.float waitpoint35; +.float waitpoint36; +.float waitpoint37; +.float waitpoint38; +.float waitpoint39; +.float waitpoint40; +.float waitpoint41; +.float waitpoint42; +.float waitpoint43; +.float waitpoint44; +.float waitpoint45; +.float waitpoint46; +.float waitpoint47; +.float waitpoint48; +.float waitpoint49; +.float waitpoint50; \ No newline at end of file diff --git a/QC_other/QC_keep/settings.qc b/QC_other/QC_keep/settings.qc new file mode 100644 index 00000000..5ebd0672 --- /dev/null +++ b/QC_other/QC_keep/settings.qc @@ -0,0 +1,995 @@ +/*====================================================================== + MOD CUSTOM SETTINGS +======================================================================*/ +void() toggleautoaim; // Toggle auto aim +void() togglezaware; // Toggle Z aware monsters +void() togglefootstep; // Toggle footstep sound (player/monster) +void() toggleliquiddmg; // Toggle Monster Liquid damage +void() toggleshotgunproj; // Toggle Shotgun Projectiles +void() toggleshotguncase; // Toggle Shotgun Casing +void() toggleupgradeaxe; // Toggle Axe Upgrade (inventory only) +void() toggleupgradessg; // Toggle Shotgun Upgrade (inventory only) +void() toggleupgradelg; // Toggle Lightning Upgrade (inventory only) +void() togglepixels; // Toggle Texture modes +void() togglecoopartifacts; // Toggle COOP can drop artifacts +void() togglecoopammoboxes; // Toggle COOP ammo boxes to respawn + +void() display_configflag; // Display config flag +void() display_playinfo; // Display Player information +void() display_version; // Display MOD information +void() display_mapvar; // Display Map Variables +void() display_customkeys; // Display Custom Key inventory +void() toggleaipath; // Toggle AI path extra info +void() CycleParticleDebug; // Cycle particle debug messages + +void(float sigil_bit) givesigil; // Testing only +void(float key_bit) givekey; // Testing only + +void() CycleWeaponCommand; +void() CycleWeaponReverseCommand; +void() CheatCommand; +void() SharpshooterCheat; +void() NailPiercerCheat; +void() EnvSuitCheat; +void() PentagramCheat; +void() InvisibleCheat; +void() QuadDamageCheat; +void() StartIntermissionCamera; + +/*====================================================================== + Show MOD name and version +======================================================================*/ +void() display_version = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + sprint(self,MOD_VERSION); +}; + + +/*====================================================================== + Prints which custom keys the player has in their inventory +======================================================================*/ +void() display_customkeys = +{ + local string ckey_str1, ckey_str2, ckey_str3, ckey_str4; + local float ckey_count; + + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + self.impulse = 0; + + // Check for any custom keys in player inventory + if (self.moditems & IT_CKEYALL) { + // Always reset key count + ckey_count = 0; + + if (self.moditems & IT_CKEY1) { + ckey_str1 = self.ckeyname1; + ckey_count = ckey_count + 1; + } + if (self.moditems & IT_CKEY2) { + if (ckey_count == 1) ckey_str2 = self.ckeyname2; + else ckey_str1 = self.ckeyname2; + ckey_count = ckey_count + 1; + } + if (self.moditems & IT_CKEY3) { + if (ckey_count == 2) ckey_str3 = self.ckeyname3; + else if (ckey_count == 1) ckey_str2 = self.ckeyname3; + else ckey_str1 = self.ckeyname3; + ckey_count = ckey_count + 1; + } + if (self.moditems & IT_CKEY4) { + if (ckey_count == 3) ckey_str4 = self.ckeyname4; + else if (ckey_count == 2) ckey_str3 = self.ckeyname4; + else if (ckey_count == 1) ckey_str2 = self.ckeyname4; + else ckey_str1 = self.ckeyname4; + ckey_count = ckey_count + 1; + } + + // if 4 keys are present, then squash the last two key names together + // The maximum amount of strings that centerprint can handle is 7 + // A bit of shame, because only needed one more string! + if (ckey_count == 4) + centerprint7 (self, "-[ \bArcane Key Inventory\b ]-\nYou have the following\n\n", ckey_str1, "\n", ckey_str2, "\n", ckey_str3, ckey_str4); + else + // Space out title and keys (does not print key 4) + centerprint7 (self, "-[ \bArcane Key Inventory\b ]-\nYou have the following\n\n", ckey_str1, "\n", ckey_str2, "\n", ckey_str3, "\n"); + } + else + // Should always say the state of the inventory + centerprint(self, "-[ \bArcane Key Inventory\b ]-\n\nIs Empty!\n"); +}; + +/*====================================================================== + The MOD can be customizied from three different source: + quake.rc < worldspawn < impulse commands (top priority) + + The serverflags is the ONLY variable that is passed between MAP loads + and that variable is not available straightaway! Once the worldspawn + is loaded (first thing to happen) the serverflags is still empty + and the functions have to cope with it 'out of sync' until later. + + after worldspawn is loaded, the combination of the quake.rc (TEMP1) + is merged with the keys on worldspawn and all spawning functions + use the configflags until it can be sync'd with serverflags. + + The configflags is setup to be temporary so that any previous value + from a quickload does not interfere with it. + +======================================================================*/ +// Assume that serverflags not setup yet, merge worldspawn with configflag +// Once serverflags available, then sync everything together +void(float regbitflag, float worldvalue) update_worldspawn = +{ + // Is the bit value TRUE? + if (worldvalue > 0) configflag = configflag | regbitflag; + // Only take about a bit value from configflag if bit value is present + else if (worldvalue < 0) { + if (configflag & regbitflag) configflag = configflag - regbitflag; + } +}; + +//---------------------------------------------------------------------- +// The worldspawn key values always override the quake.rc values and +// should be merged with the console variable when loading a map +// serverflags is not available before spawn functions +void() sycn_worldspawn = +{ + update_worldspawn(SVR_ITEMOFFSET, self.no_item_offset); + update_worldspawn(SVR_ITEMROTATE, self.no_item_rotate); + update_worldspawn(SVR_UPDAXE, self.upgrade_axe); + update_worldspawn(SVR_UPDSSG, self.upgrade_ssg); + update_worldspawn(SVR_UPDLG, self.upgrade_lg); + update_worldspawn(SVR_ZAWARE, self.no_zaware); + update_worldspawn(SVR_LIQDAM, self.no_liquiddmg); +}; + +//---------------------------------------------------------------------- +// Reset the serverflag to console + worldspawn settings +// This only needs to be done when loading a new map or changelevel +// quickload cannot run this function it will damage inventory +void() sync_serverflags = +{ + local float checkflag; + + if (serverflags & SVR_LIVE) { + dprint("\b[SERVERFLAG]\b MAP LOAD reset/sync\n"); + // Take 1-8 runes, 9-16 worldspawn merge, 17-23 mod/console options + checkflag = (serverflags & SVR_RUNEFLAG) + (temp1flag & SVR_WORLDFLAG) + (configflag & SVR_HIGHFLAG); + // Update the serverflags ready for future updates + serverflags = configflag = checkflag; + } +}; + +//---------------------------------------------------------------------- +// Update configflag and if the serverflags is active, update that as well! +void(float regbitflag, float regbitvalue) update_configflag = +{ + // Is the bit value TRUE? + if (regbitvalue == TRUE) { + configflag = configflag | regbitflag; + if (serverflags & SVR_LIVE) serverflags = serverflags | regbitflag; + } + // If the bit value FALSE + else { + configflag = configflag - (configflag & regbitflag); + if (serverflags & SVR_LIVE) { + serverflags = serverflags - (serverflags & regbitflag); + } + } + + // Only the top 8 bits of TEMP1 flag can be updated + // Some options should not be changed easily, causes problems + if (regbitflag & SVR_HIGHFLAG) { + // Re-fresh the console variable + dprint("\b[TEMP1]\b Changing ("); dprint(ftos(regbitflag)); + dprint(")\n"); + temp1flag = cvar("temp1"); + if (regbitvalue > 0) temp1flag = temp1flag | regbitflag; + else temp1flag = temp1flag - (temp1flag & regbitflag); + // Write any changes to the console variable (TEMP1) + cvar_set("temp1", ftos(temp1flag)); + } +}; + +//---------------------------------------------------------------------- +float(float regbitflag) query_configflag = +{ + // Return bitflag value so multiple bits can be tested together + return (configflag & regbitflag); +}; + +//---------------------------------------------------------------------- +float(float regbitflag) query_temp1flag = +{ + // Return bitflag value so multiple bits can be tested together + return (temp1flag & regbitflag); +}; + +//---------------------------------------------------------------------- +// Once global variables are available (client/server is setup) +// Sync the serverflag with the configflag +//---------------------------------------------------------------------- +void() sync_configflag = +{ + local float checkflag; + + // At this point the live data is all over the place and needs to be merged + // The serverflag can contain (rune keys and console options) if quickload + // and the configflag contains default + worldspawn keys + if (serverflags & SVR_LIVE) { + dprint("\b[SERVERFLAG]\b LIVE data detected\n"); + // Take 1-16 runes & spawn options, 17-23 mod/console options + checkflag = (serverflags & SVR_LOWFLAG) + (configflag & SVR_HIGHFLAG); + + // Make sure all flags are in sync with each other + configflag = serverflags = checkflag | SVR_LIVE; + } + else { + dprint("\b[SERVERFLAG]\b new game detected\n"); + // Update the serverflags ready for future updates + serverflags = configflag | SVR_LIVE; + } +}; + +//---------------------------------------------------------------------- +void() display_configflag = +{ + if (developer == 0) return; + + dprint("\n\b[CONFIG]\b MOD Settings ("); + if (configflag & SVR_LIVE) dprint(ftos(configflag-SVR_LIVE)); + else dprint(ftos(configflag)); + if (configflag & SVR_LIVE) dprint(") L\n"); + else dprint(")\n"); + dprint("--------------------------------------\n"); + // Particle system + if (query_configflag(SVR_PARTICLES)) dprint("+ Particle System enabled\n"); + else dprint("- Particle System disabled\n"); + if (query_configflag(SVR_SPRPARTON) || world.sprite_particles == TRUE) + dprint("* Sprite/Dot particles ONLY\n"); + if (query_configflag(SVR_WEATHER)) dprint("- Weather System disabled\n"); + else dprint("+ Weather System enabled\n"); + // All new MOD weapons + if (world.upgrade_axe < 0) dprint("W Axe Upg Remove on Worldspawn\n"); + else if (world.upgrade_axe > 0) dprint("W Axe Upg Added on Worldspawn\n"); + else if (query_temp1flag(SVR_UPDAXE)) dprint("* Axe Upgrade in quake.rc\n"); + else if (query_configflag(SVR_UPDAXE)) dprint("+ Axe Upgrade from inventory\n"); + else dprint("- NO Axe upgrade detected\n"); + + if (world.upgrade_ssg < 0) dprint("W SSG Upg Remove on Worldspawn\n"); + else if (world.upgrade_ssg > 0) dprint("W SSG Upg Added on Worldspawn\n"); + else if (query_temp1flag(SVR_UPDSSG)) dprint("* SSG Upgrade in quake.rc\n"); + else if (query_configflag(SVR_UPDSSG)) dprint("+ SSG Upgrade from inventory\n"); + else dprint("- NO SSG upgrade detected\n"); + + if (world.upgrade_lg < 0) dprint("W LG Upg Remove on Worldspawn\n"); + else if (world.upgrade_lg > 0) dprint("W LG Upg Added on Worldspawn\n"); + else if (query_temp1flag(SVR_UPDLG)) dprint("* LG Upgrade in quake.rc\n"); + else if (query_configflag(SVR_UPDLG)) dprint("+ LG Upgrade from inventory\n"); + else dprint("- NO LG upgrade detected\n"); + + // New Shotgun bullet projectile/casing system + if (world.no_sgprojectile > 0) dprint("W SG Projs Disabled on worldspawn\n"); + else if (query_configflag(SVR_SHOTGPROJ)) dprint("- Shotgun hitscan system\n"); + else dprint("+ Shotgun projectiles system\n"); + if (world.no_sgcasing > 0) dprint("W SG Casing Disabled on worldspawn\n"); + else if (query_configflag(SVR_SHOTGCASE)) dprint("- Shotgun casing disabled\n"); + else dprint("+ Shotgun casing enabled\n"); + if (playerprojsize == 0) dprint("+ Large Projectile Collision\n"); + else dprint("- Small Projectile Collision\n"); + + // Items updates; origin points and random rotation + if (query_configflag(SVR_ITEMOFFSET)) dprint("+ All items use center origin\n"); + else dprint("- All items use corner origin\n"); + if (query_configflag(SVR_ITEMROTATE)) dprint("- All items use entity angle key\n"); + else dprint("+ All items are randomly rotated\n"); + + // General MOD settings + if (autoaim_cvar >= 1) dprint("+ Player weapon autoaim disabled\n"); + else dprint("- Player weapon autoaim enabled\n"); + if (query_configflag(SVR_ZAWARE)) dprint("- Z Aware Monster combat disabled\n"); + else dprint("+ Z Aware Monster combat enabled\n"); + if (query_configflag(SVR_FOOTSTEP)) dprint("- footstep sounds disabled\n"); + else dprint("+ footstep sounds enabled\n"); + if (query_configflag(SVR_LIQDAM)) dprint("- monster liquid damage off\n"); + else dprint("+ monster liquid damage on\n"); + if (query_configflag(SVR_AIPATH)) dprint("- Path Corner Arrows disabled\n"); + else dprint("+ Path Corner Arrows enabled\n"); + + // Body fade/floor checks + if (map_bodyfadeaway > 0) dprint("+ Monster dead body fade away\n"); + else dprint("- No fade away for monster bodies\n"); + if (map_bodyflrcheck > 0) dprint("+ Monster dead body check floor\n"); + else dprint("- No floor checks for monster bodies\n"); + + // Visual settings - fog / wateralpha / gravity + if (query_configflag(SVR_NOFOGCMDS)) dprint("- Global fog system disabled\n"); + else if (fog_active && fog_control) { + dprint("+ Gfog ("); + lftos(self, fog_control.fog_currden, 1,3, BUFFER_DPRINT); dprint(")("); + lftos(self, fog_control.fog_currcol_x, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self, fog_control.fog_currcol_y, 1,3, BUFFER_DPRINT); dprint(" "); + lftos(self, fog_control.fog_currcol_z, 1,3, BUFFER_DPRINT); dprint(")\n"); + } + else dprint("* Global fog default not defined\n"); + if (liquid_alpha != 1) { + dprint("+ Water Alpha has changed ("); + lftos(self, liquid_alpha, 0,3, BUFFER_DPRINT); dprint(")\n"); + } + if (map_gravity != DEF_GRAVITY) { + dprint("+ Map gravity has changed ("); + dprint(ftos(map_gravity)); dprint(")\n"); + } + + // DP compatible visual settings + if (engine == ENG_DPEXT) { + dprint("+ DP features ( "); + // Show all active features + if (ext_dpfog) dprint("FOG "); + if (ext_dpsurf) dprint("SURF "); + if (ext_dprain) dprint("RAIN "); + if (ext_dpsnow) dprint("SNOW"); + dprint(")\n"); + } + + // Show the coop respawn options + if (coop > 0) { + if (coop_weapons == FALSE) dprint("+ COOP weapons respawn TRUE\n"); + else dprint("- COOP weapons respawn FALSE\n"); + if (coop_ammoboxes == FALSE) dprint("- COOP ammo boxes respawn FALSE\n"); + else dprint("+ COOP ammo boxes respawn TRUE\n"); + if (coop_health == FALSE) dprint("- COOP health packs respawn FALSE\n"); + else dprint("+ COOP health packs respawn TRUE\n"); + if (coop_powerups == FALSE) dprint("- COOP powerups respawn FALSE\n"); + else dprint("+ COOP powerups respawn TRUE\n"); + } + + dprint("--------------------------------------\n"); +}; + +/*====================================================================== + Prints origin and mangle to console screen + Useful for creating good locations for intermission camera's +======================================================================*/ +void() display_playinfo = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + sprint(self,"\b[INFO]\b Org ("); sprint(self,vtos(self.origin)); + sprint(self,") Ang ("); sprint(self,vtos(self.v_angle)); + sprint(self,")\n"); +}; + +/*====================================================================== + Give the player various sigils (serverflag) + Give the player silver/gold keys +======================================================================*/ +void(float sigil_bit) givesigil = +{ + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + dprint("\b[SIGIL]\b Server updated ("); + dprint(ftos(sigil_bit)); dprint(")\n"); + if (sigil_bit & SVR_RUNE_KEY1) update_configflag(SVR_RUNE_KEY1,TRUE); + if (sigil_bit & SVR_RUNE_KEY2) update_configflag(SVR_RUNE_KEY2,TRUE); + if (sigil_bit & SVR_RUNE_KEY3) update_configflag(SVR_RUNE_KEY3,TRUE); + if (sigil_bit & SVR_RUNE_KEY4) update_configflag(SVR_RUNE_KEY4,TRUE); +}; + +//---------------------------------------------------------------------- +void(float key_bit) givekey = +{ + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + dprint("\b[KEYS]\b Inventory updated ("); + dprint(ftos(key_bit)); dprint(")\n"); + if (key_bit & IT_KEY1) self.items = self.items | IT_KEY1; + if (key_bit & IT_KEY2) self.items = self.items | IT_KEY2; +}; + +/*====================================================================== + TOGGLE auto aim feature (default OFF) +======================================================================*/ +//---------------------------------------------------------------------- +void() toggleautoaim = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable + if (autoaim_cvar >= 1) autoaim_cvar = 0.93; + else autoaim_cvar = 1; + cvar_set("sv_aim", ftos(autoaim_cvar)); + + sprint(self, "\b[Impulse]\b Auto aim state ("); + if (autoaim_cvar < 1) sprint(self, "ON)\n"); + else sprint(self, "OFF)\n"); +}; + +//---------------------------------------------------------------------- +void() toggleprojsize = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the global variable + if (playerprojsize == 1) playerprojsize = 0; + else playerprojsize = 1; + + sprint(self, "\b[Impulse]\b Player proj size ("); + if (playerprojsize == 1) sprint(self, "SMALL)\n"); + else sprint(self, "LARGE)\n"); +}; + + +/*====================================================================== + TOGGLE Z aware monsters (default ON) +======================================================================*/ +void() togglezaware = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_ZAWARE)) update_configflag(SVR_ZAWARE, FALSE); + else update_configflag(SVR_ZAWARE, TRUE); + + sprint(self, "\b[Impulse]\b Z Aware Monsters ("); + if (query_configflag(SVR_ZAWARE)) sprint(self, "Disabled)\n"); + else sprint(self, "Enabled)\n"); +}; + +/*====================================================================== + TOGGLE footsteps (default ON) +======================================================================*/ +void() togglefootstep = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_FOOTSTEP)) update_configflag(SVR_FOOTSTEP, FALSE); + else update_configflag(SVR_FOOTSTEP, TRUE); + + sprint(self, "\b[Impulse]\b footsteps ("); + if (query_configflag(SVR_FOOTSTEP)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +/*====================================================================== + TOGGLE Liquid Damage (default ON) +======================================================================*/ +void() toggleliquiddmg = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_LIQDAM)) update_configflag(SVR_LIQDAM, FALSE); + else update_configflag(SVR_LIQDAM, TRUE); + + sprint(self, "\b[Impulse]\b Monster Liquid Damage ("); + if (query_configflag(SVR_LIQDAM)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +/*====================================================================== + TOGGLE AI path extra info (default ON) +======================================================================*/ +void() toggleaipath = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_AIPATH)) update_configflag(SVR_AIPATH, FALSE); + else update_configflag(SVR_AIPATH, TRUE); + + sprint(self, "\b[Impulse]\b Path Corner Arrows ("); + if (query_configflag(SVR_AIPATH)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); + sprint(self, "Reload / Quickload map to see changes!\n"); +}; + +/*====================================================================== + TOGGLE SG Projectiles (default ON) +======================================================================*/ +void() toggleshotgunproj = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_SHOTGPROJ)) update_configflag(SVR_SHOTGPROJ, FALSE); + else update_configflag(SVR_SHOTGPROJ, TRUE); + + sprint(self, "\b[Impulse]\b Shotgun Projectiles ("); + if (query_configflag(SVR_SHOTGPROJ)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +/*====================================================================== + TOGGLE SG Casings (default ON) +======================================================================*/ +void() toggleshotguncase = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_SHOTGCASE)) update_configflag(SVR_SHOTGCASE, FALSE); + else update_configflag(SVR_SHOTGCASE, TRUE); + + sprint(self, "\b[Impulse]\b Shotgun Casing ("); + if (query_configflag(SVR_SHOTGCASE)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + + + +/*====================================================================== + TOGGLE texture pixel mode (linear = blurry, nearest = crispy) +======================================================================*/ +void() togglepixels = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b texture filtering ("); + if (pixelmode == TRUE) { + pixelmode = FALSE; + stuffcmd(self, "\ngl_texturemode GL_LINEAR_MIPMAP_LINEAR\n"); + sprint(self, "blurry)\n"); + } + else { + pixelmode = TRUE; + stuffcmd(self, "\ngl_texturemode GL_NEAREST_MIPMAP_LINEAR\n"); + sprint(self, "crispy)\n"); + } +}; + + +//---------------------------------------------------------------------- +void() togglecoopartifacts = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Drop Artifacts ("); + if (coop_artifacts == TRUE) { + coop_artifacts = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_artifacts = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecoopweapons = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Weapons Respawn ("); + if (coop_weapons == TRUE) { + coop_weapons = FALSE; + sprint(self, "ON)\n"); + } + else { + coop_weapons = TRUE; + sprint(self, "OFF)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecoopammoboxes = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Ammo Boxes Respawn ("); + if (coop_ammoboxes == TRUE) { + coop_ammoboxes = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_ammoboxes = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecoophealth = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Health Packs Respawn ("); + if (coop_health == TRUE) { + coop_health = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_health = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() togglecooppowerups = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (coop == FALSE) { + sprint(self,"\b[IMPULSE]\b Only works when COOP active!\n"); + return; + } + + self.impulse = 0; + sprint(self, "\b[SETTINGS]\b COOP Powerups Respawn ("); + if (coop_powerups == TRUE) { + coop_powerups = FALSE; + sprint(self, "OFF)\n"); + } + else { + coop_powerups = TRUE; + sprint(self, "ON)\n"); + } +}; + +//---------------------------------------------------------------------- +void() update_weather = +{ + // Check for advanced engines + if (ext_active) { + // FTE/QSS only supports one console command for weather + // Engine does not remember setting and resets it + if (checkextension("FTE_SV_POINTPARTICLES")) + if (query_configflag(SVR_WEATHER)) + stuffcmd(self, "\nr_part_rain 0\n"); + else stuffcmd(self, "\nr_part_rain 1\n"); + else { + // DP engine remembers rain/snow weather settings + // DP has separate commands for weather types + if (query_configflag(SVR_WEATHER)) { + // Weather disabled + stuffcmd(self, "\ncl_particles_rain 0\n"); + stuffcmd(self, "\ncl_particles_snow 0\n"); + } + else { + // Weather enabled + stuffcmd(self, "\ncl_particles_rain 1\n"); + stuffcmd(self, "\ncl_particles_snow 1\n"); + } + } + } +}; + +//---------------------------------------------------------------------- +void() toggleweather = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + // Enhanced engines enabled? + if (!ext_active) { + sprint(self,"\b[Impulse]\b Engine does not support weather.\n"); + return; + } + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_WEATHER)) update_configflag(SVR_WEATHER, FALSE); + else update_configflag(SVR_WEATHER, TRUE); + + sprint(self, "\b[Impulse]\b Particle weather system ("); + if (query_configflag(SVR_WEATHER)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); + update_weather(); +}; + +//---------------------------------------------------------------------- +void() togglebodyremoval = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + + self.impulse = 0; + + // Toggle body removal/fade system timer + // default = time + 10 + random() * 5 + if (map_bodyfadeaway > 0) map_bodyfadeaway = 0; + else map_bodyfadeaway = 5; + + sprint(self, "\b[Impulse]\b Monster body removal ("); + if (map_bodyfadeaway > 0) sprint(self, "ON)\n"); + else sprint(self, "OFF)\n"); +}; + + +/*====================================================================== + Require DEVELOPER mode to be active +======================================================================*/ +void() toggleupgradeaxe = +{ + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + if (self.moditems & IT_UPGRADE_AXE) { + dprint("\b[Impulse]\b Shadow Axe Removed\n"); + self.moditems = self.moditems - IT_UPGRADE_AXE; + } + else { + dprint("\b[Impulse]\b Shadow Axe Added\n"); + self.moditems = self.moditems | IT_UPGRADE_AXE; + } + + if (self.weapon == IT_AXE) W_SetCurrentAmmo(self); +}; + +//---------------------------------------------------------------------- +void() toggleupgradessg = +{ + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + if (self.moditems & IT_UPGRADE_SSG) { + dprint("\b[Impulse]\b Widowmaker Shotgun Removed\n"); + self.moditems = self.moditems - IT_UPGRADE_SSG; + } + else { + dprint("\b[Impulse]\b Widowmaker Shotgun Added\n"); + self.moditems = self.moditems | IT_UPGRADE_SSG; + } + + // make sure player VIEW model is up to date + if (self.weapon == IT_SUPER_SHOTGUN) W_SetCurrentAmmo(self); +}; + +//---------------------------------------------------------------------- +void() toggleupgradelg = +{ + // Default return conditions (must be player and developer) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + if (self.moditems & IT_UPGRADE_LG) { + dprint("\b[Impulse]\b Plasma Gun Removed\n"); + self.moditems = self.moditems - IT_UPGRADE_LG; + } + else { + dprint("\b[Impulse]\b Plasma Gun Added\n"); + self.moditems = self.moditems | IT_UPGRADE_LG; + } + + // make sure player VIEW model is up to date + if (self.weapon == IT_LIGHTNING) W_SetCurrentAmmo(self); +}; + +//---------------------------------------------------------------------- +void() toggledevhelpers = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + + // Toggle the state of the console variable using the server flag + if (query_configflag(SVR_DEVHELPER)) update_configflag(SVR_DEVHELPER, FALSE); + else update_configflag(SVR_DEVHELPER, TRUE); + + sprint(self, "\b[Impulse]\b Dev Helpers are ("); + if (query_configflag(SVR_DEVHELPER)) sprint(self, "OFF)\n"); + else sprint(self, "ON)\n"); +}; + +//---------------------------------------------------------------------- +void() CycleParticleDebug = +{ + // Default return conditions (must be player) + if ( !(self.flags & FL_CLIENT) ) return; + if (developer == 0) { + sprint(self,"\b[IMPULSE]\b Only works in developer mode!\n"); + return; + } + + self.impulse = 0; + + part_debug = part_debug + 1; + if (part_debug > PARTICLE_DEBUGMAX) part_debug = 0; + + sprint(self, "\b[Impulse]\b Particle debug level ("); + sprint(self, ftos(part_debug)); + sprint(self, ")\n"); +}; + + +/*====================================================================== + IMPULSE 9 + Gives the player certain weapons and ammo (CHEAT COMMAND) +======================================================================*/ +void() CheatCommand = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 9]\b Weapon Cheat Command\n"); + dprint("- Use Impulse 245 to get silver/gold keys!\n"); + self.impulse = 0; + self.ammo_rockets = 100; + self.ammo_nails = 150; + self.ammo_shells = 150; + self.ammo_cells = 150; + self.ammo_lava_nails = 200; + self.ammo_multi_rockets = 100; + self.ammo_plasma = 100; + self.ammo_bolts = 100; + self.ammo_poison = 100; + + self.moditems = self.moditems | IT_UPGRADE_AXE | IT_UPGRADE_SSG | IT_UPGRADE_LG; + self.items = self.items | IT_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN | + IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | IT_LIGHTNING | IT_LAVA_NAILGUN | IT_LAVA_SUPER_NAILGUN | IT_MULTI_GRENADE | IT_MULTI_ROCKET | IT_PLASMA_GUN | IT_EXTRA_WEAPON; + self.items2 = self.items2 | IT2_ARMOR3 | IT2_PROXIMITY_GUN | IT2_MJOLNIR | IT2_LASER_CANNON; + self.weapon = IT2_LASER_CANNON; + self.armorvalue = 150; + W_SetCurrentAmmo (self); +}; + +/*====================================================================== + IMPULSE 250 +======================================================================*/ +void() SharpshooterCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 250]\b Sharp Shooter Cheat\n"); + self.impulse = 0; + self.sharpshoot_time = 1; + self.sharpshoot_finished = time + POWERUP_TIMER; + self.items = self.items | IT_QUAD; + self.moditems = self.moditems | IT_ARTSHARP; +}; + +/*====================================================================== + IMPULSE 251 +======================================================================*/ +void() NailPiercerCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 251]\b Nail Piercer Cheat\n"); + self.impulse = 0; + self.nailpiercer_time = 1; + self.nailpiercer_finished = time + POWERUP_TIMER; + self.items = self.items | IT_QUAD; + self.moditems = self.moditems | IT_ARTPIERCE; +}; + +/*====================================================================== + IMPULSE 252 +======================================================================*/ +void() EnvSuitCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 252]\b Environmental Suit Cheat\n"); + self.impulse = 0; + self.rad_time = 1; + self.radsuit_finished = time + POWERUP_TIMER; + self.items = self.items | IT_SUIT; +}; + +/*====================================================================== + IMPULSE 253 +======================================================================*/ +void() PentagramCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 253]\b Pentagram of Protection Cheat\n"); + self.impulse = 0; + self.invincible_time = 1; + self.invincible_finished = time + POWERUP_TIMER; + self.items = self.items | IT_INVULNERABILITY; +}; + +/*====================================================================== + IMPULSE 254 +======================================================================*/ +void() InvisibleCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 254]\b Ring of Shadows Cheat\n"); + self.impulse = 0; + self.invisible_time = 1; + self.invisible_finished = time + POWERUP_TIMER; + self.items = self.items | IT_INVISIBILITY; +}; + +/*====================================================================== + IMPULSE 255 +======================================================================*/ +void() QuadDamageCheat = +{ + if (intermission_running) return; // intermission or finale + if (deathmatch || coop) return; + + dprint("\b[Impulse 255]\b Quad Damage Cheat\n"); + self.impulse = 0; + self.super_time = 1; + self.super_damage_finished = time + POWERUP_TIMER; + self.items = self.items | IT_QUAD; +}; diff --git a/QC_other/QC_keep/sounds.qc b/QC_other/QC_keep/sounds.qc new file mode 100644 index 00000000..ef0044a4 --- /dev/null +++ b/QC_other/QC_keep/sounds.qc @@ -0,0 +1,521 @@ +/*====================================================================== + SOUND functions +======================================================================*/ +float SOUND_PLAYONCE = 2; // When triggered plays once + +//---------------------------------------------------------------------- +void() ambient_sound_setup = +{ + if (self.volume > 1) self.volume = 1; + ambientsound (self.origin, self.noise, self.volume, ATTN_STATIC); +}; + +/*============================================================================ +/*QUAKED ambient_custom_loop (0.3 0.1 0.6) (-16 -16 -8) (16 16 8) x +Custom ambient (must be looped) sound, CANNOT toggle/switch state +-------- KEYS -------- +volume : volume of sound (default 1, capped at 1) +noise : custom sound to play (looped) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Custom ambient (must be looped) sound, CANNOT toggle/switch state +============================================================================*/ +void() ambient_custom_loop = +{ + // Check for sound file + if (self.noise == "") { + dprint("\b[AMB_CUSTOM_LOOP]\b Missing sound file\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_comp_hum = +{ + self.noise = "ambience/comp1.wav"; + precache_sound (self.noise); + self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_drip = +{ + self.noise = "ambience/drip1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_drone = +{ + self.noise = "ambience/drone6.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_flouro_buzz = +{ + self.noise = "ambience/buzz1.wav"; + precache_sound (self.noise); + self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_light_buzz = +{ + self.noise = "ambience/fl_hum1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_suck_wind = +{ + self.noise = "ambience/suck1.wav"; + precache_sound (self.noise); + self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_swamp1 = +{ + self.noise = "ambience/swamp1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_swamp2 = +{ + self.noise = "ambience/swamp2.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_thunder = +{ + self.noise = "ambience/thunder1.wav"; + precache_sound (self.noise); + self.volume = 0.5; + ambient_sound_setup(); +}; + +//====================================================================== +/*QUAKED ambient_custom_sound (0.5 0.1 0.8) (-16 -16 -8) (16 16 8) x PLAYONCE x x x x STARTOFF x +Play a sound on a periodic basis +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : targets to trigger each time sound is played +volume : volume of sound (default 1, capped at 1) +noise : primary sound (ambience/windgust1a.wav) +noise1 : stop sound (anbience/switch_6off.wav) +noise2 : random sound (ambience/windgust1b.wav) +wait : random time between sounds (default 20, =-1 no random element) +delay : minimum time between sounds (default 2) +waitmin : Starting time (waitmin + random() x waitmin, =-1 no delay) +waitmin2: 1 = Will not silence any playing sound if switching off +impulse : channel on which to play sound (0-7) (0 automatic is default) +speed : attenuation -1=no attenuation, 1=normal (default), 2=idle, 3=static, 4=quiet +-------- SPAWNFLAGS -------- +PLAYONCE : When triggered plays once +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Play a sound on a periodic basis +*/ +//====================================================================== +void() ambient_custom_stop = +{ + // Cannot block via entity state because there is an 'off sound' + // Need to check against entity internal state for off state + if (self.state == STATE_OFF) return; + + // Switch off sound emitter, clear next think + self.state = STATE_OFF; + self.think = SUB_Null; + self.nextthink = time + 0.1; + + // Catch play once/disable setting separate + if (self.estate & ESTATE_DISABLE) return; + + // Check for OFF sound, else play silence to clear sound + if (self.noise1 != "") + sound (self, self.impulse, self.noise1, self.volume, self.speed); + else { + // If aflag is defined, do not cut off sound + if (!self.waitmin2) sound (self, self.impulse, SOUND_EMPTY, self.volume, self.speed); + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_play = +{ + // Block everything except ON entity state + if (self.estate & ESTATE_BLOCK) return; + + // Internal state used for switch off sound + self.state = STATE_ON; + + // Check for random volume changes + if (self.t_width > 0) { + self.volume = self.t_width + (random() * self.t_length); + if (self.volume > 1) self.volume = 1; + } + + // Check for weather system? + if (self.check_weather == TRUE) { + // Check if weather system still active? + if (!query_configflag(SVR_WEATHER)) { + // never has multiple sounds + sound (self, self.impulse, self.noise, self.volume, self.speed); + } + } + else { + // Check for multiple random sounds + if (self.noise2 != "" && random() < 0.5) + sound (self, self.impulse, self.noise2, self.volume, self.speed); + else sound (self, self.impulse, self.noise, self.volume, self.speed); + + // If any targets defined, trigger them + if (self.target != "") trigger_strs(self.target, self); + } + + // Keep playing sound? + // If sound is setup to play once, don't turn off sound before finished + // Let the sound play out and switch off ambient sound entity + if (self.spawnflags & SOUND_PLAYONCE) self.estate = ESTATE_DISABLE; + else { + // Check for any random time element + if (self.wait == 0) self.nextthink = time + self.delay; + else self.nextthink = time + self.delay + random()*self.wait; + self.think = ambient_custom_play; + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove spawnflag and switch ON entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.estate_on(); + } + else { + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // Toggle state of ambient sound to start/stop + if (self.state == STATE_OFF) self.estate_on(); + else self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_on = +{ + self.estate = ESTATE_ON; + ambient_custom_play(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_off = +{ + self.estate = ESTATE_OFF; + ambient_custom_stop(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_disable = +{ + self.state = STATE_OFF; + sound (self, self.impulse, SOUND_EMPTY, self.volume, self.speed); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_sound = +{ + // Check for sound file + if (self.noise == "") { + dprint("\b[AMBIENT_SOUND]\b Missing sound file at "); + dprint(vtos(self.origin)); dprint("\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + precache_sound (self.noise); + + // Is there an OFF sound defined (used for toggle sounds) + if (self.noise1 != "") precache_sound (self.noise1); + + // Is there any random alternative sounds + if (self.noise2 != "") precache_sound (self.noise2); + + self.classtype = CT_SOUNDEMITTER; + if (self.volume <= 0 || self.volume > 1) self.volume = 1; + + // Setup defaults for sound waits (-1=no random element) + if (self.wait == 0) self.wait = 20; + if (self.wait < 0) self.wait = 0; + + if (self.delay <= 0) self.delay = 2; + if (self.waitmin == 0) self.waitmin = 4; + if (self.impulse <= 0) self.impulse = 1; + + // attenuation -1=no attenuation, 1=normal (default), 2=idle, 3=static, 4=quiet + if (self.speed < 0) self.speed = ATTN_NONE; + else if (self.speed == 2) self.speed = ATTN_IDLE; + else if (self.speed == 3) self.speed = ATTN_STATIC; + else if (self.speed == 4) self.speed = ATTN_QUIET; + else self.speed = ATTN_NORM; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = ambient_custom_on; + self.estate_off = ambient_custom_off; + self.estate_use = ambient_custom_use; + self.estate_disable = ambient_custom_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + if (self.waitmin > 0) { + self.nextthink = time + self.waitmin + random()*self.waitmin; + self.think = self.estate_on; + } + else self.estate_on(); + } +}; + +//---------------------------------------------------------------------- +void() ambient_custom_water = +{ + if (self.noise == "") self.noise = "ad171/ambience/water1.wav"; + if (!self.volume) self.volume = 0.75; + ambient_custom_loop(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_rain = +{ + if (self.count == 1) { + // Long dripping water sound + self.noise = "ad171/ambience/rain1_nl.wav"; + if (!self.speed) self.speed = 2; + if (!self.volume) self.volume = 0.4; + // Sound is 7s long, 0.1s for overlap + self.delay = 6.9; + } + else { + // Very short intense rain sound + self.noise = "ad171/ambience/rain2_nl.wav"; + if (!self.speed) self.speed = 1; + if (!self.volume) self.volume = 0.5; + // Sound is 3s long, 0.1s for overlap + self.delay = 2.9; + } + + self.wait = -1; // pretend loop, no pause + self.waitmin = -1; // No start delay + self.check_weather = TRUE; // Keep checking weather system + + // Always start off, must be triggered + self.spawnflags = ENT_STARTOFF; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_rumble = +{ + // Always precache all sounds and then randomly pick one + // load/save games will always generate new random selection + // and that will produce cache errors everytime + precache_sound ("ad171/ambience/rumble1.wav"); + precache_sound ("ad171/ambience/rumble2.wav"); + precache_sound ("ad171/ambience/rumble3.wav"); + + // Pick a random sound to start with + if (self.count < 0) self.count = random()*3; + + // Setup sound wav names + if (self.count <= 1) { + self.noise = "ad171/ambience/rumble1.wav"; + // Pick an alternative random sound + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/rumble2.wav"; + else self.noise2 = "ad171/ambience/rumble3.wav"; + } + } + else if (self.count <= 2) { + self.noise = "ad171/ambience/rumble2.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/rumble1.wav"; + else self.noise2 = "ad171/ambience/rumble3.wav"; + } + } + else { + self.noise = "ad171/ambience/rumble3.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/rumble1.wav"; + else self.noise2 = "ad171/ambience/rumble2.wav"; + } + } + + // Default values for rumble + if (!self.volume) { self.t_width = 0.5; self.t_length = 0.5; } + if (!self.speed) self.speed = 1; + if (!self.delay) self.delay = 20; + if (!self.wait) self.wait = 20; + if (!self.waitmin) self.waitmin = 6 + random()*6; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_wind = +{ + // Always precache all sounds and then randomly pick one + // load/save games will always generate new random selection + // and that will produce cache errors everytime + precache_sound ("ad171/ambience/windgust1.wav"); + precache_sound ("ad171/ambience/windgust2.wav"); + precache_sound ("ad171/ambience/windgust3.wav"); + precache_sound ("ad171/ambience/windgust4.wav"); + precache_sound ("ad171/ambience/windgust5.wav"); + precache_sound ("ad171/ambience/windgust6.wav"); + + // Pick a random sound to start with + if (self.count < 0) self.count = random()*6; + + // Setup sound wav names + if (self.count <= 1) { + self.noise = "ad171/ambience/windgust1.wav"; + // Pick an alternative random sound + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/windgust2.wav"; + else self.noise2 = "ad171/ambience/windgust3.wav"; + } + } + else if (self.count <= 2) { + self.noise = "ad171/ambience/windgust2.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/windgust1.wav"; + else self.noise2 = "ad171/ambience/windgust3.wav"; + } + } + else if (self.count <= 3) { + self.noise = "ad171/ambience/windgust3.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/windgust1.wav"; + else self.noise2 = "ad171/ambience/windgust2.wav"; + } + } + else if (self.count <= 4) { + self.noise = "ad171/ambience/windgust4.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/windgust5.wav"; + else self.noise2 = "ad171/ambience/windgust6.wav"; + } + } + else if (self.count <= 5) { + self.noise = "ad171/ambience/windgust5.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/windgust4.wav"; + else self.noise2 = "ad171/ambience/windgust6.wav"; + } + } + else { + self.noise = "ad171/ambience/windgust6.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/windgust4.wav"; + else self.noise2 = "ad171/ambience/windgust5.wav"; + } + } + + // Default values for wind + if (!self.volume) self.volume = 1; + if (!self.speed) self.speed = 1; + if (!self.delay) self.delay = 10; + if (!self.wait) self.wait = 10; + if (!self.waitmin) self.waitmin = 4 + random()*4; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_wood = +{ + // Always precache all sounds and then randomly pick one + // load/save games will always generate new random selection + // and that will produce cache errors everytime + precache_sound ("ad171/ambience/woodcreak2a.wav"); + precache_sound ("ad171/ambience/woodcreak2b.wav"); + precache_sound ("ad171/ambience/woodcreak2c.wav"); + precache_sound ("ad171/ambience/woodcreak2d.wav"); + + // Pick a random sound to start with + if (self.count < 0) self.count = random()*4; + + if (self.count <= 1) { + self.noise = "ad171/ambience/woodcreak2a.wav"; + // Pick an alternative random sound + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/woodcreak2b.wav"; + else self.noise2 = "ad171/ambience/woodcreak2c.wav"; + } + } + else if (self.count <= 2) { + self.noise = "ad171/ambience/woodcreak2b.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/woodcreak2c.wav"; + else self.noise2 = "ad171/ambience/woodcreak2d.wav"; + } + } + else if (self.count <= 3) { + self.noise = "ad171/ambience/woodcreak2c.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/woodcreak2a.wav"; + else self.noise2 = "ad171/ambience/woodcreak2d.wav"; + } + } + else { + self.noise = "ad171/ambience/woodcreak2d.wav"; + if (self.lefty) { + if (random() < 0.5) self.noise2 = "ad171/ambience/woodcreak2a.wav"; + else self.noise2 = "ad171/ambience/woodcreak2b.wav"; + } + } + + // Default values for wood + if (!self.volume) self.volume = 1; + if (!self.speed) self.speed = 2; + if (!self.delay) self.delay = 15; + if (!self.wait) self.wait = 30; + if (!self.waitmin) self.waitmin = 8 + random()*8; + + // Back into main function + ambient_custom_sound(); +}; + +//---------------------------------------------------------------------- +void() ambient_custom_chime = +{ + if (self.noise == "") self.noise = "ad171/ambience/chimes.wav"; + if (!self.speed) self.speed = 2; + if (!self.volume) self.volume = 1; + if (!self.wait) self.wait = 10; + if (!self.delay) self.delay = 10; + if (!self.waitmin) self.waitmin = 10 + random()*10; + if (!self.waitmin2) self.waitmin2 = -1; + + // Back into main function + ambient_custom_sound(); +}; diff --git a/QC_other/QC_keep/soundskeep.qc b/QC_other/QC_keep/soundskeep.qc new file mode 100644 index 00000000..65be9f7b --- /dev/null +++ b/QC_other/QC_keep/soundskeep.qc @@ -0,0 +1,257 @@ +float SOUND_ALTVERSION = 4; +float SOUND_EXTENSION1 = 16; + +void() SuperDamageSound = { + if (self.super_damage_finished > time) + { + if (self.super_sound < time) + { + self.super_sound = time + 1; + sound (self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM); + } + } + return; +}; + +void() ambient_drain = { + self.noise = "ambience/drain.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_eerie = { + self.noise = "ambience/rych1.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_factory = { + self.noise = "ambience/factory.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_fan_blowing = { + self.noise = "ambience/fanblow.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_flies = { + self.noise = "ambience/bugs.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_flys = { + self.noise = "misc/flys.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_grinder = { + self.noise = "ambience/grinder.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_highwind = { + self.noise = "ambience/highwind.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + self.count = 99; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_humming = { + if (self.spawnflags & SOUND_ALTVERSION) { + self.noise = "ambience/maydn.wav"; // Support for Nehahra ambient_humming + if (self.volume <= 0) self.volume = 0.5; + } else { + self.noise = "ambience/humming.wav"; + if (self.volume <= 0) self.volume = 0.5; + } + precache_sound (self.noise); + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_hum1 = { + self.noise = "ambience/hum1.wav"; + if (self.volume <= 0) self.volume = 0.5; + precache_sound (self.noise); + ambient_sound_setup(); +}; +void() ambient_lapping = { + self.noise = "ambience/wat_amb.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + self.count = 99; + ambient_sound_setup(); +}; +void() ambient_lapping2 = { + self.noise = "ambience/wat_cave.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + self.count = 99; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_machines = { + self.noise = "ambience/begths.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_nehum = { + self.noise = "ambience/filt.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_rain = { + if (self.count == 0) + self.noise = "ambience/rain.wav"; // Rain Runoff + + if (self.count == 1) + self.noise = "ambience/rain3.wav"; // Steady Rain + + if (self.count == 2) + self.noise = "ambience/rain2.wav"; // Heavy Rain + + if (self.count > 2 || self.count < 0) + self.noise = "ambience/rain3.wav"; + + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_riftpower = { + self.noise = "ambience/riftpowr.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_running_lava = { + self.noise = "ambience/runlava.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_running_water = { + self.noise = "ambience/runwater.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_rushing = { + self.noise = "ambience/rushing.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_sizzle = { + self.noise = "ambience/amsizl.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +void() ambient_stargate_hum = { + self.noise = "ambience/sgatehum.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + self.count = 99; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_swamp3 = { + self.noise = "ambience/swamp3.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_teeth = { + self.noise = "ambience/teeth.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_teleport = { + self.noise = "ambience/hum1.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_thrum = { + self.noise = "ambience/thrum.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() thunder_go_boom = { + if (random() < 0.5) { + sound(self, CHAN_AUTO, self.noise, self.volume, ATTN_NONE); + SUB_UseTargets(); + } else { + sound(self, CHAN_AUTO, self.noise3, self.volume, ATTN_NONE); + SUB_UseTargets(); + } + self.think = thunder_go_boom; + if (self.spawnflags & SOUND_EXTENSION1) { + self.nextthink = time + self.wait * random(); + } else { + self.nextthink = time + self.wait; + } +} +//void() ambient_water_drip = { +// self.noise = "ambience/wat_drip.wav"; // !! wat_drip.wav DOES NOT EXIST!! +// precache_sound (self.noise); +// if (self.volume <= 0) self.volume = 1; +// self.count = 99; +// ambient_sound_setup(); +//}; +//---------------------------------------------------------------------- +void() ambient_waterfall = { + self.noise = "ambience/waterfal.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 0.5; + ambient_sound_setup(); +}; +void() ambient_water_fall = { + self.noise = "ambience/wat_fall.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + self.count = 99; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_whnoise = { + self.noise = "ambience/whn.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; +//---------------------------------------------------------------------- +void() ambient_zzxzz = { + self.noise = "ambience/flash.wav"; + precache_sound (self.noise); + if (self.volume <= 0) self.volume = 1; + ambient_sound_setup(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/sprites.qc b/QC_other/QC_keep/sprites.qc new file mode 100644 index 00000000..fe889a04 --- /dev/null +++ b/QC_other/QC_keep/sprites.qc @@ -0,0 +1,26 @@ + +// these are the only sprites still in the game... + +$spritename s_explod +$type vp_parallel +$load id1/gfx/sprites/explod03.lbm +$frame 24 24 56 56 +$frame 120 24 56 56 +$frame 216 24 56 56 +$frame 24 88 56 56 +$frame 120 88 56 56 +$frame 216 88 56 56 + + +$spritename s_bubble +$type vp_parallel +$load id1/gfx/sprites/bubble.lbm +$frame 16 16 16 16 +$frame 40 16 16 16 + + +$spritename s_light +$type vp_parallel +$load id1/gfx/sprites/light.lbm +$frame 104 32 32 32 + diff --git a/QC_other/QC_keep/subs.qc b/QC_other/QC_keep/subs.qc new file mode 100644 index 00000000..63aac91d --- /dev/null +++ b/QC_other/QC_keep/subs.qc @@ -0,0 +1,1348 @@ +/*====================================================================== + SUB FUNCTIONS +======================================================================*/ +void() SUB_Null = {}; +void() SUB_Remove = {remove(self);}; +void(entity inflictor, entity attacker, float damage) SUB_Null_pain = {}; + +void() SUB_CalcMoveDone; +void() SUB_CalcAngleMoveDone; +void(vector marker_org, float marker_type) spawn_marker; + +//====================================================================== +// To determine if an entity is still active this function generates +// an unique number that can be checked/shared between linked entities +//---------------------------------------------------------------------- +void(entity targ) gen_unique_no = +{ + // Check if target entity has an unique number already + if (targ.entno_unique == 0) + targ.entno_unique = rint(random()*1000) * rint(random()*1000); +}; + +//====================================================================== +// Most of the monsters have an attack_offset setup to spawn their +// proejctiles in the right location relative to their gun model +// This function expects the makevectors has been done already +// makevectors (self.angles); <--- if missing, vector will be rubbish! +//---------------------------------------------------------------------- +vector(vector attack_dir) attack_vector = +{ + local vector retvec; + retvec = v_forward * attack_dir_x; + retvec = retvec + (v_right * attack_dir_y); + retvec = retvec + (v_up * attack_dir_z); + return retvec; +}; + +//====================================================================== +// Bmodels have a 0,0,0 origin key, need to calculate from mins/maxs +// This function will return the true origin using mins/max vectors +//---------------------------------------------------------------------- +vector(entity bmodel_ent) bmodel_origin = +{ + local vector vdiff, vorigin; + + // Calculate the middle point of the mins/maxs size vectors + vdiff_x = (bmodel_ent.maxs_x - bmodel_ent.mins_x) / 2; + vdiff_y = (bmodel_ent.maxs_y - bmodel_ent.mins_y) / 2; + vdiff_z = (bmodel_ent.maxs_z - bmodel_ent.mins_z) / 2; + + // The mins vector is an absolute value of where the Bmodel is located + // Add mins vector to middle point to get true origin + // When bmodel do move they also update their origin co-ordinates + // So any additional movement needs to be added as well + // This means that bmodels can be tracked by movement functions + vorigin = bmodel_ent.origin + bmodel_ent.mins + vdiff; + + // Return origin + return vorigin; +}; + +//====================================================================== +// Check for bmodel errors, model key empty (can crash engine) +//---------------------------------------------------------------------- +float() check_bmodel_keys = +{ + if (self.model == "") { + // this error can be fatal for most engines, show warning + dprint ("\b[BMODEL]\b "); dprint (self.classname); + dprint (" ("); dprint (self.targetname); + dprint (") missing MODEL key!\n"); + + self.classtype = CT_DEVMARKER; // Useless entity + self.movetype = MOVETYPE_NONE; // Stationary + self.solid = SOLID_NOT; // no world interaction + + // If developer active show yellow diamond + if (developer > 0) setmodel(self, MODEL_BROKEN); + else setmodel(self,""); + + // Make sure no world interaction + setsize (self, VEC_ORIGIN, VEC_ORIGIN); + + // Randomly place debug diamond above 0,0,0 + self.pos1 = '0 0 0'; + self.pos1_z = random()*64; + setorigin(self, self.pos1); + + // Do nothing with this entity + return TRUE; + } + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Cannot have multiple upgrade restrictions on monster/items +//---------------------------------------------------------------------- +void() remove_duplicate_upgrades = +{ + if (self.upgrade_axe) { + if (self.upgrade_ssg) self.upgrade_ssg = FALSE; + else if (self.upgrade_lg) self.upgrade_lg = FALSE; + } + else if (self.upgrade_ssg) { + if (self.upgrade_axe) self.upgrade_axe = FALSE; + else if (self.upgrade_lg) self.upgrade_lg = FALSE; + } + else if (self.upgrade_lg) { + if (self.upgrade_axe) self.upgrade_axe = FALSE; + else if (self.upgrade_ssg) self.upgrade_ssg = FALSE; + } +} + +/*====================================================================== +QuakeEd only writes a single float for angles (bad idea), +so up and down are just constant angles. +======================================================================*/ +void() SetMovedir = +{ + if (self.angles == '0 -1 0') self.movedir = '0 0 1'; + else if (self.angles == '0 -2 0') self.movedir = '0 0 -1'; + else { + makevectors (self.angles); + self.movedir = v_forward; + } + // Bmodels need angles key reset otherwise twisted on spawn + self.angles = '0 0 0'; +}; + +//---------------------------------------------------------------------- +float(vector check_vec) CheckZeroVector = +{ + if (check_vec_x == 0 && check_vec_y == 0 && check_vec_z == 0) + return TRUE; + else return FALSE; +}; + +//---------------------------------------------------------------------- +// Some entities have directional parameters (angles -> movedir) +// This function searches for a target entity (useful for tracking) +// Always finds the first target key (will fail if multiple targets) +//---------------------------------------------------------------------- +void() TargetMovedir = +{ + local entity targ; + local vector org, targorg; + + if (self.target == "") return; + + // Check self for Bmodel origin + if (self.bsporigin) org = bmodel_origin(self); + else org = self.origin; + + // Find target entity + targ = find(world, targetname, self.target); + if (targ) { + // Check for a Bmodel object (special origin) + if (targ.bsporigin) targorg = bmodel_origin(targ); + else targorg = targ.origin; + // Calculate facing angle towards target + self.movedir = normalize(targorg - org); + } +}; + +/*====================================================================== +InitTrigger +======================================================================*/ +void() InitTrigger = +{ + // trigger angles are used for one-way touches. An angle of 0 is assumed + // to mean no restrictions, so use a yaw of 360 instead. + if (CheckZeroVector(self.angles) == FALSE) SetMovedir (); + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + self.mdl = self.model; // Save model for later + setmodel (self, self.mdl); // set size and link into world + self.bbmins = self.mins; // Save bmodel bounds for later + self.bbmaxs = self.maxs; + self.bsporigin = TRUE; // bmodel origin 0,0,0 + self.modelindex = 0; + self.model = ""; // hide bmodel surface +}; + +/*====================================================================== +SUB_CalcMove + +calculate self.velocity and self.nextthink to reach dest from +self.origin traveling at speed +======================================================================*/ +void(vector tdest, float tspeed, void() func) SUB_CalcMove = +{ + local vector vdestdelta; + local float len, traveltime; + + if (!tspeed) tspeed = 40; // Create default speed if none specified + self.think1 = func; // Finished moving function + self.finaldest = tdest; // Final destination + self.think = SUB_CalcMoveDone; // Tidy up function + + vdestdelta = tdest - self.origin; // set destdelta to the vector needed to move + len = vlen (vdestdelta); // calculate length of vector + traveltime = len / tspeed; // divide by speed to get time to reach dest + + // If move distance or time too small, snap to final location + if (traveltime < 0.1 || tdest == self.origin) { + self.velocity = '0 0 0'; + self.nextthink = self.ltime + 0.1; + return; + } + + // scale the destdelta vector by the time spent traveling to get velocity + self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float + self.nextthink = self.ltime + traveltime; +}; + +/*====================================================================== +After moving, set origin to exact final destination +======================================================================*/ +void() SUB_CalcMoveDone = +{ + self.velocity = '0 0 0'; + setorigin(self, self.finaldest); + self.nextthink = -1; + if (self.think1) self.think1(); +}; + +//---------------------------------------------------------------------- +// Not used anywhere +//---------------------------------------------------------------------- +void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = +{ + local entity stemp; + stemp = self; + self = ent; + + SUB_CalcMove (tdest, tspeed, func); + self = stemp; +}; + +/*====================================================================== +SUB_CalcMoveEntity + +calculate self.velocity and self.nextthink to reach dest from +self.origin traveling at speed +======================================================================*/ +void() SUB_MoveEntityDone = +{ + self.movetype = self.classmove; + SUB_CalcMoveDone(); +}; + +//---------------------------------------------------------------------- +void(vector tdest, float tspeed, void() func) SUB_CalcMoveEntity = +{ + local vector vdestdelta; + local float traveltime; + + if (!tspeed) tspeed = 4; // Create default travel time if none specified + self.classmove = self.movetype; // save previous movetype + self.movetype = MOVETYPE_FLY; // Allow entity to move smoothly + self.think1 = func; // Store final function + self.finaldest = tdest; // Store final destination + + vdestdelta = tdest - self.origin; // set destdelta to the vector needed to move + traveltime = 1 / tspeed; // Work out percentage travel velocity + self.velocity = vdestdelta * traveltime; // Calc time travel fraction + + self.nextthink = time + tspeed; + self.think = SUB_MoveEntityDone; +}; + +/*====================================================================== +SUB_CalcAngleMove + +calculate self.avelocity and self.nextthink to reach destangle from +self.angles rotating + +The calling function should make sure self.think is valid +======================================================================*/ +void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = +{ +local vector destdelta; +local float len, traveltime; + + if (!tspeed) dprint("[SUB_CALC_ANGLE] No speed is defined!"); + + // set destdelta to the vector needed to move + destdelta = destangle - self.angles; + + // calculate length of vector + len = vlen (destdelta); + + // divide by speed to get time to reach dest + traveltime = len / tspeed; + + // set nextthink to trigger a think when dest is reached + self.nextthink = self.ltime + traveltime; + + // scale the destdelta vector by the time spent traveling to get velocity + self.avelocity = destdelta * (1 / traveltime); + + self.think1 = func; + self.finalangle = destangle; + self.think = SUB_CalcAngleMoveDone; +}; + +/*====================================================================== +After rotating, set angle to exact final angle +======================================================================*/ +void() SUB_CalcAngleMoveDone = +{ + self.angles = self.finalangle; + self.avelocity = '0 0 0'; + self.nextthink = -1; + if (self.think1) + self.think1(); +}; + +//---------------------------------------------------------------------- +// Not used anywhere +//---------------------------------------------------------------------- +void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = +{ + local entity stemp; + stemp = self; + self = ent; + SUB_CalcAngleMove (destangle, tspeed, func); + self = stemp; +}; + +//---------------------------------------------------------------------- +void() DelayThink = +{ + activator = self.enemy; + SUB_UseTargets (); + remove(self); +}; + +/*====================================================================== +SUB_UseTargets + +the global "activator" should be set to the entity that initiated the firing. + +If self.delay is set, a DelayedUse entity will be created that will actually +do the SUB_UseTargets after that many seconds have passed. + +Centerprints any self.message to the activator. + +Removes all entities with a targetname that match self.killtarget, +and removes them, so some events can remove other triggers. + +Search for (string)targetname in all entities that +match (string)self.target and call their .use function + +======================================================================*/ +void() SUB_UseTargets = +{ + local entity t, stemp, otemp, act; + + // -Qmaster - removed the following check due to the fact that it breaks certain hacks and logic (e.g. the high animation rate func_wall hack by Preach) + //---------------------------------------------------------------------- + // Check for recursive loops!?! + //---------------------------------------------------------------------- + /*if (self.targetname != "") { + if (self.targetname == self.target || self.targetname == self.target2) { + dprint("\n----------------------------------------\n"); + dprint("\b[USE_TARGET]\b target == targetname, really bad!!!\n"); + dprint(self.classname); + dprint(" ("); dprint(self.targetname); dprint(") at "); + if (self.bsporigin) dprint(vtos(bmodel_origin(self))); + else dprint(vtos(self.origin)); + dprint("\ntarg ("); dprint(self.target); + dprint(") targ2 ("); dprint(self.target2); + dprint(") kill ("); dprint(self.killtarget); + dprint(")\n----------------------------------------\n"); + return; + } + }*/ + //---------------------------------------------------------------------- + // check for a delay + //---------------------------------------------------------------------- + if (self.delay) { + // create a temp object to fire at a later time + t = spawn(); + t.classname = "DelayedUse"; + t.classtype = CT_TRIGRELAYDELAY; + t.owner = self; + t.nextthink = time + self.delay; + t.think = DelayThink; + t.enemy = activator; + t.message = self.message; + t.killtarget = self.killtarget; + t.target = self.target; + t.target2 = self.target2; + t.target3 = self.target3; + t.target4 = self.target4; + t.statetarget1 = self.statetarget1; + t.statetarget2 = self.statetarget2; + t.statetarget3 = self.statetarget3; + t.statetarget4 = self.statetarget4; + t.statetarget5 = self.statetarget5; + t.statetarget6 = self.statetarget6; + t.statetarget7 = self.statetarget7; + t.statetarget8 = self.statetarget8; + t.statetarget9 = self.statetarget9; + t.statetarget10 = self.statetarget10; + t.statetarget11 = self.statetarget11; + t.statetarget12 = self.statetarget12; + t.statetarget13 = self.statetarget13; + t.statetarget14 = self.statetarget14; + t.statetarget15 = self.statetarget15; + t.statetarget16 = self.statetarget16; + t.statetarget17 = self.statetarget17; + t.statetarget18 = self.statetarget18; + t.statetarget19 = self.statetarget19; + t.statetarget20 = self.statetarget20; + t.statetarget21 = self.statetarget21; + t.statetarget22 = self.statetarget22; + t.statetarget23 = self.statetarget23; + t.statetarget24 = self.statetarget24; + t.noise = self.noise; + return; + } + + //---------------------------------------------------------------------- + // Check if previous delay has been disabled + // Unfortunately start off = OFF state and not easy to check for + // because some entities use that spawnflag bit for other things! + //---------------------------------------------------------------------- + if (self.classtype == CT_TRIGRELAYDELAY) { + if (self.owner.estate & ESTATE_DISABLE) return; + } + + //---------------------------------------------------------------------- + // print any messages + //---------------------------------------------------------------------- + if (activator.flags & FL_CLIENT && self.message != "") { + if (coop > 0) { + // Write message to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CENTERPRINT); + WriteString (MSG_ALL, self.message); + } + // Write message to single client + else centerprint (activator, self.message); + // Default noise = classic beep beep sound + if (self.noise == "") sound (activator, CHAN_VOICE, SOUND_TALK, 1, ATTN_NORM); + } + + //---------------------------------------------------------------------- + // kill targets + // I really do hate this function because there is hardly any checks + // on entities being removed, added a player check for sanity! + //---------------------------------------------------------------------- + if (self.killtarget != "") { + t = find (world, targetname, self.killtarget); + while(t) { + // Check for activate mosnters? Tidy up kill counter + if (t.flags & FL_MONSTER && t.health > 0) { + if (!t.nomonstercount) { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + } + } + // Added extra check to prevent player client removal!?! + if (!(t.flags & FL_CLIENT)) { + // Try to minimize the entity chain damage, check for + // entity attachments and delete them as well! + if (t.attachment) remove(t.attachment); + if (t.attachment2) remove(t.attachment2); + if (t.attachment3) remove(t.attachment3); + // Make sure any unique ent number is reset + if (t.entno_unique > 0) t.entno_unique = 0; + // Remove entity from chain list + remove (t); + } + // Find the next killtarget + t = find (t, targetname, self.killtarget); + } + } + //---------------------------------------------------------------------- + // fire targets + //---------------------------------------------------------------------- + if (self.target != "") { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.target); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp; // Switch self/other + self.activate = stemp; // used by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + // Are there anymore targets left in the list? + t = find (t, targetname, self.target); + } + } + //---------------------------------------------------------------------- + if (self.target2 != "") { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.target2); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.target2); + } + } + //---------------------------------------------------------------------- + if (self.target3 != "") { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.target3); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.target3); + } + } + //---------------------------------------------------------------------- + if (self.target4 != "") { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.target4); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.target4); + } + } + //---------------------------------------------------------------------- + if (self.statetarget1 != "" && (globalstate & GLOBALSTATE_1)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget1); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget1); + } + } + //---------------------------------------------------------------------- + if (self.statetarget2 != "" && (globalstate & GLOBALSTATE_2)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget2); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget2); + } + } + //---------------------------------------------------------------------- + if (self.statetarget3 != "" && (globalstate & GLOBALSTATE_3)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget3); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget3); + } + } + //---------------------------------------------------------------------- + if (self.statetarget4 != "" && (globalstate & GLOBALSTATE_4)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget4); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget4); + } + } + //---------------------------------------------------------------------- + if (self.statetarget5 != "" && (globalstate & GLOBALSTATE_5)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget5); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget5); + } + } + //---------------------------------------------------------------------- + if (self.statetarget6 != "" && (globalstate & GLOBALSTATE_6)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget6); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget6); + } + } + //---------------------------------------------------------------------- + if (self.statetarget7 != "" && (globalstate & GLOBALSTATE_7)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget7); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget7); + } + } + //---------------------------------------------------------------------- + if (self.statetarget8 != "" && (globalstate & GLOBALSTATE_8)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget8); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget8); + } + } + //---------------------------------------------------------------------- + if (self.statetarget9 != "" && (globalstate & GLOBALSTATE_9)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget9); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget9); + } + } + //---------------------------------------------------------------------- + if (self.statetarget10 != "" && (globalstate & GLOBALSTATE_10)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget10); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget10); + } + } + //---------------------------------------------------------------------- + if (self.statetarget11 != "" && (globalstate & GLOBALSTATE_11)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget11); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget11); + } + } + //---------------------------------------------------------------------- + if (self.statetarget12 != "" && (globalstate & GLOBALSTATE_12)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget12); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget12); + } + } + //---------------------------------------------------------------------- + if (self.statetarget13 != "" && (globalstate & GLOBALSTATE_13)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget13); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget13); + } + } + //---------------------------------------------------------------------- + if (self.statetarget14 != "" && (globalstate & GLOBALSTATE_14)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget14); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget14); + } + } + //---------------------------------------------------------------------- + if (self.statetarget15 != "" && (globalstate & GLOBALSTATE_15)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget15); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget15); + } + } + //---------------------------------------------------------------------- + if (self.statetarget16 != "" && (globalstate & GLOBALSTATE_16)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget16); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget16); + } + } + //---------------------------------------------------------------------- + if (self.statetarget17 != "" && (globalstate & GLOBALSTATE_17)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget17); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget17); + } + } + //---------------------------------------------------------------------- + if (self.statetarget18 != "" && (globalstate & GLOBALSTATE_18)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget18); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget18); + } + } + //---------------------------------------------------------------------- + if (self.statetarget19 != "" && (globalstate & GLOBALSTATE_19)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget19); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget19); + } + } + //---------------------------------------------------------------------- + if (self.statetarget20 != "" && (globalstate & GLOBALSTATE_20)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget20); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget20); + } + } + //---------------------------------------------------------------------- + if (self.statetarget21 != "" && (globalstate & GLOBALSTATE_21)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget21); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget21); + } + } + //---------------------------------------------------------------------- + if (self.statetarget22 != "" && (globalstate & GLOBALSTATE_22)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget22); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget22); + } + } + //---------------------------------------------------------------------- + if (self.statetarget23 != "" && (globalstate & GLOBALSTATE_23)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget23); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget23); + } + } + //---------------------------------------------------------------------- + if (self.statetarget24 != "" && (globalstate & GLOBALSTATE_24)) { + act = activator; // ID Code - Never switch around, not sure why it is here? + t = find (world, targetname, self.statetarget24); + stemp = self; otemp = other; // Store self/other + while(t) { + if (t.use != SUB_Null) { + if (t.use) { + self = t; other = stemp;// Switch self/other + self.activate = stemp; // used mostly by the breakable system + self.use (); // fire trigger + self = stemp; other = otemp; // restore self/other + activator = act; // ID code - Never changed, why restore it? + } + } + t = find (t, targetname, self.statetarget24); + } + } +}; + +/*====================================================================== + SUB_AttackFinished + in nightmare mode, all attack_finished times become 0 + some monsters refire twice automatically (using .cnt variable) + Change nightmare to be less range spam and better time scaling +======================================================================*/ +void(float normal) SUB_AttackFinished = +{ + local float nightadj; // Easier to work out percentage + self.cnt = 0; // reset checkfire counter + + if (skill == SKILL_NIGHTMARE) { + // Nightmare mode is just endless range attacks! + // I never thought this was a good way to end skill levels + // Changed nightmare mode to 50-75% decrease in time + // Exceptions to nightmare mode (minion spawning) - 75-100% time + nightadj = 0.5 + (random()*0.25); + if (self.minion_active) nightadj = nightadj + 0.25; + // The original ID shamblers were lightning turrets on Nightmare + // Shamblers don't scale with skill levels in AD because + // they don't have projectiles, so they need a switch instead + // On Nightmare skill Shamblers go from 2-4s to 1s! + // Instead of 2-4s, NM is 0.6-1.2s, Average 1.2s +2 frames + if (self.classtype == CT_MONSHAM) nightadj = 0.4; + self.attack_finished = time + (normal*nightadj); + } + // Easy, Nornal and Hard skill all pass through, no change + else self.attack_finished = time + normal; + //dprint("Time ("); dprint(ftos(time)); + //dprint(") AF ("); dprint(ftos(normal)); + //dprint(") Dif ("); dprint(ftos(self.attack_finished - time)); + //dprint(") Att ("); dprint(ftos(self.attack_finished)); + //dprint(")\n"); +}; + +//---------------------------------------------------------------------- +// Used by soliders and enforcers (special double fire mode) +//---------------------------------------------------------------------- +void (void() thinkst) SUB_CheckRefire = +{ + if (skill != SKILL_NIGHTMARE) return; + if (self.cnt == 1) return; + if (!visible (self.enemy)) return; + self.cnt = 1; + self.think = thinkst; +}; + +//---------------------------------------------------------------------- +// Not used anywhere in QC +//---------------------------------------------------------------------- +/*float() SUB_CountTargets = +{ + local entity t; + local float i; + + i = 0; + if (self.target != "") { + t = world; + do { + t = find(t, targetname, self.target); + if (!t) break; + i = i + 1; + } while ( 1 ); + } + return i; +};*/ + +/*====================================================================== + ChooseTurn + - can't find any reference to this in the QC +======================================================================*/ +/*void(vector dest3) ChooseTurn = +{ + local vector dir, newdir; + + dir = self.origin - dest3; + + newdir_x = trace_plane_normal_y; + newdir_y = 0 - trace_plane_normal_x; + newdir_z = 0; + + if (dir * newdir > 0) { + dir_x = 0 - trace_plane_normal_y; + dir_y = trace_plane_normal_x; + } + else { + dir_x = trace_plane_normal_y; + dir_y = 0 - trace_plane_normal_x; + } + + dir_z = 0; + self.ideal_yaw = vectoyaw(dir); +};*/ + +/*====================================================================== + SPAWN_TFOG and SPAWN_TDEATH + + These functions were originally in triggers.qc, but are used all + over the place by monsters, items and players. Subs seems a better + home for these generic functions. + + ======================================================================*/ +void() play_teleport = +{ + self.lip = random() * 5; + if (self.lip < 1) self.noise = "misc/r_tele1.wav"; + else if (self.lip < 2) self.noise = "misc/r_tele2.wav"; + else if (self.lip < 3) self.noise = "misc/r_tele3.wav"; + else if (self.lip < 4) self.noise = "misc/r_tele4.wav"; + else self.noise = "misc/r_tele5.wav"; + + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + self.nextthink = time + 2; // Allow time for the sound to finish + self.think = SUB_Remove; // tidy up function +}; + +//---------------------------------------------------------------------- +void(vector org) spawn_tfog = +{ + local entity spawneffect; + + spawneffect = spawn (); + spawneffect.origin = org; + spawneffect.nextthink = time + 0.2; + spawneffect.think = play_teleport; + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TELEPORT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); +}; + +//---------------------------------------------------------------------- +void() tdeath_touch = +{ + // Cannot telefrag yourself!?! + if (other == self.owner) return; + // Check if found a breakable than cannot be broken + if (ai_foundbreakable(self, other, FALSE)) return; + + // A boss cannot be telefragged (except shub) + // Telefrag entity trying to telefrag boss instead!?! + if (other.bossflag == TRUE) { + if (other.classtype != CT_MONIDSHUB) { + T_Damage (self.owner, other, other, MEGADEATH, NOARMOR); + return; + } + } + + // frag anyone who teleports in on top of an invincible player + if (other.flags & FL_CLIENT) { + if (other.invincible_finished > time) self.classname = "teledeath2"; + // other monsters explode themselves + if ( !(self.owner.flags & FL_CLIENT) ) { + T_Damage (self.owner, self, self, MEGADEATH, NOARMOR); + return; + } + } + + // Sudden death incoming ... + if (other.health) T_Damage (other, self, self, MEGADEATH, NOARMOR); +}; + +//---------------------------------------------------------------------- +void(vector org, entity death_owner) spawn_tdeath = +{ + local entity death; + + death = spawn(); + death.classname = "teledeath"; + death.owner = death_owner; + death.movetype = MOVETYPE_NONE; + death.solid = SOLID_TRIGGER; + death.angles = '0 0 0'; + setsize (death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1'); + setorigin (death, org); + death.touch = tdeath_touch; + death.nextthink = time + 0.2; + death.think = SUB_Remove; + + // This is extremely costly on the engine because it re-checks + // every trigger in the map to see if it is touching something + force_retouch = 2; +}; + +/*====================================================================== + skill_chanceattack + Calculate chance to attack player based on skill level and distance + The standard ID range formula + (enemy_range == RANGE_MELEE) chance = 0.9 + (enemy_range == RANGE_NEAR) chance = 0.4 + (enemy_range == RANGE_MID) chance = 0.05 + else chance = 0; + The problem with this formula is that the chance factor is not gradual + and will spike in chance when close to range boundaries + Also this formula has no skill modifiers leading to limited gameplay rules + +======================================================================*/ +float() SUB_ChanceAttack = +{ + local float chrange, chskill, chance; + + chrange = chskill = 0; // taniwha patch + + // Upper and lower limits of range have fixed chance rates + if (self.enemydist > MON_MAX_RANGE) chance = 0.05; + else if (self.enemydist < MON_RANGE_MELEE) chance = 0.95; + else { + // Random chance of range attack based on player distance + chrange = ((MON_MAX_RANGE - self.enemydist) / MON_STEPRANGE) / 10; + + // Skill modifier to chance (Easy -0.2 Norm -0.1, Hard 0, Night 0.1) + chskill = ((skill-SKILL_HARD)*0.1); + chance = chrange + chskill; + + // There Should always be a chance to HIT or MISS + if (chance > 0.95) chance = 0.95; + else if (chance < 0.05) chance = 0.05; + } + + // Return result and finish debug information line + if (random() < chance) return TRUE; + else return FALSE; +}; + +/*====================================================================== + skill_subattack + Calculate attack_finished time based on skill level +======================================================================*/ +float (float min_time, float ranbase_time) SUB_SkillAttack = +{ + local float ran_time, sub_time; + + // Easy = min + random(base + 1.5) Normal = min + random(base + 1.0) + // Hard = min + random(base + 0.5) Nightm = min + random(base + 0.0) + ran_time = ranbase_time + ((SKILL_NIGHTMARE - skill) * 0.5); + sub_time = min_time + (ran_time * random()); + + return sub_time; +}; + +/*====================================================================== + SUB_Tracking + Progressively tracks the origin of enemies making attacks more accurate + * Original code by Necros (http://shoresofnis.com/) +======================================================================*/ +vector(vector iorg, vector org_offset, entity targ, float zspeed) SUB_Tracking = +{ + local vector vec, org; + local float diff; + + // Allow for source origin to be fine tuned (directional) + makevectors (self.angles); + org = self.origin + attack_vector(org_offset); + + diff = vlen(iorg - org) / zspeed; // Workout difference + vec = targ.velocity; + if (targ.flags & FL_MONSTER) vec_z = 0; // Flatten Z axis for monsters + else vec_z = vec_z * 0.2; // Aim for headshot with players + + iorg = targ.origin + diff * vec; // Refine target origin + return iorg; +}; + +/*====================================================================== + SUB_Elevation + Calculates the Elevation for Z Aware monsters + * Original code by Preach (https://tomeofpreach.wordpress.com/) + * Added support for variable origin locations and proj speeds + * Added support for distance scaling linked to skill levels +======================================================================*/ +float(float theta, vector sorg, vector mdest, float zspeed) SUB_Elevation = +{ + local float a, b, c; //constants in the equation to be solved + local vector ofs; //displacement we wish the projectile to travel + local float y, z; //horizontal and vertical components of ofs + local float tan_theta; //trig values of the angle theta + local vector vec, eorg; + local float dist, sperc; + + // Place projectile destination at player head level + if (self.classtype == CT_MONSPIDER) mdest = mdest + ELEV_SPID_OFS; + else mdest = mdest + ELEV_VIEW_OFS; + + // Work out vector distance between source and destination + // Normalize the distance and create a percentage of that + // This is a skill based calculation so the aiming gets better + // The grenade is aimed infront of target so that it bounces + // No check for vertical difference so it bad going up height! + // Zombie, poison spiders zaware calculation is fine, exception! + if (self.classgroup != CG_ZOMBIE && self.classtype != CT_MONSPIDER + && self.classtype != CT_MONBOGLORD) { + vec = mdest - sorg; + dist = vlen(vec); + vec = normalize(vec); + sperc = 0.45 + skill*0.15; + eorg = sorg + (vec * (dist*sperc)); + ofs = eorg - sorg; + } + else ofs = mdest - sorg; + + //calculate how far we are firing + // ofs = mdest - sorg; + z = ofs_z; + ofs_z = 0; + y = vlen(ofs); + + // Map gravity is a global variable defined in world.qc + //find the coefficients of the quadratic in tan(theta) + a = 0.5 * map_gravity * y * y / (zspeed * zspeed); + b = -y; + c = a + z; + + //check if the destination is too far to reach + if(b*b < 4*a*c) return ELEV_DEFAULT; + + //calculate the tan value of the given theta + tan_theta = mathlib_tan(theta); + + //reuse ang to create the improved firing direction + theta = mathlib_atan2(a*tan_theta*tan_theta - c, 2*a*tan_theta + b); + + //constrain the values to stop anything too mad happening + while(theta > 90) theta = theta - 180; + return theta; +}; + +/*====================================================================== + SUB_Elevat (Alternative version, not used anymore, left for reference) + Calculates the Elevation for Z Aware monsters + * Original formula WIKI with QC help from ericw +======================================================================*/ +/*float(vector source, vector targ, float zspeed) SUB_Elevat = +{ + local float g; // Gravity + local float targx, targy; // Sub parts of distance + local float v2, v4; // speed*speed & speed*speed*speed*speed + local vector dist; // Distance to travel + local float ang, theta; + + g = map_gravity; // default 800 + dist = targ - source; // vector distance + targy = dist_z; // Up direction + dist_z = 0; + targx = vlen(dist); // X,Y direction + + v2 = zspeed * zspeed; + v4 = v2 * v2; + + // First part of equation + ang = v4 - (g * ( (g * targx * targx) + (2 * targy * v2) ) ); + // Cap elevation angle at default value + //if(ang < 0) return ELEV_DEFAULT; + + // Second section of equation + theta = mathlib_atan2 ((v2 - mathlib_sqrt(ang)) / (g * targx),1); + return theta; +}; */ diff --git a/QC_other/QC_keep/subs_drake.qc b/QC_other/QC_keep/subs_drake.qc new file mode 100644 index 00000000..09ecc7ab --- /dev/null +++ b/QC_other/QC_keep/subs_drake.qc @@ -0,0 +1,908 @@ +float(float yaw, float dist) noclip_move; +void(float dist) noclip_goal; +void SuperDamageSound (); + +// Checks if a given point in space is in water. +float(vector spot) VecInWater;; + +// Called by 'W_Attack' and various monster AI functions. +void() W_ShowHostile = +{ + SuperDamageSound (); // Moved from 'W_WeaponFrame' to here. + self.show_hostile = time + 1; // wake monsters up + //self.attack_time = time; // So imps know when to dodge. +}; + +// Prototype -- function at bottom of this file. +float(float yaw, float dist) safe_move; + +// Based on 'SV_StepDirection'. +// Use this only for big multi-hulled monsters such as dragons. +float(float yaw, float dist) QC_StepDir = +{ + self.ideal_yaw = yaw; + ChangeYaw (); + +//- - - - - - - - - +// First, move self. If successful, see if self is facing ideal. +// If not, snap self back. +// if (self.solid == SOLID_NOT) + { // Solid not entities cannot touch things. + // The move_box entity should be solid_not. + local vector spot; + + spot = self.origin; + if (safe_move (yaw, dist)) + { + if (!FacingIdeal ()) + setorigin (self, spot); // Didn't turn enough so don't move. + return TRUE; + } + } +// FIXME: Code below breaks dragons' move code if used. Don't know how yet. +// else +// { // Can't risk touching triggers that may hurt or teleport self, +// // so get a dummy to test movement. +// local entity swap; +// local float moved, faced; +// +// UpdateMovebox (); +// swap = self; +// self = move_box; +// moved = safe_move (yaw, dist); // This moves the dummy. +// faced = FacingIdeal (); +// self = swap; +// if (moved) +// { // Dummy made a move. +// if (faced) +// safe_move (yaw, dist); // Move where the dummy moved. +// return TRUE; +// } +// } +//- - - - - - - - - + + return FALSE; +}; + +// Based on 'SV_NewChaseDir'. +void(float dist) QC_NewChaseDir = +{ + local vector delta; + local float d1, d2; + local float old, back, turn; + + old = floor (self.ideal_yaw / 45); // IIRC, int chops off decimals. + old = anglemod (old * 45); + back = anglemod (old - 180); + + delta = self.goalentity.origin - self.origin; + if (delta_x > 10) + d1 = 0; + else if (delta_x < -10) + d1 = 180; + else + d1 = -1; + if (delta_y < -10) + d2 = 270; + else if (delta_y > 10) + d2 = 90; + else + d2 = -1; + +// Try direct route. + if (d1 != -1) + if (d2 != -1) + { + if (d1 == 0) + {if (d2 == 90) turn = 45; else turn = 315;} + else + {if (d2 == 90) turn = 135; else turn = 215;} + + if (turn != back) + if (QC_StepDir (turn, dist)) + return; + } + +// Try other directions. + local float ax, ay; + + ax = fabs(delta_x); + ay = fabs(delta_y); + if ((random() < 0.333) || (ay > ax)) + {turn = d1; d1 = d2; d2 = turn;} + + if (d1 != -1) + if (d1 != back) + if (QC_StepDir (d1, dist)) + return; + if (d2 != -1) + if (d2 != back) + if (QC_StepDir (d2, dist)) + return; + +// No direct path to goal, so pick another way. + if (old != -1) + if (QC_StepDir (old, dist)) + return; + + local float end, next; + if (random() < 0.5) + {turn = 0; end = 315; next = 45;} + else + {turn = 315; end = 0; next = -45;} + + while (turn <= end) + { + if (turn != back) + if (QC_StepDir (turn, dist)) + return; + turn = turn + next; + } + + if (back != -1) + if (QC_StepDir (back, dist)) + return; + +// Can't move. + self.ideal_yaw = old; + +// Disabled bridge pull out code because only flying dragons use this code. +// Pull out code. +// flat_move (0, 0); // This will do the 'SV_FixCheckBottom' code. +}; + +// Based on 'SV_CloseEnough'. +float(float dist) QC_CloseEnough = { + if (self.goalentity.absmin_x > self.absmax_x + dist) return FALSE; + if (self.goalentity.absmax_x < self.absmin_x - dist) return FALSE; + if (self.goalentity.absmin_y > self.absmax_y + dist) return FALSE; + if (self.goalentity.absmax_y < self.absmin_y - dist) return FALSE; + if (self.goalentity.absmin_z > self.absmax_z + dist) return FALSE; + if (self.goalentity.absmax_z < self.absmin_z - dist) return FALSE; + return TRUE; +}; + +// This tries to emulate movetogoal for multiple bboxes acting as a unit. +// This is probably a very slow function compared to other functions. +// (However, it is not noticable at all with a modern computer.) +void(float dist) QC_MoveToGoal = +{ +// Commented out because only dragons use this, and they fly. +// if (!(self.flags & FLx_NOT_FALLING)) //(FL_ONGROUND|FL_FLY|FL_SWIM) +// return; + +// If next step hits enemy, stop. + if (self.enemy) + if (QC_CloseEnough (dist)) + return; + +// Bump around... + if (random() < 0.333) + QC_NewChaseDir (dist); + else if (!QC_StepDir (self.ideal_yaw, dist)) + QC_NewChaseDir (dist); +}; + +//========================================================================= +// Animation + +// Sets nextthink. 'fr' is frame time delay based on 35 fps. +// Used by code that emulates stuff from the Doom or Heretic games. +void(float fr) Doom_NextThink = {self.nextthink = time + (fr / 35);}; + +// Checks if the given two entities' bboxes overlap. +// Similar to 'EntitiesTouching', but uses absmin/absmax. +float(entity e1, entity e2) Overlap = +{ + if (e1.absmin_x > e2.absmax_x) return FALSE; + if (e1.absmax_x < e2.absmin_x) return FALSE; + if (e1.absmin_y > e2.absmax_y) return FALSE; + if (e1.absmax_y < e2.absmin_y) return FALSE; + if (e1.absmin_z > e2.absmax_z) return FALSE; + if (e1.absmax_z < e2.absmin_z) return FALSE; + return TRUE; +}; + + +// Like 'Overlap' above, but adds distance. +// Useful to check collisions when one entity has a clip bonus. +float(entity e1, entity e2, float dist) Overlapped = +{ + if (e1.absmin_x > e2.absmax_x + dist) return FALSE; + if (e1.absmax_x < e2.absmin_x - dist) return FALSE; + if (e1.absmin_y > e2.absmax_y + dist) return FALSE; + if (e1.absmax_y < e2.absmin_y - dist) return FALSE; + if (e1.absmin_z > e2.absmax_z + dist) return FALSE; + if (e1.absmax_z < e2.absmin_z - dist) return FALSE; + return TRUE; +}; + +float(vector amin, vector amax, vector bmin, vector bmax) Point_Overlap = +{ + if (amin_x > bmax_x) return FALSE; + if (amax_x < bmin_x) return FALSE; + if (amin_y > bmax_y) return FALSE; + if (amax_y < bmin_y) return FALSE; + if (amin_z > bmax_z) return FALSE; + if (amax_z < bmin_z) return FALSE; + return TRUE; +}; + +// Checks if entity 'e' is a missile. +float(entity e) IsMissile = +{ + if (!(e.flags & FLx_NOT_MISSILE)) + { + if (e.solid == SOLID_BBOX) + { + if (e.touch) + if (e.touch != SUB_Null) + if (e.touch != SUB_Remove) + return TRUE; + } + else if (e.solid == SOLID_TRIGGER) + { + if (e.classname == "fireball") // Lavaball check. + return TRUE; + } + } + return FALSE; +}; + +// This makes an entity do a think function right now. +void(entity ent, void() thinkst) SUB_Think = { + local entity swap; + + swap = self; + self = ent; + thinkst (); + self = swap; +}; + +//========================================================================== +// Safe Message Functions + +// These are for functions that display messages and are used by clients +// (players) and non-clients (monsters). Such functions include item pickups +// and powerup countdowns. + +void(entity ent, string text) Safe_sprint = +{ + if ((ent.flags & FLx_CREATURE) == FL_CLIENT) + sprint (ent, text); +}; + +void(entity ent, string text) Safe_centerprint = +{ + if ((ent.flags & FLx_CREATURE) == FL_CLIENT) + centerprint (ent, text); +}; + +void(entity ent, string text) Safe_stuffcmd = +{ +// The server crashes if it attempts a stuffcmd on a non-client. + if ((ent.flags & FLx_CREATURE) == FL_CLIENT) + stuffcmd (ent, text); +}; + +// Use this to centerprint a message to everyone. +void(string text) Mass_Centerprint = +{ + local entity pc; + + pc = find (world, classname, "player"); + while (pc) + { + if ((pc.flags & FLx_CREATURE) == FL_CLIENT) // Confirm pc status. + centerprint (pc, text); + pc = find (pc, classname, "player"); + } +}; + +// Convenience function -- set model, size, and origin. +// Called by various missile functions. +void(entity e, string s, vector v1, vector v2, vector org) setall = +{ + setmodel (e, s); // May resize hullbox after this is called. + setsize (e, v1, v2); // Must do *after* setmodel. + setorigin (e, org); // Updates links immediately, so do last. +}; + +//========================================================================== +// Miscellaneous Junk + +//- - - - - - - - - +// How games handled pain in Nightmare. +// Doom: Monsters take pain normally. However, most monsters didn't +// flinch reliably, and when they did, had short delays. +// Quake1: Immune to pain for five seconds after taking damage. +// Quake2: Immune to pain. +// +// Complete immunity to pain is not fun, and makes some monsters much +// more dangerous than normal. For instance, the lowly grunt with his +// hitscan shotgun. +//- - - - - - - - - +// Checks if monster won't flinch from pain. +float() SUB_IgnorePain = { + if (skill >= 3) + { // Nightmare or Hell. + if (random() < 0.5) // Update 1/5/10: Go 50/50 instead of 100%. + return TRUE; + } + return FALSE; +}; + +//- - - - - - - - - +// Checks if enemy is within melee range. def_range is defined melee range. +// Assumes self has an enemy and can damage said enemy. +float(float def_range) InMeleeRange = { + local float dist; + + if (!self.enemy.modelindex) + if (self.enemy.solid == SOLID_NOT) + return FALSE; // Phased out of the level. + + dist = vlen(self.enemy.origin - self.origin); + if (dist > def_range) + if ( dist > ((self.maxs_x + self.enemy.maxs_x) * SQRT2 + 10) ) + return FALSE; + + return TRUE; // Within range. +}; + +// Variant of 'FacingIdeal' in which TRUE is returned only if difference +// between self's yaw and ideal yaw is one-half of a degree or less. +// Used by patrol related code. +float() MatchingIdeal = { + local float delta; + + delta = rint(self.angles_y - self.ideal_yaw); + delta = anglemod(delta); + return !delta; +}; + +// Add one to the global float. Used to help calculate attack patterns for +// some monsters. Update: Rollover after 8-bit limit. +float() AddOne = {gloat = (gloat + 1) & 255; return gloat;}; + +// From Drake +// DRAGONS /- - - - +//========================================================================== +// TEMP GOAL (Custom addition) +// +// 'walkmove' and 'movetogoal' always causes a flying monster to drift +// vertically toward edict.enemy by 8 per call. In addition, if the +// drift fails, the whole move aborts and no horizontal move is done. +// +// Therefore, create a dummy entity that can be swapped in temporarily +// as the enemy. +//========================================================================== +entity temp_goal; + +// Used to control movement of flying/swimming entities. +void() InitTempGoal = +{ + temp_goal = spawn(); + temp_goal.classname = "goal"; +}; + +// From Drake +//========================================================================== +// MOVE BOX (Custom addition) +// +// Quake checks movement with only one of three hull sizes: +// point-size, human-size, and shambler-size. Anything bigger than +// shambler-size will clip walls because it is bigger than the bbox +// used by the Quake engine for movement. +// +// Therefore, create a dummy entity that can test movement multiple +// times on behalf of the monster to be moved. The move box is +// placed at the corners of the monster, and if all move checks are +// good, the monster will be allowed to move. +//========================================================================== +entity move_box; + +// Used by big entities to prevent clipping of walls. +void() InitMoveBox = +{ + move_box = spawn(); + setsize (move_box, VEC_HULL2_MIN, VEC_HULL2_MAX); + move_box.solid = SOLID_NOT; + move_box.movetype = MOVETYPE_STEP; + move_box.classname = "move_box"; +}; + +//========================================================================== +// Safe Movement Functions + +// The following two "safe_" functions help improve stability at the +// cost of speed. Monsters should have th_move and th_goal defined, +// but in case they do not, do something to prevent a crash by call to +// undefined function. +float(float yaw, float dist) safe_move = +{ + if (self.th_move) + return self.th_move (yaw, dist); +// If the first check failed, that means self.th_move was undefined, +// and the game would have crashed due to a call to an undefined function. + if (self.movetype == MOVETYPE_NOCLIP) + return noclip_move (yaw, dist); +// Disabled: Monster should call swim_* via self.th_*. +// if (self.flags & FL_SWIM) +// return swim_move (yaw, dist); + return walkmove (yaw, dist); +}; + +void(float dist) safe_goal = +{ + if (self.th_goal) + self.th_goal (dist); +// If the first check failed, that means self.th_goal was undefined, +// and the game would have crashed due to a call to an undefined function. + else + { + if (self.movetype == MOVETYPE_NOCLIP) + noclip_goal (dist); +// else if (self.flags & FL_SWIM) +// swim_goal (dist); + else + movetogoal (dist); // The original builtin. + } +}; + +//========================================================================== +// Noclip Movement -- Used by wraiths and other such ghostly monsters. + +//============ +// This is 'walkmove' for monsters with noclip movement. Based on +// 'SV_movestep'. Noclip entities are capable of unrestricted 3D movement. +// +// NOTE: This function *always* returns TRUE. +// This function is float type for convenience (i.e., cut-and-paste code). +//============ +float(float yaw, float dist) noclip_move = +{ + local vector move; + + move = '0 0 0'; move_y = yaw; + makevectors (move); + move = v_forward * dist * 10; + if (self.enemy) + { + local float delta; + + delta = self.origin_z - self.enemy.origin_z; + if (delta < 30) + move_z = move_z + 80; + else if (delta > 40) + move_z = move_z - 80; + } + self.velocity = move; + return TRUE; +}; + +// Based on 'SV_StepDirection'. +// Originally float type, but noclip movement cannot be blocked. +void(float yaw, float dist) noclip_step = +{ + self.ideal_yaw = yaw; + ChangeYaw (); + + if (FacingIdeal ()) + noclip_move (yaw, dist); + else + self.velocity = '0 0 0'; // Didn't turn enough so don't move. +}; + +// Based on 'SV_NewChaseDir'. +void(float dist) noclip_chase = +{ + local vector delta; + local float d1, d2; + local float old, back, turn; + + old = floor (self.ideal_yaw / 45); // IIRC, int chops off decimals. + old = anglemod (old * 45); + back = anglemod (old - 180); + + delta = self.goalentity.origin - self.origin; + if (delta_x > 10) + d1 = 0; + else if (delta_x < -10) + d1 = 180; + else + d1 = -1; + if (delta_y < -10) + d2 = 270; + else if (delta_y > 10) + d2 = 90; + else + d2 = -1; + +// Try direct route. + if (d1 != -1) + if (d2 != -1) + { + if (d1 == 0) + {if (d2 == 90) turn = 45; else turn = 315;} + else + {if (d2 == 90) turn = 135; else turn = 215;} + + if (turn != back) + {noclip_step (turn, dist); return;} + } + +// Try other directions. + local float ax, ay; + + ax = fabs(delta_x); + ay = fabs(delta_y); + if ((random() < 0.333) || (ay > ax)) + {turn = d1; d1 = d2; d2 = turn;} + + if (d1 != -1) + if (d1 != back) + {noclip_step (d1, dist); return;} + if (d2 != -1) + if (d2 != back) + {noclip_step (d2, dist); return;} + +// No direct path to goal, so pick another way. + noclip_step (old, dist); +}; + +//============ +// This is 'movetogoal' for monsters with noclip movement. +// Based on 'SV_MoveToGoal'. +//============ +void(float dist) noclip_goal +{ +// Noclip entities have full, unrestricted 3D movement. + +// If next step hits enemy, stop... but only if wraith is not in a wall. +// Why? Because the wraith can't attack effectively if pinned in the wall. + if (self.enemy) + if (QC_CloseEnough (dist)) + if (pointcontents (self.origin) != CONTENT_SOLID) + {self.velocity = '0 0 0'; return;} + + if (random() < 0.333) + noclip_chase (dist); + else + noclip_step (self.ideal_yaw, dist); +}; + +//============================================================================= + +// Spawns a muzzleflash. Used by phased out monsters with a modelindex +// of zero, who cannot display effects while modelindex is zero. +// Update 9/5/09: Also by players for some weapons to get around +// Qrack's custom client muzzleflashes. +void() SUB_Flash = { + local entity e; + + e = spawn(); + e.movetype = MOVETYPE_NONE; //MOVETYPE_NOCLIP; + e.velocity = '0 0 0'; //self.velocity; + e.touch = SUB_Null; + e.solid = SOLID_NOT; + e.effects = EF_MUZZLEFLASH; // The point of this function. + e.nextthink = time + 0.1; + e.think = SUB_Remove; + // Non-zero invisible model. + setall (e, "progs/null.spr", '0 0 0', '0 0 0', self.origin); //was null_256 +}; + +// Finds a random player in the game. +entity() RandomPlayer = { + local entity e; + local float loop; + + e = find (world, classname, "player"); + if (deathmatch || coop) { + loop = 0; + while (e) { + loop = loop + 1; + e = find (e, classname, "player"); + } + loop = loop * random(); + loop = ceil (loop); + e = world; + do { + e = find (e, classname, "player"); + loop = loop - 1; + } while (loop > 0); + } + return e; +}; + +// DRAGONS /- - - - +// This sets an entity's waterlevel and watertype in a way similar to +// the C code. +void(entity ent) Water_Set = { + local vector spot; + + spot = ent.origin; + spot_z = spot_z + ent.mins_z + 1; + ent.h2otype = pointcontents (spot); + if (ent.h2otype <= CONTENT_WATER) { + ent.h2olevel = 1; + spot_z = ent.origin_z + (ent.mins_z + ent.maxs_z) * 0.5; + if (pointcontents (spot) <= CONTENT_WATER) { + ent.h2olevel = 2; + spot_z = ent.origin_z + ent.view_ofs_z; + if (pointcontents (spot) <= CONTENT_WATER) + ent.h2olevel = 3; + } + } + else + ent.h2olevel = 0; +}; + +// Searches all entities to do pre-thinking stuff for monsters. +void() WorldScan = { + local entity e; + + e = nextent (world); + while (e) + { + // For now, just check for water stats for dragons. + // Used by dragons to check movement. + if (e.flags & FL_MONSTER) + if (e.classtype == CT_MONRYU || e.classtype == CT_MONWYRM) + Water_Set (e); + + e = nextent (e); + } +}; +//- - - - - - - - - + +float(entity e) IsDead = {return ((e.health <= 0) || e.deadflag);}; + +/* +============================================================================== + +MULTI-DAMAGE + +Collects multiple small damages into a single damage + +============================================================================== +*/ + +entity multi_ent; +float multi_damage; + +void() ClearMultiDamage = +{ + multi_ent = world; + multi_damage = 0; +}; + +void() ApplyMultiDamage = +{ + if (!multi_ent) + return; + T_Damage (multi_ent, self, self, multi_damage,DAMARMOR); +}; + +void(entity hit, float damage) AddMultiDamage = +{ + if (!hit) + return; + + if (hit != multi_ent) + { + ApplyMultiDamage (); + multi_damage = damage; + multi_ent = hit; + } + else + multi_damage = multi_damage + damage; +}; + +//========================================================================== +// MULTI-DAMAGE +// +// Collects multiple small damages into a single damage +// +// PM: Damage that is affected by damage flags should be handled +// in the function that calls any of MultiDamage_xxx, not here. +// That is because in case I may want weapons that shoot multiple +// attacks that have different properties, yet hit simultaneously. +//========================================================================== +// PM: Globals moved to global.qc. + +void() MultiDamage_Clear = {multi_ent = world; multi_damage = 0; multi_headinjury = 0;}; + +void(string dtype) MultiDamage_Apply = +{ + if (multi_ent) + { + T_Damage (multi_ent, self, self, multi_damage,DAMARMOR); + } +}; + +void(entity hit, float damage, float trauma, string dtype) MultiDamage_Add = +{ + if (!hit) + return; + + if (hit != multi_ent) + { + MultiDamage_Apply (dtype); + multi_headinjury = trauma; + multi_damage = damage; + multi_ent = hit; + } + else + { + multi_headinjury = multi_headinjury + trauma; + multi_damage = multi_damage + damage; + //- - - - - - - - - + // If the target takes enough damage to gib, damage it now. + // Gibbing makes the target smaller and non-solid, allowing the remaining + // shotgun pellets to hit more targets behind the one to be gibbed. + // Note: Also works for IK's antimatter gun. + //- - - - - - - - - + /* + if (hit.th_gib) + if (hit.health >= hit.gib_health) + { + local vector dv; // x=damage taken, y=armor damage, z=x+y + + dv = CalcDamage (hit, self, multi_damage, DF_NONE); + if (dv_x > (dv_y + hit.health - hit.gib_health)) + { // Enough damage to gib the target, so do it now! + if (hit.health < 0) // HACK: Make it easier to gib dead guys. + multi_damage = multi_damage - hit.health; + MultiDamage_Apply (dtype); + MultiDamage_Clear (); + } + else + { + //- - - - - - - - - + // Hack: If zombie, treat head damage as double. This means if + // zombie has 60 health, it takes only 30 to the head to kill. + // Headshot damage must be 25 or more to decapitate. + // + // Update 6/11/2011: Only if not in classic mode. + //- - - - - - - - - + if (hit.classname == "monster_zombie") + if (!q1shot) + if (multi_headinjury >= 25) + if (multi_headinjury * 2 >= hit.health) + if (dv_x * 2 >= hit.health) + { + multi_damage = multi_damage * 2; // Boom! Headshot! + MultiDamage_Apply (dtype); + MultiDamage_Clear (); + } + } + }*/ + } +}; + +//========================================================================== +// Particle Beam + +// Spawns a beam of particles. +void(vector start, vector end, float color1, float color2, + float density, float full) Particle_Beam = +{ + local vector delta; + local float points; + local float dist; + local vector next; + + delta = end - start; + dist = vlen(delta); + + if (full) + { // Unbroken, continuous trail. Used by meteor. + points = dist / 24; + points = ceil(points); + dist = -24; + } + else + { // Sparse, broken trail. Useful for frost trails. + if (deathmatch || coop) + points = 2; + else + points = 3; + dist = dist / points; + dist = 0 - dist; + } + + delta = normalize(delta); + next = delta * dist; + full = color1; + + while (points > 0) + { + particle (end, delta, full, density); + end = end + next; + points = points - 1; + if (full == color1) + full = color2; + else + full = color1; + } +}; + +// Used by shotguns and other hitscan scatterguns such IK's Asha gun. +// Update: Also used by flare gun/ruby wand. +// Note: 'damage' is used only to check reflection against courage armor. +// 'sparks' -- x=color1, y=color2, z=density (0=none). +void(vector org, vector dir, float dist, float damage, entity attacker, + vector sparks) Lead_Hitscan = +{ + local entity ignore; + local vector end; + local float loop; + + ignore = attacker; + loop = 3; + while (loop > 0) + { + end = org + dir*dist; + traceline (org, end, FALSE, ignore); + if (sparks_z >= 1) + Particle_Beam (org, trace_endpos, sparks_x, sparks_y, sparks_z, TRUE); + if (trace_fraction != 1.0) + { + /*if (HasReflection (trace_ent, trace_endpos, damage)) + { + ignore = trace_ent; + org = trace_endpos; + dir = normalize (org - ignore.origin); + dist = dist * (1 - trace_fraction); + ReflectSound (trace_ent); + } + else*/ + return; + } + else + return; + + loop = loop - 1; + } +// Reflected too many times, so fake a miss. + trace_fraction = 1.0; + trace_ent = world; +}; + +// Sound to be played when an attack is reflected. +void(entity ent) ReflectSound = +{ +// Play sound only if entity carries an artifact that provides reflection. +// That is, don't play sound for warlocks who cast a reflection spell. + if (ent.mirror_finished) + { + if (ent.flags & FL_CLIENT) + if (ent.mirror_sound < time) + { + ent.mirror_sound = time + 2; // t+1 boings too much. + sound (ent, CHAN_ITEM, "items/reflect3.wav", 1, ATTN_NORM); + } + } +}; + +float(entity e) ImmuneToDamage = { + if (!e.takedamage) + return TRUE; + if (e.flags & FL_GODMODE) + return TRUE; + return (e.invincible_finished); +}; + +// Checks if entity 'e' can grunt in pain. +float(entity e) FeelsPain = { + if (e.health > 0) + if (e.th_pain) + if (e.th_pain != SUB_Null) + if (e.pain_finished <= time) + if (!ImmuneToDamage (e)) + return TRUE; + + return FALSE; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/subs_extras.qc b/QC_other/QC_keep/subs_extras.qc new file mode 100644 index 00000000..d10dea66 --- /dev/null +++ b/QC_other/QC_keep/subs_extras.qc @@ -0,0 +1,15 @@ +/* +============ +SUB_RandomRange + +Return a random number between min & max (or min if max is 0) +Just make sure max is greater than min... +============ +*/ +float(float rmin, float rmax) SUB_RandomRange = +{ + if (!rmax) + return rmin; + else + return rmin + random()*(rmax-rmin); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/subs_keep.qc b/QC_other/QC_keep/subs_keep.qc new file mode 100644 index 00000000..96899eed --- /dev/null +++ b/QC_other/QC_keep/subs_keep.qc @@ -0,0 +1,172 @@ +void (entity srcent, entity destent) SUB_CopyEntity = { + destent.modelindex = srcent.modelindex; + destent.absmin = srcent.absmin; + destent.absmax = srcent.absmax; + destent.ltime = srcent.ltime; + destent.movetype = srcent.movetype; + destent.solid = srcent.solid; + destent.origin = srcent.origin; + destent.oldorigin = srcent.oldorigin; + destent.velocity = srcent.velocity; + destent.angles = srcent.angles; + destent.avelocity = srcent.avelocity; + destent.punchangle = srcent.punchangle; + destent.classname = srcent.classname; + destent.model = srcent.model; + destent.frame = srcent.frame; + destent.skin = srcent.skin; + destent.effects = srcent.effects; + destent.mins = srcent.mins; + destent.maxs = srcent.maxs; + destent.size = srcent.size; + destent.touch = srcent.touch; + destent.use = srcent.use; + destent.think = srcent.think; + destent.blocked = srcent.blocked; + destent.nextthink = srcent.nextthink; + destent.groundentity = srcent.groundentity; + destent.health = srcent.health; + destent.frags = srcent.frags; + destent.weapon = srcent.weapon; + destent.weaponmodel = srcent.weaponmodel; + destent.weaponframe = srcent.weaponframe; + destent.currentammo = srcent.currentammo; + destent.ammo_shells = srcent.ammo_shells; + destent.ammo_nails = srcent.ammo_nails; + destent.ammo_rockets = srcent.ammo_rockets; + destent.ammo_cells = srcent.ammo_cells; + destent.items = srcent.items; + destent.takedamage = srcent.takedamage; + destent.chain = srcent.chain; + destent.deadflag = srcent.deadflag; + destent.view_ofs = srcent.view_ofs; + destent.button0 = srcent.button0; + destent.button1 = srcent.button1; + destent.button2 = srcent.button2; + destent.impulse = srcent.impulse; + destent.fixangle = srcent.fixangle; + destent.v_angle = srcent.v_angle; + destent.idealpitch = srcent.idealpitch; + destent.netname = srcent.netname; + destent.enemy = srcent.enemy; + destent.flags = srcent.flags; + destent.colormap = srcent.colormap; + destent.team = srcent.team; + destent.max_health = srcent.max_health; + destent.teleport_time = srcent.teleport_time; + destent.armortype = srcent.armortype; + destent.armorvalue = srcent.armorvalue; + destent.waterlevel = srcent.waterlevel; + destent.watertype = srcent.watertype; + destent.ideal_yaw = srcent.ideal_yaw; + destent.yaw_speed = srcent.yaw_speed; + destent.aiment = srcent.aiment; + destent.goalentity = srcent.goalentity; + destent.spawnflags = srcent.spawnflags; + destent.target = srcent.target; + destent.targetname = srcent.targetname; + destent.dmg_take = srcent.dmg_take; + destent.dmg_save = srcent.dmg_save; + destent.dmg_inflictor = srcent.dmg_inflictor; + destent.owner = srcent.owner; + destent.movedir = srcent.movedir; + destent.message = srcent.message; + destent.sounds = srcent.sounds; + destent.noise = srcent.noise; + destent.noise1 = srcent.noise1; + destent.noise2 = srcent.noise2; + destent.noise3 = srcent.noise3; + destent.wad = srcent.wad; + destent.map = srcent.map; + destent.worldtype = srcent.worldtype; + destent.killtarget = srcent.killtarget; + destent.light_lev = srcent.light_lev; + destent.style = srcent.style; + destent.th_stand = srcent.th_stand; + destent.th_walk = srcent.th_walk; + destent.th_run = srcent.th_run; + destent.th_missile = srcent.th_missile; + destent.th_melee = srcent.th_melee; + destent.th_pain = srcent.th_pain; + destent.th_die = srcent.th_die; + destent.oldenemy = srcent.oldenemy; + destent.speed = srcent.speed; + destent.lefty = srcent.lefty; + destent.search_time = srcent.search_time; + destent.attack_state = srcent.attack_state; + destent.walkframe = srcent.walkframe; + destent.attack_finished = srcent.attack_finished; + destent.pain_finished = srcent.pain_finished; + destent.invincible_finished = srcent.invincible_finished; + destent.invisible_finished = srcent.invisible_finished; + destent.super_damage_finished = srcent.super_damage_finished; + destent.radsuit_finished = srcent.radsuit_finished; + destent.invincible_time = srcent.invincible_time; + destent.invincible_sound = srcent.invincible_sound; + destent.invisible_time = srcent.invisible_time; + destent.invisible_sound = srcent.invisible_sound; + destent.super_time = srcent.super_time; + destent.super_sound = srcent.super_sound; + destent.rad_time = srcent.rad_time; + destent.fly_sound = srcent.fly_sound; + destent.axhitme = srcent.axhitme; + destent.show_hostile = srcent.show_hostile; + destent.jump_flag = srcent.jump_flag; + destent.swim_flag = srcent.swim_flag; + destent.air_finished = srcent.air_finished; + destent.bubble_count = srcent.bubble_count; + destent.deathtype = srcent.deathtype; + destent.mdl = srcent.mdl; + destent.mangle = srcent.mangle; + destent.oldorigin = srcent.oldorigin; + destent.t_length = srcent.t_length; + destent.t_width = srcent.t_width; + destent.dest = srcent.dest; + destent.dest1 = srcent.dest1; + destent.dest2 = srcent.dest2; + destent.wait = srcent.wait; + destent.delay = srcent.delay; + destent.trigger_field = srcent.trigger_field; + destent.noise4 = srcent.noise4; + destent.pausetime = srcent.pausetime; + destent.movetarget = srcent.movetarget; + destent.aflag = srcent.aflag; + destent.dmg = srcent.dmg; + destent.cnt = srcent.cnt; + destent.think1 = srcent.think1; + destent.finaldest = srcent.finaldest; + destent.finalangle = srcent.finalangle; + destent.count = srcent.count; + destent.lip = srcent.lip; + destent.state = srcent.state; + destent.pos1 = srcent.pos1; + destent.pos2 = srcent.pos2; + destent.height = srcent.height; + destent.waitmin = srcent.waitmin; + destent.distance = srcent.distance; + destent.volume = srcent.volume; + destent.gorging = srcent.gorging; + destent.stoleweapon = srcent.stoleweapon; + destent.spawnmaxs = srcent.spawnmaxs; +}; + +/*====================================================================== + From Quoth for calculating gib velocity for polyp +======================================================================*/ +vector (float dm) VelocityForDamage = { + local vector v; + + v_x = 100 * crandom(); + v_y = 100 * crandom(); + v_z = 200 + 100 * random(); + if (dm > -50) { + v = v * 0.7; + } else { + if (dm > -200) { + v = v * 2; + } else { + v = v * 10; + } + } + return v; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/subs_kinn.qc b/QC_other/QC_keep/subs_kinn.qc new file mode 100644 index 00000000..5519c078 --- /dev/null +++ b/QC_other/QC_keep/subs_kinn.qc @@ -0,0 +1,73 @@ +/* +==================================================== +BDW_DelayedRemove + +This is a hack that prevents unwanted sprite frame +interpolation in DarkPlaces. It appears that a newly +spawned sprite will try to interpolate from the last +frame of the previous edict (whose slot it now fills). +==================================================== +*/ + +void() BDW_SpriteGenericLoop; +void() BDW_SpriteGenericPlayOnce; + +void() BDW_DelayedRemove = { + self.model = ""; + self.modelindex = 0; + self.frame = 0; + self.skin = 0; + self.colormap = 0; + self.effects = 0; + self.alpha = 0.0001; + self.solid = SOLID_NOT; + self.takedamage = DAMAGE_NO; + self.movetype = MOVETYPE_NONE; + self.velocity = VEC_ORIGIN; + self.angles = VEC_ORIGIN; + self.origin = VEC_ORIGIN; + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +/* +====================================================== +BDW_SpriteGenericLoop + +Loops a sprite animation + +self.idleweaponframe represents the total number +of frames in the animation. Frames are numbered +starting from 0, so the last frame in the animation +is actually (self.idleweaponframe - 1). Useful for +missiles. + +BDW_SpriteGenericPlayOnce + +Similar to the above, but removes sprite at end of +animation. Useful for explosions. +====================================================== +*/ + +void() BDW_SpriteGenericLoop = { + self.frame = self.frame + 1; + if (self.frame > (self.idleweaponframe - 1)) + self.frame = 0; + + self.think = BDW_SpriteGenericLoop; + self.nextthink = time + 0.05; +}; + +void() BDW_SpriteGenericPlayOnce = { + self.frame = self.frame + 1; + if (self.frame > (self.idleweaponframe - 1)) + { + BDW_DelayedRemove(); // hack! + return; + } + + self.think = BDW_SpriteGenericPlayOnce; + self.nextthink = time + 0.05; +}; + +void() BDW_BodyDropSound = { sound(self, CHAN_BODY, "demon/dland2.wav", 0.7, ATTN_NORM); }; \ No newline at end of file diff --git a/QC_other/QC_keep/subs_rubicon.qc b/QC_other/QC_keep/subs_rubicon.qc new file mode 100644 index 00000000..48b8eae5 --- /dev/null +++ b/QC_other/QC_keep/subs_rubicon.qc @@ -0,0 +1,12 @@ +//function to help monsters not shoot each other +float (entity targ) clean_shot = +{ + local vector spot1, spot2; + + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, FALSE, self); // try not to shoot through other monsters + if (trace_ent != targ) + return FALSE; + return TRUE; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/subs_soc.qc b/QC_other/QC_keep/subs_soc.qc new file mode 100644 index 00000000..f30441f1 --- /dev/null +++ b/QC_other/QC_keep/subs_soc.qc @@ -0,0 +1,386 @@ +//====================================================================== +// Trigger/use all entities that match the supplied targetname +// self is switched around so target use function works correctly +// +//---------------------------------------------------------------------- +void(string target_strs, entity activator_ent) trigger_strs = +{ + local entity tself, tother, tactivator, ent_list; + + // Some entities constantly use this function (<0.1s trigger) + // This is just an entity key to block the debug info + if (activator_ent.nodebuginfo == FALSE) { + dprint("\b[STR_TRIG]\b Str ("); dprint(target_strs); + dprint(") Activator ("); dprint(activator_ent.classname); + if (target_strs == "") dprint(") - ERROR!!\n"); + else dprint(")\n"); + } + + // Prevent this function from triggering everything by + // checking if the target_str is empty (empty = world) + if (target_strs != "") { + // Store self/other for later + tself = self; + tother = other; + tactivator = activator; + if (activator_ent.flags & FL_CLIENT) activator = activator_ent; + + // Build initial list from world + ent_list = find(world, targetname, target_strs); + // Cycle through list + while(ent_list) { + // Setup self/other ready for trigger/use function + self = ent_list; + other = tself; + if (self.use) { + self.activate = activator_ent; // Link activator + self.use(); // Fire use function + } + // Find next trigger from intial list (not world) + ent_list = find(ent_list, targetname, target_strs); + } + // Restore self/other from previous temp storage + self = tself; + other = tother; + if (activator_ent.flags & FL_CLIENT) activator = tactivator; + } +}; + +//====================================================================== +// Trigger/use the entity supplied and activator +// self is switched around so target use function works correctly +// +//---------------------------------------------------------------------- +void(entity target_ent, entity activator_ent) trigger_ent = +{ + local entity tself, tother, tactivator; + + dprint("\b[ENT_TRIG]\b Ent ("); dprint(ftos(target_ent.classtype)); + dprint(") Activator ("); dprint(activator_ent.classname); + if (!target_ent) dprint(") - ERROR!!\n"); + else dprint(")\n"); + + if (target_ent && target_ent.use) { + // Save self/other for later + tself = self; + tother = other; + tactivator = activator; + if (activator_ent.flags & FL_CLIENT) activator = activator_ent; + + // Switch around self/other for USE function + self = target_ent; + other = tself; + + // Use trigger + if (self.use) { + self.activate = activator_ent; // Link activator + self.use(); // Fire use function + } + + // Restore self/other from previous temp storage + self = tself; + other = tother; + if (activator_ent.flags & FL_CLIENT) activator = tactivator; + } +}; + +//====================================================================== +// Check if the entity has solid surface below +// There is no entity type checks, can be any entity in theory! +// First check is checkbottom for completel bounding box coverage +// Second check is trace down to find floor surface below +// Typical trace down distance is 128 units with 24 unit difference +// +// Uses for this function:- +// ai_states.qc - ai_stand +// monsters.qc - monster_deadbody_check +// ai_gibs.qc - CheckFloorGib +// items.qc - item_thinkloop +// +//---------------------------------------------------------------------- +void(entity source, float floor_dist) ent_floorcheck = +{ + local vector trace_pos1; + local float trace_dist; + + // if (!checkbottom(source)) = disabled + // too expensive, 5 traces (4 corners + center) and liquid check + + // Tracedown directly from origin for floor check + trace_pos1 = source.origin; + trace_pos1_z = trace_pos1_z - FLOOR_TRACE_DIST; + traceline (source.origin, trace_pos1, TRUE, source); + + // Work out distance from origin to floor + trace_dist = source.origin_z - trace_endpos_z; + + // Check if the floor is too far away? (usually 24 units) + if (trace_dist > floor_dist && source.flags & FL_ONGROUND) { + // Move entity up and do a trace/fall down (256 units max) + source.oldorigin = source.origin; + source.origin_z = source.origin_z + 1; + droptofloor(); + if (source.oldorigin != source.origin) { + // lift entity upward and remove onground flag + source.flags = source.flags - (source.flags & FL_ONGROUND); + source.velocity_z = 10 + 10*random(); + // Check for any attachment (lids) for ammo + if (source.classgroup == CG_AMMOITEM && source.attachment) { + // sync flag/velocity so lid falls correctly + source.attachment.flags = source.attachment.flags - (source.attachment.flags & FL_ONGROUND); + source.attachment.velocity = source.velocity; + } + } + // Move item back to original pos before droptofloor + setorigin(source, source.oldorigin); + } +}; + +//====================================================================== +// Check for contact with sky brushes +// - Use pointcontent() for Typical/Enhanced Quake engines +// - Use new FTE string functions and surface check for Darkplaces engine +// +//---------------------------------------------------------------------- +float(vector targ_origin) check_skycontent = +{ + local float surfnum; + local string texturename; + + // Does the engine supports extended surface checks? + if (ext_dpsurf) { + surfnum = getsurfacenearpoint(world, targ_origin); + if (surfnum >= 0) { + texturename = getsurfacetexture(world, surfnum); + if (strncasecmp(texturename, "SKY", 3) == 0) return TRUE; + } + } + else { + // Original method for checking sky content (Fitz engines) + if (pointcontents(targ_origin) == CONTENT_SKY) return TRUE; + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check point content for SOLID or SKY problems +//---------------------------------------------------------------------- +float(vector pc_org) entity_pcontent = +{ + local float pcontent; + pcontent = pointcontents(pc_org); + if (pcontent == CONTENT_SOLID) return TRUE; + if (check_skycontent(pc_org)) return TRUE; + return FALSE; +} + +//====================================================================== +// Updates totals on the HUD (checks for client to exist) +// - Specify which total to update using constant +// - Uses MSG_ONE because it is more reliable across many clients +// - Other client updates (SVC_KILLEDMONSTER, SVC_FOUNDSECRET) +// +//---------------------------------------------------------------------- +void(float hud_item) update_hud_totals = +{ + // Has the client player been setup yet? + if (client_ent && client_ent.flags & FL_CLIENT) { + + // Update total secrets + if (hud_item & HUD_SECRETS) { + msg_entity = client_ent; + WriteByte (MSG_ONE, SVC_UPDATESTAT); + WriteByte (MSG_ONE, STAT_TOTALSECRETS); + WriteLong (MSG_ONE, total_secrets); + } + // Update total monsters + if (hud_item & HUD_MONSTERS) { + msg_entity = client_ent; + WriteByte (MSG_ONE, SVC_UPDATESTAT); + WriteByte (MSG_ONE, STAT_TOTALMONSTERS); + WriteLong (MSG_ONE, total_monsters); + } + } +}; + +//====================================================================== +// Reduce any entity down to a non-interactive empty marker +// +//---------------------------------------------------------------------- +void(entity targ) entity_hide = +{ + targ.use = targ.touch = SUB_Null; // No more touchy + targ.think = SUB_Null; // No more thinking/animation + targ.nextthink = -1; // Never fire think + targ.estate = ESTATE_OFF; // Entity state off + setmodel (targ, ""); // invisible + targ.takedamage = DAMAGE_NO; // No pain/death triggers + targ.movetype = MOVETYPE_NONE; // Stationary + targ.solid = SOLID_NOT; // no world interaction + setsize (targ, VEC_ORIGIN, VEC_ORIGIN); // No size, no impact + targ.velocity = targ.avelocity = '0 0 0'; // Frozen velocity + targ.spawnflags = targ.effects = 0; // Leave flags alone + targ.waitmin = time + LARGE_TIMER; // Block any touch function +}; + +//---------------------------------------------------------------------- +void(entity targ, float removetime) entity_remove = +{ + if (targ == world) return; + entity_hide(targ); + targ.think = SUB_Remove; + targ.nextthink = time + removetime; +}; + +//====================================================================== +// Show where broken monster/items are located (developer only) +// SPNMARK_YELLOW, SPNMARK_BLUE, SPNMARK_GREEN, SPNMAKR_RED +//---------------------------------------------------------------------- +void(vector marker_org, float marker_type) spawn_marker = +{ + local entity brokend; + + if (developer) { + brokend = spawn(); + brokend.classtype = CT_DEVMARKER; + brokend.movetype = MOVETYPE_NONE; + brokend.solid = SOLID_NOT; + setmodel(brokend, MODEL_BROKEN); + setorigin(brokend, marker_org); + setsize (brokend, VEC_ORIGIN, VEC_ORIGIN); + // Setup marker type (skin colour) + // YELLOW = error, BLUE = delay, GREEN = nocount, RED = nightmare + brokend.skin = marker_type; + brokend.frame = 0; + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) brokend.effects = brokend.effects + EF_NOSHADOW; + } +}; + +//---------------------------------------------------------------------- +entity(vector spawn_org) spawn_devmarker = +{ + local entity spawn_ent; + + spawn_ent = spawn(); + spawn_ent.classtype = CT_DEVMARKER; + spawn_ent.movetype = MOVETYPE_NONE; + spawn_ent.solid = SOLID_NOT; + setmodel(spawn_ent, MODEL_BROKEN); + setorigin(spawn_ent, spawn_org); + setsize (spawn_ent, VEC_ORIGIN, VEC_ORIGIN); + return spawn_ent; +}; + +//---------------------------------------------------------------------- +// Check for SKILL spawning conditions (frame 0 check ONLY) +// Returns FALSE = do nothing TRUE = inhibit spawning +//---------------------------------------------------------------------- +float() check_nightmare = +{ + // Check for nightmare skill only spawning + if (self.nightmare == TRUE) { + // Double check the coop console variable, not setup till frame 1+ + // Use a nosave variable to prevent constant cvar command checking + if (skill_cvar != TRUE) { skill = cvar("skill"); skill_cvar = TRUE; } + if (skill == SKILL_NIGHTMARE) return FALSE; + else { + // Check for BSP entities has origin is different + if (self.bsporigin) spawn_marker(bmodel_origin(self), SPNMARK_RED); + else spawn_marker(self.origin, SPNMARK_RED); + // Hide entity instead of removing it + // Because of possible active touch functions + entity_hide(self); + return TRUE; + } + } + return FALSE; +}; + +//---------------------------------------------------------------------- +// Check for COOP spawning conditions (frame 0 check ONLY) +// Returns FALSE = do nothing TRUE = inhibit spawning +//---------------------------------------------------------------------- +float() check_coop = +{ + // Check for coop only spawning conditions + if (self.cooponly == TRUE || self.cooponly == NEGATIVE) { + // Double check the coop console variable, not setup till frame 1+ + // Use a nosave variable to prevent constant cvar command checking + if (coop_cvar != TRUE) { coop = cvar("coop"); coop_cvar = TRUE; } + + // Only one condition will let a cooponly item spawn + // cooponly = 1 coop = 0 inhibit = TRUE + // cooponly = 1 coop = 1 inhibit = FALSE + // cooponly = -1 coop = 0 inhibit = TRUE + // cooponly = -1 coop = 1 inhibit = TRUE + if (self.cooponly == TRUE && coop == TRUE) return FALSE; + else { + // Check for BSP entities has origin is different + if (self.bsporigin) spawn_marker(bmodel_origin(self), SPNMARK_PURPLE); + else spawn_marker(self.origin, SPNMARK_PURPLE); + // Hide entity instead of removing it + // Because of possible active touch functions + entity_hide(self); + return TRUE; + } + } + return FALSE; +}; + +//====================================================================== +// Clear all trigger strings +// +//---------------------------------------------------------------------- +void (entity targ) clear_trigstrs = +{ + if (targ.target != "") targ.target = string_null; + if (targ.target2 != "") targ.target2 = string_null; + if (targ.killtarget != "") targ.killtarget = string_null; +}; + +//====================================================================== +// Vector randomizer, used mostly for avelocity setups +// Used all over the place; monsters, weapons and gibs! +// +//---------------------------------------------------------------------- +vector(float base, float rndmix, float plusminus) vecrand = +{ + local vector vecmix; + if (plusminus) { + vecmix_x = base + crandom() * rndmix; + vecmix_y = base + crandom() * rndmix; + vecmix_z = base + crandom() * rndmix; + } + else { + vecmix_x = base + random() * rndmix; + vecmix_y = base + random() * rndmix; + vecmix_z = base + random() * rndmix; + } + return vecmix; +}; + +//====================================================================== +// model_fade : Gradually fade out a model over time +// * Optionally entity removal if height = 0 +// +//---------------------------------------------------------------------- +void() model_fade = +{ + self.alpha = 1 - ((time - self.ltime) / 1); + + if (self.alpha > 1) self.alpha = 1; + else if (self.alpha <= 0) { + self.alpha = 0; + self.model = ""; + // Remove model by default + if (!self.height) { + self.think = SUB_Remove; + self.nextthink = time + 1; + } + return; + } + + self.nextthink = time + FADEMODEL_TIME; +}; + diff --git a/QC_other/QC_keep/targets.qc b/QC_other/QC_keep/targets.qc new file mode 100644 index 00000000..04c42071 --- /dev/null +++ b/QC_other/QC_keep/targets.qc @@ -0,0 +1,855 @@ +/*====================================================================== + TARGET FUNCTIONS + + Trigger_relay and trigger_count are not triggers, they don't have + any touch functionality and don't even set/use any of the activator + system used by most trigger/func entities. + + These entities are essentially targets that reply on input from other + targets (use) and then use their targets (conditionally). They should + be re-classifed as target_relay and target_count, but it is too late now + for such a change, the opportunity has long gone! + +======================================================================*/ +float TRIG_COUNTNOMESSAGE = 1; // Prevents all count messages +float TRIG_RANDOMTARGET = 2; // Randomly trigger target/target2 +float TRIG_RELAYSTARTDIS = 32; // trigger_delay starts disabled +float TRIG_EXPLODENOEFF = 2; // No old particle effect +float TRIG_EXPLODEDUST = 4; // Exploding projectile dust +float TRIG_MONKILLDFUNC = 16; // kill monsters via death function +float TRIG_DELAY = 64; // Starts disabled + +float TRIG_ENGFITZ = 1; // Fitz engine +float TRIG_ENGDP = 2; // DP engine +float TRIG_ENGFTE = 4; // FTE/QSS engine +float TRIG_ENGRAIN = 16; // Check for rain effects +float TRIG_ENGSNOW = 32; // Check for snow effects + +/*====================================================================== +/*QUAKED trigger_relay (0.5 0 0.5) (-8 -8 -8) (8 8 8) x RANDOM x x x x x x Not_Easy Not_Normal Not_Hard +Triggers target(s) with custom sounds and messages +-------- KEYS -------- +targetname : trigger entity +target : targets to trigger when relay is activated +target2 : secondary targets to trigger when activated +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +wait : -1 = will only fire targets once +delay : delay before firing (after being triggered) +cnt : random amount of time to add to delay +waitmin : % random chance between target/target2 +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +RANDOM : Will randomly select between target/target2 +-------- NOTES -------- +This fixed size trigger cannot be touched, it can only be fired by other events. +Can contain killtargets, targets, delays, and messages. + +======================================================================*/ +void() trigger_relay_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + //---------------------------------------------------------------------- + // The Shotgun and Axe upgrades can make maps too easy, allow for + // triggers to not fire if the key is TRUE and inventory empty + //---------------------------------------------------------------------- + if ( other.flags & FL_CLIENT ) { + if (self.upgrade_axe && !(other.moditems & IT_UPGRADE_AXE)) return; + if (self.upgrade_ssg && !(other.moditems & IT_UPGRADE_SSG) ) return; + if (self.upgrade_lg && !(other.moditems & IT_UPGRADE_LG) ) return; + } + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // Randomly pick between target/target2 + // SUB_UseTargets will fire both target strings if found + // the random choices need to be stored elsewhere (noise3/4) + if (self.spawnflags & TRIG_RANDOMTARGET) { + if (random() < self.waitmin) self.target = self.noise3; + else self.target = self.noise4; + } + + // One thing to note about trigger_relay is that it does not change the + // activator global variable to the entity that used this trigger last + // This is handy for client test triggers (like trigger_secret) + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() trigger_relay = +{ + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGRELAY; + if (self.delay <= 0) self.delay = 0; + if (self.cnt > 0) self.delay = self.delay + random()*self.cnt; + + // Setup random trigger selection strings and random % + // No checks are done on the target/target so that they can + // be blank and the mapper can randomly select an empty trigger + // only check = The random % has got to exist between 0-1 + if (self.spawnflags & TRIG_RANDOMTARGET) { + if (self.waitmin <=0 || self.waitmin >= 1) self.waitmin = 0.5; + self.noise3 = self.noise4 = ""; // Initialize strings + self.noise3 = self.target; // Copy over strings + self.noise4 = self.target2; + self.target = self.target2 = ""; // Remove originals + } + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_relay_use; + // Setup intial entity state (can start disabled) + if (self.spawnflags & TRIG_RELAYSTARTDIS) self.estate = ESTATE_DISABLE; + else self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_counter (0.5 0 0.1) (-8 -8 -8) (8 8 8) NOMESSAGE x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A counter which triggers target(s) when complete +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger target(s) when complete +message2: message to display when complete (ignores NOMESSAGE spawnflag) +count : number of triggers needed to fire own target, (def=2) +delay : time delay to fire final trigger event +sounds : 0=silent,1=Secret,2=talk,3=switch,5=custom,6=secret2 +noise : custom sound to play when complete +-------- SPAWNFLAGS -------- +NOMESSAGE : disables count display +STARTOFF : Requires trigger to activate +-------- NOTES -------- +A counter which triggers target(s) when complete + +======================================================================*/ +void() trigger_counter_reset = +{ + // Reset counter to initial (spawning) value + self.count = self.height; +}; + +//---------------------------------------------------------------------- +void() trigger_counter_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Check for any pre-count messages + if (self.startmsg != "") { + centerprint (activator, self.startmsg); + self.startmsg = ""; + self.nextthink = time + self.wait; + self.think = self.estate_use; + return; + } + + self.count = self.count - 1; + if (self.count < 0) return; + + // Count down messages for trigger + if (self.count > 0) { + if (activator.flags & FL_CLIENT && !(self.spawnflags & TRIG_COUNTNOMESSAGE) ) { + if (self.count >= 4) centerprint (activator, "There are more to go..."); + else if (self.count == 3) centerprint (activator, "Only 3 more to go..."); + else if (self.count == 2) centerprint (activator, "Only 2 more to go..."); + else centerprint (activator, "Only 1 more to go..."); + } + return; + } + + // Reach zero on counter, time to trigger counter target + if (activator.flags & FL_CLIENT) { + if (self.message2 != "") centerprint(activator, self.message2); + else if ( !(self.spawnflags & TRIG_COUNTNOMESSAGE) ) + centerprint(activator, "Sequence completed!"); + } + + // If sound defined, play sound + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // This is a big problem with the trigger_counter entity, it does not update + // the activator global variable and does not wake up enemies correctly. + // If a trigger_count is targetting monsters then they will not get angry + // at the player, the count has to target a _once or _multi trigger instead. + self.enemy = activator; + SUB_UseTargets(); +}; + +//---------------------------------------------------------------------- +void() trigger_counter_delay = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Remove the trigger delay function + if (self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Re-route use function to actual counter + self.estate_use = trigger_counter_use; +}; + +//---------------------------------------------------------------------- +void() trigger_counter = +{ + trigger_bmodel_sounds(); // Precache any sounds + if (!self.count) self.count = 2; // default count + self.height = self.count; // Save for later, reset + self.classtype = CT_TRIGCOUNT; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_reset = trigger_counter_reset; + self.estate = ESTATE_ON; + + // The delay function is not switched off, its activate to use + if (self.spawnflags & ENT_STARTOFF) self.estate_use = trigger_counter_delay; + else self.estate_use = trigger_counter_use; +}; + +/*====================================================================== +/*QUAKED trigger_engine (0 0 1) (-8 -8 -16) (8 8 16) FITZ DP FTE x RAIN SNOW x x +Triggers target(s) when certain engine active +-------- KEYS -------- +targetname : trigger entity +target : targets to trigger when relay is activated +wait : -1 = will only fire targets once +delay : delay before firing (after being triggered) +cnt : random amount of time to add to delay +-------- SPAWNFLAGS -------- +FITZ : Only trigger for Fitz engines (default type) +DP : Only trigger for DP engine +FTE : Only trigger for FTE/QSS engines +RAIN : Check for rain effect being active +SNOW : Check for snow effect being active +-------- NOTES -------- +Triggers target(s) when certain engine active + +======================================================================*/ +void() trigger_engine_fire = +{ + // Parameter to check at of tests + self.aflag = FALSE; + + // Check each engine type for conditions + // This trigger will not reset the activator + // Should be done with one of the targets instead + if (self.spawnflags & TRIG_ENGFITZ && engine == ENG_FITZ) self.aflag = TRUE; + else if (self.spawnflags & TRIG_ENGDP && engine == ENG_DPEXT) self.aflag = TRUE; + // Extra check for FTE/QSS (they support DP particles) + else if (self.spawnflags & TRIG_ENGFTE && engine == ENG_DPEXT) { + if (checkextension("FTE_SV_POINTPARTICLES")) self.aflag = TRUE; + } + + if (self.aflag == TRUE) { + // Check for engine weather effects + if (self.spawnflags & TRIG_ENGRAIN && !ext_dprain) self.aflag = FALSE; + if (self.spawnflags & TRIG_ENGSNOW && !ext_dpsnow) self.aflag = FALSE; + // Check for weather being disabled + if (self.spawnflags & (TRIG_ENGRAIN | TRIG_ENGSNOW)) { + if (query_configflag(SVR_WEATHER)) self.aflag = FALSE; + } + + // If engine and/or weather active, fire targets! + if (self.aflag == TRUE) SUB_UseTargets(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_engine_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Setup to trigger once? + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + + // Check for any trigger delay? + if (self.delay > 0) { + self.think = trigger_engine_fire; + self.nextthink = time + self.delay; + } + else trigger_engine_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_engine = +{ + self.classtype = CR_TRIGENG; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_engine_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_clientmsg (0.5 0.5 0) (-8 -8 -16) (8 8 16) x +Centerprints a message to all clients +-------- KEYS -------- +targetname : trigger entity +message : Text to center print +sounds : 1=Secret,2=talk,3=switch,4=silent(def),5=custom,6=secret2 +noise : custom sound to play when triggered +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Centerprints a message to all clients + +======================================================================*/ +void() trigger_clientmsg_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Write message to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CENTERPRINT); + WriteString (MSG_ALL, self.message); + + // If any sounds defined play them at entity source + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); +}; + +//---------------------------------------------------------------------- +void() trigger_clientmsg = +{ + // Default = the sound of silence! + if (self.sounds == 0) self.sounds = 4; + trigger_bmodel_sounds(); + + // Setup default message + if (self.message == "") self.message = "Default Trigger Message!\n"; + self.classtype = CT_TRIGCLMSG; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_clientmsg_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_cdtrack (0.8 0.5 0) (-8 -8 -16) (8 8 16) x +Change CD track for all clients +-------- KEYS -------- +targetname : trigger entity +count : CD track number (eg. 0-x) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Change CD track for all clients + +======================================================================*/ +void() trigger_cdtrack_change = +{ + // Write CD track to all clients + msg_entity = self; + WriteByte (MSG_ALL, SVC_CDTRACK); + WriteByte (MSG_ALL, trig_cdtrack); + WriteByte (MSG_ALL, trig_cdtrack); +}; + +//---------------------------------------------------------------------- +void() trigger_cdtrack_use = +{ + // Check for entity state system block + if (self.estate & ESTATE_BLOCK) return; + + // Make sure CD track change in savefile + trig_cdtrack = self.count; + + // Write message to all clients + trigger_cdtrack_change(); +}; + +//---------------------------------------------------------------------- +void() trigger_cdtrack = +{ + self.classtype = CT_TRIGCDTRACK; + // Make sure specified cd track is integer number + self.count = fabs(rint(self.count)); + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_cdtrack_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_skybox (0.9 0.9 0.9) (-8 -8 -16) (8 8 16) x +Load/Change Skybox for all clients +-------- KEYS -------- +targetname : trigger entity +message : Skybox name (eg moonrise_) +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Load/Change Skybox for all clients + +======================================================================*/ +void(entity targ) trigger_skybox_change = +{ + // Write skybox change to all clients + stuffcmd(targ, "SKY "); + stuffcmd(targ, trig_skybox); + stuffcmd(targ, "\n"); +}; + +//---------------------------------------------------------------------- +void() trigger_skybox_use = +{ + // Check for entity state system block + if (self.estate & ESTATE_BLOCK) return; + + // Check for client trigger first + if (activator.classtype == CT_PLAYER) self.enemy = activator; + + // Find a player for the stuff command + if (!self.enemy) { + self.enemy = find(world,targetname,"player"); + if (self.enemy.classtype != CT_PLAYER) return; + } + + // Write skybox name to all clients + trig_skybox = self.message; + trigger_skybox_change(self.enemy); +}; + +//---------------------------------------------------------------------- +void() trigger_skybox = +{ + self.classtype = CT_TRIGSKYBOX; + if (self.message == "") self.message = "Sky"; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_skybox_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_itemrespawnupd (0.5 0 0.5) (-8 -8 -16) (8 8 16) x x x x RESPAWN x x x +Change the state of respawn flag on items +-------- KEYS -------- +targetname : trigger entity +target : this points to the item to affect +-------- SPAWNFLAGS -------- +RESPAWN : Value of respawn flag to copy to item +-------- NOTES -------- +Change the state of respawn flag on items +Useful for switching off respawning items after arena fight is over + +======================================================================*/ +void() trigger_itemrespawnupd_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Loop around target(s) and update respawn flag + self.enemy = find (world, targetname, self.target); + while(self.enemy) { + // only work with active items + if (self.enemy.flags & FL_ITEM) { + if (self.spawnflags & ITEM_RESPAWN) { + self.enemy.spawnflags = self.enemy.spawnflags | ITEM_RESPAWN; + } + else { + // Remove respawn flag (even if missing) + self.enemy.spawnflags = self.enemy.spawnflags - (self.enemy.spawnflags & ITEM_RESPAWN); + } + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() trigger_itemrespawnupd = +{ + self.classtype = CT_TRIGITEMFLAG; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_itemrespawnupd_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +QUAKED trigger_monstermovespeed (0.5 0 0.5) (-8 -8 -16) (8 8 16) x +Toggle the monster move speed state +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : this points to the monster(s) to affect +state : -1 = No movement, 0 = Toggle, 1 = Free movement +wait : -1 = trigger once only +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Toggle the monster move speed state + +======================================================================*/ +void() trigger_monstermovespeed_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Loop around target(s) and update move speed + self.enemy = find (world, targetname, self.target); + while(self.enemy) { + // only work with living monsters (ignore rest) + if (self.enemy.flags & FL_MONSTER && self.enemy.health > 0) { + // Is the state a toggle or exact update? + if (self.state == 0) { + if (self.enemy.movespeed < 1) self.enemy.movespeed = 1; + else self.enemy.movespeed = -1; + } + // Exact value update + else self.enemy.movespeed = self.state; + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } + + // Trigger once functionality? + if (self.wait < 0) self.estate = ESTATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trigger_monstermovespeed = +{ + self.classtype = CT_TRIGMONMOVE; + if (self.target == "") { + dprint("\b[MON_MOVESPEED]\b No target set, removing\n"); + remove(self); + } + + // make sure state has the correct values + if (self.state < -1 || self.state > 1) self.state = 0; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monstermovespeed_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_monsterkill (0.5 0 0.5) (-8 -8 -16) (8 8 16) x x x x DEATH x x x +Remove monster(s) from the map +-------- KEYS -------- +targetname : Name of this trigger entity +target : Name of monster(s) to remove/stop +-------- SPAWNFLAGS -------- +DEATH : kill monsters via death function +-------- NOTES -------- +Remove monster(s) from the map + +======================================================================*/ +void() trigger_monsterkill_use = +{ + if (self.estate & ESTATE_BLOCK) return; + // This only works once! + self.use = SUB_Null; + + // Loop around target(s) and remove the game + self.enemy = find (world, targetname, self.target); + while(self.enemy) { + // There are always exceptions to the use of the monster flag + // Point Hell knights don't use monster flag to prevent damage! + if (self.enemy.spawnflags & MON_POINT_KNIGHT && self.enemy.health > 0) + self.enemy.flags = self.enemy.flags | FL_MONSTER; + + // only work with monsters, can't be dead, dying or negative health! + if (self.enemy.flags & FL_MONSTER && self.enemy.health > 0 && !self.enemy.deadflag) { + // Check if death function is required for monster + // Also double check they have a death function setup! + if (self.spawnflags & TRIG_MONKILLDFUNC && self.enemy.th_die) { + self.enemy.takedamage = DAMAGE_YES; + // Always do enough damage to kill the monster + // Can be a problem for ammo resistant + T_Damage (self.enemy, self, self, self.enemy.health+1, NOARMOR); + } + else { + self.enemy.deadflag = DEAD_DEAD; + self.enemy.enemy = world; + self.enemy.health = self.enemy.gibhealth; + + // Update kill counter if no exceptions! + if (!self.enemy.nomonstercount) { + killed_monsters = killed_monsters + 1; + WriteByte (MSG_ALL, SVC_KILLEDMONSTER); + } + + // Stop all animation think functions + self.enemy.think = SUB_Null; + self.enemy.nextthink = time + LARGE_TIMER; + // Finally stop and hide all models + // Should not remove monster, it might have dependancies + entity_hide(self.enemy); + entity_remove(self.enemy.attachment, 0.1); + entity_remove(self.enemy.attachment2, 0.1); + entity_remove(self.enemy.attachment3, 0.1); + } + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterkill = +{ + self.classtype = CT_TRIGMONKILL; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monsterkill_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_monsterattack (0.5 0 0.5) (-8 -8 -16) (8 8 16) x +Force a monster to attack a certain target +-------- KEYS -------- +targetname : Name of this trigger entity +target : Name of monster to affect +target2 : Name of entity to attack +-------- SPAWNFLAGS -------- +-------- NOTES -------- +Force a monster to attack a certain target + +======================================================================*/ +void() trigger_monsterattack_use = +{ + if (self.estate & ESTATE_BLOCK) return; + + // Find target monster first and see if alive? + self.enemy = find (world, targetname, self.target); + // only work with monsters, can't be dead, dying or negative health! + if (self.enemy.flags & FL_MONSTER && self.enemy.health > 0) { + self.oldenemy = find(world, targetname, self.target2); + // Check if attacking target is alive and can be damaged? + if (self.oldenemy.health > 0 && self.oldenemy.takedamage != DAMAGE_NO) { + // Setup monster to attack new target (use damage function) + T_Damage (self.enemy, self.oldenemy, self.oldenemy, 1, NOARMOR); + } + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterattack = +{ + self.classtype = CT_TRIGMONATT; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monsterattack_use; + self.estate = ESTATE_ON; +}; + +//====================================================================== +// General purpose sprite+particle explosion +// Entity is fired once (default) +//====================================================================== +/*QUAKED trigger_explode (.8 .5 .5) (-4 -4 -4) (4 4 4) x EXPLODENOEFF DUST +Triggered entity producing damage + sprite explosion +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +dmg : explosive radius damage (def=40, -1=no damage) +delay : time delay to explosion (def=0s) +noise : string name for explosion sound (def=weapons/r_exp3b.wav) +wait : re-trigger explosions (def=-1 trigger once) +style : 0=Explosion, 1=Plasma, 2=Poison, 3=Electric, 4=Burst (Smoke/Flame/Poison) +height : 0=Small, 1=Medium, 2=Large, -1=Random +count : Random amount of dust particles to spawn (1-x) +pos1 : Base dust velocity (X=Forward, Y=Right, Z=Up) +pos2 : Random dust velocity (X=Forward, Y=Right, Z=Up) +-------- SPAWNFLAGS -------- +EXPLODENOEFF : no old school particle explosion +DUST : Dust particle explosion (use angle for direction) +-------- NOTES -------- +Triggered entity producing damage + sprite explosion + +=============================================================================*/ +void() trig_explode_fire = +{ + // Dust particles are empty models with rocket smoke trails + if (self.spawnflags & TRIG_EXPLODEDUST) { + // Setup direction of projectile + makevectors(self.angles); + // Always spawn at least 1 dust particle + self.lip = 1 + rint(random() * self.count); + while (self.lip > 0) { + // Keep spawning temporary entities + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_PROJ_SMOKE); + + // Randomize the origin of the particles + self.oldorigin = self.origin + (v_right*(crandom()*self.pos1_y)); + setorigin(newmis, self.oldorigin); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + // Use pos1+pos2 vector (calculated from angles) + self.pos3_x = self.pos1_x + ( random() * self.pos2_x ); + self.pos3_y = crandom() * (self.pos1_y + ( random() * self.pos2_y )); + self.pos3_z = self.pos1_z + ( random() * self.pos2_z ); + newmis.velocity = (v_forward*self.pos3_x) + (v_right*self.pos3_y) + (v_up*self.pos3_z); + + // Setup removal and keep counting + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; + self.lip = self.lip - 1; + } + // No damage or sprites needed + return; + } + + // create any explosive radius damage + if (self.dmg > 0) T_RadiusDamage (self, self, self.dmg, self, DAMAGEALL); + + // Check for old particle effect + if ( !(self.spawnflags & TRIG_EXPLODENOEFF) ) { + // classic ID explosion + if (self.style == 0) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + } + // New Rogue extension - Blue + else if (self.style == 1) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 39); // Blue 32 + 7 + WriteByte (MSG_BROADCAST, 8); // Colour range + } + // New Rogue extension - Green + else if (self.style == 2) { + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION2); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + WriteByte (MSG_BROADCAST, 55); // Green 48 + 7 + WriteByte (MSG_BROADCAST, 8); // Colour range + } + } + + // Check for randomly sized explosion type + if (self.height == -1) self.lip = rint(0.5+ random() * 2.5); + else self.lip = rint(self.height); + // Work out explosion type offset + self.lip = self.lip + rint(self.style) * 10; + + // Use global function (Fitz/DP aware) + SpawnExplosion(self.lip, self.origin, self.noise); +}; + +//---------------------------------------------------------------------- +void() trig_explode_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Check for Trigger once setting + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + + // Check for explosion delay or straight away blow up + if (self.delay > 0) { + self.nextthink = time + self.delay; + self.think = trig_explode_fire; + } + else trig_explode_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_explode = +{ + // Default settings + self.classtype = CT_TRIGEXPLODE; + if (self.dmg >= 0) self.dmg = DAMAGE_MONROCKET; + if (self.wait == 0) self.wait = -1; + if (self.height == 0 || self.height > 3) self.height = 1; + if (self.style < 0 || self.style > 4) self.style = 0; + self.attack_finished = 0; + + if (self.noise == "") { + if (self.style == 3) self.noise = SOUND_PLASMA_HIT; + else if (self.style == 4) self.noise = SOUND_RESIST_ROCKET; + else self.noise = SOUND_REXP3; // Default + } + precache_sound (self.noise); + + // Precache smoke particles and set default movement + if (self.spawnflags & TRIG_EXPLODEDUST) { + precache_model(MODEL_PROJ_SMOKE); + if (CheckZeroVector(self.angles)) self.angles_y = 360; + if (CheckZeroVector(self.pos1)) self.pos1 = '100 25 100'; + if (CheckZeroVector(self.pos2)) self.pos2 = '100 25 100'; + } + + // Burst Sprites are NOT precached in world.qc + if (self.style == 4) { + // Check for random selection + if (self.height == -1) { + precache_model(SBURST_SMOKE); + precache_model(SBURST_FLAME); + precache_model(SBURST_POISON); + } + else if (self.height == 1) precache_model(SBURST_SMOKE); + else if (self.height == 2) precache_model(SBURST_FLAME); + else precache_model(SBURST_POISON); + } + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trig_explode_use; + self.estate = ESTATE_ON; +}; diff --git a/QC_other/QC_keep/traps.qc b/QC_other/QC_keep/traps.qc new file mode 100644 index 00000000..bb6156bb --- /dev/null +++ b/QC_other/QC_keep/traps.qc @@ -0,0 +1,689 @@ +/*====================================================================== + TRAP SHOOTERS +======================================================================*/ +float TRAP_SNGSPIKE = 1; // Large SNG spikes (high damage) +float TRAP_LASER = 2; // Enforcer style lasers +float TRAP_WIZSPIKE = 4; // Wizard Acid spit spike +float TRAP_HELLSPIKE = 8; // Hell Knight Fire spikes +float TRAP_LARGEGRENADE = 1; // Player grenades (high damage) +float TRAP_LAVAROCKET = 1; // Slow moving Cthton lava ball +float TRAP_FIREROCKET = 2; // Fast moving Gargoyle fireball +float TRAP_JIMROCKET = 4; // Low damage player rocket +float TRAP_LIGHTLARGE = 1; // Cthton Lightning effect +float TRAP_LIGHTDUST = 8; // Dust/Smoke effects at impact +float TRAP_LIGHTPART = 16; // Particle effects at impact + +float TRAP_GASSTEAM = 1; // Gas particle types (default) +float TRAP_GASFIRE = 2; +float TRAP_GASPOISON = 4; +float TRAP_GASSILENT = 16; // No particle sound effects + +float TRAP_TOGGLE = 32; // Toggle function with triggered +float TRAP_TRACKING = 128; // Keep updating the target position + +/*====================================================================== +/*QUAKED trap_spikeshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) SNG LASER WIZARD HELLK x TOGGLE x TRACK +When triggered, fires a SPIKE in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for projectile to follow, use "360" for angle 0 +wait : time between projectiles (def=0s) +delay : random time between projectile (def=0s) +count : = 1 Continuous mode (toggle/trigger to switch off) +speed : Change projectile speed (def/sng=500, laser=600, wiz=500, hell=300) +-------- SPAWNFLAGS -------- +SNG : shoots large spike (SNG damage) +LASER : shoots laser (Enforcer damage) +WIZARD : shoots acid spike (Wizard damage) +HELLK : shoots fire spike (Hell Knight damage) +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a SPIKE in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_tracking = +{ + if (self.target == "") return; + if (!self.movetarget) + self.movetarget = find(world, targetname, self.target); + + if (self.movetarget) { + // Check for a Bmodel object (special origin) + if (self.movetarget.bsporigin) self.dest1 = bmodel_origin(self.movetarget); + else self.dest1 = self.movetarget.origin; + // Calculate facing angle towards target + self.movedir = normalize(self.dest1 - self.origin); + } +}; + +//---------------------------------------------------------------------- +void() trap_shooter_fire = +{ + local vector lightn_start, lightn_finish; + + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) self.state = STATE_OFF; + if (self.state == STATE_OFF) return; + + // Check for any target entity tracking changes + if (self.spawnflags & TRAP_TRACKING) trap_tracking(); + + // Fire projectile sound + if (self.classtype == CT_LIGHTSHOOTER) { + // Time for a new LG hit sound? + if (self.t_width < time) { + // Lower volume and attenuation just in case of several together + sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + self.t_width = time + 0.6; + } + } + else if (self.noise != "") + sound (self, CHAN_VOICE, self.noise, self.volume, ATTN_NORM); + + // Determine type of projectile shooter + if (self.classtype == CT_SPIKESHOOTER) { + launch_projectile (self.origin, self.movedir, self.classproj ,self.speed); + } + else if (self.classtype == CT_GRENADESHOOTER) { + self.finaldest = self.movedir * self.speed; + self.finaldest_z = ELEV_ZAXIS; + self.finalangle = vecrand(100,200,FALSE); + Launch_Grenade(self.origin, self.finaldest, self.finalangle, self.classproj); + } + else if (self.classtype == CT_ROCKETSHOOTER) { + if (self.spawnflags == TRAP_LAVAROCKET) self.finalangle = vecrand(100,200,FALSE); + else self.finalangle = '0 0 0'; + Launch_Missile (self.origin, self.movedir, self.finalangle, self.classproj, self.speed); + } + else if (self.classtype == CT_LIGHTSHOOTER) { + // Double check a destination origin exists + if (CheckZeroVector(self.dest1)) return; + + self.effects = self.effects | EF_MUZZLEFLASH; + + // setup any random X/Y/Z start/end point wobble + lightn_start = lightn_finish = '0 0 0'; + if (CheckZeroVector(self.pos1) == FALSE) { + lightn_start_x = self.pos1_x * crandom(); + lightn_start_y = self.pos1_y * crandom(); + lightn_start_z = self.pos1_z * crandom(); + } + lightn_start = lightn_start + self.origin; + if (CheckZeroVector(self.pos2) == FALSE) { + lightn_finish_x = self.pos2_x * crandom(); + lightn_finish_y = self.pos2_y * crandom(); + lightn_finish_z = self.pos2_z * crandom(); + } + lightn_finish = lightn_finish + self.dest1; + + // trace a line from trap in direction or an exact end point + traceline(lightn_start, lightn_finish, TRUE, self); + + // Check for particle effects at impact + // Designed to spray dust back towards source origin + if (self.spawnflags & TRAP_LIGHTDUST && random() < 0.7) { + // Classic temporary entity + newmis = spawn(); + newmis.classgroup = CG_TEMPENT; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_PROJ_SMOKE); + setorigin(newmis, trace_endpos); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + // Work out vector between source and target + self.pos3 = normalize(lightn_finish - lightn_start); + // Convert vector to angle so v_forward/v_right correct + self.pos3 = vectoangles(self.pos3); + makevectors(self.pos3); + + // Randomize the X/Y and push the vector back to source + newmis.velocity = (crandom()*v_right)*150 + v_forward*(150+random()*300); + + // Temporary ents, quickly remove afterward + newmis.nextthink = time + 1 + random()*3; + newmis.think = SUB_Remove; + } + if (self.spawnflags & TRAP_LIGHTPART) + particle_explode(trace_endpos, 5+random()*5, 1, PARTICLE_BURST_BLUE, PARTICLE_BURST_LOSTUP); + + // Generate the lightning effect + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, self.lip); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, lightn_start_x); + WriteCoord (MSG_BROADCAST, lightn_start_y); + WriteCoord (MSG_BROADCAST, lightn_start_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + // Check for things to damage in between the two points + LightningDamage (lightn_start, trace_endpos, self, self.dmg); + } + + // Check for temporary continuous mode + if (self.waitmin > 0 && time < self.pausetime) { + self.think = trap_shooter_fire; + self.nextthink = time + self.waitmin2; + } + else { + // Continuous mode? + if (self.spawnflags & TRAP_TOGGLE) { + self.think = trap_shooter_fire; + self.nextthink = time + self.wait + random()*self.delay; + } + // Fire once and switch off + else self.state = STATE_OFF; + } +}; + +//---------------------------------------------------------------------- +void() trap_shooter_use = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) return; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Toggle shooter on/off + if (self.state == STATE_OFF) { + self.state = STATE_ON; + if (self.waitmin > 0) self.pausetime = time + self.waitmin; + if (!self.waitmin2) self.waitmin2 = 0.1; + } + else self.state = STATE_OFF; + + trap_shooter_fire(); +}; + +//---------------------------------------------------------------------- +void() trap_shooter_reset = +{ + self.estate = ESTATE_ON; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_spikeshooter = +{ + if (self.spawnflags & TRAP_SNGSPIKE) { + self.mdl = MODEL_PROJ_SNG; + self.noise = "weapons/spike2.wav"; + self.classproj = CT_PROJ_SNG; + if (!self.speed) self.speed = SPEED_TRAPSPIKE; + } + else if (self.spawnflags & TRAP_LASER) { + self.mdl = MODEL_PROJ_LASER; + self.noise = "enforcer/enfire.wav"; + self.classproj = CT_PROJ_LASER; + if (!self.speed) self.speed = SPEED_LASER; + // Used for impact sound of laser + precache_sound ("enforcer/enfstop.wav"); + } + else if (self.spawnflags & TRAP_WIZSPIKE) { + self.mdl = MODEL_PROJ_WIZ; + self.noise = "weapons/spike2.wav"; + self.volume = 0.5; + self.classproj = CT_PROJ_WIZ; + if (!self.speed) self.speed = SPEED_WIZSPIKE; + } + else if (self.spawnflags & TRAP_HELLSPIKE) { + self.mdl = MODEL_PROJ_HKN; + self.noise = "weapons/spike2.wav"; + self.volume = 0.5; + self.classproj = CT_PROJ_HKN; + if (!self.speed) self.speed = SPEED_HKSPIKE; + } + else { + self.mdl = MODEL_PROJ_NG; + self.noise = "weapons/spike2.wav"; + self.classproj = CT_PROJ_NG; + if (!self.speed) self.speed = SPEED_TRAPSPIKE; + } + precache_model (self.mdl); + precache_sound (self.noise); + + self.classtype = CT_SPIKESHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 1; + self.mangle = self.angles; + SetMovedir (); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; + +/*====================================================================== +/*QUAKED trap_grenadeshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) LARGE x x x x TOGGLE x TRACK Not_Easy Not_Normal Not_Hard Not_DM +When triggered, fires a GRENADE in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for projectile to follow, use "360" for angle 0 +wait : time between projectiles (def=0s) +delay : random time between projectile (def=0s) +speed : Change projectile speed (def=500, large=600) +-------- SPAWNFLAGS -------- +LARGE : shoots high damage grenade (Player damage, def=ogre) +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a GRENADE in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_grenadeshooter = +{ + self.mdl = MODEL_PROJ_GRENADE; + precache_model (self.mdl); + self.noise = "weapons/grenade.wav"; + precache_sound (self.noise); + + if (self.spawnflags & TRAP_LARGEGRENADE) { + self.classproj = CT_PROJ_GL; + if(!self.speed) self.speed = SPEED_PLAYGRENADE; + } + else { + self.classproj = CT_PROJ_GLMON; + if(!self.speed) self.speed = SPEED_PLAYGRENADE; + } + + self.classtype = CT_GRENADESHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 1; + self.mangle = self.angles; + SetMovedir (); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; + +/*====================================================================== +/*QUAKED trap_rocketshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) LAVA FIRE JIM x x TOGGLE x TRACK Not_Easy Not_Normal Not_Hard Not_DM +When triggered, fires a ROCKET in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for projectile to follow, use "360" for angle 0 +wait : time between projectiles (def=0s) +delay : random time between projectile (def=0s) +speed : Change projectile speed (def=1000, lava=300, fire=500) +-------- SPAWNFLAGS -------- +LAVABALL : shoots Chthon lava ball (Player damage) +FIREBALL : shoots Gargoyle fire ball (low damage) +JIM FLYER: shoots Jim rocket (low damage) +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a ROCKET in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_rocketshooter = +{ + if (self.spawnflags & TRAP_LAVAROCKET) { + self.mdl = MODEL_PROJ_LAVA; + precache_model (self.mdl); + self.noise = "boss1/throw.wav"; + precache_sound (self.noise); + + self.classproj = CT_PROJ_LAVA; + if (!self.speed) self.speed = SPEED_LAVABALL; + } + else if (self.spawnflags & TRAP_FIREROCKET) { + self.mdl = MODEL_PROJ_GARGOYLE; + precache_model (self.mdl); + self.noise = "gargoyle/attack1.wav"; + precache_sound (self.noise); + + self.classproj = CT_PROJ_GARG; + if (!self.speed) self.speed = SPEED_GARGMISSILE; + } + else if (self.spawnflags & TRAP_JIMROCKET) { + self.mdl = MODEL_PROJ_ROCKET; + precache_model (self.mdl); + self.noise = "weapons/sgun1.wav"; + precache_sound (self.noise); + precache_sound ("jim/rocket_hit.wav"); + + self.classproj = CT_PROJ_JIM2; + if (!self.speed) self.speed = SPEED_RLPLAYER; + } + else { + self.mdl = MODEL_PROJ_ROCKET; + precache_model (self.mdl); + self.noise = "weapons/sgun1.wav"; + precache_sound (self.noise); + + self.classproj = CT_PROJ_ROCKET; + if (!self.speed) self.speed = SPEED_RLPLAYER; + } + + self.classtype = CT_ROCKETSHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 1; + self.mangle = self.angles; + SetMovedir (); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; + +/*====================================================================== +/*QUAKED trap_lightningshooter (0 0.5 0.8) (-8 -8 -8) (8 8 8) LARGE x x DUST PART TOGGLE x TRACK +When triggered, fires a LIGHTNING at the target entity (can be blocked) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for destination (required) +wait : time between projectiles (def=1s) +delay : random time between projectile (def=0s) +volume : Lightning hit sound volume (def=0.75) +dmg : Damage from lightning strike (def=15, large=30) +pos1 : Random XYZ wobble to source position +pos2 : Random XYZ wobble to target position +-------- SPAWNFLAGS -------- +LARGE : Cthton Boss Lightning +DUST : Produce dust/smoke at point of impact +PARTICLE: Produce particles at point of impact +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a LIGHTNING at the target entity (can be blocked) +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_lightningshooter = +{ + self.noise = "weapons/lhit.wav"; + precache_sound (self.noise); + + self.classtype = CT_LIGHTSHOOTER; + if (self.wait <= 0) self.wait = 1; + if (self.delay < 0) self.delay = 0; + if (!self.volume) self.volume = 0.75; + self.t_width = 0; // Light sound timer + + // Sort out lightning damage + if (self.dmg < 1) { + self.dmg = 15; + // Double for large lightning + if (self.spawnflags & TRAP_LIGHTLARGE) self.dmg = 30; + } + + // Work out which lightning bolt to use + if (self.spawnflags & TRAP_LIGHTLARGE) self.lip = TE_LIGHTNING3; + else self.lip = TE_LIGHTNING2; + + // Must have target for destination of lightning + if (self.target == "") { + dprint("\b[TRAP]\b Lightning trap missing target!\n"); + spawn_marker(self.origin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_shooter_use; + self.estate_reset = trap_shooter_reset; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // Find target once everything has spawned + self.nextthink = time + 1 + random(); + self.think = trap_tracking; +}; + +//====================================================================== +/*QUAKED trap_gasshooter (0 .5 .8) (-8 -8 -8) (8 8 8) STEAM FIRE POISON x SILENT TOGGLE x TRACK +When triggered, fires a gas particle in the direction determined by angle +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : targeting entity used for custom direction +angle : direction for stream to follow, use "360" for angle 0 +wait : time between particles (def=0.05s) +speed : velocity speed (def=200) +waitmin: auto switch off timer (def=0.5s) +dmg : damage from contact with particles (def=1) +-------- SPAWNFLAGS -------- +STEAM : White hot clouds of steam (default) +FIRE : Will add burning debuff to player +POISON : Will add poison debuff to player +SILENT : No on/off sound, its silent! +TOGGLE : Trigger will toggle the shooter on/off instead +TRACK : Will update target entity origin before firing +-------- NOTES -------- +When triggered, fires a gas particle in the direction determined by angle +Use TOGGLE spawnflag and trigger to enable continuous mode + +======================================================================*/ +void() trap_gasshooter_touch = +{ + if (other == self.owner) return; + if (other.solid == SOLID_TRIGGER) return; + if (other.health < 1) return; + if (other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + if (other.classtype == self.owner.classtype) return; + + self.attack_finished = time + 1; + + // Check contact is a player? + if (other.flags & FL_CLIENT) { + // Check for debuff particle type first + if (self.owner.spawnflags & TRAP_GASFIRE) + ApplyFireDmg(other, self.owner.dmg, self.owner.dmg); + else if (self.owner.spawnflags & TRAP_GASPOISON) + PoisonDeBuff(other); + else T_Damage (other, self, self, self.owner.dmg, NOARMOR); + } + // Monsters have special damage to kill them quicker + else if (other.flags & FL_MONSTER) T_Damage (other, self, self, DAMAGE_MONFLAME, NOARMOR); + else T_Damage (other, self, self, self.owner.dmg, NOARMOR); + self.velocity = '0 0 0'; +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_think = +{ + self.cnt = self.cnt + 1; + if (self.cnt > 6) remove(self); + else { + self.frame = self.cnt; + self.nextthink = time + 0.1 + random() * 0.05; + } +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_spawn = +{ + local entity partemit; + + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) self.state = STATE_OFF; + if (self.state == STATE_OFF) return; + + // Check for any target entity tracking changes + if (self.spawnflags & TRAP_TRACKING) trap_tracking(); + + partemit = spawn(); + partemit.classtype = CT_TEMPSTREAM; + partemit.owner = self; + partemit.frame = partemit.cnt = 0; + + partemit.movetype = MOVETYPE_FLY; // Fly, no gravity, but contact + partemit.solid = SOLID_TRIGGER; // collision, touch required + setmodel (partemit, self.mdl); + setorigin (partemit, self.origin); + setsize (partemit, VEC_ORIGIN, VEC_ORIGIN); + + partemit.oldorigin = vecrand(0,20,TRUE); + partemit.velocity = (self.movedir * self.speed) + partemit.oldorigin; + partemit.angles_z = random() * 360; + + // If DP engine active remove particle shadow + if (engine == ENG_DPEXT) partemit.effects = partemit.effects + EF_NOSHADOW; + + partemit.nextthink = time + 0.1 + random() * 0.05; + partemit.think = trap_gasshooter_think; + partemit.touch = trap_gasshooter_touch; + + // Continuous mode or auto switch off mode still on? + if (self.spawnflags & TRAP_TOGGLE || self.waitmin2 > time) { + self.think = trap_gasshooter_spawn; + self.nextthink = time + self.wait; + } + // Time to switch off + else { + self.state = STATE_OFF; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + } +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_off = +{ + self.estate = ESTATE_OFF; + // If gas shooter currently on, play switch off sound + if (self.state == STATE_ON) + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + else sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_reset = +{ + self.estate = ESTATE_ON; + // clear any sounds playing + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_on = +{ + self.estate = ESTATE_ON; + self.state = STATE_ON; + sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.waitmin2 = time + self.waitmin; + trap_gasshooter_spawn(); +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter_use = +{ + // Check if disabled/off first + if (self.estate & ESTATE_BLOCK) return; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Toggle shooter on/off + if (self.state == STATE_ON) { + self.state = STATE_OFF; + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + } + else trap_gasshooter_on(); +}; + +//---------------------------------------------------------------------- +void() trap_gasshooter = +{ + if (self.spawnflags & TRAP_GASFIRE) { + self.mdl = SBURST_FLAME; + self.noise1 = "traps/flame_loop.wav"; + self.noise2 = "traps/flame_off.wav"; + } + else if (self.spawnflags & TRAP_GASPOISON) { + self.mdl = SBURST_POISON; + self.noise1 = "traps/steam_loop.wav"; + self.noise2 = "traps/steam_off.wav"; + } + else { + // Steam particles is the default + self.spawnflags = self.spawnflags | TRAP_GASSTEAM; + self.mdl = SBURST_STEAM; + self.noise1 = "traps/steam_loop.wav"; + self.noise2 = "traps/steam_off.wav"; + } + + if (self.spawnflags & TRAP_GASSILENT) { + self.noise1 = SOUND_EMPTY; + self.noise2 = SOUND_EMPTY; + } + precache_model (self.mdl); + precache_sound (self.noise1); + precache_sound (self.noise2); + + self.classtype = CT_GASSHOOTER; + self.solid = SOLID_NOT; // No world interaction + self.movetype = MOVETYPE_NONE; // Static item, no movement + + if (!self.dmg) self.dmg = 1; + if (self.speed < 1) self.speed = 200; + if (self.wait <0.05) self.wait = 0.05; + if (self.waitmin <=0) self.waitmin = 0.5; + + // Does not auto switch off anymore + if (self.spawnflags & TRAP_TOGGLE) self.waitmin = LARGE_TIMER; + + // setup any angle direction + if (self.angles_y == 0) self.angles_y = 360; + self.mangle = self.angles; + SetMovedir(); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trap_gasshooter_use; + self.estate_reset = trap_gasshooter_reset; + self.estate_off = trap_gasshooter_off; + self.estate_on = trap_gasshooter_on; + self.estate = ESTATE_ON; + self.state = STATE_OFF; + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 1 + random(); + self.think = trap_tracking; + } +}; diff --git a/QC_other/QC_keep/traps_hipnotic.qc b/QC_other/QC_keep/traps_hipnotic.qc new file mode 100644 index 00000000..3d33bb45 --- /dev/null +++ b/QC_other/QC_keep/traps_hipnotic.qc @@ -0,0 +1,191 @@ +void () trap_tesla_switched_use = { self.state = (TRUE - self.state); if ( (self.state == TRUE) ) self.nextthink = (time + 0.1); }; + +void () trap_tesla_scan = { + local entity head; + local entity prev; + + tesla_numtargets = FALSE; + head = findradius (self.origin,self.distance); + while ( head ) { + if ( (!(head.flags & FL_NOTARGET) && (head.flags & self.cnt)) ) { + visible (head); + if ( ((visible (head) && (head.health > FALSE)) && (head.struck_by_mjolnir == FALSE)) ) { + if ( (tesla_numtargets == FALSE) ) { + tesla_target = head; + } else { + prev.next_ent = head; + } + tesla_numtargets = (tesla_numtargets + TRUE); + prev = head; + if ( (tesla_numtargets == self.count) ) return ; + } + } + head = head.chain; + } +}; + +void () TeslaLightningThink = { + self.owner.attack_state = FL_SWIM; + if ( (time > self.delay) ) { + self.enemy.struck_by_mjolnir = FALSE; + remove (self); + return ; + } + traceline (self.origin,self.enemy.origin,TRUE,self); + vlen ((self.origin - self.enemy.origin)); + if ( (((trace_fraction != TRUE) || (self.enemy.health <= FALSE)) || (vlen ((self.origin - self.enemy.origin)) > (self.distance + MOVETYPE_BOUNCE))) ) { + self.enemy.struck_by_mjolnir = FALSE; + remove (self); + return ; + } + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST,self); + WriteCoord (MSG_BROADCAST,self.origin_x); + WriteCoord (MSG_BROADCAST,self.origin_y); + WriteCoord (MSG_BROADCAST,self.origin_z); + WriteCoord (MSG_BROADCAST,trace_endpos_x); + WriteCoord (MSG_BROADCAST,trace_endpos_y); + WriteCoord (MSG_BROADCAST,trace_endpos_z); + LightningDamage (self.origin,trace_endpos,self.lastvictim,self.dmg); + self.nextthink = (time + 0.100); +}; + +void (entity targ) SpawnTeslaLightning = { + local entity lgt; + + lgt = spawn (); + if ( (self.duration > FALSE) ) { + lgt.delay = (time + self.duration); + } else { + lgt.delay = (time + 9999.000); + } + lgt.enemy = targ; + targ.struck_by_mjolnir = TRUE; + lgt.distance = self.distance; + lgt.owner = self; + lgt.lastvictim = self.lastvictim; + lgt.dmg = self.dmg; + lgt.origin = self.origin; + lgt.think = TeslaLightningThink; + lgt.nextthink = time; + lgt.deathtype = self.deathtype; +}; + +void () trap_tesla_think = { + if ( (self.state == 0) ) { self.nextthink = (time + 0.250); return; } + if ( (self.attack_state == 0) ) { + self.think = trap_tesla_think; + trap_tesla_scan (); + if ( (tesla_numtargets > FALSE) ) { + if ( (self.wait > FALSE) ) sound (self,CHAN_AUTO,"misc/tesla.wav",TRUE,ATTN_NORM); + self.attack_state = TRUE; + self.nextthink = (time + self.wait); + return ; + } + self.nextthink = (time + 0.250); + if ((self.delay > FALSE) && (time > self.search_time) ) self.attack_state = MOVETYPE_WALK; + } else { + if ( (self.attack_state == TRUE) ) { + trap_tesla_scan (); + while ( (tesla_numtargets > FALSE) ) { + sound (self,CHAN_AUTO,"hipweap/mjolhit.wav",TRUE,ATTN_NORM); + SpawnTeslaLightning (tesla_target); + tesla_target = tesla_target.next_ent; + tesla_numtargets = (tesla_numtargets - TRUE); + } + self.attack_state = FL_SWIM; + self.nextthink = (time + TRUE); + } else { + if ( (self.attack_state == FL_SWIM) ) { + self.attack_state = MOVETYPE_WALK; + self.nextthink = (time + 0.200); + } else { + if ( (self.attack_state == MOVETYPE_WALK) ) { + self.attack_state = FALSE; + self.nextthink = (time + 0.100); + if ( (self.classname == "trap_gods_wrath") ) { + self.nextthink = CONTENT_EMPTY; + } + } + } + } + } +}; + +void () trap_tesla_coil = { + precache_sound ("misc/tesla.wav"); + precache_sound ("hipweap/mjolhit.wav"); + if ( (self.wait == FALSE) ) self.wait = FL_SWIM; + if ( (self.dmg == FALSE) ) self.dmg = (FL_SWIM + (MOVETYPE_FLY * cvar ("skill"))); + if ( (self.duration == FALSE) ) self.duration = CONTENT_EMPTY; + if ( (self.distance == FALSE) ) self.distance = 600.000; + if ( (self.spawnflags & TRUE) ) { self.cnt = (FL_CLIENT | FL_MONSTER); } else { self.cnt = FL_CLIENT; } + self.use = trap_tesla_switched_use; + if ( (self.delay == FALSE) ) self.delay = CONTENT_EMPTY; + self.nextthink = (time + random ()); + self.think = trap_tesla_think; + self.lastvictim = world; + tesla_numtargets = FALSE; + self.attack_state = FALSE; + self.deathtype = "is electrocuted"; +}; + +void () trap_gods_wrath_use = { + if ( (self.attack_state == FALSE) ) { + self.search_time = (time + self.delay); + self.lastvictim = activator; + trap_tesla_think (); + } +}; + +void () trap_gods_wrath = { + if ( (self.delay == FALSE) ) self.delay = MOVETYPE_FLY; + trap_tesla_coil (); + self.wait = FALSE; + self.state = TRUE; + self.nextthink = CONTENT_EMPTY; + self.deathtype = "suffers the wrath of God"; + self.use = trap_gods_wrath_use; +}; + +void () trap_gravity_touch = { + if ( (self.attack_finished > time) ) return ; + if ( other.takedamage ) { T_Damage (other,self,self,self.dmg,DAMARMOR); self.attack_finished = (time + 0.200); } +}; + +void () trap_gravity_think = { + local vector vel; + local vector dir; + local vector delta; + + self.ltime = time; + trap_tesla_scan (); + while ( (tesla_numtargets > FALSE) ) { + delta = (self.origin - tesla_target.origin); + dir = normalize (delta); + vel = (dir * self.speed); + if ( ((tesla_target.wetsuit_finished > time) && (self.spawnflags & UNDERWATER)) ) vel = (vel * 0.600); + tesla_target.velocity = (tesla_target.velocity + vel); + tesla_target = tesla_target.next_ent; + tesla_numtargets = (tesla_numtargets - TRUE); + } + self.nextthink = (time + 0.100); +}; + +void () trap_gravity_well = { + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setsize (self,'-16.000 -16.000 -16.000','16.000 16.000 16.000'); + if ( (self.dmg == FALSE) ) self.dmg = 10000.000; + if ( (self.speed == FALSE) ) self.speed = 210.000; + if ( (self.distance == FALSE) ) self.distance = 600.000; + if ( (self.spawnflags & TRUE) ) { self.cnt = (FL_CLIENT | FL_MONSTER); } else { self.cnt = FL_CLIENT; } + self.attack_finished = FALSE; + self.think = trap_gravity_think; + self.touch = trap_gravity_touch; + self.lastvictim = world; + tesla_numtargets = FALSE; + self.nextthink = (time + 0.100); + self.ltime = time; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/traps_pendulum.qc b/QC_other/QC_keep/traps_pendulum.qc new file mode 100644 index 00000000..f6c5b853 --- /dev/null +++ b/QC_other/QC_keep/traps_pendulum.qc @@ -0,0 +1,423 @@ +/*====================================================================== + TRAP PENDULUM +======================================================================*/ +float PEND_MAXFRAME = 12; // Frames 0-12 +float PEND_ANIMGROUP = 13; // Size of animation group +float PEND_MIDFRAME = 7; // Fastest think frame + +float PEND_REVERSE = 1; // Start at frame 12 instead of 0 +float PEND_ONESWING = 2; // Do one swing cycle and stop (back+forth) +float PEND_SHORT = 16; // Short pole version (128 instead of 192) +float PEND_XSWING = 32; // Swing X axis (def=Y) + +//---------------------------------------------------------------------- +// The array is setup from world.qc before anything loads +//---------------------------------------------------------------------- +vector pend_X[26], pend_Y[26], pend_short[26]; + +//---------------------------------------------------------------------- +// As the pendulum swings the bounding box is adjusted around the blade +// Some swings have the bbox ahead of the blade to catch impacts better +// bbox values taken from the original pendulum from Rogue mission pack +// Using view_ofs because the model has been rebuilt/reskinned +//---------------------------------------------------------------------- +void() pendulum_setuparray = +{ + local float loopc, loopd, tempx; + local vector tbuffer; + + pend_Y[0] = '-8 -176 48'; pend_Y[1] = '8 -120 128'; + pend_Y[2] = '-8 -172 12'; pend_Y[3] = '8 -112 88'; + pend_Y[4] = '-8 -160 -22'; pend_Y[5] = '8 -96 50'; + pend_Y[6] = '-8 -138 -51'; pend_Y[7] = '8 -70 17'; + pend_Y[8] = '-8 -110 -72'; pend_Y[9] = '8 -38 -8'; + pend_Y[10] = '-8 -76 -83'; pend_Y[11] = '8 0 -23'; + pend_Y[12] = '-8 -40 -88'; pend_Y[13] = '8 40 -32'; + pend_Y[14] = '-8 0 -83'; pend_Y[15] = '8 76 -23'; + pend_Y[16] = '-8 38 -72'; pend_Y[17] = '8 100 -8'; + pend_Y[18] = '-8 70 -51'; pend_Y[19] = '8 138 17'; + pend_Y[20] = '-8 96 -22'; pend_Y[21] = '8 160 50'; + pend_Y[22] = '-8 112 12'; pend_Y[23] = '8 172 88'; + pend_Y[24] = '-8 120 48'; pend_Y[25] = '8 176 128'; + + // 128 unit pendulum - Y Swing (default) + pend_short[0] = '0 64 -108'; pend_short[1] = '0 56 -92'; + pend_short[2] = '0 56 -76'; pend_short[3] = '0 48 -60'; + pend_short[4] = '0 36 -52'; pend_short[5] = '0 16 -44'; + pend_short[6] = '0 0 -44'; pend_short[7] = '0 -16 -44'; + pend_short[8] = '0 -32 -52'; pend_short[9] = '0 -48 -60'; + pend_short[10] = '0 -56 -76'; pend_short[11] = '0 -56 -92'; + pend_short[12] = '0 -64 -108'; + + loopc = loopd = 0; + + while (loopc < PEND_ANIMGROUP) { + // Generate X axis vector offset from Y axis data (short pendulum) + tbuffer = pend_short[loopc]; // Read vector offset + tempx = tbuffer_x; // Tempoary store + tbuffer_x = tbuffer_y; // Swap around + tbuffer_y = tempx; // Restore temp + pend_short[PEND_ANIMGROUP + loopc] = tbuffer; + + // Generate X axis swing min/max vector from Y axis data + tbuffer = pend_Y[loopd]; // min bbox + tempx = tbuffer_x; + tbuffer_x = tbuffer_y; + tbuffer_y = tempx; + pend_X[loopd] = tbuffer; + tbuffer = pend_Y[loopd+1]; // max bbox + tempx = tbuffer_x; + tbuffer_x = tbuffer_y; + tbuffer_y = tempx; + pend_X[loopd+1] = tbuffer; + + loopc = loopc + 1; + loopd = loopd + 2; + } +}; + +//---------------------------------------------------------------------- +// The original rogue pendulum adjusted the bbox every animation frame +// FTEQCC supports arrays and the previous method can now be done easier +// Also sets the nextthink time to adjust for swing momentum +//---------------------------------------------------------------------- +void(float frame_seq) trap_pendsize = { + self.cnt = frame_seq * 2; + + // Short pendulum needs a different offset each frame + if (self.spawnflags & PEND_SHORT) { + if (self.spawnflags & PEND_XSWING) self.view_ofs = pend_short[PEND_ANIMGROUP+frame_seq]; + else self.view_ofs = pend_short[frame_seq]; + } + + // X/Y swing axis have different bbox vectors + if (self.spawnflags & PEND_XSWING) { + self.pos1 = pend_X[self.cnt] + self.view_ofs; + self.pos2 = pend_X[self.cnt + 1] + self.view_ofs; + } + else { + self.pos1 = pend_Y[self.cnt] + self.view_ofs; + self.pos2 = pend_Y[self.cnt + 1] + self.view_ofs; + } + setsize( self, self.pos1, self.pos2 ); + + if (self.think) { + // Change nextthink time to simulate the pendulum going fast/slow from momentum + self.cnt = 0.05 + (fabs(PEND_MIDFRAME - (frame_seq + 1)) * 0.02); + self.nextthink = time + self.cnt; + } +}; + +//---------------------------------------------------------------------- +// Pendulum animation frames +//---------------------------------------------------------------------- +$frame pend_frame1 pend_frame2 pend_frame3 pend_frame4 pend_frame5 pend_frame6 pend_frame7 +$frame pend_frame8 pend_frame9 pend_frame10 pend_frame11 pend_frame12 pend_frame13 + +// Stationary idle for beginning and ending +void() pend_idle1 =[ $pend_frame1, pend_idle1 ] {}; +void() pend_idle21 =[ $pend_frame13, pend_idle21 ] {}; + +//---------------------------------------------------------------------- +// Pendulum Swing (one cycle is 26 frames) +//---------------------------------------------------------------------- +void() pend_swing1 =[ $pend_frame1, pend_swing2 ] { + // Stop the pendulum if state is OFF / DISABLED + if (self.estate & ESTATE_BLOCK) self.think = pend_idle1; + else if (self.state == STATE_OFF) self.think = pend_idle1; + else { + self.count = self.count + 1; + if (self.spawnflags & PEND_ONESWING && self.count > 2) { + self.state = STATE_OFF; + self.think = pend_idle1; + } + else { + trap_pendsize(0); // Move bbox to frame 0 + self.aflag = 1; // Direction of pendulum blade (touch function) + } + } +}; +void() pend_swing2 =[ $pend_frame2, pend_swing3 ] { trap_pendsize(1);}; +void() pend_swing3 =[ $pend_frame3, pend_swing4 ] { trap_pendsize(2);}; +void() pend_swing4 =[ $pend_frame4, pend_swing5 ] { trap_pendsize(3); +sound ( self, CHAN_VOICE, self.noise1, 0.5, ATTN_NORM);}; +void() pend_swing5 =[ $pend_frame5, pend_swing6 ] {trap_pendsize(4);}; +void() pend_swing6 =[ $pend_frame6, pend_swing7 ] {trap_pendsize(5);}; +void() pend_swing7 =[ $pend_frame7, pend_swing8 ] {trap_pendsize(6);}; +void() pend_swing8 =[ $pend_frame8, pend_swing9 ] {trap_pendsize(7);}; +void() pend_swing9 =[ $pend_frame9, pend_swing10 ] {trap_pendsize(8);}; +void() pend_swing10 =[ $pend_frame10, pend_swing11 ] {trap_pendsize(9);}; +void() pend_swing11 =[ $pend_frame11, pend_swing12 ] {trap_pendsize(10);}; +void() pend_swing12 =[ $pend_frame12, pend_swing13 ] {trap_pendsize(11);}; +// One extra frame pause at end of sequence +void() pend_swing13 =[ $pend_frame13, pend_swing21 ] {trap_pendsize(12);}; + +//---------------------------------------------------------------------- +void() pend_swing21 =[ $pend_frame13, pend_swing22 ] { + // Stop the pendulum if state is OFF / DISABLED + if (self.estate & ESTATE_BLOCK) self.think = pend_idle21; + else if (self.state == STATE_OFF) self.think = pend_idle21; + else { + self.count = self.count + 1; + if (self.spawnflags & PEND_ONESWING && self.count > 2) { + self.state = STATE_OFF; + self.think = pend_idle21; + } + else { + trap_pendsize(12); // Move bbox to frame 12 + self.aflag = -1; // Direction of pendulum blade (touch function) + } + } +}; +void() pend_swing22 =[ $pend_frame12, pend_swing23 ] {trap_pendsize(11);}; +void() pend_swing23 =[ $pend_frame11, pend_swing24 ] {trap_pendsize(10);}; +void() pend_swing24 =[ $pend_frame10, pend_swing25 ] {trap_pendsize(9); +sound ( self, CHAN_VOICE, self.noise1, 0.5, ATTN_NORM);}; +void() pend_swing25 =[ $pend_frame9, pend_swing26 ] {trap_pendsize(8);}; +void() pend_swing26 =[ $pend_frame8, pend_swing27 ] {trap_pendsize(7);}; +void() pend_swing27 =[ $pend_frame7, pend_swing28 ] {trap_pendsize(6);}; +void() pend_swing28 =[ $pend_frame6, pend_swing29 ] {trap_pendsize(5);}; +void() pend_swing29 =[ $pend_frame5, pend_swing30 ] {trap_pendsize(4);}; +void() pend_swing30 =[ $pend_frame4, pend_swing31 ] {trap_pendsize(3);}; +void() pend_swing31 =[ $pend_frame3, pend_swing32 ] {trap_pendsize(2);}; +void() pend_swing32 =[ $pend_frame2, pend_swing33 ] {trap_pendsize(1);}; +// One extra frame pause at end of sequence +void() pend_swing33 =[ $pend_frame1, pend_swing1 ] {trap_pendsize(0);}; + +//---------------------------------------------------------------------- +// if something has touched the pendulum, damage and bounce away +//---------------------------------------------------------------------- +void() trap_pendulum_touch = +{ + // Blade can still hurt if touched, except when OFF = not visible + if (self.estate & ESTATE_OFF) return; + // Double check if dead monster body! + if (trigger_check_body(other,DEAD_EXPLODE)) return; + if (other.health < 1 || other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + if (self.waitmin > 0) self.attack_finished = time + self.waitmin; + + // only play hit sound once per second + if (self.pain_finished < time) { + sound ( self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + self.pain_finished = time + 1; + } + + // Instant death for monsters, they can get knocked into wierd locations + if (other.flags & FL_MONSTER) + T_Damage (other, self, self, other.max_health + 100, DAMARMOR); + else + // Small damage but can be lethal because of how often touch runs + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // Fling the player/object away from blade + // Setting aflag in animation frame to specify direction + if (self.spawnflags & PEND_XSWING) other.velocity_x = self.aflag * 250; + else other.velocity_y = self.aflag * 250; + other.velocity_z = 200; // Little upward lift + + // Blood and gore at object location not pendulum + SpawnMeatSpray (other, other, crandom() * 200); +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_fire = +{ + // Swing counter + self.count = 0; + // Make sure starting frame is start or finish + if (self.frame != 0 && self.frame != PEND_MAXFRAME) + self.frame = self.frame_override; + + // Setup next frame to update swing + if (self.frame == 0) self.think = pend_swing1; + else self.think = pend_swing13; + self.nextthink = time + 0.01 + self.wait; +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_use = +{ + // Deal with STARTOFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove spawnflag and switch ON entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.state = STATE_OFF; // use toggle function + self.estate_on(); // switch on + } + + // Block USE functionality if state wrong + if (self.estate & ESTATE_BLOCK) return; + + // Toggle state of pendulum to start/stop + if (self.state == STATE_OFF) { + self.state = STATE_ON; + trap_pendulum_fire(); + } + else self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_on = +{ + // Turn on model/world interaction + self.estate = ESTATE_ON; + self.solid = SOLID_TRIGGER; + self.movetype = MOVETYPE_NONE; + setmodel (self, self.mdl); + setsize (self, self.mins , self.maxs); + trap_pendsize(self.frame); +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setmodel (self, ""); + self.frame = self.frame_override; + self.state = STATE_OFF; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() trap_pendulum_disable = +{ + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trap_pendlong = +{ + // Short/long version of the model + if (self.spawnflags & PEND_SHORT) self.mdl = "progs/ad171/trap_pendshort.mdl"; + else self.mdl = "progs/ad171/trap_pendlong.mdl"; + precache_model (self.mdl); + + self.view_ofs = '0 0 -108'; // Offset bbox vectors (new model different location) + self.oldorigin = '0 0 0'; // Entity is correct location + + self.noise1 = "traps/pend_swing.wav"; + self.noise2 = "traps/pend_hit.wav"; + precache_sound (self.noise1); + precache_sound (self.noise2); + + self.classtype = CT_PENDULUM; + if (self.dmg == 0) self.dmg = 5; // Default touch damage + if (self.dmg < 0) self.dmg = 0; // Use -1 for no damage option + if (self.wait <= 0) self.wait = 0; // Default starting delay + if (!self.waitmin) self.waitmin = 0.5; // Damage throttle + self.state = STATE_OFF; + + // Error - Check for targetname for trigger event + if (self.targetname == "") { + dprint("\b[PENDULUM]\b missing targetname, cannot be triggered!\n"); + } + + // Rotate model and swing on X axis instead + if (self.spawnflags & PEND_XSWING) self.angles = '0 270 0'; + else self.angles = '0 0 0'; + + // Start the opposite way around (frame 13 instead of 1) + // This also affects one swing parameter + if (self.spawnflags & PEND_REVERSE) self.frame_override = PEND_MAXFRAME; + else self.frame_override = 0; + self.frame = self.frame_override; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trap_pendulum_on; + self.estate_off = trap_pendulum_off; + self.estate_use = trap_pendulum_use; + self.estate_disable = trap_pendulum_disable; + self.touch = trap_pendulum_touch; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() trap_pendlongx = +{ + self.spawnflags = self.spawnflags | PEND_XSWING; + trap_pendlong(); +} + +//---------------------------------------------------------------------- +void() trap_pendshort = +{ + self.spawnflags = self.spawnflags | PEND_SHORT; + trap_pendlong(); +} + +//---------------------------------------------------------------------- +void() trap_pendshortx = +{ + self.spawnflags = self.spawnflags | PEND_SHORT; + self.spawnflags = self.spawnflags | PEND_XSWING; + trap_pendlong(); +} + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendlong (0.5 0.75 0) (-8 -192 -24) (8 0 24) REVERSE ONESWING x x x x STARTOFF x +Long (192 units) Pendulum (From Rogue mission pack) +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Long (192 units) Pendulum (From Rogue mission pack) +*/ + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendlongx (0.5 0.75 0) (-192 -8 -24) (0 8 24) REVERSE ONESWING x x x x STARTOFF x +Long (192 units) Pendulum working on X axis only +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Long (192 units) Pendulum working on X axis only +*/ + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendshort (0.5 0.75 0) (-8 -192 -24) (8 0 24) REVERSE ONESWING x x x x STARTOFF x +Short (128 units) Pendulum +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Short (128 units) Pendulum +*/ + +//----------------------------------------------------------------------------- +/*QUAKED trap_pendshortx (0.5 0.75 0) (-192 -8 -24) (0 8 24) REVERSE ONESWING x x x x STARTOFF x +Short (128 units) Pendulum working on X axis only +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +dmg : Damage to do for each contact, def=5 +waitmin : Damage throttle to touch function, def=0.5s +wait : amount of time (seconds) before starting swinging. def=0 +-------- SPAWNFLAGS -------- +REVERSE : Starts at frame 12 instead 0 +ONESWING : Will do a single swing (back + forth) when triggered +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Short (128 units) Pendulum working on X axis only +*/ diff --git a/QC_other/QC_keep/traps_sawblade.qc b/QC_other/QC_keep/traps_sawblade.qc new file mode 100644 index 00000000..aa753687 --- /dev/null +++ b/QC_other/QC_keep/traps_sawblade.qc @@ -0,0 +1,282 @@ +/*====================================================================== + TRAP Sawblade + * Originally based on code from Rogue Software + * Extra code support from lunaran +======================================================================*/ +float SAW_STARTON = 1; +float SAW_XAXIS = 16; +float SAW_REVERSE = 32; + +/*====================================================================== +/*QUAKED trap_sawbladex (0 .5 .8) (-18 -18 -18) (18 18 18) STARTON x x x x REVERSE STARTOFF x +Rotating Saw Blade +-------- KEYS -------- +targetname : toggle state (use trigger ent for exact state) +target : Name of first path_corner to start at (instant move) +speed : Speed to follow path, def=100 +yaw_speed : Rotation speed for Saw Blade (def=180) +dmg : Damage to do for each contact, def=4 +waitmin : Damage throttle for ON touch function, def=0.1s +height : Damage throttle for OFF touch function, def=1s +lip : Deceleration time; def=2s, =-1 instant stop +sounds : 0=Silent, 1=Woodmill, 5=Custom sounds +noise : custom sound - stopped +noise1 : custom sound - moving (looping) +-------- SPAWNFLAGS -------- +STARTON : Start moving straight away if targetname is used +REVERSE : Start going backward through path_corner chain +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Rotating Saw Blade + +======================================================================*/ + +void() trap_sawblade_touch = +{ + // Blade can still hurt if touched, except when OFF = not visible + if (self.estate & ESTATE_OFF) return; + // Double check if dead monster body! + if (trigger_check_body(other,DEAD_EXPLODE)) return; + if (other.health < 1 || other.takedamage == DAMAGE_NO) return; + if (self.attack_finished > time) return; + + // --- lunaran ------------------- + // Different touch damage based on blade state + if (self.state == STATE_ON) { + if (self.waitmin > 0) self.attack_finished = time + self.waitmin; + // Hit sounded added by Lunaran, added sound string check + if (self.noise2 !="") sound (self, CHAN_AUTO, self.noise2, 1, 1); + } + else { + if (self.height > 0) self.attack_finished = time + self.height; + } + + // Instant death for monsters + if (other.flags & FL_MONSTER) + T_Damage (other, self, self, other.max_health + 100, DAMARMOR); + else + // Small damage but can be lethal because of how often touch runs + T_Damage (other, self, self, self.dmg, DAMARMOR); + + // Blood and gore at object location not sawblade + SpawnMeatSpray ( other, other, crandom() * 200); +}; + +//---------------------------------------------------------------------- +// New slowdown/stop function by lunaran +//---------------------------------------------------------------------- +void() trap_sawblade_stopthink = +{ + float remaining; + + // If slow down time expired, make sure blade has stopped + if (self.pain_finished <= time) { + self.velocity = self.avelocity = '0 0 0'; + return; + } + + remaining = (self.pain_finished - time) / self.lip; + + //---------------------------------------------------------------------- + // quit moving if we've hit the next pathcorner + // it'd be cooler to continue on the track as we decelerate but this way + // we don't have to muck about in the func_train code + //---------------------------------------------------------------------- + if (self.rad_time && self.rad_time <= time) { + self.velocity = '0 0 0'; + setorigin(self, self.finaldest); + self.rad_time = 0; + } + + // ramp down from original speed and spinrate over self.lip seconds + if (CheckZeroVector(self.velocity) == FALSE) + self.velocity = normalize(self.velocity) * self.speed * remaining; + self.avelocity = normalize(self.avelocity) * self.yaw_speed * remaining; + + // Double tick time to smooth out slowdown + self.nextthink = time + 0.05; +} + +//---------------------------------------------------------------------- +// New slowdown/stop function by lunaran +//---------------------------------------------------------------------- +void() trap_sawblade_stop = +{ + float d, timeToPathCorner; + + // Play wind down stop sound + sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + // save the time we become completely still in pain_finished + self.pain_finished = time + self.lip; + + // calculate when we'll hit the next pathcorner (if ever) + // so we can stop there + timeToPathCorner = vlen(self.origin-self.finaldest) / self.speed; + + // linear deceleration = stopping distance of exactly 1/2 speed*stoptime + if (self.lip * 0.5 > timeToPathCorner ) { + // linear deceleration = exponential time taken relative to distance + d = mathlib_sqrt( 1 - ( 2 * timeToPathCorner / self.lip ) ); + d = self.lip * ( 1 - d ); + + // save the time in rad_time + self.rad_time = time + d; + } + self.think = trap_sawblade_stopthink; + self.think(); +}; + +//---------------------------------------------------------------------- +void() trap_sawblade_use = +{ + // Block entity state OFF + DISABLE + if (self.estate & ESTATE_BLOCK) return; + + // Toggle function + if (self.state == STATE_OFF) { + self.state = STATE_ON; + // use special train resume function + func_train_resume(); + } + else { + self.state = STATE_OFF; + trap_sawblade_stop(); + } +}; + +//---------------------------------------------------------------------- +void() trap_sawblade_setup = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove start off flag and switch on entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + } + + self.estate_on(); // Switch on entity + func_train_startcorner(); // Move to first corner + self.estate_use = trap_sawblade_use;// Switch ON sawblade + self.estate_fire = func_train_next; // Move to next path corner + self.state = STATE_OFF; // sawblade is OFF, waiting + + // Sharp pointy edges! + self.touch = trap_sawblade_touch; + + // Did the first corner (owner) exist? + if (self.owner && self.spawnflags & SAW_STARTON) { + self.nextthink = time + 0.1; + self.think = self.estate_use; + } +}; + +//---------------------------------------------------------------------- +void() trap_sawblade_on = +{ + // Stop re-triggering ON state + if (self.estate == ESTATE_ON) return; + + // Turn on model/world interaction + self.estate = ESTATE_ON; // Switch on entity + self.solid = SOLID_TRIGGER; // Keep on cutting! + self.movetype = MOVETYPE_NOCLIP; // Free movement + setmodel (self, self.mdl); // Show bmodel/model + setsize (self, self.bbmins , self.bbmaxs); // Use pre-defined size + // Stop any current sounds, new sound will play in func_train function + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.velocity = self.avelocity = '0 0 0'; // reset velocity/rotation +}; + +//---------------------------------------------------------------------- +void() trap_sawbladey = +{ + // 0 = No sound, 1 = buzzzzz, 5 = custom + if (self.sounds > 0) { + if (self.sounds == 1) { + self.noise = ("traps/sawblade_off.wav"); + self.noise1 = ("traps/sawblade_on.wav"); + self.noise2 = ("traps/sawstrike1.wav"); // lunaran + } + else if (self.sounds == 5) { + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; // lunaran + } + precache_sound (self.noise); + precache_sound (self.noise1); + precache_sound (self.noise2); // lunaran + } + + self.mdl = "progs/trap_sawblade.mdl"; + precache_model (self.mdl); + + self.classtype = CT_SAWBLADE; + self.state = STATE_OFF; + self.volume = 0.5; + + // Error - Check for first path corner target + if (self.target == "") { + dprint("\b[SAWBLADE]\b missing path corner target!\n"); + } + + // Setup orientiation and bounding box parameters + // required for state on and touch function + if (self.spawnflags & SAW_XAXIS) { + self.angles = '0 0 0'; + self.bbmins = '-20 -2 -20'; + self.bbmaxs = '20 2 20'; + } + else { + self.angles = '0 90 0'; + self.bbmins = '-2 -20 -20'; + self.bbmaxs = '2 20 20'; + } + + if (!self.dmg) self.dmg = 4; // Default touch damage + if (!self.waitmin) self.waitmin = 0.1; // Damage throttle ON state + if (self.speed < 1) self.speed = 100; // Default path speed + self.wait = self.delay = 0; // reset wait and delay + + // --- lunaran ---------------------- + if (!self.height) self.height = 1; // Damage throttle OFF state + if (!self.lip) self.lip = 2; // Deceleration time, -1 for none + if (self.lip < 0) self.lip = 0; // Convert -1 switch to 0 time + + // Setup default rotation speed + if (!self.yaw_speed) self.yaw_speed = 180; + self.v_angle = '0 0 0'; + self.v_angle_x = self.yaw_speed; + + // Save spawn location + self.dest0 = self.finaldest = self.origin; + if (self.target == "") self.owner = self; + self.bsporigin = FALSE; + + // Cannot have start ON and OFF together, remove OFF state! + if (self.spawnflags & SAW_STARTON && self.spawnflags & ENT_STARTOFF) + self.spawnflags = self.spawnflags - ENT_STARTOFF; + + // Setup train direction (switchable via path corners) + if (self.spawnflags & SAW_REVERSE) self.direction = 1; + else self.direction = 0; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trap_sawblade_on; + self.estate_off = func_train_off; + self.estate_use = trap_sawblade_setup; + self.estate_reset = func_train_reset; + self.estate_disable = func_train_disable; + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else { + self.nextthink = time + 0.1; + self.think = self.estate_use; + } +}; + +//---------------------------------------------------------------------- +void() trap_sawbladex = +{ + self.spawnflags = self.spawnflags | SAW_XAXIS; + trap_sawbladey(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/traps_turret.qc b/QC_other/QC_keep/traps_turret.qc new file mode 100644 index 00000000..feac65ae --- /dev/null +++ b/QC_other/QC_keep/traps_turret.qc @@ -0,0 +1,645 @@ +$cd apoc/progs/turret +$origin 0 0 10 +$base base +$skin base +$frame tilt0 tilt6 tilt12 tilt18 +$frame tilt24 tilt30 tilt36 tilt42 +$frame tilt48 tilt54 tilt60 tilt66 +$frame tilt72 tilt78 tilt84 tilt90 +$frame retract1 retract2 retract3 retract4 retract5 retract6 retract7 + +float TUR_STARTOFF = 1; +float TUR_RETRACT = 2; +float TUR_OFFRET = 4; +float TUR_LASERS = 8; +float TUR_ROCKETS = 16; +float TUR_PPC = 32; +float TURRET_STATE_INACTIVE = 0; +float TURRET_STATE_ACTIVATING = 1; +float TURRET_STATE_ACTIVE = 2; +float TURRET_STATE_DEACTIVATING = 3; +float TURRET_MAX_PITCH = 6; +float TURRET_MIN_PITCH = -6; + +void() turret_active; +void() turret_ret2; + +// returns the appropriate frame for the passed pitch +float(float pitch) turret_frame= { return floor(pitch/5.625); }; + +// returns the appropriate frame for while firing +float(float pitch) turret_fireframe= { return (turret_frame(pitch) + 23);}; + +// Check to see if the turret will fire +float() CheckTurretAttack = { + local vector spot1, spot2; + local entity targ; + local float chance; + + targ = self.enemy; + + // see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + traceline (spot1, spot2, FALSE, self); + + if (trace_ent != targ) return FALSE; // don't have a clear shot + if (trace_inopen && trace_inwater) return FALSE; // sight line crossed contents + if (time < self.attack_finished) return FALSE; + + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else if (enemy_range == RANGE_NEAR) + chance = 0.5; + else if (enemy_range == RANGE_MID) + chance = 0.2; + else + chance = 0.05; + + if (random () < chance) { + self.th_missile(); + if(self.spawnflags & TUR_LASERS) + SUB_AttackFinished (1.5 + 2*random()); + if(self.spawnflags & TUR_ROCKETS) + SUB_AttackFinished (1.5 + 3*random()); + if(self.spawnflags & TUR_PPC) + SUB_AttackFinished (2 + 2*random()); + else + SUB_AttackFinished (1 + 1.5*random()); + return TRUE; + } + return FALSE; +}; + +void() turret_face = { + local vector tmpvec; + + tmpvec = vectoangles(self.origin - (self.enemy.origin + self.enemy.view_ofs)); + if(tmpvec_x > self.rotate_type) { + if(tmpvec_x > (self.rotate_type + 6)) + self.rotate_type = self.rotate_type + 6; + else + self.rotate_type = tmpvec_x; + } else if(tmpvec_x < self.rotate_type) { + if(tmpvec_x < (self.rotate_type - 6)) + self.rotate_type = self.rotate_type - 6; + else + self.rotate_type = tmpvec_x; + } + + self.frame = turret_frame(self.rotate_type); + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); +}; + +void() turret_still = [ $tilt0, turret_still] { self.frame = turret_frame(self.rotate_type); FindTarget (); }; + +void() turret_ret1 = [ $retract1, turret_ret1] { if(self.frame >= 15) { turret_ret2(); return; } self.frame = self.frame + 1; self.nextthink = time + 0.05; }; +void() turret_ret2 = [ $retract1, turret_ret3] { self.nextthink = time + 0.05; }; +void() turret_ret3 = [ $retract2, turret_ret4] { self.nextthink = time + 0.05; }; +void() turret_ret4 = [ $retract3, turret_ret5] { self.nextthink = time + 0.05; }; +void() turret_ret5 = [ $retract4, turret_ret6] { self.solid = SOLID_NOT;self.nextthink = time + 0.05; }; +void() turret_ret6 = [ $retract5, turret_ret7] { self.nextthink = time + 0.05; }; +void() turret_ret7 = [ $retract6, turret_ret8] { self.nextthink = time + 0.05; }; +void() turret_ret8 = [ $retract7, turret_retracted] { if(!self.currentammo) self.think = SUB_Null;self.nextthink = time + 0.05; }; + +void() turret_unret1 = [ $retract6, turret_unret2] { self.nextthink = time + 0.05; }; +void() turret_unret2 = [ $retract5, turret_unret3] { self.nextthink = time + 0.05; }; +void() turret_unret3 = [ $retract4, turret_unret4] { self.nextthink = time + 0.05; }; +void() turret_unret4 = [ $retract3, turret_unret5] { self.solid = SOLID_SLIDEBOX; setmodel (self, "progs/custents/turret.mdl"); self.nextthink = time + 0.05; }; +void() turret_unret5 = [ $retract2, turret_unret6] { self.nextthink = time + 0.05; }; +void() turret_unret6 = [ $retract1, turret_unret7] { self.nextthink = time + 0.05; }; +void() turret_unret7 = [ $tilt0, turret_unret7] { + if(self.frame > (turret_frame(self.rotate_type) + 1)) + self.frame = self.frame - 2; + else + { + self.frame = turret_frame(self.rotate_type); + turret_active(); + } +}; + +void() turret_retracted = [ $retract7, turret_retracted] { if(FindTarget ()) turret_unret1(); }; + +void() turret_active = [ $tilt0, turret_active] { + enemy_infront = infront(self.enemy); + enemy_range = range(self.enemy); + enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + self.frame = turret_frame(self.rotate_type); + + // see if the enemy is dead + if (self.enemy.health <= 0 || self.enemy.deadflag != 0) { + self.enemy = world; + // FIXME: look all around for other targets + if (self.oldenemy.health > 0) { + self.enemy = self.oldenemy; + HuntTarget (); + } else { + self.th_stand(); + return; + } + } + self.show_hostile = time + 1; // wake up other monsters + + // check knowledge of enemy + enemy_vis = visible(self.enemy); + if (enemy_vis) self.search_time = time + 5; + + // look for other coop players + if ((coop && self.search_time < time) && (FindTarget())) return; + if (self.attack_state == AS_MISSILE || self.attack_state == AS_MELEE) { ai_run_missile (); return; } + CheckTurretAttack (); +}; + +void() turret_bullet1 = [ $tilt0, turret_bullet2] { + local vector dir, bullet_dir, spread_dir, bullet_spread; + + bullet_spread = SPREAD_SG2; // Sharpshooter! + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + sound (self, CHAN_WEAPON, "turret/plasbult.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + bullet_dir = self.enemy.origin - self.enemy.velocity*0.2; + bullet_dir = normalize (dir - self.origin); + spread_dir = bullet_dir + (crandom()*bullet_spread_x) * v_right + (crandom()*bullet_spread_y) * v_up; + Launch_Bullet(self.origin, dir, CT_PROJ_SG, (crandom()*10 + (SPEED_MONSG + (skill*SPEED_MONSGMULT)))); + Launch_Bullet(self.origin, dir, CT_PROJ_SG, (crandom()*10 + (SPEED_MONSG + (skill*SPEED_MONSGMULT)))); + Launch_ShellCasing(1); +}; +void() turret_bullet2 = [ $tilt0, turret_bullet3] { turret_face(); self.nextthink = time + 0.05; }; +void() turret_bullet3 = [ $tilt0, turret_bullet4] { + local vector dir, bullet_dir, spread_dir, bullet_spread; + + bullet_spread = SPREAD_SG2; // Sharpshooter! + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + sound (self, CHAN_WEAPON, "turret/plasbult.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + bullet_dir = self.enemy.origin - self.enemy.velocity*0.2; + bullet_dir = normalize (dir - self.origin); + spread_dir = bullet_dir + (crandom()*bullet_spread_x) * v_right + (crandom()*bullet_spread_y) * v_up; + Launch_Bullet(self.origin, dir, CT_PROJ_SG, (crandom()*10 + (SPEED_MONSG + (skill*SPEED_MONSGMULT)))); + Launch_Bullet(self.origin, dir, CT_PROJ_SG, (crandom()*10 + (SPEED_MONSG + (skill*SPEED_MONSGMULT)))); + Launch_ShellCasing(1); +}; +void() turret_bullet4 = [ $tilt0, turret_bullet5] { turret_face(); self.nextthink = time + 0.05; }; +void() turret_bullet5 = [ $tilt0, turret_active] { + local vector dir, bullet_dir, spread_dir, bullet_spread; + + bullet_spread = SPREAD_SG2; // Sharpshooter! + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + sound (self, CHAN_WEAPON, "turret/plasbult.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + bullet_dir = self.enemy.origin - self.enemy.velocity*0.2; + bullet_dir = normalize (dir - self.origin); + spread_dir = bullet_dir + (crandom()*bullet_spread_x) * v_right + (crandom()*bullet_spread_y) * v_up; + Launch_Bullet(self.origin, dir, CT_PROJ_SG, (crandom()*10 + (SPEED_MONSG + (skill*SPEED_MONSGMULT)))); + Launch_Bullet(self.origin, dir, CT_PROJ_SG, (crandom()*10 + (SPEED_MONSG + (skill*SPEED_MONSGMULT)))); + Launch_ShellCasing(1); +}; + +void() turret_laser1 =[ $tilt0, turret_laser2] { + local vector dir, vel; + + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + vel = normalize(self.enemy.origin - self.origin); + vel = vel * SPEED_LASER; + dir = vectoangles(vel); + launch_projectile (self.origin,dir,CT_PROJ_LASER,SPEED_LASER); +}; +void() turret_laser2 =[ $tilt0, turret_laser3] {turret_face();}; +void() turret_laser3 =[ $tilt0, turret_laser4] {turret_face();}; +void() turret_laser4 =[ $tilt0, turret_laser5] {turret_face();}; +void() turret_laser5 =[ $tilt0, turret_active] { + local vector dir, vel; + + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + vel = normalize(self.enemy.origin - self.origin); + vel = vel * SPEED_LASER; + dir = vectoangles(vel); + launch_projectile (self.origin,dir,CT_PROJ_LASER,SPEED_LASER); +}; + +void() turret_rocket1 =[ $tilt0, turret_active] { + local vector dir, vel; + + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + vel = normalize(self.enemy.origin - self.origin); + vel = vel * SPEED_LASER; + dir = vectoangles(vel); + Launch_Missile (self.origin, dir, '0 0 0', CT_PROJ_ARMY, SPEED_RLPLAYER); +}; + +void() turret_beam1 = [ $tilt0, turret_beam2] { turret_face(); sound (self, CHAN_WEAPON, "turret/beamchrg.wav", 1, ATTN_NORM); self.nextthink = time + 0.2; }; +void() turret_beam2 = [ $tilt0, turret_beam3] { turret_face(); sound (self, CHAN_WEAPON, "turret/beamchrg.wav", 1, ATTN_NORM); self.nextthink = time + 0.2; }; +void() turret_beam3 = [ $tilt0, turret_beam4] { turret_face(); sound (self, CHAN_WEAPON, "turret/beamchrg.wav", 1, ATTN_NORM); self.nextthink = time + 0.2; }; +void() turret_beam4 = [ $tilt0, turret_beam5] { + turret_face(); + self.frame = turret_fireframe(self.rotate_type); + + // explode if under water + if (self.waterlevel > 1) { + beam_water_burst(20); + return; + } + newmis = spawn(); + newmis.solid = SOLID_NOT; + newmis.movetype = MOVETYPE_FLY; + newmis.currentammo = 10; + setorigin(newmis, self.origin); + newmis.owner = self; + newmis.think = beam_generate; + newmis.nextthink = time + 0.05; +}; +void() turret_beam5 = [ $tilt0, turret_beam6] { turret_face(); }; +void() turret_beam6 = [ $tilt0, turret_beam7] { turret_face(); }; +void() turret_beam7 = [ $tilt0, turret_active] { turret_face(); }; + +void() turret_fire2; +void() turret_fire1 = [ $tilt0, turret_fire2] { turret_face(); if(infront(self.enemy)) self.think = turret_fire2; self.nextthink = time + 0.05; }; +void() turret_fire2 = [ $tilt0, turret_fire3] { turret_face(); self.nextthink = time + 0.05; }; +void() turret_fire3 = [ $tilt0, turret_fire4] { turret_face(); self.nextthink = time + 0.05; }; +void() turret_fire4 = [ $tilt0, turret_fire4] { + turret_face(); + if(self.spawnflags & TUR_LASERS) + turret_laser1(); + else if(self.spawnflags & TUR_ROCKETS) + turret_rocket1(); + else if(self.spawnflags & TUR_PPC) + turret_beam1(); + else + turret_bullet1(); +}; + +void(entity inflictor, entity attacker, float damage) turret_pain = { + if (self.pain_finished > time) return; + self.pain_finished = time + 1; + sound (self, CHAN_VOICE, "turret/beamchrg.wav", 1, ATTN_NORM); + ThrowGib (11, 1); +}; + +void() turret_die= { + local entity dedtur; + + self.use = SUB_Null; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + dedtur = spawn(); + dedtur.solid = SOLID_NOT; + dedtur.movetype = MOVETYPE_NONE; + dedtur.angles = self.angles; + setorigin(dedtur, self.origin); + setmodel (dedtur, "progs/custents/dedturet.mdl"); + setsize (self, '-10 -10 -3', '10 10 12'); + dedtur.skin = self.skin; + ThrowHead (); + ThrowGib (11,4); +}; + +void() turret_use= { + if(self.currentammo) { + self.currentammo = FALSE; + if((self.spawnflags & TUR_RETRACT) || (self.spawnflags & TUR_OFFRET)) + turret_ret1(); + else + self.think = SUB_Null; + } else { + self.currentammo = TRUE; + if((self.spawnflags & TUR_RETRACT) || (self.spawnflags & TUR_OFFRET)) + turret_unret1(); + else + turret_still(); + } +}; + +void() turret_setup= { + local vector endorg; + + traceline(self.origin, self.origin + '0 0 2000', TRUE, self); + endorg = trace_endpos; + endorg_z = endorg_z - 12; + setorigin(self, endorg); + + // decide how to start according to the spawnflags + if(self.spawnflags & TUR_STARTOFF){ + if((self.spawnflags & TUR_RETRACT) || (self.spawnflags & TUR_OFFRET)) { + self.frame = $retract7; + self.solid = SOLID_NOT; + } else + self.frame = turret_frame(self.rotate_type); + + self.currentammo = FALSE; + self.think = SUB_Null; + } else { + if(self.spawnflags & TUR_RETRACT) { + self.solid = SOLID_NOT; + turret_retracted(); + } else + turret_still(); + + self.nextthink = self.nextthink + random()*0.5; + } +}; + +void() trap_turret= { + self.mdl = "progs/custents/turret.mdl"; + self.headmdl = "progs/custents/h_turret.mdl"; + self.gib1mdl = "progs/custents/turetgib.mdl"; + precache_model ("progs/custents/turret.mdl"); + precache_model ("progs/custents/h_turret.mdl"); + precache_model ("progs/custents/dedturet.mdl"); + precache_model ("progs/custents/turetgib.mdl"); + precache_sound ("turret/beamchrg.wav"); + precache_sound ("turret/beammode.wav"); + precache_model ("progs/laser.mdl"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + precache_model ("progs/missile.mdl"); + precache_sound ("weapons/sgun1.wav"); + precache_model ("progs/custents/beam.mdl"); + precache_sound ("turret/beamhit.wav"); + precache_sound ("hipweap/mjolhit.wav"); + precache_sound ("turret/plasbult.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, self.mdl); + setsize (self, '-12 -12 -6', '12 12 12'); + if(self.health < 1) self.health = 100; + self.max_health = self.health; + if(self.rotate_type < 0 || self.rotate_type > 90) self.rotate_type = 0; + self.currentammo = TRUE; + + if(self.spawnflags & TUR_RETRACT) { + self.th_stand = turret_ret1; + self.th_walk = turret_ret1; + } else { + self.th_stand = turret_still; + self.th_walk = turret_still; + } + self.th_run = turret_active; + self.th_pain = turret_pain; + self.th_die = turret_die; + self.th_missile = turret_fire1; + + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + self.yaw_speed = 30; + self.view_ofs = '0 0 -0.1'; + self.use = turret_use; + self.flags = self.flags | FL_FLY; + self.pausetime = 99999999; + self.nextthink = self.nextthink + random()*0.5; + self.think = turret_setup; +}; + + + +void() turret_shoot = { + local vector ang; + + self.effects = self.effects | EF_MUZZLEFLASH; + sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM); + + //calculate pitch based on the enemy's position, but clamp it to a narrow range + ang = vectoangles(self.enemy.origin - self.origin); + if (ang_x > 180) + ang_x = ang_x - 360; + if (ang_x > TURRET_MAX_PITCH) + ang_x = TURRET_MAX_PITCH; + if (ang_x < TURRET_MIN_PITCH) + ang_x = TURRET_MIN_PITCH; + self.angles_x = 0 - ang_x; //invert it because for some reason +pitch is downwards for makevectors() but upwards for vectoangles() + + makevectors (self.angles); + launch_projectile (self.origin + ('0 0 1' * self.angles_x),v_forward,CT_PROJ_LASER,SPEED_LASER); +}; + +//returns true if existing enemy is still valid or we found a new valid enemy +float() turret_findtarget = { + local entity e; + + if (self.enemy != world) + e = self.enemy; + else //get a new enemy + { + e = checkclient (); + if (!e) + return FALSE; // current check entity isn't in PVS + } + + if (e.items & IT_INVISIBILITY) + return FALSE; + + if (range (e) == RANGE_FAR) + return FALSE; + + if (!visible (e)) + return FALSE; + + if (e.takedamage == DAMAGE_NO) + return FALSE; + +// +// got one +// + self.enemy = e; + if (self.enemy.classname != "player") + { + self.enemy = self.enemy.enemy; + if (self.enemy.classname != "player") + { + self.enemy = world; + return FALSE; + } + } + + return TRUE; +}; + +void() turret_helper_think = { + self.nextthink = time + 0.2; + if ( self.owner.state != TURRET_STATE_ACTIVE) return; + + //find enemy + if (!turret_findtarget()) return; + + //turn towards enemy + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + self.yaw_speed = (50 + skill * 20) * 0.2; + ChangeYaw(); + + //shoot if enemy is in sight (even if facing wrong way) + turret_shoot(); +}; + +void() turret_hit_bottom = { sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); self.state = TURRET_STATE_INACTIVE; }; + +void() turret_go_down = { sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); self.state = TURRET_STATE_DEACTIVATING; SUB_CalcMove (self.pos1, self.speed, turret_hit_bottom); }; + +void() turret_hit_top = { sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); self.state = TURRET_STATE_ACTIVE; }; + +void() turret_go_up = { + sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + self.state = TURRET_STATE_ACTIVATING; + SUB_CalcMove (self.pos2, self.speed, turret_hit_top); +}; + +void() turret_func_use = { + if (self.state == TURRET_STATE_INACTIVE || self.state == TURRET_STATE_DEACTIVATING) { + self.frame = 0; + turret_go_up(); + self.enemy = activator; + } else if (self.state == TURRET_STATE_ACTIVATING || self.state == TURRET_STATE_ACTIVE) { + self.frame = 1; + + //if deactivated after being previously active, use movedir2 to determine position + self.pos1 = self.origin + self.movedir2; + turret_go_down(); + } +}; + +/* +=============================================================================== +spawn function +=============================================================================== +*/ + +/*QUAKED func_turret (0 .5 .8) ? START_OFF +A rotating laser shooter that aims at the player in any horizontal direction. Has a capped rotation speed based on skill setting. When triggered, toggles between active and inactive states + +START_OFF spawns in the inactive state + +place in the level in the active/attacking position for proper lighting. + +"movedir" the offset from active position to the initial START_OFF position +"movedir2" the offset from the active position to the deactivated position (after being previously active) +"height" the position that laser originates, measured up from the very bottom of the model +"angle" determines the initial turret direction (horizontal directions only) +"speed" speed when moving to a new position +"sounds" sounds to use when moving to a new position +0) no sound +1) stone +2) base +3) stone chain +4) screechy metal +*/ + +void() func_turret = { + local entity helper; + local vector org; + + if (self.sounds == 0) { + precache_sound ("misc/null.wav"); + precache_sound ("misc/null.wav"); + self.noise1 = "misc/null.wav"; + self.noise2 = "misc/null.wav"; + } + if (self.sounds == 1) { + precache_sound ("doors/drclos4.wav"); + precache_sound ("doors/doormv1.wav"); + self.noise1 = "doors/drclos4.wav"; + self.noise2 = "doors/doormv1.wav"; + } + if (self.sounds == 2) { + precache_sound ("doors/hydro1.wav"); + precache_sound ("doors/hydro2.wav"); + self.noise2 = "doors/hydro1.wav"; + self.noise1 = "doors/hydro2.wav"; + } + if (self.sounds == 3) { + precache_sound ("doors/stndr1.wav"); + precache_sound ("doors/stndr2.wav"); + self.noise2 = "doors/stndr1.wav"; + self.noise1 = "doors/stndr2.wav"; + } + if (self.sounds == 4) { + precache_sound ("doors/ddoor1.wav"); + precache_sound ("doors/ddoor2.wav"); + self.noise1 = "doors/ddoor2.wav"; + self.noise2 = "doors/ddoor1.wav"; + } + + precache_model ("progs/laser.mdl"); + precache_sound ("enforcer/enfire.wav"); + precache_sound ("enforcer/enfstop.wav"); + + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + setmodel (self, self.model); + self.use = turret_func_use; + + if (!self.speed) + self.speed = 100; + + self.pos1 = self.origin + self.movedir; //inactive position + self.pos2 = self.origin; //active position + + //spawn a second entity to handle alpha changes, since MOVETYPE_PUSH doesn't support think functions + helper = spawn(); + helper.owner = self; + helper.nextthink = 0.1; + helper.think = turret_helper_think; + helper.classname = "turret"; + helper.angles = self.angles; + org_x = (self.absmin_x + self.absmax_x) / 2; + org_y = (self.absmin_y + self.absmax_y) / 2; + org_z = self.absmin_z + self.height; + setorigin (helper, org); + + //set actual angles to 0 now that helper has its angles + self.angles = '0 0 0'; + + //move to initial position + if (self.spawnflags & TUR_STARTOFF) { + self.state = TURRET_STATE_INACTIVE; + setorigin (self, self.pos1); + self.frame = 1; + } else { + self.state = TURRET_STATE_ACTIVE; + setorigin (self, self.pos2); + self.frame = 0; + } + + // Testing using stuff from trap_turret to get this to work right + if(self.health < 1) self.health = 100; + self.max_health = self.health; + if(self.rotate_type < 0 || self.rotate_type > 90) self.rotate_type = 0; + self.currentammo = TRUE; + + if(self.spawnflags & TUR_RETRACT) { + self.th_stand = turret_ret1; + self.th_walk = turret_ret1; + } else { + self.th_stand = turret_still; + self.th_walk = turret_still; + } + self.th_run = turret_active; + self.th_pain = turret_pain; + self.th_die = turret_die; + self.th_missile = turret_fire1; + + self.takedamage = DAMAGE_AIM; + self.ideal_yaw = self.angles * '0 1 0'; + self.yaw_speed = 30; + self.view_ofs = '0 0 -0.1'; + self.use = turret_use; + self.flags = self.flags | FL_FLY; + self.pausetime = 99999999; + self.nextthink = self.nextthink + random()*0.5; + self.think = turret_setup; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/triggers.qc b/QC_other/QC_keep/triggers.qc new file mode 100644 index 00000000..515d5f94 --- /dev/null +++ b/QC_other/QC_keep/triggers.qc @@ -0,0 +1,2010 @@ +/*====================================================================== + TRIGGER FUNCTIONS +======================================================================*/ +float TRIG_SPAWNBUBBLES = 2; // Produce bubbles +float TRIG_SECRETNOMSG = 2; // No default message +float TRIG_TELEPLAYER = 1; // Player only +float TRIG_TELESILENT = 2; // No teleport sound +float TRIG_TELEALWAYSON = 4; // Trigger teleports starts on +float TRIG_HURTMONSTER = 4; // Only hurt monsters +float TRIG_HURTFALLING = 32; // Only hurt if player falling +float TRIG_PUSHONCE = 1; // Switch off after one use +float TRIG_PUSHSILENT = 2; // No wind sound for player +float TRIG_PUSHNOMONSTER = 4; // Monsters cannot use this push trigger +float TRIG_CMAPNOPAUSE = 1; // No info screen, next map +float TRIG_CMAPRESETINV = 2; // Reset inventory (shotgun+25shells) +float TRIG_CMAPSECSPAWN = 4; // Spawn at the second spawn point +float TRIG_MONJUMPFLY = 2; // Will affect flying units +float TRIG_MONJUMPSWIM = 4; // Will affect swimming units +float TRIG_TSOUNDWGEO = 4; // World Geometry interaction +float TRIG_TSOUNDDRAIN = 8; // Drain effect when disabled +float TRIG_VOIDNOCLIENT = 1; // Clients will suffer no damage +float TRIG_VOIDNOMONSTER = 2; // Monsters will be immune to the void +float TRIG_VOIDNOAMMO = 4; // Ammo projectiles will pass through +float TRIG_VOIDNOGG = 8; // Minion eggs will ignore the void +float TRIG_VOIDNOTEMP = 16; // Temporary entities will exist longer +float TRIG_VOIDNOITEM = 32; // All items will carry on as before + +//====================================================================== +// If a dead body has touched a trigger, setup removal +//====================================================================== +float(entity body_ent, float body_death) trigger_check_body = +{ + if (body_ent.flags & FL_MONSTER && body_ent.deadflag == DEAD_DEAD) { + body_ent.deadflag = body_death; + body_ent.touchedvoid = TRUE; + return TRUE; + } + return FALSE; +}; + +//====================================================================== +// Setup/Spawn/Remove bubbles inside a trigger volume +//====================================================================== +void() trigger_setup_bubbles = +{ + // Quake compilers can add the style key to any entity connected + // to dynamic lights, this is usually 32-64 in value and should + // not interfere, but never use style > 32 for any values + if (self.style == 1) self.mdl = "progs/s_bubble_grey.spr"; + else if (self.style == 2) self.mdl = "progs/s_bubble_brnd1.spr"; + else if (self.style == 4) self.mdl = "progs/s_bubble_grn1.spr"; + else if (self.style == 5) self.mdl = "progs/s_bubble_red1.spr"; + else if (self.style == 6) self.mdl = "progs/s_bubble_brnd2.spr"; + else if (self.style == 7) self.mdl = "progs/s_bubble_pinkyel.spr"; + else if (self.style == 8) self.mdl = "progs/s_bubble_brnl1.spr"; + else if (self.style == 9) self.mdl = "progs/s_bubble_purp1.spr"; + else if (self.style == 10) self.mdl = "progs/s_bubble_purp2.spr"; + else if (self.style == 11) self.mdl = "progs/s_bubble_brnl2.spr"; + else if (self.style == 12) self.mdl = "progs/s_bubble_grn2.spr"; + else if (self.style == 13) self.mdl = "progs/s_bubble_yellow.spr"; + else if (self.style == 14) self.mdl = "progs/s_bubble_blue2.spr"; + else if (self.style == 15) self.mdl = "progs/s_bubble_red2.spr"; + else self.mdl = "progs/s_bubble_blue1.spr"; + precache_model(self.mdl); + + // Setup defaults for healing bubbles + self.waitmin = self.bubble_count = 0; // Reset counters + if (!self.count) self.count = 5; // max active bubbles + if (!self.height) self.height = self.size_z; + if (self.height < 64) self.height = 64; // min top of volume + self.oldorigin = bmodel_origin(self); + self.oldorigin_z = self.mins_z; + self.t_width = (self.size_x/2); + self.t_length = (self.size_y/2); + // Default spawn rate for bubbles + if (self.yaw_speed <= 0) self.yaw_speed = 0.5; +}; + +//---------------------------------------------------------------------- +void() trigger_remove_bubble = +{ + if (other == self.owner) return; // Touching self, do nothing + if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing + + self.touch = SUB_Null; + if (self.owner.bubble_count > 0) + self.owner.bubble_count = self.owner.bubble_count - 1; + remove(self); +}; + +//---------------------------------------------------------------------- +void() trigger_update_bubble = +{ + // The size of the trigger is the default height for the bubbles + // to raise up, or The height can be specified as a value + + self.lefty = fabs(self.origin_z - self.owner.oldorigin_z); + if (self.lefty > self.owner.height) { + trigger_remove_bubble(); + } + else { + // Wobble on the X / Y axis as the bubble raises up + self.velocity_x = self.velocity_y = 0; + if (random() < 0.5) self.velocity_x = self.velocity_x + crandom()*4; + else self.velocity_y = self.velocity_y + crandom()*4; + // Make the bubble raise faster by random amounts + self.velocity_z = self.velocity_z + random(); + // Keep updating bubble, 15 updates is the limit + self.nextthink = time + 0.5 + random()*0.5; + if (self.count < 15) self.count = self.count + 1; + else trigger_remove_bubble(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_spawn_bubbles = +{ + local entity bubble; + + if (self.estate & ESTATE_BLOCK) return; + if ( !(self.spawnflags & TRIG_SPAWNBUBBLES) ) return; + + if (self.bubble_count < self.count) { + self.bubble_count = self.bubble_count + 1; + + bubble = spawn(); + bubble.owner = self; + bubble.classname = "misc_bubble"; + bubble.classtype = CT_BUBBLE; + bubble.classgroup = CG_TEMPENT; + bubble.movetype = MOVETYPE_NOCLIP; + bubble.solid = SOLID_TRIGGER; + setmodel(bubble, self.mdl); + bubble.frame = rint(random() * 3); // Light/dark colours + setsize (bubble, VEC_ORIGIN, VEC_ORIGIN); + bubble.origin_x = self.oldorigin_x + crandom()*self.t_width; + bubble.origin_y = self.oldorigin_y + crandom()*self.t_length; + bubble.origin_z = self.oldorigin_z; + setorigin(bubble, bubble.origin); + bubble.velocity = vecrand(0,5,TRUE); + bubble.velocity_z = 10 + random()*15; + bubble.count = rint(random()*4); + + bubble.nextthink = time + 0.5 + random()*0.5; + bubble.think = trigger_update_bubble; + bubble.touch = trigger_remove_bubble; + } + + // Keep spawning bubbles until told not too! + self.think = trigger_spawn_bubbles; + self.nextthink = time + self.yaw_speed + random()*self.yaw_speed; +}; + +/*====================================================================== +/*QUAKED trigger_multiple (0.5 0 0.5) ? NOTOUCH x x x MODCHECK MONSTERS STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Variable sized bmodel that uses multiple times +------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger all these targets +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +health : Can be damaged instead of touched +wait : time between re-triggering +delay : delay before firing (after being triggered) +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +MODCHECK : Will remove this entity if THIS mod is active +MONSTER : can be touched/triggered by monsters +STARTOFF : Requires trigger to activate +------- NOTES -------- +Variable sized bmodel that uses multiple times + +======================================================================*/ +void() trigger_multiple = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.spawnflags & TRIG_MODCHECK) { remove(self); return; } + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGMULTI; + InitTrigger (); + if (!self.wait) self.wait = 0.2; + + // Setup Entity State functionality + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_once (0.5 0 0.5) ? NOTOUCH x x INVIEW MODCHECK MONSTER STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Variable sized bmodel that uses once +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger all these targets +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +health : Can be damaged instead of touched +wait : Always -1 +delay : delay before firing (after being triggered) +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +t_length : Inview distance (less than) to activate trigger +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +INVIEW : Player has to be infront and look at trigger (>30 & <60) +MODCHECK : Will remove this entity if THIS mod is active +MONSTER : can be touched/triggered by monsters +STARTOFF : Requires trigger to activate +-------- NOTES -------- +Variable sized bmodel that uses once + +======================================================================*/ +void() trigger_once = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.spawnflags & TRIG_MODCHECK) { remove(self); return; } + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGONCE; + InitTrigger (); + self.wait = -1; + + // Inview triggers need to start delayed, high cpu functions + if (self.spawnflags & TRIG_INVIEW) { + self.spawnflags = self.spawnflags | ENT_STARTOFF; + // Cannot have inview triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + } + + // Setup Entity State functionality + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_secret (.5 0 .5) ? NOTOUCH NOMSG x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Update map secret counter +------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger +upgrade_ssg : = 1 will only trigger if shotgun upgrade active on server +upgrade_axe : = 1 will only trigger if axe upgrade active on server +upgrade_lg : = 1 will only trigger if lightning gun upgrade active on server +health : Can be damaged instead of touched +wait : Always -1 +angle : Facing Direction for trigger to work, use 360 for angle 0. +sounds : 1=Secret(def),2=talk,3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +NOMSG : Remove/Block any trigger secret message +STARTOFF : Requires trigger to activate +------- NOTES -------- +Update map secret counter + +======================================================================*/ +void() trigger_secret = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.sounds == 0) self.sounds = 1; + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGSECRET; + InitTrigger (); + self.wait = -1; // Trigger ONCE + self.count = 1; // Add 1 secret + + total_secrets = total_secrets + self.count; + if (!self.message) self.message = "You found a secret area!"; + if (self.spawnflags & TRIG_SECRETNOMSG) self.message = ""; + + // Cannot have secret triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_teleport (0.5 0 0.5) ? PLAYER_ONLY SILENT STARTON x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Teleport player/monsters to target location +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : Points to info_teleport_destination entity +wait : -1 = trigger once condition (def=0) +speed : forward momentum speed after teleporting (def=300) +volume : teleporter hum sound volume (def=0.5) +noise : custom sound to play when active (must be looped, def=hum1.wav) +waitmin : the length of the custom sound (def=3.622 for hum1.wav) +-------- SPAWNFLAGS -------- +PLAYER_ONLY : Can only be used by players (nothing else) +SILENT : No teleporter hum sound regardless of state +STARTON : Will start active regardless of targetname setting +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Teleport player/monsters to target location +if targetname is setup, the teleporter requires a trigger to activate +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_teleport_sound = +{ + // Has the original bmodel trigger been deleted!?! + if (!self.owner) { + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + return; + } + + // The Quake sound system is really basic and dumb! :) + // Originally the sound of the teleporter was setup as an ambientsound, + // which always play, loop and never can be turned off! + // + // Normal sounds are ONLY active when the player is in the same portal! + // This is probably an optimization (engine) thing to save time + // constantly checking attenuation levels + // + // The teleporter sound is manually looped because of portal problems + // and that the trigger can be turned on / off. + // The waitmin parameter has to match the length of the sound, otherwise + // the looping will literally sound odd + // + + // Keep checking for any updates + self.nextthink = time + 0.1; + self.think = trigger_teleport_sound; + + // Wait for trigger to start before doing anything + if (self.owner.spawnflags & ENT_STARTOFF) return; + + // Has the trigger been switched off recently? + if (self.owner.estate != self.estate) { + // Check for OFF and disabled together + if (self.owner.estate & ESTATE_BLOCK) { + self.estate = self.owner.estate; + sound (self, CHAN_VOICE, SOUND_EMPTY, 1, ATTN_NORM); + self.fly_sound = LARGE_TIMER; + return; + } + else { + // trigger has been switched on, reset sound + self.estate = self.owner.estate; + self.fly_sound = 0; + } + } + + // Play the sound if loop has finished or been reset + if (self.fly_sound < time ) { + self.fly_sound = time + self.owner.waitmin; + sound (self, CHAN_VOICE, self.owner.noise, self.owner.volume, ATTN_STATIC); + } +}; + +//---------------------------------------------------------------------- +// This is used for the closet monster setup where the trigger is fired +// and then anything touching the trigger 0.2s later is teleported +// This forces all touch triggers in a map to check what they are touching! +//---------------------------------------------------------------------- +void() trigger_teleport_use = +{ + // Deal with START OFF functionality first + if (self.spawnflags & ENT_STARTOFF) { + // Remove start off flag and switch on entity + self.spawnflags = self.spawnflags - ENT_STARTOFF; + self.estate_on(); + return; + } + // Block entity state DISABLE + if (self.estate & ESTATE_DISABLE) return; + if (self.estate & ESTATE_OFF) self.estate_on(); + + // Force retouch is really hard on the engine because EVERY trigger + // in the map is re-checked for any touching objects + force_retouch = 2; + self.nextthink = time + 0.2; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport_on = +{ + self.estate = ESTATE_ON; + self.state = STATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport_off = +{ + self.estate = ESTATE_OFF; + self.state = STATE_OFF; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport_touch = +{ + if (self.estate & ESTATE_BLOCK) return; // Entity off/disabled? + if (self.spawnflags & ENT_STARTOFF) return; // Starts off? + if (self.attack_finished > time) return; // Trigger once? + if (self.state == STATE_OFF) return; // Waiting for trigger? + + // Is the teleporter designed for players only? + if (self.spawnflags & TRIG_TELEPLAYER && !(other.flags & FL_CLIENT)) return; + // only teleport living creatures and monsters (mostly) + if (other.health < 1 || other.solid != SOLID_SLIDEBOX) return; + + // Find teleporter target + if (!self.goalentity) { + self.goalentity = find (world, targetname, self.target); + if (!self.goalentity) { + dprint("\b[TELEPORT_TOUCH]\b Cannot find target\n"); + return; + } + // New feature, fire targets on teleporter destination + if (self.goalentity.classtype == CT_MISCTELEPORT && self.goalentity.target != "") { + trigger_strs(self.goalentity.target, other); // Fire all targets + self.goalentity.target = ""; // only work once + } + // This stuff never changes, might as well generate it now + makevectors (self.goalentity.mangle); + self.goalentity.movedir = v_forward; + self.goalentity.pos1 = self.goalentity.origin + 32 * self.goalentity.movedir; + } + + // Check for a trigger_once condition + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } + + // Fire all targets on trigger teleporter entity (ID code) + // not sure why? the target *should* be pointing at info_destination + // Could use killtarget or message strings + SUB_UseTargets (); + + // put a tfog where the player was + spawn_tfog (other.origin); + + // spawn a tfog flash in front of the destination + spawn_tfog (self.goalentity.pos1); + spawn_tdeath(self.goalentity.origin, other); + + // Add a little forward momentum to teleporting entity + // This is usually used for gib/telefrag effects + if (!other.health) { + other.origin = self.goalentity.origin; + other.velocity = (self.goalentity.movedir * other.velocity_x) + (self.goalentity.movedir * other.velocity_y); + return; + } + + // Move/rotate teleporting entity to new location + setorigin (other, self.goalentity.origin); + other.angles = self.goalentity.mangle; + + // If player, rotate (immediately) and push forward + if (other.flags & FL_CLIENT) { + other.fixangle = 1; // turn this way immediately + other.teleport_time = time + 0.7; // Special state for engine + if (other.flags & FL_ONGROUND) other.flags = other.flags - FL_ONGROUND; + other.velocity = self.goalentity.movedir * self.speed; + } + // Telporting entities need to check for ground + other.flags = other.flags - other.flags & FL_ONGROUND; +}; + +//---------------------------------------------------------------------- +void() trigger_teleport = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Always pre-cache telporter teleporter sound + if (self.noise == "") self.noise = "ambience/hum1.wav"; + precache_sound (self.noise); + // The length of the custom sound cannot be < 0.1s + if (self.waitmin <= 0.1) self.waitmin = 3.622; + + self.classtype = CT_TRIGTELEPORT; + InitTrigger (); + + // A trigger teleporter going nowhere!?! + // Need to initialize trigger to get mins/maxs for origin + if (self.target == "") { + dprint("\b[TRIGGER_TELEPORT]\b Missing target\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Spawnflag 1 is used for something else (notouch duplicate) + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + if (!self.volume) self.volume = 0.5; + if (!self.speed) self.speed = 300; + // Save this for later (sound emitter) + self.oldorigin = bmodel_origin(self); + + // Trigger teleport is a special case in the way it is setup because + // is it abused for monster closets, where the trigger is always active + self.touch = trigger_teleport_touch; + self.solid = SOLID_TRIGGER; + setsize (self, self.bbmins, self.bbmaxs); + + // Setup Entity State functionality + self.estate_on = trigger_teleport_on; + self.estate_off = trigger_teleport_off; + self.estate_use = trigger_teleport_use; + self.use = entity_state_use; + + // Damn annoying that the targetname is being used like this because + // there could have been a better way to do this type of functionality + // == "" teleporter works fine (starts on) + // != "" teleporter requires trigger activation + if (self.spawnflags & TRIG_TELEALWAYSON) self.estate = ESTATE_ON; + else if (self.spawnflags & ENT_STARTOFF) self.estate = ESTATE_OFF; + else if (self.targetname != "") self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; + + // Setup sound emitter for teleporter state + if ( !(self.spawnflags & TRIG_TELESILENT) ) { + self.attachment = spawn(); + self.attachment.owner = self; + self.attachment.estate = -1; + self.attachment.movetype = MOVETYPE_NONE; + self.attachment.solid = SOLID_NOT; + setorigin(self.attachment, self.oldorigin); + //setmodel(self.attachment, MODEL_BROKEN); + self.attachment.nextthink = time + 1; + self.attachment.think = trigger_teleport_sound; + } +}; + +/*====================================================================== +/*QUAKED trigger_changelevel (0.5 0 0.5) ? NO_INTERMIS RESETINV x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Finish current map, show intermission screen and loads next +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger before intermission +map : The name of next map (e.g. e1m1) default=same map +startspawn2: Special unique number (1-7) which must match info_player_start2 +-------- SPAWNFLAGS -------- +NO_INTERMIS : No Intermission screen +RESETINV : Reset player inventory to default (Shotgun+Shells) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Finish current map, show intermission screen and loads next +This entity cannot be damaged and is always touchable once activated + + ======================================================================*/ +void() trigger_changelevel_finish = +{ + intermission_running = 1; + + // enforce a wait time before allowing changelevel + if (deathmatch) intermission_exittime = time + 5; + else intermission_exittime = time + 2; + + WriteByte (MSG_ALL, SVC_CDTRACK); // Update CD track + WriteByte (MSG_ALL, SVC_UPDATESTAT); // Update stats, total kills etc + WriteByte (MSG_ALL, SVC_UPDATESTAT); // Update twice? + StartIntermissionCamera(); // Setup intermission camera(s) + WriteByte (MSG_ALL, SVC_INTERMISSION); // Start intermission (lock movement) +}; + +//---------------------------------------------------------------------- +void() trigger_changelevel_fire = +{ + if (self.attack_finished > time) return; + if ( !(self.bmodel_act.flags & FL_CLIENT) ) return; + if ( self.bmodel_act.health < 1 ) return; + + self.attack_finished = LARGE_TIMER; + + // Reset player inventory back to ID default (shotgun+25shells) + if (self.spawnflags & TRIG_CMAPRESETINV) { + dprint("\b[CHANGELVL]\b Resetting client inventory!\n"); + self.bmodel_act.health = HEAL_PLAYMAX; + self.bmodel_act.armortype = self.bmodel_act.armorvalue = 0; + self.bmodel_act.ammo_shells = DEF_SHELLS; + self.bmodel_act.ammo_nails = self.bmodel_act.ammo_rockets = self.bmodel_act.ammo_cells = 0; + self.bmodel_act.items = IT_SHOTGUN | IT_AXE; + self.bmodel_act.moditems = 0; + self.bmodel_act.weapon = IT_SHOTGUN; + } + + // Some crazy DM parameters to prevent teleport exit + if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) { + T_Damage (self.bmodel_act, self, self, MEGADEATH, NOARMOR); return; + } + // More crazy DM stuff + if (coop || deathmatch) { + bprint (self.bmodel_act.netname); + bprint (" exited the level\n"); + } + + // is there a special info_player_start2 location setup? + // This will also reset any values back to zero (default) + if (self.startspawn2 < 1 || self.startspawn2 > 7) self.startspawn2 = 0; + update_configflag(SVR_SPAWN_BIT1, floor( (self.startspawn2 & 1) / 1) ); + update_configflag(SVR_SPAWN_BIT2, floor( (self.startspawn2 & 2) / 2) ); + update_configflag(SVR_SPAWN_BIT3, floor( (self.startspawn2 & 4) / 4) ); + + // *change* if map key not defined, reload current map again + if (self.map) nextmap = self.map; + SUB_UseTargets (); + + // If no intermission, go straight to next map + if ( (self.spawnflags & TRIG_CMAPNOPAUSE) && (deathmatch == 0) ) { + GotoNextMap(); + return; + } + + // we can't move people right now, because touch functions are called + // in the middle of C movement code, so set a think time to do it + self.think = trigger_changelevel_finish; + self.nextthink = time + 0.1; +}; + +//---------------------------------------------------------------------- +void() trigger_changelevel_setup = +{ + // If map not defined, use current mapname instead + if (!self.map) self.map = mapname; +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() changelevel_touch = { trigger_changelevel_fire();}; + +//---------------------------------------------------------------------- +void() trigger_changelevel = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGLEVEL; + InitTrigger (); + // Spawnflag 1 is used for something else (notouch duplicate) + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + // Cannot have change level triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_fire = trigger_changelevel_fire; + trigger_bmodel_setup(); + + // Wait for everything to spawn before checking map name + self.think = trigger_changelevel_setup; + self.nextthink = time + 1; +}; + +/*====================================================================== +/*QUAKED trigger_setskill (0.5 0 0.5) ? NOTOUCH x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Sets player skill level (via console) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +health : Can be damaged instead of touched +wait : time between re-triggering (def=0.2s, -1=once) +angle : Facing Direction for trigger to work, use "360" for angle 0. +message : Skill Level - 0 = easy, 1 = normal, 2 = hard, 3 = nightmare +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Sets player skill level (via console) + +======================================================================*/ +void() trigger_setskill_fire = +{ + if (self.attack_finished > time) return; + + // There is no client check for the skill level change so that + // the use functionality can work from trigger chains + cvar_set ("skill", self.message); + + // Is the trigger repeatable? + if (self.wait > 0) { + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + // block trigger and turn off (trigger_once) + else { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_setskill = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGSKILLS; + InitTrigger (); + + if (!self.wait) self.wait = 1; + if (self.message == "") self.message = "0"; + + // Cannot have skill triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + self.estate_fire = trigger_setskill_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_rune (0.5 0 0.5) ? E1 E2 E3 E4 x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +A Trigger that fires once if the player has certain runes +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +health : Can be damaged instead of touched +angle : Facing Direction for trigger to work, use "360" for angle 0. +target : trigger to fire if player has MIXTURE of runes +noise1 : trigger to fire if player has rune 1 +noise2 : trigger to fire if player has rune 2 +noise3 : trigger to fire if player has rune 3 +noise4 : trigger to fire if player has rune 4 +wait : = -1 Only trigger once if the player has runes +-------- SPAWNFLAGS -------- +E1 : Episode 1 +E2 : Episode 2 +E3 : Episode 3 +E4 : Episode 4 +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +There are two ways this trigger can be used, a single check for multiple +runes using target key OR individual triggers for runes using noise 1-4 keys +This trigger is designed to work once when rune conditions are met + +======================================================================*/ +void() trigger_rune_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + // Stop the trigger constantly firing + self.attack_finished = time + self.waitmin; + + // Check for single rune trigger + if (self.target) { + if (query_configflag(SVR_RUNE_ALL) & self.customkey == self.customkey) { + trigger_strs(self.target, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + } + else { + // Check for multiple rune triggers + if (query_configflag(self.customkey & SVR_RUNE_KEY1) == SVR_RUNE_KEY1 && self.noise1 != "") { + trigger_strs(self.noise1, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + if (query_configflag(self.customkey & SVR_RUNE_KEY2) == SVR_RUNE_KEY2 && self.noise2 != "") { + trigger_strs(self.noise2, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + if (query_configflag(self.customkey & SVR_RUNE_KEY3) == SVR_RUNE_KEY3 && self.noise3 != "") { + trigger_strs(self.noise3, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + if (query_configflag(self.customkey & SVR_RUNE_KEY4) == SVR_RUNE_KEY4 && self.noise4 != "") { + trigger_strs(self.noise4, self.bmodel_act); + if (self.wait < 0) self.attack_finished = LARGE_TIMER; + } + } + + // The attack_finished is set by the RUNE condition being TRUE + // The trigger is designed to be trigger_once (no need to check wait) + // The trigger needs to meet a rune condition before switching off + if (self.attack_finished == LARGE_TIMER) self.estate_off(); +}; + +//---------------------------------------------------------------------- +void() trigger_rune = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGRUNES; + // Spawnflag 1 is used for something else (notouch duplicate) + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH; + InitTrigger (); + if (self.waitmin <=0) self.waitmin = 1; + + // Cannot have rune triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + // Calculate the rune key selection + self.customkey = self.spawnflags & SVR_RUNE_ALL; + + // Cannot do anything with the trigger if no runes are selected + if (self.customkey == 0) { + dprint("\b[TRIG_RUNE]\b No runes setup!\n"); + self.oldorigin = bmodel_origin(self); + spawn_marker(self.oldorigin, SPNMARK_YELLOW); + remove(self); + return; + } + + // Setup Entity State functionality + self.estate_fire = trigger_rune_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_push (0.5 0 0.5) ? PUSH_ONCE SILENT NOMONSTER x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Push the Player and Grenades! +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : target entity for custom direction +angle : direction of push (-2 is down, -1 up) +angles : Pitch Yaw Roll (up/down, angle, tilt left/right) +speed : Speed of push direction (def=1000) +-------- SPAWNFLAGS -------- +PUSH_ONCE : trigger_once functionality +SILENT : No wind sound for player +NOMONSTER : Monsters cannot be pushed by this trigger +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Push the Player, player/ogre grenades and minion eggs! +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_push_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + // Check for any dead monster bodies (no exceptions) + if (trigger_check_body(self.bmodel_act,DEAD_EXPLODE)) return; + // Check for no monster exception + if (self.spawnflags & TRIG_PUSHNOMONSTER && self.bmodel_act.flags & FL_MONSTER) return; + + // Cool feature is that it will push grenades! + // Added player, ogre and minion eggs to the catch + if (self.bmodel_act.classtype == CT_PROJ_GL || + self.bmodel_act.classtype == CT_PROJ_GLMON || + self.bmodel_act.classtype == CT_PROJ_MEGG) + self.bmodel_act.velocity = self.speed * self.movedir * 10; + // Standard push for all bmodel_act living entities + else if (self.bmodel_act.health > 0) { + self.bmodel_act.velocity = self.speed * self.movedir * 10; + // Play wind sound for the player + if (self.bmodel_act.classtype == CT_PLAYER) { + if (self.bmodel_act.fly_sound < time) { + self.bmodel_act.fly_sound = time + 1.5; + sound (self.bmodel_act, CHAN_AUTO, self.noise, 1, ATTN_NORM); + } + } + } + + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +// Map hack reference +void() trigger_push_touch = { self.bmodel_act = other; trigger_push_fire(); } + +//---------------------------------------------------------------------- +void() trigger_push = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGPUSH; + InitTrigger (); + // Spawnflag 1 is used for something else (notouch duplicate) + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + if (!self.speed) self.speed = 1000; + + // Setup default wind sound if no custom sound found + // else if silent trigger, use misc/empty sound + if ( !(self.spawnflags & TRIG_PUSHSILENT) && self.noise == "") + self.noise = "ambience/windfly.wav"; + if (self.noise == "") self.noise = SOUND_EMPTY; + precache_sound (self.noise); + + if (self.spawnflags & TRIG_PUSHONCE) self.wait = -1; + + // Setup Entity State functionality + self.estate_fire = trigger_push_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 2; + self.think = TargetMovedir; + } +}; + +/*====================================================================== + Player ladder (originally from Rubicon2 codebase by JohnFitz) + - This is a very simple system, jump to attach to the ladder brush + - move up down via jumpping (hook in preplayer code) + - Added multiple climbing sounds (works with player footsound state) + - Modified to have on/off/toggle state via triggers + - Downsides to system, there is no abilty to go down a ladder + +/*====================================================================== +/*QUAKED trigger_ladder (.5 .5 .5) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Invisible brush based ladder (jump key to climb) +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +angle : direction player must be facing to climb ladder (required) +waitmin : time between climb sound (def = depends on sound type) +speed : velocity speed to climb ladder (def=160) +sounds : 1=metal, 2=wood, 3=rope, 4=silent, 5=custom (def=wood) +noise1-4 : custom sounds to play when climbing ladder +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Invisible brush based ladder (jump key to climb) +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_ladder_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + + // Ladders ONLY work with players because of client.qc (PlayerPreThink) + if (self.estate & ESTATE_BLOCK) return; + if ( !(self.bmodel_act.flags & FL_CLIENT) ) return; + if ( self.bmodel_act.health < 1 ) return; + + // Don't stick underwater, or in the middle of a waterjump + if (self.bmodel_act.waterlevel > 1) return; + if (self.bmodel_act.flags & FL_WATERJUMP) return; + + self.bmodel_act.onladder = 1; // Add everytime the player touches volume + self.bmodel_act.entladder = self; // Link back to play sounds +}; + +//---------------------------------------------------------------------- +void() trigger_ladder = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + // Default = wood + if (!self.sounds) self.sounds = 2; + if (self.sounds == 1) { // Metal + if(!self.waitmin) self.waitmin = 0.45; + self.noise1 = "player/ladmetal1.wav"; + self.noise2 = "player/ladmetal2.wav"; + self.noise3 = "player/ladmetal3.wav"; + self.noise4 = "player/ladmetal4.wav"; + } + else if (self.sounds == 2) { // Wood + if(!self.waitmin) self.waitmin = 0.4; + self.noise1 = "player/ladwood1.wav"; + self.noise2 = "player/ladwood2.wav"; + self.noise3 = "player/ladwood3.wav"; + self.noise4 = "player/ladwood4.wav"; + } + else if (self.sounds == 3) { // Old Rope + if(!self.waitmin) self.waitmin = 0.7; + self.noise1 = "player/ladrope1.wav"; + self.noise2 = "player/ladrope2.wav"; + self.noise3 = "player/ladrope3.wav"; + self.noise4 = "player/ladrope4.wav"; + } + else { + // Custom or empty + if (!self.waitmin) self.waitmin = 0.5; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + if (self.noise2 == "") self.noise2 = SOUND_EMPTY; + if (self.noise3 == "") self.noise3 = SOUND_EMPTY; + if (self.noise4 == "") self.noise4 = SOUND_EMPTY; + } + precache_sound(self.noise1); + precache_sound(self.noise2); + precache_sound(self.noise3); + precache_sound(self.noise4); + + self.classtype = CT_TRIGLADDER; + InitTrigger (); + if (!self.speed) self.speed = 160; + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Cannot have ladder triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + self.estate_fire = trigger_ladder_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_giveitems (0.5 0 0.5) ? NOTOUCH x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Variable sized bmodel used to give items to player +The target items only work if delay spawned spawnflag is set +The pickup sound can be turned off by adding sounds=4 to item +The target items will not respawn or work more than once +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : Points to all items to give to the player +wait : (def) -1 = will only fire targets once +angle : Facing Direction for trigger to work, use "360" for angle 0. +sounds : 1=Secret,2=talk(def),3=switch,4=silent,5=custom,6=secret2 +noise : custom sound to play when triggered +message : message to display when triggered +-------- SPAWNFLAGS -------- +NOTOUCH : can only be triggered via other entities +STARTOFF : Requires trigger to activate +-------- NOTES -------- +Variable sized bmodel used to give items to activator +The target items only work if delay spawned spawnflag is set +The pickup sound can be turned off by adding sounds=4 to item +The target items will not respawn or work more than once + +======================================================================*/ +void() trigger_giveitem_fire = +{ + local entity stemp; + + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + // Activator can only be the player + if (!(self.bmodel_act.flags & FL_CLIENT)) return; + if (self.bmodel_act.health < 1) return; + if (self.target == "") return; + + // Save for later and reset activator + stemp = self; activator = self.bmodel_act; + + // Play the sound ON the activator and display message + if (self.noise != "") sound (activator, CHAN_VOICE, self.noise, 1, ATTN_NORM); + if (self.message != "") centerprint (activator, self.message); + + // Search entity list for targets + self.enemy = find (world, targetname, self.target); + + while(self.enemy) { + // This only works with items + if (self.enemy.flags & FL_ITEM) { + // Only works with items that start off + if (self.enemy.spawnflags & ENT_STARTOFF) { + if (self.enemy.touch2 != SUB_Null) { + // Switch to item for touch function + other = self.bmodel_act; + activator = self.bmodel_act; + self = self.enemy; + // make sure items never respawn and silent pickup + self.spawnflags = self.spawnflags - (self.spawnflags & ITEM_RESPAWN); + self.respawn_time = -1; + self.respawn_trig = FALSE; + // item should always be floating (no drop to floor functions) + self.spawnflags = self.spawnflags | ITEM_FLOATING; + // give trigger sound overrides all items + if (stemp.sounds != 4) self.noise = SOUND_EMPTY; + // Use original touch function + self.touch2 (); + self = stemp; + + } + } + } + // Are there anymore targets left in the list? + self.enemy = find (self.enemy, targetname, self.target); + } + + // always TRIGGER_ONCE functionality + self.attack_finished = LARGE_TIMER; +}; + +//---------------------------------------------------------------------- +void() trigger_giveitems = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.sounds == 0) self.sounds = 4; // Default = silence + trigger_bmodel_sounds(); // Precache any sounds + self.classtype = CT_TRIGGIVEITEM; + InitTrigger (); + + // Always trigger once functionality + self.wait = -1; + + // Cannot have trigger give items touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Setup Entity State functionality + self.estate_fire = trigger_giveitem_fire; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_fog (.5 .5 .5) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Trigger change global fog to new value over time +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : name of target(s) to trigger +speed : time (secs) to fade from current to new (-1 = instant, 2s = default) +wait : time between re-triggering (def=2s, -1=once) +angle : Facing Direction for trigger to work, use "360" for angle 0. +fog_density : new fog density (def=0.5, -1=debug mode) +fog_colour : new fog colours (def=0.1 0.1 0.1) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Trigger change global fog to new value over time + +======================================================================*/ +void() trigger_fog_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + if (query_configflag(SVR_NOFOGCMDS)) { + dprint("\b[FOG]\b quake.rc disabled, removing!\n"); + self.attack_finished = LARGE_TIMER; + entity_remove(self, 0.1); + return; + } + + // Print dev message if worldspawn not setup correctly + // First fog blend will be weird otherwise + if (!fog_active) { + if (self.pain_finished < time) { + dprint("\b[FOG]\b Missing density + colour on worldspawn!\n"); + dprint("\b[FOG]\b First fog blend requires worldspawn setup\n"); + } + self.pain_finished = time + 1; + } + + // Crazy test option, random fog! + if (self.lefty) { + self.fog_density = random(); + self.fog_colour_x = random(); + self.fog_colour_y = random(); + self.fog_colour_z = random(); + self.speed = 1 + random()*4; + } + + // Update global fog controller + fade_fog(self.fog_density, self.fog_colour, self.speed); + SUB_UseTargets(); + + // Is the trigger repeatable? + if (self.wait > 0) { + if (self.wait < self.speed) self.wait = self.speed + 0.1; + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + // block trigger and turn off (trigger_once) + else { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_fog_waitforcontrol = +{ + if (fog_control && fog_active) { + // Setup Entity State functionality + self.estate_fire = trigger_fog_fire; + trigger_bmodel_setup(); + } + else { + self.think = trigger_fog_waitforcontrol; + self.nextthink = time + 0.1 + random(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_fog = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGFOG; + InitTrigger (); + + // A fade time < minimum fade time = instant change + if (self.speed < FADEFOG_TIME) self.speed = FADEFOG_TIME; + if (!self.speed) self.speed = 2; + if (!self.wait) self.wait = 2; + self.attack_finished = 0; + + // Cannot have fog triggers touched by monsters + self.spawnflags = self.spawnflags - (self.spawnflags & TRIG_MONSTERS); + + // Check for debug test mode (random density/colour) + if (self.fog_density < 0) self.lefty = TRUE; + // Default density/colour + if (!self.fog_density) self.fog_density = 0.1; + if (CheckZeroVector(self.fog_colour)) self.fog_colour = '0.1 0.1 0.1'; + + trigger_fog_waitforcontrol(); +}; + +/*====================================================================== +/*QUAKED trigger_nomonjump (.5 .5 .5) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Stop monsters from using jump attack +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : -1 = trigger_once functionality +delay : time to delay jump attack by (def=0.5s) +waitmin: Re-trigger timer to stop touch flooding (def=0.1s) +noise1 : specify classname that CAN use this trigger (noise1=monster_dog) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Stop monsters from using jump attack + +======================================================================*/ +void() trigger_nomonjump_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Block non-monsters + if (!(self.bmodel_act.flags & FL_MONSTER)) return; + + // Is there any classname exception setup? + if (self.noise1 != "") { + if (self.bmodel_act.classname != self.noise1) return; + } + + // Check for any extra triggers, fire them once! + if (self.target != "") { + trigger_strs(self.target, activator); + self.target = ""; + } + + // Update jump flag to block jump attacks + self.bmodel_act.jump_flag = time + self.delay; + // Restrict the trigger to 0.1s re-triggering + self.attack_finished = time + self.waitmin; + + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_nomonjump = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGNOJUMP; + if (!self.delay) self.delay = 0.5; + if (!self.waitmin) self.waitmin = 0.1; + // Work out dimensions of trigger + InitTrigger (); + + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Setup Entity State functionality + self.estate_fire = trigger_nomonjump_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); + +}; + +//---------------------------------------------------------------------- +// Re-direct because it was renamed to be more consistent +void() trigger_monsternojump = { trigger_nomonjump(); }; + +/*====================================================================== +/*QUAKED trigger_monsterdrop (0 .5 .5) (-8 -8 -8) (8 8 8) x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Drop monster(s) to floor +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : -1 = trigger_once functionality +height : the speed thrown upwards (def 50) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Drop monster(s) to floor +======================================================================*/ + +void() trigger_monsterdrop_use = +{ + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + if (self.target == "") return; + + // Build initial list from world + self.oldenemy = find(world, targetname, self.target); + while (self.oldenemy) { + // only works with monsters + if (self.oldenemy.flags & FL_MONSTER) { + // Double check for swim/fly types + if (!(self.oldenemy.flags & (FL_FLY || FL_SWIM))) { + // Got to be onground already + if (self.oldenemy.flags & FL_ONGROUND) { + // Set monster in motion + self.oldenemy.flags = self.oldenemy.flags - FL_ONGROUND; + self.oldenemy.velocity_z = self.height; + } + } + } + // Find next monster in list + self.oldenemy = find(self.oldenemy, targetname, self.target); + } + // Setup to trigger once functionality? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterdrop = +{ + self.classtype = CT_TRIGMONDROP; + if (!self.height) self.height = 50; + + // Check for firing conditions (nightmare, coop) + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_monsterdrop_use; + self.estate = ESTATE_ON; +}; + +/*====================================================================== +/*QUAKED trigger_monsterjump (.5 .5 .5) ? x FLYING SWIMMING x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Push monsters in a certain direction +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : target entity for custom direction +wait : -1 = trigger_once functionality +angle : direction of push (-2 is down, -1 up) +speed : the speed thrown forward (def 200) +height : the speed thrown upwards (def 200) +noise1 : specify classname that CAN use this trigger (noise1=monster_dog) +-------- SPAWNFLAGS -------- +FLYING : Will affect flying monsters +SWIMMING : Will affect swimming monsters +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Push monsters in a certain direction +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_monsterjump_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; + + // Cannot move spawning statues + if (self.bmodel_act.spawnstatue) return; + // Check monster is not jumping already + if (self.bmodel_act.jump_flag > time) return; + + // Block non-monsters and fly/swim if spawnflag not set + if (!(self.bmodel_act.flags & FL_MONSTER)) return; + if (!(self.spawnflags & TRIG_MONJUMPFLY) && self.bmodel_act.flags & FL_FLY) return; + if (!(self.spawnflags & TRIG_MONJUMPSWIM) && self.bmodel_act.flags & FL_SWIM) return; + + // Is there any classname exception setup? + if (self.noise1 != "") { + if (self.bmodel_act.classname != self.noise1) return; + // extra special condition for enraged drole's + if (self.bmodel_act.classtype == CT_MONDROLE && !self.bmodel_act.attack_rage) return; + } + + // Check for any triggers, fire them once! + if (self.target != "") { + trigger_strs(self.target, activator); + self.target = ""; + } + + // Flying/Swimming monsters only need a push in the right direction + if (self.bmodel_act.flags & FL_FLY || self.bmodel_act.flags & FL_SWIM) { + self.bmodel_act.velocity = self.movedir * self.speed; + } + else { + // set XY even if not on ground, so the jump will clear lips + self.bmodel_act.velocity_x = self.movedir_x * self.speed; + self.bmodel_act.velocity_y = self.movedir_y * self.speed; + // If monster on the ground, lift them up + if (self.bmodel_act.flags & FL_ONGROUND ) { + self.bmodel_act.flags = self.bmodel_act.flags - FL_ONGROUND; + self.bmodel_act.velocity_z = self.height; + } + } + + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterjump = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGMONJUMP; + if (!self.speed) self.speed = 200; + if (!self.height) self.height = 200; + if (self.angles_y == 0) self.angles_y = 360; + // Work out facing angle + InitTrigger (); + + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Setup Entity State functionality + self.estate_fire = trigger_monsterjump_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); + + // If target is setup, calculate new facing angle + if (self.target != "") { + self.nextthink = time + 2; + self.think = TargetMovedir; + } +}; + +//---------------------------------------------------------------------- +void() trigger_drolejump = +{ + self.noise1 = "monster_drole"; + trigger_monsterjump(); +}; + +/*====================================================================== +/*QUAKED trigger_monsterturret (0.5 0.3 0) ? x x x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Temporarily turn a monster into a turret +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +wait : -1 = Only trigger a monster turret function once +count : random chance to pause; constant = -1, def = 0.25, range = 0 - 1 +noise1 : only works with this type of monster (monster_ogre) +-------- SPAWNFLAGS -------- +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Temporarily turn a monster into a turret +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_monsterturret_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + + local entity tself; + + if (self.estate & ESTATE_BLOCK) return; + if (self.attack_finished > time) return; // trigger_once functionality + if (!(self.bmodel_act.flags & FL_MONSTER)) return; // ONLY Monsters! + if (self.bmodel_act.health < 1) return; // Dead things cannot be turrets! + if (self.bmodel_act.movespeed < 0) return; // Already a turret!?! + if (!self.bmodel_act.enemy) return; // This is a combat node only + if (self.bmodel_act.turretactive) return; // Already using a turret position + if (!self.bmodel_act.th_missile) return; // Only works if got range attack + if (self.noise1 != "") { if (self.noise1 != self.bmodel_act.classname) return; } + + // Switch to monster + tself = self; + self = self.bmodel_act; other = tself; + // check enemy visibility and direction + if (visible(self.enemy) && infront(self.enemy)) { + // Link the monster to the turret (used by ai_run) + self.turretactive = other; + } + + self = tself; + // Setup to trigger push once? + if (self.wait < 0) { + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_monsterturret = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGMONTURRET; + if (self.count < 0) self.count = -1; + else if (self.count == 0 || self.count > 1) self.count = 0.25; + InitTrigger (); + + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + + // Setup Entity State functionality + self.estate_fire = trigger_monsterturret_fire; + self.touch = trigger_bmodel_anytouch; + trigger_bmodel_setup(); +}; + +/*====================================================================== +/*QUAKED trigger_hurt (.5 .5 .5) ? x BUBBLES MONSTER_ONLY x MODCHECK FALLING STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Will hurt any touching entity +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +dmg : damage from contact with trigger (def=5) +wait : time between pain contact (def=1s) +angle : Facing Direction for trigger to work, use "360" for angle 0. +speed : used by falling spawnflag for velocity check (def=300) +height : Maximum travel distance up for bubbles (default trigger size) +count : total amount of active bubbles at once (default 5) +style : 1-15 (grey,brown1,blue1,green1,red1,brown2,pinkyel,brown3,purp1,purp2,brown4,green2,yellow,blue2,red2) +-------- SPAWNFLAGS -------- +BUBBLES : Spawn bubbles within trigger volume when active +MONSTER_ONLY : Will only affect monsters +MODCHECK : Will remove this entity if THIS mod is active +FALLING : Only hurts if the player is falling (speed=velocity) +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Will hurt any touching entity that can take damage +This entity cannot be damaged and is always touchable once activated + +======================================================================*/ +void() trigger_hurt_fire = +{ + // This is after bmodel _use, _killed and _touch, so any reference + // to the trigger activator has to go through 'bmodel_act' + if (self.attack_finished > time) return; + if (self.bmodel_act.takedamage == DAMAGE_NO) return; + if (self.spawnflags & TRIG_HURTMONSTER && !(self.bmodel_act.flags & FL_MONSTER)) return; + // Check for falling damage conditions (player + flying + speeding) + if (self.spawnflags & TRIG_HURTFALLING) { + if (self.bmodel_act.flags & FL_MONSTER) return; + if (self.bmodel_act.flags & FL_ONGROUND) return; + if (fabs(self.bmodel_act.velocity_z) < self.speed) return; + } + + // Check for any dead monster bodies (no exceptions) + if (trigger_check_body(self.bmodel_act,DEAD_EXPLODE)) return; + + // Check for godmode players taking screenshots! + if (self.bmodel_act.flags & FL_CLIENT && self.bmodel_act.flags & FL_GODMODE) return; + + // Block touch function based on wait time + self.attack_finished = time + self.wait; + T_Damage (self.bmodel_act, self, self, self.dmg, DAMARMOR); +}; + +//---------------------------------------------------------------------- +void() trigger_hurt_on = +{ + self.estate = ESTATE_ON; + self.solid = SOLID_TRIGGER; + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + // Spawn bubbles inside volume brush + trigger_spawn_bubbles(); +}; + +//---------------------------------------------------------------------- +void() trigger_hurt = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + if (self.spawnflags & TRIG_MODCHECK) { remove(self); return; } + self.classtype = CT_TRIGHURT; + InitTrigger (); + // No trigger damage functionality and always touchable! + self.spawnflags = self.spawnflags | TRIG_ALWAYTOUCH | TRIG_NODAMAGE; + if (self.dmg < 0) self.dmg = 0; + else if (self.dmg == 0) self.dmg = 5; + if (self.wait <= 0) self.wait = 1; + + // Setup bubble model/counter/volume + if (self.spawnflags & TRIG_SPAWNBUBBLES) trigger_setup_bubbles(); + + // Setup default falling damage speed + if (self.spawnflags & TRIG_HURTFALLING && self.speed < 1) self.speed = 300; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trigger_hurt_on; + self.estate_off = trigger_bmodel_off; + self.estate_disable = trigger_bmodel_disable; + if (self.dmg > 0) { + self.estate_fire = trigger_hurt_fire; + self.touch = trigger_bmodel_anytouch; + } + + // Switch on OR off? + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +/*====================================================================== +/*QUAKED trigger_heal (.5 .5 .5) ? x BUBBLES x x x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Heals any player who touches this trigger +-------- KEYS -------- +targetname : trigger entity (works with entity state system) +target : trigger once when players stands in trigger (start cycle) +target2 : trigger once when healing expires (finish cycle) +wait : time between healing (default 1s) +healamount : amount to heal each time touched (default 10) +max_health : total amount to heal (default 50, -1=no limit) +sounds : 1=heal_15, 2=heal_25, 3=heal_100, 4=respawn, 5=custom (default 1) +noise : Custom sound for healing +lip : All messages are silent to the player (heal/expire) 1=block heal 2=block all +message : centerprints when players stands in trigger +message2 : centerprints when healing function has expired +height : Maximum travel distance up for bubbles (default trigger size) +count : total amount of active bubbles at once (default 5) +style : 1-15 (grey,brown1,blue1,green1,red1,brown2,pinkyel,brown3,purp1,purp2,brown4,green2,yellow,blue2,red2) +yaw_speed : spawning rate (def=0.5) for bubbles (speed + random() x speed) +-------- SPAWNFLAGS -------- +BUBBLES : Spawn bubbles within trigger volume when active +STARTOFF : Starts off and waits for trigger +-------- NOTES -------- +Heals any player who touches this trigger, can be triggered on/off and produces +bubbles within the bounding box of the trigger when spawnflag enabled + +======================================================================*/ +void() trigger_heal_touch = +{ + if (self.estate & ESTATE_BLOCK) return; // Function off/disabled + if (self.attack_finished > time) return; // Touch blocked (temporary) + if ( !(other.flags & FL_CLIENT) ) return; // Only works with clients + if (other.health < 1 ) return; // Cannot heal, target is dead + if (self.health < 1) return; // Run out of health + + // Do not constantly check healing, use wait + self.attack_finished = time + self.wait; + + // Can the pool heal the player? + if (!T_Heal(other, self.healamount, 0)) return; + + // Healing sound + sound (other, CHAN_BODY, self.noise, 1, ATTN_NORM); + // Has the pool run out of health? + if (self.max_health > 0) self.health = self.health - self.healamount; + + // Has the healing trigger expired? + if (self.health < 1) { + // Only block message lip=1 healing 2=all messages + if (self.lip < 2) centerprint (other, self.message2); + // Fire any targets once (finish of healing cycle) + if (self.target2 != "") {trigger_strs(self.target2, other);self.target2 = "";} + // Switch off healing trigger + entity_state_off(); + } + else { + // Fire any targets once (start of healing cycle) + if (self.target != "") {trigger_strs(self.target, other);self.target = "";} + // Display healing message (check for lip block) + if (!self.lip) centerprint (other, self.message); + } +}; + +//---------------------------------------------------------------------- +void() trigger_heal_on = +{ + if (self.health > 0) { + self.estate = ESTATE_ON; + self.solid = SOLID_TRIGGER; + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + // Spawn bubbles inside volume brush + trigger_spawn_bubbles(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_heal_reset = +{ + if (self.max_health > 0) { + // Reset health, targets and switch on entity + self.health = self.max_health; + if (self.noise1 != "") self.target = self.noise1; + if (self.noise2 != "") self.target2 = self.noise2; + self.estate_on(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_heal = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + InitTrigger (); + self.classtype = CT_TRIGHEAL; + + // Setup default healing sound + if (self.sounds == 2) self.noise = SOUND_HEAL25; + else if (self.sounds == 3) self.noise = SOUND_HEAL100; + else if (self.sounds == 4) self.noise = SOUND_RESPAWN; + else if (self.sounds == 5 && self.noise == "") self.noise = SOUND_HEAL15; + else self.noise = SOUND_HEAL15; + precache_sound(self.noise); + + // Setup bubble model/counter/volume + if (self.spawnflags & TRIG_SPAWNBUBBLES) trigger_setup_bubbles(); + + if (!self.wait) self.wait = 1; // Default trigger time + if (self.healamount < 1) self.healamount = 10; // Quantity to heal each touch trigger + if (!self.max_health) self.max_health = 50; // Default max healing + // Cannot have healamount large than max, need to cap healamount + if (self.max_health > 0 && self.max_health < self.healamount) + self.healamount = self.max_health; + + if (self.max_health < 0) self.health = 100; // max < 0 = Infinite healing + else self.health = self.max_health; // Reset total ready + + if (!self.message) self.message = "You feel the effects of the healing pool"; + if (!self.message2) self.message2 = "The Healing Pool has expired!"; + + // Save any trigger names for reset events + if (self.target != "" ) self.noise1 = self.target; + if (self.target2 != "" ) self.noise2 = self.target2; + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trigger_heal_on; + self.estate_off = trigger_bmodel_off; + self.estate_disable = trigger_bmodel_disable; + self.estate_reset = trigger_heal_reset; + self.touch = trigger_heal_touch; + + // Switch on OR off? + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + else self.estate_on(); +}; + +/*====================================================================== +/*QUAKED trigger_touchsound (.5 .5 .5) ? x x WORLDGEO DRAIN x x STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Plays sounds when touched by the player +------- KEYS -------- +targetname : trigger entity (works with entity state system) +sounds : 1=Water (def) 2=Slime 3=Lava 4=silent 5=custom +noise : Custom trigger touch sound +noise1 : Custom trigger exit sound +noise2 : Custom draining sound +speed : Time (def=1.5s) to drain liquid +yaw_speed : Vertical drain speed (def=0.05) +water_alpha: Alpha value for liquid (override worldspawn) +-------- SPAWNFLAGS -------- +WORLDGEO : Will draw bmodel (not just a trigger) +DRAIN : Drain effect when trigger_disabled +STARTOFF : Requires trigger to activate +------- NOTES -------- +Plays sounds when touched by the player + +======================================================================*/ +void() trigger_tsound_touch = +{ + if (self.estate & ESTATE_BLOCK) return; // Function off/disabled + if (self.attack_finished > time) return; // Touch blocked (temporary) + if ( !(other.flags & FL_CLIENT) ) return; // Only works with clients + if (other.health < 1 ) return; // other is dead + + if (other.touchedliquid < time) + sound (other, CHAN_BODY, self.noise, 1, ATTN_NORM); + other.touchedliquid = time + 0.1; + other.touchedsound = self.noise1; + self.attack_finished = time + 0.05; +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_on = +{ + // No longer need this spawnflag, remove it + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_TRIGGER; + self.origin = self.oldorigin; + self.alpha = self.water_alpha; + if (self.spawnflags & TRIG_TSOUNDWGEO) setmodel (self, self.mdl); +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_fade = +{ + // Take draining time and divide by time passed + self.lip = self.speed - ((time - self.ltime) / self.speed); + // Start at current alpha value and move towards 0 + self.alpha = self.lip * (self.water_alpha / self.speed); + // Slowly sink into the ground as alpha fading + self.origin_z = self.origin_z - (self.speed * self.yaw_speed); + // Exit condition + if (self.alpha <= 0) { + self.alpha = 0.01; + self.model = ""; + self.estate = ESTATE_OFF; + return; + } + // Keep on loop (using minimum QS time segment) + self.nextthink = time + FADEMODEL_TIME; +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_drain = +{ sound(self, CHAN_AUTO, self.owner.noise2, 1, ATTN_NORM); }; + +//---------------------------------------------------------------------- +void() trigger_tsound_disable = +{ + if (self.estate & ESTATE_BLOCK) return; + self.solid = SOLID_NOT; + self.estate = ESTATE_DISABLE; + + if (self.spawnflags & TRIG_TSOUNDDRAIN) { + // Allow for bmodel timer to alpha correctly + self.ltime = time; + // Gradually fade and lower bmodel + self.think = trigger_tsound_fade; + self.nextthink = time + FADEMODEL_TIME; + // Start playing draining sound + self.sound_emitter.think = trigger_tsound_drain; + self.sound_emitter.nextthink = time + self.super_time; + } +}; + +//---------------------------------------------------------------------- +void() trigger_tsound_syncalpha = +{ + // Allow for trigger to override global water alpha + if (self.water_alpha > 0) self.alpha = self.water_alpha; + else if (liquid_alpha > 0) self.alpha = liquid_alpha; + else self.alpha = 1; + // Save this value for later + self.water_alpha = self.alpha; + if (!(self.spawnflags & ENT_STARTOFF)) self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() trigger_touchsound = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGTSOUND; + self.mdl = self.model; + InitTrigger (); + + if (!self.speed) self.speed = 1.5; + if (!self.yaw_speed) self.yaw_speed = 0.05; + if (self.super_time < 0.1) self.super_time = 0.1; + self.attack_finished = 0; + self.oldorigin = self.origin; + + // Default sounds (water) + if (self.sounds < 1) self.sounds = 1; + + // Precache all sounds + if (self.sounds == 1) { + if (self.noise == "") self.noise = "player/inh2o.wav"; + if (self.noise1 == "") self.noise1 = "misc/outwater.wav"; + } + else if (self.sounds == 2) { + if (self.noise == "") self.noise = "player/slimbrn2.wav"; + if (self.noise1 == "") self.noise1 = "misc/outwater.wav"; + } + else if (self.sounds == 3) { + if (self.noise == "") self.noise = "player/inlava.wav"; + if (self.noise1 == "") self.noise1 = "misc/outwater.wav"; + } + // make sure there is always a sound (empty) defined + if (self.noise == "") self.noise = SOUND_EMPTY; + if (self.noise1 == "") self.noise1 = SOUND_EMPTY; + + precache_sound(self.noise); + precache_sound(self.noise1); + + if (self.spawnflags & TRIG_TSOUNDDRAIN) { + if (self.noise2 == "") self.noise2 = "ambience/liquid_drain.wav"; + precache_sound(self.noise2); + // Create an entity to play drain sound + // bmodel origins are at 0,0,0 so never play properly + self.sound_emitter = spawn(); + self.sound_emitter.owner = self; + self.sound_emitter.origin = bmodel_origin(self) + '0 0 32'; + self.sound_emitter.solid = SOLID_NOT; + self.sound_emitter.movetype = MOVETYPE_NONE; + setmodel(self.sound_emitter, MODEL_EMPTY); + setorigin(self.sound_emitter, self.sound_emitter.origin); + } + + // Setup Entity State functionality + if (self.targetname != "") self.use = entity_state_use; + self.estate_on = trigger_tsound_on; + self.estate_off = trigger_bmodel_off; + self.estate_disable = trigger_tsound_disable; + self.touch = trigger_tsound_touch; + + // Switch off? + if (self.spawnflags & ENT_STARTOFF) self.estate_off(); + + // Sync the water alpha console variable + self.think = trigger_tsound_syncalpha; + self.nextthink = time + 0.1 + random(); +}; + +/*====================================================================== +/*QUAKED trigger_void (.5 .5 .5) ? NO_CLIENT NO_MONSTER NO_AMMO NO_EGG NO_TEMP NO_ITEM STARTOFF x Not_Easy Not_Normal Not_Hard Not_DM +Garbage collector for bottom of skyboxes +------- KEYS -------- +targetname : trigger entity (works with entity state system) +-------- SPAWNFLAGS -------- +NO_CLIENT : Ignore clients (anything flagged as a client) +NO_MONSTER : Ignore monsters (anything flagged as a monster) +NO_AMMO : Ignore ammo types (all ammo projectile types) +NO_EGG : Ignore minion eggs (affects shalrath, wraiths) +NO_TEMP : Ignore temporary ents (gibs, sparks, smoke) +NO_ITEM : Ignore items (weapons,armor,keys,runes,powerups) +STARTOFF : Requires trigger to activate +------- NOTES -------- +Garbage collector for bottom of skyboxes +======================================================================*/ +void() trigger_void_touch = +{ + // Exception, entity state and particles! + if (self.estate & ESTATE_BLOCK) return; + if (other.classtype == CT_PARTICLE) return; + + // Check for any dead monster bodies (no exceptions) + if (trigger_check_body(other,DEAD_REMOVE)) return; + + // Process spawnflag exceptions + if (self.spawnflags & TRIG_VOIDNOCLIENT && other.flags & FL_CLIENT) return; + if (self.spawnflags & TRIG_VOIDNOMONSTER && other.flags & FL_MONSTER) return; + if (self.spawnflags & TRIG_VOIDNOAMMO) { + if (other.classgroup == CG_PROJALL) return; + else if (other.classgroup == CG_PROJSHELLS) return; + else if (other.classgroup == CG_PROJNAILS) return; + else if (other.classgroup == CG_PROJROCKETS) return; + else if (other.classgroup == CG_PROJCELLS) return; + } + if (self.spawnflags & TRIG_VOIDNOGG && other.classgroup == CG_MINIONEGG) return; + if (self.spawnflags & TRIG_VOIDNOTEMP && other.classgroup == CG_TEMPENT) return; + if (self.spawnflags & TRIG_VOIDNOITEM) { + if (other.classgroup == CG_WEAPON) return; + else if (other.classgroup == CG_AMMOITEM) return; + else if (other.classgroup == CG_ARMOR) return; + else if (other.classgroup == CG_KEY) return; + else if (other.classgroup == CG_RUNE) return; + else if (other.classgroup == CG_ARTIFACT) return; + } + + // flag touching entity, so other functions will ignore it + other.touchedvoid = TRUE; + + // Let monsters and clients die through their own functions + if (other.flags & FL_CLIENT || other.flags & FL_MONSTER) + T_Damage (other, self, self, other.health+8, NOARMOR); + else { + // Remove all ammo projectiles on contact + // Hide other items types (may have particles active) + if (other.classgroup == CG_PROJALL) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJSHELLS) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJNAILS) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJROCKETS) entity_remove(other,0.1); + else if (other.classgroup == CG_PROJCELLS) entity_remove(other,0.1); + else if (other.classgroup == CG_MINIONEGG) entity_remove(other,0.1); + else if (other.classgroup == CG_TEMPENT) entity_remove(other,0.1); + else if (other.classgroup == CG_WEAPON) entity_hide(other); + else if (other.classgroup == CG_AMMOITEM) { + entity_hide(other); + // Hide any shell/nail lids + if (other.attachment) entity_hide(other.attachment); + } + else if (other.classgroup == CG_ARMOR) entity_hide(other); + else if (other.classgroup == CG_KEY) entity_hide(other); + else if (other.classgroup == CG_RUNE) entity_hide(other); + else if (other.classgroup == CG_ARTIFACT) entity_hide(other); + else if (other.classgroup == CG_MISCENT) entity_hide(other); + } +}; + +//---------------------------------------------------------------------- +void() trigger_void = +{ + if (check_bmodel_keys()) return; // Check for bmodel errors + + self.classtype = CT_TRIGVOID; + InitTrigger (); + setsize (self, self.bbmins, self.bbmaxs); + + // Setup Entity State functionality + // This does not work via typical trigger bmodel paths + // This trigger is special, needs to work straight away + // There is only a toggle/on/off state function + if (self.targetname != "") self.use = entity_state_use; + self.touch = trigger_void_touch; + if (self.spawnflags & ENT_STARTOFF) self.estate = ESTATE_OFF; + else self.estate = ESTATE_ON; +}; diff --git a/QC_other/QC_keep/triggers_keep.qc b/QC_other/QC_keep/triggers_keep.qc new file mode 100644 index 00000000..591c7ccb --- /dev/null +++ b/QC_other/QC_keep/triggers_keep.qc @@ -0,0 +1,326 @@ +float COUNTER_TOGGLE = 1.000; +float COUNTER_LOOP = 2.000; +float COUNTER_STEP = 4.000; +float COUNTER_RESET = 8.000; +float COUNTER_RANDOM = 16.000; +float COUNTER_FINISHCOUNT = 32.000; +float COUNTER_START_ON = 64.000; + +void () counter_on_use; +void () counter_off_use; +void () oncount_use; + +void () trigger_remove = { trigger_void(); }; + +void () trigger_setgravity_touch = { + if (other.flags & FL_CLIENT) { + other.gravity = self.gravity; + other.gravtrigent = self; + other.gravtrig = 1; + //dprint("Gravity changed to:\n"); Removed since it spams the console every frame on developer 1 + //dprint(ftos(self.gravity)); + //dprint("\n"); + } +}; + +void () trigger_setgravity = { + InitTrigger (); + self.touch = trigger_setgravity_touch; + if (self.gravity <= 0 || self.gravity > 1) self.gravity = 1; +}; + +float CMD_ACTIVATOR_ONLY = 2; +float CMD_UPDATE_ENV_VARIABLES = 4; +float CMD_DO_NOT_TERMINATE = 8; + + +void () command_use_server = { + local entity pent; + + if (self.spawnflags & CMD_ACTIVATOR_ONLY) { + pent = other; + if (pent != world && pent.flags & FL_CLIENT) { + stuffcmd(pent,self.message); + if (!(self.spawnflags & CMD_DO_NOT_TERMINATE)) { + stuffcmd(pent,"\n"); + } + } else { + if (activator != world && activator.flags & FL_CLIENT) { + stuffcmd(activator,self.message); + if (!(self.spawnflags & CMD_DO_NOT_TERMINATE)) { + stuffcmd(activator,"\n"); + } + } + } + } else { + // Stuff commands to all players on the server + pent = find(world,classname,"player"); + while (pent) { + if (pent != world && pent.flags & FL_CLIENT) { + stuffcmd(pent,self.message); + if (!(self.spawnflags & CMD_DO_NOT_TERMINATE)) { + stuffcmd(pent,"\n"); + } + } + pent = find(world, classname, "player"); + } + } +}; + +void () command_use = { + localcmd (self.message); + if (!(self.spawnflags & CMD_DO_NOT_TERMINATE)) { + localcmd("\n"); + } + if (self.classname == "info_command_spawn") { + entity_hide(self); + } +}; + +void () info_command_use_server = { command_use_server(); }; +void () info_command_use = { command_use(); }; + +void () info_command = { + if (self.message == "") { remove(self); return; } + self.use = info_command_use; + self.think = SUB_Null; +}; +void () info_command_server = { + if (self.message == "") { remove(self); return; } + self.use = info_command_use_server; + self.think = SUB_Null; +}; + +void () info_command_spawn = { + if (self.message == "") { remove(self); return; } + //self.spawnflags = self.spawnflags | CMD_RESEND_ON_LOAD; + self.use = info_command_use; + self.think = SUB_Null; +}; + +void () trigger_command_touch = { if (other.flags & FL_CLIENT) command_use(); }; +void () trigger_command = { + if (self.message == "") { remove(self); return; } + InitTrigger (); + self.touch = trigger_command_touch; +}; + +void () trigger_waterfall_touch = { + if ( !(other.flags & FL_CLIENT) ) return ; + other.velocity = (other.velocity + self.movedir); + other.velocity_x = (other.velocity_x + (self.count * (random () - 0.500))); + other.velocity_y = (other.velocity_y + (self.count * (random () - 0.500))); +}; + +void () trigger_waterfall = { + InitTrigger (); + self.touch = trigger_waterfall_touch; + if ( (self.count == FALSE) ) self.count = 100.000; + if ( (self.movedir == '0 0 0') ) self.movedir = '0 -90 0'; + if ( (self.speed == FALSE) ) { + self.movedir = (self.movedir * 50.000); + } else { + self.movedir = (self.movedir * self.speed); + } +}; + + + +void () counter_think = { + self.cnt = (self.cnt + TRUE); + if ( (self.spawnflags & COUNTER_RANDOM) ) { + self.state = (random () * self.count); + self.state = (floor (self.state) + TRUE); + } else { + self.state = self.cnt; + } + activator = other; + SUB_UseTargets (); + self.nextthink = (time + self.wait); + if ( (self.spawnflags & COUNTER_STEP) ) counter_on_use (); + if ( (self.cnt >= self.count) ) { + self.cnt = FALSE; + if ( (self.aflag || !(self.spawnflags & COUNTER_LOOP)) && self.spawnflags & COUNTER_TOGGLE ) { counter_on_use (); } else { remove (self); } + } +}; + +void () counter_on_use = { + if ( ((self.cnt != FALSE) && (self.spawnflags & COUNTER_FINISHCOUNT)) ) { self.aflag = TRUE; return; } + self.use = counter_off_use; + self.think = SUB_Null; + self.aflag = FALSE; +}; + +void () counter_off_use = { + self.aflag = FALSE; + if ( (self.spawnflags & COUNTER_TOGGLE) ) { + self.use = counter_on_use; + } else { + self.use = SUB_Null; + } + if ( (self.spawnflags & COUNTER_RESET) ) { + self.cnt = FALSE; + self.state = FALSE; + } + self.think = counter_think; + if ( self.delay ) { + self.nextthink = (time + self.delay); + } else { + counter_think (); + } +}; +float (entity counter) counter_GetCount = { + if ( (counter.classname == "counter") ) return ( counter.state ); + return ( FALSE ); +}; + +void () func_counter = { + if ( !self.wait ) self.wait = TRUE; + self.count = floor (self.count); + if ( (self.count <= FALSE) ) self.count = MOVETYPE_BOUNCE; + self.cnt = FALSE; + self.state = FALSE; + self.classname = "counter"; + self.use = counter_off_use; + self.think = SUB_Null; + if ( (self.spawnflags & COUNTER_START_ON) ) { + self.think = counter_off_use; + self.nextthink = (time + 0.100); + } +}; + +void () oncount_use = { + if ( (counter_GetCount (other) == self.count) ) { + activator = other; + SUB_UseTargets (); + } +}; + +void () func_oncount = { + self.count = floor (self.count); + if ( (self.count <= FALSE) ) self.count = TRUE; + self.classname = "oncount"; + self.use = oncount_use; + self.think = SUB_Null; +}; + +void() change_cvar = { + local entity check; + + cvar_set (self.netname, self.message); + bprint("\n\n"); + self.classname = "cvar_done"; + check = find(world, classname, "player"); + if(!check) check = find(world, classname, "camera"); + check.ideal_yaw = -1; + self.nextthink = time + 0.02; + self.think = SUB_UseTargets; +}; + +void() cvarset_touch = { + if (other.health <= 0 || other.classname != "player") return; + change_cvar(); +}; + +void() trigger_cvarset = { + if (deathmatch || coop) remove (self); + InitTrigger (); + self.use = change_cvar; + self.touch = cvarset_touch; +}; + +//- - - - - - - - - +// Update 8/19/09: Jump/Dive Triggers + +// Hipnotic's cnt stuff - - - - - - - - +// Code common to various triggers with Hip countdown on touch. +void() HipCntDown = +{ + if (self.cnt > 0) + { + self.cnt = self.cnt - 1; + if (self.cnt == 0) + { + self.solid = SOLID_NOT; // PM: Another safeguard. + self.touch = SUB_Null; + self.nextthink = time + 0.1; + self.think = SUB_Remove; + } + } +}; + +// Override velocity if a player jumps within one. +void() tjump_touch = +{ + if (other.health <= 0) + return; + if (other.classname != "player") //if (!(other.flags & FLx_CREATURE)) + return; // Only creatures can use jump pads. + + if (self.spawnflags & PUSH_JUMP_ONLY) + { // Jump only when player presses jump button. +// if (other.fly_sound < time) +// { +// other.fly_sound = time + 1.5; +// if (!(self.spawnflags & PUSH_CURRENT)) +// sound (other, CHAN_AUTO, "ambience/windfly.wav", 1, ATTN_NORM); +// } + if (!other.jump_time || (other.jump_time + 0.2 < time)) + return; // Didn't jump recently. + other.jump_time = 0; // Time to fly! + } + else + { // Automatic use. + if (other.flags & FL_CLIENT) // Only clients use falling damage. + other.jump_flag = 0; // Don't take damage if fell on trigger. + if (other.flags & FL_ONGROUND == 0) + return; + } + +// Up, up, and away! + if (!(self.spawnflags & PUSH_CURRENT)) + { // First sound overrides jump sound. Second sound is standard push sound. + sound (other, CHAN_BODY, "items/reflect.wav", 1, ATTN_NORM); + sound (other, CHAN_AUTO, "ambience/windfly.wav", 1, ATTN_NORM); + } + if (self.speed) + { // Unlike trigger_monsterjump, jump at a direction 'other' is facing. + local vector vec; + + vec = '0 0 0'; + vec_y = other.angles_y; + makevectors (vec); + other.velocity = v_forward * self.speed; + } + other.velocity_z = self.height; + other.flags = other.flags - (other.flags & FL_ONGROUND); + +// if (self.spawnflags & PUSH_ONCE) +// {remove (self); return;} + +// Hipnotic's cnt stuff - - - - - - - - + HipCntDown (); +//- - - - - - - - - - - - - - - - - - - +}; + +//============ +// --> QUAKED trigger_jump (.5 .5 .5) ? PUSH_ONCE PUSH_CURRENT PUSH_JUMP_ONLY +// Pushes the player up +//============ +void() trigger_jump_spawn = +{ + precache_sound ("ambience/windfly.wav"); + precache_sound ("items/reflect.wav"); // Bounce sound. + + // 'InitTrigger' already done elsewhere. + self.touch = tjump_touch; + + if (!self.height) + self.height = 1000; // PM: Use 900 in roman3 and unforgiven2. +// Hipnotic's cnt stuff - - - - - - - - + if (!self.cnt) + self.cnt = -1; +//- - - - - - - - - - - - - - - - - - - +}; + +void() trigger_jump = {InitTrigger (); trigger_jump_spawn ();}; \ No newline at end of file diff --git a/QC_other/QC_keep/triggers_states.qc b/QC_other/QC_keep/triggers_states.qc new file mode 100644 index 00000000..d1d23dff --- /dev/null +++ b/QC_other/QC_keep/triggers_states.qc @@ -0,0 +1,356 @@ +/*====================================================================== + TRIGGER STATE FUNCTIONS +======================================================================*/ +float TRIG_NOTOUCH = 1; // Touch functionality is disabled +float TRIG_INVIEW = 8; // player has to see trigger +float TRIG_MODCHECK = 16; // Will remove this entity if THIS mod is active +float TRIG_MONSTERS = 32; // Cane be touched/triggered by monsters +// float ENT_STARTOFF = 64; // Global spawnflags setting + +// Added by functions, no map entity interaction +float TRIG_NODAMAGE = 16384; // Block trigger damage functionality +float TRIG_ALWAYTOUCH = 32768; // Always allow touch function to exist + +//---------------------------------------------------------------------- +void() trigger_bmodel_sounds = +{ + // Used by lots of different triggers for standard sounds + if (self.sounds == 1) self.noise = "misc/secret.wav"; + else if (self.sounds == 2) self.noise = SOUND_TALK; + else if (self.sounds == 3) self.noise = "misc/trigger1.wav"; + else if (self.sounds == 4) self.noise = SOUND_EMPTY; + else if (self.sounds == 6) self.noise = "misc/secret3.wav"; + // precache any sounds that have been defined + if (self.noise != "") precache_sound(self.noise); +}; + +//---------------------------------------------------------------------- +// Special sight trigger, Is the player *looking* at this trigger +// This sight trigger cannot be disabled or turned off atm +//---------------------------------------------------------------------- +void() trigger_bmodel_inview = +{ + local entity client, tself; + local float play_dist, play_range, play_angle; + + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + + // Checkclient needs an proper entity origin, bmodels are '0 0 0' + // Create a temporary entity to switch around too for checkclient + if (!self.attachment) { + self.attachment = spawn(); + self.attachment.owner = self; + self.oldorigin = bmodel_origin(self); + setorigin(self.attachment, self.oldorigin); + } + + // Swap around self/attachment so checkclient can work properly + tself = self; self = self.attachment; + client = checkclient (); // Find a client in current PVS + self = tself; + + // Found a player to check sight/distance for? + if (client.flags & FL_CLIENT) { + if (visxray(client, VEC_ORIGIN, VEC_ORIGIN, FALSE)) { + // Work out vector length between entity and player + play_dist = vlen(self.oldorigin - client.origin); + // Is there a distance check active? if not make sure it will pass + if (!self.t_length) play_range = play_dist + 1; + else play_range = self.t_length; + + // The angle the player is facing towards the trigger (45 = forward) + play_angle = viewangle(self.oldorigin, client.origin, 45, TRUE, client.v_angle_y); + + // Check distance is correct and facing angle focused + if (play_dist < play_range && play_angle > 30 && play_angle < 60) { + self.wait = -1; + self.bmodel_act = activator; + self.estate_fire(); + return; + } + } + } + + // Keep checking, 0.1 standard entity timing + self.nextthink = time + 0.1; + self.think = trigger_bmodel_inview; +}; + +//---------------------------------------------------------------------- +// the trigger was just touched/killed/used +// self.bmodel_act should be set to the activator so it can be held +// through a delay so wait for the delay time before firing +//---------------------------------------------------------------------- +void() trigger_bmodel_fire = +{ + // Is the trigger blocked? (trigger_once) + if (self.attack_finished > time) return; + + //---------------------------------------------------------------------- + // The Shotgun and Axe upgrades can make maps too easy, allow for + // triggers to not fire if the key is TRUE and inventory empty + //---------------------------------------------------------------------- + if ( self.bmodel_act.flags & FL_CLIENT ) { + if (self.upgrade_axe && !(self.bmodel_act.moditems & IT_UPGRADE_AXE)) return; + if (self.upgrade_ssg && !(self.bmodel_act.moditems & IT_UPGRADE_SSG) ) return; + if (self.upgrade_lg && !(self.bmodel_act.moditems & IT_UPGRADE_LG) ) return; + } + + // Trigger secrets only work for players + if (self.classtype == CT_TRIGSECRET) { + // If trigger_secret has NOTOUCH then check activator + if (!(self.bmodel_act.flags & FL_CLIENT)) return; + // The trigger can be reset, so double check + if (self.count > 0) { + found_secrets = found_secrets + self.count; + WriteByte (MSG_ALL, SVC_FOUNDSECRET); + self.count = 0; // Secrets only work once + } + } + + // Play the sound ON the trigger, NOT the activator + if (self.noise != "") sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + + //---------------------------------------------------------------------- + // One of the downside to trigger_multi and trigger_once is that they + // reset the activator global variable each time they are used. + // This can causes problems with triggers that require client references + // for centerprint/sound cues (like trigger_secret) + // The way to get around this problem is to use trigger_relay as this does + // not change the activator variable + // + activator = self.bmodel_act; + SUB_UseTargets(); + + // Is the trigger repeatable? + if (self.wait > 0) { + self.attack_finished = time + self.wait; + self.nextthink = self.attack_finished; + self.think = self.estate_on; + } + else { + // TRIGGER_ONCE functionality + self.attack_finished = LARGE_TIMER; + self.estate_off(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_use = +{ + // There is no client test here because this can come from + // multiple entity types, the activator is passed on + if (self.estate & ESTATE_BLOCK) return; + self.bmodel_act = activator; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_touch = +{ + // This is a client touch event, triggers that require + // other entity types need to have their own touch event + if (self.estate & ESTATE_BLOCK) return; + if ( !(self.spawnflags & TRIG_MONSTERS) && !(other.flags & FL_CLIENT) ) return; + + // Did the trigger have an angle key setup? + if (CheckZeroVector(self.movedir) == FALSE) { + makevectors (other.angles); + if (v_forward * self.movedir < 0) return; + } + + self.bmodel_act = other; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_anytouch = +{ + // This will allow anything to touch it + if (self.estate & ESTATE_BLOCK) return; + self.bmodel_act = other; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_killed = +{ + // The proto button setup of triggers using health + // Always reset health regardless if blocked or not + self.health = self.max_health; + if (self.estate & ESTATE_BLOCK) return; + self.takedamage = DAMAGE_NO; + self.bmodel_act = damage_attacker; + self.estate_fire(); +}; + +//---------------------------------------------------------------------- +// Setup touch/damage/bounding box functionality +//---------------------------------------------------------------------- +void() trigger_bmodel_restore = +{ + // Damage functionality + if (self.max_health > 0 && !(self.spawnflags & TRIG_NODAMAGE) ) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + } + // The extra option (ALWAYSTOUCH) was added because some triggers + // have re-used spawnflag 1 for other purposes and they still need + // touch founctionality + else if ( !(self.spawnflags & TRIG_NOTOUCH) || self.spawnflags & TRIG_ALWAYTOUCH) + self.solid = SOLID_TRIGGER; + // Turn off touch functionality + else self.solid = SOLID_NOT; + + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + + // Check for spawning conditions (nightmare, coop) + // Needs to exist after entity has been added to work for BSPorigin + if (check_nightmare() == TRUE) return; + if (check_coop() == TRUE) return; +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_delay = +{ + if (self.estate == ESTATE_DISABLE) return; + + // Remove the START OFF functionality + self.spawnflags = self.spawnflags - (self.spawnflags & ENT_STARTOFF); + + // Reset USE and trigger_once conditions + self.estate_use = trigger_bmodel_use; + self.attack_finished = 0; + self.estate = ESTATE_ON; + + // Check if the player needs to be inview before triggering? + // It would be weird to have this on multiple/secret triggers + if (self.classtype == CT_TRIGONCE && self.spawnflags & TRIG_INVIEW) { + // Restore bounding box (dev testing visual thing) + setsize (self, self.bbmins, self.bbmaxs); + // Inview triggers are not touchable and cannot be damaged + self.spawnflags = self.spawnflags | TRIG_NOTOUCH | TRIG_NODAMAGE; + self.estate_use = trigger_bmodel_inview; + self.estate_use(); + return; + } + + //---------------------------------------------------------------------- + // I would have never of guessed this was used throughout the original + // ID maps and there are countless cases of trigger_multiple entities + // being used like buttons that can be damaged but not touched. + // I get the impression this was a prototype stage of development where + // everyone was waiting for func_button functionality to come online. + // + if (self.health && !(self.spawnflags & TRIG_NODAMAGE)) { + self.max_health = self.health; // save health for later + self.th_die = trigger_bmodel_killed; // damage trigger + } + else { + // Setup touch functionality + if ( !(self.spawnflags & TRIG_NOTOUCH) || self.spawnflags & TRIG_ALWAYTOUCH) { + if (!self.touch) self.touch = trigger_bmodel_touch; + } + } + + // Setup touch/damage/bounding box functionality + trigger_bmodel_restore(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_on = +{ + self.estate = ESTATE_ON; + self.movetype = MOVETYPE_NONE; + + // Check for delayed/trigger_once functionality? + if (self.spawnflags & ENT_STARTOFF || self.attack_finished > time) + self.solid = SOLID_NOT; + else { + // Setup touch/damage/bounding box functionality + trigger_bmodel_restore(); + } +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_off = +{ + self.estate = ESTATE_OFF; + self.movetype = MOVETYPE_NONE; + self.solid = SOLID_NOT; + setsize(self, VEC_ORIGIN, VEC_ORIGIN); + self.estate_disable(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_reset = +{ + // Reset trigger_once conditions + self.attack_finished = 0; + self.estate_on(); +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_disable = +{ + // Shutdown trigger completely + self.takedamage = DAMAGE_NO; + self.think = SUB_Null; +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_default = +{ + self.estate_on = trigger_bmodel_on; + self.estate_off = trigger_bmodel_off; + if (!self.estate_fire) self.estate_fire = trigger_bmodel_fire; + self.estate_disable = trigger_bmodel_disable; + self.estate_reset = trigger_bmodel_reset; + self.estate = ESTATE_ON; +}; + +//---------------------------------------------------------------------- +void() trigger_bmodel_setup = +{ + trigger_bmodel_default(); + if (self.targetname != "") self.use = entity_state_use; + self.estate_use = trigger_bmodel_delay; + + if (self.spawnflags & ENT_STARTOFF) { + self.estate_use = trigger_bmodel_delay; + self.estate_on = trigger_bmodel_delay; + self.estate_off(); + } + // The original functionality of the trigger is to pass through + else self.estate_use(); +}; + +//---------------------------------------------------------------------- +// Re-direction for map hacks (not used normally) +//---------------------------------------------------------------------- +void() multi_trigger = { + trigger_bmodel_default(); + trigger_bmodel_fire(); +}; +void() multi_killed = { + trigger_bmodel_default(); + trigger_bmodel_killed(); +}; +void() multi_use = { + trigger_bmodel_default(); + trigger_bmodel_use(); +}; +void() multi_touch = { + trigger_bmodel_default(); + trigger_bmodel_touch(); +}; +void() multi_wait = { + if (self.max_health) { + self.health = self.max_health; + self.takedamage = DAMAGE_YES; + self.solid = SOLID_BBOX; + } +}; diff --git a/QC_other/QC_keep/versus.qc b/QC_other/QC_keep/versus.qc new file mode 100644 index 00000000..417e1e86 --- /dev/null +++ b/QC_other/QC_keep/versus.qc @@ -0,0 +1,136 @@ +/* VERSUS.QC +=================================================================================================================== +by Qmaster + +Multiplayer game mode where there are two teams + +Survival team must battle monsters and collect coins to pay for unlocking the next area, +weapons, powerups, etc. until they can pay for and access the exit. + +Gamemaster team must spawn monsters of their choice and collect bones to pay for more monsters +until the survival team are out of lives. + +FOR AD MOD OR AD DERIVATIVES ONLY +=================================================================================================================== +*/ +/* ADD TO setttings.qc -> ImpulseCommands() FUNCTION +=================================================================================================================== +void(entity targ) print_coins; +void(entity targ) print_bones; + + else if (self.impulse == 141) print_coins(); // Display versus currency for survival player(s) + else if (self.impulse == 142) print_bones(); // Display versus currency for gamemaster player(s) + +=================================================================================================================== +*/ + + + +void () versus_setup = { + coins = 0; + bones = 0; + numsurvivor = 0; + numgamemaster = 0; +}; + +void (entity targ) set_teamsurvivor = { + if (targ.versustype < 1) { + targ.versustype = VT_SURVIVOR; + } else { + if (developer) { + targ.versustype = VT_SURVIVOR; + } else { + sprint(targ,"Already on a team, can't change mid-game"); + } + } +}; + +void (entity targ) set_teamgamemaster = { + if (targ.versustype < 1) { + targ.versustype = VT_GAMEMASTER; + } else { + if (developer) { + targ.versustype = VT_GAMEMASTER; + } else { + sprint(targ,"Already on a team, can't change mid-game"); + } + } +}; + +void (entity targ) print_coins = { + local string retval; + retval = ftos(coins); + //retval = ("Coins:\n" + retval); + centerprint (targ,retval); +}; + + +void (entity targ) print_bones = { + local string retval; + retval = ftos(bones); + centerprint (targ,retval); +}; + +void () item_coin_touch = { + if (other.versustype != VT_SURVIVOR) return; + + sprint (other, "You got "); + sprint (other, ftos(self.count)); + sprint (other, "coins\n"); + stuffcmd (other, "bf\n"); + activator = other; + coins = coins + self.count; + SUB_UseTargets(); +}; + +void () item_coin_setup = { + if (self.noise == "") + self.noise = "items/money.wav"; + + precache_sound (self.noise); + self.touch2 = item_coin_touch; + self.bbmins = VEC_KEYS_MIN; + self.bbmaxs = VEC_KEYS_MAX; + item_start(); +}; + +void () item_coin = { + if (self.mdl == "") + self.mdl = "progs/ne_ruins/coin.mdl"; + + precache_model (self.mdl); + if (self.count < 1) self.count = 1; + item_coin_setup(); +}; + +void () item_bone_touch = { + if (other.versustype != VT_GAMEMASTER) return; + + sprint (other, "You got "); + sprint (other, ftos(self.count)); + sprint (other, "bones\n"); + stuffcmd (other, "bf\n"); + activator = other; + bones = bones + self.count; + SUB_UseTargets(); +}; + +void () item_bone_setup = { + if (self.noise == "") + self.noise = "items/money.wav"; + + precache_sound (self.noise); + self.touch2 = item_bone_touch; + self.bbmins = VEC_KEYS_MIN; + self.bbmaxs = VEC_KEYS_MAX; + item_start(); +}; + +void () item_bone = { + if (self.mdl == "") + self.mdl = "progs/ad171/proj_wraithpoison.mdl"; + + precache_model (self.mdl); + if (self.count < 1) self.count = 1; + item_bone_setup(); +}; \ No newline at end of file diff --git a/QC_other/QC_keep/wand.qc b/QC_other/QC_keep/wand.qc new file mode 100644 index 00000000..1531f9b4 --- /dev/null +++ b/QC_other/QC_keep/wand.qc @@ -0,0 +1,319 @@ +//========================================================================== +// +// ZAPPER (Flare Gun or the Ruby Wand) +// +//========================================================================== + +//========================================================================== +// Flares + +// Flares are spawned from explosions caused by the zapper when fired +// at maximum power. + +void() FlareGlitter_Think = +{ + self.frame = self.frame + 4; + if (self.flags & FL_ONGROUND) + self.nextthink = time + 0.1; + else + self.nextthink = time + 0.2; + self.think = SUB_Remove; +}; + +void() FlareGlitter = +{ + local vector ang; + + ang_x = random() * 90; // Aim downward. + if (self.flags & FL_ONGROUND) + ang_x = 0 - ang_x; + ang_y = random() * 360; + ang_z = 0; + makevectors (ang); + + newmis = spawn(); + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_NOT; // Was SOLID_TRIGGER; + newmis.velocity = v_forward * 150; + newmis.gravity = 0.5; // Don't fall as quickly. + newmis.classname = "glitter"; +// newmis.touch = SUB_Remove; +// FIXME: Merge with explosion sprite to save a model slot? + newmis.frame = 70; + if (self.flags & FL_ONGROUND) + newmis.nextthink = time + 0.1; + else + newmis.nextthink = time + 0.2; + newmis.think = FlareGlitter_Think; + + setall (newmis, "progs/drake/s_spark.spr", '0 0 0', '0 0 0', self.origin); +}; + +void() Flare_Think = +{ + if (self.delay <= time) + { if (self.effects & EF_BRIGHTLIGHT) + {self.effects = EF_DIMLIGHT; self.delay = time + 2;} // Was T+3. + else + {remove (self); return;} + } + + self.nextthink = time + 0.1; + self.think = Flare_Think; + + if (self.lefty) + FlareGlitter (); + else + { // Spawn some particles at the source. + local float den; + + den = ceil(self.delay - time) * 4; + particle (self.origin, '0 0 0', 232, den); + } + self.lefty = !self.lefty; +}; + +// Activates the spark generator that was spawned recently. +void() Flare_Activate = +{ + self.velocity = '0 0 -10'; + self.effects = EF_BRIGHTLIGHT; //EF_DIMLIGHT; + self.delay = time + 3; + Flare_Think (); +}; + +// Spawns an invisible spark generator. Because we want the explosion +// sprite visible without extra stuff in the way, the generator isn't +// active until a few frames later, when the explosion is almost over. +void(vector start) Flare_Spawn = +{ +// Effect is harmless, so owner can be anyone. + newmis = spawn (); + newmis.master = newmis.owner = world; + newmis.movetype = MOVETYPE_FLY; + newmis.solid = SOLID_NOT; + newmis.classname = "flare"; +// set newmis duration + newmis.nextthink = time + 0.4; + newmis.think = Flare_Activate; + + setall (newmis, "progs/null.spr", '0 0 0', '0 0 0', start); //was null_256.spr +}; + +// Returns the ammo charge level. Called by the equivalent of CheckPowerups. +// Charging notes, for normal mode flare gun: +// * Charging can be done only while holding the weapon. +// * The time to charge a super shot is double the time needed for +// a full spray of mini-shots. For example, if it takes one second +// to charge a spray of three shots, it takes one more second for the +// super shot. +float(entity ent) Zapper_Level = +{ + local float tnt; + + if (ent.attack_finished > time) + return 0; // Can't shoot yet. + if (ent.tome_finished) + { ent.zapper_time = 0; // In case tome wears off before discharge. + return WAND_FULL + 2; + } + if (time < ent.zapper_time) + return 0; // Don't let rollover mess up counters. + +// 0-1 = 1, 1-2 = 2, 2-3 = 3, 3-5 = 4. + tnt = ceil((time - ent.zapper_time) / WAND_DELAY); + if (tnt >= (WAND_FULL * 2 - 1)) // e.g., best 3 out of 5. + return WAND_FULL + 1; + if (tnt > WAND_FULL) + return WAND_FULL; + return tnt; +}; + +void() WandSpark_Touch = { + if (pointcontents(self.origin) == CONTENT_SKY) + {remove (self); return;} + //if (Reflected ()) + //return; + + self.touch = SUB_Null; // Stack overflow prevention. + +// hit something that bleeds + if (other.takedamage) + T_Damage (other, self, self.master, self.dmg, DAMARMOR); + + self.origin = self.origin - 8*normalize(self.velocity); + BecomeFancy (X32_CUT_ORANGE, 4); +}; + +// Note: 'shots' is number of hitscan shots. +// Does not include the two freebie side missiles. +void(vector start, vector dir, float shots) FireSparks = { + local entity targ, attacker; + local vector end, end2, d1; + local float damage, dist, mid, fr, sparx; +// local float fx; + local string dtype; + local vector glitter; + + attacker = self; + dtype = "sparks"; + damage = WAND_DAMAGE; + dist = WAND_RANGE; + fr = X32_SPARK_ORANGE; + sparx = TRUE; + // Note: Changed 225 to 97 so blood won't spawn in ports. + glitter = '233 97 1'; +// fx = EF_MUZZLEFLASH; + +// Check for ToP override. + if (shots < 1) + { + shots = 5; + damage = 5; // Heretic damage is d8 per shot. + dist = 2048; + fr = X32_CUT_ORANGE; + sparx = FALSE; + glitter_z = 0; +// fx = 0; + + // Fire the two side projectiles. + // Remember, spikes lasts up to six seconds. + d1_x = (shots - 1) * 1.40625; d1_y = 0; d1_z = 1; + end = Aim_Scatter (dir, d1); + //Knightspike_Launch (start, end, 600); //18*35=630. + launch_projectile (start, end, CT_PROJ_HKN, 600); + newmis.dmg = damage; + newmis.touch = WandSpark_Touch; + newmis.classtype = CT_WANDSPARK; + if (shots > 1) + { + d1_x = 0 - d1_x; + end = Aim_Scatter (dir, d1); + //Knightspike_Launch (start, end, 600); + launch_projectile (start, end, CT_PROJ_HKN, 600); + newmis.dmg = damage; + newmis.touch = WandSpark_Touch; + newmis.classtype = CT_WANDSPARK; + } + } + +// Start multi-trace attack. Uses MultiDamage_* functions. + mid = (shots + 1) * 0.5; + MultiDamage_Clear (); + while (shots > 0) + { + if (mid == 1) + d1 = dir; + else + { + d1_x = (shots - mid) * 2.8125; d1_y = crandom()*0.5; d1_z = 1; + d1 = Aim_Scatter (dir, d1); + } + Lead_Hitscan (start, d1, dist, damage, attacker, glitter); + targ = trace_ent; + end = trace_endpos; + end2 = end - d1*8; + // Note: Reflection merely stops the beam. + if (trace_fraction < 1) + { + MultiDamage_Add (targ, damage, 0, dtype); + self = spawn(); +// self.effects = fx; + setall (self, "progs/null.spr", '0 0 0', '0 0 0', end2); //was null_256 + // Play sizzle sounds at reduced volume and attenuation. + sound (self, CHAN_AUTO, "enforcer/enfstop.wav", 0.5, ATTN_STATIC); + BecomeFancy (fr, 4); + self = attacker; + } + shots = shots - 1; + } + MultiDamage_Apply (dtype); +}; + +// Shoots one big explosive shot. +// If multiple shots are desired, rewrite to use explosive shotgun code. +void(vector start, vector dir) FireBigSpark = +{ +// Doom damage d3*5. Heretic damage d8+6 (ToP d8*7). + local entity targ, attacker; + local vector end, end2; + local float damage, splash; + + attacker = self; + splash = WAND_DAMAGE * (WAND_FULL + 1); + damage = SUB_RandomDamage (splash); + Lead_Hitscan (start, dir, WAND_RANGE, damage, attacker, '233 97 4'); + targ = trace_ent; + end = trace_endpos; + end2 = end - dir*8; + + if (targ) + { + if (targ.classname == "monster_zombie") + { // Update 11/2/09: Let max charge obliterate (unarmored) zombies. + if (damage < targ.health) + damage = targ.health; + } + T_Damage (targ, attacker, attacker, damage, DAMARMOR); + } + self = spawn(); + setall (self, "progs/null.spr", '0 0 0', '0 0 0', end); // was null_256.spr + self.classtype = CT_WANDBIGSPARK; + T_RadiusDamage (self, attacker, splash, targ, DAMAGEALL); + self.origin = end2; + Rocket_Explosion2 (end2, 224, 16); + BecomeFancy (X80_SPARK_ORANGE, 6); + self = attacker; + + Flare_Spawn (end2); +}; + +void() W_FireSparks = { + local vector dir, org; + local float charge; + + // Using IT2_CROSS for the wand + if (self.weapon == IT2_CROSS) + charge = self.currentammo; + else + charge = 0; // This shouldn't happen, but if so... +// Update 4/5/10: Use all accumulated energy. + if (charge > WAND_FULL + 1) + charge = WAND_FULL + 1; + self.currentammo = 0; + self.zapper_time = time + WAND_DELAY; + self.attack_finished = time + WAND_DELAY; + + // Was "weapons/gldhit.wav". + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); + // Since weapon is a magic wand, no recoil effects are needed. + + makevectors (self.v_angle); + org = self.origin + v_forward*8 + '0 0 16'; + dir = aim(self, 100000); + + //GhostTouch_On (); + if (self.tome_finished) + FireSparks (org, dir, 0); + else if (charge <= WAND_FULL) + { + if (!charge) + { // Player is holding attack button down for rapid-fire. + // Scatter shots a bit like in Heretic. + local vector err; + + err_x = random(); err_x = err_x - random(); err_x = err_x * 2; + err_y = crandom(); // Was random() - 0.5; + err_z = 1; + dir = Aim_Scatter (dir, err); + charge = 1; + } + FireSparks (org, dir, charge); + } + else + FireBigSpark (org, dir); + //GhostTouch_Off (); +}; + + +//===========================/ END OF FILE /===========================// diff --git a/QC_other/QC_keep/weapons.qc b/QC_other/QC_keep/weapons.qc new file mode 100644 index 00000000..b5a949ff --- /dev/null +++ b/QC_other/QC_keep/weapons.qc @@ -0,0 +1,2169 @@ +/*====================================================================== + PLAYER ONLY WEAPON FUNCTIONS + +void() W_Precache; - moved to world.qc +float() crandom; - moved to subs.qc +vector() wall_velocity - merged into spawn_touchblood (only used once) +void(vector org, vector vel) SpawnChunk - Not used anywhere, removed + + W_SetCurrentAmmo - Update HUD icons based on self.weapon value + W_BestWeapon - returns best weapon LG > SNG > SSG > NG > SG > Axe + interesting that the function does not return GL/RL + W_CheckNoAmmo - Ammo check for attack function + W_Attack - Main function that fire weapons (player animations) + Will automatically wakeup any nearby monsters + W_ChangeWeapon - Change weapon based on availabilty and ammo + CycleWeaponCommand - Move forward or backward through active weapons + CycleWeaponReverseCommand + W_WeaponFrame - Called every frame, catches impulse event + SuperDamageSound - Plays quad damage sound + +======================================================================*/ +void() player_run; // Start of run cycle +void(entity targ) remoteplayer_run; +void() player_axe1; // Different Axe animations +void() player_axeb1; +void() player_axec1; +void() player_axed1; +void() player_axee1; + +void() player_axeold1; // Different Axe animations for original axe +void() player_axeoldb1; +void() player_axeoldc1; +void() player_axeoldd1; + +void() player_sg1; // Shotgun +void() player_supersg1; // Super Shotgun +void() player_nail1; // Nailgun +void() player_snail1; // Super Nailgun +void() player_rocket1; // Rocket Launcher +void() player_grenade1; // Grenade Launcher +void() player_multi_rocket1; // Multi-Rocket Launcher +void() player_multi_grenade1; // Multi-Grenade Launcher +void() player_light1; // Thunderbolt +void() player_plasma1; // Plasma Gun +void() player_plasmalight1; // Rogue Plasma Gun +void() player_ssgreset; // Reset weaponframe +void() player_sgreset; +void() player_grenreset; +void() player_rockreset; +void() player_crossbow1; +void() player_crossbow2; +void() player_crossbow3; +void() player_crossbow4; +void() player_crossbow5; +void() player_crossbow6; +void() player_laser1; +void() player_hammer1; +void() player_mjolnir1; +void() player_prox_grenade1; +void() player_wand1; +void() player_grapple1; +void() player_grapple3; +void() player_chainlight1; +void() player_blast1; +void() player_saw1; + +void() W_FireSparks; +void(entity ent) ReflectSound; + +/*====================================================================== + Weapon ammo run out and switching to next best weapon +======================================================================*/ +void(float wait_time) forceweaponswitch = { + local float nextweap; + + if (self.flags & FL_MONSTER) return; + + // has the player run out of ammo? work out next best weapon + nextweap = W_BestWeapon (self); + // Does the player need to switch weapons? + if (self.weapon != nextweap) { + self.weapon = nextweap; + W_SetCurrentAmmo (self); + } +}; + +/*====================================================================== + Hipnotic weapon functions +======================================================================*/ +void (float stat) HIP_FireLaser = { + local vector org; + local vector dir; + local vector out; + local float ofs; + local float aofs; + local float glow; + + if ( !self.button0 ) { + player_run (); + return ; + } + if ((self.weapon == IT2_LASER_CANNON) && (self.ammo_cells < TRUE) ) { + self.weapon = W_BestWeapon (self); + W_SetCurrentAmmo (self); + return ; + } + + if ((self.weapon == IT_SHOTGUN) && (self.ammo_shells < TRUE) ) { + self.weapon = W_BestWeapon (self); + W_SetCurrentAmmo (self); + return ; + } + + self.effects = (self.effects | EF_MUZZLEFLASH); + makevectors (self.v_angle); + ofs = MOVETYPE_TOSS; + out = v_forward; + out_z = FALSE; + out = normalize (out); + org = ((self.origin + ((STAT_TOTALMONSTERS - ofs) * v_up)) + (STAT_TOTALMONSTERS * out)); + dir = aim (self,1000.000); + aofs = (ofs * 0.707); + if ( (stat == FALSE) ) { + self.ammo_cells = (self.ammo_cells - TRUE); + self.currentammo = (self.currentammo - TRUE); + org = (org + (aofs * v_right)); + org = (org - (aofs * v_up)); + HIP_LaunchLaser (org,dir,FALSE); + org = (org - ((FL_SWIM * aofs) * v_right)); + HIP_LaunchLaser (org,dir,FALSE); + } else { + if ( (stat == TRUE) ) { + self.ammo_cells = (self.ammo_cells - TRUE); + self.currentammo = (self.currentammo - TRUE); + org = (org + (ofs * v_up)); + if ( (random () < 0.100) ) { + HIP_LaunchLaser (org,dir,TRUE); + newmis.dmg = 25.000; + } else { + HIP_LaunchLaser (org,dir,FALSE); + } + } else { + // Using the modified shotgun-turned-blaster model... + org = self.origin + '0 0 12'; + if (stat == 2) + if (self.tracer_time <= time) + {glow = TRUE; self.tracer_time = time + 0.5;} + + self.ammo_shells = (self.ammo_shells - TRUE); // blaster uses shells?? well, I guess that's fine whatevs + self.currentammo = (self.currentammo - TRUE); + HIP_LaunchLaser (org, dir, glow); + newmis.volume = 0; // No random chance of removal on impact. + // Note to self: Spread gun looks bad unless v_model is wide. + } + } + self.punchangle_x = CONTENT_EMPTY; +}; + +void (float stat) W_FireLaser = { HIP_FireLaser(stat); } + +void () HIP_FireMjolnir = { + local vector org; + local float damage; + local vector source; + + self.attack_finished = (time + 0.400); + source = (self.origin + '0.000 0.000 16.000'); + makevectors (self.v_angle); + traceline (source,(source + (v_forward * RANGE_PLAYAXE)),FALSE,self); + if ( ((trace_fraction == TRUE) && (self.ammo_cells >= 15.000)) ) { + source = (source + (v_forward * RANGE_PLAYAXE)); + traceline (source,(source - (v_up * 50.000)),FALSE,self); + if ( ((trace_fraction > 0.300) && (trace_fraction < TRUE)) ) { + HIP_FireMjolnirLightning (); + self.attack_finished = (time + 1.000); + return ; + } + } + org = (trace_endpos - (v_forward * 4)); + if ( trace_ent.takedamage ) { + damage = 50.000; + if ( (trace_ent.classgroup == CG_ZOMBIE) ) + damage = 70.000; + + trace_ent.axhitme = TRUE; + SpawnBlood (trace_ent, org,v_forward,damage); + T_Damage (trace_ent,self,self,damage, DAMARMOR); + } else { + if ( (trace_fraction != TRUE) ) { + sound (self,CHAN_WEAPON,"hipweap/mjoltink.wav",TRUE,ATTN_NORM); + WriteByte (MSG_BROADCAST,SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST,TE_GUNSHOT); + WriteCoord (MSG_BROADCAST,org_x); + WriteCoord (MSG_BROADCAST,org_y); + WriteCoord (MSG_BROADCAST,org_z); + } else { + sound (self,CHAN_WEAPON,"knight/sword1.wav",TRUE,ATTN_NORM); + } + } + self.attack_finished = (time + 0.400); +}; + +void () W_FireMjolnir = { HIP_FireMjolnir(); }; + +void () W_FireProximityGrenade = { + local entity missile; + + if (self.attack_finished > time) return; + if (self.ammo_rockets < 1) { forceweaponswitch(0.2); return;} + NumProximityGrenades = (NumProximityGrenades + TRUE); + self.ammo_rockets = (self.ammo_rockets - TRUE); + self.currentammo = (self.currentammo - TRUE); + sound (self,CHAN_WEAPON,"hipweap/proxbomb.wav",TRUE,ATTN_NORM); + self.punchangle_x = CONTENT_SOLID; + missile = spawn (); + missile.owner = self; + missile.lastvictim = self; + missile.movetype = MOVETYPE_TOSS; + missile.solid = SOLID_BBOX; + missile.classname = "proximity_grenade"; + missile.takedamage = DAMAGE_NO; + missile.health = MOVETYPE_FLY; + missile.state = FALSE; + makevectors (self.v_angle); + if ( self.v_angle_x ) { + missile.velocity = ((((v_forward * 600.000) + (v_up * 200)) + ((crandom () * v_right) * MOVETYPE_BOUNCE)) + ((crandom () * v_up) * MOVETYPE_BOUNCE)); + } else { + missile.velocity = aim (self,10000.000); + missile.velocity = (missile.velocity * 600.000); + missile.velocity_z = 200; + } + missile.avelocity = '100.000 600.000 100.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = ProximityGrenadeTouch; + missile.nextthink = (time + FL_SWIM); + missile.delay = ((time + 15.000) + (MOVETYPE_BOUNCE * random ())); + missile.think = ProximityBomb; + missile.th_die = ProximityGrenadeExplode; + setmodel (missile,"progs/hipnotic/proxbomb.mdl"); + setorigin (missile,self.origin); + setsize (missile,'-1.000 -1.000 -1.000','1.000 1.000 1.000'); + self.attack_finished = (time + 0.600); +}; + +/*====================================================================== + W_FireAxe +======================================================================*/ +void() W_FireAxe = { + local vector source, org, vec; + local float src_dist, dotprod, axedmg; + local entity onflr, tself, tother; + + makevectors (self.v_angle); // Player forward angle + source = self.origin + '0 0 16'; // Move source point up body + + if (self.flags & FL_GODMODE && self.flags & FL_NOTARGET) { + traceline (source, source + (v_forward* RANGE_PLAYAXE), FALSE, self); + if (trace_fraction < 1.0) { + if (trace_ent.flags & FL_MONSTER && trace_ent.health > 0) { + dprint("\n\b[DEBUG]\b system active, changing monster\n"); + trace_ent.debuglvl = 1 - trace_ent.debuglvl; + } + } + return; + } + + if (self.moditems & IT_UPGRADE_AXE) { + // See if there are any bodies lying around + onflr = find(world, bodyonflr, MON_ONFLR); + while (onflr) { + src_dist = vlen(source - onflr.origin); + if (src_dist < RANGE_CHOPAXE) { // Is the body close to the player? + org = onflr.origin - '0 0 16'; // move origin close to floor + makevectors (self.v_angle); // Calculate viewing angle + vec = normalize (org - self.origin); + dotprod = vec * v_forward; + if (dotprod > 0.6) { // Is the body infront of the player + onflr.origin = org; // Move gib closer to floor + onflr.bodyonflr = string_null; // no more body gibbing + tself = self; tother = other; // save self/other + self = onflr; other = tself; // switch around + if (onflr.classgroup == CG_ZOMBIE) { + self.health = 0; + Killed(onflr, tself); + } + else { + self.max_health = MON_NOGIBVELOCITY; // use minimal velocity + monster_ThrowGib(); // throw parts + } + + self = tself; other = tother; // switch back + SpawnBlood (onflr, onflr.origin, '0 0 50', axedmg*4); + return; // Finished + } + } + // See if there are anymore bodies close by + onflr = find(onflr,bodyonflr, MON_ONFLR); + } + } + + // Trace forward and see if the axe has hit anything? + traceline (source, source + (v_forward* RANGE_PLAYAXE), FALSE, self); + if (trace_fraction == 1.0) return; // No contact, no hit + + org = trace_endpos - v_forward*4; // Back 4 units to spawn blood + + if (trace_ent.takedamage) { + trace_ent.axhitme = 1; // special DM/Coop axe hit sound + if (self.moditems & IT_UPGRADE_AXE) axedmg = DAMAGE_PLAYAXE2; + else axedmg = DAMAGE_PLAYAXE1; + + // Spamn blood always up so player can see it + SpawnBlood (trace_ent, org, '0 0 1', axedmg); + T_Damage (trace_ent, self, self, axedmg, DAMARMOR); + + // Check with impact sound to play + if (trace_ent.flags & FL_MONSTER) { + if (random() < 0.5) sound (self, CHAN_WEAPON, GIB_SOUND_HEAVY, 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, GIB_SOUND_HEAVY2, 1, ATTN_NORM); + } + else if (trace_ent.classtype == CT_FUNCBREAK) { + if (trace_ent.style == BTYPE_WOOD) + sound (self, CHAN_WEAPON, SOUND_AXE_WOOD, 1, ATTN_NORM); + else if (trace_ent.style == BTYPE_GLASS) + sound (self, CHAN_WEAPON, SOUND_AXE_GLASS, 1, ATTN_NORM); + else if (trace_ent.style == BTYPE_METAL) + sound (self, CHAN_WEAPON, SOUND_AXE_METAL, 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, SOUND_AXE_STONE, 1, ATTN_NORM); + } + } + //---------------------------------------------------------------------- + // WORLD OBJECT : Target does not bleed, play stone hitting sound + //---------------------------------------------------------------------- + else { + sound (self, CHAN_WEAPON, SOUND_AXE_STONE, 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + } +}; + +/*====================================================================== + OLD STYLE BULLET SYSTEM (HITSCAN) +======================================================================*/ + +//---------------------------------------------------------------------- +void(vector org, float marker_time) MarkAttack = { + newmis = spawn(); + newmis.classtype = CT_DEVMARKER; + newmis.movetype = MOVETYPE_NONE; + newmis.solid = SOLID_NOT; + setmodel(newmis, MODEL_BROKEN); + newmis.skin = rint(random()*7); + setorigin(newmis, org); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.think = SUB_Remove; + newmis.nextthink = time + marker_time; +}; + +//---------------------------------------------------------------------- +void(float damage, vector dir) TraceAttack = { + local vector vel, org; + + vel = normalize(dir + v_up*crandom() + v_right*crandom()); + vel = vel + 2*trace_plane_normal; + vel = vel * 200; + + org = trace_endpos - dir*4; + + // Check for sky content? skies don't impact or bleed + if (!check_skycontent(org)) { + if (trace_ent.takedamage) { + // Show bullet resistance as small blood+gunshot+smoke + if (trace_ent.resist_shells > 0) Resist_Shells(trace_ent, org, vel, damage); + else { + // Hitting monsters does twice the amount of blood effects + if (trace_ent.flags & FL_MONSTER) SpawnBlood (trace_ent, org, vel*0.2, damage*2); + else SpawnBlood (trace_ent, org, vel*0.2, damage); + } + // Keep adding up the damage + AddMultiDamage (trace_ent, damage); + + // Check for target dummy (manually create marker) + if (trace_ent.classtype == CT_TARGETDUMMY) + MarkAttack(org, trace_ent.wait); + } + else { + // Hit something that does not bleed (often world) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_GUNSHOT); + WriteCoord (MSG_BROADCAST, org_x); + WriteCoord (MSG_BROADCAST, org_y); + WriteCoord (MSG_BROADCAST, org_z); + } + } +}; + +//---------------------------------------------------------------------- +void(float shotcount, vector spread) FireBullets = { + local vector direction, src, dir; + + makevectors(self.v_angle); + + if (self.flags & FL_CLIENT) { + // Auto aim assist (builtin function 44) + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYAIM); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYAIM); + } + else { + // A monster attacking a monster will not dodge + if (self.enemy.flags & FL_MONSTER) + dir = normalize(self.enemy.origin - self.origin); + else { + // fire somewhat behind the player + // so a dodging player is harder to hit + dir = self.enemy.origin - self.enemy.velocity*0.2; + dir = normalize (dir - self.origin); + } + } + + src = self.origin + v_forward*10; + src_z = self.absmin_z + self.size_z * 0.7; + + ClearMultiDamage (); + while (shotcount > 0) { + direction = dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up; + traceline (src, src + direction*2048, FALSE, self); + if (trace_fraction != 1.0) TraceAttack (DAMAGE_SHELL, direction); + shotcount = shotcount - 1; + } + ApplyMultiDamage (); +}; + +/*====================================================================== +W_FireShotgun +======================================================================*/ +void() W_FireShotgun = { + local vector spread_pat; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_shells < 1) { forceweaponswitch(0.2); return;} + + // Change weapon sound if using Projectile Pellets + // IMPORTANT - default for Projectile Pellets is ON = 0 + if (!query_configflag(SVR_SHOTGPROJ)) + sound (self ,CHAN_WEAPON, "weapons/sg2.wav", 1, ATTN_NORM); + else + sound (self ,CHAN_WEAPON, "weapons/sg1.wav", 1, ATTN_NORM); + + self.effects = self.effects | EF_MUZZLEFLASH; + + if (self.perms & POW_SHOTTYMAN) { + self.attack_finished = time + 0.3; + } else { + self.attack_finished = time + 0.5; + } + self.punchangle_x = -2; + if (self.classtype != CT_MONGREMLIN) + player_sgreset(); // reset weaponframe + + self.currentammo = self.ammo_shells = self.ammo_shells - 1; + + if (self.moditems & IT_ARTSHARP) spread_pat = SPREAD_SG2; + else spread_pat = SPREAD_SG; + + // Choose between a projectile or hitscan system + if (query_configflag(SVR_SHOTGPROJ)) + FireBullets (QUANTITY_SG, spread_pat); + else { + Launch_Shells(QUANTITY_SGP, spread_pat, CT_PROJ_SG); + Launch_ShellCasing(1); // Shell casings + } +}; + +/*====================================================================== +W_FireSuperShotgun +======================================================================*/ +void() W_FireSuperShotgun = { + local float ssg_qty, shell_qty; + local vector spread_pat; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_shells < 2 && self.classtype != CT_MONGREMLIN) { forceweaponswitch(0.2); return;} + + makevectors (self.v_angle); // Special view angle for the player + + // if shot in the air - do Newton's 3rd law. (from zerstorer) + if (!(self.flags & FL_ONGROUND)) + self.velocity = self.velocity - (v_forward * 35); + + // Change weapon sound if using Shotgun Upgrade or Projectile Pellets + // IMPORTANT - default for Projectile Pellets is ON = 0 + if (self.moditems & IT_UPGRADE_SSG || !query_configflag(SVR_SHOTGPROJ)) { + sound (self ,CHAN_WEAPON, "weapons/ssg2.wav", 1, ATTN_NORM); + } else{ + sound (self ,CHAN_WEAPON, "weapons/ssg1.wav", 1, ATTN_NORM); + } + + self.effects = self.effects | EF_MUZZLEFLASH; + if (self.perms & POW_SHOTTYMAN) { + self.attack_finished = time + 0.5; + } else { + self.attack_finished = time + 0.7; + } + self.punchangle_x = -4; + if (self.classtype != CT_MONGREMLIN) + player_ssgreset(); // reset weaponframe + shell_qty = 2; // Standard shell casings quantity + + // If the player has the Widowmaker, setup triple shot + if (self.moditems & IT_UPGRADE_SSG) { + // Only got 2 shells in the gun (reduced damage) + if (self.ammo_shells < 3) { + self.ammo_shells = 0; + ssg_qty = QUANTITY_SSG * 1; + } + else { + // 150% damage + shell_qty = 3; + self.ammo_shells = self.ammo_shells - 3; + ssg_qty = QUANTITY_SSG * 1.5; + } + } + else { + // Default ID SSG damage + self.ammo_shells = self.ammo_shells - 2; + ssg_qty = QUANTITY_SSG * 1; + } + + self.currentammo = self.ammo_shells; + if (self.moditems & IT_ARTSHARP) spread_pat = SPREAD_SSG2; + else spread_pat = SPREAD_SSG; + + // Choose between a projectile or hit-scan system + if (query_configflag(SVR_SHOTGPROJ)) + FireBullets (ssg_qty, spread_pat); // Hit-scan + else { + Launch_Shells(ssg_qty, spread_pat, CT_PROJ_SSG); + Launch_ShellCasing(shell_qty); + } +}; + +/*====================================================================== +W_FireSpikes +======================================================================*/ +void(float oz, float ox) W_FireSpikes = { + local vector org, dir; + + // If run out of ammo, switch weapons to next best + if (self.ammo_nails < 1) { forceweaponswitch(0.2); return; } + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + makevectors (self.v_angle); + + // Check for auto aim state + // Auto aim assist (builtin function 44) + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYSPIKE); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYSPIKE); + + // SNG setup, sound and ammo change + if (self.ammo_nails > 1 && self.weapon == IT_SUPER_NAILGUN) { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + if (self.perms & POW_DOUBLE) { + self.currentammo = self.ammo_nails = self.ammo_nails - 1; + } else { + self.currentammo = self.ammo_nails = self.ammo_nails - 2; + } + + //------------------------------------------------------------- + // Original setup - org = self.origin + '0 0 16'; + // - SNG projectile offset idea by Kinn + // org = self.origin + dir*14 + v_right*ox; + // org_z = org_z + oz; + // The SNG offset idea was hiting far below the crosshair + // which was causing impact problems. + // Kept the barrel offset, removed the Z adjustment instead! + //------------------------------------------------------------- + org = self.origin + '0 0 16' + v_right*ox; + launch_projectile (org, dir, CT_PROJ_SNG, SPEED_PLAYSPIKE); + } + // NG setup, sound and ammo change + else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + if (self.perms & POW_DOUBLE) { + if (self.nailcosthalf) { + self.currentammo = self.ammo_nails = self.ammo_nails - 1; + self.nailcosthalf = 0; + } else { + self.nailcosthalf = 1; + } + } else { + self.currentammo = self.ammo_nails = self.ammo_nails - 1; + } + + // Original setup - org = self.origin + '0 0 16' + v_right*ox; + // - NG projectile offset idea by Kinn + // org = self.origin + '0 0 8' + dir*14 + v_right*ox; + org = self.origin + '0 0 16' + v_right*ox; + launch_projectile (org, dir, CT_PROJ_NG, SPEED_PLAYSPIKE); + } +}; + +/*====================================================================== +W_FireLavaSpikes +======================================================================*/ +void(float oz, float ox) W_FireLavaSpikes = { + local vector org, dir; + + // If run out of ammo, switch weapons to next best + if (self.ammo_lava_nails < 1) { forceweaponswitch(0.2); return; } + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + makevectors (self.v_angle); + + // Check for auto aim state + // Auto aim assist (builtin function 44) + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYSPIKE); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYSPIKE); + + // Lava SNG setup, sound and ammo change + if (self.ammo_lava_nails > 1 && self.weapon == IT_LAVA_SUPER_NAILGUN) { + sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + if (self.perms & POW_DOUBLE) { + self.currentammo = self.ammo_lava_nails = self.ammo_lava_nails - 1; + } else { + self.currentammo = self.ammo_lava_nails = self.ammo_lava_nails - 2; + } + + //------------------------------------------------------------- + // Original setup - org = self.origin + '0 0 16'; + // - SNG projectile offset idea by Kinn + // org = self.origin + dir*14 + v_right*ox; + // org_z = org_z + oz; + // The SNG offset idea was hiting far below the crosshair + // which was causing impact problems. + // Kept the barrel offset, removed the Z adjustment instead! + //------------------------------------------------------------- + org = self.origin + '0 0 16' + v_right*ox; + launch_projectile (org, dir, CT_PROJ_LAVASNG, SPEED_PLAYSPIKE); + } + // Lava NG setup, sound and ammo change + else { + sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + if (self.perms & POW_DOUBLE) { + if (self.nailcosthalf) { + self.currentammo = self.ammo_lava_nails = self.ammo_lava_nails - 1; + self.nailcosthalf = 0; + } else { + self.nailcosthalf = 1; + } + } else { + self.currentammo = self.ammo_lava_nails = self.ammo_lava_nails - 1; + } + + // Original setup - org = self.origin + '0 0 16' + v_right*ox; + // - NG projectile offset idea by Kinn + // org = self.origin + '0 0 8' + dir*14 + v_right*ox; + org = self.origin + '0 0 16' + v_right*ox; + launch_projectile (org, dir, CT_PROJ_LAVANG, SPEED_PLAYSPIKE); + } +}; + +/*====================================================================== +GRENADES +======================================================================*/ +void() W_FireGrenade = +{ + local vector dir, avel; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_rockets < 1) { forceweaponswitch(0.2); return;} + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.6; + self.punchangle_x = -2; + player_grenreset(); // reset weaponframe + + makevectors (self.v_angle); + // Has the player aimed left/right? then no auto aim assist + if (self.v_angle_x) { + dir = v_forward*SPEED_PLAYGRENADE + v_up * ELEV_ZAXIS + crandom()*v_right*10 + crandom()*v_up*10; + } + else { + // Check for auto aim state + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYAIM); + else dir = normalize(v_forward * SPEED_PLAYGRENADE); + // Work out default speed and elevation + dir = dir * SPEED_PLAYGRENADE; + dir_z = ELEV_ZAXIS; + } + avel = vecrand(100,200,FALSE); + Launch_Grenade(self.origin, dir, avel, CT_PROJ_GL); +}; + +/*====================================================================== + ROCKETS +======================================================================*/ +void() W_FireRocket = +{ + local vector org, dir; + + // Ran out of ammo, switch to next best weapon + if (self.attack_finished > time) return; + if (self.ammo_rockets < 1) { forceweaponswitch(0.2); return;} + + self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.8; + self.punchangle_x = -2; + player_rockreset(); // reset weaponframe + + makevectors (self.v_angle); + org = self.origin + v_forward * 8 + '0 0 16'; + + // Auto aim assist (builtin function 44) + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_RLPLAYER); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_RLPLAYER); + + Launch_Missile (org, dir, '0 0 0', CT_PROJ_ROCKET, SPEED_RLPLAYER); +}; + +void () W_Fire_Crossbow = { + local vector org, dir; + + if (self.attack_finished > time) return; + if (self.ammo_bolts < 1) { forceweaponswitch(0.2); return;} + self.currentammo = self.ammo_bolts = self.ammo_bolts - 1; + + makevectors (self.v_angle); + sound (self, CHAN_WEAPON, "weapons/crossbow_fire.wav", 1, ATTN_NORM); + + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYSPIKE); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_DCROSS); + + self.attack_finished = time + 0.9; + org = self.origin + '0 0 16'; + launch_projectile (org, dir, CT_PROJ_BOLT1, 1100); +}; + +void () W_Fire_Crossbow_Poison = { + local vector org, dir; + + if (self.attack_finished > time) return; + if (self.ammo_poison < 1) { forceweaponswitch(0.2); return;} + self.currentammo = self.ammo_poison = self.ammo_poison - 1; + + makevectors (self.v_angle); + sound (self, CHAN_WEAPON, "weapons/crossbow_fire.wav", 1, ATTN_NORM); + + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYSPIKE); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_DCROSS); + + self.attack_finished = time + 0.9; + org = self.origin + '0 0 16'; + self.poisonous = 1; + launch_projectile (org, dir, CT_PROJ_BOLT2, 1100); +}; + +/*====================================================================== +PLASMA +======================================================================*/ +void() W_FirePlasma = { + local vector org, dir; + + // If run out of ammo, switch weapons to next best + if (self.attack_finished > time) return; + if (self.ammo_cells < 1) { forceweaponswitch(0.2); return; } + + // Do nothing if weapon is under water + if (self.waterlevel > 1) { + self.attack_finished = time + 0.2; + sound (self, CHAN_WEAPON, "weapons/nofire.wav", 1, ATTN_NORM); + return; + } + + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + + makevectors (self.v_angle); + + // Check for auto aim state + // Auto aim assist (builtin function 44) + if ((autoaim_cvar < 1) && self.classtype != CT_MONGREMLIN) dir = aim(self, SPEED_PLAYPLASMA); + // Straight line forward where crosshair is pointing + else dir = normalize(v_forward * SPEED_PLAYPLASMA); + + sound (self, CHAN_WEAPON, "weapons/plasma_fire.wav", 1, ATTN_NORM); + self.currentammo = self.ammo_cells = self.ammo_cells - 1; + + org = self.origin + v_forward*8 + '0 0 16'; + launch_plasma (org, dir, CT_PROJ_PLASMA, SPEED_PLAYPLASMA); +}; + +void(vector lstart, entity lsource, float ldamage) LightningReflection; + +//---------------------------------------------------------------------- +void(vector p1, vector p2, entity from, float damage) LightningDamage = { + local entity e1, e2; + local vector f; + local float lighthit, temp_classgroup; + + f = p2 - p1; + normalize (f); + f_x = 0 - f_y; + f_y = f_x; + f_z = 0; + f = f*16; + + e1 = e2 = world; + lighthit = FALSE; + // LightningDamage (org, trace_endpos, self, 10); + // dprint("Light ("); dprint(trace_ent.classname); dprint(")\n"); + traceline (p1, p2, FALSE, self); + if (trace_ent.takedamage) { + lighthit = TRUE; + // Some weird MP velocity hack! + if (self.classtype == CT_PLAYER) { + if (other.classtype == CT_PLAYER) + trace_ent.velocity_z = trace_ent.velocity_z + 400; + } + } + else { + e1 = trace_ent; + + traceline (p1 + f, p2 + f, FALSE, self); + if (trace_ent != e1 && trace_ent.takedamage) lighthit = TRUE; + else { + e2 = trace_ent; + + traceline (p1 - f, p2 - f, FALSE, self); + if (trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage) + lighthit = TRUE; + } + } + + // Found a target to hit? + if (lighthit) { + //---------------------------------------------------------------------- + // Check for breakable/pushable monster immunity + if (ai_immunedamage(self, trace_ent)) { + // This is resist lightning function without pain sound + // Don't spawn smoke constantly (let the sprite finish) + if (self.lightning_timer < time) { + self.lightning_timer = time + 0.3; + SpawnExplosion(EXPLODE_BURST_SMOKE, trace_endpos, ""); + } + SpawnProjectileSmoke(trace_endpos, 200, 50, 150); + } + + // Check for any cell/lightning resistance + else if (trace_ent.resist_cells > 0) { + damage = damage * trace_ent.resist_cells; + Resist_Lightning(trace_ent, trace_endpos); + if (damage > 0) { + // Need to fool T_Damage that damage is coming from LG + temp_classgroup = from.classgroup; + from.classgroup = CG_PROJCELLS; + T_Damage (trace_ent, from, from, damage, DAMARMOR); + from.classgroup = temp_classgroup; + } + } + else { + // Originally used 225 blood colour + SpawnBlood(trace_ent, trace_endpos, '0 0 100', damage*4); + T_Damage (trace_ent, from, from, damage, DAMARMOR); + } + // Check for any lightning reflection abilitites + if (trace_ent.reflectlightning) { + // Source = Lightning originally came from player + LightningReflection(trace_endpos, trace_ent, damage*0.5); + } + } +}; + +//---------------------------------------------------------------------- +// New ability to spawn lighting strikes in random directions +//---------------------------------------------------------------------- +void(vector lstart, entity lsource, float ldamage) LightningReflection = +{ + local vector lfinish, dir; + + // Setup a random XYZ direction (+/-) + lfinish = lstart + vecrand(0,1000,1); + + // Trace line in random direction + traceline(lstart, lfinish, FALSE, lsource); + + // Random chance of a plasma/lightning bolt! + if (random() < 0.5) { + dir = normalize(trace_endpos - lstart); + launch_plasma(lstart, dir, CT_REFLECTLIGHT, SPEED_REFLECTION); + } + else { + // Draw lighting beam (32 model unit chunks) + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, lsource); + WriteCoord (MSG_BROADCAST, lstart_x); + WriteCoord (MSG_BROADCAST, lstart_y); + WriteCoord (MSG_BROADCAST, lstart_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + // Check for damage with new lightning beam + LightningDamage(lstart, trace_endpos, world, ldamage); + } +}; + +//---------------------------------------------------------------------- +// This lightning damage check is designed for the lightning gun +// with many modifiers designed for the player and MP combat +// This function should not be used for general lightning damage +//---------------------------------------------------------------------- +void(vector p1, vector p2, entity from, float damage) PlayerLightningDamage = +{ + local entity e1, e2; + local vector f; + local float lighthit, temp_classgroup; + + f = p2 - p1; + normalize (f); + f_x = 0 - f_y; + f_y = f_x; + f_z = 0; + f = f*16; + + e1 = e2 = world; + lighthit = FALSE; + // LightningDamage (org, trace_endpos, self, 10); + // dprint("Light ("); dprint(trace_ent.classname); dprint(")\n"); + traceline (p1, p2, FALSE, self); + if (trace_ent.takedamage) { + lighthit = TRUE; + // Some weird MP velocity hack! + // The story about this code (from quakeworld.nu) + // + // This code appears to have been there for a long, long time. + // It was there in Quake 1.06 Shareware release, and it may have + // been there before that. Someone must have been experimenting + // with something and forgot it there, but no one noticed because + // in that function, the 'other' entity is not usually set to + // anything in particular, and the code never worked. + // + // But then QW came along, and in the QW engine it turns out + // that 'other' will be set to 'self' if the player is touching + // a platform. And so the dormant code stared working! It was + // discovered by players, and players started using it to their + // advantage. Now it's an integral part of dm6 gameplay. + // + // The code was apparently discovered and removed when Quake QC + // code was cleaned up before being released to public, so you + // won't normally see it in NQ mods. But it is there in the + // progs.dat in pak0.pak; and it will work in QuakeWorld engines + // supporting progs.dat (currently FTE and ZQuake). + // + if (self.classtype == CT_PLAYER) { + if (other.classtype == CT_PLAYER) + trace_ent.velocity_z = trace_ent.velocity_z + 400; + } + } + else { + e1 = trace_ent; + + traceline (p1 + f, p2 + f, FALSE, self); + if (trace_ent != e1 && trace_ent.takedamage) lighthit = TRUE; + else { + e2 = trace_ent; + + traceline (p1 - f, p2 - f, FALSE, self); + if (trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage) + lighthit = TRUE; + } + } + + // Found a target to hit? + if (lighthit) { + // Check for any cell/lightning resistance + if (trace_ent.resist_cells > 0) { + damage = Resist_Damage(trace_ent, IT_CELLS, damage); + Resist_Lightning(trace_ent, trace_endpos); + if (damage > 0) { + // Need to fool T_Damage that damage is coming from LG + temp_classgroup = from.classgroup; + from.classgroup = CG_PROJCELLS; + T_Damage (trace_ent, from, from, damage, DAMARMOR); + from.classgroup = temp_classgroup; + } + } + else { + // Originally used 225 blood colour + SpawnBlood(trace_ent, trace_endpos, '0 0 100', damage*4); + T_Damage (trace_ent, from, from, damage, DAMARMOR); + } + // Check for any lightning reflection abilitites + if (trace_ent.reflectlightning) { + // Source = Lightning originally came from player + LightningReflection(trace_endpos, trace_ent, damage*0.5); + } + } +}; + + +//---------------------------------------------------------------------- +void() W_FireLightning = { + local vector dir; + local float cells; + + // Ran out of ammo, switch to next best weapon + if (self.ammo_cells < 1) { forceweaponswitch(0.2); return; } + + // explode if under water + if (self.waterlevel > 1) { + cells = self.ammo_cells; + self.ammo_cells = 0; + W_SetCurrentAmmo (self); + T_RadiusDamage (self, self, 35*cells, world, DAMAGEALL); + return; + } + + // Time for a new LG hit sound? + if (self.t_width < time) { + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.t_width = time + 0.6; + } + + self.currentammo = self.ammo_cells = self.ammo_cells - 1; + self.effects = self.effects | EF_MUZZLEFLASH; + self.attack_finished = time + 0.2; + self.punchangle_x = -2; + + dir = self.origin + '0 0 16'; + traceline (dir, dir + v_forward*6000, TRUE, self); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LIGHTNING2); + WriteEntity (MSG_BROADCAST, self); + WriteCoord (MSG_BROADCAST, dir_x); + WriteCoord (MSG_BROADCAST, dir_y); + WriteCoord (MSG_BROADCAST, dir_z); + WriteCoord (MSG_BROADCAST, trace_endpos_x); + WriteCoord (MSG_BROADCAST, trace_endpos_y); + WriteCoord (MSG_BROADCAST, trace_endpos_z); + + PlayerLightningDamage (self.origin, trace_endpos + v_forward*4, self, DAMAGE_LGPLAYER); +}; + +// Fires chain lightning. +// Replaces 'W_FireLightning' and custom 'W_FireBurstLight'. +void(float cl) W_FireThunderbolt = { + local vector org; + local float cells, damage; // Used as ammo cost first, then as damage. + + // Ran out of ammo, switch to next best weapon + if (self.ammo_cells < 1) { forceweaponswitch(0.2); return; } + + // explode if under water + if (self.waterlevel > 1) { + cells = self.ammo_cells; + self.ammo_cells = 0; + W_SetCurrentAmmo (self); + T_RadiusDamage (self, self, 35*cells, world, DAMAGEALL); + return; + } + + if (self.t_width < time) { + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.t_width = time + 0.6; + } + self.punchangle_x = -2; + + damage = 2; + if (self.tome_finished) + damage = damage + 1; + if (self.ammo_cells < damage) + damage = self.ammo_cells; + + self.currentammo = self.ammo_cells = self.ammo_cells - damage; + damage = damage * 15; + +// Grrr, when a beam is drawn from a client, it always starts from the +// origin no matter the source point passed. QuakeC can't fix this +// without causing some other problem sore to the eyes. + makevectors(self.v_angle); + org = self.origin + '0 0 16'; +// Note: Changing 1st parm won't make lightning start elsewhere from client. + if (cl) + BurstLit_Bolt (self.origin, org + v_forward*600, self, damage, 350); + else + LightningBolt (self.origin, org + v_forward*600, self, damage, self, TE_LIGHTNING2, "thunderbolt"); +}; + + + + + + + + + + + + + + +void () W_FireMultiGrenade = { + local entity missile; + + if (self.attack_finished > time) return; + + self.attack_finished = time + 0.6; + self.ammo_multi_rockets = (self.ammo_multi_rockets - TRUE); + self.currentammo = (self.currentammo - TRUE); + sound (self,CHAN_WEAPON,"weapons/grenade.wav",TRUE,ATTN_NORM); + self.punchangle_x = CONTENT_SOLID; + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + missile.classname = "MultiGrenade"; + makevectors (self.v_angle); + if ( self.v_angle_x ) { + missile.velocity = ((((v_forward * 600.000) + (v_up * 200.000)) + ((crandom () * v_right) * MOVETYPE_BOUNCE)) + ((crandom () * v_up) * MOVETYPE_BOUNCE)); + } else { + missile.velocity = aim (self,10000.000); + missile.velocity = (missile.velocity * 600.000); + missile.velocity_z = 200.000; + } + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = MultiGrenadeTouch; + missile.nextthink = (time + TRUE); + missile.think = MultiGrenadeExplode; + setmodel (missile,"progs/rogue/mervup.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,self.origin); +}; + +void () W_FireMultiRocket = { + if (self.attack_finished > time) return; + self.ammo_multi_rockets = (self.ammo_multi_rockets - TRUE); + self.currentammo = (self.currentammo - TRUE); + sound (self,CHAN_WEAPON,"weapons/sgun1.wav",TRUE,ATTN_NORM); + self.punchangle_x = CONTENT_SOLID; + MultiRocketLaunch (-10.000,FL_SWIM); + MultiRocketLaunch (CONTENT_LAVA,MOVETYPE_WALK); + MultiRocketLaunch (MOVETYPE_FLY,FALSE); + MultiRocketLaunch (MOVETYPE_BOUNCE,TRUE); + self.attack_finished = time + 0.9; +}; + +void () W_FirePlasmaGun = { + local entity missile; + + if (self.attack_finished > time) return; + if ( (self.waterlevel > TRUE) ) { + W_SetCurrentAmmo (self); + discharged = TRUE; + T_RadiusDamage (self,self,(35.000 * self.ammo_plasma),world,DAMAGEALL); + discharged = FALSE; + self.ammo_plasma = FALSE; + return ; + } + self.ammo_plasma = (self.ammo_plasma - TRUE); + self.currentammo = (self.currentammo - TRUE); + sound (self,CHAN_WEAPON,"plasma/fire.wav",0.500,ATTN_NORM); + self.punchangle_x = CONTENT_SOLID; + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_FLYMISSILE; + missile.solid = SOLID_BBOX; + missile.classname = "plasma"; + makevectors (self.v_angle); + missile.velocity = aim (self,1250); + missile.velocity = (missile.velocity * 1250); + missile.avelocity = '300.000 300.000 300.000'; + missile.angles = vectoangles (missile.velocity); + missile.touch = PlasmaTouch; + setmodel (missile,"progs/plasma.mdl"); + setsize (missile,VEC_ORIGIN,VEC_ORIGIN); + setorigin (missile,((self.origin + (v_forward * FL_CLIENT)) + '0.000 0.000 16.000')); + sound (missile,CHAN_WEAPON,"plasma/flight.wav",TRUE,ATTN_NORM); + missile.think = PlasmaGroundOut; + missile.nextthink = (time + MOVETYPE_FLY); + self.attack_finished = time + 0.8; +}; + +/*====================================================================== + PLAYER WEAPON UPDATES AND AMMO CHECKS + + W_SetCurrentAmmo - Update HUD icons based on self.weapon value + W_BestWeapon - returns best weapon LG > SNG > SSG > NG > SG > Axe + interesting that the function does not return GL/RL + W_CheckNoAmmo - Ammo check for attack function + W_Attack - Main function that fire weapons (player animations) + Will automatically wakeup any nearby monsters + W_ChangeWeapon - Change weapon based on availabilty and ammo + CycleWeaponCommand - Move forward or backward through active weapons + CycleWeaponReverseCommand + W_WeaponFrame - Called every frame, catches impulse event + SuperDamageSound - Plays quad damage sound + +======================================================================*/ +void(entity targ) W_SetCurrentAmmo = { + if (intermission_running > 0) return; // intermission or finale + remoteplayer_run (targ); // get out of any weapon firing states + + // Reset all Ammo types for gfx on sbar (engine code hack - sbar.c) + targ.items = targ.items - ( targ.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) ); + targ.items2 = (targ.items2 - (targ.items2 & ((IT2_LAVA_NAILS | IT2_PLASMA_AMMO) | IT2_MULTI_ROCKETS))); + + if (targ.weapon == IT_AXE) { + targ.currentammo = 0; + if (targ.moditems & IT_UPGRADE_AXE) { + targ.weaponmodel = MODEL_VWEAP_UPAXE; + } else { + targ.weaponmodel = v_axemodel; + } + + if (targ.perms & IT_CHAINSAW) { + targ.weaponmodel = "progs/drake/v_saw.mdl"; // override axes + } + } + else if (targ.weapon == IT_SHOTGUN) { + targ.currentammo = targ.ammo_shells; + if (targ.perms & IT_BLASTER) { + targ.weaponmodel = "progs/drake/v_laserb.mdl"; + } else { + if (targ.items & IT_SHOTGUN) { + targ.weaponmodel = MODEL_VWEAP_SG; + } else { + targ.weaponmodel = ""; + targ.currentammo = 0; + } + } + targ.items = targ.items | IT_SHELLS; + } + else if (targ.weapon == IT_SUPER_SHOTGUN) { + targ.currentammo = targ.ammo_shells; + if (targ.moditems & IT_UPGRADE_SSG) targ.weaponmodel = MODEL_VWEAP_UPSSG; + else targ.weaponmodel = MODEL_VWEAP_SSG; + targ.items = targ.items | IT_SHELLS; + } + else if (targ.weapon == IT_LAVA_NAILGUN) { + targ.currentammo = targ.ammo_lava_nails; + targ.weaponmodel = MODEL_VWEAP_LAVANG; + targ.items2 = targ.items2 | IT2_LAVA_NAILS; + } + else if (targ.weapon == IT_NAILGUN) { + targ.currentammo = targ.ammo_nails; + targ.weaponmodel = MODEL_VWEAP_NG; + targ.items = targ.items | IT_NAILS; + } + else if (targ.weapon == IT_LAVA_SUPER_NAILGUN) { + targ.currentammo = targ.ammo_lava_nails; + targ.weaponmodel = MODEL_VWEAP_LAVASNG; + targ.items2 = targ.items2 | IT2_LAVA_NAILS; + } + else if (targ.weapon == IT_SUPER_NAILGUN) { + targ.currentammo = targ.ammo_nails; + targ.weaponmodel = MODEL_VWEAP_SNG; + targ.items = targ.items | IT_NAILS; + } + else if (targ.weapon == IT_MULTI_GRENADE) { + targ.currentammo = targ.ammo_multi_rockets; + targ.weaponmodel = MODEL_VWEAP_MULTG; + targ.items2 = targ.items2 | IT2_MULTI_ROCKETS; + } + else if (targ.weapon == IT_GRENADE_LAUNCHER) { + targ.currentammo = targ.ammo_rockets; + targ.weaponmodel = MODEL_VWEAP_GL; + targ.items = targ.items | IT_ROCKETS; + } + else if (targ.weapon == IT2_PROXIMITY_GUN) { + targ.currentammo = targ.ammo_rockets; + targ.weaponmodel = MODEL_VWEAP_PROX; + //targ.weaponmodel = "progs/drake/v_rocks.mdl"; + targ.items = targ.items | IT_ROCKETS; + } + else if (targ.weapon == IT_MULTI_ROCKET) { + targ.currentammo = targ.ammo_multi_rockets; + targ.weaponmodel = MODEL_VWEAP_MULTR; + targ.items2 = targ.items2 | IT2_MULTI_ROCKETS; + } + else if (targ.weapon == IT_ROCKET_LAUNCHER) { + targ.currentammo = targ.ammo_rockets; + targ.weaponmodel = MODEL_VWEAP_RL; + targ.items = targ.items | IT_ROCKETS; + } + else if (targ.weapon == IT_LIGHTNING) { + targ.currentammo = targ.ammo_cells; + if (targ.moditems & IT_UPGRADE_LG) targ.weaponmodel = MODEL_VWEAP_UPLG; + else targ.weaponmodel = MODEL_VWEAP_LG; + targ.items = targ.items | IT_CELLS; + } + else if (targ.weapon == IT2_CHAINLIGHTNING) { + targ.currentammo = targ.ammo_cells; + targ.weaponmodel = "progs/drake/v_light2.mdl"; + targ.items = targ.items | IT_CELLS; + } + else if (targ.weapon == IT_PLASMA_GUN) { + targ.currentammo = targ.ammo_plasma; + targ.weaponmodel = MODEL_VWEAP_PLASM; + targ.items2 = targ.items2 | IT2_MULTI_ROCKETS; + } + else if (targ.weapon == IT2_LASER_CANNON) { + targ.currentammo = targ.ammo_cells; + //targ.weaponmodel = MODEL_VWEAP_LCAN; + targ.weaponmodel = "progs/drake/v_laserg.mdl"; + targ.items = targ.items | IT_CELLS; + } + else if (targ.weapon == IT_EXTRA_WEAPON) { + if (targ.ammo_poison > 0) { + targ.currentammo = targ.ammo_poison; + targ.weaponmodel = "progs/v_crossbow2.mdl"; + targ.items2 = targ.items2 | IT2_POISON; + } else { + targ.currentammo = targ.ammo_bolts; + targ.weaponmodel = "progs/v_crossbow1.mdl"; + targ.items2 = targ.items2 | IT2_BOLTS; + } + } + else if (targ.weapon == IT2_MJOLNIR) { + targ.currentammo = targ.ammo_cells; + targ.weaponmodel = MODEL_VWEAP_MJOL; + targ.items = targ.items | IT_CELLS; + } + else if (targ.weapon == IT2_CROSS) { + targ.weaponmodel = "progs/drake/v_wand.mdl"; + } + else if (targ.weapon == IT2_GRAPPLE) { + targ.currentammo = 0; + targ.weaponmodel = "progs/drake/v_grpple.mdl"; + if (self.hook) { + if (self.hook.count) { + self.weaponframe = 1; // Hook is still out. + } + } + } + else { + // Cinematic mode, no viewmodel + targ.currentammo = 0; + targ.weaponmodel = ""; + } + targ.weaponframe = 0; // reset weapon frame +}; + +/*====================================================================== + Return best weapon based on current ammo quantities, excludes rockets and multi-rockets for obvious heat of the moment self inflicted damage avoidance +======================================================================*/ +float(entity targ) W_BestWeapon = +{ + + if (targ.waterlevel < 1 && targ.ammo_cells > 0 && (targ.items & IT2_LASER_CANNON) ) + return IT2_LASER_CANNON; + if (targ.waterlevel < 1 && targ.ammo_cells > 0 && (targ.items2 & IT2_CHAINLIGHTNING) ) + return IT2_CHAINLIGHTNING; + if (targ.waterlevel < 1 && targ.ammo_cells > 0 && (targ.items & IT_LIGHTNING) ) + return IT_LIGHTNING; + if (targ.waterlevel < 1 && targ.ammo_cells > 0 && (targ.items & IT2_MJOLNIR) ) + return IT2_MJOLNIR; + if(targ.ammo_lava_nails > 1 && (targ.items & IT_LAVA_SUPER_NAILGUN) ) + return IT_LAVA_SUPER_NAILGUN; + if(targ.ammo_nails > 1 && (targ.items & IT_SUPER_NAILGUN) ) + return IT_SUPER_NAILGUN; + if(targ.ammo_lava_nails > 1 && (targ.items & IT_LAVA_NAILGUN) ) + return IT_LAVA_NAILGUN; + if(targ.ammo_bolts > 1 && (targ.items & IT_EXTRA_WEAPON) ) + return IT_EXTRA_WEAPON; + if(targ.ammo_shells > 2 && (targ.items & IT_SUPER_SHOTGUN) ) + return IT_SUPER_SHOTGUN; // greater than 2 in case of upgrade triple shotgun Widowmaker + if(targ.ammo_nails > 0 && (targ.items & IT_NAILGUN) ) + return IT_NAILGUN; + if(targ.ammo_shells > 0 && (targ.items & IT_SHOTGUN || targ.perms | IT_BLASTER) ) + return IT_SHOTGUN; + if (targ.waterlevel > 0 && targ.ammo_cells < 1 && (targ.items & IT2_MJOLNIR) ) + return IT2_MJOLNIR; + if (targ.items & IT_AXE) + return IT_AXE; + if (targ.items2 & IT2_CROSS) + return IT2_CROSS; // WAND + + return FALSE; +}; + +//---------------------------------------------------------------------- +float(entity targ) W_CheckNoAmmo = +{ + if (targ.currentammo > 0) return TRUE; + if (targ.weapon == IT_AXE || targ.weapon == IT2_MJOLNIR || targ.weapon == IT2_CROSS || targ.weapon == IT2_GRAPPLE) return TRUE; + + targ.weapon = W_BestWeapon (targ); + W_SetCurrentAmmo (targ); + + // drop the weapon down + return FALSE; +}; + +void() player_lava_nail1; +void() player_lava_snail1; + +/*====================================================================== +W_Attack +======================================================================*/ +void() W_Attack = { + if (intermission_running > 0) return; // intermission or finale + if ( !W_CheckNoAmmo(self) ) return; // Out of ammo? + + makevectors (self.v_angle); // calculate forward angle for velocity + + if (self.weapon != IT_EXTRA_WEAPON) + self.show_hostile = time + 1; // wake monsters up + + //---------------------------------------------------------------------- + // Axe - Mighty chopper + //---------------------------------------------------------------------- + if (self.weapon == IT_AXE) { + if (self.perms & IT_CHAINSAW) { + // Chainsaw (overrides axes once acquired) + player_saw1 (); + self.attack_finished = time + 0.55; + sound (self, CHAN_AUTO, "weapons/sawatck.wav", 1, ATTN_NORM); + } else { + // Axe and Shadowaxe + if (random() < 0.5) sound (self, CHAN_WEAPON, SOUND_AXE_SWIPE1, 1, ATTN_NORM); + else sound (self, CHAN_WEAPON, SOUND_AXE_SWIPE2, 1, ATTN_NORM); + // Work out which axe swing to play (never play swing twice in a row) + self.lip = self.meleeattack; + while (self.meleeattack == self.lip) { + self.lip = rint(random()*4.4); + } + self.meleeattack = self.lip; + if (v_axemodel == "progs/ad171/v_shadaxe0.mdl") { + if (self.meleeattack == 0) player_axe1(); + else if (self.meleeattack == 1) player_axeb1(); + else if (self.meleeattack == 2) player_axec1(); + else if (self.meleeattack == 3) player_axed1(); + else player_axee1(); + } else { + if (self.meleeattack == 0) player_axeold1(); + else if (self.meleeattack == 1) player_axeoldb1(); + else if (self.meleeattack == 2) player_axeoldc1(); + else player_axeoldd1(); + } + self.attack_finished = time + 0.5; + } + } + //---------------------------------------------------------------------- + else if (self.weapon == IT_SHOTGUN) { + if (self.perms & IT_BLASTER) { + player_blast1(); // use laser blaster only once we have it, still uses shells + } else { + player_sg1(); // use standard single barrel shotgun + } + } + else if (self.weapon == IT_SUPER_SHOTGUN) player_supersg1(); + else if (self.weapon == IT_NAILGUN) player_nail1(); + else if (self.weapon == IT_LAVA_NAILGUN) { player_lava_nail1(); self.lavaGunFired = TRUE; } + else if (self.weapon == IT_SUPER_NAILGUN) player_snail1(); + else if (self.weapon == IT_LAVA_SUPER_NAILGUN) {player_lava_snail1(); self.lavaGunFired = TRUE; } + else if (self.weapon == IT_MULTI_GRENADE) player_multi_grenade1(); + else if (self.weapon == IT_GRENADE_LAUNCHER) player_grenade1(); + else if (self.weapon == IT_MULTI_ROCKET) player_multi_rocket1(); + else if (self.weapon == IT_ROCKET_LAUNCHER) player_rocket1(); + else if (self.weapon == IT_PLASMA_GUN) player_plasmalight1(); + else if (self.weapon == IT_LIGHTNING) { + if (self.moditems & IT_UPGRADE_LG) player_plasma1(); + else { + player_light1(); + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + } + } + else if (self.weapon == IT_EXTRA_WEAPON) player_crossbow1(); + else if (self.weapon == IT2_LASER_CANNON) player_laser1(); + else if (self.weapon == IT2_MJOLNIR) { + if (self.ammo_cells < 30) { + self.attack_finished = time + 0.4; + player_hammer1(); + } else { + self.attack_finished = time + 0.4; + player_mjolnir1(); + } + } + else if (self.weapon == IT2_GRAPPLE) { + if (self.hook) { + // Assume hook was improperly removed, so reset links. + if (!self.hook.modelindex) { + self.hook = world; // So W_FireGrapple fires a hook. + player_grapple1 (); + return; + } + if (self.hook.count) + return; + player_grapple3 (); + } + else + player_grapple1 (); + // Modified animation takes three frames to complete. + self.attack_finished = time + 0.3; + } + else if (self.weapon == IT2_PROXIMITY_GUN) { + player_prox_grenade1(); + /* player_rocket1(); + if (self.tome_finished) + { W_FireHydra(); + W_Reload (1.5); + } + else + { W_FireSidewinder(); + W_Reload (1); + } + */ + } + else if (self.weapon == IT2_CHAINLIGHTNING) { + // Quake cannot draw very many bolts, so rapid-fire like + // normal Thunderbolt is a bad idea. + // Update 11/20/09: Use DoE plasma code with fewer bolts. + // We may be able to stay under limits (24 bolts). + //if (self.tome_finished) { TODO: Uncomment this if statement once I figure out if tome_finished is a viable powerup from Drake? + // player_snake1 (); + // W_FireDeathRay (); + // W_Reload (0.4); + //} else { + player_chainlight1(); + self.attack_finished = time + 0.1; + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + //} + } + else if (self.weapon == IT2_CROSS) { + player_wand1(); + W_FireSparks(); + } +}; + +float (entity targ, float testValue) InItems = { + if ( (targ.items & testValue) ) + return ( TRUE ); + + return ( FALSE ); +}; + +float (entity targ, float testValue) InItems2 = { + if ( (targ.items2 & testValue) ) + return ( TRUE ); + + return ( FALSE ); +}; + +float (entity targ, float testValue) InModItems = { + if ( (targ.moditems & testValue) ) + return ( TRUE ); + + return ( FALSE ); +}; + +/*====================================================================== + W_ChangeWeapon + Check if got weapon and ammo and switch to relevant weapon +======================================================================*/ +void(entity targ) W_ChangeWeapon = { + local float it, it2, am, fl; + local float gotgun; + local float gotprox; + local float gotgren; + local float gotmultgren; + + if (intermission_running > 0) return; // intermission or finale + it = targ.items; + it2 = targ.items2; + am = FALSE; + + gotprox = InItems2(targ, IT2_PROXIMITY_GUN); + gotgren = InItems(targ, IT_GRENADE_LAUNCHER); + gotmultgren = InItems(targ, IT_MULTI_GRENADE); + gotgun = FALSE; + if (targ.impulse == 1) { + if ((targ.items2 & IT2_GRAPPLE) && (targ.weapon == IT_AXE)) { + fl = IT2_GRAPPLE; + gotgun = InItems2(targ, fl); + } else { + fl = IT_AXE; + gotgun = InItems(targ, IT_AXE); + if (InModItems(targ, IT_UPGRADE_AXE)) gotgun = TRUE; + if (self.perms & IT_CHAINSAW) gotgun = TRUE; + } + + if ( !(targ.items & IT_AXE)) { + fl = IT2_GRAPPLE; + gotgun = InItems2(targ, fl); + } + } + else if (targ.impulse == 2) { + fl = IT_SHOTGUN; + if (targ.ammo_shells < 1) am = TRUE; + gotgun = InItems(targ, IT_SHOTGUN); + } + else if (targ.impulse == 3) { + fl = IT_SUPER_SHOTGUN; + if (targ.ammo_shells < 2) am = TRUE; + gotgun = InItems(targ, IT_SUPER_SHOTGUN); + if (InModItems(targ, IT_UPGRADE_SSG)) gotgun = TRUE; + } + else if (targ.impulse == 4) { + if ((targ.items & IT_LAVA_NAILGUN) &&(targ.weapon == IT_NAILGUN) || (targ.ammo_nails < 1)) { + fl = IT_LAVA_NAILGUN; + if (targ.ammo_lava_nails < 1) am = TRUE; + gotgun = InItems(targ, fl); + } else { + fl = IT_NAILGUN; + if (targ.ammo_nails < 1) am = TRUE; + gotgun = InItems(targ, fl); + } + } + else if (targ.impulse == 5) { + if ((targ.items & IT_LAVA_SUPER_NAILGUN) && (targ.weapon == IT_SUPER_NAILGUN) || (targ.ammo_nails < 2)) { + fl = IT_LAVA_SUPER_NAILGUN; + if (targ.ammo_lava_nails < 2) am = TRUE; + gotgun = InItems(targ, fl); + } else { + fl = IT_SUPER_NAILGUN; + if (targ.ammo_nails < 2) am = TRUE; + gotgun = InItems(targ, fl); + } + } + else if (targ.impulse == 6) { + if (targ.weapon == IT_GRENADE_LAUNCHER) { + if (gotmultgren) { + fl = IT_MULTI_GRENADE; + gotgun = TRUE; + } else { + fl = IT2_PROXIMITY_GUN; + gotgun = InItems2(targ, fl); + } + } else { + if (targ.weapon == IT_MULTI_GRENADE) { + if (gotprox) { + fl = IT2_PROXIMITY_GUN; + gotgun = TRUE; + } else { + fl = IT_GRENADE_LAUNCHER; + gotgun = InItems(targ, fl); + } + } else { + if (targ.weapon == IT2_PROXIMITY_GUN) { + if (gotgren) { + fl = IT_GRENADE_LAUNCHER; + gotgun = TRUE; + } else { + fl = IT_MULTI_GRENADE; + gotgun = InItems(targ, fl); + } + } else { + if (gotgren) { + fl = IT_GRENADE_LAUNCHER; + gotgun = TRUE; + } else { + if (gotmultgren) { + fl = IT_MULTI_GRENADE; + gotgun = TRUE; + } else { + if (gotprox) { + fl = IT2_PROXIMITY_GUN; + gotgun = TRUE; + } + } + } + } + } + } + if (fl == IT_MULTI_GRENADE) { + if (targ.ammo_multi_rockets < 1) am = TRUE; + } else { + if (targ.ammo_rockets < 1) am = TRUE; + } + } + else if (targ.impulse == 7) { + if ((targ.items & IT_MULTI_ROCKET) && (targ.weapon == IT_ROCKET_LAUNCHER) || (targ.ammo_rockets < 1)) { + fl = IT_MULTI_ROCKET; + if (targ.ammo_multi_rockets < 1) am = TRUE; + gotgun = InItems(targ, fl); + } else { + fl = IT_ROCKET_LAUNCHER; + if (targ.ammo_rockets < 1) am = TRUE; + gotgun = InItems(targ, fl); + } + } + else if (targ.impulse == 8) { + if ((targ.items & IT_PLASMA_GUN) && (targ.weapon == IT_LIGHTNING) || (targ.ammo_cells < 1)) { + fl = IT_PLASMA_GUN; + if (targ.ammo_plasma < 1) am = TRUE; + gotgun = InItems(targ, fl); + } else { + fl = IT_LIGHTNING; + if (targ.ammo_cells < 1) am = TRUE; + gotgun = InItems(targ, fl); + if (InModItems(targ, IT_UPGRADE_LG)) gotgun = TRUE; + } + } + else if (targ.impulse == 9) { + if ((targ.items & IT_EXTRA_WEAPON) && (targ.weapon == IT2_LASER_CANNON) || (targ.ammo_cells < 1)) { + fl = IT_EXTRA_WEAPON; + if (targ.ammo_bolts < 1) am = TRUE; + gotgun = InItems(targ, fl); + } else { + fl = IT2_LASER_CANNON; + if (targ.ammo_cells < 1) am = TRUE; + gotgun = InItems2(targ, fl); + } + } + else if (targ.impulse == 60) { + fl = IT_LAVA_NAILGUN; + if (targ.ammo_lava_nails < 1) am = TRUE; + gotgun = InItems(targ, fl); + } + else if (targ.impulse == 61) { + fl = IT_LAVA_SUPER_NAILGUN; + if (targ.ammo_lava_nails < 2) am = TRUE; + gotgun = InItems(targ, fl); + } + else if (targ.impulse == 62) { + fl = IT_MULTI_GRENADE; + if (targ.ammo_multi_rockets < 1) am = TRUE; + gotgun = InItems(targ, fl); + } + else if (targ.impulse == 63) { + fl = IT_MULTI_ROCKET; + if (targ.ammo_multi_rockets < 1) am = TRUE; + gotgun = InItems(targ, fl); + } + else if (targ.impulse == 64) { + fl = IT_PLASMA_GUN; + if (targ.ammo_plasma < 1) am = TRUE; + gotgun = InItems(targ, fl); + } + else if (targ.impulse == 175) { + fl = IT2_LASER_CANNON; + if (targ.ammo_cells < 1) am = TRUE; + gotgun = InItems2(targ, fl); + } + else if (targ.impulse == 176) { + fl = IT2_PROXIMITY_GUN; + gotgun = InItems2(targ, fl); + } + else if (targ.impulse == 177) { + if ((targ.items & IT_EXTRA_WEAPON) && (targ.weapon == IT2_LASER_CANNON) || (targ.ammo_cells < 1)) { + fl = IT_EXTRA_WEAPON; + if (targ.ammo_bolts < 1) am = TRUE; + gotgun = InItems(targ, fl); + } else { + fl = IT2_LASER_CANNON; + if (targ.ammo_cells < 1) am = TRUE; + gotgun = InItems2(targ, fl); + } + + if ((targ.items2 & IT2_CROSS) && ((targ.weapon == IT2_MJOLNIR) || !InItems(targ,IT2_MJOLNIR))) { + fl = IT2_CROSS; + gotgun = InItems2(targ, fl); + } else { + fl = IT2_MJOLNIR; + gotgun = InItems2(targ, fl); + } + } + else if (targ.impulse == 178) { + fl = IT_EXTRA_WEAPON; + gotgun = InItems(targ, fl); + } + else if (targ.impulse == 179) { + fl = IT2_CROSS; + gotgun = InItems2(targ, fl); + } + else if (targ.impulse == 180) { + fl = IT2_GRAPPLE; + gotgun = InItems2(targ, fl); + } + else if (targ.impulse == 181) { + fl = IT2_CHAINLIGHTNING; + gotgun = InItems2(targ, fl); + } + targ.impulse = 0; // Clear impulse + + //---------------------------------------------------------------------- + // FL = don't have the weapon + // AM = out of ammo + //---------------------------------------------------------------------- + //Do we have this weapon? + if ( !(gotgun) ) { + sprint (targ,"no weapon.\n"); + return ; + } + + //Do we have ammo? + if ( am ) { + sprint (targ,"not enough ammo.\n"); + return ; + } + + if ( (targ.weapon != fl) ) { + if ( ((targ.weapon == IT_LAVA_NAILGUN) || (targ.weapon == IT_LAVA_SUPER_NAILGUN)) ) { + if ( ((fl == IT_NAILGUN) || (fl == IT_SUPER_NAILGUN)) ) { + sprint (targ,"Normal Nails\n"); + } + } else { + if ( (targ.weapon == IT_MULTI_GRENADE) ) { + if ( (fl == IT_GRENADE_LAUNCHER) ) { + sprint (targ,"Normal Grenades\n"); + } + } else { + if ( (targ.weapon == IT_MULTI_ROCKET) ) { + if ( (fl == IT_ROCKET_LAUNCHER) ) { + sprint (targ,"Normal Rockets\n"); + } + } else { + if ( (targ.weapon == IT_PLASMA_GUN) ) { + if ( (fl == IT_LIGHTNING) ) { + if (targ.moditems & IT_UPGRADE_LG) { + sprint (targ,"Plasma Gun\n"); + } else { + sprint (targ,"Lightning Gun\n"); + } + } + } else { + if ( ((fl == IT_LAVA_NAILGUN) || (fl == IT_LAVA_SUPER_NAILGUN)) ) { + sprint (targ,"Lava Nails!\n"); + } else { + if ( (fl == IT_MULTI_GRENADE) ) { + sprint (targ,"Multi-Grenades!\n"); + } else { + if ( (fl == IT_MULTI_ROCKET) ) { + sprint (targ,"Multi-Rockets!\n"); + } else { + if ( (fl == IT_PLASMA_GUN) ) { + sprint (targ,"Plasma Gun!\n"); + } else { + if ( (fl == IT2_PROXIMITY_GUN) ) { + sprint (targ,"Proximity Grenades!\n"); + } else { + if ( (fl == IT2_LASER_CANNON) ) { + sprint (targ,"Laser Cannon!\n"); + } else { + if ( (fl == IT2_CROSS) ) { + sprint (targ,"Magic Wand!\n"); + } else { + if ( (fl == IT2_MJOLNIR) ) { + sprint (targ,"Mjolnir's Hammer!\n"); + } + } + } + } + } + } + } + } + } + } + } + } + } + targ.weapon = fl; + W_SetCurrentAmmo (targ); +}; + +/*====================================================================== +CycleWeaponCommand +======================================================================*/ +void() CycleWeaponCommand = +{ + local float am; + + if (intermission_running > 0) return; // intermission or finale + self.impulse = 0; // reset impulse + + if (self.weapon == 0 && self.items == 0) return; + + // Keep cycling around weapon list until found a weapon with ammo + while (1) { + am = 0; + if (self.weapon == IT2_MJOLNIR) { + self.weapon = IT2_CHAINLIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == IT2_CHAINLIGHTNING) { + self.weapon = IT_AXE; + } + else if (self.weapon == IT_AXE) { + self.weapon = IT_SHOTGUN; + if (self.ammo_shells < 1) am = 1; + } + else if (self.weapon == IT_SHOTGUN) { + self.weapon = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) am = 1; + } + else if (self.weapon == IT_SUPER_SHOTGUN) { + self.weapon = IT_NAILGUN; + if (self.ammo_nails < 1) am = 1; + } + else if (self.weapon == IT_NAILGUN) { + self.weapon = IT_LAVA_NAILGUN; + if (self.ammo_lava_nails < 2) am = 1; + } + else if (self.weapon == IT_LAVA_NAILGUN) { + self.weapon = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) am = 1; + } + else if (self.weapon == IT_SUPER_NAILGUN) { + self.weapon = IT_LAVA_SUPER_NAILGUN; + if (self.ammo_lava_nails < 2) am = 1; + } + else if (self.weapon == IT_LAVA_SUPER_NAILGUN) { + self.weapon = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_GRENADE_LAUNCHER) { + self.weapon = IT2_PROXIMITY_GUN; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT2_PROXIMITY_GUN) { + self.weapon = IT_MULTI_GRENADE; + if (self.ammo_multi_rockets < 1) am = 1; + } + else if (self.weapon == IT_MULTI_GRENADE) { + self.weapon = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_ROCKET_LAUNCHER) { + self.weapon = IT_MULTI_ROCKET; + if (self.ammo_multi_rockets < 1) am = 1; + } + else if (self.weapon == IT_MULTI_ROCKET) { + self.weapon = IT_LIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == IT_LIGHTNING) { + self.weapon = IT_PLASMA_GUN; + if (self.ammo_plasma < 1) am = 1; + } + else if (self.weapon == IT_PLASMA_GUN) { + self.weapon = IT2_LASER_CANNON; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == IT2_LASER_CANNON) { + self.weapon = IT_EXTRA_WEAPON; + if (self.ammo_bolts < 1) am = 1; + } + else if (self.weapon == IT_EXTRA_WEAPON) { + self.weapon = IT2_CROSS; + } + else if (self.weapon == IT2_CROSS) { + self.weapon = IT2_MJOLNIR; + } + else if (self.weapon == IT2_MJOLNIR) { + self.weapon = IT2_CHAINLIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == FALSE || self.items == 0) { + return; // prevent crash in "cinematic mode" + } + + // Has the player got the weapons and ammo to switch? + if (self.weapon == IT2_MJOLNIR || self.weapon == IT2_LASER_CANNON || self.weapon == IT2_PROXIMITY_GUN || self.weapon == IT2_CROSS || self.weapon == IT2_CHAINLIGHTNING) { + if (self.weapon == IT2_CROSS) { + if ( (self.items2 & IT2_CROSS) && !am) { + W_SetCurrentAmmo (self); + return; + } + } else { + if ( (self.items2 & self.weapon) && !am) { + W_SetCurrentAmmo (self); + return; + } + } + } else { + if ( (self.items & self.weapon) && !am) { + W_SetCurrentAmmo (self); + return; + } + } + } +}; + +/*====================================================================== +CycleWeaponReverseCommand +======================================================================*/ +void() CycleWeaponReverseCommand = +{ + local float am; + + if (intermission_running > 0) return; // intermission or finale + self.impulse = 0; // reset impulse + + if (self.weapon == 0 && self.items == 0) return; + + // Keep cycling around weapon list until found a weapon with ammo + while (1) { + am = 0; + if (self.weapon == IT2_MJOLNIR) { + self.weapon = IT2_CROSS; + } + else if (self.weapon == IT2_CROSS) { + self.weapon = IT_EXTRA_WEAPON; + if (self.ammo_bolts < 1) am = 1; + } + else if (self.weapon == IT_EXTRA_WEAPON) { + self.weapon = IT2_LASER_CANNON; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == IT2_LASER_CANNON) { + self.weapon = IT_PLASMA_GUN; + if (self.ammo_plasma < 1) am = 1; + } + else if (self.weapon == IT_PLASMA_GUN) { + self.weapon = IT_LIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == IT_LIGHTNING) { + self.weapon = IT_MULTI_ROCKET; + if (self.ammo_multi_rockets < 1) am = 1; + } + else if (self.weapon == IT_MULTI_ROCKET) { + self.weapon = IT_ROCKET_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_ROCKET_LAUNCHER) { + self.weapon = IT_MULTI_GRENADE; + if (self.ammo_multi_rockets < 1) am = 1; + } + else if (self.weapon == IT_MULTI_GRENADE) { + self.weapon = IT2_PROXIMITY_GUN; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT2_PROXIMITY_GUN) { + self.weapon = IT_GRENADE_LAUNCHER; + if (self.ammo_rockets < 1) am = 1; + } + else if (self.weapon == IT_GRENADE_LAUNCHER) { + self.weapon = IT_LAVA_SUPER_NAILGUN; + if (self.ammo_lava_nails < 2) am = 1; + } + else if (self.weapon == IT_LAVA_SUPER_NAILGUN) { + self.weapon = IT_SUPER_NAILGUN; + if (self.ammo_nails < 2) am = 1; + } + else if (self.weapon == IT_SUPER_NAILGUN) { + self.weapon = IT_LAVA_NAILGUN; + if (self.ammo_lava_nails < 1) am = 1; + } + else if (self.weapon == IT_LAVA_NAILGUN) { + self.weapon = IT_NAILGUN; + if (self.ammo_nails < 1) am = 1; + } + else if (self.weapon == IT_NAILGUN) { + self.weapon = IT_SUPER_SHOTGUN; + if (self.ammo_shells < 2) am = 1; + } + else if (self.weapon == IT_SUPER_SHOTGUN) { + self.weapon = IT_SHOTGUN; + if (self.ammo_shells < 1) am = 1; + } + else if (self.weapon == IT_SHOTGUN) { + self.weapon = IT_AXE; + } + else if (self.weapon == IT_AXE) { + self.weapon = IT2_CHAINLIGHTNING; + if (self.ammo_cells < 1) am = 1; + } + else if (self.weapon == IT2_CHAINLIGHTNING) { + self.weapon = IT2_MJOLNIR; + } else if (self.weapon == FALSE || self.items == 0) { + return; // prevent crash in "cinematic mode" + } + + // Has the player got the weapons and ammo to switch? + if (self.weapon == IT2_MJOLNIR || self.weapon == IT2_LASER_CANNON || self.weapon == IT2_PROXIMITY_GUN || self.weapon == IT2_CROSS || self.weapon == IT2_CHAINLIGHTNING) { + if (self.weapon == IT2_CROSS) { + if ( (self.items2 & IT2_CROSS) && !am) { + W_SetCurrentAmmo (self); + return; + } + } else { + if ( (self.items2 & self.weapon) && !am) { + W_SetCurrentAmmo (self); + return; + } + } + } else { + if ( (self.items & self.weapon) && !am) { + W_SetCurrentAmmo (self); + return; + } + } + } +}; + +/*====================================================================== +W_WeaponFrame +======================================================================*/ +void() W_WeaponFrame = { + if (self.lavaGunFired) { + if (self.weapon == IT_LAVA_NAILGUN || self.weapon == IT_LAVA_SUPER_NAILGUN) { + sound (self, CHAN_BODY, "lavagun/snail.wav", 1, ATTN_NORM); + } + self.lavaGunFired = 0; + } + + ImpulseCommands (); + // Allow for impulse commands before weapon lockout + if (time < self.attack_finished) return; + + // Change crossbow skin if bolts are poisoned + if (self.ammo_poison > 0) { + W_SetCurrentAmmo (self); + } + + // check for attack + if (self.button0) { + // originally - SuperDamageSound + // Only play one powerup sound at once + if (self.super_damage_finished > 0 && self.powerup_sound < time) { + if (self.super_sound < time) { + self.super_sound = time + 1; + self.powerup_sound = time + 1; + sound (self, CHAN_BODY, SOUND_ARTQUAD3, 1, ATTN_NORM); + } + } + // Only play one powerup sound at once + if (self.sharpshoot_finished > 0 && self.powerup_sound < time) { + // Only works with the shotguns + if (self.weapon == IT_SHOTGUN || self.weapon == IT_SUPER_SHOTGUN) { + if (self.sharpshooter_sound < time) { + self.sharpshooter_sound = time + 0.5; + // Only play the sound every other shot + self.powerup_sound = time + 1; + sound (self, CHAN_BODY, SOUND_ARTSHARP3, 1, ATTN_NORM); + } + } + } + // Only play one powerup sound at once + if (self.nailpiercer_finished > 0 && self.powerup_sound < time) { + // Only works with nailgun + super nailgun + if (self.weapon == IT_NAILGUN || self.weapon == IT_SUPER_NAILGUN) { + if (self.nailpiercer_sound < time) { + self.nailpiercer_sound = time + 0.5; + self.powerup_sound = time + 1; + sound (self, CHAN_BODY, SOUND_ARTNAILP3, 1, ATTN_NORM); + } + } + } + // Check for weapon updates + W_Attack (); + } +}; diff --git a/QC_other/QC_keep/win64-fteqccgui.exe b/QC_other/QC_keep/win64-fteqccgui.exe new file mode 100644 index 00000000..e50622c3 Binary files /dev/null and b/QC_other/QC_keep/win64-fteqccgui.exe differ diff --git a/QC_other/QC_keep/world.qc b/QC_other/QC_keep/world.qc new file mode 100644 index 00000000..07e4606c --- /dev/null +++ b/QC_other/QC_keep/world.qc @@ -0,0 +1,867 @@ +/*====================================================================== + GLOBAL STUFF +======================================================================*/ +entity lastspawn; // client.qc (SelectSpawnPoint) +entity () ammohealthsum; +void() InitBodyQue; +//---------------------------------------------------------------------- +void() main = +{ + dprint ("\b[MAIN]\bfunction started ...\n"); + + //---------------------------------------------------------------------- + // these are just commands to the prog compiler to copy these files + //---------------------------------------------------------------------- + precache_file ("progs.dat"); + precache_file ("gfx.wad"); + precache_file ("quake.rc"); + precache_file ("default.cfg"); + + precache_file ("end1.bin"); + precache_file2 ("end2.bin"); + + //precache_file ("demo1.dem"); + //precache_file ("demo2.dem"); + //precache_file ("demo3.dem"); + + //---------------------------------------------------------------------- + // these are all of the lumps from the cached.ls files + //---------------------------------------------------------------------- + precache_file ("gfx/palette.lmp"); + precache_file ("gfx/colormap.lmp"); + + precache_file2 ("gfx/pop.lmp"); + + precache_file ("gfx/complete.lmp"); + precache_file ("gfx/inter.lmp"); + + precache_file ("gfx/ranking.lmp"); + precache_file ("gfx/vidmodes.lmp"); + precache_file ("gfx/finale.lmp"); + precache_file ("gfx/conback.lmp"); + precache_file ("gfx/qplaque.lmp"); + + precache_file ("gfx/menudot1.lmp"); + precache_file ("gfx/menudot2.lmp"); + precache_file ("gfx/menudot3.lmp"); + precache_file ("gfx/menudot4.lmp"); + precache_file ("gfx/menudot5.lmp"); + precache_file ("gfx/menudot6.lmp"); + + precache_file ("gfx/menuplyr.lmp"); + precache_file ("gfx/bigbox.lmp"); + precache_file ("gfx/dim_modm.lmp"); + precache_file ("gfx/dim_drct.lmp"); + precache_file ("gfx/dim_ipx.lmp"); + precache_file ("gfx/dim_tcp.lmp"); + precache_file ("gfx/dim_mult.lmp"); + precache_file ("gfx/mainmenu.lmp"); + + precache_file ("gfx/box_tl.lmp"); + precache_file ("gfx/box_tm.lmp"); + precache_file ("gfx/box_tr.lmp"); + + precache_file ("gfx/box_ml.lmp"); + precache_file ("gfx/box_mm.lmp"); + precache_file ("gfx/box_mm2.lmp"); + precache_file ("gfx/box_mr.lmp"); + + precache_file ("gfx/box_bl.lmp"); + precache_file ("gfx/box_bm.lmp"); + precache_file ("gfx/box_br.lmp"); + + precache_file ("gfx/sp_menu.lmp"); + precache_file ("gfx/ttl_sgl.lmp"); + precache_file ("gfx/ttl_main.lmp"); + precache_file ("gfx/ttl_cstm.lmp"); + + precache_file ("gfx/mp_menu.lmp"); + + precache_file ("gfx/netmen1.lmp"); + precache_file ("gfx/netmen2.lmp"); + precache_file ("gfx/netmen3.lmp"); + precache_file ("gfx/netmen4.lmp"); + precache_file ("gfx/netmen5.lmp"); + + precache_file ("gfx/sell.lmp"); + + precache_file ("gfx/help0.lmp"); + precache_file ("gfx/help1.lmp"); + precache_file ("gfx/help2.lmp"); + precache_file ("gfx/help3.lmp"); + precache_file ("gfx/help4.lmp"); + precache_file ("gfx/help5.lmp"); + + precache_file ("gfx/pause.lmp"); + precache_file ("gfx/loading.lmp"); + + precache_file ("gfx/p_option.lmp"); + precache_file ("gfx/p_load.lmp"); + precache_file ("gfx/p_save.lmp"); + precache_file ("gfx/p_multi.lmp"); + + //---------------------------------------------------------------------- + // sounds loaded by C code + //---------------------------------------------------------------------- + precache_sound ("misc/menu1.wav"); + precache_sound ("misc/menu2.wav"); + precache_sound ("misc/menu3.wav"); + + precache_sound ("ambience/water1.wav"); + precache_sound ("ambience/wind2.wav"); + + //---------------------------------------------------------------------- + // shareware + //---------------------------------------------------------------------- + precache_file ("maps/start.bsp"); + + precache_file ("maps/e1m1.bsp"); + precache_file ("maps/e1m2.bsp"); + precache_file ("maps/e1m3.bsp"); + precache_file ("maps/e1m4.bsp"); + precache_file ("maps/e1m5.bsp"); + precache_file ("maps/e1m6.bsp"); + precache_file ("maps/e1m7.bsp"); + precache_file ("maps/e1m8.bsp"); + + //---------------------------------------------------------------------- + // registered. Full version of Quake is required to play this mod. + //---------------------------------------------------------------------- + precache_file2 ("gfx/pop.lmp"); + + precache_file2 ("maps/e2m1.bsp"); + precache_file2 ("maps/e2m2.bsp"); + precache_file2 ("maps/e2m3.bsp"); + precache_file2 ("maps/e2m4.bsp"); + precache_file2 ("maps/e2m5.bsp"); + precache_file2 ("maps/e2m6.bsp"); + precache_file2 ("maps/e2m7.bsp"); + + precache_file2 ("maps/e3m1.bsp"); + precache_file2 ("maps/e3m2.bsp"); + precache_file2 ("maps/e3m3.bsp"); + precache_file2 ("maps/e3m4.bsp"); + precache_file2 ("maps/e3m5.bsp"); + precache_file2 ("maps/e3m6.bsp"); + precache_file2 ("maps/e3m7.bsp"); + + precache_file2 ("maps/e4m1.bsp"); + precache_file2 ("maps/e4m2.bsp"); + precache_file2 ("maps/e4m3.bsp"); + precache_file2 ("maps/e4m4.bsp"); + precache_file2 ("maps/e4m5.bsp"); + precache_file2 ("maps/e4m6.bsp"); + precache_file2 ("maps/e4m7.bsp"); + precache_file2 ("maps/e4m8.bsp"); + + precache_file2 ("maps/end.bsp"); + + precache_file2 ("maps/dm1.bsp"); + precache_file2 ("maps/dm2.bsp"); + precache_file2 ("maps/dm3.bsp"); + precache_file2 ("maps/dm4.bsp"); + precache_file2 ("maps/dm5.bsp"); + precache_file2 ("maps/dm6.bsp"); +}; + +/*====================================================================== +/*QUAKED worldspawn (0 0 0) ? x +Only used for the world. +-------- KEYS -------- +worldtype : World type 0 = medieval, 1 = metal, 2 = base +wad : list of Wad Files used by compiler (; for seperation) +message : Title of map +sounds : CD Music track to play (4-11) + +light : Ambient light level (eg 5) +sky : 6 sided cube for sky brushes (night_) +_range : Scales brightness range of all lights (useful for dirt) + +_sunlight : Brightness of SUN (eg 100) +_sunlight_color : Red/Green/Blue (0.78 0.86 1.00) +_sunlight_mangle : Angle of sunlight (eg 0 -90 0) +_sunlight_penumbra : Penumbra width, in degrees, of sunlight +_sunlight_dirt : 1 = enables dirt mapping on sun + +// Ambient bounce light (multiple suns in a dome) +_sunlight2 : Second SUN (eg 100) +_sunlight2_color : Red/Green/Blue (0.78 0.86 1.00) +_sunlight2_dirt : 1 = enables dirt mapping on sun 2 + +_dirt : 1 = enables dirtmapping (ambient occlusion) on all lights +_dirtmode : Choose between ordered (def=0) and randomized (1) +_dirtscale : Scale factor used in dirt calculations, def=1 +_dirtgain : Exponent used in dirt calculation, def=1 +_dirtdepth : Maximum depth of occlusion checking, def=128 + +gravity : gravity of map (default = 800) +fog : console command (Den/R/G/B - '0.05 0.3 0.3 0.3') +fog_density : Global fog density (works with trigger_fog) +fog_colour : Global fog colour (XYZ = RGB) +fog_dpextra : extra DP fog parameters, default - '1 0 8192 1024 32' +water_alpha : Water Alpha, default - 1.00 +particlemax : Amount of ACTIVE particles per map + +no_item_offset : All ammo/heal items use central point rotation +no_item_rotate : No random rotated for all items +no_zaware : Switch OFF zaware monster attacks +no_sgprojectile : Switches OFF ALL shotgun projectiles +no_sgcasing : Switches OFF ALL shotgun casings +no_liquiddmg : Switch OFF liquid (slime/lava) monster damage +no_surfacecheck : Switch OFF Darkplaces style particles, useful for large maps +knight_defskin : Default skin (0-3) type for new knight model +bodyflrcheck : All monster dead body check floor for gravity +bodyfadeaway : All monster dead bodies fade away +sprite_particles: Switch all custom particles to sprites (builtin excluded) + +upgrade_axe : Upgrade Axe -1=disable, 1=enable +upgrade_ssg : Upgrade Super Shotgun -1=disable, 1=enable +upgrade_lg : Upgrade Lightning Gun -1=disable, 1=enable + +give_weapons : Bit flag for which weapons to give to the player +take_weapons : 1=SG, 2=SSG, 4=NG, 8=SNG, 16=GL, 32=RL, 64=LG (excludes Axe) +max_health : Update player health if below this value +currentammo : =1 reset inventory, =0 minimum values +ammo_shells : Setup starting shell quanity (reset/minimum) +ammo_nails : Setup starting nails quanity (reset/minimum) +ammo_rockets : Setup starting rockets quanity (reset/minimum) +ammo_cells : Setup starting cells quanity (reset/minimum) +armortype : Armour type to start with 1=Green, 2=Yellow, 3=Red +armorvalue : Quantity of armour to reset player (100/150/200) + +======================================================================*/ +void() worldspawn = +{ + lastspawn = world; + InitBodyQue (); + InitTempGoal (); + InitMoveBox (); + developer = cvar("developer"); + self.classtype = CT_WORLD; + + //---------------------------------------------------------------------- + // these sounds MUST be the first precache_sounds + //---------------------------------------------------------------------- + precache_sound ("weapons/r_exp3.wav"); // Hardcoded Explosion (null) + precache_sound ("weapons/rocket1i.wav"); // spike gun + precache_sound ("weapons/sgun1.wav"); // Rocket launcher!?! + // precache_sound ("weapons/guncock.wav"); // player shotgun (not used anymore) + precache_sound ("weapons/sg1.wav"); // Original SG (reduced hiss/noise) + precache_sound ("weapons/sg2.wav"); // New SG (with shell casing) + precache_sound ("weapons/ric1.wav"); // ricochet (used in c code) + precache_sound ("weapons/ric2.wav"); // ricochet (used in c code) + precache_sound ("weapons/ric3.wav"); // ricochet (used in c code) + precache_sound ("weapons/spike2.wav"); // super spikes + precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code) + precache_sound ("weapons/grenade.wav"); // grenade launcher + precache_sound ("weapons/gl_loadshort.wav");// MONSTER grenade launcher + precache_sound ("weapons/bounce.wav"); // grenade bounce + // precache_sound ("weapons/shotgn2.wav"); // super shotgun (not used anymore) + precache_sound ("weapons/ssg1.wav"); // Original SSG (reduced hiss/noise) + precache_sound ("weapons/ssg2.wav"); // Projectile shells or Shotgun upgrade + precache_sound (SOUND_PLASMA_FIRE); // Player PG (eliminator) + precache_sound (SOUND_PLASMA_HIT); // New fire/impact sounds + precache_sound ("weapons/nofire.wav"); // Weapon jams/noammo/broken + + //---------------------------------------------------------------------- + precache_sound (SOUND_REXP3); // Original explosion + precache_sound (SOUND_RESIST_ROCKET); // Resist Rockets + + //---------------------------------------------------------------------- + // sounds used from C physics code + precache_sound ("demon/dland2.wav"); // landing thud + precache_sound ("misc/h2ohit1.wav"); // landing splash + + //---------------------------------------------------------------------- + // Always precaches player sounds + precache_sound (SOUND_RESPAWN); // item respawn sound + precache_sound ("player/plyrjmp8.wav"); // player jump + precache_sound ("player/land.wav"); // player landing + precache_sound ("player/land2.wav"); // player hurt landing + precache_sound ("player/drown1.wav"); // drowning pain + precache_sound ("player/drown2.wav"); // drowning pain + precache_sound ("player/gasp1.wav"); // gasping for air + precache_sound ("player/gasp2.wav"); // taking breath + precache_sound ("player/h2odeath.wav"); // drowning death + + precache_sound (SOUND_EMPTY); // Empty sound + precache_sound (SOUND_TALK); // talk message/trigger + precache_sound ("player/teledth1.wav"); // telefrag + precache_sound ("misc/r_tele1.wav"); // teleport sounds + precache_sound ("misc/r_tele2.wav"); + precache_sound ("misc/r_tele3.wav"); + precache_sound ("misc/r_tele4.wav"); + precache_sound ("misc/r_tele5.wav"); + precache_sound ("weapons/lock4.wav"); // ammo pick up + precache_sound ("weapons/pkup.wav"); // weapon up + precache_sound ("items/armor1.wav"); // armor up + precache_sound ("weapons/lhit.wav"); // lightning + precache_sound ("weapons/lstart.wav"); // lightning start + precache_sound ("weapons/shellc.wav"); // Shotgun shell falling to floor + precache_sound (SOUND_ARTQUAD3); // Quad firing + precache_sound (SOUND_ARTNAILP3); // Nail Piercer firing + precache_sound (SOUND_ARTPENT3); // God mode on, taking damage + + precache_sound ("misc/power.wav"); //lightning for boss + + //---------------------------------------------------------------------- + // player gib sounds + precache_sound ("player/gib.wav"); // Used for players only + precache_sound (GIB_SOUND_UDEATH); // Used for monsters and players (sounds player) + precache_sound ("player/tornoff2.wav"); // Exit sound for client disconnect + + //---------------------------------------------------------------------- + // player pain sounds + precache_sound ("player/pain1.wav"); + precache_sound ("player/pain2.wav"); + precache_sound ("player/pain3.wav"); + precache_sound ("player/pain4.wav"); + precache_sound ("player/pain5.wav"); + precache_sound ("player/pain6.wav"); + + //---------------------------------------------------------------------- + // player death sounds + precache_sound ("player/death1.wav"); + precache_sound ("player/death2.wav"); + precache_sound ("player/death3.wav"); + precache_sound ("player/death4.wav"); + precache_sound ("player/death5.wav"); + + //---------------------------------------------------------------------- + // more weapon sounds + // precache_sound ("weapons/ax1.wav"); // ax swoosh + // precache_sound ("player/axhit1.wav"); // ax hit meat + // precache_sound ("player/axhit2.wav"); // ax hit world + precache_sound(SOUND_AXE_SWIPE1); // Axe swipe 1 + precache_sound(SOUND_AXE_SWIPE2); // Axe swipe 2 + precache_sound(SOUND_AXE_PLAYER); // axe hit player + precache_sound(SOUND_AXE_STONE); // stone impact + precache_sound(SOUND_AXE_WOOD); // wood impact + precache_sound(SOUND_AXE_GLASS); // glass impact + precache_sound(SOUND_AXE_METAL); // metal impact + precache_sound(SOUND_AXE_CERAMIC); // Ceramic impact + precache_sound(GIB_SOUND_HEAVY); // fleshy + precache_sound(GIB_SOUND_HEAVY2); // harder flesh! + + precache_sound ("player/h2ojump.wav"); // player jumping into water + precache_sound ("player/slimbrn2.wav"); // player enter slime + precache_sound ("player/inh2o.wav"); // player enter water + precache_sound ("player/inlava.wav"); // player enter lava + precache_sound ("misc/outwater.wav"); // leaving water sound + + precache_sound ("player/lburn1.wav"); // lava burn + precache_sound ("player/lburn2.wav"); // lava burn + + precache_sound ("misc/water1.wav"); // swimming + precache_sound ("misc/water2.wav"); // swimming + precache_sound (SOUND_HEARTBEAT); // Heartbeat (fast 1s) + + precache_model (MODEL_PLAYER); + precache_model (MODEL_PLAYER_EYES); + precache_model (MODEL_PLAYER_HEAD); + // precache_model ("progs/gib1.mdl"); // Replaced with better models + // precache_model ("progs/gib2.mdl"); + // precache_model ("progs/gib3.mdl"); + + precache_model (SBUBBLE_DROWN); // player drowning bubbles + precache_model (SEXP_SMALL); // Fire explosion (ID) + precache_model (SEXP_MED); // Fire explosion (Quoth) + precache_model (SEXP_BIG); // Fire explosion (Quoth) + precache_model (SEXP_PLASMA_SMALL); // Plasma explosion (Marcher) + precache_model (SEXP_PLASMA_BIG); // Plasma explosion (Marcher) + precache_model (SEXP_POISON_SMALL); // Poison explosion (Marcher) + precache_model (SEXP_POISON_MED); // Poison explosion (Quoth) + precache_model (SEXP_ELECTRIC); // Impact explosion (Quoth) + precache_model (SBURST_SMOKE); // Small puff of smoke (Rubicon2) + // Hardly ever used, entity cache it if needed +// precache_model (SEXP_ICE_BIG); // Ice explosion (ne_ruin) + + precache_model (MODEL_PROJ_SMOKE); // Empty model + smoke trail + precache_model (MODEL_PROJ_FLESH); // SpawnMeatSpray - projectiles.qc + precache_model (MODEL_PROJ_FLESHP); // Poisonous version of meat + + precache_model ("progs/g_axe.mdl"); + precache_model ("progs/ad171/g_shadaxeplain.mdl"); + precache_model ("progs/v_axe.mdl"); + precache_model ("progs/ad171/v_shadaxe0.mdl"); + precache_model (MODEL_VWEAP_UPAXE); // Upgrade - Shadow + precache_model (MODEL_VWEAP_SG); + precache_model (MODEL_VWEAP_SSG); + precache_model (MODEL_VWEAP_UPSSG); // Upgrade - Widowmaker + precache_model (MODEL_VWEAP_NG); + precache_model (MODEL_VWEAP_SNG); + precache_model (MODEL_VWEAP_GL); + precache_model (MODEL_VWEAP_RL); + precache_model (MODEL_VWEAP_LG); + precache_model (MODEL_VWEAP_UPLG); // Upgrade - Plasma Gun + + // precache_model (MODEL_VWEAP_ZSSG); // Zerstorer Riot gun + + precache_model ("progs/bolt.mdl"); // for lightning gun + precache_model ("progs/bolt2.mdl"); // for lightning gun + precache_model ("progs/bolt3.mdl"); // for boss shock + precache_model (MODEL_PROJ_PGPLASMA); // Plasma bolt for PG + // precache_model ("progs/lavaball.mdl"); // for testing + + precache_model (MODEL_PROJ_SHELLC); // Launch_ShellCasing - projectiles.qc + precache_model (MODEL_PROJ_DIAM2); // Projectile bullets + precache_model (MODEL_PROJ_NG); + precache_model (MODEL_PROJ_SNG); + precache_model (MODEL_PROJ_GRENADE); + precache_model (MODEL_PROJ_ROCKET); + precache_model (MODEL_BACKPACK); // DropBackpack - items.qc + + //---------------------------------------------------------------------- + // Pre-cache for MOD stuff + //---------------------------------------------------------------------- + precache_model (MODEL_BROKEN); // Broken model error + precache_model (MODEL_EMPTY); // Used for info_intermission cameras + + precache_model (GIB1_BLOOD); // New gib - arm/leg + precache_model (GIB2_BLOOD); // New gib - body + precache_model (GIB3_BLOOD); // New gib - slice + precache_model (GIB4_BLOOD); // New gib - small chunk/ball + precache_model (GIB5_BLOOD); // New gib - large chunk/ball + + precache_sound (GIB1_SOUND); // Monster Gib 1 + precache_sound (GIB3_SOUND); // Monster Gib 3 + precache_sound (GIB5_SOUND); // Monster Gib 5 + precache_sound (GIBHIT1_SOUND); // Gib Impact sound 1 + precache_sound (GIBHIT2_SOUND); // Gib Impact sound 2 + precache_sound (GIBHIT3_SOUND); // Gib Impact sound 3 + precache_sound (GIBHIT4_SOUND); // Gib Impact sound 4 + precache_sound (GIBHIT5_SOUND); // Gib Impact sound 5 + precache_sound (GIBHIT1_STONESOUND); // long roll + precache_sound (GIBHIT3_STONESOUND); // quick roll + precache_sound (GIBHIT5_STONESOUND); // slow roll + precache_sound (GIBHIT1_METALSOUND); // small clink + precache_sound (GIBHIT3_METALSOUND); // large clank + precache_sound (GIBHIT5_METALSOUND); // gigantic clonk + precache_sound (GIB_SOUND_HEAVY); // Large gib + precache_sound (GIB_SOUND_METALA); // Sword impact + precache_sound (GIB_SOUND_METALB); // Sword impact + precache_sound (GIB_SOUND_CHAIN); // Chain impact + precache_sound (GIB_SOUND_WOOD); // Wooden impact + precache_sound (GIB_SOUND_ACID); // Acid burning + precache_sound (GIB_SOUND_SDEATH); // Stone death + + //---------------------------------------------------------------------- + // Footstep sounds (slow, light, medium, heavy, large & giant) + //---------------------------------------------------------------------- + precache_sound (SOUND_FS_SLOW1); + precache_sound (SOUND_FS_SLOW2); + precache_sound (SOUND_FS_SLOW3); + precache_sound (SOUND_FS_SLOW4); + precache_sound (SOUND_FS_SLOW5); + + precache_sound (SOUND_FS_DRAG1); + precache_sound (SOUND_FS_DRAG2); + precache_sound (SOUND_FS_DRAG3); + precache_sound (SOUND_FS_DRAG4); + precache_sound (SOUND_FS_DRAG5); + + precache_sound (SOUND_FS_LIGHT1); + precache_sound (SOUND_FS_LIGHT2); + precache_sound (SOUND_FS_LIGHT3); + precache_sound (SOUND_FS_LIGHT4); + precache_sound (SOUND_FS_LIGHT5); + + precache_sound (SOUND_FS_MEDIUM1); + precache_sound (SOUND_FS_MEDIUM2); + precache_sound (SOUND_FS_MEDIUM3); + precache_sound (SOUND_FS_MEDIUM4); + precache_sound (SOUND_FS_MEDIUM5); + + precache_sound (SOUND_FS_HEAVY1); + precache_sound (SOUND_FS_HEAVY2); + precache_sound (SOUND_FS_HEAVY3); + precache_sound (SOUND_FS_HEAVY4); + precache_sound (SOUND_FS_HEAVY5); + + precache_sound (SOUND_FS_LARGE1); + precache_sound (SOUND_FS_LARGE2); + precache_sound (SOUND_FS_LARGE3); + precache_sound (SOUND_FS_LARGE4); + precache_sound (SOUND_FS_LARGE5); + + precache_sound (SOUND_FS_GIANT1); + precache_sound (SOUND_FS_GIANT2); + precache_sound (SOUND_FS_GIANT3); + precache_sound (SOUND_FS_GIANT4); + precache_sound (SOUND_FS_GIANT5); + + PrecacheAll(); + + + //---------------------------------------------------------------------- + // Setup light animation tables. 'a' is total darkness, 'z' is maxbright. + //---------------------------------------------------------------------- + // 0 normal + lightstyle(0, "m"); + // 1 FLICKER (first variety) + lightstyle(1, "mmnmmommommnonmmonqnmmo"); + // 2 SLOW STRONG PULSE + lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); + // 3 CANDLE (first variety) + lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); + // 4 FAST STROBE + lightstyle(4, "mamamamamama"); + // 5 GENTLE PULSE 1 + lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj"); + // 6 FLICKER (second variety) + lightstyle(6, "nmonqnmomnmomomno"); + // 7 CANDLE (second variety) + lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm"); + // 8 CANDLE (third variety) + lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"); + // 9 SLOW STROBE (fourth variety) + lightstyle(9, "aaaaaaaazzzzzzzz"); + // 10 FLUORESCENT FLICKER + lightstyle(10, "mmamammmmammamamaaamammma"); + // 11 SLOW PULSE NOT FADE TO BLACK + lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); + // styles 32-62 are assigned by the light program for switchable lights + // 63 testing + lightstyle(63, "a"); + + //---------------------------------------------------------------------- + // Check for engine type and extensions (different features) + //---------------------------------------------------------------------- + engine = ENG_FITZ; // Default engine type (no extensions) + ext_active = cvar("pr_checkextension"); // Check for extra extensions + if (ext_active) { + // This could be DP, QSS, DQ, RMQ, Qbism etc + engine = ENG_DPEXT; + + // Check for DP point particle extensions + ext_dppart = checkextension("DP_SV_POINTPARTICLES"); + // DP extra fog params + ext_dpfog = checkextension("DP_GFX_FOG"); + // surface content + ext_dpsurf = checkextension("DP_QC_GETSURFACE"); + // particle rain/snow system + ext_dprain = checkextension("DP_TE_PARTICLERAIN"); + ext_dpsnow = checkextension("DP_TE_PARTICLESNOW"); + // Engine support for proper rotating/colliding bmodels + //ext_dprot = checkextension("DP_SV_ROTATINGBMODEL"); + + // Check for FTE/QS-S point particle extensions + // Sadly it seems the QS-Spike engine is not going to declare + // the particle functions to the MOD, so it looks like there + // is no way to detect if rain/snow effects are active + if (checkextension("FTE_SV_POINTPARTICLES")) { + ext_dppart = TRUE; + if (checkextension("FTE_PART_NAMESPACE_EFFECTINFO")) { + // The default should be root of MOD directory + // QS-Spike/FTE has other plans ... + particleeffectnum("effectinfo.txt"); + // Rain/Snow checkextension don't exist atm + // Maybe one day the QSS engine will support it! + particleeffectnum("fte_weather.cfg"); + } + } + } + + dprint("\n\b[ENGINE]\b "); + if (engine == ENG_FITZ) dprint("Fitz Compatible\n"); + else if (engine == ENG_DPEXT) dprint("DP Compatible\n"); + else dprint("Unknown\n"); + + // Large maps cannot use this function, check for disable + if (self.no_surfacecheck == TRUE) ext_dpsurf = 0; + + //---------------------------------------------------------------------- + // Check for any custom water alpha defined on the worldspawn + // This is not very precise because FTOS is only ONE decimal place + // Once the client has started, the water alpha is fine tuned + if (self.water_alpha) { + liquid_alpha = self.water_alpha; + cvar_set ("r_wateralpha", ftos(liquid_alpha)); + } + + // Default is auto aim OFF + autoaim_cvar = 1; + + // Check for any override on player projectiles + playerprojsize = world.no_bigprojectiles; + + if (self.useold_axe) { + g_axemodel = "progs/g_axe.mdl"; + v_axemodel = "progs/v_axe.mdl"; + } else { + g_axemodel = "progs/ad171/g_shadaxeplain.mdl"; + v_axemodel = "progs/ad171/v_shadaxe0.mdl"; + } + + //---------------------------------------------------------------------- + // Check for any custom gravity settings or ziggy secret map + if (!self.gravity) map_gravity = DEF_GRAVITY; + else map_gravity = self.gravity; + if (self.model == "maps/e1m8.bsp") map_gravity = 100; // Ziggy secret map + cvar_set ("sv_gravity", ftos(map_gravity)); + + //---------------------------------------------------------------------- + // Check for global body floor check and fading timer + if (self.bodyflrcheck == 1) map_bodyflrcheck = TRUE; + else map_bodyflrcheck = FALSE; + if (self.bodyfadeaway > 0) map_bodyfadeaway = self.bodyfadeaway; + else map_bodyfadeaway = FALSE; + + //---------------------------------------------------------------------- + // The values of configflag is never saved, its always generated! + // merge any changes from worldspawn into console variable + configflag = cvar("temp1"); + sycn_worldspawn(); + temp1flag = configflag; + + dprint("\b[WORLD]\b TEMP1 + Worldspawn ("); + dprint(ftos(temp1flag)); dprint(")\n"); + + //---------------------------------------------------------------------- + // Setup Particle System + //---------------------------------------------------------------------- + if (query_configflag(SVR_PARTICLES) == SVR_PARTICLES) { + if (self.particlemax > 0) part_max = self.particlemax; + else part_max = PARTICLE_MAXENTS; + // DP setup uses engine particles + if (engine == ENG_DPEXT && query_configflag(SVR_SPRPARTON) == FALSE + && self.sprite_particles == FALSE) + part_max = part_max * 0.5; + dprint("\b[WORLD]\b Max particles ("); + dprint(ftos(part_max)); dprint(")\n"); + setup_particlechain(); // Setup intial particle chain + } + + //---------------------------------------------------------------------- + dprint("\b[WORLD]\b Setup Pendulum vector array\n"); + pendulum_setuparray(); + + if (self.devdata & DEV_AMMO_N_HEALTH) { + self.deventity = ammohealthsum(); + } + + //---------------------------------------------------------------------- + // Original id levels + // Episode 1 + // The Slipgate Complex, Castle of the Damned, The Necropolis, The Grisly Grotto + // Gloom Keep, The Door to Chthon, The House of Chthon, Ziggurat Vertigo (S) + // Episode 2 + // The Installation, The Ogre Citadel, The Crypt of Decay, The Ebon Fortress + // The Wizard's Manse, The Dismal Oubliette, The Underearth (S) + // Episode 3 + // Termination Central, The Vaults of Zin, The Tomb of Terror, Satan's Dark Delight + // The Wind Tunnels, Chambers of Torment, The Haunted Halls (S) + // Episode 4 + // The Sewage System, The Tower of Despair, The Elder God Shrine, The Palace of Hate + // Hell's Atrium, The Pain Maze, Azure Agony, The Nameless City (S) + //---------------------------------------------------------------------- +}; + +/*====================================================================== + Start frame +======================================================================*/ +void() StartFrame = { + teamplay = cvar("teamplay"); + developer = cvar("developer"); + skill = cvar("skill"); + coop = cvar("coop"); + + framecount = framecount + 1; + WorldScan(); // Sets h2olevel and h2otype for ryu and wyrm dragons (Drake) +}; + +/*====================================================================== + BODY QUE + Keeps track of dead player models +======================================================================*/ +entity bodyque_head; + +// just here so spawn functions don't complain after the world +// creates bodyques +void() bodyque = {}; + +//---------------------------------------------------------------------- +// New Code from Inside3d forums (old system was terrible) +//---------------------------------------------------------------------- +void() InitBodyQue = +{ + local entity e, prev; + local float numBodies, num; + + num = 0; + // how many player corpses to allow in the world at once + numBodies = 10; + prev = world; + bodyque_head = world; + + while(num < numBodies) { + // Spawn another body + e = spawn(); + e.classname = "bodyque"; + + // If this is the first, set the bodyque_head pointer + // (start of the list) + if(bodyque_head == world) bodyque_head = e; + + // Link up to previous item to form the linked list + if(prev != world) e.owner = prev; + + // Point prev to the new item + prev = e; + num = num + 1; + } + // turn the linked list into a linked loop + bodyque_head.owner = prev; +}; + +//---------------------------------------------------------------------- +// make a body que entry for the given ent so the ent can be +// respawned elsewhere +//---------------------------------------------------------------------- +void(entity ent) CopyToBodyQue = +{ + bodyque_head.angles = ent.angles; + bodyque_head.model = ent.model; + bodyque_head.modelindex = ent.modelindex; + bodyque_head.frame = ent.frame; + bodyque_head.colormap = ent.colormap; + bodyque_head.movetype = ent.movetype; + bodyque_head.velocity = ent.velocity; + bodyque_head.flags = 0; + setorigin (bodyque_head, ent.origin); + setsize (bodyque_head, ent.mins, ent.maxs); + bodyque_head = bodyque_head.owner; +}; + +/*====================================================================== + Stuff removed + - QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10) + - QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8) + - QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) + Used as a positional target for spotlights, etc. + - QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) + Used as a positional target for lightning. + - QUAKED test_teleport (0 .5 .8) ? + - QUAKED test_fodder (0 .5 .8) ? + - QUAKED noclass (0 0 0) (-8 -8 -8) (8 8 8) + - QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big + +======================================================================*/ +void() item_weapon = { remove(self); }; +void() misc_noisemaker = { remove(self); }; +void() noclass = { remove(self); }; + +void() test_fodder = { remove(self); }; +void() test_goaway = { remove(self); }; +void() test_spawn = { remove(self); }; +void() test_teleport = { remove(self); }; + +void() testplayerstart = { remove(self); }; +void() viewthing = { remove(self); }; + +/*====================================================================== +/*QUAKED trigger_onlyregistered (.5 .5 .5) ? +Checks for registered version of game, no one uses this anymore +======================================================================*/ +void() trigger_onlyregistered_touch = +{ + if ( !(other.flags & FL_CLIENT) ) return; + if (self.attack_finished > time) return; + + self.attack_finished = time + 2; + if (cvar("registered")) { + self.message = ""; + SUB_UseTargets (); + remove (self); + } + else { + if (self.message != "") { + centerprint (other, self.message); + sound (other, CHAN_BODY, SOUND_TALK, 1, ATTN_NORM); + } + } +}; + +//---------------------------------------------------------------------- +void() trigger_onlyregistered = +{ + InitTrigger (); + self.touch = trigger_onlyregistered_touch; +}; + +//---------------------------------------------------------------------- +// A function that supresses compiler errors +//---------------------------------------------------------------------- +void() dpcompiler_errors = +{ + worldstatus = ""; + gettaginfo_parent = 0; + gettaginfo_name = ""; + gettaginfo_offset = '0 0 0'; + gettaginfo_forward = '0 0 0'; + gettaginfo_right = '0 0 0'; + gettaginfo_up = '0 0 0'; + trace_dpstartcontents = 0; + trace_dphitcontents = 0; + trace_dphitq3surfaceflags = 0; + trace_dphittexturename = ""; +}; + +void() amsumthink = { + float dmg = 0; + + dprint("\b[DEV]\b Developer Level Data:\n"); + dprint("World Ammo Sum:: Shells: "); + dprint(ftos(self.ammo_shells)); + dprint(", Nails: "); + dprint(ftos(self.ammo_nails)); + dprint(", Rockets: "); + dprint(ftos(self.ammo_rockets)); + dprint(", Cells: "); + dprint(ftos(self.ammo_cells)); + dprint("\n"); + dprint("Lava Nails: "); + dprint(ftos(self.ammo_lava_nails)); + dprint(", Multi-Rockets: "); + dprint(ftos(self.ammo_multi_rockets)); + dprint(", Plasma: "); + dprint(ftos(self.ammo_plasma)); + dprint(", Bolts: "); + dprint(ftos(self.ammo_bolts)); + dprint(", Poison: "); + dprint(ftos(self.ammo_poison)); + dprint("\n"); + + vector plasmad = DAMAGE_PGPLAYER; + dmg = dmg + (self.ammo_shells * DAMAGE_SHELL); + dmg = dmg + (self.ammo_nails * DAMAGE_NGSPIKE); + dmg = dmg + (self.ammo_lava_nails * DAMAGE_LAVANGSPIKE); + dmg = dmg + (self.ammo_rockets * DAMAGE_PLAYGRENADE); + dmg = dmg + (self.ammo_multi_rockets * DAMAGE_PLAYGRENADE); + dmg = dmg + (self.ammo_cells * DAMAGE_LGPLAYER); + dmg = dmg + (self.ammo_plasma * plasmad.x); + dmg = dmg + (self.ammo_bolts * DAMAGE_BOLTPLAYER); + dmg = dmg + (self.ammo_poison * DAMAGE_BOLTPLAYERP); + dprint("Estimated Player Damage Points:: "); + dprint(ftos(dmg)); + dprint("\n"); + + dprint("World Enemy Health Sum:: "); + dprint(ftos(self.enemyhealth)); + dprint("\n"); + dprint("World Items Health Sum:: "); + dprint(ftos(self.health)); + dprint("\n"); + + self.think = SUB_Remove; + self.nextthink = time + 0.1; +}; + +entity () ammohealthsum { + entity e; + e = spawn(); + e.classname = "info_devdata"; + e.think = amsumthink; + e.nextthink = time + 5; // give plenty of time to add all the sums up + return e; +}; \ No newline at end of file diff --git a/QC_other/QC_keep/wrong_fteqccgui.exe b/QC_other/QC_keep/wrong_fteqccgui.exe new file mode 100644 index 00000000..9105a1df Binary files /dev/null and b/QC_other/QC_keep/wrong_fteqccgui.exe differ diff --git a/QC_original/ai.qc b/QC_other/QC_original/ai.qc similarity index 100% rename from QC_original/ai.qc rename to QC_other/QC_original/ai.qc diff --git a/QC_original/amtest.qc b/QC_other/QC_original/amtest.qc similarity index 100% rename from QC_original/amtest.qc rename to QC_other/QC_original/amtest.qc diff --git a/QC_original/boss.qc b/QC_other/QC_original/boss.qc similarity index 100% rename from QC_original/boss.qc rename to QC_other/QC_original/boss.qc diff --git a/QC_original/buttons.qc b/QC_other/QC_original/buttons.qc similarity index 100% rename from QC_original/buttons.qc rename to QC_other/QC_original/buttons.qc diff --git a/QC_original/client.qc b/QC_other/QC_original/client.qc similarity index 100% rename from QC_original/client.qc rename to QC_other/QC_original/client.qc diff --git a/QC_original/combat.qc b/QC_other/QC_original/combat.qc similarity index 100% rename from QC_original/combat.qc rename to QC_other/QC_original/combat.qc diff --git a/QC_original/defs.qc b/QC_other/QC_original/defs.qc similarity index 100% rename from QC_original/defs.qc rename to QC_other/QC_original/defs.qc diff --git a/QC_original/demon.qc b/QC_other/QC_original/demon.qc similarity index 100% rename from QC_original/demon.qc rename to QC_other/QC_original/demon.qc diff --git a/QC_original/dog.qc b/QC_other/QC_original/dog.qc similarity index 100% rename from QC_original/dog.qc rename to QC_other/QC_original/dog.qc diff --git a/QC_original/doors.qc b/QC_other/QC_original/doors.qc similarity index 100% rename from QC_original/doors.qc rename to QC_other/QC_original/doors.qc diff --git a/QC_original/enforcer.qc b/QC_other/QC_original/enforcer.qc similarity index 100% rename from QC_original/enforcer.qc rename to QC_other/QC_original/enforcer.qc diff --git a/QC_original/fight.qc b/QC_other/QC_original/fight.qc similarity index 100% rename from QC_original/fight.qc rename to QC_other/QC_original/fight.qc diff --git a/QC_original/fish.qc b/QC_other/QC_original/fish.qc similarity index 100% rename from QC_original/fish.qc rename to QC_other/QC_original/fish.qc diff --git a/QC_original/flag.qc b/QC_other/QC_original/flag.qc similarity index 100% rename from QC_original/flag.qc rename to QC_other/QC_original/flag.qc diff --git a/QC_original/hknight.qc b/QC_other/QC_original/hknight.qc similarity index 100% rename from QC_original/hknight.qc rename to QC_other/QC_original/hknight.qc diff --git a/QC_original/items.qc b/QC_other/QC_original/items.qc similarity index 100% rename from QC_original/items.qc rename to QC_other/QC_original/items.qc diff --git a/QC_original/jctest.qc b/QC_other/QC_original/jctest.qc similarity index 100% rename from QC_original/jctest.qc rename to QC_other/QC_original/jctest.qc diff --git a/QC_original/knight.qc b/QC_other/QC_original/knight.qc similarity index 100% rename from QC_original/knight.qc rename to QC_other/QC_original/knight.qc diff --git a/QC_original/misc.qc b/QC_other/QC_original/misc.qc similarity index 100% rename from QC_original/misc.qc rename to QC_other/QC_original/misc.qc diff --git a/QC_original/models.qc b/QC_other/QC_original/models.qc similarity index 100% rename from QC_original/models.qc rename to QC_other/QC_original/models.qc diff --git a/QC_original/monsters.qc b/QC_other/QC_original/monsters.qc similarity index 100% rename from QC_original/monsters.qc rename to QC_other/QC_original/monsters.qc diff --git a/QC_other/QC_original/ogre.qc b/QC_other/QC_original/ogre.qc new file mode 100644 index 00000000..d14e2da3 --- /dev/null +++ b/QC_other/QC_original/ogre.qc @@ -0,0 +1,483 @@ +/* +============================================================================== + +OGRE + +============================================================================== +*/ + +$cd id1/models/ogre_c +$origin 0 0 24 +$base base +$skin base + +$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 + +$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 +$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16 + +$frame run1 run2 run3 run4 run5 run6 run7 run8 + +$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7 +$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14 + +$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 +$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14 + +$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6 + +$frame pain1 pain2 pain3 pain4 pain5 + +$frame painb1 painb2 painb3 + +$frame painc1 painc2 painc3 painc4 painc5 painc6 + +$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10 +$frame paind11 paind12 paind13 paind14 paind15 paind16 + +$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10 +$frame paine11 paine12 paine13 paine14 paine15 + +$frame death1 death2 death3 death4 death5 death6 +$frame death7 death8 death9 death10 death11 death12 +$frame death13 death14 + +$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6 +$frame bdeath7 bdeath8 bdeath9 bdeath10 + +$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11 + +//============================================================================= + + +void() OgreGrenadeExplode = +{ + T_RadiusDamage (self, self.owner, 40, world); + sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); + + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_EXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + self.velocity = '0 0 0'; + self.touch = SUB_Null; + setmodel (self, "progs/s_explod.spr"); + self.solid = SOLID_NOT; + s_explode1 (); +}; + +void() OgreGrenadeTouch = +{ + if (other == self.owner) + return; // don't explode on owner + if (other.takedamage == DAMAGE_AIM) + { + OgreGrenadeExplode(); + return; + } + sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound + if (self.velocity == '0 0 0') + self.avelocity = '0 0 0'; +}; + +/* +================ +OgreFireGrenade +================ +*/ +void() OgreFireGrenade = +{ + local entity missile, mpuff; + + self.effects = self.effects | EF_MUZZLEFLASH; + + sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + + missile = spawn (); + missile.owner = self; + missile.movetype = MOVETYPE_BOUNCE; + missile.solid = SOLID_BBOX; + +// set missile speed + + makevectors (self.angles); + + missile.velocity = normalize(self.enemy.origin - self.origin); + missile.velocity = missile.velocity * 600; + missile.velocity_z = 200; + + missile.avelocity = '300 300 300'; + + missile.angles = vectoangles(missile.velocity); + + missile.touch = OgreGrenadeTouch; + +// set missile duration + missile.nextthink = time + 2.5; + missile.think = OgreGrenadeExplode; + + setmodel (missile, "progs/grenade.mdl"); + setsize (missile, '0 0 0', '0 0 0'); + setorigin (missile, self.origin); +}; + + +//============================================================================= + +/* +================ +chainsaw + +FIXME +================ +*/ +void(float side) chainsaw = +{ +local vector delta; +local float ldmg; + + if (!self.enemy) + return; + if (!CanDamage (self.enemy, self)) + return; + + ai_charge(10); + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 100) + return; + + ldmg = (random() + random() + random()) * 4; + T_Damage (self.enemy, self, self, ldmg); + + if (side) + { + makevectors (self.angles); + if (side == 1) + SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right); + else + SpawnMeatSpray (self.origin + v_forward*16, side * v_right); + } +}; + + +void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();}; +void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();}; +void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();}; +void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();}; +void() ogre_stand5 =[ $stand5, ogre_stand6 ] { +if (random() < 0.2) + sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); +ai_stand(); +}; +void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();}; +void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();}; +void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();}; +void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();}; + +void() ogre_walk1 =[ $walk1, ogre_walk2 ] {ai_walk(3);}; +void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);}; +void() ogre_walk3 =[ $walk3, ogre_walk4 ] { +ai_walk(2); +if (random() < 0.2) + sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE); +}; +void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);}; +void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);}; +void() ogre_walk6 =[ $walk6, ogre_walk7 ] { +ai_walk(5); +if (random() < 0.1) + sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); +}; +void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);}; +void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);}; +void() ogre_walk9 =[ $walk9, ogre_walk10 ] {ai_walk(3);}; +void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);}; +void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);}; +void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);}; +void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);}; +void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);}; +void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);}; +void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);}; + +void() ogre_run1 =[ $run1, ogre_run2 ] {ai_run(9); +if (random() < 0.2) + sound (self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE); +}; +void() ogre_run2 =[ $run2, ogre_run3 ] {ai_run(12);}; +void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);}; +void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);}; +void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);}; +void() ogre_run6 =[ $run6, ogre_run7 ] {ai_run(4);}; +void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);}; +void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);}; + +void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11); +sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); +}; +void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);}; +void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);}; +void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);}; +void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);self.angles_y = self.angles_y + random()*25;}; +void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;}; +void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);}; +void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);}; +void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);}; + +void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6); +sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); +}; +void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);}; +void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);}; +void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);}; +void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);}; +void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0);}; +void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);}; +void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);}; +void() ogre_smash9 =[ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);}; +void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1);}; +void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0); +self.nextthink = self.nextthink + random()*0.2;}; // slight variation +void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge();}; +void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);}; +void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);}; + +void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();}; +void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();}; +void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();}; +void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireGrenade();}; +void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();}; +void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();}; +void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();}; + +void() ogre_pain1 =[ $pain1, ogre_pain2 ] {}; +void() ogre_pain2 =[ $pain2, ogre_pain3 ] {}; +void() ogre_pain3 =[ $pain3, ogre_pain4 ] {}; +void() ogre_pain4 =[ $pain4, ogre_pain5 ] {}; +void() ogre_pain5 =[ $pain5, ogre_run1 ] {}; + + +void() ogre_painb1 =[ $painb1, ogre_painb2 ] {}; +void() ogre_painb2 =[ $painb2, ogre_painb3 ] {}; +void() ogre_painb3 =[ $painb3, ogre_run1 ] {}; + + +void() ogre_painc1 =[ $painc1, ogre_painc2 ] {}; +void() ogre_painc2 =[ $painc2, ogre_painc3 ] {}; +void() ogre_painc3 =[ $painc3, ogre_painc4 ] {}; +void() ogre_painc4 =[ $painc4, ogre_painc5 ] {}; +void() ogre_painc5 =[ $painc5, ogre_painc6 ] {}; +void() ogre_painc6 =[ $painc6, ogre_run1 ] {}; + + +void() ogre_paind1 =[ $paind1, ogre_paind2 ] {}; +void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);}; +void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);}; +void() ogre_paind4 =[ $paind4, ogre_paind5 ] {ai_pain(4);}; +void() ogre_paind5 =[ $paind5, ogre_paind6 ] {}; +void() ogre_paind6 =[ $paind6, ogre_paind7 ] {}; +void() ogre_paind7 =[ $paind7, ogre_paind8 ] {}; +void() ogre_paind8 =[ $paind8, ogre_paind9 ] {}; +void() ogre_paind9 =[ $paind9, ogre_paind10 ] {}; +void() ogre_paind10=[ $paind10, ogre_paind11 ] {}; +void() ogre_paind11=[ $paind11, ogre_paind12 ] {}; +void() ogre_paind12=[ $paind12, ogre_paind13 ] {}; +void() ogre_paind13=[ $paind13, ogre_paind14 ] {}; +void() ogre_paind14=[ $paind14, ogre_paind15 ] {}; +void() ogre_paind15=[ $paind15, ogre_paind16 ] {}; +void() ogre_paind16=[ $paind16, ogre_run1 ] {}; + +void() ogre_paine1 =[ $paine1, ogre_paine2 ] {}; +void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);}; +void() ogre_paine3 =[ $paine3, ogre_paine4 ] {ai_pain(9);}; +void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);}; +void() ogre_paine5 =[ $paine5, ogre_paine6 ] {}; +void() ogre_paine6 =[ $paine6, ogre_paine7 ] {}; +void() ogre_paine7 =[ $paine7, ogre_paine8 ] {}; +void() ogre_paine8 =[ $paine8, ogre_paine9 ] {}; +void() ogre_paine9 =[ $paine9, ogre_paine10 ] {}; +void() ogre_paine10=[ $paine10, ogre_paine11 ] {}; +void() ogre_paine11=[ $paine11, ogre_paine12 ] {}; +void() ogre_paine12=[ $paine12, ogre_paine13 ] {}; +void() ogre_paine13=[ $paine13, ogre_paine14 ] {}; +void() ogre_paine14=[ $paine14, ogre_paine15 ] {}; +void() ogre_paine15=[ $paine15, ogre_run1 ] {}; + + +void(entity attacker, float damage) ogre_pain = +{ + local float r; + +// don't make multiple pain sounds right after each other + if (self.pain_finished > time) + return; + + sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); + + r = random(); + + if (r < 0.25) + { + ogre_pain1 (); + self.pain_finished = time + 1; + } + else if (r < 0.5) + { + ogre_painb1 (); + self.pain_finished = time + 1; + } + else if (r < 0.75) + { + ogre_painc1 (); + self.pain_finished = time + 1; + } + else if (r < 0.88) + { + ogre_paind1 (); + self.pain_finished = time + 2; + } + else + { + ogre_paine1 (); + self.pain_finished = time + 2; + } +}; + +void() OgreDrop = +{ + local entity entPlayer; + entPlayer = FindEntPlayerForDrop(); + + self.solid = SOLID_NOT; + self.ammo_rockets = 2; + DropBackpack(); + + if(entPlayer != world && random() > 0.65) + { + if(!TryDrop(entPlayer, WID_GRENADE_LAUNCHER, 0.5)) + if(!TryDrop(entPlayer, WID_PROIXIMITY_GUN, 0.4)) + if(!TryDrop(entPlayer, WID_ROCKET_LAUNCHER, 0.4)) + if(!TryDrop(entPlayer, WID_SUPER_NAILGUN, 0.2)) + if(!TryDrop(entPlayer, WID_NAILGUN, 0.2)) + if(!TryDrop(entPlayer, WID_SUPER_SHOTGUN, 0.1)) + if(!TryDrop(entPlayer, WID_SHOTGUN, 0.1)) + if(!TryDrop(entPlayer, WID_AXE, 0.1)) + { /* Intentionally empty. */ } + } +} + +void() ogre_die1 =[ $death1, ogre_die2 ] {}; +void() ogre_die2 =[ $death2, ogre_die3 ] {}; +void() ogre_die3 =[ $death3, ogre_die4 ] +{ OgreDrop(); }; +void() ogre_die4 =[ $death4, ogre_die5 ] {}; +void() ogre_die5 =[ $death5, ogre_die6 ] {}; +void() ogre_die6 =[ $death6, ogre_die7 ] {}; +void() ogre_die7 =[ $death7, ogre_die8 ] {}; +void() ogre_die8 =[ $death8, ogre_die9 ] {}; +void() ogre_die9 =[ $death9, ogre_die10 ] {}; +void() ogre_die10 =[ $death10, ogre_die11 ] {}; +void() ogre_die11 =[ $death11, ogre_die12 ] {}; +void() ogre_die12 =[ $death12, ogre_die13 ] {}; +void() ogre_die13 =[ $death13, ogre_die14 ] {}; +void() ogre_die14 =[ $death14, ogre_die14 ] {}; + +void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {}; +void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {ai_forward(5);}; +void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ] +{ OgreDrop(); }; +void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);}; +void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);}; +void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);}; +void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);}; +void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {}; +void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {}; +void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {}; + +void() ogre_die = +{ +// check for gib + if (self.health < -80) + { + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + ThrowHead ("progs/h_ogre.mdl", self.health); + ThrowGib ("progs/gib3.mdl", self.health); + ThrowGib ("progs/gib3.mdl", self.health); + ThrowGib ("progs/gib3.mdl", self.health); + return; + } + + sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM); + + if (random() < 0.5) + ogre_die1 (); + else + ogre_bdie1 (); +}; + +void() ogre_melee = +{ + if (random() > 0.5) + ogre_smash1 (); + else + ogre_swing1 (); +}; + + +/*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush + +*/ +void() monster_ogre = +{ + if (deathmatch) + { + remove(self); + return; + } + precache_model ("progs/ogre.mdl"); + precache_model ("progs/h_ogre.mdl"); + precache_model ("progs/grenade.mdl"); + + precache_sound ("ogre/ogdrag.wav"); + precache_sound ("ogre/ogdth.wav"); + precache_sound ("ogre/ogidle.wav"); + precache_sound ("ogre/ogidle2.wav"); + precache_sound ("ogre/ogpain1.wav"); + precache_sound ("ogre/ogsawatk.wav"); + precache_sound ("ogre/ogwake.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + + setmodel (self, "progs/ogre.mdl"); + + // vector VEC_HULL2_MIN = '-32 -32 -24'; + // vector VEC_HULL2_MAX = '32 32 64'; + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + self.health = 200; + + self.th_stand = ogre_stand1; + self.th_walk = ogre_walk1; + self.th_run = ogre_run1; + self.th_die = ogre_die; + self.th_melee = ogre_melee; + self.th_missile = ogre_nail1; + self.th_pain = ogre_pain; + + walkmonster_start(); +}; + +void() monster_ogre_marksman = +{ + monster_ogre (); +}; + + diff --git a/QC_original/oldone.qc b/QC_other/QC_original/oldone.qc similarity index 100% rename from QC_original/oldone.qc rename to QC_other/QC_original/oldone.qc diff --git a/QC_original/plats.qc b/QC_other/QC_original/plats.qc similarity index 100% rename from QC_original/plats.qc rename to QC_other/QC_original/plats.qc diff --git a/QC_original/player.qc b/QC_other/QC_original/player.qc similarity index 100% rename from QC_original/player.qc rename to QC_other/QC_original/player.qc diff --git a/QC_original/progs.dat b/QC_other/QC_original/progs.dat similarity index 100% rename from QC_original/progs.dat rename to QC_other/QC_original/progs.dat diff --git a/QC_original/progs.src b/QC_other/QC_original/progs.src similarity index 100% rename from QC_original/progs.src rename to QC_other/QC_original/progs.src diff --git a/QC_original/shalrath.qc b/QC_other/QC_original/shalrath.qc similarity index 100% rename from QC_original/shalrath.qc rename to QC_other/QC_original/shalrath.qc diff --git a/QC_original/shambler.qc b/QC_other/QC_original/shambler.qc similarity index 100% rename from QC_original/shambler.qc rename to QC_other/QC_original/shambler.qc diff --git a/QC_original/soldier.qc b/QC_other/QC_original/soldier.qc similarity index 100% rename from QC_original/soldier.qc rename to QC_other/QC_original/soldier.qc diff --git a/QC_other/QC_original/sprites.qc b/QC_other/QC_original/sprites.qc new file mode 100644 index 00000000..fe889a04 --- /dev/null +++ b/QC_other/QC_original/sprites.qc @@ -0,0 +1,26 @@ + +// these are the only sprites still in the game... + +$spritename s_explod +$type vp_parallel +$load id1/gfx/sprites/explod03.lbm +$frame 24 24 56 56 +$frame 120 24 56 56 +$frame 216 24 56 56 +$frame 24 88 56 56 +$frame 120 88 56 56 +$frame 216 88 56 56 + + +$spritename s_bubble +$type vp_parallel +$load id1/gfx/sprites/bubble.lbm +$frame 16 16 16 16 +$frame 40 16 16 16 + + +$spritename s_light +$type vp_parallel +$load id1/gfx/sprites/light.lbm +$frame 104 32 32 32 + diff --git a/QC_original/subs.qc b/QC_other/QC_original/subs.qc similarity index 100% rename from QC_original/subs.qc rename to QC_other/QC_original/subs.qc diff --git a/QC_original/tarbaby.qc b/QC_other/QC_original/tarbaby.qc similarity index 100% rename from QC_original/tarbaby.qc rename to QC_other/QC_original/tarbaby.qc diff --git a/QC_original/triggers.qc b/QC_other/QC_original/triggers.qc similarity index 100% rename from QC_original/triggers.qc rename to QC_other/QC_original/triggers.qc diff --git a/QC_original/weapons.qc b/QC_other/QC_original/weapons.qc similarity index 100% rename from QC_original/weapons.qc rename to QC_other/QC_original/weapons.qc diff --git a/QC_original/wizard.qc b/QC_other/QC_original/wizard.qc similarity index 100% rename from QC_original/wizard.qc rename to QC_other/QC_original/wizard.qc diff --git a/QC_original/world.qc b/QC_other/QC_original/world.qc similarity index 100% rename from QC_original/world.qc rename to QC_other/QC_original/world.qc diff --git a/QC_original/zombie.qc b/QC_other/QC_original/zombie.qc similarity index 100% rename from QC_original/zombie.qc rename to QC_other/QC_original/zombie.qc diff --git a/QC_rogue/AI.QC b/QC_other/QC_rogue/AI.QC similarity index 100% rename from QC_rogue/AI.QC rename to QC_other/QC_rogue/AI.QC diff --git a/QC_rogue/BOSS.QC b/QC_other/QC_rogue/BOSS.QC similarity index 100% rename from QC_rogue/BOSS.QC rename to QC_other/QC_rogue/BOSS.QC diff --git a/QC_rogue/BUTTONS.QC b/QC_other/QC_rogue/BUTTONS.QC similarity index 100% rename from QC_rogue/BUTTONS.QC rename to QC_other/QC_rogue/BUTTONS.QC diff --git a/QC_rogue/BUZZSAW.QC b/QC_other/QC_rogue/BUZZSAW.QC similarity index 100% rename from QC_rogue/BUZZSAW.QC rename to QC_other/QC_rogue/BUZZSAW.QC diff --git a/QC_rogue/CLIENT.QC b/QC_other/QC_rogue/CLIENT.QC similarity index 100% rename from QC_rogue/CLIENT.QC rename to QC_other/QC_rogue/CLIENT.QC diff --git a/QC_rogue/COMBAT.QC b/QC_other/QC_rogue/COMBAT.QC similarity index 100% rename from QC_rogue/COMBAT.QC rename to QC_other/QC_rogue/COMBAT.QC diff --git a/QC_rogue/DEFS.QC b/QC_other/QC_rogue/DEFS.QC similarity index 100% rename from QC_rogue/DEFS.QC rename to QC_other/QC_rogue/DEFS.QC diff --git a/QC_rogue/DEMON.QC b/QC_other/QC_rogue/DEMON.QC similarity index 100% rename from QC_rogue/DEMON.QC rename to QC_other/QC_rogue/DEMON.QC diff --git a/QC_rogue/DMATCH.QC b/QC_other/QC_rogue/DMATCH.QC similarity index 100% rename from QC_rogue/DMATCH.QC rename to QC_other/QC_rogue/DMATCH.QC diff --git a/QC_rogue/DOG.QC b/QC_other/QC_rogue/DOG.QC similarity index 100% rename from QC_rogue/DOG.QC rename to QC_other/QC_rogue/DOG.QC diff --git a/QC_rogue/DOORS.QC b/QC_other/QC_rogue/DOORS.QC similarity index 100% rename from QC_rogue/DOORS.QC rename to QC_other/QC_rogue/DOORS.QC diff --git a/QC_rogue/DRAGON.QC b/QC_other/QC_rogue/DRAGON.QC similarity index 100% rename from QC_rogue/DRAGON.QC rename to QC_other/QC_rogue/DRAGON.QC diff --git a/QC_rogue/EARTHQ.QC b/QC_other/QC_rogue/EARTHQ.QC similarity index 100% rename from QC_rogue/EARTHQ.QC rename to QC_other/QC_rogue/EARTHQ.QC diff --git a/QC_rogue/EEL.QC b/QC_other/QC_rogue/EEL.QC similarity index 100% rename from QC_rogue/EEL.QC rename to QC_other/QC_rogue/EEL.QC diff --git a/QC_rogue/ELEVATR.QC b/QC_other/QC_rogue/ELEVATR.QC similarity index 100% rename from QC_rogue/ELEVATR.QC rename to QC_other/QC_rogue/ELEVATR.QC diff --git a/QC_rogue/ENDING.QC b/QC_other/QC_rogue/ENDING.QC similarity index 100% rename from QC_rogue/ENDING.QC rename to QC_other/QC_rogue/ENDING.QC diff --git a/QC_rogue/ENFORCER.QC b/QC_other/QC_rogue/ENFORCER.QC similarity index 95% rename from QC_rogue/ENFORCER.QC rename to QC_other/QC_rogue/ENFORCER.QC index 9b37d873..f538024e 100644 --- a/QC_rogue/ENFORCER.QC +++ b/QC_other/QC_rogue/ENFORCER.QC @@ -257,31 +257,12 @@ void(entity attacker, float damage) enf_pain = //============================================================================ -void() EnforcerDrop = -{ - local entity entPlayer; - entPlayer = FindEntPlayerForDrop(); - - self.solid = SOLID_NOT; - self.ammo_cells = 5; - DropBackpack(); - if(entPlayer != world && random() > 0.65) - { - if(!TryDrop(entPlayer, WID_LASER_CANNON, 0.4)) - if(!TryDrop(entPlayer, WID_SUPER_NAILGUN, 0.4)) - if(!TryDrop(entPlayer, WID_NAILGUN, 0.5)) - if(!TryDrop(entPlayer, WID_SUPER_SHOTGUN, 0.2)) - if(!TryDrop(entPlayer, WID_SHOTGUN, 0.2)) - if(!TryDrop(entPlayer, WID_AXE, 0.2)) - { /* Intentionally empty. */ } - } -} void() enf_die1 =[ $death1, enf_die2 ] {}; void() enf_die2 =[ $death2, enf_die3 ] {}; void() enf_die3 =[ $death3, enf_die4 ] -{EnforcerDrop();}; +{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();}; void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);}; void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);}; void() enf_die6 =[ $death6, enf_die7 ] {}; @@ -299,7 +280,7 @@ void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] { }; void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {}; void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] -{EnforcerDrop();}; +{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();}; void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {}; void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {}; void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {}; diff --git a/QC_rogue/FIGHT.QC b/QC_other/QC_rogue/FIGHT.QC similarity index 99% rename from QC_rogue/FIGHT.QC rename to QC_other/QC_rogue/FIGHT.QC index f1c23cbb..9baf5360 100644 --- a/QC_rogue/FIGHT.QC +++ b/QC_other/QC_rogue/FIGHT.QC @@ -70,6 +70,7 @@ float() CheckAttack = if (trace_ent != targ) return FALSE; // don't have a clear shot + if (trace_inopen && trace_inwater) return FALSE; // sight line crossed contents @@ -405,3 +406,4 @@ float() OgreCheckAttack = SUB_AttackFinished (1 + 2*random()); return TRUE; }; + diff --git a/QC_other/QC_rogue/FIGHT.QC.bak b/QC_other/QC_rogue/FIGHT.QC.bak new file mode 100644 index 00000000..386f8bb4 --- /dev/null +++ b/QC_other/QC_rogue/FIGHT.QC.bak @@ -0,0 +1,408 @@ + +/* + +A monster is in fight mode if it thinks it can effectively attack its +enemy. + +When it decides it can't attack, it goes into hunt mode. + +*/ + +float(float v) anglemod; + +void() knight_atk1; +void() knight_runatk1; +void() ogre_smash1; +void() ogre_swing1; + +void() sham_smash1; +void() sham_swingr1; +void() sham_swingl1; + +float() DemonCheckAttack; +void(float side) Demon_Melee; + +void(vector dest) ChooseTurn; + +void() ai_face; + + +float enemy_vis, enemy_infront, enemy_range; +float enemy_yaw; + + +void() knight_attack = +{ + local float len; + +// decide if now is a good swing time + len = vlen(self.enemy.origin+self.enemy.view_ofs - (self.origin+self.view_ofs)); + + if (len<80) + knight_atk1 (); + else + knight_runatk1 (); +}; + +//============================================================================= + +/* +=========== +CheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() CheckAttack = +{ + local vector spot1, spot2; + local entity targ; + local float chance; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, FALSE, self); + + if (trace_ent != targ) + return FALSE; // don't have a clear shot + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (enemy_range == RANGE_MELEE) + { // melee attack + if (self.th_melee) + { + if (self.classname == "monster_knight") + knight_attack (); + else + self.th_melee (); + return TRUE; + } + } + +// missile attack + if (!self.th_missile) + return FALSE; + + if (time < self.attack_finished) + return FALSE; + + if (enemy_range == RANGE_FAR) + return FALSE; + + if (enemy_range == RANGE_MELEE) + { + chance = 0.9; + self.attack_finished = 0; + } + else if (enemy_range == RANGE_NEAR) + { + if (self.th_melee) + chance = 0.2; + else + chance = 0.4; + } + else if (enemy_range == RANGE_MID) + { + if (self.th_melee) + chance = 0.05; + else + chance = 0.1; + } + else + chance = 0; + + if (random () < chance) + { + self.th_missile (); + SUB_AttackFinished (2*random()); + return TRUE; + } + + return FALSE; +}; + + +/* +============= +ai_face + +Stay facing the enemy +============= +*/ +void() ai_face = +{ + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); +}; + +/* +============= +ai_charge + +The monster is in a melee attack, so get as close as possible to .enemy +============= +*/ +float (entity targ) visible; +float(entity targ) infront; +float(entity targ) range; + +void(float d) ai_charge = +{ + ai_face (); + movetogoal (d); // done in C code... +}; + +void() ai_charge_side = +{ + local vector dtemp; + local float heading; + +// aim to the left of the enemy for a flyby + + self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); + ChangeYaw (); + + makevectors (self.angles); + dtemp = self.enemy.origin - 30*v_right; + heading = vectoyaw(dtemp - self.origin); + + walkmove(heading, 20); +}; + + +/* +============= +ai_melee + +============= +*/ +void() ai_melee = +{ + local vector delta; + local float ldmg; + + if (!self.enemy) + return; // removed before stroke + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 60) + return; + + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg); +}; + + +void() ai_melee_side = +{ + local vector delta; + local float ldmg; + + if (!self.enemy) + return; // removed before stroke + + ai_charge_side(); + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > 60) + return; + if (!CanDamage (self.enemy, self)) + return; + ldmg = (random() + random() + random()) * 3; + T_Damage (self.enemy, self, self, ldmg); +}; + + +//============================================================================= + +/* +=========== +SoldierCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() SoldierCheckAttack = +{ + local vector spot1, spot2; + local entity targ; + local float chance; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, FALSE, self); + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (trace_ent != targ) + return FALSE; // don't have a clear shot + + +// missile attack + if (time < self.attack_finished) + return FALSE; + + if (enemy_range == RANGE_FAR) + return FALSE; + + if (enemy_range == RANGE_MELEE) + chance = 0.9; + else if (enemy_range == RANGE_NEAR) + chance = 0.4; + else if (enemy_range == RANGE_MID) + chance = 0.05; + else + chance = 0; + + if (random () < chance) + { + self.th_missile (); + SUB_AttackFinished (1 + random()); + if (random() < 0.3) + self.lefty = !self.lefty; + + return TRUE; + } + + return FALSE; +}; +//============================================================================= + +/* +=========== +ShamCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() ShamCheckAttack = +{ + local vector spot1, spot2; + local entity targ; + local float chance; + local float enemy_yaw; + + if (enemy_range == RANGE_MELEE) + { + if (CanDamage (self.enemy, self)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if (time < self.attack_finished) + return FALSE; + + if (!enemy_vis) + return FALSE; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + if (vlen(spot1 - spot2) > 600) + return FALSE; + + traceline (spot1, spot2, FALSE, self); + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (trace_ent != targ) + { + return FALSE; // don't have a clear shot + } + +// missile attack + if (enemy_range == RANGE_FAR) + return FALSE; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (2 + 2*random()); + return TRUE; +}; + +//============================================================================ + +/* +=========== +OgreCheckAttack + +The player is in view, so decide to move or launch an attack +Returns FALSE if movement should continue +============ +*/ +float() OgreCheckAttack = +{ + local vector spot1, spot2; + local entity targ; + local float chance; + + if (enemy_range == RANGE_MELEE) + { + if (CanDamage (self.enemy, self)) + { + self.attack_state = AS_MELEE; + return TRUE; + } + } + + if (time < self.attack_finished) + return FALSE; + + if (!enemy_vis) + return FALSE; + + targ = self.enemy; + +// see if any entities are in the way of the shot + spot1 = self.origin + self.view_ofs; + spot2 = targ.origin + targ.view_ofs; + + traceline (spot1, spot2, FALSE, self); + + if (trace_inopen && trace_inwater) + return FALSE; // sight line crossed contents + + if (trace_ent != targ) + { + return FALSE; // don't have a clear shot + } + +// missile attack + if (time < self.attack_finished) + return FALSE; + + if (enemy_range == RANGE_FAR) + return FALSE; + + else if (enemy_range == RANGE_NEAR) + chance = 0.10; + else if (enemy_range == RANGE_MID) + chance = 0.05; + else + chance = 0; + + self.attack_state = AS_MISSILE; + SUB_AttackFinished (1 + 2*random()); + return TRUE; +}; diff --git a/QC_rogue/FILES.DAT b/QC_other/QC_rogue/FILES.DAT similarity index 100% rename from QC_rogue/FILES.DAT rename to QC_other/QC_rogue/FILES.DAT diff --git a/QC_rogue/FISH.QC b/QC_other/QC_rogue/FISH.QC similarity index 100% rename from QC_rogue/FISH.QC rename to QC_other/QC_rogue/FISH.QC diff --git a/QC_rogue/GRAPPLE.QC b/QC_other/QC_rogue/GRAPPLE.QC similarity index 100% rename from QC_rogue/GRAPPLE.QC rename to QC_other/QC_rogue/GRAPPLE.QC diff --git a/QC_rogue/INVIS_SW.QC b/QC_other/QC_rogue/INVIS_SW.QC similarity index 100% rename from QC_rogue/INVIS_SW.QC rename to QC_other/QC_rogue/INVIS_SW.QC diff --git a/QC_rogue/ITEMS.QC b/QC_other/QC_rogue/ITEMS.QC similarity index 100% rename from QC_rogue/ITEMS.QC rename to QC_other/QC_rogue/ITEMS.QC diff --git a/QC_rogue/KNIGHT.QC b/QC_other/QC_rogue/KNIGHT.QC similarity index 100% rename from QC_rogue/KNIGHT.QC rename to QC_other/QC_rogue/KNIGHT.QC diff --git a/QC_rogue/LAVAMAN.QC b/QC_other/QC_rogue/LAVAMAN.QC similarity index 100% rename from QC_rogue/LAVAMAN.QC rename to QC_other/QC_rogue/LAVAMAN.QC diff --git a/QC_rogue/LAVA_WPN.QC b/QC_other/QC_rogue/LAVA_WPN.QC similarity index 100% rename from QC_rogue/LAVA_WPN.QC rename to QC_other/QC_rogue/LAVA_WPN.QC diff --git a/QC_rogue/LIGHTNIN.QC b/QC_other/QC_rogue/LIGHTNIN.QC similarity index 100% rename from QC_rogue/LIGHTNIN.QC rename to QC_other/QC_rogue/LIGHTNIN.QC diff --git a/QC_rogue/MISC.QC b/QC_other/QC_rogue/MISC.QC similarity index 100% rename from QC_rogue/MISC.QC rename to QC_other/QC_rogue/MISC.QC diff --git a/QC_rogue/MONSTERS.QC b/QC_other/QC_rogue/MONSTERS.QC similarity index 100% rename from QC_rogue/MONSTERS.QC rename to QC_other/QC_rogue/MONSTERS.QC diff --git a/QC_rogue/MORPH.QC b/QC_other/QC_rogue/MORPH.QC similarity index 100% rename from QC_rogue/MORPH.QC rename to QC_other/QC_rogue/MORPH.QC diff --git a/QC_rogue/MOTD.QC b/QC_other/QC_rogue/MOTD.QC similarity index 100% rename from QC_rogue/MOTD.QC rename to QC_other/QC_rogue/MOTD.QC diff --git a/QC_rogue/MULT_WPN.QC b/QC_other/QC_rogue/MULT_WPN.QC similarity index 100% rename from QC_rogue/MULT_WPN.QC rename to QC_other/QC_rogue/MULT_WPN.QC diff --git a/QC_rogue/MUMMY.QC b/QC_other/QC_rogue/MUMMY.QC similarity index 100% rename from QC_rogue/MUMMY.QC rename to QC_other/QC_rogue/MUMMY.QC diff --git a/QC_rogue/NEWITEMS.QC b/QC_other/QC_rogue/NEWITEMS.QC similarity index 100% rename from QC_rogue/NEWITEMS.QC rename to QC_other/QC_rogue/NEWITEMS.QC diff --git a/QC_rogue/NEWMISC.QC b/QC_other/QC_rogue/NEWMISC.QC similarity index 100% rename from QC_rogue/NEWMISC.QC rename to QC_other/QC_rogue/NEWMISC.QC diff --git a/QC_rogue/NEWPLATS.QC b/QC_other/QC_rogue/NEWPLATS.QC similarity index 99% rename from QC_rogue/NEWPLATS.QC rename to QC_other/QC_rogue/NEWPLATS.QC index 31f62e45..c609e1aa 100644 --- a/QC_rogue/NEWPLATS.QC +++ b/QC_other/QC_rogue/NEWPLATS.QC @@ -11,7 +11,7 @@ float START_AT_TOP = 8; float PLAT2 = 16; float PLAT2_BOTTOM = 32; -float ELV_BUTN_DIR = 0; +float ELV_BUTN_DIR; // ================================== // down N and wait code diff --git a/QC_rogue/NEW_AI.QC b/QC_other/QC_rogue/NEW_AI.QC similarity index 100% rename from QC_rogue/NEW_AI.QC rename to QC_other/QC_rogue/NEW_AI.QC diff --git a/QC_rogue/OGRE.QC b/QC_other/QC_rogue/OGRE.QC similarity index 100% rename from QC_rogue/OGRE.QC rename to QC_other/QC_rogue/OGRE.QC diff --git a/QC_rogue/OLDONE.QC b/QC_other/QC_rogue/OLDONE.QC similarity index 100% rename from QC_rogue/OLDONE.QC rename to QC_other/QC_rogue/OLDONE.QC diff --git a/QC_rogue/PENDULUM.QC b/QC_other/QC_rogue/PENDULUM.QC similarity index 100% rename from QC_rogue/PENDULUM.QC rename to QC_other/QC_rogue/PENDULUM.QC diff --git a/QC_rogue/PLATS.QC b/QC_other/QC_rogue/PLATS.QC similarity index 100% rename from QC_rogue/PLATS.QC rename to QC_other/QC_rogue/PLATS.QC diff --git a/QC_rogue/PLAYER.QC b/QC_other/QC_rogue/PLAYER.QC similarity index 100% rename from QC_rogue/PLAYER.QC rename to QC_other/QC_rogue/PLAYER.QC diff --git a/QC_rogue/PROGDEFS.H b/QC_other/QC_rogue/PROGDEFS.H similarity index 100% rename from QC_rogue/PROGDEFS.H rename to QC_other/QC_rogue/PROGDEFS.H diff --git a/QC_rogue/PROGS.SRC b/QC_other/QC_rogue/PROGS.SRC similarity index 100% rename from QC_rogue/PROGS.SRC rename to QC_other/QC_rogue/PROGS.SRC diff --git a/QC_rogue/RANDOM.QC b/QC_other/QC_rogue/RANDOM.QC similarity index 100% rename from QC_rogue/RANDOM.QC rename to QC_other/QC_rogue/RANDOM.QC diff --git a/QC_rogue/RUNES.QC b/QC_other/QC_rogue/RUNES.QC similarity index 100% rename from QC_rogue/RUNES.QC rename to QC_other/QC_rogue/RUNES.QC diff --git a/QC_rogue/SHALRATH.QC b/QC_other/QC_rogue/SHALRATH.QC similarity index 100% rename from QC_rogue/SHALRATH.QC rename to QC_other/QC_rogue/SHALRATH.QC diff --git a/QC_rogue/SHAMBLER.QC b/QC_other/QC_rogue/SHAMBLER.QC similarity index 100% rename from QC_rogue/SHAMBLER.QC rename to QC_other/QC_rogue/SHAMBLER.QC diff --git a/QC_rogue/SHIELD.QC b/QC_other/QC_rogue/SHIELD.QC similarity index 100% rename from QC_rogue/SHIELD.QC rename to QC_other/QC_rogue/SHIELD.QC diff --git a/QC_rogue/SOLDIER.QC b/QC_other/QC_rogue/SOLDIER.QC similarity index 100% rename from QC_rogue/SOLDIER.QC rename to QC_other/QC_rogue/SOLDIER.QC diff --git a/QC_rogue/SPHERE.QC b/QC_other/QC_rogue/SPHERE.QC similarity index 100% rename from QC_rogue/SPHERE.QC rename to QC_other/QC_rogue/SPHERE.QC diff --git a/QC_rogue/SPRITES.QC b/QC_other/QC_rogue/SPRITES.QC similarity index 100% rename from QC_rogue/SPRITES.QC rename to QC_other/QC_rogue/SPRITES.QC diff --git a/QC_rogue/SUBS.QC b/QC_other/QC_rogue/SUBS.QC similarity index 100% rename from QC_rogue/SUBS.QC rename to QC_other/QC_rogue/SUBS.QC diff --git a/QC_rogue/S_WRATH.QC b/QC_other/QC_rogue/S_WRATH.QC similarity index 100% rename from QC_rogue/S_WRATH.QC rename to QC_other/QC_rogue/S_WRATH.QC diff --git a/QC_rogue/TARBABY.QC b/QC_other/QC_rogue/TARBABY.QC similarity index 100% rename from QC_rogue/TARBABY.QC rename to QC_other/QC_rogue/TARBABY.QC diff --git a/QC_rogue/TEAMPLAY.QC b/QC_other/QC_rogue/TEAMPLAY.QC similarity index 100% rename from QC_rogue/TEAMPLAY.QC rename to QC_other/QC_rogue/TEAMPLAY.QC diff --git a/QC_rogue/TIMEMACH.QC b/QC_other/QC_rogue/TIMEMACH.QC similarity index 100% rename from QC_rogue/TIMEMACH.QC rename to QC_other/QC_rogue/TIMEMACH.QC diff --git a/QC_rogue/TRIGGERS.QC b/QC_other/QC_rogue/TRIGGERS.QC similarity index 100% rename from QC_rogue/TRIGGERS.QC rename to QC_other/QC_rogue/TRIGGERS.QC diff --git a/QC_rogue/WEAPONS.QC b/QC_other/QC_rogue/WEAPONS.QC similarity index 99% rename from QC_rogue/WEAPONS.QC rename to QC_other/QC_rogue/WEAPONS.QC index d25dea71..e8d81c92 100644 --- a/QC_rogue/WEAPONS.QC +++ b/QC_other/QC_rogue/WEAPONS.QC @@ -1311,7 +1311,8 @@ void() CheatCommand = IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | - IT_LAVA_NAILGUN | + + IT_LAVA_NAILGUN | IT_LAVA_SUPER_NAILGUN | IT_MULTI_GRENADE | IT_MULTI_ROCKET | diff --git a/QC_rogue/WIZARD.QC b/QC_other/QC_rogue/WIZARD.QC similarity index 100% rename from QC_rogue/WIZARD.QC rename to QC_other/QC_rogue/WIZARD.QC diff --git a/QC_rogue/WORLD.QC b/QC_other/QC_rogue/WORLD.QC similarity index 100% rename from QC_rogue/WORLD.QC rename to QC_other/QC_rogue/WORLD.QC diff --git a/QC_rogue/WRATH.QC b/QC_other/QC_rogue/WRATH.QC similarity index 100% rename from QC_rogue/WRATH.QC rename to QC_other/QC_rogue/WRATH.QC diff --git a/QC_rogue/ZOMBIE.QC b/QC_other/QC_rogue/ZOMBIE.QC similarity index 100% rename from QC_rogue/ZOMBIE.QC rename to QC_other/QC_rogue/ZOMBIE.QC diff --git a/QC_rogue/HKNIGHT.QC b/QC_other/QC_rogue/hknight.qc similarity index 100% rename from QC_rogue/HKNIGHT.QC rename to QC_other/QC_rogue/hknight.qc diff --git a/QC_other/QC_rogue/rogue_to_merge.md b/QC_other/QC_rogue/rogue_to_merge.md new file mode 100644 index 00000000..343384e4 --- /dev/null +++ b/QC_other/QC_rogue/rogue_to_merge.md @@ -0,0 +1,20 @@ +rogue to merge: +X * ai.qc (DONE) +X * defs.qc (DONE) +X * client.qc (DONE) +X * combat.qc (DONE) +X * doors.qc (DONE) +X * enforcer.qc (DONE) +X * hknight.qc (DONE) +X * items.qc (DONE) +X * knight.qc (DONE) +X * misc.qc (DONE) +X * monsters.qc (DONE) +X * ogre.qc (DONE) +X * player.qc (DONE) +X * progs.src (DONE) +X * tarbaby.qc (DONE) +X * triggers.qc (DONE) +X * weapons.qc (DONE) +X * world.qc (DONE) +X * zombie.qc (DONE) diff --git a/Quake/Makefile b/Quake/Makefile deleted file mode 100644 index fe1ae833..00000000 --- a/Quake/Makefile +++ /dev/null @@ -1,304 +0,0 @@ -# GNU Makefile for QuakeSpasm unix targets. -# You need the SDL library fully installed. -# "make DEBUG=1" to build a debug client. -# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. -# "make DO_USERDIRS=1" to enable user directories support - -# Enable/Disable user directories support -DO_USERDIRS=0 - -### Enable/Disable SDL2 -USE_SDL2=0 - -### Enable/Disable codecs for streaming music support -USE_CODEC_WAVE=1 -USE_CODEC_FLAC=0 -USE_CODEC_MP3=1 -USE_CODEC_VORBIS=1 -USE_CODEC_OPUS=0 -# either mikmod or xmp -USE_CODEC_MIKMOD=0 -USE_CODEC_XMP=0 -USE_CODEC_UMX=0 - -# which library to use for mp3 decoding: mad or mpg123 -MP3LIB=mad -# which library to use for ogg decoding: vorbis or tremor -VORBISLIB=vorbis - -# --------------------------- -# Helper functions -# --------------------------- - -check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;) - -# --------------------------- - -HOST_OS := $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]') - -DEBUG ?= 0 - -# --------------------------- -# build variables -# --------------------------- - -CC ?= gcc -LINKER = $(CC) - -STRIP ?= strip - -#CPUFLAGS= -mtune=i686 -#CPUFLAGS= -march=pentium4 -#CPUFLAGS= -mtune=k8 -#CPUFLAGS= -march=atom -CPUFLAGS= -LDFLAGS = -DFLAGS ?= -CFLAGS ?= -Wall -Wno-trigraphs -CFLAGS += $(CPUFLAGS) -ifneq ($(DEBUG),0) -DFLAGS += -DDEBUG -CFLAGS += -g -do_strip= -else -DFLAGS += -DNDEBUG -CFLAGS += -O2 -CFLAGS += $(call check_gcc,-fweb,) -CFLAGS += $(call check_gcc,-frename-registers,) -cmd_strip=$(STRIP) $(1) -define do_strip - $(call cmd_strip,$(1)); -endef -endif - -ifeq ($(DO_USERDIRS),1) -CFLAGS += -DDO_USERDIRS=1 -endif - -### X11BASE only gets used if its in an unusual place - -X11DIRS := /usr/X11R7 /usr/local/X11R7 /usr/X11R6 /usr/local/X11R6 -X11BASE_GUESS := $(shell \ - if [ -e /usr/include/X11/Xlib.h ] && \ - [ -e /usr/lib/libX11.a ]; then exit 0; fi; \ - if [ -e /usr/local/include/X11/Xlib.h ] && \ - [ -e /usr/local/lib/libX11.a ]; then exit 0; fi; \ - for DIR in $(X11DIRS); do \ - if [ -e $$DIR/include/X11/Xlib.h ] && \ - [ -e $$DIR/lib/libX11.a ]; then echo $$DIR; break; fi; \ - done ) - -X11BASE ?= $(X11BASE_GUESS) - -ifneq ($(X11BASE),) -LDFLAGS+= -L$(X11BASE)/lib -CFLAGS += -I$(X11BASE)/include -endif - -ifeq ($(USE_SDL2),1) -CFLAGS += -DUSE_SDL2 -endif - -ifeq ($(USE_SDL2),1) -SDL_CONFIG ?= sdl2-config -else -SDL_CONFIG ?= sdl-config -endif -SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -SDL_LIBS := $(shell $(SDL_CONFIG) --libs) - -ifeq ($(HOST_OS),sunos) -NET_LIBS :=-lsocket -lnsl -lresolv -else -NET_LIBS := -endif - -ifneq ($(VORBISLIB),vorbis) -ifneq ($(VORBISLIB),tremor) -$(error Invalid VORBISLIB setting) -endif -endif -ifneq ($(MP3LIB),mpg123) -ifneq ($(MP3LIB),mad) -$(error Invalid MP3LIB setting) -endif -endif -ifeq ($(MP3LIB),mad) -mp3_obj=snd_mp3 -lib_mp3dec=-lmad -endif -ifeq ($(MP3LIB),mpg123) -mp3_obj=snd_mpg123 -lib_mp3dec=-lmpg123 -endif -ifeq ($(VORBISLIB),vorbis) -cpp_vorbisdec= -lib_vorbisdec=-lvorbisfile -lvorbis -logg -endif -ifeq ($(VORBISLIB),tremor) -cpp_vorbisdec=-DVORBIS_USE_TREMOR -lib_vorbisdec=-lvorbisidec -logg -endif - -CODECLIBS := -ifeq ($(USE_CODEC_WAVE),1) -CFLAGS+= -DUSE_CODEC_WAVE -endif -ifeq ($(USE_CODEC_FLAC),1) -CFLAGS+= -DUSE_CODEC_FLAC -CODECLIBS+= -lFLAC -endif -ifeq ($(USE_CODEC_OPUS),1) -# opus and opusfile put their *.h under <includedir>/opus, -# but they include the headers without the opus directory -# prefix and rely on pkg-config. ewww... -CFLAGS+= -DUSE_CODEC_OPUS -CFLAGS+= $(shell pkg-config --cflags opusfile) -CODECLIBS+= $(shell pkg-config --libs opusfile) -endif -ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) -CODECLIBS+= $(lib_vorbisdec) -endif -ifeq ($(USE_CODEC_MP3),1) -CFLAGS+= -DUSE_CODEC_MP3 -CODECLIBS+= $(lib_mp3dec) -endif -ifeq ($(USE_CODEC_MIKMOD),1) -CFLAGS+= -DUSE_CODEC_MIKMOD -CODECLIBS+= -lmikmod -endif -ifeq ($(USE_CODEC_XMP),1) -CFLAGS+= -DUSE_CODEC_XMP -CODECLIBS+= -lxmp -endif -ifeq ($(USE_CODEC_UMX),1) -CFLAGS+= -DUSE_CODEC_UMX -endif - -COMMON_LIBS:= -lm -lGL - -LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS) - -# --------------------------- -# targets -# --------------------------- - -.PHONY: clean debug release - -DEFAULT_TARGET := quakespasm - -# --------------------------- -# rules -# --------------------------- - -%.o: %.c - $(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $< - -# ---------------------------------------------------------------------------- -# objects -# ---------------------------------------------------------------------------- - -MUSIC_OBJS:= bgmusic.o \ - snd_codec.o \ - snd_flac.o \ - snd_wave.o \ - snd_vorbis.o \ - snd_opus.o \ - $(mp3_obj).o \ - snd_mp3tag.o \ - snd_mikmod.o \ - snd_xmp.o \ - snd_umx.o -COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS) -SYSOBJ_SND := snd_sdl.o -SYSOBJ_CDA := cd_sdl.o -SYSOBJ_INPUT := in_sdl.o -SYSOBJ_GL_VID:= gl_vidsdl.o -SYSOBJ_NET := net_bsd.o net_udp.o -SYSOBJ_SYS := pl_linux.o sys_sdl_unix.o -SYSOBJ_MAIN:= main_sdl.o -SYSOBJ_RES := - -GLOBJS = \ - gl_refrag.o \ - gl_rlight.o \ - gl_rmain.o \ - gl_fog.o \ - gl_rmisc.o \ - r_part.o \ - r_world.o \ - gl_screen.o \ - gl_sky.o \ - gl_warp.o \ - $(SYSOBJ_GL_VID) \ - gl_draw.o \ - image.o \ - gl_texmgr.o \ - gl_mesh.o \ - r_sprite.o \ - r_alias.o \ - r_brush.o \ - gl_model.o - -OBJS := strlcat.o \ - strlcpy.o \ - $(GLOBJS) \ - $(SYSOBJ_INPUT) \ - $(COMOBJ_SND) \ - $(SYSOBJ_SND) \ - $(SYSOBJ_CDA) \ - $(SYSOBJ_NET) \ - net_dgrm.o \ - net_loop.o \ - net_main.o \ - chase.o \ - cl_demo.o \ - cl_input.o \ - cl_main.o \ - cl_parse.o \ - cl_tent.o \ - console.o \ - keys.o \ - menu.o \ - sbar.o \ - view.o \ - wad.o \ - cmd.o \ - common.o \ - crc.o \ - cvar.o \ - cfgfile.o \ - host.o \ - host_cmd.o \ - mathlib.o \ - pr_cmds.o \ - pr_edict.o \ - pr_exec.o \ - sv_main.o \ - sv_move.o \ - sv_phys.o \ - sv_user.o \ - world.o \ - zone.o \ - $(SYSOBJ_SYS) $(SYSOBJ_MAIN) $(SYSOBJ_RES) - -# ------------------------ -# Linux build rules -# ------------------------ - -quakespasm: $(OBJS) - $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ - $(call do_strip,$@) - -image.o: lodepng.c lodepng.h stb_image_write.h - -release: quakespasm -debug: - $(error Use "make DEBUG=1") - -clean: - rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print) - -install: quakespasm - cp quakespasm /usr/local/games/quake diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin deleted file mode 100644 index aaad1967..00000000 --- a/Quake/Makefile.darwin +++ /dev/null @@ -1,328 +0,0 @@ -# GNU Makefile for compiling Mac OS X version of QuakeSpasm. -# Usage: "make -f Makefile.darwin" -# To cross-compile on Linux hosts, see the build_cross_osx*.sh scripts. -# "make DEBUG=1" to build a debug client. -# "make SDL_FRAMEWORK_PATH=/path/to/Frameworks" to specify the directory -# containing SDL.framework and override the locally included versions. -# "make DO_USERDIRS=1" to enable user directories support - -# Enable/Disable user directories support -DO_USERDIRS=0 - -### Enable/Disable SDL2 -USE_SDL2=0 - -### Enable/Disable codecs for streaming music support -USE_CODEC_WAVE=1 -USE_CODEC_FLAC=1 -USE_CODEC_MP3=1 -USE_CODEC_VORBIS=1 -USE_CODEC_OPUS=1 -# either mikmod or xmp -USE_CODEC_MIKMOD=1 -USE_CODEC_XMP=0 -USE_CODEC_UMX=1 - -# which library to use for mp3 decoding: mad or mpg123 -MP3LIB=mad -# which library to use for ogg decoding: vorbis or tremor -VORBISLIB=vorbis - -# --------------------------- -# Helper functions -# --------------------------- - -check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;) - -# --------------------------- - -HOST_OS := $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]') -MACH_TYPE= $(shell sh detect.sh arch) - -DEBUG ?= 0 - -# --------------------------- -# build variables -# --------------------------- - -CC ?= gcc -LINKER = $(CC) -LIPO ?= lipo - -STRIP ?= strip - -CPUFLAGS= -LDFLAGS = -DFLAGS ?= -CFLAGS ?= -Wall -# @rpath can be used when targeting 10.5+ -USE_RPATH=0 -# require 10.5 for 64 bit builds -ifeq ($(MACH_TYPE),ppc64) -CFLAGS +=-mmacosx-version-min=10.5 -LDFLAGS +=-mmacosx-version-min=10.5 -USE_RPATH=1 -endif -ifeq ($(USE_SDL2),1) -# sdl2 needs targetting 10.5+ -# as of v2.0.5, sdl2 targets 10.6+ -ifeq ($(MACH_TYPE),x86) -CFLAGS +=-mmacosx-version-min=10.6 -LDFLAGS +=-mmacosx-version-min=10.6 -USE_RPATH=1 -endif -endif -ifeq ($(MACH_TYPE),x86_64) -# require 10.6 for amd64 builds, not 10.5 (SDL's requirement.) -# bundle1.o is needed for dyld_stub_binding_helper -CFLAGS +=-mmacosx-version-min=10.6 -LDFLAGS +=-mmacosx-version-min=10.6 -Wl,-lbundle1.o -USE_RPATH=1 -endif -CFLAGS += $(CPUFLAGS) -ifeq ($(USE_RPATH),1) -LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks -endif - -ifneq ($(DEBUG),0) -DFLAGS += -DDEBUG -CFLAGS += -g -do_strip= -else -DFLAGS += -DNDEBUG -CFLAGS += -O2 -CFLAGS += $(call check_gcc,-fweb,) -CFLAGS += $(call check_gcc,-frename-registers,) -cmd_strip=$(STRIP) $(1) -define do_strip - $(call cmd_strip,$(1)); -endef -endif - -ifeq ($(DO_USERDIRS),1) -CFLAGS += -DDO_USERDIRS=1 -endif - -ifeq ($(USE_SDL2),1) -CFLAGS += -DUSE_SDL2 -endif - -# not relying on sdl-config command and assuming -# /Library/Frameworks/SDL.framework is available -SDL_CFLAGS =-D_GNU_SOURCE=1 -D_THREAD_SAFE -SDL_CFLAGS+=-DSDL_FRAMEWORK -DNO_SDL_CONFIG -ifeq ($(USE_SDL2),1) -SDL_FRAMEWORK_NAME = SDL2 -else -SDL_FRAMEWORK_NAME = SDL -endif -# default to our local SDL[2].framework for build -SDL_FRAMEWORK_PATH ?=../MacOSX -ifneq ($(SDL_FRAMEWORK_PATH),) -SDL_LIBS +=-F$(SDL_FRAMEWORK_PATH) -SDL_CFLAGS+=-F$(SDL_FRAMEWORK_PATH) -endif -SDL_LIBS +=-Wl,-framework,$(SDL_FRAMEWORK_NAME) -Wl,-framework,Cocoa - -NET_LIBS := - -ifneq ($(VORBISLIB),vorbis) -ifneq ($(VORBISLIB),tremor) -$(error Invalid VORBISLIB setting) -endif -endif -ifneq ($(MP3LIB),mpg123) -ifneq ($(MP3LIB),mad) -$(error Invalid MP3LIB setting) -endif -endif -ifeq ($(MP3LIB),mad) -mp3_obj=snd_mp3 -lib_mp3dec=-lmad -endif -ifeq ($(MP3LIB),mpg123) -mp3_obj=snd_mpg123 -lib_mp3dec=-lmpg123 -endif -ifeq ($(VORBISLIB),vorbis) -cpp_vorbisdec= -lib_vorbisdec=-lvorbisfile -lvorbis -logg -endif -ifeq ($(VORBISLIB),tremor) -cpp_vorbisdec=-DVORBIS_USE_TREMOR -lib_vorbisdec=-lvorbisidec -logg -endif - -CODECLIBS := -ifeq ($(USE_CODEC_WAVE),1) -CFLAGS+= -DUSE_CODEC_WAVE -endif -ifeq ($(USE_CODEC_FLAC),1) -CFLAGS+= -DUSE_CODEC_FLAC -CODEC_INC = -I../MacOSX/codecs/include -CODEC_LINK= -L../MacOSX/codecs/lib -CODECLIBS+= -lFLAC -endif -ifeq ($(USE_CODEC_OPUS),1) -CFLAGS+= -DUSE_CODEC_OPUS -CODEC_INC = -I../MacOSX/codecs/include -CODEC_LINK= -L../MacOSX/codecs/lib -CODECLIBS+= -lopusfile -lopus -logg -endif -ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) -CODEC_INC = -I../MacOSX/codecs/include -CODEC_LINK= -L../MacOSX/codecs/lib -CODECLIBS+= $(lib_vorbisdec) -endif -ifeq ($(USE_CODEC_MP3),1) -CFLAGS+= -DUSE_CODEC_MP3 -CODEC_INC = -I../MacOSX/codecs/include -CODEC_LINK= -L../MacOSX/codecs/lib -CODECLIBS+= $(lib_mp3dec) -endif -ifeq ($(USE_CODEC_MIKMOD),1) -CFLAGS+= -DUSE_CODEC_MIKMOD -CODEC_INC = -I../MacOSX/codecs/include -CODEC_LINK= -L../MacOSX/codecs/lib -CODECLIBS+= -lmikmod -endif -ifeq ($(USE_CODEC_XMP),1) -CFLAGS+= -DUSE_CODEC_XMP -CODEC_INC = -I../MacOSX/codecs/include -CODEC_LINK= -L../MacOSX/codecs/lib -CODECLIBS+= -lxmp -endif -ifeq ($(USE_CODEC_UMX),1) -CFLAGS+= -DUSE_CODEC_UMX -endif -CFLAGS+= $(CODEC_INC) - -COMMON_LIBS:= -Wl,-framework,IOKit -Wl,-framework,OpenGL - -LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODEC_LINK) $(CODECLIBS) - -# --------------------------- -# targets -# --------------------------- - -.PHONY: clean debug release - -DEFAULT_TARGET := quakespasm - -# --------------------------- -# rules -# --------------------------- - -%.o: %.c - $(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $< -%.o: %.m - $(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $< -%.o: ../MacOSX/%.m - $(CC) $(DFLAGS) -c -I../MacOSX $(CFLAGS) $(SDL_CFLAGS) -o $@ $< - -# ---------------------------------------------------------------------------- -# objects -# ---------------------------------------------------------------------------- - -MUSIC_OBJS:= bgmusic.o \ - snd_codec.o \ - snd_flac.o \ - snd_wave.o \ - snd_vorbis.o \ - snd_opus.o \ - $(mp3_obj).o \ - snd_mp3tag.o \ - snd_mikmod.o \ - snd_xmp.o \ - snd_umx.o -COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS) -SYSOBJ_SND := snd_sdl.o -SYSOBJ_CDA := cd_sdl.o -SYSOBJ_INPUT := in_sdl.o -SYSOBJ_GL_VID:= gl_vidsdl.o -SYSOBJ_NET := net_bsd.o net_udp.o -SYSOBJ_LAUNCHER := AppController.o QuakeArgument.o QuakeArguments.o ScreenInfo.o SDLApplication.o -SYSOBJ_SYS := pl_osx.o sys_sdl_unix.o -SYSOBJ_MAIN:= main_sdl.o SDLMain.o - -GLOBJS = \ - gl_refrag.o \ - gl_rlight.o \ - gl_rmain.o \ - gl_fog.o \ - gl_rmisc.o \ - r_part.o \ - r_world.o \ - gl_screen.o \ - gl_sky.o \ - gl_warp.o \ - $(SYSOBJ_GL_VID) \ - gl_draw.o \ - image.o \ - gl_texmgr.o \ - gl_mesh.o \ - r_sprite.o \ - r_alias.o \ - r_brush.o \ - gl_model.o - -OBJS := strlcat.o \ - strlcpy.o \ - $(GLOBJS) \ - $(SYSOBJ_INPUT) \ - $(COMOBJ_SND) \ - $(SYSOBJ_SND) \ - $(SYSOBJ_CDA) \ - $(SYSOBJ_NET) \ - net_dgrm.o \ - net_loop.o \ - net_main.o \ - chase.o \ - cl_demo.o \ - cl_input.o \ - cl_main.o \ - cl_parse.o \ - cl_tent.o \ - console.o \ - keys.o \ - menu.o \ - sbar.o \ - view.o \ - wad.o \ - cmd.o \ - common.o \ - crc.o \ - cvar.o \ - cfgfile.o \ - host.o \ - host_cmd.o \ - mathlib.o \ - pr_cmds.o \ - pr_edict.o \ - pr_exec.o \ - sv_main.o \ - sv_move.o \ - sv_phys.o \ - sv_user.o \ - world.o \ - zone.o \ - $(SYSOBJ_SYS) $(SYSOBJ_LAUNCHER) $(SYSOBJ_MAIN) - -# ------------------------ -# darwin build rules -# ------------------------ - -quakespasm: $(OBJS) - $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ - $(call do_strip,$@) - -image.o: lodepng.c lodepng.h stb_image_write.h - -release: quakespasm -debug: - $(error Use "make DEBUG=1") - -clean: - rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print) - diff --git a/Quake/Makefile.w32 b/Quake/Makefile.w32 deleted file mode 100644 index 71cea828..00000000 --- a/Quake/Makefile.w32 +++ /dev/null @@ -1,292 +0,0 @@ -# GNU Makefile for compiling Win32 quakespasm.exe using MinGW or MinGW-w64. -# Usage: "make -f Makefile.w32" -# To cross-compile on Linux hosts, see the build_cross_win32*.sh scripts. -# "make DEBUG=1" to build a debug client. -# "make SDL_CONFIG=/path/to/sdl-config" to override the locally included SDL versions. -# "make WINSOCK2=1" to use WinSock2 api instead of the old WinSock 1.1. - -### Enable/disable SDL2 -USE_SDL2=0 - -### Enable/disable codecs for streaming music support -USE_CODEC_WAVE=1 -USE_CODEC_FLAC=1 -USE_CODEC_MP3=1 -USE_CODEC_VORBIS=1 -USE_CODEC_OPUS=1 -# either mikmod or xmp -USE_CODEC_MIKMOD=1 -USE_CODEC_XMP=0 -USE_CODEC_UMX=1 - -# which library to use for mp3 decoding: mad or mpg123 -MP3LIB=mad -# which library to use for ogg decoding: vorbis or tremor -VORBISLIB=vorbis - -# --------------------------- -# Helper functions -# --------------------------- - -check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;) - -# --------------------------- - -DEBUG ?= 0 -WINSOCK2?= 0 - -# --------------------------- -# build variables -# --------------------------- - -CC = gcc -LINKER = $(CC) -WINDRES = windres - -STRIP = strip - -#CPUFLAGS= -mtune=i686 -#CPUFLAGS= -march=pentium4 -CPUFLAGS= -LDFLAGS = -m32 -mwindows -DFLAGS ?= -CFLAGS ?= -m32 -Wall -Wno-trigraphs -CFLAGS += $(CPUFLAGS) - -ifneq ($(DEBUG),0) -DFLAGS += -DDEBUG -CFLAGS += -g -do_strip= -else -DFLAGS += -DNDEBUG -CFLAGS += -O2 -CFLAGS += $(call check_gcc,-fweb,) -CFLAGS += $(call check_gcc,-frename-registers,) -cmd_strip=$(STRIP) $(1) -define do_strip - $(call cmd_strip,$(1)); -endef -endif - -ifeq ($(USE_SDL2),1) -CFLAGS += -DUSE_SDL2 -endif - -# default to our local SDL[2] for build -ifeq ($(USE_SDL2),1) -SDL_CONFIG ?=../Windows/SDL2/bin/sdl2-config --prefix=../Windows/SDL2 -else -SDL_CONFIG ?=../Windows/SDL/bin/sdl-config --prefix=../Windows/SDL -endif -SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -SDL_LIBS := $(shell $(SDL_CONFIG) --libs) - -ifeq ($(WINSOCK2),1) -DEFWINSOCK :=-D_USE_WINSOCK2 -LIBWINSOCK := -lws2_32 -else -DEFWINSOCK := -LIBWINSOCK := -lwsock32 -endif - -CFLAGS += $(DEFWINSOCK) -NET_LIBS := $(LIBWINSOCK) - -ifneq ($(VORBISLIB),vorbis) -ifneq ($(VORBISLIB),tremor) -$(error Invalid VORBISLIB setting) -endif -endif -ifneq ($(MP3LIB),mpg123) -ifneq ($(MP3LIB),mad) -$(error Invalid MP3LIB setting) -endif -endif -ifeq ($(MP3LIB),mad) -mp3_obj=snd_mp3 -lib_mp3dec=-lmad -endif -ifeq ($(MP3LIB),mpg123) -mp3_obj=snd_mpg123 -lib_mp3dec=-lmpg123 -endif -ifeq ($(VORBISLIB),vorbis) -cpp_vorbisdec= -lib_vorbisdec=-lvorbisfile -lvorbis -logg -endif -ifeq ($(VORBISLIB),tremor) -cpp_vorbisdec=-DVORBIS_USE_TREMOR -lib_vorbisdec=-lvorbisidec -logg -endif - -CODECLIBS := -ifeq ($(USE_CODEC_WAVE),1) -CFLAGS+= -DUSE_CODEC_WAVE -endif -ifeq ($(USE_CODEC_FLAC),1) -CFLAGS+= -DUSE_CODEC_FLAC -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= -lFLAC -endif -ifeq ($(USE_CODEC_OPUS),1) -CFLAGS+= -DUSE_CODEC_OPUS -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= -lopusfile -lopus -logg -endif -ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= $(lib_vorbisdec) -endif -ifeq ($(USE_CODEC_MP3),1) -CFLAGS+= -DUSE_CODEC_MP3 -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= $(lib_mp3dec) -endif -ifeq ($(USE_CODEC_MIKMOD),1) -CFLAGS+= -DUSE_CODEC_MIKMOD -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= -lmikmod -endif -ifeq ($(USE_CODEC_XMP),1) -CFLAGS+= -DUSE_CODEC_XMP -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x86 -CODECLIBS+= -lxmp -endif -ifeq ($(USE_CODEC_UMX),1) -CFLAGS+= -DUSE_CODEC_UMX -endif -CFLAGS+= $(CODEC_INC) - -COMMON_LIBS:= -lm -lopengl32 -lwinmm - -LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODEC_LINK) $(CODECLIBS) - -# --------------------------- -# targets -# --------------------------- - -.PHONY: clean debug release - -DEFAULT_TARGET := quakespasm.exe - -# --------------------------- -# rules -# --------------------------- - -%.o: %.c - $(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $< -%.res: ../Windows/%.rc - $(WINDRES) -I../Windows --output-format=coff --target=pe-i386 -o $@ $< - -# ---------------------------------------------------------------------------- -# objects -# ---------------------------------------------------------------------------- - -MUSIC_OBJS:= bgmusic.o \ - snd_codec.o \ - snd_flac.o \ - snd_wave.o \ - snd_vorbis.o \ - snd_opus.o \ - $(mp3_obj).o \ - snd_mp3tag.o \ - snd_mikmod.o \ - snd_xmp.o \ - snd_umx.o -COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS) -SYSOBJ_SND := snd_sdl.o -SYSOBJ_CDA := cd_sdl.o -SYSOBJ_INPUT := in_sdl.o -SYSOBJ_GL_VID:= gl_vidsdl.o -SYSOBJ_NET := net_win.o net_wins.o net_wipx.o -SYSOBJ_SYS := pl_win.o sys_sdl_win.o -SYSOBJ_MAIN:= main_sdl.o -SYSOBJ_RES := QuakeSpasm.res - -GLOBJS = \ - gl_refrag.o \ - gl_rlight.o \ - gl_rmain.o \ - gl_fog.o \ - gl_rmisc.o \ - r_part.o \ - r_world.o \ - gl_screen.o \ - gl_sky.o \ - gl_warp.o \ - $(SYSOBJ_GL_VID) \ - gl_draw.o \ - image.o \ - gl_texmgr.o \ - gl_mesh.o \ - r_sprite.o \ - r_alias.o \ - r_brush.o \ - gl_model.o - -OBJS := strlcat.o \ - strlcpy.o \ - $(GLOBJS) \ - $(SYSOBJ_INPUT) \ - $(COMOBJ_SND) \ - $(SYSOBJ_SND) \ - $(SYSOBJ_CDA) \ - $(SYSOBJ_NET) \ - net_dgrm.o \ - net_loop.o \ - net_main.o \ - chase.o \ - cl_demo.o \ - cl_input.o \ - cl_main.o \ - cl_parse.o \ - cl_tent.o \ - console.o \ - keys.o \ - menu.o \ - sbar.o \ - view.o \ - wad.o \ - cmd.o \ - common.o \ - crc.o \ - cvar.o \ - cfgfile.o \ - host.o \ - host_cmd.o \ - mathlib.o \ - pr_cmds.o \ - pr_edict.o \ - pr_exec.o \ - sv_main.o \ - sv_move.o \ - sv_phys.o \ - sv_user.o \ - world.o \ - zone.o \ - $(SYSOBJ_SYS) $(SYSOBJ_MAIN) $(SYSOBJ_RES) - -# ------------------------ -# MinGW build rules -# ------------------------ - -quakespasm.exe: $(OBJS) - $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ - $(call do_strip,$@) - -image.o: lodepng.c lodepng.h stb_image_write.h - -release: quakespasm.exe -debug: - $(error Use "make DEBUG=1") - -clean: - rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print) - diff --git a/Quake/Makefile.w64 b/Quake/Makefile.w64 deleted file mode 100644 index ab640fdc..00000000 --- a/Quake/Makefile.w64 +++ /dev/null @@ -1,290 +0,0 @@ -# GNU Makefile for compiling Win64 quakespasm.exe using MinGW-w64. -# Usage: "make -f Makefile.w64" -# To cross-compile on Linux hosts, see the build_cross_win32*.sh scripts. -# "make DEBUG=1" to build a debug client. -# "make SDL_CONFIG=/path/to/sdl-config" to override the locally included SDL versions. -# "make WINSOCK2=0" to use the old WinSock 1.1 api (NOT RECOMMENDED) - -### Enable/disable SDL2 -USE_SDL2=0 - -### Enable/disable codecs for streaming music support -USE_CODEC_WAVE=1 -USE_CODEC_FLAC=1 -USE_CODEC_MP3=1 -USE_CODEC_VORBIS=1 -USE_CODEC_OPUS=1 -# either mikmod or xmp -USE_CODEC_MIKMOD=1 -USE_CODEC_XMP=0 -USE_CODEC_UMX=1 - -# which library to use for mp3 decoding: mad or mpg123 -MP3LIB=mad -# which library to use for ogg decoding: vorbis or tremor -VORBISLIB=vorbis - -# --------------------------- -# Helper functions -# --------------------------- - -check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;) - -# --------------------------- - -DEBUG ?= 0 -WINSOCK2?= 1 - -# --------------------------- -# build variables -# --------------------------- - -CC = gcc -LINKER = $(CC) -WINDRES = windres - -STRIP = strip - -CPUFLAGS= -LDFLAGS = -m64 -mwindows -DFLAGS ?= -CFLAGS ?= -m64 -Wall -Wno-trigraphs -CFLAGS += $(CPUFLAGS) - -ifneq ($(DEBUG),0) -DFLAGS += -DDEBUG -CFLAGS += -g -do_strip= -else -DFLAGS += -DNDEBUG -CFLAGS += -O2 -CFLAGS += $(call check_gcc,-fweb,) -CFLAGS += $(call check_gcc,-frename-registers,) -cmd_strip=$(STRIP) $(1) -define do_strip - $(call cmd_strip,$(1)); -endef -endif - -ifeq ($(USE_SDL2),1) -CFLAGS += -DUSE_SDL2 -endif - -# default to our local SDL[2] for build -ifeq ($(USE_SDL2),1) -SDL_CONFIG ?=../Windows/SDL2/bin/sdl2-config --prefix=../Windows/SDL2 --lib-suffix=64 -else -SDL_CONFIG ?=../Windows/SDL/bin/sdl-config --prefix=../Windows/SDL --lib-suffix=64 -endif -SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -SDL_LIBS := $(shell $(SDL_CONFIG) --libs) - -ifeq ($(WINSOCK2),1) -DEFWINSOCK :=-D_USE_WINSOCK2 -LIBWINSOCK := -lws2_32 -else -DEFWINSOCK := -LIBWINSOCK := -lwsock32 -endif - -CFLAGS += $(DEFWINSOCK) -NET_LIBS := $(LIBWINSOCK) - -ifneq ($(VORBISLIB),vorbis) -ifneq ($(VORBISLIB),tremor) -$(error Invalid VORBISLIB setting) -endif -endif -ifneq ($(MP3LIB),mpg123) -ifneq ($(MP3LIB),mad) -$(error Invalid MP3LIB setting) -endif -endif -ifeq ($(MP3LIB),mad) -mp3_obj=snd_mp3 -lib_mp3dec=-lmad -endif -ifeq ($(MP3LIB),mpg123) -mp3_obj=snd_mpg123 -lib_mp3dec=-lmpg123 -endif -ifeq ($(VORBISLIB),vorbis) -cpp_vorbisdec= -lib_vorbisdec=-lvorbisfile -lvorbis -logg -endif -ifeq ($(VORBISLIB),tremor) -cpp_vorbisdec=-DVORBIS_USE_TREMOR -lib_vorbisdec=-lvorbisidec -logg -endif - -CODECLIBS := -ifeq ($(USE_CODEC_WAVE),1) -CFLAGS+= -DUSE_CODEC_WAVE -endif -ifeq ($(USE_CODEC_FLAC),1) -CFLAGS+= -DUSE_CODEC_FLAC -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= -lFLAC -endif -ifeq ($(USE_CODEC_OPUS),1) -CFLAGS+= -DUSE_CODEC_OPUS -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= -lopusfile -lopus -logg -endif -ifeq ($(USE_CODEC_VORBIS),1) -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= $(lib_vorbisdec) -endif -ifeq ($(USE_CODEC_MP3),1) -CFLAGS+= -DUSE_CODEC_MP3 -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= $(lib_mp3dec) -endif -ifeq ($(USE_CODEC_MIKMOD),1) -CFLAGS+= -DUSE_CODEC_MIKMOD -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= -lmikmod -endif -ifeq ($(USE_CODEC_XMP),1) -CFLAGS+= -DUSE_CODEC_XMP -CODEC_INC = -I../Windows/codecs/include -CODEC_LINK= -L../Windows/codecs/x64 -CODECLIBS+= -lxmp -endif -ifeq ($(USE_CODEC_UMX),1) -CFLAGS+= -DUSE_CODEC_UMX -endif -CFLAGS+= $(CODEC_INC) - -COMMON_LIBS:= -lm -lopengl32 -lwinmm - -LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODEC_LINK) $(CODECLIBS) - -# --------------------------- -# targets -# --------------------------- - -.PHONY: clean debug release - -DEFAULT_TARGET := quakespasm.exe - -# --------------------------- -# rules -# --------------------------- - -%.o: %.c - $(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $< -%.res: ../Windows/%.rc - $(WINDRES) -I../Windows --output-format=coff --target=pe-x86-64 -o $@ $< - -# ---------------------------------------------------------------------------- -# objects -# ---------------------------------------------------------------------------- - -MUSIC_OBJS:= bgmusic.o \ - snd_codec.o \ - snd_flac.o \ - snd_wave.o \ - snd_vorbis.o \ - snd_opus.o \ - $(mp3_obj).o \ - snd_mp3tag.o \ - snd_mikmod.o \ - snd_xmp.o \ - snd_umx.o -COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o $(MUSIC_OBJS) -SYSOBJ_SND := snd_sdl.o -SYSOBJ_CDA := cd_sdl.o -SYSOBJ_INPUT := in_sdl.o -SYSOBJ_GL_VID:= gl_vidsdl.o -SYSOBJ_NET := net_win.o net_wins.o net_wipx.o -SYSOBJ_SYS := pl_win.o sys_sdl_win.o -SYSOBJ_MAIN:= main_sdl.o -SYSOBJ_RES := QuakeSpasm.res - -GLOBJS = \ - gl_refrag.o \ - gl_rlight.o \ - gl_rmain.o \ - gl_fog.o \ - gl_rmisc.o \ - r_part.o \ - r_world.o \ - gl_screen.o \ - gl_sky.o \ - gl_warp.o \ - $(SYSOBJ_GL_VID) \ - gl_draw.o \ - image.o \ - gl_texmgr.o \ - gl_mesh.o \ - r_sprite.o \ - r_alias.o \ - r_brush.o \ - gl_model.o - -OBJS := strlcat.o \ - strlcpy.o \ - $(GLOBJS) \ - $(SYSOBJ_INPUT) \ - $(COMOBJ_SND) \ - $(SYSOBJ_SND) \ - $(SYSOBJ_CDA) \ - $(SYSOBJ_NET) \ - net_dgrm.o \ - net_loop.o \ - net_main.o \ - chase.o \ - cl_demo.o \ - cl_input.o \ - cl_main.o \ - cl_parse.o \ - cl_tent.o \ - console.o \ - keys.o \ - menu.o \ - sbar.o \ - view.o \ - wad.o \ - cmd.o \ - common.o \ - crc.o \ - cvar.o \ - cfgfile.o \ - host.o \ - host_cmd.o \ - mathlib.o \ - pr_cmds.o \ - pr_edict.o \ - pr_exec.o \ - sv_main.o \ - sv_move.o \ - sv_phys.o \ - sv_user.o \ - world.o \ - zone.o \ - $(SYSOBJ_SYS) $(SYSOBJ_MAIN) $(SYSOBJ_RES) - -# ------------------------ -# MinGW-w64 build rules -# ------------------------ - -quakespasm.exe: $(OBJS) - $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ - $(call do_strip,$@) - -image.o: lodepng.c lodepng.h stb_image_write.h - -release: quakespasm.exe -debug: - $(error Use "make DEBUG=1") - -clean: - rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print) - diff --git a/Quake/OWMakefile.win32 b/Quake/OWMakefile.win32 deleted file mode 100644 index 6bd01ad7..00000000 --- a/Quake/OWMakefile.win32 +++ /dev/null @@ -1,237 +0,0 @@ -# makefile to build quakespasm.exe for Windows using Open Watcom: -# wmake -f OWMakefile.win32 - -### Enable/disable SDL2 -USE_SDL2=0 - -### Enable/disable codecs for streaming music support -USE_CODEC_WAVE=1 -USE_CODEC_FLAC=1 -USE_CODEC_MP3=1 -USE_CODEC_VORBIS=1 -USE_CODEC_OPUS=1 -# either mikmod or xmp -USE_CODEC_MIKMOD=1 -USE_CODEC_XMP=0 -USE_CODEC_UMX=1 - -# which library to use for mp3 decoding: mad or mpg123 -MP3LIB=mad -# which library to use for ogg decoding: vorbis or tremor -VORBISLIB=vorbis - -WINSOCK2= 0 - -# --------------------------- -# build variables -# --------------------------- - -CFLAGS_BASE = -zq -wx -bm -bt=nt -5s -sg -otexan -fp5 -fpi87 -ei -j -zp8 -CFLAGS = $(CFLAGS_BASE) - -!ifneq USE_SDL2 1 -SDL_CFLAGS = -I../Windows/SDL/include -SDL_LIBS = ../Windows/SDL/watcom/SDL.lib -!else -SDL_CFLAGS = -I../Windows/SDL2/include -SDL_LIBS = ../Windows/SDL2/watcom/SDL2.lib -CFLAGS += -DUSE_SDL2 -!endif - -!ifeq WINSOCK2 1 -DEFWINSOCK =-D_USE_WINSOCK2 -LIBWINSOCK = ws2_32.lib -!else -DEFWINSOCK = -LIBWINSOCK = wsock32.lib -!endif - -CFLAGS += $(DEFWINSOCK) -NET_LIBS = $(LIBWINSOCK) - -# note: all codec libraries are static. -CODEC_INC = -I../Windows/codecs/include -LIBCODEC = ../Windows/codecs/x86-watcom/ -!ifeq MP3LIB mad -mp3_obj=snd_mp3 -lib_mp3dec=$(LIBCODEC)mad.lib -!endif -!ifeq MP3LIB mpg123 -mp3_obj=snd_mpg123 -lib_mp3dec=$(LIBCODEC)mpg123.lib -!endif -!ifeq VORBISLIB vorbis -cpp_vorbisdec= -lib_vorbisdec=$(LIBCODEC)vorbisfile.lib $(LIBCODEC)vorbis.lib $(LIBCODEC)ogg.lib -!endif -!ifeq VORBISLIB tremor -cpp_vorbisdec=-DVORBIS_USE_TREMOR -lib_vorbisdec=$(LIBCODEC)vorbisidec.lib $(LIBCODEC)ogg.lib -!endif - -CODECLIBS = -!ifeq USE_CODEC_WAVE 1 -CFLAGS+= -DUSE_CODEC_WAVE -!endif -!ifeq USE_CODEC_FLAC 1 -CFLAGS+= -DUSE_CODEC_FLAC -CFLAGS+= -DFLAC__NO_DLL -CODECLIBS+= $(LIBCODEC)FLAC.lib -!endif -!ifeq USE_CODEC_OPUS 1 -CFLAGS+= -DUSE_CODEC_OPUS -CODECLIBS+= $(LIBCODEC)opusfile.lib $(LIBCODEC)opus.lib $(LIBCODEC)ogg.lib -!endif -!ifeq USE_CODEC_VORBIS 1 -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) -CODECLIBS+= $(lib_vorbisdec) -!endif -!ifeq USE_CODEC_MP3 1 -CFLAGS+= -DUSE_CODEC_MP3 -CODECLIBS+= $(lib_mp3dec) -!endif -!ifeq USE_CODEC_MIKMOD 1 -CFLAGS+= -DUSE_CODEC_MIKMOD -CFLAGS+= -DMIKMOD_STATIC -CODECLIBS+= $(LIBCODEC)mikmod.lib -!endif -!ifeq USE_CODEC_XMP 1 -CFLAGS+= -DUSE_CODEC_XMP -CFLAGS+= -DXMP_NO_DLL -CODECLIBS+= $(LIBCODEC)libxmp.lib -!endif -!ifeq USE_CODEC_UMX 1 -CFLAGS+= -DUSE_CODEC_UMX -!endif -CFLAGS+= $(CODEC_INC) - -COMMON_LIBS= opengl32.lib winmm.lib - -LIBS = $(CODECLIBS) $(SDL_LIBS) $(COMMON_LIBS) $(NET_LIBS) - -# --------------------------- -# targets -# --------------------------- - -all: quakespasm.exe - -# --------------------------- -# rules -# --------------------------- - -.EXTENSIONS: .res .rc - -.c.obj: - wcc386 $(INCLUDES) $(CFLAGS) $(SDL_CFLAGS) -fo=$^@ $< -SDL_win32_main.obj: ../Windows/SDL/main/SDL_win32_main.c - wcc386 $(CFLAGS_BASE) $(SDL_CFLAGS) -fo=$^@ $< -SDL_windows_main.obj: ../Windows/SDL2/main/SDL_windows_main.c - wcc386 $(CFLAGS_BASE) $(SDL_CFLAGS) -I../Windows/SDL2/main -fo=$^@ $< -quakespasm.res: ../Windows/QuakeSpasm.rc - wrc -q -r -bt=nt -I../Windows -fo=$^@ $< - -# ---------------------------------------------------------------------------- -# objects -# ---------------------------------------------------------------------------- - -MUSIC_OBJS= bgmusic.obj & - snd_codec.obj & - snd_flac.obj & - snd_wave.obj & - snd_vorbis.obj & - snd_opus.obj & - $(mp3_obj).obj & - snd_mp3tag.obj & - snd_mikmod.obj & - snd_xmp.obj & - snd_umx.obj -COMOBJ_SND = snd_dma.obj snd_mix.obj snd_mem.obj $(MUSIC_OBJS) -SYSOBJ_SND = snd_sdl.obj -SYSOBJ_CDA = cd_sdl.obj -SYSOBJ_INPUT = in_sdl.obj -SYSOBJ_GL_VID= gl_vidsdl.obj -SYSOBJ_NET = net_win.obj net_wins.obj net_wipx.obj -SYSOBJ_SYS = pl_win.obj sys_sdl_win.obj -SYSOBJ_MAIN= main_sdl.obj -!ifeq USE_SDL2 1 -SYSOBJ_MAIN+= SDL_windows_main.obj -!else -SYSOBJ_MAIN+= SDL_win32_main.obj -!endif -SYSOBJ_RES = quakespasm.res - -GLOBJS = & - gl_refrag.obj & - gl_rlight.obj & - gl_rmain.obj & - gl_fog.obj & - gl_rmisc.obj & - r_part.obj & - r_world.obj & - gl_screen.obj & - gl_sky.obj & - gl_warp.obj & - $(SYSOBJ_GL_VID) & - gl_draw.obj & - image.obj & - gl_texmgr.obj & - gl_mesh.obj & - r_sprite.obj & - r_alias.obj & - r_brush.obj & - gl_model.obj - -OBJS = strlcat.obj & - strlcpy.obj & - $(GLOBJS) & - $(SYSOBJ_INPUT) & - $(COMOBJ_SND) & - $(SYSOBJ_SND) & - $(SYSOBJ_CDA) & - $(SYSOBJ_NET) & - net_dgrm.obj & - net_loop.obj & - net_main.obj & - chase.obj & - cl_demo.obj & - cl_input.obj & - cl_main.obj & - cl_parse.obj & - cl_tent.obj & - console.obj & - keys.obj & - menu.obj & - sbar.obj & - view.obj & - wad.obj & - cmd.obj & - common.obj & - crc.obj & - cvar.obj & - cfgfile.obj & - host.obj & - host_cmd.obj & - mathlib.obj & - pr_cmds.obj & - pr_edict.obj & - pr_exec.obj & - sv_main.obj & - sv_move.obj & - sv_phys.obj & - sv_user.obj & - world.obj & - zone.obj & - $(SYSOBJ_SYS) $(SYSOBJ_MAIN) - -# ------------------------ -# Watcom build rules -# ------------------------ - -# 1 MB stack size. -quakespasm.exe: $(OBJS) quakespasm.res - wlink N $@ SYS NT_WIN OPTION q OPTION STACK=0x100000 LIBR {$(LIBS)} F {$(OBJS)} - wrc -q $^*.res - -clean: .symbolic - rm -f *.obj *.res *.err quakespasm.exe - diff --git a/Quake/bgmusic.cpp b/Quake/bgmusic.cpp index 93661920..ea1ad46b 100644 --- a/Quake/bgmusic.cpp +++ b/Quake/bgmusic.cpp @@ -22,9 +22,14 @@ * */ -#include "quakedef.hpp" #include "snd_codec.hpp" #include "bgmusic.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "q_sound.hpp" +#include "cdaudio.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" #define MUSIC_DIRNAME "music" diff --git a/Quake/bgmusic.hpp b/Quake/bgmusic.hpp index 1a4c634d..2b97a7e3 100644 --- a/Quake/bgmusic.hpp +++ b/Quake/bgmusic.hpp @@ -22,21 +22,22 @@ * */ -#ifndef _BGMUSIC_H_ -#define _BGMUSIC_H_ +#pragma once + +#include "q_stdinc.hpp" +#include "cvar.hpp" extern bool bgmloop; extern cvar_t bgm_extmusic; -bool BGM_Init(void); -void BGM_Shutdown(void); +bool BGM_Init(); +void BGM_Shutdown(); void BGM_Play(const char* filename); -void BGM_Stop(void); -void BGM_Update(void); -void BGM_Pause(void); -void BGM_Resume(void); +void BGM_Stop(); +void BGM_Update(); +void BGM_Pause(); +void BGM_Resume(); void BGM_PlayCDtrack(byte track, bool looping); -#endif /* _BGMUSIC_H_ */ diff --git a/Quake/bspfile.hpp b/Quake/bspfile.hpp index b481fe69..94bc83f9 100644 --- a/Quake/bspfile.hpp +++ b/Quake/bspfile.hpp @@ -21,10 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __BSPFILE_H -#define __BSPFILE_H +#pragma once -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" +#include "q_stdinc.hpp" +#include "quakedef_macros.hpp" // upper design bounds @@ -101,7 +102,27 @@ typedef struct int headnode[MAX_MAP_HULLS]; int visleafs; // not including the solid leaf 0 int firstface, numfaces; -} dmodel_t; +} mmodel_t; + +// QSS +typedef struct +{ + float mins[3], maxs[3]; + float origin[3]; + int headnode[4]; + int visleafs; // not including the solid leaf 0 + int firstface, numfaces; +} dmodelq1_t; + +// QSS +typedef struct +{ + float mins[3], maxs[3]; + float origin[3]; + int headnode[8]; + int visleafs; // not including the solid leaf 0 + int firstface, numfaces; +} dmodelh2_t; typedef struct { @@ -164,6 +185,9 @@ typedef struct #define CONTENTS_CURRENT_UP -13 #define CONTENTS_CURRENT_DOWN -14 +// QSS +#define CONTENTS_LADDER -16 + // !!! if this is changed, it must be changed in asm_i386.h too !!! typedef struct @@ -215,6 +239,7 @@ typedef struct texinfo_s int miptex; int flags; } texinfo_t; + #define TEX_SPECIAL 1 // sky or slime, no lightmap or 256 subdivision #define TEX_MISSING 2 // johnfitz -- this texinfo does not have a texture @@ -230,7 +255,12 @@ typedef struct unsigned int v[2]; // vertex numbers } dledge_t; -#define MAXLIGHTMAPS 4 +#define MAXLIGHTMAPS 16 + +// QSS +#define INVALID_LIGHTSTYLE 0xffffu +#define INVALID_LIGHTSTYLE_OLD 0xffu + typedef struct { short planenum; @@ -241,7 +271,7 @@ typedef struct short texinfo; // lighting info - byte styles[MAXLIGHTMAPS]; + byte styles[4]; int lightofs; // start of [numstyles*surfsize] samples } dsface_t; @@ -255,7 +285,7 @@ typedef struct int texinfo; // lighting info - byte styles[MAXLIGHTMAPS]; + byte styles[4]; int lightofs; // start of [numstyles*surfsize] samples } dlface_t; @@ -322,7 +352,7 @@ typedef struct // the utilities get to be lazy and just use large static arrays extern int nummodels; -extern dmodel_t dmodels[MAX_MAP_MODELS]; +extern mmodel_t dmodels[MAX_MAP_MODELS]; extern int visdatasize; extern byte dvisdata[MAX_MAP_VISIBILITY]; @@ -372,7 +402,7 @@ int CompressVis(byte* vis, byte* dest); void LoadBSPFile(char* filename); void WriteBSPFile(char* filename); -void PrintBSPFileSizes(void); +void PrintBSPFileSizes(); //=============== @@ -385,7 +415,7 @@ typedef struct epair_s struct entitybsp_t { - glm::vec3 origin; + qvec3 origin; int firstbrush; int numbrushes; epair_t* epairs; @@ -395,4 +425,3 @@ extern int num_entities; extern entitybsp_t entities[MAX_MAP_ENTITIES]; #endif /* QUAKE_GAME */ -#endif /* __BSPFILE_H */ diff --git a/Quake/build_cross_osx-sdl2.sh b/Quake/build_cross_osx-sdl2.sh deleted file mode 100644 index 5d791c76..00000000 --- a/Quake/build_cross_osx-sdl2.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -rm -f quakespasm.x86 quakespasm.x86_64 QuakeSpasm -make clean - -OLDPATH=$PATH -MAKE_CMD=make - -OSXBUILD=1 -export OSXBUILD -STRIP=/bin/true -export STRIP - -# x86 -PATH=/opt/cross_osx-x86.5/usr/bin:$OLDPATH -CC=i686-apple-darwin9-gcc -AS=i686-apple-darwin9-as -AR=i686-apple-darwin9-ar -RANLIB=i686-apple-darwin9-ranlib -LIPO=i686-apple-darwin9-lipo -export PATH CC AS AR RANLIB LIPO -$MAKE_CMD MACH_TYPE=x86 USE_SDL2=1 -f Makefile.darwin $* || exit 1 -i686-apple-darwin9-strip -S quakespasm || exit 1 -mv quakespasm quakespasm.x86 || exit 1 -$MAKE_CMD clean - -# x86_64 -PATH=/opt/cross_osx-x86_64/usr/bin:$OLDPATH -CC=x86_64-apple-darwin9-gcc -AS=x86_64-apple-darwin9-as -AR=x86_64-apple-darwin9-ar -RANLIB=x86_64-apple-darwin9-ranlib -LIPO=x86_64-apple-darwin9-lipo -export PATH CC AS AR RANLIB LIPO -$MAKE_CMD MACH_TYPE=x86_64 USE_SDL2=1 -f Makefile.darwin $* || exit 1 -x86_64-apple-darwin9-strip -S quakespasm || exit 1 -mv quakespasm quakespasm.x86_64 || exit 1 -$MAKE_CMD clean - -$LIPO -create -o QuakeSpasm quakespasm.x86 quakespasm.x86_64 || exit 1 - diff --git a/Quake/build_cross_osx.sh b/Quake/build_cross_osx.sh deleted file mode 100644 index 85e9bd93..00000000 --- a/Quake/build_cross_osx.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -rm -f quakespasm.ppc \ - quakespasm.x86 \ - quakespasm.x86_64 \ - QuakeSpasm -make clean - -OLDPATH=$PATH -MAKE_CMD=make - -OSXBUILD=1 -export OSXBUILD -STRIP=/bin/true -export STRIP - -# ppc -PATH=/opt/cross_osx-ppc/bin:$OLDPATH -CC=powerpc-apple-darwin9-gcc -AS=powerpc-apple-darwin9-as -AR=powerpc-apple-darwin9-ar -RANLIB=powerpc-apple-darwin9-ranlib -LIPO=powerpc-apple-darwin9-lipo -export PATH CC AS AR RANLIB LIPO -$MAKE_CMD MACH_TYPE=ppc -f Makefile.darwin $* || exit 1 -powerpc-apple-darwin9-strip -S quakespasm || exit 1 -mv quakespasm quakespasm.ppc || exit 1 -$MAKE_CMD clean - -# x86 -PATH=/opt/cross_osx-x86/bin:$OLDPATH -CC=i686-apple-darwin9-gcc -AS=i686-apple-darwin9-as -AR=i686-apple-darwin9-ar -RANLIB=i686-apple-darwin9-ranlib -LIPO=i686-apple-darwin9-lipo -export PATH CC AS AR RANLIB LIPO -$MAKE_CMD MACH_TYPE=x86 -f Makefile.darwin $* || exit 1 -i686-apple-darwin9-strip -S quakespasm || exit 1 -mv quakespasm quakespasm.x86 || exit 1 -$MAKE_CMD clean - -# x86_64 -PATH=/opt/cross_osx-x86_64/usr/bin:$OLDPATH -CC=x86_64-apple-darwin9-gcc -AS=x86_64-apple-darwin9-as -AR=x86_64-apple-darwin9-ar -RANLIB=x86_64-apple-darwin9-ranlib -LIPO=x86_64-apple-darwin9-lipo -export PATH CC AS AR RANLIB LIPO -$MAKE_CMD MACH_TYPE=x86_64 -f Makefile.darwin $* || exit 1 -x86_64-apple-darwin9-strip -S quakespasm || exit 1 -mv quakespasm quakespasm.x86_64 || exit 1 -$MAKE_CMD clean - -$LIPO -create -o QuakeSpasm quakespasm.ppc quakespasm.x86 quakespasm.x86_64 || exit 1 - diff --git a/Quake/build_cross_win32-sdl2.sh b/Quake/build_cross_win32-sdl2.sh deleted file mode 100644 index bc698d8a..00000000 --- a/Quake/build_cross_win32-sdl2.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# Change this script to meet your needs and/or environment. - -TARGET=i686-w64-mingw32 -PREFIX=/opt/cross_win32 - -PATH="$PREFIX/bin:$PATH" -export PATH - -MAKE_CMD=make - -CC="$TARGET-gcc" -AS="$TARGET-as" -RANLIB="$TARGET-ranlib" -AR="$TARGET-ar" -WINDRES="$TARGET-windres" -STRIP="$TARGET-strip" -export PATH CC AS AR RANLIB WINDRES STRIP - -exec $MAKE_CMD USE_SDL2=1 WINSOCK2=1 CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR WINDRES=$WINDRES STRIP=$STRIP -f Makefile.w32 $* diff --git a/Quake/build_cross_win32.sh b/Quake/build_cross_win32.sh deleted file mode 100644 index 59957967..00000000 --- a/Quake/build_cross_win32.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# Change this script to meet your needs and/or environment. - -#TARGET=i686-w64-mingw32 -TARGET=i686-pc-mingw32 -#PREFIX=/opt/cross_win32 -PREFIX=/usr/local/cross-win32 - -PATH="$PREFIX/bin:$PATH" -export PATH - -MAKE_CMD=make - -CC="$TARGET-gcc" -AS="$TARGET-as" -RANLIB="$TARGET-ranlib" -AR="$TARGET-ar" -WINDRES="$TARGET-windres" -STRIP="$TARGET-strip" -export PATH CC AS AR RANLIB WINDRES STRIP - -exec $MAKE_CMD CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR WINDRES=$WINDRES STRIP=$STRIP -f Makefile.w32 $* diff --git a/Quake/build_cross_win64-sdl2.sh b/Quake/build_cross_win64-sdl2.sh deleted file mode 100644 index 312c7bad..00000000 --- a/Quake/build_cross_win64-sdl2.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# Change this script to meet your needs and/or environment. - -TARGET=x86_64-w64-mingw32 -PREFIX=/opt/cross_win64 - -PATH="$PREFIX/bin:$PATH" -export PATH - -MAKE_CMD=make - -CC="$TARGET-gcc" -AS="$TARGET-as" -RANLIB="$TARGET-ranlib" -AR="$TARGET-ar" -WINDRES="$TARGET-windres" -STRIP="$TARGET-strip" -export PATH CC AS AR RANLIB WINDRES STRIP - -exec $MAKE_CMD USE_SDL2=1 CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR WINDRES=$WINDRES STRIP=$STRIP -f Makefile.w64 $* diff --git a/Quake/build_cross_win64.sh b/Quake/build_cross_win64.sh deleted file mode 100644 index 877077ab..00000000 --- a/Quake/build_cross_win64.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# Change this script to meet your needs and/or environment. - -TARGET=x86_64-w64-mingw32 -PREFIX=/opt/cross_win64 - -PATH="$PREFIX/bin:$PATH" -export PATH - -MAKE_CMD=make - -CC="$TARGET-gcc" -AS="$TARGET-as" -RANLIB="$TARGET-ranlib" -AR="$TARGET-ar" -WINDRES="$TARGET-windres" -STRIP="$TARGET-strip" -export PATH CC AS AR RANLIB WINDRES STRIP - -exec $MAKE_CMD CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR WINDRES=$WINDRES STRIP=$STRIP -f Makefile.w64 $* diff --git a/Quake/byteorder.cpp b/Quake/byteorder.cpp new file mode 100644 index 00000000..6810c961 --- /dev/null +++ b/Quake/byteorder.cpp @@ -0,0 +1,109 @@ +#include "byteorder.hpp" +#include "sys.hpp" +#include "q_stdinc.hpp" + +bool host_bigendian; + +short (*BigShort)(short l); +short (*LittleShort)(short l); +int (*BigLong)(int l); +int (*LittleLong)(int l); +float (*BigFloat)(float l); +float (*LittleFloat)(float l); + +short ShortSwap(short l) +{ + const byte b1 = l & 255; + const byte b2 = (l >> 8) & 255; + + return (b1 << 8) + b2; +} + +short ShortNoSwap(short l) +{ + return l; +} + +int LongSwap(int l) +{ + const byte b1 = l & 255; + const byte b2 = (l >> 8) & 255; + const byte b3 = (l >> 16) & 255; + const byte b4 = (l >> 24) & 255; + + return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4; +} + +int LongNoSwap(int l) +{ + return l; +} + +float FloatSwap(float f) +{ + union + { + float f; + byte b[4]; + } dat1, dat2; + + dat1.f = f; + dat2.b[0] = dat1.b[3]; + dat2.b[1] = dat1.b[2]; + dat2.b[2] = dat1.b[1]; + dat2.b[3] = dat1.b[0]; + return dat2.f; +} + +float FloatNoSwap(float f) +{ + return f; +} + +void ByteOrder_Init() +{ + int i = 0x12345678; + /* U N I X */ + + /* + BE_ORDER: 12 34 56 78 + U N I X + + LE_ORDER: 78 56 34 12 + X I N U + + PDP_ORDER: 34 12 78 56 + N U X I + */ + if(*(char*)&i == 0x12) + { + host_bigendian = true; + } + else if(*(char*)&i == 0x78) + { + host_bigendian = false; + } + else + { /* if ( *(char *)&i == 0x34 ) */ + Sys_Error("Unsupported endianism."); + } + + if(host_bigendian) + { + BigShort = ShortNoSwap; + LittleShort = ShortSwap; + BigLong = LongNoSwap; + LittleLong = LongSwap; + BigFloat = FloatNoSwap; + LittleFloat = FloatSwap; + } + else /* assumed LITTLE_ENDIAN. */ + { + BigShort = ShortSwap; + LittleShort = ShortNoSwap; + BigLong = LongSwap; + LittleLong = LongNoSwap; + BigFloat = FloatSwap; + LittleFloat = FloatNoSwap; + } +} diff --git a/Quake/byteorder.hpp b/Quake/byteorder.hpp new file mode 100644 index 00000000..f0b9c3ed --- /dev/null +++ b/Quake/byteorder.hpp @@ -0,0 +1,12 @@ +#pragma once + +extern bool host_bigendian; + +extern short (*BigShort)(short l); +extern short (*LittleShort)(short l); +extern int (*BigLong)(int l); +extern int (*LittleLong)(int l); +extern float (*BigFloat)(float l); +extern float (*LittleFloat)(float l); + +void ByteOrder_Init(); diff --git a/Quake/cd_null.cpp b/Quake/cd_null.cpp index d95a3390..cfb49d12 100644 --- a/Quake/cd_null.cpp +++ b/Quake/cd_null.cpp @@ -18,7 +18,9 @@ */ -#include "quakedef.hpp" +#include "q_stdinc.hpp" +#include "cdaudio.hpp" +#include "console.hpp" int CDAudio_Play(byte track, bool looping) { diff --git a/Quake/cd_sdl.cpp b/Quake/cd_sdl.cpp index 655fbdb6..d4493a78 100644 --- a/Quake/cd_sdl.cpp +++ b/Quake/cd_sdl.cpp @@ -22,15 +22,7 @@ */ -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif #ifndef SDL_INIT_CDROM @@ -41,7 +33,10 @@ #else /* SDL_INIT_CDROM */ -#include "quakedef.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "cdaudio.hpp" +#include "console.hpp" static bool cdValid = false; static bool playing = false; diff --git a/Quake/cdaudio.hpp b/Quake/cdaudio.hpp index 4ef26dc3..1d499530 100644 --- a/Quake/cdaudio.hpp +++ b/Quake/cdaudio.hpp @@ -20,16 +20,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CDAUDIO_H -#define __CDAUDIO_H +#pragma once -int CDAudio_Init(void); +int CDAudio_Init(); int CDAudio_Play(byte track, bool looping); /* returns 0 for success, -1 for failure. */ -void CDAudio_Stop(void); -void CDAudio_Pause(void); -void CDAudio_Resume(void); -void CDAudio_Shutdown(void); -void CDAudio_Update(void); - -#endif /* __CDAUDIO_H */ +void CDAudio_Stop(); +void CDAudio_Pause(); +void CDAudio_Resume(); +void CDAudio_Shutdown(); +void CDAudio_Update(); diff --git a/Quake/cfgfile.cpp b/Quake/cfgfile.cpp index ae2a0a21..7030790a 100644 --- a/Quake/cfgfile.cpp +++ b/Quake/cfgfile.cpp @@ -19,8 +19,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "quakedef.hpp" - +#include "fshandle.hpp" +#include "common.hpp" +#include "zone.hpp" +#include "cvar.hpp" static fshandle_t* cfg_file; diff --git a/Quake/cfgfile.hpp b/Quake/cfgfile.hpp index e1225f47..2f5fa858 100644 --- a/Quake/cfgfile.hpp +++ b/Quake/cfgfile.hpp @@ -19,14 +19,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __CFGFILE_H -#define __CFGFILE_H +#pragma once int CFG_OpenConfig(const char* cfg_name); // opens the given config file. only one open config file is // kept: previosly opened one, if any, will be closed. -void CFG_CloseConfig(void); +void CFG_CloseConfig(); // closes the currently open config file. void CFG_ReadCvars(const char** vars, int num_vars); @@ -38,5 +37,3 @@ void CFG_ReadCvarOverrides(const char** vars, int num_vars); // values of cvars in the given list. doesn't do anything with // the config file. call this after CFG_ReadCvars() and before // locking your cvars. - -#endif /* __CFGFILE_H */ diff --git a/Quake/chase.cpp b/Quake/chase.cpp index 60ea1761..c7a8134e 100644 --- a/Quake/chase.cpp +++ b/Quake/chase.cpp @@ -22,9 +22,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // chase.c -- chase camera code -#include "quakedef.hpp" #include "mathlib.hpp" #include "util.hpp" +#include "cvar.hpp" +#include "render.hpp" +#include "client.hpp" cvar_t chase_back = {"chase_back", "100", CVAR_NONE}; cvar_t chase_up = {"chase_up", "16", CVAR_NONE}; @@ -51,7 +53,7 @@ TraceLine TODO: impact on bmodels, monsters ============== */ -[[nodiscard]] trace_t TraceLine(const glm::vec3& start, const glm::vec3& end) +[[nodiscard]] trace_t TraceLine(const qvec3& start, const qvec3& end) { trace_t trace; memset(&trace, 0, sizeof(trace)); @@ -62,7 +64,7 @@ TODO: impact on bmodels, monsters } [[nodiscard]] trace_t TraceLineToEntity( - const glm::vec3& start, const glm::vec3& end, edict_t* ent) + const qvec3& start, const qvec3& end, edict_t* ent) { return SV_MoveTrace(start, end, MOVE_NORMAL, ent); } @@ -98,7 +100,7 @@ void Chase_UpdateForDrawing(refdef_t& refdef, entity_t* viewent) quake::util::getAngledVectors(cl.viewangles); // calc ideal camera location before checking for walls - glm::vec3 ideal; + qvec3 ideal; for(int i = 0; i < 3; i++) { ideal[i] = viewent->origin[i] - forward[i] * chase_back.value + @@ -108,7 +110,7 @@ void Chase_UpdateForDrawing(refdef_t& refdef, entity_t* viewent) ideal[2] = viewent->origin[2] + chase_up.value; // make sure camera is not in or behind a wall - glm::vec3 temp = TraceLine(refdef.vieworg, ideal).endpos; + qvec3 temp = TraceLine(refdef.vieworg, ideal).endpos; if(glm::length(temp) != 0.f) { ideal = temp; @@ -118,7 +120,7 @@ void Chase_UpdateForDrawing(refdef_t& refdef, entity_t* viewent) refdef.vieworg = ideal; // find the spot the player is looking at - temp = viewent->origin + 4096.f * forward; + temp = viewent->origin + 4096._qf * forward; const auto crosshair = TraceLine(viewent->origin, temp).endpos; diff --git a/Quake/cl_demo.cpp b/Quake/cl_demo.cpp index 2b9bd4dc..115e78ed 100644 --- a/Quake/cl_demo.cpp +++ b/Quake/cl_demo.cpp @@ -21,6 +21,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "quakedef.hpp" +#include "console.hpp" +#include "net.hpp" +#include "keys.hpp" +#include "protocol.hpp" +#include "byteorder.hpp" +#include "msg.hpp" +#include "client.hpp" +#include "sys.hpp" +#include "cmd.hpp" +#include "gl_texmgr.hpp" static void CL_FinishTimeDemo(); diff --git a/Quake/cl_input.cpp b/Quake/cl_input.cpp index 7c87e591..fe4be1cd 100644 --- a/Quake/cl_input.cpp +++ b/Quake/cl_input.cpp @@ -26,6 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // rights reserved. #include "quakedef.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "net.hpp" +#include "mathlib.hpp" +#include "msg.hpp" +#include "input.hpp" +#include "client.hpp" extern cvar_t cl_maxpitch; // johnfitz -- variable pitch clamping extern cvar_t cl_minpitch; // johnfitz -- variable pitch clamping @@ -401,7 +408,7 @@ void CL_AdjustAngles() { float speed; - if((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0)) + if((in_speed.state & 1) ^ (cl_alwaysrun.value == 0.0)) { speed = host_frametime * cl_anglespeedkey.value; } @@ -496,7 +503,7 @@ void CL_BaseMove(usercmd_t* cmd) // // adjust for speed key // - if((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0)) + if((in_speed.state & 1) ^ (cl_alwaysrun.value == 0.0)) { cmd->forwardmove *= cl_movespeedkey.value; cmd->sidemove *= cl_movespeedkey.value; @@ -548,9 +555,7 @@ void CL_SendMove(const usercmd_t* cmd) }; const auto writeVec = [&](const auto& vec) { - MSG_WriteFloat(&buf, vec[0]); - MSG_WriteFloat(&buf, vec[1]); - MSG_WriteFloat(&buf, vec[2]); + MSG_WriteVec3(&buf, vec, cl.protocolflags); }; // aimangles @@ -559,6 +564,9 @@ void CL_SendMove(const usercmd_t* cmd) // viewangles writeAngles(cl.viewangles); + // vr yaw: + MSG_WriteFloat(&buf, cmd->vryaw); + // main hand values: writeVec(cmd->handpos); writeVec(cmd->handrot); @@ -575,28 +583,29 @@ void CL_SendMove(const usercmd_t* cmd) MSG_WriteFloat(&buf, cmd->offhandvelmag); writeVec(cmd->offhandavel); + // headvel + writeVec(cmd->headvel); + // muzzlepos writeVec(cmd->muzzlepos); // offmuzzlepos writeVec(cmd->offmuzzlepos); + // vrbits0 + MSG_WriteUnsignedChar(&buf, cmd->vrbits0); + // movement MSG_WriteShort(&buf, cmd->forwardmove); MSG_WriteShort(&buf, cmd->sidemove); MSG_WriteShort(&buf, cmd->upmove); // teleportation - MSG_WriteShort(&buf, cmd->teleporting); writeVec(cmd->teleport_target); // hands - MSG_WriteShort(&buf, cmd->offhand_grabbing); - MSG_WriteShort(&buf, cmd->offhand_prevgrabbing); - MSG_WriteShort(&buf, cmd->mainhand_grabbing); - MSG_WriteShort(&buf, cmd->mainhand_prevgrabbing); - MSG_WriteShort(&buf, cmd->offhand_hotspot); - MSG_WriteShort(&buf, cmd->mainhand_hotspot); + MSG_WriteByte(&buf, cmd->offhand_hotspot); + MSG_WriteByte(&buf, cmd->mainhand_hotspot); // roomscalemove writeVec(cmd->roomscalemove); diff --git a/Quake/cl_main.cpp b/Quake/cl_main.cpp index fe775b81..5ac967ce 100644 --- a/Quake/cl_main.cpp +++ b/Quake/cl_main.cpp @@ -23,9 +23,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // cl_main.c -- client main loop #include "quakedef.hpp" +#include "host.hpp" #include "bgmusic.hpp" #include "vr.hpp" #include "util.hpp" +#include "cmd.hpp" +#include "cdaudio.hpp" +#include "console.hpp" +#include "net.hpp" +#include "glquake.hpp" +#include "keys.hpp" +#include "quakedef_macros.hpp" +#include "msg.hpp" +#include "client.hpp" +#include "screen.hpp" +#include "zone.hpp" +#include "input.hpp" +#include "q_sound.hpp" + +#include <string> +#include <vector> // we need to declare some mouse variables here, because the menu system // references them even when on a unix system. @@ -66,6 +83,13 @@ int cl_max_edicts; // johnfitz -- only changes when new map loads int cl_numvisedicts; entity_t* cl_visedicts[MAX_VISEDICTS]; + + + + + + + extern cvar_t r_lerpmodels, r_lerpmove; // johnfitz /* @@ -82,7 +106,8 @@ void CL_ClearState() } // wipe the entire cl structure - memset(&cl, 0, sizeof(cl)); + // memset(&cl, 0, sizeof(cl)); + cl = client_state_t{}; SZ_Clear(&cls.message); @@ -95,6 +120,8 @@ void CL_ClearState() // johnfitz -- cl_entities is now dynamically allocated cl_max_edicts = CLAMP(MIN_EDICTS, (int)max_edicts.value, MAX_EDICTS); cl_entities = Hunk_AllocName<entity_t>(cl_max_edicts, "cl_entities"); + + cl.worldTexts.clear(); } /* @@ -525,7 +552,7 @@ void CL_RelinkEntities() { // if the delta is large, assume a teleport and don't lerp float f = frac; - glm::vec3 delta; + qvec3 delta; for(int j = 0; j < 3; j++) { @@ -585,14 +612,13 @@ void CL_RelinkEntities() dlight_t* dl; if(ent->effects & EF_MUZZLEFLASH) { - dl = CL_AllocDlight(i); dl->origin = ent->origin; dl->origin[2] += 16; const auto fv = quake::util::getFwdVecFromPitchYawRoll(ent->angles); - dl->origin += 18.f * fv; + dl->origin += 18._qf * fv; dl->radius = 200 + (rand() & 31); dl->minlight = 32; dl->die = cl.time + 0.1; @@ -628,6 +654,7 @@ void CL_RelinkEntities() dl->radius = 400 + (rand() & 31); dl->die = cl.time + 0.001; } + if(ent->effects & EF_DIMLIGHT) { dl = CL_AllocDlight(i); @@ -636,6 +663,14 @@ void CL_RelinkEntities() dl->die = cl.time + 0.001; } + if(ent->effects & EF_VERYDIMLIGHT) + { + dl = CL_AllocDlight(i); + dl->origin = ent->origin; + dl->radius = 50 + (rand() & 31); + dl->die = cl.time + 0.001; + } + if(ent->model->flags & EF_GIB) { R_RocketTrail(oldorg, ent->origin, 2 /* blood */); @@ -646,7 +681,7 @@ void CL_RelinkEntities() } else if(ent->model->flags & EF_TRACER) { - R_RocketTrail(oldorg, ent->origin, 3) /* tracer */; + R_RocketTrail(oldorg, ent->origin, 3 /* tracer */); } else if(ent->model->flags & EF_TRACER2) { @@ -654,11 +689,22 @@ void CL_RelinkEntities() } else if(ent->model->flags & EF_ROCKET) { - R_RocketTrail(oldorg, ent->origin, 0 /* rocket trail */); - dl = CL_AllocDlight(i); - dl->origin = ent->origin; - dl->radius = 200; - dl->die = cl.time + 0.01; + if(ent->effects & EF_MINIROCKET) + { + R_RocketTrail(oldorg, ent->origin, 7 /* mini rocket trail */); + dl = CL_AllocDlight(i); + dl->origin = ent->origin; + dl->radius = 70; + dl->die = cl.time + 0.01; + } + else + { + R_RocketTrail(oldorg, ent->origin, 0 /* rocket trail */); + dl = CL_AllocDlight(i); + dl->origin = ent->origin; + dl->radius = 200; + dl->die = cl.time + 0.01; + } } else if(ent->model->flags & EF_GRENADE) { @@ -669,6 +715,11 @@ void CL_RelinkEntities() R_RocketTrail(oldorg, ent->origin, 6 /* voor trail */); } + if(ent->effects & EF_LAVATRAIL) + { + R_RunParticleEffect_LavaSpike(ent->origin, vec3_zero, 4); + } + ent->forcelink = false; // This hides the player model in first person view. @@ -862,7 +913,7 @@ void CL_Tracepos_f(refdef_t& refdef) return; } - const auto v = refdef.vieworg + 8192.f * vpn; + const auto v = refdef.vieworg + 8192._qf * vpn; const auto trace = TraceLine(refdef.vieworg, v); if(!quake::util::hitSomething(trace)) diff --git a/Quake/cl_parse.cpp b/Quake/cl_parse.cpp index 7c6bfe8d..06047b23 100644 --- a/Quake/cl_parse.cpp +++ b/Quake/cl_parse.cpp @@ -23,9 +23,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // cl_parse.c -- parse a message received from the server +#include "common.hpp" +#include "host.hpp" #include "quakedef.hpp" #include "bgmusic.hpp" #include "vr.hpp" +#include "worldtext.hpp" +#include "cdaudio.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" +#include "sbar.hpp" +#include "net.hpp" +#include "mathlib.hpp" +#include "glquake.hpp" +#include "protocol.hpp" +#include "msg.hpp" +#include "sys.hpp" +#include "server.hpp" +#include "q_sound.hpp" +#include "screen.hpp" +#include "cmd.hpp" +#include "client.hpp" + +#include <limits> const char* svc_strings[] = { "svc_bad", "svc_nop", "svc_disconnect", "svc_updatestat", @@ -60,32 +80,32 @@ const char* svc_strings[] = { "svc_cdtrack", // [byte] track [byte] looptrack "svc_sellscreen", "svc_cutscene", // johnfitz -- new server messages - "", // 35 - "", // 36 - "svc_skybox", // 37 // [string] skyname - "", // 38 - "", // 39 - "svc_bf", // 40 // no data - "svc_fog", // 41 // [byte] density [byte] red [byte] - // green [byte] blue [float] time - "svc_spawnbaseline2", // 42 // support for large modelindex, large - // framenum, alpha, using flags - "svc_spawnstatic2", // 43 // support for large modelindex, large - // framenum, alpha, using flags - "svc_spawnstaticsound2", // 44 // [coord3] [short] samp [byte] vol - //[byte] aten - "svc_particle2", // 45 - "", // 46 - "", // 47 - "", // 48 - "", // 49 - "", // 50 + "", // 35 + "", // 36 + "svc_skybox", // 37 // [string] skyname + "", // 38 + "", // 39 + "svc_bf", // 40 // no data + "svc_fog", // 41 // [byte] density [byte] red [byte] + // green [byte] blue [float] time + "svc_spawnbaseline2", // 42 // support for large modelindex, large + // framenum, alpha, using flags + "svc_spawnstatic2", // 43 // support for large modelindex, large + // framenum, alpha, using flags + "svc_spawnstaticsound2", // 44 // [coord3] [short] samp [byte] vol + //[byte] aten + "svc_particle2", // 45 + "svc_worldtext_hmake", // 46 + "svc_worldtext_hsettext", // 47 + "svc_worldtext_hsetpos", // 48 + "svc_worldtext_hsetangles", // 49 + "svc_worldtext_hsethalign", // 50 // johnfitz }; bool warn_about_nehahra_protocol; // johnfitz -extern glm::vec3 v_punchangles[2]; // johnfitz +extern qvec3 v_punchangles[2]; // johnfitz //============================================================================= @@ -132,17 +152,9 @@ CL_ParseStartSoundPacket */ void CL_ParseStartSoundPacket() { - glm::vec3 pos; - int channel; - - int ent; - int sound_num; + int field_mask = MSG_ReadByte(); int volume; - int field_mask; float attenuation; - int i; - - field_mask = MSG_ReadByte(); if(field_mask & SND_VOLUME) { @@ -163,6 +175,8 @@ void CL_ParseStartSoundPacket() } // johnfitz -- PROTOCOL_FITZQUAKE + int ent; + int channel; if(field_mask & SND_LARGEENTITY) { ent = (unsigned short)MSG_ReadShort(); @@ -175,6 +189,7 @@ void CL_ParseStartSoundPacket() channel &= 7; } + int sound_num; if(field_mask & SND_LARGESOUND) { sound_num = (unsigned short)MSG_ReadShort(); @@ -198,10 +213,7 @@ void CL_ParseStartSoundPacket() Host_Error("CL_ParseStartSoundPacket: ent = %i", ent); } - for(i = 0; i < 3; i++) - { - pos[i] = MSG_ReadCoord(cl.protocolflags); - } + const qvec3 pos = MSG_ReadVec3(cl.protocolflags); S_StartSound(ent, channel, cl.sound_precache[sound_num], pos, volume / 255.0, attenuation); @@ -304,6 +316,7 @@ void CL_ParseServerInfo() // wipe the client_state_t struct // CL_ClearState(); + VR_OnClientClearState(); // parse protocol version number i = MSG_ReadLong(); @@ -628,12 +641,9 @@ void CL_ParseUpdate(int bits) else { target[index] = baselineData[index]; - }; + } }; - // TODO VR: (P1) remove, this should be set only when scale changes - bits |= U_SCALE; - // clang-format off doIt(&MSG_ReadCoord, U_ORIGIN1, ent->msg_origins[0], ent->baseline.origin, 0); doIt(&MSG_ReadAngle, U_ANGLE1, ent->msg_angles[0], ent->baseline.angles, 0); @@ -650,9 +660,7 @@ void CL_ParseUpdate(int bits) if(bits & U_SCALE) { - ent->scale_origin[0] = MSG_ReadCoord(cl.protocolflags); - ent->scale_origin[1] = MSG_ReadCoord(cl.protocolflags); - ent->scale_origin[2] = MSG_ReadCoord(cl.protocolflags); + ent->scale_origin = MSG_ReadVec3(cl.protocolflags); } // johnfitz -- lerping for movetype_step entities @@ -719,7 +727,7 @@ void CL_ParseUpdate(int bits) b = MSG_ReadFloat(); // alpha if(a == 2) { - MSG_ReadFloat(); // fullbright (not using this yet) + (void)MSG_ReadFloat(); // fullbright (not using this yet) } ent->alpha = ENTALPHA_ENCODE(b); } @@ -817,13 +825,9 @@ Server information pertaining to this client only */ void CL_ParseClientdata() { - int i; - - int j; - int bits; // johnfitz - - bits = (unsigned int)MSG_ReadLong(); // johnfitz -- read bits here isntead - // of in CL_ParseServerMessage() + int bits = + (unsigned int)MSG_ReadLong(); // johnfitz -- read bits here isntead + // of in CL_ParseServerMessage() // johnfitz -- PROTOCOL_FITZQUAKE if(bits & SU_EXTEND1) @@ -855,7 +859,7 @@ void CL_ParseClientdata() } cl.mvelocity[1] = cl.mvelocity[0]; - for(i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) { if(bits & (SU_PUNCH1 << i)) { @@ -887,13 +891,14 @@ void CL_ParseClientdata() // johnfitz // [always sent] if (bits & SU_ITEMS) - i = MSG_ReadLong(); + int i = MSG_ReadLong(); + // TODO VR: (P1) should we send other item flags as well? if(cl.items != i) { // set flash times Sbar_Changed(); - for(j = 0; j < 32; j++) + for(int j = 0; j < 32; j++) { if((i & (1 << j)) && !(cl.items & (1 << j))) { @@ -978,9 +983,9 @@ void CL_ParseClientdata() Sbar_Changed(); } - for(i = 0; i < 4; i++) + for(int i = 0; i < 4; i++) { - j = MSG_ReadByte(); + int j = MSG_ReadByte(); if(cl.stats[STAT_SHELLS + i] != j) { cl.stats[STAT_SHELLS + i] = j; @@ -1075,22 +1080,33 @@ void CL_ParseClientdata() // TODO VR: (P2) weapon ids in holsters - not sure what this todo is // checking, need to check what is being sent. I think model strings are // being sent and used as keys... - cl.stats[STAT_HOLSTERWEAPON0] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPON1] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPON2] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPON3] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPON4] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPON5] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPONMODEL0] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPONMODEL1] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPONMODEL2] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPONMODEL3] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPONMODEL4] = MSG_ReadByte(); - cl.stats[STAT_HOLSTERWEAPONMODEL5] = MSG_ReadByte(); + if(bits & SU_VR_HOLSTERS) + { + cl.stats[STAT_HOLSTERWEAPON0] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPON1] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPON2] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPON3] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPON4] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPON5] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONMODEL0] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONMODEL1] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONMODEL2] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONMODEL3] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONMODEL4] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONMODEL5] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONFLAGS0] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONFLAGS1] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONFLAGS2] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONFLAGS3] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONFLAGS4] = MSG_ReadByte(); + cl.stats[STAT_HOLSTERWEAPONFLAGS5] = MSG_ReadByte(); + } // TODO VR: (P2) some data is sent twice, can optimize for MP cl.stats[STAT_MAINHAND_WID] = MSG_ReadByte(); cl.stats[STAT_OFFHAND_WID] = MSG_ReadByte(); + cl.stats[STAT_WEAPONFLAGS] = MSG_ReadByte(); + cl.stats[STAT_WEAPONFLAGS2] = MSG_ReadByte(); // johnfitz -- lerping // ericw -- this was done before the upper 8 bits of @@ -1211,18 +1227,14 @@ CL_ParseStaticSound */ void CL_ParseStaticSound(int version) // johnfitz -- added argument { - glm::vec3 org; + qvec3 org; int sound_num; int vol; int atten; - int i; - for(i = 0; i < 3; i++) - { - org[i] = MSG_ReadCoord(cl.protocolflags); - } + org = MSG_ReadVec3(cl.protocolflags); // johnfitz -- PROTOCOL_FITZQUAKE if(version == 2) @@ -1589,6 +1601,36 @@ void CL_ParseServerMessage() CL_ParseStaticSound(2); break; // johnfitz + + case svc_worldtext_hmake: + { + cl.OnMsg_WorldTextHMake(); + break; + } + + case svc_worldtext_hsettext: + { + cl.OnMsg_WorldTextHSetText(); + break; + } + + case svc_worldtext_hsetpos: + { + cl.OnMsg_WorldTextHSetPos(); + break; + } + + case svc_worldtext_hsetangles: + { + cl.OnMsg_WorldTextHSetAngles(); + break; + } + + case svc_worldtext_hsethalign: + { + cl.OnMsg_WorldTextHSetHAlign(); + break; + } } lastcmd = cmd; // johnfitz diff --git a/Quake/cl_tent.cpp b/Quake/cl_tent.cpp index dd65228b..42576a6c 100644 --- a/Quake/cl_tent.cpp +++ b/Quake/cl_tent.cpp @@ -25,6 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "vr.hpp" #include "util.hpp" +#include "console.hpp" +#include "glquake.hpp" +#include "msg.hpp" +#include "q_sound.hpp" +#include "client.hpp" +#include "sys.hpp" struct qmodel_t; @@ -56,15 +62,6 @@ void CL_InitTEnts() cl_sfx_r_exp3 = S_PrecacheSound("weapons/r_exp3.wav"); } -[[nodiscard]] static glm::vec3 readVectorFromProtocolFlags() noexcept -{ - glm::vec3 res; - res[0] = MSG_ReadCoord(cl.protocolflags); - res[1] = MSG_ReadCoord(cl.protocolflags); - res[2] = MSG_ReadCoord(cl.protocolflags); - return res; -} - /* ================= CL_ParseBeam @@ -74,8 +71,8 @@ beam_t* CL_ParseBeam(qmodel_t* m) { const int ent = MSG_ReadShort(); const int disambiguator = MSG_ReadByte(); - const glm::vec3 start = readVectorFromProtocolFlags(); - const glm::vec3 end = readVectorFromProtocolFlags(); + const auto start = MSG_ReadVec3(cl.protocolflags); + const auto end = MSG_ReadVec3(cl.protocolflags); const auto initBeam = [&](beam_t& b) { b.entity = ent; @@ -136,7 +133,7 @@ void CL_ParseTEnt() { case TE_WIZSPIKE: // spike hitting wall { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_RunParticleEffect_BulletPuff(pos, vec3_zero, 20, 30); S_StartSound(-1, 0, cl_sfx_wizhit, pos, 1, 1); break; @@ -144,7 +141,7 @@ void CL_ParseTEnt() case TE_KNIGHTSPIKE: // spike hitting wall { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_RunParticleEffect_BulletPuff(pos, vec3_zero, 226, 20); S_StartSound(-1, 0, cl_sfx_knighthit, pos, 1, 1); break; @@ -152,7 +149,7 @@ void CL_ParseTEnt() case TE_SPIKE: // spike hitting wall { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_RunParticleEffect_BulletPuff(pos, vec3_zero, 0, 10); if(rand() % 5) { @@ -179,7 +176,7 @@ void CL_ParseTEnt() case TE_SUPERSPIKE: // super spike hitting wall { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_RunParticleEffect_BulletPuff(pos, vec3_zero, 0, 20); if(rand() % 5) @@ -207,14 +204,14 @@ void CL_ParseTEnt() case TE_GUNSHOT: // bullet hitting wall { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_RunParticleEffect_BulletPuff(pos, vec3_zero, 0, 10); break; } case TE_EXPLOSION: // rocket explosion { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_ParticleExplosion(pos); dlight_t* dl = CL_AllocDlight(0); dl->origin = pos; @@ -227,7 +224,7 @@ void CL_ParseTEnt() case TE_TAREXPLOSION: // tarbaby explosion { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_ParticleExplosion(pos); S_StartSound(-1, 0, cl_sfx_r_exp3, pos, 1, 1); @@ -248,8 +245,8 @@ void CL_ParseTEnt() { qmodel_t* model = Mod_ForName("progs/bolt2.mdl", true); auto* hdr = (aliashdr_t*)Mod_Extradata(model); - hdr->scale_origin = hdr->original_scale_origin * 0.5f; - hdr->scale = hdr->original_scale * 0.5f; + hdr->scale_origin = hdr->original_scale_origin * 0.5_qf; + hdr->scale = hdr->original_scale * 0.5_qf; if(beam_t* b = CL_ParseBeam(model)) { @@ -277,11 +274,11 @@ void CL_ParseTEnt() { qmodel_t* model = Mod_ForName("progs/beam.mdl", true); auto* hdr = (aliashdr_t*)Mod_Extradata(model); - hdr->scale_origin = hdr->original_scale_origin * 0.25f; - hdr->scale = hdr->original_scale * 0.25f; + hdr->scale_origin = hdr->original_scale_origin * 0.25_qf; + hdr->scale = hdr->original_scale * 0.25_qf; - hdr->scale[0] = hdr->original_scale[0] * 0.12f; - hdr->scale_origin[0] = hdr->original_scale_origin[0] * 0.12f; + hdr->scale[0] = hdr->original_scale[0] * 0.12_qf; + hdr->scale_origin[0] = hdr->original_scale_origin[0] * 0.12_qf; if(beam_t* b = CL_ParseBeam(model)) { @@ -297,29 +294,27 @@ void CL_ParseTEnt() case TE_LAVASPLASH: { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_LavaSplash(pos); break; } case TE_TELEPORT: { - const glm::vec3 pos = readVectorFromProtocolFlags(); + const auto pos = MSG_ReadVec3(cl.protocolflags); R_TeleportSplash(pos); break; } case TE_EXPLOSION2: // color mapped explosion { - const glm::vec3 pos = readVectorFromProtocolFlags(); - R_ParticleExplosion(pos); + const auto pos = MSG_ReadVec3(cl.protocolflags); const int colorStart = MSG_ReadByte(); const int colorLength = MSG_ReadByte(); - (void)colorStart; // still need to read the byte to avoid issues - (void)colorLength; // still need to read the byte to avoid issues - - // TODO VR: (P2) unused above ^ - // R_ParticleExplosion2(pos, colorStart, colorLength); + + // TODO VR: (P2): consider rewriting to use hue in fragment shader + R_ParticleExplosion2(pos, colorStart, colorLength); + dlight_t* dl = CL_AllocDlight(0); dl->origin = pos; dl->radius = 350; @@ -381,7 +376,7 @@ void CL_UpdateTEnts() } // calculate pitch and yaw - glm::vec3 dist = b.end - b.start; + auto dist = b.end - b.start; float pitch; float yaw; @@ -415,8 +410,8 @@ void CL_UpdateTEnts() } // add new entities for the lightning - glm::vec3 org = b.start; - float d = glm::length(dist); + auto org = b.start; + auto d = glm::length(dist); dist = safeNormalize(dist); const float incr = 30.f * b.scaleRatioX; diff --git a/Quake/client.cpp b/Quake/client.cpp new file mode 100644 index 00000000..e8b0aa4e --- /dev/null +++ b/Quake/client.cpp @@ -0,0 +1,70 @@ +#include "client.hpp" +#include "msg.hpp" + +[[nodiscard]] bool client_state_t::isValidWorldTextHandle( + const WorldTextHandle wth) const noexcept +{ + return (worldTexts.size() < maxWorldTextInstances) && + (static_cast<WorldTextHandle>(worldTexts.size()) > wth); +} + +void client_state_t::OnMsg_WorldTextHMake() noexcept +{ + const WorldTextHandle wth = MSG_ReadShort(); + + cl.worldTexts.resize(wth + 1); + assert(isValidWorldTextHandle(wth)); +} + +void client_state_t::OnMsg_WorldTextHSetText() noexcept +{ + const WorldTextHandle wth = MSG_ReadShort(); + assert(isValidWorldTextHandle(wth)); + + const char* str = MSG_ReadString(); + + if(isValidWorldTextHandle(wth)) + { + cl.worldTexts[wth]._text = str; + } +} + +void client_state_t::OnMsg_WorldTextHSetPos() noexcept +{ + const WorldTextHandle wth = MSG_ReadShort(); + assert(isValidWorldTextHandle(wth)); + + const qvec3 v = MSG_ReadVec3(cl.protocolflags); + + if(isValidWorldTextHandle(wth)) + { + cl.worldTexts[wth]._pos = v; + } +} + +void client_state_t::OnMsg_WorldTextHSetAngles() noexcept +{ + const WorldTextHandle wth = MSG_ReadShort(); + assert(isValidWorldTextHandle(wth)); + + const qvec3 v = MSG_ReadVec3(cl.protocolflags); + + if(isValidWorldTextHandle(wth)) + { + cl.worldTexts[wth]._angles = v; + } +} + +void client_state_t::OnMsg_WorldTextHSetHAlign() noexcept +{ + const WorldTextHandle wth = MSG_ReadShort(); + assert(isValidWorldTextHandle(wth)); + + const auto b = MSG_ReadByte(); + const auto v = static_cast<WorldText::HAlign>(b); + + if(isValidWorldTextHandle(wth)) + { + cl.worldTexts[wth]._hAlign = v; + } +} diff --git a/Quake/client.hpp b/Quake/client.hpp index d98bb35b..7df53114 100644 --- a/Quake/client.hpp +++ b/Quake/client.hpp @@ -21,29 +21,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _CLIENT_H_ -#define _CLIENT_H_ - -#define CSHIFT_CONTENTS 0 -#define CSHIFT_DAMAGE 1 -#define CSHIFT_BONUS 2 -#define CSHIFT_POWERUP 3 -#define NUM_CSHIFTS 4 -#define NAME_LENGTH 64 -#define SIGNONS 4 // signon messages to receive before connected -#define MAX_DLIGHTS 64 // johnfitz -- was 32 -#define MAX_BEAMS 128 // johnfitz -- was 24 -#define MAX_MAPSTRING 2048 -#define MAX_DEMOS 8 -#define MAX_DEMONAME 16 -#define MAX_TEMP_ENTITIES 512 // johnfitz -- was 64 -#define MAX_STATIC_ENTITIES 4096 // ericw -- was 512 //johnfitz -- was 128 -#define MAX_VISEDICTS 4096 // larger, now we support BSP2 - -#include "quakeglm.hpp" +#pragma once + +#include "render.hpp" +#include "world.hpp" +#include "keys.hpp" +#include "quakeglm_qvec3.hpp" #include "quakedef.hpp" +#include "worldtext.hpp" +#include "common.hpp" +#include "gl_model.hpp" +#include "quakedef_macros.hpp" +#include "sizebuf.hpp" -// client.h +#include <vector> typedef struct { @@ -77,13 +68,13 @@ typedef struct struct dlight_t { - glm::vec3 origin; + qvec3 origin; float radius; float die; // stop lighting after this time float decay; // drop this each second float minlight; // don't add when contributing less int key; - glm::vec3 color; // johnfitz -- lit support via lordhavoc + qvec3 color; // johnfitz -- lit support via lordhavoc }; @@ -93,10 +84,12 @@ struct beam_t int disambiguator; qmodel_t* model; float endtime; - glm::vec3 start, end; + qvec3 start, end; bool spin; float scaleRatioX; -} ; + // SomeEnum special; // TODO VR: (P1) consider adding this and experiment + // with particles/dlights +}; @@ -173,25 +166,26 @@ struct client_state_t // sent to the server each frame. The server sets punchangle when // the view is temporarliy offset, and an angle reset commands at the start // of each level and after teleporting. - glm::vec3 mviewangles[2]; // during demo playback viewangles is lerped - // between these - glm::vec3 viewangles; - - glm::vec3 aimangles; - glm::vec3 vmeshoffset; - glm::vec3 handpos[2]; - glm::vec3 handrot[2]; - glm::vec3 prevhandrot[2]; - glm::vec3 handvel[2]; - glm::vec3 handthrowvel[2]; + qvec3 mviewangles[2]; // during demo playback viewangles is lerped + // between these + qvec3 viewangles; + + qvec3 aimangles; + qvec3 vmeshoffset; + qvec3 handpos[2]; + qvec3 handrot[2]; + qvec3 prevhandrot[2]; + qvec3 handvel[2]; + qvec3 handthrowvel[2]; float handvelmag[2]; - glm::vec3 handavel[2]; + qvec3 handavel[2]; + qvec3 headvel; - glm::vec3 mvelocity[2]; // update by server, used for lean+bob - // (0 is newest) - glm::vec3 velocity; // lerped between mvelocity[0] and [1] + qvec3 mvelocity[2]; // update by server, used for lean+bob + // (0 is newest) + qvec3 velocity; // lerped between mvelocity[0] and [1] - glm::vec3 punchangle; // temporary offset + qvec3 punchangle; // temporary offset // pitch drifting vars float idealpitch; @@ -234,7 +228,7 @@ struct client_state_t // refresh related state qmodel_t* worldmodel; // cl_entities[0].model - struct efrag_s* free_efrags; + struct efrag_t* free_efrags; int num_efrags; int num_entities; // held in cl_entities array int num_statics; // held in cl_staticentities array @@ -249,13 +243,30 @@ struct client_state_t entity_t left_upper_holster; entity_t right_upper_holster; entity_t vrtorso; - entity_t left_hand; - entity_t right_hand; entity_t left_hip_holster_slot; entity_t right_hip_holster_slot; entity_t left_upper_holster_slot; entity_t right_upper_holster_slot; + entity_t mainhand_wpn_button; + entity_t offhand_wpn_button; + + struct hand_entities + { + entity_t base; + entity_t f_thumb; + entity_t f_index; + entity_t f_middle; + entity_t f_ring; + entity_t f_pinky; + }; + + hand_entities left_hand_entities; + hand_entities right_hand_entities; + + hand_entities left_hand_ghost_entities; + hand_entities right_hand_ghost_entities; + int cdtrack, looptrack; // cd audio // frag scoreboard @@ -263,8 +274,74 @@ struct client_state_t unsigned protocol; // johnfitz unsigned protocolflags; + + std::vector<WorldText> worldTexts; + + int hotspot[2]; + + [[nodiscard]] bool isValidWorldTextHandle( + const WorldTextHandle wth) const noexcept; + + void OnMsg_WorldTextHMake() noexcept; + void OnMsg_WorldTextHSetText() noexcept; + void OnMsg_WorldTextHSetPos() noexcept; + void OnMsg_WorldTextHSetAngles() noexcept; + void OnMsg_WorldTextHSetHAlign() noexcept; }; +template <typename F> +bool anyViewmodel(client_state_t& clientState, F&& f) +{ + return // + f(clientState.viewent) // + || f(clientState.offhand_viewent) // + || f(clientState.left_hip_holster) // + || f(clientState.right_hip_holster) // + || f(clientState.left_upper_holster) // + || f(clientState.right_upper_holster) // + || f(clientState.vrtorso) // + || f(clientState.left_hip_holster_slot) // + || f(clientState.right_hip_holster_slot) // + || f(clientState.left_upper_holster_slot) // + || f(clientState.right_upper_holster_slot) // + || f(clientState.mainhand_wpn_button) // + || f(clientState.offhand_wpn_button) // + || f(clientState.left_hand_entities.base) // + || f(clientState.left_hand_entities.f_thumb) // + || f(clientState.left_hand_entities.f_index) // + || f(clientState.left_hand_entities.f_middle) // + || f(clientState.left_hand_entities.f_ring) // + || f(clientState.left_hand_entities.f_pinky) // + || f(clientState.right_hand_entities.base) // + || f(clientState.right_hand_entities.f_thumb) // + || f(clientState.right_hand_entities.f_index) // + || f(clientState.right_hand_entities.f_middle) // + || f(clientState.right_hand_entities.f_ring) // + || f(clientState.right_hand_entities.f_pinky) // + || f(clientState.left_hand_ghost_entities.base) // + || f(clientState.left_hand_ghost_entities.f_thumb) // + || f(clientState.left_hand_ghost_entities.f_index) // + || f(clientState.left_hand_ghost_entities.f_middle) // + || f(clientState.left_hand_ghost_entities.f_ring) // + || f(clientState.left_hand_ghost_entities.f_pinky) // + || f(clientState.right_hand_ghost_entities.base) // + || f(clientState.right_hand_ghost_entities.f_thumb) // + || f(clientState.right_hand_ghost_entities.f_index) // + || f(clientState.right_hand_ghost_entities.f_middle) // + || f(clientState.right_hand_ghost_entities.f_ring) // + || f(clientState.right_hand_ghost_entities.f_pinky); +} + +template <typename F> +void forAllViewmodels(client_state_t& clientState, F&& f) +{ + anyViewmodel(clientState, [&](entity_t& e) { + f(e); + return false; + }); +} + + // // cvars @@ -325,19 +402,19 @@ extern int cl_max_edicts; // johnfitz -- only changes when new map loads // cl_main // dlight_t* CL_AllocDlight(int key); -void CL_DecayLights(void); +void CL_DecayLights(); -void CL_Init(void); +void CL_Init(); void CL_EstablishConnection(const char* host); -void CL_Signon1(void); -void CL_Signon2(void); -void CL_Signon3(void); -void CL_Signon4(void); +void CL_Signon1(); +void CL_Signon2(); +void CL_Signon3(); +void CL_Signon4(); -void CL_Disconnect(void); -void CL_Disconnect_f(void); -void CL_NextDemo(void); +void CL_Disconnect(); +void CL_Disconnect_f(); +void CL_NextDemo(); // // cl_input @@ -353,64 +430,62 @@ extern kbutton_t in_strafe; extern kbutton_t in_speed; extern kbutton_t in_grableft, in_grabright; -void CL_InitInput(void); -void CL_SendCmd(void); +void CL_InitInput(); +void CL_SendCmd(); void CL_SendMove(const usercmd_t* cmd); -int CL_ReadFromServer(void); +int CL_ReadFromServer(); void CL_BaseMove(usercmd_t* cmd); -void CL_ParseTEnt(void); -void CL_UpdateTEnts(void); +void CL_ParseTEnt(); +void CL_UpdateTEnts(); -void CL_ClearState(void); +void CL_ClearState(); // // cl_demo.c // -void CL_StopPlayback(void); -int CL_GetMessage(void); +void CL_StopPlayback(); +int CL_GetMessage(); -void CL_Stop_f(void); -void CL_Record_f(void); -void CL_PlayDemo_f(void); -void CL_TimeDemo_f(void); +void CL_Stop_f(); +void CL_Record_f(); +void CL_PlayDemo_f(); +void CL_TimeDemo_f(); // // cl_parse.c // -void CL_ParseServerMessage(void); +void CL_ParseServerMessage(); void CL_NewTranslation(int slot); // // view // -void V_StartPitchDrift(void); -void V_StopPitchDrift(void); +void V_StartPitchDrift(); +void V_StopPitchDrift(); -void V_RenderView(void); -// void V_UpdatePalette (void); //johnfitz -void V_Register(void); -void V_ParseDamage(void); +void V_RenderView(); +// void V_UpdatePalette (); //johnfitz +void V_Register(); +void V_ParseDamage(); void V_SetContentsColor(int contents); // // cl_tent // -void CL_InitTEnts(void); -void CL_SignonReply(void); +void CL_InitTEnts(); +void CL_SignonReply(); // // chase // extern cvar_t chase_active; -void Chase_Init(void); +void Chase_Init(); struct trace_t; -[[nodiscard]] trace_t TraceLine(const glm::vec3& start, const glm::vec3& end); +[[nodiscard]] trace_t TraceLine(const qvec3& start, const qvec3& end); [[nodiscard]] trace_t TraceLineToEntity( - const glm::vec3& start, const glm::vec3& end, edict_t* ent); -void Chase_UpdateForClient(void); // johnfitz + const qvec3& start, const qvec3& end, edict_t* ent); +void Chase_UpdateForClient(); // johnfitz void Chase_UpdateForDrawing(refdef_t& refdef, entity_t* viewent); // johnfitz - -#endif /* _CLIENT_H_ */ diff --git a/Quake/cmd.cpp b/Quake/cmd.cpp index 54adbc1b..0b46797f 100644 --- a/Quake/cmd.cpp +++ b/Quake/cmd.cpp @@ -24,8 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // cmd.c -- Quake script command processing module #include "quakedef.hpp" - - +#include "cmd.hpp" +#include "console.hpp" +#include "zone.hpp" +#include "msg.hpp" +#include "common.hpp" +#include "client.hpp" +#include "sys.hpp" #define MAX_ALIAS_NAME 32 diff --git a/Quake/cmd.hpp b/Quake/cmd.hpp index d4d1b845..75a42a05 100644 --- a/Quake/cmd.hpp +++ b/Quake/cmd.hpp @@ -21,8 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_CMD_H -#define _QUAKE_CMD_H +#pragma once // cmd.h -- Command buffer and command execution @@ -40,7 +39,7 @@ The game starts with a Cbuf_AddText ("exec quake.rc\n"); Cbuf_Execute (); */ -void Cbuf_Init(void); +void Cbuf_Init(); // allocates an initial text buffer that will grow as needed void Cbuf_AddText(const char* text); @@ -52,7 +51,7 @@ void Cbuf_InsertText(const char* text); // inserted at the beginning of the buffer, before any remaining unexecuted // commands. -void Cbuf_Execute(void); +void Cbuf_Execute(); // Pulls off \n terminated lines of text from the command buffer and sends // them through Cmd_ExecuteString. Stops when the buffer is empty. // Normally called once per frame, but may be explicitly invoked. @@ -71,7 +70,7 @@ not apropriate. */ -typedef void (*xcommand_t)(void); +typedef void (*xcommand_t)(); typedef enum { @@ -82,7 +81,7 @@ typedef enum extern cmd_source_t cmd_source; -void Cmd_Init(void); +void Cmd_Init(); void Cmd_AddCommand(const char* cmd_name, xcommand_t function); // called by the init functions of other parts of the program to @@ -96,9 +95,9 @@ const char* Cmd_CompleteCommand(const char* partial); // attempts to match a partial command for automatic command line completion // returns nullptr if nothing fits -int Cmd_Argc(void); +int Cmd_Argc(); const char* Cmd_Argv(int arg); -const char* Cmd_Args(void); +const char* Cmd_Args(); // The functions that execute commands get their parameters with these // functions. Cmd_Argv () will return an empty string, not a nullptr // if arg > argc, so string operations are allways safe. @@ -115,7 +114,7 @@ void Cmd_ExecuteString(const char* text, cmd_source_t src); // Parses a single line of text into arguments and tries to execute it. // The text can come from the command buffer, a remote client, or stdin. -void Cmd_ForwardToServer(void); +void Cmd_ForwardToServer(); // adds the current command line as a clc_stringcmd to the client message. // things like godmode, noclip, etc, are commands directed to the server, // so when they are typed in at the console, they will need to be forwarded. @@ -123,5 +122,3 @@ void Cmd_ForwardToServer(void); void Cmd_Print(const char* text); // used by command functions to send output to either the graphics console or // passed as a print message to the client - -#endif /* _QUAKE_CMD_H */ diff --git a/Quake/common.cpp b/Quake/common.cpp index 48a6c3da..03111503 100644 --- a/Quake/common.cpp +++ b/Quake/common.cpp @@ -23,10 +23,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // common.c -- misc functions used in client and server -#include "quakedef.hpp" +#include "common.hpp" +#include "host.hpp" #include "q_ctype.hpp" -#include <errno.h> +#include "cmd.hpp" +#include "console.hpp" +#include "zone.hpp" +#include "quakeparms.hpp" +#include "crc.hpp" +#include "net.hpp" +#include "mathlib.hpp" +#include "glquake.hpp" +#include "zone.hpp" +#include "sizebuf.hpp" +#include "msg.hpp" #include "vr.hpp" +#include "byteorder.hpp" +#include "vr_cvars.hpp" +#include "sys.hpp" +#include "client.hpp" +#include "draw.hpp" +#include "gl_texmgr.hpp" + +#include <cerrno> +#include <string_view> +#include <string> +#include <vector> static char* largv[MAX_NUM_ARGVS + 1]; static char argvdummy[] = " "; @@ -41,8 +63,6 @@ cvar_t cmdline = { static bool com_modified; // set true if using non-id files -bool fitzmode; - static void COM_Path_f(); // if a packfile directory differs from this, it is assumed to be hacked @@ -61,6 +81,7 @@ char** com_argv; #define CMDLINE_LENGTH 256 /* johnfitz -- mirrored in cmd.c */ char com_cmdline[CMDLINE_LENGTH]; +// TODO VR: (P1) remove rogue/hipnotic special cases bool standard_quake = true, rogue, hipnotic; // this graphic needs to be in the pak file to use registered features @@ -650,533 +671,6 @@ float Q_atof(const char* str) return val * sign; } -/* -============================================================================ - - BYTE ORDER FUNCTIONS - -============================================================================ -*/ - -bool host_bigendian; - -short (*BigShort)(short l); -short (*LittleShort)(short l); -int (*BigLong)(int l); -int (*LittleLong)(int l); -float (*BigFloat)(float l); -float (*LittleFloat)(float l); - -short ShortSwap(short l) -{ - byte b1; - - byte b2; - - b1 = l & 255; - b2 = (l >> 8) & 255; - - return (b1 << 8) + b2; -} - -short ShortNoSwap(short l) -{ - return l; -} - -int LongSwap(int l) -{ - byte b1; - - byte b2; - - byte b3; - - byte b4; - - b1 = l & 255; - b2 = (l >> 8) & 255; - b3 = (l >> 16) & 255; - b4 = (l >> 24) & 255; - - return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4; -} - -int LongNoSwap(int l) -{ - return l; -} - -float FloatSwap(float f) -{ - union - { - float f; - byte b[4]; - } dat1, dat2; - - - dat1.f = f; - dat2.b[0] = dat1.b[3]; - dat2.b[1] = dat1.b[2]; - dat2.b[2] = dat1.b[1]; - dat2.b[3] = dat1.b[0]; - return dat2.f; -} - -float FloatNoSwap(float f) -{ - return f; -} - -/* -============================================================================== - - MESSAGE IO FUNCTIONS - -Handles byte ordering and avoids alignment errors -============================================================================== -*/ - -// -// writing functions -// - -void MSG_WriteChar(sizebuf_t* sb, int c) -{ - byte* buf; - -#ifdef PARANOID - // TODO VR: (P2) always fires - // if(c < -128 || c > 127) Sys_Error("MSG_WriteChar: range error"); -#endif - - buf = (byte*)SZ_GetSpace(sb, 1); - buf[0] = c; -} - -void MSG_WriteByte(sizebuf_t* sb, int c) -{ - byte* buf; - -#ifdef PARANOID - // TODO VR: (P2) always fires - // if(c < 0 || c > 255) Sys_Error("MSG_WriteByte: range error"); -#endif - - buf = (byte*)SZ_GetSpace(sb, 1); - buf[0] = c; -} - -void MSG_WriteShort(sizebuf_t* sb, int c) -{ - byte* buf; - -#ifdef PARANOID - // TODO VR: (P2) always fires - // if(c < ((short)0x8000) || c > (short)0x7fff) - // Sys_Error("MSG_WriteShort: range error"); -#endif - - buf = (byte*)SZ_GetSpace(sb, 2); - buf[0] = c & 0xff; - buf[1] = c >> 8; -} - -void MSG_WriteLong(sizebuf_t* sb, int c) -{ - byte* buf; - - buf = (byte*)SZ_GetSpace(sb, 4); - buf[0] = c & 0xff; - buf[1] = (c >> 8) & 0xff; - buf[2] = (c >> 16) & 0xff; - buf[3] = c >> 24; -} - -void MSG_WriteFloat(sizebuf_t* sb, float f) -{ - union - { - float f; - int l; - } dat; - - dat.f = f; - dat.l = LittleLong(dat.l); - - SZ_Write(sb, &dat.l, 4); -} - -void MSG_WriteString(sizebuf_t* sb, const char* s) -{ - if(!s) - { - SZ_Write(sb, "", 1); - } - else - { - SZ_Write(sb, s, Q_strlen(s) + 1); - } -} - -// johnfitz -- original behavior, 13.3 fixed point coords, max range +-4096 -void MSG_WriteCoord16(sizebuf_t* sb, float f) -{ - MSG_WriteShort(sb, Q_rint(f * 8)); -} - -// johnfitz -- 16.8 fixed point coords, max range +-32768 -void MSG_WriteCoord24(sizebuf_t* sb, float f) -{ - MSG_WriteShort(sb, f); - MSG_WriteByte(sb, (int)(f * 255) % 255); -} - -// johnfitz -- 32-bit float coords -void MSG_WriteCoord32f(sizebuf_t* sb, float f) -{ - MSG_WriteFloat(sb, f); -} - -void MSG_WriteCoord(sizebuf_t* sb, float f, unsigned int flags) -{ - if(flags & PRFL_FLOATCOORD) - { - MSG_WriteFloat(sb, f); - } - else if(flags & PRFL_INT32COORD) - { - MSG_WriteLong(sb, Q_rint(f * 16)); - } - else if(flags & PRFL_24BITCOORD) - { - MSG_WriteCoord24(sb, f); - } - else - { - MSG_WriteCoord16(sb, f); - } -} - -void MSG_WriteAngle(sizebuf_t* sb, float f, unsigned int flags) -{ - if(flags & PRFL_FLOATANGLE) - { - MSG_WriteFloat(sb, f); - } - else if(flags & PRFL_SHORTANGLE) - { - MSG_WriteShort(sb, Q_rint(f * 65536.0 / 360.0) & 65535); - } - else - { - MSG_WriteByte( - sb, Q_rint(f * 256.0 / 360.0) & - 255); // johnfitz -- use Q_rint instead of (int) } - } -} - -// johnfitz -- for PROTOCOL_FITZQUAKE -void MSG_WriteAngle16(sizebuf_t* sb, float f, unsigned int flags) -{ - if(flags & PRFL_FLOATANGLE) - { - MSG_WriteFloat(sb, f); - } - else - { - MSG_WriteShort(sb, Q_rint(f * 65536.0 / 360.0) & 65535); - } -} -// johnfitz - -// -// reading functions -// -int msg_readcount; -bool msg_badread; - -void MSG_BeginReading() -{ - msg_readcount = 0; - msg_badread = false; -} - -// returns -1 and sets msg_badread if no more characters are available -int MSG_ReadChar() -{ - int c; - - if(msg_readcount + 1 > net_message.cursize) - { - msg_badread = true; - return -1; - } - - c = (signed char)net_message.data[msg_readcount]; - msg_readcount++; - - return c; -} - -int MSG_ReadByte() -{ - int c; - - if(msg_readcount + 1 > net_message.cursize) - { - msg_badread = true; - return -1; - } - - c = (unsigned char)net_message.data[msg_readcount]; - msg_readcount++; - - return c; -} - -int MSG_ReadShort() -{ - int c; - - if(msg_readcount + 2 > net_message.cursize) - { - msg_badread = true; - return -1; - } - - c = (short)(net_message.data[msg_readcount] + - (net_message.data[msg_readcount + 1] << 8)); - - msg_readcount += 2; - - return c; -} - -int MSG_ReadLong() -{ - int c; - - if(msg_readcount + 4 > net_message.cursize) - { - msg_badread = true; - return -1; - } - - c = net_message.data[msg_readcount] + - (net_message.data[msg_readcount + 1] << 8) + - (net_message.data[msg_readcount + 2] << 16) + - (net_message.data[msg_readcount + 3] << 24); - - msg_readcount += 4; - - return c; -} - -float MSG_ReadFloat() -{ - union - { - byte b[4]; - float f; - int l; - } dat; - - dat.b[0] = net_message.data[msg_readcount]; - dat.b[1] = net_message.data[msg_readcount + 1]; - dat.b[2] = net_message.data[msg_readcount + 2]; - dat.b[3] = net_message.data[msg_readcount + 3]; - msg_readcount += 4; - - dat.l = LittleLong(dat.l); - - return dat.f; -} - -const char* MSG_ReadString() -{ - static char string[2048]; - int c; - size_t l; - - l = 0; - do - { - c = MSG_ReadByte(); - if(c == -1 || c == 0) - { - break; - } - string[l] = c; - l++; - } while(l < sizeof(string) - 1); - - string[l] = 0; - - return string; -} - -// johnfitz -- original behavior, 13.3 fixed point coords, max range +-4096 -float MSG_ReadCoord16() -{ - return MSG_ReadShort() * (1.0 / 8); -} - -// johnfitz -- 16.8 fixed point coords, max range +-32768 -float MSG_ReadCoord24() -{ - return MSG_ReadShort() + MSG_ReadByte() * (1.0 / 255); -} - -// johnfitz -- 32-bit float coords -float MSG_ReadCoord32f() -{ - return MSG_ReadFloat(); -} - -float MSG_ReadCoord(unsigned int flags) -{ - if(flags & PRFL_FLOATCOORD) - { - return MSG_ReadFloat(); - } - if(flags & PRFL_INT32COORD) - - { - - return MSG_ReadLong() * (1.0 / 16.0); - } - - else if(flags & PRFL_24BITCOORD) - - { - - return MSG_ReadCoord24(); - } - - else - - { - - return MSG_ReadCoord16(); - } -} - -float MSG_ReadAngle(unsigned int flags) -{ - if(flags & PRFL_FLOATANGLE) - { - return MSG_ReadFloat(); - } - if(flags & PRFL_SHORTANGLE) - - { - - return MSG_ReadShort() * (360.0 / 65536); - } - - else - - { - - return MSG_ReadChar() * (360.0 / 256); - } -} - -// johnfitz -- for PROTOCOL_FITZQUAKE -float MSG_ReadAngle16(unsigned int flags) -{ - if(flags & PRFL_FLOATANGLE) - { - return MSG_ReadFloat(); // make sure - } - - return MSG_ReadShort() * (360.0 / 65536); -} -// johnfitz - -//=========================================================================== - -void SZ_Alloc(sizebuf_t* buf, int startsize) -{ - if(startsize < 256) - { - startsize = 256; - } - buf->data = (byte*)Hunk_AllocName(startsize, "sizebuf"); - buf->maxsize = startsize; - buf->cursize = 0; -} - - -void SZ_Free(sizebuf_t* buf) -{ - // Z_Free (buf->data); - // buf->data = nullptr; - // buf->maxsize = 0; - buf->cursize = 0; -} - -void SZ_Clear(sizebuf_t* buf) -{ - buf->cursize = 0; -} - -void* SZ_GetSpace(sizebuf_t* buf, int length) -{ - void* data; - - if(buf->cursize + length > buf->maxsize) - { - if(!buf->allowoverflow) - { - Host_Error( - "SZ_GetSpace: overflow without allowoverflow set"); // ericw -- - } - // made - // Host_Error - // to be - // less - // annoying - - if(length > buf->maxsize) - { - Sys_Error("SZ_GetSpace: %i is > full buffer size", length); - } - - buf->overflowed = true; - Con_Printf("SZ_GetSpace: overflow"); - SZ_Clear(buf); - } - - data = buf->data + buf->cursize; - buf->cursize += length; - - return data; -} - -void SZ_Write(sizebuf_t* buf, const void* data, int length) -{ - Q_memcpy(SZ_GetSpace(buf, length), data, length); -} - -void SZ_Print(sizebuf_t* buf, const char* data) -{ - int len = Q_strlen(data) + 1; - - if(buf->data[buf->cursize - 1]) - { /* no trailing 0 */ - Q_memcpy((byte*)SZ_GetSpace(buf, len), data, len); - } - else - { /* write over trailing 0 */ - Q_memcpy((byte*)SZ_GetSpace(buf, len - 1) - 1, data, len); - } -} - - -//============================================================================ /* ============ @@ -1520,6 +1014,7 @@ static void COM_CheckRegistered() unsigned short check[128]; int i; + // TODO VR: (P1) could use something similar to detect mission packs COM_OpenFile("gfx/pop.lmp", &h, nullptr); if(h == -1) @@ -1653,55 +1148,8 @@ COM_Init */ void COM_Init() { - int i = 0x12345678; - /* U N I X */ + ByteOrder_Init(); - /* - BE_ORDER: 12 34 56 78 - U N I X - - LE_ORDER: 78 56 34 12 - X I N U - - PDP_ORDER: 34 12 78 56 - N U X I - */ - if(*(char*)&i == 0x12) - { - host_bigendian = true; - } - else if(*(char*)&i == 0x78) - { - host_bigendian = false; - } - else - { /* if ( *(char *)&i == 0x34 ) */ - Sys_Error("Unsupported endianism."); - } - - if(host_bigendian) - { - BigShort = ShortNoSwap; - LittleShort = ShortSwap; - BigLong = LongNoSwap; - LittleLong = LongSwap; - BigFloat = FloatNoSwap; - LittleFloat = FloatSwap; - } - else /* assumed LITTLE_ENDIAN. */ - { - BigShort = ShortSwap; - LittleShort = ShortNoSwap; - BigLong = LongSwap; - LittleLong = LongNoSwap; - BigFloat = FloatSwap; - LittleFloat = FloatNoSwap; - } - - if(COM_CheckParm("-fitz")) - { - fitzmode = true; - } #ifdef _DEBUG Cmd_AddCommand("fitztest", FitzTest_f); // johnfitz #endif @@ -1883,13 +1331,6 @@ can be used for detecting a file's presence. static int COM_FindFile( const char* filename, int* handle, FILE** file, unsigned int* path_id) { - searchpath_t* search; - char netpath[MAX_OSPATH]; - pack_t* pak; - int i; - - int findtime; - if(file && handle) { Sys_Error("COM_FindFile: both handle and file set"); @@ -1900,18 +1341,28 @@ static int COM_FindFile( // // search through the path, one element at a time // - for(search = com_searchpaths; search; search = search->next) + for(searchpath_t* search = com_searchpaths; search; search = search->next) { if(search->pack) /* look through all the pak file elements */ { - pak = search->pack; - for(i = 0; i < pak->numfiles; i++) + pack_t* pak = search->pack; + for(int i = 0; i < pak->numfiles; i++) { if(strcmp(pak->files[i].name, filename) != 0) { continue; } + // VR: This hack allows multiple "start.bsp" maps to coexist. + // The user can decide which one is loaded by setting a CVar. + const auto extractedPakName = VR_ExtractPakName(*pak); + if(std::strcmp(filename, "maps/start.bsp") == 0 && + extractedPakName != VR_GetActiveStartPakName() && + extractedPakName != "pak0") + { + continue; + } + // found it! com_filesize = pak->files[i].filelen; file_from_pak = 1; @@ -1940,7 +1391,6 @@ static int COM_FindFile( return com_filesize; } - else /* for COM_FileExists() */ { return com_filesize; @@ -1949,10 +1399,11 @@ static int COM_FindFile( } else /* check a file in the directory tree */ { + char netpath[MAX_OSPATH]; q_snprintf( netpath, sizeof(netpath), "%s/%s", search->filename, filename); - findtime = Sys_FileTime(netpath); + const int findtime = Sys_FileTime(netpath); if(findtime == -1) { continue; @@ -1965,6 +1416,7 @@ static int COM_FindFile( if(handle) { + int i; com_filesize = Sys_FileOpenRead(netpath, &i); *handle = i; return com_filesize; @@ -2000,10 +1452,12 @@ static int COM_FindFile( { *handle = -1; } + if(file) { *file = nullptr; } + com_filesize = -1; return com_filesize; } @@ -2233,6 +1687,22 @@ byte* COM_LoadMallocFile_TextMode_OSPath(const char* path, long* len_out) return data; } +const char* COM_ParseTimestampNewline(const char* buffer) +{ + int tmp; + int consumed = 0; + + const int rc = sscanf(buffer, "%d-%d-%d %d:%d:%d\n%n", &tmp, &tmp, &tmp, + &tmp, &tmp, &tmp, &consumed); + + if(rc != 6) + { + return nullptr; + } + + return buffer + consumed; +} + const char* COM_ParseIntNewline(const char* buffer, int* value) { int consumed = 0; @@ -2371,6 +1841,7 @@ static void COM_AddGameDirectory(const char* base, const char* dir) search->next = com_searchpaths; com_searchpaths = search; + // VR: This was changed to support non-contiguous `.pak` files. for(int i = 0; i < 99; i++) { char pakfile[MAX_OSPATH]; @@ -2379,7 +1850,7 @@ static void COM_AddGameDirectory(const char* base, const char* dir) pack_t* pak = COM_LoadPackFile(pakfile); pack_t* qspak; - if(i != 0 || path_id != 1 || fitzmode) + if(i != 0 || path_id != 1) { qspak = nullptr; } @@ -2403,7 +1874,7 @@ static void COM_AddGameDirectory(const char* base, const char* dir) search->next = com_searchpaths; com_searchpaths = search; - Con_Printf("Added pakfile to search paths: '%s'\n", pakfile); + VR_OnLoadedPak(*pak); } if(qspak) @@ -2417,8 +1888,8 @@ static void COM_AddGameDirectory(const char* base, const char* dir) if(!pak) { - Con_Printf( - "Could not add pakfile to search paths: '%s'\n", pakfile); + // Con_Printf( + // "Could not add pakfile to search paths: '%s'\n", pakfile); } } @@ -2650,6 +2121,7 @@ void COM_InitFilesystem() // johnfitz -- modified based on topaz's tutorial com_basedir[j - 1] = 0; } + // VR: This starts loading all the `.pak` files. // start up with GAMENAME by default (id1) COM_AddGameDirectory(com_basedir, GAMENAME); @@ -2717,196 +2189,3 @@ void COM_InitFilesystem() // johnfitz -- modified based on topaz's tutorial COM_CheckRegistered(); } - - -/* The following FS_*() stdio replacements are necessary if one is - * to perform non-sequential reads on files reopened on pak files - * because we need the bookkeeping about file start/end positions. - * Allocating and filling in the fshandle_t structure is the users' - * responsibility when the file is initially opened. */ - -size_t FS_fread(void* ptr, size_t size, size_t nmemb, fshandle_t* fh) -{ - long byte_size; - long bytes_read; - size_t nmemb_read; - - if(!fh) - { - errno = EBADF; - return 0; - } - if(!ptr) - { - errno = EFAULT; - return 0; - } - if(!size || !nmemb) - { /* no error, just zero bytes wanted */ - errno = 0; - return 0; - } - - byte_size = nmemb * size; - if(byte_size > fh->length - fh->pos) - { /* just read to end */ - byte_size = fh->length - fh->pos; - } - bytes_read = fread(ptr, 1, byte_size, fh->file); - fh->pos += bytes_read; - - /* fread() must return the number of elements read, - * not the total number of bytes. */ - nmemb_read = bytes_read / size; - /* even if the last member is only read partially - * it is counted as a whole in the return value. */ - if(bytes_read % size) - { - nmemb_read++; - } - - return nmemb_read; -} - -int FS_fseek(fshandle_t* fh, long offset, int whence) -{ - /* I don't care about 64 bit off_t or fseeko() here. - * the quake/hexen2 file system is 32 bits, anyway. */ - int ret; - - if(!fh) - { - errno = EBADF; - return -1; - } - - /* the relative file position shouldn't be smaller - * than zero or bigger than the filesize. */ - switch(whence) - { - case SEEK_SET: break; - case SEEK_CUR: offset += fh->pos; break; - case SEEK_END: offset = fh->length + offset; break; - default: errno = EINVAL; return -1; - } - - if(offset < 0) - { - errno = EINVAL; - return -1; - } - - if(offset > fh->length) - { /* just seek to end */ - offset = fh->length; - } - - ret = fseek(fh->file, fh->start + offset, SEEK_SET); - if(ret < 0) - { - return ret; - } - - fh->pos = offset; - return 0; -} - -int FS_fclose(fshandle_t* fh) -{ - if(!fh) - { - errno = EBADF; - return -1; - } - return fclose(fh->file); -} - -long FS_ftell(fshandle_t* fh) -{ - if(!fh) - { - errno = EBADF; - return -1; - } - return fh->pos; -} - -void FS_rewind(fshandle_t* fh) -{ - if(!fh) - { - return; - } - clearerr(fh->file); - fseek(fh->file, fh->start, SEEK_SET); - fh->pos = 0; -} - -int FS_feof(fshandle_t* fh) -{ - if(!fh) - { - errno = EBADF; - return -1; - } - if(fh->pos >= fh->length) - { - return -1; - } - return 0; -} - -int FS_ferror(fshandle_t* fh) -{ - if(!fh) - { - errno = EBADF; - return -1; - } - return ferror(fh->file); -} - -int FS_fgetc(fshandle_t* fh) -{ - if(!fh) - { - errno = EBADF; - return EOF; - } - if(fh->pos >= fh->length) - { - return EOF; - } - fh->pos += 1; - return fgetc(fh->file); -} - -char* FS_fgets(char* s, int size, fshandle_t* fh) -{ - char* ret; - - if(FS_feof(fh)) - { - return nullptr; - } - - if(size > (fh->length - fh->pos) + 1) - { - size = (fh->length - fh->pos) + 1; - } - - ret = fgets(s, size, fh->file); - fh->pos = ftell(fh->file) - fh->start; - - return ret; -} - -long FS_filelength(fshandle_t* fh) -{ - if(!fh) - { - errno = EBADF; - return -1; - } - return fh->length; -} diff --git a/Quake/common.hpp b/Quake/common.hpp index 6eba8b25..1067ce88 100644 --- a/Quake/common.hpp +++ b/Quake/common.hpp @@ -21,8 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _Q_COMMON_H -#define _Q_COMMON_H +#pragma once + +#include "quakeglm_qvec3.hpp" +#include "quakedef_macros.hpp" +#include "q_stdinc.hpp" // comndef.h -- general definitions @@ -47,22 +50,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CLAMP(_minval, x, _maxval) \ ((x) < (_minval) ? (_minval) : (x) > (_maxval) ? (_maxval) : (x)) -typedef struct sizebuf_s -{ - bool allowoverflow; // if false, do a Sys_Error - bool overflowed; // set to true if the buffer size failed - byte* data; - int maxsize; - int cursize; -} sizebuf_t; - -void SZ_Alloc(sizebuf_t* buf, int startsize); -void SZ_Free(sizebuf_t* buf); -void SZ_Clear(sizebuf_t* buf); -void* SZ_GetSpace(sizebuf_t* buf, int length); -void SZ_Write(sizebuf_t* buf, const void* data, int length); -void SZ_Print(sizebuf_t* buf, const char* data); // strcats onto the sizebuf - //============================================================================ typedef struct link_s @@ -70,7 +57,6 @@ typedef struct link_s struct link_s *prev, *next; } link_t; - void ClearLink(link_t* l); void RemoveLink(link_t* l); void InsertLinkBefore(link_t* l, link_t* before); @@ -83,44 +69,6 @@ void InsertLinkAfter(link_t* l, link_t* after); //============================================================================ -extern bool host_bigendian; - -extern short (*BigShort)(short l); -extern short (*LittleShort)(short l); -extern int (*BigLong)(int l); -extern int (*LittleLong)(int l); -extern float (*BigFloat)(float l); -extern float (*LittleFloat)(float l); - -//============================================================================ - -void MSG_WriteChar(sizebuf_t* sb, int c); -void MSG_WriteByte(sizebuf_t* sb, int c); -void MSG_WriteShort(sizebuf_t* sb, int c); -void MSG_WriteLong(sizebuf_t* sb, int c); -void MSG_WriteFloat(sizebuf_t* sb, float f); -void MSG_WriteString(sizebuf_t* sb, const char* s); -void MSG_WriteCoord(sizebuf_t* sb, float f, unsigned int flags); -void MSG_WriteAngle(sizebuf_t* sb, float f, unsigned int flags); -void MSG_WriteAngle16(sizebuf_t* sb, float f, unsigned int flags); // johnfitz - -extern int msg_readcount; -extern bool msg_badread; // set if a read goes beyond end of message - -void MSG_BeginReading(void); -int MSG_ReadChar(void); -int MSG_ReadByte(void); -int MSG_ReadShort(void); -int MSG_ReadLong(void); -float MSG_ReadFloat(void); -const char* MSG_ReadString(void); - -float MSG_ReadCoord(unsigned int flags); -float MSG_ReadAngle(unsigned int flags); -float MSG_ReadAngle16(unsigned int flags); // johnfitz - -//============================================================================ - void Q_memset(void* dest, int fill, size_t count); void Q_memcpy(void* dest, const void* src, size_t count); int Q_memcmp(const void* m1, const void* m2, size_t count); @@ -174,9 +122,9 @@ extern int safemode; int COM_CheckParm(const char* parm); -void COM_Init(void); +void COM_Init(); void COM_InitArgv(int argc, char** argv); -void COM_InitFilesystem(void); +void COM_InitFilesystem(); const char* COM_SkipPath(const char* pathname); void COM_StripExtension(const char* in, char* out, size_t outsize); @@ -261,6 +209,11 @@ byte* COM_LoadMallocFile(const char* path, unsigned int* path_id); // Loads in "t" mode so CRLF to LF translation is performed on Windows. byte* COM_LoadMallocFile_TextMode_OSPath(const char* path, long* len_out); +// Attempts to parse an timestamp, followed by a newline. +// Returns advanced buffer position. +// Doesn't signal parsing failure, but this is not needed for savegame loading. +const char* COM_ParseTimestampNewline(const char* buffer); + // Attempts to parse an int, followed by a newline. // Returns advanced buffer position. // Doesn't signal parsing failure, but this is not needed for savegame loading. @@ -274,36 +227,6 @@ const char* COM_ParseFloatNewline(const char* buffer, float* value); // newline. Returns advanced buffer position. const char* COM_ParseStringNewline(const char* buffer); -/* The following FS_*() stdio replacements are necessary if one is - * to perform non-sequential reads on files reopened on pak files - * because we need the bookkeeping about file start/end positions. - * Allocating and filling in the fshandle_t structure is the users' - * responsibility when the file is initially opened. */ - -typedef struct _fshandle_t -{ - FILE* file; - bool pak; /* is the file read from a pak */ - long start; /* file or data start position */ - long length; /* file or data size */ - long pos; /* current position relative to start */ -} fshandle_t; - -size_t FS_fread(void* ptr, size_t size, size_t nmemb, fshandle_t* fh); -int FS_fseek(fshandle_t* fh, long offset, int whence); -long FS_ftell(fshandle_t* fh); -void FS_rewind(fshandle_t* fh); -int FS_feof(fshandle_t* fh); -int FS_ferror(fshandle_t* fh); -int FS_fclose(fshandle_t* fh); -int FS_fgetc(fshandle_t* fh); -char* FS_fgets(char* s, int size, fshandle_t* fh); -long FS_filelength(fshandle_t* fh); - - -extern struct cvar_s registered; +extern struct cvar_t registered; extern bool standard_quake, rogue, hipnotic; -extern bool fitzmode; /* if true, run in fitzquake mode disabling custom quakespasm hacks */ - -#endif /* _Q_COMMON_H */ diff --git a/Quake/console.cpp b/Quake/console.cpp index fb7e3d39..d84d6024 100644 --- a/Quake/console.cpp +++ b/Quake/console.cpp @@ -31,7 +31,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #else #include <unistd.h> #endif + #include "quakedef.hpp" +#include "quakeparms.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "console.hpp" +#include "qpic.hpp" +#include "glquake.hpp" +#include "menu.hpp" +#include "keys.hpp" +#include "client.hpp" +#include "input.hpp" +#include "screen.hpp" +#include "q_sound.hpp" +#include "zone.hpp" +#include "sys.hpp" +#include "draw.hpp" int con_linewidth; @@ -1241,8 +1257,8 @@ void Con_DrawNotify() const char* text; float time; - GL_SetCanvas(CANVAS_CONSOLE); // johnfitz - v = vid.conheight; // johnfitz + GL_SetCanvas(CANVAS_NOTIFY); // johnfitz + v = vid.conheight; // johnfitz for(i = con_current - NUM_CON_TIMES + 1; i <= con_current; i++) { @@ -1382,7 +1398,7 @@ void Con_DrawConsole(int lines, bool drawinput) int rows; const char* text; - char ver[32]; + char ver[64]; if(lines <= 0) { diff --git a/Quake/console.hpp b/Quake/console.hpp index 2b90adca..2d800c88 100644 --- a/Quake/console.hpp +++ b/Quake/console.hpp @@ -21,8 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CONSOLE_H -#define __CONSOLE_H +#pragma once #include "q_stdinc.hpp" @@ -39,8 +38,8 @@ extern char con_lastcenterstring[]; // johnfitz void Con_DrawCharacter(int cx, int line, int num); -void Con_CheckResize(void); -void Con_Init(void); +void Con_CheckResize(); +void Con_Init(); void Con_DrawConsole(int lines, bool drawinput); void Con_Printf(const char* fmt, ...) FUNC_PRINTF(1, 2); void Con_DWarning(const char* fmt, ...) FUNC_PRINTF(1, 2); // ericw @@ -48,25 +47,23 @@ void Con_Warning(const char* fmt, ...) FUNC_PRINTF(1, 2); // johnfitz void Con_DPrintf(const char* fmt, ...) FUNC_PRINTF(1, 2); void Con_DPrintf2(const char* fmt, ...) FUNC_PRINTF(1, 2); // johnfitz void Con_SafePrintf(const char* fmt, ...) FUNC_PRINTF(1, 2); -void Con_DrawNotify(void); -void Con_ClearNotify(void); -void Con_ToggleConsole_f(void); +void Con_DrawNotify(); +void Con_ClearNotify(); +void Con_ToggleConsole_f(); void Con_NotifyBox(const char* text); // during startup for sound / cd warnings -void Con_Show(void); -void Con_Hide(void); +void Con_Show(); +void Con_Hide(); const char* Con_Quakebar(int len); -void Con_TabComplete(void); +void Con_TabComplete(); void Con_LogCenterPrint(const char* str); // // debuglog // -struct quakeparms_t; +struct quakeparms_t; void LOG_Init(quakeparms_t* parms); -void LOG_Close(void); +void LOG_Close(); void Con_DebugLog(const char* msg); - -#endif /* __CONSOLE_H */ diff --git a/Quake/crc.hpp b/Quake/crc.hpp index f44bd0d3..55c21fa4 100644 --- a/Quake/crc.hpp +++ b/Quake/crc.hpp @@ -19,8 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_CRC_H -#define _QUAKE_CRC_H +#pragma once /* crc.h */ @@ -29,5 +28,3 @@ void CRC_ProcessByte(unsigned short* crcvalue, byte data); unsigned short CRC_Value(unsigned short crcvalue); unsigned short CRC_Block( const byte* start, int count); // johnfitz -- texture crc - -#endif /* _QUAKE_CRC_H */ diff --git a/Quake/cvar.cpp b/Quake/cvar.cpp index 5b22e3b8..24feaaac 100644 --- a/Quake/cvar.cpp +++ b/Quake/cvar.cpp @@ -23,9 +23,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // cvar.c -- dynamic variable tracking #include "quakedef.hpp" +#include "cvar.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "zone.hpp" +#include "common.hpp" + +#include <vector> static cvar_t* cvar_vars; static char cvar_null_string[] = ""; +static std::vector<cvar_t*> cvar_handles; //============================================================================== // @@ -42,12 +50,9 @@ Cvar_List_f -- johnfitz */ void Cvar_List_f() { - cvar_t* cvar; const char* partial; int len; - int count; - if(Cmd_Argc() > 1) { partial = Cmd_Argv(1); @@ -59,8 +64,8 @@ void Cvar_List_f() len = 0; } - count = 0; - for(cvar = cvar_vars; cvar; cvar = cvar->next) + int count = 0; + for(cvar_t* cvar = cvar_vars; cvar; cvar = cvar->next) { if(partial && Q_strncmp(partial, cvar->name, len)) { @@ -73,10 +78,12 @@ void Cvar_List_f() } Con_SafePrintf("%i cvars", count); + if(partial) { Con_SafePrintf(" beginning with \"%s\"", partial); } + Con_SafePrintf("\n"); } @@ -204,9 +211,7 @@ Cvar_ResetAll_f -- johnfitz */ void Cvar_ResetAll_f() { - cvar_t* var; - - for(var = cvar_vars; var; var = var->next) + for(cvar_t* var = cvar_vars; var; var = var->next) { Cvar_Reset(var->name); } @@ -219,9 +224,7 @@ Cvar_ResetCfg_f -- QuakeSpasm */ void Cvar_ResetCfg_f() { - cvar_t* var; - - for(var = cvar_vars; var; var = var->next) + for(cvar_t* var = cvar_vars; var; var = var->next) { if(var->flags & CVAR_ARCHIVE) { @@ -251,6 +254,8 @@ void Cvar_Init() Cmd_AddCommand("reset", Cvar_Reset_f); Cmd_AddCommand("resetall", Cvar_ResetAll_f); Cmd_AddCommand("resetcfg", Cvar_ResetCfg_f); + + cvar_handles.reserve(128); } //============================================================================== @@ -266,9 +271,7 @@ Cvar_FindVar */ cvar_t* Cvar_FindVar(const char* var_name) { - cvar_t* var; - - for(var = cvar_vars; var; var = var->next) + for(cvar_t* var = cvar_vars; var; var = var->next) { if(!Q_strcmp(var_name, var->name)) { @@ -306,6 +309,7 @@ cvar_t* Cvar_FindVarAfter(const char* prev_name, unsigned int with_flags) } var = var->next; } + return var; } @@ -316,8 +320,7 @@ Cvar_LockVar */ void Cvar_LockVar(const char* var_name) { - cvar_t* var = Cvar_FindVar(var_name); - if(var) + if(cvar_t* var = Cvar_FindVar(var_name)) { var->flags |= CVAR_LOCKED; } @@ -325,8 +328,7 @@ void Cvar_LockVar(const char* var_name) void Cvar_UnlockVar(const char* var_name) { - cvar_t* var = Cvar_FindVar(var_name); - if(var) + if(cvar_t* var = Cvar_FindVar(var_name)) { var->flags &= ~CVAR_LOCKED; } @@ -334,9 +336,7 @@ void Cvar_UnlockVar(const char* var_name) void Cvar_UnlockAll() { - cvar_t* var; - - for(var = cvar_vars; var; var = var->next) + for(cvar_t* var = cvar_vars; var; var = var->next) { var->flags &= ~CVAR_LOCKED; } @@ -349,13 +349,13 @@ Cvar_VariableValue */ float Cvar_VariableValue(const char* var_name) { - cvar_t* var; + cvar_t* var = Cvar_FindVar(var_name); - var = Cvar_FindVar(var_name); if(!var) { return 0; } + return Q_atof(var->string); } @@ -367,13 +367,13 @@ Cvar_VariableString */ const char* Cvar_VariableString(const char* var_name) { - cvar_t* var; + cvar_t* var = Cvar_FindVar(var_name); - var = Cvar_FindVar(var_name); if(!var) { return cvar_null_string; } + return var->string; } @@ -385,17 +385,14 @@ Cvar_CompleteVariable */ const char* Cvar_CompleteVariable(const char* partial) { - cvar_t* cvar; - int len; - - len = Q_strlen(partial); + const int len = Q_strlen(partial); if(!len) { return nullptr; } // check functions - for(cvar = cvar_vars; cvar; cvar = cvar->next) + for(cvar_t* cvar = cvar_vars; cvar; cvar = cvar->next) { if(!Q_strncmp(partial, cvar->name, len)) { @@ -413,9 +410,8 @@ Cvar_Reset -- johnfitz */ void Cvar_Reset(const char* name) { - cvar_t* var; + cvar_t* var = Cvar_FindVar(name); - var = Cvar_FindVar(name); if(!var) { Con_Printf("variable \"%s\" not found\n", name); @@ -432,6 +428,7 @@ void Cvar_SetQuick(cvar_t* var, const char* value) { return; } + if(!(var->flags & CVAR_REGISTERED)) { return; @@ -487,8 +484,6 @@ void Cvar_SetValueQuick(cvar_t* var, const float value) { char val[32]; - char* ptr = val; - if(value == (float)((int)value)) { q_snprintf(val, sizeof(val), "%i", (int)value); @@ -496,7 +491,9 @@ void Cvar_SetValueQuick(cvar_t* var, const float value) else { q_snprintf(val, sizeof(val), "%f", value); + // kill trailing zeroes + char* ptr = val; while(*ptr) { ptr++; @@ -517,9 +514,8 @@ Cvar_Set */ void Cvar_Set(const char* var_name, const char* value) { - cvar_t* var; + cvar_t* var = Cvar_FindVar(var_name); - var = Cvar_FindVar(var_name); if(!var) { // there is an error in C code if this happens @@ -539,8 +535,6 @@ void Cvar_SetValue(const char* var_name, const float value) { char val[32]; - char* ptr = val; - if(value == (float)((int)value)) { q_snprintf(val, sizeof(val), "%i", (int)value); @@ -548,7 +542,9 @@ void Cvar_SetValue(const char* var_name, const float value) else { q_snprintf(val, sizeof(val), "%f", value); + // kill trailing zeroes + char* ptr = val; while(*ptr) { ptr++; @@ -569,8 +565,7 @@ Cvar_SetROM */ void Cvar_SetROM(const char* var_name, const char* value) { - cvar_t* var = Cvar_FindVar(var_name); - if(var) + if(cvar_t* var = Cvar_FindVar(var_name)) { var->flags &= ~CVAR_ROM; Cvar_SetQuick(var, value); @@ -585,8 +580,7 @@ Cvar_SetValueROM */ void Cvar_SetValueROM(const char* var_name, const float value) { - cvar_t* var = Cvar_FindVar(var_name); - if(var) + if(cvar_t* var = Cvar_FindVar(var_name)) { var->flags &= ~CVAR_ROM; Cvar_SetValueQuick(var, value); @@ -603,12 +597,6 @@ Adds a freestanding variable to the variable list. */ void Cvar_RegisterVariable(cvar_t* variable) { - char value[512]; - bool set_rom; - cvar_t* cursor; - - cvar_t* prev; // johnfitz -- sorted list insert - // first check to see if it has already been defined if(Cvar_FindVar(variable->name)) { @@ -634,13 +622,15 @@ void Cvar_RegisterVariable(cvar_t* variable) } else // insert later { - prev = cvar_vars; - cursor = cvar_vars->next; + cvar_t* prev = cvar_vars; + cvar_t* cursor = cvar_vars->next; + while(cursor && (strcmp(variable->name, cursor->name) > 0)) { prev = cursor; cursor = cursor->next; } + variable->next = prev->next; prev->next = variable; } @@ -648,6 +638,7 @@ void Cvar_RegisterVariable(cvar_t* variable) variable->flags |= CVAR_REGISTERED; // copy the value off, because future sets will Z_Free it + char value[512]; q_strlcpy(value, variable->string, sizeof(value)); variable->string = nullptr; variable->default_string = nullptr; @@ -658,9 +649,10 @@ void Cvar_RegisterVariable(cvar_t* variable) } // set it through the function to be consistent - set_rom = (variable->flags & CVAR_ROM); + const bool set_rom = (variable->flags & CVAR_ROM); variable->flags &= ~CVAR_ROM; Cvar_SetQuick(variable, value); + if(set_rom) { variable->flags |= CVAR_ROM; @@ -677,6 +669,7 @@ Set a callback function to the var void Cvar_SetCallback(cvar_t* var, cvarcallback_t func) { var->callback = func; + if(func) { var->flags |= CVAR_CALLBACK; @@ -696,10 +689,8 @@ Handles variable inspection and changing from the console */ bool Cvar_Command() { - cvar_t* v; - // check variables - v = Cvar_FindVar(Cmd_Argv(0)); + cvar_t* v = Cvar_FindVar(Cmd_Argv(0)); if(!v) { return false; @@ -727,9 +718,7 @@ with the archive flag set to true. */ void Cvar_WriteVariables(FILE* f) { - cvar_t* var; - - for(var = cvar_vars; var; var = var->next) + for(cvar_t* var = cvar_vars; var; var = var->next) { if(var->flags & CVAR_ARCHIVE) { @@ -737,3 +726,43 @@ void Cvar_WriteVariables(FILE* f) } } } + +// VR: CVar handles. +int Cvar_MakeHandle(const char* var_name) +{ + if(cvar_t* var = Cvar_FindVar(var_name)) + { + cvar_handles.emplace_back(var); + return cvar_handles.size() - 1; + } + + Con_Printf("Attempted to make handle for invalid CVar '%s'\n", var_name); + return -1; +} + +float Cvar_GetValueFromHandle(const int handle) +{ + if(handle < 0 || handle >= static_cast<int>(cvar_handles.size())) + { + Con_Printf("Attempted to get CVar from invalid handle '%d'\n", handle); + return 0; + } + + return cvar_handles[handle]->value; +} + +void Cvar_SetValueFromHandle(const int handle, const float value) +{ + if(handle < 0 || handle >= static_cast<int>(cvar_handles.size())) + { + Con_Printf("Attempted to set CVar from invalid handle '%d'\n", handle); + return; + } + + Cvar_SetValueQuick(cvar_handles[handle], value); +} + +void Cvar_ClearAllHandles() +{ + cvar_handles.clear(); +} diff --git a/Quake/cvar.hpp b/Quake/cvar.hpp index 8ac3a0f9..2c7dd993 100644 --- a/Quake/cvar.hpp +++ b/Quake/cvar.hpp @@ -21,8 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CVAR_H__ -#define __CVAR_H__ +#pragma once + +#include <cstdio> /* cvar_t variables are used to hold scalar or string variables that can @@ -79,9 +80,9 @@ interface from being ambiguous. #define CVAR_CALLBACK (1U << 16) // var has a callback -typedef void (*cvarcallback_t)(struct cvar_s*); +typedef void (*cvarcallback_t)(struct cvar_t*); -typedef struct cvar_s +struct cvar_t { const char* name; const char* string; @@ -90,8 +91,8 @@ typedef struct cvar_s const char* default_string; // johnfitz -- remember defaults for reset function cvarcallback_t callback; - struct cvar_s* next; -} cvar_t; + cvar_t* next; +}; void Cvar_RegisterVariable(cvar_t* variable); // registers a cvar that already has the name, string, and optionally @@ -122,7 +123,7 @@ float Cvar_VariableValue(const char* var_name); const char* Cvar_VariableString(const char* var_name); // returns an empty string if not defined -bool Cvar_Command(void); +bool Cvar_Command(); // called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known // command. Returns true if the command was a variable reference that // was handled. (print or change) @@ -136,12 +137,15 @@ cvar_t* Cvar_FindVarAfter(const char* prev_name, unsigned int with_flags); void Cvar_LockVar(const char* var_name); void Cvar_UnlockVar(const char* var_name); -void Cvar_UnlockAll(void); +void Cvar_UnlockAll(); -void Cvar_Init(void); +void Cvar_Init(); const char* Cvar_CompleteVariable(const char* partial); // attempts to match a partial variable name for command line completion // returns nullptr if nothing fits -#endif /* __CVAR_H__ */ +int Cvar_MakeHandle(const char* var_name); +float Cvar_GetValueFromHandle(const int handle); +void Cvar_SetValueFromHandle(const int handle, const float value); +void Cvar_ClearAllHandles(); diff --git a/Quake/detect.sh b/Quake/detect.sh deleted file mode 100644 index 94fc8dcf..00000000 --- a/Quake/detect.sh +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/sh - -# script from loki_setup tools - -DetectARCH() -{ - status=1 - case `uname -m` in - amd64 | x86_64) - echo "x86_64" - status=0;; - i?86 | i86*) - echo "x86" - status=0;; - 90*/*) - echo "hppa" - status=0;; - *) - case `uname -s` in - IRIX*) - echo "mips" - status=0;; - AIX*) - echo "ppc" - status=0;; - *) - arch=`uname -p 2> /dev/null || uname -m` - if test "$arch" = powerpc; then - echo "ppc" - else - echo $arch - fi - status=0;; - esac - esac - return $status -} - -DetectOS() -{ - os=`uname -s` - if test "$os" = "OpenUNIX"; then - echo SCO_SV - else - echo $os - fi - return 0 -} - -if test "$1" = "os"; then - result=`DetectOS` -elif test "$1" = "arch"; then - result=`DetectARCH` -else - result="OS: `DetectOS`, Arch: `DetectARCH`" -fi - -status="$?" -echo $result - -exit $status - diff --git a/Quake/draw.hpp b/Quake/draw.hpp index 571f6827..6dc5675e 100644 --- a/Quake/draw.hpp +++ b/Quake/draw.hpp @@ -21,30 +21,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_DRAW_H -#define _QUAKE_DRAW_H +#pragma once + +#include "screen.hpp" + +struct qpic_t; // draw.h -- these are the only functions outside the refresh allowed // to touch the vid buffer extern qpic_t* draw_disc; // also used on sbar -void Draw_Init(void); +void Draw_Init(); void Draw_Character(int x, int y, int num); void Draw_DebugChar(char num); void Draw_Pic(int x, int y, qpic_t* pic); void Draw_TransPicTranslate(int x, int y, qpic_t* pic, int top, int bottom); // johnfitz -- more parameters -void Draw_ConsoleBackground(void); // johnfitz -- removed parameter int lines +void Draw_ConsoleBackground(); // johnfitz -- removed parameter int lines void Draw_TileClear(int x, int y, int w, int h); void Draw_Fill( int x, int y, int w, int h, int c, float alpha); // johnfitz -- added alpha -void Draw_FadeScreen(void); +void Draw_FadeScreen(); void Draw_String(int x, int y, const char* str); qpic_t* Draw_PicFromWad(const char* name); qpic_t* Draw_CachePic(const char* path); -void Draw_NewGame(void); +void Draw_NewGame(); void GL_SetCanvas(canvastype newcanvas); // johnfitz - -#endif /* _QUAKE_DRAW_H */ diff --git a/Quake/efrag.hpp b/Quake/efrag.hpp new file mode 100644 index 00000000..605357c5 --- /dev/null +++ b/Quake/efrag.hpp @@ -0,0 +1,31 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +struct efrag_t +{ + struct efrag_t* leafnext; + struct entity_t* entity; +}; + diff --git a/Quake/entity.hpp b/Quake/entity.hpp new file mode 100644 index 00000000..938d17ed --- /dev/null +++ b/Quake/entity.hpp @@ -0,0 +1,101 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +#include "quakeglm_qvec3.hpp" +#include "protocol.hpp" + +#include <cstdint> + +struct qmodel_t; +struct efrag_t; +struct mnode_t; + +enum class EntityLightModifier : std::uint8_t +{ + None = 0, + Override = 1, + Multiply = 2, +}; + +struct entity_t +{ + bool forcelink; // model changed + + int update_type; + + entity_state_t baseline; // to fill in defaults in updates + + double msgtime; // time of last update + qvec3 msg_origins[2]; // last two updates (0 is newest) + qvec3 origin; + qvec3 msg_angles[2]; // last two updates (0 is newest) + qvec3 angles; + qmodel_t* model; // nullptr = no model + efrag_t* efrag; // linked list of efrags + int frame; + float syncbase; // for client-side animations + byte* colormap; + int effects; // light, particles, etc + int skinnum; // for Alias models + int visframe; // last frame this entity was + // found in an active leaf + + int dlightframe; // dynamic lighting + int dlightbits; + + // FIXME: could turn these into a union + int trivial_accept; + mnode_t* topnode; // for bmodels, first world node + // that splits bmodel, or nullptr if + // not split + + byte alpha; // johnfitz -- alpha + byte lerpflags; // johnfitz -- lerping + float lerpstart; // johnfitz -- animation lerping + float lerptime; // johnfitz -- animation lerping + float lerpfinish; // johnfitz -- lerping -- server sent us a more accurate + // interval, use it instead of 0.1 + short previouspose; // johnfitz -- animation lerping + short currentpose; // johnfitz -- animation lerping + // short futurepose; //johnfitz -- animation lerping + float movelerpstart; // johnfitz -- transform lerping + qvec3 previousorigin; // johnfitz -- transform lerping + qvec3 currentorigin; // johnfitz -- transform lerping + qvec3 previousangles; // johnfitz -- transform lerping + qvec3 currentangles; // johnfitz -- transform lerping + + bool horizFlip; // VR: horizontal flip + + // VR: per-instance scaling + qvec3 msg_scales[2]; // last two updates (0 is newest) + qvec3 scale; + qvec3 scale_origin; + + bool hidden; // TODO VR: (P1) hack? or document + qfloat zeroBlend; // TODO VR: (P1) hack? or document + + EntityLightModifier lightmod; // TODO VR: (P1) hack? or document + qvec3 lightmodvalue; // TODO VR: (P1) hack? or document +}; diff --git a/Quake/filenames.hpp b/Quake/filenames.hpp index 65ca354f..1bfb9d77 100644 --- a/Quake/filenames.hpp +++ b/Quake/filenames.hpp @@ -27,7 +27,7 @@ #ifndef FILENAMES_H #define FILENAMES_H -#include <string.h> +#include <cstring> /* ---------------------- Windows, DOS, OS2: ---------------------- */ #if defined(__MSDOS__) || defined(__DOS__) || defined(__DJGPP__) || \ diff --git a/Quake/fshandle.cpp b/Quake/fshandle.cpp new file mode 100644 index 00000000..7ca930bb --- /dev/null +++ b/Quake/fshandle.cpp @@ -0,0 +1,195 @@ +#include "fshandle.hpp" + +#include <cerrno> + +/* The following FS_*() stdio replacements are necessary if one is + * to perform non-sequential reads on files reopened on pak files + * because we need the bookkeeping about file start/end positions. + * Allocating and filling in the fshandle_t structure is the users' + * responsibility when the file is initially opened. */ + +size_t FS_fread(void* ptr, size_t size, size_t nmemb, fshandle_t* fh) +{ + long byte_size; + long bytes_read; + size_t nmemb_read; + + if(!fh) + { + errno = EBADF; + return 0; + } + if(!ptr) + { + errno = EFAULT; + return 0; + } + if(!size || !nmemb) + { /* no error, just zero bytes wanted */ + errno = 0; + return 0; + } + + byte_size = nmemb * size; + if(byte_size > fh->length - fh->pos) + { /* just read to end */ + byte_size = fh->length - fh->pos; + } + bytes_read = fread(ptr, 1, byte_size, fh->file); + fh->pos += bytes_read; + + /* fread() must return the number of elements read, + * not the total number of bytes. */ + nmemb_read = bytes_read / size; + /* even if the last member is only read partially + * it is counted as a whole in the return value. */ + if(bytes_read % size) + { + nmemb_read++; + } + + return nmemb_read; +} + +int FS_fseek(fshandle_t* fh, long offset, int whence) +{ + /* I don't care about 64 bit off_t or fseeko() here. + * the quake/hexen2 file system is 32 bits, anyway. */ + int ret; + + if(!fh) + { + errno = EBADF; + return -1; + } + + /* the relative file position shouldn't be smaller + * than zero or bigger than the filesize. */ + switch(whence) + { + case SEEK_SET: break; + case SEEK_CUR: offset += fh->pos; break; + case SEEK_END: offset = fh->length + offset; break; + default: errno = EINVAL; return -1; + } + + if(offset < 0) + { + errno = EINVAL; + return -1; + } + + if(offset > fh->length) + { /* just seek to end */ + offset = fh->length; + } + + ret = fseek(fh->file, fh->start + offset, SEEK_SET); + if(ret < 0) + { + return ret; + } + + fh->pos = offset; + return 0; +} + +int FS_fclose(fshandle_t* fh) +{ + if(!fh) + { + errno = EBADF; + return -1; + } + return fclose(fh->file); +} + +long FS_ftell(fshandle_t* fh) +{ + if(!fh) + { + errno = EBADF; + return -1; + } + return fh->pos; +} + +void FS_rewind(fshandle_t* fh) +{ + if(!fh) + { + return; + } + clearerr(fh->file); + fseek(fh->file, fh->start, SEEK_SET); + fh->pos = 0; +} + +int FS_feof(fshandle_t* fh) +{ + if(!fh) + { + errno = EBADF; + return -1; + } + if(fh->pos >= fh->length) + { + return -1; + } + return 0; +} + +int FS_ferror(fshandle_t* fh) +{ + if(!fh) + { + errno = EBADF; + return -1; + } + return ferror(fh->file); +} + +int FS_fgetc(fshandle_t* fh) +{ + if(!fh) + { + errno = EBADF; + return EOF; + } + if(fh->pos >= fh->length) + { + return EOF; + } + fh->pos += 1; + return fgetc(fh->file); +} + +char* FS_fgets(char* s, int size, fshandle_t* fh) +{ + char* ret; + + if(FS_feof(fh)) + { + return nullptr; + } + + if(size > (fh->length - fh->pos) + 1) + { + size = (fh->length - fh->pos) + 1; + } + + ret = fgets(s, size, fh->file); + fh->pos = ftell(fh->file) - fh->start; + + return ret; +} + +long FS_filelength(fshandle_t* fh) +{ + if(!fh) + { + errno = EBADF; + return -1; + } + return fh->length; +} diff --git a/Quake/fshandle.hpp b/Quake/fshandle.hpp new file mode 100644 index 00000000..b12a896d --- /dev/null +++ b/Quake/fshandle.hpp @@ -0,0 +1,53 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +#include <cstdio> + +/* The following FS_*() stdio replacements are necessary if one is + * to perform non-sequential reads on files reopened on pak files + * because we need the bookkeeping about file start/end positions. + * Allocating and filling in the fshandle_t structure is the users' + * responsibility when the file is initially opened. */ + +typedef struct _fshandle_t +{ + FILE* file; + bool pak; /* is the file read from a pak */ + long start; /* file or data start position */ + long length; /* file or data size */ + long pos; /* current position relative to start */ +} fshandle_t; + +size_t FS_fread(void* ptr, size_t size, size_t nmemb, fshandle_t* fh); +int FS_fseek(fshandle_t* fh, long offset, int whence); +long FS_ftell(fshandle_t* fh); +void FS_rewind(fshandle_t* fh); +int FS_feof(fshandle_t* fh); +int FS_ferror(fshandle_t* fh); +int FS_fclose(fshandle_t* fh); +int FS_fgetc(fshandle_t* fh); +char* FS_fgets(char* s, int size, fshandle_t* fh); +long FS_filelength(fshandle_t* fh); + diff --git a/Quake/gl_draw.cpp b/Quake/gl_draw.cpp index f040b6b4..eace9224 100644 --- a/Quake/gl_draw.cpp +++ b/Quake/gl_draw.cpp @@ -24,8 +24,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // draw.c -- 2d drawing +#include <GL/glew.h> + #include "quakedef.hpp" +#include "console.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" +#include "quakedef_macros.hpp" +#include "sbar.hpp" +#include "wad.hpp" +#include "gl_texmgr.hpp" +#include "qpic.hpp" +#include "glquake.hpp" +#include "sys.hpp" +#include "screen.hpp" +#include "draw.hpp" +#include "client.hpp" // extern unsigned char d_15to8table[65536]; //johnfitz -- never used @@ -482,21 +496,12 @@ Draw_CharacterQuad -- johnfitz -- seperate function to spit out verts */ void Draw_CharacterQuad(int x, int y, char num) { - int row; - - int col; - float frow; - - float fcol; - - float size; - - row = num >> 4; - col = num & 15; + const int row = num >> 4; + const int col = num & 15; - frow = row * 0.0625; - fcol = col * 0.0625; - size = 0.0625; + const float frow = row * 0.0625; + const float fcol = col * 0.0625; + const float size = 0.0625; glTexCoord2f(fcol, frow); glVertex2f(x, y); @@ -515,11 +520,6 @@ Draw_Character -- johnfitz -- modified to call Draw_CharacterQuad */ void Draw_Character(int x, int y, int num) { - if(y <= -8) - { - return; // totally off screen - } - num &= 255; if(num == 32) @@ -782,6 +782,15 @@ void GL_SetCanvas(canvastype newcanvas) glViewport(glx, gly, glwidth, glheight); break; case CANVAS_CONSOLE: + s = q_min((float)glwidth / 800.0, (float)glheight / 600.0); + s = CLAMP(1.0, scr_menuscale.value, s); + lines = + vid.conheight - (scr_con_current * vid.conheight / glheight); + glOrtho(0, 800, 600, 0, -99999, 99999); + glViewport(glx + (glwidth - 800 * s) / 2, + gly + (glheight - 600 * s) / 2, 800 * s, 600 * s); + break; + case CANVAS_NOTIFY: lines = vid.conheight - (scr_con_current * vid.conheight / glheight); glOrtho( diff --git a/Quake/gl_fog.cpp b/Quake/gl_fog.cpp index 9693eb77..51638dbc 100644 --- a/Quake/gl_fog.cpp +++ b/Quake/gl_fog.cpp @@ -24,6 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "quakeglm.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "mathlib.hpp" +#include "glquake.hpp" +#include "client.hpp" +#include "common.hpp" +#include "msg.hpp" //============================================================================== // @@ -355,7 +363,7 @@ void Fog_StartAdditive() { if(Fog_GetDensity() > 0) { - glFogfv(GL_FOG_COLOR, glm::value_ptr(vec3_zero)); + glFogfv(GL_FOG_COLOR, toGlVec(vec3_zero)); } } diff --git a/Quake/gl_mesh.cpp b/Quake/gl_mesh.cpp index d1f30616..f803ea77 100644 --- a/Quake/gl_mesh.cpp +++ b/Quake/gl_mesh.cpp @@ -23,7 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // gl_mesh.c: triangle model functions #include "quakedef.hpp" - +#include "glquake.hpp" +#include "client.hpp" +#include "gl_texmgr.hpp" +#include "console.hpp" /* ================================================================= @@ -600,10 +603,10 @@ static void GLMesh_LoadVertexBuffer(qmodel_t* m, const aliashdr_t* hdr) // upload indices buffer - GL_DeleteBuffersFunc(1, &m->meshindexesvbo); - GL_GenBuffersFunc(1, &m->meshindexesvbo); - GL_BindBufferFunc(GL_ELEMENT_ARRAY_BUFFER, m->meshindexesvbo); - GL_BufferDataFunc(GL_ELEMENT_ARRAY_BUFFER, + glDeleteBuffersARB(1, &m->meshindexesvbo); + glGenBuffersARB(1, &m->meshindexesvbo); + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, m->meshindexesvbo); + glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER, hdr->numindexes * sizeof(unsigned short), indexes, GL_STATIC_DRAW); // create the vertex buffer (empty) @@ -669,10 +672,10 @@ static void GLMesh_LoadVertexBuffer(qmodel_t* m, const aliashdr_t* hdr) } // upload vertexes buffer - GL_DeleteBuffersFunc(1, &m->meshvbo); - GL_GenBuffersFunc(1, &m->meshvbo); - GL_BindBufferFunc(GL_ARRAY_BUFFER, m->meshvbo); - GL_BufferDataFunc(GL_ARRAY_BUFFER, totalvbosize, vbodata, GL_STATIC_DRAW); + glDeleteBuffersARB(1, &m->meshvbo); + glGenBuffersARB(1, &m->meshvbo); + glBindBufferARB(GL_ARRAY_BUFFER, m->meshvbo); + glBufferDataARB(GL_ARRAY_BUFFER, totalvbosize, vbodata, GL_STATIC_DRAW); free(vbodata); @@ -744,10 +747,10 @@ void GLMesh_DeleteVertexBuffers() continue; } - GL_DeleteBuffersFunc(1, &m->meshvbo); + glDeleteBuffersARB(1, &m->meshvbo); m->meshvbo = 0; - GL_DeleteBuffersFunc(1, &m->meshindexesvbo); + glDeleteBuffersARB(1, &m->meshindexesvbo); m->meshindexesvbo = 0; } diff --git a/Quake/gl_model.cpp b/Quake/gl_model.cpp index 824f7b0a..40c60fc8 100644 --- a/Quake/gl_model.cpp +++ b/Quake/gl_model.cpp @@ -25,9 +25,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // models are the only shared resource between a client and server running // on the same machine. +#include <GL/glew.h> + +#include "host.hpp" #include "quakedef.hpp" #include "util.hpp" -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" +#include "image.hpp" +#include "glquake.hpp" +#include "byteorder.hpp" +#include "gl_texmgr.hpp" +#include "sys.hpp" qmodel_t* loadmodel; char loadname[32]; // for hunk tags @@ -105,7 +116,7 @@ void* Mod_Extradata(qmodel_t* mod) Mod_PointInLeaf =============== */ -mleaf_t* Mod_PointInLeaf(const glm::vec3& p, qmodel_t* model) +mleaf_t* Mod_PointInLeaf(const qvec3& p, qmodel_t* model) { mnode_t* node; float d; @@ -318,6 +329,16 @@ qmodel_t* Mod_FindName(const char* name) return mod; } +void Mod_ForAllKnownNames(void (*f)(const char*)) noexcept +{ + int i; + qmodel_t* mod; + for(i = 0, mod = mod_known; i < mod_numknown; ++i, ++mod) + { + f(mod->name); + } +} + /* ================== Mod_TouchModel @@ -1309,7 +1330,7 @@ void Mod_PolyForUnlitSurface(msurface_t* fa) int numverts; int i; int lindex; - float* vec; + qfloat* vec; glpoly_t* poly; float texscale; @@ -1330,12 +1351,12 @@ void Mod_PolyForUnlitSurface(msurface_t* fa) if(lindex > 0) { - vec = glm::value_ptr( + vec = toGlVec( loadmodel->vertexes[loadmodel->edges[lindex].v[0]].position); } else { - vec = glm::value_ptr( + vec = toGlVec( loadmodel->vertexes[loadmodel->edges[-lindex].v[1]].position); } VectorCopy(vec, verts[numverts]); @@ -1348,11 +1369,13 @@ void Mod_PolyForUnlitSurface(msurface_t* fa) poly->next = nullptr; fa->polys = poly; poly->numverts = numverts; - for(i = 0, vec = (float*)verts; i < numverts; i++, vec += 3) + + float* fvec; + for(i = 0, fvec = (float*)verts; i < numverts; i++, fvec += 3) { - VectorCopy(vec, poly->verts[i]); - poly->verts[i][3] = DotProduct(vec, fa->texinfo->vecs[0]) * texscale; - poly->verts[i][4] = DotProduct(vec, fa->texinfo->vecs[1]) * texscale; + VectorCopy(fvec, poly->verts[i]); + poly->verts[i][3] = DotProduct(fvec, fa->texinfo->vecs[0]) * texscale; + poly->verts[i][4] = DotProduct(fvec, fa->texinfo->vecs[1]) * texscale; } } @@ -2385,9 +2408,9 @@ void Mod_LoadPlanes(lump_t* l) RadiusFromBounds ================= */ -float RadiusFromBounds(const glm::vec3& mins, const glm::vec3& maxs) +float RadiusFromBounds(const qvec3& mins, const qvec3& maxs) { - glm::vec3 corner; + qvec3 corner; for(int i = 0; i < 3; i++) { @@ -2405,21 +2428,21 @@ Mod_LoadSubmodels */ void Mod_LoadSubmodels(lump_t* l) { - dmodel_t* in; - dmodel_t* out; + mmodel_t* in; + mmodel_t* out; int i; int j; int count; - in = (dmodel_t*)(mod_base + l->fileofs); + in = (mmodel_t*)(mod_base + l->fileofs); if(l->filelen % sizeof(*in)) { Sys_Error("MOD_LoadBmodel: funny lump size in %s", loadmodel->name); } count = l->filelen / sizeof(*in); - out = (dmodel_t*)Hunk_AllocName(count * sizeof(*out), loadname); + out = (mmodel_t*)Hunk_AllocName(count * sizeof(*out), loadname); loadmodel->submodels = out; loadmodel->numsubmodels = count; @@ -2537,7 +2560,7 @@ void Mod_LoadBrushModel(qmodel_t* mod, void* buffer) int j; int bsp2; dheader_t* header; - dmodel_t* bm; + mmodel_t* bm; float radius; // johnfitz loadmodel->type = mod_brush; @@ -3037,7 +3060,7 @@ void Mod_CalcAliasBounds(aliashdr_t* a) { float yawradius; float radius; - glm::vec3 v; + qvec3 v; // clear out all data for(int i = 0; i < 3; i++) diff --git a/Quake/gl_model.hpp b/Quake/gl_model.hpp index f88a9433..723b8423 100644 --- a/Quake/gl_model.hpp +++ b/Quake/gl_model.hpp @@ -21,13 +21,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __MODEL__ -#define __MODEL__ +#pragma once +#include <GL/glew.h> + +#include "host.hpp" #include "modelgen.hpp" #include "spritegn.hpp" -#include "client.hpp" -#include "quakeglm.hpp" +#include "efrag.hpp" +#include "quakeglm_qvec3.hpp" +#include "vr_macros.hpp" +#include "zone.hpp" +#include "quakedef_macros.hpp" +#include "bspfile.hpp" /* @@ -38,11 +44,15 @@ m*_t structures are in-memory // entity effects -#define EF_BRIGHTFIELD 1 -#define EF_MUZZLEFLASH 2 -#define EF_BRIGHTLIGHT 4 -#define EF_DIMLIGHT 8 - +// clang-format off +#define EF_BRIGHTFIELD VRUTIL_POWER_OF_TWO(0) +#define EF_MUZZLEFLASH VRUTIL_POWER_OF_TWO(1) +#define EF_BRIGHTLIGHT VRUTIL_POWER_OF_TWO(2) +#define EF_DIMLIGHT VRUTIL_POWER_OF_TWO(3) +#define EF_VERYDIMLIGHT VRUTIL_POWER_OF_TWO(4) +#define EF_MINIROCKET VRUTIL_POWER_OF_TWO(5) +#define EF_LAVATRAIL VRUTIL_POWER_OF_TWO(6) +// clang-format on /* ============================================================================== @@ -59,7 +69,7 @@ BRUSH MODELS // !!! if this is changed, it must be changed in asm_draw.h too !!! typedef struct { - glm::vec3 position; + qvec3 position; } mvertex_t; #define SIDE_FRONT 0 @@ -71,7 +81,7 @@ typedef struct // !!! if this is changed, it must be changed in asm_i386.h too !!! typedef struct mplane_s { - glm::vec3 normal; + qvec3 normal; float dist; byte type; // for texture axis selection and fast side tests byte signbits; // signx + signy<<1 + signz<<1 @@ -86,21 +96,24 @@ typedef enum chain_model = 1 } texchain_t; -typedef struct texture_s + +struct gltexture_t; + +struct texture_t { char name[16]; unsigned width, height; - struct gltexture_s* gltexture; // johnfitz -- pointer to gltexture - struct gltexture_s* fullbright; // johnfitz -- fullbright mask texture - struct gltexture_s* warpimage; // johnfitz -- for water animation + gltexture_t* gltexture; // johnfitz -- pointer to gltexture + gltexture_t* fullbright; // johnfitz -- fullbright mask texture + gltexture_t* warpimage; // johnfitz -- for water animation bool update_warp; // johnfitz -- update warp this frame struct msurface_s* texturechains[2]; // for texture chains int anim_total; // total tenths in sequence ( 0 = no) int anim_min, anim_max; // time for this frame min <=time< max - struct texture_s* anim_next; // in the animation sequence - struct texture_s* alternate_anims; // bmodels in frmae 1 use these + texture_t* anim_next; // in the animation sequence + texture_t* alternate_anims; // bmodels in frmae 1 use these unsigned offsets[MIPLEVELS]; // four mip maps stored -} texture_t; +}; #define SURF_PLANEBACK 2 @@ -146,8 +159,8 @@ typedef struct msurface_s { int visframe; // should be drawn when node is crossed bool culled; // johnfitz -- for frustum culling - glm::vec3 mins; // johnfitz -- for frustum culling - glm::vec3 maxs; // johnfitz -- for frustum culling + qvec3 mins; // johnfitz -- for frustum culling + qvec3 maxs; // johnfitz -- for frustum culling mplane_t* plane; int flags; @@ -179,7 +192,7 @@ typedef struct msurface_s byte* samples; // [numstyles*surfsize] } msurface_t; -typedef struct mnode_s +struct mnode_t { // common with leaf int contents; // 0, to differentiate from leafs @@ -187,15 +200,15 @@ typedef struct mnode_s float minmaxs[6]; // for bounding box culling - struct mnode_s* parent; + struct mnode_t* parent; // node specific mplane_t* plane; - struct mnode_s* children[2]; + struct mnode_t* children[2]; unsigned int firstsurface; unsigned int numsurfaces; -} mnode_t; +}; @@ -207,7 +220,7 @@ typedef struct mleaf_s float minmaxs[6]; // for bounding box culling - struct mnode_s* parent; + mnode_t* parent; // leaf specific byte* compressed_vis; @@ -228,15 +241,15 @@ typedef struct mclipnode_s // johnfitz // !!! if this is changed, it must be changed in asm_i386.h too !!! -typedef struct +struct hull_t { mclipnode_t* clipnodes; // johnfitz -- was dclipnode_t mplane_t* planes; int firstclipnode; int lastclipnode; - glm::vec3 clip_mins; - glm::vec3 clip_maxs; -} hull_t; + qvec3 clip_mins; + qvec3 clip_maxs; +}; /* ============================================================================== @@ -251,9 +264,9 @@ SPRITE MODELS typedef struct mspriteframe_s { int width, height; - float up, down, left, right; - float smax, tmax; // johnfitz -- image might be padded - struct gltexture_s* gltexture; + qfloat up, down, left, right; + qfloat smax, tmax; // johnfitz -- image might be padded + gltexture_t* gltexture; } mspriteframe_t; typedef struct @@ -348,10 +361,10 @@ struct aliashdr_t { int ident; int version; - glm::vec3 scale; - glm::vec3 scale_origin; + qvec3 scale; + qvec3 scale_origin; float boundingradius; - glm::vec3 eyeposition; + qvec3 eyeposition; int numskins; int skinwidth; int skinheight; @@ -363,8 +376,8 @@ struct aliashdr_t float size; // For vr - we modify these, so keep the originals - glm::vec3 original_scale; - glm::vec3 original_scale_origin; + qvec3 original_scale; + qvec3 original_scale_origin; // ericw -- used to populate vbo int numverts_vbo; // number of verts with unique x,y,z,s,t @@ -379,8 +392,8 @@ struct aliashdr_t int poseverts; int posedata; // numposes*poseverts trivert_t int commands; // gl command list with embedded s/t - struct gltexture_s* gltextures[MAX_SKINS][4]; // johnfitz - struct gltexture_s* fbtextures[MAX_SKINS][4]; // johnfitz + gltexture_t* gltextures[MAX_SKINS][4]; // johnfitz + gltexture_t* fbtextures[MAX_SKINS][4]; // johnfitz int texels[MAX_SKINS]; // only for player skins maliasframedesc_t frames[1]; // variable sized }; @@ -440,9 +453,9 @@ struct qmodel_t // // volume occupied by the model graphics // - glm::vec3 mins, maxs; - glm::vec3 ymins, ymaxs; // johnfitz -- bounds for entities with nonzero yaw - glm::vec3 rmins, + qvec3 mins, maxs; + qvec3 ymins, ymaxs; // johnfitz -- bounds for entities with nonzero yaw + qvec3 rmins, rmaxs; // johnfitz -- bounds for entities with nonzero pitch or roll // johnfitz -- removed float radius; @@ -450,7 +463,7 @@ struct qmodel_t // solid volume for clipping // bool clipbox; - glm::vec3 clipmins, clipmaxs; + qvec3 clipmins, clipmaxs; // // brush model @@ -458,7 +471,7 @@ struct qmodel_t int firstmodelsurface, nummodelsurfaces; int numsubmodels; - dmodel_t* submodels; + mmodel_t* submodels; int numplanes; mplane_t* planes; @@ -521,18 +534,18 @@ struct qmodel_t //============================================================================ -void Mod_Init(void); -void Mod_ClearAll(void); -void Mod_ResetAll(void); // for gamedir changes (Host_Game_f) +void Mod_Init(); +void Mod_ClearAll(); +void Mod_ResetAll(); // for gamedir changes (Host_Game_f) qmodel_t* Mod_ForName(const char* name, bool crash); qmodel_t* Mod_ForName_WithFallback(const char* name, const char* fallback); void* Mod_Extradata(qmodel_t* mod); // handles caching void Mod_TouchModel(const char* name); -mleaf_t* Mod_PointInLeaf(const glm::vec3& p, qmodel_t* model); +mleaf_t* Mod_PointInLeaf(const qvec3& p, qmodel_t* model); byte* Mod_LeafPVS(mleaf_t* leaf, qmodel_t* model); byte* Mod_NoVisPVS(qmodel_t* model); void Mod_SetExtraFlags(qmodel_t* mod); -#endif // __MODEL__ +void Mod_ForAllKnownNames(void (*f)(const char*)) noexcept; diff --git a/Quake/gl_refrag.cpp b/Quake/gl_refrag.cpp index 30d01871..86f968c1 100644 --- a/Quake/gl_refrag.cpp +++ b/Quake/gl_refrag.cpp @@ -23,6 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_efrag.c #include "quakedef.hpp" +#include "mathlib.hpp" +#include "glquake.hpp" +#include "client.hpp" +#include "entity.hpp" +#include "console.hpp" mnode_t* r_pefragtopnode; @@ -47,7 +52,7 @@ This is inspired by MH's tutorial, and code from RMQEngine. =============================================================================== */ -glm::vec3 r_emins, r_emaxs; +qvec3 r_emins, r_emaxs; entity_t* r_addent; diff --git a/Quake/gl_rlight.cpp b/Quake/gl_rlight.cpp index 82dbf27b..bdb744a2 100644 --- a/Quake/gl_rlight.cpp +++ b/Quake/gl_rlight.cpp @@ -23,6 +23,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_light.c #include "quakedef.hpp" +#include "quakedef_macros.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "mathlib.hpp" +#include "glquake.hpp" +#include "client.hpp" +#include "draw.hpp" +#include "view.hpp" int r_dlightframecount; @@ -98,7 +105,7 @@ void R_RenderDlight(dlight_t* light) float rad = light->radius * 0.35; - glm::vec3 v = light->origin - r_origin; + qvec3 v = light->origin - r_origin; if(glm::length(v) < rad) { // view is inside the dlight @@ -112,7 +119,7 @@ void R_RenderDlight(dlight_t* light) { v[i] = light->origin[i] - vpn[i] * rad; } - glVertex3fv(glm::value_ptr(v)); + glVertex3fv(toGlVec(v)); glColor3f(0, 0, 0); for(int i = 16; i >= 0; i--) { @@ -122,7 +129,7 @@ void R_RenderDlight(dlight_t* light) v[j] = light->origin[j] + vright[j] * cos(a) * rad + vup[j] * sin(a) * rad; } - glVertex3fv(glm::value_ptr(v)); + glVertex3fv(toGlVec(v)); } glEnd(); } @@ -322,8 +329,8 @@ LIGHT SAMPLING */ mplane_t* lightplane; -glm::vec3 lightspot; -glm::vec3 lightcolor; // johnfitz -- lit support via lordhavoc +qvec3 lightspot; +qvec3 lightcolor; // johnfitz -- lit support via lordhavoc /* ============= @@ -331,8 +338,8 @@ RecursiveLightPoint -- johnfitz -- replaced entire function for lit support via lordhavoc ============= */ -int RecursiveLightPoint(glm::vec3& color, mnode_t* node, const glm::vec3& start, - const glm::vec3& end) +int RecursiveLightPoint(qvec3& color, mnode_t* node, const qvec3& start, + const qvec3& end) { float front; float back; @@ -367,7 +374,7 @@ int RecursiveLightPoint(glm::vec3& color, mnode_t* node, const glm::vec3& start, frac = front / (front - back); - glm::vec3 mid; + qvec3 mid; mid[0] = start[0] + (end[0] - start[0]) * frac; mid[1] = start[1] + (end[1] - start[1]) * frac; mid[2] = start[2] + (end[2] - start[2]) * frac; @@ -495,7 +502,7 @@ R_LightPoint -- johnfitz -- replaced entire function for lit support via lordhavoc ============= */ -int R_LightPoint(const glm::vec3& p) +int R_LightPoint(const qvec3& p) { if(!cl.worldmodel->lightdata) { @@ -503,7 +510,7 @@ int R_LightPoint(const glm::vec3& p) return 255; } - glm::vec3 end; + qvec3 end; end[0] = p[0]; end[1] = p[1]; end[2] = p[2] - 8192; // johnfitz -- was 2048 diff --git a/Quake/gl_rmain.cpp b/Quake/gl_rmain.cpp index ac18a96b..3edceef5 100644 --- a/Quake/gl_rmain.cpp +++ b/Quake/gl_rmain.cpp @@ -23,14 +23,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_main.c #include "quakedef.hpp" -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" #include "vr.hpp" +#include "vr_showfn.hpp" +#include "vr_cvars.hpp" #include "util.hpp" -#include "opengl_ext.hpp" +#include "worldtext.hpp" +#include "console.hpp" +#include "sbar.hpp" +#include "glquake.hpp" +#include "shader.hpp" +#include "sys.hpp" +#include "gl_texmgr.hpp" +#include "view.hpp" +#include "vid.hpp" +#include "client.hpp" +#include "q_sound.hpp" + +#include <string_view> +#include <algorithm> bool r_cache_thrash; // compatability -glm::vec3 modelorg, r_entorigin; +qvec3 modelorg, r_entorigin; entity_t* currententity; int r_visframecount; // bumped when going to a new PVS @@ -46,10 +61,10 @@ float rs_megatexels; // // view origin // -glm::vec3 vup; -glm::vec3 vpn; -glm::vec3 vright; -glm::vec3 r_origin; +qvec3 vup; +qvec3 vpn; +qvec3 vright; +qvec3 r_origin; float r_fovx, r_fovy; // johnfitz -- rendering fov may be different becuase of // r_waterwarp and r_stereo @@ -66,6 +81,7 @@ int d_lightstylevalue[256]; // 8.8 fraction of base light value cvar_t r_norefresh = {"r_norefresh", "0", CVAR_NONE}; cvar_t r_drawentities = {"r_drawentities", "1", CVAR_NONE}; +cvar_t r_drawworldtext = {"r_drawworldtext", "1", CVAR_NONE}; cvar_t r_drawviewmodel = {"r_drawviewmodel", "1", CVAR_NONE}; cvar_t r_speeds = {"r_speeds", "0", CVAR_NONE}; cvar_t r_pos = {"r_pos", "0", CVAR_NONE}; @@ -153,7 +169,7 @@ void GLSLGamma_DeleteTexture() { glDeleteTextures(1, &r_gamma_texture); r_gamma_texture = 0; - r_gamma_program = 0; // deleted in R_DeleteShaders + r_gamma_program = 0; } /* @@ -163,33 +179,37 @@ GLSLGamma_CreateShaders */ static void GLSLGamma_CreateShaders() { - const GLchar* vertSource = - "#version 110\n" - "\n" - "void main(void) {\n" - " gl_Position = vec4(gl_Vertex.xy, 0.0, 1.0);\n" - " gl_TexCoord[0] = gl_MultiTexCoord0;\n" - "}\n"; - - const GLchar* fragSource = - "#version 110\n" - "\n" - "uniform sampler2D GammaTexture;\n" - "uniform float GammaValue;\n" - "uniform float ContrastValue;\n" - "\n" - "void main(void) {\n" - " vec4 frag = texture2D(GammaTexture, gl_TexCoord[0].xy);\n" - " frag.rgb = frag.rgb * ContrastValue;\n" - " gl_FragColor = vec4(pow(frag.rgb, vec3(GammaValue)), 1.0);\n" - "}\n"; + using namespace std::string_view_literals; + + constexpr auto vertSource = R"glsl( +#version 110 + +void main(void) { + gl_Position = vec4(gl_Vertex.xy, 0.0, 1.0); + gl_TexCoord[0] = gl_MultiTexCoord0; +} +)glsl"sv; + + constexpr auto fragSource = R"glsl( +#version 110 + +uniform sampler2D GammaTexture; +uniform float GammaValue; +uniform float ContrastValue; + +void main(void) { + vec4 frag = texture2D(GammaTexture, gl_TexCoord[0].xy); + frag.rgb = frag.rgb * ContrastValue; + gl_FragColor = vec4(pow(frag.rgb, vec3(GammaValue)), 1.0); +} +)glsl"sv; if(!gl_glsl_gamma_able) { return; } - r_gamma_program = GL_CreateProgram(vertSource, fragSource, 0, nullptr); + r_gamma_program = quake::make_gl_program(vertSource, fragSource); // get uniform locations gammaLoc = GL_GetUniformLocation(&r_gamma_program, "GammaValue"); @@ -257,16 +277,24 @@ void GLSLGamma_GammaCorrect() // TODO VR: (P2) this only affects 2D rendering, doesn't affect HMD // rendering - glBindFramebufferEXT(GL_FRAMEBUFFER, VR_GetEyeFBO(0).framebuffer); - glReadBuffer(GL_FRONT); + if(vr_fakevr.value == 0 && vr_novrinit.value == 0) + { + /* + glBindFramebuffer(GL_FRAMEBUFFER, VR_GetEyeFBO(0).framebuffer); + glReadBuffer(GL_FRONT); + */ + + glBindFramebuffer(GL_FRAMEBUFFER, VR_GetEyeFBO(0).framebuffer); + // glBindTexture(GL_TEXTURE_2D, VR_GetEyeFBO(0).texture); + } glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, glx, gly, glwidth, glheight); // draw the texture back to the framebuffer with a fragment shader - GL_UseProgramFunc(r_gamma_program); - GL_Uniform1fFunc(gammaLoc, vid_gamma.value); - GL_Uniform1fFunc(contrastLoc, q_min(2.0, q_max(1.0, vid_contrast.value))); - GL_Uniform1iFunc(textureLoc, 0); // use texture unit 0 + glUseProgram(r_gamma_program); + glUniform1f(gammaLoc, vid_gamma.value); + glUniform1f(contrastLoc, q_min(2.0, q_max(1.0, vid_contrast.value))); + glUniform1i(textureLoc, 0); // use texture unit 0 glDisable(GL_ALPHA_TEST); glDisable(GL_DEPTH_TEST); @@ -290,7 +318,7 @@ void GLSLGamma_GammaCorrect() glEnable(GL_CULL_FACE); - GL_UseProgramFunc(0); + glUseProgram(0); // clear cached binding GL_ClearBindings(); @@ -303,82 +331,106 @@ R_CullBox -- johnfitz -- replaced with new function from lordhavoc Returns true if the box is completely outside the frustum ================= */ -bool R_CullBox(const glm::vec3& emins, const glm::vec3& emaxs) +bool R_CullBox(const qvec3& emins, const qvec3& emaxs) { - int i; - mplane_t* p; - for(i = 0; i < 4; i++) + for(int i = 0; i < 4; i++) { - p = frustum + i; + const mplane_t* const p = frustum + i; + switch(p->signbits) { - default: + default: [[fallthrough]]; case 0: + { if(p->normal[0] * emaxs[0] + p->normal[1] * emaxs[1] + p->normal[2] * emaxs[2] < p->dist) { return true; } + break; + } case 1: + { if(p->normal[0] * emins[0] + p->normal[1] * emaxs[1] + p->normal[2] * emaxs[2] < p->dist) { return true; } + break; + } case 2: + { if(p->normal[0] * emaxs[0] + p->normal[1] * emins[1] + p->normal[2] * emaxs[2] < p->dist) { return true; } + break; + } case 3: + { if(p->normal[0] * emins[0] + p->normal[1] * emins[1] + p->normal[2] * emaxs[2] < p->dist) { return true; } + break; + } case 4: + { if(p->normal[0] * emaxs[0] + p->normal[1] * emaxs[1] + p->normal[2] * emins[2] < p->dist) { return true; } + break; + } case 5: + { if(p->normal[0] * emins[0] + p->normal[1] * emaxs[1] + p->normal[2] * emins[2] < p->dist) { return true; } + break; + } case 6: + { if(p->normal[0] * emaxs[0] + p->normal[1] * emins[1] + p->normal[2] * emins[2] < p->dist) { return true; } + break; + } case 7: + { if(p->normal[0] * emins[0] + p->normal[1] * emins[1] + p->normal[2] * emins[2] < p->dist) { return true; } + break; + } } } + return false; } /* @@ -388,8 +440,8 @@ R_CullModelForEntity -- johnfitz -- uses correct bounds based on rotation */ bool R_CullModelForEntity(entity_t* e) { - glm::vec3 mins; - glm::vec3 maxs; + qvec3 mins; + qvec3 maxs; if(e->angles[0] || e->angles[2]) // pitch or roll { @@ -416,7 +468,7 @@ R_RotateForEntity -- johnfitz -- modified to take origin and angles instead of pointer to entity =============== */ -void R_RotateForEntity(const glm::vec3& origin, const glm::vec3& angles) +void R_RotateForEntity(const qvec3& origin, const qvec3& angles) { glTranslatef(origin[0], origin[1], origin[2]); glRotatef(angles[YAW], 0, 0, 1); @@ -488,13 +540,13 @@ to turn away from side, use a negative angle =============== */ #define DEG2RAD(a) ((a)*M_PI_DIV_180) -[[nodiscard]] glm::vec3 TurnVector( - const glm::vec3& forward, const glm::vec3& side, const float angle) noexcept +[[nodiscard]] qvec3 TurnVector( + const qvec3& forward, const qvec3& side, const float angle) noexcept { const float scale_forward = cos(DEG2RAD(angle)); const float scale_side = sin(DEG2RAD(angle)); - glm::vec3 res; + qvec3 res; res[0] = scale_forward * forward[0] + scale_side * side[0]; res[1] = scale_forward * forward[1] + scale_side * side[1]; res[2] = scale_forward * forward[2] + scale_side * side[2]; @@ -781,6 +833,153 @@ void R_DrawEntitiesOnList(bool alphapass) // johnfitz -- added parameter } } +void R_DrawWorldText() +{ + // TODO VR: (P1) cleanup and optimize + + const auto drawCharacterQuad = [](const qvec3& pos, const qvec3& hInc, + const qvec3& zInc, const char num) { + const int row = num >> 4; + const int col = num & 15; + + const float frow = row * 0.0625; + const float fcol = col * 0.0625; + const float size = 0.0625; + + const auto doVertex = [&](const qvec3& p) { + glVertex3f(p.x, p.y, p.z); + }; + + glTexCoord2f(fcol, frow); + doVertex(pos); + + glTexCoord2f(fcol + size, frow); + doVertex(pos + hInc); + + glTexCoord2f(fcol + size, frow + size); + doVertex(pos + hInc + zInc); + + glTexCoord2f(fcol, frow + size); + doVertex(pos + zInc); + }; + + const auto forSplitStringView = [](const std::string_view str, + const std::string_view delims, + auto&& f) { + for(auto first = str.data(), second = str.data(), + last = first + str.size(); + second != last && first != last; first = second + 1) + { + second = std::find_first_of( + first, last, std::cbegin(delims), std::cend(delims)); + + if(first != second) + { + f(std::string_view(first, second - first)); + } + } + }; + + const auto drawString = [&](const qvec3& originalpos, const qvec3& angles, + const std::string_view str, + const WorldText::HAlign hAlign) { + static std::vector<std::string_view> lines; + + // Split into lines + lines.clear(); + forSplitStringView(str, "\n", + [&](const std::string_view sv) { lines.emplace_back(sv); }); + + if(lines.empty()) + { + return; + } + + // Find longest line size (for centering) + const std::size_t longestLineSize = std::max_element(lines.begin(), + lines.end(), + [](const std::string_view& a, const std::string_view& b) { + return a.size() < b.size(); + })->size(); + + // Angles and offsets + const auto [fwd, right, up] = quake::util::getAngledVectors(angles); + const auto hInc = right * 8.f; + const auto zInc = qvec3{0, 0, -8.f} * up; + + // Bounds + const auto absmins = originalpos; + const auto absmaxs = absmins + + (hInc * static_cast<float>(longestLineSize)) + + (zInc * static_cast<float>(lines.size())); + + const auto center = originalpos - ((absmaxs - absmins) / 2.f); + + // Draw + std::size_t iLine = 0; + for(const std::string_view& line : lines) + { + const std::size_t sizeDiff = longestLineSize - line.size(); + + auto startPos = [&] { + if(hAlign == WorldText::HAlign::Left) + { + return center + (zInc * static_cast<float>(iLine)); + } + + if(hAlign == WorldText::HAlign::Center) + { + return center + + (hInc * static_cast<float>(sizeDiff) / 2.f) + + (zInc * static_cast<float>(iLine)); + } + + assert(hAlign == WorldText::HAlign::Right); + return center + (hInc * static_cast<float>(sizeDiff)) + + (zInc * static_cast<float>(iLine)); + }(); + + for(const char c : line) + { + if(c != ' ') + { + // don't waste verts on spaces + drawCharacterQuad(startPos, hInc, zInc, c); + } + + startPos += hInc; + } + + ++iLine; + } + }; + + if(!r_drawworldtext.value) + { + return; + } + + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glColor4f(1, 1, 1, 1); + + extern gltexture_t* char_texture; + GL_Bind(char_texture); + glBegin(GL_QUADS); + + for(const WorldText& wt : cl.worldTexts) + { + drawString(wt._pos, wt._angles, wt._text, wt._hAlign); + } + + glEnd(); + + glDisable(GL_ALPHA_TEST); + glEnable(GL_BLEND); + glEnable(GL_CULL_FACE); +} + /* ============= R_DrawViewModel -- johnfitz -- gutted @@ -794,13 +993,14 @@ void R_DrawViewModel(entity_t* viewent) return; } - if(cl.items & IT_INVISIBILITY || cl.stats[STAT_HEALTH] <= 0) + if(cl.stats[STAT_HEALTH] <= 0) { - // TODO VR: (P0) use alpha instead of not drawing viewmodel with - // invisibility return; } + // Apply transparency effect when player has invisibility. + viewent->alpha = (cl.items & IT_INVISIBILITY) ? 128 : 255; + currententity = viewent; if(!currententity->model) { @@ -834,7 +1034,7 @@ void R_DrawViewModel(entity_t* viewent) R_EmitWirePoint -- johnfitz -- draws a wireframe cross shape for point entities ================ */ -void R_EmitWirePoint(const glm::vec3& origin) +void R_EmitWirePoint(const qvec3& origin) { constexpr int size = 4; @@ -853,7 +1053,7 @@ void R_EmitWirePoint(const glm::vec3& origin) R_EmitWireBox -- johnfitz -- draws one axis aligned bounding box ================ */ -void R_EmitWireBox(const glm::vec3& mins, const glm::vec3& maxs) +void R_EmitWireBox(const qvec3& mins, const qvec3& maxs) { glBegin(GL_QUAD_STRIP); glVertex3f(mins[0], mins[1], mins[2]); @@ -914,8 +1114,8 @@ void R_ShowBoundingBoxes() else { // box entity - const glm::vec3 mins = ed->v.mins + ed->v.origin; - const glm::vec3 maxs = ed->v.maxs + ed->v.origin; + const qvec3 mins = ed->v.mins + ed->v.origin; + const qvec3 maxs = ed->v.maxs + ed->v.origin; R_EmitWireBox(mins, maxs); } } @@ -979,8 +1179,8 @@ void R_ShowTris() } } - const auto doViewmodel = [&](entity_t* ent) { - currententity = ent; + const auto doViewmodel = [&](entity_t& ent) { + currententity = &ent; if(r_drawviewmodel.value && !chase_active.value && cl.stats[STAT_HEALTH] > 0 && !(cl.items & IT_INVISIBILITY) && currententity->model && currententity->model->type == mod_alias) @@ -991,34 +1191,7 @@ void R_ShowTris() } }; - // viewmodel - doViewmodel(&cl.viewent); - - // offhand viewmodel - doViewmodel(&cl.offhand_viewent); - - // hip holsters - doViewmodel(&cl.left_hip_holster); - doViewmodel(&cl.right_hip_holster); - - // upper holsters - doViewmodel(&cl.left_upper_holster); - doViewmodel(&cl.right_upper_holster); - - // hands - doViewmodel(&cl.left_hand); - doViewmodel(&cl.right_hand); - - // vrtorso - doViewmodel(&cl.vrtorso); - - // hip holsters slots - doViewmodel(&cl.left_hip_holster_slot); - doViewmodel(&cl.right_hip_holster_slot); - - // upper holsters slots - doViewmodel(&cl.left_upper_holster_slot); - doViewmodel(&cl.right_upper_holster_slot); + forAllViewmodels(cl, doViewmodel); } extern cvar_t r_particles; @@ -1073,19 +1246,11 @@ void R_DrawShadows() continue; } + const bool isViewmodel = + anyViewmodel(cl, [&](entity_t& e) { return currententity == &e; }); + // TODO VR: (P2) repetition here to check player view entities - if(currententity == &cl.viewent || - currententity == &cl.offhand_viewent || - currententity == &cl.left_hip_holster || - currententity == &cl.right_hip_holster || - currententity == &cl.left_upper_holster || - currententity == &cl.right_upper_holster || - currententity == &cl.left_hand || currententity == &cl.right_hand || - currententity == &cl.vrtorso || - currententity == &cl.left_hip_holster_slot || - currententity == &cl.right_hip_holster_slot || - currententity == &cl.left_upper_holster_slot || - currententity == &cl.right_upper_holster_slot) + if(isViewmodel) { // View entities are drawn manually below. continue; @@ -1095,11 +1260,11 @@ void R_DrawShadows() } // TODO VR: (P1) viewent shadow looks weird - const auto drawViewentShadow = [](entity_t* ent) { - if(ent->model != nullptr) + const auto drawViewentShadow = [](entity_t& ent) { + if(ent.model != nullptr) { - currententity = ent; - GL_DrawAliasShadow(ent); + currententity = &ent; + GL_DrawAliasShadow(&ent); } }; @@ -1111,25 +1276,13 @@ void R_DrawShadows() if(playerShadows == VrPlayerShadows::ViewEntities || playerShadows == VrPlayerShadows::Both) { - drawViewentShadow(&cl.viewent); - drawViewentShadow(&cl.offhand_viewent); - drawViewentShadow(&cl.left_hip_holster); - drawViewentShadow(&cl.right_hip_holster); - drawViewentShadow(&cl.left_upper_holster); - drawViewentShadow(&cl.right_upper_holster); - drawViewentShadow(&cl.left_hand); - drawViewentShadow(&cl.right_hand); - drawViewentShadow(&cl.vrtorso); - drawViewentShadow(&cl.left_hip_holster_slot); - drawViewentShadow(&cl.right_hip_holster_slot); - drawViewentShadow(&cl.left_upper_holster_slot); - drawViewentShadow(&cl.right_upper_holster_slot); + forAllViewmodels(cl, drawViewentShadow); } if(playerShadows == VrPlayerShadows::ThirdPerson || playerShadows == VrPlayerShadows::Both) { - drawViewentShadow(&cl_entities[cl.viewentity]); + drawViewentShadow(cl_entities[cl.viewentity]); } } @@ -1162,6 +1315,8 @@ void R_RenderScene() R_DrawEntitiesOnList(false); // johnfitz -- false means this is the pass for // nonalpha entities + R_DrawWorldText(); + R_DrawWorld_Water(); // johnfitz -- drawn here since they might have // transparency @@ -1176,7 +1331,7 @@ void R_RenderScene() if(vr_enabled.value) { - VR_ShowCrosshair(); + quake::vr::showfn::show_crosshair(); } // johnfitz -- moved here from R_RenderView @@ -1185,6 +1340,10 @@ void R_RenderScene() // VR: This is what draws the offhand. R_DrawViewModel(&cl.offhand_viewent); + // VR: This is what draws the weapon buttons. + R_DrawViewModel(&cl.mainhand_wpn_button); + R_DrawViewModel(&cl.offhand_wpn_button); + if(vr_leg_holster_model_enabled.value) { // VR: This is what draws the hip holsters slots. @@ -1205,8 +1364,20 @@ void R_RenderScene() R_DrawViewModel(&cl.right_upper_holster); // VR: This is what draws the hands. - R_DrawViewModel(&cl.left_hand); - R_DrawViewModel(&cl.right_hand); + const auto drawHand = [](auto& handEntities) { + R_DrawViewModel(&handEntities.base); + R_DrawViewModel(&handEntities.f_thumb); + R_DrawViewModel(&handEntities.f_index); + R_DrawViewModel(&handEntities.f_middle); + R_DrawViewModel(&handEntities.f_ring); + R_DrawViewModel(&handEntities.f_pinky); + }; + + drawHand(cl.left_hand_entities); + drawHand(cl.right_hand_entities); + + drawHand(cl.left_hand_ghost_entities); + drawHand(cl.right_hand_ghost_entities); // VR: This is what draws the torso. if(vr_vrtorso_enabled.value == 1) @@ -1219,7 +1390,7 @@ void R_RenderScene() R_ShowBoundingBoxes(); // johnfitz if(vr_enabled.value) { - VR_DrawAllShowHelpers(); + quake::vr::showfn::draw_all_show_helpers(); } } @@ -1379,15 +1550,15 @@ void R_RenderView() // johnfitz -- stereo rendering -- full of hacky goodness if(r_stereo.value) { - float eyesep = CLAMP(-8.0f, r_stereo.value, 8.0f); - float fdepth = CLAMP(32.0f, r_stereodepth.value, 1024.0f); + qfloat eyesep = CLAMP(-8.0f, r_stereo.value, 8.0f); + qfloat fdepth = CLAMP(32.0f, r_stereodepth.value, 1024.0f); std::tie(vpn, vright, vup) = quake::util::getAngledVectors(r_refdef.viewangles); // render left eye (red) glColorMask(1, 0, 0, 1); - r_refdef.vieworg += (-0.5f * eyesep) * vright; + r_refdef.vieworg += (-0.5_qf * eyesep) * vright; frustum_skew = 0.5 * eyesep * NEARCLIP / fdepth; srand((int)(cl.time * 1000)); // sync random stuff between eyes @@ -1396,7 +1567,7 @@ void R_RenderView() // render right eye (cyan) glClear(GL_DEPTH_BUFFER_BIT); glColorMask(0, 1, 1, 1); - r_refdef.vieworg += (1.0f * eyesep) * vright; + r_refdef.vieworg += (1.0_qf * eyesep) * vright; frustum_skew = -frustum_skew; srand((int)(cl.time * 1000)); // sync random stuff between eyes @@ -1404,7 +1575,7 @@ void R_RenderView() // restore glColorMask(1, 1, 1, 1); - r_refdef.vieworg += (-0.5f * eyesep) * vright; + r_refdef.vieworg += (-0.5_qf * eyesep) * vright; frustum_skew = 0.0f; } else diff --git a/Quake/gl_rmisc.cpp b/Quake/gl_rmisc.cpp index b979e454..cf71ce34 100644 --- a/Quake/gl_rmisc.cpp +++ b/Quake/gl_rmisc.cpp @@ -23,8 +23,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // r_misc.c +#include "host.hpp" #include "quakedef.hpp" #include "vr.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "glquake.hpp" +#include "client.hpp" +#include "sys.hpp" +#include "gl_texmgr.hpp" // johnfitz -- new cvars extern cvar_t r_stereo; @@ -203,6 +210,7 @@ void R_Init() Cvar_RegisterVariable(&r_lightmap); Cvar_RegisterVariable(&r_fullbright); Cvar_RegisterVariable(&r_drawentities); + Cvar_RegisterVariable(&r_drawworldtext); Cvar_RegisterVariable(&r_drawviewmodel); Cvar_RegisterVariable(&r_shadows); Cvar_RegisterVariable(&r_wateralpha); @@ -525,47 +533,6 @@ void D_FlushCaches() { } -static GLuint gl_programs[16]; -static int gl_num_programs; - -static bool GL_CheckShader(GLuint shader) -{ - GLint status; - GL_GetShaderivFunc(shader, GL_COMPILE_STATUS, &status); - - if(status != GL_TRUE) - { - char infolog[1024]; - - memset(infolog, 0, sizeof(infolog)); - GL_GetShaderInfoLogFunc(shader, sizeof(infolog), nullptr, infolog); - - Con_Warning("GLSL program failed to compile: %s", infolog); - - return false; - } - return true; -} - -static bool GL_CheckProgram(GLuint program) -{ - GLint status; - GL_GetProgramivFunc(program, GL_LINK_STATUS, &status); - - if(status != GL_TRUE) - { - char infolog[1024]; - - memset(infolog, 0, sizeof(infolog)); - GL_GetProgramInfoLogFunc(program, sizeof(infolog), nullptr, infolog); - - Con_Warning("GLSL program failed to link: %s", infolog); - - return false; - } - return true; -} - /* ============= GL_GetUniformLocation @@ -580,117 +547,16 @@ GLint GL_GetUniformLocation(GLuint* programPtr, const char* name) return -1; } - location = GL_GetUniformLocationFunc(*programPtr, name); + location = glGetUniformLocation(*programPtr, name); if(location == -1) { - Con_Warning("GL_GetUniformLocationFunc %s failed\n", name); + Con_Warning("glGetUniformLocation %s failed\n", name); *programPtr = 0; } return location; } -/* -==================== -GL_CreateProgram - -Compiles and returns GLSL program. -==================== -*/ -GLuint GL_CreateProgram(const GLchar* vertSource, const GLchar* fragSource, - int numbindings, const glsl_attrib_binding_t* bindings) -{ - int i; - GLuint program; - - GLuint vertShader; - - GLuint fragShader; - - if(!gl_glsl_able) - { - return 0; - } - - vertShader = GL_CreateShaderFunc(GL_VERTEX_SHADER); - GL_ShaderSourceFunc(vertShader, 1, &vertSource, nullptr); - GL_CompileShaderFunc(vertShader); - if(!GL_CheckShader(vertShader)) - { - GL_DeleteShaderFunc(vertShader); - return 0; - } - - fragShader = GL_CreateShaderFunc(GL_FRAGMENT_SHADER); - GL_ShaderSourceFunc(fragShader, 1, &fragSource, nullptr); - GL_CompileShaderFunc(fragShader); - if(!GL_CheckShader(fragShader)) - { - GL_DeleteShaderFunc(vertShader); - GL_DeleteShaderFunc(fragShader); - return 0; - } - program = GL_CreateProgramFunc(); - GL_AttachShaderFunc(program, vertShader); - GL_DeleteShaderFunc(vertShader); - GL_AttachShaderFunc(program, fragShader); - GL_DeleteShaderFunc(fragShader); - - for(i = 0; i < numbindings; i++) - { - GL_BindAttribLocationFunc( - program, bindings[i].attrib, bindings[i].name); - } - - GL_LinkProgramFunc(program); - - if(!GL_CheckProgram(program)) - { - GL_DeleteProgramFunc(program); - return 0; - } - - if(gl_num_programs == (sizeof(gl_programs) / sizeof(GLuint))) - - { - - Host_Error("gl_programs overflow"); - } - - - - gl_programs[gl_num_programs] = program; - - gl_num_programs++; - - - - return program; -} - -/* -==================== -R_DeleteShaders - -Deletes any GLSL programs that have been created. -==================== -*/ -void R_DeleteShaders() -{ - int i; - - if(!gl_glsl_able) - { - return; - } - - for(i = 0; i < gl_num_programs; i++) - { - GL_DeleteProgramFunc(gl_programs[i]); - gl_programs[i] = 0; - } - gl_num_programs = 0; -} GLuint current_array_buffer, current_element_array_buffer; /* @@ -723,7 +589,7 @@ void GL_BindBuffer(GLenum target, GLuint buffer) if(*cache != buffer) { *cache = buffer; - GL_BindBufferFunc(target, *cache); + glBindBufferARB(target, *cache); } } @@ -744,6 +610,6 @@ void GL_ClearBufferBindings() current_array_buffer = 0; current_element_array_buffer = 0; - GL_BindBufferFunc(GL_ARRAY_BUFFER, 0); - GL_BindBufferFunc(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); } diff --git a/Quake/gl_screen.cpp b/Quake/gl_screen.cpp index bd8f0f60..87f1f06e 100644 --- a/Quake/gl_screen.cpp +++ b/Quake/gl_screen.cpp @@ -26,6 +26,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "sbar.hpp" +#include "qpic.hpp" +#include "image.hpp" +#include "glquake.hpp" +#include "menu.hpp" +#include "keys.hpp" +#include "sys.hpp" +#include "client.hpp" +#include "mathlib.hpp" +#include "draw.hpp" +#include "q_sound.hpp" +#include "draw.hpp" +#include "screen.hpp" +#include "view.hpp" /* @@ -1273,6 +1290,7 @@ void SCR_UpdateScreenContent() SCR_DrawClock(); // johnfitz SCR_DrawConsole(); M_Draw(); + M_DrawKeyboard(); } } diff --git a/Quake/gl_sky.cpp b/Quake/gl_sky.cpp index ea2dd7ec..96501558 100644 --- a/Quake/gl_sky.cpp +++ b/Quake/gl_sky.cpp @@ -25,11 +25,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "util.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "image.hpp" +#include "common.hpp" +#include "glquake.hpp" +#include "gl_texmgr.hpp" +#include "client.hpp" +#include "sys.hpp" #define MAX_CLIP_VERTS 64 - - extern qmodel_t* loadmodel; // for r_speeds readout // for r_speeds readout @@ -77,78 +83,67 @@ A sky texture is 256*128, with the left side being a masked overlay */ void Sky_LoadTexture(texture_t* mt) { - char texturename[64]; - int i; - - int j; - - int p; - - int r; - - int g; - - int b; - - int count; - byte* src; static byte front_data[128 * 128]; // FIXME: Hunk_Alloc static byte back_data[128 * 128]; // FIXME: Hunk_Alloc - unsigned* rgba; - src = (byte*)mt + mt->offsets[0]; + byte* src = (byte*)mt + mt->offsets[0]; // extract back layer and upload - for(i = 0; i < 128; i++) + for(int i = 0; i < 128; ++i) { - for(j = 0; j < 128; j++) + for(int j = 0; j < 128; ++j) { back_data[(i * 128) + j] = src[i * 256 + j + 128]; } + } - q_snprintf(texturename, sizeof(texturename), "%s:%s_back", - loadmodel->name, mt->name); - solidskytexture = TexMgr_LoadImage(loadmodel, texturename, 128, 128, - SRC_INDEXED, back_data, "", (src_offset_t)back_data, TEXPREF_NONE); + char texturename[64]; + q_snprintf(texturename, sizeof(texturename), "%s:%s_back", loadmodel->name, + mt->name); + solidskytexture = TexMgr_LoadImage(loadmodel, texturename, 128, 128, + SRC_INDEXED, back_data, "", (src_offset_t)back_data, TEXPREF_NONE); - // extract front layer and upload - for(i = 0; i < 128; i++) + // extract front layer and upload + for(int i = 0; i < 128; ++i) + { + for(int j = 0; j < 128; ++j) { - for(j = 0; j < 128; j++) + front_data[(i * 128) + j] = src[i * 256 + j]; + + if(front_data[(i * 128) + j] == 0) { - front_data[(i * 128) + j] = src[i * 256 + j]; - if(front_data[(i * 128) + j] == 0) - { - front_data[(i * 128) + j] = 255; - } + front_data[(i * 128) + j] = 255; } } + } - q_snprintf(texturename, sizeof(texturename), "%s:%s_front", - loadmodel->name, mt->name); - alphaskytexture = - TexMgr_LoadImage(loadmodel, texturename, 128, 128, SRC_INDEXED, - front_data, "", (src_offset_t)front_data, TEXPREF_ALPHA); + q_snprintf(texturename, sizeof(texturename), "%s:%s_front", loadmodel->name, + mt->name); + alphaskytexture = TexMgr_LoadImage(loadmodel, texturename, 128, 128, + SRC_INDEXED, front_data, "", (src_offset_t)front_data, TEXPREF_ALPHA); - // calculate r_fastsky color based on average of all opaque foreground - // colors - r = g = b = count = 0; - for(i = 0; i < 128; i++) + // calculate r_fastsky color based on average of all opaque foreground + // colors + int r, g, b, count; + r = g = b = count = 0; + + for(int i = 0; i < 128; i++) + { + for(int j = 0; j < 128; j++) { - for(j = 0; j < 128; j++) + int p = src[i * 256 + j]; + + if(p != 0) { - p = src[i * 256 + j]; - if(p != 0) - { - rgba = &d_8to24table[p]; - r += ((byte*)rgba)[0]; - g += ((byte*)rgba)[1]; - b += ((byte*)rgba)[2]; - count++; - } + unsigned int* rgba = &d_8to24table[p]; + r += ((byte*)rgba)[0]; + g += ((byte*)rgba)[1]; + b += ((byte*)rgba)[2]; + ++count; } } } + skyflatcolor[0] = (float)r / (count * 255); skyflatcolor[1] = (float)g / (count * 255); skyflatcolor[2] = (float)b / (count * 255); @@ -406,13 +401,13 @@ void Sky_ProjectPoly(int nump, vec3_t vecs) float* vp; // decide which face it maps to - glm::vec3 v = vec3_zero; + qvec3 v = vec3_zero; for(i = 0, vp = vecs; i < nump; i++, vp += 3) { VectorAdd(vp, v, v); } - glm::vec3 av; + qvec3 av; av[0] = fabs(v[0]); av[1] = fabs(v[1]); av[2] = fabs(v[2]); @@ -689,10 +684,10 @@ void Sky_ProcessEntities() float dot; bool rotated; - glm::vec3 temp; - glm::vec3 forward; - glm::vec3 right; - glm::vec3 up; + qvec3 temp; + qvec3 forward; + qvec3 right; + qvec3 up; if(!r_drawentities.value) { @@ -989,9 +984,9 @@ void Sky_DrawFaceQuad(glpoly_t* p) for(i = 0, v = p->verts[0]; i < 4; i++, v += VERTEXSIZE) { Sky_GetTexCoord(v, 8, &s, &t); - GL_MTexCoord2fFunc(GL_TEXTURE0_ARB, s, t); + glMultiTexCoord2fARB(GL_TEXTURE0_ARB, s, t); Sky_GetTexCoord(v, 16, &s, &t); - GL_MTexCoord2fFunc(GL_TEXTURE1_ARB, s, t); + glMultiTexCoord2fARB(GL_TEXTURE1_ARB, s, t); glVertex3fv(v); } glEnd(); @@ -1081,20 +1076,20 @@ void Sky_DrawFace(int axis) int j; int start; - float di; + qfloat di; - float qi; + qfloat qi; - float dj; + qfloat dj; - float qj; - glm::vec3 vup; + qfloat qj; + qvec3 vup; - glm::vec3 vright; + qvec3 vright; - glm::vec3 temp; + qvec3 temp; - glm::vec3 temp2; + qvec3 temp2; Sky_SetBoxVert(-1.0, -1.0, axis, verts[0]); Sky_SetBoxVert(-1.0, 1.0, axis, verts[1]); diff --git a/Quake/gl_texmgr.cpp b/Quake/gl_texmgr.cpp index 4620344d..261946be 100644 --- a/Quake/gl_texmgr.cpp +++ b/Quake/gl_texmgr.cpp @@ -24,6 +24,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // gl_texmgr.c -- fitzquake's texture manager. manages opengl texture images #include "quakedef.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "crc.hpp" +#include "sbar.hpp" +#include "image.hpp" +#include "glquake.hpp" +#include "gl_texmgr.hpp" +#include "common.hpp" +#include "sys.hpp" +#include "render.hpp" const int gl_solid_format = 3; const int gl_alpha_format = 4; @@ -1791,7 +1801,7 @@ void GL_SelectTexture(GLenum target) return; } - GL_SelectTextureFunc(target); + glActiveTextureARB(target); currenttarget = target; } diff --git a/Quake/gl_texmgr.hpp b/Quake/gl_texmgr.hpp index b96c353a..fd1c7b34 100644 --- a/Quake/gl_texmgr.hpp +++ b/Quake/gl_texmgr.hpp @@ -20,8 +20,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _GL_TEXMAN_H -#define _GL_TEXMAN_H +#pragma once + +#include <GL/glew.h> + +#include "quakedef_macros.hpp" +#include "gl_model.hpp" // gl_texmgr.h -- fitzquake's texture manager. manages opengl texture images @@ -50,11 +54,11 @@ enum srcformat typedef uintptr_t src_offset_t; -typedef struct gltexture_s +struct gltexture_t { // managed by texture manager GLuint texnum; - struct gltexture_s* next; + gltexture_t* next; qmodel_t* owner; // managed by image loading char name[64]; @@ -73,7 +77,7 @@ typedef struct gltexture_s signed char pants; // 0-13 pants color, or -1 if never colormapped // used for rendering int visframe; // matches r_framecount if texture was bound this frame -} gltexture_t; +}; extern gltexture_t* notexture; extern gltexture_t* nulltexture; @@ -87,23 +91,23 @@ extern unsigned int d_8to24table_pants[256]; // TEXTURE MANAGER -float TexMgr_FrameUsage(void); +float TexMgr_FrameUsage(); gltexture_t* TexMgr_FindTexture(qmodel_t* owner, const char* name); -gltexture_t* TexMgr_NewTexture(void); +gltexture_t* TexMgr_NewTexture(); void TexMgr_FreeTexture(gltexture_t* kill); void TexMgr_FreeTextures(unsigned int flags, unsigned int mask); void TexMgr_FreeTexturesForOwner(qmodel_t* owner); -void TexMgr_NewGame(void); -void TexMgr_Init(void); -void TexMgr_DeleteTextureObjects(void); +void TexMgr_NewGame(); +void TexMgr_Init(); +void TexMgr_DeleteTextureObjects(); // IMAGE LOADING gltexture_t* TexMgr_LoadImage(qmodel_t* owner, const char* name, int width, int height, enum srcformat format, byte* data, const char* source_file, src_offset_t source_offset, unsigned flags); void TexMgr_ReloadImage(gltexture_t* glt, int shirt, int pants); -void TexMgr_ReloadImages(void); -void TexMgr_ReloadNobrightImages(void); +void TexMgr_ReloadImages(); +void TexMgr_ReloadNobrightImages(); int TexMgr_Pad(int s); int TexMgr_SafeTextureSize(int s); @@ -112,9 +116,7 @@ int TexMgr_PadConditional(int s); // TEXTURE BINDING & TEXTURE UNIT SWITCHING void GL_SelectTexture(GLenum target); -void GL_DisableMultitexture(void); // selects texture unit 0 -void GL_EnableMultitexture(void); // selects texture unit 1 +void GL_DisableMultitexture(); // selects texture unit 0 +void GL_EnableMultitexture(); // selects texture unit 1 void GL_Bind(gltexture_t* texture); -void GL_ClearBindings(void); - -#endif /* _GL_TEXMAN_H */ +void GL_ClearBindings(); diff --git a/Quake/gl_util.cpp b/Quake/gl_util.cpp new file mode 100644 index 00000000..6f64d0f5 --- /dev/null +++ b/Quake/gl_util.cpp @@ -0,0 +1,61 @@ +#include "gl_util.hpp" +#include "glquake.hpp" + +#include <GL/glew.h> + +namespace quake::vr::gl_util +{ + +[[nodiscard]] gl_beginend_guard::gl_beginend_guard(const GLenum mode) noexcept +{ + glBegin(mode); +} + +gl_beginend_guard::~gl_beginend_guard() noexcept +{ + glEnd(); +} + +void gl_showfn_guard::setup_gl() noexcept +{ + glDisable(GL_DEPTH_TEST); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + GL_PolygonOffset(OFFSET_SHOWTRIS); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable(GL_TEXTURE_2D); + glDisable(GL_CULL_FACE); +} + +void gl_showfn_guard::cleanup_gl() noexcept +{ + glColor3f(1, 1, 1); + glEnable(GL_TEXTURE_2D); + glEnable(GL_CULL_FACE); + glDisable(GL_BLEND); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + GL_PolygonOffset(OFFSET_NONE); + glEnable(GL_DEPTH_TEST); +} + +[[nodiscard]] gl_showfn_guard::gl_showfn_guard() noexcept +{ + setup_gl(); +} + +gl_showfn_guard::~gl_showfn_guard() noexcept +{ + cleanup_gl(); +} + +void gl_vertex(const qvec2& v) noexcept +{ + glVertex2f(v[0], v[1]); +} + +void gl_vertex(const qvec3& v) noexcept +{ + glVertex3f(v[0], v[1], v[2]); +} + +} // namespace quake::vr::gl_util diff --git a/Quake/gl_util.hpp b/Quake/gl_util.hpp new file mode 100644 index 00000000..4e4d387c --- /dev/null +++ b/Quake/gl_util.hpp @@ -0,0 +1,93 @@ +#pragma once + +#include "quakeglm_qvec2.hpp" +#include "quakeglm_qvec3.hpp" + +#include <GL/glew.h> + +namespace quake::vr::gl_util +{ + +struct gl_beginend_guard +{ + [[nodiscard]] gl_beginend_guard(const GLenum mode) noexcept; + ~gl_beginend_guard() noexcept; +}; + +class gl_showfn_guard +{ +private: + static void setup_gl() noexcept; + static void cleanup_gl() noexcept; + +public: + [[nodiscard]] gl_showfn_guard() noexcept; + ~gl_showfn_guard() noexcept; + + gl_showfn_guard(const gl_showfn_guard&) = delete; + gl_showfn_guard(gl_showfn_guard&&) = delete; + + gl_showfn_guard& operator=(const gl_showfn_guard&) = delete; + gl_showfn_guard& operator=(gl_showfn_guard&&) = delete; + + template <typename F> + void draw_points_with_size(float size, F&& f_draw) noexcept + { + glEnable(GL_POINT_SMOOTH); + glPointSize(size); + + { + const gl_beginend_guard guard{GL_POINTS}; + f_draw(); + } + + glDisable(GL_POINT_SMOOTH); + } + + template <typename F> + void draw_points(F&& f_draw) noexcept + { + draw_points_with_size(12.f, f_draw); + } + + template <typename F> + void draw_points_and_lines(F&& f_draw) noexcept + { + glLineWidth(2.f * glwidth / vid.width); + + glEnable(GL_LINE_SMOOTH); + glShadeModel(GL_SMOOTH); + + { + const gl_beginend_guard guard{GL_LINES}; + f_draw(); + } + + glShadeModel(GL_FLAT); + glDisable(GL_LINE_SMOOTH); + + draw_points(f_draw); + } + + template <typename F> + void draw_line_strip(const float size, F&& f_draw) + { + glLineWidth(size * glwidth / vid.width); + + glEnable(GL_LINE_SMOOTH); + glShadeModel(GL_SMOOTH); + + { + const gl_beginend_guard guard{GL_LINE_STRIP}; + f_draw(); + } + + glShadeModel(GL_FLAT); + glDisable(GL_LINE_SMOOTH); + } +}; + +void gl_vertex(const qvec2& v) noexcept; +void gl_vertex(const qvec3& v) noexcept; + +} // namespace quake::vr::gl_util diff --git a/Quake/gl_vidsdl.cpp b/Quake/gl_vidsdl.cpp index d02e340a..dfb8bd46 100644 --- a/Quake/gl_vidsdl.cpp +++ b/Quake/gl_vidsdl.cpp @@ -26,17 +26,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "cfgfile.hpp" #include "bgmusic.hpp" -#include "resource.hpp" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) +#include "cmd.hpp" +#include "common.hpp" +#include "cdaudio.hpp" +#include "console.hpp" +#include "sbar.hpp" +#include "platform.hpp" +#include "glquake.hpp" +#include "qpic.hpp" +#include "zone.hpp" +#include "keys.hpp" +#include "menu.hpp" +#include "byteorder.hpp" +#include "sys.hpp" +#include "screen.hpp" +#include "input.hpp" +#include "q_sound.hpp" +#include "gl_texmgr.hpp" +#include "draw.hpp" + +#include <GL/glew.h> #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif + #include "vr.hpp" +#include "vr_cvars.hpp" #include "menu_util.hpp" #include <cassert> @@ -57,13 +70,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DEFAULT_REFRESHRATE 60 -typedef struct +struct vmode_t { int width; int height; int refreshrate; int bpp; -} vmode_t; +}; static const char* gl_vendor; static const char* gl_renderer; @@ -78,12 +91,8 @@ static int nummodes; static bool vid_initialized = false; -#if defined(USE_SDL2) static SDL_Window* draw_context; static SDL_GLContext gl_context; -#else -static SDL_Surface* draw_context; -#endif static bool vid_locked = false; // johnfitz static bool vid_changed = false; @@ -115,41 +124,6 @@ bool gl_glsl_gamma_able = false; // ericw bool gl_glsl_alias_able = false; // ericw int gl_stencilbits; -PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = nullptr; // johnfitz -PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc = nullptr; // johnfitz -PFNGLCLIENTACTIVETEXTUREARBPROC GL_ClientActiveTextureFunc = nullptr; // ericw -PFNGLBINDBUFFERARBPROC GL_BindBufferFunc = nullptr; // ericw -PFNGLBUFFERDATAARBPROC GL_BufferDataFunc = nullptr; // ericw -PFNGLBUFFERSUBDATAARBPROC GL_BufferSubDataFunc = nullptr; // ericw -PFNGLDELETEBUFFERSARBPROC GL_DeleteBuffersFunc = nullptr; // ericw -PFNGLGENBUFFERSARBPROC GL_GenBuffersFunc = nullptr; // ericw - -QS_PFNGLCREATESHADERPROC GL_CreateShaderFunc = nullptr; // ericw -QS_PFNGLDELETESHADERPROC GL_DeleteShaderFunc = nullptr; // ericw -QS_PFNGLDELETEPROGRAMPROC GL_DeleteProgramFunc = nullptr; // ericw -QS_PFNGLSHADERSOURCEPROC GL_ShaderSourceFunc = nullptr; // ericw -QS_PFNGLCOMPILESHADERPROC GL_CompileShaderFunc = nullptr; // ericw -QS_PFNGLGETSHADERIVPROC GL_GetShaderivFunc = nullptr; // ericw -QS_PFNGLGETSHADERINFOLOGPROC GL_GetShaderInfoLogFunc = nullptr; // ericw -QS_PFNGLGETPROGRAMIVPROC GL_GetProgramivFunc = nullptr; // ericw -QS_PFNGLGETPROGRAMINFOLOGPROC GL_GetProgramInfoLogFunc = nullptr; // ericw -QS_PFNGLCREATEPROGRAMPROC GL_CreateProgramFunc = nullptr; // ericw -QS_PFNGLATTACHSHADERPROC GL_AttachShaderFunc = nullptr; // ericw -QS_PFNGLLINKPROGRAMPROC GL_LinkProgramFunc = nullptr; // ericw -QS_PFNGLBINDATTRIBLOCATIONFUNC GL_BindAttribLocationFunc = nullptr; // ericw -QS_PFNGLUSEPROGRAMPROC GL_UseProgramFunc = nullptr; // ericw -QS_PFNGLGETATTRIBLOCATIONPROC GL_GetAttribLocationFunc = nullptr; // ericw -QS_PFNGLVERTEXATTRIBPOINTERPROC GL_VertexAttribPointerFunc = nullptr; // ericw -QS_PFNGLENABLEVERTEXATTRIBARRAYPROC GL_EnableVertexAttribArrayFunc = - nullptr; // ericw -QS_PFNGLDISABLEVERTEXATTRIBARRAYPROC GL_DisableVertexAttribArrayFunc = - nullptr; // ericw -QS_PFNGLGETUNIFORMLOCATIONPROC GL_GetUniformLocationFunc = nullptr; // ericw -QS_PFNGLUNIFORM1IPROC GL_Uniform1iFunc = nullptr; // ericw -QS_PFNGLUNIFORM1FPROC GL_Uniform1fFunc = nullptr; // ericw -QS_PFNGLUNIFORM3FPROC GL_Uniform3fFunc = nullptr; // ericw -QS_PFNGLUNIFORM4FPROC GL_Uniform4fFunc = nullptr; // ericw - //==================================== // johnfitz -- new cvars @@ -219,7 +193,6 @@ static void VID_Gamma_SetGamma() value = GAMMA_MAX; } -#if defined(USE_SDL2) #if USE_GAMMA_RAMPS if(SDL_SetWindowGammaRamp(draw_context, vid_gamma_red, vid_gamma_green, vid_gamma_blue) != 0) @@ -232,16 +205,6 @@ static void VID_Gamma_SetGamma() "VID_Gamma_SetGamma: failed on SDL_SetWindowBrightness\n"); } #endif -#else /* USE_SDL2 */ -#if USE_GAMMA_RAMPS - if(SDL_SetGammaRamp(vid_gamma_red, vid_gamma_green, vid_gamma_blue) == - -1) - Con_Printf("VID_Gamma_SetGamma: failed on SDL_SetGammaRamp\n"); -#else - if(SDL_SetGamma(value, value, value) == -1) - Con_Printf("VID_Gamma_SetGamma: failed on SDL_SetGamma\n"); -#endif -#endif /* USE_SDL2 */ } } @@ -259,7 +222,6 @@ static void VID_Gamma_Restore() if(draw_context && gammaworks) { -#if defined(USE_SDL2) #if USE_GAMMA_RAMPS if(SDL_SetWindowGammaRamp(draw_context, vid_sysgamma_red, vid_sysgamma_green, vid_sysgamma_blue) != 0) @@ -271,16 +233,6 @@ static void VID_Gamma_Restore() "VID_Gamma_Restore: failed on SDL_SetWindowBrightness\n"); } #endif -#else /* USE_SDL2 */ -#if USE_GAMMA_RAMPS - if(SDL_SetGammaRamp( - vid_sysgamma_red, vid_sysgamma_green, vid_sysgamma_blue) == -1) - Con_Printf("VID_Gamma_Restore: failed on SDL_SetGammaRamp\n"); -#else - if(SDL_SetGamma(1, 1, 1) == -1) - Con_Printf("VID_Gamma_Restore: failed on SDL_SetGamma\n"); -#endif -#endif /* USE_SDL2 */ } } @@ -343,7 +295,6 @@ static void VID_Gamma_Init() return; } -#if defined(USE_SDL2) #if USE_GAMMA_RAMPS gammaworks = (SDL_GetWindowGammaRamp(draw_context, vid_sysgamma_red, vid_sysgamma_green, vid_sysgamma_blue) == 0); @@ -353,17 +304,6 @@ static void VID_Gamma_Init() #else gammaworks = (SDL_SetWindowBrightness(draw_context, 1) == 0); #endif -#else /* USE_SDL2 */ -#if USE_GAMMA_RAMPS - gammaworks = (SDL_GetGammaRamp(vid_sysgamma_red, vid_sysgamma_green, - vid_sysgamma_blue) == 0); - if(gammaworks) - gammaworks = (SDL_SetGammaRamp(vid_sysgamma_red, vid_sysgamma_green, - vid_sysgamma_blue) == 0); -#else - gammaworks = (SDL_SetGamma(1, 1, 1) == 0); -#endif -#endif /* USE_SDL2 */ if(!gammaworks) { @@ -378,15 +318,10 @@ VID_GetCurrentWidth */ static int VID_GetCurrentWidth() { -#if defined(USE_SDL2) int w = 0; - int h = 0; SDL_GetWindowSize(draw_context, &w, &h); return w; -#else - return draw_context->w; -#endif } /* @@ -396,15 +331,10 @@ VID_GetCurrentHeight */ static int VID_GetCurrentHeight() { -#if defined(USE_SDL2) int w = 0; - int h = 0; SDL_GetWindowSize(draw_context, &w, &h); return h; -#else - return draw_context->h; -#endif } /* @@ -414,11 +344,8 @@ VID_GetCurrentRefreshRate */ static int VID_GetCurrentRefreshRate() { -#if defined(USE_SDL2) SDL_DisplayMode mode; - int current_display; - - current_display = SDL_GetWindowDisplayIndex(draw_context); + int current_display = SDL_GetWindowDisplayIndex(draw_context); if(0 != SDL_GetCurrentDisplayMode(current_display, &mode)) { @@ -426,10 +353,6 @@ static int VID_GetCurrentRefreshRate() } return mode.refresh_rate; -#else - // SDL1.2 doesn't support refresh rates - return DEFAULT_REFRESHRATE; -#endif } @@ -440,12 +363,8 @@ VID_GetCurrentBPP */ static int VID_GetCurrentBPP() { -#if defined(USE_SDL2) const Uint32 pixelFormat = SDL_GetWindowPixelFormat(draw_context); return SDL_BITSPERPIXEL(pixelFormat); -#else - return draw_context->format->BitsPerPixel; -#endif } /* @@ -457,11 +376,7 @@ returns true if we are in regular fullscreen or "desktop fullscren" */ static bool VID_GetFullscreen() { -#if defined(USE_SDL2) return (SDL_GetWindowFlags(draw_context) & SDL_WINDOW_FULLSCREEN) != 0; -#else - return (draw_context->flags & SDL_FULLSCREEN) != 0; -#endif } /* @@ -473,12 +388,8 @@ returns true if we are specifically in "desktop fullscreen" mode */ static bool VID_GetDesktopFullscreen() { -#if defined(USE_SDL2) return (SDL_GetWindowFlags(draw_context) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP; -#else - return false; -#endif } /* @@ -488,14 +399,7 @@ VID_GetVSync */ static bool VID_GetVSync() { -#if defined(USE_SDL2) return SDL_GL_GetSwapInterval() == 1; -#else - int swap_control; - if(SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &swap_control) == 0) - return swap_control > 0; - return false; -#endif } /* @@ -507,11 +411,7 @@ used by pl_win.c */ void* VID_GetWindow() { -#if defined(USE_SDL2) return draw_context; -#else - return nullptr; -#endif } /* @@ -521,12 +421,8 @@ VID_HasMouseOrInputFocus */ bool VID_HasMouseOrInputFocus() { -#if defined(USE_SDL2) return (SDL_GetWindowFlags(draw_context) & (SDL_WINDOW_MOUSE_FOCUS | SDL_WINDOW_INPUT_FOCUS)) != 0; -#else - return (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) != 0; -#endif } /* @@ -536,15 +432,9 @@ VID_IsMinimized */ bool VID_IsMinimized() { -#if defined(USE_SDL2) return !(SDL_GetWindowFlags(draw_context) & SDL_WINDOW_SHOWN); -#else - /* SDL_APPACTIVE in SDL 1.x means "not minimized" */ - return !(SDL_GetAppState() & SDL_APPACTIVE); -#endif } -#if defined(USE_SDL2) /* ================ VID_SDL2_GetDisplayMode @@ -562,9 +452,8 @@ static SDL_DisplayMode* VID_SDL2_GetDisplayMode( { static SDL_DisplayMode mode; const int sdlmodes = SDL_GetNumDisplayModes(0); - int i; - for(i = 0; i < sdlmodes; i++) + for(int i = 0; i < sdlmodes; i++) { if(SDL_GetDisplayMode(0, i, &mode) != 0) { @@ -578,9 +467,9 @@ static SDL_DisplayMode* VID_SDL2_GetDisplayMode( return &mode; } } + return nullptr; } -#endif /* USE_SDL2 */ /* ================ @@ -606,25 +495,16 @@ static bool VID_ValidMode( return false; } -#if defined(USE_SDL2) if(fullscreen && VID_SDL2_GetDisplayMode(width, height, refreshrate, bpp) == nullptr) { bpp = 0; } -#else - { - Uint32 flags = DEFAULT_SDL_FLAGS; - if(fullscreen) flags |= SDL_FULLSCREEN; - - bpp = SDL_VideoModeOK(width, height, bpp, flags); - } -#endif switch(bpp) { - case 16: - case 24: + case 16: [[fallthrough]]; + case 24: [[fallthrough]]; case 32: break; default: return false; } @@ -640,19 +520,16 @@ VID_SetMode static bool VID_SetMode( int width, int height, int refreshrate, int bpp, bool fullscreen) { - int temp; Uint32 flags; - char caption[50]; + char caption[64]; int depthbits; int stencilbits; int fsaa_obtained; -#if defined(USE_SDL2) int previous_display; -#endif // so Con_Printfs don't mess us up by forcing vid and snd updates - temp = scr_disabled_for_loading; + int temp = scr_disabled_for_loading; scr_disabled_for_loading = true; CDAudio_Pause(); @@ -678,7 +555,6 @@ static bool VID_SetMode( q_snprintf(caption, sizeof(caption), "QuakeSpasm " QUAKESPASM_VER_STRING); -#if defined(USE_SDL2) /* Create the window if needed, hidden */ if(!draw_context) { @@ -783,44 +659,6 @@ static bool VID_SetMode( gl_swap_control = false; } -#else /* !defined(USE_SDL2) */ - - flags = DEFAULT_SDL_FLAGS; - if(fullscreen) flags |= SDL_FULLSCREEN; - if(vid_borderless.value) flags |= SDL_NOFRAME; - - gl_swap_control = true; - if(SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == - -1) - gl_swap_control = false; - - bpp = SDL_VideoModeOK(width, height, bpp, flags); - - draw_context = SDL_SetVideoMode(width, height, bpp, flags); - if(!draw_context) - { - // scale back fsaa - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); - draw_context = SDL_SetVideoMode(width, height, bpp, flags); - } - if(!draw_context) - { - // scale back SDL_GL_DEPTH_SIZE - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - draw_context = SDL_SetVideoMode(width, height, bpp, flags); - } - if(!draw_context) - { - // scale back SDL_GL_STENCIL_SIZE - SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0); - draw_context = SDL_SetVideoMode(width, height, bpp, flags); - if(!draw_context) Sys_Error("Couldn't set video mode"); - } - - SDL_WM_SetCaption(caption, caption); -#endif /* !defined(USE_SDL2) */ - vid.width = VID_GetCurrentWidth(); vid.height = VID_GetCurrentHeight(); vid.conwidth = vid.width & 0xFFFFFFF8; @@ -887,15 +725,6 @@ VID_Restart -- johnfitz -- change video modes on the fly */ static void VID_Restart() { - int width; - - int height; - - int refreshrate; - - int bpp; - bool fullscreen; - if(vid_locked || !vid_changed) { return; @@ -906,11 +735,11 @@ static void VID_Restart() VID_VR_Disable(); } - width = (int)vid_width.value; - height = (int)vid_height.value; - refreshrate = (int)vid_refreshrate.value; - bpp = (int)vid_bpp.value; - fullscreen = vid_fullscreen.value ? true : false; + const int width = (int)vid_width.value; + const int height = (int)vid_height.value; + const int refreshrate = (int)vid_refreshrate.value; + const int bpp = (int)vid_bpp.value; + const bool fullscreen = vid_fullscreen.value ? true : false; // // validate new mode @@ -932,7 +761,6 @@ static void VID_Restart() TexMgr_DeleteTextureObjects(); GLSLGamma_DeleteTexture(); R_ScaleView_DeleteTexture(); - R_DeleteShaders(); GL_DeleteBModelVertexBuffer(); GLMesh_DeleteVertexBuffers(); @@ -960,13 +788,11 @@ static void VID_Restart() vid.conwidth = CLAMP(320, vid.conwidth, vid.width); vid.conwidth &= 0xFFFFFFF8; vid.conheight = vid.conwidth * vid.height / vid.width; - // + // keep cvars in line with actual mode - // VID_SyncCvars(); - // + // update mouse grab - // if(key_dest == key_console || key_dest == key_menu) { if(modestate == MS_WINDOWED) @@ -993,28 +819,17 @@ switching modes */ static void VID_Test() { - int old_width; - - int old_height; - - int old_refreshrate; - - int old_bpp; - - int old_fullscreen; - if(vid_locked || !vid_changed) { return; } - // + // now try the switch - // - old_width = VID_GetCurrentWidth(); - old_height = VID_GetCurrentHeight(); - old_refreshrate = VID_GetCurrentRefreshRate(); - old_bpp = VID_GetCurrentBPP(); - old_fullscreen = VID_GetFullscreen() ? true : false; + const int old_width = VID_GetCurrentWidth(); + const int old_height = VID_GetCurrentHeight(); + const int old_refreshrate = VID_GetCurrentRefreshRate(); + const int old_bpp = VID_GetCurrentBPP(); + const int old_fullscreen = VID_GetFullscreen() ? true : false; VID_Restart(); @@ -1072,15 +887,6 @@ GL_MakeNiceExtensionsList -- johnfitz */ static char* GL_MakeNiceExtensionsList(const char* in) { - char* copy; - - char* token; - - char* out; - int i; - - int count; - if(!in) { return Z_Strdup("(none)"); @@ -1088,6 +894,8 @@ static char* GL_MakeNiceExtensionsList(const char* in) // each space will be replaced by 4 chars, so count the spaces before we // malloc + int i; + int count; for(i = 0, count = 1; i < (int)strlen(in); i++) { if(in[i] == ' ') @@ -1097,12 +905,12 @@ static char* GL_MakeNiceExtensionsList(const char* in) } assert(count >= 0); - out = (char*)Z_Malloc( + char* out = (char*)Z_Malloc( strlen(in) + (size_t)count * 3 + 1); // usually about 1-2k out[0] = 0; - copy = (char*)Z_Strdup(in); - for(token = strtok(copy, " "); token; token = strtok(nullptr, " ")) + char* copy = (char*)Z_Strdup(in); + for(char* token = strtok(copy, " "); token; token = strtok(nullptr, " ")) { strcat(out, "\n "); strcat(out, token); @@ -1125,54 +933,9 @@ static void GL_Info_f() Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions_nice); } -/* -=============== -GL_CheckExtensions -=============== -*/ -static bool GL_ParseExtensionList(const char* list, const char* name) -{ - const char* start; - const char* where; - - const char* terminator; - - if(!list || !name || !*name) - { - return false; - } - if(strchr(name, ' ') != nullptr) - { - return false; // extension names must not have spaces - } - - start = list; - while(1) - { - where = strstr(start, name); - if(!where) - { - break; - } - terminator = where + strlen(name); - if(where == start || where[-1] == ' ') - { - if(*terminator == ' ' || *terminator == '\0') - { - return true; - } - } - start = terminator; - } - return false; -} - static void GL_CheckExtensions() { - int swap_control; - // ARB_vertex_buffer_object - // if(COM_CheckParm("-novbo")) { Con_Warning("Vertex buffer objects disabled at command line\n"); @@ -1184,58 +947,26 @@ static void GL_CheckExtensions() "OpenGL version < 1.5, skipping ARB_vertex_buffer_object " "check\n"); } + else if(GLEW_ARB_vertex_program) + { + gl_vbo_able = true; + } else { - GL_BindBufferFunc = - (PFNGLBINDBUFFERARBPROC)SDL_GL_GetProcAddress("glBindBufferARB"); - GL_BufferDataFunc = - (PFNGLBUFFERDATAARBPROC)SDL_GL_GetProcAddress("glBufferDataARB"); - GL_BufferSubDataFunc = (PFNGLBUFFERSUBDATAARBPROC)SDL_GL_GetProcAddress( - "glBufferSubDataARB"); - GL_DeleteBuffersFunc = (PFNGLDELETEBUFFERSARBPROC)SDL_GL_GetProcAddress( - "glDeleteBuffersARB"); - GL_GenBuffersFunc = - (PFNGLGENBUFFERSARBPROC)SDL_GL_GetProcAddress("glGenBuffersARB"); - if(GL_BindBufferFunc && GL_BufferDataFunc && GL_BufferSubDataFunc && - GL_DeleteBuffersFunc && GL_GenBuffersFunc) - { - Con_Printf("FOUND: ARB_vertex_buffer_object\n"); - gl_vbo_able = true; - } - else - { - Con_Warning("ARB_vertex_buffer_object not available\n"); - } + Con_Warning("ARB_vertex_buffer_object not available\n"); } // multitexture - // if(COM_CheckParm("-nomtex")) { Con_Warning("Mutitexture disabled at command line\n"); } - else if(GL_ParseExtensionList(gl_extensions, "GL_ARB_multitexture")) - { - GL_MTexCoord2fFunc = (PFNGLMULTITEXCOORD2FARBPROC)SDL_GL_GetProcAddress( - "glMultiTexCoord2fARB"); - GL_SelectTextureFunc = (PFNGLACTIVETEXTUREARBPROC)SDL_GL_GetProcAddress( - "glActiveTextureARB"); - GL_ClientActiveTextureFunc = - (PFNGLCLIENTACTIVETEXTUREARBPROC)SDL_GL_GetProcAddress( - "glClientActiveTextureARB"); - if(GL_MTexCoord2fFunc && GL_SelectTextureFunc && - GL_ClientActiveTextureFunc) - { - Con_Printf("FOUND: ARB_multitexture\n"); - gl_mtexable = true; + else if(GLEW_ARB_multitexture) + { + gl_mtexable = true; - glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_max_texture_units); - Con_Printf("GL_MAX_TEXTURE_UNITS: %d\n", (int)gl_max_texture_units); - } - else - { - Con_Warning("Couldn't link to multitexture functions\n"); - } + glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_max_texture_units); + Con_Printf("GL_MAX_TEXTURE_UNITS: %d\n", (int)gl_max_texture_units); } else { @@ -1243,17 +974,16 @@ static void GL_CheckExtensions() } // texture_env_combine - // if(COM_CheckParm("-nocombine")) { Con_Warning("texture_env_combine disabled at command line\n"); } - else if(GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_env_combine")) + else if(GLEW_ARB_texture_env_combine) { Con_Printf("FOUND: ARB_texture_env_combine\n"); gl_texture_env_combine = true; } - else if(GL_ParseExtensionList(gl_extensions, "GL_EXT_texture_env_combine")) + else if(GLEW_EXT_texture_env_combine) { Con_Printf("FOUND: EXT_texture_env_combine\n"); gl_texture_env_combine = true; @@ -1264,17 +994,16 @@ static void GL_CheckExtensions() } // texture_env_add - // if(COM_CheckParm("-noadd")) { Con_Warning("texture_env_add disabled at command line\n"); } - else if(GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_env_add")) + else if(GLEW_ARB_texture_env_add) { Con_Printf("FOUND: ARB_texture_env_add\n"); gl_texture_env_add = true; } - else if(GL_ParseExtensionList(gl_extensions, "GL_EXT_texture_env_add")) + else if(GLEW_EXT_texture_env_add) { Con_Printf("FOUND: EXT_texture_env_add\n"); gl_texture_env_add = true; @@ -1286,32 +1015,19 @@ static void GL_CheckExtensions() // swap control // + int swap_control; if(!gl_swap_control) { -#if defined(USE_SDL2) Con_Warning( "vertical sync not supported (SDL_GL_SetSwapInterval " "failed)\n"); -#else - Con_Warning( - "vertical sync not supported (SDL_GL_SetAttribute failed)\n"); -#endif } -#if defined(USE_SDL2) else if((swap_control = SDL_GL_GetSwapInterval()) == -1) -#else - else if(SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &swap_control) == -1) -#endif { gl_swap_control = false; -#if defined(USE_SDL2) Con_Warning( "vertical sync not supported (SDL_GL_GetSwapInterval " "failed)\n"); -#else - Con_Warning( - "vertical sync not supported (SDL_GL_GetAttribute failed)\n"); -#endif } else if((vid_vsync.value && swap_control != 1) || (!vid_vsync.value && swap_control != 0)) @@ -1323,17 +1039,11 @@ static void GL_CheckExtensions() } else { -#if defined(USE_SDL2) Con_Printf("FOUND: SDL_GL_SetSwapInterval\n"); -#else - Con_Printf("FOUND: SDL_GL_SWAP_CONTROL\n"); -#endif } // anisotropic filtering - // - if(GL_ParseExtensionList( - gl_extensions, "GL_EXT_texture_filter_anisotropic")) + if(GLEW_EXT_texture_filter_anisotropic) { float test1; @@ -1381,13 +1091,11 @@ static void GL_CheckExtensions() } // texture_non_power_of_two - // if(COM_CheckParm("-notexturenpot")) { Con_Warning("texture_non_power_of_two disabled at command line\n"); } - else if(GL_ParseExtensionList( - gl_extensions, "GL_ARB_texture_non_power_of_two")) + else if(GLEW_ARB_texture_non_power_of_two) { Con_Printf("FOUND: ARB_texture_non_power_of_two\n"); gl_texture_NPOT = true; @@ -1398,86 +1106,13 @@ static void GL_CheckExtensions() } // GLSL - // if(COM_CheckParm("-noglsl")) { Con_Warning("GLSL disabled at command line\n"); } else if(gl_version_major >= 2) { - GL_CreateShaderFunc = - (QS_PFNGLCREATESHADERPROC)SDL_GL_GetProcAddress("glCreateShader"); - GL_DeleteShaderFunc = - (QS_PFNGLDELETESHADERPROC)SDL_GL_GetProcAddress("glDeleteShader"); - GL_DeleteProgramFunc = - (QS_PFNGLDELETEPROGRAMPROC)SDL_GL_GetProcAddress("glDeleteProgram"); - GL_ShaderSourceFunc = - (QS_PFNGLSHADERSOURCEPROC)SDL_GL_GetProcAddress("glShaderSource"); - GL_CompileShaderFunc = - (QS_PFNGLCOMPILESHADERPROC)SDL_GL_GetProcAddress("glCompileShader"); - GL_GetShaderivFunc = - (QS_PFNGLGETSHADERIVPROC)SDL_GL_GetProcAddress("glGetShaderiv"); - GL_GetShaderInfoLogFunc = - (QS_PFNGLGETSHADERINFOLOGPROC)SDL_GL_GetProcAddress( - "glGetShaderInfoLog"); - GL_GetProgramivFunc = - (QS_PFNGLGETPROGRAMIVPROC)SDL_GL_GetProcAddress("glGetProgramiv"); - GL_GetProgramInfoLogFunc = - (QS_PFNGLGETPROGRAMINFOLOGPROC)SDL_GL_GetProcAddress( - "glGetProgramInfoLog"); - GL_CreateProgramFunc = - (QS_PFNGLCREATEPROGRAMPROC)SDL_GL_GetProcAddress("glCreateProgram"); - GL_AttachShaderFunc = - (QS_PFNGLATTACHSHADERPROC)SDL_GL_GetProcAddress("glAttachShader"); - GL_LinkProgramFunc = - (QS_PFNGLLINKPROGRAMPROC)SDL_GL_GetProcAddress("glLinkProgram"); - GL_BindAttribLocationFunc = - (QS_PFNGLBINDATTRIBLOCATIONFUNC)SDL_GL_GetProcAddress( - "glBindAttribLocation"); - GL_UseProgramFunc = - (QS_PFNGLUSEPROGRAMPROC)SDL_GL_GetProcAddress("glUseProgram"); - GL_GetAttribLocationFunc = - (QS_PFNGLGETATTRIBLOCATIONPROC)SDL_GL_GetProcAddress( - "glGetAttribLocation"); - GL_VertexAttribPointerFunc = - (QS_PFNGLVERTEXATTRIBPOINTERPROC)SDL_GL_GetProcAddress( - "glVertexAttribPointer"); - GL_EnableVertexAttribArrayFunc = - (QS_PFNGLENABLEVERTEXATTRIBARRAYPROC)SDL_GL_GetProcAddress( - "glEnableVertexAttribArray"); - GL_DisableVertexAttribArrayFunc = - (QS_PFNGLDISABLEVERTEXATTRIBARRAYPROC)SDL_GL_GetProcAddress( - "glDisableVertexAttribArray"); - GL_GetUniformLocationFunc = - (QS_PFNGLGETUNIFORMLOCATIONPROC)SDL_GL_GetProcAddress( - "glGetUniformLocation"); - GL_Uniform1iFunc = - (QS_PFNGLUNIFORM1IPROC)SDL_GL_GetProcAddress("glUniform1i"); - GL_Uniform1fFunc = - (QS_PFNGLUNIFORM1FPROC)SDL_GL_GetProcAddress("glUniform1f"); - GL_Uniform3fFunc = - (QS_PFNGLUNIFORM3FPROC)SDL_GL_GetProcAddress("glUniform3f"); - GL_Uniform4fFunc = - (QS_PFNGLUNIFORM4FPROC)SDL_GL_GetProcAddress("glUniform4f"); - - if(GL_CreateShaderFunc && GL_DeleteShaderFunc && GL_DeleteProgramFunc && - GL_ShaderSourceFunc && GL_CompileShaderFunc && GL_GetShaderivFunc && - GL_GetShaderInfoLogFunc && GL_GetProgramivFunc && - GL_GetProgramInfoLogFunc && GL_CreateProgramFunc && - GL_AttachShaderFunc && GL_LinkProgramFunc && - GL_BindAttribLocationFunc && GL_UseProgramFunc && - GL_GetAttribLocationFunc && GL_VertexAttribPointerFunc && - GL_EnableVertexAttribArrayFunc && GL_DisableVertexAttribArrayFunc && - GL_GetUniformLocationFunc && GL_Uniform1iFunc && GL_Uniform1fFunc && - GL_Uniform3fFunc && GL_Uniform4fFunc) - { - Con_Printf("FOUND: GLSL\n"); - gl_glsl_able = true; - } - else - { - Con_Warning("GLSL not available\n"); - } + gl_glsl_able = true; } else { @@ -1485,7 +1120,6 @@ static void GL_CheckExtensions() } // GLSL gamma - // if(COM_CheckParm("-noglslgamma")) { Con_Warning("GLSL gamma disabled at command line\n"); @@ -1500,7 +1134,6 @@ static void GL_CheckExtensions() } // GLSL alias model rendering - // if(COM_CheckParm("-noglslalias")) { Con_Warning("GLSL alias model rendering disabled at command line\n"); @@ -1548,6 +1181,26 @@ static void GL_SetupState() glDepthFunc(GL_LEQUAL); // johnfitz -- moved here becuase gl_ztrick is gone. } +void GLAPIENTRY MessageCallback(GLenum source, GLenum type, GLuint id, + GLenum severity, GLsizei length, const GLchar* message, + const void* userParam) +{ + (void)source; + (void)id; + (void)length; + (void)userParam; + + if(severity == GL_DEBUG_SEVERITY_LOW || + severity == GL_DEBUG_SEVERITY_NOTIFICATION) + { + return; + } + + fprintf(stderr, "GL: %s type = 0x%x, severity = 0x%x, message = %s\n", + (type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : ""), type, severity, + message); +} + /* =============== GL_Init @@ -1577,8 +1230,17 @@ static void GL_Init() } gl_extensions_nice = GL_MakeNiceExtensionsList(gl_extensions); + glewExperimental = GL_TRUE; + auto init_res = glewInit(); + if(init_res != GLEW_OK) + { + Con_Printf( + "Error initializing GLEW: %s\n", glewGetErrorString(glewInit())); + } + GL_CheckExtensions(); // johnfitz + #ifdef __APPLE__ // ericw -- enable multi-threaded OpenGL, gives a decent FPS boost. // https://developer.apple.com/library/mac/technotes/tn2085/ @@ -1597,9 +1259,18 @@ static void GL_Init() } // johnfitz - GLAlias_CreateShaders(); + // GLAlias_CreateShaders(); + void GLAliasBlended_CreateShaders(); + GLAliasBlended_CreateShaders(); GLWorld_CreateShaders(); GL_ClearBufferBindings(); + +#ifndef NDEBUG + // During init, enable debug output + glEnable(GL_DEBUG_OUTPUT); + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + glDebugMessageCallback(MessageCallback, 0); +#endif } /* @@ -1623,11 +1294,7 @@ void GL_EndRendering() { if(!scr_skipupdate) { -#if defined(USE_SDL2) SDL_GL_SwapWindow(draw_context); -#else - SDL_GL_SwapBuffers(); -#endif } } @@ -1640,9 +1307,7 @@ void VID_Shutdown() SDL_QuitSubSystem(SDL_INIT_VIDEO); draw_context = nullptr; -#if defined(USE_SDL2) gl_context = nullptr; -#endif PL_VID_Shutdown(); } } @@ -1697,18 +1362,12 @@ rates after each mode. */ static void VID_DescribeModes_f() { - int i; - int lastwidth; + int lastwidth = 0; + int lastheight = 0; + int lastbpp = 0; + int count = 0; - int lastheight; - - int lastbpp; - - int count; - - lastwidth = lastheight = lastbpp = count = 0; - - for(i = 0; i < nummodes; i++) + for(int i = 0; i < nummodes; i++) { if(lastwidth != modelist[i].width || lastheight != modelist[i].height || lastbpp != modelist[i].bpp) @@ -1756,12 +1415,10 @@ VID_InitModelist */ static void VID_InitModelist() { -#if defined(USE_SDL2) const int sdlmodes = SDL_GetNumDisplayModes(0); - int i; nummodes = 0; - for(i = 0; i < sdlmodes; i++) + for(int i = 0; i < sdlmodes; i++) { SDL_DisplayMode mode; @@ -1778,59 +1435,6 @@ static void VID_InitModelist() nummodes++; } } -#else /* !defined(USE_SDL2) */ - SDL_PixelFormat format; - SDL_Rect** modes; - Uint32 flags; - int i, j, k, originalnummodes, existingmode; - int bpps[] = {16, 24, 32}; // enumerate >8 bpp modes - - originalnummodes = nummodes = 0; - format.palette = nullptr; - - // enumerate fullscreen modes - flags = DEFAULT_SDL_FLAGS | SDL_FULLSCREEN; - for(i = 0; i < (int)(sizeof(bpps) / sizeof(bpps[0])); i++) - { - if(nummodes >= MAX_MODE_LIST) break; - - format.BitsPerPixel = bpps[i]; - modes = SDL_ListModes(&format, flags); - - if(modes == (SDL_Rect**)0 || modes == (SDL_Rect**)-1) continue; - - for(j = 0; modes[j]; j++) - { - if(modes[j]->w > MAXWIDTH || modes[j]->h > MAXHEIGHT || - nummodes >= MAX_MODE_LIST) - continue; - - modelist[nummodes].width = modes[j]->w; - modelist[nummodes].height = modes[j]->h; - modelist[nummodes].bpp = bpps[i]; - modelist[nummodes].refreshrate = DEFAULT_REFRESHRATE; - - for(k = originalnummodes, existingmode = 0; k < nummodes; k++) - { - if((modelist[nummodes].width == modelist[k].width) && - (modelist[nummodes].height == modelist[k].height) && - (modelist[nummodes].bpp == modelist[k].bpp)) - { - existingmode = 1; - break; - } - } - - if(!existingmode) - { - nummodes++; - } - } - } - - if(nummodes == originalnummodes) - Con_SafePrintf("No fullscreen DIB modes found\n"); -#endif /* !defined(USE_SDL2) */ } /* @@ -1843,21 +1447,11 @@ void VID_Init() static char vid_center[] = "SDL_VIDEO_CENTERED=center"; int p; - int width; - - int height; - - int refreshrate; - - int bpp; int display_width; - int display_height; - int display_refreshrate; - int display_bpp; - bool fullscreen; + const char* read_vars[] = {"vid_fullscreen", "vid_width", "vid_height", "vid_refreshrate", "vid_bpp", "vid_vsync", "vid_fsaa", "vid_desktopfullscreen", "vid_borderless"}; @@ -1895,7 +1489,6 @@ void VID_Init() Sys_Error("Couldn't init SDL video: %s", SDL_GetError()); } -#if defined(USE_SDL2) { SDL_DisplayMode mode; if(SDL_GetDesktopDisplayMode(0, &mode) != 0) @@ -1908,15 +1501,6 @@ void VID_Init() display_refreshrate = mode.refresh_rate; display_bpp = SDL_BITSPERPIXEL(mode.format); } -#else - { - const SDL_VideoInfo* info = SDL_GetVideoInfo(); - display_width = info->current_w; - display_height = info->current_h; - display_refreshrate = DEFAULT_REFRESHRATE; - display_bpp = info->vfmt->BitsPerPixel; - } -#endif Cvar_SetValueQuick(&vid_bpp, (float)display_bpp); @@ -1929,12 +1513,12 @@ void VID_Init() VID_InitModelist(); - width = (int)vid_width.value; - height = (int)vid_height.value; - refreshrate = (int)vid_refreshrate.value; - bpp = (int)vid_bpp.value; - fullscreen = (int)vid_fullscreen.value; - fsaa = (int)vid_fsaa.value; + int width = (int)vid_width.value; + int height = (int)vid_height.value; + int refreshrate = (int)vid_refreshrate.value; + int bpp = (int)vid_bpp.value; + int fullscreen = (int)vid_fullscreen.value; + int fsaa = (int)vid_fsaa.value; if(COM_CheckParm("-current")) { @@ -2057,9 +1641,7 @@ void VID_Toggle() // WinXP issue. This will keep all the mode changing code in one place. static bool vid_toggle_works = false; bool toggleWorked; -#if defined(USE_SDL2) Uint32 flags = 0; -#endif S_ClearBuffer(); @@ -2080,7 +1662,6 @@ void VID_Toggle() goto vrestart; } -#if defined(USE_SDL2) if(!VID_GetFullscreen()) { flags = vid_desktopfullscreen.value ? SDL_WINDOW_FULLSCREEN_DESKTOP @@ -2088,9 +1669,6 @@ void VID_Toggle() } toggleWorked = SDL_SetWindowFullscreen(draw_context, flags) == 0; -#else - toggleWorked = SDL_WM_ToggleFullScreen(draw_context) == 1; -#endif if(toggleWorked) { @@ -2190,19 +1768,12 @@ VID_Menu_Init */ static void VID_Menu_Init() { - int i; - - int j; - - int h; - - int w; - - for(i = 0; i < nummodes; i++) + for(int i = 0; i < nummodes; i++) { - w = modelist[i].width; - h = modelist[i].height; + const int w = modelist[i].width; + const int h = modelist[i].height; + int j; for(j = 0; j < vid_menu_nummodes; j++) { if(vid_menu_modes[j].width == w && vid_menu_modes[j].height == h) @@ -2229,15 +1800,9 @@ regenerates bpp list based on current vid_width and vid_height */ static void VID_Menu_RebuildBppList() { - int i; - - int j; - - int b; - vid_menu_numbpps = 0; - for(i = 0; i < nummodes; i++) + for(int i = 0; i < nummodes; i++) { if(vid_menu_numbpps >= MAX_BPPS_LIST) { @@ -2251,8 +1816,9 @@ static void VID_Menu_RebuildBppList() continue; } - b = modelist[i].bpp; + const int b = modelist[i].bpp; + int j; for(j = 0; j < vid_menu_numbpps; j++) { if(vid_menu_bpps[j] == b) @@ -2277,6 +1843,7 @@ static void VID_Menu_RebuildBppList() } // if vid_bpp is not in the new list, change vid_bpp + int i; for(i = 0; i < vid_menu_numbpps; i++) { if(vid_menu_bpps[i] == (int)(vid_bpp.value)) @@ -2300,15 +1867,9 @@ regenerates rate list based on current vid_width, vid_height and vid_bpp */ static void VID_Menu_RebuildRateList() { - int i; - - int j; - - int r; - vid_menu_numrates = 0; - for(i = 0; i < nummodes; i++) + for(int i = 0; i < nummodes; i++) { // rate list is limited to rates available with current // width/height/bpp @@ -2319,8 +1880,9 @@ static void VID_Menu_RebuildRateList() continue; } - r = modelist[i].refreshrate; + const int r = modelist[i].refreshrate; + int j; for(j = 0; j < vid_menu_numrates; j++) { if(vid_menu_rates[j] == r) @@ -2345,6 +1907,7 @@ static void VID_Menu_RebuildRateList() } // if vid_refreshrate is not in the new list, change vid_refreshrate + int i; for(i = 0; i < vid_menu_numrates; i++) { if(vid_menu_rates[i] == (int)(vid_refreshrate.value)) diff --git a/Quake/gl_warp.cpp b/Quake/gl_warp.cpp index 2bbb1cd2..9392446e 100644 --- a/Quake/gl_warp.cpp +++ b/Quake/gl_warp.cpp @@ -21,8 +21,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // gl_warp.c -- warping animation support -#include "quakedef.hpp" -#include "quakeglm.hpp" +#include <GL/glew.h> + +#include "quakeglm_qvec3.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "sbar.hpp" +#include "mathlib.hpp" +#include "cvar.hpp" +#include "client.hpp" +#include "glquake.hpp" +#include "sys.hpp" +#include "screen.hpp" +#include "gl_texmgr.hpp" +#include "draw.hpp" extern cvar_t r_drawflat; @@ -58,12 +69,12 @@ msurface_t* warpface; cvar_t gl_subdivide_size = {"gl_subdivide_size", "128", CVAR_ARCHIVE}; -void BoundPoly(int numverts, float* verts, glm::vec3& mins, glm::vec3& maxs) +void BoundPoly(int numverts, qfloat* verts, qvec3& mins, qvec3& maxs) { int i; int j; - float* v; + qfloat* v; mins[0] = mins[1] = mins[2] = FLT_MAX; maxs[0] = maxs[1] = maxs[2] = -FLT_MAX; @@ -84,30 +95,30 @@ void BoundPoly(int numverts, float* verts, glm::vec3& mins, glm::vec3& maxs) } } -void SubdividePolygon(int numverts, float* verts) +void SubdividePolygon(int numverts, qfloat* verts) { int i; int j; int k; - glm::vec3 mins; + qvec3 mins; - glm::vec3 maxs; - float m; - float* v; - glm::vec3 front[64]; + qvec3 maxs; + qfloat m; + qfloat* v; + qvec3 front[64]; - glm::vec3 back[64]; + qvec3 back[64]; int f; int b; - float dist[64]; - float frac; + qfloat dist[64]; + qfloat frac; glpoly_t* poly; - float s; + qfloat s; - float t; + qfloat t; if(numverts > 60) { @@ -172,8 +183,8 @@ void SubdividePolygon(int numverts, float* verts) } } - SubdividePolygon(f, glm::value_ptr(front[0])); - SubdividePolygon(b, glm::value_ptr(back[0])); + SubdividePolygon(f, toGlVec(front[0])); + SubdividePolygon(b, toGlVec(back[0])); return; } @@ -199,7 +210,7 @@ GL_SubdivideSurface */ void GL_SubdivideSurface(msurface_t* fa) { - glm::vec3 verts[64]; + qvec3 verts[64]; int i; warpface = fa; @@ -209,7 +220,7 @@ void GL_SubdivideSurface(msurface_t* fa) for(i = 0; i < fa->polys->numverts; i++) VectorCopy(fa->polys->verts[i], verts[i]); - SubdividePolygon(fa->polys->numverts, glm::value_ptr(verts[0])); + SubdividePolygon(fa->polys->numverts, toGlVec(verts[0])); } /* diff --git a/Quake/glquake.hpp b/Quake/glquake.hpp index 06d1f8ef..517b04dd 100644 --- a/Quake/glquake.hpp +++ b/Quake/glquake.hpp @@ -22,15 +22,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GLQUAKE_H -#define __GLQUAKE_H +#pragma once + +#include "quakeglm_qvec3.hpp" +#include "bspfile.hpp" +#include "gl_model.hpp" +#include "cvar.hpp" +#include "vid.hpp" +#include "refdef.hpp" #include <cstdint> -#include "quakeglm.hpp" void GL_BeginRendering(int* x, int* y, int* width, int* height); -void GL_EndRendering(void); -void GL_Set2D(void); +void GL_EndRendering(); +void GL_Set2D(); extern int glx, gly, glwidth, glheight; @@ -52,10 +57,12 @@ extern int glx, gly, glwidth, glheight; #define BACKFACE_EPSILON 0.01 -void R_TimeRefresh_f(void); -void R_ReadPointFile_f(void); +void R_TimeRefresh_f(); +void R_ReadPointFile_f(); texture_t* R_TextureAnimation(texture_t* base, int frame); +struct texture_t; + typedef struct surfcache_s { struct surfcache_s* next; @@ -66,7 +73,7 @@ typedef struct surfcache_s unsigned width; unsigned height; // DEBUG only needed for debug float mipscale; - struct texture_s* texture; // checked for animating textures + texture_t* texture; // checked for animating textures byte data[4]; // width*height elements } surfcache_t; @@ -89,7 +96,7 @@ typedef struct //==================================================== extern bool r_cache_thrash; // compatability -extern glm::vec3 modelorg, r_entorigin; +extern qvec3 modelorg, r_entorigin; extern entity_t* currententity; extern int r_visframecount; // ??? what difs? extern int r_framecount; @@ -98,10 +105,10 @@ extern mplane_t frustum[4]; // // view origin // -extern glm::vec3 vup; -extern glm::vec3 vpn; -extern glm::vec3 vright; -extern glm::vec3 r_origin; +extern qvec3 vup; +extern qvec3 vpn; +extern qvec3 vright; +extern qvec3 r_origin; // // screen size info @@ -112,6 +119,7 @@ extern int d_lightstylevalue[256]; // 8.8 fraction of base light value extern cvar_t r_norefresh; extern cvar_t r_drawentities; +extern cvar_t r_drawworldtext; extern cvar_t r_drawworld; extern cvar_t r_drawviewmodel; extern cvar_t r_speeds; @@ -147,29 +155,30 @@ extern int gl_stencilbits; // Multitexture extern bool mtexenabled; extern bool gl_mtexable; -extern PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc; -extern PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc; -extern PFNGLCLIENTACTIVETEXTUREARBPROC GL_ClientActiveTextureFunc; +// extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB; +// extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; +// extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB; extern GLint gl_max_texture_units; // ericw // johnfitz -- anisotropic filtering -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +// #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +// #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF extern float gl_max_anisotropy; extern bool gl_anisotropy_able; // ericw -- VBO -extern PFNGLBINDBUFFERARBPROC GL_BindBufferFunc; -extern PFNGLBUFFERDATAARBPROC GL_BufferDataFunc; -extern PFNGLBUFFERSUBDATAARBPROC GL_BufferSubDataFunc; -extern PFNGLDELETEBUFFERSARBPROC GL_DeleteBuffersFunc; -extern PFNGLGENBUFFERSARBPROC GL_GenBuffersFunc; +// extern PFNGLBINDBUFFERARBPROC glBindBufferARB; +// extern PFNGLBUFFERDATAARBPROC glBufferDataARB; +// extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB; +// extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB; +// extern PFNGLGENBUFFERSARBPROC glGenBuffersARB; extern bool gl_vbo_able; // ericw // ericw -- GLSL // SDL 1.2 has a bug where it doesn't provide these typedefs on OS X! +/* typedef GLuint(APIENTRYP QS_PFNGLCREATESHADERPROC)(GLenum type); typedef void(APIENTRYP QS_PFNGLDELETESHADERPROC)(GLuint shader); typedef void(APIENTRYP QS_PFNGLDELETEPROGRAMPROC)(GLuint program); @@ -184,7 +193,7 @@ typedef void(APIENTRYP QS_PFNGLGETPROGRAMIVPROC)( GLuint program, GLenum pname, GLint* params); typedef void(APIENTRYP QS_PFNGLGETPROGRAMINFOLOGPROC)( GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef GLuint(APIENTRYP QS_PFNGLCREATEPROGRAMPROC)(void); +typedef GLuint(APIENTRYP QS_PFNGLCREATEPROGRAMPROC)(); typedef void(APIENTRYP QS_PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); typedef void(APIENTRYP QS_PFNGLLINKPROGRAMPROC)(GLuint program); typedef void(APIENTRYP QS_PFNGLBINDATTRIBLOCATIONFUNC)( @@ -206,29 +215,31 @@ typedef void(APIENTRYP QS_PFNGLUNIFORM3FPROC)( typedef void(APIENTRYP QS_PFNGLUNIFORM4FPROC)( GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -extern QS_PFNGLCREATESHADERPROC GL_CreateShaderFunc; -extern QS_PFNGLDELETESHADERPROC GL_DeleteShaderFunc; -extern QS_PFNGLDELETEPROGRAMPROC GL_DeleteProgramFunc; -extern QS_PFNGLSHADERSOURCEPROC GL_ShaderSourceFunc; -extern QS_PFNGLCOMPILESHADERPROC GL_CompileShaderFunc; -extern QS_PFNGLGETSHADERIVPROC GL_GetShaderivFunc; -extern QS_PFNGLGETSHADERINFOLOGPROC GL_GetShaderInfoLogFunc; -extern QS_PFNGLGETPROGRAMIVPROC GL_GetProgramivFunc; -extern QS_PFNGLGETPROGRAMINFOLOGPROC GL_GetProgramInfoLogFunc; -extern QS_PFNGLCREATEPROGRAMPROC GL_CreateProgramFunc; -extern QS_PFNGLATTACHSHADERPROC GL_AttachShaderFunc; -extern QS_PFNGLLINKPROGRAMPROC GL_LinkProgramFunc; -extern QS_PFNGLBINDATTRIBLOCATIONFUNC GL_BindAttribLocationFunc; -extern QS_PFNGLUSEPROGRAMPROC GL_UseProgramFunc; -extern QS_PFNGLGETATTRIBLOCATIONPROC GL_GetAttribLocationFunc; -extern QS_PFNGLVERTEXATTRIBPOINTERPROC GL_VertexAttribPointerFunc; -extern QS_PFNGLENABLEVERTEXATTRIBARRAYPROC GL_EnableVertexAttribArrayFunc; -extern QS_PFNGLDISABLEVERTEXATTRIBARRAYPROC GL_DisableVertexAttribArrayFunc; -extern QS_PFNGLGETUNIFORMLOCATIONPROC GL_GetUniformLocationFunc; -extern QS_PFNGLUNIFORM1IPROC GL_Uniform1iFunc; -extern QS_PFNGLUNIFORM1FPROC GL_Uniform1fFunc; -extern QS_PFNGLUNIFORM3FPROC GL_Uniform3fFunc; -extern QS_PFNGLUNIFORM4FPROC GL_Uniform4fFunc; +extern QS_PFNGLCREATESHADERPROC glCreateShader; +extern QS_PFNGLDELETESHADERPROC glDeleteShader; +extern QS_PFNGLDELETEPROGRAMPROC glDeleteProgram; +extern QS_PFNGLSHADERSOURCEPROC glShaderSource; +extern QS_PFNGLCOMPILESHADERPROC glCompileShader; +extern QS_PFNGLGETSHADERIVPROC glGetShaderiv; +extern QS_PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog; +extern QS_PFNGLGETPROGRAMIVPROC glGetProgramiv; +extern QS_PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog; +extern QS_PFNGLCREATEPROGRAMPROC glCreateProgram; +extern QS_PFNGLATTACHSHADERPROC glAttachShader; +extern QS_PFNGLLINKPROGRAMPROC glLinkProgram; +extern QS_PFNGLBINDATTRIBLOCATIONFUNC glBindAttribLocation; +extern QS_PFNGLUSEPROGRAMPROC glUseProgram; +extern QS_PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation; +extern QS_PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer; +extern QS_PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray; +extern QS_PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray; +extern QS_PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation; +extern QS_PFNGLUNIFORM1IPROC glUniform1i; +extern QS_PFNGLUNIFORM1FPROC glUniform1f; +extern QS_PFNGLUNIFORM3FPROC glUniform3f; +extern QS_PFNGLUNIFORM4FPROC glUniform4f; +*/ + extern bool gl_glsl_able; extern bool gl_glsl_gamma_able; extern bool gl_glsl_alias_able; @@ -308,6 +319,7 @@ typedef struct glRect_s { unsigned short l, t, w, h; } glRect_t; + struct lightmap_s { gltexture_t* texture; @@ -337,42 +349,42 @@ extern float map_wateralpha, map_lavaalpha, map_telealpha, map_slimealpha; // ericw // johnfitz -- fog functions called from outside gl_fog.c -void Fog_ParseServerMessage(void); -float* Fog_GetColor(void); -float Fog_GetDensity(void); -void Fog_EnableGFog(void); -void Fog_DisableGFog(void); -void Fog_StartAdditive(void); -void Fog_StopAdditive(void); -void Fog_SetupFrame(void); -void Fog_NewMap(void); -void Fog_Init(void); -void Fog_SetupState(void); - -void R_NewGame(void); +void Fog_ParseServerMessage(); +float* Fog_GetColor(); +float Fog_GetDensity(); +void Fog_EnableGFog(); +void Fog_DisableGFog(); +void Fog_StartAdditive(); +void Fog_StopAdditive(); +void Fog_SetupFrame(); +void Fog_NewMap(); +void Fog_Init(); +void Fog_SetupState(); + +void R_NewGame(); struct dlight_t; -void R_AnimateLight(void); -void R_MarkSurfaces(void); -void R_CullSurfaces(void); -bool R_CullBox(const glm::vec3& emins, const glm::vec3& emaxs); +void R_AnimateLight(); +void R_MarkSurfaces(); +void R_CullSurfaces(); +bool R_CullBox(const qvec3& emins, const qvec3& emaxs); void R_StoreEfrags(efrag_t** ppefrag); bool R_CullModelForEntity(entity_t* e); -void R_RotateForEntity(const glm::vec3& origin, const glm::vec3& angles); +void R_RotateForEntity(const qvec3& origin, const qvec3& angles); void R_MarkLights(dlight_t* light, int num, mnode_t* node); -void R_InitParticles(void); -void R_DrawParticles(void); -void CL_RunParticles(void); -void R_ClearParticles(void); +void R_InitParticles(); +void R_DrawParticles(); +void CL_RunParticles(); +void R_ClearParticles(); void R_TranslatePlayerSkin(int playernum); void R_TranslateNewPlayerSkin(int playernum); // johnfitz -- this handles cases // when the actual texture changes -void R_UpdateWarpTextures(void); +void R_UpdateWarpTextures(); -void R_DrawWorld(void); +void R_DrawWorld(); void R_DrawAliasModel(entity_t* e); void R_DrawBrushModel(entity_t* e); void R_DrawSpriteModel(entity_t* e); @@ -380,60 +392,56 @@ void R_DrawSpriteModel(entity_t* e); void R_DrawTextureChains_Water( qmodel_t* model, entity_t* ent, texchain_t chain); -void R_RenderDlights(void); -void GL_BuildLightmaps(void); -void GL_DeleteBModelVertexBuffer(void); -void GL_BuildBModelVertexBuffer(void); -void GLMesh_LoadVertexBuffers(void); -void GLMesh_DeleteVertexBuffers(void); -void R_RebuildAllLightmaps(void); +void R_RenderDlights(); +void GL_BuildLightmaps(); +void GL_DeleteBModelVertexBuffer(); +void GL_BuildBModelVertexBuffer(); +void GLMesh_LoadVertexBuffers(); +void GLMesh_DeleteVertexBuffers(); +void R_RebuildAllLightmaps(); -int R_LightPoint(const glm::vec3& p); +int R_LightPoint(const qvec3& p); void GL_SubdivideSurface(msurface_t* fa); void R_BuildLightMap(msurface_t* surf, byte* dest, int stride); void R_RenderDynamicLightmaps(msurface_t* fa); -void R_UploadLightmaps(void); +void R_UploadLightmaps(); -void R_DrawWorld_ShowTris(void); +void R_DrawWorld_ShowTris(); void R_DrawBrushModel_ShowTris(entity_t* e); void R_DrawAliasModel_ShowTris(entity_t* e); -void R_DrawParticles_ShowTris(void); +void R_DrawParticles_ShowTris(); GLint GL_GetUniformLocation(GLuint* programPtr, const char* name); -GLuint GL_CreateProgram(const GLchar* vertSource, const GLchar* fragSource, - int numbindings, const glsl_attrib_binding_t* bindings); -void R_DeleteShaders(void); -void GLWorld_CreateShaders(void); -void GLAlias_CreateShaders(void); +void GLWorld_CreateShaders(); +void GLAlias_CreateShaders(); void GL_DrawAliasShadow(entity_t* e); void DrawGLTriangleFan(glpoly_t* p); void DrawGLPoly(glpoly_t* p); void DrawWaterPoly(glpoly_t* p); void GL_MakeAliasModelDisplayLists(qmodel_t* m, aliashdr_t* hdr); -void Sky_Init(void); -void Sky_DrawSky(void); -void Sky_NewMap(void); +void Sky_Init(); +void Sky_DrawSky(); +void Sky_NewMap(); void Sky_LoadTexture(texture_t* mt); void Sky_LoadSkyBox(const char* name); -void TexMgr_RecalcWarpImageSize(void); +void TexMgr_RecalcWarpImageSize(); void R_ClearTextureChains(qmodel_t* mod, texchain_t chain); void R_ChainSurface(msurface_t* surf, texchain_t chain); void R_DrawTextureChains(qmodel_t* model, entity_t* ent, texchain_t chain); -void R_DrawWorld_Water(void); +void R_DrawWorld_Water(); void GL_BindBuffer(GLenum target, GLuint buffer); void GL_ClearBufferBindings(); -void GLSLGamma_DeleteTexture(void); -void GLSLGamma_GammaCorrect(void); +void GLSLGamma_DeleteTexture(); +void GLSLGamma_GammaCorrect(); -void R_ScaleView_DeleteTexture(void); +void R_ScaleView_DeleteTexture(); float GL_WaterAlphaForSurface(msurface_t* fa); -#endif /* __GLQUAKE_H */ diff --git a/Quake/history.txt b/Quake/history.txt new file mode 100644 index 00000000..30c35929 --- /dev/null +++ b/Quake/history.txt @@ -0,0 +1,3 @@ +map q +map q3dm6qw +impulse 100 diff --git a/Quake/host.cpp b/Quake/host.cpp index d0e378ce..9d982476 100644 --- a/Quake/host.cpp +++ b/Quake/host.cpp @@ -23,10 +23,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // host.c -- coordinates spawning and killing of local servers +#include "host.hpp" #include "quakedef.hpp" #include "bgmusic.hpp" #include <setjmp.h> #include "vr.hpp" +#include "vr_cvars.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "cdaudio.hpp" +#include "quakeparms.hpp" +#include "sbar.hpp" +#include "wad.hpp" +#include "net.hpp" +#include "glquake.hpp" +#include "menu.hpp" +#include "keys.hpp" +#include "protocol.hpp" +#include "msg.hpp" +#include "client.hpp" +#include "console.hpp" +#include "saveutil.hpp" +#include "sys.hpp" +#include "server.hpp" +#include "screen.hpp" +#include "gl_texmgr.hpp" +#include "vid.hpp" +#include "draw.hpp" +#include "q_sound.hpp" +#include "input.hpp" +#include "view.hpp" /* @@ -303,11 +329,11 @@ void Host_FindMaxClients() } svs.maxclientslimit = svs.maxclients; - if(svs.maxclientslimit < 4) + if(svs.maxclientslimit < 16) { - svs.maxclientslimit = 4; + svs.maxclientslimit = 16; } - svs.clients = (struct client_s*)Hunk_AllocName( + svs.clients = (struct client_t*)Hunk_AllocName( svs.maxclientslimit * sizeof(client_t), "clients"); if(svs.maxclients > 1) @@ -662,8 +688,12 @@ void Host_ClearMemory() Hunk_FreeToLowMark(host_hunklevel); cls.signon = 0; free(sv.edicts); // ericw -- sv.edicts switched to use malloc() - memset(&sv, 0, sizeof(sv)); - memset(&cl, 0, sizeof(cl)); + + // memset(&sv, 0, sizeof(sv)); + // memset(&cl, 0, sizeof(cl)); + + sv = server_t{}; + cl = client_state_t{}; } @@ -814,11 +844,6 @@ void _Host_Frame(float time) static double time1 = 0; static double time2 = 0; static double time3 = 0; - int pass1; - - int pass2; - - int pass3; { host_abortserver_setjmp_done = true; @@ -887,6 +912,12 @@ void _Host_Frame(float time) if(cls.state == ca_connected) { CL_ReadFromServer(); + + // VR: Autosave. + if(!deathmatch.value) + { + quake::saveutil::doAutomaticAutosave(); + } } // update video @@ -920,10 +951,10 @@ void _Host_Frame(float time) if(host_speeds.value) { - pass1 = (time1 - time3) * 1000; + int pass1 = (time1 - time3) * 1000; time3 = Sys_DoubleTime(); - pass2 = (time2 - time1) * 1000; - pass3 = (time3 - time2) * 1000; + int pass2 = (time2 - time1) * 1000; + int pass3 = (time3 - time2) * 1000; Con_Printf("%3i tot %3i server %3i gfx %3i snd\n", pass1 + pass2 + pass3, pass1, pass2, pass3); } @@ -1056,7 +1087,7 @@ void Host_Init() CL_Init(); } - (void) Hunk_AllocName(0, "-HOST_HUNKLEVEL-"); + (void)Hunk_AllocName(0, "-HOST_HUNKLEVEL-"); host_hunklevel = Hunk_LowMark(); host_initialized = true; diff --git a/Quake/host.hpp b/Quake/host.hpp new file mode 100644 index 00000000..a79a2f6f --- /dev/null +++ b/Quake/host.hpp @@ -0,0 +1,54 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2007-2008 Kristian Duske +Copyright (C) 2010-2019 QuakeSpasm developers + +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. + +*/ + +#pragma once + +#include "q_stdinc.hpp" + +#include <ctime> + +struct cvar_t; + +void Host_ClearMemory(); +void Host_ServerFrame(); +void Host_InitCommands(); +void Host_Init(); +void Host_Shutdown(); +void Host_Callback_Notify(cvar_t* var); /* callback function for CVAR_NOTIFY */ +void Host_Warn(const char* error, ...) FUNC_PRINTF(1, 2); +bool Host_MakeSavegame(const char* filename, const std::time_t* timestamp, + const bool printMessage); + +[[noreturn]] void Host_Error(const char* error, ...) FUNC_PRINTF(1, 2); +[[noreturn]] void Host_EndGame(const char* message, ...) FUNC_PRINTF(1, 2); + +#ifdef __WATCOMC__ +#pragma aux Host_Error aborts; +#pragma aux Host_EndGame aborts; +#endif + +void Host_Frame(float time); +void Host_Quit_f(); +void Host_ClientCommands(const char* fmt, ...) FUNC_PRINTF(1, 2); +void Host_ShutdownServer(bool crash); +void Host_WriteConfiguration(); diff --git a/Quake/host_cmd.cpp b/Quake/host_cmd.cpp index 8a40ba5e..345be1ed 100644 --- a/Quake/host_cmd.cpp +++ b/Quake/host_cmd.cpp @@ -22,12 +22,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "host.hpp" #include "quakedef.hpp" +#include "net.hpp" +#include "zone.hpp" +#include "keys.hpp" +#include "protocol.hpp" +#include "input.hpp" +#include "sys.hpp" +#include "msg.hpp" +#include "vr.hpp" +#include "vr_cvars.hpp" +#include "util.hpp" +#include "worldtext.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" +#include "menu.hpp" +#include "screen.hpp" +#include "client.hpp" +#include "sys.hpp" +#include "saveutil.hpp" +#include "sizebuf.hpp" + +#include <ctime> + #ifndef _WIN32 #include <dirent.h> #endif -#include "vr.hpp" -#include "util.hpp" extern cvar_t pausable; @@ -864,11 +886,6 @@ command from the console. Active clients are kicked off. */ void Host_Map_f() { - int i; - char name[MAX_QPATH]; - - char* p; - if(Cmd_Argc() < 2) // no map name given { if(cls.state == ca_dedicated) @@ -890,6 +907,7 @@ void Host_Map_f() { Con_Printf("map <levelname>: start a new server\n"); } + return; } @@ -907,18 +925,23 @@ void Host_Map_f() { IN_Activate(); } + key_dest = key_game; // remove console or menu SCR_BeginLoadingPlaque(); svs.serverflags = 0; // haven't completed an episode yet + + char name[MAX_QPATH]; q_strlcpy(name, Cmd_Argv(1), sizeof(name)); + // remove (any) trailing ".bsp" from mapname -- S.A. - p = strstr(name, ".bsp"); + char* p = strstr(name, ".bsp"); if(p && p[4] == '\0') { *p = '\0'; } - SV_SpawnServer(name); + + SV_SpawnServer(name, SpawnServerSrc::FromMapCmd); if(!sv.active) { return; @@ -927,7 +950,7 @@ void Host_Map_f() if(cls.state != ca_dedicated) { memset(cls.spawnparms, 0, MAX_MAPSTRING); - for(i = 2; i < Cmd_Argc(); i++) + for(int i = 2; i < Cmd_Argc(); i++) { q_strlcat(cls.spawnparms, Cmd_Argv(i), MAX_MAPSTRING); q_strlcat(cls.spawnparms, " ", MAX_MAPSTRING); @@ -991,13 +1014,12 @@ Goes to a new map, taking all clients along */ void Host_Changelevel_f() { - char level[MAX_QPATH]; - if(Cmd_Argc() != 2) { Con_Printf("changelevel <levelname> : continue game on a new level\n"); return; } + if(!sv.active || cls.demoplayback) { Con_Printf("Only the server may changelevel\n"); @@ -1005,7 +1027,9 @@ void Host_Changelevel_f() } // johnfitz -- check for client having map before anything else + char level[MAX_QPATH]; q_snprintf(level, sizeof(level), "maps/%s.bsp", Cmd_Argv(1)); + if(!COM_FileExists(level, nullptr)) { Host_Error("cannot find map %s", level); @@ -1016,10 +1040,13 @@ void Host_Changelevel_f() { IN_Activate(); // -- S.A. } + key_dest = key_game; // remove console or menu SV_SaveSpawnparms(); + q_strlcpy(level, Cmd_Argv(1), sizeof(level)); - SV_SpawnServer(level); + SV_SpawnServer(level, SpawnServerSrc::FromChangelevelCmd); + // also issue an error if spawn failed -- O.S. if(!sv.active) { @@ -1047,9 +1074,12 @@ void Host_Restart_f() { return; } - q_strlcpy(mapname, sv.name, - sizeof(mapname)); // mapname gets cleared in spawnserver - SV_SpawnServer(mapname); + + // mapname gets cleared in spawnserver + q_strlcpy(mapname, sv.name, sizeof(mapname)); + + SV_SpawnServer(mapname, SpawnServerSrc::FromRestart); + if(!sv.active) { Host_Error("cannot restart map %s", mapname); @@ -1141,78 +1171,73 @@ void Host_SavegameComment(char* text) text[SAVEGAME_COMMENT_LENGTH] = '\0'; } - -/* -=============== -Host_Savegame_f -=============== -*/ -void Host_Savegame_f() +bool Host_MakeSavegame( + const char* filename, const std::time_t* timestamp, const bool printMessage) { - char name[MAX_OSPATH]; - FILE* f; - int i; - char comment[SAVEGAME_COMMENT_LENGTH + 1]; - - if(cmd_source != src_command) - { - return; - } - if(!sv.active) { Con_Printf("Not playing a local game.\n"); - return; + return false; } if(cl.intermission) { Con_Printf("Can't save in intermission.\n"); - return; + return false; } if(svs.maxclients != 1) { Con_Printf("Can't save multiplayer games.\n"); - return; + return false; } - if(Cmd_Argc() != 2) - { - Con_Printf("save <savename> : save a game\n"); - return; - } - - if(strstr(Cmd_Argv(1), "..")) + if(strstr(filename, "..")) { Con_Printf("Relative pathnames are not allowed.\n"); - return; + return false; } - for(i = 0; i < svs.maxclients; i++) + for(int i = 0; i < svs.maxclients; i++) { if(svs.clients[i].active && (svs.clients[i].edict->v.health <= 0)) { Con_Printf("Can't savegame with a dead player\n"); - return; + return false; } } - q_snprintf(name, sizeof(name), "%s/%s", com_gamedir, Cmd_Argv(1)); + char name[MAX_OSPATH]; + q_snprintf(name, sizeof(name), "%s/%s", com_gamedir, filename); COM_AddExtension(name, ".sav", sizeof(name)); - Con_Printf("Saving game to %s...\n", name); - f = fopen(name, "w"); + if(printMessage) + { + Con_Printf("Saving game to %s...\n", name); + } + + FILE* f = fopen(name, "w"); if(!f) { Con_Printf("ERROR: couldn't open.\n"); - return; + return false; + } + + if(timestamp != nullptr) + { + std::tm* ptm = gmtime(timestamp); + + char buf[256]; + std::strftime(buf, sizeof(buf), "%F %T", ptm); + + fprintf(f, "%s\n", buf); } fprintf(f, "%i\n", SAVEGAME_VERSION); + char comment[SAVEGAME_COMMENT_LENGTH + 1]; Host_SavegameComment(comment); fprintf(f, "%s\n", comment); - for(i = 0; i < NUM_SPAWN_PARMS; i++) + for(int i = 0; i < NUM_SPAWN_PARMS; i++) { fprintf(f, "%f\n", svs.clients->spawn_parms[i]); } @@ -1222,7 +1247,7 @@ void Host_Savegame_f() // write the light styles - for(i = 0; i < MAX_LIGHTSTYLES; i++) + for(int i = 0; i < MAX_LIGHTSTYLES; i++) { if(sv.lightstyles[i]) { @@ -1234,39 +1259,30 @@ void Host_Savegame_f() } } - ED_WriteGlobals(f); - for(i = 0; i < sv.num_edicts; i++) + for(int i = 0; i < sv.num_edicts; i++) { ED_Write(f, EDICT_NUM(i)); fflush(f); } fclose(f); - Con_Printf("done.\n"); + + if(printMessage) + { + Con_Printf("done.\n"); + } + + return true; } /* =============== -Host_Loadgame_f +Host_Savegame_f =============== */ -void Host_Loadgame_f() +void Host_Savegame_f() { - static char* start; - - char name[MAX_OSPATH]; - char mapname[MAX_QPATH]; - float time; - - float tfloat; - const char* data; - int i; - edict_t* ent; - int entnum; - int version; - float spawn_parms[NUM_SPAWN_PARMS]; - if(cmd_source != src_command) { return; @@ -1274,19 +1290,26 @@ void Host_Loadgame_f() if(Cmd_Argc() != 2) { - Con_Printf("load <savename> : load a game\n"); + Con_Printf("save <savename> : save a game\n"); return; } - if(strstr(Cmd_Argv(1), "..")) + Host_MakeSavegame(Cmd_Argv(1), nullptr, true); +} + + +bool Host_Loadgame(const char* filename, const bool hasTimestamp) +{ + if(strstr(filename, "..")) { Con_Printf("Relative pathnames are not allowed.\n"); - return; + return false; } cls.demonum = -1; // stop demo loop in case this fails - q_snprintf(name, sizeof(name), "%s/%s", com_gamedir, Cmd_Argv(1)); + char name[MAX_OSPATH]; + q_snprintf(name, sizeof(name), "%s/%s", com_gamedir, filename); COM_AddExtension(name, ".sav", sizeof(name)); // we can't call SCR_BeginLoadingPlaque, because too much stack space has @@ -1296,6 +1319,7 @@ void Host_Loadgame_f() Con_Printf("Loading game from %s...\n", name); // avoid leaking if the previous Host_Loadgame_f failed with a Host_Error + static char* start; if(start != nullptr) { free(start); @@ -1305,58 +1329,80 @@ void Host_Loadgame_f() if(start == nullptr) { Con_Printf("ERROR: couldn't open.\n"); - return; + return false; } + const char* data; data = start; + + if(hasTimestamp) + { + data = COM_ParseTimestampNewline(data); + if(data == nullptr) + { + return false; + } + } + + int version; data = COM_ParseIntNewline(data, &version); + if(version != SAVEGAME_VERSION) { free(start); start = nullptr; Con_Printf( "Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); - return; + return false; } + + float spawn_parms[NUM_SPAWN_PARMS]; data = COM_ParseStringNewline(data); - for(i = 0; i < NUM_SPAWN_PARMS; i++) + for(int i = 0; i < NUM_SPAWN_PARMS; i++) { data = COM_ParseFloatNewline(data, &spawn_parms[i]); } + // this silliness is so we can load 1.06 save files, which have float skill // values + float tfloat; data = COM_ParseFloatNewline(data, &tfloat); current_skill = (int)(tfloat + 0.1); Cvar_SetValue("skill", (float)current_skill); data = COM_ParseStringNewline(data); + + char mapname[MAX_QPATH]; q_strlcpy(mapname, com_token, sizeof(mapname)); + + float time; data = COM_ParseFloatNewline(data, &time); CL_Disconnect_f(); - SV_SpawnServer(mapname); + SV_SpawnServer(mapname, SpawnServerSrc::FromSaveFile); if(!sv.active) { free(start); start = nullptr; Con_Printf("Couldn't load map\n"); - return; + return false; } + sv.paused = true; // pause until all clients connect sv.loadgame = true; // load the light styles - for(i = 0; i < MAX_LIGHTSTYLES; i++) + for(int i = 0; i < MAX_LIGHTSTYLES; i++) { data = COM_ParseStringNewline(data); sv.lightstyles[i] = (const char*)Hunk_Strdup(com_token, "lightstyles"); } // load the edicts out of the savegame file - entnum = -1; // -1 is the globals + int entnum = -1; // -1 is the globals while(*data) { data = COM_Parse(data); @@ -1377,7 +1423,7 @@ void Host_Loadgame_f() else { // parse an edict - ent = EDICT_NUM(entnum); + edict_t* ent = EDICT_NUM(entnum); if(entnum < sv.num_edicts) { ent->free = false; @@ -1405,7 +1451,7 @@ void Host_Loadgame_f() free(start); start = nullptr; - for(i = 0; i < NUM_SPAWN_PARMS; i++) + for(int i = 0; i < NUM_SPAWN_PARMS; i++) { svs.clients->spawn_parms[i] = spawn_parms[i]; } @@ -1415,6 +1461,65 @@ void Host_Loadgame_f() CL_EstablishConnection("local"); Host_Reconnect_f(); } + + Con_DPrintf("Calling QC 'OnLoadGame'.\n"); + PR_ExecuteProgram(pr_global_struct->OnLoadGame); + return true; +} + +/* +=============== +Host_Loadgame_f +=============== +*/ +void Host_Loadgame_f() +{ + if(cmd_source != src_command) + { + return; + } + + if(Cmd_Argc() != 2) + { + Con_Printf("load <savename> : load a game\n"); + return; + } + + if(strstr(Cmd_Argv(1), "..")) + { + Con_Printf("Relative pathnames are not allowed.\n"); + return; + } + + if(!Host_Loadgame(Cmd_Argv(1), false /* hasTimestamp */)) + { + Con_Printf("Failed to load '%s'\n", Cmd_Argv(1)); + } +} + +void Host_LoadAutosave_f() +{ + if(cmd_source != src_command) + { + return; + } + + if(Cmd_Argc() != 2) + { + Con_Printf("load_autosave <savename> : load an autosave\n"); + return; + } + + if(strstr(Cmd_Argv(1), "..")) + { + Con_Printf("Relative pathnames are not allowed.\n"); + return; + } + + if(!Host_Loadgame(Cmd_Argv(1), true /* hasTimestamp */)) + { + Con_Printf("Failed to load '%s'\n", Cmd_Argv(1)); + } } //============================================================================ @@ -1873,6 +1978,12 @@ void Host_Spawn_f() } PR_ExecuteProgram(pr_global_struct->PutClientInServer); + + // VR: Force autosave on client spawn. + if(!pr_global_struct->deathmatch && !pr_global_struct->coop) + { + quake::saveutil::doChangelevelAutosave(); + } } @@ -1888,9 +1999,11 @@ void Host_Spawn_f() MSG_WriteByte(&host_client->message, svc_updatename); MSG_WriteByte(&host_client->message, i); MSG_WriteString(&host_client->message, client->name); + MSG_WriteByte(&host_client->message, svc_updatefrags); MSG_WriteByte(&host_client->message, i); MSG_WriteShort(&host_client->message, client->old_frags); + MSG_WriteByte(&host_client->message, svc_updatecolors); MSG_WriteByte(&host_client->message, i); MSG_WriteByte(&host_client->message, client->colors); @@ -1943,6 +2056,20 @@ void Host_Spawn_f() MSG_WriteByte(&host_client->message, svc_signonnum); MSG_WriteByte(&host_client->message, 3); host_client->sendsignon = true; + + { + WorldTextHandle wth = 0; + for(const WorldText& wt : sv.worldTexts) + { + sv.SendMsg_WorldTextHMake(*host_client, wth); + sv.SendMsg_WorldTextHSetText(*host_client, wth, wt._text.data()); + sv.SendMsg_WorldTextHSetPos(*host_client, wth, wt._pos); + sv.SendMsg_WorldTextHSetAngles(*host_client, wth, wt._angles); + sv.SendMsg_WorldTextHSetHAlign(*host_client, wth, wt._hAlign); + + ++wth; + } + } } /* @@ -2536,6 +2663,7 @@ void Host_Startdemos_f() if(!sv.active && cls.demonum != -1 && !cls.demoplayback) { cls.demonum = 0; + if(vr_enabled.value) { // Start a new game when vr_enabled @@ -2545,13 +2673,18 @@ void Host_Startdemos_f() Cbuf_AddText("map start\n"); Cbuf_AddText("centerview\n"); } + + /* else if(!fitzmode) - { /* QuakeSpasm customization: */ - /* go straight to menu, no CL_NextDemo */ + { + // QuakeSpasm customization: + // go straight to menu, no CL_NextDemo cls.demonum = -1; Cbuf_InsertText("menu_main\n"); return; } + */ + CL_NextDemo(); } else @@ -2645,6 +2778,7 @@ void Host_InitCommands() Cmd_AddCommand("kick", Host_Kick_f); Cmd_AddCommand("ping", Host_Ping_f); Cmd_AddCommand("load", Host_Loadgame_f); + Cmd_AddCommand("load_autosave", Host_LoadAutosave_f); Cmd_AddCommand("save", Host_Savegame_f); Cmd_AddCommand("give", Host_Give_f); diff --git a/Quake/image.cpp b/Quake/image.cpp index 96147cdb..5282d33f 100644 --- a/Quake/image.cpp +++ b/Quake/image.cpp @@ -22,7 +22,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // image.c -- image loading +#include "image.hpp" + #include "quakedef.hpp" +#include "console.hpp" +#include "byteorder.hpp" +#include "common.hpp" +#include "zone.hpp" +#include "sys.hpp" #define STB_IMAGE_WRITE_IMPLEMENTATION #define STB_IMAGE_WRITE_STATIC diff --git a/Quake/image.hpp b/Quake/image.hpp index 69d679aa..f1955bae 100644 --- a/Quake/image.hpp +++ b/Quake/image.hpp @@ -21,8 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef GL_IMAGE_H -#define GL_IMAGE_H +#pragma once + +#include "q_stdinc.hpp" +#include <cstdio> // image.h -- image reading / writing @@ -38,4 +40,3 @@ bool Image_WritePNG(const char* name, byte* data, int width, int height, bool Image_WriteJPG(const char* name, byte* data, int width, int height, int bpp, int quality, bool upsidedown); -#endif /* GL_IMAGE_H */ diff --git a/Quake/in_sdl.cpp b/Quake/in_sdl.cpp index c59721ff..b11d2f0b 100644 --- a/Quake/in_sdl.cpp +++ b/Quake/in_sdl.cpp @@ -23,15 +23,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "quakedef.hpp" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) +#include "client.hpp" +#include "common.hpp" +#include "console.hpp" +#include "quakeparms.hpp" +#include "keys.hpp" +#include "protocol.hpp" +#include "input.hpp" +#include "sys.hpp" +#include "q_sound.hpp" + #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif static bool textmode; @@ -60,18 +62,13 @@ cvar_t joy_exponent_move = {"joy_exponent_move", "3", CVAR_ARCHIVE}; cvar_t joy_swapmovelook = {"joy_swapmovelook", "0", CVAR_ARCHIVE}; cvar_t joy_enable = {"joy_enable", "1", CVAR_ARCHIVE}; -#if defined(USE_SDL2) static SDL_JoystickID joy_active_instaceid = -1; static SDL_GameController* joy_active_controller = nullptr; -#endif static bool no_mouse = false; static int buttonremap[] = {K_MOUSE1, K_MOUSE3, /* right button */ K_MOUSE2, /* middle button */ -#if !defined(USE_SDL2) /* mousewheel up/down not counted as buttons in SDL2 */ - K_MWHEELUP, K_MWHEELDOWN, -#endif K_MOUSE4, K_MOUSE5}; /* total accumulated mouse movement since last frame */ @@ -90,18 +87,15 @@ static int SDLCALL IN_FilterMouseEvents(const SDL_Event* event) return 1; } -#if defined(USE_SDL2) static int SDLCALL IN_SDL2_FilterMouseEvents(void* userdata, SDL_Event* event) { (void)userdata; return IN_FilterMouseEvents(event); } -#endif static void IN_BeginIgnoringMouseEvents() { -#if defined(USE_SDL2) SDL_EventFilter currentFilter = nullptr; void* currentUserdata = nullptr; SDL_GetEventFilter(¤tFilter, ¤tUserdata); @@ -110,24 +104,16 @@ static void IN_BeginIgnoringMouseEvents() { SDL_SetEventFilter(IN_SDL2_FilterMouseEvents, nullptr); } -#else - if(SDL_GetEventFilter() != IN_FilterMouseEvents) - SDL_SetEventFilter(IN_FilterMouseEvents); -#endif } static void IN_EndIgnoringMouseEvents() { -#if defined(USE_SDL2) SDL_EventFilter currentFilter; void* currentUserdata; if(SDL_GetEventFilter(¤tFilter, ¤tUserdata) == SDL_TRUE) { SDL_SetEventFilter(nullptr, nullptr); } -#else - if(SDL_GetEventFilter() != nullptr) SDL_SetEventFilter(nullptr); -#endif } #ifdef MACOS_X_ACCELERATION_HACK @@ -230,26 +216,10 @@ void IN_Activate() IN_DisableOSXMouseAccel(); #endif -#if defined(USE_SDL2) if(SDL_SetRelativeMouseMode(SDL_TRUE) != 0) { Con_Printf("WARNING: SDL_SetRelativeMouseMode(SDL_TRUE) failed.\n"); } -#else - if(SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_ON) - { - SDL_WM_GrabInput(SDL_GRAB_ON); - if(SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_ON) - Con_Printf("WARNING: SDL_WM_GrabInput(SDL_GRAB_ON) failed.\n"); - } - - if(SDL_ShowCursor(SDL_QUERY) != SDL_DISABLE) - { - SDL_ShowCursor(SDL_DISABLE); - if(SDL_ShowCursor(SDL_QUERY) != SDL_DISABLE) - Con_Printf("WARNING: SDL_ShowCursor(SDL_DISABLE) failed.\n"); - } -#endif IN_EndIgnoringMouseEvents(); @@ -270,23 +240,7 @@ void IN_Deactivate(bool free_cursor) if(free_cursor) { -#if defined(USE_SDL2) SDL_SetRelativeMouseMode(SDL_FALSE); -#else - if(SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_OFF) - { - SDL_WM_GrabInput(SDL_GRAB_OFF); - if(SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_OFF) - Con_Printf("WARNING: SDL_WM_GrabInput(SDL_GRAB_OFF) failed.\n"); - } - - if(SDL_ShowCursor(SDL_QUERY) != SDL_ENABLE) - { - SDL_ShowCursor(SDL_ENABLE); - if(SDL_ShowCursor(SDL_QUERY) != SDL_ENABLE) - Con_Printf("WARNING: SDL_ShowCursor(SDL_ENABLE) failed.\n"); - } -#endif } /* discard all mouse events when input is deactivated */ @@ -295,7 +249,6 @@ void IN_Deactivate(bool free_cursor) void IN_StartupJoystick() { -#if defined(USE_SDL2) int i; int nummappings; char controllerdb[MAX_OSPATH]; @@ -363,26 +316,17 @@ void IN_StartupJoystick() joyname != nullptr ? joyname : "NULL"); } } -#endif } void IN_ShutdownJoystick() { -#if defined(USE_SDL2) SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); -#endif } void IN_Init() { textmode = Key_TextEntry(); -#if !defined(USE_SDL2) - SDL_EnableUNICODE(textmode); - if(SDL_EnableKeyRepeat( - SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL) == -1) - Con_Printf("Warning: SDL_EnableKeyRepeat() failed.\n"); -#else if(textmode) { SDL_StartTextInput(); @@ -391,7 +335,7 @@ void IN_Init() { SDL_StopTextInput(); } -#endif + if(safemode || COM_CheckParm("-nomouse")) { no_mouse = true; @@ -433,7 +377,6 @@ void IN_MouseMotion(int dx, int dy) total_dy += dy; } -#if defined(USE_SDL2) typedef struct joyaxis_s { float x; @@ -620,7 +563,6 @@ static void IN_JoyKeyEvent(bool wasdown, bool isdown, int key, double* timer) } } } -#endif /* ================ @@ -632,7 +574,6 @@ analog sticks/triggers */ void IN_Commands() { -#if defined(USE_SDL2) joyaxisstate_t newaxisstate; int i; const float stickthreshold = 0.9; @@ -724,7 +665,6 @@ void IN_Commands() K_RTRIGGER, &joy_emulatedkeytimer[9]); joy_axisstate = newaxisstate; -#endif } /* @@ -734,7 +674,6 @@ IN_JoyMove */ void IN_JoyMove(usercmd_t* cmd) { -#if defined(USE_SDL2) float speed; joyaxis_t moveRaw; @@ -775,7 +714,7 @@ void IN_JoyMove(usercmd_t* cmd) moveEased = IN_ApplyMoveEasing(moveDeadzone, joy_exponent_move.value); lookEased = IN_ApplyEasing(lookDeadzone, joy_exponent.value); - if((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0)) + if((in_speed.state & 1) ^ (cl_alwaysrun.value == 0.0)) { speed = cl_movespeedkey.value; } @@ -806,7 +745,6 @@ void IN_JoyMove(usercmd_t* cmd) { cl.viewangles[PITCH] = cl_minpitch.value; } -#endif } void IN_MouseMove(usercmd_t* cmd) @@ -880,12 +818,7 @@ void IN_UpdateInputMode() if(textmode != want_textmode) { textmode = want_textmode; -#if !defined(USE_SDL2) - SDL_EnableUNICODE(textmode); - if(in_debugkeys.value) - Con_Printf( - "SDL_EnableUNICODE %d time: %g\n", textmode, Sys_DoubleTime()); -#else + if(textmode) { SDL_StartTextInput(); @@ -902,86 +835,9 @@ void IN_UpdateInputMode() Con_Printf("SDL_StopTextInput time: %g\n", Sys_DoubleTime()); } } -#endif } } -#if !defined(USE_SDL2) -static inline int IN_SDL_KeysymToQuakeKey(SDLKey sym) -{ - if(sym > SDLK_SPACE && sym < SDLK_DELETE) return sym; - - switch(sym) - { - case SDLK_TAB: return K_TAB; - case SDLK_RETURN: return K_ENTER; - case SDLK_ESCAPE: return K_ESCAPE; - case SDLK_SPACE: return K_SPACE; - - case SDLK_BACKSPACE: return K_BACKSPACE; - case SDLK_UP: return K_UPARROW; - case SDLK_DOWN: return K_DOWNARROW; - case SDLK_LEFT: return K_LEFTARROW; - case SDLK_RIGHT: return K_RIGHTARROW; - - case SDLK_LALT: return K_ALT; - case SDLK_RALT: return K_ALT; - case SDLK_LCTRL: return K_CTRL; - case SDLK_RCTRL: return K_CTRL; - case SDLK_LSHIFT: return K_SHIFT; - case SDLK_RSHIFT: return K_SHIFT; - - case SDLK_F1: return K_F1; - case SDLK_F2: return K_F2; - case SDLK_F3: return K_F3; - case SDLK_F4: return K_F4; - case SDLK_F5: return K_F5; - case SDLK_F6: return K_F6; - case SDLK_F7: return K_F7; - case SDLK_F8: return K_F8; - case SDLK_F9: return K_F9; - case SDLK_F10: return K_F10; - case SDLK_F11: return K_F11; - case SDLK_F12: return K_F12; - case SDLK_INSERT: return K_INS; - case SDLK_DELETE: return K_DEL; - case SDLK_PAGEDOWN: return K_PGDN; - case SDLK_PAGEUP: return K_PGUP; - case SDLK_HOME: return K_HOME; - case SDLK_END: return K_END; - - case SDLK_NUMLOCK: return K_KP_NUMLOCK; - case SDLK_KP_DIVIDE: return K_KP_SLASH; - case SDLK_KP_MULTIPLY: return K_KP_STAR; - case SDLK_KP_MINUS: return K_KP_MINUS; - case SDLK_KP7: return K_KP_HOME; - case SDLK_KP8: return K_KP_UPARROW; - case SDLK_KP9: return K_KP_PGUP; - case SDLK_KP_PLUS: return K_KP_PLUS; - case SDLK_KP4: return K_KP_LEFTARROW; - case SDLK_KP5: return K_KP_5; - case SDLK_KP6: return K_KP_RIGHTARROW; - case SDLK_KP1: return K_KP_END; - case SDLK_KP2: return K_KP_DOWNARROW; - case SDLK_KP3: return K_KP_PGDN; - case SDLK_KP_ENTER: return K_KP_ENTER; - case SDLK_KP0: return K_KP_INS; - case SDLK_KP_PERIOD: return K_KP_DEL; - - case SDLK_LMETA: return K_COMMAND; - case SDLK_RMETA: return K_COMMAND; - - case SDLK_BREAK: return K_PAUSE; - case SDLK_PAUSE: return K_PAUSE; - - case SDLK_WORLD_18: return '~'; // the '�' key - - default: return 0; - } -} -#endif - -#if defined(USE_SDL2) static inline int IN_SDL2_ScancodeToQuakeKey(SDL_Scancode scancode) { switch(scancode) @@ -1102,29 +958,20 @@ static inline int IN_SDL2_ScancodeToQuakeKey(SDL_Scancode scancode) default: return 0; } } -#endif -#if defined(USE_SDL2) static void IN_DebugTextEvent(SDL_Event* event) { Con_Printf( "SDL_TEXTINPUT '%s' time: %g\n", event->text.text, Sys_DoubleTime()); } -#endif static void IN_DebugKeyEvent(SDL_Event* event) { const char* eventtype = (event->key.state == SDL_PRESSED) ? "SDL_KEYDOWN" : "SDL_KEYUP"; -#if defined(USE_SDL2) Con_Printf("%s scancode: '%s' keycode: '%s' time: %g\n", eventtype, SDL_GetScancodeName(event->key.keysym.scancode), SDL_GetKeyName(event->key.keysym.sym), Sys_DoubleTime()); -#else - Con_Printf("%s sym: '%s' unicode: %04x time: %g\n", eventtype, - SDL_GetKeyName(event->key.keysym.sym), (int)event->key.keysym.unicode, - Sys_DoubleTime()); -#endif } void IN_SendKeyEvents() @@ -1137,7 +984,6 @@ void IN_SendKeyEvents() { switch(event.type) { -#if defined(USE_SDL2) case SDL_WINDOWEVENT: if(event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { @@ -1148,18 +994,6 @@ void IN_SendKeyEvents() S_BlockSound(); } break; -#else - case SDL_ACTIVEEVENT: - if(event.active.state & (SDL_APPINPUTFOCUS | SDL_APPACTIVE)) - { - if(event.active.gain) - S_UnblockSound(); - else - S_BlockSound(); - } - break; -#endif -#if defined(USE_SDL2) case SDL_TEXTINPUT: if(in_debugkeys.value) { @@ -1180,7 +1014,6 @@ void IN_SendKeyEvents() } } break; -#endif case SDL_KEYDOWN: case SDL_KEYUP: down = (event.key.state == SDL_PRESSED); @@ -1190,21 +1023,13 @@ void IN_SendKeyEvents() IN_DebugKeyEvent(&event); } -#if defined(USE_SDL2) // SDL2: we interpret the keyboard as the US layout, so // keybindings are based on key position, not the label // on the key cap. key = IN_SDL2_ScancodeToQuakeKey(event.key.keysym.scancode); -#else - key = IN_SDL_KeysymToQuakeKey(event.key.keysym.sym); -#endif Key_Event(key, down); -#if !defined(USE_SDL2) - if(down && (event.key.keysym.unicode & ~0x7F) == 0) - Char_Event(event.key.keysym.unicode); -#endif break; case SDL_MOUSEBUTTONDOWN: @@ -1221,7 +1046,6 @@ void IN_SendKeyEvents() event.button.state == SDL_PRESSED); break; -#if defined(USE_SDL2) case SDL_MOUSEWHEEL: if(event.wheel.y > 0) { @@ -1234,13 +1058,11 @@ void IN_SendKeyEvents() Key_Event(K_MWHEELDOWN, false); } break; -#endif case SDL_MOUSEMOTION: IN_MouseMotion(event.motion.xrel, event.motion.yrel); break; -#if defined(USE_SDL2) case SDL_CONTROLLERDEVICEADDED: if(joy_active_instaceid == -1) { @@ -1279,7 +1101,6 @@ void IN_SendKeyEvents() case SDL_CONTROLLERDEVICEREMAPPED: Con_DPrintf("Ignoring SDL_CONTROLLERDEVICEREMAPPED\n"); break; -#endif case SDL_QUIT: CL_Disconnect(); diff --git a/Quake/input.hpp b/Quake/input.hpp index 75ad9b97..6a71b301 100644 --- a/Quake/input.hpp +++ b/Quake/input.hpp @@ -20,31 +20,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_INPUT_H -#define _QUAKE_INPUT_H +#pragma once + +#include "protocol.hpp" // input.h -- external (non-keyboard) input devices -void IN_Init(void); +void IN_Init(); -void IN_Shutdown(void); +void IN_Shutdown(); -void IN_Commands(void); +void IN_Commands(); // oportunity for devices to stick commands on the script buffer // mouse moved by dx and dy pixels void IN_MouseMotion(int dx, int dy); -void IN_SendKeyEvents(void); +void IN_SendKeyEvents(); // used as a callback for Sys_SendKeyEvents() by some drivers -void IN_UpdateInputMode(void); +void IN_UpdateInputMode(); // do stuff if input mode (text/non-text) changes matter to the keyboard driver void IN_Move(usercmd_t* cmd); // add additional movement on top of the keyboard move cmd -void IN_ClearStates(void); +void IN_ClearStates(); // restores all button and position states to defaults // called when the app becomes active @@ -52,5 +53,3 @@ void IN_Activate(); // called when the app becomes inactive void IN_Deactivate(bool free_cursor); - -#endif /* _QUAKE_INPUT_H */ diff --git a/Quake/json.hpp b/Quake/json.hpp new file mode 100644 index 00000000..f04091d0 --- /dev/null +++ b/Quake/json.hpp @@ -0,0 +1,24294 @@ +/* + __ _____ _____ _____ + __| | __| | | | JSON for Modern C++ +| | |__ | | | | | | version 3.7.3 +|_____|_____|_____|_|___| https://github.com/nlohmann/json + +Licensed under the MIT License <http://opensource.org/licenses/MIT>. +SPDX-License-Identifier: MIT +Copyright (c) 2013-2019 Niels Lohmann <http://nlohmann.me>. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#define NLOHMANN_JSON_VERSION_MAJOR 3 +#define NLOHMANN_JSON_VERSION_MINOR 7 +#define NLOHMANN_JSON_VERSION_PATCH 3 + +#include <algorithm> // all_of, find, for_each +#include <cassert> // assert +#include <ciso646> // and, not, or +#include <cstddef> // nullptr_t, ptrdiff_t, size_t +#include <functional> // hash, less +#include <initializer_list> // initializer_list +#include <iosfwd> // istream, ostream +#include <iterator> // random_access_iterator_tag +#include <memory> // unique_ptr +#include <numeric> // accumulate +#include <string> // string, stoi, to_string +#include <utility> // declval, forward, move, pair, swap +#include <vector> // vector + +// #include <nlohmann/adl_serializer.hpp> + + +#include <utility> + +// #include <nlohmann/detail/conversions/from_json.hpp> + + +#include <algorithm> // transform +#include <array> // array +#include <ciso646> // and, not +#include <forward_list> // forward_list +#include <iterator> // inserter, front_inserter, end +#include <map> // map +#include <string> // string +#include <tuple> // tuple, make_tuple +#include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include <unordered_map> // unordered_map +#include <utility> // pair, declval +#include <valarray> // valarray + +// #include <nlohmann/detail/exceptions.hpp> + + +#include <exception> // exception +#include <stdexcept> // runtime_error +#include <string> // to_string + +// #include <nlohmann/detail/input/position_t.hpp> + + +#include <cstddef> // size_t + +namespace nlohmann +{ +namespace detail +{ +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/macro_scope.hpp> + + +#include <utility> // pair +// #include <nlohmann/thirdparty/hedley/hedley.hpp> +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson <evan@nemerson.com> + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>. + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 13) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 13 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP \ +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include <stdint.h> + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include <stdint.h> + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 +#endif + +// disable float-equal warnings on GCC/clang +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdocumentation" +#endif + +// allow to disable exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include <cstdlib> + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template<typename BasicJsonType> \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template<typename BasicJsonType> \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template<template<typename, typename, typename...> class ObjectType, \ + template<typename, typename...> class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template<typename> class AllocatorType, \ + template<typename, typename = void> class JSONSerializer, \ + class BinaryType> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json<ObjectType, ArrayType, StringType, BooleanType, \ + NumberIntegerType, NumberUnsignedType, NumberFloatType, \ + AllocatorType, JSONSerializer, BinaryType> + + +namespace nlohmann +{ +namespace detail +{ +//////////////// +// exceptions // +//////////////// + +/*! +@brief general exception of the @ref basic_json class + +This class is an extension of `std::exception` objects with a member @a id for +exception ids. It is used as the base class for all exceptions thrown by the +@ref basic_json class. This class can hence be used as "wildcard" to catch +exceptions. + +Subclasses: +- @ref parse_error for exceptions indicating a parse error +- @ref invalid_iterator for exceptions indicating errors with iterators +- @ref type_error for exceptions indicating executing a member function with + a wrong type +- @ref out_of_range for exceptions indicating access out of the defined range +- @ref other_error for exceptions indicating other library errors + +@internal +@note To have nothrow-copy-constructible exceptions, we internally use + `std::runtime_error` which can cope with arbitrary-length error messages. + Intermediate strings are built with static functions and then passed to + the actual constructor. +@endinternal + +@liveexample{The following code shows how arbitrary library exceptions can be +caught.,exception} + +@since version 3.0.0 +*/ +class exception : public std::exception +{ + public: + /// returns the explanatory string + JSON_HEDLEY_RETURNS_NON_NULL + const char* what() const noexcept override + { + return m.what(); + } + + /// the id of the exception + const int id; + + protected: + JSON_HEDLEY_NON_NULL(3) + exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} + + static std::string name(const std::string& ename, int id_) + { + return "[json.exception." + ename + "." + std::to_string(id_) + "] "; + } + + private: + /// an exception object as storage for error messages + std::runtime_error m; +}; + +/*! +@brief exception indicating a parse error + +This exception is thrown by the library when a parse error occurs. Parse errors +can occur during the deserialization of JSON text, CBOR, MessagePack, as well +as when using JSON Patch. + +Member @a byte holds the byte index of the last read character in the input +file. + +Exceptions have ids 1xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position. +json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. +json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. +json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects. +json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. +json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`. +json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character. +json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences. +json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number. +json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. +json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. +json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read. +json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet). + +@note For an input with n bytes, 1 is the index of the first character and n+1 + is the index of the terminating null byte or the end of file. This also + holds true when reading a byte vector (CBOR or MessagePack). + +@liveexample{The following code shows how a `parse_error` exception can be +caught.,parse_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class parse_error : public exception +{ + public: + /*! + @brief create a parse error exception + @param[in] id_ the id of the exception + @param[in] pos the position where the error occurred (or with + chars_read_total=0 if the position cannot be + determined) + @param[in] what_arg the explanatory string + @return parse_error object + */ + static parse_error create(int id_, const position_t& pos, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + position_string(pos) + ": " + what_arg; + return parse_error(id_, pos.chars_read_total, w.c_str()); + } + + static parse_error create(int id_, std::size_t byte_, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + + ": " + what_arg; + return parse_error(id_, byte_, w.c_str()); + } + + /*! + @brief byte index of the parse error + + The byte index of the last read character in the input file. + + @note For an input with n bytes, 1 is the index of the first character and + n+1 is the index of the terminating null byte or the end of file. + This also holds true when reading a byte vector (CBOR or MessagePack). + */ + const std::size_t byte; + + private: + parse_error(int id_, std::size_t byte_, const char* what_arg) + : exception(id_, what_arg), byte(byte_) {} + + static std::string position_string(const position_t& pos) + { + return " at line " + std::to_string(pos.lines_read + 1) + + ", column " + std::to_string(pos.chars_read_current_line); + } +}; + +/*! +@brief exception indicating errors with iterators + +This exception is thrown if iterators passed to a library function do not match +the expected semantics. + +Exceptions have ids 2xx. + +name / id | example message | description +----------------------------------- | --------------- | ------------------------- +json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion. +json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from. +json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid. +json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid. +json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range. +json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key. +json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to. +json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container. +json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered. +json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin(). + +@liveexample{The following code shows how an `invalid_iterator` exception can be +caught.,invalid_iterator} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class invalid_iterator : public exception +{ + public: + static invalid_iterator create(int id_, const std::string& what_arg) + { + std::string w = exception::name("invalid_iterator", id_) + what_arg; + return invalid_iterator(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + invalid_iterator(int id_, const char* what_arg) + : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating executing a member function with a wrong type + +This exception is thrown in case of a type error; that is, a library function is +executed on a JSON value whose type does not match the expected semantics. + +Exceptions have ids 3xx. + +name / id | example message | description +----------------------------- | --------------- | ------------------------- +json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead. +json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types. +json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t &. +json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types. +json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types. +json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types. +json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types. +json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types. +json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types. +json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types. +json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types. +json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types. +json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined. +json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers. +json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive. +json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. | +json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) | + +@liveexample{The following code shows how a `type_error` exception can be +caught.,type_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class type_error : public exception +{ + public: + static type_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("type_error", id_) + what_arg; + return type_error(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating access out of the defined range + +This exception is thrown in case a library function is called on an input +parameter that exceeds the expected range, for instance in case of array +indices or nonexisting object keys. + +Exceptions have ids 4xx. + +name / id | example message | description +------------------------------- | --------------- | ------------------------- +json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1. +json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it. +json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object. +json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved. +json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value. +json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF. +json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. | +json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. | +json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string | + +@liveexample{The following code shows how an `out_of_range` exception can be +caught.,out_of_range} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class out_of_range : public exception +{ + public: + static out_of_range create(int id_, const std::string& what_arg) + { + std::string w = exception::name("out_of_range", id_) + what_arg; + return out_of_range(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating other library errors + +This exception is thrown in case of errors that cannot be classified with the +other exception types. + +Exceptions have ids 5xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed. + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range + +@liveexample{The following code shows how an `other_error` exception can be +caught.,other_error} + +@since version 3.0.0 +*/ +class other_error : public exception +{ + public: + static other_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("other_error", id_) + what_arg; + return other_error(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/cpp_future.hpp> + + +#include <ciso646> // not +#include <cstddef> // size_t +#include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type + +namespace nlohmann +{ +namespace detail +{ +// alias templates to reduce boilerplate +template<bool B, typename T = void> +using enable_if_t = typename std::enable_if<B, T>::type; + +template<typename T> +using uncvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type; + +// implementation of C++14 index_sequence and affiliates +// source: https://stackoverflow.com/a/32223343 +template<std::size_t... Ints> +struct index_sequence +{ + using type = index_sequence; + using value_type = std::size_t; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +template<class Sequence1, class Sequence2> +struct merge_and_renumber; + +template<std::size_t... I1, std::size_t... I2> +struct merge_and_renumber<index_sequence<I1...>, index_sequence<I2...>> + : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; + +template<std::size_t N> +struct make_index_sequence + : merge_and_renumber < typename make_index_sequence < N / 2 >::type, + typename make_index_sequence < N - N / 2 >::type > {}; + +template<> struct make_index_sequence<0> : index_sequence<> {}; +template<> struct make_index_sequence<1> : index_sequence<0> {}; + +template<typename... Ts> +using index_sequence_for = make_index_sequence<sizeof...(Ts)>; + +// dispatch utility (taken from ranges-v3) +template<unsigned N> struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template<typename T> +struct static_const +{ + static constexpr T value{}; +}; + +template<typename T> +constexpr T static_const<T>::value; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/meta/type_traits.hpp> + + +#include <ciso646> // not +#include <limits> // numeric_limits +#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type +#include <utility> // declval + +// #include <nlohmann/detail/iterators/iterator_traits.hpp> + + +#include <iterator> // random_access_iterator_tag + +// #include <nlohmann/detail/meta/void_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +template <typename ...Ts> struct make_void +{ + using type = void; +}; +template <typename ...Ts> using void_t = typename make_void<Ts...>::type; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/meta/cpp_future.hpp> + + +namespace nlohmann +{ +namespace detail +{ +template <typename It, typename = void> +struct iterator_types {}; + +template <typename It> +struct iterator_types < + It, + void_t<typename It::difference_type, typename It::value_type, typename It::pointer, + typename It::reference, typename It::iterator_category >> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template <typename T, typename = void> +struct iterator_traits +{ +}; + +template <typename T> +struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> + : iterator_types<T> +{ +}; + +template <typename T> +struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/cpp_future.hpp> + +// #include <nlohmann/detail/meta/detected.hpp> + + +#include <type_traits> + +// #include <nlohmann/detail/meta/void_t.hpp> + + +// https://en.cppreference.com/w/cpp/experimental/is_detected +namespace nlohmann +{ +namespace detail +{ +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template <class Default, + class AlwaysVoid, + template <class...> class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template <class Default, template <class...> class Op, class... Args> +struct detector<Default, void_t<Op<Args...>>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op<Args...>; +}; + +template <template <class...> class Op, class... Args> +using is_detected = typename detector<nonesuch, void, Op, Args...>::value_t; + +template <template <class...> class Op, class... Args> +using detected_t = typename detector<nonesuch, void, Op, Args...>::type; + +template <class Default, template <class...> class Op, class... Args> +using detected_or = detector<Default, void, Op, Args...>; + +template <class Default, template <class...> class Op, class... Args> +using detected_or_t = typename detected_or<Default, Op, Args...>::type; + +template <class Expected, template <class...> class Op, class... Args> +using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>; + +template <class To, template <class...> class Op, class... Args> +using is_detected_convertible = + std::is_convertible<detected_t<Op, Args...>, To>; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/json_fwd.hpp> +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ +#define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + +#include <cstdint> // int64_t, uint64_t +#include <map> // map +#include <memory> // allocator +#include <string> // string +#include <vector> // vector + +/*! +@brief namespace for Niels Lohmann +@see https://github.com/nlohmann +@since version 1.0.0 +*/ +namespace nlohmann +{ +/*! +@brief default JSONSerializer template argument + +This serializer ignores the template arguments and uses ADL +([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) +for serialization. +*/ +template<typename T = void, typename SFINAE = void> +struct adl_serializer; + +template<template<typename U, typename V, typename... Args> class ObjectType = + std::map, + template<typename U, typename... Args> class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template<typename U> class AllocatorType = std::allocator, + template<typename T, typename SFINAE = void> class JSONSerializer = + adl_serializer, + class BinaryType = std::vector<std::uint8_t>> +class basic_json; + +/*! +@brief JSON Pointer + +A JSON pointer defines a string syntax for identifying a specific value +within a JSON document. It can be used with functions `at` and +`operator[]`. Furthermore, JSON pointers are the base for JSON patches. + +@sa [RFC 6901](https://tools.ietf.org/html/rfc6901) + +@since version 2.0.0 +*/ +template<typename BasicJsonType> +class json_pointer; + +/*! +@brief default JSON class + +This type is the default specialization of the @ref basic_json class which +uses the standard template types. + +@since version 1.0.0 +*/ +using json = basic_json<>; +} // namespace nlohmann + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +namespace nlohmann +{ +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval<T>()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template<typename> struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json<NLOHMANN_BASIC_JSON_TPL> : std::true_type {}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template <typename> +class json_ref; + +template<typename> +struct is_json_ref : std::false_type {}; + +template <typename T> +struct is_json_ref<json_ref<T>> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template <typename T> +using mapped_type_t = typename T::mapped_type; + +template <typename T> +using key_type_t = typename T::key_type; + +template <typename T> +using value_type_t = typename T::value_type; + +template <typename T> +using difference_type_t = typename T::difference_type; + +template <typename T> +using pointer_t = typename T::pointer; + +template <typename T> +using reference_t = typename T::reference; + +template <typename T> +using iterator_category_t = typename T::iterator_category; + +template <typename T> +using iterator_t = typename T::iterator; + +template <typename T, typename... Args> +using to_json_function = decltype(T::to_json(std::declval<Args>()...)); + +template <typename T, typename... Args> +using from_json_function = decltype(T::from_json(std::declval<Args>()...)); + +template <typename T, typename U> +using get_template_function = decltype(std::declval<T>().template get<U>()); + +// trait checking if JSONSerializer<T>::from_json(json const&, udt&) exists +template <typename BasicJsonType, typename T, typename = void> +struct has_from_json : std::false_type {}; + +template <typename BasicJsonType, typename T> +struct has_from_json<BasicJsonType, T, + enable_if_t<not is_basic_json<T>::value>> +{ + using serializer = typename BasicJsonType::template json_serializer<T, void>; + + static constexpr bool value = + is_detected_exact<void, from_json_function, serializer, + const BasicJsonType&, T&>::value; +}; + +// This trait checks if JSONSerializer<T>::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template <typename BasicJsonType, typename T, typename = void> +struct has_non_default_from_json : std::false_type {}; + +template<typename BasicJsonType, typename T> +struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> +{ + using serializer = typename BasicJsonType::template json_serializer<T, void>; + + static constexpr bool value = + is_detected_exact<T, from_json_function, serializer, + const BasicJsonType&>::value; +}; + +// This trait checks if BasicJsonType::json_serializer<T>::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template <typename BasicJsonType, typename T, typename = void> +struct has_to_json : std::false_type {}; + +template <typename BasicJsonType, typename T> +struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> +{ + using serializer = typename BasicJsonType::template json_serializer<T, void>; + + static constexpr bool value = + is_detected_exact<void, to_json_function, serializer, BasicJsonType&, + T>::value; +}; + + +/////////////////// +// is_ functions // +/////////////////// + +template <typename T, typename = void> +struct is_iterator_traits : std::false_type {}; + +template <typename T> +struct is_iterator_traits<iterator_traits<T>> +{ + private: + using traits = iterator_traits<T>; + + public: + static constexpr auto value = + is_detected<value_type_t, traits>::value && + is_detected<difference_type_t, traits>::value && + is_detected<pointer_t, traits>::value && + is_detected<iterator_category_t, traits>::value && + is_detected<reference_t, traits>::value; +}; + +// source: https://stackoverflow.com/a/37193089/4116453 + +template <typename T, typename = void> +struct is_complete_type : std::false_type {}; + +template <typename T> +struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_type {}; + +template <typename BasicJsonType, typename CompatibleObjectType, + typename = void> +struct is_compatible_object_type_impl : std::false_type {}; + +template <typename BasicJsonType, typename CompatibleObjectType> +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and + is_detected<key_type_t, CompatibleObjectType>::value >> +{ + + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + std::is_constructible<typename object_t::key_type, + typename CompatibleObjectType::key_type>::value and + std::is_constructible<typename object_t::mapped_type, + typename CompatibleObjectType::mapped_type>::value; +}; + +template <typename BasicJsonType, typename CompatibleObjectType> +struct is_compatible_object_type + : is_compatible_object_type_impl<BasicJsonType, CompatibleObjectType> {}; + +template <typename BasicJsonType, typename ConstructibleObjectType, + typename = void> +struct is_constructible_object_type_impl : std::false_type {}; + +template <typename BasicJsonType, typename ConstructibleObjectType> +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and + is_detected<key_type_t, ConstructibleObjectType>::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (std::is_default_constructible<ConstructibleObjectType>::value and + (std::is_move_assignable<ConstructibleObjectType>::value or + std::is_copy_assignable<ConstructibleObjectType>::value) and + (std::is_constructible<typename ConstructibleObjectType::key_type, + typename object_t::key_type>::value and + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) or + (has_from_json<BasicJsonType, + typename ConstructibleObjectType::mapped_type>::value or + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template <typename BasicJsonType, typename ConstructibleObjectType> +struct is_constructible_object_type + : is_constructible_object_type_impl<BasicJsonType, + ConstructibleObjectType> {}; + +template <typename BasicJsonType, typename CompatibleStringType, + typename = void> +struct is_compatible_string_type_impl : std::false_type {}; + +template <typename BasicJsonType, typename CompatibleStringType> +struct is_compatible_string_type_impl < + BasicJsonType, CompatibleStringType, + enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type, + value_type_t, CompatibleStringType>::value >> +{ + static constexpr auto value = + std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value; +}; + +template <typename BasicJsonType, typename ConstructibleStringType> +struct is_compatible_string_type + : is_compatible_string_type_impl<BasicJsonType, ConstructibleStringType> {}; + +template <typename BasicJsonType, typename ConstructibleStringType, + typename = void> +struct is_constructible_string_type_impl : std::false_type {}; + +template <typename BasicJsonType, typename ConstructibleStringType> +struct is_constructible_string_type_impl < + BasicJsonType, ConstructibleStringType, + enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type, + value_type_t, ConstructibleStringType>::value >> +{ + static constexpr auto value = + std::is_constructible<ConstructibleStringType, + typename BasicJsonType::string_t>::value; +}; + +template <typename BasicJsonType, typename ConstructibleStringType> +struct is_constructible_string_type + : is_constructible_string_type_impl<BasicJsonType, ConstructibleStringType> {}; + +template <typename BasicJsonType, typename CompatibleArrayType, typename = void> +struct is_compatible_array_type_impl : std::false_type {}; + +template <typename BasicJsonType, typename CompatibleArrayType> +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t<is_detected<value_type_t, CompatibleArrayType>::value and + is_detected<iterator_t, CompatibleArrayType>::value and +// This is needed because json_reverse_iterator has a ::iterator type... +// Therefore it is detected as a CompatibleArrayType. +// The real fix would be to have an Iterable concept. + not is_iterator_traits< + iterator_traits<CompatibleArrayType>>::value >> +{ + static constexpr bool value = + std::is_constructible<BasicJsonType, + typename CompatibleArrayType::value_type>::value; +}; + +template <typename BasicJsonType, typename CompatibleArrayType> +struct is_compatible_array_type + : is_compatible_array_type_impl<BasicJsonType, CompatibleArrayType> {}; + +template <typename BasicJsonType, typename ConstructibleArrayType, typename = void> +struct is_constructible_array_type_impl : std::false_type {}; + +template <typename BasicJsonType, typename ConstructibleArrayType> +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t<std::is_same<ConstructibleArrayType, + typename BasicJsonType::value_type>::value >> + : std::true_type {}; + +template <typename BasicJsonType, typename ConstructibleArrayType> +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t<not std::is_same<ConstructibleArrayType, + typename BasicJsonType::value_type>::value and + std::is_default_constructible<ConstructibleArrayType>::value and +(std::is_move_assignable<ConstructibleArrayType>::value or + std::is_copy_assignable<ConstructibleArrayType>::value) and +is_detected<value_type_t, ConstructibleArrayType>::value and +is_detected<iterator_t, ConstructibleArrayType>::value and +is_complete_type< +detected_t<value_type_t, ConstructibleArrayType>>::value >> +{ + static constexpr bool value = + // This is needed because json_reverse_iterator has a ::iterator type, + // furthermore, std::back_insert_iterator (and other iterators) have a + // base class `iterator`... Therefore it is detected as a + // ConstructibleArrayType. The real fix would be to have an Iterable + // concept. + not is_iterator_traits<iterator_traits<ConstructibleArrayType>>::value and + + (std::is_same<typename ConstructibleArrayType::value_type, + typename BasicJsonType::array_t::value_type>::value or + has_from_json<BasicJsonType, + typename ConstructibleArrayType::value_type>::value or + has_non_default_from_json < + BasicJsonType, typename ConstructibleArrayType::value_type >::value); +}; + +template <typename BasicJsonType, typename ConstructibleArrayType> +struct is_constructible_array_type + : is_constructible_array_type_impl<BasicJsonType, ConstructibleArrayType> {}; + +template <typename RealIntegerType, typename CompatibleNumberIntegerType, + typename = void> +struct is_compatible_integer_type_impl : std::false_type {}; + +template <typename RealIntegerType, typename CompatibleNumberIntegerType> +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t<std::is_integral<RealIntegerType>::value and + std::is_integral<CompatibleNumberIntegerType>::value and + not std::is_same<bool, CompatibleNumberIntegerType>::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits<RealIntegerType>; + using CompatibleLimits = std::numeric_limits<CompatibleNumberIntegerType>; + + static constexpr auto value = + std::is_constructible<RealIntegerType, + CompatibleNumberIntegerType>::value and + CompatibleLimits::is_integer and + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template <typename RealIntegerType, typename CompatibleNumberIntegerType> +struct is_compatible_integer_type + : is_compatible_integer_type_impl<RealIntegerType, + CompatibleNumberIntegerType> {}; + +template <typename BasicJsonType, typename CompatibleType, typename = void> +struct is_compatible_type_impl: std::false_type {}; + +template <typename BasicJsonType, typename CompatibleType> +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t<is_complete_type<CompatibleType>::value >> +{ + static constexpr bool value = + has_to_json<BasicJsonType, CompatibleType>::value; +}; + +template <typename BasicJsonType, typename CompatibleType> +struct is_compatible_type + : is_compatible_type_impl<BasicJsonType, CompatibleType> {}; + +// https://en.cppreference.com/w/cpp/types/conjunction +template<class...> struct conjunction : std::true_type { }; +template<class B1> struct conjunction<B1> : B1 { }; +template<class B1, class... Bn> +struct conjunction<B1, Bn...> +: std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {}; + +template <typename T1, typename T2> +struct is_constructible_tuple : std::false_type {}; + +template <typename T1, typename... Args> +struct is_constructible_tuple<T1, std::tuple<Args...>> : conjunction<std::is_constructible<T1, Args>...> {}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/value_t.hpp> + + +#include <array> // array +#include <ciso646> // and +#include <cstddef> // size_t +#include <cstdint> // uint8_t +#include <string> // string + +namespace nlohmann +{ +namespace detail +{ +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + static constexpr std::array<std::uint8_t, 9> order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast<std::size_t>(lhs); + const auto r_index = static_cast<std::size_t>(rhs); + return l_index < order.size() and r_index < order.size() and order[l_index] < order[r_index]; +} +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +template<typename BasicJsonType> +void from_json(const BasicJsonType& j, typename std::nullptr_t& n) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_null())) + { + JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); + } + n = nullptr; +} + +// overloads for basic_json template parameters +template<typename BasicJsonType, typename ArithmeticType, + enable_if_t<std::is_arithmetic<ArithmeticType>::value and + not std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value, + int> = 0> +void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) +{ + switch (static_cast<value_t>(j)) + { + case value_t::number_unsigned: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>()); + break; + } + case value_t::number_integer: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>()); + break; + } + case value_t::number_float: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>()); + break; + } + + default: + JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); + } +} + +template<typename BasicJsonType> +void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_boolean())) + { + JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); + } + b = *j.template get_ptr<const typename BasicJsonType::boolean_t*>(); +} + +template<typename BasicJsonType> +void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_string())) + { + JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); + } + s = *j.template get_ptr<const typename BasicJsonType::string_t*>(); +} + +template < + typename BasicJsonType, typename ConstructibleStringType, + enable_if_t < + is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value and + not std::is_same<typename BasicJsonType::string_t, + ConstructibleStringType>::value, + int > = 0 > +void from_json(const BasicJsonType& j, ConstructibleStringType& s) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_string())) + { + JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); + } + + s = *j.template get_ptr<const typename BasicJsonType::string_t*>(); +} + +template<typename BasicJsonType> +void from_json(const BasicJsonType& j, typename BasicJsonType::number_float_t& val) +{ + get_arithmetic_value(j, val); +} + +template<typename BasicJsonType> +void from_json(const BasicJsonType& j, typename BasicJsonType::number_unsigned_t& val) +{ + get_arithmetic_value(j, val); +} + +template<typename BasicJsonType> +void from_json(const BasicJsonType& j, typename BasicJsonType::number_integer_t& val) +{ + get_arithmetic_value(j, val); +} + +template<typename BasicJsonType, typename EnumType, + enable_if_t<std::is_enum<EnumType>::value, int> = 0> +void from_json(const BasicJsonType& j, EnumType& e) +{ + typename std::underlying_type<EnumType>::type val; + get_arithmetic_value(j, val); + e = static_cast<EnumType>(val); +} + +// forward_list doesn't have an insert method +template<typename BasicJsonType, typename T, typename Allocator, + enable_if_t<std::is_convertible<BasicJsonType, T>::value, int> = 0> +void from_json(const BasicJsonType& j, std::forward_list<T, Allocator>& l) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + l.clear(); + std::transform(j.rbegin(), j.rend(), + std::front_inserter(l), [](const BasicJsonType & i) + { + return i.template get<T>(); + }); +} + +// valarray doesn't have an insert method +template<typename BasicJsonType, typename T, + enable_if_t<std::is_convertible<BasicJsonType, T>::value, int> = 0> +void from_json(const BasicJsonType& j, std::valarray<T>& l) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + l.resize(j.size()); + std::copy(j.begin(), j.end(), std::begin(l)); +} + +template <typename BasicJsonType, typename T, std::size_t N> +auto from_json(const BasicJsonType& j, T (&arr)[N]) +-> decltype(j.template get<T>(), void()) +{ + for (std::size_t i = 0; i < N; ++i) + { + arr[i] = j.at(i).template get<T>(); + } +} + +template<typename BasicJsonType> +void from_json_array_impl(const BasicJsonType& j, typename BasicJsonType::array_t& arr, priority_tag<3> /*unused*/) +{ + arr = *j.template get_ptr<const typename BasicJsonType::array_t*>(); +} + +template <typename BasicJsonType, typename T, std::size_t N> +auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr, + priority_tag<2> /*unused*/) +-> decltype(j.template get<T>(), void()) +{ + for (std::size_t i = 0; i < N; ++i) + { + arr[i] = j.at(i).template get<T>(); + } +} + +template<typename BasicJsonType, typename ConstructibleArrayType> +auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/) +-> decltype( + arr.reserve(std::declval<typename ConstructibleArrayType::size_type>()), + j.template get<typename ConstructibleArrayType::value_type>(), + void()) +{ + using std::end; + + ConstructibleArrayType ret; + ret.reserve(j.size()); + std::transform(j.begin(), j.end(), + std::inserter(ret, end(ret)), [](const BasicJsonType & i) + { + // get<BasicJsonType>() returns *this, this won't call a from_json + // method when value_type is BasicJsonType + return i.template get<typename ConstructibleArrayType::value_type>(); + }); + arr = std::move(ret); +} + +template <typename BasicJsonType, typename ConstructibleArrayType> +void from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, + priority_tag<0> /*unused*/) +{ + using std::end; + + ConstructibleArrayType ret; + std::transform( + j.begin(), j.end(), std::inserter(ret, end(ret)), + [](const BasicJsonType & i) + { + // get<BasicJsonType>() returns *this, this won't call a from_json + // method when value_type is BasicJsonType + return i.template get<typename ConstructibleArrayType::value_type>(); + }); + arr = std::move(ret); +} + +template <typename BasicJsonType, typename ConstructibleArrayType, + enable_if_t < + is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value and + not is_constructible_object_type<BasicJsonType, ConstructibleArrayType>::value and + not is_constructible_string_type<BasicJsonType, ConstructibleArrayType>::value and + not is_basic_json<ConstructibleArrayType>::value, + int > = 0 > + +auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) +-> decltype(from_json_array_impl(j, arr, priority_tag<3> {}), +j.template get<typename ConstructibleArrayType::value_type>(), +void()) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + + std::string(j.type_name()))); + } + + from_json_array_impl(j, arr, priority_tag<3> {}); +} + +template<typename BasicJsonType, typename ConstructibleObjectType, + enable_if_t<is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value, int> = 0> +void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_object())) + { + JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); + } + + ConstructibleObjectType ret; + auto inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>(); + using value_type = typename ConstructibleObjectType::value_type; + std::transform( + inner_object->begin(), inner_object->end(), + std::inserter(ret, ret.begin()), + [](typename BasicJsonType::object_t::value_type const & p) + { + return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>()); + }); + obj = std::move(ret); +} + +// overload for arithmetic types, not chosen for basic_json template arguments +// (BooleanType, etc..); note: Is it really necessary to provide explicit +// overloads for boolean_t etc. in case of a custom BooleanType which is not +// an arithmetic type? +template<typename BasicJsonType, typename ArithmeticType, + enable_if_t < + std::is_arithmetic<ArithmeticType>::value and + not std::is_same<ArithmeticType, typename BasicJsonType::number_unsigned_t>::value and + not std::is_same<ArithmeticType, typename BasicJsonType::number_integer_t>::value and + not std::is_same<ArithmeticType, typename BasicJsonType::number_float_t>::value and + not std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value, + int> = 0> +void from_json(const BasicJsonType& j, ArithmeticType& val) +{ + switch (static_cast<value_t>(j)) + { + case value_t::number_unsigned: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>()); + break; + } + case value_t::number_integer: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>()); + break; + } + case value_t::number_float: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>()); + break; + } + case value_t::boolean: + { + val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>()); + break; + } + + default: + JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); + } +} + +template<typename BasicJsonType, typename A1, typename A2> +void from_json(const BasicJsonType& j, std::pair<A1, A2>& p) +{ + p = {j.at(0).template get<A1>(), j.at(1).template get<A2>()}; +} + +template<typename BasicJsonType, typename Tuple, std::size_t... Idx> +void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_sequence<Idx...> /*unused*/) +{ + t = std::make_tuple(j.at(Idx).template get<typename std::tuple_element<Idx, Tuple>::type>()...); +} + +template<typename BasicJsonType, typename... Args> +void from_json(const BasicJsonType& j, std::tuple<Args...>& t) +{ + from_json_tuple_impl(j, t, index_sequence_for<Args...> {}); +} + +template <typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator, + typename = enable_if_t<not std::is_constructible< + typename BasicJsonType::string_t, Key>::value>> +void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allocator>& m) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + m.clear(); + for (const auto& p : j) + { + if (JSON_HEDLEY_UNLIKELY(not p.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); + } + m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>()); + } +} + +template <typename BasicJsonType, typename Key, typename Value, typename Hash, typename KeyEqual, typename Allocator, + typename = enable_if_t<not std::is_constructible< + typename BasicJsonType::string_t, Key>::value>> +void from_json(const BasicJsonType& j, std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>& m) +{ + if (JSON_HEDLEY_UNLIKELY(not j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + m.clear(); + for (const auto& p : j) + { + if (JSON_HEDLEY_UNLIKELY(not p.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); + } + m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>()); + } +} + +struct from_json_fn +{ + template<typename BasicJsonType, typename T> + auto operator()(const BasicJsonType& j, T& val) const + noexcept(noexcept(from_json(j, val))) + -> decltype(from_json(j, val), void()) + { + return from_json(j, val); + } +}; +} // namespace detail + +/// namespace to hold default `from_json` function +/// to see why this is required: +/// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html +namespace +{ +constexpr const auto& from_json = detail::static_const<detail::from_json_fn>::value; +} // namespace +} // namespace nlohmann + +// #include <nlohmann/detail/conversions/to_json.hpp> + + +#include <algorithm> // copy +#include <ciso646> // or, and, not +#include <iterator> // begin, end +#include <string> // string +#include <tuple> // tuple, get +#include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type +#include <utility> // move, forward, declval, pair +#include <valarray> // valarray +#include <vector> // vector + +// #include <nlohmann/detail/iterators/iteration_proxy.hpp> + + +#include <cstddef> // size_t +#include <iterator> // input_iterator_tag +#include <string> // string, to_string +#include <tuple> // tuple_size, get, tuple_element + +// #include <nlohmann/detail/meta/type_traits.hpp> + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +template<typename string_type> +void int_to_string( string_type& target, std::size_t value ) +{ + target = std::to_string(value); +} +template <typename IteratorType> class iteration_proxy_value +{ + public: + using difference_type = std::ptrdiff_t; + using value_type = iteration_proxy_value; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::input_iterator_tag; + using string_type = typename std::remove_cv< typename std::remove_reference<decltype( std::declval<IteratorType>().key() ) >::type >::type; + + private: + /// the iterator + IteratorType anchor; + /// an index for arrays (used to create key names) + std::size_t array_index = 0; + /// last stringified array index + mutable std::size_t array_index_last = 0; + /// a string representation of the array index + mutable string_type array_index_str = "0"; + /// an empty string (to return a reference for primitive values) + const string_type empty_str = ""; + + public: + explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {} + + /// dereference operator (needed for range-based for) + iteration_proxy_value& operator*() + { + return *this; + } + + /// increment operator (needed for range-based for) + iteration_proxy_value& operator++() + { + ++anchor; + ++array_index; + + return *this; + } + + /// equality operator (needed for InputIterator) + bool operator==(const iteration_proxy_value& o) const + { + return anchor == o.anchor; + } + + /// inequality operator (needed for range-based for) + bool operator!=(const iteration_proxy_value& o) const + { + return anchor != o.anchor; + } + + /// return key of the iterator + const string_type& key() const + { + assert(anchor.m_object != nullptr); + + switch (anchor.m_object->type()) + { + // use integer array index as key + case value_t::array: + { + if (array_index != array_index_last) + { + int_to_string( array_index_str, array_index ); + array_index_last = array_index; + } + return array_index_str; + } + + // use key from the object + case value_t::object: + return anchor.key(); + + // use an empty key for all primitive types + default: + return empty_str; + } + } + + /// return value of the iterator + typename IteratorType::reference value() const + { + return anchor.value(); + } +}; + +/// proxy class for the items() function +template<typename IteratorType> class iteration_proxy +{ + private: + /// the container to iterate + typename IteratorType::reference container; + + public: + /// construct iteration proxy from a container + explicit iteration_proxy(typename IteratorType::reference cont) noexcept + : container(cont) {} + + /// return iterator begin (needed for range-based for) + iteration_proxy_value<IteratorType> begin() noexcept + { + return iteration_proxy_value<IteratorType>(container.begin()); + } + + /// return iterator end (needed for range-based for) + iteration_proxy_value<IteratorType> end() noexcept + { + return iteration_proxy_value<IteratorType>(container.end()); + } +}; +// Structured Bindings Support +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +template <std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0> +auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.key()) +{ + return i.key(); +} +// Structured Bindings Support +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +template <std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0> +auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.value()) +{ + return i.value(); +} +} // namespace detail +} // namespace nlohmann + +// The Addition to the STD Namespace is required to add +// Structured Bindings Support to the iteration_proxy_value class +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +namespace std +{ +#if defined(__clang__) + // Fix: https://github.com/nlohmann/json/issues/1401 + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmismatched-tags" +#endif +template <typename IteratorType> +class tuple_size<::nlohmann::detail::iteration_proxy_value<IteratorType>> + : public std::integral_constant<std::size_t, 2> {}; + +template <std::size_t N, typename IteratorType> +class tuple_element<N, ::nlohmann::detail::iteration_proxy_value<IteratorType >> +{ + public: + using type = decltype( + get<N>(std::declval < + ::nlohmann::detail::iteration_proxy_value<IteratorType >> ())); +}; +#if defined(__clang__) + #pragma clang diagnostic pop +#endif +} // namespace std + +// #include <nlohmann/detail/meta/cpp_future.hpp> + +// #include <nlohmann/detail/meta/type_traits.hpp> + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +////////////////// +// constructors // +////////////////// + +template<value_t> struct external_constructor; + +template<> +struct external_constructor<value_t::boolean> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept + { + j.m_type = value_t::boolean; + j.m_value = b; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::string> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, const typename BasicJsonType::string_t& s) + { + j.m_type = value_t::string; + j.m_value = s; + j.assert_invariant(); + } + + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::string_t&& s) + { + j.m_type = value_t::string; + j.m_value = std::move(s); + j.assert_invariant(); + } + + template<typename BasicJsonType, typename CompatibleStringType, + enable_if_t<not std::is_same<CompatibleStringType, typename BasicJsonType::string_t>::value, + int> = 0> + static void construct(BasicJsonType& j, const CompatibleStringType& str) + { + j.m_type = value_t::string; + j.m_value.string = j.template create<typename BasicJsonType::string_t>(str); + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::binary> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, const typename BasicJsonType::binary_t& b) + { + j.m_type = value_t::binary; + typename BasicJsonType::internal_binary_t value{b}; + j.m_value = value; + j.assert_invariant(); + } + + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::binary_t&& b) + { + j.m_type = value_t::binary; + typename BasicJsonType::internal_binary_t value{std::move(b)}; + j.m_value = value; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::number_float> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::number_float_t val) noexcept + { + j.m_type = value_t::number_float; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::number_unsigned> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::number_unsigned_t val) noexcept + { + j.m_type = value_t::number_unsigned; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::number_integer> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::number_integer_t val) noexcept + { + j.m_type = value_t::number_integer; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::array> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr) + { + j.m_type = value_t::array; + j.m_value = arr; + j.assert_invariant(); + } + + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::array_t&& arr) + { + j.m_type = value_t::array; + j.m_value = std::move(arr); + j.assert_invariant(); + } + + template<typename BasicJsonType, typename CompatibleArrayType, + enable_if_t<not std::is_same<CompatibleArrayType, typename BasicJsonType::array_t>::value, + int> = 0> + static void construct(BasicJsonType& j, const CompatibleArrayType& arr) + { + using std::begin; + using std::end; + j.m_type = value_t::array; + j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr)); + j.assert_invariant(); + } + + template<typename BasicJsonType> + static void construct(BasicJsonType& j, const std::vector<bool>& arr) + { + j.m_type = value_t::array; + j.m_value = value_t::array; + j.m_value.array->reserve(arr.size()); + for (const bool x : arr) + { + j.m_value.array->push_back(x); + } + j.assert_invariant(); + } + + template<typename BasicJsonType, typename T, + enable_if_t<std::is_convertible<T, BasicJsonType>::value, int> = 0> + static void construct(BasicJsonType& j, const std::valarray<T>& arr) + { + j.m_type = value_t::array; + j.m_value = value_t::array; + j.m_value.array->resize(arr.size()); + if (arr.size() > 0) + { + std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin()); + } + j.assert_invariant(); + } +}; + +template<> +struct external_constructor<value_t::object> +{ + template<typename BasicJsonType> + static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj) + { + j.m_type = value_t::object; + j.m_value = obj; + j.assert_invariant(); + } + + template<typename BasicJsonType> + static void construct(BasicJsonType& j, typename BasicJsonType::object_t&& obj) + { + j.m_type = value_t::object; + j.m_value = std::move(obj); + j.assert_invariant(); + } + + template<typename BasicJsonType, typename CompatibleObjectType, + enable_if_t<not std::is_same<CompatibleObjectType, typename BasicJsonType::object_t>::value, int> = 0> + static void construct(BasicJsonType& j, const CompatibleObjectType& obj) + { + using std::begin; + using std::end; + + j.m_type = value_t::object; + j.m_value.object = j.template create<typename BasicJsonType::object_t>(begin(obj), end(obj)); + j.assert_invariant(); + } +}; + +///////////// +// to_json // +///////////// + +template<typename BasicJsonType, typename T, + enable_if_t<std::is_same<T, typename BasicJsonType::boolean_t>::value, int> = 0> +void to_json(BasicJsonType& j, T b) noexcept +{ + external_constructor<value_t::boolean>::construct(j, b); +} + +template<typename BasicJsonType, typename CompatibleString, + enable_if_t<std::is_constructible<typename BasicJsonType::string_t, CompatibleString>::value, int> = 0> +void to_json(BasicJsonType& j, const CompatibleString& s) +{ + external_constructor<value_t::string>::construct(j, s); +} + +template<typename BasicJsonType> +void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s) +{ + external_constructor<value_t::string>::construct(j, std::move(s)); +} + +template<typename BasicJsonType, typename FloatType, + enable_if_t<std::is_floating_point<FloatType>::value, int> = 0> +void to_json(BasicJsonType& j, FloatType val) noexcept +{ + external_constructor<value_t::number_float>::construct(j, static_cast<typename BasicJsonType::number_float_t>(val)); +} + +template<typename BasicJsonType, typename CompatibleNumberUnsignedType, + enable_if_t<is_compatible_integer_type<typename BasicJsonType::number_unsigned_t, CompatibleNumberUnsignedType>::value, int> = 0> +void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept +{ + external_constructor<value_t::number_unsigned>::construct(j, static_cast<typename BasicJsonType::number_unsigned_t>(val)); +} + +template<typename BasicJsonType, typename CompatibleNumberIntegerType, + enable_if_t<is_compatible_integer_type<typename BasicJsonType::number_integer_t, CompatibleNumberIntegerType>::value, int> = 0> +void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept +{ + external_constructor<value_t::number_integer>::construct(j, static_cast<typename BasicJsonType::number_integer_t>(val)); +} + +template<typename BasicJsonType, typename EnumType, + enable_if_t<std::is_enum<EnumType>::value, int> = 0> +void to_json(BasicJsonType& j, EnumType e) noexcept +{ + using underlying_type = typename std::underlying_type<EnumType>::type; + external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e)); +} + +template<typename BasicJsonType> +void to_json(BasicJsonType& j, const std::vector<bool>& e) +{ + external_constructor<value_t::array>::construct(j, e); +} + +template <typename BasicJsonType, typename CompatibleArrayType, + enable_if_t<is_compatible_array_type<BasicJsonType, + CompatibleArrayType>::value and + not is_compatible_object_type< + BasicJsonType, CompatibleArrayType>::value and + not is_compatible_string_type<BasicJsonType, CompatibleArrayType>::value and + not is_basic_json<CompatibleArrayType>::value, + int> = 0> +void to_json(BasicJsonType& j, const CompatibleArrayType& arr) +{ + external_constructor<value_t::array>::construct(j, arr); +} + +template<typename BasicJsonType, typename T, + enable_if_t<std::is_convertible<T, BasicJsonType>::value, int> = 0> +void to_json(BasicJsonType& j, const std::valarray<T>& arr) +{ + external_constructor<value_t::array>::construct(j, std::move(arr)); +} + +template<typename BasicJsonType> +void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr) +{ + external_constructor<value_t::array>::construct(j, std::move(arr)); +} + +template<typename BasicJsonType, typename CompatibleObjectType, + enable_if_t<is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value and not is_basic_json<CompatibleObjectType>::value, int> = 0> +void to_json(BasicJsonType& j, const CompatibleObjectType& obj) +{ + external_constructor<value_t::object>::construct(j, obj); +} + +template<typename BasicJsonType> +void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj) +{ + external_constructor<value_t::object>::construct(j, std::move(obj)); +} + +template < + typename BasicJsonType, typename T, std::size_t N, + enable_if_t<not std::is_constructible<typename BasicJsonType::string_t, + const T(&)[N]>::value, + int> = 0 > +void to_json(BasicJsonType& j, const T(&arr)[N]) +{ + external_constructor<value_t::array>::construct(j, arr); +} + +template < typename BasicJsonType, typename T1, typename T2, enable_if_t < std::is_constructible<BasicJsonType, T1>::value&& std::is_constructible<BasicJsonType, T2>::value, int > = 0 > +void to_json(BasicJsonType& j, const std::pair<T1, T2>& p) +{ + j = { p.first, p.second }; +} + +// for https://github.com/nlohmann/json/pull/1134 +template < typename BasicJsonType, typename T, + enable_if_t<std::is_same<T, iteration_proxy_value<typename BasicJsonType::iterator>>::value, int> = 0> +void to_json(BasicJsonType& j, const T& b) +{ + j = { {b.key(), b.value()} }; +} + +template<typename BasicJsonType, typename Tuple, std::size_t... Idx> +void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<Idx...> /*unused*/) +{ + j = { std::get<Idx>(t)... }; +} + +template<typename BasicJsonType, typename T, enable_if_t<is_constructible_tuple<BasicJsonType, T>::value, int > = 0> +void to_json(BasicJsonType& j, const T& t) +{ + to_json_tuple_impl(j, t, make_index_sequence<std::tuple_size<T>::value> {}); +} + +struct to_json_fn +{ + template<typename BasicJsonType, typename T> + auto operator()(BasicJsonType& j, T&& val) const noexcept(noexcept(to_json(j, std::forward<T>(val)))) + -> decltype(to_json(j, std::forward<T>(val)), void()) + { + return to_json(j, std::forward<T>(val)); + } +}; +} // namespace detail + +/// namespace to hold default `to_json` function +namespace +{ +constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value; +} // namespace +} // namespace nlohmann + + +namespace nlohmann +{ + +template<typename, typename> +struct adl_serializer +{ + /*! + @brief convert a JSON value to any value type + + This function is usually called by the `get()` function of the + @ref basic_json class (either explicit or via conversion operators). + + @param[in] j JSON value to read from + @param[in,out] val value to write to + */ + template<typename BasicJsonType, typename ValueType> + static auto from_json(BasicJsonType&& j, ValueType& val) noexcept( + noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))) + -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()) + { + ::nlohmann::from_json(std::forward<BasicJsonType>(j), val); + } + + /*! + @brief convert any value type to a JSON value + + This function is usually called by the constructors of the @ref basic_json + class. + + @param[in,out] j JSON value to write to + @param[in] val value to read from + */ + template <typename BasicJsonType, typename ValueType> + static auto to_json(BasicJsonType& j, ValueType&& val) noexcept( + noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val)))) + -> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)), void()) + { + ::nlohmann::to_json(j, std::forward<ValueType>(val)); + } +}; + +} // namespace nlohmann + +// #include <nlohmann/detail/conversions/from_json.hpp> + +// #include <nlohmann/detail/conversions/to_json.hpp> + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/input/binary_reader.hpp> + + +#include <algorithm> // generate_n +#include <array> // array +#include <cassert> // assert +#include <cmath> // ldexp +#include <cstddef> // size_t +#include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t +#include <cstdio> // snprintf +#include <cstring> // memcpy +#include <iterator> // back_inserter +#include <limits> // numeric_limits +#include <string> // char_traits, string +#include <utility> // make_pair, move + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/input/input_adapters.hpp> + + +#include <array> // array +#include <cassert> // assert +#include <cstddef> // size_t +#include <cstdio> //FILE * +#include <cstring> // strlen +#include <istream> // istream +#include <iterator> // begin, end, iterator_traits, random_access_iterator_tag, distance, next +#include <memory> // shared_ptr, make_shared, addressof +#include <numeric> // accumulate +#include <string> // string, char_traits +#include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer +#include <utility> // pair, declval + +// #include <nlohmann/detail/iterators/iterator_traits.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + + +namespace nlohmann +{ +namespace detail +{ +/// the supported input formats +enum class input_format_t { json, cbor, msgpack, ubjson, bson }; + +//////////////////// +// input adapters // +//////////////////// + +/*! +@brief abstract input adapter interface + +Produces a stream of std::char_traits<char>::int_type characters from a +std::istream, a buffer, or some other input type. Accepts the return of +exactly one non-EOF character for future input. The int_type characters +returned consist of all valid char values as positive values (typically +unsigned char), plus an EOF value outside that range, specified by the value +of the function std::char_traits<char>::eof(). This value is typically -1, but +could be any arbitrary value which is not a valid char value. +*/ +struct input_adapter_protocol +{ + /// get a character [0,255] or std::char_traits<char>::eof(). + virtual std::char_traits<char>::int_type get_character() = 0; + virtual ~input_adapter_protocol() = default; +}; + +/// a type to simplify interfaces +using input_adapter_t = std::shared_ptr<input_adapter_protocol>; + +/*! +Input adapter for stdio file access. This adapter read only 1 byte and do not use any + buffer. This adapter is a very low level adapter. +*/ +class file_input_adapter : public input_adapter_protocol +{ + public: + JSON_HEDLEY_NON_NULL(2) + explicit file_input_adapter(std::FILE* f) noexcept + : m_file(f) + {} + + // make class move-only + file_input_adapter(const file_input_adapter&) = delete; + file_input_adapter(file_input_adapter&&) = default; + file_input_adapter& operator=(const file_input_adapter&) = delete; + file_input_adapter& operator=(file_input_adapter&&) = default; + ~file_input_adapter() override = default; + + std::char_traits<char>::int_type get_character() noexcept override + { + return std::fgetc(m_file); + } + + private: + /// the file pointer to read from + std::FILE* m_file; +}; + + +/*! +Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at +beginning of input. Does not support changing the underlying std::streambuf +in mid-input. Maintains underlying std::istream and std::streambuf to support +subsequent use of standard std::istream operations to process any input +characters following those used in parsing the JSON input. Clears the +std::istream flags; any input errors (e.g., EOF) will be detected by the first +subsequent call for input from the std::istream. +*/ +class input_stream_adapter : public input_adapter_protocol +{ + public: + ~input_stream_adapter() override + { + // clear stream flags; we use underlying streambuf I/O, do not + // maintain ifstream flags, except eof + is.clear(is.rdstate() & std::ios::eofbit); + } + + explicit input_stream_adapter(std::istream& i) + : is(i), sb(*i.rdbuf()) + {} + + // delete because of pointer members + input_stream_adapter(const input_stream_adapter&) = delete; + input_stream_adapter& operator=(input_stream_adapter&) = delete; + input_stream_adapter(input_stream_adapter&&) = delete; + input_stream_adapter& operator=(input_stream_adapter&&) = delete; + + // std::istream/std::streambuf use std::char_traits<char>::to_int_type, to + // ensure that std::char_traits<char>::eof() and the character 0xFF do not + // end up as the same value, eg. 0xFFFFFFFF. + std::char_traits<char>::int_type get_character() override + { + auto res = sb.sbumpc(); + // set eof manually, as we don't use the istream interface. + if (res == EOF) + { + is.clear(is.rdstate() | std::ios::eofbit); + } + return res; + } + + private: + /// the associated input stream + std::istream& is; + std::streambuf& sb; +}; + +/// input adapter for buffer input +class input_buffer_adapter : public input_adapter_protocol +{ + public: + input_buffer_adapter(const char* b, const std::size_t l) noexcept + : cursor(b), limit(b == nullptr ? nullptr : (b + l)) + {} + + // delete because of pointer members + input_buffer_adapter(const input_buffer_adapter&) = delete; + input_buffer_adapter& operator=(input_buffer_adapter&) = delete; + input_buffer_adapter(input_buffer_adapter&&) = delete; + input_buffer_adapter& operator=(input_buffer_adapter&&) = delete; + ~input_buffer_adapter() override = default; + + std::char_traits<char>::int_type get_character() noexcept override + { + if (JSON_HEDLEY_LIKELY(cursor < limit)) + { + assert(cursor != nullptr and limit != nullptr); + return std::char_traits<char>::to_int_type(*(cursor++)); + } + + return std::char_traits<char>::eof(); + } + + private: + /// pointer to the current character + const char* cursor; + /// pointer past the last character + const char* const limit; +}; + +template<typename WideStringType, size_t T> +struct wide_string_input_helper +{ + // UTF-32 + static void fill_buffer(const WideStringType& str, + size_t& current_wchar, + std::array<std::char_traits<char>::int_type, 4>& utf8_bytes, + size_t& utf8_bytes_index, + size_t& utf8_bytes_filled) + { + utf8_bytes_index = 0; + + if (current_wchar == str.size()) + { + utf8_bytes[0] = std::char_traits<char>::eof(); + utf8_bytes_filled = 1; + } + else + { + // get the current character + const auto wc = static_cast<unsigned int>(str[current_wchar++]); + + // UTF-32 to UTF-8 encoding + if (wc < 0x80) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc); + utf8_bytes_filled = 1; + } + else if (wc <= 0x7FF) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xC0u | ((wc >> 6u) & 0x1Fu)); + utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | (wc & 0x3Fu)); + utf8_bytes_filled = 2; + } + else if (wc <= 0xFFFF) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xE0u | ((wc >> 12u) & 0x0Fu)); + utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((wc >> 6u) & 0x3Fu)); + utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | (wc & 0x3Fu)); + utf8_bytes_filled = 3; + } + else if (wc <= 0x10FFFF) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xF0u | ((wc >> 18u) & 0x07u)); + utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((wc >> 12u) & 0x3Fu)); + utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | ((wc >> 6u) & 0x3Fu)); + utf8_bytes[3] = static_cast<std::char_traits<char>::int_type>(0x80u | (wc & 0x3Fu)); + utf8_bytes_filled = 4; + } + else + { + // unknown character + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc); + utf8_bytes_filled = 1; + } + } + } +}; + +template<typename WideStringType> +struct wide_string_input_helper<WideStringType, 2> +{ + // UTF-16 + static void fill_buffer(const WideStringType& str, + size_t& current_wchar, + std::array<std::char_traits<char>::int_type, 4>& utf8_bytes, + size_t& utf8_bytes_index, + size_t& utf8_bytes_filled) + { + utf8_bytes_index = 0; + + if (current_wchar == str.size()) + { + utf8_bytes[0] = std::char_traits<char>::eof(); + utf8_bytes_filled = 1; + } + else + { + // get the current character + const auto wc = static_cast<unsigned int>(str[current_wchar++]); + + // UTF-16 to UTF-8 encoding + if (wc < 0x80) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc); + utf8_bytes_filled = 1; + } + else if (wc <= 0x7FF) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xC0u | ((wc >> 6u))); + utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | (wc & 0x3Fu)); + utf8_bytes_filled = 2; + } + else if (0xD800 > wc or wc >= 0xE000) + { + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xE0u | ((wc >> 12u))); + utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((wc >> 6u) & 0x3Fu)); + utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | (wc & 0x3Fu)); + utf8_bytes_filled = 3; + } + else + { + if (current_wchar < str.size()) + { + const auto wc2 = static_cast<unsigned int>(str[current_wchar++]); + const auto charcode = 0x10000u + (((wc & 0x3FFu) << 10u) | (wc2 & 0x3FFu)); + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(0xF0u | (charcode >> 18u)); + utf8_bytes[1] = static_cast<std::char_traits<char>::int_type>(0x80u | ((charcode >> 12u) & 0x3Fu)); + utf8_bytes[2] = static_cast<std::char_traits<char>::int_type>(0x80u | ((charcode >> 6u) & 0x3Fu)); + utf8_bytes[3] = static_cast<std::char_traits<char>::int_type>(0x80u | (charcode & 0x3Fu)); + utf8_bytes_filled = 4; + } + else + { + // unknown character + ++current_wchar; + utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc); + utf8_bytes_filled = 1; + } + } + } + } +}; + +template<typename WideStringType> +class wide_string_input_adapter : public input_adapter_protocol +{ + public: + explicit wide_string_input_adapter(const WideStringType& w) noexcept + : str(w) + {} + + std::char_traits<char>::int_type get_character() noexcept override + { + // check if buffer needs to be filled + if (utf8_bytes_index == utf8_bytes_filled) + { + fill_buffer<sizeof(typename WideStringType::value_type)>(); + + assert(utf8_bytes_filled > 0); + assert(utf8_bytes_index == 0); + } + + // use buffer + assert(utf8_bytes_filled > 0); + assert(utf8_bytes_index < utf8_bytes_filled); + return utf8_bytes[utf8_bytes_index++]; + } + + private: + template<size_t T> + void fill_buffer() + { + wide_string_input_helper<WideStringType, T>::fill_buffer(str, current_wchar, utf8_bytes, utf8_bytes_index, utf8_bytes_filled); + } + + /// the wstring to process + const WideStringType& str; + + /// index of the current wchar in str + std::size_t current_wchar = 0; + + /// a buffer for UTF-8 bytes + std::array<std::char_traits<char>::int_type, 4> utf8_bytes = {{0, 0, 0, 0}}; + + /// index to the utf8_codes array for the next valid byte + std::size_t utf8_bytes_index = 0; + /// number of valid bytes in the utf8_codes array + std::size_t utf8_bytes_filled = 0; +}; + +class input_adapter +{ + public: + // native support + JSON_HEDLEY_NON_NULL(2) + input_adapter(std::FILE* file) + : ia(std::make_shared<file_input_adapter>(file)) {} + /// input adapter for input stream + input_adapter(std::istream& i) + : ia(std::make_shared<input_stream_adapter>(i)) {} + + /// input adapter for input stream + input_adapter(std::istream&& i) + : ia(std::make_shared<input_stream_adapter>(i)) {} + + input_adapter(const std::wstring& ws) + : ia(std::make_shared<wide_string_input_adapter<std::wstring>>(ws)) {} + + input_adapter(const std::u16string& ws) + : ia(std::make_shared<wide_string_input_adapter<std::u16string>>(ws)) {} + + input_adapter(const std::u32string& ws) + : ia(std::make_shared<wide_string_input_adapter<std::u32string>>(ws)) {} + + /// input adapter for buffer + template<typename CharT, + typename std::enable_if< + std::is_pointer<CharT>::value and + std::is_integral<typename std::remove_pointer<CharT>::type>::value and + sizeof(typename std::remove_pointer<CharT>::type) == 1, + int>::type = 0> + input_adapter(CharT b, std::size_t l) + : ia(std::make_shared<input_buffer_adapter>(reinterpret_cast<const char*>(b), l)) {} + + // derived support + + /// input adapter for string literal + template<typename CharT, + typename std::enable_if< + std::is_pointer<CharT>::value and + std::is_integral<typename std::remove_pointer<CharT>::type>::value and + sizeof(typename std::remove_pointer<CharT>::type) == 1, + int>::type = 0> + input_adapter(CharT b) + : input_adapter(reinterpret_cast<const char*>(b), + std::strlen(reinterpret_cast<const char*>(b))) {} + + /// input adapter for iterator range with contiguous storage + template<class IteratorType, + typename std::enable_if< + std::is_same<typename iterator_traits<IteratorType>::iterator_category, std::random_access_iterator_tag>::value, + int>::type = 0> + input_adapter(IteratorType first, IteratorType last) + { +#ifndef NDEBUG + // assertion to check that the iterator range is indeed contiguous, + // see https://stackoverflow.com/a/35008842/266378 for more discussion + const auto is_contiguous = std::accumulate( + first, last, std::pair<bool, int>(true, 0), + [&first](std::pair<bool, int> res, decltype(*first) val) + { + res.first &= (val == *(std::next(std::addressof(*first), res.second++))); + return res; + }).first; + assert(is_contiguous); +#endif + + // assertion to check that each element is 1 byte long + static_assert( + sizeof(typename iterator_traits<IteratorType>::value_type) == 1, + "each element in the iterator range must have the size of 1 byte"); + + const auto len = static_cast<size_t>(std::distance(first, last)); + if (JSON_HEDLEY_LIKELY(len > 0)) + { + // there is at least one element: use the address of first + ia = std::make_shared<input_buffer_adapter>(reinterpret_cast<const char*>(&(*first)), len); + } + else + { + // the address of first cannot be used: use nullptr + ia = std::make_shared<input_buffer_adapter>(nullptr, len); + } + } + + /// input adapter for array + template<class T, std::size_t N> + input_adapter(T (&array)[N]) + : input_adapter(std::begin(array), std::end(array)) {} + + /// input adapter for contiguous container + template<class ContiguousContainer, typename + std::enable_if<not std::is_pointer<ContiguousContainer>::value and + std::is_base_of<std::random_access_iterator_tag, typename iterator_traits<decltype(std::begin(std::declval<ContiguousContainer const>()))>::iterator_category>::value, + int>::type = 0> + input_adapter(const ContiguousContainer& c) + : input_adapter(std::begin(c), std::end(c)) {} + + operator input_adapter_t() + { + return ia; + } + + private: + /// the actual adapter + input_adapter_t ia = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/input/json_sax.hpp> + + +#include <cassert> // assert +#include <cstddef> +#include <string> // string +#include <utility> // move +#include <vector> // vector + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + + +namespace nlohmann +{ + +/*! +@brief SAX interface + +This class describes the SAX interface used by @ref nlohmann::json::sax_parse. +Each function is called in different situations while the input is parsed. The +boolean return value informs the parser whether to continue processing the +input. +*/ +template<typename BasicJsonType> +struct json_sax +{ + /// type for (signed) integers + using number_integer_t = typename BasicJsonType::number_integer_t; + /// type for unsigned integers + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + /// type for floating-point numbers + using number_float_t = typename BasicJsonType::number_float_t; + /// type for strings + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + /*! + @brief a null value was read + @return whether parsing should proceed + */ + virtual bool null() = 0; + + /*! + @brief a boolean value was read + @param[in] val boolean value + @return whether parsing should proceed + */ + virtual bool boolean(bool val) = 0; + + /*! + @brief an integer number was read + @param[in] val integer value + @return whether parsing should proceed + */ + virtual bool number_integer(number_integer_t val) = 0; + + /*! + @brief an unsigned integer number was read + @param[in] val unsigned integer value + @return whether parsing should proceed + */ + virtual bool number_unsigned(number_unsigned_t val) = 0; + + /*! + @brief an floating-point number was read + @param[in] val floating-point value + @param[in] s raw token value + @return whether parsing should proceed + */ + virtual bool number_float(number_float_t val, const string_t& s) = 0; + + /*! + @brief a string was read + @param[in] val string value + @return whether parsing should proceed + @note It is safe to move the passed string. + */ + virtual bool string(string_t& val) = 0; + + /*! + @brief a binary string was read + @param[in] val binary value + @return whether parsing should proceed + @note It is safe to move the passed binary. + */ + virtual bool binary(binary_t& val) = 0; + + /*! + @brief the beginning of an object was read + @param[in] elements number of object elements or -1 if unknown + @return whether parsing should proceed + @note binary formats may report the number of elements + */ + virtual bool start_object(std::size_t elements) = 0; + + /*! + @brief an object key was read + @param[in] val object key + @return whether parsing should proceed + @note It is safe to move the passed string. + */ + virtual bool key(string_t& val) = 0; + + /*! + @brief the end of an object was read + @return whether parsing should proceed + */ + virtual bool end_object() = 0; + + /*! + @brief the beginning of an array was read + @param[in] elements number of array elements or -1 if unknown + @return whether parsing should proceed + @note binary formats may report the number of elements + */ + virtual bool start_array(std::size_t elements) = 0; + + /*! + @brief the end of an array was read + @return whether parsing should proceed + */ + virtual bool end_array() = 0; + + /*! + @brief a parse error occurred + @param[in] position the position in the input where the error occurs + @param[in] last_token the last read token + @param[in] ex an exception object describing the error + @return whether parsing should proceed (must return false) + */ + virtual bool parse_error(std::size_t position, + const std::string& last_token, + const detail::exception& ex) = 0; + + virtual ~json_sax() = default; +}; + + +namespace detail +{ +/*! +@brief SAX implementation to create a JSON value from SAX events + +This class implements the @ref json_sax interface and processes the SAX events +to create a JSON value which makes it basically a DOM parser. The structure or +hierarchy of the JSON value is managed by the stack `ref_stack` which contains +a pointer to the respective array or object for each recursion depth. + +After successful parsing, the value that is passed by reference to the +constructor contains the parsed value. + +@tparam BasicJsonType the JSON type +*/ +template<typename BasicJsonType> +class json_sax_dom_parser +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + /*! + @param[in, out] r reference to a JSON value that is manipulated while + parsing + @param[in] allow_exceptions_ whether parse errors yield exceptions + */ + explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_exceptions_ = true) + : root(r), allow_exceptions(allow_exceptions_) + {} + + // make class move-only + json_sax_dom_parser(const json_sax_dom_parser&) = delete; + json_sax_dom_parser(json_sax_dom_parser&&) = default; + json_sax_dom_parser& operator=(const json_sax_dom_parser&) = delete; + json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default; + ~json_sax_dom_parser() = default; + + bool null() + { + handle_value(nullptr); + return true; + } + + bool boolean(bool val) + { + handle_value(val); + return true; + } + + bool number_integer(number_integer_t val) + { + handle_value(val); + return true; + } + + bool number_unsigned(number_unsigned_t val) + { + handle_value(val); + return true; + } + + bool number_float(number_float_t val, const string_t& /*unused*/) + { + handle_value(val); + return true; + } + + bool string(string_t& val) + { + handle_value(val); + return true; + } + + bool binary(binary_t& val) + { + handle_binary(val); + return true; + } + + bool start_object(std::size_t len) + { + ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); + + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, + "excessive object size: " + std::to_string(len))); + } + + return true; + } + + bool key(string_t& val) + { + // add null at given key and store the reference for later + object_element = &(ref_stack.back()->m_value.object->operator[](val)); + return true; + } + + bool end_object() + { + ref_stack.pop_back(); + return true; + } + + bool start_array(std::size_t len) + { + ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); + + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, + "excessive array size: " + std::to_string(len))); + } + + return true; + } + + bool end_array() + { + ref_stack.pop_back(); + return true; + } + + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, + const detail::exception& ex) + { + errored = true; + if (allow_exceptions) + { + // determine the proper exception type from the id + switch ((ex.id / 100) % 100) + { + case 1: + JSON_THROW(*static_cast<const detail::parse_error*>(&ex)); + case 4: + JSON_THROW(*static_cast<const detail::out_of_range*>(&ex)); + // LCOV_EXCL_START + case 2: + JSON_THROW(*static_cast<const detail::invalid_iterator*>(&ex)); + case 3: + JSON_THROW(*static_cast<const detail::type_error*>(&ex)); + case 5: + JSON_THROW(*static_cast<const detail::other_error*>(&ex)); + default: + assert(false); + // LCOV_EXCL_STOP + } + } + return false; + } + + constexpr bool is_errored() const + { + return errored; + } + + private: + /*! + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + */ + template<typename Value> + JSON_HEDLEY_RETURNS_NON_NULL + BasicJsonType* handle_value(Value&& v) + { + if (ref_stack.empty()) + { + root = BasicJsonType(std::forward<Value>(v)); + return &root; + } + + assert(ref_stack.back()->is_array() or ref_stack.back()->is_object()); + + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->emplace_back(std::forward<Value>(v)); + return &(ref_stack.back()->m_value.array->back()); + } + + assert(ref_stack.back()->is_object()); + assert(object_element); + *object_element = BasicJsonType(std::forward<Value>(v)); + return object_element; + } + + /*! + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + */ + template<typename BinaryValue> + JSON_HEDLEY_RETURNS_NON_NULL + BasicJsonType* handle_binary(BinaryValue&& v) + { + if (ref_stack.empty()) + { + root = BasicJsonType::binary_array(std::forward<BinaryValue>(v)); + return &root; + } + + assert(ref_stack.back()->is_array() or ref_stack.back()->is_object()); + + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->emplace_back(BasicJsonType::binary_array(std::forward<BinaryValue>(v))); + return &(ref_stack.back()->m_value.array->back()); + } + + assert(ref_stack.back()->is_object()); + assert(object_element); + *object_element = BasicJsonType::binary_array(std::forward<BinaryValue>(v)); + return object_element; + } + + /// the parsed JSON value + BasicJsonType& root; + /// stack to model hierarchy of values + std::vector<BasicJsonType*> ref_stack {}; + /// helper to hold the reference for the next object element + BasicJsonType* object_element = nullptr; + /// whether a syntax error occurred + bool errored = false; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; +}; + +template<typename BasicJsonType> +class json_sax_dom_callback_parser +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using parser_callback_t = typename BasicJsonType::parser_callback_t; + using parse_event_t = typename BasicJsonType::parse_event_t; + + json_sax_dom_callback_parser(BasicJsonType& r, + const parser_callback_t cb, + const bool allow_exceptions_ = true) + : root(r), callback(cb), allow_exceptions(allow_exceptions_) + { + keep_stack.push_back(true); + } + + // make class move-only + json_sax_dom_callback_parser(const json_sax_dom_callback_parser&) = delete; + json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = default; + json_sax_dom_callback_parser& operator=(const json_sax_dom_callback_parser&) = delete; + json_sax_dom_callback_parser& operator=(json_sax_dom_callback_parser&&) = default; + ~json_sax_dom_callback_parser() = default; + + bool null() + { + handle_value(nullptr); + return true; + } + + bool boolean(bool val) + { + handle_value(val); + return true; + } + + bool number_integer(number_integer_t val) + { + handle_value(val); + return true; + } + + bool number_unsigned(number_unsigned_t val) + { + handle_value(val); + return true; + } + + bool number_float(number_float_t val, const string_t& /*unused*/) + { + handle_value(val); + return true; + } + + bool string(string_t& val) + { + handle_value(val); + return true; + } + + bool binary(binary_t& val) + { + handle_value(val); + return true; + } + + bool start_object(std::size_t len) + { + // check callback for object start + const bool keep = callback(static_cast<int>(ref_stack.size()), parse_event_t::object_start, discarded); + keep_stack.push_back(keep); + + auto val = handle_value(BasicJsonType::value_t::object, true); + ref_stack.push_back(val.second); + + // check object limit + if (ref_stack.back() and JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); + } + + return true; + } + + bool key(string_t& val) + { + BasicJsonType k = BasicJsonType(val); + + // check callback for key + const bool keep = callback(static_cast<int>(ref_stack.size()), parse_event_t::key, k); + key_keep_stack.push_back(keep); + + // add discarded value at given key and store the reference for later + if (keep and ref_stack.back()) + { + object_element = &(ref_stack.back()->m_value.object->operator[](val) = discarded); + } + + return true; + } + + bool end_object() + { + if (ref_stack.back() and not callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::object_end, *ref_stack.back())) + { + // discard object + *ref_stack.back() = discarded; + } + + assert(not ref_stack.empty()); + assert(not keep_stack.empty()); + ref_stack.pop_back(); + keep_stack.pop_back(); + + if (not ref_stack.empty() and ref_stack.back() and ref_stack.back()->is_object()) + { + // remove discarded value + for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it) + { + if (it->is_discarded()) + { + ref_stack.back()->erase(it); + break; + } + } + } + + return true; + } + + bool start_array(std::size_t len) + { + const bool keep = callback(static_cast<int>(ref_stack.size()), parse_event_t::array_start, discarded); + keep_stack.push_back(keep); + + auto val = handle_value(BasicJsonType::value_t::array, true); + ref_stack.push_back(val.second); + + // check array limit + if (ref_stack.back() and JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); + } + + return true; + } + + bool end_array() + { + bool keep = true; + + if (ref_stack.back()) + { + keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back()); + if (not keep) + { + // discard array + *ref_stack.back() = discarded; + } + } + + assert(not ref_stack.empty()); + assert(not keep_stack.empty()); + ref_stack.pop_back(); + keep_stack.pop_back(); + + // remove discarded value + if (not keep and not ref_stack.empty() and ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->pop_back(); + } + + return true; + } + + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, + const detail::exception& ex) + { + errored = true; + if (allow_exceptions) + { + // determine the proper exception type from the id + switch ((ex.id / 100) % 100) + { + case 1: + JSON_THROW(*static_cast<const detail::parse_error*>(&ex)); + case 4: + JSON_THROW(*static_cast<const detail::out_of_range*>(&ex)); + // LCOV_EXCL_START + case 2: + JSON_THROW(*static_cast<const detail::invalid_iterator*>(&ex)); + case 3: + JSON_THROW(*static_cast<const detail::type_error*>(&ex)); + case 5: + JSON_THROW(*static_cast<const detail::other_error*>(&ex)); + default: + assert(false); + // LCOV_EXCL_STOP + } + } + return false; + } + + constexpr bool is_errored() const + { + return errored; + } + + private: + /*! + @param[in] v value to add to the JSON value we build during parsing + @param[in] skip_callback whether we should skip calling the callback + function; this is required after start_array() and + start_object() SAX events, because otherwise we would call the + callback function with an empty array or object, respectively. + + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + + @return pair of boolean (whether value should be kept) and pointer (to the + passed value in the ref_stack hierarchy; nullptr if not kept) + */ + template<typename Value> + std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool skip_callback = false) + { + assert(not keep_stack.empty()); + + // do not handle this value if we know it would be added to a discarded + // container + if (not keep_stack.back()) + { + return {false, nullptr}; + } + + // create value + auto value = BasicJsonType(std::forward<Value>(v)); + + // check callback + const bool keep = skip_callback or callback(static_cast<int>(ref_stack.size()), parse_event_t::value, value); + + // do not handle this value if we just learnt it shall be discarded + if (not keep) + { + return {false, nullptr}; + } + + if (ref_stack.empty()) + { + root = std::move(value); + return {true, &root}; + } + + // skip this value if we already decided to skip the parent + // (https://github.com/nlohmann/json/issues/971#issuecomment-413678360) + if (not ref_stack.back()) + { + return {false, nullptr}; + } + + // we now only expect arrays and objects + assert(ref_stack.back()->is_array() or ref_stack.back()->is_object()); + + // array + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->push_back(std::move(value)); + return {true, &(ref_stack.back()->m_value.array->back())}; + } + + // object + assert(ref_stack.back()->is_object()); + // check if we should store an element for the current key + assert(not key_keep_stack.empty()); + const bool store_element = key_keep_stack.back(); + key_keep_stack.pop_back(); + + if (not store_element) + { + return {false, nullptr}; + } + + assert(object_element); + *object_element = std::move(value); + return {true, object_element}; + } + + /// the parsed JSON value + BasicJsonType& root; + /// stack to model hierarchy of values + std::vector<BasicJsonType*> ref_stack {}; + /// stack to manage which values to keep + std::vector<bool> keep_stack {}; + /// stack to manage which object keys to keep + std::vector<bool> key_keep_stack {}; + /// helper to hold the reference for the next object element + BasicJsonType* object_element = nullptr; + /// whether a syntax error occurred + bool errored = false; + /// callback function + const parser_callback_t callback = nullptr; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; + /// a discarded value for the callback + BasicJsonType discarded = BasicJsonType::value_t::discarded; +}; + +template<typename BasicJsonType> +class json_sax_acceptor +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + bool null() + { + return true; + } + + bool boolean(bool /*unused*/) + { + return true; + } + + bool number_integer(number_integer_t /*unused*/) + { + return true; + } + + bool number_unsigned(number_unsigned_t /*unused*/) + { + return true; + } + + bool number_float(number_float_t /*unused*/, const string_t& /*unused*/) + { + return true; + } + + bool string(string_t& /*unused*/) + { + return true; + } + + bool binary(binary_t& /*unused*/) + { + return true; + } + + bool start_object(std::size_t /*unused*/ = std::size_t(-1)) + { + return true; + } + + bool key(string_t& /*unused*/) + { + return true; + } + + bool end_object() + { + return true; + } + + bool start_array(std::size_t /*unused*/ = std::size_t(-1)) + { + return true; + } + + bool end_array() + { + return true; + } + + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const detail::exception& /*unused*/) + { + return false; + } +}; +} // namespace detail + +} // namespace nlohmann + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/is_sax.hpp> + + +#include <cstdint> // size_t +#include <utility> // declval +#include <string> // string + +// #include <nlohmann/detail/meta/detected.hpp> + +// #include <nlohmann/detail/meta/type_traits.hpp> + + +namespace nlohmann +{ +namespace detail +{ +template <typename T> +using null_function_t = decltype(std::declval<T&>().null()); + +template <typename T> +using boolean_function_t = + decltype(std::declval<T&>().boolean(std::declval<bool>())); + +template <typename T, typename Integer> +using number_integer_function_t = + decltype(std::declval<T&>().number_integer(std::declval<Integer>())); + +template <typename T, typename Unsigned> +using number_unsigned_function_t = + decltype(std::declval<T&>().number_unsigned(std::declval<Unsigned>())); + +template <typename T, typename Float, typename String> +using number_float_function_t = decltype(std::declval<T&>().number_float( + std::declval<Float>(), std::declval<const String&>())); + +template <typename T, typename String> +using string_function_t = + decltype(std::declval<T&>().string(std::declval<String&>())); + +template <typename T> +using start_object_function_t = + decltype(std::declval<T&>().start_object(std::declval<std::size_t>())); + +template <typename T, typename String> +using key_function_t = + decltype(std::declval<T&>().key(std::declval<String&>())); + +template <typename T> +using end_object_function_t = decltype(std::declval<T&>().end_object()); + +template <typename T> +using start_array_function_t = + decltype(std::declval<T&>().start_array(std::declval<std::size_t>())); + +template <typename T> +using end_array_function_t = decltype(std::declval<T&>().end_array()); + +template <typename T, typename Exception> +using parse_error_function_t = decltype(std::declval<T&>().parse_error( + std::declval<std::size_t>(), std::declval<const std::string&>(), + std::declval<const Exception&>())); + +template <typename SAX, typename BasicJsonType> +struct is_sax +{ + private: + static_assert(is_basic_json<BasicJsonType>::value, + "BasicJsonType must be of type basic_json<...>"); + + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using exception_t = typename BasicJsonType::exception; + + public: + static constexpr bool value = + is_detected_exact<bool, null_function_t, SAX>::value && + is_detected_exact<bool, boolean_function_t, SAX>::value && + is_detected_exact<bool, number_integer_function_t, SAX, + number_integer_t>::value && + is_detected_exact<bool, number_unsigned_function_t, SAX, + number_unsigned_t>::value && + is_detected_exact<bool, number_float_function_t, SAX, number_float_t, + string_t>::value && + is_detected_exact<bool, string_function_t, SAX, string_t>::value && + is_detected_exact<bool, start_object_function_t, SAX>::value && + is_detected_exact<bool, key_function_t, SAX, string_t>::value && + is_detected_exact<bool, end_object_function_t, SAX>::value && + is_detected_exact<bool, start_array_function_t, SAX>::value && + is_detected_exact<bool, end_array_function_t, SAX>::value && + is_detected_exact<bool, parse_error_function_t, SAX, exception_t>::value; +}; + +template <typename SAX, typename BasicJsonType> +struct is_sax_static_asserts +{ + private: + static_assert(is_basic_json<BasicJsonType>::value, + "BasicJsonType must be of type basic_json<...>"); + + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using exception_t = typename BasicJsonType::exception; + + public: + static_assert(is_detected_exact<bool, null_function_t, SAX>::value, + "Missing/invalid function: bool null()"); + static_assert(is_detected_exact<bool, boolean_function_t, SAX>::value, + "Missing/invalid function: bool boolean(bool)"); + static_assert(is_detected_exact<bool, boolean_function_t, SAX>::value, + "Missing/invalid function: bool boolean(bool)"); + static_assert( + is_detected_exact<bool, number_integer_function_t, SAX, + number_integer_t>::value, + "Missing/invalid function: bool number_integer(number_integer_t)"); + static_assert( + is_detected_exact<bool, number_unsigned_function_t, SAX, + number_unsigned_t>::value, + "Missing/invalid function: bool number_unsigned(number_unsigned_t)"); + static_assert(is_detected_exact<bool, number_float_function_t, SAX, + number_float_t, string_t>::value, + "Missing/invalid function: bool number_float(number_float_t, const string_t&)"); + static_assert( + is_detected_exact<bool, string_function_t, SAX, string_t>::value, + "Missing/invalid function: bool string(string_t&)"); + static_assert(is_detected_exact<bool, start_object_function_t, SAX>::value, + "Missing/invalid function: bool start_object(std::size_t)"); + static_assert(is_detected_exact<bool, key_function_t, SAX, string_t>::value, + "Missing/invalid function: bool key(string_t&)"); + static_assert(is_detected_exact<bool, end_object_function_t, SAX>::value, + "Missing/invalid function: bool end_object()"); + static_assert(is_detected_exact<bool, start_array_function_t, SAX>::value, + "Missing/invalid function: bool start_array(std::size_t)"); + static_assert(is_detected_exact<bool, end_array_function_t, SAX>::value, + "Missing/invalid function: bool end_array()"); + static_assert( + is_detected_exact<bool, parse_error_function_t, SAX, exception_t>::value, + "Missing/invalid function: bool parse_error(std::size_t, const " + "std::string&, const exception&)"); +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// binary reader // +/////////////////// + +/*! +@brief deserialization of CBOR, MessagePack, and UBJSON values +*/ +template<typename BasicJsonType, typename SAX = json_sax_dom_parser<BasicJsonType>> +class binary_reader +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using internal_binary_t = typename BasicJsonType::internal_binary_t; + using json_sax_t = SAX; + + public: + /*! + @brief create a binary reader + + @param[in] adapter input adapter to read from + */ + explicit binary_reader(input_adapter_t adapter) : ia(std::move(adapter)) + { + (void)detail::is_sax_static_asserts<SAX, BasicJsonType> {}; + assert(ia); + } + + // make class move-only + binary_reader(const binary_reader&) = delete; + binary_reader(binary_reader&&) = default; + binary_reader& operator=(const binary_reader&) = delete; + binary_reader& operator=(binary_reader&&) = default; + ~binary_reader() = default; + + /*! + @param[in] format the binary format to parse + @param[in] sax_ a SAX event processor + @param[in] strict whether to expect the input to be consumed completed + + @return + */ + JSON_HEDLEY_NON_NULL(3) + bool sax_parse(const input_format_t format, + json_sax_t* sax_, + const bool strict = true) + { + sax = sax_; + bool result = false; + + switch (format) + { + case input_format_t::bson: + result = parse_bson_internal(); + break; + + case input_format_t::cbor: + result = parse_cbor_internal(); + break; + + case input_format_t::msgpack: + result = parse_msgpack_internal(); + break; + + case input_format_t::ubjson: + result = parse_ubjson_internal(); + break; + + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + + // strict mode: next byte must be EOF + if (result and strict) + { + if (format == input_format_t::ubjson) + { + get_ignore_noop(); + } + else + { + get(); + } + + if (JSON_HEDLEY_UNLIKELY(current != std::char_traits<char>::eof())) + { + return sax->parse_error(chars_read, get_token_string(), + parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); + } + } + + return result; + } + + /*! + @brief determine system byte order + + @return true if and only if system's byte order is little endian + + @note from https://stackoverflow.com/a/1001328/266378 + */ + static constexpr bool little_endianess(int num = 1) noexcept + { + return *reinterpret_cast<char*>(&num) == 1; + } + + private: + ////////// + // BSON // + ////////// + + /*! + @brief Reads in a BSON-object and passes it to the SAX-parser. + @return whether a valid BSON-value was passed to the SAX parser + */ + bool parse_bson_internal() + { + std::int32_t document_size; + get_number<std::int32_t, true>(input_format_t::bson, document_size); + + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/false))) + { + return false; + } + + return sax->end_object(); + } + + /*! + @brief Parses a C-style string from the BSON input. + @param[in, out] result A reference to the string variable where the read + string is to be stored. + @return `true` if the \x00-byte indicating the end of the string was + encountered before the EOF; false` indicates an unexpected EOF. + */ + bool get_bson_cstr(string_t& result) + { + auto out = std::back_inserter(result); + while (true) + { + get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "cstring"))) + { + return false; + } + if (current == 0x00) + { + return true; + } + *out++ = static_cast<char>(current); + } + + return true; + } + + /*! + @brief Parses a zero-terminated string of length @a len from the BSON + input. + @param[in] len The length (including the zero-byte at the end) of the + string to be read. + @param[in, out] result A reference to the string variable where the read + string is to be stored. + @tparam NumberType The type of the length @a len + @pre len >= 1 + @return `true` if the string was successfully parsed + */ + template<typename NumberType> + bool get_bson_string(const NumberType len, string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(len < 1)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); + } + + return get_string(input_format_t::bson, len - static_cast<NumberType>(1), result) and get() != std::char_traits<char>::eof(); + } + + /*! + @brief Parses a byte array input of length @a len from the BSON input. + @param[in] len The length of the byte array to be read. + @param[in, out] result A reference to the binary variable where the read + array is to be stored. + @tparam NumberType The type of the length @a len + @pre len >= 0 + @return `true` if the byte array was successfully parsed + */ + template<typename NumberType> + bool get_bson_binary(const NumberType len, internal_binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(len < 0)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "byte array length cannot be negative, is " + std::to_string(len), "binary"))); + } + + result.has_subtype = true; // All BSON binary values have a subtype + get_number<std::uint8_t>(input_format_t::bson, result.subtype); + + return get_binary(input_format_t::bson, len, result); + } + + /*! + @brief Read a BSON document element of the given @a element_type. + @param[in] element_type The BSON element type, c.f. http://bsonspec.org/spec.html + @param[in] element_type_parse_position The position in the input stream, + where the `element_type` was read. + @warning Not all BSON element types are supported yet. An unsupported + @a element_type will give rise to a parse_error.114: + Unsupported BSON record type 0x... + @return whether a valid BSON-object/array was passed to the SAX parser + */ + bool parse_bson_element_internal(const int element_type, + const std::size_t element_type_parse_position) + { + switch (element_type) + { + case 0x01: // double + { + double number; + return get_number<double, true>(input_format_t::bson, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + case 0x02: // string + { + std::int32_t len; + string_t value; + return get_number<std::int32_t, true>(input_format_t::bson, len) and get_bson_string(len, value) and sax->string(value); + } + + case 0x03: // object + { + return parse_bson_internal(); + } + + case 0x04: // array + { + return parse_bson_array(); + } + + case 0x05: // binary + { + std::int32_t len; + internal_binary_t value; + return get_number<std::int32_t, true>(input_format_t::bson, len) and get_bson_binary(len, value) and sax->binary(value); + } + + case 0x08: // boolean + { + return sax->boolean(get() != 0); + } + + case 0x0A: // null + { + return sax->null(); + } + + case 0x10: // int32 + { + std::int32_t value; + return get_number<std::int32_t, true>(input_format_t::bson, value) and sax->number_integer(value); + } + + case 0x12: // int64 + { + std::int64_t value; + return get_number<std::int64_t, true>(input_format_t::bson, value) and sax->number_integer(value); + } + + default: // anything else not supported (yet) + { + std::array<char, 3> cr{{}}; + (std::snprintf)(cr.data(), cr.size(), "%.2hhX", static_cast<unsigned char>(element_type)); + return sax->parse_error(element_type_parse_position, std::string(cr.data()), parse_error::create(114, element_type_parse_position, "Unsupported BSON record type 0x" + std::string(cr.data()))); + } + } + } + + /*! + @brief Read a BSON element list (as specified in the BSON-spec) + + The same binary layout is used for objects and arrays, hence it must be + indicated with the argument @a is_array which one is expected + (true --> array, false --> object). + + @param[in] is_array Determines if the element list being read is to be + treated as an object (@a is_array == false), or as an + array (@a is_array == true). + @return whether a valid BSON-object/array was passed to the SAX parser + */ + bool parse_bson_element_list(const bool is_array) + { + string_t key; + + while (int element_type = get()) + { + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::bson, "element list"))) + { + return false; + } + + const std::size_t element_type_parse_position = chars_read; + if (JSON_HEDLEY_UNLIKELY(not get_bson_cstr(key))) + { + return false; + } + + if (not is_array and not sax->key(key)) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_internal(element_type, element_type_parse_position))) + { + return false; + } + + // get_bson_cstr only appends + key.clear(); + } + + return true; + } + + /*! + @brief Reads an array from the BSON input and passes it to the SAX-parser. + @return whether a valid BSON-array was passed to the SAX parser + */ + bool parse_bson_array() + { + std::int32_t document_size; + get_number<std::int32_t, true>(input_format_t::bson, document_size); + + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(not parse_bson_element_list(/*is_array*/true))) + { + return false; + } + + return sax->end_array(); + } + + ////////// + // CBOR // + ////////// + + /*! + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether a valid CBOR value was passed to the SAX parser + */ + bool parse_cbor_internal(const bool get_char = true) + { + switch (get_char ? get() : current) + { + // EOF + case std::char_traits<char>::eof(): + return unexpect_eof(input_format_t::cbor, "value"); + + // Integer 0x00..0x17 (0..23) + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + return sax->number_unsigned(static_cast<number_unsigned_t>(current)); + + case 0x18: // Unsigned integer (one-byte uint8_t follows) + { + std::uint8_t number; + return get_number(input_format_t::cbor, number) and sax->number_unsigned(number); + } + + case 0x19: // Unsigned integer (two-byte uint16_t follows) + { + std::uint16_t number; + return get_number(input_format_t::cbor, number) and sax->number_unsigned(number); + } + + case 0x1A: // Unsigned integer (four-byte uint32_t follows) + { + std::uint32_t number; + return get_number(input_format_t::cbor, number) and sax->number_unsigned(number); + } + + case 0x1B: // Unsigned integer (eight-byte uint64_t follows) + { + std::uint64_t number; + return get_number(input_format_t::cbor, number) and sax->number_unsigned(number); + } + + // Negative integer -1-0x00..-1-0x17 (-1..-24) + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + return sax->number_integer(static_cast<std::int8_t>(0x20 - 1 - current)); + + case 0x38: // Negative integer (one-byte uint8_t follows) + { + std::uint8_t number; + return get_number(input_format_t::cbor, number) and sax->number_integer(static_cast<number_integer_t>(-1) - number); + } + + case 0x39: // Negative integer -1-n (two-byte uint16_t follows) + { + std::uint16_t number; + return get_number(input_format_t::cbor, number) and sax->number_integer(static_cast<number_integer_t>(-1) - number); + } + + case 0x3A: // Negative integer -1-n (four-byte uint32_t follows) + { + std::uint32_t number; + return get_number(input_format_t::cbor, number) and sax->number_integer(static_cast<number_integer_t>(-1) - number); + } + + case 0x3B: // Negative integer -1-n (eight-byte uint64_t follows) + { + std::uint64_t number; + return get_number(input_format_t::cbor, number) and sax->number_integer(static_cast<number_integer_t>(-1) + - static_cast<number_integer_t>(number)); + } + + // Binary data (0x00..0x17 bytes follow) + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: // Binary data (one-byte uint8_t for n follows) + case 0x59: // Binary data (two-byte uint16_t for n follow) + case 0x5A: // Binary data (four-byte uint32_t for n follow) + case 0x5B: // Binary data (eight-byte uint64_t for n follow) + case 0x5F: // Binary data (indefinite length) + { + internal_binary_t b; + return get_cbor_binary(b) and sax->binary(b); + } + + // UTF-8 string (0x00..0x17 bytes follow) + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: // UTF-8 string (one-byte uint8_t for n follows) + case 0x79: // UTF-8 string (two-byte uint16_t for n follow) + case 0x7A: // UTF-8 string (four-byte uint32_t for n follow) + case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow) + case 0x7F: // UTF-8 string (indefinite length) + { + string_t s; + return get_cbor_string(s) and sax->string(s); + } + + // array (0x00..0x17 data items follow) + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8A: + case 0x8B: + case 0x8C: + case 0x8D: + case 0x8E: + case 0x8F: + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + return get_cbor_array(static_cast<std::size_t>(static_cast<unsigned int>(current) & 0x1Fu)); + + case 0x98: // array (one-byte uint8_t for n follows) + { + std::uint8_t len; + return get_number(input_format_t::cbor, len) and get_cbor_array(static_cast<std::size_t>(len)); + } + + case 0x99: // array (two-byte uint16_t for n follow) + { + std::uint16_t len; + return get_number(input_format_t::cbor, len) and get_cbor_array(static_cast<std::size_t>(len)); + } + + case 0x9A: // array (four-byte uint32_t for n follow) + { + std::uint32_t len; + return get_number(input_format_t::cbor, len) and get_cbor_array(static_cast<std::size_t>(len)); + } + + case 0x9B: // array (eight-byte uint64_t for n follow) + { + std::uint64_t len; + return get_number(input_format_t::cbor, len) and get_cbor_array(static_cast<std::size_t>(len)); + } + + case 0x9F: // array (indefinite length) + return get_cbor_array(std::size_t(-1)); + + // map (0x00..0x17 pairs of data items follow) + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + return get_cbor_object(static_cast<std::size_t>(static_cast<unsigned int>(current) & 0x1Fu)); + + case 0xB8: // map (one-byte uint8_t for n follows) + { + std::uint8_t len; + return get_number(input_format_t::cbor, len) and get_cbor_object(static_cast<std::size_t>(len)); + } + + case 0xB9: // map (two-byte uint16_t for n follow) + { + std::uint16_t len; + return get_number(input_format_t::cbor, len) and get_cbor_object(static_cast<std::size_t>(len)); + } + + case 0xBA: // map (four-byte uint32_t for n follow) + { + std::uint32_t len; + return get_number(input_format_t::cbor, len) and get_cbor_object(static_cast<std::size_t>(len)); + } + + case 0xBB: // map (eight-byte uint64_t for n follow) + { + std::uint64_t len; + return get_number(input_format_t::cbor, len) and get_cbor_object(static_cast<std::size_t>(len)); + } + + case 0xBF: // map (indefinite length) + return get_cbor_object(std::size_t(-1)); + + case 0xF4: // false + return sax->boolean(false); + + case 0xF5: // true + return sax->boolean(true); + + case 0xF6: // null + return sax->null(); + + case 0xF9: // Half-Precision Float (two-byte IEEE 754) + { + const int byte1_raw = get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + { + return false; + } + const int byte2_raw = get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "number"))) + { + return false; + } + + const auto byte1 = static_cast<unsigned char>(byte1_raw); + const auto byte2 = static_cast<unsigned char>(byte2_raw); + + // code from RFC 7049, Appendix D, Figure 3: + // As half-precision floating-point numbers were only added + // to IEEE 754 in 2008, today's programming platforms often + // still only have limited support for them. It is very + // easy to include at least decoding support for them even + // without such support. An example of a small decoder for + // half-precision floating-point numbers in the C language + // is shown in Fig. 3. + const auto half = static_cast<unsigned int>((byte1 << 8u) + byte2); + const double val = [&half] + { + const int exp = (half >> 10u) & 0x1Fu; + const unsigned int mant = half & 0x3FFu; + assert(0 <= exp and exp <= 32); + assert(mant <= 1024); + switch (exp) + { + case 0: + return std::ldexp(mant, -24); + case 31: + return (mant == 0) + ? std::numeric_limits<double>::infinity() + : std::numeric_limits<double>::quiet_NaN(); + default: + return std::ldexp(mant + 1024, exp - 25); + } + }(); + return sax->number_float((half & 0x8000u) != 0 + ? static_cast<number_float_t>(-val) + : static_cast<number_float_t>(val), ""); + } + + case 0xFA: // Single-Precision Float (four-byte IEEE 754) + { + float number; + return get_number(input_format_t::cbor, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + case 0xFB: // Double-Precision Float (eight-byte IEEE 754) + { + double number; + return get_number(input_format_t::cbor, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + default: // anything else (0xFF is handled inside the other types) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::cbor, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @brief reads a CBOR string + + This function first reads starting bytes to determine the expected + string length and then copies this number of bytes into a string. + Additionally, CBOR's strings with indefinite lengths are supported. + + @param[out] result created string + + @return whether string creation completed + */ + bool get_cbor_string(string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "string"))) + { + return false; + } + + switch (current) + { + // UTF-8 string (0x00..0x17 bytes follow) + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + { + return get_string(input_format_t::cbor, static_cast<unsigned int>(current) & 0x1Fu, result); + } + + case 0x78: // UTF-8 string (one-byte uint8_t for n follows) + { + std::uint8_t len; + return get_number(input_format_t::cbor, len) and get_string(input_format_t::cbor, len, result); + } + + case 0x79: // UTF-8 string (two-byte uint16_t for n follow) + { + std::uint16_t len; + return get_number(input_format_t::cbor, len) and get_string(input_format_t::cbor, len, result); + } + + case 0x7A: // UTF-8 string (four-byte uint32_t for n follow) + { + std::uint32_t len; + return get_number(input_format_t::cbor, len) and get_string(input_format_t::cbor, len, result); + } + + case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow) + { + std::uint64_t len; + return get_number(input_format_t::cbor, len) and get_string(input_format_t::cbor, len, result); + } + + case 0x7F: // UTF-8 string (indefinite length) + { + while (get() != 0xFF) + { + string_t chunk; + if (not get_cbor_string(chunk)) + { + return false; + } + result.append(chunk); + } + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::cbor, "expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x" + last_token, "string"))); + } + } + } + + /*! + @brief reads a CBOR byte array + + This function first reads starting bytes to determine the expected + byte array length and then copies this number of bytes into the byte array. + Additionally, CBOR's byte arrays with indefinite lengths are supported. + + @param[out] result created byte array + + @return whether byte array creation completed + */ + bool get_cbor_binary(internal_binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::cbor, "binary"))) + { + return false; + } + + switch (current) + { + // Binary data (0x00..0x17 bytes follow) + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + { + return get_binary(input_format_t::cbor, static_cast<unsigned int>(current) & 0x1Fu, result); + } + + case 0x58: // Binary data (one-byte uint8_t for n follows) + { + std::uint8_t len; + return get_number(input_format_t::cbor, len) and get_binary(input_format_t::cbor, len, result); + } + + case 0x59: // Binary data (two-byte uint16_t for n follow) + { + std::uint16_t len; + return get_number(input_format_t::cbor, len) and get_binary(input_format_t::cbor, len, result); + } + + case 0x5A: // Binary data (four-byte uint32_t for n follow) + { + std::uint32_t len; + return get_number(input_format_t::cbor, len) and get_binary(input_format_t::cbor, len, result); + } + + case 0x5B: // Binary data (eight-byte uint64_t for n follow) + { + std::uint64_t len; + return get_number(input_format_t::cbor, len) and get_binary(input_format_t::cbor, len, result); + } + + case 0x5F: // Binary data (indefinite length) + { + while (get() != 0xFF) + { + internal_binary_t chunk; + if (not get_cbor_binary(chunk)) + { + return false; + } + result.insert(result.end(), chunk.begin(), chunk.end()); + } + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::cbor, "expected length specification (0x40-0x5B) or indefinite binary array type (0x5F); last byte: 0x" + last_token, "binary"))); + } + } + } + + /*! + @param[in] len the length of the array or std::size_t(-1) for an + array of indefinite size + @return whether array creation completed + */ + bool get_cbor_array(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) + { + return false; + } + + if (len != std::size_t(-1)) + { + for (std::size_t i = 0; i < len; ++i) + { + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + { + return false; + } + } + } + else + { + while (get() != 0xFF) + { + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal(false))) + { + return false; + } + } + } + + return sax->end_array(); + } + + /*! + @param[in] len the length of the object or std::size_t(-1) for an + object of indefinite size + @return whether object creation completed + */ + bool get_cbor_object(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) + { + return false; + } + + string_t key; + if (len != std::size_t(-1)) + { + for (std::size_t i = 0; i < len; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + { + return false; + } + key.clear(); + } + } + else + { + while (get() != 0xFF) + { + if (JSON_HEDLEY_UNLIKELY(not get_cbor_string(key) or not sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(not parse_cbor_internal())) + { + return false; + } + key.clear(); + } + } + + return sax->end_object(); + } + + ///////////// + // MsgPack // + ///////////// + + /*! + @return whether a valid MessagePack value was passed to the SAX parser + */ + bool parse_msgpack_internal() + { + switch (get()) + { + // EOF + case std::char_traits<char>::eof(): + return unexpect_eof(input_format_t::msgpack, "value"); + + // positive fixint + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3A: + case 0x3B: + case 0x3C: + case 0x3D: + case 0x3E: + case 0x3F: + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5C: + case 0x5D: + case 0x5E: + case 0x5F: + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + return sax->number_unsigned(static_cast<number_unsigned_t>(current)); + + // fixmap + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8A: + case 0x8B: + case 0x8C: + case 0x8D: + case 0x8E: + case 0x8F: + return get_msgpack_object(static_cast<std::size_t>(static_cast<unsigned int>(current) & 0x0Fu)); + + // fixarray + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + case 0x98: + case 0x99: + case 0x9A: + case 0x9B: + case 0x9C: + case 0x9D: + case 0x9E: + case 0x9F: + return get_msgpack_array(static_cast<std::size_t>(static_cast<unsigned int>(current) & 0x0Fu)); + + // fixstr + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + case 0xB8: + case 0xB9: + case 0xBA: + case 0xBB: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + case 0xD9: // str 8 + case 0xDA: // str 16 + case 0xDB: // str 32 + { + string_t s; + return get_msgpack_string(s) and sax->string(s); + } + + case 0xC0: // nil + return sax->null(); + + case 0xC2: // false + return sax->boolean(false); + + case 0xC3: // true + return sax->boolean(true); + + case 0xC4: // bin 8 + case 0xC5: // bin 16 + case 0xC6: // bin 32 + case 0xC7: // ext 8 + case 0xC8: // ext 16 + case 0xC9: // ext 32 + case 0xD4: // fixext 1 + case 0xD5: // fixext 2 + case 0xD6: // fixext 4 + case 0xD7: // fixext 8 + case 0xD8: // fixext 16 + { + internal_binary_t b; + return get_msgpack_binary(b) and sax->binary(b); + } + + case 0xCA: // float 32 + { + float number; + return get_number(input_format_t::msgpack, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + case 0xCB: // float 64 + { + double number; + return get_number(input_format_t::msgpack, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + case 0xCC: // uint 8 + { + std::uint8_t number; + return get_number(input_format_t::msgpack, number) and sax->number_unsigned(number); + } + + case 0xCD: // uint 16 + { + std::uint16_t number; + return get_number(input_format_t::msgpack, number) and sax->number_unsigned(number); + } + + case 0xCE: // uint 32 + { + std::uint32_t number; + return get_number(input_format_t::msgpack, number) and sax->number_unsigned(number); + } + + case 0xCF: // uint 64 + { + std::uint64_t number; + return get_number(input_format_t::msgpack, number) and sax->number_unsigned(number); + } + + case 0xD0: // int 8 + { + std::int8_t number; + return get_number(input_format_t::msgpack, number) and sax->number_integer(number); + } + + case 0xD1: // int 16 + { + std::int16_t number; + return get_number(input_format_t::msgpack, number) and sax->number_integer(number); + } + + case 0xD2: // int 32 + { + std::int32_t number; + return get_number(input_format_t::msgpack, number) and sax->number_integer(number); + } + + case 0xD3: // int 64 + { + std::int64_t number; + return get_number(input_format_t::msgpack, number) and sax->number_integer(number); + } + + case 0xDC: // array 16 + { + std::uint16_t len; + return get_number(input_format_t::msgpack, len) and get_msgpack_array(static_cast<std::size_t>(len)); + } + + case 0xDD: // array 32 + { + std::uint32_t len; + return get_number(input_format_t::msgpack, len) and get_msgpack_array(static_cast<std::size_t>(len)); + } + + case 0xDE: // map 16 + { + std::uint16_t len; + return get_number(input_format_t::msgpack, len) and get_msgpack_object(static_cast<std::size_t>(len)); + } + + case 0xDF: // map 32 + { + std::uint32_t len; + return get_number(input_format_t::msgpack, len) and get_msgpack_object(static_cast<std::size_t>(len)); + } + + // negative fixint + case 0xE0: + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xED: + case 0xEE: + case 0xEF: + case 0xF0: + case 0xF1: + case 0xF2: + case 0xF3: + case 0xF4: + case 0xF5: + case 0xF6: + case 0xF7: + case 0xF8: + case 0xF9: + case 0xFA: + case 0xFB: + case 0xFC: + case 0xFD: + case 0xFE: + case 0xFF: + return sax->number_integer(static_cast<std::int8_t>(current)); + + default: // anything else + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::msgpack, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @brief reads a MessagePack string + + This function first reads starting bytes to determine the expected + string length and then copies this number of bytes into a string. + + @param[out] result created string + + @return whether string creation completed + */ + bool get_msgpack_string(string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "string"))) + { + return false; + } + + switch (current) + { + // fixstr + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + case 0xB8: + case 0xB9: + case 0xBA: + case 0xBB: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + { + return get_string(input_format_t::msgpack, static_cast<unsigned int>(current) & 0x1Fu, result); + } + + case 0xD9: // str 8 + { + std::uint8_t len; + return get_number(input_format_t::msgpack, len) and get_string(input_format_t::msgpack, len, result); + } + + case 0xDA: // str 16 + { + std::uint16_t len; + return get_number(input_format_t::msgpack, len) and get_string(input_format_t::msgpack, len, result); + } + + case 0xDB: // str 32 + { + std::uint32_t len; + return get_number(input_format_t::msgpack, len) and get_string(input_format_t::msgpack, len, result); + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::msgpack, "expected length specification (0xA0-0xBF, 0xD9-0xDB); last byte: 0x" + last_token, "string"))); + } + } + } + + /*! + @brief reads a MessagePack byte array + + This function first reads starting bytes to determine the expected + byte array length and then copies this number of bytes into a byte array. + + @param[out] result created byte array + + @return whether byte array creation completed + */ + bool get_msgpack_binary(internal_binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::msgpack, "binary"))) + { + return false; + } + + switch (current) + { + case 0xC4: // bin 8 + { + std::uint8_t len; + return get_number(input_format_t::msgpack, len) and get_binary(input_format_t::msgpack, len, result); + } + + case 0xC5: // bin 16 + { + std::uint16_t len; + return get_number(input_format_t::msgpack, len) and get_binary(input_format_t::msgpack, len, result); + } + + case 0xC6: // bin 32 + { + std::uint32_t len; + return get_number(input_format_t::msgpack, len) and get_binary(input_format_t::msgpack, len, result); + } + + case 0xC7: // ext 8 + { + std::uint8_t len; + result.has_subtype = true; + return get_number(input_format_t::msgpack, len) and + get_number(input_format_t::msgpack, result.subtype) and + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC8: // ext 16 + { + std::uint16_t len; + result.has_subtype = true; + return get_number(input_format_t::msgpack, len) and + get_number(input_format_t::msgpack, result.subtype) and + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC9: // ext 32 + { + std::uint32_t len; + result.has_subtype = true; + return get_number(input_format_t::msgpack, len) and + get_number(input_format_t::msgpack, result.subtype) and + get_binary(input_format_t::msgpack, len, result); + } + + case 0xD4: // fixext 1 + { + result.has_subtype = true; + return get_number(input_format_t::msgpack, result.subtype) and get_binary(input_format_t::msgpack, 1, result); + } + + case 0xD5: // fixext 2 + { + result.has_subtype = true; + return get_number(input_format_t::msgpack, result.subtype) and get_binary(input_format_t::msgpack, 2, result); + } + + case 0xD6: // fixext 4 + { + result.has_subtype = true; + return get_number(input_format_t::msgpack, result.subtype) and get_binary(input_format_t::msgpack, 4, result); + } + + case 0xD7: // fixext 8 + { + result.has_subtype = true; + return get_number(input_format_t::msgpack, result.subtype) and get_binary(input_format_t::msgpack, 8, result); + } + + case 0xD8: // fixext 16 + { + result.has_subtype = true; + return get_number(input_format_t::msgpack, result.subtype) and get_binary(input_format_t::msgpack, 16, result); + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::msgpack, "expected binary type specification (0xC4-0xC9, 0xD4-0xD8); last byte: 0x" + last_token, "binary"))); + } + } + } + + /*! + @param[in] len the length of the array + @return whether array creation completed + */ + bool get_msgpack_array(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(len))) + { + return false; + } + + for (std::size_t i = 0; i < len; ++i) + { + if (JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) + { + return false; + } + } + + return sax->end_array(); + } + + /*! + @param[in] len the length of the object + @return whether object creation completed + */ + bool get_msgpack_object(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(len))) + { + return false; + } + + string_t key; + for (std::size_t i = 0; i < len; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(not get_msgpack_string(key) or not sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(not parse_msgpack_internal())) + { + return false; + } + key.clear(); + } + + return sax->end_object(); + } + + //////////// + // UBJSON // + //////////// + + /*! + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether a valid UBJSON value was passed to the SAX parser + */ + bool parse_ubjson_internal(const bool get_char = true) + { + return get_ubjson_value(get_char ? get_ignore_noop() : current); + } + + /*! + @brief reads a UBJSON string + + This function is either called after reading the 'S' byte explicitly + indicating a string, or in case of an object key where the 'S' byte can be + left out. + + @param[out] result created string + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether string creation completed + */ + bool get_ubjson_string(string_t& result, const bool get_char = true) + { + if (get_char) + { + get(); // TODO(niels): may we ignore N here? + } + + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + { + return false; + } + + switch (current) + { + case 'U': + { + std::uint8_t len; + return get_number(input_format_t::ubjson, len) and get_string(input_format_t::ubjson, len, result); + } + + case 'i': + { + std::int8_t len; + return get_number(input_format_t::ubjson, len) and get_string(input_format_t::ubjson, len, result); + } + + case 'I': + { + std::int16_t len; + return get_number(input_format_t::ubjson, len) and get_string(input_format_t::ubjson, len, result); + } + + case 'l': + { + std::int32_t len; + return get_number(input_format_t::ubjson, len) and get_string(input_format_t::ubjson, len, result); + } + + case 'L': + { + std::int64_t len; + return get_number(input_format_t::ubjson, len) and get_string(input_format_t::ubjson, len, result); + } + + default: + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "expected length type specification (U, i, I, l, L); last byte: 0x" + last_token, "string"))); + } + } + + /*! + @param[out] result determined size + @return whether size determination completed + */ + bool get_ubjson_size_value(std::size_t& result) + { + switch (get_ignore_noop()) + { + case 'U': + { + std::uint8_t number; + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast<std::size_t>(number); + return true; + } + + case 'i': + { + std::int8_t number; + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast<std::size_t>(number); + return true; + } + + case 'I': + { + std::int16_t number; + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast<std::size_t>(number); + return true; + } + + case 'l': + { + std::int32_t number; + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast<std::size_t>(number); + return true; + } + + case 'L': + { + std::int64_t number; + if (JSON_HEDLEY_UNLIKELY(not get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast<std::size_t>(number); + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "expected length type specification (U, i, I, l, L) after '#'; last byte: 0x" + last_token, "size"))); + } + } + } + + /*! + @brief determine the type and size for a container + + In the optimized UBJSON format, a type and a size can be provided to allow + for a more compact representation. + + @param[out] result pair of the size and the type + + @return whether pair creation completed + */ + bool get_ubjson_size_type(std::pair<std::size_t, int>& result) + { + result.first = string_t::npos; // size + result.second = 0; // type + + get_ignore_noop(); + + if (current == '$') + { + result.second = get(); // must not ignore 'N', because 'N' maybe the type + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "type"))) + { + return false; + } + + get_ignore_noop(); + if (JSON_HEDLEY_UNLIKELY(current != '#')) + { + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "value"))) + { + return false; + } + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "expected '#' after type information; last byte: 0x" + last_token, "size"))); + } + + return get_ubjson_size_value(result.first); + } + + if (current == '#') + { + return get_ubjson_size_value(result.first); + } + + return true; + } + + /*! + @param prefix the previously read or set type prefix + @return whether value creation completed + */ + bool get_ubjson_value(const int prefix) + { + switch (prefix) + { + case std::char_traits<char>::eof(): // EOF + return unexpect_eof(input_format_t::ubjson, "value"); + + case 'T': // true + return sax->boolean(true); + case 'F': // false + return sax->boolean(false); + + case 'Z': // null + return sax->null(); + + case 'U': + { + std::uint8_t number; + return get_number(input_format_t::ubjson, number) and sax->number_unsigned(number); + } + + case 'i': + { + std::int8_t number; + return get_number(input_format_t::ubjson, number) and sax->number_integer(number); + } + + case 'I': + { + std::int16_t number; + return get_number(input_format_t::ubjson, number) and sax->number_integer(number); + } + + case 'l': + { + std::int32_t number; + return get_number(input_format_t::ubjson, number) and sax->number_integer(number); + } + + case 'L': + { + std::int64_t number; + return get_number(input_format_t::ubjson, number) and sax->number_integer(number); + } + + case 'd': + { + float number; + return get_number(input_format_t::ubjson, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + case 'D': + { + double number; + return get_number(input_format_t::ubjson, number) and sax->number_float(static_cast<number_float_t>(number), ""); + } + + case 'C': // char + { + get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(input_format_t::ubjson, "char"))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(current > 127)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); + } + string_t s(1, static_cast<char>(current)); + return sax->string(s); + } + + case 'S': // string + { + string_t s; + return get_ubjson_string(s) and sax->string(s); + } + + case '[': // array + return get_ubjson_array(); + + case '{': // object + return get_ubjson_object(); + + default: // anything else + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @return whether array creation completed + */ + bool get_ubjson_array() + { + std::pair<std::size_t, int> size_and_type; + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + { + return false; + } + + if (size_and_type.first != string_t::npos) + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(size_and_type.first))) + { + return false; + } + + if (size_and_type.second != 0) + { + if (size_and_type.second != 'N') + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + { + return false; + } + } + } + } + else + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + { + return false; + } + } + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + { + return false; + } + + while (current != ']') + { + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal(false))) + { + return false; + } + get_ignore_noop(); + } + } + + return sax->end_array(); + } + + /*! + @return whether object creation completed + */ + bool get_ubjson_object() + { + std::pair<std::size_t, int> size_and_type; + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_size_type(size_and_type))) + { + return false; + } + + string_t key; + if (size_and_type.first != string_t::npos) + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(size_and_type.first))) + { + return false; + } + + if (size_and_type.second != 0) + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_value(size_and_type.second))) + { + return false; + } + key.clear(); + } + } + else + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key) or not sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + { + return false; + } + key.clear(); + } + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + { + return false; + } + + while (current != '}') + { + if (JSON_HEDLEY_UNLIKELY(not get_ubjson_string(key, false) or not sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(not parse_ubjson_internal())) + { + return false; + } + get_ignore_noop(); + key.clear(); + } + } + + return sax->end_object(); + } + + // Note, no reader for UBJSON binary types is implemented because they do + // not exist + + /////////////////////// + // Utility functions // + /////////////////////// + + /*! + @brief get next character from the input + + This function provides the interface to the used input adapter. It does + not throw in case the input reached EOF, but returns a -'ve valued + `std::char_traits<char>::eof()` in that case. + + @return character read from the input + */ + int get() + { + ++chars_read; + return current = ia->get_character(); + } + + /*! + @return character read from the input after ignoring all 'N' entries + */ + int get_ignore_noop() + { + do + { + get(); + } + while (current == 'N'); + + return current; + } + + /* + @brief read a number from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[out] result number of type @a NumberType + + @return whether conversion completed + + @note This function needs to respect the system's endianess, because + bytes in CBOR, MessagePack, and UBJSON are stored in network order + (big endian) and therefore need reordering on little endian systems. + */ + template<typename NumberType, bool InputIsLittleEndian = false> + bool get_number(const input_format_t format, NumberType& result) + { + // step 1: read input into array with system's byte order + std::array<std::uint8_t, sizeof(NumberType)> vec; + for (std::size_t i = 0; i < sizeof(NumberType); ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "number"))) + { + return false; + } + + // reverse byte order prior to conversion if necessary + if (is_little_endian != InputIsLittleEndian) + { + vec[sizeof(NumberType) - i - 1] = static_cast<std::uint8_t>(current); + } + else + { + vec[i] = static_cast<std::uint8_t>(current); // LCOV_EXCL_LINE + } + } + + // step 2: convert array into number of type T and return + std::memcpy(&result, vec.data(), sizeof(NumberType)); + return true; + } + + /*! + @brief create a string by reading characters from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[in] len number of characters to read + @param[out] result string created by reading @a len bytes + + @return whether string creation completed + + @note We can not reserve @a len bytes for the result, because @a len + may be too large. Usually, @ref unexpect_eof() detects the end of + the input before we run out of string memory. + */ + template<typename NumberType> + bool get_string(const input_format_t format, + const NumberType len, + string_t& result) + { + bool success = true; + std::generate_n(std::back_inserter(result), len, [this, &success, &format]() + { + get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "string"))) + { + success = false; + } + return static_cast<char>(current); + }); + return success; + } + + /*! + @brief create a byte array by reading bytes from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[in] len number of bytes to read + @param[out] result byte array created by reading @a len bytes + + @return whether byte array creation completed + + @note We can not reserve @a len bytes for the result, because @a len + may be too large. Usually, @ref unexpect_eof() detects the end of + the input before we run out of memory. + */ + template<typename NumberType> + bool get_binary(const input_format_t format, + const NumberType len, + internal_binary_t& result) + { + bool success = true; + std::generate_n(std::back_inserter(result), len, [this, &success, &format]() + { + get(); + if (JSON_HEDLEY_UNLIKELY(not unexpect_eof(format, "binary"))) + { + success = false; + } + return static_cast<uint8_t>(current); + }); + return success; + } + + /*! + @param[in] format the current format (for diagnostics) + @param[in] context further context information (for diagnostics) + @return whether the last read character is not EOF + */ + JSON_HEDLEY_NON_NULL(3) + bool unexpect_eof(const input_format_t format, const char* context) const + { + if (JSON_HEDLEY_UNLIKELY(current == std::char_traits<char>::eof())) + { + return sax->parse_error(chars_read, "<end of file>", + parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); + } + return true; + } + + /*! + @return a string representation of the last read byte + */ + std::string get_token_string() const + { + std::array<char, 3> cr{{}}; + (std::snprintf)(cr.data(), cr.size(), "%.2hhX", static_cast<unsigned char>(current)); + return std::string{cr.data()}; + } + + /*! + @param[in] format the current format + @param[in] detail a detailed error message + @param[in] context further context information + @return a message string to use in the parse_error exceptions + */ + std::string exception_message(const input_format_t format, + const std::string& detail, + const std::string& context) const + { + std::string error_msg = "syntax error while parsing "; + + switch (format) + { + case input_format_t::cbor: + error_msg += "CBOR"; + break; + + case input_format_t::msgpack: + error_msg += "MessagePack"; + break; + + case input_format_t::ubjson: + error_msg += "UBJSON"; + break; + + case input_format_t::bson: + error_msg += "BSON"; + break; + + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + + return error_msg + " " + context + ": " + detail; + } + + private: + /// input adapter + input_adapter_t ia = nullptr; + + /// the current character + int current = std::char_traits<char>::eof(); + + /// the number of characters read + std::size_t chars_read = 0; + + /// whether we can assume little endianess + const bool is_little_endian = little_endianess(); + + /// the SAX parser + json_sax_t* sax = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/input/input_adapters.hpp> + +// #include <nlohmann/detail/input/lexer.hpp> + + +#include <array> // array +#include <clocale> // localeconv +#include <cstddef> // size_t +#include <cstdio> // snprintf +#include <cstdlib> // strtof, strtod, strtold, strtoll, strtoull +#include <initializer_list> // initializer_list +#include <string> // char_traits, string +#include <utility> // move +#include <vector> // vector + +// #include <nlohmann/detail/input/input_adapters.hpp> + +// #include <nlohmann/detail/input/position_t.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + + +namespace nlohmann +{ +namespace detail +{ +/////////// +// lexer // +/////////// + +/*! +@brief lexical analysis + +This class organizes the lexical analysis during JSON deserialization. +*/ +template<typename BasicJsonType> +class lexer +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + + public: + /// token types for the parser + enum class token_type + { + uninitialized, ///< indicating the scanner is uninitialized + literal_true, ///< the `true` literal + literal_false, ///< the `false` literal + literal_null, ///< the `null` literal + value_string, ///< a string -- use get_string() for actual value + value_unsigned, ///< an unsigned integer -- use get_number_unsigned() for actual value + value_integer, ///< a signed integer -- use get_number_integer() for actual value + value_float, ///< an floating point number -- use get_number_float() for actual value + begin_array, ///< the character for array begin `[` + begin_object, ///< the character for object begin `{` + end_array, ///< the character for array end `]` + end_object, ///< the character for object end `}` + name_separator, ///< the name separator `:` + value_separator, ///< the value separator `,` + parse_error, ///< indicating a parse error + end_of_input, ///< indicating the end of the input buffer + literal_or_value ///< a literal or the begin of a value (only for diagnostics) + }; + + /// return name of values of type token_type (only used for errors) + JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_CONST + static const char* token_type_name(const token_type t) noexcept + { + switch (t) + { + case token_type::uninitialized: + return "<uninitialized>"; + case token_type::literal_true: + return "true literal"; + case token_type::literal_false: + return "false literal"; + case token_type::literal_null: + return "null literal"; + case token_type::value_string: + return "string literal"; + case lexer::token_type::value_unsigned: + case lexer::token_type::value_integer: + case lexer::token_type::value_float: + return "number literal"; + case token_type::begin_array: + return "'['"; + case token_type::begin_object: + return "'{'"; + case token_type::end_array: + return "']'"; + case token_type::end_object: + return "'}'"; + case token_type::name_separator: + return "':'"; + case token_type::value_separator: + return "','"; + case token_type::parse_error: + return "<parse error>"; + case token_type::end_of_input: + return "end of input"; + case token_type::literal_or_value: + return "'[', '{', or a literal"; + // LCOV_EXCL_START + default: // catch non-enum values + return "unknown token"; + // LCOV_EXCL_STOP + } + } + + explicit lexer(detail::input_adapter_t&& adapter) + : ia(std::move(adapter)), decimal_point_char(get_decimal_point()) {} + + // delete because of pointer members + lexer(const lexer&) = delete; + lexer(lexer&&) = delete; + lexer& operator=(lexer&) = delete; + lexer& operator=(lexer&&) = delete; + ~lexer() = default; + + private: + ///////////////////// + // locales + ///////////////////// + + /// return the locale-dependent decimal point + JSON_HEDLEY_PURE + static char get_decimal_point() noexcept + { + const auto loc = localeconv(); + assert(loc != nullptr); + return (loc->decimal_point == nullptr) ? '.' : *(loc->decimal_point); + } + + ///////////////////// + // scan functions + ///////////////////// + + /*! + @brief get codepoint from 4 hex characters following `\u` + + For input "\u c1 c2 c3 c4" the codepoint is: + (c1 * 0x1000) + (c2 * 0x0100) + (c3 * 0x0010) + c4 + = (c1 << 12) + (c2 << 8) + (c3 << 4) + (c4 << 0) + + Furthermore, the possible characters '0'..'9', 'A'..'F', and 'a'..'f' + must be converted to the integers 0x0..0x9, 0xA..0xF, 0xA..0xF, resp. The + conversion is done by subtracting the offset (0x30, 0x37, and 0x57) + between the ASCII value of the character and the desired integer value. + + @return codepoint (0x0000..0xFFFF) or -1 in case of an error (e.g. EOF or + non-hex character) + */ + int get_codepoint() + { + // this function only makes sense after reading `\u` + assert(current == 'u'); + int codepoint = 0; + + const auto factors = { 12u, 8u, 4u, 0u }; + for (const auto factor : factors) + { + get(); + + if (current >= '0' and current <= '9') + { + codepoint += static_cast<int>((static_cast<unsigned int>(current) - 0x30u) << factor); + } + else if (current >= 'A' and current <= 'F') + { + codepoint += static_cast<int>((static_cast<unsigned int>(current) - 0x37u) << factor); + } + else if (current >= 'a' and current <= 'f') + { + codepoint += static_cast<int>((static_cast<unsigned int>(current) - 0x57u) << factor); + } + else + { + return -1; + } + } + + assert(0x0000 <= codepoint and codepoint <= 0xFFFF); + return codepoint; + } + + /*! + @brief check if the next byte(s) are inside a given range + + Adds the current byte and, for each passed range, reads a new byte and + checks if it is inside the range. If a violation was detected, set up an + error message and return false. Otherwise, return true. + + @param[in] ranges list of integers; interpreted as list of pairs of + inclusive lower and upper bound, respectively + + @pre The passed list @a ranges must have 2, 4, or 6 elements; that is, + 1, 2, or 3 pairs. This precondition is enforced by an assertion. + + @return true if and only if no range violation was detected + */ + bool next_byte_in_range(std::initializer_list<int> ranges) + { + assert(ranges.size() == 2 or ranges.size() == 4 or ranges.size() == 6); + add(current); + + for (auto range = ranges.begin(); range != ranges.end(); ++range) + { + get(); + if (JSON_HEDLEY_LIKELY(*range <= current and current <= *(++range))) + { + add(current); + } + else + { + error_message = "invalid string: ill-formed UTF-8 byte"; + return false; + } + } + + return true; + } + + /*! + @brief scan a string literal + + This function scans a string according to Sect. 7 of RFC 7159. While + scanning, bytes are escaped and copied into buffer token_buffer. Then the + function returns successfully, token_buffer is *not* null-terminated (as it + may contain \0 bytes), and token_buffer.size() is the number of bytes in the + string. + + @return token_type::value_string if string could be successfully scanned, + token_type::parse_error otherwise + + @note In case of errors, variable error_message contains a textual + description. + */ + token_type scan_string() + { + // reset token_buffer (ignore opening quote) + reset(); + + // we entered the function by reading an open quote + assert(current == '\"'); + + while (true) + { + // get next character + switch (get()) + { + // end of file while parsing string + case std::char_traits<char>::eof(): + { + error_message = "invalid string: missing closing quote"; + return token_type::parse_error; + } + + // closing quote + case '\"': + { + return token_type::value_string; + } + + // escapes + case '\\': + { + switch (get()) + { + // quotation mark + case '\"': + add('\"'); + break; + // reverse solidus + case '\\': + add('\\'); + break; + // solidus + case '/': + add('/'); + break; + // backspace + case 'b': + add('\b'); + break; + // form feed + case 'f': + add('\f'); + break; + // line feed + case 'n': + add('\n'); + break; + // carriage return + case 'r': + add('\r'); + break; + // tab + case 't': + add('\t'); + break; + + // unicode escapes + case 'u': + { + const int codepoint1 = get_codepoint(); + int codepoint = codepoint1; // start with codepoint1 + + if (JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) + { + error_message = "invalid string: '\\u' must be followed by 4 hex digits"; + return token_type::parse_error; + } + + // check if code point is a high surrogate + if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF) + { + // expect next \uxxxx entry + if (JSON_HEDLEY_LIKELY(get() == '\\' and get() == 'u')) + { + const int codepoint2 = get_codepoint(); + + if (JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) + { + error_message = "invalid string: '\\u' must be followed by 4 hex digits"; + return token_type::parse_error; + } + + // check if codepoint2 is a low surrogate + if (JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF)) + { + // overwrite codepoint + codepoint = static_cast<int>( + // high surrogate occupies the most significant 22 bits + (static_cast<unsigned int>(codepoint1) << 10u) + // low surrogate occupies the least significant 15 bits + + static_cast<unsigned int>(codepoint2) + // there is still the 0xD800, 0xDC00 and 0x10000 noise + // in the result so we have to subtract with: + // (0xD800 << 10) + DC00 - 0x10000 = 0x35FDC00 + - 0x35FDC00u); + } + else + { + error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF"; + return token_type::parse_error; + } + } + else + { + error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF"; + return token_type::parse_error; + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF)) + { + error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; + return token_type::parse_error; + } + } + + // result of the above calculation yields a proper codepoint + assert(0x00 <= codepoint and codepoint <= 0x10FFFF); + + // translate codepoint into bytes + if (codepoint < 0x80) + { + // 1-byte characters: 0xxxxxxx (ASCII) + add(codepoint); + } + else if (codepoint <= 0x7FF) + { + // 2-byte characters: 110xxxxx 10xxxxxx + add(static_cast<int>(0xC0u | (static_cast<unsigned int>(codepoint) >> 6u))); + add(static_cast<int>(0x80u | (static_cast<unsigned int>(codepoint) & 0x3Fu))); + } + else if (codepoint <= 0xFFFF) + { + // 3-byte characters: 1110xxxx 10xxxxxx 10xxxxxx + add(static_cast<int>(0xE0u | (static_cast<unsigned int>(codepoint) >> 12u))); + add(static_cast<int>(0x80u | ((static_cast<unsigned int>(codepoint) >> 6u) & 0x3Fu))); + add(static_cast<int>(0x80u | (static_cast<unsigned int>(codepoint) & 0x3Fu))); + } + else + { + // 4-byte characters: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + add(static_cast<int>(0xF0u | (static_cast<unsigned int>(codepoint) >> 18u))); + add(static_cast<int>(0x80u | ((static_cast<unsigned int>(codepoint) >> 12u) & 0x3Fu))); + add(static_cast<int>(0x80u | ((static_cast<unsigned int>(codepoint) >> 6u) & 0x3Fu))); + add(static_cast<int>(0x80u | (static_cast<unsigned int>(codepoint) & 0x3Fu))); + } + + break; + } + + // other characters after escape + default: + error_message = "invalid string: forbidden character after backslash"; + return token_type::parse_error; + } + + break; + } + + // invalid control characters + case 0x00: + { + error_message = "invalid string: control character U+0000 (NUL) must be escaped to \\u0000"; + return token_type::parse_error; + } + + case 0x01: + { + error_message = "invalid string: control character U+0001 (SOH) must be escaped to \\u0001"; + return token_type::parse_error; + } + + case 0x02: + { + error_message = "invalid string: control character U+0002 (STX) must be escaped to \\u0002"; + return token_type::parse_error; + } + + case 0x03: + { + error_message = "invalid string: control character U+0003 (ETX) must be escaped to \\u0003"; + return token_type::parse_error; + } + + case 0x04: + { + error_message = "invalid string: control character U+0004 (EOT) must be escaped to \\u0004"; + return token_type::parse_error; + } + + case 0x05: + { + error_message = "invalid string: control character U+0005 (ENQ) must be escaped to \\u0005"; + return token_type::parse_error; + } + + case 0x06: + { + error_message = "invalid string: control character U+0006 (ACK) must be escaped to \\u0006"; + return token_type::parse_error; + } + + case 0x07: + { + error_message = "invalid string: control character U+0007 (BEL) must be escaped to \\u0007"; + return token_type::parse_error; + } + + case 0x08: + { + error_message = "invalid string: control character U+0008 (BS) must be escaped to \\u0008 or \\b"; + return token_type::parse_error; + } + + case 0x09: + { + error_message = "invalid string: control character U+0009 (HT) must be escaped to \\u0009 or \\t"; + return token_type::parse_error; + } + + case 0x0A: + { + error_message = "invalid string: control character U+000A (LF) must be escaped to \\u000A or \\n"; + return token_type::parse_error; + } + + case 0x0B: + { + error_message = "invalid string: control character U+000B (VT) must be escaped to \\u000B"; + return token_type::parse_error; + } + + case 0x0C: + { + error_message = "invalid string: control character U+000C (FF) must be escaped to \\u000C or \\f"; + return token_type::parse_error; + } + + case 0x0D: + { + error_message = "invalid string: control character U+000D (CR) must be escaped to \\u000D or \\r"; + return token_type::parse_error; + } + + case 0x0E: + { + error_message = "invalid string: control character U+000E (SO) must be escaped to \\u000E"; + return token_type::parse_error; + } + + case 0x0F: + { + error_message = "invalid string: control character U+000F (SI) must be escaped to \\u000F"; + return token_type::parse_error; + } + + case 0x10: + { + error_message = "invalid string: control character U+0010 (DLE) must be escaped to \\u0010"; + return token_type::parse_error; + } + + case 0x11: + { + error_message = "invalid string: control character U+0011 (DC1) must be escaped to \\u0011"; + return token_type::parse_error; + } + + case 0x12: + { + error_message = "invalid string: control character U+0012 (DC2) must be escaped to \\u0012"; + return token_type::parse_error; + } + + case 0x13: + { + error_message = "invalid string: control character U+0013 (DC3) must be escaped to \\u0013"; + return token_type::parse_error; + } + + case 0x14: + { + error_message = "invalid string: control character U+0014 (DC4) must be escaped to \\u0014"; + return token_type::parse_error; + } + + case 0x15: + { + error_message = "invalid string: control character U+0015 (NAK) must be escaped to \\u0015"; + return token_type::parse_error; + } + + case 0x16: + { + error_message = "invalid string: control character U+0016 (SYN) must be escaped to \\u0016"; + return token_type::parse_error; + } + + case 0x17: + { + error_message = "invalid string: control character U+0017 (ETB) must be escaped to \\u0017"; + return token_type::parse_error; + } + + case 0x18: + { + error_message = "invalid string: control character U+0018 (CAN) must be escaped to \\u0018"; + return token_type::parse_error; + } + + case 0x19: + { + error_message = "invalid string: control character U+0019 (EM) must be escaped to \\u0019"; + return token_type::parse_error; + } + + case 0x1A: + { + error_message = "invalid string: control character U+001A (SUB) must be escaped to \\u001A"; + return token_type::parse_error; + } + + case 0x1B: + { + error_message = "invalid string: control character U+001B (ESC) must be escaped to \\u001B"; + return token_type::parse_error; + } + + case 0x1C: + { + error_message = "invalid string: control character U+001C (FS) must be escaped to \\u001C"; + return token_type::parse_error; + } + + case 0x1D: + { + error_message = "invalid string: control character U+001D (GS) must be escaped to \\u001D"; + return token_type::parse_error; + } + + case 0x1E: + { + error_message = "invalid string: control character U+001E (RS) must be escaped to \\u001E"; + return token_type::parse_error; + } + + case 0x1F: + { + error_message = "invalid string: control character U+001F (US) must be escaped to \\u001F"; + return token_type::parse_error; + } + + // U+0020..U+007F (except U+0022 (quote) and U+005C (backspace)) + case 0x20: + case 0x21: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3A: + case 0x3B: + case 0x3C: + case 0x3D: + case 0x3E: + case 0x3F: + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5D: + case 0x5E: + case 0x5F: + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + { + add(current); + break; + } + + // U+0080..U+07FF: bytes C2..DF 80..BF + case 0xC2: + case 0xC3: + case 0xC4: + case 0xC5: + case 0xC6: + case 0xC7: + case 0xC8: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCC: + case 0xCD: + case 0xCE: + case 0xCF: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD5: + case 0xD6: + case 0xD7: + case 0xD8: + case 0xD9: + case 0xDA: + case 0xDB: + case 0xDC: + case 0xDD: + case 0xDE: + case 0xDF: + { + if (JSON_HEDLEY_UNLIKELY(not next_byte_in_range({0x80, 0xBF}))) + { + return token_type::parse_error; + } + break; + } + + // U+0800..U+0FFF: bytes E0 A0..BF 80..BF + case 0xE0: + { + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+1000..U+CFFF: bytes E1..EC 80..BF 80..BF + // U+E000..U+FFFF: bytes EE..EF 80..BF 80..BF + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xEE: + case 0xEF: + { + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+D000..U+D7FF: bytes ED 80..9F 80..BF + case 0xED: + { + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF + case 0xF0: + { + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF + case 0xF1: + case 0xF2: + case 0xF3: + { + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF + case 0xF4: + { + if (JSON_HEDLEY_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // remaining bytes (80..C1 and F5..FF) are ill-formed + default: + { + error_message = "invalid string: ill-formed UTF-8 byte"; + return token_type::parse_error; + } + } + } + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(float& f, const char* str, char** endptr) noexcept + { + f = std::strtof(str, endptr); + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(double& f, const char* str, char** endptr) noexcept + { + f = std::strtod(str, endptr); + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(long double& f, const char* str, char** endptr) noexcept + { + f = std::strtold(str, endptr); + } + + /*! + @brief scan a number literal + + This function scans a string according to Sect. 6 of RFC 7159. + + The function is realized with a deterministic finite state machine derived + from the grammar described in RFC 7159. Starting in state "init", the + input is read and used to determined the next state. Only state "done" + accepts the number. State "error" is a trap state to model errors. In the + table below, "anything" means any character but the ones listed before. + + state | 0 | 1-9 | e E | + | - | . | anything + ---------|----------|----------|----------|---------|---------|----------|----------- + init | zero | any1 | [error] | [error] | minus | [error] | [error] + minus | zero | any1 | [error] | [error] | [error] | [error] | [error] + zero | done | done | exponent | done | done | decimal1 | done + any1 | any1 | any1 | exponent | done | done | decimal1 | done + decimal1 | decimal2 | decimal2 | [error] | [error] | [error] | [error] | [error] + decimal2 | decimal2 | decimal2 | exponent | done | done | done | done + exponent | any2 | any2 | [error] | sign | sign | [error] | [error] + sign | any2 | any2 | [error] | [error] | [error] | [error] | [error] + any2 | any2 | any2 | done | done | done | done | done + + The state machine is realized with one label per state (prefixed with + "scan_number_") and `goto` statements between them. The state machine + contains cycles, but any cycle can be left when EOF is read. Therefore, + the function is guaranteed to terminate. + + During scanning, the read bytes are stored in token_buffer. This string is + then converted to a signed integer, an unsigned integer, or a + floating-point number. + + @return token_type::value_unsigned, token_type::value_integer, or + token_type::value_float if number could be successfully scanned, + token_type::parse_error otherwise + + @note The scanner is independent of the current locale. Internally, the + locale's decimal point is used instead of `.` to work with the + locale-dependent converters. + */ + token_type scan_number() // lgtm [cpp/use-of-goto] + { + // reset token_buffer to store the number's bytes + reset(); + + // the type of the parsed number; initially set to unsigned; will be + // changed if minus sign, decimal point or exponent is read + token_type number_type = token_type::value_unsigned; + + // state (init): we just found out we need to scan a number + switch (current) + { + case '-': + { + add(current); + goto scan_number_minus; + } + + case '0': + { + add(current); + goto scan_number_zero; + } + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + // all other characters are rejected outside scan_number() + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + +scan_number_minus: + // state: we just parsed a leading minus sign + number_type = token_type::value_integer; + switch (get()) + { + case '0': + { + add(current); + goto scan_number_zero; + } + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + default: + { + error_message = "invalid number; expected digit after '-'"; + return token_type::parse_error; + } + } + +scan_number_zero: + // state: we just parse a zero (maybe with a leading minus sign) + switch (get()) + { + case '.': + { + add(decimal_point_char); + goto scan_number_decimal1; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_any1: + // state: we just parsed a number 0-9 (maybe with a leading minus sign) + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + case '.': + { + add(decimal_point_char); + goto scan_number_decimal1; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_decimal1: + // state: we just parsed a decimal point + number_type = token_type::value_float; + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_decimal2; + } + + default: + { + error_message = "invalid number; expected digit after '.'"; + return token_type::parse_error; + } + } + +scan_number_decimal2: + // we just parsed at least one number after a decimal point + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_decimal2; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_exponent: + // we just parsed an exponent + number_type = token_type::value_float; + switch (get()) + { + case '+': + case '-': + { + add(current); + goto scan_number_sign; + } + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + { + error_message = + "invalid number; expected '+', '-', or digit after exponent"; + return token_type::parse_error; + } + } + +scan_number_sign: + // we just parsed an exponent sign + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + { + error_message = "invalid number; expected digit after exponent sign"; + return token_type::parse_error; + } + } + +scan_number_any2: + // we just parsed a number after the exponent or exponent sign + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + goto scan_number_done; + } + +scan_number_done: + // unget the character after the number (we only read it to know that + // we are done scanning a number) + unget(); + + char* endptr = nullptr; + errno = 0; + + // try to parse integers first and fall back to floats + if (number_type == token_type::value_unsigned) + { + const auto x = std::strtoull(token_buffer.data(), &endptr, 10); + + // we checked the number format before + assert(endptr == token_buffer.data() + token_buffer.size()); + + if (errno == 0) + { + value_unsigned = static_cast<number_unsigned_t>(x); + if (value_unsigned == x) + { + return token_type::value_unsigned; + } + } + } + else if (number_type == token_type::value_integer) + { + const auto x = std::strtoll(token_buffer.data(), &endptr, 10); + + // we checked the number format before + assert(endptr == token_buffer.data() + token_buffer.size()); + + if (errno == 0) + { + value_integer = static_cast<number_integer_t>(x); + if (value_integer == x) + { + return token_type::value_integer; + } + } + } + + // this code is reached if we parse a floating-point number or if an + // integer conversion above failed + strtof(value_float, token_buffer.data(), &endptr); + + // we checked the number format before + assert(endptr == token_buffer.data() + token_buffer.size()); + + return token_type::value_float; + } + + /*! + @param[in] literal_text the literal text to expect + @param[in] length the length of the passed literal text + @param[in] return_type the token type to return on success + */ + JSON_HEDLEY_NON_NULL(2) + token_type scan_literal(const char* literal_text, const std::size_t length, + token_type return_type) + { + assert(current == literal_text[0]); + for (std::size_t i = 1; i < length; ++i) + { + if (JSON_HEDLEY_UNLIKELY(get() != literal_text[i])) + { + error_message = "invalid literal"; + return token_type::parse_error; + } + } + return return_type; + } + + ///////////////////// + // input management + ///////////////////// + + /// reset token_buffer; current character is beginning of token + void reset() noexcept + { + token_buffer.clear(); + token_string.clear(); + token_string.push_back(std::char_traits<char>::to_char_type(current)); + } + + /* + @brief get next character from the input + + This function provides the interface to the used input adapter. It does + not throw in case the input reached EOF, but returns a + `std::char_traits<char>::eof()` in that case. Stores the scanned characters + for use in error messages. + + @return character read from the input + */ + std::char_traits<char>::int_type get() + { + ++position.chars_read_total; + ++position.chars_read_current_line; + + if (next_unget) + { + // just reset the next_unget variable and work with current + next_unget = false; + } + else + { + current = ia->get_character(); + } + + if (JSON_HEDLEY_LIKELY(current != std::char_traits<char>::eof())) + { + token_string.push_back(std::char_traits<char>::to_char_type(current)); + } + + if (current == '\n') + { + ++position.lines_read; + position.chars_read_current_line = 0; + } + + return current; + } + + /*! + @brief unget current character (read it again on next get) + + We implement unget by setting variable next_unget to true. The input is not + changed - we just simulate ungetting by modifying chars_read_total, + chars_read_current_line, and token_string. The next call to get() will + behave as if the unget character is read again. + */ + void unget() + { + next_unget = true; + + --position.chars_read_total; + + // in case we "unget" a newline, we have to also decrement the lines_read + if (position.chars_read_current_line == 0) + { + if (position.lines_read > 0) + { + --position.lines_read; + } + } + else + { + --position.chars_read_current_line; + } + + if (JSON_HEDLEY_LIKELY(current != std::char_traits<char>::eof())) + { + assert(not token_string.empty()); + token_string.pop_back(); + } + } + + /// add a character to token_buffer + void add(int c) + { + token_buffer.push_back(std::char_traits<char>::to_char_type(c)); + } + + public: + ///////////////////// + // value getters + ///////////////////// + + /// return integer value + constexpr number_integer_t get_number_integer() const noexcept + { + return value_integer; + } + + /// return unsigned integer value + constexpr number_unsigned_t get_number_unsigned() const noexcept + { + return value_unsigned; + } + + /// return floating-point value + constexpr number_float_t get_number_float() const noexcept + { + return value_float; + } + + /// return current string value (implicitly resets the token; useful only once) + string_t& get_string() + { + return token_buffer; + } + + ///////////////////// + // diagnostics + ///////////////////// + + /// return position of last read token + constexpr position_t get_position() const noexcept + { + return position; + } + + /// return the last read token (for errors only). Will never contain EOF + /// (an arbitrary value that is not a valid char value, often -1), because + /// 255 may legitimately occur. May contain NUL, which should be escaped. + std::string get_token_string() const + { + // escape control characters + std::string result; + for (const auto c : token_string) + { + if ('\x00' <= c and c <= '\x1F') + { + // escape control characters + std::array<char, 9> cs{{}}; + (std::snprintf)(cs.data(), cs.size(), "<U+%.4X>", static_cast<unsigned char>(c)); + result += cs.data(); + } + else + { + // add character as is + result.push_back(c); + } + } + + return result; + } + + /// return syntax error message + JSON_HEDLEY_RETURNS_NON_NULL + constexpr const char* get_error_message() const noexcept + { + return error_message; + } + + ///////////////////// + // actual scanner + ///////////////////// + + /*! + @brief skip the UTF-8 byte order mark + @return true iff there is no BOM or the correct BOM has been skipped + */ + bool skip_bom() + { + if (get() == 0xEF) + { + // check if we completely parse the BOM + return get() == 0xBB and get() == 0xBF; + } + + // the first character is not the beginning of the BOM; unget it to + // process is later + unget(); + return true; + } + + token_type scan() + { + // initially, skip the BOM + if (position.chars_read_total == 0 and not skip_bom()) + { + error_message = "invalid BOM; must be 0xEF 0xBB 0xBF if given"; + return token_type::parse_error; + } + + // read next character and ignore whitespace + do + { + get(); + } + while (current == ' ' or current == '\t' or current == '\n' or current == '\r'); + + switch (current) + { + // structural characters + case '[': + return token_type::begin_array; + case ']': + return token_type::end_array; + case '{': + return token_type::begin_object; + case '}': + return token_type::end_object; + case ':': + return token_type::name_separator; + case ',': + return token_type::value_separator; + + // literals + case 't': + return scan_literal("true", 4, token_type::literal_true); + case 'f': + return scan_literal("false", 5, token_type::literal_false); + case 'n': + return scan_literal("null", 4, token_type::literal_null); + + // string + case '\"': + return scan_string(); + + // number + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return scan_number(); + + // end of input (the null byte is needed when parsing from + // string literals) + case '\0': + case std::char_traits<char>::eof(): + return token_type::end_of_input; + + // error + default: + error_message = "invalid literal"; + return token_type::parse_error; + } + } + + private: + /// input adapter + detail::input_adapter_t ia = nullptr; + + /// the current character + std::char_traits<char>::int_type current = std::char_traits<char>::eof(); + + /// whether the next get() call should just return current + bool next_unget = false; + + /// the start position of the current token + position_t position {}; + + /// raw input token string (for error messages) + std::vector<char> token_string {}; + + /// buffer for variable-length tokens (numbers, strings) + string_t token_buffer {}; + + /// a description of occurred lexer errors + const char* error_message = ""; + + // number values + number_integer_t value_integer = 0; + number_unsigned_t value_unsigned = 0; + number_float_t value_float = 0; + + /// the decimal point + const char decimal_point_char = '.'; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/input/parser.hpp> + + +#include <cassert> // assert +#include <cmath> // isfinite +#include <cstdint> // uint8_t +#include <functional> // function +#include <string> // string +#include <utility> // move +#include <vector> // vector + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/input/input_adapters.hpp> + +// #include <nlohmann/detail/input/json_sax.hpp> + +// #include <nlohmann/detail/input/lexer.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/is_sax.hpp> + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +//////////// +// parser // +//////////// + +/*! +@brief syntax analysis + +This class implements a recursive descent parser. +*/ +template<typename BasicJsonType> +class parser +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using lexer_t = lexer<BasicJsonType>; + using token_type = typename lexer_t::token_type; + + public: + enum class parse_event_t : uint8_t + { + /// the parser read `{` and started to process a JSON object + object_start, + /// the parser read `}` and finished processing a JSON object + object_end, + /// the parser read `[` and started to process a JSON array + array_start, + /// the parser read `]` and finished processing a JSON array + array_end, + /// the parser read a key of a value in an object + key, + /// the parser finished reading a JSON value + value + }; + + using parser_callback_t = + std::function<bool(int depth, parse_event_t event, BasicJsonType& parsed)>; + + /// a parser reading from an input adapter + explicit parser(detail::input_adapter_t&& adapter, + const parser_callback_t cb = nullptr, + const bool allow_exceptions_ = true) + : callback(cb), m_lexer(std::move(adapter)), allow_exceptions(allow_exceptions_) + { + // read first token + get_token(); + } + + /*! + @brief public parser interface + + @param[in] strict whether to expect the last token to be EOF + @param[in,out] result parsed JSON value + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + */ + void parse(const bool strict, BasicJsonType& result) + { + if (callback) + { + json_sax_dom_callback_parser<BasicJsonType> sdp(result, callback, allow_exceptions); + sax_parse_internal(&sdp); + result.assert_invariant(); + + // in strict mode, input must be completely read + if (strict and (get_token() != token_type::end_of_input)) + { + sdp.parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + // in case of an error, return discarded value + if (sdp.is_errored()) + { + result = value_t::discarded; + return; + } + + // set top-level value to null if it was discarded by the callback + // function + if (result.is_discarded()) + { + result = nullptr; + } + } + else + { + json_sax_dom_parser<BasicJsonType> sdp(result, allow_exceptions); + sax_parse_internal(&sdp); + result.assert_invariant(); + + // in strict mode, input must be completely read + if (strict and (get_token() != token_type::end_of_input)) + { + sdp.parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + // in case of an error, return discarded value + if (sdp.is_errored()) + { + result = value_t::discarded; + return; + } + } + } + + /*! + @brief public accept interface + + @param[in] strict whether to expect the last token to be EOF + @return whether the input is a proper JSON text + */ + bool accept(const bool strict = true) + { + json_sax_acceptor<BasicJsonType> sax_acceptor; + return sax_parse(&sax_acceptor, strict); + } + + template <typename SAX> + JSON_HEDLEY_NON_NULL(2) + bool sax_parse(SAX* sax, const bool strict = true) + { + (void)detail::is_sax_static_asserts<SAX, BasicJsonType> {}; + const bool result = sax_parse_internal(sax); + + // strict mode: next byte must be EOF + if (result and strict and (get_token() != token_type::end_of_input)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + return result; + } + + private: + template <typename SAX> + JSON_HEDLEY_NON_NULL(2) + bool sax_parse_internal(SAX* sax) + { + // stack to remember the hierarchy of structured values we are parsing + // true = array; false = object + std::vector<bool> states; + // value to avoid a goto (see comment where set to true) + bool skip_to_state_evaluation = false; + + while (true) + { + if (not skip_to_state_evaluation) + { + // invariant: get_token() was called before each iteration + switch (last_token) + { + case token_type::begin_object: + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_object(std::size_t(-1)))) + { + return false; + } + + // closing } -> we are done + if (get_token() == token_type::end_object) + { + if (JSON_HEDLEY_UNLIKELY(not sax->end_object())) + { + return false; + } + break; + } + + // parse key + if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::value_string, "object key"))); + } + if (JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + { + return false; + } + + // parse separator (:) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::name_separator, "object separator"))); + } + + // remember we are now inside an object + states.push_back(false); + + // parse values + get_token(); + continue; + } + + case token_type::begin_array: + { + if (JSON_HEDLEY_UNLIKELY(not sax->start_array(std::size_t(-1)))) + { + return false; + } + + // closing ] -> we are done + if (get_token() == token_type::end_array) + { + if (JSON_HEDLEY_UNLIKELY(not sax->end_array())) + { + return false; + } + break; + } + + // remember we are now inside an array + states.push_back(true); + + // parse values (no need to call get_token) + continue; + } + + case token_type::value_float: + { + const auto res = m_lexer.get_number_float(); + + if (JSON_HEDLEY_UNLIKELY(not std::isfinite(res))) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); + } + + if (JSON_HEDLEY_UNLIKELY(not sax->number_float(res, m_lexer.get_string()))) + { + return false; + } + + break; + } + + case token_type::literal_false: + { + if (JSON_HEDLEY_UNLIKELY(not sax->boolean(false))) + { + return false; + } + break; + } + + case token_type::literal_null: + { + if (JSON_HEDLEY_UNLIKELY(not sax->null())) + { + return false; + } + break; + } + + case token_type::literal_true: + { + if (JSON_HEDLEY_UNLIKELY(not sax->boolean(true))) + { + return false; + } + break; + } + + case token_type::value_integer: + { + if (JSON_HEDLEY_UNLIKELY(not sax->number_integer(m_lexer.get_number_integer()))) + { + return false; + } + break; + } + + case token_type::value_string: + { + if (JSON_HEDLEY_UNLIKELY(not sax->string(m_lexer.get_string()))) + { + return false; + } + break; + } + + case token_type::value_unsigned: + { + if (JSON_HEDLEY_UNLIKELY(not sax->number_unsigned(m_lexer.get_number_unsigned()))) + { + return false; + } + break; + } + + case token_type::parse_error: + { + // using "uninitialized" to avoid "expected" message + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::uninitialized, "value"))); + } + + default: // the last token was unexpected + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::literal_or_value, "value"))); + } + } + } + else + { + skip_to_state_evaluation = false; + } + + // we reached this line after we successfully parsed a value + if (states.empty()) + { + // empty stack: we reached the end of the hierarchy: done + return true; + } + + if (states.back()) // array + { + // comma -> next value + if (get_token() == token_type::value_separator) + { + // parse a new value + get_token(); + continue; + } + + // closing ] + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) + { + if (JSON_HEDLEY_UNLIKELY(not sax->end_array())) + { + return false; + } + + // We are done with this array. Before we can parse a + // new value, we need to evaluate the new state first. + // By setting skip_to_state_evaluation to false, we + // are effectively jumping to the beginning of this if. + assert(not states.empty()); + states.pop_back(); + skip_to_state_evaluation = true; + continue; + } + + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_array, "array"))); + } + else // object + { + // comma -> next value + if (get_token() == token_type::value_separator) + { + // parse key + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::value_string, "object key"))); + } + + if (JSON_HEDLEY_UNLIKELY(not sax->key(m_lexer.get_string()))) + { + return false; + } + + // parse separator (:) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::name_separator, "object separator"))); + } + + // parse values + get_token(); + continue; + } + + // closing } + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) + { + if (JSON_HEDLEY_UNLIKELY(not sax->end_object())) + { + return false; + } + + // We are done with this object. Before we can parse a + // new value, we need to evaluate the new state first. + // By setting skip_to_state_evaluation to false, we + // are effectively jumping to the beginning of this if. + assert(not states.empty()); + states.pop_back(); + skip_to_state_evaluation = true; + continue; + } + + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_object, "object"))); + } + } + } + + /// get next token from lexer + token_type get_token() + { + return last_token = m_lexer.scan(); + } + + std::string exception_message(const token_type expected, const std::string& context) + { + std::string error_msg = "syntax error "; + + if (not context.empty()) + { + error_msg += "while parsing " + context + " "; + } + + error_msg += "- "; + + if (last_token == token_type::parse_error) + { + error_msg += std::string(m_lexer.get_error_message()) + "; last read: '" + + m_lexer.get_token_string() + "'"; + } + else + { + error_msg += "unexpected " + std::string(lexer_t::token_type_name(last_token)); + } + + if (expected != token_type::uninitialized) + { + error_msg += "; expected " + std::string(lexer_t::token_type_name(expected)); + } + + return error_msg; + } + + private: + /// callback function + const parser_callback_t callback = nullptr; + /// the type of the last read token + token_type last_token = token_type::uninitialized; + /// the lexer + lexer_t m_lexer; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/iterators/internal_iterator.hpp> + + +// #include <nlohmann/detail/iterators/primitive_iterator.hpp> + + +#include <cstddef> // ptrdiff_t +#include <limits> // numeric_limits + +namespace nlohmann +{ +namespace detail +{ +/* +@brief an iterator for primitive JSON types + +This class models an iterator for primitive JSON types (boolean, number, +string). It's only purpose is to allow the iterator/const_iterator classes +to "iterate" over primitive values. Internally, the iterator is modeled by +a `difference_type` variable. Value begin_value (`0`) models the begin, +end_value (`1`) models past the end. +*/ +class primitive_iterator_t +{ + private: + using difference_type = std::ptrdiff_t; + static constexpr difference_type begin_value = 0; + static constexpr difference_type end_value = begin_value + 1; + + /// iterator as signed integer type + difference_type m_it = (std::numeric_limits<std::ptrdiff_t>::min)(); + + public: + constexpr difference_type get_value() const noexcept + { + return m_it; + } + + /// set iterator to a defined beginning + void set_begin() noexcept + { + m_it = begin_value; + } + + /// set iterator to a defined past the end + void set_end() noexcept + { + m_it = end_value; + } + + /// return whether the iterator can be dereferenced + constexpr bool is_begin() const noexcept + { + return m_it == begin_value; + } + + /// return whether the iterator is at end + constexpr bool is_end() const noexcept + { + return m_it == end_value; + } + + friend constexpr bool operator==(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it == rhs.m_it; + } + + friend constexpr bool operator<(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it < rhs.m_it; + } + + primitive_iterator_t operator+(difference_type n) noexcept + { + auto result = *this; + result += n; + return result; + } + + friend constexpr difference_type operator-(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it - rhs.m_it; + } + + primitive_iterator_t& operator++() noexcept + { + ++m_it; + return *this; + } + + primitive_iterator_t const operator++(int) noexcept + { + auto result = *this; + ++m_it; + return result; + } + + primitive_iterator_t& operator--() noexcept + { + --m_it; + return *this; + } + + primitive_iterator_t const operator--(int) noexcept + { + auto result = *this; + --m_it; + return result; + } + + primitive_iterator_t& operator+=(difference_type n) noexcept + { + m_it += n; + return *this; + } + + primitive_iterator_t& operator-=(difference_type n) noexcept + { + m_it -= n; + return *this; + } +}; +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +/*! +@brief an iterator value + +@note This structure could easily be a union, but MSVC currently does not allow +unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. +*/ +template<typename BasicJsonType> struct internal_iterator +{ + /// iterator for JSON objects + typename BasicJsonType::object_t::iterator object_iterator {}; + /// iterator for JSON arrays + typename BasicJsonType::array_t::iterator array_iterator {}; + /// iterator for JSON binary arrays + typename BasicJsonType::binary_t::iterator binary_iterator {}; + /// generic iterator for all other types + primitive_iterator_t primitive_iterator {}; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/iterators/iter_impl.hpp> + + +#include <ciso646> // not +#include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next +#include <type_traits> // conditional, is_const, remove_const + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/iterators/internal_iterator.hpp> + +// #include <nlohmann/detail/iterators/primitive_iterator.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/cpp_future.hpp> + +// #include <nlohmann/detail/meta/type_traits.hpp> + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +// forward declare, to be able to friend it later on +template<typename IteratorType> class iteration_proxy; +template<typename IteratorType> class iteration_proxy_value; + +/*! +@brief a template for a bidirectional iterator for the @ref basic_json class +This class implements a both iterators (iterator and const_iterator) for the +@ref basic_json class. +@note An iterator is called *initialized* when a pointer to a JSON value has + been set (e.g., by a constructor or a copy assignment). If the iterator is + default-constructed, it is *uninitialized* and most methods are undefined. + **The library uses assertions to detect calls on uninitialized iterators.** +@requirement The class satisfies the following concept requirements: +- +[BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): + The iterator that can be moved can be moved in both directions (i.e. + incremented and decremented). +@since version 1.0.0, simplified in version 2.0.9, change to bidirectional + iterators in version 3.0.0 (see https://github.com/nlohmann/json/issues/593) +*/ +template<typename BasicJsonType> +class iter_impl +{ + /// allow basic_json to access private members + friend iter_impl<typename std::conditional<std::is_const<BasicJsonType>::value, typename std::remove_const<BasicJsonType>::type, const BasicJsonType>::type>; + friend BasicJsonType; + friend iteration_proxy<iter_impl>; + friend iteration_proxy_value<iter_impl>; + + using object_t = typename BasicJsonType::object_t; + using array_t = typename BasicJsonType::array_t; + // make sure BasicJsonType is basic_json or const basic_json + static_assert(is_basic_json<typename std::remove_const<BasicJsonType>::type>::value, + "iter_impl only accepts (const) basic_json"); + + public: + + /// The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. + /// The C++ Standard has never required user-defined iterators to derive from std::iterator. + /// A user-defined iterator should provide publicly accessible typedefs named + /// iterator_category, value_type, difference_type, pointer, and reference. + /// Note that value_type is required to be non-const, even for constant iterators. + using iterator_category = std::bidirectional_iterator_tag; + + /// the type of the values when the iterator is dereferenced + using value_type = typename BasicJsonType::value_type; + /// a type to represent differences between iterators + using difference_type = typename BasicJsonType::difference_type; + /// defines a pointer to the type iterated over (value_type) + using pointer = typename std::conditional<std::is_const<BasicJsonType>::value, + typename BasicJsonType::const_pointer, + typename BasicJsonType::pointer>::type; + /// defines a reference to the type iterated over (value_type) + using reference = + typename std::conditional<std::is_const<BasicJsonType>::value, + typename BasicJsonType::const_reference, + typename BasicJsonType::reference>::type; + + /// default constructor + iter_impl() = default; + + /*! + @brief constructor for a given JSON instance + @param[in] object pointer to a JSON object for this iterator + @pre object != nullptr + @post The iterator is initialized; i.e. `m_object != nullptr`. + */ + explicit iter_impl(pointer object) noexcept : m_object(object) + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = typename object_t::iterator(); + break; + } + + case value_t::array: + { + m_it.array_iterator = typename array_t::iterator(); + break; + } + + default: + { + m_it.primitive_iterator = primitive_iterator_t(); + break; + } + } + } + + /*! + @note The conventional copy constructor and copy assignment are implicitly + defined. Combined with the following converting constructor and + assignment, they support: (1) copy from iterator to iterator, (2) + copy from const iterator to const iterator, and (3) conversion from + iterator to const iterator. However conversion from const iterator + to iterator is not defined. + */ + + /*! + @brief const copy constructor + @param[in] other const iterator to copy from + @note This copy constructor had to be defined explicitly to circumvent a bug + occurring on msvc v19.0 compiler (VS 2015) debug build. For more + information refer to: https://github.com/nlohmann/json/issues/1608 + */ + iter_impl(const iter_impl<const BasicJsonType>& other) noexcept + : m_object(other.m_object), m_it(other.m_it) + {} + + /*! + @brief converting assignment + @param[in] other const iterator to copy from + @return const/non-const iterator + @note It is not checked whether @a other is initialized. + */ + iter_impl& operator=(const iter_impl<const BasicJsonType>& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + + /*! + @brief converting constructor + @param[in] other non-const iterator to copy from + @note It is not checked whether @a other is initialized. + */ + iter_impl(const iter_impl<typename std::remove_const<BasicJsonType>::type>& other) noexcept + : m_object(other.m_object), m_it(other.m_it) + {} + + /*! + @brief converting assignment + @param[in] other non-const iterator to copy from + @return const/non-const iterator + @note It is not checked whether @a other is initialized. + */ + iter_impl& operator=(const iter_impl<typename std::remove_const<BasicJsonType>::type>& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + + private: + /*! + @brief set the iterator to the first value + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + void set_begin() noexcept + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = m_object->m_value.object->begin(); + break; + } + + case value_t::array: + { + m_it.array_iterator = m_object->m_value.array->begin(); + break; + } + + case value_t::null: + { + // set to end so begin()==end() is true: null is empty + m_it.primitive_iterator.set_end(); + break; + } + + default: + { + m_it.primitive_iterator.set_begin(); + break; + } + } + } + + /*! + @brief set the iterator past the last value + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + void set_end() noexcept + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = m_object->m_value.object->end(); + break; + } + + case value_t::array: + { + m_it.array_iterator = m_object->m_value.array->end(); + break; + } + + default: + { + m_it.primitive_iterator.set_end(); + break; + } + } + } + + public: + /*! + @brief return a reference to the value pointed to by the iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference operator*() const + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + assert(m_it.object_iterator != m_object->m_value.object->end()); + return m_it.object_iterator->second; + } + + case value_t::array: + { + assert(m_it.array_iterator != m_object->m_value.array->end()); + return *m_it.array_iterator; + } + + case value_t::null: + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + { + return *m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief dereference the iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + pointer operator->() const + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + assert(m_it.object_iterator != m_object->m_value.object->end()); + return &(m_it.object_iterator->second); + } + + case value_t::array: + { + assert(m_it.array_iterator != m_object->m_value.array->end()); + return &*m_it.array_iterator; + } + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + { + return m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief post-increment (it++) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl const operator++(int) + { + auto result = *this; + ++(*this); + return result; + } + + /*! + @brief pre-increment (++it) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator++() + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + std::advance(m_it.object_iterator, 1); + break; + } + + case value_t::array: + { + std::advance(m_it.array_iterator, 1); + break; + } + + default: + { + ++m_it.primitive_iterator; + break; + } + } + + return *this; + } + + /*! + @brief post-decrement (it--) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl const operator--(int) + { + auto result = *this; + --(*this); + return result; + } + + /*! + @brief pre-decrement (--it) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator--() + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + std::advance(m_it.object_iterator, -1); + break; + } + + case value_t::array: + { + std::advance(m_it.array_iterator, -1); + break; + } + + default: + { + --m_it.primitive_iterator; + break; + } + } + + return *this; + } + + /*! + @brief comparison: equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator==(const iter_impl& other) const + { + // if objects are not the same, the comparison is undefined + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + { + JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); + } + + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + return (m_it.object_iterator == other.m_it.object_iterator); + + case value_t::array: + return (m_it.array_iterator == other.m_it.array_iterator); + + default: + return (m_it.primitive_iterator == other.m_it.primitive_iterator); + } + } + + /*! + @brief comparison: not equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator!=(const iter_impl& other) const + { + return not operator==(other); + } + + /*! + @brief comparison: smaller + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator<(const iter_impl& other) const + { + // if objects are not the same, the comparison is undefined + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + { + JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); + } + + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(213, "cannot compare order of object iterators")); + + case value_t::array: + return (m_it.array_iterator < other.m_it.array_iterator); + + default: + return (m_it.primitive_iterator < other.m_it.primitive_iterator); + } + } + + /*! + @brief comparison: less than or equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator<=(const iter_impl& other) const + { + return not other.operator < (*this); + } + + /*! + @brief comparison: greater than + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator>(const iter_impl& other) const + { + return not operator<=(other); + } + + /*! + @brief comparison: greater than or equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator>=(const iter_impl& other) const + { + return not operator<(other); + } + + /*! + @brief add to iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator+=(difference_type i) + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators")); + + case value_t::array: + { + std::advance(m_it.array_iterator, i); + break; + } + + default: + { + m_it.primitive_iterator += i; + break; + } + } + + return *this; + } + + /*! + @brief subtract from iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator-=(difference_type i) + { + return operator+=(-i); + } + + /*! + @brief add to iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl operator+(difference_type i) const + { + auto result = *this; + result += i; + return result; + } + + /*! + @brief addition of distance and iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + friend iter_impl operator+(difference_type i, const iter_impl& it) + { + auto result = it; + result += i; + return result; + } + + /*! + @brief subtract from iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl operator-(difference_type i) const + { + auto result = *this; + result -= i; + return result; + } + + /*! + @brief return difference + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + difference_type operator-(const iter_impl& other) const + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators")); + + case value_t::array: + return m_it.array_iterator - other.m_it.array_iterator; + + default: + return m_it.primitive_iterator - other.m_it.primitive_iterator; + } + } + + /*! + @brief access to successor + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference operator[](difference_type n) const + { + assert(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(208, "cannot use operator[] for object iterators")); + + case value_t::array: + return *std::next(m_it.array_iterator, n); + + case value_t::null: + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + { + return *m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief return the key of an object iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + const typename object_t::key_type& key() const + { + assert(m_object != nullptr); + + if (JSON_HEDLEY_LIKELY(m_object->is_object())) + { + return m_it.object_iterator->first; + } + + JSON_THROW(invalid_iterator::create(207, "cannot use key() for non-object iterators")); + } + + /*! + @brief return the value of an iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference value() const + { + return operator*(); + } + + private: + /// associated JSON instance + pointer m_object = nullptr; + /// the actual iterator of the associated instance + internal_iterator<typename std::remove_const<BasicJsonType>::type> m_it {}; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/iterators/iteration_proxy.hpp> + +// #include <nlohmann/detail/iterators/json_reverse_iterator.hpp> + + +#include <cstddef> // ptrdiff_t +#include <iterator> // reverse_iterator +#include <utility> // declval + +namespace nlohmann +{ +namespace detail +{ +////////////////////// +// reverse_iterator // +////////////////////// + +/*! +@brief a template for a reverse iterator class + +@tparam Base the base iterator type to reverse. Valid types are @ref +iterator (to create @ref reverse_iterator) and @ref const_iterator (to +create @ref const_reverse_iterator). + +@requirement The class satisfies the following concept requirements: +- +[BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): + The iterator that can be moved can be moved in both directions (i.e. + incremented and decremented). +- [OutputIterator](https://en.cppreference.com/w/cpp/named_req/OutputIterator): + It is possible to write to the pointed-to element (only if @a Base is + @ref iterator). + +@since version 1.0.0 +*/ +template<typename Base> +class json_reverse_iterator : public std::reverse_iterator<Base> +{ + public: + using difference_type = std::ptrdiff_t; + /// shortcut to the reverse iterator adapter + using base_iterator = std::reverse_iterator<Base>; + /// the reference type for the pointed-to element + using reference = typename Base::reference; + + /// create reverse iterator from iterator + explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept + : base_iterator(it) {} + + /// create reverse iterator from base class + explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} + + /// post-increment (it++) + json_reverse_iterator const operator++(int) + { + return static_cast<json_reverse_iterator>(base_iterator::operator++(1)); + } + + /// pre-increment (++it) + json_reverse_iterator& operator++() + { + return static_cast<json_reverse_iterator&>(base_iterator::operator++()); + } + + /// post-decrement (it--) + json_reverse_iterator const operator--(int) + { + return static_cast<json_reverse_iterator>(base_iterator::operator--(1)); + } + + /// pre-decrement (--it) + json_reverse_iterator& operator--() + { + return static_cast<json_reverse_iterator&>(base_iterator::operator--()); + } + + /// add to iterator + json_reverse_iterator& operator+=(difference_type i) + { + return static_cast<json_reverse_iterator&>(base_iterator::operator+=(i)); + } + + /// add to iterator + json_reverse_iterator operator+(difference_type i) const + { + return static_cast<json_reverse_iterator>(base_iterator::operator+(i)); + } + + /// subtract from iterator + json_reverse_iterator operator-(difference_type i) const + { + return static_cast<json_reverse_iterator>(base_iterator::operator-(i)); + } + + /// return difference + difference_type operator-(const json_reverse_iterator& other) const + { + return base_iterator(*this) - base_iterator(other); + } + + /// access to successor + reference operator[](difference_type n) const + { + return *(this->operator+(n)); + } + + /// return the key of an object iterator + auto key() const -> decltype(std::declval<Base>().key()) + { + auto it = --this->base(); + return it.key(); + } + + /// return the value of an iterator + reference value() const + { + auto it = --this->base(); + return it.operator * (); + } +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/iterators/primitive_iterator.hpp> + +// #include <nlohmann/detail/json_pointer.hpp> + + +#include <algorithm> // all_of +#include <cassert> // assert +#include <cctype> // isdigit +#include <numeric> // accumulate +#include <string> // string +#include <utility> // move +#include <vector> // vector + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +template<typename BasicJsonType> +class json_pointer +{ + // allow basic_json to access private members + NLOHMANN_BASIC_JSON_TPL_DECLARATION + friend class basic_json; + + public: + /*! + @brief create JSON pointer + + Create a JSON pointer according to the syntax described in + [Section 3 of RFC6901](https://tools.ietf.org/html/rfc6901#section-3). + + @param[in] s string representing the JSON pointer; if omitted, the empty + string is assumed which references the whole JSON value + + @throw parse_error.107 if the given JSON pointer @a s is nonempty and does + not begin with a slash (`/`); see example below + + @throw parse_error.108 if a tilde (`~`) in the given JSON pointer @a s is + not followed by `0` (representing `~`) or `1` (representing `/`); see + example below + + @liveexample{The example shows the construction several valid JSON pointers + as well as the exceptional behavior.,json_pointer} + + @since version 2.0.0 + */ + explicit json_pointer(const std::string& s = "") + : reference_tokens(split(s)) + {} + + /*! + @brief return a string representation of the JSON pointer + + @invariant For each JSON pointer `ptr`, it holds: + @code {.cpp} + ptr == json_pointer(ptr.to_string()); + @endcode + + @return a string representation of the JSON pointer + + @liveexample{The example shows the result of `to_string`.,json_pointer__to_string} + + @since version 2.0.0 + */ + std::string to_string() const + { + return std::accumulate(reference_tokens.begin(), reference_tokens.end(), + std::string{}, + [](const std::string & a, const std::string & b) + { + return a + "/" + escape(b); + }); + } + + /// @copydoc to_string() + operator std::string() const + { + return to_string(); + } + + /*! + @brief append another JSON pointer at the end of this JSON pointer + + @param[in] ptr JSON pointer to append + @return JSON pointer with @a ptr appended + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::string) to append a reference token + @sa @ref operator/=(std::size_t) to append an array index + @sa @ref operator/(const json_pointer&, const json_pointer&) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(const json_pointer& ptr) + { + reference_tokens.insert(reference_tokens.end(), + ptr.reference_tokens.begin(), + ptr.reference_tokens.end()); + return *this; + } + + /*! + @brief append an unescaped reference token at the end of this JSON pointer + + @param[in] token reference token to append + @return JSON pointer with @a token appended without escaping @a token + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Amortized constant. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + @sa @ref operator/=(std::size_t) to append an array index + @sa @ref operator/(const json_pointer&, std::size_t) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(std::string token) + { + push_back(std::move(token)); + return *this; + } + + /*! + @brief append an array index at the end of this JSON pointer + + @param[in] array_idx array index to append + @return JSON pointer with @a array_idx appended + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Amortized constant. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + @sa @ref operator/=(std::string) to append a reference token + @sa @ref operator/(const json_pointer&, std::string) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(std::size_t array_idx) + { + return *this /= std::to_string(array_idx); + } + + /*! + @brief create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer + + @param[in] lhs JSON pointer + @param[in] rhs JSON pointer + @return a new JSON pointer with @a rhs appended to @a lhs + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a lhs and @a rhs. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& lhs, + const json_pointer& rhs) + { + return json_pointer(lhs) /= rhs; + } + + /*! + @brief create a new JSON pointer by appending the unescaped token at the end of the JSON pointer + + @param[in] ptr JSON pointer + @param[in] token reference token + @return a new JSON pointer with unescaped @a token appended to @a ptr + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::string) to append a reference token + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& ptr, std::string token) + { + return json_pointer(ptr) /= std::move(token); + } + + /*! + @brief create a new JSON pointer by appending the array-index-token at the end of the JSON pointer + + @param[in] ptr JSON pointer + @param[in] array_idx array index + @return a new JSON pointer with @a array_idx appended to @a ptr + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::size_t) to append an array index + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& ptr, std::size_t array_idx) + { + return json_pointer(ptr) /= array_idx; + } + + /*! + @brief returns the parent of this JSON pointer + + @return parent of this JSON pointer; in case this JSON pointer is the root, + the root itself is returned + + @complexity Linear in the length of the JSON pointer. + + @liveexample{The example shows the result of `parent_pointer` for different + JSON Pointers.,json_pointer__parent_pointer} + + @since version 3.6.0 + */ + json_pointer parent_pointer() const + { + if (empty()) + { + return *this; + } + + json_pointer res = *this; + res.pop_back(); + return res; + } + + /*! + @brief remove last reference token + + @pre not `empty()` + + @liveexample{The example shows the usage of `pop_back`.,json_pointer__pop_back} + + @complexity Constant. + + @throw out_of_range.405 if JSON pointer has no parent + + @since version 3.6.0 + */ + void pop_back() + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + reference_tokens.pop_back(); + } + + /*! + @brief return last reference token + + @pre not `empty()` + @return last reference token + + @liveexample{The example shows the usage of `back`.,json_pointer__back} + + @complexity Constant. + + @throw out_of_range.405 if JSON pointer has no parent + + @since version 3.6.0 + */ + const std::string& back() const + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + return reference_tokens.back(); + } + + /*! + @brief append an unescaped token at the end of the reference pointer + + @param[in] token token to add + + @complexity Amortized constant. + + @liveexample{The example shows the result of `push_back` for different + JSON Pointers.,json_pointer__push_back} + + @since version 3.6.0 + */ + void push_back(const std::string& token) + { + reference_tokens.push_back(token); + } + + /// @copydoc push_back(const std::string&) + void push_back(std::string&& token) + { + reference_tokens.push_back(std::move(token)); + } + + /*! + @brief return whether pointer points to the root document + + @return true iff the JSON pointer points to the root document + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example shows the result of `empty` for different JSON + Pointers.,json_pointer__empty} + + @since version 3.6.0 + */ + bool empty() const noexcept + { + return reference_tokens.empty(); + } + + private: + /*! + @param[in] s reference token to be converted into an array index + + @return integer representation of @a s + + @throw out_of_range.404 if string @a s could not be converted to an integer + */ + static int array_index(const std::string& s) + { + // error condition (cf. RFC 6901, Sect. 4) + if (JSON_HEDLEY_UNLIKELY(s.size() > 1 and s[0] == '0')) + { + JSON_THROW(detail::parse_error::create(106, 0, + "array index '" + s + + "' must not begin with '0'")); + } + + // error condition (cf. RFC 6901, Sect. 4) + if (JSON_HEDLEY_UNLIKELY(s.size() > 1 and not (s[0] >= '1' and s[0] <= '9'))) + { + JSON_THROW(detail::parse_error::create(109, 0, "array index '" + s + "' is not a number")); + } + + std::size_t processed_chars = 0; + int res = 0; + JSON_TRY + { + res = std::stoi(s, &processed_chars); + } + JSON_CATCH(std::out_of_range&) + { + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); + } + + // check if the string was completely read + if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) + { + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); + } + + return res; + } + + json_pointer top() const + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + json_pointer result = *this; + result.reference_tokens = {reference_tokens[0]}; + return result; + } + + /*! + @brief create and return a reference to the pointed to value + + @complexity Linear in the number of reference tokens. + + @throw parse_error.109 if array index is not a number + @throw type_error.313 if value cannot be unflattened + */ + BasicJsonType& get_and_create(BasicJsonType& j) const + { + using size_type = typename BasicJsonType::size_type; + auto result = &j; + + // in case no reference tokens exist, return a reference to the JSON value + // j which will be overwritten by a primitive value + for (const auto& reference_token : reference_tokens) + { + switch (result->type()) + { + case detail::value_t::null: + { + if (reference_token == "0") + { + // start a new array if reference token is 0 + result = &result->operator[](0); + } + else + { + // start a new object otherwise + result = &result->operator[](reference_token); + } + break; + } + + case detail::value_t::object: + { + // create an entry in the object + result = &result->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + // create an entry in the array + result = &result->operator[](static_cast<size_type>(array_index(reference_token))); + break; + } + + /* + The following code is only reached if there exists a reference + token _and_ the current value is primitive. In this case, we have + an error situation, because primitive values may only occur as + single value; that is, with an empty list of reference tokens. + */ + default: + JSON_THROW(detail::type_error::create(313, "invalid value to unflatten")); + } + } + + return *result; + } + + /*! + @brief return a reference to the pointed to value + + @note This version does not throw if a value is not present, but tries to + create nested values instead. For instance, calling this function + with pointer `"/this/that"` on a null value is equivalent to calling + `operator[]("this").operator[]("that")` on that value, effectively + changing the null value to an object. + + @param[in] ptr a JSON value + + @return reference to the JSON value pointed to by the JSON pointer + + @complexity Linear in the length of the JSON pointer. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + BasicJsonType& get_unchecked(BasicJsonType* ptr) const + { + using size_type = typename BasicJsonType::size_type; + for (const auto& reference_token : reference_tokens) + { + // convert null values to arrays or objects before continuing + if (ptr->is_null()) + { + // check if reference token is a number + const bool nums = + std::all_of(reference_token.begin(), reference_token.end(), + [](const unsigned char x) + { + return std::isdigit(x); + }); + + // change value to array for numbers or "-" or to object otherwise + *ptr = (nums or reference_token == "-") + ? detail::value_t::array + : detail::value_t::object; + } + + switch (ptr->type()) + { + case detail::value_t::object: + { + // use unchecked object access + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (reference_token == "-") + { + // explicitly treat "-" as index beyond the end + ptr = &ptr->operator[](ptr->m_value.array->size()); + } + else + { + // convert array index to number; unchecked access + ptr = &ptr->operator[]( + static_cast<size_type>(array_index(reference_token))); + } + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + BasicJsonType& get_checked(BasicJsonType* ptr) const + { + using size_type = typename BasicJsonType::size_type; + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // note: at performs range check + ptr = &ptr->at(reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // note: at performs range check + ptr = &ptr->at(static_cast<size_type>(array_index(reference_token))); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @brief return a const reference to the pointed to value + + @param[in] ptr a JSON value + + @return const reference to the JSON value pointed to by the JSON + pointer + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + const BasicJsonType& get_unchecked(const BasicJsonType* ptr) const + { + using size_type = typename BasicJsonType::size_type; + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // use unchecked object access + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" cannot be used for const access + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // use unchecked array access + ptr = &ptr->operator[]( + static_cast<size_type>(array_index(reference_token))); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + const BasicJsonType& get_checked(const BasicJsonType* ptr) const + { + using size_type = typename BasicJsonType::size_type; + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // note: at performs range check + ptr = &ptr->at(reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // note: at performs range check + ptr = &ptr->at(static_cast<size_type>(array_index(reference_token))); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + */ + bool contains(const BasicJsonType* ptr) const + { + using size_type = typename BasicJsonType::size_type; + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + if (not ptr->contains(reference_token)) + { + // we did not find the key in the object + return false; + } + + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + return false; + } + if (JSON_HEDLEY_UNLIKELY(reference_token.size() == 1 and not ("0" <= reference_token and reference_token <= "9"))) + { + // invalid char + return false; + } + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1)) + { + if (JSON_HEDLEY_UNLIKELY(not ('1' <= reference_token[0] and reference_token[0] <= '9'))) + { + // first char should be between '1' and '9' + return false; + } + for (std::size_t i = 1; i < reference_token.size(); i++) + { + if (JSON_HEDLEY_UNLIKELY(not ('0' <= reference_token[i] and reference_token[i] <= '9'))) + { + // other char should be between '0' and '9' + return false; + } + } + } + + const auto idx = static_cast<size_type>(array_index(reference_token)); + if (idx >= ptr->size()) + { + // index out of range + return false; + } + + ptr = &ptr->operator[](idx); + break; + } + + default: + { + // we do not expect primitive values if there is still a + // reference token to process + return false; + } + } + } + + // no reference token left means we found a primitive value + return true; + } + + /*! + @brief split the string input to reference tokens + + @note This function is only called by the json_pointer constructor. + All exceptions below are documented there. + + @throw parse_error.107 if the pointer is not empty or begins with '/' + @throw parse_error.108 if character '~' is not followed by '0' or '1' + */ + static std::vector<std::string> split(const std::string& reference_string) + { + std::vector<std::string> result; + + // special case: empty reference string -> no reference tokens + if (reference_string.empty()) + { + return result; + } + + // check if nonempty reference string begins with slash + if (JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) + { + JSON_THROW(detail::parse_error::create(107, 1, + "JSON pointer must be empty or begin with '/' - was: '" + + reference_string + "'")); + } + + // extract the reference tokens: + // - slash: position of the last read slash (or end of string) + // - start: position after the previous slash + for ( + // search for the first slash after the first character + std::size_t slash = reference_string.find_first_of('/', 1), + // set the beginning of the first reference token + start = 1; + // we can stop if start == 0 (if slash == std::string::npos) + start != 0; + // set the beginning of the next reference token + // (will eventually be 0 if slash == std::string::npos) + start = (slash == std::string::npos) ? 0 : slash + 1, + // find next slash + slash = reference_string.find_first_of('/', start)) + { + // use the text between the beginning of the reference token + // (start) and the last slash (slash). + auto reference_token = reference_string.substr(start, slash - start); + + // check reference tokens are properly escaped + for (std::size_t pos = reference_token.find_first_of('~'); + pos != std::string::npos; + pos = reference_token.find_first_of('~', pos + 1)) + { + assert(reference_token[pos] == '~'); + + // ~ must be followed by 0 or 1 + if (JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or + (reference_token[pos + 1] != '0' and + reference_token[pos + 1] != '1'))) + { + JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); + } + } + + // finally, store the reference token + unescape(reference_token); + result.push_back(reference_token); + } + + return result; + } + + /*! + @brief replace all occurrences of a substring by another string + + @param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t + @param[in] f the substring to replace with @a t + @param[in] t the string to replace @a f + + @pre The search string @a f must not be empty. **This precondition is + enforced with an assertion.** + + @since version 2.0.0 + */ + static void replace_substring(std::string& s, const std::string& f, + const std::string& t) + { + assert(not f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != std::string::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} + } + + /// escape "~" to "~0" and "/" to "~1" + static std::string escape(std::string s) + { + replace_substring(s, "~", "~0"); + replace_substring(s, "/", "~1"); + return s; + } + + /// unescape "~1" to tilde and "~0" to slash (order is important!) + static void unescape(std::string& s) + { + replace_substring(s, "~1", "/"); + replace_substring(s, "~0", "~"); + } + + /*! + @param[in] reference_string the reference string to the current value + @param[in] value the value to consider + @param[in,out] result the result object to insert values to + + @note Empty objects or arrays are flattened to `null`. + */ + static void flatten(const std::string& reference_string, + const BasicJsonType& value, + BasicJsonType& result) + { + switch (value.type()) + { + case detail::value_t::array: + { + if (value.m_value.array->empty()) + { + // flatten empty array as null + result[reference_string] = nullptr; + } + else + { + // iterate array and use index as reference string + for (std::size_t i = 0; i < value.m_value.array->size(); ++i) + { + flatten(reference_string + "/" + std::to_string(i), + value.m_value.array->operator[](i), result); + } + } + break; + } + + case detail::value_t::object: + { + if (value.m_value.object->empty()) + { + // flatten empty object as null + result[reference_string] = nullptr; + } + else + { + // iterate object and use keys as reference string + for (const auto& element : *value.m_value.object) + { + flatten(reference_string + "/" + escape(element.first), element.second, result); + } + } + break; + } + + default: + { + // add primitive value with its reference string + result[reference_string] = value; + break; + } + } + } + + /*! + @param[in] value flattened JSON + + @return unflattened JSON + + @throw parse_error.109 if array index is not a number + @throw type_error.314 if value is not an object + @throw type_error.315 if object values are not primitive + @throw type_error.313 if value cannot be unflattened + */ + static BasicJsonType + unflatten(const BasicJsonType& value) + { + if (JSON_HEDLEY_UNLIKELY(not value.is_object())) + { + JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); + } + + BasicJsonType result; + + // iterate the JSON object values + for (const auto& element : *value.m_value.object) + { + if (JSON_HEDLEY_UNLIKELY(not element.second.is_primitive())) + { + JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); + } + + // assign value to reference pointed to by JSON pointer; Note that if + // the JSON pointer is "" (i.e., points to the whole value), function + // get_and_create returns a reference to result itself. An assignment + // will then create a primitive value. + json_pointer(element.first).get_and_create(result) = element.second; + } + + return result; + } + + /*! + @brief compares two JSON pointers for equality + + @param[in] lhs JSON pointer to compare + @param[in] rhs JSON pointer to compare + @return whether @a lhs is equal to @a rhs + + @complexity Linear in the length of the JSON pointer + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + */ + friend bool operator==(json_pointer const& lhs, + json_pointer const& rhs) noexcept + { + return lhs.reference_tokens == rhs.reference_tokens; + } + + /*! + @brief compares two JSON pointers for inequality + + @param[in] lhs JSON pointer to compare + @param[in] rhs JSON pointer to compare + @return whether @a lhs is not equal @a rhs + + @complexity Linear in the length of the JSON pointer + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + */ + friend bool operator!=(json_pointer const& lhs, + json_pointer const& rhs) noexcept + { + return not (lhs == rhs); + } + + /// the reference tokens + std::vector<std::string> reference_tokens; +}; +} // namespace nlohmann + +// #include <nlohmann/detail/json_ref.hpp> + + +#include <initializer_list> +#include <utility> + +// #include <nlohmann/detail/meta/type_traits.hpp> + + +namespace nlohmann +{ +namespace detail +{ +template<typename BasicJsonType> +class json_ref +{ + public: + using value_type = BasicJsonType; + + json_ref(value_type&& value) + : owned_value(std::move(value)), value_ref(&owned_value), is_rvalue(true) + {} + + json_ref(const value_type& value) + : value_ref(const_cast<value_type*>(&value)), is_rvalue(false) + {} + + json_ref(std::initializer_list<json_ref> init) + : owned_value(init), value_ref(&owned_value), is_rvalue(true) + {} + + template < + class... Args, + enable_if_t<std::is_constructible<value_type, Args...>::value, int> = 0 > + json_ref(Args && ... args) + : owned_value(std::forward<Args>(args)...), value_ref(&owned_value), + is_rvalue(true) {} + + // class should be movable only + json_ref(json_ref&&) = default; + json_ref(const json_ref&) = delete; + json_ref& operator=(const json_ref&) = delete; + json_ref& operator=(json_ref&&) = delete; + ~json_ref() = default; + + value_type moved_or_copied() const + { + if (is_rvalue) + { + return std::move(*value_ref); + } + return *value_ref; + } + + value_type const& operator*() const + { + return *static_cast<value_type const*>(value_ref); + } + + value_type const* operator->() const + { + return static_cast<value_type const*>(value_ref); + } + + private: + mutable value_type owned_value = nullptr; + value_type* value_ref = nullptr; + const bool is_rvalue; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/cpp_future.hpp> + +// #include <nlohmann/detail/meta/type_traits.hpp> + +// #include <nlohmann/detail/output/binary_writer.hpp> + + +#include <algorithm> // reverse +#include <array> // array +#include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t +#include <cstring> // memcpy +#include <limits> // numeric_limits +#include <string> // string + +// #include <nlohmann/detail/input/binary_reader.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/output/output_adapters.hpp> + + +#include <algorithm> // copy +#include <cstddef> // size_t +#include <ios> // streamsize +#include <iterator> // back_inserter +#include <memory> // shared_ptr, make_shared +#include <ostream> // basic_ostream +#include <string> // basic_string +#include <vector> // vector +// #include <nlohmann/detail/macro_scope.hpp> + + +namespace nlohmann +{ +namespace detail +{ +/// abstract output adapter interface +template<typename CharType> struct output_adapter_protocol +{ + virtual void write_character(CharType c) = 0; + virtual void write_characters(const CharType* s, std::size_t length) = 0; + virtual ~output_adapter_protocol() = default; +}; + +/// a type to simplify interfaces +template<typename CharType> +using output_adapter_t = std::shared_ptr<output_adapter_protocol<CharType>>; + +/// output adapter for byte vectors +template<typename CharType> +class output_vector_adapter : public output_adapter_protocol<CharType> +{ + public: + explicit output_vector_adapter(std::vector<CharType>& vec) noexcept + : v(vec) + {} + + void write_character(CharType c) override + { + v.push_back(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + std::copy(s, s + length, std::back_inserter(v)); + } + + private: + std::vector<CharType>& v; +}; + +/// output adapter for output streams +template<typename CharType> +class output_stream_adapter : public output_adapter_protocol<CharType> +{ + public: + explicit output_stream_adapter(std::basic_ostream<CharType>& s) noexcept + : stream(s) + {} + + void write_character(CharType c) override + { + stream.put(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + stream.write(s, static_cast<std::streamsize>(length)); + } + + private: + std::basic_ostream<CharType>& stream; +}; + +/// output adapter for basic_string +template<typename CharType, typename StringType = std::basic_string<CharType>> +class output_string_adapter : public output_adapter_protocol<CharType> +{ + public: + explicit output_string_adapter(StringType& s) noexcept + : str(s) + {} + + void write_character(CharType c) override + { + str.push_back(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + str.append(s, length); + } + + private: + StringType& str; +}; + +template<typename CharType, typename StringType = std::basic_string<CharType>> +class output_adapter +{ + public: + output_adapter(std::vector<CharType>& vec) + : oa(std::make_shared<output_vector_adapter<CharType>>(vec)) {} + + output_adapter(std::basic_ostream<CharType>& s) + : oa(std::make_shared<output_stream_adapter<CharType>>(s)) {} + + output_adapter(StringType& s) + : oa(std::make_shared<output_string_adapter<CharType, StringType>>(s)) {} + + operator output_adapter_t<CharType>() + { + return oa; + } + + private: + output_adapter_t<CharType> oa = nullptr; +}; +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// binary writer // +/////////////////// + +/*! +@brief serialization to CBOR and MessagePack values +*/ +template<typename BasicJsonType, typename CharType> +class binary_writer +{ + using string_t = typename BasicJsonType::string_t; + using internal_binary_t = typename BasicJsonType::internal_binary_t; + + public: + /*! + @brief create a binary writer + + @param[in] adapter output adapter to write to + */ + explicit binary_writer(output_adapter_t<CharType> adapter) : oa(adapter) + { + assert(oa); + } + + /*! + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + void write_bson(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::object: + { + write_bson_object(*j.m_value.object); + break; + } + + default: + { + JSON_THROW(type_error::create(317, "to serialize to BSON, top-level type must be object, but is " + std::string(j.type_name()))); + } + } + } + + /*! + @param[in] j JSON value to serialize + */ + void write_cbor(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::null: + { + oa->write_character(to_char_type(0xF6)); + break; + } + + case value_t::boolean: + { + oa->write_character(j.m_value.boolean + ? to_char_type(0xF5) + : to_char_type(0xF4)); + break; + } + + case value_t::number_integer: + { + if (j.m_value.number_integer >= 0) + { + // CBOR does not differentiate between positive signed + // integers and unsigned integers. Therefore, we used the + // code from the value_t::number_unsigned case here. + if (j.m_value.number_integer <= 0x17) + { + write_number(static_cast<std::uint8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0x18)); + write_number(static_cast<std::uint8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0x19)); + write_number(static_cast<std::uint16_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0x1A)); + write_number(static_cast<std::uint32_t>(j.m_value.number_integer)); + } + else + { + oa->write_character(to_char_type(0x1B)); + write_number(static_cast<std::uint64_t>(j.m_value.number_integer)); + } + } + else + { + // The conversions below encode the sign in the first + // byte, and the value is converted to a positive number. + const auto positive_number = -1 - j.m_value.number_integer; + if (j.m_value.number_integer >= -24) + { + write_number(static_cast<std::uint8_t>(0x20 + positive_number)); + } + else if (positive_number <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0x38)); + write_number(static_cast<std::uint8_t>(positive_number)); + } + else if (positive_number <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0x39)); + write_number(static_cast<std::uint16_t>(positive_number)); + } + else if (positive_number <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0x3A)); + write_number(static_cast<std::uint32_t>(positive_number)); + } + else + { + oa->write_character(to_char_type(0x3B)); + write_number(static_cast<std::uint64_t>(positive_number)); + } + } + break; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned <= 0x17) + { + write_number(static_cast<std::uint8_t>(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0x18)); + write_number(static_cast<std::uint8_t>(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0x19)); + write_number(static_cast<std::uint16_t>(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0x1A)); + write_number(static_cast<std::uint32_t>(j.m_value.number_unsigned)); + } + else + { + oa->write_character(to_char_type(0x1B)); + write_number(static_cast<std::uint64_t>(j.m_value.number_unsigned)); + } + break; + } + + case value_t::number_float: + { + oa->write_character(get_cbor_float_prefix(j.m_value.number_float)); + write_number(j.m_value.number_float); + break; + } + + case value_t::string: + { + // step 1: write control byte and the string length + const auto N = j.m_value.string->size(); + if (N <= 0x17) + { + write_number(static_cast<std::uint8_t>(0x60 + N)); + } + else if (N <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0x78)); + write_number(static_cast<std::uint8_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0x79)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0x7A)); + write_number(static_cast<std::uint32_t>(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits<std::uint64_t>::max)()) + { + oa->write_character(to_char_type(0x7B)); + write_number(static_cast<std::uint64_t>(N)); + } + // LCOV_EXCL_STOP + + // step 2: write the string + oa->write_characters( + reinterpret_cast<const CharType*>(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + // step 1: write control byte and the array size + const auto N = j.m_value.array->size(); + if (N <= 0x17) + { + write_number(static_cast<std::uint8_t>(0x80 + N)); + } + else if (N <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0x98)); + write_number(static_cast<std::uint8_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0x99)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0x9A)); + write_number(static_cast<std::uint32_t>(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits<std::uint64_t>::max)()) + { + oa->write_character(to_char_type(0x9B)); + write_number(static_cast<std::uint64_t>(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + for (const auto& el : *j.m_value.array) + { + write_cbor(el); + } + break; + } + + case value_t::binary: + { + // step 1: write control byte and the binary array size + const auto N = j.m_value.binary->size(); + if (N <= 0x17) + { + write_number(static_cast<std::uint8_t>(0x40 + N)); + } + else if (N <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0x58)); + write_number(static_cast<std::uint8_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0x59)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0x5A)); + write_number(static_cast<std::uint32_t>(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits<std::uint64_t>::max)()) + { + oa->write_character(to_char_type(0x5B)); + write_number(static_cast<std::uint64_t>(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + oa->write_characters( + reinterpret_cast<const CharType*>(j.m_value.binary->data()), + N); + + break; + } + + case value_t::object: + { + // step 1: write control byte and the object size + const auto N = j.m_value.object->size(); + if (N <= 0x17) + { + write_number(static_cast<std::uint8_t>(0xA0 + N)); + } + else if (N <= (std::numeric_limits<std::uint8_t>::max)()) + { + oa->write_character(to_char_type(0xB8)); + write_number(static_cast<std::uint8_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + oa->write_character(to_char_type(0xB9)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + oa->write_character(to_char_type(0xBA)); + write_number(static_cast<std::uint32_t>(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits<std::uint64_t>::max)()) + { + oa->write_character(to_char_type(0xBB)); + write_number(static_cast<std::uint64_t>(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + for (const auto& el : *j.m_value.object) + { + write_cbor(el.first); + write_cbor(el.second); + } + break; + } + + default: + break; + } + } + + /*! + @param[in] j JSON value to serialize + */ + void write_msgpack(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::null: // nil + { + oa->write_character(to_char_type(0xC0)); + break; + } + + case value_t::boolean: // true and false + { + oa->write_character(j.m_value.boolean + ? to_char_type(0xC3) + : to_char_type(0xC2)); + break; + } + + case value_t::number_integer: + { + if (j.m_value.number_integer >= 0) + { + // MessagePack does not differentiate between positive + // signed integers and unsigned integers. Therefore, we used + // the code from the value_t::number_unsigned case here. + if (j.m_value.number_unsigned < 128) + { + // positive fixnum + write_number(static_cast<std::uint8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint8_t>::max)()) + { + // uint 8 + oa->write_character(to_char_type(0xCC)); + write_number(static_cast<std::uint8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint16_t>::max)()) + { + // uint 16 + oa->write_character(to_char_type(0xCD)); + write_number(static_cast<std::uint16_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint32_t>::max)()) + { + // uint 32 + oa->write_character(to_char_type(0xCE)); + write_number(static_cast<std::uint32_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint64_t>::max)()) + { + // uint 64 + oa->write_character(to_char_type(0xCF)); + write_number(static_cast<std::uint64_t>(j.m_value.number_integer)); + } + } + else + { + if (j.m_value.number_integer >= -32) + { + // negative fixnum + write_number(static_cast<std::int8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits<std::int8_t>::min)() and + j.m_value.number_integer <= (std::numeric_limits<std::int8_t>::max)()) + { + // int 8 + oa->write_character(to_char_type(0xD0)); + write_number(static_cast<std::int8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits<std::int16_t>::min)() and + j.m_value.number_integer <= (std::numeric_limits<std::int16_t>::max)()) + { + // int 16 + oa->write_character(to_char_type(0xD1)); + write_number(static_cast<std::int16_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits<std::int32_t>::min)() and + j.m_value.number_integer <= (std::numeric_limits<std::int32_t>::max)()) + { + // int 32 + oa->write_character(to_char_type(0xD2)); + write_number(static_cast<std::int32_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits<std::int64_t>::min)() and + j.m_value.number_integer <= (std::numeric_limits<std::int64_t>::max)()) + { + // int 64 + oa->write_character(to_char_type(0xD3)); + write_number(static_cast<std::int64_t>(j.m_value.number_integer)); + } + } + break; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned < 128) + { + // positive fixnum + write_number(static_cast<std::uint8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint8_t>::max)()) + { + // uint 8 + oa->write_character(to_char_type(0xCC)); + write_number(static_cast<std::uint8_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint16_t>::max)()) + { + // uint 16 + oa->write_character(to_char_type(0xCD)); + write_number(static_cast<std::uint16_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint32_t>::max)()) + { + // uint 32 + oa->write_character(to_char_type(0xCE)); + write_number(static_cast<std::uint32_t>(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits<std::uint64_t>::max)()) + { + // uint 64 + oa->write_character(to_char_type(0xCF)); + write_number(static_cast<std::uint64_t>(j.m_value.number_integer)); + } + break; + } + + case value_t::number_float: + { + oa->write_character(get_msgpack_float_prefix(j.m_value.number_float)); + write_number(j.m_value.number_float); + break; + } + + case value_t::string: + { + // step 1: write control byte and the string length + const auto N = j.m_value.string->size(); + if (N <= 31) + { + // fixstr + write_number(static_cast<std::uint8_t>(0xA0 | N)); + } + else if (N <= (std::numeric_limits<std::uint8_t>::max)()) + { + // str 8 + oa->write_character(to_char_type(0xD9)); + write_number(static_cast<std::uint8_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + // str 16 + oa->write_character(to_char_type(0xDA)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + // str 32 + oa->write_character(to_char_type(0xDB)); + write_number(static_cast<std::uint32_t>(N)); + } + + // step 2: write the string + oa->write_characters( + reinterpret_cast<const CharType*>(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + // step 1: write control byte and the array size + const auto N = j.m_value.array->size(); + if (N <= 15) + { + // fixarray + write_number(static_cast<std::uint8_t>(0x90 | N)); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + // array 16 + oa->write_character(to_char_type(0xDC)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + // array 32 + oa->write_character(to_char_type(0xDD)); + write_number(static_cast<std::uint32_t>(N)); + } + + // step 2: write each element + for (const auto& el : *j.m_value.array) + { + write_msgpack(el); + } + break; + } + + case value_t::binary: + { + // step 0: determine if the binary type has a set subtype to + // determine whether or not to use the ext or fixext types + const bool use_ext = j.m_value.binary->has_subtype; + + // step 1: write control byte and the byte string length + const auto N = j.m_value.binary->size(); + if (N <= (std::numeric_limits<std::uint8_t>::max)()) + { + std::uint8_t output_type; + bool fixed = true; + if (use_ext) + { + switch (N) + { + case 1: + output_type = 0xD4; // fixext 1 + break; + case 2: + output_type = 0xD5; // fixext 2 + break; + case 4: + output_type = 0xD6; // fixext 4 + break; + case 8: + output_type = 0xD7; // fixext 8 + break; + case 16: + output_type = 0xD8; // fixext 16 + break; + default: + output_type = 0xC7; // ext 8 + fixed = false; + break; + } + + } + else + { + output_type = 0xC4; // bin 8 + fixed = false; + } + + oa->write_character(to_char_type(output_type)); + if (not fixed) + { + write_number(static_cast<std::uint8_t>(N)); + } + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + std::uint8_t output_type; + if (use_ext) + { + output_type = 0xC8; // ext 16 + } + else + { + output_type = 0xC5; // bin 16 + } + + oa->write_character(to_char_type(output_type)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + std::uint8_t output_type; + if (use_ext) + { + output_type = 0xC9; // ext 32 + } + else + { + output_type = 0xC6; // bin 32 + } + + oa->write_character(to_char_type(output_type)); + write_number(static_cast<std::uint32_t>(N)); + } + + // step 1.5: if this is an ext type, write the subtype + if (use_ext) + { + write_number(j.m_value.binary->subtype); + } + + // step 2: write the byte string + oa->write_characters( + reinterpret_cast<const CharType*>(j.m_value.binary->data()), + N); + + break; + } + + case value_t::object: + { + // step 1: write control byte and the object size + const auto N = j.m_value.object->size(); + if (N <= 15) + { + // fixmap + write_number(static_cast<std::uint8_t>(0x80 | (N & 0xF))); + } + else if (N <= (std::numeric_limits<std::uint16_t>::max)()) + { + // map 16 + oa->write_character(to_char_type(0xDE)); + write_number(static_cast<std::uint16_t>(N)); + } + else if (N <= (std::numeric_limits<std::uint32_t>::max)()) + { + // map 32 + oa->write_character(to_char_type(0xDF)); + write_number(static_cast<std::uint32_t>(N)); + } + + // step 2: write each element + for (const auto& el : *j.m_value.object) + { + write_msgpack(el.first); + write_msgpack(el.second); + } + break; + } + + default: + break; + } + } + + /*! + @param[in] j JSON value to serialize + @param[in] use_count whether to use '#' prefixes (optimized format) + @param[in] use_type whether to use '$' prefixes (optimized format) + @param[in] add_prefix whether prefixes need to be used for this value + */ + void write_ubjson(const BasicJsonType& j, const bool use_count, + const bool use_type, const bool add_prefix = true) + { + switch (j.type()) + { + case value_t::null: + { + if (add_prefix) + { + oa->write_character(to_char_type('Z')); + } + break; + } + + case value_t::boolean: + { + if (add_prefix) + { + oa->write_character(j.m_value.boolean + ? to_char_type('T') + : to_char_type('F')); + } + break; + } + + case value_t::number_integer: + { + write_number_with_ubjson_prefix(j.m_value.number_integer, add_prefix); + break; + } + + case value_t::number_unsigned: + { + write_number_with_ubjson_prefix(j.m_value.number_unsigned, add_prefix); + break; + } + + case value_t::number_float: + { + write_number_with_ubjson_prefix(j.m_value.number_float, add_prefix); + break; + } + + case value_t::string: + { + if (add_prefix) + { + oa->write_character(to_char_type('S')); + } + write_number_with_ubjson_prefix(j.m_value.string->size(), true); + oa->write_characters( + reinterpret_cast<const CharType*>(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + if (add_prefix) + { + oa->write_character(to_char_type('[')); + } + + bool prefix_required = true; + if (use_type and not j.m_value.array->empty()) + { + assert(use_count); + const CharType first_prefix = ubjson_prefix(j.front()); + const bool same_prefix = std::all_of(j.begin() + 1, j.end(), + [this, first_prefix](const BasicJsonType & v) + { + return ubjson_prefix(v) == first_prefix; + }); + + if (same_prefix) + { + prefix_required = false; + oa->write_character(to_char_type('$')); + oa->write_character(first_prefix); + } + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.array->size(), true); + } + + for (const auto& el : *j.m_value.array) + { + write_ubjson(el, use_count, use_type, prefix_required); + } + + if (not use_count) + { + oa->write_character(to_char_type(']')); + } + + break; + } + + case value_t::binary: + { + if (add_prefix) + { + oa->write_character(to_char_type('[')); + } + + if (use_type and not j.m_value.binary->empty()) + { + assert(use_count); + oa->write_character(to_char_type('$')); + oa->write_character('U'); + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.binary->size(), true); + } + + if (use_type) + { + oa->write_characters( + reinterpret_cast<const CharType*>(j.m_value.binary->data()), + j.m_value.binary->size()); + } + else + { + for (size_t i = 0; i < j.m_value.binary->size(); ++i) + { + oa->write_character(to_char_type('U')); + oa->write_character(j.m_value.binary->data()[i]); + } + } + + if (not use_count) + { + oa->write_character(to_char_type(']')); + } + + break; + } + + case value_t::object: + { + if (add_prefix) + { + oa->write_character(to_char_type('{')); + } + + bool prefix_required = true; + if (use_type and not j.m_value.object->empty()) + { + assert(use_count); + const CharType first_prefix = ubjson_prefix(j.front()); + const bool same_prefix = std::all_of(j.begin(), j.end(), + [this, first_prefix](const BasicJsonType & v) + { + return ubjson_prefix(v) == first_prefix; + }); + + if (same_prefix) + { + prefix_required = false; + oa->write_character(to_char_type('$')); + oa->write_character(first_prefix); + } + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.object->size(), true); + } + + for (const auto& el : *j.m_value.object) + { + write_number_with_ubjson_prefix(el.first.size(), true); + oa->write_characters( + reinterpret_cast<const CharType*>(el.first.c_str()), + el.first.size()); + write_ubjson(el.second, use_count, use_type, prefix_required); + } + + if (not use_count) + { + oa->write_character(to_char_type('}')); + } + + break; + } + + default: + break; + } + } + + private: + ////////// + // BSON // + ////////// + + /*! + @return The size of a BSON document entry header, including the id marker + and the entry name size (and its null-terminator). + */ + static std::size_t calc_bson_entry_header_size(const string_t& name) + { + const auto it = name.find(static_cast<typename string_t::value_type>(0)); + if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + { + JSON_THROW(out_of_range::create(409, + "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); + } + + return /*id*/ 1ul + name.size() + /*zero-terminator*/1u; + } + + /*! + @brief Writes the given @a element_type and @a name to the output adapter + */ + void write_bson_entry_header(const string_t& name, + const std::uint8_t element_type) + { + oa->write_character(to_char_type(element_type)); // boolean + oa->write_characters( + reinterpret_cast<const CharType*>(name.c_str()), + name.size() + 1u); + } + + /*! + @brief Writes a BSON element with key @a name and boolean value @a value + */ + void write_bson_boolean(const string_t& name, + const bool value) + { + write_bson_entry_header(name, 0x08); + oa->write_character(value ? to_char_type(0x01) : to_char_type(0x00)); + } + + /*! + @brief Writes a BSON element with key @a name and double value @a value + */ + void write_bson_double(const string_t& name, + const double value) + { + write_bson_entry_header(name, 0x01); + write_number<double, true>(value); + } + + /*! + @return The size of the BSON-encoded string in @a value + */ + static std::size_t calc_bson_string_size(const string_t& value) + { + return sizeof(std::int32_t) + value.size() + 1ul; + } + + /*! + @brief Writes a BSON element with key @a name and string value @a value + */ + void write_bson_string(const string_t& name, + const string_t& value) + { + write_bson_entry_header(name, 0x02); + + write_number<std::int32_t, true>(static_cast<std::int32_t>(value.size() + 1ul)); + oa->write_characters( + reinterpret_cast<const CharType*>(value.c_str()), + value.size() + 1); + } + + /*! + @brief Writes a BSON element with key @a name and null value + */ + void write_bson_null(const string_t& name) + { + write_bson_entry_header(name, 0x0A); + } + + /*! + @return The size of the BSON-encoded integer @a value + */ + static std::size_t calc_bson_integer_size(const std::int64_t value) + { + return (std::numeric_limits<std::int32_t>::min)() <= value and value <= (std::numeric_limits<std::int32_t>::max)() + ? sizeof(std::int32_t) + : sizeof(std::int64_t); + } + + /*! + @brief Writes a BSON element with key @a name and integer @a value + */ + void write_bson_integer(const string_t& name, + const std::int64_t value) + { + if ((std::numeric_limits<std::int32_t>::min)() <= value and value <= (std::numeric_limits<std::int32_t>::max)()) + { + write_bson_entry_header(name, 0x10); // int32 + write_number<std::int32_t, true>(static_cast<std::int32_t>(value)); + } + else + { + write_bson_entry_header(name, 0x12); // int64 + write_number<std::int64_t, true>(static_cast<std::int64_t>(value)); + } + } + + /*! + @return The size of the BSON-encoded unsigned integer in @a j + */ + static constexpr std::size_t calc_bson_unsigned_size(const std::uint64_t value) noexcept + { + return (value <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)())) + ? sizeof(std::int32_t) + : sizeof(std::int64_t); + } + + /*! + @brief Writes a BSON element with key @a name and unsigned @a value + */ + void write_bson_unsigned(const string_t& name, + const std::uint64_t value) + { + if (value <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)())) + { + write_bson_entry_header(name, 0x10 /* int32 */); + write_number<std::int32_t, true>(static_cast<std::int32_t>(value)); + } + else if (value <= static_cast<std::uint64_t>((std::numeric_limits<std::int64_t>::max)())) + { + write_bson_entry_header(name, 0x12 /* int64 */); + write_number<std::int64_t, true>(static_cast<std::int64_t>(value)); + } + else + { + JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(value) + " cannot be represented by BSON as it does not fit int64")); + } + } + + /*! + @brief Writes a BSON element with key @a name and object @a value + */ + void write_bson_object_entry(const string_t& name, + const typename BasicJsonType::object_t& value) + { + write_bson_entry_header(name, 0x03); // object + write_bson_object(value); + } + + /*! + @return The size of the BSON-encoded array @a value + */ + static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t& value) + { + std::size_t array_index = 0ul; + + const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), std::size_t(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el) + { + return result + calc_bson_element_size(std::to_string(array_index++), el); + }); + + return sizeof(std::int32_t) + embedded_document_size + 1ul; + } + + /*! + @return The size of the BSON-encoded binary array @a value + */ + static std::size_t calc_bson_binary_size(const typename BasicJsonType::internal_binary_t& value) + { + return sizeof(std::int32_t) + value.size() + 1ul; + } + + /*! + @brief Writes a BSON element with key @a name and array @a value + */ + void write_bson_array(const string_t& name, + const typename BasicJsonType::array_t& value) + { + write_bson_entry_header(name, 0x04); // array + write_number<std::int32_t, true>(static_cast<std::int32_t>(calc_bson_array_size(value))); + + std::size_t array_index = 0ul; + + for (const auto& el : value) + { + write_bson_element(std::to_string(array_index++), el); + } + + oa->write_character(to_char_type(0x00)); + } + + /*! + @brief Writes a BSON element with key @a name and binary value @a value + */ + void write_bson_binary(const string_t& name, + const internal_binary_t& value) + { + write_bson_entry_header(name, 0x05); + + write_number<std::int32_t, true>(static_cast<std::int32_t>(value.size())); + std::uint8_t subtype = 0x00; // Generic Binary Subtype + if (value.has_subtype) + { + subtype = value.subtype; + } + write_number(subtype); + + oa->write_characters( + reinterpret_cast<const CharType*>(value.data()), + value.size()); + } + + /*! + @brief Calculates the size necessary to serialize the JSON value @a j with its @a name + @return The calculated size for the BSON document entry for @a j with the given @a name. + */ + static std::size_t calc_bson_element_size(const string_t& name, + const BasicJsonType& j) + { + const auto header_size = calc_bson_entry_header_size(name); + switch (j.type()) + { + case value_t::object: + return header_size + calc_bson_object_size(*j.m_value.object); + + case value_t::array: + return header_size + calc_bson_array_size(*j.m_value.array); + + case value_t::binary: + return header_size + calc_bson_binary_size(*j.m_value.binary); + + case value_t::boolean: + return header_size + 1ul; + + case value_t::number_float: + return header_size + 8ul; + + case value_t::number_integer: + return header_size + calc_bson_integer_size(j.m_value.number_integer); + + case value_t::number_unsigned: + return header_size + calc_bson_unsigned_size(j.m_value.number_unsigned); + + case value_t::string: + return header_size + calc_bson_string_size(*j.m_value.string); + + case value_t::null: + return header_size + 0ul; + + // LCOV_EXCL_START + default: + assert(false); + return 0ul; + // LCOV_EXCL_STOP + } + } + + /*! + @brief Serializes the JSON value @a j to BSON and associates it with the + key @a name. + @param name The name to associate with the JSON entity @a j within the + current BSON document + @return The size of the BSON entry + */ + void write_bson_element(const string_t& name, + const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::object: + return write_bson_object_entry(name, *j.m_value.object); + + case value_t::array: + return write_bson_array(name, *j.m_value.array); + + case value_t::binary: + return write_bson_binary(name, *j.m_value.binary); + + case value_t::boolean: + return write_bson_boolean(name, j.m_value.boolean); + + case value_t::number_float: + return write_bson_double(name, j.m_value.number_float); + + case value_t::number_integer: + return write_bson_integer(name, j.m_value.number_integer); + + case value_t::number_unsigned: + return write_bson_unsigned(name, j.m_value.number_unsigned); + + case value_t::string: + return write_bson_string(name, *j.m_value.string); + + case value_t::null: + return write_bson_null(name); + + // LCOV_EXCL_START + default: + assert(false); + return; + // LCOV_EXCL_STOP + } + } + + /*! + @brief Calculates the size of the BSON serialization of the given + JSON-object @a j. + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + static std::size_t calc_bson_object_size(const typename BasicJsonType::object_t& value) + { + std::size_t document_size = std::accumulate(value.begin(), value.end(), std::size_t(0), + [](size_t result, const typename BasicJsonType::object_t::value_type & el) + { + return result += calc_bson_element_size(el.first, el.second); + }); + + return sizeof(std::int32_t) + document_size + 1ul; + } + + /*! + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + void write_bson_object(const typename BasicJsonType::object_t& value) + { + write_number<std::int32_t, true>(static_cast<std::int32_t>(calc_bson_object_size(value))); + + for (const auto& el : value) + { + write_bson_element(el.first, el.second); + } + + oa->write_character(to_char_type(0x00)); + } + + ////////// + // CBOR // + ////////// + + static constexpr CharType get_cbor_float_prefix(float /*unused*/) + { + return to_char_type(0xFA); // Single-Precision Float + } + + static constexpr CharType get_cbor_float_prefix(double /*unused*/) + { + return to_char_type(0xFB); // Double-Precision Float + } + + ///////////// + // MsgPack // + ///////////// + + static constexpr CharType get_msgpack_float_prefix(float /*unused*/) + { + return to_char_type(0xCA); // float 32 + } + + static constexpr CharType get_msgpack_float_prefix(double /*unused*/) + { + return to_char_type(0xCB); // float 64 + } + + //////////// + // UBJSON // + //////////// + + // UBJSON: write number (floating point) + template<typename NumberType, typename std::enable_if< + std::is_floating_point<NumberType>::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if (add_prefix) + { + oa->write_character(get_ubjson_float_prefix(n)); + } + write_number(n); + } + + // UBJSON: write number (unsigned integer) + template<typename NumberType, typename std::enable_if< + std::is_unsigned<NumberType>::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int8_t>::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('i')); // int8 + } + write_number(static_cast<std::uint8_t>(n)); + } + else if (n <= (std::numeric_limits<std::uint8_t>::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('U')); // uint8 + } + write_number(static_cast<std::uint8_t>(n)); + } + else if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int16_t>::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('I')); // int16 + } + write_number(static_cast<std::int16_t>(n)); + } + else if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('l')); // int32 + } + write_number(static_cast<std::int32_t>(n)); + } + else if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int64_t>::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('L')); // int64 + } + write_number(static_cast<std::int64_t>(n)); + } + else + { + JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(n) + " cannot be represented by UBJSON as it does not fit int64")); + } + } + + // UBJSON: write number (signed integer) + template<typename NumberType, typename std::enable_if< + std::is_signed<NumberType>::value and + not std::is_floating_point<NumberType>::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if ((std::numeric_limits<std::int8_t>::min)() <= n and n <= (std::numeric_limits<std::int8_t>::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('i')); // int8 + } + write_number(static_cast<std::int8_t>(n)); + } + else if (static_cast<std::int64_t>((std::numeric_limits<std::uint8_t>::min)()) <= n and n <= static_cast<std::int64_t>((std::numeric_limits<std::uint8_t>::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('U')); // uint8 + } + write_number(static_cast<std::uint8_t>(n)); + } + else if ((std::numeric_limits<std::int16_t>::min)() <= n and n <= (std::numeric_limits<std::int16_t>::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('I')); // int16 + } + write_number(static_cast<std::int16_t>(n)); + } + else if ((std::numeric_limits<std::int32_t>::min)() <= n and n <= (std::numeric_limits<std::int32_t>::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('l')); // int32 + } + write_number(static_cast<std::int32_t>(n)); + } + else if ((std::numeric_limits<std::int64_t>::min)() <= n and n <= (std::numeric_limits<std::int64_t>::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('L')); // int64 + } + write_number(static_cast<std::int64_t>(n)); + } + // LCOV_EXCL_START + else + { + JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(n) + " cannot be represented by UBJSON as it does not fit int64")); + } + // LCOV_EXCL_STOP + } + + /*! + @brief determine the type prefix of container values + + @note This function does not need to be 100% accurate when it comes to + integer limits. In case a number exceeds the limits of int64_t, + this will be detected by a later call to function + write_number_with_ubjson_prefix. Therefore, we return 'L' for any + value that does not fit the previous limits. + */ + CharType ubjson_prefix(const BasicJsonType& j) const noexcept + { + switch (j.type()) + { + case value_t::null: + return 'Z'; + + case value_t::boolean: + return j.m_value.boolean ? 'T' : 'F'; + + case value_t::number_integer: + { + if ((std::numeric_limits<std::int8_t>::min)() <= j.m_value.number_integer and j.m_value.number_integer <= (std::numeric_limits<std::int8_t>::max)()) + { + return 'i'; + } + if ((std::numeric_limits<std::uint8_t>::min)() <= j.m_value.number_integer and j.m_value.number_integer <= (std::numeric_limits<std::uint8_t>::max)()) + { + return 'U'; + } + if ((std::numeric_limits<std::int16_t>::min)() <= j.m_value.number_integer and j.m_value.number_integer <= (std::numeric_limits<std::int16_t>::max)()) + { + return 'I'; + } + if ((std::numeric_limits<std::int32_t>::min)() <= j.m_value.number_integer and j.m_value.number_integer <= (std::numeric_limits<std::int32_t>::max)()) + { + return 'l'; + } + // no check and assume int64_t (see note above) + return 'L'; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int8_t>::max)())) + { + return 'i'; + } + if (j.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::uint8_t>::max)())) + { + return 'U'; + } + if (j.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int16_t>::max)())) + { + return 'I'; + } + if (j.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)())) + { + return 'l'; + } + // no check and assume int64_t (see note above) + return 'L'; + } + + case value_t::number_float: + return get_ubjson_float_prefix(j.m_value.number_float); + + case value_t::string: + return 'S'; + + case value_t::array: // fallthrough + case value_t::binary: + return '['; + + case value_t::object: + return '{'; + + default: // discarded values + return 'N'; + } + } + + static constexpr CharType get_ubjson_float_prefix(float /*unused*/) + { + return 'd'; // float 32 + } + + static constexpr CharType get_ubjson_float_prefix(double /*unused*/) + { + return 'D'; // float 64 + } + + /////////////////////// + // Utility functions // + /////////////////////// + + /* + @brief write a number to output input + @param[in] n number of type @a NumberType + @tparam NumberType the type of the number + @tparam OutputIsLittleEndian Set to true if output data is + required to be little endian + + @note This function needs to respect the system's endianess, because bytes + in CBOR, MessagePack, and UBJSON are stored in network order (big + endian) and therefore need reordering on little endian systems. + */ + template<typename NumberType, bool OutputIsLittleEndian = false> + void write_number(const NumberType n) + { + // step 1: write number to array of length NumberType + std::array<CharType, sizeof(NumberType)> vec; + std::memcpy(vec.data(), &n, sizeof(NumberType)); + + // step 2: write array to output (with possible reordering) + if (is_little_endian != OutputIsLittleEndian) + { + // reverse byte order prior to conversion if necessary + std::reverse(vec.begin(), vec.end()); + } + + oa->write_characters(vec.data(), sizeof(NumberType)); + } + + public: + // The following to_char_type functions are implement the conversion + // between uint8_t and CharType. In case CharType is not unsigned, + // such a conversion is required to allow values greater than 128. + // See <https://github.com/nlohmann/json/issues/1286> for a discussion. + template < typename C = CharType, + enable_if_t < std::is_signed<C>::value and std::is_signed<char>::value > * = nullptr > + static constexpr CharType to_char_type(std::uint8_t x) noexcept + { + return *reinterpret_cast<char*>(&x); + } + + template < typename C = CharType, + enable_if_t < std::is_signed<C>::value and std::is_unsigned<char>::value > * = nullptr > + static CharType to_char_type(std::uint8_t x) noexcept + { + static_assert(sizeof(std::uint8_t) == sizeof(CharType), "size of CharType must be equal to std::uint8_t"); + static_assert(std::is_trivial<CharType>::value, "CharType must be trivial"); + CharType result; + std::memcpy(&result, &x, sizeof(x)); + return result; + } + + template<typename C = CharType, + enable_if_t<std::is_unsigned<C>::value>* = nullptr> + static constexpr CharType to_char_type(std::uint8_t x) noexcept + { + return x; + } + + template < typename InputCharType, typename C = CharType, + enable_if_t < + std::is_signed<C>::value and + std::is_signed<char>::value and + std::is_same<char, typename std::remove_cv<InputCharType>::type>::value + > * = nullptr > + static constexpr CharType to_char_type(InputCharType x) noexcept + { + return x; + } + + private: + /// whether we can assume little endianess + const bool is_little_endian = binary_reader<BasicJsonType>::little_endianess(); + + /// the output + output_adapter_t<CharType> oa = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/output/output_adapters.hpp> + +// #include <nlohmann/detail/output/serializer.hpp> + + +#include <algorithm> // reverse, remove, fill, find, none_of +#include <array> // array +#include <cassert> // assert +#include <ciso646> // and, or +#include <clocale> // localeconv, lconv +#include <cmath> // labs, isfinite, isnan, signbit +#include <cstddef> // size_t, ptrdiff_t +#include <cstdint> // uint8_t +#include <cstdio> // snprintf +#include <limits> // numeric_limits +#include <string> // string +#include <type_traits> // is_same +#include <utility> // move + +// #include <nlohmann/detail/conversions/to_chars.hpp> + + +#include <array> // array +#include <cassert> // assert +#include <ciso646> // or, and, not +#include <cmath> // signbit, isfinite +#include <cstdint> // intN_t, uintN_t +#include <cstring> // memcpy, memmove +#include <limits> // numeric_limits +#include <type_traits> // conditional +// #include <nlohmann/detail/macro_scope.hpp> + + +namespace nlohmann +{ +namespace detail +{ + +/*! +@brief implements the Grisu2 algorithm for binary to decimal floating-point +conversion. + +This implementation is a slightly modified version of the reference +implementation which may be obtained from +http://florian.loitsch.com/publications (bench.tar.gz). + +The code is distributed under the MIT license, Copyright (c) 2009 Florian Loitsch. + +For a detailed description of the algorithm see: + +[1] Loitsch, "Printing Floating-Point Numbers Quickly and Accurately with + Integers", Proceedings of the ACM SIGPLAN 2010 Conference on Programming + Language Design and Implementation, PLDI 2010 +[2] Burger, Dybvig, "Printing Floating-Point Numbers Quickly and Accurately", + Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language + Design and Implementation, PLDI 1996 +*/ +namespace dtoa_impl +{ + +template <typename Target, typename Source> +Target reinterpret_bits(const Source source) +{ + static_assert(sizeof(Target) == sizeof(Source), "size mismatch"); + + Target target; + std::memcpy(&target, &source, sizeof(Source)); + return target; +} + +struct diyfp // f * 2^e +{ + static constexpr int kPrecision = 64; // = q + + std::uint64_t f = 0; + int e = 0; + + constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_) {} + + /*! + @brief returns x - y + @pre x.e == y.e and x.f >= y.f + */ + static diyfp sub(const diyfp& x, const diyfp& y) noexcept + { + assert(x.e == y.e); + assert(x.f >= y.f); + + return {x.f - y.f, x.e}; + } + + /*! + @brief returns x * y + @note The result is rounded. (Only the upper q bits are returned.) + */ + static diyfp mul(const diyfp& x, const diyfp& y) noexcept + { + static_assert(kPrecision == 64, "internal error"); + + // Computes: + // f = round((x.f * y.f) / 2^q) + // e = x.e + y.e + q + + // Emulate the 64-bit * 64-bit multiplication: + // + // p = u * v + // = (u_lo + 2^32 u_hi) (v_lo + 2^32 v_hi) + // = (u_lo v_lo ) + 2^32 ((u_lo v_hi ) + (u_hi v_lo )) + 2^64 (u_hi v_hi ) + // = (p0 ) + 2^32 ((p1 ) + (p2 )) + 2^64 (p3 ) + // = (p0_lo + 2^32 p0_hi) + 2^32 ((p1_lo + 2^32 p1_hi) + (p2_lo + 2^32 p2_hi)) + 2^64 (p3 ) + // = (p0_lo ) + 2^32 (p0_hi + p1_lo + p2_lo ) + 2^64 (p1_hi + p2_hi + p3) + // = (p0_lo ) + 2^32 (Q ) + 2^64 (H ) + // = (p0_lo ) + 2^32 (Q_lo + 2^32 Q_hi ) + 2^64 (H ) + // + // (Since Q might be larger than 2^32 - 1) + // + // = (p0_lo + 2^32 Q_lo) + 2^64 (Q_hi + H) + // + // (Q_hi + H does not overflow a 64-bit int) + // + // = p_lo + 2^64 p_hi + + const std::uint64_t u_lo = x.f & 0xFFFFFFFFu; + const std::uint64_t u_hi = x.f >> 32u; + const std::uint64_t v_lo = y.f & 0xFFFFFFFFu; + const std::uint64_t v_hi = y.f >> 32u; + + const std::uint64_t p0 = u_lo * v_lo; + const std::uint64_t p1 = u_lo * v_hi; + const std::uint64_t p2 = u_hi * v_lo; + const std::uint64_t p3 = u_hi * v_hi; + + const std::uint64_t p0_hi = p0 >> 32u; + const std::uint64_t p1_lo = p1 & 0xFFFFFFFFu; + const std::uint64_t p1_hi = p1 >> 32u; + const std::uint64_t p2_lo = p2 & 0xFFFFFFFFu; + const std::uint64_t p2_hi = p2 >> 32u; + + std::uint64_t Q = p0_hi + p1_lo + p2_lo; + + // The full product might now be computed as + // + // p_hi = p3 + p2_hi + p1_hi + (Q >> 32) + // p_lo = p0_lo + (Q << 32) + // + // But in this particular case here, the full p_lo is not required. + // Effectively we only need to add the highest bit in p_lo to p_hi (and + // Q_hi + 1 does not overflow). + + Q += std::uint64_t{1} << (64u - 32u - 1u); // round, ties up + + const std::uint64_t h = p3 + p2_hi + p1_hi + (Q >> 32u); + + return {h, x.e + y.e + 64}; + } + + /*! + @brief normalize x such that the significand is >= 2^(q-1) + @pre x.f != 0 + */ + static diyfp normalize(diyfp x) noexcept + { + assert(x.f != 0); + + while ((x.f >> 63u) == 0) + { + x.f <<= 1u; + x.e--; + } + + return x; + } + + /*! + @brief normalize x such that the result has the exponent E + @pre e >= x.e and the upper e - x.e bits of x.f must be zero. + */ + static diyfp normalize_to(const diyfp& x, const int target_exponent) noexcept + { + const int delta = x.e - target_exponent; + + assert(delta >= 0); + assert(((x.f << delta) >> delta) == x.f); + + return {x.f << delta, target_exponent}; + } +}; + +struct boundaries +{ + diyfp w; + diyfp minus; + diyfp plus; +}; + +/*! +Compute the (normalized) diyfp representing the input number 'value' and its +boundaries. + +@pre value must be finite and positive +*/ +template <typename FloatType> +boundaries compute_boundaries(FloatType value) +{ + assert(std::isfinite(value)); + assert(value > 0); + + // Convert the IEEE representation into a diyfp. + // + // If v is denormal: + // value = 0.F * 2^(1 - bias) = ( F) * 2^(1 - bias - (p-1)) + // If v is normalized: + // value = 1.F * 2^(E - bias) = (2^(p-1) + F) * 2^(E - bias - (p-1)) + + static_assert(std::numeric_limits<FloatType>::is_iec559, + "internal error: dtoa_short requires an IEEE-754 floating-point implementation"); + + constexpr int kPrecision = std::numeric_limits<FloatType>::digits; // = p (includes the hidden bit) + constexpr int kBias = std::numeric_limits<FloatType>::max_exponent - 1 + (kPrecision - 1); + constexpr int kMinExp = 1 - kBias; + constexpr std::uint64_t kHiddenBit = std::uint64_t{1} << (kPrecision - 1); // = 2^(p-1) + + using bits_type = typename std::conditional<kPrecision == 24, std::uint32_t, std::uint64_t >::type; + + const std::uint64_t bits = reinterpret_bits<bits_type>(value); + const std::uint64_t E = bits >> (kPrecision - 1); + const std::uint64_t F = bits & (kHiddenBit - 1); + + const bool is_denormal = E == 0; + const diyfp v = is_denormal + ? diyfp(F, kMinExp) + : diyfp(F + kHiddenBit, static_cast<int>(E) - kBias); + + // Compute the boundaries m- and m+ of the floating-point value + // v = f * 2^e. + // + // Determine v- and v+, the floating-point predecessor and successor if v, + // respectively. + // + // v- = v - 2^e if f != 2^(p-1) or e == e_min (A) + // = v - 2^(e-1) if f == 2^(p-1) and e > e_min (B) + // + // v+ = v + 2^e + // + // Let m- = (v- + v) / 2 and m+ = (v + v+) / 2. All real numbers _strictly_ + // between m- and m+ round to v, regardless of how the input rounding + // algorithm breaks ties. + // + // ---+-------------+-------------+-------------+-------------+--- (A) + // v- m- v m+ v+ + // + // -----------------+------+------+-------------+-------------+--- (B) + // v- m- v m+ v+ + + const bool lower_boundary_is_closer = F == 0 and E > 1; + const diyfp m_plus = diyfp(2 * v.f + 1, v.e - 1); + const diyfp m_minus = lower_boundary_is_closer + ? diyfp(4 * v.f - 1, v.e - 2) // (B) + : diyfp(2 * v.f - 1, v.e - 1); // (A) + + // Determine the normalized w+ = m+. + const diyfp w_plus = diyfp::normalize(m_plus); + + // Determine w- = m- such that e_(w-) = e_(w+). + const diyfp w_minus = diyfp::normalize_to(m_minus, w_plus.e); + + return {diyfp::normalize(v), w_minus, w_plus}; +} + +// Given normalized diyfp w, Grisu needs to find a (normalized) cached +// power-of-ten c, such that the exponent of the product c * w = f * 2^e lies +// within a certain range [alpha, gamma] (Definition 3.2 from [1]) +// +// alpha <= e = e_c + e_w + q <= gamma +// +// or +// +// f_c * f_w * 2^alpha <= f_c 2^(e_c) * f_w 2^(e_w) * 2^q +// <= f_c * f_w * 2^gamma +// +// Since c and w are normalized, i.e. 2^(q-1) <= f < 2^q, this implies +// +// 2^(q-1) * 2^(q-1) * 2^alpha <= c * w * 2^q < 2^q * 2^q * 2^gamma +// +// or +// +// 2^(q - 2 + alpha) <= c * w < 2^(q + gamma) +// +// The choice of (alpha,gamma) determines the size of the table and the form of +// the digit generation procedure. Using (alpha,gamma)=(-60,-32) works out well +// in practice: +// +// The idea is to cut the number c * w = f * 2^e into two parts, which can be +// processed independently: An integral part p1, and a fractional part p2: +// +// f * 2^e = ( (f div 2^-e) * 2^-e + (f mod 2^-e) ) * 2^e +// = (f div 2^-e) + (f mod 2^-e) * 2^e +// = p1 + p2 * 2^e +// +// The conversion of p1 into decimal form requires a series of divisions and +// modulos by (a power of) 10. These operations are faster for 32-bit than for +// 64-bit integers, so p1 should ideally fit into a 32-bit integer. This can be +// achieved by choosing +// +// -e >= 32 or e <= -32 := gamma +// +// In order to convert the fractional part +// +// p2 * 2^e = p2 / 2^-e = d[-1] / 10^1 + d[-2] / 10^2 + ... +// +// into decimal form, the fraction is repeatedly multiplied by 10 and the digits +// d[-i] are extracted in order: +// +// (10 * p2) div 2^-e = d[-1] +// (10 * p2) mod 2^-e = d[-2] / 10^1 + ... +// +// The multiplication by 10 must not overflow. It is sufficient to choose +// +// 10 * p2 < 16 * p2 = 2^4 * p2 <= 2^64. +// +// Since p2 = f mod 2^-e < 2^-e, +// +// -e <= 60 or e >= -60 := alpha + +constexpr int kAlpha = -60; +constexpr int kGamma = -32; + +struct cached_power // c = f * 2^e ~= 10^k +{ + std::uint64_t f; + int e; + int k; +}; + +/*! +For a normalized diyfp w = f * 2^e, this function returns a (normalized) cached +power-of-ten c = f_c * 2^e_c, such that the exponent of the product w * c +satisfies (Definition 3.2 from [1]) + + alpha <= e_c + e + q <= gamma. +*/ +inline cached_power get_cached_power_for_binary_exponent(int e) +{ + // Now + // + // alpha <= e_c + e + q <= gamma (1) + // ==> f_c * 2^alpha <= c * 2^e * 2^q + // + // and since the c's are normalized, 2^(q-1) <= f_c, + // + // ==> 2^(q - 1 + alpha) <= c * 2^(e + q) + // ==> 2^(alpha - e - 1) <= c + // + // If c were an exact power of ten, i.e. c = 10^k, one may determine k as + // + // k = ceil( log_10( 2^(alpha - e - 1) ) ) + // = ceil( (alpha - e - 1) * log_10(2) ) + // + // From the paper: + // "In theory the result of the procedure could be wrong since c is rounded, + // and the computation itself is approximated [...]. In practice, however, + // this simple function is sufficient." + // + // For IEEE double precision floating-point numbers converted into + // normalized diyfp's w = f * 2^e, with q = 64, + // + // e >= -1022 (min IEEE exponent) + // -52 (p - 1) + // -52 (p - 1, possibly normalize denormal IEEE numbers) + // -11 (normalize the diyfp) + // = -1137 + // + // and + // + // e <= +1023 (max IEEE exponent) + // -52 (p - 1) + // -11 (normalize the diyfp) + // = 960 + // + // This binary exponent range [-1137,960] results in a decimal exponent + // range [-307,324]. One does not need to store a cached power for each + // k in this range. For each such k it suffices to find a cached power + // such that the exponent of the product lies in [alpha,gamma]. + // This implies that the difference of the decimal exponents of adjacent + // table entries must be less than or equal to + // + // floor( (gamma - alpha) * log_10(2) ) = 8. + // + // (A smaller distance gamma-alpha would require a larger table.) + + // NB: + // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34. + + constexpr int kCachedPowersMinDecExp = -300; + constexpr int kCachedPowersDecStep = 8; + + static constexpr std::array<cached_power, 79> kCachedPowers = + { + { + { 0xAB70FE17C79AC6CA, -1060, -300 }, + { 0xFF77B1FCBEBCDC4F, -1034, -292 }, + { 0xBE5691EF416BD60C, -1007, -284 }, + { 0x8DD01FAD907FFC3C, -980, -276 }, + { 0xD3515C2831559A83, -954, -268 }, + { 0x9D71AC8FADA6C9B5, -927, -260 }, + { 0xEA9C227723EE8BCB, -901, -252 }, + { 0xAECC49914078536D, -874, -244 }, + { 0x823C12795DB6CE57, -847, -236 }, + { 0xC21094364DFB5637, -821, -228 }, + { 0x9096EA6F3848984F, -794, -220 }, + { 0xD77485CB25823AC7, -768, -212 }, + { 0xA086CFCD97BF97F4, -741, -204 }, + { 0xEF340A98172AACE5, -715, -196 }, + { 0xB23867FB2A35B28E, -688, -188 }, + { 0x84C8D4DFD2C63F3B, -661, -180 }, + { 0xC5DD44271AD3CDBA, -635, -172 }, + { 0x936B9FCEBB25C996, -608, -164 }, + { 0xDBAC6C247D62A584, -582, -156 }, + { 0xA3AB66580D5FDAF6, -555, -148 }, + { 0xF3E2F893DEC3F126, -529, -140 }, + { 0xB5B5ADA8AAFF80B8, -502, -132 }, + { 0x87625F056C7C4A8B, -475, -124 }, + { 0xC9BCFF6034C13053, -449, -116 }, + { 0x964E858C91BA2655, -422, -108 }, + { 0xDFF9772470297EBD, -396, -100 }, + { 0xA6DFBD9FB8E5B88F, -369, -92 }, + { 0xF8A95FCF88747D94, -343, -84 }, + { 0xB94470938FA89BCF, -316, -76 }, + { 0x8A08F0F8BF0F156B, -289, -68 }, + { 0xCDB02555653131B6, -263, -60 }, + { 0x993FE2C6D07B7FAC, -236, -52 }, + { 0xE45C10C42A2B3B06, -210, -44 }, + { 0xAA242499697392D3, -183, -36 }, + { 0xFD87B5F28300CA0E, -157, -28 }, + { 0xBCE5086492111AEB, -130, -20 }, + { 0x8CBCCC096F5088CC, -103, -12 }, + { 0xD1B71758E219652C, -77, -4 }, + { 0x9C40000000000000, -50, 4 }, + { 0xE8D4A51000000000, -24, 12 }, + { 0xAD78EBC5AC620000, 3, 20 }, + { 0x813F3978F8940984, 30, 28 }, + { 0xC097CE7BC90715B3, 56, 36 }, + { 0x8F7E32CE7BEA5C70, 83, 44 }, + { 0xD5D238A4ABE98068, 109, 52 }, + { 0x9F4F2726179A2245, 136, 60 }, + { 0xED63A231D4C4FB27, 162, 68 }, + { 0xB0DE65388CC8ADA8, 189, 76 }, + { 0x83C7088E1AAB65DB, 216, 84 }, + { 0xC45D1DF942711D9A, 242, 92 }, + { 0x924D692CA61BE758, 269, 100 }, + { 0xDA01EE641A708DEA, 295, 108 }, + { 0xA26DA3999AEF774A, 322, 116 }, + { 0xF209787BB47D6B85, 348, 124 }, + { 0xB454E4A179DD1877, 375, 132 }, + { 0x865B86925B9BC5C2, 402, 140 }, + { 0xC83553C5C8965D3D, 428, 148 }, + { 0x952AB45CFA97A0B3, 455, 156 }, + { 0xDE469FBD99A05FE3, 481, 164 }, + { 0xA59BC234DB398C25, 508, 172 }, + { 0xF6C69A72A3989F5C, 534, 180 }, + { 0xB7DCBF5354E9BECE, 561, 188 }, + { 0x88FCF317F22241E2, 588, 196 }, + { 0xCC20CE9BD35C78A5, 614, 204 }, + { 0x98165AF37B2153DF, 641, 212 }, + { 0xE2A0B5DC971F303A, 667, 220 }, + { 0xA8D9D1535CE3B396, 694, 228 }, + { 0xFB9B7CD9A4A7443C, 720, 236 }, + { 0xBB764C4CA7A44410, 747, 244 }, + { 0x8BAB8EEFB6409C1A, 774, 252 }, + { 0xD01FEF10A657842C, 800, 260 }, + { 0x9B10A4E5E9913129, 827, 268 }, + { 0xE7109BFBA19C0C9D, 853, 276 }, + { 0xAC2820D9623BF429, 880, 284 }, + { 0x80444B5E7AA7CF85, 907, 292 }, + { 0xBF21E44003ACDD2D, 933, 300 }, + { 0x8E679C2F5E44FF8F, 960, 308 }, + { 0xD433179D9C8CB841, 986, 316 }, + { 0x9E19DB92B4E31BA9, 1013, 324 }, + } + }; + + // This computation gives exactly the same results for k as + // k = ceil((kAlpha - e - 1) * 0.30102999566398114) + // for |e| <= 1500, but doesn't require floating-point operations. + // NB: log_10(2) ~= 78913 / 2^18 + assert(e >= -1500); + assert(e <= 1500); + const int f = kAlpha - e - 1; + const int k = (f * 78913) / (1 << 18) + static_cast<int>(f > 0); + + const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / kCachedPowersDecStep; + assert(index >= 0); + assert(static_cast<std::size_t>(index) < kCachedPowers.size()); + + const cached_power cached = kCachedPowers[static_cast<std::size_t>(index)]; + assert(kAlpha <= cached.e + e + 64); + assert(kGamma >= cached.e + e + 64); + + return cached; +} + +/*! +For n != 0, returns k, such that pow10 := 10^(k-1) <= n < 10^k. +For n == 0, returns 1 and sets pow10 := 1. +*/ +inline int find_largest_pow10(const std::uint32_t n, std::uint32_t& pow10) +{ + // LCOV_EXCL_START + if (n >= 1000000000) + { + pow10 = 1000000000; + return 10; + } + // LCOV_EXCL_STOP + else if (n >= 100000000) + { + pow10 = 100000000; + return 9; + } + else if (n >= 10000000) + { + pow10 = 10000000; + return 8; + } + else if (n >= 1000000) + { + pow10 = 1000000; + return 7; + } + else if (n >= 100000) + { + pow10 = 100000; + return 6; + } + else if (n >= 10000) + { + pow10 = 10000; + return 5; + } + else if (n >= 1000) + { + pow10 = 1000; + return 4; + } + else if (n >= 100) + { + pow10 = 100; + return 3; + } + else if (n >= 10) + { + pow10 = 10; + return 2; + } + else + { + pow10 = 1; + return 1; + } +} + +inline void grisu2_round(char* buf, int len, std::uint64_t dist, std::uint64_t delta, + std::uint64_t rest, std::uint64_t ten_k) +{ + assert(len >= 1); + assert(dist <= delta); + assert(rest <= delta); + assert(ten_k > 0); + + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // ten_k + // <------> + // <---- rest ----> + // --------------[------------------+----+--------------]-------------- + // w V + // = buf * 10^k + // + // ten_k represents a unit-in-the-last-place in the decimal representation + // stored in buf. + // Decrement buf by ten_k while this takes buf closer to w. + + // The tests are written in this order to avoid overflow in unsigned + // integer arithmetic. + + while (rest < dist + and delta - rest >= ten_k + and (rest + ten_k < dist or dist - rest > rest + ten_k - dist)) + { + assert(buf[len - 1] != '0'); + buf[len - 1]--; + rest += ten_k; + } +} + +/*! +Generates V = buffer * 10^decimal_exponent, such that M- <= V <= M+. +M- and M+ must be normalized and share the same exponent -60 <= e <= -32. +*/ +inline void grisu2_digit_gen(char* buffer, int& length, int& decimal_exponent, + diyfp M_minus, diyfp w, diyfp M_plus) +{ + static_assert(kAlpha >= -60, "internal error"); + static_assert(kGamma <= -32, "internal error"); + + // Generates the digits (and the exponent) of a decimal floating-point + // number V = buffer * 10^decimal_exponent in the range [M-, M+]. The diyfp's + // w, M- and M+ share the same exponent e, which satisfies alpha <= e <= gamma. + // + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // Grisu2 generates the digits of M+ from left to right and stops as soon as + // V is in [M-,M+]. + + assert(M_plus.e >= kAlpha); + assert(M_plus.e <= kGamma); + + std::uint64_t delta = diyfp::sub(M_plus, M_minus).f; // (significand of (M+ - M-), implicit exponent is e) + std::uint64_t dist = diyfp::sub(M_plus, w ).f; // (significand of (M+ - w ), implicit exponent is e) + + // Split M+ = f * 2^e into two parts p1 and p2 (note: e < 0): + // + // M+ = f * 2^e + // = ((f div 2^-e) * 2^-e + (f mod 2^-e)) * 2^e + // = ((p1 ) * 2^-e + (p2 )) * 2^e + // = p1 + p2 * 2^e + + const diyfp one(std::uint64_t{1} << -M_plus.e, M_plus.e); + + auto p1 = static_cast<std::uint32_t>(M_plus.f >> -one.e); // p1 = f div 2^-e (Since -e >= 32, p1 fits into a 32-bit int.) + std::uint64_t p2 = M_plus.f & (one.f - 1); // p2 = f mod 2^-e + + // 1) + // + // Generate the digits of the integral part p1 = d[n-1]...d[1]d[0] + + assert(p1 > 0); + + std::uint32_t pow10; + const int k = find_largest_pow10(p1, pow10); + + // 10^(k-1) <= p1 < 10^k, pow10 = 10^(k-1) + // + // p1 = (p1 div 10^(k-1)) * 10^(k-1) + (p1 mod 10^(k-1)) + // = (d[k-1] ) * 10^(k-1) + (p1 mod 10^(k-1)) + // + // M+ = p1 + p2 * 2^e + // = d[k-1] * 10^(k-1) + (p1 mod 10^(k-1)) + p2 * 2^e + // = d[k-1] * 10^(k-1) + ((p1 mod 10^(k-1)) * 2^-e + p2) * 2^e + // = d[k-1] * 10^(k-1) + ( rest) * 2^e + // + // Now generate the digits d[n] of p1 from left to right (n = k-1,...,0) + // + // p1 = d[k-1]...d[n] * 10^n + d[n-1]...d[0] + // + // but stop as soon as + // + // rest * 2^e = (d[n-1]...d[0] * 2^-e + p2) * 2^e <= delta * 2^e + + int n = k; + while (n > 0) + { + // Invariants: + // M+ = buffer * 10^n + (p1 + p2 * 2^e) (buffer = 0 for n = k) + // pow10 = 10^(n-1) <= p1 < 10^n + // + const std::uint32_t d = p1 / pow10; // d = p1 div 10^(n-1) + const std::uint32_t r = p1 % pow10; // r = p1 mod 10^(n-1) + // + // M+ = buffer * 10^n + (d * 10^(n-1) + r) + p2 * 2^e + // = (buffer * 10 + d) * 10^(n-1) + (r + p2 * 2^e) + // + assert(d <= 9); + buffer[length++] = static_cast<char>('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(n-1) + (r + p2 * 2^e) + // + p1 = r; + n--; + // + // M+ = buffer * 10^n + (p1 + p2 * 2^e) + // pow10 = 10^n + // + + // Now check if enough digits have been generated. + // Compute + // + // p1 + p2 * 2^e = (p1 * 2^-e + p2) * 2^e = rest * 2^e + // + // Note: + // Since rest and delta share the same exponent e, it suffices to + // compare the significands. + const std::uint64_t rest = (std::uint64_t{p1} << -one.e) + p2; + if (rest <= delta) + { + // V = buffer * 10^n, with M- <= V <= M+. + + decimal_exponent += n; + + // We may now just stop. But instead look if the buffer could be + // decremented to bring V closer to w. + // + // pow10 = 10^n is now 1 ulp in the decimal representation V. + // The rounding procedure works with diyfp's with an implicit + // exponent of e. + // + // 10^n = (10^n * 2^-e) * 2^e = ulp * 2^e + // + const std::uint64_t ten_n = std::uint64_t{pow10} << -one.e; + grisu2_round(buffer, length, dist, delta, rest, ten_n); + + return; + } + + pow10 /= 10; + // + // pow10 = 10^(n-1) <= p1 < 10^n + // Invariants restored. + } + + // 2) + // + // The digits of the integral part have been generated: + // + // M+ = d[k-1]...d[1]d[0] + p2 * 2^e + // = buffer + p2 * 2^e + // + // Now generate the digits of the fractional part p2 * 2^e. + // + // Note: + // No decimal point is generated: the exponent is adjusted instead. + // + // p2 actually represents the fraction + // + // p2 * 2^e + // = p2 / 2^-e + // = d[-1] / 10^1 + d[-2] / 10^2 + ... + // + // Now generate the digits d[-m] of p1 from left to right (m = 1,2,...) + // + // p2 * 2^e = d[-1]d[-2]...d[-m] * 10^-m + // + 10^-m * (d[-m-1] / 10^1 + d[-m-2] / 10^2 + ...) + // + // using + // + // 10^m * p2 = ((10^m * p2) div 2^-e) * 2^-e + ((10^m * p2) mod 2^-e) + // = ( d) * 2^-e + ( r) + // + // or + // 10^m * p2 * 2^e = d + r * 2^e + // + // i.e. + // + // M+ = buffer + p2 * 2^e + // = buffer + 10^-m * (d + r * 2^e) + // = (buffer * 10^m + d) * 10^-m + 10^-m * r * 2^e + // + // and stop as soon as 10^-m * r * 2^e <= delta * 2^e + + assert(p2 > delta); + + int m = 0; + for (;;) + { + // Invariant: + // M+ = buffer * 10^-m + 10^-m * (d[-m-1] / 10 + d[-m-2] / 10^2 + ...) * 2^e + // = buffer * 10^-m + 10^-m * (p2 ) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (10 * p2) ) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * ((10*p2 div 2^-e) * 2^-e + (10*p2 mod 2^-e)) * 2^e + // + assert(p2 <= (std::numeric_limits<std::uint64_t>::max)() / 10); + p2 *= 10; + const std::uint64_t d = p2 >> -one.e; // d = (10 * p2) div 2^-e + const std::uint64_t r = p2 & (one.f - 1); // r = (10 * p2) mod 2^-e + // + // M+ = buffer * 10^-m + 10^-m * (1/10 * (d * 2^-e + r) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (d + r * 2^e)) + // = (buffer * 10 + d) * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + assert(d <= 9); + buffer[length++] = static_cast<char>('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + p2 = r; + m++; + // + // M+ = buffer * 10^-m + 10^-m * p2 * 2^e + // Invariant restored. + + // Check if enough digits have been generated. + // + // 10^-m * p2 * 2^e <= delta * 2^e + // p2 * 2^e <= 10^m * delta * 2^e + // p2 <= 10^m * delta + delta *= 10; + dist *= 10; + if (p2 <= delta) + { + break; + } + } + + // V = buffer * 10^-m, with M- <= V <= M+. + + decimal_exponent -= m; + + // 1 ulp in the decimal representation is now 10^-m. + // Since delta and dist are now scaled by 10^m, we need to do the + // same with ulp in order to keep the units in sync. + // + // 10^m * 10^-m = 1 = 2^-e * 2^e = ten_m * 2^e + // + const std::uint64_t ten_m = one.f; + grisu2_round(buffer, length, dist, delta, p2, ten_m); + + // By construction this algorithm generates the shortest possible decimal + // number (Loitsch, Theorem 6.2) which rounds back to w. + // For an input number of precision p, at least + // + // N = 1 + ceil(p * log_10(2)) + // + // decimal digits are sufficient to identify all binary floating-point + // numbers (Matula, "In-and-Out conversions"). + // This implies that the algorithm does not produce more than N decimal + // digits. + // + // N = 17 for p = 53 (IEEE double precision) + // N = 9 for p = 24 (IEEE single precision) +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +JSON_HEDLEY_NON_NULL(1) +inline void grisu2(char* buf, int& len, int& decimal_exponent, + diyfp m_minus, diyfp v, diyfp m_plus) +{ + assert(m_plus.e == m_minus.e); + assert(m_plus.e == v.e); + + // --------(-----------------------+-----------------------)-------- (A) + // m- v m+ + // + // --------------------(-----------+-----------------------)-------- (B) + // m- v m+ + // + // First scale v (and m- and m+) such that the exponent is in the range + // [alpha, gamma]. + + const cached_power cached = get_cached_power_for_binary_exponent(m_plus.e); + + const diyfp c_minus_k(cached.f, cached.e); // = c ~= 10^-k + + // The exponent of the products is = v.e + c_minus_k.e + q and is in the range [alpha,gamma] + const diyfp w = diyfp::mul(v, c_minus_k); + const diyfp w_minus = diyfp::mul(m_minus, c_minus_k); + const diyfp w_plus = diyfp::mul(m_plus, c_minus_k); + + // ----(---+---)---------------(---+---)---------------(---+---)---- + // w- w w+ + // = c*m- = c*v = c*m+ + // + // diyfp::mul rounds its result and c_minus_k is approximated too. w, w- and + // w+ are now off by a small amount. + // In fact: + // + // w - v * 10^k < 1 ulp + // + // To account for this inaccuracy, add resp. subtract 1 ulp. + // + // --------+---[---------------(---+---)---------------]---+-------- + // w- M- w M+ w+ + // + // Now any number in [M-, M+] (bounds included) will round to w when input, + // regardless of how the input rounding algorithm breaks ties. + // + // And digit_gen generates the shortest possible such number in [M-, M+]. + // Note that this does not mean that Grisu2 always generates the shortest + // possible number in the interval (m-, m+). + const diyfp M_minus(w_minus.f + 1, w_minus.e); + const diyfp M_plus (w_plus.f - 1, w_plus.e ); + + decimal_exponent = -cached.k; // = -(-k) = k + + grisu2_digit_gen(buf, len, decimal_exponent, M_minus, w, M_plus); +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +template <typename FloatType> +JSON_HEDLEY_NON_NULL(1) +void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) +{ + static_assert(diyfp::kPrecision >= std::numeric_limits<FloatType>::digits + 3, + "internal error: not enough precision"); + + assert(std::isfinite(value)); + assert(value > 0); + + // If the neighbors (and boundaries) of 'value' are always computed for double-precision + // numbers, all float's can be recovered using strtod (and strtof). However, the resulting + // decimal representations are not exactly "short". + // + // The documentation for 'std::to_chars' (https://en.cppreference.com/w/cpp/utility/to_chars) + // says "value is converted to a string as if by std::sprintf in the default ("C") locale" + // and since sprintf promotes float's to double's, I think this is exactly what 'std::to_chars' + // does. + // On the other hand, the documentation for 'std::to_chars' requires that "parsing the + // representation using the corresponding std::from_chars function recovers value exactly". That + // indicates that single precision floating-point numbers should be recovered using + // 'std::strtof'. + // + // NB: If the neighbors are computed for single-precision numbers, there is a single float + // (7.0385307e-26f) which can't be recovered using strtod. The resulting double precision + // value is off by 1 ulp. +#if 0 + const boundaries w = compute_boundaries(static_cast<double>(value)); +#else + const boundaries w = compute_boundaries(value); +#endif + + grisu2(buf, len, decimal_exponent, w.minus, w.w, w.plus); +} + +/*! +@brief appends a decimal representation of e to buf +@return a pointer to the element following the exponent. +@pre -1000 < e < 1000 +*/ +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL +inline char* append_exponent(char* buf, int e) +{ + assert(e > -1000); + assert(e < 1000); + + if (e < 0) + { + e = -e; + *buf++ = '-'; + } + else + { + *buf++ = '+'; + } + + auto k = static_cast<std::uint32_t>(e); + if (k < 10) + { + // Always print at least two digits in the exponent. + // This is for compatibility with printf("%g"). + *buf++ = '0'; + *buf++ = static_cast<char>('0' + k); + } + else if (k < 100) + { + *buf++ = static_cast<char>('0' + k / 10); + k %= 10; + *buf++ = static_cast<char>('0' + k); + } + else + { + *buf++ = static_cast<char>('0' + k / 100); + k %= 100; + *buf++ = static_cast<char>('0' + k / 10); + k %= 10; + *buf++ = static_cast<char>('0' + k); + } + + return buf; +} + +/*! +@brief prettify v = buf * 10^decimal_exponent + +If v is in the range [10^min_exp, 10^max_exp) it will be printed in fixed-point +notation. Otherwise it will be printed in exponential notation. + +@pre min_exp < 0 +@pre max_exp > 0 +*/ +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL +inline char* format_buffer(char* buf, int len, int decimal_exponent, + int min_exp, int max_exp) +{ + assert(min_exp < 0); + assert(max_exp > 0); + + const int k = len; + const int n = len + decimal_exponent; + + // v = buf * 10^(n-k) + // k is the length of the buffer (number of decimal digits) + // n is the position of the decimal point relative to the start of the buffer. + + if (k <= n and n <= max_exp) + { + // digits[000] + // len <= max_exp + 2 + + std::memset(buf + k, '0', static_cast<size_t>(n) - static_cast<size_t>(k)); + // Make it look like a floating-point number (#362, #378) + buf[n + 0] = '.'; + buf[n + 1] = '0'; + return buf + (static_cast<size_t>(n) + 2); + } + + if (0 < n and n <= max_exp) + { + // dig.its + // len <= max_digits10 + 1 + + assert(k > n); + + std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n, static_cast<size_t>(k) - static_cast<size_t>(n)); + buf[n] = '.'; + return buf + (static_cast<size_t>(k) + 1U); + } + + if (min_exp < n and n <= 0) + { + // 0.[000]digits + // len <= 2 + (-min_exp - 1) + max_digits10 + + std::memmove(buf + (2 + static_cast<size_t>(-n)), buf, static_cast<size_t>(k)); + buf[0] = '0'; + buf[1] = '.'; + std::memset(buf + 2, '0', static_cast<size_t>(-n)); + return buf + (2U + static_cast<size_t>(-n) + static_cast<size_t>(k)); + } + + if (k == 1) + { + // dE+123 + // len <= 1 + 5 + + buf += 1; + } + else + { + // d.igitsE+123 + // len <= max_digits10 + 1 + 5 + + std::memmove(buf + 2, buf + 1, static_cast<size_t>(k) - 1); + buf[1] = '.'; + buf += 1 + static_cast<size_t>(k); + } + + *buf++ = 'e'; + return append_exponent(buf, n - 1); +} + +} // namespace dtoa_impl + +/*! +@brief generates a decimal representation of the floating-point number value in [first, last). + +The format of the resulting decimal representation is similar to printf's %g +format. Returns an iterator pointing past-the-end of the decimal representation. + +@note The input number must be finite, i.e. NaN's and Inf's are not supported. +@note The buffer must be large enough. +@note The result is NOT null-terminated. +*/ +template <typename FloatType> +JSON_HEDLEY_NON_NULL(1, 2) +JSON_HEDLEY_RETURNS_NON_NULL +char* to_chars(char* first, const char* last, FloatType value) +{ + static_cast<void>(last); // maybe unused - fix warning + assert(std::isfinite(value)); + + // Use signbit(value) instead of (value < 0) since signbit works for -0. + if (std::signbit(value)) + { + value = -value; + *first++ = '-'; + } + + if (value == 0) // +-0 + { + *first++ = '0'; + // Make it look like a floating-point number (#362, #378) + *first++ = '.'; + *first++ = '0'; + return first; + } + + assert(last - first >= std::numeric_limits<FloatType>::max_digits10); + + // Compute v = buffer * 10^decimal_exponent. + // The decimal digits are stored in the buffer, which needs to be interpreted + // as an unsigned decimal integer. + // len is the length of the buffer, i.e. the number of decimal digits. + int len = 0; + int decimal_exponent = 0; + dtoa_impl::grisu2(first, len, decimal_exponent, value); + + assert(len <= std::numeric_limits<FloatType>::max_digits10); + + // Format the buffer like printf("%.*g", prec, value) + constexpr int kMinExp = -4; + // Use digits10 here to increase compatibility with version 2. + constexpr int kMaxExp = std::numeric_limits<FloatType>::digits10; + + assert(last - first >= kMaxExp + 2); + assert(last - first >= 2 + (-kMinExp - 1) + std::numeric_limits<FloatType>::max_digits10); + assert(last - first >= std::numeric_limits<FloatType>::max_digits10 + 6); + + return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp, kMaxExp); +} + +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/exceptions.hpp> + +// #include <nlohmann/detail/macro_scope.hpp> + +// #include <nlohmann/detail/meta/cpp_future.hpp> + +// #include <nlohmann/detail/output/binary_writer.hpp> + +// #include <nlohmann/detail/output/output_adapters.hpp> + +// #include <nlohmann/detail/value_t.hpp> + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// serialization // +/////////////////// + +/// how to treat decoding errors +enum class error_handler_t +{ + strict, ///< throw a type_error exception in case of invalid UTF-8 + replace, ///< replace invalid UTF-8 sequences with U+FFFD + ignore ///< ignore invalid UTF-8 sequences +}; + +template<typename BasicJsonType> +class serializer +{ + using string_t = typename BasicJsonType::string_t; + using number_float_t = typename BasicJsonType::number_float_t; + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using binary_t = typename BasicJsonType::binary_t; + static constexpr std::uint8_t UTF8_ACCEPT = 0; + static constexpr std::uint8_t UTF8_REJECT = 1; + + public: + /*! + @param[in] s output stream to serialize to + @param[in] ichar indentation character to use + @param[in] error_handler_ how to react on decoding errors + */ + serializer(output_adapter_t<char> s, const char ichar, + error_handler_t error_handler_ = error_handler_t::strict) + : o(std::move(s)) + , loc(std::localeconv()) + , thousands_sep(loc->thousands_sep == nullptr ? '\0' : * (loc->thousands_sep)) + , decimal_point(loc->decimal_point == nullptr ? '\0' : * (loc->decimal_point)) + , indent_char(ichar) + , indent_string(512, indent_char) + , error_handler(error_handler_) + {} + + // delete because of pointer members + serializer(const serializer&) = delete; + serializer& operator=(const serializer&) = delete; + serializer(serializer&&) = delete; + serializer& operator=(serializer&&) = delete; + ~serializer() = default; + + /*! + @brief internal implementation of the serialization function + + This function is called by the public member function dump and organizes + the serialization internally. The indentation level is propagated as + additional parameter. In case of arrays and objects, the function is + called recursively. + + - strings and object keys are escaped using `escape_string()` + - integer numbers are converted implicitly via `operator<<` + - floating-point numbers are converted to a string using `"%g"` format + - if specified to, binary values are output using the syntax `b[]`, otherwise an exception is thrown + + @param[in] val value to serialize + @param[in] pretty_print whether the output shall be pretty-printed + @param[in] indent_step the indent level + @param[in] current_indent the current indent level (only used internally) + @param[in] serialize_binary whether the output shall include non-standard binary output + */ + void dump(const BasicJsonType& val, const bool pretty_print, + const bool ensure_ascii, + const unsigned int indent_step, + const unsigned int current_indent = 0, + const bool serialize_binary = false) + { + switch (val.m_type) + { + case value_t::object: + { + if (val.m_value.object->empty()) + { + o->write_characters("{}", 2); + return; + } + + if (pretty_print) + { + o->write_characters("{\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + // first n-1 elements + auto i = val.m_value.object->cbegin(); + for (std::size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i) + { + o->write_characters(indent_string.c_str(), new_indent); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\": ", 3); + dump(i->second, true, ensure_ascii, indent_step, new_indent, serialize_binary); + o->write_characters(",\n", 2); + } + + // last element + assert(i != val.m_value.object->cend()); + assert(std::next(i) == val.m_value.object->cend()); + o->write_characters(indent_string.c_str(), new_indent); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\": ", 3); + dump(i->second, true, ensure_ascii, indent_step, new_indent, serialize_binary); + + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character('}'); + } + else + { + o->write_character('{'); + + // first n-1 elements + auto i = val.m_value.object->cbegin(); + for (std::size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i) + { + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\":", 2); + dump(i->second, false, ensure_ascii, indent_step, current_indent, serialize_binary); + o->write_character(','); + } + + // last element + assert(i != val.m_value.object->cend()); + assert(std::next(i) == val.m_value.object->cend()); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\":", 2); + dump(i->second, false, ensure_ascii, indent_step, current_indent, serialize_binary); + + o->write_character('}'); + } + + return; + } + + case value_t::array: + { + if (val.m_value.array->empty()) + { + o->write_characters("[]", 2); + return; + } + + if (pretty_print) + { + o->write_characters("[\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + // first n-1 elements + for (auto i = val.m_value.array->cbegin(); + i != val.m_value.array->cend() - 1; ++i) + { + o->write_characters(indent_string.c_str(), new_indent); + dump(*i, true, ensure_ascii, indent_step, new_indent, serialize_binary); + o->write_characters(",\n", 2); + } + + // last element + assert(not val.m_value.array->empty()); + o->write_characters(indent_string.c_str(), new_indent); + dump(val.m_value.array->back(), true, ensure_ascii, indent_step, new_indent, serialize_binary); + + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character(']'); + } + else + { + o->write_character('['); + + // first n-1 elements + for (auto i = val.m_value.array->cbegin(); + i != val.m_value.array->cend() - 1; ++i) + { + dump(*i, false, ensure_ascii, indent_step, current_indent, serialize_binary); + o->write_character(','); + } + + // last element + assert(not val.m_value.array->empty()); + dump(val.m_value.array->back(), false, ensure_ascii, indent_step, current_indent, serialize_binary); + + o->write_character(']'); + } + + return; + } + + case value_t::string: + { + o->write_character('\"'); + dump_escaped(*val.m_value.string, ensure_ascii); + o->write_character('\"'); + return; + } + + case value_t::binary: + { + if (not serialize_binary) + { + JSON_THROW(type_error::create(317, "cannot serialize binary data to text JSON")); + } + + if (val.m_value.binary->empty()) + { + o->write_characters("b[]", 3); + } + else if (pretty_print) + { + o->write_characters("b[", 2); + for (auto i = val.m_value.binary->cbegin(); + i != val.m_value.binary->cend() - 1; ++i) + { + dump_integer(*i); + o->write_character(','); + if (std::distance(val.m_value.binary->cbegin(), i) % 16 == 0) + { + o->write_character('\n'); + } + else + { + o->write_character(' '); + } + } + + dump_integer(val.m_value.binary->back()); + o->write_character(']'); + } + else + { + o->write_characters("b[", 2); + for (auto i = val.m_value.binary->cbegin(); + i != val.m_value.binary->cend() - 1; ++i) + { + dump_integer(*i); + o->write_character(','); + } + + dump_integer(val.m_value.binary->back()); + o->write_character(']'); + } + return; + } + + case value_t::boolean: + { + if (val.m_value.boolean) + { + o->write_characters("true", 4); + } + else + { + o->write_characters("false", 5); + } + return; + } + + case value_t::number_integer: + { + dump_integer(val.m_value.number_integer); + return; + } + + case value_t::number_unsigned: + { + dump_integer(val.m_value.number_unsigned); + return; + } + + case value_t::number_float: + { + dump_float(val.m_value.number_float); + return; + } + + case value_t::discarded: + { + o->write_characters("<discarded>", 11); + return; + } + + case value_t::null: + { + o->write_characters("null", 4); + return; + } + + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + } + + private: + /*! + @brief dump escaped string + + Escape a string by replacing certain special characters by a sequence of an + escape character (backslash) and another character and other control + characters by a sequence of "\u" followed by a four-digit hex + representation. The escaped string is written to output stream @a o. + + @param[in] s the string to escape + @param[in] ensure_ascii whether to escape non-ASCII characters with + \uXXXX sequences + + @complexity Linear in the length of string @a s. + */ + void dump_escaped(const string_t& s, const bool ensure_ascii) + { + std::uint32_t codepoint; + std::uint8_t state = UTF8_ACCEPT; + std::size_t bytes = 0; // number of bytes written to string_buffer + + // number of bytes written at the point of the last valid byte + std::size_t bytes_after_last_accept = 0; + std::size_t undumped_chars = 0; + + for (std::size_t i = 0; i < s.size(); ++i) + { + const auto byte = static_cast<uint8_t>(s[i]); + + switch (decode(state, codepoint, byte)) + { + case UTF8_ACCEPT: // decode found a new code point + { + switch (codepoint) + { + case 0x08: // backspace + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'b'; + break; + } + + case 0x09: // horizontal tab + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 't'; + break; + } + + case 0x0A: // newline + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'n'; + break; + } + + case 0x0C: // formfeed + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'f'; + break; + } + + case 0x0D: // carriage return + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'r'; + break; + } + + case 0x22: // quotation mark + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = '\"'; + break; + } + + case 0x5C: // reverse solidus + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = '\\'; + break; + } + + default: + { + // escape control characters (0x00..0x1F) or, if + // ensure_ascii parameter is used, non-ASCII characters + if ((codepoint <= 0x1F) or (ensure_ascii and (codepoint >= 0x7F))) + { + if (codepoint <= 0xFFFF) + { + (std::snprintf)(string_buffer.data() + bytes, 7, "\\u%04x", + static_cast<std::uint16_t>(codepoint)); + bytes += 6; + } + else + { + (std::snprintf)(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x", + static_cast<std::uint16_t>(0xD7C0u + (codepoint >> 10u)), + static_cast<std::uint16_t>(0xDC00u + (codepoint & 0x3FFu))); + bytes += 12; + } + } + else + { + // copy byte to buffer (all previous bytes + // been copied have in default case above) + string_buffer[bytes++] = s[i]; + } + break; + } + } + + // write buffer and reset index; there must be 13 bytes + // left, as this is the maximal number of bytes to be + // written ("\uxxxx\uxxxx\0") for one code point + if (string_buffer.size() - bytes < 13) + { + o->write_characters(string_buffer.data(), bytes); + bytes = 0; + } + + // remember the byte position of this accept + bytes_after_last_accept = bytes; + undumped_chars = 0; + break; + } + + case UTF8_REJECT: // decode found invalid UTF-8 byte + { + switch (error_handler) + { + case error_handler_t::strict: + { + std::string sn(3, '\0'); + (std::snprintf)(&sn[0], sn.size(), "%.2X", byte); + JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + sn)); + } + + case error_handler_t::ignore: + case error_handler_t::replace: + { + // in case we saw this character the first time, we + // would like to read it again, because the byte + // may be OK for itself, but just not OK for the + // previous sequence + if (undumped_chars > 0) + { + --i; + } + + // reset length buffer to the last accepted index; + // thus removing/ignoring the invalid characters + bytes = bytes_after_last_accept; + + if (error_handler == error_handler_t::replace) + { + // add a replacement character + if (ensure_ascii) + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'u'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'd'; + } + else + { + string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xEF'); + string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBF'); + string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBD'); + } + + // write buffer and reset index; there must be 13 bytes + // left, as this is the maximal number of bytes to be + // written ("\uxxxx\uxxxx\0") for one code point + if (string_buffer.size() - bytes < 13) + { + o->write_characters(string_buffer.data(), bytes); + bytes = 0; + } + + bytes_after_last_accept = bytes; + } + + undumped_chars = 0; + + // continue processing the string + state = UTF8_ACCEPT; + break; + } + + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + break; + } + + default: // decode found yet incomplete multi-byte code point + { + if (not ensure_ascii) + { + // code point will not be escaped - copy byte to buffer + string_buffer[bytes++] = s[i]; + } + ++undumped_chars; + break; + } + } + } + + // we finished processing the string + if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) + { + // write buffer + if (bytes > 0) + { + o->write_characters(string_buffer.data(), bytes); + } + } + else + { + // we finish reading, but do not accept: string was incomplete + switch (error_handler) + { + case error_handler_t::strict: + { + std::string sn(3, '\0'); + (std::snprintf)(&sn[0], sn.size(), "%.2X", static_cast<std::uint8_t>(s.back())); + JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn)); + } + + case error_handler_t::ignore: + { + // write all accepted bytes + o->write_characters(string_buffer.data(), bytes_after_last_accept); + break; + } + + case error_handler_t::replace: + { + // write all accepted bytes + o->write_characters(string_buffer.data(), bytes_after_last_accept); + // add a replacement character + if (ensure_ascii) + { + o->write_characters("\\ufffd", 6); + } + else + { + o->write_characters("\xEF\xBF\xBD", 3); + } + break; + } + + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + } + } + + /*! + @brief count digits + + Count the number of decimal (base 10) digits for an input unsigned integer. + + @param[in] x unsigned integer number to count its digits + @return number of decimal digits + */ + inline unsigned int count_digits(number_unsigned_t x) noexcept + { + unsigned int n_digits = 1; + for (;;) + { + if (x < 10) + { + return n_digits; + } + if (x < 100) + { + return n_digits + 1; + } + if (x < 1000) + { + return n_digits + 2; + } + if (x < 10000) + { + return n_digits + 3; + } + x = x / 10000u; + n_digits += 4; + } + } + + /*! + @brief dump an integer + + Dump a given integer to output stream @a o. Works internally with + @a number_buffer. + + @param[in] x integer number (signed or unsigned) to dump + @tparam NumberType either @a number_integer_t or @a number_unsigned_t + */ + template<typename NumberType, detail::enable_if_t< + std::is_same<NumberType, number_unsigned_t>::value or + std::is_same<NumberType, number_integer_t>::value or + std::is_same<NumberType, typename binary_t::value_type>::value, + int> = 0> + void dump_integer(NumberType x) + { + static constexpr std::array<std::array<char, 2>, 100> digits_to_99 + { + { + {{'0', '0'}}, {{'0', '1'}}, {{'0', '2'}}, {{'0', '3'}}, {{'0', '4'}}, {{'0', '5'}}, {{'0', '6'}}, {{'0', '7'}}, {{'0', '8'}}, {{'0', '9'}}, + {{'1', '0'}}, {{'1', '1'}}, {{'1', '2'}}, {{'1', '3'}}, {{'1', '4'}}, {{'1', '5'}}, {{'1', '6'}}, {{'1', '7'}}, {{'1', '8'}}, {{'1', '9'}}, + {{'2', '0'}}, {{'2', '1'}}, {{'2', '2'}}, {{'2', '3'}}, {{'2', '4'}}, {{'2', '5'}}, {{'2', '6'}}, {{'2', '7'}}, {{'2', '8'}}, {{'2', '9'}}, + {{'3', '0'}}, {{'3', '1'}}, {{'3', '2'}}, {{'3', '3'}}, {{'3', '4'}}, {{'3', '5'}}, {{'3', '6'}}, {{'3', '7'}}, {{'3', '8'}}, {{'3', '9'}}, + {{'4', '0'}}, {{'4', '1'}}, {{'4', '2'}}, {{'4', '3'}}, {{'4', '4'}}, {{'4', '5'}}, {{'4', '6'}}, {{'4', '7'}}, {{'4', '8'}}, {{'4', '9'}}, + {{'5', '0'}}, {{'5', '1'}}, {{'5', '2'}}, {{'5', '3'}}, {{'5', '4'}}, {{'5', '5'}}, {{'5', '6'}}, {{'5', '7'}}, {{'5', '8'}}, {{'5', '9'}}, + {{'6', '0'}}, {{'6', '1'}}, {{'6', '2'}}, {{'6', '3'}}, {{'6', '4'}}, {{'6', '5'}}, {{'6', '6'}}, {{'6', '7'}}, {{'6', '8'}}, {{'6', '9'}}, + {{'7', '0'}}, {{'7', '1'}}, {{'7', '2'}}, {{'7', '3'}}, {{'7', '4'}}, {{'7', '5'}}, {{'7', '6'}}, {{'7', '7'}}, {{'7', '8'}}, {{'7', '9'}}, + {{'8', '0'}}, {{'8', '1'}}, {{'8', '2'}}, {{'8', '3'}}, {{'8', '4'}}, {{'8', '5'}}, {{'8', '6'}}, {{'8', '7'}}, {{'8', '8'}}, {{'8', '9'}}, + {{'9', '0'}}, {{'9', '1'}}, {{'9', '2'}}, {{'9', '3'}}, {{'9', '4'}}, {{'9', '5'}}, {{'9', '6'}}, {{'9', '7'}}, {{'9', '8'}}, {{'9', '9'}}, + } + }; + + // special case for "0" + if (x == 0) + { + o->write_character('0'); + return; + } + + // use a pointer to fill the buffer + auto buffer_ptr = number_buffer.begin(); + + const bool is_negative = std::is_same<NumberType, number_integer_t>::value and not(x >= 0); // see issue #755 + number_unsigned_t abs_value; + + unsigned int n_chars; + + if (is_negative) + { + *buffer_ptr = '-'; + abs_value = remove_sign(static_cast<number_integer_t>(x)); + + // account one more byte for the minus sign + n_chars = 1 + count_digits(abs_value); + } + else + { + abs_value = static_cast<number_unsigned_t>(x); + n_chars = count_digits(abs_value); + } + + // spare 1 byte for '\0' + assert(n_chars < number_buffer.size() - 1); + + // jump to the end to generate the string from backward + // so we later avoid reversing the result + buffer_ptr += n_chars; + + // Fast int2ascii implementation inspired by "Fastware" talk by Andrei Alexandrescu + // See: https://www.youtube.com/watch?v=o4-CwDo2zpg + while (abs_value >= 100) + { + const auto digits_index = static_cast<unsigned>((abs_value % 100)); + abs_value /= 100; + *(--buffer_ptr) = digits_to_99[digits_index][1]; + *(--buffer_ptr) = digits_to_99[digits_index][0]; + } + + if (abs_value >= 10) + { + const auto digits_index = static_cast<unsigned>(abs_value); + *(--buffer_ptr) = digits_to_99[digits_index][1]; + *(--buffer_ptr) = digits_to_99[digits_index][0]; + } + else + { + *(--buffer_ptr) = static_cast<char>('0' + abs_value); + } + + o->write_characters(number_buffer.data(), n_chars); + } + + /*! + @brief dump a floating-point number + + Dump a given floating-point number to output stream @a o. Works internally + with @a number_buffer. + + @param[in] x floating-point number to dump + */ + void dump_float(number_float_t x) + { + // NaN / inf + if (not std::isfinite(x)) + { + o->write_characters("null", 4); + return; + } + + // If number_float_t is an IEEE-754 single or double precision number, + // use the Grisu2 algorithm to produce short numbers which are + // guaranteed to round-trip, using strtof and strtod, resp. + // + // NB: The test below works if <long double> == <double>. + static constexpr bool is_ieee_single_or_double + = (std::numeric_limits<number_float_t>::is_iec559 and std::numeric_limits<number_float_t>::digits == 24 and std::numeric_limits<number_float_t>::max_exponent == 128) or + (std::numeric_limits<number_float_t>::is_iec559 and std::numeric_limits<number_float_t>::digits == 53 and std::numeric_limits<number_float_t>::max_exponent == 1024); + + dump_float(x, std::integral_constant<bool, is_ieee_single_or_double>()); + } + + void dump_float(number_float_t x, std::true_type /*is_ieee_single_or_double*/) + { + char* begin = number_buffer.data(); + char* end = ::nlohmann::detail::to_chars(begin, begin + number_buffer.size(), x); + + o->write_characters(begin, static_cast<size_t>(end - begin)); + } + + void dump_float(number_float_t x, std::false_type /*is_ieee_single_or_double*/) + { + // get number of digits for a float -> text -> float round-trip + static constexpr auto d = std::numeric_limits<number_float_t>::max_digits10; + + // the actual conversion + std::ptrdiff_t len = (std::snprintf)(number_buffer.data(), number_buffer.size(), "%.*g", d, x); + + // negative value indicates an error + assert(len > 0); + // check if buffer was large enough + assert(static_cast<std::size_t>(len) < number_buffer.size()); + + // erase thousands separator + if (thousands_sep != '\0') + { + const auto end = std::remove(number_buffer.begin(), + number_buffer.begin() + len, thousands_sep); + std::fill(end, number_buffer.end(), '\0'); + assert((end - number_buffer.begin()) <= len); + len = (end - number_buffer.begin()); + } + + // convert decimal point to '.' + if (decimal_point != '\0' and decimal_point != '.') + { + const auto dec_pos = std::find(number_buffer.begin(), number_buffer.end(), decimal_point); + if (dec_pos != number_buffer.end()) + { + *dec_pos = '.'; + } + } + + o->write_characters(number_buffer.data(), static_cast<std::size_t>(len)); + + // determine if need to append ".0" + const bool value_is_int_like = + std::none_of(number_buffer.begin(), number_buffer.begin() + len + 1, + [](char c) + { + return c == '.' or c == 'e'; + }); + + if (value_is_int_like) + { + o->write_characters(".0", 2); + } + } + + /*! + @brief check whether a string is UTF-8 encoded + + The function checks each byte of a string whether it is UTF-8 encoded. The + result of the check is stored in the @a state parameter. The function must + be called initially with state 0 (accept). State 1 means the string must + be rejected, because the current byte is not allowed. If the string is + completely processed, but the state is non-zero, the string ended + prematurely; that is, the last byte indicated more bytes should have + followed. + + @param[in,out] state the state of the decoding + @param[in,out] codep codepoint (valid only if resulting state is UTF8_ACCEPT) + @param[in] byte next byte to decode + @return new state + + @note The function has been edited: a std::array is used. + + @copyright Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de> + @sa http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ + */ + static std::uint8_t decode(std::uint8_t& state, std::uint32_t& codep, const std::uint8_t byte) noexcept + { + static const std::array<std::uint8_t, 400> utf8d = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9F + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // A0..BF + 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0..DF + 0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // E0..EF + 0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // F0..FF + 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2 + 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4 + 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6 + 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // s7..s8 + } + }; + + const std::uint8_t type = utf8d[byte]; + + codep = (state != UTF8_ACCEPT) + ? (byte & 0x3fu) | (codep << 6u) + : (0xFFu >> type) & (byte); + + std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type); + assert(index < 400); + state = utf8d[index]; + return state; + } + + /* + * Overload to make the compiler happy while it is instantiating + * dump_integer for number_unsigned_t. + * Must never be called. + */ + number_unsigned_t remove_sign(number_unsigned_t x) + { + assert(false); // LCOV_EXCL_LINE + return x; // LCOV_EXCL_LINE + } + + /* + * Helper function for dump_integer + * + * This function takes a negative signed integer and returns its absolute + * value as unsigned integer. The plus/minus shuffling is necessary as we can + * not directly remove the sign of an arbitrary signed integer as the + * absolute values of INT_MIN and INT_MAX are usually not the same. See + * #1708 for details. + */ + inline number_unsigned_t remove_sign(number_integer_t x) noexcept + { + assert(x < 0 and x < (std::numeric_limits<number_integer_t>::max)()); + return static_cast<number_unsigned_t>(-(x + 1)) + 1; + } + + private: + /// the output of the serializer + output_adapter_t<char> o = nullptr; + + /// a (hopefully) large enough character buffer + std::array<char, 64> number_buffer{{}}; + + /// the locale + const std::lconv* loc = nullptr; + /// the locale's thousand separator character + const char thousands_sep = '\0'; + /// the locale's decimal point character + const char decimal_point = '\0'; + + /// string buffer + std::array<char, 512> string_buffer{{}}; + + /// the indentation character + const char indent_char; + /// the indentation string + string_t indent_string; + + /// error_handler how to react on decoding errors + const error_handler_t error_handler; +}; +} // namespace detail +} // namespace nlohmann + +// #include <nlohmann/detail/value_t.hpp> + +// #include <nlohmann/json_fwd.hpp> + + +/*! +@brief namespace for Niels Lohmann +@see https://github.com/nlohmann +@since version 1.0.0 +*/ +namespace nlohmann +{ + +/*! +@brief a class to store JSON values + +@tparam ObjectType type for JSON objects (`std::map` by default; will be used +in @ref object_t) +@tparam ArrayType type for JSON arrays (`std::vector` by default; will be used +in @ref array_t) +@tparam StringType type for JSON strings and object keys (`std::string` by +default; will be used in @ref string_t) +@tparam BooleanType type for JSON booleans (`bool` by default; will be used +in @ref boolean_t) +@tparam NumberIntegerType type for JSON integer numbers (`int64_t` by +default; will be used in @ref number_integer_t) +@tparam NumberUnsignedType type for JSON unsigned integer numbers (@c +`uint64_t` by default; will be used in @ref number_unsigned_t) +@tparam NumberFloatType type for JSON floating-point numbers (`double` by +default; will be used in @ref number_float_t) +@tparam BinaryType type for packed binary data for compatibility with binary +serialization formats (`std::vector<std::uint8_t>` by default; will be used in +@ref binary_t) +@tparam AllocatorType type of the allocator to use (`std::allocator` by +default) +@tparam JSONSerializer the serializer to resolve internal calls to `to_json()` +and `from_json()` (@ref adl_serializer by default) + +@requirement The class satisfies the following concept requirements: +- Basic + - [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible): + JSON values can be default constructed. The result will be a JSON null + value. + - [MoveConstructible](https://en.cppreference.com/w/cpp/named_req/MoveConstructible): + A JSON value can be constructed from an rvalue argument. + - [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible): + A JSON value can be copy-constructed from an lvalue expression. + - [MoveAssignable](https://en.cppreference.com/w/cpp/named_req/MoveAssignable): + A JSON value van be assigned from an rvalue argument. + - [CopyAssignable](https://en.cppreference.com/w/cpp/named_req/CopyAssignable): + A JSON value can be copy-assigned from an lvalue expression. + - [Destructible](https://en.cppreference.com/w/cpp/named_req/Destructible): + JSON values can be destructed. +- Layout + - [StandardLayoutType](https://en.cppreference.com/w/cpp/named_req/StandardLayoutType): + JSON values have + [standard layout](https://en.cppreference.com/w/cpp/language/data_members#Standard_layout): + All non-static data members are private and standard layout types, the + class has no virtual functions or (virtual) base classes. +- Library-wide + - [EqualityComparable](https://en.cppreference.com/w/cpp/named_req/EqualityComparable): + JSON values can be compared with `==`, see @ref + operator==(const_reference,const_reference). + - [LessThanComparable](https://en.cppreference.com/w/cpp/named_req/LessThanComparable): + JSON values can be compared with `<`, see @ref + operator<(const_reference,const_reference). + - [Swappable](https://en.cppreference.com/w/cpp/named_req/Swappable): + Any JSON lvalue or rvalue of can be swapped with any lvalue or rvalue of + other compatible types, using unqualified function call @ref swap(). + - [NullablePointer](https://en.cppreference.com/w/cpp/named_req/NullablePointer): + JSON values can be compared against `std::nullptr_t` objects which are used + to model the `null` value. +- Container + - [Container](https://en.cppreference.com/w/cpp/named_req/Container): + JSON values can be used like STL containers and provide iterator access. + - [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer); + JSON values can be used like STL containers and provide reverse iterator + access. + +@invariant The member variables @a m_value and @a m_type have the following +relationship: +- If `m_type == value_t::object`, then `m_value.object != nullptr`. +- If `m_type == value_t::array`, then `m_value.array != nullptr`. +- If `m_type == value_t::string`, then `m_value.string != nullptr`. +The invariants are checked by member function assert_invariant(). + +@internal +@note ObjectType trick from https://stackoverflow.com/a/9860911 +@endinternal + +@see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange +Format](http://rfc7159.net/rfc7159) + +@since version 1.0.0 + +@nosubgrouping +*/ +NLOHMANN_BASIC_JSON_TPL_DECLARATION +class basic_json +{ + private: + template<detail::value_t> friend struct detail::external_constructor; + friend ::nlohmann::json_pointer<basic_json>; + friend ::nlohmann::detail::parser<basic_json>; + friend ::nlohmann::detail::serializer<basic_json>; + template<typename BasicJsonType> + friend class ::nlohmann::detail::iter_impl; + template<typename BasicJsonType, typename CharType> + friend class ::nlohmann::detail::binary_writer; + template<typename BasicJsonType, typename SAX> + friend class ::nlohmann::detail::binary_reader; + template<typename BasicJsonType> + friend class ::nlohmann::detail::json_sax_dom_parser; + template<typename BasicJsonType> + friend class ::nlohmann::detail::json_sax_dom_callback_parser; + + /// workaround type for MSVC + using basic_json_t = NLOHMANN_BASIC_JSON_TPL; + + // convenience aliases for types residing in namespace detail; + using lexer = ::nlohmann::detail::lexer<basic_json>; + using parser = ::nlohmann::detail::parser<basic_json>; + + using primitive_iterator_t = ::nlohmann::detail::primitive_iterator_t; + template<typename BasicJsonType> + using internal_iterator = ::nlohmann::detail::internal_iterator<BasicJsonType>; + template<typename BasicJsonType> + using iter_impl = ::nlohmann::detail::iter_impl<BasicJsonType>; + template<typename Iterator> + using iteration_proxy = ::nlohmann::detail::iteration_proxy<Iterator>; + template<typename Base> using json_reverse_iterator = ::nlohmann::detail::json_reverse_iterator<Base>; + + template<typename CharType> + using output_adapter_t = ::nlohmann::detail::output_adapter_t<CharType>; + + using binary_reader = ::nlohmann::detail::binary_reader<basic_json>; + template<typename CharType> using binary_writer = ::nlohmann::detail::binary_writer<basic_json, CharType>; + + using serializer = ::nlohmann::detail::serializer<basic_json>; + + public: + using value_t = detail::value_t; + /// JSON Pointer, see @ref nlohmann::json_pointer + using json_pointer = ::nlohmann::json_pointer<basic_json>; + template<typename T, typename SFINAE> + using json_serializer = JSONSerializer<T, SFINAE>; + /// how to treat decoding errors + using error_handler_t = detail::error_handler_t; + /// helper type for initializer lists of basic_json values + using initializer_list_t = std::initializer_list<detail::json_ref<basic_json>>; + + using input_format_t = detail::input_format_t; + /// SAX interface type, see @ref nlohmann::json_sax + using json_sax_t = json_sax<basic_json>; + + //////////////// + // exceptions // + //////////////// + + /// @name exceptions + /// Classes to implement user-defined exceptions. + /// @{ + + /// @copydoc detail::exception + using exception = detail::exception; + /// @copydoc detail::parse_error + using parse_error = detail::parse_error; + /// @copydoc detail::invalid_iterator + using invalid_iterator = detail::invalid_iterator; + /// @copydoc detail::type_error + using type_error = detail::type_error; + /// @copydoc detail::out_of_range + using out_of_range = detail::out_of_range; + /// @copydoc detail::other_error + using other_error = detail::other_error; + + /// @} + + + ///////////////////// + // container types // + ///////////////////// + + /// @name container types + /// The canonic container types to use @ref basic_json like any other STL + /// container. + /// @{ + + /// the type of elements in a basic_json container + using value_type = basic_json; + + /// the type of an element reference + using reference = value_type&; + /// the type of an element const reference + using const_reference = const value_type&; + + /// a type to represent differences between iterators + using difference_type = std::ptrdiff_t; + /// a type to represent container sizes + using size_type = std::size_t; + + /// the allocator type + using allocator_type = AllocatorType<basic_json>; + + /// the type of an element pointer + using pointer = typename std::allocator_traits<allocator_type>::pointer; + /// the type of an element const pointer + using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; + + /// an iterator for a basic_json container + using iterator = iter_impl<basic_json>; + /// a const iterator for a basic_json container + using const_iterator = iter_impl<const basic_json>; + /// a reverse iterator for a basic_json container + using reverse_iterator = json_reverse_iterator<typename basic_json::iterator>; + /// a const reverse iterator for a basic_json container + using const_reverse_iterator = json_reverse_iterator<typename basic_json::const_iterator>; + + /// @} + + + /*! + @brief returns the allocator associated with the container + */ + static allocator_type get_allocator() + { + return allocator_type(); + } + + /*! + @brief returns version information on the library + + This function returns a JSON object with information about the library, + including the version number and information on the platform and compiler. + + @return JSON object holding version information + key | description + ----------- | --------------- + `compiler` | Information on the used compiler. It is an object with the following keys: `c++` (the used C++ standard), `family` (the compiler family; possible values are `clang`, `icc`, `gcc`, `ilecpp`, `msvc`, `pgcpp`, `sunpro`, and `unknown`), and `version` (the compiler version). + `copyright` | The copyright line for the library as string. + `name` | The name of the library as string. + `platform` | The used platform as string. Possible values are `win32`, `linux`, `apple`, `unix`, and `unknown`. + `url` | The URL of the project as string. + `version` | The version of the library. It is an object with the following keys: `major`, `minor`, and `patch` as defined by [Semantic Versioning](http://semver.org), and `string` (the version string). + + @liveexample{The following code shows an example output of the `meta()` + function.,meta} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @complexity Constant. + + @since 2.1.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json meta() + { + basic_json result; + + result["copyright"] = "(C) 2013-2017 Niels Lohmann"; + result["name"] = "JSON for Modern C++"; + result["url"] = "https://github.com/nlohmann/json"; + result["version"]["string"] = + std::to_string(NLOHMANN_JSON_VERSION_MAJOR) + "." + + std::to_string(NLOHMANN_JSON_VERSION_MINOR) + "." + + std::to_string(NLOHMANN_JSON_VERSION_PATCH); + result["version"]["major"] = NLOHMANN_JSON_VERSION_MAJOR; + result["version"]["minor"] = NLOHMANN_JSON_VERSION_MINOR; + result["version"]["patch"] = NLOHMANN_JSON_VERSION_PATCH; + +#ifdef _WIN32 + result["platform"] = "win32"; +#elif defined __linux__ + result["platform"] = "linux"; +#elif defined __APPLE__ + result["platform"] = "apple"; +#elif defined __unix__ + result["platform"] = "unix"; +#else + result["platform"] = "unknown"; +#endif + +#if defined(__ICC) || defined(__INTEL_COMPILER) + result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}}; +#elif defined(__clang__) + result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}}; +#elif defined(__GNUC__) || defined(__GNUG__) + result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}}; +#elif defined(__HP_cc) || defined(__HP_aCC) + result["compiler"] = "hp" +#elif defined(__IBMCPP__) + result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; +#elif defined(_MSC_VER) + result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}}; +#elif defined(__PGI) + result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}}; +#elif defined(__SUNPRO_CC) + result["compiler"] = {{"family", "sunpro"}, {"version", __SUNPRO_CC}}; +#else + result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; +#endif + +#ifdef __cplusplus + result["compiler"]["c++"] = std::to_string(__cplusplus); +#else + result["compiler"]["c++"] = "unknown"; +#endif + return result; + } + + + /////////////////////////// + // JSON value data types // + /////////////////////////// + + /// @name JSON value data types + /// The data types to store a JSON value. These types are derived from + /// the template arguments passed to class @ref basic_json. + /// @{ + +#if defined(JSON_HAS_CPP_14) + // Use transparent comparator if possible, combined with perfect forwarding + // on find() and count() calls prevents unnecessary string construction. + using object_comparator_t = std::less<>; +#else + using object_comparator_t = std::less<StringType>; +#endif + + /*! + @brief a type for an object + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON objects as follows: + > An object is an unordered collection of zero or more name/value pairs, + > where a name is a string and a value is a string, number, boolean, null, + > object, or array. + + To store objects in C++, a type is defined by the template parameters + described below. + + @tparam ObjectType the container to store objects (e.g., `std::map` or + `std::unordered_map`) + @tparam StringType the type of the keys or names (e.g., `std::string`). + The comparison function `std::less<StringType>` is used to order elements + inside the container. + @tparam AllocatorType the allocator to use for objects (e.g., + `std::allocator`) + + #### Default type + + With the default values for @a ObjectType (`std::map`), @a StringType + (`std::string`), and @a AllocatorType (`std::allocator`), the default + value for @a object_t is: + + @code {.cpp} + std::map< + std::string, // key_type + basic_json, // value_type + std::less<std::string>, // key_compare + std::allocator<std::pair<const std::string, basic_json>> // allocator_type + > + @endcode + + #### Behavior + + The choice of @a object_t influences the behavior of the JSON class. With + the default type, objects have the following behavior: + + - When all names are unique, objects will be interoperable in the sense + that all software implementations receiving that object will agree on + the name-value mappings. + - When the names within an object are not unique, it is unspecified which + one of the values for a given key will be chosen. For instance, + `{"key": 2, "key": 1}` could be equal to either `{"key": 1}` or + `{"key": 2}`. + - Internally, name/value pairs are stored in lexicographical order of the + names. Objects will also be serialized (see @ref dump) in this order. + For instance, `{"b": 1, "a": 2}` and `{"a": 2, "b": 1}` will be stored + and serialized as `{"a": 2, "b": 1}`. + - When comparing objects, the order of the name/value pairs is irrelevant. + This makes objects interoperable in the sense that they will not be + affected by these differences. For instance, `{"b": 1, "a": 2}` and + `{"a": 2, "b": 1}` will be treated as equal. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the maximum depth of nesting. + + In this class, the object's limit of nesting is not explicitly constrained. + However, a maximum depth of nesting may be introduced by the compiler or + runtime environment. A theoretical limit can be queried by calling the + @ref max_size function of a JSON object. + + #### Storage + + Objects are stored as pointers in a @ref basic_json type. That is, for any + access to object values, a pointer of type `object_t*` must be + dereferenced. + + @sa @ref array_t -- type for an array value + + @since version 1.0.0 + + @note The order name/value pairs are added to the object is *not* + preserved by the library. Therefore, iterating an object may return + name/value pairs in a different order than they were originally stored. In + fact, keys will be traversed in alphabetical order as `std::map` with + `std::less` is used by default. Please note this behavior conforms to [RFC + 7159](http://rfc7159.net/rfc7159), because any order implements the + specified "unordered" nature of JSON objects. + */ + using object_t = ObjectType<StringType, + basic_json, + object_comparator_t, + AllocatorType<std::pair<const StringType, + basic_json>>>; + + /*! + @brief a type for an array + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON arrays as follows: + > An array is an ordered sequence of zero or more values. + + To store objects in C++, a type is defined by the template parameters + explained below. + + @tparam ArrayType container type to store arrays (e.g., `std::vector` or + `std::list`) + @tparam AllocatorType allocator to use for arrays (e.g., `std::allocator`) + + #### Default type + + With the default values for @a ArrayType (`std::vector`) and @a + AllocatorType (`std::allocator`), the default value for @a array_t is: + + @code {.cpp} + std::vector< + basic_json, // value_type + std::allocator<basic_json> // allocator_type + > + @endcode + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the maximum depth of nesting. + + In this class, the array's limit of nesting is not explicitly constrained. + However, a maximum depth of nesting may be introduced by the compiler or + runtime environment. A theoretical limit can be queried by calling the + @ref max_size function of a JSON array. + + #### Storage + + Arrays are stored as pointers in a @ref basic_json type. That is, for any + access to array values, a pointer of type `array_t*` must be dereferenced. + + @sa @ref object_t -- type for an object value + + @since version 1.0.0 + */ + using array_t = ArrayType<basic_json, AllocatorType<basic_json>>; + + /*! + @brief a type for a string + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON strings as follows: + > A string is a sequence of zero or more Unicode characters. + + To store objects in C++, a type is defined by the template parameter + described below. Unicode values are split by the JSON class into + byte-sized characters during deserialization. + + @tparam StringType the container to store strings (e.g., `std::string`). + Note this container is used for keys/names in objects, see @ref object_t. + + #### Default type + + With the default values for @a StringType (`std::string`), the default + value for @a string_t is: + + @code {.cpp} + std::string + @endcode + + #### Encoding + + Strings are stored in UTF-8 encoding. Therefore, functions like + `std::string::size()` or `std::string::length()` return the number of + bytes in the string rather than the number of characters or glyphs. + + #### String comparison + + [RFC 7159](http://rfc7159.net/rfc7159) states: + > Software implementations are typically required to test names of object + > members for equality. Implementations that transform the textual + > representation into sequences of Unicode code units and then perform the + > comparison numerically, code unit by code unit, are interoperable in the + > sense that implementations will agree in all cases on equality or + > inequality of two strings. For example, implementations that compare + > strings with escaped characters unconverted may incorrectly find that + > `"a\\b"` and `"a\u005Cb"` are not equal. + + This implementation is interoperable as it does compare strings code unit + by code unit. + + #### Storage + + String values are stored as pointers in a @ref basic_json type. That is, + for any access to string values, a pointer of type `string_t*` must be + dereferenced. + + @since version 1.0.0 + */ + using string_t = StringType; + + /*! + @brief a type for a boolean + + [RFC 7159](http://rfc7159.net/rfc7159) implicitly describes a boolean as a + type which differentiates the two literals `true` and `false`. + + To store objects in C++, a type is defined by the template parameter @a + BooleanType which chooses the type to use. + + #### Default type + + With the default values for @a BooleanType (`bool`), the default value for + @a boolean_t is: + + @code {.cpp} + bool + @endcode + + #### Storage + + Boolean values are stored directly inside a @ref basic_json type. + + @since version 1.0.0 + */ + using boolean_t = BooleanType; + + /*! + @brief a type for a number (integer) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store integer numbers in C++, a type is defined by the template + parameter @a NumberIntegerType which chooses the type to use. + + #### Default type + + With the default values for @a NumberIntegerType (`int64_t`), the default + value for @a number_integer_t is: + + @code {.cpp} + int64_t + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in integer literals lead to an interpretation as octal + number. Internally, the value will be stored as decimal number. For + instance, the C++ integer literal `010` will be serialized to `8`. + During deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the range and precision of numbers. + + When the default type is used, the maximal integer number that can be + stored is `9223372036854775807` (INT64_MAX) and the minimal integer number + that can be stored is `-9223372036854775808` (INT64_MIN). Integer numbers + that are out of range will yield over/underflow when used in a + constructor. During deserialization, too large or small integer numbers + will be automatically be stored as @ref number_unsigned_t or @ref + number_float_t. + + [RFC 7159](http://rfc7159.net/rfc7159) further states: + > Note that when such software is used, numbers that are integers and are + > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense + > that implementations will agree exactly on their numeric values. + + As this range is a subrange of the exactly supported range [INT64_MIN, + INT64_MAX], this class's integer type is interoperable. + + #### Storage + + Integer number values are stored directly inside a @ref basic_json type. + + @sa @ref number_float_t -- type for number values (floating-point) + + @sa @ref number_unsigned_t -- type for number values (unsigned integer) + + @since version 1.0.0 + */ + using number_integer_t = NumberIntegerType; + + /*! + @brief a type for a number (unsigned) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store unsigned integer numbers in C++, a type is defined by the + template parameter @a NumberUnsignedType which chooses the type to use. + + #### Default type + + With the default values for @a NumberUnsignedType (`uint64_t`), the + default value for @a number_unsigned_t is: + + @code {.cpp} + uint64_t + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in integer literals lead to an interpretation as octal + number. Internally, the value will be stored as decimal number. For + instance, the C++ integer literal `010` will be serialized to `8`. + During deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the range and precision of numbers. + + When the default type is used, the maximal integer number that can be + stored is `18446744073709551615` (UINT64_MAX) and the minimal integer + number that can be stored is `0`. Integer numbers that are out of range + will yield over/underflow when used in a constructor. During + deserialization, too large or small integer numbers will be automatically + be stored as @ref number_integer_t or @ref number_float_t. + + [RFC 7159](http://rfc7159.net/rfc7159) further states: + > Note that when such software is used, numbers that are integers and are + > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense + > that implementations will agree exactly on their numeric values. + + As this range is a subrange (when considered in conjunction with the + number_integer_t type) of the exactly supported range [0, UINT64_MAX], + this class's integer type is interoperable. + + #### Storage + + Integer number values are stored directly inside a @ref basic_json type. + + @sa @ref number_float_t -- type for number values (floating-point) + @sa @ref number_integer_t -- type for number values (integer) + + @since version 2.0.0 + */ + using number_unsigned_t = NumberUnsignedType; + + /*! + @brief a type for a number (floating-point) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store floating-point numbers in C++, a type is defined by the template + parameter @a NumberFloatType which chooses the type to use. + + #### Default type + + With the default values for @a NumberFloatType (`double`), the default + value for @a number_float_t is: + + @code {.cpp} + double + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in floating-point literals will be ignored. Internally, + the value will be stored as decimal number. For instance, the C++ + floating-point literal `01.2` will be serialized to `1.2`. During + deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) states: + > This specification allows implementations to set limits on the range and + > precision of numbers accepted. Since software that implements IEEE + > 754-2008 binary64 (double precision) numbers is generally available and + > widely used, good interoperability can be achieved by implementations + > that expect no more precision or range than these provide, in the sense + > that implementations will approximate JSON numbers within the expected + > precision. + + This implementation does exactly follow this approach, as it uses double + precision floating-point numbers. Note values smaller than + `-1.79769313486232e+308` and values greater than `1.79769313486232e+308` + will be stored as NaN internally and be serialized to `null`. + + #### Storage + + Floating-point number values are stored directly inside a @ref basic_json + type. + + @sa @ref number_integer_t -- type for number values (integer) + + @sa @ref number_unsigned_t -- type for number values (unsigned integer) + + @since version 1.0.0 + */ + using number_float_t = NumberFloatType; + + /*! + @brief a type for a packed binary type + + This type is a type designed to carry binary data that appears in various + serialized formats, such as CBOR's Major Type 2, MessagePack's bin, and + BSON's generic binary subtype. This type is NOT a part of standard JSON and + exists solely for compatibility with these binary types. As such, it is + simply defined as an ordered sequence of zero or more byte values. + + Additionally, as an implementation detail, the subtype of the binary data is + carried around as a `unint8_t`, which is compatible with both of the binary + data formats that use binary subtyping, (though the specific numbering is + incompatible with each other, and it is up to the user to translate between + them). + + [CBOR's RFC 7049](https://tools.ietf.org/html/rfc7049) describes this type + as: + > Major type 2: a byte string. The string's length in bytes is + > represented following the rules for positive integers (major type + > 0). + + [MessagePack's documentation on the bin type + family](https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family) + describes this type as: + > Bin format family stores an byte array in 2, 3, or 5 bytes of extra bytes + > in addition to the size of the byte array. + + [BSON's specifications](http://bsonspec.org/spec.html) describe several + binary types; however, this type is intended to represent the generic binary + type which has the description: + > Generic binary subtype - This is the most commonly used binary subtype and + > should be the 'default' for drivers and tools. + + None of these impose any limitations on the internal representation other + than the basic unit of storage be some type of array whose parts are + decomposible into bytes. + + The default representation of this binary format is a + `std::vector<std::uint8_t>`, which is a very common way to represent a byte + array in modern C++. + + #### Default type + + The default values for @a BinaryType is `std::vector<std::uint8_t>` + + #### Storage + + Binary Arrays are stored as pointers in a @ref basic_json type. That is, + for any access to array values, a pointer of the type `binary_t*` must be + dereferenced. + + @sa @ref array_t -- type for an array value + + @since version 3.8.0 + */ + + using binary_t = BinaryType; + + /*! + @brief an internal type for a backed binary type + + This type is designed to be `binary_t` but with the subtype implementation + detail. This type exists so that the user does not have to specify a struct + his- or herself with a specific naming scheme in order to override the + binary type. I.e. it's for ease of use. + */ + struct internal_binary_t : public BinaryType + { + using BinaryType::BinaryType; + internal_binary_t() noexcept(noexcept(BinaryType())) : BinaryType() {} + internal_binary_t(BinaryType const& bint) noexcept(noexcept(BinaryType(bint))) : BinaryType(bint) {} + internal_binary_t(BinaryType&& bint) noexcept(noexcept(BinaryType(std::move(bint)))) : BinaryType(std::move(bint)) {} + + // TOOD: If minimum C++ version is ever bumped to C++17, this field + // deserves to be a std::optional + std::uint8_t subtype = 0; + bool has_subtype = false; + }; + + /// @} + + private: + + /// helper for exception-safe object creation + template<typename T, typename... Args> + JSON_HEDLEY_RETURNS_NON_NULL + static T* create(Args&& ... args) + { + AllocatorType<T> alloc; + using AllocatorTraits = std::allocator_traits<AllocatorType<T>>; + + auto deleter = [&](T * object) + { + AllocatorTraits::deallocate(alloc, object, 1); + }; + std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter); + AllocatorTraits::construct(alloc, object.get(), std::forward<Args>(args)...); + assert(object != nullptr); + return object.release(); + } + + //////////////////////// + // JSON value storage // + //////////////////////// + + /*! + @brief a JSON value + + The actual storage for a JSON value of the @ref basic_json class. This + union combines the different storage types for the JSON value types + defined in @ref value_t. + + JSON type | value_t type | used type + --------- | --------------- | ------------------------ + object | object | pointer to @ref object_t + array | array | pointer to @ref array_t + string | string | pointer to @ref string_t + boolean | boolean | @ref boolean_t + number | number_integer | @ref number_integer_t + number | number_unsigned | @ref number_unsigned_t + number | number_float | @ref number_float_t + binary | binary | pointer to @ref internal_binary_t + null | null | *no value is stored* + + @note Variable-length types (objects, arrays, and strings) are stored as + pointers. The size of the union should not exceed 64 bits if the default + value types are used. + + @since version 1.0.0 + */ + union json_value + { + /// object (stored with pointer to save storage) + object_t* object; + /// array (stored with pointer to save storage) + array_t* array; + /// string (stored with pointer to save storage) + string_t* string; + /// binary (stored with pointer to save storage) + internal_binary_t* binary; + /// boolean + boolean_t boolean; + /// number (integer) + number_integer_t number_integer; + /// number (unsigned integer) + number_unsigned_t number_unsigned; + /// number (floating-point) + number_float_t number_float; + + /// default constructor (for null values) + json_value() = default; + /// constructor for booleans + json_value(boolean_t v) noexcept : boolean(v) {} + /// constructor for numbers (integer) + json_value(number_integer_t v) noexcept : number_integer(v) {} + /// constructor for numbers (unsigned) + json_value(number_unsigned_t v) noexcept : number_unsigned(v) {} + /// constructor for numbers (floating-point) + json_value(number_float_t v) noexcept : number_float(v) {} + /// constructor for empty values of a given type + json_value(value_t t) + { + switch (t) + { + case value_t::object: + { + object = create<object_t>(); + break; + } + + case value_t::array: + { + array = create<array_t>(); + break; + } + + case value_t::string: + { + string = create<string_t>(""); + break; + } + + case value_t::binary: + { + binary = create<internal_binary_t>(); + break; + } + + case value_t::boolean: + { + boolean = boolean_t(false); + break; + } + + case value_t::number_integer: + { + number_integer = number_integer_t(0); + break; + } + + case value_t::number_unsigned: + { + number_unsigned = number_unsigned_t(0); + break; + } + + case value_t::number_float: + { + number_float = number_float_t(0.0); + break; + } + + case value_t::null: + { + object = nullptr; // silence warning, see #821 + break; + } + + default: + { + object = nullptr; // silence warning, see #821 + if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) + { + JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.7.3")); // LCOV_EXCL_LINE + } + break; + } + } + } + + /// constructor for strings + json_value(const string_t& value) + { + string = create<string_t>(value); + } + + /// constructor for rvalue strings + json_value(string_t&& value) + { + string = create<string_t>(std::move(value)); + } + + /// constructor for objects + json_value(const object_t& value) + { + object = create<object_t>(value); + } + + /// constructor for rvalue objects + json_value(object_t&& value) + { + object = create<object_t>(std::move(value)); + } + + /// constructor for arrays + json_value(const array_t& value) + { + array = create<array_t>(value); + } + + /// constructor for rvalue arrays + json_value(array_t&& value) + { + array = create<array_t>(std::move(value)); + } + + /// constructor for binary arrays + json_value(const binary_t& value) + { + binary = create<internal_binary_t>(value); + } + + /// constructor for rvalue binary arrays + json_value(binary_t&& value) + { + binary = create<internal_binary_t>(std::move(value)); + } + + void destroy(value_t t) noexcept + { + // flatten the current json_value to a heap-allocated stack + std::vector<basic_json> stack; + + // move the top-level items to stack + if (t == value_t::array) + { + stack.reserve(array->size()); + std::move(array->begin(), array->end(), std::back_inserter(stack)); + } + else if (t == value_t::object) + { + stack.reserve(object->size()); + for (auto&& it : *object) + { + stack.push_back(std::move(it.second)); + } + } + + while (not stack.empty()) + { + // move the last item to local variable to be processed + basic_json current_item(std::move(stack.back())); + stack.pop_back(); + + // if current_item is array/object, move + // its children to the stack to be processed later + if (current_item.is_array()) + { + std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(), + std::back_inserter(stack)); + + current_item.m_value.array->clear(); + } + else if (current_item.is_object()) + { + for (auto&& it : *current_item.m_value.object) + { + stack.push_back(std::move(it.second)); + } + + current_item.m_value.object->clear(); + } + + // it's now safe that current_item get destructed + // since it doesn't have any children + } + + switch (t) + { + case value_t::object: + { + AllocatorType<object_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, object); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, object, 1); + break; + } + + case value_t::array: + { + AllocatorType<array_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, array); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, array, 1); + break; + } + + case value_t::string: + { + AllocatorType<string_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, string); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, string, 1); + break; + } + + case value_t::binary: + { + AllocatorType<internal_binary_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, binary); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, binary, 1); + break; + } + + default: + { + break; + } + } + } + }; + + /*! + @brief checks the class invariants + + This function asserts the class invariants. It needs to be called at the + end of every constructor to make sure that created objects respect the + invariant. Furthermore, it has to be called each time the type of a JSON + value is changed, because the invariant expresses a relationship between + @a m_type and @a m_value. + */ + void assert_invariant() const noexcept + { + assert(m_type != value_t::object or m_value.object != nullptr); + assert(m_type != value_t::array or m_value.array != nullptr); + assert(m_type != value_t::string or m_value.string != nullptr); + } + + public: + ////////////////////////// + // JSON parser callback // + ////////////////////////// + + /*! + @brief parser event types + + The parser callback distinguishes the following events: + - `object_start`: the parser read `{` and started to process a JSON object + - `key`: the parser read a key of a value in an object + - `object_end`: the parser read `}` and finished processing a JSON object + - `array_start`: the parser read `[` and started to process a JSON array + - `array_end`: the parser read `]` and finished processing a JSON array + - `value`: the parser finished reading a JSON value + + @image html callback_events.png "Example when certain parse events are triggered" + + @sa @ref parser_callback_t for more information and examples + */ + using parse_event_t = typename parser::parse_event_t; + + /*! + @brief per-element parser callback type + + With a parser callback function, the result of parsing a JSON text can be + influenced. When passed to @ref parse, it is called on certain events + (passed as @ref parse_event_t via parameter @a event) with a set recursion + depth @a depth and context JSON value @a parsed. The return value of the + callback function is a boolean indicating whether the element that emitted + the callback shall be kept or not. + + We distinguish six scenarios (determined by the event type) in which the + callback function can be called. The following table describes the values + of the parameters @a depth, @a event, and @a parsed. + + parameter @a event | description | parameter @a depth | parameter @a parsed + ------------------ | ----------- | ------------------ | ------------------- + parse_event_t::object_start | the parser read `{` and started to process a JSON object | depth of the parent of the JSON object | a JSON value with type discarded + parse_event_t::key | the parser read a key of a value in an object | depth of the currently parsed JSON object | a JSON string containing the key + parse_event_t::object_end | the parser read `}` and finished processing a JSON object | depth of the parent of the JSON object | the parsed JSON object + parse_event_t::array_start | the parser read `[` and started to process a JSON array | depth of the parent of the JSON array | a JSON value with type discarded + parse_event_t::array_end | the parser read `]` and finished processing a JSON array | depth of the parent of the JSON array | the parsed JSON array + parse_event_t::value | the parser finished reading a JSON value | depth of the value | the parsed JSON value + + @image html callback_events.png "Example when certain parse events are triggered" + + Discarding a value (i.e., returning `false`) has different effects + depending on the context in which function was called: + + - Discarded values in structured types are skipped. That is, the parser + will behave as if the discarded value was never read. + - In case a value outside a structured type is skipped, it is replaced + with `null`. This case happens if the top-level element is skipped. + + @param[in] depth the depth of the recursion during parsing + + @param[in] event an event of type parse_event_t indicating the context in + the callback function has been called + + @param[in,out] parsed the current intermediate parse result; note that + writing to this value has no effect for parse_event_t::key events + + @return Whether the JSON value which called the function during parsing + should be kept (`true`) or not (`false`). In the latter case, it is either + skipped completely or replaced by an empty discarded object. + + @sa @ref parse for examples + + @since version 1.0.0 + */ + using parser_callback_t = typename parser::parser_callback_t; + + ////////////////// + // constructors // + ////////////////// + + /// @name constructors and destructors + /// Constructors of class @ref basic_json, copy/move constructor, copy + /// assignment, static functions creating objects, and the destructor. + /// @{ + + /*! + @brief create an empty value with a given type + + Create an empty JSON value with a given type. The value will be default + initialized with an empty value which depends on the type: + + Value type | initial value + ----------- | ------------- + null | `null` + boolean | `false` + string | `""` + number | `0` + object | `{}` + array | `[]` + binary | empty array + + @param[in] v the type of the value to create + + @complexity Constant. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows the constructor for different @ref + value_t values,basic_json__value_t} + + @sa @ref clear() -- restores the postcondition of this constructor + + @since version 1.0.0 + */ + basic_json(const value_t v) + : m_type(v), m_value(v) + { + assert_invariant(); + } + + /*! + @brief create a null object + + Create a `null` JSON value. It either takes a null pointer as parameter + (explicitly creating `null`) or no parameter (implicitly creating `null`). + The passed null pointer itself is not read -- it is only used to choose + the right constructor. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this constructor never throws + exceptions. + + @liveexample{The following code shows the constructor with and without a + null pointer parameter.,basic_json__nullptr_t} + + @since version 1.0.0 + */ + basic_json(std::nullptr_t = nullptr) noexcept + : basic_json(value_t::null) + { + assert_invariant(); + } + + /*! + @brief create a JSON value + + This is a "catch all" constructor for all compatible JSON types; that is, + types for which a `to_json()` method exists. The constructor forwards the + parameter @a val to that method (to `json_serializer<U>::to_json` method + with `U = uncvref_t<CompatibleType>`, to be exact). + + Template type @a CompatibleType includes, but is not limited to, the + following types: + - **arrays**: @ref array_t and all kinds of compatible containers such as + `std::vector`, `std::deque`, `std::list`, `std::forward_list`, + `std::array`, `std::valarray`, `std::set`, `std::unordered_set`, + `std::multiset`, and `std::unordered_multiset` with a `value_type` from + which a @ref basic_json value can be constructed. + - **objects**: @ref object_t and all kinds of compatible associative + containers such as `std::map`, `std::unordered_map`, `std::multimap`, + and `std::unordered_multimap` with a `key_type` compatible to + @ref string_t and a `value_type` from which a @ref basic_json value can + be constructed. + - **strings**: @ref string_t, string literals, and all compatible string + containers can be used. + - **numbers**: @ref number_integer_t, @ref number_unsigned_t, + @ref number_float_t, and all convertible number types such as `int`, + `size_t`, `int64_t`, `float` or `double` can be used. + - **boolean**: @ref boolean_t / `bool` can be used. + - **binary**: @ref binary_t / `std::vector<uint8_t>` may be used, + unfortunately because string literals cannot be distinguished from binary + character arrays by the C++ type system, all types compatible with `const + char*` will be directed to the string constructor instead. This is both + for backwards compatibility, and due to the fact that a binary type is not + a standard JSON type. + + See the examples below. + + @tparam CompatibleType a type such that: + - @a CompatibleType is not derived from `std::istream`, + - @a CompatibleType is not @ref basic_json (to avoid hijacking copy/move + constructors), + - @a CompatibleType is not a different @ref basic_json type (i.e. with different template arguments) + - @a CompatibleType is not a @ref basic_json nested type (e.g., + @ref json_pointer, @ref iterator, etc ...) + - @ref @ref json_serializer<U> has a + `to_json(basic_json_t&, CompatibleType&&)` method + + @tparam U = `uncvref_t<CompatibleType>` + + @param[in] val the value to be forwarded to the respective constructor + + @complexity Usually linear in the size of the passed @a val, also + depending on the implementation of the called `to_json()` + method. + + @exceptionsafety Depends on the called constructor. For types directly + supported by the library (i.e., all types for which no `to_json()` function + was provided), strong guarantee holds: if an exception is thrown, there are + no changes to any JSON value. + + @liveexample{The following code shows the constructor with several + compatible types.,basic_json__CompatibleType} + + @since version 2.1.0 + */ + template <typename CompatibleType, + typename U = detail::uncvref_t<CompatibleType>, + detail::enable_if_t< + not detail::is_basic_json<U>::value and detail::is_compatible_type<basic_json_t, U>::value, int> = 0> + basic_json(CompatibleType && val) noexcept(noexcept( + JSONSerializer<U>::to_json(std::declval<basic_json_t&>(), + std::forward<CompatibleType>(val)))) + { + JSONSerializer<U>::to_json(*this, std::forward<CompatibleType>(val)); + assert_invariant(); + } + + /*! + @brief create a JSON value from an existing one + + This is a constructor for existing @ref basic_json types. + It does not hijack copy/move constructors, since the parameter has different + template arguments than the current ones. + + The constructor tries to convert the internal @ref m_value of the parameter. + + @tparam BasicJsonType a type such that: + - @a BasicJsonType is a @ref basic_json type. + - @a BasicJsonType has different template arguments than @ref basic_json_t. + + @param[in] val the @ref basic_json value to be converted. + + @complexity Usually linear in the size of the passed @a val, also + depending on the implementation of the called `to_json()` + method. + + @exceptionsafety Depends on the called constructor. For types directly + supported by the library (i.e., all types for which no `to_json()` function + was provided), strong guarantee holds: if an exception is thrown, there are + no changes to any JSON value. + + @since version 3.2.0 + */ + template <typename BasicJsonType, + detail::enable_if_t< + detail::is_basic_json<BasicJsonType>::value and not std::is_same<basic_json, BasicJsonType>::value, int> = 0> + basic_json(const BasicJsonType& val) + { + using other_boolean_t = typename BasicJsonType::boolean_t; + using other_number_float_t = typename BasicJsonType::number_float_t; + using other_number_integer_t = typename BasicJsonType::number_integer_t; + using other_number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using other_string_t = typename BasicJsonType::string_t; + using other_object_t = typename BasicJsonType::object_t; + using other_array_t = typename BasicJsonType::array_t; + using other_binary_t = typename BasicJsonType::internal_binary_t; + + switch (val.type()) + { + case value_t::boolean: + JSONSerializer<other_boolean_t>::to_json(*this, val.template get<other_boolean_t>()); + break; + case value_t::number_float: + JSONSerializer<other_number_float_t>::to_json(*this, val.template get<other_number_float_t>()); + break; + case value_t::number_integer: + JSONSerializer<other_number_integer_t>::to_json(*this, val.template get<other_number_integer_t>()); + break; + case value_t::number_unsigned: + JSONSerializer<other_number_unsigned_t>::to_json(*this, val.template get<other_number_unsigned_t>()); + break; + case value_t::string: + JSONSerializer<other_string_t>::to_json(*this, val.template get_ref<const other_string_t&>()); + break; + case value_t::object: + JSONSerializer<other_object_t>::to_json(*this, val.template get_ref<const other_object_t&>()); + break; + case value_t::array: + JSONSerializer<other_array_t>::to_json(*this, val.template get_ref<const other_array_t&>()); + break; + case value_t::binary: + JSONSerializer<other_binary_t>::to_json(*this, val.template get_ref<const other_binary_t&>()); + break; + case value_t::null: + *this = nullptr; + break; + case value_t::discarded: + m_type = value_t::discarded; + break; + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + assert_invariant(); + } + + /*! + @brief create a container (array or object) from an initializer list + + Creates a JSON value of type array or object from the passed initializer + list @a init. In case @a type_deduction is `true` (default), the type of + the JSON value to be created is deducted from the initializer list @a init + according to the following rules: + + 1. If the list is empty, an empty JSON object value `{}` is created. + 2. If the list consists of pairs whose first element is a string, a JSON + object value is created where the first elements of the pairs are + treated as keys and the second elements are as values. + 3. In all other cases, an array is created. + + The rules aim to create the best fit between a C++ initializer list and + JSON values. The rationale is as follows: + + 1. The empty initializer list is written as `{}` which is exactly an empty + JSON object. + 2. C++ has no way of describing mapped types other than to list a list of + pairs. As JSON requires that keys must be of type string, rule 2 is the + weakest constraint one can pose on initializer lists to interpret them + as an object. + 3. In all other cases, the initializer list could not be interpreted as + JSON object type, so interpreting it as JSON array type is safe. + + With the rules described above, the following JSON values cannot be + expressed by an initializer list: + + - the empty array (`[]`): use @ref array(initializer_list_t) + with an empty initializer list in this case + - arrays whose elements satisfy rule 2: use @ref + array(initializer_list_t) with the same initializer list + in this case + + @note When used without parentheses around an empty initializer list, @ref + basic_json() is called instead of this function, yielding the JSON null + value. + + @param[in] init initializer list with JSON values + + @param[in] type_deduction internal parameter; when set to `true`, the type + of the JSON value is deducted from the initializer list @a init; when set + to `false`, the type provided via @a manual_type is forced. This mode is + used by the functions @ref array(initializer_list_t) and + @ref object(initializer_list_t). + + @param[in] manual_type internal parameter; when @a type_deduction is set + to `false`, the created JSON value will use the provided type (only @ref + value_t::array and @ref value_t::object are valid); when @a type_deduction + is set to `true`, this parameter has no effect + + @throw type_error.301 if @a type_deduction is `false`, @a manual_type is + `value_t::object`, but @a init contains an element which is not a pair + whose first element is a string. In this case, the constructor could not + create an object. If @a type_deduction would have be `true`, an array + would have been created. See @ref object(initializer_list_t) + for an example. + + @complexity Linear in the size of the initializer list @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The example below shows how JSON values are created from + initializer lists.,basic_json__list_init_t} + + @sa @ref array(initializer_list_t) -- create a JSON array + value from an initializer list + @sa @ref object(initializer_list_t) -- create a JSON object + value from an initializer list + + @since version 1.0.0 + */ + basic_json(initializer_list_t init, + bool type_deduction = true, + value_t manual_type = value_t::array) + { + // check if each element is an array with two elements whose first + // element is a string + bool is_an_object = std::all_of(init.begin(), init.end(), + [](const detail::json_ref<basic_json>& element_ref) + { + return element_ref->is_array() and element_ref->size() == 2 and (*element_ref)[0].is_string(); + }); + + // adjust type if type deduction is not wanted + if (not type_deduction) + { + // if array is wanted, do not create an object though possible + if (manual_type == value_t::array) + { + is_an_object = false; + } + + // if object is wanted but impossible, throw an exception + if (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object)) + { + JSON_THROW(type_error::create(301, "cannot create object from initializer list")); + } + } + + if (is_an_object) + { + // the initializer list is a list of pairs -> create object + m_type = value_t::object; + m_value = value_t::object; + + std::for_each(init.begin(), init.end(), [this](const detail::json_ref<basic_json>& element_ref) + { + auto element = element_ref.moved_or_copied(); + m_value.object->emplace( + std::move(*((*element.m_value.array)[0].m_value.string)), + std::move((*element.m_value.array)[1])); + }); + } + else + { + // the initializer list describes an array -> create array + m_type = value_t::array; + m_value.array = create<array_t>(init.begin(), init.end()); + } + + assert_invariant(); + } + + /*! + @brief explicitly create a binary array from an already constructed copy of + its base type + + Creates a JSON binary array value from a given `binary_t`. Binary values are + part of various binary formats, such as CBOR, MsgPack, and BSON. And this + constructor is used to create a value for serialization to those formats. + + @note Note, this function exists because of the difficulty in correctly + specifying the correct template overload in the standard value ctor, as both + JSON arrays and JSON binary arrays are backed with some form of a + `std::vector`. Because JSON binary arrays are a non-standard extension it + was decided that it would be best to prevent automatic initialization of a + binary array type, for backwards compatibility and so it does not happen on + accident. + + @param[in] init `binary_t` with JSON values to create a binary array from + + @return JSON binary array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @since version 3.8.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary_array(binary_t const& init) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = init; + return res; + } + + /*! + @brief explicitly create a binary array from an already constructed rvalue + copy of its base type + + Creates a JSON binary array value from a given `binary_t`. Binary values are + part of various binary formats, such as CBOR, MsgPack, and BSON. And this + constructor is used to create a value for serialization to those formats. + + @note Note, this function exists because of the difficulty in correctly + specifying the correct template overload in the standard value ctor, as both + JSON arrays and JSON binary arrays are backed with some form of a + `std::vector`. Because JSON binary arrays are a non-standard extension it + was decided that it would be best to prevent automatic initialization of a + binary array type, for backwards compatibility and so it doesn't happen on + accident. + + @param[in] init `binary_t` with JSON values to create a binary array from + + @return JSON binary array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @since version 3.8.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary_array(binary_t&& init) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = std::move(init); + return res; + } + + /*! + @brief explicitly create an array from an initializer list + + Creates a JSON array value from a given initializer list. That is, given a + list of values `a, b, c`, creates the JSON value `[a, b, c]`. If the + initializer list is empty, the empty array `[]` is created. + + @note This function is only needed to express two edge cases that cannot + be realized with the initializer list constructor (@ref + basic_json(initializer_list_t, bool, value_t)). These cases + are: + 1. creating an array whose elements are all pairs whose first element is a + string -- in this case, the initializer list constructor would create an + object, taking the first elements as keys + 2. creating an empty array -- passing the empty initializer list to the + initializer list constructor yields an empty object + + @param[in] init initializer list with JSON values to create an array from + (optional) + + @return JSON array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows an example for the `array` + function.,array} + + @sa @ref basic_json(initializer_list_t, bool, value_t) -- + create a JSON value from an initializer list + @sa @ref object(initializer_list_t) -- create a JSON object + value from an initializer list + + @since version 1.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json array(initializer_list_t init = {}) + { + return basic_json(init, false, value_t::array); + } + + /*! + @brief explicitly create an object from an initializer list + + Creates a JSON object value from a given initializer list. The initializer + lists elements must be pairs, and their first elements must be strings. If + the initializer list is empty, the empty object `{}` is created. + + @note This function is only added for symmetry reasons. In contrast to the + related function @ref array(initializer_list_t), there are + no cases which can only be expressed by this function. That is, any + initializer list @a init can also be passed to the initializer list + constructor @ref basic_json(initializer_list_t, bool, value_t). + + @param[in] init initializer list to create an object from (optional) + + @return JSON object value + + @throw type_error.301 if @a init is not a list of pairs whose first + elements are strings. In this case, no object can be created. When such a + value is passed to @ref basic_json(initializer_list_t, bool, value_t), + an array would have been created from the passed initializer list @a init. + See example below. + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows an example for the `object` + function.,object} + + @sa @ref basic_json(initializer_list_t, bool, value_t) -- + create a JSON value from an initializer list + @sa @ref array(initializer_list_t) -- create a JSON array + value from an initializer list + + @since version 1.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json object(initializer_list_t init = {}) + { + return basic_json(init, false, value_t::object); + } + + /*! + @brief construct an array with count copies of given value + + Constructs a JSON array value by creating @a cnt copies of a passed value. + In case @a cnt is `0`, an empty array is created. + + @param[in] cnt the number of JSON copies of @a val to create + @param[in] val the JSON value to copy + + @post `std::distance(begin(),end()) == cnt` holds. + + @complexity Linear in @a cnt. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows examples for the @ref + basic_json(size_type\, const basic_json&) + constructor.,basic_json__size_type_basic_json} + + @since version 1.0.0 + */ + basic_json(size_type cnt, const basic_json& val) + : m_type(value_t::array) + { + m_value.array = create<array_t>(cnt, val); + assert_invariant(); + } + + /*! + @brief construct a JSON container given an iterator range + + Constructs the JSON value with the contents of the range `[first, last)`. + The semantics depends on the different types a JSON value can have: + - In case of a null type, invalid_iterator.206 is thrown. + - In case of other primitive types (number, boolean, or string), @a first + must be `begin()` and @a last must be `end()`. In this case, the value is + copied. Otherwise, invalid_iterator.204 is thrown. + - In case of structured types (array, object), the constructor behaves as + similar versions for `std::vector` or `std::map`; that is, a JSON array + or object is constructed from the values in the range. + + @tparam InputIT an input iterator type (@ref iterator or @ref + const_iterator) + + @param[in] first begin of the range to copy from (included) + @param[in] last end of the range to copy from (excluded) + + @pre Iterators @a first and @a last must be initialized. **This + precondition is enforced with an assertion (see warning).** If + assertions are switched off, a violation of this precondition yields + undefined behavior. + + @pre Range `[first, last)` is valid. Usually, this precondition cannot be + checked efficiently. Only certain edge cases are detected; see the + description of the exceptions below. A violation of this precondition + yields undefined behavior. + + @warning A precondition is enforced with a runtime assertion that will + result in calling `std::abort` if this precondition is not met. + Assertions can be disabled by defining `NDEBUG` at compile time. + See https://en.cppreference.com/w/cpp/error/assert for more + information. + + @throw invalid_iterator.201 if iterators @a first and @a last are not + compatible (i.e., do not belong to the same JSON value). In this case, + the range `[first, last)` is undefined. + @throw invalid_iterator.204 if iterators @a first and @a last belong to a + primitive type (number, boolean, or string), but @a first does not point + to the first element any more. In this case, the range `[first, last)` is + undefined. See example code below. + @throw invalid_iterator.206 if iterators @a first and @a last belong to a + null value. In this case, the range `[first, last)` is undefined. + + @complexity Linear in distance between @a first and @a last. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The example below shows several ways to create JSON values by + specifying a subrange with iterators.,basic_json__InputIt_InputIt} + + @since version 1.0.0 + */ + template<class InputIT, typename std::enable_if< + std::is_same<InputIT, typename basic_json_t::iterator>::value or + std::is_same<InputIT, typename basic_json_t::const_iterator>::value, int>::type = 0> + basic_json(InputIT first, InputIT last) + { + assert(first.m_object != nullptr); + assert(last.m_object != nullptr); + + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); + } + + // copy type from first iterator + m_type = first.m_object->m_type; + + // check if iterator range is complete for primitive values + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + { + if (JSON_HEDLEY_UNLIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) + { + JSON_THROW(invalid_iterator::create(204, "iterators out of range")); + } + break; + } + + default: + break; + } + + switch (m_type) + { + case value_t::number_integer: + { + m_value.number_integer = first.m_object->m_value.number_integer; + break; + } + + case value_t::number_unsigned: + { + m_value.number_unsigned = first.m_object->m_value.number_unsigned; + break; + } + + case value_t::number_float: + { + m_value.number_float = first.m_object->m_value.number_float; + break; + } + + case value_t::boolean: + { + m_value.boolean = first.m_object->m_value.boolean; + break; + } + + case value_t::string: + { + m_value = *first.m_object->m_value.string; + break; + } + + case value_t::object: + { + m_value.object = create<object_t>(first.m_it.object_iterator, + last.m_it.object_iterator); + break; + } + + case value_t::array: + { + m_value.array = create<array_t>(first.m_it.array_iterator, + last.m_it.array_iterator); + break; + } + + case value_t::binary: + { + m_value.binary = create<internal_binary_t>(first.m_it.binary_iterator, + last.m_it.binary_iterator); + break; + } + + default: + JSON_THROW(invalid_iterator::create(206, "cannot construct with iterators from " + + std::string(first.m_object->type_name()))); + } + + assert_invariant(); + } + + + /////////////////////////////////////// + // other constructors and destructor // + /////////////////////////////////////// + + template <typename JsonRef, + detail::enable_if_t<detail::conjunction<detail::is_json_ref<JsonRef>, + std::is_same<typename JsonRef::value_type, basic_json>>::value, int> = 0 > + basic_json(const JsonRef& ref) : basic_json(ref.moved_or_copied()) {} + + /*! + @brief copy constructor + + Creates a copy of a given JSON value. + + @param[in] other the JSON value to copy + + @post `*this == other` + + @complexity Linear in the size of @a other. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + - As postcondition, it holds: `other == basic_json(other)`. + + @liveexample{The following code shows an example for the copy + constructor.,basic_json__basic_json} + + @since version 1.0.0 + */ + basic_json(const basic_json& other) + : m_type(other.m_type) + { + // check of passed value is valid + other.assert_invariant(); + + switch (m_type) + { + case value_t::object: + { + m_value = *other.m_value.object; + break; + } + + case value_t::array: + { + m_value = *other.m_value.array; + break; + } + + case value_t::string: + { + m_value = *other.m_value.string; + break; + } + + case value_t::boolean: + { + m_value = other.m_value.boolean; + break; + } + + case value_t::number_integer: + { + m_value = other.m_value.number_integer; + break; + } + + case value_t::number_unsigned: + { + m_value = other.m_value.number_unsigned; + break; + } + + case value_t::number_float: + { + m_value = other.m_value.number_float; + break; + } + + case value_t::binary: + { + m_value = *other.m_value.binary; + break; + } + + default: + break; + } + + assert_invariant(); + } + + /*! + @brief move constructor + + Move constructor. Constructs a JSON value with the contents of the given + value @a other using move semantics. It "steals" the resources from @a + other and leaves it as JSON null value. + + @param[in,out] other value to move to this object + + @post `*this` has the same value as @a other before the call. + @post @a other is a JSON null value. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this constructor never throws + exceptions. + + @requirement This function helps `basic_json` satisfying the + [MoveConstructible](https://en.cppreference.com/w/cpp/named_req/MoveConstructible) + requirements. + + @liveexample{The code below shows the move constructor explicitly called + via std::move.,basic_json__moveconstructor} + + @since version 1.0.0 + */ + basic_json(basic_json&& other) noexcept + : m_type(std::move(other.m_type)), + m_value(std::move(other.m_value)) + { + // check that passed value is valid + other.assert_invariant(); + + // invalidate payload + other.m_type = value_t::null; + other.m_value = {}; + + assert_invariant(); + } + + /*! + @brief copy assignment + + Copy assignment operator. Copies a JSON value via the "copy and swap" + strategy: It is expressed in terms of the copy constructor, destructor, + and the `swap()` member function. + + @param[in] other value to copy from + + @complexity Linear. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + + @liveexample{The code below shows and example for the copy assignment. It + creates a copy of value `a` which is then swapped with `b`. Finally\, the + copy of `a` (which is the null value after the swap) is + destroyed.,basic_json__copyassignment} + + @since version 1.0.0 + */ + basic_json& operator=(basic_json other) noexcept ( + std::is_nothrow_move_constructible<value_t>::value and + std::is_nothrow_move_assignable<value_t>::value and + std::is_nothrow_move_constructible<json_value>::value and + std::is_nothrow_move_assignable<json_value>::value + ) + { + // check that passed value is valid + other.assert_invariant(); + + using std::swap; + swap(m_type, other.m_type); + swap(m_value, other.m_value); + + assert_invariant(); + return *this; + } + + /*! + @brief destructor + + Destroys the JSON value and frees all allocated memory. + + @complexity Linear. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + - All stored elements are destroyed and all memory is freed. + + @since version 1.0.0 + */ + ~basic_json() noexcept + { + assert_invariant(); + m_value.destroy(m_type); + } + + /// @} + + public: + /////////////////////// + // object inspection // + /////////////////////// + + /// @name object inspection + /// Functions to inspect the type of a JSON value. + /// @{ + + /*! + @brief serialization + + Serialization function for JSON values. The function tries to mimic + Python's `json.dumps()` function, and currently supports its @a indent + and @a ensure_ascii parameters. + + @param[in] indent If indent is nonnegative, then array elements and object + members will be pretty-printed with that indent level. An indent level of + `0` will only insert newlines. `-1` (the default) selects the most compact + representation. + @param[in] indent_char The character to use for indentation if @a indent is + greater than `0`. The default is ` ` (space). + @param[in] ensure_ascii If @a ensure_ascii is true, all non-ASCII characters + in the output are escaped with `\uXXXX` sequences, and the result consists + of ASCII characters only. + @param[in] error_handler how to react on decoding errors; there are three + possible values: `strict` (throws and exception in case a decoding error + occurs; default), `replace` (replace invalid UTF-8 sequences with U+FFFD), + and `ignore` (ignore invalid UTF-8 sequences during serialization). + @param[in] serialize_binary Whether or not to allow serialization of binary + types to JSON. Because binary types are non-standard, this will produce + non-conformant JSON, and is disabled by default. This flag is primarily + useful for debugging. Will output the binary value as a list of 8-bit + numbers prefixed by "b" (e.g. "bindata" = b[3, 0, 42, 255]). + + @return string containing the serialization of the JSON value + + @throw type_error.316 if a string stored inside the JSON value is not + UTF-8 encoded + + @complexity Linear. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @liveexample{The following example shows the effect of different @a indent\, + @a indent_char\, and @a ensure_ascii parameters to the result of the + serialization.,dump} + + @see https://docs.python.org/2/library/json.html#json.dump + + @since version 1.0.0; indentation character @a indent_char, option + @a ensure_ascii and exceptions added in version 3.0.0; error + handlers added in version 3.4.0. + */ + string_t dump(const int indent = -1, + const char indent_char = ' ', + const bool ensure_ascii = false, + const error_handler_t error_handler = error_handler_t::strict, + const bool serialize_binary = false) const + { + string_t result; + serializer s(detail::output_adapter<char, string_t>(result), indent_char, error_handler); + + if (indent >= 0) + { + s.dump(*this, true, ensure_ascii, static_cast<unsigned int>(indent), 0, serialize_binary); + } + else + { + s.dump(*this, false, ensure_ascii, 0, 0, serialize_binary); + } + + return result; + } + + /*! + @brief return the type of the JSON value (explicit) + + Return the type of the JSON value as a value from the @ref value_t + enumeration. + + @return the type of the JSON value + Value type | return value + ------------------------- | ------------------------- + null | value_t::null + boolean | value_t::boolean + string | value_t::string + number (integer) | value_t::number_integer + number (unsigned integer) | value_t::number_unsigned + number (floating-point) | value_t::number_float + object | value_t::object + array | value_t::array + binary | value_t::binary + discarded | value_t::discarded + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `type()` for all JSON + types.,type} + + @sa @ref operator value_t() -- return the type of the JSON value (implicit) + @sa @ref type_name() -- return the type as string + + @since version 1.0.0 + */ + constexpr value_t type() const noexcept + { + return m_type; + } + + /*! + @brief return whether type is primitive + + This function returns true if and only if the JSON type is primitive + (string, number, boolean, or null). + + @return `true` if type is primitive (string, number, boolean, or null), + `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_primitive()` for all JSON + types.,is_primitive} + + @sa @ref is_structured() -- returns whether JSON value is structured + @sa @ref is_null() -- returns whether JSON value is `null` + @sa @ref is_string() -- returns whether JSON value is a string + @sa @ref is_boolean() -- returns whether JSON value is a boolean + @sa @ref is_number() -- returns whether JSON value is a number + @sa @ref is_binary() -- returns whether JSON value is a binary array + + @since version 1.0.0 + */ + constexpr bool is_primitive() const noexcept + { + return is_null() or is_string() or is_boolean() or is_number() or is_binary(); + } + + /*! + @brief return whether type is structured + + This function returns true if and only if the JSON type is structured + (array or object). + + @return `true` if type is structured (array or object), `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_structured()` for all JSON + types.,is_structured} + + @sa @ref is_primitive() -- returns whether value is primitive + @sa @ref is_array() -- returns whether value is an array + @sa @ref is_object() -- returns whether value is an object + + @since version 1.0.0 + */ + constexpr bool is_structured() const noexcept + { + return is_array() or is_object(); + } + + /*! + @brief return whether value is null + + This function returns true if and only if the JSON value is null. + + @return `true` if type is null, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_null()` for all JSON + types.,is_null} + + @since version 1.0.0 + */ + constexpr bool is_null() const noexcept + { + return m_type == value_t::null; + } + + /*! + @brief return whether value is a boolean + + This function returns true if and only if the JSON value is a boolean. + + @return `true` if type is boolean, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_boolean()` for all JSON + types.,is_boolean} + + @since version 1.0.0 + */ + constexpr bool is_boolean() const noexcept + { + return m_type == value_t::boolean; + } + + /*! + @brief return whether value is a number + + This function returns true if and only if the JSON value is a number. This + includes both integer (signed and unsigned) and floating-point values. + + @return `true` if type is number (regardless whether integer, unsigned + integer or floating-type), `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number()` for all JSON + types.,is_number} + + @sa @ref is_number_integer() -- check if value is an integer or unsigned + integer number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 1.0.0 + */ + constexpr bool is_number() const noexcept + { + return is_number_integer() or is_number_float(); + } + + /*! + @brief return whether value is an integer number + + This function returns true if and only if the JSON value is a signed or + unsigned integer number. This excludes floating-point values. + + @return `true` if type is an integer or unsigned integer number, `false` + otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_integer()` for all + JSON types.,is_number_integer} + + @sa @ref is_number() -- check if value is a number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 1.0.0 + */ + constexpr bool is_number_integer() const noexcept + { + return m_type == value_t::number_integer or m_type == value_t::number_unsigned; + } + + /*! + @brief return whether value is an unsigned integer number + + This function returns true if and only if the JSON value is an unsigned + integer number. This excludes floating-point and signed integer values. + + @return `true` if type is an unsigned integer number, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_unsigned()` for all + JSON types.,is_number_unsigned} + + @sa @ref is_number() -- check if value is a number + @sa @ref is_number_integer() -- check if value is an integer or unsigned + integer number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 2.0.0 + */ + constexpr bool is_number_unsigned() const noexcept + { + return m_type == value_t::number_unsigned; + } + + /*! + @brief return whether value is a floating-point number + + This function returns true if and only if the JSON value is a + floating-point number. This excludes signed and unsigned integer values. + + @return `true` if type is a floating-point number, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_float()` for all + JSON types.,is_number_float} + + @sa @ref is_number() -- check if value is number + @sa @ref is_number_integer() -- check if value is an integer number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + + @since version 1.0.0 + */ + constexpr bool is_number_float() const noexcept + { + return m_type == value_t::number_float; + } + + /*! + @brief return whether value is an object + + This function returns true if and only if the JSON value is an object. + + @return `true` if type is object, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_object()` for all JSON + types.,is_object} + + @since version 1.0.0 + */ + constexpr bool is_object() const noexcept + { + return m_type == value_t::object; + } + + /*! + @brief return whether value is an array + + This function returns true if and only if the JSON value is an array. + + @return `true` if type is array, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_array()` for all JSON + types.,is_array} + + @since version 1.0.0 + */ + constexpr bool is_array() const noexcept + { + return m_type == value_t::array; + } + + /*! + @brief return whether value is a string + + This function returns true if and only if the JSON value is a string. + + @return `true` if type is string, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_string()` for all JSON + types.,is_string} + + @since version 1.0.0 + */ + constexpr bool is_string() const noexcept + { + return m_type == value_t::string; + } + + /*! + @brief return whether value is a binary array + + This function returns true if and only if the JSON value is a binary array. + + @return `true` if type is binary array, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_binary()` for all JSON + types.,is_binary} + + @since version 3.8.0 + */ + constexpr bool is_binary() const noexcept + { + return m_type == value_t::binary; + } + + /*! + @brief return whether value is discarded + + This function returns true if and only if the JSON value was discarded + during parsing with a callback function (see @ref parser_callback_t). + + @note This function will always be `false` for JSON values after parsing. + That is, discarded values can only occur during parsing, but will be + removed when inside a structured value or replaced by null in other cases. + + @return `true` if type is discarded, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_discarded()` for all JSON + types.,is_discarded} + + @since version 1.0.0 + */ + constexpr bool is_discarded() const noexcept + { + return m_type == value_t::discarded; + } + + /*! + @brief return the type of the JSON value (implicit) + + Implicitly return the type of the JSON value as a value from the @ref + value_t enumeration. + + @return the type of the JSON value + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies the @ref value_t operator for + all JSON types.,operator__value_t} + + @sa @ref type() -- return the type of the JSON value (explicit) + @sa @ref type_name() -- return the type as string + + @since version 1.0.0 + */ + constexpr operator value_t() const noexcept + { + return m_type; + } + + /// @} + + private: + ////////////////// + // value access // + ////////////////// + + /// get a boolean (explicit) + boolean_t get_impl(boolean_t* /*unused*/) const + { + if (JSON_HEDLEY_LIKELY(is_boolean())) + { + return m_value.boolean; + } + + JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(type_name()))); + } + + /// get a pointer to the value (object) + object_t* get_impl_ptr(object_t* /*unused*/) noexcept + { + return is_object() ? m_value.object : nullptr; + } + + /// get a pointer to the value (object) + constexpr const object_t* get_impl_ptr(const object_t* /*unused*/) const noexcept + { + return is_object() ? m_value.object : nullptr; + } + + /// get a pointer to the value (array) + array_t* get_impl_ptr(array_t* /*unused*/) noexcept + { + return is_array() ? m_value.array : nullptr; + } + + /// get a pointer to the value (array) + constexpr const array_t* get_impl_ptr(const array_t* /*unused*/) const noexcept + { + return is_array() ? m_value.array : nullptr; + } + + /// get a pointer to the value (string) + string_t* get_impl_ptr(string_t* /*unused*/) noexcept + { + return is_string() ? m_value.string : nullptr; + } + + /// get a pointer to the value (string) + constexpr const string_t* get_impl_ptr(const string_t* /*unused*/) const noexcept + { + return is_string() ? m_value.string : nullptr; + } + + /// get a pointer to the value (boolean) + boolean_t* get_impl_ptr(boolean_t* /*unused*/) noexcept + { + return is_boolean() ? &m_value.boolean : nullptr; + } + + /// get a pointer to the value (boolean) + constexpr const boolean_t* get_impl_ptr(const boolean_t* /*unused*/) const noexcept + { + return is_boolean() ? &m_value.boolean : nullptr; + } + + /// get a pointer to the value (integer number) + number_integer_t* get_impl_ptr(number_integer_t* /*unused*/) noexcept + { + return is_number_integer() ? &m_value.number_integer : nullptr; + } + + /// get a pointer to the value (integer number) + constexpr const number_integer_t* get_impl_ptr(const number_integer_t* /*unused*/) const noexcept + { + return is_number_integer() ? &m_value.number_integer : nullptr; + } + + /// get a pointer to the value (unsigned number) + number_unsigned_t* get_impl_ptr(number_unsigned_t* /*unused*/) noexcept + { + return is_number_unsigned() ? &m_value.number_unsigned : nullptr; + } + + /// get a pointer to the value (unsigned number) + constexpr const number_unsigned_t* get_impl_ptr(const number_unsigned_t* /*unused*/) const noexcept + { + return is_number_unsigned() ? &m_value.number_unsigned : nullptr; + } + + /// get a pointer to the value (floating-point number) + number_float_t* get_impl_ptr(number_float_t* /*unused*/) noexcept + { + return is_number_float() ? &m_value.number_float : nullptr; + } + + /// get a pointer to the value (floating-point number) + constexpr const number_float_t* get_impl_ptr(const number_float_t* /*unused*/) const noexcept + { + return is_number_float() ? &m_value.number_float : nullptr; + } + + /// get a pointer to the value (binary) + binary_t* get_impl_ptr(binary_t* /*unused*/) noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /// get a pointer to the value (binary) + constexpr const binary_t* get_impl_ptr(const binary_t* /*unused*/) const noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /// get a pointer to the value (binary) + internal_binary_t* get_impl_ptr(internal_binary_t* /*unused*/) noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /// get a pointer to the value (binary) + constexpr const internal_binary_t* get_impl_ptr(const internal_binary_t* /*unused*/) const noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /*! + @brief helper function to implement get_ref() + + This function helps to implement get_ref() without code duplication for + const and non-const overloads + + @tparam ThisType will be deduced as `basic_json` or `const basic_json` + + @throw type_error.303 if ReferenceType does not match underlying value + type of the current JSON + */ + template<typename ReferenceType, typename ThisType> + static ReferenceType get_ref_impl(ThisType& obj) + { + // delegate the call to get_ptr<>() + auto ptr = obj.template get_ptr<typename std::add_pointer<ReferenceType>::type>(); + + if (JSON_HEDLEY_LIKELY(ptr != nullptr)) + { + return *ptr; + } + + JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + std::string(obj.type_name()))); + } + + public: + /// @name value access + /// Direct access to the stored value of a JSON value. + /// @{ + + /*! + @brief get special-case overload + + This overloads avoids a lot of template boilerplate, it can be seen as the + identity method + + @tparam BasicJsonType == @ref basic_json + + @return a copy of *this + + @complexity Constant. + + @since version 2.1.0 + */ + template<typename BasicJsonType, detail::enable_if_t< + std::is_same<typename std::remove_const<BasicJsonType>::type, basic_json_t>::value, + int> = 0> + basic_json get() const + { + return *this; + } + + /*! + @brief get special-case overload + + This overloads converts the current @ref basic_json in a different + @ref basic_json type + + @tparam BasicJsonType == @ref basic_json + + @return a copy of *this, converted into @tparam BasicJsonType + + @complexity Depending on the implementation of the called `from_json()` + method. + + @since version 3.2.0 + */ + template<typename BasicJsonType, detail::enable_if_t< + not std::is_same<BasicJsonType, basic_json>::value and + detail::is_basic_json<BasicJsonType>::value, int> = 0> + BasicJsonType get() const + { + return *this; + } + + /*! + @brief get a value (explicit) + + Explicit type conversion between the JSON value and a compatible value + which is [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible) + and [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). + The value is converted by calling the @ref json_serializer<ValueType> + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + ValueType ret; + JSONSerializer<ValueType>::from_json(*this, ret); + return ret; + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json, + - @ref json_serializer<ValueType> has a `from_json()` method of the form + `void from_json(const basic_json&, ValueType&)`, and + - @ref json_serializer<ValueType> does not have a `from_json()` method of + the form `ValueType from_json(const basic_json&)` + + @tparam ValueTypeCV the provided value type + @tparam ValueType the returned value type + + @return copy of the JSON value, converted to @a ValueType + + @throw what @ref json_serializer<ValueType> `from_json()` method throws + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector<short>`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map<std::string\, + json>`.,get__ValueType_const} + + @since version 2.1.0 + */ + template<typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>, + detail::enable_if_t < + not detail::is_basic_json<ValueType>::value and + detail::has_from_json<basic_json_t, ValueType>::value and + not detail::has_non_default_from_json<basic_json_t, ValueType>::value, + int> = 0> + ValueType get() const noexcept(noexcept( + JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>()))) + { + // we cannot static_assert on ValueTypeCV being non-const, because + // there is support for get<const basic_json_t>(), which is why we + // still need the uncvref + static_assert(not std::is_reference<ValueTypeCV>::value, + "get() cannot be used with reference types, you might want to use get_ref()"); + static_assert(std::is_default_constructible<ValueType>::value, + "types must be DefaultConstructible when used with get()"); + + ValueType ret; + JSONSerializer<ValueType>::from_json(*this, ret); + return ret; + } + + /*! + @brief get a value (explicit); special case + + Explicit type conversion between the JSON value and a compatible value + which is **not** [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible) + and **not** [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). + The value is converted by calling the @ref json_serializer<ValueType> + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + return JSONSerializer<ValueTypeCV>::from_json(*this); + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json and + - @ref json_serializer<ValueType> has a `from_json()` method of the form + `ValueType from_json(const basic_json&)` + + @note If @ref json_serializer<ValueType> has both overloads of + `from_json()`, this one is chosen. + + @tparam ValueTypeCV the provided value type + @tparam ValueType the returned value type + + @return copy of the JSON value, converted to @a ValueType + + @throw what @ref json_serializer<ValueType> `from_json()` method throws + + @since version 2.1.0 + */ + template<typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>, + detail::enable_if_t<not std::is_same<basic_json_t, ValueType>::value and + detail::has_non_default_from_json<basic_json_t, ValueType>::value, + int> = 0> + ValueType get() const noexcept(noexcept( + JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>()))) + { + static_assert(not std::is_reference<ValueTypeCV>::value, + "get() cannot be used with reference types, you might want to use get_ref()"); + return JSONSerializer<ValueType>::from_json(*this); + } + + /*! + @brief get a value (explicit) + + Explicit type conversion between the JSON value and a compatible value. + The value is filled into the input parameter by calling the @ref json_serializer<ValueType> + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + ValueType v; + JSONSerializer<ValueType>::from_json(*this, v); + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json, + - @ref json_serializer<ValueType> has a `from_json()` method of the form + `void from_json(const basic_json&, ValueType&)`, and + + @tparam ValueType the input parameter type. + + @return the input parameter, allowing chaining calls. + + @throw what @ref json_serializer<ValueType> `from_json()` method throws + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector<short>`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map<std::string\, + json>`.,get_to} + + @since version 3.3.0 + */ + template<typename ValueType, + detail::enable_if_t < + not detail::is_basic_json<ValueType>::value and + detail::has_from_json<basic_json_t, ValueType>::value, + int> = 0> + ValueType & get_to(ValueType& v) const noexcept(noexcept( + JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v))) + { + JSONSerializer<ValueType>::from_json(*this, v); + return v; + } + + template < + typename T, std::size_t N, + typename Array = T (&)[N], + detail::enable_if_t < + detail::has_from_json<basic_json_t, Array>::value, int > = 0 > + Array get_to(T (&v)[N]) const + noexcept(noexcept(JSONSerializer<Array>::from_json( + std::declval<const basic_json_t&>(), v))) + { + JSONSerializer<Array>::from_json(*this, v); + return v; + } + + + /*! + @brief get a pointer value (implicit) + + Implicit pointer access to the internally stored JSON value. No copies are + made. + + @warning Writing data to the pointee of the result yields an undefined + state. + + @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref + object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, + @ref number_unsigned_t, or @ref number_float_t. Enforced by a static + assertion. + + @return pointer to the internally stored JSON value if the requested + pointer type @a PointerType fits to the JSON value; `nullptr` otherwise + + @complexity Constant. + + @liveexample{The example below shows how pointers to internal values of a + JSON value can be requested. Note that no type conversions are made and a + `nullptr` is returned if the value and the requested pointer type does not + match.,get_ptr} + + @since version 1.0.0 + */ + template<typename PointerType, typename std::enable_if< + std::is_pointer<PointerType>::value, int>::type = 0> + auto get_ptr() noexcept -> decltype(std::declval<basic_json_t&>().get_impl_ptr(std::declval<PointerType>())) + { + // delegate the call to get_impl_ptr<>() + return get_impl_ptr(static_cast<PointerType>(nullptr)); + } + + /*! + @brief get a pointer value (implicit) + @copydoc get_ptr() + */ + template<typename PointerType, typename std::enable_if< + std::is_pointer<PointerType>::value and + std::is_const<typename std::remove_pointer<PointerType>::type>::value, int>::type = 0> + constexpr auto get_ptr() const noexcept -> decltype(std::declval<const basic_json_t&>().get_impl_ptr(std::declval<PointerType>())) + { + // delegate the call to get_impl_ptr<>() const + return get_impl_ptr(static_cast<PointerType>(nullptr)); + } + + /*! + @brief get a pointer value (explicit) + + Explicit pointer access to the internally stored JSON value. No copies are + made. + + @warning The pointer becomes invalid if the underlying JSON object + changes. + + @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref + object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, + @ref number_unsigned_t, or @ref number_float_t. + + @return pointer to the internally stored JSON value if the requested + pointer type @a PointerType fits to the JSON value; `nullptr` otherwise + + @complexity Constant. + + @liveexample{The example below shows how pointers to internal values of a + JSON value can be requested. Note that no type conversions are made and a + `nullptr` is returned if the value and the requested pointer type does not + match.,get__PointerType} + + @sa @ref get_ptr() for explicit pointer-member access + + @since version 1.0.0 + */ + template<typename PointerType, typename std::enable_if< + std::is_pointer<PointerType>::value, int>::type = 0> + auto get() noexcept -> decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>()) + { + // delegate the call to get_ptr + return get_ptr<PointerType>(); + } + + /*! + @brief get a pointer value (explicit) + @copydoc get() + */ + template<typename PointerType, typename std::enable_if< + std::is_pointer<PointerType>::value, int>::type = 0> + constexpr auto get() const noexcept -> decltype(std::declval<const basic_json_t&>().template get_ptr<PointerType>()) + { + // delegate the call to get_ptr + return get_ptr<PointerType>(); + } + + /*! + @brief get a reference value (implicit) + + Implicit reference access to the internally stored JSON value. No copies + are made. + + @warning Writing data to the referee of the result yields an undefined + state. + + @tparam ReferenceType reference type; must be a reference to @ref array_t, + @ref object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, or + @ref number_float_t. Enforced by static assertion. + + @return reference to the internally stored JSON value if the requested + reference type @a ReferenceType fits to the JSON value; throws + type_error.303 otherwise + + @throw type_error.303 in case passed type @a ReferenceType is incompatible + with the stored JSON value; see example below + + @complexity Constant. + + @liveexample{The example shows several calls to `get_ref()`.,get_ref} + + @since version 1.1.0 + */ + template<typename ReferenceType, typename std::enable_if< + std::is_reference<ReferenceType>::value, int>::type = 0> + ReferenceType get_ref() + { + // delegate call to get_ref_impl + return get_ref_impl<ReferenceType>(*this); + } + + /*! + @brief get a reference value (implicit) + @copydoc get_ref() + */ + template<typename ReferenceType, typename std::enable_if< + std::is_reference<ReferenceType>::value and + std::is_const<typename std::remove_reference<ReferenceType>::type>::value, int>::type = 0> + ReferenceType get_ref() const + { + // delegate call to get_ref_impl + return get_ref_impl<ReferenceType>(*this); + } + + /*! + @brief get a value (implicit) + + Implicit type conversion between the JSON value and a compatible value. + The call is realized by calling @ref get() const. + + @tparam ValueType non-pointer type compatible to the JSON value, for + instance `int` for JSON integer numbers, `bool` for JSON booleans, or + `std::vector` types for JSON arrays. The character type of @ref string_t + as well as an initializer list of this type is excluded to avoid + ambiguities as these types implicitly convert to `std::string`. + + @return copy of the JSON value, converted to type @a ValueType + + @throw type_error.302 in case passed type @a ValueType is incompatible + to the JSON value type (e.g., the JSON value is of type boolean, but a + string is requested); see example below + + @complexity Linear in the size of the JSON value. + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector<short>`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map<std::string\, + json>`.,operator__ValueType} + + @since version 1.0.0 + */ + template < typename ValueType, typename std::enable_if < + not std::is_pointer<ValueType>::value and + not std::is_same<ValueType, detail::json_ref<basic_json>>::value and + not std::is_same<ValueType, typename string_t::value_type>::value and + not detail::is_basic_json<ValueType>::value + and not std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>::value +#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) and _MSC_VER <= 1914)) + and not std::is_same<ValueType, typename std::string_view>::value +#endif + and detail::is_detected<detail::get_template_function, const basic_json_t&, ValueType>::value + , int >::type = 0 > + operator ValueType() const + { + // delegate the call to get<>() const + return get<ValueType>(); + } + + /// @} + + + //////////////////// + // element access // + //////////////////// + + /// @name element access + /// Access to the JSON value. + /// @{ + + /*! + @brief access specified array element with bounds checking + + Returns a reference to the element at specified location @a idx, with + bounds checking. + + @param[in] idx index of the element to access + + @return reference to the element at index @a idx + + @throw type_error.304 if the JSON value is not an array; in this case, + calling `at` with an index makes no sense. See example below. + @throw out_of_range.401 if the index @a idx is out of range of the array; + that is, `idx >= size()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 1.0.0 + + @liveexample{The example below shows how array elements can be read and + written using `at()`. It also demonstrates the different exceptions that + can be thrown.,at__size_type} + */ + reference at(size_type idx) + { + // at only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + JSON_TRY + { + return m_value.array->at(idx); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified array element with bounds checking + + Returns a const reference to the element at specified location @a idx, + with bounds checking. + + @param[in] idx index of the element to access + + @return const reference to the element at index @a idx + + @throw type_error.304 if the JSON value is not an array; in this case, + calling `at` with an index makes no sense. See example below. + @throw out_of_range.401 if the index @a idx is out of range of the array; + that is, `idx >= size()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 1.0.0 + + @liveexample{The example below shows how array elements can be read using + `at()`. It also demonstrates the different exceptions that can be thrown., + at__size_type_const} + */ + const_reference at(size_type idx) const + { + // at only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + JSON_TRY + { + return m_value.array->at(idx); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified object element with bounds checking + + Returns a reference to the element at with specified key @a key, with + bounds checking. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.304 if the JSON value is not an object; in this case, + calling `at` with a key makes no sense. See example below. + @throw out_of_range.403 if the key @a key is is not stored in the object; + that is, `find(key) == end()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Logarithmic in the size of the container. + + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + + @liveexample{The example below shows how object elements can be read and + written using `at()`. It also demonstrates the different exceptions that + can be thrown.,at__object_t_key_type} + */ + reference at(const typename object_t::key_type& key) + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_TRY + { + return m_value.object->at(key); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified object element with bounds checking + + Returns a const reference to the element at with specified key @a key, + with bounds checking. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @throw type_error.304 if the JSON value is not an object; in this case, + calling `at` with a key makes no sense. See example below. + @throw out_of_range.403 if the key @a key is is not stored in the object; + that is, `find(key) == end()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Logarithmic in the size of the container. + + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + + @liveexample{The example below shows how object elements can be read using + `at()`. It also demonstrates the different exceptions that can be thrown., + at__object_t_key_type_const} + */ + const_reference at(const typename object_t::key_type& key) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_TRY + { + return m_value.object->at(key); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified array element + + Returns a reference to the element at specified location @a idx. + + @note If @a idx is beyond the range of the array (i.e., `idx >= size()`), + then the array is silently filled up with `null` values to make `idx` a + valid reference to the last stored element. + + @param[in] idx index of the element to access + + @return reference to the element at index @a idx + + @throw type_error.305 if the JSON value is not an array or null; in that + cases, using the [] operator with an index makes no sense. + + @complexity Constant if @a idx is in the range of the array. Otherwise + linear in `idx - size()`. + + @liveexample{The example below shows how array elements can be read and + written using `[]` operator. Note the addition of `null` + values.,operatorarray__size_type} + + @since version 1.0.0 + */ + reference operator[](size_type idx) + { + // implicitly convert null value to an empty array + if (is_null()) + { + m_type = value_t::array; + m_value.array = create<array_t>(); + assert_invariant(); + } + + // operator[] only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // fill up array with null values if given idx is outside range + if (idx >= m_value.array->size()) + { + m_value.array->insert(m_value.array->end(), + idx - m_value.array->size() + 1, + basic_json()); + } + + return m_value.array->operator[](idx); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name()))); + } + + /*! + @brief access specified array element + + Returns a const reference to the element at specified location @a idx. + + @param[in] idx index of the element to access + + @return const reference to the element at index @a idx + + @throw type_error.305 if the JSON value is not an array; in that case, + using the [] operator with an index makes no sense. + + @complexity Constant. + + @liveexample{The example below shows how array elements can be read using + the `[]` operator.,operatorarray__size_type_const} + + @since version 1.0.0 + */ + const_reference operator[](size_type idx) const + { + // const operator[] only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + return m_value.array->operator[](idx); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element + + Returns a reference to the element at with specified key @a key. + + @note If @a key is not found in the object, then it is silently added to + the object and filled with a `null` value to make `key` a valid reference. + In case the value was `null` before, it is converted to an object. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.305 if the JSON value is not an object or null; in that + cases, using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read and + written using the `[]` operator.,operatorarray__key_type} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + */ + reference operator[](const typename object_t::key_type& key) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create<object_t>(); + assert_invariant(); + } + + // operator[] only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->operator[](key); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief read-only access specified object element + + Returns a const reference to the element at with specified key @a key. No + bounds checking is performed. + + @warning If the element with key @a key does not exist, the behavior is + undefined. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @pre The element with key @a key must exist. **This precondition is + enforced with an assertion.** + + @throw type_error.305 if the JSON value is not an object; in that case, + using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read using + the `[]` operator.,operatorarray__key_type_const} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + */ + const_reference operator[](const typename object_t::key_type& key) const + { + // const operator[] only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + assert(m_value.object->find(key) != m_value.object->end()); + return m_value.object->find(key)->second; + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element + + Returns a reference to the element at with specified key @a key. + + @note If @a key is not found in the object, then it is silently added to + the object and filled with a `null` value to make `key` a valid reference. + In case the value was `null` before, it is converted to an object. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.305 if the JSON value is not an object or null; in that + cases, using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read and + written using the `[]` operator.,operatorarray__key_type} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.1.0 + */ + template<typename T> + JSON_HEDLEY_NON_NULL(2) + reference operator[](T* key) + { + // implicitly convert null to object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->operator[](key); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief read-only access specified object element + + Returns a const reference to the element at with specified key @a key. No + bounds checking is performed. + + @warning If the element with key @a key does not exist, the behavior is + undefined. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @pre The element with key @a key must exist. **This precondition is + enforced with an assertion.** + + @throw type_error.305 if the JSON value is not an object; in that case, + using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read using + the `[]` operator.,operatorarray__key_type_const} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.1.0 + */ + template<typename T> + JSON_HEDLEY_NON_NULL(2) + const_reference operator[](T* key) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + assert(m_value.object->find(key) != m_value.object->end()); + return m_value.object->find(key)->second; + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element with default value + + Returns either a copy of an object's element at the specified key @a key + or a given default value if no element with key @a key exists. + + The function is basically equivalent to executing + @code {.cpp} + try { + return at(key); + } catch(out_of_range) { + return default_value; + } + @endcode + + @note Unlike @ref at(const typename object_t::key_type&), this function + does not throw if the given key @a key was not found. + + @note Unlike @ref operator[](const typename object_t::key_type& key), this + function does not implicitly add an element to the position defined by @a + key. This function is furthermore also applicable to const objects. + + @param[in] key key of the element to access + @param[in] default_value the value to return if @a key is not found + + @tparam ValueType type compatible to JSON values, for instance `int` for + JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for + JSON arrays. Note the type of the expected value at @a key and the default + value @a default_value must be compatible. + + @return copy of the element at key @a key or @a default_value if @a key + is not found + + @throw type_error.302 if @a default_value does not match the type of the + value at @a key + @throw type_error.306 if the JSON value is not an object; in that case, + using `value()` with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be queried + with a default value.,basic_json__value} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + + @since version 1.0.0 + */ + template<class ValueType, typename std::enable_if< + std::is_convertible<basic_json_t, ValueType>::value, int>::type = 0> + ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + // if key is found, return value and given default value otherwise + const auto it = find(key); + if (it != end()) + { + return *it; + } + + return default_value; + } + + JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name()))); + } + + /*! + @brief overload for a default value of type const char* + @copydoc basic_json::value(const typename object_t::key_type&, const ValueType&) const + */ + string_t value(const typename object_t::key_type& key, const char* default_value) const + { + return value(key, string_t(default_value)); + } + + /*! + @brief access specified object element via JSON Pointer with default value + + Returns either a copy of an object's element at the specified key @a key + or a given default value if no element with key @a key exists. + + The function is basically equivalent to executing + @code {.cpp} + try { + return at(ptr); + } catch(out_of_range) { + return default_value; + } + @endcode + + @note Unlike @ref at(const json_pointer&), this function does not throw + if the given key @a key was not found. + + @param[in] ptr a JSON pointer to the element to access + @param[in] default_value the value to return if @a ptr found no value + + @tparam ValueType type compatible to JSON values, for instance `int` for + JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for + JSON arrays. Note the type of the expected value at @a key and the default + value @a default_value must be compatible. + + @return copy of the element at key @a key or @a default_value if @a key + is not found + + @throw type_error.302 if @a default_value does not match the type of the + value at @a ptr + @throw type_error.306 if the JSON value is not an object; in that case, + using `value()` with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be queried + with a default value.,basic_json__value_ptr} + + @sa @ref operator[](const json_pointer&) for unchecked access by reference + + @since version 2.0.2 + */ + template<class ValueType, typename std::enable_if< + std::is_convertible<basic_json_t, ValueType>::value, int>::type = 0> + ValueType value(const json_pointer& ptr, const ValueType& default_value) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + // if pointer resolves a value, return it or use default value + JSON_TRY + { + return ptr.get_checked(this); + } + JSON_INTERNAL_CATCH (out_of_range&) + { + return default_value; + } + } + + JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name()))); + } + + /*! + @brief overload for a default value of type const char* + @copydoc basic_json::value(const json_pointer&, ValueType) const + */ + JSON_HEDLEY_NON_NULL(3) + string_t value(const json_pointer& ptr, const char* default_value) const + { + return value(ptr, string_t(default_value)); + } + + /*! + @brief return the binary subtype + + Returns the numerical subtype of the JSON value, if the JSON value is of + type "binary", and it has a subtype. If it does not have a subtype (or the + object is not of type binary) this function will return size_t(-1) as a + sentinel value. + + @return the numerical subtype of the binary JSON value + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + std::size_t get_subtype() const noexcept + { + if (is_binary() and m_value.binary->has_subtype) + { + return m_value.binary->subtype; + } + + return std::size_t(-1); + } + + /*! + @brief sets the binary subtype + + Sets the binary subtype of the JSON value, also flags a binary JSON value as + having a subtype, which has implications for serialization to msgpack (will + prefer ext file formats over bin). If the JSON value is not a binary value, + this function does nothing. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref get_subtype() -- return the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + + void set_subtype(std::uint8_t subtype) noexcept + { + if (is_binary()) + { + m_value.binary->has_subtype = true; + m_value.binary->subtype = subtype; + } + } + + /*! + @brief clears the binary subtype + + Clears the binary subtype of the JSON value, also flags a binary JSON value + as not having a subtype, which has implications for serialization to msgpack + (will prefer bin file formats over ext). If the JSON value is not a binary + value, this function does nothing. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref get_subtype() -- return the binary subtype + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + void clear_subtype() noexcept + { + if (is_binary()) + { + m_value.binary->has_subtype = false; + m_value.binary->subtype = 0; + } + } + + /*! + @brief return whether or not the binary subtype has a value + + Returns whether or not the binary subtype has a value. + + @return whether or not the binary subtype has a value. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref get_subtype() -- return the binary subtype + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + + @since version 3.8.0 + */ + bool has_subtype() const noexcept + { + return is_binary() and m_value.binary->has_subtype; + } + + /*! + @brief access the first element + + Returns a reference to the first element in the container. For a JSON + container `c`, the expression `c.front()` is equivalent to `*c.begin()`. + + @return In case of a structured type (array or object), a reference to the + first element is returned. In case of number, string, boolean, or binary + values, a reference to the value is returned. + + @complexity Constant. + + @pre The JSON value must not be `null` (would throw `std::out_of_range`) + or an empty array or object (undefined behavior, **guarded by + assertions**). + @post The JSON value remains unchanged. + + @throw invalid_iterator.214 when called on `null` value + + @liveexample{The following code shows an example for `front()`.,front} + + @sa @ref back() -- access the last element + + @since version 1.0.0 + */ + reference front() + { + return *begin(); + } + + /*! + @copydoc basic_json::front() + */ + const_reference front() const + { + return *cbegin(); + } + + /*! + @brief access the last element + + Returns a reference to the last element in the container. For a JSON + container `c`, the expression `c.back()` is equivalent to + @code {.cpp} + auto tmp = c.end(); + --tmp; + return *tmp; + @endcode + + @return In case of a structured type (array or object), a reference to the + last element is returned. In case of number, string, boolean, or binary + values, a reference to the value is returned. + + @complexity Constant. + + @pre The JSON value must not be `null` (would throw `std::out_of_range`) + or an empty array or object (undefined behavior, **guarded by + assertions**). + @post The JSON value remains unchanged. + + @throw invalid_iterator.214 when called on a `null` value. See example + below. + + @liveexample{The following code shows an example for `back()`.,back} + + @sa @ref front() -- access the first element + + @since version 1.0.0 + */ + reference back() + { + auto tmp = end(); + --tmp; + return *tmp; + } + + /*! + @copydoc basic_json::back() + */ + const_reference back() const + { + auto tmp = cend(); + --tmp; + return *tmp; + } + + /*! + @brief remove element given an iterator + + Removes the element specified by iterator @a pos. The iterator @a pos must + be valid and dereferenceable. Thus the `end()` iterator (which is valid, + but is not dereferenceable) cannot be used as a value for @a pos. + + If called on a primitive type other than `null`, the resulting JSON value + will be `null`. + + @param[in] pos iterator to the element to remove + @return Iterator following the last removed element. If the iterator @a + pos refers to the last element, the `end()` iterator is returned. + + @tparam IteratorType an @ref iterator or @ref const_iterator + + @post Invalidates iterators and references at or after the point of the + erase, including the `end()` iterator. + + @throw type_error.307 if called on a `null` value; example: `"cannot use + erase() with null"` + @throw invalid_iterator.202 if called on an iterator which does not belong + to the current JSON value; example: `"iterator does not fit current + value"` + @throw invalid_iterator.205 if called on a primitive type with invalid + iterator (i.e., any iterator which is not `begin()`); example: `"iterator + out of range"` + + @complexity The complexity depends on the type: + - objects: amortized constant + - arrays: linear in distance between @a pos and the end of the container + - strings and binary: linear in the length of the member + - other types: constant + + @liveexample{The example shows the result of `erase()` for different JSON + types.,erase__IteratorType} + + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + template<class IteratorType, typename std::enable_if< + std::is_same<IteratorType, typename basic_json_t::iterator>::value or + std::is_same<IteratorType, typename basic_json_t::const_iterator>::value, int>::type + = 0> + IteratorType erase(IteratorType pos) + { + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(this != pos.m_object)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + IteratorType result = end(); + + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + case value_t::binary: + { + if (JSON_HEDLEY_UNLIKELY(not pos.m_it.primitive_iterator.is_begin())) + { + JSON_THROW(invalid_iterator::create(205, "iterator out of range")); + } + + if (is_string()) + { + AllocatorType<string_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.string); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.string, 1); + m_value.string = nullptr; + } + else if (is_binary()) + { + AllocatorType<internal_binary_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.binary); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.binary, 1); + m_value.binary = nullptr; + } + + m_type = value_t::null; + assert_invariant(); + break; + } + + case value_t::object: + { + result.m_it.object_iterator = m_value.object->erase(pos.m_it.object_iterator); + break; + } + + case value_t::array: + { + result.m_it.array_iterator = m_value.array->erase(pos.m_it.array_iterator); + break; + } + + default: + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + return result; + } + + /*! + @brief remove elements given an iterator range + + Removes the element specified by the range `[first; last)`. The iterator + @a first does not need to be dereferenceable if `first == last`: erasing + an empty range is a no-op. + + If called on a primitive type other than `null`, the resulting JSON value + will be `null`. + + @param[in] first iterator to the beginning of the range to remove + @param[in] last iterator past the end of the range to remove + @return Iterator following the last removed element. If the iterator @a + second refers to the last element, the `end()` iterator is returned. + + @tparam IteratorType an @ref iterator or @ref const_iterator + + @post Invalidates iterators and references at or after the point of the + erase, including the `end()` iterator. + + @throw type_error.307 if called on a `null` value; example: `"cannot use + erase() with null"` + @throw invalid_iterator.203 if called on iterators which does not belong + to the current JSON value; example: `"iterators do not fit current value"` + @throw invalid_iterator.204 if called on a primitive type with invalid + iterators (i.e., if `first != begin()` and `last != end()`); example: + `"iterators out of range"` + + @complexity The complexity depends on the type: + - objects: `log(size()) + std::distance(first, last)` + - arrays: linear in the distance between @a first and @a last, plus linear + in the distance between @a last and end of the container + - strings and binary: linear in the length of the member + - other types: constant + + @liveexample{The example shows the result of `erase()` for different JSON + types.,erase__IteratorType_IteratorType} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + template<class IteratorType, typename std::enable_if< + std::is_same<IteratorType, typename basic_json_t::iterator>::value or + std::is_same<IteratorType, typename basic_json_t::const_iterator>::value, int>::type + = 0> + IteratorType erase(IteratorType first, IteratorType last) + { + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(this != first.m_object or this != last.m_object)) + { + JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); + } + + IteratorType result = end(); + + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + case value_t::binary: + { + if (JSON_HEDLEY_LIKELY(not first.m_it.primitive_iterator.is_begin() + or not last.m_it.primitive_iterator.is_end())) + { + JSON_THROW(invalid_iterator::create(204, "iterators out of range")); + } + + if (is_string()) + { + AllocatorType<string_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.string); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.string, 1); + m_value.string = nullptr; + } + else if (is_binary()) + { + AllocatorType<internal_binary_t> alloc; + std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.binary); + std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.binary, 1); + m_value.binary = nullptr; + } + + m_type = value_t::null; + assert_invariant(); + break; + } + + case value_t::object: + { + result.m_it.object_iterator = m_value.object->erase(first.m_it.object_iterator, + last.m_it.object_iterator); + break; + } + + case value_t::array: + { + result.m_it.array_iterator = m_value.array->erase(first.m_it.array_iterator, + last.m_it.array_iterator); + break; + } + + default: + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + return result; + } + + /*! + @brief remove element from a JSON object given a key + + Removes elements from a JSON object with the key value @a key. + + @param[in] key value of the elements to remove + + @return Number of elements removed. If @a ObjectType is the default + `std::map` type, the return value will always be `0` (@a key was not + found) or `1` (@a key was found). + + @post References and iterators to the erased elements are invalidated. + Other references and iterators are not affected. + + @throw type_error.307 when called on a type other than JSON object; + example: `"cannot use erase() with null"` + + @complexity `log(size()) + count(key)` + + @liveexample{The example shows the effect of `erase()`.,erase__key_type} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + size_type erase(const typename object_t::key_type& key) + { + // this erase only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->erase(key); + } + + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + /*! + @brief remove element from a JSON array given an index + + Removes element from a JSON array at the index @a idx. + + @param[in] idx index of the element to remove + + @throw type_error.307 when called on a type other than JSON object; + example: `"cannot use erase() with null"` + @throw out_of_range.401 when `idx >= size()`; example: `"array index 17 + is out of range"` + + @complexity Linear in distance between @a idx and the end of the container. + + @liveexample{The example shows the effect of `erase()`.,erase__size_type} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + + @since version 1.0.0 + */ + void erase(const size_type idx) + { + // this erase only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + if (JSON_HEDLEY_UNLIKELY(idx >= size())) + { + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + + m_value.array->erase(m_value.array->begin() + static_cast<difference_type>(idx)); + } + else + { + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + } + + /// @} + + + //////////// + // lookup // + //////////// + + /// @name lookup + /// @{ + + /*! + @brief find an element in a JSON object + + Finds an element in a JSON object with key equivalent to @a key. If the + element is not found or the JSON value is not an object, end() is + returned. + + @note This method always returns @ref end() when executed on a JSON type + that is not an object. + + @param[in] key key value of the element to search for. + + @return Iterator to an element with key equivalent to @a key. If no such + element is found or the JSON value is not an object, past-the-end (see + @ref end()) iterator is returned. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The example shows how `find()` is used.,find__key_type} + + @sa @ref contains(KeyT&&) const -- checks whether a key exists + + @since version 1.0.0 + */ + template<typename KeyT> + iterator find(KeyT&& key) + { + auto result = end(); + + if (is_object()) + { + result.m_it.object_iterator = m_value.object->find(std::forward<KeyT>(key)); + } + + return result; + } + + /*! + @brief find an element in a JSON object + @copydoc find(KeyT&&) + */ + template<typename KeyT> + const_iterator find(KeyT&& key) const + { + auto result = cend(); + + if (is_object()) + { + result.m_it.object_iterator = m_value.object->find(std::forward<KeyT>(key)); + } + + return result; + } + + /*! + @brief returns the number of occurrences of a key in a JSON object + + Returns the number of elements with key @a key. If ObjectType is the + default `std::map` type, the return value will always be `0` (@a key was + not found) or `1` (@a key was found). + + @note This method always returns `0` when executed on a JSON type that is + not an object. + + @param[in] key key value of the element to count + + @return Number of elements with key @a key. If the JSON value is not an + object, the return value will be `0`. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The example shows how `count()` is used.,count} + + @since version 1.0.0 + */ + template<typename KeyT> + size_type count(KeyT&& key) const + { + // return 0 for all nonobject types + return is_object() ? m_value.object->count(std::forward<KeyT>(key)) : 0; + } + + /*! + @brief check the existence of an element in a JSON object + + Check whether an element exists in a JSON object with key equivalent to + @a key. If the element is not found or the JSON value is not an object, + false is returned. + + @note This method always returns false when executed on a JSON type + that is not an object. + + @param[in] key key value to check its existence. + + @return true if an element with specified @a key exists. If no such + element with such key is found or the JSON value is not an object, + false is returned. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The following code shows an example for `contains()`.,contains} + + @sa @ref find(KeyT&&) -- returns an iterator to an object element + @sa @ref contains(const json_pointer&) const -- checks the existence for a JSON pointer + + @since version 3.6.0 + */ + template<typename KeyT, typename std::enable_if< + not std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int>::type = 0> + bool contains(KeyT && key) const + { + return is_object() and m_value.object->find(std::forward<KeyT>(key)) != m_value.object->end(); + } + + /*! + @brief check the existence of an element in a JSON object given a JSON pointer + + Check whether the given JSON pointer @a ptr can be resolved in the current + JSON value. + + @note This method can be executed on any JSON value type. + + @param[in] ptr JSON pointer to check its existence. + + @return true if the JSON pointer can be resolved to a stored value, false + otherwise. + + @post If `j.contains(ptr)` returns true, it is safe to call `j[ptr]`. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The following code shows an example for `contains()`.,contains_json_pointer} + + @sa @ref contains(KeyT &&) const -- checks the existence of a key + + @since version 3.7.0 + */ + bool contains(const json_pointer& ptr) const + { + return ptr.contains(this); + } + + /// @} + + + /////////////// + // iterators // + /////////////// + + /// @name iterators + /// @{ + + /*! + @brief returns an iterator to the first element + + Returns an iterator to the first element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return iterator to the first element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + + @liveexample{The following code shows an example for `begin()`.,begin} + + @sa @ref cbegin() -- returns a const iterator to the beginning + @sa @ref end() -- returns an iterator to the end + @sa @ref cend() -- returns a const iterator to the end + + @since version 1.0.0 + */ + iterator begin() noexcept + { + iterator result(this); + result.set_begin(); + return result; + } + + /*! + @copydoc basic_json::cbegin() + */ + const_iterator begin() const noexcept + { + return cbegin(); + } + + /*! + @brief returns a const iterator to the first element + + Returns a const iterator to the first element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return const iterator to the first element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast<const basic_json&>(*this).begin()`. + + @liveexample{The following code shows an example for `cbegin()`.,cbegin} + + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref end() -- returns an iterator to the end + @sa @ref cend() -- returns a const iterator to the end + + @since version 1.0.0 + */ + const_iterator cbegin() const noexcept + { + const_iterator result(this); + result.set_begin(); + return result; + } + + /*! + @brief returns an iterator to one past the last element + + Returns an iterator to one past the last element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return iterator one past the last element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + + @liveexample{The following code shows an example for `end()`.,end} + + @sa @ref cend() -- returns a const iterator to the end + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref cbegin() -- returns a const iterator to the beginning + + @since version 1.0.0 + */ + iterator end() noexcept + { + iterator result(this); + result.set_end(); + return result; + } + + /*! + @copydoc basic_json::cend() + */ + const_iterator end() const noexcept + { + return cend(); + } + + /*! + @brief returns a const iterator to one past the last element + + Returns a const iterator to one past the last element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return const iterator one past the last element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast<const basic_json&>(*this).end()`. + + @liveexample{The following code shows an example for `cend()`.,cend} + + @sa @ref end() -- returns an iterator to the end + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref cbegin() -- returns a const iterator to the beginning + + @since version 1.0.0 + */ + const_iterator cend() const noexcept + { + const_iterator result(this); + result.set_end(); + return result; + } + + /*! + @brief returns an iterator to the reverse-beginning + + Returns an iterator to the reverse-beginning; that is, the last element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `reverse_iterator(end())`. + + @liveexample{The following code shows an example for `rbegin()`.,rbegin} + + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref crend() -- returns a const reverse iterator to the end + + @since version 1.0.0 + */ + reverse_iterator rbegin() noexcept + { + return reverse_iterator(end()); + } + + /*! + @copydoc basic_json::crbegin() + */ + const_reverse_iterator rbegin() const noexcept + { + return crbegin(); + } + + /*! + @brief returns an iterator to the reverse-end + + Returns an iterator to the reverse-end; that is, one before the first + element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `reverse_iterator(begin())`. + + @liveexample{The following code shows an example for `rend()`.,rend} + + @sa @ref crend() -- returns a const reverse iterator to the end + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + + @since version 1.0.0 + */ + reverse_iterator rend() noexcept + { + return reverse_iterator(begin()); + } + + /*! + @copydoc basic_json::crend() + */ + const_reverse_iterator rend() const noexcept + { + return crend(); + } + + /*! + @brief returns a const reverse iterator to the last element + + Returns a const iterator to the reverse-beginning; that is, the last + element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast<const basic_json&>(*this).rbegin()`. + + @liveexample{The following code shows an example for `crbegin()`.,crbegin} + + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref crend() -- returns a const reverse iterator to the end + + @since version 1.0.0 + */ + const_reverse_iterator crbegin() const noexcept + { + return const_reverse_iterator(cend()); + } + + /*! + @brief returns a const reverse iterator to one before the first + + Returns a const reverse iterator to the reverse-end; that is, one before + the first element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast<const basic_json&>(*this).rend()`. + + @liveexample{The following code shows an example for `crend()`.,crend} + + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + + @since version 1.0.0 + */ + const_reverse_iterator crend() const noexcept + { + return const_reverse_iterator(cbegin()); + } + + public: + /*! + @brief wrapper to access iterator member functions in range-based for + + This function allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a + reference to the JSON values is returned, so there is no access to the + underlying iterator. + + For loop without iterator_wrapper: + + @code{cpp} + for (auto it = j_object.begin(); it != j_object.end(); ++it) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + Range-based for loop without iterator proxy: + + @code{cpp} + for (auto it : j_object) + { + // "it" is of type json::reference and has no key() member + std::cout << "value: " << it << '\n'; + } + @endcode + + Range-based for loop with iterator proxy: + + @code{cpp} + for (auto it : json::iterator_wrapper(j_object)) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + @note When iterating over an array, `key()` will return the index of the + element as string (see example). + + @param[in] ref reference to a JSON value + @return iteration proxy object wrapping @a ref with an interface to use in + range-based for loops + + @liveexample{The following code shows how the wrapper is used,iterator_wrapper} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @note The name of this function is not yet final and may change in the + future. + + @deprecated This stream operator is deprecated and will be removed in + future 4.0.0 of the library. Please use @ref items() instead; + that is, replace `json::iterator_wrapper(j)` with `j.items()`. + */ + JSON_HEDLEY_DEPRECATED(3.1.0) + static iteration_proxy<iterator> iterator_wrapper(reference ref) noexcept + { + return ref.items(); + } + + /*! + @copydoc iterator_wrapper(reference) + */ + JSON_HEDLEY_DEPRECATED(3.1.0) + static iteration_proxy<const_iterator> iterator_wrapper(const_reference ref) noexcept + { + return ref.items(); + } + + /*! + @brief helper to access iterator member functions in range-based for + + This function allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a + reference to the JSON values is returned, so there is no access to the + underlying iterator. + + For loop without `items()` function: + + @code{cpp} + for (auto it = j_object.begin(); it != j_object.end(); ++it) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + Range-based for loop without `items()` function: + + @code{cpp} + for (auto it : j_object) + { + // "it" is of type json::reference and has no key() member + std::cout << "value: " << it << '\n'; + } + @endcode + + Range-based for loop with `items()` function: + + @code{cpp} + for (auto& el : j_object.items()) + { + std::cout << "key: " << el.key() << ", value:" << el.value() << '\n'; + } + @endcode + + The `items()` function also allows to use + [structured bindings](https://en.cppreference.com/w/cpp/language/structured_binding) + (C++17): + + @code{cpp} + for (auto& [key, val] : j_object.items()) + { + std::cout << "key: " << key << ", value:" << val << '\n'; + } + @endcode + + @note When iterating over an array, `key()` will return the index of the + element as string (see example). For primitive types (e.g., numbers), + `key()` returns an empty string. + + @return iteration proxy object wrapping @a ref with an interface to use in + range-based for loops + + @liveexample{The following code shows how the function is used.,items} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 3.1.0, structured bindings support since 3.5.0. + */ + iteration_proxy<iterator> items() noexcept + { + return iteration_proxy<iterator>(*this); + } + + /*! + @copydoc items() + */ + iteration_proxy<const_iterator> items() const noexcept + { + return iteration_proxy<const_iterator>(*this); + } + + /// @} + + + ////////////// + // capacity // + ////////////// + + /// @name capacity + /// @{ + + /*! + @brief checks whether the container is empty. + + Checks if a JSON value has no elements (i.e. whether its @ref size is `0`). + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `true` + boolean | `false` + string | `false` + number | `false` + binary | `false` + object | result of function `object_t::empty()` + array | result of function `array_t::empty()` + + @liveexample{The following code uses `empty()` to check if a JSON + object contains any elements.,empty} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their `empty()` functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @note This function does not return whether a string stored as JSON value + is empty - it returns whether the JSON container itself is empty which is + false in the case of a string. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `begin() == end()`. + + @sa @ref size() -- returns the number of elements + + @since version 1.0.0 + */ + bool empty() const noexcept + { + switch (m_type) + { + case value_t::null: + { + // null values are empty + return true; + } + + case value_t::array: + { + // delegate call to array_t::empty() + return m_value.array->empty(); + } + + case value_t::object: + { + // delegate call to object_t::empty() + return m_value.object->empty(); + } + + default: + { + // all other types are nonempty + return false; + } + } + } + + /*! + @brief returns the number of elements + + Returns the number of elements in a JSON value. + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `0` + boolean | `1` + string | `1` + number | `1` + binary | `1` + object | result of function object_t::size() + array | result of function array_t::size() + + @liveexample{The following code calls `size()` on the different value + types.,size} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their size() functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @note This function does not return the length of a string stored as JSON + value - it returns the number of elements in the JSON value which is 1 in + the case of a string. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `std::distance(begin(), end())`. + + @sa @ref empty() -- checks whether the container is empty + @sa @ref max_size() -- returns the maximal number of elements + + @since version 1.0.0 + */ + size_type size() const noexcept + { + switch (m_type) + { + case value_t::null: + { + // null values are empty + return 0; + } + + case value_t::array: + { + // delegate call to array_t::size() + return m_value.array->size(); + } + + case value_t::object: + { + // delegate call to object_t::size() + return m_value.object->size(); + } + + default: + { + // all other types have size 1 + return 1; + } + } + } + + /*! + @brief returns the maximum possible number of elements + + Returns the maximum number of elements a JSON value is able to hold due to + system or library implementation limitations, i.e. `std::distance(begin(), + end())` for the JSON value. + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `0` (same as `size()`) + boolean | `1` (same as `size()`) + string | `1` (same as `size()`) + number | `1` (same as `size()`) + binary | `1` (same as `size()`) + object | result of function `object_t::max_size()` + array | result of function `array_t::max_size()` + + @liveexample{The following code calls `max_size()` on the different value + types. Note the output is implementation specific.,max_size} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their `max_size()` functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of returning `b.size()` where `b` is the largest + possible JSON value. + + @sa @ref size() -- returns the number of elements + + @since version 1.0.0 + */ + size_type max_size() const noexcept + { + switch (m_type) + { + case value_t::array: + { + // delegate call to array_t::max_size() + return m_value.array->max_size(); + } + + case value_t::object: + { + // delegate call to object_t::max_size() + return m_value.object->max_size(); + } + + default: + { + // all other types have max_size() == size() + return size(); + } + } + } + + /// @} + + + /////////////// + // modifiers // + /////////////// + + /// @name modifiers + /// @{ + + /*! + @brief clears the contents + + Clears the content of a JSON value and resets it to the default value as + if @ref basic_json(value_t) would have been called with the current value + type from @ref type(): + + Value type | initial value + ----------- | ------------- + null | `null` + boolean | `false` + string | `""` + number | `0` + binary | An empty byte vector + object | `{}` + array | `[]` + + @post Has the same effect as calling + @code {.cpp} + *this = basic_json(type()); + @endcode + + @liveexample{The example below shows the effect of `clear()` to different + JSON types.,clear} + + @complexity Linear in the size of the JSON value. + + @iterators All iterators, pointers and references related to this container + are invalidated. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @sa @ref basic_json(value_t) -- constructor that creates an object with the + same value than calling `clear()` + + @since version 1.0.0 + */ + void clear() noexcept + { + switch (m_type) + { + case value_t::number_integer: + { + m_value.number_integer = 0; + break; + } + + case value_t::number_unsigned: + { + m_value.number_unsigned = 0; + break; + } + + case value_t::number_float: + { + m_value.number_float = 0.0; + break; + } + + case value_t::boolean: + { + m_value.boolean = false; + break; + } + + case value_t::string: + { + m_value.string->clear(); + break; + } + + case value_t::binary: + { + m_value.binary->clear(); + break; + } + + case value_t::array: + { + m_value.array->clear(); + break; + } + + case value_t::object: + { + m_value.object->clear(); + break; + } + + default: + break; + } + } + + /*! + @brief add an object to an array + + Appends the given element @a val to the end of the JSON value. If the + function is called on a JSON null value, an empty array is created before + appending @a val. + + @param[in] val the value to add to the JSON array + + @throw type_error.308 when called on a type other than JSON array or + null; example: `"cannot use push_back() with number"` + + @complexity Amortized constant. + + @liveexample{The example shows how `push_back()` and `+=` can be used to + add elements to a JSON array. Note how the `null` value was silently + converted to a JSON array.,push_back} + + @since version 1.0.0 + */ + void push_back(basic_json&& val) + { + // push_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array (move semantics) + m_value.array->push_back(std::move(val)); + // if val is moved from, basic_json move constructor marks it null so we do not call the destructor + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + reference operator+=(basic_json&& val) + { + push_back(std::move(val)); + return *this; + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + void push_back(const basic_json& val) + { + // push_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array + m_value.array->push_back(val); + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + reference operator+=(const basic_json& val) + { + push_back(val); + return *this; + } + + /*! + @brief add an object to an object + + Inserts the given element @a val to the JSON object. If the function is + called on a JSON null value, an empty object is created before inserting + @a val. + + @param[in] val the value to add to the JSON object + + @throw type_error.308 when called on a type other than JSON object or + null; example: `"cannot use push_back() with number"` + + @complexity Logarithmic in the size of the container, O(log(`size()`)). + + @liveexample{The example shows how `push_back()` and `+=` can be used to + add elements to a JSON object. Note how the `null` value was silently + converted to a JSON object.,push_back__object_t__value} + + @since version 1.0.0 + */ + void push_back(const typename object_t::value_type& val) + { + // push_back only works for null objects or objects + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // add element to array + m_value.object->insert(val); + } + + /*! + @brief add an object to an object + @copydoc push_back(const typename object_t::value_type&) + */ + reference operator+=(const typename object_t::value_type& val) + { + push_back(val); + return *this; + } + + /*! + @brief add an object to an object + + This function allows to use `push_back` with an initializer list. In case + + 1. the current value is an object, + 2. the initializer list @a init contains only two elements, and + 3. the first element of @a init is a string, + + @a init is converted into an object element and added using + @ref push_back(const typename object_t::value_type&). Otherwise, @a init + is converted to a JSON value and added using @ref push_back(basic_json&&). + + @param[in] init an initializer list + + @complexity Linear in the size of the initializer list @a init. + + @note This function is required to resolve an ambiguous overload error, + because pairs like `{"key", "value"}` can be both interpreted as + `object_t::value_type` or `std::initializer_list<basic_json>`, see + https://github.com/nlohmann/json/issues/235 for more information. + + @liveexample{The example shows how initializer lists are treated as + objects when possible.,push_back__initializer_list} + */ + void push_back(initializer_list_t init) + { + if (is_object() and init.size() == 2 and (*init.begin())->is_string()) + { + basic_json&& key = init.begin()->moved_or_copied(); + push_back(typename object_t::value_type( + std::move(key.get_ref<string_t&>()), (init.begin() + 1)->moved_or_copied())); + } + else + { + push_back(basic_json(init)); + } + } + + /*! + @brief add an object to an object + @copydoc push_back(initializer_list_t) + */ + reference operator+=(initializer_list_t init) + { + push_back(init); + return *this; + } + + /*! + @brief add an object to an array + + Creates a JSON value from the passed parameters @a args to the end of the + JSON value. If the function is called on a JSON null value, an empty array + is created before appending the value created from @a args. + + @param[in] args arguments to forward to a constructor of @ref basic_json + @tparam Args compatible types to create a @ref basic_json object + + @return reference to the inserted element + + @throw type_error.311 when called on a type other than JSON array or + null; example: `"cannot use emplace_back() with number"` + + @complexity Amortized constant. + + @liveexample{The example shows how `push_back()` can be used to add + elements to a JSON array. Note how the `null` value was silently converted + to a JSON array.,emplace_back} + + @since version 2.0.8, returns reference since 3.7.0 + */ + template<class... Args> + reference emplace_back(Args&& ... args) + { + // emplace_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_array()))) + { + JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array (perfect forwarding) +#ifdef JSON_HAS_CPP_17 + return m_value.array->emplace_back(std::forward<Args>(args)...); +#else + m_value.array->emplace_back(std::forward<Args>(args)...); + return m_value.array->back(); +#endif + } + + /*! + @brief add an object to an object if key does not exist + + Inserts a new element into a JSON object constructed in-place with the + given @a args if there is no element with the key in the container. If the + function is called on a JSON null value, an empty object is created before + appending the value created from @a args. + + @param[in] args arguments to forward to a constructor of @ref basic_json + @tparam Args compatible types to create a @ref basic_json object + + @return a pair consisting of an iterator to the inserted element, or the + already-existing element if no insertion happened, and a bool + denoting whether the insertion took place. + + @throw type_error.311 when called on a type other than JSON object or + null; example: `"cannot use emplace() with number"` + + @complexity Logarithmic in the size of the container, O(log(`size()`)). + + @liveexample{The example shows how `emplace()` can be used to add elements + to a JSON object. Note how the `null` value was silently converted to a + JSON object. Further note how no value is added if there was already one + value stored with the same key.,emplace} + + @since version 2.0.8 + */ + template<class... Args> + std::pair<iterator, bool> emplace(Args&& ... args) + { + // emplace only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(not(is_null() or is_object()))) + { + JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); + } + + // transform null object into an object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // add element to array (perfect forwarding) + auto res = m_value.object->emplace(std::forward<Args>(args)...); + // create result iterator and set iterator to the result of emplace + auto it = begin(); + it.m_it.object_iterator = res.first; + + // return pair of iterator and boolean + return {it, res.second}; + } + + /// Helper for insertion of an iterator + /// @note: This uses std::distance to support GCC 4.8, + /// see https://github.com/nlohmann/json/pull/1257 + template<typename... Args> + iterator insert_iterator(const_iterator pos, Args&& ... args) + { + iterator result(this); + assert(m_value.array != nullptr); + + auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); + m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...); + result.m_it.array_iterator = m_value.array->begin() + insert_pos; + + // This could have been written as: + // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val); + // but the return value of insert is missing in GCC 4.8, so it is written this way instead. + + return result; + } + + /*! + @brief inserts element + + Inserts element @a val before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] val element to insert + @return iterator pointing to the inserted @a val. + + @throw type_error.309 if called on JSON values other than arrays; + example: `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @complexity Constant plus linear in the distance between @a pos and end of + the container. + + @liveexample{The example shows how `insert()` is used.,insert} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, const basic_json& val) + { + // insert only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, val); + } + + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + /*! + @brief inserts element + @copydoc insert(const_iterator, const basic_json&) + */ + iterator insert(const_iterator pos, basic_json&& val) + { + return insert(pos, val); + } + + /*! + @brief inserts elements + + Inserts @a cnt copies of @a val before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] cnt number of copies of @a val to insert + @param[in] val element to insert + @return iterator pointing to the first element inserted, or @a pos if + `cnt==0` + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @complexity Linear in @a cnt plus linear in the distance between @a pos + and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__count} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, size_type cnt, const basic_json& val) + { + // insert only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, cnt, val); + } + + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + /*! + @brief inserts elements + + Inserts elements from range `[first, last)` before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + @throw invalid_iterator.211 if @a first or @a last are iterators into + container for which insert is called; example: `"passed iterators may not + belong to container"` + + @return iterator pointing to the first element inserted, or @a pos if + `first==last` + + @complexity Linear in `std::distance(first, last)` plus linear in the + distance between @a pos and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__range} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, const_iterator first, const_iterator last) + { + // insert only works for arrays + if (JSON_HEDLEY_UNLIKELY(not is_array())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + if (JSON_HEDLEY_UNLIKELY(first.m_object == this)) + { + JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); + } + + // insert to array and return iterator + return insert_iterator(pos, first.m_it.array_iterator, last.m_it.array_iterator); + } + + /*! + @brief inserts elements + + Inserts elements from initializer list @a ilist before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] ilist initializer list to insert the values from + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @return iterator pointing to the first element inserted, or @a pos if + `ilist` is empty + + @complexity Linear in `ilist.size()` plus linear in the distance between + @a pos and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__ilist} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, initializer_list_t ilist) + { + // insert only works for arrays + if (JSON_HEDLEY_UNLIKELY(not is_array())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, ilist.begin(), ilist.end()); + } + + /*! + @brief inserts elements + + Inserts elements from range `[first, last)`. + + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.309 if called on JSON values other than objects; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if iterator @a first or @a last does does not + point to an object; example: `"iterators first and last must point to + objects"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + + @complexity Logarithmic: `O(N*log(size() + N))`, where `N` is the number + of elements to insert. + + @liveexample{The example shows how `insert()` is used.,insert__range_object} + + @since version 3.0.0 + */ + void insert(const_iterator first, const_iterator last) + { + // insert only works for objects + if (JSON_HEDLEY_UNLIKELY(not is_object())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + // passed iterators must belong to objects + if (JSON_HEDLEY_UNLIKELY(not first.m_object->is_object())) + { + JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); + } + + m_value.object->insert(first.m_it.object_iterator, last.m_it.object_iterator); + } + + /*! + @brief updates a JSON object from another object, overwriting existing keys + + Inserts all values from JSON object @a j and overwrites existing keys. + + @param[in] j JSON object to read values from + + @throw type_error.312 if called on JSON values other than objects; example: + `"cannot use update() with string"` + + @complexity O(N*log(size() + N)), where N is the number of elements to + insert. + + @liveexample{The example shows how `update()` is used.,update} + + @sa https://docs.python.org/3.6/library/stdtypes.html#dict.update + + @since version 3.0.0 + */ + void update(const_reference j) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create<object_t>(); + assert_invariant(); + } + + if (JSON_HEDLEY_UNLIKELY(not is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); + } + if (JSON_HEDLEY_UNLIKELY(not j.is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); + } + + for (auto it = j.cbegin(); it != j.cend(); ++it) + { + m_value.object->operator[](it.key()) = it.value(); + } + } + + /*! + @brief updates a JSON object from another object, overwriting existing keys + + Inserts all values from from range `[first, last)` and overwrites existing + keys. + + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.312 if called on JSON values other than objects; example: + `"cannot use update() with string"` + @throw invalid_iterator.202 if iterator @a first or @a last does does not + point to an object; example: `"iterators first and last must point to + objects"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + + @complexity O(N*log(size() + N)), where N is the number of elements to + insert. + + @liveexample{The example shows how `update()` is used__range.,update} + + @sa https://docs.python.org/3.6/library/stdtypes.html#dict.update + + @since version 3.0.0 + */ + void update(const_iterator first, const_iterator last) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create<object_t>(); + assert_invariant(); + } + + if (JSON_HEDLEY_UNLIKELY(not is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + // passed iterators must belong to objects + if (JSON_HEDLEY_UNLIKELY(not first.m_object->is_object() + or not last.m_object->is_object())) + { + JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); + } + + for (auto it = first; it != last; ++it) + { + m_value.object->operator[](it.key()) = it.value(); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of the JSON value with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other JSON value to exchange the contents with + + @complexity Constant. + + @liveexample{The example below shows how JSON values can be swapped with + `swap()`.,swap__reference} + + @since version 1.0.0 + */ + void swap(reference other) noexcept ( + std::is_nothrow_move_constructible<value_t>::value and + std::is_nothrow_move_assignable<value_t>::value and + std::is_nothrow_move_constructible<json_value>::value and + std::is_nothrow_move_assignable<json_value>::value + ) + { + std::swap(m_type, other.m_type); + std::swap(m_value, other.m_value); + assert_invariant(); + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON array with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other array to exchange the contents with + + @throw type_error.310 when JSON value is not an array; example: `"cannot + use swap() with string"` + + @complexity Constant. + + @liveexample{The example below shows how arrays can be swapped with + `swap()`.,swap__array_t} + + @since version 1.0.0 + */ + void swap(array_t& other) + { + // swap only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + std::swap(*(m_value.array), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON object with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other object to exchange the contents with + + @throw type_error.310 when JSON value is not an object; example: + `"cannot use swap() with string"` + + @complexity Constant. + + @liveexample{The example below shows how objects can be swapped with + `swap()`.,swap__object_t} + + @since version 1.0.0 + */ + void swap(object_t& other) + { + // swap only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + std::swap(*(m_value.object), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON string with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other string to exchange the contents with + + @throw type_error.310 when JSON value is not a string; example: `"cannot + use swap() with boolean"` + + @complexity Constant. + + @liveexample{The example below shows how strings can be swapped with + `swap()`.,swap__string_t} + + @since version 1.0.0 + */ + void swap(string_t& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_string())) + { + std::swap(*(m_value.string), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /// @} + + public: + ////////////////////////////////////////// + // lexicographical comparison operators // + ////////////////////////////////////////// + + /// @name lexicographical comparison operators + /// @{ + + /*! + @brief comparison: equal + + Compares two JSON values for equality according to the following rules: + - Two JSON values are equal if (1) they are from the same type and (2) + their stored values are the same according to their respective + `operator==`. + - Integer and floating-point numbers are automatically converted before + comparison. Note that two NaN values are always treated as unequal. + - Two JSON null values are equal. + + @note Floating-point inside JSON values numbers are compared with + `json::number_float_t::operator==` which is `double::operator==` by + default. To compare floating-point while respecting an epsilon, an alternative + [comparison function](https://github.com/mariokonrad/marnav/blob/master/include/marnav/math/floatingpoint.hpp#L34-#L39) + could be used, for instance + @code {.cpp} + template<typename T, typename = typename std::enable_if<std::is_floating_point<T>::value, T>::type> + inline bool is_same(T a, T b, T epsilon = std::numeric_limits<T>::epsilon()) noexcept + { + return std::abs(a - b) <= epsilon; + } + @endcode + Or you can self-defined operator equal function like this: + @code {.cpp} + bool my_equal(const_reference lhs, const_reference rhs) { + const auto lhs_type lhs.type(); + const auto rhs_type rhs.type(); + if (lhs_type == rhs_type) { + switch(lhs_type) + // self_defined case + case value_t::number_float: + return std::abs(lhs - rhs) <= std::numeric_limits<float>::epsilon(); + // other cases remain the same with the original + ... + } + ... + } + @endcode + + @note NaN values never compare equal to themselves or to other NaN values. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether the values @a lhs and @a rhs are equal + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @complexity Linear. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__equal} + + @since version 1.0.0 + */ + friend bool operator==(const_reference lhs, const_reference rhs) noexcept + { + const auto lhs_type = lhs.type(); + const auto rhs_type = rhs.type(); + + if (lhs_type == rhs_type) + { + switch (lhs_type) + { + case value_t::array: + return *lhs.m_value.array == *rhs.m_value.array; + + case value_t::object: + return *lhs.m_value.object == *rhs.m_value.object; + + case value_t::null: + return true; + + case value_t::string: + return *lhs.m_value.string == *rhs.m_value.string; + + case value_t::boolean: + return lhs.m_value.boolean == rhs.m_value.boolean; + + case value_t::number_integer: + return lhs.m_value.number_integer == rhs.m_value.number_integer; + + case value_t::number_unsigned: + return lhs.m_value.number_unsigned == rhs.m_value.number_unsigned; + + case value_t::number_float: + return lhs.m_value.number_float == rhs.m_value.number_float; + + case value_t::binary: + return *lhs.m_value.binary == *rhs.m_value.binary; + + default: + return false; + } + } + else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_float) + { + return static_cast<number_float_t>(lhs.m_value.number_integer) == rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float and rhs_type == value_t::number_integer) + { + return lhs.m_value.number_float == static_cast<number_float_t>(rhs.m_value.number_integer); + } + else if (lhs_type == value_t::number_unsigned and rhs_type == value_t::number_float) + { + return static_cast<number_float_t>(lhs.m_value.number_unsigned) == rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float and rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_float == static_cast<number_float_t>(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_unsigned and rhs_type == value_t::number_integer) + { + return static_cast<number_integer_t>(lhs.m_value.number_unsigned) == rhs.m_value.number_integer; + } + else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_integer == static_cast<number_integer_t>(rhs.m_value.number_unsigned); + } + + return false; + } + + /*! + @brief comparison: equal + @copydoc operator==(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs == basic_json(rhs); + } + + /*! + @brief comparison: equal + @copydoc operator==(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) == rhs; + } + + /*! + @brief comparison: not equal + + Compares two JSON values for inequality by calculating `not (lhs == rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether the values @a lhs and @a rhs are not equal + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__notequal} + + @since version 1.0.0 + */ + friend bool operator!=(const_reference lhs, const_reference rhs) noexcept + { + return not (lhs == rhs); + } + + /*! + @brief comparison: not equal + @copydoc operator!=(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator!=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs != basic_json(rhs); + } + + /*! + @brief comparison: not equal + @copydoc operator!=(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator!=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) != rhs; + } + + /*! + @brief comparison: less than + + Compares whether one JSON value @a lhs is less than another JSON value @a + rhs according to the following rules: + - If @a lhs and @a rhs have the same type, the values are compared using + the default `<` operator. + - Integer and floating-point numbers are automatically converted before + comparison + - In case @a lhs and @a rhs have different types, the values are ignored + and the order of the types is considered, see + @ref operator<(const value_t, const value_t). + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is less than @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__less} + + @since version 1.0.0 + */ + friend bool operator<(const_reference lhs, const_reference rhs) noexcept + { + const auto lhs_type = lhs.type(); + const auto rhs_type = rhs.type(); + + if (lhs_type == rhs_type) + { + switch (lhs_type) + { + case value_t::array: + // note parentheses are necessary, see + // https://github.com/nlohmann/json/issues/1530 + return (*lhs.m_value.array) < (*rhs.m_value.array); + + case value_t::object: + return (*lhs.m_value.object) < (*rhs.m_value.object); + + case value_t::null: + return false; + + case value_t::string: + return (*lhs.m_value.string) < (*rhs.m_value.string); + + case value_t::boolean: + return (lhs.m_value.boolean) < (rhs.m_value.boolean); + + case value_t::number_integer: + return (lhs.m_value.number_integer) < (rhs.m_value.number_integer); + + case value_t::number_unsigned: + return (lhs.m_value.number_unsigned) < (rhs.m_value.number_unsigned); + + case value_t::number_float: + return (lhs.m_value.number_float) < (rhs.m_value.number_float); + + case value_t::binary: + return (lhs.m_value.binary) < (rhs.m_value.binary); + + default: + return false; + } + } + else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_float) + { + return static_cast<number_float_t>(lhs.m_value.number_integer) < rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float and rhs_type == value_t::number_integer) + { + return lhs.m_value.number_float < static_cast<number_float_t>(rhs.m_value.number_integer); + } + else if (lhs_type == value_t::number_unsigned and rhs_type == value_t::number_float) + { + return static_cast<number_float_t>(lhs.m_value.number_unsigned) < rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float and rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_float < static_cast<number_float_t>(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_integer < static_cast<number_integer_t>(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_unsigned and rhs_type == value_t::number_integer) + { + return static_cast<number_integer_t>(lhs.m_value.number_unsigned) < rhs.m_value.number_integer; + } + + // We only reach this line if we cannot compare values. In that case, + // we compare types. Note we have to call the operator explicitly, + // because MSVC has problems otherwise. + return operator<(lhs_type, rhs_type); + } + + /*! + @brief comparison: less than + @copydoc operator<(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator<(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs < basic_json(rhs); + } + + /*! + @brief comparison: less than + @copydoc operator<(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator<(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) < rhs; + } + + /*! + @brief comparison: less than or equal + + Compares whether one JSON value @a lhs is less than or equal to another + JSON value by calculating `not (rhs < lhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is less than or equal to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__greater} + + @since version 1.0.0 + */ + friend bool operator<=(const_reference lhs, const_reference rhs) noexcept + { + return not (rhs < lhs); + } + + /*! + @brief comparison: less than or equal + @copydoc operator<=(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator<=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs <= basic_json(rhs); + } + + /*! + @brief comparison: less than or equal + @copydoc operator<=(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator<=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) <= rhs; + } + + /*! + @brief comparison: greater than + + Compares whether one JSON value @a lhs is greater than another + JSON value by calculating `not (lhs <= rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is greater than to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__lessequal} + + @since version 1.0.0 + */ + friend bool operator>(const_reference lhs, const_reference rhs) noexcept + { + return not (lhs <= rhs); + } + + /*! + @brief comparison: greater than + @copydoc operator>(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator>(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs > basic_json(rhs); + } + + /*! + @brief comparison: greater than + @copydoc operator>(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator>(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) > rhs; + } + + /*! + @brief comparison: greater than or equal + + Compares whether one JSON value @a lhs is greater than or equal to another + JSON value by calculating `not (lhs < rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is greater than or equal to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__greaterequal} + + @since version 1.0.0 + */ + friend bool operator>=(const_reference lhs, const_reference rhs) noexcept + { + return not (lhs < rhs); + } + + /*! + @brief comparison: greater than or equal + @copydoc operator>=(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator>=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs >= basic_json(rhs); + } + + /*! + @brief comparison: greater than or equal + @copydoc operator>=(const_reference, const_reference) + */ + template<typename ScalarType, typename std::enable_if< + std::is_scalar<ScalarType>::value, int>::type = 0> + friend bool operator>=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) >= rhs; + } + + /// @} + + /////////////////// + // serialization // + /////////////////// + + /// @name serialization + /// @{ + + /*! + @brief serialize to stream + + Serialize the given JSON value @a j to the output stream @a o. The JSON + value will be serialized using the @ref dump member function. + + - The indentation of the output can be controlled with the member variable + `width` of the output stream @a o. For instance, using the manipulator + `std::setw(4)` on @a o sets the indentation level to `4` and the + serialization result is the same as calling `dump(4)`. + + - The indentation character can be controlled with the member variable + `fill` of the output stream @a o. For instance, the manipulator + `std::setfill('\\t')` sets indentation to use a tab character rather than + the default space character. + + @param[in,out] o stream to serialize to + @param[in] j JSON value to serialize + + @return the stream @a o + + @throw type_error.316 if a string stored inside the JSON value is not + UTF-8 encoded + + @complexity Linear. + + @liveexample{The example below shows the serialization with different + parameters to `width` to adjust the indentation level.,operator_serialize} + + @since version 1.0.0; indentation character added in version 3.0.0 + */ + friend std::ostream& operator<<(std::ostream& o, const basic_json& j) + { + // read width member and use it as indentation parameter if nonzero + const bool pretty_print = o.width() > 0; + const auto indentation = pretty_print ? o.width() : 0; + + // reset width to 0 for subsequent calls to this stream + o.width(0); + + // do the actual serialization + serializer s(detail::output_adapter<char>(o), o.fill()); + s.dump(j, pretty_print, false, static_cast<unsigned int>(indentation)); + return o; + } + + /*! + @brief serialize to stream + @deprecated This stream operator is deprecated and will be removed in + future 4.0.0 of the library. Please use + @ref operator<<(std::ostream&, const basic_json&) + instead; that is, replace calls like `j >> o;` with `o << j;`. + @since version 1.0.0; deprecated since version 3.0.0 + */ + JSON_HEDLEY_DEPRECATED(3.0.0) + friend std::ostream& operator>>(const basic_json& j, std::ostream& o) + { + return o << j; + } + + /// @} + + + ///////////////////// + // deserialization // + ///////////////////// + + /// @name deserialization + /// @{ + + /*! + @brief deserialize from a compatible input + + This function reads from a compatible input. Examples are: + - an array of 1-byte values + - strings with character/literal type with size of 1 byte + - input streams + - container with contiguous storage of 1-byte values. Compatible container + types include `std::vector`, `std::string`, `std::array`, + `std::valarray`, and `std::initializer_list`. Furthermore, C-style + arrays can be used with `std::begin()`/`std::end()`. User-defined + containers can be used as long as they implement random-access iterators + and a contiguous storage. + + @pre Each element of the container has a size of 1 byte. Violating this + precondition yields undefined behavior. **This precondition is enforced + with a static assertion.** + + @pre The container storage is contiguous. Violating this precondition + yields undefined behavior. **This precondition is enforced with an + assertion.** + + @warning There is no way to enforce all preconditions at compile-time. If + the function is called with a noncompliant container and with + assertions switched off, the behavior is undefined and will most + likely yield segmentation violation. + + @param[in] i input to read from + @param[in] cb a parser callback function of type @ref parser_callback_t + which is used to control the deserialization by filtering unwanted values + (optional) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the parser callback function + @a cb has a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `parse()` function reading + from an array.,parse__array__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function with + and without callback function.,parse__string__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function with + and without callback function.,parse__istream__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function reading + from a contiguous container.,parse__contiguouscontainer__parser_callback_t} + + @since version 2.0.3 (contiguous containers) + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json parse(detail::input_adapter&& i, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true) + { + basic_json result; + parser(i, cb, allow_exceptions).parse(true, result); + return result; + } + + static bool accept(detail::input_adapter&& i) + { + return parser(i).accept(true); + } + + /*! + @brief generate SAX events + + The SAX event lister must follow the interface of @ref json_sax. + + This function reads from a compatible input. Examples are: + - an array of 1-byte values + - strings with character/literal type with size of 1 byte + - input streams + - container with contiguous storage of 1-byte values. Compatible container + types include `std::vector`, `std::string`, `std::array`, + `std::valarray`, and `std::initializer_list`. Furthermore, C-style + arrays can be used with `std::begin()`/`std::end()`. User-defined + containers can be used as long as they implement random-access iterators + and a contiguous storage. + + @pre Each element of the container has a size of 1 byte. Violating this + precondition yields undefined behavior. **This precondition is enforced + with a static assertion.** + + @pre The container storage is contiguous. Violating this precondition + yields undefined behavior. **This precondition is enforced with an + assertion.** + + @warning There is no way to enforce all preconditions at compile-time. If + the function is called with a noncompliant container and with + assertions switched off, the behavior is undefined and will most + likely yield segmentation violation. + + @param[in] i input to read from + @param[in,out] sax SAX event listener + @param[in] format the format to parse (JSON, CBOR, MessagePack, or UBJSON) + @param[in] strict whether the input has to be consumed completely + + @return return value of the last processed SAX event + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the SAX consumer @a sax has + a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `sax_parse()` function + reading from string and processing the events with a user-defined SAX + event consumer.,sax_parse} + + @since version 3.2.0 + */ + template <typename SAX> + JSON_HEDLEY_NON_NULL(2) + static bool sax_parse(detail::input_adapter&& i, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true) + { + return format == input_format_t::json + ? parser(std::move(i)).sax_parse(sax, strict) + : detail::binary_reader<basic_json, SAX>(std::move(i)).sax_parse(format, sax, strict); + } + + /*! + @brief deserialize from an iterator range with contiguous storage + + This function reads from an iterator range of a container with contiguous + storage of 1-byte values. Compatible container types include + `std::vector`, `std::string`, `std::array`, `std::valarray`, and + `std::initializer_list`. Furthermore, C-style arrays can be used with + `std::begin()`/`std::end()`. User-defined containers can be used as long + as they implement random-access iterators and a contiguous storage. + + @pre The iterator range is contiguous. Violating this precondition yields + undefined behavior. **This precondition is enforced with an assertion.** + @pre Each element in the range has a size of 1 byte. Violating this + precondition yields undefined behavior. **This precondition is enforced + with a static assertion.** + + @warning There is no way to enforce all preconditions at compile-time. If + the function is called with noncompliant iterators and with + assertions switched off, the behavior is undefined and will most + likely yield segmentation violation. + + @tparam IteratorType iterator of container with contiguous storage + @param[in] first begin of the range to parse (included) + @param[in] last end of the range to parse (excluded) + @param[in] cb a parser callback function of type @ref parser_callback_t + which is used to control the deserialization by filtering unwanted values + (optional) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the parser callback function + @a cb has a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `parse()` function reading + from an iterator range.,parse__iteratortype__parser_callback_t} + + @since version 2.0.3 + */ + template<class IteratorType, typename std::enable_if< + std::is_base_of< + std::random_access_iterator_tag, + typename std::iterator_traits<IteratorType>::iterator_category>::value, int>::type = 0> + static basic_json parse(IteratorType first, IteratorType last, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true) + { + basic_json result; + parser(detail::input_adapter(first, last), cb, allow_exceptions).parse(true, result); + return result; + } + + template<class IteratorType, typename std::enable_if< + std::is_base_of< + std::random_access_iterator_tag, + typename std::iterator_traits<IteratorType>::iterator_category>::value, int>::type = 0> + static bool accept(IteratorType first, IteratorType last) + { + return parser(detail::input_adapter(first, last)).accept(true); + } + + template<class IteratorType, class SAX, typename std::enable_if< + std::is_base_of< + std::random_access_iterator_tag, + typename std::iterator_traits<IteratorType>::iterator_category>::value, int>::type = 0> + JSON_HEDLEY_NON_NULL(3) + static bool sax_parse(IteratorType first, IteratorType last, SAX* sax) + { + return parser(detail::input_adapter(first, last)).sax_parse(sax); + } + + /*! + @brief deserialize from stream + @deprecated This stream operator is deprecated and will be removed in + version 4.0.0 of the library. Please use + @ref operator>>(std::istream&, basic_json&) + instead; that is, replace calls like `j << i;` with `i >> j;`. + @since version 1.0.0; deprecated since version 3.0.0 + */ + JSON_HEDLEY_DEPRECATED(3.0.0) + friend std::istream& operator<<(basic_json& j, std::istream& i) + { + return operator>>(i, j); + } + + /*! + @brief deserialize from stream + + Deserializes an input stream to a JSON value. + + @param[in,out] i input stream to read a serialized JSON value from + @param[in,out] j JSON value to write the deserialized input to + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below shows how a JSON value is constructed by + reading a serialization from a stream.,operator_deserialize} + + @sa parse(std::istream&, const parser_callback_t) for a variant with a + parser callback function to filter values while parsing + + @since version 1.0.0 + */ + friend std::istream& operator>>(std::istream& i, basic_json& j) + { + parser(detail::input_adapter(i)).parse(false, j); + return i; + } + + /// @} + + /////////////////////////// + // convenience functions // + /////////////////////////// + + /*! + @brief return the type as string + + Returns the type name as string to be used in error messages - usually to + indicate that a function was called on a wrong JSON type. + + @return a string representation of a the @a m_type member: + Value type | return value + ----------- | ------------- + null | `"null"` + boolean | `"boolean"` + string | `"string"` + number | `"number"` (for all number types) + object | `"object"` + array | `"array"` + binary | `"binary"` + discarded | `"discarded"` + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @complexity Constant. + + @liveexample{The following code exemplifies `type_name()` for all JSON + types.,type_name} + + @sa @ref type() -- return the type of the JSON value + @sa @ref operator value_t() -- return the type of the JSON value (implicit) + + @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` + since 3.0.0 + */ + JSON_HEDLEY_RETURNS_NON_NULL + const char* type_name() const noexcept + { + { + switch (m_type) + { + case value_t::null: + return "null"; + case value_t::object: + return "object"; + case value_t::array: + return "array"; + case value_t::string: + return "string"; + case value_t::boolean: + return "boolean"; + case value_t::binary: + return "binary"; + case value_t::discarded: + return "discarded"; + default: + return "number"; + } + } + } + + + private: + ////////////////////// + // member variables // + ////////////////////// + + /// the type of the current element + value_t m_type = value_t::null; + + /// the value of the current element + json_value m_value = {}; + + ////////////////////////////////////////// + // binary serialization/deserialization // + ////////////////////////////////////////// + + /// @name binary serialization/deserialization support + /// @{ + + public: + /*! + @brief create a CBOR serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the CBOR (Concise + Binary Object Representation) serialization format. CBOR is a binary + serialization format which aims to be more compact than JSON itself, yet + more efficient to parse. + + The library uses the following mapping from JSON values types to + CBOR types according to the CBOR specification (RFC 7049): + + JSON value type | value/range | CBOR type | first byte + --------------- | ------------------------------------------ | ---------------------------------- | --------------- + null | `null` | Null | 0xF6 + boolean | `true` | True | 0xF5 + boolean | `false` | False | 0xF4 + number_integer | -9223372036854775808..-2147483649 | Negative integer (8 bytes follow) | 0x3B + number_integer | -2147483648..-32769 | Negative integer (4 bytes follow) | 0x3A + number_integer | -32768..-129 | Negative integer (2 bytes follow) | 0x39 + number_integer | -128..-25 | Negative integer (1 byte follow) | 0x38 + number_integer | -24..-1 | Negative integer | 0x20..0x37 + number_integer | 0..23 | Integer | 0x00..0x17 + number_integer | 24..255 | Unsigned integer (1 byte follow) | 0x18 + number_integer | 256..65535 | Unsigned integer (2 bytes follow) | 0x19 + number_integer | 65536..4294967295 | Unsigned integer (4 bytes follow) | 0x1A + number_integer | 4294967296..18446744073709551615 | Unsigned integer (8 bytes follow) | 0x1B + number_unsigned | 0..23 | Integer | 0x00..0x17 + number_unsigned | 24..255 | Unsigned integer (1 byte follow) | 0x18 + number_unsigned | 256..65535 | Unsigned integer (2 bytes follow) | 0x19 + number_unsigned | 65536..4294967295 | Unsigned integer (4 bytes follow) | 0x1A + number_unsigned | 4294967296..18446744073709551615 | Unsigned integer (8 bytes follow) | 0x1B + number_float | *any value* | Double-Precision Float | 0xFB + string | *length*: 0..23 | UTF-8 string | 0x60..0x77 + string | *length*: 23..255 | UTF-8 string (1 byte follow) | 0x78 + string | *length*: 256..65535 | UTF-8 string (2 bytes follow) | 0x79 + string | *length*: 65536..4294967295 | UTF-8 string (4 bytes follow) | 0x7A + string | *length*: 4294967296..18446744073709551615 | UTF-8 string (8 bytes follow) | 0x7B + array | *size*: 0..23 | array | 0x80..0x97 + array | *size*: 23..255 | array (1 byte follow) | 0x98 + array | *size*: 256..65535 | array (2 bytes follow) | 0x99 + array | *size*: 65536..4294967295 | array (4 bytes follow) | 0x9A + array | *size*: 4294967296..18446744073709551615 | array (8 bytes follow) | 0x9B + object | *size*: 0..23 | map | 0xA0..0xB7 + object | *size*: 23..255 | map (1 byte follow) | 0xB8 + object | *size*: 256..65535 | map (2 bytes follow) | 0xB9 + object | *size*: 65536..4294967295 | map (4 bytes follow) | 0xBA + object | *size*: 4294967296..18446744073709551615 | map (8 bytes follow) | 0xBB + binary | *size*: 0..23 | byte string | 0x40..0x57 + binary | *size*: 23..255 | byte string (1 byte follow) | 0x58 + binary | *size*: 256..65535 | byte string (2 bytes follow) | 0x59 + binary | *size*: 65536..4294967295 | byte string (4 bytes follow) | 0x5A + binary | *size*: 4294967296..18446744073709551615 | byte string (8 bytes follow) | 0x5B + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a CBOR value. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @note The following CBOR types are not used in the conversion: + - UTF-8 strings terminated by "break" (0x7F) + - arrays terminated by "break" (0x9F) + - maps terminated by "break" (0xBF) + - byte strings terminated by "break" (0x5F) + - date/time (0xC0..0xC1) + - bignum (0xC2..0xC3) + - decimal fraction (0xC4) + - bigfloat (0xC5) + - tagged items (0xC6..0xD4, 0xD8..0xDB) + - expected conversions (0xD5..0xD7) + - simple values (0xE0..0xF3, 0xF8) + - undefined (0xF7) + - half and single-precision floats (0xF9-0xFA) + - break (0xFF) + + @param[in] j JSON value to serialize + @return MessagePack serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in CBOR format.,to_cbor} + + @sa http://cbor.io + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool) for the + analogous deserialization + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9 + */ + static std::vector<uint8_t> to_cbor(const basic_json& j) + { + std::vector<uint8_t> result; + to_cbor(j, result); + return result; + } + + static void to_cbor(const basic_json& j, detail::output_adapter<uint8_t> o) + { + binary_writer<uint8_t>(o).write_cbor(j); + } + + static void to_cbor(const basic_json& j, detail::output_adapter<char> o) + { + binary_writer<char>(o).write_cbor(j); + } + + /*! + @brief create a MessagePack serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the MessagePack + serialization format. MessagePack is a binary serialization format which + aims to be more compact than JSON itself, yet more efficient to parse. + + The library uses the following mapping from JSON values types to + MessagePack types according to the MessagePack specification: + + JSON value type | value/range | MessagePack type | first byte + --------------- | --------------------------------- | ---------------- | ---------- + null | `null` | nil | 0xC0 + boolean | `true` | true | 0xC3 + boolean | `false` | false | 0xC2 + number_integer | -9223372036854775808..-2147483649 | int64 | 0xD3 + number_integer | -2147483648..-32769 | int32 | 0xD2 + number_integer | -32768..-129 | int16 | 0xD1 + number_integer | -128..-33 | int8 | 0xD0 + number_integer | -32..-1 | negative fixint | 0xE0..0xFF + number_integer | 0..127 | positive fixint | 0x00..0x7F + number_integer | 128..255 | uint 8 | 0xCC + number_integer | 256..65535 | uint 16 | 0xCD + number_integer | 65536..4294967295 | uint 32 | 0xCE + number_integer | 4294967296..18446744073709551615 | uint 64 | 0xCF + number_unsigned | 0..127 | positive fixint | 0x00..0x7F + number_unsigned | 128..255 | uint 8 | 0xCC + number_unsigned | 256..65535 | uint 16 | 0xCD + number_unsigned | 65536..4294967295 | uint 32 | 0xCE + number_unsigned | 4294967296..18446744073709551615 | uint 64 | 0xCF + number_float | *any value* | float 64 | 0xCB + string | *length*: 0..31 | fixstr | 0xA0..0xBF + string | *length*: 32..255 | str 8 | 0xD9 + string | *length*: 256..65535 | str 16 | 0xDA + string | *length*: 65536..4294967295 | str 32 | 0xDB + array | *size*: 0..15 | fixarray | 0x90..0x9F + array | *size*: 16..65535 | array 16 | 0xDC + array | *size*: 65536..4294967295 | array 32 | 0xDD + object | *size*: 0..15 | fix map | 0x80..0x8F + object | *size*: 16..65535 | map 16 | 0xDE + object | *size*: 65536..4294967295 | map 32 | 0xDF + binary | *size*: 0..255 | bin 8 | 0xC4 + binary | *size*: 256..65535 | bin 16 | 0xC5 + binary | *size*: 65536..4294967295 | bin 32 | 0xC6 + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a MessagePack value. + + @note The following values can **not** be converted to a MessagePack value: + - strings with more than 4294967295 bytes + - byte strings with more than 4294967295 bytes + - arrays with more than 4294967295 elements + - objects with more than 4294967295 elements + + @note The following MessagePack types are not used in the conversion: + - float 32 (0xCA) + + @note Any MessagePack output created @ref to_msgpack can be successfully + parsed by @ref from_msgpack. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @param[in] j JSON value to serialize + @return MessagePack serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in MessagePack format.,to_msgpack} + + @sa http://msgpack.org + @sa @ref from_msgpack for the analogous deserialization + @sa @ref to_cbor(const basic_json& for the related CBOR format + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9 + */ + static std::vector<uint8_t> to_msgpack(const basic_json& j) + { + std::vector<uint8_t> result; + to_msgpack(j, result); + return result; + } + + static void to_msgpack(const basic_json& j, detail::output_adapter<uint8_t> o) + { + binary_writer<uint8_t>(o).write_msgpack(j); + } + + static void to_msgpack(const basic_json& j, detail::output_adapter<char> o) + { + binary_writer<char>(o).write_msgpack(j); + } + + /*! + @brief create a UBJSON serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the UBJSON + (Universal Binary JSON) serialization format. UBJSON aims to be more compact + than JSON itself, yet more efficient to parse. + + The library uses the following mapping from JSON values types to + UBJSON types according to the UBJSON specification: + + JSON value type | value/range | UBJSON type | marker + --------------- | --------------------------------- | ----------- | ------ + null | `null` | null | `Z` + boolean | `true` | true | `T` + boolean | `false` | false | `F` + number_integer | -9223372036854775808..-2147483649 | int64 | `L` + number_integer | -2147483648..-32769 | int32 | `l` + number_integer | -32768..-129 | int16 | `I` + number_integer | -128..127 | int8 | `i` + number_integer | 128..255 | uint8 | `U` + number_integer | 256..32767 | int16 | `I` + number_integer | 32768..2147483647 | int32 | `l` + number_integer | 2147483648..9223372036854775807 | int64 | `L` + number_unsigned | 0..127 | int8 | `i` + number_unsigned | 128..255 | uint8 | `U` + number_unsigned | 256..32767 | int16 | `I` + number_unsigned | 32768..2147483647 | int32 | `l` + number_unsigned | 2147483648..9223372036854775807 | int64 | `L` + number_float | *any value* | float64 | `D` + string | *with shortest length indicator* | string | `S` + array | *see notes on optimized format* | array | `[` + object | *see notes on optimized format* | map | `{` + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a UBJSON value. + + @note The following values can **not** be converted to a UBJSON value: + - strings with more than 9223372036854775807 bytes (theoretical) + - unsigned integer numbers above 9223372036854775807 + + @note The following markers are not used in the conversion: + - `Z`: no-op values are not created. + - `C`: single-byte strings are serialized with `S` markers. + + @note Any UBJSON output created @ref to_ubjson can be successfully parsed + by @ref from_ubjson. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @note The optimized formats for containers are supported: Parameter + @a use_size adds size information to the beginning of a container and + removes the closing marker. Parameter @a use_type further checks + whether all elements of a container have the same type and adds the + type marker to the beginning of the container. The @a use_type + parameter must only be used together with @a use_size = true. Note + that @a use_size = true alone may result in larger representations - + the benefit of this parameter is that the receiving side is + immediately informed on the number of elements of the container. + + @note If the JSON data contains the binary type, the value stored is a list + of integers, as suggested by the UBJSON documentation. In particular, + this means that serialization and the deserialization of a JSON + containing binary values into UBJSON and back will result in a + different JSON object. + + @param[in] j JSON value to serialize + @param[in] use_size whether to add size annotations to container types + @param[in] use_type whether to add type annotations to container types + (must be combined with @a use_size = true) + @return UBJSON serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in UBJSON format.,to_ubjson} + + @sa http://ubjson.org + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + analogous deserialization + @sa @ref to_cbor(const basic_json& for the related CBOR format + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + + @since version 3.1.0 + */ + static std::vector<uint8_t> to_ubjson(const basic_json& j, + const bool use_size = false, + const bool use_type = false) + { + std::vector<uint8_t> result; + to_ubjson(j, result, use_size, use_type); + return result; + } + + static void to_ubjson(const basic_json& j, detail::output_adapter<uint8_t> o, + const bool use_size = false, const bool use_type = false) + { + binary_writer<uint8_t>(o).write_ubjson(j, use_size, use_type); + } + + static void to_ubjson(const basic_json& j, detail::output_adapter<char> o, + const bool use_size = false, const bool use_type = false) + { + binary_writer<char>(o).write_ubjson(j, use_size, use_type); + } + + + /*! + @brief Serializes the given JSON object `j` to BSON and returns a vector + containing the corresponding BSON-representation. + + BSON (Binary JSON) is a binary format in which zero or more ordered key/value pairs are + stored as a single entity (a so-called document). + + The library uses the following mapping from JSON values types to BSON types: + + JSON value type | value/range | BSON type | marker + --------------- | --------------------------------- | ----------- | ------ + null | `null` | null | 0x0A + boolean | `true`, `false` | boolean | 0x08 + number_integer | -9223372036854775808..-2147483649 | int64 | 0x12 + number_integer | -2147483648..2147483647 | int32 | 0x10 + number_integer | 2147483648..9223372036854775807 | int64 | 0x12 + number_unsigned | 0..2147483647 | int32 | 0x10 + number_unsigned | 2147483648..9223372036854775807 | int64 | 0x12 + number_unsigned | 9223372036854775808..18446744073709551615| -- | -- + number_float | *any value* | double | 0x01 + string | *any value* | string | 0x02 + array | *any value* | document | 0x04 + object | *any value* | document | 0x03 + binary | *any value* | binary | 0x05 + + @warning The mapping is **incomplete**, since only JSON-objects (and things + contained therein) can be serialized to BSON. + Also, integers larger than 9223372036854775807 cannot be serialized to BSON, + and the keys may not contain U+0000, since they are serialized a + zero-terminated c-strings. + + @throw out_of_range.407 if `j.is_number_unsigned() && j.get<std::uint64_t>() > 9223372036854775807` + @throw out_of_range.409 if a key in `j` contains a NULL (U+0000) + @throw type_error.317 if `!j.is_object()` + + @pre The input `j` is required to be an object: `j.is_object() == true`. + + @note Any BSON output created via @ref to_bson can be successfully parsed + by @ref from_bson. + + @param[in] j JSON value to serialize + @return BSON serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in BSON format.,to_bson} + + @sa http://bsonspec.org/spec.html + @sa @ref from_bson(detail::input_adapter&&, const bool strict) for the + analogous deserialization + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + @sa @ref to_cbor(const basic_json&) for the related CBOR format + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + */ + static std::vector<uint8_t> to_bson(const basic_json& j) + { + std::vector<uint8_t> result; + to_bson(j, result); + return result; + } + + /*! + @brief Serializes the given JSON object `j` to BSON and forwards the + corresponding BSON-representation to the given output_adapter `o`. + @param j The JSON object to convert to BSON. + @param o The output adapter that receives the binary BSON representation. + @pre The input `j` shall be an object: `j.is_object() == true` + @sa @ref to_bson(const basic_json&) + */ + static void to_bson(const basic_json& j, detail::output_adapter<uint8_t> o) + { + binary_writer<uint8_t>(o).write_bson(j); + } + + /*! + @copydoc to_bson(const basic_json&, detail::output_adapter<uint8_t>) + */ + static void to_bson(const basic_json& j, detail::output_adapter<char> o) + { + binary_writer<char>(o).write_bson(j); + } + + + /*! + @brief create a JSON value from an input in CBOR format + + Deserializes a given input @a i to a JSON value using the CBOR (Concise + Binary Object Representation) serialization format. + + The library maps CBOR types to JSON value types as follows: + + CBOR type | JSON value type | first byte + ---------------------- | --------------- | ---------- + Integer | number_unsigned | 0x00..0x17 + Unsigned integer | number_unsigned | 0x18 + Unsigned integer | number_unsigned | 0x19 + Unsigned integer | number_unsigned | 0x1A + Unsigned integer | number_unsigned | 0x1B + Negative integer | number_integer | 0x20..0x37 + Negative integer | number_integer | 0x38 + Negative integer | number_integer | 0x39 + Negative integer | number_integer | 0x3A + Negative integer | number_integer | 0x3B + Byte string | binary | 0x40..0x57 + Byte string | binary | 0x58 + Byte string | binary | 0x59 + Byte string | binary | 0x5A + Byte string | binary | 0x5B + UTF-8 string | string | 0x60..0x77 + UTF-8 string | string | 0x78 + UTF-8 string | string | 0x79 + UTF-8 string | string | 0x7A + UTF-8 string | string | 0x7B + UTF-8 string | string | 0x7F + array | array | 0x80..0x97 + array | array | 0x98 + array | array | 0x99 + array | array | 0x9A + array | array | 0x9B + array | array | 0x9F + map | object | 0xA0..0xB7 + map | object | 0xB8 + map | object | 0xB9 + map | object | 0xBA + map | object | 0xBB + map | object | 0xBF + False | `false` | 0xF4 + True | `true` | 0xF5 + Null | `null` | 0xF6 + Half-Precision Float | number_float | 0xF9 + Single-Precision Float | number_float | 0xFA + Double-Precision Float | number_float | 0xFB + + @warning The mapping is **incomplete** in the sense that not all CBOR + types can be converted to a JSON value. The following CBOR types + are not supported and will yield parse errors (parse_error.112): + - date/time (0xC0..0xC1) + - bignum (0xC2..0xC3) + - decimal fraction (0xC4) + - bigfloat (0xC5) + - tagged items (0xC6..0xD4, 0xD8..0xDB) + - expected conversions (0xD5..0xD7) + - simple values (0xE0..0xF3, 0xF8) + - undefined (0xF7) + + @warning CBOR allows map keys of any type, whereas JSON only allows + strings as keys in object values. Therefore, CBOR maps with keys + other than UTF-8 strings are rejected (parse_error.113). + + @note Any CBOR output created @ref to_cbor can be successfully parsed by + @ref from_cbor. + + @param[in] i an input in CBOR format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if unsupported features from CBOR were + used in the given input @a v or if the input is not valid CBOR + @throw parse_error.113 if a string was expected as map key, but not found + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in CBOR + format to a JSON value.,from_cbor} + + @sa http://cbor.io + @sa @ref to_cbor(const basic_json&) for the analogous serialization + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for the + related MessagePack format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9; parameter @a start_index since 2.1.1; changed to + consume input adapters, removed start_index parameter, and added + @a strict parameter since 3.0.0; added @a allow_exceptions parameter + since 3.2.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_cbor(detail::input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(i)).sax_parse(input_format_t::cbor, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_cbor(detail::input_adapter&&, const bool, const bool) + */ + template<typename A1, typename A2, + detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0> + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_cbor(A1 && a1, A2 && a2, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(std::forward<A1>(a1), std::forward<A2>(a2))).sax_parse(input_format_t::cbor, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @brief create a JSON value from an input in MessagePack format + + Deserializes a given input @a i to a JSON value using the MessagePack + serialization format. + + The library maps MessagePack types to JSON value types as follows: + + MessagePack type | JSON value type | first byte + ---------------- | --------------- | ---------- + positive fixint | number_unsigned | 0x00..0x7F + fixmap | object | 0x80..0x8F + fixarray | array | 0x90..0x9F + fixstr | string | 0xA0..0xBF + nil | `null` | 0xC0 + false | `false` | 0xC2 + true | `true` | 0xC3 + float 32 | number_float | 0xCA + float 64 | number_float | 0xCB + uint 8 | number_unsigned | 0xCC + uint 16 | number_unsigned | 0xCD + uint 32 | number_unsigned | 0xCE + uint 64 | number_unsigned | 0xCF + int 8 | number_integer | 0xD0 + int 16 | number_integer | 0xD1 + int 32 | number_integer | 0xD2 + int 64 | number_integer | 0xD3 + str 8 | string | 0xD9 + str 16 | string | 0xDA + str 32 | string | 0xDB + array 16 | array | 0xDC + array 32 | array | 0xDD + map 16 | object | 0xDE + map 32 | object | 0xDF + bin 8 | binary | 0xC4 + bin 16 | binary | 0xC5 + bin 32 | binary | 0xC6 + ext 8 | binary | 0xC7 + ext 16 | binary | 0xC8 + ext 32 | binary | 0xC9 + fixext 1 | binary | 0xD4 + fixext 2 | binary | 0xD5 + fixext 4 | binary | 0xD6 + fixext 8 | binary | 0xD7 + fixext 16 | binary | 0xD8 + negative fixint | number_integer | 0xE0-0xFF + + @note Any MessagePack output created @ref to_msgpack can be successfully + parsed by @ref from_msgpack. + + @param[in] i an input in MessagePack format convertible to an input + adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if unsupported features from MessagePack were + used in the given input @a i or if the input is not valid MessagePack + @throw parse_error.113 if a string was expected as map key, but not found + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + MessagePack format to a JSON value.,from_msgpack} + + @sa http://msgpack.org + @sa @ref to_msgpack(const basic_json&) for the analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool) for the + related CBOR format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for + the related UBJSON format + @sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for + the related BSON format + + @since version 2.0.9; parameter @a start_index since 2.1.1; changed to + consume input adapters, removed start_index parameter, and added + @a strict parameter since 3.0.0; added @a allow_exceptions parameter + since 3.2.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_msgpack(detail::input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(i)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_msgpack(detail::input_adapter&&, const bool, const bool) + */ + template<typename A1, typename A2, + detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0> + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_msgpack(A1 && a1, A2 && a2, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(std::forward<A1>(a1), std::forward<A2>(a2))).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @brief create a JSON value from an input in UBJSON format + + Deserializes a given input @a i to a JSON value using the UBJSON (Universal + Binary JSON) serialization format. + + The library maps UBJSON types to JSON value types as follows: + + UBJSON type | JSON value type | marker + ----------- | --------------------------------------- | ------ + no-op | *no value, next value is read* | `N` + null | `null` | `Z` + false | `false` | `F` + true | `true` | `T` + float32 | number_float | `d` + float64 | number_float | `D` + uint8 | number_unsigned | `U` + int8 | number_integer | `i` + int16 | number_integer | `I` + int32 | number_integer | `l` + int64 | number_integer | `L` + string | string | `S` + char | string | `C` + array | array (optimized values are supported) | `[` + object | object (optimized values are supported) | `{` + + @note The mapping is **complete** in the sense that any UBJSON value can + be converted to a JSON value. + + @param[in] i an input in UBJSON format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if a parse error occurs + @throw parse_error.113 if a string could not be parsed successfully + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + UBJSON format to a JSON value.,from_ubjson} + + @sa http://ubjson.org + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool) for the + related CBOR format + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for + the related MessagePack format + @sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for + the related BSON format + + @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_ubjson(detail::input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(i)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_ubjson(detail::input_adapter&&, const bool, const bool) + */ + template<typename A1, typename A2, + detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0> + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_ubjson(A1 && a1, A2 && a2, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(std::forward<A1>(a1), std::forward<A2>(a2))).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @brief Create a JSON value from an input in BSON format + + Deserializes a given input @a i to a JSON value using the BSON (Binary JSON) + serialization format. + + The library maps BSON record types to JSON value types as follows: + + BSON type | BSON marker byte | JSON value type + --------------- | ---------------- | --------------------------- + double | 0x01 | number_float + string | 0x02 | string + document | 0x03 | object + array | 0x04 | array + binary | 0x05 | still unsupported + undefined | 0x06 | still unsupported + ObjectId | 0x07 | still unsupported + boolean | 0x08 | boolean + UTC Date-Time | 0x09 | still unsupported + null | 0x0A | null + Regular Expr. | 0x0B | still unsupported + DB Pointer | 0x0C | still unsupported + JavaScript Code | 0x0D | still unsupported + Symbol | 0x0E | still unsupported + JavaScript Code | 0x0F | still unsupported + int32 | 0x10 | number_integer + Timestamp | 0x11 | still unsupported + 128-bit decimal float | 0x13 | still unsupported + Max Key | 0x7F | still unsupported + Min Key | 0xFF | still unsupported + + @warning The mapping is **incomplete**. The unsupported mappings + are indicated in the table above. + + @param[in] i an input in BSON format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.114 if an unsupported BSON record type is encountered + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + BSON format to a JSON value.,from_bson} + + @sa http://bsonspec.org/spec.html + @sa @ref to_bson(const basic_json&) for the analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool) for the + related CBOR format + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for + the related MessagePack format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + related UBJSON format + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_bson(detail::input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(i)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_bson(detail::input_adapter&&, const bool, const bool) + */ + template<typename A1, typename A2, + detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0> + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_bson(A1 && a1, A2 && a2, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions); + const bool res = binary_reader(detail::input_adapter(std::forward<A1>(a1), std::forward<A2>(a2))).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + + /// @} + + ////////////////////////// + // JSON Pointer support // + ////////////////////////// + + /// @name JSON Pointer functions + /// @{ + + /*! + @brief access specified element via JSON Pointer + + Uses a JSON pointer to retrieve a reference to the respective JSON value. + No bound checking is performed. Similar to @ref operator[](const typename + object_t::key_type&), `null` values are created in arrays and objects if + necessary. + + In particular: + - If the JSON pointer points to an object key that does not exist, it + is created an filled with a `null` value before a reference to it + is returned. + - If the JSON pointer points to an array index that does not exist, it + is created an filled with a `null` value before a reference to it + is returned. All indices between the current maximum and the given + index are also filled with `null`. + - The special value `-` is treated as a synonym for the index past the + end. + + @param[in] ptr a JSON pointer + + @return reference to the element pointed to by @a ptr + + @complexity Constant. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.404 if the JSON pointer can not be resolved + + @liveexample{The behavior is shown in the example.,operatorjson_pointer} + + @since version 2.0.0 + */ + reference operator[](const json_pointer& ptr) + { + return ptr.get_unchecked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Uses a JSON pointer to retrieve a reference to the respective JSON value. + No bound checking is performed. The function does not change the JSON + value; no `null` values are created. In particular, the special value + `-` yields an exception. + + @param[in] ptr JSON pointer to the desired element + + @return const reference to the element pointed to by @a ptr + + @complexity Constant. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + + @liveexample{The behavior is shown in the example.,operatorjson_pointer_const} + + @since version 2.0.0 + */ + const_reference operator[](const json_pointer& ptr) const + { + return ptr.get_unchecked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Returns a reference to the element at with specified JSON pointer @a ptr, + with bounds checking. + + @param[in] ptr JSON pointer to the desired element + + @return reference to the element pointed to by @a ptr + + @throw parse_error.106 if an array index in the passed JSON pointer @a ptr + begins with '0'. See example below. + + @throw parse_error.109 if an array index in the passed JSON pointer @a ptr + is not a number. See example below. + + @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr + is out of range. See example below. + + @throw out_of_range.402 if the array index '-' is used in the passed JSON + pointer @a ptr. As `at` provides checked access (and no elements are + implicitly inserted), the index '-' is always invalid. See example below. + + @throw out_of_range.403 if the JSON pointer describes a key of an object + which cannot be found. See example below. + + @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved. + See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 2.0.0 + + @liveexample{The behavior is shown in the example.,at_json_pointer} + */ + reference at(const json_pointer& ptr) + { + return ptr.get_checked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Returns a const reference to the element at with specified JSON pointer @a + ptr, with bounds checking. + + @param[in] ptr JSON pointer to the desired element + + @return reference to the element pointed to by @a ptr + + @throw parse_error.106 if an array index in the passed JSON pointer @a ptr + begins with '0'. See example below. + + @throw parse_error.109 if an array index in the passed JSON pointer @a ptr + is not a number. See example below. + + @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr + is out of range. See example below. + + @throw out_of_range.402 if the array index '-' is used in the passed JSON + pointer @a ptr. As `at` provides checked access (and no elements are + implicitly inserted), the index '-' is always invalid. See example below. + + @throw out_of_range.403 if the JSON pointer describes a key of an object + which cannot be found. See example below. + + @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved. + See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 2.0.0 + + @liveexample{The behavior is shown in the example.,at_json_pointer_const} + */ + const_reference at(const json_pointer& ptr) const + { + return ptr.get_checked(this); + } + + /*! + @brief return flattened JSON value + + The function creates a JSON object whose keys are JSON pointers (see [RFC + 6901](https://tools.ietf.org/html/rfc6901)) and whose values are all + primitive. The original JSON value can be restored using the @ref + unflatten() function. + + @return an object that maps JSON pointers to primitive values + + @note Empty objects and arrays are flattened to `null` and will not be + reconstructed correctly by the @ref unflatten() function. + + @complexity Linear in the size the JSON value. + + @liveexample{The following code shows how a JSON object is flattened to an + object whose keys consist of JSON pointers.,flatten} + + @sa @ref unflatten() for the reverse function + + @since version 2.0.0 + */ + basic_json flatten() const + { + basic_json result(value_t::object); + json_pointer::flatten("", *this, result); + return result; + } + + /*! + @brief unflatten a previously flattened JSON value + + The function restores the arbitrary nesting of a JSON value that has been + flattened before using the @ref flatten() function. The JSON value must + meet certain constraints: + 1. The value must be an object. + 2. The keys must be JSON pointers (see + [RFC 6901](https://tools.ietf.org/html/rfc6901)) + 3. The mapped values must be primitive JSON types. + + @return the original JSON from a flattened version + + @note Empty objects and arrays are flattened by @ref flatten() to `null` + values and can not unflattened to their original type. Apart from + this example, for a JSON value `j`, the following is always true: + `j == j.flatten().unflatten()`. + + @complexity Linear in the size the JSON value. + + @throw type_error.314 if value is not an object + @throw type_error.315 if object values are not primitive + + @liveexample{The following code shows how a flattened JSON object is + unflattened into the original nested JSON object.,unflatten} + + @sa @ref flatten() for the reverse function + + @since version 2.0.0 + */ + basic_json unflatten() const + { + return json_pointer::unflatten(*this); + } + + /// @} + + ////////////////////////// + // JSON Patch functions // + ////////////////////////// + + /// @name JSON Patch functions + /// @{ + + /*! + @brief applies a JSON patch + + [JSON Patch](http://jsonpatch.com) defines a JSON document structure for + expressing a sequence of operations to apply to a JSON) document. With + this function, a JSON Patch is applied to the current JSON value by + executing all operations from the patch. + + @param[in] json_patch JSON patch document + @return patched document + + @note The application of a patch is atomic: Either all operations succeed + and the patched document is returned or an exception is thrown. In + any case, the original value is not changed: the patch is applied + to a copy of the value. + + @throw parse_error.104 if the JSON patch does not consist of an array of + objects + + @throw parse_error.105 if the JSON patch is malformed (e.g., mandatory + attributes are missing); example: `"operation add must have member path"` + + @throw out_of_range.401 if an array index is out of range. + + @throw out_of_range.403 if a JSON pointer inside the patch could not be + resolved successfully in the current JSON value; example: `"key baz not + found"` + + @throw out_of_range.405 if JSON pointer has no parent ("add", "remove", + "move") + + @throw other_error.501 if "test" operation was unsuccessful + + @complexity Linear in the size of the JSON value and the length of the + JSON patch. As usually only a fraction of the JSON value is affected by + the patch, the complexity can usually be neglected. + + @liveexample{The following code shows how a JSON patch is applied to a + value.,patch} + + @sa @ref diff -- create a JSON patch by comparing two JSON values + + @sa [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) + @sa [RFC 6901 (JSON Pointer)](https://tools.ietf.org/html/rfc6901) + + @since version 2.0.0 + */ + basic_json patch(const basic_json& json_patch) const + { + // make a working copy to apply the patch to + basic_json result = *this; + + // the valid JSON Patch operations + enum class patch_operations {add, remove, replace, move, copy, test, invalid}; + + const auto get_op = [](const std::string & op) + { + if (op == "add") + { + return patch_operations::add; + } + if (op == "remove") + { + return patch_operations::remove; + } + if (op == "replace") + { + return patch_operations::replace; + } + if (op == "move") + { + return patch_operations::move; + } + if (op == "copy") + { + return patch_operations::copy; + } + if (op == "test") + { + return patch_operations::test; + } + + return patch_operations::invalid; + }; + + // wrapper for "add" operation; add value at ptr + const auto operation_add = [&result](json_pointer & ptr, basic_json val) + { + // adding to the root of the target document means replacing it + if (ptr.empty()) + { + result = val; + return; + } + + // make sure the top element of the pointer exists + json_pointer top_pointer = ptr.top(); + if (top_pointer != ptr) + { + result.at(top_pointer); + } + + // get reference to parent of JSON pointer ptr + const auto last_path = ptr.back(); + ptr.pop_back(); + basic_json& parent = result[ptr]; + + switch (parent.m_type) + { + case value_t::null: + case value_t::object: + { + // use operator[] to add value + parent[last_path] = val; + break; + } + + case value_t::array: + { + if (last_path == "-") + { + // special case: append to back + parent.push_back(val); + } + else + { + const auto idx = json_pointer::array_index(last_path); + if (JSON_HEDLEY_UNLIKELY(static_cast<size_type>(idx) > parent.size())) + { + // avoid undefined behavior + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + + // default case: insert add offset + parent.insert(parent.begin() + static_cast<difference_type>(idx), val); + } + break; + } + + // if there exists a parent it cannot be primitive + default: // LCOV_EXCL_LINE + assert(false); // LCOV_EXCL_LINE + } + }; + + // wrapper for "remove" operation; remove value at ptr + const auto operation_remove = [&result](json_pointer & ptr) + { + // get reference to parent of JSON pointer ptr + const auto last_path = ptr.back(); + ptr.pop_back(); + basic_json& parent = result.at(ptr); + + // remove child + if (parent.is_object()) + { + // perform range check + auto it = parent.find(last_path); + if (JSON_HEDLEY_LIKELY(it != parent.end())) + { + parent.erase(it); + } + else + { + JSON_THROW(out_of_range::create(403, "key '" + last_path + "' not found")); + } + } + else if (parent.is_array()) + { + // note erase performs range check + parent.erase(static_cast<size_type>(json_pointer::array_index(last_path))); + } + }; + + // type check: top level value must be an array + if (JSON_HEDLEY_UNLIKELY(not json_patch.is_array())) + { + JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); + } + + // iterate and apply the operations + for (const auto& val : json_patch) + { + // wrapper to get a value for an operation + const auto get_value = [&val](const std::string & op, + const std::string & member, + bool string_type) -> basic_json & + { + // find value + auto it = val.m_value.object->find(member); + + // context-sensitive error message + const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; + + // check if desired value is present + if (JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) + { + JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); + } + + // check if result is of type string + if (JSON_HEDLEY_UNLIKELY(string_type and not it->second.is_string())) + { + JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); + } + + // no error: return value + return it->second; + }; + + // type check: every element of the array must be an object + if (JSON_HEDLEY_UNLIKELY(not val.is_object())) + { + JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); + } + + // collect mandatory members + const std::string op = get_value("op", "op", true); + const std::string path = get_value(op, "path", true); + json_pointer ptr(path); + + switch (get_op(op)) + { + case patch_operations::add: + { + operation_add(ptr, get_value("add", "value", false)); + break; + } + + case patch_operations::remove: + { + operation_remove(ptr); + break; + } + + case patch_operations::replace: + { + // the "path" location must exist - use at() + result.at(ptr) = get_value("replace", "value", false); + break; + } + + case patch_operations::move: + { + const std::string from_path = get_value("move", "from", true); + json_pointer from_ptr(from_path); + + // the "from" location must exist - use at() + basic_json v = result.at(from_ptr); + + // The move operation is functionally identical to a + // "remove" operation on the "from" location, followed + // immediately by an "add" operation at the target + // location with the value that was just removed. + operation_remove(from_ptr); + operation_add(ptr, v); + break; + } + + case patch_operations::copy: + { + const std::string from_path = get_value("copy", "from", true); + const json_pointer from_ptr(from_path); + + // the "from" location must exist - use at() + basic_json v = result.at(from_ptr); + + // The copy is functionally identical to an "add" + // operation at the target location using the value + // specified in the "from" member. + operation_add(ptr, v); + break; + } + + case patch_operations::test: + { + bool success = false; + JSON_TRY + { + // check if "value" matches the one at "path" + // the "path" location must exist - use at() + success = (result.at(ptr) == get_value("test", "value", false)); + } + JSON_INTERNAL_CATCH (out_of_range&) + { + // ignore out of range errors: success remains false + } + + // throw an exception if test fails + if (JSON_HEDLEY_UNLIKELY(not success)) + { + JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); + } + + break; + } + + default: + { + // op must be "add", "remove", "replace", "move", "copy", or + // "test" + JSON_THROW(parse_error::create(105, 0, "operation value '" + op + "' is invalid")); + } + } + } + + return result; + } + + /*! + @brief creates a diff as a JSON patch + + Creates a [JSON Patch](http://jsonpatch.com) so that value @a source can + be changed into the value @a target by calling @ref patch function. + + @invariant For two JSON values @a source and @a target, the following code + yields always `true`: + @code {.cpp} + source.patch(diff(source, target)) == target; + @endcode + + @note Currently, only `remove`, `add`, and `replace` operations are + generated. + + @param[in] source JSON value to compare from + @param[in] target JSON value to compare against + @param[in] path helper value to create JSON pointers + + @return a JSON patch to convert the @a source to @a target + + @complexity Linear in the lengths of @a source and @a target. + + @liveexample{The following code shows how a JSON patch is created as a + diff for two JSON values.,diff} + + @sa @ref patch -- apply a JSON patch + @sa @ref merge_patch -- apply a JSON Merge Patch + + @sa [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) + + @since version 2.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json diff(const basic_json& source, const basic_json& target, + const std::string& path = "") + { + // the patch + basic_json result(value_t::array); + + // if the values are the same, return empty patch + if (source == target) + { + return result; + } + + if (source.type() != target.type()) + { + // different types: replace value + result.push_back( + { + {"op", "replace"}, {"path", path}, {"value", target} + }); + return result; + } + + switch (source.type()) + { + case value_t::array: + { + // first pass: traverse common elements + std::size_t i = 0; + while (i < source.size() and i < target.size()) + { + // recursive call to compare array values at index i + auto temp_diff = diff(source[i], target[i], path + "/" + std::to_string(i)); + result.insert(result.end(), temp_diff.begin(), temp_diff.end()); + ++i; + } + + // i now reached the end of at least one array + // in a second pass, traverse the remaining elements + + // remove my remaining elements + const auto end_index = static_cast<difference_type>(result.size()); + while (i < source.size()) + { + // add operations in reverse order to avoid invalid + // indices + result.insert(result.begin() + end_index, object( + { + {"op", "remove"}, + {"path", path + "/" + std::to_string(i)} + })); + ++i; + } + + // add other remaining elements + while (i < target.size()) + { + result.push_back( + { + {"op", "add"}, + {"path", path + "/-"}, + {"value", target[i]} + }); + ++i; + } + + break; + } + + case value_t::object: + { + // first pass: traverse this object's elements + for (auto it = source.cbegin(); it != source.cend(); ++it) + { + // escape the key name to be used in a JSON patch + const auto key = json_pointer::escape(it.key()); + + if (target.find(it.key()) != target.end()) + { + // recursive call to compare object values at key it + auto temp_diff = diff(it.value(), target[it.key()], path + "/" + key); + result.insert(result.end(), temp_diff.begin(), temp_diff.end()); + } + else + { + // found a key that is not in o -> remove it + result.push_back(object( + { + {"op", "remove"}, {"path", path + "/" + key} + })); + } + } + + // second pass: traverse other object's elements + for (auto it = target.cbegin(); it != target.cend(); ++it) + { + if (source.find(it.key()) == source.end()) + { + // found a key that is not in this -> add it + const auto key = json_pointer::escape(it.key()); + result.push_back( + { + {"op", "add"}, {"path", path + "/" + key}, + {"value", it.value()} + }); + } + } + + break; + } + + default: + { + // both primitive type: replace value + result.push_back( + { + {"op", "replace"}, {"path", path}, {"value", target} + }); + break; + } + } + + return result; + } + + /// @} + + //////////////////////////////// + // JSON Merge Patch functions // + //////////////////////////////// + + /// @name JSON Merge Patch functions + /// @{ + + /*! + @brief applies a JSON Merge Patch + + The merge patch format is primarily intended for use with the HTTP PATCH + method as a means of describing a set of modifications to a target + resource's content. This function applies a merge patch to the current + JSON value. + + The function implements the following algorithm from Section 2 of + [RFC 7396 (JSON Merge Patch)](https://tools.ietf.org/html/rfc7396): + + ``` + define MergePatch(Target, Patch): + if Patch is an Object: + if Target is not an Object: + Target = {} // Ignore the contents and set it to an empty Object + for each Name/Value pair in Patch: + if Value is null: + if Name exists in Target: + remove the Name/Value pair from Target + else: + Target[Name] = MergePatch(Target[Name], Value) + return Target + else: + return Patch + ``` + + Thereby, `Target` is the current object; that is, the patch is applied to + the current value. + + @param[in] apply_patch the patch to apply + + @complexity Linear in the lengths of @a patch. + + @liveexample{The following code shows how a JSON Merge Patch is applied to + a JSON document.,merge_patch} + + @sa @ref patch -- apply a JSON patch + @sa [RFC 7396 (JSON Merge Patch)](https://tools.ietf.org/html/rfc7396) + + @since version 3.0.0 + */ + void merge_patch(const basic_json& apply_patch) + { + if (apply_patch.is_object()) + { + if (not is_object()) + { + *this = object(); + } + for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it) + { + if (it.value().is_null()) + { + erase(it.key()); + } + else + { + operator[](it.key()).merge_patch(it.value()); + } + } + } + else + { + *this = apply_patch; + } + } + + /// @} +}; + +/*! +@brief user-defined to_string function for JSON values + +This function implements a user-defined to_string for JSON objects. + +@param[in] j a JSON object +@return a std::string object +*/ + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j) +{ + return j.dump(); +} +} // namespace nlohmann + +/////////////////////// +// nonmember support // +/////////////////////// + +// specialization of std::swap, and std::hash +namespace std +{ + +/// hash value for JSON objects +template<> +struct hash<nlohmann::json> +{ + /*! + @brief return a hash value for a JSON object + + @since version 1.0.0 + */ + std::size_t operator()(const nlohmann::json& j) const + { + // a naive hashing via the string representation + const auto& h = hash<nlohmann::json::string_t>(); + return h(j.dump()); + } +}; + +/// specialization for std::less<value_t> +/// @note: do not remove the space after '<', +/// see https://github.com/nlohmann/json/pull/679 +template<> +struct less<::nlohmann::detail::value_t> +{ + /*! + @brief compare two value_t enum values + @since version 3.0.0 + */ + bool operator()(nlohmann::detail::value_t lhs, + nlohmann::detail::value_t rhs) const noexcept + { + return nlohmann::detail::operator<(lhs, rhs); + } +}; + +/*! +@brief exchanges the values of two JSON objects + +@since version 1.0.0 +*/ +template<> +inline void swap<nlohmann::json>(nlohmann::json& j1, nlohmann::json& j2) noexcept( + is_nothrow_move_constructible<nlohmann::json>::value and + is_nothrow_move_assignable<nlohmann::json>::value +) +{ + j1.swap(j2); +} + +} // namespace std + +/*! +@brief user-defined string literal for JSON values + +This operator implements a user-defined string literal for JSON objects. It +can be used by adding `"_json"` to a string literal and returns a JSON object +if no parse error occurred. + +@param[in] s a string representation of a JSON object +@param[in] n the length of string @a s +@return a JSON object + +@since version 1.0.0 +*/ +JSON_HEDLEY_NON_NULL(1) +inline nlohmann::json operator "" _json(const char* s, std::size_t n) +{ + return nlohmann::json::parse(s, s + n); +} + +/*! +@brief user-defined string literal for JSON pointer + +This operator implements a user-defined string literal for JSON Pointers. It +can be used by adding `"_json_pointer"` to a string literal and returns a JSON pointer +object if no parse error occurred. + +@param[in] s a string representation of a JSON Pointer +@param[in] n the length of string @a s +@return a JSON pointer object + +@since version 2.0.0 +*/ +JSON_HEDLEY_NON_NULL(1) +inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) +{ + return nlohmann::json::json_pointer(std::string(s, n)); +} + +// #include <nlohmann/detail/macro_unscope.hpp> + + +// restore GCC/clang diagnostic settings +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic pop +#endif +#if defined(__clang__) + #pragma GCC diagnostic pop +#endif + +// clean up +#undef JSON_INTERNAL_CATCH +#undef JSON_CATCH +#undef JSON_THROW +#undef JSON_TRY +#undef JSON_HAS_CPP_14 +#undef JSON_HAS_CPP_17 +#undef NLOHMANN_BASIC_JSON_TPL_DECLARATION +#undef NLOHMANN_BASIC_JSON_TPL + +// #include <nlohmann/thirdparty/hedley/hedley_undef.hpp> +#undef JSON_HEDLEY_ALWAYS_INLINE +#undef JSON_HEDLEY_ARM_VERSION +#undef JSON_HEDLEY_ARM_VERSION_CHECK +#undef JSON_HEDLEY_ARRAY_PARAM +#undef JSON_HEDLEY_ASSUME +#undef JSON_HEDLEY_BEGIN_C_DECLS +#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef JSON_HEDLEY_CLANG_HAS_FEATURE +#undef JSON_HEDLEY_CLANG_HAS_WARNING +#undef JSON_HEDLEY_COMPCERT_VERSION +#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef JSON_HEDLEY_CONCAT +#undef JSON_HEDLEY_CONCAT3 +#undef JSON_HEDLEY_CONCAT3_EX +#undef JSON_HEDLEY_CONCAT_EX +#undef JSON_HEDLEY_CONST +#undef JSON_HEDLEY_CONSTEXPR +#undef JSON_HEDLEY_CONST_CAST +#undef JSON_HEDLEY_CPP_CAST +#undef JSON_HEDLEY_CRAY_VERSION +#undef JSON_HEDLEY_CRAY_VERSION_CHECK +#undef JSON_HEDLEY_C_DECL +#undef JSON_HEDLEY_DEPRECATED +#undef JSON_HEDLEY_DEPRECATED_FOR +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef JSON_HEDLEY_DIAGNOSTIC_POP +#undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef JSON_HEDLEY_DMC_VERSION +#undef JSON_HEDLEY_DMC_VERSION_CHECK +#undef JSON_HEDLEY_EMPTY_BASES +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef JSON_HEDLEY_END_C_DECLS +#undef JSON_HEDLEY_FLAGS +#undef JSON_HEDLEY_FLAGS_CAST +#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_BUILTIN +#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_EXTENSION +#undef JSON_HEDLEY_GCC_HAS_FEATURE +#undef JSON_HEDLEY_GCC_HAS_WARNING +#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef JSON_HEDLEY_GCC_VERSION +#undef JSON_HEDLEY_GCC_VERSION_CHECK +#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef JSON_HEDLEY_GNUC_HAS_FEATURE +#undef JSON_HEDLEY_GNUC_HAS_WARNING +#undef JSON_HEDLEY_GNUC_VERSION +#undef JSON_HEDLEY_GNUC_VERSION_CHECK +#undef JSON_HEDLEY_HAS_ATTRIBUTE +#undef JSON_HEDLEY_HAS_BUILTIN +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_HAS_EXTENSION +#undef JSON_HEDLEY_HAS_FEATURE +#undef JSON_HEDLEY_HAS_WARNING +#undef JSON_HEDLEY_IAR_VERSION +#undef JSON_HEDLEY_IAR_VERSION_CHECK +#undef JSON_HEDLEY_IBM_VERSION +#undef JSON_HEDLEY_IBM_VERSION_CHECK +#undef JSON_HEDLEY_IMPORT +#undef JSON_HEDLEY_INLINE +#undef JSON_HEDLEY_INTEL_VERSION +#undef JSON_HEDLEY_INTEL_VERSION_CHECK +#undef JSON_HEDLEY_IS_CONSTANT +#undef JSON_HEDLEY_IS_CONSTEXPR_ +#undef JSON_HEDLEY_LIKELY +#undef JSON_HEDLEY_MALLOC +#undef JSON_HEDLEY_MESSAGE +#undef JSON_HEDLEY_MSVC_VERSION +#undef JSON_HEDLEY_MSVC_VERSION_CHECK +#undef JSON_HEDLEY_NEVER_INLINE +#undef JSON_HEDLEY_NON_NULL +#undef JSON_HEDLEY_NO_ESCAPE +#undef JSON_HEDLEY_NO_RETURN +#undef JSON_HEDLEY_NO_THROW +#undef JSON_HEDLEY_NULL +#undef JSON_HEDLEY_PELLES_VERSION +#undef JSON_HEDLEY_PELLES_VERSION_CHECK +#undef JSON_HEDLEY_PGI_VERSION +#undef JSON_HEDLEY_PGI_VERSION_CHECK +#undef JSON_HEDLEY_PREDICT +#undef JSON_HEDLEY_PRINTF_FORMAT +#undef JSON_HEDLEY_PRIVATE +#undef JSON_HEDLEY_PUBLIC +#undef JSON_HEDLEY_PURE +#undef JSON_HEDLEY_REINTERPRET_CAST +#undef JSON_HEDLEY_REQUIRE +#undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef JSON_HEDLEY_REQUIRE_MSG +#undef JSON_HEDLEY_RESTRICT +#undef JSON_HEDLEY_RETURNS_NON_NULL +#undef JSON_HEDLEY_SENTINEL +#undef JSON_HEDLEY_STATIC_ASSERT +#undef JSON_HEDLEY_STATIC_CAST +#undef JSON_HEDLEY_STRINGIFY +#undef JSON_HEDLEY_STRINGIFY_EX +#undef JSON_HEDLEY_SUNPRO_VERSION +#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef JSON_HEDLEY_TINYC_VERSION +#undef JSON_HEDLEY_TINYC_VERSION_CHECK +#undef JSON_HEDLEY_TI_ARMCL_VERSION +#undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL2000_VERSION +#undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL430_VERSION +#undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL6X_VERSION +#undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL7X_VERSION +#undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#undef JSON_HEDLEY_TI_CLPRU_VERSION +#undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#undef JSON_HEDLEY_TI_VERSION +#undef JSON_HEDLEY_TI_VERSION_CHECK +#undef JSON_HEDLEY_UNAVAILABLE +#undef JSON_HEDLEY_UNLIKELY +#undef JSON_HEDLEY_UNPREDICTABLE +#undef JSON_HEDLEY_UNREACHABLE +#undef JSON_HEDLEY_UNREACHABLE_RETURN +#undef JSON_HEDLEY_VERSION +#undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef JSON_HEDLEY_VERSION_DECODE_MINOR +#undef JSON_HEDLEY_VERSION_DECODE_REVISION +#undef JSON_HEDLEY_VERSION_ENCODE +#undef JSON_HEDLEY_WARNING +#undef JSON_HEDLEY_WARN_UNUSED_RESULT +#undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#undef JSON_HEDLEY_FALL_THROUGH + + + +#endif // INCLUDE_NLOHMANN_JSON_HPP_ diff --git a/Quake/keys.cpp b/Quake/keys.cpp index 4f2474d7..7cfe3846 100644 --- a/Quake/keys.cpp +++ b/Quake/keys.cpp @@ -22,8 +22,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "quakedef.hpp" +#include "keys.hpp" #include "arch_def.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "quakeparms.hpp" +#include "platform.hpp" +#include "glquake.hpp" +#include "menu.hpp" +#include "zone.hpp" +#include "q_stdinc.hpp" +#include "vid.hpp" +#include "client.hpp" +#include "screen.hpp" +#include "input.hpp" +#include "vr_cvars.hpp" +#include "vr.hpp" +#include "menu_keyboard.hpp" +#include "sys.hpp" /* key up events are sent even if in console mode */ @@ -193,8 +209,17 @@ Interactive line editing and console scrollback extern char *con_text, key_tabpartial[MAXCMDLINE]; extern int con_current, con_linewidth, con_vislines; -void Key_Console(int key) +void Key_Console(int key, const bool fromVirtualKeyboard) { + // TODO VR: (P1) cleanup + quake::vr::menu_keyboard& mkb(); + + if(!fromVirtualKeyboard && !vr_fakevr.value && + mkb().hovered(vr_menu_mouse_x, vr_menu_mouse_y) && key == K_ENTER) + { + return; + } + static char current[MAXCMDLINE] = ""; int history_line_last; size_t len; @@ -882,8 +907,8 @@ void Key_Init() // ascii characters consolekeys[i] = true; } - consolekeys['`'] = false; - consolekeys['~'] = false; + consolekeys[static_cast<int>('`')] = false; + consolekeys[static_cast<int>('~')] = false; consolekeys[K_TAB] = true; consolekeys[K_ENTER] = true; consolekeys[K_ESCAPE] = true; @@ -1136,7 +1161,7 @@ void Key_Event(int key, bool down) case key_menu: M_Keydown(key); break; case key_game: - case key_console: Key_Console(key); break; + case key_console: Key_Console(key, false /* fromVirtualKeyboard */); break; default: Sys_Error("Bad key_dest"); } } diff --git a/Quake/keys.hpp b/Quake/keys.hpp index 03967f87..055e182b 100644 --- a/Quake/keys.hpp +++ b/Quake/keys.hpp @@ -21,8 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_KEYS_H -#define _QUAKE_KEYS_H +#pragma once + +#include <cstdio> // // these are the key numbers that should be passed to Key_Event @@ -180,27 +181,25 @@ extern double key_blinktime; extern bool chat_team; -void Key_Init(void); -void Key_ClearStates(void); -void Key_UpdateForDest(void); +void Key_Init(); +void Key_ClearStates(); +void Key_UpdateForDest(); -void Key_BeginInputGrab(void); -void Key_EndInputGrab(void); +void Key_BeginInputGrab(); +void Key_EndInputGrab(); void Key_GetGrabbedInput(int* lastkey, int* lastchar); void Key_Event(int key, bool down); void Char_Event(int key); -bool Key_TextEntry(void); +bool Key_TextEntry(); void Key_SetBinding(int keynum, const char* binding); const char* Key_KeynumToString(int keynum); void Key_WriteBindings(FILE* f); -void Key_EndChat(void); -const char* Key_GetChatBuffer(void); -int Key_GetChatMsgLen(void); - -void History_Init(void); -void History_Shutdown(void); +void Key_EndChat(); +const char* Key_GetChatBuffer(); +int Key_GetChatMsgLen(); -#endif /* _QUAKE_KEYS_H */ +void History_Init(); +void History_Shutdown(); diff --git a/Quake/lerpdata.hpp b/Quake/lerpdata.hpp new file mode 100644 index 00000000..f905c352 --- /dev/null +++ b/Quake/lerpdata.hpp @@ -0,0 +1,10 @@ +#pragma once + +struct lerpdata_t +{ + short pose1; + short pose2; + float blend; + qvec3 origin; + qvec3 angles; +}; diff --git a/Quake/lodepng.hpp b/Quake/lodepng.hpp index 299f344b..7c47d7c3 100644 --- a/Quake/lodepng.hpp +++ b/Quake/lodepng.hpp @@ -26,7 +26,7 @@ freely, subject to the following restrictions: #ifndef LODEPNG_H #define LODEPNG_H -#include <string.h> /*for size_t*/ +#include <cstring> /*for size_t*/ extern const char* LODEPNG_VERSION_STRING; diff --git a/Quake/macros.hpp b/Quake/macros.hpp new file mode 100644 index 00000000..dcafef05 --- /dev/null +++ b/Quake/macros.hpp @@ -0,0 +1,35 @@ +#pragma once + +#if !defined(QUAKE_FORCEINLINE) +#if defined(__GNUC__) || defined(__clang__) +#define QUAKE_FORCEINLINE [[gnu::always_inline]] inline +#elif defined(_MSC_VER) +#define QUAKE_FORCEINLINE __forceinline +#else +#define QUAKE_FORCEINLINE inline +#endif +#endif + +#if !defined(QUAKE_PURE) +#if defined(__GNUC__) || defined(__clang__) +#define QUAKE_PUREFN [[gnu::pure]] +#else +#define QUAKE_PUREFN +#endif +#endif + +#if !defined(QUAKE_CONSTFN) +#if defined(__GNUC__) || defined(__clang__) +#define QUAKE_CONSTFN [[gnu::const]] +#else +#define QUAKE_CONSTFN +#endif +#endif + +#if !defined(QUAKE_FORCEINLINE_PUREFN) +#define QUAKE_FORCEINLINE_PUREFN QUAKE_PUREFN QUAKE_FORCEINLINE +#endif + +#if !defined(QUAKE_FORCEINLINE_CONSTFN) +#define QUAKE_FORCEINLINE_CONSTFN QUAKE_CONSTFN QUAKE_FORCEINLINE +#endif diff --git a/Quake/main_sdl.cpp b/Quake/main_sdl.cpp index 1b2512d7..0e0302e6 100644 --- a/Quake/main_sdl.cpp +++ b/Quake/main_sdl.cpp @@ -25,19 +25,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <cassert> #include <string> +#include "host.hpp" #include "quakedef.hpp" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) +#include "common.hpp" +#include "quakeparms.hpp" +#include "sys.hpp" +#include "vid.hpp" +#include "client.hpp" +#include "screen.hpp" + #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif -#include <stdio.h> -#if defined(USE_SDL2) +#include <stdio.h> /* need at least SDL_2.0.0 */ #define SDL_MIN_X 2 @@ -46,18 +45,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SDL_REQUIREDVERSION (SDL_VERSIONNUM(SDL_MIN_X, SDL_MIN_Y, SDL_MIN_Z)) #define SDL_NEW_VERSION_REJECT (SDL_VERSIONNUM(3, 0, 0)) -#else - -/* need at least SDL_1.2.10 */ -#define SDL_MIN_X 1 -#define SDL_MIN_Y 2 -#define SDL_MIN_Z 10 -#define SDL_REQUIREDVERSION (SDL_VERSIONNUM(SDL_MIN_X, SDL_MIN_Y, SDL_MIN_Z)) -/* reject 1.3.0 and newer at runtime. */ -#define SDL_NEW_VERSION_REJECT (SDL_VERSIONNUM(1, 3, 0)) - -#endif - static void Sys_AtExit() { SDL_Quit(); @@ -65,13 +52,9 @@ static void Sys_AtExit() static void Sys_InitSDL() { -#if defined(USE_SDL2) SDL_version v; SDL_version* sdl_version = &v; SDL_GetVersion(&v); -#else - const SDL_version* sdl_version = SDL_Linked_Version(); -#endif Sys_Printf("Found SDL version %i.%i.%i\n", sdl_version->major, sdl_version->minor, sdl_version->patch); @@ -104,7 +87,7 @@ static quakeparms_t parms; // On OS X we call SDL_main from the launcher, but SDL2 doesn't redefine main // as SDL_main on OS X anymore, so we do it ourselves. -#if defined(USE_SDL2) && defined(__APPLE__) +#if defined(__APPLE__) #define main SDL_main #endif diff --git a/Quake/mathlib.cpp b/Quake/mathlib.cpp index 66e98e66..677c609f 100644 --- a/Quake/mathlib.cpp +++ b/Quake/mathlib.cpp @@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "util.hpp" +#include "gl_model.hpp" +#include "quakeglm_qmat3.hpp" +#include "sys.hpp" /*-----------------------------------------------------------------*/ @@ -32,10 +35,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //#define DEG2RAD( a ) ( a * M_PI ) / 180.0F #define DEG2RAD(a) ((a)*M_PI_DIV_180) // johnfitz -glm::vec3 ProjectPointOnPlane(const glm::vec3& p, const glm::vec3& normal) +qvec3 ProjectPointOnPlane(const qvec3& p, const qvec3& normal) { float d; - glm::vec3 n; + qvec3 n; float inv_denom; inv_denom = 1.0F / DotProduct(normal, normal); @@ -46,29 +49,13 @@ glm::vec3 ProjectPointOnPlane(const glm::vec3& p, const glm::vec3& normal) n[1] = normal[1] * inv_denom; n[2] = normal[2] * inv_denom; - glm::vec3 dst; + qvec3 dst; dst[0] = p[0] - d * n[0]; dst[1] = p[1] - d * n[1]; dst[2] = p[2] - d * n[2]; return dst; } -/*-----------------------------------------------------------------*/ - - -float anglemod(float a) -{ -#if 0 - if (a >= 0) - a -= 360*(int)(a/360); - else - a += 360*( 1 + (int)(-a/360) ); -#endif - a = (360.0 / 65536) * ((int)(a * (65536 / 360.0)) & 65535); - return a; -} - - /* ================== BoxOnPlaneSide @@ -76,7 +63,7 @@ BoxOnPlaneSide Returns 1, 2, or 1 + 2 ================== */ -int BoxOnPlaneSide(const glm::vec3& emins, const glm::vec3& emaxs, mplane_t* p) +int BoxOnPlaneSide(const qvec3& emins, const qvec3& emaxs, mplane_t* p) { float dist1; @@ -130,7 +117,7 @@ int BoxOnPlaneSide(const glm::vec3& emins, const glm::vec3& emaxs, mplane_t* p) p->normal[2] * emaxs[2]; break; case 5: - dist1 = p->normal[0] * emins[0] + p->normal[1] * emaxs[1] + + dist1 = p->normal[0] * emins[0] + p->normal[1] * emaxs[1] + p->normal[2] * emins[2]; dist2 = p->normal[0] * emaxs[0] + p->normal[1] * emins[1] + p->normal[2] * emaxs[2]; @@ -155,7 +142,7 @@ int BoxOnPlaneSide(const glm::vec3& emins, const glm::vec3& emaxs, mplane_t* p) #if 0 int i; - glm::vec3 corners[2]; + qvec3 corners[2]; for (i=0 ; i<3 ; i++) { @@ -199,9 +186,9 @@ int BoxOnPlaneSide(const glm::vec3& emins, const glm::vec3& emaxs, mplane_t* p) // johnfitz -- the opposite of AngleVectors. this takes forward and generates // pitch yaw roll // TODO: take right and up vectors to properly set yaw and roll -[[nodiscard]] glm::vec3 VectorAngles(const glm::vec3& forward) noexcept +[[nodiscard]] qvec3 VectorAngles(const qvec3& forward) noexcept { - glm::vec3 temp, res; + qvec3 temp, res; temp[0] = forward[0]; temp[1] = forward[1]; @@ -218,20 +205,20 @@ float VectorLength(vec3_t v) return sqrt(DotProduct(v, v)); } -[[nodiscard]] glm::mat3 RotMatFromAngleVector(const glm::vec3& angles) noexcept +[[nodiscard]] qmat3 RotMatFromAngleVector(const qvec3& angles) noexcept { const auto [fwd, right, up] = quake::util::getAngledVectors(angles); - glm::mat3 res; + qmat3 res; res[0] = fwd; - res[1] = right * -1.f; // flip y so (0,0,0) produces identity! + res[1] = right * -1._qf; // flip y so (0,0,0) produces identity! res[2] = up; return res; } -[[nodiscard]] glm::vec3 AngleVectorFromRotMat(const glm::mat3& mat) noexcept +[[nodiscard]] qvec3 AngleVectorFromRotMat(const qmat3& mat) noexcept { - glm::vec3 out; + qvec3 out; out[1] = -atan2(mat[0][0], mat[0][1]) / M_PI_DIV_180 + 90; out[0] = @@ -250,9 +237,9 @@ float VectorLength(vec3_t v) return out; } -[[nodiscard]] glm::mat3 CreateRotMat(const int axis, const float angle) noexcept +[[nodiscard]] qmat3 CreateRotMat(const int axis, const qfloat angle) noexcept { - const glm::vec3 angles{ + const qvec3 angles{ axis == 0 ? angle : 0, axis == 1 ? angle : 0, axis == 2 ? angle : 0}; return RotMatFromAngleVector(angles); @@ -263,10 +250,10 @@ float VectorLength(vec3_t v) R_ConcatRotations ================ */ -[[nodiscard]] glm::mat3 R_ConcatRotations( - const glm::mat3& in1, const glm::mat3& in2) noexcept +[[nodiscard]] qmat3 R_ConcatRotations( + const qmat3& in1, const qmat3& in2) noexcept { - glm::mat3 res; + qmat3 res; res[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0]; diff --git a/Quake/mathlib.hpp b/Quake/mathlib.hpp index 7342b7e9..30f90da0 100644 --- a/Quake/mathlib.hpp +++ b/Quake/mathlib.hpp @@ -22,13 +22,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __MATHLIB_H -#define __MATHLIB_H +#pragma once // mathlib.h -#include <math.h> +#include <cmath> + +#include "macros.hpp" #include "quakeglm.hpp" +#include "quakeglm_qmat3.hpp" +#include "quakedef_macros.hpp" +#include "q_stdinc.hpp" #ifndef M_PI #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h @@ -36,10 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_PI_DIV_180 (M_PI / 180.0) // johnfitz -struct mplane_s; - -inline constexpr glm::vec3 vec3_zero{0.f, 0.f, 0.f}; - #define nanmask (255 << 23) /* 7F800000 */ #if 0 /* macro is violating strict aliasing rules */ #define IS_NAN(x) (((*(int*)(char*)&x) & nanmask) == nanmask) @@ -60,20 +60,24 @@ static inline int IS_NAN(float x) ((x) > 0 ? (int)((x) + 0.5) : (int)((x)-0.5)) // johnfitz -- from joequake #define DotProduct(x, y) (x[0] * y[0] + x[1] * y[1] + x[2] * y[2]) + #define DoublePrecisionDotProduct(x, y) \ ((double)x[0] * y[0] + (double)x[1] * y[1] + (double)x[2] * y[2]) + #define VectorSubtract(a, b, c) \ { \ c[0] = a[0] - b[0]; \ c[1] = a[1] - b[1]; \ c[2] = a[2] - b[2]; \ } + #define VectorAdd(a, b, c) \ { \ c[0] = a[0] + b[0]; \ c[1] = a[1] + b[1]; \ c[2] = a[2] + b[2]; \ } + #define VectorCopy(a, b) \ { \ b[0] = a[0]; \ @@ -81,90 +85,56 @@ static inline int IS_NAN(float x) b[2] = a[2]; \ } -[[nodiscard]] inline glm::vec3 safeNormalize(const glm::vec3& in) +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN qvec3 safeNormalize(const qvec3& in) { const auto length = glm::length(in); return length != 0.f ? in / length : in; } -[[nodiscard]] glm::vec3 VectorAngles( - const glm::vec3& forward) noexcept; // johnfitz +[[nodiscard]] qvec3 VectorAngles(const qvec3& forward) noexcept; // johnfitz float VectorLength(vec3_t v); -[[nodiscard]] glm::mat3 R_ConcatRotations( - const glm::mat3& in1, const glm::mat3& in2) noexcept; +[[nodiscard]] qmat3 R_ConcatRotations( + const qmat3& in1, const qmat3& in2) noexcept; void R_ConcatTransforms(float in1[3][4], float in2[3][4], float out[3][4]); -inline glm::vec3 AngleVectorsOnlyFwd(const glm::vec3& angles) noexcept +inline qvec3 AngleVectorsOnlyFwd(const qvec3& angles) noexcept { - const float yawRadians = angles[YAW] * (M_PI / 180.f); + const auto yawRadians = glm::radians(angles[YAW]); assert(!std::isnan(yawRadians)); assert(!std::isinf(yawRadians)); - const float sy = std::sin(yawRadians); - const float cy = std::cos(yawRadians); + const auto sy = std::sin(yawRadians); + const auto cy = std::cos(yawRadians); - const float pitchRadians = angles[PITCH] * (M_PI / 180.f); + const auto pitchRadians = glm::radians(angles[PITCH]); assert(!std::isnan(pitchRadians)); assert(!std::isinf(pitchRadians)); - const float sp = std::sin(pitchRadians); - const float cp = std::cos(pitchRadians); + const auto sp = std::sin(pitchRadians); + const auto cp = std::cos(pitchRadians); return {cp * cy, cp * sy, -sp}; } -inline void AngleVectors(const glm::vec3& angles, glm::vec3& forward, - glm::vec3& right, glm::vec3& up) noexcept -{ - const float yawRadians = angles[YAW] * (M_PI / 180.f); - assert(!std::isnan(yawRadians)); - assert(!std::isinf(yawRadians)); - - const float sy = std::sin(yawRadians); - const float cy = std::cos(yawRadians); - - const float pitchRadians = angles[PITCH] * (M_PI / 180.f); - assert(!std::isnan(pitchRadians)); - assert(!std::isinf(pitchRadians)); - - const float sp = std::sin(pitchRadians); - const float cp = std::cos(pitchRadians); - - const float rollRadians = angles[ROLL] * (M_PI / 180.f); - assert(!std::isnan(rollRadians)); - assert(!std::isinf(rollRadians)); - - const float sr = std::sin(rollRadians); - const float cr = std::cos(rollRadians); - - forward[0] = cp * cy; - forward[1] = cp * sy; - forward[2] = -sp; +struct mplane_s; +int BoxOnPlaneSide( + const qvec3& emins, const qvec3& emaxs, struct mplane_s* plane); - right[0] = (-1 * sr * sp * cy + -1 * cr * -sy); - right[1] = (-1 * sr * sp * sy + -1 * cr * cy); - right[2] = -1 * sr * cp; - up[0] = (cr * sp * cy + -sr * -sy); - up[1] = (cr * sp * sy + -sr * cy); - up[2] = cr * cp; +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr float anglemod( + float a) noexcept +{ + return (360.0 / 65536) * ((int)(a * (65536 / 360.0)) & 65535); } -int BoxOnPlaneSide( - const glm::vec3& emins, const glm::vec3& emaxs, struct mplane_s* plane); -float anglemod(float a); - -[[nodiscard]] glm::mat3 RotMatFromAngleVector(const glm::vec3& angles) noexcept; -[[nodiscard]] glm::vec3 AngleVectorFromRotMat(const glm::mat3& mat) noexcept; -[[nodiscard]] glm::mat3 CreateRotMat( - const int axis, const float angle) noexcept; +[[nodiscard]] qmat3 RotMatFromAngleVector(const qvec3& angles) noexcept; +[[nodiscard]] qvec3 AngleVectorFromRotMat(const qmat3& mat) noexcept; +[[nodiscard]] qmat3 CreateRotMat(const int axis, const qfloat angle) noexcept; #define BOX_ON_PLANE_SIDE(emins, emaxs, p) \ (((p)->type < 3) ? (((p)->dist <= (emins)[(p)->type]) \ ? 1 \ : (((p)->dist >= (emaxs)[(p)->type]) ? 2 : 3)) \ : BoxOnPlaneSide((emins), (emaxs), (p))) - -#endif /* __MATHLIB_H */ diff --git a/Quake/menu.cpp b/Quake/menu.cpp index d30561c1..92fa6472 100644 --- a/Quake/menu.cpp +++ b/Quake/menu.cpp @@ -21,18 +21,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "host.hpp" +#include "menu.hpp" +#include "console.hpp" +#include "cvar.hpp" #include "quakedef.hpp" #include "bgmusic.hpp" #include "menu_util.hpp" #include "util.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" +#include "vr_showfn.hpp" +#include "cmd.hpp" +#include "qpic.hpp" +#include "net.hpp" +#include "keys.hpp" +#include "saveutil.hpp" +#include "draw.hpp" +#include "client.hpp" +#include "input.hpp" +#include "screen.hpp" +#include "q_sound.hpp" +#include "vid.hpp" +#include "view.hpp" +#include "gl_util.hpp" +#include "menu_keyboard.hpp" #include <string> +#include <SDL2/SDL_mouse.h> #include <string_view> #include <cassert> #include <array> #include <tuple> #include <cstddef> +#include <algorithm> +#include <ctime> +#include <iomanip> +#include <variant> void (*vid_menucmdfn)(); // johnfitz void (*vid_menudrawfn)(); @@ -40,9 +65,8 @@ void (*vid_menukeyfn)(int key); enum m_state_e m_state; - void M_Menu_SinglePlayer_f(); -void M_Menu_NewGame_f(); +void M_Menu_NewGame_f(const char* map); void M_Menu_Load_f(); void M_Menu_Save_f(); void M_Menu_MultiPlayer_f(); @@ -57,7 +81,6 @@ void M_Menu_Keys_f(); void M_Menu_Video_f(); void M_Menu_Help_f(); - void M_Main_Draw(); void M_SinglePlayer_Draw(); void M_Load_Draw(); @@ -103,11 +126,11 @@ char m_return_reason[32]; // TODO VR: (P2) hackish #define StartingGame ((multiPlayerMenu().cursor_idx()) == 1) #define JoiningGame ((multiPlayerMenu().cursor_idx()) == 0) -#define IPXConfig (m_net_cursor == 0) -#define TCPIPConfig (m_net_cursor == 1) void M_ConfigureNetSubsystem(); +[[nodiscard]] static quake::menu& quakeVRQuickSettingsMenu(); + /* ================ M_DrawCharacter @@ -130,6 +153,7 @@ void M_Print(int cx, int cy, const char* str) } } + void M_PrintWithNewLine(int cx, int cy, const char* str) { const int originalCx = cx; @@ -338,7 +362,6 @@ void M_ToggleMenu_f() } } - //============================================================================= /* MAIN MENU */ @@ -347,10 +370,13 @@ void M_ToggleMenu_f() quake::menu m{"Main Menu", [] {}}; m.add_action_entry("Single Player", &M_Menu_SinglePlayer_f); - m.add_action_entry("Multi Player", &M_Menu_MultiPlayer_f); + m.add_action_entry("Multi Player & Bots", &M_Menu_MultiPlayer_f); m.add_action_entry("Options", &M_Menu_Options_f); - m.add_action_entry("Quake VR Settings", &M_Menu_QuakeVRSettings_f); - m.add_action_entry("Quake VR Dev Tools", &M_Menu_QuakeVRDevTools_f); + // m.add_action_entry("Quake VR - Quick Settings", + // &M_Menu_QuakeVRQuickSettings_f); + m.add_action_entry("Quake VR - Settings", &M_Menu_QuakeVRSettings_f); + m.add_action_entry("Quake VR - Dev Tools", &M_Menu_QuakeVRDevTools_f); + m.add_action_entry("Quake VR - Change Map", &M_Menu_QuakeVRChangeMap_f); m.add_action_entry("Help/Ordering", &M_Menu_Help_f); m.add_action_entry("Quit", &M_Menu_Quit_f); @@ -395,16 +421,16 @@ void M_Main_Key(int key) key_dest = key_game; m_state = m_none; cls.demonum = m_save_demonum; - if(!fitzmode) - { /* QuakeSpasm customization: */ - break; - } + break; + + /* if(cls.demonum != -1 && !cls.demoplayback && cls.state != ca_connected) { CL_NextDemo(); } break; + */ } } } @@ -416,10 +442,40 @@ void M_Main_Key(int key) { quake::menu m{"Single Player", &M_Menu_Main_f}; - m.add_action_entry("New Game", &M_Menu_NewGame_f); + m.add_action_entry("Tutorial", [] { M_Menu_NewGame_f("vrtutorial"); }); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + m.add_action_entry("New Game", [] { M_Menu_NewGame_f("start"); }); m.add_action_entry("Load", &M_Menu_Load_f); m.add_action_entry("Save", &M_Menu_Save_f); + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + { + const std::vector<std::string>& loadedPakNames = + VR_GetLoadedPakNamesWithStartMaps(); + + auto e = + m.add_cvar_entry<int>("Start map from:", vr_activestartpaknameidx, + {1, 0, static_cast<int>(loadedPakNames.size()) - 1}); + + e.tooltip( + "When multiple '.pak' are placed in the 'Id1' folder, the starting " + "map will be overwritten by the last '.pak' file. This option " + "allows you to choose what '.pak' file to get the starting map " + "from."); + + e->_printer = [&](char* buf, const int buf_size, const int x) { + snprintf(buf, buf_size, "%s", + loadedPakNames[x % loadedPakNames.size()].data()); + }; + } + return m; } @@ -450,60 +506,23 @@ void M_SinglePlayer_Key(int key) //============================================================================= /* LOAD/SAVE MENU */ -int load_cursor; // 0 < load_cursor < MAX_SAVEGAMES - -#define MAX_SAVEGAMES 20 /* johnfitz -- increased from 12 */ -char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH + 1]; -int loadable[MAX_SAVEGAMES]; - -void M_ScanSaves() -{ - int i; - - int j; - char name[MAX_OSPATH]; - FILE* f; - int version; - - for(i = 0; i < MAX_SAVEGAMES; i++) - { - strcpy(m_filenames[i], "--- UNUSED SLOT ---"); - loadable[i] = false; - q_snprintf(name, sizeof(name), "%s/s%i.sav", com_gamedir, i); - f = fopen(name, "r"); - if(!f) - { - continue; - } - fscanf(f, "%i\n", &version); - fscanf(f, "%79s\n", name); - q_strlcpy(m_filenames[i], name, SAVEGAME_COMMENT_LENGTH + 1); - - // change _ back to space - for(j = 0; j < SAVEGAME_COMMENT_LENGTH; j++) - { - if(m_filenames[i][j] == '_') - { - m_filenames[i][j] = ' '; - } - } - loadable[i] = true; - fclose(f); - } -} +std::size_t save_cursor; // 0 < save_cursor < MAX_SAVEGAMES +std::size_t load_cursor; // 0 < load_cursor < MAX_SAVEGAMES + MAX_AUTOSAVES -void M_Menu_NewGame_f() +void M_Menu_NewGame_f(const char* map) { IN_Activate(); key_dest = key_game; + if(sv.active) { Cbuf_AddText("disconnect\n"); } + Cbuf_AddText("maxplayers 1\n"); Cbuf_AddText("deathmatch 0\n"); // johnfitz Cbuf_AddText("coop 0\n"); // johnfitz - Cbuf_AddText("map start\n"); + Cbuf_AddText(va("map %s\n", map)); } void M_Menu_Load_f() @@ -513,7 +532,8 @@ void M_Menu_Load_f() IN_Deactivate(modestate == MS_WINDOWED); key_dest = key_menu; - M_ScanSaves(); + + quake::saveutil::scanSaves(); } void M_Menu_Save_f() @@ -522,56 +542,76 @@ void M_Menu_Save_f() { return; } + if(cl.intermission) { return; } + if(svs.maxclients != 1) { return; } + m_entersound = true; m_state = m_save; IN_Deactivate(modestate == MS_WINDOWED); key_dest = key_menu; - M_ScanSaves(); + + quake::saveutil::scanSaves(); } void M_Load_Draw() { - int i; - qpic_t* p; - - p = Draw_CachePic("gfx/p_load.lmp"); + qpic_t* p = Draw_CachePic("gfx/p_load.lmp"); M_DrawPic((320 - p->width) / 2, 4, p); - for(i = 0; i < MAX_SAVEGAMES; i++) + for(std::size_t i = 0; i < MAX_SAVEGAMES; i++) + { + M_Print(16, 32 + 8 * i, quake::saveutil::nthSaveFilename(i)); + } + + for(std::size_t i = 0; i < MAX_AUTOSAVES; i++) { - M_Print(16, 32 + 8 * i, m_filenames[i]); + M_PrintWhite(16, (8 * (MAX_SAVEGAMES + 1)) + 32 + 8 * i, "(AUTO)"); + + M_Print(70, (8 * (MAX_SAVEGAMES + 1)) + 32 + 8 * i, + quake::saveutil::nthAutosaveFilename(i)); + + char buf[24]{'\0'}; + + if(quake::saveutil::isNthAutosaveLoadable(i)) + { + std::strftime(buf, sizeof(buf), "%F %T", + std::localtime(&quake::saveutil::nthAutosaveTimestamp(i))); + } + + M_PrintWhite(370, (8 * (MAX_SAVEGAMES + 1)) + 32 + 8 * i, buf); } // line cursor - M_DrawCharacter(8, 32 + load_cursor * 8, 12 + ((int)(realtime * 4) & 1)); + const int cursorX = (load_cursor < MAX_SAVEGAMES) + ? (32 + load_cursor * 8) + : (32 + (load_cursor + 1) * 8); + + M_DrawCharacter(8, cursorX, 12 + ((int)(realtime * 4) & 1)); } void M_Save_Draw() { - int i; - qpic_t* p; - - p = Draw_CachePic("gfx/p_save.lmp"); + qpic_t* p = Draw_CachePic("gfx/p_save.lmp"); M_DrawPic((320 - p->width) / 2, 4, p); - for(i = 0; i < MAX_SAVEGAMES; i++) + for(std::size_t i = 0; i < MAX_SAVEGAMES; i++) { - M_Print(16, 32 + 8 * i, m_filenames[i]); + M_Print(16, 32 + 8 * i, quake::saveutil::nthSaveFilename(i)); } // line cursor - M_DrawCharacter(8, 32 + load_cursor * 8, 12 + ((int)(realtime * 4) & 1)); + M_DrawCharacter(8, 32 + save_cursor * 8, 12 + ((int)(realtime * 4) & 1)); } @@ -585,11 +625,27 @@ void M_Load_Key(int k) case K_ENTER: case K_KP_ENTER: case K_ABUTTON: + { S_LocalSound("misc/menu2.wav"); - if(!loadable[load_cursor]) + + if(load_cursor < MAX_SAVEGAMES) { - return; + if(!quake::saveutil::isNthSaveLoadable(load_cursor)) + { + return; + } + } + else + { + assert(load_cursor < MAX_SAVEGAMES + MAX_AUTOSAVES); + + if(!quake::saveutil::isNthAutosaveLoadable( + load_cursor - MAX_SAVEGAMES)) + { + return; + } } + m_state = m_none; IN_Activate(); key_dest = key_game; @@ -599,28 +655,50 @@ void M_Load_Key(int k) SCR_BeginLoadingPlaque(); // issue the load command - Cbuf_AddText(va("load s%i\n", load_cursor)); + if(load_cursor < MAX_SAVEGAMES) + { + Cbuf_AddText(va("load s%i\n", load_cursor)); + } + else + { + Cbuf_AddText( + va("load_autosave auto%i\n", load_cursor - MAX_SAVEGAMES)); + } + return; + } case K_UPARROW: case K_LEFTARROW: + { S_LocalSound("misc/menu1.wav"); - load_cursor--; - if(load_cursor < 0) + + if(load_cursor == 0) + { + load_cursor = (MAX_SAVEGAMES + MAX_AUTOSAVES) - 1; + } + else { - load_cursor = MAX_SAVEGAMES - 1; + --load_cursor; } + break; + } case K_DOWNARROW: case K_RIGHTARROW: + { S_LocalSound("misc/menu1.wav"); - load_cursor++; - if(load_cursor >= MAX_SAVEGAMES) + + ++load_cursor; + + if(load_cursor >= (MAX_SAVEGAMES + MAX_AUTOSAVES)) { load_cursor = 0; } + break; + } } } @@ -635,34 +713,103 @@ void M_Save_Key(int k) case K_ENTER: case K_KP_ENTER: case K_ABUTTON: + { m_state = m_none; IN_Activate(); key_dest = key_game; - Cbuf_AddText(va("save s%i\n", load_cursor)); + Cbuf_AddText(va("save s%i\n", save_cursor)); return; + } case K_UPARROW: case K_LEFTARROW: + { S_LocalSound("misc/menu1.wav"); - load_cursor--; - if(load_cursor < 0) + + if(save_cursor == 0) + { + save_cursor = MAX_SAVEGAMES - 1; + } + else { - load_cursor = MAX_SAVEGAMES - 1; + --save_cursor; } + break; + } case K_DOWNARROW: case K_RIGHTARROW: + { S_LocalSound("misc/menu1.wav"); - load_cursor++; - if(load_cursor >= MAX_SAVEGAMES) + + ++save_cursor; + + if(save_cursor >= MAX_SAVEGAMES) { - load_cursor = 0; + save_cursor = 0; } break; + } } } +//============================================================================= +/* BOT CONTROL MENU */ + +[[nodiscard]] static quake::menu makeBotControlMenu() +{ + const auto runCmd = [](const char* cmd) { + return [cmd] { + quake::menu_util::playMenuSound("items/r_item2.wav", 0.5); + Cmd_ExecuteString(cmd, cmd_source_t::src_command); + }; + }; + + quake::menu m{"Bot Control", &M_Menu_MultiPlayer_f}; + + m.add_action_entry("Add Bot (Team 0)", runCmd("impulse 100")); + m.add_action_entry("Add Bot (Team 1)", runCmd("impulse 101")); + m.add_action_entry("Kick Bot", runCmd("impulse 102")); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + extern cvar_t skill; + m.add_cvar_getter_enum_entry<int>( // + "Skill", // + [] { return &skill; }, // + "Easy", "Normal", "Hard", "Nightmare" // + ); + + return m; +} + +[[nodiscard]] static quake::menu& botControlMenu() +{ + static quake::menu res = makeBotControlMenu(); + return res; +} + +void M_Menu_BotControl_f() +{ + IN_Deactivate(modestate == MS_WINDOWED); + key_dest = key_menu; + m_state = m_botcontrol; + m_entersound = true; +} + +void M_BotControl_Draw() +{ + botControlMenu().draw(); +} + +void M_BotControl_Key(int key) +{ + botControlMenu().key(key); +} + //============================================================================= /* MULTIPLAYER MENU */ @@ -670,9 +817,10 @@ void M_Save_Key(int k) { quake::menu m{"Multi Player", &M_Menu_Main_f}; - m.add_action_entry("Join a Game", &M_Menu_Net_f); - m.add_action_entry("New Game", &M_Menu_Net_f); + m.add_action_entry("Join a Game", &M_Menu_LanConfig_f); + m.add_action_entry("New Game", &M_Menu_LanConfig_f); m.add_action_entry("Setup", &M_Menu_Setup_f); + m.add_action_entry("Bot Control", &M_Menu_BotControl_f); return m; } @@ -693,7 +841,7 @@ void M_Menu_MultiPlayer_f() void M_MultiPlayer_Draw() { - if(!ipxAvailable && !tcpipAvailable) + if(!tcpipAvailable) { M_PrintWhite( (320 / 2) - ((27 * 8) / 2), 148, "No Communications Available"); @@ -955,7 +1103,7 @@ void M_Menu_Net_f() key_dest = key_menu; m_state = m_net; m_entersound = true; - m_net_items = 2; + m_net_items = 1; if(m_net_cursor >= m_net_items) { @@ -976,26 +1124,7 @@ void M_Net_Draw() M_DrawPic((320 - p->width) / 2, 4, p); f = 32; - - if(ipxAvailable) - { - p = Draw_CachePic("gfx/netmen3.lmp"); - } - else - { - p = Draw_CachePic("gfx/dim_ipx.lmp"); - } - M_DrawTransPic(72, f, p); - - f += 19; - if(tcpipAvailable) - { - p = Draw_CachePic("gfx/netmen4.lmp"); - } - else - { - p = Draw_CachePic("gfx/dim_tcp.lmp"); - } + p = Draw_CachePic("gfx/netmen4.lmp"); M_DrawTransPic(72, f, p); f = (320 - 26 * 8) / 2; @@ -1014,7 +1143,6 @@ void M_Net_Draw() void M_Net_Key(int k) { -again: switch(k) { case K_ESCAPE: @@ -1022,18 +1150,12 @@ void M_Net_Key(int k) case K_DOWNARROW: S_LocalSound("misc/menu1.wav"); - if(++m_net_cursor >= m_net_items) - { - m_net_cursor = 0; - } + m_net_cursor = 0; break; case K_UPARROW: S_LocalSound("misc/menu1.wav"); - if(--m_net_cursor < 0) - { - m_net_cursor = m_net_items - 1; - } + m_net_cursor = 0; break; case K_ENTER: @@ -1043,15 +1165,6 @@ void M_Net_Key(int k) M_Menu_LanConfig_f(); break; } - - if(m_net_cursor == 0 && !ipxAvailable) - { - goto again; - } - if(m_net_cursor == 1 && !tcpipAvailable) - { - goto again; - } } //============================================================================= @@ -1248,7 +1361,7 @@ void M_Options_Key(int k) options_cursor = 0; } } - */ + */ } //============================================================================= @@ -1274,6 +1387,12 @@ void M_Options_Key(int k) m.add_cvar_entry<float>("Menu Distance", vr_menu_distance, {1, 24, 256}) .tooltip("Distance of the menu from the anchor point."); + m.add_cvar_getter_enum_entry<int>( // + "Pointer Hand", // + [] { return &vr_menu_mouse_pointer_hand; }, // + "Off-Hand", // + "Main Hand"); + // TODO VR: (P1) menu lerp amount, menu distance follow hand? return m; @@ -1512,6 +1631,11 @@ void M_Options_Key(int k) "Yaw offset for the guns/hands. Only for off-hand. Affects " "aiming."); + m.add_cvar_entry<float>( + "Finger Grip Bias", vr_finger_grip_bias, {0.05f, 0.f, 1.f}); + + m.add_cvar_entry<bool>("Auto close thumb", vr_finger_auto_close_thumb); + return m; } @@ -1618,6 +1742,10 @@ void M_Options_Key(int k) "well, if the weapon is close enough. The shoulder position can be " "tweaked in 'Hotspot Settings'."); + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + m.add_cvar_entry<float>( "2H Aiming Threshold", vr_2h_angle_threshold, {0.05f, -1.f, 1.f}) .tooltip( @@ -1625,6 +1753,13 @@ void M_Options_Key(int k) "two-handed aiming stops. Increase the value for a more strict " "two-handed aiming experience."); + m.add_cvar_entry<bool>( + "Disable 2H Aiming Threshold", vr_2h_disable_angle_threshold); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + m.add_cvar_entry<float>("2H Virtual Stock Factor", vr_2h_virtual_stock_factor, {0.05f, 0.f, 1.f}) .tooltip( @@ -1808,7 +1943,7 @@ void M_Options_Key(int k) m.add_cvar_getter_enum_entry<VrForceGrabMode>( // "Force Grab", // [] { return &vr_forcegrab_mode; }, // - "Disabled", "Parabola", "Linear", "Instant" // + "Disabled", "Linear", "Parabola", "Instant" // ) .tooltip( "When enabled, allows the player to force grab thrown weapons from " @@ -1851,7 +1986,7 @@ void M_Options_Key(int k) } //============================================================================= -/* QUAKE VR SETTINGS MENU - GRAPHICAL SETTINGS */ +/* QUAKE VR SETTINGS MENU - GRAPHICAL SETTINGS */ [[nodiscard]] static quake::menu makeQVRSGraphicalMenu() { @@ -1887,7 +2022,7 @@ void M_Options_Key(int k) } //============================================================================= -/* QUAKE VR SETTINGS MENU - HUD CONFIGURATION */ +/* QUAKE VR SETTINGS MENU - HUD CONFIGURATION */ [[nodiscard]] static quake::menu makeQVRSHudConfigurationMenu() { @@ -1946,7 +2081,7 @@ void M_Options_Key(int k) } //============================================================================= -/* QUAKE VR SETTINGS MENU - HOTSPOT SETTINGS */ +/* QUAKE VR SETTINGS MENU - HOTSPOT SETTINGS */ [[nodiscard]] static quake::menu makeQVRSHotspotMenu() { @@ -2025,7 +2160,7 @@ void M_Options_Key(int k) } //============================================================================= -/* QUAKE VR SETTINGS MENU - TORSO SETTINGS */ +/* QUAKE VR SETTINGS MENU - TORSO SETTINGS */ [[nodiscard]] static quake::menu makeQVRSTorsoMenu() { @@ -2036,7 +2171,7 @@ void M_Options_Key(int k) quake::menu m{"Torso Settings", &M_Menu_QuakeVRSettings_f}; - m.on_key([](int) { + m.on_key([](int, quake::impl::menu_entry&) { // TODO VR: (P2) hackish VR_ModVRTorsoModel(); VR_ModVRLegHolsterModel(); @@ -2097,55 +2232,19 @@ void M_Options_Key(int k) } //============================================================================= -/* QUAKE VR SETTINGS MENU - CHANGE MAP */ - -[[nodiscard]] static quake::menu makeQVRSChangeMapMenu() -{ - using namespace std::literals; - - static const std::array maps{"orig_start"sv, "start"sv, "e1m1"sv, "e1m2"sv, - "e1m3"sv, "e1m4"sv, "e1m5"sv, "e1m6"sv, "e1m7"sv, "e1m8"sv, "e2m1"sv, - "e2m2"sv, "e2m3"sv, "e2m4"sv, "e2m5"sv, "e2m6"sv, "e2m7"sv, "e3m1"sv, - "e3m2"sv, "e3m3"sv, "e3m4"sv, "e3m5"sv, "e3m6"sv, "e3m7"sv, "e4m1"sv, - "e4m2"sv, "e4m3"sv, "e4m4"sv, "e4m5"sv, "e4m6"sv, "e4m7"sv, "e4m8"sv, - "end"sv, "hip1m1"sv, "hip1m2"sv, "hip1m3"sv, "hip1m4"sv, "hip1m5"sv, - "hip2m1"sv, "hip2m2"sv, "hip2m3"sv, "hip2m4"sv, "hip2m5"sv, "hip2m6"sv, - "hip3m1"sv, "hip3m2"sv, "hip3m3"sv, "hip3m4"sv, "hipdm1"sv, "hipend"sv}; - - const auto changeMap = [](const int option) { - return [option] { - quake::menu_util::playMenuSound("items/r_item2.wav", 0.5); - Cmd_ExecuteString(va("map %s", maps[option].data()), src_command); - }; - }; - - // ------------------------------------------------------------------------ - - quake::menu m{"Change Map", &M_Menu_QuakeVRSettings_f, true}; - - int idx{0}; - for(const auto& map : maps) - { - m.add_action_entry(map, changeMap(idx)); - ++idx; - } - - return m; -} - -[[nodiscard]] static quake::menu& qvrsChangeMapMenu() -{ - static quake::menu res = makeQVRSChangeMapMenu(); - return res; -} - -//============================================================================= -/* QUAKE VR SETTINGS MENU - TRANSPARENCY OPTIONS */ +/* QUAKE VR SETTINGS MENU - TRANSPARENCY OPTIONS */ [[nodiscard]] static quake::menu makeQVRSTransparencyOptionsMenu() { quake::menu m{"Transparency Options", &M_Menu_QuakeVRSettings_f}; + m.on_key([](const int key, quake::impl::menu_entry& entry) { + if(key == 'p') + { + quakeVRQuickSettingsMenu().add_entry_ptr(entry); + } + }); + extern cvar_t r_novis; m.add_cvar_entry<bool>("(!) No Vis", r_novis) .tooltip( @@ -2180,6 +2279,39 @@ void M_Options_Key(int k) return res; } +//============================================================================= +/* QUAKE VR QUICK SETTINGS MENU */ + +[[nodiscard]] static quake::menu makeQuakeVRQuickSettingsMenu() +{ + quake::menu m{"Quake VR - Quick Settings", &M_Menu_Main_f}; + return m; +} + +[[nodiscard]] static quake::menu& quakeVRQuickSettingsMenu() +{ + static quake::menu res = makeQuakeVRQuickSettingsMenu(); + return res; +} + +void M_Menu_QuakeVRQuickSettings_f() +{ + IN_Deactivate(modestate == MS_WINDOWED); + key_dest = key_menu; + m_state = m_quakevrquicksettings; + m_entersound = true; +} + +void M_QuakeVRQuickSettings_Draw() +{ + quakeVRQuickSettingsMenu().draw(); +} + +void M_QuakeVRQuickSettings_Key(int k) +{ + quakeVRQuickSettingsMenu().key(k); +} + //============================================================================= /* QUAKE VR SETTINGS MENU */ @@ -2199,13 +2331,12 @@ static void forQVRSMenus(F&& f) f(qvrsHudConfigurationMenu(), m_qvrs_hudconfiguration); f(qvrsHotspotMenu(), m_qvrs_hotspot); f(qvrsTorsoMenu(), m_qvrs_torso); - f(qvrsChangeMapMenu(), m_qvrs_changemap); f(qvrsTransparencyOptionsMenu(), m_qvrs_transparencyoptions); } [[nodiscard]] static quake::menu makeQuakeVRSettingsMenu() { - quake::menu m{"Quake VR Settings", &M_Menu_Main_f}; + quake::menu m{"Quake VR - Settings", &M_Menu_Main_f}; const auto makeGotoMenu = [&](quake::menu& xm, m_state_e s) { m.add_action_entry( @@ -2240,11 +2371,10 @@ void M_QuakeVRSettings_Key(int k) quakeVRSettingsMenu().key(k); } - //============================================================================= -/* QUAKE VR DEV TOOLS MENU - WEAPON CONFIGURATION */ +/* QUAKE VR DEV TOOLS MENU - WEAPON CONFIGURATION (1) */ -[[nodiscard]] static quake::menu makeQVRDTWeaponConfigurationMenu() +[[nodiscard]] static quake::menu makeQVRDTWeaponConfiguration1Menu() { static bool wpnoff_offhand = false; @@ -2256,7 +2386,7 @@ void M_QuakeVRSettings_Key(int k) const float oInc = 0.1f; constexpr float oBound = 100.f; - const float rInc = 0.1f; + const float rInc = 0.2f; constexpr float rBound = 90.f; const quake::menu_bounds<float> oBounds{oInc, -oBound, oBound}; @@ -2264,9 +2394,9 @@ void M_QuakeVRSettings_Key(int k) // ------------------------------------------------------------------------ - quake::menu m{"Weapon Configuration", &M_Menu_QuakeVRDevTools_f}; + quake::menu m{"Weapon Configuration (1)", &M_Menu_QuakeVRDevTools_f}; - m.on_key([](int) { + m.on_key([](int, quake::impl::menu_entry&) { // TODO VR: (P2) hackish VR_ModAllWeapons(); }); @@ -2312,10 +2442,10 @@ void M_QuakeVRSettings_Key(int k) m.add_separator(); // ------------------------------------------------------------------------ - const auto hoverOffset = makeHoverFn(vr_impl_draw_wpnoffset_helper_offset); - const auto hoverMuzzle = makeHoverFn(vr_impl_draw_wpnoffset_helper_muzzle); + const auto hoverOffset = + makeHoverFn(quake::vr::showfn::vr_impl_draw_wpnoffset_helper_offset); const auto hover2HOffset = - makeHoverFn(vr_impl_draw_wpnoffset_helper_2h_offset); + makeHoverFn(quake::vr::showfn::vr_impl_draw_wpnoffset_helper_2h_offset); // ------------------------------------------------------------------------ @@ -2348,6 +2478,9 @@ void M_QuakeVRSettings_Key(int k) m.add_separator(); // ------------------------------------------------------------------------ + const auto hoverMuzzle = + makeHoverFn(quake::vr::showfn::vr_impl_draw_wpnoffset_helper_muzzle); + const char* muzzleTooltip = "Position of the weapon muzzle. Relative to the XYZ offsets above. " "Affected by the weapon model scale. DOES affect aiming. Bullets and " @@ -2363,6 +2496,16 @@ void M_QuakeVRSettings_Key(int k) .hover(hoverMuzzle) .tooltip(muzzleTooltip); + m.add_cvar_getter_entry<int>( // + "Muzzle Anchor Vertex", // + [getIdx] { + return &VR_GetWpnCVar(getIdx(), WpnCVar::MuzzleAnchorVertex); + }, // + {1, 0, 4096} // + ) + .hover(hoverMuzzle) + .tooltip("Index of the mesh vertex where the muzzle will be attached."); + // ------------------------------------------------------------------------ m.add_separator(); // ------------------------------------------------------------------------ @@ -2397,14 +2540,14 @@ void M_QuakeVRSettings_Key(int k) return m; } -[[nodiscard]] static quake::menu& qvrdtWeaponConfigurationMenu() +[[nodiscard]] static quake::menu& qvrdtWeaponConfiguration1Menu() { - static quake::menu res = makeQVRDTWeaponConfigurationMenu(); + static quake::menu res = makeQVRDTWeaponConfiguration1Menu(); return res; } //============================================================================= -/* QUAKE VR DEV TOOLS MENU - WEAPON CONFIGURATION 2 */ +/* QUAKE VR DEV TOOLS MENU - WEAPON CONFIGURATION (2) */ [[nodiscard]] static quake::menu makeQVRDTWeaponConfiguration2Menu() { @@ -2418,7 +2561,7 @@ void M_QuakeVRSettings_Key(int k) const float oInc = 0.1f; constexpr float oBound = 100.f; - const float rInc = 0.1f; + const float rInc = 0.2f; constexpr float rBound = 180.f; const quake::menu_bounds<float> oBounds{oInc, -oBound, oBound}; @@ -2428,7 +2571,7 @@ void M_QuakeVRSettings_Key(int k) quake::menu m{"Weapon Configuration (2)", &M_Menu_QuakeVRDevTools_f}; - m.on_key([](int) { + m.on_key([](int, quake::impl::menu_entry&) { // TODO VR: (P2) hackish VR_ModAllWeapons(); }); @@ -2482,9 +2625,9 @@ void M_QuakeVRSettings_Key(int k) // ------------------------------------------------------------------------ const auto hoverHandAnchorVertex = - makeHoverFn(vr_impl_draw_hand_anchor_vertex); + makeHoverFn(quake::vr::showfn::vr_impl_draw_hand_anchor_vertex); const auto hover2HHandAnchorVertex = - makeHoverFn(vr_impl_draw_2h_hand_anchor_vertex); + makeHoverFn(quake::vr::showfn::vr_impl_draw_2h_hand_anchor_vertex); // ------------------------------------------------------------------------ @@ -2496,7 +2639,7 @@ void M_QuakeVRSettings_Key(int k) [getIdx] { return &VR_GetWpnCVar(getIdx(), WpnCVar::HandAnchorVertex); }, // - {1, 0, 1024} // + {1, 0, 4096} // ) .hover(hoverHandAnchorVertex) .tooltip( @@ -2525,7 +2668,7 @@ void M_QuakeVRSettings_Key(int k) [getIdx] { return &VR_GetWpnCVar(getIdx(), WpnCVar::TwoHHandAnchorVertex); }, // - {1, 0, 1024} // + {1, 0, 4096} // ) .hover(hover2HHandAnchorVertex) .tooltip( @@ -2549,20 +2692,6 @@ void M_QuakeVRSettings_Key(int k) m.add_separator(); // ------------------------------------------------------------------------ - const char* offHandOffsetTooltip = - "Visual offset of the hand, relative to the above hand offset."; - - o_wpncvar("Off-Hand X", WpnCVar::OffHandOffsetX) - .tooltip(offHandOffsetTooltip); - o_wpncvar("Off-Hand Y", WpnCVar::OffHandOffsetY) - .tooltip(offHandOffsetTooltip); - o_wpncvar("Off-Hand Z", WpnCVar::OffHandOffsetZ) - .tooltip(offHandOffsetTooltip); - - // ------------------------------------------------------------------------ - m.add_separator(); - // ------------------------------------------------------------------------ - m.add_cvar_getter_enum_entry<Wpn2HMode>( // "2H Mode", // [getIdx] { return &VR_GetWpnCVar(getIdx(), WpnCVar::TwoHMode); }, // @@ -2654,7 +2783,7 @@ void M_QuakeVRSettings_Key(int k) quake::menu m{"Weapon Configuration (3)", &M_Menu_QuakeVRDevTools_f}; - m.on_key([](int) { + m.on_key([](int, quake::impl::menu_entry&) { // TODO VR: (P2) hackish VR_ModAllWeapons(); }); @@ -2730,12 +2859,210 @@ void M_QuakeVRSettings_Key(int k) } //============================================================================= -/* QUAKE VR DEV TOOLS MENU - DEBUG UTILITIES */ +/* QUAKE VR DEV TOOLS MENU - WEAPON CONFIGURATION (4) */ -[[nodiscard]] static quake::menu makeQVRDTDebugUtilitiesMenu() +[[nodiscard]] static quake::menu makeQVRDTWeaponConfiguration4Menu() { - const auto runCmd = [](const char* cmd) { - return [cmd] { + static bool wpnoff_offhand = false; + + const auto getIdx = [] { + return wpnoff_offhand ? VR_GetOffHandWpnCvarEntry() + : VR_GetMainHandWpnCvarEntry(); + }; + + const float oInc = 0.1f; + constexpr float oBound = 100.f; + + const float rInc = 0.2f; + constexpr float rBound = 180.f; + + const quake::menu_bounds<float> oBounds{oInc, -oBound, oBound}; + const quake::menu_bounds<float> rBounds{rInc, -rBound, rBound}; + const quake::menu_bounds<float> zbBounds{0.05f, 0.f, 1.f}; + + // ------------------------------------------------------------------------ + + quake::menu m{"Weapon Configuration (4)", &M_Menu_QuakeVRDevTools_f}; + + m.on_key([](int, quake::impl::menu_entry&) { + // TODO VR: (P2) hackish + VR_ModAllWeapons(); + }); + + // ------------------------------------------------------------------------ + + const auto o_wpncvar = [&](const char* title, const WpnCVar c) { + return m.add_cvar_getter_entry<float>( // + title, // + [getIdx, c] { return &VR_GetWpnCVar(getIdx(), c); }, // + oBounds // + ); + }; + + const auto r_wpncvar = [&](const char* title, const WpnCVar c) { + return m.add_cvar_getter_entry<float>( // + title, // + [getIdx, c] { return &VR_GetWpnCVar(getIdx(), c); }, // + rBounds // + ); + }; + + const auto zb_wpncvar = [&](const char* title, const WpnCVar c) { + return m.add_cvar_getter_entry<float>( // + title, // + [getIdx, c] { return &VR_GetWpnCVar(getIdx(), c); }, // + zbBounds // + ); + }; + + const auto makeHoverFn = [&](int& implVar) { + return [&](const bool x) { + if(!x) + { + implVar = 0; + return; + } + + implVar = wpnoff_offhand ? 2 : 1; + }; + }; + + // ------------------------------------------------------------------------ + + m.add_getter_entry<bool>( // + "Off-Hand", // + [] { return &wpnoff_offhand; } // + ); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + m.add_cvar_getter_enum_entry<WpnButtonMode>( // + "Button Mode", // + [getIdx] { + return &VR_GetWpnCVar(getIdx(), WpnCVar::WpnButtonMode); + }, // + "Disabled", "Ammo Type Change" // + ) + .tooltip("Type of button."); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + const char* btnOffsetTooltip = "Offset of the weapon button."; + + o_wpncvar("Button X", WpnCVar::WpnButtonX).tooltip(btnOffsetTooltip); + o_wpncvar("Button Y", WpnCVar::WpnButtonY).tooltip(btnOffsetTooltip); + o_wpncvar("Button Z", WpnCVar::WpnButtonZ).tooltip(btnOffsetTooltip); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + const char* btnAngleTooltip = "Angle offset of the weapon button."; + + r_wpncvar("Button Pitch", WpnCVar::WpnButtonPitch).tooltip(btnAngleTooltip); + r_wpncvar("Button Yaw", WpnCVar::WpnButtonYaw).tooltip(btnAngleTooltip); + r_wpncvar("Button Roll", WpnCVar::WpnButtonRoll).tooltip(btnAngleTooltip); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + const auto hoverWpnButtonAnchorVertex = + makeHoverFn(quake::vr::showfn::vr_impl_draw_wpnbutton_anchor_vertex); + + m.add_cvar_getter_entry<int>( // + "Button Anchor Vertex", // + [getIdx] { + return &VR_GetWpnCVar(getIdx(), WpnCVar::WpnButtonAnchorVertex); + }, // + {1, 0, 4096} // + ) + .hover(hoverWpnButtonAnchorVertex) + .tooltip("Index of the mesh vertex where the button will be attached."); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + const char* zbTooltip = + "Blending factor of the weapon animation with the zeroth frame. Useful " + "to adjust recoil animations."; + + zb_wpncvar("Zero Blend", WpnCVar::ZeroBlend).tooltip(zbTooltip); + zb_wpncvar("2H Zero Blend", WpnCVar::TwoHZeroBlend).tooltip(zbTooltip); + + return m; +} + +[[nodiscard]] static quake::menu& qvrdtWeaponConfiguration4Menu() +{ + static quake::menu res = makeQVRDTWeaponConfiguration4Menu(); + return res; +} + +//============================================================================= +/* QUAKE VR DEV TOOLS MENU - FINGER CONFIGURATION */ + +[[nodiscard]] static quake::menu makeQVRDTFingerConfigurationMenu() +{ + const float oInc = 0.025f; + constexpr float oBound = 100.f; + + const quake::menu_bounds<float> oBounds{oInc, -oBound, oBound}; + + // ------------------------------------------------------------------------ + + quake::menu m{"Finger Configuration", &M_Menu_QuakeVRDevTools_f}; + + // ------------------------------------------------------------------------ + +#define MAKE_XYZ_CONTROLS(name, cvar_family_prefix) \ + { \ + m.add_cvar_entry<float>(name " X", cvar_family_prefix##_x, oBounds); \ + m.add_cvar_entry<float>(name " Y", cvar_family_prefix##_y, oBounds); \ + m.add_cvar_entry<float>(name " Z", cvar_family_prefix##_z, oBounds); \ + m.add_separator(); \ + } + + MAKE_XYZ_CONTROLS("All Fingers And Base", vr_fingers_and_base); + MAKE_XYZ_CONTROLS( + "All Fingers And Base (Off-Hand)", vr_fingers_and_base_offhand); + MAKE_XYZ_CONTROLS("All Fingers", vr_fingers); + MAKE_XYZ_CONTROLS("Thumb", vr_finger_thumb); + MAKE_XYZ_CONTROLS("Index", vr_finger_index); + MAKE_XYZ_CONTROLS("Middle", vr_finger_middle); + MAKE_XYZ_CONTROLS("Ring", vr_finger_ring); + MAKE_XYZ_CONTROLS("Pinky", vr_finger_pinky); + MAKE_XYZ_CONTROLS("Base", vr_finger_base); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + m.add_cvar_entry<bool>("Finger Blending", vr_finger_blending); + m.add_cvar_entry<float>( + "Finger Blending Speed", vr_finger_blending_speed, {0.5f, 0.f, 100.f}); + + return m; +} + +[[nodiscard]] static quake::menu& qvrdtFingerConfigurationMenu() +{ + static quake::menu res = makeQVRDTFingerConfigurationMenu(); + return res; +} + +//============================================================================= +/* QUAKE VR DEV TOOLS MENU - DEBUG UTILITIES */ + +[[nodiscard]] static quake::menu makeQVRDTDebugUtilitiesMenu() +{ + const auto runCmd = [](const char* cmd) { + return [cmd] { quake::menu_util::playMenuSound("items/r_item2.wav", 0.5); Cmd_ExecuteString(cmd, cmd_source_t::src_command); }; @@ -2745,9 +3072,43 @@ void M_QuakeVRSettings_Key(int k) quake::menu m{"Debug Utilities", &M_Menu_QuakeVRDevTools_f}; + m.add_cvar_entry<bool>( + "Force-grabbable ammo items", vr_forcegrabbable_ammo_boxes); + + m.add_cvar_entry<bool>( + "Force-grabbable health items", vr_forcegrabbable_health_boxes); + + m.add_cvar_entry<float>("Return item time (DM)", + vr_forcegrabbable_return_time_deathmatch, {0.5f, 0.f, 50.f}); + + m.add_cvar_entry<float>("Return item time (SP)", + vr_forcegrabbable_return_time_singleplayer, {0.5f, 0.f, 50.f}); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + m.add_cvar_entry<float>("Throw Up Center Of Mass", + vr_throw_up_center_of_mass, {0.01f, 0.f, 10.f}); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + m.add_cvar_entry<int>("Autosave Period", vr_autosave_seconds, {5, 5, 2400}); + m.add_cvar_entry<bool>( + "Autosave On Changelevel", vr_autosave_on_changelevel); + m.add_cvar_entry<bool>("Autosave Messages", vr_autosave_show_message); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + m.add_action_entry("Impulse 9 (Give All)", runCmd("impulse 9")); m.add_action_entry("Impulse 11 (Rune)", runCmd("impulse 11")); m.add_action_entry("Impulse 14 (Spawn All)", runCmd("impulse 14")); + m.add_action_entry("Impulse 17 (Spawn Grapple)", runCmd("impulse 17")); + m.add_action_entry("Impulse 254 (Invisibility)", runCmd("impulse 254")); m.add_action_entry("Impulse 255 (Quad)", runCmd("impulse 255")); m.add_action_entry("God Mode", runCmd("god")); m.add_action_entry("Noclip", runCmd("noclip")); @@ -2779,12 +3140,11 @@ void M_QuakeVRSettings_Key(int k) m.add_cvar_entry<bool>("Fake VR Mode", vr_fakevr); - m.add_cvar_entry<bool>("Enable Grapple Gun", vr_enable_grapple); - extern cvar_t host_timescale; m.add_cvar_entry<float>("Timescale", host_timescale, {0.05f, 0.f, 5.f}); m.add_cvar_entry<bool>("Print Handvel", vr_debug_print_handvel); + m.add_cvar_entry<bool>("Print Headvel", vr_debug_print_headvel); m.add_cvar_entry<bool>("Show Hand Pos/Rot", vr_debug_show_hand_pos_and_rot); // ------------------------------------------------------------------------ @@ -2820,15 +3180,17 @@ void M_QuakeVRSettings_Key(int k) template <typename F> static void forQVRDTMenus(F&& f) { - f(qvrdtWeaponConfigurationMenu(), m_qvrdt_weaponconfiguration); + f(qvrdtWeaponConfiguration1Menu(), m_qvrdt_weaponconfiguration1); f(qvrdtWeaponConfiguration2Menu(), m_qvrdt_weaponconfiguration2); f(qvrdtWeaponConfiguration3Menu(), m_qvrdt_weaponconfiguration3); + f(qvrdtWeaponConfiguration4Menu(), m_qvrdt_weaponconfiguration4); + f(qvrdtFingerConfigurationMenu(), m_qvrdt_fingerconfiguration); f(qvrdtDebugUtilitiesMenu(), m_qvrdt_debugutilities); } [[nodiscard]] static quake::menu makeQuakeVRDevToolsMenu() { - quake::menu m{"Quake VR Dev Tools", &M_Menu_Main_f}; + quake::menu m{"Quake VR - Dev Tools", &M_Menu_Main_f}; const auto makeGotoMenu = [&](quake::menu& xm, m_state_e s) { m.add_action_entry( @@ -2863,6 +3225,235 @@ void M_QuakeVRDevTools_Key(int k) quakeVRDevToolsMenu().key(k); } +//============================================================================= +/* QUAKE VR CHANGE MAP - IMPL */ + +enum class ChangeMapCommand : int +{ + Map = 0, + Changelevel = 1, +}; + +[[nodiscard]] static int& getChangeMapCommand() +{ + static int cmd{static_cast<int>(ChangeMapCommand::Map)}; + return cmd; +} + +template <typename Range> +[[nodiscard]] static quake::menu makeQVRCMChangeMapMenuImpl( + const std::string_view name, const Range& maps) +{ + const auto changeMap = [&maps](const int option) { + return [&maps, option] { + quake::menu_util::playMenuSound("items/r_item2.wav", 0.5); + + const char* cmd = + static_cast<ChangeMapCommand>(getChangeMapCommand()) == + ChangeMapCommand::Map + ? "map" + : "changelevel"; + + Cmd_ExecuteString( + va("%s %s", cmd, maps[option].data()), src_command); + }; + }; + + // ------------------------------------------------------------------------ + + quake::menu m{name, &M_Menu_QuakeVRChangeMap_f, true}; + + int idx{0}; + for(const auto& map : maps) + { + m.add_action_entry(map, changeMap(idx)); + ++idx; + } + + return m; +} + +using namespace std::literals; + +constexpr std::array mapsVanilla{"e1m1"sv, "e1m2"sv, "e1m3"sv, "e1m4"sv, + "e1m5"sv, "e1m6"sv, "e1m7"sv, "e1m8"sv, "e2m1"sv, "e2m2"sv, "e2m3"sv, + "e2m4"sv, "e2m5"sv, "e2m6"sv, "e2m7"sv, "e3m1"sv, "e3m2"sv, "e3m3"sv, + "e3m4"sv, "e3m5"sv, "e3m6"sv, "e3m7"sv, "e4m1"sv, "e4m2"sv, "e4m3"sv, + "e4m4"sv, "e4m5"sv, "e4m6"sv, "e4m7"sv, "e4m8"sv, "end"sv}; + +constexpr std::array mapsSoa{"hip1m1"sv, "hip1m2"sv, "hip1m3"sv, "hip1m4"sv, + "hip1m5"sv, "hip2m1"sv, "hip2m2"sv, "hip2m3"sv, "hip2m4"sv, "hip2m5"sv, + "hip2m6"sv, "hip3m1"sv, "hip3m2"sv, "hip3m3"sv, "hip3m4"sv, "hipdm1"sv, + "hipend"sv}; + +constexpr std::array mapsDoe{"r1m1"sv, "r1m2"sv, "r1m3"sv, "r1m4"sv, "r1m5"sv, + "r1m6"sv, "r1m7"sv, "r2m1"sv, "r2m2"sv, "r2m3"sv, "r2m4"sv, "r2m5"sv, + "r2m6"sv, "r2m7"sv, "r2m8"sv, "ctf1"sv}; + +constexpr std::array mapsDopa{"e5m1"sv, "e5m2"sv, "e5m3"sv, "e5m4"sv, "e5m5"sv, + "e5m6"sv, "e5m7"sv, "e5m8"sv, "e5end"sv, "e5dm"sv}; + +constexpr std::array mapsHoney{ + "saint"sv, "honey"sv, "h_hub1"sv, "h_hub2"sv, "h_end"sv, "credits"sv}; + +//============================================================================= +/* QUAKE VR CHANGE MAP - VANILLA */ + +[[nodiscard]] static quake::menu makeQVRCMVanillaMenu() +{ + return makeQVRCMChangeMapMenuImpl("Vanilla", mapsVanilla); +} + +[[nodiscard]] static quake::menu& qvrcmVanillaMenu() +{ + static quake::menu res = makeQVRCMVanillaMenu(); + return res; +} + +//============================================================================= +/* QUAKE VR CHANGE MAP - SOA */ + +[[nodiscard]] static quake::menu makeQVRCMSoaMenu() +{ + return makeQVRCMChangeMapMenuImpl("Scourge of Armagon", mapsSoa); +} + +[[nodiscard]] static quake::menu& qvrcmSoaMenu() +{ + static quake::menu res = makeQVRCMSoaMenu(); + return res; +} + +//============================================================================= +/* QUAKE VR CHANGE MAP - DOE */ + +[[nodiscard]] static quake::menu makeQVRCMDoeMenu() +{ + return makeQVRCMChangeMapMenuImpl("Dissolution of Eternity", mapsDoe); +} + +[[nodiscard]] static quake::menu& qvrcmDoeMenu() +{ + static quake::menu res = makeQVRCMDoeMenu(); + return res; +} + +//============================================================================= +/* QUAKE VR CHANGE MAP - DOPA */ + +[[nodiscard]] static quake::menu makeQVRCMDopaMenu() +{ + return makeQVRCMChangeMapMenuImpl("Dimensions of the Past", mapsDopa); +} + +[[nodiscard]] static quake::menu& qvrcmDopaMenu() +{ + static quake::menu res = makeQVRCMDopaMenu(); + return res; +} + +//============================================================================= +/* QUAKE VR CHANGE MAP - HONEY */ + +[[nodiscard]] static quake::menu makeQVRCMHoneyMenu() +{ + return makeQVRCMChangeMapMenuImpl("Honey (czg)", mapsHoney); +} + +[[nodiscard]] static quake::menu& qvrcmHoneyMenu() +{ + static quake::menu res = makeQVRCMHoneyMenu(); + return res; +} + +//============================================================================= +/* QUAKE VR CHANGE MAP - EXTRA */ + +[[nodiscard]] static quake::menu makeQVRCMExtraMenu() +{ + static std::vector<std::string_view> mapsExtra; + + int i; + filelist_item_t* level; + + for(level = extralevels, i = 0; level; level = level->next, i++) + { + mapsExtra.emplace_back(level->name); + } + + return makeQVRCMChangeMapMenuImpl("Custom Maps", mapsExtra); +} + +[[nodiscard]] static quake::menu& qvrcmExtraMenu() +{ + static quake::menu res = makeQVRCMExtraMenu(); + return res; +} + + +//============================================================================= +/* QUAKE VR CHANGE MAP MENU */ + +template <typename F> +static void forQVRCMMenus(F&& f) +{ + f(qvrcmVanillaMenu(), m_qvrs_changemap_vanilla); + f(qvrcmSoaMenu(), m_qvrs_changemap_soa); + f(qvrcmDoeMenu(), m_qvrs_changemap_doe); + f(qvrcmDopaMenu(), m_qvrs_changemap_dopa); + f(qvrcmHoneyMenu(), m_qvrs_changemap_honey); + f(qvrcmExtraMenu(), m_qvrs_changemap_extra); +} + +[[nodiscard]] static quake::menu makeQuakeVRChangeMap() +{ + quake::menu m{"Quake VR - Change Map", &M_Menu_Main_f}; + + const auto makeGotoMenu = [&](quake::menu& xm, m_state_e s) { + m.add_action_entry( + xm.title(), [&xm, s] { quake::menu_util::setMenuState(xm, s); }); + }; + + m.add_getter_enum_entry<ChangeMapCommand>( // + "Preserve Equipment", // + [] { return &getChangeMapCommand(); }, // + "No (map)", // + "Yes (changelevel)" // + ); + + // ------------------------------------------------------------------------ + m.add_separator(); + // ------------------------------------------------------------------------ + + forQVRCMMenus(makeGotoMenu); + + return m; +} + +[[nodiscard]] static quake::menu& quakeVRChangeMapMenu() +{ + static quake::menu res = makeQuakeVRChangeMap(); + return res; +} + +void M_Menu_QuakeVRChangeMap_f() +{ + IN_Deactivate(modestate == MS_WINDOWED); + key_dest = key_menu; + m_state = m_quakevrchangemap; + m_entersound = true; +} + +void M_QuakeVRChangeMap_Draw() +{ + quakeVRChangeMapMenu().draw(); +} + +void M_QuakeVRChangeMap_Key(int k) +{ + quakeVRChangeMapMenu().key(k); +} + //============================================================================= /* KEYS MENU */ @@ -3192,6 +3783,12 @@ void M_Quit_Key(int key) m_state = m_none; } } + else + { + IN_Deactivate(modestate == MS_WINDOWED); + key_dest = key_console; + Host_Quit_f(); + } } @@ -3234,7 +3831,7 @@ bool M_Quit_TextEntry() void M_Quit_Draw() // johnfitz -- modified for new quit message { - char msg1[40]; + char msg1[64]; char msg2[] = "by Vittorio Romeo, Ozkan Sezer, Eric Wasylishen, others"; /* msg2/msg3 are mostly [40] */ @@ -3252,15 +3849,15 @@ void M_Quit_Draw() // johnfitz -- modified for new quit message sprintf(msg1, "QuakeSpasm " QUAKESPASM_VER_STRING); // okay, this is kind of fucked up. M_DrawTextBox will always act as if - // width is even. Also, the width and lines values are for the interior of - // the box, but the x and y values include the border. + // width is even. Also, the width and lines values are for the interior + // of the box, but the x and y values include the border. boxlen = q_max(strlen(msg1), q_max((sizeof(msg2) - 1), (sizeof(msg3) - 1))) + 1; if(boxlen & 1) { boxlen++; } - M_DrawTextBox(160 - 4 * (boxlen + 2), 76, boxlen, 4); + M_DrawTextBox(260 - 4 * (boxlen + 2), 76, boxlen, 4); // now do the text M_Print(260 - 4 * strlen(msg1), 88, msg1); @@ -3287,7 +3884,7 @@ void M_Menu_LanConfig_f() m_entersound = true; if(lanConfig_cursor == -1) { - if(JoiningGame && TCPIPConfig) + if(JoiningGame) { lanConfig_cursor = 2; } @@ -3328,26 +3925,14 @@ void M_LanConfig_Draw() { startJoin = "Join Game"; } - if(IPXConfig) - { - protocol = "IPX"; - } - else - { - protocol = "TCP/IP"; - } + + protocol = "TCP/IP"; + M_Print(basex, 32, va("%s - %s", startJoin, protocol)); basex += 8; M_Print(basex, 52, "Address:"); - if(IPXConfig) - { - M_Print(basex + 9 * 8, 52, my_ipx_address); - } - else - { - M_Print(basex + 9 * 8, 52, my_tcpip_address); - } + M_Print(basex + 9 * 8, 52, my_tcpip_address); M_Print(basex, lanConfig_cursor_table[0], "Port"); M_DrawTextBox(basex + 8 * 8, lanConfig_cursor_table[0] - 8, 6, 1); @@ -3395,7 +3980,7 @@ void M_LanConfig_Key(int key) switch(key) { case K_ESCAPE: - case K_BBUTTON: M_Menu_Net_f(); break; + case K_BBUTTON: M_Menu_MultiPlayer_f(); break; case K_UPARROW: S_LocalSound("misc/menu1.wav"); @@ -3539,96 +4124,119 @@ typedef struct const char* description; } level_t; -level_t levels[] = {{"start", "Entrance"}, // 0 - - {"e1m1", "Slipgate Complex"}, // 1 - {"e1m2", "Castle of the Damned"}, {"e1m3", "The Necropolis"}, - {"e1m4", "The Grisly Grotto"}, {"e1m5", "Gloom Keep"}, - {"e1m6", "The Door To Chthon"}, {"e1m7", "The House of Chthon"}, - {"e1m8", "Ziggurat Vertigo"}, - - {"e2m1", "The Installation"}, // 9 - {"e2m2", "Ogre Citadel"}, {"e2m3", "Crypt of Decay"}, - {"e2m4", "The Ebon Fortress"}, {"e2m5", "The Wizard's Manse"}, - {"e2m6", "The Dismal Oubliette"}, {"e2m7", "Underearth"}, - - {"e3m1", "Termination Central"}, // 16 - {"e3m2", "The Vaults of Zin"}, {"e3m3", "The Tomb of Terror"}, - {"e3m4", "Satan's Dark Delight"}, {"e3m5", "Wind Tunnels"}, - {"e3m6", "Chambers of Torment"}, {"e3m7", "The Haunted Halls"}, - - {"e4m1", "The Sewage System"}, // 23 - {"e4m2", "The Tower of Despair"}, {"e4m3", "The Elder God Shrine"}, - {"e4m4", "The Palace of Hate"}, {"e4m5", "Hell's Atrium"}, - {"e4m6", "The Pain Maze"}, {"e4m7", "Azure Agony"}, - {"e4m8", "The Nameless City"}, - - {"end", "Shub-Niggurath's Pit"}, // 31 - - {"dm1", "Place of Two Deaths"}, // 32 - {"dm2", "Claustrophobopolis"}, {"dm3", "The Abandoned Base"}, - {"dm4", "The Bad Place"}, {"dm5", "The Cistern"}, {"dm6", "The Dark Zone"}}; - -// MED 01/06/97 added hipnotic levels -level_t hipnoticlevels[] = { - {"start", "Command HQ"}, // 0 - - {"hip1m1", "The Pumping Station"}, // 1 - {"hip1m2", "Storage Facility"}, {"hip1m3", "The Lost Mine"}, - {"hip1m4", "Research Facility"}, {"hip1m5", "Military Complex"}, - - {"hip2m1", "Ancient Realms"}, // 6 - {"hip2m2", "The Black Cathedral"}, {"hip2m3", "The Catacombs"}, - {"hip2m4", "The Crypt"}, {"hip2m5", "Mortum's Keep"}, - {"hip2m6", "The Gremlin's Domain"}, - - {"hip3m1", "Tur Torment"}, // 12 - {"hip3m2", "Pandemonium"}, {"hip3m3", "Limbo"}, {"hip3m4", "The Gauntlet"}, - - {"hipend", "Armagon's Lair"}, // 16 - - {"hipdm1", "The Edge of Oblivion"} // 17 +level_t levels[] = { + + {"e1m1", "Slipgate Complex"}, // 0 + {"e1m2", "Castle of the Damned"}, // 1 + {"e1m3", "The Necropolis"}, // 2 + {"e1m4", "The Grisly Grotto"}, // 3 + {"e1m5", "Gloom Keep"}, // 4 + {"e1m6", "The Door To Chthon"}, // 5 + {"e1m7", "The House of Chthon"}, // 6 + {"e1m8", "Ziggurat Vertigo"}, // 7 + + {"e2m1", "The Installation"}, // 8 + {"e2m2", "Ogre Citadel"}, // 9 + {"e2m3", "Crypt of Decay"}, // 10 + {"e2m4", "The Ebon Fortress"}, // 11 + {"e2m5", "The Wizard's Manse"}, // 12 + {"e2m6", "The Dismal Oubliette"}, // 13 + {"e2m7", "Underearth"}, // 14 + + {"e3m1", "Termination Central"}, // 15 + {"e3m2", "The Vaults of Zin"}, // 16 + {"e3m3", "The Tomb of Terror"}, // 17 + {"e3m4", "Satan's Dark Delight"}, // 18 + {"e3m5", "Wind Tunnels"}, // 19 + {"e3m6", "Chambers of Torment"}, // 20 + {"e3m7", "The Haunted Halls"}, // 21 + + {"e4m1", "The Sewage System"}, // 22 + {"e4m2", "The Tower of Despair"}, // 23 + {"e4m3", "The Elder God Shrine"}, // 24 + {"e4m4", "The Palace of Hate"}, // 25 + {"e4m5", "Hell's Atrium"}, // 26 + {"e4m6", "The Pain Maze"}, // 27 + {"e4m7", "Azure Agony"}, // 28 + {"e4m8", "The Nameless City"}, // 29 + + {"end", "Shub-Niggurath's Pit"}, // 30 + + {"dm1", "Place of Two Deaths"}, // 31 + {"dm2", "Claustrophobopolis"}, // 32 + {"dm3", "The Abandoned Base"}, // 33 + {"dm4", "The Bad Place"}, // 34 + {"dm5", "The Cistern"}, // 35 + {"dm6", "The Dark Zone"}, // 36 + + {"hip1m1", "The Pumping Station"}, // 37 + {"hip1m2", "Storage Facility"}, // 38 + {"hip1m3", "The Lost Mine"}, // 39 + {"hip1m4", "Research Facility"}, // 40 + {"hip1m5", "Military Complex"}, // 41 + + {"hip2m1", "Ancient Realms"}, // 42 + {"hip2m2", "The Black Cathedral"}, // 43 + {"hip2m3", "The Catacombs"}, // 44 + {"hip2m4", "The Crypt"}, // 45 + {"hip2m5", "Mortum's Keep"}, // 46 + {"hip2m6", "The Gremlin's Domain"}, // 47 + + {"hip3m1", "Tur Torment"}, // 48 + {"hip3m2", "Pandemonium"}, // 49 + {"hip3m3", "Limbo"}, // 50 + {"hip3m4", "The Gauntlet"}, // 51 + + {"hipend", "Armagon's Lair"}, // 52 + + {"hipdm1", "The Edge of Oblivion"}, // 53 + + {"r1m1", "Deviant's Domain"}, // 54 + {"r1m2", "Dread Portal"}, // 55 + {"r1m3", "Judgement Call"}, // 56 + {"r1m4", "Cave of Death"}, // 57 + {"r1m5", "Towers of Wrath"}, // 58 + {"r1m6", "Temple of Pain"}, // 59 + {"r1m7", "Tomb of the Overlord"}, // 60 + + {"r2m1", "Tempus Fugit"}, // 61 + {"r2m2", "Elemental Fury I"}, // 62 + {"r2m3", "Elemental Fury II"}, // 63 + {"r2m4", "Curse of Osiris"}, // 64 + {"r2m5", "Wizard's Keep"}, // 65 + {"r2m6", "Blood Sacrifice"}, // 66 + {"r2m7", "Last Bastion"}, // 67 + {"r2m8", "Source of Evil"}, // 68 + + {"ctf1", "Division of Change"} // 69 }; -// PGM 01/07/97 added rogue levels -// PGM 03/02/97 added dmatch level -level_t roguelevels[] = {{"start", "Split Decision"}, - {"r1m1", "Deviant's Domain"}, {"r1m2", "Dread Portal"}, - {"r1m3", "Judgement Call"}, {"r1m4", "Cave of Death"}, - {"r1m5", "Towers of Wrath"}, {"r1m6", "Temple of Pain"}, - {"r1m7", "Tomb of the Overlord"}, {"r2m1", "Tempus Fugit"}, - {"r2m2", "Elemental Fury I"}, {"r2m3", "Elemental Fury II"}, - {"r2m4", "Curse of Osiris"}, {"r2m5", "Wizard's Keep"}, - {"r2m6", "Blood Sacrifice"}, {"r2m7", "Last Bastion"}, - {"r2m8", "Source of Evil"}, {"ctf1", "Division of Change"}}; - typedef struct { const char* description; int firstLevel; - int levels; + int lastLevel; } episode_t; -episode_t episodes[] = {{"Welcome to Quake", 0, 1}, {"Doomed Dimension", 1, 8}, - {"Realm of Black Magic", 9, 7}, {"Netherworld", 16, 7}, - {"The Elder World", 23, 8}, {"Final Level", 31, 1}, - {"Deathmatch Arena", 32, 6}}; - -// MED 01/06/97 added hipnotic episodes -episode_t hipnoticepisodes[] = {{"Scourge of Armagon", 0, 1}, - {"Fortress of the Dead", 1, 5}, {"Dominion of Darkness", 6, 6}, - {"The Rift", 12, 4}, {"Final Level", 16, 1}, {"Deathmatch Arena", 17, 1}}; - -// PGM 01/07/97 added rogue episodes -// PGM 03/02/97 added dmatch episode -episode_t rogueepisodes[] = {{"Introduction", 0, 1}, {"Hell's Fortress", 1, 7}, - {"Corridors of Time", 8, 8}, {"Deathmatch Arena", 16, 1}}; +episode_t episodes[] = { + // + {"Vanilla E1", 0, 7}, // + {"Vanilla E2", 8, 14}, // + {"Vanilla E3", 15, 21}, // + {"Vanilla E4", 22, 30}, // + {"Vanilla DM", 31, 36}, // + {"SoA E1", 37, 41}, // + {"SoA E2", 42, 47}, // + {"SoA E3", 48, 52}, // + {"SoA DM", 53, 53}, // + {"DoE E1", 54, 60}, // + {"DoE E2", 61, 68}, // + {"DoE DM", 69, 69}, // +}; int startepisode; int startlevel; int maxplayers; -bool m_serverInfoMessage = false; -double m_serverInfoMessageTime; void M_Menu_GameOptions_f() { @@ -3636,10 +4244,12 @@ void M_Menu_GameOptions_f() key_dest = key_menu; m_state = m_gameoptions; m_entersound = true; + if(maxplayers == 0) { maxplayers = svs.maxclients; } + if(maxplayers < 2) { maxplayers = svs.maxclientslimit; @@ -3654,7 +4264,6 @@ int gameoptions_cursor; void M_GameOptions_Draw() { qpic_t* p; - int x; M_DrawTransPic(16, 4, Draw_CachePic("gfx/qplaque.lmp")); p = Draw_CachePic("gfx/p_multi.lmp"); @@ -3745,73 +4354,17 @@ void M_GameOptions_Draw() } M_Print(0, 112, " Episode"); - // MED 01/06/97 added hipnotic episodes - if(hipnotic) - { - M_Print(160, 112, hipnoticepisodes[startepisode].description); - // PGM 01/07/97 added rogue episodes - } - else if(rogue) - { - M_Print(160, 112, rogueepisodes[startepisode].description); - } - else - { - M_Print(160, 112, episodes[startepisode].description); - } + M_Print(160, 112, episodes[startepisode].description); M_Print(0, 120, " Level"); - // MED 01/06/97 added hipnotic episodes - if(hipnotic) - { - M_Print(160, 120, - hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + - startlevel] - .description); - M_Print(160, 128, - hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + - startlevel] - .name); - } - // PGM 01/07/97 added rogue episodes - else if(rogue) - { - M_Print(160, 120, - roguelevels[rogueepisodes[startepisode].firstLevel + startlevel] - .description); - M_Print(160, 128, - roguelevels[rogueepisodes[startepisode].firstLevel + startlevel] - .name); - } - else - { - M_Print(160, 120, - levels[episodes[startepisode].firstLevel + startlevel].description); - M_Print(160, 128, - levels[episodes[startepisode].firstLevel + startlevel].name); - } + M_Print(160, 120, + levels[episodes[startepisode].firstLevel + startlevel].description); + M_Print( + 160, 128, levels[episodes[startepisode].firstLevel + startlevel].name); // line cursor M_DrawCharacter(144, gameoptions_cursor_table[gameoptions_cursor], 12 + ((int)(realtime * 4) & 1)); - - if(m_serverInfoMessage) - { - if((realtime - m_serverInfoMessageTime) < 5.0) - { - x = (320 - 26 * 8) / 2; - M_DrawTextBox(x, 138, 24, 4); - x += 8; - M_Print(x, 146, " More than 4 players "); - M_Print(x, 154, " requires using command "); - M_Print(x, 162, "line parameters; please "); - M_Print(x, 170, " see techinfo.txt. "); - } - else - { - m_serverInfoMessage = false; - } - } } @@ -3827,8 +4380,6 @@ void M_NetStart_Change(int dir) if(maxplayers > svs.maxclientslimit) { maxplayers = svs.maxclientslimit; - m_serverInfoMessage = true; - m_serverInfoMessageTime = realtime; } if(maxplayers < 2) { @@ -3893,25 +4444,7 @@ void M_NetStart_Change(int dir) case 7: startepisode += dir; - // MED 01/06/97 added hipnotic count - if(hipnotic) - { - count = 6; - // PGM 01/07/97 added rogue count - // PGM 03/02/97 added 1 for dmatch episode - } - else if(rogue) - { - count = 4; - } - else if(registered.value) - { - count = 7; - } - else - { - count = 2; - } + count = sizeof(episodes) / sizeof(episode_t); if(startepisode < 0) { @@ -3928,20 +4461,8 @@ void M_NetStart_Change(int dir) case 8: startlevel += dir; - // MED 01/06/97 added hipnotic episodes - if(hipnotic) - { - count = hipnoticepisodes[startepisode].levels; - // PGM 01/06/97 added hipnotic episodes - } - else if(rogue) - { - count = rogueepisodes[startepisode].levels; - } - else - { - count = episodes[startepisode].levels; - } + count = episodes[startepisode].lastLevel - + episodes[startepisode].firstLevel + 1; if(startlevel < 0) { @@ -3961,7 +4482,7 @@ void M_GameOptions_Key(int key) switch(key) { case K_ESCAPE: - case K_BBUTTON: M_Menu_Net_f(); break; + case K_BBUTTON: M_Menu_LanConfig_f(); break; case K_UPARROW: S_LocalSound("misc/menu1.wav"); @@ -4014,27 +4535,9 @@ void M_GameOptions_Key(int key) Cbuf_AddText(va("maxplayers %u\n", maxplayers)); SCR_BeginLoadingPlaque(); - if(hipnotic) - { - Cbuf_AddText(va("map %s\n", - hipnoticlevels[hipnoticepisodes[startepisode] - .firstLevel + - startlevel] - .name)); - } - else if(rogue) - { - Cbuf_AddText(va("map %s\n", - roguelevels[rogueepisodes[startepisode].firstLevel + - startlevel] - .name)); - } - else - { - Cbuf_AddText(va("map %s\n", - levels[episodes[startepisode].firstLevel + startlevel] - .name)); - } + Cbuf_AddText(va("map %s\n", + levels[episodes[startepisode].firstLevel + startlevel] + .name)); return; } @@ -4221,8 +4724,88 @@ void M_Init() Cmd_AddCommand("help", M_Menu_Help_f); Cmd_AddCommand("menu_quit", M_Menu_Quit_f); + + Cmd_AddCommand("autosave", quake::saveutil::doAutosave); +} + +[[nodiscard]] quake::vr::menu_keyboard& mkb() +{ + static quake::vr::menu_keyboard mkb{{200, 400}}; + return mkb; } +// TODO VR: (P1) cleanup +void M_DrawKeyboard() +{ + using quake::vr::menu_keyboard; + + if(key_dest != key_menu && key_dest != key_console) + { + return; + } + + mkb().draw(); + + { + glDisable(GL_TEXTURE_2D); + glEnable(GL_POINT_SMOOTH); + glPointSize(8); + + const float mx = vr_menu_mouse_x; + const float my = vr_menu_mouse_y; + const bool click = vr_menu_mouse_click; + + const auto doKey = [&](const int key) { + if(key_dest == key_menu) + { + M_Keydown(key, true /* fromVirtualKeyboard */); + } + else if(key_dest == key_console) + { + if(key == K_ESCAPE) + { + M_ToggleMenu_f(); + } + else + { + void Key_Console(int key, const bool fromVirtualKeyboard); + Key_Console(key, true /* fromVirtualKeyboard */); + } + } + }; + + const auto actions = quake::util::make_overload_set( + [&](const char c) { Char_Event(mkb().caps_lock() ? c - 32 : c); }, + [&](menu_keyboard::ka_backspace) { doKey(K_BACKSPACE); }, // + [&](menu_keyboard::ka_enter) { doKey(K_ENTER); }, // + [&](menu_keyboard::ka_back) { doKey(K_ESCAPE); }, // + [&](menu_keyboard::ka_up) { doKey(K_UPARROW); }, // + [&](menu_keyboard::ka_down) { doKey(K_DOWNARROW); }, // + [&](menu_keyboard::ka_left) { doKey(K_LEFTARROW); }, // + [&](menu_keyboard::ka_right) { doKey(K_RIGHTARROW); }, // + [&](menu_keyboard::ka_space) { Char_Event(' '); }, // + [&](menu_keyboard::ka_tab) { doKey(K_TAB); }, // + [&](menu_keyboard::ka_capslock) { mkb().toggle_caps_lock(); }, //, + [&](menu_keyboard::ka_console) { + m_state = m_none; + Con_ToggleConsole_f(); + }); + + mkb().update_click(mx, my, click); + mkb().update_letters(mx, my, click, actions); + mkb().update_drag(mx, my, click); + + { + const quake::vr::gl_util::gl_beginend_guard guard{GL_POINTS}; + + glColor3f(1, 0, 0); + quake::vr::gl_util::gl_vertex(qvec2{mx, my}); + } + + glDisable(GL_POINT_SMOOTH); + glEnable(GL_TEXTURE_2D); + } +} void M_Draw() { @@ -4266,6 +4849,15 @@ void M_Draw() } }); + // ----------------------------------------------------------------------- + // VR: Process nested "Quake VR Change mMap" menus. + forQVRCMMenus([&](quake::menu& xm, m_state_e s) { + if(m_state == s) + { + xm.draw(); + } + }); + switch(m_state) { case m_none: break; @@ -4281,8 +4873,11 @@ void M_Draw() case m_video: M_Video_Draw(); break; // ------------------------------------------------------------------- // VR: New menus. + case m_botcontrol: M_BotControl_Draw(); break; + case m_quakevrquicksettings: M_QuakeVRQuickSettings_Draw(); break; case m_quakevrsettings: M_QuakeVRSettings_Draw(); break; case m_quakevrdevtools: M_QuakeVRDevTools_Draw(); break; + case m_quakevrchangemap: M_QuakeVRChangeMap_Draw(); break; // ------------------------------------------------------------------- case m_help: M_Help_Draw(); break; case m_lanconfig: M_LanConfig_Draw(); break; @@ -4291,14 +4886,22 @@ void M_Draw() case m_slist: M_ServerList_Draw(); break; case m_quit: - if(!fitzmode) - { /* QuakeSpasm customization: */ + // if(!fitzmode) + if(false) + { + /* QuakeSpasm customization: */ /* Quit now! S.A. */ key_dest = key_console; Host_Quit_f(); } M_Quit_Draw(); break; + + default: + { + // Nested menus are handled above. + break; + } } if(m_entersound) @@ -4310,9 +4913,14 @@ void M_Draw() S_ExtraUpdate(); } - -void M_Keydown(int key) +void M_Keydown(int key, const bool fromVirtualKeyboard) { + if(!fromVirtualKeyboard && !vr_fakevr.value && + mkb().hovered(vr_menu_mouse_x, vr_menu_mouse_y) && key == K_ENTER) + { + return; + } + // ----------------------------------------------------------------------- // VR: Process nested "Quake VR Settings" menus. { @@ -4351,6 +4959,24 @@ void M_Keydown(int key) } } + // ----------------------------------------------------------------------- + // VR: Process nested "Quake VR Change Map" menus. + { + bool processedAny = false; + + forQVRCMMenus([&](quake::menu& xm, m_state_e s) { + if(m_state == s) + { + xm.key(key); + processedAny = true; + } + }); + + if(processedAny) + { + return; + } + } switch(m_state) { @@ -4367,8 +4993,11 @@ void M_Keydown(int key) case m_video: M_Video_Key(key); return; // ------------------------------------------------------------------- // VR: New menus. + case m_botcontrol: M_BotControl_Key(key); break; + case m_quakevrquicksettings: M_QuakeVRQuickSettings_Key(key); return; case m_quakevrsettings: M_QuakeVRSettings_Key(key); return; case m_quakevrdevtools: M_QuakeVRDevTools_Key(key); return; + case m_quakevrchangemap: M_QuakeVRChangeMap_Key(key); return; // ------------------------------------------------------------------- case m_help: M_Help_Key(key); return; case m_quit: M_Quit_Key(key); return; @@ -4376,6 +5005,12 @@ void M_Keydown(int key) case m_gameoptions: M_GameOptions_Key(key); return; case m_search: M_Search_Key(key); return; case m_slist: M_ServerList_Key(key); return; + + default: + { + // Nested menus are handled above. + break; + } } } @@ -4408,9 +5043,5 @@ void M_ConfigureNetSubsystem() { // enable/disable net systems to match desired config Cbuf_AddText("stopdemo\n"); - - if(IPXConfig || TCPIPConfig) - { - net_hostport = lanConfig_port; - } + net_hostport = lanConfig_port; } diff --git a/Quake/menu.hpp b/Quake/menu.hpp index 6fd1b9b7..7d2d3128 100644 --- a/Quake/menu.hpp +++ b/Quake/menu.hpp @@ -21,91 +21,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_MENU_H -#define _QUAKE_MENU_H +#pragma once -enum m_state_e -{ - m_none, - m_main, - m_singleplayer, - m_load, - m_save, - m_multiplayer, - m_setup, - m_net, - m_options, - m_quakevrsettings, - m_quakevrdevtools, - m_video, - m_vr, - m_vrgameplay, - m_wpn_offset, - m_sbar_offset, - m_hotspot, - m_vrtorso, - m_map, - m_debug, - m_keys, - m_help, - m_quit, - m_lanconfig, - m_gameoptions, - m_search, - m_slist, - m_qvrs_menu, - m_qvrs_crosshair, - m_qvrs_particle, - m_qvrs_locomotion, - m_qvrs_handguncalibration, - m_qvrs_playercalibration, - m_qvrs_melee, - m_qvrs_aiming, - m_qvrs_immersion, - m_qvrs_graphical, - m_qvrs_hudconfiguration, - m_qvrs_hotspot, - m_qvrs_torso, - m_qvrs_changemap, - m_qvrs_transparencyoptions, - m_qvrdt_weaponconfiguration, - m_qvrdt_weaponconfiguration2, - m_qvrdt_weaponconfiguration3, - m_qvrdt_debugutilities, -}; +#include "mstate.hpp" -extern enum m_state_e m_state; -extern enum m_state_e m_return_state; +#include <ctime> extern bool m_entersound; // // menus // -void M_Init(void); -void M_Keydown(int key); +void M_Init(); +void M_Keydown(int key, const bool fromVirtualKeyboard = false); void M_Charinput(int key); -bool M_TextEntry(void); -void M_ToggleMenu_f(void); +bool M_TextEntry(); +void M_ToggleMenu_f(); -void M_Menu_Main_f(void); -void M_Menu_Options_f(void); +void M_Menu_Main_f(); +void M_Menu_Options_f(); +void M_Menu_QuakeVRQuickSettings_f(); void M_Menu_QuakeVRSettings_f(); void M_Menu_QuakeVRDevTools_f(); -void M_Menu_Quit_f(void); +void M_Menu_QuakeVRChangeMap_f(); +void M_Menu_Quit_f(); void M_Print(int cx, int cy, const char* str); void M_PrintWithNewLine(int cx, int cy, const char* str); void M_PrintWhite(int cx, int cy, const char* str); void M_PrintWhiteWithNewLine(int cx, int cy, const char* str); -void M_PrintWhiteByWrapping(const int wrapCount, int cx, int cy, const char* str); +void M_PrintWhiteByWrapping( + const int wrapCount, int cx, int cy, const char* str); -void M_Draw(void); +void M_Draw(); +void M_DrawKeyboard(); void M_DrawCharacter(int cx, int line, int num); +struct qpic_t; + void M_DrawSlider(int x, int y, float range); void M_DrawPic(int x, int y, qpic_t* pic); void M_DrawTransPic(int x, int y, qpic_t* pic); void M_DrawCheckbox(int x, int y, int on); - -#endif /* _QUAKE_MENU_H */ diff --git a/Quake/menu_keyboard.cpp b/Quake/menu_keyboard.cpp new file mode 100644 index 00000000..69d9b3c4 --- /dev/null +++ b/Quake/menu_keyboard.cpp @@ -0,0 +1,298 @@ +#pragma once + +#include "menu_keyboard.hpp" + +#include "gl_util.hpp" +#include "menu.hpp" + +#include <string_view> + +namespace quake::vr +{ + +[[nodiscard]] qvec2 menu_keyboard::drag_min() noexcept +{ + return _pos - qvec2{8, 8}; +} + +[[nodiscard]] qvec2 menu_keyboard::drag_max() noexcept +{ + return drag_min() + qvec2{256, 16}; +} + +void menu_keyboard::draw_bounds() noexcept +{ + glDisable(GL_TEXTURE_2D); + + { + const gl_util::gl_beginend_guard guard{GL_QUADS}; + + const auto [min, max] = bounds(); + glColor3f(0.05, 0.05, 0.05); + + glVertex2f(min.x, min.y); + glVertex2f(max.x, min.y); + glVertex2f(max.x, max.y); + glVertex2f(min.x, max.y); + } + + glEnable(GL_TEXTURE_2D); + glColor3f(1, 1, 1); +} + + +void menu_keyboard::draw_dragbar() noexcept +{ + glDisable(GL_TEXTURE_2D); + + { + const gl_util::gl_beginend_guard guard{GL_QUADS}; + + const auto& min = drag_min(); + const auto& max = drag_max(); + + if(_drag_hover) + { + glColor3f(0.65, 0.15, 0.15); + } + else + { + glColor3f(0.15, 0.15, 0.15); + } + + glVertex2f(min.x, min.y); + glVertex2f(max.x, min.y); + glVertex2f(max.x, max.y); + glVertex2f(min.x, max.y); + } + + glEnable(GL_TEXTURE_2D); + glColor3f(1, 1, 1); +} + +[[nodiscard]] qvec2 menu_keyboard::tile_pos(const qvec2& pos) +{ + return pos + _pos + qvec2{0, 24}; +} + +void menu_keyboard::draw_tiles() +{ + glDisable(GL_TEXTURE_2D); + + { + const gl_util::gl_beginend_guard guard{GL_QUADS}; + + for(const key& k : _keys) + { + const auto& min = tile_pos(k._bounds._min); + const auto& max = tile_pos(k._bounds._max); + + if(k._hovered) + { + glColor3f(0.65, 0.15, 0.15); + } + else + { + glColor3f(0.15, 0.15, 0.15); + } + + glVertex2f(min.x, min.y); + glVertex2f(max.x, min.y); + glVertex2f(max.x, max.y); + glVertex2f(min.x, max.y); + } + } + + glEnable(GL_TEXTURE_2D); + glColor3f(1, 1, 1); +} + +void menu_keyboard::draw_letters() +{ + for(const key& k : _keys) + { + const auto cp = tile_pos(k._pos); + + quake::util::match( + k._action, + [&](const char c) { + M_DrawCharacter(cp.x, cp.y, _caps_lock ? c - 32 : c); + }, + [&](ka_backspace) { M_PrintWhite(cp.x, cp.y, "backspace"); }, // + [&](ka_enter) { M_PrintWhite(cp.x, cp.y, "enter"); }, // + [&](ka_back) { M_PrintWhite(cp.x, cp.y, "escape"); }, // + [&](ka_up) { M_PrintWhite(cp.x, cp.y, "up"); }, // + [&](ka_down) { M_PrintWhite(cp.x, cp.y, "down"); }, // + [&](ka_left) { M_PrintWhite(cp.x, cp.y, "left"); }, // + [&](ka_right) { M_PrintWhite(cp.x, cp.y, "right"); }, // + [&](ka_space) { M_PrintWhite(cp.x, cp.y, "space"); }, // + [&](ka_tab) { M_PrintWhite(cp.x, cp.y, "tab"); }, // + [&](ka_console) { M_PrintWhite(cp.x, cp.y, "console"); }, // + [&](ka_capslock) { + M_PrintWhite( + cp.x, cp.y, va("caps %s", _caps_lock ? "ON" : "OFF")); + }); + } +} + +[[nodiscard]] bool menu_keyboard::inside( + const int x, const int y, const qvec2& min, const qvec2& max) +{ + return x >= min.x && x <= max.x && y >= min.y && y <= max.y; +} + +[[nodiscard]] bool menu_keyboard::hovers_tile( + const key& k, const int x, const int y) +{ + const auto& min = tile_pos(k._bounds._min); + const auto& max = tile_pos(k._bounds._max); + + return inside(x, y, min, max); +} + +[[nodiscard]] bool menu_keyboard::hovers_drag(const int x, const int y) +{ + const float off = _drag_hover ? 16.f : 0.f; + const qvec2 voff{off, off}; + + return inside(x, y, drag_min() - voff, drag_max() + voff); +} + + +[[nodiscard]] menu_keyboard::aabb menu_keyboard::bounds() noexcept +{ + qvec2 min = drag_min(); + qvec2 max = drag_max(); + + for(const key& k : _keys) + { + const auto bmin = tile_pos(k._bounds._min); + const auto bmax = tile_pos(k._bounds._max); + + min.x = std::min(min.x, bmin.x); + min.y = std::min(min.y, bmin.y); + + max.x = std::max(max.x, bmax.x); + max.y = std::max(max.y, bmax.y); + } + + min.x -= 8; + min.y -= 8; + + max.x += 8; + max.y += 8; + + return {min, max}; +} + + +menu_keyboard::menu_keyboard(const qvec2 pos) noexcept : _pos{pos} +{ + using namespace std::string_view_literals; + constexpr auto kbLayout = R"(1234567890' +qwertyuiop +asdfghjkl +zxcvbnm,.-)"sv; + + constexpr int distance = 28; + constexpr int off = 8; + + int cx = 0; + int cy = 0; + + for(const char c : kbLayout) + { + if(c == '\n') + { + cy += distance; + cx = 0; + + continue; + } + + const aabb key_bounds{ + {cx - off, cy - off}, // + {cx + 8 + off, cy + 8 + off} // + }; + + _keys.emplace_back(key{qvec2{cx, cy}, key_bounds, key_action{c}}); + cx += distance; + } + + const auto add_special_key = [&](const int x, const int y, const int width, + auto action) { + constexpr int off = 8; + constexpr int height = 8; + + const aabb key_bounds{ + {x - off, y - off}, // + {x + width + off, y + height + off} // + }; + + _keys.emplace_back(key{qvec2{x, y}, key_bounds, key_action{action}}); + }; + + add_special_key(280 + 32, -24, 76, ka_back{}); + add_special_key(280 + 32, 4, 76, ka_backspace{}); + add_special_key(280 + 32, 8 + 24, 76, ka_enter{}); + add_special_key(280 + 32 + 20 + 76, -24, 76, ka_console{}); + add_special_key(280 + 32 + 20 + 76, 4, 76, ka_capslock{}); + add_special_key(280 + 32 + 20 + 76, 8 + 24, 76, ka_tab{}); + add_special_key(55, 114, 150, ka_space{}); + + add_special_key(64 + 280 + 48, 26 + 4 + 8 + 48, 32, ka_up{}); + add_special_key(64 + 280 + 48, 26 + 4 + 4 + 24 + 8 + 48, 32, ka_down{}); + add_special_key(64 + 280 + 0 - 8, 26 + 4 + 4 + 24 + 8 + 48, 32, ka_left{}); + add_special_key( + 64 + 280 + 48 + 48 + 8, 26 + 4 + 4 + 24 + 8 + 48, 38, ka_right{}); +} + +void menu_keyboard::update_click(const int mx, const int my, const bool click) +{ + _rising_edge = click && !_last_click; + _falling_edge = !click && _last_click; + _last_click = click; +} + + +void menu_keyboard::update_drag(const int mx, const int my, const bool click) +{ + _drag_hover = hovers_drag(mx, my); + + if(_drag_hover && _rising_edge) + { + _old_pos = _pos; + _drag_start = qvec2{mx, my}; + } + + if(_drag_hover && click) + { + _pos = _old_pos + qvec2{mx, my} - _drag_start; + } +} + +void menu_keyboard::draw() +{ + draw_bounds(); + draw_dragbar(); + draw_tiles(); + draw_letters(); +} + +[[nodiscard]] bool menu_keyboard::hovered(const int mx, const int my) noexcept +{ + const auto [min, max] = bounds(); + return inside(mx, my, min, max); +} + +void menu_keyboard::toggle_caps_lock() noexcept +{ + _caps_lock = !_caps_lock; +} + +[[nodiscard]] bool menu_keyboard::caps_lock() noexcept +{ + return _caps_lock; +} + +} // namespace quake::vr diff --git a/Quake/menu_keyboard.hpp b/Quake/menu_keyboard.hpp new file mode 100644 index 00000000..98222dad --- /dev/null +++ b/Quake/menu_keyboard.hpp @@ -0,0 +1,113 @@ +#pragma once + +#include "util.hpp" +#include "quakeglm_qvec2.hpp" + +#include <variant> +#include <vector> + +namespace quake::vr +{ + +class menu_keyboard +{ +public: + // clang-format off + struct ka_backspace { }; + struct ka_enter { }; + struct ka_back { }; + struct ka_up { }; + struct ka_down { }; + struct ka_left { }; + struct ka_right { }; + struct ka_space { }; + struct ka_capslock { }; + struct ka_tab { }; + struct ka_console { }; + // clang-format on + + using key_action = + std::variant<char, ka_backspace, ka_enter, ka_back, ka_up, ka_down, + ka_left, ka_right, ka_space, ka_capslock, ka_tab, ka_console>; + +private: + struct aabb + { + qvec2 _min; + qvec2 _max; + }; + + struct key + { + qvec2 _pos; + aabb _bounds; + key_action _action; + bool _hovered{false}; + }; + + std::vector<key> _keys; + qvec2 _pos; + bool _last_click{false}; + bool _rising_edge{false}; + bool _falling_edge{false}; + + bool _drag_hover{false}; + qvec2 _old_pos{}; + qvec2 _drag_start{}; + + bool _caps_lock{}; + + [[nodiscard]] qvec2 drag_min() noexcept; + + [[nodiscard]] qvec2 drag_max() noexcept; + + void draw_bounds() noexcept; + + void draw_dragbar() noexcept; + + [[nodiscard]] qvec2 tile_pos(const qvec2& pos); + + void draw_tiles(); + + void draw_letters(); + + [[nodiscard]] bool inside( + const int x, const int y, const qvec2& min, const qvec2& max); + + [[nodiscard]] bool hovers_tile(const key& k, const int x, const int y); + + [[nodiscard]] bool hovers_drag(const int x, const int y); + + [[nodiscard]] aabb bounds() noexcept; + +public: + menu_keyboard(const qvec2 pos) noexcept; + + void update_click(const int mx, const int my, const bool click); + + template <typename F> + void update_letters(const int mx, const int my, const bool click, F&& f) + { + for(key& k : _keys) + { + k._hovered = hovers_tile(k, mx, my); + + if(k._hovered && _rising_edge) + { + quake::util::match(k._action, f); + } + } + } + + void update_drag(const int mx, const int my, const bool click); + + void draw(); + + [[nodiscard]] bool hovered(const int mx, const int my) noexcept; + + void toggle_caps_lock() noexcept; + + [[nodiscard]] bool caps_lock() noexcept; +}; + +} // namespace quake::vr diff --git a/Quake/menu_util.cpp b/Quake/menu_util.cpp index c121f230..3655c20c 100644 --- a/Quake/menu_util.cpp +++ b/Quake/menu_util.cpp @@ -1,7 +1,12 @@ #include "menu_util.hpp" -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" #include "client.hpp" +#include "menu.hpp" +#include "util.hpp" +#include "keys.hpp" +#include "q_sound.hpp" +#include "input.hpp" // TODO VR: (P2) forward declaration due to crappy quake header deps @@ -9,37 +14,545 @@ struct sfx_t; sfx_t* S_PrecacheSound(const char* name); -void S_StartSound(int entnum, int entchannel, sfx_t* sfx, - const glm::vec3& origin, float fvol, float attenuation); +void S_StartSound(int entnum, int entchannel, sfx_t* sfx, const qvec3& origin, + float fvol, float attenuation); namespace quake::menu_util { - void playMenuSound(const char* sound, float fvol) + +void playMenuSound(const char* sound, float fvol) +{ + if(sfx_t* const sfx = S_PrecacheSound(sound)) + { + S_StartSound(cl.viewentity, 0, sfx, vec3_zero, fvol, 1); + } +} + +void playMenuDefaultSound() +{ + playMenuSound("items/r_item1.wav", 0.5); +} + +void setMenuState(m_state_e state) +{ + IN_Deactivate(modestate == MS_WINDOWED); + key_dest = key_menu; + m_state = state; + m_entersound = true; + + playMenuDefaultSound(); +} + +void setMenuState(quake::menu& m, m_state_e state) +{ + setMenuState(state); + m.enter(); +} + +} // namespace quake::menu_util + +namespace quake +{ + +void menu::clear() +{ + _entries.clear(); + _cursor_idx = 0; +} + +void menu::assert_valid_idx(const int idx) const +{ + assert(idx >= 0); + assert(idx < entry_count()); +} + +impl::menu_entry& menu::access(const int idx) noexcept +{ + assert_valid_idx(idx); + return _entries[idx]; +} + +const impl::menu_entry& menu::access(const int idx) const noexcept +{ + assert_valid_idx(idx); + return _entries[idx]; +} + +void menu::key_option(const int key, const int idx) +{ + if(empty()) + { + return; + } + + const bool isLeft = (key == K_LEFTARROW); + + const auto adjustValueI = quake::util::makeMenuValueAdjuster<int>(isLeft); + + const auto adjustCVarF = quake::util::makeMenuCVarAdjuster<float>(isLeft); + const auto adjustCVarI = quake::util::makeMenuCVarAdjuster<int>(isLeft); + + impl::menu_entry& e = access(idx); + + const auto match_entry = [&](auto& self, auto&& entry) -> void { + quake::util::match( + std::forward<decltype(entry)>(entry), // + [&](const impl::menu_entry_value<bool>& x) { + bool& v = *(x._getter()); + v = !v; + }, + [&](const impl::menu_entry_cvar<float>& x) { + const auto& [inc, min, max] = x._bounds; + adjustCVarF(*(x._cvar_getter()), inc, min, max); + }, + [&](const impl::menu_entry_cvar<int>& x) { + const auto& [inc, min, max] = x._bounds; + adjustCVarI(*(x._cvar_getter()), inc, min, max); + }, + [&](const impl::menu_entry_cvar<bool>& x) { + adjustCVarI(*(x._cvar_getter()), 1, 0, 1); + }, + [&](const impl::menu_entry_value_labeled_cvar<int>& x) { + const auto& [inc, min, max] = x._bounds; + adjustCVarI(*(x._cvar_getter()), inc, min, max); + }, + [&](const impl::menu_entry_value_labeled<int>& x) { + const auto& [inc, min, max] = x._bounds; + adjustValueI(*(x._getter()), inc, min, max); + }, + [&](const impl::menu_entry_action& x) { x._action(); }, + [&](const impl::menu_entry_action_slider& x) { + x._action_slide(isLeft ? -1 : 1); + }, + [&](const impl::menu_entry_separator&) {}, + [&](const impl::menu_entry_ptr& ptr) { + self(self, ptr._ptr->_variant); + }); + }; + + match_entry(match_entry, e._variant); +} + +[[nodiscard]] bool menu::entry_is_selectable_at(const int idx) +{ + assert_valid_idx(idx); + return !std::holds_alternative<impl::menu_entry_separator>( + _entries[idx]._variant); +} + + +menu::menu(const std::string_view title, std::function<void()> escape_fn, + bool two_columns) noexcept + : _title{title}, _escape_fn{std::move(escape_fn)}, _two_columns{two_columns} +{ +} + +void menu::add_separator() +{ + // TODO VR: (P2) not nice, separator should not have a common + _entries.emplace_back( + impl::menu_entry_common{}, impl::menu_entry_separator{}); +} + +void menu::enter() +{ + if(empty()) + { + return; + } + + // Hover current entry. + auto& curr_hover_change_fn = access(_cursor_idx)._common._hover_change; + + if(curr_hover_change_fn) + { + curr_hover_change_fn(true); + } +} + +void menu::leave() +{ + if(empty()) + { + return; + } + + // Un-hover current entry. + auto& curr_hover_change_fn = access(_cursor_idx)._common._hover_change; + + if(curr_hover_change_fn) + { + curr_hover_change_fn(false); + } +} + +void menu::remove_entry_at(const std::size_t index) noexcept +{ + assert_valid_idx(index); + _entries.erase(_entries.begin() + index); + + move_cursor(0); +} + +void menu::update_hover( + const int prev_cursor_idx, const int curr_cursor_idx) noexcept +{ + if(curr_cursor_idx == prev_cursor_idx) + { + return; + } + + auto& prev_hover_change_fn = access(prev_cursor_idx)._common._hover_change; + + if(prev_hover_change_fn) + { + prev_hover_change_fn(false); + } + + auto& curr_hover_change_fn = access(curr_cursor_idx)._common._hover_change; + + if(curr_hover_change_fn) + { + curr_hover_change_fn(true); + } +} + +void menu::move_cursor(const int offset) noexcept +{ + if(empty()) + { + _cursor_idx = 0; + return; + } + + const auto prev_cursor_idx = _cursor_idx; + const int dir = offset > 0 ? 1 : -1; + + _cursor_idx += offset; + + while(_cursor_idx >= 0 && _cursor_idx < entry_count() && + !entry_is_selectable_at(_cursor_idx)) + { + _cursor_idx += dir; + } + + if(_cursor_idx < 0) + { + _cursor_idx = entry_count() - 1; + + while(!entry_is_selectable_at(_cursor_idx)) + { + --_cursor_idx; + } + } + else if(_cursor_idx >= entry_count()) { - if(sfx_t* const sfx = S_PrecacheSound(sound)) + _cursor_idx = 0; + + while(!entry_is_selectable_at(_cursor_idx)) { - S_StartSound(cl.viewentity, 0, sfx, vec3_zero, fvol, 1); + ++_cursor_idx; } } - void playMenuDefaultSound() + update_hover(prev_cursor_idx, _cursor_idx); +} + +void menu::key(const int key) +{ + switch(key) { - playMenuSound("items/r_item1.wav", 0.5); + case K_ESCAPE: + { + VID_SyncCvars(); // sync cvars before leaving menu. + // FIXME: there are other ways to leave + // menu + S_LocalSound("misc/menu1.wav"); + + // TODO VR: (P2) have some sort of menu stack instead of + // going back manually + assert(_escape_fn); + _escape_fn(); + + leave(); + + break; + } + + case K_UPARROW: + { + S_LocalSound("misc/menu1.wav"); + + move_cursor(-1); + break; + } + + case K_DOWNARROW: + { + S_LocalSound("misc/menu1.wav"); + + move_cursor(1); + break; + } + + case K_LEFTARROW: + { + if(_two_columns) + { + S_LocalSound("misc/menu1.wav"); + move_cursor(-items_per_column); + } + else + { + S_LocalSound("misc/menu3.wav"); + key_option(key, _cursor_idx); + } + + break; + } + + case K_RIGHTARROW: + { + if(_two_columns) + { + S_LocalSound("misc/menu1.wav"); + move_cursor(items_per_column); + } + else + { + S_LocalSound("misc/menu3.wav"); + key_option(key, _cursor_idx); + } + + break; + } + + case K_ENTER: + { + m_entersound = true; + key_option(key, _cursor_idx); + break; + } } - void setMenuState(m_state_e state) + if(_key_fn) { - IN_Deactivate(modestate == MS_WINDOWED); - key_dest = key_menu; - m_state = state; - m_entersound = true; + _key_fn(key, access(_cursor_idx)); + } +} + +void menu::draw(const int offset_x, const int offset_y) +{ + int x = offset_x + 240; - playMenuDefaultSound(); + if(_two_columns) + { + x -= 120 * (_cursor_idx / items_per_column); } - void setMenuState(quake::menu& m, m_state_e state) + int y = offset_y + 4; + + // plaque + // M_DrawTransPic(16, y, Draw_CachePic("gfx/qplaque.lmp")); + + // customize header + // qpic_t* p = Draw_CachePic("gfx/ttl_cstm.lmp"); + // M_DrawPic((320 - p->width) / 2, y, p); + + y += 28; + + // title + M_PrintWhite((320 - 8 * _title.size()) / 2, y, _title.data()); + y += 16; + + if(empty()) { - setMenuState(state); - m.enter(); + return; } -} // namespace quake::menu_util + + char buf[512]{}; + int idx{0}; + + constexpr int char_size = 8; + constexpr int label_padding = 26; + + const auto get_label_x = [&, this](const std::string_view s) { + if(_two_columns) + { + return (x - 240) + 70 + (120 * (idx / items_per_column)); + } + + return (x - 240) + 8 + + ((label_padding - static_cast<int>(s.size())) * char_size); + }; + + const auto print_label = [this, &get_label_x, &y, &buf]( + std::string_view s) { + if(_two_columns && s.size() > 13) + { + s.remove_suffix(s.size() - 13); + } + + for(std::size_t i = 0; i < s.size(); ++i) + { + buf[i] = s[i]; + } + buf[s.size()] = '\0'; + + M_Print(get_label_x(s), y, buf); + }; + + const auto print_as_float_str = [&buf, &x, &y](const float value) { + snprintf(buf, sizeof(buf), "%.4f", value); + M_Print(x, y, buf); + }; + + const auto print_as_int_str = [&buf, &x, &y](const int value) { + snprintf(buf, sizeof(buf), "%d", value); + M_Print(x, y, buf); + }; + + const auto print_as_bool_str = [&buf, &x, &y](const bool value) { + snprintf(buf, sizeof(buf), value ? "On" : "Off"); + M_Print(x, y, buf); + }; + + const auto print_as_str = [&buf, &x, &y](const std::string_view value) { + snprintf(buf, sizeof(buf), "%s", value.data()); + M_Print(x, y, buf); + }; + + const auto print_tooltip = [&buf](const std::string_view value) { + snprintf(buf, sizeof(buf), "%s", value.data()); + M_PrintWhiteByWrapping(28, 340, 50, buf); + }; + + { + const auto& curr_tooltip = access(_cursor_idx)._common._tooltip; + if(!curr_tooltip.empty()) + { + print_tooltip(curr_tooltip); + } + } + + for(const impl::menu_entry& e : _entries) + { + const std::string_view& e_label = e._common._label; + + const auto match_entry = [&](auto& self, auto&& entry) -> void { + quake::util::match( + std::forward<decltype(entry)>(entry), // + [&](const impl::menu_entry_value<bool>& entry) { + print_label(e_label); + print_as_bool_str(*(entry._getter())); + }, + [&](const impl::menu_entry_cvar<float>& entry) { + print_label(e_label); + + const float value = entry._cvar_getter()->value; + if(entry._printer == nullptr) + { + print_as_float_str(value); + } + else + { + entry._printer(buf, sizeof(buf), value); + M_Print(x, y, buf); + } + }, + [&](const impl::menu_entry_cvar<int>& entry) { + print_label(e_label); + + const int value = entry._cvar_getter()->value; + if(entry._printer == nullptr) + { + print_as_int_str(value); + } + else + { + entry._printer(buf, sizeof(buf), value); + M_Print(x, y, buf); + } + }, + [&](const impl::menu_entry_cvar<bool>& entry) { + print_label(e_label); + print_as_bool_str(entry._cvar_getter()->value); + }, + [&](const impl::menu_entry_value_labeled_cvar<int>& entry) { + print_label(e_label); + print_as_str(entry._value_label_fn( + static_cast<int>(entry._cvar_getter()->value))); + }, + [&](const impl::menu_entry_value_labeled<int>& entry) { + print_label(e_label); + print_as_str(entry._value_label_fn( + static_cast<int>(*entry._getter()))); + }, + [&](const impl::menu_entry_action&) { + print_label(e_label); + + if(!_two_columns) + { + print_as_str("(X)"); + } + }, + [&](const impl::menu_entry_action_slider& entry) { + print_label(e_label); + M_DrawSlider(x + 10, y, entry._range()); + }, + [&](const impl::menu_entry_separator&) {}, + [&](const impl::menu_entry_ptr& ptr) { + self(self, ptr._ptr->_variant); + }); + }; + + match_entry(match_entry, e._variant); + + if(_cursor_idx == idx) + { + if(_two_columns) + { + M_DrawCharacter( + (x - 240) + (70 - 15) + (120 * (idx / items_per_column)), y, + 12 + ((int)(realtime * 4) & 1)); + } + else + { + M_DrawCharacter(x - 10, y, 12 + ((int)(realtime * 4) & 1)); + } + } + + ++idx; + y += 8; + + if(_two_columns) + { + if(idx % 25 == 0) + { + y = 32 + 16; + } + } + } +} + +[[nodiscard]] int menu::cursor_idx() noexcept +{ + return _cursor_idx; +} + +[[nodiscard]] const std::string_view& menu::title() noexcept +{ + return _title; +} + +[[nodiscard]] int menu::entry_count() const noexcept +{ + return static_cast<int>(_entries.size()); +} + +[[nodiscard]] bool menu::empty() const noexcept +{ + return _entries.empty(); +} + +} // namespace quake diff --git a/Quake/menu_util.hpp b/Quake/menu_util.hpp index 3a7508d5..8a1627bf 100644 --- a/Quake/menu_util.hpp +++ b/Quake/menu_util.hpp @@ -1,7 +1,7 @@ #pragma once #include "quakedef.hpp" -#include "util.hpp" +#include "mstate.hpp" #include <string> #include <cassert> @@ -14,645 +14,346 @@ namespace quake { - class menu; +class menu; } namespace quake::menu_util { - void playMenuSound(const char* sound, float fvol); - void playMenuDefaultSound(); - void setMenuState(m_state_e state); - void setMenuState(quake::menu& m, m_state_e state); + +void playMenuSound(const char* sound, float fvol); +void playMenuDefaultSound(); +void setMenuState(m_state_e state); +void setMenuState(quake::menu& m, m_state_e state); + } // namespace quake::menu_util namespace quake { - template <typename T> - struct menu_bounds +template <typename T> +struct menu_bounds +{ + T _inc, _min, _max; + + constexpr menu_bounds(const T inc, const T min, const T max) noexcept + : _inc{inc}, _min{min}, _max{max} { - T _inc, _min, _max; + } +}; - constexpr menu_bounds(const T inc, const T min, const T max) noexcept - : _inc{inc}, _min{min}, _max{max} - { - } - }; +template <> +struct menu_bounds<bool> +{ +}; - template <> - struct menu_bounds<bool> - { - }; +namespace impl +{ +struct menu_entry_common +{ + std::string_view _label; + std::function<void(bool)> _hover_change; + std::string_view _tooltip; +}; - namespace impl - { - struct menu_entry_common - { - std::string_view _label; - std::function<void(bool)> _hover_change; - std::string_view _tooltip; - }; +template <typename T> +struct menu_entry_value +{ + std::function<T*()> _getter; + menu_bounds<T> _bounds; +}; - template <typename T> - struct menu_entry_value - { - std::function<T*()> _getter; - menu_bounds<T> _bounds; - }; +template <typename T> +struct menu_entry_cvar +{ + std::function<cvar_t*()> _cvar_getter; + menu_bounds<T> _bounds; + std::function<void(char*, int, T)> _printer; +}; - template <typename T> - struct menu_entry_cvar - { - std::function<cvar_t*()> _cvar_getter; - menu_bounds<T> _bounds; - std::function<void(char*, int, T)> _printer; - }; +template <typename T> +struct menu_entry_value_labeled_cvar +{ + std::function<cvar_t*()> _cvar_getter; + menu_bounds<T> _bounds; + std::function<std::string_view(T)> _value_label_fn; +}; - template <typename T> - struct menu_entry_value_labeled_cvar - { - std::function<cvar_t*()> _cvar_getter; - menu_bounds<T> _bounds; - std::function<std::string_view(T)> _value_label_fn; - }; +template <typename T> +struct menu_entry_value_labeled +{ + std::function<T*()> _getter; + menu_bounds<T> _bounds; + std::function<std::string_view(T)> _value_label_fn; +}; - struct menu_entry_action - { - std::function<void()> _action; - }; +struct menu_entry_action +{ + std::function<void()> _action; +}; - struct menu_entry_separator - { - }; +struct menu_entry_separator +{ +}; - struct menu_entry_action_slider - { - std::function<void(int)> _action_slide; - std::function<float()> _range; - }; +struct menu_entry_action_slider +{ + std::function<void(int)> _action_slide; + std::function<float()> _range; +}; - using menu_entry_variant = std::variant< // - menu_entry_value<bool>, // - menu_entry_cvar<float>, // - menu_entry_cvar<int>, // - menu_entry_cvar<bool>, // - menu_entry_value_labeled_cvar<int>, // - menu_entry_action, // - menu_entry_action_slider, // - menu_entry_separator // - >; - - struct menu_entry - { - menu_entry_common _common; - menu_entry_variant _variant; - - explicit menu_entry( - menu_entry_common c, menu_entry_variant v) noexcept - : _common{std::move(c)}, _variant{std::move(v)} - { - } - }; - } // namespace impl +struct menu_entry; + +struct menu_entry_ptr +{ + menu_entry* _ptr; +}; + +using menu_entry_variant = std::variant< // + menu_entry_value<bool>, // + menu_entry_cvar<float>, // + menu_entry_cvar<int>, // + menu_entry_cvar<bool>, // + menu_entry_value_labeled_cvar<int>, // + menu_entry_value_labeled<int>, // + menu_entry_action, // + menu_entry_action_slider, // + menu_entry_separator, // + menu_entry_ptr // + >; + +struct menu_entry +{ + menu_entry_common _common; + menu_entry_variant _variant; - class menu + explicit menu_entry(menu_entry_common c, menu_entry_variant v) noexcept + : _common{std::move(c)}, _variant{std::move(v)} { - public: - template <typename T> - class entry_handle - { - private: - menu* _menu; - std::size_t _index; - - public: - explicit entry_handle(menu& m, const std::size_t i) noexcept - : _menu{&m}, _index{i} - { - } - - T& operator*() noexcept - { - return _menu->access_variant<T>(_index); - } - - const T& operator*() const noexcept - { - return _menu->access_variant<T>(_index); - } - - T* operator->() noexcept - { - return &_menu->access_variant<T>(_index); - } - - const T* operator->() const noexcept - { - return &_menu->access_variant<T>(_index); - } - - template <typename F> - entry_handle& hover(F&& f) noexcept - { - _menu->access(_index)._common._hover_change = - std::forward<F>(f); - - return *this; - } - - entry_handle& tooltip(const std::string_view x) noexcept - { - _menu->access(_index)._common._tooltip = x; - return *this; - } - }; + } +}; - private: - std::vector<impl::menu_entry> _entries; - std::string_view _title; - int _cursor_idx{0}; - std::function<void()> _escape_fn; - std::function<void(int)> _key_fn; +} // namespace impl - // TODO VR: (P2) hack for map menu, make this nicer... - bool _two_columns{false}; +class menu +{ +public: + class entry_handle_base + { + protected: + menu* _menu; + std::size_t _index; - void assert_valid_idx(const int idx) const + public: + explicit entry_handle_base(menu& m, const std::size_t i) noexcept + : _menu{&m}, _index{i} { - assert(idx >= 0); - assert(idx < static_cast<int>(_entries.size())); } - impl::menu_entry& access(const int idx) noexcept + template <typename F> + entry_handle_base& hover(F&& f) noexcept { - assert_valid_idx(idx); - return _entries[idx]; + entry()._common._hover_change = std::forward<F>(f); + return *this; } - const impl::menu_entry& access(const int idx) const noexcept + entry_handle_base& tooltip(const std::string_view x) noexcept { - assert_valid_idx(idx); - return _entries[idx]; + entry()._common._tooltip = x; + return *this; } - template <typename T> - T& access_variant(const int idx) noexcept + [[nodiscard]] impl::menu_entry& entry() noexcept { - return std::get<T>(access(idx)._variant); + return _menu->access(_index); } - template <typename T> - const T& access_variant(const int idx) const noexcept + [[nodiscard]] const impl::menu_entry& entry() const noexcept { - return std::get<T>(access(idx)._variant); + return _menu->access(_index); } + }; - void key_option(const int key, const int idx) - { - const bool isLeft = (key == K_LEFTARROW); - const auto adjustF = quake::util::makeMenuAdjuster<float>(isLeft); - const auto adjustI = quake::util::makeMenuAdjuster<int>(isLeft); - - assert_valid_idx(idx); - - auto& e = _entries[idx]; - - quake::util::match( - e._variant, // - [&](const impl::menu_entry_value<bool>& x) { - bool& v = *(x._getter()); - v = !v; - }, - [&](const impl::menu_entry_cvar<float>& x) { - const auto& [inc, min, max] = x._bounds; - adjustF(*(x._cvar_getter()), inc, min, max); - }, - [&](const impl::menu_entry_cvar<int>& x) { - const auto& [inc, min, max] = x._bounds; - adjustI(*(x._cvar_getter()), inc, min, max); - }, - [&](const impl::menu_entry_cvar<bool>& x) { - adjustI(*(x._cvar_getter()), 1, 0, 1); - }, - [&](const impl::menu_entry_value_labeled_cvar<int>& x) { - const auto& [inc, min, max] = x._bounds; - adjustI(*(x._cvar_getter()), inc, min, max); - }, - [&](const impl::menu_entry_action& x) { x._action(); }, - [&](const impl::menu_entry_action_slider& x) { - x._action_slide(isLeft ? -1 : 1); - }, - [&](const impl::menu_entry_separator&) {}); - } + template <typename T> + class entry_handle : public entry_handle_base + { + public: + using entry_handle_base::entry_handle_base; - [[nodiscard]] bool entry_is_selectable_at(const int idx) + T& operator*() noexcept { - assert_valid_idx(idx); - return !std::holds_alternative<impl::menu_entry_separator>( - _entries[idx]._variant); + return _menu->access_variant<T>(_index); } - template <typename T, typename... Args> - entry_handle<T> emplace_and_get_handle( - const impl::menu_entry_common& common, Args&&... args) noexcept + const T& operator*() const noexcept { - const auto index = _entries.size(); - - _entries.emplace_back(common, - impl::menu_entry_variant{T{std::forward<Args>(args)...}}); - - return entry_handle<T>{*this, index}; + return _menu->access_variant<T>(_index); } - - public: - menu(const std::string_view title, std::function<void()> escape_fn, - bool two_columns = false) noexcept - : _title{title}, _escape_fn{std::move(escape_fn)}, _two_columns{ - two_columns} + T* operator->() noexcept { + return &_menu->access_variant<T>(_index); } - template <typename F> - void on_key(F&& f) + const T* operator->() const noexcept { - _key_fn = std::forward<F>(f); + return &_menu->access_variant<T>(_index); } + }; - template <typename T, typename CvarGetter> - auto add_cvar_getter_entry(const std::string_view label, - CvarGetter&& cvar_getter, const menu_bounds<T> bounds = {}) - { - return emplace_and_get_handle<impl::menu_entry_cvar<T>>( - {label}, std::forward<CvarGetter>(cvar_getter), bounds); - } +private: + std::vector<impl::menu_entry> _entries; + std::string_view _title; + int _cursor_idx{0}; + std::function<void()> _escape_fn; + std::function<void(int, impl::menu_entry&)> _key_fn; - template <typename T> - auto add_cvar_entry(const std::string_view label, cvar_t& cvar, - const menu_bounds<T> bounds = {}) - { - return add_cvar_getter_entry( - label, [&cvar] { return &cvar; }, bounds); - } + static constexpr int items_per_column = 25; - template <typename T, typename CvarGetter, typename... EnumLabels> - auto add_cvar_getter_enum_entry(const std::string_view label, - CvarGetter&& cvar_getter, const EnumLabels... enum_labels) - { - const auto enum_labels_fn = [enum_labels...]( - int x) -> std::string_view { - static std::array<std::string_view, sizeof...(enum_labels)> - strs{enum_labels...}; - return strs[static_cast<int>(x)]; - }; - - return emplace_and_get_handle< - impl::menu_entry_value_labeled_cvar<int>>({label}, - std::forward<CvarGetter>(cvar_getter), - menu_bounds<int>{ - 1, 0, static_cast<int>(sizeof...(enum_labels)) - 1}, - enum_labels_fn); - } + // TODO VR: (P2) hack for map menu, make this nicer... + bool _two_columns{false}; - template <typename T, typename Getter> - auto add_getter_entry(const std::string_view label, Getter&& getter, - const menu_bounds<T> bounds = {}) - { - return emplace_and_get_handle<impl::menu_entry_value<T>>( - {label}, std::forward<Getter>(getter), bounds); - } + void assert_valid_idx(const int idx) const; - template <typename F> - auto add_action_entry(const std::string_view label, F&& f) - { - return emplace_and_get_handle<impl::menu_entry_action>( - {label}, std::forward<F>(f)); - } + impl::menu_entry& access(const int idx) noexcept; - template <typename FAction, typename FRange> - auto add_action_slider_entry( - const std::string_view label, FAction&& fAction, FRange&& fRange) - { - return emplace_and_get_handle<impl::menu_entry_action_slider>( - {label}, std::forward<FAction>(fAction), - std::forward<FRange>(fRange)); - } + const impl::menu_entry& access(const int idx) const noexcept; - void add_separator() - { - // TODO VR: (P2) not nice, separator should not have a common - _entries.emplace_back( - impl::menu_entry_common{}, impl::menu_entry_separator{}); - } + template <typename T> + T& access_variant(const int idx) noexcept + { + return std::get<T>(access(idx)._variant); + } - void enter() - { - // Hover current entry. - auto& curr_hover_change_fn = - access(_cursor_idx)._common._hover_change; - - if(curr_hover_change_fn) - { - curr_hover_change_fn(true); - } - } + template <typename T> + const T& access_variant(const int idx) const noexcept + { + return std::get<T>(access(idx)._variant); + } - void leave() - { - // Un-hover current entry. - auto& curr_hover_change_fn = - access(_cursor_idx)._common._hover_change; - - if(curr_hover_change_fn) - { - curr_hover_change_fn(false); - } - } + void key_option(const int key, const int idx); - void key(const int key) - { - const auto update_hover = [this](const int prev_cursor_idx, - const int curr_cursor_idx) { - if(curr_cursor_idx == prev_cursor_idx) - { - return; - } - - auto& prev_hover_change_fn = - access(prev_cursor_idx)._common._hover_change; - - if(prev_hover_change_fn) - { - prev_hover_change_fn(false); - } - - auto& curr_hover_change_fn = - access(curr_cursor_idx)._common._hover_change; - - if(curr_hover_change_fn) - { - curr_hover_change_fn(true); - } - }; - - switch(key) - { - case K_ESCAPE: - { - VID_SyncCvars(); // sync cvars before leaving menu. - // FIXME: there are other ways to leave - // menu - S_LocalSound("misc/menu1.wav"); - - // TODO VR: (P2) have some sort of menu stack instead of - // going back manually - assert(_escape_fn); - _escape_fn(); - - leave(); - - break; - } - - case K_UPARROW: - { - S_LocalSound("misc/menu1.wav"); - - const auto prev_cursor_idx = _cursor_idx; - - do - { - --_cursor_idx; - } while(_cursor_idx >= 0 && - !entry_is_selectable_at(_cursor_idx)); - - if(_cursor_idx < 0) - { - _cursor_idx = static_cast<int>(_entries.size() - 1); - - while(!entry_is_selectable_at(_cursor_idx)) - { - --_cursor_idx; - } - } - - update_hover(prev_cursor_idx, _cursor_idx); - break; - } - - case K_DOWNARROW: - { - S_LocalSound("misc/menu1.wav"); - - const auto prev_cursor_idx = _cursor_idx; - - do - { - ++_cursor_idx; - } while(_cursor_idx < static_cast<int>(_entries.size()) && - !entry_is_selectable_at(_cursor_idx)); - - if(_cursor_idx >= static_cast<int>(_entries.size())) - { - _cursor_idx = 0; - - while(!entry_is_selectable_at(_cursor_idx)) - { - ++_cursor_idx; - } - } - - update_hover(prev_cursor_idx, _cursor_idx); - break; - } - - case K_LEFTARROW: [[fallthrough]]; - case K_RIGHTARROW: - { - S_LocalSound("misc/menu3.wav"); - key_option(key, _cursor_idx); - break; - } - - case K_ENTER: - { - m_entersound = true; - key_option(key, _cursor_idx); - break; - } - } - - if(_key_fn) - { - _key_fn(key); - } - } + [[nodiscard]] bool entry_is_selectable_at(const int idx); - void draw() - { - int y = 4; - - // plaque - // M_DrawTransPic(16, y, Draw_CachePic("gfx/qplaque.lmp")); - - // customize header - // qpic_t* p = Draw_CachePic("gfx/ttl_cstm.lmp"); - // M_DrawPic((320 - p->width) / 2, y, p); - - y += 28; - - // title - M_PrintWhite((320 - 8 * _title.size()) / 2, y, _title.data()); - y += 16; - - char buf[512]{}; - int idx{0}; - - constexpr int char_size = 8; - constexpr int label_padding = 26; - - const auto get_label_x = [&, this](const std::string_view s) { - if(_two_columns) - { - return 70 + (120 * (idx / 25)); - } - - return 8 + ((label_padding - static_cast<int>(s.size())) * - char_size); - }; - - const auto print_label = [&get_label_x, &y]( - const std::string_view s) { - M_Print(get_label_x(s), y, s.data()); - }; - - const auto print_as_float_str = [&buf, &y](const float value) { - snprintf(buf, sizeof(buf), "%.4f", value); - M_Print(240, y, buf); - }; - - const auto print_as_int_str = [&buf, &y](const int value) { - snprintf(buf, sizeof(buf), "%d", value); - M_Print(240, y, buf); - }; - - const auto print_as_bool_str = [&buf, &y](const bool value) { - snprintf(buf, sizeof(buf), value ? "On" : "Off"); - M_Print(240, y, buf); - }; - - const auto print_as_str = [&buf, &y](const std::string_view value) { - snprintf(buf, sizeof(buf), "%s", value.data()); - M_Print(240, y, buf); - }; - - const auto print_tooltip = [&buf](const std::string_view value) { - snprintf(buf, sizeof(buf), "%s", value.data()); - M_PrintWhiteByWrapping(28, 340, 50, buf); - }; - - { - const auto& curr_tooltip = access(_cursor_idx)._common._tooltip; - if(!curr_tooltip.empty()) - { - print_tooltip(curr_tooltip); - } - } - - for(const impl::menu_entry& e : _entries) - { - const std::string_view& e_label = e._common._label; - - quake::util::match( - e._variant, // - [&](const impl::menu_entry_value<bool>& x) { - print_label(e_label); - print_as_bool_str(*(x._getter())); - }, - [&](const impl::menu_entry_cvar<float>& x) { - print_label(e_label); - - const float value = x._cvar_getter()->value; - if(x._printer == nullptr) - { - print_as_float_str(value); - } - else - { - x._printer(buf, sizeof(buf), value); - M_Print(240, y, buf); - } - }, - [&](const impl::menu_entry_cvar<int>& x) { - print_label(e_label); - - const int value = x._cvar_getter()->value; - if(x._printer == nullptr) - { - print_as_int_str(value); - } - else - { - x._printer(buf, sizeof(buf), value); - M_Print(240, y, buf); - } - }, - [&](const impl::menu_entry_cvar<bool>& x) { - print_label(e_label); - print_as_bool_str(x._cvar_getter()->value); - }, - [&](const impl::menu_entry_value_labeled_cvar<int>& x) { - print_label(e_label); - print_as_str(x._value_label_fn( - static_cast<int>(x._cvar_getter()->value))); - }, - [&](const impl::menu_entry_action&) { - print_label(e_label); - - if(!_two_columns) - { - print_as_str("(X)"); - } - }, - [&](const impl::menu_entry_action_slider& x) { - print_label(e_label); - M_DrawSlider(250, y, x._range()); - }, - [&](const impl::menu_entry_separator&) {}); - - if(_cursor_idx == idx) - { - if(_two_columns) - { - M_DrawCharacter((70 - 15) + (120 * (idx / 25)), y, - 12 + ((int)(realtime * 4) & 1)); - } - else - { - M_DrawCharacter(230, y, 12 + ((int)(realtime * 4) & 1)); - } - } - - ++idx; - y += 8; - - if(_two_columns) - { - if(idx % 25 == 0) - { - y = 32 + 16; - } - } - } - } + template <typename T, typename... Args> + entry_handle<T> emplace_and_get_handle( + const impl::menu_entry_common& common, Args&&... args) noexcept + { + const auto index = _entries.size(); - [[nodiscard]] int cursor_idx() noexcept - { - return _cursor_idx; - } + _entries.emplace_back( + common, impl::menu_entry_variant{T{std::forward<Args>(args)...}}); + + return entry_handle<T>{*this, index}; + } + + void update_hover( + const int prev_cursor_idx, const int curr_cursor_idx) noexcept; + + void remove_entry_at(const std::size_t index) noexcept; + void move_cursor(const int offset) noexcept; + +public: + menu(const std::string_view title, std::function<void()> escape_fn, + bool two_columns = false) noexcept; + + void clear(); + + template <typename F> + void on_key(F&& f) + { + _key_fn = std::forward<F>(f); + } + + template <typename T, typename CvarGetter> + auto add_cvar_getter_entry(const std::string_view label, + CvarGetter&& cvar_getter, const menu_bounds<T> bounds = {}) + { + return emplace_and_get_handle<impl::menu_entry_cvar<T>>( + {label}, std::forward<CvarGetter>(cvar_getter), bounds); + } + + template <typename T> + auto add_cvar_entry(const std::string_view label, cvar_t& cvar, + const menu_bounds<T> bounds = {}) + { + return add_cvar_getter_entry( + label, [&cvar] { return &cvar; }, bounds); + } + + template <typename T, typename CvarGetter, typename... EnumLabels> + auto add_cvar_getter_enum_entry(const std::string_view label, + CvarGetter&& cvar_getter, const EnumLabels... enum_labels) + { + const auto enum_labels_fn = [enum_labels...]( + int x) -> std::string_view { + static std::array<std::string_view, sizeof...(enum_labels)> strs{ + enum_labels...}; + return strs[static_cast<int>(x)]; + }; + + return emplace_and_get_handle<impl::menu_entry_value_labeled_cvar<int>>( + {label}, std::forward<CvarGetter>(cvar_getter), + menu_bounds<int>{ + 1, 0, static_cast<int>(sizeof...(enum_labels)) - 1}, + enum_labels_fn); + } + + template <typename T, typename Getter, typename... EnumLabels> + auto add_getter_enum_entry(const std::string_view label, Getter&& getter, + const EnumLabels... enum_labels) + { + const auto enum_labels_fn = [enum_labels...]( + int x) -> std::string_view { + static std::array<std::string_view, sizeof...(enum_labels)> strs{ + enum_labels...}; + return strs[static_cast<int>(x)]; + }; + + return emplace_and_get_handle<impl::menu_entry_value_labeled<int>>( + {label}, std::forward<Getter>(getter), + menu_bounds<int>{ + 1, 0, static_cast<int>(sizeof...(enum_labels)) - 1}, + enum_labels_fn); + } + + template <typename T, typename Getter> + auto add_getter_entry(const std::string_view label, Getter&& getter, + const menu_bounds<T> bounds = {}) + { + return emplace_and_get_handle<impl::menu_entry_value<T>>( + {label}, std::forward<Getter>(getter), bounds); + } + + template <typename F> + auto add_action_entry(const std::string_view label, F&& f) + { + return emplace_and_get_handle<impl::menu_entry_action>( + {label}, std::forward<F>(f)); + } + + template <typename FAction, typename FRange> + auto add_action_slider_entry( + const std::string_view label, FAction&& fAction, FRange&& fRange) + { + return emplace_and_get_handle<impl::menu_entry_action_slider>({label}, + std::forward<FAction>(fAction), std::forward<FRange>(fRange)); + } + + void add_separator(); + + auto add_entry_ptr(impl::menu_entry& entry){ + return emplace_and_get_handle<impl::menu_entry_ptr>(entry._common, + &entry); +} + + void enter(); + void leave(); + void key(const int key); + void draw(const int offset_x = 0, const int offset_y = 0); + + [[nodiscard]] int cursor_idx() noexcept; + [[nodiscard]] const std::string_view& title() noexcept; + [[nodiscard]] int entry_count() const noexcept; + [[nodiscard]] bool empty() const noexcept; +}; - [[nodiscard]] const std::string_view& title() noexcept - { - return _title; - } - }; } // namespace quake diff --git a/Quake/modelgen.hpp b/Quake/modelgen.hpp index 0bbfce71..d6248652 100644 --- a/Quake/modelgen.hpp +++ b/Quake/modelgen.hpp @@ -19,8 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _MODELGEN_H -#define _MODELGEN_H +#pragma once // // modelgen.h: header file for model generation program @@ -32,21 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // * pass data from one to the other via model files. * // ********************************************************* -#ifdef INCLUDELIBS - -#include <stdlib.h> -#include <stdio.h> -#include <math.h> -#include <string.h> - -#include "cmdlib.hpp" -#include "scriplib.hpp" -#include "trilib.hpp" -#include "lbmlib.hpp" -#include "mathlib.hpp" -#include "quakeglm.hpp" - -#endif +#include "quakeglm_qvec3.hpp" +#include "q_stdinc.hpp" #define ALIAS_VERSION 6 @@ -78,10 +64,10 @@ typedef struct { int ident; int version; - glm::vec3 scale; - glm::vec3 scale_origin; + qvec3 scale; + qvec3 scale_origin; float boundingradius; - glm::vec3 eyeposition; + qvec3 eyeposition; int numskins; int skinwidth; int skinheight; @@ -160,5 +146,3 @@ typedef struct #define IDPOLYHEADER (('O' << 24) + ('P' << 16) + ('D' << 8) + 'I') // little-endian "IDPO" - -#endif /* _MODELGEN_H */ diff --git a/Quake/msg.cpp b/Quake/msg.cpp new file mode 100644 index 00000000..6e964185 --- /dev/null +++ b/Quake/msg.cpp @@ -0,0 +1,380 @@ +#include "msg.hpp" +#include "q_stdinc.hpp" +#include "sizebuf.hpp" +#include "byteorder.hpp" +#include "common.hpp" +#include "mathlib.hpp" +#include "net.hpp" +#include "protocol.hpp" +#include "sys.hpp" + +// +// writing functions +// + +void MSG_WriteChar(sizebuf_t* sb, int c) +{ +#ifdef PARANOID + if(c < -128 || c > 127) + { + Sys_Error("MSG_WriteChar: range error"); + } +#endif + + byte* const buf = (byte*)SZ_GetSpace(sb, 1); + buf[0] = c; +} + +void MSG_WriteUnsignedChar(sizebuf_t* sb, unsigned char c) +{ +#ifdef PARANOID + if(c < 0 || c > 255) + { + Sys_Error("MSG_WriteByte: range error"); + } +#endif + + byte* const buf = (byte*)SZ_GetSpace(sb, 1); + buf[0] = c; +} + +void MSG_WriteByte(sizebuf_t* sb, int c) +{ +#ifdef PARANOID + // TODO VR: (P2) always fires + // if(c < 0 || c > 255) Sys_Error("MSG_WriteByte: range error"); +#endif + + byte* const buf = (byte*)SZ_GetSpace(sb, 1); + buf[0] = c; +} + +void MSG_WriteShort(sizebuf_t* sb, int c) +{ +#ifdef PARANOID + // if(c < -32768 || c > 32767) + // if (c < 0|| c > 65535) + { + // TODO VR: (P2) always fires - seems both signed and unsigned are being + // passed Sys_Error("MSG_WriteShort: range error"); + } +#endif + + byte* const buf = (byte*)SZ_GetSpace(sb, 2); + // buf[0] = c & 0b1111'1111'0000'0000; + buf[0] = c & 0xff; + buf[1] = c >> 8; +} + +void MSG_WriteLong(sizebuf_t* sb, int c) +{ + byte* const buf = (byte*)SZ_GetSpace(sb, 4); + buf[0] = c & 0xff; + buf[1] = (c >> 8) & 0xff; + buf[2] = (c >> 16) & 0xff; + buf[3] = c >> 24; +} + +void MSG_WriteFloat(sizebuf_t* sb, float f) +{ + union + { + float f; + int l; + } dat; + + dat.f = f; + dat.l = LittleLong(dat.l); + + SZ_Write(sb, &dat.l, 4); +} + +void MSG_WriteString(sizebuf_t* sb, const char* s) +{ + if(!s) + { + SZ_Write(sb, "", 1); + } + else + { + SZ_Write(sb, s, Q_strlen(s) + 1); + } +} + +// johnfitz -- original behavior, 13.3 fixed point coords, max range +-4096 +void MSG_WriteCoord16(sizebuf_t* sb, float f) +{ + MSG_WriteShort(sb, Q_rint(f * 8)); +} + +// johnfitz -- 16.8 fixed point coords, max range +-32768 +void MSG_WriteCoord24(sizebuf_t* sb, float f) +{ + MSG_WriteShort(sb, f); + MSG_WriteByte(sb, (int)(f * 255) % 255); +} + +// johnfitz -- 32-bit float coords +void MSG_WriteCoord32f(sizebuf_t* sb, float f) +{ + MSG_WriteFloat(sb, f); +} + +void MSG_WriteCoord(sizebuf_t* sb, float f, unsigned int flags) +{ + if(flags & PRFL_FLOATCOORD) + { + MSG_WriteFloat(sb, f); + } + else if(flags & PRFL_INT32COORD) + { + MSG_WriteLong(sb, Q_rint(f * 16)); + } + else if(flags & PRFL_24BITCOORD) + { + MSG_WriteCoord24(sb, f); + } + else + { + MSG_WriteCoord16(sb, f); + } +} + +void MSG_WriteAngle(sizebuf_t* sb, float f, unsigned int flags) +{ + if(flags & PRFL_FLOATANGLE) + { + MSG_WriteFloat(sb, f); + } + else if(flags & PRFL_SHORTANGLE) + { + MSG_WriteShort(sb, Q_rint(f * 65536.0 / 360.0) & 65535); + } + else + { + MSG_WriteByte(sb, Q_rint(f * 256.0 / 360.0) & 255); + // johnfitz -- use Q_rint instead of (int) + } +} + +// johnfitz -- for PROTOCOL_FITZQUAKE +void MSG_WriteAngle16(sizebuf_t* sb, float f, unsigned int flags) +{ + if(flags & PRFL_FLOATANGLE) + { + MSG_WriteFloat(sb, f); + } + else + { + MSG_WriteShort(sb, Q_rint(f * 65536.0 / 360.0) & 65535); + } +} +// johnfitz + +void MSG_WriteVec3(sizebuf_t* sb, const qvec3& v, unsigned int flags) +{ + MSG_WriteCoord(sb, v[0], flags); + MSG_WriteCoord(sb, v[1], flags); + MSG_WriteCoord(sb, v[2], flags); +} + +// +// reading functions +// +int msg_readcount; +bool msg_badread; + +void MSG_BeginReading() +{ + msg_readcount = 0; + msg_badread = false; +} + +// returns -1 and sets msg_badread if no more characters are available +[[nodiscard]] int MSG_ReadChar() +{ + if(msg_readcount + 1 > net_message.cursize) + { + msg_badread = true; + return -1; + } + + const int c = (signed char)net_message.data[msg_readcount]; + msg_readcount++; + + return c; +} + +[[nodiscard]] unsigned char MSG_ReadUnsignedChar() +{ + if(msg_readcount + 1 > net_message.cursize) + { + msg_badread = true; + return -1; + } + + const auto c = (unsigned char)net_message.data[msg_readcount]; + msg_readcount++; + + return c; +} + +[[nodiscard]] int MSG_ReadByte() +{ + if(msg_readcount + 1 > net_message.cursize) + { + msg_badread = true; + return -1; + } + + const int c = (unsigned char)net_message.data[msg_readcount]; + msg_readcount++; + + return c; +} + +[[nodiscard]] int MSG_ReadShort() +{ + if(msg_readcount + 2 > net_message.cursize) + { + msg_badread = true; + return -1; + } + + const int c = (short)(net_message.data[msg_readcount] + + (net_message.data[msg_readcount + 1] << 8)); + + msg_readcount += 2; + + return c; +} + +[[nodiscard]] int MSG_ReadLong() +{ + + if(msg_readcount + 4 > net_message.cursize) + { + msg_badread = true; + return -1; + } + + const int c = net_message.data[msg_readcount] + + (net_message.data[msg_readcount + 1] << 8) + + (net_message.data[msg_readcount + 2] << 16) + + (net_message.data[msg_readcount + 3] << 24); + + msg_readcount += 4; + + return c; +} + +[[nodiscard]] float MSG_ReadFloat() +{ + union + { + byte b[4]; + float f; + int l; + } dat; + + dat.b[0] = net_message.data[msg_readcount]; + dat.b[1] = net_message.data[msg_readcount + 1]; + dat.b[2] = net_message.data[msg_readcount + 2]; + dat.b[3] = net_message.data[msg_readcount + 3]; + msg_readcount += 4; + + dat.l = LittleLong(dat.l); + + return dat.f; +} + +[[nodiscard]] const char* MSG_ReadString() +{ + static char string[2048]; + + size_t l = 0; + do + { + const int c = MSG_ReadByte(); + if(c == -1 || c == 0) + { + break; + } + string[l] = c; + l++; + } while(l < sizeof(string) - 1); + + string[l] = 0; + + return string; +} + +// johnfitz -- original behavior, 13.3 fixed point coords, max range +-4096 +[[nodiscard]] float MSG_ReadCoord16() +{ + return MSG_ReadShort() * (1.0 / 8); +} + +// johnfitz -- 16.8 fixed point coords, max range +-32768 +[[nodiscard]] float MSG_ReadCoord24() +{ + return MSG_ReadShort() + MSG_ReadByte() * (1.0 / 255); +} + +// johnfitz -- 32-bit float coords +[[nodiscard]] float MSG_ReadCoord32f() +{ + return MSG_ReadFloat(); +} + +[[nodiscard]] float MSG_ReadCoord(unsigned int flags) +{ + if(flags & PRFL_FLOATCOORD) + { + return MSG_ReadFloat(); + } + + if(flags & PRFL_INT32COORD) + { + return MSG_ReadLong() * (1.0 / 16.0); + } + + if(flags & PRFL_24BITCOORD) + { + return MSG_ReadCoord24(); + } + + return MSG_ReadCoord16(); +} + +[[nodiscard]] float MSG_ReadAngle(unsigned int flags) +{ + if(flags & PRFL_FLOATANGLE) + { + return MSG_ReadFloat(); + } + + if(flags & PRFL_SHORTANGLE) + { + return MSG_ReadShort() * (360.0 / 65536); + } + + return MSG_ReadChar() * (360.0 / 256); +} + +// johnfitz -- for PROTOCOL_FITZQUAKE +[[nodiscard]] float MSG_ReadAngle16(unsigned int flags) +{ + if(flags & PRFL_FLOATANGLE) + { + return MSG_ReadFloat(); // make sure + } + + return MSG_ReadShort() * (360.0 / 65536); +} +// johnfitz + +[[nodiscard]] qvec3 MSG_ReadVec3(unsigned int flags) +{ + return {MSG_ReadCoord(flags), MSG_ReadCoord(flags), MSG_ReadCoord(flags)}; +} diff --git a/Quake/msg.hpp b/Quake/msg.hpp new file mode 100644 index 00000000..8c2fafaf --- /dev/null +++ b/Quake/msg.hpp @@ -0,0 +1,57 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +#include "quakeglm_qvec3.hpp" + +struct sizebuf_t; + +extern int msg_readcount; +extern bool msg_badread; // set if a read goes beyond end of message + +void MSG_WriteChar(sizebuf_t* sb, int c); +void MSG_WriteUnsignedChar(sizebuf_t* sb, unsigned char c); +void MSG_WriteByte(sizebuf_t* sb, int c); +void MSG_WriteShort(sizebuf_t* sb, int c); +void MSG_WriteLong(sizebuf_t* sb, int c); +void MSG_WriteFloat(sizebuf_t* sb, float f); +void MSG_WriteString(sizebuf_t* sb, const char* s); +void MSG_WriteCoord(sizebuf_t* sb, float f, unsigned int flags); +void MSG_WriteAngle(sizebuf_t* sb, float f, unsigned int flags); +void MSG_WriteAngle16(sizebuf_t* sb, float f, unsigned int flags); +void MSG_WriteVec3(sizebuf_t* sb, const qvec3& v, unsigned int flags); + +void MSG_BeginReading(); + +[[nodiscard]] int MSG_ReadChar(); +[[nodiscard]] unsigned char MSG_ReadUnsignedChar(); +[[nodiscard]] int MSG_ReadByte(); +[[nodiscard]] int MSG_ReadShort(); +[[nodiscard]] int MSG_ReadLong(); +[[nodiscard]] float MSG_ReadFloat(); +[[nodiscard]] const char* MSG_ReadString(); +[[nodiscard]] float MSG_ReadCoord(unsigned int flags); +[[nodiscard]] float MSG_ReadAngle(unsigned int flags); +[[nodiscard]] float MSG_ReadAngle16(unsigned int flags); +[[nodiscard]] qvec3 MSG_ReadVec3(unsigned int flags); diff --git a/Quake/mstate.hpp b/Quake/mstate.hpp new file mode 100644 index 00000000..2402fa03 --- /dev/null +++ b/Quake/mstate.hpp @@ -0,0 +1,88 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +enum m_state_e +{ + m_none, + m_main, + m_singleplayer, + m_load, + m_save, + m_multiplayer, + m_botcontrol, + m_setup, + m_net, + m_options, + m_quakevrquicksettings, + m_quakevrsettings, + m_quakevrdevtools, + m_quakevrchangemap, + m_video, + m_vr, + m_vrgameplay, + m_wpn_offset, + m_sbar_offset, + m_hotspot, + m_vrtorso, + m_map, + m_debug, + m_keys, + m_help, + m_quit, + m_lanconfig, + m_gameoptions, + m_search, + m_slist, + m_qvrs_menu, + m_qvrs_crosshair, + m_qvrs_particle, + m_qvrs_locomotion, + m_qvrs_handguncalibration, + m_qvrs_playercalibration, + m_qvrs_melee, + m_qvrs_aiming, + m_qvrs_immersion, + m_qvrs_graphical, + m_qvrs_hudconfiguration, + m_qvrs_hotspot, + m_qvrs_torso, + m_qvrs_changemap_vanilla, + m_qvrs_changemap_soa, + m_qvrs_changemap_doe, + m_qvrs_changemap_dopa, + m_qvrs_changemap_honey, + m_qvrs_changemap_extra, + m_qvrs_transparencyoptions, + m_qvrdt_weaponconfiguration1, + m_qvrdt_weaponconfiguration2, + m_qvrdt_weaponconfiguration3, + m_qvrdt_weaponconfiguration4, + m_qvrdt_fingerconfiguration, + m_qvrdt_debugutilities, +}; + +extern enum m_state_e m_state; +extern enum m_state_e m_return_state; + diff --git a/Quake/net.hpp b/Quake/net.hpp index a6c22526..de8929e7 100644 --- a/Quake/net.hpp +++ b/Quake/net.hpp @@ -29,13 +29,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. whole engine */ -#ifndef _QUAKE_NET_H -#define _QUAKE_NET_H +#pragma once +#include "cvar.hpp" +#include "common.hpp" +#include "sizebuf.hpp" #define NET_NAMELEN 64 -#define NET_MAXMESSAGE 65000 /* ericw -- was 32000 */ +#define NET_MAXMESSAGE 65535 /* ericw -- was 32000 */ extern int DEFAULTnet_hostport; extern int net_hostport; @@ -47,10 +49,10 @@ extern sizebuf_t net_message; extern int net_activeconnections; -void NET_Init(void); -void NET_Shutdown(void); +void NET_Init(); +void NET_Shutdown(); -struct qsocket_s* NET_CheckNewConnections(void); +struct qsocket_s* NET_CheckNewConnections(); // returns a new connection number if there is one pending, else -1 struct qsocket_s* NET_Connect(const char* host); @@ -89,7 +91,7 @@ void NET_Close(struct qsocket_s* sock); // from a server. // A netcon_t number will not be reused until this function is called for it -void NET_Poll(void); +void NET_Poll(); // Server list related globals: @@ -99,8 +101,8 @@ extern bool slistLocal; extern int hostCacheCount; -void NET_Slist_f(void); -void NET_SlistSort(void); +void NET_Slist_f(); +void NET_SlistSort(); const char* NET_SlistPrintServer(int n); const char* NET_SlistPrintServerName(int n); @@ -111,5 +113,3 @@ extern bool ipxAvailable; extern bool tcpipAvailable; extern char my_ipx_address[NET_NAMELEN]; extern char my_tcpip_address[NET_NAMELEN]; - -#endif /* _QUAKE_NET_H */ diff --git a/Quake/net_defs.hpp b/Quake/net_defs.hpp index a52c82cf..4bf450f6 100644 --- a/Quake/net_defs.hpp +++ b/Quake/net_defs.hpp @@ -21,8 +21,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __NET_DEFS_H -#define __NET_DEFS_H +#pragma once + +#include "q_stdinc.hpp" +#include "net.hpp" struct qsockaddr { @@ -168,13 +170,13 @@ typedef struct const char* name; bool initialized; sys_socket_t controlSock; - sys_socket_t (*Init)(void); - void (*Shutdown)(void); + sys_socket_t (*Init)(); + void (*Shutdown)(); void (*Listen)(bool state); sys_socket_t (*Open_Socket)(int port); int (*Close_Socket)(sys_socket_t socketid); int (*Connect)(sys_socket_t socketid, struct qsockaddr* addr); - sys_socket_t (*CheckNewConnections)(void); + sys_socket_t (*CheckNewConnections)(); int (*Read)( sys_socket_t socketid, byte* buf, int len, struct qsockaddr* addr); int (*Write)( @@ -198,18 +200,18 @@ typedef struct { const char* name; bool initialized; - int (*Init)(void); + int (*Init)(); void (*Listen)(bool state); void (*SearchForHosts)(bool xmit); qsocket_t* (*Connect)(const char* host); - qsocket_t* (*CheckNewConnections)(void); + qsocket_t* (*CheckNewConnections)(); int (*QGetMessage)(qsocket_t* sock); int (*QSendMessage)(qsocket_t* sock, sizebuf_t* data); int (*SendUnreliableMessage)(qsocket_t* sock, sizebuf_t* data); bool (*CanSendMessage)(qsocket_t* sock); bool (*CanSendUnreliableMessage)(qsocket_t* sock); void (*Close)(qsocket_t* sock); - void (*Shutdown)(void); + void (*Shutdown)(); } net_driver_t; extern net_driver_t net_drivers[]; @@ -225,9 +227,9 @@ extern int messagesReceived; extern int unreliableMessagesSent; extern int unreliableMessagesReceived; -qsocket_t* NET_NewQSocket(void); +qsocket_t* NET_NewQSocket(); void NET_FreeQSocket(qsocket_t*); -double SetNetTime(void); +double SetNetTime(); #define HOSTCACHESIZE 8 @@ -258,4 +260,3 @@ typedef struct _PollProcedure void SchedulePollProcedure(PollProcedure* pp, double timeOffset); -#endif /* __NET_DEFS_H */ diff --git a/Quake/net_dgrm.cpp b/Quake/net_dgrm.cpp index b4975ae4..c55eced2 100644 --- a/Quake/net_dgrm.cpp +++ b/Quake/net_dgrm.cpp @@ -29,6 +29,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "net_defs.hpp" #include "net_dgrm.hpp" +#include "progs.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" +#include "net.hpp" +#include "menu.hpp" +#include "keys.hpp" +#include "msg.hpp" +#include "screen.hpp" +#include "sys.hpp" +#include "server.hpp" +#include "vid.hpp" +#include "input.hpp" +#include "byteorder.hpp" // these two macros are to make the code more readable #define sfunc net_landrivers[sock->landriver] @@ -607,7 +622,7 @@ static void Test_Poll(void* unused) MSG_BeginReading(); control = BigLong(*((int*)net_message.data)); - MSG_ReadLong(); + (void)MSG_ReadLong(); if(control == -1) { break; @@ -626,7 +641,7 @@ static void Test_Poll(void* unused) Sys_Error("Unexpected repsonse to Player Info request\n"); } - MSG_ReadByte(); /* playerNumber */ + (void)MSG_ReadByte(); /* playerNumber */ Q_strcpy(name, MSG_ReadString()); colors = MSG_ReadLong(); frags = MSG_ReadLong(); @@ -766,7 +781,7 @@ static void Test2_Poll(void* unused) MSG_BeginReading(); control = BigLong(*((int*)net_message.data)); - MSG_ReadLong(); + (void)MSG_ReadLong(); if(control == -1) { goto Error; @@ -1013,7 +1028,7 @@ static qsocket_t* _Datagram_CheckNewConnections() MSG_BeginReading(); control = BigLong(*((int*)net_message.data)); - MSG_ReadLong(); + (void)MSG_ReadLong(); if(control == -1) { return nullptr; @@ -1336,7 +1351,7 @@ static void _Datagram_SearchForHosts(bool xmit) MSG_BeginReading(); control = BigLong(*((int*)net_message.data)); - MSG_ReadLong(); + (void)MSG_ReadLong(); if(control == -1) { continue; @@ -1518,7 +1533,7 @@ static qsocket_t* _Datagram_Connect(const char* host) MSG_BeginReading(); control = BigLong(*((int*)net_message.data)); - MSG_ReadLong(); + (void)MSG_ReadLong(); if(control == -1) { ret = 0; diff --git a/Quake/net_dgrm.hpp b/Quake/net_dgrm.hpp index 54a3df71..6bb79a04 100644 --- a/Quake/net_dgrm.hpp +++ b/Quake/net_dgrm.hpp @@ -20,20 +20,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __NET_DATAGRAM_H -#define __NET_DATAGRAM_H +#pragma once -int Datagram_Init(void); +int Datagram_Init(); void Datagram_Listen(bool state); void Datagram_SearchForHosts(bool xmit); qsocket_t* Datagram_Connect(const char* host); -qsocket_t* Datagram_CheckNewConnections(void); +qsocket_t* Datagram_CheckNewConnections(); int Datagram_GetMessage(qsocket_t* sock); int Datagram_SendMessage(qsocket_t* sock, sizebuf_t* data); int Datagram_SendUnreliableMessage(qsocket_t* sock, sizebuf_t* data); bool Datagram_CanSendMessage(qsocket_t* sock); bool Datagram_CanSendUnreliableMessage(qsocket_t* sock); void Datagram_Close(qsocket_t* sock); -void Datagram_Shutdown(void); - -#endif /* __NET_DATAGRAM_H */ +void Datagram_Shutdown(); diff --git a/Quake/net_loop.cpp b/Quake/net_loop.cpp index 3d0f3e11..7e1c5dba 100644 --- a/Quake/net_loop.cpp +++ b/Quake/net_loop.cpp @@ -26,6 +26,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "net_defs.hpp" #include "net_loop.hpp" +#include "console.hpp" +#include "net.hpp" +#include "client.hpp" +#include "sys.hpp" +#include "server.hpp" static bool localconnectpending = false; static qsocket_t* loop_client = nullptr; diff --git a/Quake/net_loop.hpp b/Quake/net_loop.hpp index 7b7c35b9..1d51e598 100644 --- a/Quake/net_loop.hpp +++ b/Quake/net_loop.hpp @@ -20,21 +20,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __NET_LOOP_H -#define __NET_LOOP_H +#pragma once // net_loop.h -int Loop_Init(void); +int Loop_Init(); void Loop_Listen(bool state); void Loop_SearchForHosts(bool xmit); qsocket_t* Loop_Connect(const char* host); -qsocket_t* Loop_CheckNewConnections(void); +qsocket_t* Loop_CheckNewConnections(); int Loop_GetMessage(qsocket_t* sock); int Loop_SendMessage(qsocket_t* sock, sizebuf_t* data); int Loop_SendUnreliableMessage(qsocket_t* sock, sizebuf_t* data); bool Loop_CanSendMessage(qsocket_t* sock); bool Loop_CanSendUnreliableMessage(qsocket_t* sock); void Loop_Close(qsocket_t* sock); -void Loop_Shutdown(void); - -#endif /* __NET_LOOP_H */ +void Loop_Shutdown(); diff --git a/Quake/net_main.cpp b/Quake/net_main.cpp index faf9d566..3e4df762 100644 --- a/Quake/net_main.cpp +++ b/Quake/net_main.cpp @@ -25,6 +25,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "net_sys.hpp" #include "quakedef.hpp" #include "net_defs.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "console.hpp" +#include "net.hpp" +#include "server.hpp" +#include "sys.hpp" +#include "client.hpp" qsocket_t* net_activeSockets = nullptr; qsocket_t* net_freeSockets = nullptr; @@ -411,10 +418,12 @@ static void Slist_Send(void* unused) { continue; } + if(net_drivers[net_driverlevel].initialized == false) { continue; } + dfunc.SearchForHosts(true); } @@ -436,10 +445,12 @@ static void Slist_Poll(void* unused) { continue; } + if(net_drivers[net_driverlevel].initialized == false) { continue; } + dfunc.SearchForHosts(false); } @@ -458,6 +469,7 @@ static void Slist_Poll(void* unused) { PrintSlistTrailer(); } + slistInProgress = false; slistSilent = false; slistLocal = true; @@ -504,6 +516,7 @@ qsocket_t* NET_Connect(const char* host) break; } } + if(n < hostCacheCount) { goto JustDoIt; @@ -525,6 +538,7 @@ qsocket_t* NET_Connect(const char* host) { return nullptr; } + host = hostcache[0].cname; Con_Printf("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host); } diff --git a/Quake/net_sys.hpp b/Quake/net_sys.hpp index ae0df80d..943cfc42 100644 --- a/Quake/net_sys.hpp +++ b/Quake/net_sys.hpp @@ -21,8 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __NET_SYS_H__ -#define __NET_SYS_H__ +#pragma once #include <sys/types.h> #include <errno.h> @@ -195,6 +194,3 @@ static_assert(offsetof(struct sockaddr, sa_family) == SA_FAM_OFFSET); the terminating NUL) are limited to HOST_NAME_MAX bytes'. */ #define MAXHOSTNAMELEN 256 #endif /* MAXHOSTNAMELEN */ - - -#endif /* __NET_SYS_H__ */ diff --git a/Quake/net_udp.cpp b/Quake/net_udp.cpp index d14be89d..d8599686 100644 --- a/Quake/net_udp.cpp +++ b/Quake/net_udp.cpp @@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "net_sys.hpp" #include "quakedef.hpp" #include "net_defs.hpp" +#include "common.hpp" +#include "console.hpp" static sys_socket_t net_acceptsocket = INVALID_SOCKET; // socket for fielding new connections @@ -73,13 +75,8 @@ sys_socket_t UDP_Init() } else #endif - if(!(local = gethostbyname(buff))) + if(!(local = gethostbyname(buff))) { -// TODO VR: (P2) mingw hack -#ifdef __MINGW32__ -#define hstrerror(x) strerror((x)) -#endif - Con_SafePrintf( "UDP_Init: gethostbyname failed (%s)\n", hstrerror(h_errno)); } diff --git a/Quake/net_udp.hpp b/Quake/net_udp.hpp index c37706e6..4bd7e671 100644 --- a/Quake/net_udp.hpp +++ b/Quake/net_udp.hpp @@ -20,16 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __net_udp_h -#define __net_udp_h +#pragma once -sys_socket_t UDP_Init(void); -void UDP_Shutdown(void); +sys_socket_t UDP_Init(); +void UDP_Shutdown(); void UDP_Listen(bool state); sys_socket_t UDP_OpenSocket(int port); int UDP_CloseSocket(sys_socket_t socketid); int UDP_Connect(sys_socket_t socketid, struct qsockaddr* addr); -sys_socket_t UDP_CheckNewConnections(void); +sys_socket_t UDP_CheckNewConnections(); int UDP_Read(sys_socket_t socketid, byte* buf, int len, struct qsockaddr* addr); int UDP_Write( sys_socket_t socketid, byte* buf, int len, struct qsockaddr* addr); @@ -42,5 +41,3 @@ int UDP_GetAddrFromName(const char* name, struct qsockaddr* addr); int UDP_AddrCompare(struct qsockaddr* addr1, struct qsockaddr* addr2); int UDP_GetSocketPort(struct qsockaddr* addr); int UDP_SetSocketPort(struct qsockaddr* addr, int port); - -#endif /* __net_udp_h */ diff --git a/Quake/net_wins.cpp b/Quake/net_wins.cpp index 3f5f459f..c4471651 100644 --- a/Quake/net_wins.cpp +++ b/Quake/net_wins.cpp @@ -17,13 +17,16 @@ 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 "q_stdinc.hpp" #include "arch_def.hpp" #include "net_sys.hpp" #include "quakedef.hpp" #include "net_defs.hpp" +#include "common.hpp" +#include "console.hpp" +#include "sys.hpp" static sys_socket_t net_acceptsocket = INVALID_SOCKET; // socket for fielding new connections diff --git a/Quake/net_wins.hpp b/Quake/net_wins.hpp index 92a46ed1..c13ea384 100644 --- a/Quake/net_wins.hpp +++ b/Quake/net_wins.hpp @@ -20,16 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __NET_WINSOCK_H -#define __NET_WINSOCK_H +#pragma once -sys_socket_t WINS_Init(void); -void WINS_Shutdown(void); +sys_socket_t WINS_Init(); +void WINS_Shutdown(); void WINS_Listen(bool state); sys_socket_t WINS_OpenSocket(int port); int WINS_CloseSocket(sys_socket_t socketid); int WINS_Connect(sys_socket_t socketid, struct qsockaddr* addr); -sys_socket_t WINS_CheckNewConnections(void); +sys_socket_t WINS_CheckNewConnections(); int WINS_Read( sys_socket_t socketid, byte* buf, int len, struct qsockaddr* addr); int WINS_Write( @@ -43,5 +42,3 @@ int WINS_GetAddrFromName(const char* name, struct qsockaddr* addr); int WINS_AddrCompare(struct qsockaddr* addr1, struct qsockaddr* addr2); int WINS_GetSocketPort(struct qsockaddr* addr); int WINS_SetSocketPort(struct qsockaddr* addr, int port); - -#endif /* __NET_WINSOCK_H */ diff --git a/Quake/net_wipx.cpp b/Quake/net_wipx.cpp index 1d236b69..b49d1b98 100644 --- a/Quake/net_wipx.cpp +++ b/Quake/net_wipx.cpp @@ -24,13 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "q_stdinc.hpp" #include "arch_def.hpp" +#include "console.hpp" #include "net_sys.hpp" #include <wsipx.h> #include "quakedef.hpp" #include "net_defs.hpp" #include "net_wipx.hpp" - - +#include "common.hpp" +#include "sys.hpp" static sys_socket_t net_acceptsocket = INVALID_SOCKET; // socket for fielding new connections diff --git a/Quake/net_wipx.hpp b/Quake/net_wipx.hpp index 18ed1d20..65779cb8 100644 --- a/Quake/net_wipx.hpp +++ b/Quake/net_wipx.hpp @@ -20,16 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __NET_WINIPX_H -#define __NET_WINIPX_H +#pragma once -sys_socket_t WIPX_Init(void); -void WIPX_Shutdown(void); +sys_socket_t WIPX_Init(); +void WIPX_Shutdown(); void WIPX_Listen(bool state); sys_socket_t WIPX_OpenSocket(int port); int WIPX_CloseSocket(sys_socket_t socketid); int WIPX_Connect(sys_socket_t socketid, struct qsockaddr* addr); -sys_socket_t WIPX_CheckNewConnections(void); +sys_socket_t WIPX_CheckNewConnections(); int WIPX_Read( sys_socket_t socketid, byte* buf, int len, struct qsockaddr* addr); int WIPX_Write( @@ -43,5 +42,3 @@ int WIPX_GetAddrFromName(const char* name, struct qsockaddr* addr); int WIPX_AddrCompare(struct qsockaddr* addr1, struct qsockaddr* addr2); int WIPX_GetSocketPort(struct qsockaddr* addr); int WIPX_SetSocketPort(struct qsockaddr* addr, int port); - -#endif /* __NET_WINIPX_H */ diff --git a/Quake/opengl_ext.cpp b/Quake/opengl_ext.cpp deleted file mode 100644 index bcef8452..00000000 --- a/Quake/opengl_ext.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "opengl_ext.hpp" - -namespace -{ - struct - { - void* func; - const char* name; - } quake_gl_exts[] = { - {&glBindFramebufferEXT, "glBindFramebufferEXT"}, - {&glBlitFramebufferEXT, "glBlitFramebufferEXT"}, - {&glDeleteFramebuffersEXT, "glDeleteFramebuffersEXT"}, - {&glGenFramebuffersEXT, "glGenFramebuffersEXT"}, - {&glTexImage2DMultisampleEXT, "glTexImage2DMultisample"}, - {&glFramebufferTexture2DEXT, "glFramebufferTexture2DEXT"}, - {&glFramebufferRenderbufferEXT, "glFramebufferRenderbufferEXT"}, - {&glCheckFramebufferStatusEXT, "glCheckFramebufferStatusEXT"}, - {&wglSwapIntervalEXT, "wglSwapIntervalEXT"}, - {nullptr, nullptr}, - }; -} // namespace - -PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT; -PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; -PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT; -PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT; -PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisampleEXT; - -namespace quake::gl -{ - [[nodiscard]] bool InitOpenGLExtensions() noexcept - { - static bool extensions_initialized{false}; - - if(extensions_initialized) - { - return true; - } - - for(int i = 0; quake_gl_exts[i].func; ++i) - { - void* const func = SDL_GL_GetProcAddress(quake_gl_exts[i].name); - if(!func) - { - return false; - } - - *((void**)quake_gl_exts[i].func) = func; - } - - extensions_initialized = true; - return extensions_initialized; - } -} // namespace quake::gl diff --git a/Quake/opengl_ext.hpp b/Quake/opengl_ext.hpp deleted file mode 100644 index 37114eaa..00000000 --- a/Quake/opengl_ext.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "quakedef.hpp" - -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 - -typedef void(APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)( - GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -typedef bool(APIENTRYP PFNWGLSWAPINTERVALEXTPROC)(int); - -extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT; -extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT; -extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; -extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT; -extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT; -extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT; -extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT; -extern PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT; -extern PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisampleEXT; - -namespace quake::gl -{ - [[nodiscard]] bool InitOpenGLExtensions() noexcept; -} diff --git a/Quake/pl_linux.cpp b/Quake/pl_linux.cpp index 7f05d979..ef977e6c 100644 --- a/Quake/pl_linux.cpp +++ b/Quake/pl_linux.cpp @@ -23,15 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "quakedef.hpp" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) +#include "platform.hpp" + #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif static const Uint8 bmp_bytes[] = { #include "qs_bmp.hpp" @@ -50,13 +44,8 @@ void PL_SetWindowIcon(void) if(icon == nullptr) return; /* make pure magenta (#ff00ff) tranparent */ colorkey = SDL_MapRGB(icon->format, 255, 0, 255); -#if defined(USE_SDL2) SDL_SetColorKey(icon, SDL_TRUE, colorkey); SDL_SetWindowIcon((SDL_Window*)VID_GetWindow(), icon); -#else - SDL_SetColorKey(icon, SDL_SRCCOLORKEY, colorkey); - SDL_WM_SetIcon(icon, nullptr); -#endif SDL_FreeSurface(icon); } @@ -68,7 +57,6 @@ void PL_VID_Shutdown(void) char* PL_GetClipboardData(void) { char* data = nullptr; -#if defined(USE_SDL2) char* cliptext = SDL_GetClipboardText(); if(cliptext != nullptr) @@ -82,7 +70,6 @@ char* PL_GetClipboardData(void) data = (char*)Z_Malloc(size); q_strlcpy(data, cliptext, size); } -#endif return data; } diff --git a/Quake/pl_osx.m b/Quake/pl_osx.m index 2def67d5..8adb6fa8 100644 --- a/Quake/pl_osx.m +++ b/Quake/pl_osx.m @@ -23,15 +23,10 @@ */ #include "quakedef.h" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) +#include "platform.hpp" + #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif + #import <Cocoa/Cocoa.h> void PL_SetWindowIcon(void) diff --git a/Quake/pl_win.cpp b/Quake/pl_win.cpp index 54af53c7..89e0fba3 100644 --- a/Quake/pl_win.cpp +++ b/Quake/pl_win.cpp @@ -23,19 +23,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "quakedef.hpp" + #include <windows.h> -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) +#include "platform.hpp" + +#include "keys.hpp" +#include "vid.hpp" +#include "zone.hpp" +#include "common.hpp" + #include <SDL2/SDL.h> #include <SDL2/SDL_syswm.h> -#else -#include <SDL/SDL.h> -#include <SDL/SDL_syswm.h> -#endif -#else -#include "SDL.h" -#include "SDL_syswm.h" -#endif static HICON icon; @@ -55,18 +53,13 @@ void PL_SetWindowIcon() SDL_VERSION(&wminfo.version); -#if defined(USE_SDL2) if(SDL_GetWindowWMInfo((SDL_Window*)VID_GetWindow(), &wminfo) != SDL_TRUE) { return; /* wrong SDL version */ } hwnd = wminfo.info.win.window; -#else - if(SDL_GetWMInfo(&wminfo) != 1) return; /* wrong SDL version */ - hwnd = wminfo.window; -#endif #ifdef _WIN64 SetClassLongPtr(hwnd, GCLP_HICON, (LONG_PTR)icon); #else diff --git a/Quake/platform.hpp b/Quake/platform.hpp index b36c1232..32ea7f2a 100644 --- a/Quake/platform.hpp +++ b/Quake/platform.hpp @@ -22,19 +22,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_PLATFORM_H -#define _QUAKE_PLATFORM_H +#pragma once /* platform dependent way to set the window icon */ -void PL_SetWindowIcon(void); +void PL_SetWindowIcon(); /* platform dependent cleanup */ -void PL_VID_Shutdown(void); +void PL_VID_Shutdown(); /* retrieve text from the clipboard (returns Z_Malloc()'ed data) */ -char* PL_GetClipboardData(void); +char* PL_GetClipboardData(); /* show an error dialog */ void PL_ErrorDialog(const char* text); - -#endif /* _QUAKE_PLATFORM_H */ diff --git a/Quake/pr_cmds.cpp b/Quake/pr_cmds.cpp index 29fefefa..3d2de629 100644 --- a/Quake/pr_cmds.cpp +++ b/Quake/pr_cmds.cpp @@ -21,13 +21,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "host.hpp" +#include "console.hpp" +#include "cvar.hpp" +#include "pr_comp.hpp" +#include "progs.hpp" +#include "protocol.hpp" #include "quakedef.hpp" #include "quakeglm.hpp" #include "util.hpp" +#include "worldtext.hpp" +#include "console.hpp" +#include "glquake.hpp" +#include "msg.hpp" +#include "sys.hpp" +#include "cmd.hpp" #include <cmath> +#include <glm/gtx/rotate_vector.hpp> +#include "quakeglm_qquat.hpp" -#define STRINGTEMP_BUFFERS 16 +#define STRINGTEMP_BUFFERS 32 #define STRINGTEMP_LENGTH 1024 static char pr_string_temp[STRINGTEMP_BUFFERS][STRINGTEMP_LENGTH]; static byte pr_string_tempindex = 0; @@ -44,13 +58,22 @@ static char* PR_GetTempString() #define MSG_ALL 2 // reliable to all #define MSG_INIT 3 // write to the init string -[[nodiscard]] static QUAKE_FORCEINLINE glm::vec3 extractVector( +[[nodiscard]] QUAKE_FORCEINLINE static qvec3 extractVector( const int parm) noexcept { float* const ptr = G_VECTOR(parm); return {ptr[0], ptr[1], ptr[2]}; } +QUAKE_FORCEINLINE static void returnVector(const qvec3& v) noexcept +{ + G_VECTOR(OFS_RETURN)[0] = v[0]; + G_VECTOR(OFS_RETURN)[1] = v[1]; + G_VECTOR(OFS_RETURN)[2] = v[2]; +} + + + /* =============================================================================== @@ -209,7 +232,7 @@ will not set internal links correctly, so clipping would be messed up. This should be called when an object is spawned, and then only if it is teleported. -setorigin (entity, origin) +setorigin(entity, origin) ================= */ static void PF_setorigin() @@ -220,19 +243,19 @@ static void PF_setorigin() } static void SetMinMaxSize( - edict_t* e, const glm::vec3& minvec, const glm::vec3& maxvec, bool rotate) + edict_t* e, const qvec3& minvec, const qvec3& maxvec, bool rotate) { - glm::vec3 rmin; + qvec3 rmin; - glm::vec3 rmax; - float bounds[2][3]; + qvec3 rmax; + qvec3 bounds[2]; float xvector[2]; float yvector[2]; float a; - glm::vec3 base; + qvec3 base; - glm::vec3 transformed; + qvec3 transformed; int i; int j; @@ -252,8 +275,8 @@ static void SetMinMaxSize( if(!rotate) { - VectorCopy(minvec, rmin); - VectorCopy(maxvec, rmax); + rmin = minvec; + rmax = maxvec; } else { @@ -265,8 +288,8 @@ static void SetMinMaxSize( yvector[0] = -sin(a); yvector[1] = cos(a); - VectorCopy(minvec, bounds[0]); - VectorCopy(maxvec, bounds[1]); + bounds[0] = minvec; + bounds[1] = maxvec; rmin[0] = rmin[1] = rmin[2] = FLT_MAX; rmax[0] = rmax[1] = rmax[2] = -FLT_MAX; @@ -318,7 +341,7 @@ PF_setsize the size box is rotated by the current angle -setsize (entity, minvector, maxvector) +setsize(entity, minvector, maxvector) ================= */ static void PF_setsize() @@ -476,13 +499,13 @@ static void PF_normalize() if(new_temp == 0) { - VectorCopy(vec3_zero, G_VECTOR(OFS_RETURN)); + returnVector(vec3_zero); } else { new_temp = 1 / new_temp; - const auto res = v * static_cast<float>(new_temp); - VectorCopy(res, G_VECTOR(OFS_RETURN)); + const auto res = v * static_cast<qfloat>(new_temp); + returnVector(res); } } @@ -791,17 +814,11 @@ Larger attenuations will drop off. */ static void PF_sound() { - const char* sample; - int channel; - edict_t* entity; - int volume; - float attenuation; - - entity = G_EDICT(OFS_PARM0); - channel = G_FLOAT(OFS_PARM1); - sample = G_STRING(OFS_PARM2); - volume = G_FLOAT(OFS_PARM3) * 255; - attenuation = G_FLOAT(OFS_PARM4); + edict_t* entity = G_EDICT(OFS_PARM0); + const int channel = G_FLOAT(OFS_PARM1); + const char* sample = G_STRING(OFS_PARM2); + const int volume = G_FLOAT(OFS_PARM3) * 255; + const float attenuation = G_FLOAT(OFS_PARM4); if(volume < 0 || volume > 255) { @@ -907,7 +924,7 @@ scalar checkpos (entity, vector) ================= */ #if 0 -static void PF_checkpos (void) +static void PF_checkpos(void) { } #endif @@ -976,7 +993,7 @@ static int PF_newcheckclient(int check) } // get the PVS for the entity - glm::vec3 org = ent->v.origin + ent->v.view_ofs; + qvec3 org = ent->v.origin + ent->v.view_ofs; mleaf_t* leaf = Mod_PointInLeaf(org, sv.worldmodel); byte* pvs = Mod_LeafPVS(leaf, sv.worldmodel); @@ -1039,7 +1056,7 @@ static void PF_checkclient() // if current entity can't possibly see the check entity, return 0 self = PROG_TO_EDICT(pr_global_struct->self); - const glm::vec3 view = self->v.origin + self->v.view_ofs; + const qvec3 view = self->v.origin + self->v.view_ofs; leaf = Mod_PointInLeaf(view, sv.worldmodel); l = (leaf - sv.worldmodel->leafs) - 1; if((l < 0) || !(checkpvs[l >> 3] & (1 << (l & 7)))) @@ -1111,11 +1128,7 @@ float cvar (string) */ static void PF_cvar() { - const char* str; - - str = G_STRING(OFS_PARM0); - - G_FLOAT(OFS_RETURN) = Cvar_VariableValue(str); + G_FLOAT(OFS_RETURN) = Cvar_VariableValue(G_STRING(OFS_PARM0)); } /* @@ -1127,14 +1140,316 @@ float cvar (string) */ static void PF_cvar_set() { - const char* var; + const char* var = G_STRING(OFS_PARM0); + const char* val = G_STRING(OFS_PARM1); - const char* val; + Cvar_Set(var, val); +} - var = G_STRING(OFS_PARM0); - val = G_STRING(OFS_PARM1); +/* +================= +PF_cvar_hmake - Cvar_Set(var, val); +float cvar_hmake (string) +================= +*/ +static void PF_cvar_hmake() +{ + G_INT(OFS_RETURN) = Cvar_MakeHandle(G_STRING(OFS_PARM0)); +} + +/* +================= +PF_cvar_hget + +float cvar_hget (float) +================= +*/ +static void PF_cvar_hget() +{ + G_FLOAT(OFS_RETURN) = Cvar_GetValueFromHandle(G_INT(OFS_PARM0)); +} + +/* +================= +PF_cvar_hget + +float cvar_hget (float) +================= +*/ +static void PF_cvar_hset() +{ + Cvar_SetValueFromHandle(G_INT(OFS_PARM0), G_FLOAT(OFS_PARM1)); +} + +template <typename F> +static void forAllActiveOrSpawnedClients(F&& f) +{ + for(int i = 0; i < svs.maxclients; i++) + { + client_t& client = svs.clients[i]; + + if(client.active || client.spawned) + { + f(client); + } + } +} + +static void PF_worldtext_hmake() +{ + if(!sv.hasAnyFreeWorldTextHandle()) + { + Host_Error("No free world text handles available"); + return; + } + + const WorldTextHandle wth = sv.makeWorldTextHandle(); + + forAllActiveOrSpawnedClients( + [&](client_t& client) { sv.SendMsg_WorldTextHMake(client, wth); }); + + G_INT(OFS_RETURN) = wth; +} + +static void PF_worldtext_hsettext() +{ + const WorldTextHandle wth = G_INT(OFS_PARM0); + const char* text = G_STRING(OFS_PARM1); + + if(!sv.isValidWorldTextHandle(wth)) + { + Host_Error("Invalid world text handle '%d'", wth); + return; + } + + sv.getWorldText(wth)._text = text; + + forAllActiveOrSpawnedClients([&](client_t& client) { + sv.SendMsg_WorldTextHSetText(client, wth, text); + }); +} + +static void PF_worldtext_hsetpos() +{ + const WorldTextHandle wth = G_INT(OFS_PARM0); + const qvec3 pos = extractVector(OFS_PARM1); + + if(!sv.isValidWorldTextHandle(wth)) + { + Host_Error("Invalid world text handle '%d'", wth); + return; + } + + sv.getWorldText(wth)._pos = pos; + + forAllActiveOrSpawnedClients([&](client_t& client) { + sv.SendMsg_WorldTextHSetPos(client, wth, pos); + }); +} + +static void PF_worldtext_hsetangles() +{ + const WorldTextHandle wth = G_INT(OFS_PARM0); + const qvec3 angles = extractVector(OFS_PARM1); + + if(!sv.isValidWorldTextHandle(wth)) + { + Host_Error("Invalid world text handle '%d'", wth); + return; + } + + sv.getWorldText(wth)._angles = angles; + + forAllActiveOrSpawnedClients([&](client_t& client) { + sv.SendMsg_WorldTextHSetAngles(client, wth, angles); + }); +} + +static void PF_worldtext_hsethalign() +{ + const WorldTextHandle wth = G_INT(OFS_PARM0); + const float hAlignFloat = G_FLOAT(OFS_PARM1); + + if(!sv.isValidWorldTextHandle(wth)) + { + Host_Error("Invalid world text handle '%d'", wth); + return; + } + + const auto hAlign = static_cast<WorldText::HAlign>(hAlignFloat); + + sv.getWorldText(wth)._hAlign = hAlign; + + forAllActiveOrSpawnedClients([&](client_t& client) { + sv.SendMsg_WorldTextHSetHAlign(client, wth, hAlign); + }); +} + +static void PF_strlen() +{ + G_FLOAT(OFS_RETURN) = std::strlen(G_STRING(OFS_PARM0)); +} + +static void PF_nthchar() +{ + G_FLOAT(OFS_RETURN) = + (G_STRING(OFS_PARM0))[static_cast<int>(G_FLOAT(OFS_PARM1))]; +} + +static void PF_substr() +{ + const char* s = G_STRING(OFS_PARM0); + const int b = static_cast<int>(G_FLOAT(OFS_PARM1)); + const int e = static_cast<int>(G_FLOAT(OFS_PARM2)); + + char* buf = PR_GetTempString(); + int i = 0; + for(; i < e - b; ++i) + { + buf[i] = s[b + i]; + } + + buf[i] = '\0'; + + // TODO VR: (P1): does this continuously allocate new strings? + G_INT(OFS_RETURN) = PR_SetEngineString(buf); +} + +static void PF_calcthrowangle() +{ + // TODO VR: (P2): repetition with `SV_AddGravityImpl` + const auto getGravity = [&](const float entGravity) { + extern cvar_t sv_gravity; + return (double)entGravity * (double)sv_gravity.value * host_frametime; + }; + + const float inEntGravity = G_FLOAT(OFS_PARM0); + + const float entGravity = inEntGravity == 0 ? 1.f : inEntGravity; + const float throwSpeed = G_FLOAT(OFS_PARM1); + const qvec3 fromPos = extractVector(OFS_PARM2); + const qvec3 toPos = extractVector(OFS_PARM3); + + float xx = toPos.x - fromPos.x; + float xy = toPos.y - fromPos.y; + float x = std::sqrt(xx * xx + xy * xy); + float z = fromPos.z - toPos.z; + + float v = throwSpeed; + float g = -getGravity(entGravity); + + float xSqrt = (v * v * v * v) - (g * (g * (x * x) + 2.f * z * (v * v))); + + // Not enough range + if(xSqrt < 0) + { + G_FLOAT(OFS_RETURN) = 0.0f; + return; + } + + G_FLOAT(OFS_RETURN) = + glm::degrees(std::atan2(((v * v) - std::sqrt(xSqrt)), (g * x))); +} + +static void PF_rotatevec() +{ + const qvec3 vec = extractVector(OFS_PARM0); + const qvec3 upx = extractVector(OFS_PARM1); + const float angle = glm::radians(G_FLOAT(OFS_PARM2)); + + auto rers = + glm::normalize(vec + glm::vec3{0.0, 0.0, std::abs(std::tan(angle))}); + returnVector(rers); + return; + + // up direction: + glm::vec3 up(0.0, 0.0, 1.0); + // find right vector: + auto right = glm::cross(glm::normalize(vec), glm::normalize(up)); + + qquat m; + m = glm::rotate(m, angle, right); + m = glm::normalize(m); + + qvec3 rr = m * vec; + returnVector(rr); + return; + + // TODO VR: (P1): fix this. consider checking QSS source code for rotation + // code + + + + glm::mat4 rotationMat(1); // Creates a identity matrix + rotationMat = glm::rotate(rotationMat, angle, right); + auto res = glm::vec3(rotationMat * glm::vec4(vec, 1.0)); + + returnVector(res); + + // returnVector(glm::rotate(vec, angle, up)); +} + +static void PF_sin() +{ + G_FLOAT(OFS_RETURN) = std::sin(glm::radians(G_FLOAT(OFS_PARM0))); +} + +static void PF_cos() +{ + G_FLOAT(OFS_RETURN) = std::cos(glm::radians(G_FLOAT(OFS_PARM0))); +} + +static void PF_tan() +{ + G_FLOAT(OFS_RETURN) = std::tan(glm::radians(G_FLOAT(OFS_PARM0))); +} + +static void PF_asin() +{ + G_FLOAT(OFS_RETURN) = glm::degrees(std::asin(G_FLOAT(OFS_PARM0))); +} + +static void PF_acos() +{ + G_FLOAT(OFS_RETURN) = glm::degrees(std::acos(G_FLOAT(OFS_PARM0))); +} + +static void PF_atan() +{ + G_FLOAT(OFS_RETURN) = glm::degrees(std::atan(G_FLOAT(OFS_PARM0))); +} + +static void PF_sqrt() +{ + G_FLOAT(OFS_RETURN) = std::sqrt(G_FLOAT(OFS_PARM0)); +} + + +static void PF_atan2() +{ + G_FLOAT(OFS_RETURN) = + glm::degrees(std::atan2(G_FLOAT(OFS_PARM0), G_FLOAT(OFS_PARM1))); +} + + +/* +================= +PF_cvar_hclear + +void cvar_hclear () +================= +*/ +static void PF_cvar_hclear() +{ + Cvar_ClearAllHandles(); +} + +static void PF_redirectvector() +{ + const auto input = extractVector(OFS_PARM0); + const auto exemplar = extractVector(OFS_PARM1); + returnVector(quake::util::redirectVector(input, exemplar)); } /* @@ -1165,7 +1480,7 @@ static void PF_findradius() continue; } - glm::vec3 eorg; + qvec3 eorg; for(int j = 0; j < 3; j++) { eorg[j] = org[j] - (ent->v.origin[j] + @@ -1386,7 +1701,7 @@ static void PF_walkmove() float yaw; float dist; - glm::vec3 move; + qvec3 move; dfunction_t* oldf; int oldself; @@ -1427,26 +1742,46 @@ void() droptofloor */ static void PF_droptofloor() { - edict_t* ent = PROG_TO_EDICT(pr_global_struct->self); + edict_t& ent = *PROG_TO_EDICT(pr_global_struct->self); - glm::vec3 end = ent->v.origin; - end[2] -= 256; + qfloat highestZ = std::numeric_limits<qfloat>::lowest(); + edict_t* groundEnt = nullptr; - trace_t trace = - SV_Move(ent->v.origin, ent->v.mins, ent->v.maxs, end, false, ent); + const auto processHit = [&](const qvec3& xyOffset) { + const qvec3 corner = + ent.v.origin + xyOffset + qvec3{0, 0, ent.v.mins[2]}; - if(trace.fraction == 1 || trace.allsolid) - { - G_FLOAT(OFS_RETURN) = 0; - } - else + const trace_t trace = SV_MoveTrace( + corner, corner + qvec3{0, 0, -256._qf}, MOVE_NOMONSTERS, &ent); + + if(!quake::util::hitSomething(trace) || trace.allsolid) + { + return false; + } + + if(highestZ < trace.endpos[2]) + { + highestZ = trace.endpos[2]; + groundEnt = trace.ent; + } + + return true; + }; + + const bool anyFloorHit = + processHit(vec3_zero) || quake::util::anyXYCorner(ent, processHit); + + if(!anyFloorHit) { - ent->v.origin = trace.endpos; - SV_LinkEdict(ent, false); - quake::util::addFlag(ent, FL_ONGROUND); - ent->v.groundentity = EDICT_TO_PROG(trace.ent); - G_FLOAT(OFS_RETURN) = 1; + G_FLOAT(OFS_RETURN) = 0; // FALSE + return; } + + ent.v.origin[2] = highestZ - ent.v.mins[2]; + SV_LinkEdict(&ent, false); + quake::util::addFlag(&ent, FL_ONGROUND); + ent.v.groundentity = EDICT_TO_PROG(groundEnt); + G_FLOAT(OFS_RETURN) = 1; // TRUE } /* @@ -1587,17 +1922,17 @@ static void PF_aim() edict_t* check; edict_t* bestent; - glm::vec3 start; + qvec3 start; - glm::vec3 dir; + qvec3 dir; - glm::vec3 end; + qvec3 end; int i; int j; trace_t tr; - float dist; + qfloat dist; float bestdist; float speed; @@ -1611,17 +1946,17 @@ static void PF_aim() // try sending a trace straight dir = pr_global_struct->v_forward; - end = start + 2048.f * dir; + end = start + 2048._qf * dir; tr = SV_MoveTrace(start, end, false, ent); if(tr.ent && tr.ent->v.takedamage == DAMAGE_AIM && (!teamplay.value || ent->v.team <= 0 || ent->v.team != tr.ent->v.team)) { - VectorCopy(pr_global_struct->v_forward, G_VECTOR(OFS_RETURN)); + returnVector(pr_global_struct->v_forward); return; } // try all possible entities - glm::vec3 bestdir = dir; + qvec3 bestdir = dir; bestdist = sv_aim.value; bestent = nullptr; @@ -1665,14 +2000,14 @@ static void PF_aim() { dir = bestent->v.origin - ent->v.origin; dist = DotProduct(dir, pr_global_struct->v_forward); - end = pr_global_struct->v_forward * dist; + end = pr_global_struct->v_forward * float(dist); end[2] = dir[2]; end = safeNormalize(end); - VectorCopy(end, G_VECTOR(OFS_RETURN)); + returnVector(end); } else { - VectorCopy(bestdir, G_VECTOR(OFS_RETURN)); + returnVector(bestdir); } } @@ -1808,6 +2143,11 @@ static void PF_WriteEntity() MSG_WriteShort(WriteDest(), G_EDICTNUM(OFS_PARM1)); } +static void PF_WriteVec3() +{ + MSG_WriteVec3(WriteDest(), extractVector(OFS_PARM1), sv.protocolflags); +} + //============================================================================= static void PF_makestatic() @@ -2015,6 +2355,42 @@ static builtin_t pr_builtin[] = { PF_max, // #83 PF_makeforward, // #84 PF_maprange, // #85 + + PF_cvar_hmake, // #86 + PF_cvar_hget, // #87 + PF_cvar_hclear, // #88 + + PF_redirectvector, // #89 + + PF_cvar_hset, // #90 + + PF_worldtext_hmake, // #91 + PF_worldtext_hsettext, // #92 + PF_worldtext_hsetpos, // #93 + PF_worldtext_hsetangles, // #94 + + PF_WriteVec3, // #95 + + PF_worldtext_hsethalign, // #96 + + PF_strlen, // #97 + PF_nthchar, // #98 + PF_substr, // #99 + + PF_calcthrowangle, // #100 + PF_rotatevec, // #101 + + PF_sin, // #102 + PF_cos, // #103 + + PF_asin, // #104 + PF_acos, // #105 + + PF_tan, // #106 + PF_atan, // #107 + + PF_sqrt, // #108 + PF_atan2, // #109 }; builtin_t* pr_builtins = pr_builtin; diff --git a/Quake/pr_comp.hpp b/Quake/pr_comp.hpp index cf8d4daf..791a473f 100644 --- a/Quake/pr_comp.hpp +++ b/Quake/pr_comp.hpp @@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __PR_COMP_H -#define __PR_COMP_H +#pragma once // this file is shared by quake and qcc @@ -193,5 +192,3 @@ typedef struct int entityfields; } dprograms_t; - -#endif /* __PR_COMP_H */ diff --git a/Quake/pr_edict.cpp b/Quake/pr_edict.cpp index e6a611d2..8fe6f4ec 100644 --- a/Quake/pr_edict.cpp +++ b/Quake/pr_edict.cpp @@ -22,8 +22,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // sv_edict.c -- entity dictionary -#include <cassert> +#include "host.hpp" #include "quakedef.hpp" +#include "cmd.hpp" +#include "console.hpp" +#include "crc.hpp" +#include "mathlib.hpp" +#include "zone.hpp" +#include "byteorder.hpp" +#include "progs.hpp" +#include "pr_comp.hpp" +#include "server.hpp" +#include "world.hpp" + +#include <cassert> dprograms_t* progs; dfunction_t* pr_functions; @@ -955,14 +967,7 @@ Used for initial level load and for savegames. */ const char* ED_ParseEdict(const char* data, edict_t* ent) { - ddef_t* key; - char keyname[256]; - bool anglehack; - - bool init; - int n; - - init = false; + bool init = false; // clear it if(ent != sv.edicts) @@ -976,10 +981,12 @@ const char* ED_ParseEdict(const char* data, edict_t* ent) { // parse key data = COM_Parse(data); + if(com_token[0] == '}') { break; } + if(!data) { Host_Error("ED_ParseEntity: EOF without closing brace"); @@ -987,6 +994,7 @@ const char* ED_ParseEdict(const char* data, edict_t* ent) // anglehack is to allow QuakeEd to write single scalar angles // and allow them to be turned into vectors. (FIXME...) + bool anglehack; if(!strcmp(com_token, "angle")) { strcpy(com_token, "angles"); @@ -1003,10 +1011,11 @@ const char* ED_ParseEdict(const char* data, edict_t* ent) strcpy(com_token, "light_lev"); // hack for single light def } + char keyname[256]; q_strlcpy(keyname, com_token, sizeof(keyname)); // another hack to fix keynames with trailing spaces - n = strlen(keyname); + int n = strlen(keyname); while(n && keyname[n - 1] == ' ') { keyname[n - 1] = 0; @@ -1042,7 +1051,7 @@ const char* ED_ParseEdict(const char* data, edict_t* ent) } // johnfitz - key = ED_FindField(keyname); + ddef_t* key = ED_FindField(keyname); if(!key) { // johnfitz -- HACK -- suppress error becuase fog/sky/alpha fields @@ -1053,6 +1062,7 @@ const char* ED_ParseEdict(const char* data, edict_t* ent) Con_DPrintf("\"%s\" is not a field\n", keyname); // johnfitz -- was Con_Printf } + continue; } @@ -1095,7 +1105,6 @@ to call ED_CallSpawnFunctions () to let the objects initialize themselves. */ void ED_LoadFromFile(const char* data) { - dfunction_t* func; edict_t* ent = nullptr; int inhibit = 0; @@ -1106,23 +1115,18 @@ void ED_LoadFromFile(const char* data) { // parse the opening brace data = COM_Parse(data); + if(!data) { break; } + if(com_token[0] != '{') { Host_Error("ED_LoadFromFile: found %s when expecting {", com_token); } - if(!ent) - { - ent = EDICT_NUM(0); - } - else - { - ent = ED_Alloc(); - } + ent = (!ent) ? EDICT_NUM(0) : ED_Alloc(); data = ED_ParseEdict(data, ent); // remove things from different skill levels or deathmatch @@ -1160,7 +1164,7 @@ void ED_LoadFromFile(const char* data) } // look for the spawn function - func = ED_FindFunction(PR_GetString(ent->v.classname)); + dfunction_t* func = ED_FindFunction(PR_GetString(ent->v.classname)); if(!func) { @@ -1196,10 +1200,10 @@ void PR_LoadProgs() CRC_Init(&pr_crc); - progs = (dprograms_t*)COM_LoadHunkFile("progs.dat", nullptr); + progs = (dprograms_t*)COM_LoadHunkFile("vrprogs.dat", nullptr); if(!progs) { - Host_Error("PR_LoadProgs: couldn't load progs.dat"); + Host_Error("PR_LoadProgs: couldn't load vrprogs.dat"); } Con_DPrintf("Programs occupy %iK.\n", com_filesize / 1024); @@ -1216,14 +1220,14 @@ void PR_LoadProgs() if(progs->version != PROG_VERSION) { - Host_Error("progs.dat has wrong version number (%i should be %i)", + Host_Error("vrprogs.dat has wrong version number (%i should be %i)", progs->version, PROG_VERSION); } if(progs->crc != PROGHEADER_CRC) { Host_Error( - "progs.dat system vars have been modified, progdefs.h is out of " + "vrprogs.dat system vars have been modified, progdefs.h is out of " "date"); } @@ -1231,7 +1235,7 @@ void PR_LoadProgs() pr_strings = (char*)progs + progs->ofs_strings; if(progs->ofs_strings + progs->numstrings >= com_filesize) { - Host_Error("progs.dat strings go past end of file\n"); + Host_Error("vrprogs.dat strings go past end of file\n"); } // initialize the strings @@ -1291,7 +1295,7 @@ void PR_LoadProgs() pr_fielddefs[i].ofs = LittleShort(pr_fielddefs[i].ofs); pr_fielddefs[i].s_name = LittleLong(pr_fielddefs[i].s_name); - // johnfitz -- detect alpha support in progs.dat + // johnfitz -- detect alpha support in vrprogs.dat if(!strcmp(pr_strings + pr_fielddefs[i].s_name, "alpha")) { pr_alpha_supported = true; diff --git a/Quake/pr_exec.cpp b/Quake/pr_exec.cpp index 662e7b3c..fb29f784 100644 --- a/Quake/pr_exec.cpp +++ b/Quake/pr_exec.cpp @@ -20,7 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "host.hpp" #include "quakedef.hpp" +#include "console.hpp" +#include "pr_comp.hpp" +#include "progs.hpp" +#include "server.hpp" typedef struct { diff --git a/Quake/progdefs.hpp b/Quake/progdefs.hpp index c7e9acbe..a9b26e84 100644 --- a/Quake/progdefs.hpp +++ b/Quake/progdefs.hpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakeglm.hpp" -#define vec3_t glm::vec3 +#define vec3_t qvec3 #include "progdefs_generated.hpp" diff --git a/Quake/progdefs_generated.hpp b/Quake/progdefs_generated.hpp index 0e5c0b68..25d66e13 100644 --- a/Quake/progdefs_generated.hpp +++ b/Quake/progdefs_generated.hpp @@ -27,6 +27,7 @@ typedef struct globalvars_s float total_monsters; float found_secrets; float killed_monsters; + float spawnServerFromSaveFile; float parm1; float parm2; float parm3; @@ -43,6 +44,22 @@ typedef struct globalvars_s float parm14; float parm15; float parm16; + float parm17; + float parm18; + float parm19; + float parm20; + float parm21; + float parm22; + float parm23; + float parm24; + float parm25; + float parm26; + float parm27; + float parm28; + float parm29; + float parm30; + float parm31; + float parm32; vec3_t v_forward; vec3_t v_up; vec3_t v_right; @@ -66,6 +83,9 @@ typedef struct globalvars_s func_t ClientDisconnect; func_t SetNewParms; func_t SetChangeParms; + func_t OnSpawnServerBeforeLoad; + func_t OnSpawnServerAfterLoad; + func_t OnLoadGame; } globalvars_t; typedef struct entvars_s @@ -81,8 +101,6 @@ typedef struct entvars_s vec3_t velocity; vec3_t angles; vec3_t avelocity; - vec3_t scale; - vec3_t scale_origin; vec3_t punchangle; string_t classname; string_t model; @@ -93,41 +111,18 @@ typedef struct entvars_s vec3_t maxs; vec3_t size; func_t touch; - func_t handtouch; - func_t vr_wpntouch; func_t use; func_t think; - func_t think2; func_t blocked; float nextthink; - float nextthink2; int groundentity; float health; float frags; float weapon; string_t weaponmodel; float weaponframe; - float weapon2; - string_t weaponmodel2; - float weaponframe2; - float prevweapon; - float prevweapon2; - float holsterweapon0; - float holsterweapon1; - float holsterweapon2; - float holsterweapon3; - float holsterweapon4; - float holsterweapon5; - string_t holsterweaponmodel0; - string_t holsterweaponmodel1; - string_t holsterweaponmodel2; - string_t holsterweaponmodel3; - string_t holsterweaponmodel4; - string_t holsterweaponmodel5; float currentammo; - float currentammo2; float ammocounter; - float ammocounter2; float ammo_shells; float ammo_nails; float ammo_rockets; @@ -140,7 +135,6 @@ typedef struct entvars_s float button0; float button1; float button2; - float button3; float impulse; float fixangle; vec3_t v_angle; @@ -175,38 +169,65 @@ typedef struct entvars_s string_t noise1; string_t noise2; string_t noise3; + vec3_t v_viewangle; + vec3_t scale; + vec3_t scale_origin; + float vr_itemId; + func_t handtouch; + func_t vr_wpntouch; + func_t think2; + float nextthink2; + float weaponflags; + float weapon2; + string_t weaponmodel2; + float weaponframe2; + float weaponflags2; + float holsterweapon0; + float holsterweapon1; + float holsterweapon2; + float holsterweapon3; + float holsterweapon4; + float holsterweapon5; + string_t holsterweaponmodel0; + string_t holsterweaponmodel1; + string_t holsterweaponmodel2; + string_t holsterweaponmodel3; + string_t holsterweaponmodel4; + string_t holsterweaponmodel5; + float holsterweaponflags0; + float holsterweaponflags1; + float holsterweaponflags2; + float holsterweaponflags3; + float holsterweaponflags4; + float holsterweaponflags5; + float offhand_hotspot; + float mainhand_hotspot; + float currentammo2; + float ammocounter2; + float button3; + float vryaw; vec3_t handpos; vec3_t handrot; vec3_t handvel; vec3_t handthrowvel; float handvelmag; vec3_t handavel; - vec3_t v_viewangle; vec3_t offhandpos; vec3_t offhandrot; vec3_t offhandvel; vec3_t offhandthrowvel; float offhandvelmag; vec3_t offhandavel; - float touchinghand; + vec3_t headvel; vec3_t muzzlepos; vec3_t offmuzzlepos; - float teleporting; + float vrbits0; vec3_t teleport_target; - float offhand_grabbing; - float offhand_prevgrabbing; - float mainhand_grabbing; - float mainhand_prevgrabbing; - float offhand_forcegrabbing; - float mainhand_forcegrabbing; - float offhand_hotspot; - float mainhand_hotspot; vec3_t roomscalemove; - float throwhit; - float throwstabilize; - float throwstabilizedim; + float touchinghand; float handtouch_hand; int handtouch_ent; + float ishuman; } entvars_t; -#define PROGHEADER_CRC 47192 +#define PROGHEADER_CRC 51933 diff --git a/Quake/progs.hpp b/Quake/progs.hpp index 5cfa4d51..d7dd836a 100644 --- a/Quake/progs.hpp +++ b/Quake/progs.hpp @@ -21,11 +21,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_PROGS_H -#define _QUAKE_PROGS_H +#pragma once #include "pr_comp.hpp" /* defs shared with qcc */ #include "progdefs.hpp" /* generated by program cdefs */ +#include "common.hpp" +#include "protocol.hpp" typedef union eval_s { string_t string; @@ -71,18 +72,18 @@ extern float* pr_globals; /* same as pr_global_struct */ extern int pr_edict_size; /* in bytes */ -void PR_Init(void); +void PR_Init(); void PR_ExecuteProgram(func_t fnum); -void PR_LoadProgs(void); +void PR_LoadProgs(); const char* PR_GetString(int num); int PR_SetEngineString(const char* s); int PR_AllocString(int bufferlength, char** ptr); -void PR_Profile_f(void); +void PR_Profile_f(); -edict_t* ED_Alloc(void); +edict_t* ED_Alloc(); void ED_Free(edict_t* ed); void ED_Print(edict_t* ed); @@ -121,7 +122,7 @@ int NUM_FOR_EDICT(edict_t* e); extern int type_size[8]; -typedef void (*builtin_t)(void); +typedef void (*builtin_t)(); extern builtin_t* pr_builtins; extern const int pr_numbuiltins; @@ -138,9 +139,7 @@ extern unsigned short pr_crc; #pragma aux PR_RunError aborts; #endif -void ED_PrintEdicts(void); +void ED_PrintEdicts(); void ED_PrintNum(int ent); eval_t* GetEdictFieldValue(edict_t* ed, const char* field); - -#endif /* _QUAKE_PROGS_H */ diff --git a/Quake/protocol.hpp b/Quake/protocol.hpp index c772a25f..2ada9d3e 100644 --- a/Quake/protocol.hpp +++ b/Quake/protocol.hpp @@ -21,16 +21,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_PROTOCOL_H -#define _QUAKE_PROTOCOL_H +#pragma once -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" // protocol.h -- communications protocols #define PROTOCOL_NETQUAKE 15 // johnfitz -- standard quake protocol #define PROTOCOL_FITZQUAKE \ - 666 // johnfitz -- added new protocol for fitzquake 0.85 + 8681 // johnfitz -- added new protocol for fitzquake 0.85 #define PROTOCOL_RMQ 999 // PROTOCOL_RMQ protocol flags @@ -123,7 +122,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // not sent if ENTALPHA_DEFAULT #define SU_VR_WEAPON2 (1 << 26) #define SU_VR_WEAPONFRAME2 (1 << 27) -#define SU_UNUSED28 (1 << 28) +#define SU_VR_HOLSTERS (1 << 28) #define SU_UNUSED29 (1 << 29) #define SU_UNUSED30 (1 << 30) #define SU_EXTEND3 (1 << 31) // another byte to follow, future expansion @@ -241,6 +240,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 43 // support for large modelindex, large framenum, alpha, using flags #define svc_spawnstaticsound2 44 // [coord3] [short] samp [byte] vol [byte] aten #define svc_particle2 45 // [vec3] pos [vec3] dir [byte] preset [short] count + +#define svc_worldtext_hmake 46 +#define svc_worldtext_hsettext 47 +#define svc_worldtext_hsetpos 48 +#define svc_worldtext_hsetangles 49 +#define svc_worldtext_hsethalign 50 // johnfitz // @@ -275,10 +280,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct entity_state_t { - glm::vec3 origin; - glm::vec3 angles; - glm::vec3 scale; - glm::vec3 scale_origin; + qvec3 origin; + qvec3 angles; + qvec3 scale; + qvec3 scale_origin; unsigned short modelindex; // johnfitz -- was int unsigned short frame; // johnfitz -- was int unsigned char colormap; // johnfitz -- was int @@ -289,21 +294,24 @@ struct entity_state_t struct usercmd_t { - glm::vec3 viewangles; - glm::vec3 handpos; - glm::vec3 handrot; - glm::vec3 handvel; - glm::vec3 handthrowvel; + qvec3 viewangles; + float vryaw; + qvec3 handpos; + qvec3 handrot; + qvec3 handvel; + qvec3 handthrowvel; float handvelmag; - glm::vec3 handavel; - glm::vec3 offhandpos; - glm::vec3 offhandrot; - glm::vec3 offhandvel; - glm::vec3 offhandthrowvel; + qvec3 handavel; + qvec3 offhandpos; + qvec3 offhandrot; + qvec3 offhandvel; + qvec3 offhandthrowvel; float offhandvelmag; - glm::vec3 offhandavel; - glm::vec3 muzzlepos; - glm::vec3 offmuzzlepos; + qvec3 offhandavel; + qvec3 headvel; + qvec3 muzzlepos; + qvec3 offmuzzlepos; + unsigned char vrbits0; // intended velocities float forwardmove; @@ -311,19 +319,12 @@ struct usercmd_t float upmove; // VR teleportation - int teleporting; - glm::vec3 teleport_target; + qvec3 teleport_target; // VR hands - int offhand_grabbing; - int offhand_prevgrabbing; - int mainhand_grabbing; - int mainhand_prevgrabbing; int offhand_hotspot; int mainhand_hotspot; // VR room scale movement - glm::vec3 roomscalemove; + qvec3 roomscalemove; }; - -#endif /* _QUAKE_PROTOCOL_H */ diff --git a/Quake/q_sound.hpp b/Quake/q_sound.hpp index df136a13..607162d6 100644 --- a/Quake/q_sound.hpp +++ b/Quake/q_sound.hpp @@ -23,10 +23,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // sound.h -- client sound i/o functions -#ifndef __QUAKE_SOUND__ -#define __QUAKE_SOUND__ +#pragma once -#include "quakeglm.hpp" +#include "q_stdinc.hpp" +#include "quakeglm_qvec3.hpp" +#include "zone.hpp" +#include "quakedef_macros.hpp" +#include "cvar.hpp" /* !!! if this is changed, it must be changed in asm_i386.h too !!! */ typedef struct @@ -75,7 +78,7 @@ typedef struct int looping; /* where to loop, -1 = no looping */ int entnum; /* to allow overriding a specific sound */ int entchannel; - glm::vec3 origin; /* origin of sound effect */ + qvec3 origin; /* origin of sound effect */ float dist_mult; /* distance multiplier (attenuation/clipK) */ int master_vol; /* 0-255 master volume */ } channel_t; @@ -92,30 +95,30 @@ typedef struct int dataofs; /* chunk starts this many bytes from file start */ } wavinfo_t; -void S_Init(void); -void S_Startup(void); -void S_Shutdown(void); +void S_Init(); +void S_Startup(); +void S_Shutdown(); void S_StartSound(int entnum, int entchannel, sfx_t* sfx, - const glm::vec3& origin, float fvol, float attenuation); + const qvec3& origin, float fvol, float attenuation); void S_StaticSound( - sfx_t* sfx, const glm::vec3& origin, float vol, float attenuation); + sfx_t* sfx, const qvec3& origin, float vol, float attenuation); void S_StopSound(int entnum, int entchannel); void S_StopAllSounds(bool clear); -void S_ClearBuffer(void); -void S_Update(const glm::vec3& origin, const glm::vec3& forward, - const glm::vec3& right, const glm::vec3& up); -void S_ExtraUpdate(void); +void S_ClearBuffer(); +void S_Update(const qvec3& origin, const qvec3& forward, + const qvec3& right, const qvec3& up); +void S_ExtraUpdate(); -void S_BlockSound(void); -void S_UnblockSound(void); +void S_BlockSound(); +void S_UnblockSound(); sfx_t* S_PrecacheSound(const char* sample); void S_TouchSound(const char* sample); -void S_ClearPrecache(void); -void S_BeginPrecaching(void); -void S_EndPrecaching(void); +void S_ClearPrecache(); +void S_BeginPrecaching(); +void S_EndPrecaching(); void S_PaintChannels(int endtime); -void S_InitPaintChannels(void); +void S_InitPaintChannels(); /* picks a channel based on priorities, empty slots, number of channels */ channel_t* SND_PickChannel(int entnum, int entchannel); @@ -132,22 +135,22 @@ void S_RawSamples( bool SNDDMA_Init(dma_t* dma); /* gets the current DMA position */ -int SNDDMA_GetDMAPos(void); +int SNDDMA_GetDMAPos(); /* shutdown the DMA xfer. */ -void SNDDMA_Shutdown(void); +void SNDDMA_Shutdown(); /* validates & locks the dma buffer */ -void SNDDMA_LockBuffer(void); +void SNDDMA_LockBuffer(); /* unlocks the dma buffer / sends sound to the device */ -void SNDDMA_Submit(void); +void SNDDMA_Submit(); /* blocks sound output upon window focus loss */ -void SNDDMA_BlockSound(void); +void SNDDMA_BlockSound(); /* unblocks the output upon window focus gain */ -void SNDDMA_UnblockSound(void); +void SNDDMA_UnblockSound(); /* ==================================================================== * User-setable variables @@ -170,10 +173,10 @@ extern int soundtime; extern int paintedtime; extern int s_rawend; -extern glm::vec3 listener_origin; -extern glm::vec3 listener_forward; -extern glm::vec3 listener_right; -extern glm::vec3 listener_up; +extern qvec3 listener_origin; +extern qvec3 listener_forward; +extern qvec3 listener_right; +extern qvec3 listener_up; extern cvar_t sndspeed; extern cvar_t snd_mixspeed; @@ -191,6 +194,4 @@ sfxcache_t* S_LoadSound(sfx_t* s); wavinfo_t GetWavinfo(const char* name, byte* wav, int wavlength); -void SND_InitScaletable(void); - -#endif /* __QUAKE_SOUND__ */ +void SND_InitScaletable(); diff --git a/Quake/q_stdinc.hpp b/Quake/q_stdinc.hpp index 0fbb63a5..4862d285 100644 --- a/Quake/q_stdinc.hpp +++ b/Quake/q_stdinc.hpp @@ -26,16 +26,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __QSTDINC_H -#define __QSTDINC_H +#pragma once #include <sys/types.h> #include <stddef.h> #include <limits.h> -#define GLM_FORCE_INLINE -#include "quakeglm.hpp" - #ifndef _WIN32 /* others we support without sys/param.h? */ #include <sys/param.h> #endif @@ -67,7 +63,7 @@ #include <stdlib.h> #include <stdarg.h> -#include <string.h> +#include <cstring> #include <float.h> /*==========================================================================*/ @@ -173,5 +169,3 @@ typedef ptrdiff_t ssize_t; #endif /*==========================================================================*/ - -#endif /* __QSTDINC_H */ diff --git a/Quake/qpic.hpp b/Quake/qpic.hpp new file mode 100644 index 00000000..707b60c9 --- /dev/null +++ b/Quake/qpic.hpp @@ -0,0 +1,34 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +#include "q_stdinc.hpp" + +struct qpic_t +{ + int width, height; + byte data[4]; // variably sized +}; + +void SwapPic(qpic_t* pic); diff --git a/Quake/quakedef.hpp b/Quake/quakedef.hpp index bc90634c..8e467604 100644 --- a/Quake/quakedef.hpp +++ b/Quake/quakedef.hpp @@ -21,311 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef QUAKEDEFS_H -#define QUAKEDEFS_H +#pragma once -// quakedef.h -- primary header for client - -#define QUAKE_GAME // as opposed to utilities - -#define VERSION 1.09 -#define GLQUAKE_VERSION 1.00 -#define D3DQUAKE_VERSION 0.01 -#define WINQUAKE_VERSION 0.996 -#define LINUX_VERSION 1.30 -#define X11_VERSION 1.10 - -#define FITZQUAKE_VERSION 0.85 // johnfitz -#define QUAKESPASM_VERSION 0.93 -#define QUAKEVR_VERSION "0.0.4" -#define QUAKESPASM_VER_PATCH 2 // helper to print a string like 0.93.2 -#ifndef QUAKESPASM_VER_SUFFIX -#define QUAKESPASM_VER_SUFFIX // optional version suffix string literal like - // "-beta1" -#endif - -#define QS_STRINGIFY_(x) #x -#define QS_STRINGIFY(x) QS_STRINGIFY_(x) - -// combined version string like "0.92.1-beta1" -#define QUAKESPASM_VER_STRING \ - QS_STRINGIFY(QUAKESPASM_VERSION) \ - "." QS_STRINGIFY(QUAKESPASM_VER_PATCH) QUAKESPASM_VER_SUFFIX \ - " | Quake VR " QUAKEVR_VERSION - -// define PARANOID // speed sapping error checking - -#define GAMENAME "id1" // directory to look in by default - -#include "q_stdinc.hpp" - -// !!! if this is changed, it must be changed in d_ifacea.h too !!! -#define CACHE_SIZE 32 // used to align key data structures - -#define Q_UNUSED(x) (x = x) // for pesky compiler / lint warnings - -#define MINIMUM_MEMORY 1'048'576 // 16 MB -#define MINIMUM_MEMORY_LEVELPAK (MINIMUM_MEMORY + 0x100000) - -#define MAX_NUM_ARGVS 50 - -// up / down -#define PITCH 0 - -// left / right -#define YAW 1 - -// fall over -#define ROLL 2 - - -#define MAX_QPATH 64 // max length of a quake game pathname - -#define ON_EPSILON 0.1 // point on plane side epsilon - -#define DIST_EPSILON \ - (0.03125f) // 1/32 epsilon to keep floating point happy (moved from world.c) - -#define MAX_MSGLEN \ - 96000 // max length of a reliable message //ericw -- was 32000 -#define MAX_DATAGRAM \ - 64000 // max length of unreliable message //johnfitz -- was 1024 - -#define DATAGRAM_MTU \ - 1400 // johnfitz -- actual limit for unreliable messages to nonlocal clients - -// -// per-level limits -// -#define MIN_EDICTS 256 // johnfitz -- lowest allowed value for max_edicts cvar -#define MAX_EDICTS \ - 32000 // johnfitz -- highest allowed value for max_edicts cvar - // ents past 8192 can't play sounds in the standard protocol -#define MAX_LIGHTSTYLES 64 -#define MAX_MODELS 2048 // johnfitz -- was 256 -#define MAX_SOUNDS 2048 // johnfitz -- was 256 - -#define SAVEGAME_COMMENT_LENGTH 39 - -#define MAX_STYLESTRING 64 - -// -// stats are integers communicated to the client by the server -// -#define MAX_CL_STATS 64 - -#define STAT_HEALTH 0 -#define STAT_FRAGS 1 -#define STAT_WEAPON 2 -#define STAT_AMMO 3 -#define STAT_ARMOR 4 -#define STAT_WEAPONFRAME 5 -#define STAT_SHELLS 6 -#define STAT_NAILS 7 -#define STAT_ROCKETS 8 -#define STAT_CELLS 9 -#define STAT_ACTIVEWEAPON 10 -#define STAT_TOTALSECRETS 11 -#define STAT_TOTALMONSTERS 12 -#define STAT_SECRETS 13 // bumped on client side by svc_foundsecret -#define STAT_MONSTERS 14 // bumped by svc_killedmonster -#define STAT_WEAPON2 15 -#define STAT_WEAPONMODEL2 16 -#define STAT_WEAPONFRAME2 17 -#define STAT_HOLSTERWEAPON0 18 -#define STAT_HOLSTERWEAPON1 19 -#define STAT_HOLSTERWEAPON2 20 -#define STAT_HOLSTERWEAPON3 21 -#define STAT_HOLSTERWEAPONMODEL0 22 -#define STAT_HOLSTERWEAPONMODEL1 23 -#define STAT_HOLSTERWEAPONMODEL2 24 -#define STAT_HOLSTERWEAPONMODEL3 25 -#define STAT_AMMO2 26 -#define STAT_AMMOCOUNTER 27 -#define STAT_AMMOCOUNTER2 28 -#define STAT_HOLSTERWEAPON4 29 -#define STAT_HOLSTERWEAPON5 30 -#define STAT_HOLSTERWEAPONMODEL4 31 -#define STAT_HOLSTERWEAPONMODEL5 32 -#define STAT_MAINHAND_WID 33 -#define STAT_OFFHAND_WID 34 - -// stock defines -// -#define IT_SHOTGUN 1 -#define IT_SUPER_SHOTGUN 2 -#define IT_NAILGUN 4 -#define IT_SUPER_NAILGUN 8 -#define IT_GRENADE_LAUNCHER 16 -#define IT_ROCKET_LAUNCHER 32 -#define IT_LIGHTNING 64 -#define IT_SUPER_LIGHTNING 128 -#define IT_SHELLS 256 -#define IT_NAILS 512 -#define IT_ROCKETS 1024 -#define IT_CELLS 2048 -#define IT_AXE 4096 -#define IT_ARMOR1 8192 -#define IT_ARMOR2 16384 -#define IT_ARMOR3 32768 -#define IT_SUPERHEALTH 65536 -#define IT_KEY1 131072 -#define IT_KEY2 262144 -#define IT_INVISIBILITY 524288 -#define IT_INVULNERABILITY 1048576 -#define IT_SUIT 2097152 -#define IT_QUAD 4194304 -#define IT_SIGIL1 (1 << 28) -#define IT_SIGIL2 (1 << 29) -#define IT_SIGIL3 (1 << 30) -#define IT_SIGIL4 (1 << 31) - -//=========================================== -// rogue changed and added defines - -#define RIT_SHELLS 128 -#define RIT_NAILS 256 -#define RIT_ROCKETS 512 -#define RIT_CELLS 1024 -#define RIT_AXE 2048 -#define RIT_LAVA_NAILGUN 4096 -#define RIT_LAVA_SUPER_NAILGUN 8192 -#define RIT_MULTI_GRENADE 16384 -#define RIT_MULTI_ROCKET 32768 -#define RIT_PLASMA_GUN 65536 -#define RIT_ARMOR1 8388608 -#define RIT_ARMOR2 16777216 -#define RIT_ARMOR3 33554432 -#define RIT_LAVA_NAILS 67108864 -#define RIT_PLASMA_AMMO 134217728 -#define RIT_MULTI_ROCKETS 268435456 -#define RIT_SHIELD 536870912 -#define RIT_ANTIGRAV 1073741824 -#define RIT_SUPERHEALTH 2147483648 - -// MED 01/04/97 added hipnotic defines -//=========================================== -// hipnotic added defines -#define HIT_PROXIMITY_GUN_BIT 16 -#define HIT_MJOLNIR_BIT 7 -#define HIT_LASER_CANNON_BIT 23 -#define HIT_PROXIMITY_GUN (1 << HIT_PROXIMITY_GUN_BIT) // 65536 -#define HIT_MJOLNIR (1 << HIT_MJOLNIR_BIT) -#define HIT_LASER_CANNON (1 << HIT_LASER_CANNON_BIT) -#define HIT_WETSUIT (1 << (23 + 2)) -#define HIT_EMPATHY_SHIELDS (1 << (23 + 3)) - -//=========================================== - -// weapon ids -#define WID_FIST 0 -#define WID_GRAPPLE 1 -#define WID_AXE 2 -#define WID_MJOLNIR 3 -#define WID_SHOTGUN 4 -#define WID_SUPER_SHOTGUN 5 -#define WID_NAILGUN 6 -#define WID_SUPER_NAILGUN 7 -#define WID_GRENADE_LAUNCHER 8 -#define WID_PROXIMITY_GUN 9 -#define WID_ROCKET_LAUNCHER 10 -#define WID_LIGHTNING 11 -#define WID_LASER_CANNON 12 - -// ammo ids -#define AID_SHELLS 0 -#define AID_NAILS 1 -#define AID_ROCKETS 2 -#define AID_CELLS 3 -#define AID_NONE 4 - -// Quake VR hotspots -#define QVR_HS_NONE 0 -#define QVR_HS_OFFHAND_2H_GRAB 1 // 2H grab - helper offhand -#define QVR_HS_MAINHAND_2H_GRAB 2 // 2H grab - helper mainhand -#define QVR_HS_LEFT_SHOULDER_HOLSTER 3 -#define QVR_HS_RIGHT_SHOULDER_HOLSTER 4 -#define QVR_HS_LEFT_HIP_HOLSTER 5 -#define QVR_HS_RIGHT_HIP_HOLSTER 6 -#define QVR_HS_HAND_SWITCH 7 -#define QVR_HS_LEFT_UPPER_HOLSTER 8 -#define QVR_HS_RIGHT_UPPER_HOLSTER 9 - -#define MAX_SCOREBOARD 16 -#define MAX_SCOREBOARDNAME 32 - -#define SOUND_CHANNELS 8 - -struct quakeparms_t -{ - const char* basedir; - const char* userdir; // user's directory on UNIX platforms. - // if user directories are enabled, basedir - // and userdir will point to different - // memory locations, otherwise to the same. - int argc; - char** argv; - void* membase; - int memsize; - int numcpus; - int errstate; -}; - -#include "common.hpp" -#include "bspfile.hpp" -#include "sys.hpp" -#include "zone.hpp" -#include "mathlib.hpp" #include "cvar.hpp" - -#include "protocol.hpp" -#include "net.hpp" - -#include "cmd.hpp" -#include "crc.hpp" - -#include "progs.hpp" -#include "server.hpp" - -#include "platform.hpp" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) -#include <SDL2/SDL.h> -#include <SDL2/SDL_opengl.h> -#else -#include <SDL/SDL.h> -#include <SDL/SDL_opengl.h> -#endif -#else -#include "SDL.h" -#include "SDL_opengl.h" -#endif -#ifndef APIENTRY -#define APIENTRY -#endif - -#include "console.hpp" -#include "wad.hpp" -#include "vid.hpp" -#include "screen.hpp" -#include "draw.hpp" -#include "render.hpp" -#include "view.hpp" -#include "sbar.hpp" -#include "q_sound.hpp" -#include "client.hpp" - -#include "gl_model.hpp" -#include "world.hpp" - -#include "image.hpp" //johnfitz -#include "gl_texmgr.hpp" //johnfitz -#include "input.hpp" -#include "keys.hpp" -#include "menu.hpp" -#include "cdaudio.hpp" -#include "glquake.hpp" - +#include "quakeparms.hpp" +#include "q_stdinc.hpp" //============================================================================= @@ -353,59 +53,26 @@ extern int host_framecount; // incremented every frame, never reset extern double realtime; // not bounded in any way, changed at // start of every frame, never reset -typedef struct filelist_item_s +struct filelist_item_t { char name[32]; - struct filelist_item_s* next; -} filelist_item_t; + filelist_item_t* next; +}; extern filelist_item_t* modlist; extern filelist_item_t* extralevels; extern filelist_item_t* demolist; -void Host_ClearMemory(void); -void Host_ServerFrame(void); -void Host_InitCommands(void); -void Host_Init(void); -void Host_Shutdown(void); -void Host_Callback_Notify(cvar_t* var); /* callback function for CVAR_NOTIFY */ -void Host_Warn(const char* error, ...) FUNC_PRINTF(1, 2); -[[noreturn]] void Host_Error(const char* error, ...) FUNC_PRINTF(1, 2); -[[noreturn]] void Host_EndGame(const char* message, ...) FUNC_PRINTF(1, 2); -#ifdef __WATCOMC__ -#pragma aux Host_Error aborts; -#pragma aux Host_EndGame aborts; -#endif -void Host_Frame(float time); -void Host_Quit_f(void); -void Host_ClientCommands(const char* fmt, ...) FUNC_PRINTF(1, 2); -void Host_ShutdownServer(bool crash); -void Host_WriteConfiguration(void); - -void ExtraMaps_Init(void); -void Modlist_Init(void); -void DemoList_Init(void); +void ExtraMaps_Init(); +void Modlist_Init(); +void DemoList_Init(); -void DemoList_Rebuild(void); +void DemoList_Rebuild(); extern int current_skill; // skill level for currently loaded level (in case - // the user changes the cvar while the level is - // running, this reflects the level actually in use) + // the user changes the cvar while the level is + // running, this reflects the level actually in use) extern bool isDedicated; extern int minimum_memory; - -// johnfitz -- struct for passing lerp information to drawing functions -struct lerpdata_t -{ - short pose1; - short pose2; - float blend; - glm::vec3 origin; - glm::vec3 angles; -}; -// johnfitz - - -#endif /* QUAKEDEFS_H */ diff --git a/Quake/quakedef_macros.hpp b/Quake/quakedef_macros.hpp new file mode 100644 index 00000000..e041469b --- /dev/null +++ b/Quake/quakedef_macros.hpp @@ -0,0 +1,298 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2007-2008 Kristian Duske +Copyright (C) 2010-2019 QuakeSpasm developers + +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. + +*/ + +#pragma once + +// quakedef.h -- primary header for client + +#define QUAKE_GAME // as opposed to utilities + +#define VERSION 1.09 +#define GLQUAKE_VERSION 1.00 +#define D3DQUAKE_VERSION 0.01 +#define WINQUAKE_VERSION 0.996 +#define LINUX_VERSION 1.30 +#define X11_VERSION 1.10 + +#define FITZQUAKE_VERSION 0.85 // johnfitz +#define QUAKESPASM_VERSION 0.93 +#define QUAKEVR_VERSION "0.0.5" +#define QUAKESPASM_VER_PATCH 2 // helper to print a string like 0.93.2 +#ifndef QUAKESPASM_VER_SUFFIX +#define QUAKESPASM_VER_SUFFIX // optional version suffix string literal like + // "-beta1" +#endif + +#define QS_STRINGIFY_(x) #x +#define QS_STRINGIFY(x) QS_STRINGIFY_(x) + +// combined version string like "0.92.1-beta1" +#define QUAKESPASM_VER_STRING \ + QS_STRINGIFY(QUAKESPASM_VERSION) \ + "." QS_STRINGIFY(QUAKESPASM_VER_PATCH) QUAKESPASM_VER_SUFFIX \ + " | Quake VR " QUAKEVR_VERSION + +// #define PARANOID // speed sapping error checking + +#define GAMENAME "id1" // directory to look in by default + +// !!! if this is changed, it must be changed in d_ifacea.h too !!! +#define CACHE_SIZE 32 // used to align key data structures + +#define Q_UNUSED(x) (x = x) // for pesky compiler / lint warnings + +#define MINIMUM_MEMORY 1'048'576 // 16 MB +#define MINIMUM_MEMORY_LEVELPAK (MINIMUM_MEMORY + 0x100000) + +#define MAX_NUM_ARGVS 50 + +// up / down +#define PITCH 0 + +// left / right +#define YAW 1 + +// fall over +#define ROLL 2 + + +#define MAX_QPATH 128 // max length of a quake game pathname + +#define ON_EPSILON 0.1 // point on plane side epsilon + +#define DIST_EPSILON \ + (0.03125f) // 1/32 epsilon to keep floating point happy (moved from world.c) + +#define MAX_MSGLEN \ + 96000 // max length of a reliable message //ericw -- was 32000 +#define MAX_DATAGRAM \ + 64000 // max length of unreliable message //johnfitz -- was 1024 + +#define DATAGRAM_MTU \ + 1400 // johnfitz -- actual limit for unreliable messages to nonlocal clients + +// +// per-level limits +// +#define MIN_EDICTS 256 // johnfitz -- lowest allowed value for max_edicts cvar +#define MAX_EDICTS \ + 32000 // johnfitz -- highest allowed value for max_edicts cvar + // ents past 8192 can't play sounds in the standard protocol +#define MAX_LIGHTSTYLES 64 +#define MAX_MODELS 2048 // johnfitz -- was 256 +#define MAX_SOUNDS 2048 // johnfitz -- was 256 + +#define SAVEGAME_COMMENT_LENGTH 39 + +#define MAX_STYLESTRING 64 + +// +// stats are integers communicated to the client by the server +// +#define MAX_CL_STATS 64 + +#define STAT_HEALTH 0 +#define STAT_FRAGS 1 +#define STAT_WEAPON 2 +#define STAT_AMMO 3 +#define STAT_ARMOR 4 +#define STAT_WEAPONFRAME 5 +#define STAT_SHELLS 6 +#define STAT_NAILS 7 +#define STAT_ROCKETS 8 +#define STAT_CELLS 9 +#define STAT_ACTIVEWEAPON 10 +#define STAT_TOTALSECRETS 11 +#define STAT_TOTALMONSTERS 12 +#define STAT_SECRETS 13 // bumped on client side by svc_foundsecret +#define STAT_MONSTERS 14 // bumped by svc_killedmonster +#define STAT_WEAPON2 15 +#define STAT_WEAPONMODEL2 16 +#define STAT_WEAPONFRAME2 17 +#define STAT_HOLSTERWEAPON0 18 +#define STAT_HOLSTERWEAPON1 19 +#define STAT_HOLSTERWEAPON2 20 +#define STAT_HOLSTERWEAPON3 21 +#define STAT_HOLSTERWEAPONMODEL0 22 +#define STAT_HOLSTERWEAPONMODEL1 23 +#define STAT_HOLSTERWEAPONMODEL2 24 +#define STAT_HOLSTERWEAPONMODEL3 25 +#define STAT_AMMO2 26 +#define STAT_AMMOCOUNTER 27 +#define STAT_AMMOCOUNTER2 28 +#define STAT_HOLSTERWEAPON4 29 +#define STAT_HOLSTERWEAPON5 30 +#define STAT_HOLSTERWEAPONMODEL4 31 +#define STAT_HOLSTERWEAPONMODEL5 32 +#define STAT_MAINHAND_WID 33 +#define STAT_OFFHAND_WID 34 +#define STAT_WEAPONFLAGS 35 +#define STAT_WEAPONFLAGS2 36 +#define STAT_HOLSTERWEAPONFLAGS0 37 +#define STAT_HOLSTERWEAPONFLAGS1 38 +#define STAT_HOLSTERWEAPONFLAGS2 39 +#define STAT_HOLSTERWEAPONFLAGS3 40 +#define STAT_HOLSTERWEAPONFLAGS4 41 +#define STAT_HOLSTERWEAPONFLAGS5 42 + +// stock defines +// +// clang-format off +#define IT_SHOTGUN VRUTIL_POWER_OF_TWO(0) +#define IT_SUPER_SHOTGUN VRUTIL_POWER_OF_TWO(1) +#define IT_NAILGUN VRUTIL_POWER_OF_TWO(2) +#define IT_SUPER_NAILGUN VRUTIL_POWER_OF_TWO(3) +#define IT_GRENADE_LAUNCHER VRUTIL_POWER_OF_TWO(4) +#define IT_ROCKET_LAUNCHER VRUTIL_POWER_OF_TWO(5) +#define IT_LIGHTNING VRUTIL_POWER_OF_TWO(6) +#define IT_SUPER_LIGHTNING VRUTIL_POWER_OF_TWO(7) +#define IT_SHELLS VRUTIL_POWER_OF_TWO(8) +#define IT_NAILS VRUTIL_POWER_OF_TWO(9) +#define IT_ROCKETS VRUTIL_POWER_OF_TWO(10) +#define IT_CELLS VRUTIL_POWER_OF_TWO(11) +#define IT_AXE VRUTIL_POWER_OF_TWO(12) +#define IT_ARMOR1 VRUTIL_POWER_OF_TWO(13) +#define IT_ARMOR2 VRUTIL_POWER_OF_TWO(14) +#define IT_ARMOR3 VRUTIL_POWER_OF_TWO(15) +#define IT_SUPERHEALTH VRUTIL_POWER_OF_TWO(16) +#define IT_KEY1 VRUTIL_POWER_OF_TWO(17) +#define IT_KEY2 VRUTIL_POWER_OF_TWO(18) +#define IT_INVISIBILITY VRUTIL_POWER_OF_TWO(19) +#define IT_INVULNERABILITY VRUTIL_POWER_OF_TWO(20) +#define IT_SUIT VRUTIL_POWER_OF_TWO(21) +#define IT_QUAD VRUTIL_POWER_OF_TWO(22) +// clang-format on +#define IT_SIGIL1 (1 << 28) +#define IT_SIGIL2 (1 << 29) +#define IT_SIGIL3 (1 << 30) +#define IT_SIGIL4 (1 << 31) + +//=========================================== +// rogue changed and added defines + +#define RIT_SHELLS 128 +#define RIT_NAILS 256 +#define RIT_ROCKETS 512 +#define RIT_CELLS 1024 +#define RIT_AXE 2048 +#define RIT_LAVA_NAILGUN 4096 +#define RIT_LAVA_SUPER_NAILGUN 8192 +#define RIT_MULTI_GRENADE 16384 +#define RIT_MULTI_ROCKET 32768 +#define RIT_PLASMA_GUN 65536 +#define RIT_ARMOR1 8388608 +#define RIT_ARMOR2 16777216 +#define RIT_ARMOR3 33554432 +#define RIT_LAVA_NAILS 67108864 +#define RIT_PLASMA_AMMO 134217728 +#define RIT_MULTI_ROCKETS 268435456 +#define RIT_SHIELD 536870912 +#define RIT_ANTIGRAV 1073741824 +#define RIT_SUPERHEALTH 2147483648 + +// MED 01/04/97 added hipnotic defines +//=========================================== +// hipnotic added defines +#define HIT_PROXIMITY_GUN_BIT 16 +#define HIT_MJOLNIR_BIT 7 +#define HIT_LASER_CANNON_BIT 23 +#define HIT_PROXIMITY_GUN (1 << HIT_PROXIMITY_GUN_BIT) // 65536 +#define HIT_MJOLNIR (1 << HIT_MJOLNIR_BIT) +#define HIT_LASER_CANNON (1 << HIT_LASER_CANNON_BIT) +#define HIT_WETSUIT (1 << (23 + 2)) +#define HIT_EMPATHY_SHIELDS (1 << (23 + 3)) + +//=========================================== + +// weapon ids +#define WID_FIST 0 +#define WID_GRAPPLE 1 +#define WID_AXE 2 +#define WID_MJOLNIR 3 +#define WID_SHOTGUN 4 +#define WID_SUPER_SHOTGUN 5 +#define WID_NAILGUN 6 +#define WID_SUPER_NAILGUN 7 +#define WID_GRENADE_LAUNCHER 8 +#define WID_PROXIMITY_GUN 9 +#define WID_ROCKET_LAUNCHER 10 +#define WID_LIGHTNING 11 +#define WID_LASER_CANNON 12 + +// ammo ids +#define AID_NONE 0 +#define AID_SHELLS 1 +#define AID_NAILS 2 +#define AID_ROCKETS 3 +#define AID_CELLS 4 +#define AID_LAVA_NAILS 5 +#define AID_MULTI_ROCKETS 6 +#define AID_PLASMA 7 + +// Quake VR hotspots +#define QVR_HS_NONE 0 +#define QVR_HS_OFFHAND_2H_GRAB 1 // 2H grab - helper offhand +#define QVR_HS_MAINHAND_2H_GRAB 2 // 2H grab - helper mainhand +#define QVR_HS_LEFT_SHOULDER_HOLSTER 3 +#define QVR_HS_RIGHT_SHOULDER_HOLSTER 4 +#define QVR_HS_LEFT_HIP_HOLSTER 5 +#define QVR_HS_RIGHT_HIP_HOLSTER 6 +#define QVR_HS_HAND_SWITCH 7 +#define QVR_HS_LEFT_UPPER_HOLSTER 8 +#define QVR_HS_RIGHT_UPPER_HOLSTER 9 + +// Quake VR - vrbits0 bits +// clang-format off +#define QVR_VRBITS0_TELEPORTING VRUTIL_POWER_OF_TWO(0) +#define QVR_VRBITS0_OFFHAND_GRABBING VRUTIL_POWER_OF_TWO(1) +#define QVR_VRBITS0_OFFHAND_PREVGRABBING VRUTIL_POWER_OF_TWO(2) +#define QVR_VRBITS0_MAINHAND_GRABBING VRUTIL_POWER_OF_TWO(3) +#define QVR_VRBITS0_MAINHAND_PREVGRABBING VRUTIL_POWER_OF_TWO(4) +#define QVR_VRBITS0_2H_AIMING VRUTIL_POWER_OF_TWO(5) +// clang-format on + +#define MAX_SCOREBOARD 16 +#define MAX_SCOREBOARDNAME 32 + +#define SOUND_CHANNELS 8 + + + + +// From client.hpp + +#define CSHIFT_CONTENTS 0 +#define CSHIFT_DAMAGE 1 +#define CSHIFT_BONUS 2 +#define CSHIFT_POWERUP 3 +#define NUM_CSHIFTS 4 +#define NAME_LENGTH 64 +#define SIGNONS 4 // signon messages to receive before connected +#define MAX_DLIGHTS 64 // johnfitz -- was 32 +#define MAX_BEAMS 128 // johnfitz -- was 24 +#define MAX_MAPSTRING 2048 +#define MAX_DEMOS 8 +#define MAX_DEMONAME 16 +#define MAX_TEMP_ENTITIES 512 // johnfitz -- was 64 +#define MAX_STATIC_ENTITIES 4096 // ericw -- was 512 //johnfitz -- was 128 +#define MAX_VISEDICTS 4096 // larger, now we support BSP2 diff --git a/Quake/quakeglm.cpp b/Quake/quakeglm.cpp index c1541781..e69de29b 100644 --- a/Quake/quakeglm.cpp +++ b/Quake/quakeglm.cpp @@ -1,7 +0,0 @@ -#include "quakeglm.hpp" - -template struct glm::vec<4, signed char, glm::packed_highp>; -template struct glm::vec<4, unsigned char, glm::packed_highp>; -template struct glm::vec<4, float, glm::packed_highp>; -template struct glm::vec<3, float, glm::packed_highp>; -template struct glm::vec<2, float, glm::packed_highp>; diff --git a/Quake/quakeglm.hpp b/Quake/quakeglm.hpp index 03c49fa6..a7a81d89 100644 --- a/Quake/quakeglm.hpp +++ b/Quake/quakeglm.hpp @@ -8,28 +8,20 @@ #pragma GCC diagnostic ignored "-Wpedantic" #endif -#define GLM_FORCE_INLINE -#define GLM_CONFIG_SIMD GLM_ENABLE -#define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR -#define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE -#define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE -#define GLM_FORCE_SWIZZLE - -#include <glm.hpp> -#include <gtc/type_ptr.hpp> -#include <gtc/quaternion.hpp> -#include <gtx/quaternion.hpp> -#include <gtx/euler_angles.hpp> -#include <gtx/rotate_vector.hpp> -#include <gtx/io.hpp> -#include <gtx/vec_swizzle.hpp> +#include "quakeglm_macros.hpp" + +#include <glm/common.hpp> +#include <glm/trigonometric.hpp> #ifdef __GNUC__ #pragma GCC diagnostic pop #endif -extern template struct glm::vec<4, signed char, glm::packed_highp>; -extern template struct glm::vec<4, unsigned char, glm::packed_highp>; -extern template struct glm::vec<4, float, glm::packed_highp>; -extern template struct glm::vec<3, float, glm::packed_highp>; -extern template struct glm::vec<2, float, glm::packed_highp>; +#include "quakeglm_qvec3.hpp" + +using qfloat = float; + +[[nodiscard]] constexpr inline qfloat operator"" _qf(long double x) noexcept +{ + return qfloat(x); +} diff --git a/Quake/quakeglm_macros.hpp b/Quake/quakeglm_macros.hpp new file mode 100644 index 00000000..6e9f4e83 --- /dev/null +++ b/Quake/quakeglm_macros.hpp @@ -0,0 +1,8 @@ +#pragma once + +#define GLM_FORCE_INLINE +#define GLM_CONFIG_SIMD GLM_ENABLE +#define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR +#define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE +#define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE +#define GLM_FORCE_SWIZZLE diff --git a/Quake/quakeglm_qmat3.hpp b/Quake/quakeglm_qmat3.hpp new file mode 100644 index 00000000..4b3c0fec --- /dev/null +++ b/Quake/quakeglm_qmat3.hpp @@ -0,0 +1,19 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_macros.hpp" + +#include <glm/mat3x3.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +using qmat3 = glm::mat3; diff --git a/Quake/quakeglm_qmat4.hpp b/Quake/quakeglm_qmat4.hpp new file mode 100644 index 00000000..67c06694 --- /dev/null +++ b/Quake/quakeglm_qmat4.hpp @@ -0,0 +1,19 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_macros.hpp" + +#include <glm/mat4x4.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +using qmat4 = glm::mat4; diff --git a/Quake/quakeglm_qquat.hpp b/Quake/quakeglm_qquat.hpp new file mode 100644 index 00000000..0cc1e3b6 --- /dev/null +++ b/Quake/quakeglm_qquat.hpp @@ -0,0 +1,24 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_macros.hpp" + +#include <glm/gtc/quaternion.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +using qquat = glm::quat; + +[[nodiscard]] inline auto toGlMat(const qquat& q) noexcept +{ + return glm::mat4_cast(q); +} diff --git a/Quake/quakeglm_qvec2.hpp b/Quake/quakeglm_qvec2.hpp new file mode 100644 index 00000000..cb7c30cb --- /dev/null +++ b/Quake/quakeglm_qvec2.hpp @@ -0,0 +1,20 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_macros.hpp" + +#include <glm/vec2.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + + +using qvec2 = glm::vec2; diff --git a/Quake/quakeglm_qvec3.hpp b/Quake/quakeglm_qvec3.hpp new file mode 100644 index 00000000..4f50d653 --- /dev/null +++ b/Quake/quakeglm_qvec3.hpp @@ -0,0 +1,22 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_macros.hpp" + +#include <glm/vec3.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +using qfloat = float; +using qvec3 = glm::vec3; + +inline constexpr qvec3 vec3_zero{0.f, 0.f, 0.f}; diff --git a/Quake/quakeglm_qvec3_togl.hpp b/Quake/quakeglm_qvec3_togl.hpp new file mode 100644 index 00000000..a829e1eb --- /dev/null +++ b/Quake/quakeglm_qvec3_togl.hpp @@ -0,0 +1,27 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_qvec3.hpp" + +#include <glm/gtc/type_ptr.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +[[nodiscard]] inline auto* toGlVec(qvec3& v) noexcept +{ + return glm::value_ptr(v); +} + +[[nodiscard]] inline const auto* toGlVec(const qvec3& v) noexcept +{ + return glm::value_ptr(v); +} diff --git a/Quake/quakeglm_qvec4.hpp b/Quake/quakeglm_qvec4.hpp new file mode 100644 index 00000000..73d28fbb --- /dev/null +++ b/Quake/quakeglm_qvec4.hpp @@ -0,0 +1,19 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push + +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wmacro-redefined" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "quakeglm_macros.hpp" + +#include <glm/vec4.hpp> + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +using qvec4 = glm::vec4; diff --git a/Quake/quakeparms.hpp b/Quake/quakeparms.hpp new file mode 100644 index 00000000..a2652630 --- /dev/null +++ b/Quake/quakeparms.hpp @@ -0,0 +1,39 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2007-2008 Kristian Duske +Copyright (C) 2010-2019 QuakeSpasm developers + +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. + +*/ + +#pragma once + +struct quakeparms_t +{ + const char* basedir; + const char* userdir; // user's directory on UNIX platforms. + // if user directories are enabled, basedir + // and userdir will point to different + // memory locations, otherwise to the same. + int argc; + char** argv; + void* membase; + int memsize; + int numcpus; + int errstate; +}; diff --git a/Quake/r_alias.cpp b/Quake/r_alias.cpp index 082e1de3..30f4325c 100644 --- a/Quake/r_alias.cpp +++ b/Quake/r_alias.cpp @@ -23,8 +23,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_alias.c -- alias model rendering +#include <GL/glew.h> + #include "quakeglm.hpp" +#include "console.hpp" +#include "gl_texmgr.hpp" #include "quakedef.hpp" +#include "lerpdata.hpp" +#include "render.hpp" +#include "glquake.hpp" +#include "mathlib.hpp" +#include "quakedef_macros.hpp" +#include "client.hpp" +#include "shader.hpp" extern cvar_t r_drawflat, gl_overbright_models, gl_fullbrights, r_lerpmodels, r_lerpmove; // johnfitz @@ -40,7 +51,7 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = { }; // johnfitz -- replaces "float shadelight" for lit support -extern glm::vec3 lightcolor; +extern qvec3 lightcolor; // precalculated dot products for quantized angles #define SHADEDOT_QUANT 16 @@ -48,10 +59,10 @@ float r_avertexnormal_dots[SHADEDOT_QUANT][256] = { #include "anorm_dots.hpp" }; -extern glm::vec3 lightspot; +extern qvec3 lightspot; float* shadedots = r_avertexnormal_dots[0]; -glm::vec3 shadevector; +qvec3 shadevector; float entalpha; // johnfitz @@ -61,9 +72,11 @@ bool shading = true; // johnfitz -- if false, disable vertex shading for various // reasons (fullbright, r_lightmap, showtris, etc) static GLuint r_alias_program; +static GLuint r_aliasblended_program; // uniforms used in vert shader static GLuint blendLoc; +static GLuint zeroBlendLoc; static GLuint shadevectorLoc; static GLuint lightColorLoc; @@ -79,6 +92,7 @@ static GLuint useAlphaTestLoc; #define pose2VertexAttrIndex 2 #define pose2NormalAttrIndex 3 #define texCoordsAttrIndex 4 +#define zeroBlendVertexAttrIndex 5 /* ============= @@ -117,88 +131,94 @@ GLAlias_CreateShaders */ void GLAlias_CreateShaders() { - const glsl_attrib_binding_t bindings[] = {{"TexCoords", texCoordsAttrIndex}, - {"Pose1Vert", pose1VertexAttrIndex}, - {"Pose1Normal", pose1NormalAttrIndex}, - {"Pose2Vert", pose2VertexAttrIndex}, - {"Pose2Normal", pose2NormalAttrIndex}}; - - const GLchar* vertSource = - "#version 110\n" - "\n" - "uniform float Blend;\n" - "uniform vec3 ShadeVector;\n" - "uniform vec4 LightColor;\n" - "attribute vec4 TexCoords; // only xy are used \n" - "attribute vec4 Pose1Vert;\n" - "attribute vec3 Pose1Normal;\n" - "attribute vec4 Pose2Vert;\n" - "attribute vec3 Pose2Normal;\n" - "\n" - "varying float FogFragCoord;\n" - "\n" - "float r_avertexnormal_dot(vec3 vertexnormal) // from MH \n" - "{\n" - " float dot = dot(vertexnormal, ShadeVector);\n" - " // wtf - this reproduces anorm_dots within as reasonable a " - "degree of tolerance as the >= 0 case\n" - " if (dot < 0.0)\n" - " return 1.0 + dot * (13.0 / 44.0);\n" - " else\n" - " return 1.0 + dot;\n" - "}\n" - "void main()\n" - "{\n" - " gl_TexCoord[0] = TexCoords;\n" - " vec4 lerpedVert = mix(vec4(Pose1Vert.xyz, 1.0), " - "vec4(Pose2Vert.xyz, 1.0), Blend);\n" - " gl_Position = gl_ModelViewProjectionMatrix * lerpedVert;\n" - " FogFragCoord = gl_Position.w;\n" - " float dot1 = r_avertexnormal_dot(Pose1Normal);\n" - " float dot2 = r_avertexnormal_dot(Pose2Normal);\n" - " gl_FrontColor = LightColor * vec4(vec3(mix(dot1, dot2, Blend)), " - "1.0);\n" - "}\n"; - - const GLchar* fragSource = - "#version 110\n" - "\n" - "uniform sampler2D Tex;\n" - "uniform sampler2D FullbrightTex;\n" - "uniform bool UseFullbrightTex;\n" - "uniform bool UseOverbright;\n" - "uniform bool UseAlphaTest;\n" - "\n" - "varying float FogFragCoord;\n" - "\n" - "void main()\n" - "{\n" - " vec4 result = texture2D(Tex, gl_TexCoord[0].xy);\n" - " if (UseAlphaTest && (result.a < 0.666))\n" - " discard;\n" - " result *= gl_Color;\n" - " if (UseOverbright)\n" - " result.rgb *= 2.0;\n" - " if (UseFullbrightTex)\n" - " result += texture2D(FullbrightTex, gl_TexCoord[0].xy);\n" - " result = clamp(result, 0.0, 1.0);\n" - " float fog = exp(-gl_Fog.density * gl_Fog.density * FogFragCoord * " - "FogFragCoord);\n" - " fog = clamp(fog, 0.0, 1.0);\n" - " result = mix(gl_Fog.color, result, fog);\n" - " result.a = gl_Color.a;\n" // FIXME: This will make almost - // transparent things cut holes though - // heavy fog - " gl_FragColor = result;\n" - "}\n"; + const GLchar* vertSource = R"glsl( +#version 110 + +uniform float Blend; +uniform vec3 ShadeVector; +uniform vec4 LightColor; +attribute vec4 TexCoords; // only xy are used +attribute vec4 Pose1Vert; +attribute vec3 Pose1Normal; +attribute vec4 Pose2Vert; +attribute vec3 Pose2Normal; + +varying float FogFragCoord; + +float r_avertexnormal_dot(vec3 vertexnormal) // from MH +{ + float dot = dot(vertexnormal, ShadeVector); + // wtf - this reproduces anorm_dots within as reasonable a degree of tolerance as the >= 0 case + + if (dot < 0.0) + return 1.0 + dot * (13.0 / 44.0); + else + return 1.0 + dot; +} + +void main() +{ + gl_TexCoord[0] = TexCoords; + vec4 lerpedVert = mix(vec4(Pose1Vert.xyz, 1.0), + vec4(Pose2Vert.xyz, 1.0), Blend); + gl_Position = gl_ModelViewProjectionMatrix * lerpedVert; + FogFragCoord = gl_Position.w; + float dot1 = r_avertexnormal_dot(Pose1Normal); + float dot2 = r_avertexnormal_dot(Pose2Normal); + gl_FrontColor = LightColor * vec4(vec3(mix(dot1, dot2, Blend)), 1.0); +})glsl"; + + const GLchar* fragSource = R"glsl( +#version 110 + +uniform sampler2D Tex; +uniform sampler2D FullbrightTex; +uniform bool UseFullbrightTex; +uniform bool UseOverbright; +uniform bool UseAlphaTest; + +varying float FogFragCoord; + +void main() +{ + vec4 result = texture2D(Tex, gl_TexCoord[0].xy); + if (UseAlphaTest && (result.a < 0.666)) + discard; + + result *= gl_Color; + + if (UseOverbright) + result.rgb *= 2.0; + + if (UseFullbrightTex) + result += texture2D(FullbrightTex, gl_TexCoord[0].xy); + + result = clamp(result, 0.0, 1.0); + + float fog = exp(-gl_Fog.density * gl_Fog.density * FogFragCoord * FogFragCoord); + fog = clamp(fog, 0.0, 1.0); + result = mix(gl_Fog.color, result, fog); + + // FIXME: This will make almos transparent things cut holes though heavy fo + result.a = gl_Color.a; + gl_FragColor = result; +})glsl"; if(!gl_glsl_alias_able) { return; } - r_alias_program = GL_CreateProgram(vertSource, fragSource, - sizeof(bindings) / sizeof(bindings[0]), bindings); + r_alias_program = + quake::gl_program_builder{} + .add_shader({GL_VERTEX_SHADER, vertSource}) + .add_shader({GL_FRAGMENT_SHADER, fragSource}) + .add_attr_binding({"TexCoords", texCoordsAttrIndex}) + .add_attr_binding({"Pose1Vert", pose1VertexAttrIndex}) + .add_attr_binding({"Pose1Normal", pose1NormalAttrIndex}) + .add_attr_binding({"Pose2Vert", pose2VertexAttrIndex}) + .add_attr_binding({"Pose2Normal", pose2NormalAttrIndex}) + .compile_and_link(); if(r_alias_program != 0) { @@ -218,12 +238,132 @@ void GLAlias_CreateShaders() } } +void GLAliasBlended_CreateShaders() +{ + const GLchar* vertSource = R"glsl( +#version 110 + +uniform float Blend; +uniform float ZeroBlend; +uniform vec3 ShadeVector; +uniform vec4 LightColor; +attribute vec4 TexCoords; // only xy are used +attribute vec4 Pose1Vert; +attribute vec3 Pose1Normal; +attribute vec4 Pose2Vert; +attribute vec3 Pose2Normal; +attribute vec4 ZeroBlendVert; + +varying float FogFragCoord; + +float r_avertexnormal_dot(vec3 vertexnormal) // from MH +{ + float dot = dot(vertexnormal, ShadeVector); + // wtf - this reproduces anorm_dots within as reasonable a degree of tolerance as the >= 0 case + + if (dot < 0.0) + return 1.0 + dot * (13.0 / 44.0); + else + return 1.0 + dot; +} + +void main() +{ + gl_TexCoord[0] = TexCoords; + + vec4 lerpedVert = mix(vec4(Pose1Vert.xyz, 1.0), + vec4(Pose2Vert.xyz, 1.0), Blend); + + vec4 zeroBlendedVert = mix(lerpedVert, vec4(ZeroBlendVert.xyz, 1.0), ZeroBlend); + + gl_Position = gl_ModelViewProjectionMatrix * zeroBlendedVert; + FogFragCoord = gl_Position.w; + float dot1 = r_avertexnormal_dot(Pose1Normal); + float dot2 = r_avertexnormal_dot(Pose2Normal); + gl_FrontColor = LightColor * vec4(vec3(mix(dot1, dot2, Blend)), 1.0); +})glsl"; + + const GLchar* fragSource = R"glsl( +#version 110 + +uniform sampler2D Tex; +uniform sampler2D FullbrightTex; +uniform bool UseFullbrightTex; +uniform bool UseOverbright; +uniform bool UseAlphaTest; + +varying float FogFragCoord; + +void main() +{ + vec4 result = texture2D(Tex, gl_TexCoord[0].xy); + if (UseAlphaTest && (result.a < 0.666)) + discard; + + result *= gl_Color; + + if (UseOverbright) + result.rgb *= 2.0; + + if (UseFullbrightTex) + result += texture2D(FullbrightTex, gl_TexCoord[0].xy); + + result = clamp(result, 0.0, 1.0); + + float fog = exp(-gl_Fog.density * gl_Fog.density * FogFragCoord * FogFragCoord); + fog = clamp(fog, 0.0, 1.0); + result = mix(gl_Fog.color, result, fog); + + // FIXME: This will make almos transparent things cut holes though heavy fo + result.a = gl_Color.a; + gl_FragColor = result; +})glsl"; + + if(!gl_glsl_alias_able) + { + return; + } + + r_aliasblended_program = + quake::gl_program_builder{} + .add_shader({GL_VERTEX_SHADER, vertSource}) + .add_shader({GL_FRAGMENT_SHADER, fragSource}) + .add_attr_binding({"TexCoords", texCoordsAttrIndex}) + .add_attr_binding({"Pose1Vert", pose1VertexAttrIndex}) + .add_attr_binding({"Pose1Normal", pose1NormalAttrIndex}) + .add_attr_binding({"Pose2Vert", pose2VertexAttrIndex}) + .add_attr_binding({"Pose2Normal", pose2NormalAttrIndex}) + .add_attr_binding({"ZeroBlendVert", zeroBlendVertexAttrIndex}) + .compile_and_link(); + + if(r_aliasblended_program != 0) + { + // get uniform locations + blendLoc = GL_GetUniformLocation(&r_aliasblended_program, "Blend"); + zeroBlendLoc = + GL_GetUniformLocation(&r_aliasblended_program, "ZeroBlend"); + shadevectorLoc = + GL_GetUniformLocation(&r_aliasblended_program, "ShadeVector"); + lightColorLoc = + GL_GetUniformLocation(&r_aliasblended_program, "LightColor"); + texLoc = GL_GetUniformLocation(&r_aliasblended_program, "Tex"); + fullbrightTexLoc = + GL_GetUniformLocation(&r_aliasblended_program, "FullbrightTex"); + useFullbrightTexLoc = + GL_GetUniformLocation(&r_aliasblended_program, "UseFullbrightTex"); + useOverbrightLoc = + GL_GetUniformLocation(&r_aliasblended_program, "UseOverbright"); + useAlphaTestLoc = + GL_GetUniformLocation(&r_aliasblended_program, "UseAlphaTest"); + } +} + /* ============= GL_DrawAliasFrame_GLSL -- ericw Optimized alias model drawing codepath. -Compared to the original GL_DrawAliasFrame, this makes 1 draw call, +Compared to the <original GL_DrawAliasFrame, this makes 1 draw call, no vertex data is uploaded (it's already in the r_meshvbo and r_meshindexesvbo static VBOs), and lerping and lighting is done in the vertex shader. @@ -232,7 +372,7 @@ Supports optional overbright, optional fullbright pixels. Based on code by MH from RMQEngine ============= */ -void GL_DrawAliasFrame_GLSL(aliashdr_t* paliashdr, lerpdata_t lerpdata, +void GL_DrawAliasFrame_GLSL(aliashdr_t* paliashdr, const lerpdata_t& lerpdata, gltexture_t* tx, gltexture_t* fb) { float blend; @@ -247,43 +387,39 @@ void GL_DrawAliasFrame_GLSL(aliashdr_t* paliashdr, lerpdata_t lerpdata, blend = 0; } - GL_UseProgramFunc(r_alias_program); + glUseProgram(r_alias_program); - GL_BindBuffer(GL_ARRAY_BUFFER, currententity->model->meshvbo); - GL_BindBuffer( - GL_ELEMENT_ARRAY_BUFFER, currententity->model->meshindexesvbo); + glBindBuffer(GL_ARRAY_BUFFER, currententity->model->meshvbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, currententity->model->meshindexesvbo); - GL_EnableVertexAttribArrayFunc(texCoordsAttrIndex); - GL_EnableVertexAttribArrayFunc(pose1VertexAttrIndex); - GL_EnableVertexAttribArrayFunc(pose2VertexAttrIndex); - GL_EnableVertexAttribArrayFunc(pose1NormalAttrIndex); - GL_EnableVertexAttribArrayFunc(pose2NormalAttrIndex); + glEnableVertexAttribArray(texCoordsAttrIndex); + glEnableVertexAttribArray(pose1VertexAttrIndex); + glEnableVertexAttribArray(pose2VertexAttrIndex); + glEnableVertexAttribArray(pose1NormalAttrIndex); + glEnableVertexAttribArray(pose2NormalAttrIndex); - GL_VertexAttribPointerFunc(texCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, 0, + glVertexAttribPointer(texCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, 0, (void*)(intptr_t)currententity->model->vbostofs); - GL_VertexAttribPointerFunc(pose1VertexAttrIndex, 4, GL_UNSIGNED_BYTE, - GL_FALSE, sizeof(meshxyz_t), - GLARB_GetXYZOffset(paliashdr, lerpdata.pose1)); - GL_VertexAttribPointerFunc(pose2VertexAttrIndex, 4, GL_UNSIGNED_BYTE, - GL_FALSE, sizeof(meshxyz_t), - GLARB_GetXYZOffset(paliashdr, lerpdata.pose2)); + glVertexAttribPointer(pose1VertexAttrIndex, 4, GL_UNSIGNED_BYTE, GL_FALSE, + sizeof(meshxyz_t), GLARB_GetXYZOffset(paliashdr, lerpdata.pose1)); + glVertexAttribPointer(pose2VertexAttrIndex, 4, GL_UNSIGNED_BYTE, GL_FALSE, + sizeof(meshxyz_t), GLARB_GetXYZOffset(paliashdr, lerpdata.pose2)); // GL_TRUE to normalize the signed bytes to [-1 .. 1] - GL_VertexAttribPointerFunc(pose1NormalAttrIndex, 4, GL_BYTE, GL_TRUE, + glVertexAttribPointer(pose1NormalAttrIndex, 4, GL_BYTE, GL_TRUE, sizeof(meshxyz_t), GLARB_GetNormalOffset(paliashdr, lerpdata.pose1)); - GL_VertexAttribPointerFunc(pose2NormalAttrIndex, 4, GL_BYTE, GL_TRUE, + glVertexAttribPointer(pose2NormalAttrIndex, 4, GL_BYTE, GL_TRUE, sizeof(meshxyz_t), GLARB_GetNormalOffset(paliashdr, lerpdata.pose2)); // set uniforms - GL_Uniform1fFunc(blendLoc, blend); - GL_Uniform3fFunc( - shadevectorLoc, shadevector[0], shadevector[1], shadevector[2]); - GL_Uniform4fFunc( + glUniform1f(blendLoc, blend); + glUniform3f(shadevectorLoc, shadevector[0], shadevector[1], shadevector[2]); + glUniform4f( lightColorLoc, lightcolor[0], lightcolor[1], lightcolor[2], entalpha); - GL_Uniform1iFunc(texLoc, 0); - GL_Uniform1iFunc(fullbrightTexLoc, 1); - GL_Uniform1iFunc(useFullbrightTexLoc, (fb != nullptr) ? 1 : 0); - GL_Uniform1fFunc(useOverbrightLoc, overbright ? 1 : 0); - GL_Uniform1iFunc( + glUniform1i(texLoc, 0); + glUniform1i(fullbrightTexLoc, 1); + glUniform1i(useFullbrightTexLoc, (fb != nullptr) ? 1 : 0); + glUniform1f(useOverbrightLoc, overbright ? 1 : 0); + glUniform1i( useAlphaTestLoc, (currententity->model->flags & MF_HOLEY) ? 1 : 0); // set textures @@ -301,25 +437,284 @@ void GL_DrawAliasFrame_GLSL(aliashdr_t* paliashdr, lerpdata_t lerpdata, (void*)(intptr_t)currententity->model->vboindexofs); // clean up - GL_DisableVertexAttribArrayFunc(texCoordsAttrIndex); - GL_DisableVertexAttribArrayFunc(pose1VertexAttrIndex); - GL_DisableVertexAttribArrayFunc(pose2VertexAttrIndex); - GL_DisableVertexAttribArrayFunc(pose1NormalAttrIndex); - GL_DisableVertexAttribArrayFunc(pose2NormalAttrIndex); + glDisableVertexAttribArray(pose2NormalAttrIndex); + glDisableVertexAttribArray(pose1NormalAttrIndex); + glDisableVertexAttribArray(pose2VertexAttrIndex); + glDisableVertexAttribArray(pose1VertexAttrIndex); + glDisableVertexAttribArray(texCoordsAttrIndex); + + glUseProgram(0); + GL_SelectTexture(GL_TEXTURE0); + + rs_aliaspasses += paliashdr->numtris; +} + +void GL_DrawBlendedAliasFrame_GLSL(aliashdr_t* paliashdr, + const lerpdata_t& lerpdata, const lerpdata_t& zeroLerpdata, + const qfloat zeroBlend, gltexture_t* tx, gltexture_t* fb) +{ + const float blend = + (lerpdata.pose1 != lerpdata.pose2) ? lerpdata.blend : 0.f; + + glUseProgram(r_aliasblended_program); + + glBindBuffer(GL_ARRAY_BUFFER, currententity->model->meshvbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, currententity->model->meshindexesvbo); + + glEnableVertexAttribArray(texCoordsAttrIndex); + glEnableVertexAttribArray(pose1VertexAttrIndex); + glEnableVertexAttribArray(pose2VertexAttrIndex); + glEnableVertexAttribArray(pose1NormalAttrIndex); + glEnableVertexAttribArray(pose2NormalAttrIndex); + glEnableVertexAttribArray(zeroBlendVertexAttrIndex); + + glVertexAttribPointer(texCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, 0, + (void*)(intptr_t)currententity->model->vbostofs); - GL_UseProgramFunc(0); + glVertexAttribPointer(pose1VertexAttrIndex, 4, GL_UNSIGNED_BYTE, GL_FALSE, + sizeof(meshxyz_t), GLARB_GetXYZOffset(paliashdr, lerpdata.pose1)); + + glVertexAttribPointer(pose2VertexAttrIndex, 4, GL_UNSIGNED_BYTE, GL_FALSE, + sizeof(meshxyz_t), GLARB_GetXYZOffset(paliashdr, lerpdata.pose2)); + + // GL_TRUE to normalize the signed bytes to [-1 .. 1] + glVertexAttribPointer(pose1NormalAttrIndex, 4, GL_BYTE, GL_TRUE, + sizeof(meshxyz_t), GLARB_GetNormalOffset(paliashdr, lerpdata.pose1)); + + glVertexAttribPointer(pose2NormalAttrIndex, 4, GL_BYTE, GL_TRUE, + sizeof(meshxyz_t), GLARB_GetNormalOffset(paliashdr, lerpdata.pose2)); + + glVertexAttribPointer(zeroBlendVertexAttrIndex, 4, GL_UNSIGNED_BYTE, + GL_FALSE, sizeof(meshxyz_t), + GLARB_GetXYZOffset(paliashdr, zeroLerpdata.pose1)); + + // set uniforms + glUniform1f(blendLoc, blend); + glUniform1f(zeroBlendLoc, zeroBlend); + glUniform3f(shadevectorLoc, shadevector[0], shadevector[1], shadevector[2]); + glUniform4f( + lightColorLoc, lightcolor[0], lightcolor[1], lightcolor[2], entalpha); + glUniform1i(texLoc, 0); + glUniform1i(fullbrightTexLoc, 1); + glUniform1i(useFullbrightTexLoc, (fb != nullptr) ? 1 : 0); + glUniform1f(useOverbrightLoc, overbright ? 1 : 0); + glUniform1i( + useAlphaTestLoc, (currententity->model->flags & MF_HOLEY) ? 1 : 0); + + // set textures + GL_SelectTexture(GL_TEXTURE0); + GL_Bind(tx); + + if(fb) + { + GL_SelectTexture(GL_TEXTURE1); + GL_Bind(fb); + } + + // draw + glDrawElements(GL_TRIANGLES, paliashdr->numindexes, GL_UNSIGNED_SHORT, + (void*)(intptr_t)currententity->model->vboindexofs); + + // clean up + glDisableVertexAttribArray(zeroBlendVertexAttrIndex); + glDisableVertexAttribArray(pose2NormalAttrIndex); + glDisableVertexAttribArray(pose1NormalAttrIndex); + glDisableVertexAttribArray(pose2VertexAttrIndex); + glDisableVertexAttribArray(pose1VertexAttrIndex); + glDisableVertexAttribArray(texCoordsAttrIndex); + + glUseProgram(0); GL_SelectTexture(GL_TEXTURE0); rs_aliaspasses += paliashdr->numtris; } +[[nodiscard]] DrawAliasFrameData getDrawAliasFrameData( + const aliashdr_t& paliashdr, const lerpdata_t& lerpdata, + const lerpdata_t& zeroLerpdata) noexcept +{ + DrawAliasFrameData res; + + const auto vertsStart = + (trivertx_t*)(((byte*)(&paliashdr)) + paliashdr.posedata); + + if(lerpdata.pose1 != lerpdata.pose2) + { + res.lerping = true; + res.verts1 = vertsStart; + res.verts2 = res.verts1; + res.verts1 += lerpdata.pose1 * paliashdr.poseverts; + res.verts2 += lerpdata.pose2 * paliashdr.poseverts; + res.blend = lerpdata.blend; + res.iblend = 1.0f - res.blend; + } + else // poses the same means either 1. the entity has paused its animation, + // or 2. r_lerpmodels is disabled + { + res.lerping = false; + res.verts1 = vertsStart; + res.verts1 += lerpdata.pose1 * paliashdr.poseverts; + + res.verts2 = res.verts1; // avoid bogus compiler warning + res.blend = res.iblend = 0; // avoid bogus compiler warning + } + + res.zeroverts1 = vertsStart; + res.zeroverts1 += zeroLerpdata.pose1 * paliashdr.poseverts; + + return res; +} + +[[nodiscard]] qvec3 getFinalVertexPosLerped( + const DrawAliasFrameData& fd, const qfloat zeroBlend) noexcept +{ + const qvec3 v{// + fd.verts1->v[0] * fd.iblend + fd.verts2->v[0] * fd.blend, + fd.verts1->v[1] * fd.iblend + fd.verts2->v[1] * fd.blend, + fd.verts1->v[2] * fd.iblend + fd.verts2->v[2] * fd.blend}; + + const qvec3 zv{ + fd.zeroverts1->v[0], fd.zeroverts1->v[1], fd.zeroverts1->v[2]}; + + return glm::mix(v, zv, zeroBlend); +} + +[[nodiscard]] qvec3 getFinalVertexPosNonLerped( + const DrawAliasFrameData& fd, const qfloat zeroBlend) noexcept +{ + const qvec3 v{fd.verts1->v[0], fd.verts1->v[1], fd.verts1->v[2]}; + const qvec3 zv{ + fd.zeroverts1->v[0], fd.zeroverts1->v[1], fd.zeroverts1->v[2]}; + + return glm::mix(v, zv, zeroBlend); +} + +// TODO VR: (P1) test (done, this works). Cleanup? +void GL_DrawBlendedAliasFrame(const aliashdr_t* paliashdr, + const lerpdata_t& lerpdata, const lerpdata_t& zeroLerpdata, + const qfloat zeroBlend) +{ + if(zeroBlend <= 0.001) + { + void GL_DrawAliasFrame( + const aliashdr_t* paliashdr, const lerpdata_t& lerpdata); + GL_DrawAliasFrame(paliashdr, lerpdata); + return; + } + + auto fd = getDrawAliasFrameData(*paliashdr, lerpdata, zeroLerpdata); + auto& [verts1, verts2, zeroverts1, blend, iblend, lerping] = fd; + + int* commands = (int*)((byte*)paliashdr + paliashdr->commands); + + float vertcolor[4]; + vertcolor[3] = entalpha; // never changes, so there's no need to put this + // inside the loop + + while(true) + { + // get the vertex count and primitive type + int count = *commands++; + if(!count) + { + break; // done + } + + if(count < 0) + { + count = -count; + glBegin(GL_TRIANGLE_FAN); + } + else + { + glBegin(GL_TRIANGLE_STRIP); + } + + do + { + float u = ((float*)commands)[0]; + float v = ((float*)commands)[1]; + if(mtexenabled) + { + glMultiTexCoord2fARB(GL_TEXTURE0_ARB, u, v); + glMultiTexCoord2fARB(GL_TEXTURE1_ARB, u, v); + } + else + { + glTexCoord2f(u, v); + } + + commands += 2; + + if(shading) + { + if(r_drawflat_cheatsafe) + { + srand(count * (unsigned int)(src_offset_t)commands); + glColor3f(rand() % 256 / 255.0, rand() % 256 / 255.0, + rand() % 256 / 255.0); + } + else if(lerping) + { + vertcolor[0] = + (shadedots[verts1->lightnormalindex] * iblend + + shadedots[verts2->lightnormalindex] * blend) * + lightcolor[0]; + vertcolor[1] = + (shadedots[verts1->lightnormalindex] * iblend + + shadedots[verts2->lightnormalindex] * blend) * + lightcolor[1]; + vertcolor[2] = + (shadedots[verts1->lightnormalindex] * iblend + + shadedots[verts2->lightnormalindex] * blend) * + lightcolor[2]; + glColor4fv(vertcolor); + } + else + { + vertcolor[0] = + shadedots[verts1->lightnormalindex] * lightcolor[0]; + vertcolor[1] = + shadedots[verts1->lightnormalindex] * lightcolor[1]; + vertcolor[2] = + shadedots[verts1->lightnormalindex] * lightcolor[2]; + glColor4fv(vertcolor); + } + } + + if(lerping) + { + const qvec3 f = getFinalVertexPosLerped(fd, zeroBlend); + glVertex3f(f[0], f[1], f[2]); + + verts1++; + verts2++; + + zeroverts1++; + } + else + { + const qvec3 f = getFinalVertexPosNonLerped(fd, zeroBlend); + glVertex3f(f[0], f[1], f[2]); + + verts1++; + zeroverts1++; + } + } while(--count); + + glEnd(); + } + + rs_aliaspasses += paliashdr->numtris; +} + /* ============= GL_DrawAliasFrame -- johnfitz -- rewritten to support colored light, lerping, entalpha, multitexture, and r_drawflat ============= */ -void GL_DrawAliasFrame(aliashdr_t* paliashdr, lerpdata_t lerpdata) +void GL_DrawAliasFrame(const aliashdr_t* paliashdr, const lerpdata_t& lerpdata) { trivertx_t* verts1; trivertx_t* verts2; @@ -380,8 +775,8 @@ void GL_DrawAliasFrame(aliashdr_t* paliashdr, lerpdata_t lerpdata) float v = ((float*)commands)[1]; if(mtexenabled) { - GL_MTexCoord2fFunc(GL_TEXTURE0_ARB, u, v); - GL_MTexCoord2fFunc(GL_TEXTURE1_ARB, u, v); + glMultiTexCoord2fARB(GL_TEXTURE0_ARB, u, v); + glMultiTexCoord2fARB(GL_TEXTURE1_ARB, u, v); } else { @@ -453,25 +848,21 @@ R_SetupAliasFrame -- johnfitz -- rewritten to support lerping ================= */ void R_SetupAliasFrame( - entity_t* e, aliashdr_t* paliashdr, int frame, lerpdata_t* lerpdata) + entity_t* e, const aliashdr_t& paliashdr, int frame, lerpdata_t* lerpdata) { - int posenum; - - int numposes; - - if((frame >= paliashdr->numframes) || (frame < 0)) + if((frame >= paliashdr.numframes) || (frame < 0)) { Con_DPrintf("R_AliasSetupFrame: no such frame %d for '%s'\n", frame, e->model->name); frame = 0; } - posenum = paliashdr->frames[frame].firstpose; - numposes = paliashdr->frames[frame].numposes; + int posenum = paliashdr.frames[frame].firstpose; + const int numposes = paliashdr.frames[frame].numposes; if(numposes > 1) { - e->lerptime = paliashdr->frames[frame].interval; + e->lerptime = paliashdr.frames[frame].interval; posenum += (int)(cl.time / e->lerptime) % numposes; } else @@ -528,6 +919,27 @@ void R_SetupAliasFrame( } } +void R_SetupAliasFrameZero( + const aliashdr_t& paliashdr, int frame, lerpdata_t* lerpdata) +{ + if((frame >= paliashdr.numframes) || (frame < 0)) + { + frame = 0; + } + + int posenum = paliashdr.frames[frame].firstpose; + const int numposes = paliashdr.frames[frame].numposes; + + if(numposes > 1) + { + posenum += (int)(cl.time / 0.1) % numposes; + } + + // set up values + lerpdata->blend = 1; + lerpdata->pose1 = lerpdata->pose2 = posenum; +} + /* ================= R_SetupEntityTransform -- johnfitz -- set up transform part of lerpdata @@ -536,8 +948,6 @@ R_SetupEntityTransform -- johnfitz -- set up transform part of lerpdata void R_SetupEntityTransform(entity_t* e, lerpdata_t* lerpdata) { float blend; - glm::vec3 d; - int i; // if LERP_RESETMOVE, kill any lerps in progress if(e->lerpflags & LERP_RESETMOVE) @@ -575,14 +985,14 @@ void R_SetupEntityTransform(entity_t* e, lerpdata_t* lerpdata) } // translation - d = e->currentorigin - e->previousorigin; + qvec3 d = e->currentorigin - e->previousorigin; lerpdata->origin[0] = e->previousorigin[0] + d[0] * blend; lerpdata->origin[1] = e->previousorigin[1] + d[1] * blend; lerpdata->origin[2] = e->previousorigin[2] + d[2] * blend; // rotation d = e->currentangles - e->previousangles; - for(i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) { if(d[i] > 180) { @@ -612,21 +1022,15 @@ rewritten */ void R_SetupAliasLighting(entity_t* e) { - glm::vec3 dist; - float add; - int i; - int quantizedangle; - float radiansangle; - R_LightPoint(e->origin); // add dlights - for(i = 0; i < MAX_DLIGHTS; i++) + for(int i = 0; i < MAX_DLIGHTS; i++) { if(cl_dlights[i].die >= cl.time) { - dist = currententity->origin - cl_dlights[i].origin; - add = cl_dlights[i].radius - glm::length(dist); + const qvec3 dist = currententity->origin - cl_dlights[i].origin; + const qfloat add = cl_dlights[i].radius - glm::length(dist); if(add > 0) { @@ -635,21 +1039,20 @@ void R_SetupAliasLighting(entity_t* e) } } + const bool isViewmodel = + anyViewmodel(cl, [&](entity_t& ent) { return e == &ent; }); + // TODO VR: (P2) repetition here to check player view entities // minimum light value on gun (24) - if(e == &cl.viewent || e == &cl.offhand_viewent || - e == &cl.left_hip_holster || e == &cl.right_hip_holster || - e == &cl.left_upper_holster || e == &cl.right_upper_holster || - e == &cl.left_hand || e == &cl.right_hand || e == &cl.vrtorso || - e == &cl.left_hip_holster_slot || e == &cl.right_hip_holster_slot || - e == &cl.left_upper_holster_slot || e == &cl.right_upper_holster_slot) + if(isViewmodel) { - add = 72.0f - (lightcolor[0] + lightcolor[1] + lightcolor[2]); - if(add > 0.0f) + const qfloat add = + 72.0_qf - (lightcolor[0] + lightcolor[1] + lightcolor[2]); + if(add > 0.0_qf) { - lightcolor[0] += add / 3.0f; - lightcolor[1] += add / 3.0f; - lightcolor[2] += add / 3.0f; + lightcolor[0] += add / 3.0_qf; + lightcolor[1] += add / 3.0_qf; + lightcolor[2] += add / 3.0_qf; } } @@ -657,20 +1060,22 @@ void R_SetupAliasLighting(entity_t* e) if(currententity > cl_entities && currententity <= cl_entities + cl.maxclients) { - add = 24.0f - (lightcolor[0] + lightcolor[1] + lightcolor[2]); - if(add > 0.0f) + const qfloat add = + 24.0_qf - (lightcolor[0] + lightcolor[1] + lightcolor[2]); + if(add > 0.0_qf) { - lightcolor[0] += add / 3.0f; - lightcolor[1] += add / 3.0f; - lightcolor[2] += add / 3.0f; + lightcolor[0] += add / 3.0_qf; + lightcolor[1] += add / 3.0_qf; + lightcolor[2] += add / 3.0_qf; } } // clamp lighting so it doesn't overbright as much (96) if(overbright) { - add = 288.0f / (lightcolor[0] + lightcolor[1] + lightcolor[2]); - if(add < 1.0f) + const qfloat add = + 288.0_qf / (lightcolor[0] + lightcolor[1] + lightcolor[2]); + if(add < 1.0_qf) { lightcolor *= add; } @@ -681,18 +1086,18 @@ void R_SetupAliasLighting(entity_t* e) { if(e->model->flags & MOD_FBRIGHTHACK) { - lightcolor[0] = 256.0f; - lightcolor[1] = 256.0f; - lightcolor[2] = 256.0f; + lightcolor[0] = 256.0_qf; + lightcolor[1] = 256.0_qf; + lightcolor[2] = 256.0_qf; } } - quantizedangle = + const int quantizedangle = ((int)(e->angles[1] * (SHADEDOT_QUANT / 360.0))) & (SHADEDOT_QUANT - 1); // ericw -- shadevector is passed to the shader to compute shadedots inside // the shader, see GLAlias_CreateShaders() - radiansangle = (quantizedangle / 16.0) * 2.0 * 3.14159; + const float radiansangle = (quantizedangle / 16.0) * 2.0 * 3.14159; shadevector[0] = cos(-radiansangle); shadevector[1] = sin(-radiansangle); shadevector[2] = 1; @@ -701,6 +1106,15 @@ void R_SetupAliasLighting(entity_t* e) shadedots = r_avertexnormal_dots[quantizedangle]; lightcolor *= 1.0f / 200.0f; + + if(e->lightmod == EntityLightModifier::Override) + { + lightcolor = e->lightmodvalue; + } + else if(e->lightmod == EntityLightModifier::Multiply) + { + lightcolor *= e->lightmodvalue; + } } /* @@ -710,24 +1124,27 @@ R_DrawAliasModel -- johnfitz -- almost completely rewritten */ void R_DrawAliasModel(entity_t* e) { - aliashdr_t* paliashdr; - int i; - + // Cannot move down due to goto. int anim; - int skinnum; + int i; gltexture_t* tx; - gltexture_t* fb; - lerpdata_t lerpdata; - bool alphatest = !!(e->model->flags & MF_HOLEY); + + const bool alphatest = !!(e->model->flags & MF_HOLEY); + const qfloat zeroBlend = e->zeroBlend; // // setup pose/lerp data -- do it first so we don't miss updates due to // culling // - paliashdr = (aliashdr_t*)Mod_Extradata(e->model); - R_SetupAliasFrame(e, paliashdr, e->frame, &lerpdata); + aliashdr_t* paliashdr = (aliashdr_t*)Mod_Extradata(e->model); + + lerpdata_t zeroLerpdata; + R_SetupAliasFrameZero(*paliashdr, 0, &zeroLerpdata); + + lerpdata_t lerpdata; + R_SetupAliasFrame(e, *paliashdr, e->frame, &lerpdata); R_SetupEntityTransform(e, &lerpdata); // @@ -744,7 +1161,7 @@ void R_DrawAliasModel(entity_t* e) glPushMatrix(); R_RotateForEntity(lerpdata.origin, lerpdata.angles); - if(e->horizflip) + if(e->horizFlip) { glScalef(1.0f, -1.0f, 1.0f); glFrontFace(GL_CCW); @@ -814,6 +1231,7 @@ void R_DrawAliasModel(entity_t* e) // set up textures // GL_DisableMultitexture(); + anim = (int)(cl.time * 10) & 3; skinnum = e->skinnum; if((skinnum >= paliashdr->numskins) || (skinnum < 0)) @@ -844,7 +1262,7 @@ void R_DrawAliasModel(entity_t* e) if(r_drawflat_cheatsafe) { glDisable(GL_TEXTURE_2D); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame(paliashdr, lerpdata, zeroLerpdata, zeroBlend); glEnable(GL_TEXTURE_2D); srand((int)(cl.time * 1000)); // restore randomness } @@ -853,7 +1271,7 @@ void R_DrawAliasModel(entity_t* e) GL_Bind(tx); shading = false; glColor4f(1, 1, 1, entalpha); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame(paliashdr, lerpdata, zeroLerpdata, zeroBlend); if(fb) { glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); @@ -863,7 +1281,8 @@ void R_DrawAliasModel(entity_t* e) glDepthMask(GL_FALSE); glColor3f(entalpha, entalpha, entalpha); Fog_StartAdditive(); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); Fog_StopAdditive(); glDepthMask(GL_TRUE); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -875,14 +1294,23 @@ void R_DrawAliasModel(entity_t* e) glDisable(GL_TEXTURE_2D); shading = false; glColor3f(1, 1, 1); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame(paliashdr, lerpdata, zeroLerpdata, zeroBlend); glEnable(GL_TEXTURE_2D); } // call fast path if possible. if the shader compliation failed for some // reason, r_alias_program will be 0. - else if(r_alias_program != 0) + // TODO VR: (P1) test, restore? (done, this works. Cleanup) + else if(/*r_alias_program != 0 && */ r_aliasblended_program != 0) { - GL_DrawAliasFrame_GLSL(paliashdr, lerpdata, tx, fb); + if(false && zeroBlend <= 0.001) + { + GL_DrawAliasFrame_GLSL(paliashdr, lerpdata, tx, fb); + } + else + { + GL_DrawBlendedAliasFrame_GLSL( + paliashdr, lerpdata, zeroLerpdata, zeroBlend, tx, fb); + } } else if(overbright) { @@ -899,7 +1327,8 @@ void R_DrawAliasModel(entity_t* e) GL_Bind(fb); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); glEnable(GL_BLEND); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); glDisable(GL_BLEND); GL_DisableMultitexture(); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); @@ -914,7 +1343,8 @@ void R_DrawAliasModel(entity_t* e) glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2.0f); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1.0f); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); // second pass @@ -928,7 +1358,8 @@ void R_DrawAliasModel(entity_t* e) shading = false; glColor3f(entalpha, entalpha, entalpha); Fog_StartAdditive(); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); Fog_StopAdditive(); glDepthMask(GL_TRUE); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -941,14 +1372,16 @@ void R_DrawAliasModel(entity_t* e) // first pass GL_Bind(tx); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); // second pass -- additive with black fog, to double the object // colors but not the fog color glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); glDepthMask(GL_FALSE); Fog_StartAdditive(); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); Fog_StopAdditive(); glDepthMask(GL_TRUE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); @@ -965,7 +1398,8 @@ void R_DrawAliasModel(entity_t* e) shading = false; glColor3f(entalpha, entalpha, entalpha); Fog_StartAdditive(); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); Fog_StopAdditive(); glDepthMask(GL_TRUE); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -986,7 +1420,8 @@ void R_DrawAliasModel(entity_t* e) GL_Bind(fb); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); glEnable(GL_BLEND); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); glDisable(GL_BLEND); GL_DisableMultitexture(); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); @@ -996,7 +1431,8 @@ void R_DrawAliasModel(entity_t* e) // first pass GL_Bind(tx); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); // second pass if(fb) { @@ -1007,7 +1443,8 @@ void R_DrawAliasModel(entity_t* e) shading = false; glColor3f(entalpha, entalpha, entalpha); Fog_StartAdditive(); - GL_DrawAliasFrame(paliashdr, lerpdata); + GL_DrawBlendedAliasFrame( + paliashdr, lerpdata, zeroLerpdata, zeroBlend); Fog_StopAdditive(); glDepthMask(GL_TRUE); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1029,7 +1466,7 @@ void R_DrawAliasModel(entity_t* e) glColor3f(1, 1, 1); glPopMatrix(); - if(e->horizflip) + if(e->horizFlip) { glFrontFace(GL_CW); } @@ -1051,6 +1488,8 @@ TODO: orient shadow onto "lightplane" (a global mplane_t*) */ void GL_DrawAliasShadow(entity_t* e) { + // TODO VR: (P1) does this attempt to draw shadows for the world model...? + float shadowmatrix[16] = {1, 0, 0, 0, 0, 1, 0, 0, SHADOW_SKEW_X, SHADOW_SKEW_Y, SHADOW_VSCALE, 0, 0, 0, SHADOW_HEIGHT, 1}; float lheight; @@ -1075,7 +1514,7 @@ void GL_DrawAliasShadow(entity_t* e) } paliashdr = (aliashdr_t*)Mod_Extradata(e->model); - R_SetupAliasFrame(e, paliashdr, e->frame, &lerpdata); + R_SetupAliasFrame(e, *paliashdr, e->frame, &lerpdata); R_SetupEntityTransform(e, &lerpdata); R_LightPoint(e->origin); lheight = currententity->origin[2] - lightspot[2]; @@ -1100,6 +1539,7 @@ void GL_DrawAliasShadow(entity_t* e) glDisable(GL_TEXTURE_2D); shading = false; glColor4f(0, 0, 0, entalpha * 0.5); + // TODO VR: (P1) can this use glsl? GL_DrawAliasFrame(paliashdr, lerpdata); glEnable(GL_TEXTURE_2D); glDisable(GL_BLEND); @@ -1125,7 +1565,7 @@ void R_DrawAliasModel_ShowTris(entity_t* e) } paliashdr = (aliashdr_t*)Mod_Extradata(e->model); - R_SetupAliasFrame(e, paliashdr, e->frame, &lerpdata); + R_SetupAliasFrame(e, *paliashdr, e->frame, &lerpdata); R_SetupEntityTransform(e, &lerpdata); glPushMatrix(); diff --git a/Quake/r_brush.cpp b/Quake/r_brush.cpp index e64fe214..9b6408f0 100644 --- a/Quake/r_brush.cpp +++ b/Quake/r_brush.cpp @@ -25,7 +25,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "util.hpp" -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "glquake.hpp" +#include "quakedef_macros.hpp" +#include "entity.hpp" +#include "client.hpp" +#include "gl_texmgr.hpp" +#include "sys.hpp" +#include "console.hpp" extern cvar_t gl_fullbrights, r_drawflat, gl_overbright, r_oldwater; // johnfitz extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix @@ -354,8 +362,8 @@ void R_DrawSequentialPoly (msurface_t *s) v = s->polys->verts[0]; for (i=0 ; i<s->polys->numverts ; i++, v+= VERTEXSIZE) { - GL_MTexCoord2fFunc (GL_TEXTURE0_ARB, v[3], v[4]); - GL_MTexCoord2fFunc (GL_TEXTURE1_ARB, v[5], v[6]); + glMultiTexCoord2fARB (GL_TEXTURE0_ARB, v[3], v[4]); + glMultiTexCoord2fARB (GL_TEXTURE1_ARB, v[5], v[6]); glVertex3fv (v); } glEnd (); @@ -429,8 +437,8 @@ void R_DrawSequentialPoly (msurface_t *s) v = s->polys->verts[0]; for (i=0 ; i<s->polys->numverts ; i++, v+= VERTEXSIZE) { - GL_MTexCoord2fFunc (GL_TEXTURE0_ARB, v[3], v[4]); - GL_MTexCoord2fFunc (GL_TEXTURE1_ARB, v[5], v[6]); + glMultiTexCoord2fARB (GL_TEXTURE0_ARB, v[3], v[4]); + glMultiTexCoord2fARB (GL_TEXTURE1_ARB, v[5], v[6]); glVertex3fv (v); } glEnd (); @@ -527,26 +535,18 @@ R_DrawBrushModel */ void R_DrawBrushModel(entity_t* e) { - int i; - - int k; - msurface_t* psurf; - float dot; - mplane_t* pplane; - qmodel_t* clmodel; - if(R_CullModelForEntity(e)) { return; } currententity = e; - clmodel = e->model; + qmodel_t* clmodel = e->model; modelorg = r_refdef.vieworg - e->origin; if(e->angles[0] || e->angles[1] || e->angles[2]) { - glm::vec3 temp = modelorg; + const qvec3 temp = modelorg; const auto [forward, right, up] = quake::util::getAngledVectors(e->angles); @@ -556,13 +556,13 @@ void R_DrawBrushModel(entity_t* e) modelorg[2] = DotProduct(temp, up); } - psurf = &clmodel->surfaces[clmodel->firstmodelsurface]; + msurface_t* psurf = &clmodel->surfaces[clmodel->firstmodelsurface]; // calculate dynamic lighting for bmodel if it's not an // instanced model if(clmodel->firstmodelsurface != 0 && !gl_flashblend.value) { - for(k = 0; k < MAX_DLIGHTS; k++) + for(int k = 0; k < MAX_DLIGHTS; ++k) { if((cl_dlights[k].die < cl.time) || (!cl_dlights[k].radius)) { @@ -592,13 +592,33 @@ void R_DrawBrushModel(entity_t* e) } e->angles[0] = -e->angles[0]; // stupid quake bug + if(e->horizFlip) + { + glScalef(1.0f, -1.0f, 1.0f); + glFrontFace(GL_CCW); + } + + // TODO VR: (P1) document why we have +1, code repetition with alias + glTranslatef(-e->scale_origin[0], -e->scale_origin[1], -e->scale_origin[2]); + glScalef(e->scale[0] + 1.f, e->scale[1] + 1.f, e->scale[2] + 1.f); + glTranslatef(e->scale_origin[0], e->scale_origin[1], e->scale_origin[2]); + + const bool scaled = + (e->scale[0] != 0.f) && (e->scale[1] != 0.f) && (e->scale[2] != 0.f); + R_ClearTextureChains(clmodel, chain_model); - for(i = 0; i < clmodel->nummodelsurfaces; i++, psurf++) + + int i; + for(i = 0; i < clmodel->nummodelsurfaces; ++i, ++psurf) { - pplane = psurf->plane; - dot = DotProduct(modelorg, pplane->normal) - pplane->dist; - if(((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) || - (!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) + mplane_t* pplane = psurf->plane; + const float dot = DotProduct(modelorg, pplane->normal) - pplane->dist; + + // TODO VR: (P2) hack for scaled brush models, dot is incorrenct and + // faces get culled + if(scaled || + (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) || + (!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))) { R_ChainSurface(psurf, chain_model); rs_brushpolys++; @@ -636,7 +656,7 @@ void R_DrawBrushModel_ShowTris(entity_t* e) modelorg = r_refdef.vieworg - e->origin; if(e->angles[0] || e->angles[1] || e->angles[2]) { - glm::vec3 temp = modelorg; + qvec3 temp = modelorg; const auto [forward, right, up] = quake::util::getAngledVectors(e->angles); @@ -653,6 +673,17 @@ void R_DrawBrushModel_ShowTris(entity_t* e) R_RotateForEntity(e->origin, e->angles); e->angles[0] = -e->angles[0]; // stupid quake bug + if(e->horizFlip) + { + glScalef(1.0f, -1.0f, 1.0f); + glFrontFace(GL_CCW); + } + + // TODO VR: (P1) document why we have +1, code repetition with brush + glTranslatef(-e->scale_origin[0], -e->scale_origin[1], -e->scale_origin[2]); + glScalef(e->scale[0] + 1.f, e->scale[1] + 1.f, e->scale[2] + 1.f); + glTranslatef(e->scale_origin[0], e->scale_origin[1], e->scale_origin[2]); + // // draw it // @@ -889,10 +920,10 @@ void BuildSurfaceDisplayList(msurface_t* fa) medge_t* pedges; medge_t* r_pedge; - float* vec; - float s; + qfloat* vec; + qfloat s; - float t; + qfloat t; glpoly_t* poly; // reconstruct the polygon @@ -915,12 +946,12 @@ void BuildSurfaceDisplayList(msurface_t* fa) if(lindex > 0) { r_pedge = &pedges[lindex]; - vec = glm::value_ptr(r_pcurrentvertbase[r_pedge->v[0]].position); + vec = toGlVec(r_pcurrentvertbase[r_pedge->v[0]].position); } else { r_pedge = &pedges[-lindex]; - vec = glm::value_ptr(r_pcurrentvertbase[r_pedge->v[1]].position); + vec = toGlVec(r_pcurrentvertbase[r_pedge->v[1]].position); } s = DotProduct(vec, fa->texinfo->vecs[0]) + fa->texinfo->vecs[0][3]; s /= fa->texinfo->texture->width; @@ -1071,7 +1102,7 @@ void GL_DeleteBModelVertexBuffer() return; } - GL_DeleteBuffersFunc(1, &gl_bmodel_vbo); + glDeleteBuffersARB(1, &gl_bmodel_vbo); gl_bmodel_vbo = 0; GL_ClearBufferBindings(); @@ -1104,8 +1135,8 @@ void GL_BuildBModelVertexBuffer() } // ask GL for a name for our VBO - GL_DeleteBuffersFunc(1, &gl_bmodel_vbo); - GL_GenBuffersFunc(1, &gl_bmodel_vbo); + glDeleteBuffersARB(1, &gl_bmodel_vbo); + glGenBuffersARB(1, &gl_bmodel_vbo); // count all verts in all models numverts = 0; @@ -1147,8 +1178,8 @@ void GL_BuildBModelVertexBuffer() } // upload to GPU - GL_BindBufferFunc(GL_ARRAY_BUFFER, gl_bmodel_vbo); - GL_BufferDataFunc(GL_ARRAY_BUFFER, varray_bytes, varray, GL_STATIC_DRAW); + glBindBufferARB(GL_ARRAY_BUFFER, gl_bmodel_vbo); + glBufferDataARB(GL_ARRAY_BUFFER, varray_bytes, varray, GL_STATIC_DRAW); free(varray); // invalidate the cached bindings @@ -1171,9 +1202,9 @@ void R_AddDynamicLights(msurface_t* surf) float rad; float minlight; - glm::vec3 impact; + qvec3 impact; - glm::vec3 local; + qvec3 local; int s; int t; diff --git a/Quake/r_part.cpp b/Quake/r_part.cpp index c7e5b81b..6fcdb6b5 100644 --- a/Quake/r_part.cpp +++ b/Quake/r_part.cpp @@ -18,7 +18,7 @@ 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. +Foundation, Inc., 59 Temple Place - Suite 430, Boston, MA 02111-1307, USA. */ @@ -26,15 +26,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "sys.hpp" #include "util.hpp" #include "quakeglm.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "quakeglm_qvec4.hpp" +#include "common.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" +#include "image.hpp" +#include "shader.hpp" +#include "msg.hpp" +#include "zone.hpp" +#include "client.hpp" +#include "gl_texmgr.hpp" + #include <algorithm> #include <random> +#include <string_view> #include <utility> #include <array> -#define MAX_PARTICLES \ - 4096 // default max # of particles at one - // time, per texture (TODO VR: (P2) should it be per texture?) +#define MAX_PARTICLES 4096 * 100 // default max # of particles at once +// time, per texture (TODO VR: (P2) should it be per texture?, cvar) #define ABSOLUTE_MIN_PARTICLES \ 512 // no fewer than this no matter what's @@ -66,79 +78,226 @@ enum ptype_t : std::uint8_t pt_rock, pt_gunsmoke, pt_gunpickup, + pt_txbigsmoke, }; -// TODO VR: (P2) optimize layout? -struct particle_t +struct ParticleSOA { - glm::vec3 org; - glm::vec3 vel; - glm::vec3 acc; + struct Data + { + float _ramp; + float _die; + ptype_t _type; + std::uint8_t _param0; + }; + + qvec3* _orgs; + qvec3* _vels; + qvec3* _accs; + qvec4* _colors; + float* _angles; + float* _scales; + int* _atlasIdxs; + Data* _datas; +}; + +struct ParticleHandleSOA +{ + ParticleSOA* _soa; + std::size_t _idx; + + [[nodiscard]] QUAKE_FORCEINLINE qvec3& org() noexcept + { + return _soa->_orgs[_idx]; + } + + [[nodiscard]] QUAKE_FORCEINLINE qvec3& vel() noexcept + { + return _soa->_vels[_idx]; + } + + [[nodiscard]] QUAKE_FORCEINLINE qvec3& acc() noexcept + { + return _soa->_accs[_idx]; + } + + QUAKE_FORCEINLINE void setColor(const float x) noexcept + { + GLubyte* c = (GLubyte*)&d_8to24table[(int)x]; + + _soa->_colors[_idx].rgb = + qvec3{c[0] / 255.f, c[1] / 255.f, c[2] / 255.f}; + } + + [[nodiscard]] QUAKE_FORCEINLINE float& ramp() noexcept + { + return _soa->_datas[_idx]._ramp; + } + + [[nodiscard]] QUAKE_FORCEINLINE float& die() noexcept + { + return _soa->_datas[_idx]._die; + } + + [[nodiscard]] QUAKE_FORCEINLINE float& scale() noexcept + { + return _soa->_scales[_idx]; + } + + QUAKE_FORCEINLINE void setAlpha(const float x) noexcept + { + _soa->_colors[_idx].a = x / 255.f; + } + + QUAKE_FORCEINLINE void addAlpha(const float x, const float ft) noexcept + { + _soa->_colors[_idx].a += (x / 255.f) * ft; + } - float color; - float ramp; - float die; - float scale; - float alpha; - float angle; + [[nodiscard]] QUAKE_FORCEINLINE float& angle() noexcept + { + return _soa->_angles[_idx]; + } + + [[nodiscard]] QUAKE_FORCEINLINE int& atlasIdx() noexcept + { + return _soa->_atlasIdxs[_idx]; + } - ptype_t type; - std::uint8_t param0; + [[nodiscard]] QUAKE_FORCEINLINE ptype_t& type() noexcept + { + return _soa->_datas[_idx]._type; + } + + [[nodiscard]] QUAKE_FORCEINLINE std::uint8_t& param0() noexcept + { + return _soa->_datas[_idx]._param0; + } }; -class ParticleBuffer +template <class UnaryPredicate> +[[nodiscard]] constexpr std::size_t index_find_if( + std::size_t first, std::size_t last, UnaryPredicate&& p) +{ + for(; first != last; ++first) + { + if(p(first)) + { + return first; + } + } + + return last; +} + +template <class UnaryPredicate, class F> +[[nodiscard]] std::size_t index_remove_if( + std::size_t first, std::size_t last, UnaryPredicate&& p, F&& f) +{ + first = index_find_if(first, last, p); + + if(first != last) + { + for(std::size_t i = first; ++i != last;) + { + if(!p(i)) + { + f(first, i); + ++first; + } + } + } + + return first; +} + +class ParticleBufferSOA { private: - particle_t* _particles; - particle_t* _aliveEnd; - particle_t* _end; + ParticleSOA _pSOA; + std::size_t _aliveCount; std::size_t _maxParticles; public: void initialize(const std::size_t maxParticles) noexcept { + _aliveCount = 0; _maxParticles = maxParticles; - _particles = (particle_t*)Hunk_AllocName( - _maxParticles * sizeof(particle_t), "particles"); - _aliveEnd = _particles; - _end = _particles + _maxParticles; + + const auto alloc = [&](auto& field, const char* name) { + using Type = std::remove_pointer_t<std::decay_t<decltype(field)>>; + field = Hunk_AllocName<Type>(_maxParticles, name); + }; + + alloc(_pSOA._orgs, "psoa_orgs"); + alloc(_pSOA._vels, "psoa_vels"); + alloc(_pSOA._accs, "psoa_accs"); + alloc(_pSOA._colors, "psoa_colors"); + alloc(_pSOA._angles, "psoa_angles"); + alloc(_pSOA._scales, "psoa_scales"); + alloc(_pSOA._atlasIdxs, "psoa_atlasIdxs"); + alloc(_pSOA._datas, "psoa_datas"); } void cleanup() noexcept { - _aliveEnd = - std::remove_if(_particles, _aliveEnd, [](const particle_t& p) { - return p.alpha <= 0.f || p.scale <= 0.f || cl.time >= p.die; + _aliveCount = index_remove_if( + 0, _aliveCount, + [&](const std::size_t i) { + return _pSOA._colors[i].a <= 0.f // + || _pSOA._scales[i] <= 0.f // + || cl.time >= _pSOA._datas[i]._die; + }, + [&](const std::size_t targetIdx, const std::size_t srcIdx) { + _pSOA._orgs[targetIdx] = std::move(_pSOA._orgs[srcIdx]); + _pSOA._vels[targetIdx] = std::move(_pSOA._vels[srcIdx]); + _pSOA._accs[targetIdx] = std::move(_pSOA._accs[srcIdx]); + _pSOA._colors[targetIdx] = std::move(_pSOA._colors[srcIdx]); + _pSOA._angles[targetIdx] = std::move(_pSOA._angles[srcIdx]); + _pSOA._scales[targetIdx] = std::move(_pSOA._scales[srcIdx]); + _pSOA._atlasIdxs[targetIdx] = + std::move(_pSOA._atlasIdxs[srcIdx]); + _pSOA._datas[targetIdx] = std::move(_pSOA._datas[srcIdx]); }); } - [[nodiscard]] QUAKE_FORCEINLINE particle_t& create() noexcept + [[nodiscard]] QUAKE_FORCEINLINE ParticleHandleSOA create() noexcept { - return *_aliveEnd++; + return {&_pSOA, _aliveCount++}; } template <typename F> QUAKE_FORCEINLINE void forActive(F&& f) noexcept { - for(auto p = _particles; p != _aliveEnd; ++p) + for(std::size_t i = 0; i < _aliveCount; ++i) { - f(*p); + f(ParticleHandleSOA{&_pSOA, i}); } } [[nodiscard]] QUAKE_FORCEINLINE bool full() const noexcept { - return _aliveEnd == _end; + return _aliveCount == _maxParticles; } void clear() noexcept { - _aliveEnd = _particles; + _aliveCount = 0; } [[nodiscard]] QUAKE_FORCEINLINE bool empty() const noexcept { - return _aliveEnd == _particles; + return _aliveCount == 0; + } + + [[nodiscard]] QUAKE_FORCEINLINE std::size_t aliveCount() const noexcept + { + return _aliveCount; + } + + ParticleSOA& soa() noexcept + { + return _pSOA; } }; @@ -149,6 +308,88 @@ struct ImageData int height; }; +ImageData stitchImageData(const ImageData& a, const ImageData& b) +{ + const auto width = a.width + b.width; + const auto height = std::max(a.height, b.height); + const auto numPixels = width * height; + const auto numBytes = numPixels * 4; + + const auto idx = [](const int width, const int height, const int depth, + const int x, const int y, const int z) { + return (width * y + x) * 4 + z; + return x + height * (y + width * z); + return x + width * (y + depth * z); + }; + + byte* data = Hunk_Alloc<byte>(numBytes); + + const auto doPic = [&](const int xOffset, const auto& pic) { + for(int x = 0; x < pic.width; ++x) + { + for(int y = 0; y < pic.height; ++y) + { + for(int z = 0; z < 4; ++z) + { + data[idx(width, height, 4, xOffset + x, y, z)] = + pic.data[idx(pic.width, pic.height, 4, x, y, z)]; + } + } + } + }; + + doPic(0, a); + doPic(a.width, b); + + return ImageData{data, width, height}; +} + +struct AtlasData +{ + ImageData _imageData; + std::vector<float> _imageInfo; // x, y, width, height +}; + +template <typename... Ts> +[[nodiscard]] AtlasData stitchImages(const Ts&... images) +{ + const auto width = (images.width + ...); + const auto height = std::max({images.height...}); + const auto numPixels = width * height; + const auto numBytes = numPixels * 4; + + const auto idx = [](const int width, const int depth, const int x, + const int y, + const int z) { return (width * y + x) * depth + z; }; + + byte* data = Hunk_Alloc<byte>(numBytes); + std::vector<float> imageInfo; + + const auto blit = [&](const int xOffset, const auto& pic) { + imageInfo.emplace_back(xOffset); + imageInfo.emplace_back(0); + imageInfo.emplace_back(pic.width); + imageInfo.emplace_back(pic.height); + + for(int x = 0; x < pic.width; ++x) + { + for(int y = 0; y < pic.height; ++y) + { + for(int z = 0; z < 4; ++z) + { + data[idx(width, 4, xOffset + x, y, z)] = + pic.data[idx(pic.width, 4, x, y, z)]; + } + } + } + }; + + int xOffset = 0; + ((blit(xOffset, images), xOffset += images.width), ...); + + return AtlasData{ImageData{data, width, height}, std::move(imageInfo)}; +} + class ParticleTextureManager { public: @@ -176,8 +417,8 @@ class ParticleTextureManager return _textures[handle]; } - [[nodiscard]] const ImageData& getImageData(const Handle handle) const - noexcept + [[nodiscard]] const ImageData& getImageData( + const Handle handle) const noexcept { assert(handle < _next); return _imageData[handle]; @@ -191,6 +432,9 @@ class ParticleTextureManager int r_numparticles; +using PBuffer = ParticleBufferSOA; +using PHandle = ParticleHandleSOA; + class ParticleManager { public: @@ -198,7 +442,7 @@ class ParticleManager private: ParticleTextureManager _textureMgr; - std::array<ParticleBuffer, ParticleTextureManager::maxTextures> _buffers; + std::array<PBuffer, ParticleTextureManager::maxTextures> _buffers; public: [[nodiscard]] Handle createBuffer( @@ -214,13 +458,13 @@ class ParticleManager return _textureMgr.get(handle); } - [[nodiscard]] const ImageData& getImageData(const Handle handle) const - noexcept + [[nodiscard]] const ImageData& getImageData( + const Handle handle) const noexcept { return _textureMgr.getImageData(handle); } - [[nodiscard]] ParticleBuffer& getBuffer( + [[nodiscard]] PBuffer& getBuffer( const ParticleTextureManager::Handle txHandle) noexcept { assert(txHandle < _textureMgr.numActive()); @@ -282,6 +526,11 @@ std::mt19937 mt(rd()); return std::uniform_int_distribution<int>{min, max - 1}(mt); } +[[nodiscard]] QUAKE_FORCEINLINE static float rndToRad( + const float min, const float max) noexcept +{ + return rnd(min * M_PI_DIV_180, max * M_PI_DIV_180); +} cvar_t r_particles = {"r_particles", "1", CVAR_ARCHIVE}; // johnfitz cvar_t r_particle_mult = {"r_particle_mult", "1", CVAR_ARCHIVE}; @@ -310,29 +559,32 @@ QUAKE_FORCEINLINE void makeNParticles( const ParticleTextureManager::Handle txHandle, const int count, F&& f) noexcept { - makeNParticlesI(txHandle, count, [&f](const int, particle_t& p) { f(p); }); + makeNParticlesI(txHandle, count, [&f](const int, PHandle p) { f(p); }); } -QUAKE_FORCEINLINE void setAccGrav(particle_t& p, float mult = 0.5f) noexcept +QUAKE_FORCEINLINE void setAccGrav(PHandle p, float mult = 0.5f) noexcept { extern cvar_t sv_gravity; - p.acc[0] = 0.f; - p.acc[1] = 0.f; - p.acc[2] = -sv_gravity.value * mult; + p.acc()[0] = 0.f; + p.acc()[1] = 0.f; + p.acc()[2] = -sv_gravity.value * mult; } -ParticleTextureManager::Handle ptxCircle; -ParticleTextureManager::Handle ptxSquare; -ParticleTextureManager::Handle ptxBlob; -ParticleTextureManager::Handle ptxExplosion; -ParticleTextureManager::Handle ptxSmoke; -ParticleTextureManager::Handle ptxBlood; -ParticleTextureManager::Handle ptxBloodMist; -ParticleTextureManager::Handle ptxLightning; -ParticleTextureManager::Handle ptxSpark; -ParticleTextureManager::Handle ptxRock; -ParticleTextureManager::Handle ptxGunSmoke; +ParticleTextureManager::Handle ptxAtlas; +AtlasData ptxAtlasData; + +constexpr int aiCircle = 0; +// constexpr int aiSquare = 1; +// constexpr int aiBlob = 2; +constexpr int aiExplosion = 3; +constexpr int aiSmoke = 4; +constexpr int aiBlood = 5; +constexpr int aiBloodMist = 6; +constexpr int aiLightning = 7; +constexpr int aiSpark = 8; +constexpr int aiRock = 9; +constexpr int aiGunSmoke = 10; template <typename F> QUAKE_FORCEINLINE void forActiveParticles(F&& f) noexcept @@ -448,42 +700,38 @@ void R_InitParticleTextures() static byte particle2_data[2 * 2 * 4]; static byte particle3_data[64 * 64 * 4]; - { + const auto circleImageData = [&] { buildCircleTexture(particle1_data); - const ImageData imageData{particle1_data, 64, 64}; - ptxCircle = pMgr.createBuffer( - makeTextureFromImageData("particle1", imageData), imageData); - } + return ImageData{particle1_data, 64, 64}; + }(); - { + const auto squareImageData = [&] { buildSquareTexture(particle2_data); - const ImageData imageData{particle2_data, 2, 2}; - ptxSquare = pMgr.createBuffer( - makeTextureFromImageData("particle2", imageData), imageData); - } + return ImageData{particle2_data, 2, 2}; + }(); - { + const auto blobImageData = [&] { buildBlobTexture(particle3_data); - const ImageData imageData{particle3_data, 64, 64}; - ptxBlob = pMgr.createBuffer( - makeTextureFromImageData("particle3", imageData), imageData); - } - - const auto load = [&](ParticleTextureManager::Handle& target, - const char* name) { - const auto imageData = loadImage(name); - target = pMgr.createBuffer( - makeTextureFromImageData(name, imageData), imageData); - }; - - load(ptxExplosion, "textures/particle_explosion"); - load(ptxSmoke, "textures/particle_smoke"); - load(ptxBlood, "textures/particle_blood"); - load(ptxBloodMist, "textures/particle_blood_mist"); - load(ptxLightning, "textures/particle_lightning"); - load(ptxSpark, "textures/particle_spark"); - load(ptxRock, "textures/particle_rock"); - load(ptxGunSmoke, "textures/particle_gun_smoke"); + return ImageData{particle3_data, 64, 64}; + }(); + + ptxAtlasData = stitchImages( // + circleImageData, // + squareImageData, // + blobImageData, // + loadImage("textures/particle_explosion"), // + loadImage("textures/particle_smoke"), // + loadImage("textures/particle_blood"), // + loadImage("textures/particle_blood_mist"), // + loadImage("textures/particle_lightning"), // + loadImage("textures/particle_spark"), // + loadImage("textures/particle_rock"), // + loadImage("textures/particle_gun_smoke") // + ); + + ptxAtlas = pMgr.createBuffer( + makeTextureFromImageData("atlas", ptxAtlasData._imageData), + ptxAtlasData._imageData); } static void R_InitRNumParticles() @@ -529,7 +777,7 @@ R_EntityParticles */ #define NUMVERTEXNORMALS 162 extern float r_avertexnormals[NUMVERTEXNORMALS][3]; -glm::vec3 avelocities[NUMVERTEXNORMALS]; +qvec3 avelocities[NUMVERTEXNORMALS]; float beamlength = 16; void R_EntityParticles(entity_t* ent) @@ -554,27 +802,28 @@ void R_EntityParticles(entity_t* ent) float sp = sin(angle); float cp = cos(angle); - glm::vec3 forward; + qvec3 forward; forward[0] = cp * cy; forward[1] = cp * sy; forward[2] = -sp; - makeNParticles(ptxCircle, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 0.01; - p.color = 0x6f; - p.type = pt_explode; - p.scale = 1.f; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 0.01; + p.setColor(0x6f); + p.type() = pt_explode; + p.scale() = 1.f; setAccGrav(p); constexpr float dist = 64; - p.org[0] = ent->origin[0] + r_avertexnormals[i][0] * dist + - forward[0] * beamlength; - p.org[1] = ent->origin[1] + r_avertexnormals[i][1] * dist + - forward[1] * beamlength; - p.org[2] = ent->origin[2] + r_avertexnormals[i][2] * dist + - forward[2] * beamlength; + p.org()[0] = ent->origin[0] + r_avertexnormals[i][0] * dist + + forward[0] * beamlength; + p.org()[1] = ent->origin[1] + r_avertexnormals[i][1] * dist + + forward[1] * beamlength; + p.org()[2] = ent->origin[2] + r_avertexnormals[i][2] * dist + + forward[2] * beamlength; }); } } @@ -617,7 +866,7 @@ void R_ReadPointFile_f() int c = 0; while(true) { - glm::vec3 org; + qvec3 org; const int r = fscanf(f, "%f %f %f\n", &org[0], &org[1], &org[2]); if(r != 3) @@ -627,17 +876,18 @@ void R_ReadPointFile_f() c++; - makeNParticles(ptxCircle, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = 99999; - p.color = (-c) & 15; - p.type = pt_static; - p.scale = 1.f; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = 99999; + p.setColor((-c) & 15); + p.type() = pt_static; + p.scale() = 1.f; setAccGrav(p); - p.vel = vec3_zero; - p.org = org; + p.vel() = vec3_zero; + p.org() = org; }); } @@ -654,13 +904,9 @@ Parse an effect out of the server message */ void R_ParseParticleEffect() { - glm::vec3 org; - for(int i = 0; i < 3; i++) - { - org[i] = MSG_ReadCoord(cl.protocolflags); - } + const auto org = MSG_ReadVec3(cl.protocolflags); - glm::vec3 dir; + qvec3 dir; for(int i = 0; i < 3; i++) { dir[i] = MSG_ReadChar() * (1.0 / 16); @@ -681,13 +927,9 @@ Parse an effect out of the server message (preset-based) */ void R_ParseParticle2Effect() { - glm::vec3 org; - for(int i = 0; i < 3; i++) - { - org[i] = MSG_ReadCoord(cl.protocolflags); - } + const auto org = MSG_ReadVec3(cl.protocolflags); - glm::vec3 dir; + qvec3 dir; for(int i = 0; i < 3; i++) { dir[i] = MSG_ReadChar() * (1.0 / 16); @@ -704,92 +946,97 @@ void R_ParseParticle2Effect() R_ParticleExplosion =============== */ -void R_ParticleExplosion(const glm::vec3& org) -{ - makeNParticlesI(ptxCircle, 256, [&](const int i, particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 2; - p.color = ramp1[0]; - p.ramp = rand() & 3; - p.scale = rnd(0.6f, 1.2f); +void R_ParticleExplosion(const qvec3& org) +{ + makeNParticlesI(ptxAtlas, 256, [&](const int i, PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(ramp1[0]); + p.ramp() = rand() & 3; + p.scale() = rnd(0.6f, 1.2f); setAccGrav(p); - p.type = i & 1 ? pt_explode : pt_explode2; + p.type() = i & 1 ? pt_explode : pt_explode2; for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-16, 16); - p.vel[j] = rnd(-256, 256); + p.org()[j] = org[j] + rnd(-16, 16); + p.vel()[j] = rnd(-256, 256); } }); - makeNParticlesI(ptxSpark, 64, [&](const int, particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 3; - p.color = ramp1[0]; - p.ramp = rand() & 3; - p.scale = rnd(1.9f, 2.9f) * 0.55f; + makeNParticlesI(ptxAtlas, 64, [&](const int, PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(ramp1[0]); + p.ramp() = rand() & 3; + p.scale() = rnd(1.9f, 2.9f) * 0.55f; setAccGrav(p); - p.type = pt_rock; - p.param0 = rndi(0, 2); // rotation direction + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-16, 16); - p.vel[j] = rnd(-256, 256); + p.org()[j] = org[j] + rnd(-16, 16); + p.vel()[j] = rnd(-256, 256); } }); - makeNParticlesI(ptxRock, 48, [&](const int, particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 3; - p.color = 167 + (rand() & 7); - p.ramp = rand() & 3; - p.scale = rnd(0.9f, 1.9f); + makeNParticlesI(ptxAtlas, 48, [&](const int, PHandle p) { + p.atlasIdx() = aiRock; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(167 + (rand() & 7)); + p.ramp() = rand() & 3; + p.scale() = rnd(0.9f, 1.9f); setAccGrav(p); - p.type = pt_rock; - p.param0 = rndi(0, 2); // rotation direction + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-16, 16); - p.vel[j] = rnd(-256, 256); + p.org()[j] = org[j] + rnd(-16, 16); + p.vel()[j] = rnd(-256, 256); } }); - makeNParticles(ptxExplosion, 3, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 240; - p.die = cl.time + 1.5 * rnd(0.5f, 1.5f); - p.color = ramp1[0]; - p.ramp = rand() & 3; - p.scale = rnd(0.5f, 2.1f) * 2.f; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiExplosion; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(ramp1[0]); + p.ramp() = rand() & 3; + p.scale() = rnd(0.5f, 2.1f) * 2.f; setAccGrav(p, 0.05f); - p.type = pt_txexplode; - p.param0 = rndi(0, 2); // rotation direction + p.type() = pt_txexplode; + p.param0() = rndi(0, 2); // rotation direction for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-11, 11); - p.vel[j] = rnd(-8, 8); + p.org()[j] = org[j] + rnd(-11, 11); + p.vel()[j] = rnd(-8, 8); } }); - makeNParticles(ptxSmoke, 3, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 225; - p.die = cl.time + 3.5 * (rand() % 5); - p.color = rand() & 7; - p.scale = rnd(1.2f, 1.5f); - p.type = pt_txsmoke; + makeNParticles(ptxAtlas, 3, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(225); + p.die() = cl.time + 3.5; + p.setColor(rand() & 7); + p.scale() = rnd(1.2f, 1.5f); + p.type() = pt_txsmoke; setAccGrav(p, -0.09f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = rnd(-24, 24); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-24, 24); } }); } @@ -799,331 +1046,458 @@ void R_ParticleExplosion(const glm::vec3& org) R_ParticleExplosion2 =============== */ -void R_ParticleExplosion2(const glm::vec3& org, int colorStart, int colorLength) +void R_ParticleExplosion2(const qvec3& org, int colorStart, int colorLength) { int colorMod = 0; - makeNParticles(ptxCircle, 512, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 0.3; - p.color = colorStart + (colorMod % colorLength); - p.scale = 1.f; + makeNParticlesI(ptxAtlas, 256, [&](const int, PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(colorStart + (colorMod % colorLength)); + p.scale() = rnd(1.6f, 3.5f); colorMod++; setAccGrav(p); + p.type() = pt_blob; + + for(int j = 0; j < 3; j++) + { + p.org()[j] = org[j] + rnd(-16, 16); + p.vel()[j] = rnd(-256, 256); + } + }); + + makeNParticlesI(ptxAtlas, 64, [&](const int, PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(ramp1[0]); + p.ramp() = rand() & 3; + p.scale() = rnd(1.9f, 2.9f) * 0.55f; + setAccGrav(p); + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction - p.type = pt_blob; for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-16, 16); - p.vel[j] = rnd(-256, 256); + p.org()[j] = org[j] + rnd(-16, 16); + p.vel()[j] = rnd(-256, 256); + } + }); + + makeNParticlesI(ptxAtlas, 48, [&](const int, PHandle p) { + p.atlasIdx() = aiRock; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(167 + (rand() & 7)); + p.ramp() = rand() & 3; + p.scale() = rnd(0.9f, 1.9f); + setAccGrav(p); + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction + + for(int j = 0; j < 3; j++) + { + p.org()[j] = org[j] + rnd(-16, 16); + p.vel()[j] = rnd(-256, 256); + } + }); + + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiExplosion; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.5; + p.setColor(colorStart + (colorMod % colorLength)); + p.ramp() = rand() & 3; + p.scale() = rnd(0.5f, 2.1f) * 2.f; + setAccGrav(p, 0.05f); + p.type() = pt_txexplode; + p.param0() = rndi(0, 2); // rotation direction + + for(int j = 0; j < 3; j++) + { + p.org()[j] = org[j] + rnd(-11, 11); + p.vel()[j] = rnd(-8, 8); + } + }); + + makeNParticles(ptxAtlas, 3, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(225); + p.die() = cl.time + 3.5; + p.setColor(rand() & 7); + p.scale() = rnd(1.2f, 1.5f); + p.type() = pt_txsmoke; + setAccGrav(p, -0.09f); + + for(int j = 0; j < 3; j++) + { + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-24, 24); } }); } void R_RunParticleEffect_BulletPuff( - const glm::vec3& org, const glm::vec3& dir, int color, int count) + const qvec3& org, const qvec3& dir, int color, int count) { const auto debrisCount = count * 0.7f; const auto dustCount = count * 0.7f; const auto sparkCount = count * 0.4f; - makeNParticles(ptxRock, debrisCount, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 0.7 * (rand() % 5); - p.color = (color & ~7) + (rand() & 7); - p.scale = rnd(0.5f, 0.9f); - p.type = pt_rock; - p.param0 = rndi(0, 2); // rotation direction + makeNParticles(ptxAtlas, debrisCount, [&](PHandle p) { + p.atlasIdx() = aiRock; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 0.7 * (rand() % 5); + p.setColor((color & ~7) + (rand() & 7)); + p.scale() = rnd(0.5f, 0.9f); + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction setAccGrav(p, 0.26f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = (dir[j] + 0.3f) * rnd(-75, 75); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = (dir[j] + 0.3f) * rnd(-75, 75); } }); - makeNParticles(ptxSmoke, 1, [&](particle_t& p) { - p.alpha = 45; - p.die = cl.time + 1.5 * (rand() % 5); - p.color = rand() & 7; - p.scale = rnd(0.3f, 0.5f); - p.type = pt_txsmoke; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.setAlpha(45); + p.die() = cl.time + 1.25 * (rand() % 5); + p.setColor(rand() & 7); + p.scale() = rnd(0.3f, 0.5f); + p.type() = pt_txsmoke; setAccGrav(p, -0.09f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 4) - 2); - p.vel[j] = rnd(-12, 12); + p.org()[j] = org[j] + ((rand() & 4) - 2); + p.vel()[j] = rnd(-12, 12); } }); - makeNParticles(ptxCircle, dustCount, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 1.5 * (rand() % 5); - p.color = (color & ~7) + (rand() & 7); - p.scale = rnd(0.05f, 0.3f); - p.type = pt_static; + makeNParticles(ptxAtlas, dustCount, [&](PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 0.75 * (rand() % 5); + p.setColor((color & ~7) + (rand() & 7)); + p.scale() = rnd(0.05f, 0.3f); + p.type() = pt_static; setAccGrav(p, 0.08f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = rnd(-24, 24); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-24, 24); } - p.vel[2] += rnd(10, 40); + p.vel()[2] += rnd(10, 40); }); - makeNParticles(ptxSpark, sparkCount, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 1.6 * (rand() % 5); - p.color = ramp3[0] + (rand() & 7); - p.scale = rnd(1.95f, 2.87f) * 0.35f; - p.type = pt_rock; - p.param0 = rndi(0, 2); // rotation direction + makeNParticles(ptxAtlas, sparkCount, [&](PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 1.25 * (rand() % 5); + p.setColor(ramp3[0] + (rand() & 7)); + p.scale() = rnd(1.95f, 2.87f) * 0.35f; + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction setAccGrav(p, 1.f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = rnd(-48, 48); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-48, 48); } - p.vel[2] = rnd(60, 360); + p.vel()[2] = rnd(60, 360); }); } -void R_RunParticleEffect_Blood( - const glm::vec3& org, const glm::vec3& dir, int count) +void R_RunParticleEffect_Blood(const qvec3& org, const qvec3& dir, int count) { constexpr int bloodColors[]{247, 248, 249, 250, 251}; const auto pickBloodColor = [&] { return bloodColors[rndi(0, 5)]; }; - makeNParticles(ptxBlood, count * 2, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 100; - p.die = cl.time + 0.7 * (rand() % 3); - p.color = pickBloodColor(); - p.scale = rnd(0.35f, 0.6f) * 6.5f; - p.type = pt_static; + makeNParticles(ptxAtlas, count * 2, [&](PHandle p) { + p.atlasIdx() = aiBlood; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(100); + p.die() = cl.time + 0.7 * (rand() % 3); + p.setColor(pickBloodColor()); + p.scale() = rnd(0.35f, 0.6f) * 6.5f; + p.type() = pt_static; setAccGrav(p, 0.29f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-2, 2); - p.vel[j] = (dir[j] + 0.3f) * rnd(-10, 10); + p.org()[j] = org[j] + rnd(-2, 2); + p.vel()[j] = (dir[j] + 0.3f) * rnd(-10, 10); } - p.vel[2] += rnd(0, 40); + p.vel()[2] += rnd(0, 40); }); - makeNParticles(ptxCircle, count * 24, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 175; - p.die = cl.time + 0.4 * (rand() % 3); - p.color = pickBloodColor(); - p.scale = rnd(0.12f, 0.2f); - p.type = pt_static; + makeNParticles(ptxAtlas, count * 24, [&](PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(175); + p.die() = cl.time + 0.4 * (rand() % 3); + p.setColor(pickBloodColor()); + p.scale() = rnd(0.12f, 0.2f); + p.type() = pt_static; setAccGrav(p, 0.45f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-2, 2); - p.vel[j] = (dir[j] + 0.3f) * rnd(-3, 3); - p.vel[j] *= 13.f; + p.org()[j] = org[j] + rnd(-2, 2); + p.vel()[j] = (dir[j] + 0.3f) * rnd(-3, 3); + p.vel()[j] *= 13.f; } - p.vel[2] += rnd(20, 60); + p.vel()[2] += rnd(20, 60); }); - makeNParticles(ptxBloodMist, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 38; - p.die = cl.time + 3.2; - p.color = 225; - p.ramp = rand() & 3; - p.scale = rnd(1.1f, 2.4f) * 15.f; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiBloodMist; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(38); + p.die() = cl.time + 2.0; + p.setColor(225); + p.ramp() = rand() & 3; + p.scale() = rnd(1.1f, 2.4f) * 15.f; setAccGrav(p, -0.03f); - p.type = pt_txsmoke; + p.type() = pt_txsmoke; for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-8, 8); - p.vel[j] = rnd(-4, -4); + p.org()[j] = org[j] + rnd(-8, 8); + p.vel()[j] = rnd(-4, -4); } }); } void R_RunParticleEffect_Lightning( - const glm::vec3& org, const glm::vec3& dir, int count) + const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxLightning, count, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 180; - p.die = cl.time + 1.3 * (rand() % 3); - p.color = 254; - p.scale = rnd(0.35f, 0.6f) * 6.2f; - p.type = pt_lightning; + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiLightning; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(rnd(180, 220)); + p.die() = cl.time + 1.2 * (rand() % 3); + p.setColor(254); + p.scale() = rnd(0.35f, 0.6f) * 6.2f; + p.type() = pt_lightning; setAccGrav(p, 0.f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + rnd(-3, 3); - p.vel[j] = rnd(-185, 185); + p.org()[j] = org[j] + rnd(-3, 3); + p.vel()[j] = rnd(-185, 185); } }); } -void R_RunParticleEffect_Smoke( - const glm::vec3& org, const glm::vec3& dir, int count) +void R_RunParticleEffect_Smoke(const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxSmoke, count, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 125; - p.die = cl.time + 3.5 * (rand() % 5); - p.color = rand() & 7; - p.scale = rnd(1.2f, 1.5f) * 0.8f; - p.type = pt_txsmoke; + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(125); + p.die() = cl.time + 2.5 * (rand() % 5); + p.setColor(rand() & 7); + p.scale() = rnd(1.2f, 1.5f) * 0.8f; + p.type() = pt_txsmoke; setAccGrav(p, -0.09f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = rnd(-24, 24); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-24, 24); } }); } -void R_RunParticleEffect_Sparks( - const glm::vec3& org, const glm::vec3& dir, int count) +void R_RunParticleEffect_BigSmoke(const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxSpark, count, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 2.6 * (rand() % 5); - p.color = rndi(102, 112); - p.scale = rnd(1.55f, 2.87f) * 0.45f; - p.type = pt_rock; - p.param0 = rndi(0, 2); // rotation direction + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 2.5 * (rand() % 5); + p.setColor(rand() & 7); + p.scale() = rnd(1.2f, 1.7f) * 2.8f; + p.type() = pt_txbigsmoke; + setAccGrav(p, -0.09f); + + for(int j = 0; j < 3; j++) + { + p.org()[j] = org[j] + ((rand() & 9) - 4); + p.vel()[j] = rnd(-24, 24); + } + }); +} + +void R_RunParticleEffect_Sparks(const qvec3& org, const qvec3& dir, int count) +{ + (void)dir; + + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 2.0 * (rand() % 5); + p.setColor(rndi(102, 112)); + p.scale() = rnd(1.55f, 2.87f) * 0.45f; + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction setAccGrav(p, 1.f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = rnd(-48, 48); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-48, 48); } - p.vel[2] = rnd(60, 360); + p.vel()[2] = rnd(60, 360); }); } -void R_RunParticleEffect_GunSmoke( - const glm::vec3& org, const glm::vec3& dir, int count) +void R_RunParticleEffect_GunSmoke(const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxGunSmoke, count, [&](particle_t& p) { - p.angle = 3.14f / 2.f + rnd(-0.2f, 0.2f); - p.alpha = rnd(85, 125); - p.die = cl.time + 6; - p.color = rndi(10, 16); - p.scale = rnd(0.9f, 1.5f) * 0.1f; - p.type = pt_gunsmoke; + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiGunSmoke; + p.angle() = rndToRad(-10.f, 10.f) + (90 * M_PI_DIV_180); + p.setAlpha(rnd(85, 125)); + p.die() = cl.time + 3.5; + p.setColor(rndi(10, 16)); + p.scale() = rnd(0.9f, 1.5f) * 0.1f; + p.type() = pt_gunsmoke; setAccGrav(p, -0.09f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j]; - p.vel[j] = rnd(-3, 3); + p.org()[j] = org[j]; + p.vel()[j] = rnd(-3, 3); } - p.org[2] += 3.f; + p.org()[2] += 3.f; }); } -void R_RunParticleEffect_Teleport( - const glm::vec3& org, const glm::vec3& dir, int count) +void R_RunParticleEffect_Teleport(const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxSpark, count, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.die = cl.time + 0.6; - p.color = rndi(208, 220); - p.scale = rnd(1.55f, 2.87f) * 0.65f; - p.type = pt_rock; - p.param0 = rndi(0, 2); // rotation direction + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.die() = cl.time + 0.6; + p.setColor(rndi(208, 220)); + p.scale() = rnd(1.55f, 2.87f) * 0.65f; + p.type() = pt_rock; + p.param0() = rndi(0, 2); // rotation direction setAccGrav(p, 1.f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 7) - 4); - p.vel[j] = rnd(-48, 48); + p.org()[j] = org[j] + ((rand() & 7) - 4); + p.vel()[j] = rnd(-48, 48); } - p.vel[2] = rnd(60, 360); + p.vel()[2] = rnd(60, 360); }); } void R_RunParticleEffect_GunPickup( - const glm::vec3& org, const glm::vec3& dir, int count) + const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxSpark, count, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = rnd(150, 200); - p.die = cl.time + 0.5; - p.color = rndi(12, 16); - p.scale = rnd(1.55f, 2.87f) * 0.35f; - p.type = pt_gunpickup; - p.param0 = rndi(0, 2); // rotation direction + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(rnd(150, 200)); + p.die() = cl.time + 0.5; + p.setColor(rndi(12, 16)); + p.scale() = rnd(1.55f, 2.87f) * 0.35f; + p.type() = pt_gunpickup; setAccGrav(p, -0.2f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 3) - 2); - p.vel[j] = rnd(-16, 16); + p.org()[j] = org[j] + ((rand() & 3) - 2); + p.vel()[j] = rnd(-16, 16); } - p.vel[2] = rnd(-10, 30); + p.vel()[2] = rnd(-10, 30); }); } void R_RunParticleEffect_GunForceGrab( - const glm::vec3& org, const glm::vec3& dir, int count) + const qvec3& org, const qvec3& dir, int count) { (void)dir; - makeNParticles(ptxSpark, count, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = rnd(180, 225); - p.die = cl.time + 0.6; - p.color = rndi(106, 111); - p.scale = rnd(1.55f, 2.87f) * 0.35f; - p.type = pt_gunpickup; - p.param0 = rndi(0, 2); // rotation direction + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(rnd(180, 225)); + p.die() = cl.time + 0.6; + p.setColor(rndi(106, 111)); + p.scale() = rnd(1.55f, 2.87f) * 0.35f; + p.type() = pt_gunpickup; setAccGrav(p, -0.3f); for(int j = 0; j < 3; j++) { - p.org[j] = org[j] + ((rand() & 4) - 2); - p.vel[j] = rnd(-24, 24); + p.org()[j] = org[j] + ((rand() & 4) - 2); + p.vel()[j] = rnd(-24, 24); } - p.vel[2] = rnd(0, 40); + p.vel()[2] = rnd(0, 40); + }); +} + +void R_RunParticleEffect_LavaSpike( + const qvec3& org, const qvec3& dir, int count) +{ + (void)dir; + + makeNParticles(ptxAtlas, count, [&](PHandle p) { + p.atlasIdx() = aiSpark; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(rnd(180, 225)); + p.die() = cl.time + 0.5; + p.setColor(rndi(247, 254)); + p.scale() = rnd(1.55f, 2.87f) * 0.17f; + p.type() = pt_gunpickup; + setAccGrav(p, 0.17f); + + for(int j = 0; j < 3; j++) + { + p.org()[j] = org[j] + static_cast<float>(((rand() & 2) - 1)) * 0.3f; + p.vel()[j] = rnd(-2, 2); + } }); } @@ -1133,7 +1507,7 @@ R_RunParticle2Effect =============== */ void R_RunParticle2Effect( - const glm::vec3& org, const glm::vec3& dir, int preset, int count) + const qvec3& org, const qvec3& dir, int preset, int count) { enum class Preset : int { @@ -1147,6 +1521,8 @@ void R_RunParticle2Effect( Teleport = 7, GunPickup = 8, GunForceGrab = 9, + LavaSpike = 10, + BigSmoke = 11 }; switch(static_cast<Preset>(preset)) @@ -1201,6 +1577,16 @@ void R_RunParticle2Effect( R_RunParticleEffect_GunForceGrab(org, dir, count); break; } + case Preset::LavaSpike: + { + R_RunParticleEffect_LavaSpike(org, dir, count); + break; + } + case Preset::BigSmoke: + { + R_RunParticleEffect_BigSmoke(org, dir, count); + break; + } default: { assert(false); @@ -1214,32 +1600,33 @@ void R_RunParticle2Effect( R_LavaSplash =============== */ -void R_LavaSplash(const glm::vec3& org) +void R_LavaSplash(const qvec3& org) { for(int i = -16; i < 16; i++) { for(int j = -16; j < 16; j++) { - makeNParticles(ptxCircle, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.scale = 1.f; - p.die = cl.time + 2 + (rand() & 31) * 0.02; - p.color = 224 + (rand() & 7); - p.type = pt_static; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.scale() = 1.f; + p.die() = cl.time + 2 + (rand() & 31) * 0.02; + p.setColor(224 + (rand() & 7)); + p.type() = pt_static; setAccGrav(p); - const glm::vec3 dir{ // + const qvec3 dir{ // j * 8 + (rand() & 7), // i * 8 + (rand() & 7), // 256}; - p.org[0] = org[0] + dir[0]; - p.org[1] = org[1] + dir[1]; - p.org[2] = org[2] + (rand() & 63); + p.org()[0] = org[0] + dir[0]; + p.org()[1] = org[1] + dir[1]; + p.org()[2] = org[2] + (rand() & 63); - const float vel = 50 + (rand() & 63); - p.vel = safeNormalize(dir) * vel; + const qfloat vel = 50 + (rand() & 63); + p.vel() = safeNormalize(dir) * vel; }); } } @@ -1250,7 +1637,7 @@ void R_LavaSplash(const glm::vec3& org) R_TeleportSplash =============== */ -void R_TeleportSplash(const glm::vec3& org) +void R_TeleportSplash(const qvec3& org) { for(int i = -16; i < 16; i += 4) { @@ -1258,116 +1645,117 @@ void R_TeleportSplash(const glm::vec3& org) { for(int k = -24; k < 32; k += 4) { - makeNParticles(ptxCircle, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = rnd(150, 255); - p.scale = rnd(0.6f, 1.f); - p.die = cl.time + 1.2 + (rand() & 7) * 0.2; - p.color = 7 + (rand() & 7); - p.type = pt_teleport; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiCircle; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(rnd(150, 255)); + p.scale() = rnd(0.6f, 1.f); + p.die() = cl.time + 1.2 + (rand() & 7) * 0.2; + p.setColor(7 + (rand() & 7)); + p.type() = pt_teleport; setAccGrav(p, 0.2f); - const glm::vec3 dir{ + const qvec3 dir{ j * 8, // i * 8, // k * 8 // }; - p.org[0] = org[0] + i + (rand() & 3); - p.org[1] = org[1] + j + (rand() & 3); - p.org[2] = org[2] + k + (rand() & 3); + p.org()[0] = org[0] + i + (rand() & 3); + p.org()[1] = org[1] + j + (rand() & 3); + p.org()[2] = org[2] + k + (rand() & 3); - const float vel = 50 + (rand() & 63); - p.vel = safeNormalize(dir) * vel; + const qfloat vel = 50 + (rand() & 63); + p.vel() = safeNormalize(dir) * vel; }); } } } } -static void R_SetRTRocketTrail(const glm::vec3& start, particle_t& p) +static void R_SetRTRocketTrail(const qvec3& start, PHandle p) { - p.ramp = (rand() & 3); - p.color = ramp3[(int)p.ramp]; - p.type = pt_fire; + p.ramp() = (rand() & 3); + p.setColor(ramp3[(int)p.ramp()]); + p.type() = pt_fire; for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + ((rand() % 6) - 3); + p.org()[j] = start[j] + ((rand() % 6) - 3); } } -static void R_SetRTBlood(const glm::vec3& start, particle_t& p) +static void R_SetRTBlood(const qvec3& start, PHandle p) { - p.type = pt_static; - p.color = 67 + (rand() & 3); + p.type() = pt_static; + p.setColor(67 + (rand() & 3)); for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + ((rand() % 6) - 3); + p.org()[j] = start[j] + ((rand() % 6) - 3); } } static void R_SetRTTracer( - const glm::vec3& start, const glm::vec3& end, particle_t& p, int type) + const qvec3& start, const qvec3& end, PHandle p, int type) { static int tracercount; const auto vec = end - start; - p.die = cl.time + 0.5; - p.type = pt_static; + p.die() = cl.time + 0.5; + p.type() = pt_static; if(type == 3) { - p.color = 52 + ((tracercount & 4) << 1); + p.setColor(52 + ((tracercount & 4) << 1)); } else { - p.color = 230 + ((tracercount & 4) << 1); + p.setColor(230 + ((tracercount & 4) << 1)); } tracercount++; - p.org = start; + p.org() = start; if(tracercount & 1) { - p.vel[0] = 30 * vec[1]; - p.vel[1] = 30 * -vec[0]; + p.vel()[0] = 30 * vec[1]; + p.vel()[1] = 30 * -vec[0]; } else { - p.vel[0] = 30 * -vec[1]; - p.vel[1] = 30 * vec[0]; + p.vel()[0] = 30 * -vec[1]; + p.vel()[1] = 30 * vec[0]; } } -static void R_SetRTSlightBlood(const glm::vec3& start, particle_t& p) +static void R_SetRTSlightBlood(const qvec3& start, PHandle p) { - p.type = pt_static; - p.color = 67 + (rand() & 3); + p.type() = pt_static; + p.setColor(67 + (rand() & 3)); for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + ((rand() % 6) - 3); + p.org()[j] = start[j] + ((rand() % 6) - 3); } } -static void R_SetRTVoorTrail(const glm::vec3& start, particle_t& p) +static void R_SetRTVoorTrail(const qvec3& start, PHandle p) { - p.color = 9 * 16 + 8 + (rand() & 3); - p.type = pt_static; - p.die = cl.time + 0.3; + p.setColor(9 * 16 + 8 + (rand() & 3)); + p.type() = pt_static; + p.die() = cl.time + 0.3; for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + ((rand() & 15) - 8); + p.org()[j] = start[j] + ((rand() & 15) - 8); } } -static void R_SetRTCommon(particle_t& p) +static void R_SetRTCommon(PHandle p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 255; - p.scale = 0.7f; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(255); + p.scale() = 0.7f; setAccGrav(p, 0.05f); - p.vel = vec3_zero; - p.die = cl.time + 2; + p.vel() = vec3_zero; + p.die() = cl.time + 2; } /* @@ -1380,9 +1768,9 @@ FIXME -- rename function and use #defined types instead of numbers constexpr float rate = 0.1f / 9.f; float untilNext = rate; -void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) +void R_RocketTrail(qvec3 start, const qvec3& end, int type) { - const float frametime = cl.time - cl.oldtime; + const auto frametime = cl.time - cl.oldtime; untilNext -= frametime; if(untilNext > 0) @@ -1416,23 +1804,25 @@ void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) { case 0: // rocket trail { - makeNParticles(ptxCircle, 6, [&](particle_t& p) { + makeNParticles(ptxAtlas, 6, [&](PHandle p) { + p.atlasIdx() = aiCircle; R_SetRTCommon(p); R_SetRTRocketTrail(start, p); }); - makeNParticles(ptxSmoke, 1, [&](particle_t& p) { - p.alpha = 65; - p.die = cl.time + 1.5 * (rand() % 5); - p.color = rand() & 7; - p.scale = rnd(0.3f, 0.5f); - p.type = pt_txsmoke; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.setAlpha(65); + p.die() = cl.time + 1.5 * (rand() % 5); + p.setColor(rand() & 7); + p.scale() = rnd(0.3f, 0.5f); + p.type() = pt_txsmoke; setAccGrav(p, -0.09f); for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + ((rand() & 6) - 3); - p.vel[j] = rnd(-18, 18); + p.org()[j] = start[j] + ((rand() & 6) - 3); + p.vel()[j] = rnd(-18, 18); } }); @@ -1441,19 +1831,20 @@ void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) case 1: // smoke smoke { - makeNParticles(ptxSmoke, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 65; - p.die = cl.time + 1.5 * (rand() % 5); - p.color = rand() & 7; - p.scale = rnd(0.3f, 0.5f); - p.type = pt_txsmoke; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(65); + p.die() = cl.time + 1.5 * (rand() % 5); + p.setColor(rand() & 7); + p.scale() = rnd(0.3f, 0.5f); + p.type() = pt_txsmoke; setAccGrav(p, -0.09f); for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + ((rand() & 6) - 3); - p.vel[j] = rnd(-18, 18); + p.org()[j] = start[j] + ((rand() & 6) - 3); + p.vel()[j] = rnd(-18, 18); } }); @@ -1462,25 +1853,27 @@ void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) case 2: // blood { - makeNParticles(ptxCircle, 6, [&](particle_t& p) { + makeNParticles(ptxAtlas, 6, [&](PHandle p) { + p.atlasIdx() = aiCircle; R_SetRTCommon(p); R_SetRTBlood(start, p); }); - makeNParticles(ptxBloodMist, 1, [&](particle_t& p) { - p.angle = rnd(0.f, 360.f); - p.alpha = 32; - p.die = cl.time + 3.2; - p.color = 225; - p.ramp = rand() & 3; - p.scale = rnd(1.1f, 2.4f) * 15.f; + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiBloodMist; + p.angle() = rndToRad(0.f, 360.f); + p.setAlpha(32); + p.die() = cl.time + 3.2; + p.setColor(225); + p.ramp() = rand() & 3; + p.scale() = rnd(1.1f, 2.4f) * 15.f; setAccGrav(p, -0.03f); - p.type = pt_txsmoke; + p.type() = pt_txsmoke; for(int j = 0; j < 3; j++) { - p.org[j] = start[j] + rnd(-8, 8); - p.vel[j] = rnd(-4, -4); + p.org()[j] = start[j] + rnd(-8, 8); + p.vel()[j] = rnd(-4, -4); } }); @@ -1490,7 +1883,8 @@ void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) case 3: [[fallthrough]]; case 5: // tracer { - makeNParticles(ptxCircle, 6, [&](particle_t& p) { + makeNParticles(ptxAtlas, 6, [&](PHandle p) { + p.atlasIdx() = aiCircle; R_SetRTCommon(p); R_SetRTTracer(start, end, p, type); }); @@ -1500,7 +1894,8 @@ void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) case 4: // slight blood { - makeNParticles(ptxCircle, 6, [&](particle_t& p) { + makeNParticles(ptxAtlas, 6, [&](PHandle p) { + p.atlasIdx() = aiCircle; R_SetRTCommon(p); R_SetRTSlightBlood(start, p); len -= 3; @@ -1511,13 +1906,41 @@ void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type) case 6: // voor trail { - makeNParticles(ptxCircle, 6, [&](particle_t& p) { + makeNParticles(ptxAtlas, 6, [&](PHandle p) { + p.atlasIdx() = aiCircle; R_SetRTCommon(p); R_SetRTVoorTrail(start, p); }); break; } + + case 7: // mini rocket trail + { + makeNParticles(ptxAtlas, 2, [&](PHandle p) { + p.atlasIdx() = aiCircle; + R_SetRTCommon(p); + R_SetRTRocketTrail(start, p); + }); + + makeNParticles(ptxAtlas, 1, [&](PHandle p) { + p.atlasIdx() = aiSmoke; + p.setAlpha(55); + p.die() = cl.time + 1.2 * (rand() % 5); + p.setColor(rand() & 7); + p.scale() = rnd(0.05f, 0.23f); + p.type() = pt_txsmoke; + setAccGrav(p, -0.09f); + + for(int j = 0; j < 3; j++) + { + p.org()[j] = start[j] + ((rand() & 4) - 2); + p.vel()[j] = rnd(-18, 18); + } + }); + + break; + } } start += vec; @@ -1537,7 +1960,8 @@ void CL_RunParticles() return; } - const float frametime = cl.time - cl.oldtime; + const qfloat frametime = cl.time - cl.oldtime; + const float time3 = frametime * 15; const float time2 = frametime * 10; const float time1 = frametime * 5; @@ -1545,11 +1969,19 @@ void CL_RunParticles() pMgr.cleanup(); - forActiveParticles([&](particle_t& p) { - p.vel += p.acc * frametime; - p.org += p.vel * frametime; + pMgr.forBuffers([&](gltexture_t*, const ImageData&, PBuffer& pBuffer) { + ParticleSOA& soa = pBuffer.soa(); + const auto pCount = pBuffer.aliveCount(); - switch(p.type) + for(std::size_t i = 0; i < pCount; ++i) + { + soa._vels[i] += soa._accs[i] * frametime; + soa._orgs[i] += soa._vels[i] * frametime; + } + }); + + forActiveParticles([&](PHandle p) { + switch(p.type()) { case pt_static: { @@ -1558,14 +1990,14 @@ void CL_RunParticles() case pt_fire: { - p.ramp += time1; - if(p.ramp >= 6) + p.ramp() += time1; + if(p.ramp() >= 6) { - p.die = -1; + p.die() = -1; } else { - p.color = ramp3[(int)p.ramp]; + p.setColor(ramp3[(int)p.ramp()]); } break; @@ -1573,20 +2005,20 @@ void CL_RunParticles() case pt_explode: { - p.ramp += time2; + p.ramp() += time2; - if(p.ramp >= 8) + if(p.ramp() >= 8) { - p.die = -1; + p.die() = -1; } else { - p.color = ramp1[(int)p.ramp]; + p.setColor(ramp1[(int)p.ramp()]); } for(int i = 0; i < 3; i++) { - p.vel[i] += p.vel[i] * dvel; + p.vel()[i] += p.vel()[i] * dvel; } break; @@ -1594,20 +2026,20 @@ void CL_RunParticles() case pt_explode2: { - p.ramp += time3; + p.ramp() += time3; - if(p.ramp >= 8) + if(p.ramp() >= 8) { - p.die = -1; + p.die() = -1; } else { - p.color = ramp2[(int)p.ramp]; + p.setColor(ramp2[(int)p.ramp()]); } for(int i = 0; i < 3; i++) { - p.vel[i] -= p.vel[i] * frametime; + p.vel()[i] -= p.vel()[i] * frametime; } break; @@ -1615,10 +2047,7 @@ void CL_RunParticles() case pt_blob: { - for(int i = 0; i < 3; i++) - { - p.vel[i] += p.vel[i] * dvel; - } + p.vel() += p.vel() * dvel; break; } @@ -1627,7 +2056,7 @@ void CL_RunParticles() { for(int i = 0; i < 2; i++) { - p.vel[i] -= p.vel[i] * dvel; + p.vel()[i] -= p.vel()[i] * dvel; } break; @@ -1635,57 +2064,65 @@ void CL_RunParticles() case pt_txexplode: { - p.alpha -= 345.f * frametime; - p.scale += 135.f * frametime; - p.angle += 0.75f * frametime * (p.param0 == 0 ? 1.f : -1.f); + p.addAlpha(-345.f, frametime); + p.scale() += 135.f * frametime; + p.angle() += 0.75f * frametime * (p.param0() == 0 ? 1.f : -1.f); break; } case pt_txsmoke: { - p.alpha -= 75.f * frametime; - p.scale += 47.f * frametime; + p.addAlpha(-70.f, frametime); + p.scale() += 47.f * frametime; + + break; + } + + case pt_txbigsmoke: + { + p.addAlpha(-35.f, frametime); + p.scale() += 37.f * frametime; break; } case pt_lightning: { - p.alpha -= 87.f * frametime; - p.scale -= 33.f * frametime; + p.addAlpha(-84.f, frametime); + p.scale() -= 32.f * frametime; break; } case pt_teleport: { - p.alpha -= 85.f * frametime; - p.scale -= 0.1f * frametime; + p.addAlpha(-85.f, frametime); + p.scale() -= 0.1f * frametime; break; } case pt_rock: { - p.angle += 25.f * frametime * (p.param0 == 0 ? 1.f : -1.f); + p.angle() += 25.f * frametime * (p.param0() == 0 ? 1.f : -1.f); break; } case pt_gunsmoke: { - p.alpha -= 105.f * frametime; - p.scale += 68.f * frametime; - p.org[2] += 18.f * frametime; + p.addAlpha(-110.f, frametime); + p.scale() += 69.f * frametime; + p.org()[2] += 18.f * frametime; break; } case pt_gunpickup: { - p.alpha -= 120.f * frametime; - p.scale -= 0.2f * frametime; + p.addAlpha(-120.f, frametime); + p.scale() -= 0.2f * frametime; break; } @@ -1698,6 +2135,145 @@ void CL_RunParticles() }); } +static GLuint makeParticleShaders() +{ + using namespace std::string_view_literals; + + constexpr auto vertexShader = R"glsl( +#version 430 core + +layout(location = 0) in vec3 pOrg; +layout(location = 1) in float pAngle; +layout(location = 2) in float pScale; +layout(location = 3) in vec4 pColor; +layout(location = 4) in int pAtlasIdx; + +out VS_OUT { + float opAngle; + float opScale; + vec4 opColor; + int opAtlasIdx; +} vs_out; + +void main() +{ + gl_Position = vec4(pOrg, 1.0); + vs_out.opAngle = pAngle; + vs_out.opScale = pScale; + vs_out.opColor = pColor; + vs_out.opAtlasIdx = pAtlasIdx; +} +)glsl"sv; + + + constexpr auto geometryShader = R"glsl( +#version 430 core + +layout(points) in; +layout(triangle_strip, max_vertices = 4) out; + +in VS_OUT { + float opAngle; + float opScale; + vec4 opColor; + int opAtlasIdx; +} gs_in[]; + +layout(location = 5) uniform vec3 rOrigin; +layout(location = 6) uniform vec3 rUp; +layout(location = 7) uniform vec3 rRight; +layout(location = 8) uniform mat4 mvMatrix; +layout(location = 12) uniform mat4 pjMatrix; + +out vec2 texcoord; +out vec4 outVertexColor; +flat out int outAtlasIdx; + +// From: http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/ +mat4 rotationMatrix(vec3 axis, float angle) +{ + axis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; + + return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + +void main() +{ + vec3 pos = gl_in[0].gl_Position.xyz; + + vec3 fwd = pos - rOrigin; + mat4 rotMat = rotationMatrix(fwd, gs_in[0].opAngle); // This seems wrong + + vec3 up = (vec4(rUp, 1.0) * rotMat).xyz; + vec3 right = (vec4(rRight, 1.0) * rotMat).xyz; + + float halfScale = gs_in[0].opScale / 2.0; + + vec3 left = -right; + vec3 down = -up; + + outVertexColor = gs_in[0].opColor; + outAtlasIdx = gs_in[0].opAtlasIdx; + + gl_Position = pjMatrix * mvMatrix * vec4(pos + halfScale * down + halfScale * left, 1.0); + texcoord = vec2(0, 0); + EmitVertex(); + + gl_Position = pjMatrix * mvMatrix * vec4(pos + halfScale * up + halfScale * left, 1.0); + texcoord = vec2(1, 0); + EmitVertex(); + + gl_Position = pjMatrix * mvMatrix * vec4(pos + halfScale * down + halfScale * right, 1.0); + texcoord = vec2(0, 1); + EmitVertex(); + + gl_Position = pjMatrix * mvMatrix * vec4(pos + halfScale * up + halfScale * right, 1.0); + texcoord = vec2(1, 1); + EmitVertex(); + + EndPrimitive(); +} +)glsl"sv; + + constexpr auto fragmentShader = R"glsl( +#version 430 core + +layout(location = 16) uniform vec4 atlasBuf[11]; // TODO VR: (P1) hardcoded + +in vec2 texcoord; +in vec4 outVertexColor; +flat in int outAtlasIdx; + +uniform sampler2D gColorMap; + +out vec4 FragColor; + +void main (void) +{ + ivec2 textureSize2d = textureSize(gColorMap, 0); + + vec2 imgXY = atlasBuf[outAtlasIdx].xy; + vec2 imgWH = atlasBuf[outAtlasIdx].zw; + + vec2 uv = (imgXY / textureSize2d) + (texcoord.xy * (imgWH / textureSize2d)); + + vec3 t = texture(gColorMap, uv).rgb * outVertexColor.rgb; + FragColor = vec4(t, texture(gColorMap, uv).a * outVertexColor.a); + + if(FragColor.a < 0.01) + discard; +} +)glsl"sv; + + return quake::make_gl_program(vertexShader, geometryShader, fragmentShader); +} + /* =============== R_DrawParticles -- johnfitz -- moved all non-drawing code to @@ -1711,72 +2287,212 @@ void R_DrawParticles() return; } - const auto up = vup * 1.5f; - const auto right = vright * 1.5f; + static bool generated = false; + + static GLint particleProgramId; + + static GLuint vaoId; + + static GLuint pOrgVboId; + static GLuint pAngleVboId; + static GLuint pScaleVboId; + static GLuint pColorVboId; + static GLuint pAtlasIdxVboId; + + static GLint pOrgLocation; + static GLint pAngleLocation; + static GLint pScaleLocation; + static GLint pColorLocation; + static GLint pAtlasIdxLocation; + static GLint rOriginLocation; + static GLint rUpLocation; + static GLint rRightLocation; + static GLint mvMatrixLocation; + static GLint pjMatrixLocation; + static GLint atlasBufLocation; + + if(!generated) + { + particleProgramId = makeParticleShaders(); + + glGenVertexArrays(1, &vaoId); + + glGenBuffers(1, &pOrgVboId); + glGenBuffers(1, &pAngleVboId); + glGenBuffers(1, &pScaleVboId); + glGenBuffers(1, &pColorVboId); + glGenBuffers(1, &pAtlasIdxVboId); + + pOrgLocation = 0; + pAngleLocation = 1; + pScaleLocation = 2; + pColorLocation = 3; + pAtlasIdxLocation = 4; + rOriginLocation = 5; + rUpLocation = 6; + rRightLocation = 7; + mvMatrixLocation = 8; + pjMatrixLocation = 12; + atlasBufLocation = 16; + + generated = true; + } + + const auto up = vup * 1.5_qf; + const auto right = vright * 1.5_qf; + + float mvMatrix[16]; + glGetFloatv(GL_MODELVIEW_MATRIX, mvMatrix); + + float pjMatrix[16]; + glGetFloatv(GL_PROJECTION_MATRIX, pjMatrix); - using namespace quake::util; + // + // + // Configuration + glUseProgram(particleProgramId); + + glBindVertexArray(vaoId); + + glEnableVertexAttribArray(pOrgLocation); + glEnableVertexAttribArray(pAngleLocation); + glEnableVertexAttribArray(pScaleLocation); + glEnableVertexAttribArray(pColorLocation); + glEnableVertexAttribArray(pAtlasIdxLocation); + + glUniform3f( // + rOriginLocation, // + r_origin[0], r_origin[1], r_origin[2]); + + glUniform3f( // + rUpLocation, // + up[0], up[1], up[2]); + + glUniform3f( // + rRightLocation, // + right[0], right[1], right[2]); + + glUniformMatrix4fv( // + mvMatrixLocation, // location + 1, // count + GL_FALSE, // transpose + mvMatrix); + + glUniformMatrix4fv( // + pjMatrixLocation, // location + 1, // count + GL_FALSE, // transpose + pjMatrix); + + glUniform4fv( // + atlasBufLocation, // location + 11, // count TODO VR: (P1) hardcoded + ptxAtlasData._imageInfo.data() // value + ); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glEnable(GL_BLEND); + glDepthMask(GL_FALSE); + + glBindVertexArray(vaoId); - // TODO VR: (P2) this could be optimized a lot - // https://community.khronos.org/t/drawing-my-quads-faster/61312/2 pMgr.forBuffers([&](gltexture_t* texture, const ImageData& imageData, - ParticleBuffer& pBuffer) { + PBuffer& pBuffer) { + (void)texture; (void)imageData; + const auto pCount = pBuffer.aliveCount(); + ParticleSOA& soa = pBuffer.soa(); + GL_Bind(texture); - glEnable(GL_BLEND); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDepthMask(GL_FALSE); // johnfitz -- fix for particle z-buffer bug - - glBegin(GL_QUADS); - pBuffer.forActive([&](particle_t& p) { - // johnfitz -- particle transparency and fade out - GLubyte* c = (GLubyte*)&d_8to24table[(int)p.color]; - - GLubyte color[4]; - color[0] = c[0]; - color[1] = c[1]; - color[2] = c[2]; - color[3] = p.alpha > 0 ? p.alpha : 0; - - glColor4ubv(color); - - const auto xFwd = p.org - r_origin; - - // TODO VR: (P2) `glm::rotate` is the bottleneck in debug mode (!) - const auto xUp = glm::rotate(up, p.angle, xFwd); - const auto xRight = glm::rotate(right, p.angle, xFwd); - - const auto halfScale = p.scale / 2.f; - const auto xLeft = -xRight; - const auto xDown = -xUp; - const auto xUpLeft = p.org + halfScale * xUp + halfScale * xLeft; - const auto xUpRight = p.org + halfScale * xUp + halfScale * xRight; - const auto xDownLeft = - p.org + halfScale * xDown + halfScale * xLeft; - const auto xDownRight = - p.org + halfScale * xDown + halfScale * xRight; - - glTexCoord2f(0, 0); - glVertex3fv(glm::value_ptr(xDownLeft)); - - glTexCoord2f(1, 0); - glVertex3fv(glm::value_ptr(xUpLeft)); - - glTexCoord2f(1, 1); - glVertex3fv(glm::value_ptr(xUpRight)); - - glTexCoord2f(0, 1); - glVertex3fv(glm::value_ptr(xDownRight)); - }); - glEnd(); - glDepthMask(GL_TRUE); // johnfitz -- fix for particle z-buffer bug - glDisable(GL_BLEND); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glColor3f(1, 1, 1); + // + // + // Setup + + glBindBuffer(GL_ARRAY_BUFFER, pOrgVboId); + glBufferData( + GL_ARRAY_BUFFER, sizeof(qvec3) * pCount, soa._orgs, GL_STATIC_DRAW); + glVertexAttribPointer( // + pOrgLocation, // location + 3, // number of components (vec3 = 3) + GL_FLOAT, // type of each component + GL_FALSE, // normalized + 0, // stride + (void*)0 // array buffer offset + ); + + glBindBuffer(GL_ARRAY_BUFFER, pAngleVboId); + glBufferData(GL_ARRAY_BUFFER, sizeof(float) * pCount, soa._angles, + GL_STATIC_DRAW); + glVertexAttribPointer( // + pAngleLocation, // location + 1, // number of components + GL_FLOAT, // type of each component + GL_FALSE, // normalized + 0, // stride + (void*)0 // array buffer offset + ); + + glBindBuffer(GL_ARRAY_BUFFER, pScaleVboId); + glBufferData(GL_ARRAY_BUFFER, sizeof(float) * pCount, soa._scales, + GL_STATIC_DRAW); + glVertexAttribPointer( // + pScaleLocation, // location + 1, // number of components + GL_FLOAT, // type of each component + GL_FALSE, // normalized + 0, // stride + (void*)0 // array buffer offset + ); + + glBindBuffer(GL_ARRAY_BUFFER, pColorVboId); + glBufferData(GL_ARRAY_BUFFER, sizeof(qvec4) * pCount, soa._colors, + GL_STATIC_DRAW); + glVertexAttribPointer( // + pColorLocation, // location + 4, // number of components + GL_FLOAT, // type of each component + GL_FALSE, // normalized + 0, // stride + (void*)0 // array buffer offset + ); + + glBindBuffer(GL_ARRAY_BUFFER, pAtlasIdxVboId); + glBufferData(GL_ARRAY_BUFFER, sizeof(int) * pCount, soa._atlasIdxs, + GL_STATIC_DRAW); + glVertexAttribIPointer( // + pAtlasIdxLocation, // location + 1, // number of components + GL_INT, // type of each component + 0, // stride + (void*)0 // array buffer offset + ); + + // + // + // Draw + glDrawArrays(GL_POINTS, 0, pBuffer.aliveCount()); }); -} + glDepthMask(GL_TRUE); + glDisable(GL_BLEND); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + glColor3f(1, 1, 1); + + // + // + // Cleanup + glDisableVertexAttribArray(pAtlasIdxLocation); + glDisableVertexAttribArray(pColorLocation); + glDisableVertexAttribArray(pScaleLocation); + glDisableVertexAttribArray(pAngleLocation); + glDisableVertexAttribArray(pOrgLocation); + + glBindVertexArray(0); + + glUseProgram(0); +} /* =============== @@ -1794,22 +2510,22 @@ void R_DrawParticles_ShowTris() // const auto right = vright * 1.5f; glBegin(GL_TRIANGLES); - forActiveParticles([&](particle_t& p) { + forActiveParticles([&](PHandle p) { (void)p; // TODO VR: (P2) rewrite /* const float scale = p.scale; - glVertex3fv(glm::value_ptr(p.org)); + glVertex3fv(toGlVec(p.org)); - glm::vec3 p_up; + qvec3 p_up; VectorMA(p.org, scale, up, p_up); - glVertex3fv(glm::value_ptr(p_up)); + glVertex3fv(toGlVec(p_up)); - glm::vec3 p_right; + qvec3 p_right; VectorMA(p.org, scale, right, p_right); - glVertex3fv(glm::value_ptr(p_right)); + glVertex3fv(toGlVec(p_right)); */ }); glEnd(); diff --git a/Quake/r_sprite.cpp b/Quake/r_sprite.cpp index 37813cd7..c8c3505c 100644 --- a/Quake/r_sprite.cpp +++ b/Quake/r_sprite.cpp @@ -23,8 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_sprite.c -- sprite model rendering #include "quakedef.hpp" -#include "quakeglm.hpp" #include "util.hpp" +#include "entity.hpp" +#include "quakeglm_qvec3.hpp" +#include "quakeglm_qvec3_togl.hpp" +#include "glquake.hpp" +#include "client.hpp" +#include "console.hpp" +#include "gl_texmgr.hpp" /* ================ @@ -99,9 +105,9 @@ void R_DrawSpriteModel(entity_t* e) { // TODO: frustum cull it? - glm::vec3 v_forward; - glm::vec3 v_right; - glm::vec3 v_up; + qvec3 v_forward; + qvec3 v_right; + qvec3 v_up; msprite_t* psprite = (msprite_t*)currententity->model->cache.data; @@ -183,24 +189,24 @@ void R_DrawSpriteModel(entity_t* e) glBegin(GL_TRIANGLE_FAN); // was GL_QUADS, but changed to support r_showtris glTexCoord2f(0, frame->tmax); - glm::vec3 point = e->origin + (frame->down * v_up); + qvec3 point = e->origin + (frame->down * v_up); point += (frame->left * v_right); - glVertex3fv(glm::value_ptr(point)); + glVertex3fv(toGlVec(point)); glTexCoord2f(0, 0); point = e->origin + (frame->up * v_up); point += (frame->left * v_right); - glVertex3fv(glm::value_ptr(point)); + glVertex3fv(toGlVec(point)); glTexCoord2f(frame->smax, 0); point = e->origin + (frame->up * v_up); point += (frame->right * v_right); - glVertex3fv(glm::value_ptr(point)); + glVertex3fv(toGlVec(point)); glTexCoord2f(frame->smax, frame->tmax); point = e->origin + (frame->down * v_up); point += (frame->right * v_right); - glVertex3fv(glm::value_ptr(point)); + glVertex3fv(toGlVec(point)); glEnd(); glDisable(GL_ALPHA_TEST); diff --git a/Quake/r_world.cpp b/Quake/r_world.cpp index 13d4d2f7..4347529c 100644 --- a/Quake/r_world.cpp +++ b/Quake/r_world.cpp @@ -24,12 +24,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // r_world.c: world model rendering #include "quakedef.hpp" +#include "glquake.hpp" +#include "mathlib.hpp" +#include "shader.hpp" +#include "client.hpp" +#include "gl_texmgr.hpp" + #include <cassert> extern cvar_t gl_fullbrights, r_drawflat, gl_overbright, r_oldwater, r_oldskyleaf, r_showtris; // johnfitz -byte* SV_FatPVS(const glm::vec3& org, qmodel_t* worldmodel); +byte* SV_FatPVS(const qvec3& org, qmodel_t* worldmodel); int vis_changed; // if true, force pvs to be refreshed @@ -257,10 +263,6 @@ R_CullSurfaces -- johnfitz */ void R_CullSurfaces() { - msurface_t* s; - int i; - texture_t* t; - if(!r_drawworld_cheatsafe) { return; @@ -269,16 +271,17 @@ void R_CullSurfaces() // ericw -- instead of testing (s->visframe == r_visframecount) on all world // surfaces, use the chained surfaces, which is exactly the same set of // sufaces - for(i = 0; i < cl.worldmodel->numtextures; i++) + for(int i = 0; i < cl.worldmodel->numtextures; i++) { - t = cl.worldmodel->textures[i]; + texture_t* const t = cl.worldmodel->textures[i]; if(!t || !t->texturechains[chain_world]) { continue; } - for(s = t->texturechains[chain_world]; s; s = s->texturechain) + for(msurface_t* s = t->texturechains[chain_world]; s; + s = s->texturechain) { if(R_CullBox(s->mins, s->maxs) || R_BackFaceCull(s)) { @@ -307,28 +310,24 @@ mh dynamic lighting speedup */ void R_BuildLightmapChains(qmodel_t* model, texchain_t chain) { - texture_t* t; - msurface_t* s; - int i; - // clear lightmap chains (already done in r_marksurfaces, but clearing them // here to be safe becuase of r_stereo) - for(i = 0; i < lightmap_count; i++) + for(int i = 0; i < lightmap_count; i++) { lightmap[i].polys = nullptr; } // now rebuild them - for(i = 0; i < model->numtextures; i++) + for(int i = 0; i < model->numtextures; i++) { - t = model->textures[i]; + texture_t* t = model->textures[i]; if(!t || !t->texturechains[chain]) { continue; } - for(s = t->texturechains[chain]; s; s = s->texturechain) + for(msurface_t* s = t->texturechains[chain]; s; s = s->texturechain) { if(!s->culled) { @@ -660,8 +659,8 @@ void R_DrawTextureChains_Multitexture( v = s->polys->verts[0]; for(j = 0; j < s->polys->numverts; j++, v += VERTEXSIZE) { - GL_MTexCoord2fFunc(GL_TEXTURE0_ARB, v[3], v[4]); - GL_MTexCoord2fFunc(GL_TEXTURE1_ARB, v[5], v[6]); + glMultiTexCoord2fARB(GL_TEXTURE0_ARB, v[3], v[4]); + glMultiTexCoord2fARB(GL_TEXTURE1_ARB, v[5], v[6]); glVertex3fv(v); } glEnd(); @@ -986,8 +985,6 @@ GLWorld_CreateShaders */ void GLWorld_CreateShaders() { - const glsl_attrib_binding_t bindings[] = {{"Vert", vertAttrIndex}, - {"TexCoords", texCoordsAttrIndex}, {"LMCoords", LMCoordsAttrIndex}}; // Driver bug workarounds: // - "Intel(R) UHD Graphics 600" version "4.6.0 - Build 26.20.100.7263" @@ -995,64 +992,74 @@ void GLWorld_CreateShaders() // `gl_ModelViewProjectionMatrix * vec4(Vert, 1.0);`. Work around // with making Vert a vec4. // (https://sourceforge.net/p/quakespasm/bugs/39/) - const GLchar* vertSource = - "#version 110\n" - "\n" - "attribute vec4 Vert;\n" - "attribute vec2 TexCoords;\n" - "attribute vec2 LMCoords;\n" - "\n" - "varying float FogFragCoord;\n" - "\n" - "void main()\n" - "{\n" - " gl_TexCoord[0] = vec4(TexCoords, 0.0, 0.0);\n" - " gl_TexCoord[1] = vec4(LMCoords, 0.0, 0.0);\n" - " gl_Position = gl_ModelViewProjectionMatrix * Vert;\n" - " FogFragCoord = gl_Position.w;\n" - "}\n"; - - const GLchar* fragSource = - "#version 110\n" - "\n" - "uniform sampler2D Tex;\n" - "uniform sampler2D LMTex;\n" - "uniform sampler2D FullbrightTex;\n" - "uniform bool UseFullbrightTex;\n" - "uniform bool UseOverbright;\n" - "uniform bool UseAlphaTest;\n" - "uniform float Alpha;\n" - "\n" - "varying float FogFragCoord;\n" - "\n" - "void main()\n" - "{\n" - " vec4 result = texture2D(Tex, gl_TexCoord[0].xy);\n" - " if (UseAlphaTest && (result.a < 0.666))\n" - " discard;\n" - " result *= texture2D(LMTex, gl_TexCoord[1].xy);\n" - " if (UseOverbright)\n" - " result.rgb *= 2.0;\n" - " if (UseFullbrightTex)\n" - " result += texture2D(FullbrightTex, gl_TexCoord[0].xy);\n" - " result = clamp(result, 0.0, 1.0);\n" - " float fog = exp(-gl_Fog.density * gl_Fog.density * " - "FogFragCoord * " - "FogFragCoord);\n" - " fog = clamp(fog, 0.0, 1.0);\n" - " result = mix(gl_Fog.color, result, fog);\n" - " result.a = Alpha;\n" // FIXME: This will make almost transparent - // things cut holes though heavy fog - " gl_FragColor = result;\n" - "}\n"; + const GLchar* vertSource = R"glsl( +#version 110 + +attribute vec4 Vert; +attribute vec2 TexCoords; +attribute vec2 LMCoords; + +varying float FogFragCoord; + +void main() +{ + gl_TexCoord[0] = vec4(TexCoords, 0.0, 0.0); + gl_TexCoord[1] = vec4(LMCoords, 0.0, 0.0); + gl_Position = gl_ModelViewProjectionMatrix * Vert; + FogFragCoord = gl_Position.w; +} +)glsl"; + + const GLchar* fragSource = R"glsl( +#version 110 + +uniform sampler2D Tex; +uniform sampler2D LMTex; +uniform sampler2D FullbrightTex; +uniform bool UseFullbrightTex; +uniform bool UseOverbright; +uniform bool UseAlphaTest; +uniform float Alpha; + +varying float FogFragCoord; + +void main() +{ + vec4 result = texture2D(Tex, gl_TexCoord[0].xy); + + if (UseAlphaTest && (result.a < 0.666)) + discard; + + result *= texture2D(LMTex, gl_TexCoord[1].xy); + + if (UseOverbright) + result.rgb *= 2.0; + + if (UseFullbrightTex) + result += texture2D(FullbrightTex, gl_TexCoord[0].xy); + + result = clamp(result, 0.0, 1.0); + float fog = exp(-gl_Fog.density * gl_Fog.density * FogFragCoord * FogFragCoord); + fog = clamp(fog, 0.0, 1.0); + result = mix(gl_Fog.color, result, fog); + result.a = Alpha; // FIXME: This will make almost transparent + // things cut holes though heavy + gl_FragColor = result; +} +)glsl"; if(!gl_glsl_alias_able) { return; } - r_world_program = GL_CreateProgram(vertSource, fragSource, - sizeof(bindings) / sizeof(bindings[0]), bindings); + r_world_program = quake::gl_program_builder{} + .add_shader({GL_VERTEX_SHADER, vertSource}) + .add_shader({GL_FRAGMENT_SHADER, fragSource}) + .add_attr_binding({"Vert", vertAttrIndex}) + .add_attr_binding({"TexCoords", texCoordsAttrIndex}) + .add_attr_binding({"LMCoords", LMCoordsAttrIndex}) + .compile_and_link(); if(r_world_program != 0) { @@ -1100,32 +1107,32 @@ void R_DrawTextureChains_GLSL(qmodel_t* model, entity_t* ent, texchain_t chain) glEnable(GL_BLEND); } - GL_UseProgramFunc(r_world_program); + glUseProgram(r_world_program); // Bind the buffers - GL_BindBuffer(GL_ARRAY_BUFFER, gl_bmodel_vbo); - GL_BindBuffer( + glBindBuffer(GL_ARRAY_BUFFER, gl_bmodel_vbo); + glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0); // indices come from client memory! - GL_EnableVertexAttribArrayFunc(vertAttrIndex); - GL_EnableVertexAttribArrayFunc(texCoordsAttrIndex); - GL_EnableVertexAttribArrayFunc(LMCoordsAttrIndex); + glEnableVertexAttribArray(vertAttrIndex); + glEnableVertexAttribArray(texCoordsAttrIndex); + glEnableVertexAttribArray(LMCoordsAttrIndex); - GL_VertexAttribPointerFunc(vertAttrIndex, 3, GL_FLOAT, GL_FALSE, + glVertexAttribPointer(vertAttrIndex, 3, GL_FLOAT, GL_FALSE, VERTEXSIZE * sizeof(float), ((float*)nullptr)); - GL_VertexAttribPointerFunc(texCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, + glVertexAttribPointer(texCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, VERTEXSIZE * sizeof(float), ((float*)nullptr) + 3); - GL_VertexAttribPointerFunc(LMCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, + glVertexAttribPointer(LMCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, VERTEXSIZE * sizeof(float), ((float*)nullptr) + 5); // set uniforms - GL_Uniform1iFunc(texLoc, 0); - GL_Uniform1iFunc(LMTexLoc, 1); - GL_Uniform1iFunc(fullbrightTexLoc, 2); - GL_Uniform1iFunc(useFullbrightTexLoc, 0); - GL_Uniform1iFunc(useOverbrightLoc, (int)gl_overbright.value); - GL_Uniform1iFunc(useAlphaTestLoc, 0); - GL_Uniform1fFunc(alphaLoc, entalpha); + glUniform1i(texLoc, 0); + glUniform1i(LMTexLoc, 1); + glUniform1i(fullbrightTexLoc, 2); + glUniform1i(useFullbrightTexLoc, 0); + glUniform1i(useOverbrightLoc, (int)gl_overbright.value); + glUniform1i(useAlphaTestLoc, 0); + glUniform1f(alphaLoc, entalpha); for(i = 0; i < model->numtextures; i++) { @@ -1145,11 +1152,11 @@ void R_DrawTextureChains_GLSL(qmodel_t* model, entity_t* ent, texchain_t chain) { GL_SelectTexture(GL_TEXTURE2); GL_Bind(fullbright); - GL_Uniform1iFunc(useFullbrightTexLoc, 1); + glUniform1i(useFullbrightTexLoc, 1); } else { - GL_Uniform1iFunc(useFullbrightTexLoc, 0); + glUniform1i(useFullbrightTexLoc, 0); } R_ClearBatch(); @@ -1170,7 +1177,7 @@ void R_DrawTextureChains_GLSL(qmodel_t* model, entity_t* ent, texchain_t chain) if(t->texturechains[chain]->flags & SURF_DRAWFENCE) { - GL_Uniform1iFunc( + glUniform1i( useAlphaTestLoc, 1); // Flip alpha test back on } @@ -1196,16 +1203,16 @@ void R_DrawTextureChains_GLSL(qmodel_t* model, entity_t* ent, texchain_t chain) if(bound && t->texturechains[chain]->flags & SURF_DRAWFENCE) { - GL_Uniform1iFunc(useAlphaTestLoc, 0); // Flip alpha test back off + glUniform1i(useAlphaTestLoc, 0); // Flip alpha test back off } } // clean up - GL_DisableVertexAttribArrayFunc(vertAttrIndex); - GL_DisableVertexAttribArrayFunc(texCoordsAttrIndex); - GL_DisableVertexAttribArrayFunc(LMCoordsAttrIndex); + glDisableVertexAttribArray(vertAttrIndex); + glDisableVertexAttribArray(texCoordsAttrIndex); + glDisableVertexAttribArray(LMCoordsAttrIndex); - GL_UseProgramFunc(0); + glUseProgram(0); GL_SelectTexture(GL_TEXTURE0); if(entalpha < 1) @@ -1222,16 +1229,7 @@ R_DrawWorld -- johnfitz -- rewritten */ void R_DrawTextureChains(qmodel_t* model, entity_t* ent, texchain_t chain) { - float entalpha; - - if(ent != nullptr) - { - entalpha = ENTALPHA_DECODE(ent->alpha); - } - else - { - entalpha = 1; - } + const float entalpha = ent == nullptr ? 1 : ENTALPHA_DECODE(ent->alpha); // ericw -- the mh dynamic lightmap speedup: make a first pass through // all surfaces we are going to draw, and rebuild any lightmaps that diff --git a/Quake/refdef.hpp b/Quake/refdef.hpp new file mode 100644 index 00000000..899773ae --- /dev/null +++ b/Quake/refdef.hpp @@ -0,0 +1,60 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +#include "vid.hpp" +#include "quakeglm_qvec3.hpp" + +struct refdef_t +{ + vrect_t vrect; // subwindow in video for refresh + // FIXME: not need vrect next field here? + vrect_t aliasvrect; // scaled Alias version + int vrectright, vrectbottom; // right & bottom screen coords + int aliasvrectright, aliasvrectbottom; // scaled Alias versions + float vrectrightedge; // rightmost right edge we care about, + // for use in edge list + float fvrectx, fvrecty; // for floating-point compares + float fvrectx_adj, fvrecty_adj; // left and top edges, for clamping + int vrect_x_adj_shift20; // (vrect.x + 0.5 - epsilon) << 20 + int vrectright_adj_shift20; // (vrectright + 0.5 - epsilon) << 20 + float fvrectright_adj, fvrectbottom_adj; + // right and bottom edges, for clamping + float fvrectright; // rightmost edge, for Alias clamping + float fvrectbottom; // bottommost edge, for Alias clamping + float horizontalFieldOfView; // at Z = 1.0, this many X is visible + // 2.0 = 90 degrees + float xOrigin; // should probably allways be 0.5 + float yOrigin; // between be around 0.3 to 0.5 + + qvec3 vieworg; + qvec3 viewangles; + qvec3 aimangles; + + float fov_x, fov_y; + + int ambientlight; +}; + +extern refdef_t r_refdef; diff --git a/Quake/render.hpp b/Quake/render.hpp index b4f4d97e..5762f775 100644 --- a/Quake/render.hpp +++ b/Quake/render.hpp @@ -21,10 +21,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_RENDER_H -#define _QUAKE_RENDER_H +#pragma once -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" +#include "modelgen.hpp" +#include "gl_model.hpp" +#include "efrag.hpp" +#include "entity.hpp" +#include "refdef.hpp" + +#include <string> // refresh.h -- public interface to refresh functions @@ -35,12 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //============================================================================= -typedef struct efrag_s -{ - struct efrag_s* leafnext; - struct entity_t* entity; -} efrag_t; - // johnfitz -- for lerping #define LERP_MOVESTEP \ (1 << 0) // this is a MOVETYPE_STEP entity, enable movement lerp @@ -55,143 +55,53 @@ typedef struct efrag_s // interval of 0.1 // johnfitz -struct entity_t -{ - bool forcelink; // model changed - - int update_type; - - entity_state_t baseline; // to fill in defaults in updates - - double msgtime; // time of last update - glm::vec3 msg_origins[2]; // last two updates (0 is newest) - glm::vec3 origin; - glm::vec3 msg_angles[2]; // last two updates (0 is newest) - glm::vec3 angles; - qmodel_t* model; // nullptr = no model - struct efrag_s* efrag; // linked list of efrags - int frame; - float syncbase; // for client-side animations - byte* colormap; - int effects; // light, particles, etc - int skinnum; // for Alias models - int visframe; // last frame this entity was - // found in an active leaf - - int dlightframe; // dynamic lighting - int dlightbits; - - // FIXME: could turn these into a union - int trivial_accept; - struct mnode_s* topnode; // for bmodels, first world node - // that splits bmodel, or nullptr if - // not split - - byte alpha; // johnfitz -- alpha - byte lerpflags; // johnfitz -- lerping - float lerpstart; // johnfitz -- animation lerping - float lerptime; // johnfitz -- animation lerping - float lerpfinish; // johnfitz -- lerping -- server sent us a more accurate - // interval, use it instead of 0.1 - short previouspose; // johnfitz -- animation lerping - short currentpose; // johnfitz -- animation lerping - // short futurepose; //johnfitz -- animation lerping - float movelerpstart; // johnfitz -- transform lerping - glm::vec3 previousorigin; // johnfitz -- transform lerping - glm::vec3 currentorigin; // johnfitz -- transform lerping - glm::vec3 previousangles; // johnfitz -- transform lerping - glm::vec3 currentangles; // johnfitz -- transform lerping - - bool horizflip; // VR: horizontal flip - - // VR: per-instance scaling - glm::vec3 msg_scales[2]; // last two updates (0 is newest) - glm::vec3 scale; - glm::vec3 scale_origin; - - bool hidden; // TODO VR: (P1) hack -}; - -// !!! if this is changed, it must be changed in asm_draw.h too !!! -typedef struct -{ - vrect_t vrect; // subwindow in video for refresh - // FIXME: not need vrect next field here? - vrect_t aliasvrect; // scaled Alias version - int vrectright, vrectbottom; // right & bottom screen coords - int aliasvrectright, aliasvrectbottom; // scaled Alias versions - float vrectrightedge; // rightmost right edge we care about, - // for use in edge list - float fvrectx, fvrecty; // for floating-point compares - float fvrectx_adj, fvrecty_adj; // left and top edges, for clamping - int vrect_x_adj_shift20; // (vrect.x + 0.5 - epsilon) << 20 - int vrectright_adj_shift20; // (vrectright + 0.5 - epsilon) << 20 - float fvrectright_adj, fvrectbottom_adj; - // right and bottom edges, for clamping - float fvrectright; // rightmost edge, for Alias clamping - float fvrectbottom; // bottommost edge, for Alias clamping - float horizontalFieldOfView; // at Z = 1.0, this many X is visible - // 2.0 = 90 degrees - float xOrigin; // should probably allways be 0.5 - float yOrigin; // between be around 0.3 to 0.5 - - glm::vec3 vieworg; - glm::vec3 viewangles; - glm::vec3 aimangles; - - float fov_x, fov_y; - - int ambientlight; -} refdef_t; - // // refresh // extern int reinit_surfcache; +extern qvec3 r_origin, vpn, vright, vup; -extern refdef_t r_refdef; -extern glm::vec3 r_origin, vpn, vright, vup; - -void R_Init(void); -void R_InitTextures(void); -void R_InitEfrags(void); -void R_RenderView(void); // must set r_refdef first -void R_RenderScene(void); +void R_Init(); +void R_InitTextures(); +void R_InitEfrags(); +void R_RenderView(); // must set r_refdef first +void R_RenderScene(); void R_DrawViewModel(entity_t* viewent); void R_ViewChanged(vrect_t* pvrect, int lineadj, float aspect); // called whenever r_refdef or vid change // void R_InitSky (struct texture_s *mt); // called at level load -void R_CheckEfrags(void); // johnfitz +void R_CheckEfrags(); // johnfitz void R_AddEfrags(entity_t* ent); -void R_NewMap(void); +void R_NewMap(); -void R_ParseParticleEffect(void); -void R_ParseParticle2Effect(void); +void R_ParseParticleEffect(); +void R_ParseParticle2Effect(); void R_RunParticle2Effect( - const glm::vec3& org, const glm::vec3& dir, int preset, int count); + const qvec3& org, const qvec3& dir, int preset, int count); void R_RunParticleEffect_BulletPuff( - const glm::vec3& org, const glm::vec3& dir, int color, int count); -void R_RocketTrail(glm::vec3 start, const glm::vec3& end, int type); + const qvec3& org, const qvec3& dir, int color, int count); +void R_RunParticleEffect_LavaSpike( + const qvec3& org, const qvec3& dir, int count); +void R_RocketTrail(qvec3 start, const qvec3& end, int type); void R_EntityParticles(entity_t* ent); -void R_ParticleExplosion(const glm::vec3& org); -void R_ParticleExplosion2( - const glm::vec3& org, int colorStart, int colorLength); -void R_LavaSplash(const glm::vec3& org); -void R_TeleportSplash(const glm::vec3& org); +void R_ParticleExplosion(const qvec3& org); +void R_ParticleExplosion2(const qvec3& org, int colorStart, int colorLength); +void R_LavaSplash(const qvec3& org); +void R_TeleportSplash(const qvec3& org); -void R_PushDlights(void); +void R_PushDlights(); struct aliashdr_t; struct lerpdata_t; void R_SetupAliasFrame( - entity_t* e, aliashdr_t* paliashdr, int frame, lerpdata_t* lerpdata); + entity_t* e, const aliashdr_t& paliashdr, int frame, lerpdata_t* lerpdata); void R_SetupEntityTransform(entity_t* e, lerpdata_t* lerpdata); @@ -203,9 +113,30 @@ extern int reinit_surfcache; // if 1, surface cache is currently empty and extern bool r_cache_thrash; // set if thrashing the surface cache int D_SurfaceCacheForRes(int width, int height); -void D_FlushCaches(void); -void D_DeleteSurfaceCache(void); +void D_FlushCaches(); +void D_DeleteSurfaceCache(); void D_InitCaches(void* buffer, int size); void R_SetVrect(vrect_t* pvrect, vrect_t* pvrectin, int lineadj); -#endif /* _QUAKE_RENDER_H */ +struct DrawAliasFrameData +{ + trivertx_t* verts1; + trivertx_t* verts2; + trivertx_t* zeroverts1; + float blend; + float iblend; + bool lerping; +}; + +void R_SetupAliasFrameZero( + const aliashdr_t& paliashdr, int frame, lerpdata_t* lerpdata); + +[[nodiscard]] DrawAliasFrameData getDrawAliasFrameData( + const aliashdr_t& paliashdr, const lerpdata_t& lerpdata, + const lerpdata_t& zeroLerpdata) noexcept; + +[[nodiscard]] qvec3 getFinalVertexPosLerped( + const DrawAliasFrameData& fd, const qfloat zeroBlend) noexcept; + +[[nodiscard]] qvec3 getFinalVertexPosNonLerped( + const DrawAliasFrameData& fd, const qfloat zeroBlend) noexcept; diff --git a/Quake/resource.hpp b/Quake/resource.hpp deleted file mode 100644 index 7c2f2204..00000000 --- a/Quake/resource.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _QUAKE_RESOURCE_H -#define _QUAKE_RESOURCE_H - -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by winquake.rc -// -#define IDS_STRING1 1 -#define IDI_ICON2 1 -#define IDD_DIALOG1 108 -#define IDD_PROGRESS 109 -#define IDC_PROGRESS 1000 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 113 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1004 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - -#endif /* _QUAKE_RESOURCE_H */ diff --git a/Quake/saveutil.cpp b/Quake/saveutil.cpp new file mode 100644 index 00000000..e0d0d9ff --- /dev/null +++ b/Quake/saveutil.cpp @@ -0,0 +1,239 @@ +#include "saveutil.hpp" + +#include "quakedef_macros.hpp" +#include "q_stdinc.hpp" +#include "common.hpp" +#include "console.hpp" +#include "vr_cvars.hpp" +#include "host.hpp" + +#include <algorithm> +#include <cassert> + +namespace quake::saveutil +{ +[[nodiscard]] auto& saveFilenames() noexcept +{ + static char data[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH + 1]{}; + return data; +} +// namespace quake::saveutil +[[nodiscard]] auto& autosaveFilenames() noexcept +{ + static char data[MAX_AUTOSAVES][SAVEGAME_COMMENT_LENGTH + 1]{}; + return data; +} + +[[nodiscard]] auto& saveLoadables() noexcept +{ + static int data[MAX_SAVEGAMES]{}; + return data; +} + +[[nodiscard]] auto& autosaveLoadables() noexcept +{ + static int data[MAX_AUTOSAVES]{}; + return data; +} + +[[nodiscard]] auto& autosaveTimestamps() noexcept +{ + static std::time_t data[MAX_AUTOSAVES]{}; + return data; +} + +[[nodiscard]] const char* nthSaveFilename(const std::size_t i) noexcept +{ + assert(i < MAX_SAVEGAMES); + return saveFilenames()[i]; +} +// namespace quake::saveutil +[[nodiscard]] const char* nthAutosaveFilename(const std::size_t i) noexcept +{ + assert(i < MAX_AUTOSAVES); + return autosaveFilenames()[i]; +} + +[[nodiscard]] bool isNthSaveLoadable(const std::size_t i) noexcept +{ + assert(i < MAX_SAVEGAMES); + return saveLoadables()[i]; +} + +[[nodiscard]] bool isNthAutosaveLoadable(const std::size_t i) noexcept +{ + assert(i < MAX_AUTOSAVES); + return autosaveLoadables()[i]; +} + +[[nodiscard]] const std::time_t& nthAutosaveTimestamp( + const std::size_t i) noexcept +{ + assert(i < MAX_AUTOSAVES); + return autosaveTimestamps()[i]; +} + +[[nodiscard]] int timeDiffInSeconds( + const std::time_t& begin, const std::time_t& end) noexcept +{ + return std::difftime(end, begin); +} + +[[nodiscard]] std::time_t& lastAutosaveTime() noexcept +{ + static std::time_t res{std::time(0)}; + return res; +} + +void scanSaves() +{ + const auto doScan = [&](auto& filenamesArray, auto& loadableArray, + const int max, const char* naming, + const char* unusedSlot, + std::time_t* timestampArray) { + for(int i = 0; i < max; i++) + { + strcpy(filenamesArray[i], unusedSlot); + loadableArray[i] = false; + + char name[MAX_OSPATH]; + q_snprintf(name, sizeof(name), naming, com_gamedir, i); + + FILE* f = fopen(name, "r"); + if(!f) + { + continue; + } + + if(timestampArray != nullptr) + { + std::tm tm{}; + tm.tm_isdst = 0; + + std::fscanf(f, "%d-%d-%d %d:%d:%d\n", &tm.tm_year, &tm.tm_mon, + &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); + tm.tm_year -= 1900; + + timestampArray[i] = std::mktime(&tm); + assert(timestampArray[i] != -1); + } + + int version; + fscanf(f, "%i\n", &version); + fscanf(f, "%79s\n", name); + q_strlcpy(filenamesArray[i], name, SAVEGAME_COMMENT_LENGTH + 1); + + // change _ back to space + for(int j = 0; j < SAVEGAME_COMMENT_LENGTH; j++) + { + if(filenamesArray[i][j] == '_') + { + filenamesArray[i][j] = ' '; + } + } + + loadableArray[i] = true; + + fclose(f); + } + }; + + doScan( // + saveFilenames(), // + saveLoadables(), // + MAX_SAVEGAMES, // + "%s/s%i.sav", // + "--- UNUSED SLOT ---", // + nullptr // + ); + + doScan( // + autosaveFilenames(), // + autosaveLoadables(), // + MAX_AUTOSAVES, // + "%s/auto%i.sav", // + "--- UNUSED AUTOSAVE SLOT ---", // + autosaveTimestamps() // + ); +} + +[[nodiscard]] static int getNextAutosaveSlot() noexcept +{ + scanSaves(); + + for(std::size_t i = 0; i < MAX_AUTOSAVES; ++i) + { + if(!isNthAutosaveLoadable(i)) + { + return i; + } + } + + const auto it = std::min_element(std::begin(autosaveTimestamps()), + std::end(autosaveTimestamps()), + [](const std::time_t& a, const std::time_t& b) { + return std::difftime(a, std::time_t(nullptr)) < + std::difftime(b, std::time_t(nullptr)); + }); + + return it - std::begin(autosaveTimestamps()); +} + +void doAutosave() noexcept +{ + if(vr_autosave_show_message.value) + { + Con_Printf("Creating autosave...\n"); + } + + const int idx = getNextAutosaveSlot(); + const std::time_t now = std::time(0); + + char name[64]; + q_snprintf(name, sizeof(name), "auto%d", idx); + + if(Host_MakeSavegame(name, &now, vr_autosave_show_message.value)) + { + if(vr_autosave_show_message.value) + { + Con_Printf("Successfully created autosave.\n"); + } + } + else + { + if(vr_autosave_show_message.value) + { + Con_Printf("Failed to created autosave.\n"); + } + } +} + +void doAutomaticAutosave() noexcept +{ + const std::time_t now = std::time(0); + + const int secondDiff = quake::saveutil::timeDiffInSeconds( + quake::saveutil::lastAutosaveTime(), now); + + if(secondDiff > vr_autosave_seconds.value) + { + quake::saveutil::doAutosave(); + quake::saveutil::lastAutosaveTime() = now; + } +} + +void doChangelevelAutosave() noexcept +{ + if(!vr_autosave_on_changelevel.value) + { + return; + } + + const std::time_t now = std::time(0); + + quake::saveutil::doAutosave(); + quake::saveutil::lastAutosaveTime() = now; +} + + +} // namespace quake::saveutil diff --git a/Quake/saveutil.hpp b/Quake/saveutil.hpp new file mode 100644 index 00000000..437fd942 --- /dev/null +++ b/Quake/saveutil.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include <ctime> + +inline constexpr std::size_t MAX_SAVEGAMES = 20; +inline constexpr std::size_t MAX_AUTOSAVES = 12; + +namespace quake::saveutil +{ + +void doAutosave() noexcept; +void doAutomaticAutosave() noexcept; +void doChangelevelAutosave() noexcept; + +[[nodiscard]] std::time_t& lastAutosaveTime() noexcept; + +[[nodiscard]] int timeDiffInSeconds( + const std::time_t& begin, const std::time_t& end) noexcept; + +void scanSaves(); + +[[nodiscard]] const char* nthSaveFilename(const std::size_t i) noexcept; +[[nodiscard]] const char* nthAutosaveFilename(const std::size_t i) noexcept; + +[[nodiscard]] bool isNthSaveLoadable(const std::size_t i) noexcept; +[[nodiscard]] bool isNthAutosaveLoadable(const std::size_t i) noexcept; + +[[nodiscard]] const std::time_t& nthAutosaveTimestamp( + const std::size_t i) noexcept; + +} // namespace quake::saveutil diff --git a/Quake/sbar.cpp b/Quake/sbar.cpp index d9a6d891..776590ad 100644 --- a/Quake/sbar.cpp +++ b/Quake/sbar.cpp @@ -23,6 +23,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // sbar.c -- status bar code #include "quakedef.hpp" +#include "cmd.hpp" +#include "sbar.hpp" +#include "qpic.hpp" +#include "glquake.hpp" +#include "menu.hpp" +#include "draw.hpp" +#include "common.hpp" +#include "server.hpp" +#include "client.hpp" +#include "view.hpp" int sb_updates; // if >= vid.numpages, no update needed @@ -552,23 +562,21 @@ void Sbar_SoloScoreboard() cl.stats[STAT_TOTALSECRETS]); Sbar_DrawString(312 - strlen(str) * 8, 12, str); - if(!fitzmode) - { /* QuakeSpasm customization: */ - q_snprintf(str, sizeof(str), "skill %i", (int)(skill.value + 0.5)); - Sbar_DrawString(160 - strlen(str) * 4, 12, str); + q_snprintf(str, sizeof(str), "skill %i", (int)(skill.value + 0.5)); + Sbar_DrawString(160 - strlen(str) * 4, 12, str); - q_snprintf(str, sizeof(str), "%s (%s)", cl.levelname, cl.mapname); - len = strlen(str); - if(len > 40) - { - Sbar_DrawScrollString(0, 4, 320, str); - } - else - { - Sbar_DrawString(160 - len * 4, 4, str); - } - return; + q_snprintf(str, sizeof(str), "%s (%s)", cl.levelname, cl.mapname); + len = strlen(str); + if(len > 40) + { + Sbar_DrawScrollString(0, 4, 320, str); + } + else + { + Sbar_DrawString(160 - len * 4, 4, str); } + return; + minutes = cl.time / 60; seconds = cl.time - 60 * minutes; tens = seconds / 10; @@ -1247,10 +1255,10 @@ void Sbar_Draw() const auto drawAmmoIcon = [&](const int x, const int stat) { const int aid = static_cast<int>(cl.stats[stat]); - if(aid >= AID_SHELLS && aid <= AID_NAILS) + if(aid >= AID_SHELLS && aid <= AID_CELLS) { // Shells, nails, rockets, cells - Sbar_DrawPic(x, 0, sb_ammo[aid]); + Sbar_DrawPic(x, 0, sb_ammo[aid - 1]); } else if(aid == AID_NONE) { diff --git a/Quake/sbar.hpp b/Quake/sbar.hpp index 95ff9dbf..b10397ad 100644 --- a/Quake/sbar.hpp +++ b/Quake/sbar.hpp @@ -21,26 +21,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_SBAR_H -#define _QUAKE_SBAR_H +#pragma once // the status bar is only redrawn if something has changed, but if anything // does, the entire thing will be redrawn for the next vid.numpages frames. extern int sb_lines; // scan lines to draw -void Sbar_Init(void); -void Sbar_LoadPics(void); +void Sbar_Init(); +void Sbar_LoadPics(); -void Sbar_Changed(void); +void Sbar_Changed(); // call whenever any of the client stats represented on the sbar changes -void Sbar_Draw(void); +void Sbar_Draw(); // called every frame by screen -void Sbar_IntermissionOverlay(void); +void Sbar_IntermissionOverlay(); // called each frame after the level has been completed -void Sbar_FinaleOverlay(void); - -#endif /* _QUAKE_SBAR_H */ +void Sbar_FinaleOverlay(); diff --git a/Quake/screen.hpp b/Quake/screen.hpp index d01f2d9c..803da22f 100644 --- a/Quake/screen.hpp +++ b/Quake/screen.hpp @@ -21,24 +21,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_SCREEN_H -#define _QUAKE_SCREEN_H +#pragma once + +#include "cvar.hpp" // screen.h -void SCR_Init(void); -void SCR_LoadPics(void); +void SCR_Init(); +void SCR_LoadPics(); -void SCR_UpdateScreen(void); +void SCR_UpdateScreen(); -void SCR_SizeUp(void); -void SCR_SizeDown(void); -void SCR_BringDownConsole(void); +void SCR_SizeUp(); +void SCR_SizeDown(); +void SCR_BringDownConsole(); void SCR_CenterPrint(const char* str); -void SCR_BeginLoadingPlaque(void); -void SCR_EndLoadingPlaque(void); +void SCR_BeginLoadingPlaque(); +void SCR_EndLoadingPlaque(); int SCR_ModalMessage( const char* text, float timeout); // johnfitz -- added timeout @@ -56,7 +57,7 @@ extern cvar_t scr_viewsize; extern cvar_t scr_sbaralpha; // johnfitz -void SCR_UpdateWholeScreen(void); +void SCR_UpdateWholeScreen(); // johnfitz -- stuff for 2d drawing control typedef enum @@ -64,6 +65,7 @@ typedef enum CANVAS_NONE, CANVAS_DEFAULT, CANVAS_CONSOLE, + CANVAS_NOTIFY, CANVAS_MENU, CANVAS_SBAR, CANVAS_WARPIMAGE, @@ -83,4 +85,3 @@ extern cvar_t scr_crosshairscale; extern int scr_tileclear_updates; // johnfitz -#endif /* _QUAKE_SCREEN_H */ diff --git a/Quake/server.cpp b/Quake/server.cpp new file mode 100644 index 00000000..dfc910b6 --- /dev/null +++ b/Quake/server.cpp @@ -0,0 +1,82 @@ +#include "server.hpp" +#include "msg.hpp" + +#include <cassert> + +[[nodiscard]] bool server_t::isValidWorldTextHandle( + const WorldTextHandle wth) const noexcept +{ + return static_cast<int>(wth) < static_cast<int>(worldTexts.size()); +} + +[[nodiscard]] bool server_t::hasAnyFreeWorldTextHandle() const noexcept +{ + return !freeWorldTextHandles.empty(); +} + +[[nodiscard]] WorldTextHandle server_t::makeWorldTextHandle() noexcept +{ + assert(hasAnyFreeWorldTextHandle()); + + const WorldTextHandle wth = freeWorldTextHandles.back(); + freeWorldTextHandles.pop_back(); + worldTexts.resize(wth + 1); + + assert(isValidWorldTextHandle(wth)); + return wth; +} + +[[nodiscard]] WorldText& server_t::getWorldText( + const WorldTextHandle wth) noexcept +{ + assert(isValidWorldTextHandle(wth)); + return worldTexts[wth]; +} + +void server_t::initializeWorldTexts() +{ + worldTexts.clear(); + for(std::size_t i = 0; i < maxWorldTextInstances; ++i) + { + freeWorldTextHandles.emplace_back(maxWorldTextInstances - 1 - i); + } +} + +void server_t::SendMsg_WorldTextHMake( + client_t& client, const WorldTextHandle wth) noexcept +{ + MSG_WriteByte(&client.message, svc_worldtext_hmake); + MSG_WriteShort(&client.message, wth); +} + +void server_t::SendMsg_WorldTextHSetText(client_t& client, + const WorldTextHandle wth, const char* const text) noexcept +{ + MSG_WriteByte(&client.message, svc_worldtext_hsettext); + MSG_WriteShort(&client.message, wth); + MSG_WriteString(&client.message, text); +} + +void server_t::SendMsg_WorldTextHSetPos( + client_t& client, const WorldTextHandle wth, const qvec3& pos) noexcept +{ + MSG_WriteByte(&client.message, svc_worldtext_hsetpos); + MSG_WriteShort(&client.message, wth); + MSG_WriteVec3(&client.message, pos, sv.protocolflags); +} + +void server_t::SendMsg_WorldTextHSetAngles( + client_t& client, const WorldTextHandle wth, const qvec3& angles) noexcept +{ + MSG_WriteByte(&client.message, svc_worldtext_hsetangles); + MSG_WriteShort(&client.message, wth); + MSG_WriteVec3(&client.message, angles, sv.protocolflags); +} + +void server_t::SendMsg_WorldTextHSetHAlign(client_t& client, + const WorldTextHandle wth, const WorldText::HAlign hAlign) noexcept +{ + MSG_WriteByte(&client.message, svc_worldtext_hsethalign); + MSG_WriteShort(&client.message, wth); + MSG_WriteByte(&client.message, static_cast<int>(hAlign)); +} diff --git a/Quake/server.hpp b/Quake/server.hpp index 9dbc7503..62d9c060 100644 --- a/Quake/server.hpp +++ b/Quake/server.hpp @@ -21,8 +21,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_SERVER_H -#define _QUAKE_SERVER_H +#pragma once + +#include "vr_macros.hpp" +#include "worldtext.hpp" +#include "cvar.hpp" +#include "common.hpp" +#include "quakedef_macros.hpp" +#include "progs.hpp" +#include "sizebuf.hpp" + +#include <vector> struct qmodel_t; @@ -32,7 +41,7 @@ typedef struct { int maxclients; int maxclientslimit; - struct client_s* clients; // [maxclients] + struct client_t* clients; // [maxclients] int serverflags; // episode completion information bool changelevel_issued; // cleared when at SV_SpawnServer } server_static_t; @@ -45,7 +54,7 @@ typedef enum ss_active } server_state_t; -typedef struct +struct server_t { bool active; // false if only a net client @@ -83,13 +92,42 @@ typedef struct unsigned protocol; // johnfitz unsigned protocolflags; -} server_t; + std::vector<WorldText> worldTexts; + std::vector<WorldTextHandle> freeWorldTextHandles; + + [[nodiscard]] bool isValidWorldTextHandle( + const WorldTextHandle wth) const noexcept; + + [[nodiscard]] bool hasAnyFreeWorldTextHandle() const noexcept; + + [[nodiscard]] WorldTextHandle makeWorldTextHandle() noexcept; + + [[nodiscard]] WorldText& getWorldText(const WorldTextHandle wth) noexcept; + + void initializeWorldTexts(); + + // World text "server -> client" messages + void SendMsg_WorldTextHMake( + client_t& client, const WorldTextHandle wth) noexcept; + + void SendMsg_WorldTextHSetText(client_t& client, const WorldTextHandle wth, + const char* const text) noexcept; + + void SendMsg_WorldTextHSetPos( + client_t& client, const WorldTextHandle wth, const qvec3& pos) noexcept; + + void SendMsg_WorldTextHSetAngles(client_t& client, + const WorldTextHandle wth, const qvec3& angles) noexcept; + + void SendMsg_WorldTextHSetHAlign(client_t& client, + const WorldTextHandle wth, const WorldText::HAlign hAlign) noexcept; +}; #define NUM_PING_TIMES 16 -#define NUM_SPAWN_PARMS 16 +#define NUM_SPAWN_PARMS 32 -typedef struct client_s +struct client_t { bool active; // false = client is free bool spawned; // false = don't send datagrams @@ -101,8 +139,8 @@ typedef struct client_s struct qsocket_s* netconnection; // communications handle - usercmd_t cmd; // movement - glm::vec3 wishdir; // intended motion calced from cmd + usercmd_t cmd; // movement + qvec3 wishdir; // intended motion calced from cmd sizebuf_t message; // can be added to at any time, // copied and clear once per frame @@ -119,7 +157,7 @@ typedef struct client_s // client known data for deltas int old_frags; -} client_t; +}; //============================================================================= @@ -155,28 +193,35 @@ typedef struct client_s #define DAMAGE_AIM 2 // edict->flags -#define FL_FLY 1 -#define FL_SWIM 2 -//#define FL_GLIMPSE 4 -#define FL_CONVEYOR 4 -#define FL_CLIENT 8 -#define FL_INWATER 16 -#define FL_MONSTER 32 -#define FL_GODMODE 64 -#define FL_NOTARGET 128 -#define FL_ITEM 256 -#define FL_ONGROUND 512 -#define FL_PARTIALGROUND 1024 // not all corners are valid -#define FL_WATERJUMP 2048 // player jumping out of water -#define FL_JUMPRELEASED 4096 // for jump debouncing -#define FL_EASYHANDTOUCH 8192 // adds bonus to boundaries for handtouch +// clang-format off +#define FL_FLY VRUTIL_POWER_OF_TWO(0) +#define FL_SWIM VRUTIL_POWER_OF_TWO(1) +#define FL_CONVEYOR VRUTIL_POWER_OF_TWO(2) +#define FL_CLIENT VRUTIL_POWER_OF_TWO(3) +#define FL_INWATER VRUTIL_POWER_OF_TWO(4) +#define FL_MONSTER VRUTIL_POWER_OF_TWO(5) +#define FL_GODMODE VRUTIL_POWER_OF_TWO(6) +#define FL_NOTARGET VRUTIL_POWER_OF_TWO(7) +#define FL_ITEM VRUTIL_POWER_OF_TWO(8) +#define FL_ONGROUND VRUTIL_POWER_OF_TWO(9) +#define FL_PARTIALGROUND VRUTIL_POWER_OF_TWO(10) // not all corners are valid +#define FL_WATERJUMP VRUTIL_POWER_OF_TWO(11) // player jumping out of water +#define FL_JUMPRELEASED VRUTIL_POWER_OF_TWO(12) // for jump debouncing +#define FL_EASYHANDTOUCH VRUTIL_POWER_OF_TWO(13) // adds bonus to boundaries for handtouch +#define FL_SPECIFICDAMAGE VRUTIL_POWER_OF_TWO(14) // HONEY. +#define FL_FORCEGRABBABLE VRUTIL_POWER_OF_TWO(15) // VR. +// clang-format on // entity effects - -#define EF_BRIGHTFIELD 1 -#define EF_MUZZLEFLASH 2 -#define EF_BRIGHTLIGHT 4 -#define EF_DIMLIGHT 8 +// clang-format off +#define EF_BRIGHTFIELD VRUTIL_POWER_OF_TWO(0) +#define EF_MUZZLEFLASH VRUTIL_POWER_OF_TWO(1) +#define EF_BRIGHTLIGHT VRUTIL_POWER_OF_TWO(2) +#define EF_DIMLIGHT VRUTIL_POWER_OF_TWO(3) +#define EF_VERYDIMLIGHT VRUTIL_POWER_OF_TWO(4) +#define EF_MINIROCKET VRUTIL_POWER_OF_TWO(5) +#define EF_LAVATRAIL VRUTIL_POWER_OF_TWO(6) +// clang-format on #define SPAWNFLAG_NOT_EASY 256 #define SPAWNFLAG_NOT_MEDIUM 512 @@ -201,44 +246,51 @@ extern edict_t* sv_player; //=========================================================== -void SV_Init(void); +void SV_Init(); -void SV_StartParticle(const glm::vec3& org, const glm::vec3& dir, - const int color, const int count); -void SV_StartParticle2(const glm::vec3& org, const glm::vec3& dir, - const int preset, const int count); +void SV_StartParticle( + const qvec3& org, const qvec3& dir, const int color, const int count); +void SV_StartParticle2( + const qvec3& org, const qvec3& dir, const int preset, const int count); void SV_StartSound(edict_t* entity, int channel, const char* sample, int volume, float attenuation); void SV_DropClient(bool crash); -void SV_SendClientMessages(void); -void SV_ClearDatagram(void); +void SV_SendClientMessages(); +void SV_ClearDatagram(); int SV_ModelIndex(const char* name); -void SV_SetIdealPitch(void); +void SV_SetIdealPitch(); -void SV_AddUpdates(void); +void SV_AddUpdates(); -void SV_ClientThink(void); +void SV_ClientThink(); void SV_AddClientToServer(struct qsocket_s* ret); void SV_ClientPrintf(const char* fmt, ...) FUNC_PRINTF(1, 2); void SV_BroadcastPrintf(const char* fmt, ...) FUNC_PRINTF(1, 2); -void SV_Physics(void); +void SV_Physics(); bool SV_CheckBottom(edict_t* ent); -bool SV_movestep(edict_t* ent, glm::vec3 move, bool relink); +bool SV_movestep(edict_t* ent, qvec3 move, bool relink); void SV_WriteClientdataToMessage(edict_t* ent, sizebuf_t* msg); -void SV_MoveToGoal(void); +void SV_MoveToGoal(); -void SV_CheckForNewClients(void); -void SV_RunClients(void); +void SV_CheckForNewClients(); +void SV_RunClients(); void SV_SaveSpawnparms(); -void SV_SpawnServer(const char* server); -#endif /* _QUAKE_SERVER_H */ +enum class SpawnServerSrc +{ + FromSaveFile, + FromMapCmd, + FromChangelevelCmd, + FromRestart +}; + +void SV_SpawnServer(const char* server, const SpawnServerSrc src); diff --git a/Quake/shader.cpp b/Quake/shader.cpp new file mode 100644 index 00000000..221dab75 --- /dev/null +++ b/Quake/shader.cpp @@ -0,0 +1,197 @@ +#include "shader.hpp" + +#include <GL/glew.h> + +#include <string_view> +#include <filesystem> +#include <cassert> +#include <vector> +#include <cstdio> + +namespace quake +{ + +namespace +{ + +[[nodiscard]] constexpr bool is_valid_shader_type( + const GLenum shader_type) noexcept +{ + return shader_type == GL_COMPUTE_SHADER || + shader_type == GL_VERTEX_SHADER || + shader_type == GL_TESS_CONTROL_SHADER || + shader_type == GL_TESS_EVALUATION_SHADER || + shader_type == GL_GEOMETRY_SHADER || + shader_type == GL_FRAGMENT_SHADER; +} + +[[nodiscard]] constexpr const char* shader_type_to_str( + const GLenum shader_type) noexcept +{ + if(shader_type == GL_COMPUTE_SHADER) + { + return "GL_COMPUTE_SHADER"; + } + + if(shader_type == GL_VERTEX_SHADER) + { + return "GL_VERTEX_SHADER"; + } + + if(shader_type == GL_TESS_CONTROL_SHADER) + { + return "GL_TESS_CONTROL_SHADER"; + } + + if(shader_type == GL_TESS_EVALUATION_SHADER) + { + return "GL_TESS_EVALUATION_SHADER"; + } + + if(shader_type == GL_GEOMETRY_SHADER) + { + return "GL_GEOMETRY_SHADER"; + } + + assert(shader_type == GL_FRAGMENT_SHADER); + return "GL_FRAGMENT_SHADER"; +} + +void impl_gl_shader_source( + const GLuint shader_id, const std::string_view src) noexcept +{ + const char* data{src.data()}; + const GLint length{static_cast<GLint>(src.size())}; + + glShaderSource(shader_id, 1, &data, &length); +} + +[[nodiscard]] GLuint impl_make_gl_shader( + const GLenum shader_type, const std::string_view src) noexcept +{ + assert(is_valid_shader_type(shader_type)); + + const GLuint shader_id{glCreateShader(shader_type)}; + assert(shader_id != 0); + + impl_gl_shader_source(shader_id, src); + glCompileShader(shader_id); + + GLint result_code{GL_FALSE}; + glGetShaderiv(shader_id, GL_COMPILE_STATUS, &result_code); + + GLint info_log_length; + glGetShaderiv(shader_id, GL_INFO_LOG_LENGTH, &info_log_length); + + if(info_log_length > 0) + { + std::vector<GLchar> buffer(info_log_length + 1); + + glGetShaderInfoLog(shader_id, info_log_length, nullptr, buffer.data()); + + std::printf("Failure compiling '%s' with id '%d':\n%s\n", + shader_type_to_str(shader_type), shader_id, buffer.data()); + } + + assert(result_code == GL_TRUE); + return shader_id; +} + +} // namespace + +[[nodiscard]] GLuint make_gl_program(const std::string_view src_vertex, + const std::string_view src_geometry, + const std::string_view src_fragment) noexcept +{ + return gl_program_builder{} + .add_shader(gl_shader_src{GL_VERTEX_SHADER, src_vertex}) + .add_shader(gl_shader_src{GL_GEOMETRY_SHADER, src_geometry}) + .add_shader(gl_shader_src{GL_FRAGMENT_SHADER, src_fragment}) + .compile_and_link(); +} + +[[nodiscard]] GLuint make_gl_program(const std::string_view src_vertex, + const std::string_view src_fragment) noexcept +{ + return gl_program_builder{} + .add_shader(gl_shader_src{GL_VERTEX_SHADER, src_vertex}) + .add_shader(gl_shader_src{GL_FRAGMENT_SHADER, src_fragment}) + .compile_and_link(); +} + +[[nodiscard]] gl_program_builder&& gl_program_builder::add_shader( + const gl_shader_src& shader_src) && +{ + _shader_srcs.emplace_back(shader_src); + return std::move(*this); +} + +[[nodiscard]] gl_program_builder&& gl_program_builder::add_attr_binding( + const gl_attr_binding& attr_binding) && +{ + _attr_bindings.emplace_back(attr_binding); + return std::move(*this); +} + +[[nodiscard]] GLuint gl_program_builder::compile_and_link() && +{ + // Compile shaders + std::vector<GLuint> shader_ids; + for(const auto& [shader_type, shader_src] : _shader_srcs) + { + shader_ids.emplace_back(impl_make_gl_shader(shader_type, shader_src)); + } + + // Create program + const GLuint program_id{glCreateProgram()}; + assert(program_id != 0); + + // Attach shaders + for(const GLuint sid : shader_ids) + { + glAttachShader(program_id, sid); + } + + // Bind attribute locations + for(const auto& [name, attr_index] : _attr_bindings) + { + glBindAttribLocation(program_id, attr_index, name.data()); + } + + // Link program + glLinkProgram(program_id); + + // Check program + GLint result_code{GL_FALSE}; + glGetProgramiv(program_id, GL_LINK_STATUS, &result_code); + + GLint info_log_length; + glGetProgramiv(program_id, GL_INFO_LOG_LENGTH, &info_log_length); + + if(info_log_length > 0) + { + std::vector<GLchar> buffer(info_log_length + 1); + + glGetProgramInfoLog( + program_id, info_log_length, nullptr, buffer.data()); + + std::printf("Failure compiling program with id '%d':\n%s\n", program_id, + buffer.data()); + } + + assert(result_code == GL_TRUE); + + for(const GLuint sid : shader_ids) + { + glDetachShader(program_id, sid); + } + + for(const GLuint sid : shader_ids) + { + glDeleteShader(sid); + } + + return program_id; +} + +} // namespace quake diff --git a/Quake/shader.hpp b/Quake/shader.hpp new file mode 100644 index 00000000..15c7cc4d --- /dev/null +++ b/Quake/shader.hpp @@ -0,0 +1,55 @@ +#pragma once + +#include <GL/glew.h> + +#include <string_view> +#include <filesystem> + +// TODO VR: (P2) pimpl +#include <GL/glew.h> + +#include <string_view> +#include <filesystem> +#include <cassert> +#include <vector> +#include <cstdio> + +namespace quake +{ + +[[nodiscard]] GLuint make_gl_program(const std::string_view src_vertex, + const std::string_view src_geometry, + const std::string_view src_frag) noexcept; + +[[nodiscard]] GLuint make_gl_program(const std::string_view src_vertex, + const std::string_view src_frag) noexcept; + +struct gl_shader_src +{ + GLenum _shader_type; + std::string_view _src; +}; + +struct gl_attr_binding +{ + std::string_view _name; + GLuint _attr_index; +}; + +class gl_program_builder +{ +private: + std::vector<gl_shader_src> _shader_srcs; + std::vector<gl_attr_binding> _attr_bindings; + +public: + [[nodiscard]] gl_program_builder&& add_shader( + const gl_shader_src& shader_src) &&; + + [[nodiscard]] gl_program_builder&& add_attr_binding( + const gl_attr_binding& attr_binding) &&; + + [[nodiscard]] GLuint compile_and_link() &&; +}; + +} // namespace quake diff --git a/Quake/sizebuf.cpp b/Quake/sizebuf.cpp new file mode 100644 index 00000000..ad638073 --- /dev/null +++ b/Quake/sizebuf.cpp @@ -0,0 +1,80 @@ +#include "sizebuf.hpp" +#include "zone.hpp" +#include "common.hpp" +#include "console.hpp" +#include "quakedef.hpp" +#include "host.hpp" +#include "sys.hpp" + +void SZ_Alloc(sizebuf_t* buf, int startsize) +{ + if(startsize < 256) + { + startsize = 256; + } + + buf->data = (byte*)Hunk_AllocName(startsize, "sizebuf"); + buf->maxsize = startsize; + buf->cursize = 0; +} + + +void SZ_Free(sizebuf_t* buf) +{ + // Z_Free (buf->data); + // buf->data = nullptr; + // buf->maxsize = 0; + buf->cursize = 0; +} + +void SZ_Clear(sizebuf_t* buf) +{ + buf->cursize = 0; +} + +void* SZ_GetSpace(sizebuf_t* buf, int length) +{ + void* data; + + if(buf->cursize + length > buf->maxsize) + { + if(!buf->allowoverflow) + { + Host_Error( + "SZ_GetSpace: overflow without allowoverflow set"); // ericw -- + } + + if(length > buf->maxsize) + { + Sys_Error("SZ_GetSpace: %i is > full buffer size", length); + } + + buf->overflowed = true; + Con_Printf("SZ_GetSpace: overflow"); + SZ_Clear(buf); + } + + data = buf->data + buf->cursize; + buf->cursize += length; + + return data; +} + +void SZ_Write(sizebuf_t* buf, const void* data, int length) +{ + Q_memcpy(SZ_GetSpace(buf, length), data, length); +} + +void SZ_Print(sizebuf_t* buf, const char* data) +{ + int len = Q_strlen(data) + 1; + + if(buf->data[buf->cursize - 1]) + { /* no trailing 0 */ + Q_memcpy((byte*)SZ_GetSpace(buf, len), data, len); + } + else + { /* write over trailing 0 */ + Q_memcpy((byte*)SZ_GetSpace(buf, len - 1) - 1, data, len); + } +} diff --git a/Quake/sizebuf.hpp b/Quake/sizebuf.hpp new file mode 100644 index 00000000..62d4f93f --- /dev/null +++ b/Quake/sizebuf.hpp @@ -0,0 +1,42 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2002-2009 John Fitzgibbons and others +Copyright (C) 2010-2014 QuakeSpasm developers +Copyright (C) 2020-2020 Vittorio Romeo + +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. + +*/ + +#pragma once + +#include "q_stdinc.hpp" + +struct sizebuf_t +{ + bool allowoverflow; // if false, do a Sys_Error + bool overflowed; // set to true if the buffer size failed + byte* data; + int maxsize; + int cursize; +}; + +void SZ_Alloc(sizebuf_t* buf, int startsize); +void SZ_Free(sizebuf_t* buf); +void SZ_Clear(sizebuf_t* buf); +void* SZ_GetSpace(sizebuf_t* buf, int length); +void SZ_Write(sizebuf_t* buf, const void* data, int length); +void SZ_Print(sizebuf_t* buf, const char* data); // strcats onto the sizebuf diff --git a/Quake/snd_codec.cpp b/Quake/snd_codec.cpp index 68c6839e..98f8d4fb 100644 --- a/Quake/snd_codec.cpp +++ b/Quake/snd_codec.cpp @@ -24,8 +24,13 @@ */ #include "quakedef.hpp" +#include "console.hpp" +#include "common.hpp" +#include "quakedef_macros.hpp" + #include "snd_codec.hpp" #include "snd_codeci.hpp" +#include "zone.hpp" /* headers for individual codecs */ #include "snd_mikmod.hpp" diff --git a/Quake/snd_codec.hpp b/Quake/snd_codec.hpp index 43307eb0..11389f22 100644 --- a/Quake/snd_codec.hpp +++ b/Quake/snd_codec.hpp @@ -23,8 +23,10 @@ * */ -#ifndef _SND_CODEC_H_ -#define _SND_CODEC_H_ +#pragma once + +#include "fshandle.hpp" +#include "quakedef_macros.hpp" typedef struct snd_info_s { @@ -59,8 +61,8 @@ typedef struct snd_stream_s } snd_stream_t; -void S_CodecInit(void); -void S_CodecShutdown(void); +void S_CodecInit(); +void S_CodecShutdown(); /* Callers of the following S_CodecOpenStream* functions * are reponsible for attaching any path to the filename */ @@ -100,5 +102,3 @@ void S_CodecUtilClose(snd_stream_t** stream); int S_CodecIsAvailable(unsigned int type); /* return 1 if available, 0 if codec failed init * or -1 if no such codec is present. */ - -#endif /* _SND_CODEC_H_ */ diff --git a/Quake/snd_codeci.hpp b/Quake/snd_codeci.hpp index 35979b0f..bd8ae5d5 100644 --- a/Quake/snd_codeci.hpp +++ b/Quake/snd_codeci.hpp @@ -23,12 +23,11 @@ * */ -#ifndef _SND_CODECI_H_ -#define _SND_CODECI_H_ +#pragma once /* Codec internals */ -typedef bool (*CODEC_INIT)(void); -typedef void (*CODEC_SHUTDOWN)(void); +typedef bool (*CODEC_INIT)(); +typedef void (*CODEC_SHUTDOWN)(); typedef bool (*CODEC_OPEN)(snd_stream_t* stream); typedef int (*CODEC_READ)(snd_stream_t* stream, int bytes, void* buffer); typedef int (*CODEC_REWIND)(snd_stream_t* stream); @@ -50,5 +49,3 @@ struct snd_codec_s bool S_CodecForwardStream(snd_stream_t* stream, unsigned int type); /* Forward a stream to another codec of 'type' type. */ - -#endif /* _SND_CODECI_H_ */ diff --git a/Quake/snd_dma.cpp b/Quake/snd_dma.cpp index 53caef06..10deddbc 100644 --- a/Quake/snd_dma.cpp +++ b/Quake/snd_dma.cpp @@ -25,10 +25,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // snd_dma.c -- main control for any streaming sound output device -#include "quakedef.hpp" +#include "q_sound.hpp" +#include "bspfile.hpp" #include "snd_codec.hpp" #include "bgmusic.hpp" #include "quakeglm.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "console.hpp" +#include "quakedef_macros.hpp" +#include "quakeparms.hpp" +#include "quakeglm_qvec3.hpp" +#include "mathlib.hpp" +#include "sys.hpp" +#include "gl_model.hpp" +#include "client.hpp" static void S_Play(); static void S_PlayVol(); @@ -50,10 +61,10 @@ static bool snd_initialized = false; static dma_t sn; volatile dma_t* shm = nullptr; -glm::vec3 listener_origin; -glm::vec3 listener_forward; -glm::vec3 listener_right; -glm::vec3 listener_up; +qvec3 listener_origin; +qvec3 listener_forward; +qvec3 listener_right; +qvec3 listener_up; #define sound_nominal_clip_dist 1000.0 @@ -214,6 +225,7 @@ void S_Init() Cvar_SetQuick(&snd_mixspeed, com_argv[i + 1]); } + extern quakeparms_t* host_parms; if(host_parms->memsize < 0x800000) { Cvar_SetQuick(&loadas8bit, "1"); @@ -436,7 +448,7 @@ void SND_Spatialize(channel_t* ch) float rscale; float scale; - glm::vec3 source_vec; + qvec3 source_vec; // anything coming from the view entity will always be full volume if(ch->entnum == cl.viewentity) @@ -485,7 +497,7 @@ void SND_Spatialize(channel_t* ch) // ======================================================================= void S_StartSound(int entnum, int entchannel, sfx_t* sfx, - const glm::vec3& origin, float fvol, float attenuation) + const qvec3& origin, float fvol, float attenuation) { channel_t* target_chan; @@ -662,7 +674,7 @@ S_StaticSound ================= */ void S_StaticSound( - sfx_t* sfx, const glm::vec3& origin, float vol, float attenuation) + sfx_t* sfx, const qvec3& origin, float vol, float attenuation) { channel_t* ss; sfxcache_t* sc; @@ -752,6 +764,8 @@ static void S_UpdateAmbientSounds() vol = 0; } + extern double host_frametime; + // don't adjust volume too fast if(chan->master_vol < vol) { @@ -885,8 +899,8 @@ S_Update Called once each time through the main loop ============ */ -void S_Update(const glm::vec3& origin, const glm::vec3& forward, - const glm::vec3& right, const glm::vec3& up) +void S_Update(const qvec3& origin, const qvec3& forward, + const qvec3& right, const qvec3& up) { int i; diff --git a/Quake/snd_flac.cpp b/Quake/snd_flac.cpp index 3e943769..1fff86c4 100644 --- a/Quake/snd_flac.cpp +++ b/Quake/snd_flac.cpp @@ -23,6 +23,9 @@ */ #include "quakedef.hpp" +#include "console.hpp" +#include "fshandle.hpp" +#include "zone.hpp" #if defined(USE_CODEC_FLAC) #include "snd_codec.hpp" diff --git a/Quake/snd_flac.hpp b/Quake/snd_flac.hpp index 05546418..b960b507 100644 --- a/Quake/snd_flac.hpp +++ b/Quake/snd_flac.hpp @@ -1,12 +1,9 @@ /* fLaC streaming music support. */ -#if !defined(_SND_FLAC_H_) -#define _SND_FLAC_H_ 1 +#pragma once #if defined(USE_CODEC_FLAC) extern snd_codec_t flac_codec; #endif /* USE_CODEC_FLAC */ - -#endif /* ! _SND_FLAC_H_ */ diff --git a/Quake/snd_mem.cpp b/Quake/snd_mem.cpp index 0fe1e18c..2ec6b5aa 100644 --- a/Quake/snd_mem.cpp +++ b/Quake/snd_mem.cpp @@ -20,7 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // snd_mem.c: sound caching -#include "quakedef.hpp" +#include "q_sound.hpp" +#include "q_stdinc.hpp" +#include "console.hpp" +#include "common.hpp" +#include "sys.hpp" +#include "byteorder.hpp" + +// QSS +#include "snd_codec.hpp" /* ================ @@ -64,42 +72,72 @@ static void ResampleSfx(sfx_t* sfx, int inrate, int inwidth, byte* data) { sc->width = inwidth; } - sc->stereo = 0; - - // resample / decimate to the current source rate - if(stepscale == 1 && inwidth == 1 && sc->width == 1) - { - // fast special case - for(i = 0; i < outcount; i++) - { - ((signed char*)sc->data)[i] = (int)((unsigned char)(data[i]) - 128); - } - } - else + // QSS + if(sc->stereo == 1) { - // general case + // crappy approach to stereo - strip it out by merging left+right + // channels + sc->stereo = 0; + samplefrac = 0; fracstep = stepscale * 256; for(i = 0; i < outcount; i++) { srcsample = samplefrac >> 8; + srcsample <<= 1; samplefrac += fracstep; if(inwidth == 2) - { - sample = LittleShort(((short*)data)[srcsample]); - } + sample = LittleShort(((short*)data)[srcsample]) + + LittleShort(((short*)data)[srcsample + 1]); else - { - sample = (int)((unsigned char)(data[srcsample]) - 128) << 8; - } + sample = + ((int)((unsigned char)(data[srcsample]) - 128) << 8) + + ((int)((unsigned char)(data[srcsample + 1]) - 128) << 8); + sample /= 2; if(sc->width == 2) - { ((short*)sc->data)[i] = sample; - } else - { ((signed char*)sc->data)[i] = sample >> 8; + } + } + else + { + // resample / decimate to the current source rate + if(stepscale == 1 && inwidth == 1 && sc->width == 1) + { + // fast special case + for(i = 0; i < outcount; i++) + { + ((signed char*)sc->data)[i] = + (int)((unsigned char)(data[i]) - 128); + } + } + else + { + // general case + samplefrac = 0; + fracstep = stepscale * 256; + for(i = 0; i < outcount; i++) + { + srcsample = samplefrac >> 8; + samplefrac += fracstep; + if(inwidth == 2) + { + sample = LittleShort(((short*)data)[srcsample]); + } + else + { + sample = (int)((unsigned char)(data[srcsample]) - 128) << 8; + } + if(sc->width == 2) + { + ((short*)sc->data)[i] = sample; + } + else + { + ((signed char*)sc->data)[i] = sample >> 8; + } } } } @@ -135,10 +173,56 @@ sfxcache_t* S_LoadSound(sfx_t* s) q_strlcpy(namebuffer, "sound/", sizeof(namebuffer)); q_strlcat(namebuffer, s->name, sizeof(namebuffer)); - // Con_Printf ("loading %s\n",namebuffer); + // QSS + if(strcmp("wav", COM_FileGetExtension(s->name))) + { + // if its an ogg (or even an mp3) then decode it now. our mixer doesn't + // support streaming anything but music. + // FIXME: I hate depending on extensions for this sort of thing. Its not + // a very quakey thing to do. + snd_stream_t* stream = S_CodecOpenStreamExt(namebuffer); + if(!stream) stream = S_CodecOpenStreamExt(s->name); + if(stream) + { + size_t decodedsize = 1024 * 1024 * 16; + void* decoded = malloc(decodedsize); + int res = S_CodecReadStream(stream, decodedsize, decoded); + int len; + S_CodecCloseStream(stream); + + res /= stream->info.width * stream->info.channels; + + stepscale = (float)stream->info.rate / shm->speed; + len = res / stepscale; + len = len * stream->info.width; // * info.channels; + + sc = (sfxcache_t*)Cache_Alloc( + &s->cache, res + sizeof(sfxcache_t), s->name); + if(!sc) return NULL; + + sc->length = res / stream->info.channels; + sc->loopstart = -1; + sc->speed = stream->info.rate; + sc->width = stream->info.width; + sc->stereo = stream->info.channels - 1; + + ResampleSfx(s, sc->speed, sc->width, static_cast<byte*>(decoded)); + free(decoded); + return sc; + } + } + + + // Con_Printf ("loading %s\n",namebuffer); data = COM_LoadStackFile(namebuffer, stackbuf, sizeof(stackbuf), nullptr); + // QSS + if(!data) + { + data = COM_LoadStackFile(s->name, stackbuf, sizeof(stackbuf), NULL); + } + if(!data) { Con_Printf("Couldn't load %s\n", namebuffer); @@ -146,7 +230,7 @@ sfxcache_t* S_LoadSound(sfx_t* s) } info = GetWavinfo(s->name, data, com_filesize); - if(info.channels != 1) + if(info.channels != 1 && info.channels != 2 /* QSS */) { Con_Printf("%s is a stereo sample\n", s->name); return nullptr; @@ -161,7 +245,8 @@ sfxcache_t* S_LoadSound(sfx_t* s) stepscale = (float)info.rate / shm->speed; len = info.samples / stepscale; - len = len * info.width * info.channels; + // QSS + len = len * info.width; // * info.channels; * info.channels; if(info.samples == 0 || len == 0) { @@ -175,11 +260,15 @@ sfxcache_t* S_LoadSound(sfx_t* s) return nullptr; } - sc->length = info.samples; + // QSS + sc->length = info.samples / info.channels; + sc->loopstart = info.loopstart; sc->speed = info.rate; sc->width = info.width; - sc->stereo = info.channels; + + // QSS + sc->stereo = info.channels - 1; ResampleSfx(s, sc->speed, sc->width, data + info.dataofs); diff --git a/Quake/snd_mikmod.cpp b/Quake/snd_mikmod.cpp index 33cbc62e..cb9fe9f5 100644 --- a/Quake/snd_mikmod.cpp +++ b/Quake/snd_mikmod.cpp @@ -19,6 +19,10 @@ */ #include "quakedef.hpp" +#include "fshandle.hpp" +#include "zone.hpp" +#include "console.hpp" +#include "q_sound.hpp" #if defined(USE_CODEC_MIKMOD) #include "snd_codec.hpp" diff --git a/Quake/snd_mix.cpp b/Quake/snd_mix.cpp index 60da7973..eba9ea0e 100644 --- a/Quake/snd_mix.cpp +++ b/Quake/snd_mix.cpp @@ -23,6 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // snd_mix.c -- portable code to mix sounds for snd_dma.c #include "quakedef.hpp" +#include "console.hpp" +#include "common.hpp" +#include "q_sound.hpp" +#include "mathlib.hpp" #define PAINTBUFFER_SIZE 2048 portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE]; @@ -288,6 +292,13 @@ static void S_ApplyFilter(filter_t* filter, int* data, int stride, int count) input = (float*)malloc(sizeof(float) * (filter->kernelsize + count)); + // QSS + if(!input) + { + return; + } + + // set up the input buffer // memory holds the previous filter->kernelsize samples of input. memcpy(input, filter->memory, filter->kernelsize * sizeof(float)); diff --git a/Quake/snd_modplug.hpp b/Quake/snd_modplug.hpp index 230fc1ae..425c54b3 100644 --- a/Quake/snd_modplug.hpp +++ b/Quake/snd_modplug.hpp @@ -1,11 +1,8 @@ /* module tracker decoding support using libmodplug */ -#if !defined(_SND_MODPLUG_H_) -#define _SND_MODPLUG_H_ +#pragma once #if defined(USE_CODEC_MODPLUG) extern snd_codec_t modplug_codec; #endif /* USE_CODEC_MODPLUG */ - -#endif /* ! _SND_MODPLUG_H_ */ diff --git a/Quake/snd_mp3.cpp b/Quake/snd_mp3.cpp index a9394793..806eb884 100644 --- a/Quake/snd_mp3.cpp +++ b/Quake/snd_mp3.cpp @@ -24,7 +24,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "quakedef.hpp" +#include "console.hpp" +#include "common.hpp" +#include "byteorder.hpp" #if defined(USE_CODEC_MP3) #include "snd_codec.hpp" diff --git a/Quake/snd_mp3.hpp b/Quake/snd_mp3.hpp index 461d8353..f51ec96e 100644 --- a/Quake/snd_mp3.hpp +++ b/Quake/snd_mp3.hpp @@ -1,7 +1,6 @@ /* MP3 decoding support using libmad or libmpg123. */ -#if !defined(_SND_MP3_H_) -#define _SND_MP3_H_ +#pragma once #if defined(USE_CODEC_MP3) @@ -9,5 +8,3 @@ extern snd_codec_t mp3_codec; int mp3_skiptags(snd_stream_t*); #endif /* USE_CODEC_MP3 */ - -#endif /* ! _SND_MP3_H_ */ diff --git a/Quake/snd_mp3tag.cpp b/Quake/snd_mp3tag.cpp index 5ad278ef..2c989b58 100644 --- a/Quake/snd_mp3tag.cpp +++ b/Quake/snd_mp3tag.cpp @@ -18,6 +18,7 @@ */ #include "quakedef.hpp" +#include "console.hpp" #if defined(USE_CODEC_MP3) #include "snd_codec.hpp" diff --git a/Quake/snd_mpg123.cpp b/Quake/snd_mpg123.cpp index 96377eee..2d1c6e6b 100644 --- a/Quake/snd_mpg123.cpp +++ b/Quake/snd_mpg123.cpp @@ -18,6 +18,9 @@ */ #include "quakedef.hpp" +#include "fshandle.hpp" +#include "console.hpp" +#include "zone.hpp" #if defined(USE_CODEC_MP3) #include "snd_codec.hpp" diff --git a/Quake/snd_opus.cpp b/Quake/snd_opus.cpp index 440c8aa8..9c807d9a 100644 --- a/Quake/snd_opus.cpp +++ b/Quake/snd_opus.cpp @@ -22,6 +22,8 @@ */ #include "quakedef.hpp" +#include "fshandle.hpp" +#include "console.hpp" #if defined(USE_CODEC_OPUS) #include "snd_codec.hpp" diff --git a/Quake/snd_sdl.cpp b/Quake/snd_sdl.cpp index 9d0a70d8..d919d7c5 100644 --- a/Quake/snd_sdl.cpp +++ b/Quake/snd_sdl.cpp @@ -24,20 +24,14 @@ Copyright (C) 2020-2020 Vittorio Romeo */ #include "quakedef.hpp" +#include "console.hpp" +#include "q_sound.hpp" +#include "common.hpp" -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif static int buffersize; - static void SDLCALL paint_audio(void* unused, Uint8* stream, int len) { (void)unused; @@ -170,7 +164,7 @@ bool SNDDMA_Init(dma_t* dma) Con_Printf("SDL audio spec : %d Hz, %d samples, %d channels\n", desired.freq, desired.samples, desired.channels); -#if defined(USE_SDL2) + { const char* driver = SDL_GetCurrentAudioDriver(); const char* device = SDL_GetAudioDeviceName(0, SDL_FALSE); @@ -178,10 +172,7 @@ bool SNDDMA_Init(dma_t* dma) driver != nullptr ? driver : "(UNKNOWN)", device != nullptr ? device : "(UNKNOWN)"); } -#else - if(SDL_AudioDriverName(drivername, sizeof(drivername)) == nullptr) - strcpy(drivername, "(UNKNOWN)"); -#endif + buffersize = shm->samples * (shm->samplebits / 8); Con_Printf( "SDL audio driver: %s, %d bytes buffer\n", drivername, buffersize); diff --git a/Quake/snd_umx.cpp b/Quake/snd_umx.cpp index ea8681d2..4d774cfd 100644 --- a/Quake/snd_umx.cpp +++ b/Quake/snd_umx.cpp @@ -28,6 +28,9 @@ */ #include "quakedef.hpp" +#include "fshandle.hpp" +#include "console.hpp" +#include "common.hpp" #if defined(USE_CODEC_UMX) #include "snd_codec.hpp" diff --git a/Quake/snd_umx.hpp b/Quake/snd_umx.hpp index 7c770150..17db0148 100644 --- a/Quake/snd_umx.hpp +++ b/Quake/snd_umx.hpp @@ -1,11 +1,8 @@ /* Unreal UMX format support */ -#if !defined(_SND_UMX_H_) -#define _SND_UMX_H_ +#pragma once #if defined(USE_CODEC_UMX) extern snd_codec_t umx_codec; #endif /* USE_CODEC_UMX */ - -#endif /* ! _SND_UMX_H_ */ diff --git a/Quake/snd_vorbis.cpp b/Quake/snd_vorbis.cpp index 4305dd3e..320d0d08 100644 --- a/Quake/snd_vorbis.cpp +++ b/Quake/snd_vorbis.cpp @@ -22,6 +22,10 @@ */ #include "quakedef.hpp" +#include "console.hpp" +#include "fshandle.hpp" +#include "zone.hpp" +#include "byteorder.hpp" #if defined(USE_CODEC_VORBIS) #include "snd_codec.hpp" diff --git a/Quake/snd_vorbis.hpp b/Quake/snd_vorbis.hpp index 1ef49496..9feacd05 100644 --- a/Quake/snd_vorbis.hpp +++ b/Quake/snd_vorbis.hpp @@ -1,12 +1,8 @@ /* Ogg/Vorbis streaming music support. */ - -#if !defined(_SND_VORBIS_H_) -#define _SND_VORBIS_H_ 1 +#pragma once #if defined(USE_CODEC_VORBIS) extern snd_codec_t vorbis_codec; #endif /* USE_CODEC_VORBIS */ - -#endif /* ! _SND_VORBIS_H_ */ diff --git a/Quake/snd_wave.cpp b/Quake/snd_wave.cpp index be52c3d1..464c403e 100644 --- a/Quake/snd_wave.cpp +++ b/Quake/snd_wave.cpp @@ -22,7 +22,10 @@ * */ -#include "quakedef.hpp" +#include "console.hpp" +#include "common.hpp" +#include "q_sound.hpp" +#include "byteorder.hpp" #if defined(USE_CODEC_WAVE) #include "snd_codec.hpp" diff --git a/Quake/snd_wave.hpp b/Quake/snd_wave.hpp index e27dd6a4..da429b2b 100644 --- a/Quake/snd_wave.hpp +++ b/Quake/snd_wave.hpp @@ -1,12 +1,8 @@ /* WAV streaming music support. */ - -#if !defined(_SND_WAVE_H_) -#define _SND_WAVE_H_ +#pragma once #if defined(USE_CODEC_WAVE) extern snd_codec_t wav_codec; #endif /* USE_CODEC_WAVE */ - -#endif /* ! _SND_WAVE_H_ */ diff --git a/Quake/snd_xmp.hpp b/Quake/snd_xmp.hpp index 16b99ca3..a46905e1 100644 --- a/Quake/snd_xmp.hpp +++ b/Quake/snd_xmp.hpp @@ -1,11 +1,8 @@ /* module tracker decoding support using libxmp */ -#if !defined(_SND_XMP_H_) -#define _SND_XMP_H_ +#pragma once #if defined(USE_CODEC_XMP) extern snd_codec_t xmp_codec; #endif /* USE_CODEC_XMP */ - -#endif /* ! _SND_XMP_H_ */ diff --git a/Quake/spritegn.hpp b/Quake/spritegn.hpp index c65d2d14..e2db5d0e 100644 --- a/Quake/spritegn.hpp +++ b/Quake/spritegn.hpp @@ -19,8 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __SPRITEGEN_H -#define __SPRITEGEN_H +#pragma once // // spritegn.h: header file for sprite generation program @@ -52,7 +51,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <stdlib.h> #include <stdio.h> #include <math.h> -#include <string.h> +#include <cstring> #include "cmdlib.hpp" #include "scriplib.hpp" @@ -125,5 +124,3 @@ typedef struct #define IDSPRITEHEADER (('P' << 24) + ('S' << 16) + ('D' << 8) + 'I') // little-endian "IDSP" - -#endif /* __SPRITEGEN_H */ diff --git a/Quake/stb_image_write.hpp b/Quake/stb_image_write.hpp index 7b96fc15..e8ada298 100644 --- a/Quake/stb_image_write.hpp +++ b/Quake/stb_image_write.hpp @@ -177,7 +177,7 @@ STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, #include <stdarg.h> #include <stdlib.h> -#include <string.h> +#include <cstring> #include <math.h> #if defined(STBIW_MALLOC) && defined(STBIW_FREE) && \ diff --git a/Quake/strl_fn.hpp b/Quake/strl_fn.hpp index bec89ea5..8066fa7c 100644 --- a/Quake/strl_fn.hpp +++ b/Quake/strl_fn.hpp @@ -1,10 +1,7 @@ /* header file for BSD strlcat and strlcpy */ -#ifndef __STRLFUNCS_H -#define __STRLFUNCS_H +#pragma once /* use our own copies of strlcpy and strlcat taken from OpenBSD */ extern size_t q_strlcpy(char* dst, const char* src, size_t size); extern size_t q_strlcat(char* dst, const char* src, size_t size); - -#endif /* __STRLFUNCS_H */ diff --git a/Quake/strlcat.cpp b/Quake/strlcat.cpp index 1a584a4b..4059e290 100644 --- a/Quake/strlcat.cpp +++ b/Quake/strlcat.cpp @@ -17,7 +17,7 @@ */ #include <sys/types.h> -#include <string.h> +#include <cstring> #include "strl_fn.hpp" diff --git a/Quake/strlcpy.cpp b/Quake/strlcpy.cpp index 6999254f..d4ddaf4f 100644 --- a/Quake/strlcpy.cpp +++ b/Quake/strlcpy.cpp @@ -17,7 +17,7 @@ */ #include <sys/types.h> -#include <string.h> +#include <cstring> #include "strl_fn.hpp" diff --git a/Quake/sv_main.cpp b/Quake/sv_main.cpp index 6731a488..c3c3595b 100644 --- a/Quake/sv_main.cpp +++ b/Quake/sv_main.cpp @@ -22,9 +22,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // sv_main.c -- server main program +#include "host.hpp" +#include "menu.hpp" #include "quakedef.hpp" +#include "server.hpp" #include "vr.hpp" #include "util.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "console.hpp" +#include "net.hpp" +#include "glquake.hpp" +#include "protocol.hpp" +#include "worldtext.hpp" +#include "msg.hpp" +#include "sys.hpp" server_t sv; server_static_t svs; @@ -147,11 +159,9 @@ EVENT MESSAGES ============================================================================= */ -static void writeCommonParticleData(const glm::vec3& org, const glm::vec3& dir) +static void writeCommonParticleData(const qvec3& org, const qvec3& dir) { - MSG_WriteCoord(&sv.datagram, org[0], sv.protocolflags); - MSG_WriteCoord(&sv.datagram, org[1], sv.protocolflags); - MSG_WriteCoord(&sv.datagram, org[2], sv.protocolflags); + MSG_WriteVec3(&sv.datagram, org, sv.protocolflags); for(int i = 0; i < 3; i++) { int v = dir[i] * 16; @@ -174,8 +184,8 @@ SV_StartParticle Make sure the event gets sent to all clients ================== */ -void SV_StartParticle(const glm::vec3& org, const glm::vec3& dir, - const int color, const int count) +void SV_StartParticle( + const qvec3& org, const qvec3& dir, const int color, const int count) { if(sv.datagram.cursize > MAX_DATAGRAM - 16) { @@ -195,8 +205,8 @@ SV_StartParticle2 Make sure the event gets sent to all clients ================== */ -void SV_StartParticle2(const glm::vec3& org, const glm::vec3& dir, - const int preset, const int count) +void SV_StartParticle2( + const qvec3& org, const qvec3& dir, const int preset, const int count) { if(sv.datagram.cursize > MAX_DATAGRAM - 16) { @@ -227,13 +237,6 @@ Larger attenuations will drop off. (max 4 attenuation) void SV_StartSound(edict_t* entity, int channel, const char* sample, int volume, float attenuation) { - int sound_num; - - int ent; - int i; - - int field_mask; - if(volume < 0 || volume > 255) { Host_Error("SV_StartSound: volume = %i", volume); @@ -255,6 +258,7 @@ void SV_StartSound(edict_t* entity, int channel, const char* sample, int volume, } // find precache number for sound + int sound_num; for(sound_num = 1; sound_num < MAX_SOUNDS && sv.sound_precache[sound_num]; sound_num++) { @@ -270,9 +274,9 @@ void SV_StartSound(edict_t* entity, int channel, const char* sample, int volume, return; } - ent = NUM_FOR_EDICT(entity); + const int ent = NUM_FOR_EDICT(entity); - field_mask = 0; + int field_mask = 0; if(volume != DEFAULT_SOUND_PACKET_VOLUME) { field_mask |= SND_VOLUME; @@ -335,7 +339,7 @@ void SV_StartSound(edict_t* entity, int channel, const char* sample, int volume, } // johnfitz - for(i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) { MSG_WriteCoord(&sv.datagram, entity->v.origin[i] + 0.5 * (entity->v.mins[i] + entity->v.maxs[i]), @@ -366,8 +370,10 @@ void SV_SendServerinfo(client_t* client) int i; // johnfitz MSG_WriteByte(&client->message, svc_print); - sprintf(message, "%c\nFITZQUAKE %1.2f SERVER (%i CRC)\n", 2, - FITZQUAKE_VERSION, pr_crc); // johnfitz -- include fitzquake version + + sprintf(message, "%c\nQUAKE VR %s SERVER (%i CRC)\n", 2, QUAKEVR_VERSION, + pr_crc); // johnfitz -- include fitzquake version + MSG_WriteString(&client->message, message); MSG_WriteByte(&client->message, svc_serverinfo); @@ -441,24 +447,19 @@ once for a player each game, not once for each level change. */ void SV_ConnectClient(int clientnum) { - edict_t* ent; - client_t* client; - int edictnum; - struct qsocket_s* netconnection; - int i; float spawn_parms[NUM_SPAWN_PARMS]; - client = svs.clients + clientnum; + client_t* client = svs.clients + clientnum; Con_DPrintf("Client %s connected\n", NET_QSocketGetAddressString(client->netconnection)); - edictnum = clientnum + 1; + int edictnum = clientnum + 1; - ent = EDICT_NUM(edictnum); + edict_t* ent = EDICT_NUM(edictnum); // set up the client_t - netconnection = client->netconnection; + struct qsocket_s* netconnection = client->netconnection; if(sv.loadgame) { @@ -483,7 +484,7 @@ void SV_ConnectClient(int clientnum) { // call the progs to get default spawn parms for the new client PR_ExecuteProgram(pr_global_struct->SetNewParms); - for(i = 0; i < NUM_SPAWN_PARMS; i++) + for(int i = 0; i < NUM_SPAWN_PARMS; i++) { client->spawn_parms[i] = (&pr_global_struct->parm1)[i]; } @@ -501,15 +502,12 @@ SV_CheckForNewClients */ void SV_CheckForNewClients() { - struct qsocket_s* ret; - int i; - // // check for new connections // while(true) { - ret = NET_CheckNewConnections(); + struct qsocket_s* ret = NET_CheckNewConnections(); if(!ret) { break; @@ -518,6 +516,7 @@ void SV_CheckForNewClients() // // init a new client structure // + int i; for(i = 0; i < svs.maxclients; i++) { if(!svs.clients[i].active) @@ -573,7 +572,7 @@ static int fatbytes; static byte* fatpvs; static int fatpvs_capacity; -void SV_AddToFatPVS(const glm::vec3& org, mnode_t* node, +void SV_AddToFatPVS(const qvec3& org, mnode_t* node, qmodel_t* worldmodel) // johnfitz -- added worldmodel as a parameter { int i; @@ -626,7 +625,7 @@ Calculates a PVS that is the inclusive or of all leafs within 8 pixels of the given point. ============= */ -byte* SV_FatPVS(const glm::vec3& org, +byte* SV_FatPVS(const qvec3& org, qmodel_t* worldmodel) // johnfitz -- added worldmodel as a parameter { fatbytes = (worldmodel->numleafs + 7) >> @@ -658,7 +657,7 @@ PVS test encapsulated in a nice function bool SV_VisibleToClient(edict_t* client, edict_t* test, qmodel_t* worldmodel) { byte* pvs; - glm::vec3 org; + qvec3 org; int i; org = client->v.origin + client->v.view_ofs; @@ -690,7 +689,7 @@ void SV_WriteEntitiesToClient(edict_t* clent, sizebuf_t* msg) int i; int bits; byte* pvs; - glm::vec3 org; + qvec3 org; float miss; edict_t* ent; @@ -771,9 +770,6 @@ void SV_WriteEntitiesToClient(edict_t* clent, sizebuf_t* msg) } } - // TODO VR: (P1) remove, this should be set only when scale changes - bits |= U_SCALE; - if(ent->v.angles[0] != ent->baseline.angles[0]) { bits |= U_ANGLE1; @@ -871,31 +867,36 @@ void SV_WriteEntitiesToClient(edict_t* clent, sizebuf_t* msg) // johnfitz -- PROTOCOL_FITZQUAKE if(sv.protocol != PROTOCOL_NETQUAKE) { - if(ent->baseline.alpha != ent->alpha) { bits |= U_ALPHA; } + if(ent->baseline.scale != ent->v.scale) { bits |= U_SCALE; } + if(bits & U_FRAME && (int)ent->v.frame & 0xFF00) { bits |= U_FRAME2; } + if(bits & U_MODEL && (int)ent->v.modelindex & 0xFF00) { bits |= U_MODEL2; } + if(ent->sendinterval) { bits |= U_LERPFINISH; } + if(bits >= 65536) { bits |= U_EXTEND1; } + if(bits >= 16777216) { bits |= U_EXTEND2; @@ -1064,6 +1065,7 @@ void SV_CleanupEnts() ================== SV_WriteClientdataToMessage +Sent to every connected client per frame. ================== */ void SV_WriteClientdataToMessage(edict_t* ent, sizebuf_t* msg) @@ -1227,6 +1229,22 @@ void SV_WriteClientdataToMessage(edict_t* ent, sizebuf_t* msg) bits |= SU_VR_WEAPON2; bits |= SU_VR_WEAPONFRAME2; + + const bool anyHolster = + ent->v.holsterweapon0 || ent->v.holsterweapon1 || + ent->v.holsterweapon2 || ent->v.holsterweapon3 || + ent->v.holsterweapon4 || ent->v.holsterweapon5 || + ent->v.holsterweaponmodel0 || ent->v.holsterweaponmodel1 || + ent->v.holsterweaponmodel2 || ent->v.holsterweaponmodel3 || + ent->v.holsterweaponmodel4 || ent->v.holsterweaponmodel5 || + ent->v.holsterweaponflags0 || ent->v.holsterweaponflags1 || + ent->v.holsterweaponflags2 || ent->v.holsterweaponflags3 || + ent->v.holsterweaponflags4 || ent->v.holsterweaponflags5; + + if(anyHolster) + { + bits |= SU_VR_HOLSTERS; + } } // johnfitz @@ -1364,27 +1382,70 @@ void SV_WriteClientdataToMessage(edict_t* ent, sizebuf_t* msg) } // TODO VR: (P2) weapon ids in holsters - MSG_WriteByte(msg, (int)ent->v.holsterweapon0); - MSG_WriteByte(msg, (int)ent->v.holsterweapon1); - MSG_WriteByte(msg, (int)ent->v.holsterweapon2); - MSG_WriteByte(msg, (int)ent->v.holsterweapon3); - MSG_WriteByte(msg, (int)ent->v.holsterweapon4); - MSG_WriteByte(msg, (int)ent->v.holsterweapon5); - MSG_WriteByte( - msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel0))); - MSG_WriteByte( - msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel1))); - MSG_WriteByte( - msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel2))); - MSG_WriteByte( - msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel3))); - MSG_WriteByte( - msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel4))); - MSG_WriteByte( - msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel5))); + if(bits & SU_VR_HOLSTERS) + { + MSG_WriteByte(msg, (int)ent->v.holsterweapon0); + MSG_WriteByte(msg, (int)ent->v.holsterweapon1); + MSG_WriteByte(msg, (int)ent->v.holsterweapon2); + MSG_WriteByte(msg, (int)ent->v.holsterweapon3); + MSG_WriteByte(msg, (int)ent->v.holsterweapon4); + MSG_WriteByte(msg, (int)ent->v.holsterweapon5); + MSG_WriteByte( + msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel0))); + MSG_WriteByte( + msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel1))); + MSG_WriteByte( + msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel2))); + MSG_WriteByte( + msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel3))); + MSG_WriteByte( + msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel4))); + MSG_WriteByte( + msg, (int)SV_ModelIndex(PR_GetString(ent->v.holsterweaponmodel5))); + MSG_WriteByte( + msg, (int)ent->v.holsterweaponflags0); // STAT_HOLSTERWEAPONFLAGS0 + MSG_WriteByte( + msg, (int)ent->v.holsterweaponflags1); // STAT_HOLSTERWEAPONFLAGS1 + MSG_WriteByte( + msg, (int)ent->v.holsterweaponflags2); // STAT_HOLSTERWEAPONFLAGS2 + MSG_WriteByte( + msg, (int)ent->v.holsterweaponflags3); // STAT_HOLSTERWEAPONFLAGS3 + MSG_WriteByte( + msg, (int)ent->v.holsterweaponflags4); // STAT_HOLSTERWEAPONFLAGS4 + MSG_WriteByte( + msg, (int)ent->v.holsterweaponflags5); // STAT_HOLSTERWEAPONFLAGS5 + } MSG_WriteByte(msg, (int)ent->v.weapon); // STAT_MAINHAND_WID MSG_WriteByte(msg, (int)ent->v.weapon2); // STAT_OFFHAND_WID + + MSG_WriteByte(msg, (int)ent->v.weaponflags); // STAT_WEAPONFLAGS + MSG_WriteByte(msg, (int)ent->v.weaponflags2); // STAT_WEAPONFLAGS2 + + + // TODO VR: (P1) experiment with this +#if 0 + { + VrGunWallCollision outGunWallCollision[2]; + + const auto doHandAndGunCollisions = [&](const HandIdx index) { + const auto worldHandPos = VR_GetWorldHandPos(index, ent->v.origin); + + const qvec3 adjPlayerOrigin = + VR_GetAdjustedPlayerOrigin(ent->v.origin); + + qvec3 finalVec = worldHandPos; + + const auto resolvedHandPos = + VR_GetResolvedHandPos(ent, worldHandPos, adjPlayerOrigin); + + finalVec = resolvedHandPos; + + finalVec = VR_UpdateGunWallCollisions( + ent, index, outGunWallCollision[index], finalVec); + }; + } +#endif } /* @@ -1641,18 +1702,18 @@ SV_CreateBaseline void SV_CreateBaseline() { int i; - edict_t* svent; - int entnum; int bits; // johnfitz -- PROTOCOL_FITZQUAKE - for(entnum = 0; entnum < sv.num_edicts; entnum++) + for(int entnum = 0; entnum < sv.num_edicts; entnum++) { // get the current server version - svent = EDICT_NUM(entnum); + edict_t* svent = EDICT_NUM(entnum); + if(svent->free) { continue; } + if(entnum > svs.maxclients && !svent->v.modelindex) { continue; @@ -1813,12 +1874,9 @@ transition to another level */ void SV_SaveSpawnparms() { - int i; - - int j; - svs.serverflags = pr_global_struct->serverflags; + int i; for(i = 0, host_client = svs.clients; i < svs.maxclients; i++, host_client++) { @@ -1831,7 +1889,7 @@ void SV_SaveSpawnparms() // client pr_global_struct->self = EDICT_TO_PROG(host_client->edict); PR_ExecuteProgram(pr_global_struct->SetChangeParms); - for(j = 0; j < NUM_SPAWN_PARMS; j++) + for(int j = 0; j < NUM_SPAWN_PARMS; j++) { host_client->spawn_parms[j] = (&pr_global_struct->parm1)[j]; } @@ -1847,25 +1905,24 @@ This is called at the start of each level ================ */ extern float scr_centertime_off; -void SV_SpawnServer(const char* server) + +void SV_SpawnServer(const char* server, const SpawnServerSrc src) { static char dummy[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - edict_t* ent; - int i; // let's not have any servers with no name if(hostname.string[0] == 0) { Cvar_Set("hostname", "UNNAMED"); } + scr_centertime_off = 0; Con_DPrintf("SpawnServer: %s\n", server); svs.changelevel_issued = false; // now safe to issue another // - // tell all connected clients that we are going to a new - // level + // tell all connected clients that we are going to a new level // if(sv.active) { @@ -1879,22 +1936,13 @@ void SV_SpawnServer(const char* server) { Cvar_Set("deathmatch", "0"); } - current_skill = (int)(skill.value + 0.5); - if(current_skill < 0) - { - current_skill = 0; - } - if(current_skill > 3) - { - current_skill = 3; - } + current_skill = std::clamp((int)(skill.value + 0.5), 0, 3); Cvar_SetValue("skill", (float)current_skill); // // set up the new server // - // memset (&sv, 0, sizeof(sv)); Host_ClearMemory(); q_strlcpy(sv.name, server, sizeof(sv.name)); @@ -1943,9 +1991,9 @@ void SV_SpawnServer(const char* server) memset(sv.edicts, 0, sv.num_edicts * pr_edict_size); // ericw -- sv.edicts // switched to use malloc() - for(i = 0; i < svs.maxclients; i++) + for(int i = 0; i < svs.maxclients; i++) { - ent = EDICT_NUM(i + 1); + edict_t* ent = EDICT_NUM(i + 1); svs.clients[i].edict = ent; } @@ -1954,8 +2002,11 @@ void SV_SpawnServer(const char* server) sv.time = 1.0; + // VR: This is where the map is changed upon creation of a server. `map`, + // `changelevel`, and slipgates eventually all reach this point. q_strlcpy(sv.name, server, sizeof(sv.name)); q_snprintf(sv.modelname, sizeof(sv.modelname), "maps/%s.bsp", server); + sv.worldmodel = Mod_ForName(sv.modelname, false); if(!sv.worldmodel) { @@ -1963,6 +2014,7 @@ void SV_SpawnServer(const char* server) sv.active = false; return; } + sv.models[1] = sv.worldmodel; // @@ -1970,10 +2022,13 @@ void SV_SpawnServer(const char* server) // SV_ClearWorld(); + // Initialize world text handles and buffers + sv.initializeWorldTexts(); + sv.sound_precache[0] = dummy; sv.model_precache[0] = dummy; sv.model_precache[1] = sv.modelname; - for(i = 1; i < sv.worldmodel->numsubmodels; i++) + for(int i = 1; i < sv.worldmodel->numsubmodels; i++) { sv.model_precache[1 + i] = localmodels[i]; sv.models[i + 1] = Mod_ForName(localmodels[i], false); @@ -1982,7 +2037,7 @@ void SV_SpawnServer(const char* server) // // load the rest of the entities // - ent = EDICT_NUM(0); + edict_t* ent = EDICT_NUM(0); memset(&ent->v, 0, progs->entityfields * 4); ent->free = false; ent->v.model = PR_SetEngineString(sv.worldmodel->name); @@ -2004,6 +2059,15 @@ void SV_SpawnServer(const char* server) // serverflags are for cross level information (sigils) pr_global_struct->serverflags = svs.serverflags; + { + Con_DPrintf("Calling QC 'OnSpawnServerBeforeLoad'.\n"); + + pr_global_struct->spawnServerFromSaveFile = + src == SpawnServerSrc::FromSaveFile; + + PR_ExecuteProgram(pr_global_struct->OnSpawnServerBeforeLoad); + } + ED_LoadFromFile(sv.worldmodel->entities); sv.active = true; @@ -2035,14 +2099,32 @@ void SV_SpawnServer(const char* server) // johnfitz // send serverinfo to all connected clients - for(i = 0, host_client = svs.clients; i < svs.maxclients; - i++, host_client++) { - if(host_client->active) + int i; + + for(i = 0, host_client = svs.clients; i < svs.maxclients; + i++, host_client++) { - SV_SendServerinfo(host_client); + if(host_client->active) + { + SV_SendServerinfo(host_client); + } } } + { + Con_DPrintf("Calling QC 'OnSpawnServerAfterLoad'.\n"); + + pr_global_struct->spawnServerFromSaveFile = + src == SpawnServerSrc::FromSaveFile; + + PR_ExecuteProgram(pr_global_struct->OnSpawnServerAfterLoad); + } + + { + Con_DPrintf("Calling C++ 'VR_OnSpawnServer'.\n"); + VR_OnSpawnServer(); + } + Con_DPrintf("Server spawned.\n"); } diff --git a/Quake/sv_move.cpp b/Quake/sv_move.cpp index 78c10569..52f8ea92 100644 --- a/Quake/sv_move.cpp +++ b/Quake/sv_move.cpp @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "util.hpp" +#include "bspfile.hpp" #define STEPSIZE 18 @@ -41,26 +42,19 @@ int c_yes, c_no; // TODO VR: (P2) could have used this to detect onground? bool SV_CheckBottom(edict_t* ent) { - glm::vec3 mins, maxs, start, stop; + qvec3 start, stop; - trace_t trace; - int x; - int y; - float mid; - - float bottom; - - mins = ent->v.origin + ent->v.mins; - maxs = ent->v.origin + ent->v.maxs; + const qvec3 mins = ent->v.origin + ent->v.mins; + const qvec3 maxs = ent->v.origin + ent->v.maxs; // if all of the points under the corners are solid world, don't bother // with the tougher checks // the corners must be within 16 of the midpoint start[2] = mins[2] - 1; - for(x = 0; x <= 1; x++) + for(int x = 0; x <= 1; x++) { - for(y = 0; y <= 1; y++) + for(int y = 0; y <= 1; y++) { start[0] = x ? maxs[0] : mins[0]; start[1] = y ? maxs[1] : mins[1]; @@ -85,18 +79,21 @@ bool SV_CheckBottom(edict_t* ent) start[0] = stop[0] = (mins[0] + maxs[0]) * 0.5; start[1] = stop[1] = (mins[1] + maxs[1]) * 0.5; stop[2] = start[2] - 2 * STEPSIZE; - trace = SV_MoveTrace(start, stop, true, ent); + trace_t trace = SV_MoveTrace(start, stop, true, ent); if(trace.fraction == 1.0) { return false; } + + float mid; + float bottom; mid = bottom = trace.endpos[2]; // the corners must be within 16 of the midpoint - for(x = 0; x <= 1; x++) + for(int x = 0; x <= 1; x++) { - for(y = 0; y <= 1; y++) + for(int y = 0; y <= 1; y++) { start[0] = stop[0] = x ? maxs[0] : mins[0]; start[1] = stop[1] = y ? maxs[1] : mins[1]; @@ -129,13 +126,11 @@ possible, no move is done, false is returned, and pr_global_struct->trace_normal is set to the normal of the blocking wall ============= */ -bool SV_movestep(edict_t* ent, glm::vec3 move, bool relink) +bool SV_movestep(edict_t* ent, qvec3 move, bool relink) { - - // try the move - glm::vec3 oldorg = ent->v.origin; - glm::vec3 neworg = ent->v.origin + move; + auto oldorg = ent->v.origin; + auto neworg = ent->v.origin + move; // flying monsters don't step up if(quake::util::hasAnyFlag(ent, FL_SWIM, FL_FLY)) @@ -192,7 +187,7 @@ bool SV_movestep(edict_t* ent, glm::vec3 move, bool relink) // push down from a step height above the wished position neworg[2] += STEPSIZE; - glm::vec3 end = neworg; + qvec3 end = neworg; end[2] -= STEPSIZE * 2; trace_t trace = SV_Move(neworg, ent->v.mins, ent->v.maxs, end, false, ent); @@ -281,9 +276,9 @@ facing it. void PF_changeyaw(); bool SV_StepDirection(edict_t* ent, float yaw, float dist) { - glm::vec3 move; + qvec3 move; - glm::vec3 oldorigin; + qvec3 oldorigin; float delta; ent->v.ideal_yaw = yaw; diff --git a/Quake/sv_phys.cpp b/Quake/sv_phys.cpp index b43b362f..49dca3a8 100644 --- a/Quake/sv_phys.cpp +++ b/Quake/sv_phys.cpp @@ -23,12 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // sv_phys.c #include "console.hpp" -#include "fwd.hpp" +#include <glm/fwd.hpp> #include "quakedef.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" #include "world.hpp" #include "util.hpp" #include "quakeglm.hpp" +#include "sys.hpp" #include <algorithm> #include <tuple> @@ -119,8 +121,8 @@ void SV_CheckVelocity(edict_t* ent) ent->v.origin[i] = 0; } - ent->v.velocity[i] = std::clamp( - ent->v.velocity[i], -sv_maxvelocity.value, sv_maxvelocity.value); + ent->v.velocity[i] = std::clamp(ent->v.velocity[i], + float(-sv_maxvelocity.value), float(sv_maxvelocity.value)); } } @@ -137,6 +139,11 @@ Returns false if the entity removed itself. template <auto TNextThink, auto TThink, bool TDoLerp> bool SV_RunThinkImpl(edict_t* ent) { + if(!((ent->v).*TThink)) + { + return !ent->free; + } + float thinktime = (ent->v).*TNextThink; if(thinktime <= 0 || thinktime > sv.time + host_frametime) { @@ -229,8 +236,8 @@ returns the blocked flags (1 = floor, 2 = step / wall) */ #define STOP_EPSILON 0.1 -int ClipVelocity(const glm::vec3& in, const glm::vec3& normal, glm::vec3& out, - float overbounce) +int ClipVelocity( + const qvec3& in, const qvec3& normal, qvec3& out, float overbounce) { int blocked = 0; @@ -260,21 +267,6 @@ int ClipVelocity(const glm::vec3& in, const glm::vec3& normal, glm::vec3& out, return blocked; } -static void doFakeHandtouch(edict_t* player, edict_t* target) -{ - VR_SetFakeHandtouchParams(player, target); - SV_Impact(player, target, &entvars_t::handtouch); -} - -static void doFakeHandtouchIfBodyInteractionsEnabled( - edict_t* player, edict_t* target) -{ - if(!vr_enabled.value || vr_body_interactions.value == 1) - { - doFakeHandtouch(player, target); - } -} - /* ============ SV_FlyMove @@ -292,11 +284,11 @@ int SV_FlyMove(edict_t* ent, float time, trace_t* steptrace) { constexpr int numbumps = 4; - const glm::vec3 primal_velocity = ent->v.velocity; + const auto primal_velocity = ent->v.velocity; - glm::vec3 planes[MAX_CLIP_PLANES]; - glm::vec3 original_velocity = ent->v.velocity; - glm::vec3 new_velocity; + qvec3 planes[MAX_CLIP_PLANES]; + qvec3 original_velocity = ent->v.velocity; + qvec3 new_velocity; float time_left = time; @@ -310,7 +302,7 @@ int SV_FlyMove(edict_t* ent, float time, trace_t* steptrace) break; } - const glm::vec3 end = ent->v.origin + time_left * ent->v.velocity; + const auto end = ent->v.origin + time_left * ent->v.velocity; trace_t trace = SV_Move(ent->v.origin, ent->v.mins, ent->v.maxs, end, false, ent); @@ -364,11 +356,6 @@ int SV_FlyMove(edict_t* ent, float time, trace_t* steptrace) // SV_Impact(ent, trace.ent, &entvars_t::touch); - // -------------------------------------------------------------------- - // VR: Simulate touching with right hand if body interactions are off. - doFakeHandtouchIfBodyInteractionsEnabled(ent, trace.ent); - // -------------------------------------------------------------------- - if(ent->free) { break; // removed by the impact function @@ -427,7 +414,7 @@ int SV_FlyMove(edict_t* ent, float time, trace_t* steptrace) } const auto dir = glm::cross(planes[0], planes[1]); - const float d = DotProduct(dir, ent->v.velocity); + const auto d = DotProduct(dir, ent->v.velocity); ent->v.velocity = dir * d; } @@ -486,7 +473,6 @@ static void SV_PushEntityImpact(edict_t* ent, const trace_t& trace) } SV_Impact(ent, trace.ent, &entvars_t::touch); - doFakeHandtouchIfBodyInteractionsEnabled(ent, trace.ent); } /* @@ -496,27 +482,27 @@ SV_PushEntity Does not change the entities velocity at all ============ */ -trace_t SV_PushEntity(edict_t* ent, const glm::vec3& push) +trace_t SV_PushEntity(edict_t* ent, const qvec3& push) { - const glm::vec3 end = ent->v.origin + push; + const auto start = ent->v.origin - push; + const auto end = ent->v.origin + push; trace_t trace; if(ent->v.movetype == MOVETYPE_FLYMISSILE) { - trace = SV_Move( - ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_MISSILE, ent); + trace = + SV_Move(start, ent->v.mins, ent->v.maxs, end, MOVE_MISSILE, ent); } else if(ent->v.solid == SOLID_TRIGGER || ent->v.solid == SOLID_NOT || ent->v.solid == SOLID_NOT_BUT_TOUCHABLE) { // only clip against bmodels - trace = SV_Move( - ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NOMONSTERS, ent); + trace = + SV_Move(start, ent->v.mins, ent->v.maxs, end, MOVE_NOMONSTERS, ent); } else { - trace = SV_Move( - ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent); + trace = SV_Move(start, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent); } ent->v.origin = trace.endpos; @@ -527,35 +513,6 @@ trace_t SV_PushEntity(edict_t* ent, const glm::vec3& push) return trace; } -[[nodiscard]] static bool checkGroundCollision(edict_t* ent, - trace_t& traceBuffer, glm::vec3& offsetBuffer, const glm::vec3& move, - const float xBias, const float yBias) -{ - const auto checkCorner = [&](const glm::vec3& pos) { - const glm::vec3 end = pos + move; - - traceBuffer = SV_MoveTrace(pos, end, MOVE_NOMONSTERS, ent); - - return quake::util::hitSomething(traceBuffer) && - quake::util::traceHitGround(traceBuffer); - }; - - const glm::vec3 bottomOrigin = ent->v.origin + ent->v.mins[2]; - - const auto left = ent->v.mins[0] + xBias; - const auto right = ent->v.maxs[0] - xBias; - const auto fwd = ent->v.mins[1] + yBias; - const auto back = ent->v.maxs[1] - yBias; - - const auto testCorner = [&](const float x, const float y) { - offsetBuffer = glm::vec3{x, y, 0.f}; - return checkCorner(bottomOrigin + offsetBuffer); - }; - - return testCorner(left, fwd) || testCorner(left, back) || - testCorner(right, fwd) || testCorner(right, back); -} - /* ============ SV_PushMove @@ -563,6 +520,14 @@ SV_PushMove */ void SV_PushMove(edict_t* pusher, float movetime) { + // When changing this, test the following: + // * Lift in E1M1 + // * Platform (controlled by button) in E1M1 + // * Crusher in E1M3 + // * Big doors in E1M3 + // * Slow elevator in E2M6 + // * Crusher in HIP3M4 + if(!pusher->v.velocity[0] && !pusher->v.velocity[1] && !pusher->v.velocity[2]) { @@ -570,11 +535,11 @@ void SV_PushMove(edict_t* pusher, float movetime) return; } - const glm::vec3 move = pusher->v.velocity * movetime; - const glm::vec3 pusherNewMins = pusher->v.absmin + move; - const glm::vec3 pusherNewMaxs = pusher->v.absmax + move; + const auto move = pusher->v.velocity * movetime; + const auto pusherNewMins = pusher->v.absmin + move; + const auto pusherNewMaxs = pusher->v.absmax + move; - const glm::vec3 oldPushorig = pusher->v.origin; + const auto oldPushorig = pusher->v.origin; // move the pusher to it's final position @@ -585,7 +550,7 @@ void SV_PushMove(edict_t* pusher, float movetime) // johnfitz -- dynamically allocate const int mark = Hunk_LowMark(); // johnfitz const auto moved_edict = Hunk_Alloc<edict_t*>(sv.num_edicts); - const auto moved_from = Hunk_Alloc<glm::vec3>(sv.num_edicts); + const auto moved_from = Hunk_Alloc<qvec3>(sv.num_edicts); // johnfitz // see if any solid entities are inside the final position @@ -617,17 +582,17 @@ void SV_PushMove(edict_t* pusher, float movetime) // see if the ent's bbox is inside the pusher's final position - const glm::vec3 minBottom{0.f, 0.f, -1.f}; + const qvec3 minBottom{0.f, 0.f, -1.f}; const bool checkIntoSolid = SV_TestEntityPositionCustomOrigin(check, check->v.origin); trace_t traceBuffer; - glm::vec3 offsetBuffer; + qvec3 offsetBuffer; const bool checkOnTopOfPusher = - checkGroundCollision( - check, traceBuffer, offsetBuffer, minBottom, 0.f, 0.f) && + quake::util::checkGroundCollision(MOVE_NOMONSTERS, check, + traceBuffer, offsetBuffer, minBottom, 0.f, 0.f) && traceBuffer.ent == pusher; if(!checkIntoSolid && !checkOnTopOfPusher) @@ -642,7 +607,7 @@ void SV_PushMove(edict_t* pusher, float movetime) quake::util::removeFlag(check, FL_ONGROUND); } - const glm::vec3 entorig = check->v.origin; + const qvec3 entorig = check->v.origin; moved_from[num_moved] = check->v.origin; moved_edict[num_moved] = check; ++num_moved; @@ -658,22 +623,22 @@ void SV_PushMove(edict_t* pusher, float movetime) check->v.groundentity = EDICT_TO_PROG(pusher); } - const auto checkBlockScaled = [&](edict_t* ent, const float xf, - const float yf) { - const auto nmins = ent->v.mins * glm::vec3{xf, xf, yf}; - const auto nmaxs = ent->v.maxs * glm::vec3{xf, xf, yf}; + const auto checkBlock = [&](edict_t* ent, qvec3 adjUpMove) { + if(adjUpMove[2] < 0) + { + adjUpMove[2] *= -1.f; + } - const trace_t trace = SV_Move( - ent->v.origin, nmins, nmaxs, ent->v.origin, MOVE_NORMAL, ent); + const trace_t trace = + SV_Move(ent->v.origin + adjUpMove, ent->v.mins, ent->v.maxs, + ent->v.origin + adjUpMove, MOVE_NORMAL, ent); - return trace.startsolid ? sv.edicts : nullptr; + return trace.startsolid; }; // if it is still inside the pusher, block - const auto maxHMove = std::max(std::abs(move.x), std::abs(move.y)); - const bool verticalMove = std::abs(move.z) > maxHMove; - edict_t* const block = - checkBlockScaled(check, 1.f, verticalMove ? 0.95f : 1.f); + const bool block = checkBlock(check, move); + if(block) { // fail the move @@ -788,7 +753,7 @@ void SV_CheckStuck(edict_t* ent) return; } - const glm::vec3 org = ent->v.origin; + const qvec3 org = ent->v.origin; ent->v.origin = ent->v.oldorigin; if(!SV_TestEntityPosition(ent)) @@ -804,7 +769,7 @@ void SV_CheckStuck(edict_t* ent) { for(int j = -1; j <= 1; j++) { - ent->v.origin = org + glm::vec3{i, j, z}; + ent->v.origin = org + qvec3{i, j, z}; if(!SV_TestEntityPosition(ent)) { @@ -830,7 +795,7 @@ bool SV_CheckWater(edict_t* ent) { const auto prevWaterlevel = ent->v.waterlevel; - glm::vec3 point = ent->v.origin; + qvec3 point = ent->v.origin; point[2] += ent->v.mins[2] + 1; ent->v.waterlevel = 0; @@ -874,18 +839,18 @@ SV_WallFriction void SV_WallFriction(edict_t* ent, trace_t* trace) { const auto fwd = quake::util::getFwdVecFromPitchYawRoll(ent->v.v_angle); - float d = DotProduct(trace->plane.normal, fwd); + qfloat d = DotProduct(trace->plane.normal, fwd); - d += 0.5; + d += 0.5_qf; if(d >= 0) { return; } // cut the tangential velocity - float i = DotProduct(trace->plane.normal, ent->v.velocity); - const glm::vec3 into = trace->plane.normal * i; - const glm::vec3 side = ent->v.velocity - into; + const auto i = DotProduct(trace->plane.normal, ent->v.velocity); + const auto into = trace->plane.normal * i; + const auto side = ent->v.velocity - qvec3(into); ent->v.velocity[0] = side[0] * (1 + d); ent->v.velocity[1] = side[1] * (1 + d); @@ -903,10 +868,10 @@ Try fixing by pushing one pixel in each direction. This is a hack, but in the interest of good gameplay... ====================== */ -int SV_TryUnstick(edict_t* ent, glm::vec3 oldvel) +int SV_TryUnstick(edict_t* ent, qvec3 oldvel) { - glm::vec3 oldorg; - glm::vec3 dir; + qvec3 oldorg; + qvec3 dir; int clip; trace_t steptrace; @@ -994,8 +959,8 @@ void SV_WalkMove(edict_t* ent, const bool resetOnGround) quake::util::removeFlag(ent, FL_ONGROUND); } - const glm::vec3 oldorg = ent->v.origin; - const glm::vec3 oldvel = ent->v.velocity; + const qvec3 oldorg = ent->v.origin; + const qvec3 oldvel = ent->v.velocity; trace_t steptrace; int clip = SV_FlyMove(ent, host_frametime, &steptrace); @@ -1025,8 +990,8 @@ void SV_WalkMove(edict_t* ent, const bool resetOnGround) return; } - const glm::vec3 nosteporg = ent->v.origin; - const glm::vec3 nostepvel = ent->v.velocity; + const qvec3 nosteporg = ent->v.origin; + const qvec3 nostepvel = ent->v.velocity; // // try moving up and forward to go up a step @@ -1034,8 +999,8 @@ void SV_WalkMove(edict_t* ent, const bool resetOnGround) ent->v.origin = oldorg; // back to start pos constexpr float stepsize = 18.f; - const glm::vec3 upmove{0.f, 0.f, stepsize}; - const glm::vec3 downmove{0.f, 0.f, -stepsize + oldvel[2] * host_frametime}; + const qvec3 upmove{0.f, 0.f, stepsize}; + const qvec3 downmove{0.f, 0.f, -stepsize + oldvel[2] * host_frametime}; // move up SV_PushEntity(ent, upmove); // FIXME: don't link? @@ -1099,7 +1064,7 @@ void SV_Handtouch(edict_t* ent) // TODO VR: (P2) cleanup, too much unnecessary tracing and work // Utility constants - const glm::vec3 handOffsets{2.5f, 2.5f, 2.5f}; + const qvec3 handOffsets{2.5f, 2.5f, 2.5f}; // Figure out tracing boundaries // (Largest possible volume containing the hands and the player) @@ -1118,17 +1083,17 @@ void SV_Handtouch(edict_t* ent) const auto offHandAbsMin = offHandOrigin - handOffsets; const auto offHandAbsMax = offHandOrigin + handOffsets; - const glm::vec3 minBound{ + const qvec3 minBound{ std::min({playerAbsMin.x, mainHandAbsMin.x, offHandAbsMin.x}), std::min({playerAbsMin.y, mainHandAbsMin.y, offHandAbsMin.y}), std::min({playerAbsMin.z, mainHandAbsMin.z, offHandAbsMin.z})}; - const glm::vec3 maxBound{ + const qvec3 maxBound{ std::max({playerAbsMax.x, mainHandAbsMax.x, offHandAbsMax.x}), std::max({playerAbsMax.y, mainHandAbsMax.y, offHandAbsMax.y}), std::max({playerAbsMax.z, mainHandAbsMax.z, offHandAbsMax.z})}; - const auto halfSize = (maxBound - minBound) / 2.f; + const auto halfSize = (maxBound - minBound) / 2._qf; const auto origin = minBound + halfSize; return std::tuple{origin, -halfSize, +halfSize}; }(); @@ -1140,20 +1105,20 @@ void SV_Handtouch(edict_t* ent) } const auto handCollisionCheck = [&](const int hand, - const glm::vec3& handPos) { + const qvec3& handPos) { const float bonus = (quake::util::hasFlag(trace.ent, FL_EASYHANDTOUCH)) ? VR_GetEasyHandTouchBonus() : 0.f; - const glm::vec3 bonusVec{bonus, bonus, bonus}; + const qvec3 bonusVec{bonus, bonus, bonus}; - const glm::vec3 aMin = + const auto aMin = trace.ent->v.origin + trace.ent->v.mins - bonusVec; - const glm::vec3 aMax = + const auto aMax = trace.ent->v.origin + trace.ent->v.maxs + bonusVec; - const glm::vec3 bMin = handPos - handOffsets; - const glm::vec3 bMax = handPos + handOffsets; + const auto bMin = handPos - handOffsets; + const auto bMax = handPos + handOffsets; if(quake::util::boxIntersection(aMin, aMax, bMin, bMax)) { @@ -1166,10 +1131,9 @@ void SV_Handtouch(edict_t* ent) handCollisionCheck(cVR_MainHand, ent->v.handpos); }; - const auto endHandPos = [&](const glm::vec3& handPos, - const glm::vec3& handRot) { + const auto endHandPos = [&](const qvec3& handPos, const qvec3& handRot) { const auto fwd = quake::util::getFwdVecFromPitchYawRoll(handRot); - return handPos + fwd * 1.f; + return handPos + fwd * 1._qf; }; const auto mainHandEnd = endHandPos(ent->v.handpos, ent->v.handrot); @@ -1182,10 +1146,9 @@ void SV_Handtouch(edict_t* ent) ent->v.origin, ent->v.mins, ent->v.maxs, offHandEnd, MOVE_NORMAL, ent)); traceCheck(SV_Move(origin, mins, maxs, offHandEnd, MOVE_NORMAL, ent)); - const auto traceForHand = [&](const glm::vec3& handPos, - const glm::vec3& handRot) { + const auto traceForHand = [&](const qvec3& handPos, const qvec3& handRot) { const auto fwd = quake::util::getFwdVecFromPitchYawRoll(handRot); - const auto end = handPos + fwd * 1.f; + const auto end = handPos + fwd * 1._qf; return SV_Move( handPos, -handOffsets, handOffsets, end, MOVE_NORMAL, ent); @@ -1199,17 +1162,18 @@ void SV_VRWpntouch(edict_t* ent) { // TODO VR: (P2) code repetition with vr.cpp setHandPos - const auto doHand = [&](const int handIndex) { + const auto doHand = [&](const HandIdx handIndex) { const auto& playerOrigin = ent->v.origin; const auto worldHandPos = VR_GetWorldHandPos(handIndex, playerOrigin); const auto adjPlayerOrigin = VR_GetAdjustedPlayerOrigin(playerOrigin); const auto resolvedHandPos = - VR_GetResolvedHandPos(worldHandPos, adjPlayerOrigin); + VR_GetResolvedHandPos(ent, worldHandPos, adjPlayerOrigin); VrGunWallCollision collisionData; - VR_UpdateGunWallCollisions(handIndex, collisionData, resolvedHandPos); + VR_UpdateGunWallCollisions( + ent, handIndex, collisionData, resolvedHandPos); if(collisionData._ent != nullptr && collisionData._ent->v.vr_wpntouch) { @@ -1259,7 +1223,7 @@ void SV_Physics_Client(edict_t* ent, int num) // // decide which move function to call // - if(ent->v.teleporting == 1) + if(quake::util::hasFlag(ent->v.vrbits0, QVR_VRBITS0_TELEPORTING)) { if(!SV_RunThink(ent)) { @@ -1525,13 +1489,13 @@ void SV_Physics_Toss(edict_t* ent) vel[2] -= SV_AddGravityImpl(ent); } - const glm::vec3 move = vel * static_cast<float>(host_frametime); + const qvec3 move = vel * static_cast<float>(host_frametime); trace_t traceBuffer; - glm::vec3 offsetBuffer; + qvec3 offsetBuffer; - if(!checkGroundCollision( - ent, traceBuffer, offsetBuffer, move, 0.f, 0.f)) + if(!quake::util::checkGroundCollision(MOVE_NOMONSTERS, ent, traceBuffer, + offsetBuffer, move, 0._qf, 0._qf)) { if(quake::util::hasFlag(ent, FL_ONGROUND)) { @@ -1542,7 +1506,7 @@ void SV_Physics_Toss(edict_t* ent) else { const float backoff = - ent->v.movetype == MOVETYPE_BOUNCE ? 1.5f : 1.f; + ent->v.movetype == MOVETYPE_BOUNCE ? 1.5_qf : 1._qf; ClipVelocity(ent->v.velocity, traceBuffer.plane.normal, ent->v.velocity, backoff); @@ -1555,8 +1519,8 @@ void SV_Physics_Toss(edict_t* ent) ent->v.groundentity = EDICT_TO_PROG(traceBuffer.ent); ent->v.velocity = ent->v.avelocity = vec3_zero; - ent->v.origin = - traceBuffer.endpos - ent->v.mins[2] - offsetBuffer; + ent->v.origin = qvec3(traceBuffer.endpos) - + ent->v.mins[2] - qvec3(offsetBuffer); SV_LinkEdict(ent, true); SV_PushEntityImpact(ent, traceBuffer); @@ -1580,7 +1544,7 @@ void SV_Physics_Toss(edict_t* ent) ent->v.angles += static_cast<float>(host_frametime) * ent->v.avelocity; // move origin - const glm::vec3 move = ent->v.velocity * static_cast<float>(host_frametime); + const qvec3 move = ent->v.velocity * static_cast<float>(host_frametime); const trace_t trace = SV_PushEntity(ent, move); if(quake::util::hitSomething(trace) && !ent->free) diff --git a/Quake/sv_user.cpp b/Quake/sv_user.cpp index d71534a4..43f5e8c3 100644 --- a/Quake/sv_user.cpp +++ b/Quake/sv_user.cpp @@ -26,6 +26,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "vr.hpp" #include "world.hpp" #include "util.hpp" +#include "q_stdinc.hpp" +#include "net.hpp" +#include "keys.hpp" +#include "msg.hpp" +#include "sys.hpp" +#include "console.hpp" +#include "vid.hpp" +#include "draw.hpp" +#include "screen.hpp" +#include "view.hpp" +#include "cmd.hpp" + #include <iostream> edict_t* sv_player{nullptr}; @@ -34,11 +46,11 @@ extern cvar_t sv_friction; cvar_t sv_edgefriction = {"edgefriction", "2", CVAR_NONE}; extern cvar_t sv_stopspeed; -static glm::vec3 forward, right, up; +static qvec3 forward, right, up; // world -glm::vec3* origin{nullptr}; -glm::vec3* velocity{nullptr}; +qvec3* origin{nullptr}; +qvec3* velocity{nullptr}; bool onground; @@ -61,9 +73,9 @@ void SV_SetIdealPitch() float cosval; trace_t tr; - glm::vec3 top; + qvec3 top; - glm::vec3 bottom; + qvec3 bottom; float z[MAX_FORWARD]; int i; @@ -148,15 +160,15 @@ SV_UserFriction */ void SV_UserFriction() { - glm::vec3* vel; + qvec3* vel; float speed; float newspeed; float control; - glm::vec3 start; + qvec3 start; - glm::vec3 stop; + qvec3 stop; float friction; trace_t trace; @@ -205,7 +217,7 @@ SV_Accelerate cvar_t sv_maxspeed = {"sv_maxspeed", "320", CVAR_NOTIFY | CVAR_SERVERINFO}; cvar_t sv_accelerate = {"sv_accelerate", "10", CVAR_NONE}; -void SV_Accelerate(float wishspeed, const glm::vec3& wishdir) +void SV_Accelerate(float wishspeed, const qvec3& wishdir) { const float currentspeed = DotProduct((*velocity), wishdir); const float addspeed = wishspeed - currentspeed; @@ -227,7 +239,7 @@ void SV_Accelerate(float wishspeed, const glm::vec3& wishdir) } } -void SV_AirAccelerate(float wishspeed, const glm::vec3& wishveloc) +void SV_AirAccelerate(float wishspeed, const qvec3& wishveloc) { float wishspd = glm::length(wishveloc); @@ -281,7 +293,7 @@ SV_WaterMove void SV_WaterMove() { int i; - glm::vec3 wishvel; + qvec3 wishvel; float speed; float newspeed; @@ -295,8 +307,11 @@ void SV_WaterMove() // // user intentions // + + // TODO VR: (P1) this should probably change depending on the chosen + // locomotion style, std::tie(forward, right, up) = - quake::util::getAngledVectors(sv_player->v.v_angle); + quake::util::getAngledVectors(sv_player->v.v_viewangle); for(i = 0; i < 3; i++) { @@ -387,6 +402,8 @@ new, alternate noclip. old noclip is still handled in SV_AirMove */ void SV_NoclipMove() { + // TODO VR: (P1) this should probably change depending on the chosen + // locomotion style std::tie(forward, right, up) = quake::util::getAngledVectors(sv_player->v.v_angle); @@ -409,11 +426,13 @@ SV_AirMove */ void SV_AirMove() { + // TODO VR: (P1) this should probably change depending on the chosen + // locomotion style std::tie(forward, right, up) = - quake::util::getAngledVectors(VR_GetHeadAngles()); + quake::util::getAngledVectors(sv_player->v.v_viewangle); - float fmove = cmd.forwardmove; - const float smove = cmd.sidemove; + qfloat fmove = cmd.forwardmove; + const qfloat smove = cmd.sidemove; // hack to not let you back into teleporter if(sv.time < sv_player->v.teleport_time && fmove < 0) @@ -421,7 +440,7 @@ void SV_AirMove() fmove = 0; } - glm::vec3 wishvel = forward * fmove + right * smove; + qvec3 wishvel = forward * fmove + right * smove; if((int)sv_player->v.movetype != MOVETYPE_WALK) { @@ -492,7 +511,7 @@ void SV_ClientThink() // show 1/3 the pitch angle and all the roll angle cmd = host_client->cmd; - glm::vec3 v_angle; + qvec3 v_angle; v_angle = sv_player->v.v_angle + sv_player->v.punchangle; sv_player->v.angles[ROLL] = V_CalcRoll(sv_player->v.angles, sv_player->v.velocity) * 4; @@ -559,9 +578,7 @@ void SV_ReadClientMove(usercmd_t* move) } }; - const auto readVec = [&]() -> glm::vec3 { - return {MSG_ReadFloat(), MSG_ReadFloat(), MSG_ReadFloat()}; - }; + const auto readVec = [&] { return MSG_ReadVec3(sv.protocolflags); }; // aimangles readAngles(host_client->edict->v.v_angle); @@ -569,6 +586,9 @@ void SV_ReadClientMove(usercmd_t* move) // viewangles readAngles(host_client->edict->v.v_viewangle); + // vr yaw + host_client->edict->v.vryaw = move->vryaw = MSG_ReadFloat(); + // ------------------------------------------------------------------------ // main hand values: host_client->edict->v.handpos = move->handpos = readVec(); @@ -589,34 +609,31 @@ void SV_ReadClientMove(usercmd_t* move) host_client->edict->v.offhandavel = move->offhandavel = readVec(); // ------------------------------------------------------------------------ + // headvel + host_client->edict->v.headvel = move->headvel = readVec(); + // muzzlepos host_client->edict->v.muzzlepos = move->muzzlepos = readVec(); // offmuzzlepos host_client->edict->v.offmuzzlepos = move->offmuzzlepos = readVec(); + // vrbits + host_client->edict->v.vrbits0 = move->vrbits0 = MSG_ReadUnsignedChar(); + // movement move->forwardmove = MSG_ReadShort(); move->sidemove = MSG_ReadShort(); move->upmove = MSG_ReadShort(); // teleportation - host_client->edict->v.teleporting = move->teleporting = MSG_ReadShort(); host_client->edict->v.teleport_target = move->teleport_target = readVec(); // hands - host_client->edict->v.offhand_grabbing = move->offhand_grabbing = - MSG_ReadShort(); - host_client->edict->v.offhand_prevgrabbing = move->offhand_prevgrabbing = - MSG_ReadShort(); - host_client->edict->v.mainhand_grabbing = move->mainhand_grabbing = - MSG_ReadShort(); - host_client->edict->v.mainhand_prevgrabbing = move->mainhand_prevgrabbing = - MSG_ReadShort(); host_client->edict->v.offhand_hotspot = move->offhand_hotspot = - MSG_ReadShort(); + MSG_ReadByte(); host_client->edict->v.mainhand_hotspot = move->mainhand_hotspot = - MSG_ReadShort(); + MSG_ReadByte(); // roomscalemove host_client->edict->v.roomscalemove = move->roomscalemove = readVec(); @@ -653,7 +670,8 @@ bool SV_ReadClientMessage() ret = NET_GetMessage(host_client->netconnection); if(ret == -1) { - Sys_Printf("SV_ReadClientMessage: NET_GetMessage failed\n"); + Sys_Printf( + "SV_ReadClientMessage: NET_GetMessage failed. rc= %d\n", ret); return false; } if(!ret) diff --git a/Quake/sys.hpp b/Quake/sys.hpp index 9dd874ee..dcc42376 100644 --- a/Quake/sys.hpp +++ b/Quake/sys.hpp @@ -20,12 +20,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_SYS_H -#define _QUAKE_SYS_H +#pragma once + +#include "q_stdinc.hpp" // sys.h -- non-portable functions -void Sys_Init(void); +void Sys_Init(); // // file IO @@ -46,7 +47,7 @@ void Sys_mkdir(const char* path); // // system IO // -[[noreturn]] void Sys_Quit(void); +[[noreturn]] void Sys_Quit(); [[noreturn]] void Sys_Error(const char* error, ...) FUNC_PRINTF(1, 2); // an error will cause the entire program to exit #ifdef __WATCOMC__ @@ -57,14 +58,12 @@ void Sys_mkdir(const char* path); void Sys_Printf(const char* fmt, ...) FUNC_PRINTF(1, 2); // send text to the console -double Sys_DoubleTime(void); +double Sys_DoubleTime(); -const char* Sys_ConsoleInput(void); +const char* Sys_ConsoleInput(); void Sys_Sleep(unsigned long msecs); // yield for about 'msecs' milliseconds. -void Sys_SendKeyEvents(void); +void Sys_SendKeyEvents(); // Perform Key_Event () callbacks until the input que is empty - -#endif /* _QUAKE_SYS_H */ diff --git a/Quake/sys_sdl_unix.cpp b/Quake/sys_sdl_unix.cpp index 88cc4fcf..4eb2df17 100644 --- a/Quake/sys_sdl_unix.cpp +++ b/Quake/sys_sdl_unix.cpp @@ -22,8 +22,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "host.hpp" #include "arch_def.hpp" #include "quakedef.hpp" +#include "platform.hpp" +#include "quakeparms.hpp" #include <sys/types.h> #include <errno.h> @@ -39,16 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <pwd.h> #endif -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) #include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif - bool isDedicated; cvar_t sys_throttle = {"sys_throttle", "0.02", CVAR_ARCHIVE}; @@ -398,7 +392,13 @@ void Sys_Quit(void) double Sys_DoubleTime(void) { + // QSS +#if 1 + return SDL_GetPerformanceCounter() / + (long double)SDL_GetPerformanceFrequency(); +#else return SDL_GetTicks() / 1000.0; +#endif } const char* Sys_ConsoleInput(void) diff --git a/Quake/sys_sdl_win.cpp b/Quake/sys_sdl_win.cpp index 196cd0b1..8edb63c9 100644 --- a/Quake/sys_sdl_win.cpp +++ b/Quake/sys_sdl_win.cpp @@ -25,26 +25,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif + #include <windows.h> #include <mmsystem.h> +#include "host.hpp" #include "quakedef.hpp" +#include "quakeparms.hpp" +#include "platform.hpp" +#include "common.hpp" +#include "input.hpp" +#include "sys.hpp" #include <sys/types.h> #include <errno.h> #include <io.h> #include <direct.h> -#if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) -#if defined(USE_SDL2) -#include <SDL2/SDL.h> -#else -#include <SDL/SDL.h> -#endif -#else -#include "SDL.h" -#endif +#include <string> +#include <SDL2/SDL.h> bool isDedicated; bool Win95, Win95old, WinNT, WinVista; @@ -251,6 +251,30 @@ static void Sys_SetTimerResolution() timeBeginPeriod(1); } +// Returns the last Win32 error, in string format. Returns an empty string if +// there is no error. +static std::string GetLastErrorAsString() +{ + // Get the error message, if any. + DWORD errorMessageID = ::GetLastError(); + if(errorMessageID == 0) + return std::string(); // No error message has been recorded + + LPSTR messageBuffer = nullptr; + size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&messageBuffer, 0, NULL); + + std::string message(messageBuffer, size); + + // Free the buffer. + LocalFree(messageBuffer); + + return message; +} + void Sys_Init() { OSVERSIONINFO vinfo; @@ -313,10 +337,11 @@ void Sys_Init() if(isDedicated) { - if(!AllocConsole()) + if(false && !AllocConsole()) { isDedicated = false; /* so that we have a graphical error dialog */ - Sys_Error("Couldn't create dedicated server console"); + Sys_Error("Couldn't create dedicated server console: '%s'", + GetLastErrorAsString().data()); } hinput = GetStdHandle(STD_INPUT_HANDLE); diff --git a/Quake/util.hpp b/Quake/util.hpp index c33ee36f..e2a7ce92 100644 --- a/Quake/util.hpp +++ b/Quake/util.hpp @@ -1,13 +1,23 @@ #pragma once #ifdef WIN32 +#include <windows.h> #include "debugapi.h" + +#undef min +#undef max #endif #include "q_stdinc.hpp" #include "cvar.hpp" #include "mathlib.hpp" #include "quakeglm.hpp" +#include "macros.hpp" +#include "progs.hpp" +#include "world.hpp" +#include "server.hpp" + +#include <GL/glew.h> #include <array> #include <algorithm> @@ -19,174 +29,198 @@ #include <sstream> #include <variant> -#if !defined(QUAKE_FORCEINLINE) -#if defined(_MSC_VER) -#define QUAKE_FORCEINLINE __forceinline -#elif defined(__GNUC__) && __GNUC__ > 3 -// Clang also defines __GNUC__ (as 4) -#define QUAKE_FORCEINLINE inline __attribute__((__always_inline__)) -#else -#define QUAKE_FORCEINLINE inline -#endif -#endif - // TODO VR: (P2) ugly declaration float VR_GetMenuMult() noexcept; namespace quake::util { - template <typename T> - [[nodiscard]] constexpr T mapRange(const T input, const T inputMin, - const T inputMax, const T outputMin, const T outputMax) noexcept - { - const T slope = - T(1.0) * (outputMax - outputMin) / (inputMax - inputMin); - - return outputMin + slope * (input - inputMin); - } - template <typename T> - [[nodiscard]] T cvarToEnum(const cvar_t& x) noexcept - { - return static_cast<T>(static_cast<int>(x.value)); - } +template <typename T> +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr T mapRange(const T input, + const T inputMin, const T inputMax, const T outputMin, + const T outputMax) noexcept +{ + const T slope = T(1.0) * (outputMax - outputMin) / (inputMax - inputMin); - template <typename... Ts> - [[nodiscard]] std::string stringCat(const Ts&... xs) - { - std::ostringstream oss; - (oss << ... << xs); - return oss.str(); - } + return outputMin + slope * (input - inputMin); +} - template <typename T, typename... Ts> - [[nodiscard]] std::string stringCatSeparated( - const std::string_view separator, const T& x, const Ts&... xs) - { - std::ostringstream oss; - oss << x; - ((oss << separator << xs), ...); - return oss.str(); - } +template <typename T> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN T cvarToEnum(const cvar_t& x) noexcept +{ + return static_cast<T>(static_cast<int>(x.value)); +} - template <typename... Ts> - void debugPrint([[maybe_unused]] const Ts&... xs) - { +template <typename... Ts> +[[nodiscard]] std::string stringCat(const Ts&... xs) +{ + std::ostringstream oss; + (oss << ... << xs); + return oss.str(); +} + +template <typename T, typename... Ts> +[[nodiscard]] std::string stringCatSeparated( + const std::string_view separator, const T& x, const Ts&... xs) +{ + std::ostringstream oss; + oss << x; + ((oss << separator << xs), ...); + return oss.str(); +} + +template <typename... Ts> +void debugPrint([[maybe_unused]] const Ts&... xs) +{ #ifdef WIN32 - OutputDebugStringA(stringCat(xs...).data()); + OutputDebugStringA(stringCat(xs...).data()); #endif - } +} - template <typename... Ts> - void debugPrintSeparated([[maybe_unused]] const std::string_view separator, - [[maybe_unused]] const Ts&... xs) - { +template <typename... Ts> +void debugPrintSeparated([[maybe_unused]] const std::string_view separator, + [[maybe_unused]] const Ts&... xs) +{ #ifdef WIN32 - OutputDebugStringA(stringCatSeparated(separator, xs...).data()); + OutputDebugStringA(stringCatSeparated(separator, xs...).data()); #endif - } +} - template <typename TVec3AMin, typename TVec3AMax, typename TVec3BMin, - typename TVec3BMax> - [[nodiscard]] constexpr QUAKE_FORCEINLINE bool boxIntersection( - const TVec3AMin& aMin, const TVec3AMax& aMax, const TVec3BMin& bMin, - const TVec3BMax& bMax) noexcept - { - return aMin[0] <= bMax[0] && // - aMin[1] <= bMax[1] && // - aMin[2] <= bMax[2] && // - aMax[0] >= bMin[0] && // - aMax[1] >= bMin[1] && // - aMax[2] >= bMin[2]; - } +template <typename TVec3AMin, typename TVec3AMax, typename TVec3BMin, + typename TVec3BMax> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN constexpr bool boxIntersection( + const TVec3AMin& aMin, const TVec3AMax& aMax, const TVec3BMin& bMin, + const TVec3BMax& bMax) noexcept +{ + return aMin[0] <= bMax[0] && // + aMin[1] <= bMax[1] && // + aMin[2] <= bMax[2] && // + aMax[0] >= bMin[0] && // + aMax[1] >= bMin[1] && // + aMax[2] >= bMin[2]; +} + +template <typename TEntA, typename TEntB> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN constexpr bool entBoxIntersection( + const TEntA& entA, const TEntB& entB) noexcept +{ + return boxIntersection( + entA->v.absmin, entA->v.absmax, entB->v.absmin, entB->v.absmax); +} - template <typename TEntA, typename TEntB> - [[nodiscard]] constexpr QUAKE_FORCEINLINE bool entBoxIntersection( - const TEntA& entA, const TEntB& entB) noexcept - { - return boxIntersection( - entA->v.absmin, entA->v.absmax, entB->v.absmin, entB->v.absmax); - } +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN double lerp( + double a, double b, double f) noexcept +{ + return (a * (1.0 - f)) + (b * f); +} - [[nodiscard]] QUAKE_FORCEINLINE double lerp( - double a, double b, double f) noexcept - { - return (a * (1.0 - f)) + (b * f); - } +template <typename T> +[[nodiscard]] QUAKE_FORCEINLINE constexpr auto safeAsin(const T x) noexcept +{ + assert(!std::isnan(x)); + assert(x >= T(-1)); + assert(x <= T(1)); - template <typename T> - [[nodiscard]] constexpr QUAKE_FORCEINLINE auto safeAsin(const T x) noexcept - { - assert(!std::isnan(x)); - assert(x >= T(-1)); - assert(x <= T(1)); + return std::asin(x); +} - return std::asin(x); - } +template <typename T> +[[nodiscard]] QUAKE_FORCEINLINE constexpr auto safeAtan2( + const T y, const T x) noexcept +{ + assert(!std::isnan(y)); + assert(!std::isnan(x)); + assert(y != T(0) || x != T(0)); - template <typename T> - [[nodiscard]] constexpr QUAKE_FORCEINLINE auto safeAtan2( - const T y, const T x) noexcept - { - assert(!std::isnan(y)); - assert(!std::isnan(x)); - assert(y != T(0) || x != T(0)); + return std::atan2(y, x); +} - return std::atan2(y, x); - } +[[nodiscard]] inline qvec3 pitchYawRollFromDirectionVector( + const qvec3& up, const qvec3& dir) +{ + // From: https://stackoverflow.com/a/21627251/598696 - [[nodiscard]] inline glm::vec3 pitchYawRollFromDirectionVector( - const glm::vec3& up, const glm::vec3& dir) - { - // From: https://stackoverflow.com/a/21627251/598696 + const auto pitch = safeAsin(dir[2]); + const auto yaw = safeAtan2(dir[1], dir[0]); - const auto pitch = safeAsin(dir[2]); - const auto yaw = safeAtan2(dir[1], dir[0]); + const auto w0 = qvec3{-dir[1], dir[0], 0}; + const auto u0 = glm::cross(w0, dir); - const auto w0 = glm::vec3{-dir[1], dir[0], 0}; - const auto u0 = glm::cross(w0, dir); + const auto w0len = glm::length(w0); + assert(w0len != 0); - const auto w0len = glm::length(w0); - assert(w0len != 0); + const auto u0len = glm::length(u0); + assert(u0len != 0); - const auto u0len = glm::length(u0); - assert(u0len != 0); + const auto roll = + safeAtan2(glm::dot(w0, up) / w0len, glm::dot(u0, up) / u0len); - const auto roll = - safeAtan2(glm::dot(w0, up) / w0len, glm::dot(u0, up) / u0len); + auto res = glm::degrees(qvec3{pitch, yaw, roll}); + res[0 /* PITCH */] *= -1.f; + res[2 /* ROLL */] -= 180.f; + return res; +} - auto res = glm::degrees(glm::vec3{pitch, yaw, roll}); - res[0 /* PITCH */] *= -1.f; - res[2 /* ROLL */] -= 180.f; - return res; - } +[[nodiscard]] QUAKE_FORCEINLINE std::tuple<qvec3, qvec3, qvec3> +getAngledVectors(const qvec3& v) noexcept +{ + const auto yawRadians = glm::radians(v[YAW]); + assert(!std::isnan(yawRadians)); + assert(!std::isinf(yawRadians)); - [[nodiscard]] QUAKE_FORCEINLINE std::tuple<glm::vec3, glm::vec3, glm::vec3> - getAngledVectors(const glm::vec3& v) noexcept - { - glm::vec3 forward, right, up; - AngleVectors(v, forward, right, up); - return std::tuple{forward, right, up}; - } + const auto sy = std::sin(yawRadians); + const auto cy = std::cos(yawRadians); - [[nodiscard]] QUAKE_FORCEINLINE glm::vec3 - getDirectionVectorFromPitchYawRoll(const glm::vec3& v) noexcept - { - return AngleVectorsOnlyFwd(v); - } + const auto pitchRadians = glm::radians(v[PITCH]); + assert(!std::isnan(pitchRadians)); + assert(!std::isinf(pitchRadians)); - // TODO VR: (P2) same as above, use one or the other - [[nodiscard]] QUAKE_FORCEINLINE glm::vec3 getFwdVecFromPitchYawRoll( - const glm::vec3& v) noexcept - { - return AngleVectorsOnlyFwd(v); - } + const auto sp = std::sin(pitchRadians); + const auto cp = std::cos(pitchRadians); - template <typename T> - [[nodiscard]] auto makeMenuAdjuster(const bool isLeft) - { - return [isLeft]( - const cvar_t& cvar, const T incr, const T min, const T max) { + const auto rollRadians = glm::radians(v[ROLL]); + assert(!std::isnan(rollRadians)); + assert(!std::isinf(rollRadians)); + + const auto sr = std::sin(rollRadians); + const auto cr = std::cos(rollRadians); + + const qvec3 forward{// + cp * cy, // + cp * sy, // + -sp}; + + const qvec3 right{ // + (-1.f * sr * sp * cy + -1.f * cr * -sy), // + (-1.f * sr * sp * sy + -1.f * cr * cy), // + -1.f * sr * cp}; + + const qvec3 up{ // + (cr * sp * cy + -sr * -sy), // + (cr * sp * sy + -sr * cy), // + cr * cp}; + + return std::tuple{forward, right, up}; +} + +[[nodiscard]] QUAKE_FORCEINLINE qvec3 getDirectionVectorFromPitchYawRoll( + const qvec3& v) noexcept +{ + return AngleVectorsOnlyFwd(v); +} + +// TODO VR: (P2) same as above, use one or the other +[[nodiscard]] QUAKE_FORCEINLINE qvec3 getFwdVecFromPitchYawRoll( + const qvec3& v) noexcept +{ + return AngleVectorsOnlyFwd(v); +} + +template <typename T> +[[nodiscard]] auto makeMenuCVarAdjuster(const bool isLeft) +{ + return + [isLeft](const cvar_t& cvar, const T incr, const T min, const T max) { const float factor = VR_GetMenuMult() >= 3 ? 6.f : VR_GetMenuMult(); const T adjIncr = incr * static_cast<T>(factor); @@ -197,151 +231,219 @@ namespace quake::util Cvar_SetValue(cvar.name, res); }; - } +} - template <typename T> - [[nodiscard]] QUAKE_FORCEINLINE bool hitSomething(const T& trace) noexcept - { - return trace.fraction < 1.f; - } +template <typename T> +[[nodiscard]] auto makeMenuValueAdjuster(const bool isLeft) +{ + return [isLeft](T& value, const T incr, const T min, const T max) { + const float factor = VR_GetMenuMult() >= 3 ? 6.f : VR_GetMenuMult(); - template <typename... Fs> - struct overload_set : Fs... - { - template <typename... FFwds> - constexpr overload_set(FFwds&&... fFwds) - : Fs{std::forward<FFwds>(fFwds)}... - { - } + const T adjIncr = incr * static_cast<T>(factor); + + const auto newVal = + static_cast<T>(isLeft ? value - adjIncr : value + adjIncr); + const auto res = static_cast<T>(std::clamp(newVal, min, max)); - using Fs::operator()...; + value = res; }; +} - template <typename... Fs> - overload_set(Fs...) -> overload_set<Fs...>; +template <typename T> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN bool hitSomething( + const T& trace) noexcept +{ + return trace.fraction < 1.f; +} - template <typename Variant, typename... Fs> - constexpr decltype(auto) match(Variant&& v, Fs&&... fs) +template <typename... Fs> +struct overload_set : Fs... +{ + template <typename... FFwds> + constexpr overload_set(FFwds&&... fFwds) : Fs{std::forward<FFwds>(fFwds)}... { - return std::visit( - overload_set{std::forward<Fs>(fs)...}, std::forward<Variant>(v)); } - // TODO VR: (P2) reuse throughout project - [[nodiscard]] QUAKE_FORCEINLINE glm::vec3 redirectVector( - const glm::vec3& input, const glm::vec3& examplar) noexcept - { - const auto [fwd, right, up] = getAngledVectors(examplar); - return fwd * input[0] + right * input[1] + up * input[2]; - } + using Fs::operator()...; +}; - template <typename TTrace> - [[nodiscard]] QUAKE_FORCEINLINE bool traceHitGround(const TTrace& trace) - { - return trace.plane.normal[2] > 0.7; - } +template <typename... Fs> +overload_set(Fs...) -> overload_set<Fs...>; - [[nodiscard]] inline int getMaxMSAALevel() noexcept - { - int res; - glGetIntegerv(GL_MAX_SAMPLES, &res); - return res; - } +template <typename... Fs> +constexpr auto make_overload_set(Fs&&... fs) +{ + return overload_set<std::decay_t<Fs>...>{std::forward<Fs>(fs)...}; +} - [[nodiscard]] constexpr QUAKE_FORCEINLINE bool hasFlag( - const float flags, const int x) noexcept - { - return static_cast<int>(flags) & x; - } +template <typename Variant, typename... Fs> +constexpr decltype(auto) match(Variant&& v, Fs&&... fs) +{ + return std::visit( + make_overload_set(std::forward<Fs>(fs)...), std::forward<Variant>(v)); +} - [[nodiscard]] constexpr QUAKE_FORCEINLINE bool hasFlag( - const edict_t* edict, const int x) noexcept - { - return hasFlag(edict->v.flags, x); - } +// TODO VR: (P2) reuse throughout project +[[nodiscard]] QUAKE_FORCEINLINE qvec3 redirectVector( + const qvec3& input, const qvec3& examplar) noexcept +{ + const auto [fwd, right, up] = getAngledVectors(examplar); + return fwd * input[0] + right * input[1] + up * input[2]; +} - [[nodiscard]] constexpr QUAKE_FORCEINLINE int removeFlag( - const float flags, const int x) noexcept - { - return static_cast<int>(flags) & ~x; - } +template <typename TTrace> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN bool traceHitGround(const TTrace& trace) +{ + return trace.plane.normal[2] > 0.7; +} - constexpr QUAKE_FORCEINLINE void removeFlag( - edict_t* edict, const int x) noexcept - { - edict->v.flags = removeFlag(edict->v.flags, x); - } +[[nodiscard]] inline int getMaxMSAALevel() noexcept +{ + int res; + glGetIntegerv(GL_MAX_SAMPLES, &res); + return res; +} - [[nodiscard]] constexpr QUAKE_FORCEINLINE int addFlag( - const float flags, const int x) noexcept - { - return static_cast<int>(flags) | x; - } +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr bool hasFlag( + const float flags, const int x) noexcept +{ + return static_cast<int>(flags) & x; +} - constexpr QUAKE_FORCEINLINE void addFlag( - edict_t* edict, const int x) noexcept - { - edict->v.flags = addFlag(edict->v.flags, x); - } +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN constexpr bool hasFlag( + const edict_t* edict, const int x) noexcept +{ + return hasFlag(edict->v.flags, x); +} - [[nodiscard]] constexpr QUAKE_FORCEINLINE int toggleFlag( - const float flags, const int x) noexcept - { - return static_cast<int>(flags) ^ x; - } +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr int removeFlag( + const float flags, const int x) noexcept +{ + return static_cast<int>(flags) & ~x; +} - constexpr QUAKE_FORCEINLINE void toggleFlag( - edict_t* edict, const int x) noexcept - { - edict->v.flags = toggleFlag(edict->v.flags, x); - } +QUAKE_FORCEINLINE constexpr void removeFlag( + edict_t* edict, const int x) noexcept +{ + edict->v.flags = removeFlag(edict->v.flags, x); +} - template <typename... TFlags> - [[nodiscard]] constexpr QUAKE_FORCEINLINE bool hasAnyFlag( - const float flags, const TFlags... xs) noexcept - { - return static_cast<int>(flags) & (xs | ...); - } +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr int addFlag( + const float flags, const int x) noexcept +{ + return static_cast<int>(flags) | x; +} - template <typename... TFlags> - [[nodiscard]] constexpr QUAKE_FORCEINLINE bool hasAnyFlag( - edict_t* edict, const TFlags... xs) noexcept - { - return hasAnyFlag(edict->v.flags, xs...); - } +QUAKE_FORCEINLINE constexpr void addFlag(edict_t* edict, const int x) noexcept +{ + edict->v.flags = addFlag(edict->v.flags, x); +} - [[nodiscard]] QUAKE_FORCEINLINE bool canBeTouched(const edict_t* edict) - { - return (edict->v.touch || edict->v.handtouch) && - edict->v.solid != SOLID_NOT; - } +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr int toggleFlag( + const float flags, const int x) noexcept +{ + return static_cast<int>(flags) ^ x; +} + +QUAKE_FORCEINLINE constexpr void toggleFlag( + edict_t* edict, const int x) noexcept +{ + edict->v.flags = toggleFlag(edict->v.flags, x); +} + +template <typename... TFlags> +[[nodiscard]] QUAKE_FORCEINLINE_CONSTFN constexpr bool hasAnyFlag( + const float flags, const TFlags... xs) noexcept +{ + return static_cast<int>(flags) & (xs | ...); +} + +template <typename... TFlags> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN constexpr bool hasAnyFlag( + edict_t* edict, const TFlags... xs) noexcept +{ + return hasAnyFlag(edict->v.flags, xs...); +} + +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN bool canBeTouched(const edict_t* edict) +{ + return (edict->v.touch || edict->v.handtouch) && + edict->v.solid != SOLID_NOT; +} + +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN bool canBeHandTouched( + const edict_t* edict) +{ + return edict->v.handtouch && edict->v.solid != SOLID_NOT; +} + +template <typename F> +bool anyXYCorner(const edict_t& ent, F&& f) +{ + const qfloat left = ent.v.mins[0]; + const qfloat right = ent.v.maxs[0]; + const qfloat fwd = ent.v.mins[1]; + const qfloat back = ent.v.maxs[1]; + + const auto doCorner = [&](const qfloat xOffset, const qfloat yOffset) { + return f(qvec3{xOffset, yOffset, 0.f}); + }; + + return doCorner(left, fwd) || doCorner(left, back) || + doCorner(right, fwd) || doCorner(right, back); +} - [[nodiscard]] QUAKE_FORCEINLINE bool canBeHandTouched(const edict_t* edict) +[[nodiscard]] inline bool checkGroundCollision(const int moveType, edict_t* ent, + trace_t& traceBuffer, qvec3& offsetBuffer, const qvec3& move, + const float xBias, const float yBias) +{ + (void)xBias; // TODO VR: (P2) unused + (void)yBias; // TODO VR: (P2) unused + + const auto checkCorner = [&](const qvec3& pos) { + const qvec3 end = pos + move; + + traceBuffer = SV_MoveTrace(pos, end, moveType, ent); + return hitSomething(traceBuffer) && traceHitGround(traceBuffer); + }; + + const qvec3 bottomOrigin = ent->v.origin + ent->v.mins[2]; + + if(ent->v.mins == vec3_zero && ent->v.maxs == vec3_zero) { - return edict->v.handtouch && edict->v.solid != SOLID_NOT; + // Optimized case for zero-sized objects. + offsetBuffer = vec3_zero; + return checkCorner(bottomOrigin); } + + return anyXYCorner(*ent, [&](const qvec3& offset) { + offsetBuffer = offset; + return checkCorner(bottomOrigin + offsetBuffer); + }); +} + } // namespace quake::util namespace std { - template <int D, typename T, glm::qualifier P> - struct tuple_size<glm::vec<D, T, P>> - : std::integral_constant<std::size_t, D> - { - }; +template <int D, typename T, glm::qualifier P> +struct tuple_size<glm::vec<D, T, P>> : std::integral_constant<std::size_t, D> +{ +}; - template <std::size_t I, int D, typename T, glm::qualifier P> - struct tuple_element<I, glm::vec<D, T, P>> - { - using type = T; - }; +template <std::size_t I, int D, typename T, glm::qualifier P> +struct tuple_element<I, glm::vec<D, T, P>> +{ + using type = T; +}; } // namespace std namespace glm { - template <std::size_t I, int D, typename T, glm::qualifier P> - [[nodiscard]] QUAKE_FORCEINLINE T get(const glm::vec<D, T, P>& v) noexcept - { - return v[I]; - } +template <std::size_t I, int D, typename T, glm::qualifier P> +[[nodiscard]] QUAKE_FORCEINLINE_PUREFN T get( + const glm::vec<D, T, P>& v) noexcept +{ + return v[I]; +} } // namespace glm diff --git a/Quake/vid.hpp b/Quake/vid.hpp index 921f54d4..17099b3b 100644 --- a/Quake/vid.hpp +++ b/Quake/vid.hpp @@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __VID_DEFS_H -#define __VID_DEFS_H +#pragma once // vid.h -- video driver defs @@ -74,25 +73,23 @@ typedef struct extern viddef_t vid; // global video state -extern void (*vid_menudrawfn)(void); +extern void (*vid_menudrawfn)(); extern void (*vid_menukeyfn)(int key); -extern void (*vid_menucmdfn)(void); // johnfitz +extern void (*vid_menucmdfn)(); // johnfitz -void VID_Init(void); // johnfitz -- removed palette from argument list +void VID_Init(); // johnfitz -- removed palette from argument list -void VID_Shutdown(void); +void VID_Shutdown(); // Called at shutdown void VID_Update(vrect_t* rects); // flushes the given rectangles from the view buffer to the screen -void VID_SyncCvars(void); +void VID_SyncCvars(); -void VID_Toggle(void); +void VID_Toggle(); -void* VID_GetWindow(void); -bool VID_HasMouseOrInputFocus(void); -bool VID_IsMinimized(void); -void VID_Lock(void); - -#endif /* __VID_DEFS_H */ +void* VID_GetWindow(); +bool VID_HasMouseOrInputFocus(); +bool VID_IsMinimized(); +void VID_Lock(); diff --git a/Quake/view.cpp b/Quake/view.cpp index 3ef3f53f..ed5dd4e8 100644 --- a/Quake/view.cpp +++ b/Quake/view.cpp @@ -24,8 +24,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" #include "render.hpp" #include "util.hpp" +#include "cmd.hpp" +#include "glquake.hpp" +#include "msg.hpp" +#include "client.hpp" +#include "gl_texmgr.hpp" +#include "screen.hpp" +#include "console.hpp" /* @@ -79,9 +87,9 @@ float v_dmg_time, v_dmg_roll, v_dmg_pitch; extern int in_forward, in_forward2, in_back; -glm::vec3 v_punchangles[2]; // johnfitz -- copied from cl.punchangle. 0 is - // current, 1 is previous value. never the same - // unless map just loaded +qvec3 v_punchangles[2]; // johnfitz -- copied from cl.punchangle. 0 is + // current, 1 is previous value. never the same + // unless map just loaded @@ -92,11 +100,11 @@ V_CalcRoll Used by view and sv_user =============== */ -float V_CalcRoll(const glm::vec3& angles, const glm::vec3& velocity) +qfloat V_CalcRoll(const qvec3& angles, const qvec3& velocity) { - float sign; - float side; - float value; + qfloat sign; + qfloat side; + qfloat value; const auto [forward, right, up] = quake::util::getAngledVectors(angles); @@ -115,8 +123,8 @@ float V_CalcRoll(const glm::vec3& angles, const glm::vec3& velocity) } - // if (cl.inwater) - // value *= 6; + // if (cl.inwater) + // value *= 6; if(side < cl_rollspeed.value) { @@ -324,8 +332,7 @@ void V_ParseDamage() int armor; int blood; - glm::vec3 from; - int i; + qvec3 from; entity_t* ent; float side; @@ -333,10 +340,7 @@ void V_ParseDamage() armor = MSG_ReadByte(); blood = MSG_ReadByte(); - for(i = 0; i < 3; i++) - { - from[i] = MSG_ReadCoord(cl.protocolflags); - } + from = MSG_ReadVec3(cl.protocolflags); count = blood * 0.5 + armor * 0.5; if(count < 10) @@ -694,7 +698,7 @@ CalcGunAngle ================== */ void CalcGunAngle(const int wpnCvarEntry, entity_t* viewent, - const glm::vec3& handrot, bool horizFlip) + const qvec3& handrot, bool horizFlip) { // Skip everything if we're doing VR Controller aiming. if(vr_enabled.value && vr_aimmode.value == VrAimMode::e_CONTROLLER) @@ -933,7 +937,7 @@ static void StairSmoothView(float& oldz, const entity_t* ent, entity_t* view) // FIXME: noclip_anglehack is set on the server, so in a nonlocal game // this won't work. - float steptime = cl.time - cl.oldtime; + auto steptime = cl.time - cl.oldtime; if(steptime < 0) { // FIXME I_Error ("steptime < 0"); @@ -966,9 +970,10 @@ static void StairSmoothView(float& oldz, const entity_t* ent, entity_t* view) V_CalcRefdef ================== */ -void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) +void V_CalcRefdef( + const int cvarEntry, const qvec3& handpos, const qvec3& gunOffset) { - static glm::vec3 punch{vec3_zero}; // johnfitz -- v_gunkick + static qvec3 punch{vec3_zero}; // johnfitz -- v_gunkick V_DriftPitch(); @@ -978,7 +983,6 @@ void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) // view is the weapon model (only visible from inside body) entity_t* view = &cl.viewent; - // transform the view offset by the model's matrix to get the offset from // model origin for the view @@ -992,7 +996,7 @@ void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) // refresh position if(VR_EnabledAndNotFake()) { - extern glm::vec3 vr_viewOffset; + extern qvec3 vr_viewOffset; r_refdef.vieworg = ent->origin + vr_viewOffset; } else @@ -1014,7 +1018,7 @@ void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) V_AddIdle(); // offsets - glm::vec3 angles; + qvec3 angles; angles[PITCH] = -ent->angles[PITCH]; // because entity pitches are actually backward angles[YAW] = ent->angles[YAW]; @@ -1041,8 +1045,7 @@ void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) // set up gun position view->angles = cl.viewangles; - CalcGunAngle( - VR_GetMainHandWpnCvarEntry(), view, cl.handrot[cVR_MainHand], false); + CalcGunAngle(cvarEntry, view, cl.handrot[cVR_MainHand], false); // VR controller aiming configuration if(vr_enabled.value && vr_aimmode.value == VrAimMode::e_CONTROLLER) @@ -1089,7 +1092,17 @@ void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) view->model = cl.model_precache[cl.stats[STAT_WEAPON]]; // TODO VR: (P2) hack - if(view->model && !strcmp(view->model->name, "progs/hand.mdl")) + const auto isHandMdl = [](const char* mdlname) { + return (strcmp(mdlname, "progs/hand.mdl") == 0) || + (strcmp(mdlname, "progs/hand_base.mdl") == 0) || + (strcmp(mdlname, "progs/finger_thumb.mdl") == 0) || + (strcmp(mdlname, "progs/finger_index.mdl") == 0) || + (strcmp(mdlname, "progs/finger_middle.mdl") == 0) || + (strcmp(mdlname, "progs/finger_ring.mdl") == 0) || + (strcmp(mdlname, "progs/finger_pinky.mdl") == 0); + }; + + if(view->model && isHandMdl(view->model->name)) { view->hidden = true; } @@ -1144,14 +1157,13 @@ void V_CalcRefdef(const glm::vec3& handpos, const glm::vec3& gunOffset) } void V_SetupOffHandWpnViewEnt( - const glm::vec3& handpos, const glm::vec3& gunOffset) + const int cvarEntry, const qvec3& handpos, const qvec3& gunOffset) { // view is the weapon model (only visible from inside body) entity_t& view = cl.offhand_viewent; // set up gun position - CalcGunAngle( - VR_GetOffHandWpnCvarEntry(), &view, cl.handrot[cVR_OffHand], true); + CalcGunAngle(cvarEntry, &view, cl.handrot[cVR_OffHand], true); // VR controller aiming configuration if(vr_enabled.value && vr_aimmode.value == VrAimMode::e_CONTROLLER) @@ -1166,7 +1178,17 @@ void V_SetupOffHandWpnViewEnt( view.model = cl.model_precache[cl.stats[STAT_WEAPONMODEL2]]; // TODO VR: (P2) hack - if(view.model && !strcmp(view.model->name, "progs/hand.mdl")) + const auto isHandMdl = [](const char* mdlname) { + return (strcmp(mdlname, "progs/hand.mdl") == 0) || + (strcmp(mdlname, "progs/hand_base.mdl") == 0) || + (strcmp(mdlname, "progs/finger_thumb.mdl") == 0) || + (strcmp(mdlname, "progs/finger_index.mdl") == 0) || + (strcmp(mdlname, "progs/finger_middle.mdl") == 0) || + (strcmp(mdlname, "progs/finger_ring.mdl") == 0) || + (strcmp(mdlname, "progs/finger_pinky.mdl") == 0); + }; + + if(view.model && isHandMdl(view.model->name)) { view.hidden = true; } @@ -1177,7 +1199,7 @@ void V_SetupOffHandWpnViewEnt( view.frame = cl.stats[STAT_WEAPONFRAME2]; view.colormap = vid.colormap; - view.horizflip = true; + view.horizFlip = true; StairSmoothView(playerOldZ, &cl_entities[cl.viewentity], &view); @@ -1191,33 +1213,47 @@ void V_SetupVRTorsoViewEnt() { entity_t& view = cl.vrtorso; - const glm::vec3 playerYawOnly{0, VR_GetBodyYawAngle(), 0}; + const qvec3 playerYawOnly{0, VR_GetBodyYawAngle(), 0}; const auto [vFwd, vRight, vUp] = quake::util::getAngledVectors(playerYawOnly); - const auto heightRatio = std::clamp(VR_GetCrouchRatio(), 0.f, 0.8f); + const auto heightRatio = std::clamp(VR_GetCrouchRatio(), 0._qf, 0.8_qf); - view.angles[PITCH] = 0.f + vr_vrtorso_pitch.value - (heightRatio * 35.f); + view.angles[PITCH] = 0.f + vr_vrtorso_pitch.value - (heightRatio * 35._qf); view.angles[YAW] = VR_GetBodyYawAngle() + vr_vrtorso_yaw.value; - view.angles[ROLL] = 0.f + vr_vrtorso_roll.value; + view.angles[ROLL] = 0._qf + vr_vrtorso_roll.value; view.model = Mod_ForName("progs/vrtorso.mdl", true); view.frame = 0; view.colormap = vid.colormap; view.origin = cl_entities[cl.viewentity].origin; - view.origin += vFwd * vr_vrtorso_x_offset.value; - view.origin -= vFwd * (heightRatio * 14.f); - view.origin += vRight * vr_vrtorso_y_offset.value; + view.origin += vFwd * qfloat(vr_vrtorso_x_offset.value); + view.origin -= vFwd * (heightRatio * 14._qf); + view.origin += vRight * qfloat(vr_vrtorso_y_offset.value); view.origin[2] += VR_GetHeadOrigin()[2] * vr_vrtorso_head_z_mult.value; view.origin[2] += vr_vrtorso_z_offset.value; StairSmoothView(playerOldZ, &cl_entities[cl.viewentity], &view); } -void V_SetupHolsterSlotViewEnt(const glm::vec3& pos, entity_t* view, - const float pitch, const float yaw, const float roll, const bool horizflip) +void V_SetupHolsterSlotViewEnt(const int hotspot, const qvec3& pos, + entity_t* view, const qfloat pitch, const qfloat yaw, const qfloat roll, + const bool horizFlip) { + const bool hovered = (cl.hotspot[cVR_OffHand] == hotspot) || + (cl.hotspot[cVR_MainHand] == hotspot); + + if(hovered) + { + view->lightmod = EntityLightModifier::Multiply; + view->lightmodvalue = {6.f, 6.f, 6.f}; + } + else + { + view->lightmod = EntityLightModifier::None; + } + view->angles[PITCH] = pitch; view->angles[YAW] = yaw; view->angles[ROLL] = roll; @@ -1228,7 +1264,7 @@ void V_SetupHolsterSlotViewEnt(const glm::vec3& pos, entity_t* view, view->frame = 0; view->colormap = vid.colormap; - view->horizflip = horizflip; + view->horizFlip = horizFlip; StairSmoothView(playerOldZ, &cl_entities[cl.viewentity], view); @@ -1238,19 +1274,42 @@ void V_SetupHolsterSlotViewEnt(const glm::vec3& pos, entity_t* view, } } -void V_SetupHolsterViewEnt(const int modelId, const glm::vec3& pos, - entity_t* view, const float pitch, const float yaw, const float roll, - const bool horizflip) +void V_SetupHolsterViewEnt(const int hotspot, const int modelId, + const qvec3& pos, entity_t* view, const qfloat pitch, const qfloat yaw, + const qfloat roll, const bool horizFlip) { + const bool hovered = (cl.hotspot[cVR_OffHand] == hotspot) || + (cl.hotspot[cVR_MainHand] == hotspot); + view->angles[PITCH] = pitch; view->angles[YAW] = yaw; view->angles[ROLL] = roll; + if(hovered) + { + view->lightmod = EntityLightModifier::Multiply; + view->lightmodvalue = {6.f, 6.f, 6.f}; + } + else + { + view->lightmod = EntityLightModifier::None; + } + view->origin = pos; view->model = cl.model_precache[modelId]; // TODO VR: (P2) hack - if(view->model && !strcmp(view->model->name, "progs/hand.mdl")) + const auto isHandMdl = [](const char* mdlname) { + return (strcmp(mdlname, "progs/hand.mdl") == 0) || + (strcmp(mdlname, "progs/hand_base.mdl") == 0) || + (strcmp(mdlname, "progs/finger_thumb.mdl") == 0) || + (strcmp(mdlname, "progs/finger_index.mdl") == 0) || + (strcmp(mdlname, "progs/finger_middle.mdl") == 0) || + (strcmp(mdlname, "progs/finger_ring.mdl") == 0) || + (strcmp(mdlname, "progs/finger_pinky.mdl") == 0); + }; + + if(view->model && isHandMdl(view->model->name)) { view->model = nullptr; } @@ -1258,7 +1317,7 @@ void V_SetupHolsterViewEnt(const int modelId, const glm::vec3& pos, view->frame = 0; view->colormap = vid.colormap; - view->horizflip = horizflip; + view->horizFlip = horizFlip; if(chase_active.value) { @@ -1266,12 +1325,102 @@ void V_SetupHolsterViewEnt(const int modelId, const glm::vec3& pos, } } -static void V_SetupHandViewEnt(const int anchorWpnCvar, entity_t* const anchor, - entity_t* const hand, const glm::vec3& handRot, - const glm::vec3& extraOffset, const bool horizflip) +static const char* fingerIdxToModelName(const FingerIdx fingerIdx) +{ + if(fingerIdx == FingerIdx::Thumb) + { + return "progs/finger_thumb.mdl"; + } + + if(fingerIdx == FingerIdx::Index) + { + return "progs/finger_index.mdl"; + } + + if(fingerIdx == FingerIdx::Middle) + { + return "progs/finger_middle.mdl"; + } + + if(fingerIdx == FingerIdx::Ring) + { + return "progs/finger_ring.mdl"; + } + + if(fingerIdx == FingerIdx::Pinky) + { + return "progs/finger_pinky.mdl"; + } + + assert(fingerIdx == FingerIdx::Base); + return "progs/hand_base.mdl"; +}; + +static qvec3 fingerIdxToOffset(const FingerIdx fingerIdx, const int handIdx) +{ + qvec3 result = quake::vr::get_fingers_and_base_xyz(); + + if(handIdx == cVR_OffHand) + { + result += quake::vr::get_fingers_and_base_offhand_xyz(); + } + + if(fingerIdx == FingerIdx::Base) + { + return result + quake::vr::get_finger_base_xyz(); + } + + result += quake::vr::get_fingers_xyz(); + + if(fingerIdx == FingerIdx::Thumb) + { + result += quake::vr::get_finger_thumb_xyz(); + } + else if(fingerIdx == FingerIdx::Index) + { + result += quake::vr::get_finger_index_xyz(); + } + else if(fingerIdx == FingerIdx::Middle) + { + result += quake::vr::get_finger_middle_xyz(); + } + else if(fingerIdx == FingerIdx::Ring) + { + result += quake::vr::get_finger_ring_xyz(); + } + else + { + assert(fingerIdx == FingerIdx::Pinky); + result += quake::vr::get_finger_pinky_xyz(); + } + + return result; +} + +static void V_SetupHandViewEnt(const FingerIdx fingerIdx, int anchorWpnCvar, + entity_t* const anchor, entity_t* const hand, qvec3 handRot, + const qvec3& extraOffset, const bool horizFlip, const bool ghost) { assert(anchor->model != nullptr); + auto [oPitch, oYaw, oRoll] = + VR_GetWpnAngleOffsets(vr_hardcoded_wpn_cvar_fist); + + if(horizFlip) + { + oYaw *= -1.f; + oRoll *= -1.f; + } + + handRot[PITCH] += oPitch; + handRot[YAW] += oYaw; + handRot[ROLL] += oRoll; + + if(ghost) + { + anchorWpnCvar = vr_hardcoded_wpn_cvar_fist; + } + const auto extraOffsets = VR_GetWpnHandOffsets(anchorWpnCvar) + extraOffset; const int anchorVertex = static_cast<int>( @@ -1280,10 +1429,16 @@ static void V_SetupHandViewEnt(const int anchorWpnCvar, entity_t* const anchor, const bool hideHand = static_cast<bool>(VR_GetWpnCVarValue(anchorWpnCvar, WpnCVar::HideHand)); - const glm::vec3 pos = VR_GetScaledAndAngledAliasVertexPosition( - anchor, anchorVertex, extraOffsets, handRot); + const int handIdx = horizFlip ? cVR_OffHand : cVR_MainHand; + + auto pos = VR_GetScaledAndAngledAliasVertexPosition( + anchor, anchorVertex, extraOffsets, handRot, horizFlip); + + if(anchorWpnCvar == vr_hardcoded_wpn_cvar_fist) + { + pos = cl.handpos[handIdx]; + } - const int handIdx = horizflip ? cVR_OffHand : cVR_MainHand; const int otherHandIdx = VR_OtherHand(handIdx); const auto otherWpnCvar = VR_GetWpnCvarEntry(otherHandIdx); @@ -1293,12 +1448,13 @@ static void V_SetupHandViewEnt(const int anchorWpnCvar, entity_t* const anchor, if(otherWpnTwoHDisplayModeFixed && vr_2h_aim_transition[otherHandIdx] > 0.f) { + // Blend when leaving 2H mode + entity_t* const otherAnchor = anchor == &cl.viewent ? &cl.offhand_viewent : &cl.viewent; - const glm::vec3 twoHFixedPos = - VR_GetWpnFixed2HFinalPosition(otherAnchor, otherWpnCvar, horizflip, - extraOffset, cl.handrot[otherHandIdx]); + const auto twoHFixedPos = VR_GetWpnFixed2HFinalPosition(otherAnchor, + otherWpnCvar, horizFlip, extraOffset, cl.handrot[otherHandIdx]); hand->origin = glm::mix(pos, twoHFixedPos, vr_2h_aim_transition[otherHandIdx]); @@ -1308,206 +1464,358 @@ static void V_SetupHandViewEnt(const int anchorWpnCvar, entity_t* const anchor, hand->origin = pos; } - hand->model = Mod_ForName("progs/hand.mdl", true); - hand->hidden = hideHand; - hand->frame = 0; - hand->colormap = vid.colormap; - hand->horizflip = horizflip; + auto foff = fingerIdxToOffset(fingerIdx, handIdx); + if(horizFlip) + { + foff[1] *= -1.f; + } + + hand->origin += quake::util::redirectVector(foff, handRot); + hand->model = Mod_ForName(fingerIdxToModelName(fingerIdx), true); - // TODO VR: (P2) hardcoded fist cvar number - // if(hand->model != nullptr) { const auto handHdr = (aliashdr_t*)Mod_Extradata(hand->model); + // TODO VR: (P2) hardcoded fist cvar number ApplyMod_Weapon(vr_hardcoded_wpn_cvar_fist, handHdr); } - CalcGunAngle(vr_hardcoded_wpn_cvar_fist, hand, handRot, horizflip); + hand->hidden = hideHand; + hand->frame = vr_fingertracking_frame[(int)handIdx][(int)fingerIdx]; + hand->colormap = vid.colormap; + hand->horizFlip = horizFlip; + + hand->angles[PITCH] = -handRot[PITCH]; + hand->angles[YAW] = handRot[YAW]; + hand->angles[ROLL] = handRot[ROLL]; } -static void V_SetupFixedHelpingHandViewEnt(const int helpingHand, - const int otherWpnCvar, entity_t* const anchor, entity_t* const hand, - const glm::vec3& handRot, const glm::vec3& otherHandRot, - const glm::vec3& extraOffset, const bool horizflip) +static void V_SetupFixedHelpingHandViewEnt(const FingerIdx fingerIdx, + const int helpingHand, const int otherWpnCvar, entity_t* const anchor, + entity_t* const hand, const qvec3& handRot, qvec3 otherHandRot, + const qvec3& extraOffset, const bool horizFlip) { + (void)handRot; + assert(anchor->model != nullptr); - const glm::vec3 pos = VR_GetWpnFixed2HFinalPosition( - anchor, otherWpnCvar, horizflip, extraOffset, otherHandRot); + auto [oPitch, oYaw, oRoll] = VR_GetWpnFixed2HHandAngles(otherWpnCvar); + + if(!horizFlip) + { + oYaw *= -1.f; + oRoll *= -1.f; + } + + otherHandRot[PITCH] += oPitch; + otherHandRot[YAW] += oYaw; + otherHandRot[ROLL] += oRoll; + + const auto pos = VR_GetWpnFixed2HFinalPosition( + anchor, otherWpnCvar, horizFlip, extraOffset, otherHandRot); hand->origin = glm::mix(cl.handpos[helpingHand], pos, vr_2h_aim_transition[VR_OtherHand(helpingHand)]); - hand->model = Mod_ForName("progs/hand.mdl", true); - hand->frame = 0; - hand->colormap = vid.colormap; - hand->horizflip = horizflip; + const int handIdx = horizFlip ? cVR_OffHand : cVR_MainHand; + + auto foff = fingerIdxToOffset(fingerIdx, handIdx); + if(horizFlip) + { + foff[1] *= -1.f; + } + + hand->origin += quake::util::redirectVector(foff, otherHandRot); + hand->model = Mod_ForName(fingerIdxToModelName(fingerIdx), true); - // TODO VR: (P2) hardcoded fist cvar number - if(hand->model != nullptr) { const auto handHdr = (aliashdr_t*)Mod_Extradata(hand->model); + // TODO VR: (P2) hardcoded fist cvar number ApplyMod_Weapon(vr_hardcoded_wpn_cvar_fist, handHdr); } - auto [rPitch, rYaw, rRoll] = VR_GetWpnFixed2HHandAngles(otherWpnCvar); + hand->frame = vr_fingertracking_frame[(int)handIdx][(int)fingerIdx]; + hand->colormap = vid.colormap; + hand->horizFlip = horizFlip; - if(!horizflip) + hand->angles[PITCH] = -otherHandRot[PITCH]; + hand->angles[YAW] = otherHandRot[YAW]; + hand->angles[ROLL] = otherHandRot[ROLL]; +} + +static void V_SetupWpnButtonViewEnt(const int anchorWpnCvar, + entity_t* const anchor, entity_t* const wpnButton, const qvec3& handRot, + const qvec3& extraOffset, const bool horizFlip) +{ + assert(anchor->model != nullptr); + + auto extraOffsets = VR_GetWpnButtonOffsets(anchorWpnCvar) + extraOffset; + + if(horizFlip) { - rYaw *= -1.f; - rRoll *= -1.f; + // extraOffsets[1] *= -1.f; } - hand->angles = otherHandRot + glm::vec3{rPitch, rYaw, rRoll}; - hand->angles[PITCH] *= -1.f; -} + const int anchorVertex = static_cast<int>( + VR_GetWpnCVarValue(anchorWpnCvar, WpnCVar::WpnButtonAnchorVertex)); + const bool hideButton = + static_cast<WpnButtonMode>(VR_GetWpnCVarValue( + anchorWpnCvar, WpnCVar::WpnButtonMode)) == WpnButtonMode::None; -/* -================== -V_RenderView + const qvec3 pos = VR_GetScaledAndAngledAliasVertexPosition( + anchor, anchorVertex, extraOffsets, handRot, horizFlip); -The player's clipping box goes from (-16 -16 -24) to (16 16 32) from -the entity origin, so any view position inside that will be valid -================== -*/ -extern vrect_t scr_vrect; + // const int handIdx = horizFlip ? cVR_OffHand : cVR_MainHand; -void V_RenderView() -{ - if(con_forcedup) + qvec3 angles = VR_GetWpnButtonAngles(anchorWpnCvar); + if(horizFlip) { - return; + angles[ROLL] *= -1.f; } - if(cl.intermission) + wpnButton->origin = pos; + wpnButton->model = Mod_ForName("progs/wpnbutton.mdl", true); + wpnButton->hidden = hideButton; + wpnButton->frame = 0; + wpnButton->colormap = vid.colormap; + wpnButton->horizFlip = horizFlip; + wpnButton->angles = handRot + angles; + wpnButton->angles[PITCH] *= -1.f; + + // TODO VR: (P2) hardcoded fist cvar number + // if(hand->model != nullptr) + // { + // const auto handHdr = (aliashdr_t*)Mod_Extradata(hand->model); + // ApplyMod_Weapon(vr_hardcoded_wpn_cvar_fist, handHdr); + // } +} + +static void V_RenderView_WeaponModels() +{ + // ------------------------------------------------------------------- + // VR: Setup main hand weapon, player model entity, and refdef. { - V_CalcIntermissionRefdef(); - R_RenderView(); + const auto cvarEntry = VR_GetMainHandWpnCvarEntry(); + const auto gunOffset = VR_GetWpnGunOffsets(cvarEntry); + + V_CalcRefdef(cvarEntry, cl.handpos[cVR_MainHand], gunOffset); } - else if(!cl.paused /* && (cl.maxclients > 1 || key_dest == key_game) */) + + // ------------------------------------------------------------------- + // VR: Setup off hand weapon. { - // ------------------------------------------------------------------- - // VR: Setup main hand weapon, player model entity, and refdef. - { - const auto gunOffset = - VR_GetWpnGunOffsets(VR_GetMainHandWpnCvarEntry()); + const auto cvarEntry = VR_GetOffHandWpnCvarEntry(); + auto gunOffset = VR_GetWpnGunOffsets(cvarEntry); + gunOffset[1] *= -1.f; - V_CalcRefdef(cl.handpos[cVR_MainHand], gunOffset); - } + V_SetupOffHandWpnViewEnt(cvarEntry, cl.handpos[cVR_OffHand], gunOffset); + } +} - // ------------------------------------------------------------------- - // VR: Setup off hand weapon. - { - auto gunOffset = VR_GetWpnGunOffsets(VR_GetOffHandWpnCvarEntry()); - gunOffset[1] *= -1.f; +static void V_RenderView_HolsteredWeaponModels() +{ + // ------------------------------------------------------------------- + // VR: Setup holstered weapons. + const auto playerBodyYaw = VR_GetBodyYawAngle(); - V_SetupOffHandWpnViewEnt(cl.handpos[cVR_OffHand], gunOffset); - } + V_SetupHolsterViewEnt(QVR_HS_LEFT_HIP_HOLSTER, + cl.stats[STAT_HOLSTERWEAPONMODEL2], VR_GetLeftHipPos(), + &cl.left_hip_holster, -90.f, 0.f, -playerBodyYaw + 10.f, true); + + V_SetupHolsterViewEnt(QVR_HS_RIGHT_HIP_HOLSTER, + cl.stats[STAT_HOLSTERWEAPONMODEL3], VR_GetRightHipPos(), + &cl.right_hip_holster, -90.f, 0.f, -playerBodyYaw - 10.f, false); - // ------------------------------------------------------------------- - // VR: Setup holstered weapons. - const auto playerBodyYaw = VR_GetBodyYawAngle(); + V_SetupHolsterViewEnt(QVR_HS_LEFT_UPPER_HOLSTER, + cl.stats[STAT_HOLSTERWEAPONMODEL4], VR_GetLeftUpperPos(), + &cl.left_upper_holster, -20.f, playerBodyYaw + 180.f, 0.f, true); - V_SetupHolsterViewEnt(cl.stats[STAT_HOLSTERWEAPONMODEL2], - VR_GetLeftHipPos(), &cl.left_hip_holster, -90.f, 0.f, - -playerBodyYaw + 10.f, true); + V_SetupHolsterViewEnt(QVR_HS_RIGHT_UPPER_HOLSTER, + cl.stats[STAT_HOLSTERWEAPONMODEL5], VR_GetRightUpperPos(), + &cl.right_upper_holster, -20.f, playerBodyYaw + 180.f, 0.f, false); +} - V_SetupHolsterViewEnt(cl.stats[STAT_HOLSTERWEAPONMODEL3], - VR_GetRightHipPos(), &cl.right_hip_holster, -90.f, 0.f, - -playerBodyYaw - 10.f, false); +static void V_RenderView_HolsterModels() +{ + // ------------------------------------------------------------------- + // VR: Setup holsters. + const auto playerBodyYaw = VR_GetBodyYawAngle(); - V_SetupHolsterViewEnt(cl.stats[STAT_HOLSTERWEAPONMODEL4], - VR_GetLeftUpperPos(), &cl.left_upper_holster, -20.f, - playerBodyYaw + 180.f, 0.f, true); + // TODO VR: (P2) code repetition between holsters and slots + if(vr_leg_holster_model_enabled.value) + { + V_SetupHolsterSlotViewEnt(QVR_HS_LEFT_HIP_HOLSTER, VR_GetLeftHipPos(), + &cl.left_hip_holster_slot, -0.f, playerBodyYaw - 10.f, 0.f, true); - V_SetupHolsterViewEnt(cl.stats[STAT_HOLSTERWEAPONMODEL5], - VR_GetRightUpperPos(), &cl.right_upper_holster, -20.f, - playerBodyYaw + 180.f, 0.f, false); + V_SetupHolsterSlotViewEnt(QVR_HS_RIGHT_HIP_HOLSTER, VR_GetRightHipPos(), + &cl.right_hip_holster_slot, -0.f, playerBodyYaw + 10.f, 0.f, false); - // TODO VR: (P2) code repetition between holsters and slots - if(vr_leg_holster_model_enabled.value) - { - V_SetupHolsterSlotViewEnt(VR_GetLeftHipPos(), - &cl.left_hip_holster_slot, -0.f, playerBodyYaw - 10.f, 0.f, - true); + V_SetupHolsterSlotViewEnt(QVR_HS_LEFT_UPPER_HOLSTER, + VR_GetLeftUpperPos(), &cl.left_upper_holster_slot, -30.f, + playerBodyYaw - 10.f, 0.f, true); - V_SetupHolsterSlotViewEnt(VR_GetRightHipPos(), - &cl.right_hip_holster_slot, -0.f, playerBodyYaw + 10.f, 0.f, - false); + V_SetupHolsterSlotViewEnt(QVR_HS_RIGHT_UPPER_HOLSTER, + VR_GetRightUpperPos(), &cl.right_upper_holster_slot, -30.f, + playerBodyYaw + 10.f, 0.f, false); + } +} + +static void V_RenderView_HandModels() +{ + const auto doHand = [&](const FingerIdx fingerIdx, entity_t* wpnEnt, + const int wpnCvar, entity_t* otherWpnEnt, + entity_t* handEnt, const int hand, + const qvec3& extraOffset, const bool horizFlip, + const bool ghost) { + if(otherWpnEnt->model != nullptr) + { + const int otherWpnCvar = VR_GetWpnCVarFromModel(otherWpnEnt->model); - V_SetupHolsterSlotViewEnt(VR_GetLeftUpperPos(), - &cl.left_upper_holster_slot, -30.f, playerBodyYaw - 10.f, 0.f, - true); + const bool twoHDisplayModeFixed = + quake::util::cvarToEnum<Wpn2HDisplayMode>( + VR_GetWpnCVar(otherWpnCvar, WpnCVar::TwoHDisplayMode)) == + Wpn2HDisplayMode::Fixed; - V_SetupHolsterSlotViewEnt(VR_GetRightUpperPos(), - &cl.right_upper_holster_slot, -30.f, playerBodyYaw + 10.f, 0.f, - false); - } + const bool inFixed2HAiming = + VR_IsActive2HHelpingHand(hand) && twoHDisplayModeFixed; - const auto doHand = [&](entity_t* wpnEnt, entity_t* handEnt, - const int hand, const glm::vec3& extraOffset, - const bool horizFlip) { - if(wpnEnt->model == nullptr) + if(inFixed2HAiming) { + // setup zeroblend + otherWpnEnt->zeroBlend = + VR_GetWpnCVarValue(otherWpnCvar, WpnCVar::TwoHZeroBlend); + + const auto otherHand = VR_OtherHand(hand); + + V_SetupFixedHelpingHandViewEnt(fingerIdx, hand, otherWpnCvar, + otherWpnEnt, handEnt, cl.handrot[hand], + cl.handrot[otherHand], extraOffset, horizFlip); + return; } - const int wpnCvar = VR_GetWpnCVarFromModel(wpnEnt->model); + // setup zeroblend + otherWpnEnt->zeroBlend = + VR_GetWpnCVarValue(otherWpnCvar, WpnCVar::ZeroBlend); + } - const auto otherWpnEnt = - wpnEnt == &cl.viewent ? &cl.offhand_viewent : &cl.viewent; + V_SetupHandViewEnt(fingerIdx, wpnCvar, wpnEnt, handEnt, + cl.handrot[hand], extraOffset, horizFlip, ghost); + }; - if(otherWpnEnt->model != nullptr) - { - const int otherWpnCvar = - VR_GetWpnCVarFromModel(otherWpnEnt->model); + const auto doHandEntities = [&](auto& handEntities, entity_t& wpnEnt, + const int handIdx, const qvec3& extraOffset, + const bool horizFlip, const bool ghost) { + if(wpnEnt.model == nullptr) + { + return; + } - const bool twoHDisplayModeFixed = - quake::util::cvarToEnum<Wpn2HDisplayMode>(VR_GetWpnCVar( - otherWpnCvar, WpnCVar::TwoHDisplayMode)) == - Wpn2HDisplayMode::Fixed; + const int wpnCvar = VR_GetWpnCVarFromModel(wpnEnt.model); - const bool inFixed2HAiming = - VR_IsActive2HHelpingHand(hand) && twoHDisplayModeFixed; + entity_t& otherWpnEnt = + &wpnEnt == &cl.viewent ? cl.offhand_viewent : cl.viewent; - if(inFixed2HAiming) - { - const auto otherHand = VR_OtherHand(hand); + const auto doHandImpl = [&](const FingerIdx fingerIdx, + entity_t& handEnt) { + doHand(fingerIdx, &wpnEnt, wpnCvar, &otherWpnEnt, &handEnt, handIdx, + extraOffset, horizFlip, ghost); + }; - V_SetupFixedHelpingHandViewEnt(hand, otherWpnCvar, - otherWpnEnt, handEnt, cl.handrot[hand], - cl.handrot[otherHand], extraOffset, horizFlip); + doHandImpl(FingerIdx::Base, handEntities.base); + doHandImpl(FingerIdx::Thumb, handEntities.f_thumb); + doHandImpl(FingerIdx::Index, handEntities.f_index); + doHandImpl(FingerIdx::Middle, handEntities.f_middle); + doHandImpl(FingerIdx::Ring, handEntities.f_ring); + doHandImpl(FingerIdx::Pinky, handEntities.f_pinky); + }; - return; - } - } + // ------------------------------------------------------------------- + // VR: Setup main hand. + doHandEntities(cl.right_hand_entities, cl.viewent, cVR_MainHand, vec3_zero, + false, false); - V_SetupHandViewEnt(wpnCvar, wpnEnt, handEnt, cl.handrot[hand], - extraOffset, horizFlip); - }; + if(false) + { // TODO VR: (P1) cvar, transparency + doHandEntities(cl.right_hand_ghost_entities, cl.viewent, cVR_MainHand, + vec3_zero, false, true); + } - // ------------------------------------------------------------------- - // VR: Setup main hand. - doHand(&cl.viewent, &cl.right_hand, cVR_MainHand, vec3_zero, false); + // ------------------------------------------------------------------- + // VR: Setup off hand. + doHandEntities(cl.left_hand_entities, cl.offhand_viewent, cVR_OffHand, + vec3_zero, true, false); - // ------------------------------------------------------------------- - // VR: Setup off hand. - const auto offHandOffsets = - cl.offhand_viewent.model == nullptr - ? vec3_zero - : VR_GetWpnOffHandOffsets( - VR_GetWpnCVarFromModel(cl.offhand_viewent.model)); + if(false) + { // TODO VR: (P1) cvar, transparency + doHandEntities(cl.left_hand_ghost_entities, cl.offhand_viewent, + cVR_OffHand, vec3_zero, true, true); + } +} - doHand(&cl.offhand_viewent, &cl.left_hand, cVR_OffHand, offHandOffsets, - true); +static void V_RenderView_VRTorsoModel() +{ + // ------------------------------------------------------------------- + // VR: Setup VR torso. + if(vr_vrtorso_enabled.value == 1) + { + V_SetupVRTorsoViewEnt(); + } +} - // ------------------------------------------------------------------- - // VR: Setup VR torso. - if(vr_vrtorso_enabled.value == 1) +static void V_RenderView_WeaponButtonModels() +{ + // ------------------------------------------------------------------- + // VR: Setup weapon buttons. + const auto doWpnButton = [&](entity_t* wpnEnt, entity_t* buttonEnt, + const int hand, const qvec3& extraOffset, + const bool horizFlip) { + if(wpnEnt->model == nullptr) { - V_SetupVRTorsoViewEnt(); + return; } + const int wpnCvar = VR_GetWpnCVarFromModel(wpnEnt->model); + + V_SetupWpnButtonViewEnt(wpnCvar, wpnEnt, buttonEnt, cl.handrot[hand], + extraOffset, horizFlip); + }; + + doWpnButton( + &cl.viewent, &cl.mainhand_wpn_button, cVR_MainHand, vec3_zero, false); + doWpnButton(&cl.offhand_viewent, &cl.offhand_wpn_button, cVR_OffHand, + vec3_zero, true); +} + +/* +================== +V_RenderView + +The player's clipping box goes from (-16 -16 -24) to (16 16 32) from +the entity origin, so any view position inside that will be valid +================== +*/ +void V_RenderView() +{ + if(con_forcedup) + { + return; + } + + if(cl.intermission) + { + V_CalcIntermissionRefdef(); + R_RenderView(); + } + else if(!cl.paused /* && (cl.maxclients > 1 || key_dest == key_game) */) + { + V_RenderView_WeaponModels(); + V_RenderView_HolsteredWeaponModels(); + V_RenderView_HolsterModels(); + V_RenderView_HandModels(); + V_RenderView_VRTorsoModel(); + V_RenderView_WeaponButtonModels(); + R_RenderView(); } diff --git a/Quake/view.hpp b/Quake/view.hpp index fdbfcd17..c0ec2230 100644 --- a/Quake/view.hpp +++ b/Quake/view.hpp @@ -21,21 +21,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_VIEW_H -#define _QUAKE_VIEW_H +#pragma once #include "quakeglm.hpp" +#include "cvar.hpp" extern cvar_t vid_gamma; extern cvar_t vid_contrast; extern float v_blend[4]; -void V_Init(void); -void V_RenderView(void); -void V_CalcBlend(void); -void V_UpdateBlend(void); -float V_CalcRoll(const glm::vec3& angles, const glm::vec3& velocity); -// void V_UpdatePalette (void); //johnfitz - -#endif /* _QUAKE_VIEW_H */ +void V_Init(); +void V_RenderView(); +void V_CalcBlend(); +void V_UpdateBlend(); +qfloat V_CalcRoll(const qvec3& angles, const qvec3& velocity); +// void V_UpdatePalette (); //johnfitz diff --git a/Quake/vr.cpp b/Quake/vr.cpp index 0aae8832..1b7164e9 100644 --- a/Quake/vr.cpp +++ b/Quake/vr.cpp @@ -1,17 +1,39 @@ #include "console.hpp" +#include "cvar.hpp" #include "quakedef.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" #include "util.hpp" #include "render.hpp" #include "openvr.hpp" #include "quakeglm.hpp" -#include "opengl_ext.hpp" +#include "quakeglm_qmat4.hpp" +#include "quakeglm_qvec2.hpp" +#include "quakeglm_qvec4.hpp" +#include "quakeglm_qquat.hpp" +#include "common.hpp" +#include "lerpdata.hpp" +#include "sbar.hpp" +#include "menu.hpp" +#include "keys.hpp" +#include "client.hpp" +#include "draw.hpp" +#include "gl_util.hpp" +#include "cmd.hpp" #include <algorithm> #include <cassert> +#include <cstring> #include <vector> #include <tuple> #include <string> +#include <deque> + +#include <SDL2/SDL.h> + +#include <glm/gtx/rotate_vector.hpp> +#include <glm/gtx/intersect.hpp> +#include <glm/gtx/projection.hpp> // // @@ -54,19 +76,64 @@ struct vr_eye_t // VR Input Structs // ---------------------------------------------------------------------------- +class VecHistory +{ +private: + std::size_t _bufCapacity; + std::deque<qvec3> _data; + +public: + explicit VecHistory(const std::size_t bufCapacity) noexcept + : _bufCapacity{5} + { + } + + void add(const qvec3& v) + { + if(_data.size() == _bufCapacity) + { + _data.pop_front(); + } + + _data.push_back(v); + } + + [[nodiscard]] qvec3 average() const noexcept + { + if(_data.size() == 0) + { + return vec3_zero; + } + + qvec3 res{}; + + for(const auto& v : _data) + { + res += v; + } + + return res / static_cast<qfloat>(_data.size()); + } +}; + struct vr_controller { vr::VRControllerState_t state; vr::VRControllerState_t lastState; - glm::vec3 position; - glm::vec3 orientation; - glm::vec3 velocity; - glm::vec3 a_velocity; + qvec3 position; + qvec3 orientation; + qvec3 velocity; + qvec3 a_velocity; vr::HmdVector3_t rawvector; vr::HmdQuaternion_t raworientation; bool active{false}; + + VecHistory velocityHistory{5}; + VecHistory angularVelocityHistory{5}; }; + + // // // @@ -107,9 +174,13 @@ static bool readbackYaw; std::string vr_working_directory; -glm::vec3 vr_viewOffset; -glm::vec3 lastHudPosition{}; -glm::vec3 lastMenuPosition{}; +qvec3 vr_viewOffset; +qvec3 lastHudPosition{}; +qvec3 lastMenuPosition{}; +qvec3 vr_menu_target{}; +qvec3 vr_menu_angles{}; +qvec3 vr_menu_normal{}; +qvec3 vr_menu_intersection_point{}; vr::IVRSystem* ovrHMD; vr::TrackedDevicePose_t ovr_DevicePose[vr::k_unMaxTrackedDeviceCount]; @@ -117,16 +188,16 @@ vr::TrackedDevicePose_t ovr_DevicePose[vr::k_unMaxTrackedDeviceCount]; static vr_eye_t eyes[2]; static vr_eye_t* current_eye = nullptr; static vr_controller controllers[2]; -static glm::vec3 lastOrientation{vec3_zero}; -static glm::vec3 lastAim{vec3_zero}; +static qvec3 lastOrientation{vec3_zero}; +static qvec3 lastAim{vec3_zero}; static bool vr_initialized = false; -static glm::vec3 headOrigin{vec3_zero}; -static glm::vec3 lastHeadOrigin{vec3_zero}; +static qvec3 headOrigin{vec3_zero}; +static qvec3 lastHeadOrigin{vec3_zero}; static vr::HmdVector3_t headVelocity; -glm::vec3 vr_roomscale_move{}; +qvec3 vr_roomscale_move{}; // Wolfenstein 3D, DOOM and QUAKE use the same coordinate/unit system: // 8 foot (96 inch) height wall == 64 units, 1.5 inches per pixel unit @@ -139,25 +210,44 @@ bool vr_was_teleporting{false}; bool vr_teleporting{false}; bool vr_teleporting_impact_valid{false}; bool vr_send_teleport_msg{false}; -glm::vec3 vr_teleporting_impact{vec3_zero}; +qvec3 vr_teleporting_impact{vec3_zero}; bool vr_left_grabbing{false}; bool vr_left_prevgrabbing{false}; bool vr_right_grabbing{false}; bool vr_right_prevgrabbing{false}; +vr::VRSkeletalSummaryData_t vr_ss_lefthand; +vr::VRSkeletalSummaryData_t vr_ss_righthand; + +std::array<std::array<float, 6>, 2> vr_lastfinger_frame{}; +std::array<std::array<float, 6>, 2> vr_fingertracking_frame{}; + +float vr_menu_mouse_x{}; +float vr_menu_mouse_y{}; +bool vr_menu_mouse_click{}; + VrGunWallCollision vr_gun_wall_collision[2]; float vr_2h_aim_transition[2]{0.f, 0.f}; float vr_2h_aim_stock_transition[2]{0.f, 0.f}; bool gotLastPlayerOrigin{false}; -glm::vec3 lastPlayerOrigin; +qvec3 lastPlayerOrigin; float lastPlayerHeadYaw{}; float lastVrYawDiff{}; float vr_menu_mult{0.f}; bool vr_should_aim_2h[2]{}; bool vr_active_2h_helping_hand[2]{}; int vr_hardcoded_wpn_cvar_fist{16}; -glm::vec3 lastMenuAngles; +qvec3 lastMenuAngles; + +struct WpnButtonState +{ + bool _hover{false}; + bool _prevHover{false}; + float _lastClTime{0.f}; +}; + +WpnButtonState vr_wpnbutton_state[2]; // TODO VR: (P2) not sure what this number should actually be... enum @@ -168,164 +258,9 @@ enum cvar_t vr_weapon_offset[e_MAX_WEAPONS * static_cast<std::size_t>(WpnCVar::k_Max)]; -// TODO VR: (P2) organize and encapsulate -int vr_impl_draw_wpnoffset_helper_offset{0}; -int vr_impl_draw_wpnoffset_helper_muzzle{0}; -int vr_impl_draw_wpnoffset_helper_2h_offset{0}; -int vr_impl_draw_hand_anchor_vertex{0}; -int vr_impl_draw_2h_hand_anchor_vertex{0}; -int vr_impl_draw_wpnoffset_helper_length{0}; - float vr_debug_max_handvelmag{0.f}; float vr_debug_max_handvelmag_timeout{0.f}; -// -// -// -// ---------------------------------------------------------------------------- -// VR CVar Initialization and Registration -// ---------------------------------------------------------------------------- - -static std::vector<cvar_t*> cvarsToRegister; - -#define DEFINE_CVAR(name, defaultValue, type) \ - cvar_t name = {#name, #defaultValue, type}; \ - static struct _cvar_registrar##name##__LINE__##_t \ - { \ - _cvar_registrar##name##__LINE__##_t() \ - { \ - cvarsToRegister.emplace_back(&name); \ - } \ - } _cvar_registrar##name##__LINE__ - -#define DEFINE_CVAR_ARCHIVE(name, defaultValue) \ - DEFINE_CVAR(name, defaultValue, CVAR_ARCHIVE); - -DEFINE_CVAR(vr_enabled, 0, CVAR_NONE); -DEFINE_CVAR(vr_viewkick, 0, CVAR_NONE); -DEFINE_CVAR(vr_lefthanded, 0, CVAR_NONE); -DEFINE_CVAR(vr_fakevr, 0, CVAR_NONE); - -// TODO VR: (P1) decide what to do with this -DEFINE_CVAR(vr_enable_grapple, 0, CVAR_NONE); - -DEFINE_CVAR_ARCHIVE(vr_crosshair, 1); -DEFINE_CVAR_ARCHIVE(vr_crosshair_depth, 0); -DEFINE_CVAR_ARCHIVE(vr_crosshair_size, 3.0); -DEFINE_CVAR_ARCHIVE(vr_crosshair_alpha, 0.25); -DEFINE_CVAR_ARCHIVE(vr_aimmode, 7); -DEFINE_CVAR_ARCHIVE(vr_deadzone, 30); -DEFINE_CVAR_ARCHIVE(vr_gunangle, 32); -DEFINE_CVAR_ARCHIVE(vr_gunmodelpitch, 0); -DEFINE_CVAR_ARCHIVE(vr_gunmodelscale, 1.0); -DEFINE_CVAR_ARCHIVE(vr_gunmodely, 0); -DEFINE_CVAR_ARCHIVE(vr_crosshairy, 0); -DEFINE_CVAR_ARCHIVE(vr_world_scale, 1.0); -DEFINE_CVAR_ARCHIVE(vr_floor_offset, -16); -DEFINE_CVAR_ARCHIVE(vr_snap_turn, 0); -DEFINE_CVAR_ARCHIVE(vr_enable_joystick_turn, 1); -DEFINE_CVAR_ARCHIVE(vr_turn_speed, 1); -DEFINE_CVAR_ARCHIVE(vr_msaa, 4); -DEFINE_CVAR_ARCHIVE(vr_movement_mode, 0); -DEFINE_CVAR_ARCHIVE(vr_hud_scale, 0.025); -DEFINE_CVAR_ARCHIVE(vr_menu_scale, 0.13); -DEFINE_CVAR_ARCHIVE(vr_melee_threshold, 7); -DEFINE_CVAR_ARCHIVE(vr_gunyaw, 0); -DEFINE_CVAR_ARCHIVE(vr_gun_z_offset, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_mode, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_offset_x, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_offset_y, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_offset_z, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_offset_pitch, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_offset_yaw, 0); -DEFINE_CVAR_ARCHIVE(vr_sbar_offset_roll, 0); -DEFINE_CVAR_ARCHIVE(vr_roomscale_jump, 1); -DEFINE_CVAR_ARCHIVE(vr_height_calibration, 1.6); -DEFINE_CVAR_ARCHIVE(vr_roomscale_jump_threshold, 1.0); -DEFINE_CVAR_ARCHIVE(vr_menu_distance, 76); -DEFINE_CVAR_ARCHIVE(vr_melee_dmg_multiplier, 1.0); -DEFINE_CVAR_ARCHIVE(vr_melee_range_multiplier, 1.0); -DEFINE_CVAR_ARCHIVE(vr_body_interactions, 0); -DEFINE_CVAR_ARCHIVE(vr_roomscale_move_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_teleport_enabled, 1); -DEFINE_CVAR_ARCHIVE(vr_teleport_range, 400); -DEFINE_CVAR_ARCHIVE(vr_2h_mode, 2); -DEFINE_CVAR_ARCHIVE(vr_2h_angle_threshold, 0.65); -DEFINE_CVAR_ARCHIVE(vr_virtual_stock_thresh, 10); -DEFINE_CVAR_ARCHIVE(vr_show_virtual_stock, 0); -DEFINE_CVAR_ARCHIVE(vr_shoulder_offset_x, -1.5); -DEFINE_CVAR_ARCHIVE(vr_shoulder_offset_y, 1.75); -DEFINE_CVAR_ARCHIVE(vr_shoulder_offset_z, 16.0); -DEFINE_CVAR_ARCHIVE(vr_2h_virtual_stock_factor, 0.5); -DEFINE_CVAR_ARCHIVE(vr_wpn_pos_weight, 1); -DEFINE_CVAR_ARCHIVE(vr_wpn_pos_weight_offset, 0.0); -DEFINE_CVAR_ARCHIVE(vr_wpn_pos_weight_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_wpn_pos_weight_2h_help_offset, 0.3); -DEFINE_CVAR_ARCHIVE(vr_wpn_pos_weight_2h_help_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_wpn_dir_weight, 1); -DEFINE_CVAR_ARCHIVE(vr_wpn_dir_weight_offset, 0.0); -DEFINE_CVAR_ARCHIVE(vr_wpn_dir_weight_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_wpn_dir_weight_2h_help_offset, 0.3); -DEFINE_CVAR_ARCHIVE(vr_wpn_dir_weight_2h_help_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_offhandpitch, 0.0); -DEFINE_CVAR_ARCHIVE(vr_offhandyaw, 0.0); -DEFINE_CVAR_ARCHIVE(vr_show_hip_holsters, 0); -DEFINE_CVAR_ARCHIVE(vr_hip_offset_x, -1.0); -DEFINE_CVAR_ARCHIVE(vr_hip_offset_y, 7.0); -DEFINE_CVAR_ARCHIVE(vr_hip_offset_z, 4.5); -DEFINE_CVAR_ARCHIVE(vr_hip_holster_thresh, 6.0); -DEFINE_CVAR_ARCHIVE(vr_show_shoulder_holsters, 0); -DEFINE_CVAR_ARCHIVE(vr_shoulder_holster_offset_x, 5.0); -DEFINE_CVAR_ARCHIVE(vr_shoulder_holster_offset_y, 1.5); -DEFINE_CVAR_ARCHIVE(vr_shoulder_holster_offset_z, 0.0); -DEFINE_CVAR_ARCHIVE(vr_shoulder_holster_thresh, 8.0); -DEFINE_CVAR_ARCHIVE(vr_show_upper_holsters, 0); -DEFINE_CVAR_ARCHIVE(vr_upper_holster_offset_x, 2.5); -DEFINE_CVAR_ARCHIVE(vr_upper_holster_offset_y, 6.5); -DEFINE_CVAR_ARCHIVE(vr_upper_holster_offset_z, 2.5); -DEFINE_CVAR_ARCHIVE(vr_upper_holster_thresh, 6.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_debuglines_enabled, 0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_enabled, 1); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_x_offset, -3.25); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_y_offset, 0.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_z_offset, -21.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_head_z_mult, 32.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_x_scale, 1.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_y_scale, 1.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_z_scale, 1.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_pitch, 0.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_yaw, 0.0); -DEFINE_CVAR_ARCHIVE(vr_vrtorso_roll, 0.0); -DEFINE_CVAR_ARCHIVE(vr_holster_haptics, 1); -DEFINE_CVAR_ARCHIVE(vr_player_shadows, 2); -DEFINE_CVAR_ARCHIVE(vr_positional_damage, 1); -DEFINE_CVAR_ARCHIVE(vr_debug_print_handvel, 0); -DEFINE_CVAR_ARCHIVE(vr_debug_show_hand_pos_and_rot, 0); -DEFINE_CVAR_ARCHIVE(vr_leg_holster_model_enabled, 1); -DEFINE_CVAR_ARCHIVE(vr_leg_holster_model_scale, 1); -DEFINE_CVAR_ARCHIVE(vr_leg_holster_model_x_offset, 0.0); -DEFINE_CVAR_ARCHIVE(vr_leg_holster_model_y_offset, 0.0); -DEFINE_CVAR_ARCHIVE(vr_leg_holster_model_z_offset, 0.0); -DEFINE_CVAR_ARCHIVE(vr_holster_mode, 0); -DEFINE_CVAR_ARCHIVE(vr_weapon_throw_mode, 0); -DEFINE_CVAR_ARCHIVE(vr_weapon_throw_damage_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_weapon_throw_velocity_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_weapon_cycle_mode, 0); -DEFINE_CVAR_ARCHIVE(vr_melee_bloodlust, 0); -DEFINE_CVAR_ARCHIVE(vr_melee_bloodlust_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_enemy_drops, 0); -DEFINE_CVAR_ARCHIVE(vr_enemy_drops_chance_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_ammobox_drops, 0); -DEFINE_CVAR_ARCHIVE(vr_ammobox_drops_chance_mult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_menumode, 0); -DEFINE_CVAR_ARCHIVE(vr_forcegrab_powermult, 1.0); -DEFINE_CVAR_ARCHIVE(vr_forcegrab_mode, 1); -DEFINE_CVAR_ARCHIVE(vr_forcegrab_range, 150.0); -DEFINE_CVAR_ARCHIVE(vr_forcegrab_radius, 18.0); -DEFINE_CVAR_ARCHIVE(vr_forcegrab_eligible_particles, 1); -DEFINE_CVAR_ARCHIVE(vr_forcegrab_eligible_haptics, 1); -DEFINE_CVAR_ARCHIVE(vr_weapondrop_particles, 1); - // // // @@ -367,18 +302,18 @@ void RecreateTextures( fbo->size.width = width; fbo->size.height = height; - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->framebuffer); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, - GL_TEXTURE_2D, fbo->texture, 0); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - GL_TEXTURE_2D, fbo->depth_texture, 0); + glBindFramebuffer(GL_FRAMEBUFFER, fbo->framebuffer); + glFramebufferTexture2D( + GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo->texture, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, + fbo->depth_texture, 0); } [[nodiscard]] fbo_t CreateFBO(const int width, const int height) noexcept { fbo_t fbo; - glGenFramebuffersEXT(1, &fbo.framebuffer); + glGenFramebuffers(1, &fbo.framebuffer); fbo.depth_texture = 0; @@ -405,30 +340,30 @@ void CreateMSAA(fbo_t* const fbo, const int width, const int height, if(fbo->msaa_framebuffer) { - glDeleteFramebuffersEXT(1, &fbo->msaa_framebuffer); + glDeleteFramebuffers(1, &fbo->msaa_framebuffer); glDeleteTextures(1, &fbo->msaa_texture); glDeleteTextures(1, &fbo->msaa_depth_texture); } - glGenFramebuffersEXT(1, &fbo->msaa_framebuffer); + glGenFramebuffers(1, &fbo->msaa_framebuffer); glGenTextures(1, &fbo->msaa_texture); glGenTextures(1, &fbo->msaa_depth_texture); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, fbo->msaa_texture); - glTexImage2DMultisampleEXT( + glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, msaa, GL_RGBA8, width, height, false); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, fbo->msaa_depth_texture); - glTexImage2DMultisampleEXT(GL_TEXTURE_2D_MULTISAMPLE, msaa, + glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, msaa, GL_DEPTH_COMPONENT24, width, height, false); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->msaa_framebuffer); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + glBindFramebuffer(GL_FRAMEBUFFER, fbo->msaa_framebuffer); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, fbo->msaa_texture, 0); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D_MULTISAMPLE, fbo->msaa_depth_texture, 0); - const GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + const GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if(status != GL_FRAMEBUFFER_COMPLETE) { Con_Printf("Framebuffer incomplete %x", status); @@ -438,21 +373,20 @@ void CreateMSAA(fbo_t* const fbo, const int width, const int height, // TODO VR: (P2) never called void DeleteFBO(const fbo_t& fbo) { - glDeleteFramebuffersEXT(1, &fbo.framebuffer); + glDeleteFramebuffers(1, &fbo.framebuffer); glDeleteTextures(1, &fbo.depth_texture); glDeleteTextures(1, &fbo.texture); } // TODO VR: (P2) move to util? This uses `vrYaw` inside -[[nodiscard]] glm::vec3 QuatToYawPitchRoll( - const vr::HmdQuaternion_t& q) noexcept +[[nodiscard]] qvec3 QuatToYawPitchRoll(const vr::HmdQuaternion_t& q) noexcept { const auto sqw = q.w * q.w; const auto sqx = q.x * q.x; const auto sqy = q.y * q.y; const auto sqz = q.z * q.z; - glm::vec3 out; + qvec3 out; out[PITCH] = -asin(-2 * (q.y * q.z - q.w * q.x)) / M_PI_DIV_180; out[YAW] = atan2(2 * (q.x * q.z + q.w * q.y), sqw - sqx - sqy + sqz) / @@ -464,8 +398,8 @@ void DeleteFBO(const fbo_t& fbo) return out; } -[[nodiscard]] glm::vec3 Vec3RotateZ( - const glm::vec3& in, const float angle) noexcept +[[nodiscard]] static qvec3 Vec3RotateZ( + const qvec3& in, const qfloat angle) noexcept { return { in[0] * std::cos(angle) - in[1] * std::sin(angle), // @@ -514,8 +448,8 @@ void DeleteFBO(const fbo_t& fbo) u.v[2] = q.z; // Dot products of u,v and u,u - const float uvDot = u.v[0] * v.v[0] + u.v[1] * v.v[1] + u.v[2] * v.v[2]; - const float uuDot = u.v[0] * u.v[0] + u.v[1] * u.v[1] + u.v[2] * u.v[2]; + const auto uvDot = u.v[0] * v.v[0] + u.v[1] * v.v[1] + u.v[2] * v.v[2]; + const auto uuDot = u.v[0] * u.v[0] + u.v[1] * u.v[1] + u.v[2] * u.v[2]; // Calculate cross product of u, v vr::HmdVector3_t uvCross; @@ -525,7 +459,7 @@ void DeleteFBO(const fbo_t& fbo) // Calculate each vectors' result individually because there aren't // arthimetic functions for HmdVector3_t dsahfkldhsaklfhklsadh - const float s = q.w; + const auto s = q.w; vr::HmdVector3_t result; result.v[0] = u.v[0] * 2.0f * uvDot + (s * s - uuDot) * v.v[0] + @@ -597,12 +531,12 @@ void DeleteFBO(const fbo_t& fbo) return q; } -void HmdVec3RotateY(vr::HmdVector3_t& pos, const float angle) noexcept +static void HmdVec3RotateY(vr::HmdVector3_t& pos, const qfloat angle) noexcept { - const float s = std::sin(angle); - const float c = std::cos(angle); - const float x = c * pos.v[0] - s * pos.v[2]; - const float y = s * pos.v[0] + c * pos.v[2]; + const auto s = std::sin(angle); + const auto c = std::cos(angle); + const auto x = c * pos.v[0] - s * pos.v[2]; + const auto y = s * pos.v[0] + c * pos.v[2]; pos.v[0] = x; pos.v[2] = y; @@ -652,17 +586,17 @@ static void VR_Deadzone_f(cvar_t* var) noexcept // Weapon CVars // ---------------------------------------------------------------------------- -[[nodiscard]] static float VR_GetScaleCorrect() noexcept +[[nodiscard]] static qfloat VR_GetScaleCorrect() noexcept { // Initial version had 0.75 default world scale, so weapons reflect // that. - return (vr_world_scale.value / 0.75f) * vr_gunmodelscale.value; + return (vr_world_scale.value / 0.75_qf) * vr_gunmodelscale.value; } -void VR_ApplyModelMod(const glm::vec3& scale, const glm::vec3& offsets, - aliashdr_t* const hdr) noexcept +void VR_ApplyModelMod( + const qvec3& scale, const qvec3& offsets, aliashdr_t* const hdr) noexcept { - const float scaleCorrect = VR_GetScaleCorrect(); + const auto scaleCorrect = VR_GetScaleCorrect(); hdr->scale = hdr->original_scale * scale * scaleCorrect; hdr->scale_origin = hdr->original_scale_origin + offsets; @@ -671,7 +605,7 @@ void VR_ApplyModelMod(const glm::vec3& scale, const glm::vec3& offsets, [[nodiscard]] float VR_GetEasyHandTouchBonus() noexcept { - return 5.f; + return 4.5f; } [[nodiscard]] int VR_OtherHand(const int hand) noexcept @@ -693,9 +627,20 @@ void VR_ApplyModelMod(const glm::vec3& scale, const glm::vec3& offsets, vr_active_2h_helping_hand[helpingHand]; } +[[nodiscard]] bool VR_IsHandGrabbing(const int hand) noexcept +{ + if(hand == cVR_OffHand) + { + return vr_left_grabbing; + } + + assert(hand == cVR_MainHand); + return vr_right_grabbing; +} + void ApplyMod_Weapon(const int cvarEntry, aliashdr_t* const hdr) { - const glm::vec3 ofs = VR_GetWpnOffsets(cvarEntry); + const auto ofs = VR_GetWpnOffsets(cvarEntry); const auto scale = VR_GetWpnCVarValue(cvarEntry, WpnCVar::Scale); VR_ApplyModelMod({scale, scale, scale}, ofs, hdr); @@ -783,7 +728,7 @@ char* CopyWithNumeral(const char* str, int i) return VR_GetMainHandWpnCvarEntry(); } -[[nodiscard]] glm::vec3 VR_GetWpnOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::OffsetX), @@ -791,7 +736,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::OffsetZ) + vr_gunmodely.value}; } -[[nodiscard]] glm::vec3 VR_GetWpn2HOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpn2HOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHOffsetX), @@ -799,7 +744,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHOffsetZ)}; } -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnFixed2HOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHFixedOffsetX), @@ -807,7 +752,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHFixedOffsetZ)}; } -[[nodiscard]] glm::vec3 VR_GetWpnGunOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnGunOffsets(const int cvarEntry) noexcept { // TODO VR: (P1) bugged at the moment, need to use angles and stop hand from // moving @@ -818,7 +763,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::GunOffsetZ)}; } -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HHandAngles(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnFixed2HHandAngles(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHFixedHandPitch), @@ -826,7 +771,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHFixedHandRoll)}; } -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HMainHandOffsets( +[[nodiscard]] qvec3 VR_GetWpnFixed2HMainHandOffsets( const int cvarEntry) noexcept { return {// @@ -835,7 +780,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHFixedMainHandOffsetZ)}; } -[[nodiscard]] glm::vec3 VR_GetWpnAngleOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnAngleOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::Pitch) + vr_gunmodelpitch.value, @@ -843,7 +788,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::Roll)}; } -[[nodiscard]] glm::vec3 VR_GetWpnMuzzleOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnMuzzleOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::MuzzleOffsetX), @@ -851,8 +796,23 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::MuzzleOffsetZ)}; } +[[nodiscard]] qvec3 VR_GetWpnButtonOffsets(const int cvarEntry) noexcept +{ + return {// + VR_GetWpnCVarValue(cvarEntry, WpnCVar::WpnButtonX), + VR_GetWpnCVarValue(cvarEntry, WpnCVar::WpnButtonY), + VR_GetWpnCVarValue(cvarEntry, WpnCVar::WpnButtonZ)}; +} + +[[nodiscard]] qvec3 VR_GetWpnButtonAngles(const int cvarEntry) noexcept +{ + return {// + VR_GetWpnCVarValue(cvarEntry, WpnCVar::WpnButtonPitch), + VR_GetWpnCVarValue(cvarEntry, WpnCVar::WpnButtonYaw), + VR_GetWpnCVarValue(cvarEntry, WpnCVar::WpnButtonRoll)}; +} -[[nodiscard]] glm::vec3 VR_GetWpn2HAngleOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpn2HAngleOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHPitch), @@ -860,7 +820,7 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHRoll)}; } -[[nodiscard]] glm::vec3 VR_GetWpnHandOffsets(const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_GetWpnHandOffsets(const int cvarEntry) noexcept { return {// VR_GetWpnCVarValue(cvarEntry, WpnCVar::HandOffsetX), @@ -868,14 +828,6 @@ char* CopyWithNumeral(const char* str, int i) VR_GetWpnCVarValue(cvarEntry, WpnCVar::HandOffsetZ)}; } -[[nodiscard]] glm::vec3 VR_GetWpnOffHandOffsets(const int cvarEntry) noexcept -{ - return {// - VR_GetWpnCVarValue(cvarEntry, WpnCVar::OffHandOffsetX), - VR_GetWpnCVarValue(cvarEntry, WpnCVar::OffHandOffsetY), - VR_GetWpnCVarValue(cvarEntry, WpnCVar::OffHandOffsetZ)}; -} - [[nodiscard]] Wpn2HMode VR_GetWpn2HMode(const int cvarEntry) noexcept { return cvarToEnum<Wpn2HMode>(VR_GetWpnCVar(cvarEntry, WpnCVar::TwoHMode)); @@ -928,6 +880,10 @@ int InitWeaponCVars(int i, const char* id, const char* offsetX, const char* twoHDisplayMode = "0.0", const char* twoHHandAnchorVertex = "0.0") { + (void)offHandOffsetX; + (void)offHandOffsetY; + (void)offHandOffsetZ; + const auto init = [&](const WpnCVar wpnCVar, const char* name, const char* defaultVal) { InitWeaponCVar(VR_GetWpnCVar(i, wpnCVar), name, i, defaultVal); @@ -958,9 +914,12 @@ int InitWeaponCVars(int i, const char* id, const char* offsetX, init(WpnCVar::HandOffsetY, "vr_wofs_hand_y_nn", handOffsetY); init(WpnCVar::HandOffsetZ, "vr_wofs_hand_z_nn", handOffsetZ); init(WpnCVar::HandAnchorVertex, "vr_wofs_hand_av_nn", handAnchorVertex); - init(WpnCVar::OffHandOffsetX, "vr_wofs_offhand_x_nn", offHandOffsetX); - init(WpnCVar::OffHandOffsetY, "vr_wofs_offhand_y_nn", offHandOffsetY); - init(WpnCVar::OffHandOffsetZ, "vr_wofs_offhand_z_nn", offHandOffsetZ); + + // TODO VR: (P1) deprecated + // init(WpnCVar::OffHandOffsetX, "vr_wofs_offhand_x_nn", offHandOffsetX); + // init(WpnCVar::OffHandOffsetY, "vr_wofs_offhand_y_nn", offHandOffsetY); + // init(WpnCVar::OffHandOffsetZ, "vr_wofs_offhand_z_nn", offHandOffsetZ); + init(WpnCVar::CrosshairMode, "vr_wofs_ch_mode_z_nn", crosshairMode); init(WpnCVar::HideHand, "vr_wofs_hide_hand_nn", hideHand); init(WpnCVar::TwoHDisplayMode, "vr_wofs_2h_dispmd_nn", twoHDisplayMode); @@ -983,6 +942,23 @@ int InitWeaponCVars(int i, const char* id, const char* offsetX, init(WpnCVar::WeightHandThrowVelMult, "vr_wofs_w_htvelmult_nn", "1.0"); init(WpnCVar::Weight2HPosMult, "vr_wofs_w_2hposmult_nn", "1.0"); init(WpnCVar::Weight2HDirMult, "vr_wofs_w_2hdirmult_nn", "1.0"); + init(WpnCVar::WpnButtonMode, "vr_wofs_wpnbtnmode_nn", "0.0"); + init(WpnCVar::WpnButtonX, "vr_wofs_wpnbtn_x_nn", "0.0"); + init(WpnCVar::WpnButtonY, "vr_wofs_wpnbtn_y_nn", "0.0"); + init(WpnCVar::WpnButtonZ, "vr_wofs_wpnbtn_z_nn", "0.0"); + init(WpnCVar::WpnButtonAnchorVertex, "vr_wofs_wpnbtn_av_nn", "0.0"); + + // TODO VR: (P1) deprecated + // init(WpnCVar::WpnButtonOffHandX, "vr_wofs_wpnbtn_oh_x_nn", "0.0"); + // init(WpnCVar::WpnButtonOffHandY, "vr_wofs_wpnbtn_oh_y_nn", "0.0"); + // init(WpnCVar::WpnButtonOffHandZ, "vr_wofs_wpnbtn_oh_z_nn", "0.0"); + + init(WpnCVar::WpnButtonPitch, "vr_wofs_wpnbtn_pitch_nn", "0.0"); + init(WpnCVar::WpnButtonYaw, "vr_wofs_wpnbtn_yaw_nn", "0.0"); + init(WpnCVar::WpnButtonRoll, "vr_wofs_wpnbtn_roll_nn", "0.0"); + init(WpnCVar::MuzzleAnchorVertex, "vr_wofs_muzzle_av_nn", "0.0"); + init(WpnCVar::ZeroBlend, "vr_wofs_zb_nn", "0.0"); + init(WpnCVar::TwoHZeroBlend, "vr_wofs_zb_2h_nn", "0.0"); // clang-format on return i; @@ -1064,11 +1040,7 @@ void VID_VR_Init() Cvar_SetCallback(&vr_enabled, VR_Enabled_f); Cvar_SetCallback(&vr_deadzone, VR_Deadzone_f); - for(cvar_t* c : cvarsToRegister) - { - Cvar_RegisterVariable(c); - } - + quake::vr::register_all_cvars(); InitAllWeaponCVars(); // VR: Fix grenade model flags to enable smoke trail. @@ -1092,8 +1064,8 @@ void VR_InitGame() void VR_ModVRTorsoModel() { - const glm::vec3 vrTorsoScale{vr_vrtorso_x_scale.value, - vr_vrtorso_y_scale.value, vr_vrtorso_z_scale.value}; + const qvec3 vrTorsoScale{vr_vrtorso_x_scale.value, vr_vrtorso_y_scale.value, + vr_vrtorso_z_scale.value}; auto* model = Mod_ForName("progs/vrtorso.mdl", true); auto* hdr = (aliashdr_t*)Mod_Extradata(model); @@ -1104,7 +1076,7 @@ void VR_ModVRTorsoModel() void VR_ModVRLegHolsterModel() { const auto factor = vr_leg_holster_model_scale.value; - const glm::vec3 legHolsterScale{factor, factor, factor}; + const qvec3 legHolsterScale{factor, factor, factor}; auto* model = Mod_ForName("progs/legholster.mdl", true); auto* hdr = (aliashdr_t*)Mod_Extradata(model); @@ -1164,7 +1136,10 @@ void VR_ModAllModels() vr::VRActiveActionSet_t vrActiveActionSet; vr::VRActionSetHandle_t vrashDefault; +vr::VRActionSetHandle_t vrashMenu; +vr::VRActionHandle_t vrahLeftHandAnim; +vr::VRActionHandle_t vrahRightHandAnim; vr::VRActionHandle_t vrahLocomotion; vr::VRActionHandle_t vrahTurn; vr::VRActionHandle_t vrahFireMainHand; @@ -1188,6 +1163,18 @@ vr::VRActionHandle_t vrahBTurnRight; vr::VRActionHandle_t vrahLeftHaptic; vr::VRActionHandle_t vrahRightHaptic; +vr::VRActionHandle_t vrahMenuNavigation; +vr::VRActionHandle_t vrahMenuUp; +vr::VRActionHandle_t vrahMenuDown; +vr::VRActionHandle_t vrahMenuLeft; +vr::VRActionHandle_t vrahMenuRight; +vr::VRActionHandle_t vrahMenuEnter; +vr::VRActionHandle_t vrahMenuBack; +vr::VRActionHandle_t vrahMenuAddToShortcuts; +vr::VRActionHandle_t vrahMenuMultiplierHalf; +vr::VRActionHandle_t vrahMenuMultiplierPlusOne; +vr::VRActionHandle_t vrahMenuMultiplierPlusOne2; + vr::VRInputValueHandle_t vrivhLeft; vr::VRInputValueHandle_t vrivhRight; @@ -1206,6 +1193,19 @@ static void VR_InitActionHandles() } } + // ----------------------------------------------------------------------- + // VR: Read "menu" action set handle. + { + const auto rc = + vr::VRInput()->GetActionSetHandle("/actions/menu", &vrashMenu); + + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf("Failed to read Steam VR action set handle, rc = %d\n", + (int)rc); + } + } + // ----------------------------------------------------------------------- // VR: Read all action handles. const auto readHandle = [](const char* name, vr::VRActionHandle_t& handle) { @@ -1218,6 +1218,10 @@ static void VR_InitActionHandles() } }; + // Skeleton options. + readHandle("/actions/default/in/LeftHandAnim", vrahLeftHandAnim); + readHandle("/actions/default/in/RightHandAnim", vrahRightHandAnim); + // Analog joystick options. readHandle("/actions/default/in/Locomotion", vrahLocomotion); readHandle("/actions/default/in/Turn", vrahTurn); @@ -1250,6 +1254,20 @@ static void VR_InitActionHandles() readHandle("/actions/default/out/LeftHaptic", vrahLeftHaptic); readHandle("/actions/default/out/RightHaptic", vrahRightHaptic); + // Menu. + readHandle("/actions/menu/in/Navigation", vrahMenuNavigation); + readHandle("/actions/menu/in/Up", vrahMenuUp); + readHandle("/actions/menu/in/Down", vrahMenuDown); + readHandle("/actions/menu/in/Left", vrahMenuLeft); + readHandle("/actions/menu/in/Right", vrahMenuRight); + readHandle("/actions/menu/in/Enter", vrahMenuEnter); + readHandle("/actions/menu/in/Back", vrahMenuBack); + readHandle("/actions/menu/in/AddToShortcuts", vrahMenuAddToShortcuts); + readHandle("/actions/menu/in/MultiplierHalf", vrahMenuMultiplierHalf); + readHandle("/actions/menu/in/MultiplierPlusOne", vrahMenuMultiplierPlusOne); + readHandle( + "/actions/menu/in/MultiplierPlusOne2", vrahMenuMultiplierPlusOne2); + vrActiveActionSet.ulActionSet = vrashDefault; vrActiveActionSet.ulRestrictedToDevice = vr::k_ulInvalidInputValueHandle; vrActiveActionSet.nPriority = 0; @@ -1283,27 +1301,60 @@ static void VR_InitActionHandles() return key_dest == key_menu; } +[[nodiscard]] static bool inConsole() noexcept +{ + return key_dest == key_console; +} + +[[nodiscard]] static bool inMenuOrConsole() noexcept +{ + return inMenu() || inConsole(); +} + [[nodiscard]] static bool inGame() noexcept { return key_dest == key_game; } -[[nodiscard]] static bool svPlayerActive() noexcept +[[nodiscard]] edict_t* getPlayerEdictUnchecked() noexcept +{ + return svs.clients[0].edict; + // return sv_player; +} + +[[nodiscard]] bool svPlayerActive() noexcept { // TODO VR: (P2) document, this is because of Host_ClearMemory and map // change callback - return sv_player != nullptr && sv.active == true && sv.state == ss_active && - cls.signon == SIGNONS; + // return getPlayerEdictUnchecked() != nullptr && cls.signon == SIGNONS; + + // sv.active == true && sv.state == ss_active + + return svs.clients != nullptr && svs.clients[0].active && + svs.clients[0].spawned && getPlayerEdictUnchecked() != nullptr && + sv.active == true && sv.state == ss_active && cls.signon == SIGNONS; } -[[nodiscard]] static edict_t* getPlayerEdict() noexcept +// TODO VR: (P1) grep for invocations of the fn below for multiplayer issues +[[nodiscard]] edict_t* getPlayerEdict() noexcept { assert(svPlayerActive()); - return sv_player; + return getPlayerEdictUnchecked(); } bool VR_Enable() { + if(COM_CheckParm("-novr")) + { + Cvar_SetValueQuick(&vr_fakevr, 1); + Cvar_SetValueQuick(&vr_novrinit, 1); + } + + if(vr_fakevr.value && vr_novrinit.value) + { + return true; + } + if(vr_initialized) { return true; @@ -1340,12 +1391,6 @@ bool VR_Enable() } } - if(!quake::gl::InitOpenGLExtensions()) - { - Con_Printf("Failed to initialize OpenGL extensions"); - return false; - } - eyes[0].eye = vr::Eye_Left; eyes[1].eye = vr::Eye_Right; @@ -1372,7 +1417,10 @@ bool VR_Enable() VR_ResetOrientation(); // Recenter the HMD - wglSwapIntervalEXT(0); // Disable V-Sync + if(const int rc = SDL_GL_SetSwapInterval(0); rc != 0) // Disable V-Sync + { + Con_Printf("Error disabling VSync, rc=%d\n", rc); + } Cbuf_AddText( "exec vr_autoexec.cfg\n"); // Load the vr autosec config file incase @@ -1412,6 +1460,11 @@ void VID_VR_Disable() static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) { + if(vr_fakevr.value || vr_novrinit.value) + { + return; + } + // Remember the current glwidth/height; we have to modify it here for // each eye const int oldglheight = glheight; @@ -1449,11 +1502,11 @@ static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) if(eye.fbo.msaa > 0) { glEnable(GL_MULTISAMPLE); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, eye.fbo.msaa_framebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, eye.fbo.msaa_framebuffer); } else { - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, eye.fbo.framebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, eye.fbo.framebuffer); } glViewport(0, 0, eye.fbo.size.width, eye.fbo.size.height); @@ -1472,10 +1525,9 @@ static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) if(eye.fbo.msaa > 0) { glDisable(GL_MULTISAMPLE); - glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, eye.fbo.framebuffer); - glBindFramebufferEXT(GL_READ_FRAMEBUFFER, eye.fbo.msaa_framebuffer); - glDrawBuffer(GL_BACK); - glBlitFramebufferEXT(0, 0, glwidth, glheight, 0, 0, glwidth, glheight, + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, eye.fbo.framebuffer); + glBindFramebuffer(GL_READ_FRAMEBUFFER, eye.fbo.msaa_framebuffer); + glBlitFramebuffer(0, 0, glwidth, glheight, 0, 0, glwidth, glheight, GL_COLOR_BUFFER_BIT, GL_NEAREST); } @@ -1488,24 +1540,23 @@ static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) glwidth = oldglwidth; glheight = oldglheight; - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); } // Get a reasonable height around where hands should be when aiming a gun. -[[nodiscard]] float VR_GetHandZOrigin(const glm::vec3& playerOrigin) noexcept +[[nodiscard]] float VR_GetHandZOrigin(const qvec3& playerOrigin) noexcept { return playerOrigin[2] + vr_floor_offset.value + vr_gun_z_offset.value; } // Get the player origin vector, but adjusted to the upper torso on the Z axis. -[[nodiscard]] glm::vec3 VR_GetAdjustedPlayerOrigin( - glm::vec3 playerOrigin) noexcept +[[nodiscard]] qvec3 VR_GetAdjustedPlayerOrigin(qvec3 playerOrigin) noexcept { playerOrigin[2] = VR_GetHandZOrigin(playerOrigin) + 40; return playerOrigin; } -[[nodiscard]] static float VR_GetWeaponWeightFactorImpl(const int cvarEntry, +[[nodiscard]] static qfloat VR_GetWeaponWeightFactorImpl(const int cvarEntry, const float aiming2H, const float weightOffset, const float weightMult, const float twoHHelpOffset, const float twoHHelpMult, const float wpnTwoHMult) @@ -1522,7 +1573,7 @@ static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) return std::clamp(finalFactor, 0.f, 1.f); } -[[nodiscard]] float VR_GetWeaponWeightPosFactor( +[[nodiscard]] qfloat VR_GetWeaponWeightPosFactor( const int cvarEntry, const float aiming2H) { return VR_GetWeaponWeightFactorImpl(cvarEntry, aiming2H, // @@ -1534,7 +1585,7 @@ static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) ); } -[[nodiscard]] float VR_GetWeaponWeightDirFactor( +[[nodiscard]] qfloat VR_GetWeaponWeightDirFactor( const int cvarEntry, const float aiming2H) { return VR_GetWeaponWeightFactorImpl(cvarEntry, aiming2H, // @@ -1547,7 +1598,7 @@ static void RenderScreenForCurrentEye_OVR(vr_eye_t& eye) } template <auto TFactorFn> -[[nodiscard]] static float VR_CalcWeaponWeight(const int handIndex) noexcept +[[nodiscard]] static qfloat VR_CalcWeaponWeight(const int handIndex) noexcept { return (handIndex == 0 && !vr_should_aim_2h[handIndex]) ? (*TFactorFn)(VR_GetOffHandWpnCvarEntry(), 0.f) @@ -1556,15 +1607,15 @@ template <auto TFactorFn> } template <auto TFactorFn> -[[nodiscard]] static float VR_CalcWeaponWeightFTAdjusted( +[[nodiscard]] static qfloat VR_CalcWeaponWeightFTAdjusted( const int handIndex) noexcept { const auto weaponWeight = VR_CalcWeaponWeight<TFactorFn>(handIndex); - const float frametime = cl.time - cl.oldtime; + const auto frametime = cl.time - cl.oldtime; return (weaponWeight * frametime) * 100.f; } -[[nodiscard]] const glm::vec3& VR_GetHeadOrigin() noexcept +[[nodiscard]] const qvec3& VR_GetHeadOrigin() noexcept { return lastHeadOrigin; } @@ -1580,7 +1631,7 @@ void debugPrintHandvel(const int index, const float linearity) if(vr_debug_max_handvelmag_timeout > 0.f) { - const float frametime = cl.time - cl.oldtime; + const auto frametime = cl.time - cl.oldtime; vr_debug_max_handvelmag_timeout -= frametime; } else @@ -1598,29 +1649,61 @@ void debugPrintHandvel(const int index, const float linearity) } } -glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, - VrGunWallCollision& out, glm::vec3 resolvedHandPos) noexcept +void debugPrintHeadvel() { - if(!svPlayerActive()) + if(!vr_debug_print_headvel.value) { - out._ent = nullptr; - return resolvedHandPos; + return; + } + + const auto len = glm::length(cl.headvel); + if(len < 2.f) + { + return; + } + + Con_Printf("headvel: {%.2f, %.2f, %.2f} | len: %.2f\n", cl.headvel[0], + cl.headvel[1], cl.headvel[2], len); +} + +[[nodiscard]] entity_t* VR_GetAnchorEntity(const HandIdx handIdx) noexcept +{ + return handIdx == cVR_MainHand ? &cl.viewent : &cl.offhand_viewent; +} + +[[nodiscard]] bool VR_GetHorizFlip(const HandIdx handIdx) noexcept +{ + return handIdx == cVR_OffHand; +} + +[[nodiscard]] qvec3 VR_CalcLocalWpnMuzzlePos(const int index) noexcept +{ + entity_t* const anchor = VR_GetAnchorEntity(index); + + if(anchor->model == nullptr) + { + return vec3_zero; } - constexpr glm::vec3 handMins{-1.f, -1.f, -1.f}; - constexpr glm::vec3 handMaxs{1.f, 1.f, 1.f}; + return VR_CalcFinalWpnMuzzlePos(index) - anchor->origin; +} + +qvec3 VR_UpdateGunWallCollisions(edict_t* edict, const int handIndex, + VrGunWallCollision& out, qvec3 resolvedHandPos) noexcept +{ + constexpr qvec3 handMins{-1.f, -1.f, -1.f}; + constexpr qvec3 handMaxs{1.f, 1.f, 1.f}; // Local position of the gun's muzzle. Takes orientation into // account. - const auto localMuzzlePos = - VR_CalcWeaponMuzzlePosImpl(handIndex, VR_GetWpnCvarEntry(handIndex)); + const auto localMuzzlePos = VR_CalcLocalWpnMuzzlePos(handIndex); // World position of the gun's muzzle. const auto muzzlePos = resolvedHandPos + localMuzzlePos; // Check for collisions between the muzzle and geometry/entities. - const trace_t gunTrace = SV_Move(resolvedHandPos, handMins, handMaxs, - muzzlePos, MOVE_NORMAL, getPlayerEdict()); + const trace_t gunTrace = SV_Move( + resolvedHandPos, handMins, handMaxs, muzzlePos, MOVE_NORMAL, edict); // Position of the hand after resolving collisions with the gun // muzzle. @@ -1649,8 +1732,8 @@ glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, return resolvedHandPos; } -[[nodiscard]] glm::vec3 VR_GetWorldHandPos( - const int handIndex, const glm::vec3& playerOrigin) noexcept +[[nodiscard]] qvec3 VR_GetWorldHandPos( + const int handIndex, const qvec3& playerOrigin) noexcept { // Position of the hand relative to the head. const auto headLocalPreRot = controllers[handIndex].position - headOrigin; @@ -1660,7 +1743,7 @@ glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, // Position of the hand in the game world, prior to any collision // detection or resolution. - const glm::vec3 worldHandPos{ + const qvec3 worldHandPos{ -headLocal[0] + playerOrigin[0], // -headLocal[1] + playerOrigin[1], // headLocal[2] + VR_GetHandZOrigin(playerOrigin) // @@ -1669,22 +1752,17 @@ glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, return worldHandPos; } -[[nodiscard]] glm::vec3 VR_GetResolvedHandPos( - const glm::vec3& worldHandPos, const glm::vec3& adjPlayerOrigin) noexcept +[[nodiscard]] qvec3 VR_GetResolvedHandPos(edict_t* edict, + const qvec3& worldHandPos, const qvec3& adjPlayerOrigin) noexcept { - if(!svPlayerActive()) - { - return worldHandPos; - } - // Size of hand hitboxes. - constexpr glm::vec3 mins{-1.f, -1.f, -1.f}; - constexpr glm::vec3 maxs{1.f, 1.f, 1.f}; + constexpr qvec3 mins{-1.f, -1.f, -1.f}; + constexpr qvec3 maxs{1.f, 1.f, 1.f}; // Trace from upper torso to desired final location. `SV_Move` detects // entities as well, not just geometry. - const trace_t trace = SV_Move(adjPlayerOrigin, mins, maxs, worldHandPos, - MOVE_NORMAL, getPlayerEdict()); + const trace_t trace = + SV_Move(adjPlayerOrigin, mins, maxs, worldHandPos, MOVE_NORMAL, edict); // Compute final collision resolution position, starting from the // desired position and resolving only against the collision plane's @@ -1695,7 +1773,7 @@ glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, } // Resolve collision along trace normals. - glm::vec3 res = worldHandPos; + qvec3 res = worldHandPos; for(int i = 0; i < 3; ++i) { @@ -1708,13 +1786,20 @@ glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, return res; } -void SetHandPos(int index, entity_t* player) +template <typename T> +[[nodiscard]] static qvec3 openVRCoordsToQuakeCoords(const T& v) { - if(!svPlayerActive()) - { - return; - } + return qvec3{-v[2], v[0], v[1]}; +} +[[nodiscard]] static qvec3 redirectVectorByYaw( + const qvec3& input, const qfloat exemplarYaw) +{ + return redirectVector(input, {0.f, exemplarYaw, 0.f}); +} + +void SetHandPos(int index, entity_t* player) +{ // ----------------------------------------------------------------------- // VR: Figure out position of hand controllers in the game world. @@ -1724,32 +1809,36 @@ void SetHandPos(int index, entity_t* player) // VR: Detect & resolve hand collisions against the world or entities. // Start around the upper torso, not actual center of the player. - const glm::vec3 adjPlayerOrigin = - VR_GetAdjustedPlayerOrigin(player->origin); + const qvec3 adjPlayerOrigin = VR_GetAdjustedPlayerOrigin(player->origin); // TODO VR: (P2) cvar to enable/disable muzzle collisions - glm::vec3 finalVec = worldHandPos; + qvec3 finalVec = worldHandPos; // TODO VR: (P2) reintroduce as modifier // const float gunLength = index == 0 ? 0.f : // VR_GetWpnLength(VR_GetMainHandWpnCvarEntry()); - const auto resolvedHandPos = - VR_GetResolvedHandPos(worldHandPos, adjPlayerOrigin); + if(svPlayerActive()) + { + edict_t* playerEdict = getPlayerEdict(); + + const auto resolvedHandPos = + VR_GetResolvedHandPos(playerEdict, worldHandPos, adjPlayerOrigin); - finalVec = resolvedHandPos; + finalVec = resolvedHandPos; - finalVec = VR_UpdateGunWallCollisions( - index, vr_gun_wall_collision[index], finalVec); + finalVec = VR_UpdateGunWallCollisions( + playerEdict, index, vr_gun_wall_collision[index], finalVec); + } const auto oldHandpos = cl.handpos[index]; - const glm::vec3 lastPlayerTranslation = + const qvec3 lastPlayerTranslation = gotLastPlayerOrigin ? player->origin - lastPlayerOrigin : vec3_zero; // ------------------------------------------------------------------------ // VR: Interpolate hand position depending on weapon weight. - if(!inMenu() && vr_wpn_pos_weight.value == 1) + if(!inMenuOrConsole() && vr_wpn_pos_weight.value == 1) { const auto wpnCvarEntry = VR_GetWpnCvarEntry(index); @@ -1757,15 +1846,15 @@ void SetHandPos(int index, entity_t* player) VR_CalcWeaponWeightFTAdjusted<VR_GetWeaponWeightPosFactor>(index) * VR_GetWpnCVarValue(wpnCvarEntry, WpnCVar::WeightPosMult); - const auto rotate_point = [](const glm::vec2& center, const float angle, - glm::vec2 p) { + const auto rotate_point = [](const qvec2& center, const qfloat angle, + qvec2 p) { // translate point back to origin: p -= center; // rotate point - const float s = std::sin(angle); - const float c = std::cos(angle); - const glm::vec2 rotated{p.x * c - p.y * s, p.x * s + p.y * c}; + const qfloat s = std::sin(angle); + const qfloat c = std::cos(angle); + const qvec2 rotated{p.x * c - p.y * s, p.x * s + p.y * c}; // translate point back return rotated + center; @@ -1774,7 +1863,7 @@ void SetHandPos(int index, entity_t* player) const auto oldadjxy = rotate_point( player->origin.xy, glm::radians(-lastVrYawDiff), oldHandpos.xy); - const glm::vec3 oldadj{oldadjxy[0], oldadjxy[1], oldHandpos[2]}; + const qvec3 oldadj{oldadjxy[0], oldadjxy[1], oldHandpos[2]}; const auto diffWithOld = oldHandpos - oldadj; @@ -1796,7 +1885,7 @@ void SetHandPos(int index, entity_t* player) // ------------------------------------------------------------------------ // If hands get too far, bring them closer to the player. const auto currHandPos = cl.handpos[index]; - constexpr auto maxHandPlayerDiff = 50.f; + constexpr qfloat maxHandPlayerDiff = 50.f; const auto handPlayerDiff = currHandPos - adjPlayerOrigin; if(glm::length(handPlayerDiff) > maxHandPlayerDiff) { @@ -1806,15 +1895,6 @@ void SetHandPos(int index, entity_t* player) // handrot is set with AngleVectorFromRotMat - const auto openVRCoordsToQuakeCoords = [](const glm::vec3& v) { - return glm::vec3{-v.z, v.x, v.y}; - }; - - const auto redirectVectorByYaw = [&](const glm::vec3& input, - const float exemplarYaw) { - return redirectVector(input, {0.f, exemplarYaw, 0.f}); - }; - // handvel // Redirect controller velocity to world velocity (based on thumbstick yaw // turn angle). @@ -1827,16 +1907,15 @@ void SetHandPos(int index, entity_t* player) // handthrowvel { - cl.handthrowvel[index] = controllers[index].velocity; + cl.handthrowvel[index] = controllers[index].velocityHistory.average(); // TODO VR: (P1) throwing an item up with a small flick feels too strong const auto up = std::get<2>(getAngledVectors(controllers[index].orientation)); - // TODO VR: (P1) center of mass is different for different weapons - // TODO VR: (P1) cvar this 0.1f cl.handthrowvel[index] += - glm::cross(controllers[index].a_velocity, up * 0.1f); + glm::cross(controllers[index].angularVelocityHistory.average(), + up * vr_throw_up_center_of_mass.value); cl.handthrowvel[index] = redirectVectorByYaw( openVRCoordsToQuakeCoords(cl.handthrowvel[index]), @@ -1852,18 +1931,18 @@ void SetHandPos(int index, entity_t* player) const auto weaponWeight = VR_CalcWeaponWeight<VR_GetWeaponWeightPosFactor>(index); - const auto clampedWeight = std::clamp(weaponWeight, 0.f, 0.4f); + const auto clampedWeight = std::clamp(weaponWeight, 0._qf, 0.4_qf); const auto handvelFactor = - mapRange(clampedWeight, 0.0f, 0.4f, 0.55f, 1.f) * + mapRange(clampedWeight, 0.0_qf, 0.4_qf, 0.55_qf, 1._qf) * VR_GetWpnCVarValue(wpnCvarEntry, WpnCVar::WeightHandVelMult); const auto handthrowvelFactor = - mapRange(clampedWeight, 0.0f, 0.4f, 0.45f, 1.f) * + mapRange(clampedWeight, 0.0_qf, 0.4_qf, 0.45_qf, 1._qf) * VR_GetWpnCVarValue(wpnCvarEntry, WpnCVar::WeightHandThrowVelMult); - cl.handvel[index] *= handvelFactor; - cl.handthrowvel[index] *= handthrowvelFactor; + cl.handvel[index] *= std::pow(handvelFactor, 0.4f); + cl.handthrowvel[index] *= std::pow(handthrowvelFactor, 0.8f); } // TODO VR: (P2) doesn't work due to collision resolution with wall, it @@ -1899,69 +1978,46 @@ void SetHandPos(int index, entity_t* player) debugPrintHandvel(index, linearity); } -[[nodiscard]] static const glm::vec3& VR_GetPlayerOrigin() noexcept +[[nodiscard]] static const qvec3& VR_GetPlayerOrigin() noexcept { return cl_entities[cl.viewentity].origin; } -[[nodiscard]] glm::vec3 VR_GetAliasVertexOffsets( +// TODO VR: (P1) code repetition with r_alias +[[nodiscard]] qvec3 VR_GetAliasVertexOffsets( entity_t* const anchor, const int anchorVertex) noexcept { const auto anchorHdr = (aliashdr_t*)Mod_Extradata(anchor->model); + lerpdata_t zeroLerpdata; + R_SetupAliasFrameZero(*anchorHdr, 0, &zeroLerpdata); + lerpdata_t lerpdata; - R_SetupAliasFrame(anchor, anchorHdr, anchor->frame, &lerpdata); - R_SetupEntityTransform(anchor, &lerpdata); + R_SetupAliasFrame(anchor, *anchorHdr, anchor->frame, &lerpdata); - // ------------------------------------------------------------------------ - // VR: Mostly taken from `GL_DrawAliasFrame`. - trivertx_t* verts1; - trivertx_t* verts2; - float blend; - float iblend; - bool lerping; - - if(lerpdata.pose1 != lerpdata.pose2) - { - lerping = true; - verts1 = (trivertx_t*)((byte*)anchorHdr + anchorHdr->posedata); - verts2 = verts1; - verts1 += lerpdata.pose1 * anchorHdr->poseverts; - verts2 += lerpdata.pose2 * anchorHdr->poseverts; - blend = lerpdata.blend; - iblend = 1.0f - blend; - } - else // poses the same means either 1. the entity has paused its animation, - // or 2. r_lerpmodels is disabled - { - lerping = false; - verts1 = (trivertx_t*)((byte*)anchorHdr + anchorHdr->posedata); - verts2 = verts1; // avoid bogus compiler warning - verts1 += lerpdata.pose1 * anchorHdr->poseverts; - blend = iblend = 0; // avoid bogus compiler warning - } - // ------------------------------------------------------------------------ + auto fd = getDrawAliasFrameData(*anchorHdr, lerpdata, zeroLerpdata); const int clampedAnchorVertex = std::clamp(anchorVertex, 0, anchorHdr->numverts); - verts1 += clampedAnchorVertex; - verts2 += clampedAnchorVertex; + fd.verts1 += clampedAnchorVertex; + fd.verts2 += clampedAnchorVertex; + fd.zeroverts1 += clampedAnchorVertex; - if(lerping) + if(fd.lerping) { - return {// - verts1->v[0] * iblend + verts2->v[0] * blend, - verts1->v[1] * iblend + verts2->v[1] * blend, - verts1->v[2] * iblend + verts2->v[2] * blend}; + return getFinalVertexPosLerped(fd, anchor->zeroBlend); } - return {verts1->v[0], verts1->v[1], verts1->v[2]}; + return getFinalVertexPosNonLerped(fd, anchor->zeroBlend); } -[[nodiscard]] glm::vec3 VR_GetScaledAliasVertexOffsets(entity_t* const anchor, - const int anchorVertex, const glm::vec3& extraOffsets) noexcept +[[nodiscard]] qvec3 VR_GetScaledAliasVertexOffsets(entity_t* const anchor, + const int anchorVertex, const qvec3& extraOffsets, + const bool horizFlip) noexcept { + (void)extraOffsets; + if(anchor->model == nullptr) { return vec3_zero; @@ -1969,87 +2025,122 @@ void SetHandPos(int index, entity_t* player) const auto anchorHdr = (aliashdr_t*)Mod_Extradata(anchor->model); - glm::vec3 result = VR_GetAliasVertexOffsets(anchor, anchorVertex); + qvec3 result = VR_GetAliasVertexOffsets(anchor, anchorVertex); + + if(horizFlip) + { + result[1] *= -1.f; + } + + // const auto scaleCorrect = VR_GetScaleCorrect(); + // + // auto scale = anchorHdr->original_scale * scale * scaleCorrect; + // auto scale_origin = anchorHdr->original_scale_origin + offsets; + // scale_origin *= scaleCorrect; + + const auto offsets = anchorHdr->scale_origin; result *= anchorHdr->scale; - result[0] += anchorHdr->scale_origin[0]; - result[1] -= anchorHdr->scale_origin[1]; - result[2] += anchorHdr->scale_origin[2]; - result += extraOffsets; + + // const auto scaleratio = anchorHdr->scale / anchorHdr->original_scale; + + result += offsets; // * scaleratio; + // result += offsets * 3.f; + + // result[0] -= + // anchorHdr->scale_origin[0] - anchorHdr->original_scale_origin[0]; + // result[1] -= + // anchorHdr->scale_origin[1] - anchorHdr->original_scale_origin[1]; + // result[2] -= + // anchorHdr->scale_origin[2] - anchorHdr->original_scale_origin[2]; + + + // result += extraOffsets; + // result *= 0.f; return result; } -[[nodiscard]] glm::vec3 VR_GetScaledAndAngledAliasVertexOffsets( - entity_t* const anchor, const int anchorVertex, - const glm::vec3& extraOffsets, const glm::vec3& rotation) noexcept +[[nodiscard]] qvec3 VR_GetScaledAndAngledAliasVertexOffsets( + entity_t* const anchor, const int anchorVertex, const qvec3& extraOffsets, + const qvec3& rotation, const bool horizFlip) noexcept { - const auto finalVertexOffsets = - VR_GetScaledAliasVertexOffsets(anchor, anchorVertex, extraOffsets); + if(anchor == nullptr || anchor->model == nullptr) + { + return vec3_zero; + } + + const auto finalVertexOffsets = VR_GetScaledAliasVertexOffsets( + anchor, anchorVertex, extraOffsets, horizFlip); + // const auto anchorHdr = (aliashdr_t*)Mod_Extradata(anchor->model); return quake::util::redirectVector(finalVertexOffsets, rotation); } -[[nodiscard]] glm::vec3 VR_GetScaledAndAngledAliasVertexPosition( - entity_t* const anchor, const int anchorVertex, - const glm::vec3& extraOffsets, const glm::vec3& rotation) noexcept +[[nodiscard]] qvec3 VR_GetScaledAndAngledAliasVertexPosition( + entity_t* const anchor, const int anchorVertex, const qvec3& extraOffsets, + const qvec3& rotation, const bool horizFlip) noexcept { - const glm::vec3 angledOffsets = VR_GetScaledAndAngledAliasVertexOffsets( - anchor, anchorVertex, extraOffsets, rotation); + (void)rotation; - return anchor->origin + angledOffsets; -} + const auto anchorHdr = (aliashdr_t*)Mod_Extradata(anchor->model); + qvec3 c = VR_GetAliasVertexOffsets(anchor, anchorVertex); -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HFinalPosition(entity_t* const anchor, - const int cvarEntry, const bool horizflip, const glm::vec3& extraOffset, - const glm::vec3& handRot) noexcept -{ - auto fixed2HOffsets = VR_GetWpnFixed2HOffsets(cvarEntry); + qmat4 trMat = glm::translate(anchor->origin); - if(!horizflip) - { - fixed2HOffsets[1] *= -1.f; + trMat *= glm::rotate(glm::radians(anchor->angles[YAW]), qvec3{0, 0, 1}); + trMat *= glm::rotate(glm::radians(-anchor->angles[PITCH]), qvec3{0, 1, 0}); + trMat *= glm::rotate(glm::radians(anchor->angles[ROLL]), qvec3{1, 0, 0}); - const auto mhofs = VR_GetWpnFixed2HMainHandOffsets(cvarEntry); - fixed2HOffsets += mhofs; + if(horizFlip) + { + trMat *= glm::scale(qvec3{1._qf, -1._qf, 1._qf}); } - const auto extraOffsets = - VR_GetWpnHandOffsets(cvarEntry) + extraOffset + fixed2HOffsets; - - const int anchorVertex = static_cast<int>( - VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHHandAnchorVertex)); + trMat *= glm::translate(extraOffsets); + trMat *= glm::translate(anchorHdr->scale_origin); + trMat *= glm::scale(anchorHdr->scale); - return VR_GetScaledAndAngledAliasVertexPosition( - anchor, anchorVertex, extraOffsets, handRot); + return trMat * qvec4(c, 1.f); } -[[nodiscard]] glm::vec3 VR_GetBodyAnchor(const glm::vec3& offsets) noexcept +[[nodiscard]] qvec3 VR_GetWpnFixed2HFinalPosition(entity_t* const anchor, + const int cvarEntry, const bool horizFlip, const qvec3& extraOffset, + const qvec3& handRot) noexcept { - // TODO VR: (P2) maybe we should assert here and ensure this is not called - // if player is not active - if(!svPlayerActive()) + if(anchor == nullptr || anchor->model == nullptr) { return vec3_zero; } - const auto heightRatio = std::clamp(VR_GetCrouchRatio(), 0.f, 0.8f); + const qvec3 extraOffsets = VR_GetWpnFixed2HOffsets(cvarEntry) + extraOffset; + + const auto anchorVertex = static_cast<VertexIdx>( + VR_GetWpnCVarValue(cvarEntry, WpnCVar::TwoHHandAnchorVertex)); + + return VR_GetScaledAndAngledAliasVertexPosition( + anchor, anchorVertex, extraOffsets, handRot, horizFlip); +} + +[[nodiscard]] qvec3 VR_GetBodyAnchor(const qvec3& offsets) noexcept +{ + const auto heightRatio = std::clamp(VR_GetCrouchRatio(), 0._qf, 0.8_qf); const auto [vFwd, vRight, vUp] = - getAngledVectors({heightRatio * -35.f, VR_GetBodyYawAngle(), 0.f}); + getAngledVectors({heightRatio * -35._qf, VR_GetBodyYawAngle(), 0._qf}); const auto& [ox, oy, oz] = offsets; auto origin = VR_GetPlayerOrigin(); - origin[2] += 2.f; - origin[2] -= VR_GetCrouchRatio() * 18.f; + origin[2] += 2._qf; + origin[2] -= VR_GetCrouchRatio() * 18._qf; return origin + vRight * oy + vFwd * ox + - vUp * vr_height_calibration.value * oz; + vUp * qfloat(vr_height_calibration.value) * oz; } // Relative to player. -[[nodiscard]] static glm::vec3 VR_GetShoulderOffsets() noexcept +[[nodiscard]] static qvec3 VR_GetShoulderOffsets() noexcept { return { vr_shoulder_offset_x.value, // @@ -2059,7 +2150,7 @@ void SetHandPos(int index, entity_t* player) } // Relative to shoulder offset. -[[nodiscard]] static glm::vec3 VR_GetShoulderHolsterOffsets() noexcept +[[nodiscard]] static qvec3 VR_GetShoulderHolsterOffsets() noexcept { return { vr_shoulder_holster_offset_x.value, // @@ -2069,7 +2160,7 @@ void SetHandPos(int index, entity_t* player) } // Relative to player. -[[nodiscard]] static glm::vec3 VR_GetHipOffsets() noexcept +[[nodiscard]] static qvec3 VR_GetHipOffsets() noexcept { return { vr_hip_offset_x.value, // @@ -2079,7 +2170,7 @@ void SetHandPos(int index, entity_t* player) } // Relative to player. -[[nodiscard]] static glm::vec3 VR_GetUpperOffsets() noexcept +[[nodiscard]] static qvec3 VR_GetUpperOffsets() noexcept { return { vr_upper_holster_offset_x.value, // @@ -2088,24 +2179,24 @@ void SetHandPos(int index, entity_t* player) }; } -[[nodiscard]] static glm::vec3 VR_NegateY(glm::vec3 v) noexcept +[[nodiscard]] static qvec3 VR_NegateY(qvec3 v) noexcept { v.y = -v.y; return v; } -[[nodiscard]] glm::vec3 VR_GetLeftShoulderStockPos() noexcept +[[nodiscard]] static qvec3 VR_GetLeftShoulderStockPos() noexcept { return VR_GetBodyAnchor(VR_NegateY(VR_GetShoulderOffsets())); } -[[nodiscard]] glm::vec3 VR_GetRightShoulderStockPos() noexcept +[[nodiscard]] static qvec3 VR_GetRightShoulderStockPos() noexcept { return VR_GetBodyAnchor(VR_GetShoulderOffsets()); } -[[nodiscard]] glm::vec3 VR_GetShoulderStockPos( +[[nodiscard]] qvec3 VR_GetShoulderStockPos( const int holdingHand, const int helpingHand) noexcept { (void)helpingHand; @@ -2119,11 +2210,11 @@ void SetHandPos(int index, entity_t* player) return VR_GetRightShoulderStockPos(); } -[[nodiscard]] glm::vec3 VR_GetHolsterXCrouchAdjustment( - const float mult) noexcept +[[nodiscard]] qvec3 VR_GetHolsterXCrouchAdjustment(const float mult) noexcept { // TODO VR: (P2) abstract this, used in view as well - const auto heightRatio = std::clamp(VR_GetCrouchRatio() - 0.2f, 0.f, 0.6f); + const auto heightRatio = + std::clamp(VR_GetCrouchRatio() - 0.2_qf, 0._qf, 0.6_qf); const auto crouchXOffset = heightRatio * mult; const auto vFwd = @@ -2133,13 +2224,13 @@ void SetHandPos(int index, entity_t* player) } -[[nodiscard]] glm::vec3 VR_GetShoulderHolsterCrouchAdjustment() noexcept +[[nodiscard]] qvec3 VR_GetShoulderHolsterCrouchAdjustment() noexcept { // TODO VR: (P2) cvar + menu entry return VR_GetHolsterXCrouchAdjustment(1.5f); } -[[nodiscard]] glm::vec3 VR_GetLeftShoulderHolsterPos() noexcept +[[nodiscard]] qvec3 VR_GetLeftShoulderHolsterPos() noexcept { const auto shoulderPos = VR_NegateY(VR_GetShoulderOffsets()); const auto holsterOff = VR_NegateY(VR_GetShoulderHolsterOffsets()); @@ -2148,7 +2239,7 @@ void SetHandPos(int index, entity_t* player) VR_GetShoulderHolsterCrouchAdjustment(); } -[[nodiscard]] glm::vec3 VR_GetRightShoulderHolsterPos() noexcept +[[nodiscard]] qvec3 VR_GetRightShoulderHolsterPos() noexcept { const auto shoulderPos = VR_GetShoulderOffsets(); const auto holsterOff = VR_GetShoulderHolsterOffsets(); @@ -2158,58 +2249,58 @@ void SetHandPos(int index, entity_t* player) } -[[nodiscard]] glm::vec3 VR_GetHipHolsterCrouchAdjustment() noexcept +[[nodiscard]] qvec3 VR_GetHipHolsterCrouchAdjustment() noexcept { // TODO VR: (P2) cvar + menu entry return VR_GetHolsterXCrouchAdjustment(-9.5f); } -[[nodiscard]] glm::vec3 VR_GetLeftHipPos() noexcept +[[nodiscard]] qvec3 VR_GetLeftHipPos() noexcept { return VR_GetBodyAnchor(VR_NegateY(VR_GetHipOffsets())) + VR_GetHipHolsterCrouchAdjustment(); } -[[nodiscard]] glm::vec3 VR_GetRightHipPos() noexcept +[[nodiscard]] qvec3 VR_GetRightHipPos() noexcept { return VR_GetBodyAnchor(VR_GetHipOffsets()) + VR_GetHipHolsterCrouchAdjustment(); } -[[nodiscard]] glm::vec3 VR_GetUpperHolsterCrouchAdjustment() noexcept +[[nodiscard]] qvec3 VR_GetUpperHolsterCrouchAdjustment() noexcept { // TODO VR: (P2) cvar + menu entry return VR_GetHolsterXCrouchAdjustment(-1.5f); } -[[nodiscard]] glm::vec3 VR_GetLeftUpperPos() noexcept +[[nodiscard]] qvec3 VR_GetLeftUpperPos() noexcept { return VR_GetBodyAnchor(VR_NegateY(VR_GetUpperOffsets())) + VR_GetUpperHolsterCrouchAdjustment(); } -[[nodiscard]] glm::vec3 VR_GetRightUpperPos() noexcept +[[nodiscard]] qvec3 VR_GetRightUpperPos() noexcept { return VR_GetBodyAnchor(VR_GetUpperOffsets()) + VR_GetUpperHolsterCrouchAdjustment(); } -[[nodiscard]] float VR_GetTurnYawAngle() noexcept +[[nodiscard]] qfloat VR_GetTurnYawAngle() noexcept { return vrYaw; } -[[nodiscard]] static glm::vec3 VR_GetEyesOrientation() noexcept +[[nodiscard]] static qvec3 VR_GetEyesOrientation() noexcept { return QuatToYawPitchRoll(eyes[0].orientation); } -[[nodiscard]] glm::vec3 VR_GetHeadAngles() noexcept +[[nodiscard]] qvec3 VR_GetHeadAngles() noexcept { return cl.viewangles; } -[[nodiscard]] float VR_GetHeadYawAngle() noexcept +[[nodiscard]] qfloat VR_GetHeadYawAngle() noexcept { return VR_GetHeadAngles()[YAW]; } @@ -2253,21 +2344,21 @@ void SetHandPos(int index, entity_t* player) } [[nodiscard]] static auto VR_GetBodyYawAdjPlayerOrigins( - const glm::vec3& headFwdDir, const glm::vec3& headRightDir) noexcept + const qvec3& headFwdDir, const qvec3& headRightDir) noexcept { - const auto adjPlayerOrigin = VR_GetPlayerOrigin() - headFwdDir * 10.f; - const auto adjPlayerOriginLeft = adjPlayerOrigin - headRightDir * 6.5f; - const auto adjPlayerOriginRight = adjPlayerOrigin + headRightDir * 6.5f; + const auto adjPlayerOrigin = VR_GetPlayerOrigin() - headFwdDir * 10._qf; + const auto adjPlayerOriginLeft = adjPlayerOrigin - headRightDir * 6.5_qf; + const auto adjPlayerOriginRight = adjPlayerOrigin + headRightDir * 6.5_qf; return std::tuple{ adjPlayerOrigin, adjPlayerOriginLeft, adjPlayerOriginRight}; } [[nodiscard]] static auto VR_GetFixedZHeadHandDiffs( - const glm::vec3& adjPlayerOriginLeft, - const glm::vec3& adjPlayerOriginRight) noexcept + const qvec3& adjPlayerOriginLeft, + const qvec3& adjPlayerOriginRight) noexcept { - const auto fixZ = [&](glm::vec3 v) { + const auto fixZ = [&](qvec3 v) { v[2] = adjPlayerOriginLeft[2]; return v; }; @@ -2278,9 +2369,8 @@ void SetHandPos(int index, entity_t* player) }; } -[[nodiscard]] static glm::vec3 VR_GetBodyYawMixHandDir( - const std::array<glm::vec3, 2>& headHandDiffs, - const glm::vec3& headFwdDir) noexcept +[[nodiscard]] static qvec3 VR_GetBodyYawMixHandDir( + const std::array<qvec3, 2>& headHandDiffs, const qvec3& headFwdDir) noexcept { auto result = glm::mix(headHandDiffs[0], headHandDiffs[1], 0.5f); result /= 10.f; @@ -2299,13 +2389,14 @@ void SetHandPos(int index, entity_t* player) return result; } -[[nodiscard]] static glm::vec3 VR_GetBodyYawMixFinalDir( - const glm::vec3& headFwdDir, const glm::vec3& mixHandDir) noexcept +[[nodiscard]] static qvec3 VR_GetBodyYawMixFinalDir( + const qvec3& headFwdDir, const qvec3& mixHandDir) noexcept { return glm::normalize(glm::mix(headFwdDir, mixHandDir, 0.8f)); } -[[nodiscard]] static auto VR_GetBodyYawAngleCalculations() noexcept +[[nodiscard]] std::tuple<qvec3, qvec3, qvec3, qvec3, qvec3, qvec3, qvec3, qvec3> +VR_GetBodyYawAngleCalculations() noexcept { // const auto [headFwdDir, headRightDir, headUpDir] = VR_GetHeadYawDirs(); const auto [headFwdDir, headRightDir, headUpDir] = @@ -2325,9 +2416,9 @@ void SetHandPos(int index, entity_t* player) mixFinalDir}; } -[[nodiscard]] float VR_GetBodyYawAngle() noexcept +[[nodiscard]] qfloat VR_GetBodyYawAngle() noexcept { - if(!controllers[0].active || !controllers[1].active || !svPlayerActive()) + if(!controllers[0].active || !controllers[1].active) { // If any controller is off or player is inactive, return head yaw. return VR_GetHeadFwdAngleBlended(); @@ -2342,20 +2433,20 @@ void SetHandPos(int index, entity_t* player) } -[[nodiscard]] static glm::vec3 VR_Get2HVirtualStockMix( - const glm::vec3& viaHand, const glm::vec3& viaShoulder) noexcept +[[nodiscard]] qvec3 VR_Get2HVirtualStockMix( + const qvec3& viaHand, const qvec3& viaShoulder) noexcept { return glm::mix(viaHand, viaShoulder, vr_2h_virtual_stock_factor.value); } -[[nodiscard]] static glm::vec3 VR_Get2HHoldingHandPos( +[[nodiscard]] qvec3 VR_Get2HHoldingHandPos( const int holdingHand, const int helpingHand) noexcept { (void)helpingHand; return cl.handpos[holdingHand]; } -[[nodiscard]] static glm::vec3 VR_Get2HHelpingHandPos( +[[nodiscard]] qvec3 VR_Get2HHelpingHandPos( const int holdingHand, const int helpingHand) noexcept { const auto [thox, thoy, thoz] = @@ -2372,8 +2463,8 @@ void SetHandPos(int index, entity_t* player) up * thoz; } -[[nodiscard]] static bool VR_InStockDistance(const int holdingHand, - const int helpingHand, const glm::vec3& shoulderPos) noexcept +[[nodiscard]] bool VR_InStockDistance(const int holdingHand, + const int helpingHand, const qvec3& shoulderPos) noexcept { (void)helpingHand; @@ -2383,7 +2474,7 @@ void SetHandPos(int index, entity_t* player) static void VR_DoTeleportation() { - if(!vr_teleport_enabled.value) // || !svPlayerActive()) + if(!vr_teleport_enabled.value || !svPlayerActive()) { return; } @@ -2394,12 +2485,12 @@ static void VR_DoTeleportation() { constexpr float oh = 6.f; constexpr float oy = 12.f; - const glm::vec3 mins{-oh, -oh, -oy}; - const glm::vec3 maxs{oh, oh, oy}; + const qvec3 mins{-oh, -oh, -oy}; + const qvec3 maxs{oh, oh, oy}; const auto fwd = getFwdVecFromPitchYawRoll(cl.handrot[cVR_OffHand]); const auto target = - cl.handpos[cVR_OffHand] + vr_teleport_range.value * fwd; + cl.handpos[cVR_OffHand] + qfloat(vr_teleport_range.value) * fwd; const auto adjPlayerOrigin = VR_GetAdjustedPlayerOrigin(player->origin); @@ -2439,6 +2530,11 @@ __attribute__((no_sanitize_address)) static void VR_UpdateDevicesOrientationPosition() noexcept { + if(vr_fakevr.value && vr_novrinit.value) + { + return; + } + controllers[0].active = false; controllers[1].active = false; @@ -2471,7 +2567,7 @@ VR_UpdateDevicesOrientationPosition() noexcept // TODO VR: (P2) this should use the player's appoximated body // origin instead of the head origin, taking controllers into // account. See comment below for more info. - glm::vec3 moveInTracking = headOrigin - lastHeadOrigin; + qvec3 moveInTracking = headOrigin - lastHeadOrigin; moveInTracking[0] *= -meters_to_units; moveInTracking[1] *= -meters_to_units; moveInTracking[2] = 0; @@ -2566,10 +2662,12 @@ VR_UpdateDevicesOrientationPosition() noexcept controller->velocity[0] = rawControllerVel.v[0]; controller->velocity[1] = rawControllerVel.v[1]; controller->velocity[2] = rawControllerVel.v[2]; + controller->velocityHistory.add(controller->velocity); controller->a_velocity[0] = rawControllerAVel.v[0]; controller->a_velocity[1] = rawControllerAVel.v[1]; controller->a_velocity[2] = rawControllerAVel.v[2]; + controller->angularVelocityHistory.add(controller->a_velocity); controller->orientation = QuatToYawPitchRoll(rawControllerQuat); } @@ -2579,7 +2677,7 @@ VR_UpdateDevicesOrientationPosition() noexcept static void VR_DoWeaponDirSlerp() { - if(inMenu() || vr_wpn_dir_weight.value != 1) + if(inMenuOrConsole() || vr_wpn_dir_weight.value != 1) { return; } @@ -2605,7 +2703,7 @@ static void VR_DoWeaponDirSlerp() const auto slerpFwd = glm::slerp(nOldFwd, nNewFwd, ftw); const auto slerpUp = glm::slerp(nOldUp, nNewUp, ftw); - const auto anyNan = [](const glm::vec3& v) { + const auto anyNan = [](const qvec3& v) { return std::isnan(v[0]) || std::isnan(v[1]) || std::isnan(v[2]); }; @@ -2650,7 +2748,7 @@ static void VR_DoUpdatePrevAnglesAndPlayerYaw() } static bool VR_GoodDistanceForDynamic2HGrabImpl( - const glm::vec3& holdingHandPos, const glm::vec3& helpingHandPos) + const qvec3& holdingHandPos, const qvec3& helpingHandPos) { // TODO VR: (P1) weapon cvar for this! const auto handDist = glm::distance(holdingHandPos, helpingHandPos); @@ -2677,22 +2775,12 @@ static bool VR_GoodDistanceFor2HGrab( VR_Get2HHelpingHandPos(holdingHand, helpingHand)); } - const bool horizflip = holdingHand == cVR_OffHand; - - const auto offHandOffsets = - cl.offhand_viewent.model == nullptr - ? vec3_zero - : VR_GetWpnOffHandOffsets( - VR_GetWpnCVarFromModel(cl.offhand_viewent.model)); + const bool horizFlip = VR_GetHorizFlip(holdingHand); - const glm::vec3 extraOffset = - holdingHand == cVR_MainHand ? offHandOffsets : vec3_zero; + entity_t* const anchor = VR_GetAnchorEntity(holdingHand); - entity_t* const anchor = - holdingHand == cVR_OffHand ? &cl.offhand_viewent : &cl.viewent; - - const glm::vec3 pos = VR_GetWpnFixed2HFinalPosition( - anchor, wpnCvarEntry, horizflip, extraOffset, cl.handrot[holdingHand]); + const qvec3 pos = VR_GetWpnFixed2HFinalPosition( + anchor, wpnCvarEntry, horizFlip, vec3_zero, cl.handrot[holdingHand]); const bool alreadyAiming = vr_should_aim_2h[holdingHand]; const float threshold = alreadyAiming ? 20.f : 5.5f; @@ -2710,49 +2798,35 @@ static bool VR_GoodDistanceForOffHand2HGrab() return VR_GoodDistanceFor2HGrab(cVR_OffHand, cVR_MainHand); } -static bool VR_GoodDistanceForHandSwitch(const glm::vec3& a, const glm::vec3& b) +static bool VR_GoodDistanceForHandSwitch(const qvec3& a, const qvec3& b) { return glm::distance(a, b) < 5.f; } -[[nodiscard]] glm::vec3 VR_CalcWeaponMuzzlePosImpl( - const int index, const int cvarEntry) noexcept +[[nodiscard]] qvec3 VR_CalcFinalWpnMuzzlePos(const int index) noexcept { - glm::vec3 finalOffsets{VR_GetWpnOffsets(cvarEntry)}; - finalOffsets[1] *= -1.f; - - finalOffsets /= VR_GetWpnCVarValue(cvarEntry, WpnCVar::Scale); + entity_t* const anchor = VR_GetAnchorEntity(index); - finalOffsets += VR_GetWpnMuzzleOffsets(cvarEntry); + if(anchor->model == nullptr) + { + return vec3_zero; + } - finalOffsets *= - VR_GetWpnCVarValue(cvarEntry, WpnCVar::Scale) * VR_GetScaleCorrect(); + const WpnCvarEntry anchorWpnCvar = VR_GetWpnCvarEntry(index); - return redirectVector(finalOffsets, cl.handrot[index]); -} + const auto anchorVertex = static_cast<VertexIdx>( + VR_GetWpnCVarValue(anchorWpnCvar, WpnCVar::MuzzleAnchorVertex)); -[[nodiscard]] glm::vec3 VR_CalcMainHandWpnMuzzlePos() noexcept -{ - return cl.handpos[cVR_MainHand] + VR_CalcWeaponMuzzlePosImpl(cVR_MainHand, - VR_GetMainHandWpnCvarEntry()); -} + const bool horizFlip = VR_GetHorizFlip(index); -[[nodiscard]] glm::vec3 VR_CalcOffHandWpnMuzzlePos() noexcept -{ - return cl.handpos[cVR_OffHand] + - VR_CalcWeaponMuzzlePosImpl(cVR_OffHand, VR_GetOffHandWpnCvarEntry()); + return VR_GetScaledAndAngledAliasVertexPosition(anchor, anchorVertex, + VR_GetWpnMuzzleOffsets(anchorWpnCvar), cl.handrot[index], horizFlip); } -static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, - const glm::vec3 (&originalRots)[2], const int holdingHand, - const int helpingHand, const glm::vec3& shoulderStockPos) +static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, const qvec3 (&originalRots)[2], + const int holdingHand, const int helpingHand, const qvec3& shoulderStockPos) { - // if(!svPlayerActive()) - // { - // return; - // } - const auto helpingHandPos = VR_Get2HHelpingHandPos(holdingHand, helpingHand); @@ -2775,7 +2849,7 @@ static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, const bool goodDistanceOrAlreadyAiming = VR_GoodDistanceFor2HGrab(holdingHand, helpingHand); - const float frametime = cl.time - cl.oldtime; + const auto frametime = cl.time - cl.oldtime; const auto transitionVar = [&frametime](float& var, const bool predicate, const float speed) { @@ -2797,16 +2871,18 @@ static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, const auto helpingHandStatIdx = helpingHand == cVR_OffHand ? STAT_OFFHAND_WID : STAT_MAINHAND_WID; - const bool helpingHandIsFist = - (svPlayerActive() && cl.stats[helpingHandStatIdx] == WID_FIST); + const bool helpingHandIsFist = cl.stats[helpingHandStatIdx] == WID_FIST; const bool beforeMuzzle = [&] { - const auto muzzlePos = holdingHand == cVR_MainHand - ? VR_CalcMainHandWpnMuzzlePos() - : VR_CalcOffHandWpnMuzzlePos(); + const auto muzzlePos = VR_CalcFinalWpnMuzzlePos(holdingHand); const auto gunLength = glm::distance(holdingHandPos, muzzlePos); - return glm::distance(holdingHandPos, helpingHandPos) <= gunLength; + + // Bias is needed because muzzle now moves with the gun animation. + const auto bias = 7.5_qf; + + return glm::distance(holdingHandPos, helpingHandPos) <= + gunLength + bias; }(); const bool canGrabWith2H = helpingHandGrabbing && @@ -2814,9 +2890,11 @@ static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, !vr_gun_wall_collision[holdingHand]._colliding && helpingHandIsFist && beforeMuzzle; - vr_should_aim_2h[holdingHand] = canGrabWith2H && - goodDistanceOrAlreadyAiming && - diffDot > vr_2h_angle_threshold.value; + const bool goodDot = (diffDot > vr_2h_angle_threshold.value) || + vr_2h_disable_angle_threshold.value; + + vr_should_aim_2h[holdingHand] = + canGrabWith2H && goodDistanceOrAlreadyAiming && goodDot; vr_active_2h_helping_hand[helpingHand] = vr_should_aim_2h[holdingHand]; @@ -2831,9 +2909,17 @@ static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, const auto [pitch, yaw, roll] = pitchYawRollFromDirectionVector(up, mixDir); - const auto [oP, oY, oR] = + auto [oP, oY, oR] = VR_GetWpn2HAngleOffsets(VR_GetWpnCvarEntry(holdingHand)); + const bool horizFlip = VR_GetHorizFlip(holdingHand); + + if(horizFlip) + { + oY *= -1; + oR *= -1; + } + cl.handrot[holdingHand][PITCH] = pitch + oP * vr_2h_aim_transition[holdingHand]; cl.handrot[holdingHand][YAW] = yaw + oY * vr_2h_aim_transition[holdingHand]; @@ -2841,11 +2927,11 @@ static void VR_Do2HAimingImpl(Vr2HMode vr2HMode, roll + oR * vr_2h_aim_transition[holdingHand]; } -static void VR_Do2HAiming(const glm::vec3 (&originalRots)[2]) +static void VR_Do2HAiming(const qvec3 (&originalRots)[2]) { const auto vr2HMode = cvarToEnum<Vr2HMode>(vr_2h_mode); - if(vr2HMode == Vr2HMode::Disabled || !svPlayerActive()) + if(vr2HMode == Vr2HMode::Disabled) { return; } @@ -2867,41 +2953,58 @@ static void VR_Do2HAiming(const glm::vec3 (&originalRots)[2]) static void VR_FakeVRControllerAiming() { - // if(!svPlayerActive()) - // { - // return; - // } - - const auto [vfwd, vright, vup] = - getAngledVectors({0.f, cl.viewangles[YAW], 0.f}); - - const auto [vwfwd, vwright, vwup] = getAngledVectors(cl.viewangles); - + const auto [vfwd, vright, vup] = getAngledVectors(cl.viewangles); const auto& playerOrigin = VR_GetPlayerOrigin(); + vrYaw = cl.viewangles[YAW]; + cl.handpos[cVR_MainHand] = - playerOrigin + vfwd * 4.5f + vright * 4.5f + vup * 6.f; + playerOrigin + vfwd * 16.5_qf + vright * 5.5_qf + vup * 15.5_qf; cl.handpos[cVR_OffHand] = - playerOrigin + vfwd * 4.5f - vright * 4.5f + vup * 6.f; + playerOrigin + vfwd * 16.5_qf - vright * 5.5_qf + vup * 15.5_qf; + + cl.handrot[cVR_MainHand] = cl.viewangles; + cl.handrot[cVR_OffHand] = cl.viewangles; +} + +static void VR_DoWpnButton() +{ + const auto doWpnButton = [](const int handIdx, + const entity_t& wpnButtonEntity, + const char key) { + const bool hasWpnButton = !wpnButtonEntity.hidden; + + WpnButtonState& state = vr_wpnbutton_state[handIdx]; - const trace_t trace = SV_MoveTrace(playerOrigin + vup * 8.f, - playerOrigin + vup * 8.f + vwfwd * 1000.f, MOVE_NORMAL, - getPlayerEdict()); + if(hasWpnButton && (cl.time - state._lastClTime) > 0.2f) + { + // TODO VR: (P1) improve this collision detection + const auto otherHandIdx = VR_OtherHand(handIdx); + + const auto handPos = cl.handpos[otherHandIdx]; + + const auto [fwd, right, up] = + getAngledVectors(cl.handrot[otherHandIdx]); + + const auto adjHandPos = handPos + fwd * 2._qf + up * -2.5_qf; - const auto maindir = - glm::normalize(trace.endpos - cl.handpos[cVR_MainHand]); + const auto dist = glm::distance(adjHandPos, wpnButtonEntity.origin); - const auto offdir = glm::normalize(trace.endpos - cl.handpos[cVR_OffHand]); + state._prevHover = state._hover; + state._hover = dist < 2.7_qf; + state._lastClTime = cl.time; - const auto mainang = pitchYawRollFromDirectionVector(vup, maindir); - const auto offang = pitchYawRollFromDirectionVector(vup, offdir); + const bool risingEdge = !state._prevHover && state._hover; + Key_Event(key, risingEdge); + } + }; - cl.handrot[cVR_MainHand] = mainang; - cl.handrot[cVR_OffHand] = offang; + doWpnButton(cVR_OffHand, cl.offhand_wpn_button, '7'); + doWpnButton(cVR_MainHand, cl.mainhand_wpn_button, '8'); } -static void VR_ControllerAiming(const glm::vec3& orientation) +static void VR_ControllerAiming(const qvec3& orientation) { // In fake VR mode, aim is controlled with the mouse. if(vr_fakevr.value == 0) @@ -2910,13 +3013,13 @@ static void VR_ControllerAiming(const glm::vec3& orientation) cl.viewangles[YAW] = orientation[YAW]; } - glm::vec3 originalRots[2]; + qvec3 originalRots[2]; for(int i = 0; i < 2; i++) { const auto rotOfs = - i == 0 ? glm::vec3{vr_offhandpitch.value, vr_offhandyaw.value, 0.f} - : glm::vec3{vr_gunangle.value, vr_gunyaw.value, 0.f}; + i == 0 ? qvec3{vr_offhandpitch.value, vr_offhandyaw.value, 0.f} + : qvec3{vr_gunangle.value, vr_gunyaw.value, 0.f}; const auto gunMatPitch = CreateRotMat(0, rotOfs[0]); const auto gunMatYaw = CreateRotMat(1, rotOfs[1]); @@ -2944,6 +3047,12 @@ static void VR_ControllerAiming(const glm::vec3& orientation) entity_t* const player = &cl_entities[cl.viewentity]; + // headvel + cl.headvel = redirectVectorByYaw( + openVRCoordsToQuakeCoords(headVelocity.v), VR_GetTurnYawAngle()); + debugPrintHeadvel(); + + // handpos and offhandpos SetHandPos(0, player); SetHandPos(1, player); @@ -2960,39 +3069,150 @@ static void VR_ControllerAiming(const glm::vec3& orientation) VR_DoUpdatePrevAnglesAndPlayerYaw(); VR_DoTeleportation(); + VR_DoWpnButton(); } -void VR_UpdateScreenContent() +static void VR_ResetGlobals() { - // Last chance to enable VR Mode - we get here when the game already - // start up with vr_enabled 1 If enabling fails, unset the cvar and - // return. - if(!vr_initialized && !VR_Enable()) + for(int handIdx = 0; handIdx < 2; ++handIdx) { - Cvar_Set("vr_enabled", "0"); - return; + vr_wpnbutton_state[handIdx] = WpnButtonState{}; } +} - // Get and update the VR devices' orientation and position - VR_UpdateDevicesOrientationPosition(); +void VR_OnSpawnServer() +{ + VR_ResetGlobals(); +} - // Reset the aim roll value before calculation, incase the user switches - // aimmode from 7 to another. - cl.aimangles[ROLL] = 0.0; +void VR_OnClientClearState() +{ + VR_ResetGlobals(); +} - const auto orientation = VR_GetEyesOrientation(); - if(std::exchange(readbackYaw, false)) +[[nodiscard]] static float handSkeletalToFrame( + const FingerIdx fingerIdx, const vr::VRSkeletalSummaryData_t& ss) +{ + // Close thumb in pancake mode. + if(fingerIdx == FingerIdx::Thumb && vr_fakevr.value) { - vrYaw = cl.viewangles[YAW] - (orientation[YAW] - vrYaw); + return 5.f; } - switch((int)vr_aimmode.value) + // Automatically close thumb if most other fingers are curled. + if(fingerIdx == FingerIdx::Thumb && vr_finger_auto_close_thumb.value) { - // 1: (Default) Head Aiming; View YAW is mouse+head, PITCH is - // head - default: - case VrAimMode::e_HEAD_MYAW: + const auto avg = [](const auto... xs) { + return (xs + ...) / sizeof...(xs); + }; + + const auto avgCurl = [&](const auto... xs) { + return avg(ss.flFingerCurl[(int)xs]...); + }; + + if(avgCurl(FingerIdx::Index, FingerIdx::Middle, FingerIdx::Ring, + FingerIdx::Pinky) > 0.5) + { + return 5.f; + } + } + + return std::clamp( + ss.flFingerCurl[(int)fingerIdx] + vr_finger_grip_bias.value, 0.f, + 1.f) * + 5.f; +} + +[[nodiscard]] static float handSkeletalToFrameForHand( + const FingerIdx fingerIdx, const HandIdx handIdx) +{ + return handSkeletalToFrame( + fingerIdx, handIdx == cVR_OffHand ? vr_ss_lefthand : vr_ss_righthand); +} + +[[nodiscard]] static float handSkeletalToFrameForHandWithBlending( + const FingerIdx fingerIdx, const HandIdx handIdx) +{ + const float targetFrame = handSkeletalToFrameForHand(fingerIdx, handIdx); + + if(!vr_finger_blending.value) + { + return targetFrame; + } + const float frametime = cl.time - cl.oldtime; + auto& ff = vr_fingertracking_frame[handIdx][(int)fingerIdx]; + const float speed = frametime * vr_finger_blending_speed.value; + + if(ff > targetFrame) + { + ff -= speed; + + if(ff < targetFrame) + { + ff = targetFrame; + } + } + else if(ff < targetFrame) + { + ff += speed; + + if(ff > targetFrame) + { + ff = targetFrame; + } + } + + return ff; +} + +void VR_UpdateFingerTracking() +{ + for(const HandIdx handIdx : {cVR_OffHand, cVR_MainHand}) + { + for(const FingerIdx fingerIdx : {FingerIdx::Thumb, FingerIdx::Index, + FingerIdx::Middle, FingerIdx::Ring, FingerIdx::Pinky}) + { + vr_fingertracking_frame[(int)handIdx][(int)fingerIdx] = + handSkeletalToFrameForHandWithBlending(fingerIdx, handIdx); + } + } +} + +void VR_UpdateScreenContent() +{ + // Last chance to enable VR Mode - we get here when the game already + // start up with vr_enabled 1 If enabling fails, unset the cvar and + // return. + if(!vr_initialized && !VR_Enable()) + { + Cvar_Set("vr_enabled", "0"); + return; + } + + // Finger tracking blending information. + VR_UpdateFingerTracking(); + + // Get and update the VR devices' orientation and position + VR_UpdateDevicesOrientationPosition(); + + // Reset the aim roll value before calculation, incase the user switches + // aimmode from 7 to another. + cl.aimangles[ROLL] = 0.0; + + const auto orientation = VR_GetEyesOrientation(); + + if(vr_fakevr.value == 0 && std::exchange(readbackYaw, false)) + { + vrYaw = cl.viewangles[YAW] - (orientation[YAW] - vrYaw); + } + + switch((int)vr_aimmode.value) + { + // 1: (Default) Head Aiming; View YAW is mouse+head, PITCH is + // head + default: + case VrAimMode::e_HEAD_MYAW: cl.viewangles[PITCH] = cl.aimangles[PITCH] = orientation[PITCH]; cl.aimangles[YAW] = cl.viewangles[YAW] = cl.aimangles[YAW] + orientation[YAW] - lastOrientation[YAW]; @@ -3023,10 +3243,10 @@ void VR_UpdateScreenContent() case VrAimMode::e_BLENDED: [[fallthrough]]; case VrAimMode::e_BLENDED_NOPITCH: { - const float diffHMDYaw = orientation[YAW] - lastOrientation[YAW]; - const float diffHMDPitch = + const auto diffHMDYaw = orientation[YAW] - lastOrientation[YAW]; + const auto diffHMDPitch = orientation[PITCH] - lastOrientation[PITCH]; - const float diffAimYaw = cl.aimangles[YAW] - lastAim[YAW]; + const auto diffAimYaw = cl.aimangles[YAW] - lastAim[YAW]; float diffYaw; // find new view position based on orientation delta @@ -3053,8 +3273,6 @@ void VR_UpdateScreenContent() // 7: Controller Aiming; case VrAimMode::e_CONTROLLER: { - // TODO VR: (P0) this uses server-side data, but is called in - // client-side. Breaks multiplayer. VR_ControllerAiming(orientation); break; } @@ -3071,951 +3289,103 @@ void VR_UpdateScreenContent() r_refdef.viewangles = cl.viewangles; r_refdef.aimangles = cl.aimangles; - // Render the scene for each eye into their FBOs - for(vr_eye_t& eye : eyes) - { - // TODO VR: (P2) this global is problematic, remove it and pass args - // around It is used in view.cpp and gl_rmain.cpp - current_eye = &eye; - - // We need to scale the view offset position to quake units and - // rotate it by the current input angles (viewangle - eye - // orientation) - const auto orientation = QuatToYawPitchRoll(eye.orientation); - glm::vec3 temp{ - -eye.position.v[2], -eye.position.v[0], eye.position.v[1]}; - temp *= meters_to_units; - vr_viewOffset = Vec3RotateZ( - temp, (r_refdef.viewangles[YAW] - orientation[YAW]) * M_PI_DIV_180); - - vr_viewOffset[2] += vr_floor_offset.value; - - RenderScreenForCurrentEye_OVR(eye); - } - - // Blit mirror texture to backbuffer - const GLint w = glwidth; - const GLint h = glheight; - - glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, eyes[0].fbo.framebuffer); - glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); - glBlitFramebufferEXT(0, eyes[0].fbo.size.width, eyes[0].fbo.size.height, 0, - 0, h, w, 0, GL_COLOR_BUFFER_BIT, GL_LINEAR); - glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); -} - -void VR_SetMatrices() -{ - // Calculate HMD projection matrix and view offset position - vr::HmdMatrix44_t projection = TransposeMatrix( - ovrHMD->GetProjectionMatrix(current_eye->eye, 4.f, gl_farclip.value)); - - // Set OpenGL projection and view matrices - glMatrixMode(GL_PROJECTION); - glLoadMatrixf((GLfloat*)projection.m); -} - -[[nodiscard]] glm::vec3 VR_GetLastHeadOrigin() noexcept -{ - return lastHeadOrigin; -} - -[[nodiscard]] float VR_GetCrouchRatio() noexcept -{ - const auto maxHeight = vr_height_calibration.value; - const auto currHeight = VR_GetLastHeadOrigin()[2]; - return std::clamp((maxHeight / currHeight) - 1.f, 0.f, 1.f); -} - -void VR_CalibrateHeight() -{ - const auto height = lastHeadOrigin[2]; - Cvar_SetValue("vr_height_calibration", height); - Con_Printf("Calibrated height to %.2f\n", height); -} - -[[nodiscard]] glm::vec3 VR_AddOrientationToViewAngles( - const glm::vec3& angles) noexcept -{ - const auto [pitch, yaw, roll] = - QuatToYawPitchRoll(current_eye->orientation); - - return {angles[PITCH] + pitch, angles[YAW] + yaw, roll}; -} - -[[nodiscard]] static bool VR_InHipHolsterDistance( - const glm::vec3& hand, const glm::vec3& holster) -{ - return glm::distance(hand, holster) < vr_hip_holster_thresh.value; -} - -[[nodiscard]] static bool VR_InShoulderHolsterDistance( - const glm::vec3& hand, const glm::vec3& holster) -{ - return glm::distance(hand, holster) < vr_shoulder_holster_thresh.value; -} - -[[nodiscard]] static bool VR_InUpperHolsterDistance( - const glm::vec3& hand, const glm::vec3& holster) -{ - return glm::distance(hand, holster) < vr_upper_holster_thresh.value; -} - -static void VR_ShowFnSetupGL() noexcept -{ - glDisable(GL_DEPTH_TEST); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - GL_PolygonOffset(OFFSET_SHOWTRIS); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_TEXTURE_2D); - glDisable(GL_CULL_FACE); -} - -static void VR_ShowFnCleanupGL() noexcept -{ - glColor3f(1, 1, 1); - glEnable(GL_TEXTURE_2D); - glEnable(GL_CULL_FACE); - glDisable(GL_BLEND); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - GL_PolygonOffset(OFFSET_NONE); - glEnable(GL_DEPTH_TEST); -} - -template <typename F> -static void VR_ShowFnDrawPointsWithSize(float size, F&& drawPrimitives) noexcept -{ - glEnable(GL_POINT_SMOOTH); - glPointSize(size); - drawPrimitives(GL_POINTS); - glDisable(GL_POINT_SMOOTH); -} - -template <typename F> -static void VR_ShowFnDrawPoints(F&& drawPrimitives) noexcept -{ - VR_ShowFnDrawPointsWithSize(12.f, drawPrimitives); -} - -template <typename F> -static void VR_ShowFnDrawPointsAndLines(F&& drawPrimitives) noexcept -{ - glLineWidth(2.f * glwidth / vid.width); - - glEnable(GL_LINE_SMOOTH); - glShadeModel(GL_SMOOTH); - drawPrimitives(GL_LINES); - glShadeModel(GL_FLAT); - glDisable(GL_LINE_SMOOTH); - - VR_ShowFnDrawPoints(drawPrimitives); -} - -static void VR_GLVertex3f(const glm::vec3& v) noexcept -{ - glVertex3f(v[0], v[1], v[2]); -} - -static void VR_ShowVirtualStockImpl( - const int holdingHand, const int helpingHand) -{ - const auto holdingHandPos = - VR_Get2HHoldingHandPos(holdingHand, helpingHand); - - const auto helpingHandPos = - VR_Get2HHelpingHandPos(holdingHand, helpingHand); - - const auto shoulderPos = VR_GetShoulderStockPos(holdingHand, helpingHand); - - const auto averagePos = - VR_Get2HVirtualStockMix(holdingHandPos, shoulderPos); - - glColor4f(0, 1, 0, 0.75); - VR_GLVertex3f(holdingHandPos); - VR_GLVertex3f(helpingHandPos); - - glColor4f(0, 1, 0, 0.75); - VR_GLVertex3f(shoulderPos); - VR_GLVertex3f(helpingHandPos); - - if(VR_InStockDistance(holdingHand, helpingHand, shoulderPos)) - { - glColor4f(1, 1, 0, 0.75); - } - else - { - glColor4f(0, 1, 1, 0.75); - } - - glLineWidth(4.f * glwidth / vid.width); - VR_GLVertex3f(averagePos); - VR_GLVertex3f(helpingHandPos); -} - -[[nodiscard]] std::pair<bool, bool> VR_GetHandsToDraw( - const int cvarValue) noexcept -{ - const auto selection = static_cast<VrOptionHandSelection>(cvarValue); - - const bool optMainHand = selection == VrOptionHandSelection::MainHand; - const bool optOffHand = selection == VrOptionHandSelection::OffHand; - const bool optBothHands = selection == VrOptionHandSelection::BothHands; - - const bool drawMainHand = optMainHand || optBothHands; - const bool drawOffHand = optOffHand || optBothHands; - - return {drawMainHand, drawOffHand}; -} - -// TODO VR: (P2) recoil system, 2H will reduce it - -void VR_ShowVRTorsoDebugLines() -{ - if(vr_vrtorso_debuglines_enabled.value == 0 || !svPlayerActive()) - { - return; - } - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - const auto len = 20.f; - - const auto [adjPlayerOrigin, adjPlayerOriginLeft, adjPlayerOriginRight, - headFwdDir, headRightDir, headUpDir, mixHandDir, mixFinalDir] = - VR_GetBodyYawAngleCalculations(); - - glBegin(type); - - glColor4f(0, 1, 0, 0.75); - VR_GLVertex3f(adjPlayerOriginLeft); - VR_GLVertex3f(cl.handpos[0]); - - glColor4f(0, 1, 0, 0.75); - VR_GLVertex3f(adjPlayerOriginRight); - VR_GLVertex3f(cl.handpos[1]); - - glColor4f(0, 1, 0, 0.75); - VR_GLVertex3f(adjPlayerOrigin); - VR_GLVertex3f(adjPlayerOrigin + headFwdDir * len); - - glColor4f(0, 0, 1, 0.75); - VR_GLVertex3f(adjPlayerOrigin); - VR_GLVertex3f(adjPlayerOrigin + mixHandDir * len); - - glColor4f(1, 0, 0, 0.75); - VR_GLVertex3f(adjPlayerOrigin); - VR_GLVertex3f(adjPlayerOrigin + mixFinalDir * len * 1.25f); - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowVirtualStock() -{ - if(vr_show_virtual_stock.value == 0 || !svPlayerActive()) - { - return; - } - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - const auto [drawMainHand, drawOffHand] = - VR_GetHandsToDraw(vr_show_virtual_stock.value); - - glBegin(type); - - if(drawMainHand) - { - VR_ShowVirtualStockImpl(cVR_MainHand, cVR_OffHand); - } - - if(drawOffHand) - { - VR_ShowVirtualStockImpl(cVR_OffHand, cVR_MainHand); - } - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowHipHolsters() -{ - if(vr_show_hip_holsters.value == 0 || !svPlayerActive()) - { - return; - } - - const auto offHandPos = cl.handpos[cVR_OffHand]; - const auto mainHandPos = cl.handpos[cVR_MainHand]; - - const auto leftHipPos = VR_GetLeftHipPos(); - const auto rightHipPos = VR_GetRightHipPos(); - - const auto doColor = [&](const glm::vec3& hand, const glm::vec3& holster) { - if(VR_InHipHolsterDistance(hand, holster)) - { - glColor4f(1, 1, 0, 0.95); - } - else - { - if(hand == mainHandPos) - { - glColor4f(0, 1, 1, 0.75); - } - else - { - glColor4f(0, 1, 0, 0.75); - } - } - }; - - const auto doLine = [&](const glm::vec3& hand, const glm::vec3& holster) { - doColor(hand, holster); - VR_GLVertex3f(hand); - VR_GLVertex3f(holster); - }; - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - const auto [drawMainHand, drawOffHand] = - VR_GetHandsToDraw(vr_show_hip_holsters.value); - - glBegin(type); - - if(drawMainHand) - { - doLine(mainHandPos, leftHipPos); - doLine(mainHandPos, rightHipPos); - } - - if(drawOffHand) - { - doLine(offHandPos, leftHipPos); - doLine(offHandPos, rightHipPos); - } - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowShoulderHolsters() -{ - if(vr_show_shoulder_holsters.value == 0 || !svPlayerActive()) - { - return; - } - - const auto offHandPos = cl.handpos[cVR_OffHand]; - const auto mainHandPos = cl.handpos[cVR_MainHand]; - - const auto leftShoulderPos = VR_GetLeftShoulderHolsterPos(); - const auto rightShoulderPos = VR_GetRightShoulderHolsterPos(); - - const auto doColor = [&](const glm::vec3& hand, const glm::vec3& holster) { - if(VR_InShoulderHolsterDistance(hand, holster)) - { - glColor4f(1, 1, 0, 0.95); - } - else - { - if(hand == mainHandPos) - { - glColor4f(0, 1, 1, 0.75); - } - else - { - glColor4f(0, 1, 0, 0.75); - } - } - }; - - const auto doLine = [&](const glm::vec3& hand, const glm::vec3& holster) { - doColor(hand, holster); - VR_GLVertex3f(hand); - VR_GLVertex3f(holster); - }; - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - const auto [drawMainHand, drawOffHand] = - VR_GetHandsToDraw(vr_show_shoulder_holsters.value); - - glBegin(type); - - if(drawMainHand) - { - doLine(mainHandPos, leftShoulderPos); - doLine(mainHandPos, rightShoulderPos); - } - - if(drawOffHand) - { - doLine(offHandPos, leftShoulderPos); - doLine(offHandPos, rightShoulderPos); - } - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowUpperHolsters() -{ - if(vr_show_upper_holsters.value == 0 || !svPlayerActive()) - { - return; - } - - const auto offHandPos = cl.handpos[cVR_OffHand]; - const auto mainHandPos = cl.handpos[cVR_MainHand]; - - const auto leftUpperPos = VR_GetLeftUpperPos(); - const auto rightUpperPos = VR_GetRightUpperPos(); - - const auto doColor = [&](const glm::vec3& hand, const glm::vec3& holster) { - if(VR_InUpperHolsterDistance(hand, holster)) - { - glColor4f(1, 1, 0, 0.95); - } - else - { - if(hand == mainHandPos) - { - glColor4f(0, 1, 1, 0.75); - } - else - { - glColor4f(0, 1, 0, 0.75); - } - } - }; - - const auto doLine = [&](const glm::vec3& hand, const glm::vec3& holster) { - doColor(hand, holster); - VR_GLVertex3f(hand); - VR_GLVertex3f(holster); - }; - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - const auto [drawMainHand, drawOffHand] = - VR_GetHandsToDraw(vr_show_upper_holsters.value); - - glBegin(type); - - if(drawMainHand) - { - doLine(mainHandPos, leftUpperPos); - doLine(mainHandPos, rightUpperPos); - } - - if(drawOffHand) - { - doLine(offHandPos, leftUpperPos); - doLine(offHandPos, rightUpperPos); - } - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -static void VR_ShowCrosshairImpl(const float size, const float alpha, - const glm::vec3& start, const glm::vec3& forward) -{ - switch((int)vr_crosshair.value) - { - default: - case VrCrosshair::e_POINT: - { - glm::vec3 end, impact; - - if(vr_crosshair_depth.value <= 0) - { - // trace to first wall - end = start + 4096.f * forward; - end[2] += vr_crosshairy.value; - - impact = TraceLine(start, end).endpos; - } - else - { - // fix crosshair to specific depth - impact = start + vr_crosshair_depth.value * forward; - } - - glEnable(GL_POINT_SMOOTH); - glColor4f(1, 0, 0, alpha); - glPointSize(size * glwidth / vid.width); - - glBegin(GL_POINTS); - VR_GLVertex3f(impact); - glEnd(); - glDisable(GL_POINT_SMOOTH); - break; - } - - case VrCrosshair::e_LINE: [[fallthrough]]; - case VrCrosshair::e_LINE_SMOOTH: - { - const float depth = - vr_crosshair_depth.value <= 0 ? 4096 : vr_crosshair_depth.value; - - // trace to first entity - const auto end = start + depth * forward; - const trace_t trace = - TraceLineToEntity(start, end, getPlayerEdict()); - auto impact = hitSomething(trace) ? trace.endpos : end; - impact[2] += vr_crosshairy.value * 10.f; - - glLineWidth(size * glwidth / vid.width); - glEnable(GL_LINE_SMOOTH); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINE_STRIP); - - if((int)vr_crosshair.value == VrCrosshair::e_LINE) - { - glColor4f(1, 0, 0, alpha); - VR_GLVertex3f(start); - VR_GLVertex3f(impact); - } - else - { - const auto midA = glm::mix(start, impact, 0.15); - const auto midB = glm::mix(start, impact, 0.70); - - glColor4f(1, 0, 0, alpha * 0.01f); - VR_GLVertex3f(start); - - glColor4f(1, 0, 0, alpha); - VR_GLVertex3f(midA); - VR_GLVertex3f(midB); - - glColor4f(1, 0, 0, alpha * 0.01f); - VR_GLVertex3f(impact); - } - - glEnd(); - glShadeModel(GL_FLAT); - glDisable(GL_LINE_SMOOTH); - break; - } - } -} - -static void VR_ShowCrosshairMainHand(const float size, const float alpha) -{ - if(VR_GetWpnCrosshairMode(VR_GetMainHandWpnCvarEntry()) == - WpnCrosshairMode::Forbidden) - { - return; - } - - const auto [start, forward, right, up] = [&] { - // calc the line and draw - if(vr_aimmode.value == VrAimMode::e_CONTROLLER) - { - const auto start = VR_CalcMainHandWpnMuzzlePos(); - const auto [forward, right, up] = - getAngledVectors(cl.handrot[cVR_MainHand]); - return std::tuple{start, forward, right, up}; - } - - auto start = cl.viewent.origin; - start[2] -= cl.viewheight - 10; - - const auto [forward, right, up] = getAngledVectors(cl.aimangles); - return std::tuple{start, forward, right, up}; - }(); - - VR_ShowCrosshairImpl(size, alpha, start, forward); -} - -static void VR_ShowCrosshairOffHand(const float size, const float alpha) -{ - if(VR_GetWpnCrosshairMode(VR_GetOffHandWpnCvarEntry()) == - WpnCrosshairMode::Forbidden) - { - return; - } - - const auto [start, forward, right, up] = [&] { - // calc the line and draw - const auto start = VR_CalcOffHandWpnMuzzlePos(); - const auto [forward, right, up] = - getAngledVectors(cl.handrot[cVR_OffHand]); - return std::tuple{start, forward, right, up}; - }(); - - VR_ShowCrosshairImpl(size, alpha, start, forward); -} - -void VR_ShowCrosshair() -{ - if(vr_crosshair.value == 0 || !svPlayerActive()) - { - return; - } - - const float size = CLAMP(0.0, vr_crosshair_size.value, 32.0); - const float alpha = CLAMP(0.0, vr_crosshair_alpha.value, 1.0); - - if(size <= 0 || alpha <= 0) - { - return; - } - - VR_ShowFnSetupGL(); - - VR_ShowCrosshairMainHand(size, alpha); - VR_ShowCrosshairOffHand(size, alpha); - - VR_ShowFnCleanupGL(); -} - -void VR_DrawTeleportLine() -{ - if(!vr_teleport_enabled.value /*|| !svPlayerActive()*/ || !vr_teleporting || - vr_aimmode.value != VrAimMode::e_CONTROLLER) - { - return; - } - - const float size = 2.f; - const float alpha = 0.5f; - - if(size <= 0 || alpha <= 0) - { - return; - } - - - // calc angles - const auto start = cl.handpos[cVR_OffHand]; - - // calc line - const auto impact = vr_teleporting_impact; - - const auto midA = glm::mix(start, impact, 0.15); - const auto midB = glm::mix(start, impact, 0.85); - - // draw line - const auto setColor = [&](const float xAlpha) { - if(vr_teleporting_impact_valid) - { - glColor4f(0, 0, 1, xAlpha); - } - else - { - glColor4f(1, 0, 0, xAlpha); - } - }; - - VR_ShowFnSetupGL(); - - glLineWidth(size * glwidth / vid.width); - - glEnable(GL_LINE_SMOOTH); - glShadeModel(GL_SMOOTH); - - glBegin(GL_LINE_STRIP); - - setColor(alpha * 0.01f); - VR_GLVertex3f(start); - - setColor(alpha); - VR_GLVertex3f(midA); - VR_GLVertex3f(midB); - - setColor(alpha * 0.01f); - VR_GLVertex3f(impact); - - glEnd(); - - glShadeModel(GL_FLAT); - glDisable(GL_LINE_SMOOTH); - - VR_ShowFnCleanupGL(); -} - -void VR_ShowWpnoffsetHelperOffset() -{ - if(vr_impl_draw_wpnoffset_helper_offset == 0 || !svPlayerActive()) - { - return; - } - - const auto doColor = [&] { glColor4f(0, 1, 1, 0.75); }; - - const auto doLine = [&](const glm::vec3& a, const glm::vec3& b) { - doColor(); - VR_GLVertex3f(a); - VR_GLVertex3f(b); - }; - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - glBegin(type); - - const auto [handPos, handRot, cvarEntry] = [&] { - const auto hand = vr_impl_draw_wpnoffset_helper_offset == 1 - ? cVR_MainHand - : cVR_OffHand; - - return std::tuple{ - cl.handpos[hand], cl.handrot[hand], VR_GetWpnCvarEntry(hand)}; - }(); - - const auto offsetPos = - redirectVector(VR_GetWpnOffsets(cvarEntry), handRot); - - doLine(handPos, handPos + offsetPos); - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowWpnoffsetHelperMuzzle() -{ - if(vr_impl_draw_wpnoffset_helper_muzzle == 0 || !svPlayerActive()) - { - return; - } - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - glBegin(type); - - const auto muzzlePos = vr_impl_draw_wpnoffset_helper_muzzle == 1 - ? VR_CalcMainHandWpnMuzzlePos() - : VR_CalcOffHandWpnMuzzlePos(); - - glColor4f(0, 1, 1, 0.75); - VR_GLVertex3f(muzzlePos); - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowWpnoffsetHelper2HOffset() -{ - if(vr_impl_draw_wpnoffset_helper_2h_offset == 0 || !svPlayerActive()) - { - return; - } - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - glBegin(type); - - const auto pos = - vr_impl_draw_wpnoffset_helper_2h_offset == 1 - ? VR_Get2HHelpingHandPos(cVR_MainHand, cVR_OffHand) - : VR_Get2HHelpingHandPos(cVR_OffHand, cVR_MainHand); - - glColor4f(0, 1, 1, 0.75); - VR_GLVertex3f(pos); - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowHandPosAndRot() -{ - if(vr_debug_show_hand_pos_and_rot.value == 0 || !svPlayerActive()) - { - return; - } - - VR_ShowFnSetupGL(); - VR_ShowFnDrawPointsAndLines([&](const int type) { - glBegin(type); - - const auto drawHand = [&](const int hand) { - const auto& pos = cl.handpos[hand]; - const auto& rot = cl.handrot[hand]; - - const auto fwd = getFwdVecFromPitchYawRoll(rot); - const auto end = pos + fwd * 1.f; - - VR_GLVertex3f(pos); - VR_GLVertex3f(end); - }; - - glColor4f(0, 1, 0, 0.75); - drawHand(cVR_MainHand); - - glColor4f(1, 0, 0, 0.75); - drawHand(cVR_OffHand); - - glEnd(); - }); - VR_ShowFnCleanupGL(); -} - -void VR_ShowHandAnchorVertex() -{ - if(vr_impl_draw_hand_anchor_vertex == 0 || !svPlayerActive()) - { - return; - } - - const auto hand = - vr_impl_draw_hand_anchor_vertex == 1 ? cVR_MainHand : cVR_OffHand; - - const auto anchor = - hand == cVR_MainHand ? &cl.viewent : &cl.offhand_viewent; - - if(anchor->model == nullptr) - { - return; - } - - const int anchorVertex = static_cast<int>(VR_GetWpnCVarValue( - VR_GetWpnCvarEntry(hand), WpnCVar::HandAnchorVertex)); - - const auto drawVertex = [&](const int idxOffset) { - const glm::vec3 pos = VR_GetScaledAndAngledAliasVertexPosition( - anchor, anchorVertex + idxOffset, vec3_zero, cl.handrot[hand]); - - VR_GLVertex3f(pos); - }; - - VR_ShowFnSetupGL(); - - VR_ShowFnDrawPointsWithSize(12.f, [&](const int type) { - glBegin(type); - - glColor4f(0, 0, 1, 1.0); - drawVertex(0); - - glEnd(); - }); - - VR_ShowFnDrawPointsWithSize(6.f, [&](const int type) { - glBegin(type); - - glColor4f(0, 0, 1, 0.95); - drawVertex(1); - drawVertex(-1); - - glEnd(); - }); - - VR_ShowFnDrawPointsWithSize(3.25f, [&](const int type) { - glBegin(type); - - glColor4f(0, 0, 1, 0.9); - - for(int i = 0; i < 500; ++i) - { - drawVertex(i); - drawVertex(-i); - } - - glEnd(); - }); - - VR_ShowFnCleanupGL(); -} - -// TODO VR: (P1) code repetition -void VR_Show2HHandAnchorVertex() -{ - if(vr_impl_draw_2h_hand_anchor_vertex == 0 || !svPlayerActive()) - { - return; - } - - const auto hand = - vr_impl_draw_2h_hand_anchor_vertex == 1 ? cVR_MainHand : cVR_OffHand; - - const auto anchor = - hand == cVR_MainHand ? &cl.viewent : &cl.offhand_viewent; - - if(anchor->model == nullptr) + if(vr_fakevr.value || vr_novrinit.value) { return; } - const int anchorVertex = static_cast<int>(VR_GetWpnCVarValue( - VR_GetWpnCvarEntry(hand), WpnCVar::TwoHHandAnchorVertex)); + // Render the scene for each eye into their FBOs + for(vr_eye_t& eye : eyes) + { + // TODO VR: (P2) this global is problematic, remove it and pass args + // around It is used in view.cpp and gl_rmain.cpp + current_eye = &eye; - const auto drawVertex = [&](const int idxOffset) { - const glm::vec3 pos = VR_GetScaledAndAngledAliasVertexPosition( - anchor, anchorVertex + idxOffset, vec3_zero, cl.handrot[hand]); + // We need to scale the view offset position to quake units and + // rotate it by the current input angles (viewangle - eye + // orientation) + const auto orientation = QuatToYawPitchRoll(eye.orientation); + qvec3 temp{-eye.position.v[2], -eye.position.v[0], eye.position.v[1]}; + temp *= meters_to_units; + vr_viewOffset = Vec3RotateZ( + temp, (r_refdef.viewangles[YAW] - orientation[YAW]) * M_PI_DIV_180); - VR_GLVertex3f(pos); - }; + vr_viewOffset[2] += vr_floor_offset.value; - VR_ShowFnSetupGL(); + RenderScreenForCurrentEye_OVR(eye); + } - VR_ShowFnDrawPointsWithSize(12.f, [&](const int type) { - glBegin(type); + // Blit mirror texture to backbuffer + const GLint w = glwidth; + const GLint h = glheight; - glColor4f(0, 0, 1, 1.0); - drawVertex(0); + glBindFramebuffer(GL_READ_FRAMEBUFFER, eyes[0].fbo.framebuffer); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + glBlitFramebuffer(0, eyes[0].fbo.size.width, eyes[0].fbo.size.height, 0, 0, + h, w, 0, GL_COLOR_BUFFER_BIT, GL_LINEAR); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); +} - glEnd(); - }); +void VR_SetMatrices() +{ + // Calculate HMD projection matrix and view offset position + vr::HmdMatrix44_t projection = TransposeMatrix( + ovrHMD->GetProjectionMatrix(current_eye->eye, 4.f, gl_farclip.value)); - VR_ShowFnDrawPointsWithSize(6.f, [&](const int type) { - glBegin(type); + // Set OpenGL projection and view matrices + glMatrixMode(GL_PROJECTION); + glLoadMatrixf((GLfloat*)projection.m); +} - glColor4f(0, 0, 1, 0.95); - drawVertex(1); - drawVertex(-1); +[[nodiscard]] qvec3 VR_GetLastHeadOrigin() noexcept +{ + return lastHeadOrigin; +} - glEnd(); - }); +[[nodiscard]] qfloat VR_GetCrouchRatio() noexcept +{ + const auto maxHeight = vr_height_calibration.value; + const auto currHeight = VR_GetLastHeadOrigin()[2]; + return std::clamp((maxHeight / currHeight) - 1._qf, 0._qf, 1._qf); +} - VR_ShowFnDrawPointsWithSize(3.25f, [&](const int type) { - glBegin(type); +void VR_CalibrateHeight() +{ + const auto height = lastHeadOrigin[2]; + Cvar_SetValue("vr_height_calibration", height); + Con_Printf("Calibrated height to %.2f\n", height); +} - glColor4f(0, 0, 1, 0.9); +[[nodiscard]] qvec3 VR_AddOrientationToViewAngles(const qvec3& angles) noexcept +{ + const auto [pitch, yaw, roll] = + QuatToYawPitchRoll(current_eye->orientation); - for(int i = 0; i < 500; ++i) - { - drawVertex(i); - drawVertex(-i); - } + return {angles[PITCH] + pitch, angles[YAW] + yaw, roll}; +} - glEnd(); - }); +[[nodiscard]] bool VR_InHipHolsterDistance( + const qvec3& hand, const qvec3& holster) +{ + return glm::distance(hand, holster) < vr_hip_holster_thresh.value; +} - VR_ShowFnCleanupGL(); +[[nodiscard]] bool VR_InShoulderHolsterDistance( + const qvec3& hand, const qvec3& holster) +{ + return glm::distance(hand, holster) < vr_shoulder_holster_thresh.value; } -void VR_DrawAllShowHelpers() +[[nodiscard]] bool VR_InUpperHolsterDistance( + const qvec3& hand, const qvec3& holster) { - VR_ShowVirtualStock(); - VR_ShowHipHolsters(); - VR_ShowShoulderHolsters(); - VR_ShowUpperHolsters(); - VR_ShowVRTorsoDebugLines(); - VR_DrawTeleportLine(); - VR_ShowWpnoffsetHelperOffset(); - VR_ShowWpnoffsetHelperMuzzle(); - VR_ShowWpnoffsetHelper2HOffset(); - VR_ShowHandPosAndRot(); - VR_ShowHandAnchorVertex(); - VR_Show2HHandAnchorVertex(); + return glm::distance(hand, holster) < vr_upper_holster_thresh.value; } void VR_Draw2D() { bool draw_sbar = false; - glm::vec3 menu_angles; - glm::vec3 target; - const float scale_hud = vr_menu_scale.value; const int oldglwidth = glwidth; @@ -4056,44 +3426,51 @@ void VR_Draw2D() { if(menuMode == VrMenuMode::LastHeadAngles) { - menu_angles = inMenu() ? lastMenuAngles : cl.viewangles; + vr_menu_angles = inMenuOrConsole() ? lastMenuAngles : cl.viewangles; } else { - menu_angles = cl.viewangles; + vr_menu_angles = cl.viewangles; } if(vr_aimmode.value == VrAimMode::e_HEAD_MYAW || vr_aimmode.value == VrAimMode::e_HEAD_MYAW_MPITCH) { - menu_angles[PITCH] = 0; + vr_menu_angles[PITCH] = 0; } - const auto fwd = getFwdVecFromPitchYawRoll(menu_angles); - target = r_refdef.vieworg + vr_menu_distance.value * fwd; + const auto fwd = getFwdVecFromPitchYawRoll(vr_menu_angles); + vr_menu_target = + r_refdef.vieworg + qfloat(vr_menu_distance.value) * fwd; + vr_menu_normal = fwd; } else { const auto hand = menuMode == VrMenuMode::FollowOffHand ? cVR_OffHand : cVR_MainHand; - menu_angles = cl.handrot[hand]; + vr_menu_angles = cl.handrot[hand]; - const auto fwd = getFwdVecFromPitchYawRoll(menu_angles); - target = cl.handpos[hand] + vr_menu_distance.value * fwd; + const auto fwd = getFwdVecFromPitchYawRoll(vr_menu_angles); + vr_menu_target = + cl.handpos[hand] + qfloat(vr_menu_distance.value) * fwd; + vr_menu_normal = fwd; } // TODO VR: (P2) control smoothing with cvar - const auto smoothedTarget = glm::mix(lastMenuPosition, target, 0.9); + const auto smoothedTarget = glm::mix(lastMenuPosition, vr_menu_target, 0.9); lastMenuPosition = smoothedTarget; glTranslatef(smoothedTarget[0], smoothedTarget[1], smoothedTarget[2]); + vr_menu_angles[YAW] -= 90; + vr_menu_angles[PITCH] += 90; + // rotate around z - glRotatef(menu_angles[YAW] - 90, 0, 0, 1); + glRotatef(vr_menu_angles[YAW], 0, 0, 1); // keep bar at constant angled pitch towards user - glRotatef(90 + menu_angles[PITCH], -1, 0, 0); + glRotatef(vr_menu_angles[PITCH], -1, 0, 0); // center the status bar glTranslatef(-(320.0 * scale_hud / 2), -(200.0 * scale_hud / 2), 0); @@ -4141,6 +3518,7 @@ void VR_Draw2D() SCR_DrawClock(); // johnfitz SCR_DrawConsole(); M_Draw(); + M_DrawKeyboard(); } glDisable(GL_BLEND); @@ -4161,11 +3539,11 @@ void VR_Draw2D() void VR_DrawSbar() { - glm::vec3 sbar_angles; - glm::vec3 forward; - glm::vec3 right; - glm::vec3 up; - glm::vec3 target; + qvec3 sbar_angles; + qvec3 forward; + qvec3 right; + qvec3 up; + qvec3 target; const float scale_hud = vr_hud_scale.value; @@ -4184,7 +3562,7 @@ void VR_DrawSbar() sbar_angles = cl.handrot[cVR_MainHand]; std::tie(forward, right, up) = getAngledVectors(sbar_angles); - target = cl.handpos[cVR_MainHand] + -5.f * right; + target = cl.handpos[cVR_MainHand] + -5._qf * right; } else { @@ -4193,7 +3571,7 @@ void VR_DrawSbar() sbar_angles = cl.handrot[cVR_OffHand]; std::tie(forward, right, up) = getAngledVectors(sbar_angles); - target = cl.handpos[cVR_OffHand] + 0.f * right; + target = cl.handpos[cVR_OffHand] + 0._qf * right; } } else @@ -4208,7 +3586,7 @@ void VR_DrawSbar() std::tie(forward, right, up) = getAngledVectors(sbar_angles); - target = cl.viewent.origin + 1.f * forward; + target = cl.viewent.origin + 1._qf * forward; } // TODO VR: (P2) 1.0? Attach to off hand? @@ -4222,14 +3600,14 @@ void VR_DrawSbar() if(vr_aimmode.value == VrAimMode::e_CONTROLLER && sbarmode == VrSbarMode::OffHand) { - glm::fquat m; + qquat m; m = glm::quatLookAt(forward, up); - m = glm::rotate(m, vr_sbar_offset_pitch.value, glm::vec3{1, 0, 0}); - m = glm::rotate(m, vr_sbar_offset_yaw.value, glm::vec3{0, 1, 0}); - m = glm::rotate(m, vr_sbar_offset_roll.value, glm::vec3{0, 0, 1}); + m = glm::rotate(m, qfloat(vr_sbar_offset_pitch.value), qvec3{1, 0, 0}); + m = glm::rotate(m, qfloat(vr_sbar_offset_yaw.value), qvec3{0, 1, 0}); + m = glm::rotate(m, qfloat(vr_sbar_offset_roll.value), qvec3{0, 0, 1}); m = glm::normalize(m); - glMultMatrixf(&glm::mat4_cast(m)[0][0]); + glMultMatrixf(&toGlMat(m)[0][0]); const auto ox = vr_sbar_offset_x.value; const auto oy = vr_sbar_offset_y.value; @@ -4255,7 +3633,7 @@ void VR_DrawSbar() glPopMatrix(); } -void VR_SetAngles(const glm::vec3& angles) noexcept +void VR_SetAngles(const qvec3& angles) noexcept { cl.aimangles = angles; cl.viewangles = angles; @@ -4334,8 +3712,102 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, return vr_menu_mult; } +static void VR_DoInput_UpdateFakeMouse() +{ + int mx, my; + const auto mouseState = SDL_GetMouseState(&mx, &my); + + vr_menu_mouse_x = mx; + vr_menu_mouse_y = my; + vr_menu_mouse_click = mouseState & SDL_BUTTON(SDL_BUTTON_LEFT); +} + +static void VR_DoInput_UpdateVRMouse() +{ + if(!controllers[0].active && !controllers[1].active) + { + vr_menu_mouse_x = vr_menu_mouse_y = 0; + vr_menu_mouse_click = false; + return; + } + + const auto updateWith = [&](const HandIdx handIdx) { + const auto& orig = cl.handpos[handIdx]; + const auto dir = getFwdVecFromPitchYawRoll(cl.handrot[handIdx]); + + const auto& planeOrig = vr_menu_target; + const auto planeDir = getFwdVecFromPitchYawRoll(vr_menu_angles); + + const auto [fwd, right, up] = getAngledVectors(vr_menu_normal); + + const auto yr = [](const auto& v) { + return redirectVectorByYaw(v, VR_GetTurnYawAngle()); + }; + + qfloat intersectionDist{}; + glm::intersectRayPlane(orig, dir, planeOrig, yr(fwd), intersectionDist); + + const auto intersectionPoint = orig + intersectionDist * dir; + const auto res = intersectionPoint - planeOrig; + + vr_menu_intersection_point = intersectionPoint; + + const float scale_hud = vr_menu_scale.value; + + const auto sign = [](const float x) { + if(x >= 0) return 1.f; + return -1.f; + }; + + const auto xProj = glm::proj(res, yr(right)); + const float xSign = -sign(glm::dot(xProj, yr(right))); + vr_menu_mouse_x = glm::length(xProj) * xSign / scale_hud + 320 / 2; + + const auto yProj = glm::proj(res, yr(up)); + const float ySign = -sign(glm::dot(yProj, yr(up))); + vr_menu_mouse_y = glm::length(yProj) * ySign / scale_hud + 240 / 2; + }; + + const auto doControllersInOrder = [&](const HandIdx first, + const HandIdx second) { + if(controllers[first].active) + { + updateWith(first); + return; + } + + if(controllers[second].active) + { + updateWith(second); + return; + } + }; + + if(vr_menu_mouse_pointer_hand.value == 1) + { + doControllersInOrder(cVR_MainHand, cVR_OffHand); + } + else + { + doControllersInOrder(cVR_OffHand, cVR_MainHand); + } +} + [[nodiscard]] static VRAxisResult VR_DoInput() { + if(vr_fakevr.value && vr_novrinit.value) + { + vr_menu_mult = 1.f; + vr_left_prevgrabbing = vr_left_grabbing; + vr_right_prevgrabbing = vr_right_grabbing; + vr_left_grabbing = !(in_grableft.state & 1); + vr_right_grabbing = !(in_grabright.state & 1); + + VR_DoInput_UpdateFakeMouse(); + + return {0.f, 0.f, 0.f}; + } + { const auto rc = vr::VRInput()->UpdateActionState( &vrActiveActionSet, sizeof(vr::VRActiveActionSet_t), 1); @@ -4381,6 +3853,53 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, return out; }; + const auto readSkeletalSummary = [](const vr::VRActionHandle_t& + actionHandle) { + vr::InputSkeletalActionData_t outActionData; + + { + const auto rc = vr::VRInput()->GetSkeletalActionData(actionHandle, + &outActionData, sizeof(vr::InputSkeletalActionData_t)); + + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf( + "Failed to read Steam VR skeletal action data, rc = %d\n", + (int)rc); + } + } + + if(!outActionData.bActive) + { + // Con_Printf( + // "Failed to read Steam VR inactive skeletal action data\n"); + + return vr::VRSkeletalSummaryData_t{}; + } + + vr::VRSkeletalSummaryData_t outSummary; + + { + const int rc = vr::VRInput()->GetSkeletalSummaryData(actionHandle, + vr::EVRSummaryType::VRSummaryType_FromDevice, &outSummary); + + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf( + "Failed to read Steam VR skeletal summary data, rc = %d\n", + (int)rc); + } + } + + return outSummary; + }; + + const auto ssLeftHand = readSkeletalSummary(vrahLeftHandAnim); + const auto ssRightHand = readSkeletalSummary(vrahRightHandAnim); + + vr_ss_lefthand = ssLeftHand; + vr_ss_righthand = ssRightHand; + const auto inpLocomotion = readAnalogAction(vrahLocomotion); const auto inpTurn = readAnalogAction(vrahTurn); @@ -4434,6 +3953,32 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, const auto mustBTurnLeft = inpBTurnLeft.bState; const auto mustBTurnRight = inpBTurnRight.bState; + const auto inpMenuNavigation = readAnalogAction(vrahMenuNavigation); + const auto inpMenuUp = readDigitalAction(vrahMenuUp); + const auto inpMenuDown = readDigitalAction(vrahMenuDown); + const auto inpMenuLeft = readDigitalAction(vrahMenuLeft); + const auto inpMenuRight = readDigitalAction(vrahMenuRight); + const auto inpMenuEnter = readDigitalAction(vrahMenuEnter); + const auto inpMenuBack = readDigitalAction(vrahMenuBack); + const auto inpMenuAddToShortcuts = + readDigitalAction(vrahMenuAddToShortcuts); + const auto inpMenuMultiplierHalf = + readDigitalAction(vrahMenuMultiplierHalf); + const auto inpMenuMultiplierPlusOne = + readDigitalAction(vrahMenuMultiplierPlusOne); + const auto inpMenuMultiplierPlusOne2 = + readDigitalAction(vrahMenuMultiplierPlusOne2); + + // VR: Active action set transition. + if(inMenuOrConsole() && !inpEscape.bState) + { + vrActiveActionSet.ulActionSet = vrashMenu; + } + else if(!inMenuOrConsole() && !inpMenuBack.bState) + { + vrActiveActionSet.ulActionSet = vrashDefault; + } + // TODO VR: (P2) global state mutation here, could be source of bugs vr_left_prevgrabbing = vr_left_grabbing; vr_right_prevgrabbing = vr_right_grabbing; @@ -4444,19 +3989,21 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, Key_Event('l', inpRightGrab.bState); vr_left_grabbing = (in_grableft.state & 1); vr_right_grabbing = (in_grabright.state & 1); + VR_DoInput_UpdateVRMouse(); } else { vr_left_grabbing = !(in_grableft.state & 1); vr_right_grabbing = !(in_grabright.state & 1); + VR_DoInput_UpdateFakeMouse(); } in_speed.state = mustSpeed; // Menu multipliers to fine-tune values. - vr_menu_mult = mustTeleport ? 0.5f : 1.f; - vr_menu_mult += static_cast<int>(mustFireMainHand); - vr_menu_mult += static_cast<int>(mustFireOffHand); + vr_menu_mult = inpMenuMultiplierHalf.bState ? 0.5f : 1.f; + vr_menu_mult += static_cast<int>(inpMenuMultiplierPlusOne.bState); + vr_menu_mult += static_cast<int>(inpMenuMultiplierPlusOne2.bState); const auto doMenuHaptic = [&](const vr::VRInputValueHandle_t& origin) { vr::VRInput()->TriggerHapticVibrationAction( @@ -4466,6 +4013,16 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, vrahRightHaptic, 0, 0.1, 50, 0.5, origin); }; + /* + const auto doMenuKeyEvent = [&](const int key, + const vr::InputDigitalActionData_t& i) { + const bool pressed = isRisingEdge(i); + + Key_Event(key, pressed); + return pressed; + }; + */ + const auto doMenuKeyEventWithHaptic = [&](const int key, const vr::InputDigitalActionData_t& i) { const bool pressed = isRisingEdge(i); @@ -4479,13 +4036,8 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, return pressed; }; - if(inMenu()) + if(inMenuOrConsole()) { - doMenuKeyEventWithHaptic(K_ENTER, inpJump); - doMenuKeyEventWithHaptic(K_ESCAPE, inpEscape); - doMenuKeyEventWithHaptic(K_LEFTARROW, inpNextWeaponOffHand); - doMenuKeyEventWithHaptic(K_RIGHTARROW, inpNextWeaponMainHand); - const auto doAxis = [&](const int axis, const auto& inp, const int quakeKeyNeg, const int quakeKeyPos) { const float lastVal = @@ -4520,9 +4072,6 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, } }; - doAxis(1 /* Y axis */, inpLocomotion, K_UPARROW, K_DOWNARROW); - doAxis(0 /* X axis */, inpTurn, K_RIGHTARROW, K_LEFTARROW); - const auto doBooleanInput = [&](const auto& inp, const int quakeKey) { if(inp.bChanged) { @@ -4535,8 +4084,21 @@ void VR_DoHaptic(const int hand, const float delay, const float duration, } }; - doBooleanInput(inpBMoveForward, K_UPARROW); - doBooleanInput(inpBMoveBackward, K_DOWNARROW); + if(vr_fakevr.value == 0) + { + vr_menu_mouse_click = inpMenuEnter.bState; + + doMenuKeyEventWithHaptic(K_ENTER, inpMenuEnter); + doMenuKeyEventWithHaptic(K_ESCAPE, inpMenuBack); + doMenuKeyEventWithHaptic(K_LEFTARROW, inpMenuLeft); + doMenuKeyEventWithHaptic(K_RIGHTARROW, inpMenuRight); + + doAxis(1 /* Y axis */, inpMenuNavigation, K_UPARROW, K_DOWNARROW); + // doAxis(0 /* X axis */, inpTurn, K_RIGHTARROW, K_LEFTARROW); + + doBooleanInput(inpMenuUp, K_UPARROW); + doBooleanInput(inpMenuDown, K_DOWNARROW); + } } else { @@ -4586,6 +4148,9 @@ void VR_Move(usercmd_t* cmd) return; } + // VR: VR yaw. + cmd->vryaw = vrYaw; + // VR: Main hand values. cmd->handpos = cl.handpos[cVR_MainHand]; cmd->handrot = cl.handrot[cVR_MainHand]; @@ -4602,27 +4167,54 @@ void VR_Move(usercmd_t* cmd) cmd->offhandvelmag = cl.handvelmag[cVR_OffHand]; cmd->offhandavel = cl.handavel[cVR_OffHand]; - // VR: Weapon muzzle position. - cmd->muzzlepos = VR_CalcMainHandWpnMuzzlePos(); - cmd->offmuzzlepos = VR_CalcOffHandWpnMuzzlePos(); + // VR: Head velocity. + cmd->headvel = cl.headvel; - // VR: Buttons and instant controller actions. - // VR: Query state of controller axes. - const auto [fwdMove, sideMove, yawMove] = VR_DoInput(); + // VR: Weapon muzzle position. + cmd->muzzlepos = VR_CalcFinalWpnMuzzlePos(cVR_MainHand); + cmd->offmuzzlepos = VR_CalcFinalWpnMuzzlePos(cVR_OffHand); // VR: Teleportation. - if(std::exchange(vr_send_teleport_msg, false)) + const bool teleporting = std::exchange(vr_send_teleport_msg, false); + if(teleporting) { - cmd->teleporting = 1; cmd->teleport_target = vr_teleporting_impact; } - else + + // VR: Buttons and instant controller actions. + // VR: Query state of controller axes. + const auto [fwdMove, sideMove, yawMove] = VR_DoInput(); + + // VR: VR-related bits. { - cmd->teleporting = 0; + const auto setBit = [](unsigned char& flags, const int bit, + const bool value) { + if(value) + { + flags |= bit; + } + else + { + flags &= ~bit; + } + }; + + const bool twoHAiming = (vr_2h_aim_transition[cVR_OffHand] >= 0.5f) || + (vr_2h_aim_transition[cVR_MainHand] >= 0.5f); + + cmd->vrbits0 = 0; + setBit(cmd->vrbits0, QVR_VRBITS0_TELEPORTING, teleporting); + setBit(cmd->vrbits0, QVR_VRBITS0_OFFHAND_GRABBING, vr_left_grabbing); + setBit(cmd->vrbits0, QVR_VRBITS0_OFFHAND_PREVGRABBING, + vr_left_prevgrabbing); + setBit(cmd->vrbits0, QVR_VRBITS0_MAINHAND_GRABBING, vr_right_grabbing); + setBit(cmd->vrbits0, QVR_VRBITS0_MAINHAND_PREVGRABBING, + vr_right_prevgrabbing); + setBit(cmd->vrbits0, QVR_VRBITS0_2H_AIMING, twoHAiming); } // VR: Hands. - const auto computeHotSpot = [](const glm::vec3& hand) { + const auto computeHotSpot = [](const qvec3& hand) { if(VR_InShoulderHolsterDistance(hand, VR_GetLeftShoulderHolsterPos())) { return QVR_HS_LEFT_SHOULDER_HOLSTER; @@ -4673,75 +4265,78 @@ void VR_Move(usercmd_t* cmd) return QVR_HS_NONE; }; - cmd->offhand_grabbing = vr_left_grabbing; - cmd->offhand_prevgrabbing = vr_left_prevgrabbing; - cmd->mainhand_grabbing = vr_right_grabbing; - cmd->mainhand_prevgrabbing = vr_right_prevgrabbing; + cl.hotspot[cVR_OffHand] = cmd->offhand_hotspot = + computeHotSpot(cl.handpos[cVR_OffHand]); - cmd->offhand_hotspot = computeHotSpot(cl.handpos[cVR_OffHand]); - cmd->mainhand_hotspot = computeHotSpot(cl.handpos[cVR_MainHand]); + cl.hotspot[cVR_MainHand] = cmd->mainhand_hotspot = + computeHotSpot(cl.handpos[cVR_MainHand]); - if(inMenu()) + if(inMenuOrConsole()) { return; } auto [lfwd, lright, lup] = getAngledVectors(cl.handrot[cVR_OffHand]); - if(vr_movement_mode.value == VrMovementMode::e_RAW_INPUT) - { - cmd->forwardmove += cl_forwardspeed.value * fwdMove; - cmd->sidemove += cl_forwardspeed.value * sideMove; - - // TODO VR: (P1) avoid gimbal by using up if we are point up/down like - // below, this is actually raw input but label in menu is "Follow Head" - } - else + if(vr_fakevr.value == 0) { - const auto [vfwd, vright, vup] = VR_GetHeadYawDirs(); + if(vr_movement_mode.value == VrMovementMode::e_RAW_INPUT) + { + cmd->forwardmove += cl_forwardspeed.value * fwdMove; + cmd->sidemove += cl_forwardspeed.value * sideMove; - // avoid gimbal by using up if we are point up/down - if(fabsf(lfwd[2]) > 0.8f) + // TODO VR: (P1) avoid gimbal by using up if we are point up/down + // like below, this is actually raw input but label in menu is + // "Follow Head" + } + else { - if(lfwd[2] < -0.8f) - { - lfwd *= -1.f; - } - else + const auto [vfwd, vright, vup] = VR_GetHeadYawDirs(); + + // avoid gimbal by using up if we are point up/down + if(fabs(lfwd[2]) > 0.8f) { - lup *= -1.f; - } + if(lfwd[2] < -0.8f) + { + lfwd *= -1.f; + } + else + { + lup *= -1.f; + } - std::swap(lup, lfwd); - } + std::swap(lup, lfwd); + } - // Scale up directions so tilting doesn't affect speed - const float fac = 1.0f / lup[2]; - lfwd *= fac; - lright *= fac; + // Scale up directions so tilting doesn't affect speed + const float fac = 1.0f / lup[2]; + lfwd *= fac; + lright *= fac; - const glm::vec3 move = (fwdMove * lfwd) + (sideMove * lright); - const float fwd = DotProduct(move, vfwd); - const float right = DotProduct(move, vright); + const qvec3 move = + (qfloat(fwdMove) * lfwd) + (qfloat(sideMove) * lright); + const auto fwd = DotProduct(move, vfwd); + const auto right = DotProduct(move, vright); - // Quake run doesn't affect the value of cl_sidespeed.value, so - // just use forward speed here for consistency - cmd->forwardmove += cl_forwardspeed.value * fwd; - cmd->sidemove += cl_forwardspeed.value * right; - } + // Quake run doesn't affect the value of cl_sidespeed.value, so + // just use forward speed here for consistency + cmd->forwardmove += cl_forwardspeed.value * fwd; + cmd->sidemove += cl_forwardspeed.value * right; + } - // roomscalemove: - cmd->roomscalemove = - vr_roomscale_move * static_cast<float>(1.0f / host_frametime); + // roomscalemove: + cmd->roomscalemove = + vr_roomscale_move * static_cast<qfloat>(1._qf / host_frametime); - std::tie(lfwd, lright, lup) = getAngledVectors(cl.handrot[cVR_OffHand]); - cmd->upmove += cl_upspeed.value * fwdMove * lfwd[2]; + std::tie(lfwd, lright, lup) = getAngledVectors(cl.handrot[cVR_OffHand]); + cmd->upmove += cl_upspeed.value * fwdMove * lfwd[2]; - if((in_speed.state & 1) ^ (cl_alwaysrun.value == 0.0)) - { - cmd->forwardmove *= cl_movespeedkey.value; - cmd->sidemove *= cl_movespeedkey.value; - cmd->upmove *= cl_movespeedkey.value; + if((in_speed.state & 1) ^ (cl_alwaysrun.value == 0.0)) + { + cmd->forwardmove *= cl_movespeedkey.value; + cmd->sidemove *= cl_movespeedkey.value; + cmd->upmove *= cl_movespeedkey.value; + } } lastVrYawDiff = 0.f; @@ -4768,38 +4363,198 @@ void VR_Move(usercmd_t* cmd) } } -// TODO VR: (P0) check axe and gun melee collision bug, doesn't seem responsive -// (seems better now, but test more) +// +// +// PAK Stuff + +[[nodiscard]] const std::string& VR_GetActiveStartPakName() +{ + const std::size_t idx = vr_activestartpaknameidx.value; + const auto& vec = VR_GetLoadedPakNamesWithStartMaps(); + return vec[idx % vec.size()]; +} + +[[nodiscard]] std::vector<std::string>& VR_GetLoadedPakNames() +{ + static std::vector<std::string> res; + return res; +} + +[[nodiscard]] std::vector<std::string>& VR_GetLoadedPakNamesWithStartMaps() +{ + static std::vector<std::string> res; + return res; +} + +[[nodiscard]] std::string VR_ExtractPakName(std::string_view sv) +{ + const auto afterSlash = sv.find_last_of("/\\") + 1; + sv = sv.substr(afterSlash, sv.size() - afterSlash); + sv.remove_suffix(4); + + return std::string(sv.data(), sv.size()); +} + +[[nodiscard]] std::string VR_ExtractPakName(const pack_t& pak) +{ + return VR_ExtractPakName(pak.filename); +} + +void VR_OnLoadedPak(pack_t& pak) +{ + const auto extractedName = VR_ExtractPakName(pak); + + VR_GetLoadedPakNames().emplace_back(extractedName); + Con_Printf("Added pakfile to search paths: '%s'\n", extractedName.data()); + + for(int i = 0; i < pak.numfiles; i++) + { + if(std::strcmp(pak.files[i].name, "maps/start.bsp") == 0) + { + VR_GetLoadedPakNamesWithStartMaps().emplace_back(extractedName); + continue; + } + } +} + +// TODO VR: (P1): "seems like for the custom map a2 i can add bots with no +// problem, but on ab2 if i rapidly add them then the game crashes" - can +// reproduce, seems a problem with waypoint `._next`? + +// TODO VR: (P1): "Quicksave would be better | A hotkey for quicksaving | Maybe +// a button combo" + +// TODO VR: (P1): (MP) "I seem to be inheriting the server settings for a number +// of client side options, for instance I have immersive mode on and body-item +// interactions off, but these options were not applied whilst I was a client. I +// assume server has those settings set according to what I experienced? " + +// TODO VR: (P1): (MP) "My axe had no physics collisions, was passing through +// walls etc, where as server reported he still had collsions" -// TODO VR: (P1) consider toning animation down while aiming 2h, might -// need a new weapon cvar and significant work +// TODO VR: (P1): (MP) "Would be cool to render the full scoreboard on the +// wrist, or maybe the bottom of the hand? I think easy access to ping at least +// would be very useful to understand the context of MP bugs. Though my ping +// generally didn't feel too bad, likely under 100ms" -// TODO VR: (P0) remove existing sv_player usages, or change to to -// svs.client edicts. I believe that, by definition, svs.clients[0] is the -// local player +// TODO VR: (P1): (MP) "Jumping seemed very unreliable at times and fairly often +// just didn't trigger at all, much worse than the latency I was experiencing +// with weapons and general movement. " -// TODO VR: (P1) add tooltip to off-hand option menu in wpn config +// TODO VR: (P1): (MP) "An easy way to join games would be cool, for instance a +// numpad on the MP menu? Or a "Paste from clipboard" button, etc. " -// TODO VR: (P0) remove/fix prevweapon binding, and off-hand cycle binding +// TODO VR: (P1): "In MP, would it be possible if when spawning and grab is +// already held, to automatically grab the weapon assigned to the corresponding +// leg slot?" + +// TODO VR: (P1): "In general, would it be possible for touching weapon pickups +// to immediately give the ammo, so that it is not necessary to pickup the +// weapon itself?" + +// TODO VR: (P1): When fullauto firing a nailgun in left hand, right hand +// weapon animations stop being lerped. + +// TODO VR: (P1): "Ammo switching should not be possible in non-DOE levels +// since no ammo can be found?" "I might consider randomly spawning some, +// controlling the spawn rate with a CVar. Why not" + +// TODO VR: (P1): plasma gun needs vrprojectilevelocity + +// TODO VR: (P1) "Some weapons are so long that they physics collide with +// the floor to prevent your hand from touching health pickups, so you need +// to do an awkward wrist movement to allow your hand to near the health +// pickup. Seems most obvious with the rocket launcher. In my opinion held +// weapons should just collect pickups when colliding instead." // TODO VR: (P1) "Perhaps the VR Body Interaction can be split into items / // weapons? I much prefer the weapon pickup by hand, due to the inventory // management aspect, where as items have no such concern" -// TODO VR: (P1) visual feedback when hovering holster, e.g. weapon comes out a -// bit, or glow, or bloom effect on vision edge (complementary to haptics) +// TODO VR: (P1) visual feedback when hovering holster, e.g. weapon comes +// out a bit, or glow, or bloom effect on vision edge (complementary to +// haptics) // TODO VR: (P1) melee doesn't work with laser cannon - intended? test -// TODO VR: (P2) "it seems to be a bit strange to me that I can hold down the -// trigger on the shotguns" +// TODO VR: (P1): "I had let go of weapon grabs between a level end and next +// level start and upon next level spawn the main hand weapon was nowhere to +// be found, the offhand weapon was on the floor" + +// TODO VR: (P1) recoil system, 2H will reduce it, or accuracy change for +// shotgun/ssg, reduce spread + +// TODO VR: (P1) "Is there an option to not drop the weapon I'm holding when +// I release the grip button?" + +// TODO VR: (P1) add system to load multiple folders at once (like paks) + +// TODO VR: (P1) Swimming direction - what controller to follow? + +// TODO VR: (P1) "no one wants to be faced with giant space shuttle like +// control panels full of semi-cryptic technical parameters to tweak right +// before one can start playing. That's just generally means the developer +// offloads the burden of setting the right defaults for many variables to +// the user, and the user experience suffers in consequence. " +// +// "These games are best enjoyed as plug and play experiences. And having to +// tweak various multipliers for all sorts of obscure parameters usually +// ruins that." + +// TODO VR: (P1) "hey i just was wondering how to use the soundtrack for +// mission pack 1? do i need to swap out the original soundtrack before +// launching? " + +// TODO VR: (P1): "If you're standing on a ledge and try to force grab an +// item below, it seems like you need to position your body over the ledge +// specifically so that a specific point of your body has a direct line of +// sight to the weapon" - this might be related to water + +// TODO VR: (P1): lightning bolt tent beam is lagging behind the player, +// why? + +// TODO VR: (P1): "also config is being rewritten +// +// Yes this is a bit annoying, though unavoidable in the case that new +// variables are being added I guess. Unless there's a way to either: +// +// A) preserve user overrides in a file separate to config.cfg, I think this +// might be possible with autoexec.cfg or something though I don't think +// that is integrated into the game itself at all and we need to manually +// maintain it? B) could we stop shipping config.cfg with each release and +// instead it populates missing variables on load with a sane default +// instead? Debatable depending on how mature @vee feels the project is +// +// I guess. I personally need to go and alter about 3-4 variables each +// release so it's manage-able for now." + +// TODO VR: (P1): "Seems like every beta I get 1-2 crashes, are there crash +// reports or memory dumps that would be useful?" + +// TODO VR: (P1): "- Is it normal for the HUD in DOE to not show alternate ammo +// counts unless the weapon is specifically selected and the alt ammo active?" + +// TODO VR: (P1): joining a multiplayer match with mismatched `start` map causes +// weird glitches as the BSP geometry is incorrect + +// TODO VR: (P1): consider merging VOIP and better networking from QSS + +// TODO VR: (P1): are things like holster placement affected by server configs +// in MP? Check + + + +// TODO VR: (P2) add tooltip to off-hand option menu in wpn config + +// TODO VR: (P2) "it seems to be a bit strange to me that I can hold down +// the trigger on the shotguns" // TODO VR: (P2) consider adding ghost hands // TODO VR: (P2) scourge of armagon music? -// TODO VR: (P2) consider new particle effect for shootable weapons and walls -// instead of blood +// TODO VR: (P2) consider new particle effect for shootable weapons and +// walls instead of blood // TODO VR: (P2) add general cvars for health and damage multipliers @@ -4810,20 +4565,59 @@ void VR_Move(usercmd_t* cmd) // TODO VR: (P2) immersive swimming // TODO VR: (P2): "the problem with turning up the QuakeVR particle -// system is that beyond a certain point it all starts to overlap. It would be -// nice if the value also somewhat increased the spread or distance of the -// particles too, just to make it a bit messier" - -// TODO VR: (P1): "If you're standing on a ledge and try to force grab an item -// below, it seems like you need to position your body over the ledge -// specifically so that a specific point of your body has a direct line of sight -// to the weapon" - this might be related to water - -// TODO VR: (P1): "I had let go of weapon grabs between a level end and next -// level start and upon next level spawn the main hand weapon was nowhere to be -// found, the offhand weapon was on the floor" - -// TODO VR: (P1): "I did find it quite confusing at times being unable to -// holster to my shoulder, because something was already there. I guess some -// sort of buzz or something to indicate the holster is full could be helpful." -// text message should be good enough +// system is that beyond a certain point it all starts to overlap. It would +// be nice if the value also somewhat increased the spread or distance of +// the particles too, just to make it a bit messier" + +// TODO VR: (P2) "The force grab seems a bit strange to me though, requiring +// me to press both the trigger and grip at once, then it doesn't quite come +// right to my hand, and I have to then release the buttons and then press +// grip again to finally grab it. Could do with a bit of a tweak, and +// obviously Half-Life: Alyx is the perfect example to rip off here." + +// TODO VR: (P2) "Also, snap turning seems to have a tiny bit of lag and/or +// not work some of the time. And I don't mean because of any kind of dead +// zone as I've tried that at different settings already. Maybe just double +// check there's not a bit of a code conflict, like maybe if you flick once +// you can't quite flick immediately again in some cases or something." + +// TODO VR: (P2) "Unfortunately, since the game doesn't differentiate from +// the mission packs, it uses the same soundtrack for all of them (eg if you +// were playing SOA, it would still play the original quake soundtrack +// unless you replaced the files manually)" + +// TODO VR: (P2) "Hopefully that can be fixed, along with merging the start +// map together into one giant hubworld" + +// TODO VR: (P2) "The lava splash noise just seems plain wrong, too watery. +// Even silent would be better, in the case of the molten rocks" + +// TODO VR: (P2) "Perhaps its just VR thats making me notice it, but the +// stopping friction after running just feels too light and floaty" + +// TODO VR: (P2) "In some situations force grab linear is being very +// unreliable, whereas others its fine. Is force grab code unchanged in +// 0.0.5 or is it helpful to try and replicate? I was having most issues +// when holding with right hand and trying to force grab with left." + +// TODO VR: (P2): " hint messages for each of the weapons when they are held for +// the first time in a new game?" + +// TODO VR: (P2): " I think making it work pretty much just like in Half-Life: +// Alyx would be ideal: So, you would press the controller's grip button while +// pointing at the object to activate the "force" (indicate this is happening to +// the player somehow), do a flick/pull motion toward you to flick the object to +// you (if you don't flick and instead release the button then it would +// deactivate the "force"), and then, in the case of this particular game, it +// could probably automatically grab the object once it reaches your hand (no +// additional press of the grip button required). Something like that would +// probably work: Press grip, flick/pull motion toward you, and you auto-grab it +// once it reaches your hand." + +// TODO VR: (P2): "On thing that I think that would be a quality of life +// improvement are quicksave/quickload entries at the top of the pause menu. +// When I was streaming the game, I meant to save the game, but when I went to +// go do that, my itchy button thumb accidentally started a new game." + +// TODO VR: (P2): "the desktop display has a bit of it cut off from what looks +// like the console" diff --git a/Quake/vr.hpp b/Quake/vr.hpp index 1a06650b..6fe7fa83 100644 --- a/Quake/vr.hpp +++ b/Quake/vr.hpp @@ -1,6 +1,26 @@ -#pragma once // 2016 Dominic Szablewski - phoboslab.org +#pragma once #include "quakedef.hpp" +#include "openvr.hpp" +#include "common.hpp" +#include "gl_model.hpp" +#include "entity.hpp" +#include "progs.hpp" + +#include <array> +#include <vector> +#include <string> + +// +// +// +// ---------------------------------------------------------------------------- +// VR Typedef +// ---------------------------------------------------------------------------- + +using HandIdx = int; // TODO VR: (P2) should be strong typedef? +using WpnCvarEntry = int; +using VertexIdx = int; // // @@ -9,9 +29,9 @@ // VR Constants // ---------------------------------------------------------------------------- -inline constexpr int cVR_OffHand = 0; -inline constexpr int cVR_MainHand = 1; -inline constexpr int cVR_FakeHand = 2; +inline constexpr HandIdx cVR_OffHand = 0; +inline constexpr HandIdx cVR_MainHand = 1; +inline constexpr HandIdx cVR_FakeHand = 2; // // @@ -20,6 +40,16 @@ inline constexpr int cVR_FakeHand = 2; // VR Configuration Enums // ---------------------------------------------------------------------------- +enum class FingerIdx : int +{ + Thumb = 0, + Index = 1, + Middle = 2, + Ring = 3, + Pinky = 4, + Base = 5 +}; + struct VrAimMode { enum Enum @@ -192,8 +222,8 @@ enum class VrMenuMode : int enum class VrForceGrabMode : int { Disabled = 0, - Parabola = 1, - Linear = 2, + Linear = 1, + Parabola = 2, Instant = 3, }; @@ -211,18 +241,13 @@ void VID_VR_Disable(); void VR_UpdateScreenContent(); -void VR_ShowCrosshair(); -void VR_DrawAllShowHelpers(); - -void VR_DrawTeleportLine(); void VR_Draw2D(); void VR_Move(usercmd_t* cmd); void VR_InitGame(); void VR_PushYaw(); void VR_DrawSbar(); -[[nodiscard]] glm::vec3 VR_AddOrientationToViewAngles( - const glm::vec3& angles) noexcept; -void VR_SetAngles(const glm::vec3& angles) noexcept; +[[nodiscard]] qvec3 VR_AddOrientationToViewAngles(const qvec3& angles) noexcept; +void VR_SetAngles(const qvec3& angles) noexcept; void VR_ResetOrientation(); void VR_SetMatrices(); void VR_CalibrateHeight(); @@ -230,6 +255,11 @@ void VR_ModVRTorsoModel(); void VR_ModVRLegHolsterModel(); void VR_ModAllModels(); +void VR_OnSpawnServer(); +void VR_OnClientClearState(); + + + struct VrGunWallCollision { bool _colliding{false}; @@ -237,17 +267,16 @@ struct VrGunWallCollision edict_t* _ent{nullptr}; }; -[[nodiscard]] glm::vec3 VR_GetAdjustedPlayerOrigin( - glm::vec3 playerOrigin) noexcept; +[[nodiscard]] qvec3 VR_GetAdjustedPlayerOrigin(qvec3 playerOrigin) noexcept; -[[nodiscard]] glm::vec3 VR_GetWorldHandPos( - const int handIndex, const glm::vec3& playerOrigin) noexcept; +[[nodiscard]] qvec3 VR_GetWorldHandPos( + const int handIndex, const qvec3& playerOrigin) noexcept; -[[nodiscard]] glm::vec3 VR_GetResolvedHandPos( - const glm::vec3& worldHandPos, const glm::vec3& adjPlayerOrigin) noexcept; +[[nodiscard]] qvec3 VR_GetResolvedHandPos(edict_t* edict, + const qvec3& worldHandPos, const qvec3& adjPlayerOrigin) noexcept; -glm::vec3 VR_UpdateGunWallCollisions(const int handIndex, - VrGunWallCollision& out, glm::vec3 resolvedHandPos) noexcept; +qvec3 VR_UpdateGunWallCollisions(edict_t* edict, const int handIndex, + VrGunWallCollision& out, qvec3 resolvedHandPos) noexcept; // TODO VR: (P2) move @@ -264,43 +293,44 @@ struct fbo_t [[nodiscard]] fbo_t& VR_GetEyeFBO(const int index) noexcept; -[[nodiscard]] const glm::vec3& VR_GetHeadOrigin() noexcept; +[[nodiscard]] const qvec3& VR_GetHeadOrigin() noexcept; void VR_DoHaptic(const int hand, const float delay, const float duration, const float frequency, const float amplitude); [[nodiscard]] float VR_GetMenuMult() noexcept; -[[nodiscard]] glm::vec3 VR_GetLastHeadOrigin() noexcept; -[[nodiscard]] float VR_GetCrouchRatio() noexcept; +[[nodiscard]] qvec3 VR_GetLastHeadOrigin() noexcept; +[[nodiscard]] qfloat VR_GetCrouchRatio() noexcept; -[[nodiscard]] glm::vec3 VR_GetLeftHipPos() noexcept; -[[nodiscard]] glm::vec3 VR_GetRightHipPos() noexcept; -[[nodiscard]] glm::vec3 VR_GetLeftUpperPos() noexcept; -[[nodiscard]] glm::vec3 VR_GetRightUpperPos() noexcept; +[[nodiscard]] qvec3 VR_GetLeftHipPos() noexcept; +[[nodiscard]] qvec3 VR_GetRightHipPos() noexcept; +[[nodiscard]] qvec3 VR_GetLeftUpperPos() noexcept; +[[nodiscard]] qvec3 VR_GetRightUpperPos() noexcept; -[[nodiscard]] float VR_GetTurnYawAngle() noexcept; -[[nodiscard]] glm::vec3 VR_GetHeadAngles() noexcept; -[[nodiscard]] float VR_GetHeadYawAngle() noexcept; -[[nodiscard]] float VR_GetBodyYawAngle() noexcept; +[[nodiscard]] qfloat VR_GetTurnYawAngle() noexcept; +[[nodiscard]] qvec3 VR_GetHeadAngles() noexcept; +[[nodiscard]] qfloat VR_GetHeadYawAngle() noexcept; +[[nodiscard]] qfloat VR_GetBodyYawAngle() noexcept; -[[nodiscard]] glm::vec3 VR_GetAliasVertexOffsets( +[[nodiscard]] qvec3 VR_GetAliasVertexOffsets( entity_t* const anchor, const int anchorVertex) noexcept; -[[nodiscard]] glm::vec3 VR_GetScaledAliasVertexOffsets(entity_t* const anchor, - const int anchorVertex, const glm::vec3& extraOffsets) noexcept; +[[nodiscard]] qvec3 VR_GetScaledAliasVertexOffsets(entity_t* const anchor, + const int anchorVertex, const qvec3& extraOffsets, + const bool horizFlip) noexcept; -[[nodiscard]] glm::vec3 VR_GetScaledAndAngledAliasVertexOffsets( - entity_t* const anchor, const int anchorVertex, - const glm::vec3& extraOffsets, const glm::vec3& rotation) noexcept; +[[nodiscard]] qvec3 VR_GetScaledAndAngledAliasVertexOffsets( + entity_t* const anchor, const int anchorVertex, const qvec3& extraOffsets, + const qvec3& rotation, const bool horizFlip) noexcept; -[[nodiscard]] glm::vec3 VR_GetScaledAndAngledAliasVertexPosition( - entity_t* const anchor, const int anchorVertex, - const glm::vec3& extraOffsets, const glm::vec3& rotation) noexcept; +[[nodiscard]] qvec3 VR_GetScaledAndAngledAliasVertexPosition( + entity_t* const anchor, const int anchorVertex, const qvec3& extraOffsets, + const qvec3& rotation, const bool horizFlip) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HFinalPosition(entity_t* const anchor, - const int cvarEntry, const bool horizflip, const glm::vec3& extraOffset, - const glm::vec3& handRot) noexcept; +[[nodiscard]] qvec3 VR_GetWpnFixed2HFinalPosition(entity_t* const anchor, + const int cvarEntry, const bool horizflip, const qvec3& extraOffset, + const qvec3& handRot) noexcept; // TODO VR: (P2) remove? [[nodiscard]] int VR_GetWpnCVarFromModel(qmodel_t* model); @@ -313,14 +343,20 @@ void VR_ModAllWeapons(); [[nodiscard]] bool VR_EnabledAndNotFake() noexcept; -void VR_ApplyModelMod(const glm::vec3& scale, const glm::vec3& offsets, - aliashdr_t* const hdr) noexcept; +void VR_ApplyModelMod( + const qvec3& scale, const qvec3& offsets, aliashdr_t* const hdr) noexcept; [[nodiscard]] float VR_GetEasyHandTouchBonus() noexcept; [[nodiscard]] int VR_OtherHand(const int hand) noexcept; [[nodiscard]] bool VR_IsActive2HHelpingHand(const int hand) noexcept; +[[nodiscard]] bool VR_IsHandGrabbing(const int hand) noexcept; + +[[nodiscard]] entity_t* VR_GetAnchorEntity(const HandIdx handIdx) noexcept; + +[[nodiscard]] bool VR_GetHorizFlip(const HandIdx handIdx) noexcept; + // // // @@ -358,6 +394,15 @@ enum class Wpn2HDisplayMode : std::uint8_t Fixed = 1, }; +enum class WpnButtonMode : int +{ + // The weapon does not have a button. + None = 0, + + // The weapon has a button to change ammunition type. + ChangeAmmo = 1, +}; + enum class WpnCVar : std::uint8_t { OffsetX = 0, @@ -384,9 +429,9 @@ enum class WpnCVar : std::uint8_t HandOffsetY = 21, HandOffsetZ = 22, HandAnchorVertex = 23, - OffHandOffsetX = 24, - OffHandOffsetY = 25, - OffHandOffsetZ = 26, + // OffHandOffsetX = 24, // TODO VR: (P2) deprecated, free index + // OffHandOffsetY = 25, // TODO VR: (P2) deprecated, free index + // OffHandOffsetZ = 26, // TODO VR: (P2) deprecated, free index CrosshairMode = 27, HideHand = 28, TwoHDisplayMode = 29, @@ -409,38 +454,55 @@ enum class WpnCVar : std::uint8_t WeightHandThrowVelMult = 46, Weight2HPosMult = 47, Weight2HDirMult = 48, + WpnButtonMode = 49, + WpnButtonX = 50, + WpnButtonY = 51, + WpnButtonZ = 52, + WpnButtonAnchorVertex = 53, + // WpnButtonOffHandX = 54, // TODO VR: (P2) deprecated, free index + // WpnButtonOffHandY = 55, // TODO VR: (P2) deprecated, free index + // WpnButtonOffHandZ = 56, // TODO VR: (P2) deprecated, free index + WpnButtonPitch = 57, + WpnButtonYaw = 58, + WpnButtonRoll = 59, + MuzzleAnchorVertex = 60, + + ZeroBlend = 61, + TwoHZeroBlend = 62, k_Max }; // ---------------------------------------------------------------------------- -[[nodiscard]] glm::vec3 VR_GetWpnOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpn2HOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpnGunOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HHandAngles( - const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpnFixed2HMainHandOffsets( +[[nodiscard]] qvec3 VR_GetWpnOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpn2HOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnFixed2HOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnGunOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnFixed2HHandAngles(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnFixed2HMainHandOffsets( const int cvarEntry) noexcept; // ---------------------------------------------------------------------------- -[[nodiscard]] glm::vec3 VR_GetWpnAngleOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpn2HAngleOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnAngleOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpn2HAngleOffsets(const int cvarEntry) noexcept; // ---------------------------------------------------------------------------- -[[nodiscard]] glm::vec3 VR_GetWpnMuzzleOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnMuzzleOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_CalcWeaponMuzzlePosImpl( - const int index, const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_CalcMainHandWpnMuzzlePos() noexcept; +[[nodiscard]] qvec3 VR_CalcMainHandWpnMuzzlePos() noexcept; // ---------------------------------------------------------------------------- -[[nodiscard]] glm::vec3 VR_GetWpnHandOffsets(const int cvarEntry) noexcept; -[[nodiscard]] glm::vec3 VR_GetWpnOffHandOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnButtonOffsets(const int cvarEntry) noexcept; +[[nodiscard]] qvec3 VR_GetWpnButtonAngles(const int cvarEntry) noexcept; + + +// ---------------------------------------------------------------------------- + +[[nodiscard]] qvec3 VR_GetWpnHandOffsets(const int cvarEntry) noexcept; [[nodiscard]] cvar_t& VR_GetWpnCVar( const int cvarEntry, WpnCVar setting) noexcept; @@ -458,137 +520,77 @@ enum class WpnCVar : std::uint8_t // // // ---------------------------------------------------------------------------- -// CVar Declarations +// Extern Declarations // ---------------------------------------------------------------------------- -extern cvar_t vr_aimmode; -extern cvar_t vr_crosshair_alpha; -extern cvar_t vr_crosshair_depth; -extern cvar_t vr_crosshair_size; -extern cvar_t vr_crosshair; -extern cvar_t vr_crosshairy; -extern cvar_t vr_deadzone; -extern cvar_t vr_enabled; -extern cvar_t vr_floor_offset; -extern cvar_t vr_gun_z_offset; -extern cvar_t vr_gunangle; -extern cvar_t vr_gunmodelpitch; -extern cvar_t vr_gunmodelscale; -extern cvar_t vr_gunmodely; -extern cvar_t vr_gunyaw; -extern cvar_t vr_hud_scale; -extern cvar_t vr_melee_threshold; -extern cvar_t vr_menu_scale; -extern cvar_t vr_movement_mode; -extern cvar_t vr_msaa; -extern cvar_t vr_enable_joystick_turn; -extern cvar_t vr_snap_turn; -extern cvar_t vr_turn_speed; -extern cvar_t vr_viewkick; -extern cvar_t vr_world_scale; -extern cvar_t vr_sbar_mode; -extern cvar_t vr_sbar_offset_x; -extern cvar_t vr_sbar_offset_y; -extern cvar_t vr_sbar_offset_z; -extern cvar_t vr_sbar_offset_pitch; -extern cvar_t vr_sbar_offset_yaw; -extern cvar_t vr_sbar_offset_roll; -extern cvar_t vr_roomscale_jump; -extern cvar_t vr_height_calibration; -extern cvar_t vr_roomscale_jump_threshold; -extern cvar_t vr_menu_distance; -extern cvar_t vr_melee_dmg_multiplier; -extern cvar_t vr_melee_range_multiplier; -extern cvar_t vr_body_interactions; -extern cvar_t vr_roomscale_move_mult; -extern cvar_t vr_teleport_enabled; -extern cvar_t vr_teleport_range; -extern cvar_t vr_2h_mode; -extern cvar_t vr_2h_angle_threshold; -extern cvar_t vr_virtual_stock_thresh; -extern cvar_t vr_show_virtual_stock; -extern cvar_t vr_shoulder_offset_x; -extern cvar_t vr_shoulder_offset_y; -extern cvar_t vr_shoulder_offset_z; -extern cvar_t vr_2h_virtual_stock_factor; -extern cvar_t vr_wpn_pos_weight; -extern cvar_t vr_wpn_pos_weight_offset; -extern cvar_t vr_wpn_pos_weight_mult; -extern cvar_t vr_wpn_pos_weight_2h_help_offset; -extern cvar_t vr_wpn_pos_weight_2h_help_mult; -extern cvar_t vr_wpn_dir_weight; -extern cvar_t vr_wpn_dir_weight_offset; -extern cvar_t vr_wpn_dir_weight_mult; -extern cvar_t vr_wpn_dir_weight_2h_help_offset; -extern cvar_t vr_wpn_dir_weight_2h_help_mult; -extern cvar_t vr_offhandpitch; -extern cvar_t vr_offhandyaw; -extern cvar_t vr_show_hip_holsters; -extern cvar_t vr_hip_offset_x; -extern cvar_t vr_hip_offset_y; -extern cvar_t vr_hip_offset_z; -extern cvar_t vr_hip_holster_thresh; -extern cvar_t vr_show_shoulder_holsters; -extern cvar_t vr_shoulder_holster_offset_x; -extern cvar_t vr_shoulder_holster_offset_y; -extern cvar_t vr_shoulder_holster_offset_z; -extern cvar_t vr_shoulder_holster_thresh; -extern cvar_t vr_show_upper_holsters; -extern cvar_t vr_upper_holster_offset_x; -extern cvar_t vr_upper_holster_offset_y; -extern cvar_t vr_upper_holster_offset_z; -extern cvar_t vr_upper_holster_thresh; -extern cvar_t vr_fakevr; -extern cvar_t vr_vrtorso_debuglines_enabled; -extern cvar_t vr_vrtorso_enabled; -extern cvar_t vr_vrtorso_x_offset; -extern cvar_t vr_vrtorso_y_offset; -extern cvar_t vr_vrtorso_z_offset; -extern cvar_t vr_vrtorso_head_z_mult; -extern cvar_t vr_vrtorso_x_scale; -extern cvar_t vr_vrtorso_y_scale; -extern cvar_t vr_vrtorso_z_scale; -extern cvar_t vr_vrtorso_pitch; -extern cvar_t vr_vrtorso_yaw; -extern cvar_t vr_vrtorso_roll; -extern cvar_t vr_holster_haptics; -extern cvar_t vr_player_shadows; -extern cvar_t vr_positional_damage; -extern cvar_t vr_debug_print_handvel; -extern cvar_t vr_debug_show_hand_pos_and_rot; -extern cvar_t vr_leg_holster_model_enabled; -extern cvar_t vr_leg_holster_model_scale; -extern cvar_t vr_leg_holster_model_x_offset; -extern cvar_t vr_leg_holster_model_y_offset; -extern cvar_t vr_leg_holster_model_z_offset; -extern cvar_t vr_holster_mode; -extern cvar_t vr_weapon_throw_mode; -extern cvar_t vr_weapon_throw_damage_mult; -extern cvar_t vr_weapon_throw_velocity_mult; -extern cvar_t vr_weapon_cycle_mode; -extern cvar_t vr_melee_bloodlust; -extern cvar_t vr_melee_bloodlust_mult; -extern cvar_t vr_enemy_drops; -extern cvar_t vr_enemy_drops_chance_mult; -extern cvar_t vr_ammobox_drops; -extern cvar_t vr_ammobox_drops_chance_mult; -extern cvar_t vr_menumode; -extern cvar_t vr_forcegrab_powermult; -extern cvar_t vr_forcegrab_mode; -extern cvar_t vr_forcegrab_range; -extern cvar_t vr_forcegrab_radius; -extern cvar_t vr_weapondrop_particles; -extern cvar_t vr_forcegrab_eligible_particles; -extern cvar_t vr_forcegrab_eligible_haptics; -extern cvar_t vr_enable_grapple; - // TODO VR: (P2) what to do with this? extern int vr_hardcoded_wpn_cvar_fist; // TODO VR: (P2) encapsulate nicely -extern int vr_impl_draw_wpnoffset_helper_offset; -extern int vr_impl_draw_wpnoffset_helper_muzzle; -extern int vr_impl_draw_wpnoffset_helper_2h_offset; -extern int vr_impl_draw_hand_anchor_vertex; -extern int vr_impl_draw_2h_hand_anchor_vertex; extern float vr_2h_aim_transition[2]; +extern bool vr_teleporting; +extern qvec3 vr_teleporting_impact; +extern bool vr_teleporting_impact_valid; +extern vr::VRSkeletalSummaryData_t vr_ss_lefthand; +extern vr::VRSkeletalSummaryData_t vr_ss_righthand; +extern std::array<std::array<float, 6>, 2> vr_fingertracking_frame; +extern float vr_menu_mouse_x; +extern float vr_menu_mouse_y; +extern bool vr_menu_mouse_click; +extern qvec3 vr_menu_target; +extern qvec3 vr_menu_angles; +extern qvec3 vr_menu_normal; +extern qvec3 vr_menu_intersection_point; + +// TODO VR: (P1) used by show fns +[[nodiscard]] qvec3 VR_Get2HHoldingHandPos( + const int holdingHand, const int helpingHand) noexcept; + +[[nodiscard]] qvec3 VR_Get2HHelpingHandPos( + const int holdingHand, const int helpingHand) noexcept; + +[[nodiscard]] qvec3 VR_GetShoulderStockPos( + const int holdingHand, const int helpingHand) noexcept; + +[[nodiscard]] qvec3 VR_Get2HVirtualStockMix( + const qvec3& viaHand, const qvec3& viaShoulder) noexcept; + +[[nodiscard]] bool VR_InStockDistance(const int holdingHand, + const int helpingHand, const qvec3& shoulderPos) noexcept; + +[[nodiscard]] std::tuple<qvec3, qvec3, qvec3, qvec3, qvec3, qvec3, qvec3, qvec3> +VR_GetBodyYawAngleCalculations() noexcept; + +[[nodiscard]] bool VR_InHipHolsterDistance( + const qvec3& hand, const qvec3& holster); + +[[nodiscard]] bool VR_InShoulderHolsterDistance( + const qvec3& hand, const qvec3& holster); + +[[nodiscard]] bool VR_InUpperHolsterDistance( + const qvec3& hand, const qvec3& holster); + +[[nodiscard]] qvec3 VR_GetLeftShoulderHolsterPos() noexcept; + +[[nodiscard]] qvec3 VR_GetRightShoulderHolsterPos() noexcept; + +[[nodiscard]] WpnCrosshairMode VR_GetWpnCrosshairMode( + const int cvarEntry) noexcept; + +[[nodiscard]] qvec3 VR_CalcFinalWpnMuzzlePos(const int index) noexcept; + +[[nodiscard]] bool svPlayerActive() noexcept; +[[nodiscard]] edict_t* getPlayerEdict() noexcept; + +// +// +// PAK Stuff + +[[nodiscard]] const std::string& VR_GetActiveStartPakName(); +[[nodiscard]] std::vector<std::string>& VR_GetLoadedPakNames(); +[[nodiscard]] std::vector<std::string>& VR_GetLoadedPakNamesWithStartMaps(); + +[[nodiscard]] std::string VR_ExtractPakName(std::string_view sv); +[[nodiscard]] std::string VR_ExtractPakName(const pack_t& pak); + +void VR_OnLoadedPak(pack_t& pak); diff --git a/Quake/vr_cvars.cpp b/Quake/vr_cvars.cpp new file mode 100644 index 00000000..9326230c --- /dev/null +++ b/Quake/vr_cvars.cpp @@ -0,0 +1,324 @@ +#include "vr_cvars.hpp" + +#include <vector> + +// +// +// +// ---------------------------------------------------------------------------- +// CVar definition and registration macros +// ---------------------------------------------------------------------------- + +static std::vector<cvar_t*> cvarsToRegister; + +#define DEFINE_FCVAR(name, defaultValue, type) \ + cvar_t name = {#name, #defaultValue, type}; \ + static struct _cvar_registrar##name##__LINE__##_t \ + { \ + _cvar_registrar##name##__LINE__##_t() \ + { \ + cvarsToRegister.emplace_back(&name); \ + } \ + } _cvar_registrar##name##__LINE__ + +#define DEFINE_FCVAR_ARCHIVE(name, defaultValue) \ + DEFINE_FCVAR(name, defaultValue, CVAR_ARCHIVE); + +// +// +// +// ---------------------------------------------------------------------------- +// Non-archived CVars +// ---------------------------------------------------------------------------- + +DEFINE_FCVAR(vr_enabled, 0, CVAR_NONE); +DEFINE_FCVAR(vr_viewkick, 0, CVAR_NONE); +DEFINE_FCVAR(vr_lefthanded, 0, CVAR_NONE); +DEFINE_FCVAR(vr_fakevr, 0, CVAR_NONE); +DEFINE_FCVAR(vr_novrinit, 0, CVAR_NONE); + +// +// +// +// ---------------------------------------------------------------------------- +// Archived CVars +// ---------------------------------------------------------------------------- + +DEFINE_FCVAR_ARCHIVE(vr_crosshair, 1); +DEFINE_FCVAR_ARCHIVE(vr_crosshair_depth, 0); +DEFINE_FCVAR_ARCHIVE(vr_crosshair_size, 3.0); +DEFINE_FCVAR_ARCHIVE(vr_crosshair_alpha, 0.25); +DEFINE_FCVAR_ARCHIVE(vr_aimmode, 7); +DEFINE_FCVAR_ARCHIVE(vr_deadzone, 30); +DEFINE_FCVAR_ARCHIVE(vr_gunangle, 32); +DEFINE_FCVAR_ARCHIVE(vr_gunmodelpitch, 0); +DEFINE_FCVAR_ARCHIVE(vr_gunmodelscale, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_gunmodely, 0); +DEFINE_FCVAR_ARCHIVE(vr_crosshairy, 0); +DEFINE_FCVAR_ARCHIVE(vr_world_scale, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_floor_offset, -16); +DEFINE_FCVAR_ARCHIVE(vr_snap_turn, 0); +DEFINE_FCVAR_ARCHIVE(vr_enable_joystick_turn, 1); +DEFINE_FCVAR_ARCHIVE(vr_turn_speed, 1); +DEFINE_FCVAR_ARCHIVE(vr_msaa, 4); +DEFINE_FCVAR_ARCHIVE(vr_movement_mode, 0); +DEFINE_FCVAR_ARCHIVE(vr_hud_scale, 0.025); +DEFINE_FCVAR_ARCHIVE(vr_menu_scale, 0.13); +DEFINE_FCVAR_ARCHIVE(vr_melee_threshold, 7); +DEFINE_FCVAR_ARCHIVE(vr_gunyaw, 0); +DEFINE_FCVAR_ARCHIVE(vr_gun_z_offset, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_mode, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_offset_x, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_offset_y, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_offset_z, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_offset_pitch, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_offset_yaw, 0); +DEFINE_FCVAR_ARCHIVE(vr_sbar_offset_roll, 0); +DEFINE_FCVAR_ARCHIVE(vr_roomscale_jump, 1); +DEFINE_FCVAR_ARCHIVE(vr_height_calibration, 1.6); +DEFINE_FCVAR_ARCHIVE(vr_roomscale_jump_threshold, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_menu_distance, 76); +DEFINE_FCVAR_ARCHIVE(vr_melee_dmg_multiplier, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_melee_range_multiplier, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_body_interactions, 0); +DEFINE_FCVAR_ARCHIVE(vr_roomscale_move_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_teleport_enabled, 1); +DEFINE_FCVAR_ARCHIVE(vr_teleport_range, 400); +DEFINE_FCVAR_ARCHIVE(vr_2h_mode, 2); +DEFINE_FCVAR_ARCHIVE(vr_2h_angle_threshold, 0.65); +DEFINE_FCVAR_ARCHIVE(vr_virtual_stock_thresh, 10); +DEFINE_FCVAR_ARCHIVE(vr_show_virtual_stock, 0); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_offset_x, -1.5); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_offset_y, 1.75); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_offset_z, 16.0); +DEFINE_FCVAR_ARCHIVE(vr_2h_virtual_stock_factor, 0.5); +DEFINE_FCVAR_ARCHIVE(vr_wpn_pos_weight, 1); +DEFINE_FCVAR_ARCHIVE(vr_wpn_pos_weight_offset, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_wpn_pos_weight_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_wpn_pos_weight_2h_help_offset, 0.3); +DEFINE_FCVAR_ARCHIVE(vr_wpn_pos_weight_2h_help_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_wpn_dir_weight, 1); +DEFINE_FCVAR_ARCHIVE(vr_wpn_dir_weight_offset, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_wpn_dir_weight_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_wpn_dir_weight_2h_help_offset, 0.3); +DEFINE_FCVAR_ARCHIVE(vr_wpn_dir_weight_2h_help_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_offhandpitch, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_offhandyaw, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_show_hip_holsters, 0); +DEFINE_FCVAR_ARCHIVE(vr_hip_offset_x, -1.0); +DEFINE_FCVAR_ARCHIVE(vr_hip_offset_y, 7.0); +DEFINE_FCVAR_ARCHIVE(vr_hip_offset_z, 4.5); +DEFINE_FCVAR_ARCHIVE(vr_hip_holster_thresh, 6.0); +DEFINE_FCVAR_ARCHIVE(vr_show_shoulder_holsters, 0); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_holster_offset_x, 5.0); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_holster_offset_y, 1.5); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_holster_offset_z, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_shoulder_holster_thresh, 8.0); +DEFINE_FCVAR_ARCHIVE(vr_show_upper_holsters, 0); +DEFINE_FCVAR_ARCHIVE(vr_upper_holster_offset_x, 2.5); +DEFINE_FCVAR_ARCHIVE(vr_upper_holster_offset_y, 6.5); +DEFINE_FCVAR_ARCHIVE(vr_upper_holster_offset_z, 2.5); +DEFINE_FCVAR_ARCHIVE(vr_upper_holster_thresh, 6.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_debuglines_enabled, 0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_enabled, 1); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_x_offset, -3.25); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_y_offset, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_z_offset, -21.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_head_z_mult, 32.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_x_scale, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_y_scale, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_z_scale, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_pitch, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_yaw, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_vrtorso_roll, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_holster_haptics, 1); +DEFINE_FCVAR_ARCHIVE(vr_player_shadows, 2); +DEFINE_FCVAR_ARCHIVE(vr_positional_damage, 1); +DEFINE_FCVAR_ARCHIVE(vr_debug_print_handvel, 0); +DEFINE_FCVAR_ARCHIVE(vr_debug_print_headvel, 0); +DEFINE_FCVAR_ARCHIVE(vr_debug_show_hand_pos_and_rot, 0); +DEFINE_FCVAR_ARCHIVE(vr_leg_holster_model_enabled, 1); +DEFINE_FCVAR_ARCHIVE(vr_leg_holster_model_scale, 1); +DEFINE_FCVAR_ARCHIVE(vr_leg_holster_model_x_offset, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_leg_holster_model_y_offset, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_leg_holster_model_z_offset, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_holster_mode, 0); +DEFINE_FCVAR_ARCHIVE(vr_weapon_throw_mode, 0); +DEFINE_FCVAR_ARCHIVE(vr_weapon_throw_damage_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_weapon_throw_velocity_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_weapon_cycle_mode, 0); +DEFINE_FCVAR_ARCHIVE(vr_melee_bloodlust, 0); +DEFINE_FCVAR_ARCHIVE(vr_melee_bloodlust_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_enemy_drops, 0); +DEFINE_FCVAR_ARCHIVE(vr_enemy_drops_chance_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_ammobox_drops, 0); +DEFINE_FCVAR_ARCHIVE(vr_ammobox_drops_chance_mult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_menumode, 0); +DEFINE_FCVAR_ARCHIVE(vr_forcegrab_powermult, 1.0); +DEFINE_FCVAR_ARCHIVE(vr_forcegrab_mode, 1); +DEFINE_FCVAR_ARCHIVE(vr_forcegrab_range, 150.0); +DEFINE_FCVAR_ARCHIVE(vr_forcegrab_radius, 18.0); +DEFINE_FCVAR_ARCHIVE(vr_forcegrab_eligible_particles, 1); +DEFINE_FCVAR_ARCHIVE(vr_forcegrab_eligible_haptics, 1); +DEFINE_FCVAR_ARCHIVE(vr_weapondrop_particles, 1); +DEFINE_FCVAR_ARCHIVE(vr_2h_spread_reduction, 0.5); // TODO VR: (P2) add to menu +DEFINE_FCVAR_ARCHIVE( + vr_2h_throw_velocity_mult, 1.4); // TODO VR: (P2) add to menu +DEFINE_FCVAR_ARCHIVE( + vr_headbutt_velocity_threshold, 2.02); // TODO VR: (P2) add to menu +DEFINE_FCVAR_ARCHIVE(vr_headbutt_damage_mult, 32); // TODO VR: (P2) add to menu +DEFINE_FCVAR_ARCHIVE(vr_activestartpaknameidx, 0); +DEFINE_FCVAR_ARCHIVE(vr_verbosebots, 0); +DEFINE_FCVAR_ARCHIVE(vr_finger_grip_bias, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_2h_disable_angle_threshold, 0); +DEFINE_FCVAR_ARCHIVE(vr_autosave_seconds, 240); +DEFINE_FCVAR_ARCHIVE(vr_autosave_on_changelevel, 1); +DEFINE_FCVAR_ARCHIVE(vr_throw_up_center_of_mass, 0.1); +DEFINE_FCVAR_ARCHIVE(vr_forcegrabbable_ammo_boxes, 1); +DEFINE_FCVAR_ARCHIVE(vr_forcegrabbable_health_boxes, 1); +DEFINE_FCVAR_ARCHIVE(vr_forcegrabbable_return_time_deathmatch, 4); +DEFINE_FCVAR_ARCHIVE(vr_forcegrabbable_return_time_singleplayer, 0); +DEFINE_FCVAR_ARCHIVE(vr_finger_auto_close_thumb, 1); +DEFINE_FCVAR_ARCHIVE(vr_autosave_show_message, 0); +DEFINE_FCVAR_ARCHIVE(vr_finger_blending, 1); +DEFINE_FCVAR_ARCHIVE(vr_finger_blending_speed, 50); +DEFINE_FCVAR_ARCHIVE(vr_menu_mouse_pointer_hand, 1); + +// +// +// +// ---------------------------------------------------------------------------- +// Finger tracking offsets +// ---------------------------------------------------------------------------- + +// All fingers and base +DEFINE_FCVAR_ARCHIVE(vr_fingers_and_base_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_fingers_and_base_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_fingers_and_base_z, 0.0); + +// All fingers and base (off-hand only) +DEFINE_FCVAR_ARCHIVE(vr_fingers_and_base_offhand_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_fingers_and_base_offhand_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_fingers_and_base_offhand_z, 0.0); + +// All fingers +DEFINE_FCVAR_ARCHIVE(vr_fingers_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_fingers_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_fingers_z, 0.0); + +// Thumb +DEFINE_FCVAR_ARCHIVE(vr_finger_thumb_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_thumb_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_thumb_z, 0.0); + +// Index +DEFINE_FCVAR_ARCHIVE(vr_finger_index_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_index_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_index_z, 0.0); + +// Middle +DEFINE_FCVAR_ARCHIVE(vr_finger_middle_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_middle_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_middle_z, 0.0); + +// Ring +DEFINE_FCVAR_ARCHIVE(vr_finger_ring_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_ring_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_ring_z, 0.0); + +// Pinky +DEFINE_FCVAR_ARCHIVE(vr_finger_pinky_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_pinky_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_pinky_z, 0.0); + +// Base +DEFINE_FCVAR_ARCHIVE(vr_finger_base_x, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_base_y, 0.0); +DEFINE_FCVAR_ARCHIVE(vr_finger_base_z, 0.0); + +#undef DEFINE_FCVAR_ARCHIVE +#undef DEFINE_FCVAR + +// +// +// +// ---------------------------------------------------------------------------- +// Registration +// ---------------------------------------------------------------------------- + +namespace quake::vr +{ +void register_all_cvars() noexcept +{ + for(cvar_t* c : cvarsToRegister) + { + Cvar_RegisterVariable(c); + } + + cvarsToRegister.clear(); + cvarsToRegister.shrink_to_fit(); +} +} // namespace quake::vr + +// +// +// +// ---------------------------------------------------------------------------- +// Getters +// ---------------------------------------------------------------------------- + +#define QVR_CVAR_VEC3_XYZ(cvar_family_prefix) \ + { \ + cvar_family_prefix##_x.value, cvar_family_prefix##_y.value, \ + cvar_family_prefix##_z.value \ + } + +namespace quake::vr +{ +[[nodiscard]] qvec3 get_fingers_and_base_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_fingers_and_base); +} + +[[nodiscard]] qvec3 get_fingers_and_base_offhand_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_fingers_and_base_offhand); +} + +[[nodiscard]] qvec3 get_fingers_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_fingers); +} + +[[nodiscard]] qvec3 get_finger_thumb_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_finger_thumb); +} + +[[nodiscard]] qvec3 get_finger_index_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_finger_index); +} + +[[nodiscard]] qvec3 get_finger_middle_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_finger_middle); +} + +[[nodiscard]] qvec3 get_finger_ring_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_finger_ring); +} + +[[nodiscard]] qvec3 get_finger_pinky_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_finger_pinky); +} + +[[nodiscard]] qvec3 get_finger_base_xyz() noexcept +{ + return QVR_CVAR_VEC3_XYZ(vr_finger_base); +} +} // namespace quake::vr + +#undef QVR_CVAR_VEC3_XYZ diff --git a/Quake/vr_cvars.hpp b/Quake/vr_cvars.hpp new file mode 100644 index 00000000..5fbcdafa --- /dev/null +++ b/Quake/vr_cvars.hpp @@ -0,0 +1,238 @@ +#pragma once + +#include "cvar.hpp" +#include "quakeglm_qvec3.hpp" + +// +// +// +// ---------------------------------------------------------------------------- +// CVar Declarations +// ---------------------------------------------------------------------------- + +extern cvar_t vr_aimmode; +extern cvar_t vr_crosshair_alpha; +extern cvar_t vr_crosshair_depth; +extern cvar_t vr_crosshair_size; +extern cvar_t vr_crosshair; +extern cvar_t vr_crosshairy; +extern cvar_t vr_deadzone; +extern cvar_t vr_enabled; +extern cvar_t vr_lefthanded; +extern cvar_t vr_floor_offset; +extern cvar_t vr_gun_z_offset; +extern cvar_t vr_gunangle; +extern cvar_t vr_gunmodelpitch; +extern cvar_t vr_gunmodelscale; +extern cvar_t vr_gunmodely; +extern cvar_t vr_gunyaw; +extern cvar_t vr_hud_scale; +extern cvar_t vr_melee_threshold; +extern cvar_t vr_menu_scale; +extern cvar_t vr_movement_mode; +extern cvar_t vr_msaa; +extern cvar_t vr_enable_joystick_turn; +extern cvar_t vr_snap_turn; +extern cvar_t vr_turn_speed; +extern cvar_t vr_viewkick; +extern cvar_t vr_world_scale; +extern cvar_t vr_sbar_mode; +extern cvar_t vr_sbar_offset_x; +extern cvar_t vr_sbar_offset_y; +extern cvar_t vr_sbar_offset_z; +extern cvar_t vr_sbar_offset_pitch; +extern cvar_t vr_sbar_offset_yaw; +extern cvar_t vr_sbar_offset_roll; +extern cvar_t vr_roomscale_jump; +extern cvar_t vr_height_calibration; +extern cvar_t vr_roomscale_jump_threshold; +extern cvar_t vr_menu_distance; +extern cvar_t vr_melee_dmg_multiplier; +extern cvar_t vr_melee_range_multiplier; +extern cvar_t vr_body_interactions; +extern cvar_t vr_roomscale_move_mult; +extern cvar_t vr_teleport_enabled; +extern cvar_t vr_teleport_range; +extern cvar_t vr_2h_mode; +extern cvar_t vr_2h_angle_threshold; +extern cvar_t vr_virtual_stock_thresh; +extern cvar_t vr_show_virtual_stock; +extern cvar_t vr_shoulder_offset_x; +extern cvar_t vr_shoulder_offset_y; +extern cvar_t vr_shoulder_offset_z; +extern cvar_t vr_2h_virtual_stock_factor; +extern cvar_t vr_wpn_pos_weight; +extern cvar_t vr_wpn_pos_weight_offset; +extern cvar_t vr_wpn_pos_weight_mult; +extern cvar_t vr_wpn_pos_weight_2h_help_offset; +extern cvar_t vr_wpn_pos_weight_2h_help_mult; +extern cvar_t vr_wpn_dir_weight; +extern cvar_t vr_wpn_dir_weight_offset; +extern cvar_t vr_wpn_dir_weight_mult; +extern cvar_t vr_wpn_dir_weight_2h_help_offset; +extern cvar_t vr_wpn_dir_weight_2h_help_mult; +extern cvar_t vr_offhandpitch; +extern cvar_t vr_offhandyaw; +extern cvar_t vr_show_hip_holsters; +extern cvar_t vr_hip_offset_x; +extern cvar_t vr_hip_offset_y; +extern cvar_t vr_hip_offset_z; +extern cvar_t vr_hip_holster_thresh; +extern cvar_t vr_show_shoulder_holsters; +extern cvar_t vr_shoulder_holster_offset_x; +extern cvar_t vr_shoulder_holster_offset_y; +extern cvar_t vr_shoulder_holster_offset_z; +extern cvar_t vr_shoulder_holster_thresh; +extern cvar_t vr_show_upper_holsters; +extern cvar_t vr_upper_holster_offset_x; +extern cvar_t vr_upper_holster_offset_y; +extern cvar_t vr_upper_holster_offset_z; +extern cvar_t vr_upper_holster_thresh; +extern cvar_t vr_fakevr; +extern cvar_t vr_novrinit; +extern cvar_t vr_vrtorso_debuglines_enabled; +extern cvar_t vr_vrtorso_enabled; +extern cvar_t vr_vrtorso_x_offset; +extern cvar_t vr_vrtorso_y_offset; +extern cvar_t vr_vrtorso_z_offset; +extern cvar_t vr_vrtorso_head_z_mult; +extern cvar_t vr_vrtorso_x_scale; +extern cvar_t vr_vrtorso_y_scale; +extern cvar_t vr_vrtorso_z_scale; +extern cvar_t vr_vrtorso_pitch; +extern cvar_t vr_vrtorso_yaw; +extern cvar_t vr_vrtorso_roll; +extern cvar_t vr_holster_haptics; +extern cvar_t vr_player_shadows; +extern cvar_t vr_positional_damage; +extern cvar_t vr_debug_print_handvel; +extern cvar_t vr_debug_print_headvel; +extern cvar_t vr_debug_show_hand_pos_and_rot; +extern cvar_t vr_leg_holster_model_enabled; +extern cvar_t vr_leg_holster_model_scale; +extern cvar_t vr_leg_holster_model_x_offset; +extern cvar_t vr_leg_holster_model_y_offset; +extern cvar_t vr_leg_holster_model_z_offset; +extern cvar_t vr_holster_mode; +extern cvar_t vr_weapon_throw_mode; +extern cvar_t vr_weapon_throw_damage_mult; +extern cvar_t vr_weapon_throw_velocity_mult; +extern cvar_t vr_weapon_cycle_mode; +extern cvar_t vr_melee_bloodlust; +extern cvar_t vr_melee_bloodlust_mult; +extern cvar_t vr_enemy_drops; +extern cvar_t vr_enemy_drops_chance_mult; +extern cvar_t vr_ammobox_drops; +extern cvar_t vr_ammobox_drops_chance_mult; +extern cvar_t vr_menumode; +extern cvar_t vr_forcegrab_powermult; +extern cvar_t vr_forcegrab_mode; +extern cvar_t vr_forcegrab_range; +extern cvar_t vr_forcegrab_radius; +extern cvar_t vr_weapondrop_particles; +extern cvar_t vr_forcegrab_eligible_particles; +extern cvar_t vr_forcegrab_eligible_haptics; +extern cvar_t vr_2h_spread_reduction; +extern cvar_t vr_2h_throw_velocity_mult; +extern cvar_t vr_headbutt_velocity_threshold; +extern cvar_t vr_headbutt_damage_mult; +extern cvar_t vr_activestartpaknameidx; +extern cvar_t vr_verbosebots; +extern cvar_t vr_finger_grip_bias; +extern cvar_t vr_2h_disable_angle_threshold; +extern cvar_t vr_autosave_seconds; +extern cvar_t vr_autosave_on_changelevel; +extern cvar_t vr_throw_up_center_of_mass; +extern cvar_t vr_forcegrabbable_ammo_boxes; +extern cvar_t vr_forcegrabbable_health_boxes; +extern cvar_t vr_forcegrabbable_return_time_deathmatch; +extern cvar_t vr_forcegrabbable_return_time_singleplayer; +extern cvar_t vr_finger_auto_close_thumb; +extern cvar_t vr_autosave_show_message; +extern cvar_t vr_finger_blending; +extern cvar_t vr_finger_blending_speed; +extern cvar_t vr_menu_mouse_pointer_hand; + +// +// +// +// ---------------------------------------------------------------------------- +// Finger tracking offsets +// ---------------------------------------------------------------------------- + +// All fingers and base +extern cvar_t vr_fingers_and_base_x; +extern cvar_t vr_fingers_and_base_y; +extern cvar_t vr_fingers_and_base_z; + +// All fingers and base (off-hand only) +extern cvar_t vr_fingers_and_base_offhand_x; +extern cvar_t vr_fingers_and_base_offhand_y; +extern cvar_t vr_fingers_and_base_offhand_z; + +// All fingers +extern cvar_t vr_fingers_x; +extern cvar_t vr_fingers_y; +extern cvar_t vr_fingers_z; + +// Thumb +extern cvar_t vr_finger_thumb_x; +extern cvar_t vr_finger_thumb_y; +extern cvar_t vr_finger_thumb_z; + +// Index +extern cvar_t vr_finger_index_x; +extern cvar_t vr_finger_index_y; +extern cvar_t vr_finger_index_z; + +// Middle +extern cvar_t vr_finger_middle_x; +extern cvar_t vr_finger_middle_y; +extern cvar_t vr_finger_middle_z; + +// Ring +extern cvar_t vr_finger_ring_x; +extern cvar_t vr_finger_ring_y; +extern cvar_t vr_finger_ring_z; + +// Pinky +extern cvar_t vr_finger_pinky_x; +extern cvar_t vr_finger_pinky_y; +extern cvar_t vr_finger_pinky_z; + +// Base +extern cvar_t vr_finger_base_x; +extern cvar_t vr_finger_base_y; +extern cvar_t vr_finger_base_z; + +// +// +// +// ---------------------------------------------------------------------------- +// Registration +// ---------------------------------------------------------------------------- + +namespace quake::vr +{ +void register_all_cvars() noexcept; +} + +// +// +// +// ---------------------------------------------------------------------------- +// Getters +// ---------------------------------------------------------------------------- + +namespace quake::vr +{ +[[nodiscard]] qvec3 get_fingers_and_base_xyz() noexcept; +[[nodiscard]] qvec3 get_fingers_and_base_offhand_xyz() noexcept; +[[nodiscard]] qvec3 get_fingers_xyz() noexcept; +[[nodiscard]] qvec3 get_finger_thumb_xyz() noexcept; +[[nodiscard]] qvec3 get_finger_index_xyz() noexcept; +[[nodiscard]] qvec3 get_finger_middle_xyz() noexcept; +[[nodiscard]] qvec3 get_finger_ring_xyz() noexcept; +[[nodiscard]] qvec3 get_finger_pinky_xyz() noexcept; +[[nodiscard]] qvec3 get_finger_base_xyz() noexcept; +} // namespace quake::vr diff --git a/Quake/vr_macros.hpp b/Quake/vr_macros.hpp new file mode 100644 index 00000000..fb23844b --- /dev/null +++ b/Quake/vr_macros.hpp @@ -0,0 +1,3 @@ +#pragma once + +#define VRUTIL_POWER_OF_TWO(xExponent) (1 << xExponent) diff --git a/Quake/vr_showfn.cpp b/Quake/vr_showfn.cpp new file mode 100644 index 00000000..72827bcf --- /dev/null +++ b/Quake/vr_showfn.cpp @@ -0,0 +1,822 @@ +#include "quakedef.hpp" +#include "vr.hpp" +#include "vr_cvars.hpp" +#include "vr_showfn.hpp" +#include "util.hpp" +#include "quakeglm.hpp" +#include "glquake.hpp" +#include "client.hpp" +#include "world.hpp" +#include "gl_util.hpp" + +#include <algorithm> +#include <cassert> +#include <tuple> +#include <utility> + +using namespace quake::vr::gl_util; + +namespace quake::vr::showfn +{ + +namespace +{ + +// +// +// +// ---------------------------------------------------------------------------- +// Implementation utilities +// ---------------------------------------------------------------------------- + +[[nodiscard]] std::pair<bool, bool> get_hands_to_draw( + const int cvarValue) noexcept +{ + assert(cvarValue >= 0 && cvarValue <= 3); + const auto selection = static_cast<VrOptionHandSelection>(cvarValue); + + const bool opt_main_hand = selection == VrOptionHandSelection::MainHand; + const bool opt_off_hand = selection == VrOptionHandSelection::OffHand; + const bool opt_both_hands = selection == VrOptionHandSelection::BothHands; + + const bool draw_main_hand = opt_main_hand || opt_both_hands; + const bool draw_off_hand = opt_off_hand || opt_both_hands; + + return {draw_main_hand, draw_off_hand}; +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Virtual Stock +// ---------------------------------------------------------------------------- + +void show_virtual_stock_impl( + const HandIdx holding_hand, const HandIdx helping_hand) +{ + const qvec3 holding_hand_pos = + VR_Get2HHoldingHandPos(holding_hand, helping_hand); + + const qvec3 helping_hand_pos = + VR_Get2HHelpingHandPos(holding_hand, helping_hand); + + const qvec3 shoulder_pos = + VR_GetShoulderStockPos(holding_hand, helping_hand); + + const qvec3 average_pos = + VR_Get2HVirtualStockMix(holding_hand_pos, shoulder_pos); + + glColor4f(0, 1, 0, 0.75); + gl_vertex(holding_hand_pos); + gl_vertex(helping_hand_pos); + + glColor4f(0, 1, 0, 0.75); + gl_vertex(shoulder_pos); + gl_vertex(helping_hand_pos); + + if(VR_InStockDistance(holding_hand, helping_hand, shoulder_pos)) + { + glColor4f(1, 1, 0, 0.75); + } + else + { + glColor4f(0, 1, 1, 0.75); + } + + glLineWidth(4.f * glwidth / vid.width); + gl_vertex(average_pos); + gl_vertex(helping_hand_pos); +} + +void show_virtual_stock() +{ + if(vr_show_virtual_stock.value == 0) + { + return; + } + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto [draw_main_hand, draw_off_hand] = + get_hands_to_draw(vr_show_virtual_stock.value); + + if(draw_main_hand) + { + show_virtual_stock_impl(cVR_MainHand, cVR_OffHand); + } + + if(draw_off_hand) + { + show_virtual_stock_impl(cVR_OffHand, cVR_MainHand); + } + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show VR Torso +// ---------------------------------------------------------------------------- + +void show_vr_torso_debug_lines() +{ + if(vr_vrtorso_debuglines_enabled.value == 0) + { + return; + } + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto len = 20._qf; + + const auto [adj_player_origin, adj_player_originLeft, + adj_player_originRight, head_fwd_dir, head_right_dir, head_up_dir, + mix_hand_dir, mix_final_dir] = VR_GetBodyYawAngleCalculations(); + + glColor4f(0, 1, 0, 0.75); + gl_vertex(adj_player_originLeft); + gl_vertex(cl.handpos[0]); + + glColor4f(0, 1, 0, 0.75); + gl_vertex(adj_player_originRight); + gl_vertex(cl.handpos[1]); + + glColor4f(0, 1, 0, 0.75); + gl_vertex(adj_player_origin); + gl_vertex(adj_player_origin + head_fwd_dir * len); + + glColor4f(0, 0, 1, 0.75); + gl_vertex(adj_player_origin); + gl_vertex(adj_player_origin + mix_hand_dir * len); + + glColor4f(1, 0, 0, 0.75); + gl_vertex(adj_player_origin); + gl_vertex(adj_player_origin + mix_final_dir * len * 1.25_qf); + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Holsters Impl +// ---------------------------------------------------------------------------- + +template <typename FLeftPos, typename FRightPos> +void show_holster_impl( + const int cvarValue, FLeftPos&& f_left_pos, FRightPos&& f_right_pos) +{ + if(cvarValue == 0) + { + return; + } + + const auto& off_hand_pos = cl.handpos[cVR_OffHand]; + const auto& main_hand_pos = cl.handpos[cVR_MainHand]; + + const auto left_holster_pos = f_left_pos(); + const auto right_holster_pos = f_right_pos(); + + const auto do_color = [&](const qvec3& hand, const qvec3& holster) { + if(VR_InHipHolsterDistance(hand, holster)) + { + glColor4f(1, 1, 0, 0.95); + return; + } + + glColor4f(0, 1, hand == main_hand_pos ? 1 : 0, 0.75); + }; + + const auto do_line = [&](const qvec3& hand, const qvec3& holster) { + do_color(hand, holster); + gl_vertex(hand); + gl_vertex(holster); + }; + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto [draw_main_hand, draw_off_hand] = + get_hands_to_draw(cvarValue); + + if(draw_main_hand) + { + do_line(main_hand_pos, left_holster_pos); + do_line(main_hand_pos, right_holster_pos); + } + + if(draw_off_hand) + { + do_line(off_hand_pos, left_holster_pos); + do_line(off_hand_pos, right_holster_pos); + } + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Hip Holsters +// ---------------------------------------------------------------------------- + +void show_hip_holsters() +{ + show_holster_impl( + vr_show_hip_holsters.value, VR_GetLeftHipPos, VR_GetRightHipPos); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Shoulder Holsters +// ---------------------------------------------------------------------------- + +void show_shoulder_holsters() +{ + show_holster_impl(vr_show_shoulder_holsters.value, + VR_GetLeftShoulderHolsterPos, VR_GetRightShoulderHolsterPos); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Upper Holsters +// ---------------------------------------------------------------------------- + +void show_upper_holsters() +{ + show_holster_impl( + vr_show_upper_holsters.value, VR_GetLeftUpperPos, VR_GetRightUpperPos); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Crosshair +// ---------------------------------------------------------------------------- + +void show_crosshair_impl_point( + const float size, const float alpha, const qvec3& start, const qvec3& fwd) +{ + qvec3 end, impact; + + if(vr_crosshair_depth.value <= 0) + { + // trace to first wall + end = start + 4096._qf * fwd; + end[2] += vr_crosshairy.value; + + // TODO VR: (P1) trace in clientside + impact = TraceLine(start, end).endpos; + } + else + { + // fix crosshair to specific depth + impact = start + qfloat(vr_crosshair_depth.value) * fwd; + } + + glEnable(GL_POINT_SMOOTH); + glColor4f(1, 0, 0, alpha); + glPointSize(size * glwidth / vid.width); + + glBegin(GL_POINTS); + { + gl_vertex(impact); + } + glEnd(); + + glDisable(GL_POINT_SMOOTH); +} + +void show_crosshair_impl_line( + const float size, const float alpha, const qvec3& start, const qvec3& fwd) +{ + const qfloat depth = + vr_crosshair_depth.value <= 0 ? 4096 : vr_crosshair_depth.value; + + // trace to first entity + const auto end = start + depth * fwd; + + // TODO VR: (P1) trace in clientside + const trace_t trace = TraceLineToEntity(start, end, getPlayerEdict()); + + auto impact = quake::util::hitSomething(trace) ? trace.endpos : end; + impact[2] += vr_crosshairy.value * 10.f; + + glLineWidth(size * glwidth / vid.width); + + glEnable(GL_LINE_SMOOTH); + glShadeModel(GL_SMOOTH); + + glBegin(GL_LINE_STRIP); + { + if((int)vr_crosshair.value == VrCrosshair::e_LINE) + { + glColor4f(1, 0, 0, alpha); + gl_vertex(start); + gl_vertex(impact); + } + else + { + const auto midA = glm::mix(start, impact, 0.15); + const auto midB = glm::mix(start, impact, 0.70); + + glColor4f(1, 0, 0, alpha * 0.01f); + gl_vertex(start); + + glColor4f(1, 0, 0, alpha); + gl_vertex(midA); + gl_vertex(midB); + + glColor4f(1, 0, 0, alpha * 0.01f); + gl_vertex(impact); + } + } + glEnd(); + + glShadeModel(GL_FLAT); + glDisable(GL_LINE_SMOOTH); +} + +void show_crosshair_impl( + const float size, const float alpha, const qvec3& start, const qvec3& fwd) +{ + switch((int)vr_crosshair.value) + { + default: [[fallthrough]]; + case VrCrosshair::e_POINT: + { + show_crosshair_impl_point(size, alpha, start, fwd); + break; + } + + case VrCrosshair::e_LINE: [[fallthrough]]; + case VrCrosshair::e_LINE_SMOOTH: + { + show_crosshair_impl_line(size, alpha, start, fwd); + break; + } + } +} + +void show_crosshair_hand_impl( + const HandIdx hand_idx, const float size, const float alpha) +{ + if(VR_GetWpnCrosshairMode(VR_GetWpnCvarEntry(hand_idx)) == + WpnCrosshairMode::Forbidden) + { + return; + } + + const auto start = VR_CalcFinalWpnMuzzlePos(hand_idx); + const auto [fwd, right, up] = + quake::util::getAngledVectors(cl.handrot[hand_idx]); + + show_crosshair_impl(size, alpha, start, fwd); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Teleport Line +// ---------------------------------------------------------------------------- + +void show_teleport_line() +{ + if(!vr_teleport_enabled.value || !vr_teleporting || + vr_aimmode.value != VrAimMode::e_CONTROLLER) + { + return; + } + + constexpr float size = 2.f; + constexpr float alpha = 0.5f; + + if(size <= 0 || alpha <= 0) + { + return; + } + + // calc angles + const auto start = cl.handpos[cVR_OffHand]; + + // calc line + const auto impact = vr_teleporting_impact; + + const auto midA = glm::mix(start, impact, 0.15); + const auto midB = glm::mix(start, impact, 0.85); + + // draw line + const auto set_color = [&](const float xAlpha) { + if(vr_teleporting_impact_valid) + { + glColor4f(0, 0, 1, xAlpha); + } + else + { + glColor4f(1, 0, 0, xAlpha); + } + }; + + gl_showfn_guard guard; + guard.draw_line_strip(size, [&] { + set_color(alpha * 0.01f); + gl_vertex(start); + + set_color(alpha); + gl_vertex(midA); + gl_vertex(midB); + + set_color(alpha * 0.01f); + gl_vertex(impact); + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Weapon Helper: Offset +// ---------------------------------------------------------------------------- + +void show_wpn_offset_helper_offset() +{ + if(vr_impl_draw_wpnoffset_helper_offset == 0) + { + return; + } + + const auto do_color = [&] { glColor4f(0, 1, 1, 0.75); }; + + const auto do_line = [&](const qvec3& a, const qvec3& b) { + do_color(); + gl_vertex(a); + gl_vertex(b); + }; + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto [hand_pos, hand_rot, cvarEntry] = [&] { + const HandIdx hand_idx = vr_impl_draw_wpnoffset_helper_offset == 1 + ? cVR_MainHand + : cVR_OffHand; + + return std::tuple{cl.handpos[hand_idx], cl.handrot[hand_idx], + VR_GetWpnCvarEntry(hand_idx)}; + }(); + + const auto offsetPos = + quake::util::redirectVector(VR_GetWpnOffsets(cvarEntry), hand_rot); + + do_line(hand_pos, hand_pos + offsetPos); + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Weapon Helper: Muzzle +// ---------------------------------------------------------------------------- + +void show_wpn_offset_helper_muzzle() +{ + if(vr_impl_draw_wpnoffset_helper_muzzle == 0) + { + return; + } + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto muzzle_pos = vr_impl_draw_wpnoffset_helper_muzzle == 1 + ? VR_CalcFinalWpnMuzzlePos(cVR_MainHand) + : VR_CalcFinalWpnMuzzlePos(cVR_OffHand); + + glColor4f(0, 1, 1, 0.75); + gl_vertex(muzzle_pos); + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Weapon Helper: 2H Offset +// ---------------------------------------------------------------------------- + +void show_wpn_offset_helper_2h_offset() +{ + if(vr_impl_draw_wpnoffset_helper_2h_offset == 0) + { + return; + } + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto pos = + vr_impl_draw_wpnoffset_helper_2h_offset == 1 + ? VR_Get2HHelpingHandPos(cVR_MainHand, cVR_OffHand) + : VR_Get2HHelpingHandPos(cVR_OffHand, cVR_MainHand); + + glColor4f(0, 1, 1, 0.75); + gl_vertex(pos); + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Hand Pos and Rot +// ---------------------------------------------------------------------------- + +void show_hand_pos_and_rot() +{ + if(vr_debug_show_hand_pos_and_rot.value == 0) + { + return; + } + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto do_hand = [&](const HandIdx hand_idx) { + const auto& pos = cl.handpos[hand_idx]; + const auto& rot = cl.handrot[hand_idx]; + + const auto fwd = quake::util::getFwdVecFromPitchYawRoll(rot); + const auto end = pos + fwd * 1._qf; + + gl_vertex(pos); + gl_vertex(end); + }; + + glColor4f(0, 1, 0, 0.75); + do_hand(cVR_MainHand); + + glColor4f(1, 0, 0, 0.75); + do_hand(cVR_OffHand); + }); +} + +// TODO VR: (P1) move: +void show_menu_intersection_point() +{ + return; + + gl_showfn_guard guard; + + guard.draw_points_and_lines([&] { + const auto do_hand = [&](const HandIdx hand_idx) { + glColor4f(0, 1, 0, 0.75); + gl_vertex(cl.handpos[hand_idx]); + gl_vertex(vr_menu_intersection_point); + + // glColor4f(0, 0, 1, 0.5); + // gl_vertex(cl.handpos[hand_idx]); + // gl_vertex(vr_menu_target); + + glColor4f(1, 0, 0, 0.5); + gl_vertex(vr_menu_target); + gl_vertex(vr_menu_target + vr_menu_normal * 205.f); + }; + + do_hand(cVR_MainHand); + + // glColor4f(1, 0, 0, 0.75); + // do_hand(cVR_OffHand); + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Anchor Vertex Impl +// ---------------------------------------------------------------------------- + +void show_anchor_vertex_impl(const HandIdx hand_idx, const WpnCVar wpn_cvar) +{ + entity_t* const anchor = VR_GetAnchorEntity(hand_idx); + + if(anchor->model == nullptr) + { + return; + } + + const WpnCvarEntry wpn_cvar_entry = VR_GetWpnCvarEntry(hand_idx); + + const auto anchor_vertex = + static_cast<VertexIdx>(VR_GetWpnCVarValue(wpn_cvar_entry, wpn_cvar)); + + const qvec3 rots = VR_GetWpnAngleOffsets(wpn_cvar_entry); + + const bool horiz_flip = hand_idx == cVR_OffHand; + + const auto do_vertex = [&](const VertexIdx vertex_idx_offset) { + const auto pos = VR_GetScaledAndAngledAliasVertexPosition(anchor, + anchor_vertex + vertex_idx_offset, vec3_zero, + cl.handrot[hand_idx] + rots, horiz_flip); + + gl_vertex(pos); + }; + + gl_showfn_guard guard; + + guard.draw_points_with_size(12.f, [&] { + glColor4f(1.f, 1.f, 1.f, 1.0f); + do_vertex(0); + }); + + guard.draw_points_with_size(6.f, [&] { + glColor4f(0.f, 0.f, 1.f, 0.95f); + do_vertex(1); + + glColor4f(0.f, 1.f, 0.f, 0.95f); + do_vertex(-1); + }); + + guard.draw_points_with_size(3.25f, [&] { + // TODO VR: (P1) use the proper limit instead of 500 + glColor4f(0.f, 0.f, 1.f, 0.9f); + for(int i = 2; i < 500; ++i) + { + do_vertex(i); + } + + glColor4f(0.f, 1.f, 0.f, 0.9f); + for(int i = 2; i < 500; ++i) + { + do_vertex(-i); + } + }); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Hand Anchor Vertex +// ---------------------------------------------------------------------------- + +void show_hand_anchor_vertex() +{ + // TODO VR: (P2) cvar to always show all vertices + // show_hand_anchor_vertex_impl(cVR_MainHand); + // show_hand_anchor_vertex_impl(cVR_OffHand); + + if(vr_impl_draw_hand_anchor_vertex == 0) + { + return; + } + + const HandIdx hand_idx = + vr_impl_draw_hand_anchor_vertex == 1 ? cVR_MainHand : cVR_OffHand; + + show_anchor_vertex_impl(hand_idx, WpnCVar::HandAnchorVertex); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show 2H Hand Anchor Vertex +// ---------------------------------------------------------------------------- + +// TODO VR: (P1) code repetition, move all Show functions to some other file +void show_2h_hand_anchor_vertex() +{ + // TODO VR: (P2) cvar to always show all vertices + // show_2h_hand_anchor_vertex_impl(cVR_MainHand); + // show_2h_hand_anchor_vertex_impl(cVR_OffHand); + + if(vr_impl_draw_2h_hand_anchor_vertex == 0) + { + return; + } + + const HandIdx hand_idx = + vr_impl_draw_hand_anchor_vertex == 1 ? cVR_MainHand : cVR_OffHand; + + show_anchor_vertex_impl(hand_idx, WpnCVar::TwoHHandAnchorVertex); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Weapon Button Anchor Vertex +// ---------------------------------------------------------------------------- + +// TODO VR: (P1) code repetition +void show_wpn_button_anchor_vertex() +{ + if(vr_impl_draw_wpnbutton_anchor_vertex == 0) + { + return; + } + + const HandIdx hand_idx = + vr_impl_draw_hand_anchor_vertex == 1 ? cVR_MainHand : cVR_OffHand; + + show_anchor_vertex_impl(hand_idx, WpnCVar::WpnButtonAnchorVertex); +} + +// +// +// +// ---------------------------------------------------------------------------- +// Show Muzzle Anchor Vertex +// ---------------------------------------------------------------------------- + +// TODO VR: (P1) code repetition +void show_muzzle_anchor_vertex() +{ + if(vr_impl_draw_wpnoffset_helper_muzzle == 0) + { + return; + } + + const HandIdx hand_idx = + vr_impl_draw_hand_anchor_vertex == 1 ? cVR_MainHand : cVR_OffHand; + + show_anchor_vertex_impl(hand_idx, WpnCVar::MuzzleAnchorVertex); +} + +} // namespace + +// +// +// +// ---------------------------------------------------------------------------- +// Globals +// ---------------------------------------------------------------------------- + +// TODO VR: (P2) organize and encapsulate +int vr_impl_draw_wpnoffset_helper_offset{0}; +int vr_impl_draw_wpnoffset_helper_muzzle{0}; +int vr_impl_draw_wpnoffset_helper_2h_offset{0}; +int vr_impl_draw_hand_anchor_vertex{0}; +int vr_impl_draw_2h_hand_anchor_vertex{0}; +int vr_impl_draw_wpnbutton_anchor_vertex{0}; +int vr_impl_draw_wpnoffset_helper_length{0}; + +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +void draw_all_show_helpers() +{ + show_virtual_stock(); + show_hip_holsters(); + show_shoulder_holsters(); + show_upper_holsters(); + show_vr_torso_debug_lines(); + show_teleport_line(); + show_wpn_offset_helper_offset(); + show_wpn_offset_helper_muzzle(); + show_wpn_offset_helper_2h_offset(); + show_hand_pos_and_rot(); + show_hand_anchor_vertex(); + show_2h_hand_anchor_vertex(); + show_wpn_button_anchor_vertex(); + show_muzzle_anchor_vertex(); + show_menu_intersection_point(); +} + +void show_crosshair() +{ + if(vr_crosshair.value == 0 || !svPlayerActive()) + { + return; + } + + const float size = std::clamp(vr_crosshair_size.value, 0.f, 32.f); + const float alpha = std::clamp(vr_crosshair_alpha.value, 0.f, 1.f); + + if(size <= 0 || alpha <= 0) + { + return; + } + + gl_showfn_guard guard; + show_crosshair_hand_impl(cVR_OffHand, size, alpha); + show_crosshair_hand_impl(cVR_MainHand, size, alpha); +} + +} // namespace quake::vr::showfn diff --git a/Quake/vr_showfn.hpp b/Quake/vr_showfn.hpp new file mode 100644 index 00000000..0eed0224 --- /dev/null +++ b/Quake/vr_showfn.hpp @@ -0,0 +1,36 @@ +#pragma once + +// +// +// +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + +namespace quake::vr::showfn +{ + +void draw_all_show_helpers(); +void show_crosshair(); + +} // namespace quake::vr::showfn + +// +// +// +// ---------------------------------------------------------------------------- +// Extern Declarations +// ---------------------------------------------------------------------------- + +namespace quake::vr::showfn +{ + +// TODO VR: (P2) encapsulate nicely +extern int vr_impl_draw_wpnoffset_helper_offset; +extern int vr_impl_draw_wpnoffset_helper_muzzle; +extern int vr_impl_draw_wpnoffset_helper_2h_offset; +extern int vr_impl_draw_hand_anchor_vertex; +extern int vr_impl_draw_2h_hand_anchor_vertex; +extern int vr_impl_draw_wpnbutton_anchor_vertex; + +} diff --git a/Quake/wad.cpp b/Quake/wad.cpp index 605c492d..4bc48098 100644 --- a/Quake/wad.cpp +++ b/Quake/wad.cpp @@ -22,14 +22,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // wad.c -#include "quakedef.hpp" +#include "wad.hpp" + +#include "q_stdinc.hpp" +#include "qpic.hpp" +#include "common.hpp" +#include "sys.hpp" +#include "console.hpp" +#include "byteorder.hpp" int wad_numlumps; lumpinfo_t* wad_lumps; byte* wad_base = nullptr; - - /* ================== W_CleanupName diff --git a/Quake/wad.hpp b/Quake/wad.hpp index aee9f373..b46aa3f7 100644 --- a/Quake/wad.hpp +++ b/Quake/wad.hpp @@ -21,12 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_WAD_H -#define _QUAKE_WAD_H +#pragma once -//=============== -// TYPES -//=============== +#include "q_stdinc.hpp" #define CMP_NONE 0 #define CMP_LZSS 1 @@ -44,12 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define WADFILENAME \ "gfx.wad" // johnfitz -- filename is now hard-coded for honesty -typedef struct -{ - int width, height; - byte data[4]; // variably sized -} qpic_t; - typedef struct { char identification[4]; // should be WAD2 or 2DAW @@ -72,12 +63,9 @@ extern int wad_numlumps; extern lumpinfo_t* wad_lumps; extern byte* wad_base; -void W_LoadWadFile(void); // johnfitz -- filename is now hard-coded for honesty +void W_LoadWadFile(); // johnfitz -- filename is now hard-coded for honesty void W_CleanupName(const char* in, char* out); lumpinfo_t* W_GetLumpinfo(const char* name); void* W_GetLumpName(const char* name); void* W_GetLumpNum(int num); -void SwapPic(qpic_t* pic); - -#endif /* _QUAKE_WAD_H */ diff --git a/Quake/world.cpp b/Quake/world.cpp index 6a835bc4..b3b85627 100644 --- a/Quake/world.cpp +++ b/Quake/world.cpp @@ -25,8 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.hpp" #include "util.hpp" -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" #include "vr.hpp" +#include "vr_cvars.hpp" +#include "console.hpp" +#include "host.hpp" +#include "sys.hpp" #include <cassert> @@ -41,17 +45,17 @@ line of sight checks trace->crosscontent, but bullets don't struct moveclip_t { - glm::vec3 boxmins, boxmaxs; // enclose the test object along entire move - glm::vec3 mins, maxs; // size of the moving object - glm::vec3 mins2, maxs2; // size when clipping against mosnters - glm::vec3 start, end; + qvec3 boxmins, boxmaxs; // enclose the test object along entire move + qvec3 mins, maxs; // size of the moving object + qvec3 mins2, maxs2; // size when clipping against mosnters + qvec3 start, end; trace_t trace; int type; edict_t* passedict; }; -int SV_HullPointContents(hull_t* hull, int num, const glm::vec3& p); +int SV_HullPointContents(const hull_t* hull, int num, const qvec3& p); /* =============================================================================== @@ -114,7 +118,7 @@ To keep everything totally uniform, bounding boxes are turned into small BSP trees instead of being compared directly. =================== */ -hull_t* SV_HullForBox(const glm::vec3& mins, const glm::vec3& maxs) +hull_t* SV_HullForBox(const qvec3& mins, const qvec3& maxs) { box_planes[0].dist = maxs[0]; box_planes[1].dist = mins[0]; @@ -138,12 +142,12 @@ Offset is filled in to contain the adjustment that must be added to the testing object's origin to get a point to use with the returned hull. ================ */ -hull_t* SV_HullForEntity(edict_t* ent, const glm::vec3& mins, - const glm::vec3& maxs, glm::vec3& offset) +hull_t* SV_HullForEntity( + edict_t* ent, const qvec3& mins, const qvec3& maxs, qvec3& offset) { - glm::vec3 size; - glm::vec3 hullmins; - glm::vec3 hullmaxs; + qvec3 size; + qvec3 hullmins; + qvec3 hullmaxs; hull_t* hull; @@ -184,6 +188,7 @@ hull_t* SV_HullForEntity(edict_t* ent, const glm::vec3& mins, // calculate an offset value to center the origin offset = hull->clip_mins - mins; + // offset.x = offset.y = 0; offset += ent->v.origin; } else @@ -197,7 +202,6 @@ hull_t* SV_HullForEntity(edict_t* ent, const glm::vec3& mins, offset = ent->v.origin; } - return hull; } @@ -230,8 +234,7 @@ SV_CreateAreaNode =============== */ -areanode_t* SV_CreateAreaNode( - int depth, const glm::vec3& mins, const glm::vec3& maxs) +areanode_t* SV_CreateAreaNode(int depth, const qvec3& mins, const qvec3& maxs) { areanode_t* anode = &sv_areanodes[sv_numareanodes]; sv_numareanodes++; @@ -246,7 +249,7 @@ areanode_t* SV_CreateAreaNode( return anode; } - glm::vec3 size = maxs - mins; + qvec3 size = maxs - mins; if(size[0] > size[1]) { anode->axis = 0; @@ -258,10 +261,10 @@ areanode_t* SV_CreateAreaNode( anode->dist = 0.5f * (maxs[anode->axis] + mins[anode->axis]); - const glm::vec3& mins1 = mins; - glm::vec3 mins2 = mins; - glm::vec3 maxs1 = maxs; - const glm::vec3& maxs2 = maxs; + const qvec3& mins1 = mins; + qvec3 mins2 = mins; + qvec3 maxs1 = maxs; + const qvec3& maxs2 = maxs; maxs1[anode->axis] = mins2[anode->axis] = anode->dist; @@ -328,13 +331,11 @@ static void SV_AreaTriggerEdicts(edict_t* ent, areanode_t* node, edict_t** list, continue; } - const bool canBeTouched = quake::util::canBeTouched(target); - // TODO VR: (P2) consequences of this? Seems to fix handtouch on // ledges // if(!canBeTouched || !quake::util::entBoxIntersection(ent, // target)) - if(!canBeTouched) + if(!quake::util::canBeTouched(target)) { continue; } @@ -422,14 +423,12 @@ void SV_TouchLinks(edict_t* ent) PR_ExecuteProgram(target->v.touch); } - // -------------------------------------------------------------------- - // VR: Simulate touching with right hand if body interactions are off. - if(target->v.handtouch && vr_body_interactions.value == 1) + if(target->v.handtouch && quake::util::hasFlag(ent, FL_CLIENT) && + (!ent->v.ishuman || vr_body_interactions.value || vr_fakevr.value)) { VR_SetFakeHandtouchParams(ent, target); PR_ExecuteProgram(target->v.handtouch); } - // -------------------------------------------------------------------- pr_global_struct->self = old_self; pr_global_struct->other = old_other; @@ -437,7 +436,7 @@ void SV_TouchLinks(edict_t* ent) const auto doHandtouch = [](edict_t* ent, edict_t* target) { // Add some size to the hands. - const glm::vec3 offsets{2.5f, 2.5f, 2.5f}; + const qvec3 offsets{2.5f, 2.5f, 2.5f}; const auto handposmin = ent->v.handpos - offsets; const auto handposmax = ent->v.handpos + offsets; @@ -449,14 +448,14 @@ void SV_TouchLinks(edict_t* ent) const bool entIntersects = !quake::util::entBoxIntersection(ent, target); - const auto intersects = [&](const glm::vec3& handMin, - const glm::vec3& handMax) { + const auto intersects = [&](const qvec3& handMin, + const qvec3& handMax) { // VR: This increases the boundaries for easier hand touching. const float bonus = quake::util::hasFlag(target, FL_EASYHANDTOUCH) ? VR_GetEasyHandTouchBonus() : 0.f; - const glm::vec3 bonusVec{bonus, bonus, bonus}; + const qvec3 bonusVec{bonus, bonus, bonus}; return quake::util::boxIntersection(handMin, handMax, target->v.absmin - bonusVec, target->v.absmax + bonusVec); @@ -692,7 +691,7 @@ SV_HullPointContents ================== */ -int SV_HullPointContents(hull_t* hull, int num, const glm::vec3& p) +int SV_HullPointContents(const hull_t* hull, int num, const qvec3& p) { while(num >= 0) { @@ -701,10 +700,10 @@ int SV_HullPointContents(hull_t* hull, int num, const glm::vec3& p) Sys_Error("SV_HullPointContents: bad node number"); } - mclipnode_t* node = hull->clipnodes + num; - mplane_t* plane = hull->planes + node->planenum; + const mclipnode_t* const node = hull->clipnodes + num; + const mplane_t* const plane = hull->planes + node->planenum; - float d = + const float d = plane->type < 3 ? p[plane->type] - plane->dist : DoublePrecisionDotProduct(plane->normal, p) - plane->dist; @@ -722,7 +721,7 @@ SV_PointContents ================== */ -int SV_PointContents(const glm::vec3& p) +int SV_PointContents(const qvec3& p) { const int cont = SV_HullPointContents(&sv.worldmodel->hulls[0], 0, p); if(cont <= CONTENTS_CURRENT_0 && cont >= CONTENTS_CURRENT_DOWN) @@ -733,7 +732,7 @@ int SV_PointContents(const glm::vec3& p) return cont; } -int SV_TruePointContents(const glm::vec3& p) +int SV_TruePointContents(const qvec3& p) { return SV_HullPointContents(&sv.worldmodel->hulls[0], 0, p); } @@ -747,8 +746,7 @@ SV_TestEntityPosition This could be a lot more efficient... ============ */ -edict_t* SV_TestEntityPositionCustomOrigin( - edict_t* ent, const glm::vec3& xOrigin) +edict_t* SV_TestEntityPositionCustomOrigin(edict_t* ent, const qvec3& xOrigin) { const trace_t trace = SV_Move(xOrigin, ent->v.mins, ent->v.maxs, xOrigin, MOVE_NORMAL, ent); @@ -777,8 +775,43 @@ SV_RecursiveHullCheck ================== */ bool SV_RecursiveHullCheck(hull_t* hull, int num, float p1f, float p2f, - const glm::vec3& p1, const glm::vec3& p2, trace_t* trace) + const qvec3& p1, const qvec3& p2, trace_t* trace) { + // QSS + // Optimize the case where this is a simple point check + if(p1 == p2) + { + // points cannot cross planes, so do it faster + const auto c = SV_HullPointContents(hull, num, p1); + + // TODO VR: (P2) restore when this is implemented + // trace->contents = c; + + switch(c) + { + case CONTENTS_SOLID: + { + trace->startsolid = true; + break; + } + case CONTENTS_EMPTY: + { + trace->allsolid = false; + trace->inopen = true; + break; + } + default: + { + trace->allsolid = false; + trace->inwater = true; + break; + } + } + + return true; + } + +#ifdef PARANOID // ------------------------------------------------------------------------ // VR: Solves weird crashes, probably related to hand pos on spawn. if(std::isnan(p1f) || std::isnan(p2f)) @@ -786,6 +819,7 @@ bool SV_RecursiveHullCheck(hull_t* hull, int num, float p1f, float p2f, return false; } // ------------------------------------------------------------------------ +#endif // check for empty if(num < 0) @@ -886,7 +920,7 @@ bool SV_RecursiveHullCheck(hull_t* hull, int num, float p1f, float p2f, frac = 1; } - glm::vec3 mid; + qvec3 mid; float midf = p1f + (p2f - p1f) * frac; for(int i = 0; i < 3; i++) { @@ -973,8 +1007,8 @@ Handles selection or creation of a clipping hull, and offseting (and eventually rotation) of the end points ================== */ -trace_t SV_ClipMoveToEntity(edict_t* ent, const glm::vec3& start, - const glm::vec3& mins, const glm::vec3& maxs, const glm::vec3& end) +trace_t SV_ClipMoveToEntity(edict_t* ent, const qvec3& start, const qvec3& mins, + const qvec3& maxs, const qvec3& end) { // fill in a default trace trace_t trace; @@ -984,11 +1018,11 @@ trace_t SV_ClipMoveToEntity(edict_t* ent, const glm::vec3& start, trace.endpos = end; // get the clipping hull - glm::vec3 offset; + qvec3 offset; hull_t* hull = SV_HullForEntity(ent, mins, maxs, offset); - const glm::vec3 start_l = start - offset; - const glm::vec3 end_l = end - offset; + const qvec3 start_l = start - qvec3(offset); + const qvec3 end_l = end - qvec3(offset); // trace a line through the apropriate clipping hull SV_RecursiveHullCheck( @@ -1132,9 +1166,8 @@ void SV_ClipToLinks(areanode_t* node, moveclip_t* clip) SV_MoveBounds ================== */ -void SV_MoveBounds(const glm::vec3& start, const glm::vec3& mins, - const glm::vec3& maxs, const glm::vec3& end, glm::vec3& boxmins, - glm::vec3& boxmaxs) +void SV_MoveBounds(const qvec3& start, const qvec3& mins, const qvec3& maxs, + const qvec3& end, qvec3& boxmins, qvec3& boxmaxs) { #if 0 // debug to test against everything @@ -1162,9 +1195,8 @@ boxmaxs[0] = boxmaxs[1] = boxmaxs[2] = 9999; SV_Move ================== */ -trace_t SV_Move(const glm::vec3& start, const glm::vec3& mins, - const glm::vec3& maxs, const glm::vec3& end, const int type, - edict_t* const passedict) +trace_t SV_Move(const qvec3& start, const qvec3& mins, const qvec3& maxs, + const qvec3& end, const int type, edict_t* const passedict) { moveclip_t clip; memset(&clip, 0, sizeof(moveclip_t)); @@ -1211,8 +1243,8 @@ trace_t SV_Move(const glm::vec3& start, const glm::vec3& mins, SV_MoveTrace ================== */ -trace_t SV_MoveTrace(const glm::vec3& start, const glm::vec3& end, - const int type, edict_t* const passedict) +trace_t SV_MoveTrace(const qvec3& start, const qvec3& end, const int type, + edict_t* const passedict) { return SV_Move(start, vec3_zero, vec3_zero, end, type, passedict); } diff --git a/Quake/world.hpp b/Quake/world.hpp index 9f548a5b..6924bffe 100644 --- a/Quake/world.hpp +++ b/Quake/world.hpp @@ -21,14 +21,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _QUAKE_WORLD_H -#define _QUAKE_WORLD_H +#pragma once -#include "quakeglm.hpp" +#include "quakeglm_qvec3.hpp" + +struct edict_t; typedef struct { - glm::vec3 normal; + qvec3 normal; float dist; } plane_t; @@ -37,10 +38,14 @@ struct trace_t bool allsolid; // if true, plane is not valid bool startsolid; // if true, the initial point was in a solid area bool inopen, inwater; - float fraction; // time completed, 1.0 = didn't hit anything - glm::vec3 endpos; // final position - plane_t plane; // surface normal at impact - edict_t* ent; // entity the surface is on + float fraction; // time completed, 1.0 = didn't hit anything + qvec3 endpos; // final position + plane_t plane; // surface normal at impact + edict_t* ent; // entity the surface is on + + // TODO VR: (P2) implement this + // QSS + // int contents; // spike -- the content type(s) that we found. }; @@ -48,8 +53,10 @@ struct trace_t #define MOVE_NOMONSTERS 1 #define MOVE_MISSILE 2 +// QSS +#define MOVE_HITALLCONTENTS (1 << 9) -void SV_ClearWorld(void); +void SV_ClearWorld(); // called after the world model has been loaded, before linking any entities void SV_UnlinkEdict(edict_t* ent); @@ -63,22 +70,21 @@ void SV_LinkEdict(edict_t* ent, bool touch_triggers); // sets ent->v.absmin and ent->v.absmax // if touch_triggers, calls prog functions for the intersected triggers -int SV_PointContents(const glm::vec3& p); -int SV_TruePointContents(const glm::vec3& p); +int SV_PointContents(const qvec3& p); +int SV_TruePointContents(const qvec3& p); // returns the CONTENTS_* value from the world at the given point. // does not check any entities at all // the non-true version remaps the water current contents to content_water -edict_t* SV_TestEntityPositionCustomOrigin(edict_t* ent, const glm::vec3& xOrigin); +edict_t* SV_TestEntityPositionCustomOrigin(edict_t* ent, const qvec3& xOrigin); edict_t* SV_TestEntityPosition(edict_t* ent); -trace_t SV_Move(const glm::vec3& start, const glm::vec3& mins, - const glm::vec3& maxs, const glm::vec3& end, const int type, - edict_t* const passedict); +trace_t SV_Move(const qvec3& start, const qvec3& mins, const qvec3& maxs, + const qvec3& end, const int type, edict_t* const passedict); // mins and maxs are relative -trace_t SV_MoveTrace(const glm::vec3& start, const glm::vec3& end, - const int type, edict_t* const passedict); +trace_t SV_MoveTrace(const qvec3& start, const qvec3& end, const int type, + edict_t* const passedict); // if the entire move stays in a solid volume, trace.allsolid will be set @@ -88,8 +94,8 @@ trace_t SV_MoveTrace(const glm::vec3& start, const glm::vec3& end, // nomonsters is used for line of sight or edge testing, where mosnters // shouldn't be considered solid objects +struct hull_t; + // passedict is explicitly excluded from clipping checks (normally nullptr) bool SV_RecursiveHullCheck(hull_t* hull, int num, float p1f, float p2f, - const glm::vec3& p1, const glm::vec3& p2, trace_t* trace); - -#endif /* _QUAKE_WORLD_H */ + const qvec3& p1, const qvec3& p2, trace_t* trace); diff --git a/Quake/worldtext.hpp b/Quake/worldtext.hpp new file mode 100644 index 00000000..4c7f0290 --- /dev/null +++ b/Quake/worldtext.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include <string> +#include <cstddef> +#include <cstdint> +#include <limits> + +#include "quakeglm_qvec3.hpp" + +#undef min +#undef max + +struct WorldText +{ + enum class HAlign : std::uint8_t + { + Left = 0, + Center = 1, + Right = 2 + }; + + std::string _text{}; + qvec3 _pos{}; + qvec3 _angles{}; + HAlign _hAlign{HAlign::Left}; +}; + +using WorldTextHandle = std::uint16_t; + +inline constexpr std::size_t maxWorldTextInstances = std::numeric_limits<WorldTextHandle>::max(); diff --git a/Quake/wsaerror.hpp b/Quake/wsaerror.hpp index 0a2407d0..af84f714 100644 --- a/Quake/wsaerror.hpp +++ b/Quake/wsaerror.hpp @@ -1,5 +1,4 @@ -#ifndef __WSAERROR_H__ -#define __WSAERROR_H__ +#pragma once /* strings for winsock error codes. * from online references, such as @@ -111,4 +110,3 @@ } } -#endif diff --git a/Quake/zone.cpp b/Quake/zone.cpp index b41e0752..48e4dce5 100644 --- a/Quake/zone.cpp +++ b/Quake/zone.cpp @@ -22,7 +22,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // zone.c +#include "zone.hpp" + #include "quakedef.hpp" +#include "gl_model.hpp" +#include "cmd.hpp" +#include "common.hpp" +#include "console.hpp" +#include "sys.hpp" +#include "gl_texmgr.hpp" #define DYNAMIC_SIZE \ (4 * 1024 * 1024) // ericw -- was 512KB (64-bit) / 384KB (32-bit) @@ -204,26 +212,27 @@ static void* Z_TagMalloc(int size, int tag) Z_CheckHeap ======================== */ -static void Z_CheckHeap() +[[maybe_unused]] static void Z_CheckHeap() { - memblock_t* block; - - for(block = mainzone->blocklist.next;; block = block->next) + for(memblock_t* block = mainzone->blocklist.next;; block = block->next) { if(block->next == &mainzone->blocklist) { break; // all blocks have been hit } + if((byte*)block + block->size != (byte*)block->next) { Sys_Error( "Z_CheckHeap: block size does not touch the next block\n"); } + if(block->next->prev != block) { Sys_Error( "Z_CheckHeap: next block doesn't have proper back link\n"); } + if(!block->tag && !block->next->tag) { Sys_Error("Z_CheckHeap: two consecutive free blocks\n"); @@ -239,10 +248,11 @@ Z_Malloc */ void* Z_Malloc(int size) { - void* buf; - +#ifdef PARANOID Z_CheckHeap(); // DEBUG - buf = Z_TagMalloc(size, 1); +#endif + + void* buf = Z_TagMalloc(size, 1); if(!buf) { Sys_Error("Z_Malloc: failed on allocation of %i bytes", size); @@ -284,15 +294,24 @@ void* Z_Realloc(void* ptr, int size) Z_Free(ptr); ptr = Z_TagMalloc(size, 1); + if(!ptr) { Sys_Error("Z_Realloc: failed on allocation of %i bytes", size); } + // QSS + // Spike -- fix a bug where alignment resulted in no 0-initialisation + block = (memblock_t*)((byte*)ptr - sizeof(memblock_t)); + size = block->size; + size -= (4 + (int)sizeof(memblock_t)); /* see Z_TagMalloc() */ + // Spike -- end fix + if(ptr != old_ptr) { memmove(ptr, old_ptr, q_min(old_size, size)); } + if(old_size < size) { memset((byte*)ptr + old_size, 0, size - old_size); diff --git a/Quake/zone.hpp b/Quake/zone.hpp index 964d9a92..5f1054d4 100644 --- a/Quake/zone.hpp +++ b/Quake/zone.hpp @@ -21,8 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __ZZONE_H -#define __ZZONE_H +#pragma once /* memory allocation @@ -109,7 +108,6 @@ template <typename T> return (T*)Hunk_Alloc(count * sizeof(T)); } - template <typename T> [[nodiscard]] T* Hunk_AllocName(const int count, const char* name) noexcept { @@ -124,7 +122,7 @@ template <typename T> for(int i = 0; i < count; ++i) { - new(ptr + count) T{}; + new((char*)ptr + count) T{}; } return ptr; @@ -138,14 +136,14 @@ void Hunk_FreeToHighMark(const int mark) noexcept; void* Hunk_TempAlloc(int size); -void Hunk_Check(void); +void Hunk_Check(); typedef struct cache_user_s { void* data; } cache_user_t; -void Cache_Flush(void); +void Cache_Flush(); void* Cache_Check(cache_user_t* c); // returns the cached data, and moves to the head of the LRU list @@ -158,6 +156,4 @@ void* Cache_Alloc(cache_user_t* c, int size, const char* name); // Returns nullptr if all purgable data was tossed and there still // wasn't enough room. -void Cache_Report(void); - -#endif /* __ZZONE_H */ +void Cache_Report(); diff --git a/README.md b/README.md index 0e0b02e3..e68038e6 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,16 @@ * Smooth locomotion * Teleportation * Fully room-scale *(including jumping)* -* Hand tracking +* Hand tracking *(including full finger tracking)* * Weapon models with hands and ironsights -* VR interactions *(melee, pick up items, press buttons)* +* VR interactions *(melee, headbutts, pick up items, press buttons)* * Rebalanced for VR *(hitboxes, difficulty, projectile speed)* * Steam VR Input API support *(can rebind inputs in Steam VR settings)* * Many customization options *(e.g. melee damage/range, hand/body item pickup, and more)* * Brand new particle system *(smoke, blood, lightning effects, and more)* * Haptic feedback *(weapons, melee, damage, interactions with items)* * Full Scourge of Armagon support *(weapons, enemies, maps)* +* Full Dissolution of Eternity support *(weapons, enemies, maps)* * Two-handed weapon aiming *(with virtual stock support)* * Weapon weight simulation * Grappling hook *(from Dissolution of Eternity)* @@ -31,6 +32,7 @@ * Dual-wielding * Weapon holster system *(hip and shoulders, fully customizable)* * Weapon throwing & force grabbing +* Multiplayer support *(also with bots)* ## Disclaimer @@ -76,12 +78,30 @@ Quake VR supports the "Scourge of Armagon" official mission pack. It can be inst When Scourge of Armagon is installed, it overwrites Quake 1's `start.bsp` with its own starting map. In order to play Quake 1 maps, use the *"Change Map"* functionality under *"Quake VR Settings"*. + +### Mission Pack 2: Dissolution of Eternity + +Quake VR supports the "Dissolution of Eternity" official mission pack. The instructions above apply here as well. Take `pak0.pak` from the `rogue` folder, rename it to somethhing unique (e.g. `pak4.pak` if you installed Scourge of Armagon), and place it in your `Id1` folder. + ### Highly Recommended Addons +#### HD Textures and Soundtrack + The [HD Textures and Soundtrack](https://drive.google.com/file/d/1noIH27xA8gnr_hwqouXiSoMQBIyuf__V/view) addon is highly recommended to improve immersion. * [Installation Instructions](https://old.reddit.com/r/ValveIndex/comments/fbs1nh/quake_vr_release_trailer_v001/fj7205c/) +#### Extra Multiplayer Maps with Bot Support + +Quake VR comes with [Frikbot X++](http://neogeographica.com/site/pages/mods/fbxpp.html), which adds AI opponents for deathmatch. As the vanilla multiplayer map pool is quite limited, the following map pack and Frikbot waypoint collection are strongly advised if you are interested in playing against bots: + +* [The Definitive Frikbot Mappack](https://www.quaddicted.com/files/misc/DefinitiveFrikbotMappackV2.zip) +* [The Definitive Frikbot Waypack](https://www.quaddicted.com/files/misc/DefinitiveFrikbotWaypackV2.zip) *([forum discussion](http://quakeone.com/forum/quake-mod-releases/finished-works/5313-the-definitive-frikbot-waypack))* + +### Custom Maps + +For supported custom maps, please see [CUSTOM_MAPS.md](https://github.com/SuperV1234/quakevr/blob/master/CUSTOM_MAPS.md). + ### Vispatching The Quake VR engine supports transparent water, however original Quake maps need to be patched in order for it to work properly. It is therefore highly recommended that you "vispatch" your Quake (and Scourge of Armagon) maps. @@ -94,7 +114,7 @@ Once your maps are patched, go through the options in the *"Transparency Options ### SteamVR Bindings -The first thing you should do after starting Quake VR is opening the *"Controller Bindings"* interface on SteamVR and ensure that in-game actions are mapped to the motion controllers. +The first thing you should do after starting Quake VR is opening the *"Controller Bindings"* interface on SteamVR and ensure that in-game actions are mapped to the motion controllers. There are two action sets to bind: one for in-game actions, and one for menu control. See an [example video **here**](https://giant.gfycat.com/ThornyEducatedBushbaby.mp4). ### In-Game Configuration @@ -106,6 +126,20 @@ After setting up your bindings, please go through all the options in *"Quake VR There is no "best" way of playing Quake VR. Simply use the settings that you enjoy the most! +## Multiplayer + +### Versus Bots + +To play against bots, select *"Multiplayer & Bots"* from the main menu, then *"New Game"* and follow the on-screen instructions. When in-game, spawn new bots from the *"Bot Control"* menu under *"Multiplayer & Bots"*. + +### On the Internet + +Coordinate with other players on the [official Quake VR Discord](http://discord.me/quakevr). The host of the game will start a server by going to *"Multiplayer & Bots"* from the main menu, then *"New Game"*. The host will then share their [public IPV4 address](https://www.whatismyip.com/what-is-my-public-ip-address) with other players, which will connect from the *"Join a Game"* menu. The virtual keyboard can be used to insert the IP address. + +Note that the host needs to [properly forward their ports](https://portforward.com/quake/) and ensure that their public IP is accessible from the Internet. + +At the moment there is no server browser and no dedicated server support. Also, only Windows servers are supported. Dedicated Linux servers and an easier way to play together will be the next goals for Quake VR. + ## Troubleshooting * > The game seems to work fine, but there is no audio! @@ -130,12 +164,18 @@ There is no "best" way of playing Quake VR. Simply use the settings that you enj * [Fishbiter's OpenVR port](https://github.com/Fishbiter/Quakespasm-OpenVR) * [Zackin5's OpenVR port](https://github.com/Zackin5/Quakespasm-OpenVR) * [Dominic Szablewski's (Phoboslab) Oculus port](https://github.com/phoboslab/Quakespasm-Rift) + * [Quakespasm-Spiked](http://triptohell.info/moodles/qss/) -* Hands and ironsights modeled by me +* Hand models with finger trackning support created by *Trevor Roach* + * Many thanks! + +* Weapon ironsights modeled by me * Using the [Authentic Model Improvements](https://github.com/NightFright2k19/authmdl) project as a base * Many thanks to the following beta testers, who provided a lot of great feedback: *carn1x*, *GeekyGami*, *Sly VR*. +* Many thanks to *Spoike* for helping me out with QuakeC and Quake engine internals. + *(Please forgive me if I am forgetting someone. I will update this list as needed.)* ## Fan Coverage diff --git a/ReleaseFiles/Id1/config.cfg b/ReleaseFiles/Id1/config.cfg index 219fff48..fc689172 100644 --- a/ReleaseFiles/Id1/config.cfg +++ b/ReleaseFiles/Id1/config.cfg @@ -15,8 +15,8 @@ bind "3" "impulse 12" bind "4" "impulse 15" bind "5" "impulse 16" bind "6" "impulse 6" -bind "7" "impulse 7" -bind "8" "impulse 8" +bind "7" "impulse 42" +bind "8" "impulse 43" bind "=" "sizeup" bind "\" "+mlook" bind "`" "toggleconsole" @@ -56,11 +56,11 @@ bind "MOUSE2" "+offhandattack" bind "MOUSE3" "+mlook" bind "MWHEELDOWN" "impulse 12" bind "PAUSE" "pause" -_cl_color "0" -_cl_name "player" +_cl_color "84" +_cl_name "vee" _snd_mixahead "0.1" bgm_extmusic "1" -bgmvolume "1" +bgmvolume "0.5" cfg_unbindall "1" cl_alwaysrun "1" cl_backspeed "200" @@ -69,10 +69,10 @@ cl_maxpitch "90" cl_minpitch "-90" cl_movespeedkey "0.5" contrast "1" -crosshair "0" +crosshair "1" external_ents "1" fov_adapt "1" -gamma "1" +gamma "0.5" gl_farclip "16384" gl_flashblend "0" gl_fullbrights "1" @@ -100,7 +100,7 @@ m_side "0.8" m_yaw "0.022" r_clearcolor "2" r_dynamic "1" -r_lavaalpha "0" +r_lavaalpha "0.8" r_novis "0" r_oldwater "1" r_particle_mult "1" @@ -108,17 +108,17 @@ r_particles "1" r_scale "1" r_shadows "1" r_slimealpha "0" -r_telealpha "0" +r_telealpha "0.9" r_viewmodel_quake "0" -r_wateralpha "0.5" +r_wateralpha "0.8" saved1 "0" -saved2 "0" -saved3 "0" +saved2 "-288" +saved3 "270" saved4 "0" savedgamecfg "0" scr_conalpha "0.5" -scr_conscale "1.1" -scr_conspeed "500" +scr_conscale "1" +scr_conspeed "5000" scr_conwidth "0" scr_crosshairscale "1" scr_menuscale "1.1" @@ -132,18 +132,25 @@ vid_bpp "24" vid_desktopfullscreen "0" vid_fsaa "0" vid_fullscreen "0" -vid_height "900" -vid_refreshrate "60" +vid_height "600" +vid_refreshrate "144" vid_vsync "0" -vid_width "1600" +vid_width "800" viewsize "100" volume "0.8" vr_2h_angle_threshold "0.65" +vr_2h_disable_angle_threshold "0" vr_2h_mode "2" +vr_2h_spread_reduction "0.5" +vr_2h_throw_velocity_mult "1.4" vr_2h_virtual_stock_factor "0.5" +vr_activestartpaknameidx "0" vr_aimmode "6" vr_ammobox_drops "0" -vr_ammobox_drops_chance_mult "1.0" +vr_ammobox_drops_chance_mult "1" +vr_autosave_on_changelevel "1" +vr_autosave_seconds "240" +vr_autosave_show_message "0" vr_body_interactions "0" vr_crosshair "0" vr_crosshair_alpha "0.85" @@ -152,10 +159,42 @@ vr_crosshair_size "1" vr_crosshairy "0" vr_deadzone "25" vr_debug_print_handvel "0" +vr_debug_print_headvel "0" vr_debug_show_hand_pos_and_rot "0" vr_enable_joystick_turn "1" vr_enemy_drops "0" -vr_enemy_drops_chance_mult "1.0" +vr_enemy_drops_chance_mult "1" +vr_finger_auto_close_thumb "1" +vr_finger_base_x "0" +vr_finger_base_y "0.0" +vr_finger_base_z "0.0" +vr_finger_blending "1" +vr_finger_blending_speed "50" +vr_finger_grip_bias "0" +vr_finger_index_x "-0.325" +vr_finger_index_y "0.6125" +vr_finger_index_z "-1.825" +vr_finger_middle_x "-0.3625" +vr_finger_middle_y "0.5125" +vr_finger_middle_z "-0.3125" +vr_finger_pinky_x "-0.325" +vr_finger_pinky_y "1.15" +vr_finger_pinky_z "1.6375" +vr_finger_ring_x "-0.3625" +vr_finger_ring_y "0.7" +vr_finger_ring_z "0.65" +vr_finger_thumb_x "-0.3625" +vr_finger_thumb_y "3.2625" +vr_finger_thumb_z "-1.9375" +vr_fingers_and_base_offhand_x "0" +vr_fingers_and_base_offhand_y "0" +vr_fingers_and_base_offhand_z "0.0" +vr_fingers_and_base_x "1.925" +vr_fingers_and_base_y "-2.825" +vr_fingers_and_base_z "-2.075" +vr_fingers_x "-5.05" +vr_fingers_y "-0.1" +vr_fingers_z "-0.1875" vr_floor_offset "-21" vr_forcegrab_eligible_haptics "1" vr_forcegrab_eligible_particles "1" @@ -163,12 +202,18 @@ vr_forcegrab_mode "1" vr_forcegrab_powermult "1.0" vr_forcegrab_radius "18" vr_forcegrab_range "150.0" +vr_forcegrabbable_ammo_boxes "1" +vr_forcegrabbable_health_boxes "1" +vr_forcegrabbable_return_time_deathmatch "4" +vr_forcegrabbable_return_time_singleplayer "0" vr_gun_z_offset "-1" vr_gunangle "39.5" vr_gunmodelpitch "7" vr_gunmodelscale "0.7" vr_gunmodely "1.3" vr_gunyaw "4" +vr_headbutt_damage_mult "32" +vr_headbutt_velocity_threshold "2.02" vr_height_calibration "1.57799" vr_hip_holster_thresh "6.5" vr_hip_offset_x "-3.5" @@ -187,8 +232,9 @@ vr_melee_bloodlust_mult "1.0" vr_melee_dmg_multiplier "1.0" vr_melee_range_multiplier "1.0" vr_melee_threshold "7" -vr_menu_distance "76" -vr_menu_scale "0.2" +vr_menu_distance "80" +vr_menu_mouse_pointer_hand "1" +vr_menu_scale "0.15" vr_menumode "0" vr_movement_mode "1" vr_msaa "9" @@ -218,13 +264,15 @@ vr_show_shoulder_holsters "0" vr_show_upper_holsters "0" vr_show_virtual_stock "0" vr_snap_turn "0" -vr_teleport_enabled "1" +vr_teleport_enabled "0" vr_teleport_range "400" +vr_throw_up_center_of_mass "0.065" vr_turn_speed "3.25" vr_upper_holster_offset_x "-4.25" vr_upper_holster_offset_y "7" vr_upper_holster_offset_z "8.5" vr_upper_holster_thresh "6.5" +vr_verbosebots "0" vr_virtual_stock_thresh "10" vr_vrtorso_debuglines_enabled "0" vr_vrtorso_enabled "1" @@ -254,11 +302,11 @@ vr_wofs_2h_dispmd_08 "1" vr_wofs_2h_dispmd_09 "0" vr_wofs_2h_dispmd_10 "1" vr_wofs_2h_dispmd_11 "1" -vr_wofs_2h_dispmd_12 "0.0" -vr_wofs_2h_dispmd_13 "0.0" -vr_wofs_2h_dispmd_14 "0.0" -vr_wofs_2h_dispmd_15 "0.0" -vr_wofs_2h_dispmd_16 "0.0" +vr_wofs_2h_dispmd_12 "1" +vr_wofs_2h_dispmd_13 "1" +vr_wofs_2h_dispmd_14 "1" +vr_wofs_2h_dispmd_15 "1" +vr_wofs_2h_dispmd_16 "1" vr_wofs_2h_dispmd_17 "0.0" vr_wofs_2h_dispmd_18 "0.0" vr_wofs_2h_dispmd_19 "0.0" @@ -308,9 +356,9 @@ vr_wofs_2h_fxd_hp_30 "0.0" vr_wofs_2h_fxd_hp_31 "0.0" vr_wofs_2h_fxd_hp_32 "0.0" vr_wofs_2h_fxd_hr_01 "0.0" -vr_wofs_2h_fxd_hr_02 "-67.799927" -vr_wofs_2h_fxd_hr_03 "-52.199963" -vr_wofs_2h_fxd_hr_04 "-76.799904" +vr_wofs_2h_fxd_hr_02 "-84.599884" +vr_wofs_2h_fxd_hr_03 "-71.399948" +vr_wofs_2h_fxd_hr_04 "-86.399879" vr_wofs_2h_fxd_hr_05 "21.600008" vr_wofs_2h_fxd_hr_06 "-78.599899" vr_wofs_2h_fxd_hr_07 "-82.999886" @@ -318,11 +366,11 @@ vr_wofs_2h_fxd_hr_08 "-90.400024" vr_wofs_2h_fxd_hr_09 "0.0" vr_wofs_2h_fxd_hr_10 "75.799942" vr_wofs_2h_fxd_hr_11 "-78.599899" -vr_wofs_2h_fxd_hr_12 "0.0" -vr_wofs_2h_fxd_hr_13 "0.0" -vr_wofs_2h_fxd_hr_14 "0.0" -vr_wofs_2h_fxd_hr_15 "0.0" -vr_wofs_2h_fxd_hr_16 "0.0" +vr_wofs_2h_fxd_hr_12 "-76.799904" +vr_wofs_2h_fxd_hr_13 "21.600008" +vr_wofs_2h_fxd_hr_14 "-78.599899" +vr_wofs_2h_fxd_hr_15 "-82.999886" +vr_wofs_2h_fxd_hr_16 "-90.400024" vr_wofs_2h_fxd_hr_17 "0.0" vr_wofs_2h_fxd_hr_18 "0.0" vr_wofs_2h_fxd_hr_19 "0.0" @@ -343,18 +391,18 @@ vr_wofs_2h_fxd_hy_01 "0.0" vr_wofs_2h_fxd_hy_02 "-17.400005" vr_wofs_2h_fxd_hy_03 "-21.600008" vr_wofs_2h_fxd_hy_04 "-26.400011" -vr_wofs_2h_fxd_hy_05 "0.0" +vr_wofs_2h_fxd_hy_05 "0" vr_wofs_2h_fxd_hy_06 "-29.000013" -vr_wofs_2h_fxd_hy_07 "-27.600012" +vr_wofs_2h_fxd_hy_07 "-24.200008" vr_wofs_2h_fxd_hy_08 "-32.650013" vr_wofs_2h_fxd_hy_09 "0.0" vr_wofs_2h_fxd_hy_10 "0.0" vr_wofs_2h_fxd_hy_11 "-29.000013" -vr_wofs_2h_fxd_hy_12 "0.0" +vr_wofs_2h_fxd_hy_12 "-26.400011" vr_wofs_2h_fxd_hy_13 "0.0" -vr_wofs_2h_fxd_hy_14 "0.0" -vr_wofs_2h_fxd_hy_15 "0.0" -vr_wofs_2h_fxd_hy_16 "0.0" +vr_wofs_2h_fxd_hy_14 "-29.000013" +vr_wofs_2h_fxd_hy_15 "-24.20001" +vr_wofs_2h_fxd_hy_16 "-32.650013" vr_wofs_2h_fxd_hy_17 "0.0" vr_wofs_2h_fxd_hy_18 "0.0" vr_wofs_2h_fxd_hy_19 "0.0" @@ -382,8 +430,8 @@ vr_wofs_2h_fxd_mh_ox_08 "0.0" vr_wofs_2h_fxd_mh_ox_09 "0.0" vr_wofs_2h_fxd_mh_ox_10 "0.0" vr_wofs_2h_fxd_mh_ox_11 "0.0" -vr_wofs_2h_fxd_mh_ox_12 "0.0" -vr_wofs_2h_fxd_mh_ox_13 "0.0" +vr_wofs_2h_fxd_mh_ox_12 "0" +vr_wofs_2h_fxd_mh_ox_13 "0" vr_wofs_2h_fxd_mh_ox_14 "0.0" vr_wofs_2h_fxd_mh_ox_15 "0.0" vr_wofs_2h_fxd_mh_ox_16 "0.0" @@ -404,7 +452,7 @@ vr_wofs_2h_fxd_mh_ox_30 "0.0" vr_wofs_2h_fxd_mh_ox_31 "0.0" vr_wofs_2h_fxd_mh_ox_32 "0.0" vr_wofs_2h_fxd_mh_oy_01 "0.0" -vr_wofs_2h_fxd_mh_oy_02 "0.7" +vr_wofs_2h_fxd_mh_oy_02 "0" vr_wofs_2h_fxd_mh_oy_03 "5.4" vr_wofs_2h_fxd_mh_oy_04 "3.9" vr_wofs_2h_fxd_mh_oy_05 "1.9" @@ -414,11 +462,11 @@ vr_wofs_2h_fxd_mh_oy_08 "3.8" vr_wofs_2h_fxd_mh_oy_09 "0.0" vr_wofs_2h_fxd_mh_oy_10 "-4.4" vr_wofs_2h_fxd_mh_oy_11 "6.6" -vr_wofs_2h_fxd_mh_oy_12 "0.0" -vr_wofs_2h_fxd_mh_oy_13 "0.0" -vr_wofs_2h_fxd_mh_oy_14 "0.0" -vr_wofs_2h_fxd_mh_oy_15 "0.0" -vr_wofs_2h_fxd_mh_oy_16 "0.0" +vr_wofs_2h_fxd_mh_oy_12 "3.9" +vr_wofs_2h_fxd_mh_oy_13 "1.9" +vr_wofs_2h_fxd_mh_oy_14 "6.6" +vr_wofs_2h_fxd_mh_oy_15 "5.95" +vr_wofs_2h_fxd_mh_oy_16 "3.8" vr_wofs_2h_fxd_mh_oy_17 "0" vr_wofs_2h_fxd_mh_oy_18 "0.0" vr_wofs_2h_fxd_mh_oy_19 "0.0" @@ -448,7 +496,7 @@ vr_wofs_2h_fxd_mh_oz_10 "0.0" vr_wofs_2h_fxd_mh_oz_11 "0.0" vr_wofs_2h_fxd_mh_oz_12 "0.0" vr_wofs_2h_fxd_mh_oz_13 "0.0" -vr_wofs_2h_fxd_mh_oz_14 "0.0" +vr_wofs_2h_fxd_mh_oz_14 "0" vr_wofs_2h_fxd_mh_oz_15 "0.0" vr_wofs_2h_fxd_mh_oz_16 "0.0" vr_wofs_2h_fxd_mh_oz_17 "0" @@ -468,21 +516,21 @@ vr_wofs_2h_fxd_mh_oz_30 "0.0" vr_wofs_2h_fxd_mh_oz_31 "0.0" vr_wofs_2h_fxd_mh_oz_32 "0.0" vr_wofs_2h_fxd_ox_01 "0.0" -vr_wofs_2h_fxd_ox_02 "-1.2" -vr_wofs_2h_fxd_ox_03 "-2.4" +vr_wofs_2h_fxd_ox_02 "0" +vr_wofs_2h_fxd_ox_03 "0" vr_wofs_2h_fxd_ox_04 "1.8" -vr_wofs_2h_fxd_ox_05 "3.4" -vr_wofs_2h_fxd_ox_06 "4.2" +vr_wofs_2h_fxd_ox_05 "2" +vr_wofs_2h_fxd_ox_06 "0.6" vr_wofs_2h_fxd_ox_07 "3" -vr_wofs_2h_fxd_ox_08 "0.0" +vr_wofs_2h_fxd_ox_08 "0.8" vr_wofs_2h_fxd_ox_09 "0.0" -vr_wofs_2h_fxd_ox_10 "2.4" -vr_wofs_2h_fxd_ox_11 "4.2" -vr_wofs_2h_fxd_ox_12 "0.0" -vr_wofs_2h_fxd_ox_13 "0.0" -vr_wofs_2h_fxd_ox_14 "0.0" -vr_wofs_2h_fxd_ox_15 "0.0" -vr_wofs_2h_fxd_ox_16 "0.0" +vr_wofs_2h_fxd_ox_10 "-1.7" +vr_wofs_2h_fxd_ox_11 "0.6" +vr_wofs_2h_fxd_ox_12 "1.8" +vr_wofs_2h_fxd_ox_13 "2" +vr_wofs_2h_fxd_ox_14 "0.6" +vr_wofs_2h_fxd_ox_15 "3" +vr_wofs_2h_fxd_ox_16 "0.8" vr_wofs_2h_fxd_ox_17 "0.0" vr_wofs_2h_fxd_ox_18 "0.0" vr_wofs_2h_fxd_ox_19 "0.0" @@ -500,21 +548,21 @@ vr_wofs_2h_fxd_ox_30 "0.0" vr_wofs_2h_fxd_ox_31 "0.0" vr_wofs_2h_fxd_ox_32 "0.0" vr_wofs_2h_fxd_oy_01 "0.0" -vr_wofs_2h_fxd_oy_02 "-2.4" -vr_wofs_2h_fxd_oy_03 "0" -vr_wofs_2h_fxd_oy_04 "0.0" -vr_wofs_2h_fxd_oy_05 "-1.2" -vr_wofs_2h_fxd_oy_06 "1.2" -vr_wofs_2h_fxd_oy_07 "1" -vr_wofs_2h_fxd_oy_08 "0.4" +vr_wofs_2h_fxd_oy_02 "-0.7" +vr_wofs_2h_fxd_oy_03 "0.6" +vr_wofs_2h_fxd_oy_04 "0.2" +vr_wofs_2h_fxd_oy_05 "0.9" +vr_wofs_2h_fxd_oy_06 "-2.9" +vr_wofs_2h_fxd_oy_07 "1.1" +vr_wofs_2h_fxd_oy_08 "0.9" vr_wofs_2h_fxd_oy_09 "0.0" -vr_wofs_2h_fxd_oy_10 "-0.2" -vr_wofs_2h_fxd_oy_11 "1.2" +vr_wofs_2h_fxd_oy_10 "4.3" +vr_wofs_2h_fxd_oy_11 "-2.9" vr_wofs_2h_fxd_oy_12 "0.0" -vr_wofs_2h_fxd_oy_13 "0.0" -vr_wofs_2h_fxd_oy_14 "0.0" -vr_wofs_2h_fxd_oy_15 "0.0" -vr_wofs_2h_fxd_oy_16 "0.0" +vr_wofs_2h_fxd_oy_13 "0.9" +vr_wofs_2h_fxd_oy_14 "-2.9" +vr_wofs_2h_fxd_oy_15 "1.1" +vr_wofs_2h_fxd_oy_16 "0.9" vr_wofs_2h_fxd_oy_17 "0.0" vr_wofs_2h_fxd_oy_18 "0.0" vr_wofs_2h_fxd_oy_19 "0.0" @@ -532,22 +580,22 @@ vr_wofs_2h_fxd_oy_30 "0.0" vr_wofs_2h_fxd_oy_31 "0.0" vr_wofs_2h_fxd_oy_32 "0.0" vr_wofs_2h_fxd_oz_01 "0.0" -vr_wofs_2h_fxd_oz_02 "0.0" -vr_wofs_2h_fxd_oz_03 "-2" +vr_wofs_2h_fxd_oz_02 "0.7" +vr_wofs_2h_fxd_oz_03 "0" vr_wofs_2h_fxd_oz_04 "0.2" -vr_wofs_2h_fxd_oz_05 "-0.8" -vr_wofs_2h_fxd_oz_06 "-2.8" -vr_wofs_2h_fxd_oz_07 "-1.6" -vr_wofs_2h_fxd_oz_08 "0.8" +vr_wofs_2h_fxd_oz_05 "1.6" +vr_wofs_2h_fxd_oz_06 "-0.2" +vr_wofs_2h_fxd_oz_07 "-1" +vr_wofs_2h_fxd_oz_08 "-0.4" vr_wofs_2h_fxd_oz_09 "0.0" -vr_wofs_2h_fxd_oz_10 "-4.6" -vr_wofs_2h_fxd_oz_11 "-2.8" -vr_wofs_2h_fxd_oz_12 "0.0" -vr_wofs_2h_fxd_oz_13 "0.0" -vr_wofs_2h_fxd_oz_14 "0.0" -vr_wofs_2h_fxd_oz_15 "0.0" -vr_wofs_2h_fxd_oz_16 "0.0" -vr_wofs_2h_fxd_oz_17 "0.0" +vr_wofs_2h_fxd_oz_10 "10.000004" +vr_wofs_2h_fxd_oz_11 "-0.2" +vr_wofs_2h_fxd_oz_12 "0.2" +vr_wofs_2h_fxd_oz_13 "1.6" +vr_wofs_2h_fxd_oz_14 "-0.2" +vr_wofs_2h_fxd_oz_15 "-1" +vr_wofs_2h_fxd_oz_16 "-0.4" +vr_wofs_2h_fxd_oz_17 "0" vr_wofs_2h_fxd_oz_18 "0.0" vr_wofs_2h_fxd_oz_19 "0.0" vr_wofs_2h_fxd_oz_20 "0.0" @@ -568,19 +616,19 @@ vr_wofs_2h_hand_av_02 "48" vr_wofs_2h_hand_av_03 "29" vr_wofs_2h_hand_av_04 "51" vr_wofs_2h_hand_av_05 "94" -vr_wofs_2h_hand_av_06 "57" +vr_wofs_2h_hand_av_06 "15" vr_wofs_2h_hand_av_07 "3" -vr_wofs_2h_hand_av_08 "208" +vr_wofs_2h_hand_av_08 "230" vr_wofs_2h_hand_av_09 "3" -vr_wofs_2h_hand_av_10 "19" -vr_wofs_2h_hand_av_11 "57" -vr_wofs_2h_hand_av_12 "0.0" -vr_wofs_2h_hand_av_13 "0.0" -vr_wofs_2h_hand_av_14 "0.0" -vr_wofs_2h_hand_av_15 "0.0" -vr_wofs_2h_hand_av_16 "0.0" +vr_wofs_2h_hand_av_10 "4" +vr_wofs_2h_hand_av_11 "15" +vr_wofs_2h_hand_av_12 "51" +vr_wofs_2h_hand_av_13 "94" +vr_wofs_2h_hand_av_14 "15" +vr_wofs_2h_hand_av_15 "3" +vr_wofs_2h_hand_av_16 "203" vr_wofs_2h_hand_av_17 "0.0" -vr_wofs_2h_hand_av_18 "0.0" +vr_wofs_2h_hand_av_18 "0" vr_wofs_2h_hand_av_19 "0.0" vr_wofs_2h_hand_av_20 "0.0" vr_wofs_2h_hand_av_21 "0.0" @@ -633,7 +681,7 @@ vr_wofs_2h_pitch_03 "0.0" vr_wofs_2h_pitch_04 "0.0" vr_wofs_2h_pitch_05 "0.0" vr_wofs_2h_pitch_06 "0.0" -vr_wofs_2h_pitch_07 "0" +vr_wofs_2h_pitch_07 "4.8" vr_wofs_2h_pitch_08 "0.0" vr_wofs_2h_pitch_09 "0.0" vr_wofs_2h_pitch_10 "0" @@ -641,7 +689,7 @@ vr_wofs_2h_pitch_11 "0.0" vr_wofs_2h_pitch_12 "0.0" vr_wofs_2h_pitch_13 "0.0" vr_wofs_2h_pitch_14 "0.0" -vr_wofs_2h_pitch_15 "0.0" +vr_wofs_2h_pitch_15 "4.8" vr_wofs_2h_pitch_16 "0.0" vr_wofs_2h_pitch_17 "0.0" vr_wofs_2h_pitch_18 "0.0" @@ -702,11 +750,11 @@ vr_wofs_2h_x_08 "0" vr_wofs_2h_x_09 "0.0" vr_wofs_2h_x_10 "0.000001" vr_wofs_2h_x_11 "0.0" -vr_wofs_2h_x_12 "0.0" -vr_wofs_2h_x_13 "0.0" +vr_wofs_2h_x_12 "0" +vr_wofs_2h_x_13 "0.8" vr_wofs_2h_x_14 "0.0" vr_wofs_2h_x_15 "0.0" -vr_wofs_2h_x_16 "0.0" +vr_wofs_2h_x_16 "0" vr_wofs_2h_x_17 "0.0" vr_wofs_2h_x_18 "0.0" vr_wofs_2h_x_19 "0.0" @@ -735,7 +783,7 @@ vr_wofs_2h_y_09 "0.0" vr_wofs_2h_y_10 "-1.6" vr_wofs_2h_y_11 "0.0" vr_wofs_2h_y_12 "0.0" -vr_wofs_2h_y_13 "0.0" +vr_wofs_2h_y_13 "1.8" vr_wofs_2h_y_14 "0.0" vr_wofs_2h_y_15 "0.0" vr_wofs_2h_y_16 "0.0" @@ -759,19 +807,19 @@ vr_wofs_2h_yaw_01 "0.0" vr_wofs_2h_yaw_02 "0.0" vr_wofs_2h_yaw_03 "0.0" vr_wofs_2h_yaw_04 "0.0" -vr_wofs_2h_yaw_05 "0.0" +vr_wofs_2h_yaw_05 "6" vr_wofs_2h_yaw_06 "0.0" vr_wofs_2h_yaw_07 "0" -vr_wofs_2h_yaw_08 "0.0" +vr_wofs_2h_yaw_08 "-9.399998" vr_wofs_2h_yaw_09 "0.0" vr_wofs_2h_yaw_10 "0" vr_wofs_2h_yaw_11 "0.0" vr_wofs_2h_yaw_12 "0.0" -vr_wofs_2h_yaw_13 "0.0" +vr_wofs_2h_yaw_13 "6" vr_wofs_2h_yaw_14 "0.0" -vr_wofs_2h_yaw_15 "0.0" -vr_wofs_2h_yaw_16 "0.0" -vr_wofs_2h_yaw_17 "0.0" +vr_wofs_2h_yaw_15 "0" +vr_wofs_2h_yaw_16 "-9.399999" +vr_wofs_2h_yaw_17 "-0.000001" vr_wofs_2h_yaw_18 "0.0" vr_wofs_2h_yaw_19 "0.0" vr_wofs_2h_yaw_20 "0.0" @@ -799,10 +847,10 @@ vr_wofs_2h_z_09 "0.0" vr_wofs_2h_z_10 "-1" vr_wofs_2h_z_11 "2" vr_wofs_2h_z_12 "0.0" -vr_wofs_2h_z_13 "0.0" -vr_wofs_2h_z_14 "0.0" -vr_wofs_2h_z_15 "0.0" -vr_wofs_2h_z_16 "0.0" +vr_wofs_2h_z_13 "-3.4" +vr_wofs_2h_z_14 "2" +vr_wofs_2h_z_15 "1.8" +vr_wofs_2h_z_16 "1" vr_wofs_2h_z_17 "0.0" vr_wofs_2h_z_18 "0.0" vr_wofs_2h_z_19 "0.0" @@ -947,9 +995,9 @@ vr_wofs_gunoff_z_29 "0.0" vr_wofs_gunoff_z_30 "0.0" vr_wofs_gunoff_z_31 "0.0" vr_wofs_gunoff_z_32 "0.0" -vr_wofs_hand_av_01 "3" +vr_wofs_hand_av_01 "2" vr_wofs_hand_av_02 "165" -vr_wofs_hand_av_03 "54" +vr_wofs_hand_av_03 "65" vr_wofs_hand_av_04 "5" vr_wofs_hand_av_05 "28" vr_wofs_hand_av_06 "33" @@ -958,11 +1006,11 @@ vr_wofs_hand_av_08 "57" vr_wofs_hand_av_09 "0.0" vr_wofs_hand_av_10 "4" vr_wofs_hand_av_11 "33" -vr_wofs_hand_av_12 "0.0" -vr_wofs_hand_av_13 "0.0" -vr_wofs_hand_av_14 "0.0" -vr_wofs_hand_av_15 "0.0" -vr_wofs_hand_av_16 "0.0" +vr_wofs_hand_av_12 "5" +vr_wofs_hand_av_13 "44" +vr_wofs_hand_av_14 "33" +vr_wofs_hand_av_15 "12" +vr_wofs_hand_av_16 "57" vr_wofs_hand_av_17 "0" vr_wofs_hand_av_18 "68" vr_wofs_hand_av_19 "0.0" @@ -979,24 +1027,24 @@ vr_wofs_hand_av_29 "0.0" vr_wofs_hand_av_30 "0.0" vr_wofs_hand_av_31 "0.0" vr_wofs_hand_av_32 "0.0" -vr_wofs_hand_x_01 "1.1" -vr_wofs_hand_x_02 "1.899994" -vr_wofs_hand_x_03 "3.1" -vr_wofs_hand_x_04 "-0.3" -vr_wofs_hand_x_05 "-1.4" +vr_wofs_hand_x_01 "3.4" +vr_wofs_hand_x_02 "2.399994" +vr_wofs_hand_x_03 "-3.25" +vr_wofs_hand_x_04 "0.8" +vr_wofs_hand_x_05 "-0.8" vr_wofs_hand_x_06 "0.4" -vr_wofs_hand_x_07 "1.300005" -vr_wofs_hand_x_08 "2.2" -vr_wofs_hand_x_09 "1.6" -vr_wofs_hand_x_10 "-17.100044" +vr_wofs_hand_x_07 "2.100005" +vr_wofs_hand_x_08 "2.4" +vr_wofs_hand_x_09 "1.9" +vr_wofs_hand_x_10 "-16.200041" vr_wofs_hand_x_11 "0.4" -vr_wofs_hand_x_12 "0.0" -vr_wofs_hand_x_13 "0.0" -vr_wofs_hand_x_14 "0.0" -vr_wofs_hand_x_15 "0.0" -vr_wofs_hand_x_16 "0.0" -vr_wofs_hand_x_17 "1.6" -vr_wofs_hand_x_18 "0.8" +vr_wofs_hand_x_12 "0.8" +vr_wofs_hand_x_13 "-0.8" +vr_wofs_hand_x_14 "0.4" +vr_wofs_hand_x_15 "2.100005" +vr_wofs_hand_x_16 "2.4" +vr_wofs_hand_x_17 "1.7" +vr_wofs_hand_x_18 "1.7" vr_wofs_hand_x_19 "0.0" vr_wofs_hand_x_20 "0.0" vr_wofs_hand_x_21 "0.0" @@ -1011,24 +1059,24 @@ vr_wofs_hand_x_29 "0.0" vr_wofs_hand_x_30 "0.0" vr_wofs_hand_x_31 "0.0" vr_wofs_hand_x_32 "0.0" -vr_wofs_hand_y_01 "-1.55" -vr_wofs_hand_y_02 "-3.1" -vr_wofs_hand_y_03 "-4.8" -vr_wofs_hand_y_04 "-8.299998" -vr_wofs_hand_y_05 "-6.7" -vr_wofs_hand_y_06 "-5.3" -vr_wofs_hand_y_07 "-9.900002" -vr_wofs_hand_y_08 "-7.199998" -vr_wofs_hand_y_09 "-5.9" -vr_wofs_hand_y_10 "-5.5" -vr_wofs_hand_y_11 "-5.3" -vr_wofs_hand_y_12 "0.0" -vr_wofs_hand_y_13 "0.0" -vr_wofs_hand_y_14 "0.0" -vr_wofs_hand_y_15 "0.0" -vr_wofs_hand_y_16 "0.0" +vr_wofs_hand_y_01 "0" +vr_wofs_hand_y_02 "0.2" +vr_wofs_hand_y_03 "1.1" +vr_wofs_hand_y_04 "-1.299998" +vr_wofs_hand_y_05 "0.2" +vr_wofs_hand_y_06 "-1.5" +vr_wofs_hand_y_07 "-0.8" +vr_wofs_hand_y_08 "0.700002" +vr_wofs_hand_y_09 "0" +vr_wofs_hand_y_10 "1.9" +vr_wofs_hand_y_11 "-1.5" +vr_wofs_hand_y_12 "-1.299998" +vr_wofs_hand_y_13 "0.2" +vr_wofs_hand_y_14 "-1.5" +vr_wofs_hand_y_15 "-0.8" +vr_wofs_hand_y_16 "0.700002" vr_wofs_hand_y_17 "-4.25" -vr_wofs_hand_y_18 "-6.5" +vr_wofs_hand_y_18 "-0.2" vr_wofs_hand_y_19 "0.0" vr_wofs_hand_y_20 "0.0" vr_wofs_hand_y_21 "0.0" @@ -1043,24 +1091,24 @@ vr_wofs_hand_y_29 "0.0" vr_wofs_hand_y_30 "0.0" vr_wofs_hand_y_31 "0.0" vr_wofs_hand_y_32 "0.0" -vr_wofs_hand_z_01 "-0.3" +vr_wofs_hand_z_01 "3.6" vr_wofs_hand_z_02 "0.7" -vr_wofs_hand_z_03 "2.5" -vr_wofs_hand_z_04 "0.3" -vr_wofs_hand_z_05 "2.5" -vr_wofs_hand_z_06 "1.9" +vr_wofs_hand_z_03 "1.25" +vr_wofs_hand_z_04 "0.1" +vr_wofs_hand_z_05 "2.6" +vr_wofs_hand_z_06 "2" vr_wofs_hand_z_07 "1" -vr_wofs_hand_z_08 "-1.65" -vr_wofs_hand_z_09 "5.2" +vr_wofs_hand_z_08 "-1.35" +vr_wofs_hand_z_09 "4.5" vr_wofs_hand_z_10 "10.3" -vr_wofs_hand_z_11 "1.9" -vr_wofs_hand_z_12 "0.0" -vr_wofs_hand_z_13 "0.0" -vr_wofs_hand_z_14 "0.0" -vr_wofs_hand_z_15 "0.0" -vr_wofs_hand_z_16 "0.0" +vr_wofs_hand_z_11 "2" +vr_wofs_hand_z_12 "0.1" +vr_wofs_hand_z_13 "2.6" +vr_wofs_hand_z_14 "2" +vr_wofs_hand_z_15 "1" +vr_wofs_hand_z_16 "-1.35" vr_wofs_hand_z_17 "2" -vr_wofs_hand_z_18 "1.4" +vr_wofs_hand_z_18 "1.1" vr_wofs_hand_z_19 "0.0" vr_wofs_hand_z_20 "0.0" vr_wofs_hand_z_21 "0.0" @@ -1088,7 +1136,7 @@ vr_wofs_hide_hand_10 "0.0" vr_wofs_hide_hand_11 "0.0" vr_wofs_hide_hand_12 "0.0" vr_wofs_hide_hand_13 "0.0" -vr_wofs_hide_hand_14 "0.0" +vr_wofs_hide_hand_14 "0" vr_wofs_hide_hand_15 "0.0" vr_wofs_hide_hand_16 "0.0" vr_wofs_hide_hand_17 "0" @@ -1171,24 +1219,56 @@ vr_wofs_length_29 "0.0" vr_wofs_length_30 "0.0" vr_wofs_length_31 "0.0" vr_wofs_length_32 "0.0" -vr_wofs_muzzle_x_01 "12.999997" -vr_wofs_muzzle_x_02 "24.29999" -vr_wofs_muzzle_x_03 "11.299999" -vr_wofs_muzzle_x_04 "13.799999" -vr_wofs_muzzle_x_05 "24" -vr_wofs_muzzle_x_06 "-0.6" -vr_wofs_muzzle_x_07 "35.400002" -vr_wofs_muzzle_x_08 "25.400005" -vr_wofs_muzzle_x_09 "6.4" -vr_wofs_muzzle_x_10 "100" -vr_wofs_muzzle_x_11 "-0.6" -vr_wofs_muzzle_x_12 "0.0" -vr_wofs_muzzle_x_13 "0.0" -vr_wofs_muzzle_x_14 "0.0" -vr_wofs_muzzle_x_15 "0.0" -vr_wofs_muzzle_x_16 "0.0" -vr_wofs_muzzle_x_17 "-7.8" -vr_wofs_muzzle_x_18 "23.29999" +vr_wofs_muzzle_av_01 "41" +vr_wofs_muzzle_av_02 "1" +vr_wofs_muzzle_av_03 "13" +vr_wofs_muzzle_av_04 "33" +vr_wofs_muzzle_av_05 "129" +vr_wofs_muzzle_av_06 "0.0" +vr_wofs_muzzle_av_07 "17" +vr_wofs_muzzle_av_08 "104" +vr_wofs_muzzle_av_09 "36" +vr_wofs_muzzle_av_10 "22" +vr_wofs_muzzle_av_11 "0.0" +vr_wofs_muzzle_av_12 "33" +vr_wofs_muzzle_av_13 "128" +vr_wofs_muzzle_av_14 "0.0" +vr_wofs_muzzle_av_15 "17" +vr_wofs_muzzle_av_16 "104" +vr_wofs_muzzle_av_17 "0" +vr_wofs_muzzle_av_18 "90" +vr_wofs_muzzle_av_19 "0.0" +vr_wofs_muzzle_av_20 "0.0" +vr_wofs_muzzle_av_21 "0.0" +vr_wofs_muzzle_av_22 "0.0" +vr_wofs_muzzle_av_23 "0.0" +vr_wofs_muzzle_av_24 "0.0" +vr_wofs_muzzle_av_25 "0.0" +vr_wofs_muzzle_av_26 "0.0" +vr_wofs_muzzle_av_27 "0.0" +vr_wofs_muzzle_av_28 "0.0" +vr_wofs_muzzle_av_29 "0.0" +vr_wofs_muzzle_av_30 "0.0" +vr_wofs_muzzle_av_31 "0.0" +vr_wofs_muzzle_av_32 "0.0" +vr_wofs_muzzle_x_01 "-0.700006" +vr_wofs_muzzle_x_02 "0.899979" +vr_wofs_muzzle_x_03 "0.499997" +vr_wofs_muzzle_x_04 "-0.000004" +vr_wofs_muzzle_x_05 "-0.000009" +vr_wofs_muzzle_x_06 "0" +vr_wofs_muzzle_x_07 "-0.000006" +vr_wofs_muzzle_x_08 "-0.000005" +vr_wofs_muzzle_x_09 "0" +vr_wofs_muzzle_x_10 "3.000157" +vr_wofs_muzzle_x_11 "0" +vr_wofs_muzzle_x_12 "-0.000004" +vr_wofs_muzzle_x_13 "-0.000009" +vr_wofs_muzzle_x_14 "0" +vr_wofs_muzzle_x_15 "-0.000006" +vr_wofs_muzzle_x_16 "-0.000005" +vr_wofs_muzzle_x_17 "-0.000001" +vr_wofs_muzzle_x_18 "1.59998" vr_wofs_muzzle_x_19 "0.0" vr_wofs_muzzle_x_20 "0.0" vr_wofs_muzzle_x_21 "0.0" @@ -1203,24 +1283,24 @@ vr_wofs_muzzle_x_29 "0.0" vr_wofs_muzzle_x_30 "0.0" vr_wofs_muzzle_x_31 "0.0" vr_wofs_muzzle_x_32 "0.0" -vr_wofs_muzzle_y_01 "3.4" -vr_wofs_muzzle_y_02 "3.7" -vr_wofs_muzzle_y_03 "3.4" -vr_wofs_muzzle_y_04 "6.4" -vr_wofs_muzzle_y_05 "12.699992" -vr_wofs_muzzle_y_06 "6.2" -vr_wofs_muzzle_y_07 "21.400005" -vr_wofs_muzzle_y_08 "17.49999" +vr_wofs_muzzle_y_01 "0" +vr_wofs_muzzle_y_02 "0.35" +vr_wofs_muzzle_y_03 "0.35" +vr_wofs_muzzle_y_04 "0.85" +vr_wofs_muzzle_y_05 "0.499991" +vr_wofs_muzzle_y_06 "0" +vr_wofs_muzzle_y_07 "-0.000003" +vr_wofs_muzzle_y_08 "-0.000014" vr_wofs_muzzle_y_09 "0.0" -vr_wofs_muzzle_y_10 "18.099993" -vr_wofs_muzzle_y_11 "6.2" -vr_wofs_muzzle_y_12 "0.0" -vr_wofs_muzzle_y_13 "0.0" -vr_wofs_muzzle_y_14 "0.0" -vr_wofs_muzzle_y_15 "0.0" -vr_wofs_muzzle_y_16 "0.0" -vr_wofs_muzzle_y_17 "6.8" -vr_wofs_muzzle_y_18 "16.000006" +vr_wofs_muzzle_y_10 "0.399987" +vr_wofs_muzzle_y_11 "0" +vr_wofs_muzzle_y_12 "0.85" +vr_wofs_muzzle_y_13 "0.499991" +vr_wofs_muzzle_y_14 "0" +vr_wofs_muzzle_y_15 "-0.000003" +vr_wofs_muzzle_y_16 "-0.000014" +vr_wofs_muzzle_y_17 "0" +vr_wofs_muzzle_y_18 "0.399997" vr_wofs_muzzle_y_19 "0.0" vr_wofs_muzzle_y_20 "0.0" vr_wofs_muzzle_y_21 "0.0" @@ -1235,24 +1315,24 @@ vr_wofs_muzzle_y_29 "0.0" vr_wofs_muzzle_y_30 "0.0" vr_wofs_muzzle_y_31 "0.0" vr_wofs_muzzle_y_32 "0.0" -vr_wofs_muzzle_z_01 "21.700006" -vr_wofs_muzzle_z_02 "-0.7" -vr_wofs_muzzle_z_03 "3.2" -vr_wofs_muzzle_z_04 "-2.1" -vr_wofs_muzzle_z_05 "-10.099995" -vr_wofs_muzzle_z_06 "-0.599996" -vr_wofs_muzzle_z_07 "-3.299994" -vr_wofs_muzzle_z_08 "8.999994" -vr_wofs_muzzle_z_09 "26" -vr_wofs_muzzle_z_10 "-55.599991" -vr_wofs_muzzle_z_11 "-0.600007" -vr_wofs_muzzle_z_12 "0.0" -vr_wofs_muzzle_z_13 "0.0" -vr_wofs_muzzle_z_14 "0.0" -vr_wofs_muzzle_z_15 "0.0" -vr_wofs_muzzle_z_16 "0.0" -vr_wofs_muzzle_z_17 "-4.999997" -vr_wofs_muzzle_z_18 "-0.6" +vr_wofs_muzzle_z_01 "-2.100002" +vr_wofs_muzzle_z_02 "0.6" +vr_wofs_muzzle_z_03 "-0.7" +vr_wofs_muzzle_z_04 "-0.9" +vr_wofs_muzzle_z_05 "-0.999995" +vr_wofs_muzzle_z_06 "0.000004" +vr_wofs_muzzle_z_07 "-1.299994" +vr_wofs_muzzle_z_08 "-0.500006" +vr_wofs_muzzle_z_09 "-2.60001" +vr_wofs_muzzle_z_10 "-1.500035" +vr_wofs_muzzle_z_11 "-0.000007" +vr_wofs_muzzle_z_12 "-0.9" +vr_wofs_muzzle_z_13 "-0.999995" +vr_wofs_muzzle_z_14 "0.000004" +vr_wofs_muzzle_z_15 "-1.299994" +vr_wofs_muzzle_z_16 "-0.500006" +vr_wofs_muzzle_z_17 "0.000003" +vr_wofs_muzzle_z_18 "1.2" vr_wofs_muzzle_z_19 "0.0" vr_wofs_muzzle_z_20 "0.0" vr_wofs_muzzle_z_21 "0.0" @@ -1267,103 +1347,7 @@ vr_wofs_muzzle_z_29 "0.0" vr_wofs_muzzle_z_30 "0.0" vr_wofs_muzzle_z_31 "0.0" vr_wofs_muzzle_z_32 "0.0" -vr_wofs_offhand_x_01 "-0.25" -vr_wofs_offhand_x_02 "0" -vr_wofs_offhand_x_03 "0.0" -vr_wofs_offhand_x_04 "0.0" -vr_wofs_offhand_x_05 "0" -vr_wofs_offhand_x_06 "0" -vr_wofs_offhand_x_07 "0.0" -vr_wofs_offhand_x_08 "0" -vr_wofs_offhand_x_09 "0.0" -vr_wofs_offhand_x_10 "0.0" -vr_wofs_offhand_x_11 "0.0" -vr_wofs_offhand_x_12 "0.0" -vr_wofs_offhand_x_13 "0.0" -vr_wofs_offhand_x_14 "0.0" -vr_wofs_offhand_x_15 "0.0" -vr_wofs_offhand_x_16 "0.0" -vr_wofs_offhand_x_17 "0.1" -vr_wofs_offhand_x_18 "0.0" -vr_wofs_offhand_x_19 "0.0" -vr_wofs_offhand_x_20 "0.0" -vr_wofs_offhand_x_21 "0.0" -vr_wofs_offhand_x_22 "0.0" -vr_wofs_offhand_x_23 "0.0" -vr_wofs_offhand_x_24 "0.0" -vr_wofs_offhand_x_25 "0.0" -vr_wofs_offhand_x_26 "0.0" -vr_wofs_offhand_x_27 "0.0" -vr_wofs_offhand_x_28 "0.0" -vr_wofs_offhand_x_29 "0.0" -vr_wofs_offhand_x_30 "0.0" -vr_wofs_offhand_x_31 "0.0" -vr_wofs_offhand_x_32 "0.0" -vr_wofs_offhand_y_01 "0.15" -vr_wofs_offhand_y_02 "0.4" -vr_wofs_offhand_y_03 "0.5" -vr_wofs_offhand_y_04 "0.4" -vr_wofs_offhand_y_05 "0.3" -vr_wofs_offhand_y_06 "0.3" -vr_wofs_offhand_y_07 "0.2" -vr_wofs_offhand_y_08 "0.5" -vr_wofs_offhand_y_09 "0.4" -vr_wofs_offhand_y_10 "0.4" -vr_wofs_offhand_y_11 "0.3" -vr_wofs_offhand_y_12 "0.0" -vr_wofs_offhand_y_13 "0.0" -vr_wofs_offhand_y_14 "0.0" -vr_wofs_offhand_y_15 "0.0" -vr_wofs_offhand_y_16 "0.0" -vr_wofs_offhand_y_17 "0.8" -vr_wofs_offhand_y_18 "0.2" -vr_wofs_offhand_y_19 "0.0" -vr_wofs_offhand_y_20 "0.0" -vr_wofs_offhand_y_21 "0.0" -vr_wofs_offhand_y_22 "0.0" -vr_wofs_offhand_y_23 "0.0" -vr_wofs_offhand_y_24 "0.0" -vr_wofs_offhand_y_25 "0.0" -vr_wofs_offhand_y_26 "0.0" -vr_wofs_offhand_y_27 "0.0" -vr_wofs_offhand_y_28 "0.0" -vr_wofs_offhand_y_29 "0.0" -vr_wofs_offhand_y_30 "0.0" -vr_wofs_offhand_y_31 "0.0" -vr_wofs_offhand_y_32 "0.0" -vr_wofs_offhand_z_01 "0.0" -vr_wofs_offhand_z_02 "0" -vr_wofs_offhand_z_03 "0.0" -vr_wofs_offhand_z_04 "0.0" -vr_wofs_offhand_z_05 "0.0" -vr_wofs_offhand_z_06 "0" -vr_wofs_offhand_z_07 "0" -vr_wofs_offhand_z_08 "0" -vr_wofs_offhand_z_09 "0.0" -vr_wofs_offhand_z_10 "0" -vr_wofs_offhand_z_11 "0" -vr_wofs_offhand_z_12 "0.0" -vr_wofs_offhand_z_13 "0.0" -vr_wofs_offhand_z_14 "0.0" -vr_wofs_offhand_z_15 "0.0" -vr_wofs_offhand_z_16 "0.0" -vr_wofs_offhand_z_17 "0" -vr_wofs_offhand_z_18 "0.0" -vr_wofs_offhand_z_19 "0.0" -vr_wofs_offhand_z_20 "0.0" -vr_wofs_offhand_z_21 "0.0" -vr_wofs_offhand_z_22 "0.0" -vr_wofs_offhand_z_23 "0.0" -vr_wofs_offhand_z_24 "0.0" -vr_wofs_offhand_z_25 "0.0" -vr_wofs_offhand_z_26 "0.0" -vr_wofs_offhand_z_27 "0.0" -vr_wofs_offhand_z_28 "0.0" -vr_wofs_offhand_z_29 "0.0" -vr_wofs_offhand_z_30 "0.0" -vr_wofs_offhand_z_31 "0.0" -vr_wofs_offhand_z_32 "0.0" -vr_wofs_pitch_01 "-8" +vr_wofs_pitch_01 "0" vr_wofs_pitch_02 "-6" vr_wofs_pitch_03 "-8" vr_wofs_pitch_04 "-5" @@ -1374,11 +1358,11 @@ vr_wofs_pitch_08 "-7" vr_wofs_pitch_09 "-8" vr_wofs_pitch_10 "-5.5" vr_wofs_pitch_11 "-8.5" -vr_wofs_pitch_12 "0.0" -vr_wofs_pitch_13 "0.0" -vr_wofs_pitch_14 "0.0" -vr_wofs_pitch_15 "0.0" -vr_wofs_pitch_16 "0.0" +vr_wofs_pitch_12 "-5" +vr_wofs_pitch_13 "-6.5" +vr_wofs_pitch_14 "-8.5" +vr_wofs_pitch_15 "-4.5" +vr_wofs_pitch_16 "-7" vr_wofs_pitch_17 "-8.500001" vr_wofs_pitch_18 "-4.8" vr_wofs_pitch_19 "0.0" @@ -1395,7 +1379,7 @@ vr_wofs_pitch_29 "0.0" vr_wofs_pitch_30 "0.0" vr_wofs_pitch_31 "0.0" vr_wofs_pitch_32 "0.0" -vr_wofs_roll_01 "-2.4" +vr_wofs_roll_01 "0" vr_wofs_roll_02 "0" vr_wofs_roll_03 "0.0" vr_wofs_roll_04 "0.0" @@ -1438,11 +1422,11 @@ vr_wofs_scale_08 "0.35" vr_wofs_scale_09 "0.34" vr_wofs_scale_10 "0.34" vr_wofs_scale_11 "0.38" -vr_wofs_scale_12 "0.5" -vr_wofs_scale_13 "0.5" -vr_wofs_scale_14 "0.5" -vr_wofs_scale_15 "0.5" -vr_wofs_scale_16 "0.5" +vr_wofs_scale_12 "0.48" +vr_wofs_scale_13 "0.38" +vr_wofs_scale_14 "0.38" +vr_wofs_scale_15 "0.34" +vr_wofs_scale_16 "0.35" vr_wofs_scale_17 "0.34" vr_wofs_scale_18 "0.33" vr_wofs_scale_19 "0.5" @@ -1535,8 +1519,8 @@ vr_wofs_w_dirmult_09 "1.0" vr_wofs_w_dirmult_10 "0.4" vr_wofs_w_dirmult_11 "0.95" vr_wofs_w_dirmult_12 "1.0" -vr_wofs_w_dirmult_13 "1.0" -vr_wofs_w_dirmult_14 "1.0" +vr_wofs_w_dirmult_13 "0.73" +vr_wofs_w_dirmult_14 "0.95" vr_wofs_w_dirmult_15 "1.0" vr_wofs_w_dirmult_16 "1.0" vr_wofs_w_dirmult_17 "1.0" @@ -1567,8 +1551,8 @@ vr_wofs_w_htvelmult_09 "1.0" vr_wofs_w_htvelmult_10 "1.0" vr_wofs_w_htvelmult_11 "1.0" vr_wofs_w_htvelmult_12 "1.0" -vr_wofs_w_htvelmult_13 "1.0" -vr_wofs_w_htvelmult_14 "1.0" +vr_wofs_w_htvelmult_13 "0.9" +vr_wofs_w_htvelmult_14 "0.95" vr_wofs_w_htvelmult_15 "1.0" vr_wofs_w_htvelmult_16 "1.0" vr_wofs_w_htvelmult_17 "1.0" @@ -1599,8 +1583,8 @@ vr_wofs_w_hvelmult_09 "1.0" vr_wofs_w_hvelmult_10 "1.0" vr_wofs_w_hvelmult_11 "0.95" vr_wofs_w_hvelmult_12 "1.0" -vr_wofs_w_hvelmult_13 "1.0" -vr_wofs_w_hvelmult_14 "1.0" +vr_wofs_w_hvelmult_13 "0.95" +vr_wofs_w_hvelmult_14 "0.95" vr_wofs_w_hvelmult_15 "1.0" vr_wofs_w_hvelmult_16 "1.0" vr_wofs_w_hvelmult_17 "1.0" @@ -1631,8 +1615,8 @@ vr_wofs_w_posmult_09 "1.0" vr_wofs_w_posmult_10 "0.95" vr_wofs_w_posmult_11 "0.95" vr_wofs_w_posmult_12 "1.0" -vr_wofs_w_posmult_13 "1.0" -vr_wofs_w_posmult_14 "1.0" +vr_wofs_w_posmult_13 "0.73" +vr_wofs_w_posmult_14 "0.95" vr_wofs_w_posmult_15 "1.0" vr_wofs_w_posmult_16 "1.0" vr_wofs_w_posmult_17 "1.0" @@ -1662,11 +1646,11 @@ vr_wofs_weight_08 "0.8" vr_wofs_weight_09 "0.78" vr_wofs_weight_10 "0.96" vr_wofs_weight_11 "0.82" -vr_wofs_weight_12 "0.0" -vr_wofs_weight_13 "0.0" -vr_wofs_weight_14 "0.0" -vr_wofs_weight_15 "0.0" -vr_wofs_weight_16 "0.0" +vr_wofs_weight_12 "0.65" +vr_wofs_weight_13 "0.76" +vr_wofs_weight_14 "0.82" +vr_wofs_weight_15 "0.9" +vr_wofs_weight_16 "0.8" vr_wofs_weight_17 "0" vr_wofs_weight_18 "0.4" vr_wofs_weight_19 "0.0" @@ -1683,24 +1667,280 @@ vr_wofs_weight_29 "0.0" vr_wofs_weight_30 "0.0" vr_wofs_weight_31 "0.0" vr_wofs_weight_32 "0.0" -vr_wofs_x_01 "-0.1" -vr_wofs_x_02 "1.300001" -vr_wofs_x_03 "6.799997" -vr_wofs_x_04 "4.6" -vr_wofs_x_05 "2.0" -vr_wofs_x_06 "11.100022" -vr_wofs_x_07 "7.40001" -vr_wofs_x_08 "3" -vr_wofs_x_09 "1.6" -vr_wofs_x_10 "-0.4" +vr_wofs_wpnbtn_av_01 "0" +vr_wofs_wpnbtn_av_02 "0" +vr_wofs_wpnbtn_av_03 "0.0" +vr_wofs_wpnbtn_av_04 "97" +vr_wofs_wpnbtn_av_05 "28" +vr_wofs_wpnbtn_av_06 "33" +vr_wofs_wpnbtn_av_07 "12" +vr_wofs_wpnbtn_av_08 "57" +vr_wofs_wpnbtn_av_09 "0.0" +vr_wofs_wpnbtn_av_10 "0.0" +vr_wofs_wpnbtn_av_11 "0.0" +vr_wofs_wpnbtn_av_12 "97" +vr_wofs_wpnbtn_av_13 "44" +vr_wofs_wpnbtn_av_14 "33" +vr_wofs_wpnbtn_av_15 "12" +vr_wofs_wpnbtn_av_16 "57" +vr_wofs_wpnbtn_av_17 "0.0" +vr_wofs_wpnbtn_av_18 "0.0" +vr_wofs_wpnbtn_av_19 "0.0" +vr_wofs_wpnbtn_av_20 "0.0" +vr_wofs_wpnbtn_av_21 "0.0" +vr_wofs_wpnbtn_av_22 "0.0" +vr_wofs_wpnbtn_av_23 "0.0" +vr_wofs_wpnbtn_av_24 "0.0" +vr_wofs_wpnbtn_av_25 "0.0" +vr_wofs_wpnbtn_av_26 "0.0" +vr_wofs_wpnbtn_av_27 "0.0" +vr_wofs_wpnbtn_av_28 "0.0" +vr_wofs_wpnbtn_av_29 "0.0" +vr_wofs_wpnbtn_av_30 "0.0" +vr_wofs_wpnbtn_av_31 "0.0" +vr_wofs_wpnbtn_av_32 "0.0" +vr_wofs_wpnbtn_pitch_01 "0.0" +vr_wofs_wpnbtn_pitch_02 "0.0" +vr_wofs_wpnbtn_pitch_03 "0.0" +vr_wofs_wpnbtn_pitch_04 "0.0" +vr_wofs_wpnbtn_pitch_05 "0.0" +vr_wofs_wpnbtn_pitch_06 "0.0" +vr_wofs_wpnbtn_pitch_07 "0.0" +vr_wofs_wpnbtn_pitch_08 "0.0" +vr_wofs_wpnbtn_pitch_09 "0.0" +vr_wofs_wpnbtn_pitch_10 "0.0" +vr_wofs_wpnbtn_pitch_11 "0.0" +vr_wofs_wpnbtn_pitch_12 "0.0" +vr_wofs_wpnbtn_pitch_13 "0.0" +vr_wofs_wpnbtn_pitch_14 "0.0" +vr_wofs_wpnbtn_pitch_15 "0.0" +vr_wofs_wpnbtn_pitch_16 "0.0" +vr_wofs_wpnbtn_pitch_17 "0.0" +vr_wofs_wpnbtn_pitch_18 "0.0" +vr_wofs_wpnbtn_pitch_19 "0.0" +vr_wofs_wpnbtn_pitch_20 "0.0" +vr_wofs_wpnbtn_pitch_21 "0.0" +vr_wofs_wpnbtn_pitch_22 "0.0" +vr_wofs_wpnbtn_pitch_23 "0.0" +vr_wofs_wpnbtn_pitch_24 "0.0" +vr_wofs_wpnbtn_pitch_25 "0.0" +vr_wofs_wpnbtn_pitch_26 "0.0" +vr_wofs_wpnbtn_pitch_27 "0.0" +vr_wofs_wpnbtn_pitch_28 "0.0" +vr_wofs_wpnbtn_pitch_29 "0.0" +vr_wofs_wpnbtn_pitch_30 "0.0" +vr_wofs_wpnbtn_pitch_31 "0.0" +vr_wofs_wpnbtn_pitch_32 "0.0" +vr_wofs_wpnbtn_roll_01 "0.0" +vr_wofs_wpnbtn_roll_02 "0.0" +vr_wofs_wpnbtn_roll_03 "0.0" +vr_wofs_wpnbtn_roll_04 "0.0" +vr_wofs_wpnbtn_roll_05 "-65.399933" +vr_wofs_wpnbtn_roll_06 "56.999977" +vr_wofs_wpnbtn_roll_07 "32.400013" +vr_wofs_wpnbtn_roll_08 "0.0" +vr_wofs_wpnbtn_roll_09 "0.0" +vr_wofs_wpnbtn_roll_10 "0.0" +vr_wofs_wpnbtn_roll_11 "0.0" +vr_wofs_wpnbtn_roll_12 "0.0" +vr_wofs_wpnbtn_roll_13 "-65.399933" +vr_wofs_wpnbtn_roll_14 "56.999962" +vr_wofs_wpnbtn_roll_15 "32.400013" +vr_wofs_wpnbtn_roll_16 "0.0" +vr_wofs_wpnbtn_roll_17 "0.0" +vr_wofs_wpnbtn_roll_18 "0.0" +vr_wofs_wpnbtn_roll_19 "0.0" +vr_wofs_wpnbtn_roll_20 "0.0" +vr_wofs_wpnbtn_roll_21 "0.0" +vr_wofs_wpnbtn_roll_22 "0.0" +vr_wofs_wpnbtn_roll_23 "0.0" +vr_wofs_wpnbtn_roll_24 "0.0" +vr_wofs_wpnbtn_roll_25 "0.0" +vr_wofs_wpnbtn_roll_26 "0.0" +vr_wofs_wpnbtn_roll_27 "0.0" +vr_wofs_wpnbtn_roll_28 "0.0" +vr_wofs_wpnbtn_roll_29 "0.0" +vr_wofs_wpnbtn_roll_30 "0.0" +vr_wofs_wpnbtn_roll_31 "0.0" +vr_wofs_wpnbtn_roll_32 "0.0" +vr_wofs_wpnbtn_x_01 "0.0" +vr_wofs_wpnbtn_x_02 "-7.9" +vr_wofs_wpnbtn_x_03 "0.0" +vr_wofs_wpnbtn_x_04 "1.6" +vr_wofs_wpnbtn_x_05 "-1.6" +vr_wofs_wpnbtn_x_06 "-0.2" +vr_wofs_wpnbtn_x_07 "1.8" +vr_wofs_wpnbtn_x_08 "5.4" +vr_wofs_wpnbtn_x_09 "0.0" +vr_wofs_wpnbtn_x_10 "0.0" +vr_wofs_wpnbtn_x_11 "0.0" +vr_wofs_wpnbtn_x_12 "1.6" +vr_wofs_wpnbtn_x_13 "-1.6" +vr_wofs_wpnbtn_x_14 "-0.2" +vr_wofs_wpnbtn_x_15 "1.8" +vr_wofs_wpnbtn_x_16 "5.4" +vr_wofs_wpnbtn_x_17 "0.0" +vr_wofs_wpnbtn_x_18 "0.0" +vr_wofs_wpnbtn_x_19 "0.0" +vr_wofs_wpnbtn_x_20 "0.0" +vr_wofs_wpnbtn_x_21 "0.0" +vr_wofs_wpnbtn_x_22 "0.0" +vr_wofs_wpnbtn_x_23 "0.0" +vr_wofs_wpnbtn_x_24 "0.0" +vr_wofs_wpnbtn_x_25 "0.0" +vr_wofs_wpnbtn_x_26 "0.0" +vr_wofs_wpnbtn_x_27 "0.0" +vr_wofs_wpnbtn_x_28 "0.0" +vr_wofs_wpnbtn_x_29 "0.0" +vr_wofs_wpnbtn_x_30 "0.0" +vr_wofs_wpnbtn_x_31 "0.0" +vr_wofs_wpnbtn_x_32 "0.0" +vr_wofs_wpnbtn_y_01 "0.0" +vr_wofs_wpnbtn_y_02 "-2.0" +vr_wofs_wpnbtn_y_03 "0.0" +vr_wofs_wpnbtn_y_04 "-0.45" +vr_wofs_wpnbtn_y_05 "1.500001" +vr_wofs_wpnbtn_y_06 "-2.9" +vr_wofs_wpnbtn_y_07 "-1.5" +vr_wofs_wpnbtn_y_08 "-0.7" +vr_wofs_wpnbtn_y_09 "0.0" +vr_wofs_wpnbtn_y_10 "0.0" +vr_wofs_wpnbtn_y_11 "0.0" +vr_wofs_wpnbtn_y_12 "-0.45" +vr_wofs_wpnbtn_y_13 "1.500001" +vr_wofs_wpnbtn_y_14 "-2.9" +vr_wofs_wpnbtn_y_15 "-1.5" +vr_wofs_wpnbtn_y_16 "-0.7" +vr_wofs_wpnbtn_y_17 "0.0" +vr_wofs_wpnbtn_y_18 "0.0" +vr_wofs_wpnbtn_y_19 "0.0" +vr_wofs_wpnbtn_y_20 "0.0" +vr_wofs_wpnbtn_y_21 "0.0" +vr_wofs_wpnbtn_y_22 "0.0" +vr_wofs_wpnbtn_y_23 "0.0" +vr_wofs_wpnbtn_y_24 "0.0" +vr_wofs_wpnbtn_y_25 "0.0" +vr_wofs_wpnbtn_y_26 "0.0" +vr_wofs_wpnbtn_y_27 "0.0" +vr_wofs_wpnbtn_y_28 "0.0" +vr_wofs_wpnbtn_y_29 "0.0" +vr_wofs_wpnbtn_y_30 "0.0" +vr_wofs_wpnbtn_y_31 "0.0" +vr_wofs_wpnbtn_y_32 "0.0" +vr_wofs_wpnbtn_yaw_01 "0.0" +vr_wofs_wpnbtn_yaw_02 "0.0" +vr_wofs_wpnbtn_yaw_03 "0.0" +vr_wofs_wpnbtn_yaw_04 "0.0" +vr_wofs_wpnbtn_yaw_05 "0.0" +vr_wofs_wpnbtn_yaw_06 "0.0" +vr_wofs_wpnbtn_yaw_07 "0.0" +vr_wofs_wpnbtn_yaw_08 "0.0" +vr_wofs_wpnbtn_yaw_09 "0.0" +vr_wofs_wpnbtn_yaw_10 "0.0" +vr_wofs_wpnbtn_yaw_11 "0.0" +vr_wofs_wpnbtn_yaw_12 "0.0" +vr_wofs_wpnbtn_yaw_13 "0.0" +vr_wofs_wpnbtn_yaw_14 "0.0" +vr_wofs_wpnbtn_yaw_15 "0.0" +vr_wofs_wpnbtn_yaw_16 "0.0" +vr_wofs_wpnbtn_yaw_17 "0.0" +vr_wofs_wpnbtn_yaw_18 "0.0" +vr_wofs_wpnbtn_yaw_19 "0.0" +vr_wofs_wpnbtn_yaw_20 "0.0" +vr_wofs_wpnbtn_yaw_21 "0.0" +vr_wofs_wpnbtn_yaw_22 "0.0" +vr_wofs_wpnbtn_yaw_23 "0.0" +vr_wofs_wpnbtn_yaw_24 "0.0" +vr_wofs_wpnbtn_yaw_25 "0.0" +vr_wofs_wpnbtn_yaw_26 "0.0" +vr_wofs_wpnbtn_yaw_27 "0.0" +vr_wofs_wpnbtn_yaw_28 "0.0" +vr_wofs_wpnbtn_yaw_29 "0.0" +vr_wofs_wpnbtn_yaw_30 "0.0" +vr_wofs_wpnbtn_yaw_31 "0.0" +vr_wofs_wpnbtn_yaw_32 "0.0" +vr_wofs_wpnbtn_z_01 "0.0" +vr_wofs_wpnbtn_z_02 "1" +vr_wofs_wpnbtn_z_03 "0.0" +vr_wofs_wpnbtn_z_04 "-0.2" +vr_wofs_wpnbtn_z_05 "3" +vr_wofs_wpnbtn_z_06 "1.8" +vr_wofs_wpnbtn_z_07 "1.3" +vr_wofs_wpnbtn_z_08 "-1" +vr_wofs_wpnbtn_z_09 "0.0" +vr_wofs_wpnbtn_z_10 "0.0" +vr_wofs_wpnbtn_z_11 "0.0" +vr_wofs_wpnbtn_z_12 "-0.2" +vr_wofs_wpnbtn_z_13 "3" +vr_wofs_wpnbtn_z_14 "1.8" +vr_wofs_wpnbtn_z_15 "1.3" +vr_wofs_wpnbtn_z_16 "-1" +vr_wofs_wpnbtn_z_17 "0.0" +vr_wofs_wpnbtn_z_18 "0.0" +vr_wofs_wpnbtn_z_19 "0.0" +vr_wofs_wpnbtn_z_20 "0.0" +vr_wofs_wpnbtn_z_21 "0.0" +vr_wofs_wpnbtn_z_22 "0.0" +vr_wofs_wpnbtn_z_23 "0.0" +vr_wofs_wpnbtn_z_24 "0.0" +vr_wofs_wpnbtn_z_25 "0.0" +vr_wofs_wpnbtn_z_26 "0.0" +vr_wofs_wpnbtn_z_27 "0.0" +vr_wofs_wpnbtn_z_28 "0.0" +vr_wofs_wpnbtn_z_29 "0.0" +vr_wofs_wpnbtn_z_30 "0.0" +vr_wofs_wpnbtn_z_31 "0.0" +vr_wofs_wpnbtn_z_32 "0.0" +vr_wofs_wpnbtnmode_01 "0" +vr_wofs_wpnbtnmode_02 "0" +vr_wofs_wpnbtnmode_03 "0.0" +vr_wofs_wpnbtnmode_04 "1" +vr_wofs_wpnbtnmode_05 "1" +vr_wofs_wpnbtnmode_06 "1" +vr_wofs_wpnbtnmode_07 "1" +vr_wofs_wpnbtnmode_08 "1" +vr_wofs_wpnbtnmode_09 "0.0" +vr_wofs_wpnbtnmode_10 "0.0" +vr_wofs_wpnbtnmode_11 "0.0" +vr_wofs_wpnbtnmode_12 "1" +vr_wofs_wpnbtnmode_13 "1" +vr_wofs_wpnbtnmode_14 "1" +vr_wofs_wpnbtnmode_15 "1" +vr_wofs_wpnbtnmode_16 "1" +vr_wofs_wpnbtnmode_17 "0.0" +vr_wofs_wpnbtnmode_18 "0.0" +vr_wofs_wpnbtnmode_19 "0.0" +vr_wofs_wpnbtnmode_20 "0.0" +vr_wofs_wpnbtnmode_21 "0.0" +vr_wofs_wpnbtnmode_22 "0.0" +vr_wofs_wpnbtnmode_23 "0.0" +vr_wofs_wpnbtnmode_24 "0.0" +vr_wofs_wpnbtnmode_25 "0.0" +vr_wofs_wpnbtnmode_26 "0.0" +vr_wofs_wpnbtnmode_27 "0.0" +vr_wofs_wpnbtnmode_28 "0.0" +vr_wofs_wpnbtnmode_29 "0.0" +vr_wofs_wpnbtnmode_30 "0.0" +vr_wofs_wpnbtnmode_31 "0.0" +vr_wofs_wpnbtnmode_32 "0.0" +vr_wofs_x_01 "-0.6" +vr_wofs_x_02 "0.950001" +vr_wofs_x_03 "6.099997" +vr_wofs_x_04 "3.6" +vr_wofs_x_05 "1.3" +vr_wofs_x_06 "11.100024" +vr_wofs_x_07 "6.60001" +vr_wofs_x_08 "2.25" +vr_wofs_x_09 "1.2" +vr_wofs_x_10 "-1.4" vr_wofs_x_11 "11.099998" -vr_wofs_x_12 "-5" -vr_wofs_x_13 "0" -vr_wofs_x_14 "10" -vr_wofs_x_15 "10" -vr_wofs_x_16 "3" -vr_wofs_x_17 "2.25" -vr_wofs_x_18 "-1.45" +vr_wofs_x_12 "3.6" +vr_wofs_x_13 "1.05" +vr_wofs_x_14 "11.000022" +vr_wofs_x_15 "6.50001" +vr_wofs_x_16 "2.25" +vr_wofs_x_17 "0.0" +vr_wofs_x_18 "-2.15" vr_wofs_x_19 "1.5" vr_wofs_x_20 "1.5" vr_wofs_x_21 "1.5" @@ -1716,23 +1956,23 @@ vr_wofs_x_30 "1.5" vr_wofs_x_31 "1.5" vr_wofs_x_32 "1.5" vr_wofs_y_01 "1.1" -vr_wofs_y_02 "1.600002" -vr_wofs_y_03 "1.65" -vr_wofs_y_04 "3.1" -vr_wofs_y_05 "4.9" -vr_wofs_y_06 "2.4" -vr_wofs_y_07 "7.25" -vr_wofs_y_08 "6.15" -vr_wofs_y_09 "3.45" -vr_wofs_y_10 "6.1" -vr_wofs_y_11 "2.4" -vr_wofs_y_12 "3" -vr_wofs_y_13 "3" -vr_wofs_y_14 "1.5" -vr_wofs_y_15 "7" -vr_wofs_y_16 "4" -vr_wofs_y_17 "2.45" -vr_wofs_y_18 "5.25" +vr_wofs_y_02 "1.350002" +vr_wofs_y_03 "1.35" +vr_wofs_y_04 "2.75" +vr_wofs_y_05 "4.55" +vr_wofs_y_06 "2.25" +vr_wofs_y_07 "7.1" +vr_wofs_y_08 "6.05" +vr_wofs_y_09 "3.2" +vr_wofs_y_10 "5.9" +vr_wofs_y_11 "2.25" +vr_wofs_y_12 "2.75" +vr_wofs_y_13 "4.55" +vr_wofs_y_14 "2.25" +vr_wofs_y_15 "7.05" +vr_wofs_y_16 "6.05" +vr_wofs_y_17 "0.0" +vr_wofs_y_18 "5" vr_wofs_y_19 "1" vr_wofs_y_20 "1" vr_wofs_y_21 "1" @@ -1747,7 +1987,7 @@ vr_wofs_y_29 "1" vr_wofs_y_30 "1" vr_wofs_y_31 "1" vr_wofs_y_32 "1" -vr_wofs_yaw_01 "-2.7" +vr_wofs_yaw_01 "0.79998" vr_wofs_yaw_02 "0" vr_wofs_yaw_03 "0" vr_wofs_yaw_04 "0.0" @@ -1760,9 +2000,9 @@ vr_wofs_yaw_10 "0" vr_wofs_yaw_11 "0.5" vr_wofs_yaw_12 "0.0" vr_wofs_yaw_13 "0.0" -vr_wofs_yaw_14 "0.0" -vr_wofs_yaw_15 "0.0" -vr_wofs_yaw_16 "0.0" +vr_wofs_yaw_14 "0.5" +vr_wofs_yaw_15 "0.5" +vr_wofs_yaw_16 "0" vr_wofs_yaw_17 "0" vr_wofs_yaw_18 "0.0" vr_wofs_yaw_19 "0.0" @@ -1779,24 +2019,24 @@ vr_wofs_yaw_29 "0.0" vr_wofs_yaw_30 "0.0" vr_wofs_yaw_31 "0.0" vr_wofs_yaw_32 "0.0" -vr_wofs_z_01 "-0.6" -vr_wofs_z_02 "0.599979" -vr_wofs_z_03 "-1.300011" -vr_wofs_z_04 "1.199975" -vr_wofs_z_05 "2.75" -vr_wofs_z_06 "-1.000028" -vr_wofs_z_07 "0.499956" -vr_wofs_z_08 "-3.1" -vr_wofs_z_09 "-1.35" -vr_wofs_z_10 "13.199994" -vr_wofs_z_11 "-1" -vr_wofs_z_12 "15" -vr_wofs_z_13 "19" -vr_wofs_z_14 "13" -vr_wofs_z_15 "19" -vr_wofs_z_16 "13" -vr_wofs_z_17 "-1.1" -vr_wofs_z_18 "-0.45" +vr_wofs_z_01 "-0.8" +vr_wofs_z_02 "-0.050021" +vr_wofs_z_03 "-2.350011" +vr_wofs_z_04 "0.799975" +vr_wofs_z_05 "2.05" +vr_wofs_z_06 "-1.850028" +vr_wofs_z_07 "-0.350044" +vr_wofs_z_08 "-3.95" +vr_wofs_z_09 "-1.45" +vr_wofs_z_10 "12.299991" +vr_wofs_z_11 "-1.85" +vr_wofs_z_12 "0.799975" +vr_wofs_z_13 "2.05" +vr_wofs_z_14 "-1.950028" +vr_wofs_z_15 "-0.350044" +vr_wofs_z_16 "-3.95" +vr_wofs_z_17 "0.0" +vr_wofs_z_18 "-0.9" vr_wofs_z_19 "10" vr_wofs_z_20 "10" vr_wofs_z_21 "10" @@ -1811,6 +2051,70 @@ vr_wofs_z_29 "10" vr_wofs_z_30 "10" vr_wofs_z_31 "10" vr_wofs_z_32 "10" +vr_wofs_zb_01 "0.0" +vr_wofs_zb_02 "0" +vr_wofs_zb_03 "0.0" +vr_wofs_zb_04 "0.0" +vr_wofs_zb_05 "0.0" +vr_wofs_zb_06 "0.0" +vr_wofs_zb_07 "0.0" +vr_wofs_zb_08 "0.0" +vr_wofs_zb_09 "0.0" +vr_wofs_zb_10 "0.0" +vr_wofs_zb_11 "0.0" +vr_wofs_zb_12 "0.0" +vr_wofs_zb_13 "0.0" +vr_wofs_zb_14 "0.0" +vr_wofs_zb_15 "0.0" +vr_wofs_zb_16 "0.0" +vr_wofs_zb_17 "0.0" +vr_wofs_zb_18 "0.0" +vr_wofs_zb_19 "0.0" +vr_wofs_zb_20 "0.0" +vr_wofs_zb_21 "0.0" +vr_wofs_zb_22 "0.0" +vr_wofs_zb_23 "0.0" +vr_wofs_zb_24 "0.0" +vr_wofs_zb_25 "0.0" +vr_wofs_zb_26 "0.0" +vr_wofs_zb_27 "0.0" +vr_wofs_zb_28 "0.0" +vr_wofs_zb_29 "0.0" +vr_wofs_zb_2h_01 "0.0" +vr_wofs_zb_2h_02 "0.8" +vr_wofs_zb_2h_03 "0.8" +vr_wofs_zb_2h_04 "0.0" +vr_wofs_zb_2h_05 "0.0" +vr_wofs_zb_2h_06 "0.75" +vr_wofs_zb_2h_07 "0.75" +vr_wofs_zb_2h_08 "0.0" +vr_wofs_zb_2h_09 "0.0" +vr_wofs_zb_2h_10 "0.0" +vr_wofs_zb_2h_11 "0.75" +vr_wofs_zb_2h_12 "0.0" +vr_wofs_zb_2h_13 "0.0" +vr_wofs_zb_2h_14 "0.0" +vr_wofs_zb_2h_15 "0.0" +vr_wofs_zb_2h_16 "0.0" +vr_wofs_zb_2h_17 "0.0" +vr_wofs_zb_2h_18 "0.0" +vr_wofs_zb_2h_19 "0.0" +vr_wofs_zb_2h_20 "0.0" +vr_wofs_zb_2h_21 "0.0" +vr_wofs_zb_2h_22 "0.0" +vr_wofs_zb_2h_23 "0.0" +vr_wofs_zb_2h_24 "0.0" +vr_wofs_zb_2h_25 "0.0" +vr_wofs_zb_2h_26 "0.0" +vr_wofs_zb_2h_27 "0.0" +vr_wofs_zb_2h_28 "0.0" +vr_wofs_zb_2h_29 "0.0" +vr_wofs_zb_2h_30 "0.0" +vr_wofs_zb_2h_31 "0.0" +vr_wofs_zb_2h_32 "0.0" +vr_wofs_zb_30 "0.0" +vr_wofs_zb_31 "0.0" +vr_wofs_zb_32 "0.0" vr_world_scale "1.25" vr_wpn_dir_weight "1" vr_wpn_dir_weight_2h_help_mult "1.0" diff --git a/ReleaseFiles/Id1/maps/vrtutorial.bsp b/ReleaseFiles/Id1/maps/vrtutorial.bsp new file mode 100644 index 00000000..16ffcd54 Binary files /dev/null and b/ReleaseFiles/Id1/maps/vrtutorial.bsp differ diff --git a/ReleaseFiles/Id1/maps/vrtutorial.pts b/ReleaseFiles/Id1/maps/vrtutorial.pts new file mode 100644 index 00000000..93ee701c --- /dev/null +++ b/ReleaseFiles/Id1/maps/vrtutorial.pts @@ -0,0 +1,1199 @@ +-904.000000 -1204.000000 373.000000 +-904.529786 -1204.799310 371.244885 +-905.059573 -1205.598620 369.489770 +-905.589359 -1206.397931 367.734654 +-906.119146 -1207.197241 365.979539 +-906.648932 -1207.996551 364.224424 +-907.178718 -1208.795861 362.469309 +-907.708505 -1209.595172 360.714193 +-908.238291 -1210.394482 358.959078 +-908.768078 -1211.193792 357.203963 +-909.297864 -1211.993102 355.448848 +-909.827651 -1212.792413 353.693732 +-910.357437 -1213.591723 351.938617 +-910.887223 -1214.391033 350.183502 +-911.417010 -1215.190343 348.428387 +-911.946796 -1215.989654 346.673271 +-912.476583 -1216.788964 344.918156 +-913.006369 -1217.588274 343.163041 +-913.536155 -1218.387584 341.407926 +-914.065942 -1219.186895 339.652810 +-914.595728 -1219.986205 337.897695 +-915.125515 -1220.785515 336.142580 +-915.655301 -1221.584825 334.387465 +-916.185087 -1222.384136 332.632350 +-916.714874 -1223.183446 330.877234 +-917.244660 -1223.982756 329.122119 +-917.774447 -1224.782066 327.367004 +-918.304233 -1225.581377 325.611889 +-918.834019 -1226.380687 323.856773 +-919.363806 -1227.179997 322.101658 +-919.893592 -1227.979307 320.346543 +-920.423379 -1228.778617 318.591428 +-920.953165 -1229.577928 316.836312 +-921.482952 -1230.377238 315.081197 +-922.012738 -1231.176548 313.326082 +-922.542524 -1231.975858 311.570967 +-923.072311 -1232.775169 309.815851 +-923.602097 -1233.574479 308.060736 +-924.131884 -1234.373789 306.305621 +-924.661670 -1235.173099 304.550506 +-925.191456 -1235.972410 302.795391 +-925.721243 -1236.771720 301.040275 +-926.251029 -1237.571030 299.285160 +-926.780816 -1238.370340 297.530045 +-927.310602 -1239.169651 295.774930 +-927.840388 -1239.968961 294.019814 +-928.370175 -1240.768271 292.264699 +-928.899961 -1241.567581 290.509584 +-929.429748 -1242.366892 288.754469 +-929.959534 -1243.166202 286.999353 +-930.489321 -1243.965512 285.244238 +-931.019107 -1244.764822 283.489123 +-931.548893 -1245.564133 281.734008 +-932.078680 -1246.363443 279.978892 +-932.608466 -1247.162753 278.223777 +-933.138253 -1247.962063 276.468662 +-933.668039 -1248.761374 274.713547 +-934.197825 -1249.560684 272.958431 +-934.727612 -1250.359994 271.203316 +-935.257398 -1251.159304 269.448201 +-935.787185 -1251.958615 267.693086 +-936.316971 -1252.757925 265.937971 +-936.846757 -1253.557235 264.182855 +-937.376544 -1254.356545 262.427740 +-937.906330 -1255.155855 260.672625 +-938.436117 -1255.955166 258.917510 +-938.965903 -1256.754476 257.162394 +-939.495690 -1257.553786 255.407279 +-940.025476 -1258.353096 253.652164 +-940.555262 -1259.152407 251.897049 +-941.085049 -1259.951717 250.141933 +-941.614835 -1260.751027 248.386818 +-942.144622 -1261.550337 246.631703 +-942.674408 -1262.349648 244.876588 +-943.204194 -1263.148958 243.121472 +-943.733981 -1263.948268 241.366357 +-944.263767 -1264.747578 239.611242 +-944.793554 -1265.546889 237.856127 +-945.323340 -1266.346199 236.101011 +-945.853126 -1267.145509 234.345896 +-946.382913 -1267.944819 232.590781 +-946.912699 -1268.744130 230.835666 +-947.442486 -1269.543440 229.080551 +-947.972272 -1270.342750 227.325435 +-948.502058 -1271.142060 225.570320 +-949.031845 -1271.941371 223.815205 +-949.561631 -1272.740681 222.060090 +-950.091418 -1273.539991 220.304974 +-950.621204 -1274.339301 218.549859 +-951.150991 -1275.138612 216.794744 +-951.680777 -1275.937922 215.039629 +-952.210563 -1276.737232 213.284513 +-952.740350 -1277.536542 211.529398 +-953.270136 -1278.335852 209.774283 +-953.799923 -1279.135163 208.019168 +-954.329709 -1279.934473 206.264052 +-954.859495 -1280.733783 204.508937 +-955.389282 -1281.533093 202.753822 +-955.919068 -1282.332404 200.998707 +-956.448855 -1283.131714 199.243592 +-956.978641 -1283.931024 197.488476 +-957.508427 -1284.730334 195.733361 +-958.038214 -1285.529645 193.978246 +-958.568000 -1286.328955 192.223131 +-959.097787 -1287.128265 190.468015 +-959.627573 -1287.927575 188.712900 +-960.157360 -1288.726886 186.957785 +-960.687146 -1289.526196 185.202670 +-961.216932 -1290.325506 183.447554 +-961.746719 -1291.124816 181.692439 +-962.276505 -1291.924127 179.937324 +-962.806292 -1292.723437 178.182209 +-963.336078 -1293.522747 176.427093 +-963.865864 -1294.322057 174.671978 +-964.395651 -1295.121368 172.916863 +-964.925437 -1295.920678 171.161748 +-965.455224 -1296.719988 169.406632 +-965.985010 -1297.519298 167.651517 +-966.514796 -1298.318609 165.896402 +-967.044583 -1299.117919 164.141287 +-967.574369 -1299.917229 162.386172 +-968.104156 -1300.716539 160.631056 +-968.633942 -1301.515850 158.875941 +-969.163729 -1302.315160 157.120826 +-969.693515 -1303.114470 155.365711 +-970.223301 -1303.913780 153.610595 +-970.753088 -1304.713090 151.855480 +-971.282874 -1305.512401 150.100365 +-971.812661 -1306.311711 148.345250 +-972.342447 -1307.111021 146.590134 +-972.872233 -1307.910331 144.835019 +-973.402020 -1308.709642 143.079904 +-973.931806 -1309.508952 141.324789 +-974.461593 -1310.308262 139.569673 +-974.991379 -1311.107572 137.814558 +-975.521165 -1311.906883 136.059443 +-976.050952 -1312.706193 134.304328 +-976.580738 -1313.505503 132.549212 +-977.110525 -1314.304813 130.794097 +-977.640311 -1315.104124 129.038982 +-978.170097 -1315.903434 127.283867 +-978.699884 -1316.702744 125.528752 +-979.229670 -1317.502054 123.773636 +-979.759457 -1318.301365 122.018521 +-980.289243 -1319.100675 120.263406 +-980.819030 -1319.899985 118.508291 +-981.348816 -1320.699295 116.753175 +-981.878602 -1321.498606 114.998060 +-982.408389 -1322.297916 113.242945 +-982.938175 -1323.097226 111.487830 +-983.467962 -1323.896536 109.732714 +-983.997748 -1324.695847 107.977599 +-984.527534 -1325.495157 106.222484 +-985.057321 -1326.294467 104.467369 +-985.587107 -1327.093777 102.712253 +-986.116894 -1327.893087 100.957138 +-986.646680 -1328.692398 99.202023 +-987.176466 -1329.491708 97.446908 +-987.706253 -1330.291018 95.691793 +-988.236039 -1331.090328 93.936677 +-988.765826 -1331.889639 92.181562 +-989.295612 -1332.688949 90.426447 +-989.825399 -1333.488259 88.671332 +-990.355185 -1334.287569 86.916216 +-990.884971 -1335.086880 85.161101 +-991.414758 -1335.886190 83.405986 +-991.944544 -1336.685500 81.650871 +-992.474331 -1337.484810 79.895755 +-993.004117 -1338.284121 78.140640 +-993.533903 -1339.083431 76.385525 +-994.063690 -1339.882741 74.630410 +-994.593476 -1340.682051 72.875294 +-995.123263 -1341.481362 71.120179 +-995.653049 -1342.280672 69.365064 +-996.182835 -1343.079982 67.609949 +-996.712622 -1343.879292 65.854833 +-997.242408 -1344.678603 64.099718 +-997.772195 -1345.477913 62.344603 +-998.301981 -1346.277223 60.589488 +-998.831768 -1347.076533 58.834373 +-999.361554 -1347.875844 57.079257 +-999.891340 -1348.675154 55.324142 +-1000.421127 -1349.474464 53.569027 +-1000.950913 -1350.273774 51.813912 +-1001.480700 -1351.073085 50.058796 +-1002.010486 -1351.872395 48.303681 +-1002.540272 -1352.671705 46.548566 +-1003.070059 -1353.471015 44.793451 +-1003.599845 -1354.270325 43.038335 +-1004.129632 -1355.069636 41.283220 +-1004.659418 -1355.868946 39.528105 +-1005.189204 -1356.668256 37.772990 +-1005.718991 -1357.467566 36.017874 +-1006.248777 -1358.266877 34.262759 +-1006.778564 -1359.066187 32.507644 +-1007.308350 -1359.865497 30.752529 +-1007.838136 -1360.664807 28.997413 +-1008.367923 -1361.464118 27.242298 +-1008.897709 -1362.263428 25.487183 +-1009.427496 -1363.062738 23.732068 +-1009.957282 -1363.862048 21.976953 +-1010.487069 -1364.661359 20.221837 +-1011.016855 -1365.460669 18.466722 +-1011.546641 -1366.259979 16.711607 +-1012.076428 -1367.059289 14.956492 +-1012.945080 -1368.369861 12.078755 +-1010.986835 -1368.529020 11.704667 +-1009.028589 -1368.688180 11.330578 +-1007.070344 -1368.847339 10.956490 +-1005.112098 -1369.006498 10.582401 +-1003.153852 -1369.165658 10.208312 +-1001.195607 -1369.324817 9.834224 +-999.237361 -1369.483976 9.460135 +-997.279115 -1369.643136 9.086047 +-995.320870 -1369.802295 8.711958 +-993.362624 -1369.961454 8.337870 +-991.404378 -1370.120614 7.963781 +-989.446133 -1370.279773 7.589692 +-987.487887 -1370.438933 7.215604 +-985.529641 -1370.598092 6.841515 +-983.571396 -1370.757251 6.467427 +-981.613150 -1370.916411 6.093338 +-979.654904 -1371.075570 5.719250 +-977.696659 -1371.234729 5.345161 +-975.738413 -1371.393889 4.971072 +-973.780167 -1371.553048 4.596984 +-971.821922 -1371.712207 4.222895 +-969.863676 -1371.871367 3.848807 +-967.905430 -1372.030526 3.474718 +-965.947185 -1372.189685 3.100629 +-963.988939 -1372.348845 2.726541 +-962.030693 -1372.508004 2.352452 +-960.072448 -1372.667164 1.978364 +-958.114202 -1372.826323 1.604275 +-956.155957 -1372.985482 1.230187 +-954.197711 -1373.144642 0.856098 +-952.239465 -1373.303801 0.482009 +-950.281220 -1373.462960 0.107921 +-948.322974 -1373.622120 -0.266168 +-946.364728 -1373.781279 -0.640256 +-944.406483 -1373.940438 -1.014345 +-942.448237 -1374.099598 -1.388433 +-940.489991 -1374.258757 -1.762522 +-938.531746 -1374.417916 -2.136611 +-936.573500 -1374.577076 -2.510699 +-934.615254 -1374.736235 -2.884788 +-932.657009 -1374.895395 -3.258876 +-930.698763 -1375.054554 -3.632965 +-928.740517 -1375.213713 -4.007053 +-926.782272 -1375.372873 -4.381142 +-924.824026 -1375.532032 -4.755231 +-922.865780 -1375.691191 -5.129319 +-920.907535 -1375.850351 -5.503408 +-918.949289 -1376.009510 -5.877496 +-916.991043 -1376.168669 -6.251585 +-915.032798 -1376.327829 -6.625673 +-913.074552 -1376.486988 -6.999762 +-911.116307 -1376.646147 -7.373851 +-909.158061 -1376.805307 -7.747939 +-907.199815 -1376.964466 -8.122028 +-905.241570 -1377.123626 -8.496116 +-903.283324 -1377.282785 -8.870205 +-901.325078 -1377.441944 -9.244293 +-899.366833 -1377.601104 -9.618382 +-897.408587 -1377.760263 -9.992471 +-895.450341 -1377.919422 -10.366559 +-893.492096 -1378.078582 -10.740648 +-891.533850 -1378.237741 -11.114736 +-889.575604 -1378.396900 -11.488825 +-887.617359 -1378.556060 -11.862913 +-885.659113 -1378.715219 -12.237002 +-883.700867 -1378.874378 -12.611091 +-881.742622 -1379.033538 -12.985179 +-879.784376 -1379.192697 -13.359268 +-877.826130 -1379.351857 -13.733356 +-875.867885 -1379.511016 -14.107445 +-873.909639 -1379.670175 -14.481534 +-871.951393 -1379.829335 -14.855622 +-869.993148 -1379.988494 -15.229711 +-868.034902 -1380.147653 -15.603799 +-866.076656 -1380.306813 -15.977888 +-864.118411 -1380.465972 -16.351976 +-862.160165 -1380.625131 -16.726065 +-860.201920 -1380.784291 -17.100154 +-858.243674 -1380.943450 -17.474242 +-856.285428 -1381.102609 -17.848331 +-854.327183 -1381.261769 -18.222419 +-852.368937 -1381.420928 -18.596508 +-850.410691 -1381.580088 -18.970596 +-848.452446 -1381.739247 -19.344685 +-846.494200 -1381.898406 -19.718774 +-844.535954 -1382.057566 -20.092862 +-842.577709 -1382.216725 -20.466951 +-840.619463 -1382.375884 -20.841039 +-838.661217 -1382.535044 -21.215128 +-836.702972 -1382.694203 -21.589216 +-834.744726 -1382.853362 -21.963305 +-832.786480 -1383.012522 -22.337394 +-830.828235 -1383.171681 -22.711482 +-828.869989 -1383.330840 -23.085571 +-826.911743 -1383.490000 -23.459659 +-824.953498 -1383.649159 -23.833748 +-822.995252 -1383.808318 -24.207836 +-821.037006 -1383.967478 -24.581925 +-819.078761 -1384.126637 -24.956014 +-817.120515 -1384.285797 -25.330102 +-815.162270 -1384.444956 -25.704191 +-813.204024 -1384.604115 -26.078279 +-811.245778 -1384.763275 -26.452368 +-809.287533 -1384.922434 -26.826456 +-807.329287 -1385.081593 -27.200545 +-805.371041 -1385.240753 -27.574634 +-803.412796 -1385.399912 -27.948722 +-801.454550 -1385.559071 -28.322811 +-799.496304 -1385.718231 -28.696899 +-797.538059 -1385.877390 -29.070988 +-795.579813 -1386.036549 -29.445076 +-793.621567 -1386.195709 -29.819165 +-791.663322 -1386.354868 -30.193254 +-789.705076 -1386.514028 -30.567342 +-787.746830 -1386.673187 -30.941431 +-785.788585 -1386.832346 -31.315519 +-783.830339 -1386.991506 -31.689608 +-781.872093 -1387.150665 -32.063697 +-779.913848 -1387.309824 -32.437785 +-777.955602 -1387.468984 -32.811874 +-775.997356 -1387.628143 -33.185962 +-774.039111 -1387.787302 -33.560051 +-772.080865 -1387.946462 -33.934139 +-770.122619 -1388.105621 -34.308228 +-768.164374 -1388.264780 -34.682317 +-766.206128 -1388.423940 -35.056405 +-764.247883 -1388.583099 -35.430494 +-762.289637 -1388.742259 -35.804582 +-760.331391 -1388.901418 -36.178671 +-758.373146 -1389.060577 -36.552759 +-756.414900 -1389.219737 -36.926848 +-754.456654 -1389.378896 -37.300937 +-752.498409 -1389.538055 -37.675025 +-750.540163 -1389.697215 -38.049114 +-748.581917 -1389.856374 -38.423202 +-746.623672 -1390.015533 -38.797291 +-744.665426 -1390.174693 -39.171379 +-742.707180 -1390.333852 -39.545468 +-740.748935 -1390.493011 -39.919557 +-738.790689 -1390.652171 -40.293645 +-736.832443 -1390.811330 -40.667734 +-734.874198 -1390.970490 -41.041822 +-732.915952 -1391.129649 -41.415911 +-730.957706 -1391.288808 -41.789999 +-728.999461 -1391.447968 -42.164088 +-727.041215 -1391.607127 -42.538177 +-725.082969 -1391.766286 -42.912265 +-723.124724 -1391.925446 -43.286354 +-721.166478 -1392.084605 -43.660442 +-719.208233 -1392.243764 -44.034531 +-717.249987 -1392.402924 -44.408619 +-715.291741 -1392.562083 -44.782708 +-713.333496 -1392.721242 -45.156797 +-711.375250 -1392.880402 -45.530885 +-709.417004 -1393.039561 -45.904974 +-707.458759 -1393.198721 -46.279062 +-705.500513 -1393.357880 -46.653151 +-703.542267 -1393.517039 -47.027239 +-701.584022 -1393.676199 -47.401328 +-699.625776 -1393.835358 -47.775417 +-697.667530 -1393.994517 -48.149505 +-695.709285 -1394.153677 -48.523594 +-693.751039 -1394.312836 -48.897682 +-691.792793 -1394.471995 -49.271771 +-689.834548 -1394.631155 -49.645860 +-687.876302 -1394.790314 -50.019948 +-685.918056 -1394.949473 -50.394037 +-683.959811 -1395.108633 -50.768125 +-682.001565 -1395.267792 -51.142214 +-680.043319 -1395.426952 -51.516302 +-678.085074 -1395.586111 -51.890391 +-676.126828 -1395.745270 -52.264480 +-674.168582 -1395.904430 -52.638568 +-672.210337 -1396.063589 -53.012657 +-670.252091 -1396.222748 -53.386745 +-668.293846 -1396.381908 -53.760834 +-666.335600 -1396.541067 -54.134922 +-664.377354 -1396.700226 -54.509011 +-662.419109 -1396.859386 -54.883100 +-660.460863 -1397.018545 -55.257188 +-658.502617 -1397.177704 -55.631277 +-656.544372 -1397.336864 -56.005365 +-654.586126 -1397.496023 -56.379454 +-652.627880 -1397.655183 -56.753542 +-650.669635 -1397.814342 -57.127631 +-648.711389 -1397.973501 -57.501720 +-646.753143 -1398.132661 -57.875808 +-644.794898 -1398.291820 -58.249897 +-642.836652 -1398.450979 -58.623985 +-640.878406 -1398.610139 -58.998074 +-638.920161 -1398.769298 -59.372162 +-636.961915 -1398.928457 -59.746251 +-635.003669 -1399.087617 -60.120340 +-633.045424 -1399.246776 -60.494428 +-631.087178 -1399.405935 -60.868517 +-629.128932 -1399.565095 -61.242605 +-627.170687 -1399.724254 -61.616694 +-625.212441 -1399.883414 -61.990782 +-623.254196 -1400.042573 -62.364871 +-621.295950 -1400.201732 -62.738960 +-619.337704 -1400.360892 -63.113048 +-617.379459 -1400.520051 -63.487137 +-615.421213 -1400.679210 -63.861225 +-613.462967 -1400.838370 -64.235314 +-611.504722 -1400.997529 -64.609402 +-609.546476 -1401.156688 -64.983491 +-607.588230 -1401.315848 -65.357580 +-605.629985 -1401.475007 -65.731668 +-603.671739 -1401.634166 -66.105757 +-601.713493 -1401.793326 -66.479845 +-599.755248 -1401.952485 -66.853934 +-597.797002 -1402.111645 -67.228023 +-595.838756 -1402.270804 -67.602111 +-593.880511 -1402.429963 -67.976200 +-591.922265 -1402.589123 -68.350288 +-589.964019 -1402.748282 -68.724377 +-588.005774 -1402.907441 -69.098465 +-586.047528 -1403.066601 -69.472554 +-584.089282 -1403.225760 -69.846643 +-582.131037 -1403.384919 -70.220731 +-580.172791 -1403.544079 -70.594820 +-578.214545 -1403.703238 -70.968908 +-576.256300 -1403.862397 -71.342997 +-574.298054 -1404.021557 -71.717085 +-572.339809 -1404.180716 -72.091174 +-570.381563 -1404.339875 -72.465263 +-568.423317 -1404.499035 -72.839351 +-566.465072 -1404.658194 -73.213440 +-564.506826 -1404.817354 -73.587528 +-562.548580 -1404.976513 -73.961617 +-560.590335 -1405.135672 -74.335705 +-558.632089 -1405.294832 -74.709794 +-556.673843 -1405.453991 -75.083883 +-554.715598 -1405.613150 -75.457971 +-552.757352 -1405.772310 -75.832060 +-550.799106 -1405.931469 -76.206148 +-548.840861 -1406.090628 -76.580237 +-546.882615 -1406.249788 -76.954325 +-544.924369 -1406.408947 -77.328414 +-542.966124 -1406.568106 -77.702503 +-541.007878 -1406.727266 -78.076591 +-539.049632 -1406.886425 -78.450680 +-537.091387 -1407.045585 -78.824768 +-535.133141 -1407.204744 -79.198857 +-533.174895 -1407.363903 -79.572945 +-531.216650 -1407.523063 -79.947034 +-529.258404 -1407.682222 -80.321123 +-527.300159 -1407.841381 -80.695211 +-525.341913 -1408.000541 -81.069300 +-523.383667 -1408.159700 -81.443388 +-521.425422 -1408.318859 -81.817477 +-519.467176 -1408.478019 -82.191565 +-517.508930 -1408.637178 -82.565654 +-515.550685 -1408.796337 -82.939743 +-513.592439 -1408.955497 -83.313831 +-511.634193 -1409.114656 -83.687920 +-509.675948 -1409.273816 -84.062008 +-507.717702 -1409.432975 -84.436097 +-505.759456 -1409.592134 -84.810186 +-503.801211 -1409.751294 -85.184274 +-501.842965 -1409.910453 -85.558363 +-499.884719 -1410.069612 -85.932451 +-497.926474 -1410.228772 -86.306540 +-495.968228 -1410.387931 -86.680628 +-494.009982 -1410.547090 -87.054717 +-492.051737 -1410.706250 -87.428806 +-490.093491 -1410.865409 -87.802894 +-488.135245 -1411.024568 -88.176983 +-486.177000 -1411.183728 -88.551071 +-484.218754 -1411.342887 -88.925160 +-482.260508 -1411.502047 -89.299248 +-480.302263 -1411.661206 -89.673337 +-478.344017 -1411.820365 -90.047426 +-476.385772 -1411.979525 -90.421514 +-474.427526 -1412.138684 -90.795603 +-472.469280 -1412.297843 -91.169691 +-470.511035 -1412.457003 -91.543780 +-468.552789 -1412.616162 -91.917868 +-466.594543 -1412.775321 -92.291957 +-464.636298 -1412.934481 -92.666046 +-462.678052 -1413.093640 -93.040134 +-460.719806 -1413.252799 -93.414223 +-458.761561 -1413.411959 -93.788311 +-456.803315 -1413.571118 -94.162400 +-454.845069 -1413.730278 -94.536488 +-452.886824 -1413.889437 -94.910577 +-450.928578 -1414.048596 -95.284666 +-448.970332 -1414.207756 -95.658754 +-447.012087 -1414.366915 -96.032843 +-445.053841 -1414.526074 -96.406931 +-443.095595 -1414.685234 -96.781020 +-441.137350 -1414.844393 -97.155108 +-439.179104 -1415.003552 -97.529197 +-437.220858 -1415.162712 -97.903286 +-435.262613 -1415.321871 -98.277374 +-433.304367 -1415.481030 -98.651463 +-431.346122 -1415.640190 -99.025551 +-429.387876 -1415.799349 -99.399640 +-427.429630 -1415.958509 -99.773728 +-425.471385 -1416.117668 -100.147817 +-423.513139 -1416.276827 -100.521906 +-421.554893 -1416.435987 -100.895994 +-419.596648 -1416.595146 -101.270083 +-417.638402 -1416.754305 -101.644171 +-415.680156 -1416.913465 -102.018260 +-413.721911 -1417.072624 -102.392349 +-411.763665 -1417.231783 -102.766437 +-409.805419 -1417.390943 -103.140526 +-407.847174 -1417.550102 -103.514614 +-405.888928 -1417.709261 -103.888703 +-403.930682 -1417.868421 -104.262791 +-401.972437 -1418.027580 -104.636880 +-398.929928 -1418.274865 -105.218098 +-399.827834 -1418.292466 -107.005122 +-400.725741 -1418.310068 -108.792146 +-401.623648 -1418.327669 -110.579169 +-402.521554 -1418.345271 -112.366193 +-403.419461 -1418.362872 -114.153217 +-404.317367 -1418.380474 -115.940241 +-405.215274 -1418.398075 -117.727264 +-406.113181 -1418.415677 -119.514288 +-407.011087 -1418.433278 -121.301312 +-407.908994 -1418.450880 -123.088336 +-408.806900 -1418.468481 -124.875359 +-409.704807 -1418.486082 -126.662383 +-410.602714 -1418.503684 -128.449407 +-411.500620 -1418.521285 -130.236431 +-412.398527 -1418.538887 -132.023455 +-413.296433 -1418.556488 -133.810478 +-414.194340 -1418.574090 -135.597502 +-415.092247 -1418.591691 -137.384526 +-415.990153 -1418.609293 -139.171550 +-416.888060 -1418.626894 -140.958573 +-417.785966 -1418.644496 -142.745597 +-418.683873 -1418.662097 -144.532621 +-419.581780 -1418.679699 -146.319645 +-420.479686 -1418.697300 -148.106668 +-421.377593 -1418.714902 -149.893692 +-422.275499 -1418.732503 -151.680716 +-423.173406 -1418.750105 -153.467740 +-424.071312 -1418.767706 -155.254763 +-424.969219 -1418.785308 -157.041787 +-425.867126 -1418.802909 -158.828811 +-426.765032 -1418.820511 -160.615835 +-427.662939 -1418.838112 -162.402859 +-428.560845 -1418.855714 -164.189882 +-429.458752 -1418.873315 -165.976906 +-430.356659 -1418.890917 -167.763930 +-431.254565 -1418.908518 -169.550954 +-432.152472 -1418.926120 -171.337977 +-433.050378 -1418.943721 -173.125001 +-433.948285 -1418.961323 -174.912025 +-434.846192 -1418.978924 -176.699049 +-435.744098 -1418.996526 -178.486072 +-436.642005 -1419.014127 -180.273096 +-437.539911 -1419.031729 -182.060120 +-438.437818 -1419.049330 -183.847144 +-439.335725 -1419.066932 -185.634167 +-440.233631 -1419.084533 -187.421191 +-441.131538 -1419.102135 -189.208215 +-442.029444 -1419.119736 -190.995239 +-442.927351 -1419.137337 -192.782263 +-443.825258 -1419.154939 -194.569286 +-444.723164 -1419.172540 -196.356310 +-445.621071 -1419.190142 -198.143334 +-446.518977 -1419.207743 -199.930358 +-447.416884 -1419.225345 -201.717381 +-448.314791 -1419.242946 -203.504405 +-449.212697 -1419.260548 -205.291429 +-450.110604 -1419.278149 -207.078453 +-451.008510 -1419.295751 -208.865476 +-451.906417 -1419.313352 -210.652500 +-452.804323 -1419.330954 -212.439524 +-453.702230 -1419.348555 -214.226548 +-454.600137 -1419.366157 -216.013571 +-455.498043 -1419.383758 -217.800595 +-456.395950 -1419.401360 -219.587619 +-457.293856 -1419.418961 -221.374643 +-458.191763 -1419.436563 -223.161667 +-459.089670 -1419.454164 -224.948690 +-459.987576 -1419.471766 -226.735714 +-460.885483 -1419.489367 -228.522738 +-461.783389 -1419.506969 -230.309762 +-462.681296 -1419.524570 -232.096785 +-463.579203 -1419.542172 -233.883809 +-464.477109 -1419.559773 -235.670833 +-465.375016 -1419.577375 -237.457857 +-466.272922 -1419.594976 -239.244880 +-467.170829 -1419.612578 -241.031904 +-468.068736 -1419.630179 -242.818928 +-468.966642 -1419.647781 -244.605952 +-469.864549 -1419.665382 -246.392975 +-470.762455 -1419.682984 -248.179999 +-471.660362 -1419.700585 -249.967023 +-472.558269 -1419.718187 -251.754047 +-473.456175 -1419.735788 -253.541071 +-474.354082 -1419.753390 -255.328094 +-475.251988 -1419.770991 -257.115118 +-476.149895 -1419.788593 -258.902142 +-477.047802 -1419.806194 -260.689166 +-477.945708 -1419.823795 -262.476189 +-478.843615 -1419.841397 -264.263213 +-479.741521 -1419.858998 -266.050237 +-480.639428 -1419.876600 -267.837261 +-481.537335 -1419.894201 -269.624284 +-482.435241 -1419.911803 -271.411308 +-483.333148 -1419.929404 -273.198332 +-484.231054 -1419.947006 -274.985356 +-485.128961 -1419.964607 -276.772379 +-486.026867 -1419.982209 -278.559403 +-486.924774 -1419.999810 -280.346427 +-487.822681 -1420.017412 -282.133451 +-488.720587 -1420.035013 -283.920475 +-489.618494 -1420.052615 -285.707498 +-490.516400 -1420.070216 -287.494522 +-491.414307 -1420.087818 -289.281546 +-492.312214 -1420.105419 -291.068570 +-493.210120 -1420.123021 -292.855593 +-494.108027 -1420.140622 -294.642617 +-495.005933 -1420.158224 -296.429641 +-495.903840 -1420.175825 -298.216665 +-496.801747 -1420.193427 -300.003688 +-497.699653 -1420.211028 -301.790712 +-498.597560 -1420.228630 -303.577736 +-499.495466 -1420.246231 -305.364760 +-500.393373 -1420.263833 -307.151783 +-501.291280 -1420.281434 -308.938807 +-502.189186 -1420.299036 -310.725831 +-503.087093 -1420.316637 -312.512855 +-503.984999 -1420.334239 -314.299879 +-504.882906 -1420.351840 -316.086902 +-505.780813 -1420.369442 -317.873926 +-506.678719 -1420.387043 -319.660950 +-507.576626 -1420.404645 -321.447974 +-508.474532 -1420.422246 -323.234997 +-509.372439 -1420.439848 -325.022021 +-510.270346 -1420.457449 -326.809045 +-511.168252 -1420.475051 -328.596069 +-512.066159 -1420.492652 -330.383092 +-512.964065 -1420.510253 -332.170116 +-513.861972 -1420.527855 -333.957140 +-514.759878 -1420.545456 -335.744164 +-515.657785 -1420.563058 -337.531187 +-516.555692 -1420.580659 -339.318211 +-517.453598 -1420.598261 -341.105235 +-518.351505 -1420.615862 -342.892259 +-519.249411 -1420.633464 -344.679283 +-520.147318 -1420.651065 -346.466306 +-521.045225 -1420.668667 -348.253330 +-521.943131 -1420.686268 -350.040354 +-522.841038 -1420.703870 -351.827378 +-523.738944 -1420.721471 -353.614401 +-524.636851 -1420.739073 -355.401425 +-525.534758 -1420.756674 -357.188449 +-526.432664 -1420.774276 -358.975473 +-527.330571 -1420.791877 -360.762496 +-528.228477 -1420.809479 -362.549520 +-529.126384 -1420.827080 -364.336544 +-530.024291 -1420.844682 -366.123568 +-530.922197 -1420.862283 -367.910591 +-531.820104 -1420.879885 -369.697615 +-532.718010 -1420.897486 -371.484639 +-533.615917 -1420.915088 -373.271663 +-534.513824 -1420.932689 -375.058687 +-535.411730 -1420.950291 -376.845710 +-536.309637 -1420.967892 -378.632734 +-537.207543 -1420.985494 -380.419758 +-538.105450 -1421.003095 -382.206782 +-539.003357 -1421.020697 -383.993805 +-539.901263 -1421.038298 -385.780829 +-540.799170 -1421.055900 -387.567853 +-541.697076 -1421.073501 -389.354877 +-542.594983 -1421.091103 -391.141900 +-543.492889 -1421.108704 -392.928924 +-544.390796 -1421.126306 -394.715948 +-545.288703 -1421.143907 -396.502972 +-546.186609 -1421.161508 -398.289996 +-547.084516 -1421.179110 -400.077019 +-547.982422 -1421.196711 -401.864043 +-548.880329 -1421.214313 -403.651067 +-549.778236 -1421.231914 -405.438091 +-550.676142 -1421.249516 -407.225114 +-551.574049 -1421.267117 -409.012138 +-552.471955 -1421.284719 -410.799162 +-553.369862 -1421.302320 -412.586186 +-554.267769 -1421.319922 -414.373209 +-555.165675 -1421.337523 -416.160233 +-556.063582 -1421.355125 -417.947257 +-556.961488 -1421.372726 -419.734281 +-557.859395 -1421.390328 -421.521304 +-558.757302 -1421.407929 -423.308328 +-559.655208 -1421.425531 -425.095352 +-560.553115 -1421.443132 -426.882376 +-561.451021 -1421.460734 -428.669400 +-562.348928 -1421.478335 -430.456423 +-563.246835 -1421.495937 -432.243447 +-564.144741 -1421.513538 -434.030471 +-565.042648 -1421.531140 -435.817495 +-565.940554 -1421.548741 -437.604518 +-566.838461 -1421.566343 -439.391542 +-567.736368 -1421.583944 -441.178566 +-568.634274 -1421.601546 -442.965590 +-569.532181 -1421.619147 -444.752613 +-570.430087 -1421.636749 -446.539637 +-571.327994 -1421.654350 -448.326661 +-572.225900 -1421.671952 -450.113685 +-573.123807 -1421.689553 -451.900708 +-574.021714 -1421.707155 -453.687732 +-574.919620 -1421.724756 -455.474756 +-575.817527 -1421.742358 -457.261780 +-576.715433 -1421.759959 -459.048804 +-577.613340 -1421.777561 -460.835827 +-578.511247 -1421.795162 -462.622851 +-579.409153 -1421.812764 -464.409875 +-580.307060 -1421.830365 -466.196899 +-581.204966 -1421.847966 -467.983922 +-582.102873 -1421.865568 -469.770946 +-583.000780 -1421.883169 -471.557970 +-583.898686 -1421.900771 -473.344994 +-584.796593 -1421.918372 -475.132017 +-585.694499 -1421.935974 -476.919041 +-586.592406 -1421.953575 -478.706065 +-587.490313 -1421.971177 -480.493089 +-588.388219 -1421.988778 -482.280112 +-589.286126 -1422.006380 -484.067136 +-590.184032 -1422.023981 -485.854160 +-591.081939 -1422.041583 -487.641184 +-591.979846 -1422.059184 -489.428208 +-592.877752 -1422.076786 -491.215231 +-593.775659 -1422.094387 -493.002255 +-594.673565 -1422.111989 -494.789279 +-595.571472 -1422.129590 -496.576303 +-596.469379 -1422.147192 -498.363326 +-597.367285 -1422.164793 -500.150350 +-598.265192 -1422.182395 -501.937374 +-599.163098 -1422.199996 -503.724398 +-600.061005 -1422.217598 -505.511421 +-600.958911 -1422.235199 -507.298445 +-601.856818 -1422.252801 -509.085469 +-602.754725 -1422.270402 -510.872493 +-603.652631 -1422.288004 -512.659516 +-604.550538 -1422.305605 -514.446540 +-605.448444 -1422.323207 -516.233564 +-606.346351 -1422.340808 -518.020588 +-607.244258 -1422.358410 -519.807612 +-608.142164 -1422.376011 -521.594635 +-609.040071 -1422.393613 -523.381659 +-609.937977 -1422.411214 -525.168683 +-610.835884 -1422.428816 -526.955707 +-611.733791 -1422.446417 -528.742730 +-612.631697 -1422.464019 -530.529754 +-613.529604 -1422.481620 -532.316778 +-614.427510 -1422.499221 -534.103802 +-615.325417 -1422.516823 -535.890825 +-616.223324 -1422.534424 -537.677849 +-617.121230 -1422.552026 -539.464873 +-618.019137 -1422.569627 -541.251897 +-618.917043 -1422.587229 -543.038920 +-619.814950 -1422.604830 -544.825944 +-620.712857 -1422.622432 -546.612968 +-621.610763 -1422.640033 -548.399992 +-622.508670 -1422.657635 -550.187016 +-623.406576 -1422.675236 -551.974039 +-624.304483 -1422.692838 -553.761063 +-625.202390 -1422.710439 -555.548087 +-626.100296 -1422.728041 -557.335111 +-626.998203 -1422.745642 -559.122134 +-627.896109 -1422.763244 -560.909158 +-628.794016 -1422.780845 -562.696182 +-629.691922 -1422.798447 -564.483206 +-630.589829 -1422.816048 -566.270229 +-631.487736 -1422.833650 -568.057253 +-632.385642 -1422.851251 -569.844277 +-633.283549 -1422.868853 -571.631301 +-634.181455 -1422.886454 -573.418324 +-635.079362 -1422.904056 -575.205348 +-635.977269 -1422.921657 -576.992372 +-636.875175 -1422.939259 -578.779396 +-637.773082 -1422.956860 -580.566420 +-638.670988 -1422.974462 -582.353443 +-639.568895 -1422.992063 -584.140467 +-640.466802 -1423.009665 -585.927491 +-641.364708 -1423.027266 -587.714515 +-642.262615 -1423.044868 -589.501538 +-643.160521 -1423.062469 -591.288562 +-644.058428 -1423.080071 -593.075586 +-644.956335 -1423.097672 -594.862610 +-645.854241 -1423.115274 -596.649633 +-646.752148 -1423.132875 -598.436657 +-647.650054 -1423.150477 -600.223681 +-648.547961 -1423.168078 -602.010705 +-649.445868 -1423.185679 -603.797728 +-650.343774 -1423.203281 -605.584752 +-651.241681 -1423.220882 -607.371776 +-652.139587 -1423.238484 -609.158800 +-653.037494 -1423.256085 -610.945824 +-653.935401 -1423.273687 -612.732847 +-654.833307 -1423.291288 -614.519871 +-655.731214 -1423.308890 -616.306895 +-656.629120 -1423.326491 -618.093919 +-657.527027 -1423.344093 -619.880942 +-658.424933 -1423.361694 -621.667966 +-659.322840 -1423.379296 -623.454990 +-660.220747 -1423.396897 -625.242014 +-661.118653 -1423.414499 -627.029037 +-662.016560 -1423.432100 -628.816061 +-662.914466 -1423.449702 -630.603085 +-663.812373 -1423.467303 -632.390109 +-664.710280 -1423.484905 -634.177132 +-665.608186 -1423.502506 -635.964156 +-666.506093 -1423.520108 -637.751180 +-667.403999 -1423.537709 -639.538204 +-668.301906 -1423.555311 -641.325228 +-669.199813 -1423.572912 -643.112251 +-670.097719 -1423.590514 -644.899275 +-670.995626 -1423.608115 -646.686299 +-671.893532 -1423.625717 -648.473323 +-672.791439 -1423.643318 -650.260346 +-673.689346 -1423.660920 -652.047370 +-674.587252 -1423.678521 -653.834394 +-675.485159 -1423.696123 -655.621418 +-676.383065 -1423.713724 -657.408441 +-677.280972 -1423.731326 -659.195465 +-678.178879 -1423.748927 -660.982489 +-679.076785 -1423.766529 -662.769513 +-679.974692 -1423.784130 -664.556536 +-680.872598 -1423.801732 -666.343560 +-681.770505 -1423.819333 -668.130584 +-682.668412 -1423.836935 -669.917608 +-683.566318 -1423.854536 -671.704632 +-684.464225 -1423.872137 -673.491655 +-685.362131 -1423.889739 -675.278679 +-686.260038 -1423.907340 -677.065703 +-687.157944 -1423.924942 -678.852727 +-688.055851 -1423.942543 -680.639750 +-688.953758 -1423.960145 -682.426774 +-689.851664 -1423.977746 -684.213798 +-690.749571 -1423.995348 -686.000822 +-691.647477 -1424.012949 -687.787845 +-692.545384 -1424.030551 -689.574869 +-693.443291 -1424.048152 -691.361893 +-694.341197 -1424.065754 -693.148917 +-695.239104 -1424.083355 -694.935940 +-696.137010 -1424.100957 -696.722964 +-697.034917 -1424.118558 -698.509988 +-697.932824 -1424.136160 -700.297012 +-698.830730 -1424.153761 -702.084036 +-699.728637 -1424.171363 -703.871059 +-700.626543 -1424.188964 -705.658083 +-701.524450 -1424.206566 -707.445107 +-702.422357 -1424.224167 -709.232131 +-703.320263 -1424.241769 -711.019154 +-704.218170 -1424.259370 -712.806178 +-705.116076 -1424.276972 -714.593202 +-706.013983 -1424.294573 -716.380226 +-706.911890 -1424.312175 -718.167249 +-707.809796 -1424.329776 -719.954273 +-708.707703 -1424.347378 -721.741297 +-709.605609 -1424.364979 -723.528321 +-710.503516 -1424.382581 -725.315344 +-711.401423 -1424.400182 -727.102368 +-712.299329 -1424.417784 -728.889392 +-713.197236 -1424.435385 -730.676416 +-714.095142 -1424.452987 -732.463440 +-714.993049 -1424.470588 -734.250463 +-715.890956 -1424.488190 -736.037487 +-716.788862 -1424.505791 -737.824511 +-717.686769 -1424.523392 -739.611535 +-718.584675 -1424.540994 -741.398558 +-719.482582 -1424.558595 -743.185582 +-720.380488 -1424.576197 -744.972606 +-721.278395 -1424.593798 -746.759630 +-722.176302 -1424.611400 -748.546653 +-723.074208 -1424.629001 -750.333677 +-723.972115 -1424.646603 -752.120701 +-724.870021 -1424.664204 -753.907725 +-725.767928 -1424.681806 -755.694748 +-726.665835 -1424.699407 -757.481772 +-727.563741 -1424.717009 -759.268796 +-728.461648 -1424.734610 -761.055820 +-729.359554 -1424.752212 -762.842844 +-730.257461 -1424.769813 -764.629867 +-731.155368 -1424.787415 -766.416891 +-732.053274 -1424.805016 -768.203915 +-732.951181 -1424.822618 -769.990939 +-733.849087 -1424.840219 -771.777962 +-734.746994 -1424.857821 -773.564986 +-735.644901 -1424.875422 -775.352010 +-736.542807 -1424.893024 -777.139034 +-737.440714 -1424.910625 -778.926057 +-738.338620 -1424.928227 -780.713081 +-739.236527 -1424.945828 -782.500105 +-740.134434 -1424.963430 -784.287129 +-741.032340 -1424.981031 -786.074152 +-742.000000 -1425.000000 -788.000000 +-743.996423 -1425.119558 -788.000000 +-745.992847 -1425.239115 -788.000000 +-747.989270 -1425.358673 -788.000000 +-749.985693 -1425.478231 -788.000000 +-751.982116 -1425.597788 -788.000000 +-753.978540 -1425.717346 -788.000000 +-755.974963 -1425.836904 -788.000000 +-757.971386 -1425.956461 -788.000000 +-759.967810 -1426.076019 -788.000000 +-761.964233 -1426.195577 -788.000000 +-763.960656 -1426.315134 -788.000000 +-765.957080 -1426.434692 -788.000000 +-767.953503 -1426.554250 -788.000000 +-769.949926 -1426.673807 -788.000000 +-771.946349 -1426.793365 -788.000000 +-773.942773 -1426.912923 -788.000000 +-775.939196 -1427.032480 -788.000000 +-777.935619 -1427.152038 -788.000000 +-779.932043 -1427.271596 -788.000000 +-781.928466 -1427.391153 -788.000000 +-783.924889 -1427.510711 -788.000000 +-785.921312 -1427.630269 -788.000000 +-787.917736 -1427.749826 -788.000000 +-789.914159 -1427.869384 -788.000000 +-791.910582 -1427.988942 -788.000000 +-793.907006 -1428.108499 -788.000000 +-795.903429 -1428.228057 -788.000000 +-797.899852 -1428.347615 -788.000000 +-799.896275 -1428.467172 -788.000000 +-801.892699 -1428.586730 -788.000000 +-803.889122 -1428.706288 -788.000000 +-805.885545 -1428.825845 -788.000000 +-807.881969 -1428.945403 -788.000000 +-809.878392 -1429.064961 -788.000000 +-811.874815 -1429.184518 -788.000000 +-813.871239 -1429.304076 -788.000000 +-815.867662 -1429.423634 -788.000000 +-817.864085 -1429.543191 -788.000000 +-819.860508 -1429.662749 -788.000000 +-821.856932 -1429.782307 -788.000000 +-823.853355 -1429.901864 -788.000000 +-825.849778 -1430.021422 -788.000000 +-827.846202 -1430.140980 -788.000000 +-829.842625 -1430.260537 -788.000000 +-831.839048 -1430.380095 -788.000000 +-833.835471 -1430.499653 -788.000000 +-835.831895 -1430.619210 -788.000000 +-837.828318 -1430.738768 -788.000000 +-839.824741 -1430.858326 -788.000000 +-841.821165 -1430.977883 -788.000000 +-843.817588 -1431.097441 -788.000000 +-845.814011 -1431.216999 -788.000000 +-847.810435 -1431.336556 -788.000000 +-849.806858 -1431.456114 -788.000000 +-851.803281 -1431.575672 -788.000000 +-853.799704 -1431.695229 -788.000000 +-855.796128 -1431.814787 -788.000000 +-857.792551 -1431.934345 -788.000000 +-859.788974 -1432.053902 -788.000000 +-861.785398 -1432.173460 -788.000000 +-863.781821 -1432.293018 -788.000000 +-865.778244 -1432.412575 -788.000000 +-867.774667 -1432.532133 -788.000000 +-869.771091 -1432.651691 -788.000000 +-871.767514 -1432.771248 -788.000000 +-873.763937 -1432.890806 -788.000000 +-875.760361 -1433.010364 -788.000000 +-877.756784 -1433.129921 -788.000000 +-879.753207 -1433.249479 -788.000000 +-881.749630 -1433.369037 -788.000000 +-883.746054 -1433.488594 -788.000000 +-885.742477 -1433.608152 -788.000000 +-887.738900 -1433.727710 -788.000000 +-889.735324 -1433.847267 -788.000000 +-891.731747 -1433.966825 -788.000000 +-893.728170 -1434.086383 -788.000000 +-895.724594 -1434.205940 -788.000000 +-897.721017 -1434.325498 -788.000000 +-899.717440 -1434.445056 -788.000000 +-901.713863 -1434.564613 -788.000000 +-903.710287 -1434.684171 -788.000000 +-905.706710 -1434.803729 -788.000000 +-907.703133 -1434.923286 -788.000000 +-909.699557 -1435.042844 -788.000000 +-911.695980 -1435.162402 -788.000000 +-913.692403 -1435.281960 -788.000000 +-915.688826 -1435.401517 -788.000000 +-917.685250 -1435.521075 -788.000000 +-919.681673 -1435.640633 -788.000000 +-921.678096 -1435.760190 -788.000000 +-923.674520 -1435.879748 -788.000000 +-925.670943 -1435.999306 -788.000000 +-927.667366 -1436.118863 -788.000000 +-929.663790 -1436.238421 -788.000000 +-931.660213 -1436.357979 -788.000000 +-933.656636 -1436.477536 -788.000000 +-935.653059 -1436.597094 -788.000000 +-937.649483 -1436.716652 -788.000000 +-939.645906 -1436.836209 -788.000000 +-941.642329 -1436.955767 -788.000000 +-943.638753 -1437.075325 -788.000000 +-945.635176 -1437.194882 -788.000000 +-947.631599 -1437.314440 -788.000000 +-949.628022 -1437.433998 -788.000000 +-951.624446 -1437.553555 -788.000000 +-953.620869 -1437.673113 -788.000000 +-955.617292 -1437.792671 -788.000000 +-957.613716 -1437.912228 -788.000000 +-959.610139 -1438.031786 -788.000000 +-961.606562 -1438.151344 -788.000000 +-963.602985 -1438.270901 -788.000000 +-965.599409 -1438.390459 -788.000000 +-967.595832 -1438.510017 -788.000000 +-969.592255 -1438.629574 -788.000000 +-971.588679 -1438.749132 -788.000000 +-973.585102 -1438.868690 -788.000000 +-975.581525 -1438.988247 -788.000000 +-977.577949 -1439.107805 -788.000000 +-979.574372 -1439.227363 -788.000000 +-981.570795 -1439.346920 -788.000000 +-983.567218 -1439.466478 -788.000000 +-985.563642 -1439.586036 -788.000000 +-987.560065 -1439.705593 -788.000000 +-989.556488 -1439.825151 -788.000000 +-991.552912 -1439.944709 -788.000000 +-993.549335 -1440.064266 -788.000000 +-995.545758 -1440.183824 -788.000000 +-997.542181 -1440.303382 -788.000000 +-999.538605 -1440.422939 -788.000000 +-1001.535028 -1440.542497 -788.000000 +-1003.531451 -1440.662055 -788.000000 +-1005.527875 -1440.781612 -788.000000 +-1007.524298 -1440.901170 -788.000000 +-1009.520721 -1441.020728 -788.000000 +-1011.517145 -1441.140285 -788.000000 +-1013.513568 -1441.259843 -788.000000 +-1015.509991 -1441.379401 -788.000000 +-1017.506414 -1441.498958 -788.000000 +-1019.502838 -1441.618516 -788.000000 +-1021.499261 -1441.738074 -788.000000 +-1023.495684 -1441.857631 -788.000000 +-1025.492108 -1441.977189 -788.000000 +-1027.488531 -1442.096747 -788.000000 +-1029.484954 -1442.216304 -788.000000 +-1031.481377 -1442.335862 -788.000000 +-1033.477801 -1442.455420 -788.000000 +-1035.474224 -1442.574977 -788.000000 +-1037.470647 -1442.694535 -788.000000 +-1039.467071 -1442.814093 -788.000000 +-1041.463494 -1442.933650 -788.000000 +-1043.459917 -1443.053208 -788.000000 +-1045.456340 -1443.172766 -788.000000 +-1047.452764 -1443.292323 -788.000000 +-1049.449187 -1443.411881 -788.000000 +-1051.445610 -1443.531439 -788.000000 +-1053.442034 -1443.650996 -788.000000 +-1055.438457 -1443.770554 -788.000000 +-1057.434880 -1443.890112 -788.000000 +-1059.431304 -1444.009669 -788.000000 +-1061.427727 -1444.129227 -788.000000 +-1063.424150 -1444.248785 -788.000000 +-1065.420573 -1444.368342 -788.000000 +-1067.416997 -1444.487900 -788.000000 +-1069.413420 -1444.607458 -788.000000 +-1071.409843 -1444.727015 -788.000000 +-1073.406267 -1444.846573 -788.000000 +-1075.402690 -1444.966131 -788.000000 +-1077.399113 -1445.085688 -788.000000 +-1079.395536 -1445.205246 -788.000000 +-1081.391960 -1445.324804 -788.000000 +-1083.388383 -1445.444361 -788.000000 +-1085.384806 -1445.563919 -788.000000 +-1087.381230 -1445.683477 -788.000000 +-1089.377653 -1445.803034 -788.000000 +-1091.374076 -1445.922592 -788.000000 +-1093.370500 -1446.042150 -788.000000 +-1095.366923 -1446.161707 -788.000000 +-1097.363346 -1446.281265 -788.000000 +-1099.359769 -1446.400823 -788.000000 +-1101.356193 -1446.520380 -788.000000 +-1103.352616 -1446.639938 -788.000000 +-1105.349039 -1446.759496 -788.000000 +-1107.345463 -1446.879053 -788.000000 +-1109.341886 -1446.998611 -788.000000 +-1111.338309 -1447.118169 -788.000000 +-1113.334732 -1447.237726 -788.000000 +-1115.331156 -1447.357284 -788.000000 +-1117.327579 -1447.476842 -788.000000 +-1119.324002 -1447.596399 -788.000000 +-1121.320426 -1447.715957 -788.000000 +-1123.316849 -1447.835515 -788.000000 +-1125.313272 -1447.955072 -788.000000 +-1127.309696 -1448.074630 -788.000000 +-1129.306119 -1448.194188 -788.000000 +-1131.302542 -1448.313745 -788.000000 +-1133.298965 -1448.433303 -788.000000 +-1135.295389 -1448.552861 -788.000000 +-1137.291812 -1448.672418 -788.000000 +-1139.288235 -1448.791976 -788.000000 +-1141.284659 -1448.911534 -788.000000 +-1143.281082 -1449.031091 -788.000000 +-1145.277505 -1449.150649 -788.000000 +-1147.273928 -1449.270207 -788.000000 +-1149.270352 -1449.389764 -788.000000 +-1151.266775 -1449.509322 -788.000000 +-1153.263198 -1449.628880 -788.000000 +-1155.259622 -1449.748437 -788.000000 +-1157.256045 -1449.867995 -788.000000 +-1159.252468 -1449.987553 -788.000000 +-1161.248891 -1450.107110 -788.000000 +-1163.245315 -1450.226668 -788.000000 +-1165.241738 -1450.346226 -788.000000 +-1167.238161 -1450.465783 -788.000000 +-1169.234585 -1450.585341 -788.000000 +-1171.231008 -1450.704899 -788.000000 +-1173.227431 -1450.824456 -788.000000 +-1175.223855 -1450.944014 -788.000000 +-1177.220278 -1451.063572 -788.000000 +-1179.216701 -1451.183129 -788.000000 +-1181.213124 -1451.302687 -788.000000 +-1183.209548 -1451.422245 -788.000000 +-1185.205971 -1451.541802 -788.000000 +-1187.202394 -1451.661360 -788.000000 +-1189.198818 -1451.780918 -788.000000 +-1191.195241 -1451.900475 -788.000000 +-1193.191664 -1452.020033 -788.000000 +-1195.188087 -1452.139591 -788.000000 +-1197.184511 -1452.259148 -788.000000 +-1199.180934 -1452.378706 -788.000000 +-1201.177357 -1452.498264 -788.000000 +-1203.173781 -1452.617821 -788.000000 +-1205.170204 -1452.737379 -788.000000 +-1207.166627 -1452.856937 -788.000000 +-1209.163051 -1452.976494 -788.000000 +-1211.159474 -1453.096052 -788.000000 +-1213.155897 -1453.215610 -788.000000 +-1215.152320 -1453.335167 -788.000000 +-1217.148744 -1453.454725 -788.000000 +-1219.145167 -1453.574283 -788.000000 +-1221.141590 -1453.693840 -788.000000 +-1223.138014 -1453.813398 -788.000000 +-1225.134437 -1453.932956 -788.000000 +-1227.130860 -1454.052513 -788.000000 +-1229.127283 -1454.172071 -788.000000 +-1231.123707 -1454.291629 -788.000000 +-1233.120130 -1454.411186 -788.000000 +-1235.116553 -1454.530744 -788.000000 +-1237.112977 -1454.650302 -788.000000 +-1239.109400 -1454.769859 -788.000000 +-1241.105823 -1454.889417 -788.000000 +-1243.102246 -1455.008975 -788.000000 +-1245.098670 -1455.128533 -788.000000 +-1247.095093 -1455.248090 -788.000000 +-1249.091516 -1455.367648 -788.000000 +-1251.087940 -1455.487206 -788.000000 +-1253.084363 -1455.606763 -788.000000 +-1255.080786 -1455.726321 -788.000000 +-1257.077210 -1455.845879 -788.000000 +-1259.073633 -1455.965436 -788.000000 +-1261.070056 -1456.084994 -788.000000 +-1263.066479 -1456.204552 -788.000000 +-1265.062903 -1456.324109 -788.000000 +-1268.000000 -1456.500000 -788.000000 +-1269.925081 -1456.933821 -787.674634 +-1271.850162 -1457.367642 -787.349268 +-1273.775243 -1457.801463 -787.023903 +-1275.700324 -1458.235284 -786.698537 +-1277.625404 -1458.669105 -786.373171 +-1279.550485 -1459.102926 -786.047805 +-1281.475566 -1459.536747 -785.722440 +-1283.400647 -1459.970568 -785.397074 +-1285.325728 -1460.404389 -785.071708 +-1287.250809 -1460.838210 -784.746342 +-1289.175890 -1461.272031 -784.420976 +-1291.100971 -1461.705853 -784.095611 +-1293.026051 -1462.139674 -783.770245 +-1294.951132 -1462.573495 -783.444879 +-1296.876213 -1463.007316 -783.119513 +-1298.801294 -1463.441137 -782.794147 +-1300.726375 -1463.874958 -782.468782 +-1302.651456 -1464.308779 -782.143416 +-1304.576537 -1464.742600 -781.818050 +-1306.501618 -1465.176421 -781.492684 +-1308.426699 -1465.610242 -781.167319 +-1310.351779 -1466.044063 -780.841953 +-1312.276860 -1466.477884 -780.516587 +-1314.201941 -1466.911705 -780.191221 +-1316.127022 -1467.345526 -779.865855 +-1318.052103 -1467.779347 -779.540490 +-1319.977184 -1468.213168 -779.215124 +-1321.902265 -1468.646989 -778.889758 +-1323.827346 -1469.080810 -778.564392 +-1325.752427 -1469.514631 -778.239027 +-1327.677507 -1469.948452 -777.913661 +-1329.602588 -1470.382273 -777.588295 +-1331.527669 -1470.816094 -777.262929 +-1333.452750 -1471.249916 -776.937563 +-1335.377831 -1471.683737 -776.612198 diff --git a/ReleaseFiles/Id1/pak10.pak b/ReleaseFiles/Id1/pak10.pak index ef96558a..19e43de4 100644 Binary files a/ReleaseFiles/Id1/pak10.pak and b/ReleaseFiles/Id1/pak10.pak differ diff --git a/ReleaseFiles/Id1/pak11.pak b/ReleaseFiles/Id1/pak11.pak index 3bbdf19f..e3b604a3 100644 Binary files a/ReleaseFiles/Id1/pak11.pak and b/ReleaseFiles/Id1/pak11.pak differ diff --git a/ReleaseFiles/Id1/pak12.pak b/ReleaseFiles/Id1/pak12.pak index 20a5dfbf..4dd7d552 100644 Binary files a/ReleaseFiles/Id1/pak12.pak and b/ReleaseFiles/Id1/pak12.pak differ diff --git a/ReleaseFiles/SDL2.dll b/ReleaseFiles/SDL2.dll new file mode 100644 index 00000000..36cf97f9 Binary files /dev/null and b/ReleaseFiles/SDL2.dll differ diff --git a/ReleaseFiles/actions.json b/ReleaseFiles/actions.json index eab84e8f..a5847c37 100644 --- a/ReleaseFiles/actions.json +++ b/ReleaseFiles/actions.json @@ -1,5 +1,17 @@ { "actions": [ + { + "name": "/actions/default/in/LeftHandAnim", + "type": "skeleton", + "skeleton": "/skeleton/hand/left", + "requirement": "suggested" + }, + { + "name": "/actions/default/in/RightHandAnim", + "type": "skeleton", + "skeleton": "/skeleton/hand/right", + "requirement": "suggested" + }, { "name": "/actions/default/in/Locomotion", "type": "vector2" @@ -87,12 +99,60 @@ { "name": "/actions/default/out/RightHaptic", "type": "vibration" + }, + { + "name": "/actions/menu/in/Navigation", + "type": "vector2" + }, + { + "name": "/actions/menu/in/Up", + "type": "boolean" + }, + { + "name": "/actions/menu/in/Down", + "type": "boolean" + }, + { + "name": "/actions/menu/in/Left", + "type": "boolean" + }, + { + "name": "/actions/menu/in/Right", + "type": "boolean" + }, + { + "name": "/actions/menu/in/Enter", + "type": "boolean" + }, + { + "name": "/actions/menu/in/Back", + "type": "boolean" + }, + { + "name": "/actions/menu/in/AddToShortcuts", + "type": "boolean" + }, + { + "name": "/actions/menu/in/MultiplierHalf", + "type": "boolean" + }, + { + "name": "/actions/menu/in/MultiplierPlusOne", + "type": "boolean" + }, + { + "name": "/actions/menu/in/MultiplierPlusOne2", + "type": "boolean" } ], "action_sets": [ { "name": "/actions/default", "usage": "leftright" + }, + { + "name": "/actions/menu", + "usage": "leftright" } ], "default_bindings": [ @@ -145,7 +205,20 @@ "/actions/default/in/BTurnLeft": "(Boolean) Turn Left", "/actions/default/in/BTurnRight": "(Boolean) Turn Right", "/actions/default/out/LeftHaptic": "Left Hand Haptic", - "/actions/default/out/RightHaptic": "Right Hand Haptic" + "/actions/default/out/RightHaptic": "Right Hand Haptic", + "/actions/default/in/LeftHandAnim": "Left Hand Skeleton", + "/actions/default/in/RightHandAnim": "Right Hand Skeleton", + "/actions/menu/in/Navigation": "Menu - Navigation", + "/actions/menu/in/Up": "Menu - Up", + "/actions/menu/in/Down": "Menu - Down", + "/actions/menu/in/Left": "Menu - Left", + "/actions/menu/in/Right": "Menu - Right", + "/actions/menu/in/Enter": "Menu - Enter", + "/actions/menu/in/Back": "Menu - Back", + "/actions/menu/in/AddToShortcuts": "Menu - Add To Shortcuts", + "/actions/menu/in/MultiplierHalf": "Menu - Value Multiplier (Half)", + "/actions/menu/in/MultiplierPlusOne": "Menu - Value Multiplier (Double) (1)", + "/actions/menu/in/MultiplierPlusOne2": "Menu - Value Multiplier (Double) (2)" } ] } diff --git a/ReleaseFiles/bindings_cosmos.json b/ReleaseFiles/bindings_cosmos.json index d3537f9b..a7fae8f3 100644 --- a/ReleaseFiles/bindings_cosmos.json +++ b/ReleaseFiles/bindings_cosmos.json @@ -1,132 +1,217 @@ { - "action_manifest_version": 0, - "alias_info": {}, - "app_key": "system.generated.quakevr.exe", - "bindings": { - "/actions/default": { - "chords": [], - "haptics": [ - { - "output": "/actions/default/out/lefthaptic", - "path": "/user/hand/left/output/haptic" - }, - { - "output": "/actions/default/out/righthaptic", - "path": "/user/hand/right/output/haptic" - } - ], - "poses": [], - "skeleton": [], - "sources": [ - { - "inputs": { - "click": { - "output": "/actions/default/in/speed" - }, - "position": { - "output": "/actions/default/in/Locomotion" - } - }, - "mode": "joystick", - "path": "/user/hand/left/input/thumbstick" - }, - { - "inputs": { - "position": { - "output": "/actions/default/in/Turn" - } - }, - "mode": "joystick", - "path": "/user/hand/right/input/thumbstick" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/FireMainHand" - } - }, - "mode": "button", - "path": "/user/hand/right/input/trigger" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/Jump" - } - }, - "mode": "button", - "path": "/user/hand/right/input/a" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponMainHand" - } - }, - "mode": "button", - "path": "/user/hand/right/input/b" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/Escape" - } - }, - "mode": "button", - "path": "/user/hand/left/input/a" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponOffHand" - } - }, - "mode": "button", - "path": "/user/hand/left/input/b" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/fireoffhand" - } - }, - "mode": "button", - "path": "/user/hand/left/input/trigger" - }, - { - "inputs": { - "touch": { - "output": "/actions/default/in/teleport" - } - }, - "mode": "button", - "path": "/user/hand/left/input/trackpad" - }, - { - "inputs": { - "grab": { - "output": "/actions/default/in/leftgrab" - } - }, - "mode": "grab", - "path": "/user/hand/left/input/grip" - }, - { - "inputs": { - "grab": { - "output": "/actions/default/in/rightgrab" - } - }, - "mode": "grab", - "path": "/user/hand/right/input/grip" - } - ] - } - }, - "category": "steamvr_input", - "controller_type": "vive_controller", - "description": "The default binding for Cosmos controllers", - "name": "Default Cosmos Controller Binding", - "options": {}, - "simulated_actions": [] + "action_manifest_version": 0, + "alias_info": {}, + "app_key": "system.generated.quakevr.exe", + "bindings": { + "/actions/default": { + "chords": [], + "haptics": [ + { + "output": "/actions/default/out/lefthaptic", + "path": "/user/hand/left/output/haptic" + }, + { + "output": "/actions/default/out/righthaptic", + "path": "/user/hand/right/output/haptic" + } + ], + "poses": [], + "skeleton": [ + { + "output": "/actions/default/in/LeftHandAnim", + "path": "/user/hand/left/input/skeleton/left" + }, + { + "output": "/actions/default/in/RightHandAnim", + "path": "/user/hand/right/input/skeleton/right" + } + ], + "sources": [ + { + "inputs": { + "click": { + "output": "/actions/default/in/speed" + }, + "position": { + "output": "/actions/default/in/Locomotion" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "position": { + "output": "/actions/default/in/Turn" + } + }, + "mode": "joystick", + "path": "/user/hand/right/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/FireMainHand" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/Jump" + } + }, + "mode": "button", + "path": "/user/hand/right/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/NextWeaponMainHand" + } + }, + "mode": "button", + "path": "/user/hand/right/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/Escape" + } + }, + "mode": "button", + "path": "/user/hand/left/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/NextWeaponOffHand" + } + }, + "mode": "button", + "path": "/user/hand/left/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/fireoffhand" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "touch": { + "output": "/actions/default/in/teleport" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "grab": { + "output": "/actions/default/in/leftgrab" + } + }, + "mode": "grab", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "grab": { + "output": "/actions/default/in/rightgrab" + } + }, + "mode": "grab", + "path": "/user/hand/right/input/grip" + } + ] + }, + "/actions/menu": { + "sources": [ + { + "inputs": { + "position": { + "output": "/actions/menu/in/navigation" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/left" + } + }, + "mode": "button", + "path": "/user/hand/left/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/right" + } + }, + "mode": "button", + "path": "/user/hand/right/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/enter" + } + }, + "mode": "button", + "path": "/user/hand/right/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/back" + } + }, + "mode": "button", + "path": "/user/hand/left/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierhalf" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierplusone" + } + }, + "mode": "trigger", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierplusone2" + } + }, + "mode": "trigger", + "path": "/user/hand/right/input/trigger" + } + ] + } + }, + "category": "steamvr_input", + "controller_type": "vive_controller", + "description": "The default binding for Cosmos controllers", + "name": "Default Cosmos Controller Binding", + "options": {}, + "simulated_actions": [] } diff --git a/ReleaseFiles/bindings_generic.json b/ReleaseFiles/bindings_generic.json index f2a1ea79..2b4f1b8d 100644 --- a/ReleaseFiles/bindings_generic.json +++ b/ReleaseFiles/bindings_generic.json @@ -1,132 +1,141 @@ { - "action_manifest_version": 0, - "alias_info": {}, - "app_key": "system.generated.quakevr.exe", - "bindings": { - "/actions/default": { - "chords": [], - "haptics": [ - { - "output": "/actions/default/out/lefthaptic", - "path": "/user/hand/left/output/haptic" - }, - { - "output": "/actions/default/out/righthaptic", - "path": "/user/hand/right/output/haptic" - } - ], - "poses": [], - "skeleton": [], - "sources": [ - { - "inputs": { - "click": { - "output": "/actions/default/in/speed" - }, - "position": { - "output": "/actions/default/in/Locomotion" - } - }, - "mode": "joystick", - "path": "/user/hand/left/input/thumbstick" - }, - { - "inputs": { - "position": { - "output": "/actions/default/in/Turn" - } - }, - "mode": "joystick", - "path": "/user/hand/right/input/thumbstick" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/FireMainHand" - } - }, - "mode": "button", - "path": "/user/hand/right/input/trigger" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/Jump" - } - }, - "mode": "button", - "path": "/user/hand/right/input/a" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponMainHand" - } - }, - "mode": "button", - "path": "/user/hand/right/input/b" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/Escape" - } - }, - "mode": "button", - "path": "/user/hand/left/input/a" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponOffHand" - } - }, - "mode": "button", - "path": "/user/hand/left/input/b" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/fireoffhand" - } - }, - "mode": "button", - "path": "/user/hand/left/input/trigger" - }, - { - "inputs": { - "touch": { - "output": "/actions/default/in/teleport" - } - }, - "mode": "button", - "path": "/user/hand/left/input/trackpad" - }, - { - "inputs": { - "grab": { - "output": "/actions/default/in/leftgrab" - } - }, - "mode": "grab", - "path": "/user/hand/left/input/grip" - }, - { - "inputs": { - "grab": { - "output": "/actions/default/in/rightgrab" - } - }, - "mode": "grab", - "path": "/user/hand/right/input/grip" - } - ] - } - }, - "category": "steamvr_input", - "controller_type": "generic", - "description": "The default binding for generic controllers", - "name": "Default Generic Controller Binding", - "options": {}, - "simulated_actions": [] + "action_manifest_version": 0, + "alias_info": {}, + "app_key": "system.generated.quakevr.exe", + "bindings": { + "/actions/default": { + "chords": [], + "haptics": [ + { + "output": "/actions/default/out/lefthaptic", + "path": "/user/hand/left/output/haptic" + }, + { + "output": "/actions/default/out/righthaptic", + "path": "/user/hand/right/output/haptic" + } + ], + "poses": [], + "skeleton": [ + { + "output": "/actions/default/in/LeftHandAnim", + "path": "/user/hand/left/input/skeleton/left" + }, + { + "output": "/actions/default/in/RightHandAnim", + "path": "/user/hand/right/input/skeleton/right" + } + ], + "sources": [ + { + "inputs": { + "click": { + "output": "/actions/default/in/speed" + }, + "position": { + "output": "/actions/default/in/Locomotion" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "position": { + "output": "/actions/default/in/Turn" + } + }, + "mode": "joystick", + "path": "/user/hand/right/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/FireMainHand" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/Jump" + } + }, + "mode": "button", + "path": "/user/hand/right/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/NextWeaponMainHand" + } + }, + "mode": "button", + "path": "/user/hand/right/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/Escape" + } + }, + "mode": "button", + "path": "/user/hand/left/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/NextWeaponOffHand" + } + }, + "mode": "button", + "path": "/user/hand/left/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/fireoffhand" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "touch": { + "output": "/actions/default/in/teleport" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "grab": { + "output": "/actions/default/in/leftgrab" + } + }, + "mode": "grab", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "grab": { + "output": "/actions/default/in/rightgrab" + } + }, + "mode": "grab", + "path": "/user/hand/right/input/grip" + } + ] + } + }, + "category": "steamvr_input", + "controller_type": "generic", + "description": "The default binding for generic controllers", + "name": "Default Generic Controller Binding", + "options": {}, + "simulated_actions": [] } diff --git a/ReleaseFiles/bindings_holographic.json b/ReleaseFiles/bindings_holographic.json index 7b704e36..97a2c4a0 100644 --- a/ReleaseFiles/bindings_holographic.json +++ b/ReleaseFiles/bindings_holographic.json @@ -16,7 +16,16 @@ } ], "poses": [], - "skeleton": [], + "skeleton": [ + { + "output": "/actions/default/in/lefthandanim", + "path": "/user/hand/left/input/skeleton/left" + }, + { + "output": "/actions/default/in/RightHandAnim", + "path": "/user/hand/right/input/skeleton/right" + } + ], "sources": [ { "inputs": { @@ -119,14 +128,153 @@ }, "mode": "button", "path": "/user/hand/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/jump" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trackpad" + }, + { + "inputs": { + "position": { + "output": "/actions/default/in/turn" + } + }, + "mode": "joystick", + "path": "/user/hand/right/input/joystick" + }, + { + "inputs": { + "position": { + "output": "/actions/default/in/locomotion" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/joystick" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/escape" + } + }, + "mode": "button", + "path": "/user/hand/right/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/escape" + } + }, + "mode": "button", + "path": "/user/hand/left/input/application_menu" + } + ] + }, + "/actions/menu": { + "sources": [ + { + "inputs": { + "position": { + "output": "/actions/menu/in/navigation" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/joystick" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/enter" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/left" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/back" + } + }, + "mode": "button", + "path": "/user/hand/left/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/back" + } + }, + "mode": "button", + "path": "/user/hand/right/input/application_menu" + }, + { + "inputs": { + "position": { + "output": "/actions/menu/in/navigation" + } + }, + "mode": "joystick", + "path": "/user/hand/right/input/joystick" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/right" + } + }, + "mode": "button", + "path": "/user/hand/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/left" + } + }, + "mode": "button", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/down" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/up" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" } ] } }, "category": "steamvr_input", "controller_type": "holographic_controller", - "description": "The default binding for Holographic controllers", - "name": "Default Holographic Controller Binding", + "description": "The default bindings for Holographic controllers", + "name": "WMR bindings for QuakeVR", "options": {}, "simulated_actions": [] } diff --git a/ReleaseFiles/bindings_knuckles.json b/ReleaseFiles/bindings_knuckles.json index 8caa9c72..f55958fa 100644 --- a/ReleaseFiles/bindings_knuckles.json +++ b/ReleaseFiles/bindings_knuckles.json @@ -1,132 +1,217 @@ { - "action_manifest_version": 0, - "alias_info": {}, - "app_key": "system.generated.quakevr.exe", - "bindings": { - "/actions/default": { - "chords": [], - "haptics": [ + "action_manifest_version" : 0, + "alias_info" : {}, + "app_key" : "system.generated.quakevr.exe", + "bindings" : { + "/actions/default" : { + "chords" : [], + "haptics" : [ { - "output": "/actions/default/out/lefthaptic", - "path": "/user/hand/left/output/haptic" + "output" : "/actions/default/out/lefthaptic", + "path" : "/user/hand/left/output/haptic" }, { - "output": "/actions/default/out/righthaptic", - "path": "/user/hand/right/output/haptic" + "output" : "/actions/default/out/righthaptic", + "path" : "/user/hand/right/output/haptic" } ], - "poses": [], - "skeleton": [], - "sources": [ + "poses" : [], + "skeleton" : [ { - "inputs": { - "click": { - "output": "/actions/default/in/speed" + "output" : "/actions/default/in/LeftHandAnim", + "path" : "/user/hand/left/input/skeleton/left" + }, + { + "output" : "/actions/default/in/RightHandAnim", + "path" : "/user/hand/right/input/skeleton/right" + } + ], + "sources" : [ + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/speed" }, - "position": { - "output": "/actions/default/in/Locomotion" + "position" : { + "output" : "/actions/default/in/Locomotion" + } + }, + "mode" : "joystick", + "path" : "/user/hand/left/input/thumbstick" + }, + { + "inputs" : { + "position" : { + "output" : "/actions/default/in/Turn" + } + }, + "mode" : "joystick", + "path" : "/user/hand/right/input/thumbstick" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/FireMainHand" + } + }, + "mode" : "button", + "path" : "/user/hand/right/input/trigger" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/Jump" + } + }, + "mode" : "button", + "path" : "/user/hand/right/input/a" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/NextWeaponMainHand" + } + }, + "mode" : "button", + "path" : "/user/hand/right/input/b" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/NextWeaponOffHand" + } + }, + "mode" : "button", + "path" : "/user/hand/left/input/b" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/fireoffhand" } }, - "mode": "joystick", - "path": "/user/hand/left/input/thumbstick" + "mode" : "button", + "path" : "/user/hand/left/input/trigger" }, { - "inputs": { - "position": { - "output": "/actions/default/in/Turn" + "inputs" : { + "touch" : { + "output" : "/actions/default/in/teleport" } }, - "mode": "joystick", - "path": "/user/hand/right/input/thumbstick" + "mode" : "button", + "path" : "/user/hand/left/input/trackpad" }, { - "inputs": { - "click": { - "output": "/actions/default/in/FireMainHand" + "inputs" : { + "grab" : { + "output" : "/actions/default/in/leftgrab" } }, - "mode": "button", - "path": "/user/hand/right/input/trigger" + "mode" : "grab", + "path" : "/user/hand/left/input/grip" }, { - "inputs": { - "click": { - "output": "/actions/default/in/Jump" + "inputs" : { + "grab" : { + "output" : "/actions/default/in/rightgrab" + } + }, + "mode" : "grab", + "path" : "/user/hand/right/input/grip" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/escape" + } + }, + "mode" : "button", + "path" : "/user/hand/left/input/a" + } + ] + }, + "/actions/menu" : { + "sources" : [ + { + "inputs" : { + "position" : { + "output" : "/actions/menu/in/navigation" } }, - "mode": "button", - "path": "/user/hand/right/input/a" + "mode" : "joystick", + "path" : "/user/hand/left/input/thumbstick" }, { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponMainHand" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/left" } }, - "mode": "button", - "path": "/user/hand/right/input/b" + "mode" : "button", + "path" : "/user/hand/left/input/b" }, { - "inputs": { - "click": { - "output": "/actions/default/in/Escape" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/right" } }, - "mode": "button", - "path": "/user/hand/left/input/a" + "mode" : "button", + "path" : "/user/hand/right/input/b" }, { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponOffHand" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/enter" } }, - "mode": "button", - "path": "/user/hand/left/input/b" + "mode" : "button", + "path" : "/user/hand/right/input/a" }, { - "inputs": { - "click": { - "output": "/actions/default/in/fireoffhand" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/back" } }, - "mode": "button", - "path": "/user/hand/left/input/trigger" + "mode" : "button", + "path" : "/user/hand/left/input/a" }, { - "inputs": { - "touch": { - "output": "/actions/default/in/teleport" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/multiplierhalf" } }, - "mode": "button", - "path": "/user/hand/left/input/trackpad" + "mode" : "button", + "path" : "/user/hand/left/input/trackpad" }, { - "inputs": { - "grab": { - "output": "/actions/default/in/leftgrab" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/multiplierplusone" } }, - "mode": "grab", - "path": "/user/hand/left/input/grip" + "mode" : "trigger", + "path" : "/user/hand/left/input/trigger" }, { - "inputs": { - "grab": { - "output": "/actions/default/in/rightgrab" + "inputs" : { + "click" : { + "output" : "/actions/menu/in/multiplierplusone2" } }, - "mode": "grab", - "path": "/user/hand/right/input/grip" + "mode" : "trigger", + "path" : "/user/hand/right/input/trigger" } ] } }, - "category": "steamvr_input", - "controller_type": "knuckles", - "description": "The default binding for Valve Index controllers", - "name": "Default Index Controller Binding", - "options": {}, - "simulated_actions": [] + "category" : "steamvr_input", + "controller_type" : "knuckles", + "description" : "The default binding for Valve Index controllers", + "name" : "Default Index Controller Binding", + "options" : {}, + "simulated_actions" : [] } diff --git a/ReleaseFiles/bindings_touch.json b/ReleaseFiles/bindings_touch.json index 6399cee2..3a2e7b94 100644 --- a/ReleaseFiles/bindings_touch.json +++ b/ReleaseFiles/bindings_touch.json @@ -4,7 +4,8 @@ "bindings": { "/actions/default": { "chords": [], - "haptics": [{ + "haptics": [ + { "output": "/actions/default/out/LeftHaptic", "path": "/user/hand/left/output/haptic" }, @@ -14,8 +15,18 @@ } ], "poses": [], - "skeleton": [], - "sources": [{ + "skeleton": [ + { + "output": "/actions/default/in/LeftHandAnim", + "path": "/user/hand/left/input/skeleton/left" + }, + { + "output": "/actions/default/in/RightHandAnim", + "path": "/user/hand/right/input/skeleton/right" + } + ], + "sources": [ + { "inputs": { "position": { "output": "/actions/default/in/Locomotion" @@ -95,6 +106,121 @@ }, "mode": "button", "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/speed" + }, + "position": { + "output": "/actions/default/in/locomotion" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/joystick" + }, + { + "inputs": { + "position": { + "output": "/actions/default/in/turn" + } + }, + "mode": "joystick", + "path": "/user/hand/right/input/joystick" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/leftgrab" + } + }, + "mode": "trigger", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/rightgrab" + } + }, + "mode": "trigger", + "path": "/user/hand/right/input/grip" + } + ] + }, + "/actions/menu": { + "sources": [ + { + "inputs": { + "position": { + "output": "/actions/menu/in/navigation" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/left" + } + }, + "mode": "button", + "path": "/user/hand/left/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/right" + } + }, + "mode": "button", + "path": "/user/hand/right/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/enter" + } + }, + "mode": "button", + "path": "/user/hand/right/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/back" + } + }, + "mode": "button", + "path": "/user/hand/left/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierhalf" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierplusone" + } + }, + "mode": "trigger", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierplusone2" + } + }, + "mode": "trigger", + "path": "/user/hand/right/input/trigger" } ] } diff --git a/ReleaseFiles/bindings_vive.json b/ReleaseFiles/bindings_vive.json index fd4d42e1..34ebf7ee 100644 --- a/ReleaseFiles/bindings_vive.json +++ b/ReleaseFiles/bindings_vive.json @@ -1,132 +1,217 @@ { - "action_manifest_version": 0, - "alias_info": {}, - "app_key": "system.generated.quakevr.exe", - "bindings": { - "/actions/default": { - "chords": [], - "haptics": [ - { - "output": "/actions/default/out/lefthaptic", - "path": "/user/hand/left/output/haptic" - }, - { - "output": "/actions/default/out/righthaptic", - "path": "/user/hand/right/output/haptic" - } - ], - "poses": [], - "skeleton": [], - "sources": [ - { - "inputs": { - "click": { - "output": "/actions/default/in/speed" - }, - "position": { - "output": "/actions/default/in/Locomotion" - } - }, - "mode": "joystick", - "path": "/user/hand/left/input/thumbstick" - }, - { - "inputs": { - "position": { - "output": "/actions/default/in/Turn" - } - }, - "mode": "joystick", - "path": "/user/hand/right/input/thumbstick" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/FireMainHand" - } - }, - "mode": "button", - "path": "/user/hand/right/input/trigger" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/Jump" - } - }, - "mode": "button", - "path": "/user/hand/right/input/a" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponMainHand" - } - }, - "mode": "button", - "path": "/user/hand/right/input/b" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/Escape" - } - }, - "mode": "button", - "path": "/user/hand/left/input/a" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/NextWeaponOffHand" - } - }, - "mode": "button", - "path": "/user/hand/left/input/b" - }, - { - "inputs": { - "click": { - "output": "/actions/default/in/fireoffhand" - } - }, - "mode": "button", - "path": "/user/hand/left/input/trigger" - }, - { - "inputs": { - "touch": { - "output": "/actions/default/in/teleport" - } - }, - "mode": "button", - "path": "/user/hand/left/input/trackpad" - }, - { - "inputs": { - "grab": { - "output": "/actions/default/in/leftgrab" - } - }, - "mode": "grab", - "path": "/user/hand/left/input/grip" - }, - { - "inputs": { - "grab": { - "output": "/actions/default/in/rightgrab" - } - }, - "mode": "grab", - "path": "/user/hand/right/input/grip" - } - ] - } - }, - "category": "steamvr_input", - "controller_type": "vive_controller", - "description": "The default binding for Vive controllers", - "name": "Default Vive Controller Binding", - "options": {}, - "simulated_actions": [] + "action_manifest_version": 0, + "alias_info": {}, + "app_key": "system.generated.quakevr.exe", + "bindings": { + "/actions/default": { + "chords": [], + "haptics": [ + { + "output": "/actions/default/out/lefthaptic", + "path": "/user/hand/left/output/haptic" + }, + { + "output": "/actions/default/out/righthaptic", + "path": "/user/hand/right/output/haptic" + } + ], + "poses": [], + "skeleton": [ + { + "output": "/actions/default/in/LeftHandAnim", + "path": "/user/hand/left/input/skeleton/left" + }, + { + "output": "/actions/default/in/RightHandAnim", + "path": "/user/hand/right/input/skeleton/right" + } + ], + "sources": [ + { + "inputs": { + "click": { + "output": "/actions/default/in/speed" + }, + "position": { + "output": "/actions/default/in/Locomotion" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "position": { + "output": "/actions/default/in/Turn" + } + }, + "mode": "joystick", + "path": "/user/hand/right/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/FireMainHand" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/Jump" + } + }, + "mode": "button", + "path": "/user/hand/right/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/NextWeaponMainHand" + } + }, + "mode": "button", + "path": "/user/hand/right/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/Escape" + } + }, + "mode": "button", + "path": "/user/hand/left/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/NextWeaponOffHand" + } + }, + "mode": "button", + "path": "/user/hand/left/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/default/in/fireoffhand" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "touch": { + "output": "/actions/default/in/teleport" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "grab": { + "output": "/actions/default/in/leftgrab" + } + }, + "mode": "grab", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "grab": { + "output": "/actions/default/in/rightgrab" + } + }, + "mode": "grab", + "path": "/user/hand/right/input/grip" + } + ] + }, + "/actions/menu": { + "sources": [ + { + "inputs": { + "position": { + "output": "/actions/menu/in/navigation" + } + }, + "mode": "joystick", + "path": "/user/hand/left/input/thumbstick" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/left" + } + }, + "mode": "button", + "path": "/user/hand/left/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/right" + } + }, + "mode": "button", + "path": "/user/hand/right/input/b" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/enter" + } + }, + "mode": "button", + "path": "/user/hand/right/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/back" + } + }, + "mode": "button", + "path": "/user/hand/left/input/a" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierhalf" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierplusone" + } + }, + "mode": "trigger", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/menu/in/multiplierplusone2" + } + }, + "mode": "trigger", + "path": "/user/hand/right/input/trigger" + } + ] + } + }, + "category": "steamvr_input", + "controller_type": "vive_controller", + "description": "The default binding for Vive controllers", + "name": "Default Vive Controller Binding", + "options": {}, + "simulated_actions": [] } diff --git a/ReleaseFiles/glew32.dll b/ReleaseFiles/glew32.dll new file mode 100644 index 00000000..04f93819 Binary files /dev/null and b/ReleaseFiles/glew32.dll differ diff --git a/ReleaseFiles/quakevr-debug-novr.bat b/ReleaseFiles/quakevr-debug-novr.bat new file mode 100644 index 00000000..5e27b6e1 --- /dev/null +++ b/ReleaseFiles/quakevr-debug-novr.bat @@ -0,0 +1 @@ +quakevr-debug.exe -novr \ No newline at end of file diff --git a/ReleaseFiles/quakevr-novr.bat b/ReleaseFiles/quakevr-novr.bat new file mode 100644 index 00000000..029f3fa7 --- /dev/null +++ b/ReleaseFiles/quakevr-novr.bat @@ -0,0 +1 @@ +quakevr.exe -novr \ No newline at end of file diff --git a/Windows/CMakeLists.txt b/Windows/CMakeLists.txt deleted file mode 100644 index 39117b5b..00000000 --- a/Windows/CMakeLists.txt +++ /dev/null @@ -1,158 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - -project(quakespasm-sdl2 VERSION 0.0.1 LANGUAGES CXX) - -set(source_list - "../Quake/bgmusic.cpp" - "../Quake/cd_sdl.cpp" - "../Quake/cfgfile.cpp" - "../Quake/chase.cpp" - "../Quake/cl_demo.cpp" - "../Quake/cl_input.cpp" - "../Quake/cl_main.cpp" - "../Quake/cl_parse.cpp" - "../Quake/cl_tent.cpp" - "../Quake/cmd.cpp" - "../Quake/common.cpp" - "../Quake/console.cpp" - "../Quake/crc.cpp" - "../Quake/cvar.cpp" - "../Quake/gl_draw.cpp" - "../Quake/gl_fog.cpp" - "../Quake/gl_mesh.cpp" - "../Quake/gl_model.cpp" - "../Quake/gl_refrag.cpp" - "../Quake/gl_rlight.cpp" - "../Quake/gl_rmain.cpp" - "../Quake/gl_rmisc.cpp" - "../Quake/gl_screen.cpp" - "../Quake/gl_sky.cpp" - "../Quake/gl_texmgr.cpp" - "../Quake/gl_vidsdl.cpp" - "../Quake/gl_warp.cpp" - "../Quake/host.cpp" - "../Quake/host_cmd.cpp" - "../Quake/image.cpp" - "../Quake/in_sdl.cpp" - "../Quake/keys.cpp" - "../Quake/main_sdl.cpp" - "../Quake/mathlib.cpp" - "../Quake/menu.cpp" - "../Quake/menu_util.cpp" - "../Quake/net_dgrm.cpp" - "../Quake/net_loop.cpp" - "../Quake/net_main.cpp" - "../Quake/net_udp.cpp" - "../Quake/pr_cmds.cpp" - "../Quake/pr_edict.cpp" - "../Quake/pr_exec.cpp" - "../Quake/r_alias.cpp" - "../Quake/r_brush.cpp" - "../Quake/r_part.cpp" - "../Quake/r_sprite.cpp" - "../Quake/r_world.cpp" - "../Quake/sbar.cpp" - "../Quake/snd_codec.cpp" - "../Quake/snd_dma.cpp" - "../Quake/snd_flac.cpp" - "../Quake/snd_mem.cpp" - "../Quake/snd_mikmod.cpp" - "../Quake/snd_mix.cpp" - "../Quake/snd_modplug.cpp" - "../Quake/snd_mp3.cpp" - "../Quake/snd_mp3tag.cpp" - "../Quake/snd_mpg123.cpp" - "../Quake/snd_opus.cpp" - "../Quake/snd_sdl.cpp" - "../Quake/snd_umx.cpp" - "../Quake/snd_vorbis.cpp" - "../Quake/snd_wave.cpp" - "../Quake/snd_xmp.cpp" - "../Quake/strlcat.cpp" - "../Quake/strlcpy.cpp" - "../Quake/sv_main.cpp" - "../Quake/sv_move.cpp" - "../Quake/sv_phys.cpp" - "../Quake/sv_user.cpp" - "../Quake/view.cpp" - "../Quake/vr.cpp" - "../Quake/wad.cpp" - "../Quake/world.cpp" - "../Quake/zone.cpp" -) - -if (WIN32) - list(APPEND source_list - "../Quake/net_win.cpp" - "../Quake/net_wins.cpp" - "../Quake/net_wipx.cpp" - "../Quake/pl_win.cpp" - "../Quake/sys_sdl_win.cpp" - ) -else() - list(APPEND source_list - "../Quake/net_bsd.cpp" - "../Quake/pl_linux.cpp" - "../Quake/sys_sdl_unix.cpp" - ) -endif() - - -set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX ) - -add_executable(quakespasm-sdl2 "${CMAKE_CURRENT_SOURCE_DIR}/../Quake/vr.cpp" "${source_list}") -set_target_properties(quakespasm-sdl2 PROPERTIES LINKER_LANGUAGE CXX) - -target_compile_features(quakespasm-sdl2 PUBLIC cxx_std_17) -target_compile_options(quakespasm-sdl2 - PRIVATE -x c++ -Wall -Wextra -Wno-missing-field-initializers -fdiagnostics-color=always -Wpedantic -Wimplicit-fallthrough -g - -Wno-language-extension-token -Wno-nested-anon-types -Wno-gnu-anonymous-struct -Wno-deprecated-declarations -Wno-microsoft-enum-value # WIN32 only - -Wfallthrough -) - # -fsanitize=address) -target_compile_definitions(quakespasm-sdl2 PRIVATE USE_SDL2=1 _AMD64_=1) - -target_include_directories( - quakespasm-sdl2 PUBLIC - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/SDL2/include/> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../Quake/> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../glm/> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> -) - -include(FindOpenGL) - -if (WIN32) - set(SDL2_LIBRARIES - "C:/OHWorkspace/quakevr/Windows/SDL2/lib64/SDL2main.lib" - "C:/OHWorkspace/quakevr/Windows/SDL2/lib64/SDL2.lib" - ) - - target_link_libraries(quakespasm-sdl2 - ${OPENGL_gl_LIBRARY} ${SDL2_LIBRARIES} wsock32 winmm ws2_32 - ) - - set(OPENVR_LIBRARIES - "C:/OHWorkspace/quakevr/Windows/OpenVR/lib/win64/openvr_api.lib" - ) - - target_link_libraries(quakespasm-sdl2 - ${OPENGL_gl_LIBRARY} ${SDL2_LIBRARIES} ${OPENVR_LIBRARIES} - ) -else() - find_package(SDL2 REQUIRED) - include_directories(${SDL2_INCLUDE_DIRS}) - - set(OPENVR_LIBRARIES - "/home/vittorioromeo/Repos/openvr/bin/linux64/libopenvr_api.so" - ) - - target_link_libraries(quakespasm-sdl2 - asan ${OPENGL_gl_LIBRARY} SDL2::SDL2 ${OPENVR_LIBRARIES} - ) -endif() - - diff --git a/Windows/SDL/BUGS b/Windows/SDL/BUGS deleted file mode 100644 index 218bf3d1..00000000 --- a/Windows/SDL/BUGS +++ /dev/null @@ -1,18 +0,0 @@ - -Bugs are now managed in the SDL bug tracker, here: - - http://bugzilla.libsdl.org/ - -You may report bugs there, and search to see if a given issue has already - been reported, discussed, and maybe even fixed. - - - -You may also find help at the SDL mailing list. Subscription information: - - http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org - -Bug reports are welcome here, but we really appreciate if you use Bugzilla, as - bugs discussed on the mailing list may be forgotten or missed. - - diff --git a/Windows/SDL/COPYING b/Windows/SDL/COPYING deleted file mode 100644 index 2cba2ac7..00000000 --- a/Windows/SDL/COPYING +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/Windows/SDL/README-SDL.txt b/Windows/SDL/README-SDL.txt deleted file mode 100644 index 4d36ca9d..00000000 --- a/Windows/SDL/README-SDL.txt +++ /dev/null @@ -1,13 +0,0 @@ - -Please distribute this file with the SDL runtime environment: - -The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library -designed to make it easy to write multi-media software, such as games and -emulators. - -The Simple DirectMedia Layer library source code is available from: -http://www.libsdl.org/ - -This library is distributed under the terms of the GNU LGPL license: -http://www.gnu.org/copyleft/lesser.html - diff --git a/Windows/SDL/include/SDL.h b/Windows/SDL/include/SDL.h deleted file mode 100644 index 6087b7cd..00000000 --- a/Windows/SDL/include/SDL.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL.h - * Main include header for the SDL library - */ - -#ifndef _SDL_H -#define _SDL_H - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_audio.h" -#include "SDL_cdrom.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_loadso.h" -#include "SDL_mutex.h" -#include "SDL_rwops.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_video.h" -#include "SDL_version.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @file SDL.h - * @note As of version 0.5, SDL is loaded dynamically into the application - */ - -/** @name SDL_INIT Flags - * These are the flags which may be passed to SDL_Init() -- you should - * specify the subsystems which you will be using in your application. - */ -/*@{*/ -#define SDL_INIT_TIMER 0x00000001 -#define SDL_INIT_AUDIO 0x00000010 -#define SDL_INIT_VIDEO 0x00000020 -#define SDL_INIT_CDROM 0x00000100 -#define SDL_INIT_JOYSTICK 0x00000200 -#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ -#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ -#define SDL_INIT_EVERYTHING 0x0000FFFF -/*@}*/ - -/** This function loads the SDL dynamically linked library and initializes - * the subsystems specified by 'flags' (and those satisfying dependencies) - * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup - * signal handlers for some commonly ignored fatal signals (like SIGSEGV) - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/** This function initializes specific SDL subsystems */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/** This function cleans up specific SDL subsystems */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/** This function returns mask of the specified subsystems which have - * been initialized. - * If 'flags' is 0, it returns a mask of all initialized subsystems. - */ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/** This function cleans up all initialized subsystems and unloads the - * dynamically linked library. You should call it upon all exit conditions. - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_H */ diff --git a/Windows/SDL/include/SDL_active.h b/Windows/SDL/include/SDL_active.h deleted file mode 100644 index cd854e89..00000000 --- a/Windows/SDL/include/SDL_active.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_active.h - * Include file for SDL application focus event handling - */ - -#ifndef _SDL_active_h -#define _SDL_active_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name The available application states */ -/*@{*/ -#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ -#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ -#define SDL_APPACTIVE 0x04 /**< The application is active */ -/*@}*/ - -/* Function prototypes */ -/** - * This function returns the current state of the application, which is a - * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and - * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to - * see your application, otherwise it has been iconified or disabled. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_active_h */ diff --git a/Windows/SDL/include/SDL_audio.h b/Windows/SDL/include/SDL_audio.h deleted file mode 100644 index e879c989..00000000 --- a/Windows/SDL/include/SDL_audio.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_audio.h - * Access to the raw audio mixing buffer for the SDL library - */ - -#ifndef _SDL_audio_h -#define _SDL_audio_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * When filling in the desired audio spec structure, - * - 'desired->freq' should be the desired audio frequency in samples-per-second. - * - 'desired->format' should be the desired audio format. - * - 'desired->samples' is the desired size of the audio buffer, in samples. - * This number should be a power of two, and may be adjusted by the audio - * driver to a value more suitable for the hardware. Good values seem to - * range between 512 and 8096 inclusive, depending on the application and - * CPU speed. Smaller values yield faster response time, but can lead - * to underflow if the application is doing heavy processing and cannot - * fill the audio buffer in time. A stereo sample consists of both right - * and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: ms = (samples*1000)/freq - * - 'desired->size' is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * - 'desired->silence' is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * - 'desired->callback' should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. - * - 'desired->userdata' is passed as the first parameter to your callback - * function. - * - * @note The calculated values in this structure are calculated by SDL_OpenAudio() - * - */ -typedef struct SDL_AudioSpec { - int freq; /**< DSP frequency -- samples per second */ - Uint16 format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in samples (power of 2) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - /** - * This function is called when the audio device needs more data. - * - * @param[out] stream A pointer to the audio data buffer - * @param[in] len The length of the audio buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - */ - void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); - void *userdata; -} SDL_AudioSpec; - -/** - * @name Audio format flags - * defaults to LSB byte order - */ -/*@{*/ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB - -/** - * @name Native audio byte ordering - */ -/*@{*/ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#endif -/*@}*/ - -/*@}*/ - - -/** A structure to hold a set of audio conversion filters and buffers */ -typedef struct SDL_AudioCVT { - int needed; /**< Set to 1 if conversion possible */ - Uint16 src_format; /**< Source audio format */ - Uint16 dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); - int filter_index; /**< Current audio conversion function */ -} SDL_AudioCVT; - - -/* Function prototypes */ - -/** - * @name Audio Init and Quit - * These functions are used internally, and should not be used unless you - * have a specific need to specify the audio driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/*@{*/ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); -/*@}*/ - -/** - * This function fills the given character buffer with the name of the - * current audio driver, and returns a pointer to it if the audio driver has - * been initialized. It returns NULL if no driver has been initialized. - */ -extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); - -/** - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. - * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. - * - * @sa SDL_AudioSpec - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); - -typedef enum { - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_audiostatus; - -/** Get the current audio state */ -extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); - -/** - * This function pauses and unpauses the audio callback processing. - * It should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); - -/** - * This function loads a WAVE from the data source, automatically freeing - * that source if 'freesrc' is non-zero. For example, to load a WAVE file, - * you could do: - * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode - * - * If this function succeeds, it returns the given SDL_AudioSpec, - * filled with the audio data format of the wave data, and sets - * 'audio_buf' to a malloc()'d buffer containing the audio data, - * and sets 'audio_len' to the length of that audio buffer, in bytes. - * You need to free the audio buffer with SDL_FreeWAV() when you are - * done with it. - * - * This function returns NULL and sets the SDL error message if the - * wave file cannot be opened, uses an unknown data format, or is - * corrupt. Currently raw and MS-ADPCM WAVE files are supported. - */ -extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); - -/** Compatibility convenience function -- loads a WAV from a file */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/** - * This function frees data previously allocated with SDL_LoadWAV_RW() - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); - -/** - * This function takes a source format and rate and a destination format - * and rate, and initializes the 'cvt' structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. - * - * @return This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, - Uint16 src_format, Uint8 src_channels, int src_rate, - Uint16 dst_format, Uint8 dst_channels, int dst_rate); - -/** - * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), - * created an audio buffer cvt->buf, and filled it with cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * The data conversion may expand the size of the audio data, so the buffer - * cvt->buf should be allocated after the cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); - - -#define SDL_MIX_MAXVOLUME 128 -/** - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. - */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); - -/** - * @name Audio Locks - * The lock manipulated by these functions protects the callback function. - * During a LockAudio/UnlockAudio pair, you can be guaranteed that the - * callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -/*@}*/ - -/** - * This function shuts down audio processing and closes the audio device. - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_audio_h */ diff --git a/Windows/SDL/include/SDL_byteorder.h b/Windows/SDL/include/SDL_byteorder.h deleted file mode 100644 index 47332c3d..00000000 --- a/Windows/SDL/include/SDL_byteorder.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_byteorder.h - * @deprecated Use SDL_endian.h instead - */ - -/* DEPRECATED */ -#include "SDL_endian.h" diff --git a/Windows/SDL/include/SDL_cdrom.h b/Windows/SDL/include/SDL_cdrom.h deleted file mode 100644 index febb19dc..00000000 --- a/Windows/SDL/include/SDL_cdrom.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_cdrom.h - * This is the CD-audio control API for Simple DirectMedia Layer - */ - -#ifndef _SDL_cdrom_h -#define _SDL_cdrom_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file SDL_cdrom.h - * In order to use these functions, SDL_Init() must have been called - * with the SDL_INIT_CDROM flag. This causes SDL to scan the system - * for CD-ROM drives, and load appropriate drivers. - */ - -/** The maximum number of CD-ROM tracks on a disk */ -#define SDL_MAX_TRACKS 99 - -/** @name Track Types - * The types of CD-ROM track possible - */ -/*@{*/ -#define SDL_AUDIO_TRACK 0x00 -#define SDL_DATA_TRACK 0x04 -/*@}*/ - -/** The possible states which a CD-ROM drive can be in. */ -typedef enum { - CD_TRAYEMPTY, - CD_STOPPED, - CD_PLAYING, - CD_PAUSED, - CD_ERROR = -1 -} CDstatus; - -/** Given a status, returns true if there's a disk in the drive */ -#define CD_INDRIVE(status) ((int)(status) > 0) - -typedef struct SDL_CDtrack { - Uint8 id; /**< Track number */ - Uint8 type; /**< Data or audio track */ - Uint16 unused; - Uint32 length; /**< Length, in frames, of this track */ - Uint32 offset; /**< Offset, in frames, from start of disk */ -} SDL_CDtrack; - -/** This structure is only current as of the last call to SDL_CDStatus() */ -typedef struct SDL_CD { - int id; /**< Private drive identifier */ - CDstatus status; /**< Current drive status */ - - /** The rest of this structure is only valid if there's a CD in drive */ - /*@{*/ - int numtracks; /**< Number of tracks on disk */ - int cur_track; /**< Current track position */ - int cur_frame; /**< Current frame offset within current track */ - SDL_CDtrack track[SDL_MAX_TRACKS+1]; - /*@}*/ -} SDL_CD; - -/** @name Frames / MSF Conversion Functions - * Conversion functions from frames to Minute/Second/Frames and vice versa - */ -/*@{*/ -#define CD_FPS 75 -#define FRAMES_TO_MSF(f, M,S,F) { \ - int value = f; \ - *(F) = value%CD_FPS; \ - value /= CD_FPS; \ - *(S) = value%60; \ - value /= 60; \ - *(M) = value; \ -} -#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) -/*@}*/ - -/* CD-audio API functions: */ - -/** - * Returns the number of CD-ROM drives on the system, or -1 if - * SDL_Init() has not been called with the SDL_INIT_CDROM flag. - */ -extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); - -/** - * Returns a human-readable, system-dependent identifier for the CD-ROM. - * Example: - * - "/dev/cdrom" - * - "E:" - * - "/dev/disk/ide/1/master" - */ -extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); - -/** - * Opens a CD-ROM drive for access. It returns a drive handle on success, - * or NULL if the drive was invalid or busy. This newly opened CD-ROM - * becomes the default CD used when other CD functions are passed a NULL - * CD-ROM handle. - * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. - */ -extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); - -/** - * This function returns the current status of the given drive. - * If the drive has a CD in it, the table of contents of the CD and current - * play position of the CD will be stored in the SDL_CD structure. - */ -extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); - -/** - * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' - * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play - * until the end of the CD. This function will skip data tracks. - * This function should only be called after calling SDL_CDStatus() to - * get track information about the CD. - * For example: - * @code - * // Play entire CD: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) - * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); - * // Play last track: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { - * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); - * } - * // Play first and second track and 10 seconds of third track: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) - * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); - * @endcode - * - * @return This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, - int start_track, int start_frame, int ntracks, int nframes); - -/** - * Play the given CD starting at 'start' frame for 'length' frames. - * @return It returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); - -/** Pause play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); - -/** Resume play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); - -/** Stop play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); - -/** Eject CD-ROM - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); - -/** Closes the handle for the CD-ROM drive */ -extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ diff --git a/Windows/SDL/include/SDL_config.h b/Windows/SDL/include/SDL_config.h deleted file mode 100644 index 09ba38a7..00000000 --- a/Windows/SDL/include/SDL_config.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/* Add any platform that doesn't build using the configure system */ -#if defined(__DREAMCAST__) -#include "SDL_config_dreamcast.h" -#elif defined(__MACOS__) -#include "SDL_config_macos.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__SYMBIAN32__) -#include "SDL_config_symbian.h" /* must be before win32! */ -#elif defined(__WIN32__) -#include "SDL_config_win32.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#endif /* _SDL_config_h */ diff --git a/Windows/SDL/include/SDL_config_amiga.h b/Windows/SDL/include/SDL_config_amiga.h deleted file mode 100644 index 23e08619..00000000 --- a/Windows/SDL/include/SDL_config_amiga.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2006 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_amiga_h -#define _SDL_config_amiga_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_AHI 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_AMIGA 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DUMMY 1 - -/* Enable various threading systems */ -#define SDL_THREAD_AMIGA 1 - -/* Enable various timer systems */ -#define SDL_TIMER_AMIGA 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 - -#endif /* _SDL_config_amiga_h */ diff --git a/Windows/SDL/include/SDL_config_dreamcast.h b/Windows/SDL/include/SDL_config_dreamcast.h deleted file mode 100644 index fb03098e..00000000 --- a/Windows/SDL/include/SDL_config_dreamcast.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_dreamcast_h -#define _SDL_config_dreamcast_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DC 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_DC 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DC 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DUMMY 1 - -/* Enable various threading systems */ -#define SDL_THREAD_DC 1 - -/* Enable various timer systems */ -#define SDL_TIMER_DC 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DC 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_dreamcast_h */ diff --git a/Windows/SDL/include/SDL_config_macos.h b/Windows/SDL/include/SDL_config_macos.h deleted file mode 100644 index 4fe1715a..00000000 --- a/Windows/SDL/include/SDL_config_macos.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_macos_h -#define _SDL_config_macos_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#include <MacTypes.h> - -typedef SInt8 int8_t; -typedef UInt8 uint8_t; -typedef SInt16 int16_t; -typedef UInt16 uint16_t; -typedef SInt32 int32_t; -typedef UInt32 uint32_t; -typedef SInt64 int64_t; -typedef UInt64 uint64_t; -typedef unsigned long uintptr_t; - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_SSCANF 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_SNDMGR 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#if TARGET_API_MAC_CARBON -#define SDL_CDROM_DUMMY 1 -#else -#define SDL_CDROM_MACOS 1 -#endif - -/* Enable various input drivers */ -#if TARGET_API_MAC_CARBON -#define SDL_JOYSTICK_DUMMY 1 -#else -#define SDL_JOYSTICK_MACOS 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_MACOS 1 - -/* Enable various threading systems */ -#define SDL_THREADS_DISABLED 1 - -/* Enable various timer systems */ -#define SDL_TIMER_MACOS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 -#define SDL_VIDEO_DRIVER_TOOLBOX 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 - -#endif /* _SDL_config_macos_h */ diff --git a/Windows/SDL/include/SDL_config_macosx.h b/Windows/SDL/include/SDL_config_macosx.h deleted file mode 100644 index c05712ee..00000000 --- a/Windows/SDL/include/SDL_config_macosx.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_macosx_h -#define _SDL_config_macosx_h - -#include "SDL_platform.h" - -/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ -#include <AvailabilityMacros.h> - -/* This is a set of defines to configure the SDL features */ - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ -#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) -#define HAVE_ALLOCA_H 1 -#endif -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_MACOSX 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 - -/* Enable various shared object loading systems */ -#ifdef __ppc__ -/* For Mac OS X 10.2 compatibility */ -#define SDL_LOADSO_DLCOMPAT 1 -#else -#define SDL_LOADSO_DLOPEN 1 -#endif - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) -#define SDL_VIDEO_DRIVER_TOOLBOX 1 -#else -#define SDL_VIDEO_DRIVER_QUARTZ 1 -#endif -#define SDL_VIDEO_DRIVER_DGA 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" -#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 -#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 -#define SDL_VIDEO_DRIVER_X11_XME 1 -#define SDL_VIDEO_DRIVER_X11_XRANDR 1 -#define SDL_VIDEO_DRIVER_X11_XV 1 -#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_GLX 1 - -/* Disable screensaver */ -#define SDL_VIDEO_DISABLE_SCREENSAVER 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 -#ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 -#endif - -#endif /* _SDL_config_macosx_h */ diff --git a/Windows/SDL/include/SDL_config_minimal.h b/Windows/SDL/include/SDL_config_minimal.h deleted file mode 100644 index d10db7c6..00000000 --- a/Windows/SDL/include/SDL_config_minimal.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_minimal_h -#define _SDL_config_minimal_h - -#include "SDL_platform.h" - -/* This is the minimal configuration that can be used to build SDL */ - -#include <stdarg.h> - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned int size_t; -typedef unsigned long uintptr_t; - -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 - -/* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_minimal_h */ diff --git a/Windows/SDL/include/SDL_config_nds.h b/Windows/SDL/include/SDL_config_nds.h deleted file mode 100644 index cb4d61f6..00000000 --- a/Windows/SDL/include/SDL_config_nds.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_nds_h -#define _SDL_config_nds_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -/* C datatypes */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Endianness */ -#define SDL_BYTEORDER 1234 - -/* Useful headers */ -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_NDS 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_NDS 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable various timer systems */ -#define SDL_TIMER_NDS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_NDS 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_nds_h */ diff --git a/Windows/SDL/include/SDL_config_os2.h b/Windows/SDL/include/SDL_config_os2.h deleted file mode 100644 index 0342c818..00000000 --- a/Windows/SDL/include/SDL_config_os2.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_os2_h -#define _SDL_config_os2_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#define SDL_HAS_64BIT_TYPE 1 - -/* Use Watcom's LIBC */ -#define HAVE_LIBC 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DART 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_OS2 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_OS2 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_OS2 1 - -/* Enable various threading systems */ -#define SDL_THREAD_OS2 1 - -/* Enable various timer systems */ -#define SDL_TIMER_OS2 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_OS2FS 1 - -/* Enable OpenGL support */ -/* Nothing yet for OS/2. */ - -/* Enable assembly routines where available */ -#define SDL_ASSEMBLY_ROUTINES 1 - -#endif /* _SDL_config_os2_h */ diff --git a/Windows/SDL/include/SDL_config_symbian.h b/Windows/SDL/include/SDL_config_symbian.h deleted file mode 100644 index e917ac6e..00000000 --- a/Windows/SDL/include/SDL_config_symbian.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* - -Symbian version Markus Mertama - -*/ - - -#ifndef _SDL_CONFIG_SYMBIAN_H -#define _SDL_CONFIG_SYMBIAN_H - -#include "SDL_platform.h" - -/* This is the minimal configuration that can be used to build SDL */ - - -#include <stdarg.h> -#include <stddef.h> - - -#ifdef __GCCE__ -#define SYMBIAN32_GCCE -#endif - -#ifndef _SIZE_T_DEFINED -typedef unsigned int size_t; -#endif - -#ifndef _INTPTR_T_DECLARED -typedef unsigned int uintptr_t; -#endif - -#ifndef _INT8_T_DECLARED -typedef signed char int8_t; -#endif - -#ifndef _UINT8_T_DECLARED -typedef unsigned char uint8_t; -#endif - -#ifndef _INT16_T_DECLARED -typedef signed short int16_t; -#endif - -#ifndef _UINT16_T_DECLARED -typedef unsigned short uint16_t; -#endif - -#ifndef _INT32_T_DECLARED -typedef signed int int32_t; -#endif - -#ifndef _UINT32_T_DECLARED -typedef unsigned int uint32_t; -#endif - -#ifndef _INT64_T_DECLARED -typedef signed long long int64_t; -#endif - -#ifndef _UINT64_T_DECLARED -typedef unsigned long long uint64_t; -#endif - -#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 - - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -#define SDL_THREAD_SYMBIAN 1 - -#define SDL_VIDEO_DRIVER_EPOC 1 - -#define SDL_VIDEO_OPENGL 0 - -#define SDL_HAS_64BIT_TYPE 1 - -#define HAVE_LIBC 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -/*#define HAVE_ALLOCA 1*/ -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRUPR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -/*#define HAVE__STRICMP 1*/ -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 - - - -#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/Windows/SDL/include/SDL_config_win32.h b/Windows/SDL/include/SDL_config_win32.h deleted file mode 100644 index 6d2ae2d6..00000000 --- a/Windows/SDL/include/SDL_config_win32.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_win32_h -#define _SDL_config_win32_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Enabled for SDL 1.2 (binary compatibility) */ -#define HAVE_LIBC 1 -#ifdef HAVE_LIBC -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#ifndef _WIN32_WCE -#define HAVE_SIGNAL_H 1 -#endif - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#if defined(__MINGW32__) || defined(__WATCOMC__) -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#endif -#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(_WIN64) -#define HAVE__STRTOI64 1 -#define HAVE__STRTOUI64 1 -#endif -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#ifndef _WIN32_WCE -#define SDL_AUDIO_DRIVER_DSOUND 1 -#endif -#define SDL_AUDIO_DRIVER_WAVEOUT 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#ifdef _WIN32_WCE -#define SDL_CDROM_DISABLED 1 -#else -#define SDL_CDROM_WIN32 1 -#endif - -/* Enable various input drivers */ -#ifdef _WIN32_WCE -#define SDL_JOYSTICK_DISABLED 1 -#else -#define SDL_JOYSTICK_WINMM 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WIN32 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WIN32 1 - -/* Enable various timer systems */ -#ifdef _WIN32_WCE -#define SDL_TIMER_WINCE 1 -#else -#define SDL_TIMER_WIN32 1 -#endif - -/* Enable various video drivers */ -#ifdef _WIN32_WCE -#define SDL_VIDEO_DRIVER_GAPI 1 -#endif -#ifndef _WIN32_WCE -#define SDL_VIDEO_DRIVER_DDRAW 1 -#endif -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDIB 1 - -/* Enable OpenGL support */ -#ifndef _WIN32_WCE -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_WGL 1 -#endif - -/* Disable screensaver */ -#define SDL_VIDEO_DISABLE_SCREENSAVER 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* _SDL_config_win32_h */ diff --git a/Windows/SDL/include/SDL_copying.h b/Windows/SDL/include/SDL_copying.h deleted file mode 100644 index b5b64f29..00000000 --- a/Windows/SDL/include/SDL_copying.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - diff --git a/Windows/SDL/include/SDL_cpuinfo.h b/Windows/SDL/include/SDL_cpuinfo.h deleted file mode 100644 index 1335b982..00000000 --- a/Windows/SDL/include/SDL_cpuinfo.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_cpuinfo.h - * CPU feature detection for SDL - */ - -#ifndef _SDL_cpuinfo_h -#define _SDL_cpuinfo_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** This function returns true if the CPU has the RDTSC instruction */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/** This function returns true if the CPU has MMX features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/** This function returns true if the CPU has MMX Ext. features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); - -/** This function returns true if the CPU has 3DNow features */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/** This function returns true if the CPU has 3DNow! Ext. features */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); - -/** This function returns true if the CPU has SSE features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/** This function returns true if the CPU has SSE2 features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/** This function returns true if the CPU has AltiVec features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/** This function returns true if the CPU has ARM SIMD (ARMv6) features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); - -/** This function returns true if the CPU has ARM NEON features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMNEON(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_cpuinfo_h */ diff --git a/Windows/SDL/include/SDL_endian.h b/Windows/SDL/include/SDL_endian.h deleted file mode 100644 index 953f2c0f..00000000 --- a/Windows/SDL/include/SDL_endian.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_endian.h - * Functions for reading and writing endian-specific values - */ - -#ifndef _SDL_endian_h -#define _SDL_endian_h - -#include "SDL_stdinc.h" - -/** @name SDL_ENDIANs - * The two types of endianness - */ -/*@{*/ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 -/*@}*/ - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#ifdef __linux__ -#include <endian.h> -#define SDL_BYTEORDER __BYTE_ORDER -#elif defined(__OpenBSD__) -#include <endian.h> -#define SDL_BYTEORDER BYTE_ORDER -#else -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MIPSEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* __linux __ */ -#endif /* !SDL_BYTEORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name SDL_Swap Functions - * Use inline functions for compilers that support them, and static - * functions for those that do not. Because these functions become - * static for compilers that do not support inline functions, this - * header should only be included in files that actually use them. - */ -/*@{*/ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - int result; - - __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); - return (Uint16)result; -} -#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -static __inline__ Uint16 SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint16 SDL_Swap16(Uint16); -#pragma aux SDL_Swap16 = \ - "xchg al, ah" \ - parm [ax] \ - modify [ax]; -#else -static __inline__ Uint16 SDL_Swap16(Uint16 x) { - return SDL_static_cast(Uint16, ((x<<8)|(x>>8))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0" : "=r" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0" : "=r" (x) : "0" (x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); - __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); - __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); - return result; -} -#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -static __inline__ Uint32 SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint32 SDL_Swap32(Uint32); -#ifndef __SW_3 /* 486+ */ -#pragma aux SDL_Swap32 = \ - "bswap eax" \ - parm [eax] \ - modify [eax]; -#else /* 386-only */ -#pragma aux SDL_Swap32 = \ - "xchg al, ah" \ - "ror eax, 16" \ - "xchg al, ah" \ - parm [eax] \ - modify [eax]; -#endif -#else -static __inline__ Uint32 SDL_Swap32(Uint32 x) { - return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); -} -#endif - -#ifdef SDL_HAS_64BIT_TYPE -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint64 SDL_Swap64(Uint64 x) -{ - union { - struct { Uint32 a,b; } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" - : "=r" (v.s.a), "=r" (v.s.b) - : "0" (v.s.a), "1" (v.s.b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint64 SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0" : "=r" (x) : "0" (x)); - return x; -} -#else -static __inline__ Uint64 SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif -#else -/* This is mainly to keep compilers from complaining in SDL code. - * If there is no real 64-bit datatype, then compilers will complain about - * the fake 64-bit datatype that SDL provides when it compiles user code. - */ -#define SDL_Swap64(X) (X) -#endif /* SDL_HAS_64BIT_TYPE */ -/*@}*/ - -/** - * @name SDL_SwapLE and SDL_SwapBE Functions - * Byteswap item from the specified endianness to the native endianness - */ -/*@{*/ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#endif -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_endian_h */ diff --git a/Windows/SDL/include/SDL_error.h b/Windows/SDL/include/SDL_error.h deleted file mode 100644 index 4e1cce3b..00000000 --- a/Windows/SDL/include/SDL_error.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_error.h - * Simple error message routines for SDL - */ - -#ifndef _SDL_error_h -#define _SDL_error_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name Public functions - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); -extern DECLSPEC char * SDLCALL SDL_GetError(void); -extern DECLSPEC void SDLCALL SDL_ClearError(void); -/*@}*/ - -/** - * @name Private functions - * @internal Private error message function - used internally - */ -/*@{*/ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -typedef enum { - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_error_h */ diff --git a/Windows/SDL/include/SDL_events.h b/Windows/SDL/include/SDL_events.h deleted file mode 100644 index 94b42025..00000000 --- a/Windows/SDL/include/SDL_events.h +++ /dev/null @@ -1,356 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_events.h - * Include file for SDL event handling - */ - -#ifndef _SDL_events_h -#define _SDL_events_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_active.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_quit.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name General keyboard/mouse state definitions */ -/*@{*/ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 -/*@}*/ - -/** Event enumerations */ -typedef enum { - SDL_NOEVENT = 0, /**< Unused (do not remove) */ - SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ - SDL_KEYDOWN, /**< Keys pressed */ - SDL_KEYUP, /**< Keys released */ - SDL_MOUSEMOTION, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_JOYAXISMOTION, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_QUIT, /**< User-requested quit */ - SDL_SYSWMEVENT, /**< System specific event */ - SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ - SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ - SDL_VIDEORESIZE, /**< User resized video mode */ - SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ - SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ - /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ - SDL_USEREVENT = 24, - /** This last event is only for bounding internal arrays - * It is the number of bits in the event mask datatype -- Uint32 - */ - SDL_NUMEVENTS = 32 -} SDL_EventType; - -/** @name Predefined event masks */ -/*@{*/ -#define SDL_EVENTMASK(X) (1<<(X)) -typedef enum { - SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), - SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), - SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), - SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| - SDL_EVENTMASK(SDL_KEYUP), - SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), - SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), - SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| - SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| - SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), - SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), - SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), - SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), - SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| - SDL_EVENTMASK(SDL_JOYBALLMOTION)| - SDL_EVENTMASK(SDL_JOYHATMOTION)| - SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| - SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), - SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), - SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), - SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) -} SDL_EventMask ; -#define SDL_ALLEVENTS 0xFFFFFFFF -/*@}*/ - -/** Application visibility event structure */ -typedef struct SDL_ActiveEvent { - Uint8 type; /**< SDL_ACTIVEEVENT */ - Uint8 gain; /**< Whether given states were gained or lost (1/0) */ - Uint8 state; /**< A mask of the focus states */ -} SDL_ActiveEvent; - -/** Keyboard event structure */ -typedef struct SDL_KeyboardEvent { - Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ - Uint8 which; /**< The keyboard device index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - SDL_keysym keysym; -} SDL_KeyboardEvent; - -/** Mouse motion event structure */ -typedef struct SDL_MouseMotionEvent { - Uint8 type; /**< SDL_MOUSEMOTION */ - Uint8 which; /**< The mouse device index */ - Uint8 state; /**< The current button state */ - Uint16 x, y; /**< The X/Y coordinates of the mouse */ - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_MouseMotionEvent; - -/** Mouse button event structure */ -typedef struct SDL_MouseButtonEvent { - Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ - Uint8 which; /**< The mouse device index */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ -} SDL_MouseButtonEvent; - -/** Joystick axis motion event structure */ -typedef struct SDL_JoyAxisEvent { - Uint8 type; /**< SDL_JOYAXISMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 axis; /**< The joystick axis index */ - Sint16 value; /**< The axis value (range: -32768 to 32767) */ -} SDL_JoyAxisEvent; - -/** Joystick trackball motion event structure */ -typedef struct SDL_JoyBallEvent { - Uint8 type; /**< SDL_JOYBALLMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 ball; /**< The joystick trackball index */ - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** Joystick hat position change event structure */ -typedef struct SDL_JoyHatEvent { - Uint8 type; /**< SDL_JOYHATMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value: - * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP - * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT - * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN - * Note that zero means the POV is centered. - */ -} SDL_JoyHatEvent; - -/** Joystick button event structure */ -typedef struct SDL_JoyButtonEvent { - Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ - Uint8 which; /**< The joystick device index */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ -} SDL_JoyButtonEvent; - -/** The "window resized" event - * When you get this event, you are responsible for setting a new video - * mode with the new width and height. - */ -typedef struct SDL_ResizeEvent { - Uint8 type; /**< SDL_VIDEORESIZE */ - int w; /**< New width */ - int h; /**< New height */ -} SDL_ResizeEvent; - -/** The "screen redraw" event */ -typedef struct SDL_ExposeEvent { - Uint8 type; /**< SDL_VIDEOEXPOSE */ -} SDL_ExposeEvent; - -/** The "quit requested" event */ -typedef struct SDL_QuitEvent { - Uint8 type; /**< SDL_QUIT */ -} SDL_QuitEvent; - -/** A user-defined event type */ -typedef struct SDL_UserEvent { - Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ - int code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ -} SDL_UserEvent; - -/** If you want to use this event, you should include SDL_syswm.h */ -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; -typedef struct SDL_SysWMEvent { - Uint8 type; - SDL_SysWMmsg *msg; -} SDL_SysWMEvent; - -/** General event structure */ -typedef union SDL_Event { - Uint8 type; - SDL_ActiveEvent active; - SDL_KeyboardEvent key; - SDL_MouseMotionEvent motion; - SDL_MouseButtonEvent button; - SDL_JoyAxisEvent jaxis; - SDL_JoyBallEvent jball; - SDL_JoyHatEvent jhat; - SDL_JoyButtonEvent jbutton; - SDL_ResizeEvent resize; - SDL_ExposeEvent expose; - SDL_QuitEvent quit; - SDL_UserEvent user; - SDL_SysWMEvent syswm; -} SDL_Event; - - -/* Function prototypes */ - -/** Pumps the event loop, gathering events from the input devices. - * This function updates the event queue and internal input device state. - * This should only be run in the thread that sets the video mode. - */ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -typedef enum { - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; - -/** - * Checks the event queue for messages and optionally returns them. - * - * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to - * the back of the event queue. - * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front - * of the event queue, matching 'mask', will be returned and will not - * be removed from the queue. - * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front - * of the event queue, matching 'mask', will be returned and will be - * removed from the queue. - * - * @return - * This function returns the number of events actually stored, or -1 - * if there was an error. - * - * This function is thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, - SDL_eventaction action, Uint32 mask); - -/** Polls for currently pending events, and returns 1 if there are any pending - * events, or 0 if there are none available. If 'event' is not NULL, the next - * event is removed from the queue and stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); - -/** Waits indefinitely for the next available event, returning 1, or 0 if there - * was an error while waiting for events. If 'event' is not NULL, the next - * event is removed from the queue and stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); - -/** Add an event to the event queue. - * This function returns 0 on success, or -1 if the event queue was full - * or there was some other error. - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); - -/** @name Event Filtering */ -/*@{*/ -typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); -/** - * This function sets up a filter to process all events before they - * change internal state and are posted to the internal event queue. - * - * The filter is protypted as: - * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode - * - * If the filter returns 1, then the event will be added to the internal queue. - * If it returns 0, then the event will be dropped from the queue, but the - * internal state will still be updated. This allows selective filtering of - * dynamically arriving events. - * - * @warning Be very careful of what you do in the event filter function, as - * it may run in a different thread! - * - * There is one caveat when dealing with the SDL_QUITEVENT event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will - * be closed, otherwise the window will remain open if possible. - * If the quit event is generated by an interrupt signal, it will bypass the - * internal queue and be delivered to the application at the next event poll. - */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); - -/** - * Return the current event filter - can be used to "chain" filters. - * If there is no event filter set, this function returns NULL. - */ -extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); -/*@}*/ - -/** @name Event State */ -/*@{*/ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 -/*@}*/ - -/** -* This function allows you to set the state of processing certain events. -* If 'state' is set to SDL_IGNORE, that event will be automatically dropped -* from the event queue and will not event be filtered. -* If 'state' is set to SDL_ENABLE, that event will be processed normally. -* If 'state' is set to SDL_QUERY, SDL_EventState() will return the -* current processing state of the specified event. -*/ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_events_h */ diff --git a/Windows/SDL/include/SDL_getenv.h b/Windows/SDL/include/SDL_getenv.h deleted file mode 100644 index bea63007..00000000 --- a/Windows/SDL/include/SDL_getenv.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_getenv.h - * @deprecated Use SDL_stdinc.h instead - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/Windows/SDL/include/SDL_joystick.h b/Windows/SDL/include/SDL_joystick.h deleted file mode 100644 index 708d1a9f..00000000 --- a/Windows/SDL/include/SDL_joystick.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_joystick.h - * Include file for SDL joystick event handling - */ - -#ifndef _SDL_joystick_h -#define _SDL_joystick_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @file SDL_joystick.h - * @note In order to use these functions, SDL_Init() must have been called - * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. - */ - -/** The joystick structure used to identify an SDL joystick */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - -/* Function prototypes */ -/** - * Count the number of joysticks attached to the system - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/** - * Get the implementation dependent name of a joystick. - * - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); - -/** - * Open a joystick for use. - * - * @param[in] device_index - * The index passed as an argument refers to - * the N'th joystick on the system. This index is the value which will - * identify this joystick in future joystick events. - * - * @return This function returns a joystick identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); - -/** - * Returns 1 if the joystick has been opened, or 0 if it has not. - */ -extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); - -/** - * Get the device index of an opened joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); - -/** - * Get the number of general axis controls on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); - -/** - * Get the number of trackballs on a joystick - * - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); - -/** - * Get the number of POV hats on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); - -/** - * Get the number of buttons on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); - -/** - * Update the current state of the open joysticks. - * - * This is called automatically by the event loop if any joystick - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/** - * Enable/disable joystick event polling. - * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. - * - * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -/** - * Get the current state of an axis control on a joystick - * - * @param[in] axis The axis indices start at index 0. - * - * @return The state is a value ranging from -32768 to 32767. - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); - -/** - * @name Hat Positions - * The return value of SDL_JoystickGetHat() is one of the following positions: - */ -/*@{*/ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/*@}*/ - -/** - * Get the current state of a POV hat on a joystick - * - * @param[in] hat The hat indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); - -/** - * Get the ball axis change since the last poll - * - * @param[in] ball The ball indices start at index 0. - * - * @return This returns 0, or -1 if you passed it invalid parameters. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); - -/** - * Get the current state of a button on a joystick - * - * @param[in] button The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); - -/** - * Close a joystick previously opened with SDL_JoystickOpen() - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_joystick_h */ diff --git a/Windows/SDL/include/SDL_keyboard.h b/Windows/SDL/include/SDL_keyboard.h deleted file mode 100644 index 9d7129c5..00000000 --- a/Windows/SDL/include/SDL_keyboard.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_keyboard.h - * Include file for SDL keyboard event handling - */ - -#ifndef _SDL_keyboard_h -#define _SDL_keyboard_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keysym.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** Keysym structure - * - * - The scancode is hardware dependent, and should not be used by general - * applications. If no hardware scancode is available, it will be 0. - * - * - The 'unicode' translated character is only available when character - * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, - * this is a UNICODE character corresponding to the keypress. If the - * high 9 bits of the character are 0, then this maps to the equivalent - * ASCII character: - * @code - * char ch; - * if ( (keysym.unicode & 0xFF80) == 0 ) { - * ch = keysym.unicode & 0x7F; - * } else { - * An international character.. - * } - * @endcode - */ -typedef struct SDL_keysym { - Uint8 scancode; /**< hardware specific scancode */ - SDLKey sym; /**< SDL virtual keysym */ - SDLMod mod; /**< current key modifiers */ - Uint16 unicode; /**< translated character */ -} SDL_keysym; - -/** This is the mask which refers to all hotkey bindings */ -#define SDL_ALL_HOTKEYS 0xFFFFFFFF - -/* Function prototypes */ -/** - * Enable/Disable UNICODE translation of keyboard input. - * - * This translation has some overhead, so translation defaults off. - * - * @param[in] enable - * If 'enable' is 1, translation is enabled. - * If 'enable' is 0, translation is disabled. - * If 'enable' is -1, the translation state is not changed. - * - * @return It returns the previous state of keyboard translation. - */ -extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); - -#define SDL_DEFAULT_REPEAT_DELAY 500 -#define SDL_DEFAULT_REPEAT_INTERVAL 30 -/** - * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. - * - * @param[in] delay - * 'delay' is the initial delay in ms between the time when a key is - * pressed, and keyboard repeat begins. - * - * @param[in] interval - * 'interval' is the time in ms between keyboard repeat events. - * - * If 'delay' is set to 0, keyboard repeat is disabled. - */ -extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); -extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); - -/** - * Get a snapshot of the current state of the keyboard. - * Returns an array of keystates, indexed by the SDLK_* syms. - * Usage: - * @code - * Uint8 *keystate = SDL_GetKeyState(NULL); - * if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed. - * @endcode - */ -extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); - -/** - * Get the current key modifier state - */ -extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); - -/** - * Set the current key modifier state. - * This does not change the keyboard state, only the key modifier flags. - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); - -/** - * Get the name of an SDL virtual keysym - */ -extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_keyboard_h */ diff --git a/Windows/SDL/include/SDL_keysym.h b/Windows/SDL/include/SDL_keysym.h deleted file mode 100644 index f2ad12b8..00000000 --- a/Windows/SDL/include/SDL_keysym.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_keysym_h -#define _SDL_keysym_h - -/** What we really want is a mapping of every raw key on the keyboard. - * To support international keyboards, we use the range 0xA1 - 0xFF - * as international virtual keycodes. We'll follow in the footsteps of X11... - * @brief The names of the keys - */ -typedef enum { - /** @name ASCII mapped keysyms - * The keyboard syms have been cleverly chosen to map to ASCII - */ - /*@{*/ - SDLK_UNKNOWN = 0, - SDLK_FIRST = 0, - SDLK_BACKSPACE = 8, - SDLK_TAB = 9, - SDLK_CLEAR = 12, - SDLK_RETURN = 13, - SDLK_PAUSE = 19, - SDLK_ESCAPE = 27, - SDLK_SPACE = 32, - SDLK_EXCLAIM = 33, - SDLK_QUOTEDBL = 34, - SDLK_HASH = 35, - SDLK_DOLLAR = 36, - SDLK_AMPERSAND = 38, - SDLK_QUOTE = 39, - SDLK_LEFTPAREN = 40, - SDLK_RIGHTPAREN = 41, - SDLK_ASTERISK = 42, - SDLK_PLUS = 43, - SDLK_COMMA = 44, - SDLK_MINUS = 45, - SDLK_PERIOD = 46, - SDLK_SLASH = 47, - SDLK_0 = 48, - SDLK_1 = 49, - SDLK_2 = 50, - SDLK_3 = 51, - SDLK_4 = 52, - SDLK_5 = 53, - SDLK_6 = 54, - SDLK_7 = 55, - SDLK_8 = 56, - SDLK_9 = 57, - SDLK_COLON = 58, - SDLK_SEMICOLON = 59, - SDLK_LESS = 60, - SDLK_EQUALS = 61, - SDLK_GREATER = 62, - SDLK_QUESTION = 63, - SDLK_AT = 64, - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = 91, - SDLK_BACKSLASH = 92, - SDLK_RIGHTBRACKET = 93, - SDLK_CARET = 94, - SDLK_UNDERSCORE = 95, - SDLK_BACKQUOTE = 96, - SDLK_a = 97, - SDLK_b = 98, - SDLK_c = 99, - SDLK_d = 100, - SDLK_e = 101, - SDLK_f = 102, - SDLK_g = 103, - SDLK_h = 104, - SDLK_i = 105, - SDLK_j = 106, - SDLK_k = 107, - SDLK_l = 108, - SDLK_m = 109, - SDLK_n = 110, - SDLK_o = 111, - SDLK_p = 112, - SDLK_q = 113, - SDLK_r = 114, - SDLK_s = 115, - SDLK_t = 116, - SDLK_u = 117, - SDLK_v = 118, - SDLK_w = 119, - SDLK_x = 120, - SDLK_y = 121, - SDLK_z = 122, - SDLK_DELETE = 127, - /* End of ASCII mapped keysyms */ - /*@}*/ - - /** @name International keyboard syms */ - /*@{*/ - SDLK_WORLD_0 = 160, /* 0xA0 */ - SDLK_WORLD_1 = 161, - SDLK_WORLD_2 = 162, - SDLK_WORLD_3 = 163, - SDLK_WORLD_4 = 164, - SDLK_WORLD_5 = 165, - SDLK_WORLD_6 = 166, - SDLK_WORLD_7 = 167, - SDLK_WORLD_8 = 168, - SDLK_WORLD_9 = 169, - SDLK_WORLD_10 = 170, - SDLK_WORLD_11 = 171, - SDLK_WORLD_12 = 172, - SDLK_WORLD_13 = 173, - SDLK_WORLD_14 = 174, - SDLK_WORLD_15 = 175, - SDLK_WORLD_16 = 176, - SDLK_WORLD_17 = 177, - SDLK_WORLD_18 = 178, - SDLK_WORLD_19 = 179, - SDLK_WORLD_20 = 180, - SDLK_WORLD_21 = 181, - SDLK_WORLD_22 = 182, - SDLK_WORLD_23 = 183, - SDLK_WORLD_24 = 184, - SDLK_WORLD_25 = 185, - SDLK_WORLD_26 = 186, - SDLK_WORLD_27 = 187, - SDLK_WORLD_28 = 188, - SDLK_WORLD_29 = 189, - SDLK_WORLD_30 = 190, - SDLK_WORLD_31 = 191, - SDLK_WORLD_32 = 192, - SDLK_WORLD_33 = 193, - SDLK_WORLD_34 = 194, - SDLK_WORLD_35 = 195, - SDLK_WORLD_36 = 196, - SDLK_WORLD_37 = 197, - SDLK_WORLD_38 = 198, - SDLK_WORLD_39 = 199, - SDLK_WORLD_40 = 200, - SDLK_WORLD_41 = 201, - SDLK_WORLD_42 = 202, - SDLK_WORLD_43 = 203, - SDLK_WORLD_44 = 204, - SDLK_WORLD_45 = 205, - SDLK_WORLD_46 = 206, - SDLK_WORLD_47 = 207, - SDLK_WORLD_48 = 208, - SDLK_WORLD_49 = 209, - SDLK_WORLD_50 = 210, - SDLK_WORLD_51 = 211, - SDLK_WORLD_52 = 212, - SDLK_WORLD_53 = 213, - SDLK_WORLD_54 = 214, - SDLK_WORLD_55 = 215, - SDLK_WORLD_56 = 216, - SDLK_WORLD_57 = 217, - SDLK_WORLD_58 = 218, - SDLK_WORLD_59 = 219, - SDLK_WORLD_60 = 220, - SDLK_WORLD_61 = 221, - SDLK_WORLD_62 = 222, - SDLK_WORLD_63 = 223, - SDLK_WORLD_64 = 224, - SDLK_WORLD_65 = 225, - SDLK_WORLD_66 = 226, - SDLK_WORLD_67 = 227, - SDLK_WORLD_68 = 228, - SDLK_WORLD_69 = 229, - SDLK_WORLD_70 = 230, - SDLK_WORLD_71 = 231, - SDLK_WORLD_72 = 232, - SDLK_WORLD_73 = 233, - SDLK_WORLD_74 = 234, - SDLK_WORLD_75 = 235, - SDLK_WORLD_76 = 236, - SDLK_WORLD_77 = 237, - SDLK_WORLD_78 = 238, - SDLK_WORLD_79 = 239, - SDLK_WORLD_80 = 240, - SDLK_WORLD_81 = 241, - SDLK_WORLD_82 = 242, - SDLK_WORLD_83 = 243, - SDLK_WORLD_84 = 244, - SDLK_WORLD_85 = 245, - SDLK_WORLD_86 = 246, - SDLK_WORLD_87 = 247, - SDLK_WORLD_88 = 248, - SDLK_WORLD_89 = 249, - SDLK_WORLD_90 = 250, - SDLK_WORLD_91 = 251, - SDLK_WORLD_92 = 252, - SDLK_WORLD_93 = 253, - SDLK_WORLD_94 = 254, - SDLK_WORLD_95 = 255, /* 0xFF */ - /*@}*/ - - /** @name Numeric keypad */ - /*@{*/ - SDLK_KP0 = 256, - SDLK_KP1 = 257, - SDLK_KP2 = 258, - SDLK_KP3 = 259, - SDLK_KP4 = 260, - SDLK_KP5 = 261, - SDLK_KP6 = 262, - SDLK_KP7 = 263, - SDLK_KP8 = 264, - SDLK_KP9 = 265, - SDLK_KP_PERIOD = 266, - SDLK_KP_DIVIDE = 267, - SDLK_KP_MULTIPLY = 268, - SDLK_KP_MINUS = 269, - SDLK_KP_PLUS = 270, - SDLK_KP_ENTER = 271, - SDLK_KP_EQUALS = 272, - /*@}*/ - - /** @name Arrows + Home/End pad */ - /*@{*/ - SDLK_UP = 273, - SDLK_DOWN = 274, - SDLK_RIGHT = 275, - SDLK_LEFT = 276, - SDLK_INSERT = 277, - SDLK_HOME = 278, - SDLK_END = 279, - SDLK_PAGEUP = 280, - SDLK_PAGEDOWN = 281, - /*@}*/ - - /** @name Function keys */ - /*@{*/ - SDLK_F1 = 282, - SDLK_F2 = 283, - SDLK_F3 = 284, - SDLK_F4 = 285, - SDLK_F5 = 286, - SDLK_F6 = 287, - SDLK_F7 = 288, - SDLK_F8 = 289, - SDLK_F9 = 290, - SDLK_F10 = 291, - SDLK_F11 = 292, - SDLK_F12 = 293, - SDLK_F13 = 294, - SDLK_F14 = 295, - SDLK_F15 = 296, - /*@}*/ - - /** @name Key state modifier keys */ - /*@{*/ - SDLK_NUMLOCK = 300, - SDLK_CAPSLOCK = 301, - SDLK_SCROLLOCK = 302, - SDLK_RSHIFT = 303, - SDLK_LSHIFT = 304, - SDLK_RCTRL = 305, - SDLK_LCTRL = 306, - SDLK_RALT = 307, - SDLK_LALT = 308, - SDLK_RMETA = 309, - SDLK_LMETA = 310, - SDLK_LSUPER = 311, /**< Left "Windows" key */ - SDLK_RSUPER = 312, /**< Right "Windows" key */ - SDLK_MODE = 313, /**< "Alt Gr" key */ - SDLK_COMPOSE = 314, /**< Multi-key compose key */ - /*@}*/ - - /** @name Miscellaneous function keys */ - /*@{*/ - SDLK_HELP = 315, - SDLK_PRINT = 316, - SDLK_SYSREQ = 317, - SDLK_BREAK = 318, - SDLK_MENU = 319, - SDLK_POWER = 320, /**< Power Macintosh power key */ - SDLK_EURO = 321, /**< Some european keyboards */ - SDLK_UNDO = 322, /**< Atari keyboard has Undo */ - /*@}*/ - - /* Add any other keys here */ - - SDLK_LAST -} SDLKey; - -/** Enumeration of valid key mods (possibly OR'd together) */ -typedef enum { - KMOD_NONE = 0x0000, - KMOD_LSHIFT= 0x0001, - KMOD_RSHIFT= 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDLMod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_META (KMOD_LMETA|KMOD_RMETA) - -#endif /* _SDL_keysym_h */ diff --git a/Windows/SDL/include/SDL_loadso.h b/Windows/SDL/include/SDL_loadso.h deleted file mode 100644 index 0c5e5362..00000000 --- a/Windows/SDL/include/SDL_loadso.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_loadso.h - * System dependent library loading routines - */ - -/** @file SDL_loadso.h - * Some things to keep in mind: - * - These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * - Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * - Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - - -#ifndef _SDL_loadso_h -#define _SDL_loadso_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. - */ -extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); - -/** - * Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). - */ -extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); - -/** Unload a shared object from memory */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_loadso_h */ diff --git a/Windows/SDL/include/SDL_main.h b/Windows/SDL/include/SDL_main.h deleted file mode 100644 index ab50ef1e..00000000 --- a/Windows/SDL/include/SDL_main.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_main_h -#define _SDL_main_h - -#include "SDL_stdinc.h" - -/** @file SDL_main.h - * Redefine main() on Win32 and MacOS so that it is called by winmain.c - */ - -#if defined(__WIN32__) || \ - (defined(__MWERKS__) && !defined(__BEOS__)) || \ - defined(__MACOS__) || defined(__MACOSX__) || \ - defined(__SYMBIAN32__) || defined(QWS) - -#ifdef __cplusplus -#define C_LINKAGE "C" -#else -#define C_LINKAGE -#endif /* __cplusplus */ - -/** The application's main() function must be called with C linkage, - * and should be declared like this: - * @code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * @endcode - */ -#define main SDL_main - -/** The prototype for the application's main() function */ -extern C_LINKAGE int SDL_main(int argc, char *argv[]); - - -/** @name From the SDL library code -- needed for registering the app on Win32 */ -/*@{*/ -#ifdef __WIN32__ - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** This should be called from your WinMain() function, if any */ -extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); -/** This can also be called, but is no longer necessary */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); -/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); -#ifdef __cplusplus -} -#endif -#include "close_code.h" -#endif -/*@}*/ - -/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ -/*@{*/ -#if defined(__MACOS__) - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** Forward declaration so we don't need to include QuickDraw.h */ -struct QDGlobals; - -/** This should be called from your main() function, if any */ -extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); - -#ifdef __cplusplus -} -#endif -#include "close_code.h" -#endif -/*@}*/ - -#endif /* Need to redefine main()? */ - -#endif /* _SDL_main_h */ diff --git a/Windows/SDL/include/SDL_mouse.h b/Windows/SDL/include/SDL_mouse.h deleted file mode 100644 index 7c563b94..00000000 --- a/Windows/SDL/include/SDL_mouse.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_mouse.h - * Include file for SDL mouse event handling - */ - -#ifndef _SDL_mouse_h -#define _SDL_mouse_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct WMcursor WMcursor; /**< Implementation dependent */ -typedef struct SDL_Cursor { - SDL_Rect area; /**< The area of the mouse cursor */ - Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ - Uint8 *data; /**< B/W cursor data */ - Uint8 *mask; /**< B/W cursor mask */ - Uint8 *save[2]; /**< Place to save cursor area */ - WMcursor *wm_cursor; /**< Window-manager cursor */ -} SDL_Cursor; - -/* Function prototypes */ -/** - * Retrieve the current state of the mouse. - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * current mouse cursor position. You can pass NULL for either x or y. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); - -/** - * Retrieve the current state of the mouse. - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); - -/** - * Set the position of the mouse cursor (generates a mouse motion event) - */ -extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); - -/** - * Create a cursor using the specified data and mask (in MSB format). - * The cursor width must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * data mask resulting pixel on screen - * 0 1 White - * 1 1 Black - * 0 0 Transparent - * 1 0 Inverted color if possible, black if not. - * - * Cursors created with this function must be freed with SDL_FreeCursor(). - */ -extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor - (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); - -/** - * Set the currently active cursor to the specified one. - * If the cursor is currently visible, the change will be immediately - * represented on the display. - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); - -/** - * Returns the currently active cursor. - */ -extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); - -/** - * Deallocates a cursor created with SDL_CreateCursor(). - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); - -/** - * Toggle whether or not the cursor is shown on the screen. - * The cursor start off displayed, but can be turned off. - * SDL_ShowCursor() returns 1 if the cursor was being displayed - * before the call, or 0 if it was not. You can query the current - * state by passing a 'toggle' value of -1. - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/*@{*/ -/** Used as a mask when testing buttons in buttonstate - * Button 1: Left mouse button - * Button 2: Middle mouse button - * Button 3: Right mouse button - * Button 4: Mouse wheel up (may also be a real button) - * Button 5: Mouse wheel down (may also be a real button) - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_WHEELUP 4 -#define SDL_BUTTON_WHEELDOWN 5 -#define SDL_BUTTON_X1 6 -#define SDL_BUTTON_X2 7 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_mouse_h */ diff --git a/Windows/SDL/include/SDL_mutex.h b/Windows/SDL/include/SDL_mutex.h deleted file mode 100644 index c8da9b1a..00000000 --- a/Windows/SDL/include/SDL_mutex.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_mutex_h -#define _SDL_mutex_h - -/** @file SDL_mutex.h - * Functions to provide thread synchronization primitives - * - * @note These are independent of the other SDL routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** Synchronization functions which can time out return this value - * if they time out. - */ -#define SDL_MUTEX_TIMEDOUT 1 - -/** This is the timeout value which corresponds to never time out */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Mutex functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** The SDL mutex structure, defined in SDL_mutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/** Create a mutex, initialized unlocked */ -extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); - -#define SDL_LockMutex(m) SDL_mutexP(m) -/** Lock the mutex - * @return 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); - -#define SDL_UnlockMutex(m) SDL_mutexV(m) -/** Unlock the mutex - * @return 0, or -1 on error - * - * It is an error to unlock a mutex that has not been locked by - * the current thread, and doing so results in undefined behavior. - */ -extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); - -/** Destroy a mutex */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Semaphore functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** The SDL semaphore structure, defined in SDL_sem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/** Create a semaphore, initialized with value, returns NULL on failure. */ -extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/** Destroy a semaphore */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); - -/** - * This function suspends the calling thread until the semaphore pointed - * to by sem has a positive count. It then atomically decreases the semaphore - * count. - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); - -/** Non-blocking variant of SDL_SemWait(). - * @return 0 if the wait succeeds, - * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); - -/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if - * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in - * the allotted time, and -1 on error. - * - * On some platforms this function is implemented by looping with a delay - * of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); - -/** Atomically increases the semaphore's count (not blocking). - * @return 0, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); - -/** Returns the current count of the semaphore */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Condition_variable_functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/*@{*/ -/** The SDL condition variable structure, defined in SDL_cond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; -/*@}*/ - -/** Create a condition variable */ -extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); - -/** Destroy a condition variable */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); - -/** Restart one of the threads that are waiting on the condition variable, - * @return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); - -/** Restart all threads that are waiting on the condition variable, - * @return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); - -/** Wait on the condition variable, unlocking the provided mutex. - * The mutex must be locked before entering this function! - * The mutex is re-locked once the condition variable is signaled. - * @return 0 when it is signaled, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); - -/** Waits for at most 'ms' milliseconds, and returns 0 if the condition - * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not - * signaled in the allotted time, and -1 on error. - * On some platforms this function is implemented by looping with a delay - * of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); - -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_mutex_h */ - diff --git a/Windows/SDL/include/SDL_name.h b/Windows/SDL/include/SDL_name.h deleted file mode 100644 index 511619af..00000000 --- a/Windows/SDL/include/SDL_name.h +++ /dev/null @@ -1,11 +0,0 @@ - -#ifndef _SDLname_h_ -#define _SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* _SDLname_h_ */ diff --git a/Windows/SDL/include/SDL_opengl.h b/Windows/SDL/include/SDL_opengl.h deleted file mode 100644 index 3d791d69..00000000 --- a/Windows/SDL/include/SDL_opengl.h +++ /dev/null @@ -1,6570 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_opengl.h - * This is a simple file to encapsulate the OpenGL API headers - */ - -#include "SDL_config.h" - -#ifdef __WIN32__ -#define WIN32_LEAN_AND_MEAN -#ifndef NOMINMAX -#define NOMINMAX /* Don't defined min() and max() */ -#endif -#include <windows.h> -#endif -#ifndef NO_SDL_GLEXT -#define __glext_h_ /* Don't let gl.h include glext.h */ -#endif -#if defined(__MACOSX__) -#include <OpenGL/gl.h> /* Header File For The OpenGL Library */ -#include <OpenGL/glu.h> /* Header File For The GLU Library */ -#elif defined(__MACOS__) -#include <gl.h> /* Header File For The OpenGL Library */ -#include <glu.h> /* Header File For The GLU Library */ -#else -#include <GL/gl.h> /* Header File For The OpenGL Library */ -#include <GL/glu.h> /* Header File For The GLU Library */ -#endif -#ifndef NO_SDL_GLEXT -#undef __glext_h_ -#endif - -/** @name GLext.h - * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. - * It is included here because glext.h is not available on some systems. - * If you don't want this version included, simply define "NO_SDL_GLEXT" - */ -/*@{*/ -#ifndef NO_SDL_GLEXT -#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#define WIN32_LEAN_AND_MEAN 1 -#include <windows.h> -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/06/20 */ -/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 29 - -#ifndef GL_VERSION_1_2 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#endif - -#ifndef GL_ARB_imaging -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif - -#ifndef GL_VERSION_1_3 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#endif - -#ifndef GL_VERSION_1_4 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#endif - -#ifndef GL_VERSION_1_5 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#endif - -#ifndef GL_VERSION_2_0 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_env_add -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_ARB_point_parameters -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -#ifndef GL_ARB_shadow -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -#ifndef GL_ARB_window_pos -#endif - -#ifndef GL_ARB_vertex_program -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#endif - -#ifndef GL_ARB_fragment_program -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#endif - -#ifndef GL_ARB_shader_objects -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#endif - -#ifndef GL_ARB_point_sprite -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -#ifndef GL_ARB_texture_float -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_EXT_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif - -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif - -#ifndef GL_NV_evaluators -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#endif - -#ifndef GL_NV_texture_compression_vtc -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif - -#ifndef GL_NV_texture_shader -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif - -#ifndef GL_NV_vertex_program -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif - -#ifndef GL_OML_interlace -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif - -#ifndef GL_OML_subsample -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif - -#ifndef GL_OML_resample -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#endif - -#ifndef GL_ATI_element_array -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#endif - -#ifndef GL_SUN_mesh_array -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_DEPTH_CLAMP_NV 0x864F -#endif - -#ifndef GL_NV_occlusion_query -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#endif - -#ifndef GL_NV_point_sprite -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif - -#ifndef GL_NV_vertex_program1_1 -#endif - -#ifndef GL_EXT_shadow_funcs -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -#ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A -#endif - -#ifndef GL_APPLE_fence -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -#ifndef GL_S3_s3tc -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -#ifndef GL_ATI_texture_float -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif - -#ifndef GL_NV_float_buffer -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif - -#ifndef GL_NV_fragment_program -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#endif - -#ifndef GL_NV_half_float -#define GL_HALF_FLOAT_NV 0x140B -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#endif - -#ifndef GL_NV_primitive_restart -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -#ifndef GL_NV_vertex_program2 -#endif - -#ifndef GL_ATI_map_object_buffer -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#endif - -#ifndef GL_OES_read_format -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#endif - -#ifndef GL_MESA_pack_invert -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -#ifndef GL_NV_fragment_program_option -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif - -#ifndef GL_NV_vertex_program2_option -/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ -/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ -#endif - -#ifndef GL_NV_vertex_program3 -/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#endif - -#ifndef GL_GREMEDY_string_marker -#endif - - -/*************************************************************/ - -#include <stddef.h> -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; /* native character */ -#endif - -#ifndef GL_VERSION_1_5 -/* GL types for handling large vertex buffer objects */ -#ifdef __APPLE__ -typedef long GLintptr; -typedef long GLsizeiptr; -#else -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -#endif -#endif - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -#ifdef __APPLE__ -typedef long GLintptrARB; -typedef long GLsizeiptrARB; -#else -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif -#endif - -#ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and program/shader text */ -typedef char GLcharARB; /* native character */ -#if defined(__APPLE__) -typedef void *GLhandleARB; /* shader object handle */ -#else -typedef unsigned int GLhandleARB; /* shader object handle */ -#endif -#endif - -/* GL types for "half" precision (s10e5) float data in host memory */ -#ifndef GL_ARB_half_float_pixel -typedef unsigned short GLhalfARB; -#endif - -#ifndef GL_NV_half_float -typedef unsigned short GLhalfNV; -#endif - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -#endif - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#endif - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#endif - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#endif - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#endif - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#endif - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#endif - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#endif - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#endif - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#endif - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#endif - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#endif - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#endif - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#endif - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#endif - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#endif - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#endif - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -/* This is really a WGL extension, but defines some associated GL enums. - * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. - */ -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#endif - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#endif - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#endif - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#endif - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#endif - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#endif - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#endif - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#endif - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif -#endif /* NO_SDL_GLEXT */ -/*@}*/ diff --git a/Windows/SDL/include/SDL_platform.h b/Windows/SDL/include/SDL_platform.h deleted file mode 100644 index bcbd7b66..00000000 --- a/Windows/SDL/include/SDL_platform.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_platform.h - * Try to get a standard set of platform defines - */ - -#ifndef _SDL_platform_h -#define _SDL_platform_h - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__BEOS__) -#undef __BEOS__ -#define __BEOS__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if defined(linux) || defined(__linux) || defined(__linux__) -#undef __LINUX__ -#define __LINUX__ 1 -#endif -#if defined(__APPLE__) -#undef __MACOSX__ -#define __MACOSX__ 1 -#elif defined(macintosh) -#undef __MACOS__ -#define __MACOS__ 1 -#endif -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) || defined(__EMX__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif -#if defined(WIN32) || defined(_WIN32) -#undef __WIN32__ -#define __WIN32__ 1 -#endif - -#endif /* _SDL_platform_h */ diff --git a/Windows/SDL/include/SDL_quit.h b/Windows/SDL/include/SDL_quit.h deleted file mode 100644 index abd2ec6c..00000000 --- a/Windows/SDL/include/SDL_quit.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_quit.h - * Include file for SDL quit event handling - */ - -#ifndef _SDL_quit_h -#define _SDL_quit_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/** @file SDL_quit.h - * An SDL_QUITEVENT is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate SDL_QUITEVENT events as well. There is no way - * to determine the cause of an SDL_QUITEVENT, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - */ - -/** @file SDL_quit.h - * There are no functions directly affecting the quit event - */ - -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) - -#endif /* _SDL_quit_h */ diff --git a/Windows/SDL/include/SDL_rwops.h b/Windows/SDL/include/SDL_rwops.h deleted file mode 100644 index 98361d7e..00000000 --- a/Windows/SDL/include/SDL_rwops.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_rwops.h - * This file provides a general interface for SDL to read and write - * data sources. It can easily be extended to files, memory, etc. - */ - -#ifndef _SDL_rwops_h -#define _SDL_rwops_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the read/write operation structure -- very basic */ - -typedef struct SDL_RWops { - /** Seek to 'offset' relative to whence, one of stdio's whence values: - * SEEK_SET, SEEK_CUR, SEEK_END - * Returns the final offset in the data source. - */ - int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); - - /** Read up to 'maxnum' objects each of size 'size' from the data - * source to the area pointed at by 'ptr'. - * Returns the number of objects read, or -1 if the read failed. - */ - int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); - - /** Write exactly 'num' objects each of size 'objsize' from the area - * pointed at by 'ptr' to data source. - * Returns 'num', or -1 if the write failed. - */ - int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); - - /** Close and free an allocated SDL_FSops structure */ - int (SDLCALL *close)(struct SDL_RWops *context); - - Uint32 type; - union { -#if defined(__WIN32__) && !defined(__SYMBIAN32__) - struct { - int append; - void *h; - struct { - void *data; - int size; - int left; - } buffer; - } win32io; -#endif -#ifdef HAVE_STDIO_H - struct { - int autoclose; - FILE *fp; - } stdio; -#endif - struct { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct { - void *data1; - } unknown; - } hidden; - -} SDL_RWops; - - -/** @name Functions to create SDL_RWops structures from various data sources */ -/*@{*/ - -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); - -#ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); -#endif - -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); - -extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); - -/*@}*/ - -/** @name Seek Reference Points */ -/*@{*/ -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ -/*@}*/ - -/** @name Macros to easily read and write from an SDL_RWops structure */ -/*@{*/ -#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) -#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) -#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -#define SDL_RWclose(ctx) (ctx)->close(ctx) -/*@}*/ - -/** @name Read an item of the specified endianness and return in native format */ -/*@{*/ -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); -/*@}*/ - -/** @name Write an item of native format to the specified endianness */ -/*@{*/ -extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); -extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_rwops_h */ diff --git a/Windows/SDL/include/SDL_stdinc.h b/Windows/SDL/include/SDL_stdinc.h deleted file mode 100644 index 0df46478..00000000 --- a/Windows/SDL/include/SDL_stdinc.h +++ /dev/null @@ -1,624 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_stdinc.h - * This is a general header that includes C language support - */ - -#ifndef _SDL_stdinc_h -#define _SDL_stdinc_h - -#include "SDL_config.h" - - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_STDIO_H -#include <stdio.h> -#endif -#if defined(STDC_HEADERS) -# include <stdlib.h> -# include <stddef.h> -# include <stdarg.h> -#else -# if defined(HAVE_STDLIB_H) -# include <stdlib.h> -# elif defined(HAVE_MALLOC_H) -# include <malloc.h> -# endif -# if defined(HAVE_STDDEF_H) -# include <stddef.h> -# endif -# if defined(HAVE_STDARG_H) -# include <stdarg.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#if defined(HAVE_INTTYPES_H) -# include <inttypes.h> -#elif defined(HAVE_STDINT_H) -# include <stdint.h> -#endif -#ifdef HAVE_CTYPE_H -# include <ctype.h> -#endif -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -# include <iconv.h> -#endif -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include <alloca.h> -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include <malloc.h> -# define alloca _alloca -# elif defined(__WATCOMC__) -# include <malloc.h> -# elif defined(__BORLANDC__) -# include <malloc.h> -# elif defined(__DMC__) -# include <stdlib.h> -# elif defined(__AIX__) - #pragma alloca -# elif defined(__MRC__) - void *alloca (unsigned); -# else - char *alloca (); -# endif -#endif - -/** The number of elements in an array */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/* Use proper C++ casts when compiled as C++ to be compatible with the option - -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ -#ifdef __cplusplus -#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression) -#define SDL_static_cast(type, expression) static_cast<type>(expression) -#else -#define SDL_reinterpret_cast(type, expression) ((type)(expression)) -#define SDL_static_cast(type, expression) ((type)(expression)) -#endif - -/** @name Basic data types */ -/*@{*/ -typedef enum { - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; - -typedef int8_t Sint8; -typedef uint8_t Uint8; -typedef int16_t Sint16; -typedef uint16_t Uint16; -typedef int32_t Sint32; -typedef uint32_t Uint32; - -#ifdef SDL_HAS_64BIT_TYPE -typedef int64_t Sint64; -#ifndef SYMBIAN32_GCCE -typedef uint64_t Uint64; -#endif -#else -/* This is really just a hack to prevent the compiler from complaining */ -typedef struct { - Uint32 hi; - Uint32 lo; -} Uint64, Sint64; -#endif - -/*@}*/ - -/** @name Make sure the types really have the right sizes */ -/*@{*/ -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_dummy_ ## name[(x) * 2 - 1] - -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -/*@}*/ - -/** @name Enum Size Check - * Check to make sure enums are the size of ints, for structure packing. - * For both Watcom C/C++ and Borland C/C++ the compiler option that makes - * enums having the size of an int must be enabled. - * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). - */ -/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ -#ifdef __MWERKS__ -#pragma enumsalwaysint on -#endif - -typedef enum { - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -#ifndef __NDS__ -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -/*@}*/ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_MALLOC -#define SDL_malloc malloc -#else -extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); -#endif - -#ifdef HAVE_CALLOC -#define SDL_calloc calloc -#else -extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); -#endif - -#ifdef HAVE_REALLOC -#define SDL_realloc realloc -#else -extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); -#endif - -#ifdef HAVE_FREE -#define SDL_free free -#else -extern DECLSPEC void SDLCALL SDL_free(void *mem); -#endif - -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -#ifdef HAVE_GETENV -#define SDL_getenv getenv -#else -extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); -#endif - -#ifdef HAVE_PUTENV -#define SDL_putenv putenv -#else -extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); -#endif - -#ifdef HAVE_QSORT -#define SDL_qsort qsort -#else -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)); -#endif - -#ifdef HAVE_ABS -#define SDL_abs abs -#else -#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) -#endif - -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) - -#ifdef HAVE_CTYPE_H -#define SDL_isdigit(X) isdigit(X) -#define SDL_isspace(X) isspace(X) -#define SDL_toupper(X) toupper(X) -#define SDL_tolower(X) tolower(X) -#else -#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) -#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) -#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) -#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) -#endif - -#ifdef HAVE_MEMSET -#define SDL_memset memset -#else -extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); -#endif - -#if defined(__GNUC__) && defined(i386) -#define SDL_memset4(dst, val, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; stosl\n\t" \ - : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memset4 -#define SDL_memset4(dst, val, len) \ -do { \ - unsigned _count = (len); \ - unsigned _n = (_count + 3) / 4; \ - Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ - Uint32 _val = (val); \ - if (len == 0) break; \ - switch (_count % 4) { \ - case 0: do { *_p++ = _val; \ - case 3: *_p++ = _val; \ - case 2: *_p++ = _val; \ - case 1: *_p++ = _val; \ - } while ( --_n ); \ - } \ -} while(0) -#endif - -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl\n\t" \ - "testb $2,%b4\n\t" \ - "je 1f\n\t" \ - "movsw\n" \ - "1:\ttestb $1,%b4\n\t" \ - "je 2f\n\t" \ - "movsb\n" \ - "2:" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy -#ifdef HAVE_MEMCPY -#define SDL_memcpy memcpy -#elif defined(HAVE_BCOPY) -#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) -#else -extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); -#endif -#endif - -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy4(dst, src, len) \ -do { \ - int ecx, edi, esi; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl" \ - : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ - : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy4 -#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) -#endif - -#if defined(__GNUC__) && defined(i386) -#define SDL_revcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - char *dstp = SDL_static_cast(char *, dst); \ - char *srcp = SDL_static_cast(char *, src); \ - int n = (len); \ - if ( n >= 4 ) { \ - __asm__ __volatile__ ( \ - "std\n\t" \ - "rep ; movsl\n\t" \ - "cld\n\t" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (n >> 2), \ - "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ - : "memory" ); \ - } \ - switch (n & 3) { \ - case 3: dstp[2] = srcp[2]; \ - case 2: dstp[1] = srcp[1]; \ - case 1: dstp[0] = srcp[0]; \ - break; \ - default: \ - break; \ - } \ -} while(0) -#endif -#ifndef SDL_revcpy -extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); -#endif - -#ifdef HAVE_MEMMOVE -#define SDL_memmove memmove -#elif defined(HAVE_BCOPY) -#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) -#else -#define SDL_memmove(dst, src, len) \ -do { \ - if ( dst < src ) { \ - SDL_memcpy(dst, src, len); \ - } else { \ - SDL_revcpy(dst, src, len); \ - } \ -} while(0) -#endif - -#ifdef HAVE_MEMCMP -#define SDL_memcmp memcmp -#else -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); -#endif - -#ifdef HAVE_STRLEN -#define SDL_strlen strlen -#else -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); -#endif - -#ifdef HAVE_STRLCPY -#define SDL_strlcpy strlcpy -#else -extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); -#endif - -#ifdef HAVE_STRLCAT -#define SDL_strlcat strlcat -#else -extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); -#endif - -#ifdef HAVE_STRDUP -#define SDL_strdup strdup -#else -extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); -#endif - -#ifdef HAVE__STRREV -#define SDL_strrev _strrev -#else -extern DECLSPEC char * SDLCALL SDL_strrev(char *string); -#endif - -#ifdef HAVE__STRUPR -#define SDL_strupr _strupr -#else -extern DECLSPEC char * SDLCALL SDL_strupr(char *string); -#endif - -#ifdef HAVE__STRLWR -#define SDL_strlwr _strlwr -#else -extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); -#endif - -#ifdef HAVE_STRCHR -#define SDL_strchr strchr -#elif defined(HAVE_INDEX) -#define SDL_strchr index -#else -extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); -#endif - -#ifdef HAVE_STRRCHR -#define SDL_strrchr strrchr -#elif defined(HAVE_RINDEX) -#define SDL_strrchr rindex -#else -extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); -#endif - -#ifdef HAVE_STRSTR -#define SDL_strstr strstr -#else -extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); -#endif - -#ifdef HAVE_ITOA -#define SDL_itoa itoa -#else -#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) -#endif - -#ifdef HAVE__LTOA -#define SDL_ltoa _ltoa -#else -extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); -#endif - -#ifdef HAVE__UITOA -#define SDL_uitoa _uitoa -#else -#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) -#endif - -#ifdef HAVE__ULTOA -#define SDL_ultoa _ultoa -#else -extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); -#endif - -#ifdef HAVE_STRTOL -#define SDL_strtol strtol -#else -extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); -#endif - -#ifdef HAVE_STRTOUL -#define SDL_strtoul strtoul -#else -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); -#endif - -#ifdef SDL_HAS_64BIT_TYPE - -#ifdef HAVE__I64TOA -#define SDL_lltoa _i64toa -#else -extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); -#endif - -#ifdef HAVE__UI64TOA -#define SDL_ulltoa _ui64toa -#else -extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); -#endif - -#ifdef HAVE__STRTOI64 -#define SDL_strtoll _strtoi64 -#elif defined(HAVE_STRTOLL) -#define SDL_strtoll strtoll -#else -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); -#endif - -#ifdef HAVE__STRTOUI64 -#define SDL_strtoull _strtoui64 -#elif defined(HAVE_STRTOULL) -#define SDL_strtoull strtoull -#else -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); -#endif - -#endif /* SDL_HAS_64BIT_TYPE */ - -#ifdef HAVE_STRTOD -#define SDL_strtod strtod -#else -extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); -#endif - -#ifdef HAVE_ATOI -#define SDL_atoi atoi -#else -#define SDL_atoi(X) SDL_strtol(X, NULL, 0) -#endif - -#ifdef HAVE_ATOF -#define SDL_atof atof -#else -#define SDL_atof(X) SDL_strtod(X, NULL) -#endif - -#ifdef HAVE_STRCMP -#define SDL_strcmp strcmp -#else -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -#endif - -#ifdef HAVE_STRNCMP -#define SDL_strncmp strncmp -#else -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -#endif - -#if defined(HAVE__STRICMP) -#define SDL_strcasecmp _stricmp -#elif defined(HAVE_STRCASECMP) -#define SDL_strcasecmp strcasecmp -#else -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -#endif - -#if defined(HAVE__STRNICMP) -#define SDL_strncasecmp _strnicmp -#elif defined(HAVE_STRNCASECMP) -#define SDL_strncasecmp strncasecmp -#else -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); -#endif - -#ifdef HAVE_SSCANF -#define SDL_sscanf sscanf -#else -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); -#endif - -#if defined(HAVE_SNPRINTF) && !(defined(__WATCOMC__) || defined(_WIN32)) -#define SDL_snprintf snprintf -#else -extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); -#endif - -#if defined(HAVE_VSNPRINTF) && !(defined(__WATCOMC__) || defined(_WIN32)) -#define SDL_vsnprintf vsnprintf -#else -extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); -#endif - -/** @name SDL_ICONV Error Codes - * The SDL implementation of iconv() returns these error codes - */ -/*@{*/ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 -/*@}*/ - -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -#define SDL_iconv_t iconv_t -#define SDL_iconv_open iconv_open -#define SDL_iconv_close iconv_close -#else -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -#endif -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -/** This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. - */ -extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_stdinc_h */ diff --git a/Windows/SDL/include/SDL_syswm.h b/Windows/SDL/include/SDL_syswm.h deleted file mode 100644 index 40845b64..00000000 --- a/Windows/SDL/include/SDL_syswm.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_syswm.h - * Include file for SDL custom system window manager hooks - */ - -#ifndef _SDL_syswm_h -#define _SDL_syswm_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_version.h" - -#ifndef SDL_PROTOTYPES_ONLY -# if defined(SDL_VIDEO_DRIVER_X11) -# if defined(__APPLE__) && defined(__MACH__) -# define Cursor X11Cursor /* conflicts with Quickdraw.h */ -# endif -# include <X11/Xlib.h> -# include <X11/Xatom.h> -# if defined(__APPLE__) && defined(__MACH__) -# undef Cursor -# endif -# elif defined(SDL_VIDEO_DRIVER_NANOX) -# include <microwin/nano-X.h> -# elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include <windows.h> -# elif defined(SDL_VIDEO_DRIVER_PHOTON) -# include <sys/neutrino.h> -# include <Ph.h> -# endif -#endif - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @file SDL_syswm.h - * Your application has access to a special type of event 'SDL_SYSWMEVENT', - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState() - */ -struct SDL_SysWMinfo; -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - -#ifndef SDL_PROTOTYPES_ONLY - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) - -/** These are the various supported subsystems under UNIX */ -typedef enum { - SDL_SYSWM_X11 -} SDL_SYSWM_TYPE; - -/** The UNIX custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union { - XEvent xevent; - } event; -}; - -/** The UNIX custom window manager information structure. - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo { - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union { - struct { - Display *display; /**< The X11 display */ - Window window; /**< The X11 display window */ - /** These locking functions should be called around - * any X11 functions using the display variable, - * but not the gfxdisplay variable. - * They lock the event thread, so should not be - * called around event functions or from event filters. - */ - /*@{*/ - void (*lock_func)(void); - void (*unlock_func)(void); - /*@}*/ - - /** @name Introduced in SDL 1.0.2 */ - /*@{*/ - Window fswindow; /**< The X11 fullscreen window */ - Window wmwindow; /**< The X11 managed input window */ - /*@}*/ - - /** @name Introduced in SDL 1.2.12 */ - /*@{*/ - Display *gfxdisplay; /**< The X11 display to which rendering is done */ - /*@}*/ - } x11; - } info; -}; - -#elif defined(SDL_VIDEO_DRIVER_NANOX) - -/** The generic custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The windows custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version ; - GR_WINDOW_ID window ; /* The display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) - -/** The windows custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ -}; - -/** The windows custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - HWND window; /**< The Win32 display window */ - HGLRC hglrc; /**< The OpenGL context, if any */ -}; - -#elif defined(SDL_VIDEO_DRIVER_RISCOS) - -/** RISC OS custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int eventCode; /**< The window for the message */ - int pollBlock[64]; -}; - -/** The RISC OS custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - int wimpVersion; /**< Wimp version running under */ - int taskHandle; /**< The RISC OS task handle */ - int window; /**< The RISC OS display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_PHOTON) - -/** The QNX custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The QNX custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - int data; -}; - -#else - -/** The generic custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The generic custom window manager information structure */ -struct SDL_SysWMinfo { - SDL_version version; - int data; -}; - -#endif /* video driver type */ - -#endif /* SDL_PROTOTYPES_ONLY */ - -/* Function prototypes */ -/** - * This function gives you custom hooks into the window manager information. - * It fills the structure pointed to by 'info' with custom information and - * returns 0 if the function is not implemented, 1 if the function is - * implemented and no error occurred, and -1 if the version member of - * the 'info' structure is not filled in or not supported. - * - * You typically use this function like this: - * @code - * SDL_SysWMinfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWMInfo(&info) ) { ... } - * @endcode - */ -extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_syswm_h */ diff --git a/Windows/SDL/include/SDL_thread.h b/Windows/SDL/include/SDL_thread.h deleted file mode 100644 index b7d5a917..00000000 --- a/Windows/SDL/include/SDL_thread.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_thread_h -#define _SDL_thread_h - -/** @file SDL_thread.h - * Header for the SDL thread management routines - * - * @note These are independent of the other SDL routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_mutex.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/** Create a thread */ -#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) -/** - * We compile SDL into a DLL on OS/2. This means, that it's the DLL which - * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL.DLL will - * be initialized for those threads, and not the RTL of the calling application! - * To solve this, we make a little hack here. - * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL.DLL which uses this API, - * then the RTL of SDL.DLL will be used to create the new thread, and if it's - * the application, then the RTL of the application will be used. - * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime library! - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef _WIN32_WCE -#include <process.h> /* This has _beginthread() and _endthread() defined! */ -#endif -#ifdef __EMX__ -#include <stdlib.h> -#endif - -#ifdef __OS2__ -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); -typedef void (*pfnSDL_CurrentEndThread)(void); -#else -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#endif - -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); - -#ifdef __OS2__ -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) -#elif defined(_WIN32_WCE) -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) -#else -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) -#endif -#else -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); -#endif - -/** Get the 32-bit thread identifier for the current thread */ -extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); - -/** Get the 32-bit thread identifier for the specified thread, - * equivalent to SDL_ThreadID() if the specified thread is NULL. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); - -/** Wait for a thread to finish. - * The return code for the thread function is placed in the area - * pointed to by 'status', if 'status' is not NULL. - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); - -/** Forcefully kill a thread without worrying about its state */ -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_thread_h */ diff --git a/Windows/SDL/include/SDL_timer.h b/Windows/SDL/include/SDL_timer.h deleted file mode 100644 index d764d5f3..00000000 --- a/Windows/SDL/include/SDL_timer.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_timer_h -#define _SDL_timer_h - -/** @file SDL_timer.h - * Header for the SDL time management routines - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the OS scheduler timeslice, in milliseconds */ -#define SDL_TIMESLICE 10 - -/** This is the maximum resolution of the SDL timer on all platforms */ -#define TIMER_RESOLUTION 10 /**< Experimentally determined */ - -/** - * Get the number of milliseconds since the SDL library initialization. - * Note that this value wraps if the program runs for more than ~49 days. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/** Wait a specified number of milliseconds before returning */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** Function prototype for the timer callback function */ -typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); - -/** - * Set a callback to run after the specified number of milliseconds has - * elapsed. The callback function is passed the current timer interval - * and returns the next timer interval. If the returned value is the - * same as the one passed in, the periodic alarm continues, otherwise a - * new alarm is scheduled. If the callback returns 0, the periodic alarm - * is cancelled. - * - * To cancel a currently running timer, call SDL_SetTimer(0, NULL); - * - * The timer callback function may run in a different thread than your - * main code, and so shouldn't call any functions from within itself. - * - * The maximum resolution of this timer is 10 ms, which means that if - * you request a 16 ms timer, your callback will run approximately 20 ms - * later on an unloaded system. If you wanted to set a flag signaling - * a frame update at 30 frames per second (every 33 ms), you might set a - * timer for 30 ms: - * @code SDL_SetTimer((33/10)*10, flag_update); @endcode - * - * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). - * - * Under UNIX, you should not use raise or use SIGALRM and this function - * in the same program, as it is implemented using setitimer(). You also - * should not use this function in multi-threaded applications as signals - * to multi-threaded apps have undefined behavior in some implementations. - * - * This function returns 0 if successful, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); - -/** @name New timer API - * New timer API, supports multiple timers - * Written by Stephane Peter <megastep@lokigames.com> - */ -/*@{*/ - -/** - * Function prototype for the new timer callback function. - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); - -/** Definition of the timer ID type */ -typedef struct _SDL_TimerID *SDL_TimerID; - -/** Add a new timer to the pool of timers already running. - * Returns a timer ID, or NULL when an error occurs. - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); - -/** - * Remove one of the multiple timers knowing its ID. - * Returns a boolean value indicating success. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); - -/*@}*/ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_timer_h */ diff --git a/Windows/SDL/include/SDL_types.h b/Windows/SDL/include/SDL_types.h deleted file mode 100644 index 79d8b28d..00000000 --- a/Windows/SDL/include/SDL_types.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_types.h - * @deprecated Use SDL_stdinc.h instead. - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/Windows/SDL/include/SDL_version.h b/Windows/SDL/include/SDL_version.h deleted file mode 100644 index 4385ebf0..00000000 --- a/Windows/SDL/include/SDL_version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_version.h - * This header defines the current SDL version - */ - -#ifndef _SDL_version_h -#define _SDL_version_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name Version Number - * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL - */ -/*@{*/ -#define SDL_MAJOR_VERSION 1 -#define SDL_MINOR_VERSION 2 -#define SDL_PATCHLEVEL 16 -/*@}*/ - -typedef struct SDL_version { - Uint8 major; - Uint8 minor; - Uint8 patch; -} SDL_version; - -/** - * This macro can be used to fill a version structure with the compile-time - * version of the SDL library. - */ -#define SDL_VERSION(X) \ -{ \ - (X)->major = SDL_MAJOR_VERSION; \ - (X)->minor = SDL_MINOR_VERSION; \ - (X)->patch = SDL_PATCHLEVEL; \ -} - -/** This macro turns the version numbers into a numeric value: - * (1,2,3) -> (1203) - * This assumes that there will never be more than 100 patchlevels - */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/** This is the version number macro for the current SDL version */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) - -/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) - -/** This function gets the version of the dynamically linked SDL library. - * it should NOT be used to fill a version structure, instead you should - * use the SDL_Version() macro. - */ -extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_version_h */ diff --git a/Windows/SDL/include/SDL_video.h b/Windows/SDL/include/SDL_video.h deleted file mode 100644 index f9c4e070..00000000 --- a/Windows/SDL/include/SDL_video.h +++ /dev/null @@ -1,951 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_video.h - * Header file for access to the SDL raw framebuffer window - */ - -#ifndef _SDL_video_h -#define _SDL_video_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name Transparency definitions - * These define alpha as the opacity of a surface - */ -/*@{*/ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/*@}*/ - -/** @name Useful data types */ -/*@{*/ -typedef struct SDL_Rect { - Sint16 x, y; - Uint16 w, h; -} SDL_Rect; - -typedef struct SDL_Color { - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 unused; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette { - int ncolors; - SDL_Color *colors; -} SDL_Palette; -/*@}*/ - -/** Everything in the pixel format structure is read-only */ -typedef struct SDL_PixelFormat { - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - - /** RGB color key information */ - Uint32 colorkey; - /** Alpha value information (per-surface alpha) */ - Uint8 alpha; -} SDL_PixelFormat; - -/** This structure should be treated as read-only, except for 'pixels', - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface { - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - Uint16 pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - int offset; /**< Private */ - - /** Hardware-specific surface info */ - struct private_hwdata *hwdata; - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - Uint32 unused1; /**< for binary compatibility */ - - /** Allow recursive locks */ - Uint32 locked; /**< Private */ - - /** info for fast blit mapping to other surfaces */ - struct SDL_BlitMap *map; /**< Private */ - - /** format version, bumped at every change to invalidate blit maps */ - unsigned int format_version; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** @name SDL_Surface Flags - * These are the currently supported flags for the SDL_surface - */ -/*@{*/ - -/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ -/*@{*/ -#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ -#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ -#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ -/*@}*/ - -/** Available for SDL_SetVideoMode() */ -/*@{*/ -#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ -#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ -#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ -#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ -#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ -#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ -#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ -#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ -/*@}*/ - -/** Used internally (read-only) */ -/*@{*/ -#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ -#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ -#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ -#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ -#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ -#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ -/*@}*/ - -/*@}*/ - -/** Evaluates to true if the surface needs to be locked before access */ -#define SDL_MUSTLOCK(surface) \ - (surface->offset || \ - ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) - -/** typedef for private surface blitting functions */ -typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, - struct SDL_Surface *dst, SDL_Rect *dstrect); - - -/** Useful for determining the video hardware capabilities */ -typedef struct SDL_VideoInfo { - Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ - Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ - Uint32 UnusedBits1 :6; - Uint32 UnusedBits2 :1; - Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ - Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ - Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ - Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ - Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ - Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ - Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ - Uint32 UnusedBits3 :16; - Uint32 video_mem; /**< The total amount of video memory (in K) */ - SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ - int current_w; /**< Value: The current video mode width */ - int current_h; /**< Value: The current video mode height */ -} SDL_VideoInfo; - - -/** @name Overlay Formats - * The most common video overlay formats. - * For an explanation of these pixel formats, see: - * http://www.webartz.com/fourcc/indexyuv.htm - * - * For information on the relationship between color spaces, see: - * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html - */ -/*@{*/ -#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ -#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ -#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ -#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ -#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ -/*@}*/ - -/** The YUV hardware video overlay */ -typedef struct SDL_Overlay { - Uint32 format; /**< Read-only */ - int w, h; /**< Read-only */ - int planes; /**< Read-only */ - Uint16 *pitches; /**< Read-only */ - Uint8 **pixels; /**< Read-write */ - - /** @name Hardware-specific surface info */ - /*@{*/ - struct private_yuvhwfuncs *hwfuncs; - struct private_yuvhwdata *hwdata; - /*@{*/ - - /** @name Special flags */ - /*@{*/ - Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ - Uint32 UnusedBits :31; - /*@}*/ -} SDL_Overlay; - - -/** Public enumeration for setting the OpenGL window attributes. */ -typedef enum { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_SWAP_CONTROL -} SDL_GLattr; - -/** @name flags for SDL_SetPalette() */ -/*@{*/ -#define SDL_LOGPAL 0x01 -#define SDL_PHYSPAL 0x02 -/*@}*/ - -/* Function prototypes */ - -/** - * @name Video Init and Quit - * These functions are used internally, and should not be used unless you - * have a specific need to specify the video driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/*@{*/ -/** - * Initializes the video subsystem. Sets up a connection - * to the window manager, etc, and determines the current video mode and - * pixel format, but does not initialize a window or graphics mode. - * Note that event handling is activated by this routine. - * - * If you use both sound and video in your application, you need to call - * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, - * you won't be able to set full-screen display modes. - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); -/*@}*/ - -/** - * This function fills the given character buffer with the name of the - * video driver, and returns a pointer to it if the video driver has - * been initialized. It returns NULL if no driver has been initialized. - */ -extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); - -/** - * This function returns a pointer to the current display surface. - * If SDL is doing format conversion on the display surface, this - * function returns the publicly visible surface, not the real video - * surface. - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); - -/** - * This function returns a read-only pointer to information about the - * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' - * member of the returned structure will contain the pixel format of the - * "best" video mode. - */ -extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); - -/** - * Check to see if a particular video mode is supported. - * It returns 0 if the requested mode is not supported under any bit depth, - * or returns the bits-per-pixel of the closest available mode with the - * given width and height. If this bits-per-pixel is different from the - * one used when setting the video mode, SDL_SetVideoMode() will succeed, - * but will emulate the requested bits-per-pixel with a shadow surface. - * - * The arguments to SDL_VideoModeOK() are the same ones you would pass to - * SDL_SetVideoMode() - */ -extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); - -/** - * Return a pointer to an array of available screen dimensions for the - * given format and video flags, sorted largest to smallest. Returns - * NULL if there are no dimensions available for a particular format, - * or (SDL_Rect **)-1 if any dimension is okay for the given format. - * - * If 'format' is NULL, the mode list will be for the format given - * by SDL_GetVideoInfo()->vfmt - */ -extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); - -/** - * Set up a video mode with the specified width, height and bits-per-pixel. - * - * If 'bpp' is 0, it is treated as the current display bits per pixel. - * - * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the - * requested bits-per-pixel, but will return whatever video pixel format is - * available. The default is to emulate the requested pixel format if it - * is not natively available. - * - * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in - * video memory, if possible, and you may have to call SDL_LockSurface() - * in order to access the raw framebuffer. Otherwise, the video surface - * will be created in system memory. - * - * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle - * updates asynchronously, but you must always lock before accessing pixels. - * SDL will wait for updates to complete before returning from the lock. - * - * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee - * that the colors set by SDL_SetColors() will be the colors you get. - * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all - * of the colors exactly the way they are requested, and you should look - * at the video surface structure to determine the actual palette. - * If SDL cannot guarantee that the colors you request can be set, - * i.e. if the colormap is shared, then the video surface may be created - * under emulation in system memory, overriding the SDL_HWSURFACE flag. - * - * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set - * a fullscreen video mode. The default is to create a windowed mode - * if the current graphics system has a window manager. - * If the SDL library is able to set a fullscreen video mode, this flag - * will be set in the surface that is returned. - * - * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up - * two surfaces in video memory and swap between them when you call - * SDL_Flip(). This is usually slower than the normal single-buffering - * scheme, but prevents "tearing" artifacts caused by modifying video - * memory while the monitor is refreshing. It should only be used by - * applications that redraw the entire screen on every update. - * - * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the - * window manager, if any, to resize the window at runtime. When this - * occurs, SDL will send a SDL_VIDEORESIZE event to you application, - * and you must respond to the event by re-calling SDL_SetVideoMode() - * with the requested size (or another size that suits the application). - * - * If SDL_NOFRAME is set in 'flags', the SDL library will create a window - * without any title bar or frame decoration. Fullscreen video modes have - * this flag set automatically. - * - * This function returns the video framebuffer surface, or NULL if it fails. - * - * If you rely on functionality provided by certain video flags, check the - * flags of the returned surface to make sure that functionality is available. - * SDL will fall back to reduced functionality if the exact flags you wanted - * are not available. - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode - (int width, int height, int bpp, Uint32 flags); - -/** @name SDL_Update Functions - * These functions should not be called while 'screen' is locked. - */ -/*@{*/ -/** - * Makes sure the given list of rectangles is updated on the given screen. - */ -extern DECLSPEC void SDLCALL SDL_UpdateRects - (SDL_Surface *screen, int numrects, SDL_Rect *rects); -/** - * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire - * screen. - */ -extern DECLSPEC void SDLCALL SDL_UpdateRect - (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); -/*@}*/ - -/** - * On hardware that supports double-buffering, this function sets up a flip - * and returns. The hardware will wait for vertical retrace, and then swap - * video buffers before the next video surface blit or lock will return. - * On hardware that doesn not support double-buffering, this is equivalent - * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); - * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when - * setting the video mode for this function to perform hardware flipping. - * This function returns 0 if successful, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); - -/** - * Set the gamma correction for each of the color channels. - * The gamma values range (approximately) between 0.1 and 10.0 - * - * If this function isn't supported directly by the hardware, it will - * be emulated using gamma ramps, if available. If successful, this - * function returns 0, otherwise it returns -1. - */ -extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); - -/** - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * You may pass NULL for any of the channels to leave it unchanged. - * If the call succeeds, it will return 0. If the display driver or - * hardware does not support gamma translation, or otherwise fails, - * this function will return -1. - */ -extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); - -/** - * Retrieve the current values of the gamma translation tables. - * - * You must pass in valid pointers to arrays of 256 16-bit quantities. - * Any of the pointers may be NULL to ignore that channel. - * If the call succeeds, it will return 0. If the display driver or - * hardware does not support gamma translation, or otherwise fails, - * this function will return -1. - */ -extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); - -/** - * Sets a portion of the colormap for the given 8-bit surface. If 'surface' - * is not a palettized surface, this function does nothing, returning 0. - * If all of the colors were set as passed to SDL_SetColors(), it will - * return 1. If not all the color entries were set exactly as given, - * it will return 0, and you should look at the surface palette to - * determine the actual color palette. - * - * When 'surface' is the surface associated with the current display, the - * display colormap will be updated with the requested colors. If - * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() - * will always return 1, and the palette is guaranteed to be set the way - * you desire, even if the window colormap has to be warped or run under - * emulation. - */ -extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, - SDL_Color *colors, int firstcolor, int ncolors); - -/** - * Sets a portion of the colormap for a given 8-bit surface. - * 'flags' is one or both of: - * SDL_LOGPAL -- set logical palette, which controls how blits are mapped - * to/from the surface, - * SDL_PHYSPAL -- set physical palette, which controls how pixels look on - * the screen - * Only screens have physical palettes. Separate change of physical/logical - * palettes is only possible if the screen has SDL_HWPALETTE set. - * - * The return value is 1 if all colours could be set as requested, and 0 - * otherwise. - * - * SDL_SetColors() is equivalent to calling this function with - * flags = (SDL_LOGPAL|SDL_PHYSPAL). - */ -extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, - SDL_Color *colors, int firstcolor, - int ncolors); - -/** - * Maps an RGB triple to an opaque pixel value for a given pixel format - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b); - -/** - * Maps an RGBA quadruple to a pixel value for a given pixel format - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); - -/** - * Maps a pixel value into the RGB components for a given pixel format - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b); - -/** - * Maps a pixel value into the RGBA components for a given pixel format - */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); - -/** @sa SDL_CreateRGBSurface */ -#define SDL_AllocSurface SDL_CreateRGBSurface -/** - * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * If the function runs out of memory, it will return NULL. - * - * The 'flags' tell what kind of surface to create. - * SDL_SWSURFACE means that the surface should be created in system memory. - * SDL_HWSURFACE means that the surface should be created in video memory, - * with the same format as the display surface. This is useful for surfaces - * that will not change much, to take advantage of hardware acceleration - * when being blitted to the display surface. - * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with - * this surface, but you must always lock it before accessing the pixels. - * SDL will wait for current blits to finish before returning from the lock. - * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. - * If the hardware supports acceleration of colorkey blits between - * two surfaces in video memory, SDL will try to place the surface in - * video memory. If this isn't possible or if there is no hardware - * acceleration available, the surface will be placed in system memory. - * SDL_SRCALPHA means that the surface will be used for alpha blits and - * if the hardware supports hardware acceleration of alpha blits between - * two surfaces in video memory, to place the surface in video memory - * if possible, otherwise it will be placed in system memory. - * If the surface is created in video memory, blits will be _much_ faster, - * but the surface format must be identical to the video surface format, - * and the only way to access the pixels member of the surface is to use - * the SDL_LockSurface() and SDL_UnlockSurface() calls. - * If the requested surface actually resides in video memory, SDL_HWSURFACE - * will be set in the flags member of the returned surface. If for some - * reason the surface could not be placed in video memory, it will not have - * the SDL_HWSURFACE flag set, and will be created in system memory instead. - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -/** @sa SDL_CreateRGBSurface */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, int height, int depth, int pitch, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); - -/** - * SDL_LockSurface() sets up a surface for directly accessing the pixels. - * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write - * to and read from 'surface->pixels', using the pixel format stored in - * 'surface->format'. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. In particular, if the - * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you - * will not need to lock the display surface before accessing it. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. - * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. - */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); - -/** - * Load a surface from a seekable SDL data source (memory or file.) - * If 'freesrc' is non-zero, the source will be closed after being read. - * Returns the new surface, or NULL if there was an error. - * The new surface should be freed with SDL_FreeSurface(). - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); - -/** Convenience macro -- load a surface from a file */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Save a surface to a seekable SDL data source (memory or file.) - * If 'freedst' is non-zero, the source will be closed after being written. - * Returns 0 if successful or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface *surface, SDL_RWops *dst, int freedst); - -/** Convenience macro -- save a surface to a file */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * Sets the color key (transparent pixel) in a blittable surface. - * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), - * 'key' will be the transparent pixel in the source image of a blit. - * SDL_RLEACCEL requests RLE acceleration for the surface if present, - * and removes RLE acceleration if absent. - * If 'flag' is 0, this function clears any current color key. - * This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey - (SDL_Surface *surface, Uint32 flag, Uint32 key); - -/** - * This function sets the alpha value for the entire surface, as opposed to - * using the alpha component of each pixel. This value measures the range - * of transparency of the surface, 0 being completely transparent to 255 - * being completely opaque. An 'alpha' value of 255 causes blits to be - * opaque, the source pixels copied to the destination (the default). Note - * that per-surface alpha can be combined with colorkey transparency. - * - * If 'flag' is 0, alpha blending is disabled for the surface. - * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. - * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the - * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. - * - * The 'alpha' parameter is ignored for surfaces that have an alpha channel. - */ -extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); - -/** - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); - -/** - * Gets the clipping rectangle for the destination surface in a blit. - * 'rect' must be a pointer to a valid rectangle which will be filled - * with the correct values. - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); - -/** - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - * - * This function is used internally by SDL_DisplayFormat(). - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface - (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); - -/** - * This performs a fast blit from the source surface to the destination - * surface. It assumes that the source and destination rectangles are - * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire - * surface (src or dst) is copied. The final blit rectangles are saved - * in 'srcrect' and 'dstrect' after all clipping is performed. - * If the blit is successful, it returns 0, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without alpha and colorkey - * are defined as follows: - * - * RGBA->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using alpha-channel). - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy RGB. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value); - * set destination alpha to opaque. - * SDL_SRCALPHA not set: - * copy RGB, set destination alpha to source per-surface alpha value. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * RGBA->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source alpha channel) the RGB values; - * leave destination alpha untouched. [Note: is this correct?] - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy all of RGBA to the destination. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value). - * SDL_SRCALPHA not set: - * copy RGB. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * If either of the surfaces were in video memory, and the blit returns -2, - * the video memory was lost, so it should be reloaded with artwork and - * re-blitted: - * @code - * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { - * while ( SDL_LockSurface(image) < 0 ) - * Sleep(10); - * -- Write image pixels to image->pixels -- - * SDL_UnlockSurface(image); - * } - * @endcode - * - * This happens under DirectX 5.0 when the system switches away from your - * fullscreen application. The lock will also fail until you have access - * to the video memory again. - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. - */ -#define SDL_BlitSurface SDL_UpperBlit - -/** This is the public blit function, SDL_BlitSurface(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlit() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); -/** This is a semi-private blit function and it performs low-level surface - * blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - -/** - * This function performs a fast fill of the given rectangle with 'color' - * The given rectangle is clipped to the destination surface clip area - * and the final fill rectangle is saved in the passed in pointer. - * If 'dstrect' is NULL, the whole surface will be filled with 'color' - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); - -/** - * This function takes a surface and copies it to a new surface of the - * pixel format and colors of the video framebuffer, suitable for fast - * blitting onto the display surface. It calls SDL_ConvertSurface() - * - * If you want to take advantage of hardware colorkey or alpha blit - * acceleration, you should set the colorkey and alpha value before - * calling this function. - * - * If the conversion fails or runs out of memory, it returns NULL - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); - -/** - * This function takes a surface and copies it to a new surface of the - * pixel format and colors of the video framebuffer (if possible), - * suitable for fast alpha blitting onto the display surface. - * The new surface will always have an alpha channel. - * - * If you want to take advantage of hardware colorkey or alpha blit - * acceleration, you should set the colorkey and alpha value before - * calling this function. - * - * If the conversion fails or runs out of memory, it returns NULL - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name YUV video surface overlay functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** This function creates a video output overlay - * Calling the returned surface an overlay is something of a misnomer because - * the contents of the display surface underneath the area where the overlay - * is shown is undefined - it may be overwritten with the converted YUV data. - */ -extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, - Uint32 format, SDL_Surface *display); - -/** Lock an overlay for direct access, and unlock it when you are done */ -extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); -extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); - -/** Blit a video overlay to the display surface. - * The contents of the video surface underneath the blit destination are - * not defined. - * The width and height of the destination rectangle may be different from - * that of the overlay, but currently only 2x scaling is supported. - */ -extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); - -/** Free a video overlay */ -extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name OpenGL support functions. */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** - * Dynamically load an OpenGL library, or the default one if path is NULL - * - * If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * Get the address of a GL function - */ -extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); - -/** - * Set an attribute of the OpenGL subsystem before intialization. - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * Get an attribute of the OpenGL subsystem from the windowing - * interface, such as glX. This is of course different from getting - * the values from SDL's internal OpenGL subsystem, which only - * stores the values you request before initialization. - * - * Developers should track the values they pass into SDL_GL_SetAttribute - * themselves if they want to retrieve these values. - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); - -/** - * Swap the OpenGL buffers, if double-buffering is supported. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); - -/** @name OpenGL Internal Functions - * Internal functions that should not be called unless you have read - * and understood the source code for these functions. - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); -extern DECLSPEC void SDLCALL SDL_GL_Lock(void); -extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); -/*@}*/ - -/*@}*/ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Window Manager Functions */ -/** These functions allow interaction with the window manager, if any. */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** - * Sets the title and icon text of the display window (UTF-8 encoded) - */ -extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); -/** - * Gets the title and icon text of the display window (UTF-8 encoded) - */ -extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); - -/** - * Sets the icon for the display window. - * This function must be called before the first call to SDL_SetVideoMode(). - * It takes an icon surface, and a mask in MSB format. - * If 'mask' is NULL, the entire icon surface will be used as the icon. - */ -extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); - -/** - * This function iconifies the window, and returns 1 if it succeeded. - * If the function succeeds, it generates an SDL_APPACTIVE loss event. - * This function is a noop and returns 0 in non-windowed environments. - */ -extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); - -/** - * Toggle fullscreen mode without changing the contents of the screen. - * If the display surface does not require locking before accessing - * the pixel information, then the memory pointers will not change. - * - * If this function was able to toggle fullscreen mode (change from - * running in a window to fullscreen, or vice-versa), it will return 1. - * If it is not implemented, or fails, it returns 0. - * - * The next call to SDL_SetVideoMode() will set the mode fullscreen - * attribute based on the flags parameter - if SDL_FULLSCREEN is not - * set, then the display will be windowed by default where supported. - * - * This is currently only implemented in the X11 video driver. - */ -extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); - -typedef enum { - SDL_GRAB_QUERY = -1, - SDL_GRAB_OFF = 0, - SDL_GRAB_ON = 1, - SDL_GRAB_FULLSCREEN /**< Used internally */ -} SDL_GrabMode; -/** - * This function allows you to set and query the input grab state of - * the application. It returns the new input grab state. - * - * Grabbing means that the mouse is confined to the application window, - * and nearly all keyboard input is passed directly to the application, - * and not interpreted by a window manager, if any. - */ -extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); - -/*@}*/ - -/** @internal Not in public API at the moment - do not use! */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ diff --git a/Windows/SDL/include/begin_code.h b/Windows/SDL/include/begin_code.h deleted file mode 100644 index 1c8a2a03..00000000 --- a/Windows/SDL/include/begin_code.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file begin_code.h - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) - */ - -/** - * @file begin_code.h - * This shouldn't be nested -- included it around code only. - */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -/** - * @def DECLSPEC - * Some compilers use a special export keyword - */ -#ifndef DECLSPEC -# if defined(__BEOS__) || defined(__HAIKU__) -# if defined(__GNUC__) -# define DECLSPEC -# else -# define DECLSPEC __declspec(export) -# endif -# elif defined(__WIN32__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# elif defined(__OS2__) -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/** - * @def SDLCALL - * By default SDL uses the C calling convention - */ -#ifndef SDLCALL -# if defined(__WIN32__) && !defined(__GNUC__) -# define SDLCALL __cdecl -# elif defined(__OS2__) - /* But on OS/2, we use the _System calling convention */ - /* to be compatible with every compiler */ -# if defined (__GNUC__) && !defined(_System) -# define _System /* For compatibility with old GCC/EMX */ -# endif -# define SDLCALL _System -# else -# define SDLCALL -# endif -#endif /* SDLCALL */ - -#ifdef __SYMBIAN32__ -#ifndef EKA2 -#undef DECLSPEC -#define DECLSPEC -#elif !defined(__WINS__) -#undef DECLSPEC -#define DECLSPEC __declspec(dllexport) -#endif /* !EKA2 */ -#endif /* __SYMBIAN32__ */ - -/** - * @file begin_code.h - * Force structure packing at 4 byte alignment. - * This is necessary if the header is included in code which has structure - * packing set to an alternate value, say for loading structures from disk. - * The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#ifdef _M_X64 -/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ -#pragma pack(push,8) -#else -#pragma pack(push,4) -#endif -#elif (defined(__MWERKS__) && defined(__MACOS__)) -#pragma options align=mac68k4byte -#pragma enumsalwaysint on -#endif /* Compiler needs structure packing set */ - -/** - * @def SDL_INLINE_OKAY - * Set up compiler-specific options for inlining functions - */ -#ifndef SDL_INLINE_OKAY -#ifdef __GNUC__ -#define SDL_INLINE_OKAY -#else -/* Add any special compiler-specific cases here */ -#if defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) || defined(__EABI__) -#ifndef __inline__ -#define __inline__ __inline -#endif -#define SDL_INLINE_OKAY -#else -#if !defined(__MRC__) && !defined(_SGI_SOURCE) -#ifndef __inline__ -#define __inline__ inline -#endif -#define SDL_INLINE_OKAY -#endif /* Not a funky compiler */ -#endif /* Visual C++ */ -#endif /* GNU C */ -#endif /* SDL_INLINE_OKAY */ - -/** - * @def __inline__ - * If inlining isn't supported, remove "__inline__", turning static - * inlined functions into static functions (resulting in code bloat - * in all files which include the offending header files) - */ -#ifndef SDL_INLINE_OKAY -#define __inline__ -#endif - -/** - * @def NULL - * Apparently this is needed by several Windows compilers - */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/Windows/SDL/include/close_code.h b/Windows/SDL/include/close_code.h deleted file mode 100644 index 7a97d88e..00000000 --- a/Windows/SDL/include/close_code.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file close_code.h - * This file reverses the effects of begin_code.h and should be included - * after you finish any function and structure declarations in your headers - */ - -#ifndef _begin_code_h -#error close_code.h included without matching begin_code.h -#endif -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#if (defined(__MWERKS__) && defined(__MACOS__)) -#pragma options align=reset -#pragma enumsalwaysint reset -#else -#pragma pack(pop) -#endif -#endif /* Compiler needs structure packing set */ diff --git a/Windows/SDL/lib/SDL.dll b/Windows/SDL/lib/SDL.dll deleted file mode 100644 index 59bff48b..00000000 Binary files a/Windows/SDL/lib/SDL.dll and /dev/null differ diff --git a/Windows/SDL/lib/SDL.lib b/Windows/SDL/lib/SDL.lib deleted file mode 100644 index 0722a5b7..00000000 Binary files a/Windows/SDL/lib/SDL.lib and /dev/null differ diff --git a/Windows/SDL/lib/SDLmain.lib b/Windows/SDL/lib/SDLmain.lib deleted file mode 100644 index e2e14269..00000000 Binary files a/Windows/SDL/lib/SDLmain.lib and /dev/null differ diff --git a/Windows/SDL/lib/libSDL.dll.a b/Windows/SDL/lib/libSDL.dll.a deleted file mode 100644 index 0d333d47..00000000 Binary files a/Windows/SDL/lib/libSDL.dll.a and /dev/null differ diff --git a/Windows/SDL/lib/libSDLmain.a b/Windows/SDL/lib/libSDLmain.a deleted file mode 100644 index 2ab31840..00000000 Binary files a/Windows/SDL/lib/libSDLmain.a and /dev/null differ diff --git a/Windows/SDL/lib64/SDL.dll b/Windows/SDL/lib64/SDL.dll deleted file mode 100644 index af8b0a3d..00000000 Binary files a/Windows/SDL/lib64/SDL.dll and /dev/null differ diff --git a/Windows/SDL/lib64/SDL.lib b/Windows/SDL/lib64/SDL.lib deleted file mode 100644 index ae2f687f..00000000 Binary files a/Windows/SDL/lib64/SDL.lib and /dev/null differ diff --git a/Windows/SDL/lib64/SDLmain.lib b/Windows/SDL/lib64/SDLmain.lib deleted file mode 100644 index 0c8e43a3..00000000 Binary files a/Windows/SDL/lib64/SDLmain.lib and /dev/null differ diff --git a/Windows/SDL/lib64/libSDL.dll.a b/Windows/SDL/lib64/libSDL.dll.a deleted file mode 100644 index e82e04d5..00000000 Binary files a/Windows/SDL/lib64/libSDL.dll.a and /dev/null differ diff --git a/Windows/SDL/lib64/libSDLmain.a b/Windows/SDL/lib64/libSDLmain.a deleted file mode 100644 index 6c4d94c0..00000000 Binary files a/Windows/SDL/lib64/libSDLmain.a and /dev/null differ diff --git a/Windows/SDL/main/SDL_win32_main.c b/Windows/SDL/main/SDL_win32_main.c deleted file mode 100644 index 672b48c1..00000000 --- a/Windows/SDL/main/SDL_win32_main.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 - - The WinMain function -- calls your program's main() function -*/ - -#include <stdio.h> -#include <stdlib.h> - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#ifdef _WIN32_WCE -# define DIR_SEPERATOR TEXT("\\") -# undef _getcwd -# define _getcwd(str,len) wcscpy(str,TEXT("")) -# define setbuf(f,b) -# define setvbuf(w,x,y,z) -# define fopen _wfopen -# define freopen _wfreopen -# define remove(x) DeleteFile(x) -#else -# define DIR_SEPERATOR TEXT("/") -# include <direct.h> -#endif - -/* Include the SDL main definition header */ -#include "SDL.h" -#include "SDL_main.h" - -#ifdef main -# ifndef _WIN32_WCE_EMULATION -# undef main -# endif /* _WIN32_WCE_EMULATION */ -#endif /* main */ - -/* The standard output files */ -#define STDOUT_FILE TEXT("stdout.txt") -#define STDERR_FILE TEXT("stderr.txt") - -/* Set a variable to tell if the stdio redirect has been enabled. */ -static int stdioRedirectEnabled = 0; - -#ifdef _WIN32_WCE - static wchar_t stdoutPath[MAX_PATH]; - static wchar_t stderrPath[MAX_PATH]; -#else - static char stdoutPath[MAX_PATH]; - static char stderrPath[MAX_PATH]; -#endif - -#if defined(_WIN32_WCE) && _WIN32_WCE < 300 -/* seems to be undefined in Win CE although in online help */ -#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) -#endif /* _WIN32_WCE < 300 */ - -static void UnEscapeQuotes( char *arg ) -{ - char *last = NULL; - - while( *arg ) { - if( *arg == '"' && *last == '\\' ) { - char *c_curr = arg; - char *c_last = last; - - while( *c_curr ) { - *c_last = *c_curr; - c_last = c_curr; - c_curr++; - } - *c_last = '\0'; - } - last = arg; - arg++; - } -} - -/* Parse a command line buffer into arguments */ -static int ParseCommandLine(char *cmdline, char **argv) -{ - char *bufp; - char *lastp = NULL; - int argc, last_argc; - - argc = last_argc = 0; - for ( bufp = cmdline; *bufp; ) { - /* Skip leading whitespace */ - while ( isspace(*bufp) ) { - ++bufp; - } - /* Skip over argument */ - if ( *bufp == '"' ) { - ++bufp; - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && ( *bufp != '"' || (lastp && *lastp == '\\') ) ) { - lastp = bufp; - ++bufp; - } - } else { - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && ! isspace(*bufp) ) { - ++bufp; - } - } - if ( *bufp ) { - if ( argv ) { - *bufp = '\0'; - } - ++bufp; - } - - /* Strip out \ from \" sequences */ - if( argv && last_argc != argc ) { - UnEscapeQuotes( argv[last_argc] ); - } - last_argc = argc; - } - if ( argv ) { - argv[argc] = NULL; - } - return(argc); -} - -/* Show an error message */ -static void ShowError(const char *title, const char *message) -{ -/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ -#ifdef USE_MESSAGEBOX - MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK); -#else - fprintf(stderr, "%s: %s\n", title, message); -#endif -} - -/* Pop up an out of memory message, returns to Windows */ -static BOOL OutOfMemory(void) -{ - ShowError("Fatal Error", "Out of memory - aborting"); - return FALSE; -} - -/* SDL_Quit() shouldn't be used with atexit() directly because - calling conventions may differ... */ -static void cleanup(void) -{ - SDL_Quit(); -} - -/* Remove the output files if there was no output written */ -static void cleanup_output(void) { - FILE *file; - int empty; - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - - /* Without redirection we're done */ - if (!stdioRedirectEnabled) { - return; - } - - /* See if the files have any output in them */ - if ( stdoutPath[0] ) { - file = fopen(stdoutPath, TEXT("rb")); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - remove(stdoutPath); - } - } - } - if ( stderrPath[0] ) { - file = fopen(stderrPath, TEXT("rb")); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - remove(stderrPath); - } - } - } -} - -/* Redirect the output (stdout and stderr) to a file */ -static void redirect_output(void) -{ - DWORD pathlen; -#ifdef _WIN32_WCE - wchar_t path[MAX_PATH]; -#else - char path[MAX_PATH]; -#endif - FILE *newfp; - - pathlen = GetModuleFileName(NULL, path, SDL_arraysize(path)); - while ( pathlen > 0 && path[pathlen] != '\\' ) { - --pathlen; - } - path[pathlen] = '\0'; - -#ifdef _WIN32_WCE - wcsncpy( stdoutPath, path, SDL_arraysize(stdoutPath) ); - wcsncat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); -#else - SDL_strlcpy( stdoutPath, path, SDL_arraysize(stdoutPath) ); - SDL_strlcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); -#endif - - /* Redirect standard input and standard output */ - newfp = freopen(stdoutPath, TEXT("w"), stdout); - -#ifndef _WIN32_WCE - if ( newfp == NULL ) { /* This happens on NT */ -#if !defined(stdout) - stdout = fopen(stdoutPath, TEXT("w")); -#else - newfp = fopen(stdoutPath, TEXT("w")); - if ( newfp ) { - *stdout = *newfp; - } -#endif - } -#endif /* _WIN32_WCE */ - -#ifdef _WIN32_WCE - wcsncpy( stderrPath, path, SDL_arraysize(stdoutPath) ); - wcsncat( stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); -#else - SDL_strlcpy( stderrPath, path, SDL_arraysize(stderrPath) ); - SDL_strlcat( stderrPath, DIR_SEPERATOR STDERR_FILE, SDL_arraysize(stderrPath) ); -#endif - - newfp = freopen(stderrPath, TEXT("w"), stderr); -#ifndef _WIN32_WCE - if ( newfp == NULL ) { /* This happens on NT */ -#if !defined(stderr) - stderr = fopen(stderrPath, TEXT("w")); -#else - newfp = fopen(stderrPath, TEXT("w")); - if ( newfp ) { - *stderr = *newfp; - } -#endif - } -#endif /* _WIN32_WCE */ - - setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* Line buffered */ - setbuf(stderr, NULL); /* No buffering */ - stdioRedirectEnabled = 1; -} - -#if defined(_MSC_VER) && !defined(_WIN32_WCE) -/* The VC++ compiler needs main defined */ -#define console_main main -#endif - -/* This is where execution begins [console apps] */ -int console_main(int argc, char *argv[]) -{ - size_t n; - char *bufp, *appname; - int status; - - /* Get the class name from argv[0] */ - appname = argv[0]; - if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) { - appname = bufp+1; - } else - if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) { - appname = bufp+1; - } - - if ( (bufp=SDL_strrchr(appname, '.')) == NULL ) - n = SDL_strlen(appname); - else - n = (bufp-appname); - - bufp = SDL_stack_alloc(char, n+1); - if ( bufp == NULL ) { - return OutOfMemory(); - } - SDL_strlcpy(bufp, appname, n+1); - appname = bufp; - - /* Load SDL dynamic link library */ - if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) { - ShowError("WinMain() error", SDL_GetError()); - return(FALSE); - } - atexit(cleanup_output); - atexit(cleanup); - - /* Sam: - We still need to pass in the application handle so that - DirectInput will initialize properly when SDL_RegisterApp() - is called later in the video initialization. - */ - SDL_SetModuleHandle(GetModuleHandle(NULL)); - - /* Run the application main() code */ - status = SDL_main(argc, argv); - - /* Exit cleanly, calling atexit() functions */ - exit(status); - - /* Hush little compiler, don't you cry... */ - return 0; -} - -/* This is where execution begins [windowed apps] */ -#ifdef _WIN32_WCE -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw) -#else -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) -#endif -{ - HMODULE handle; - char **argv; - int argc; - char *cmdline; - char *env_str; -#ifdef _WIN32_WCE - wchar_t *bufp; - int nLen; -#else - char *bufp; - size_t nLen; -#endif - - /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't - keep them open. This is a hack.. hopefully it will be fixed - someday. DDHELP.EXE starts up the first time DDRAW.DLL is loaded. - */ - handle = LoadLibrary(TEXT("DDRAW.DLL")); - if ( handle != NULL ) { - FreeLibrary(handle); - } - - /* Check for stdio redirect settings and do the redirection */ - if ((env_str = SDL_getenv("SDL_STDIO_REDIRECT"))) { - if (SDL_atoi(env_str)) { - redirect_output(); - } - } -#ifndef NO_STDIO_REDIRECT - else { - redirect_output(); - } -#endif - -#ifdef _WIN32_WCE - nLen = wcslen(szCmdLine)+128+1; - bufp = SDL_stack_alloc(wchar_t, nLen*2); - wcscpy (bufp, TEXT("\"")); - GetModuleFileName(NULL, bufp+1, 128-3); - wcscpy (bufp+wcslen(bufp), TEXT("\" ")); - wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp)); - nLen = wcslen(bufp)+1; - cmdline = SDL_stack_alloc(char, nLen); - if ( cmdline == NULL ) { - return OutOfMemory(); - } - WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); -#else - /* Grab the command line */ - bufp = GetCommandLine(); - nLen = SDL_strlen(bufp)+1; - cmdline = SDL_stack_alloc(char, nLen); - if ( cmdline == NULL ) { - return OutOfMemory(); - } - SDL_strlcpy(cmdline, bufp, nLen); -#endif - - /* Parse it into argv and argc */ - argc = ParseCommandLine(cmdline, NULL); - argv = SDL_stack_alloc(char*, argc+1); - if ( argv == NULL ) { - return OutOfMemory(); - } - ParseCommandLine(cmdline, argv); - - /* Run the main program (after a little SDL initialization) */ - console_main(argc, argv); - - /* Hush little compiler, don't you cry... */ - return 0; -} diff --git a/Windows/SDL/watcom/SDL.def b/Windows/SDL/watcom/SDL.def deleted file mode 100644 index 751a54bc..00000000 --- a/Windows/SDL/watcom/SDL.def +++ /dev/null @@ -1,210 +0,0 @@ -; lib /def:SDL.def /out:SDL.lib /machine:x86 -LIBRARY SDL.dll -EXPORTS -SDL_AddTimer -SDL_AllocRW -SDL_AudioDriverName -SDL_AudioInit -SDL_AudioQuit -SDL_BuildAudioCVT -SDL_CDClose -SDL_CDEject -SDL_CDName -SDL_CDNumDrives -SDL_CDOpen -SDL_CDPause -SDL_CDPlay -SDL_CDPlayTracks -SDL_CDResume -SDL_CDStatus -SDL_CDStop -SDL_ClearError -SDL_CloseAudio -SDL_CondBroadcast -SDL_CondSignal -SDL_CondWait -SDL_CondWaitTimeout -SDL_ConvertAudio -SDL_ConvertSurface -SDL_CreateCond -SDL_CreateCursor -SDL_CreateMutex -SDL_CreateRGBSurface -SDL_CreateRGBSurfaceFrom -SDL_CreateSemaphore -SDL_CreateThread -SDL_CreateYUVOverlay -SDL_Delay -SDL_DestroyCond -SDL_DestroyMutex -SDL_DestroySemaphore -SDL_DisplayFormat -SDL_DisplayFormatAlpha -SDL_DisplayYUVOverlay -SDL_EnableKeyRepeat -SDL_EnableUNICODE -SDL_Error -SDL_EventState -SDL_FillRect -SDL_Flip -SDL_FreeCursor -SDL_FreeRW -SDL_FreeSurface -SDL_FreeWAV -SDL_FreeYUVOverlay -SDL_GL_GetAttribute -SDL_GL_GetProcAddress -SDL_GL_LoadLibrary -SDL_GL_Lock -SDL_GL_SetAttribute -SDL_GL_SwapBuffers -SDL_GL_Unlock -SDL_GL_UpdateRects -SDL_GetAppState -SDL_GetAudioStatus -SDL_GetClipRect -SDL_GetCursor -SDL_GetError -SDL_GetEventFilter -SDL_GetGammaRamp -SDL_GetKeyName -SDL_GetKeyRepeat -SDL_GetKeyState -SDL_GetModState -SDL_GetMouseState -SDL_GetRGB -SDL_GetRGBA -SDL_GetRelativeMouseState -SDL_GetThreadID -SDL_GetTicks -SDL_GetVideoInfo -SDL_GetVideoSurface -SDL_GetWMInfo -SDL_Has3DNow -SDL_Has3DNowExt -SDL_HasARMNEON -SDL_HasARMSIMD -SDL_HasAltiVec -SDL_HasMMX -SDL_HasMMXExt -SDL_HasRDTSC -SDL_HasSSE -SDL_HasSSE2 -SDL_Init -SDL_InitSubSystem -SDL_JoystickClose -SDL_JoystickEventState -SDL_JoystickGetAxis -SDL_JoystickGetBall -SDL_JoystickGetButton -SDL_JoystickGetHat -SDL_JoystickIndex -SDL_JoystickName -SDL_JoystickNumAxes -SDL_JoystickNumBalls -SDL_JoystickNumButtons -SDL_JoystickNumHats -SDL_JoystickOpen -SDL_JoystickOpened -SDL_JoystickUpdate -SDL_KillThread -SDL_Linked_Version -SDL_ListModes -SDL_LoadBMP_RW -SDL_LoadFunction -SDL_LoadObject -SDL_LoadWAV_RW -SDL_LockAudio -SDL_LockSurface -SDL_LockYUVOverlay -SDL_LowerBlit -SDL_MapRGB -SDL_MapRGBA -SDL_MixAudio -SDL_NumJoysticks -SDL_OpenAudio -SDL_PauseAudio -SDL_PeepEvents -SDL_PollEvent -SDL_PumpEvents -SDL_PushEvent -SDL_Quit -SDL_QuitSubSystem -SDL_RWFromConstMem -SDL_RWFromFP -SDL_RWFromFile -SDL_RWFromMem -SDL_ReadBE16 -SDL_ReadBE32 -SDL_ReadBE64 -SDL_ReadLE16 -SDL_ReadLE32 -SDL_ReadLE64 -SDL_RegisterApp -SDL_RemoveTimer -SDL_SaveBMP_RW -SDL_SemPost -SDL_SemTryWait -SDL_SemValue -SDL_SemWait -SDL_SemWaitTimeout -SDL_SetAlpha -SDL_SetClipRect -SDL_SetColorKey -SDL_SetColors -SDL_SetCursor -SDL_SetError -SDL_SetEventFilter -SDL_SetGamma -SDL_SetGammaRamp -SDL_SetModState -SDL_SetModuleHandle -SDL_SetPalette -SDL_SetTimer -SDL_SetVideoMode -SDL_ShowCursor -SDL_SoftStretch -SDL_ThreadID -SDL_UnloadObject -SDL_UnlockAudio -SDL_UnlockSurface -SDL_UnlockYUVOverlay -SDL_UnregisterApp -SDL_UpdateRect -SDL_UpdateRects -SDL_UpperBlit -SDL_VideoDriverName -SDL_VideoInit -SDL_VideoModeOK -SDL_VideoQuit -SDL_WM_GetCaption -SDL_WM_GrabInput -SDL_WM_IconifyWindow -SDL_WM_SetCaption -SDL_WM_SetIcon -SDL_WM_ToggleFullScreen -SDL_WaitEvent -SDL_WaitThread -SDL_WarpMouse -SDL_WasInit -SDL_WriteBE16 -SDL_WriteBE32 -SDL_WriteBE64 -SDL_WriteLE16 -SDL_WriteLE32 -SDL_WriteLE64 -SDL_getenv -SDL_iconv -SDL_iconv_close -SDL_iconv_open -SDL_iconv_string -SDL_mutexP -SDL_mutexV -SDL_putenv -SDL_revcpy -SDL_snprintf -SDL_strlcat -SDL_strlcpy -SDL_strtoll -SDL_strtoull -SDL_vsnprintf diff --git a/Windows/SDL/watcom/SDL.exp b/Windows/SDL/watcom/SDL.exp deleted file mode 100644 index 726aac98..00000000 --- a/Windows/SDL/watcom/SDL.exp +++ /dev/null @@ -1,207 +0,0 @@ -++'_SDL_AddTimer'.'SDL.DLL'..'SDL_AddTimer' -++'_SDL_AllocRW'.'SDL.DLL'..'SDL_AllocRW' -++'_SDL_AudioDriverName'.'SDL.DLL'..'SDL_AudioDriverName' -++'_SDL_AudioInit'.'SDL.DLL'..'SDL_AudioInit' -++'_SDL_AudioQuit'.'SDL.DLL'..'SDL_AudioQuit' -++'_SDL_BuildAudioCVT'.'SDL.DLL'..'SDL_BuildAudioCVT' -++'_SDL_CDClose'.'SDL.DLL'..'SDL_CDClose' -++'_SDL_CDEject'.'SDL.DLL'..'SDL_CDEject' -++'_SDL_CDName'.'SDL.DLL'..'SDL_CDName' -++'_SDL_CDNumDrives'.'SDL.DLL'..'SDL_CDNumDrives' -++'_SDL_CDOpen'.'SDL.DLL'..'SDL_CDOpen' -++'_SDL_CDPause'.'SDL.DLL'..'SDL_CDPause' -++'_SDL_CDPlay'.'SDL.DLL'..'SDL_CDPlay' -++'_SDL_CDPlayTracks'.'SDL.DLL'..'SDL_CDPlayTracks' -++'_SDL_CDResume'.'SDL.DLL'..'SDL_CDResume' -++'_SDL_CDStatus'.'SDL.DLL'..'SDL_CDStatus' -++'_SDL_CDStop'.'SDL.DLL'..'SDL_CDStop' -++'_SDL_ClearError'.'SDL.DLL'..'SDL_ClearError' -++'_SDL_CloseAudio'.'SDL.DLL'..'SDL_CloseAudio' -++'_SDL_CondBroadcast'.'SDL.DLL'..'SDL_CondBroadcast' -++'_SDL_CondSignal'.'SDL.DLL'..'SDL_CondSignal' -++'_SDL_CondWait'.'SDL.DLL'..'SDL_CondWait' -++'_SDL_CondWaitTimeout'.'SDL.DLL'..'SDL_CondWaitTimeout' -++'_SDL_ConvertAudio'.'SDL.DLL'..'SDL_ConvertAudio' -++'_SDL_ConvertSurface'.'SDL.DLL'..'SDL_ConvertSurface' -++'_SDL_CreateCond'.'SDL.DLL'..'SDL_CreateCond' -++'_SDL_CreateCursor'.'SDL.DLL'..'SDL_CreateCursor' -++'_SDL_CreateMutex'.'SDL.DLL'..'SDL_CreateMutex' -++'_SDL_CreateRGBSurface'.'SDL.DLL'..'SDL_CreateRGBSurface' -++'_SDL_CreateRGBSurfaceFrom'.'SDL.DLL'..'SDL_CreateRGBSurfaceFrom' -++'_SDL_CreateSemaphore'.'SDL.DLL'..'SDL_CreateSemaphore' -++'_SDL_CreateThread'.'SDL.DLL'..'SDL_CreateThread' -++'_SDL_CreateYUVOverlay'.'SDL.DLL'..'SDL_CreateYUVOverlay' -++'_SDL_Delay'.'SDL.DLL'..'SDL_Delay' -++'_SDL_DestroyCond'.'SDL.DLL'..'SDL_DestroyCond' -++'_SDL_DestroyMutex'.'SDL.DLL'..'SDL_DestroyMutex' -++'_SDL_DestroySemaphore'.'SDL.DLL'..'SDL_DestroySemaphore' -++'_SDL_DisplayFormat'.'SDL.DLL'..'SDL_DisplayFormat' -++'_SDL_DisplayFormatAlpha'.'SDL.DLL'..'SDL_DisplayFormatAlpha' -++'_SDL_DisplayYUVOverlay'.'SDL.DLL'..'SDL_DisplayYUVOverlay' -++'_SDL_EnableKeyRepeat'.'SDL.DLL'..'SDL_EnableKeyRepeat' -++'_SDL_EnableUNICODE'.'SDL.DLL'..'SDL_EnableUNICODE' -++'_SDL_Error'.'SDL.DLL'..'SDL_Error' -++'_SDL_EventState'.'SDL.DLL'..'SDL_EventState' -++'_SDL_FillRect'.'SDL.DLL'..'SDL_FillRect' -++'_SDL_Flip'.'SDL.DLL'..'SDL_Flip' -++'_SDL_FreeCursor'.'SDL.DLL'..'SDL_FreeCursor' -++'_SDL_FreeRW'.'SDL.DLL'..'SDL_FreeRW' -++'_SDL_FreeSurface'.'SDL.DLL'..'SDL_FreeSurface' -++'_SDL_FreeWAV'.'SDL.DLL'..'SDL_FreeWAV' -++'_SDL_FreeYUVOverlay'.'SDL.DLL'..'SDL_FreeYUVOverlay' -++'_SDL_GL_GetAttribute'.'SDL.DLL'..'SDL_GL_GetAttribute' -++'_SDL_GL_GetProcAddress'.'SDL.DLL'..'SDL_GL_GetProcAddress' -++'_SDL_GL_LoadLibrary'.'SDL.DLL'..'SDL_GL_LoadLibrary' -++'_SDL_GL_Lock'.'SDL.DLL'..'SDL_GL_Lock' -++'_SDL_GL_SetAttribute'.'SDL.DLL'..'SDL_GL_SetAttribute' -++'_SDL_GL_SwapBuffers'.'SDL.DLL'..'SDL_GL_SwapBuffers' -++'_SDL_GL_Unlock'.'SDL.DLL'..'SDL_GL_Unlock' -++'_SDL_GL_UpdateRects'.'SDL.DLL'..'SDL_GL_UpdateRects' -++'_SDL_GetAppState'.'SDL.DLL'..'SDL_GetAppState' -++'_SDL_GetAudioStatus'.'SDL.DLL'..'SDL_GetAudioStatus' -++'_SDL_GetClipRect'.'SDL.DLL'..'SDL_GetClipRect' -++'_SDL_GetCursor'.'SDL.DLL'..'SDL_GetCursor' -++'_SDL_GetError'.'SDL.DLL'..'SDL_GetError' -++'_SDL_GetEventFilter'.'SDL.DLL'..'SDL_GetEventFilter' -++'_SDL_GetGammaRamp'.'SDL.DLL'..'SDL_GetGammaRamp' -++'_SDL_GetKeyName'.'SDL.DLL'..'SDL_GetKeyName' -++'_SDL_GetKeyRepeat'.'SDL.DLL'..'SDL_GetKeyRepeat' -++'_SDL_GetKeyState'.'SDL.DLL'..'SDL_GetKeyState' -++'_SDL_GetModState'.'SDL.DLL'..'SDL_GetModState' -++'_SDL_GetMouseState'.'SDL.DLL'..'SDL_GetMouseState' -++'_SDL_GetRGB'.'SDL.DLL'..'SDL_GetRGB' -++'_SDL_GetRGBA'.'SDL.DLL'..'SDL_GetRGBA' -++'_SDL_GetRelativeMouseState'.'SDL.DLL'..'SDL_GetRelativeMouseState' -++'_SDL_GetThreadID'.'SDL.DLL'..'SDL_GetThreadID' -++'_SDL_GetTicks'.'SDL.DLL'..'SDL_GetTicks' -++'_SDL_GetVideoInfo'.'SDL.DLL'..'SDL_GetVideoInfo' -++'_SDL_GetVideoSurface'.'SDL.DLL'..'SDL_GetVideoSurface' -++'_SDL_GetWMInfo'.'SDL.DLL'..'SDL_GetWMInfo' -++'_SDL_Has3DNow'.'SDL.DLL'..'SDL_Has3DNow' -++'_SDL_Has3DNowExt'.'SDL.DLL'..'SDL_Has3DNowExt' -++'_SDL_HasARMNEON'.'SDL.DLL'..'SDL_HasARMNEON' -++'_SDL_HasARMSIMD'.'SDL.DLL'..'SDL_HasARMSIMD' -++'_SDL_HasAltiVec'.'SDL.DLL'..'SDL_HasAltiVec' -++'_SDL_HasMMX'.'SDL.DLL'..'SDL_HasMMX' -++'_SDL_HasMMXExt'.'SDL.DLL'..'SDL_HasMMXExt' -++'_SDL_HasRDTSC'.'SDL.DLL'..'SDL_HasRDTSC' -++'_SDL_HasSSE'.'SDL.DLL'..'SDL_HasSSE' -++'_SDL_HasSSE2'.'SDL.DLL'..'SDL_HasSSE2' -++'_SDL_Init'.'SDL.DLL'..'SDL_Init' -++'_SDL_InitSubSystem'.'SDL.DLL'..'SDL_InitSubSystem' -++'_SDL_JoystickClose'.'SDL.DLL'..'SDL_JoystickClose' -++'_SDL_JoystickEventState'.'SDL.DLL'..'SDL_JoystickEventState' -++'_SDL_JoystickGetAxis'.'SDL.DLL'..'SDL_JoystickGetAxis' -++'_SDL_JoystickGetBall'.'SDL.DLL'..'SDL_JoystickGetBall' -++'_SDL_JoystickGetButton'.'SDL.DLL'..'SDL_JoystickGetButton' -++'_SDL_JoystickGetHat'.'SDL.DLL'..'SDL_JoystickGetHat' -++'_SDL_JoystickIndex'.'SDL.DLL'..'SDL_JoystickIndex' -++'_SDL_JoystickName'.'SDL.DLL'..'SDL_JoystickName' -++'_SDL_JoystickNumAxes'.'SDL.DLL'..'SDL_JoystickNumAxes' -++'_SDL_JoystickNumBalls'.'SDL.DLL'..'SDL_JoystickNumBalls' -++'_SDL_JoystickNumButtons'.'SDL.DLL'..'SDL_JoystickNumButtons' -++'_SDL_JoystickNumHats'.'SDL.DLL'..'SDL_JoystickNumHats' -++'_SDL_JoystickOpen'.'SDL.DLL'..'SDL_JoystickOpen' -++'_SDL_JoystickOpened'.'SDL.DLL'..'SDL_JoystickOpened' -++'_SDL_JoystickUpdate'.'SDL.DLL'..'SDL_JoystickUpdate' -++'_SDL_KillThread'.'SDL.DLL'..'SDL_KillThread' -++'_SDL_Linked_Version'.'SDL.DLL'..'SDL_Linked_Version' -++'_SDL_ListModes'.'SDL.DLL'..'SDL_ListModes' -++'_SDL_LoadBMP_RW'.'SDL.DLL'..'SDL_LoadBMP_RW' -++'_SDL_LoadFunction'.'SDL.DLL'..'SDL_LoadFunction' -++'_SDL_LoadObject'.'SDL.DLL'..'SDL_LoadObject' -++'_SDL_LoadWAV_RW'.'SDL.DLL'..'SDL_LoadWAV_RW' -++'_SDL_LockAudio'.'SDL.DLL'..'SDL_LockAudio' -++'_SDL_LockSurface'.'SDL.DLL'..'SDL_LockSurface' -++'_SDL_LockYUVOverlay'.'SDL.DLL'..'SDL_LockYUVOverlay' -++'_SDL_LowerBlit'.'SDL.DLL'..'SDL_LowerBlit' -++'_SDL_MapRGB'.'SDL.DLL'..'SDL_MapRGB' -++'_SDL_MapRGBA'.'SDL.DLL'..'SDL_MapRGBA' -++'_SDL_MixAudio'.'SDL.DLL'..'SDL_MixAudio' -++'_SDL_NumJoysticks'.'SDL.DLL'..'SDL_NumJoysticks' -++'_SDL_OpenAudio'.'SDL.DLL'..'SDL_OpenAudio' -++'_SDL_PauseAudio'.'SDL.DLL'..'SDL_PauseAudio' -++'_SDL_PeepEvents'.'SDL.DLL'..'SDL_PeepEvents' -++'_SDL_PollEvent'.'SDL.DLL'..'SDL_PollEvent' -++'_SDL_PumpEvents'.'SDL.DLL'..'SDL_PumpEvents' -++'_SDL_PushEvent'.'SDL.DLL'..'SDL_PushEvent' -++'_SDL_Quit'.'SDL.DLL'..'SDL_Quit' -++'_SDL_QuitSubSystem'.'SDL.DLL'..'SDL_QuitSubSystem' -++'_SDL_RWFromConstMem'.'SDL.DLL'..'SDL_RWFromConstMem' -++'_SDL_RWFromFP'.'SDL.DLL'..'SDL_RWFromFP' -++'_SDL_RWFromFile'.'SDL.DLL'..'SDL_RWFromFile' -++'_SDL_RWFromMem'.'SDL.DLL'..'SDL_RWFromMem' -++'_SDL_ReadBE16'.'SDL.DLL'..'SDL_ReadBE16' -++'_SDL_ReadBE32'.'SDL.DLL'..'SDL_ReadBE32' -++'_SDL_ReadBE64'.'SDL.DLL'..'SDL_ReadBE64' -++'_SDL_ReadLE16'.'SDL.DLL'..'SDL_ReadLE16' -++'_SDL_ReadLE32'.'SDL.DLL'..'SDL_ReadLE32' -++'_SDL_ReadLE64'.'SDL.DLL'..'SDL_ReadLE64' -++'_SDL_RegisterApp'.'SDL.DLL'..'SDL_RegisterApp' -++'_SDL_RemoveTimer'.'SDL.DLL'..'SDL_RemoveTimer' -++'_SDL_SaveBMP_RW'.'SDL.DLL'..'SDL_SaveBMP_RW' -++'_SDL_SemPost'.'SDL.DLL'..'SDL_SemPost' -++'_SDL_SemTryWait'.'SDL.DLL'..'SDL_SemTryWait' -++'_SDL_SemValue'.'SDL.DLL'..'SDL_SemValue' -++'_SDL_SemWait'.'SDL.DLL'..'SDL_SemWait' -++'_SDL_SemWaitTimeout'.'SDL.DLL'..'SDL_SemWaitTimeout' -++'_SDL_SetAlpha'.'SDL.DLL'..'SDL_SetAlpha' -++'_SDL_SetClipRect'.'SDL.DLL'..'SDL_SetClipRect' -++'_SDL_SetColorKey'.'SDL.DLL'..'SDL_SetColorKey' -++'_SDL_SetColors'.'SDL.DLL'..'SDL_SetColors' -++'_SDL_SetCursor'.'SDL.DLL'..'SDL_SetCursor' -++'_SDL_SetError'.'SDL.DLL'..'SDL_SetError' -++'_SDL_SetEventFilter'.'SDL.DLL'..'SDL_SetEventFilter' -++'_SDL_SetGamma'.'SDL.DLL'..'SDL_SetGamma' -++'_SDL_SetGammaRamp'.'SDL.DLL'..'SDL_SetGammaRamp' -++'_SDL_SetModState'.'SDL.DLL'..'SDL_SetModState' -++'_SDL_SetModuleHandle'.'SDL.DLL'..'SDL_SetModuleHandle' -++'_SDL_SetPalette'.'SDL.DLL'..'SDL_SetPalette' -++'_SDL_SetTimer'.'SDL.DLL'..'SDL_SetTimer' -++'_SDL_SetVideoMode'.'SDL.DLL'..'SDL_SetVideoMode' -++'_SDL_ShowCursor'.'SDL.DLL'..'SDL_ShowCursor' -++'_SDL_SoftStretch'.'SDL.DLL'..'SDL_SoftStretch' -++'_SDL_ThreadID'.'SDL.DLL'..'SDL_ThreadID' -++'_SDL_UnloadObject'.'SDL.DLL'..'SDL_UnloadObject' -++'_SDL_UnlockAudio'.'SDL.DLL'..'SDL_UnlockAudio' -++'_SDL_UnlockSurface'.'SDL.DLL'..'SDL_UnlockSurface' -++'_SDL_UnlockYUVOverlay'.'SDL.DLL'..'SDL_UnlockYUVOverlay' -++'_SDL_UnregisterApp'.'SDL.DLL'..'SDL_UnregisterApp' -++'_SDL_UpdateRect'.'SDL.DLL'..'SDL_UpdateRect' -++'_SDL_UpdateRects'.'SDL.DLL'..'SDL_UpdateRects' -++'_SDL_UpperBlit'.'SDL.DLL'..'SDL_UpperBlit' -++'_SDL_VideoDriverName'.'SDL.DLL'..'SDL_VideoDriverName' -++'_SDL_VideoInit'.'SDL.DLL'..'SDL_VideoInit' -++'_SDL_VideoModeOK'.'SDL.DLL'..'SDL_VideoModeOK' -++'_SDL_VideoQuit'.'SDL.DLL'..'SDL_VideoQuit' -++'_SDL_WM_GetCaption'.'SDL.DLL'..'SDL_WM_GetCaption' -++'_SDL_WM_GrabInput'.'SDL.DLL'..'SDL_WM_GrabInput' -++'_SDL_WM_IconifyWindow'.'SDL.DLL'..'SDL_WM_IconifyWindow' -++'_SDL_WM_SetCaption'.'SDL.DLL'..'SDL_WM_SetCaption' -++'_SDL_WM_SetIcon'.'SDL.DLL'..'SDL_WM_SetIcon' -++'_SDL_WM_ToggleFullScreen'.'SDL.DLL'..'SDL_WM_ToggleFullScreen' -++'_SDL_WaitEvent'.'SDL.DLL'..'SDL_WaitEvent' -++'_SDL_WaitThread'.'SDL.DLL'..'SDL_WaitThread' -++'_SDL_WarpMouse'.'SDL.DLL'..'SDL_WarpMouse' -++'_SDL_WasInit'.'SDL.DLL'..'SDL_WasInit' -++'_SDL_WriteBE16'.'SDL.DLL'..'SDL_WriteBE16' -++'_SDL_WriteBE32'.'SDL.DLL'..'SDL_WriteBE32' -++'_SDL_WriteBE64'.'SDL.DLL'..'SDL_WriteBE64' -++'_SDL_WriteLE16'.'SDL.DLL'..'SDL_WriteLE16' -++'_SDL_WriteLE32'.'SDL.DLL'..'SDL_WriteLE32' -++'_SDL_WriteLE64'.'SDL.DLL'..'SDL_WriteLE64' -++'_SDL_getenv'.'SDL.DLL'..'SDL_getenv' -++'_SDL_iconv'.'SDL.DLL'..'SDL_iconv' -++'_SDL_iconv_close'.'SDL.DLL'..'SDL_iconv_close' -++'_SDL_iconv_open'.'SDL.DLL'..'SDL_iconv_open' -++'_SDL_iconv_string'.'SDL.DLL'..'SDL_iconv_string' -++'_SDL_mutexP'.'SDL.DLL'..'SDL_mutexP' -++'_SDL_mutexV'.'SDL.DLL'..'SDL_mutexV' -++'_SDL_putenv'.'SDL.DLL'..'SDL_putenv' -++'_SDL_revcpy'.'SDL.DLL'..'SDL_revcpy' -++'_SDL_snprintf'.'SDL.DLL'..'SDL_snprintf' -++'_SDL_strlcat'.'SDL.DLL'..'SDL_strlcat' -++'_SDL_strlcpy'.'SDL.DLL'..'SDL_strlcpy' -++'_SDL_strtoll'.'SDL.DLL'..'SDL_strtoll' -++'_SDL_strtoull'.'SDL.DLL'..'SDL_strtoull' -++'_SDL_vsnprintf'.'SDL.DLL'..'SDL_vsnprintf' diff --git a/Windows/SDL/watcom/SDL.lib b/Windows/SDL/watcom/SDL.lib deleted file mode 100644 index 79c72c98..00000000 Binary files a/Windows/SDL/watcom/SDL.lib and /dev/null differ diff --git a/Windows/SDL/watcom/def2lbc.awk b/Windows/SDL/watcom/def2lbc.awk deleted file mode 100644 index 84767f60..00000000 --- a/Windows/SDL/watcom/def2lbc.awk +++ /dev/null @@ -1,38 +0,0 @@ -# get uppercased module name -/^[ \t]*LIBRARY/ { ModuleName = toupper( $2 ); next } - -# skip uninteresting lines -/^[ \t]*(EXPORTS|;)/ { next } - -# NB: Calling conventions essentially do not exist on non-x86 platforms, -# we simply strip the decoration unless 'cpu' equals 386. - -# process fastcall symbols "@symbol@size" -/^[ \t]*@[A-Za-z0-9_]+@[0-9]+/ { - split( $1, parts, "@" ) # split the import name on the at signs - if( cpu == "386" ) - printf( "++'%s'.'%s'..'%s'\n", $1, ModuleName, parts[2] ) - else - printf( "++'%s'.'%s'\n", parts[2], ModuleName ) - next -} - -# process stdcall symbols using "symbol@size" format -/^[ \t]*[A-Za-z0-9_]+@[0-9]+/ { - split( $1, parts, "@" ) # split the import name on the at sign - if( cpu == "386" ) - printf( "++'_%s'.'%s'..'%s'\n", $1, ModuleName, parts[1] ) - else - printf( "++'%s'.'%s'\n", parts[1], ModuleName ) - next -} - -# process cdecl symbols using plain "symbol" format -/^[ \t]*[A-Za-z0-9_]+/ { - split( $1, parts, "@" ) # split the import name on the at sign - if( cpu == "386" ) - printf( "++'_%s'.'%s'..'%s'\n", $1, ModuleName, $1 ) - else - printf( "++'%s'.'%s'\n", parts[1], ModuleName ) - next -} diff --git a/Windows/SDL/watcom/makefile b/Windows/SDL/watcom/makefile deleted file mode 100644 index 583e827b..00000000 --- a/Windows/SDL/watcom/makefile +++ /dev/null @@ -1,11 +0,0 @@ -# Open Watcom makefile to generate SDL.lib -# def2lbc.awk (from OW source tree) requires 'awk' -# run 'wmake' - -all: SDL.lib - -SDL.exp: SDL.def def2lbc.awk - awk -v cpu=386 -f def2lbc.awk SDL.def > SDL.exp - -SDL.lib: SDL.exp - wlib -q -b -n -c -pa -s -t -zld -ii -io SDL.lib @SDL.exp diff --git a/Windows/SDL2/include/SDL.h b/Windows/SDL2/include/SDL.h deleted file mode 100644 index e4329395..00000000 --- a/Windows/SDL2/include/SDL.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL.h - * - * Main include header for the SDL library - */ - - -#ifndef SDL_h_ -#define SDL_h_ - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_assert.h" -#include "SDL_atomic.h" -#include "SDL_audio.h" -#include "SDL_clipboard.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_filesystem.h" -#include "SDL_gamecontroller.h" -#include "SDL_haptic.h" -#include "SDL_hints.h" -#include "SDL_joystick.h" -#include "SDL_loadso.h" -#include "SDL_log.h" -#include "SDL_messagebox.h" -#include "SDL_metal.h" -#include "SDL_mutex.h" -#include "SDL_power.h" -#include "SDL_render.h" -#include "SDL_rwops.h" -#include "SDL_sensor.h" -#include "SDL_shape.h" -#include "SDL_system.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_version.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* As of version 0.5, SDL is loaded dynamically into the application */ - -/** - * \name SDL_INIT_* - * - * These are the flags which may be passed to SDL_Init(). You should - * specify the subsystems which you will be using in your application. - */ -/* @{ */ -#define SDL_INIT_TIMER 0x00000001u -#define SDL_INIT_AUDIO 0x00000010u -#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ -#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ -#define SDL_INIT_HAPTIC 0x00001000u -#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ -#define SDL_INIT_EVENTS 0x00004000u -#define SDL_INIT_SENSOR 0x00008000u -#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ -#define SDL_INIT_EVERYTHING ( \ - SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ - SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \ - ) -/* @} */ - -/** - * This function initializes the subsystems specified by \c flags - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/** - * This function initializes specific SDL subsystems - * - * Subsystem initialization is ref-counted, you must call - * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly - * shutdown a subsystem manually (or call SDL_Quit() to force shutdown). - * If a subsystem is already loaded then this call will - * increase the ref-count and return. - */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/** - * This function cleans up specific SDL subsystems - */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/** - * This function returns a mask of the specified subsystems which have - * previously been initialized. - * - * If \c flags is 0, it returns a mask of all initialized subsystems. - */ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/** - * This function cleans up all initialized subsystems. You should - * call it upon all exit conditions. - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL.h b/Windows/SDL2/include/SDL2/SDL.h new file mode 100644 index 00000000..634bf4b6 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL.h @@ -0,0 +1,136 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL.h + * + * Main include header for the SDL library + */ + + +#ifndef SDL_h_ +#define SDL_h_ + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_assert.h" +#include "SDL_atomic.h" +#include "SDL_audio.h" +#include "SDL_clipboard.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_filesystem.h" +#include "SDL_gamecontroller.h" +#include "SDL_haptic.h" +#include "SDL_hints.h" +#include "SDL_joystick.h" +#include "SDL_loadso.h" +#include "SDL_log.h" +#include "SDL_messagebox.h" +#include "SDL_metal.h" +#include "SDL_mutex.h" +#include "SDL_power.h" +#include "SDL_render.h" +#include "SDL_rwops.h" +#include "SDL_sensor.h" +#include "SDL_shape.h" +#include "SDL_system.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_version.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* As of version 0.5, SDL is loaded dynamically into the application */ + +/** + * \name SDL_INIT_* + * + * These are the flags which may be passed to SDL_Init(). You should + * specify the subsystems which you will be using in your application. + */ +/* @{ */ +#define SDL_INIT_TIMER 0x00000001u +#define SDL_INIT_AUDIO 0x00000010u +#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ +#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ +#define SDL_INIT_HAPTIC 0x00001000u +#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ +#define SDL_INIT_EVENTS 0x00004000u +#define SDL_INIT_SENSOR 0x00008000u +#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ +#define SDL_INIT_EVERYTHING ( \ + SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ + SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \ + ) +/* @} */ + +/** + * This function initializes the subsystems specified by \c flags + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** + * This function initializes specific SDL subsystems + * + * Subsystem initialization is ref-counted, you must call + * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly + * shutdown a subsystem manually (or call SDL_Quit() to force shutdown). + * If a subsystem is already loaded then this call will + * increase the ref-count and return. + */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** + * This function cleans up specific SDL subsystems + */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** + * This function returns a mask of the specified subsystems which have + * previously been initialized. + * + * If \c flags is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** + * This function cleans up all initialized subsystems. You should + * call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_assert.h b/Windows/SDL2/include/SDL2/SDL_assert.h new file mode 100644 index 00000000..21bdad99 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_assert.h @@ -0,0 +1,291 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_assert_h_ +#define SDL_assert_h_ + +#include "SDL_config.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SDL_ASSERT_LEVEL +#ifdef SDL_DEFAULT_ASSERT_LEVEL +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL +#elif defined(_DEBUG) || defined(DEBUG) || \ + (defined(__GNUC__) && !defined(__OPTIMIZE__)) +#define SDL_ASSERT_LEVEL 2 +#else +#define SDL_ASSERT_LEVEL 1 +#endif +#endif /* SDL_ASSERT_LEVEL */ + +/* +These are macros and not first class functions so that the debugger breaks +on the assertion line and not in some random guts of SDL, and so each +assert can have unique static variables associated with it. +*/ + +#if defined(_MSC_VER) +/* Don't include intrin.h here because it contains C++ code */ + extern void __cdecl __debugbreak(void); + #define SDL_TriggerBreakpoint() __debugbreak() +#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif defined(__386__) && defined(__WATCOMC__) + #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } +#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) + #include <signal.h> + #define SDL_TriggerBreakpoint() raise(SIGTRAP) +#else + /* How do we trigger breakpoints on this platform? */ + #define SDL_TriggerBreakpoint() +#endif + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ +# define SDL_FUNCTION __func__ +#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__)) +# define SDL_FUNCTION __FUNCTION__ +#else +# define SDL_FUNCTION "???" +#endif +#define SDL_FILE __FILE__ +#define SDL_LINE __LINE__ + +/* +sizeof (x) makes the compiler still parse the expression even without +assertions enabled, so the code is always checked at compile time, but +doesn't actually generate code for it, so there are no side effects or +expensive checks at run time, just the constant size of what x WOULD be, +which presumably gets optimized out as unused. +This also solves the problem of... + + int somevalue = blah(); + SDL_assert(somevalue == 1); + +...which would cause compiles to complain that somevalue is unused if we +disable assertions. +*/ + +/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking + this condition isn't constant. And looks like an owl's face! */ +#ifdef _MSC_VER /* stupid /W4 warnings. */ +#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) +#else +#define SDL_NULL_WHILE_LOOP_CONDITION (0) +#endif + +#define SDL_disabled_assert(condition) \ + do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) + +typedef enum +{ + SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ + SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ + SDL_ASSERTION_ABORT, /**< Terminate the program. */ + SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ + SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ +} SDL_AssertState; + +typedef struct SDL_AssertData +{ + int always_ignore; + unsigned int trigger_count; + const char *condition; + const char *filename; + int linenum; + const char *function; + const struct SDL_AssertData *next; +} SDL_AssertData; + +#if (SDL_ASSERT_LEVEL > 0) + +/* Never call this directly. Use the SDL_assert* macros. */ +extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, + const char *, + const char *, int) +#if defined(__clang__) +#if __has_feature(attribute_analyzer_noreturn) +/* this tells Clang's static analysis that we're a custom assert function, + and that the analyzer should assume the condition was always true past this + SDL_assert test. */ + __attribute__((analyzer_noreturn)) +#endif +#endif +; + +/* the do {} while(0) avoids dangling else problems: + if (x) SDL_assert(y); else blah(); + ... without the do/while, the "else" could attach to this macro's "if". + We try to handle just the minimum we need here in a macro...the loop, + the static vars, and break points. The heavy lifting is handled in + SDL_ReportAssertion(), in SDL_assert.c. +*/ +#define SDL_enabled_assert(condition) \ + do { \ + while ( !(condition) ) { \ + static struct SDL_AssertData sdl_assert_data = { \ + 0, 0, #condition, 0, 0, 0, 0 \ + }; \ + const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ + if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ + continue; /* go again. */ \ + } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ + SDL_TriggerBreakpoint(); \ + } \ + break; /* not retrying. */ \ + } \ + } while (SDL_NULL_WHILE_LOOP_CONDITION) + +#endif /* enabled assertions support code */ + +/* Enable various levels of assertions. */ +#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_disabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) +#else +# error Unknown assertion level. +#endif + +/* this assertion is never disabled at any level. */ +#define SDL_assert_always(condition) SDL_enabled_assert(condition) + + +typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( + const SDL_AssertData* data, void* userdata); + +/** + * \brief Set an application-defined assertion handler. + * + * This allows an app to show its own assertion UI and/or force the + * response to an assertion failure. If the app doesn't provide this, SDL + * will try to do the right thing, popping up a system-specific GUI dialog, + * and probably minimizing any fullscreen windows. + * + * This callback may fire from any thread, but it runs wrapped in a mutex, so + * it will only fire from one thread at a time. + * + * Setting the callback to NULL restores SDL's original internal handler. + * + * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! + * + * Return SDL_AssertState value of how to handle the assertion failure. + * + * \param handler Callback function, called when an assertion fails. + * \param userdata A pointer passed to the callback as-is. + */ +extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( + SDL_AssertionHandler handler, + void *userdata); + +/** + * \brief Get the default assertion handler. + * + * This returns the function pointer that is called by default when an + * assertion is triggered. This is an internal function provided by SDL, + * that is used for assertions when SDL_SetAssertionHandler() hasn't been + * used to provide a different function. + * + * \return The default SDL_AssertionHandler that is called when an assert triggers. + */ +extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); + +/** + * \brief Get the current assertion handler. + * + * This returns the function pointer that is called when an assertion is + * triggered. This is either the value last passed to + * SDL_SetAssertionHandler(), or if no application-specified function is + * set, is equivalent to calling SDL_GetDefaultAssertionHandler(). + * + * \param puserdata Pointer to a void*, which will store the "userdata" + * pointer that was passed to SDL_SetAssertionHandler(). + * This value will always be NULL for the default handler. + * If you don't care about this data, it is safe to pass + * a NULL pointer to this function to ignore it. + * \return The SDL_AssertionHandler that is called when an assert triggers. + */ +extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); + +/** + * \brief Get a list of all assertion failures. + * + * Get all assertions triggered since last call to SDL_ResetAssertionReport(), + * or the start of the program. + * + * The proper way to examine this data looks something like this: + * + * <code> + * const SDL_AssertData *item = SDL_GetAssertionReport(); + * while (item) { + * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n", + * item->condition, item->function, item->filename, + * item->linenum, item->trigger_count, + * item->always_ignore ? "yes" : "no"); + * item = item->next; + * } + * </code> + * + * \return List of all assertions. + * \sa SDL_ResetAssertionReport + */ +extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); + +/** + * \brief Reset the list of all assertion failures. + * + * Reset list of all assertions triggered. + * + * \sa SDL_GetAssertionReport + */ +extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); + + +/* these had wrong naming conventions until 2.0.4. Please update your app! */ +#define SDL_assert_state SDL_AssertState +#define SDL_assert_data SDL_AssertData + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_assert_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_atomic.h b/Windows/SDL2/include/SDL2/SDL_atomic.h new file mode 100644 index 00000000..e99f1bcc --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_atomic.h @@ -0,0 +1,295 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_atomic.h + * + * Atomic operations. + * + * IMPORTANT: + * If you are not an expert in concurrent lockless programming, you should + * only be using the atomic lock and reference counting functions in this + * file. In all other cases you should be protecting your data structures + * with full mutexes. + * + * The list of "safe" functions to use are: + * SDL_AtomicLock() + * SDL_AtomicUnlock() + * SDL_AtomicIncRef() + * SDL_AtomicDecRef() + * + * Seriously, here be dragons! + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * You can find out a little more about lockless programming and the + * subtle issues that can arise here: + * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx + * + * There's also lots of good information here: + * http://www.1024cores.net/home/lock-free-algorithms + * http://preshing.com/ + * + * These operations may or may not actually be implemented using + * processor specific atomic operations. When possible they are + * implemented as true processor specific atomic operations. When that + * is not possible the are implemented using locks that *do* use the + * available atomic operations. + * + * All of the atomic operations that modify memory are full memory barriers. + */ + +#ifndef SDL_atomic_h_ +#define SDL_atomic_h_ + +#include "SDL_stdinc.h" +#include "SDL_platform.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name SDL AtomicLock + * + * The atomic locks are efficient spinlocks using CPU instructions, + * but are vulnerable to starvation and can spin forever if a thread + * holding a lock has been terminated. For this reason you should + * minimize the code executed inside an atomic lock and never do + * expensive things like API or system calls while holding them. + * + * The atomic locks are not safe to lock recursively. + * + * Porting Note: + * The spin lock functions and type are required and can not be + * emulated because they are used in the atomic emulation code. + */ +/* @{ */ + +typedef int SDL_SpinLock; + +/** + * \brief Try to lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + * + * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); + +/** + * \brief Lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); + +/** + * \brief Unlock a spin lock by setting it to 0. Always returns immediately + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); + +/* @} *//* SDL AtomicLock */ + + +/** + * The compiler barrier prevents the compiler from reordering + * reads and writes to globally visible variables across the call. + */ +#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__) +void _ReadWriteBarrier(void); +#pragma intrinsic(_ReadWriteBarrier) +#define SDL_CompilerBarrier() _ReadWriteBarrier() +#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ +#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") +#elif defined(__WATCOMC__) +extern _inline void SDL_CompilerBarrier (void); +#pragma aux SDL_CompilerBarrier = "" parm [] modify exact []; +#else +#define SDL_CompilerBarrier() \ +{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } +#endif + +/** + * Memory barriers are designed to prevent reads and writes from being + * reordered by the compiler and being seen out of order on multi-core CPUs. + * + * A typical pattern would be for thread A to write some data and a flag, + * and for thread B to read the flag and get the data. In this case you + * would insert a release barrier between writing the data and the flag, + * guaranteeing that the data write completes no later than the flag is + * written, and you would insert an acquire barrier between reading the + * flag and reading the data, to ensure that all the reads associated + * with the flag have completed. + * + * In this pattern you should always see a release barrier paired with + * an acquire barrier and you should gate the data reads/writes with a + * single flag variable. + * + * For more information on these semantics, take a look at the blog post: + * http://preshing.com/20120913/acquire-and-release-semantics + */ +extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void); +extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void); + +#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") +#elif defined(__GNUC__) && defined(__aarch64__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__GNUC__) && defined(__arm__) +#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */ +/* Information from: + https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19 + + The Linux kernel provides a helper function which provides the right code for a memory barrier, + hard-coded at address 0xffff0fa0 +*/ +typedef void (*SDL_KernelMemoryBarrierFunc)(); +#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() +#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() +#elif 0 /* defined(__QNXNTO__) */ +#include <sys/cpuinline.h> + +#define SDL_MemoryBarrierRelease() __cpu_membarrier() +#define SDL_MemoryBarrierAcquire() __cpu_membarrier() +#else +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) +#ifdef __thumb__ +/* The mcr instruction isn't available in thumb mode, use real functions */ +#define SDL_MEMORY_BARRIER_USES_FUNCTION +#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction() +#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#endif /* __thumb__ */ +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") +#endif /* __LINUX__ || __ANDROID__ */ +#endif /* __GNUC__ && __arm__ */ +#else +#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ +#include <mbarrier.h> +#define SDL_MemoryBarrierRelease() __machine_rel_barrier() +#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() +#else +/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ +#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() +#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() +#endif +#endif + +/** + * \brief A type representing an atomic integer value. It is a struct + * so people don't accidentally use numeric operations on it. + */ +typedef struct { int value; } SDL_atomic_t; + +/** + * \brief Set an atomic variable to a new value if it is currently an old value. + * + * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); + +/** + * \brief Set an atomic variable to a value. + * + * \return The previous value of the atomic variable. + */ +extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); + +/** + * \brief Get the value of an atomic variable + */ +extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); + +/** + * \brief Add to an atomic variable. + * + * \return The previous value of the atomic variable. + * + * \note This same style can be used for any number operation + */ +extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); + +/** + * \brief Increment an atomic variable used as a reference count. + */ +#ifndef SDL_AtomicIncRef +#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) +#endif + +/** + * \brief Decrement an atomic variable used as a reference count. + * + * \return SDL_TRUE if the variable reached zero after decrementing, + * SDL_FALSE otherwise + */ +#ifndef SDL_AtomicDecRef +#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) +#endif + +/** + * \brief Set a pointer to a new value if it is currently an old value. + * + * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); + +/** + * \brief Set a pointer to a value atomically. + * + * \return The previous value of the pointer. + */ +extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); + +/** + * \brief Get the value of a pointer atomically. + */ +extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif + +#include "close_code.h" + +#endif /* SDL_atomic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_audio.h b/Windows/SDL2/include/SDL2/SDL_audio.h new file mode 100644 index 00000000..4ba34914 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_audio.h @@ -0,0 +1,859 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_audio.h + * + * Access to the raw audio mixing buffer for the SDL library. + */ + +#ifndef SDL_audio_h_ +#define SDL_audio_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). + * + * \verbatim + ++-----------------------sample is signed if set + || + || ++-----------sample is bigendian if set + || || + || || ++---sample is float if set + || || || + || || || +---sample bit size---+ + || || || | | + 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + \endverbatim + * + * There are macros in SDL 2.0 and later to query these bits. + */ +typedef Uint16 SDL_AudioFormat; + +/** + * \name Audio flags + */ +/* @{ */ + +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#define SDL_AUDIO_MASK_DATATYPE (1<<8) +#define SDL_AUDIO_MASK_ENDIAN (1<<12) +#define SDL_AUDIO_MASK_SIGNED (1<<15) +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) +#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) +#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) +#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) +#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) +#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) + +/** + * \name Audio format flags + * + * Defaults to LSB byte order. + */ +/* @{ */ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB +/* @} */ + +/** + * \name int32 support + */ +/* @{ */ +#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ +#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ +#define AUDIO_S32 AUDIO_S32LSB +/* @} */ + +/** + * \name float32 support + */ +/* @{ */ +#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ +#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ +#define AUDIO_F32 AUDIO_F32LSB +/* @} */ + +/** + * \name Native audio byte ordering + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_S32SYS AUDIO_S32LSB +#define AUDIO_F32SYS AUDIO_F32LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_S32SYS AUDIO_S32MSB +#define AUDIO_F32SYS AUDIO_F32MSB +#endif +/* @} */ + +/** + * \name Allow change flags + * + * Which audio format changes are allowed when opening a device. + */ +/* @{ */ +#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 +#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 +#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 +#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008 +#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE) +/* @} */ + +/* @} *//* Audio flags */ + +/** + * This function is called when the audio device needs more data. + * + * \param userdata An application-specific parameter saved in + * the SDL_AudioSpec structure + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + * + * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if + * you like. Just open your audio device with a NULL callback. + */ +typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, + int len); + +/** + * The calculated values in this structure are calculated by SDL_OpenAudio(). + * + * For multi-channel audio, the default SDL channel mapping is: + * 2: FL FR (stereo) + * 3: FL FR LFE (2.1 surround) + * 4: FL FR BL BR (quad) + * 5: FL FR FC BL BR (quad + center) + * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) + * 7: FL FR FC LFE BC SL SR (6.1 surround) + * 8: FL FR FC LFE BL BR SL SR (7.1 surround) + */ +typedef struct SDL_AudioSpec +{ + int freq; /**< DSP frequency -- samples per second */ + SDL_AudioFormat format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ + void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ +} SDL_AudioSpec; + + +struct SDL_AudioCVT; +typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, + SDL_AudioFormat format); + +/** + * \brief Upper limit of filters in SDL_AudioCVT + * + * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is + * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, + * one of which is the terminating NULL pointer. + */ +#define SDL_AUDIOCVT_MAX_FILTERS 9 + +/** + * \struct SDL_AudioCVT + * \brief A structure to hold a set of audio conversion filters and buffers. + * + * Note that various parts of the conversion pipeline can take advantage + * of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require + * you to pass it aligned data, but can possibly run much faster if you + * set both its (buf) field to a pointer that is aligned to 16 bytes, and its + * (len) field to something that's a multiple of 16, if possible. + */ +#ifdef __GNUC__ +/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't + pad it out to 88 bytes to guarantee ABI compatibility between compilers. + vvv + The next time we rev the ABI, make sure to size the ints and add padding. +*/ +#define SDL_AUDIOCVT_PACKED __attribute__((packed)) +#else +#define SDL_AUDIOCVT_PACKED +#endif +/* */ +typedef struct SDL_AudioCVT +{ + int needed; /**< Set to 1 if conversion possible */ + SDL_AudioFormat src_format; /**< Source audio format */ + SDL_AudioFormat dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */ + int filter_index; /**< Current audio conversion function */ +} SDL_AUDIOCVT_PACKED SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * \name Driver discovery functions + * + * These functions return the list of built in audio drivers, in the + * order that they are normally initialized by default. + */ +/* @{ */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); +extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +/* @} */ + +/** + * \name Initialization and cleanup + * + * \internal These functions are used internally, and should not be used unless + * you have a specific need to specify the audio driver you want to + * use. You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/* @{ */ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/* @} */ + +/** + * This function returns the name of the current audio driver, or NULL + * if no driver has been initialized. + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by \c obtained. If \c obtained is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * When filling in the desired audio spec structure, + * - \c desired->freq should be the desired audio frequency in samples-per- + * second. + * - \c desired->format should be the desired audio format. + * - \c desired->samples is the desired size of the audio buffer, in + * samples. This number should be a power of two, and may be adjusted by + * the audio driver to a value more suitable for the hardware. Good values + * seem to range between 512 and 8096 inclusive, depending on the + * application and CPU speed. Smaller values yield faster response time, + * but can lead to underflow if the application is doing heavy processing + * and cannot fill the audio buffer in time. A stereo sample consists of + * both right and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: \code ms = (samples*1000)/freq \endcode + * - \c desired->size is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - \c desired->silence is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - \c desired->callback should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL + * pointer here, and call SDL_QueueAudio() with some frequency, to queue + * more audio samples to be played (or for capture devices, call + * SDL_DequeueAudio() with some frequency, to obtain audio samples). + * - \c desired->userdata is passed as the first parameter to your callback + * function. If you passed a NULL callback, this value is ignored. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, + SDL_AudioSpec * obtained); + +/** + * SDL Audio Device IDs. + * + * A successful call to SDL_OpenAudio() is always device id 1, and legacy + * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both + * for backwards compatibility and when you don't care about multiple, + * specific, or capture devices. + */ +typedef Uint32 SDL_AudioDeviceID; + +/** + * Get the number of available devices exposed by the current driver. + * Only valid after a successfully initializing the audio subsystem. + * Returns -1 if an explicit list of devices can't be determined; this is + * not an error. For example, if SDL is set up to talk to a remote audio + * server, it can't list every one available on the Internet, but it will + * still allow a specific host to be specified to SDL_OpenAudioDevice(). + * + * In many common cases, when this function returns a value <= 0, it can still + * successfully open the default device (NULL for first argument of + * SDL_OpenAudioDevice()). + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); + +/** + * Get the human-readable name of a specific audio device. + * Must be a value between 0 and (number of audio devices-1). + * Only valid after a successfully initializing the audio subsystem. + * The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); recall that function to redetect available + * hardware. + * + * The string returned by this function is UTF-8 encoded, read-only, and + * managed internally. You are not to free it. If you need to keep the + * string for any length of time, you should make your own copy of it, as it + * will be invalid next time any of several other SDL functions is called. + */ +extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, + int iscapture); + + +/** + * Open a specific audio device. Passing in a device name of NULL requests + * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). + * + * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but + * some drivers allow arbitrary and driver-specific strings, such as a + * hostname/IP address for a remote audio server, or a filename in the + * diskaudio driver. + * + * \return 0 on error, a valid device ID that is >= 2 on success. + * + * SDL_OpenAudio(), unlike this function, always acts on device ID 1. + */ +extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char + *device, + int iscapture, + const + SDL_AudioSpec * + desired, + SDL_AudioSpec * + obtained, + int + allowed_changes); + + + +/** + * \name Audio state + * + * Get the current audio state. + */ +/* @{ */ +typedef enum +{ + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_AudioStatus; +extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); + +extern DECLSPEC SDL_AudioStatus SDLCALL +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); +/* @} *//* Audio State */ + +/** + * \name Pause audio functions + * + * These functions pause and unpause the audio callback processing. + * They should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +/* @{ */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); +extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, + int pause_on); +/* @} *//* Pause audio functions */ + +/** + * \brief Load the audio data of a WAVE file into memory + * + * Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len + * to be valid pointers. The entire data portion of the file is then loaded + * into memory and decoded if necessary. + * + * If \c freesrc is non-zero, the data source gets automatically closed and + * freed before the function returns. + * + * Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits), + * IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and + * µ-law (8 bits). Other formats are currently unsupported and cause an error. + * + * If this function succeeds, the pointer returned by it is equal to \c spec + * and the pointer to the audio data allocated by the function is written to + * \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec + * members \c freq, \c channels, and \c format are set to the values of the + * audio data in the buffer. The \c samples member is set to a sane default and + * all others are set to zero. + * + * It's necessary to use SDL_FreeWAV() to free the audio data returned in + * \c audio_buf when it is no longer used. + * + * Because of the underspecification of the Waveform format, there are many + * problematic files in the wild that cause issues with strict decoders. To + * provide compatibility with these files, this decoder is lenient in regards + * to the truncation of the file, the fact chunk, and the size of the RIFF + * chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION, + * and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the + * loading process. + * + * Any file that is invalid (due to truncation, corruption, or wrong values in + * the headers), too big, or unsupported causes an error. Additionally, any + * critical I/O error from the data source will terminate the loading process + * with an error. The function returns NULL on error and in all cases (with the + * exception of \c src being NULL), an appropriate error message will be set. + * + * It is required that the data source supports seeking. + * + * Example: + * \code + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + * \endcode + * + * \param src The data source with the WAVE data + * \param freesrc A integer value that makes the function close the data source if non-zero + * \param spec A pointer filled with the audio format of the audio data + * \param audio_buf A pointer filled with the audio data allocated by the function + * \param audio_len A pointer filled with the length of the audio data buffer in bytes + * \return NULL on error, or non-NULL on success. + */ +extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, + int freesrc, + SDL_AudioSpec * spec, + Uint8 ** audio_buf, + Uint32 * audio_len); + +/** + * Loads a WAV from a file. + * Compatibility convenience function. + */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the \c cvt structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. An unsupported format causes an error and -1 will be returned. + * + * \return 0 if no conversion is needed, 1 if the audio filter is set up, + * or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_format, + Uint8 src_channels, + int src_rate, + SDL_AudioFormat dst_format, + Uint8 dst_channels, + int dst_rate); + +/** + * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), + * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * + * The data conversion may expand the size of the audio data, so the buffer + * \c cvt->buf should be allocated after the \c cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. + * + * \return 0 on success or -1 if \c cvt->buf is NULL. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); + +/* SDL_AudioStream is a new audio conversion interface. + The benefits vs SDL_AudioCVT: + - it can handle resampling data in chunks without generating + artifacts, when it doesn't have the complete buffer available. + - it can handle incoming data in any variable size. + - You push data as you have it, and pull it when you need it + */ +/* this is opaque to the outside world. */ +struct _SDL_AudioStream; +typedef struct _SDL_AudioStream SDL_AudioStream; + +/** + * Create a new audio stream + * + * \param src_format The format of the source audio + * \param src_channels The number of channels of the source audio + * \param src_rate The sampling rate of the source audio + * \param dst_format The format of the desired audio output + * \param dst_channels The number of channels of the desired audio output + * \param dst_rate The sampling rate of the desired audio output + * \return 0 on success, or -1 on error. + * + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, + const Uint8 src_channels, + const int src_rate, + const SDL_AudioFormat dst_format, + const Uint8 dst_channels, + const int dst_rate); + +/** + * Add data to be converted/resampled to the stream + * + * \param stream The stream the audio data is being added to + * \param buf A pointer to the audio data to add + * \param len The number of bytes to write to the stream + * \return 0 on success, or -1 on error. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); + +/** + * Get converted/resampled data from the stream + * + * \param stream The stream the audio is being requested from + * \param buf A buffer to fill with audio data + * \param len The maximum number of bytes to fill + * \return The number of bytes read from the stream, or -1 on error + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); + +/** + * Get the number of converted/resampled bytes available. The stream may be + * buffering data behind the scenes until it has enough to resample + * correctly, so this number might be lower than what you expect, or even + * be zero. Add more data or flush the stream if you need the data now. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); + +/** + * Tell the stream that you're done sending data, and anything being buffered + * should be converted/resampled and made available immediately. + * + * It is legal to add more data to a stream after flushing, but there will + * be audio gaps in the output. Generally this is intended to signal the + * end of input, so the complete output becomes available. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); + +/** + * Clear any pending data in the stream without converting it + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); + +/** + * Free an audio stream + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + */ +extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, + Uint32 len, int volume); + +/** + * This works like SDL_MixAudio(), but you specify the audio format instead of + * using the format of audio device 1. Thus it can be used when no audio + * device is open at all. + */ +extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, + const Uint8 * src, + SDL_AudioFormat format, + Uint32 len, int volume); + +/** + * Queue more audio on non-callback devices. + * + * (If you are looking to retrieve queued audio from a non-callback capture + * device, you want SDL_DequeueAudio() instead. This will return -1 to + * signify an error if you use it with capture devices.) + * + * SDL offers two ways to feed audio to the device: you can either supply a + * callback that SDL triggers with some frequency to obtain more audio + * (pull method), or you can supply no callback, and then SDL will expect + * you to supply data at regular intervals (push method) with this function. + * + * There are no limits on the amount of data you can queue, short of + * exhaustion of address space. Queued data will drain to the device as + * necessary without further intervention from you. If the device needs + * audio but there is not enough queued, it will play silence to make up + * the difference. This means you will have skips in your audio playback + * if you aren't routinely queueing sufficient data. + * + * This function copies the supplied data, so you are safe to free it when + * the function returns. This function is thread-safe, but queueing to the + * same device from two threads at once does not promise which buffer will + * be queued first. + * + * You may not queue audio on a device that is using an application-supplied + * callback; doing so returns an error. You have to use the audio callback + * or queue audio with this function, but not both. + * + * You should not call SDL_LockAudio() on the device before queueing; SDL + * handles locking internally for this function. + * + * \param dev The device ID to which we will queue audio. + * \param data The data to queue to the device for later playback. + * \param len The number of bytes (not samples!) to which (data) points. + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetQueuedAudioSize + * \sa SDL_ClearQueuedAudio + */ +extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); + +/** + * Dequeue more audio on non-callback devices. + * + * (If you are looking to queue audio for output on a non-callback playback + * device, you want SDL_QueueAudio() instead. This will always return 0 + * if you use it with playback devices.) + * + * SDL offers two ways to retrieve audio from a capture device: you can + * either supply a callback that SDL triggers with some frequency as the + * device records more audio data, (push method), or you can supply no + * callback, and then SDL will expect you to retrieve data at regular + * intervals (pull method) with this function. + * + * There are no limits on the amount of data you can queue, short of + * exhaustion of address space. Data from the device will keep queuing as + * necessary without further intervention from you. This means you will + * eventually run out of memory if you aren't routinely dequeueing data. + * + * Capture devices will not queue data when paused; if you are expecting + * to not need captured audio for some length of time, use + * SDL_PauseAudioDevice() to stop the capture device from queueing more + * data. This can be useful during, say, level loading times. When + * unpaused, capture devices will start queueing data from that point, + * having flushed any capturable data available while paused. + * + * This function is thread-safe, but dequeueing from the same device from + * two threads at once does not promise which thread will dequeued data + * first. + * + * You may not dequeue audio from a device that is using an + * application-supplied callback; doing so returns an error. You have to use + * the audio callback, or dequeue audio with this function, but not both. + * + * You should not call SDL_LockAudio() on the device before queueing; SDL + * handles locking internally for this function. + * + * \param dev The device ID from which we will dequeue audio. + * \param data A pointer into where audio data should be copied. + * \param len The number of bytes (not samples!) to which (data) points. + * \return number of bytes dequeued, which could be less than requested. + * + * \sa SDL_GetQueuedAudioSize + * \sa SDL_ClearQueuedAudio + */ +extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len); + +/** + * Get the number of bytes of still-queued audio. + * + * For playback device: + * + * This is the number of bytes that have been queued for playback with + * SDL_QueueAudio(), but have not yet been sent to the hardware. This + * number may shrink at any time, so this only informs of pending data. + * + * Once we've sent it to the hardware, this function can not decide the + * exact byte boundary of what has been played. It's possible that we just + * gave the hardware several kilobytes right before you called this + * function, but it hasn't played any of it yet, or maybe half of it, etc. + * + * For capture devices: + * + * This is the number of bytes that have been captured by the device and + * are waiting for you to dequeue. This number may grow at any time, so + * this only informs of the lower-bound of available data. + * + * You may not queue audio on a device that is using an application-supplied + * callback; calling this function on such a device always returns 0. + * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use + * the audio callback, but not both. + * + * You should not call SDL_LockAudio() on the device before querying; SDL + * handles locking internally for this function. + * + * \param dev The device ID of which we will query queued audio size. + * \return Number of bytes (not samples!) of queued audio. + * + * \sa SDL_QueueAudio + * \sa SDL_ClearQueuedAudio + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); + +/** + * Drop any queued audio data. For playback devices, this is any queued data + * still waiting to be submitted to the hardware. For capture devices, this + * is any data that was queued by the device that hasn't yet been dequeued by + * the application. + * + * Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For + * playback devices, the hardware will start playing silence if more audio + * isn't queued. Unpaused capture devices will start filling the queue again + * as soon as they have more data available (which, depending on the state + * of the hardware and the thread, could be before this function call + * returns!). + * + * This will not prevent playback of queued audio that's already been sent + * to the hardware, as we can not undo that, so expect there to be some + * fraction of a second of audio that might still be heard. This can be + * useful if you want to, say, drop any pending music during a level change + * in your game. + * + * You may not queue audio on a device that is using an application-supplied + * callback; calling this function on such a device is always a no-op. + * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use + * the audio callback, but not both. + * + * You should not call SDL_LockAudio() on the device before clearing the + * queue; SDL handles locking internally for this function. + * + * This function always succeeds and thus returns void. + * + * \param dev The device ID of which to clear the audio queue. + * + * \sa SDL_QueueAudio + * \sa SDL_GetQueuedAudioSize + */ +extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); + + +/** + * \name Audio lock functions + * + * The lock manipulated by these functions protects the callback function. + * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that + * the callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/* @{ */ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); +/* @} *//* Audio lock functions */ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); +extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_audio_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_bits.h b/Windows/SDL2/include/SDL2/SDL_bits.h new file mode 100644 index 00000000..db150ed0 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_bits.h @@ -0,0 +1,121 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_bits.h + * + * Functions for fiddling with bits and bitmasks. + */ + +#ifndef SDL_bits_h_ +#define SDL_bits_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_bits.h + */ + +/** + * Get the index of the most significant bit. Result is undefined when called + * with 0. This operation can also be stated as "count leading zeroes" and + * "log base 2". + * + * \return Index of the most significant bit, or -1 if the value is 0. + */ +#if defined(__WATCOMC__) && defined(__386__) +extern _inline int _SDL_clz_watcom (Uint32); +#pragma aux _SDL_clz_watcom = \ + "bsr eax, eax" \ + "xor eax, 31" \ + parm [eax] nomemory \ + value [eax] \ + modify exact [eax] nomemory; +#endif + +SDL_FORCE_INLINE int +SDL_MostSignificantBitIndex32(Uint32 x) +{ +#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) + /* Count Leading Zeroes builtin in GCC. + * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html + */ + if (x == 0) { + return -1; + } + return 31 - __builtin_clz(x); +#elif defined(__WATCOMC__) && defined(__386__) + if (x == 0) { + return -1; + } + return 31 - _SDL_clz_watcom(x); +#else + /* Based off of Bit Twiddling Hacks by Sean Eron Anderson + * <seander@cs.stanford.edu>, released in the public domain. + * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog + */ + const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; + const int S[] = {1, 2, 4, 8, 16}; + + int msbIndex = 0; + int i; + + if (x == 0) { + return -1; + } + + for (i = 4; i >= 0; i--) + { + if (x & b[i]) + { + x >>= S[i]; + msbIndex |= S[i]; + } + } + + return msbIndex; +#endif +} + +SDL_FORCE_INLINE SDL_bool +SDL_HasExactlyOneBitSet32(Uint32 x) +{ + if (x && !(x & (x - 1))) { + return SDL_TRUE; + } + return SDL_FALSE; +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_bits_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_blendmode.h b/Windows/SDL2/include/SDL2/SDL_blendmode.h new file mode 100644 index 00000000..5e21a79e --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_blendmode.h @@ -0,0 +1,123 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_blendmode.h + * + * Header file declaring the SDL_BlendMode enumeration + */ + +#ifndef SDL_blendmode_h_ +#define SDL_blendmode_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< no blending + dstRGBA = srcRGBA */ + SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) */ + SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending + dstRGB = (srcRGB * srcA) + dstRGB + dstA = dstA */ + SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate + dstRGB = srcRGB * dstRGB + dstA = dstA */ + SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply + dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) + dstA = (srcA * dstA) + (dstA * (1-srcA)) */ + SDL_BLENDMODE_INVALID = 0x7FFFFFFF + + /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ + +} SDL_BlendMode; + +/** + * \brief The blend operation used when combining source and destination pixel components + */ +typedef enum +{ + SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */ + SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */ + +} SDL_BlendOperation; + +/** + * \brief The normalized factor used to multiply pixel components + */ +typedef enum +{ + SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ + SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ + SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */ + SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */ + SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */ + SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */ + SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */ + SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */ + SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */ + SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */ + +} SDL_BlendFactor; + +/** + * \brief Create a custom blend mode, which may or may not be supported by a given renderer + * + * \param srcColorFactor source color factor + * \param dstColorFactor destination color factor + * \param colorOperation color operation + * \param srcAlphaFactor source alpha factor + * \param dstAlphaFactor destination alpha factor + * \param alphaOperation alpha operation + * + * The result of the blend mode operation will be: + * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor + * and + * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor + */ +extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, + SDL_BlendFactor dstColorFactor, + SDL_BlendOperation colorOperation, + SDL_BlendFactor srcAlphaFactor, + SDL_BlendFactor dstAlphaFactor, + SDL_BlendOperation alphaOperation); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_blendmode_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_clipboard.h b/Windows/SDL2/include/SDL2/SDL_clipboard.h new file mode 100644 index 00000000..dbf69fce --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_clipboard.h @@ -0,0 +1,71 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_clipboard.h + * + * Include file for SDL clipboard handling + */ + +#ifndef SDL_clipboard_h_ +#define SDL_clipboard_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Put UTF-8 text into the clipboard + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); + +/** + * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() + * + * \sa SDL_SetClipboardText() + */ +extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); + +/** + * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_clipboard_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_config.h b/Windows/SDL2/include/SDL2/SDL_config.h new file mode 100644 index 00000000..3937dbc3 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config.h @@ -0,0 +1,55 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/** + * \file SDL_config.h + */ + +/* Add any platform that doesn't build using the configure system. */ +#if defined(__WIN32__) +#include "SDL_config_windows.h" +#elif defined(__WINRT__) +#include "SDL_config_winrt.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__IPHONEOS__) +#include "SDL_config_iphoneos.h" +#elif defined(__ANDROID__) +#include "SDL_config_android.h" +#elif defined(__PSP__) +#include "SDL_config_psp.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#else +/* This is a minimal configuration just to get SDL running on new platforms. */ +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#ifdef USING_GENERATED_CONFIG_H +#error Wrong SDL_config.h, check your include path? +#endif + +#endif /* SDL_config_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config.h.cmake b/Windows/SDL2/include/SDL2/SDL_config.h.cmake new file mode 100644 index 00000000..d6ea31ea --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config.h.cmake @@ -0,0 +1,493 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_h_ +#define SDL_config_h_ + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C language features */ +#cmakedefine const @HAVE_CONST@ +#cmakedefine inline @HAVE_INLINE@ +#cmakedefine volatile @HAVE_VOLATILE@ + +/* C datatypes */ +/* Define SIZEOF_VOIDP for 64/32 architectures */ +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ +#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ + +/* Comment this if you want to build without any C library requirements */ +#cmakedefine HAVE_LIBC 1 +#if HAVE_LIBC + +/* Useful headers */ +#cmakedefine STDC_HEADERS 1 +#cmakedefine HAVE_ALLOCA_H 1 +#cmakedefine HAVE_CTYPE_H 1 +#cmakedefine HAVE_FLOAT_H 1 +#cmakedefine HAVE_ICONV_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MATH_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_SIGNAL_H 1 +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_STDIO_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_WCHAR_H 1 +#cmakedefine HAVE_PTHREAD_NP_H 1 +#cmakedefine HAVE_LIBUNWIND_H 1 + +/* C library functions */ +#cmakedefine HAVE_MALLOC 1 +#cmakedefine HAVE_CALLOC 1 +#cmakedefine HAVE_REALLOC 1 +#cmakedefine HAVE_FREE 1 +#cmakedefine HAVE_ALLOCA 1 +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#cmakedefine HAVE_GETENV 1 +#cmakedefine HAVE_SETENV 1 +#cmakedefine HAVE_PUTENV 1 +#cmakedefine HAVE_UNSETENV 1 +#endif +#cmakedefine HAVE_QSORT 1 +#cmakedefine HAVE_ABS 1 +#cmakedefine HAVE_BCOPY 1 +#cmakedefine HAVE_MEMSET 1 +#cmakedefine HAVE_MEMCPY 1 +#cmakedefine HAVE_MEMMOVE 1 +#cmakedefine HAVE_MEMCMP 1 +#cmakedefine HAVE_WCSLEN 1 +#cmakedefine HAVE_WCSLCPY 1 +#cmakedefine HAVE_WCSLCAT 1 +#cmakedefine HAVE_WCSDUP 1 +#cmakedefine HAVE_WCSSTR 1 +#cmakedefine HAVE_WCSCMP 1 +#cmakedefine HAVE_WCSNCMP 1 +#cmakedefine HAVE_STRLEN 1 +#cmakedefine HAVE_STRLCPY 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE__STRREV 1 +#cmakedefine HAVE__STRUPR 1 +#cmakedefine HAVE__STRLWR 1 +#cmakedefine HAVE_INDEX 1 +#cmakedefine HAVE_RINDEX 1 +#cmakedefine HAVE_STRCHR 1 +#cmakedefine HAVE_STRRCHR 1 +#cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_STRTOK_S 1 +#cmakedefine HAVE_ITOA 1 +#cmakedefine HAVE__LTOA 1 +#cmakedefine HAVE__UITOA 1 +#cmakedefine HAVE__ULTOA 1 +#cmakedefine HAVE_STRTOL 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE__I64TOA 1 +#cmakedefine HAVE__UI64TOA 1 +#cmakedefine HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STRTOD 1 +#cmakedefine HAVE_ATOI 1 +#cmakedefine HAVE_ATOF 1 +#cmakedefine HAVE_STRCMP 1 +#cmakedefine HAVE_STRNCMP 1 +#cmakedefine HAVE__STRICMP 1 +#cmakedefine HAVE_STRCASECMP 1 +#cmakedefine HAVE__STRNICMP 1 +#cmakedefine HAVE_STRNCASECMP 1 +#cmakedefine HAVE_SSCANF 1 +#cmakedefine HAVE_VSSCANF 1 +#cmakedefine HAVE_VSNPRINTF 1 +#cmakedefine HAVE_M_PI 1 +#cmakedefine HAVE_ACOS 1 +#cmakedefine HAVE_ACOSF 1 +#cmakedefine HAVE_ASIN 1 +#cmakedefine HAVE_ASINF 1 +#cmakedefine HAVE_ATAN 1 +#cmakedefine HAVE_ATANF 1 +#cmakedefine HAVE_ATAN2 1 +#cmakedefine HAVE_ATAN2F 1 +#cmakedefine HAVE_CEIL 1 +#cmakedefine HAVE_CEILF 1 +#cmakedefine HAVE_COPYSIGN 1 +#cmakedefine HAVE_COPYSIGNF 1 +#cmakedefine HAVE_COS 1 +#cmakedefine HAVE_COSF 1 +#cmakedefine HAVE_EXP 1 +#cmakedefine HAVE_EXPF 1 +#cmakedefine HAVE_FABS 1 +#cmakedefine HAVE_FABSF 1 +#cmakedefine HAVE_FLOOR 1 +#cmakedefine HAVE_FLOORF 1 +#cmakedefine HAVE_FMOD 1 +#cmakedefine HAVE_FMODF 1 +#cmakedefine HAVE_LOG 1 +#cmakedefine HAVE_LOGF 1 +#cmakedefine HAVE_LOG10 1 +#cmakedefine HAVE_LOG10F 1 +#cmakedefine HAVE_POW 1 +#cmakedefine HAVE_POWF 1 +#cmakedefine HAVE_SCALBN 1 +#cmakedefine HAVE_SCALBNF 1 +#cmakedefine HAVE_SIN 1 +#cmakedefine HAVE_SINF 1 +#cmakedefine HAVE_SQRT 1 +#cmakedefine HAVE_SQRTF 1 +#cmakedefine HAVE_TAN 1 +#cmakedefine HAVE_TANF 1 +#cmakedefine HAVE_FOPEN64 1 +#cmakedefine HAVE_FSEEKO 1 +#cmakedefine HAVE_FSEEKO64 1 +#cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SA_SIGACTION 1 +#cmakedefine HAVE_SETJMP 1 +#cmakedefine HAVE_NANOSLEEP 1 +#cmakedefine HAVE_SYSCONF 1 +#cmakedefine HAVE_SYSCTLBYNAME 1 +#cmakedefine HAVE_CLOCK_GETTIME 1 +#cmakedefine HAVE_GETPAGESIZE 1 +#cmakedefine HAVE_MPROTECT 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine HAVE_PTHREAD_SETNAME_NP 1 +#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 +#cmakedefine HAVE_SEM_TIMEDWAIT 1 +#cmakedefine HAVE_GETAUXVAL 1 +#cmakedefine HAVE_POLL 1 +#cmakedefine HAVE__EXIT 1 + +#elif __WIN32__ +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_FLOAT_H 1 +#else +/* We may need some replacement for stdarg.h here */ +#include <stdarg.h> +#endif /* HAVE_LIBC */ + +#cmakedefine HAVE_ALTIVEC_H 1 +#cmakedefine HAVE_DBUS_DBUS_H 1 +#cmakedefine HAVE_FCITX_FRONTEND_H 1 +#cmakedefine HAVE_IBUS_IBUS_H 1 +#cmakedefine HAVE_IMMINTRIN_H 1 +#cmakedefine HAVE_LIBSAMPLERATE_H 1 +#cmakedefine HAVE_LIBUDEV_H 1 + +#cmakedefine HAVE_D3D_H @HAVE_D3D_H@ +#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ +#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@ +#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@ +#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@ +#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ +#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ + +#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@ +#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@ + +#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@ +#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@ + +/* SDL internal assertion support */ +#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ + +/* Allow disabling of core subsystems */ +#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@ +#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@ +#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@ +#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@ +#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ +#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ +#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ +#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@ +#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ +#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ +#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@ +#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@ +#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@ +#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@ +#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@ + +/* Enable various audio drivers */ +#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@ +#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ +#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ +#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@ +#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ +#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@ +#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@ +#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ +#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@ +#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ +#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@ +#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ +#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ + +/* Enable various input drivers */ +#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ +#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ +#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ +#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ +#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ +#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ +#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@ +#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ +#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ +#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@ +#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ +#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ +#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ +#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@ +#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ +#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ +#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ +#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ +#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ +#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ +#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@ +#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@ + +/* Enable various sensor drivers */ +#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@ +#cmakedefine SDL_SENSOR_COREMOTION @SDL_SENSOR_COREMOTION@ +#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@ + +/* Enable various shared object loading systems */ +#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ +#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ +#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ +#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ + +/* Enable various threading systems */ +#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ +#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ + +/* Enable various timer systems */ +#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ +#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ +#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ +#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ +#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@ + +/* Enable various video drivers */ +#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ +#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@ +#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@ +#cmakedefine SDL_VIDEO_DRIVER_UIKIT @SDL_VIDEO_DRIVER_UIKIT@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ +#cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@ +#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@ +#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ +#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ +#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ + +#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@ +#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM@ + +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@ + +#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@ +#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@ +#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ + +#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@ +#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@ +#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ +#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ +#cmakedefine SDL_VIDEO_RENDER_METAL @SDL_VIDEO_RENDER_METAL@ + +/* Enable OpenGL support */ +#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ +#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@ +#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@ +#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@ +#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@ +#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@ +#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@ +#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@ + +/* Enable Vulkan support */ +#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@ + +/* Enable Metal support */ +#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@ + +/* Enable system power support */ +#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@ +#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ +#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ +#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ +#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@ +#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ +#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ +#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ + +/* Enable system filesystem support */ +#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@ +#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@ +#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@ +#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@ +#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ +#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ +#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ + +/* Enable assembly routines */ +#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@ +#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@ +#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@ +#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@ + +/* Enable dynamic libsamplerate support */ +#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@ + +/* Platform specific definitions */ +#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@ +#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@ + +#if !defined(__WIN32__) +# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +typedef unsigned int size_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +# endif /* if (stdint.h isn't available) */ +#else /* __WIN32__ */ +# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +# elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +# ifndef _UINTPTR_T_DEFINED +# ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +# else +typedef unsigned int uintptr_t; +# endif +#define _UINTPTR_T_DEFINED +# endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +# endif +# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +# endif +# else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +# ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +# endif +typedef unsigned int uintptr_t; +# endif /* __GNUC__ || _MSC_VER */ +# endif /* !_STDINT_H_ && !HAVE_STDINT_H */ +#endif /* __WIN32__ */ + +#endif /* SDL_config_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config.h.in b/Windows/SDL2/include/SDL2/SDL_config.h.in new file mode 100644 index 00000000..f769e3cf --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config.h.in @@ -0,0 +1,430 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_h_ +#define SDL_config_h_ + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* Make sure that this isn't included by Visual C++ */ +#ifdef _MSC_VER +#error You should run hg revert SDL_config.h +#endif + +/* C language features */ +#undef const +#undef inline +#undef volatile + +/* C datatypes */ +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif +#undef HAVE_GCC_ATOMICS +#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET + +/* Comment this if you want to build without any C library requirements */ +#undef HAVE_LIBC +#if HAVE_LIBC + +/* Useful headers */ +#undef STDC_HEADERS +#undef HAVE_ALLOCA_H +#undef HAVE_CTYPE_H +#undef HAVE_FLOAT_H +#undef HAVE_ICONV_H +#undef HAVE_INTTYPES_H +#undef HAVE_LIMITS_H +#undef HAVE_MALLOC_H +#undef HAVE_MATH_H +#undef HAVE_MEMORY_H +#undef HAVE_SIGNAL_H +#undef HAVE_STDARG_H +#undef HAVE_STDINT_H +#undef HAVE_STDIO_H +#undef HAVE_STDLIB_H +#undef HAVE_STRINGS_H +#undef HAVE_STRING_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_WCHAR_H +#undef HAVE_PTHREAD_NP_H +#undef HAVE_LIBUNWIND_H + +/* C library functions */ +#undef HAVE_MALLOC +#undef HAVE_CALLOC +#undef HAVE_REALLOC +#undef HAVE_FREE +#undef HAVE_ALLOCA +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#undef HAVE_GETENV +#undef HAVE_SETENV +#undef HAVE_PUTENV +#undef HAVE_UNSETENV +#endif +#undef HAVE_QSORT +#undef HAVE_ABS +#undef HAVE_BCOPY +#undef HAVE_MEMSET +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMCMP +#undef HAVE_WCSLEN +#undef HAVE_WCSLCPY +#undef HAVE_WCSLCAT +#undef HAVE_WCSDUP +#undef HAVE_WCSSTR +#undef HAVE_WCSCMP +#undef HAVE_WCSNCMP +#undef HAVE_STRLEN +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#undef HAVE__STRREV +#undef HAVE__STRUPR +#undef HAVE__STRLWR +#undef HAVE_INDEX +#undef HAVE_RINDEX +#undef HAVE_STRCHR +#undef HAVE_STRRCHR +#undef HAVE_STRSTR +#undef HAVE_STRTOK_R +#undef HAVE_STRTOK_S +#undef HAVE_ITOA +#undef HAVE__LTOA +#undef HAVE__UITOA +#undef HAVE__ULTOA +#undef HAVE_STRTOL +#undef HAVE_STRTOUL +#undef HAVE__I64TOA +#undef HAVE__UI64TOA +#undef HAVE_STRTOLL +#undef HAVE_STRTOULL +#undef HAVE_STRTOD +#undef HAVE_ATOI +#undef HAVE_ATOF +#undef HAVE_STRCMP +#undef HAVE_STRNCMP +#undef HAVE__STRICMP +#undef HAVE_STRCASECMP +#undef HAVE__STRNICMP +#undef HAVE_STRNCASECMP +#undef HAVE_SSCANF +#undef HAVE_VSSCANF +#undef HAVE_SNPRINTF +#undef HAVE_VSNPRINTF +#undef HAVE_M_PI +#undef HAVE_ACOS +#undef HAVE_ACOSF +#undef HAVE_ASIN +#undef HAVE_ASINF +#undef HAVE_ATAN +#undef HAVE_ATANF +#undef HAVE_ATAN2 +#undef HAVE_ATAN2F +#undef HAVE_CEIL +#undef HAVE_CEILF +#undef HAVE_COPYSIGN +#undef HAVE_COPYSIGNF +#undef HAVE_COS +#undef HAVE_COSF +#undef HAVE_EXP +#undef HAVE_EXPF +#undef HAVE_FABS +#undef HAVE_FABSF +#undef HAVE_FLOOR +#undef HAVE_FLOORF +#undef HAVE_FMOD +#undef HAVE_FMODF +#undef HAVE_LOG +#undef HAVE_LOGF +#undef HAVE_LOG10 +#undef HAVE_LOG10F +#undef HAVE_POW +#undef HAVE_POWF +#undef HAVE_SCALBN +#undef HAVE_SCALBNF +#undef HAVE_SIN +#undef HAVE_SINF +#undef HAVE_SQRT +#undef HAVE_SQRTF +#undef HAVE_TAN +#undef HAVE_TANF +#undef HAVE_FOPEN64 +#undef HAVE_FSEEKO +#undef HAVE_FSEEKO64 +#undef HAVE_SIGACTION +#undef HAVE_SA_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_SYSCONF +#undef HAVE_SYSCTLBYNAME +#undef HAVE_CLOCK_GETTIME +#undef HAVE_GETPAGESIZE +#undef HAVE_MPROTECT +#undef HAVE_ICONV +#undef HAVE_PTHREAD_SETNAME_NP +#undef HAVE_PTHREAD_SET_NAME_NP +#undef HAVE_SEM_TIMEDWAIT +#undef HAVE_GETAUXVAL +#undef HAVE_POLL +#undef HAVE__EXIT + +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#endif /* HAVE_LIBC */ + +#undef HAVE_ALTIVEC_H +#undef HAVE_DBUS_DBUS_H +#undef HAVE_FCITX_FRONTEND_H +#undef HAVE_IBUS_IBUS_H +#undef HAVE_IMMINTRIN_H +#undef HAVE_LIBSAMPLERATE_H +#undef HAVE_LIBUDEV_H + +#undef HAVE_DDRAW_H +#undef HAVE_DINPUT_H +#undef HAVE_DSOUND_H +#undef HAVE_DXGI_H +#undef HAVE_XINPUT_H +#undef HAVE_MMDEVICEAPI_H +#undef HAVE_AUDIOCLIENT_H +#undef HAVE_XINPUT_GAMEPAD_EX +#undef HAVE_XINPUT_STATE_EX + +/* SDL internal assertion support */ +#undef SDL_DEFAULT_ASSERT_LEVEL + +/* Allow disabling of core subsystems */ +#undef SDL_ATOMIC_DISABLED +#undef SDL_AUDIO_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_HAPTIC_DISABLED +#undef SDL_SENSOR_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_RENDER_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED +#undef SDL_POWER_DISABLED +#undef SDL_FILESYSTEM_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ANDROID +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_DUMMY +#undef SDL_AUDIO_DRIVER_EMSCRIPTEN +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_FUSIONSOUND +#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC +#undef SDL_AUDIO_DRIVER_HAIKU +#undef SDL_AUDIO_DRIVER_JACK +#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC +#undef SDL_AUDIO_DRIVER_NACL +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_NETBSD +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +#undef SDL_AUDIO_DRIVER_PAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_QSA +#undef SDL_AUDIO_DRIVER_SNDIO +#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WASAPI +#undef SDL_AUDIO_DRIVER_WINMM + +/* Enable various input drivers */ +#undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_LINUXKD +#undef SDL_INPUT_TSLIB +#undef SDL_JOYSTICK_HAIKU +#undef SDL_JOYSTICK_DINPUT +#undef SDL_JOYSTICK_XINPUT +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_ANDROID +#undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_USBHID +#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_JOYSTICK_HIDAPI +#undef SDL_JOYSTICK_EMSCRIPTEN +#undef SDL_HAPTIC_DUMMY +#undef SDL_HAPTIC_ANDROID +#undef SDL_HAPTIC_LINUX +#undef SDL_HAPTIC_IOKIT +#undef SDL_HAPTIC_DINPUT +#undef SDL_HAPTIC_XINPUT + +/* Enable various sensor drivers */ +#undef SDL_SENSOR_ANDROID +#undef SDL_SENSOR_DUMMY + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_DUMMY +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_WINDOWS + +/* Enable various threading systems */ +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_WINDOWS + +/* Enable various timer systems */ +#undef SDL_TIMER_HAIKU +#undef SDL_TIMER_DUMMY +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WINDOWS + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_HAIKU +#undef SDL_VIDEO_DRIVER_COCOA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_WINDOWS +#undef SDL_VIDEO_DRIVER_WAYLAND +#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_RPI +#undef SDL_VIDEO_DRIVER_KMSDRM +#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC +#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM +#undef SDL_VIDEO_DRIVER_ANDROID +#undef SDL_VIDEO_DRIVER_EMSCRIPTEN +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE +#undef SDL_VIDEO_DRIVER_X11_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_XDBE +#undef SDL_VIDEO_DRIVER_X11_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#undef SDL_VIDEO_DRIVER_X11_XRANDR +#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#undef SDL_VIDEO_DRIVER_X11_XSHAPE +#undef SDL_VIDEO_DRIVER_X11_XVIDMODE +#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS +#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY +#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#undef SDL_VIDEO_DRIVER_NACL +#undef SDL_VIDEO_DRIVER_VIVANTE +#undef SDL_VIDEO_DRIVER_VIVANTE_VDK +#undef SDL_VIDEO_DRIVER_QNX + +#undef SDL_VIDEO_RENDER_D3D +#undef SDL_VIDEO_RENDER_D3D11 +#undef SDL_VIDEO_RENDER_OGL +#undef SDL_VIDEO_RENDER_OGL_ES +#undef SDL_VIDEO_RENDER_OGL_ES2 +#undef SDL_VIDEO_RENDER_DIRECTFB +#undef SDL_VIDEO_RENDER_METAL + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_ES +#undef SDL_VIDEO_OPENGL_ES2 +#undef SDL_VIDEO_OPENGL_BGL +#undef SDL_VIDEO_OPENGL_CGL +#undef SDL_VIDEO_OPENGL_EGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Enable Vulkan support */ +#undef SDL_VIDEO_VULKAN + +/* Enable Metal support */ +#undef SDL_VIDEO_METAL + +/* Enable system power support */ +#undef SDL_POWER_LINUX +#undef SDL_POWER_WINDOWS +#undef SDL_POWER_MACOSX +#undef SDL_POWER_HAIKU +#undef SDL_POWER_ANDROID +#undef SDL_POWER_EMSCRIPTEN +#undef SDL_POWER_HARDWIRED + +/* Enable system filesystem support */ +#undef SDL_FILESYSTEM_HAIKU +#undef SDL_FILESYSTEM_COCOA +#undef SDL_FILESYSTEM_DUMMY +#undef SDL_FILESYSTEM_UNIX +#undef SDL_FILESYSTEM_WINDOWS +#undef SDL_FILESYSTEM_NACL +#undef SDL_FILESYSTEM_ANDROID +#undef SDL_FILESYSTEM_EMSCRIPTEN + +/* Enable assembly routines */ +#undef SDL_ASSEMBLY_ROUTINES +#undef SDL_ALTIVEC_BLITTERS +#undef SDL_ARM_SIMD_BLITTERS +#undef SDL_ARM_NEON_BLITTERS + +/* Enable ime support */ +#undef SDL_USE_IME + +/* Enable dynamic udev support */ +#undef SDL_UDEV_DYNAMIC + +/* Enable dynamic libusb support */ +#undef SDL_LIBUSB_DYNAMIC + +/* Enable dynamic libsamplerate support */ +#undef SDL_LIBSAMPLERATE_DYNAMIC + +#endif /* SDL_config_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_android.h b/Windows/SDL2/include/SDL2/SDL_config_android.h new file mode 100644 index 00000000..d057e176 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_android.h @@ -0,0 +1,179 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_android_h_ +#define SDL_config_android_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/** + * \file SDL_config_android.h + * + * This is a configuration that can be used to build SDL for Android + */ + +#include <stdarg.h> + +#define HAVE_GCC_ATOMICS 1 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_CLOCK_GETTIME 1 + +#define SIZEOF_VOIDP 4 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_ANDROID 1 +#define SDL_AUDIO_DRIVER_OPENSLES 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_ANDROID 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_HAPTIC_ANDROID 1 + +/* Enable sensor driver */ +#define SDL_SENSOR_ANDROID 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_ANDROID 1 + +/* Enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_OPENGL_ES2 1 +#define SDL_VIDEO_OPENGL_EGL 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable Vulkan support */ +/* Android does not support Vulkan in native code using the "armeabi" ABI. */ +#if defined(__ARM_ARCH) && __ARM_ARCH < 7 +#define SDL_VIDEO_VULKAN 0 +#else +#define SDL_VIDEO_VULKAN 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_ANDROID 1 + +/* Enable the filesystem driver */ +#define SDL_FILESYSTEM_ANDROID 1 + +#endif /* SDL_config_android_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_iphoneos.h b/Windows/SDL2/include/SDL2/SDL_config_iphoneos.h new file mode 100644 index 00000000..38929a8b --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_iphoneos.h @@ -0,0 +1,206 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_iphoneos_h_ +#define SDL_config_iphoneos_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +/* The libunwind functions are only available on x86 */ +/* #undef HAVE_LIBUNWIND_H */ + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 + +/* enable iPhone version of Core Audio driver */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DUMMY 1 + +/* Enable MFi joystick support */ +#define SDL_JOYSTICK_MFI 1 +#define SDL_JOYSTICK_HIDAPI 1 + +#ifdef __TVOS__ +#define SDL_SENSOR_DUMMY 1 +#else +/* Enable the CoreMotion sensor driver */ +#define SDL_SENSOR_COREMOTION 1 +#endif + +/* Enable Unix style SO loading */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Supported video drivers */ +#define SDL_VIDEO_DRIVER_UIKIT 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES2 1 +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer */ +#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)) +#define SDL_PLATFORM_SUPPORTS_METAL 1 +#else +#define SDL_PLATFORM_SUPPORTS_METAL 0 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_RENDER_METAL 1 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_VULKAN 1 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_METAL 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_UIKIT 1 + +/* enable iPhone keyboard support */ +#define SDL_IPHONE_KEYBOARD 1 + +/* enable iOS extended launch screen */ +#define SDL_IPHONE_LAUNCHSCREEN 1 + +/* Set max recognized G-force from accelerometer + See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed + */ +#define SDL_IPHONE_MAX_GFORCE 5.0 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +#endif /* SDL_config_iphoneos_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_macosx.h b/Windows/SDL2/include/SDL2/SDL_config_macosx.h new file mode 100644 index 00000000..11413459 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_macosx.h @@ -0,0 +1,258 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_macosx_h_ +#define SDL_config_macosx_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include <AvailabilityMacros.h> + +/* This is a set of defines to configure the SDL features */ + +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif + +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_LIBUNWIND_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 + +#define HAVE_GCC_ATOMICS 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_HAPTIC_IOKIT 1 + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_COCOA 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#undef SDL_VIDEO_DRIVER_X11 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 +#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 + +#ifdef MAC_OS_X_VERSION_10_8 +/* + * No matter the versions targeted, this is the 10.8 or later SDK, so you have + * to use the external Xquartz, which is a more modern Xlib. Previous SDKs + * used an older Xlib. + */ +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 +#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Metal only supported on 64-bit architectures with 10.11+ */ +#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) +#define SDL_PLATFORM_SUPPORTS_METAL 1 +#else +#define SDL_PLATFORM_SUPPORTS_METAL 0 +#endif + +#ifndef SDL_VIDEO_RENDER_METAL +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_RENDER_METAL 1 +#else +#define SDL_VIDEO_RENDER_METAL 0 +#endif +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_CGL +#define SDL_VIDEO_OPENGL_CGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_GLX +#define SDL_VIDEO_OPENGL_GLX 1 +#endif + +/* Enable Vulkan and Metal support */ +#ifndef SDL_VIDEO_VULKAN +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_VULKAN 1 +#else +#define SDL_VIDEO_VULKAN 0 +#endif +#endif + +#ifndef SDL_VIDEO_METAL +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_METAL 1 +#else +#define SDL_VIDEO_METAL 0 +#endif +#endif + +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* SDL_config_macosx_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_minimal.h b/Windows/SDL2/include/SDL2/SDL_config_minimal.h new file mode 100644 index 00000000..b9c39584 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_minimal.h @@ -0,0 +1,85 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_minimal_h_ +#define SDL_config_minimal_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/** + * \file SDL_config_minimal.h + * + * This is the minimal configuration that can be used to build SDL. + */ + +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + +/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +/* Here are some reasonable defaults */ +typedef unsigned int size_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +#else +#define HAVE_STDINT_H 1 +#endif /* Visual Studio 2008 */ + +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ +#define SDL_SENSOR_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ +#define SDL_FILESYSTEM_DUMMY 1 + +#endif /* SDL_config_minimal_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_os2.h b/Windows/SDL2/include/SDL2/SDL_config_os2.h new file mode 100644 index 00000000..f5799dce --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_os2.h @@ -0,0 +1,180 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_os2_h_ +#define SDL_config_os2_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_DISK 1 + +#define SDL_POWER_DISABLED 1 +#define SDL_JOYSTICK_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 +/*#undef SDL_JOYSTICK_HIDAPI */ + +#define SDL_SENSOR_DUMMY 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL support */ +/* #undef SDL_VIDEO_OPENGL */ + +/* Enable Vulkan support */ +/* #undef SDL_VIDEO_VULKAN */ + +#define SDL_LOADSO_DISABLED 1 +#define SDL_THREADS_DISABLED 1 +#define SDL_TIMERS_DISABLED 1 +#define SDL_FILESYSTEM_DUMMY 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 + +/* #undef HAVE_LIBSAMPLERATE_H */ + +/* Enable dynamic libsamplerate support */ +/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ + +#define HAVE_LIBC 1 + +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_WCHAR_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_SIGNAL_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#if defined(__WATCOMC__) +#define HAVE__FSEEKI64 1 +#define HAVE__FTELLI64 1 +#endif +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSLCPY 1 +#define HAVE_WCSLCAT 1 +#define HAVE_WCSCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE__I64TOA 1 +#define HAVE__UI64TOA 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSLCPY 1 +#define HAVE_WCSLCAT 1 +/* #define HAVE_WCSDUP 1 */ +/* #define wcsdup _wcsdup */ +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_VSSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 +#define HAVE_ACOS 1 +/* #undef HAVE_ACOSF */ +#define HAVE_ASIN 1 +/* #undef HAVE_ASINF */ +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +/* #undef HAVE_ATAN2F */ +#define HAVE_CEIL 1 +/* #undef HAVE_CEILF */ +/* #undef HAVE_COPYSIGN */ +/* #undef HAVE_COPYSIGNF */ +#define HAVE_COS 1 +/* #undef HAVE_COSF */ +#define HAVE_EXP 1 +/* #undef HAVE_EXPF */ +#define HAVE_FABS 1 +/* #undef HAVE_FABSF */ +#define HAVE_FLOOR 1 +/* #undef HAVE_FLOORF */ +#define HAVE_FMOD 1 +/* #undef HAVE_FMODF */ +#define HAVE_LOG 1 +/* #undef HAVE_LOGF */ +#define HAVE_LOG10 1 +/* #undef HAVE_LOG10F */ +#define HAVE_POW 1 +/* #undef HAVE_POWF */ +#define HAVE_SIN 1 +/* #undef HAVE_SINF */ +/* #undef HAVE_SCALBN */ +/* #undef HAVE_SCALBNF */ +#define HAVE_SQRT 1 +/* #undef HAVE_SQRTF */ +#define HAVE_TAN 1 +/* #undef HAVE_TANF */ + +#endif /* SDL_config_os2_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_pandora.h b/Windows/SDL2/include/SDL2/SDL_config_pandora.h new file mode 100644 index 00000000..bdc64c97 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_pandora.h @@ -0,0 +1,133 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_pandora_h_ +#define SDL_config_pandora_h_ +#define SDL_config_h_ + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define SDL_BYTEORDER 1234 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MATH_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_INPUT_TSLIB 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_SENSOR_DUMMY 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 +#define SDL_FILESYSTEM_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* SDL_config_pandora_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_psp.h b/Windows/SDL2/include/SDL2/SDL_config_psp.h new file mode 100644 index 00000000..0cbb182e --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_psp.h @@ -0,0 +1,164 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_psp_h_ +#define SDL_config_psp_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + + + +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +/* #define HAVE_SYSCONF 1 */ +/* #define HAVE_SIGACTION 1 */ + + +/* PSP isn't that sophisticated */ +#define LACKS_SYS_MMAN_H 1 + +/* Enable the PSP thread support (src/thread/psp/\*.c) */ +#define SDL_THREAD_PSP 1 + +/* Enable the PSP timer support (src/timer/psp/\*.c) */ +#define SDL_TIMERS_PSP 1 + +/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ +#define SDL_JOYSTICK_PSP 1 + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable the PSP audio driver (src/audio/psp/\*.c) */ +#define SDL_AUDIO_DRIVER_PSP 1 + +/* PSP video driver */ +#define SDL_VIDEO_DRIVER_PSP 1 + +/* PSP render driver */ +#define SDL_VIDEO_RENDER_PSP 1 + +#define SDL_POWER_PSP 1 + +/* !!! FIXME: what does PSP do for filesystem stuff? */ +#define SDL_FILESYSTEM_DUMMY 1 + +/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* PSP can't load shared object (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + + +#endif /* SDL_config_psp_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_windows.h b/Windows/SDL2/include/SDL2/SDL_config_windows.h new file mode 100644 index 00000000..f269bfc0 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_windows.h @@ -0,0 +1,260 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_windows_h_ +#define SDL_config_windows_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +#define HAVE_DDRAW_H 1 +#define HAVE_DINPUT_H 1 +#define HAVE_DSOUND_H 1 +#define HAVE_DXGI_H 1 +#define HAVE_XINPUT_H 1 +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__STRUPR */ +/* #undef HAVE__STRLWR */ +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +#if defined(_MSC_VER) +#define HAVE_STRTOK_S 1 +#endif +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEILF 1 +#define HAVE__COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#if defined(_MSC_VER) +/* These functions were added with the VC++ 2013 C runtime library */ +#if _MSC_VER >= 1800 +#define HAVE_STRTOLL 1 +#define HAVE_VSSCANF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#endif +/* This function is available with at least the VC++ 2008 C runtime library */ +#if _MSC_VER >= 1400 +#define HAVE__FSEEKI64 1 +#endif +#endif +#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_WASAPI 1 +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_JOYSTICK_XINPUT 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_HAPTIC_DINPUT 1 +#define SDL_HAPTIC_XINPUT 1 + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 1 +#endif +#ifndef SDL_VIDEO_RENDER_D3D11 +#define SDL_VIDEO_RENDER_D3D11 0 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif + +/* Enable Vulkan support */ +#define SDL_VIDEO_VULKAN 1 + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable filesystem support */ +#define SDL_FILESYSTEM_WINDOWS 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* SDL_config_windows_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_winrt.h b/Windows/SDL2/include/SDL2/SDL_config_winrt.h new file mode 100644 index 00000000..fa03389e --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_winrt.h @@ -0,0 +1,240 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_winrt_h_ +#define SDL_config_winrt_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used + by SDL to determine which version of the Windows SDK is being used. +*/ +#include <sdkddkver.h> + +/* Define possibly-undefined NTDDI values (used when compiling SDL against + older versions of the Windows SDK. +*/ +#ifndef NTDDI_WINBLUE +#define NTDDI_WINBLUE 0x06030000 +#endif +#ifndef NTDDI_WIN10 +#define NTDDI_WIN10 0x0A000000 +#endif + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +/* Useful headers */ +#define HAVE_DXGI_H 1 +#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP +#define HAVE_XINPUT_H 1 +#endif + +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 + +#define HAVE_LIBC 1 +#define STDC_HEADERS 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_S 1 +//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead +//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead +//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +//#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_VSNPRINTF 1 +//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE__COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE__SCALB 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE__FSEEKI64 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_WASAPI 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#define SDL_JOYSTICK_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 +#else +#define SDL_JOYSTICK_XINPUT 1 +#define SDL_HAPTIC_XINPUT 1 +#endif + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#if (NTDDI_VERSION >= NTDDI_WINBLUE) +#define SDL_THREAD_WINDOWS 1 +#else +/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ +#define SDL_THREAD_STDCPP 1 +#endif + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_WINRT 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ +#define SDL_VIDEO_OPENGL_ES2 1 +#define SDL_VIDEO_OPENGL_EGL 1 + +/* Enable appropriate renderer(s) */ +#define SDL_VIDEO_RENDER_D3D11 1 + +#if SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_WINRT 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* SDL_config_winrt_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_config_wiz.h b/Windows/SDL2/include/SDL2/SDL_config_wiz.h new file mode 100644 index 00000000..92b1771e --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_config_wiz.h @@ -0,0 +1,147 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_wiz_h_ +#define SDL_config_wiz_h_ +#define SDL_config_h_ + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#define SDL_BYTEORDER 1234 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MATH_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_POW 1 + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_INPUT_TSLIB 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_SENSOR_DUMMY 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* SDL_config_wiz_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_copying.h b/Windows/SDL2/include/SDL2/SDL_copying.h new file mode 100644 index 00000000..4f8a2bcd --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_copying.h @@ -0,0 +1,20 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ diff --git a/Windows/SDL2/include/SDL2/SDL_cpuinfo.h b/Windows/SDL2/include/SDL2/SDL_cpuinfo.h new file mode 100644 index 00000000..0d9b8213 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_cpuinfo.h @@ -0,0 +1,275 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_cpuinfo.h + * + * CPU feature detection for SDL. + */ + +#ifndef SDL_cpuinfo_h_ +#define SDL_cpuinfo_h_ + +#include "SDL_stdinc.h" + +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) +#ifdef __clang__ +/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */ +#undef __MMX__ +#undef __SSE__ +#undef __SSE2__ +#else +#include <intrin.h> +#ifndef _WIN64 +#ifndef __MMX__ +#define __MMX__ +#endif +#ifndef __3dNOW__ +#define __3dNOW__ +#endif +#endif +#ifndef __SSE__ +#define __SSE__ +#endif +#ifndef __SSE2__ +#define __SSE2__ +#endif +#endif /* __clang__ */ +#elif defined(__MINGW64_VERSION_MAJOR) +#include <intrin.h> +#else +/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */ +#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H) +#include <altivec.h> +#endif +#if !defined(SDL_DISABLE_ARM_NEON_H) +# if defined(__ARM_NEON) +# include <arm_neon.h> +# elif defined(__WINDOWS__) || defined(__WINRT__) +/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */ +# if defined(_M_ARM) +# include <armintr.h> +# include <arm_neon.h> +# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ +# endif +# if defined (_M_ARM64) +# include <arm64intr.h> +# include <arm64_neon.h> +# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ +# endif +# endif +#endif +#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H) +#include <mm3dnow.h> +#endif +#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) +#include <immintrin.h> +#else +#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H) +#include <mmintrin.h> +#endif +#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H) +#include <xmmintrin.h> +#endif +#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H) +#include <emmintrin.h> +#endif +#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H) +#include <pmmintrin.h> +#endif +#endif /* HAVE_IMMINTRIN_H */ +#endif /* compiler version */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* This is a guess for the cacheline size used for padding. + * Most x86 processors have a 64 byte cache line. + * The 64-bit PowerPC processors have a 128 byte cache line. + * We'll use the larger value to be generally safe. + */ +#define SDL_CACHELINE_SIZE 128 + +/** + * This function returns the number of CPU cores available. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); + +/** + * This function returns the L1 cache line size of the CPU + * + * This is useful for determining multi-threaded structure padding + * or SIMD prefetch sizes. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); + +/** + * This function returns true if the CPU has the RDTSC instruction. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** + * This function returns true if the CPU has AltiVec features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/** + * This function returns true if the CPU has MMX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** + * This function returns true if the CPU has 3DNow! features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** + * This function returns true if the CPU has SSE features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** + * This function returns true if the CPU has SSE2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** + * This function returns true if the CPU has SSE3 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); + +/** + * This function returns true if the CPU has SSE4.1 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); + +/** + * This function returns true if the CPU has SSE4.2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); + +/** + * This function returns true if the CPU has AVX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); + +/** + * This function returns true if the CPU has AVX2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); + +/** + * This function returns true if the CPU has AVX-512F (foundation) features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); + +/** + * This function returns true if the CPU has ARM SIMD (ARMv6) features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); + +/** + * This function returns true if the CPU has NEON (ARM SIMD) features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); + +/** + * This function returns the amount of RAM configured in the system, in MB. + */ +extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); + +/** + * \brief Report the alignment this system needs for SIMD allocations. + * + * This will return the minimum number of bytes to which a pointer must be + * aligned to be compatible with SIMD instructions on the current machine. + * For example, if the machine supports SSE only, it will return 16, but if + * it supports AVX-512F, it'll return 64 (etc). This only reports values for + * instruction sets SDL knows about, so if your SDL build doesn't have + * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and + * not 64 for the AVX-512 instructions that exist but SDL doesn't know about. + * Plan accordingly. + */ +extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); + +/** + * \brief Allocate memory in a SIMD-friendly way. + * + * This will allocate a block of memory that is suitable for use with SIMD + * instructions. Specifically, it will be properly aligned and padded for + * the system's supported vector instructions. + * + * The memory returned will be padded such that it is safe to read or write + * an incomplete vector at the end of the memory block. This can be useful + * so you don't have to drop back to a scalar fallback at the end of your + * SIMD processing loop to deal with the final elements without overflowing + * the allocated buffer. + * + * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() + * or delete[], etc. + * + * Note that SDL will only deal with SIMD instruction sets it is aware of; + * for example, SDL 2.0.8 knows that SSE wants 16-byte vectors + * (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't + * know that AVX-512 wants 64. To be clear: if you can't decide to use an + * instruction set with an SDL_Has*() function, don't use that instruction + * set with memory allocated through here. + * + * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't + * out of memory. + * + * \param len The length, in bytes, of the block to allocated. The actual + * allocated block might be larger due to padding, etc. + * \return Pointer to newly-allocated block, NULL if out of memory. + * + * \sa SDL_SIMDAlignment + * \sa SDL_SIMDFree + */ +extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); + +/** + * \brief Deallocate memory obtained from SDL_SIMDAlloc + * + * It is not valid to use this function on a pointer from anything but + * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, + * SDL_malloc, memalign, new[], etc. + * + * However, SDL_SIMDFree(NULL) is a legal no-op. + * + * \sa SDL_SIMDAlloc + */ +extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); + +/* vi: set ts=4 sw=4 expandtab: */ +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_cpuinfo_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_egl.h b/Windows/SDL2/include/SDL2/SDL_egl.h new file mode 100644 index 00000000..531441e6 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_egl.h @@ -0,0 +1,1676 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_egl.h + * + * This is a simple file to encapsulate the EGL API headers. + */ +#if !defined(_MSC_VER) && !defined(__ANDROID__) + +#include <EGL/egl.h> +#include <EGL/eglext.h> + +#else /* _MSC_VER */ + +/* EGL headers for Visual Studio */ + +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. +* +* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ +* +* Adopters may modify this file to suit their platform. Adopters are +* encouraged to submit platform specific modifications to the Khronos +* group so that they can be included in future versions of this file. +* Please submit changes by sending them to the public Khronos Bugzilla +* (http://khronos.org/bugzilla) by filing a bug against product +* "Khronos (general)" component "Registry". +* +* A predefined template which fills in some of the bug fields can be +* reached using http://tinyurl.com/khrplatform-h-bugreport, but you +* must create a Bugzilla login first. +* +* +* See the Implementer's Guidelines for information about where this file +* should be located on your system and for more details of its use: +* http://www.khronos.org/registry/implementers_guide.pdf +* +* This file should be included as +* #include <KHR/khrplatform.h> +* by Khronos client API header files that use its types and defines. +* +* The types in khrplatform.h should only be used to define API-specific types. +* +* Types defined in khrplatform.h: +* khronos_int8_t signed 8 bit +* khronos_uint8_t unsigned 8 bit +* khronos_int16_t signed 16 bit +* khronos_uint16_t unsigned 16 bit +* khronos_int32_t signed 32 bit +* khronos_uint32_t unsigned 32 bit +* khronos_int64_t signed 64 bit +* khronos_uint64_t unsigned 64 bit +* khronos_intptr_t signed same number of bits as a pointer +* khronos_uintptr_t unsigned same number of bits as a pointer +* khronos_ssize_t signed size +* khronos_usize_t unsigned size +* khronos_float_t signed 32 bit floating point +* khronos_time_ns_t unsigned 64 bit time in nanoseconds +* khronos_utime_nanoseconds_t unsigned time interval or absolute time in +* nanoseconds +* khronos_stime_nanoseconds_t signed time interval in nanoseconds +* khronos_boolean_enum_t enumerated boolean type. This should +* only be used as a base type when a client API's boolean type is +* an enum. Client APIs which use an integer or other type for +* booleans cannot use this as the base type for their boolean. +* +* Tokens defined in khrplatform.h: +* +* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. +* +* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. +* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. +* +* Calling convention macros defined in this file: +* KHRONOS_APICALL +* KHRONOS_APIENTRY +* KHRONOS_APIATTRIBUTES +* +* These may be used in function prototypes as: +* +* KHRONOS_APICALL void KHRONOS_APIENTRY funcname( +* int arg1, +* int arg2) KHRONOS_APIATTRIBUTES; +*/ + +/*------------------------------------------------------------------------- +* Definition of KHRONOS_APICALL +*------------------------------------------------------------------------- +* This precedes the return type of the function in the function prototype. +*/ +#if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(SDL_VIDEO_STATIC_ANGLE) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- +* Definition of KHRONOS_APIENTRY +*------------------------------------------------------------------------- +* This follows the return type of the function and precedes the function +* name in the function prototype. +*/ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) +/* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- +* Definition of KHRONOS_APIATTRIBUTES +*------------------------------------------------------------------------- +* This follows the closing parenthesis of the function prototype arguments. +*/ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- +* basic type definitions +*-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* +* Using <stdint.h> +*/ +#include <stdint.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* +* Using <inttypes.h> +*/ +#include <inttypes.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* +* Win32 +*/ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* +* Sun or Digital +*/ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* +* Hypothetical platform with no float or int64 support +*/ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* +* Generic fallback +*/ +#include <stdint.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* +* Types that are (so far) the same on all platforms +*/ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* +* Types that differ between LLP64 and LP64 architectures - in LLP64, +* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears +* to be the only LLP64 architecture in current use. +*/ +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* +* Float type +*/ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types +* +* These types can be used to represent a time interval in nanoseconds or +* an absolute Unadjusted System Time. Unadjusted System Time is the number +* of nanoseconds since some arbitrary system event (e.g. since the last +* time the system booted). The Unadjusted System Time is an unsigned +* 64 bit value that wraps back to 0 every 584 years. Time intervals +* may be either signed or unsigned. +*/ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* +* Dummy value used to pad enum types to 32 bits. +*/ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* +* Enumerated boolean type +* +* Values other than zero should be considered to be true. Therefore +* comparisons should not be made against KHRONOS_TRUE. +*/ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ + + +#ifndef __eglplatform_h_ +#define __eglplatform_h_ + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Platform-specific types and definitions for egl.h +* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ +* +* Adopters may modify khrplatform.h and this file to suit their platform. +* You are encouraged to submit all modifications to the Khronos group so that +* they can be included in future versions of this file. Please submit changes +* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) +* by filing a bug against product "EGL" component "Registry". +*/ + +/*#include <KHR/khrplatform.h>*/ + +/* Macros used in EGL function prototype declarations. +* +* EGL functions should be prototyped as: +* +* EGLAPI return-type EGLAPIENTRY eglFunction(arguments); +* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); +* +* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h +*/ + +#ifndef EGLAPI +#define EGLAPI KHRONOS_APICALL +#endif + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY KHRONOS_APIENTRY +#endif +#define EGLAPIENTRYP EGLAPIENTRY* + +/* The types NativeDisplayType, NativeWindowType, and NativePixmapType +* are aliases of window-system-dependent types, such as X Display * or +* Windows Device Context. They must be defined in platform-specific +* code below. The EGL-prefixed versions of Native*Type are the same +* types, renamed in EGL 1.3 so all types in the API start with "EGL". +* +* Khronos STRONGLY RECOMMENDS that you use the default definitions +* provided below, since these changes affect both binary and source +* portability of applications using EGL running on different EGL +* implementations. +*/ + +#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX /* don't define min() and max(). */ +#define NOMINMAX +#endif +#include <windows.h> + +#if __WINRT__ +#include <Unknwn.h> +typedef IUnknown * EGLNativeWindowType; +typedef IUnknown * EGLNativePixmapType; +typedef IUnknown * EGLNativeDisplayType; +#else +typedef HDC EGLNativeDisplayType; +typedef HBITMAP EGLNativePixmapType; +typedef HWND EGLNativeWindowType; +#endif + +#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ + +typedef int EGLNativeDisplayType; +typedef void *EGLNativeWindowType; +typedef void *EGLNativePixmapType; + +#elif defined(WL_EGL_PLATFORM) + +typedef struct wl_display *EGLNativeDisplayType; +typedef struct wl_egl_pixmap *EGLNativePixmapType; +typedef struct wl_egl_window *EGLNativeWindowType; + +#elif defined(__GBM__) + +typedef struct gbm_device *EGLNativeDisplayType; +typedef struct gbm_bo *EGLNativePixmapType; +typedef void *EGLNativeWindowType; + +#elif defined(__ANDROID__) /* Android */ + +struct ANativeWindow; +struct egl_native_pixmap_t; + +typedef struct ANativeWindow *EGLNativeWindowType; +typedef struct egl_native_pixmap_t *EGLNativePixmapType; +typedef void *EGLNativeDisplayType; + +#elif defined(MIR_EGL_PLATFORM) + +#include <mir_toolkit/mir_client_library.h> +typedef MirEGLNativeDisplayType EGLNativeDisplayType; +typedef void *EGLNativePixmapType; +typedef MirEGLNativeWindowType EGLNativeWindowType; + +#elif defined(__unix__) + +#ifdef MESA_EGL_NO_X11_HEADERS + +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; + +#else + +/* X11 (tentative) */ +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +typedef Display *EGLNativeDisplayType; +typedef Pixmap EGLNativePixmapType; +typedef Window EGLNativeWindowType; + +#endif /* MESA_EGL_NO_X11_HEADERS */ + +#else +#error "Platform not recognized" +#endif + +/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ +typedef EGLNativeDisplayType NativeDisplayType; +typedef EGLNativePixmapType NativePixmapType; +typedef EGLNativeWindowType NativeWindowType; + + +/* Define EGLint. This must be a signed integral type large enough to contain +* all legal attribute names and values passed into and out of EGL, whether +* their type is boolean, bitmask, enumerant (symbolic constant), integer, +* handle, or other. While in general a 32-bit integer will suffice, if +* handles are 64 bit types, then EGLint should be defined as a signed 64-bit +* integer type. +*/ +typedef khronos_int32_t EGLint; + +#endif /* __eglplatform_h */ + +#ifndef __egl_h_ +#define __egl_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2013-2015 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ +*/ + +/*#include <EGL/eglplatform.h>*/ + +/* Generated on date 20150623 */ + +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BLUE_SIZE 0x3022 +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_CORE_NATIVE_ENGINE 0x305B +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_DONT_CARE ((EGLint)-1) +#define EGL_DRAW 0x3059 +#define EGL_EXTENSIONS 0x3055 +#define EGL_FALSE 0 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_HEIGHT 0x3056 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_NONE 0x3038 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_READ 0x305A +#define EGL_RED_SIZE 0x3024 +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_SUCCESS 0x3000 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRUE 1 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_WIDTH 0x3057 +#define EGL_WINDOW_BIT 0x0004 +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); +EGLAPI EGLint EGLAPIENTRY eglGetError (void); +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); +EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); +#endif /* EGL_VERSION_1_0 */ + +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 +#define EGL_BACK_BUFFER 0x3084 +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_CONTEXT_LOST 0x300E +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_TARGET 0x3081 +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); +#endif /* EGL_VERSION_1_1 */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_CLIENT_APIS 0x308D +#define EGL_COLORSPACE 0x3087 +#define EGL_COLORSPACE_sRGB 0x3089 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_DISPLAY_SCALING 10000 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_RGB_BUFFER 0x308E +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_UNKNOWN ((EGLint)-1) +#define EGL_VERTICAL_RESOLUTION 0x3091 +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); +#endif /* EGL_VERSION_1_2 */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 +#define EGL_CONFORMANT 0x3042 +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_COLORSPACE_sRGB 0x3089 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#endif /* EGL_VERSION_1_3 */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 +#define EGL_OPENGL_BIT 0x0008 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); +#endif /* EGL_VERSION_1_4 */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_NO_SYNC ((EGLSync)0) +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_NO_IMAGE ((EGLImage)0) +EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); +EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); +#endif /* EGL_VERSION_1_5 */ + +#ifdef __cplusplus +} +#endif + +#endif /* __egl_h_ */ + + + +#ifndef __eglext_h_ +#define __eglext_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2013-2015 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ +*/ + +/*#include <EGL/eglplatform.h>*/ + +#define EGL_EGLEXT_VERSION 20150623 + +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: _nomatch_^ + * Default extensions included: egl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF +#endif /* EGL_KHR_cl_event */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); +#endif +#endif /* EGL_KHR_cl_event2 */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 +#endif /* EGL_KHR_client_get_all_proc_addresses */ + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 +#define EGL_CONFORMANT_KHR 0x3042 +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#endif /* EGL_KHR_config_attribs */ + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif /* EGL_KHR_create_context */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 +#endif /* EGL_KHR_create_context_no_error */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_fence_sync */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 +#endif /* EGL_KHR_get_all_proc_addresses */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 +#define EGL_GL_COLORSPACE_KHR 0x309D +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#endif /* EGL_KHR_gl_colorspace */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 +#endif /* EGL_KHR_gl_renderbuffer_image */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC +#endif /* EGL_KHR_gl_texture_2D_image */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD +#endif /* EGL_KHR_gl_texture_3D_image */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 +typedef void *EGLImageKHR; +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 +#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); +#endif +#endif /* EGL_KHR_image */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 +#endif /* EGL_KHR_image_base */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 +#endif /* EGL_KHR_image_pixmap */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); +#endif +#endif /* EGL_KHR_lock_surface */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 +#endif /* EGL_KHR_lock_surface2 */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); +#endif +#endif /* EGL_KHR_lock_surface3 */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 +#define EGL_BUFFER_AGE_KHR 0x313D +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_KHR_partial_update */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 +#define EGL_PLATFORM_ANDROID_KHR 0x3141 +#endif /* EGL_KHR_platform_android */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 +#define EGL_PLATFORM_GBM_KHR 0x31D7 +#endif /* EGL_KHR_platform_gbm */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 +#endif /* EGL_KHR_platform_wayland */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 +#endif /* EGL_KHR_platform_x11 */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_reusable_sync */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_stream */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 +#ifdef EGL_KHR_stream +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_consumer_gltexture */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 +typedef int EGLNativeFileDescriptorKHR; +#ifdef EGL_KHR_stream +#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) +typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_cross_process_fd */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 +#ifdef EGL_KHR_stream +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_fifo */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 +#ifdef EGL_KHR_stream +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 +#ifdef EGL_KHR_stream +#define EGL_STREAM_BIT_KHR 0x0800 +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_producer_eglsurface */ + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 +#endif /* EGL_KHR_surfaceless_context */ + +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_KHR_swap_buffers_with_damage */ + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA +#endif /* EGL_KHR_vg_parent_image */ + +#ifndef EGL_KHR_wait_sync +#define EGL_KHR_wait_sync 1 +typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); +#endif +#endif /* EGL_KHR_wait_sync */ + +#ifndef EGL_ANDROID_blob_cache +#define EGL_ANDROID_blob_cache 1 +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); +#endif +#endif /* EGL_ANDROID_blob_cache */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 +#endif /* EGL_ANDROID_framebuffer_target */ + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 +#endif /* EGL_ANDROID_image_native_buffer */ + +#ifndef EGL_ANDROID_native_fence_sync +#define EGL_ANDROID_native_fence_sync 1 +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 +#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 +typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); +#endif +#endif /* EGL_ANDROID_native_fence_sync */ + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 +#define EGL_RECORDABLE_ANDROID 0x3142 +#endif /* EGL_ANDROID_recordable */ + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ + +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 +#endif /* EGL_ANGLE_device_d3d */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#endif +#endif /* EGL_ANGLE_query_surface_pointer */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 +#define EGL_FIXED_SIZE_ANGLE 0x3201 +#endif /* EGL_ANGLE_window_fixed_size */ + +#ifndef EGL_ARM_pixmap_multisample_discard +#define EGL_ARM_pixmap_multisample_discard 1 +#define EGL_DISCARD_SAMPLES_ARM 0x3286 +#endif /* EGL_ARM_pixmap_multisample_discard */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 +#define EGL_BUFFER_AGE_EXT 0x313D +#endif /* EGL_EXT_buffer_age */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 +#endif /* EGL_EXT_client_extensions */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF +#endif /* EGL_EXT_create_context_robustness */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 +typedef void *EGLDeviceEXT; +#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); +#endif +#endif /* EGL_EXT_device_base */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 +#endif /* EGL_EXT_device_drm */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 +#endif /* EGL_EXT_device_enumeration */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 +#endif /* EGL_EXT_device_openwf */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 +#endif /* EGL_EXT_device_query */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 +#endif /* EGL_EXT_image_dma_buf_import */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 +#endif /* EGL_EXT_multiview_window */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) +#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); +EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); +EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); +#endif +#endif /* EGL_EXT_output_base */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 +#endif /* EGL_EXT_output_drm */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 +#endif /* EGL_EXT_output_openwf */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); +#endif +#endif /* EGL_EXT_platform_base */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 +#define EGL_PLATFORM_DEVICE_EXT 0x313F +#endif /* EGL_EXT_platform_device */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 +#endif /* EGL_EXT_platform_wayland */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 +#endif /* EGL_EXT_platform_x11 */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 +#endif /* EGL_EXT_protected_surface */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); +#endif +#endif /* EGL_EXT_stream_consumer_egloutput */ + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_EXT_swap_buffers_with_damage */ + +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D +#endif /* EGL_EXT_yuv_surface */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 +struct EGLClientPixmapHI { + void *pData; + EGLint iWidth; + EGLint iHeight; + EGLint iStride; +}; +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); +#endif +#endif /* EGL_HI_clientpixmap */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 +#endif /* EGL_HI_colorformats */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#endif /* EGL_IMG_context_priority */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif +#endif /* EGL_MESA_drm_image */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); +#endif +#endif /* EGL_MESA_image_dma_buf_export */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 +#define EGL_PLATFORM_GBM_MESA 0x31D7 +#endif /* EGL_MESA_platform_gbm */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#endif +#endif /* EGL_NOK_swap_region */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#endif +#endif /* EGL_NOK_swap_region2 */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 +#define EGL_Y_INVERTED_NOK 0x307F +#endif /* EGL_NOK_texture_from_pixmap */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 +#define EGL_AUTO_STEREO_NV 0x3136 +#endif /* EGL_NV_3dvision_surface */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif /* EGL_NV_coverage_sample */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 +#endif /* EGL_NV_coverage_sample_resolve */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D +#endif /* EGL_NV_cuda_event */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif /* EGL_NV_depth_nonlinear */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 +#define EGL_CUDA_DEVICE_NV 0x323A +#endif /* EGL_NV_device_cuda */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); +#endif +#endif /* EGL_NV_native_query */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 +#endif /* EGL_NV_post_convert_rounding */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#endif +#endif /* EGL_NV_post_sub_buffer */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 +#define EGL_SYNC_NEW_FRAME_NV 0x321F +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); +#endif +#endif /* EGL_NV_stream_sync */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_NO_SYNC_NV ((EGLSyncNV)0) +typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); +EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_NV_sync */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 +typedef khronos_utime_nanoseconds_t EGLuint64NV; +#ifdef KHRONOS_SUPPORT_INT64 +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_NV_system_time */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 +#endif /* EGL_TIZEN_image_native_buffer */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 +#endif /* EGL_TIZEN_image_native_surface */ + +#ifdef __cplusplus +} +#endif + +#endif /* __eglext_h_ */ + + +#endif /* _MSC_VER */ diff --git a/Windows/SDL2/include/SDL2/SDL_endian.h b/Windows/SDL2/include/SDL2/SDL_endian.h new file mode 100644 index 00000000..171c008a --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_endian.h @@ -0,0 +1,263 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_endian.h + * + * Functions for reading and writing endian-specific values + */ + +#ifndef SDL_endian_h_ +#define SDL_endian_h_ + +#include "SDL_stdinc.h" + +/** + * \name The two types of endianness + */ +/* @{ */ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/* @} */ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include <endian.h> +#define SDL_BYTEORDER __BYTE_ORDER +#elif defined(__OpenBSD__) +#include <endian.h> +#define SDL_BYTEORDER BYTE_ORDER +#else +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MIPSEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* __linux__ */ +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_endian.h + */ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + int result; + + __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); + return (Uint16)result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#elif defined(__WATCOMC__) && defined(__386__) +extern _inline Uint16 SDL_Swap16(Uint16); +#pragma aux SDL_Swap16 = \ + "xchg al, ah" \ + parm [ax] \ + modify [ax]; +#else +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); + __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); + __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#elif defined(__WATCOMC__) && defined(__386__) +extern _inline Uint32 SDL_Swap32(Uint32); +#ifndef __SW_3 /* 486+ */ +#pragma aux SDL_Swap32 = \ + "bswap eax" \ + parm [eax] \ + modify [eax]; +#else /* 386-only */ +#pragma aux SDL_Swap32 = \ + "xchg al, ah" \ + "ror eax, 16" \ + "xchg al, ah" \ + parm [eax] \ + modify [eax]; +#endif +#else +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | + ((x >> 8) & 0x0000FF00) | (x >> 24))); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + union + { + struct + { + Uint32 a, b; + } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), + "1"(v.s. + b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0": "=r"(x):"0"(x)); + return x; +} +#else +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return (x); +} +#endif + + +SDL_FORCE_INLINE float +SDL_SwapFloat(float x) +{ + union + { + float f; + Uint32 ui32; + } swapper; + swapper.f = x; + swapper.ui32 = SDL_Swap32(swapper.ui32); + return swapper.f; +} + + +/** + * \name Swap to native + * Byteswap item from the specified endianness to the native endianness. + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapFloatLE(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#define SDL_SwapFloatBE(X) (X) +#endif +/* @} *//* Swap to native */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_endian_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_error.h b/Windows/SDL2/include/SDL2/SDL_error.h new file mode 100644 index 00000000..aae37c0e --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_error.h @@ -0,0 +1,76 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_error.h + * + * Simple error message routines for SDL. + */ + +#ifndef SDL_error_h_ +#define SDL_error_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Public functions */ +/* SDL_SetError() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); +extern DECLSPEC const char *SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); + +/** + * \name Internal error functions + * + * \internal + * Private error reporting function - used internally. + */ +/* @{ */ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) +typedef enum +{ + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +/* SDL_Error() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); +/* @} *//* Internal error functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_error_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_events.h b/Windows/SDL2/include/SDL2/SDL_events.h new file mode 100644 index 00000000..32cfbe32 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_events.h @@ -0,0 +1,792 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_events.h + * + * Include file for SDL event handling. + */ + +#ifndef SDL_events_h_ +#define SDL_events_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_gamecontroller.h" +#include "SDL_quit.h" +#include "SDL_gesture.h" +#include "SDL_touch.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* General keyboard/mouse state definitions */ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 + +/** + * \brief The types of events that can be delivered. + */ +typedef enum +{ + SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ + + /* Application events */ + SDL_QUIT = 0x100, /**< User-requested quit */ + + /* These application events have special meaning on iOS, see README-ios.md for details */ + SDL_APP_TERMINATING, /**< The application is being terminated by the OS + Called on iOS in applicationWillTerminate() + Called on Android in onDestroy() + */ + SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. + Called on iOS in applicationDidReceiveMemoryWarning() + Called on Android in onLowMemory() + */ + SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background + Called on iOS in applicationWillResignActive() + Called on Android in onPause() + */ + SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time + Called on iOS in applicationDidEnterBackground() + Called on Android in onPause() + */ + SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground + Called on iOS in applicationWillEnterForeground() + Called on Android in onResume() + */ + SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive + Called on iOS in applicationDidBecomeActive() + Called on Android in onResume() + */ + + /* Display events */ + SDL_DISPLAYEVENT = 0x150, /**< Display state change */ + + /* Window events */ + SDL_WINDOWEVENT = 0x200, /**< Window state change */ + SDL_SYSWMEVENT, /**< System specific event */ + + /* Keyboard events */ + SDL_KEYDOWN = 0x300, /**< Key pressed */ + SDL_KEYUP, /**< Key released */ + SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ + SDL_TEXTINPUT, /**< Keyboard text input */ + SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an + input language or keyboard layout change. + */ + + /* Mouse events */ + SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_MOUSEWHEEL, /**< Mouse wheel motion */ + + /* Joystick events */ + SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ + SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ + + /* Game controller events */ + SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ + SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ + SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ + SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ + SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ + SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + + /* Touch events */ + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + + /* Gesture events */ + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + + /* Clipboard events */ + SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ + + /* Drag and drop events */ + SDL_DROPFILE = 0x1000, /**< The system requests a file open */ + SDL_DROPTEXT, /**< text/plain drag-and-drop event */ + SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */ + SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ + + /* Audio hotplug events */ + SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ + SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ + + /* Sensor events */ + SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */ + + /* Render events */ + SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ + SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ + + /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, + * and should be allocated with SDL_RegisterEvents() + */ + SDL_USEREVENT = 0x8000, + + /** + * This last event is only for bounding internal arrays + */ + SDL_LASTEVENT = 0xFFFF +} SDL_EventType; + +/** + * \brief Fields shared by every event + */ +typedef struct SDL_CommonEvent +{ + Uint32 type; + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_CommonEvent; + +/** + * \brief Display state change event data (event.display.*) + */ +typedef struct SDL_DisplayEvent +{ + Uint32 type; /**< ::SDL_DISPLAYEVENT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 display; /**< The associated display index */ + Uint8 event; /**< ::SDL_DisplayEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ +} SDL_DisplayEvent; + +/** + * \brief Window state change event data (event.window.*) + */ +typedef struct SDL_WindowEvent +{ + Uint32 type; /**< ::SDL_WINDOWEVENT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The associated window */ + Uint8 event; /**< ::SDL_WindowEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ + Sint32 data2; /**< event dependent data */ +} SDL_WindowEvent; + +/** + * \brief Keyboard button event structure (event.key.*) + */ +typedef struct SDL_KeyboardEvent +{ + Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 repeat; /**< Non-zero if this is a key repeat */ + Uint8 padding2; + Uint8 padding3; + SDL_Keysym keysym; /**< The key that was pressed or released */ +} SDL_KeyboardEvent; + +#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text editing event structure (event.edit.*) + */ +typedef struct SDL_TextEditingEvent +{ + Uint32 type; /**< ::SDL_TEXTEDITING */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ + Sint32 start; /**< The start cursor of selected editing text */ + Sint32 length; /**< The length of selected editing text */ +} SDL_TextEditingEvent; + + +#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text input event structure (event.text.*) + */ +typedef struct SDL_TextInputEvent +{ + Uint32 type; /**< ::SDL_TEXTINPUT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ +} SDL_TextInputEvent; + +/** + * \brief Mouse motion event structure (event.motion.*) + */ +typedef struct SDL_MouseMotionEvent +{ + Uint32 type; /**< ::SDL_MOUSEMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint32 state; /**< The current button state */ + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ + Sint32 xrel; /**< The relative motion in the X direction */ + Sint32 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** + * \brief Mouse button event structure (event.button.*) + */ +typedef struct SDL_MouseButtonEvent +{ + Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ + Uint8 padding1; + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ +} SDL_MouseButtonEvent; + +/** + * \brief Mouse wheel event structure (event.wheel.*) + */ +typedef struct SDL_MouseWheelEvent +{ + Uint32 type; /**< ::SDL_MOUSEWHEEL */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ + Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ + Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ +} SDL_MouseWheelEvent; + +/** + * \brief Joystick axis motion event structure (event.jaxis.*) + */ +typedef struct SDL_JoyAxisEvent +{ + Uint32 type; /**< ::SDL_JOYAXISMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The joystick axis index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_JoyAxisEvent; + +/** + * \brief Joystick trackball motion event structure (event.jball.*) + */ +typedef struct SDL_JoyBallEvent +{ + Uint32 type; /**< ::SDL_JOYBALLMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 ball; /**< The joystick trackball index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** + * \brief Joystick hat position change event structure (event.jhat.*) + */ +typedef struct SDL_JoyHatEvent +{ + Uint32 type; /**< ::SDL_JOYHATMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value. + * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP + * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT + * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * + * Note that zero means the POV is centered. + */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyHatEvent; + +/** + * \brief Joystick button event structure (event.jbutton.*) + */ +typedef struct SDL_JoyButtonEvent +{ + Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyButtonEvent; + +/** + * \brief Joystick device event structure (event.jdevice.*) + */ +typedef struct SDL_JoyDeviceEvent +{ + Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ +} SDL_JoyDeviceEvent; + + +/** + * \brief Game controller axis motion event structure (event.caxis.*) + */ +typedef struct SDL_ControllerAxisEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_ControllerAxisEvent; + + +/** + * \brief Game controller button event structure (event.cbutton.*) + */ +typedef struct SDL_ControllerButtonEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The controller button (SDL_GameControllerButton) */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_ControllerButtonEvent; + + +/** + * \brief Controller device event structure (event.cdevice.*) + */ +typedef struct SDL_ControllerDeviceEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ +} SDL_ControllerDeviceEvent; + +/** + * \brief Audio device event structure (event.adevice.*) + */ +typedef struct SDL_AudioDeviceEvent +{ + Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ + Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; +} SDL_AudioDeviceEvent; + + +/** + * \brief Touch finger event structure (event.tfinger.*) + */ +typedef struct SDL_TouchFingerEvent +{ + Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_TouchID touchId; /**< The touch device id */ + SDL_FingerID fingerId; + float x; /**< Normalized in the range 0...1 */ + float y; /**< Normalized in the range 0...1 */ + float dx; /**< Normalized in the range -1...1 */ + float dy; /**< Normalized in the range -1...1 */ + float pressure; /**< Normalized in the range 0...1 */ + Uint32 windowID; /**< The window underneath the finger, if any */ +} SDL_TouchFingerEvent; + + +/** + * \brief Multiple Finger Gesture Event (event.mgesture.*) + */ +typedef struct SDL_MultiGestureEvent +{ + Uint32 type; /**< ::SDL_MULTIGESTURE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_TouchID touchId; /**< The touch device id */ + float dTheta; + float dDist; + float x; + float y; + Uint16 numFingers; + Uint16 padding; +} SDL_MultiGestureEvent; + + +/** + * \brief Dollar Gesture Event (event.dgesture.*) + */ +typedef struct SDL_DollarGestureEvent +{ + Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_TouchID touchId; /**< The touch device id */ + SDL_GestureID gestureId; + Uint32 numFingers; + float error; + float x; /**< Normalized center of gesture */ + float y; /**< Normalized center of gesture */ +} SDL_DollarGestureEvent; + + +/** + * \brief An event used to request a file open by the system (event.drop.*) + * This event is enabled by default, you can disable it with SDL_EventState(). + * \note If this event is enabled, you must free the filename in the event. + */ +typedef struct SDL_DropEvent +{ + Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ + Uint32 windowID; /**< The window that was dropped on, if any */ +} SDL_DropEvent; + + +/** + * \brief Sensor event structure (event.sensor.*) + */ +typedef struct SDL_SensorEvent +{ + Uint32 type; /**< ::SDL_SENSORUPDATE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Sint32 which; /**< The instance ID of the sensor */ + float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ +} SDL_SensorEvent; + +/** + * \brief The "quit requested" event + */ +typedef struct SDL_QuitEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_QuitEvent; + +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_OSEvent; + +/** + * \brief A user-defined event type (event.user.*) + */ +typedef struct SDL_UserEvent +{ + Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The associated window if any */ + Sint32 code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + + +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; + +/** + * \brief A video driver dependent system event (event.syswm.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * + * \note If you want to use this event, you should include SDL_syswm.h. + */ +typedef struct SDL_SysWMEvent +{ + Uint32 type; /**< ::SDL_SYSWMEVENT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ +} SDL_SysWMEvent; + +/** + * \brief General event structure + */ +typedef union SDL_Event +{ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common event data */ + SDL_DisplayEvent display; /**< Display event data */ + SDL_WindowEvent window; /**< Window event data */ + SDL_KeyboardEvent key; /**< Keyboard event data */ + SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ + SDL_SensorEvent sensor; /**< Sensor event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ + + /* This is necessary for ABI compatibility between Visual C++ and GCC + Visual C++ will respect the push pack pragma and use 52 bytes for + this structure, and GCC will use the alignment of the largest datatype + within the union, which is 8 bytes. + + So... we'll add padding to force the size to be 56 bytes for both. + */ + Uint8 padding[56]; +} SDL_Event; + +/* Make sure we haven't broken binary compatibility */ +SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56); + + +/* Function prototypes */ + +/** + * Pumps the event loop, gathering events from the input devices. + * + * This function updates the event queue and internal input device state. + * + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +/* @{ */ +typedef enum +{ + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to + * the back of the event queue. + * + * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will not be removed from the queue. + * + * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will be removed from the queue. + * + * \return The number of events actually stored, or -1 if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, + SDL_eventaction action, + Uint32 minType, Uint32 maxType); +/* @} */ + +/** + * Checks to see if certain event types are in the event queue. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); + +/** + * This function clears events from the event queue + * This function only affects currently queued events. If you want to make + * sure that all pending OS events are flushed, you can call SDL_PumpEvents() + * on the main thread immediately before the flush call. + */ +extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); +extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); + +/** + * \brief Polls for currently pending events. + * + * \return 1 if there are any pending events, or 0 if there are none available. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); + +/** + * \brief Waits indefinitely for the next available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); + +/** + * \brief Waits until the specified timeout (in milliseconds) for the next + * available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + * \param timeout The timeout (in milliseconds) to wait for next event. + */ +extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, + int timeout); + +/** + * \brief Add an event to the event queue. + * + * \return 1 on success, 0 if the event was filtered, or -1 if the event queue + * was full or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); + +typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); + +/** + * Sets up a filter to process all events before they change internal state and + * are posted to the internal event queue. + * + * The filter is prototyped as: + * \code + * int SDL_EventFilter(void *userdata, SDL_Event * event); + * \endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * \warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the ::SDL_QuitEvent event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, + void *userdata); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns SDL_FALSE. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, + void **userdata); + +/** + * Add a function which is called when an event is added to the queue. + */ +extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Remove an event watch function added with SDL_AddEventWatch() + */ +extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Run the filter function on the current event queue, removing any + * events for which the filter returns 0. + */ +extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, + void *userdata); + +/* @{ */ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 + +/** + * This function allows you to set the state of processing certain events. + * - If \c state is set to ::SDL_IGNORE, that event will be automatically + * dropped from the event queue and will not be filtered. + * - If \c state is set to ::SDL_ENABLE, that event will be processed + * normally. + * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the + * current processing state of the specified event. + */ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); +/* @} */ +#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) + +/** + * This function allocates a set of user-defined events, and returns + * the beginning event number for that set of events. + * + * If there aren't enough user-defined events left, this function + * returns (Uint32)-1 + */ +extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_events_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_filesystem.h b/Windows/SDL2/include/SDL2/SDL_filesystem.h new file mode 100644 index 00000000..68042b60 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_filesystem.h @@ -0,0 +1,136 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_filesystem.h + * + * \brief Include file for filesystem SDL API functions + */ + +#ifndef SDL_filesystem_h_ +#define SDL_filesystem_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Get the path where the application resides. + * + * Get the "base path". This is the directory where the application was run + * from, which is probably the installation directory, and may or may not + * be the process's current working directory. + * + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). + * + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. + * + * Some platforms can't determine the application's path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \return String of base dir in UTF-8 encoding, or NULL on error. + * + * \sa SDL_GetPrefPath + */ +extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); + +/** + * \brief Get the user-and-app-specific path where files can be written. + * + * Get the "pref dir". This is meant to be where users can write personal + * files (preferences and save games, etc) that are specific to your + * application. This directory is unique per user, per application. + * + * This function will decide the appropriate location in the native filesystem, + * create the directory if necessary, and return a string of the absolute + * path to the directory in UTF-8 encoding. + * + * On Windows, the string might look like: + * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" + * + * On Linux, the string might look like: + * "/home/bob/.local/share/My Program Name/" + * + * On Mac OS X, the string might look like: + * "/Users/bob/Library/Application Support/My Program Name/" + * + * (etc.) + * + * You specify the name of your organization (if it's not a real organization, + * your name or an Internet domain you own might do) and the name of your + * application. These should be untranslated proper names. + * + * Both the org and app strings may become part of a directory name, so + * please follow these rules: + * + * - Try to use the same org string (including case-sensitivity) for + * all your applications that use this function. + * - Always use a unique app string for each one, and make sure it never + * changes for an app once you've decided on it. + * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - ...only use letters, numbers, and spaces. Avoid punctuation like + * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. + * + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). + * + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. + * + * You should assume the path returned by this function is the only safe + * place to write files (and that SDL_GetBasePath(), while it might be + * writable, or even the parent of the returned path, aren't where you + * should be writing things). + * + * Some platforms can't determine the pref path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \param org The name of your organization. + * \param app The name of your application. + * \return UTF-8 string of user dir in platform-dependent notation. NULL + * if there's a problem (creating directory failed, etc). + * + * \sa SDL_GetBasePath + */ +extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_filesystem_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_gamecontroller.h b/Windows/SDL2/include/SDL2/SDL_gamecontroller.h new file mode 100644 index 00000000..21cc1e43 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_gamecontroller.h @@ -0,0 +1,420 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gamecontroller.h + * + * Include file for SDL game controller event handling + */ + +#ifndef SDL_gamecontroller_h_ +#define SDL_gamecontroller_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_rwops.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_gamecontroller.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system + * for game controllers, and load appropriate drivers. + * + * If you would like to receive controller updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/** + * The gamecontroller structure used to identify an SDL game controller + */ +struct _SDL_GameController; +typedef struct _SDL_GameController SDL_GameController; + +typedef enum +{ + SDL_CONTROLLER_TYPE_UNKNOWN = 0, + SDL_CONTROLLER_TYPE_XBOX360, + SDL_CONTROLLER_TYPE_XBOXONE, + SDL_CONTROLLER_TYPE_PS3, + SDL_CONTROLLER_TYPE_PS4, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO +} SDL_GameControllerType; + +typedef enum +{ + SDL_CONTROLLER_BINDTYPE_NONE = 0, + SDL_CONTROLLER_BINDTYPE_BUTTON, + SDL_CONTROLLER_BINDTYPE_AXIS, + SDL_CONTROLLER_BINDTYPE_HAT +} SDL_GameControllerBindType; + +/** + * Get the SDL joystick layer binding for this controller button/axis mapping + */ +typedef struct SDL_GameControllerButtonBind +{ + SDL_GameControllerBindType bindType; + union + { + int button; + int axis; + struct { + int hat; + int hat_mask; + } hat; + } value; + +} SDL_GameControllerButtonBind; + + +/** + * To count the number of game controllers in the system for the following: + * int nJoysticks = SDL_NumJoysticks(); + * int nGameControllers = 0; + * for (int i = 0; i < nJoysticks; i++) { + * if (SDL_IsGameController(i)) { + * nGameControllers++; + * } + * } + * + * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: + * guid,name,mappings + * + * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. + * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. + * The mapping format for joystick is: + * bX - a joystick button, index X + * hX.Y - hat X with value Y + * aX - axis X of the joystick + * Buttons can be used as a controller axis and vice versa. + * + * This string shows an example of a valid mapping for a controller + * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", + * + */ + +/** + * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform() + * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt + * + * If \c freerw is non-zero, the stream will be closed after being read. + * + * \return number of mappings added, -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw); + +/** + * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() + * + * Convenience macro. + */ +#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Add or update an existing mapping configuration + * + * \return 1 if mapping is added, 0 if updated, -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString); + +/** + * Get the number of mappings installed + * + * \return the number of mappings + */ +extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void); + +/** + * Get the mapping at a particular index. + * + * \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range. + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index); + +/** + * Get a mapping string for a GUID + * + * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid); + +/** + * Get a mapping string for an open GameController + * + * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); + +/** + * Is the joystick on this index supported by the game controller interface? + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); + +/** + * Get the implementation dependent name of a game controller. + * This can be called before any controllers are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); + +/** + * Get the type of a game controller. + * This can be called before any controllers are opened. + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); + +/** + * Get the mapping of a game controller. + * This can be called before any controllers are opened. + * + * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available + */ +extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index); + +/** + * Open a game controller for use. + * The index passed as an argument refers to the N'th game controller on the system. + * This index is not the value which will identify this controller in future + * controller events. The joystick's instance id (::SDL_JoystickID) will be + * used there instead. + * + * \return A controller identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); + +/** + * Return the SDL_GameController associated with an instance id. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); + +/** + * Return the SDL_GameController associated with a player index. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); + +/** + * Return the name for this currently opened controller + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); + +/** + * Return the type of this currently opened controller + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); + +/** + * Get the player index of an opened game controller, or -1 if it's not available + * + * For XInput controllers this returns the XInput user index. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); + +/** + * Set the player index of an opened game controller + */ +extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); + +/** + * Get the USB vendor ID of an opened controller, if available. + * If the vendor ID isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); + +/** + * Get the USB product ID of an opened controller, if available. + * If the product ID isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); + +/** + * Get the product version of an opened controller, if available. + * If the product version isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); + +/** + * Returns SDL_TRUE if the controller has been opened and currently connected, + * or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); + +/** + * Get the underlying joystick object used by a controller + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); + +/** + * Enable/disable controller event polling. + * + * If controller events are disabled, you must call SDL_GameControllerUpdate() + * yourself and check the state of the controller when you want controller + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); + +/** + * Update the current state of the open game controllers. + * + * This is called automatically by the event loop if any game controller + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); + + +/** + * The list of axes available from a controller + * + * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, + * and are centered within ~8000 of zero, though advanced UI will allow users to set + * or autodetect the dead zone, which varies between controllers. + * + * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. + */ +typedef enum +{ + SDL_CONTROLLER_AXIS_INVALID = -1, + SDL_CONTROLLER_AXIS_LEFTX, + SDL_CONTROLLER_AXIS_LEFTY, + SDL_CONTROLLER_AXIS_RIGHTX, + SDL_CONTROLLER_AXIS_RIGHTY, + SDL_CONTROLLER_AXIS_TRIGGERLEFT, + SDL_CONTROLLER_AXIS_TRIGGERRIGHT, + SDL_CONTROLLER_AXIS_MAX +} SDL_GameControllerAxis; + +/** + * turn this string into a axis mapping + */ +extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); + +/** + * turn this axis enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * Get the current state of an axis control on a game controller. + * + * The state is a value ranging from -32768 to 32767 (except for the triggers, + * which range from 0 to 32767). + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * The list of buttons available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_BUTTON_INVALID = -1, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MAX +} SDL_GameControllerButton; + +/** + * turn this string into a button mapping + */ +extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); + +/** + * turn this button enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + + +/** + * Get the current state of a button on a game controller. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Trigger a rumble effect + * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param gamecontroller The controller to vibrate + * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF + * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if rumble isn't supported on this joystick + */ +extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** + * Close a controller previously opened with SDL_GameControllerOpen(). + */ +extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_gamecontroller_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_gesture.h b/Windows/SDL2/include/SDL2/SDL_gesture.h new file mode 100644 index 00000000..81ed4317 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_gesture.h @@ -0,0 +1,87 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gesture.h + * + * Include file for SDL gesture event handling. + */ + +#ifndef SDL_gesture_h_ +#define SDL_gesture_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "SDL_touch.h" + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_GestureID; + +/* Function prototypes */ + +/** + * \brief Begin Recording a gesture on the specified touch, or all touches (-1) + * + * + */ +extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); + + +/** + * \brief Save all currently loaded Dollar Gesture templates + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); + +/** + * \brief Save a currently loaded Dollar Gesture template + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); + + +/** + * \brief Load Dollar Gesture templates from a file + * + * + */ +extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_gesture_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_haptic.h b/Windows/SDL2/include/SDL2/SDL_haptic.h new file mode 100644 index 00000000..aa6f47fd --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_haptic.h @@ -0,0 +1,1238 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_haptic.h + * + * \brief The SDL haptic subsystem allows you to control haptic (force feedback) + * devices. + * + * The basic usage is as follows: + * - Initialize the subsystem (::SDL_INIT_HAPTIC). + * - Open a haptic device. + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (::SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). + * + * \par Simple rumble example: + * \code + * SDL_Haptic *haptic; + * + * // Open the device + * haptic = SDL_HapticOpen( 0 ); + * if (haptic == NULL) + * return -1; + * + * // Initialize simple rumble + * if (SDL_HapticRumbleInit( haptic ) != 0) + * return -1; + * + * // Play effect at 50% strength for 2 seconds + * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) + * return -1; + * SDL_Delay( 2000 ); + * + * // Clean up + * SDL_HapticClose( haptic ); + * \endcode + * + * \par Complete example: + * \code + * int test_haptic( SDL_Joystick * joystick ) { + * SDL_Haptic *haptic; + * SDL_HapticEffect effect; + * int effect_id; + * + * // Open the device + * haptic = SDL_HapticOpenFromJoystick( joystick ); + * if (haptic == NULL) return -1; // Most likely joystick isn't haptic + * + * // See if it can do sine waves + * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { + * SDL_HapticClose(haptic); // No sine effect + * return -1; + * } + * + * // Create the effect + * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default + * effect.type = SDL_HAPTIC_SINE; + * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates + * effect.periodic.direction.dir[0] = 18000; // Force comes from south + * effect.periodic.period = 1000; // 1000 ms + * effect.periodic.magnitude = 20000; // 20000/32767 strength + * effect.periodic.length = 5000; // 5 seconds long + * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength + * effect.periodic.fade_length = 1000; // Takes 1 second to fade away + * + * // Upload the effect + * effect_id = SDL_HapticNewEffect( haptic, &effect ); + * + * // Test the effect + * SDL_HapticRunEffect( haptic, effect_id, 1 ); + * SDL_Delay( 5000); // Wait for the effect to finish + * + * // We destroy the effect, although closing the device also does this + * SDL_HapticDestroyEffect( haptic, effect_id ); + * + * // Close the device + * SDL_HapticClose(haptic); + * + * return 0; // Success + * } + * \endcode + */ + +#ifndef SDL_haptic_h_ +#define SDL_haptic_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF). + * + * At the moment the magnitude variables are mixed between signed/unsigned, and + * it is also not made clear that ALL of those variables expect a max of 0x7FFF. + * + * Some platforms may have higher precision than that (Linux FF, Windows XInput) + * so we should fix the inconsistency in favor of higher possible precision, + * adjusting for platforms that use different scales. + * -flibit + */ + +/** + * \typedef SDL_Haptic + * + * \brief The haptic structure used to identify an SDL haptic. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + */ +struct _SDL_Haptic; +typedef struct _SDL_Haptic SDL_Haptic; + + +/** + * \name Haptic features + * + * Different haptic features a device can have. + */ +/* @{ */ + +/** + * \name Haptic effects + */ +/* @{ */ + +/** + * \brief Constant effect supported. + * + * Constant haptic effect. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_CONSTANT (1u<<0) + +/** + * \brief Sine wave effect supported. + * + * Periodic haptic effect that simulates sine waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SINE (1u<<1) + +/** + * \brief Left/Right effect supported. + * + * Haptic effect for direct control over high/low frequency motors. + * + * \sa SDL_HapticLeftRight + * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, + * we ran out of bits, and this is important for XInput devices. + */ +#define SDL_HAPTIC_LEFTRIGHT (1u<<2) + +/* !!! FIXME: put this back when we have more bits in 2.1 */ +/* #define SDL_HAPTIC_SQUARE (1<<2) */ + +/** + * \brief Triangle wave effect supported. + * + * Periodic haptic effect that simulates triangular waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_TRIANGLE (1u<<3) + +/** + * \brief Sawtoothup wave effect supported. + * + * Periodic haptic effect that simulates saw tooth up waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHUP (1u<<4) + +/** + * \brief Sawtoothdown wave effect supported. + * + * Periodic haptic effect that simulates saw tooth down waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5) + +/** + * \brief Ramp effect supported. + * + * Ramp haptic effect. + * + * \sa SDL_HapticRamp + */ +#define SDL_HAPTIC_RAMP (1u<<6) + +/** + * \brief Spring effect supported - uses axes position. + * + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_SPRING (1u<<7) + +/** + * \brief Damper effect supported - uses axes velocity. + * + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_DAMPER (1u<<8) + +/** + * \brief Inertia effect supported - uses axes acceleration. + * + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_INERTIA (1u<<9) + +/** + * \brief Friction effect supported - uses axes movement. + * + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_FRICTION (1u<<10) + +/** + * \brief Custom effect is supported. + * + * User defined custom haptic effect. + */ +#define SDL_HAPTIC_CUSTOM (1u<<11) + +/* @} *//* Haptic effects */ + +/* These last few are features the device has, not effects */ + +/** + * \brief Device can set global gain. + * + * Device supports setting the global gain. + * + * \sa SDL_HapticSetGain + */ +#define SDL_HAPTIC_GAIN (1u<<12) + +/** + * \brief Device can set autocenter. + * + * Device supports setting autocenter. + * + * \sa SDL_HapticSetAutocenter + */ +#define SDL_HAPTIC_AUTOCENTER (1u<<13) + +/** + * \brief Device can be queried for effect status. + * + * Device supports querying effect status. + * + * \sa SDL_HapticGetEffectStatus + */ +#define SDL_HAPTIC_STATUS (1u<<14) + +/** + * \brief Device can be paused. + * + * Devices supports being paused. + * + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause + */ +#define SDL_HAPTIC_PAUSE (1u<<15) + + +/** + * \name Direction encodings + */ +/* @{ */ + +/** + * \brief Uses polar coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_POLAR 0 + +/** + * \brief Uses cartesian coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_CARTESIAN 1 + +/** + * \brief Uses spherical coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_SPHERICAL 2 + +/* @} *//* Direction encodings */ + +/* @} *//* Haptic features */ + +/* + * Misc defines. + */ + +/** + * \brief Used to play a device an infinite number of times. + * + * \sa SDL_HapticRunEffect + */ +#define SDL_HAPTIC_INFINITY 4294967295U + + +/** + * \brief Structure that represents a haptic direction. + * + * This is the direction where the force comes from, + * instead of the direction in which the force is exerted. + * + * Directions can be specified by: + * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. + * + * Cardinal directions of the haptic device are relative to the positioning + * of the device. North is considered to be away from the user. + * + * The following diagram represents the cardinal directions: + * \verbatim + .--. + |__| .-------. + |=.| |.-----.| + |--| || || + | | |'-----'| + |__|~')_____(' + [ COMPUTER ] + + + North (0,-1) + ^ + | + | + (-1,0) West <----[ HAPTIC ]----> East (1,0) + | + | + v + South (0,1) + + + [ USER ] + \|||/ + (o o) + ---ooO-(_)-Ooo--- + \endverbatim + * + * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses + * the first \c dir parameter. The cardinal directions would be: + * - North: 0 (0 degrees) + * - East: 9000 (90 degrees) + * - South: 18000 (180 degrees) + * - West: 27000 (270 degrees) + * + * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions + * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses + * the first three \c dir parameters. The cardinal directions would be: + * - North: 0,-1, 0 + * - East: 1, 0, 0 + * - South: 0, 1, 0 + * - West: -1, 0, 0 + * + * The Z axis represents the height of the effect if supported, otherwise + * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you + * can use any multiple you want, only the direction matters. + * + * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. + * The first two \c dir parameters are used. The \c dir parameters are as + * follows (all values are in hundredths of degrees): + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * + * Example of force coming from the south with all encodings (force coming + * from the south means the user will have to pull the stick to counteract): + * \code + * SDL_HapticDirection direction; + * + * // Cartesian directions + * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. + * direction.dir[0] = 0; // X position + * direction.dir[1] = 1; // Y position + * // Assuming the device has 2 axes, we don't need to specify third parameter. + * + * // Polar directions + * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. + * direction.dir[0] = 18000; // Polar only uses first parameter + * + * // Spherical coordinates + * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding + * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. + * \endcode + * + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes + */ +typedef struct SDL_HapticDirection +{ + Uint8 type; /**< The type of encoding. */ + Sint32 dir[3]; /**< The encoded direction. */ +} SDL_HapticDirection; + + +/** + * \brief A structure containing a template for a Constant effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect. + * + * A constant effect applies a constant force in the specified direction + * to the joystick. + * + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticConstant +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Constant */ + Sint16 level; /**< Strength of the constant effect. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticConstant; + +/** + * \brief A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SINE + * - ::SDL_HAPTIC_LEFTRIGHT + * - ::SDL_HAPTIC_TRIANGLE + * - ::SDL_HAPTIC_SAWTOOTHUP + * - ::SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself + * over time. The type determines the shape of the wave and the parameters + * determine the dimensions of the wave. + * + * Phase is given by hundredth of a degree meaning that giving the phase a value + * of 9000 will displace it 25% of its period. Here are sample values: + * - 0: No phase displacement. + * - 9000: Displaced 25% of its period. + * - 18000: Displaced 50% of its period. + * - 27000: Displaced 75% of its period. + * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. + * + * Examples: + * \verbatim + SDL_HAPTIC_SINE + __ __ __ __ + / \ / \ / \ / + / \__/ \__/ \__/ + + SDL_HAPTIC_SQUARE + __ __ __ __ __ + | | | | | | | | | | + | |__| |__| |__| |__| | + + SDL_HAPTIC_TRIANGLE + /\ /\ /\ /\ /\ + / \ / \ / \ / \ / + / \/ \/ \/ \/ + + SDL_HAPTIC_SAWTOOTHUP + /| /| /| /| /| /| /| + / | / | / | / | / | / | / | + / |/ |/ |/ |/ |/ |/ | + + SDL_HAPTIC_SAWTOOTHDOWN + \ |\ |\ |\ |\ |\ |\ | + \ | \ | \ | \ | \ | \ | \ | + \| \| \| \| \| \| \| + \endverbatim + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticPeriodic +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, + ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or + ::SDL_HAPTIC_SAWTOOTHDOWN */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Periodic */ + Uint16 period; /**< Period of the wave. */ + Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ + Sint16 offset; /**< Mean value of the wave. */ + Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticPeriodic; + +/** + * \brief A structure containing a template for a Condition effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SPRING: Effect based on axes position. + * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * + * Direction is handled by condition internals instead of a direction member. + * The condition effect specific members have three parameters. The first + * refers to the X axis, the second refers to the Y axis and the third + * refers to the Z axis. The right terms refer to the positive side of the + * axis and the left terms refer to the negative side of the axis. Please + * refer to the ::SDL_HapticDirection diagram for which side is positive and + * which is negative. + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCondition +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, + ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ + SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Condition */ + Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ + Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ + Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ + Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ + Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ + Sint16 center[3]; /**< Position of the dead zone. */ +} SDL_HapticCondition; + +/** + * \brief A structure containing a template for a Ramp effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * + * The ramp effect starts at start strength and ends at end strength. + * It augments in linear fashion. If you use attack and fade with a ramp + * the effects get added to the ramp effect making the effect become + * quadratic instead of linear. + * + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticRamp +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_RAMP */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Ramp */ + Sint16 start; /**< Beginning strength level. */ + Sint16 end; /**< Ending strength level. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticRamp; + +/** + * \brief A structure containing a template for a Left/Right effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. + * + * The Left/Right effect is used to explicitly control the large and small + * motors, commonly found in modern game controllers. The small (right) motor + * is high frequency, and the large (left) motor is low frequency. + * + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticLeftRight +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ + + /* Replay */ + Uint32 length; /**< Duration of the effect in milliseconds. */ + + /* Rumble */ + Uint16 large_magnitude; /**< Control of the large controller motor. */ + Uint16 small_magnitude; /**< Control of the small controller motor. */ +} SDL_HapticLeftRight; + +/** + * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect. + * + * A custom force feedback effect is much like a periodic effect, where the + * application can define its exact shape. You will have to allocate the + * data yourself. Data should consist of channels * samples Uint16 samples. + * + * If channels is one, the effect is rotated using the defined direction. + * Otherwise it uses the samples in data for the different axes. + * + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCustom +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Custom */ + Uint8 channels; /**< Axes to use, minimum of one. */ + Uint16 period; /**< Sample periods. */ + Uint16 samples; /**< Amount of samples. */ + Uint16 *data; /**< Should contain channels*samples items. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticCustom; + +/** + * \brief The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. + * Time values unless specified otherwise are in milliseconds. + * + * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 + * value. Neither delay, interval, attack_length nor fade_length support + * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * + * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of + * ::SDL_HAPTIC_INFINITY. + * + * Button triggers may not be supported on all devices, it is advised to not + * use them if possible. Buttons start at index 1 instead of index 0 like + * the joystick. + * + * If both attack_length and fade_level are 0, the envelope is not used, + * otherwise both values are used. + * + * Common parts: + * \code + * // Replay - All effects have this + * Uint32 length; // Duration of effect (ms). + * Uint16 delay; // Delay before starting effect. + * + * // Trigger - All effects have this + * Uint16 button; // Button that triggers effect. + * Uint16 interval; // How soon before effect can be triggered again. + * + * // Envelope - All effects except condition effects have this + * Uint16 attack_length; // Duration of the attack (ms). + * Uint16 attack_level; // Level at the start of the attack. + * Uint16 fade_length; // Duration of the fade out (ms). + * Uint16 fade_level; // Level at the end of the fade. + * \endcode + * + * + * Here we have an example of a constant effect evolution in time: + * \verbatim + Strength + ^ + | + | effect level --> _________________ + | / \ + | / \ + | / \ + | / \ + | attack_level --> | \ + | | | <--- fade_level + | + +--------------------------------------------------> Time + [--] [---] + attack_length fade_length + + [------------------][-----------------------] + delay length + \endverbatim + * + * Note either the attack_level or the fade_level may be above the actual + * effect level. + * + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight + * \sa SDL_HapticCustom + */ +typedef union SDL_HapticEffect +{ + /* Common for all force feedback effects */ + Uint16 type; /**< Effect type. */ + SDL_HapticConstant constant; /**< Constant effect. */ + SDL_HapticPeriodic periodic; /**< Periodic effect. */ + SDL_HapticCondition condition; /**< Condition effect. */ + SDL_HapticRamp ramp; /**< Ramp effect. */ + SDL_HapticLeftRight leftright; /**< Left/Right effect. */ + SDL_HapticCustom custom; /**< Custom effect. */ +} SDL_HapticEffect; + + +/* Function prototypes */ +/** + * \brief Count the number of haptic devices attached to the system. + * + * \return Number of haptic devices detected on the system. + */ +extern DECLSPEC int SDLCALL SDL_NumHaptics(void); + +/** + * \brief Get the implementation dependent name of a haptic device. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + * + * \param device_index Index of the device to get its name. + * \return Name of the device or NULL on error. + * + * \sa SDL_NumHaptics + */ +extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); + +/** + * \brief Opens a haptic device for use. + * + * The index passed as an argument refers to the N'th haptic device on this + * system. + * + * When opening a haptic device, its gain will be set to maximum and + * autocenter will be disabled. To modify these values use + * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). + * + * \param device_index Index of the device to open. + * \return Device identifier or NULL on error. + * + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + * \sa SDL_HapticSetGain + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticPause + * \sa SDL_HapticStopAll + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); + +/** + * \brief Checks if the haptic device at index has been opened. + * + * \param device_index Index to check to see if it has been opened. + * \return 1 if it has been opened or 0 if it hasn't. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticIndex + */ +extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); + +/** + * \brief Gets the index of a haptic device. + * + * \param haptic Haptic device to get the index of. + * \return The index of the haptic device or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened + */ +extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); + +/** + * \brief Gets whether or not the current mouse has haptic capabilities. + * + * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. + * + * \sa SDL_HapticOpenFromMouse + */ +extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); + +/** + * \brief Tries to open a haptic device from the current mouse. + * + * \return The haptic device identifier or NULL on error. + * + * \sa SDL_MouseIsHaptic + * \sa SDL_HapticOpen + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); + +/** + * \brief Checks to see if a joystick has haptic features. + * + * \param joystick Joystick to test for haptic capabilities. + * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't + * or -1 if an error occurred. + * + * \sa SDL_HapticOpenFromJoystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); + +/** + * \brief Opens a haptic device for use from a joystick device. + * + * You must still close the haptic device separately. It will not be closed + * with the joystick. + * + * When opening from a joystick you should first close the haptic device before + * closing the joystick device. If not, on some implementations the haptic + * device will also get unallocated and you'll be unable to use force feedback + * on that device. + * + * \param joystick Joystick to create a haptic device from. + * \return A valid haptic device identifier on success or NULL on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticClose + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * + joystick); + +/** + * \brief Closes a haptic device previously opened with SDL_HapticOpen(). + * + * \param haptic Haptic device to close. + */ +extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can store. + * + * On some platforms this isn't fully supported, and therefore is an + * approximation. Always check to see if your created effect was actually + * created and do not rely solely on SDL_HapticNumEffects(). + * + * \param haptic The haptic device to query effect max. + * \return The number of effects the haptic device can store or + * -1 on error. + * + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can play at the same + * time. + * + * This is not supported on all platforms, but will always return a value. + * Added here for the sake of completeness. + * + * \param haptic The haptic device to query maximum playing effects. + * \return The number of effects the haptic device can play at the same time + * or -1 on error. + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); + +/** + * \brief Gets the haptic device's supported features in bitwise manner. + * + * Example: + * \code + * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { + * printf("We have constant haptic effect!\n"); + * } + * \endcode + * + * \param haptic The haptic device to query. + * \return Haptic features in bitwise manner (OR'd). + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticEffectSupported + */ +extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); + + +/** + * \brief Gets the number of haptic axes the device has. + * + * \sa SDL_HapticDirection + */ +extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); + +/** + * \brief Checks to see if effect is supported by haptic. + * + * \param haptic Haptic device to check on. + * \param effect Effect to check to see if it is supported. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticQuery + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, + SDL_HapticEffect * + effect); + +/** + * \brief Creates a new haptic effect on the device. + * + * \param haptic Haptic device to create the effect on. + * \param effect Properties of the effect to create. + * \return The identifier of the effect on success or -1 on error. + * + * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, + SDL_HapticEffect * effect); + +/** + * \brief Updates the properties of an effect. + * + * Can be used dynamically, although behavior when dynamically changing + * direction may be strange. Specifically the effect may reupload itself + * and start playing from the start. You cannot change the type either when + * running SDL_HapticUpdateEffect(). + * + * \param haptic Haptic device that has the effect. + * \param effect Identifier of the effect to update. + * \param data New effect properties to use. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, + int effect, + SDL_HapticEffect * data); + +/** + * \brief Runs the haptic effect on its associated haptic device. + * + * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over + * repeating the envelope (attack and fade) every time. If you only want the + * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length + * parameter. + * + * \param haptic Haptic device to run the effect on. + * \param effect Identifier of the haptic effect to run. + * \param iterations Number of iterations to run the effect. Use + * ::SDL_HAPTIC_INFINITY for infinity. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticStopEffect + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus + */ +extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, + int effect, + Uint32 iterations); + +/** + * \brief Stops the haptic effect on its associated haptic device. + * + * \param haptic Haptic device to stop the effect on. + * \param effect Identifier of the effect to stop. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Destroys a haptic effect on the device. + * + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. + * + * \param haptic Device to destroy the effect on. + * \param effect Identifier of the effect to destroy. + * + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Gets the status of the current effect on the haptic device. + * + * Device must support the ::SDL_HAPTIC_STATUS feature. + * + * \param haptic Haptic device to query the effect status on. + * \param effect Identifier of the effect to query its status. + * \return 0 if it isn't playing, 1 if it is playing or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, + int effect); + +/** + * \brief Sets the global gain of the device. + * + * Device must support the ::SDL_HAPTIC_GAIN feature. + * + * The user may specify the maximum gain by setting the environment variable + * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the + * maximum. + * + * \param haptic Haptic device to set the gain on. + * \param gain Value to set the gain to, should be between 0 and 100. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); + +/** + * \brief Sets the global autocenter of the device. + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. + * + * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. + * + * \param haptic Haptic device to set autocentering on. + * \param autocenter Value to set autocenter to, 0 disables autocentering. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, + int autocenter); + +/** + * \brief Pauses a haptic device. + * + * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * SDL_HapticUnpause() to resume playback. + * + * Do not modify the effects nor add new ones while the device is paused. + * That can cause all sorts of weird errors. + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticUnpause + */ +extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); + +/** + * \brief Unpauses a haptic device. + * + * Call to unpause after SDL_HapticPause(). + * + * \param haptic Haptic device to unpause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticPause + */ +extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); + +/** + * \brief Stops all the currently playing effects on a haptic device. + * + * \param haptic Haptic device to stop. + * \return 0 on success or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); + +/** + * \brief Checks to see if rumble is supported on a haptic device. + * + * \param haptic Haptic device to check to see if it supports rumble. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); + +/** + * \brief Initializes the haptic device for simple rumble playback. + * + * \param haptic Haptic device to initialize for simple rumble playback. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); + +/** + * \brief Runs simple rumble on a haptic device + * + * \param haptic Haptic device to play rumble effect on. + * \param strength Strength of the rumble to play as a 0-1 float value. + * \param length Length of the rumble to play in milliseconds. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); + +/** + * \brief Stops the simple rumble on a haptic device. + * + * \param haptic Haptic to stop the rumble on. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_haptic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_hints.h b/Windows/SDL2/include/SDL2/SDL_hints.h new file mode 100644 index 00000000..a3a53738 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_hints.h @@ -0,0 +1,1364 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_hints.h + * + * Official documentation for SDL configuration variables + * + * This file contains functions to set and get configuration hints, + * as well as listing each of them alphabetically. + * + * The convention for naming hints is SDL_HINT_X, where "SDL_X" is + * the environment variable that can be used to override the default. + * + * In general these hints are just that - they may or may not be + * supported or applicable on any given platform, but they provide + * a way for an application or user to give the library a hint as + * to how they would like the library to work. + */ + +#ifndef SDL_hints_h_ +#define SDL_hints_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. + * + * SDL can try to accelerate the SDL screen surface by using streaming + * textures with a 3D rendering engine. This variable controls whether and + * how this is done. + * + * This variable can be set to the following values: + * "0" - Disable 3D acceleration + * "1" - Enable 3D acceleration, using the default renderer. + * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) + * + * By default SDL tries to make a best guess for each platform whether + * to use acceleration or not. + */ +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" + +/** + * \brief A variable specifying which render driver to use. + * + * If the application doesn't pick a specific renderer to use, this variable + * specifies the name of the preferred renderer. If the preferred renderer + * can't be initialized, the normal default renderer is used. + * + * This variable is case insensitive and can be set to the following values: + * "direct3d" + * "opengl" + * "opengles2" + * "opengles" + * "metal" + * "software" + * + * The default varies by platform, but it's the first one in the list that + * is available on the current platform. + */ +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" + +/** + * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. + * + * This variable can be set to the following values: + * "0" - Disable shaders + * "1" - Enable shaders + * + * By default shaders are used if OpenGL supports them. + */ +#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" + +/** + * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. + * + * This variable can be set to the following values: + * "0" - Thread-safety is not enabled (faster) + * "1" - Thread-safety is enabled + * + * By default the Direct3D device is created with thread-safety disabled. + */ +#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" + +/** + * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. + * + * This variable does not have any effect on the Direct3D 9 based renderer. + * + * This variable can be set to the following values: + * "0" - Disable Debug Layer use + * "1" - Enable Debug Layer use + * + * By default, SDL does not use Direct3D Debug Layer. + */ +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" + +/** + * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize. + * + * This variable can be set to the following values: + * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen + * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen + * + * By default letterbox is used + */ +#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE" + +/** + * \brief A variable controlling the scaling quality + * + * This variable can be set to the following values: + * "0" or "nearest" - Nearest pixel sampling + * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) + * "2" or "best" - Currently this is the same as "linear" + * + * By default nearest pixel sampling is used + */ +#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" + +/** + * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. + * + * This variable can be set to the following values: + * "0" - Disable vsync + * "1" - Enable vsync + * + * By default SDL does not sync screen surface updates with vertical refresh. + */ +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" + +/** + * \brief A variable controlling whether the screensaver is enabled. + * + * This variable can be set to the following values: + * "0" - Disable screensaver + * "1" - Enable screensaver + * + * By default SDL will disable the screensaver. + */ +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" + +/** + * \brief A variable controlling whether the graphics context is externally managed. + * + * This variable can be set to the following values: + * "0" - SDL will manage graphics contexts that are attached to windows. + * "1" - Disable graphics context management on windows. + * + * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the + * context will be automatically saved and restored when pausing the application. Additionally, some + * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this + * behavior, which is desireable when the application manages the graphics context, such as + * an externally managed OpenGL context or attaching a Vulkan surface to the window. + */ +#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" + +/** + * \brief A variable controlling whether the X11 VidMode extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XVidMode + * "1" - Enable XVidMode + * + * By default SDL will use XVidMode if it is available. + */ +#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" + +/** + * \brief A variable controlling whether the X11 Xinerama extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable Xinerama + * "1" - Enable Xinerama + * + * By default SDL will use Xinerama if it is available. + */ +#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" + +/** + * \brief A variable controlling whether the X11 XRandR extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XRandR + * "1" - Enable XRandR + * + * By default SDL will not use XRandR because of window manager issues. + */ +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * \brief A variable forcing the visual ID chosen for new X11 windows + * + */ +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" + +/** + * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. + * + * This variable can be set to the following values: + * "0" - Disable _NET_WM_PING + * "1" - Enable _NET_WM_PING + * + * By default SDL will use _NET_WM_PING, but for applications that know they + * will not always be able to respond to ping requests in a timely manner they can + * turn it off to avoid the window manager thinking the app is hung. + * The hint is checked in CreateWindow. + */ +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. + * + * This variable can be set to the following values: + * "0" - Disable _NET_WM_BYPASS_COMPOSITOR + * "1" - Enable _NET_WM_BYPASS_COMPOSITOR + * + * By default SDL will use _NET_WM_BYPASS_COMPOSITOR + * + */ +#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" + +/** + * \brief A variable controlling whether X11 should use GLX or EGL by default + * + * This variable can be set to the following values: + * "0" - Use GLX + * "1" - Use EGL + * + * By default SDL will use GLX when both are present. + */ +#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL" + +/** + * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden + * + * This variable can be set to the following values: + * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) + * "1" - The window frame is interactive when the cursor is hidden + * + * By default SDL will allow interaction with the window frame when the cursor is hidden + */ +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" + +/** + * \brief A variable to specify custom icon resource id from RC file on Windows platform + */ +#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON" +#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" + +/** + * \brief A variable controlling whether the windows message loop is processed by SDL + * + * This variable can be set to the following values: + * "0" - The window message loop is not run + * "1" - The window message loop is processed in SDL_PumpEvents() + * + * By default SDL will process the windows message loop + */ +#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" + +/** + * \brief A variable controlling whether grabbing input grabs the keyboard + * + * This variable can be set to the following values: + * "0" - Grab will affect only the mouse + * "1" - Grab will affect mouse and keyboard + * + * By default SDL will not grab the keyboard so system shortcuts still work. + */ +#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" + +/** + * \brief A variable setting the double click time, in milliseconds. + */ +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" + +/** + * \brief A variable setting the double click radius, in pixels. + */ +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" + +/** + * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode + */ +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" + +/** + * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode + */ +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" + +/** + * \brief A variable controlling whether relative mouse mode is implemented using mouse warping + * + * This variable can be set to the following values: + * "0" - Relative mouse mode uses raw input + * "1" - Relative mouse mode uses mouse warping + * + * By default SDL will use raw input for relative mouse mode + */ +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" + +/** + * \brief Allow mouse click events when clicking to focus an SDL window + * + * This variable can be set to the following values: + * "0" - Ignore mouse clicks that activate a window + * "1" - Generate events for mouse clicks that activate a window + * + * By default SDL will ignore mouse clicks that activate a window + */ +#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH" + +/** + * \brief A variable controlling whether touch events should generate synthetic mouse events + * + * This variable can be set to the following values: + * "0" - Touch events will not generate mouse events + * "1" - Touch events will generate mouse events + * + * By default SDL will generate mouse events for touch events + */ +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" + +/** + * \brief A variable controlling whether mouse events should generate synthetic touch events + * + * This variable can be set to the following values: + * "0" - Mouse events will not generate touch events (default for desktop platforms) + * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS) + */ + +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. + * + */ +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * \brief A variable controlling whether the idle timer is disabled on iOS. + * + * When an iOS app does not receive touches for some time, the screen is + * dimmed automatically. For games where the accelerometer is the only input + * this is problematic. This functionality can be disabled by setting this + * hint. + * + * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() + * accomplish the same thing on iOS. They should be preferred over this hint. + * + * This variable can be set to the following values: + * "0" - Enable idle timer + * "1" - Disable idle timer + */ +#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" + +/** + * \brief A variable controlling which orientations are allowed on iOS/Android. + * + * In some circumstances it is necessary to be able to explicitly control + * which UI orientations are allowed. + * + * This variable is a space delimited list of the following values: + * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" + */ +#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" + +/** + * \brief A variable controlling whether controllers used with the Apple TV + * generate UI events. + * + * When UI events are generated by controller input, the app will be + * backgrounded when the Apple TV remote's menu button is pressed, and when the + * pause or B buttons on gamepads are pressed. + * + * More information about properly making use of controllers for the Apple TV + * can be found here: + * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/ + * + * This variable can be set to the following values: + * "0" - Controller input does not generate UI events (the default). + * "1" - Controller input generates UI events. + */ +#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" + +/** + * \brief A variable controlling whether the Apple TV remote's joystick axes + * will automatically match the rotation of the remote. + * + * This variable can be set to the following values: + * "0" - Remote orientation does not affect joystick axes (the default). + * "1" - Joystick axes are based on the orientation of the remote. + */ +#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" + +/** + * \brief A variable controlling whether the home indicator bar on iPhone X + * should be hidden. + * + * This variable can be set to the following values: + * "0" - The indicator bar is not hidden (default for windowed applications) + * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) + * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications) + */ +#define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" + +/** + * \brief A variable controlling whether the Android / iOS built-in + * accelerometer should be listed as a joystick device. + * + * This variable can be set to the following values: + * "0" - The accelerometer is not listed as a joystick + * "1" - The accelerometer is available as a 3 axis joystick (the default). + */ +#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" + +/** + * \brief A variable controlling whether the Android / tvOS remotes + * should be listed as joystick devices, instead of sending keyboard events. + * + * This variable can be set to the following values: + * "0" - Remotes send enter/escape/arrow key events + * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). + */ +#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" + +/** + * \brief A variable that lets you disable the detection and use of Xinput gamepad devices + * + * The variable can be set to the following values: + * "0" - Disable XInput detection (only uses direct input) + * "1" - Enable XInput detection (the default) + */ +#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" + +/** + * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. + * + * This hint is for backwards compatibility only and will be removed in SDL 2.1 + * + * The default value is "0". This hint must be set before SDL_Init() + */ +#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" + +/** + * \brief A variable that overrides the automatic controller type detection + * + * The variable should be comma separated entries, in the form: VID/PID=type + * + * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd + * + * The type should be one of: + * Xbox360 + * XboxOne + * PS3 + * PS4 + * SwitchPro + * + * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + */ +#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE" + +/** + * \brief A variable that lets you manually hint extra gamecontroller db entries. + * + * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" + +/** + * \brief A variable that lets you provide a file with extra gamecontroller db entries. + * + * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE" + +/** + * \brief A variable containing a list of devices to skip when scanning for game controllers. + * + * The format of the string is a comma separated list of USB VID/PID pairs + * in hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named + * file will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES" + +/** + * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable. + * + * The format of the string is a comma separated list of USB VID/PID pairs + * in hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named + * file will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" + +/** + * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout. + * + * For example, on Nintendo Switch controllers, normally you'd get: + * + * (Y) + * (X) (B) + * (A) + * + * but if this hint is set, you'll get: + * + * (X) + * (Y) (A) + * (B) + * + * The variable can be set to the following values: + * "0" - Report the face buttons by position, as though they were on an Xbox controller. + * "1" - Report the face buttons by label instead of position + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" + +/** + * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. + * + * The variable can be set to the following values: + * "0" - Disable joystick & gamecontroller input events when the + * application is in the background. + * "1" - Enable joystick & gamecontroller input events when the + * application is in the background. + * + * The default value is "0". This hint may be set at any time. + */ +#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" + +/** + * \brief A variable controlling whether the HIDAPI joystick drivers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI drivers are not used + * "1" - HIDAPI drivers are used (the default) + * + * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. + */ +#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" + +/** + * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" + +/** + * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. + * + * This variable can be set to the following values: + * "0" - extended reports are not enabled (the default) + * "1" - extended reports + * + * Extended input reports allow rumble on Bluetooth PS4 controllers, but + * break DirectInput handling for applications that don't use SDL. + * + * Once extended reports are enabled, they can not be disabled without + * power cycling the controller. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" + +/** + * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" + +/** + * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" + +/** + * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs + * + * The variable can be set to the following values: + * "0" - Do not scan for Steam Controllers + * "1" - Scan for Steam Controllers (the default) + * + * The default value is "1". This hint must be set before initializing the joystick subsystem. + */ +#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" + + +/** + * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. + * This is a debugging aid for developers and not expected to be used by end users. The default is "1" + * + * This variable can be set to the following values: + * "0" - don't allow topmost + * "1" - allow topmost + */ +#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" + +/** + * \brief A variable that controls the timer resolution, in milliseconds. + * + * The higher resolution the timer, the more frequently the CPU services + * timer interrupts, and the more precise delays are, but this takes up + * power and CPU time. This hint is only used on Windows 7 and earlier. + * + * See this blog post for more information: + * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ + * + * If this variable is set to "0", the system timer resolution is not set. + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" + + +/** + * \brief A variable describing the content orientation on QtWayland-based platforms. + * + * On QtWayland platforms, windows are rotated client-side to allow for custom + * transitions. In order to correctly position overlays (e.g. volume bar) and + * gestures (e.g. events view, close/minimize gestures), the system needs to + * know in which orientation the application is currently drawing its contents. + * + * This does not cause the window to be rotated or resized, the application + * needs to take care of drawing the content in the right orientation (the + * framebuffer is always in portrait mode). + * + * This variable can be one of the following values: + * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape" + */ +#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION" + +/** + * \brief Flags to set on QtWayland windows to integrate with the native window manager. + * + * On QtWayland platforms, this hint controls the flags to set on the windows. + * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures. + * + * This variable is a space-separated list of the following values (empty = no flags): + * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager" + */ +#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS" + +/** +* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size +* +* Use this hint in case you need to set SDL's threads stack size to other than the default. +* This is specially useful if you build SDL against a non glibc libc library (such as musl) which +* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). +* Support for this hint is currently available only in the pthread, Windows, and PSP backend. +* +* Instead of this hint, in 2.0.9 and later, you can use +* SDL_CreateThreadWithStackSize(). This hint only works with the classic +* SDL_CreateThread(). +*/ +#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" + +/** + * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) + */ +#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" + +/** + * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac + * + * If present, holding ctrl while left clicking will generate a right click + * event when on Mac. + */ +#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" + +/** +* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries +* +* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It +* can use two different sets of binaries, those compiled by the user from source +* or those provided by the Chrome browser. In the later case, these binaries require +* that SDL loads a DLL providing the shader compiler. +* +* This variable can be set to the following values: +* "d3dcompiler_46.dll" - default, best for Vista or later. +* "d3dcompiler_43.dll" - for XP support. +* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. +* +*/ +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" + +/** +* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). +* +* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has +* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly +* created SDL_Window: +* +* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is +* needed for example when sharing an OpenGL context across multiple windows. +* +* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for +* OpenGL rendering. +* +* This variable can be set to the following values: +* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should +* share a pixel format with. +*/ +#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" + +/** + * \brief A URL to a WinRT app's privacy policy + * + * All network-enabled WinRT apps must make a privacy policy available to its + * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be + * be available in the Windows Settings charm, as accessed from within the app. + * SDL provides code to add a URL-based link there, which can point to the app's + * privacy policy. + * + * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL + * before calling any SDL_Init() functions. The contents of the hint should + * be a valid URL. For example, "http://www.example.com". + * + * The default value is "", which will prevent SDL from adding a privacy policy + * link to the Settings charm. This hint should only be set during app init. + * + * The label text of an app's "Privacy Policy" link may be customized via another + * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * + * Please note that on Windows Phone, Microsoft does not provide standard UI + * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL + * will not get used on that platform. Network-enabled phone apps should display + * their privacy policy through some other, in-app means. + */ +#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" + +/** \brief Label text for a WinRT app's privacy policy link + * + * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, + * Microsoft mandates that this policy be available via the Windows Settings charm. + * SDL provides code to add a link there, with its label text being set via the + * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * + * Please note that a privacy policy's contents are not set via this hint. A separate + * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the + * policy. + * + * The contents of this hint should be encoded as a UTF8 string. + * + * The default value is "Privacy Policy". This hint should only be set during app + * initialization, preferably before any calls to SDL_Init(). + * + * For additional information on linking to a privacy policy, see the documentation for + * SDL_HINT_WINRT_PRIVACY_POLICY_URL. + */ +#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" + +/** \brief Allows back-button-press events on Windows Phone to be marked as handled + * + * Windows Phone devices typically feature a Back button. When pressed, + * the OS will emit back-button-press events, which apps are expected to + * handle in an appropriate manner. If apps do not explicitly mark these + * events as 'Handled', then the OS will invoke its default behavior for + * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to + * terminate the app (and attempt to switch to the previous app, or to the + * device's home screen). + * + * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL + * to mark back-button-press events as Handled, if and when one is sent to + * the app. + * + * Internally, Windows Phone sends back button events as parameters to + * special back-button-press callback functions. Apps that need to respond + * to back-button-press events are expected to register one or more + * callback functions for such, shortly after being launched (during the + * app's initialization phase). After the back button is pressed, the OS + * will invoke these callbacks. If the app's callback(s) do not explicitly + * mark the event as handled by the time they return, or if the app never + * registers one of these callback, the OS will consider the event + * un-handled, and it will apply its default back button behavior (terminate + * the app). + * + * SDL registers its own back-button-press callback with the Windows Phone + * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN + * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which + * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. + * If the hint's value is set to "1", the back button event's Handled + * property will get set to 'true'. If the hint's value is set to something + * else, or if it is unset, SDL will leave the event's Handled property + * alone. (By default, the OS sets this property to 'false', to note.) + * + * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a + * back button is pressed, or can set it in direct-response to a back button + * being pressed. + * + * In order to get notified when a back button is pressed, SDL apps should + * register a callback function with SDL_AddEventWatch(), and have it listen + * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. + * (Alternatively, SDL_KEYUP events can be listened-for. Listening for + * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON + * set by such a callback, will be applied to the OS' current + * back-button-press event. + * + * More details on back button behavior in Windows Phone apps can be found + * at the following page, on Microsoft's developer site: + * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx + */ +#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" + +/** + * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. + * + * This hint only applies to Mac OS X. + * + * The variable can be set to the following values: + * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and + * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" + * button on their titlebars). + * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and + * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" + * button on their titlebars). + * + * The default value is "1". Spaces are disabled regardless of this hint if + * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before + * any windows are created. + */ +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" + +/** +* \brief When set don't force the SDL app to become a foreground process +* +* This hint only applies to Mac OS X. +* +*/ +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" + +/** + * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. + */ +#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" + +/** + * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. + */ +#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" + +/** + * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. + * + * The variable can be set to the following values: + * "0" - SDL_TEXTEDITING events are sent, and it is the application's + * responsibility to render the text from these events and + * differentiate it somehow from committed text. (default) + * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, + * and text that is being composed will be rendered in its own UI. + */ +#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" + +/** + * \brief A variable to control whether we trap the Android back button to handle it manually. + * This is necessary for the right mouse button to work on some Android devices, or + * to be able to trap the back button for use in your code reliably. If set to true, + * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of + * SDL_SCANCODE_AC_BACK. + * + * The variable can be set to the following values: + * "0" - Back button will be handled as usual for system. (default) + * "1" - Back button will be trapped, allowing you to handle the key press + * manually. (This will also let right mouse click work on systems + * where the right mouse button functions as back.) + * + * The value of this hint is used at runtime, so it can be changed at any time. + */ +#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" + +/** + * \brief A variable to control whether the event loop will block itself when the app is paused. + * + * The variable can be set to the following values: + * "0" - Non blocking. + * "1" - Blocking. (default) + * + * The value should be set before SDL is initialized. + */ +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" + + /** + * \brief A variable to control whether the return key on the soft keyboard + * should hide the soft keyboard on Android and iOS. + * + * The variable can be set to the following values: + * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) + * "1" - The return key will hide the keyboard. + * + * The value of this hint is used at runtime, so it can be changed at any time. + */ +#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" + +/** + * \brief override the binding element for keyboard inputs for Emscripten builds + * + * This hint only applies to the emscripten platform + * + * The variable can be one of + * "#window" - The javascript window object (this is the default) + * "#document" - The javascript document object + * "#screen" - the javascript window.screen object + * "#canvas" - the WebGL canvas element + * any other string without a leading # sign applies to the element on the page with that ID. + */ +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" + +/** + * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. + * + * This hint only applies to Unix-like platforms. + * + * The variable can be set to the following values: + * "0" - SDL will install a SIGINT and SIGTERM handler, and when it + * catches a signal, convert it into an SDL_QUIT event. + * "1" - SDL will not install a signal handler at all. + */ +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. + * + * The variable can be set to the following values: + * "0" - SDL will generate a window-close event when it sees Alt+F4. + * "1" - SDL will only do normal key handling for Alt+F4. + */ +#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" + +/** + * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. + * + * The bitmap header version 4 is required for proper alpha channel support and + * SDL will use it when required. Should this not be desired, this hint can + * force the use of the 40 byte header version which is supported everywhere. + * + * The variable can be set to the following values: + * "0" - Surfaces with a colorkey or an alpha channel are saved to a + * 32-bit BMP file with an alpha mask. SDL will use the bitmap + * header version 4 and set the alpha mask accordingly. + * "1" - Surfaces with a colorkey or an alpha channel are saved to a + * 32-bit BMP file without an alpha mask. The alpha channel data + * will be in the file, but applications are going to ignore it. + * + * The default value is "0". + */ +#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT" + +/** + * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception. + * The 0x406D1388 Exception is a trick used to inform Visual Studio of a + * thread's name, but it tends to cause problems with other debuggers, + * and the .NET runtime. Note that SDL 2.0.6 and later will still use + * the (safer) SetThreadDescription API, introduced in the Windows 10 + * Creators Update, if available. + * + * The variable can be set to the following values: + * "0" - SDL will raise the 0x406D1388 Exception to name threads. + * This is the default behavior of SDL <= 2.0.4. + * "1" - SDL will not raise this exception, and threads will be unnamed. (default) + * This is necessary with .NET languages or debuggers that aren't Visual Studio. + */ +#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" + +/** + * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI + * + * Also known as Z-order. The variable can take a negative or positive value. + * The default is 10000. + */ +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" + +/** + * \brief Tell the video driver that we only want a double buffer. + * + * By default, most lowlevel 2D APIs will use a triple buffer scheme that + * wastes no CPU time on waiting for vsync after issuing a flip, but + * introduces a frame of latency. On the other hand, using a double buffer + * scheme instead is recommended for cases where low latency is an important + * factor because we save a whole frame of latency. + * We do so by waiting for vsync immediately after issuing a flip, usually just + * after eglSwapBuffers call in the backend's *_SwapWindow function. + * + * Since it's driver-specific, it's only supported where possible and + * implemented. Currently supported the following drivers: + * - KMSDRM (kmsdrm) + * - Raspberry Pi (raspberrypi) + */ +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" + +/** + * \brief A variable controlling what driver to use for OpenGL ES contexts. + * + * On some platforms, currently Windows and X11, OpenGL drivers may support + * creating contexts with an OpenGL ES profile. By default SDL uses these + * profiles, when available, otherwise it attempts to load an OpenGL ES + * library, e.g. that provided by the ANGLE project. This variable controls + * whether SDL follows this default behaviour or will always load an + * OpenGL ES library. + * + * Circumstances where this is useful include + * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, + * or emulator, e.g. those from ARM, Imagination or Qualcomm. + * - Resolving OpenGL ES function addresses at link time by linking with + * the OpenGL ES library instead of querying them at run time with + * SDL_GL_GetProcAddress(). + * + * Caution: for an application to work with the default behaviour across + * different OpenGL drivers it must query the OpenGL ES function + * addresses at run time using SDL_GL_GetProcAddress(). + * + * This variable is ignored on most platforms because OpenGL ES is native + * or not supported. + * + * This variable can be set to the following values: + * "0" - Use ES profile of OpenGL, if available. (Default when not set.) + * "1" - Load OpenGL ES library using the default library names. + * + */ +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" + +/** + * \brief A variable controlling speed/quality tradeoff of audio resampling. + * + * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) + * to handle audio resampling. There are different resampling modes available + * that produce different levels of quality, using more CPU. + * + * If this hint isn't specified to a valid setting, or libsamplerate isn't + * available, SDL will use the default, internal resampling algorithm. + * + * Note that this is currently only applicable to resampling audio that is + * being written to a device for playback or audio being read from a device + * for capture. SDL_AudioCVT always uses the default resampler (although this + * might change for SDL 2.1). + * + * This hint is currently only checked at audio subsystem initialization. + * + * This variable can be set to the following values: + * + * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast) + * "1" or "fast" - Use fast, slightly higher quality resampling, if available + * "2" or "medium" - Use medium quality resampling, if available + * "3" or "best" - Use high quality resampling, if available + */ +#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE" + +/** + * \brief A variable controlling the audio category on iOS and Mac OS X + * + * This variable can be set to the following values: + * + * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default) + * "playback" - Use the AVAudioSessionCategoryPlayback category + * + * For more information, see Apple's documentation: + * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html + */ +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * \brief A variable controlling whether the 2D render API is compatible or efficient. + * + * This variable can be set to the following values: + * + * "0" - Don't use batching to make rendering more efficient. + * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls. + * + * Up to SDL 2.0.9, the render API would draw immediately when requested. Now + * it batches up draw requests and sends them all to the GPU only when forced + * to (during SDL_RenderPresent, when changing render targets, by updating a + * texture that the batch needs, etc). This is significantly more efficient, + * but it can cause problems for apps that expect to render on top of the + * render API's output. As such, SDL will disable batching if a specific + * render backend is requested (since this might indicate that the app is + * planning to use the underlying graphics API directly). This hint can + * be used to explicitly request batching in this instance. It is a contract + * that you will either never use the underlying graphics API directly, or + * if you do, you will call SDL_RenderFlush() before you do so any current + * batch goes to the GPU before your work begins. Not following this contract + * will result in undefined behavior. + */ +#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" + + +/** + * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. + * + * This variable can be set to the following values: + * + * "0" - Don't log any events (default) + * "1" - Log all events except mouse and finger motion, which are pretty spammy. + * "2" - Log all events. + * + * This is generally meant to be used to debug SDL itself, but can be useful + * for application developers that need better visibility into what is going + * on in the event queue. Logged events are sent through SDL_Log(), which + * means by default they appear on stdout on most platforms or maybe + * OutputDebugString() on Windows, and can be funneled by the app with + * SDL_LogSetOutputFunction(), etc. + * + * This hint can be toggled on and off at runtime, if you only need to log + * events for a small subset of program execution. + */ +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" + + + +/** + * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file. + * + * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE + * file) is not always reliable. In case the size is wrong, it's possible to + * just ignore it and step through the chunks until a fixed limit is reached. + * + * Note that files that have trailing data unrelated to the WAVE file or + * corrupt files may slow down the loading process without a reliable boundary. + * By default, SDL stops after 10000 chunks to prevent wasting time. Use the + * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * + * This variable can be set to the following values: + * + * "force" - Always use the RIFF chunk size as a boundary for the chunk search + * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default) + * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB + * "maximum" - Search for chunks until the end of file (not recommended) + */ +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" + +/** + * \brief Controls how a truncated WAVE file is handled. + * + * A WAVE file is considered truncated if any of the chunks are incomplete or + * the data chunk size is not a multiple of the block size. By default, SDL + * decodes until the first incomplete block, as most applications seem to do. + * + * This variable can be set to the following values: + * + * "verystrict" - Raise an error if the file is truncated + * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored + * "dropframe" - Decode until the first incomplete sample frame + * "dropblock" - Decode until the first incomplete block (default) + */ +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" + +/** + * \brief Controls how the fact chunk affects the loading of a WAVE file. + * + * The fact chunk stores information about the number of samples of a WAVE + * file. The Standards Update from Microsoft notes that this value can be used + * to 'determine the length of the data in seconds'. This is especially useful + * for compressed formats (for which this is a mandatory chunk) if they produce + * multiple sample frames per block and truncating the block is not allowed. + * The fact chunk can exactly specify how many sample frames there should be + * in this case. + * + * Unfortunately, most application seem to ignore the fact chunk and so SDL + * ignores it by default as well. + * + * This variable can be set to the following values: + * + * "truncate" - Use the number of samples to truncate the wave data if + * the fact chunk is present and valid + * "strict" - Like "truncate", but raise an error if the fact chunk + * is invalid, not present for non-PCM formats, or if the + * data chunk doesn't have that many samples + * "ignorezero" - Like "truncate", but ignore fact chunk if the number of + * samples is zero + * "ignore" - Ignore fact chunk entirely (default) + */ +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/* + * \brief Override for SDL_GetDisplayUsableBounds() + * + * If set, this hint will override the expected results for + * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want + * to do this, but this allows an embedded system to request that some of the + * screen be reserved for other uses when paired with a well-behaved + * application. + * + * The contents of this hint must be 4 comma-separated integers, the first + * is the bounds x, then y, width and height, in that order. + */ +#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" + +/** + * \brief An enumeration of hint priorities + */ +typedef enum +{ + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE +} SDL_HintPriority; + + +/** + * \brief Set a hint with a specific priority + * + * The priority controls the behavior when setting a hint that already + * has a value. Hints will replace existing hints of their priority and + * lower. Environment variables are considered to have override priority. + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, + const char *value, + SDL_HintPriority priority); + +/** + * \brief Set a hint with normal priority + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, + const char *value); + +/** + * \brief Get a hint + * + * \return The string value of a hint variable. + */ +extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); + +/** + * \brief Get a hint + * + * \return The boolean value of a hint variable. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); + +/** + * \brief type definition of the hint callback function. + */ +typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); + +/** + * \brief Add a function to watch a particular hint + * + * \param name The hint to watch + * \param callback The function to call when the hint value changes + * \param userdata A pointer to pass to the callback function + */ +extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Remove a function watching a particular hint + * + * \param name The hint being watched + * \param callback The function being called when the hint value changes + * \param userdata A pointer being passed to the callback function + */ +extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Clear all hints + * + * This function is called during SDL_Quit() to free stored hints. + */ +extern DECLSPEC void SDLCALL SDL_ClearHints(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_hints_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_joystick.h b/Windows/SDL2/include/SDL2/SDL_joystick.h new file mode 100644 index 00000000..a0dd7205 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_joystick.h @@ -0,0 +1,418 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_joystick.h + * + * Include file for SDL joystick event handling + * + * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick + * behind a device_index changing as joysticks are plugged and unplugged. + * + * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted + * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. + * + * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of + * the device (a X360 wired controller for example). This identifier is platform dependent. + * + * + */ + +#ifndef SDL_joystick_h_ +#define SDL_joystick_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_joystick.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + * + * If you would like to receive joystick updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/** + * The joystick structure used to identify an SDL joystick + */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* A structure that encodes the stable unique id for a joystick device */ +typedef struct { + Uint8 data[16]; +} SDL_JoystickGUID; + +/** + * This is a unique ID for a joystick for the time it is connected to the system, + * and is never reused for the lifetime of the application. If the joystick is + * disconnected and reconnected, it will get a new ID. + * + * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. + */ +typedef Sint32 SDL_JoystickID; + +typedef enum +{ + SDL_JOYSTICK_TYPE_UNKNOWN, + SDL_JOYSTICK_TYPE_GAMECONTROLLER, + SDL_JOYSTICK_TYPE_WHEEL, + SDL_JOYSTICK_TYPE_ARCADE_STICK, + SDL_JOYSTICK_TYPE_FLIGHT_STICK, + SDL_JOYSTICK_TYPE_DANCE_PAD, + SDL_JOYSTICK_TYPE_GUITAR, + SDL_JOYSTICK_TYPE_DRUM_KIT, + SDL_JOYSTICK_TYPE_ARCADE_PAD, + SDL_JOYSTICK_TYPE_THROTTLE +} SDL_JoystickType; + +typedef enum +{ + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */ + SDL_JOYSTICK_POWER_LOW, /* <= 20% */ + SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */ + SDL_JOYSTICK_POWER_FULL, /* <= 100% */ + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX +} SDL_JoystickPowerLevel; + +/* Function prototypes */ + +/** + * Locking for multi-threaded access to the joystick API + * + * If you are using the joystick API or handling events from multiple threads + * you should use these locking functions to protect access to the joysticks. + * + * In particular, you are guaranteed that the joystick list won't change, so + * the API functions that take a joystick index will be valid, and joystick + * and game controller events will not be delivered. + */ +extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); +extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); + +/** + * Count the number of joysticks attached to the system right now + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); + +/** + * Get the player index of a joystick, or -1 if it's not available + * This can be called before any joysticks are opened. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); + +/** + * Return the GUID for the joystick at this index + * This can be called before any joysticks are opened. + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); + +/** + * Get the USB vendor ID of a joystick, if available. + * This can be called before any joysticks are opened. + * If the vendor ID isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); + +/** + * Get the USB product ID of a joystick, if available. + * This can be called before any joysticks are opened. + * If the product ID isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); + +/** + * Get the product version of a joystick, if available. + * This can be called before any joysticks are opened. + * If the product version isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index); + +/** + * Get the type of a joystick, if available. + * This can be called before any joysticks are opened. + */ +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index); + +/** + * Get the instance ID of a joystick. + * This can be called before any joysticks are opened. + * If the index is out of range, this function will return -1. + */ +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index); + +/** + * Open a joystick for use. + * The index passed as an argument refers to the N'th joystick on the system. + * This index is not the value which will identify this joystick in future + * joystick events. The joystick's instance id (::SDL_JoystickID) will be used + * there instead. + * + * \return A joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Return the SDL_Joystick associated with an instance id. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); + +/** + * Return the SDL_Joystick associated with a player index. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); + +/** + * Return the name for this currently opened joystick. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); + +/** + * Get the player index of an opened joystick, or -1 if it's not available + * + * For XInput controllers this returns the XInput user index. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); + +/** + * Set the player index of an opened joystick + */ +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); + +/** + * Return the GUID for this opened joystick + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); + +/** + * Get the USB vendor ID of an opened joystick, if available. + * If the vendor ID isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); + +/** + * Get the USB product ID of an opened joystick, if available. + * If the product ID isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); + +/** + * Get the product version of an opened joystick, if available. + * If the product version isn't available this function returns 0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); + +/** + * Get the type of an opened joystick. + */ +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); + +/** + * Return a string representation for this guid. pszGUID must point to at least 33 bytes + * (32 for the string plus a NULL terminator). + */ +extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); + +/** + * Convert a string into a joystick guid + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); + +/** + * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); + +/** + * Get the instance ID of an opened joystick or -1 if the joystick is invalid. + */ +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); + +/** + * Get the number of general axis controls on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); + +/** + * Get the number of trackballs on a joystick. + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); + +/** + * Get the number of POV hats on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); + +/** + * Get the number of buttons on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +#define SDL_JOYSTICK_AXIS_MAX 32767 +#define SDL_JOYSTICK_AXIS_MIN -32768 +/** + * Get the current state of an axis control on a joystick. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, + int axis); + +/** + * Get the initial state of an axis control on a joystick. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + * + * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, + int axis, Sint16 *state); + +/** + * \name Hat positions + */ +/* @{ */ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/* @} */ + +/** + * Get the current state of a POV hat on a joystick. + * + * The hat indices start at index 0. + * + * \return The return value is one of the following positions: + * - ::SDL_HAT_CENTERED + * - ::SDL_HAT_UP + * - ::SDL_HAT_RIGHT + * - ::SDL_HAT_DOWN + * - ::SDL_HAT_LEFT + * - ::SDL_HAT_RIGHTUP + * - ::SDL_HAT_RIGHTDOWN + * - ::SDL_HAT_LEFTUP + * - ::SDL_HAT_LEFTDOWN + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, + int hat); + +/** + * Get the ball axis change since the last poll. + * + * \return 0, or -1 if you passed it invalid parameters. + * + * The ball indices start at index 0. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, + int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, + int button); + +/** + * Trigger a rumble effect + * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param joystick The joystick to vibrate + * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF + * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if rumble isn't supported on this joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** + * Close a joystick previously opened with SDL_JoystickOpen(). + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); + +/** + * Return the battery level of this joystick + */ +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_joystick_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_keyboard.h b/Windows/SDL2/include/SDL2/SDL_keyboard.h new file mode 100644 index 00000000..f6853c64 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_keyboard.h @@ -0,0 +1,217 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keyboard.h + * + * Include file for SDL keyboard event handling + */ + +#ifndef SDL_keyboard_h_ +#define SDL_keyboard_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keycode.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The SDL keysym structure, used in key events. + * + * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. + */ +typedef struct SDL_Keysym +{ + SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ + SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ + Uint16 mod; /**< current key modifiers */ + Uint32 unused; +} SDL_Keysym; + +/* Function prototypes */ + +/** + * \brief Get the window which currently has keyboard focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); + +/** + * \brief Get a snapshot of the current state of the keyboard. + * + * \param numkeys if non-NULL, receives the length of the returned array. + * + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. + * + * \b Example: + * \code + * const Uint8 *state = SDL_GetKeyboardState(NULL); + * if ( state[SDL_SCANCODE_RETURN] ) { + * printf("<RETURN> is pressed.\n"); + * } + * \endcode + */ +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); + +/** + * \brief Get the current key modifier state for the keyboard. + */ +extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); + +/** + * \brief Set the current key modifier state for the keyboard. + * + * \note This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); + +/** + * \brief Get the key code corresponding to the given scancode according + * to the current keyboard layout. + * + * See ::SDL_Keycode for details. + * + * \sa SDL_GetKeyName() + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); + +/** + * \brief Get the scancode corresponding to the given key code according to the + * current keyboard layout. + * + * See ::SDL_Scancode for details. + * + * \sa SDL_GetScancodeName() + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); + +/** + * \brief Get a human-readable name for a scancode. + * + * \return A pointer to the name for the scancode. + * If the scancode doesn't have a name, this function returns + * an empty string (""). + * + * \sa SDL_Scancode + */ +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); + +/** + * \brief Get a scancode from a human-readable name + * + * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Scancode + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); + +/** + * \brief Get a human-readable name for a key. + * + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the key doesn't have a name, this function returns an + * empty string (""). + * + * \sa SDL_Keycode + */ +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); + +/** + * \brief Get a key code from a human-readable name + * + * \return key code, or SDLK_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Keycode + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); + +/** + * \brief Start accepting Unicode text input events. + * This function will show the on-screen keyboard if supported. + * + * \sa SDL_StopTextInput() + * \sa SDL_SetTextInputRect() + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC void SDLCALL SDL_StartTextInput(void); + +/** + * \brief Return whether or not Unicode text input events are enabled. + * + * \sa SDL_StartTextInput() + * \sa SDL_StopTextInput() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); + +/** + * \brief Stop receiving any text input events. + * This function will hide the on-screen keyboard if supported. + * + * \sa SDL_StartTextInput() + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC void SDLCALL SDL_StopTextInput(void); + +/** + * \brief Set the rectangle used to type Unicode text inputs. + * This is used as a hint for IME and on-screen keyboard placement. + * + * \sa SDL_StartTextInput() + */ +extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); + +/** + * \brief Returns whether the platform has some screen keyboard support. + * + * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. + * + * \note Not all screen keyboard functions are supported on all platforms. + * + * \sa SDL_IsScreenKeyboardShown() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); + +/** + * \brief Returns whether the screen keyboard is shown for given window. + * + * \param window The window for which screen keyboard should be queried. + * + * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. + * + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_keyboard_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_keycode.h b/Windows/SDL2/include/SDL2/SDL_keycode.h new file mode 100644 index 00000000..a1ce7a44 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_keycode.h @@ -0,0 +1,349 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keycode.h + * + * Defines constants which identify keyboard keys and modifiers. + */ + +#ifndef SDL_keycode_h_ +#define SDL_keycode_h_ + +#include "SDL_stdinc.h" +#include "SDL_scancode.h" + +/** + * \brief The SDL virtual key representation. + * + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or + * an SDLK_* constant for those keys that do not generate characters. + * + * A special exception is the number keys at the top of the keyboard which + * always map to SDLK_0...SDLK_9, regardless of layout. + */ +typedef Sint32 SDL_Keycode; + +#define SDLK_SCANCODE_MASK (1<<30) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) + +typedef enum +{ + SDLK_UNKNOWN = 0, + + SDLK_RETURN = '\r', + SDLK_ESCAPE = '\033', + SDLK_BACKSPACE = '\b', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), + + SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), + SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), + SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), + SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), + SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), + SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), + SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), + SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), + SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), + SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), + SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), + SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), + + SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), + SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), + SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), + SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), + SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), + SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), + SDLK_DELETE = '\177', + SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), + SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), + SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), + SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), + SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), + SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), + + SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), + SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), + SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), + SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), + SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), + SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), + SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), + SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), + SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), + SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), + SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), + SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), + SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), + SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), + SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), + SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), + SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), + + SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), + SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), + SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), + SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), + SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), + SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), + SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), + SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), + SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), + SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), + SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), + SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), + SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), + SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), + SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), + SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), + SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), + SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), + SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), + SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), + SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), + SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), + SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), + SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), + SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), + SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), + SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), + SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), + SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), + SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), + SDLK_KP_EQUALSAS400 = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), + + SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), + SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), + SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), + SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), + SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), + SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), + SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), + SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), + SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), + SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), + SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), + SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), + + SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), + SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), + SDLK_THOUSANDSSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), + SDLK_DECIMALSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), + SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), + SDLK_CURRENCYSUBUNIT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), + SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), + SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), + SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), + SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), + SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), + SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), + SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), + SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), + SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), + SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), + SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), + SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), + SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), + SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), + SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), + SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), + SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), + SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), + SDLK_KP_DBLAMPERSAND = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), + SDLK_KP_VERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), + SDLK_KP_DBLVERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), + SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), + SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), + SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), + SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), + SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), + SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), + SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), + SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), + SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), + SDLK_KP_MEMSUBTRACT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), + SDLK_KP_MEMMULTIPLY = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), + SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), + SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), + SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), + SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), + SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), + SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), + SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), + SDLK_KP_HEXADECIMAL = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), + + SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), + SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), + SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), + SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), + SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), + SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), + SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), + SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), + + SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), + + SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), + SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), + SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), + SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), + SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), + SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), + SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), + SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), + SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), + SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), + SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), + SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), + SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), + SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), + SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), + SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), + SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), + + SDLK_BRIGHTNESSDOWN = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), + SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), + SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), + SDLK_KBDILLUMTOGGLE = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), + SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), + SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), + SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), + SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP), + SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1), + SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2), + + SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND), + SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD) +} SDL_KeyCode; + +/** + * \brief Enumeration of valid key mods (possibly OR'd together). + */ +typedef enum +{ + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDL_Keymod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + +#endif /* SDL_keycode_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_loadso.h b/Windows/SDL2/include/SDL2/SDL_loadso.h new file mode 100644 index 00000000..89578a9f --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_loadso.h @@ -0,0 +1,81 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_loadso.h + * + * System dependent library loading routines + * + * Some things to keep in mind: + * \li These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * \li Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * \li Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + +#ifndef SDL_loadso_h_ +#define SDL_loadso_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, + const char *name); + +/** + * Unload a shared object from memory. + */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_loadso_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_log.h b/Windows/SDL2/include/SDL2/SDL_log.h new file mode 100644 index 00000000..c1751fd7 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_log.h @@ -0,0 +1,211 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_log.h + * + * Simple log messages with categories and priorities. + * + * By default logs are quiet, but if you're debugging SDL you might want: + * + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + * + * Here's where the messages go on different platforms: + * Windows: debug output stream + * Android: log output + * Others: standard error output (stderr) + */ + +#ifndef SDL_log_h_ +#define SDL_log_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \brief The maximum size of a log message + * + * Messages longer than the maximum size will be truncated + */ +#define SDL_MAX_LOG_MESSAGE 4096 + +/** + * \brief The predefined log categories + * + * By default the application category is enabled at the INFO level, + * the assert category is enabled at the WARN level, test is enabled + * at the VERBOSE level and all other categories are enabled at the + * CRITICAL level. + */ +typedef enum +{ + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + + /* Reserved for future SDL library use */ + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + + /* Beyond this point is reserved for application use, e.g. + enum { + MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, + MYAPP_CATEGORY_AWESOME2, + MYAPP_CATEGORY_AWESOME3, + ... + }; + */ + SDL_LOG_CATEGORY_CUSTOM +} SDL_LogCategory; + +/** + * \brief The predefined log priorities + */ +typedef enum +{ + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES +} SDL_LogPriority; + + +/** + * \brief Set the priority of all log categories + */ +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); + +/** + * \brief Set the priority of a particular log category + */ +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, + SDL_LogPriority priority); + +/** + * \brief Get the priority of a particular log category + */ +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); + +/** + * \brief Reset all priorities to default. + * + * \note This is called in SDL_Quit(). + */ +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); + +/** + * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE + */ +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_DEBUG + */ +extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_WARN + */ +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_ERROR + */ +extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL + */ +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessage(int category, + SDL_LogPriority priority, + SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, + SDL_LogPriority priority, + const char *fmt, va_list ap); + +/** + * \brief The prototype for the log output function + */ +typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); + +/** + * \brief Get the current log output function. + */ +extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); + +/** + * \brief This function allows you to replace the default log output + * function with one of your own. + */ +extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_log_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_main.h b/Windows/SDL2/include/SDL2/SDL_main.h new file mode 100644 index 00000000..fcb5c17d --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_main.h @@ -0,0 +1,180 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_main_h_ +#define SDL_main_h_ + +#include "SDL_stdinc.h" + +/** + * \file SDL_main.h + * + * Redefine main() on some platforms so that it is called by SDL. + */ + +#ifndef SDL_MAIN_HANDLED +#if defined(__WIN32__) +/* On Windows SDL provides WinMain(), which parses the command line and passes + the arguments to your main function. + + If you provide your own WinMain(), you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE + +#elif defined(__WINRT__) +/* On WinRT, SDL provides a main function that initializes CoreApplication, + creating an instance of IFrameworkView in the process. + + Please note that #include'ing SDL_main.h is not enough to get a main() + function working. In non-XAML apps, the file, + src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled + into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be + called, with a pointer to the Direct3D-hosted XAML control passed in. +*/ +#define SDL_MAIN_NEEDED + +#elif defined(__IPHONEOS__) +/* On iOS SDL provides a main function that creates an application delegate + and starts the iOS application run loop. + + If you link with SDL dynamically on iOS, the main function can't be in a + shared library, so you need to link with libSDLmain.a, which includes a + stub main function that calls into the shared library to start execution. + + See src/video/uikit/SDL_uikitappdelegate.m for more details. + */ +#define SDL_MAIN_NEEDED + +#elif defined(__ANDROID__) +/* On Android SDL provides a Java class in SDLActivity.java that is the + main activity entry point. + + See docs/README-android.md for more details on extending that class. + */ +#define SDL_MAIN_NEEDED + +/* We need to export SDL_main so it can be launched from Java */ +#define SDLMAIN_DECLSPEC DECLSPEC + +#elif defined(__NACL__) +/* On NACL we use ppapi_simple to set up the application helper code, + then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before + starting the user main function. + All user code is run in a separate thread by ppapi_simple, thus + allowing for blocking io to take place via nacl_io +*/ +#define SDL_MAIN_NEEDED + +#endif +#endif /* SDL_MAIN_HANDLED */ + +#ifndef SDLMAIN_DECLSPEC +#define SDLMAIN_DECLSPEC +#endif + +/** + * \file SDL_main.h + * + * The application's main() function must be called with C linkage, + * and should be declared like this: + * \code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * \endcode + */ + +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) +#define main SDL_main +#endif + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The prototype for the application's main() function + */ +typedef int (*SDL_main_func)(int argc, char *argv[]); +extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); + + +/** + * This is called by the real SDL main function to let the rest of the + * library know that initialization was done properly. + * + * Calling this yourself without knowing what you're doing can cause + * crashes and hard to diagnose problems with your application. + */ +extern DECLSPEC void SDLCALL SDL_SetMainReady(void); + +#ifdef __WIN32__ + +/** + * This can be called to set the application class at startup + */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); + +#endif /* __WIN32__ */ + + +#ifdef __WINRT__ + +/** + * \brief Initializes and launches an SDL/WinRT application. + * + * \param mainFunction The SDL app's C-style main(). + * \param reserved Reserved for future use; should be NULL + * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more + * information on the failure. + */ +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); + +#endif /* __WINRT__ */ + +#if defined(__IPHONEOS__) + +/** + * \brief Initializes and launches an SDL application. + * + * \param argc The argc parameter from the application's main() function + * \param argv The argv parameter from the application's main() function + * \param mainFunction The SDL app's C-style main(). + * \return the return value from mainFunction + */ +extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); + +#endif /* __IPHONEOS__ */ + + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_main_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_messagebox.h b/Windows/SDL2/include/SDL2/SDL_messagebox.h new file mode 100644 index 00000000..03639ce4 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_messagebox.h @@ -0,0 +1,146 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_messagebox_h_ +#define SDL_messagebox_h_ + +#include "SDL_stdinc.h" +#include "SDL_video.h" /* For SDL_Window */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief SDL_MessageBox flags. If supported will display warning icon, etc. + */ +typedef enum +{ + SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ + SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ + SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */ + SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */ + SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */ +} SDL_MessageBoxFlags; + +/** + * \brief Flags for SDL_MessageBoxButtonData. + */ +typedef enum +{ + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ +} SDL_MessageBoxButtonFlags; + +/** + * \brief Individual button data. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ + int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ + const char * text; /**< The UTF-8 button text */ +} SDL_MessageBoxButtonData; + +/** + * \brief RGB value used in a message box color scheme + */ +typedef struct +{ + Uint8 r, g, b; +} SDL_MessageBoxColor; + +typedef enum +{ + SDL_MESSAGEBOX_COLOR_BACKGROUND, + SDL_MESSAGEBOX_COLOR_TEXT, + SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, + SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, + SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, + SDL_MESSAGEBOX_COLOR_MAX +} SDL_MessageBoxColorType; + +/** + * \brief A set of colors to use for message box dialogs + */ +typedef struct +{ + SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; +} SDL_MessageBoxColorScheme; + +/** + * \brief MessageBox structure containing title, text, window, etc. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxFlags */ + SDL_Window *window; /**< Parent window, can be NULL */ + const char *title; /**< UTF-8 title */ + const char *message; /**< UTF-8 message text */ + + int numbuttons; + const SDL_MessageBoxButtonData *buttons; + + const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ +} SDL_MessageBoxData; + +/** + * \brief Create a modal message box. + * + * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. + * \param buttonid The pointer to which user id of hit button should be copied. + * + * \return -1 on error, otherwise 0 and buttonid contains user id of button + * hit or -1 if dialog was closed. + * + * \note This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or + * closes the messagebox. + */ +extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); + +/** + * \brief Create a simple modal message box + * + * \param flags ::SDL_MessageBoxFlags + * \param title UTF-8 title text + * \param message UTF-8 message text + * \param window The parent window, or NULL for no parent + * + * \return 0 on success, -1 on error + * + * \sa SDL_ShowMessageBox + */ +extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_messagebox_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_metal.h b/Windows/SDL2/include/SDL2/SDL_metal.h new file mode 100644 index 00000000..3b7eb18a --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_metal.h @@ -0,0 +1,91 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_metal.h + * + * Header file for functions to creating Metal layers and views on SDL windows. + */ + +#ifndef SDL_metal_h_ +#define SDL_metal_h_ + +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). + * + * \note This can be cast directly to an NSView or UIView. + */ +typedef void *SDL_MetalView; + +/** + * \name Metal support functions + */ +/* @{ */ + +/** + * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the + * specified window. + * + * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its + * own. It is up to user code to do that. + * + * The returned handle can be casted directly to a NSView or UIView, and the + * CAMetalLayer can be accessed from the view's 'layer' property. + * + * \code + * SDL_MetalView metalview = SDL_Metal_CreateView(window); + * UIView *uiview = (__bridge UIView *)metalview; + * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; + * // [...] + * SDL_Metal_DestroyView(metalview); + * \endcode + * + * \sa SDL_Metal_DestroyView + */ +extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); + +/** + * \brief Destroy an existing SDL_MetalView object. + * + * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was + * called after SDL_CreateWindow. + * + * \sa SDL_Metal_CreateView + */ +extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); + +/* @} *//* Metal support functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_metal_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_mouse.h b/Windows/SDL2/include/SDL2/SDL_mouse.h new file mode 100644 index 00000000..99b658e9 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_mouse.h @@ -0,0 +1,302 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_mouse.h + * + * Include file for SDL mouse event handling. + */ + +#ifndef SDL_mouse_h_ +#define SDL_mouse_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ + +/** + * \brief Cursor types for SDL_CreateSystemCursor(). + */ +typedef enum +{ + SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ + SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ + SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ + SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ + SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ + SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ + SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ + SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ + SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ + SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ + SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ + SDL_SYSTEM_CURSOR_HAND, /**< Hand */ + SDL_NUM_SYSTEM_CURSORS +} SDL_SystemCursor; + +/** + * \brief Scroll direction types for the Scroll event + */ +typedef enum +{ + SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ + SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ +} SDL_MouseWheelDirection; + +/* Function prototypes */ + +/** + * \brief Get the window which currently has mouse focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); + +/** + * \brief Retrieve the current state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse cursor position relative to the focus window for the currently + * selected mouse. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * \brief Get the current state of the mouse, in relation to the desktop + * + * This works just like SDL_GetMouseState(), but the coordinates will be + * reported relative to the top-left of the desktop. This can be useful if + * you need to track the mouse outside of a specific window and + * SDL_CaptureMouse() doesn't fit your needs. For example, it could be + * useful if you need to track the mouse while dragging a window, where + * coordinates relative to a window might not be in sync at all times. + * + * \note SDL_GetMouseState() returns the mouse position as SDL understands + * it from the last pump of the event queue. This function, however, + * queries the OS for the current mouse position, and as such, might + * be a slightly less efficient function. Unless you know what you're + * doing and have a good reason to use this function, you probably want + * SDL_GetMouseState() instead. + * + * \param x Returns the current X coord, relative to the desktop. Can be NULL. + * \param y Returns the current Y coord, relative to the desktop. Can be NULL. + * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros. + * + * \sa SDL_GetMouseState + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); + +/** + * \brief Retrieve the relative state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * \brief Moves the mouse to the given position within the window. + * + * \param window The window to move the mouse into, or NULL for the current mouse focus + * \param x The x coordinate within the window + * \param y The y coordinate within the window + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, + int x, int y); + +/** + * \brief Moves the mouse to the given position in global screen space. + * + * \param x The x coordinate + * \param y The y coordinate + * \return 0 on success, -1 on error (usually: unsupported by a platform). + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); + +/** + * \brief Set relative mouse mode. + * + * \param enabled Whether or not to enable relative mode + * + * \return 0 on success, or -1 if relative mode is not supported. + * + * While the mouse is in relative mode, the cursor is hidden, and the + * driver will try to report continuous motion in the current window. + * Only relative motion events will be delivered, the mouse position + * will not change. + * + * \note This function will flush any pending mouse motion. + * + * \sa SDL_GetRelativeMouseMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); + +/** + * \brief Capture the mouse, to track input outside an SDL window. + * + * \param enabled Whether or not to enable capturing + * + * Capturing enables your app to obtain mouse events globally, instead of + * just within your window. Not all video targets support this function. + * When capturing is enabled, the current window will get all mouse events, + * but unlike relative mode, no change is made to the cursor and it is + * not restrained to your window. + * + * This function may also deny mouse input to other windows--both those in + * your application and others on the system--so you should use this + * function sparingly, and in small bursts. For example, you might want to + * track the mouse while the user is dragging something, until the user + * releases a mouse button. It is not recommended that you capture the mouse + * for long periods of time, such as the entire time your app is running. + * + * While captured, mouse events still report coordinates relative to the + * current (foreground) window, but those coordinates may be outside the + * bounds of the window (including negative values). Capturing is only + * allowed for the foreground window. If the window loses focus while + * capturing, the capture will be disabled automatically. + * + * While capturing is enabled, the current window will have the + * SDL_WINDOW_MOUSE_CAPTURE flag set. + * + * \return 0 on success, or -1 if not supported. + */ +extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); + +/** + * \brief Query whether relative mouse mode is enabled. + * + * \sa SDL_SetRelativeMouseMode() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); + +/** + * \brief Create a cursor, using the specified bitmap data and + * mask (in MSB format). + * + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * <table> + * <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr> + * <tr><td> 0 </td><td> 1 </td><td> White </td></tr> + * <tr><td> 1 </td><td> 1 </td><td> Black </td></tr> + * <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr> + * <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black + * if not. </td></tr> + * </table> + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, + const Uint8 * mask, + int w, int h, int hot_x, + int hot_y); + +/** + * \brief Create a color cursor. + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, + int hot_x, + int hot_y); + +/** + * \brief Create a system cursor. + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); + +/** + * \brief Set the active cursor. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); + +/** + * \brief Return the active cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); + +/** + * \brief Return the default cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); + +/** + * \brief Frees a cursor created with SDL_CreateCursor() or similar functions. + * + * \sa SDL_CreateCursor() + * \sa SDL_CreateColorCursor() + * \sa SDL_CreateSystemCursor() + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); + +/** + * \brief Toggle whether or not the cursor is shown. + * + * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current + * state. + * + * \return 1 if the cursor is shown, or 0 if the cursor is hidden. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/** + * Used as a mask when testing buttons in buttonstate. + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_mouse_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_mutex.h b/Windows/SDL2/include/SDL2/SDL_mutex.h new file mode 100644 index 00000000..3c5b9557 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_mutex.h @@ -0,0 +1,251 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_mutex_h_ +#define SDL_mutex_h_ + +/** + * \file SDL_mutex.h + * + * Functions to provide thread synchronization primitives. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** + * This is the timeout value which corresponds to never time out. + */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/** + * \name Mutex functions + */ +/* @{ */ + +/* The SDL mutex structure, defined in SDL_sysmutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** + * Create a mutex, initialized unlocked. + */ +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); + +/** + * Lock the mutex. + * + * \return 0, or -1 on error. + */ +#define SDL_mutexP(m) SDL_LockMutex(m) +extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); + +/** + * Try to lock the mutex + * + * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); + +/** + * Unlock the mutex. + * + * \return 0, or -1 on error. + * + * \warning It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +#define SDL_mutexV(m) SDL_UnlockMutex(m) +extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); + +/** + * Destroy a mutex. + */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); + +/* @} *//* Mutex functions */ + + +/** + * \name Semaphore functions + */ +/* @{ */ + +/* The SDL semaphore structure, defined in SDL_syssem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** + * Create a semaphore, initialized with value, returns NULL on failure. + */ +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** + * Destroy a semaphore. + */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by \c sem has a positive count. It then atomically decreases the + * semaphore count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); + +/** + * Non-blocking variant of SDL_SemWait(). + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would + * block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); + +/** + * Variant of SDL_SemWait() with a timeout in milliseconds. + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not + * succeed in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); + +/** + * Atomically increases the semaphore's count (not blocking). + * + * \return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); + +/** + * Returns the current count of the semaphore. + */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); + +/* @} *//* Semaphore functions */ + + +/** + * \name Condition variable functions + */ +/* @{ */ + +/* The SDL condition variable structure, defined in SDL_syscond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; + +/** + * Create a condition variable. + * + * Typical use of condition variables: + * + * Thread A: + * SDL_LockMutex(lock); + * while ( ! condition ) { + * SDL_CondWait(cond, lock); + * } + * SDL_UnlockMutex(lock); + * + * Thread B: + * SDL_LockMutex(lock); + * ... + * condition = true; + * ... + * SDL_CondSignal(cond); + * SDL_UnlockMutex(lock); + * + * There is some discussion whether to signal the condition variable + * with the mutex locked or not. There is some potential performance + * benefit to unlocking first on some platforms, but there are some + * potential race conditions depending on how your code is structured. + * + * In general it's safer to signal the condition variable while the + * mutex is locked. + */ +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); + +/** + * Destroy a condition variable. + */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); + +/** + * Restart one of the threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); + +/** + * Restart all threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); + +/** + * Wait on the condition variable, unlocking the provided mutex. + * + * \warning The mutex must be locked before entering this function! + * + * The mutex is re-locked once the condition variable is signaled. + * + * \return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); + +/** + * Waits for at most \c ms milliseconds, and returns 0 if the condition + * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, + SDL_mutex * mutex, Uint32 ms); + +/* @} *//* Condition variable functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_mutex_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_name.h b/Windows/SDL2/include/SDL2/SDL_name.h new file mode 100644 index 00000000..a49c4887 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_name.h @@ -0,0 +1,33 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDLname_h_ +#define SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* SDLname_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_opengl.h b/Windows/SDL2/include/SDL2/SDL_opengl.h new file mode 100644 index 00000000..5cd302cd --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_opengl.h @@ -0,0 +1,2183 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengl.h + * + * This is a simple file to encapsulate the OpenGL API headers. + */ + +/** + * \def NO_SDL_GLEXT + * + * Define this if you have your own version of glext.h and want to disable the + * version included in SDL_opengl.h. + */ + +#ifndef SDL_opengl_h_ +#define SDL_opengl_h_ + +#include "SDL_config.h" + +#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ + +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef __gl_h_ +#define __gl_h_ + +#if defined(USE_MGL_NAMESPACE) +#include "gl_mangle.h" +#endif + + +/********************************************************************** + * Begin system-specific stuff. + */ + +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) +#define __WIN32__ +#endif + +#if defined(__WIN32__) && !defined(__CYGWIN__) +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ +# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ +# define GLAPIENTRY +# else +# define GLAPIENTRY __stdcall +# endif +#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ +# define GLAPI extern +# define GLAPIENTRY __stdcall +#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */ +# define GLAPI extern +# define GLAPIENTRY _System +# define APIENTRY _System +# if defined(__GNUC__) && !defined(_System) +# define _System +# endif +#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define GLAPI __attribute__((visibility("default"))) +# define GLAPIENTRY +#endif /* WIN32 && !CYGWIN */ + +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX /* don't define min() and max(). */ +#define NOMINMAX +#endif +#include <windows.h> +#endif + +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif + +/* "P" suffix to be used for a pointer to a function */ +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export on +#endif + +/* + * End system-specific stuff. + **********************************************************************/ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_ARB_imaging 1 + + +/* + * Datatypes + */ +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ + + + +/* + * Constants + */ + +/* Boolean values */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* Data types */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A + +/* Primitives */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 + +/* Vertex Arrays */ +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D + +/* Matrix Mode */ +#define GL_MATRIX_MODE 0x0BA0 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* Points */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_POINT_SIZE_RANGE 0x0B12 + +/* Lines */ +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_WIDTH_RANGE 0x0B22 + +/* Polygons */ +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 + +/* Display Lists */ +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_LIST_MODE 0x0B30 + +/* Depth buffer */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_BITS 0x0D56 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_COMPONENT 0x1902 + +/* Lighting */ +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_SHININESS 0x1601 +#define GL_EMISSION 0x1600 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_SHADE_MODEL 0x0B54 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_NORMALIZE 0x0BA1 + +/* User clipping planes */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* Accumulation buffer */ +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_ACCUM 0x0100 +#define GL_ADD 0x0104 +#define GL_LOAD 0x0101 +#define GL_MULT 0x0103 +#define GL_RETURN 0x0102 + +/* Alpha testing */ +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_ALPHA_TEST_FUNC 0x0BC1 + +/* Blending */ +#define GL_BLEND 0x0BE2 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND_DST 0x0BE0 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 + +/* Render Mode */ +#define GL_FEEDBACK 0x1C01 +#define GL_RENDER 0x1C00 +#define GL_SELECT 0x1C02 + +/* Feedback */ +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 + +/* Selection */ +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 + +/* Fog */ +#define GL_FOG 0x0B60 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_COLOR 0x0B66 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_LINEAR 0x2601 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* Logic Ops */ +#define GL_LOGIC_OP 0x0BF1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_CLEAR 0x1500 +#define GL_SET 0x150F +#define GL_COPY 0x1503 +#define GL_COPY_INVERTED 0x150C +#define GL_NOOP 0x1505 +#define GL_INVERT 0x150A +#define GL_AND 0x1501 +#define GL_NAND 0x150E +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_XOR 0x1506 +#define GL_EQUIV 0x1509 +#define GL_AND_REVERSE 0x1502 +#define GL_AND_INVERTED 0x1504 +#define GL_OR_REVERSE 0x150B +#define GL_OR_INVERTED 0x150D + +/* Stencil */ +#define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_INDEX 0x1901 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 + +/* Buffers, Pixel Drawing/Reading */ +#define GL_NONE 0 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +/*GL_FRONT 0x0404 */ +/*GL_BACK 0x0405 */ +/*GL_FRONT_AND_BACK 0x0408 */ +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_COLOR_INDEX 0x1900 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_ALPHA_BITS 0x0D55 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_INDEX_BITS 0x0D51 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_READ_BUFFER 0x0C02 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_BITMAP 0x1A00 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_DITHER 0x0BD0 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 + +/* Implementation limits */ +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B + +/* Gets */ +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_MODE 0x0C30 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_RENDER_MODE 0x0C40 +#define GL_RGBA_MODE 0x0C31 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_VIEWPORT 0x0BA2 + +/* Evaluators */ +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 + +/* Hints */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* Scissor box */ +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 + +/* Pixel Mode / Transfer */ +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 + +/* Texture mapping */ +#define GL_TEXTURE_ENV 0x2300 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_LINEAR 0x2400 +#define GL_EYE_PLANE 0x2502 +#define GL_SPHERE_MAP 0x2402 +#define GL_DECAL 0x2101 +#define GL_MODULATE 0x2100 +#define GL_NEAREST 0x2600 +#define GL_REPEAT 0x2901 +#define GL_CLAMP 0x2900 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 + +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +/* OpenGL 1.1 */ +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + + + +/* + * Miscellaneous + */ + +GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); + +GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glClear( GLbitfield mask ); + +GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); + +GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); + +GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); + +GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); + +GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); + +GLAPI void GLAPIENTRY glCullFace( GLenum mode ); + +GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); + +GLAPI void GLAPIENTRY glPointSize( GLfloat size ); + +GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); + +GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); + +GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); + +GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); + +GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); + +GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); + +GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); + +GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); + +GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); + +GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); + +GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glEnable( GLenum cap ); + +GLAPI void GLAPIENTRY glDisable( GLenum cap ); + +GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); + + +GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ + +GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ + + +GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); + +GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); + +GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); + +GLAPI void GLAPIENTRY glPopAttrib( void ); + + +GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ + +GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ + + +GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); + +GLAPI GLenum GLAPIENTRY glGetError( void ); + +GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); + +GLAPI void GLAPIENTRY glFinish( void ); + +GLAPI void GLAPIENTRY glFlush( void ); + +GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); + + +/* + * Depth Buffer + */ + +GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); + +GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); + +GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); + +GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); + + +/* + * Accumulation Buffer + */ + +GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); + +GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); + + +/* + * Transformation + */ + +GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); + +GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, + GLsizei width, GLsizei height ); + +GLAPI void GLAPIENTRY glPushMatrix( void ); + +GLAPI void GLAPIENTRY glPopMatrix( void ); + +GLAPI void GLAPIENTRY glLoadIdentity( void ); + +GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glRotated( GLdouble angle, + GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRotatef( GLfloat angle, + GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + + +/* + * Display Lists + */ + +GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); + +GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); + +GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); + +GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); + +GLAPI void GLAPIENTRY glEndList( void ); + +GLAPI void GLAPIENTRY glCallList( GLuint list ); + +GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, + const GLvoid *lists ); + +GLAPI void GLAPIENTRY glListBase( GLuint base ); + + +/* + * Drawing Functions + */ + +GLAPI void GLAPIENTRY glBegin( GLenum mode ); + +GLAPI void GLAPIENTRY glEnd( void ); + + +GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); + +GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); +GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glIndexd( GLdouble c ); +GLAPI void GLAPIENTRY glIndexf( GLfloat c ); +GLAPI void GLAPIENTRY glIndexi( GLint c ); +GLAPI void GLAPIENTRY glIndexs( GLshort c ); +GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); +GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); +GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); +GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); +GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); + +GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, + GLbyte blue, GLbyte alpha ); +GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, + GLdouble blue, GLdouble alpha ); +GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, + GLint blue, GLint alpha ); +GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, + GLshort blue, GLshort alpha ); +GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ); +GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, + GLuint blue, GLuint alpha ); +GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, + GLushort blue, GLushort alpha ); + + +GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); + +GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); + + +GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); +GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); +GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); +GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); + +GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); +GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); + + +GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); + + +/* + * Vertex Arrays (1.1) + */ + +GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); + +GLAPI void GLAPIENTRY glArrayElement( GLint i ); + +GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); + +GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ); + +/* + * Lighting + */ + +GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); + +GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, + GLfloat *params ); +GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); + + +/* + * Raster functions + */ + +GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); + +GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, + const GLfloat *values ); +GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, + const GLuint *values ); +GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, + const GLushort *values ); + +GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); + +GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ); + +GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + +GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type ); + +/* + * Stenciling + */ + +GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); + +GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); + +GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); + +GLAPI void GLAPIENTRY glClearStencil( GLint s ); + + + +/* + * Texture mapping + */ + +GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, + GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, + GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, + GLvoid *pixels ); + + +/* 1.1 functions */ + +GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); + + +GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, + GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height ); + + +/* + * Evaluators + */ + +GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, + GLint stride, + GLint order, const GLdouble *points ); +GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, + GLint stride, + GLint order, const GLfloat *points ); + +GLAPI void GLAPIENTRY glMap2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ); +GLAPI void GLAPIENTRY glMap2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ); + +GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); +GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); +GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); + +GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); +GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); + +GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); +GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); + +GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); + +GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ); +GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ); + +GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); + +GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); + +GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); + +GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + + +/* + * Fog + */ + +GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); + +GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); + +GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); + + +/* + * Selection and Feedback + */ + +GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); + +GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); + +GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); + +GLAPI void GLAPIENTRY glInitNames( void ); + +GLAPI void GLAPIENTRY glLoadName( GLuint name ); + +GLAPI void GLAPIENTRY glPushName( GLuint name ); + +GLAPI void GLAPIENTRY glPopName( void ); + + + +/* + * OpenGL 1.2 + */ + +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, + GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLint x, + GLint y, GLsizei width, + GLsizei height ); + +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + + +/* + * GL_ARB_imaging + */ + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + + +GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, + GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTable( GLenum target, + GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ); + +GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, + const GLint *params); + +GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat *params); + +GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); + +GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, + GLenum internalformat, GLboolean sink ); + +GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); + +GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, + GLenum format, GLenum type, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, + GLboolean sink ); + +GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); + +GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, + GLenum format, GLenum types, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, + GLenum internalformat, GLsizei width, GLenum format, GLenum type, + const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, + GLfloat params ); + +GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); + +GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, + GLint params ); + +GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width, + GLsizei height); + +GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, + GLenum type, GLvoid *image ); + +GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *row, const GLvoid *column ); + +GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, + GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + + + + +/* + * OpenGL 1.3 + */ + +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D + +GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); + +GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); + + +GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); + + +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); + + + +/* + * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + +/* + * Define this token if you want "old-style" header file behaviour (extensions + * defined in gl.h). Otherwise, extensions will be included from glext.h. + */ +#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) +#include "SDL_opengl_glext.h" +#endif /* GL_GLEXT_LEGACY */ + + + +/* + * ???. GL_MESA_packed_depth_stencil + * XXX obsolete + */ +#ifndef GL_MESA_packed_depth_stencil +#define GL_MESA_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_MESA 0x8750 +#define GL_UNSIGNED_INT_24_8_MESA 0x8751 +#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 +#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 +#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +#endif /* GL_MESA_packed_depth_stencil */ + + +#ifndef GL_ATI_blend_equation_separate +#define GL_ATI_blend_equation_separate 1 + +#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D + +GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); + +#endif /* GL_ATI_blend_equation_separate */ + + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + + +/** + ** NOTE!!!!! If you add new functions to this file, or update + ** glext.h be sure to regenerate the gl_mangle.h file. See comments + ** in that file for details. + **/ + + + +/********************************************************************** + * Begin system-specific stuff + */ +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export off +#endif + +/* + * End system-specific stuff + **********************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ + +#endif /* !__IPHONEOS__ */ + +#endif /* SDL_opengl_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl_glext.h b/Windows/SDL2/include/SDL2/SDL_opengl_glext.h similarity index 100% rename from MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl_glext.h rename to Windows/SDL2/include/SDL2/SDL_opengl_glext.h diff --git a/Windows/SDL2/include/SDL2/SDL_opengles.h b/Windows/SDL2/include/SDL2/SDL_opengles.h new file mode 100644 index 00000000..5c2a3e63 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_opengles.h @@ -0,0 +1,39 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 1.X API headers. + */ +#include "SDL_config.h" + +#ifdef __IPHONEOS__ +#include <OpenGLES/ES1/gl.h> +#include <OpenGLES/ES1/glext.h> +#else +#include <GLES/gl.h> +#include <GLES/glext.h> +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/Windows/SDL2/include/SDL2/SDL_opengles2.h b/Windows/SDL2/include/SDL2/SDL_opengles2.h new file mode 100644 index 00000000..00bc180c --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_opengles2.h @@ -0,0 +1,52 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles2.h + * + * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. + */ +#include "SDL_config.h" + +#ifndef _MSC_VER + +#ifdef __IPHONEOS__ +#include <OpenGLES/ES2/gl.h> +#include <OpenGLES/ES2/glext.h> +#else +#include <GLES2/gl2platform.h> +#include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> +#endif + +#else /* _MSC_VER */ + +/* OpenGL ES2 headers for Visual Studio */ +#include "SDL_opengles2_khrplatform.h" +#include "SDL_opengles2_gl2platform.h" +#include "SDL_opengles2_gl2.h" +#include "SDL_opengles2_gl2ext.h" + +#endif /* _MSC_VER */ + +#ifndef APIENTRY +#define APIENTRY GL_APIENTRY +#endif diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2.h b/Windows/SDL2/include/SDL2/SDL_opengles2_gl2.h similarity index 100% rename from MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2.h rename to Windows/SDL2/include/SDL2/SDL_opengles2_gl2.h diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2ext.h b/Windows/SDL2/include/SDL2/SDL_opengles2_gl2ext.h similarity index 100% rename from MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2ext.h rename to Windows/SDL2/include/SDL2/SDL_opengles2_gl2ext.h diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2platform.h b/Windows/SDL2/include/SDL2/SDL_opengles2_gl2platform.h similarity index 100% rename from MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2platform.h rename to Windows/SDL2/include/SDL2/SDL_opengles2_gl2platform.h diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_khrplatform.h b/Windows/SDL2/include/SDL2/SDL_opengles2_khrplatform.h similarity index 100% rename from MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2_khrplatform.h rename to Windows/SDL2/include/SDL2/SDL_opengles2_khrplatform.h diff --git a/Windows/SDL2/include/SDL2/SDL_pixels.h b/Windows/SDL2/include/SDL2/SDL_pixels.h new file mode 100644 index 00000000..1b119e47 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_pixels.h @@ -0,0 +1,473 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_pixels.h + * + * Header for the enumerated pixel format definitions. + */ + +#ifndef SDL_pixels_h_ +#define SDL_pixels_h_ + +#include "SDL_stdinc.h" +#include "SDL_endian.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Transparency definitions + * + * These define alpha as the opacity of a surface. + */ +/* @{ */ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/* @} */ + +/** Pixel type. */ +typedef enum +{ + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32 +} SDL_PixelType; + +/** Bitmap pixel order, high bit -> low bit. */ +typedef enum +{ + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234 +} SDL_BitmapOrder; + +/** Packed component order, high bit -> low bit. */ +typedef enum +{ + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA +} SDL_PackedOrder; + +/** Array component order, low byte -> high byte. */ +/* !!! FIXME: in 2.1, make these not overlap differently with + !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ +typedef enum +{ + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR +} SDL_ArrayOrder; + +/** Packed component layout. */ +typedef enum +{ + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102 +} SDL_PackedLayout; + +#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) + +#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ + ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ + ((bits) << 8) | ((bytes) << 0)) + +#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) +#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) +#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) +#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) +#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) +#define SDL_BYTESPERPIXEL(X) \ + (SDL_ISPIXELFORMAT_FOURCC(X) ? \ + ((((X) == SDL_PIXELFORMAT_YUY2) || \ + ((X) == SDL_PIXELFORMAT_UYVY) || \ + ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) + +#define SDL_ISPIXELFORMAT_INDEXED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) + +#define SDL_ISPIXELFORMAT_PACKED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) + +#define SDL_ISPIXELFORMAT_ARRAY(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) + +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + ((SDL_ISPIXELFORMAT_PACKED(format) && \ + ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ + (SDL_ISPIXELFORMAT_ARRAY(format) && \ + ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) + +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ +#define SDL_ISPIXELFORMAT_FOURCC(format) \ + ((format) && (SDL_PIXELFLAG(format) != 1)) + +/* Note: If you modify this list, update SDL_GetPixelFormatName() */ +typedef enum +{ + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX1MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX4LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX4MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX8 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), + SDL_PIXELFORMAT_RGB332 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_332, 8, 1), + SDL_PIXELFORMAT_RGB444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_BGR444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_RGB555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_ARGB4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_RGBA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ABGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_BGRA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ARGB1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_RGBA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_ABGR1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_BGRA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_RGB565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_BGR565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_RGB24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, + 24, 3), + SDL_PIXELFORMAT_BGR24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, + 24, 3), + SDL_PIXELFORMAT_RGB888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGBX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGRX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_ARGB8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_RGBA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ABGR8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_BGRA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ARGB2101010 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_2101010, 32, 4), + + /* Aliases for RGBA byte arrays of color data, for the current platform */ +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, +#else + SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, +#endif + + SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), + SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ + SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), + SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), + SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), + SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), + SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ + SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), + SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ + SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), + SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ + SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') +} SDL_PixelFormatEnum; + +typedef struct SDL_Color +{ + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 a; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette +{ + int ncolors; + SDL_Color *colors; + Uint32 version; + int refcount; +} SDL_Palette; + +/** + * \note Everything in the pixel format structure is read-only. + */ +typedef struct SDL_PixelFormat +{ + Uint32 format; + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 padding[2]; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + int refcount; + struct SDL_PixelFormat *next; +} SDL_PixelFormat; + +/** + * \brief Get the human readable name of a pixel format + */ +extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); + +/** + * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. + * + * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. + * + * \sa SDL_MasksToPixelFormatEnum() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, + int *bpp, + Uint32 * Rmask, + Uint32 * Gmask, + Uint32 * Bmask, + Uint32 * Amask); + +/** + * \brief Convert a bpp and RGBA masks to an enumerated pixel format. + * + * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * wasn't possible. + * + * \sa SDL_PixelFormatEnumToMasks() + */ +extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); + +/** + * \brief Create an SDL_PixelFormat structure from a pixel format enum. + */ +extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); + +/** + * \brief Free an SDL_PixelFormat structure. + */ +extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); + +/** + * \brief Create a palette structure with the specified number of color + * entries. + * + * \return A new palette, or NULL if there wasn't enough memory. + * + * \note The palette entries are initialized to white. + * + * \sa SDL_FreePalette() + */ +extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); + +/** + * \brief Set the palette for a pixel format structure. + */ +extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, + SDL_Palette *palette); + +/** + * \brief Set a range of colors in a palette. + * + * \param palette The palette to modify. + * \param colors An array of colors to copy into the palette. + * \param firstcolor The index of the first palette entry to modify. + * \param ncolors The number of entries to modify. + * + * \return 0 on success, or -1 if not all of the colors could be set. + */ +extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, + const SDL_Color * colors, + int firstcolor, int ncolors); + +/** + * \brief Free a palette created with SDL_AllocPalette(). + * + * \sa SDL_AllocPalette() + */ +extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); + +/** + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. + * + * \sa SDL_MapRGBA + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b); + +/** + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. + * + * \sa SDL_MapRGB + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the RGB components from a pixel of the specified format. + * + * \sa SDL_GetRGBA + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b); + +/** + * \brief Get the RGBA components from a pixel of the specified format. + * + * \sa SDL_GetRGB + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Calculate a 256 entry gamma ramp for a gamma value. + */ +extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_pixels_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_platform.h b/Windows/SDL2/include/SDL2/SDL_platform.h new file mode 100644 index 00000000..71665579 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_platform.h @@ -0,0 +1,198 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_platform.h + * + * Try to get a standard set of platform defines. + */ + +#ifndef SDL_platform_h_ +#define SDL_platform_h_ + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if (defined(linux) || defined(__linux) || defined(__linux__)) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(ANDROID) || defined(__ANDROID__) +#undef __ANDROID__ +#undef __LINUX__ /* do we need to do this? */ +#define __ANDROID__ 1 +#endif + +#if defined(__APPLE__) +/* lets us know what version of Mac OS X we're compiling on */ +#include "AvailabilityMacros.h" +#include "TargetConditionals.h" +#if TARGET_OS_TV +#undef __TVOS__ +#define __TVOS__ 1 +#endif +#if TARGET_OS_IPHONE +/* if compiling for iOS */ +#undef __IPHONEOS__ +#define __IPHONEOS__ 1 +#undef __MACOSX__ +#else +/* if not compiling for iOS */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +# error SDL for Mac OS X only supports deploying on 10.6 and above. +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */ +#endif /* TARGET_OS_IPHONE */ +#endif /* defined(__APPLE__) */ + +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) || defined(__EMX__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__sun) && defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif + +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) +/* Try to find out if we're compiling for WinRT or non-WinRT */ +#if defined(_MSC_VER) && defined(__has_include) +#if __has_include(<winapifamily.h>) +#define HAVE_WINAPIFAMILY_H 1 +#else +#define HAVE_WINAPIFAMILY_H 0 +#endif + +/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */ +#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */ +#define HAVE_WINAPIFAMILY_H 1 +#else +#define HAVE_WINAPIFAMILY_H 0 +#endif + +#if HAVE_WINAPIFAMILY_H +#include <winapifamily.h> +#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)) +#else +#define WINAPI_FAMILY_WINRT 0 +#endif /* HAVE_WINAPIFAMILY_H */ + +#if WINAPI_FAMILY_WINRT +#undef __WINRT__ +#define __WINRT__ 1 +#else +#undef __WINDOWS__ +#define __WINDOWS__ 1 +#endif +#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ + +#if defined(__WINDOWS__) +#undef __WIN32__ +#define __WIN32__ 1 +#endif +#if defined(__PSP__) +#undef __PSP__ +#define __PSP__ 1 +#endif + +/* The NACL compiler defines __native_client__ and __pnacl__ + * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi + */ +#if defined(__native_client__) +#undef __LINUX__ +#undef __NACL__ +#define __NACL__ 1 +#endif +#if defined(__pnacl__) +#undef __LINUX__ +#undef __PNACL__ +#define __PNACL__ 1 +/* PNACL with newlib supports static linking only */ +#define __SDL_NOGETPROCADDR__ +#endif + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Gets the name of the platform. + */ +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_platform_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_power.h b/Windows/SDL2/include/SDL2/SDL_power.h new file mode 100644 index 00000000..39884cc2 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_power.h @@ -0,0 +1,75 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_power_h_ +#define SDL_power_h_ + +/** + * \file SDL_power.h + * + * Header for the SDL power management routines. + */ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The basic state for the system's power supply. + */ +typedef enum +{ + SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ + SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ +} SDL_PowerState; + + +/** + * \brief Get the current power supply details. + * + * \param secs Seconds of battery life left. You can pass a NULL here if + * you don't care. Will return -1 if we can't determine a + * value, or we're not running on a battery. + * + * \param pct Percentage of battery life left, between 0 and 100. You can + * pass a NULL here if you don't care. Will return -1 if we + * can't determine a value, or we're not running on a battery. + * + * \return The state of the battery (if any). + */ +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_power_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_quit.h b/Windows/SDL2/include/SDL2/SDL_quit.h new file mode 100644 index 00000000..b2bd5da5 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_quit.h @@ -0,0 +1,58 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_quit.h + * + * Include file for SDL quit event handling. + */ + +#ifndef SDL_quit_h_ +#define SDL_quit_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** + * \file SDL_quit.h + * + * An ::SDL_QUIT event is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate ::SDL_QUIT events as well. There is no way + * to determine the cause of an ::SDL_QUIT event, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + * + * \sa SDL_Quit() + */ + +/* There are no functions directly affecting the quit event */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) + +#endif /* SDL_quit_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_rect.h b/Windows/SDL2/include/SDL2/SDL_rect.h new file mode 100644 index 00000000..47f0d207 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_rect.h @@ -0,0 +1,174 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rect.h + * + * Header file for SDL_rect definition and management functions. + */ + +#ifndef SDL_rect_h_ +#define SDL_rect_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_pixels.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a point (integer) + * + * \sa SDL_EnclosePoints + * \sa SDL_PointInRect + */ +typedef struct SDL_Point +{ + int x; + int y; +} SDL_Point; + +/** + * \brief The structure that defines a point (floating point) + * + * \sa SDL_EnclosePoints + * \sa SDL_PointInRect + */ +typedef struct SDL_FPoint +{ + float x; + float y; +} SDL_FPoint; + + +/** + * \brief A rectangle, with the origin at the upper left (integer). + * + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_UnionRect + * \sa SDL_EnclosePoints + */ +typedef struct SDL_Rect +{ + int x, y; + int w, h; +} SDL_Rect; + + +/** + * \brief A rectangle, with the origin at the upper left (floating point). + */ +typedef struct SDL_FRect +{ + float x; + float y; + float w; + float h; +} SDL_FRect; + + +/** + * \brief Returns true if point resides inside a rectangle. + */ +SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) +{ + return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && + (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Returns true if the rectangle has no area. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) +{ + return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Returns true if the two rectangles are equal. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) +{ + return (a && b && (a->x == b->x) && (a->y == b->y) && + (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Determine whether two rectangles intersect. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, + const SDL_Rect * B); + +/** + * \brief Calculate the intersection of two rectangles. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate the union of two rectangles. + */ +extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate a minimal rectangle enclosing a set of points + * + * \return SDL_TRUE if any points were within the clipping rect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, + int count, + const SDL_Rect * clip, + SDL_Rect * result); + +/** + * \brief Calculate the intersection of a rectangle and line segment. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * + rect, int *X1, + int *Y1, int *X2, + int *Y2); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_rect_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_render.h b/Windows/SDL2/include/SDL2/SDL_render.h new file mode 100644 index 00000000..f26fb7e5 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_render.h @@ -0,0 +1,1158 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_render.h + * + * Header file for SDL 2D rendering functions. + * + * This API supports the following features: + * * single pixel points + * * single pixel lines + * * filled rectangles + * * texture images + * + * The primitives may be drawn in opaque, blended, or additive modes. + * + * The texture images may be drawn in opaque, blended, or additive modes. + * They can have an additional color tint or alpha modulation applied to + * them, and may also be stretched with linear interpolation. + * + * This API is designed to accelerate simple 2D operations. You may + * want more functionality such as polygons and particle effects and + * in that case you should use SDL's OpenGL/Direct3D support or one + * of the many good 3D engines. + * + * These functions must be called from the main thread. + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 + */ + +#ifndef SDL_render_h_ +#define SDL_render_h_ + +#include "SDL_stdinc.h" +#include "SDL_rect.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Flags used when creating a rendering context + */ +typedef enum +{ + SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ + SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware + acceleration */ + SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized + with the refresh rate */ + SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports + rendering to texture */ +} SDL_RendererFlags; + +/** + * \brief Information on the capabilities of a render driver or context. + */ +typedef struct SDL_RendererInfo +{ + const char *name; /**< The name of the renderer */ + Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 num_texture_formats; /**< The number of available texture formats */ + Uint32 texture_formats[16]; /**< The available texture formats */ + int max_texture_width; /**< The maximum texture width */ + int max_texture_height; /**< The maximum texture height */ +} SDL_RendererInfo; + +/** + * \brief The scaling mode for a texture. + */ +typedef enum +{ + SDL_ScaleModeNearest, /**< nearest pixel sampling */ + SDL_ScaleModeLinear, /**< linear filtering */ + SDL_ScaleModeBest /**< anisotropic filtering */ +} SDL_ScaleMode; + +/** + * \brief The access pattern allowed for a texture. + */ +typedef enum +{ + SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ + SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ + SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ +} SDL_TextureAccess; + +/** + * \brief The texture channel modulation used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ + SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ + SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ +} SDL_TextureModulate; + +/** + * \brief Flip constants for SDL_RenderCopyEx + */ +typedef enum +{ + SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ + SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ + SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ +} SDL_RendererFlip; + +/** + * \brief A structure representing rendering state + */ +struct SDL_Renderer; +typedef struct SDL_Renderer SDL_Renderer; + +/** + * \brief An efficient driver-specific representation of pixel data + */ +struct SDL_Texture; +typedef struct SDL_Texture SDL_Texture; + + +/* Function prototypes */ + +/** + * \brief Get the number of 2D rendering drivers available for the current + * display. + * + * A render driver is a set of code that handles rendering and texture + * management on a particular display. Normally there is only one, but + * some drivers may have several available with different capabilities. + * + * \sa SDL_GetRenderDriverInfo() + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); + +/** + * \brief Get information about a specific 2D rendering driver for the current + * display. + * + * \param index The index of the driver to query information about. + * \param info A pointer to an SDL_RendererInfo struct to be filled with + * information on the rendering driver. + * + * \return 0 on success, -1 if the index was out of range. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, + SDL_RendererInfo * info); + +/** + * \brief Create a window and default renderer + * + * \param width The width of the window + * \param height The height of the window + * \param window_flags The flags used to create the window + * \param window A pointer filled with the window, or NULL on error + * \param renderer A pointer filled with the renderer, or NULL on error + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( + int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer); + + +/** + * \brief Create a 2D rendering context for a window. + * + * \param window The window where rendering is displayed. + * \param index The index of the rendering driver to initialize, or -1 to + * initialize the first one supporting the requested flags. + * \param flags ::SDL_RendererFlags. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateSoftwareRenderer() + * \sa SDL_GetRendererInfo() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, + int index, Uint32 flags); + +/** + * \brief Create a 2D software rendering context for a surface. + * + * \param surface The surface where rendering is done. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateRenderer() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); + +/** + * \brief Get the renderer associated with a window. + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); + +/** + * \brief Get information about a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, + SDL_RendererInfo * info); + +/** + * \brief Get the output size in pixels of a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, + int *w, int *h); + +/** + * \brief Create a texture for a rendering context. + * + * \param renderer The renderer. + * \param format The format of the texture. + * \param access One of the enumerated values in ::SDL_TextureAccess. + * \param w The width of the texture in pixels. + * \param h The height of the texture in pixels. + * + * \return The created texture is returned, or NULL if no rendering context was + * active, the format was unsupported, or the width or height were out + * of range. + * + * \note The contents of the texture are not defined at creation. + * + * \sa SDL_QueryTexture() + * \sa SDL_UpdateTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, + Uint32 format, + int access, int w, + int h); + +/** + * \brief Create a texture from an existing surface. + * + * \param renderer The renderer. + * \param surface The surface containing pixel data used to fill the texture. + * + * \return The created texture is returned, or NULL on error. + * + * \note The surface is not modified or freed by this function. + * + * \sa SDL_QueryTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); + +/** + * \brief Query the attributes of a texture + * + * \param texture A texture to be queried. + * \param format A pointer filled in with the raw format of the texture. The + * actual format may differ, but pixel transfers will use this + * format. + * \param access A pointer filled in with the actual access to the texture. + * \param w A pointer filled in with the width of the texture in pixels. + * \param h A pointer filled in with the height of the texture in pixels. + * + * \return 0 on success, or -1 if the texture is not valid. + */ +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, + Uint32 * format, int *access, + int *w, int *h); + +/** + * \brief Set an additional color value used in render copy operations. + * + * \param texture The texture to update. + * \param r The red color value multiplied into copy operations. + * \param g The green color value multiplied into copy operations. + * \param b The blue color value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or color modulation + * is not supported. + * + * \sa SDL_GetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in render copy operations. + * + * \param texture The texture to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in render copy operations. + * + * \param texture The texture to update. + * \param alpha The alpha value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or alpha modulation + * is not supported. + * + * \sa SDL_GetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in render copy operations. + * + * \param texture The texture to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for texture copy operations. + * + * \param texture The texture to update. + * \param blendMode ::SDL_BlendMode to use for texture blending. + * + * \return 0 on success, or -1 if the texture is not valid or the blend mode is + * not supported. + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for texture copy operations. + * + * \param texture The texture to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode *blendMode); + +/** + * \brief Set the scale mode used for texture scale operations. + * + * \param texture The texture to update. + * \param scaleMode ::SDL_ScaleMode to use for texture scaling. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note If the scale mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode scaleMode); + +/** + * \brief Get the scale mode used for texture scale operations. + * + * \param texture The texture to query. + * \param scaleMode A pointer filled in with the current scale mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode *scaleMode); + +/** + * \brief Update the given texture rectangle with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param pixels The raw pixel data in the format of the texture. + * \param pitch The number of bytes in a row of pixel data, including padding between lines. + * + * The pixel data must be in the format of the texture. The pixel format can be + * queried with SDL_QueryTexture. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note This is a fairly slow function. + */ +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const void *pixels, int pitch); + +/** + * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param Yplane The raw pixel data for the Y plane. + * \param Ypitch The number of bytes between rows of pixel data for the Y plane. + * \param Uplane The raw pixel data for the U plane. + * \param Upitch The number of bytes between rows of pixel data for the U plane. + * \param Vplane The raw pixel data for the V plane. + * \param Vpitch The number of bytes between rows of pixel data for the V plane. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note You can use SDL_UpdateTexture() as long as your pixel data is + * a contiguous block of Y and U/V planes in the proper order, but + * this function is available if your pixel data is not contiguous. + */ +extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch); + +/** + * \brief Lock a portion of the texture for write-only pixel access. + * + * \param texture The texture to lock for access, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param rect A pointer to the rectangle to lock for access. If the rect + * is NULL, the entire texture will be locked. + * \param pixels This is filled in with a pointer to the locked pixels, + * appropriately offset by the locked area. + * \param pitch This is filled in with the pitch of the locked pixels. + * + * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. + * + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, + const SDL_Rect * rect, + void **pixels, int *pitch); + +/** + * \brief Lock a portion of the texture for write-only pixel access. + * Expose it as a SDL surface. + * + * \param texture The texture to lock for access, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param rect A pointer to the rectangle to lock for access. If the rect + * is NULL, the entire texture will be locked. + * \param surface This is filled in with a SDL surface representing the locked area + * Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture. + * + * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. + * + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, + const SDL_Rect *rect, + SDL_Surface **surface); + +/** + * \brief Unlock a texture, uploading the changes to video memory, if needed. + * If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed. + * + * \sa SDL_LockTexture() + * \sa SDL_LockTextureToSurface() + */ +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); + +/** + * \brief Determines whether a window supports the use of render targets + * + * \param renderer The renderer that will be checked + * + * \return SDL_TRUE if supported, SDL_FALSE if not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); + +/** + * \brief Set a texture as the current rendering target. + * + * \param renderer The renderer. + * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target + * + * \return 0 on success, or -1 on error + * + * \sa SDL_GetRenderTarget() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, + SDL_Texture *texture); + +/** + * \brief Get the current render target or NULL for the default render target. + * + * \return The current render target + * + * \sa SDL_SetRenderTarget() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); + +/** + * \brief Set device independent resolution for rendering + * + * \param renderer The renderer for which resolution should be set. + * \param w The width of the logical resolution + * \param h The height of the logical resolution + * + * This function uses the viewport and scaling functionality to allow a fixed logical + * resolution for rendering, regardless of the actual output resolution. If the actual + * output resolution doesn't have the same aspect ratio the output rendering will be + * centered within the output display. + * + * If the output display is a window, mouse events in the window will be filtered + * and scaled so they seem to arrive within the logical resolution. + * + * \note If this function results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. + * + * \sa SDL_RenderGetLogicalSize() + * \sa SDL_RenderSetScale() + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); + +/** + * \brief Get device independent resolution for rendering + * + * \param renderer The renderer from which resolution should be queried. + * \param w A pointer filled with the width of the logical resolution + * \param h A pointer filled with the height of the logical resolution + * + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); + +/** + * \brief Set whether to force integer scales for resolution-independent rendering + * + * \param renderer The renderer for which integer scaling should be set. + * \param enable Enable or disable integer scaling + * + * This function restricts the logical viewport to integer values - that is, when + * a resolution is between two multiples of a logical size, the viewport size is + * rounded down to the lower multiple. + * + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer, + SDL_bool enable); + +/** + * \brief Get whether integer scales are forced for resolution-independent rendering + * + * \param renderer The renderer from which integer scaling should be queried. + * + * \sa SDL_RenderSetIntegerScale() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer); + +/** + * \brief Set the drawing area for rendering on the current target. + * + * \param renderer The renderer for which the drawing area should be set. + * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. + * + * The x,y of the viewport rect represents the origin for rendering. + * + * \return 0 on success, or -1 on error + * + * \note If the window associated with the renderer is resized, the viewport is automatically reset. + * + * \sa SDL_RenderGetViewport() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the drawing area for the current target. + * + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Set the clip rectangle for the current target. + * + * \param renderer The renderer for which clip rectangle should be set. + * \param rect A pointer to the rectangle to set as the clip rectangle, + * relative to the viewport, or NULL to disable clipping. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_RenderGetClipRect() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the clip rectangle for the current target. + * + * \param renderer The renderer from which clip rectangle should be queried. + * \param rect A pointer filled in with the current clip rectangle, or + * an empty rectangle if clipping is disabled. + * + * \sa SDL_RenderSetClipRect() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Get whether clipping is enabled on the given renderer. + * + * \param renderer The renderer from which clip state should be queried. + * + * \sa SDL_RenderGetClipRect() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); + + +/** + * \brief Set the drawing scale for rendering on the current target. + * + * \param renderer The renderer for which the drawing scale should be set. + * \param scaleX The horizontal scaling factor + * \param scaleY The vertical scaling factor + * + * The drawing coordinates are scaled by the x/y scaling factors + * before they are used by the renderer. This allows resolution + * independent drawing with a single coordinate system. + * + * \note If this results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. For best results use integer scaling factors. + * + * \sa SDL_RenderGetScale() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, + float scaleX, float scaleY); + +/** + * \brief Get the drawing scale for the current target. + * + * \param renderer The renderer from which drawing scale should be queried. + * \param scaleX A pointer filled in with the horizontal scaling factor + * \param scaleY A pointer filled in with the vertical scaling factor + * + * \sa SDL_RenderSetScale() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, + float *scaleX, float *scaleY); + +/** + * \brief Set the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer for which drawing color should be set. + * \param r The red value used to draw on the rendering target. + * \param g The green value used to draw on the rendering target. + * \param b The blue value used to draw on the rendering target. + * \param a The alpha value used to draw on the rendering target, usually + * ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer from which drawing color should be queried. + * \param r A pointer to the red value used to draw on the rendering target. + * \param g A pointer to the green value used to draw on the rendering target. + * \param b A pointer to the blue value used to draw on the rendering target. + * \param a A pointer to the alpha value used to draw on the rendering target, + * usually ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Set the blend mode used for drawing operations (Fill and Line). + * + * \param renderer The renderer for which blend mode should be set. + * \param blendMode ::SDL_BlendMode to use for blending. + * + * \return 0 on success, or -1 on error + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for drawing operations. + * + * \param renderer The renderer from which blend mode should be queried. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_SetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode *blendMode); + +/** + * \brief Clear the current rendering target with the drawing color + * + * This function clears the entire rendering target, ignoring the viewport and + * the clip rectangle. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); + +/** + * \brief Draw a point on the current rendering target. + * + * \param renderer The renderer which should draw a point. + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, + int x, int y); + +/** + * \brief Draw multiple points on the current rendering target. + * + * \param renderer The renderer which should draw multiple points. + * \param points The points to draw + * \param count The number of points to draw + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a line on the current rendering target. + * + * \param renderer The renderer which should draw a line. + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, + int x1, int y1, int x2, int y2); + +/** + * \brief Draw a series of connected lines on the current rendering target. + * + * \param renderer The renderer which should draw multiple lines. + * \param points The points along the lines + * \param count The number of points, drawing count-1 lines + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a rectangle on the current rendering target. + * + * \param renderer The renderer which should draw a rectangle. + * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Draw some number of rectangles on the current rendering target. + * + * \param renderer The renderer which should draw multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Fill a rectangle on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill a rectangle. + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Fill some number of rectangles on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Copy a portion of the texture to the current rendering target. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect); + +/** + * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction + * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). + * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect, + const double angle, + const SDL_Point *center, + const SDL_RendererFlip flip); + + +/** + * \brief Draw a point on the current rendering target. + * + * \param renderer The renderer which should draw a point. + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer, + float x, float y); + +/** + * \brief Draw multiple points on the current rendering target. + * + * \param renderer The renderer which should draw multiple points. + * \param points The points to draw + * \param count The number of points to draw + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer, + const SDL_FPoint * points, + int count); + +/** + * \brief Draw a line on the current rendering target. + * + * \param renderer The renderer which should draw a line. + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer, + float x1, float y1, float x2, float y2); + +/** + * \brief Draw a series of connected lines on the current rendering target. + * + * \param renderer The renderer which should draw multiple lines. + * \param points The points along the lines + * \param count The number of points, drawing count-1 lines + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer, + const SDL_FPoint * points, + int count); + +/** + * \brief Draw a rectangle on the current rendering target. + * + * \param renderer The renderer which should draw a rectangle. + * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer, + const SDL_FRect * rect); + +/** + * \brief Draw some number of rectangles on the current rendering target. + * + * \param renderer The renderer which should draw multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer, + const SDL_FRect * rects, + int count); + +/** + * \brief Fill a rectangle on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill a rectangle. + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer, + const SDL_FRect * rect); + +/** + * \brief Fill some number of rectangles on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer, + const SDL_FRect * rects, + int count); + +/** + * \brief Copy a portion of the texture to the current rendering target. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_FRect * dstrect); + +/** + * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction + * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). + * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_FRect * dstrect, + const double angle, + const SDL_FPoint *center, + const SDL_RendererFlip flip); + +/** + * \brief Read pixels from the current rendering target. + * + * \param renderer The renderer from which pixels should be read. + * \param rect A pointer to the rectangle to read, or NULL for the entire + * render target. + * \param format The desired format of the pixel data, or 0 to use the format + * of the rendering target + * \param pixels A pointer to be filled in with the pixel data + * \param pitch The pitch of the pixels parameter. + * + * \return 0 on success, or -1 if pixel reading is not supported. + * + * \warning This is a very slow operation, and should not be used frequently. + */ +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, + const SDL_Rect * rect, + Uint32 format, + void *pixels, int pitch); + +/** + * \brief Update the screen with rendering performed. + */ +extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); + +/** + * \brief Destroy the specified texture. + * + * \sa SDL_CreateTexture() + * \sa SDL_CreateTextureFromSurface() + */ +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); + +/** + * \brief Destroy the rendering context for a window and free associated + * textures. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); + +/** + * \brief Force the rendering context to flush any pending commands to the + * underlying rendering API. + * + * You do not need to (and in fact, shouldn't) call this function unless + * you are planning to call into OpenGL/Direct3D/Metal/whatever directly + * in addition to using an SDL_Renderer. + * + * This is for a very-specific case: if you are using SDL's render API, + * you asked for a specific renderer backend (OpenGL, Direct3D, etc), + * you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make + * OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of + * this applies, you should call SDL_RenderFlush() between calls to SDL's + * render API and the low-level API you're using in cooperation. + * + * In all other cases, you can ignore this function. This is only here to + * get maximum performance out of a specific situation. In all other cases, + * SDL will do the right thing, perhaps at a performance loss. + * + * This function is first available in SDL 2.0.10, and is not needed in + * 2.0.9 and earlier, as earlier versions did not queue rendering commands + * at all, instead flushing them to the OS immediately. + */ +extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer); + + +/** + * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with + * OpenGL instructions. + * + * \param texture The SDL texture to bind + * \param texw A pointer to a float that will be filled with the texture width + * \param texh A pointer to a float that will be filled with the texture height + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); + +/** + * \brief Unbind a texture from the current OpenGL/ES/ES2 context. + * + * \param texture The SDL texture to unbind + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); + +/** + * \brief Get the CAMetalLayer associated with the given Metal renderer + * + * \param renderer The renderer to query + * + * \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer + * + * \sa SDL_RenderGetMetalCommandEncoder() + */ +extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer); + +/** + * \brief Get the Metal command encoder for the current frame + * + * \param renderer The renderer to query + * + * \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer + * + * \sa SDL_RenderGetMetalLayer() + */ +extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_render_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_revision.h b/Windows/SDL2/include/SDL2/SDL_revision.h new file mode 100644 index 00000000..dfbc057f --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_revision.h @@ -0,0 +1,2 @@ +#define SDL_REVISION "hg-13609:34cc7d3b69d3" +#define SDL_REVISION_NUMBER 13609 diff --git a/Windows/SDL2/include/SDL2/SDL_rwops.h b/Windows/SDL2/include/SDL2/SDL_rwops.h new file mode 100644 index 00000000..6674f506 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_rwops.h @@ -0,0 +1,291 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rwops.h + * + * This file provides a general interface for SDL to read and write + * data streams. It can easily be extended to files, memory, etc. + */ + +#ifndef SDL_rwops_h_ +#define SDL_rwops_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* RWops Types */ +#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */ +#define SDL_RWOPS_WINFILE 1U /**< Win32 file */ +#define SDL_RWOPS_STDFILE 2U /**< Stdio file */ +#define SDL_RWOPS_JNIFILE 3U /**< Android asset */ +#define SDL_RWOPS_MEMORY 4U /**< Memory stream */ +#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */ + +/** + * This is the read/write operation structure -- very basic. + */ +typedef struct SDL_RWops +{ + /** + * Return the size of the file in this rwops, or -1 if unknown + */ + Sint64 (SDLCALL * size) (struct SDL_RWops * context); + + /** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data stream, or -1 on error. + */ + Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, + int whence); + + /** + * Read up to \c maxnum objects each of size \c size from the data + * stream to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ + size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, + size_t size, size_t maxnum); + + /** + * Write exactly \c num objects each of size \c size from the area + * pointed at by \c ptr to data stream. + * + * \return the number of objects written, or 0 at error or end of file. + */ + size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, + size_t size, size_t num); + + /** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ + int (SDLCALL * close) (struct SDL_RWops * context); + + Uint32 type; + union + { +#if defined(__ANDROID__) + struct + { + void *fileNameRef; + void *inputStreamRef; + void *readableByteChannelRef; + void *readMethod; + void *assetFileDescriptorRef; + long position; + long size; + long offset; + int fd; + } androidio; +#elif defined(__WIN32__) + struct + { + SDL_bool append; + void *h; + struct + { + void *data; + size_t size; + size_t left; + } buffer; + } windowsio; +#endif + +#ifdef HAVE_STDIO_H + struct + { + SDL_bool autoclose; + FILE *fp; + } stdio; +#endif + struct + { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct + { + void *data1; + void *data2; + } unknown; + } hidden; + +} SDL_RWops; + + +/** + * \name RWFrom functions + * + * Functions to create SDL_RWops structures from various data streams. + */ +/* @{ */ + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, + const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, + SDL_bool autoclose); +#else +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, + SDL_bool autoclose); +#endif + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, + int size); + +/* @} *//* RWFrom functions */ + + +extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); + +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ + +/** + * Return the size of the file in this rwops, or -1 if unknown + */ +extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context); + +/** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data stream, or -1 on error. + */ +extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, + Sint64 offset, int whence); + +/** + * Return the current offset in the data stream, or -1 on error. + */ +extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context); + +/** + * Read up to \c maxnum objects each of size \c size from the data + * stream to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ +extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, + void *ptr, size_t size, size_t maxnum); + +/** + * Write exactly \c num objects each of size \c size from the area + * pointed at by \c ptr to data stream. + * + * \return the number of objects written, or 0 at error or end of file. + */ +extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, + const void *ptr, size_t size, size_t num); + +/** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ +extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context); + +/** + * Load all the data from an SDL data stream. + * + * The data is allocated with a zero byte at the end (null terminated) + * + * If \c datasize is not NULL, it is filled with the size of the data read. + * + * If \c freesrc is non-zero, the stream will be closed after being read. + * + * The data should be freed with SDL_free(). + * + * \return the data, or NULL if there was an error. + */ +extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, + int freesrc); + +/** + * Load an entire file. + * + * The data is allocated with a zero byte at the end (null terminated) + * + * If \c datasize is not NULL, it is filled with the size of the data read. + * + * If \c freesrc is non-zero, the stream will be closed after being read. + * + * The data should be freed with SDL_free(). + * + * \return the data, or NULL if there was an error. + */ +extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); + +/** + * \name Read endian functions + * + * Read an item of the specified endianness and return in native format. + */ +/* @{ */ +extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); +/* @} *//* Read endian functions */ + +/** + * \name Write endian functions + * + * Write an item of native format to the specified endianness. + */ +/* @{ */ +extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); +/* @} *//* Write endian functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_rwops_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_scancode.h b/Windows/SDL2/include/SDL2/SDL_scancode.h new file mode 100644 index 00000000..b19197d2 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_scancode.h @@ -0,0 +1,413 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_scancode.h + * + * Defines keyboard scancodes. + */ + +#ifndef SDL_scancode_h_ +#define SDL_scancode_h_ + +#include "SDL_stdinc.h" + +/** + * \brief The SDL keyboard scancode representation. + * + * Values of this type are used to represent keyboard keys, among other places + * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the + * SDL_Event structure. + * + * The values in this enumeration are based on the USB usage page standard: + * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf + */ +typedef enum +{ + SDL_SCANCODE_UNKNOWN = 0, + + /** + * \name Usage page 0x07 + * + * These values are from usage page 0x07 (USB keyboard page). + */ + /* @{ */ + + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return + * key on ISO keyboards and at the right end + * of the QWERTY row on ANSI keyboards. + * Produces REVERSE SOLIDUS (backslash) and + * VERTICAL LINE in a US layout, REVERSE + * SOLIDUS and VERTICAL LINE in a UK Mac + * layout, NUMBER SIGN and TILDE in a UK + * Windows layout, DOLLAR SIGN and POUND SIGN + * in a Swiss German layout, NUMBER SIGN and + * APOSTROPHE in a German layout, GRAVE + * ACCENT and POUND SIGN in a French Mac + * layout, and ASTERISK and MICRO SIGN in a + * French Windows layout. + */ + SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code + * instead of 49 for the same key, but all + * OSes I've seen treat the two codes + * identically. So, as an implementor, unless + * your keyboard generates both of those + * codes and your OS treats them differently, + * you should generate SDL_SCANCODE_BACKSLASH + * instead of this code. As a user, you + * should not rely on this code because SDL + * will never generate it with most (all?) + * keyboards. + */ + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI + * and ISO keyboards). Produces GRAVE ACCENT and + * TILDE in a US Windows layout and in US and UK + * Mac layouts on ANSI keyboards, GRAVE ACCENT + * and NOT SIGN in a UK Windows layout, SECTION + * SIGN and PLUS-MINUS SIGN in US and UK Mac + * layouts on ISO keyboards, SECTION SIGN and + * DEGREE SIGN in a Swiss German layout (Mac: + * only on ISO keyboards), CIRCUMFLEX ACCENT and + * DEGREE SIGN in a German layout (Mac: only on + * ISO keyboards), SUPERSCRIPT TWO and TILDE in a + * French Windows layout, COMMERCIAL AT and + * NUMBER SIGN in a French Mac layout on ISO + * keyboards, and LESS-THAN SIGN and GREATER-THAN + * SIGN in a Swiss German, German, or French Mac + * layout on ANSI keyboards. + */ + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + + SDL_SCANCODE_CAPSLOCK = 57, + + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but + does send code 73, not 117) */ + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + */ + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + + SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO + * keyboards have over ANSI ones, + * located between left shift and Y. + * Produces GRAVE ACCENT and TILDE in a + * US or UK Mac layout, REVERSE SOLIDUS + * (backslash) and VERTICAL LINE in a + * US or UK Windows layout, and + * LESS-THAN SIGN and GREATER-THAN SIGN + * in a Swiss German, German, or French + * layout. */ + SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ + SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, + * not a physical key - but some Mac keyboards + * do have a power key. */ + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, + SDL_SCANCODE_MENU = 118, + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, + SDL_SCANCODE_AGAIN = 121, /**< redo */ + SDL_SCANCODE_UNDO = 122, + SDL_SCANCODE_CUT = 123, + SDL_SCANCODE_COPY = 124, + SDL_SCANCODE_PASTE = 125, + SDL_SCANCODE_FIND = 126, + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, +/* not sure whether there's a reason to enable these */ +/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ +/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ +/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + footnotes in USB doc */ + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ + SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ + SDL_SCANCODE_LANG3 = 146, /**< Katakana */ + SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ + SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ + SDL_SCANCODE_LANG6 = 149, /**< reserved */ + SDL_SCANCODE_LANG7 = 150, /**< reserved */ + SDL_SCANCODE_LANG8 = 151, /**< reserved */ + SDL_SCANCODE_LANG9 = 152, /**< reserved */ + + SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, /**< alt, option */ + SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + SDL_SCANCODE_RALT = 230, /**< alt gr, option */ + SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ + + SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered + * by any of the above, but since there's a + * special KMOD_MODE for it I'm adding it here + */ + + /* @} *//* Usage page 0x07 */ + + /** + * \name Usage page 0x0C + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /* @{ */ + + SDL_SCANCODE_AUDIONEXT = 258, + SDL_SCANCODE_AUDIOPREV = 259, + SDL_SCANCODE_AUDIOSTOP = 260, + SDL_SCANCODE_AUDIOPLAY = 261, + SDL_SCANCODE_AUDIOMUTE = 262, + SDL_SCANCODE_MEDIASELECT = 263, + SDL_SCANCODE_WWW = 264, + SDL_SCANCODE_MAIL = 265, + SDL_SCANCODE_CALCULATOR = 266, + SDL_SCANCODE_COMPUTER = 267, + SDL_SCANCODE_AC_SEARCH = 268, + SDL_SCANCODE_AC_HOME = 269, + SDL_SCANCODE_AC_BACK = 270, + SDL_SCANCODE_AC_FORWARD = 271, + SDL_SCANCODE_AC_STOP = 272, + SDL_SCANCODE_AC_REFRESH = 273, + SDL_SCANCODE_AC_BOOKMARKS = 274, + + /* @} *//* Usage page 0x0C */ + + /** + * \name Walther keys + * + * These are values that Christian Walther added (for mac keyboard?). + */ + /* @{ */ + + SDL_SCANCODE_BRIGHTNESSDOWN = 275, + SDL_SCANCODE_BRIGHTNESSUP = 276, + SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display + switch, video mode switch */ + SDL_SCANCODE_KBDILLUMTOGGLE = 278, + SDL_SCANCODE_KBDILLUMDOWN = 279, + SDL_SCANCODE_KBDILLUMUP = 280, + SDL_SCANCODE_EJECT = 281, + SDL_SCANCODE_SLEEP = 282, + + SDL_SCANCODE_APP1 = 283, + SDL_SCANCODE_APP2 = 284, + + /* @} *//* Walther keys */ + + /** + * \name Usage page 0x0C (additional media keys) + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /* @{ */ + + SDL_SCANCODE_AUDIOREWIND = 285, + SDL_SCANCODE_AUDIOFASTFORWARD = 286, + + /* @} *//* Usage page 0x0C (additional media keys) */ + + /* Add any other keys here. */ + + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes + for array bounds */ +} SDL_Scancode; + +#endif /* SDL_scancode_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_sensor.h b/Windows/SDL2/include/SDL2/SDL_sensor.h new file mode 100644 index 00000000..5122ee15 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_sensor.h @@ -0,0 +1,251 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_sensor.h + * + * Include file for SDL sensor event handling + * + */ + +#ifndef SDL_sensor_h_ +#define SDL_sensor_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief SDL_sensor.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system + * for sensors, and load appropriate drivers. + */ + +struct _SDL_Sensor; +typedef struct _SDL_Sensor SDL_Sensor; + +/** + * This is a unique ID for a sensor for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. + */ +typedef Sint32 SDL_SensorID; + +/* The different sensors defined by SDL + * + * Additional sensors may be available, using platform dependent semantics. + * + * Hare are the additional Android sensors: + * https://developer.android.com/reference/android/hardware/SensorEvent.html#values + */ +typedef enum +{ + SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */ + SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */ + SDL_SENSOR_ACCEL, /**< Accelerometer */ + SDL_SENSOR_GYRO /**< Gyroscope */ +} SDL_SensorType; + +/** + * Accelerometer sensor + * + * The accelerometer returns the current acceleration in SI meters per + * second squared. This includes gravity, so a device at rest will have + * an acceleration of SDL_STANDARD_GRAVITY straight down. + * + * values[0]: Acceleration on the x axis + * values[1]: Acceleration on the y axis + * values[2]: Acceleration on the z axis + * + * For phones held in portrait mode, the axes are defined as follows: + * -X ... +X : left ... right + * -Y ... +Y : bottom ... top + * -Z ... +Z : farther ... closer + * + * The axis data is not changed when the phone is rotated. + * + * \sa SDL_GetDisplayOrientation() + */ +#define SDL_STANDARD_GRAVITY 9.80665f + +/** + * Gyroscope sensor + * + * The gyroscope returns the current rate of rotation in radians per second. + * The rotation is positive in the counter-clockwise direction. That is, + * an observer looking from a positive location on one of the axes would + * see positive rotation on that axis when it appeared to be rotating + * counter-clockwise. + * + * values[0]: Angular speed around the x axis + * values[1]: Angular speed around the y axis + * values[2]: Angular speed around the z axis + * + * For phones held in portrait mode, the axes are defined as follows: + * -X ... +X : left ... right + * -Y ... +Y : bottom ... top + * -Z ... +Z : farther ... closer + * + * The axis data is not changed when the phone is rotated. + * + * \sa SDL_GetDisplayOrientation() + */ + +/* Function prototypes */ + +/** + * \brief Count the number of sensors attached to the system right now + */ +extern DECLSPEC int SDLCALL SDL_NumSensors(void); + +/** + * \brief Get the implementation dependent name of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor name, or NULL if device_index is out of range. + */ +extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); + +/** + * \brief Get the type of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range. + */ +extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index); + +/** + * \brief Get the platform dependent type of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor platform dependent type, or -1 if device_index is out of range. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); + +/** + * \brief Get the instance ID of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor instance ID, or -1 if device_index is out of range. + */ +extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); + +/** + * \brief Open a sensor for use. + * + * The index passed as an argument refers to the N'th sensor on the system. + * + * \return A sensor identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); + +/** + * Return the SDL_Sensor associated with an instance id. + */ +extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id); + +/** + * \brief Get the implementation dependent name of a sensor. + * + * \return The sensor name, or NULL if the sensor is NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); + +/** + * \brief Get the type of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL. + */ +extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); + +/** + * \brief Get the platform dependent type of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor platform dependent type, or -1 if the sensor is NULL. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); + +/** + * \brief Get the instance ID of a sensor. + * + * This can be called before any sensors are opened. + * + * \return The sensor instance ID, or -1 if the sensor is NULL. + */ +extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); + +/** + * Get the current state of an opened sensor. + * + * The number of values and interpretation of the data is sensor dependent. + * + * \param sensor The sensor to query + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * + * \return 0 or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values); + +/** + * Close a sensor previously opened with SDL_SensorOpen() + */ +extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor); + +/** + * Update the current state of the open sensors. + * + * This is called automatically by the event loop if sensor events are enabled. + * + * This needs to be called from the thread that initialized the sensor subsystem. + */ +extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* SDL_sensor_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_shape.h b/Windows/SDL2/include/SDL2/SDL_shape.h new file mode 100644 index 00000000..cbd9debd --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_shape.h @@ -0,0 +1,144 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_shape_h_ +#define SDL_shape_h_ + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file SDL_shape.h + * + * Header file for the shaped window API. + */ + +#define SDL_NONSHAPEABLE_WINDOW -1 +#define SDL_INVALID_SHAPE_ARGUMENT -2 +#define SDL_WINDOW_LACKS_SHAPE -3 + +/** + * \brief Create a window that can be shaped with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: + * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, + * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, + * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. + * + * \return The window created, or NULL if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); + +/** + * \brief Return whether the given window is a shaped window. + * + * \param window The window to query for being shaped. + * + * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. + * + * \sa SDL_CreateShapedWindow + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); + +/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ +typedef enum { + /** \brief The default mode, a binarized alpha cutoff of 1. */ + ShapeModeDefault, + /** \brief A binarized alpha cutoff with a given integer value. */ + ShapeModeBinarizeAlpha, + /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ + ShapeModeReverseBinarizeAlpha, + /** \brief A color key is applied. */ + ShapeModeColorKey +} WindowShapeMode; + +#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) + +/** \brief A union containing parameters for shaped windows. */ +typedef union { + /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */ + Uint8 binarizationCutoff; + SDL_Color colorKey; +} SDL_WindowShapeParams; + +/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ +typedef struct SDL_WindowShapeMode { + /** \brief The mode of these window-shape parameters. */ + WindowShapeMode mode; + /** \brief Window-shape parameters. */ + SDL_WindowShapeParams parameters; +} SDL_WindowShapeMode; + +/** + * \brief Set the shape and parameters of a shaped window. + * + * \param window The shaped window whose parameters should be set. + * \param shape A surface encoding the desired shape for the window. + * \param shape_mode The parameters to set for the shaped window. + * + * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW + * if the SDL_Window given does not reference a valid shaped window. + * + * \sa SDL_WindowShapeMode + * \sa SDL_GetShapedWindowMode. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + +/** + * \brief Get the shape parameters of a shaped window. + * + * \param window The shaped window whose parameters should be retrieved. + * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. + * + * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode + * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if + * the SDL_Window given is a shapeable window currently lacking a shape. + * + * \sa SDL_WindowShapeMode + * \sa SDL_SetWindowShape + */ +extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_shape_h_ */ diff --git a/Windows/SDL2/include/SDL2/SDL_stdinc.h b/Windows/SDL2/include/SDL2/SDL_stdinc.h new file mode 100644 index 00000000..d96e18bc --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_stdinc.h @@ -0,0 +1,617 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_stdinc.h + * + * This is a general header that includes C language support. + */ + +#ifndef SDL_stdinc_h_ +#define SDL_stdinc_h_ + +#include "SDL_config.h" + +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif +#if defined(STDC_HEADERS) +# include <stdlib.h> +# include <stddef.h> +# include <stdarg.h> +#else +# if defined(HAVE_STDLIB_H) +# include <stdlib.h> +# elif defined(HAVE_MALLOC_H) +# include <malloc.h> +# endif +# if defined(HAVE_STDDEF_H) +# include <stddef.h> +# endif +# if defined(HAVE_STDARG_H) +# include <stdarg.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_WCHAR_H +# include <wchar.h> +#endif +#if defined(HAVE_INTTYPES_H) +# include <inttypes.h> +#elif defined(HAVE_STDINT_H) +# include <stdint.h> +#endif +#ifdef HAVE_CTYPE_H +# include <ctype.h> +#endif +#ifdef HAVE_MATH_H +# if defined(__WINRT__) +/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on + WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx + for more information. +*/ +# define _USE_MATH_DEFINES +# endif +# include <math.h> +#endif +#ifdef HAVE_FLOAT_H +# include <float.h> +#endif +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include <alloca.h> +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include <malloc.h> +# define alloca _alloca +# elif defined(__WATCOMC__) +# include <malloc.h> +# elif defined(__BORLANDC__) +# include <malloc.h> +# elif defined(__DMC__) +# include <stdlib.h> +# elif defined(__AIX__) +#pragma alloca +# elif defined(__MRC__) +void *alloca(unsigned); +# else +char *alloca(); +# endif +#endif + +/** + * The number of elements in an array. + */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/** + * Macro useful for building other macros with strings in them + * + * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") + */ +#define SDL_STRINGIFY_ARG(arg) #arg + +/** + * \name Cast operators + * + * Use proper C++ casts when compiled as C++ to be compatible with the option + * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). + */ +/* @{ */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression) +#define SDL_static_cast(type, expression) static_cast<type>(expression) +#define SDL_const_cast(type, expression) const_cast<type>(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#define SDL_const_cast(type, expression) ((type)(expression)) +#endif +/* @} *//* Cast operators */ + +/* Define a four character code as a Uint32 */ +#define SDL_FOURCC(A, B, C, D) \ + ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) + +/** + * \name Basic data types + */ +/* @{ */ + +#ifdef __CC_ARM +/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */ +#define SDL_FALSE 0 +#define SDL_TRUE 1 +typedef int SDL_bool; +#else +typedef enum +{ + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; +#endif + +/** + * \brief A signed 8-bit integer type. + */ +#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ +#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ +typedef int8_t Sint8; +/** + * \brief An unsigned 8-bit integer type. + */ +#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ +#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ +typedef uint8_t Uint8; +/** + * \brief A signed 16-bit integer type. + */ +#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ +#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ +typedef int16_t Sint16; +/** + * \brief An unsigned 16-bit integer type. + */ +#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ +#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ +typedef uint16_t Uint16; +/** + * \brief A signed 32-bit integer type. + */ +#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ +#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ +typedef int32_t Sint32; +/** + * \brief An unsigned 32-bit integer type. + */ +#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ +#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ +typedef uint32_t Uint32; + +/** + * \brief A signed 64-bit integer type. + */ +#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ +#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ +typedef int64_t Sint64; +/** + * \brief An unsigned 64-bit integer type. + */ +#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ +#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ +typedef uint64_t Uint64; + +/* @} *//* Basic data types */ + +/* Make sure we have macros for printing 64 bit values. + * <stdint.h> should define these but this is not true all platforms. + * (for example win32) */ +#ifndef SDL_PRIs64 +#ifdef PRIs64 +#define SDL_PRIs64 PRIs64 +#elif defined(__WIN32__) +#define SDL_PRIs64 "I64d" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIs64 "ld" +#else +#define SDL_PRIs64 "lld" +#endif +#endif +#ifndef SDL_PRIu64 +#ifdef PRIu64 +#define SDL_PRIu64 PRIu64 +#elif defined(__WIN32__) +#define SDL_PRIu64 "I64u" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIu64 "lu" +#else +#define SDL_PRIu64 "llu" +#endif +#endif +#ifndef SDL_PRIx64 +#ifdef PRIx64 +#define SDL_PRIx64 PRIx64 +#elif defined(__WIN32__) +#define SDL_PRIx64 "I64x" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIx64 "lx" +#else +#define SDL_PRIx64 "llx" +#endif +#endif +#ifndef SDL_PRIX64 +#ifdef PRIX64 +#define SDL_PRIX64 PRIX64 +#elif defined(__WIN32__) +#define SDL_PRIX64 "I64X" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIX64 "lX" +#else +#define SDL_PRIX64 "llX" +#endif +#endif + +/* Annotations to help code analysis tools */ +#ifdef SDL_DISABLE_ANALYZE_MACROS +#define SDL_IN_BYTECAP(x) +#define SDL_INOUT_Z_CAP(x) +#define SDL_OUT_Z_CAP(x) +#define SDL_OUT_CAP(x) +#define SDL_OUT_BYTECAP(x) +#define SDL_OUT_Z_BYTECAP(x) +#define SDL_PRINTF_FORMAT_STRING +#define SDL_SCANF_FORMAT_STRING +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#else +#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ +#include <sal.h> + +#define SDL_IN_BYTECAP(x) _In_bytecount_(x) +#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) +#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) +#define SDL_OUT_CAP(x) _Out_cap_(x) +#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) +#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) + +#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ +#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ +#else +#define SDL_IN_BYTECAP(x) +#define SDL_INOUT_Z_CAP(x) +#define SDL_OUT_Z_CAP(x) +#define SDL_OUT_CAP(x) +#define SDL_OUT_BYTECAP(x) +#define SDL_OUT_Z_BYTECAP(x) +#define SDL_PRINTF_FORMAT_STRING +#define SDL_SCANF_FORMAT_STRING +#endif +#if defined(__GNUC__) +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) +#else +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#endif +#endif /* SDL_DISABLE_ANALYZE_MACROS */ + +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1] +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +/* Check to make sure enums are the size of ints, for structure packing. + For both Watcom C/C++ and Borland C/C++ the compiler option that makes + enums having the size of an int must be enabled. + This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). +*/ + +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#if !defined(__ANDROID__) + /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +typedef enum +{ + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); +extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); +extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); +extern DECLSPEC void SDLCALL SDL_free(void *mem); + +typedef void *(SDLCALL *SDL_malloc_func)(size_t size); +typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); +typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); +typedef void (SDLCALL *SDL_free_func)(void *mem); + +/** + * \brief Get the current set of SDL memory functions + */ +extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, + SDL_calloc_func *calloc_func, + SDL_realloc_func *realloc_func, + SDL_free_func *free_func); + +/** + * \brief Replace SDL's memory allocation functions with a custom set + * + * \note If you are replacing SDL's memory functions, you should call + * SDL_GetNumAllocations() and be very careful if it returns non-zero. + * That means that your free function will be called with memory + * allocated by the previous memory allocation functions. + */ +extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, + SDL_calloc_func calloc_func, + SDL_realloc_func realloc_func, + SDL_free_func free_func); + +/** + * \brief Get the number of outstanding (unfreed) allocations + */ +extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); + +extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); +extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); + +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); + +extern DECLSPEC int SDLCALL SDL_abs(int x); + +/* !!! FIXME: these have side effects. You probably shouldn't use them. */ +/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +extern DECLSPEC int SDLCALL SDL_isdigit(int x); +extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_isupper(int x); +extern DECLSPEC int SDLCALL SDL_islower(int x); +extern DECLSPEC int SDLCALL SDL_toupper(int x); +extern DECLSPEC int SDLCALL SDL_tolower(int x); + +extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); + +#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) +#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) +#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x))) + +/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ +SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) +{ +#ifdef __APPLE__ + memset_pattern4(dst, &val, dwords * 4); +#elif defined(__GNUC__) && defined(i386) + int u0, u1, u2; + __asm__ __volatile__ ( + "cld \n\t" + "rep ; stosl \n\t" + : "=&D" (u0), "=&a" (u1), "=&c" (u2) + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) + : "memory" + ); +#else + size_t _n = (dwords + 3) / 4; + Uint32 *_p = SDL_static_cast(Uint32 *, dst); + Uint32 _val = (val); + if (dwords == 0) + return; + switch (dwords % 4) + { + case 0: do { *_p++ = _val; /* fallthrough */ + case 3: *_p++ = _val; /* fallthrough */ + case 2: *_p++ = _val; /* fallthrough */ + case 1: *_p++ = _val; /* fallthrough */ + } while ( --_n ); + } +#endif +} + +extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); + +extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); + +extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); +extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); + +extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); + +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); +extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); +extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); +extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); +extern DECLSPEC char *SDLCALL SDL_strrev(char *str); +extern DECLSPEC char *SDLCALL SDL_strupr(char *str); +extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); +extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); +extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); +extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); + +extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); + +extern DECLSPEC int SDLCALL SDL_atoi(const char *str); +extern DECLSPEC double SDLCALL SDL_atof(const char *str); +extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); +extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); + +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); + +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); + +#ifndef HAVE_M_PI +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 /**< pi */ +#endif +#endif + +extern DECLSPEC double SDLCALL SDL_acos(double x); +extern DECLSPEC float SDLCALL SDL_acosf(float x); +extern DECLSPEC double SDLCALL SDL_asin(double x); +extern DECLSPEC float SDLCALL SDL_asinf(float x); +extern DECLSPEC double SDLCALL SDL_atan(double x); +extern DECLSPEC float SDLCALL SDL_atanf(float x); +extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); +extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y); +extern DECLSPEC double SDLCALL SDL_ceil(double x); +extern DECLSPEC float SDLCALL SDL_ceilf(float x); +extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); +extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y); +extern DECLSPEC double SDLCALL SDL_cos(double x); +extern DECLSPEC float SDLCALL SDL_cosf(float x); +extern DECLSPEC double SDLCALL SDL_exp(double x); +extern DECLSPEC float SDLCALL SDL_expf(float x); +extern DECLSPEC double SDLCALL SDL_fabs(double x); +extern DECLSPEC float SDLCALL SDL_fabsf(float x); +extern DECLSPEC double SDLCALL SDL_floor(double x); +extern DECLSPEC float SDLCALL SDL_floorf(float x); +extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); +extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); +extern DECLSPEC double SDLCALL SDL_log(double x); +extern DECLSPEC float SDLCALL SDL_logf(float x); +extern DECLSPEC double SDLCALL SDL_log10(double x); +extern DECLSPEC float SDLCALL SDL_log10f(float x); +extern DECLSPEC double SDLCALL SDL_pow(double x, double y); +extern DECLSPEC float SDLCALL SDL_powf(float x, float y); +extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); +extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n); +extern DECLSPEC double SDLCALL SDL_sin(double x); +extern DECLSPEC float SDLCALL SDL_sinf(float x); +extern DECLSPEC double SDLCALL SDL_sqrt(double x); +extern DECLSPEC float SDLCALL SDL_sqrtf(float x); +extern DECLSPEC double SDLCALL SDL_tan(double x); +extern DECLSPEC float SDLCALL SDL_tanf(float x); + +/* The SDL implementation of iconv() returns these error codes */ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 + +/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, + const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, + size_t * inbytesleft, char **outbuf, + size_t * outbytesleft); +/** + * This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, + const char *fromcode, + const char *inbuf, + size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) + +/* force builds using Clang's static analysis tools to use literal C runtime + here, since there are possibly tests that are ineffective otherwise. */ +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_malloc malloc +#define SDL_calloc calloc +#define SDL_realloc realloc +#define SDL_free free +#define SDL_memset memset +#define SDL_memcpy memcpy +#define SDL_memmove memmove +#define SDL_memcmp memcmp +#define SDL_strlen strlen +#define SDL_strlcpy strlcpy +#define SDL_strlcat strlcat +#define SDL_strdup strdup +#define SDL_strchr strchr +#define SDL_strrchr strrchr +#define SDL_strstr strstr +#define SDL_strtokr strtok_r +#define SDL_strcmp strcmp +#define SDL_strncmp strncmp +#define SDL_strcasecmp strcasecmp +#define SDL_strncasecmp strncasecmp +#define SDL_sscanf sscanf +#define SDL_vsscanf vsscanf +#define SDL_snprintf snprintf +#define SDL_vsnprintf vsnprintf +#endif + +SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) +{ + return SDL_memcpy(dst, src, dwords * 4); +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_stdinc_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_surface.h b/Windows/SDL2/include/SDL2/SDL_surface.h new file mode 100644 index 00000000..0f11d178 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_surface.h @@ -0,0 +1,554 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_surface.h + * + * Header file for ::SDL_Surface definition and management functions. + */ + +#ifndef SDL_surface_h_ +#define SDL_surface_h_ + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_blendmode.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Surface flags + * + * These are the currently supported flags for the ::SDL_Surface. + * + * \internal + * Used internally (read-only). + */ +/* @{ */ +#define SDL_SWSURFACE 0 /**< Just here for compatibility */ +#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ +#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ +#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ +#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */ +/* @} *//* Surface flags */ + +/** + * Evaluates to true if the surface needs to be locked before access. + */ +#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) + +/** + * \brief A collection of pixels used in software blitting. + * + * \note This structure should be treated as read-only, except for \c pixels, + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface +{ + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + int pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + + /** Application data associated with the surface */ + void *userdata; /**< Read-write */ + + /** information needed for surfaces requiring locks */ + int locked; /**< Read-only */ + void *lock_data; /**< Read-only */ + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** + * \brief The type of function used for surface blitting functions. + */ +typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, + struct SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief The formula used for converting between YUV and RGB + */ +typedef enum +{ + SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ + SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ + SDL_YUV_CONVERSION_BT709, /**< BT.709 */ + SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ +} SDL_YUV_CONVERSION_MODE; + +/** + * Allocate and free an RGB surface. + * + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * + * If the function runs out of memory, it will return NULL. + * + * \param flags The \c flags are obsolete and should be set to 0. + * \param width The width in pixels of the surface to create. + * \param height The height in pixels of the surface to create. + * \param depth The depth in bits of the surface to create. + * \param Rmask The red mask of the surface to create. + * \param Gmask The green mask of the surface to create. + * \param Bmask The blue mask of the surface to create. + * \param Amask The alpha mask of the surface to create. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); + +/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat + (Uint32 flags, int width, int height, int depth, Uint32 format); + +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, + int height, + int depth, + int pitch, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom + (void *pixels, int width, int height, int depth, int pitch, Uint32 format); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); + +/** + * \brief Set the palette used by a surface. + * + * \return 0, or -1 if the surface format doesn't use a palette. + * + * \note A single palette can be shared with many surfaces. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, + SDL_Palette * palette); + +/** + * \brief Sets up a surface for directly accessing the pixels. + * + * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write + * to and read from \c surface->pixels, using the pixel format stored in + * \c surface->format. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + * + * \sa SDL_UnlockSurface() + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); +/** \sa SDL_LockSurface() */ +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); + +/** + * Load a surface from a seekable SDL data stream (memory or file). + * + * If \c freesrc is non-zero, the stream will be closed after being read. + * + * The new surface should be freed with SDL_FreeSurface(). + * + * \return the new surface, or NULL if there was an error. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, + int freesrc); + +/** + * Load a surface from a file. + * + * Convenience macro. + */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data stream (memory or file). + * + * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the + * BMP directly. Other RGB formats with 8-bit or higher get converted to a + * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit + * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are + * not supported. + * + * If \c freedst is non-zero, the stream will be closed after being written. + * + * \return 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface * surface, SDL_RWops * dst, int freedst); + +/** + * Save a surface to a file. + * + * Convenience macro. + */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * \brief Sets the RLE acceleration hint for a surface. + * + * \return 0 on success, or -1 if the surface is not valid + * + * \note If RLE is enabled, colorkey and alpha blending blits are much faster, + * but the surface must be locked before directly accessing the pixels. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, + int flag); + +/** + * \brief Sets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param flag Non-zero to enable colorkey and 0 to disable colorkey + * \param key The transparent pixel in the native surface format + * + * \return 0 on success, or -1 if the surface is not valid + * + * You can pass SDL_RLEACCEL to enable RLE accelerated blits. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, + int flag, Uint32 key); + +/** + * \brief Returns whether the surface has a color key + * + * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); + +/** + * \brief Gets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param key A pointer filled in with the transparent pixel in the native + * surface format + * + * \return 0 on success, or -1 if the surface is not valid or colorkey is not + * enabled. + */ +extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, + Uint32 * key); + +/** + * \brief Set an additional color value used in blit operations. + * + * \param surface The surface to update. + * \param r The red color value multiplied into blit operations. + * \param g The green color value multiplied into blit operations. + * \param b The blue color value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in blit operations. + * + * \param surface The surface to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in blit operations. + * + * \param surface The surface to update. + * \param alpha The alpha value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in blit operations. + * + * \param surface The surface to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for blit operations. + * + * \param surface The surface to update. + * \param blendMode ::SDL_BlendMode to use for blit blending. + * + * \return 0 on success, or -1 if the parameters are not valid. + * + * \sa SDL_GetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for blit operations. + * + * \param surface The surface to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode *blendMode); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, + const SDL_Rect * rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * + * \c rect must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, + SDL_Rect * rect); + +/* + * Creates a new surface identical to the existing surface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface + (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat + (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); + +/** + * \brief Copy a block of pixels of one format to another format + * + * \return 0 on success, or -1 if there was an error + */ +extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, + Uint32 src_format, + const void * src, int src_pitch, + Uint32 dst_format, + void * dst, int dst_pitch); + +/** + * Performs a fast fill of the given rectangle with \c color. + * + * If \c rect is NULL, the whole surface will be filled with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); +extern DECLSPEC int SDLCALL SDL_FillRects + (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); + +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are + * the same size. If either \c srcrect or \c dstrect are NULL, the entire + * surface (\c src or \c dst) is copied. The final blit rectangles are saved + * in \c srcrect and \c dstrect after all clipping is performed. + * + * \return If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without blending and colorkey + * are defined as follows: + * \verbatim + RGBA->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB, set destination alpha to source per-surface alpha value. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + + RGBA->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + \endverbatim + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** + * This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief Perform a fast, low quality, stretch blit between two surfaces of the + * same pixel format. + * + * \note This function uses a static buffer, and is not thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + +#define SDL_BlitScaled SDL_UpperBlitScaled + +/** + * This is the public scaled blit function, SDL_BlitScaled(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlitScaled + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * scaled blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlitScaled + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief Set the YUV conversion mode + */ +extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); + +/** + * \brief Get the YUV conversion mode + */ +extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); + +/** + * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC + */ +extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_surface_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_system.h b/Windows/SDL2/include/SDL2/SDL_system.h new file mode 100644 index 00000000..d7974eb0 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_system.h @@ -0,0 +1,316 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_system.h + * + * Include file for platform specific SDL API functions + */ + +#ifndef SDL_system_h_ +#define SDL_system_h_ + +#include "SDL_stdinc.h" +#include "SDL_keyboard.h" +#include "SDL_render.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* Platform specific functions for Windows */ +#ifdef __WIN32__ + +/** + \brief Set a function that is called for every windows message, before TranslateMessage() +*/ +typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); +extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); + +/** + \brief Returns the D3D9 adapter index that matches the specified display index. + + This adapter index can be passed to IDirect3D9::CreateDevice and controls + on which monitor a full screen application will appear. +*/ +extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); + +typedef struct IDirect3DDevice9 IDirect3DDevice9; +/** + \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. + + Once you are done using the device, you should release it to avoid a resource leak. + */ +extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); + +/** + \brief Returns the DXGI Adapter and Output indices for the specified display index. + + These can be passed to EnumAdapters and EnumOutputs respectively to get the objects + required to create a DX10 or DX11 device and swap chain. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); + +#endif /* __WIN32__ */ + + +/* Platform specific functions for Linux */ +#ifdef __LINUX__ + +/** + \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available. + + \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); + +#endif /* __LINUX__ */ + +/* Platform specific functions for iOS */ +#ifdef __IPHONEOS__ + +#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); + +#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); + +#endif /* __IPHONEOS__ */ + + +/* Platform specific functions for Android */ +#ifdef __ANDROID__ + +/** + \brief Get the JNI environment for the current thread + + This returns JNIEnv*, but the prototype is void* so we don't need jni.h + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); + +/** + \brief Get the SDL Activity object for the application + + This returns jobject, but the prototype is void* so we don't need jni.h + The jobject returned by SDL_AndroidGetActivity is a local reference. + It is the caller's responsibility to properly release it + (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); + +/** + \brief Return API level of the current device + + API level 29: Android 10 + API level 28: Android 9 + API level 27: Android 8.1 + API level 26: Android 8.0 + API level 25: Android 7.1 + API level 24: Android 7.0 + API level 23: Android 6.0 + API level 22: Android 5.1 + API level 21: Android 5.0 + API level 20: Android 4.4W + API level 19: Android 4.4 + API level 18: Android 4.3 + API level 17: Android 4.2 + API level 16: Android 4.1 + API level 15: Android 4.0.3 + API level 14: Android 4.0 + API level 13: Android 3.2 + API level 12: Android 3.1 + API level 11: Android 3.0 + API level 10: Android 2.3.3 + */ +extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); + +/** + \brief Return true if the application is running on Android TV + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); + +/** + \brief Return true if the application is running on a Chromebook + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); + +/** + \brief Return true is the application is running on a Samsung DeX docking station + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); + +/** + \brief Trigger the Android system back button behavior. + */ +extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); + +/** + See the official Android developer guide for more information: + http://developer.android.com/guide/topics/data/data-storage.html +*/ +#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 + +/** + \brief Get the path used for internal storage for this application. + + This path is unique to your application and cannot be written to + by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); + +/** + \brief Get the current state of external storage, a bitmask of these values: + SDL_ANDROID_EXTERNAL_STORAGE_READ + SDL_ANDROID_EXTERNAL_STORAGE_WRITE + + If external storage is currently unavailable, this will return 0. +*/ +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); + +/** + \brief Get the path used for external storage for this application. + + This path is unique to your application, but is public and can be + written to by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); + +#endif /* __ANDROID__ */ + +/* Platform specific functions for WinRT */ +#ifdef __WINRT__ + +/** + * \brief WinRT / Windows Phone path types + */ +typedef enum +{ + /** \brief The installed app's root directory. + Files here are likely to be read-only. */ + SDL_WINRT_PATH_INSTALLED_LOCATION, + + /** \brief The app's local data store. Files may be written here */ + SDL_WINRT_PATH_LOCAL_FOLDER, + + /** \brief The app's roaming data store. Unsupported on Windows Phone. + Files written here may be copied to other machines via a network + connection. + */ + SDL_WINRT_PATH_ROAMING_FOLDER, + + /** \brief The app's temporary data store. Unsupported on Windows Phone. + Files written here may be deleted at any time. */ + SDL_WINRT_PATH_TEMP_FOLDER +} SDL_WinRT_Path; + + +/** + * \brief WinRT Device Family + */ +typedef enum +{ + /** \brief Unknown family */ + SDL_WINRT_DEVICEFAMILY_UNKNOWN, + + /** \brief Desktop family*/ + SDL_WINRT_DEVICEFAMILY_DESKTOP, + + /** \brief Mobile family (for example smartphone) */ + SDL_WINRT_DEVICEFAMILY_MOBILE, + + /** \brief XBox family */ + SDL_WINRT_DEVICEFAMILY_XBOX, +} SDL_WinRT_DeviceFamily; + + +/** + * \brief Retrieves a WinRT defined path on the local file system + * + * \note Documentation on most app-specific path types on WinRT + * can be found on MSDN, at the URL: + * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx + * + * \param pathType The type of path to retrieve. + * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL + * if the path is not available for any reason. Not all paths are + * available on all versions of Windows. This is especially true on + * Windows Phone. Check the documentation for the given + * SDL_WinRT_Path for more information on which path types are + * supported where. + */ +extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); + +/** + * \brief Retrieves a WinRT defined path on the local file system + * + * \note Documentation on most app-specific path types on WinRT + * can be found on MSDN, at the URL: + * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx + * + * \param pathType The type of path to retrieve. + * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL + * if the path is not available for any reason. Not all paths are + * available on all versions of Windows. This is especially true on + * Windows Phone. Check the documentation for the given + * SDL_WinRT_Path for more information on which path types are + * supported where. + */ +extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); + +/** + * \brief Detects the device family of WinRT plattform on runtime + * + * \return Device family + */ +extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); + +#endif /* __WINRT__ */ + +/** + \brief Return true if the current device is a tablet. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); + +/* Functions used by iOS application delegates to notify SDL about state changes */ +extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void); +#ifdef __IPHONEOS__ +extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); +#endif + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_system_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_syswm.h b/Windows/SDL2/include/SDL2/SDL_syswm.h new file mode 100644 index 00000000..e877b2aa --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_syswm.h @@ -0,0 +1,331 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_syswm.h + * + * Include file for SDL custom system window manager hooks. + */ + +#ifndef SDL_syswm_h_ +#define SDL_syswm_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_version.h" + +/** + * \brief SDL_syswm.h + * + * Your application has access to a special type of event ::SDL_SYSWMEVENT, + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState(). + */ +struct SDL_SysWMinfo; + +#if !defined(SDL_PROTOTYPES_ONLY) + +#if defined(SDL_VIDEO_DRIVER_WINDOWS) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX /* don't define min() and max(). */ +#define NOMINMAX +#endif +#include <windows.h> +#endif + +#if defined(SDL_VIDEO_DRIVER_WINRT) +#include <Inspectable.h> +#endif + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include <X11/Xlib.h> +#include <X11/Xatom.h> + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +#endif /* defined(SDL_VIDEO_DRIVER_X11) */ + +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) +#include <directfb.h> +#endif + +#if defined(SDL_VIDEO_DRIVER_COCOA) +#ifdef __OBJC__ +@class NSWindow; +#else +typedef struct _NSWindow NSWindow; +#endif +#endif + +#if defined(SDL_VIDEO_DRIVER_UIKIT) +#ifdef __OBJC__ +#include <UIKit/UIKit.h> +#else +typedef struct _UIWindow UIWindow; +typedef struct _UIViewController UIViewController; +#endif +typedef Uint32 GLuint; +#endif + +#if defined(SDL_VIDEO_DRIVER_ANDROID) +typedef struct ANativeWindow ANativeWindow; +typedef void *EGLSurface; +#endif + +#if defined(SDL_VIDEO_DRIVER_VIVANTE) +#include "SDL_egl.h" +#endif +#endif /* SDL_PROTOTYPES_ONLY */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(SDL_PROTOTYPES_ONLY) +/** + * These are the various supported windowing subsystems + */ +typedef enum +{ + SDL_SYSWM_UNKNOWN, + SDL_SYSWM_WINDOWS, + SDL_SYSWM_X11, + SDL_SYSWM_DIRECTFB, + SDL_SYSWM_COCOA, + SDL_SYSWM_UIKIT, + SDL_SYSWM_WAYLAND, + SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ + SDL_SYSWM_WINRT, + SDL_SYSWM_ANDROID, + SDL_SYSWM_VIVANTE, + SDL_SYSWM_OS2, + SDL_SYSWM_HAIKU +} SDL_SYSWM_TYPE; + +/** + * The custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct { + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct { + XEvent event; + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct { + DFBEvent event; + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + /* Latest version of Xcode clang complains about empty structs in C v. C++: + error: empty struct has size 0 in C, size 1 in C++ + */ + int dummy; + /* No Cocoa window events yet */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + int dummy; + /* No UIKit window events yet */ + } uikit; +#endif +#if defined(SDL_VIDEO_DRIVER_VIVANTE) + struct + { + int dummy; + /* No Vivante window events yet */ + } vivante; +#endif + /* Can't have an empty union */ + int dummy; + } msg; +}; + +/** + * The custom window manager information structure. + * + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct + { + HWND window; /**< The window handle */ + HDC hdc; /**< The window device context */ + HINSTANCE hinstance; /**< The instance handle */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_WINRT) + struct + { + IInspectable * window; /**< The WinRT CoreWindow */ + } winrt; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct + { + Display *display; /**< The X11 display */ + Window window; /**< The X11 window */ + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct + { + IDirectFB *dfb; /**< The directfb main interface */ + IDirectFBWindow *window; /**< The directfb window handle */ + IDirectFBSurface *surface; /**< The directfb client surface */ + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { +#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) + NSWindow __unsafe_unretained *window; /**< The Cocoa window */ +#else + NSWindow *window; /**< The Cocoa window */ +#endif + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { +#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) + UIWindow __unsafe_unretained *window; /**< The UIKit window */ +#else + UIWindow *window; /**< The UIKit window */ +#endif + GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ + GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ + GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ + } uikit; +#endif +#if defined(SDL_VIDEO_DRIVER_WAYLAND) + struct + { + struct wl_display *display; /**< Wayland display */ + struct wl_surface *surface; /**< Wayland surface */ + struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */ + } wl; +#endif +#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ + struct + { + void *connection; /**< Mir display server connection */ + void *surface; /**< Mir surface */ + } mir; +#endif + +#if defined(SDL_VIDEO_DRIVER_ANDROID) + struct + { + ANativeWindow *window; + EGLSurface surface; + } android; +#endif + +#if defined(SDL_VIDEO_DRIVER_VIVANTE) + struct + { + EGLNativeDisplayType display; + EGLNativeWindowType window; + } vivante; +#endif + + /* Make sure this union is always 64 bytes (8 64-bit pointers). */ + /* Be careful not to overflow this if you add a new target! */ + Uint8 dummy[64]; + } info; +}; + +#endif /* SDL_PROTOTYPES_ONLY */ + +typedef struct SDL_SysWMinfo SDL_SysWMinfo; + +/* Function prototypes */ +/** + * \brief This function allows access to driver-dependent window information. + * + * \param window The window about which information is being requested + * \param info This structure must be initialized with the SDL version, and is + * then filled in with information about the given window. + * + * \return SDL_TRUE if the function is implemented and the version member of + * the \c info struct is valid, SDL_FALSE otherwise. + * + * You typically use this function like this: + * \code + * SDL_SysWMinfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } + * \endcode + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, + SDL_SysWMinfo * info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_syswm_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test.h b/Windows/SDL2/include/SDL2/SDL_test.h new file mode 100644 index 00000000..7095427a --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef SDL_test_h_ +#define SDL_test_h_ + +#include "SDL.h" +#include "SDL_test_assert.h" +#include "SDL_test_common.h" +#include "SDL_test_compare.h" +#include "SDL_test_crc32.h" +#include "SDL_test_font.h" +#include "SDL_test_fuzzer.h" +#include "SDL_test_harness.h" +#include "SDL_test_images.h" +#include "SDL_test_log.h" +#include "SDL_test_md5.h" +#include "SDL_test_memory.h" +#include "SDL_test_random.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Global definitions */ + +/* + * Note: Maximum size of SDLTest log message is less than SDL's limit + * to ensure we can fit additional information such as the timestamp. + */ +#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_assert.h b/Windows/SDL2/include/SDL2/SDL_test_assert.h new file mode 100644 index 00000000..19b90950 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_assert.h @@ -0,0 +1,105 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_assert.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Assert API for test code and test cases + * + */ + +#ifndef SDL_test_assert_h_ +#define SDL_test_assert_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Fails the assert. + */ +#define ASSERT_FAIL 0 + +/** + * \brief Passes the assert. + */ +#define ASSERT_PASS 1 + +/** + * \brief Assert that logs and break execution flow on failures. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + * + * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired. + */ +int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. + * + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Resets the assert summary counters to zero. + */ +void SDLTest_ResetAssertSummary(void); + +/** + * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. + */ +void SDLTest_LogAssertSummary(void); + + +/** + * \brief Converts the current assert summary state to a test result. + * + * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT + */ +int SDLTest_AssertSummaryToTestResult(void); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_assert_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_common.h b/Windows/SDL2/include/SDL2/SDL_test_common.h new file mode 100644 index 00000000..3ad20305 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_common.h @@ -0,0 +1,218 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_common.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* Ported from original test\common.h file. */ + +#ifndef SDL_test_common_h_ +#define SDL_test_common_h_ + +#include "SDL.h" + +#if defined(__PSP__) +#define DEFAULT_WINDOW_WIDTH 480 +#define DEFAULT_WINDOW_HEIGHT 272 +#else +#define DEFAULT_WINDOW_WIDTH 640 +#define DEFAULT_WINDOW_HEIGHT 480 +#endif + +#define VERBOSE_VIDEO 0x00000001 +#define VERBOSE_MODES 0x00000002 +#define VERBOSE_RENDER 0x00000004 +#define VERBOSE_EVENT 0x00000008 +#define VERBOSE_AUDIO 0x00000010 + +typedef struct +{ + /* SDL init flags */ + char **argv; + Uint32 flags; + Uint32 verbose; + + /* Video info */ + const char *videodriver; + int display; + const char *window_title; + const char *window_icon; + Uint32 window_flags; + int window_x; + int window_y; + int window_w; + int window_h; + int window_minW; + int window_minH; + int window_maxW; + int window_maxH; + int logical_w; + int logical_h; + float scale; + int depth; + int refresh_rate; + int num_windows; + SDL_Window **windows; + + /* Renderer info */ + const char *renderdriver; + Uint32 render_flags; + SDL_bool skip_renderer; + SDL_Renderer **renderers; + SDL_Texture **targets; + + /* Audio info */ + const char *audiodriver; + SDL_AudioSpec audiospec; + + /* GL settings */ + int gl_red_size; + int gl_green_size; + int gl_blue_size; + int gl_alpha_size; + int gl_buffer_size; + int gl_depth_size; + int gl_stencil_size; + int gl_double_buffer; + int gl_accum_red_size; + int gl_accum_green_size; + int gl_accum_blue_size; + int gl_accum_alpha_size; + int gl_stereo; + int gl_multisamplebuffers; + int gl_multisamplesamples; + int gl_retained_backing; + int gl_accelerated; + int gl_major_version; + int gl_minor_version; + int gl_debug; + int gl_profile_mask; +} SDLTest_CommonState; + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Parse command line parameters and create common state. + * + * \param argv Array of command line parameters + * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) + * + * \returns Returns a newly allocated common state object. + */ +SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); + +/** + * \brief Process one common argument. + * + * \param state The common state describing the test window to create. + * \param index The index of the argument to process in argv[]. + * + * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error. + */ +int SDLTest_CommonArg(SDLTest_CommonState * state, int index); + + +/** + * \brief Logs command line usage info. + * + * This logs the appropriate command line options for the subsystems in use + * plus other common options, and then any application-specific options. + * This uses the SDL_Log() function and splits up output to be friendly to + * 80-character-wide terminals. + * + * \param state The common state describing the test window for the app. + * \param argv0 argv[0], as passed to main/SDL_main. + * \param options an array of strings for application specific options. The last element of the array should be NULL. + */ +void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options); + +/** + * \brief Returns common usage information + * + * You should (probably) be using SDLTest_CommonLogUsage() instead, but this + * function remains for binary compatibility. Strings returned from this + * function are valid until SDLTest_CommonQuit() is called, in which case + * those strings' memory is freed and can no longer be used. + * + * \param state The common state describing the test window to create. + * \returns String with usage information + */ +const char *SDLTest_CommonUsage(SDLTest_CommonState * state); + +/** + * \brief Open test window. + * + * \param state The common state describing the test window to create. + * + * \returns True if initialization succeeded, false otherwise + */ +SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); + +/** + * \brief Easy argument handling when test app doesn't need any custom args. + * + * \param state The common state describing the test window to create. + * \param argc argc, as supplied to SDL_main + * \param argv argv, as supplied to SDL_main + * + * \returns False if app should quit, true otherwise. + */ +SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv); + +/** + * \brief Common event handler for test windows. + * + * \param state The common state used to create test window. + * \param event The event to handle. + * \param done Flag indicating we are done. + * + */ +void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); + +/** + * \brief Close test window. + * + * \param state The common state used to create test window. + * + */ +void SDLTest_CommonQuit(SDLTest_CommonState * state); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_common_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_compare.h b/Windows/SDL2/include/SDL2/SDL_test_compare.h new file mode 100644 index 00000000..38b22bb3 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_compare.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_compare.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines comparison functions (i.e. for surfaces). + +*/ + +#ifndef SDL_test_compare_h_ +#define SDL_test_compare_h_ + +#include "SDL.h" + +#include "SDL_test_images.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Compares a surface and with reference image data for equality + * + * \param surface Surface used in comparison + * \param referenceSurface Test Surface used in comparison + * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. + * + * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. + */ +int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_compare_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_crc32.h b/Windows/SDL2/include/SDL2/SDL_test_crc32.h new file mode 100644 index 00000000..611066ab --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_crc32.h @@ -0,0 +1,124 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_crc32.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Implements CRC32 calculations (default output is Perl String::CRC32 compatible). + +*/ + +#ifndef SDL_test_crc32_h_ +#define SDL_test_crc32_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ------------ Definitions --------- */ + +/* Definition shared by all CRC routines */ + +#ifndef CrcUint32 + #define CrcUint32 unsigned int +#endif +#ifndef CrcUint8 + #define CrcUint8 unsigned char +#endif + +#ifdef ORIGINAL_METHOD + #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ +#else + #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ +#endif + +/** + * Data structure for CRC32 (checksum) computation + */ + typedef struct { + CrcUint32 crc32_table[256]; /* CRC table */ + } SDLTest_Crc32Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * \brief Initialize the CRC context + * + * Note: The function initializes the crc table required for all crc calculations. + * + * \param crcContext pointer to context variable + * + * \returns 0 for OK, -1 on error + * + */ + int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); + + +/** + * \brief calculate a crc32 from a data block + * + * \param crcContext pointer to context variable + * \param inBuf input buffer to checksum + * \param inLen length of input buffer + * \param crc32 pointer to Uint32 to store the final CRC into + * + * \returns 0 for OK, -1 on error + * + */ +int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + +/* Same routine broken down into three steps */ +int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + + +/** + * \brief clean up CRC context + * + * \param crcContext pointer to context variable + * + * \returns 0 for OK, -1 on error + * +*/ + +int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_crc32_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_font.h b/Windows/SDL2/include/SDL2/SDL_test_font.h new file mode 100644 index 00000000..dc4ce6dd --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_font.h @@ -0,0 +1,81 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_font.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef SDL_test_font_h_ +#define SDL_test_font_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +#define FONT_CHARACTER_SIZE 8 + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the character. + * \param y The Y coordinate of the upper left corner of the character. + * \param c The character to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the string. + * \param y The Y coordinate of the upper left corner of the string. + * \param s The string to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); + + +/** + * \brief Cleanup textures used by font drawing functions. + */ +void SDLTest_CleanupTextDrawing(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_font_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_fuzzer.h b/Windows/SDL2/include/SDL2/SDL_test_fuzzer.h new file mode 100644 index 00000000..cb5a17a1 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_fuzzer.h @@ -0,0 +1,384 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_fuzzer.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Data generators for fuzzing test data in a reproducible way. + +*/ + +#ifndef SDL_test_fuzzer_h_ +#define SDL_test_fuzzer_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* + Based on GSOC code by Markus Kauppila <markus.kauppila@gmail.com> +*/ + + +/** + * \file + * Note: The fuzzer implementation uses a static instance of random context + * internally which makes it thread-UNsafe. + */ + +/** + * Initializes the fuzzer for a test + * + * \param execKey Execution "Key" that initializes the random number generator uniquely for the test. + * + */ +void SDLTest_FuzzerInit(Uint64 execKey); + + +/** + * Returns a random Uint8 + * + * \returns Generated integer + */ +Uint8 SDLTest_RandomUint8(void); + +/** + * Returns a random Sint8 + * + * \returns Generated signed integer + */ +Sint8 SDLTest_RandomSint8(void); + + +/** + * Returns a random Uint16 + * + * \returns Generated integer + */ +Uint16 SDLTest_RandomUint16(void); + +/** + * Returns a random Sint16 + * + * \returns Generated signed integer + */ +Sint16 SDLTest_RandomSint16(void); + + +/** + * Returns a random integer + * + * \returns Generated integer + */ +Sint32 SDLTest_RandomSint32(void); + + +/** + * Returns a random positive integer + * + * \returns Generated integer + */ +Uint32 SDLTest_RandomUint32(void); + +/** + * Returns random Uint64. + * + * \returns Generated integer + */ +Uint64 SDLTest_RandomUint64(void); + + +/** + * Returns random Sint64. + * + * \returns Generated signed integer + */ +Sint64 SDLTest_RandomSint64(void); + +/** + * \returns random float in range [0.0 - 1.0[ + */ +float SDLTest_RandomUnitFloat(void); + +/** + * \returns random double in range [0.0 - 1.0[ + */ +double SDLTest_RandomUnitDouble(void); + +/** + * \returns random float. + * + */ +float SDLTest_RandomFloat(void); + +/** + * \returns random double. + * + */ +double SDLTest_RandomDouble(void); + +/** + * Returns a random boundary value for Uint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 + * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT8_MIN with error set + */ +Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); + + +/** + * Returns a random boundary value for Sint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 + * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT16_MIN with error set + */ +Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 + * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT32_MIN with error set + */ +Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 + * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT64_MIN with error set + */ +Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); + + +/** + * Returns integer in range [min, max] (inclusive). + * Min and max values can be negative values. + * If Max in smaller than min, then the values are swapped. + * Min and max are the same value, that value will be returned. + * + * \param min Minimum inclusive value of returned random number + * \param max Maximum inclusive value of returned random number + * + * \returns Generated random integer in range + */ +Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); + + +/** + * Generates random null-terminated string. The minimum length for + * the string is 1 character, maximum length for the string is 255 + * characters and it can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiString(void); + + +/** + * Generates random null-terminated string. The maximum length for + * the string is defined by the maxLength parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param maxLength The maximum length of the generated string. + * + * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); + + +/** + * Generates random null-terminated string. The length for + * the string is defined by the size parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param size The length of the generated string + * + * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringOfSize(int size); + +/** + * Returns the invocation count for the fuzzer since last ...FuzzerInit. + */ +int SDLTest_GetFuzzerInvocationCount(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_fuzzer_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_harness.h b/Windows/SDL2/include/SDL2/SDL_test_harness.h new file mode 100644 index 00000000..97d98128 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_harness.h @@ -0,0 +1,134 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_harness.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + Defines types for test case definitions and the test execution harness API. + + Based on original GSOC code by Markus Kauppila <markus.kauppila@gmail.com> +*/ + +#ifndef SDL_test_h_arness_h +#define SDL_test_h_arness_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ! Definitions for test case structures */ +#define TEST_ENABLED 1 +#define TEST_DISABLED 0 + +/* ! Definition of all the possible test return values of the test case method */ +#define TEST_ABORTED -1 +#define TEST_STARTED 0 +#define TEST_COMPLETED 1 +#define TEST_SKIPPED 2 + +/* ! Definition of all the possible test results for the harness */ +#define TEST_RESULT_PASSED 0 +#define TEST_RESULT_FAILED 1 +#define TEST_RESULT_NO_ASSERT 2 +#define TEST_RESULT_SKIPPED 3 +#define TEST_RESULT_SETUP_FAILURE 4 + +/* !< Function pointer to a test case setup function (run before every test) */ +typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); + +/* !< Function pointer to a test case function */ +typedef int (*SDLTest_TestCaseFp)(void *arg); + +/* !< Function pointer to a test case teardown function (run after every test) */ +typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); + +/** + * Holds information about a single test case. + */ +typedef struct SDLTest_TestCaseReference { + /* !< Func2Stress */ + SDLTest_TestCaseFp testCase; + /* !< Short name (or function name) "Func2Stress" */ + char *name; + /* !< Long name or full description "This test pushes func2() to the limit." */ + char *description; + /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ + int enabled; +} SDLTest_TestCaseReference; + +/** + * Holds information about a test suite (multiple test cases). + */ +typedef struct SDLTest_TestSuiteReference { + /* !< "PlatformSuite" */ + char *name; + /* !< The function that is run before each test. NULL skips. */ + SDLTest_TestCaseSetUpFp testSetUp; + /* !< The test cases that are run as part of the suite. Last item should be NULL. */ + const SDLTest_TestCaseReference **testCases; + /* !< The function that is run after each test. NULL skips. */ + SDLTest_TestCaseTearDownFp testTearDown; +} SDLTest_TestSuiteReference; + + +/** + * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). + * + * Note: The returned string needs to be deallocated by the caller. + * + * \param length The length of the seed string to generate + * + * \returns The generated seed string + */ +char *SDLTest_GenerateRunSeed(const int length); + +/** + * \brief Execute a test suite using the given run seed and execution key. + * + * \param testSuites Suites containing the test case. + * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. + * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. + * \param filter Filter specification. NULL disables. Case sensitive. + * \param testIterations Number of iterations to run each test case. + * + * \returns Test run result; 0 when all tests passed, 1 if any tests failed. + */ +int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_h_arness_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_images.h b/Windows/SDL2/include/SDL2/SDL_test_images.h new file mode 100644 index 00000000..1cc3ee26 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_images.h @@ -0,0 +1,78 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_images.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines some images for tests. + +*/ + +#ifndef SDL_test_images_h_ +#define SDL_test_images_h_ + +#include "SDL.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + *Type for test images. + */ +typedef struct SDLTest_SurfaceImage_s { + int width; + int height; + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + const char *pixel_data; +} SDLTest_SurfaceImage_t; + +/* Test images */ +SDL_Surface *SDLTest_ImageBlit(void); +SDL_Surface *SDLTest_ImageBlitColor(void); +SDL_Surface *SDLTest_ImageBlitAlpha(void); +SDL_Surface *SDLTest_ImageBlitBlendAdd(void); +SDL_Surface *SDLTest_ImageBlitBlend(void); +SDL_Surface *SDLTest_ImageBlitBlendMod(void); +SDL_Surface *SDLTest_ImageBlitBlendNone(void); +SDL_Surface *SDLTest_ImageBlitBlendAll(void); +SDL_Surface *SDLTest_ImageFace(void); +SDL_Surface *SDLTest_ImagePrimitives(void); +SDL_Surface *SDLTest_ImagePrimitivesBlend(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_images_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_log.h b/Windows/SDL2/include/SDL2/SDL_test_log.h new file mode 100644 index 00000000..6066f904 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_log.h @@ -0,0 +1,67 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_log.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Wrapper to log in the TEST category + * + */ + +#ifndef SDL_test_log_h_ +#define SDL_test_log_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Prints given message with a timestamp in the TEST category and INFO priority. + * + * \param fmt Message to be logged + */ +void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. + * + * \param fmt Message to be logged + */ +void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_log_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_md5.h b/Windows/SDL2/include/SDL2/SDL_test_md5.h new file mode 100644 index 00000000..b1c51d92 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_md5.h @@ -0,0 +1,129 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_md5.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + *********************************************************************** + ** Header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + *********************************************************************** +*/ + +/* + *********************************************************************** + ** Message-digest routines: ** + ** To form the message digest for a message M ** + ** (1) Initialize a context buffer mdContext using MD5Init ** + ** (2) Call MD5Update on mdContext and M ** + ** (3) Call MD5Final on mdContext ** + ** The message digest is now in mdContext->digest[0...15] ** + *********************************************************************** +*/ + +#ifndef SDL_test_md5_h_ +#define SDL_test_md5_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------ Definitions --------- */ + +/* typedef a 32-bit type */ + typedef unsigned long int MD5UINT4; + +/* Data structure for MD5 (Message-Digest) computation */ + typedef struct { + MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + MD5UINT4 buf[4]; /* scratch buffer */ + unsigned char in[64]; /* input buffer */ + unsigned char digest[16]; /* actual digest after Md5Final call */ + } SDLTest_Md5Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * \brief initialize the context + * + * \param mdContext pointer to context variable + * + * Note: The function initializes the message-digest context + * mdContext. Call before each new use of the context - + * all fields are set to zero. + */ + void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); + + +/** + * \brief update digest from variable length data + * + * \param mdContext pointer to context variable + * \param inBuf pointer to data array/string + * \param inLen length of data array/string + * + * Note: The function updates the message-digest context to account + * for the presence of each of the characters inBuf[0..inLen-1] + * in the message whose digest is being computed. +*/ + + void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, + unsigned int inLen); + + +/** + * \brief complete digest computation + * + * \param mdContext pointer to context variable + * + * Note: The function terminates the message-digest computation and + * ends with the desired message digest in mdContext.digest[0..15]. + * Always call before using the digest[] variable. +*/ + + void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_md5_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_memory.h b/Windows/SDL2/include/SDL2/SDL_test_memory.h new file mode 100644 index 00000000..df69f93e --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_memory.h @@ -0,0 +1,63 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_memory.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef SDL_test_memory_h_ +#define SDL_test_memory_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \brief Start tracking SDL memory allocations + * + * \note This should be called before any other SDL functions for complete tracking coverage + */ +int SDLTest_TrackAllocations(void); + +/** + * \brief Print a log of any outstanding allocations + * + * \note This can be called after SDL_Quit() + */ +void SDLTest_LogAllocations(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_memory_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_test_random.h b/Windows/SDL2/include/SDL2/SDL_test_random.h new file mode 100644 index 00000000..9404e9dc --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_test_random.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_random.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + A "32-bit Multiply with carry random number generator. Very fast. + Includes a list of recommended multipliers. + + multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. + period: (a*2^31)-1 + +*/ + +#ifndef SDL_test_random_h_ +#define SDL_test_random_h_ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Definitions */ + +/* + * Macros that return a random number in a specific format. + */ +#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) + +/* + * Context structure for the random number generator state. + */ + typedef struct { + unsigned int a; + unsigned int x; + unsigned int c; + unsigned int ah; + unsigned int al; + } SDLTest_RandomContext; + + +/* --- Function prototypes */ + +/** + * \brief Initialize random number generator with two integers. + * + * Note: The random sequence of numbers returned by ...Random() is the + * same for the same two integers and has a period of 2^31. + * + * \param rndContext pointer to context structure + * \param xi integer that defines the random sequence + * \param ci integer that defines the random sequence + * + */ + void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, + unsigned int ci); + +/** + * \brief Initialize random number generator based on current system time. + * + * \param rndContext pointer to context structure + * + */ + void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); + + +/** + * \brief Initialize random number generator based on current system time. + * + * Note: ...RandomInit() or ...RandomInitTime() must have been called + * before using this function. + * + * \param rndContext pointer to context structure + * + * \returns A random number (32bit unsigned integer) + * + */ + unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_test_random_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_thread.h b/Windows/SDL2/include/SDL2/SDL_thread.h new file mode 100644 index 00000000..cb530117 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_thread.h @@ -0,0 +1,361 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_thread_h_ +#define SDL_thread_h_ + +/** + * \file SDL_thread.h + * + * Header for the SDL thread management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_atomic.h" +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/* The SDL thread ID */ +typedef unsigned long SDL_threadID; + +/* Thread local storage ID, 0 is the invalid ID */ +typedef unsigned int SDL_TLSID; + +/** + * The SDL thread priority. + * + * \note On many systems you require special privileges to set high or time critical priority. + */ +typedef enum { + SDL_THREAD_PRIORITY_LOW, + SDL_THREAD_PRIORITY_NORMAL, + SDL_THREAD_PRIORITY_HIGH, + SDL_THREAD_PRIORITY_TIME_CRITICAL +} SDL_ThreadPriority; + +/** + * The function passed to SDL_CreateThread(). + * It is passed a void* user context parameter and returns an int. + */ +typedef int (SDLCALL * SDL_ThreadFunction) (void *data); + +#if defined(__WIN32__) +/** + * \file SDL_thread.h + * + * We compile SDL into a DLL. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL2.DLL will + * be initialized for those threads, and not the RTL of the calling + * application! + * + * To solve this, we make a little hack here. + * + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL2.DLL which uses this API, + * then the RTL of SDL2.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime + * library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#include <process.h> /* _beginthreadex() and _endthreadex() */ + +typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) + (void *, unsigned, unsigned (__stdcall *func)(void *), + void * /*arg*/, unsigned, unsigned * /* threadID */); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); + +#ifndef SDL_beginthread +#define SDL_beginthread _beginthreadex +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthreadex +#endif + +/** + * Create a thread. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), + const char *name, const size_t stacksize, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + + +/** + * Create a thread. + */ +#if defined(SDL_CreateThread) && SDL_DYNAMIC_API +#undef SDL_CreateThread +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#undef SDL_CreateThreadWithStackSize +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#else +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread) +#endif + +#elif defined(__OS2__) +/* + * just like the windows case above: We compile SDL2 + * into a dll with Watcom's runtime statically linked. + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD + +#ifndef __EMX__ +#include <process.h> +#else +#include <stdlib.h> +#endif + +typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); +typedef void (*pfnSDL_CurrentEndThread)(void); + +#ifndef SDL_beginthread +#define SDL_beginthread _beginthread +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthread +#endif + +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +#if defined(SDL_CreateThread) && SDL_DYNAMIC_API +#undef SDL_CreateThread +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#undef SDL_CreateThreadWithStackSize +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#else +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#endif + +#else + +/** + * Create a thread with a default stack size. + * + * This is equivalent to calling: + * SDL_CreateThreadWithStackSize(fn, name, 0, data); + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); + +/** + * Create a thread. + * + * Thread naming is a little complicated: Most systems have very small + * limits for the string length (Haiku has 32 bytes, Linux currently has 16, + * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll + * have to see what happens with your system's debugger. The name should be + * UTF-8 (but using the naming limits of C identifiers is a better bet). + * There are no requirements for thread naming conventions, so long as the + * string is null-terminated UTF-8, but these guidelines are helpful in + * choosing a name: + * + * http://stackoverflow.com/questions/149932/naming-conventions-for-threads + * + * If a system imposes requirements, SDL will try to munge the string for + * it (truncate, etc), but the original string contents will be available + * from SDL_GetThreadName(). + * + * The size (in bytes) of the new stack can be specified. Zero means "use + * the system default" which might be wildly different between platforms + * (x86 Linux generally defaults to eight megabytes, an embedded device + * might be a few kilobytes instead). + * + * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread + * function. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data); + +#endif + +/** + * Get the thread name, as it was specified in SDL_CreateThread(). + * This function returns a pointer to a UTF-8 string that names the + * specified thread, or NULL if it doesn't have a name. This is internal + * memory, not to be free()'d by the caller, and remains valid until the + * specified thread is cleaned up by SDL_WaitThread(). + */ +extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); + +/** + * Get the thread identifier for the current thread. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); + +/** + * Get the thread identifier for the specified thread. + * + * Equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); + +/** + * Set the priority for the current thread + */ +extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); + +/** + * Wait for a thread to finish. Threads that haven't been detached will + * remain (as a "zombie") until this function cleans them up. Not doing so + * is a resource leak. + * + * Once a thread has been cleaned up through this function, the SDL_Thread + * that references it becomes invalid and should not be referenced again. + * As such, only one thread may call SDL_WaitThread() on another. + * + * The return code for the thread function is placed in the area + * pointed to by \c status, if \c status is not NULL. + * + * You may not wait on a thread that has been used in a call to + * SDL_DetachThread(). Use either that function or this one, but not + * both, or behavior is undefined. + * + * It is safe to pass NULL to this function; it is a no-op. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); + +/** + * A thread may be "detached" to signify that it should not remain until + * another thread has called SDL_WaitThread() on it. Detaching a thread + * is useful for long-running threads that nothing needs to synchronize + * with or further manage. When a detached thread is done, it simply + * goes away. + * + * There is no way to recover the return code of a detached thread. If you + * need this, don't detach the thread and instead use SDL_WaitThread(). + * + * Once a thread is detached, you should usually assume the SDL_Thread isn't + * safe to reference again, as it will become invalid immediately upon + * the detached thread's exit, instead of remaining until someone has called + * SDL_WaitThread() to finally clean it up. As such, don't detach the same + * thread more than once. + * + * If a thread has already exited when passed to SDL_DetachThread(), it will + * stop waiting for a call to SDL_WaitThread() and clean up immediately. + * It is not safe to detach a thread that might be used with SDL_WaitThread(). + * + * You may not call SDL_WaitThread() on a thread that has been detached. + * Use either that function or this one, but not both, or behavior is + * undefined. + * + * It is safe to pass NULL to this function; it is a no-op. + */ +extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); + +/** + * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. + * + * \return The newly created thread local storage identifier, or 0 on error + * + * \code + * static SDL_SpinLock tls_lock; + * static SDL_TLSID thread_local_storage; + * + * void SetMyThreadData(void *value) + * { + * if (!thread_local_storage) { + * SDL_AtomicLock(&tls_lock); + * if (!thread_local_storage) { + * thread_local_storage = SDL_TLSCreate(); + * } + * SDL_AtomicUnlock(&tls_lock); + * } + * SDL_TLSSet(thread_local_storage, value, 0); + * } + * + * void *GetMyThreadData(void) + * { + * return SDL_TLSGet(thread_local_storage); + * } + * \endcode + * + * \sa SDL_TLSGet() + * \sa SDL_TLSSet() + */ +extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); + +/** + * \brief Get the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * + * \return The value associated with the ID for the current thread, or NULL if no value has been set. + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSSet() + */ +extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); + +/** + * \brief Set the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * \param value The value to associate with the ID for the current thread + * \param destructor A function called when the thread exits, to free the value. + * + * \return 0 on success, -1 on error + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSGet() + */ +extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*)); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_thread_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_timer.h b/Windows/SDL2/include/SDL2/SDL_timer.h new file mode 100644 index 00000000..aada7178 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_timer.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_timer_h_ +#define SDL_timer_h_ + +/** + * \file SDL_timer.h + * + * Header for the SDL time management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Get the number of milliseconds since the SDL library initialization. + * + * \note This value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** + * \brief Compare SDL ticks values, and return true if A has passed B + * + * e.g. if you want to wait 100 ms, you could do this: + * Uint32 timeout = SDL_GetTicks() + 100; + * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { + * ... do work until timeout has elapsed + * } + */ +#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) + +/** + * \brief Get the current value of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); + +/** + * \brief Get the count per second of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); + +/** + * \brief Wait a specified number of milliseconds before returning. + */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** + * Function prototype for the timer callback function. + * + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); + +/** + * Definition of the timer ID type. + */ +typedef int SDL_TimerID; + +/** + * \brief Add a new timer to the pool of timers already running. + * + * \return A timer ID, or 0 when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, + SDL_TimerCallback callback, + void *param); + +/** + * \brief Remove a timer knowing its ID. + * + * \return A boolean value indicating success or failure. + * + * \warning It is not safe to remove a timer multiple times. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_timer_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_touch.h b/Windows/SDL2/include/SDL2/SDL_touch.h new file mode 100644 index 00000000..fa5a37ce --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_touch.h @@ -0,0 +1,102 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_touch.h + * + * Include file for SDL touch event handling. + */ + +#ifndef SDL_touch_h_ +#define SDL_touch_h_ + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_TouchID; +typedef Sint64 SDL_FingerID; + +typedef enum +{ + SDL_TOUCH_DEVICE_INVALID = -1, + SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ + SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ + SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ +} SDL_TouchDeviceType; + +typedef struct SDL_Finger +{ + SDL_FingerID id; + float x; + float y; + float pressure; +} SDL_Finger; + +/* Used as the device ID for mouse events simulated with touch input */ +#define SDL_TOUCH_MOUSEID ((Uint32)-1) + +/* Used as the SDL_TouchID for touch events simulated with mouse input */ +#define SDL_MOUSE_TOUCHID ((Sint64)-1) + + +/* Function prototypes */ + +/** + * \brief Get the number of registered touch devices. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); + +/** + * \brief Get the touch ID with the given index, or 0 if the index is invalid. + */ +extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); + +/** + * \brief Get the type of the given touch device. + */ +extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); + +/** + * \brief Get the number of active fingers for a given touch device. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); + +/** + * \brief Get the finger object of the given touch, with the given index. + */ +extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_touch_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_types.h b/Windows/SDL2/include/SDL2/SDL_types.h new file mode 100644 index 00000000..b6bb5711 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_types.h @@ -0,0 +1,29 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_types.h + * + * \deprecated + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/Windows/SDL2/include/SDL2/SDL_version.h b/Windows/SDL2/include/SDL2/SDL_version.h new file mode 100644 index 00000000..c824b1d3 --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_version.h @@ -0,0 +1,162 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_version.h + * + * This header defines the current SDL version. + */ + +#ifndef SDL_version_h_ +#define SDL_version_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Information the version of SDL in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa SDL_VERSION + * \sa SDL_GetVersion + */ +typedef struct SDL_version +{ + Uint8 major; /**< major version */ + Uint8 minor; /**< minor version */ + Uint8 patch; /**< update version */ +} SDL_version; + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MAJOR_VERSION 2 +#define SDL_MINOR_VERSION 0 +#define SDL_PATCHLEVEL 12 + +/** + * \brief Macro to determine SDL version program was compiled against. + * + * This macro fills in a SDL_version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), + * is not a macro. + * + * \param x A pointer to a SDL_version struct to initialize. + * + * \sa SDL_version + * \sa SDL_GetVersion + */ +#define SDL_VERSION(x) \ +{ \ + (x)->major = SDL_MAJOR_VERSION; \ + (x)->minor = SDL_MINOR_VERSION; \ + (x)->patch = SDL_PATCHLEVEL; \ +} + +/** + * This macro turns the version numbers into a numeric value: + * \verbatim + (1,2,3) -> (1203) + \endverbatim + * + * This assumes that there will never be more than 100 patchlevels. + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** + * This is the version number macro for the current SDL version. + */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** + * \brief Get the version of SDL that is linked against your program. + * + * If you are linking to SDL dynamically, then it is possible that the + * current version will be different than the version you compiled against. + * This function returns the current version, while SDL_VERSION() is a + * macro that tells you what version you compiled with. + * + * \code + * SDL_version compiled; + * SDL_version linked; + * + * SDL_VERSION(&compiled); + * SDL_GetVersion(&linked); + * printf("We compiled against SDL version %d.%d.%d ...\n", + * compiled.major, compiled.minor, compiled.patch); + * printf("But we linked against SDL version %d.%d.%d.\n", + * linked.major, linked.minor, linked.patch); + * \endcode + * + * This function may be called safely at any time, even before SDL_Init(). + * + * \sa SDL_VERSION + */ +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); + +/** + * \brief Get the code revision of SDL that is linked against your program. + * + * Returns an arbitrary string (a hash value) uniquely identifying the + * exact revision of the SDL library in use, and is only useful in comparing + * against other revisions. It is NOT an incrementing number. + */ +extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); + +/** + * \brief Get the revision number of SDL that is linked against your program. + * + * Returns a number uniquely identifying the exact revision of the SDL + * library in use. It is an incrementing number based on commits to + * hg.libsdl.org. + */ +extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_version_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL2/SDL_video.h b/Windows/SDL2/include/SDL2/SDL_video.h new file mode 100644 index 00000000..20d4ce2d --- /dev/null +++ b/Windows/SDL2/include/SDL2/SDL_video.h @@ -0,0 +1,1275 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_video.h + * + * Header file for SDL video functions. + */ + +#ifndef SDL_video_h_ +#define SDL_video_h_ + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a display mode + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + * \sa SDL_GetDesktopDisplayMode() + * \sa SDL_GetCurrentDisplayMode() + * \sa SDL_GetClosestDisplayMode() + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +typedef struct +{ + Uint32 format; /**< pixel format */ + int w; /**< width, in screen coordinates */ + int h; /**< height, in screen coordinates */ + int refresh_rate; /**< refresh rate (or zero for unspecified) */ + void *driverdata; /**< driver-specific data, initialize to 0 */ +} SDL_DisplayMode; + +/** + * \brief The type used to identify a window + * + * \sa SDL_CreateWindow() + * \sa SDL_CreateWindowFrom() + * \sa SDL_DestroyWindow() + * \sa SDL_GetWindowData() + * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowGrab() + * \sa SDL_GetWindowPosition() + * \sa SDL_GetWindowSize() + * \sa SDL_GetWindowTitle() + * \sa SDL_HideWindow() + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + * \sa SDL_RaiseWindow() + * \sa SDL_RestoreWindow() + * \sa SDL_SetWindowData() + * \sa SDL_SetWindowFullscreen() + * \sa SDL_SetWindowGrab() + * \sa SDL_SetWindowIcon() + * \sa SDL_SetWindowPosition() + * \sa SDL_SetWindowSize() + * \sa SDL_SetWindowBordered() + * \sa SDL_SetWindowResizable() + * \sa SDL_SetWindowTitle() + * \sa SDL_ShowWindow() + */ +typedef struct SDL_Window SDL_Window; + +/** + * \brief The flags on a window + * + * \sa SDL_GetWindowFlags() + */ +typedef enum +{ + SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ + SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ + SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ + SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ + SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ + SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ + SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ + SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ + SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ + SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ + SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), + SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ + SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported. + On macOS NSHighResolutionCapable must be set true in the + application's Info.plist for this to have any effect. */ + SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to INPUT_GRABBED) */ + SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */ + SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */ + SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ + SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ + SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ + SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ +} SDL_WindowFlags; + +/** + * \brief Used to indicate that you don't care what the window position is. + */ +#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u +#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) +#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) +#define SDL_WINDOWPOS_ISUNDEFINED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) + +/** + * \brief Used to indicate that the window position should be centered. + */ +#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u +#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) +#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) +#define SDL_WINDOWPOS_ISCENTERED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) + +/** + * \brief Event subtype for window events + */ +typedef enum +{ + SDL_WINDOWEVENT_NONE, /**< Never used */ + SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ + SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be + redrawn */ + SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + */ + SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ + SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as + a result of an API call or through the + system or user changing the window size. */ + SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ + SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ + SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size + and position */ + SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ + SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ + SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ + SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ + SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */ + SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */ + SDL_WINDOWEVENT_HIT_TEST /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */ +} SDL_WindowEventID; + +/** + * \brief Event subtype for display events + */ +typedef enum +{ + SDL_DISPLAYEVENT_NONE, /**< Never used */ + SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */ +} SDL_DisplayEventID; + +typedef enum +{ + SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */ + SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */ + SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */ + SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */ + SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */ +} SDL_DisplayOrientation; + +/** + * \brief An opaque handle to an OpenGL context. + */ +typedef void *SDL_GLContext; + +/** + * \brief OpenGL configuration attributes + */ +typedef enum +{ + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, + SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_CONTEXT_NO_ERROR +} SDL_GLattr; + +typedef enum +{ + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ +} SDL_GLprofile; + +typedef enum +{ + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 +} SDL_GLcontextFlag; + +typedef enum +{ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 +} SDL_GLcontextReleaseFlag; + +typedef enum +{ + SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, + SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001 +} SDL_GLContextResetNotification; + +/* Function prototypes */ + +/** + * \brief Get the number of video drivers compiled into SDL + * + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); + +/** + * \brief Get the name of a built in video driver. + * + * \note The video drivers are presented in the order in which they are + * normally checked during initialization. + * + * \sa SDL_GetNumVideoDrivers() + */ +extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); + +/** + * \brief Initialize the video subsystem, optionally specifying a video driver. + * + * \param driver_name Initialize a specific driver by name, or NULL for the + * default video driver. + * + * \return 0 on success, -1 on error + * + * This function initializes the video subsystem; setting up a connection + * to the window manager, etc, and determines the available display modes + * and pixel formats, but does not initialize a window or graphics mode. + * + * \sa SDL_VideoQuit() + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); + +/** + * \brief Shuts down the video subsystem. + * + * This function closes all windows, and restores the original video mode. + * + * \sa SDL_VideoInit() + */ +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); + +/** + * \brief Returns the name of the currently initialized video driver. + * + * \return The name of the current video driver or NULL if no driver + * has been initialized + * + * \sa SDL_GetNumVideoDrivers() + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); + +/** + * \brief Returns the number of available video displays. + * + * \sa SDL_GetDisplayBounds() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); + +/** + * \brief Get the name of a display in UTF-8 encoding + * + * \return The name of a display, or NULL for an invalid display index. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); + +/** + * \brief Get the desktop area represented by a display, with the primary + * display located at 0,0 + * + * \return 0 on success, or -1 if the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); + +/** + * \brief Get the usable desktop area represented by a display, with the + * primary display located at 0,0 + * + * This is the same area as SDL_GetDisplayBounds() reports, but with portions + * reserved by the system removed. For example, on Mac OS X, this subtracts + * the area occupied by the menu bar and dock. + * + * Setting a window to be fullscreen generally bypasses these unusable areas, + * so these are good guidelines for the maximum space available to a + * non-fullscreen window. + * + * \return 0 on success, or -1 if the index is out of range. + * + * \sa SDL_GetDisplayBounds() + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect); + +/** + * \brief Get the dots/pixels-per-inch for a display + * + * \note Diagonal, horizontal and vertical DPI can all be optionally + * returned if the parameter is non-NULL. + * + * \return 0 on success, or -1 if no DPI information is available or the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); + +/** + * \brief Get the orientation of a display + * + * \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex); + +/** + * \brief Returns the number of available display modes. + * + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); + +/** + * \brief Fill in information about a specific display mode. + * + * \note The display modes are sorted in this priority: + * \li bits per pixel -> more colors to fewer colors + * \li width -> largest to smallest + * \li height -> largest to smallest + * \li refresh rate -> highest to lowest + * + * \sa SDL_GetNumDisplayModes() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, + SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the desktop display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the current display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); + + +/** + * \brief Get the closest match to the requested display mode. + * + * \param displayIndex The index of display from which mode should be queried. + * \param mode The desired display mode + * \param closest A pointer to a display mode to be filled in with the closest + * match of the available display modes. + * + * \return The passed in value \c closest, or NULL if no matching video mode + * was available. + * + * The available display modes are scanned, and \c closest is filled in with the + * closest mode matching the requested mode and returned. The mode format and + * refresh_rate default to the desktop mode if they are 0. The modes are + * scanned with size being first priority, format being second priority, and + * finally checking the refresh_rate. If all the available modes are too + * small, then NULL is returned. + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); + +/** + * \brief Get the display index associated with a window. + * + * \return the display index of the display containing the center of the + * window, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); + +/** + * \brief Set the display mode used when a fullscreen window is visible. + * + * By default the window's dimensions and the desktop format and refresh rate + * are used. + * + * \param window The window for which the display mode should be set. + * \param mode The mode to use, or NULL for the default mode. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_GetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, + const SDL_DisplayMode + * mode); + +/** + * \brief Fill in information about the display mode used when a fullscreen + * window is visible. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, + SDL_DisplayMode * mode); + +/** + * \brief Get the pixel format associated with the window. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); + +/** + * \brief Create a window with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window, in screen coordinates. + * \param h The height of the window, in screen coordinates. + * \param flags The flags for the window, a mask of any of the following: + * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, + * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. + * + * \return The created window, or NULL if window creation failed. + * + * If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size + * in pixels may differ from its size in screen coordinates on platforms with + * high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query + * the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(), + * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the + * drawable size in pixels. + * + * If the window is created with any of the SDL_WINDOW_OPENGL or + * SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function + * (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the + * corresponding UnloadLibrary function is called by SDL_DestroyWindow(). + * + * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, + * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. + * + * \note On non-Apple devices, SDL requires you to either not link to the + * Vulkan loader or link to a dynamic library version. This limitation + * may be removed in a future version of SDL. + * + * \sa SDL_DestroyWindow() + * \sa SDL_GL_LoadLibrary() + * \sa SDL_Vulkan_LoadLibrary() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, + int x, int y, int w, + int h, Uint32 flags); + +/** + * \brief Create an SDL window from an existing native window. + * + * \param data A pointer to driver-dependent window creation data + * + * \return The created window, or NULL if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); + +/** + * \brief Get the numeric ID of a window, for logging purposes. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); + +/** + * \brief Get a window from a stored ID, or NULL if it doesn't exist. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); + +/** + * \brief Get the window flags. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); + +/** + * \brief Set the title of a window, in UTF-8 format. + * + * \sa SDL_GetWindowTitle() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, + const char *title); + +/** + * \brief Get the title of a window, in UTF-8 format. + * + * \sa SDL_SetWindowTitle() + */ +extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); + +/** + * \brief Set the icon for a window. + * + * \param window The window for which the icon should be set. + * \param icon The icon for the window. + */ +extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, + SDL_Surface * icon); + +/** + * \brief Associate an arbitrary named pointer with a window. + * + * \param window The window to associate with the pointer. + * \param name The name of the pointer. + * \param userdata The associated pointer. + * + * \return The previous value associated with 'name' + * + * \note The name is case-sensitive. + * + * \sa SDL_GetWindowData() + */ +extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, + const char *name, + void *userdata); + +/** + * \brief Retrieve the data pointer associated with a window. + * + * \param window The window to query. + * \param name The name of the pointer. + * + * \return The value associated with 'name' + * + * \sa SDL_SetWindowData() + */ +extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, + const char *name); + +/** + * \brief Set the position of a window. + * + * \param window The window to reposition. + * \param x The x coordinate of the window in screen coordinates, or + * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y coordinate of the window in screen coordinates, or + * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. + * + * \note The window coordinate origin is the upper left of the display. + * + * \sa SDL_GetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, + int x, int y); + +/** + * \brief Get the position of a window. + * + * \param window The window to query. + * \param x Pointer to variable for storing the x position, in screen + * coordinates. May be NULL. + * \param y Pointer to variable for storing the y position, in screen + * coordinates. May be NULL. + * + * \sa SDL_SetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, + int *x, int *y); + +/** + * \brief Set the size of a window's client area. + * + * \param window The window to resize. + * \param w The width of the window, in screen coordinates. Must be >0. + * \param h The height of the window, in screen coordinates. Must be >0. + * + * \note Fullscreen windows automatically match the size of the display mode, + * and you should use SDL_SetWindowDisplayMode() to change their size. + * + * The window size in screen coordinates may differ from the size in pixels, if + * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with + * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or + * SDL_GetRendererOutputSize() to get the real client area size in pixels. + * + * \sa SDL_GetWindowSize() + * \sa SDL_SetWindowDisplayMode() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, + int h); + +/** + * \brief Get the size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the width, in screen + * coordinates. May be NULL. + * \param h Pointer to variable for storing the height, in screen + * coordinates. May be NULL. + * + * The window size in screen coordinates may differ from the size in pixels, if + * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with + * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or + * SDL_GetRendererOutputSize() to get the real client area size in pixels. + * + * \sa SDL_SetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, + int *h); + +/** + * \brief Get the size of a window's borders (decorations) around the client area. + * + * \param window The window to query. + * \param top Pointer to variable for storing the size of the top border. NULL is permitted. + * \param left Pointer to variable for storing the size of the left border. NULL is permitted. + * \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted. + * \param right Pointer to variable for storing the size of the right border. NULL is permitted. + * + * \return 0 on success, or -1 if getting this information is not supported. + * + * \note if this function fails (returns -1), the size values will be + * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as + * if the window in question was borderless. + */ +extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, + int *top, int *left, + int *bottom, int *right); + +/** + * \brief Set the minimum size of a window's client area. + * + * \param window The window to set a new minimum size. + * \param min_w The minimum width of the window, must be >0 + * \param min_h The minimum height of the window, must be >0 + * + * \note You can't change the minimum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, + int min_w, int min_h); + +/** + * \brief Get the minimum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the minimum width, may be NULL + * \param h Pointer to variable for storing the minimum height, may be NULL + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, + int *w, int *h); + +/** + * \brief Set the maximum size of a window's client area. + * + * \param window The window to set a new maximum size. + * \param max_w The maximum width of the window, must be >0 + * \param max_h The maximum height of the window, must be >0 + * + * \note You can't change the maximum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, + int max_w, int max_h); + +/** + * \brief Get the maximum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the maximum width, may be NULL + * \param h Pointer to variable for storing the maximum height, may be NULL + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, + int *w, int *h); + +/** + * \brief Set the border state of a window. + * + * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and + * add or remove the border from the actual window. This is a no-op if the + * window's border already matches the requested state. + * + * \param window The window of which to change the border state. + * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. + * + * \note You can't change the border state of a fullscreen window. + * + * \sa SDL_GetWindowFlags() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, + SDL_bool bordered); + +/** + * \brief Set the user-resizable state of a window. + * + * This will add or remove the window's SDL_WINDOW_RESIZABLE flag and + * allow/disallow user resizing of the window. This is a no-op if the + * window's resizable state already matches the requested state. + * + * \param window The window of which to change the resizable state. + * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow. + * + * \note You can't change the resizable state of a fullscreen window. + * + * \sa SDL_GetWindowFlags() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window, + SDL_bool resizable); + +/** + * \brief Show a window. + * + * \sa SDL_HideWindow() + */ +extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); + +/** + * \brief Hide a window. + * + * \sa SDL_ShowWindow() + */ +extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); + +/** + * \brief Raise a window above other windows and set the input focus. + */ +extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); + +/** + * \brief Make a window as large as possible. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); + +/** + * \brief Minimize a window to an iconic representation. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); + +/** + * \brief Restore the size and position of a minimized or maximized window. + * + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + */ +extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); + +/** + * \brief Set a window's fullscreen state. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, + Uint32 flags); + +/** + * \brief Get the SDL surface associated with the window. + * + * \return The window's framebuffer surface, or NULL on error. + * + * A new surface will be created with the optimal format for the window, + * if necessary. This surface will be freed when the window is destroyed. + * + * \note You may not combine this with 3D or the rendering API on this window. + * + * \sa SDL_UpdateWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); + +/** + * \brief Copy the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); + +/** + * \brief Copy a number of rectangles on the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurface() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, + const SDL_Rect * rects, + int numrects); + +/** + * \brief Set a window's input grab mode. + * + * \param window The window for which the input grab mode should be set. + * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. + * + * If the caller enables a grab while another window is currently grabbed, + * the other window loses its grab in favor of the caller's window. + * + * \sa SDL_GetWindowGrab() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, + SDL_bool grabbed); + +/** + * \brief Get a window's input grab mode. + * + * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); + +/** + * \brief Get the window that currently has an input grab enabled. + * + * \return This returns the window if input is grabbed, and NULL otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); + +/** + * \brief Set the brightness (gamma correction) for a window. + * + * \return 0 on success, or -1 if setting the brightness isn't supported. + * + * \sa SDL_GetWindowBrightness() + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); + +/** + * \brief Get the brightness (gamma correction) for a window. + * + * \return The last brightness value passed to SDL_SetWindowBrightness() + * + * \sa SDL_SetWindowBrightness() + */ +extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); + +/** + * \brief Set the opacity for a window + * + * \param window The window which will be made transparent or opaque + * \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be + * clamped internally between 0.0f and 1.0f. + * + * \return 0 on success, or -1 if setting the opacity isn't supported. + * + * \sa SDL_GetWindowOpacity() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity); + +/** + * \brief Get the opacity of a window. + * + * If transparency isn't supported on this platform, opacity will be reported + * as 1.0f without error. + * + * \param window The window in question. + * \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque) + * + * \return 0 on success, or -1 on error (invalid window, etc). + * + * \sa SDL_SetWindowOpacity() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity); + +/** + * \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name) + * + * \param modal_window The window that should be modal + * \param parent_window The parent window + * + * \return 0 on success, or -1 otherwise. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window); + +/** + * \brief Explicitly sets input focus to the window. + * + * You almost certainly want SDL_RaiseWindow() instead of this function. Use + * this with caution, as you might give focus to a window that's completely + * obscured by other windows. + * + * \param window The window that should get the input focus + * + * \return 0 on success, or -1 otherwise. + * \sa SDL_RaiseWindow() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window); + +/** + * \brief Set the gamma ramp for a window. + * + * \param window The window for which the gamma ramp should be set. + * \param red The translation table for the red channel, or NULL. + * \param green The translation table for the green channel, or NULL. + * \param blue The translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * \sa SDL_GetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, + const Uint16 * red, + const Uint16 * green, + const Uint16 * blue); + +/** + * \brief Get the gamma ramp for a window. + * + * \param window The window from which the gamma ramp should be queried. + * \param red A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the red channel, or NULL. + * \param green A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the green channel, or NULL. + * \param blue A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, + Uint16 * red, + Uint16 * green, + Uint16 * blue); + +/** + * \brief Possible return values from the SDL_HitTest callback. + * + * \sa SDL_HitTest + */ +typedef enum +{ + SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ + SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ + SDL_HITTEST_RESIZE_TOPLEFT, + SDL_HITTEST_RESIZE_TOP, + SDL_HITTEST_RESIZE_TOPRIGHT, + SDL_HITTEST_RESIZE_RIGHT, + SDL_HITTEST_RESIZE_BOTTOMRIGHT, + SDL_HITTEST_RESIZE_BOTTOM, + SDL_HITTEST_RESIZE_BOTTOMLEFT, + SDL_HITTEST_RESIZE_LEFT +} SDL_HitTestResult; + +/** + * \brief Callback used for hit-testing. + * + * \sa SDL_SetWindowHitTest + */ +typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, + const SDL_Point *area, + void *data); + +/** + * \brief Provide a callback that decides if a window region has special properties. + * + * Normally windows are dragged and resized by decorations provided by the + * system window manager (a title bar, borders, etc), but for some apps, it + * makes sense to drag them from somewhere else inside the window itself; for + * example, one might have a borderless window that wants to be draggable + * from any part, or simulate its own title bar, etc. + * + * This function lets the app provide a callback that designates pieces of + * a given window as special. This callback is run during event processing + * if we need to tell the OS to treat a region of the window specially; the + * use of this callback is known as "hit testing." + * + * Mouse input may not be delivered to your application if it is within + * a special area; the OS will often apply that input to moving the window or + * resizing the window and not deliver it to the application. + * + * Specifying NULL for a callback disables hit-testing. Hit-testing is + * disabled by default. + * + * Platforms that don't support this functionality will return -1 + * unconditionally, even if you're attempting to disable hit-testing. + * + * Your callback may fire at any time, and its firing does not indicate any + * specific behavior (for example, on Windows, this certainly might fire + * when the OS is deciding whether to drag your window, but it fires for lots + * of other reasons, too, some unrelated to anything you probably care about + * _and when the mouse isn't actually at the location it is testing_). + * Since this can fire at any time, you should try to keep your callback + * efficient, devoid of allocations, etc. + * + * \param window The window to set hit-testing on. + * \param callback The callback to call when doing a hit-test. + * \param callback_data An app-defined void pointer passed to the callback. + * \return 0 on success, -1 on error (including unsupported). + */ +extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, + SDL_HitTest callback, + void *callback_data); + +/** + * \brief Destroy a window. + */ +extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); + + +/** + * \brief Returns whether the screensaver is currently enabled (default off). + * + * \sa SDL_EnableScreenSaver() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); + +/** + * \brief Allow the screen to be blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); + +/** + * \brief Prevent the screen from being blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_EnableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); + + +/** + * \name OpenGL support functions + */ +/* @{ */ + +/** + * \brief Dynamically load an OpenGL library. + * + * \param path The platform dependent OpenGL library name, or NULL to open the + * default OpenGL library. + * + * \return 0 on success, or -1 if the library couldn't be loaded. + * + * This should be done after initializing the video driver, but before + * creating any OpenGL windows. If no OpenGL library is loaded, the default + * library will be loaded upon creation of the first OpenGL window. + * + * \note If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + * + * \sa SDL_GL_GetProcAddress() + * \sa SDL_GL_UnloadLibrary() + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * \brief Get the address of an OpenGL function. + */ +extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); + +/** + * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). + * + * \sa SDL_GL_LoadLibrary() + */ +extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); + +/** + * \brief Return true if an OpenGL extension is supported for the current + * context. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char + *extension); + +/** + * \brief Reset all previously set OpenGL context attributes to their default values + */ +extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); + +/** + * \brief Set an OpenGL window attribute before window creation. + * + * \return 0 on success, or -1 if the attribute could not be set. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * \brief Get the actual value for an attribute from the current context. + * + * \return 0 on success, or -1 if the attribute could not be retrieved. + * The integer at \c value will be modified in either case. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); + +/** + * \brief Create an OpenGL context for use with an OpenGL window, and make it + * current. + * + * \sa SDL_GL_DeleteContext() + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * + window); + +/** + * \brief Set up an OpenGL context for rendering into an OpenGL window. + * + * \note The context must have been created with a compatible window. + */ +extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, + SDL_GLContext context); + +/** + * \brief Get the currently active OpenGL window. + */ +extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); + +/** + * \brief Get the currently active OpenGL context. + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); + +/** + * \brief Get the size of a window's underlying drawable in pixels (for use + * with glViewport). + * + * \param window Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, may be NULL + * \param h Pointer to variable for storing the height in pixels, may be NULL + * + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a + * platform with high-DPI support (Apple calls this "Retina"), and not disabled + * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. + * + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() + */ +extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, + int *h); + +/** + * \brief Set the swap interval for the current OpenGL context. + * + * \param interval 0 for immediate updates, 1 for updates synchronized with the + * vertical retrace. If the system supports it, you may + * specify -1 to allow late swaps to happen immediately + * instead of waiting for the next retrace. + * + * \return 0 on success, or -1 if setting the swap interval is not supported. + * + * \sa SDL_GL_GetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); + +/** + * \brief Get the swap interval for the current OpenGL context. + * + * \return 0 if there is no vertical retrace synchronization, 1 if the buffer + * swap is synchronized with the vertical retrace, and -1 if late + * swaps happen immediately instead of waiting for the next retrace. + * If the system can't determine the swap interval, or there isn't a + * valid current context, this will return 0 as a safe default. + * + * \sa SDL_GL_SetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); + +/** + * \brief Swap the OpenGL buffers for a window, if double-buffering is + * supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); + +/** + * \brief Delete an OpenGL context. + * + * \sa SDL_GL_CreateContext() + */ +extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); + +/* @} *//* OpenGL support functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_video_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h b/Windows/SDL2/include/SDL2/SDL_vulkan.h similarity index 100% rename from MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h rename to Windows/SDL2/include/SDL2/SDL_vulkan.h diff --git a/Windows/SDL2/include/SDL2/begin_code.h b/Windows/SDL2/include/SDL2/begin_code.h new file mode 100644 index 00000000..170d69ec --- /dev/null +++ b/Windows/SDL2/include/SDL2/begin_code.h @@ -0,0 +1,170 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file begin_code.h + * + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/* This shouldn't be nested -- included it around code only. */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +#ifndef SDL_DEPRECATED +# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ +# define SDL_DEPRECATED __attribute__((deprecated)) +# else +# define SDL_DEPRECATED +# endif +#endif + +#ifndef SDL_UNUSED +# ifdef __GNUC__ +# define SDL_UNUSED __attribute__((unused)) +# else +# define SDL_UNUSED +# endif +#endif + +/* Some compilers use a special export keyword */ +#ifndef DECLSPEC +# if defined(__WIN32__) || defined(__WINRT__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# elif defined(__OS2__) +# ifdef BUILD_SDL +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# else +# if defined(__GNUC__) && __GNUC__ >= 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/* By default SDL uses the C calling convention */ +#ifndef SDLCALL +#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) +#define SDLCALL __cdecl +#elif defined(__OS2__) || defined(__EMX__) +#define SDLCALL _System +# if defined (__GNUC__) && !defined(_System) +# define _System /* for old EMX/GCC compat. */ +# endif +#else +#define SDLCALL +#endif +#endif /* SDLCALL */ + +/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ +#ifdef __SYMBIAN32__ +#undef DECLSPEC +#define DECLSPEC +#endif /* __SYMBIAN32__ */ + +/* Force structure packing at 4 byte alignment. + This is necessary if the header is included in code which has structure + packing set to an alternate value, say for loading structures from disk. + The packing is reset to the previous value in close_code.h + */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef _MSC_VER +#pragma warning(disable: 4103) +#endif +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wpragma-pack" +#endif +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#ifdef _M_X64 +/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ +#pragma pack(push,8) +#else +#pragma pack(push,4) +#endif +#endif /* Compiler needs structure packing set */ + +#ifndef SDL_INLINE +#if defined(__GNUC__) +#define SDL_INLINE __inline__ +#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ + defined(__DMC__) || defined(__SC__) || \ + defined(__WATCOMC__) || defined(__LCC__) || \ + defined(__DECC) || defined(__CC_ARM) +#define SDL_INLINE __inline +#ifndef __inline__ +#define __inline__ __inline +#endif +#else +#define SDL_INLINE inline +#ifndef __inline__ +#define __inline__ inline +#endif +#endif +#endif /* SDL_INLINE not defined */ + +#ifndef SDL_FORCE_INLINE +#if defined(_MSC_VER) +#define SDL_FORCE_INLINE __forceinline +#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) +#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ +#else +#define SDL_FORCE_INLINE static SDL_INLINE +#endif +#endif /* SDL_FORCE_INLINE not defined */ + +#ifndef SDL_NORETURN +#if defined(__GNUC__) +#define SDL_NORETURN __attribute__((noreturn)) +#elif defined(_MSC_VER) +#define SDL_NORETURN __declspec(noreturn) +#else +#define SDL_NORETURN +#endif +#endif /* SDL_NORETURN not defined */ + +/* Apparently this is needed by several Windows compilers */ +#if !defined(__MACH__) +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif /* NULL */ +#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/Windows/SDL2/include/SDL2/close_code.h b/Windows/SDL2/include/SDL2/close_code.h new file mode 100644 index 00000000..6aa411b0 --- /dev/null +++ b/Windows/SDL2/include/SDL2/close_code.h @@ -0,0 +1,40 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file close_code.h + * + * This file reverses the effects of begin_code.h and should be included + * after you finish any function and structure declarations in your headers + */ + +#ifndef _begin_code_h +#error close_code.h included without matching begin_code.h +#endif +#undef _begin_code_h + +/* Reset structure packing at previous byte alignment */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#pragma pack(pop) +#endif /* Compiler needs structure packing set */ diff --git a/Windows/SDL2/include/SDL_assert.h b/Windows/SDL2/include/SDL_assert.h deleted file mode 100644 index 8baecb63..00000000 --- a/Windows/SDL2/include/SDL_assert.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_assert_h_ -#define SDL_assert_h_ - -#include "SDL_config.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef SDL_ASSERT_LEVEL -#ifdef SDL_DEFAULT_ASSERT_LEVEL -#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL -#elif defined(_DEBUG) || defined(DEBUG) || \ - (defined(__GNUC__) && !defined(__OPTIMIZE__)) -#define SDL_ASSERT_LEVEL 2 -#else -#define SDL_ASSERT_LEVEL 1 -#endif -#endif /* SDL_ASSERT_LEVEL */ - -/* -These are macros and not first class functions so that the debugger breaks -on the assertion line and not in some random guts of SDL, and so each -assert can have unique static variables associated with it. -*/ - -#if defined(_MSC_VER) -/* Don't include intrin.h here because it contains C++ code */ - extern void __cdecl __debugbreak(void); - #define SDL_TriggerBreakpoint() __debugbreak() -#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) - #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) -#elif defined(__386__) && defined(__WATCOMC__) - #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } -#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) - #include <signal.h> - #define SDL_TriggerBreakpoint() raise(SIGTRAP) -#else - /* How do we trigger breakpoints on this platform? */ - #define SDL_TriggerBreakpoint() -#endif - -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ -# define SDL_FUNCTION __func__ -#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__)) -# define SDL_FUNCTION __FUNCTION__ -#else -# define SDL_FUNCTION "???" -#endif -#define SDL_FILE __FILE__ -#define SDL_LINE __LINE__ - -/* -sizeof (x) makes the compiler still parse the expression even without -assertions enabled, so the code is always checked at compile time, but -doesn't actually generate code for it, so there are no side effects or -expensive checks at run time, just the constant size of what x WOULD be, -which presumably gets optimized out as unused. -This also solves the problem of... - - int somevalue = blah(); - SDL_assert(somevalue == 1); - -...which would cause compiles to complain that somevalue is unused if we -disable assertions. -*/ - -/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking - this condition isn't constant. And looks like an owl's face! */ -#ifdef _MSC_VER /* stupid /W4 warnings. */ -#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) -#else -#define SDL_NULL_WHILE_LOOP_CONDITION (0) -#endif - -#define SDL_disabled_assert(condition) \ - do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) - -typedef enum -{ - SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ - SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ - SDL_ASSERTION_ABORT, /**< Terminate the program. */ - SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ - SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ -} SDL_AssertState; - -typedef struct SDL_AssertData -{ - int always_ignore; - unsigned int trigger_count; - const char *condition; - const char *filename; - int linenum; - const char *function; - const struct SDL_AssertData *next; -} SDL_AssertData; - -#if (SDL_ASSERT_LEVEL > 0) - -/* Never call this directly. Use the SDL_assert* macros. */ -extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, - const char *, - const char *, int) -#if defined(__clang__) -#if __has_feature(attribute_analyzer_noreturn) -/* this tells Clang's static analysis that we're a custom assert function, - and that the analyzer should assume the condition was always true past this - SDL_assert test. */ - __attribute__((analyzer_noreturn)) -#endif -#endif -; - -/* the do {} while(0) avoids dangling else problems: - if (x) SDL_assert(y); else blah(); - ... without the do/while, the "else" could attach to this macro's "if". - We try to handle just the minimum we need here in a macro...the loop, - the static vars, and break points. The heavy lifting is handled in - SDL_ReportAssertion(), in SDL_assert.c. -*/ -#define SDL_enabled_assert(condition) \ - do { \ - while ( !(condition) ) { \ - static struct SDL_AssertData sdl_assert_data = { \ - 0, 0, #condition, 0, 0, 0, 0 \ - }; \ - const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ - if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ - continue; /* go again. */ \ - } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ - SDL_TriggerBreakpoint(); \ - } \ - break; /* not retrying. */ \ - } \ - } while (SDL_NULL_WHILE_LOOP_CONDITION) - -#endif /* enabled assertions support code */ - -/* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_disabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) -#else -# error Unknown assertion level. -#endif - -/* this assertion is never disabled at any level. */ -#define SDL_assert_always(condition) SDL_enabled_assert(condition) - - -typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( - const SDL_AssertData* data, void* userdata); - -/** - * \brief Set an application-defined assertion handler. - * - * This allows an app to show its own assertion UI and/or force the - * response to an assertion failure. If the app doesn't provide this, SDL - * will try to do the right thing, popping up a system-specific GUI dialog, - * and probably minimizing any fullscreen windows. - * - * This callback may fire from any thread, but it runs wrapped in a mutex, so - * it will only fire from one thread at a time. - * - * Setting the callback to NULL restores SDL's original internal handler. - * - * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! - * - * Return SDL_AssertState value of how to handle the assertion failure. - * - * \param handler Callback function, called when an assertion fails. - * \param userdata A pointer passed to the callback as-is. - */ -extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( - SDL_AssertionHandler handler, - void *userdata); - -/** - * \brief Get the default assertion handler. - * - * This returns the function pointer that is called by default when an - * assertion is triggered. This is an internal function provided by SDL, - * that is used for assertions when SDL_SetAssertionHandler() hasn't been - * used to provide a different function. - * - * \return The default SDL_AssertionHandler that is called when an assert triggers. - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); - -/** - * \brief Get the current assertion handler. - * - * This returns the function pointer that is called when an assertion is - * triggered. This is either the value last passed to - * SDL_SetAssertionHandler(), or if no application-specified function is - * set, is equivalent to calling SDL_GetDefaultAssertionHandler(). - * - * \param puserdata Pointer to a void*, which will store the "userdata" - * pointer that was passed to SDL_SetAssertionHandler(). - * This value will always be NULL for the default handler. - * If you don't care about this data, it is safe to pass - * a NULL pointer to this function to ignore it. - * \return The SDL_AssertionHandler that is called when an assert triggers. - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); - -/** - * \brief Get a list of all assertion failures. - * - * Get all assertions triggered since last call to SDL_ResetAssertionReport(), - * or the start of the program. - * - * The proper way to examine this data looks something like this: - * - * <code> - * const SDL_AssertData *item = SDL_GetAssertionReport(); - * while (item) { - * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n", - * item->condition, item->function, item->filename, - * item->linenum, item->trigger_count, - * item->always_ignore ? "yes" : "no"); - * item = item->next; - * } - * </code> - * - * \return List of all assertions. - * \sa SDL_ResetAssertionReport - */ -extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); - -/** - * \brief Reset the list of all assertion failures. - * - * Reset list of all assertions triggered. - * - * \sa SDL_GetAssertionReport - */ -extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); - - -/* these had wrong naming conventions until 2.0.4. Please update your app! */ -#define SDL_assert_state SDL_AssertState -#define SDL_assert_data SDL_AssertData - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_assert_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_atomic.h b/Windows/SDL2/include/SDL_atomic.h deleted file mode 100644 index deee35f9..00000000 --- a/Windows/SDL2/include/SDL_atomic.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_atomic.h - * - * Atomic operations. - * - * IMPORTANT: - * If you are not an expert in concurrent lockless programming, you should - * only be using the atomic lock and reference counting functions in this - * file. In all other cases you should be protecting your data structures - * with full mutexes. - * - * The list of "safe" functions to use are: - * SDL_AtomicLock() - * SDL_AtomicUnlock() - * SDL_AtomicIncRef() - * SDL_AtomicDecRef() - * - * Seriously, here be dragons! - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * You can find out a little more about lockless programming and the - * subtle issues that can arise here: - * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx - * - * There's also lots of good information here: - * http://www.1024cores.net/home/lock-free-algorithms - * http://preshing.com/ - * - * These operations may or may not actually be implemented using - * processor specific atomic operations. When possible they are - * implemented as true processor specific atomic operations. When that - * is not possible the are implemented using locks that *do* use the - * available atomic operations. - * - * All of the atomic operations that modify memory are full memory barriers. - */ - -#ifndef SDL_atomic_h_ -#define SDL_atomic_h_ - -#include "SDL_stdinc.h" -#include "SDL_platform.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SDL AtomicLock - * - * The atomic locks are efficient spinlocks using CPU instructions, - * but are vulnerable to starvation and can spin forever if a thread - * holding a lock has been terminated. For this reason you should - * minimize the code executed inside an atomic lock and never do - * expensive things like API or system calls while holding them. - * - * The atomic locks are not safe to lock recursively. - * - * Porting Note: - * The spin lock functions and type are required and can not be - * emulated because they are used in the atomic emulation code. - */ -/* @{ */ - -typedef int SDL_SpinLock; - -/** - * \brief Try to lock a spin lock by setting it to a non-zero value. - * - * \param lock Points to the lock. - * - * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); - -/** - * \brief Lock a spin lock by setting it to a non-zero value. - * - * \param lock Points to the lock. - */ -extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); - -/** - * \brief Unlock a spin lock by setting it to 0. Always returns immediately - * - * \param lock Points to the lock. - */ -extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); - -/* @} *//* SDL AtomicLock */ - - -/** - * The compiler barrier prevents the compiler from reordering - * reads and writes to globally visible variables across the call. - */ -#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__) -void _ReadWriteBarrier(void); -#pragma intrinsic(_ReadWriteBarrier) -#define SDL_CompilerBarrier() _ReadWriteBarrier() -#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ -#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") -#elif defined(__WATCOMC__) -extern _inline void SDL_CompilerBarrier (void); -#pragma aux SDL_CompilerBarrier = "" parm [] modify exact []; -#else -#define SDL_CompilerBarrier() \ -{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } -#endif - -/** - * Memory barriers are designed to prevent reads and writes from being - * reordered by the compiler and being seen out of order on multi-core CPUs. - * - * A typical pattern would be for thread A to write some data and a flag, - * and for thread B to read the flag and get the data. In this case you - * would insert a release barrier between writing the data and the flag, - * guaranteeing that the data write completes no later than the flag is - * written, and you would insert an acquire barrier between reading the - * flag and reading the data, to ensure that all the reads associated - * with the flag have completed. - * - * In this pattern you should always see a release barrier paired with - * an acquire barrier and you should gate the data reads/writes with a - * single flag variable. - * - * For more information on these semantics, take a look at the blog post: - * http://preshing.com/20120913/acquire-and-release-semantics - */ -extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void); -extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void); - -#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") -#elif defined(__GNUC__) && defined(__aarch64__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__GNUC__) && defined(__arm__) -#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */ -/* Information from: - https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19 - - The Linux kernel provides a helper function which provides the right code for a memory barrier, - hard-coded at address 0xffff0fa0 -*/ -typedef void (*SDL_KernelMemoryBarrierFunc)(); -#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() -#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() -#elif 0 /* defined(__QNXNTO__) */ -#include <sys/cpuinline.h> - -#define SDL_MemoryBarrierRelease() __cpu_membarrier() -#define SDL_MemoryBarrierAcquire() __cpu_membarrier() -#else -#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) -#ifdef __thumb__ -/* The mcr instruction isn't available in thumb mode, use real functions */ -#define SDL_MEMORY_BARRIER_USES_FUNCTION -#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction() -#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#endif /* __thumb__ */ -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") -#endif /* __LINUX__ || __ANDROID__ */ -#endif /* __GNUC__ && __arm__ */ -#else -#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ -#include <mbarrier.h> -#define SDL_MemoryBarrierRelease() __machine_rel_barrier() -#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() -#else -/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ -#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() -#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() -#endif -#endif - -/** - * \brief A type representing an atomic integer value. It is a struct - * so people don't accidentally use numeric operations on it. - */ -typedef struct { int value; } SDL_atomic_t; - -/** - * \brief Set an atomic variable to a new value if it is currently an old value. - * - * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. - * - * \note If you don't know what this function is for, you shouldn't use it! -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); - -/** - * \brief Set an atomic variable to a value. - * - * \return The previous value of the atomic variable. - */ -extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); - -/** - * \brief Get the value of an atomic variable - */ -extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); - -/** - * \brief Add to an atomic variable. - * - * \return The previous value of the atomic variable. - * - * \note This same style can be used for any number operation - */ -extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); - -/** - * \brief Increment an atomic variable used as a reference count. - */ -#ifndef SDL_AtomicIncRef -#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) -#endif - -/** - * \brief Decrement an atomic variable used as a reference count. - * - * \return SDL_TRUE if the variable reached zero after decrementing, - * SDL_FALSE otherwise - */ -#ifndef SDL_AtomicDecRef -#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) -#endif - -/** - * \brief Set a pointer to a new value if it is currently an old value. - * - * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. - * - * \note If you don't know what this function is for, you shouldn't use it! -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); - -/** - * \brief Set a pointer to a value atomically. - * - * \return The previous value of the pointer. - */ -extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); - -/** - * \brief Get the value of a pointer atomically. - */ -extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#include "close_code.h" - -#endif /* SDL_atomic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_audio.h b/Windows/SDL2/include/SDL_audio.h deleted file mode 100644 index 305c01a9..00000000 --- a/Windows/SDL2/include/SDL_audio.h +++ /dev/null @@ -1,859 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_audio.h - * - * Access to the raw audio mixing buffer for the SDL library. - */ - -#ifndef SDL_audio_h_ -#define SDL_audio_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Audio format flags. - * - * These are what the 16 bits in SDL_AudioFormat currently mean... - * (Unspecified bits are always zero). - * - * \verbatim - ++-----------------------sample is signed if set - || - || ++-----------sample is bigendian if set - || || - || || ++---sample is float if set - || || || - || || || +---sample bit size---+ - || || || | | - 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - \endverbatim - * - * There are macros in SDL 2.0 and later to query these bits. - */ -typedef Uint16 SDL_AudioFormat; - -/** - * \name Audio flags - */ -/* @{ */ - -#define SDL_AUDIO_MASK_BITSIZE (0xFF) -#define SDL_AUDIO_MASK_DATATYPE (1<<8) -#define SDL_AUDIO_MASK_ENDIAN (1<<12) -#define SDL_AUDIO_MASK_SIGNED (1<<15) -#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) -#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) -#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) -#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) -#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) -#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) -#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) - -/** - * \name Audio format flags - * - * Defaults to LSB byte order. - */ -/* @{ */ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB -/* @} */ - -/** - * \name int32 support - */ -/* @{ */ -#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ -#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ -#define AUDIO_S32 AUDIO_S32LSB -/* @} */ - -/** - * \name float32 support - */ -/* @{ */ -#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ -#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ -#define AUDIO_F32 AUDIO_F32LSB -/* @} */ - -/** - * \name Native audio byte ordering - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#define AUDIO_S32SYS AUDIO_S32LSB -#define AUDIO_F32SYS AUDIO_F32LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#define AUDIO_S32SYS AUDIO_S32MSB -#define AUDIO_F32SYS AUDIO_F32MSB -#endif -/* @} */ - -/** - * \name Allow change flags - * - * Which audio format changes are allowed when opening a device. - */ -/* @{ */ -#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 -#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 -#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 -#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008 -#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE) -/* @} */ - -/* @} *//* Audio flags */ - -/** - * This function is called when the audio device needs more data. - * - * \param userdata An application-specific parameter saved in - * the SDL_AudioSpec structure - * \param stream A pointer to the audio data buffer. - * \param len The length of that buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - * - * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if - * you like. Just open your audio device with a NULL callback. - */ -typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, - int len); - -/** - * The calculated values in this structure are calculated by SDL_OpenAudio(). - * - * For multi-channel audio, the default SDL channel mapping is: - * 2: FL FR (stereo) - * 3: FL FR LFE (2.1 surround) - * 4: FL FR BL BR (quad) - * 5: FL FR FC BL BR (quad + center) - * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) - * 7: FL FR FC LFE BC SL SR (6.1 surround) - * 8: FL FR FC LFE BL BR SL SR (7.1 surround) - */ -typedef struct SDL_AudioSpec -{ - int freq; /**< DSP frequency -- samples per second */ - SDL_AudioFormat format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ - void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ -} SDL_AudioSpec; - - -struct SDL_AudioCVT; -typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, - SDL_AudioFormat format); - -/** - * \brief Upper limit of filters in SDL_AudioCVT - * - * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is - * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, - * one of which is the terminating NULL pointer. - */ -#define SDL_AUDIOCVT_MAX_FILTERS 9 - -/** - * \struct SDL_AudioCVT - * \brief A structure to hold a set of audio conversion filters and buffers. - * - * Note that various parts of the conversion pipeline can take advantage - * of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require - * you to pass it aligned data, but can possibly run much faster if you - * set both its (buf) field to a pointer that is aligned to 16 bytes, and its - * (len) field to something that's a multiple of 16, if possible. - */ -#ifdef __GNUC__ -/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't - pad it out to 88 bytes to guarantee ABI compatibility between compilers. - vvv - The next time we rev the ABI, make sure to size the ints and add padding. -*/ -#define SDL_AUDIOCVT_PACKED __attribute__((packed)) -#else -#define SDL_AUDIOCVT_PACKED -#endif -/* */ -typedef struct SDL_AudioCVT -{ - int needed; /**< Set to 1 if conversion possible */ - SDL_AudioFormat src_format; /**< Source audio format */ - SDL_AudioFormat dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */ - int filter_index; /**< Current audio conversion function */ -} SDL_AUDIOCVT_PACKED SDL_AudioCVT; - - -/* Function prototypes */ - -/** - * \name Driver discovery functions - * - * These functions return the list of built in audio drivers, in the - * order that they are normally initialized by default. - */ -/* @{ */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); -extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); -/* @} */ - -/** - * \name Initialization and cleanup - * - * \internal These functions are used internally, and should not be used unless - * you have a specific need to specify the audio driver you want to - * use. You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/* @{ */ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); -/* @} */ - -/** - * This function returns the name of the current audio driver, or NULL - * if no driver has been initialized. - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); - -/** - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by \c obtained. If \c obtained is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. - * - * When filling in the desired audio spec structure, - * - \c desired->freq should be the desired audio frequency in samples-per- - * second. - * - \c desired->format should be the desired audio format. - * - \c desired->samples is the desired size of the audio buffer, in - * samples. This number should be a power of two, and may be adjusted by - * the audio driver to a value more suitable for the hardware. Good values - * seem to range between 512 and 8096 inclusive, depending on the - * application and CPU speed. Smaller values yield faster response time, - * but can lead to underflow if the application is doing heavy processing - * and cannot fill the audio buffer in time. A stereo sample consists of - * both right and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: \code ms = (samples*1000)/freq \endcode - * - \c desired->size is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * - \c desired->silence is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * - \c desired->callback should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL - * pointer here, and call SDL_QueueAudio() with some frequency, to queue - * more audio samples to be played (or for capture devices, call - * SDL_DequeueAudio() with some frequency, to obtain audio samples). - * - \c desired->userdata is passed as the first parameter to your callback - * function. If you passed a NULL callback, this value is ignored. - * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, - SDL_AudioSpec * obtained); - -/** - * SDL Audio Device IDs. - * - * A successful call to SDL_OpenAudio() is always device id 1, and legacy - * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls - * always returns devices >= 2 on success. The legacy calls are good both - * for backwards compatibility and when you don't care about multiple, - * specific, or capture devices. - */ -typedef Uint32 SDL_AudioDeviceID; - -/** - * Get the number of available devices exposed by the current driver. - * Only valid after a successfully initializing the audio subsystem. - * Returns -1 if an explicit list of devices can't be determined; this is - * not an error. For example, if SDL is set up to talk to a remote audio - * server, it can't list every one available on the Internet, but it will - * still allow a specific host to be specified to SDL_OpenAudioDevice(). - * - * In many common cases, when this function returns a value <= 0, it can still - * successfully open the default device (NULL for first argument of - * SDL_OpenAudioDevice()). - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); - -/** - * Get the human-readable name of a specific audio device. - * Must be a value between 0 and (number of audio devices-1). - * Only valid after a successfully initializing the audio subsystem. - * The values returned by this function reflect the latest call to - * SDL_GetNumAudioDevices(); recall that function to redetect available - * hardware. - * - * The string returned by this function is UTF-8 encoded, read-only, and - * managed internally. You are not to free it. If you need to keep the - * string for any length of time, you should make your own copy of it, as it - * will be invalid next time any of several other SDL functions is called. - */ -extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, - int iscapture); - - -/** - * Open a specific audio device. Passing in a device name of NULL requests - * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). - * - * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but - * some drivers allow arbitrary and driver-specific strings, such as a - * hostname/IP address for a remote audio server, or a filename in the - * diskaudio driver. - * - * \return 0 on error, a valid device ID that is >= 2 on success. - * - * SDL_OpenAudio(), unlike this function, always acts on device ID 1. - */ -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char - *device, - int iscapture, - const - SDL_AudioSpec * - desired, - SDL_AudioSpec * - obtained, - int - allowed_changes); - - - -/** - * \name Audio state - * - * Get the current audio state. - */ -/* @{ */ -typedef enum -{ - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_AudioStatus; -extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); - -extern DECLSPEC SDL_AudioStatus SDLCALL -SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); -/* @} *//* Audio State */ - -/** - * \name Pause audio functions - * - * These functions pause and unpause the audio callback processing. - * They should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -/* @{ */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); -extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, - int pause_on); -/* @} *//* Pause audio functions */ - -/** - * \brief Load the audio data of a WAVE file into memory - * - * Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len - * to be valid pointers. The entire data portion of the file is then loaded - * into memory and decoded if necessary. - * - * If \c freesrc is non-zero, the data source gets automatically closed and - * freed before the function returns. - * - * Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits), - * IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and - * µ-law (8 bits). Other formats are currently unsupported and cause an error. - * - * If this function succeeds, the pointer returned by it is equal to \c spec - * and the pointer to the audio data allocated by the function is written to - * \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec - * members \c freq, \c channels, and \c format are set to the values of the - * audio data in the buffer. The \c samples member is set to a sane default and - * all others are set to zero. - * - * It's necessary to use SDL_FreeWAV() to free the audio data returned in - * \c audio_buf when it is no longer used. - * - * Because of the underspecification of the Waveform format, there are many - * problematic files in the wild that cause issues with strict decoders. To - * provide compatibility with these files, this decoder is lenient in regards - * to the truncation of the file, the fact chunk, and the size of the RIFF - * chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION, - * and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the - * loading process. - * - * Any file that is invalid (due to truncation, corruption, or wrong values in - * the headers), too big, or unsupported causes an error. Additionally, any - * critical I/O error from the data source will terminate the loading process - * with an error. The function returns NULL on error and in all cases (with the - * exception of \c src being NULL), an appropriate error message will be set. - * - * It is required that the data source supports seeking. - * - * Example: - * \code - * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); - * \endcode - * - * \param src The data source with the WAVE data - * \param freesrc A integer value that makes the function close the data source if non-zero - * \param spec A pointer filled with the audio format of the audio data - * \param audio_buf A pointer filled with the audio data allocated by the function - * \param audio_len A pointer filled with the length of the audio data buffer in bytes - * \return NULL on error, or non-NULL on success. - */ -extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, - int freesrc, - SDL_AudioSpec * spec, - Uint8 ** audio_buf, - Uint32 * audio_len); - -/** - * Loads a WAV from a file. - * Compatibility convenience function. - */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/** - * This function frees data previously allocated with SDL_LoadWAV_RW() - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); - -/** - * This function takes a source format and rate and a destination format - * and rate, and initializes the \c cvt structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. An unsupported format causes an error and -1 will be returned. - * - * \return 0 if no conversion is needed, 1 if the audio filter is set up, - * or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, - SDL_AudioFormat src_format, - Uint8 src_channels, - int src_rate, - SDL_AudioFormat dst_format, - Uint8 dst_channels, - int dst_rate); - -/** - * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), - * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * - * The data conversion may expand the size of the audio data, so the buffer - * \c cvt->buf should be allocated after the \c cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. - * - * \return 0 on success or -1 if \c cvt->buf is NULL. - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); - -/* SDL_AudioStream is a new audio conversion interface. - The benefits vs SDL_AudioCVT: - - it can handle resampling data in chunks without generating - artifacts, when it doesn't have the complete buffer available. - - it can handle incoming data in any variable size. - - You push data as you have it, and pull it when you need it - */ -/* this is opaque to the outside world. */ -struct _SDL_AudioStream; -typedef struct _SDL_AudioStream SDL_AudioStream; - -/** - * Create a new audio stream - * - * \param src_format The format of the source audio - * \param src_channels The number of channels of the source audio - * \param src_rate The sampling rate of the source audio - * \param dst_format The format of the desired audio output - * \param dst_channels The number of channels of the desired audio output - * \param dst_rate The sampling rate of the desired audio output - * \return 0 on success, or -1 on error. - * - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, - const Uint8 src_channels, - const int src_rate, - const SDL_AudioFormat dst_format, - const Uint8 dst_channels, - const int dst_rate); - -/** - * Add data to be converted/resampled to the stream - * - * \param stream The stream the audio data is being added to - * \param buf A pointer to the audio data to add - * \param len The number of bytes to write to the stream - * \return 0 on success, or -1 on error. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); - -/** - * Get converted/resampled data from the stream - * - * \param stream The stream the audio is being requested from - * \param buf A buffer to fill with audio data - * \param len The maximum number of bytes to fill - * \return The number of bytes read from the stream, or -1 on error - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); - -/** - * Get the number of converted/resampled bytes available. The stream may be - * buffering data behind the scenes until it has enough to resample - * correctly, so this number might be lower than what you expect, or even - * be zero. Add more data or flush the stream if you need the data now. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); - -/** - * Tell the stream that you're done sending data, and anything being buffered - * should be converted/resampled and made available immediately. - * - * It is legal to add more data to a stream after flushing, but there will - * be audio gaps in the output. Generally this is intended to signal the - * end of input, so the complete output becomes available. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); - -/** - * Clear any pending data in the stream without converting it - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); - -/** - * Free an audio stream - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - */ -extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); - -#define SDL_MIX_MAXVOLUME 128 -/** - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. - */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, - Uint32 len, int volume); - -/** - * This works like SDL_MixAudio(), but you specify the audio format instead of - * using the format of audio device 1. Thus it can be used when no audio - * device is open at all. - */ -extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, - const Uint8 * src, - SDL_AudioFormat format, - Uint32 len, int volume); - -/** - * Queue more audio on non-callback devices. - * - * (If you are looking to retrieve queued audio from a non-callback capture - * device, you want SDL_DequeueAudio() instead. This will return -1 to - * signify an error if you use it with capture devices.) - * - * SDL offers two ways to feed audio to the device: you can either supply a - * callback that SDL triggers with some frequency to obtain more audio - * (pull method), or you can supply no callback, and then SDL will expect - * you to supply data at regular intervals (push method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Queued data will drain to the device as - * necessary without further intervention from you. If the device needs - * audio but there is not enough queued, it will play silence to make up - * the difference. This means you will have skips in your audio playback - * if you aren't routinely queueing sufficient data. - * - * This function copies the supplied data, so you are safe to free it when - * the function returns. This function is thread-safe, but queueing to the - * same device from two threads at once does not promise which buffer will - * be queued first. - * - * You may not queue audio on a device that is using an application-supplied - * callback; doing so returns an error. You have to use the audio callback - * or queue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before queueing; SDL - * handles locking internally for this function. - * - * \param dev The device ID to which we will queue audio. - * \param data The data to queue to the device for later playback. - * \param len The number of bytes (not samples!) to which (data) points. - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetQueuedAudioSize - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); - -/** - * Dequeue more audio on non-callback devices. - * - * (If you are looking to queue audio for output on a non-callback playback - * device, you want SDL_QueueAudio() instead. This will always return 0 - * if you use it with playback devices.) - * - * SDL offers two ways to retrieve audio from a capture device: you can - * either supply a callback that SDL triggers with some frequency as the - * device records more audio data, (push method), or you can supply no - * callback, and then SDL will expect you to retrieve data at regular - * intervals (pull method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Data from the device will keep queuing as - * necessary without further intervention from you. This means you will - * eventually run out of memory if you aren't routinely dequeueing data. - * - * Capture devices will not queue data when paused; if you are expecting - * to not need captured audio for some length of time, use - * SDL_PauseAudioDevice() to stop the capture device from queueing more - * data. This can be useful during, say, level loading times. When - * unpaused, capture devices will start queueing data from that point, - * having flushed any capturable data available while paused. - * - * This function is thread-safe, but dequeueing from the same device from - * two threads at once does not promise which thread will dequeued data - * first. - * - * You may not dequeue audio from a device that is using an - * application-supplied callback; doing so returns an error. You have to use - * the audio callback, or dequeue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before queueing; SDL - * handles locking internally for this function. - * - * \param dev The device ID from which we will dequeue audio. - * \param data A pointer into where audio data should be copied. - * \param len The number of bytes (not samples!) to which (data) points. - * \return number of bytes dequeued, which could be less than requested. - * - * \sa SDL_GetQueuedAudioSize - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len); - -/** - * Get the number of bytes of still-queued audio. - * - * For playback device: - * - * This is the number of bytes that have been queued for playback with - * SDL_QueueAudio(), but have not yet been sent to the hardware. This - * number may shrink at any time, so this only informs of pending data. - * - * Once we've sent it to the hardware, this function can not decide the - * exact byte boundary of what has been played. It's possible that we just - * gave the hardware several kilobytes right before you called this - * function, but it hasn't played any of it yet, or maybe half of it, etc. - * - * For capture devices: - * - * This is the number of bytes that have been captured by the device and - * are waiting for you to dequeue. This number may grow at any time, so - * this only informs of the lower-bound of available data. - * - * You may not queue audio on a device that is using an application-supplied - * callback; calling this function on such a device always returns 0. - * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use - * the audio callback, but not both. - * - * You should not call SDL_LockAudio() on the device before querying; SDL - * handles locking internally for this function. - * - * \param dev The device ID of which we will query queued audio size. - * \return Number of bytes (not samples!) of queued audio. - * - * \sa SDL_QueueAudio - * \sa SDL_ClearQueuedAudio - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); - -/** - * Drop any queued audio data. For playback devices, this is any queued data - * still waiting to be submitted to the hardware. For capture devices, this - * is any data that was queued by the device that hasn't yet been dequeued by - * the application. - * - * Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For - * playback devices, the hardware will start playing silence if more audio - * isn't queued. Unpaused capture devices will start filling the queue again - * as soon as they have more data available (which, depending on the state - * of the hardware and the thread, could be before this function call - * returns!). - * - * This will not prevent playback of queued audio that's already been sent - * to the hardware, as we can not undo that, so expect there to be some - * fraction of a second of audio that might still be heard. This can be - * useful if you want to, say, drop any pending music during a level change - * in your game. - * - * You may not queue audio on a device that is using an application-supplied - * callback; calling this function on such a device is always a no-op. - * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use - * the audio callback, but not both. - * - * You should not call SDL_LockAudio() on the device before clearing the - * queue; SDL handles locking internally for this function. - * - * This function always succeeds and thus returns void. - * - * \param dev The device ID of which to clear the audio queue. - * - * \sa SDL_QueueAudio - * \sa SDL_GetQueuedAudioSize - */ -extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); - - -/** - * \name Audio lock functions - * - * The lock manipulated by these functions protects the callback function. - * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that - * the callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -/* @{ */ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); -extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); -/* @} *//* Audio lock functions */ - -/** - * This function shuts down audio processing and closes the audio device. - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); -extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_audio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_bits.h b/Windows/SDL2/include/SDL_bits.h deleted file mode 100644 index b116cc8d..00000000 --- a/Windows/SDL2/include/SDL_bits.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_bits.h - * - * Functions for fiddling with bits and bitmasks. - */ - -#ifndef SDL_bits_h_ -#define SDL_bits_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_bits.h - */ - -/** - * Get the index of the most significant bit. Result is undefined when called - * with 0. This operation can also be stated as "count leading zeroes" and - * "log base 2". - * - * \return Index of the most significant bit, or -1 if the value is 0. - */ -#if defined(__WATCOMC__) && defined(__386__) -extern _inline int _SDL_clz_watcom (Uint32); -#pragma aux _SDL_clz_watcom = \ - "bsr eax, eax" \ - "xor eax, 31" \ - parm [eax] nomemory \ - value [eax] \ - modify exact [eax] nomemory; -#endif - -SDL_FORCE_INLINE int -SDL_MostSignificantBitIndex32(Uint32 x) -{ -#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) - /* Count Leading Zeroes builtin in GCC. - * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html - */ - if (x == 0) { - return -1; - } - return 31 - __builtin_clz(x); -#elif defined(__WATCOMC__) && defined(__386__) - if (x == 0) { - return -1; - } - return 31 - _SDL_clz_watcom(x); -#else - /* Based off of Bit Twiddling Hacks by Sean Eron Anderson - * <seander@cs.stanford.edu>, released in the public domain. - * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog - */ - const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; - const int S[] = {1, 2, 4, 8, 16}; - - int msbIndex = 0; - int i; - - if (x == 0) { - return -1; - } - - for (i = 4; i >= 0; i--) - { - if (x & b[i]) - { - x >>= S[i]; - msbIndex |= S[i]; - } - } - - return msbIndex; -#endif -} - -SDL_FORCE_INLINE SDL_bool -SDL_HasExactlyOneBitSet32(Uint32 x) -{ - if (x && !(x & (x - 1))) { - return SDL_TRUE; - } - return SDL_FALSE; -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_bits_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_blendmode.h b/Windows/SDL2/include/SDL_blendmode.h deleted file mode 100644 index 6f0a22b9..00000000 --- a/Windows/SDL2/include/SDL_blendmode.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_blendmode.h - * - * Header file declaring the SDL_BlendMode enumeration - */ - -#ifndef SDL_blendmode_h_ -#define SDL_blendmode_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The blend mode used in SDL_RenderCopy() and drawing operations. - */ -typedef enum -{ - SDL_BLENDMODE_NONE = 0x00000000, /**< no blending - dstRGBA = srcRGBA */ - SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) */ - SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending - dstRGB = (srcRGB * srcA) + dstRGB - dstA = dstA */ - SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate - dstRGB = srcRGB * dstRGB - dstA = dstA */ - SDL_BLENDMODE_INVALID = 0x7FFFFFFF - - /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ - -} SDL_BlendMode; - -/** - * \brief The blend operation used when combining source and destination pixel components - */ -typedef enum -{ - SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */ - SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */ - -} SDL_BlendOperation; - -/** - * \brief The normalized factor used to multiply pixel components - */ -typedef enum -{ - SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ - SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ - SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */ - SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */ - SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */ - SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */ - SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */ - SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */ - SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */ - SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */ - -} SDL_BlendFactor; - -/** - * \brief Create a custom blend mode, which may or may not be supported by a given renderer - * - * \param srcColorFactor source color factor - * \param dstColorFactor destination color factor - * \param colorOperation color operation - * \param srcAlphaFactor source alpha factor - * \param dstAlphaFactor destination alpha factor - * \param alphaOperation alpha operation - * - * The result of the blend mode operation will be: - * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor - * and - * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor - */ -extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, - SDL_BlendFactor dstColorFactor, - SDL_BlendOperation colorOperation, - SDL_BlendFactor srcAlphaFactor, - SDL_BlendFactor dstAlphaFactor, - SDL_BlendOperation alphaOperation); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_blendmode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_clipboard.h b/Windows/SDL2/include/SDL_clipboard.h deleted file mode 100644 index c4f8766c..00000000 --- a/Windows/SDL2/include/SDL_clipboard.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_clipboard.h - * - * Include file for SDL clipboard handling - */ - -#ifndef SDL_clipboard_h_ -#define SDL_clipboard_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -/** - * \brief Put UTF-8 text into the clipboard - * - * \sa SDL_GetClipboardText() - */ -extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); - -/** - * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() - * - * \sa SDL_SetClipboardText() - */ -extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); - -/** - * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty - * - * \sa SDL_GetClipboardText() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_clipboard_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_config.h b/Windows/SDL2/include/SDL_config.h deleted file mode 100644 index 7d62d3e2..00000000 --- a/Windows/SDL2/include/SDL_config.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/** - * \file SDL_config.h - */ - -/* Add any platform that doesn't build using the configure system. */ -#if defined(__WIN32__) -#include "SDL_config_windows.h" -#elif defined(__WINRT__) -#include "SDL_config_winrt.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__ANDROID__) -#include "SDL_config_android.h" -#elif defined(__PSP__) -#include "SDL_config_psp.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -/* This is a minimal configuration just to get SDL running on new platforms. */ -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#ifdef USING_GENERATED_CONFIG_H -#error Wrong SDL_config.h, check your include path? -#endif - -#endif /* SDL_config_h_ */ diff --git a/Windows/SDL2/include/SDL_config_android.h b/Windows/SDL2/include/SDL_config_android.h deleted file mode 100644 index 9cb70bfe..00000000 --- a/Windows/SDL2/include/SDL_config_android.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_android_h_ -#define SDL_config_android_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/** - * \file SDL_config_android.h - * - * This is a configuration that can be used to build SDL for Android - */ - -#include <stdarg.h> - -#define HAVE_GCC_ATOMICS 1 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_CLOCK_GETTIME 1 - -#define SIZEOF_VOIDP 4 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_ANDROID 1 -#define SDL_AUDIO_DRIVER_OPENSLES 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_ANDROID 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_ANDROID 1 - -/* Enable sensor driver */ -#define SDL_SENSOR_ANDROID 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_ANDROID 1 - -/* Enable OpenGL ES */ -#define SDL_VIDEO_OPENGL_ES 1 -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES2 1 - -/* Enable Vulkan support */ -/* Android does not support Vulkan in native code using the "armeabi" ABI. */ -#if defined(__ARM_ARCH) && __ARM_ARCH < 7 -#define SDL_VIDEO_VULKAN 0 -#else -#define SDL_VIDEO_VULKAN 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_ANDROID 1 - -/* Enable the filesystem driver */ -#define SDL_FILESYSTEM_ANDROID 1 - -#endif /* SDL_config_android_h_ */ diff --git a/Windows/SDL2/include/SDL_config_iphoneos.h b/Windows/SDL2/include/SDL_config_iphoneos.h deleted file mode 100644 index edfc03e2..00000000 --- a/Windows/SDL2/include/SDL_config_iphoneos.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_iphoneos_h_ -#define SDL_config_iphoneos_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define HAVE_GCC_ATOMICS 1 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 -/* The libunwind functions are only available on x86 */ -/* #undef HAVE_LIBUNWIND_H */ - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_SYSCTLBYNAME 1 - -/* enable iPhone version of Core Audio driver */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DUMMY 1 - -/* Enable MFi joystick support */ -#define SDL_JOYSTICK_MFI 1 -/*#define SDL_JOYSTICK_HIDAPI 1*/ - -#ifdef __TVOS__ -#define SDL_SENSOR_DUMMY 1 -#else -/* Enable the CoreMotion sensor driver */ -#define SDL_SENSOR_COREMOTION 1 -#endif - -/* Enable Unix style SO loading */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Supported video drivers */ -#define SDL_VIDEO_DRIVER_UIKIT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL ES */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_RENDER_OGL_ES2 1 - -/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer */ -#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)) -#define SDL_PLATFORM_SUPPORTS_METAL 1 -#else -#define SDL_PLATFORM_SUPPORTS_METAL 0 -#endif - -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_RENDER_METAL 1 -#endif - -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_VULKAN 1 -#endif - -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_METAL 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_UIKIT 1 - -/* enable iPhone keyboard support */ -#define SDL_IPHONE_KEYBOARD 1 - -/* enable iOS extended launch screen */ -#define SDL_IPHONE_LAUNCHSCREEN 1 - -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - -/* enable filesystem support */ -#define SDL_FILESYSTEM_COCOA 1 - -#endif /* SDL_config_iphoneos_h_ */ diff --git a/Windows/SDL2/include/SDL_config_macosx.h b/Windows/SDL2/include/SDL_config_macosx.h deleted file mode 100644 index 22287dfc..00000000 --- a/Windows/SDL2/include/SDL_config_macosx.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_macosx_h_ -#define SDL_config_macosx_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ -#include <AvailabilityMacros.h> - -/* This is a set of defines to configure the SDL features */ - -#ifdef __LP64__ - #define SIZEOF_VOIDP 8 -#else - #define SIZEOF_VOIDP 4 -#endif - -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_LIBUNWIND_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_SYSCONF 1 -#define HAVE_SYSCTLBYNAME 1 - -#define HAVE_GCC_ATOMICS 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_IOKIT 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_COCOA 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 -#undef SDL_VIDEO_DRIVER_X11 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib" -#define SDL_VIDEO_DRIVER_X11_XDBE 1 -#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 -#define SDL_VIDEO_DRIVER_X11_XRANDR 1 -#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 -#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 -#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 -#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 - -#ifdef MAC_OS_X_VERSION_10_8 -/* - * No matter the versions targeted, this is the 10.8 or later SDK, so you have - * to use the external Xquartz, which is a more modern Xlib. Previous SDKs - * used an older Xlib. - */ -#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 -#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 -#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 -#endif - -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif - -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif - -/* Metal only supported on 64-bit architectures with 10.11+ */ -#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) -#define SDL_PLATFORM_SUPPORTS_METAL 1 -#else -#define SDL_PLATFORM_SUPPORTS_METAL 0 -#endif - -#ifndef SDL_VIDEO_RENDER_METAL -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_RENDER_METAL 1 -#else -#define SDL_VIDEO_RENDER_METAL 0 -#endif -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_CGL -#define SDL_VIDEO_OPENGL_CGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_GLX -#define SDL_VIDEO_OPENGL_GLX 1 -#endif - -/* Enable Vulkan and Metal support */ -#ifndef SDL_VIDEO_VULKAN -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_VULKAN 1 -#else -#define SDL_VIDEO_VULKAN 0 -#endif -#endif - -#ifndef SDL_VIDEO_METAL -#if SDL_PLATFORM_SUPPORTS_METAL -#define SDL_VIDEO_METAL 1 -#else -#define SDL_VIDEO_METAL 0 -#endif -#endif - -/* Enable system power support */ -#define SDL_POWER_MACOSX 1 - -/* enable filesystem support */ -#define SDL_FILESYSTEM_COCOA 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 -#ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 -#endif - -#endif /* SDL_config_macosx_h_ */ diff --git a/Windows/SDL2/include/SDL_config_minimal.h b/Windows/SDL2/include/SDL_config_minimal.h deleted file mode 100644 index 20e45b88..00000000 --- a/Windows/SDL2/include/SDL_config_minimal.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_minimal_h_ -#define SDL_config_minimal_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/** - * \file SDL_config_minimal.h - * - * This is the minimal configuration that can be used to build SDL. - */ - -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 - -/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ -#if defined(_MSC_VER) && (_MSC_VER < 1600) -/* Here are some reasonable defaults */ -typedef unsigned int size_t; -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -#else -#define HAVE_STDINT_H 1 -#endif /* Visual Studio 2008 */ - -#ifdef __GNUC__ -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 -#endif - -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ -#define SDL_SENSOR_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 - -/* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ -#define SDL_FILESYSTEM_DUMMY 1 - -#endif /* SDL_config_minimal_h_ */ diff --git a/Windows/SDL2/include/SDL_config_os2.h b/Windows/SDL2/include/SDL_config_os2.h deleted file mode 100644 index f03ca4a5..00000000 --- a/Windows/SDL2/include/SDL_config_os2.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_os2_h_ -#define SDL_config_os2_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_DISK 1 - -#define SDL_POWER_DISABLED 1 -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 -/*#undef SDL_JOYSTICK_HIDAPI */ - -#define SDL_SENSOR_DUMMY 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL support */ -/* #undef SDL_VIDEO_OPENGL */ - -/* Enable Vulkan support */ -/* #undef SDL_VIDEO_VULKAN */ - -#define SDL_LOADSO_DISABLED 1 -#define SDL_THREADS_DISABLED 1 -#define SDL_TIMERS_DISABLED 1 -#define SDL_FILESYSTEM_DUMMY 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 - -/* #undef HAVE_LIBSAMPLERATE_H */ - -/* Enable dynamic libsamplerate support */ -/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ - -#define HAVE_LIBC 1 - -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_WCHAR_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_SIGNAL_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#if defined(__WATCOMC__) -#define HAVE__FSEEKI64 1 -#define HAVE__FTELLI64 1 -#endif -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 -#define HAVE_WCSCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 -/* #define HAVE_WCSDUP 1 */ -/* #define wcsdup _wcsdup */ -#define HAVE_WCSSTR 1 -#define HAVE_WCSCMP 1 -#define HAVE_WCSNCMP 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 -#define HAVE_ACOS 1 -/* #undef HAVE_ACOSF */ -#define HAVE_ASIN 1 -/* #undef HAVE_ASINF */ -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -/* #undef HAVE_ATAN2F */ -#define HAVE_CEIL 1 -/* #undef HAVE_CEILF */ -/* #undef HAVE_COPYSIGN */ -/* #undef HAVE_COPYSIGNF */ -#define HAVE_COS 1 -/* #undef HAVE_COSF */ -#define HAVE_EXP 1 -/* #undef HAVE_EXPF */ -#define HAVE_FABS 1 -/* #undef HAVE_FABSF */ -#define HAVE_FLOOR 1 -/* #undef HAVE_FLOORF */ -#define HAVE_FMOD 1 -/* #undef HAVE_FMODF */ -#define HAVE_LOG 1 -/* #undef HAVE_LOGF */ -#define HAVE_LOG10 1 -/* #undef HAVE_LOG10F */ -#define HAVE_POW 1 -/* #undef HAVE_POWF */ -#define HAVE_SIN 1 -/* #undef HAVE_SINF */ -/* #undef HAVE_SCALBN */ -/* #undef HAVE_SCALBNF */ -#define HAVE_SQRT 1 -/* #undef HAVE_SQRTF */ -#define HAVE_TAN 1 -/* #undef HAVE_TANF */ - -#endif /* SDL_config_os2_h_ */ diff --git a/Windows/SDL2/include/SDL_config_pandora.h b/Windows/SDL2/include/SDL_config_pandora.h deleted file mode 100644 index 66ccf895..00000000 --- a/Windows/SDL2/include/SDL_config_pandora.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_pandora_h_ -#define SDL_config_pandora_h_ -#define SDL_config_h_ - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define SDL_BYTEORDER 1234 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_LOG10 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_SENSOR_DUMMY 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 -#define SDL_FILESYSTEM_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* SDL_config_pandora_h_ */ diff --git a/Windows/SDL2/include/SDL_config_psp.h b/Windows/SDL2/include/SDL_config_psp.h deleted file mode 100644 index dd2d6ecf..00000000 --- a/Windows/SDL2/include/SDL_config_psp.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_psp_h_ -#define SDL_config_psp_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - - - -#ifdef __GNUC__ -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 -#endif - -#define HAVE_GCC_ATOMICS 1 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_SETENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -/* #define HAVE_SYSCONF 1 */ -/* #define HAVE_SIGACTION 1 */ - - -/* PSP isn't that sophisticated */ -#define LACKS_SYS_MMAN_H 1 - -/* Enable the PSP thread support (src/thread/psp/\*.c) */ -#define SDL_THREAD_PSP 1 - -/* Enable the PSP timer support (src/timer/psp/\*.c) */ -#define SDL_TIMERS_PSP 1 - -/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ -#define SDL_JOYSTICK_PSP 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable the PSP audio driver (src/audio/psp/\*.c) */ -#define SDL_AUDIO_DRIVER_PSP 1 - -/* PSP video driver */ -#define SDL_VIDEO_DRIVER_PSP 1 - -/* PSP render driver */ -#define SDL_VIDEO_RENDER_PSP 1 - -#define SDL_POWER_PSP 1 - -/* !!! FIXME: what does PSP do for filesystem stuff? */ -#define SDL_FILESYSTEM_DUMMY 1 - -/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* PSP can't load shared object (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - - -#endif /* SDL_config_psp_h_ */ diff --git a/Windows/SDL2/include/SDL_config_windows.h b/Windows/SDL2/include/SDL_config_windows.h deleted file mode 100644 index c66d8754..00000000 --- a/Windows/SDL2/include/SDL_config_windows.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_windows_h_ -#define SDL_config_windows_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -#define HAVE_DDRAW_H 1 -#define HAVE_DINPUT_H 1 -#define HAVE_DSOUND_H 1 -#define HAVE_DXGI_H 1 -#define HAVE_XINPUT_H 1 -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 - -/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ -#ifdef HAVE_LIBC -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__STRUPR */ -/* #undef HAVE__STRLWR */ -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -#if defined(_MSC_VER) -#define HAVE_STRTOK_S 1 -#endif -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__LTOA */ -/* #undef HAVE__ULTOA */ -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#if defined(_MSC_VER) -/* These functions were added with the VC++ 2013 C runtime library */ -#if _MSC_VER >= 1800 -#define HAVE_STRTOLL 1 -#define HAVE_VSSCANF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#endif -/* This function is available with at least the VC++ 2008 C runtime library */ -#if _MSC_VER >= 1400 -#define HAVE__FSEEKI64 1 -#endif -#endif -#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) -#define HAVE_M_PI 1 -#endif -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -/* #undef SDL_AUDIO_DRIVER_WASAPI */ -#define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_DINPUT 1 -#define SDL_HAPTIC_XINPUT 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WINDOWS 1 - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 - -#ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif -#ifndef SDL_VIDEO_RENDER_D3D11 -#define SDL_VIDEO_RENDER_D3D11 0 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif - -/* Enable Vulkan support */ -#define SDL_VIDEO_VULKAN 1 - -/* Enable system power support */ -#define SDL_POWER_WINDOWS 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* SDL_config_windows_h_ */ diff --git a/Windows/SDL2/include/SDL_config_winrt.h b/Windows/SDL2/include/SDL_config_winrt.h deleted file mode 100644 index cb85b234..00000000 --- a/Windows/SDL2/include/SDL_config_winrt.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_winrt_h_ -#define SDL_config_winrt_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used - by SDL to determine which version of the Windows SDK is being used. -*/ -#include <sdkddkver.h> - -/* Define possibly-undefined NTDDI values (used when compiling SDL against - older versions of the Windows SDK. -*/ -#ifndef NTDDI_WINBLUE -#define NTDDI_WINBLUE 0x06030000 -#endif -#ifndef NTDDI_WIN10 -#define NTDDI_WIN10 0x0A000000 -#endif - -/* This is a set of defines to configure the SDL features */ - -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -/* Useful headers */ -#define HAVE_DXGI_H 1 -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP -#define HAVE_XINPUT_H 1 -#endif - -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 - -#define HAVE_LIBC 1 -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_S 1 -//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead -//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead -//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -//#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_VSNPRINTF 1 -//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE__SCALB 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE__FSEEKI64 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_WASAPI 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 -#else -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_HAPTIC_XINPUT 1 -#endif - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#if (NTDDI_VERSION >= NTDDI_WINBLUE) -#define SDL_THREAD_WINDOWS 1 -#else -/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ -#define SDL_THREAD_STDCPP 1 -#endif - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_WINRT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 - -/* Enable appropriate renderer(s) */ -#define SDL_VIDEO_RENDER_D3D11 1 - -#if SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_WINRT 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* SDL_config_winrt_h_ */ diff --git a/Windows/SDL2/include/SDL_config_wiz.h b/Windows/SDL2/include/SDL_config_wiz.h deleted file mode 100644 index 724c55fc..00000000 --- a/Windows/SDL2/include/SDL_config_wiz.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_wiz_h_ -#define SDL_config_wiz_h_ -#define SDL_config_h_ - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#define SDL_BYTEORDER 1234 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOK_R 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COPYSIGNF 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_POW 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_SENSOR_DUMMY 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* SDL_config_wiz_h_ */ diff --git a/Windows/SDL2/include/SDL_copying.h b/Windows/SDL2/include/SDL_copying.h deleted file mode 100644 index 1ef18cd1..00000000 --- a/Windows/SDL2/include/SDL_copying.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ diff --git a/Windows/SDL2/include/SDL_cpuinfo.h b/Windows/SDL2/include/SDL_cpuinfo.h deleted file mode 100644 index 2d094e88..00000000 --- a/Windows/SDL2/include/SDL_cpuinfo.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_cpuinfo.h - * - * CPU feature detection for SDL. - */ - -#ifndef SDL_cpuinfo_h_ -#define SDL_cpuinfo_h_ - -#include "SDL_stdinc.h" - -/* Need to do this here because intrin.h has C++ code in it */ -/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ -#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) -#ifdef __clang__ -/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */ -#undef __MMX__ -#undef __SSE__ -#undef __SSE2__ -#else -#include <intrin.h> -#ifndef _WIN64 -#ifndef __MMX__ -#define __MMX__ -#endif -#ifndef __3dNOW__ -#define __3dNOW__ -#endif -#endif -#ifndef __SSE__ -#define __SSE__ -#endif -#ifndef __SSE2__ -#define __SSE2__ -#endif -#endif /* __clang__ */ -#elif defined(__MINGW64_VERSION_MAJOR) -#include <intrin.h> -#else -/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */ -#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H) -#include <altivec.h> -#endif -#if !defined(SDL_DISABLE_ARM_NEON_H) -# if defined(__ARM_NEON) -# include <arm_neon.h> -# elif defined(__WINDOWS__) || defined(__WINRT__) -/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */ -# if defined(_M_ARM) -# include <armintr.h> -# include <arm_neon.h> -# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ -# endif -# if defined (_M_ARM64) -# include <arm64intr.h> -# include <arm64_neon.h> -# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ -# endif -# endif -#endif -#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H) -#include <mm3dnow.h> -#endif -#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) -#include <immintrin.h> -#else -#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H) -#include <mmintrin.h> -#endif -#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H) -#include <xmmintrin.h> -#endif -#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H) -#include <emmintrin.h> -#endif -#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H) -#include <pmmintrin.h> -#endif -#endif /* HAVE_IMMINTRIN_H */ -#endif /* compiler version */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* This is a guess for the cacheline size used for padding. - * Most x86 processors have a 64 byte cache line. - * The 64-bit PowerPC processors have a 128 byte cache line. - * We'll use the larger value to be generally safe. - */ -#define SDL_CACHELINE_SIZE 128 - -/** - * This function returns the number of CPU cores available. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); - -/** - * This function returns the L1 cache line size of the CPU - * - * This is useful for determining multi-threaded structure padding - * or SIMD prefetch sizes. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); - -/** - * This function returns true if the CPU has the RDTSC instruction. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/** - * This function returns true if the CPU has AltiVec features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/** - * This function returns true if the CPU has MMX features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/** - * This function returns true if the CPU has 3DNow! features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/** - * This function returns true if the CPU has SSE features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/** - * This function returns true if the CPU has SSE2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/** - * This function returns true if the CPU has SSE3 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); - -/** - * This function returns true if the CPU has SSE4.1 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); - -/** - * This function returns true if the CPU has SSE4.2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); - -/** - * This function returns true if the CPU has AVX features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); - -/** - * This function returns true if the CPU has AVX2 features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); - -/** - * This function returns true if the CPU has AVX-512F (foundation) features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); - -/** - * This function returns true if the CPU has ARM SIMD (ARMv6) features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); - -/** - * This function returns true if the CPU has NEON (ARM SIMD) features. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); - -/** - * This function returns the amount of RAM configured in the system, in MB. - */ -extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); - -/** - * \brief Report the alignment this system needs for SIMD allocations. - * - * This will return the minimum number of bytes to which a pointer must be - * aligned to be compatible with SIMD instructions on the current machine. - * For example, if the machine supports SSE only, it will return 16, but if - * it supports AVX-512F, it'll return 64 (etc). This only reports values for - * instruction sets SDL knows about, so if your SDL build doesn't have - * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and - * not 64 for the AVX-512 instructions that exist but SDL doesn't know about. - * Plan accordingly. - */ -extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); - -/** - * \brief Allocate memory in a SIMD-friendly way. - * - * This will allocate a block of memory that is suitable for use with SIMD - * instructions. Specifically, it will be properly aligned and padded for - * the system's supported vector instructions. - * - * The memory returned will be padded such that it is safe to read or write - * an incomplete vector at the end of the memory block. This can be useful - * so you don't have to drop back to a scalar fallback at the end of your - * SIMD processing loop to deal with the final elements without overflowing - * the allocated buffer. - * - * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() - * or delete[], etc. - * - * Note that SDL will only deal with SIMD instruction sets it is aware of; - * for example, SDL 2.0.8 knows that SSE wants 16-byte vectors - * (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't - * know that AVX-512 wants 64. To be clear: if you can't decide to use an - * instruction set with an SDL_Has*() function, don't use that instruction - * set with memory allocated through here. - * - * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't - * out of memory. - * - * \param len The length, in bytes, of the block to allocated. The actual - * allocated block might be larger due to padding, etc. - * \return Pointer to newly-allocated block, NULL if out of memory. - * - * \sa SDL_SIMDAlignment - * \sa SDL_SIMDFree - */ -extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); - -/** - * \brief Deallocate memory obtained from SDL_SIMDAlloc - * - * It is not valid to use this function on a pointer from anything but - * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, - * SDL_malloc, memalign, new[], etc. - * - * However, SDL_SIMDFree(NULL) is a legal no-op. - * - * \sa SDL_SIMDAlloc - */ -extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); - -/* vi: set ts=4 sw=4 expandtab: */ -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_cpuinfo_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_egl.h b/Windows/SDL2/include/SDL_egl.h deleted file mode 100644 index f95a9067..00000000 --- a/Windows/SDL2/include/SDL_egl.h +++ /dev/null @@ -1,1676 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_egl.h - * - * This is a simple file to encapsulate the EGL API headers. - */ -#if !defined(_MSC_VER) && !defined(__ANDROID__) - -#include <EGL/egl.h> -#include <EGL/eglext.h> - -#else /* _MSC_VER */ - -/* EGL headers for Visual Studio */ - -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. -* -* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ -* -* Adopters may modify this file to suit their platform. Adopters are -* encouraged to submit platform specific modifications to the Khronos -* group so that they can be included in future versions of this file. -* Please submit changes by sending them to the public Khronos Bugzilla -* (http://khronos.org/bugzilla) by filing a bug against product -* "Khronos (general)" component "Registry". -* -* A predefined template which fills in some of the bug fields can be -* reached using http://tinyurl.com/khrplatform-h-bugreport, but you -* must create a Bugzilla login first. -* -* -* See the Implementer's Guidelines for information about where this file -* should be located on your system and for more details of its use: -* http://www.khronos.org/registry/implementers_guide.pdf -* -* This file should be included as -* #include <KHR/khrplatform.h> -* by Khronos client API header files that use its types and defines. -* -* The types in khrplatform.h should only be used to define API-specific types. -* -* Types defined in khrplatform.h: -* khronos_int8_t signed 8 bit -* khronos_uint8_t unsigned 8 bit -* khronos_int16_t signed 16 bit -* khronos_uint16_t unsigned 16 bit -* khronos_int32_t signed 32 bit -* khronos_uint32_t unsigned 32 bit -* khronos_int64_t signed 64 bit -* khronos_uint64_t unsigned 64 bit -* khronos_intptr_t signed same number of bits as a pointer -* khronos_uintptr_t unsigned same number of bits as a pointer -* khronos_ssize_t signed size -* khronos_usize_t unsigned size -* khronos_float_t signed 32 bit floating point -* khronos_time_ns_t unsigned 64 bit time in nanoseconds -* khronos_utime_nanoseconds_t unsigned time interval or absolute time in -* nanoseconds -* khronos_stime_nanoseconds_t signed time interval in nanoseconds -* khronos_boolean_enum_t enumerated boolean type. This should -* only be used as a base type when a client API's boolean type is -* an enum. Client APIs which use an integer or other type for -* booleans cannot use this as the base type for their boolean. -* -* Tokens defined in khrplatform.h: -* -* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. -* -* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. -* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. -* -* Calling convention macros defined in this file: -* KHRONOS_APICALL -* KHRONOS_APIENTRY -* KHRONOS_APIATTRIBUTES -* -* These may be used in function prototypes as: -* -* KHRONOS_APICALL void KHRONOS_APIENTRY funcname( -* int arg1, -* int arg2) KHRONOS_APIATTRIBUTES; -*/ - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APICALL -*------------------------------------------------------------------------- -* This precedes the return type of the function in the function prototype. -*/ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(SDL_VIDEO_STATIC_ANGLE) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APIENTRY -*------------------------------------------------------------------------- -* This follows the return type of the function and precedes the function -* name in the function prototype. -*/ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) -/* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- -* Definition of KHRONOS_APIATTRIBUTES -*------------------------------------------------------------------------- -* This follows the closing parenthesis of the function prototype arguments. -*/ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- -* basic type definitions -*-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* -* Using <stdint.h> -*/ -#include <stdint.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* -* Using <inttypes.h> -*/ -#include <inttypes.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* -* Win32 -*/ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* -* Sun or Digital -*/ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* -* Hypothetical platform with no float or int64 support -*/ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* -* Generic fallback -*/ -#include <stdint.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* -* Types that are (so far) the same on all platforms -*/ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* -* Types that differ between LLP64 and LP64 architectures - in LLP64, -* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears -* to be the only LLP64 architecture in current use. -*/ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* -* Float type -*/ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types -* -* These types can be used to represent a time interval in nanoseconds or -* an absolute Unadjusted System Time. Unadjusted System Time is the number -* of nanoseconds since some arbitrary system event (e.g. since the last -* time the system booted). The Unadjusted System Time is an unsigned -* 64 bit value that wraps back to 0 every 584 years. Time intervals -* may be either signed or unsigned. -*/ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* -* Dummy value used to pad enum types to 32 bits. -*/ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* -* Enumerated boolean type -* -* Values other than zero should be considered to be true. Therefore -* comparisons should not be made against KHRONOS_TRUE. -*/ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - - -#ifndef __eglplatform_h_ -#define __eglplatform_h_ - -/* -** Copyright (c) 2007-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Platform-specific types and definitions for egl.h -* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ -* -* Adopters may modify khrplatform.h and this file to suit their platform. -* You are encouraged to submit all modifications to the Khronos group so that -* they can be included in future versions of this file. Please submit changes -* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) -* by filing a bug against product "EGL" component "Registry". -*/ - -/*#include <KHR/khrplatform.h>*/ - -/* Macros used in EGL function prototype declarations. -* -* EGL functions should be prototyped as: -* -* EGLAPI return-type EGLAPIENTRY eglFunction(arguments); -* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); -* -* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h -*/ - -#ifndef EGLAPI -#define EGLAPI KHRONOS_APICALL -#endif - -#ifndef EGLAPIENTRY -#define EGLAPIENTRY KHRONOS_APIENTRY -#endif -#define EGLAPIENTRYP EGLAPIENTRY* - -/* The types NativeDisplayType, NativeWindowType, and NativePixmapType -* are aliases of window-system-dependent types, such as X Display * or -* Windows Device Context. They must be defined in platform-specific -* code below. The EGL-prefixed versions of Native*Type are the same -* types, renamed in EGL 1.3 so all types in the API start with "EGL". -* -* Khronos STRONGLY RECOMMENDS that you use the default definitions -* provided below, since these changes affect both binary and source -* portability of applications using EGL running on different EGL -* implementations. -*/ - -#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> - -#if __WINRT__ -#include <Unknwn.h> -typedef IUnknown * EGLNativeWindowType; -typedef IUnknown * EGLNativePixmapType; -typedef IUnknown * EGLNativeDisplayType; -#else -typedef HDC EGLNativeDisplayType; -typedef HBITMAP EGLNativePixmapType; -typedef HWND EGLNativeWindowType; -#endif - -#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ - -typedef int EGLNativeDisplayType; -typedef void *EGLNativeWindowType; -typedef void *EGLNativePixmapType; - -#elif defined(WL_EGL_PLATFORM) - -typedef struct wl_display *EGLNativeDisplayType; -typedef struct wl_egl_pixmap *EGLNativePixmapType; -typedef struct wl_egl_window *EGLNativeWindowType; - -#elif defined(__GBM__) - -typedef struct gbm_device *EGLNativeDisplayType; -typedef struct gbm_bo *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(__ANDROID__) /* Android */ - -struct ANativeWindow; -struct egl_native_pixmap_t; - -typedef struct ANativeWindow *EGLNativeWindowType; -typedef struct egl_native_pixmap_t *EGLNativePixmapType; -typedef void *EGLNativeDisplayType; - -#elif defined(MIR_EGL_PLATFORM) - -#include <mir_toolkit/mir_client_library.h> -typedef MirEGLNativeDisplayType EGLNativeDisplayType; -typedef void *EGLNativePixmapType; -typedef MirEGLNativeWindowType EGLNativeWindowType; - -#elif defined(__unix__) - -#ifdef MESA_EGL_NO_X11_HEADERS - -typedef void *EGLNativeDisplayType; -typedef khronos_uintptr_t EGLNativePixmapType; -typedef khronos_uintptr_t EGLNativeWindowType; - -#else - -/* X11 (tentative) */ -#include <X11/Xlib.h> -#include <X11/Xutil.h> - -typedef Display *EGLNativeDisplayType; -typedef Pixmap EGLNativePixmapType; -typedef Window EGLNativeWindowType; - -#endif /* MESA_EGL_NO_X11_HEADERS */ - -#else -#error "Platform not recognized" -#endif - -/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ -typedef EGLNativeDisplayType NativeDisplayType; -typedef EGLNativePixmapType NativePixmapType; -typedef EGLNativeWindowType NativeWindowType; - - -/* Define EGLint. This must be a signed integral type large enough to contain -* all legal attribute names and values passed into and out of EGL, whether -* their type is boolean, bitmask, enumerant (symbolic constant), integer, -* handle, or other. While in general a 32-bit integer will suffice, if -* handles are 64 bit types, then EGLint should be defined as a signed 64-bit -* integer type. -*/ -typedef khronos_int32_t EGLint; - -#endif /* __eglplatform_h */ - -#ifndef __egl_h_ -#define __egl_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ -*/ - -/*#include <EGL/eglplatform.h>*/ - -/* Generated on date 20150623 */ - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: .* - * Default extensions included: None - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_VERSION_1_0 -#define EGL_VERSION_1_0 1 -typedef unsigned int EGLBoolean; -typedef void *EGLDisplay; -typedef void *EGLConfig; -typedef void *EGLSurface; -typedef void *EGLContext; -typedef void (*__eglMustCastToProperFunctionPointerType)(void); -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300A -#define EGL_BAD_NATIVE_WINDOW 0x300B -#define EGL_BAD_PARAMETER 0x300C -#define EGL_BAD_SURFACE 0x300D -#define EGL_BLUE_SIZE 0x3022 -#define EGL_BUFFER_SIZE 0x3020 -#define EGL_CONFIG_CAVEAT 0x3027 -#define EGL_CONFIG_ID 0x3028 -#define EGL_CORE_NATIVE_ENGINE 0x305B -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_DONT_CARE ((EGLint)-1) -#define EGL_DRAW 0x3059 -#define EGL_EXTENSIONS 0x3055 -#define EGL_FALSE 0 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_HEIGHT 0x3056 -#define EGL_LARGEST_PBUFFER 0x3058 -#define EGL_LEVEL 0x3029 -#define EGL_MAX_PBUFFER_HEIGHT 0x302A -#define EGL_MAX_PBUFFER_PIXELS 0x302B -#define EGL_MAX_PBUFFER_WIDTH 0x302C -#define EGL_NATIVE_RENDERABLE 0x302D -#define EGL_NATIVE_VISUAL_ID 0x302E -#define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_NONE 0x3038 -#define EGL_NON_CONFORMANT_CONFIG 0x3051 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_NO_CONTEXT ((EGLContext)0) -#define EGL_NO_DISPLAY ((EGLDisplay)0) -#define EGL_NO_SURFACE ((EGLSurface)0) -#define EGL_PBUFFER_BIT 0x0001 -#define EGL_PIXMAP_BIT 0x0002 -#define EGL_READ 0x305A -#define EGL_RED_SIZE 0x3024 -#define EGL_SAMPLES 0x3031 -#define EGL_SAMPLE_BUFFERS 0x3032 -#define EGL_SLOW_CONFIG 0x3050 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_SUCCESS 0x3000 -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 -#define EGL_TRANSPARENT_RED_VALUE 0x3037 -#define EGL_TRANSPARENT_RGB 0x3052 -#define EGL_TRANSPARENT_TYPE 0x3034 -#define EGL_TRUE 1 -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_WIDTH 0x3057 -#define EGL_WINDOW_BIT 0x0004 -EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); -EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); -EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); -EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); -EGLAPI EGLint EGLAPIENTRY eglGetError (void); -EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); -EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); -EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); -EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); -#endif /* EGL_VERSION_1_0 */ - -#ifndef EGL_VERSION_1_1 -#define EGL_VERSION_1_1 1 -#define EGL_BACK_BUFFER 0x3084 -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A -#define EGL_CONTEXT_LOST 0x300E -#define EGL_MIN_SWAP_INTERVAL 0x303B -#define EGL_MAX_SWAP_INTERVAL 0x303C -#define EGL_MIPMAP_TEXTURE 0x3082 -#define EGL_MIPMAP_LEVEL 0x3083 -#define EGL_NO_TEXTURE 0x305C -#define EGL_TEXTURE_2D 0x305F -#define EGL_TEXTURE_FORMAT 0x3080 -#define EGL_TEXTURE_RGB 0x305D -#define EGL_TEXTURE_RGBA 0x305E -#define EGL_TEXTURE_TARGET 0x3081 -EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); -#endif /* EGL_VERSION_1_1 */ - -#ifndef EGL_VERSION_1_2 -#define EGL_VERSION_1_2 1 -typedef unsigned int EGLenum; -typedef void *EGLClientBuffer; -#define EGL_ALPHA_FORMAT 0x3088 -#define EGL_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_ALPHA_FORMAT_PRE 0x308C -#define EGL_ALPHA_MASK_SIZE 0x303E -#define EGL_BUFFER_PRESERVED 0x3094 -#define EGL_BUFFER_DESTROYED 0x3095 -#define EGL_CLIENT_APIS 0x308D -#define EGL_COLORSPACE 0x3087 -#define EGL_COLORSPACE_sRGB 0x3089 -#define EGL_COLORSPACE_LINEAR 0x308A -#define EGL_COLOR_BUFFER_TYPE 0x303F -#define EGL_CONTEXT_CLIENT_TYPE 0x3097 -#define EGL_DISPLAY_SCALING 10000 -#define EGL_HORIZONTAL_RESOLUTION 0x3090 -#define EGL_LUMINANCE_BUFFER 0x308F -#define EGL_LUMINANCE_SIZE 0x303D -#define EGL_OPENGL_ES_BIT 0x0001 -#define EGL_OPENVG_BIT 0x0002 -#define EGL_OPENGL_ES_API 0x30A0 -#define EGL_OPENVG_API 0x30A1 -#define EGL_OPENVG_IMAGE 0x3096 -#define EGL_PIXEL_ASPECT_RATIO 0x3092 -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_RGB_BUFFER 0x308E -#define EGL_SINGLE_BUFFER 0x3085 -#define EGL_SWAP_BEHAVIOR 0x3093 -#define EGL_UNKNOWN ((EGLint)-1) -#define EGL_VERTICAL_RESOLUTION 0x3091 -EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); -EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); -#endif /* EGL_VERSION_1_2 */ - -#ifndef EGL_VERSION_1_3 -#define EGL_VERSION_1_3 1 -#define EGL_CONFORMANT 0x3042 -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 -#define EGL_MATCH_NATIVE_PIXMAP 0x3041 -#define EGL_OPENGL_ES2_BIT 0x0004 -#define EGL_VG_ALPHA_FORMAT 0x3088 -#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_VG_ALPHA_FORMAT_PRE 0x308C -#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 -#define EGL_VG_COLORSPACE 0x3087 -#define EGL_VG_COLORSPACE_sRGB 0x3089 -#define EGL_VG_COLORSPACE_LINEAR 0x308A -#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 -#endif /* EGL_VERSION_1_3 */ - -#ifndef EGL_VERSION_1_4 -#define EGL_VERSION_1_4 1 -#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) -#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 -#define EGL_MULTISAMPLE_RESOLVE 0x3099 -#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A -#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B -#define EGL_OPENGL_API 0x30A2 -#define EGL_OPENGL_BIT 0x0008 -#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 -EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); -#endif /* EGL_VERSION_1_4 */ - -#ifndef EGL_VERSION_1_5 -#define EGL_VERSION_1_5 1 -typedef void *EGLSync; -typedef intptr_t EGLAttrib; -typedef khronos_utime_nanoseconds_t EGLTime; -typedef void *EGLImage; -#define EGL_CONTEXT_MAJOR_VERSION 0x3098 -#define EGL_CONTEXT_MINOR_VERSION 0x30FB -#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD -#define EGL_NO_RESET_NOTIFICATION 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 -#define EGL_OPENGL_ES3_BIT 0x00000040 -#define EGL_CL_EVENT_HANDLE 0x309C -#define EGL_SYNC_CL_EVENT 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 -#define EGL_SYNC_TYPE 0x30F7 -#define EGL_SYNC_STATUS 0x30F1 -#define EGL_SYNC_CONDITION 0x30F8 -#define EGL_SIGNALED 0x30F2 -#define EGL_UNSIGNALED 0x30F3 -#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 -#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull -#define EGL_TIMEOUT_EXPIRED 0x30F5 -#define EGL_CONDITION_SATISFIED 0x30F6 -#define EGL_NO_SYNC ((EGLSync)0) -#define EGL_SYNC_FENCE 0x30F9 -#define EGL_GL_COLORSPACE 0x309D -#define EGL_GL_COLORSPACE_SRGB 0x3089 -#define EGL_GL_COLORSPACE_LINEAR 0x308A -#define EGL_GL_RENDERBUFFER 0x30B9 -#define EGL_GL_TEXTURE_2D 0x30B1 -#define EGL_GL_TEXTURE_LEVEL 0x30BC -#define EGL_GL_TEXTURE_3D 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET 0x30BD -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 -#define EGL_IMAGE_PRESERVED 0x30D2 -#define EGL_NO_IMAGE ((EGLImage)0) -EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); -EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); -#endif /* EGL_VERSION_1_5 */ - -#ifdef __cplusplus -} -#endif - -#endif /* __egl_h_ */ - - - -#ifndef __eglext_h_ -#define __eglext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2015 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ -*/ - -/*#include <EGL/eglplatform.h>*/ - -#define EGL_EGLEXT_VERSION 20150623 - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: _nomatch_^ - * Default extensions included: egl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_KHR_cl_event -#define EGL_KHR_cl_event 1 -#define EGL_CL_EVENT_HANDLE_KHR 0x309C -#define EGL_SYNC_CL_EVENT_KHR 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF -#endif /* EGL_KHR_cl_event */ - -#ifndef EGL_KHR_cl_event2 -#define EGL_KHR_cl_event2 1 -typedef void *EGLSyncKHR; -typedef intptr_t EGLAttribKHR; -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#endif -#endif /* EGL_KHR_cl_event2 */ - -#ifndef EGL_KHR_client_get_all_proc_addresses -#define EGL_KHR_client_get_all_proc_addresses 1 -#endif /* EGL_KHR_client_get_all_proc_addresses */ - -#ifndef EGL_KHR_config_attribs -#define EGL_KHR_config_attribs 1 -#define EGL_CONFORMANT_KHR 0x3042 -#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 -#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 -#endif /* EGL_KHR_config_attribs */ - -#ifndef EGL_KHR_create_context -#define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 -#endif /* EGL_KHR_create_context */ - -#ifndef EGL_KHR_create_context_no_error -#define EGL_KHR_create_context_no_error 1 -#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 -#endif /* EGL_KHR_create_context_no_error */ - -#ifndef EGL_KHR_fence_sync -#define EGL_KHR_fence_sync 1 -typedef khronos_utime_nanoseconds_t EGLTimeKHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 -#define EGL_SYNC_CONDITION_KHR 0x30F8 -#define EGL_SYNC_FENCE_KHR 0x30F9 -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_fence_sync */ - -#ifndef EGL_KHR_get_all_proc_addresses -#define EGL_KHR_get_all_proc_addresses 1 -#endif /* EGL_KHR_get_all_proc_addresses */ - -#ifndef EGL_KHR_gl_colorspace -#define EGL_KHR_gl_colorspace 1 -#define EGL_GL_COLORSPACE_KHR 0x309D -#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 -#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A -#endif /* EGL_KHR_gl_colorspace */ - -#ifndef EGL_KHR_gl_renderbuffer_image -#define EGL_KHR_gl_renderbuffer_image 1 -#define EGL_GL_RENDERBUFFER_KHR 0x30B9 -#endif /* EGL_KHR_gl_renderbuffer_image */ - -#ifndef EGL_KHR_gl_texture_2D_image -#define EGL_KHR_gl_texture_2D_image 1 -#define EGL_GL_TEXTURE_2D_KHR 0x30B1 -#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC -#endif /* EGL_KHR_gl_texture_2D_image */ - -#ifndef EGL_KHR_gl_texture_3D_image -#define EGL_KHR_gl_texture_3D_image 1 -#define EGL_GL_TEXTURE_3D_KHR 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD -#endif /* EGL_KHR_gl_texture_3D_image */ - -#ifndef EGL_KHR_gl_texture_cubemap_image -#define EGL_KHR_gl_texture_cubemap_image 1 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 -#endif /* EGL_KHR_gl_texture_cubemap_image */ - -#ifndef EGL_KHR_image -#define EGL_KHR_image 1 -typedef void *EGLImageKHR; -#define EGL_NATIVE_PIXMAP_KHR 0x30B0 -#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); -#endif -#endif /* EGL_KHR_image */ - -#ifndef EGL_KHR_image_base -#define EGL_KHR_image_base 1 -#define EGL_IMAGE_PRESERVED_KHR 0x30D2 -#endif /* EGL_KHR_image_base */ - -#ifndef EGL_KHR_image_pixmap -#define EGL_KHR_image_pixmap 1 -#endif /* EGL_KHR_image_pixmap */ - -#ifndef EGL_KHR_lock_surface -#define EGL_KHR_lock_surface 1 -#define EGL_READ_SURFACE_BIT_KHR 0x0001 -#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 -#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 -#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 -#define EGL_MATCH_FORMAT_KHR 0x3043 -#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 -#define EGL_FORMAT_RGB_565_KHR 0x30C1 -#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 -#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 -#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 -#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 -#define EGL_BITMAP_POINTER_KHR 0x30C6 -#define EGL_BITMAP_PITCH_KHR 0x30C7 -#define EGL_BITMAP_ORIGIN_KHR 0x30C8 -#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 -#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA -#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB -#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC -#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD -#define EGL_LOWER_LEFT_KHR 0x30CE -#define EGL_UPPER_LEFT_KHR 0x30CF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); -#endif -#endif /* EGL_KHR_lock_surface */ - -#ifndef EGL_KHR_lock_surface2 -#define EGL_KHR_lock_surface2 1 -#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 -#endif /* EGL_KHR_lock_surface2 */ - -#ifndef EGL_KHR_lock_surface3 -#define EGL_KHR_lock_surface3 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#endif -#endif /* EGL_KHR_lock_surface3 */ - -#ifndef EGL_KHR_partial_update -#define EGL_KHR_partial_update 1 -#define EGL_BUFFER_AGE_KHR 0x313D -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_partial_update */ - -#ifndef EGL_KHR_platform_android -#define EGL_KHR_platform_android 1 -#define EGL_PLATFORM_ANDROID_KHR 0x3141 -#endif /* EGL_KHR_platform_android */ - -#ifndef EGL_KHR_platform_gbm -#define EGL_KHR_platform_gbm 1 -#define EGL_PLATFORM_GBM_KHR 0x31D7 -#endif /* EGL_KHR_platform_gbm */ - -#ifndef EGL_KHR_platform_wayland -#define EGL_KHR_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 -#endif /* EGL_KHR_platform_wayland */ - -#ifndef EGL_KHR_platform_x11 -#define EGL_KHR_platform_x11 1 -#define EGL_PLATFORM_X11_KHR 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 -#endif /* EGL_KHR_platform_x11 */ - -#ifndef EGL_KHR_reusable_sync -#define EGL_KHR_reusable_sync 1 -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_STATUS_KHR 0x30F1 -#define EGL_SIGNALED_KHR 0x30F2 -#define EGL_UNSIGNALED_KHR 0x30F3 -#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 -#define EGL_CONDITION_SATISFIED_KHR 0x30F6 -#define EGL_SYNC_TYPE_KHR 0x30F7 -#define EGL_SYNC_REUSABLE_KHR 0x30FA -#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 -#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull -#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_reusable_sync */ - -#ifndef EGL_KHR_stream -#define EGL_KHR_stream 1 -typedef void *EGLStreamKHR; -typedef khronos_uint64_t EGLuint64KHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) -#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 -#define EGL_PRODUCER_FRAME_KHR 0x3212 -#define EGL_CONSUMER_FRAME_KHR 0x3213 -#define EGL_STREAM_STATE_KHR 0x3214 -#define EGL_STREAM_STATE_CREATED_KHR 0x3215 -#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 -#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 -#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 -#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 -#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A -#define EGL_BAD_STREAM_KHR 0x321B -#define EGL_BAD_STATE_KHR 0x321C -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_stream */ - -#ifndef EGL_KHR_stream_consumer_gltexture -#define EGL_KHR_stream_consumer_gltexture 1 -#ifdef EGL_KHR_stream -#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_consumer_gltexture */ - -#ifndef EGL_KHR_stream_cross_process_fd -#define EGL_KHR_stream_cross_process_fd 1 -typedef int EGLNativeFileDescriptorKHR; -#ifdef EGL_KHR_stream -#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) -typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_cross_process_fd */ - -#ifndef EGL_KHR_stream_fifo -#define EGL_KHR_stream_fifo 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC -#define EGL_STREAM_TIME_NOW_KHR 0x31FD -#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE -#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_fifo */ - -#ifndef EGL_KHR_stream_producer_aldatalocator -#define EGL_KHR_stream_producer_aldatalocator 1 -#ifdef EGL_KHR_stream -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_aldatalocator */ - -#ifndef EGL_KHR_stream_producer_eglsurface -#define EGL_KHR_stream_producer_eglsurface 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_BIT_KHR 0x0800 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_eglsurface */ - -#ifndef EGL_KHR_surfaceless_context -#define EGL_KHR_surfaceless_context 1 -#endif /* EGL_KHR_surfaceless_context */ - -#ifndef EGL_KHR_swap_buffers_with_damage -#define EGL_KHR_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_swap_buffers_with_damage */ - -#ifndef EGL_KHR_vg_parent_image -#define EGL_KHR_vg_parent_image 1 -#define EGL_VG_PARENT_IMAGE_KHR 0x30BA -#endif /* EGL_KHR_vg_parent_image */ - -#ifndef EGL_KHR_wait_sync -#define EGL_KHR_wait_sync 1 -typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif -#endif /* EGL_KHR_wait_sync */ - -#ifndef EGL_ANDROID_blob_cache -#define EGL_ANDROID_blob_cache 1 -typedef khronos_ssize_t EGLsizeiANDROID; -typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); -typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); -typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#endif -#endif /* EGL_ANDROID_blob_cache */ - -#ifndef EGL_ANDROID_framebuffer_target -#define EGL_ANDROID_framebuffer_target 1 -#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 -#endif /* EGL_ANDROID_framebuffer_target */ - -#ifndef EGL_ANDROID_image_native_buffer -#define EGL_ANDROID_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_ANDROID 0x3140 -#endif /* EGL_ANDROID_image_native_buffer */ - -#ifndef EGL_ANDROID_native_fence_sync -#define EGL_ANDROID_native_fence_sync 1 -#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 -#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 -#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 -#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 -typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); -#endif -#endif /* EGL_ANDROID_native_fence_sync */ - -#ifndef EGL_ANDROID_recordable -#define EGL_ANDROID_recordable 1 -#define EGL_RECORDABLE_ANDROID 0x3142 -#endif /* EGL_ANDROID_recordable */ - -#ifndef EGL_ANGLE_d3d_share_handle_client_buffer -#define EGL_ANGLE_d3d_share_handle_client_buffer 1 -#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 -#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ - -#ifndef EGL_ANGLE_device_d3d -#define EGL_ANGLE_device_d3d 1 -#define EGL_D3D9_DEVICE_ANGLE 0x33A0 -#define EGL_D3D11_DEVICE_ANGLE 0x33A1 -#endif /* EGL_ANGLE_device_d3d */ - -#ifndef EGL_ANGLE_query_surface_pointer -#define EGL_ANGLE_query_surface_pointer 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#endif -#endif /* EGL_ANGLE_query_surface_pointer */ - -#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle -#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 -#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ - -#ifndef EGL_ANGLE_window_fixed_size -#define EGL_ANGLE_window_fixed_size 1 -#define EGL_FIXED_SIZE_ANGLE 0x3201 -#endif /* EGL_ANGLE_window_fixed_size */ - -#ifndef EGL_ARM_pixmap_multisample_discard -#define EGL_ARM_pixmap_multisample_discard 1 -#define EGL_DISCARD_SAMPLES_ARM 0x3286 -#endif /* EGL_ARM_pixmap_multisample_discard */ - -#ifndef EGL_EXT_buffer_age -#define EGL_EXT_buffer_age 1 -#define EGL_BUFFER_AGE_EXT 0x313D -#endif /* EGL_EXT_buffer_age */ - -#ifndef EGL_EXT_client_extensions -#define EGL_EXT_client_extensions 1 -#endif /* EGL_EXT_client_extensions */ - -#ifndef EGL_EXT_create_context_robustness -#define EGL_EXT_create_context_robustness 1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 -#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF -#endif /* EGL_EXT_create_context_robustness */ - -#ifndef EGL_EXT_device_base -#define EGL_EXT_device_base 1 -typedef void *EGLDeviceEXT; -#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) -#define EGL_BAD_DEVICE_EXT 0x322B -#define EGL_DEVICE_EXT 0x322C -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#endif -#endif /* EGL_EXT_device_base */ - -#ifndef EGL_EXT_device_drm -#define EGL_EXT_device_drm 1 -#define EGL_DRM_DEVICE_FILE_EXT 0x3233 -#endif /* EGL_EXT_device_drm */ - -#ifndef EGL_EXT_device_enumeration -#define EGL_EXT_device_enumeration 1 -#endif /* EGL_EXT_device_enumeration */ - -#ifndef EGL_EXT_device_openwf -#define EGL_EXT_device_openwf 1 -#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 -#endif /* EGL_EXT_device_openwf */ - -#ifndef EGL_EXT_device_query -#define EGL_EXT_device_query 1 -#endif /* EGL_EXT_device_query */ - -#ifndef EGL_EXT_image_dma_buf_import -#define EGL_EXT_image_dma_buf_import 1 -#define EGL_LINUX_DMA_BUF_EXT 0x3270 -#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 -#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 -#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 -#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 -#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 -#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 -#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 -#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 -#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 -#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A -#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B -#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C -#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D -#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E -#define EGL_ITU_REC601_EXT 0x327F -#define EGL_ITU_REC709_EXT 0x3280 -#define EGL_ITU_REC2020_EXT 0x3281 -#define EGL_YUV_FULL_RANGE_EXT 0x3282 -#define EGL_YUV_NARROW_RANGE_EXT 0x3283 -#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 -#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 -#endif /* EGL_EXT_image_dma_buf_import */ - -#ifndef EGL_EXT_multiview_window -#define EGL_EXT_multiview_window 1 -#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 -#endif /* EGL_EXT_multiview_window */ - -#ifndef EGL_EXT_output_base -#define EGL_EXT_output_base 1 -typedef void *EGLOutputLayerEXT; -typedef void *EGLOutputPortEXT; -#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) -#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) -#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D -#define EGL_BAD_OUTPUT_PORT_EXT 0x322E -#define EGL_SWAP_INTERVAL_EXT 0x322F -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#endif -#endif /* EGL_EXT_output_base */ - -#ifndef EGL_EXT_output_drm -#define EGL_EXT_output_drm 1 -#define EGL_DRM_CRTC_EXT 0x3234 -#define EGL_DRM_PLANE_EXT 0x3235 -#define EGL_DRM_CONNECTOR_EXT 0x3236 -#endif /* EGL_EXT_output_drm */ - -#ifndef EGL_EXT_output_openwf -#define EGL_EXT_output_openwf 1 -#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 -#define EGL_OPENWF_PORT_ID_EXT 0x3239 -#endif /* EGL_EXT_output_openwf */ - -#ifndef EGL_EXT_platform_base -#define EGL_EXT_platform_base 1 -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#endif -#endif /* EGL_EXT_platform_base */ - -#ifndef EGL_EXT_platform_device -#define EGL_EXT_platform_device 1 -#define EGL_PLATFORM_DEVICE_EXT 0x313F -#endif /* EGL_EXT_platform_device */ - -#ifndef EGL_EXT_platform_wayland -#define EGL_EXT_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 -#endif /* EGL_EXT_platform_wayland */ - -#ifndef EGL_EXT_platform_x11 -#define EGL_EXT_platform_x11 1 -#define EGL_PLATFORM_X11_EXT 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 -#endif /* EGL_EXT_platform_x11 */ - -#ifndef EGL_EXT_protected_surface -#define EGL_EXT_protected_surface 1 -#define EGL_PROTECTED_CONTENT_EXT 0x32C0 -#endif /* EGL_EXT_protected_surface */ - -#ifndef EGL_EXT_stream_consumer_egloutput -#define EGL_EXT_stream_consumer_egloutput 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#endif -#endif /* EGL_EXT_stream_consumer_egloutput */ - -#ifndef EGL_EXT_swap_buffers_with_damage -#define EGL_EXT_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_EXT_swap_buffers_with_damage */ - -#ifndef EGL_EXT_yuv_surface -#define EGL_EXT_yuv_surface 1 -#define EGL_YUV_ORDER_EXT 0x3301 -#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 -#define EGL_YUV_SUBSAMPLE_EXT 0x3312 -#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 -#define EGL_YUV_CSC_STANDARD_EXT 0x330A -#define EGL_YUV_PLANE_BPP_EXT 0x331A -#define EGL_YUV_BUFFER_EXT 0x3300 -#define EGL_YUV_ORDER_YUV_EXT 0x3302 -#define EGL_YUV_ORDER_YVU_EXT 0x3303 -#define EGL_YUV_ORDER_YUYV_EXT 0x3304 -#define EGL_YUV_ORDER_UYVY_EXT 0x3305 -#define EGL_YUV_ORDER_YVYU_EXT 0x3306 -#define EGL_YUV_ORDER_VYUY_EXT 0x3307 -#define EGL_YUV_ORDER_AYUV_EXT 0x3308 -#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 -#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 -#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 -#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 -#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 -#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B -#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C -#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D -#define EGL_YUV_PLANE_BPP_0_EXT 0x331B -#define EGL_YUV_PLANE_BPP_8_EXT 0x331C -#define EGL_YUV_PLANE_BPP_10_EXT 0x331D -#endif /* EGL_EXT_yuv_surface */ - -#ifndef EGL_HI_clientpixmap -#define EGL_HI_clientpixmap 1 -struct EGLClientPixmapHI { - void *pData; - EGLint iWidth; - EGLint iHeight; - EGLint iStride; -}; -#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#endif -#endif /* EGL_HI_clientpixmap */ - -#ifndef EGL_HI_colorformats -#define EGL_HI_colorformats 1 -#define EGL_COLOR_FORMAT_HI 0x8F70 -#define EGL_COLOR_RGB_HI 0x8F71 -#define EGL_COLOR_RGBA_HI 0x8F72 -#define EGL_COLOR_ARGB_HI 0x8F73 -#endif /* EGL_HI_colorformats */ - -#ifndef EGL_IMG_context_priority -#define EGL_IMG_context_priority 1 -#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 -#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 -#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 -#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 -#endif /* EGL_IMG_context_priority */ - -#ifndef EGL_MESA_drm_image -#define EGL_MESA_drm_image 1 -#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 -#define EGL_DRM_BUFFER_USE_MESA 0x31D1 -#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 -#define EGL_DRM_BUFFER_MESA 0x31D3 -#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 -#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 -#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#endif -#endif /* EGL_MESA_drm_image */ - -#ifndef EGL_MESA_image_dma_buf_export -#define EGL_MESA_image_dma_buf_export 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#endif -#endif /* EGL_MESA_image_dma_buf_export */ - -#ifndef EGL_MESA_platform_gbm -#define EGL_MESA_platform_gbm 1 -#define EGL_PLATFORM_GBM_MESA 0x31D7 -#endif /* EGL_MESA_platform_gbm */ - -#ifndef EGL_NOK_swap_region -#define EGL_NOK_swap_region 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region */ - -#ifndef EGL_NOK_swap_region2 -#define EGL_NOK_swap_region2 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region2 */ - -#ifndef EGL_NOK_texture_from_pixmap -#define EGL_NOK_texture_from_pixmap 1 -#define EGL_Y_INVERTED_NOK 0x307F -#endif /* EGL_NOK_texture_from_pixmap */ - -#ifndef EGL_NV_3dvision_surface -#define EGL_NV_3dvision_surface 1 -#define EGL_AUTO_STEREO_NV 0x3136 -#endif /* EGL_NV_3dvision_surface */ - -#ifndef EGL_NV_coverage_sample -#define EGL_NV_coverage_sample 1 -#define EGL_COVERAGE_BUFFERS_NV 0x30E0 -#define EGL_COVERAGE_SAMPLES_NV 0x30E1 -#endif /* EGL_NV_coverage_sample */ - -#ifndef EGL_NV_coverage_sample_resolve -#define EGL_NV_coverage_sample_resolve 1 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 -#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 -#endif /* EGL_NV_coverage_sample_resolve */ - -#ifndef EGL_NV_cuda_event -#define EGL_NV_cuda_event 1 -#define EGL_CUDA_EVENT_HANDLE_NV 0x323B -#define EGL_SYNC_CUDA_EVENT_NV 0x323C -#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D -#endif /* EGL_NV_cuda_event */ - -#ifndef EGL_NV_depth_nonlinear -#define EGL_NV_depth_nonlinear 1 -#define EGL_DEPTH_ENCODING_NV 0x30E2 -#define EGL_DEPTH_ENCODING_NONE_NV 0 -#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 -#endif /* EGL_NV_depth_nonlinear */ - -#ifndef EGL_NV_device_cuda -#define EGL_NV_device_cuda 1 -#define EGL_CUDA_DEVICE_NV 0x323A -#endif /* EGL_NV_device_cuda */ - -#ifndef EGL_NV_native_query -#define EGL_NV_native_query 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#endif -#endif /* EGL_NV_native_query */ - -#ifndef EGL_NV_post_convert_rounding -#define EGL_NV_post_convert_rounding 1 -#endif /* EGL_NV_post_convert_rounding */ - -#ifndef EGL_NV_post_sub_buffer -#define EGL_NV_post_sub_buffer 1 -#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE -typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#endif -#endif /* EGL_NV_post_sub_buffer */ - -#ifndef EGL_NV_stream_sync -#define EGL_NV_stream_sync 1 -#define EGL_SYNC_NEW_FRAME_NV 0x321F -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#endif -#endif /* EGL_NV_stream_sync */ - -#ifndef EGL_NV_sync -#define EGL_NV_sync 1 -typedef void *EGLSyncNV; -typedef khronos_utime_nanoseconds_t EGLTimeNV; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 -#define EGL_SYNC_STATUS_NV 0x30E7 -#define EGL_SIGNALED_NV 0x30E8 -#define EGL_UNSIGNALED_NV 0x30E9 -#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 -#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull -#define EGL_ALREADY_SIGNALED_NV 0x30EA -#define EGL_TIMEOUT_EXPIRED_NV 0x30EB -#define EGL_CONDITION_SATISFIED_NV 0x30EC -#define EGL_SYNC_TYPE_NV 0x30ED -#define EGL_SYNC_CONDITION_NV 0x30EE -#define EGL_SYNC_FENCE_NV 0x30EF -#define EGL_NO_SYNC_NV ((EGLSyncNV)0) -typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); -EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_sync */ - -#ifndef EGL_NV_system_time -#define EGL_NV_system_time 1 -typedef khronos_utime_nanoseconds_t EGLuint64NV; -#ifdef KHRONOS_SUPPORT_INT64 -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_system_time */ - -#ifndef EGL_TIZEN_image_native_buffer -#define EGL_TIZEN_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 -#endif /* EGL_TIZEN_image_native_buffer */ - -#ifndef EGL_TIZEN_image_native_surface -#define EGL_TIZEN_image_native_surface 1 -#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 -#endif /* EGL_TIZEN_image_native_surface */ - -#ifdef __cplusplus -} -#endif - -#endif /* __eglext_h_ */ - - -#endif /* _MSC_VER */ diff --git a/Windows/SDL2/include/SDL_endian.h b/Windows/SDL2/include/SDL_endian.h deleted file mode 100644 index 1e6daae1..00000000 --- a/Windows/SDL2/include/SDL_endian.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_endian.h - * - * Functions for reading and writing endian-specific values - */ - -#ifndef SDL_endian_h_ -#define SDL_endian_h_ - -#include "SDL_stdinc.h" - -/** - * \name The two types of endianness - */ -/* @{ */ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 -/* @} */ - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#ifdef __linux__ -#include <endian.h> -#define SDL_BYTEORDER __BYTE_ORDER -#elif defined(__OpenBSD__) -#include <endian.h> -#define SDL_BYTEORDER BYTE_ORDER -#else -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MIPSEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* __linux__ */ -#endif /* !SDL_BYTEORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_endian.h - */ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - int result; - - __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); - return (Uint16)result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint16 SDL_Swap16(Uint16); -#pragma aux SDL_Swap16 = \ - "xchg al, ah" \ - parm [ax] \ - modify [ax]; -#else -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); - __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); - __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); - return result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint32 SDL_Swap32(Uint32); -#ifndef __SW_3 /* 486+ */ -#pragma aux SDL_Swap32 = \ - "bswap eax" \ - parm [eax] \ - modify [eax]; -#else /* 386-only */ -#pragma aux SDL_Swap32 = \ - "xchg al, ah" \ - "ror eax, 16" \ - "xchg al, ah" \ - parm [eax] \ - modify [eax]; -#endif -#else -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | - ((x >> 8) & 0x0000FF00) | (x >> 24))); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - union - { - struct - { - Uint32 a, b; - } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), - "1"(v.s. - b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0": "=r"(x):"0"(x)); - return x; -} -#else -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif - - -SDL_FORCE_INLINE float -SDL_SwapFloat(float x) -{ - union - { - float f; - Uint32 ui32; - } swapper; - swapper.f = x; - swapper.ui32 = SDL_Swap32(swapper.ui32); - return swapper.f; -} - - -/** - * \name Swap to native - * Byteswap item from the specified endianness to the native endianness. - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapFloatLE(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#define SDL_SwapFloatBE(X) (X) -#endif -/* @} *//* Swap to native */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_endian_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_error.h b/Windows/SDL2/include/SDL_error.h deleted file mode 100644 index 24416e69..00000000 --- a/Windows/SDL2/include/SDL_error.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_error.h - * - * Simple error message routines for SDL. - */ - -#ifndef SDL_error_h_ -#define SDL_error_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Public functions */ -/* SDL_SetError() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); -extern DECLSPEC const char *SDLCALL SDL_GetError(void); -extern DECLSPEC void SDLCALL SDL_ClearError(void); - -/** - * \name Internal error functions - * - * \internal - * Private error reporting function - used internally. - */ -/* @{ */ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) -typedef enum -{ - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -/* SDL_Error() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); -/* @} *//* Internal error functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_error_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_events.h b/Windows/SDL2/include/SDL_events.h deleted file mode 100644 index eaf57434..00000000 --- a/Windows/SDL2/include/SDL_events.h +++ /dev/null @@ -1,792 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_events.h - * - * Include file for SDL event handling. - */ - -#ifndef SDL_events_h_ -#define SDL_events_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_gamecontroller.h" -#include "SDL_quit.h" -#include "SDL_gesture.h" -#include "SDL_touch.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* General keyboard/mouse state definitions */ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 - -/** - * \brief The types of events that can be delivered. - */ -typedef enum -{ - SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ - - /* Application events */ - SDL_QUIT = 0x100, /**< User-requested quit */ - - /* These application events have special meaning on iOS, see README-ios.md for details */ - SDL_APP_TERMINATING, /**< The application is being terminated by the OS - Called on iOS in applicationWillTerminate() - Called on Android in onDestroy() - */ - SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. - Called on iOS in applicationDidReceiveMemoryWarning() - Called on Android in onLowMemory() - */ - SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background - Called on iOS in applicationWillResignActive() - Called on Android in onPause() - */ - SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time - Called on iOS in applicationDidEnterBackground() - Called on Android in onPause() - */ - SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground - Called on iOS in applicationWillEnterForeground() - Called on Android in onResume() - */ - SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive - Called on iOS in applicationDidBecomeActive() - Called on Android in onResume() - */ - - /* Display events */ - SDL_DISPLAYEVENT = 0x150, /**< Display state change */ - - /* Window events */ - SDL_WINDOWEVENT = 0x200, /**< Window state change */ - SDL_SYSWMEVENT, /**< System specific event */ - - /* Keyboard events */ - SDL_KEYDOWN = 0x300, /**< Key pressed */ - SDL_KEYUP, /**< Key released */ - SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ - SDL_TEXTINPUT, /**< Keyboard text input */ - SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an - input language or keyboard layout change. - */ - - /* Mouse events */ - SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_MOUSEWHEEL, /**< Mouse wheel motion */ - - /* Joystick events */ - SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ - SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ - - /* Game controller events */ - SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ - SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ - SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ - SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ - SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ - SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ - - /* Touch events */ - SDL_FINGERDOWN = 0x700, - SDL_FINGERUP, - SDL_FINGERMOTION, - - /* Gesture events */ - SDL_DOLLARGESTURE = 0x800, - SDL_DOLLARRECORD, - SDL_MULTIGESTURE, - - /* Clipboard events */ - SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ - - /* Drag and drop events */ - SDL_DROPFILE = 0x1000, /**< The system requests a file open */ - SDL_DROPTEXT, /**< text/plain drag-and-drop event */ - SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */ - SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ - - /* Audio hotplug events */ - SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ - SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ - - /* Sensor events */ - SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */ - - /* Render events */ - SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ - SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ - - /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, - * and should be allocated with SDL_RegisterEvents() - */ - SDL_USEREVENT = 0x8000, - - /** - * This last event is only for bounding internal arrays - */ - SDL_LASTEVENT = 0xFFFF -} SDL_EventType; - -/** - * \brief Fields shared by every event - */ -typedef struct SDL_CommonEvent -{ - Uint32 type; - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_CommonEvent; - -/** - * \brief Display state change event data (event.display.*) - */ -typedef struct SDL_DisplayEvent -{ - Uint32 type; /**< ::SDL_DISPLAYEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 display; /**< The associated display index */ - Uint8 event; /**< ::SDL_DisplayEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ -} SDL_DisplayEvent; - -/** - * \brief Window state change event data (event.window.*) - */ -typedef struct SDL_WindowEvent -{ - Uint32 type; /**< ::SDL_WINDOWEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The associated window */ - Uint8 event; /**< ::SDL_WindowEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ - Sint32 data2; /**< event dependent data */ -} SDL_WindowEvent; - -/** - * \brief Keyboard button event structure (event.key.*) - */ -typedef struct SDL_KeyboardEvent -{ - Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 repeat; /**< Non-zero if this is a key repeat */ - Uint8 padding2; - Uint8 padding3; - SDL_Keysym keysym; /**< The key that was pressed or released */ -} SDL_KeyboardEvent; - -#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text editing event structure (event.edit.*) - */ -typedef struct SDL_TextEditingEvent -{ - Uint32 type; /**< ::SDL_TEXTEDITING */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ - Sint32 start; /**< The start cursor of selected editing text */ - Sint32 length; /**< The length of selected editing text */ -} SDL_TextEditingEvent; - - -#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text input event structure (event.text.*) - */ -typedef struct SDL_TextInputEvent -{ - Uint32 type; /**< ::SDL_TEXTINPUT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ -} SDL_TextInputEvent; - -/** - * \brief Mouse motion event structure (event.motion.*) - */ -typedef struct SDL_MouseMotionEvent -{ - Uint32 type; /**< ::SDL_MOUSEMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint32 state; /**< The current button state */ - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ - Sint32 xrel; /**< The relative motion in the X direction */ - Sint32 yrel; /**< The relative motion in the Y direction */ -} SDL_MouseMotionEvent; - -/** - * \brief Mouse button event structure (event.button.*) - */ -typedef struct SDL_MouseButtonEvent -{ - Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ - Uint8 padding1; - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ -} SDL_MouseButtonEvent; - -/** - * \brief Mouse wheel event structure (event.wheel.*) - */ -typedef struct SDL_MouseWheelEvent -{ - Uint32 type; /**< ::SDL_MOUSEWHEEL */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ - Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ - Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ -} SDL_MouseWheelEvent; - -/** - * \brief Joystick axis motion event structure (event.jaxis.*) - */ -typedef struct SDL_JoyAxisEvent -{ - Uint32 type; /**< ::SDL_JOYAXISMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The joystick axis index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_JoyAxisEvent; - -/** - * \brief Joystick trackball motion event structure (event.jball.*) - */ -typedef struct SDL_JoyBallEvent -{ - Uint32 type; /**< ::SDL_JOYBALLMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 ball; /**< The joystick trackball index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** - * \brief Joystick hat position change event structure (event.jhat.*) - */ -typedef struct SDL_JoyHatEvent -{ - Uint32 type; /**< ::SDL_JOYHATMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value. - * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP - * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT - * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN - * - * Note that zero means the POV is centered. - */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyHatEvent; - -/** - * \brief Joystick button event structure (event.jbutton.*) - */ -typedef struct SDL_JoyButtonEvent -{ - Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyButtonEvent; - -/** - * \brief Joystick device event structure (event.jdevice.*) - */ -typedef struct SDL_JoyDeviceEvent -{ - Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ -} SDL_JoyDeviceEvent; - - -/** - * \brief Game controller axis motion event structure (event.caxis.*) - */ -typedef struct SDL_ControllerAxisEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_ControllerAxisEvent; - - -/** - * \brief Game controller button event structure (event.cbutton.*) - */ -typedef struct SDL_ControllerButtonEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The controller button (SDL_GameControllerButton) */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_ControllerButtonEvent; - - -/** - * \brief Controller device event structure (event.cdevice.*) - */ -typedef struct SDL_ControllerDeviceEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ -} SDL_ControllerDeviceEvent; - -/** - * \brief Audio device event structure (event.adevice.*) - */ -typedef struct SDL_AudioDeviceEvent -{ - Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ - Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; -} SDL_AudioDeviceEvent; - - -/** - * \brief Touch finger event structure (event.tfinger.*) - */ -typedef struct SDL_TouchFingerEvent -{ - Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - SDL_FingerID fingerId; - float x; /**< Normalized in the range 0...1 */ - float y; /**< Normalized in the range 0...1 */ - float dx; /**< Normalized in the range -1...1 */ - float dy; /**< Normalized in the range -1...1 */ - float pressure; /**< Normalized in the range 0...1 */ - Uint32 windowID; /**< The window underneath the finger, if any */ -} SDL_TouchFingerEvent; - - -/** - * \brief Multiple Finger Gesture Event (event.mgesture.*) - */ -typedef struct SDL_MultiGestureEvent -{ - Uint32 type; /**< ::SDL_MULTIGESTURE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - float dTheta; - float dDist; - float x; - float y; - Uint16 numFingers; - Uint16 padding; -} SDL_MultiGestureEvent; - - -/** - * \brief Dollar Gesture Event (event.dgesture.*) - */ -typedef struct SDL_DollarGestureEvent -{ - Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - SDL_GestureID gestureId; - Uint32 numFingers; - float error; - float x; /**< Normalized center of gesture */ - float y; /**< Normalized center of gesture */ -} SDL_DollarGestureEvent; - - -/** - * \brief An event used to request a file open by the system (event.drop.*) - * This event is enabled by default, you can disable it with SDL_EventState(). - * \note If this event is enabled, you must free the filename in the event. - */ -typedef struct SDL_DropEvent -{ - Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ - Uint32 windowID; /**< The window that was dropped on, if any */ -} SDL_DropEvent; - - -/** - * \brief Sensor event structure (event.sensor.*) - */ -typedef struct SDL_SensorEvent -{ - Uint32 type; /**< ::SDL_SENSORUPDATE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The instance ID of the sensor */ - float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ -} SDL_SensorEvent; - -/** - * \brief The "quit requested" event - */ -typedef struct SDL_QuitEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_QuitEvent; - -/** - * \brief OS Specific event - */ -typedef struct SDL_OSEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_OSEvent; - -/** - * \brief A user-defined event type (event.user.*) - */ -typedef struct SDL_UserEvent -{ - Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The associated window if any */ - Sint32 code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ -} SDL_UserEvent; - - -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; - -/** - * \brief A video driver dependent system event (event.syswm.*) - * This event is disabled by default, you can enable it with SDL_EventState() - * - * \note If you want to use this event, you should include SDL_syswm.h. - */ -typedef struct SDL_SysWMEvent -{ - Uint32 type; /**< ::SDL_SYSWMEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ -} SDL_SysWMEvent; - -/** - * \brief General event structure - */ -typedef union SDL_Event -{ - Uint32 type; /**< Event type, shared with all events */ - SDL_CommonEvent common; /**< Common event data */ - SDL_DisplayEvent display; /**< Display event data */ - SDL_WindowEvent window; /**< Window event data */ - SDL_KeyboardEvent key; /**< Keyboard event data */ - SDL_TextEditingEvent edit; /**< Text editing event data */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ - SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ - SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ - SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ - SDL_AudioDeviceEvent adevice; /**< Audio device event data */ - SDL_SensorEvent sensor; /**< Sensor event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_MultiGestureEvent mgesture; /**< Gesture event data */ - SDL_DollarGestureEvent dgesture; /**< Gesture event data */ - SDL_DropEvent drop; /**< Drag and drop event data */ - - /* This is necessary for ABI compatibility between Visual C++ and GCC - Visual C++ will respect the push pack pragma and use 52 bytes for - this structure, and GCC will use the alignment of the largest datatype - within the union, which is 8 bytes. - - So... we'll add padding to force the size to be 56 bytes for both. - */ - Uint8 padding[56]; -} SDL_Event; - -/* Make sure we haven't broken binary compatibility */ -SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56); - - -/* Function prototypes */ - -/** - * Pumps the event loop, gathering events from the input devices. - * - * This function updates the event queue and internal input device state. - * - * This should only be run in the thread that sets the video mode. - */ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -/* @{ */ -typedef enum -{ - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; - -/** - * Checks the event queue for messages and optionally returns them. - * - * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to - * the back of the event queue. - * - * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front - * of the event queue, within the specified minimum and maximum type, - * will be returned and will not be removed from the queue. - * - * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front - * of the event queue, within the specified minimum and maximum type, - * will be returned and will be removed from the queue. - * - * \return The number of events actually stored, or -1 if there was an error. - * - * This function is thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, - SDL_eventaction action, - Uint32 minType, Uint32 maxType); -/* @} */ - -/** - * Checks to see if certain event types are in the event queue. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); - -/** - * This function clears events from the event queue - * This function only affects currently queued events. If you want to make - * sure that all pending OS events are flushed, you can call SDL_PumpEvents() - * on the main thread immediately before the flush call. - */ -extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); -extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); - -/** - * \brief Polls for currently pending events. - * - * \return 1 if there are any pending events, or 0 if there are none available. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); - -/** - * \brief Waits indefinitely for the next available event. - * - * \return 1, or 0 if there was an error while waiting for events. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); - -/** - * \brief Waits until the specified timeout (in milliseconds) for the next - * available event. - * - * \return 1, or 0 if there was an error while waiting for events. - * - * \param event If not NULL, the next event is removed from the queue and - * stored in that area. - * \param timeout The timeout (in milliseconds) to wait for next event. - */ -extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, - int timeout); - -/** - * \brief Add an event to the event queue. - * - * \return 1 on success, 0 if the event was filtered, or -1 if the event queue - * was full or there was some other error. - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); - -typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); - -/** - * Sets up a filter to process all events before they change internal state and - * are posted to the internal event queue. - * - * The filter is prototyped as: - * \code - * int SDL_EventFilter(void *userdata, SDL_Event * event); - * \endcode - * - * If the filter returns 1, then the event will be added to the internal queue. - * If it returns 0, then the event will be dropped from the queue, but the - * internal state will still be updated. This allows selective filtering of - * dynamically arriving events. - * - * \warning Be very careful of what you do in the event filter function, as - * it may run in a different thread! - * - * There is one caveat when dealing with the ::SDL_QuitEvent event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will - * be closed, otherwise the window will remain open if possible. - * - * If the quit event is generated by an interrupt signal, it will bypass the - * internal queue and be delivered to the application at the next event poll. - */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, - void *userdata); - -/** - * Return the current event filter - can be used to "chain" filters. - * If there is no event filter set, this function returns SDL_FALSE. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, - void **userdata); - -/** - * Add a function which is called when an event is added to the queue. - */ -extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Remove an event watch function added with SDL_AddEventWatch() - */ -extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Run the filter function on the current event queue, removing any - * events for which the filter returns 0. - */ -extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, - void *userdata); - -/* @{ */ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 - -/** - * This function allows you to set the state of processing certain events. - * - If \c state is set to ::SDL_IGNORE, that event will be automatically - * dropped from the event queue and will not be filtered. - * - If \c state is set to ::SDL_ENABLE, that event will be processed - * normally. - * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the - * current processing state of the specified event. - */ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); -/* @} */ -#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) - -/** - * This function allocates a set of user-defined events, and returns - * the beginning event number for that set of events. - * - * If there aren't enough user-defined events left, this function - * returns (Uint32)-1 - */ -extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_events_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_filesystem.h b/Windows/SDL2/include/SDL_filesystem.h deleted file mode 100644 index 6d97e589..00000000 --- a/Windows/SDL2/include/SDL_filesystem.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_filesystem.h - * - * \brief Include file for filesystem SDL API functions - */ - -#ifndef SDL_filesystem_h_ -#define SDL_filesystem_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Get the path where the application resides. - * - * Get the "base path". This is the directory where the application was run - * from, which is probably the installation directory, and may or may not - * be the process's current working directory. - * - * This returns an absolute path in UTF-8 encoding, and is guaranteed to - * end with a path separator ('\\' on Windows, '/' most other places). - * - * The pointer returned by this function is owned by you. Please call - * SDL_free() on the pointer when you are done with it, or it will be a - * memory leak. This is not necessarily a fast call, though, so you should - * call this once near startup and save the string if you need it. - * - * Some platforms can't determine the application's path, and on other - * platforms, this might be meaningless. In such cases, this function will - * return NULL. - * - * \return String of base dir in UTF-8 encoding, or NULL on error. - * - * \sa SDL_GetPrefPath - */ -extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); - -/** - * \brief Get the user-and-app-specific path where files can be written. - * - * Get the "pref dir". This is meant to be where users can write personal - * files (preferences and save games, etc) that are specific to your - * application. This directory is unique per user, per application. - * - * This function will decide the appropriate location in the native filesystem, - * create the directory if necessary, and return a string of the absolute - * path to the directory in UTF-8 encoding. - * - * On Windows, the string might look like: - * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" - * - * On Linux, the string might look like: - * "/home/bob/.local/share/My Program Name/" - * - * On Mac OS X, the string might look like: - * "/Users/bob/Library/Application Support/My Program Name/" - * - * (etc.) - * - * You specify the name of your organization (if it's not a real organization, - * your name or an Internet domain you own might do) and the name of your - * application. These should be untranslated proper names. - * - * Both the org and app strings may become part of a directory name, so - * please follow these rules: - * - * - Try to use the same org string (including case-sensitivity) for - * all your applications that use this function. - * - Always use a unique app string for each one, and make sure it never - * changes for an app once you've decided on it. - * - Unicode characters are legal, as long as it's UTF-8 encoded, but... - * - ...only use letters, numbers, and spaces. Avoid punctuation like - * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. - * - * This returns an absolute path in UTF-8 encoding, and is guaranteed to - * end with a path separator ('\\' on Windows, '/' most other places). - * - * The pointer returned by this function is owned by you. Please call - * SDL_free() on the pointer when you are done with it, or it will be a - * memory leak. This is not necessarily a fast call, though, so you should - * call this once near startup and save the string if you need it. - * - * You should assume the path returned by this function is the only safe - * place to write files (and that SDL_GetBasePath(), while it might be - * writable, or even the parent of the returned path, aren't where you - * should be writing things). - * - * Some platforms can't determine the pref path, and on other - * platforms, this might be meaningless. In such cases, this function will - * return NULL. - * - * \param org The name of your organization. - * \param app The name of your application. - * \return UTF-8 string of user dir in platform-dependent notation. NULL - * if there's a problem (creating directory failed, etc). - * - * \sa SDL_GetBasePath - */ -extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_filesystem_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_gamecontroller.h b/Windows/SDL2/include/SDL_gamecontroller.h deleted file mode 100644 index 5ee8e8e9..00000000 --- a/Windows/SDL2/include/SDL_gamecontroller.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_gamecontroller.h - * - * Include file for SDL game controller event handling - */ - -#ifndef SDL_gamecontroller_h_ -#define SDL_gamecontroller_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_gamecontroller.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system - * for game controllers, and load appropriate drivers. - * - * If you would like to receive controller updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/** - * The gamecontroller structure used to identify an SDL game controller - */ -struct _SDL_GameController; -typedef struct _SDL_GameController SDL_GameController; - -typedef enum -{ - SDL_CONTROLLER_TYPE_UNKNOWN = 0, - SDL_CONTROLLER_TYPE_XBOX360, - SDL_CONTROLLER_TYPE_XBOXONE, - SDL_CONTROLLER_TYPE_PS3, - SDL_CONTROLLER_TYPE_PS4, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO -} SDL_GameControllerType; - -typedef enum -{ - SDL_CONTROLLER_BINDTYPE_NONE = 0, - SDL_CONTROLLER_BINDTYPE_BUTTON, - SDL_CONTROLLER_BINDTYPE_AXIS, - SDL_CONTROLLER_BINDTYPE_HAT -} SDL_GameControllerBindType; - -/** - * Get the SDL joystick layer binding for this controller button/axis mapping - */ -typedef struct SDL_GameControllerButtonBind -{ - SDL_GameControllerBindType bindType; - union - { - int button; - int axis; - struct { - int hat; - int hat_mask; - } hat; - } value; - -} SDL_GameControllerButtonBind; - - -/** - * To count the number of game controllers in the system for the following: - * int nJoysticks = SDL_NumJoysticks(); - * int nGameControllers = 0; - * for (int i = 0; i < nJoysticks; i++) { - * if (SDL_IsGameController(i)) { - * nGameControllers++; - * } - * } - * - * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: - * guid,name,mappings - * - * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. - * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. - * The mapping format for joystick is: - * bX - a joystick button, index X - * hX.Y - hat X with value Y - * aX - axis X of the joystick - * Buttons can be used as a controller axis and vice versa. - * - * This string shows an example of a valid mapping for a controller - * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", - * - */ - -/** - * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform() - * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt - * - * If \c freerw is non-zero, the stream will be closed after being read. - * - * \return number of mappings added, -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw); - -/** - * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() - * - * Convenience macro. - */ -#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Add or update an existing mapping configuration - * - * \return 1 if mapping is added, 0 if updated, -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString); - -/** - * Get the number of mappings installed - * - * \return the number of mappings - */ -extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void); - -/** - * Get the mapping at a particular index. - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range. - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index); - -/** - * Get a mapping string for a GUID - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid); - -/** - * Get a mapping string for an open GameController - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); - -/** - * Is the joystick on this index supported by the game controller interface? - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); - -/** - * Get the implementation dependent name of a game controller. - * This can be called before any controllers are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); - -/** - * Get the type of a game controller. - * This can be called before any controllers are opened. - */ -extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); - -/** - * Get the mapping of a game controller. - * This can be called before any controllers are opened. - * - * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available - */ -extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index); - -/** - * Open a game controller for use. - * The index passed as an argument refers to the N'th game controller on the system. - * This index is not the value which will identify this controller in future - * controller events. The joystick's instance id (::SDL_JoystickID) will be - * used there instead. - * - * \return A controller identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); - -/** - * Return the SDL_GameController associated with an instance id. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); - -/** - * Return the SDL_GameController associated with a player index. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); - -/** - * Return the name for this currently opened controller - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); - -/** - * Return the type of this currently opened controller - */ -extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); - -/** - * Get the player index of an opened game controller, or -1 if it's not available - * - * For XInput controllers this returns the XInput user index. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); - -/** - * Set the player index of an opened game controller - */ -extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); - -/** - * Get the USB vendor ID of an opened controller, if available. - * If the vendor ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); - -/** - * Get the USB product ID of an opened controller, if available. - * If the product ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); - -/** - * Get the product version of an opened controller, if available. - * If the product version isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); - -/** - * Returns SDL_TRUE if the controller has been opened and currently connected, - * or SDL_FALSE if it has not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); - -/** - * Get the underlying joystick object used by a controller - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); - -/** - * Enable/disable controller event polling. - * - * If controller events are disabled, you must call SDL_GameControllerUpdate() - * yourself and check the state of the controller when you want controller - * information. - * - * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); - -/** - * Update the current state of the open game controllers. - * - * This is called automatically by the event loop if any game controller - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); - - -/** - * The list of axes available from a controller - * - * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, - * and are centered within ~8000 of zero, though advanced UI will allow users to set - * or autodetect the dead zone, which varies between controllers. - * - * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. - */ -typedef enum -{ - SDL_CONTROLLER_AXIS_INVALID = -1, - SDL_CONTROLLER_AXIS_LEFTX, - SDL_CONTROLLER_AXIS_LEFTY, - SDL_CONTROLLER_AXIS_RIGHTX, - SDL_CONTROLLER_AXIS_RIGHTY, - SDL_CONTROLLER_AXIS_TRIGGERLEFT, - SDL_CONTROLLER_AXIS_TRIGGERRIGHT, - SDL_CONTROLLER_AXIS_MAX -} SDL_GameControllerAxis; - -/** - * turn this string into a axis mapping - */ -extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); - -/** - * turn this axis enum into a string mapping - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); - -/** - * Get the SDL joystick layer binding for this controller button mapping - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * Get the current state of an axis control on a game controller. - * - * The state is a value ranging from -32768 to 32767 (except for the triggers, - * which range from 0 to 32767). - * - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * The list of buttons available from a controller - */ -typedef enum -{ - SDL_CONTROLLER_BUTTON_INVALID = -1, - SDL_CONTROLLER_BUTTON_A, - SDL_CONTROLLER_BUTTON_B, - SDL_CONTROLLER_BUTTON_X, - SDL_CONTROLLER_BUTTON_Y, - SDL_CONTROLLER_BUTTON_BACK, - SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_START, - SDL_CONTROLLER_BUTTON_LEFTSTICK, - SDL_CONTROLLER_BUTTON_RIGHTSTICK, - SDL_CONTROLLER_BUTTON_LEFTSHOULDER, - SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, - SDL_CONTROLLER_BUTTON_DPAD_UP, - SDL_CONTROLLER_BUTTON_DPAD_DOWN, - SDL_CONTROLLER_BUTTON_DPAD_LEFT, - SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - SDL_CONTROLLER_BUTTON_MAX -} SDL_GameControllerButton; - -/** - * turn this string into a button mapping - */ -extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); - -/** - * turn this button enum into a string mapping - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); - -/** - * Get the SDL joystick layer binding for this controller button mapping - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - - -/** - * Get the current state of a button on a game controller. - * - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - -/** - * Trigger a rumble effect - * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. - * - * \param gamecontroller The controller to vibrate - * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF - * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * - * \return 0, or -1 if rumble isn't supported on this joystick - */ -extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); - -/** - * Close a controller previously opened with SDL_GameControllerOpen(). - */ -extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_gamecontroller_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_gesture.h b/Windows/SDL2/include/SDL_gesture.h deleted file mode 100644 index 9d25e9c1..00000000 --- a/Windows/SDL2/include/SDL_gesture.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_gesture.h - * - * Include file for SDL gesture event handling. - */ - -#ifndef SDL_gesture_h_ -#define SDL_gesture_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "SDL_touch.h" - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_GestureID; - -/* Function prototypes */ - -/** - * \brief Begin Recording a gesture on the specified touch, or all touches (-1) - * - * - */ -extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); - - -/** - * \brief Save all currently loaded Dollar Gesture templates - * - * - */ -extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); - -/** - * \brief Save a currently loaded Dollar Gesture template - * - * - */ -extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); - - -/** - * \brief Load Dollar Gesture templates from a file - * - * - */ -extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_gesture_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_haptic.h b/Windows/SDL2/include/SDL_haptic.h deleted file mode 100644 index 07562768..00000000 --- a/Windows/SDL2/include/SDL_haptic.h +++ /dev/null @@ -1,1238 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_haptic.h - * - * \brief The SDL haptic subsystem allows you to control haptic (force feedback) - * devices. - * - * The basic usage is as follows: - * - Initialize the subsystem (::SDL_INIT_HAPTIC). - * - Open a haptic device. - * - SDL_HapticOpen() to open from index. - * - SDL_HapticOpenFromJoystick() to open from an existing joystick. - * - Create an effect (::SDL_HapticEffect). - * - Upload the effect with SDL_HapticNewEffect(). - * - Run the effect with SDL_HapticRunEffect(). - * - (optional) Free the effect with SDL_HapticDestroyEffect(). - * - Close the haptic device with SDL_HapticClose(). - * - * \par Simple rumble example: - * \code - * SDL_Haptic *haptic; - * - * // Open the device - * haptic = SDL_HapticOpen( 0 ); - * if (haptic == NULL) - * return -1; - * - * // Initialize simple rumble - * if (SDL_HapticRumbleInit( haptic ) != 0) - * return -1; - * - * // Play effect at 50% strength for 2 seconds - * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) - * return -1; - * SDL_Delay( 2000 ); - * - * // Clean up - * SDL_HapticClose( haptic ); - * \endcode - * - * \par Complete example: - * \code - * int test_haptic( SDL_Joystick * joystick ) { - * SDL_Haptic *haptic; - * SDL_HapticEffect effect; - * int effect_id; - * - * // Open the device - * haptic = SDL_HapticOpenFromJoystick( joystick ); - * if (haptic == NULL) return -1; // Most likely joystick isn't haptic - * - * // See if it can do sine waves - * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { - * SDL_HapticClose(haptic); // No sine effect - * return -1; - * } - * - * // Create the effect - * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default - * effect.type = SDL_HAPTIC_SINE; - * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates - * effect.periodic.direction.dir[0] = 18000; // Force comes from south - * effect.periodic.period = 1000; // 1000 ms - * effect.periodic.magnitude = 20000; // 20000/32767 strength - * effect.periodic.length = 5000; // 5 seconds long - * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength - * effect.periodic.fade_length = 1000; // Takes 1 second to fade away - * - * // Upload the effect - * effect_id = SDL_HapticNewEffect( haptic, &effect ); - * - * // Test the effect - * SDL_HapticRunEffect( haptic, effect_id, 1 ); - * SDL_Delay( 5000); // Wait for the effect to finish - * - * // We destroy the effect, although closing the device also does this - * SDL_HapticDestroyEffect( haptic, effect_id ); - * - * // Close the device - * SDL_HapticClose(haptic); - * - * return 0; // Success - * } - * \endcode - */ - -#ifndef SDL_haptic_h_ -#define SDL_haptic_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF). - * - * At the moment the magnitude variables are mixed between signed/unsigned, and - * it is also not made clear that ALL of those variables expect a max of 0x7FFF. - * - * Some platforms may have higher precision than that (Linux FF, Windows XInput) - * so we should fix the inconsistency in favor of higher possible precision, - * adjusting for platforms that use different scales. - * -flibit - */ - -/** - * \typedef SDL_Haptic - * - * \brief The haptic structure used to identify an SDL haptic. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - */ -struct _SDL_Haptic; -typedef struct _SDL_Haptic SDL_Haptic; - - -/** - * \name Haptic features - * - * Different haptic features a device can have. - */ -/* @{ */ - -/** - * \name Haptic effects - */ -/* @{ */ - -/** - * \brief Constant effect supported. - * - * Constant haptic effect. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_CONSTANT (1u<<0) - -/** - * \brief Sine wave effect supported. - * - * Periodic haptic effect that simulates sine waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SINE (1u<<1) - -/** - * \brief Left/Right effect supported. - * - * Haptic effect for direct control over high/low frequency motors. - * - * \sa SDL_HapticLeftRight - * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, - * we ran out of bits, and this is important for XInput devices. - */ -#define SDL_HAPTIC_LEFTRIGHT (1u<<2) - -/* !!! FIXME: put this back when we have more bits in 2.1 */ -/* #define SDL_HAPTIC_SQUARE (1<<2) */ - -/** - * \brief Triangle wave effect supported. - * - * Periodic haptic effect that simulates triangular waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_TRIANGLE (1u<<3) - -/** - * \brief Sawtoothup wave effect supported. - * - * Periodic haptic effect that simulates saw tooth up waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHUP (1u<<4) - -/** - * \brief Sawtoothdown wave effect supported. - * - * Periodic haptic effect that simulates saw tooth down waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5) - -/** - * \brief Ramp effect supported. - * - * Ramp haptic effect. - * - * \sa SDL_HapticRamp - */ -#define SDL_HAPTIC_RAMP (1u<<6) - -/** - * \brief Spring effect supported - uses axes position. - * - * Condition haptic effect that simulates a spring. Effect is based on the - * axes position. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_SPRING (1u<<7) - -/** - * \brief Damper effect supported - uses axes velocity. - * - * Condition haptic effect that simulates dampening. Effect is based on the - * axes velocity. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_DAMPER (1u<<8) - -/** - * \brief Inertia effect supported - uses axes acceleration. - * - * Condition haptic effect that simulates inertia. Effect is based on the axes - * acceleration. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_INERTIA (1u<<9) - -/** - * \brief Friction effect supported - uses axes movement. - * - * Condition haptic effect that simulates friction. Effect is based on the - * axes movement. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_FRICTION (1u<<10) - -/** - * \brief Custom effect is supported. - * - * User defined custom haptic effect. - */ -#define SDL_HAPTIC_CUSTOM (1u<<11) - -/* @} *//* Haptic effects */ - -/* These last few are features the device has, not effects */ - -/** - * \brief Device can set global gain. - * - * Device supports setting the global gain. - * - * \sa SDL_HapticSetGain - */ -#define SDL_HAPTIC_GAIN (1u<<12) - -/** - * \brief Device can set autocenter. - * - * Device supports setting autocenter. - * - * \sa SDL_HapticSetAutocenter - */ -#define SDL_HAPTIC_AUTOCENTER (1u<<13) - -/** - * \brief Device can be queried for effect status. - * - * Device supports querying effect status. - * - * \sa SDL_HapticGetEffectStatus - */ -#define SDL_HAPTIC_STATUS (1u<<14) - -/** - * \brief Device can be paused. - * - * Devices supports being paused. - * - * \sa SDL_HapticPause - * \sa SDL_HapticUnpause - */ -#define SDL_HAPTIC_PAUSE (1u<<15) - - -/** - * \name Direction encodings - */ -/* @{ */ - -/** - * \brief Uses polar coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_POLAR 0 - -/** - * \brief Uses cartesian coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_CARTESIAN 1 - -/** - * \brief Uses spherical coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_SPHERICAL 2 - -/* @} *//* Direction encodings */ - -/* @} *//* Haptic features */ - -/* - * Misc defines. - */ - -/** - * \brief Used to play a device an infinite number of times. - * - * \sa SDL_HapticRunEffect - */ -#define SDL_HAPTIC_INFINITY 4294967295U - - -/** - * \brief Structure that represents a haptic direction. - * - * This is the direction where the force comes from, - * instead of the direction in which the force is exerted. - * - * Directions can be specified by: - * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. - * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. - * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. - * - * Cardinal directions of the haptic device are relative to the positioning - * of the device. North is considered to be away from the user. - * - * The following diagram represents the cardinal directions: - * \verbatim - .--. - |__| .-------. - |=.| |.-----.| - |--| || || - | | |'-----'| - |__|~')_____(' - [ COMPUTER ] - - - North (0,-1) - ^ - | - | - (-1,0) West <----[ HAPTIC ]----> East (1,0) - | - | - v - South (0,1) - - - [ USER ] - \|||/ - (o o) - ---ooO-(_)-Ooo--- - \endverbatim - * - * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a - * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses - * the first \c dir parameter. The cardinal directions would be: - * - North: 0 (0 degrees) - * - East: 9000 (90 degrees) - * - South: 18000 (180 degrees) - * - West: 27000 (270 degrees) - * - * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions - * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses - * the first three \c dir parameters. The cardinal directions would be: - * - North: 0,-1, 0 - * - East: 1, 0, 0 - * - South: 0, 1, 0 - * - West: -1, 0, 0 - * - * The Z axis represents the height of the effect if supported, otherwise - * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you - * can use any multiple you want, only the direction matters. - * - * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. - * The first two \c dir parameters are used. The \c dir parameters are as - * follows (all values are in hundredths of degrees): - * - Degrees from (1, 0) rotated towards (0, 1). - * - Degrees towards (0, 0, 1) (device needs at least 3 axes). - * - * - * Example of force coming from the south with all encodings (force coming - * from the south means the user will have to pull the stick to counteract): - * \code - * SDL_HapticDirection direction; - * - * // Cartesian directions - * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. - * direction.dir[0] = 0; // X position - * direction.dir[1] = 1; // Y position - * // Assuming the device has 2 axes, we don't need to specify third parameter. - * - * // Polar directions - * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. - * direction.dir[0] = 18000; // Polar only uses first parameter - * - * // Spherical coordinates - * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding - * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. - * \endcode - * - * \sa SDL_HAPTIC_POLAR - * \sa SDL_HAPTIC_CARTESIAN - * \sa SDL_HAPTIC_SPHERICAL - * \sa SDL_HapticEffect - * \sa SDL_HapticNumAxes - */ -typedef struct SDL_HapticDirection -{ - Uint8 type; /**< The type of encoding. */ - Sint32 dir[3]; /**< The encoded direction. */ -} SDL_HapticDirection; - - -/** - * \brief A structure containing a template for a Constant effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect. - * - * A constant effect applies a constant force in the specified direction - * to the joystick. - * - * \sa SDL_HAPTIC_CONSTANT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticConstant -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Constant */ - Sint16 level; /**< Strength of the constant effect. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticConstant; - -/** - * \brief A structure containing a template for a Periodic effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SINE - * - ::SDL_HAPTIC_LEFTRIGHT - * - ::SDL_HAPTIC_TRIANGLE - * - ::SDL_HAPTIC_SAWTOOTHUP - * - ::SDL_HAPTIC_SAWTOOTHDOWN - * - * A periodic effect consists in a wave-shaped effect that repeats itself - * over time. The type determines the shape of the wave and the parameters - * determine the dimensions of the wave. - * - * Phase is given by hundredth of a degree meaning that giving the phase a value - * of 9000 will displace it 25% of its period. Here are sample values: - * - 0: No phase displacement. - * - 9000: Displaced 25% of its period. - * - 18000: Displaced 50% of its period. - * - 27000: Displaced 75% of its period. - * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. - * - * Examples: - * \verbatim - SDL_HAPTIC_SINE - __ __ __ __ - / \ / \ / \ / - / \__/ \__/ \__/ - - SDL_HAPTIC_SQUARE - __ __ __ __ __ - | | | | | | | | | | - | |__| |__| |__| |__| | - - SDL_HAPTIC_TRIANGLE - /\ /\ /\ /\ /\ - / \ / \ / \ / \ / - / \/ \/ \/ \/ - - SDL_HAPTIC_SAWTOOTHUP - /| /| /| /| /| /| /| - / | / | / | / | / | / | / | - / |/ |/ |/ |/ |/ |/ | - - SDL_HAPTIC_SAWTOOTHDOWN - \ |\ |\ |\ |\ |\ |\ | - \ | \ | \ | \ | \ | \ | \ | - \| \| \| \| \| \| \| - \endverbatim - * - * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HAPTIC_TRIANGLE - * \sa SDL_HAPTIC_SAWTOOTHUP - * \sa SDL_HAPTIC_SAWTOOTHDOWN - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticPeriodic -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, - ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or - ::SDL_HAPTIC_SAWTOOTHDOWN */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Periodic */ - Uint16 period; /**< Period of the wave. */ - Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ - Sint16 offset; /**< Mean value of the wave. */ - Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticPeriodic; - -/** - * \brief A structure containing a template for a Condition effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SPRING: Effect based on axes position. - * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. - * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. - * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. - * - * Direction is handled by condition internals instead of a direction member. - * The condition effect specific members have three parameters. The first - * refers to the X axis, the second refers to the Y axis and the third - * refers to the Z axis. The right terms refer to the positive side of the - * axis and the left terms refer to the negative side of the axis. Please - * refer to the ::SDL_HapticDirection diagram for which side is positive and - * which is negative. - * - * \sa SDL_HapticDirection - * \sa SDL_HAPTIC_SPRING - * \sa SDL_HAPTIC_DAMPER - * \sa SDL_HAPTIC_INERTIA - * \sa SDL_HAPTIC_FRICTION - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCondition -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, - ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ - SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Condition */ - Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ - Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ - Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ - Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ - Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ - Sint16 center[3]; /**< Position of the dead zone. */ -} SDL_HapticCondition; - -/** - * \brief A structure containing a template for a Ramp effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. - * - * The ramp effect starts at start strength and ends at end strength. - * It augments in linear fashion. If you use attack and fade with a ramp - * the effects get added to the ramp effect making the effect become - * quadratic instead of linear. - * - * \sa SDL_HAPTIC_RAMP - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticRamp -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_RAMP */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Ramp */ - Sint16 start; /**< Beginning strength level. */ - Sint16 end; /**< Ending strength level. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticRamp; - -/** - * \brief A structure containing a template for a Left/Right effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. - * - * The Left/Right effect is used to explicitly control the large and small - * motors, commonly found in modern game controllers. The small (right) motor - * is high frequency, and the large (left) motor is low frequency. - * - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticLeftRight -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ - - /* Replay */ - Uint32 length; /**< Duration of the effect in milliseconds. */ - - /* Rumble */ - Uint16 large_magnitude; /**< Control of the large controller motor. */ - Uint16 small_magnitude; /**< Control of the small controller motor. */ -} SDL_HapticLeftRight; - -/** - * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect. - * - * A custom force feedback effect is much like a periodic effect, where the - * application can define its exact shape. You will have to allocate the - * data yourself. Data should consist of channels * samples Uint16 samples. - * - * If channels is one, the effect is rotated using the defined direction. - * Otherwise it uses the samples in data for the different axes. - * - * \sa SDL_HAPTIC_CUSTOM - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCustom -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Custom */ - Uint8 channels; /**< Axes to use, minimum of one. */ - Uint16 period; /**< Sample periods. */ - Uint16 samples; /**< Amount of samples. */ - Uint16 *data; /**< Should contain channels*samples items. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticCustom; - -/** - * \brief The generic template for any haptic effect. - * - * All values max at 32767 (0x7FFF). Signed values also can be negative. - * Time values unless specified otherwise are in milliseconds. - * - * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 - * value. Neither delay, interval, attack_length nor fade_length support - * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. - * - * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of - * ::SDL_HAPTIC_INFINITY. - * - * Button triggers may not be supported on all devices, it is advised to not - * use them if possible. Buttons start at index 1 instead of index 0 like - * the joystick. - * - * If both attack_length and fade_level are 0, the envelope is not used, - * otherwise both values are used. - * - * Common parts: - * \code - * // Replay - All effects have this - * Uint32 length; // Duration of effect (ms). - * Uint16 delay; // Delay before starting effect. - * - * // Trigger - All effects have this - * Uint16 button; // Button that triggers effect. - * Uint16 interval; // How soon before effect can be triggered again. - * - * // Envelope - All effects except condition effects have this - * Uint16 attack_length; // Duration of the attack (ms). - * Uint16 attack_level; // Level at the start of the attack. - * Uint16 fade_length; // Duration of the fade out (ms). - * Uint16 fade_level; // Level at the end of the fade. - * \endcode - * - * - * Here we have an example of a constant effect evolution in time: - * \verbatim - Strength - ^ - | - | effect level --> _________________ - | / \ - | / \ - | / \ - | / \ - | attack_level --> | \ - | | | <--- fade_level - | - +--------------------------------------------------> Time - [--] [---] - attack_length fade_length - - [------------------][-----------------------] - delay length - \endverbatim - * - * Note either the attack_level or the fade_level may be above the actual - * effect level. - * - * \sa SDL_HapticConstant - * \sa SDL_HapticPeriodic - * \sa SDL_HapticCondition - * \sa SDL_HapticRamp - * \sa SDL_HapticLeftRight - * \sa SDL_HapticCustom - */ -typedef union SDL_HapticEffect -{ - /* Common for all force feedback effects */ - Uint16 type; /**< Effect type. */ - SDL_HapticConstant constant; /**< Constant effect. */ - SDL_HapticPeriodic periodic; /**< Periodic effect. */ - SDL_HapticCondition condition; /**< Condition effect. */ - SDL_HapticRamp ramp; /**< Ramp effect. */ - SDL_HapticLeftRight leftright; /**< Left/Right effect. */ - SDL_HapticCustom custom; /**< Custom effect. */ -} SDL_HapticEffect; - - -/* Function prototypes */ -/** - * \brief Count the number of haptic devices attached to the system. - * - * \return Number of haptic devices detected on the system. - */ -extern DECLSPEC int SDLCALL SDL_NumHaptics(void); - -/** - * \brief Get the implementation dependent name of a haptic device. - * - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - * - * \param device_index Index of the device to get its name. - * \return Name of the device or NULL on error. - * - * \sa SDL_NumHaptics - */ -extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); - -/** - * \brief Opens a haptic device for use. - * - * The index passed as an argument refers to the N'th haptic device on this - * system. - * - * When opening a haptic device, its gain will be set to maximum and - * autocenter will be disabled. To modify these values use - * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). - * - * \param device_index Index of the device to open. - * \return Device identifier or NULL on error. - * - * \sa SDL_HapticIndex - * \sa SDL_HapticOpenFromMouse - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - * \sa SDL_HapticSetGain - * \sa SDL_HapticSetAutocenter - * \sa SDL_HapticPause - * \sa SDL_HapticStopAll - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); - -/** - * \brief Checks if the haptic device at index has been opened. - * - * \param device_index Index to check to see if it has been opened. - * \return 1 if it has been opened or 0 if it hasn't. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticIndex - */ -extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); - -/** - * \brief Gets the index of a haptic device. - * - * \param haptic Haptic device to get the index of. - * \return The index of the haptic device or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpened - */ -extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); - -/** - * \brief Gets whether or not the current mouse has haptic capabilities. - * - * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. - * - * \sa SDL_HapticOpenFromMouse - */ -extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); - -/** - * \brief Tries to open a haptic device from the current mouse. - * - * \return The haptic device identifier or NULL on error. - * - * \sa SDL_MouseIsHaptic - * \sa SDL_HapticOpen - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); - -/** - * \brief Checks to see if a joystick has haptic features. - * - * \param joystick Joystick to test for haptic capabilities. - * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't - * or -1 if an error occurred. - * - * \sa SDL_HapticOpenFromJoystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); - -/** - * \brief Opens a haptic device for use from a joystick device. - * - * You must still close the haptic device separately. It will not be closed - * with the joystick. - * - * When opening from a joystick you should first close the haptic device before - * closing the joystick device. If not, on some implementations the haptic - * device will also get unallocated and you'll be unable to use force feedback - * on that device. - * - * \param joystick Joystick to create a haptic device from. - * \return A valid haptic device identifier on success or NULL on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticClose - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * - joystick); - -/** - * \brief Closes a haptic device previously opened with SDL_HapticOpen(). - * - * \param haptic Haptic device to close. - */ -extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); - -/** - * \brief Returns the number of effects a haptic device can store. - * - * On some platforms this isn't fully supported, and therefore is an - * approximation. Always check to see if your created effect was actually - * created and do not rely solely on SDL_HapticNumEffects(). - * - * \param haptic The haptic device to query effect max. - * \return The number of effects the haptic device can store or - * -1 on error. - * - * \sa SDL_HapticNumEffectsPlaying - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); - -/** - * \brief Returns the number of effects a haptic device can play at the same - * time. - * - * This is not supported on all platforms, but will always return a value. - * Added here for the sake of completeness. - * - * \param haptic The haptic device to query maximum playing effects. - * \return The number of effects the haptic device can play at the same time - * or -1 on error. - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); - -/** - * \brief Gets the haptic device's supported features in bitwise manner. - * - * Example: - * \code - * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { - * printf("We have constant haptic effect!\n"); - * } - * \endcode - * - * \param haptic The haptic device to query. - * \return Haptic features in bitwise manner (OR'd). - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticEffectSupported - */ -extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); - - -/** - * \brief Gets the number of haptic axes the device has. - * - * \sa SDL_HapticDirection - */ -extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); - -/** - * \brief Checks to see if effect is supported by haptic. - * - * \param haptic Haptic device to check on. - * \param effect Effect to check to see if it is supported. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. - * - * \sa SDL_HapticQuery - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, - SDL_HapticEffect * - effect); - -/** - * \brief Creates a new haptic effect on the device. - * - * \param haptic Haptic device to create the effect on. - * \param effect Properties of the effect to create. - * \return The identifier of the effect on success or -1 on error. - * - * \sa SDL_HapticUpdateEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, - SDL_HapticEffect * effect); - -/** - * \brief Updates the properties of an effect. - * - * Can be used dynamically, although behavior when dynamically changing - * direction may be strange. Specifically the effect may reupload itself - * and start playing from the start. You cannot change the type either when - * running SDL_HapticUpdateEffect(). - * - * \param haptic Haptic device that has the effect. - * \param effect Identifier of the effect to update. - * \param data New effect properties to use. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticNewEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, - int effect, - SDL_HapticEffect * data); - -/** - * \brief Runs the haptic effect on its associated haptic device. - * - * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over - * repeating the envelope (attack and fade) every time. If you only want the - * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length - * parameter. - * - * \param haptic Haptic device to run the effect on. - * \param effect Identifier of the haptic effect to run. - * \param iterations Number of iterations to run the effect. Use - * ::SDL_HAPTIC_INFINITY for infinity. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticStopEffect - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticGetEffectStatus - */ -extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, - int effect, - Uint32 iterations); - -/** - * \brief Stops the haptic effect on its associated haptic device. - * - * \param haptic Haptic device to stop the effect on. - * \param effect Identifier of the effect to stop. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, - int effect); - -/** - * \brief Destroys a haptic effect on the device. - * - * This will stop the effect if it's running. Effects are automatically - * destroyed when the device is closed. - * - * \param haptic Device to destroy the effect on. - * \param effect Identifier of the effect to destroy. - * - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, - int effect); - -/** - * \brief Gets the status of the current effect on the haptic device. - * - * Device must support the ::SDL_HAPTIC_STATUS feature. - * - * \param haptic Haptic device to query the effect status on. - * \param effect Identifier of the effect to query its status. - * \return 0 if it isn't playing, 1 if it is playing or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticStopEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, - int effect); - -/** - * \brief Sets the global gain of the device. - * - * Device must support the ::SDL_HAPTIC_GAIN feature. - * - * The user may specify the maximum gain by setting the environment variable - * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to - * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the - * maximum. - * - * \param haptic Haptic device to set the gain on. - * \param gain Value to set the gain to, should be between 0 and 100. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); - -/** - * \brief Sets the global autocenter of the device. - * - * Autocenter should be between 0 and 100. Setting it to 0 will disable - * autocentering. - * - * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. - * - * \param haptic Haptic device to set autocentering on. - * \param autocenter Value to set autocenter to, 0 disables autocentering. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, - int autocenter); - -/** - * \brief Pauses a haptic device. - * - * Device must support the ::SDL_HAPTIC_PAUSE feature. Call - * SDL_HapticUnpause() to resume playback. - * - * Do not modify the effects nor add new ones while the device is paused. - * That can cause all sorts of weird errors. - * - * \param haptic Haptic device to pause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticUnpause - */ -extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); - -/** - * \brief Unpauses a haptic device. - * - * Call to unpause after SDL_HapticPause(). - * - * \param haptic Haptic device to unpause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticPause - */ -extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); - -/** - * \brief Stops all the currently playing effects on a haptic device. - * - * \param haptic Haptic device to stop. - * \return 0 on success or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); - -/** - * \brief Checks to see if rumble is supported on a haptic device. - * - * \param haptic Haptic device to check to see if it supports rumble. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. - * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); - -/** - * \brief Initializes the haptic device for simple rumble playback. - * - * \param haptic Haptic device to initialize for simple rumble playback. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); - -/** - * \brief Runs simple rumble on a haptic device - * - * \param haptic Haptic device to play rumble effect on. - * \param strength Strength of the rumble to play as a 0-1 float value. - * \param length Length of the rumble to play in milliseconds. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); - -/** - * \brief Stops the simple rumble on a haptic device. - * - * \param haptic Haptic to stop the rumble on. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRumbleSupported - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_haptic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_hints.h b/Windows/SDL2/include/SDL_hints.h deleted file mode 100644 index d36815b9..00000000 --- a/Windows/SDL2/include/SDL_hints.h +++ /dev/null @@ -1,1321 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_hints.h - * - * Official documentation for SDL configuration variables - * - * This file contains functions to set and get configuration hints, - * as well as listing each of them alphabetically. - * - * The convention for naming hints is SDL_HINT_X, where "SDL_X" is - * the environment variable that can be used to override the default. - * - * In general these hints are just that - they may or may not be - * supported or applicable on any given platform, but they provide - * a way for an application or user to give the library a hint as - * to how they would like the library to work. - */ - -#ifndef SDL_hints_h_ -#define SDL_hints_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. - * - * SDL can try to accelerate the SDL screen surface by using streaming - * textures with a 3D rendering engine. This variable controls whether and - * how this is done. - * - * This variable can be set to the following values: - * "0" - Disable 3D acceleration - * "1" - Enable 3D acceleration, using the default renderer. - * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) - * - * By default SDL tries to make a best guess for each platform whether - * to use acceleration or not. - */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" - -/** - * \brief A variable specifying which render driver to use. - * - * If the application doesn't pick a specific renderer to use, this variable - * specifies the name of the preferred renderer. If the preferred renderer - * can't be initialized, the normal default renderer is used. - * - * This variable is case insensitive and can be set to the following values: - * "direct3d" - * "opengl" - * "opengles2" - * "opengles" - * "metal" - * "software" - * - * The default varies by platform, but it's the first one in the list that - * is available on the current platform. - */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" - -/** - * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. - * - * This variable can be set to the following values: - * "0" - Disable shaders - * "1" - Enable shaders - * - * By default shaders are used if OpenGL supports them. - */ -#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" - -/** - * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. - * - * This variable can be set to the following values: - * "0" - Thread-safety is not enabled (faster) - * "1" - Thread-safety is enabled - * - * By default the Direct3D device is created with thread-safety disabled. - */ -#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" - -/** - * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. - * - * This variable does not have any effect on the Direct3D 9 based renderer. - * - * This variable can be set to the following values: - * "0" - Disable Debug Layer use - * "1" - Enable Debug Layer use - * - * By default, SDL does not use Direct3D Debug Layer. - */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" - -/** - * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize. - * - * This variable can be set to the following values: - * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen - * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen - * - * By default letterbox is used - */ -#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE" - -/** - * \brief A variable controlling the scaling quality - * - * This variable can be set to the following values: - * "0" or "nearest" - Nearest pixel sampling - * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) - * "2" or "best" - Currently this is the same as "linear" - * - * By default nearest pixel sampling is used - */ -#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" - -/** - * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. - * - * This variable can be set to the following values: - * "0" - Disable vsync - * "1" - Enable vsync - * - * By default SDL does not sync screen surface updates with vertical refresh. - */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" - -/** - * \brief A variable controlling whether the screensaver is enabled. - * - * This variable can be set to the following values: - * "0" - Disable screensaver - * "1" - Enable screensaver - * - * By default SDL will disable the screensaver. - */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" - -/** - * \brief A variable controlling whether the graphics context is externally managed. - * - * This variable can be set to the following values: - * "0" - SDL will manage graphics contexts that are attached to windows. - * "1" - Disable graphics context management on windows. - * - * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the - * context will be automatically saved and restored when pausing the application. Additionally, some - * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this - * behavior, which is desireable when the application manages the graphics context, such as - * an externally managed OpenGL context or attaching a Vulkan surface to the window. - */ -#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" - -/** - * \brief A variable controlling whether the X11 VidMode extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XVidMode - * "1" - Enable XVidMode - * - * By default SDL will use XVidMode if it is available. - */ -#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" - -/** - * \brief A variable controlling whether the X11 Xinerama extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable Xinerama - * "1" - Enable Xinerama - * - * By default SDL will use Xinerama if it is available. - */ -#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" - -/** - * \brief A variable controlling whether the X11 XRandR extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XRandR - * "1" - Enable XRandR - * - * By default SDL will not use XRandR because of window manager issues. - */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" - -/** - * \brief A variable forcing the visual ID chosen for new X11 windows - * - */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" - -/** - * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_PING - * "1" - Enable _NET_WM_PING - * - * By default SDL will use _NET_WM_PING, but for applications that know they - * will not always be able to respond to ping requests in a timely manner they can - * turn it off to avoid the window manager thinking the app is hung. - * The hint is checked in CreateWindow. - */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" - -/** - * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_BYPASS_COMPOSITOR - * "1" - Enable _NET_WM_BYPASS_COMPOSITOR - * - * By default SDL will use _NET_WM_BYPASS_COMPOSITOR - * - */ -#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" - -/** - * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden - * - * This variable can be set to the following values: - * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) - * "1" - The window frame is interactive when the cursor is hidden - * - * By default SDL will allow interaction with the window frame when the cursor is hidden - */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" - -/** - * \brief A variable to specify custom icon resource id from RC file on Windows platform - */ -#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON" -#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" - -/** - * \brief A variable controlling whether the windows message loop is processed by SDL - * - * This variable can be set to the following values: - * "0" - The window message loop is not run - * "1" - The window message loop is processed in SDL_PumpEvents() - * - * By default SDL will process the windows message loop - */ -#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" - -/** - * \brief A variable controlling whether grabbing input grabs the keyboard - * - * This variable can be set to the following values: - * "0" - Grab will affect only the mouse - * "1" - Grab will affect mouse and keyboard - * - * By default SDL will not grab the keyboard so system shortcuts still work. - */ -#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" - -/** - * \brief A variable setting the double click time, in milliseconds. - */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" - -/** - * \brief A variable setting the double click radius, in pixels. - */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" - -/** - * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode - */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" - -/** - * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode - */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" - -/** - * \brief A variable controlling whether relative mouse mode is implemented using mouse warping - * - * This variable can be set to the following values: - * "0" - Relative mouse mode uses raw input - * "1" - Relative mouse mode uses mouse warping - * - * By default SDL will use raw input for relative mouse mode - */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" - -/** - * \brief Allow mouse click events when clicking to focus an SDL window - * - * This variable can be set to the following values: - * "0" - Ignore mouse clicks that activate a window - * "1" - Generate events for mouse clicks that activate a window - * - * By default SDL will ignore mouse clicks that activate a window - */ -#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH" - -/** - * \brief A variable controlling whether touch events should generate synthetic mouse events - * - * This variable can be set to the following values: - * "0" - Touch events will not generate mouse events - * "1" - Touch events will generate mouse events - * - * By default SDL will generate mouse events for touch events - */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" - -/** - * \brief A variable controlling whether mouse events should generate synthetic touch events - * - * This variable can be set to the following values: - * "0" - Mouse events will not generate touch events (default for desktop platforms) - * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS) - */ - -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" - -/** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. - * - */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" - -/** - * \brief A variable controlling whether the idle timer is disabled on iOS. - * - * When an iOS app does not receive touches for some time, the screen is - * dimmed automatically. For games where the accelerometer is the only input - * this is problematic. This functionality can be disabled by setting this - * hint. - * - * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() - * accomplish the same thing on iOS. They should be preferred over this hint. - * - * This variable can be set to the following values: - * "0" - Enable idle timer - * "1" - Disable idle timer - */ -#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" - -/** - * \brief A variable controlling which orientations are allowed on iOS/Android. - * - * In some circumstances it is necessary to be able to explicitly control - * which UI orientations are allowed. - * - * This variable is a space delimited list of the following values: - * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" - */ -#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" - -/** - * \brief A variable controlling whether controllers used with the Apple TV - * generate UI events. - * - * When UI events are generated by controller input, the app will be - * backgrounded when the Apple TV remote's menu button is pressed, and when the - * pause or B buttons on gamepads are pressed. - * - * More information about properly making use of controllers for the Apple TV - * can be found here: - * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/ - * - * This variable can be set to the following values: - * "0" - Controller input does not generate UI events (the default). - * "1" - Controller input generates UI events. - */ -#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" - -/** - * \brief A variable controlling whether the Apple TV remote's joystick axes - * will automatically match the rotation of the remote. - * - * This variable can be set to the following values: - * "0" - Remote orientation does not affect joystick axes (the default). - * "1" - Joystick axes are based on the orientation of the remote. - */ -#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" - -/** - * \brief A variable controlling whether the home indicator bar on iPhone X - * should be hidden. - * - * This variable can be set to the following values: - * "0" - The indicator bar is not hidden (default for windowed applications) - * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) - * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications) - */ -#define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" - -/** - * \brief A variable controlling whether the Android / iOS built-in - * accelerometer should be listed as a joystick device. - * - * This variable can be set to the following values: - * "0" - The accelerometer is not listed as a joystick - * "1" - The accelerometer is available as a 3 axis joystick (the default). - */ -#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" - -/** - * \brief A variable controlling whether the Android / tvOS remotes - * should be listed as joystick devices, instead of sending keyboard events. - * - * This variable can be set to the following values: - * "0" - Remotes send enter/escape/arrow key events - * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). - */ -#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" - -/** - * \brief A variable that lets you disable the detection and use of Xinput gamepad devices - * - * The variable can be set to the following values: - * "0" - Disable XInput detection (only uses direct input) - * "1" - Enable XInput detection (the default) - */ -#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" - -/** - * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. - * - * This hint is for backwards compatibility only and will be removed in SDL 2.1 - * - * The default value is "0". This hint must be set before SDL_Init() - */ -#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" - -/** - * \brief A variable that lets you manually hint extra gamecontroller db entries. - * - * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" - -/** - * \brief A variable that lets you provide a file with extra gamecontroller db entries. - * - * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE" - -/** - * \brief A variable containing a list of devices to skip when scanning for game controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES" - -/** - * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" - -/** - * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout. - * - * For example, on Nintendo Switch controllers, normally you'd get: - * - * (Y) - * (X) (B) - * (A) - * - * but if this hint is set, you'll get: - * - * (X) - * (Y) (A) - * (B) - * - * The variable can be set to the following values: - * "0" - Report the face buttons by position, as though they were on an Xbox controller. - * "1" - Report the face buttons by label instead of position - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" - -/** - * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. - * - * The variable can be set to the following values: - * "0" - Disable joystick & gamecontroller input events when the - * application is in the background. - * "1" - Enable joystick & gamecontroller input events when the - * application is in the background. - * - * The default value is "0". This hint may be set at any time. - */ -#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" - -/** - * \brief A variable controlling whether the HIDAPI joystick drivers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI drivers are not used - * "1" - HIDAPI drivers are used (the default) - * - * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. - */ -#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" - -/** - * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" - -/** - * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. - * - * This variable can be set to the following values: - * "0" - extended reports are not enabled (the default) - * "1" - extended reports - * - * Extended input reports allow rumble on Bluetooth PS4 controllers, but - * break DirectInput handling for applications that don't use SDL. - * - * Once extended reports are enabled, they can not be disabled without - * power cycling the controller. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" - -/** - * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" - -/** - * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs - * - * The variable can be set to the following values: - * "0" - Do not scan for Steam Controllers - * "1" - Scan for Steam Controllers (the default) - * - * The default value is "1". This hint must be set before initializing the joystick subsystem. - */ -#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" - - -/** - * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. - * This is a debugging aid for developers and not expected to be used by end users. The default is "1" - * - * This variable can be set to the following values: - * "0" - don't allow topmost - * "1" - allow topmost - */ -#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" - -/** - * \brief A variable that controls the timer resolution, in milliseconds. - * - * The higher resolution the timer, the more frequently the CPU services - * timer interrupts, and the more precise delays are, but this takes up - * power and CPU time. This hint is only used on Windows 7 and earlier. - * - * See this blog post for more information: - * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ - * - * If this variable is set to "0", the system timer resolution is not set. - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" - - -/** - * \brief A variable describing the content orientation on QtWayland-based platforms. - * - * On QtWayland platforms, windows are rotated client-side to allow for custom - * transitions. In order to correctly position overlays (e.g. volume bar) and - * gestures (e.g. events view, close/minimize gestures), the system needs to - * know in which orientation the application is currently drawing its contents. - * - * This does not cause the window to be rotated or resized, the application - * needs to take care of drawing the content in the right orientation (the - * framebuffer is always in portrait mode). - * - * This variable can be one of the following values: - * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape" - */ -#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION" - -/** - * \brief Flags to set on QtWayland windows to integrate with the native window manager. - * - * On QtWayland platforms, this hint controls the flags to set on the windows. - * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures. - * - * This variable is a space-separated list of the following values (empty = no flags): - * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager" - */ -#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS" - -/** -* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size -* -* Use this hint in case you need to set SDL's threads stack size to other than the default. -* This is specially useful if you build SDL against a non glibc libc library (such as musl) which -* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). -* Support for this hint is currently available only in the pthread, Windows, and PSP backend. -* -* Instead of this hint, in 2.0.9 and later, you can use -* SDL_CreateThreadWithStackSize(). This hint only works with the classic -* SDL_CreateThread(). -*/ -#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" - -/** - * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) - */ -#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" - -/** - * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac - * - * If present, holding ctrl while left clicking will generate a right click - * event when on Mac. - */ -#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" - -/** -* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries -* -* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It -* can use two different sets of binaries, those compiled by the user from source -* or those provided by the Chrome browser. In the later case, these binaries require -* that SDL loads a DLL providing the shader compiler. -* -* This variable can be set to the following values: -* "d3dcompiler_46.dll" - default, best for Vista or later. -* "d3dcompiler_43.dll" - for XP support. -* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. -* -*/ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" - -/** -* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). -* -* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has -* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly -* created SDL_Window: -* -* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is -* needed for example when sharing an OpenGL context across multiple windows. -* -* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for -* OpenGL rendering. -* -* This variable can be set to the following values: -* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should -* share a pixel format with. -*/ -#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" - -/** - * \brief A URL to a WinRT app's privacy policy - * - * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be - * be available in the Windows Settings charm, as accessed from within the app. - * SDL provides code to add a URL-based link there, which can point to the app's - * privacy policy. - * - * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL - * before calling any SDL_Init() functions. The contents of the hint should - * be a valid URL. For example, "http://www.example.com". - * - * The default value is "", which will prevent SDL from adding a privacy policy - * link to the Settings charm. This hint should only be set during app init. - * - * The label text of an app's "Privacy Policy" link may be customized via another - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that on Windows Phone, Microsoft does not provide standard UI - * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL - * will not get used on that platform. Network-enabled phone apps should display - * their privacy policy through some other, in-app means. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" - -/** \brief Label text for a WinRT app's privacy policy link - * - * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, - * Microsoft mandates that this policy be available via the Windows Settings charm. - * SDL provides code to add a link there, with its label text being set via the - * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that a privacy policy's contents are not set via this hint. A separate - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the - * policy. - * - * The contents of this hint should be encoded as a UTF8 string. - * - * The default value is "Privacy Policy". This hint should only be set during app - * initialization, preferably before any calls to SDL_Init(). - * - * For additional information on linking to a privacy policy, see the documentation for - * SDL_HINT_WINRT_PRIVACY_POLICY_URL. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" - -/** \brief Allows back-button-press events on Windows Phone to be marked as handled - * - * Windows Phone devices typically feature a Back button. When pressed, - * the OS will emit back-button-press events, which apps are expected to - * handle in an appropriate manner. If apps do not explicitly mark these - * events as 'Handled', then the OS will invoke its default behavior for - * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to - * terminate the app (and attempt to switch to the previous app, or to the - * device's home screen). - * - * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL - * to mark back-button-press events as Handled, if and when one is sent to - * the app. - * - * Internally, Windows Phone sends back button events as parameters to - * special back-button-press callback functions. Apps that need to respond - * to back-button-press events are expected to register one or more - * callback functions for such, shortly after being launched (during the - * app's initialization phase). After the back button is pressed, the OS - * will invoke these callbacks. If the app's callback(s) do not explicitly - * mark the event as handled by the time they return, or if the app never - * registers one of these callback, the OS will consider the event - * un-handled, and it will apply its default back button behavior (terminate - * the app). - * - * SDL registers its own back-button-press callback with the Windows Phone - * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN - * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which - * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. - * If the hint's value is set to "1", the back button event's Handled - * property will get set to 'true'. If the hint's value is set to something - * else, or if it is unset, SDL will leave the event's Handled property - * alone. (By default, the OS sets this property to 'false', to note.) - * - * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a - * back button is pressed, or can set it in direct-response to a back button - * being pressed. - * - * In order to get notified when a back button is pressed, SDL apps should - * register a callback function with SDL_AddEventWatch(), and have it listen - * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. - * (Alternatively, SDL_KEYUP events can be listened-for. Listening for - * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON - * set by such a callback, will be applied to the OS' current - * back-button-press event. - * - * More details on back button behavior in Windows Phone apps can be found - * at the following page, on Microsoft's developer site: - * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx - */ -#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" - -/** - * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. - * - * This hint only applies to Mac OS X. - * - * The variable can be set to the following values: - * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and - * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" - * button on their titlebars). - * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and - * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" - * button on their titlebars). - * - * The default value is "1". Spaces are disabled regardless of this hint if - * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before - * any windows are created. - */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" - -/** -* \brief When set don't force the SDL app to become a foreground process -* -* This hint only applies to Mac OS X. -* -*/ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" - -/** - * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" - -/** - * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" - -/** - * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. - * - * The variable can be set to the following values: - * "0" - SDL_TEXTEDITING events are sent, and it is the application's - * responsibility to render the text from these events and - * differentiate it somehow from committed text. (default) - * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, - * and text that is being composed will be rendered in its own UI. - */ -#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" - -/** - * \brief A variable to control whether we trap the Android back button to handle it manually. - * This is necessary for the right mouse button to work on some Android devices, or - * to be able to trap the back button for use in your code reliably. If set to true, - * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of - * SDL_SCANCODE_AC_BACK. - * - * The variable can be set to the following values: - * "0" - Back button will be handled as usual for system. (default) - * "1" - Back button will be trapped, allowing you to handle the key press - * manually. (This will also let right mouse click work on systems - * where the right mouse button functions as back.) - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" - -/** - * \brief A variable to control whether the event loop will block itself when the app is paused. - * - * The variable can be set to the following values: - * "0" - Non blocking. - * "1" - Blocking. (default) - * - * The value should be set before SDL is initialized. - */ -#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" - - /** - * \brief A variable to control whether the return key on the soft keyboard - * should hide the soft keyboard on Android and iOS. - * - * The variable can be set to the following values: - * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) - * "1" - The return key will hide the keyboard. - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" - -/** - * \brief override the binding element for keyboard inputs for Emscripten builds - * - * This hint only applies to the emscripten platform - * - * The variable can be one of - * "#window" - The javascript window object (this is the default) - * "#document" - The javascript document object - * "#screen" - the javascript window.screen object - * "#canvas" - the WebGL canvas element - * any other string without a leading # sign applies to the element on the page with that ID. - */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" - -/** - * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. - * - * This hint only applies to Unix-like platforms. - * - * The variable can be set to the following values: - * "0" - SDL will install a SIGINT and SIGTERM handler, and when it - * catches a signal, convert it into an SDL_QUIT event. - * "1" - SDL will not install a signal handler at all. - */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" - -/** - * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. - * - * The variable can be set to the following values: - * "0" - SDL will generate a window-close event when it sees Alt+F4. - * "1" - SDL will only do normal key handling for Alt+F4. - */ -#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" - -/** - * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. - * - * The bitmap header version 4 is required for proper alpha channel support and - * SDL will use it when required. Should this not be desired, this hint can - * force the use of the 40 byte header version which is supported everywhere. - * - * The variable can be set to the following values: - * "0" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file with an alpha mask. SDL will use the bitmap - * header version 4 and set the alpha mask accordingly. - * "1" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file without an alpha mask. The alpha channel data - * will be in the file, but applications are going to ignore it. - * - * The default value is "0". - */ -#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT" - -/** - * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception. - * The 0x406D1388 Exception is a trick used to inform Visual Studio of a - * thread's name, but it tends to cause problems with other debuggers, - * and the .NET runtime. Note that SDL 2.0.6 and later will still use - * the (safer) SetThreadDescription API, introduced in the Windows 10 - * Creators Update, if available. - * - * The variable can be set to the following values: - * "0" - SDL will raise the 0x406D1388 Exception to name threads. - * This is the default behavior of SDL <= 2.0.4. - * "1" - SDL will not raise this exception, and threads will be unnamed. (default) - * This is necessary with .NET languages or debuggers that aren't Visual Studio. - */ -#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" - -/** - * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI - * - * Also known as Z-order. The variable can take a negative or positive value. - * The default is 10000. - */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" - -/** - * \brief Tell the video driver that we only want a double buffer. - * - * By default, most lowlevel 2D APIs will use a triple buffer scheme that - * wastes no CPU time on waiting for vsync after issuing a flip, but - * introduces a frame of latency. On the other hand, using a double buffer - * scheme instead is recommended for cases where low latency is an important - * factor because we save a whole frame of latency. - * We do so by waiting for vsync immediately after issuing a flip, usually just - * after eglSwapBuffers call in the backend's *_SwapWindow function. - * - * Since it's driver-specific, it's only supported where possible and - * implemented. Currently supported the following drivers: - * - KMSDRM (kmsdrm) - * - Raspberry Pi (raspberrypi) - */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" - -/** - * \brief A variable controlling what driver to use for OpenGL ES contexts. - * - * On some platforms, currently Windows and X11, OpenGL drivers may support - * creating contexts with an OpenGL ES profile. By default SDL uses these - * profiles, when available, otherwise it attempts to load an OpenGL ES - * library, e.g. that provided by the ANGLE project. This variable controls - * whether SDL follows this default behaviour or will always load an - * OpenGL ES library. - * - * Circumstances where this is useful include - * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, - * or emulator, e.g. those from ARM, Imagination or Qualcomm. - * - Resolving OpenGL ES function addresses at link time by linking with - * the OpenGL ES library instead of querying them at run time with - * SDL_GL_GetProcAddress(). - * - * Caution: for an application to work with the default behaviour across - * different OpenGL drivers it must query the OpenGL ES function - * addresses at run time using SDL_GL_GetProcAddress(). - * - * This variable is ignored on most platforms because OpenGL ES is native - * or not supported. - * - * This variable can be set to the following values: - * "0" - Use ES profile of OpenGL, if available. (Default when not set.) - * "1" - Load OpenGL ES library using the default library names. - * - */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" - -/** - * \brief A variable controlling speed/quality tradeoff of audio resampling. - * - * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) - * to handle audio resampling. There are different resampling modes available - * that produce different levels of quality, using more CPU. - * - * If this hint isn't specified to a valid setting, or libsamplerate isn't - * available, SDL will use the default, internal resampling algorithm. - * - * Note that this is currently only applicable to resampling audio that is - * being written to a device for playback or audio being read from a device - * for capture. SDL_AudioCVT always uses the default resampler (although this - * might change for SDL 2.1). - * - * This hint is currently only checked at audio subsystem initialization. - * - * This variable can be set to the following values: - * - * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast) - * "1" or "fast" - Use fast, slightly higher quality resampling, if available - * "2" or "medium" - Use medium quality resampling, if available - * "3" or "best" - Use high quality resampling, if available - */ -#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE" - -/** - * \brief A variable controlling the audio category on iOS and Mac OS X - * - * This variable can be set to the following values: - * - * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default) - * "playback" - Use the AVAudioSessionCategoryPlayback category - * - * For more information, see Apple's documentation: - * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html - */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" - -/** - * \brief A variable controlling whether the 2D render API is compatible or efficient. - * - * This variable can be set to the following values: - * - * "0" - Don't use batching to make rendering more efficient. - * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls. - * - * Up to SDL 2.0.9, the render API would draw immediately when requested. Now - * it batches up draw requests and sends them all to the GPU only when forced - * to (during SDL_RenderPresent, when changing render targets, by updating a - * texture that the batch needs, etc). This is significantly more efficient, - * but it can cause problems for apps that expect to render on top of the - * render API's output. As such, SDL will disable batching if a specific - * render backend is requested (since this might indicate that the app is - * planning to use the underlying graphics API directly). This hint can - * be used to explicitly request batching in this instance. It is a contract - * that you will either never use the underlying graphics API directly, or - * if you do, you will call SDL_RenderFlush() before you do so any current - * batch goes to the GPU before your work begins. Not following this contract - * will result in undefined behavior. - */ -#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" - - -/** - * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. - * - * This variable can be set to the following values: - * - * "0" - Don't log any events (default) - * "1" - Log all events except mouse and finger motion, which are pretty spammy. - * "2" - Log all events. - * - * This is generally meant to be used to debug SDL itself, but can be useful - * for application developers that need better visibility into what is going - * on in the event queue. Logged events are sent through SDL_Log(), which - * means by default they appear on stdout on most platforms or maybe - * OutputDebugString() on Windows, and can be funneled by the app with - * SDL_LogSetOutputFunction(), etc. - * - * This hint can be toggled on and off at runtime, if you only need to log - * events for a small subset of program execution. - */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" - - - -/** - * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file. - * - * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE - * file) is not always reliable. In case the size is wrong, it's possible to - * just ignore it and step through the chunks until a fixed limit is reached. - * - * Note that files that have trailing data unrelated to the WAVE file or - * corrupt files may slow down the loading process without a reliable boundary. - * By default, SDL stops after 10000 chunks to prevent wasting time. Use the - * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. - * - * This variable can be set to the following values: - * - * "force" - Always use the RIFF chunk size as a boundary for the chunk search - * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default) - * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB - * "maximum" - Search for chunks until the end of file (not recommended) - */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" - -/** - * \brief Controls how a truncated WAVE file is handled. - * - * A WAVE file is considered truncated if any of the chunks are incomplete or - * the data chunk size is not a multiple of the block size. By default, SDL - * decodes until the first incomplete block, as most applications seem to do. - * - * This variable can be set to the following values: - * - * "verystrict" - Raise an error if the file is truncated - * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored - * "dropframe" - Decode until the first incomplete sample frame - * "dropblock" - Decode until the first incomplete block (default) - */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" - -/** - * \brief Controls how the fact chunk affects the loading of a WAVE file. - * - * The fact chunk stores information about the number of samples of a WAVE - * file. The Standards Update from Microsoft notes that this value can be used - * to 'determine the length of the data in seconds'. This is especially useful - * for compressed formats (for which this is a mandatory chunk) if they produce - * multiple sample frames per block and truncating the block is not allowed. - * The fact chunk can exactly specify how many sample frames there should be - * in this case. - * - * Unfortunately, most application seem to ignore the fact chunk and so SDL - * ignores it by default as well. - * - * This variable can be set to the following values: - * - * "truncate" - Use the number of samples to truncate the wave data if - * the fact chunk is present and valid - * "strict" - Like "truncate", but raise an error if the fact chunk - * is invalid, not present for non-PCM formats, or if the - * data chunk doesn't have that many samples - * "ignorezero" - Like "truncate", but ignore fact chunk if the number of - * samples is zero - * "ignore" - Ignore fact chunk entirely (default) - */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" - -/** - * \brief An enumeration of hint priorities - */ -typedef enum -{ - SDL_HINT_DEFAULT, - SDL_HINT_NORMAL, - SDL_HINT_OVERRIDE -} SDL_HintPriority; - - -/** - * \brief Set a hint with a specific priority - * - * The priority controls the behavior when setting a hint that already - * has a value. Hints will replace existing hints of their priority and - * lower. Environment variables are considered to have override priority. - * - * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); - -/** - * \brief Set a hint with normal priority - * - * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, - const char *value); - -/** - * \brief Get a hint - * - * \return The string value of a hint variable. - */ -extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); - -/** - * \brief Get a hint - * - * \return The boolean value of a hint variable. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); - -/** - * \brief type definition of the hint callback function. - */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); - -/** - * \brief Add a function to watch a particular hint - * - * \param name The hint to watch - * \param callback The function to call when the hint value changes - * \param userdata A pointer to pass to the callback function - */ -extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * \brief Remove a function watching a particular hint - * - * \param name The hint being watched - * \param callback The function being called when the hint value changes - * \param userdata A pointer being passed to the callback function - */ -extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * \brief Clear all hints - * - * This function is called during SDL_Quit() to free stored hints. - */ -extern DECLSPEC void SDLCALL SDL_ClearHints(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_hints_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_joystick.h b/Windows/SDL2/include/SDL_joystick.h deleted file mode 100644 index 3c099dec..00000000 --- a/Windows/SDL2/include/SDL_joystick.h +++ /dev/null @@ -1,418 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_joystick.h - * - * Include file for SDL joystick event handling - * - * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick - * behind a device_index changing as joysticks are plugged and unplugged. - * - * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted - * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. - * - * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of - * the device (a X360 wired controller for example). This identifier is platform dependent. - * - * - */ - -#ifndef SDL_joystick_h_ -#define SDL_joystick_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_joystick.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. - * - * If you would like to receive joystick updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/** - * The joystick structure used to identify an SDL joystick - */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - -/* A structure that encodes the stable unique id for a joystick device */ -typedef struct { - Uint8 data[16]; -} SDL_JoystickGUID; - -/** - * This is a unique ID for a joystick for the time it is connected to the system, - * and is never reused for the lifetime of the application. If the joystick is - * disconnected and reconnected, it will get a new ID. - * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. - */ -typedef Sint32 SDL_JoystickID; - -typedef enum -{ - SDL_JOYSTICK_TYPE_UNKNOWN, - SDL_JOYSTICK_TYPE_GAMECONTROLLER, - SDL_JOYSTICK_TYPE_WHEEL, - SDL_JOYSTICK_TYPE_ARCADE_STICK, - SDL_JOYSTICK_TYPE_FLIGHT_STICK, - SDL_JOYSTICK_TYPE_DANCE_PAD, - SDL_JOYSTICK_TYPE_GUITAR, - SDL_JOYSTICK_TYPE_DRUM_KIT, - SDL_JOYSTICK_TYPE_ARCADE_PAD, - SDL_JOYSTICK_TYPE_THROTTLE -} SDL_JoystickType; - -typedef enum -{ - SDL_JOYSTICK_POWER_UNKNOWN = -1, - SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */ - SDL_JOYSTICK_POWER_LOW, /* <= 20% */ - SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */ - SDL_JOYSTICK_POWER_FULL, /* <= 100% */ - SDL_JOYSTICK_POWER_WIRED, - SDL_JOYSTICK_POWER_MAX -} SDL_JoystickPowerLevel; - -/* Function prototypes */ - -/** - * Locking for multi-threaded access to the joystick API - * - * If you are using the joystick API or handling events from multiple threads - * you should use these locking functions to protect access to the joysticks. - * - * In particular, you are guaranteed that the joystick list won't change, so - * the API functions that take a joystick index will be valid, and joystick - * and game controller events will not be delivered. - */ -extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); -extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); - -/** - * Count the number of joysticks attached to the system right now - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/** - * Get the implementation dependent name of a joystick. - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); - -/** - * Get the player index of a joystick, or -1 if it's not available - * This can be called before any joysticks are opened. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); - -/** - * Return the GUID for the joystick at this index - * This can be called before any joysticks are opened. - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); - -/** - * Get the USB vendor ID of a joystick, if available. - * This can be called before any joysticks are opened. - * If the vendor ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); - -/** - * Get the USB product ID of a joystick, if available. - * This can be called before any joysticks are opened. - * If the product ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); - -/** - * Get the product version of a joystick, if available. - * This can be called before any joysticks are opened. - * If the product version isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index); - -/** - * Get the type of a joystick, if available. - * This can be called before any joysticks are opened. - */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index); - -/** - * Get the instance ID of a joystick. - * This can be called before any joysticks are opened. - * If the index is out of range, this function will return -1. - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index); - -/** - * Open a joystick for use. - * The index passed as an argument refers to the N'th joystick on the system. - * This index is not the value which will identify this joystick in future - * joystick events. The joystick's instance id (::SDL_JoystickID) will be used - * there instead. - * - * \return A joystick identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); - -/** - * Return the SDL_Joystick associated with an instance id. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); - -/** - * Return the SDL_Joystick associated with a player index. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); - -/** - * Return the name for this currently opened joystick. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); - -/** - * Get the player index of an opened joystick, or -1 if it's not available - * - * For XInput controllers this returns the XInput user index. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); - -/** - * Set the player index of an opened joystick - */ -extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); - -/** - * Return the GUID for this opened joystick - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); - -/** - * Get the USB vendor ID of an opened joystick, if available. - * If the vendor ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); - -/** - * Get the USB product ID of an opened joystick, if available. - * If the product ID isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); - -/** - * Get the product version of an opened joystick, if available. - * If the product version isn't available this function returns 0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); - -/** - * Get the type of an opened joystick. - */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); - -/** - * Return a string representation for this guid. pszGUID must point to at least 33 bytes - * (32 for the string plus a NULL terminator). - */ -extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); - -/** - * Convert a string into a joystick guid - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); - -/** - * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); - -/** - * Get the instance ID of an opened joystick or -1 if the joystick is invalid. - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); - -/** - * Get the number of general axis controls on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); - -/** - * Get the number of trackballs on a joystick. - * - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); - -/** - * Get the number of POV hats on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); - -/** - * Get the number of buttons on a joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); - -/** - * Update the current state of the open joysticks. - * - * This is called automatically by the event loop if any joystick - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/** - * Enable/disable joystick event polling. - * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. - * - * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -#define SDL_JOYSTICK_AXIS_MAX 32767 -#define SDL_JOYSTICK_AXIS_MIN -32768 -/** - * Get the current state of an axis control on a joystick. - * - * The state is a value ranging from -32768 to 32767. - * - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, - int axis); - -/** - * Get the initial state of an axis control on a joystick. - * - * The state is a value ranging from -32768 to 32767. - * - * The axis indices start at index 0. - * - * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, - int axis, Sint16 *state); - -/** - * \name Hat positions - */ -/* @{ */ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/* @} */ - -/** - * Get the current state of a POV hat on a joystick. - * - * The hat indices start at index 0. - * - * \return The return value is one of the following positions: - * - ::SDL_HAT_CENTERED - * - ::SDL_HAT_UP - * - ::SDL_HAT_RIGHT - * - ::SDL_HAT_DOWN - * - ::SDL_HAT_LEFT - * - ::SDL_HAT_RIGHTUP - * - ::SDL_HAT_RIGHTDOWN - * - ::SDL_HAT_LEFTUP - * - ::SDL_HAT_LEFTDOWN - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, - int hat); - -/** - * Get the ball axis change since the last poll. - * - * \return 0, or -1 if you passed it invalid parameters. - * - * The ball indices start at index 0. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, - int ball, int *dx, int *dy); - -/** - * Get the current state of a button on a joystick. - * - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, - int button); - -/** - * Trigger a rumble effect - * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. - * - * \param joystick The joystick to vibrate - * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF - * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * - * \return 0, or -1 if rumble isn't supported on this joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); - -/** - * Close a joystick previously opened with SDL_JoystickOpen(). - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); - -/** - * Return the battery level of this joystick - */ -extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_joystick_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_keyboard.h b/Windows/SDL2/include/SDL_keyboard.h deleted file mode 100644 index 4b2a055d..00000000 --- a/Windows/SDL2/include/SDL_keyboard.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_keyboard.h - * - * Include file for SDL keyboard event handling - */ - -#ifndef SDL_keyboard_h_ -#define SDL_keyboard_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keycode.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The SDL keysym structure, used in key events. - * - * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. - */ -typedef struct SDL_Keysym -{ - SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ - SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ - Uint16 mod; /**< current key modifiers */ - Uint32 unused; -} SDL_Keysym; - -/* Function prototypes */ - -/** - * \brief Get the window which currently has keyboard focus. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); - -/** - * \brief Get a snapshot of the current state of the keyboard. - * - * \param numkeys if non-NULL, receives the length of the returned array. - * - * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. - * - * \b Example: - * \code - * const Uint8 *state = SDL_GetKeyboardState(NULL); - * if ( state[SDL_SCANCODE_RETURN] ) { - * printf("<RETURN> is pressed.\n"); - * } - * \endcode - */ -extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); - -/** - * \brief Get the current key modifier state for the keyboard. - */ -extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); - -/** - * \brief Set the current key modifier state for the keyboard. - * - * \note This does not change the keyboard state, only the key modifier flags. - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); - -/** - * \brief Get the key code corresponding to the given scancode according - * to the current keyboard layout. - * - * See ::SDL_Keycode for details. - * - * \sa SDL_GetKeyName() - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); - -/** - * \brief Get the scancode corresponding to the given key code according to the - * current keyboard layout. - * - * See ::SDL_Scancode for details. - * - * \sa SDL_GetScancodeName() - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); - -/** - * \brief Get a human-readable name for a scancode. - * - * \return A pointer to the name for the scancode. - * If the scancode doesn't have a name, this function returns - * an empty string (""). - * - * \sa SDL_Scancode - */ -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); - -/** - * \brief Get a scancode from a human-readable name - * - * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized - * - * \sa SDL_Scancode - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); - -/** - * \brief Get a human-readable name for a key. - * - * \return A pointer to a UTF-8 string that stays valid at least until the next - * call to this function. If you need it around any longer, you must - * copy it. If the key doesn't have a name, this function returns an - * empty string (""). - * - * \sa SDL_Keycode - */ -extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); - -/** - * \brief Get a key code from a human-readable name - * - * \return key code, or SDLK_UNKNOWN if the name wasn't recognized - * - * \sa SDL_Keycode - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); - -/** - * \brief Start accepting Unicode text input events. - * This function will show the on-screen keyboard if supported. - * - * \sa SDL_StopTextInput() - * \sa SDL_SetTextInputRect() - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC void SDLCALL SDL_StartTextInput(void); - -/** - * \brief Return whether or not Unicode text input events are enabled. - * - * \sa SDL_StartTextInput() - * \sa SDL_StopTextInput() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); - -/** - * \brief Stop receiving any text input events. - * This function will hide the on-screen keyboard if supported. - * - * \sa SDL_StartTextInput() - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC void SDLCALL SDL_StopTextInput(void); - -/** - * \brief Set the rectangle used to type Unicode text inputs. - * This is used as a hint for IME and on-screen keyboard placement. - * - * \sa SDL_StartTextInput() - */ -extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); - -/** - * \brief Returns whether the platform has some screen keyboard support. - * - * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. - * - * \note Not all screen keyboard functions are supported on all platforms. - * - * \sa SDL_IsScreenKeyboardShown() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); - -/** - * \brief Returns whether the screen keyboard is shown for given window. - * - * \param window The window for which screen keyboard should be queried. - * - * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. - * - * \sa SDL_HasScreenKeyboardSupport() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_keyboard_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_keycode.h b/Windows/SDL2/include/SDL_keycode.h deleted file mode 100644 index 64b72dd3..00000000 --- a/Windows/SDL2/include/SDL_keycode.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_keycode.h - * - * Defines constants which identify keyboard keys and modifiers. - */ - -#ifndef SDL_keycode_h_ -#define SDL_keycode_h_ - -#include "SDL_stdinc.h" -#include "SDL_scancode.h" - -/** - * \brief The SDL virtual key representation. - * - * Values of this type are used to represent keyboard keys using the current - * layout of the keyboard. These values include Unicode values representing - * the unmodified character that would be generated by pressing the key, or - * an SDLK_* constant for those keys that do not generate characters. - * - * A special exception is the number keys at the top of the keyboard which - * always map to SDLK_0...SDLK_9, regardless of layout. - */ -typedef Sint32 SDL_Keycode; - -#define SDLK_SCANCODE_MASK (1<<30) -#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) - -typedef enum -{ - SDLK_UNKNOWN = 0, - - SDLK_RETURN = '\r', - SDLK_ESCAPE = '\033', - SDLK_BACKSPACE = '\b', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - SDLK_EXCLAIM = '!', - SDLK_QUOTEDBL = '"', - SDLK_HASH = '#', - SDLK_PERCENT = '%', - SDLK_DOLLAR = '$', - SDLK_AMPERSAND = '&', - SDLK_QUOTE = '\'', - SDLK_LEFTPAREN = '(', - SDLK_RIGHTPAREN = ')', - SDLK_ASTERISK = '*', - SDLK_PLUS = '+', - SDLK_COMMA = ',', - SDLK_MINUS = '-', - SDLK_PERIOD = '.', - SDLK_SLASH = '/', - SDLK_0 = '0', - SDLK_1 = '1', - SDLK_2 = '2', - SDLK_3 = '3', - SDLK_4 = '4', - SDLK_5 = '5', - SDLK_6 = '6', - SDLK_7 = '7', - SDLK_8 = '8', - SDLK_9 = '9', - SDLK_COLON = ':', - SDLK_SEMICOLON = ';', - SDLK_LESS = '<', - SDLK_EQUALS = '=', - SDLK_GREATER = '>', - SDLK_QUESTION = '?', - SDLK_AT = '@', - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = '[', - SDLK_BACKSLASH = '\\', - SDLK_RIGHTBRACKET = ']', - SDLK_CARET = '^', - SDLK_UNDERSCORE = '_', - SDLK_BACKQUOTE = '`', - SDLK_a = 'a', - SDLK_b = 'b', - SDLK_c = 'c', - SDLK_d = 'd', - SDLK_e = 'e', - SDLK_f = 'f', - SDLK_g = 'g', - SDLK_h = 'h', - SDLK_i = 'i', - SDLK_j = 'j', - SDLK_k = 'k', - SDLK_l = 'l', - SDLK_m = 'm', - SDLK_n = 'n', - SDLK_o = 'o', - SDLK_p = 'p', - SDLK_q = 'q', - SDLK_r = 'r', - SDLK_s = 's', - SDLK_t = 't', - SDLK_u = 'u', - SDLK_v = 'v', - SDLK_w = 'w', - SDLK_x = 'x', - SDLK_y = 'y', - SDLK_z = 'z', - - SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), - - SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), - SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), - SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), - SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), - SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), - SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), - SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), - SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), - SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), - SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), - SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), - SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), - - SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), - SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), - SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), - SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), - SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), - SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), - SDLK_DELETE = '\177', - SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), - SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), - SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), - SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), - SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), - SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), - - SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), - SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), - SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), - SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), - SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), - SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), - SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), - SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), - SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), - SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), - SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), - SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), - SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), - SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), - SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), - SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), - SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), - - SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), - SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), - SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), - SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), - SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), - SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), - SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), - SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), - SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), - SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), - SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), - SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), - SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), - SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), - SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), - SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), - SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), - SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), - SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), - SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), - SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), - SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), - SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), - SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), - SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), - SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), - SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), - SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), - SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), - SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), - SDLK_KP_EQUALSAS400 = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), - - SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), - SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), - SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), - SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), - SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), - SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), - SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), - SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), - SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), - SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), - SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), - SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), - - SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), - SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), - SDLK_THOUSANDSSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), - SDLK_DECIMALSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), - SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), - SDLK_CURRENCYSUBUNIT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), - SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), - SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), - SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), - SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), - SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), - SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), - SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), - SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), - SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), - SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), - SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), - SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), - SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), - SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), - SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), - SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), - SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), - SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), - SDLK_KP_DBLAMPERSAND = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), - SDLK_KP_VERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), - SDLK_KP_DBLVERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), - SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), - SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), - SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), - SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), - SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), - SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), - SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), - SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), - SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), - SDLK_KP_MEMSUBTRACT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), - SDLK_KP_MEMMULTIPLY = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), - SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), - SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), - SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), - SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), - SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), - SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), - SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), - SDLK_KP_HEXADECIMAL = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), - - SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), - SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), - SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), - SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), - SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), - SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), - SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), - SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), - - SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), - - SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), - SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), - SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), - SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), - SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), - SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), - SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), - SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), - SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), - SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), - SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), - SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), - SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), - SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), - SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), - SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), - SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), - - SDLK_BRIGHTNESSDOWN = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), - SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), - SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), - SDLK_KBDILLUMTOGGLE = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), - SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), - SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), - SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), - SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP), - SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1), - SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2), - - SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND), - SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD) -} SDL_KeyCode; - -/** - * \brief Enumeration of valid key mods (possibly OR'd together). - */ -typedef enum -{ - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDL_Keymod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) - -#endif /* SDL_keycode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_loadso.h b/Windows/SDL2/include/SDL_loadso.h deleted file mode 100644 index 793ba535..00000000 --- a/Windows/SDL2/include/SDL_loadso.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_loadso.h - * - * System dependent library loading routines - * - * Some things to keep in mind: - * \li These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * \li Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * \li Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - -#ifndef SDL_loadso_h_ -#define SDL_loadso_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. - */ -extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); - -/** - * Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). - */ -extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, - const char *name); - -/** - * Unload a shared object from memory. - */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_loadso_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_log.h b/Windows/SDL2/include/SDL_log.h deleted file mode 100644 index 430e4fd0..00000000 --- a/Windows/SDL2/include/SDL_log.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_log.h - * - * Simple log messages with categories and priorities. - * - * By default logs are quiet, but if you're debugging SDL you might want: - * - * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); - * - * Here's where the messages go on different platforms: - * Windows: debug output stream - * Android: log output - * Others: standard error output (stderr) - */ - -#ifndef SDL_log_h_ -#define SDL_log_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief The maximum size of a log message - * - * Messages longer than the maximum size will be truncated - */ -#define SDL_MAX_LOG_MESSAGE 4096 - -/** - * \brief The predefined log categories - * - * By default the application category is enabled at the INFO level, - * the assert category is enabled at the WARN level, test is enabled - * at the VERBOSE level and all other categories are enabled at the - * CRITICAL level. - */ -typedef enum -{ - SDL_LOG_CATEGORY_APPLICATION, - SDL_LOG_CATEGORY_ERROR, - SDL_LOG_CATEGORY_ASSERT, - SDL_LOG_CATEGORY_SYSTEM, - SDL_LOG_CATEGORY_AUDIO, - SDL_LOG_CATEGORY_VIDEO, - SDL_LOG_CATEGORY_RENDER, - SDL_LOG_CATEGORY_INPUT, - SDL_LOG_CATEGORY_TEST, - - /* Reserved for future SDL library use */ - SDL_LOG_CATEGORY_RESERVED1, - SDL_LOG_CATEGORY_RESERVED2, - SDL_LOG_CATEGORY_RESERVED3, - SDL_LOG_CATEGORY_RESERVED4, - SDL_LOG_CATEGORY_RESERVED5, - SDL_LOG_CATEGORY_RESERVED6, - SDL_LOG_CATEGORY_RESERVED7, - SDL_LOG_CATEGORY_RESERVED8, - SDL_LOG_CATEGORY_RESERVED9, - SDL_LOG_CATEGORY_RESERVED10, - - /* Beyond this point is reserved for application use, e.g. - enum { - MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, - MYAPP_CATEGORY_AWESOME2, - MYAPP_CATEGORY_AWESOME3, - ... - }; - */ - SDL_LOG_CATEGORY_CUSTOM -} SDL_LogCategory; - -/** - * \brief The predefined log priorities - */ -typedef enum -{ - SDL_LOG_PRIORITY_VERBOSE = 1, - SDL_LOG_PRIORITY_DEBUG, - SDL_LOG_PRIORITY_INFO, - SDL_LOG_PRIORITY_WARN, - SDL_LOG_PRIORITY_ERROR, - SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES -} SDL_LogPriority; - - -/** - * \brief Set the priority of all log categories - */ -extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); - -/** - * \brief Set the priority of a particular log category - */ -extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, - SDL_LogPriority priority); - -/** - * \brief Get the priority of a particular log category - */ -extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); - -/** - * \brief Reset all priorities to default. - * - * \note This is called in SDL_Quit(). - */ -extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); - -/** - * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO - */ -extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE - */ -extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_DEBUG - */ -extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_INFO - */ -extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_WARN - */ -extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_ERROR - */ -extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL - */ -extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Log a message with the specified category and priority. - */ -extern DECLSPEC void SDLCALL SDL_LogMessage(int category, - SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); - -/** - * \brief Log a message with the specified category and priority. - */ -extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, - SDL_LogPriority priority, - const char *fmt, va_list ap); - -/** - * \brief The prototype for the log output function - */ -typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); - -/** - * \brief Get the current log output function. - */ -extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); - -/** - * \brief This function allows you to replace the default log output - * function with one of your own. - */ -extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_log_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_main.h b/Windows/SDL2/include/SDL_main.h deleted file mode 100644 index 623f2d00..00000000 --- a/Windows/SDL2/include/SDL_main.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_main_h_ -#define SDL_main_h_ - -#include "SDL_stdinc.h" - -/** - * \file SDL_main.h - * - * Redefine main() on some platforms so that it is called by SDL. - */ - -#ifndef SDL_MAIN_HANDLED -#if defined(__WIN32__) -/* On Windows SDL provides WinMain(), which parses the command line and passes - the arguments to your main function. - - If you provide your own WinMain(), you may define SDL_MAIN_HANDLED - */ -#define SDL_MAIN_AVAILABLE - -#elif defined(__WINRT__) -/* On WinRT, SDL provides a main function that initializes CoreApplication, - creating an instance of IFrameworkView in the process. - - Please note that #include'ing SDL_main.h is not enough to get a main() - function working. In non-XAML apps, the file, - src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled - into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be - called, with a pointer to the Direct3D-hosted XAML control passed in. -*/ -#define SDL_MAIN_NEEDED - -#elif defined(__IPHONEOS__) -/* On iOS SDL provides a main function that creates an application delegate - and starts the iOS application run loop. - - If you link with SDL dynamically on iOS, the main function can't be in a - shared library, so you need to link with libSDLmain.a, which includes a - stub main function that calls into the shared library to start execution. - - See src/video/uikit/SDL_uikitappdelegate.m for more details. - */ -#define SDL_MAIN_NEEDED - -#elif defined(__ANDROID__) -/* On Android SDL provides a Java class in SDLActivity.java that is the - main activity entry point. - - See docs/README-android.md for more details on extending that class. - */ -#define SDL_MAIN_NEEDED - -/* We need to export SDL_main so it can be launched from Java */ -#define SDLMAIN_DECLSPEC DECLSPEC - -#elif defined(__NACL__) -/* On NACL we use ppapi_simple to set up the application helper code, - then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before - starting the user main function. - All user code is run in a separate thread by ppapi_simple, thus - allowing for blocking io to take place via nacl_io -*/ -#define SDL_MAIN_NEEDED - -#endif -#endif /* SDL_MAIN_HANDLED */ - -#ifndef SDLMAIN_DECLSPEC -#define SDLMAIN_DECLSPEC -#endif - -/** - * \file SDL_main.h - * - * The application's main() function must be called with C linkage, - * and should be declared like this: - * \code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * \endcode - */ - -#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) -#define main SDL_main -#endif - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The prototype for the application's main() function - */ -typedef int (*SDL_main_func)(int argc, char *argv[]); -extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); - - -/** - * This is called by the real SDL main function to let the rest of the - * library know that initialization was done properly. - * - * Calling this yourself without knowing what you're doing can cause - * crashes and hard to diagnose problems with your application. - */ -extern DECLSPEC void SDLCALL SDL_SetMainReady(void); - -#ifdef __WIN32__ - -/** - * This can be called to set the application class at startup - */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); - -#endif /* __WIN32__ */ - - -#ifdef __WINRT__ - -/** - * \brief Initializes and launches an SDL/WinRT application. - * - * \param mainFunction The SDL app's C-style main(). - * \param reserved Reserved for future use; should be NULL - * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more - * information on the failure. - */ -extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); - -#endif /* __WINRT__ */ - -#if defined(__IPHONEOS__) - -/** - * \brief Initializes and launches an SDL application. - * - * \param argc The argc parameter from the application's main() function - * \param argv The argv parameter from the application's main() function - * \param mainFunction The SDL app's C-style main(). - * \return the return value from mainFunction - */ -extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); - -#endif /* __IPHONEOS__ */ - - -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_main_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_messagebox.h b/Windows/SDL2/include/SDL_messagebox.h deleted file mode 100644 index bf50deb9..00000000 --- a/Windows/SDL2/include/SDL_messagebox.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_messagebox_h_ -#define SDL_messagebox_h_ - -#include "SDL_stdinc.h" -#include "SDL_video.h" /* For SDL_Window */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SDL_MessageBox flags. If supported will display warning icon, etc. - */ -typedef enum -{ - SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ - SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ - SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */ - SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */ - SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */ -} SDL_MessageBoxFlags; - -/** - * \brief Flags for SDL_MessageBoxButtonData. - */ -typedef enum -{ - SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ - SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ -} SDL_MessageBoxButtonFlags; - -/** - * \brief Individual button data. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ - int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ - const char * text; /**< The UTF-8 button text */ -} SDL_MessageBoxButtonData; - -/** - * \brief RGB value used in a message box color scheme - */ -typedef struct -{ - Uint8 r, g, b; -} SDL_MessageBoxColor; - -typedef enum -{ - SDL_MESSAGEBOX_COLOR_BACKGROUND, - SDL_MESSAGEBOX_COLOR_TEXT, - SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, - SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, - SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, - SDL_MESSAGEBOX_COLOR_MAX -} SDL_MessageBoxColorType; - -/** - * \brief A set of colors to use for message box dialogs - */ -typedef struct -{ - SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; -} SDL_MessageBoxColorScheme; - -/** - * \brief MessageBox structure containing title, text, window, etc. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxFlags */ - SDL_Window *window; /**< Parent window, can be NULL */ - const char *title; /**< UTF-8 title */ - const char *message; /**< UTF-8 message text */ - - int numbuttons; - const SDL_MessageBoxButtonData *buttons; - - const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ -} SDL_MessageBoxData; - -/** - * \brief Create a modal message box. - * - * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. - * \param buttonid The pointer to which user id of hit button should be copied. - * - * \return -1 on error, otherwise 0 and buttonid contains user id of button - * hit or -1 if dialog was closed. - * - * \note This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or - * closes the messagebox. - */ -extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); - -/** - * \brief Create a simple modal message box - * - * \param flags ::SDL_MessageBoxFlags - * \param title UTF-8 title text - * \param message UTF-8 message text - * \param window The parent window, or NULL for no parent - * - * \return 0 on success, -1 on error - * - * \sa SDL_ShowMessageBox - */ -extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_messagebox_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_metal.h b/Windows/SDL2/include/SDL_metal.h deleted file mode 100644 index 0f1e0e94..00000000 --- a/Windows/SDL2/include/SDL_metal.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_metal.h - * - * Header file for functions to creating Metal layers and views on SDL windows. - */ - -#ifndef SDL_metal_h_ -#define SDL_metal_h_ - -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). - * - * \note This can be cast directly to an NSView or UIView. - */ -typedef void *SDL_MetalView; - -/** - * \name Metal support functions - */ -/* @{ */ - -/** - * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the - * specified window. - * - * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its - * own. It is up to user code to do that. - * - * The returned handle can be casted directly to a NSView or UIView, and the - * CAMetalLayer can be accessed from the view's 'layer' property. - * - * \code - * SDL_MetalView metalview = SDL_Metal_CreateView(window); - * UIView *uiview = (__bridge UIView *)metalview; - * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; - * // [...] - * SDL_Metal_DestroyView(metalview); - * \endcode - * - * \sa SDL_Metal_DestroyView - */ -extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); - -/** - * \brief Destroy an existing SDL_MetalView object. - * - * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was - * called after SDL_CreateWindow. - * - * \sa SDL_Metal_CreateView - */ -extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); - -/* @} *//* Metal support functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_metal_h_ */ diff --git a/Windows/SDL2/include/SDL_mouse.h b/Windows/SDL2/include/SDL_mouse.h deleted file mode 100644 index 277559d2..00000000 --- a/Windows/SDL2/include/SDL_mouse.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_mouse.h - * - * Include file for SDL mouse event handling. - */ - -#ifndef SDL_mouse_h_ -#define SDL_mouse_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ - -/** - * \brief Cursor types for SDL_CreateSystemCursor(). - */ -typedef enum -{ - SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ - SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ - SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ - SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ - SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ - SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ - SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ - SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ - SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ - SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ - SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ - SDL_SYSTEM_CURSOR_HAND, /**< Hand */ - SDL_NUM_SYSTEM_CURSORS -} SDL_SystemCursor; - -/** - * \brief Scroll direction types for the Scroll event - */ -typedef enum -{ - SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ - SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ -} SDL_MouseWheelDirection; - -/* Function prototypes */ - -/** - * \brief Get the window which currently has mouse focus. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); - -/** - * \brief Retrieve the current state of the mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse cursor position relative to the focus window for the currently - * selected mouse. You can pass NULL for either x or y. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); - -/** - * \brief Get the current state of the mouse, in relation to the desktop - * - * This works just like SDL_GetMouseState(), but the coordinates will be - * reported relative to the top-left of the desktop. This can be useful if - * you need to track the mouse outside of a specific window and - * SDL_CaptureMouse() doesn't fit your needs. For example, it could be - * useful if you need to track the mouse while dragging a window, where - * coordinates relative to a window might not be in sync at all times. - * - * \note SDL_GetMouseState() returns the mouse position as SDL understands - * it from the last pump of the event queue. This function, however, - * queries the OS for the current mouse position, and as such, might - * be a slightly less efficient function. Unless you know what you're - * doing and have a good reason to use this function, you probably want - * SDL_GetMouseState() instead. - * - * \param x Returns the current X coord, relative to the desktop. Can be NULL. - * \param y Returns the current Y coord, relative to the desktop. Can be NULL. - * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros. - * - * \sa SDL_GetMouseState - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); - -/** - * \brief Retrieve the relative state of the mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); - -/** - * \brief Moves the mouse to the given position within the window. - * - * \param window The window to move the mouse into, or NULL for the current mouse focus - * \param x The x coordinate within the window - * \param y The y coordinate within the window - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, - int x, int y); - -/** - * \brief Moves the mouse to the given position in global screen space. - * - * \param x The x coordinate - * \param y The y coordinate - * \return 0 on success, -1 on error (usually: unsupported by a platform). - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); - -/** - * \brief Set relative mouse mode. - * - * \param enabled Whether or not to enable relative mode - * - * \return 0 on success, or -1 if relative mode is not supported. - * - * While the mouse is in relative mode, the cursor is hidden, and the - * driver will try to report continuous motion in the current window. - * Only relative motion events will be delivered, the mouse position - * will not change. - * - * \note This function will flush any pending mouse motion. - * - * \sa SDL_GetRelativeMouseMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); - -/** - * \brief Capture the mouse, to track input outside an SDL window. - * - * \param enabled Whether or not to enable capturing - * - * Capturing enables your app to obtain mouse events globally, instead of - * just within your window. Not all video targets support this function. - * When capturing is enabled, the current window will get all mouse events, - * but unlike relative mode, no change is made to the cursor and it is - * not restrained to your window. - * - * This function may also deny mouse input to other windows--both those in - * your application and others on the system--so you should use this - * function sparingly, and in small bursts. For example, you might want to - * track the mouse while the user is dragging something, until the user - * releases a mouse button. It is not recommended that you capture the mouse - * for long periods of time, such as the entire time your app is running. - * - * While captured, mouse events still report coordinates relative to the - * current (foreground) window, but those coordinates may be outside the - * bounds of the window (including negative values). Capturing is only - * allowed for the foreground window. If the window loses focus while - * capturing, the capture will be disabled automatically. - * - * While capturing is enabled, the current window will have the - * SDL_WINDOW_MOUSE_CAPTURE flag set. - * - * \return 0 on success, or -1 if not supported. - */ -extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); - -/** - * \brief Query whether relative mouse mode is enabled. - * - * \sa SDL_SetRelativeMouseMode() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); - -/** - * \brief Create a cursor, using the specified bitmap data and - * mask (in MSB format). - * - * The cursor width must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * <table> - * <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr> - * <tr><td> 0 </td><td> 1 </td><td> White </td></tr> - * <tr><td> 1 </td><td> 1 </td><td> Black </td></tr> - * <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr> - * <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black - * if not. </td></tr> - * </table> - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, - const Uint8 * mask, - int w, int h, int hot_x, - int hot_y); - -/** - * \brief Create a color cursor. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, - int hot_x, - int hot_y); - -/** - * \brief Create a system cursor. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); - -/** - * \brief Set the active cursor. - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); - -/** - * \brief Return the active cursor. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); - -/** - * \brief Return the default cursor. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); - -/** - * \brief Frees a cursor created with SDL_CreateCursor() or similar functions. - * - * \sa SDL_CreateCursor() - * \sa SDL_CreateColorCursor() - * \sa SDL_CreateSystemCursor() - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); - -/** - * \brief Toggle whether or not the cursor is shown. - * - * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current - * state. - * - * \return 1 if the cursor is shown, or 0 if the cursor is hidden. - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/** - * Used as a mask when testing buttons in buttonstate. - * - Button 1: Left mouse button - * - Button 2: Middle mouse button - * - Button 3: Right mouse button - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_X1 4 -#define SDL_BUTTON_X2 5 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_mouse_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_mutex.h b/Windows/SDL2/include/SDL_mutex.h deleted file mode 100644 index 970e7871..00000000 --- a/Windows/SDL2/include/SDL_mutex.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_mutex_h_ -#define SDL_mutex_h_ - -/** - * \file SDL_mutex.h - * - * Functions to provide thread synchronization primitives. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Synchronization functions which can time out return this value - * if they time out. - */ -#define SDL_MUTEX_TIMEDOUT 1 - -/** - * This is the timeout value which corresponds to never time out. - */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/** - * \name Mutex functions - */ -/* @{ */ - -/* The SDL mutex structure, defined in SDL_sysmutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/** - * Create a mutex, initialized unlocked. - */ -extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); - -/** - * Lock the mutex. - * - * \return 0, or -1 on error. - */ -#define SDL_mutexP(m) SDL_LockMutex(m) -extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); - -/** - * Try to lock the mutex - * - * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); - -/** - * Unlock the mutex. - * - * \return 0, or -1 on error. - * - * \warning It is an error to unlock a mutex that has not been locked by - * the current thread, and doing so results in undefined behavior. - */ -#define SDL_mutexV(m) SDL_UnlockMutex(m) -extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); - -/** - * Destroy a mutex. - */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); - -/* @} *//* Mutex functions */ - - -/** - * \name Semaphore functions - */ -/* @{ */ - -/* The SDL semaphore structure, defined in SDL_syssem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/** - * Create a semaphore, initialized with value, returns NULL on failure. - */ -extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/** - * Destroy a semaphore. - */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); - -/** - * This function suspends the calling thread until the semaphore pointed - * to by \c sem has a positive count. It then atomically decreases the - * semaphore count. - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); - -/** - * Non-blocking variant of SDL_SemWait(). - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would - * block, and -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); - -/** - * Variant of SDL_SemWait() with a timeout in milliseconds. - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not - * succeed in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a - * delay of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); - -/** - * Atomically increases the semaphore's count (not blocking). - * - * \return 0, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); - -/** - * Returns the current count of the semaphore. - */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); - -/* @} *//* Semaphore functions */ - - -/** - * \name Condition variable functions - */ -/* @{ */ - -/* The SDL condition variable structure, defined in SDL_syscond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; - -/** - * Create a condition variable. - * - * Typical use of condition variables: - * - * Thread A: - * SDL_LockMutex(lock); - * while ( ! condition ) { - * SDL_CondWait(cond, lock); - * } - * SDL_UnlockMutex(lock); - * - * Thread B: - * SDL_LockMutex(lock); - * ... - * condition = true; - * ... - * SDL_CondSignal(cond); - * SDL_UnlockMutex(lock); - * - * There is some discussion whether to signal the condition variable - * with the mutex locked or not. There is some potential performance - * benefit to unlocking first on some platforms, but there are some - * potential race conditions depending on how your code is structured. - * - * In general it's safer to signal the condition variable while the - * mutex is locked. - */ -extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); - -/** - * Destroy a condition variable. - */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); - -/** - * Restart one of the threads that are waiting on the condition variable. - * - * \return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); - -/** - * Restart all threads that are waiting on the condition variable. - * - * \return 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); - -/** - * Wait on the condition variable, unlocking the provided mutex. - * - * \warning The mutex must be locked before entering this function! - * - * The mutex is re-locked once the condition variable is signaled. - * - * \return 0 when it is signaled, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); - -/** - * Waits for at most \c ms milliseconds, and returns 0 if the condition - * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not - * signaled in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a - * delay of 1 ms, and so should be avoided if possible. - */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, - SDL_mutex * mutex, Uint32 ms); - -/* @} *//* Condition variable functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_mutex_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_name.h b/Windows/SDL2/include/SDL_name.h deleted file mode 100644 index 690a8199..00000000 --- a/Windows/SDL2/include/SDL_name.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDLname_h_ -#define SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* SDLname_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_opengl.h b/Windows/SDL2/include/SDL_opengl.h deleted file mode 100644 index 6685be73..00000000 --- a/Windows/SDL2/include/SDL_opengl.h +++ /dev/null @@ -1,2183 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengl.h - * - * This is a simple file to encapsulate the OpenGL API headers. - */ - -/** - * \def NO_SDL_GLEXT - * - * Define this if you have your own version of glext.h and want to disable the - * version included in SDL_opengl.h. - */ - -#ifndef SDL_opengl_h_ -#define SDL_opengl_h_ - -#include "SDL_config.h" - -#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ - -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef __gl_h_ -#define __gl_h_ - -#if defined(USE_MGL_NAMESPACE) -#include "gl_mangle.h" -#endif - - -/********************************************************************** - * Begin system-specific stuff. - */ - -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) -#define __WIN32__ -#endif - -#if defined(__WIN32__) && !defined(__CYGWIN__) -# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# endif /* _STATIC_MESA support */ -# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ -# define GLAPIENTRY -# else -# define GLAPIENTRY __stdcall -# endif -#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ -# define GLAPI extern -# define GLAPIENTRY __stdcall -#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */ -# define GLAPI extern -# define GLAPIENTRY _System -# define APIENTRY _System -# if defined(__GNUC__) && !defined(_System) -# define _System -# endif -#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define GLAPI __attribute__((visibility("default"))) -# define GLAPIENTRY -#endif /* WIN32 && !CYGWIN */ - -/* - * WINDOWS: Include windows.h here to define APIENTRY. - * It is also useful when applications include this file by - * including only glut.h, since glut.h depends on windows.h. - * Applications needing to include windows.h with parms other - * than "WIN32_LEAN_AND_MEAN" may include windows.h before - * glut.h or gl.h. - */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> -#endif - -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef APIENTRY -#define APIENTRY GLAPIENTRY -#endif - -/* "P" suffix to be used for a pointer to a function */ -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifndef GLAPIENTRYP -#define GLAPIENTRYP GLAPIENTRY * -#endif - -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export on -#endif - -/* - * End system-specific stuff. - **********************************************************************/ - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -#define GL_VERSION_1_1 1 -#define GL_VERSION_1_2 1 -#define GL_VERSION_1_3 1 -#define GL_ARB_imaging 1 - - -/* - * Datatypes - */ -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; /* 1-byte signed */ -typedef short GLshort; /* 2-byte signed */ -typedef int GLint; /* 4-byte signed */ -typedef unsigned char GLubyte; /* 1-byte unsigned */ -typedef unsigned short GLushort; /* 2-byte unsigned */ -typedef unsigned int GLuint; /* 4-byte unsigned */ -typedef int GLsizei; /* 4-byte signed */ -typedef float GLfloat; /* single precision float */ -typedef float GLclampf; /* single precision float in [0,1] */ -typedef double GLdouble; /* double precision float */ -typedef double GLclampd; /* double precision float in [0,1] */ - - - -/* - * Constants - */ - -/* Boolean values */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* Data types */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A - -/* Primitives */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON 0x0009 - -/* Vertex Arrays */ -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D - -/* Matrix Mode */ -#define GL_MATRIX_MODE 0x0BA0 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 - -/* Points */ -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_POINT_SIZE_RANGE 0x0B12 - -/* Lines */ -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_WIDTH_RANGE 0x0B22 - -/* Polygons */ -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 - -/* Display Lists */ -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_LIST_MODE 0x0B30 - -/* Depth buffer */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_BITS 0x0D56 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_COMPONENT 0x1902 - -/* Lighting */ -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_SHININESS 0x1601 -#define GL_EMISSION 0x1600 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_SHADE_MODEL 0x0B54 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_NORMALIZE 0x0BA1 - -/* User clipping planes */ -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 - -/* Accumulation buffer */ -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_ACCUM 0x0100 -#define GL_ADD 0x0104 -#define GL_LOAD 0x0101 -#define GL_MULT 0x0103 -#define GL_RETURN 0x0102 - -/* Alpha testing */ -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_ALPHA_TEST_FUNC 0x0BC1 - -/* Blending */ -#define GL_BLEND 0x0BE2 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND_DST 0x0BE0 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 - -/* Render Mode */ -#define GL_FEEDBACK 0x1C01 -#define GL_RENDER 0x1C00 -#define GL_SELECT 0x1C02 - -/* Feedback */ -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 - -/* Selection */ -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 - -/* Fog */ -#define GL_FOG 0x0B60 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_COLOR 0x0B66 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_LINEAR 0x2601 -#define GL_EXP 0x0800 -#define GL_EXP2 0x0801 - -/* Logic Ops */ -#define GL_LOGIC_OP 0x0BF1 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_CLEAR 0x1500 -#define GL_SET 0x150F -#define GL_COPY 0x1503 -#define GL_COPY_INVERTED 0x150C -#define GL_NOOP 0x1505 -#define GL_INVERT 0x150A -#define GL_AND 0x1501 -#define GL_NAND 0x150E -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_XOR 0x1506 -#define GL_EQUIV 0x1509 -#define GL_AND_REVERSE 0x1502 -#define GL_AND_INVERTED 0x1504 -#define GL_OR_REVERSE 0x150B -#define GL_OR_INVERTED 0x150D - -/* Stencil */ -#define GL_STENCIL_BITS 0x0D57 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_INDEX 0x1901 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 - -/* Buffers, Pixel Drawing/Reading */ -#define GL_NONE 0 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -/*GL_FRONT 0x0404 */ -/*GL_BACK 0x0405 */ -/*GL_FRONT_AND_BACK 0x0408 */ -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_COLOR_INDEX 0x1900 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_ALPHA_BITS 0x0D55 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_INDEX_BITS 0x0D51 -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_READ_BUFFER 0x0C02 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_BITMAP 0x1A00 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_DITHER 0x0BD0 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 - -/* Implementation limits */ -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B - -/* Gets */ -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_MODE 0x0C30 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_RENDER_MODE 0x0C40 -#define GL_RGBA_MODE 0x0C31 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_VIEWPORT 0x0BA2 - -/* Evaluators */ -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 - -/* Hints */ -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* Scissor box */ -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 - -/* Pixel Mode / Transfer */ -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 - -/* Texture mapping */ -#define GL_TEXTURE_ENV 0x2300 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_LINEAR 0x2400 -#define GL_EYE_PLANE 0x2502 -#define GL_SPHERE_MAP 0x2402 -#define GL_DECAL 0x2101 -#define GL_MODULATE 0x2100 -#define GL_NEAREST 0x2600 -#define GL_REPEAT 0x2901 -#define GL_CLAMP 0x2900 -#define GL_S 0x2000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 - -/* Utility */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* Errors */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 - -/* glPush/PopAttrib bits */ -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000FFFFF - - -/* OpenGL 1.1 */ -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - - - -/* - * Miscellaneous - */ - -GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); - -GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glClear( GLbitfield mask ); - -GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); - -GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); - -GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); - -GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); - -GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); - -GLAPI void GLAPIENTRY glCullFace( GLenum mode ); - -GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); - -GLAPI void GLAPIENTRY glPointSize( GLfloat size ); - -GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); - -GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); - -GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); - -GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); - -GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); - -GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); - -GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); - -GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); - -GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); - -GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); - -GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); - -GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glEnable( GLenum cap ); - -GLAPI void GLAPIENTRY glDisable( GLenum cap ); - -GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); - - -GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ - -GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ - - -GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); - -GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); - -GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); - -GLAPI void GLAPIENTRY glPopAttrib( void ); - - -GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ - -GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ - - -GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); - -GLAPI GLenum GLAPIENTRY glGetError( void ); - -GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); - -GLAPI void GLAPIENTRY glFinish( void ); - -GLAPI void GLAPIENTRY glFlush( void ); - -GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); - - -/* - * Depth Buffer - */ - -GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); - -GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); - -GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); - -GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); - - -/* - * Accumulation Buffer - */ - -GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); - -GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); - - -/* - * Transformation - */ - -GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); - -GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, - GLsizei width, GLsizei height ); - -GLAPI void GLAPIENTRY glPushMatrix( void ); - -GLAPI void GLAPIENTRY glPopMatrix( void ); - -GLAPI void GLAPIENTRY glLoadIdentity( void ); - -GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glRotated( GLdouble angle, - GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRotatef( GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); - - -/* - * Display Lists - */ - -GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); - -GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); - -GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); - -GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); - -GLAPI void GLAPIENTRY glEndList( void ); - -GLAPI void GLAPIENTRY glCallList( GLuint list ); - -GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, - const GLvoid *lists ); - -GLAPI void GLAPIENTRY glListBase( GLuint base ); - - -/* - * Drawing Functions - */ - -GLAPI void GLAPIENTRY glBegin( GLenum mode ); - -GLAPI void GLAPIENTRY glEnd( void ); - - -GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); -GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); -GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); -GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); -GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); - -GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); -GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glIndexd( GLdouble c ); -GLAPI void GLAPIENTRY glIndexf( GLfloat c ); -GLAPI void GLAPIENTRY glIndexi( GLint c ); -GLAPI void GLAPIENTRY glIndexs( GLshort c ); -GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); -GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); -GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); -GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); -GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); -GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); -GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); -GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); -GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); -GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); -GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); -GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); - -GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, - GLbyte blue, GLbyte alpha ); -GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, - GLdouble blue, GLdouble alpha ); -GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); -GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, - GLint blue, GLint alpha ); -GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, - GLshort blue, GLshort alpha ); -GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha ); -GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, - GLuint blue, GLuint alpha ); -GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, - GLushort blue, GLushort alpha ); - - -GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); - -GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); - - -GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); -GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); -GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); -GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); - -GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); -GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); -GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); -GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); -GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); -GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); -GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); -GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); -GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); -GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); -GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); -GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); -GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); - - -GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); -GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); -GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); -GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); - - -/* - * Vertex Arrays (1.1) - */ - -GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); - -GLAPI void GLAPIENTRY glArrayElement( GLint i ); - -GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); - -GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, - const GLvoid *pointer ); - -/* - * Lighting - */ - -GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); - -GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, - GLfloat *params ); -GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); - - -/* - * Raster functions - */ - -GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); - -GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, - const GLfloat *values ); -GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, - const GLuint *values ); -GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, - const GLushort *values ); - -GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); -GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); -GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); - -GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, - GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); - -GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLvoid *pixels ); - -GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type ); - -/* - * Stenciling - */ - -GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); - -GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); - -GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); - -GLAPI void GLAPIENTRY glClearStencil( GLint s ); - - - -/* - * Texture mapping - */ - -GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); -GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); -GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); -GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, - GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, - GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, - GLvoid *pixels ); - - -/* 1.1 functions */ - -GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, - const GLuint *textures, - const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, - const GLuint *textures, - GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); - - -GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, - GLint xoffset, - GLsizei width, GLenum format, - GLenum type, const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - -/* - * Evaluators - */ - -GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, - GLint stride, - GLint order, const GLdouble *points ); -GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, - GLint stride, - GLint order, const GLfloat *points ); - -GLAPI void GLAPIENTRY glMap2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); -GLAPI void GLAPIENTRY glMap2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); -GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); -GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); - -GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); -GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); - -GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); -GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); - -GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); -GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); - -GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); -GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); - -GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); - -GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); - -GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); - -GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - - -/* - * Fog - */ - -GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); - -GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); - -GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); - - -/* - * Selection and Feedback - */ - -GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); - -GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); - -GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); - -GLAPI void GLAPIENTRY glInitNames( void ); - -GLAPI void GLAPIENTRY glLoadName( GLuint name ); - -GLAPI void GLAPIENTRY glPushName( GLuint name ); - -GLAPI void GLAPIENTRY glPopName( void ); - - - -/* - * OpenGL 1.2 - */ - -#define GL_RESCALE_NORMAL 0x803A -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_TEXTURE_BINDING_3D 0x806A - -GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels); - -GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ); - -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - - -/* - * GL_ARB_imaging - */ - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_BLEND_EQUATION 0x8009 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ); - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ); - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ); - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ); - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ); - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height); - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ); - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ); - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); - - - - -/* - * OpenGL 1.3 - */ - -/* multitexture */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -/* texture_cube_map */ -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -/* texture_compression */ -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -/* multisample */ -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -/* transpose_matrix */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -/* texture_env_combine */ -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -/* texture_env_dot3 */ -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -/* texture_border_clamp */ -#define GL_CLAMP_TO_BORDER 0x812D - -GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); - -GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); - - -GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); - - -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); - - - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#endif /* GL_ARB_multitexture */ - - - -/* - * Define this token if you want "old-style" header file behaviour (extensions - * defined in gl.h). Otherwise, extensions will be included from glext.h. - */ -#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) -#include "SDL_opengl_glext.h" -#endif /* GL_GLEXT_LEGACY */ - - - -/* - * ???. GL_MESA_packed_depth_stencil - * XXX obsolete - */ -#ifndef GL_MESA_packed_depth_stencil -#define GL_MESA_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_MESA 0x8750 -#define GL_UNSIGNED_INT_24_8_MESA 0x8751 -#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 -#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 -#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 - -#endif /* GL_MESA_packed_depth_stencil */ - - -#ifndef GL_ATI_blend_equation_separate -#define GL_ATI_blend_equation_separate 1 - -#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D - -GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); - -#endif /* GL_ATI_blend_equation_separate */ - - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -typedef void* GLeglImageOES; -#endif - -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - - -/** - ** NOTE!!!!! If you add new functions to this file, or update - ** glext.h be sure to regenerate the gl_mangle.h file. See comments - ** in that file for details. - **/ - - - -/********************************************************************** - * Begin system-specific stuff - */ -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export off -#endif - -/* - * End system-specific stuff - **********************************************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif /* __gl_h_ */ - -#endif /* !__IPHONEOS__ */ - -#endif /* SDL_opengl_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_opengl_glext.h b/Windows/SDL2/include/SDL_opengl_glext.h deleted file mode 100644 index 6a402b15..00000000 --- a/Windows/SDL2/include/SDL_opengl_glext.h +++ /dev/null @@ -1,11180 +0,0 @@ -#ifndef __glext_h_ -#define __glext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2013-2014 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ -/* -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.opengl.org/registry/ -** -** Khronos $Revision: 26745 $ on $Date: 2014-05-21 03:12:26 -0700 (Wed, 21 May 2014) $ -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -#define GL_GLEXT_VERSION 20140521 - -/* Generated C header for: - * API: gl - * Profile: compatibility - * Versions considered: .* - * Versions emitted: 1\.[2-9]|[234]\.[0-9] - * Default extensions included: gl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_RESCALE_NORMAL 0x803A -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_VERSION_1_2 */ - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum texture); -GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); -GLAPI void APIENTRY glClientActiveTexture (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); -#endif -#endif /* GL_VERSION_1_3 */ - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); -GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); -GLAPI void APIENTRY glFogCoordf (GLfloat coord); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); -GLAPI void APIENTRY glFogCoordd (GLdouble coord); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2iv (const GLint *v); -GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); -GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3iv (const GLint *v); -GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); -GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void APIENTRY glBlendEquation (GLenum mode); -#endif -#endif /* GL_VERSION_1_4 */ - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#include <stddef.h> -#ifdef __MACOSX__ -typedef long GLsizeiptr; -typedef long GLintptr; -#else -typedef ptrdiff_t GLsizeiptr; -typedef ptrdiff_t GLintptr; -#endif -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SRC1_ALPHA 0x8589 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_FOG_COORD_SRC 0x8450 -#define GL_FOG_COORD 0x8451 -#define GL_CURRENT_FOG_COORD 0x8453 -#define GL_FOG_COORD_ARRAY_TYPE 0x8454 -#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORD_ARRAY_POINTER 0x8456 -#define GL_FOG_COORD_ARRAY 0x8457 -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D -#define GL_SRC0_RGB 0x8580 -#define GL_SRC1_RGB 0x8581 -#define GL_SRC2_RGB 0x8582 -#define GL_SRC0_ALPHA 0x8588 -#define GL_SRC2_ALPHA 0x858A -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); -typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQuery (GLuint id); -GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQuery (GLenum target); -GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); -GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); -GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_VERSION_1_5 */ - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -typedef char GLchar; -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_TEXTURE_COORDS 0x8871 -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); -GLAPI void APIENTRY glCompileShader (GLuint shader); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum type); -GLAPI void APIENTRY glDeleteProgram (GLuint program); -GLAPI void APIENTRY glDeleteShader (GLuint shader); -GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); -GLAPI GLboolean APIENTRY glIsProgram (GLuint program); -GLAPI GLboolean APIENTRY glIsShader (GLuint shader); -GLAPI void APIENTRY glLinkProgram (GLuint program); -GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -GLAPI void APIENTRY glUseProgram (GLuint program); -GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glValidateProgram (GLuint program); -GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -#endif -#endif /* GL_VERSION_2_0 */ - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_VERSION_2_1 */ - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -typedef unsigned short GLhalf; -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_INDEX 0x8222 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_HALF_FLOAT 0x140B -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_ALPHA_INTEGER 0x8D97 -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); -GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); -GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); -GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); -GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); -GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); -GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index); -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmap (GLenum target); -GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glBindVertexArray (GLuint array); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); -#endif -#endif /* GL_VERSION_3_0 */ - -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFFu -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); -GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); -GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#endif -#endif /* GL_VERSION_3_1 */ - -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -typedef struct __GLsync *GLsync; -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include <inttypes.h> -#elif defined(__sun__) || defined(__digital__) -#include <inttypes.h> -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include <inttypes.h> -#elif defined(__SCO__) || defined(__USLC__) -#include <stdint.h> -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include <stdint.h> -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include <inttypes.h> -#endif -#endif -typedef uint64_t GLuint64; -typedef int64_t GLint64; -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_DEPTH_CLAMP 0x864F -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); -typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); -typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -GLAPI void APIENTRY glProvokingVertex (GLenum mode); -GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); -GLAPI GLboolean APIENTRY glIsSync (GLsync sync); -GLAPI void APIENTRY glDeleteSync (GLsync sync); -GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); -GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); -GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); -#endif -#endif /* GL_VERSION_3_2 */ - -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_SAMPLER_BINDING 0x8919 -#define GL_RGB10_A2UI 0x906F -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 -#define GL_INT_2_10_10_10_REV 0x8D9F -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); -typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); -typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); -typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); -GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); -GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); -GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); -GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); -GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); -GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); -GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); -GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); -GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); -GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); -GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); -#endif -#endif /* GL_VERSION_3_3 */ - -#ifndef GL_VERSION_4_0 -#define GL_VERSION_4_0 1 -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_MAX_VERTEX_STREAMS 0x8E71 -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B -#define GL_PATCHES 0x000E -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); -typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); -typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); -typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); -typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); -typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShading (GLfloat value); -GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); -GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); -GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); -GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); -GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); -GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); -GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); -GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); -GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedback (void); -GLAPI void APIENTRY glResumeTransformFeedback (void); -GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); -GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); -GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); -GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); -GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); -#endif -#endif /* GL_VERSION_4_0 */ - -#ifndef GL_VERSION_4_1 -#define GL_VERSION_4_1 1 -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_RGB565 0x8D62 -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_ALL_SHADER_BITS 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings); -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); -typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); -GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GLAPI void APIENTRY glClearDepthf (GLfloat d); -GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings); -GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); -GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); -GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); -GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); -GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); -GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); -GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); -GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); -#endif -#endif /* GL_VERSION_4_1 */ - -#ifndef GL_VERSION_4_2 -#define GL_VERSION_4_2 1 -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#define GL_NUM_SAMPLE_COUNTS 0x9380 -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); -typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); -GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); -GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -#endif -#endif /* GL_VERSION_4_2 */ - -#ifndef GL_VERSION_4_3 -#define GL_VERSION_4_3 1 -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 -#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_MAX_UNIFORM_LOCATIONS 0x826E -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F -#define GL_IS_PER_PATCH 0x92E7 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF -#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_VERTEX_BINDING_BUFFER 0x8F4F -#define GL_DISPLAY_LIST 0x82E7 -typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); -typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); -typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); -typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); -GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); -GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); -GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); -GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); -GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); -GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); -GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GLAPI void APIENTRY glPopDebugGroup (void); -GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_VERSION_4_3 */ - -#ifndef GL_VERSION_4_4 -#define GL_VERSION_4_4 1 -#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_TEXTURE_BUFFER_BINDING 0x8C2A -#define GL_MAP_PERSISTENT_BIT 0x0040 -#define GL_MAP_COHERENT_BIT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT 0x0100 -#define GL_CLIENT_STORAGE_BIT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F -#define GL_BUFFER_STORAGE_FLAGS 0x8220 -#define GL_CLEAR_TEXTURE 0x9365 -#define GL_LOCATION_COMPONENT 0x934A -#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B -#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C -#define GL_QUERY_BUFFER 0x9192 -#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 -#define GL_QUERY_BUFFER_BINDING 0x9193 -#define GL_QUERY_RESULT_NO_WAIT 0x9194 -#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 -typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); -typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); -typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); -typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); -GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures); -GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers); -GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures); -GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -#endif -#endif /* GL_VERSION_4_4 */ - -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -#endif /* GL_ARB_ES2_compatibility */ - -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 -#endif /* GL_ARB_ES3_compatibility */ - -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 -#endif /* GL_ARB_arrays_of_arrays */ - -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 -#endif /* GL_ARB_base_instance */ - -#ifndef GL_ARB_bindless_texture -#define GL_ARB_bindless_texture 1 -typedef uint64_t GLuint64EXT; -#define GL_UNSIGNED_INT64_ARB 0x140F -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle); -GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params); -#endif -#endif /* GL_ARB_bindless_texture */ - -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 -#endif /* GL_ARB_blend_func_extended */ - -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 -#endif /* GL_ARB_buffer_storage */ - -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 -struct _cl_context; -struct _cl_event; -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 -typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); -#endif -#endif /* GL_ARB_cl_event */ - -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 -#endif /* GL_ARB_clear_buffer_object */ - -#ifndef GL_ARB_clear_texture -#define GL_ARB_clear_texture 1 -#endif /* GL_ARB_clear_texture */ - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); -#endif -#endif /* GL_ARB_color_buffer_float */ - -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -#endif /* GL_ARB_compatibility */ - -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -#endif /* GL_ARB_compressed_texture_pixel_storage */ - -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#endif /* GL_ARB_compute_shader */ - -#ifndef GL_ARB_compute_variable_group_size -#define GL_ARB_compute_variable_group_size 1 -#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB -#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 -#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -#endif -#endif /* GL_ARB_compute_variable_group_size */ - -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 -#endif /* GL_ARB_conservative_depth */ - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -#define GL_COPY_READ_BUFFER_BINDING 0x8F36 -#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 -#endif /* GL_ARB_copy_buffer */ - -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 -#endif /* GL_ARB_copy_image */ - -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#endif -#endif /* GL_ARB_debug_output */ - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#endif /* GL_ARB_depth_buffer_float */ - -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -#endif /* GL_ARB_depth_clamp */ - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif /* GL_ARB_depth_texture */ - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_ARB_draw_buffers */ - -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif -#endif /* GL_ARB_draw_buffers_blend */ - -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 -#endif /* GL_ARB_draw_elements_base_vertex */ - -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 -#endif /* GL_ARB_draw_indirect */ - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_ARB_draw_instanced */ - -#ifndef GL_ARB_enhanced_layouts -#define GL_ARB_enhanced_layouts 1 -#endif /* GL_ARB_enhanced_layouts */ - -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -#endif /* GL_ARB_explicit_attrib_location */ - -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 -#endif /* GL_ARB_explicit_uniform_location */ - -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 -#endif /* GL_ARB_fragment_coord_conventions */ - -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 -#endif /* GL_ARB_fragment_layer_viewport */ - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); -GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); -#endif -#endif /* GL_ARB_fragment_program */ - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif /* GL_ARB_fragment_program_shadow */ - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif /* GL_ARB_fragment_shader */ - -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 -#endif /* GL_ARB_framebuffer_no_attachments */ - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#endif /* GL_ARB_framebuffer_object */ - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#endif /* GL_ARB_framebuffer_sRGB */ - -#ifndef GL_KHR_context_flush_control -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC -#endif /* GL_KHR_context_flush_control */ - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif -#endif /* GL_ARB_geometry_shader4 */ - -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 -#endif /* GL_ARB_get_program_binary */ - -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 -#endif /* GL_ARB_gpu_shader5 */ - -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 -#endif /* GL_ARB_gpu_shader_fp64 */ - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -typedef unsigned short GLhalfARB; -#define GL_HALF_FLOAT_ARB 0x140B -#endif /* GL_ARB_half_float_pixel */ - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#endif /* GL_ARB_half_float_vertex */ - -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_EQUATION 0x8009 -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogram (GLenum target); -GLAPI void APIENTRY glResetMinmax (GLenum target); -#endif -#endif /* GL_ARB_imaging */ - -#ifndef GL_ARB_indirect_parameters -#define GL_ARB_indirect_parameters 1 -#define GL_PARAMETER_BUFFER_ARB 0x80EE -#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#endif -#endif /* GL_ARB_indirect_parameters */ - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); -#endif -#endif /* GL_ARB_instanced_arrays */ - -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 -#endif /* GL_ARB_internalformat_query */ - -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 -#define GL_SRGB_DECODE_ARB 0x8299 -#endif /* GL_ARB_internalformat_query2 */ - -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 -#endif /* GL_ARB_invalidate_subdata */ - -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 -#endif /* GL_ARB_map_buffer_alignment */ - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#endif /* GL_ARB_map_buffer_range */ - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_ARB_matrix_palette */ - -#ifndef GL_ARB_multi_bind -#define GL_ARB_multi_bind 1 -#endif /* GL_ARB_multi_bind */ - -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 -#endif /* GL_ARB_multi_draw_indirect */ - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); -#endif -#endif /* GL_ARB_multisample */ - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); -#endif -#endif /* GL_ARB_multitexture */ - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); -GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQueryARB (GLenum target); -GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); -#endif -#endif /* GL_ARB_occlusion_query */ - -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 -#endif /* GL_ARB_occlusion_query2 */ - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif /* GL_ARB_pixel_buffer_object */ - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_ARB_point_parameters */ - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif /* GL_ARB_point_sprite */ - -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 -#endif /* GL_ARB_program_interface_query */ - -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 -#endif /* GL_ARB_provoking_vertex */ - -#ifndef GL_ARB_query_buffer_object -#define GL_ARB_query_buffer_object 1 -#endif /* GL_ARB_query_buffer_object */ - -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 -#endif /* GL_ARB_robust_buffer_access_behavior */ - -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); -GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); -GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); -GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); -GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); -GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -#endif -#endif /* GL_ARB_robustness */ - -#ifndef GL_ARB_robustness_isolation -#define GL_ARB_robustness_isolation 1 -#endif /* GL_ARB_robustness_isolation */ - -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); -#endif -#endif /* GL_ARB_sample_shading */ - -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 -#endif /* GL_ARB_sampler_objects */ - -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 -#endif /* GL_ARB_seamless_cube_map */ - -#ifndef GL_ARB_seamless_cubemap_per_texture -#define GL_ARB_seamless_cubemap_per_texture 1 -#endif /* GL_ARB_seamless_cubemap_per_texture */ - -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 -#endif /* GL_ARB_separate_shader_objects */ - -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 -#endif /* GL_ARB_shader_atomic_counters */ - -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 -#endif /* GL_ARB_shader_bit_encoding */ - -#ifndef GL_ARB_shader_draw_parameters -#define GL_ARB_shader_draw_parameters 1 -#endif /* GL_ARB_shader_draw_parameters */ - -#ifndef GL_ARB_shader_group_vote -#define GL_ARB_shader_group_vote 1 -#endif /* GL_ARB_shader_group_vote */ - -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 -#endif /* GL_ARB_shader_image_load_store */ - -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 -#endif /* GL_ARB_shader_image_size */ - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -typedef char GLcharARB; -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif -#endif /* GL_ARB_shader_objects */ - -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 -#endif /* GL_ARB_shader_precision */ - -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 -#endif /* GL_ARB_shader_stencil_export */ - -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 -#endif /* GL_ARB_shader_storage_buffer_object */ - -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 -#endif /* GL_ARB_shader_subroutine */ - -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 -#endif /* GL_ARB_shader_texture_lod */ - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif /* GL_ARB_shading_language_100 */ - -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 -#endif /* GL_ARB_shading_language_420pack */ - -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA -typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); -typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); -GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#endif -#endif /* GL_ARB_shading_language_include */ - -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 -#endif /* GL_ARB_shading_language_packing */ - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif /* GL_ARB_shadow */ - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif /* GL_ARB_shadow_ambient */ - -#ifndef GL_ARB_sparse_texture -#define GL_ARB_sparse_texture 1 -#define GL_TEXTURE_SPARSE_ARB 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 -#define GL_MIN_SPARSE_LEVEL_ARB 0x919B -#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 -typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -#endif -#endif /* GL_ARB_sparse_texture */ - -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 -#endif /* GL_ARB_stencil_texturing */ - -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 -#endif /* GL_ARB_sync */ - -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 -#endif /* GL_ARB_tessellation_shader */ - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif /* GL_ARB_texture_border_clamp */ - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); -#endif -#endif /* GL_ARB_texture_buffer_object */ - -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 -#endif /* GL_ARB_texture_buffer_object_rgb32 */ - -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 -#endif /* GL_ARB_texture_buffer_range */ - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); -#endif -#endif /* GL_ARB_texture_compression */ - -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F -#endif /* GL_ARB_texture_compression_bptc */ - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#endif /* GL_ARB_texture_compression_rgtc */ - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif /* GL_ARB_texture_cube_map */ - -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F -#endif /* GL_ARB_texture_cube_map_array */ - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif /* GL_ARB_texture_env_add */ - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif /* GL_ARB_texture_env_combine */ - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif /* GL_ARB_texture_env_crossbar */ - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif /* GL_ARB_texture_env_dot3 */ - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif /* GL_ARB_texture_float */ - -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F -#endif /* GL_ARB_texture_gather */ - -#ifndef GL_ARB_texture_mirror_clamp_to_edge -#define GL_ARB_texture_mirror_clamp_to_edge 1 -#endif /* GL_ARB_texture_mirror_clamp_to_edge */ - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif /* GL_ARB_texture_mirrored_repeat */ - -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -#endif /* GL_ARB_texture_multisample */ - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif /* GL_ARB_texture_non_power_of_two */ - -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 -#endif /* GL_ARB_texture_query_levels */ - -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 -#endif /* GL_ARB_texture_query_lod */ - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif /* GL_ARB_texture_rectangle */ - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#endif /* GL_ARB_texture_rg */ - -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 -#endif /* GL_ARB_texture_rgb10_a2ui */ - -#ifndef GL_ARB_texture_stencil8 -#define GL_ARB_texture_stencil8 1 -#endif /* GL_ARB_texture_stencil8 */ - -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 -#endif /* GL_ARB_texture_storage */ - -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 -#endif /* GL_ARB_texture_storage_multisample */ - -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -#endif /* GL_ARB_texture_swizzle */ - -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 -#endif /* GL_ARB_texture_view */ - -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 -#endif /* GL_ARB_timer_query */ - -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 -#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 -#endif /* GL_ARB_transform_feedback2 */ - -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 -#endif /* GL_ARB_transform_feedback3 */ - -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 -#endif /* GL_ARB_transform_feedback_instanced */ - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); -#endif -#endif /* GL_ARB_transpose_matrix */ - -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#endif /* GL_ARB_uniform_buffer_object */ - -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 -#endif /* GL_ARB_vertex_array_bgra */ - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#endif /* GL_ARB_vertex_array_object */ - -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 -#endif /* GL_ARB_vertex_attrib_64bit */ - -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 -#endif /* GL_ARB_vertex_attrib_binding */ - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); -GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); -GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); -GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); -GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); -GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); -GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); -GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); -GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glVertexBlendARB (GLint count); -#endif -#endif /* GL_ARB_vertex_blend */ - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef __MACOSX__ /* The OS X headers haven't caught up with Khronos yet */ -typedef long GLsizeiptrARB; -typedef long GLintptrARB; -#else -typedef ptrdiff_t GLsizeiptrARB; -typedef ptrdiff_t GLintptrARB; -#endif -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_ARB_vertex_buffer_object */ - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); -#endif -#endif /* GL_ARB_vertex_program */ - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); -#endif -#endif /* GL_ARB_vertex_shader */ - -#ifndef GL_ARB_vertex_type_10f_11f_11f_rev -#define GL_ARB_vertex_type_10f_11f_11f_rev 1 -#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 -#endif /* GL_ARB_viewport_array */ - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); -#endif -#endif /* GL_ARB_window_pos */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#endif /* GL_KHR_debug */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif /* GL_KHR_texture_compression_astc_hdr */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif /* GL_KHR_texture_compression_astc_ldr */ - -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s); -typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t); -typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); -typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); -typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x); -typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y); -typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z); -typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); -GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t); -GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r); -GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glTexCoord1bOES (GLbyte s); -GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t); -GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); -GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex2bOES (GLbyte x); -GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y); -GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z); -GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); -#endif -#endif /* GL_OES_byte_coordinates */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif /* GL_OES_compressed_paletted_texture */ - -#ifndef GL_OES_fixed_point -#define GL_OES_fixed_point 1 -typedef GLint GLfixed; -#define GL_FIXED_OES 0x140C -typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); -typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); -typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); -typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); -typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); -typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); -typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); -typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); -typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEOESPROC) (GLfixed value, GLboolean invert); -typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value); -typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); -typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue); -typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components); -typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u); -typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v); -typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v); -typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values); -typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component); -typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2); -typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token); -typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values); -typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities); -typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y); -typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w); -typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2); -typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s); -typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t); -typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r); -typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x); -typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y); -typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); -GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glClearDepthxOES (GLfixed depth); -GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); -GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); -GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); -GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); -GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glLineWidthxOES (GLfixed width); -GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); -GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); -GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glPointSizexOES (GLfixed size); -GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); -GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glSampleCoverageOES (GLfixed value, GLboolean invert); -GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value); -GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); -GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue); -GLAPI void APIENTRY glColor3xvOES (const GLfixed *components); -GLAPI void APIENTRY glColor4xvOES (const GLfixed *components); -GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u); -GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords); -GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v); -GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer); -GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v); -GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param); -GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values); -GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glIndexxOES (GLfixed component); -GLAPI void APIENTRY glIndexxvOES (const GLfixed *component); -GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2); -GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s); -GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t); -GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r); -GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glPassThroughxOES (GLfixed token); -GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values); -GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param); -GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor); -GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities); -GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y); -GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w); -GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2); -GLAPI void APIENTRY glTexCoord1xOES (GLfixed s); -GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t); -GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r); -GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glVertex2xOES (GLfixed x); -GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y); -GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords); -#endif -#endif /* GL_OES_fixed_point */ - -#ifndef GL_OES_query_matrix -#define GL_OES_query_matrix 1 -typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); -#endif -#endif /* GL_OES_query_matrix */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif /* GL_OES_read_format */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 -typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); -typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); -typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); -typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClearDepthfOES (GLclampf depth); -GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); -GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); -GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); -GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -#endif -#endif /* GL_OES_single_precision */ - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif /* GL_3DFX_multisample */ - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); -#endif -#endif /* GL_3DFX_tbuffer */ - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif /* GL_3DFX_texture_compression_FXT1 */ - -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#endif /* GL_AMD_blend_minmax_factor */ - -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 -#endif /* GL_AMD_conservative_depth */ - -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#endif -#endif /* GL_AMD_debug_output */ - -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F -#endif /* GL_AMD_depth_clamp_separate */ - -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 -typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#endif -#endif /* GL_AMD_draw_buffers_blend */ - -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 -#endif /* GL_AMD_gcn_shader */ - -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 -typedef int64_t GLint64EXT; -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); -GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_AMD_gpu_shader_int64 */ - -#ifndef GL_AMD_interleaved_elements -#define GL_AMD_interleaved_elements 1 -#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 -#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 -typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param); -#endif -#endif /* GL_AMD_interleaved_elements */ - -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); -#endif -#endif /* GL_AMD_multi_draw_indirect */ - -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 -typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); -typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); -typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); -GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); -GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); -#endif -#endif /* GL_AMD_name_gen_delete */ - -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF -typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); -#endif -#endif /* GL_AMD_occlusion_query_event */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); -GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -#endif /* GL_AMD_performance_monitor */ - -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 -#endif /* GL_AMD_pinned_memory */ - -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 -#endif /* GL_AMD_query_buffer_object */ - -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F -typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); -#endif -#endif /* GL_AMD_sample_positions */ - -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 -#endif /* GL_AMD_seamless_cubemap_per_texture */ - -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 -#endif /* GL_AMD_shader_atomic_counter_ops */ - -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 -#endif /* GL_AMD_shader_stencil_export */ - -#ifndef GL_AMD_shader_trinary_minmax -#define GL_AMD_shader_trinary_minmax 1 -#endif /* GL_AMD_shader_trinary_minmax */ - -#ifndef GL_AMD_sparse_texture -#define GL_AMD_sparse_texture 1 -#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A -#define GL_MIN_SPARSE_LEVEL_AMD 0x919B -#define GL_MIN_LOD_WARNING_AMD 0x919C -#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 -typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -#endif -#endif /* GL_AMD_sparse_texture */ - -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D -typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); -#endif -#endif /* GL_AMD_stencil_operation_extended */ - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -#endif /* GL_AMD_texture_texture4 */ - -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 -#endif /* GL_AMD_transform_feedback3_lines_triangles */ - -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 -#endif /* GL_AMD_transform_feedback4 */ - -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 -#endif /* GL_AMD_vertex_shader_layer */ - -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); -GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); -#endif -#endif /* GL_AMD_vertex_shader_tessellator */ - -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 -#endif /* GL_AMD_vertex_shader_viewport_index */ - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 -#endif /* GL_APPLE_aux_depth_stencil */ - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif /* GL_APPLE_client_storage */ - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif -#endif /* GL_APPLE_element_array */ - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); -#endif -#endif /* GL_APPLE_fence */ - -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F -#endif /* GL_APPLE_float_pixels */ - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_APPLE_flush_buffer_range */ - -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D -typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#endif -#endif /* GL_APPLE_object_purgeable */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_RAW_422_APPLE 0x8A51 -#endif /* GL_APPLE_rgb_422 */ - -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 -#endif /* GL_APPLE_row_bytes */ - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif /* GL_APPLE_specular_vector */ - -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_APPLE_texture_range */ - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif /* GL_APPLE_transform_hint */ - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); -#endif -#endif /* GL_APPLE_vertex_array_object */ - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); -#endif -#endif /* GL_APPLE_vertex_array_range */ - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#endif -#endif /* GL_APPLE_vertex_program_evaluators */ - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#define GL_YCBCR_422_APPLE 0x85B9 -#endif /* GL_APPLE_ycbcr_422 */ - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_ATI_draw_buffers */ - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif -#endif /* GL_ATI_element_array */ - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); -#endif -#endif /* GL_ATI_envmap_bumpmap */ - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); -GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); -#endif -#endif /* GL_ATI_fragment_shader */ - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); -#endif -#endif /* GL_ATI_map_object_buffer */ - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#endif /* GL_ATI_meminfo */ - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif /* GL_ATI_pixel_format_float */ - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); -#endif -#endif /* GL_ATI_pn_triangles */ - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif -#endif /* GL_ATI_separate_stencil */ - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif /* GL_ATI_text_fragment_shader */ - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif /* GL_ATI_texture_env_combine3 */ - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif /* GL_ATI_texture_float */ - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif /* GL_ATI_texture_mirror_once */ - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); -#endif -#endif /* GL_ATI_vertex_array_object */ - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); -#endif -#endif /* GL_ATI_vertex_attrib_array_object */ - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); -GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); -GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); -#endif -#endif /* GL_ATI_vertex_streams */ - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif /* GL_EXT_422_pixels */ - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#define GL_ABGR_EXT 0x8000 -#endif /* GL_EXT_abgr */ - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif /* GL_EXT_bgra */ - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); -#endif -#endif /* GL_EXT_bindable_uniform */ - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#endif -#endif /* GL_EXT_blend_color */ - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); -#endif -#endif /* GL_EXT_blend_equation_separate */ - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif -#endif /* GL_EXT_blend_func_separate */ - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif /* GL_EXT_blend_logic_op */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_BLEND_EQUATION_EXT 0x8009 -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); -#endif -#endif /* GL_EXT_blend_minmax */ - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif /* GL_EXT_blend_subtract */ - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif /* GL_EXT_clip_volume_hint */ - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif /* GL_EXT_cmyka */ - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif -#endif /* GL_EXT_color_subtable */ - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif -#endif /* GL_EXT_compiled_vertex_array */ - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -#endif -#endif /* GL_EXT_convolution */ - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); -GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); -GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); -GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_coordinate_frame */ - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_EXT_copy_texture */ - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_cull_vertex */ - -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_EXT_debug_label */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPopGroupMarkerEXT (void); -#endif -#endif /* GL_EXT_debug_marker */ - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); -#endif -#endif /* GL_EXT_depth_bounds_test */ - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); -GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array); -GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); -GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); -GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); -GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); -GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); -GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); -#endif -#endif /* GL_EXT_direct_state_access */ - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -#endif -#endif /* GL_EXT_draw_buffers2 */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_EXT_draw_instanced */ - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -#endif -#endif /* GL_EXT_draw_range_elements */ - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_fog_coord */ - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_EXT_framebuffer_blit */ - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_EXT_framebuffer_multisample */ - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); -#endif -#endif /* GL_EXT_framebuffer_object */ - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif /* GL_EXT_framebuffer_sRGB */ - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -#endif -#endif /* GL_EXT_geometry_shader4 */ - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif -#endif /* GL_EXT_gpu_program_parameters */ - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); -#endif -#endif /* GL_EXT_gpu_shader4 */ - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogramEXT (GLenum target); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); -#endif -#endif /* GL_EXT_histogram */ - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif /* GL_EXT_index_array_formats */ - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); -#endif -#endif /* GL_EXT_index_func */ - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); -#endif -#endif /* GL_EXT_index_material */ - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif /* GL_EXT_index_texture */ - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); -GLAPI void APIENTRY glTextureLightEXT (GLenum pname); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); -#endif -#endif /* GL_EXT_light_texture */ - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif /* GL_EXT_misc_attribute */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#endif -#endif /* GL_EXT_multi_draw_arrays */ - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); -#endif -#endif /* GL_EXT_multisample */ - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#endif /* GL_EXT_packed_depth_stencil */ - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif /* GL_EXT_packed_float */ - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif /* GL_EXT_packed_pixels */ - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_paletted_texture */ - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif /* GL_EXT_pixel_buffer_object */ - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_pixel_transform */ - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif /* GL_EXT_pixel_transform_color_table */ - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_EXT_point_parameters */ - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); -#endif -#endif /* GL_EXT_polygon_offset */ - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); -#endif -#endif /* GL_EXT_provoking_vertex */ - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif /* GL_EXT_rescale_normal */ - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_secondary_color */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D -typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); -typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); -GLAPI void APIENTRY glActiveProgramEXT (GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); -#endif -#endif /* GL_EXT_separate_shader_objects */ - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif /* GL_EXT_separate_specular_color */ - -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 -#endif /* GL_EXT_shader_image_load_formatted */ - -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); -#endif -#endif /* GL_EXT_shader_image_load_store */ - -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -#endif /* GL_EXT_shader_integer_mix */ - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif /* GL_EXT_shadow_funcs */ - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif /* GL_EXT_shared_texture_palette */ - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif -#endif /* GL_EXT_stencil_clear_tag */ - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); -#endif -#endif /* GL_EXT_stencil_two_side */ - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif /* GL_EXT_stencil_wrap */ - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_EXT_subtexture */ - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif /* GL_EXT_texture */ - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_EXT_texture3D */ - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#endif /* GL_EXT_texture_array */ - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); -#endif -#endif /* GL_EXT_texture_buffer_object */ - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif /* GL_EXT_texture_compression_latc */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif /* GL_EXT_texture_cube_map */ - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif /* GL_EXT_texture_env_add */ - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif /* GL_EXT_texture_env_combine */ - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif /* GL_EXT_texture_env_dot3 */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif /* GL_EXT_texture_filter_anisotropic */ - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif -#endif /* GL_EXT_texture_integer */ - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif /* GL_EXT_texture_lod_bias */ - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif /* GL_EXT_texture_mirror_clamp */ - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif -#endif /* GL_EXT_texture_object */ - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); -#endif -#endif /* GL_EXT_texture_perturb_normal */ - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif /* GL_EXT_texture_sRGB */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif /* GL_EXT_texture_sRGB_decode */ - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif /* GL_EXT_texture_shared_exponent */ - -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#endif /* GL_EXT_texture_snorm */ - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#endif /* GL_EXT_texture_swizzle */ - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#define GL_TIME_ELAPSED_EXT 0x88BF -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -#endif -#endif /* GL_EXT_timer_query */ - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#endif -#endif /* GL_EXT_transform_feedback */ - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint i); -GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); -GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); -GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -#endif -#endif /* GL_EXT_vertex_array */ - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#endif /* GL_EXT_vertex_array_bgra */ - -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); -#endif -#endif /* GL_EXT_vertex_attrib_64bit */ - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); -GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); -GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); -GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); -GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); -GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); -GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); -GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); -GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); -GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); -GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -#endif -#endif /* GL_EXT_vertex_shader */ - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_vertex_weighting */ - -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 -#define GL_SYNC_X11_FENCE_EXT 0x90E1 -typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#endif -#endif /* GL_EXT_x11_sync_object */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); -#endif -#endif /* GL_GREMEDY_frame_terminator */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); -#endif -#endif /* GL_GREMEDY_string_marker */ - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif /* GL_HP_convolution_border_modes */ - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_HP_image_transform */ - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif /* GL_HP_occlusion_test */ - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif /* GL_HP_texture_lighting */ - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#define GL_CULL_VERTEX_IBM 103050 -#endif /* GL_IBM_cull_vertex */ - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); -#endif -#endif /* GL_IBM_multimode_draw_arrays */ - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif /* GL_IBM_rasterpos_clip */ - -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 -typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); -#endif -#endif /* GL_IBM_static_data */ - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif /* GL_IBM_texture_mirrored_repeat */ - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -#endif -#endif /* GL_IBM_vertex_array_lists */ - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif -#endif /* GL_INGR_blend_func_separate */ - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif /* GL_INGR_color_clamp */ - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#define GL_INTERLACE_READ_INGR 0x8568 -#endif /* GL_INGR_interlace_read */ - -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 -#endif /* GL_INTEL_fragment_shader_ordering */ - -#ifndef GL_INTEL_map_texture -#define GL_INTEL_map_texture 1 -#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF -#define GL_LAYOUT_DEFAULT_INTEL 0 -#define GL_LAYOUT_LINEAR_INTEL 1 -#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 -typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); -typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); -GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); -GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); -#endif -#endif /* GL_INTEL_map_texture */ - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); -GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); -#endif -#endif /* GL_INTEL_parallel_arrays */ - -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); -typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); -typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); -typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); -typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); -typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); -GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); -GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); -GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); -GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); -GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#endif -#endif /* GL_INTEL_performance_query */ - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif /* GL_MESAX_texture_stack */ - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#define GL_PACK_INVERT_MESA 0x8758 -#endif /* GL_MESA_pack_invert */ - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif -#endif /* GL_MESA_resize_buffers */ - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); -#endif -#endif /* GL_MESA_window_pos */ - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif /* GL_MESA_ycbcr_texture */ - -#ifndef GL_NVX_conditional_render -#define GL_NVX_conditional_render 1 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id); -GLAPI void APIENTRY glEndConditionalRenderNVX (void); -#endif -#endif /* GL_NVX_conditional_render */ - -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#endif /* GL_NVX_gpu_memory_info */ - -#ifndef GL_NV_bindless_multi_draw_indirect -#define GL_NV_bindless_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -#endif -#endif /* GL_NV_bindless_multi_draw_indirect */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); -#endif -#endif /* GL_NV_bindless_texture */ - -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value); -GLAPI void APIENTRY glBlendBarrierNV (void); -#endif -#endif /* GL_NV_blend_equation_advanced */ - -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#endif /* GL_NV_blend_equation_advanced_coherent */ - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif /* GL_NV_blend_square */ - -#ifndef GL_NV_compute_program5 -#define GL_NV_compute_program5 1 -#define GL_COMPUTE_PROGRAM_NV 0x90FB -#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC -#endif /* GL_NV_compute_program5 */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRenderNV (void); -#endif -#endif /* GL_NV_conditional_render */ - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif /* GL_NV_copy_depth_to_color */ - -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#endif -#endif /* GL_NV_copy_image */ - -#ifndef GL_NV_deep_texture3D -#define GL_NV_deep_texture3D 1 -#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 -#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 -#endif /* GL_NV_deep_texture3D */ - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); -#endif -#endif /* GL_NV_depth_buffer_float */ - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#define GL_DEPTH_CLAMP_NV 0x864F -#endif /* GL_NV_depth_clamp */ - -#ifndef GL_NV_draw_texture -#define GL_NV_draw_texture 1 -typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -#endif -#endif /* GL_NV_draw_texture */ - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); -#endif -#endif /* GL_NV_evaluators */ - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); -#endif -#endif /* GL_NV_explicit_multisample */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); -GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GLAPI void APIENTRY glFinishFenceNV (GLuint fence); -GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -#endif /* GL_NV_fence */ - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif /* GL_NV_float_buffer */ - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -#endif /* GL_NV_fog_distance */ - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif -#endif /* GL_NV_fragment_program */ - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif /* GL_NV_fragment_program2 */ - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#endif /* GL_NV_fragment_program4 */ - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif /* GL_NV_fragment_program_option */ - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_NV_framebuffer_multisample_coverage */ - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif -#endif /* GL_NV_geometry_program4 */ - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#endif /* GL_NV_geometry_shader4 */ - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); -#endif -#endif /* GL_NV_gpu_program4 */ - -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F -#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 -#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 -typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); -#endif -#endif /* GL_NV_gpu_program5 */ - -#ifndef GL_NV_gpu_program5_mem_extended -#define GL_NV_gpu_program5_mem_extended 1 -#endif /* GL_NV_gpu_program5_mem_extended */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -#endif /* GL_NV_gpu_shader5 */ - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -typedef unsigned short GLhalfNV; -#define GL_HALF_FLOAT_NV 0x140B -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -#endif -#endif /* GL_NV_half_float */ - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif /* GL_NV_light_max_exponent */ - -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#endif /* GL_NV_multisample_coverage */ - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif /* GL_NV_multisample_filter_hint */ - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); -#endif -#endif /* GL_NV_occlusion_query */ - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif /* GL_NV_packed_depth_stencil */ - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); -#endif -#endif /* GL_NV_parameter_buffer_object */ - -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 -#endif /* GL_NV_parameter_buffer_object2 */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); -typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); -typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); -typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); -typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); -GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); -GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); -GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); -GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); -GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); -GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); -GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); -GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); -GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); -GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); -GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); -GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); -GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); -GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); -GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); -GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); -GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); -GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); -GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -#endif -#endif /* GL_NV_path_rendering */ - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); -#endif -#endif /* GL_NV_pixel_data_range */ - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); -#endif -#endif /* GL_NV_point_sprite */ - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); -GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#endif -#endif /* GL_NV_present_video */ - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); -#endif -#endif /* GL_NV_primitive_restart */ - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); -#endif -#endif /* GL_NV_register_combiners */ - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); -#endif -#endif /* GL_NV_register_combiners2 */ - -#ifndef GL_NV_shader_atomic_counters -#define GL_NV_shader_atomic_counters 1 -#endif /* GL_NV_shader_atomic_counters */ - -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 -#endif /* GL_NV_shader_atomic_float */ - -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 -typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); -typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); -typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); -typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); -typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); -GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); -GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); -GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); -GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); -GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); -GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); -GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); -GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); -GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_NV_shader_buffer_load */ - -#ifndef GL_NV_shader_buffer_store -#define GL_NV_shader_buffer_store 1 -#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 -#endif /* GL_NV_shader_buffer_store */ - -#ifndef GL_NV_shader_storage_buffer_object -#define GL_NV_shader_storage_buffer_object 1 -#endif /* GL_NV_shader_storage_buffer_object */ - -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B -#endif /* GL_NV_shader_thread_group */ - -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 -#endif /* GL_NV_shader_thread_shuffle */ - -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 -#endif /* GL_NV_tessellation_program5 */ - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif /* GL_NV_texgen_emboss */ - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif /* GL_NV_texgen_reflection */ - -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 -typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureBarrierNV (void); -#endif -#endif /* GL_NV_texture_barrier */ - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif /* GL_NV_texture_compression_vtc */ - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif /* GL_NV_texture_env_combine4 */ - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif /* GL_NV_texture_expand_normal */ - -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#endif -#endif /* GL_NV_texture_multisample */ - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif /* GL_NV_texture_rectangle */ - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif /* GL_NV_texture_shader */ - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif /* GL_NV_texture_shader2 */ - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif /* GL_NV_texture_shader3 */ - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#define GL_LAYER_NV 0x8DAA -#define GL_NEXT_BUFFER_NV -2 -#define GL_SKIP_COMPONENTS4_NV -3 -#define GL_SKIP_COMPONENTS3_NV -4 -#define GL_SKIP_COMPONENTS2_NV -5 -#define GL_SKIP_COMPONENTS1_NV -6 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); -GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#endif -#endif /* GL_NV_transform_feedback */ - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedbackNV (void); -GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); -#endif -#endif /* GL_NV_transform_feedback2 */ - -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 -typedef GLintptr GLvdpauSurfaceNV; -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); -typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); -typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); -GLAPI void APIENTRY glVDPAUFiniNV (void); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); -GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#endif -#endif /* GL_NV_vdpau_interop */ - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); -#endif -#endif /* GL_NV_vertex_array_range */ - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif /* GL_NV_vertex_array_range2 */ - -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); -GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -#endif -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 -typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); -GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); -#endif -#endif /* GL_NV_vertex_buffer_unified_memory */ - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); -GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); -GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); -GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); -#endif -#endif /* GL_NV_vertex_program */ - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif /* GL_NV_vertex_program1_1 */ - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif /* GL_NV_vertex_program2 */ - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif /* GL_NV_vertex_program2_option */ - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif /* GL_NV_vertex_program3 */ - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); -#endif -#endif /* GL_NV_vertex_program4 */ - -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C -typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#endif -#endif /* GL_NV_video_capture */ - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif /* GL_OML_interlace */ - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif /* GL_OML_resample */ - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif /* GL_OML_subsample */ - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); -#endif -#endif /* GL_PGI_misc_hints */ - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif /* GL_PGI_vertex_hints */ - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif /* GL_REND_screen_coordinates */ - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 -#endif /* GL_S3_s3tc */ - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); -#endif -#endif /* GL_SGIS_detail_texture */ - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); -#endif -#endif /* GL_SGIS_fog_function */ - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif /* GL_SGIS_generate_mipmap */ - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); -#endif -#endif /* GL_SGIS_multisample */ - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); -#endif -#endif /* GL_SGIS_pixel_texture */ - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif /* GL_SGIS_point_line_texgen */ - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_SGIS_point_parameters */ - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); -#endif -#endif /* GL_SGIS_sharpen_texture */ - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_SGIS_texture4D */ - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif /* GL_SGIS_texture_border_clamp */ - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif -#endif /* GL_SGIS_texture_color_mask */ - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif /* GL_SGIS_texture_edge_clamp */ - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif -#endif /* GL_SGIS_texture_filter4 */ - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif /* GL_SGIS_texture_lod */ - -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif /* GL_SGIS_texture_select */ - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#define GL_ASYNC_MARKER_SGIX 0x8329 -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); -#endif -#endif /* GL_SGIX_async */ - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif /* GL_SGIX_async_histogram */ - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif /* GL_SGIX_async_pixel */ - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif /* GL_SGIX_blend_alpha_minmax */ - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif /* GL_SGIX_calligraphic_fragment */ - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif /* GL_SGIX_clipmap */ - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif /* GL_SGIX_convolution_accuracy */ - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif /* GL_SGIX_depth_pass_instrument */ - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif /* GL_SGIX_depth_texture */ - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif -#endif /* GL_SGIX_flush_raster */ - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif /* GL_SGIX_fog_offset */ - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); -GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); -#endif -#endif /* GL_SGIX_fragment_lighting */ - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); -#endif -#endif /* GL_SGIX_framezoom */ - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); -#endif -#endif /* GL_SGIX_igloo_interface */ - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); -#endif -#endif /* GL_SGIX_instruments */ - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#define GL_INTERLACE_SGIX 0x8094 -#endif /* GL_SGIX_interlace */ - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif /* GL_SGIX_ir_instrument1 */ - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#define GL_LIST_PRIORITY_SGIX 0x8182 -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); -GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); -GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); -#endif -#endif /* GL_SGIX_list_priority */ - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); -#endif -#endif /* GL_SGIX_pixel_texture */ - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif /* GL_SGIX_pixel_tiles */ - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); -#endif -#endif /* GL_SGIX_polynomial_ffd */ - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); -#endif -#endif /* GL_SGIX_reference_plane */ - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif /* GL_SGIX_resample */ - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif /* GL_SGIX_scalebias_hint */ - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif /* GL_SGIX_shadow */ - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif /* GL_SGIX_shadow_ambient */ - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); -#endif -#endif /* GL_SGIX_sprite */ - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif /* GL_SGIX_subsample */ - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif -#endif /* GL_SGIX_tag_sample_buffer */ - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif /* GL_SGIX_texture_add_env */ - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif /* GL_SGIX_texture_coordinate_clamp */ - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif /* GL_SGIX_texture_lod_bias */ - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif /* GL_SGIX_texture_multi_buffer */ - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif /* GL_SGIX_texture_scale_bias */ - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif /* GL_SGIX_vertex_preclip */ - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif /* GL_SGIX_ycrcb */ - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif /* GL_SGIX_ycrcb_subsample */ - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif /* GL_SGIX_ycrcba */ - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif /* GL_SGI_color_matrix */ - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); -#endif -#endif /* GL_SGI_color_table */ - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif /* GL_SGI_texture_color_table */ - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif -#endif /* GL_SUNX_constant_data */ - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif /* GL_SUN_convolution_border_modes */ - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); -#endif -#endif /* GL_SUN_global_alpha */ - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif -#endif /* GL_SUN_mesh_array */ - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif /* GL_SUN_slice_accum */ - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); -#endif -#endif /* GL_SUN_triangle_list */ - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif -#endif /* GL_SUN_vertex */ - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif /* GL_WIN_phong_shading */ - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif /* GL_WIN_specular_fog */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Windows/SDL2/include/SDL_opengles.h b/Windows/SDL2/include/SDL_opengles.h deleted file mode 100644 index 1e0660c3..00000000 --- a/Windows/SDL2/include/SDL_opengles.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengles.h - * - * This is a simple file to encapsulate the OpenGL ES 1.X API headers. - */ -#include "SDL_config.h" - -#ifdef __IPHONEOS__ -#include <OpenGLES/ES1/gl.h> -#include <OpenGLES/ES1/glext.h> -#else -#include <GLES/gl.h> -#include <GLES/glext.h> -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif diff --git a/Windows/SDL2/include/SDL_opengles2.h b/Windows/SDL2/include/SDL_opengles2.h deleted file mode 100644 index df29d384..00000000 --- a/Windows/SDL2/include/SDL_opengles2.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengles2.h - * - * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. - */ -#include "SDL_config.h" - -#ifndef _MSC_VER - -#ifdef __IPHONEOS__ -#include <OpenGLES/ES2/gl.h> -#include <OpenGLES/ES2/glext.h> -#else -#include <GLES2/gl2platform.h> -#include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> -#endif - -#else /* _MSC_VER */ - -/* OpenGL ES2 headers for Visual Studio */ -#include "SDL_opengles2_khrplatform.h" -#include "SDL_opengles2_gl2platform.h" -#include "SDL_opengles2_gl2.h" -#include "SDL_opengles2_gl2ext.h" - -#endif /* _MSC_VER */ - -#ifndef APIENTRY -#define APIENTRY GL_APIENTRY -#endif diff --git a/Windows/SDL2/include/SDL_opengles2_gl2.h b/Windows/SDL2/include/SDL_opengles2_gl2.h deleted file mode 100644 index c62fb0a5..00000000 --- a/Windows/SDL2/include/SDL_opengles2_gl2.h +++ /dev/null @@ -1,621 +0,0 @@ -#ifndef __gl2_h_ -#define __gl2_h_ - -/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */ - -/*#include <GLES2/gl2platform.h>*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -/*------------------------------------------------------------------------- - * Data type definitions - *-----------------------------------------------------------------------*/ - -typedef void GLvoid; -typedef char GLchar; -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef khronos_int8_t GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLsizei; -typedef khronos_uint8_t GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; - -/* GL types for handling large vertex buffer objects */ -typedef khronos_intptr_t GLintptr; -typedef khronos_ssize_t GLsizeiptr; - -/* OpenGL ES core versions */ -#define GL_ES_VERSION_2_0 1 - -/* ClearBufferMask */ -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 - -/* Boolean */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* BeginMode */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 - -/* AlphaFunction (not supported in ES20) */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* BlendingFactorDest */ -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 - -/* BlendingFactorSrc */ -/* GL_ZERO */ -/* GL_ONE */ -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -/* GL_SRC_ALPHA */ -/* GL_ONE_MINUS_SRC_ALPHA */ -/* GL_DST_ALPHA */ -/* GL_ONE_MINUS_DST_ALPHA */ - -/* BlendEquationSeparate */ -#define GL_FUNC_ADD 0x8006 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ -#define GL_BLEND_EQUATION_ALPHA 0x883D - -/* BlendSubtract */ -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B - -/* Separate Blend Functions */ -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 - -/* Buffer Objects */ -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 - -#define GL_STREAM_DRAW 0x88E0 -#define GL_STATIC_DRAW 0x88E4 -#define GL_DYNAMIC_DRAW 0x88E8 - -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 - -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 - -/* CullFaceMode */ -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_FRONT_AND_BACK 0x0408 - -/* DepthFunction */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* EnableCap */ -#define GL_TEXTURE_2D 0x0DE1 -#define GL_CULL_FACE 0x0B44 -#define GL_BLEND 0x0BE2 -#define GL_DITHER 0x0BD0 -#define GL_STENCIL_TEST 0x0B90 -#define GL_DEPTH_TEST 0x0B71 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_COVERAGE 0x80A0 - -/* ErrorCode */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 - -/* FrontFaceDirection */ -#define GL_CW 0x0900 -#define GL_CCW 0x0901 - -/* GetPName */ -#define GL_LINE_WIDTH 0x0B21 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -/* GL_SCISSOR_TEST */ -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -/* GL_POLYGON_OFFSET_FILL */ -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB - -/* GetTextureParameter */ -/* GL_TEXTURE_MAG_FILTER */ -/* GL_TEXTURE_MIN_FILTER */ -/* GL_TEXTURE_WRAP_S */ -/* GL_TEXTURE_WRAP_T */ - -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 - -/* HintMode */ -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* HintTarget */ -#define GL_GENERATE_MIPMAP_HINT 0x8192 - -/* DataType */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_FIXED 0x140C - -/* PixelFormat */ -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A - -/* PixelType */ -/* GL_UNSIGNED_BYTE */ -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 - -/* Shaders */ -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_SHADER_TYPE 0x8B4F -#define GL_DELETE_STATUS 0x8B80 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D - -/* StencilFunction */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 - -/* StencilOp */ -/* GL_ZERO */ -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_INVERT 0x150A -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 - -/* StringName */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* TextureMagFilter */ -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 - -/* TextureMinFilter */ -/* GL_NEAREST */ -/* GL_LINEAR */ -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 - -/* TextureParameterName */ -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 - -/* TextureTarget */ -/* GL_TEXTURE_2D */ -#define GL_TEXTURE 0x1702 - -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C - -/* TextureUnit */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 - -/* TextureWrapMode */ -#define GL_REPEAT 0x2901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MIRRORED_REPEAT 0x8370 - -/* Uniform Types */ -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 - -/* Vertex Arrays */ -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F - -/* Read Format */ -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B - -/* Shader Source */ -#define GL_COMPILE_STATUS 0x8B81 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_COMPILER 0x8DFA - -/* Shader Binary */ -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 - -/* Shader Precision-Specified Types */ -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 - -/* Framebuffer Object. */ -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 - -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGB565 0x8D62 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_STENCIL_INDEX8 0x8D48 - -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 - -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 - -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 - -#define GL_NONE 0 - -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD - -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 - -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 - -/*------------------------------------------------------------------------- - * GL core functions. - *-----------------------------------------------------------------------*/ - -GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); -GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); -GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); -GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); -GL_APICALL void GL_APIENTRY glClearStencil (GLint s); -GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); -GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); -GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); -GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); -GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); -GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisable (GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); -GL_APICALL void GL_APIENTRY glEnable (GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glFinish (void); -GL_APICALL void GL_APIENTRY glFlush (void); -GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); -GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); -GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); -GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL GLenum GL_APIENTRY glGetError (void); -GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); -GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); -GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); -GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); -GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); -GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); -GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); -GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); -GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); - -#ifdef __cplusplus -} -#endif - -#endif /* __gl2_h_ */ - diff --git a/Windows/SDL2/include/SDL_opengles2_gl2ext.h b/Windows/SDL2/include/SDL_opengles2_gl2ext.h deleted file mode 100644 index e8ca8b13..00000000 --- a/Windows/SDL2/include/SDL_opengles2_gl2ext.h +++ /dev/null @@ -1,2050 +0,0 @@ -#ifndef __gl2ext_h_ -#define __gl2ext_h_ - -/* $Revision: 22801 $ on $Date:: 2013-08-21 03:20:48 -0700 #$ */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -#ifndef GL_APIENTRYP -# define GL_APIENTRYP GL_APIENTRY* -#endif - -/* New types shared by several extensions */ - -#ifndef __gl3_h_ -/* These are defined with respect to <inttypes.h> in the - * Apple extension spec, but they are also used by non-APPLE - * extensions, and in the Khronos header we use the Khronos - * portable types in khrplatform.h, which must be defined. - */ -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef struct __GLsync *GLsync; -#endif - - -/*------------------------------------------------------------------------* - * OES extension tokens - *------------------------------------------------------------------------*/ - -/* GL_OES_compressed_ETC1_RGB8_texture */ -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_ETC1_RGB8_OES 0x8D64 -#endif - -/* GL_OES_compressed_paletted_texture */ -#ifndef GL_OES_compressed_paletted_texture -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif - -/* GL_OES_depth24 */ -#ifndef GL_OES_depth24 -#define GL_DEPTH_COMPONENT24_OES 0x81A6 -#endif - -/* GL_OES_depth32 */ -#ifndef GL_OES_depth32 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#endif - -/* GL_OES_depth_texture */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -typedef void* GLeglImageOES; -#endif - -/* GL_OES_EGL_image_external */ -#ifndef GL_OES_EGL_image_external -/* GLeglImageOES defined in GL_OES_EGL_image already. */ -#define GL_TEXTURE_EXTERNAL_OES 0x8D65 -#define GL_SAMPLER_EXTERNAL_OES 0x8D66 -#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 -#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 -#endif - -/* GL_OES_element_index_uint */ -#ifndef GL_OES_element_index_uint -#define GL_UNSIGNED_INT 0x1405 -#endif - -/* GL_OES_get_program_binary */ -#ifndef GL_OES_get_program_binary -#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE -#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF -#endif - -/* GL_OES_mapbuffer */ -#ifndef GL_OES_mapbuffer -#define GL_WRITE_ONLY_OES 0x88B9 -#define GL_BUFFER_ACCESS_OES 0x88BB -#define GL_BUFFER_MAPPED_OES 0x88BC -#define GL_BUFFER_MAP_POINTER_OES 0x88BD -#endif - -/* GL_OES_packed_depth_stencil */ -#ifndef GL_OES_packed_depth_stencil -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif - -/* GL_OES_required_internalformat */ -#ifndef GL_OES_required_internalformat -#define GL_ALPHA8_OES 0x803C -#define GL_DEPTH_COMPONENT16_OES 0x81A5 -/* reuse GL_DEPTH_COMPONENT24_OES */ -/* reuse GL_DEPTH24_STENCIL8_OES */ -/* reuse GL_DEPTH_COMPONENT32_OES */ -#define GL_LUMINANCE4_ALPHA4_OES 0x8043 -#define GL_LUMINANCE8_ALPHA8_OES 0x8045 -#define GL_LUMINANCE8_OES 0x8040 -#define GL_RGBA4_OES 0x8056 -#define GL_RGB5_A1_OES 0x8057 -#define GL_RGB565_OES 0x8D62 -/* reuse GL_RGB8_OES */ -/* reuse GL_RGBA8_OES */ -/* reuse GL_RGB10_EXT */ -/* reuse GL_RGB10_A2_EXT */ -#endif - -/* GL_OES_rgb8_rgba8 */ -#ifndef GL_OES_rgb8_rgba8 -#define GL_RGB8_OES 0x8051 -#define GL_RGBA8_OES 0x8058 -#endif - -/* GL_OES_standard_derivatives */ -#ifndef GL_OES_standard_derivatives -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B -#endif - -/* GL_OES_stencil1 */ -#ifndef GL_OES_stencil1 -#define GL_STENCIL_INDEX1_OES 0x8D46 -#endif - -/* GL_OES_stencil4 */ -#ifndef GL_OES_stencil4 -#define GL_STENCIL_INDEX4_OES 0x8D47 -#endif - -#ifndef GL_OES_surfaceless_context -#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 -#endif - -/* GL_OES_texture_3D */ -#ifndef GL_OES_texture_3D -#define GL_TEXTURE_WRAP_R_OES 0x8072 -#define GL_TEXTURE_3D_OES 0x806F -#define GL_TEXTURE_BINDING_3D_OES 0x806A -#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 -#define GL_SAMPLER_3D_OES 0x8B5F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 -#endif - -/* GL_OES_texture_float */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_float_linear */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_half_float */ -#ifndef GL_OES_texture_half_float -#define GL_HALF_FLOAT_OES 0x8D61 -#endif - -/* GL_OES_texture_half_float_linear */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_npot */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_vertex_array_object */ -#ifndef GL_OES_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 -#endif - -/* GL_OES_vertex_half_float */ -/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ - -/* GL_OES_vertex_type_10_10_10_2 */ -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 -#define GL_INT_10_10_10_2_OES 0x8DF7 -#endif - -/*------------------------------------------------------------------------* - * KHR extension tokens - *------------------------------------------------------------------------*/ - -#ifndef GL_KHR_debug -typedef void (GL_APIENTRYP GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_QUERY_KHR 0x82E3 -/* PROGRAM_PIPELINE only in GL */ -#define GL_SAMPLER_KHR 0x82E6 -/* DISPLAY_LIST only in GL */ -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -#endif - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif - -/*------------------------------------------------------------------------* - * AMD extension tokens - *------------------------------------------------------------------------*/ - -/* GL_AMD_compressed_3DC_texture */ -#ifndef GL_AMD_compressed_3DC_texture -#define GL_3DC_X_AMD 0x87F9 -#define GL_3DC_XY_AMD 0x87FA -#endif - -/* GL_AMD_compressed_ATC_texture */ -#ifndef GL_AMD_compressed_ATC_texture -#define GL_ATC_RGB_AMD 0x8C92 -#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 -#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE -#endif - -/* GL_AMD_performance_monitor */ -#ifndef GL_AMD_performance_monitor -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#endif - -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_Z400_BINARY_AMD 0x8740 -#endif - -/*------------------------------------------------------------------------* - * ANGLE extension tokens - *------------------------------------------------------------------------*/ - -/* GL_ANGLE_depth_texture */ -#ifndef GL_ANGLE_depth_texture -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_UNSIGNED_INT 0x1405 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif - -/* GL_ANGLE_framebuffer_blit */ -#ifndef GL_ANGLE_framebuffer_blit -#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA -#endif - -/* GL_ANGLE_framebuffer_multisample */ -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 -#define GL_MAX_SAMPLES_ANGLE 0x8D57 -#endif - -/* GL_ANGLE_instanced_arrays */ -#ifndef GL_ANGLE_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE -#endif - -/* GL_ANGLE_pack_reverse_row_order */ -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 -#endif - -/* GL_ANGLE_program_binary */ -#ifndef GL_ANGLE_program_binary -#define GL_PROGRAM_BINARY_ANGLE 0x93A6 -#endif - -/* GL_ANGLE_texture_compression_dxt3 */ -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#endif - -/* GL_ANGLE_texture_compression_dxt5 */ -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 -#endif - -/* GL_ANGLE_texture_usage */ -#ifndef GL_ANGLE_texture_usage -#define GL_TEXTURE_USAGE_ANGLE 0x93A2 -#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 -#endif - -/* GL_ANGLE_translated_shader_source */ -#ifndef GL_ANGLE_translated_shader_source -#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 -#endif - -/*------------------------------------------------------------------------* - * APPLE extension tokens - *------------------------------------------------------------------------*/ - -/* GL_APPLE_copy_texture_levels */ -/* No new tokens introduced by this extension. */ - -/* GL_APPLE_framebuffer_multisample */ -#ifndef GL_APPLE_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 -#define GL_MAX_SAMPLES_APPLE 0x8D57 -#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA -#endif - -/* GL_APPLE_rgb_422 */ -#ifndef GL_APPLE_rgb_422 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -/* GL_APPLE_sync */ -#ifndef GL_APPLE_sync - -#define GL_SYNC_OBJECT_APPLE 0x8A53 -#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 -#define GL_OBJECT_TYPE_APPLE 0x9112 -#define GL_SYNC_CONDITION_APPLE 0x9113 -#define GL_SYNC_STATUS_APPLE 0x9114 -#define GL_SYNC_FLAGS_APPLE 0x9115 -#define GL_SYNC_FENCE_APPLE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 -#define GL_UNSIGNALED_APPLE 0x9118 -#define GL_SIGNALED_APPLE 0x9119 -#define GL_ALREADY_SIGNALED_APPLE 0x911A -#define GL_TIMEOUT_EXPIRED_APPLE 0x911B -#define GL_CONDITION_SATISFIED_APPLE 0x911C -#define GL_WAIT_FAILED_APPLE 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 -#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull -#endif - -/* GL_APPLE_texture_format_BGRA8888 */ -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_APPLE_texture_max_level */ -#ifndef GL_APPLE_texture_max_level -#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D -#endif - -/*------------------------------------------------------------------------* - * ARM extension tokens - *------------------------------------------------------------------------*/ - -/* GL_ARM_mali_program_binary */ -#ifndef GL_ARM_mali_program_binary -#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 -#endif - -/* GL_ARM_mali_shader_binary */ -#ifndef GL_ARM_mali_shader_binary -#define GL_MALI_SHADER_BINARY_ARM 0x8F60 -#endif - -/* GL_ARM_rgba8 */ -/* No new tokens introduced by this extension. */ - -/*------------------------------------------------------------------------* - * EXT extension tokens - *------------------------------------------------------------------------*/ - -/* GL_EXT_blend_minmax */ -#ifndef GL_EXT_blend_minmax -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#endif - -/* GL_EXT_color_buffer_half_float */ -#ifndef GL_EXT_color_buffer_half_float -#define GL_RGBA16F_EXT 0x881A -#define GL_RGB16F_EXT 0x881B -#define GL_RG16F_EXT 0x822F -#define GL_R16F_EXT 0x822D -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 -#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 -#endif - -/* GL_EXT_debug_label */ -#ifndef GL_EXT_debug_label -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#endif - -/* GL_EXT_debug_marker */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_discard_framebuffer */ -#ifndef GL_EXT_discard_framebuffer -#define GL_COLOR_EXT 0x1800 -#define GL_DEPTH_EXT 0x1801 -#define GL_STENCIL_EXT 0x1802 -#endif - -#ifndef GL_EXT_disjoint_timer_query -#define GL_QUERY_COUNTER_BITS_EXT 0x8864 -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_TIMESTAMP_EXT 0x8E28 -#define GL_GPU_DISJOINT_EXT 0x8FBB -#endif - -#ifndef GL_EXT_draw_buffers -#define GL_EXT_draw_buffers 1 -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 -#define GL_DRAW_BUFFER0_EXT 0x8825 -#define GL_DRAW_BUFFER1_EXT 0x8826 -#define GL_DRAW_BUFFER2_EXT 0x8827 -#define GL_DRAW_BUFFER3_EXT 0x8828 -#define GL_DRAW_BUFFER4_EXT 0x8829 -#define GL_DRAW_BUFFER5_EXT 0x882A -#define GL_DRAW_BUFFER6_EXT 0x882B -#define GL_DRAW_BUFFER7_EXT 0x882C -#define GL_DRAW_BUFFER8_EXT 0x882D -#define GL_DRAW_BUFFER9_EXT 0x882E -#define GL_DRAW_BUFFER10_EXT 0x882F -#define GL_DRAW_BUFFER11_EXT 0x8830 -#define GL_DRAW_BUFFER12_EXT 0x8831 -#define GL_DRAW_BUFFER13_EXT 0x8832 -#define GL_DRAW_BUFFER14_EXT 0x8833 -#define GL_DRAW_BUFFER15_EXT 0x8834 -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#endif - -/* GL_EXT_map_buffer_range */ -#ifndef GL_EXT_map_buffer_range -#define GL_MAP_READ_BIT_EXT 0x0001 -#define GL_MAP_WRITE_BIT_EXT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 -#endif - -/* GL_EXT_multisampled_render_to_texture */ -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C -/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */ -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#endif - -/* GL_EXT_multiview_draw_buffers */ -#ifndef GL_EXT_multiview_draw_buffers -#define GL_COLOR_ATTACHMENT_EXT 0x90F0 -#define GL_MULTIVIEW_EXT 0x90F1 -#define GL_DRAW_BUFFER_EXT 0x0C01 -#define GL_READ_BUFFER_EXT 0x0C02 -#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 -#endif - -/* GL_EXT_multi_draw_arrays */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_occlusion_query_boolean */ -#ifndef GL_EXT_occlusion_query_boolean -#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#endif - -/* GL_EXT_read_format_bgra */ -#ifndef GL_EXT_read_format_bgra -#define GL_BGRA_EXT 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 -#endif - -/* GL_EXT_robustness */ -#ifndef GL_EXT_robustness -/* reuse GL_NO_ERROR */ -#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 -#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 -#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 -#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 -#endif - -/* GL_EXT_separate_shader_objects */ -#ifndef GL_EXT_separate_shader_objects -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_ACTIVE_PROGRAM_EXT 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -#endif - -/* GL_EXT_shader_framebuffer_fetch */ -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 -#endif - -/* GL_EXT_shader_texture_lod */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_shadow_samplers */ -#ifndef GL_EXT_shadow_samplers -#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C -#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D -#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E -#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 -#endif - -/* GL_EXT_sRGB */ -#ifndef GL_EXT_sRGB -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 -#endif - -/* GL_EXT_sRGB_write_control */ -#ifndef GL_EXT_sRGB_write_control -#define GL_EXT_sRGB_write_control 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#endif - -/* GL_EXT_texture_compression_dxt1 */ -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#endif - -/* GL_EXT_texture_filter_anisotropic */ -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_EXT_texture_rg */ -#ifndef GL_EXT_texture_rg -#define GL_RED_EXT 0x1903 -#define GL_RG_EXT 0x8227 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#endif - -/* GL_EXT_texture_sRGB_decode */ -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif - -/* GL_EXT_texture_storage */ -#ifndef GL_EXT_texture_storage -#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_ALPHA8_EXT 0x803C -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_RGBA32F_EXT 0x8814 -#define GL_RGB32F_EXT 0x8815 -#define GL_ALPHA32F_EXT 0x8816 -#define GL_LUMINANCE32F_EXT 0x8818 -#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 -/* reuse GL_RGBA16F_EXT */ -/* reuse GL_RGB16F_EXT */ -#define GL_ALPHA16F_EXT 0x881C -#define GL_LUMINANCE16F_EXT 0x881E -#define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGB10_EXT 0x8052 -#define GL_BGRA8_EXT 0x93A1 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#define GL_R32F_EXT 0x822E -#define GL_RG32F_EXT 0x8230 -#define GL_R16F_EXT 0x822D -#define GL_RG16F_EXT 0x822F -#endif - -/* GL_EXT_texture_type_2_10_10_10_REV */ -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 -#endif - -/* GL_EXT_unpack_subimage */ -#ifndef GL_EXT_unpack_subimage -#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 -#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 -#endif - -/*------------------------------------------------------------------------* - * DMP extension tokens - *------------------------------------------------------------------------*/ - -/* GL_DMP_shader_binary */ -#ifndef GL_DMP_shader_binary -#define GL_SHADER_BINARY_DMP 0x9250 -#endif - -/*------------------------------------------------------------------------* - * FJ extension tokens - *------------------------------------------------------------------------*/ - -/* GL_FJ_shader_binary_GCCSO */ -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 -#endif - -/*------------------------------------------------------------------------* - * IMG extension tokens - *------------------------------------------------------------------------*/ - -/* GL_IMG_program_binary */ -#ifndef GL_IMG_program_binary -#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 -#endif - -/* GL_IMG_read_format */ -#ifndef GL_IMG_read_format -#define GL_BGRA_IMG 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 -#endif - -/* GL_IMG_shader_binary */ -#ifndef GL_IMG_shader_binary -#define GL_SGX_BINARY_IMG 0x8C0A -#endif - -/* GL_IMG_texture_compression_pvrtc */ -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 -#endif - -/* GL_IMG_texture_compression_pvrtc2 */ -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 -#endif - -/* GL_IMG_multisampled_render_to_texture */ -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 -#define GL_MAX_SAMPLES_IMG 0x9135 -#define GL_TEXTURE_SAMPLES_IMG 0x9136 -#endif - -/*------------------------------------------------------------------------* - * NV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_NV_coverage_sample */ -#ifndef GL_NV_coverage_sample -#define GL_COVERAGE_COMPONENT_NV 0x8ED0 -#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 -#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 -#define GL_COVERAGE_BUFFERS_NV 0x8ED3 -#define GL_COVERAGE_SAMPLES_NV 0x8ED4 -#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 -#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 -#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 -#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 -#endif - -/* GL_NV_depth_nonlinear */ -#ifndef GL_NV_depth_nonlinear -#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C -#endif - -/* GL_NV_draw_buffers */ -#ifndef GL_NV_draw_buffers -#define GL_MAX_DRAW_BUFFERS_NV 0x8824 -#define GL_DRAW_BUFFER0_NV 0x8825 -#define GL_DRAW_BUFFER1_NV 0x8826 -#define GL_DRAW_BUFFER2_NV 0x8827 -#define GL_DRAW_BUFFER3_NV 0x8828 -#define GL_DRAW_BUFFER4_NV 0x8829 -#define GL_DRAW_BUFFER5_NV 0x882A -#define GL_DRAW_BUFFER6_NV 0x882B -#define GL_DRAW_BUFFER7_NV 0x882C -#define GL_DRAW_BUFFER8_NV 0x882D -#define GL_DRAW_BUFFER9_NV 0x882E -#define GL_DRAW_BUFFER10_NV 0x882F -#define GL_DRAW_BUFFER11_NV 0x8830 -#define GL_DRAW_BUFFER12_NV 0x8831 -#define GL_DRAW_BUFFER13_NV 0x8832 -#define GL_DRAW_BUFFER14_NV 0x8833 -#define GL_DRAW_BUFFER15_NV 0x8834 -#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 -#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 -#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 -#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 -#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 -#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 -#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 -#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 -#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 -#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 -#define GL_COLOR_ATTACHMENT10_NV 0x8CEA -#define GL_COLOR_ATTACHMENT11_NV 0x8CEB -#define GL_COLOR_ATTACHMENT12_NV 0x8CEC -#define GL_COLOR_ATTACHMENT13_NV 0x8CED -#define GL_COLOR_ATTACHMENT14_NV 0x8CEE -#define GL_COLOR_ATTACHMENT15_NV 0x8CEF -#endif - -/* GL_NV_draw_instanced */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_fbo_color_attachments */ -#ifndef GL_NV_fbo_color_attachments -#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF -/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */ -#endif - -/* GL_NV_fence */ -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -/* GL_NV_framebuffer_blit */ -#ifndef GL_NV_framebuffer_blit -#define GL_READ_FRAMEBUFFER_NV 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA -#endif - -/* GL_NV_framebuffer_multisample */ -#ifndef GL_NV_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 -#define GL_MAX_SAMPLES_NV 0x8D57 -#endif - -/* GL_NV_generate_mipmap_sRGB */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_instanced_arrays */ -#ifndef GL_NV_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE -#endif - -/* GL_NV_read_buffer */ -#ifndef GL_NV_read_buffer -#define GL_READ_BUFFER_NV 0x0C02 -#endif - -/* GL_NV_read_buffer_front */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_depth */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_depth_stencil */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_stencil */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_shadow_samplers_array */ -#ifndef GL_NV_shadow_samplers_array -#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 -#endif - -/* GL_NV_shadow_samplers_cube */ -#ifndef GL_NV_shadow_samplers_cube -#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 -#endif - -/* GL_NV_sRGB_formats */ -#ifndef GL_NV_sRGB_formats -#define GL_SLUMINANCE_NV 0x8C46 -#define GL_SLUMINANCE_ALPHA_NV 0x8C44 -#define GL_SRGB8_NV 0x8C41 -#define GL_SLUMINANCE8_NV 0x8C47 -#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F -#define GL_ETC1_SRGB8_NV 0x88EE -#endif - -/* GL_NV_texture_border_clamp */ -#ifndef GL_NV_texture_border_clamp -#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 -#define GL_CLAMP_TO_BORDER_NV 0x812D -#endif - -/* GL_NV_texture_compression_s3tc_update */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_texture_npot_2D_mipmap */ -/* No new tokens introduced by this extension. */ - -/*------------------------------------------------------------------------* - * QCOM extension tokens - *------------------------------------------------------------------------*/ - -/* GL_QCOM_alpha_test */ -#ifndef GL_QCOM_alpha_test -#define GL_ALPHA_TEST_QCOM 0x0BC0 -#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 -#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 -#endif - -/* GL_QCOM_binning_control */ -#ifndef GL_QCOM_binning_control -#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 -#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 -#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 -#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 -#endif - -/* GL_QCOM_driver_control */ -/* No new tokens introduced by this extension. */ - -/* GL_QCOM_extended_get */ -#ifndef GL_QCOM_extended_get -#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 -#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 -#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 -#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 -#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 -#define GL_TEXTURE_TYPE_QCOM 0x8BD7 -#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 -#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 -#define GL_TEXTURE_TARGET_QCOM 0x8BDA -#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB -#define GL_STATE_RESTORE 0x8BDC -#endif - -/* GL_QCOM_extended_get2 */ -/* No new tokens introduced by this extension. */ - -/* GL_QCOM_perfmon_global_mode */ -#ifndef GL_QCOM_perfmon_global_mode -#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 -#endif - -/* GL_QCOM_writeonly_rendering */ -#ifndef GL_QCOM_writeonly_rendering -#define GL_WRITEONLY_RENDERING_QCOM 0x8823 -#endif - -/* GL_QCOM_tiled_rendering */ -#ifndef GL_QCOM_tiled_rendering -#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 -#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 -#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 -#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 -#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 -#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 -#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 -#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 -#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 -#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 -#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 -#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 -#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 -#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 -#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 -#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 -#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 -#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 -#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 -#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 -#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 -#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 -#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 -#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 -#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 -#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 -#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 -#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 -#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 -#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 -#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 -#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 -#endif - -/*------------------------------------------------------------------------* - * VIV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_VIV_shader_binary */ -#ifndef GL_VIV_shader_binary -#define GL_SHADER_BINARY_VIV 0x8FC4 -#endif - -/*------------------------------------------------------------------------* - * End of extension tokens, start of corresponding extension functions - *------------------------------------------------------------------------*/ - -/*------------------------------------------------------------------------* - * OES extension functions - *------------------------------------------------------------------------*/ - -/* GL_OES_compressed_ETC1_RGB8_texture */ -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_OES_compressed_ETC1_RGB8_texture 1 -#endif - -/* GL_OES_compressed_paletted_texture */ -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#endif - -/* GL_OES_depth24 */ -#ifndef GL_OES_depth24 -#define GL_OES_depth24 1 -#endif - -/* GL_OES_depth32 */ -#ifndef GL_OES_depth32 -#define GL_OES_depth32 1 -#endif - -/* GL_OES_depth_texture */ -#ifndef GL_OES_depth_texture -#define GL_OES_depth_texture 1 -#endif - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - -/* GL_OES_EGL_image_external */ -#ifndef GL_OES_EGL_image_external -#define GL_OES_EGL_image_external 1 -/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ -#endif - -/* GL_OES_element_index_uint */ -#ifndef GL_OES_element_index_uint -#define GL_OES_element_index_uint 1 -#endif - -/* GL_OES_fbo_render_mipmap */ -#ifndef GL_OES_fbo_render_mipmap -#define GL_OES_fbo_render_mipmap 1 -#endif - -/* GL_OES_fragment_precision_high */ -#ifndef GL_OES_fragment_precision_high -#define GL_OES_fragment_precision_high 1 -#endif - -/* GL_OES_get_program_binary */ -#ifndef GL_OES_get_program_binary -#define GL_OES_get_program_binary 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); -#endif -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); -#endif - -/* GL_OES_mapbuffer */ -#ifndef GL_OES_mapbuffer -#define GL_OES_mapbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); -GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid **params); -#endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid **params); -#endif - -/* GL_OES_packed_depth_stencil */ -#ifndef GL_OES_packed_depth_stencil -#define GL_OES_packed_depth_stencil 1 -#endif - -/* GL_OES_required_internalformat */ -#ifndef GL_OES_required_internalformat -#define GL_OES_required_internalformat 1 -#endif - -/* GL_OES_rgb8_rgba8 */ -#ifndef GL_OES_rgb8_rgba8 -#define GL_OES_rgb8_rgba8 1 -#endif - -/* GL_OES_standard_derivatives */ -#ifndef GL_OES_standard_derivatives -#define GL_OES_standard_derivatives 1 -#endif - -/* GL_OES_stencil1 */ -#ifndef GL_OES_stencil1 -#define GL_OES_stencil1 1 -#endif - -/* GL_OES_stencil4 */ -#ifndef GL_OES_stencil4 -#define GL_OES_stencil4 1 -#endif - -#ifndef GL_OES_surfaceless_context -#define GL_OES_surfaceless_context 1 -#endif - -/* GL_OES_texture_3D */ -#ifndef GL_OES_texture_3D -#define GL_OES_texture_3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif - -/* GL_OES_texture_float */ -#ifndef GL_OES_texture_float -#define GL_OES_texture_float 1 -#endif - -/* GL_OES_texture_float_linear */ -#ifndef GL_OES_texture_float_linear -#define GL_OES_texture_float_linear 1 -#endif - -/* GL_OES_texture_half_float */ -#ifndef GL_OES_texture_half_float -#define GL_OES_texture_half_float 1 -#endif - -/* GL_OES_texture_half_float_linear */ -#ifndef GL_OES_texture_half_float_linear -#define GL_OES_texture_half_float_linear 1 -#endif - -/* GL_OES_texture_npot */ -#ifndef GL_OES_texture_npot -#define GL_OES_texture_npot 1 -#endif - -/* GL_OES_vertex_array_object */ -#ifndef GL_OES_vertex_array_object -#define GL_OES_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); -GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); -GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); -#endif -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); -#endif - -/* GL_OES_vertex_half_float */ -#ifndef GL_OES_vertex_half_float -#define GL_OES_vertex_half_float 1 -#endif - -/* GL_OES_vertex_type_10_10_10_2 */ -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_OES_vertex_type_10_10_10_2 1 -#endif - -/*------------------------------------------------------------------------* - * KHR extension functions - *------------------------------------------------------------------------*/ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); -GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, GLvoid **params); -#endif -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, GLvoid **params); -#endif - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif - - -/*------------------------------------------------------------------------* - * AMD extension functions - *------------------------------------------------------------------------*/ - -/* GL_AMD_compressed_3DC_texture */ -#ifndef GL_AMD_compressed_3DC_texture -#define GL_AMD_compressed_3DC_texture 1 -#endif - -/* GL_AMD_compressed_ATC_texture */ -#ifndef GL_AMD_compressed_ATC_texture -#define GL_AMD_compressed_ATC_texture 1 -#endif - -/* AMD_performance_monitor */ -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); -GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); -typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif - -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_AMD_program_binary_Z400 1 -#endif - -/*------------------------------------------------------------------------* - * ANGLE extension functions - *------------------------------------------------------------------------*/ - -/* GL_ANGLE_depth_texture */ -#ifndef GL_ANGLE_depth_texture -#define GL_ANGLE_depth_texture 1 -#endif - -/* GL_ANGLE_framebuffer_blit */ -#ifndef GL_ANGLE_framebuffer_blit -#define GL_ANGLE_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -/* GL_ANGLE_framebuffer_multisample */ -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_ANGLE_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_ANGLE_instanced_arrays -#define GL_ANGLE_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); -#endif - -/* GL_ANGLE_pack_reverse_row_order */ -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_ANGLE_pack_reverse_row_order 1 -#endif - -/* GL_ANGLE_program_binary */ -#ifndef GL_ANGLE_program_binary -#define GL_ANGLE_program_binary 1 -#endif - -/* GL_ANGLE_texture_compression_dxt3 */ -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_ANGLE_texture_compression_dxt3 1 -#endif - -/* GL_ANGLE_texture_compression_dxt5 */ -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_ANGLE_texture_compression_dxt5 1 -#endif - -/* GL_ANGLE_texture_usage */ -#ifndef GL_ANGLE_texture_usage -#define GL_ANGLE_texture_usage 1 -#endif - -#ifndef GL_ANGLE_translated_shader_source -#define GL_ANGLE_translated_shader_source 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -#endif -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -#endif - -/*------------------------------------------------------------------------* - * APPLE extension functions - *------------------------------------------------------------------------*/ - -/* GL_APPLE_copy_texture_levels */ -#ifndef GL_APPLE_copy_texture_levels -#define GL_APPLE_copy_texture_levels 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif - -/* GL_APPLE_framebuffer_multisample */ -#ifndef GL_APPLE_framebuffer_multisample -#define GL_APPLE_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); -#endif - -/* GL_APPLE_rgb_422 */ -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#endif - -/* GL_APPLE_sync */ -#ifndef GL_APPLE_sync -#define GL_APPLE_sync 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); -GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); -GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); -GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif -typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); -typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); -typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif - -/* GL_APPLE_texture_format_BGRA8888 */ -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_APPLE_texture_format_BGRA8888 1 -#endif - -/* GL_APPLE_texture_max_level */ -#ifndef GL_APPLE_texture_max_level -#define GL_APPLE_texture_max_level 1 -#endif - -/*------------------------------------------------------------------------* - * ARM extension functions - *------------------------------------------------------------------------*/ - -/* GL_ARM_mali_program_binary */ -#ifndef GL_ARM_mali_program_binary -#define GL_ARM_mali_program_binary 1 -#endif - -/* GL_ARM_mali_shader_binary */ -#ifndef GL_ARM_mali_shader_binary -#define GL_ARM_mali_shader_binary 1 -#endif - -/* GL_ARM_rgba8 */ -#ifndef GL_ARM_rgba8 -#define GL_ARM_rgba8 1 -#endif - -/*------------------------------------------------------------------------* - * EXT extension functions - *------------------------------------------------------------------------*/ - -/* GL_EXT_blend_minmax */ -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#endif - -/* GL_EXT_color_buffer_half_float */ -#ifndef GL_EXT_color_buffer_half_float -#define GL_EXT_color_buffer_half_float 1 -#endif - -/* GL_EXT_debug_label */ -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif - -/* GL_EXT_debug_marker */ -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); -#endif -typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#endif - -/* GL_EXT_discard_framebuffer */ -#ifndef GL_EXT_discard_framebuffer -#define GL_EXT_discard_framebuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif -typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif - -#ifndef GL_EXT_disjoint_timer_query -#define GL_EXT_disjoint_timer_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); -GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); -GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); -GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); -GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -#endif -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -#endif /* GL_EXT_disjoint_timer_query */ - -#ifndef GL_EXT_draw_buffers -#define GL_EXT_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); -#endif /* GL_EXT_draw_buffers */ - -/* GL_EXT_map_buffer_range */ -#ifndef GL_EXT_map_buffer_range -#define GL_EXT_map_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); -#endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#endif - -/* GL_EXT_multisampled_render_to_texture */ -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_EXT_multisampled_render_to_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif - -/* GL_EXT_multiview_draw_buffers */ -#ifndef GL_EXT_multiview_draw_buffers -#define GL_EXT_multiview_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); -GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); -GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); -#endif -typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); -typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); -#endif - -/* GL_EXT_occlusion_query_boolean */ -#ifndef GL_EXT_occlusion_query_boolean -#define GL_EXT_occlusion_query_boolean 1 -/* All entry points also exist in GL_EXT_disjoint_timer_query */ -#endif - -/* GL_EXT_read_format_bgra */ -#ifndef GL_EXT_read_format_bgra -#define GL_EXT_read_format_bgra 1 -#endif - -/* GL_EXT_robustness */ -#ifndef GL_EXT_robustness -#define GL_EXT_robustness 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); -GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif - -/* GL_EXT_separate_shader_objects */ -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); -GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); -GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); -GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x); -GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif - -/* GL_EXT_shader_framebuffer_fetch */ -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_EXT_shader_framebuffer_fetch 1 -#endif - -/* GL_EXT_shader_texture_lod */ -#ifndef GL_EXT_shader_texture_lod -#define GL_EXT_shader_texture_lod 1 -#endif - -/* GL_EXT_shadow_samplers */ -#ifndef GL_EXT_shadow_samplers -#define GL_EXT_shadow_samplers 1 -#endif - -/* GL_EXT_sRGB */ -#ifndef GL_EXT_sRGB -#define GL_EXT_sRGB 1 -#endif - -/* GL_EXT_texture_compression_dxt1 */ -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 -#endif - -/* GL_EXT_texture_filter_anisotropic */ -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_EXT_texture_format_BGRA8888 1 -#endif - -/* GL_EXT_texture_rg */ -#ifndef GL_EXT_texture_rg -#define GL_EXT_texture_rg 1 -#endif - -/* GL_EXT_texture_storage */ -#ifndef GL_EXT_texture_storage -#define GL_EXT_texture_storage 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif - -/* GL_EXT_texture_type_2_10_10_10_REV */ -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_EXT_texture_type_2_10_10_10_REV 1 -#endif - -/* GL_EXT_unpack_subimage */ -#ifndef GL_EXT_unpack_subimage -#define GL_EXT_unpack_subimage 1 -#endif - -/*------------------------------------------------------------------------* - * DMP extension functions - *------------------------------------------------------------------------*/ - -/* GL_DMP_shader_binary */ -#ifndef GL_DMP_shader_binary -#define GL_DMP_shader_binary 1 -#endif - -/*------------------------------------------------------------------------* - * FJ extension functions - *------------------------------------------------------------------------*/ - -/* GL_FJ_shader_binary_GCCSO */ -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_FJ_shader_binary_GCCSO 1 -#endif - -/*------------------------------------------------------------------------* - * IMG extension functions - *------------------------------------------------------------------------*/ - -/* GL_IMG_program_binary */ -#ifndef GL_IMG_program_binary -#define GL_IMG_program_binary 1 -#endif - -/* GL_IMG_read_format */ -#ifndef GL_IMG_read_format -#define GL_IMG_read_format 1 -#endif - -/* GL_IMG_shader_binary */ -#ifndef GL_IMG_shader_binary -#define GL_IMG_shader_binary 1 -#endif - -/* GL_IMG_texture_compression_pvrtc */ -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_IMG_texture_compression_pvrtc 1 -#endif - -/* GL_IMG_texture_compression_pvrtc2 */ -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_IMG_texture_compression_pvrtc2 1 -#endif - -/* GL_IMG_multisampled_render_to_texture */ -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_IMG_multisampled_render_to_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif - -/*------------------------------------------------------------------------* - * NV extension functions - *------------------------------------------------------------------------*/ - -/* GL_NV_coverage_sample */ -#ifndef GL_NV_coverage_sample -#define GL_NV_coverage_sample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); -GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); -#endif -typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); -typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); -#endif - -/* GL_NV_depth_nonlinear */ -#ifndef GL_NV_depth_nonlinear -#define GL_NV_depth_nonlinear 1 -#endif - -/* GL_NV_draw_buffers */ -#ifndef GL_NV_draw_buffers -#define GL_NV_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); -#endif - -/* GL_NV_draw_instanced */ -#ifndef GL_NV_draw_instanced -#define GL_NV_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -/* GL_NV_fbo_color_attachments */ -#ifndef GL_NV_fbo_color_attachments -#define GL_NV_fbo_color_attachments 1 -#endif - -/* GL_NV_fence */ -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); -GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -/* GL_NV_framebuffer_blit */ -#ifndef GL_NV_framebuffer_blit -#define GL_NV_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -/* GL_NV_framebuffer_multisample */ -#ifndef GL_NV_framebuffer_multisample -#define GL_NV_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -/* GL_NV_generate_mipmap_sRGB */ -#ifndef GL_NV_generate_mipmap_sRGB -#define GL_NV_generate_mipmap_sRGB 1 -#endif - -/* GL_NV_instanced_arrays */ -#ifndef GL_NV_instanced_arrays -#define GL_NV_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); -#endif -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); -#endif - -/* GL_NV_read_buffer */ -#ifndef GL_NV_read_buffer -#define GL_NV_read_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); -#endif -typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); -#endif - -/* GL_NV_read_buffer_front */ -#ifndef GL_NV_read_buffer_front -#define GL_NV_read_buffer_front 1 -#endif - -/* GL_NV_read_depth */ -#ifndef GL_NV_read_depth -#define GL_NV_read_depth 1 -#endif - -/* GL_NV_read_depth_stencil */ -#ifndef GL_NV_read_depth_stencil -#define GL_NV_read_depth_stencil 1 -#endif - -/* GL_NV_read_stencil */ -#ifndef GL_NV_read_stencil -#define GL_NV_read_stencil 1 -#endif - -/* GL_NV_shadow_samplers_array */ -#ifndef GL_NV_shadow_samplers_array -#define GL_NV_shadow_samplers_array 1 -#endif - -/* GL_NV_shadow_samplers_cube */ -#ifndef GL_NV_shadow_samplers_cube -#define GL_NV_shadow_samplers_cube 1 -#endif - -/* GL_NV_sRGB_formats */ -#ifndef GL_NV_sRGB_formats -#define GL_NV_sRGB_formats 1 -#endif - -/* GL_NV_texture_border_clamp */ -#ifndef GL_NV_texture_border_clamp -#define GL_NV_texture_border_clamp 1 -#endif - -/* GL_NV_texture_compression_s3tc_update */ -#ifndef GL_NV_texture_compression_s3tc_update -#define GL_NV_texture_compression_s3tc_update 1 -#endif - -/* GL_NV_texture_npot_2D_mipmap */ -#ifndef GL_NV_texture_npot_2D_mipmap -#define GL_NV_texture_npot_2D_mipmap 1 -#endif - -/*------------------------------------------------------------------------* - * QCOM extension functions - *------------------------------------------------------------------------*/ - -/* GL_QCOM_alpha_test */ -#ifndef GL_QCOM_alpha_test -#define GL_QCOM_alpha_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); -#endif -typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); -#endif - -/* GL_QCOM_binning_control */ -#ifndef GL_QCOM_binning_control -#define GL_QCOM_binning_control 1 -#endif - -/* GL_QCOM_driver_control */ -#ifndef GL_QCOM_driver_control -#define GL_QCOM_driver_control 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); -GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); -GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); -#endif -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -#endif - -/* GL_QCOM_extended_get */ -#ifndef GL_QCOM_extended_get -#define GL_QCOM_extended_get 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); -GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); -GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); -#endif -typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); -#endif - -/* GL_QCOM_extended_get2 */ -#ifndef GL_QCOM_extended_get2 -#define GL_QCOM_extended_get2 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); -GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); -GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif -typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif - -/* GL_QCOM_perfmon_global_mode */ -#ifndef GL_QCOM_perfmon_global_mode -#define GL_QCOM_perfmon_global_mode 1 -#endif - -/* GL_QCOM_writeonly_rendering */ -#ifndef GL_QCOM_writeonly_rendering -#define GL_QCOM_writeonly_rendering 1 -#endif - -/* GL_QCOM_tiled_rendering */ -#ifndef GL_QCOM_tiled_rendering -#define GL_QCOM_tiled_rendering 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); -#endif -typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); -#endif - -/*------------------------------------------------------------------------* - * VIV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_VIV_shader_binary */ -#ifndef GL_VIV_shader_binary -#define GL_VIV_shader_binary 1 -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __gl2ext_h_ */ diff --git a/Windows/SDL2/include/SDL_opengles2_gl2platform.h b/Windows/SDL2/include/SDL_opengles2_gl2platform.h deleted file mode 100644 index c325686f..00000000 --- a/Windows/SDL2/include/SDL_opengles2_gl2platform.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __gl2platform_h_ -#define __gl2platform_h_ - -/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h - * - * Adopters may modify khrplatform.h and this file to suit their platform. - * You are encouraged to submit all modifications to the Khronos group so that - * they can be included in future versions of this file. Please submit changes - * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) - * by filing a bug against product "OpenGL-ES" component "Registry". - */ - -/*#include <KHR/khrplatform.h>*/ - -#ifndef GL_APICALL -#define GL_APICALL KHRONOS_APICALL -#endif - -#ifndef GL_APIENTRY -#define GL_APIENTRY KHRONOS_APIENTRY -#endif - -#endif /* __gl2platform_h_ */ diff --git a/Windows/SDL2/include/SDL_opengles2_khrplatform.h b/Windows/SDL2/include/SDL_opengles2_khrplatform.h deleted file mode 100644 index c9e6f17d..00000000 --- a/Windows/SDL2/include/SDL_opengles2_khrplatform.h +++ /dev/null @@ -1,282 +0,0 @@ -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2009 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by sending them to the public Khronos Bugzilla - * (http://khronos.org/bugzilla) by filing a bug against product - * "Khronos (general)" component "Registry". - * - * A predefined template which fills in some of the bug fields can be - * reached using http://tinyurl.com/khrplatform-h-bugreport, but you - * must create a Bugzilla login first. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include <KHR/khrplatform.h> - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_APIENTRY - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIENTRY - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using <stdint.h> - */ -#include <stdint.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using <inttypes.h> - */ -#include <inttypes.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include <stdint.h> -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ diff --git a/Windows/SDL2/include/SDL_pixels.h b/Windows/SDL2/include/SDL_pixels.h deleted file mode 100644 index 753f617a..00000000 --- a/Windows/SDL2/include/SDL_pixels.h +++ /dev/null @@ -1,473 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_pixels.h - * - * Header for the enumerated pixel format definitions. - */ - -#ifndef SDL_pixels_h_ -#define SDL_pixels_h_ - -#include "SDL_stdinc.h" -#include "SDL_endian.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Transparency definitions - * - * These define alpha as the opacity of a surface. - */ -/* @{ */ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/* @} */ - -/** Pixel type. */ -typedef enum -{ - SDL_PIXELTYPE_UNKNOWN, - SDL_PIXELTYPE_INDEX1, - SDL_PIXELTYPE_INDEX4, - SDL_PIXELTYPE_INDEX8, - SDL_PIXELTYPE_PACKED8, - SDL_PIXELTYPE_PACKED16, - SDL_PIXELTYPE_PACKED32, - SDL_PIXELTYPE_ARRAYU8, - SDL_PIXELTYPE_ARRAYU16, - SDL_PIXELTYPE_ARRAYU32, - SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32 -} SDL_PixelType; - -/** Bitmap pixel order, high bit -> low bit. */ -typedef enum -{ - SDL_BITMAPORDER_NONE, - SDL_BITMAPORDER_4321, - SDL_BITMAPORDER_1234 -} SDL_BitmapOrder; - -/** Packed component order, high bit -> low bit. */ -typedef enum -{ - SDL_PACKEDORDER_NONE, - SDL_PACKEDORDER_XRGB, - SDL_PACKEDORDER_RGBX, - SDL_PACKEDORDER_ARGB, - SDL_PACKEDORDER_RGBA, - SDL_PACKEDORDER_XBGR, - SDL_PACKEDORDER_BGRX, - SDL_PACKEDORDER_ABGR, - SDL_PACKEDORDER_BGRA -} SDL_PackedOrder; - -/** Array component order, low byte -> high byte. */ -/* !!! FIXME: in 2.1, make these not overlap differently with - !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ -typedef enum -{ - SDL_ARRAYORDER_NONE, - SDL_ARRAYORDER_RGB, - SDL_ARRAYORDER_RGBA, - SDL_ARRAYORDER_ARGB, - SDL_ARRAYORDER_BGR, - SDL_ARRAYORDER_BGRA, - SDL_ARRAYORDER_ABGR -} SDL_ArrayOrder; - -/** Packed component layout. */ -typedef enum -{ - SDL_PACKEDLAYOUT_NONE, - SDL_PACKEDLAYOUT_332, - SDL_PACKEDLAYOUT_4444, - SDL_PACKEDLAYOUT_1555, - SDL_PACKEDLAYOUT_5551, - SDL_PACKEDLAYOUT_565, - SDL_PACKEDLAYOUT_8888, - SDL_PACKEDLAYOUT_2101010, - SDL_PACKEDLAYOUT_1010102 -} SDL_PackedLayout; - -#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) - -#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ - ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ - ((bits) << 8) | ((bytes) << 0)) - -#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) -#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) -#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) -#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) -#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) -#define SDL_BYTESPERPIXEL(X) \ - (SDL_ISPIXELFORMAT_FOURCC(X) ? \ - ((((X) == SDL_PIXELFORMAT_YUY2) || \ - ((X) == SDL_PIXELFORMAT_UYVY) || \ - ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) - -#define SDL_ISPIXELFORMAT_INDEXED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) - -#define SDL_ISPIXELFORMAT_PACKED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) - -#define SDL_ISPIXELFORMAT_ARRAY(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) - -#define SDL_ISPIXELFORMAT_ALPHA(format) \ - ((SDL_ISPIXELFORMAT_PACKED(format) && \ - ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ - (SDL_ISPIXELFORMAT_ARRAY(format) && \ - ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) - -/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ -#define SDL_ISPIXELFORMAT_FOURCC(format) \ - ((format) && (SDL_PIXELFLAG(format) != 1)) - -/* Note: If you modify this list, update SDL_GetPixelFormatName() */ -typedef enum -{ - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX1MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX4LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX4MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX8 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), - SDL_PIXELFORMAT_RGB332 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_RGB444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_BGR444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_RGB555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_BGR555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_ARGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_RGBA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ABGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_BGRA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ARGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_RGBA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_ABGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_BGRA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_RGB565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_BGR565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_RGB24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, - 24, 3), - SDL_PIXELFORMAT_BGR24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, - 24, 3), - SDL_PIXELFORMAT_RGB888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_RGBX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGR888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGRX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_ARGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_RGBA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ABGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_BGRA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ARGB2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_2101010, 32, 4), - - /* Aliases for RGBA byte arrays of color data, for the current platform */ -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, -#else - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, -#endif - - SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), - SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ - SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), - SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), - SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), - SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), - SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), - SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), - SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ - SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') -} SDL_PixelFormatEnum; - -typedef struct SDL_Color -{ - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette -{ - int ncolors; - SDL_Color *colors; - Uint32 version; - int refcount; -} SDL_Palette; - -/** - * \note Everything in the pixel format structure is read-only. - */ -typedef struct SDL_PixelFormat -{ - Uint32 format; - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 padding[2]; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - int refcount; - struct SDL_PixelFormat *next; -} SDL_PixelFormat; - -/** - * \brief Get the human readable name of a pixel format - */ -extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); - -/** - * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. - * - * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. - * - * \sa SDL_MasksToPixelFormatEnum() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, - int *bpp, - Uint32 * Rmask, - Uint32 * Gmask, - Uint32 * Bmask, - Uint32 * Amask); - -/** - * \brief Convert a bpp and RGBA masks to an enumerated pixel format. - * - * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion - * wasn't possible. - * - * \sa SDL_PixelFormatEnumToMasks() - */ -extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); - -/** - * \brief Create an SDL_PixelFormat structure from a pixel format enum. - */ -extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); - -/** - * \brief Free an SDL_PixelFormat structure. - */ -extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); - -/** - * \brief Create a palette structure with the specified number of color - * entries. - * - * \return A new palette, or NULL if there wasn't enough memory. - * - * \note The palette entries are initialized to white. - * - * \sa SDL_FreePalette() - */ -extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); - -/** - * \brief Set the palette for a pixel format structure. - */ -extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, - SDL_Palette *palette); - -/** - * \brief Set a range of colors in a palette. - * - * \param palette The palette to modify. - * \param colors An array of colors to copy into the palette. - * \param firstcolor The index of the first palette entry to modify. - * \param ncolors The number of entries to modify. - * - * \return 0 on success, or -1 if not all of the colors could be set. - */ -extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, - const SDL_Color * colors, - int firstcolor, int ncolors); - -/** - * \brief Free a palette created with SDL_AllocPalette(). - * - * \sa SDL_AllocPalette() - */ -extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); - -/** - * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. - * - * \sa SDL_MapRGBA - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b); - -/** - * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. - * - * \sa SDL_MapRGB - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \brief Get the RGB components from a pixel of the specified format. - * - * \sa SDL_GetRGBA - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b); - -/** - * \brief Get the RGBA components from a pixel of the specified format. - * - * \sa SDL_GetRGB - */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \brief Calculate a 256 entry gamma ramp for a gamma value. - */ -extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_pixels_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_platform.h b/Windows/SDL2/include/SDL_platform.h deleted file mode 100644 index c2cbc6b4..00000000 --- a/Windows/SDL2/include/SDL_platform.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_platform.h - * - * Try to get a standard set of platform defines. - */ - -#ifndef SDL_platform_h_ -#define SDL_platform_h_ - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if (defined(linux) || defined(__linux) || defined(__linux__)) -#undef __LINUX__ -#define __LINUX__ 1 -#endif -#if defined(ANDROID) || defined(__ANDROID__) -#undef __ANDROID__ -#undef __LINUX__ /* do we need to do this? */ -#define __ANDROID__ 1 -#endif - -#if defined(__APPLE__) -/* lets us know what version of Mac OS X we're compiling on */ -#include "AvailabilityMacros.h" -#include "TargetConditionals.h" -#if TARGET_OS_TV -#undef __TVOS__ -#define __TVOS__ 1 -#endif -#if TARGET_OS_IPHONE -/* if compiling for iOS */ -#undef __IPHONEOS__ -#define __IPHONEOS__ 1 -#undef __MACOSX__ -#else -/* if not compiling for iOS */ -#undef __MACOSX__ -#define __MACOSX__ 1 -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 -# error SDL for Mac OS X only supports deploying on 10.6 and above. -#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */ -#endif /* TARGET_OS_IPHONE */ -#endif /* defined(__APPLE__) */ - -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) || defined(__EMX__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__sun) && defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif - -#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) -/* Try to find out if we're compiling for WinRT or non-WinRT */ -#if defined(_MSC_VER) && defined(__has_include) -#if __has_include(<winapifamily.h>) -#define HAVE_WINAPIFAMILY_H 1 -#else -#define HAVE_WINAPIFAMILY_H 0 -#endif - -/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */ -#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */ -#define HAVE_WINAPIFAMILY_H 1 -#else -#define HAVE_WINAPIFAMILY_H 0 -#endif - -#if HAVE_WINAPIFAMILY_H -#include <winapifamily.h> -#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)) -#else -#define WINAPI_FAMILY_WINRT 0 -#endif /* HAVE_WINAPIFAMILY_H */ - -#if WINAPI_FAMILY_WINRT -#undef __WINRT__ -#define __WINRT__ 1 -#else -#undef __WINDOWS__ -#define __WINDOWS__ 1 -#endif -#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ - -#if defined(__WINDOWS__) -#undef __WIN32__ -#define __WIN32__ 1 -#endif -#if defined(__PSP__) -#undef __PSP__ -#define __PSP__ 1 -#endif - -/* The NACL compiler defines __native_client__ and __pnacl__ - * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi - */ -#if defined(__native_client__) -#undef __LINUX__ -#undef __NACL__ -#define __NACL__ 1 -#endif -#if defined(__pnacl__) -#undef __LINUX__ -#undef __PNACL__ -#define __PNACL__ 1 -/* PNACL with newlib supports static linking only */ -#define __SDL_NOGETPROCADDR__ -#endif - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Gets the name of the platform. - */ -extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_platform_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_power.h b/Windows/SDL2/include/SDL_power.h deleted file mode 100644 index 4831cb77..00000000 --- a/Windows/SDL2/include/SDL_power.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_power_h_ -#define SDL_power_h_ - -/** - * \file SDL_power.h - * - * Header for the SDL power management routines. - */ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The basic state for the system's power supply. - */ -typedef enum -{ - SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ - SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ - SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ - SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ - SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ -} SDL_PowerState; - - -/** - * \brief Get the current power supply details. - * - * \param secs Seconds of battery life left. You can pass a NULL here if - * you don't care. Will return -1 if we can't determine a - * value, or we're not running on a battery. - * - * \param pct Percentage of battery life left, between 0 and 100. You can - * pass a NULL here if you don't care. Will return -1 if we - * can't determine a value, or we're not running on a battery. - * - * \return The state of the battery (if any). - */ -extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_power_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_quit.h b/Windows/SDL2/include/SDL_quit.h deleted file mode 100644 index c979983c..00000000 --- a/Windows/SDL2/include/SDL_quit.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_quit.h - * - * Include file for SDL quit event handling. - */ - -#ifndef SDL_quit_h_ -#define SDL_quit_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/** - * \file SDL_quit.h - * - * An ::SDL_QUIT event is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate ::SDL_QUIT events as well. There is no way - * to determine the cause of an ::SDL_QUIT event, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - * - * \sa SDL_Quit() - */ - -/* There are no functions directly affecting the quit event */ - -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) - -#endif /* SDL_quit_h_ */ diff --git a/Windows/SDL2/include/SDL_rect.h b/Windows/SDL2/include/SDL_rect.h deleted file mode 100644 index 71a41151..00000000 --- a/Windows/SDL2/include/SDL_rect.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_rect.h - * - * Header file for SDL_rect definition and management functions. - */ - -#ifndef SDL_rect_h_ -#define SDL_rect_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_pixels.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a point (integer) - * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect - */ -typedef struct SDL_Point -{ - int x; - int y; -} SDL_Point; - -/** - * \brief The structure that defines a point (floating point) - * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect - */ -typedef struct SDL_FPoint -{ - float x; - float y; -} SDL_FPoint; - - -/** - * \brief A rectangle, with the origin at the upper left (integer). - * - * \sa SDL_RectEmpty - * \sa SDL_RectEquals - * \sa SDL_HasIntersection - * \sa SDL_IntersectRect - * \sa SDL_UnionRect - * \sa SDL_EnclosePoints - */ -typedef struct SDL_Rect -{ - int x, y; - int w, h; -} SDL_Rect; - - -/** - * \brief A rectangle, with the origin at the upper left (floating point). - */ -typedef struct SDL_FRect -{ - float x; - float y; - float w; - float h; -} SDL_FRect; - - -/** - * \brief Returns true if point resides inside a rectangle. - */ -SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) -{ - return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && - (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Returns true if the rectangle has no area. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) -{ - return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Returns true if the two rectangles are equal. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) -{ - return (a && b && (a->x == b->x) && (a->y == b->y) && - (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * \brief Determine whether two rectangles intersect. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, - const SDL_Rect * B); - -/** - * \brief Calculate the intersection of two rectangles. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * \brief Calculate the union of two rectangles. - */ -extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * \brief Calculate a minimal rectangle enclosing a set of points - * - * \return SDL_TRUE if any points were within the clipping rect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, - int count, - const SDL_Rect * clip, - SDL_Rect * result); - -/** - * \brief Calculate the intersection of a rectangle and line segment. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * - rect, int *X1, - int *Y1, int *X2, - int *Y2); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_rect_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_render.h b/Windows/SDL2/include/SDL_render.h deleted file mode 100644 index f98c1843..00000000 --- a/Windows/SDL2/include/SDL_render.h +++ /dev/null @@ -1,1158 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_render.h - * - * Header file for SDL 2D rendering functions. - * - * This API supports the following features: - * * single pixel points - * * single pixel lines - * * filled rectangles - * * texture images - * - * The primitives may be drawn in opaque, blended, or additive modes. - * - * The texture images may be drawn in opaque, blended, or additive modes. - * They can have an additional color tint or alpha modulation applied to - * them, and may also be stretched with linear interpolation. - * - * This API is designed to accelerate simple 2D operations. You may - * want more functionality such as polygons and particle effects and - * in that case you should use SDL's OpenGL/Direct3D support or one - * of the many good 3D engines. - * - * These functions must be called from the main thread. - * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 - */ - -#ifndef SDL_render_h_ -#define SDL_render_h_ - -#include "SDL_stdinc.h" -#include "SDL_rect.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Flags used when creating a rendering context - */ -typedef enum -{ - SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ - SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware - acceleration */ - SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized - with the refresh rate */ - SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports - rendering to texture */ -} SDL_RendererFlags; - -/** - * \brief Information on the capabilities of a render driver or context. - */ -typedef struct SDL_RendererInfo -{ - const char *name; /**< The name of the renderer */ - Uint32 flags; /**< Supported ::SDL_RendererFlags */ - Uint32 num_texture_formats; /**< The number of available texture formats */ - Uint32 texture_formats[16]; /**< The available texture formats */ - int max_texture_width; /**< The maximum texture width */ - int max_texture_height; /**< The maximum texture height */ -} SDL_RendererInfo; - -/** - * \brief The scaling mode for a texture. - */ -typedef enum -{ - SDL_ScaleModeNearest, /**< nearest pixel sampling */ - SDL_ScaleModeLinear, /**< linear filtering */ - SDL_ScaleModeBest /**< anisotropic filtering */ -} SDL_ScaleMode; - -/** - * \brief The access pattern allowed for a texture. - */ -typedef enum -{ - SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ - SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ - SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ -} SDL_TextureAccess; - -/** - * \brief The texture channel modulation used in SDL_RenderCopy(). - */ -typedef enum -{ - SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ - SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ - SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ -} SDL_TextureModulate; - -/** - * \brief Flip constants for SDL_RenderCopyEx - */ -typedef enum -{ - SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ - SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ - SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ -} SDL_RendererFlip; - -/** - * \brief A structure representing rendering state - */ -struct SDL_Renderer; -typedef struct SDL_Renderer SDL_Renderer; - -/** - * \brief An efficient driver-specific representation of pixel data - */ -struct SDL_Texture; -typedef struct SDL_Texture SDL_Texture; - - -/* Function prototypes */ - -/** - * \brief Get the number of 2D rendering drivers available for the current - * display. - * - * A render driver is a set of code that handles rendering and texture - * management on a particular display. Normally there is only one, but - * some drivers may have several available with different capabilities. - * - * \sa SDL_GetRenderDriverInfo() - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); - -/** - * \brief Get information about a specific 2D rendering driver for the current - * display. - * - * \param index The index of the driver to query information about. - * \param info A pointer to an SDL_RendererInfo struct to be filled with - * information on the rendering driver. - * - * \return 0 on success, -1 if the index was out of range. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, - SDL_RendererInfo * info); - -/** - * \brief Create a window and default renderer - * - * \param width The width of the window - * \param height The height of the window - * \param window_flags The flags used to create the window - * \param window A pointer filled with the window, or NULL on error - * \param renderer A pointer filled with the renderer, or NULL on error - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( - int width, int height, Uint32 window_flags, - SDL_Window **window, SDL_Renderer **renderer); - - -/** - * \brief Create a 2D rendering context for a window. - * - * \param window The window where rendering is displayed. - * \param index The index of the rendering driver to initialize, or -1 to - * initialize the first one supporting the requested flags. - * \param flags ::SDL_RendererFlags. - * - * \return A valid rendering context or NULL if there was an error. - * - * \sa SDL_CreateSoftwareRenderer() - * \sa SDL_GetRendererInfo() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, - int index, Uint32 flags); - -/** - * \brief Create a 2D software rendering context for a surface. - * - * \param surface The surface where rendering is done. - * - * \return A valid rendering context or NULL if there was an error. - * - * \sa SDL_CreateRenderer() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); - -/** - * \brief Get the renderer associated with a window. - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); - -/** - * \brief Get information about a rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, - SDL_RendererInfo * info); - -/** - * \brief Get the output size in pixels of a rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, - int *w, int *h); - -/** - * \brief Create a texture for a rendering context. - * - * \param renderer The renderer. - * \param format The format of the texture. - * \param access One of the enumerated values in ::SDL_TextureAccess. - * \param w The width of the texture in pixels. - * \param h The height of the texture in pixels. - * - * \return The created texture is returned, or NULL if no rendering context was - * active, the format was unsupported, or the width or height were out - * of range. - * - * \note The contents of the texture are not defined at creation. - * - * \sa SDL_QueryTexture() - * \sa SDL_UpdateTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, - Uint32 format, - int access, int w, - int h); - -/** - * \brief Create a texture from an existing surface. - * - * \param renderer The renderer. - * \param surface The surface containing pixel data used to fill the texture. - * - * \return The created texture is returned, or NULL on error. - * - * \note The surface is not modified or freed by this function. - * - * \sa SDL_QueryTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); - -/** - * \brief Query the attributes of a texture - * - * \param texture A texture to be queried. - * \param format A pointer filled in with the raw format of the texture. The - * actual format may differ, but pixel transfers will use this - * format. - * \param access A pointer filled in with the actual access to the texture. - * \param w A pointer filled in with the width of the texture in pixels. - * \param h A pointer filled in with the height of the texture in pixels. - * - * \return 0 on success, or -1 if the texture is not valid. - */ -extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, - Uint32 * format, int *access, - int *w, int *h); - -/** - * \brief Set an additional color value used in render copy operations. - * - * \param texture The texture to update. - * \param r The red color value multiplied into copy operations. - * \param g The green color value multiplied into copy operations. - * \param b The blue color value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or color modulation - * is not supported. - * - * \sa SDL_GetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \brief Get the additional color value used in render copy operations. - * - * \param texture The texture to query. - * \param r A pointer filled in with the current red color value. - * \param g A pointer filled in with the current green color value. - * \param b A pointer filled in with the current blue color value. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \brief Set an additional alpha value used in render copy operations. - * - * \param texture The texture to update. - * \param alpha The alpha value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or alpha modulation - * is not supported. - * - * \sa SDL_GetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, - Uint8 alpha); - -/** - * \brief Get the additional alpha value used in render copy operations. - * - * \param texture The texture to query. - * \param alpha A pointer filled in with the current alpha value. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, - Uint8 * alpha); - -/** - * \brief Set the blend mode used for texture copy operations. - * - * \param texture The texture to update. - * \param blendMode ::SDL_BlendMode to use for texture blending. - * - * \return 0 on success, or -1 if the texture is not valid or the blend mode is - * not supported. - * - * \note If the blend mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for texture copy operations. - * - * \param texture The texture to query. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode *blendMode); - -/** - * \brief Set the scale mode used for texture scale operations. - * - * \param texture The texture to update. - * \param scaleMode ::SDL_ScaleMode to use for texture scaling. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note If the scale mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetTextureScaleMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, - SDL_ScaleMode scaleMode); - -/** - * \brief Get the scale mode used for texture scale operations. - * - * \param texture The texture to query. - * \param scaleMode A pointer filled in with the current scale mode. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \sa SDL_SetTextureScaleMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, - SDL_ScaleMode *scaleMode); - -/** - * \brief Update the given texture rectangle with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param pixels The raw pixel data in the format of the texture. - * \param pitch The number of bytes in a row of pixel data, including padding between lines. - * - * The pixel data must be in the format of the texture. The pixel format can be - * queried with SDL_QueryTexture. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note This is a fairly slow function. - */ -extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const void *pixels, int pitch); - -/** - * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param Yplane The raw pixel data for the Y plane. - * \param Ypitch The number of bytes between rows of pixel data for the Y plane. - * \param Uplane The raw pixel data for the U plane. - * \param Upitch The number of bytes between rows of pixel data for the U plane. - * \param Vplane The raw pixel data for the V plane. - * \param Vpitch The number of bytes between rows of pixel data for the V plane. - * - * \return 0 on success, or -1 if the texture is not valid. - * - * \note You can use SDL_UpdateTexture() as long as your pixel data is - * a contiguous block of Y and U/V planes in the proper order, but - * this function is available if your pixel data is not contiguous. - */ -extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch); - -/** - * \brief Lock a portion of the texture for write-only pixel access. - * - * \param texture The texture to lock for access, which was created with - * ::SDL_TEXTUREACCESS_STREAMING. - * \param rect A pointer to the rectangle to lock for access. If the rect - * is NULL, the entire texture will be locked. - * \param pixels This is filled in with a pointer to the locked pixels, - * appropriately offset by the locked area. - * \param pitch This is filled in with the pitch of the locked pixels. - * - * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. - * - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, - const SDL_Rect * rect, - void **pixels, int *pitch); - -/** - * \brief Lock a portion of the texture for write-only pixel access. - * Expose it as a SDL surface. - * - * \param texture The texture to lock for access, which was created with - * ::SDL_TEXTUREACCESS_STREAMING. - * \param rect A pointer to the rectangle to lock for access. If the rect - * is NULL, the entire texture will be locked. - * \param surface This is filled in with a SDL surface representing the locked area - * Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture. - * - * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. - * - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); - -/** - * \brief Unlock a texture, uploading the changes to video memory, if needed. - * If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed. - * - * \sa SDL_LockTexture() - * \sa SDL_LockTextureToSurface() - */ -extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); - -/** - * \brief Determines whether a window supports the use of render targets - * - * \param renderer The renderer that will be checked - * - * \return SDL_TRUE if supported, SDL_FALSE if not. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); - -/** - * \brief Set a texture as the current rendering target. - * - * \param renderer The renderer. - * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target - * - * \return 0 on success, or -1 on error - * - * \sa SDL_GetRenderTarget() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, - SDL_Texture *texture); - -/** - * \brief Get the current render target or NULL for the default render target. - * - * \return The current render target - * - * \sa SDL_SetRenderTarget() - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); - -/** - * \brief Set device independent resolution for rendering - * - * \param renderer The renderer for which resolution should be set. - * \param w The width of the logical resolution - * \param h The height of the logical resolution - * - * This function uses the viewport and scaling functionality to allow a fixed logical - * resolution for rendering, regardless of the actual output resolution. If the actual - * output resolution doesn't have the same aspect ratio the output rendering will be - * centered within the output display. - * - * If the output display is a window, mouse events in the window will be filtered - * and scaled so they seem to arrive within the logical resolution. - * - * \note If this function results in scaling or subpixel drawing by the - * rendering backend, it will be handled using the appropriate - * quality hints. - * - * \sa SDL_RenderGetLogicalSize() - * \sa SDL_RenderSetScale() - * \sa SDL_RenderSetViewport() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); - -/** - * \brief Get device independent resolution for rendering - * - * \param renderer The renderer from which resolution should be queried. - * \param w A pointer filled with the width of the logical resolution - * \param h A pointer filled with the height of the logical resolution - * - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); - -/** - * \brief Set whether to force integer scales for resolution-independent rendering - * - * \param renderer The renderer for which integer scaling should be set. - * \param enable Enable or disable integer scaling - * - * This function restricts the logical viewport to integer values - that is, when - * a resolution is between two multiples of a logical size, the viewport size is - * rounded down to the lower multiple. - * - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer, - SDL_bool enable); - -/** - * \brief Get whether integer scales are forced for resolution-independent rendering - * - * \param renderer The renderer from which integer scaling should be queried. - * - * \sa SDL_RenderSetIntegerScale() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer); - -/** - * \brief Set the drawing area for rendering on the current target. - * - * \param renderer The renderer for which the drawing area should be set. - * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. - * - * The x,y of the viewport rect represents the origin for rendering. - * - * \return 0 on success, or -1 on error - * - * \note If the window associated with the renderer is resized, the viewport is automatically reset. - * - * \sa SDL_RenderGetViewport() - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Get the drawing area for the current target. - * - * \sa SDL_RenderSetViewport() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * \brief Set the clip rectangle for the current target. - * - * \param renderer The renderer for which clip rectangle should be set. - * \param rect A pointer to the rectangle to set as the clip rectangle, or - * NULL to disable clipping. - * - * \return 0 on success, or -1 on error - * - * \sa SDL_RenderGetClipRect() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Get the clip rectangle for the current target. - * - * \param renderer The renderer from which clip rectangle should be queried. - * \param rect A pointer filled in with the current clip rectangle, or - * an empty rectangle if clipping is disabled. - * - * \sa SDL_RenderSetClipRect() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * \brief Get whether clipping is enabled on the given renderer. - * - * \param renderer The renderer from which clip state should be queried. - * - * \sa SDL_RenderGetClipRect() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); - - -/** - * \brief Set the drawing scale for rendering on the current target. - * - * \param renderer The renderer for which the drawing scale should be set. - * \param scaleX The horizontal scaling factor - * \param scaleY The vertical scaling factor - * - * The drawing coordinates are scaled by the x/y scaling factors - * before they are used by the renderer. This allows resolution - * independent drawing with a single coordinate system. - * - * \note If this results in scaling or subpixel drawing by the - * rendering backend, it will be handled using the appropriate - * quality hints. For best results use integer scaling factors. - * - * \sa SDL_RenderGetScale() - * \sa SDL_RenderSetLogicalSize() - */ -extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, - float scaleX, float scaleY); - -/** - * \brief Get the drawing scale for the current target. - * - * \param renderer The renderer from which drawing scale should be queried. - * \param scaleX A pointer filled in with the horizontal scaling factor - * \param scaleY A pointer filled in with the vertical scaling factor - * - * \sa SDL_RenderSetScale() - */ -extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, - float *scaleX, float *scaleY); - -/** - * \brief Set the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer The renderer for which drawing color should be set. - * \param r The red value used to draw on the rendering target. - * \param g The green value used to draw on the rendering target. - * \param b The blue value used to draw on the rendering target. - * \param a The alpha value used to draw on the rendering target, usually - * ::SDL_ALPHA_OPAQUE (255). - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \brief Get the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer The renderer from which drawing color should be queried. - * \param r A pointer to the red value used to draw on the rendering target. - * \param g A pointer to the green value used to draw on the rendering target. - * \param b A pointer to the blue value used to draw on the rendering target. - * \param a A pointer to the alpha value used to draw on the rendering target, - * usually ::SDL_ALPHA_OPAQUE (255). - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \brief Set the blend mode used for drawing operations (Fill and Line). - * - * \param renderer The renderer for which blend mode should be set. - * \param blendMode ::SDL_BlendMode to use for blending. - * - * \return 0 on success, or -1 on error - * - * \note If the blend mode is not supported, the closest supported mode is - * chosen. - * - * \sa SDL_GetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for drawing operations. - * - * \param renderer The renderer from which blend mode should be queried. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 on error - * - * \sa SDL_SetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode *blendMode); - -/** - * \brief Clear the current rendering target with the drawing color - * - * This function clears the entire rendering target, ignoring the viewport and - * the clip rectangle. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); - -/** - * \brief Draw a point on the current rendering target. - * - * \param renderer The renderer which should draw a point. - * \param x The x coordinate of the point. - * \param y The y coordinate of the point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, - int x, int y); - -/** - * \brief Draw multiple points on the current rendering target. - * - * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * \brief Draw a line on the current rendering target. - * - * \param renderer The renderer which should draw a line. - * \param x1 The x coordinate of the start point. - * \param y1 The y coordinate of the start point. - * \param x2 The x coordinate of the end point. - * \param y2 The y coordinate of the end point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, - int x1, int y1, int x2, int y2); - -/** - * \brief Draw a series of connected lines on the current rendering target. - * - * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * \brief Draw a rectangle on the current rendering target. - * - * \param renderer The renderer which should draw a rectangle. - * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Draw some number of rectangles on the current rendering target. - * - * \param renderer The renderer which should draw multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * \brief Fill a rectangle on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill a rectangle. - * \param rect A pointer to the destination rectangle, or NULL for the entire - * rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * \brief Fill some number of rectangles on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * \brief Copy a portion of the texture to the current rendering target. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); - -/** - * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction - * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). - * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect, - const double angle, - const SDL_Point *center, - const SDL_RendererFlip flip); - - -/** - * \brief Draw a point on the current rendering target. - * - * \param renderer The renderer which should draw a point. - * \param x The x coordinate of the point. - * \param y The y coordinate of the point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer, - float x, float y); - -/** - * \brief Draw multiple points on the current rendering target. - * - * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer, - const SDL_FPoint * points, - int count); - -/** - * \brief Draw a line on the current rendering target. - * - * \param renderer The renderer which should draw a line. - * \param x1 The x coordinate of the start point. - * \param y1 The y coordinate of the start point. - * \param x2 The x coordinate of the end point. - * \param y2 The y coordinate of the end point. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer, - float x1, float y1, float x2, float y2); - -/** - * \brief Draw a series of connected lines on the current rendering target. - * - * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer, - const SDL_FPoint * points, - int count); - -/** - * \brief Draw a rectangle on the current rendering target. - * - * \param renderer The renderer which should draw a rectangle. - * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer, - const SDL_FRect * rect); - -/** - * \brief Draw some number of rectangles on the current rendering target. - * - * \param renderer The renderer which should draw multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, - int count); - -/** - * \brief Fill a rectangle on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill a rectangle. - * \param rect A pointer to the destination rectangle, or NULL for the entire - * rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer, - const SDL_FRect * rect); - -/** - * \brief Fill some number of rectangles on the current rendering target with the drawing color. - * - * \param renderer The renderer which should fill multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, - int count); - -/** - * \brief Copy a portion of the texture to the current rendering target. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_FRect * dstrect); - -/** - * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction - * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). - * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture - * - * \return 0 on success, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_FRect * dstrect, - const double angle, - const SDL_FPoint *center, - const SDL_RendererFlip flip); - -/** - * \brief Read pixels from the current rendering target. - * - * \param renderer The renderer from which pixels should be read. - * \param rect A pointer to the rectangle to read, or NULL for the entire - * render target. - * \param format The desired format of the pixel data, or 0 to use the format - * of the rendering target - * \param pixels A pointer to be filled in with the pixel data - * \param pitch The pitch of the pixels parameter. - * - * \return 0 on success, or -1 if pixel reading is not supported. - * - * \warning This is a very slow operation, and should not be used frequently. - */ -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, - const SDL_Rect * rect, - Uint32 format, - void *pixels, int pitch); - -/** - * \brief Update the screen with rendering performed. - */ -extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); - -/** - * \brief Destroy the specified texture. - * - * \sa SDL_CreateTexture() - * \sa SDL_CreateTextureFromSurface() - */ -extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); - -/** - * \brief Destroy the rendering context for a window and free associated - * textures. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); - -/** - * \brief Force the rendering context to flush any pending commands to the - * underlying rendering API. - * - * You do not need to (and in fact, shouldn't) call this function unless - * you are planning to call into OpenGL/Direct3D/Metal/whatever directly - * in addition to using an SDL_Renderer. - * - * This is for a very-specific case: if you are using SDL's render API, - * you asked for a specific renderer backend (OpenGL, Direct3D, etc), - * you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make - * OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of - * this applies, you should call SDL_RenderFlush() between calls to SDL's - * render API and the low-level API you're using in cooperation. - * - * In all other cases, you can ignore this function. This is only here to - * get maximum performance out of a specific situation. In all other cases, - * SDL will do the right thing, perhaps at a performance loss. - * - * This function is first available in SDL 2.0.10, and is not needed in - * 2.0.9 and earlier, as earlier versions did not queue rendering commands - * at all, instead flushing them to the OS immediately. - */ -extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer); - - -/** - * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with - * OpenGL instructions. - * - * \param texture The SDL texture to bind - * \param texw A pointer to a float that will be filled with the texture width - * \param texh A pointer to a float that will be filled with the texture height - * - * \return 0 on success, or -1 if the operation is not supported - */ -extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); - -/** - * \brief Unbind a texture from the current OpenGL/ES/ES2 context. - * - * \param texture The SDL texture to unbind - * - * \return 0 on success, or -1 if the operation is not supported - */ -extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); - -/** - * \brief Get the CAMetalLayer associated with the given Metal renderer - * - * \param renderer The renderer to query - * - * \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer - * - * \sa SDL_RenderGetMetalCommandEncoder() - */ -extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer); - -/** - * \brief Get the Metal command encoder for the current frame - * - * \param renderer The renderer to query - * - * \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer - * - * \sa SDL_RenderGetMetalLayer() - */ -extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_render_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_revision.h b/Windows/SDL2/include/SDL_revision.h deleted file mode 100644 index 6996d603..00000000 --- a/Windows/SDL2/include/SDL_revision.h +++ /dev/null @@ -1,2 +0,0 @@ -#define SDL_REVISION "hg-13387:8a12cc1abc9e" -#define SDL_REVISION_NUMBER 13387 diff --git a/Windows/SDL2/include/SDL_rwops.h b/Windows/SDL2/include/SDL_rwops.h deleted file mode 100644 index f66119fb..00000000 --- a/Windows/SDL2/include/SDL_rwops.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_rwops.h - * - * This file provides a general interface for SDL to read and write - * data streams. It can easily be extended to files, memory, etc. - */ - -#ifndef SDL_rwops_h_ -#define SDL_rwops_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* RWops Types */ -#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */ -#define SDL_RWOPS_WINFILE 1U /**< Win32 file */ -#define SDL_RWOPS_STDFILE 2U /**< Stdio file */ -#define SDL_RWOPS_JNIFILE 3U /**< Android asset */ -#define SDL_RWOPS_MEMORY 4U /**< Memory stream */ -#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */ - -/** - * This is the read/write operation structure -- very basic. - */ -typedef struct SDL_RWops -{ - /** - * Return the size of the file in this rwops, or -1 if unknown - */ - Sint64 (SDLCALL * size) (struct SDL_RWops * context); - - /** - * Seek to \c offset relative to \c whence, one of stdio's whence values: - * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - * - * \return the final offset in the data stream, or -1 on error. - */ - Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, - int whence); - - /** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. - * - * \return the number of objects read, or 0 at error or end of file. - */ - size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, - size_t size, size_t maxnum); - - /** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. - * - * \return the number of objects written, or 0 at error or end of file. - */ - size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, - size_t size, size_t num); - - /** - * Close and free an allocated SDL_RWops structure. - * - * \return 0 if successful or -1 on write error when flushing data. - */ - int (SDLCALL * close) (struct SDL_RWops * context); - - Uint32 type; - union - { -#if defined(__ANDROID__) - struct - { - void *fileNameRef; - void *inputStreamRef; - void *readableByteChannelRef; - void *readMethod; - void *assetFileDescriptorRef; - long position; - long size; - long offset; - int fd; - } androidio; -#elif defined(__WIN32__) - struct - { - SDL_bool append; - void *h; - struct - { - void *data; - size_t size; - size_t left; - } buffer; - } windowsio; -#endif - -#ifdef HAVE_STDIO_H - struct - { - SDL_bool autoclose; - FILE *fp; - } stdio; -#endif - struct - { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct - { - void *data1; - void *data2; - } unknown; - } hidden; - -} SDL_RWops; - - -/** - * \name RWFrom functions - * - * Functions to create SDL_RWops structures from various data streams. - */ -/* @{ */ - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, - const char *mode); - -#ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, - SDL_bool autoclose); -#else -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, - SDL_bool autoclose); -#endif - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, - int size); - -/* @} *//* RWFrom functions */ - - -extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); - -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ - -/** - * Return the size of the file in this rwops, or -1 if unknown - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context); - -/** - * Seek to \c offset relative to \c whence, one of stdio's whence values: - * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - * - * \return the final offset in the data stream, or -1 on error. - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, - Sint64 offset, int whence); - -/** - * Return the current offset in the data stream, or -1 on error. - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context); - -/** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. - * - * \return the number of objects read, or 0 at error or end of file. - */ -extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, - void *ptr, size_t size, size_t maxnum); - -/** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. - * - * \return the number of objects written, or 0 at error or end of file. - */ -extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, - const void *ptr, size_t size, size_t num); - -/** - * Close and free an allocated SDL_RWops structure. - * - * \return 0 if successful or -1 on write error when flushing data. - */ -extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context); - -/** - * Load all the data from an SDL data stream. - * - * The data is allocated with a zero byte at the end (null terminated) - * - * If \c datasize is not NULL, it is filled with the size of the data read. - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The data should be freed with SDL_free(). - * - * \return the data, or NULL if there was an error. - */ -extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, - int freesrc); - -/** - * Load an entire file. - * - * The data is allocated with a zero byte at the end (null terminated) - * - * If \c datasize is not NULL, it is filled with the size of the data read. - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The data should be freed with SDL_free(). - * - * \return the data, or NULL if there was an error. - */ -extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); - -/** - * \name Read endian functions - * - * Read an item of the specified endianness and return in native format. - */ -/* @{ */ -extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); -/* @} *//* Read endian functions */ - -/** - * \name Write endian functions - * - * Write an item of native format to the specified endianness. - */ -/* @{ */ -extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); -extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); -/* @} *//* Write endian functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_rwops_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_scancode.h b/Windows/SDL2/include/SDL_scancode.h deleted file mode 100644 index a50305f5..00000000 --- a/Windows/SDL2/include/SDL_scancode.h +++ /dev/null @@ -1,413 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_scancode.h - * - * Defines keyboard scancodes. - */ - -#ifndef SDL_scancode_h_ -#define SDL_scancode_h_ - -#include "SDL_stdinc.h" - -/** - * \brief The SDL keyboard scancode representation. - * - * Values of this type are used to represent keyboard keys, among other places - * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the - * SDL_Event structure. - * - * The values in this enumeration are based on the USB usage page standard: - * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf - */ -typedef enum -{ - SDL_SCANCODE_UNKNOWN = 0, - - /** - * \name Usage page 0x07 - * - * These values are from usage page 0x07 (USB keyboard page). - */ - /* @{ */ - - SDL_SCANCODE_A = 4, - SDL_SCANCODE_B = 5, - SDL_SCANCODE_C = 6, - SDL_SCANCODE_D = 7, - SDL_SCANCODE_E = 8, - SDL_SCANCODE_F = 9, - SDL_SCANCODE_G = 10, - SDL_SCANCODE_H = 11, - SDL_SCANCODE_I = 12, - SDL_SCANCODE_J = 13, - SDL_SCANCODE_K = 14, - SDL_SCANCODE_L = 15, - SDL_SCANCODE_M = 16, - SDL_SCANCODE_N = 17, - SDL_SCANCODE_O = 18, - SDL_SCANCODE_P = 19, - SDL_SCANCODE_Q = 20, - SDL_SCANCODE_R = 21, - SDL_SCANCODE_S = 22, - SDL_SCANCODE_T = 23, - SDL_SCANCODE_U = 24, - SDL_SCANCODE_V = 25, - SDL_SCANCODE_W = 26, - SDL_SCANCODE_X = 27, - SDL_SCANCODE_Y = 28, - SDL_SCANCODE_Z = 29, - - SDL_SCANCODE_1 = 30, - SDL_SCANCODE_2 = 31, - SDL_SCANCODE_3 = 32, - SDL_SCANCODE_4 = 33, - SDL_SCANCODE_5 = 34, - SDL_SCANCODE_6 = 35, - SDL_SCANCODE_7 = 36, - SDL_SCANCODE_8 = 37, - SDL_SCANCODE_9 = 38, - SDL_SCANCODE_0 = 39, - - SDL_SCANCODE_RETURN = 40, - SDL_SCANCODE_ESCAPE = 41, - SDL_SCANCODE_BACKSPACE = 42, - SDL_SCANCODE_TAB = 43, - SDL_SCANCODE_SPACE = 44, - - SDL_SCANCODE_MINUS = 45, - SDL_SCANCODE_EQUALS = 46, - SDL_SCANCODE_LEFTBRACKET = 47, - SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return - * key on ISO keyboards and at the right end - * of the QWERTY row on ANSI keyboards. - * Produces REVERSE SOLIDUS (backslash) and - * VERTICAL LINE in a US layout, REVERSE - * SOLIDUS and VERTICAL LINE in a UK Mac - * layout, NUMBER SIGN and TILDE in a UK - * Windows layout, DOLLAR SIGN and POUND SIGN - * in a Swiss German layout, NUMBER SIGN and - * APOSTROPHE in a German layout, GRAVE - * ACCENT and POUND SIGN in a French Mac - * layout, and ASTERISK and MICRO SIGN in a - * French Windows layout. - */ - SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code - * instead of 49 for the same key, but all - * OSes I've seen treat the two codes - * identically. So, as an implementor, unless - * your keyboard generates both of those - * codes and your OS treats them differently, - * you should generate SDL_SCANCODE_BACKSLASH - * instead of this code. As a user, you - * should not rely on this code because SDL - * will never generate it with most (all?) - * keyboards. - */ - SDL_SCANCODE_SEMICOLON = 51, - SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI - * and ISO keyboards). Produces GRAVE ACCENT and - * TILDE in a US Windows layout and in US and UK - * Mac layouts on ANSI keyboards, GRAVE ACCENT - * and NOT SIGN in a UK Windows layout, SECTION - * SIGN and PLUS-MINUS SIGN in US and UK Mac - * layouts on ISO keyboards, SECTION SIGN and - * DEGREE SIGN in a Swiss German layout (Mac: - * only on ISO keyboards), CIRCUMFLEX ACCENT and - * DEGREE SIGN in a German layout (Mac: only on - * ISO keyboards), SUPERSCRIPT TWO and TILDE in a - * French Windows layout, COMMERCIAL AT and - * NUMBER SIGN in a French Mac layout on ISO - * keyboards, and LESS-THAN SIGN and GREATER-THAN - * SIGN in a Swiss German, German, or French Mac - * layout on ANSI keyboards. - */ - SDL_SCANCODE_COMMA = 54, - SDL_SCANCODE_PERIOD = 55, - SDL_SCANCODE_SLASH = 56, - - SDL_SCANCODE_CAPSLOCK = 57, - - SDL_SCANCODE_F1 = 58, - SDL_SCANCODE_F2 = 59, - SDL_SCANCODE_F3 = 60, - SDL_SCANCODE_F4 = 61, - SDL_SCANCODE_F5 = 62, - SDL_SCANCODE_F6 = 63, - SDL_SCANCODE_F7 = 64, - SDL_SCANCODE_F8 = 65, - SDL_SCANCODE_F9 = 66, - SDL_SCANCODE_F10 = 67, - SDL_SCANCODE_F11 = 68, - SDL_SCANCODE_F12 = 69, - - SDL_SCANCODE_PRINTSCREEN = 70, - SDL_SCANCODE_SCROLLLOCK = 71, - SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but - does send code 73, not 117) */ - SDL_SCANCODE_HOME = 74, - SDL_SCANCODE_PAGEUP = 75, - SDL_SCANCODE_DELETE = 76, - SDL_SCANCODE_END = 77, - SDL_SCANCODE_PAGEDOWN = 78, - SDL_SCANCODE_RIGHT = 79, - SDL_SCANCODE_LEFT = 80, - SDL_SCANCODE_DOWN = 81, - SDL_SCANCODE_UP = 82, - - SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards - */ - SDL_SCANCODE_KP_DIVIDE = 84, - SDL_SCANCODE_KP_MULTIPLY = 85, - SDL_SCANCODE_KP_MINUS = 86, - SDL_SCANCODE_KP_PLUS = 87, - SDL_SCANCODE_KP_ENTER = 88, - SDL_SCANCODE_KP_1 = 89, - SDL_SCANCODE_KP_2 = 90, - SDL_SCANCODE_KP_3 = 91, - SDL_SCANCODE_KP_4 = 92, - SDL_SCANCODE_KP_5 = 93, - SDL_SCANCODE_KP_6 = 94, - SDL_SCANCODE_KP_7 = 95, - SDL_SCANCODE_KP_8 = 96, - SDL_SCANCODE_KP_9 = 97, - SDL_SCANCODE_KP_0 = 98, - SDL_SCANCODE_KP_PERIOD = 99, - - SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO - * keyboards have over ANSI ones, - * located between left shift and Y. - * Produces GRAVE ACCENT and TILDE in a - * US or UK Mac layout, REVERSE SOLIDUS - * (backslash) and VERTICAL LINE in a - * US or UK Windows layout, and - * LESS-THAN SIGN and GREATER-THAN SIGN - * in a Swiss German, German, or French - * layout. */ - SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ - SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, - * not a physical key - but some Mac keyboards - * do have a power key. */ - SDL_SCANCODE_KP_EQUALS = 103, - SDL_SCANCODE_F13 = 104, - SDL_SCANCODE_F14 = 105, - SDL_SCANCODE_F15 = 106, - SDL_SCANCODE_F16 = 107, - SDL_SCANCODE_F17 = 108, - SDL_SCANCODE_F18 = 109, - SDL_SCANCODE_F19 = 110, - SDL_SCANCODE_F20 = 111, - SDL_SCANCODE_F21 = 112, - SDL_SCANCODE_F22 = 113, - SDL_SCANCODE_F23 = 114, - SDL_SCANCODE_F24 = 115, - SDL_SCANCODE_EXECUTE = 116, - SDL_SCANCODE_HELP = 117, - SDL_SCANCODE_MENU = 118, - SDL_SCANCODE_SELECT = 119, - SDL_SCANCODE_STOP = 120, - SDL_SCANCODE_AGAIN = 121, /**< redo */ - SDL_SCANCODE_UNDO = 122, - SDL_SCANCODE_CUT = 123, - SDL_SCANCODE_COPY = 124, - SDL_SCANCODE_PASTE = 125, - SDL_SCANCODE_FIND = 126, - SDL_SCANCODE_MUTE = 127, - SDL_SCANCODE_VOLUMEUP = 128, - SDL_SCANCODE_VOLUMEDOWN = 129, -/* not sure whether there's a reason to enable these */ -/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ -/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ -/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ - SDL_SCANCODE_KP_COMMA = 133, - SDL_SCANCODE_KP_EQUALSAS400 = 134, - - SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see - footnotes in USB doc */ - SDL_SCANCODE_INTERNATIONAL2 = 136, - SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ - SDL_SCANCODE_INTERNATIONAL4 = 138, - SDL_SCANCODE_INTERNATIONAL5 = 139, - SDL_SCANCODE_INTERNATIONAL6 = 140, - SDL_SCANCODE_INTERNATIONAL7 = 141, - SDL_SCANCODE_INTERNATIONAL8 = 142, - SDL_SCANCODE_INTERNATIONAL9 = 143, - SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ - SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ - SDL_SCANCODE_LANG3 = 146, /**< Katakana */ - SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ - SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ - SDL_SCANCODE_LANG6 = 149, /**< reserved */ - SDL_SCANCODE_LANG7 = 150, /**< reserved */ - SDL_SCANCODE_LANG8 = 151, /**< reserved */ - SDL_SCANCODE_LANG9 = 152, /**< reserved */ - - SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ - SDL_SCANCODE_SYSREQ = 154, - SDL_SCANCODE_CANCEL = 155, - SDL_SCANCODE_CLEAR = 156, - SDL_SCANCODE_PRIOR = 157, - SDL_SCANCODE_RETURN2 = 158, - SDL_SCANCODE_SEPARATOR = 159, - SDL_SCANCODE_OUT = 160, - SDL_SCANCODE_OPER = 161, - SDL_SCANCODE_CLEARAGAIN = 162, - SDL_SCANCODE_CRSEL = 163, - SDL_SCANCODE_EXSEL = 164, - - SDL_SCANCODE_KP_00 = 176, - SDL_SCANCODE_KP_000 = 177, - SDL_SCANCODE_THOUSANDSSEPARATOR = 178, - SDL_SCANCODE_DECIMALSEPARATOR = 179, - SDL_SCANCODE_CURRENCYUNIT = 180, - SDL_SCANCODE_CURRENCYSUBUNIT = 181, - SDL_SCANCODE_KP_LEFTPAREN = 182, - SDL_SCANCODE_KP_RIGHTPAREN = 183, - SDL_SCANCODE_KP_LEFTBRACE = 184, - SDL_SCANCODE_KP_RIGHTBRACE = 185, - SDL_SCANCODE_KP_TAB = 186, - SDL_SCANCODE_KP_BACKSPACE = 187, - SDL_SCANCODE_KP_A = 188, - SDL_SCANCODE_KP_B = 189, - SDL_SCANCODE_KP_C = 190, - SDL_SCANCODE_KP_D = 191, - SDL_SCANCODE_KP_E = 192, - SDL_SCANCODE_KP_F = 193, - SDL_SCANCODE_KP_XOR = 194, - SDL_SCANCODE_KP_POWER = 195, - SDL_SCANCODE_KP_PERCENT = 196, - SDL_SCANCODE_KP_LESS = 197, - SDL_SCANCODE_KP_GREATER = 198, - SDL_SCANCODE_KP_AMPERSAND = 199, - SDL_SCANCODE_KP_DBLAMPERSAND = 200, - SDL_SCANCODE_KP_VERTICALBAR = 201, - SDL_SCANCODE_KP_DBLVERTICALBAR = 202, - SDL_SCANCODE_KP_COLON = 203, - SDL_SCANCODE_KP_HASH = 204, - SDL_SCANCODE_KP_SPACE = 205, - SDL_SCANCODE_KP_AT = 206, - SDL_SCANCODE_KP_EXCLAM = 207, - SDL_SCANCODE_KP_MEMSTORE = 208, - SDL_SCANCODE_KP_MEMRECALL = 209, - SDL_SCANCODE_KP_MEMCLEAR = 210, - SDL_SCANCODE_KP_MEMADD = 211, - SDL_SCANCODE_KP_MEMSUBTRACT = 212, - SDL_SCANCODE_KP_MEMMULTIPLY = 213, - SDL_SCANCODE_KP_MEMDIVIDE = 214, - SDL_SCANCODE_KP_PLUSMINUS = 215, - SDL_SCANCODE_KP_CLEAR = 216, - SDL_SCANCODE_KP_CLEARENTRY = 217, - SDL_SCANCODE_KP_BINARY = 218, - SDL_SCANCODE_KP_OCTAL = 219, - SDL_SCANCODE_KP_DECIMAL = 220, - SDL_SCANCODE_KP_HEXADECIMAL = 221, - - SDL_SCANCODE_LCTRL = 224, - SDL_SCANCODE_LSHIFT = 225, - SDL_SCANCODE_LALT = 226, /**< alt, option */ - SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ - SDL_SCANCODE_RCTRL = 228, - SDL_SCANCODE_RSHIFT = 229, - SDL_SCANCODE_RALT = 230, /**< alt gr, option */ - SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ - - SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered - * by any of the above, but since there's a - * special KMOD_MODE for it I'm adding it here - */ - - /* @} *//* Usage page 0x07 */ - - /** - * \name Usage page 0x0C - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIONEXT = 258, - SDL_SCANCODE_AUDIOPREV = 259, - SDL_SCANCODE_AUDIOSTOP = 260, - SDL_SCANCODE_AUDIOPLAY = 261, - SDL_SCANCODE_AUDIOMUTE = 262, - SDL_SCANCODE_MEDIASELECT = 263, - SDL_SCANCODE_WWW = 264, - SDL_SCANCODE_MAIL = 265, - SDL_SCANCODE_CALCULATOR = 266, - SDL_SCANCODE_COMPUTER = 267, - SDL_SCANCODE_AC_SEARCH = 268, - SDL_SCANCODE_AC_HOME = 269, - SDL_SCANCODE_AC_BACK = 270, - SDL_SCANCODE_AC_FORWARD = 271, - SDL_SCANCODE_AC_STOP = 272, - SDL_SCANCODE_AC_REFRESH = 273, - SDL_SCANCODE_AC_BOOKMARKS = 274, - - /* @} *//* Usage page 0x0C */ - - /** - * \name Walther keys - * - * These are values that Christian Walther added (for mac keyboard?). - */ - /* @{ */ - - SDL_SCANCODE_BRIGHTNESSDOWN = 275, - SDL_SCANCODE_BRIGHTNESSUP = 276, - SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display - switch, video mode switch */ - SDL_SCANCODE_KBDILLUMTOGGLE = 278, - SDL_SCANCODE_KBDILLUMDOWN = 279, - SDL_SCANCODE_KBDILLUMUP = 280, - SDL_SCANCODE_EJECT = 281, - SDL_SCANCODE_SLEEP = 282, - - SDL_SCANCODE_APP1 = 283, - SDL_SCANCODE_APP2 = 284, - - /* @} *//* Walther keys */ - - /** - * \name Usage page 0x0C (additional media keys) - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIOREWIND = 285, - SDL_SCANCODE_AUDIOFASTFORWARD = 286, - - /* @} *//* Usage page 0x0C (additional media keys) */ - - /* Add any other keys here. */ - - SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes - for array bounds */ -} SDL_Scancode; - -#endif /* SDL_scancode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_sensor.h b/Windows/SDL2/include/SDL_sensor.h deleted file mode 100644 index 966adbf2..00000000 --- a/Windows/SDL2/include/SDL_sensor.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_sensor.h - * - * Include file for SDL sensor event handling - * - */ - -#ifndef SDL_sensor_h_ -#define SDL_sensor_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/** - * \brief SDL_sensor.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system - * for sensors, and load appropriate drivers. - */ - -struct _SDL_Sensor; -typedef struct _SDL_Sensor SDL_Sensor; - -/** - * This is a unique ID for a sensor for the time it is connected to the system, - * and is never reused for the lifetime of the application. - * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. - */ -typedef Sint32 SDL_SensorID; - -/* The different sensors defined by SDL - * - * Additional sensors may be available, using platform dependent semantics. - * - * Hare are the additional Android sensors: - * https://developer.android.com/reference/android/hardware/SensorEvent.html#values - */ -typedef enum -{ - SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */ - SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */ - SDL_SENSOR_ACCEL, /**< Accelerometer */ - SDL_SENSOR_GYRO /**< Gyroscope */ -} SDL_SensorType; - -/** - * Accelerometer sensor - * - * The accelerometer returns the current acceleration in SI meters per - * second squared. This includes gravity, so a device at rest will have - * an acceleration of SDL_STANDARD_GRAVITY straight down. - * - * values[0]: Acceleration on the x axis - * values[1]: Acceleration on the y axis - * values[2]: Acceleration on the z axis - * - * For phones held in portrait mode, the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ -#define SDL_STANDARD_GRAVITY 9.80665f - -/** - * Gyroscope sensor - * - * The gyroscope returns the current rate of rotation in radians per second. - * The rotation is positive in the counter-clockwise direction. That is, - * an observer looking from a positive location on one of the axes would - * see positive rotation on that axis when it appeared to be rotating - * counter-clockwise. - * - * values[0]: Angular speed around the x axis - * values[1]: Angular speed around the y axis - * values[2]: Angular speed around the z axis - * - * For phones held in portrait mode, the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ - -/* Function prototypes */ - -/** - * \brief Count the number of sensors attached to the system right now - */ -extern DECLSPEC int SDLCALL SDL_NumSensors(void); - -/** - * \brief Get the implementation dependent name of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor name, or NULL if device_index is out of range. - */ -extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); - -/** - * \brief Get the type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range. - */ -extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index); - -/** - * \brief Get the platform dependent type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor platform dependent type, or -1 if device_index is out of range. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); - -/** - * \brief Get the instance ID of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor instance ID, or -1 if device_index is out of range. - */ -extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); - -/** - * \brief Open a sensor for use. - * - * The index passed as an argument refers to the N'th sensor on the system. - * - * \return A sensor identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); - -/** - * Return the SDL_Sensor associated with an instance id. - */ -extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id); - -/** - * \brief Get the implementation dependent name of a sensor. - * - * \return The sensor name, or NULL if the sensor is NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); - -/** - * \brief Get the type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL. - */ -extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); - -/** - * \brief Get the platform dependent type of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor platform dependent type, or -1 if the sensor is NULL. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); - -/** - * \brief Get the instance ID of a sensor. - * - * This can be called before any sensors are opened. - * - * \return The sensor instance ID, or -1 if the sensor is NULL. - */ -extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); - -/** - * Get the current state of an opened sensor. - * - * The number of values and interpretation of the data is sensor dependent. - * - * \param sensor The sensor to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * - * \return 0 or -1 if an error occurred. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values); - -/** - * Close a sensor previously opened with SDL_SensorOpen() - */ -extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor); - -/** - * Update the current state of the open sensors. - * - * This is called automatically by the event loop if sensor events are enabled. - * - * This needs to be called from the thread that initialized the sensor subsystem. - */ -extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* SDL_sensor_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_shape.h b/Windows/SDL2/include/SDL_shape.h deleted file mode 100644 index 2ab43fcd..00000000 --- a/Windows/SDL2/include/SDL_shape.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_shape_h_ -#define SDL_shape_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** \file SDL_shape.h - * - * Header file for the shaped window API. - */ - -#define SDL_NONSHAPEABLE_WINDOW -1 -#define SDL_INVALID_SHAPE_ARGUMENT -2 -#define SDL_WINDOW_LACKS_SHAPE -3 - -/** - * \brief Create a window that can be shaped with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window. - * \param h The height of the window. - * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: - * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, - * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, - * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. - * - * \return The window created, or NULL if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); - -/** - * \brief Return whether the given window is a shaped window. - * - * \param window The window to query for being shaped. - * - * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. - * - * \sa SDL_CreateShapedWindow - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); - -/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ -typedef enum { - /** \brief The default mode, a binarized alpha cutoff of 1. */ - ShapeModeDefault, - /** \brief A binarized alpha cutoff with a given integer value. */ - ShapeModeBinarizeAlpha, - /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ - ShapeModeReverseBinarizeAlpha, - /** \brief A color key is applied. */ - ShapeModeColorKey -} WindowShapeMode; - -#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) - -/** \brief A union containing parameters for shaped windows. */ -typedef union { - /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */ - Uint8 binarizationCutoff; - SDL_Color colorKey; -} SDL_WindowShapeParams; - -/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ -typedef struct SDL_WindowShapeMode { - /** \brief The mode of these window-shape parameters. */ - WindowShapeMode mode; - /** \brief Window-shape parameters. */ - SDL_WindowShapeParams parameters; -} SDL_WindowShapeMode; - -/** - * \brief Set the shape and parameters of a shaped window. - * - * \param window The shaped window whose parameters should be set. - * \param shape A surface encoding the desired shape for the window. - * \param shape_mode The parameters to set for the shaped window. - * - * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW - * if the SDL_Window given does not reference a valid shaped window. - * - * \sa SDL_WindowShapeMode - * \sa SDL_GetShapedWindowMode. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); - -/** - * \brief Get the shape parameters of a shaped window. - * - * \param window The shaped window whose parameters should be retrieved. - * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. - * - * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode - * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if - * the SDL_Window given is a shapeable window currently lacking a shape. - * - * \sa SDL_WindowShapeMode - * \sa SDL_SetWindowShape - */ -extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_shape_h_ */ diff --git a/Windows/SDL2/include/SDL_stdinc.h b/Windows/SDL2/include/SDL_stdinc.h deleted file mode 100644 index ae5c1b65..00000000 --- a/Windows/SDL2/include/SDL_stdinc.h +++ /dev/null @@ -1,615 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_stdinc.h - * - * This is a general header that includes C language support. - */ - -#ifndef SDL_stdinc_h_ -#define SDL_stdinc_h_ - -#include "SDL_config.h" - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_STDIO_H -#include <stdio.h> -#endif -#if defined(STDC_HEADERS) -# include <stdlib.h> -# include <stddef.h> -# include <stdarg.h> -#else -# if defined(HAVE_STDLIB_H) -# include <stdlib.h> -# elif defined(HAVE_MALLOC_H) -# include <malloc.h> -# endif -# if defined(HAVE_STDDEF_H) -# include <stddef.h> -# endif -# if defined(HAVE_STDARG_H) -# include <stdarg.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_WCHAR_H -# include <wchar.h> -#endif -#if defined(HAVE_INTTYPES_H) -# include <inttypes.h> -#elif defined(HAVE_STDINT_H) -# include <stdint.h> -#endif -#ifdef HAVE_CTYPE_H -# include <ctype.h> -#endif -#ifdef HAVE_MATH_H -# if defined(__WINRT__) -/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on - WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx - for more information. -*/ -# define _USE_MATH_DEFINES -# endif -# include <math.h> -#endif -#ifdef HAVE_FLOAT_H -# include <float.h> -#endif -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include <alloca.h> -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include <malloc.h> -# define alloca _alloca -# elif defined(__WATCOMC__) -# include <malloc.h> -# elif defined(__BORLANDC__) -# include <malloc.h> -# elif defined(__DMC__) -# include <stdlib.h> -# elif defined(__AIX__) -#pragma alloca -# elif defined(__MRC__) -void *alloca(unsigned); -# else -char *alloca(); -# endif -#endif - -/** - * The number of elements in an array. - */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/** - * Macro useful for building other macros with strings in them - * - * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") - */ -#define SDL_STRINGIFY_ARG(arg) #arg - -/** - * \name Cast operators - * - * Use proper C++ casts when compiled as C++ to be compatible with the option - * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). - */ -/* @{ */ -#ifdef __cplusplus -#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression) -#define SDL_static_cast(type, expression) static_cast<type>(expression) -#define SDL_const_cast(type, expression) const_cast<type>(expression) -#else -#define SDL_reinterpret_cast(type, expression) ((type)(expression)) -#define SDL_static_cast(type, expression) ((type)(expression)) -#define SDL_const_cast(type, expression) ((type)(expression)) -#endif -/* @} *//* Cast operators */ - -/* Define a four character code as a Uint32 */ -#define SDL_FOURCC(A, B, C, D) \ - ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) - -/** - * \name Basic data types - */ -/* @{ */ - -#ifdef __CC_ARM -/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */ -#define SDL_FALSE 0 -#define SDL_TRUE 1 -typedef int SDL_bool; -#else -typedef enum -{ - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; -#endif - -/** - * \brief A signed 8-bit integer type. - */ -#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ -#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ -typedef int8_t Sint8; -/** - * \brief An unsigned 8-bit integer type. - */ -#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ -#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ -typedef uint8_t Uint8; -/** - * \brief A signed 16-bit integer type. - */ -#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ -#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ -typedef int16_t Sint16; -/** - * \brief An unsigned 16-bit integer type. - */ -#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ -#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ -typedef uint16_t Uint16; -/** - * \brief A signed 32-bit integer type. - */ -#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ -#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ -typedef int32_t Sint32; -/** - * \brief An unsigned 32-bit integer type. - */ -#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ -#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ -typedef uint32_t Uint32; - -/** - * \brief A signed 64-bit integer type. - */ -#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ -#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ -typedef int64_t Sint64; -/** - * \brief An unsigned 64-bit integer type. - */ -#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ -#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ -typedef uint64_t Uint64; - -/* @} *//* Basic data types */ - -/* Make sure we have macros for printing 64 bit values. - * <stdint.h> should define these but this is not true all platforms. - * (for example win32) */ -#ifndef SDL_PRIs64 -#ifdef PRIs64 -#define SDL_PRIs64 PRIs64 -#elif defined(__WIN32__) -#define SDL_PRIs64 "I64d" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIs64 "ld" -#else -#define SDL_PRIs64 "lld" -#endif -#endif -#ifndef SDL_PRIu64 -#ifdef PRIu64 -#define SDL_PRIu64 PRIu64 -#elif defined(__WIN32__) -#define SDL_PRIu64 "I64u" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIu64 "lu" -#else -#define SDL_PRIu64 "llu" -#endif -#endif -#ifndef SDL_PRIx64 -#ifdef PRIx64 -#define SDL_PRIx64 PRIx64 -#elif defined(__WIN32__) -#define SDL_PRIx64 "I64x" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIx64 "lx" -#else -#define SDL_PRIx64 "llx" -#endif -#endif -#ifndef SDL_PRIX64 -#ifdef PRIX64 -#define SDL_PRIX64 PRIX64 -#elif defined(__WIN32__) -#define SDL_PRIX64 "I64X" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIX64 "lX" -#else -#define SDL_PRIX64 "llX" -#endif -#endif - -/* Annotations to help code analysis tools */ -#ifdef SDL_DISABLE_ANALYZE_MACROS -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#else -#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ -#include <sal.h> - -#define SDL_IN_BYTECAP(x) _In_bytecount_(x) -#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) -#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) -#define SDL_OUT_CAP(x) _Out_cap_(x) -#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) -#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) - -#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ -#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ -#else -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#endif -#if defined(__GNUC__) -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#else -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#endif -#endif /* SDL_DISABLE_ANALYZE_MACROS */ - -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1] -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -/* Check to make sure enums are the size of ints, for structure packing. - For both Watcom C/C++ and Borland C/C++ the compiler option that makes - enums having the size of an int must be enabled. - This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). -*/ - -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -#if !defined(__ANDROID__) - /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ -typedef enum -{ - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); -extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); -extern DECLSPEC void SDLCALL SDL_free(void *mem); - -typedef void *(SDLCALL *SDL_malloc_func)(size_t size); -typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); -typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); -typedef void (SDLCALL *SDL_free_func)(void *mem); - -/** - * \brief Get the current set of SDL memory functions - */ -extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, - SDL_calloc_func *calloc_func, - SDL_realloc_func *realloc_func, - SDL_free_func *free_func); - -/** - * \brief Replace SDL's memory allocation functions with a custom set - * - * \note If you are replacing SDL's memory functions, you should call - * SDL_GetNumAllocations() and be very careful if it returns non-zero. - * That means that your free function will be called with memory - * allocated by the previous memory allocation functions. - */ -extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, - SDL_calloc_func calloc_func, - SDL_realloc_func realloc_func, - SDL_free_func free_func); - -/** - * \brief Get the number of outstanding (unfreed) allocations - */ -extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); - -extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); -extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); - -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); - -extern DECLSPEC int SDLCALL SDL_abs(int x); - -/* !!! FIXME: these have side effects. You probably shouldn't use them. */ -/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) - -extern DECLSPEC int SDLCALL SDL_isdigit(int x); -extern DECLSPEC int SDLCALL SDL_isspace(int x); -extern DECLSPEC int SDLCALL SDL_toupper(int x); -extern DECLSPEC int SDLCALL SDL_tolower(int x); - -extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); - -#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) -#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) -#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x))) - -/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ -SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) -{ -#ifdef __APPLE__ - memset_pattern4(dst, &val, dwords * 4); -#elif defined(__GNUC__) && defined(i386) - int u0, u1, u2; - __asm__ __volatile__ ( - "cld \n\t" - "rep ; stosl \n\t" - : "=&D" (u0), "=&a" (u1), "=&c" (u2) - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) - : "memory" - ); -#else - size_t _n = (dwords + 3) / 4; - Uint32 *_p = SDL_static_cast(Uint32 *, dst); - Uint32 _val = (val); - if (dwords == 0) - return; - switch (dwords % 4) - { - case 0: do { *_p++ = _val; [[fallthrough]]; - case 3: *_p++ = _val; [[fallthrough]]; - case 2: *_p++ = _val; [[fallthrough]]; - case 1: *_p++ = _val; - } while ( --_n ); - } -#endif -} - -extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); - -extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); - -extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); -extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); - -extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); -extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); - -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); -extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); -extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); -extern DECLSPEC char *SDLCALL SDL_strrev(char *str); -extern DECLSPEC char *SDLCALL SDL_strupr(char *str); -extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); -extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); -extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); -extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); - -extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); - -extern DECLSPEC int SDLCALL SDL_atoi(const char *str); -extern DECLSPEC double SDLCALL SDL_atof(const char *str); -extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); -extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); - -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); - -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); -extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); - -#ifndef HAVE_M_PI -#ifndef M_PI -#define M_PI 3.14159265358979323846264338327950288 /**< pi */ -#endif -#endif - -extern DECLSPEC double SDLCALL SDL_acos(double x); -extern DECLSPEC float SDLCALL SDL_acosf(float x); -extern DECLSPEC double SDLCALL SDL_asin(double x); -extern DECLSPEC float SDLCALL SDL_asinf(float x); -extern DECLSPEC double SDLCALL SDL_atan(double x); -extern DECLSPEC float SDLCALL SDL_atanf(float x); -extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); -extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y); -extern DECLSPEC double SDLCALL SDL_ceil(double x); -extern DECLSPEC float SDLCALL SDL_ceilf(float x); -extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); -extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y); -extern DECLSPEC double SDLCALL SDL_cos(double x); -extern DECLSPEC float SDLCALL SDL_cosf(float x); -extern DECLSPEC double SDLCALL SDL_exp(double x); -extern DECLSPEC float SDLCALL SDL_expf(float x); -extern DECLSPEC double SDLCALL SDL_fabs(double x); -extern DECLSPEC float SDLCALL SDL_fabsf(float x); -extern DECLSPEC double SDLCALL SDL_floor(double x); -extern DECLSPEC float SDLCALL SDL_floorf(float x); -extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); -extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); -extern DECLSPEC double SDLCALL SDL_log(double x); -extern DECLSPEC float SDLCALL SDL_logf(float x); -extern DECLSPEC double SDLCALL SDL_log10(double x); -extern DECLSPEC float SDLCALL SDL_log10f(float x); -extern DECLSPEC double SDLCALL SDL_pow(double x, double y); -extern DECLSPEC float SDLCALL SDL_powf(float x, float y); -extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); -extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n); -extern DECLSPEC double SDLCALL SDL_sin(double x); -extern DECLSPEC float SDLCALL SDL_sinf(float x); -extern DECLSPEC double SDLCALL SDL_sqrt(double x); -extern DECLSPEC float SDLCALL SDL_sqrtf(float x); -extern DECLSPEC double SDLCALL SDL_tan(double x); -extern DECLSPEC float SDLCALL SDL_tanf(float x); - -/* The SDL implementation of iconv() returns these error codes */ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 - -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, - const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); -/** - * This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. - */ -extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, - const char *fromcode, - const char *inbuf, - size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) - -/* force builds using Clang's static analysis tools to use literal C runtime - here, since there are possibly tests that are ineffective otherwise. */ -#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) -#define SDL_malloc malloc -#define SDL_calloc calloc -#define SDL_realloc realloc -#define SDL_free free -#define SDL_memset memset -#define SDL_memcpy memcpy -#define SDL_memmove memmove -#define SDL_memcmp memcmp -#define SDL_strlen strlen -#define SDL_strlcpy strlcpy -#define SDL_strlcat strlcat -#define SDL_strdup strdup -#define SDL_strchr strchr -#define SDL_strrchr strrchr -#define SDL_strstr strstr -#define SDL_strtokr strtok_r -#define SDL_strcmp strcmp -#define SDL_strncmp strncmp -#define SDL_strcasecmp strcasecmp -#define SDL_strncasecmp strncasecmp -#define SDL_sscanf sscanf -#define SDL_vsscanf vsscanf -#define SDL_snprintf snprintf -#define SDL_vsnprintf vsnprintf -#endif - -SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) -{ - return SDL_memcpy(dst, src, dwords * 4); -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_stdinc_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_surface.h b/Windows/SDL2/include/SDL_surface.h deleted file mode 100644 index 51a12830..00000000 --- a/Windows/SDL2/include/SDL_surface.h +++ /dev/null @@ -1,554 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_surface.h - * - * Header file for ::SDL_Surface definition and management functions. - */ - -#ifndef SDL_surface_h_ -#define SDL_surface_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_blendmode.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Surface flags - * - * These are the currently supported flags for the ::SDL_Surface. - * - * \internal - * Used internally (read-only). - */ -/* @{ */ -#define SDL_SWSURFACE 0 /**< Just here for compatibility */ -#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ -#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ -#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ -#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */ -/* @} *//* Surface flags */ - -/** - * Evaluates to true if the surface needs to be locked before access. - */ -#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) - -/** - * \brief A collection of pixels used in software blitting. - * - * \note This structure should be treated as read-only, except for \c pixels, - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface -{ - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - int pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - - /** Application data associated with the surface */ - void *userdata; /**< Read-write */ - - /** information needed for surfaces requiring locks */ - int locked; /**< Read-only */ - void *lock_data; /**< Read-only */ - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - - /** info for fast blit mapping to other surfaces */ - struct SDL_BlitMap *map; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** - * \brief The type of function used for surface blitting functions. - */ -typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, - struct SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief The formula used for converting between YUV and RGB - */ -typedef enum -{ - SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ - SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ - SDL_YUV_CONVERSION_BT709, /**< BT.709 */ - SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ -} SDL_YUV_CONVERSION_MODE; - -/** - * Allocate and free an RGB surface. - * - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * - * If the function runs out of memory, it will return NULL. - * - * \param flags The \c flags are obsolete and should be set to 0. - * \param width The width in pixels of the surface to create. - * \param height The height in pixels of the surface to create. - * \param depth The depth in bits of the surface to create. - * \param Rmask The red mask of the surface to create. - * \param Gmask The green mask of the surface to create. - * \param Bmask The blue mask of the surface to create. - * \param Amask The alpha mask of the surface to create. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); - -/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat - (Uint32 flags, int width, int height, int depth, Uint32 format); - -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, - int height, - int depth, - int pitch, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom - (void *pixels, int width, int height, int depth, int pitch, Uint32 format); -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); - -/** - * \brief Set the palette used by a surface. - * - * \return 0, or -1 if the surface format doesn't use a palette. - * - * \note A single palette can be shared with many surfaces. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, - SDL_Palette * palette); - -/** - * \brief Sets up a surface for directly accessing the pixels. - * - * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write - * to and read from \c surface->pixels, using the pixel format stored in - * \c surface->format. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. - * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. - * - * \sa SDL_UnlockSurface() - */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); -/** \sa SDL_LockSurface() */ -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); - -/** - * Load a surface from a seekable SDL data stream (memory or file). - * - * If \c freesrc is non-zero, the stream will be closed after being read. - * - * The new surface should be freed with SDL_FreeSurface(). - * - * \return the new surface, or NULL if there was an error. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, - int freesrc); - -/** - * Load a surface from a file. - * - * Convenience macro. - */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Save a surface to a seekable SDL data stream (memory or file). - * - * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the - * BMP directly. Other RGB formats with 8-bit or higher get converted to a - * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit - * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are - * not supported. - * - * If \c freedst is non-zero, the stream will be closed after being written. - * - * \return 0 if successful or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface * surface, SDL_RWops * dst, int freedst); - -/** - * Save a surface to a file. - * - * Convenience macro. - */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * \brief Sets the RLE acceleration hint for a surface. - * - * \return 0 on success, or -1 if the surface is not valid - * - * \note If RLE is enabled, colorkey and alpha blending blits are much faster, - * but the surface must be locked before directly accessing the pixels. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, - int flag); - -/** - * \brief Sets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param flag Non-zero to enable colorkey and 0 to disable colorkey - * \param key The transparent pixel in the native surface format - * - * \return 0 on success, or -1 if the surface is not valid - * - * You can pass SDL_RLEACCEL to enable RLE accelerated blits. - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, - int flag, Uint32 key); - -/** - * \brief Returns whether the surface has a color key - * - * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); - -/** - * \brief Gets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param key A pointer filled in with the transparent pixel in the native - * surface format - * - * \return 0 on success, or -1 if the surface is not valid or colorkey is not - * enabled. - */ -extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, - Uint32 * key); - -/** - * \brief Set an additional color value used in blit operations. - * - * \param surface The surface to update. - * \param r The red color value multiplied into blit operations. - * \param g The green color value multiplied into blit operations. - * \param b The blue color value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_GetSurfaceColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \brief Get the additional color value used in blit operations. - * - * \param surface The surface to query. - * \param r A pointer filled in with the current red color value. - * \param g A pointer filled in with the current green color value. - * \param b A pointer filled in with the current blue color value. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \brief Set an additional alpha value used in blit operations. - * - * \param surface The surface to update. - * \param alpha The alpha value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_GetSurfaceAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 alpha); - -/** - * \brief Get the additional alpha value used in blit operations. - * - * \param surface The surface to query. - * \param alpha A pointer filled in with the current alpha value. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 * alpha); - -/** - * \brief Set the blend mode used for blit operations. - * - * \param surface The surface to update. - * \param blendMode ::SDL_BlendMode to use for blit blending. - * - * \return 0 on success, or -1 if the parameters are not valid. - * - * \sa SDL_GetSurfaceBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode blendMode); - -/** - * \brief Get the blend mode used for blit operations. - * - * \param surface The surface to query. - * \param blendMode A pointer filled in with the current blend mode. - * - * \return 0 on success, or -1 if the surface is not valid. - * - * \sa SDL_SetSurfaceBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode *blendMode); - -/** - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, - const SDL_Rect * rect); - -/** - * Gets the clipping rectangle for the destination surface in a blit. - * - * \c rect must be a pointer to a valid rectangle which will be filled - * with the correct values. - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, - SDL_Rect * rect); - -/* - * Creates a new surface identical to the existing surface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface); - -/** - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface - (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat - (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); - -/** - * \brief Copy a block of pixels of one format to another format - * - * \return 0 on success, or -1 if there was an error - */ -extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, - Uint32 src_format, - const void * src, int src_pitch, - Uint32 dst_format, - void * dst, int dst_pitch); - -/** - * Performs a fast fill of the given rectangle with \c color. - * - * If \c rect is NULL, the whole surface will be filled with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); -extern DECLSPEC int SDLCALL SDL_FillRects - (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); - -/** - * Performs a fast blit from the source surface to the destination surface. - * - * This assumes that the source and destination rectangles are - * the same size. If either \c srcrect or \c dstrect are NULL, the entire - * surface (\c src or \c dst) is copied. The final blit rectangles are saved - * in \c srcrect and \c dstrect after all clipping is performed. - * - * \return If the blit is successful, it returns 0, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without blending and colorkey - * are defined as follows: - * \verbatim - RGBA->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB, set destination alpha to source per-surface alpha value. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - - RGBA->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy all of RGBA to the destination. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - \endverbatim - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. - */ -#define SDL_BlitSurface SDL_UpperBlit - -/** - * This is the public blit function, SDL_BlitSurface(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlit() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * This is a semi-private blit function and it performs low-level surface - * blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief Perform a fast, low quality, stretch blit between two surfaces of the - * same pixel format. - * - * \note This function uses a static buffer, and is not thread-safe. - */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, - const SDL_Rect * dstrect); - -#define SDL_BlitScaled SDL_UpperBlitScaled - -/** - * This is the public scaled blit function, SDL_BlitScaled(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() - */ -extern DECLSPEC int SDLCALL SDL_UpperBlitScaled - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * This is a semi-private blit function and it performs low-level surface - * scaled blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlitScaled - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief Set the YUV conversion mode - */ -extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); - -/** - * \brief Get the YUV conversion mode - */ -extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); - -/** - * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC - */ -extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_surface_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_system.h b/Windows/SDL2/include/SDL_system.h deleted file mode 100644 index 3b084076..00000000 --- a/Windows/SDL2/include/SDL_system.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_system.h - * - * Include file for platform specific SDL API functions - */ - -#ifndef SDL_system_h_ -#define SDL_system_h_ - -#include "SDL_stdinc.h" -#include "SDL_keyboard.h" -#include "SDL_render.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* Platform specific functions for Windows */ -#ifdef __WIN32__ - -/** - \brief Set a function that is called for every windows message, before TranslateMessage() -*/ -typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); -extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); - -/** - \brief Returns the D3D9 adapter index that matches the specified display index. - - This adapter index can be passed to IDirect3D9::CreateDevice and controls - on which monitor a full screen application will appear. -*/ -extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); - -typedef struct IDirect3DDevice9 IDirect3DDevice9; -/** - \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. - - Once you are done using the device, you should release it to avoid a resource leak. - */ -extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); - -/** - \brief Returns the DXGI Adapter and Output indices for the specified display index. - - These can be passed to EnumAdapters and EnumOutputs respectively to get the objects - required to create a DX10 or DX11 device and swap chain. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); - -#endif /* __WIN32__ */ - - -/* Platform specific functions for Linux */ -#ifdef __LINUX__ - -/** - \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available. - - \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); - -#endif /* __LINUX__ */ - -/* Platform specific functions for iOS */ -#if defined(__IPHONEOS__) && __IPHONEOS__ - -#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); - -#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) -extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); - -#endif /* __IPHONEOS__ */ - - -/* Platform specific functions for Android */ -#if defined(__ANDROID__) && __ANDROID__ - -/** - \brief Get the JNI environment for the current thread - - This returns JNIEnv*, but the prototype is void* so we don't need jni.h - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); - -/** - \brief Get the SDL Activity object for the application - - This returns jobject, but the prototype is void* so we don't need jni.h - The jobject returned by SDL_AndroidGetActivity is a local reference. - It is the caller's responsibility to properly release it - (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); - -/** - \brief Return true if the application is running on Android TV - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); - -/** - \brief Return true if the application is running on a Chromebook - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); - -/** - \brief Return true is the application is running on a Samsung DeX docking station - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); - -/** - \brief Trigger the Android system back button behavior. - */ -extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); - -/** - See the official Android developer guide for more information: - http://developer.android.com/guide/topics/data/data-storage.html -*/ -#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 -#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 - -/** - \brief Get the path used for internal storage for this application. - - This path is unique to your application and cannot be written to - by other applications. - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); - -/** - \brief Get the current state of external storage, a bitmask of these values: - SDL_ANDROID_EXTERNAL_STORAGE_READ - SDL_ANDROID_EXTERNAL_STORAGE_WRITE - - If external storage is currently unavailable, this will return 0. -*/ -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); - -/** - \brief Get the path used for external storage for this application. - - This path is unique to your application, but is public and can be - written to by other applications. - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); - -#endif /* __ANDROID__ */ - -/* Platform specific functions for WinRT */ -#if defined(__WINRT__) && __WINRT__ - -/** - * \brief WinRT / Windows Phone path types - */ -typedef enum -{ - /** \brief The installed app's root directory. - Files here are likely to be read-only. */ - SDL_WINRT_PATH_INSTALLED_LOCATION, - - /** \brief The app's local data store. Files may be written here */ - SDL_WINRT_PATH_LOCAL_FOLDER, - - /** \brief The app's roaming data store. Unsupported on Windows Phone. - Files written here may be copied to other machines via a network - connection. - */ - SDL_WINRT_PATH_ROAMING_FOLDER, - - /** \brief The app's temporary data store. Unsupported on Windows Phone. - Files written here may be deleted at any time. */ - SDL_WINRT_PATH_TEMP_FOLDER -} SDL_WinRT_Path; - - -/** - * \brief WinRT Device Family - */ -typedef enum -{ - /** \brief Unknown family */ - SDL_WINRT_DEVICEFAMILY_UNKNOWN, - - /** \brief Desktop family*/ - SDL_WINRT_DEVICEFAMILY_DESKTOP, - - /** \brief Mobile family (for example smartphone) */ - SDL_WINRT_DEVICEFAMILY_MOBILE, - - /** \brief XBox family */ - SDL_WINRT_DEVICEFAMILY_XBOX, -} SDL_WinRT_DeviceFamily; - - -/** - * \brief Retrieves a WinRT defined path on the local file system - * - * \note Documentation on most app-specific path types on WinRT - * can be found on MSDN, at the URL: - * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType The type of path to retrieve. - * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL - * if the path is not available for any reason. Not all paths are - * available on all versions of Windows. This is especially true on - * Windows Phone. Check the documentation for the given - * SDL_WinRT_Path for more information on which path types are - * supported where. - */ -extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); - -/** - * \brief Retrieves a WinRT defined path on the local file system - * - * \note Documentation on most app-specific path types on WinRT - * can be found on MSDN, at the URL: - * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType The type of path to retrieve. - * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL - * if the path is not available for any reason. Not all paths are - * available on all versions of Windows. This is especially true on - * Windows Phone. Check the documentation for the given - * SDL_WinRT_Path for more information on which path types are - * supported where. - */ -extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); - -/** - * \brief Detects the device family of WinRT plattform on runtime - * - * \return Device family - */ -extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); - -#endif /* __WINRT__ */ - -/** - \brief Return true if the current device is a tablet. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_system_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_syswm.h b/Windows/SDL2/include/SDL_syswm.h deleted file mode 100644 index c8236513..00000000 --- a/Windows/SDL2/include/SDL_syswm.h +++ /dev/null @@ -1,331 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_syswm.h - * - * Include file for SDL custom system window manager hooks. - */ - -#ifndef SDL_syswm_h_ -#define SDL_syswm_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_version.h" - -/** - * \brief SDL_syswm.h - * - * Your application has access to a special type of event ::SDL_SYSWMEVENT, - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState(). - */ -struct SDL_SysWMinfo; - -#if !defined(SDL_PROTOTYPES_ONLY) - -#if defined(SDL_VIDEO_DRIVER_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include <windows.h> -#endif - -#if defined(SDL_VIDEO_DRIVER_WINRT) -#include <Inspectable.h> -#endif - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) -#if defined(__APPLE__) && defined(__MACH__) -/* conflicts with Quickdraw.h */ -#define Cursor X11Cursor -#endif - -#include <X11/Xlib.h> -#include <X11/Xatom.h> - -#if defined(__APPLE__) && defined(__MACH__) -/* matches the re-define above */ -#undef Cursor -#endif - -#endif /* defined(SDL_VIDEO_DRIVER_X11) */ - -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) -#include <directfb.h> -#endif - -#if defined(SDL_VIDEO_DRIVER_COCOA) -#ifdef __OBJC__ -@class NSWindow; -#else -typedef struct _NSWindow NSWindow; -#endif -#endif - -#if defined(SDL_VIDEO_DRIVER_UIKIT) -#ifdef __OBJC__ -#include <UIKit/UIKit.h> -#else -typedef struct _UIWindow UIWindow; -typedef struct _UIViewController UIViewController; -#endif -typedef Uint32 GLuint; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) -typedef struct ANativeWindow ANativeWindow; -typedef void *EGLSurface; -#endif - -#if defined(SDL_VIDEO_DRIVER_VIVANTE) -#include "SDL_egl.h" -#endif -#endif /* SDL_PROTOTYPES_ONLY */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(SDL_PROTOTYPES_ONLY) -/** - * These are the various supported windowing subsystems - */ -typedef enum -{ - SDL_SYSWM_UNKNOWN, - SDL_SYSWM_WINDOWS, - SDL_SYSWM_X11, - SDL_SYSWM_DIRECTFB, - SDL_SYSWM_COCOA, - SDL_SYSWM_UIKIT, - SDL_SYSWM_WAYLAND, - SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ - SDL_SYSWM_WINRT, - SDL_SYSWM_ANDROID, - SDL_SYSWM_VIVANTE, - SDL_SYSWM_OS2, - SDL_SYSWM_HAIKU -} SDL_SYSWM_TYPE; - -/** - * The custom event structure. - */ -struct SDL_SysWMmsg -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct { - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct { - XEvent event; - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct { - DFBEvent event; - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { - /* Latest version of Xcode clang complains about empty structs in C v. C++: - error: empty struct has size 0 in C, size 1 in C++ - */ - int dummy; - /* No Cocoa window events yet */ - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { - int dummy; - /* No UIKit window events yet */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_VIVANTE) - struct - { - int dummy; - /* No Vivante window events yet */ - } vivante; -#endif - /* Can't have an empty union */ - int dummy; - } msg; -}; - -/** - * The custom window manager information structure. - * - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct - { - HWND window; /**< The window handle */ - HDC hdc; /**< The window device context */ - HINSTANCE hinstance; /**< The instance handle */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_WINRT) - struct - { - IInspectable * window; /**< The WinRT CoreWindow */ - } winrt; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct - { - Display *display; /**< The X11 display */ - Window window; /**< The X11 window */ - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct - { - IDirectFB *dfb; /**< The directfb main interface */ - IDirectFBWindow *window; /**< The directfb window handle */ - IDirectFBSurface *surface; /**< The directfb client surface */ - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { -#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) - NSWindow __unsafe_unretained *window; /**< The Cocoa window */ -#else - NSWindow *window; /**< The Cocoa window */ -#endif - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { -#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) - UIWindow __unsafe_unretained *window; /**< The UIKit window */ -#else - UIWindow *window; /**< The UIKit window */ -#endif - GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ - GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ - GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_WAYLAND) - struct - { - struct wl_display *display; /**< Wayland display */ - struct wl_surface *surface; /**< Wayland surface */ - struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */ - } wl; -#endif -#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ - struct - { - void *connection; /**< Mir display server connection */ - void *surface; /**< Mir surface */ - } mir; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) - struct - { - ANativeWindow *window; - EGLSurface surface; - } android; -#endif - -#if defined(SDL_VIDEO_DRIVER_VIVANTE) - struct - { - EGLNativeDisplayType display; - EGLNativeWindowType window; - } vivante; -#endif - - /* Make sure this union is always 64 bytes (8 64-bit pointers). */ - /* Be careful not to overflow this if you add a new target! */ - Uint8 dummy[64]; - } info; -}; - -#endif /* SDL_PROTOTYPES_ONLY */ - -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - -/* Function prototypes */ -/** - * \brief This function allows access to driver-dependent window information. - * - * \param window The window about which information is being requested - * \param info This structure must be initialized with the SDL version, and is - * then filled in with information about the given window. - * - * \return SDL_TRUE if the function is implemented and the version member of - * the \c info struct is valid, SDL_FALSE otherwise. - * - * You typically use this function like this: - * \code - * SDL_SysWMinfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } - * \endcode - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, - SDL_SysWMinfo * info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_syswm_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_thread.h b/Windows/SDL2/include/SDL_thread.h deleted file mode 100644 index f78b1145..00000000 --- a/Windows/SDL2/include/SDL_thread.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_thread_h_ -#define SDL_thread_h_ - -/** - * \file SDL_thread.h - * - * Header for the SDL thread management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_atomic.h" -#include "SDL_mutex.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/* The SDL thread ID */ -typedef unsigned long SDL_threadID; - -/* Thread local storage ID, 0 is the invalid ID */ -typedef unsigned int SDL_TLSID; - -/** - * The SDL thread priority. - * - * \note On many systems you require special privileges to set high or time critical priority. - */ -typedef enum { - SDL_THREAD_PRIORITY_LOW, - SDL_THREAD_PRIORITY_NORMAL, - SDL_THREAD_PRIORITY_HIGH, - SDL_THREAD_PRIORITY_TIME_CRITICAL -} SDL_ThreadPriority; - -/** - * The function passed to SDL_CreateThread(). - * It is passed a void* user context parameter and returns an int. - */ -typedef int (SDLCALL * SDL_ThreadFunction) (void *data); - -#if defined(__WIN32__) && !defined(HAVE_LIBC) -/** - * \file SDL_thread.h - * - * We compile SDL into a DLL. This means, that it's the DLL which - * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL2.DLL will - * be initialized for those threads, and not the RTL of the calling - * application! - * - * To solve this, we make a little hack here. - * - * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL2.DLL which uses this API, - * then the RTL of SDL2.DLL will be used to create the new thread, and if it's - * the application, then the RTL of the application will be used. - * - * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime - * library! - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#include <process.h> /* _beginthreadex() and _endthreadex() */ - -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) - (void *, unsigned, unsigned (__stdcall *func)(void *), - void * /*arg*/, unsigned, unsigned * /* threadID */); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); - -/** - * Create a thread. - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), - const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - - -/** - * Create a thread. - */ -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#endif - -#elif defined(__OS2__) -/* - * just like the windows case above: We compile SDL2 - * into a dll with Watcom's runtime statically linked. - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef __EMX__ -#include <process.h> -#else -#include <stdlib.h> -#endif -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); -typedef void (*pfnSDL_CurrentEndThread)(void); -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#endif - -#else - -/** - * Create a thread with a default stack size. - * - * This is equivalent to calling: - * SDL_CreateThreadWithStackSize(fn, name, 0, data); - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); - -/** - * Create a thread. - * - * Thread naming is a little complicated: Most systems have very small - * limits for the string length (Haiku has 32 bytes, Linux currently has 16, - * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll - * have to see what happens with your system's debugger. The name should be - * UTF-8 (but using the naming limits of C identifiers is a better bet). - * There are no requirements for thread naming conventions, so long as the - * string is null-terminated UTF-8, but these guidelines are helpful in - * choosing a name: - * - * http://stackoverflow.com/questions/149932/naming-conventions-for-threads - * - * If a system imposes requirements, SDL will try to munge the string for - * it (truncate, etc), but the original string contents will be available - * from SDL_GetThreadName(). - * - * The size (in bytes) of the new stack can be specified. Zero means "use - * the system default" which might be wildly different between platforms - * (x86 Linux generally defaults to eight megabytes, an embedded device - * might be a few kilobytes instead). - * - * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread - * function. - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data); - -#endif - -/** - * Get the thread name, as it was specified in SDL_CreateThread(). - * This function returns a pointer to a UTF-8 string that names the - * specified thread, or NULL if it doesn't have a name. This is internal - * memory, not to be free()'d by the caller, and remains valid until the - * specified thread is cleaned up by SDL_WaitThread(). - */ -extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); - -/** - * Get the thread identifier for the current thread. - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); - -/** - * Get the thread identifier for the specified thread. - * - * Equivalent to SDL_ThreadID() if the specified thread is NULL. - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); - -/** - * Set the priority for the current thread - */ -extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); - -/** - * Wait for a thread to finish. Threads that haven't been detached will - * remain (as a "zombie") until this function cleans them up. Not doing so - * is a resource leak. - * - * Once a thread has been cleaned up through this function, the SDL_Thread - * that references it becomes invalid and should not be referenced again. - * As such, only one thread may call SDL_WaitThread() on another. - * - * The return code for the thread function is placed in the area - * pointed to by \c status, if \c status is not NULL. - * - * You may not wait on a thread that has been used in a call to - * SDL_DetachThread(). Use either that function or this one, but not - * both, or behavior is undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); - -/** - * A thread may be "detached" to signify that it should not remain until - * another thread has called SDL_WaitThread() on it. Detaching a thread - * is useful for long-running threads that nothing needs to synchronize - * with or further manage. When a detached thread is done, it simply - * goes away. - * - * There is no way to recover the return code of a detached thread. If you - * need this, don't detach the thread and instead use SDL_WaitThread(). - * - * Once a thread is detached, you should usually assume the SDL_Thread isn't - * safe to reference again, as it will become invalid immediately upon - * the detached thread's exit, instead of remaining until someone has called - * SDL_WaitThread() to finally clean it up. As such, don't detach the same - * thread more than once. - * - * If a thread has already exited when passed to SDL_DetachThread(), it will - * stop waiting for a call to SDL_WaitThread() and clean up immediately. - * It is not safe to detach a thread that might be used with SDL_WaitThread(). - * - * You may not call SDL_WaitThread() on a thread that has been detached. - * Use either that function or this one, but not both, or behavior is - * undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - */ -extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); - -/** - * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. - * - * \return The newly created thread local storage identifier, or 0 on error - * - * \code - * static SDL_SpinLock tls_lock; - * static SDL_TLSID thread_local_storage; - * - * void SetMyThreadData(void *value) - * { - * if (!thread_local_storage) { - * SDL_AtomicLock(&tls_lock); - * if (!thread_local_storage) { - * thread_local_storage = SDL_TLSCreate(); - * } - * SDL_AtomicUnlock(&tls_lock); - * } - * SDL_TLSSet(thread_local_storage, value, 0); - * } - * - * void *GetMyThreadData(void) - * { - * return SDL_TLSGet(thread_local_storage); - * } - * \endcode - * - * \sa SDL_TLSGet() - * \sa SDL_TLSSet() - */ -extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); - -/** - * \brief Get the value associated with a thread local storage ID for the current thread. - * - * \param id The thread local storage ID - * - * \return The value associated with the ID for the current thread, or NULL if no value has been set. - * - * \sa SDL_TLSCreate() - * \sa SDL_TLSSet() - */ -extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); - -/** - * \brief Set the value associated with a thread local storage ID for the current thread. - * - * \param id The thread local storage ID - * \param value The value to associate with the ID for the current thread - * \param destructor A function called when the thread exits, to free the value. - * - * \return 0 on success, -1 on error - * - * \sa SDL_TLSCreate() - * \sa SDL_TLSGet() - */ -extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*)); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_thread_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_timer.h b/Windows/SDL2/include/SDL_timer.h deleted file mode 100644 index 2a47b043..00000000 --- a/Windows/SDL2/include/SDL_timer.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_timer_h_ -#define SDL_timer_h_ - -/** - * \file SDL_timer.h - * - * Header for the SDL time management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Get the number of milliseconds since the SDL library initialization. - * - * \note This value wraps if the program runs for more than ~49 days. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/** - * \brief Compare SDL ticks values, and return true if A has passed B - * - * e.g. if you want to wait 100 ms, you could do this: - * Uint32 timeout = SDL_GetTicks() + 100; - * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { - * ... do work until timeout has elapsed - * } - */ -#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) - -/** - * \brief Get the current value of the high resolution counter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); - -/** - * \brief Get the count per second of the high resolution counter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); - -/** - * \brief Wait a specified number of milliseconds before returning. - */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** - * Function prototype for the timer callback function. - * - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); - -/** - * Definition of the timer ID type. - */ -typedef int SDL_TimerID; - -/** - * \brief Add a new timer to the pool of timers already running. - * - * \return A timer ID, or 0 when an error occurs. - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, - SDL_TimerCallback callback, - void *param); - -/** - * \brief Remove a timer knowing its ID. - * - * \return A boolean value indicating success or failure. - * - * \warning It is not safe to remove a timer multiple times. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_timer_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_touch.h b/Windows/SDL2/include/SDL_touch.h deleted file mode 100644 index 99dbcb8c..00000000 --- a/Windows/SDL2/include/SDL_touch.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_touch.h - * - * Include file for SDL touch event handling. - */ - -#ifndef SDL_touch_h_ -#define SDL_touch_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_TouchID; -typedef Sint64 SDL_FingerID; - -typedef enum -{ - SDL_TOUCH_DEVICE_INVALID = -1, - SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ - SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ - SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ -} SDL_TouchDeviceType; - -typedef struct SDL_Finger -{ - SDL_FingerID id; - float x; - float y; - float pressure; -} SDL_Finger; - -/* Used as the device ID for mouse events simulated with touch input */ -#define SDL_TOUCH_MOUSEID ((Uint32)-1) - -/* Used as the SDL_TouchID for touch events simulated with mouse input */ -#define SDL_MOUSE_TOUCHID ((Sint64)-1) - - -/* Function prototypes */ - -/** - * \brief Get the number of registered touch devices. - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); - -/** - * \brief Get the touch ID with the given index, or 0 if the index is invalid. - */ -extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); - -/** - * \brief Get the type of the given touch device. - */ -extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); - -/** - * \brief Get the number of active fingers for a given touch device. - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); - -/** - * \brief Get the finger object of the given touch, with the given index. - */ -extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_touch_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_types.h b/Windows/SDL2/include/SDL_types.h deleted file mode 100644 index 9c3e9896..00000000 --- a/Windows/SDL2/include/SDL_types.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_types.h - * - * \deprecated - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/Windows/SDL2/include/SDL_version.h b/Windows/SDL2/include/SDL_version.h deleted file mode 100644 index 69b02706..00000000 --- a/Windows/SDL2/include/SDL_version.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_version.h - * - * This header defines the current SDL version. - */ - -#ifndef SDL_version_h_ -#define SDL_version_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Information the version of SDL in use. - * - * Represents the library's version as three levels: major revision - * (increments with massive changes, additions, and enhancements), - * minor revision (increments with backwards-compatible changes to the - * major revision), and patchlevel (increments with fixes to the minor - * revision). - * - * \sa SDL_VERSION - * \sa SDL_GetVersion - */ -typedef struct SDL_version -{ - Uint8 major; /**< major version */ - Uint8 minor; /**< minor version */ - Uint8 patch; /**< update version */ -} SDL_version; - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -#define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 11 - -/** - * \brief Macro to determine SDL version program was compiled against. - * - * This macro fills in a SDL_version structure with the version of the - * library you compiled against. This is determined by what header the - * compiler uses. Note that if you dynamically linked the library, you might - * have a slightly newer or older version at runtime. That version can be - * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), - * is not a macro. - * - * \param x A pointer to a SDL_version struct to initialize. - * - * \sa SDL_version - * \sa SDL_GetVersion - */ -#define SDL_VERSION(x) \ -{ \ - (x)->major = SDL_MAJOR_VERSION; \ - (x)->minor = SDL_MINOR_VERSION; \ - (x)->patch = SDL_PATCHLEVEL; \ -} - -/** - * This macro turns the version numbers into a numeric value: - * \verbatim - (1,2,3) -> (1203) - \endverbatim - * - * This assumes that there will never be more than 100 patchlevels. - */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/** - * This is the version number macro for the current SDL version. - */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) - -/** - * This macro will evaluate to true if compiled with SDL at least X.Y.Z. - */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) - -/** - * \brief Get the version of SDL that is linked against your program. - * - * If you are linking to SDL dynamically, then it is possible that the - * current version will be different than the version you compiled against. - * This function returns the current version, while SDL_VERSION() is a - * macro that tells you what version you compiled with. - * - * \code - * SDL_version compiled; - * SDL_version linked; - * - * SDL_VERSION(&compiled); - * SDL_GetVersion(&linked); - * printf("We compiled against SDL version %d.%d.%d ...\n", - * compiled.major, compiled.minor, compiled.patch); - * printf("But we linked against SDL version %d.%d.%d.\n", - * linked.major, linked.minor, linked.patch); - * \endcode - * - * This function may be called safely at any time, even before SDL_Init(). - * - * \sa SDL_VERSION - */ -extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); - -/** - * \brief Get the code revision of SDL that is linked against your program. - * - * Returns an arbitrary string (a hash value) uniquely identifying the - * exact revision of the SDL library in use, and is only useful in comparing - * against other revisions. It is NOT an incrementing number. - */ -extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); - -/** - * \brief Get the revision number of SDL that is linked against your program. - * - * Returns a number uniquely identifying the exact revision of the SDL - * library in use. It is an incrementing number based on commits to - * hg.libsdl.org. - */ -extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_version_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_video.h b/Windows/SDL2/include/SDL_video.h deleted file mode 100644 index c1bb7527..00000000 --- a/Windows/SDL2/include/SDL_video.h +++ /dev/null @@ -1,1275 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_video.h - * - * Header file for SDL video functions. - */ - -#ifndef SDL_video_h_ -#define SDL_video_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a display mode - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - * \sa SDL_GetDesktopDisplayMode() - * \sa SDL_GetCurrentDisplayMode() - * \sa SDL_GetClosestDisplayMode() - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -typedef struct -{ - Uint32 format; /**< pixel format */ - int w; /**< width, in screen coordinates */ - int h; /**< height, in screen coordinates */ - int refresh_rate; /**< refresh rate (or zero for unspecified) */ - void *driverdata; /**< driver-specific data, initialize to 0 */ -} SDL_DisplayMode; - -/** - * \brief The type used to identify a window - * - * \sa SDL_CreateWindow() - * \sa SDL_CreateWindowFrom() - * \sa SDL_DestroyWindow() - * \sa SDL_GetWindowData() - * \sa SDL_GetWindowFlags() - * \sa SDL_GetWindowGrab() - * \sa SDL_GetWindowPosition() - * \sa SDL_GetWindowSize() - * \sa SDL_GetWindowTitle() - * \sa SDL_HideWindow() - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - * \sa SDL_RaiseWindow() - * \sa SDL_RestoreWindow() - * \sa SDL_SetWindowData() - * \sa SDL_SetWindowFullscreen() - * \sa SDL_SetWindowGrab() - * \sa SDL_SetWindowIcon() - * \sa SDL_SetWindowPosition() - * \sa SDL_SetWindowSize() - * \sa SDL_SetWindowBordered() - * \sa SDL_SetWindowResizable() - * \sa SDL_SetWindowTitle() - * \sa SDL_ShowWindow() - */ -typedef struct SDL_Window SDL_Window; - -/** - * \brief The flags on a window - * - * \sa SDL_GetWindowFlags() - */ -typedef enum -{ - SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ - SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ - SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ - SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ - SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ - SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ - SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ - SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ - SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ - SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ - SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ - SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), - SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ - SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported. - On macOS NSHighResolutionCapable must be set true in the - application's Info.plist for this to have any effect. */ - SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to INPUT_GRABBED) */ - SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */ - SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */ - SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ - SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ - SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ - SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ -} SDL_WindowFlags; - -/** - * \brief Used to indicate that you don't care what the window position is. - */ -#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u -#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) -#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) -#define SDL_WINDOWPOS_ISUNDEFINED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) - -/** - * \brief Used to indicate that the window position should be centered. - */ -#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u -#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) -#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) -#define SDL_WINDOWPOS_ISCENTERED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) - -/** - * \brief Event subtype for window events - */ -typedef enum -{ - SDL_WINDOWEVENT_NONE, /**< Never used */ - SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ - SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ - SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be - redrawn */ - SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 - */ - SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ - SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as - a result of an API call or through the - system or user changing the window size. */ - SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ - SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ - SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size - and position */ - SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ - SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ - SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ - SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ - SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */ - SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */ - SDL_WINDOWEVENT_HIT_TEST /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */ -} SDL_WindowEventID; - -/** - * \brief Event subtype for display events - */ -typedef enum -{ - SDL_DISPLAYEVENT_NONE, /**< Never used */ - SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */ -} SDL_DisplayEventID; - -typedef enum -{ - SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */ - SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */ - SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */ - SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */ - SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */ -} SDL_DisplayOrientation; - -/** - * \brief An opaque handle to an OpenGL context. - */ -typedef void *SDL_GLContext; - -/** - * \brief OpenGL configuration attributes - */ -typedef enum -{ - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, - SDL_GL_CONTEXT_NO_ERROR -} SDL_GLattr; - -typedef enum -{ - SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, - SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, - SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ -} SDL_GLprofile; - -typedef enum -{ - SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, - SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, - SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, - SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 -} SDL_GLcontextFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 -} SDL_GLcontextReleaseFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, - SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001 -} SDL_GLContextResetNotification; - -/* Function prototypes */ - -/** - * \brief Get the number of video drivers compiled into SDL - * - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); - -/** - * \brief Get the name of a built in video driver. - * - * \note The video drivers are presented in the order in which they are - * normally checked during initialization. - * - * \sa SDL_GetNumVideoDrivers() - */ -extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); - -/** - * \brief Initialize the video subsystem, optionally specifying a video driver. - * - * \param driver_name Initialize a specific driver by name, or NULL for the - * default video driver. - * - * \return 0 on success, -1 on error - * - * This function initializes the video subsystem; setting up a connection - * to the window manager, etc, and determines the available display modes - * and pixel formats, but does not initialize a window or graphics mode. - * - * \sa SDL_VideoQuit() - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); - -/** - * \brief Shuts down the video subsystem. - * - * This function closes all windows, and restores the original video mode. - * - * \sa SDL_VideoInit() - */ -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); - -/** - * \brief Returns the name of the currently initialized video driver. - * - * \return The name of the current video driver or NULL if no driver - * has been initialized - * - * \sa SDL_GetNumVideoDrivers() - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); - -/** - * \brief Returns the number of available video displays. - * - * \sa SDL_GetDisplayBounds() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); - -/** - * \brief Get the name of a display in UTF-8 encoding - * - * \return The name of a display, or NULL for an invalid display index. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); - -/** - * \brief Get the desktop area represented by a display, with the primary - * display located at 0,0 - * - * \return 0 on success, or -1 if the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); - -/** - * \brief Get the usable desktop area represented by a display, with the - * primary display located at 0,0 - * - * This is the same area as SDL_GetDisplayBounds() reports, but with portions - * reserved by the system removed. For example, on Mac OS X, this subtracts - * the area occupied by the menu bar and dock. - * - * Setting a window to be fullscreen generally bypasses these unusable areas, - * so these are good guidelines for the maximum space available to a - * non-fullscreen window. - * - * \return 0 on success, or -1 if the index is out of range. - * - * \sa SDL_GetDisplayBounds() - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect); - -/** - * \brief Get the dots/pixels-per-inch for a display - * - * \note Diagonal, horizontal and vertical DPI can all be optionally - * returned if the parameter is non-NULL. - * - * \return 0 on success, or -1 if no DPI information is available or the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); - -/** - * \brief Get the orientation of a display - * - * \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available. - * - * \sa SDL_GetNumVideoDisplays() - */ -extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex); - -/** - * \brief Returns the number of available display modes. - * - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); - -/** - * \brief Fill in information about a specific display mode. - * - * \note The display modes are sorted in this priority: - * \li bits per pixel -> more colors to fewer colors - * \li width -> largest to smallest - * \li height -> largest to smallest - * \li refresh rate -> highest to lowest - * - * \sa SDL_GetNumDisplayModes() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, - SDL_DisplayMode * mode); - -/** - * \brief Fill in information about the desktop display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); - -/** - * \brief Fill in information about the current display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); - - -/** - * \brief Get the closest match to the requested display mode. - * - * \param displayIndex The index of display from which mode should be queried. - * \param mode The desired display mode - * \param closest A pointer to a display mode to be filled in with the closest - * match of the available display modes. - * - * \return The passed in value \c closest, or NULL if no matching video mode - * was available. - * - * The available display modes are scanned, and \c closest is filled in with the - * closest mode matching the requested mode and returned. The mode format and - * refresh_rate default to the desktop mode if they are 0. The modes are - * scanned with size being first priority, format being second priority, and - * finally checking the refresh_rate. If all the available modes are too - * small, then NULL is returned. - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); - -/** - * \brief Get the display index associated with a window. - * - * \return the display index of the display containing the center of the - * window, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); - -/** - * \brief Set the display mode used when a fullscreen window is visible. - * - * By default the window's dimensions and the desktop format and refresh rate - * are used. - * - * \param window The window for which the display mode should be set. - * \param mode The mode to use, or NULL for the default mode. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_GetWindowDisplayMode() - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, - const SDL_DisplayMode - * mode); - -/** - * \brief Fill in information about the display mode used when a fullscreen - * window is visible. - * - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, - SDL_DisplayMode * mode); - -/** - * \brief Get the pixel format associated with the window. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); - -/** - * \brief Create a window with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window, in screen coordinates. - * \param h The height of the window, in screen coordinates. - * \param flags The flags for the window, a mask of any of the following: - * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, - * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, - * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. - * - * \return The created window, or NULL if window creation failed. - * - * If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size - * in pixels may differ from its size in screen coordinates on platforms with - * high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query - * the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(), - * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the - * drawable size in pixels. - * - * If the window is created with any of the SDL_WINDOW_OPENGL or - * SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function - * (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the - * corresponding UnloadLibrary function is called by SDL_DestroyWindow(). - * - * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, - * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. - * - * \note On non-Apple devices, SDL requires you to either not link to the - * Vulkan loader or link to a dynamic library version. This limitation - * may be removed in a future version of SDL. - * - * \sa SDL_DestroyWindow() - * \sa SDL_GL_LoadLibrary() - * \sa SDL_Vulkan_LoadLibrary() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, - int x, int y, int w, - int h, Uint32 flags); - -/** - * \brief Create an SDL window from an existing native window. - * - * \param data A pointer to driver-dependent window creation data - * - * \return The created window, or NULL if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); - -/** - * \brief Get the numeric ID of a window, for logging purposes. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); - -/** - * \brief Get a window from a stored ID, or NULL if it doesn't exist. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); - -/** - * \brief Get the window flags. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); - -/** - * \brief Set the title of a window, in UTF-8 format. - * - * \sa SDL_GetWindowTitle() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, - const char *title); - -/** - * \brief Get the title of a window, in UTF-8 format. - * - * \sa SDL_SetWindowTitle() - */ -extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); - -/** - * \brief Set the icon for a window. - * - * \param window The window for which the icon should be set. - * \param icon The icon for the window. - */ -extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, - SDL_Surface * icon); - -/** - * \brief Associate an arbitrary named pointer with a window. - * - * \param window The window to associate with the pointer. - * \param name The name of the pointer. - * \param userdata The associated pointer. - * - * \return The previous value associated with 'name' - * - * \note The name is case-sensitive. - * - * \sa SDL_GetWindowData() - */ -extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, - const char *name, - void *userdata); - -/** - * \brief Retrieve the data pointer associated with a window. - * - * \param window The window to query. - * \param name The name of the pointer. - * - * \return The value associated with 'name' - * - * \sa SDL_SetWindowData() - */ -extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, - const char *name); - -/** - * \brief Set the position of a window. - * - * \param window The window to reposition. - * \param x The x coordinate of the window in screen coordinates, or - * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y coordinate of the window in screen coordinates, or - * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. - * - * \note The window coordinate origin is the upper left of the display. - * - * \sa SDL_GetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, - int x, int y); - -/** - * \brief Get the position of a window. - * - * \param window The window to query. - * \param x Pointer to variable for storing the x position, in screen - * coordinates. May be NULL. - * \param y Pointer to variable for storing the y position, in screen - * coordinates. May be NULL. - * - * \sa SDL_SetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, - int *x, int *y); - -/** - * \brief Set the size of a window's client area. - * - * \param window The window to resize. - * \param w The width of the window, in screen coordinates. Must be >0. - * \param h The height of the window, in screen coordinates. Must be >0. - * - * \note Fullscreen windows automatically match the size of the display mode, - * and you should use SDL_SetWindowDisplayMode() to change their size. - * - * The window size in screen coordinates may differ from the size in pixels, if - * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with - * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * \sa SDL_GetWindowSize() - * \sa SDL_SetWindowDisplayMode() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, - int h); - -/** - * \brief Get the size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the width, in screen - * coordinates. May be NULL. - * \param h Pointer to variable for storing the height, in screen - * coordinates. May be NULL. - * - * The window size in screen coordinates may differ from the size in pixels, if - * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with - * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * \sa SDL_SetWindowSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, - int *h); - -/** - * \brief Get the size of a window's borders (decorations) around the client area. - * - * \param window The window to query. - * \param top Pointer to variable for storing the size of the top border. NULL is permitted. - * \param left Pointer to variable for storing the size of the left border. NULL is permitted. - * \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted. - * \param right Pointer to variable for storing the size of the right border. NULL is permitted. - * - * \return 0 on success, or -1 if getting this information is not supported. - * - * \note if this function fails (returns -1), the size values will be - * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as - * if the window in question was borderless. - */ -extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, - int *top, int *left, - int *bottom, int *right); - -/** - * \brief Set the minimum size of a window's client area. - * - * \param window The window to set a new minimum size. - * \param min_w The minimum width of the window, must be >0 - * \param min_h The minimum height of the window, must be >0 - * - * \note You can't change the minimum size of a fullscreen window, it - * automatically matches the size of the display mode. - * - * \sa SDL_GetWindowMinimumSize() - * \sa SDL_SetWindowMaximumSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, - int min_w, int min_h); - -/** - * \brief Get the minimum size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the minimum width, may be NULL - * \param h Pointer to variable for storing the minimum height, may be NULL - * - * \sa SDL_GetWindowMaximumSize() - * \sa SDL_SetWindowMinimumSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, - int *w, int *h); - -/** - * \brief Set the maximum size of a window's client area. - * - * \param window The window to set a new maximum size. - * \param max_w The maximum width of the window, must be >0 - * \param max_h The maximum height of the window, must be >0 - * - * \note You can't change the maximum size of a fullscreen window, it - * automatically matches the size of the display mode. - * - * \sa SDL_GetWindowMaximumSize() - * \sa SDL_SetWindowMinimumSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, - int max_w, int max_h); - -/** - * \brief Get the maximum size of a window's client area. - * - * \param window The window to query. - * \param w Pointer to variable for storing the maximum width, may be NULL - * \param h Pointer to variable for storing the maximum height, may be NULL - * - * \sa SDL_GetWindowMinimumSize() - * \sa SDL_SetWindowMaximumSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, - int *w, int *h); - -/** - * \brief Set the border state of a window. - * - * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and - * add or remove the border from the actual window. This is a no-op if the - * window's border already matches the requested state. - * - * \param window The window of which to change the border state. - * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. - * - * \note You can't change the border state of a fullscreen window. - * - * \sa SDL_GetWindowFlags() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, - SDL_bool bordered); - -/** - * \brief Set the user-resizable state of a window. - * - * This will add or remove the window's SDL_WINDOW_RESIZABLE flag and - * allow/disallow user resizing of the window. This is a no-op if the - * window's resizable state already matches the requested state. - * - * \param window The window of which to change the resizable state. - * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow. - * - * \note You can't change the resizable state of a fullscreen window. - * - * \sa SDL_GetWindowFlags() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window, - SDL_bool resizable); - -/** - * \brief Show a window. - * - * \sa SDL_HideWindow() - */ -extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); - -/** - * \brief Hide a window. - * - * \sa SDL_ShowWindow() - */ -extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); - -/** - * \brief Raise a window above other windows and set the input focus. - */ -extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); - -/** - * \brief Make a window as large as possible. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); - -/** - * \brief Minimize a window to an iconic representation. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); - -/** - * \brief Restore the size and position of a minimized or maximized window. - * - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - */ -extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); - -/** - * \brief Set a window's fullscreen state. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, - Uint32 flags); - -/** - * \brief Get the SDL surface associated with the window. - * - * \return The window's framebuffer surface, or NULL on error. - * - * A new surface will be created with the optimal format for the window, - * if necessary. This surface will be freed when the window is destroyed. - * - * \note You may not combine this with 3D or the rendering API on this window. - * - * \sa SDL_UpdateWindowSurface() - * \sa SDL_UpdateWindowSurfaceRects() - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); - -/** - * \brief Copy the window surface to the screen. - * - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetWindowSurface() - * \sa SDL_UpdateWindowSurfaceRects() - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); - -/** - * \brief Copy a number of rectangles on the window surface to the screen. - * - * \return 0 on success, or -1 on error. - * - * \sa SDL_GetWindowSurface() - * \sa SDL_UpdateWindowSurface() - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, - const SDL_Rect * rects, - int numrects); - -/** - * \brief Set a window's input grab mode. - * - * \param window The window for which the input grab mode should be set. - * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. - * - * If the caller enables a grab while another window is currently grabbed, - * the other window loses its grab in favor of the caller's window. - * - * \sa SDL_GetWindowGrab() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, - SDL_bool grabbed); - -/** - * \brief Get a window's input grab mode. - * - * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); - -/** - * \brief Get the window that currently has an input grab enabled. - * - * \return This returns the window if input is grabbed, and NULL otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); - -/** - * \brief Set the brightness (gamma correction) for a window. - * - * \return 0 on success, or -1 if setting the brightness isn't supported. - * - * \sa SDL_GetWindowBrightness() - * \sa SDL_SetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); - -/** - * \brief Get the brightness (gamma correction) for a window. - * - * \return The last brightness value passed to SDL_SetWindowBrightness() - * - * \sa SDL_SetWindowBrightness() - */ -extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); - -/** - * \brief Set the opacity for a window - * - * \param window The window which will be made transparent or opaque - * \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be - * clamped internally between 0.0f and 1.0f. - * - * \return 0 on success, or -1 if setting the opacity isn't supported. - * - * \sa SDL_GetWindowOpacity() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity); - -/** - * \brief Get the opacity of a window. - * - * If transparency isn't supported on this platform, opacity will be reported - * as 1.0f without error. - * - * \param window The window in question. - * \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque) - * - * \return 0 on success, or -1 on error (invalid window, etc). - * - * \sa SDL_SetWindowOpacity() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity); - -/** - * \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name) - * - * \param modal_window The window that should be modal - * \param parent_window The parent window - * - * \return 0 on success, or -1 otherwise. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window); - -/** - * \brief Explicitly sets input focus to the window. - * - * You almost certainly want SDL_RaiseWindow() instead of this function. Use - * this with caution, as you might give focus to a window that's completely - * obscured by other windows. - * - * \param window The window that should get the input focus - * - * \return 0 on success, or -1 otherwise. - * \sa SDL_RaiseWindow() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window); - -/** - * \brief Set the gamma ramp for a window. - * - * \param window The window for which the gamma ramp should be set. - * \param red The translation table for the red channel, or NULL. - * \param green The translation table for the green channel, or NULL. - * \param blue The translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * \sa SDL_GetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, - const Uint16 * red, - const Uint16 * green, - const Uint16 * blue); - -/** - * \brief Get the gamma ramp for a window. - * - * \param window The window from which the gamma ramp should be queried. - * \param red A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the red channel, or NULL. - * \param green A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the green channel, or NULL. - * \param blue A pointer to a 256 element array of 16-bit quantities to hold - * the translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * \sa SDL_SetWindowGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, - Uint16 * red, - Uint16 * green, - Uint16 * blue); - -/** - * \brief Possible return values from the SDL_HitTest callback. - * - * \sa SDL_HitTest - */ -typedef enum -{ - SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ - SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ - SDL_HITTEST_RESIZE_TOPLEFT, - SDL_HITTEST_RESIZE_TOP, - SDL_HITTEST_RESIZE_TOPRIGHT, - SDL_HITTEST_RESIZE_RIGHT, - SDL_HITTEST_RESIZE_BOTTOMRIGHT, - SDL_HITTEST_RESIZE_BOTTOM, - SDL_HITTEST_RESIZE_BOTTOMLEFT, - SDL_HITTEST_RESIZE_LEFT -} SDL_HitTestResult; - -/** - * \brief Callback used for hit-testing. - * - * \sa SDL_SetWindowHitTest - */ -typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, - const SDL_Point *area, - void *data); - -/** - * \brief Provide a callback that decides if a window region has special properties. - * - * Normally windows are dragged and resized by decorations provided by the - * system window manager (a title bar, borders, etc), but for some apps, it - * makes sense to drag them from somewhere else inside the window itself; for - * example, one might have a borderless window that wants to be draggable - * from any part, or simulate its own title bar, etc. - * - * This function lets the app provide a callback that designates pieces of - * a given window as special. This callback is run during event processing - * if we need to tell the OS to treat a region of the window specially; the - * use of this callback is known as "hit testing." - * - * Mouse input may not be delivered to your application if it is within - * a special area; the OS will often apply that input to moving the window or - * resizing the window and not deliver it to the application. - * - * Specifying NULL for a callback disables hit-testing. Hit-testing is - * disabled by default. - * - * Platforms that don't support this functionality will return -1 - * unconditionally, even if you're attempting to disable hit-testing. - * - * Your callback may fire at any time, and its firing does not indicate any - * specific behavior (for example, on Windows, this certainly might fire - * when the OS is deciding whether to drag your window, but it fires for lots - * of other reasons, too, some unrelated to anything you probably care about - * _and when the mouse isn't actually at the location it is testing_). - * Since this can fire at any time, you should try to keep your callback - * efficient, devoid of allocations, etc. - * - * \param window The window to set hit-testing on. - * \param callback The callback to call when doing a hit-test. - * \param callback_data An app-defined void pointer passed to the callback. - * \return 0 on success, -1 on error (including unsupported). - */ -extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, - SDL_HitTest callback, - void *callback_data); - -/** - * \brief Destroy a window. - */ -extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); - - -/** - * \brief Returns whether the screensaver is currently enabled (default off). - * - * \sa SDL_EnableScreenSaver() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); - -/** - * \brief Allow the screen to be blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); - -/** - * \brief Prevent the screen from being blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_EnableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); - - -/** - * \name OpenGL support functions - */ -/* @{ */ - -/** - * \brief Dynamically load an OpenGL library. - * - * \param path The platform dependent OpenGL library name, or NULL to open the - * default OpenGL library. - * - * \return 0 on success, or -1 if the library couldn't be loaded. - * - * This should be done after initializing the video driver, but before - * creating any OpenGL windows. If no OpenGL library is loaded, the default - * library will be loaded upon creation of the first OpenGL window. - * - * \note If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). - * - * \sa SDL_GL_GetProcAddress() - * \sa SDL_GL_UnloadLibrary() - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * \brief Get the address of an OpenGL function. - */ -extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); - -/** - * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). - * - * \sa SDL_GL_LoadLibrary() - */ -extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); - -/** - * \brief Return true if an OpenGL extension is supported for the current - * context. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char - *extension); - -/** - * \brief Reset all previously set OpenGL context attributes to their default values - */ -extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); - -/** - * \brief Set an OpenGL window attribute before window creation. - * - * \return 0 on success, or -1 if the attribute could not be set. - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * \brief Get the actual value for an attribute from the current context. - * - * \return 0 on success, or -1 if the attribute could not be retrieved. - * The integer at \c value will be modified in either case. - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); - -/** - * \brief Create an OpenGL context for use with an OpenGL window, and make it - * current. - * - * \sa SDL_GL_DeleteContext() - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * - window); - -/** - * \brief Set up an OpenGL context for rendering into an OpenGL window. - * - * \note The context must have been created with a compatible window. - */ -extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, - SDL_GLContext context); - -/** - * \brief Get the currently active OpenGL window. - */ -extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); - -/** - * \brief Get the currently active OpenGL context. - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); - -/** - * \brief Get the size of a window's underlying drawable in pixels (for use - * with glViewport). - * - * \param window Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, may be NULL - * \param h Pointer to variable for storing the height in pixels, may be NULL - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a - * platform with high-DPI support (Apple calls this "Retina"), and not disabled - * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. - * - * \sa SDL_GetWindowSize() - * \sa SDL_CreateWindow() - */ -extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, - int *h); - -/** - * \brief Set the swap interval for the current OpenGL context. - * - * \param interval 0 for immediate updates, 1 for updates synchronized with the - * vertical retrace. If the system supports it, you may - * specify -1 to allow late swaps to happen immediately - * instead of waiting for the next retrace. - * - * \return 0 on success, or -1 if setting the swap interval is not supported. - * - * \sa SDL_GL_GetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); - -/** - * \brief Get the swap interval for the current OpenGL context. - * - * \return 0 if there is no vertical retrace synchronization, 1 if the buffer - * swap is synchronized with the vertical retrace, and -1 if late - * swaps happen immediately instead of waiting for the next retrace. - * If the system can't determine the swap interval, or there isn't a - * valid current context, this will return 0 as a safe default. - * - * \sa SDL_GL_SetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); - -/** - * \brief Swap the OpenGL buffers for a window, if double-buffering is - * supported. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); - -/** - * \brief Delete an OpenGL context. - * - * \sa SDL_GL_CreateContext() - */ -extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); - -/* @} *//* OpenGL support functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_video_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_vulkan.h b/Windows/SDL2/include/SDL_vulkan.h deleted file mode 100644 index d69a436b..00000000 --- a/Windows/SDL2/include/SDL_vulkan.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 2017, Mark Callow - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_vulkan.h - * - * Header file for functions to creating Vulkan surfaces on SDL windows. - */ - -#ifndef SDL_vulkan_h_ -#define SDL_vulkan_h_ - -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Avoid including vulkan.h, don't define VkInstance if it's already included */ -#ifdef VULKAN_H_ -#define NO_SDL_VULKAN_TYPEDEFS -#endif -#ifndef NO_SDL_VULKAN_TYPEDEFS -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; - -#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; -#else -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; -#endif - -VK_DEFINE_HANDLE(VkInstance) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) - -#endif /* !NO_SDL_VULKAN_TYPEDEFS */ - -typedef VkInstance SDL_vulkanInstance; -typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */ - -/** - * \name Vulkan support functions - * - * \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API - * is compatable with Tizen's implementation of Vulkan in SDL. - */ -/* @{ */ - -/** - * \brief Dynamically load a Vulkan loader library. - * - * \param [in] path The platform dependent Vulkan loader library name, or - * \c NULL. - * - * \return \c 0 on success, or \c -1 if the library couldn't be loaded. - * - * If \a path is NULL SDL will use the value of the environment variable - * \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan - * loader library. - * - * This should be called after initializing the video driver, but before - * creating any Vulkan windows. If no Vulkan loader library is loaded, the - * default library will be loaded upon creation of the first Vulkan window. - * - * \note It is fairly common for Vulkan applications to link with \a libvulkan - * instead of explicitly loading it at run time. This will work with - * SDL provided the application links to a dynamic library and both it - * and SDL use the same search path. - * - * \note If you specify a non-NULL \c path, an application should retrieve all - * of the Vulkan functions it uses from the dynamic library using - * \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee - * \c path points to the same vulkan loader library the application - * linked to. - * - * \note On Apple devices, if \a path is NULL, SDL will attempt to find - * the vkGetInstanceProcAddr address within all the mach-o images of - * the current process. This is because it is fairly common for Vulkan - * applications to link with libvulkan (and historically MoltenVK was - * provided as a static library). If it is not found then, on macOS, SDL - * will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib, - * followed by \c libvulkan.dylib, in that order. - * On iOS SDL will attempt to load \c libvulkan.dylib only. Applications - * using a dynamic framework or .dylib must ensure it is included in its - * application bundle. - * - * \note On non-Apple devices, application linking with a static libvulkan is - * not supported. Either do not link to the Vulkan loader or link to a - * dynamic library version. - * - * \note This function will fail if there are no working Vulkan drivers - * installed. - * - * \sa SDL_Vulkan_GetVkGetInstanceProcAddr() - * \sa SDL_Vulkan_UnloadLibrary() - */ -extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); - -/** - * \brief Get the address of the \c vkGetInstanceProcAddr function. - * - * \note This should be called after either calling SDL_Vulkan_LoadLibrary - * or creating an SDL_Window with the SDL_WINDOW_VULKAN flag. - */ -extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void); - -/** - * \brief Unload the Vulkan loader library previously loaded by - * \c SDL_Vulkan_LoadLibrary(). - * - * \sa SDL_Vulkan_LoadLibrary() - */ -extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); - -/** - * \brief Get the names of the Vulkan instance extensions needed to create - * a surface with \c SDL_Vulkan_CreateSurface(). - * - * \param [in] \c NULL or window Window for which the required Vulkan instance - * extensions should be retrieved - * \param [in,out] pCount pointer to an \c unsigned related to the number of - * required Vulkan instance extensions - * \param [out] pNames \c NULL or a pointer to an array to be filled with the - * required Vulkan instance extensions - * - * \return \c SDL_TRUE on success, \c SDL_FALSE on error. - * - * If \a pNames is \c NULL, then the number of required Vulkan instance - * extensions is returned in pCount. Otherwise, \a pCount must point to a - * variable set to the number of elements in the \a pNames array, and on - * return the variable is overwritten with the number of names actually - * written to \a pNames. If \a pCount is less than the number of required - * extensions, at most \a pCount structures will be written. If \a pCount - * is smaller than the number of required extensions, \c SDL_FALSE will be - * returned instead of \c SDL_TRUE, to indicate that not all the required - * extensions were returned. - * - * \note If \c window is not NULL, it will be checked against its creation - * flags to ensure that the Vulkan flag is present. This parameter - * will be removed in a future major release. - * - * \note The returned list of extensions will contain \c VK_KHR_surface - * and zero or more platform specific extensions - * - * \note The extension names queried here must be enabled when calling - * VkCreateInstance, otherwise surface creation will fail. - * - * \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag - * or be \c NULL - * - * \code - * unsigned int count; - * // get count of required extensions - * if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL)) - * handle_error(); - * - * static const char *const additionalExtensions[] = - * { - * VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension - * }; - * size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]); - * size_t extensionCount = count + additionalExtensionsCount; - * const char **names = malloc(sizeof(const char *) * extensionCount); - * if(!names) - * handle_error(); - * - * // get names of required extensions - * if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names)) - * handle_error(); - * - * // copy additional extensions after required extensions - * for(size_t i = 0; i < additionalExtensionsCount; i++) - * names[i + count] = additionalExtensions[i]; - * - * VkInstanceCreateInfo instanceCreateInfo = {}; - * instanceCreateInfo.enabledExtensionCount = extensionCount; - * instanceCreateInfo.ppEnabledExtensionNames = names; - * // fill in rest of instanceCreateInfo - * - * VkInstance instance; - * // create the Vulkan instance - * VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance); - * free(names); - * \endcode - * - * \sa SDL_Vulkan_CreateSurface() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( - SDL_Window *window, - unsigned int *pCount, - const char **pNames); - -/** - * \brief Create a Vulkan rendering surface for a window. - * - * \param [in] window SDL_Window to which to attach the rendering surface. - * \param [in] instance handle to the Vulkan instance to use. - * \param [out] surface pointer to a VkSurfaceKHR handle to receive the - * handle of the newly created surface. - * - * \return \c SDL_TRUE on success, \c SDL_FALSE on error. - * - * \code - * VkInstance instance; - * SDL_Window *window; - * - * // create instance and window - * - * // create the Vulkan surface - * VkSurfaceKHR surface; - * if(!SDL_Vulkan_CreateSurface(window, instance, &surface)) - * handle_error(); - * \endcode - * - * \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag. - * - * \note \a instance should have been created with the extensions returned - * by \c SDL_Vulkan_CreateSurface() enabled. - * - * \sa SDL_Vulkan_GetInstanceExtensions() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface( - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR* surface); - -/** - * \brief Get the size of a window's underlying drawable in pixels (for use - * with setting viewport, scissor & etc). - * - * \param window SDL_Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, - * may be NULL - * \param h Pointer to variable for storing the height in pixels, - * may be NULL - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a - * platform with high-DPI support (Apple calls this "Retina"), and not disabled - * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. - * - * \note On macOS high-DPI support must be enabled for an application by - * setting NSHighResolutionCapable to true in its Info.plist. - * - * \sa SDL_GetWindowSize() - * \sa SDL_CreateWindow() - */ -extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window, - int *w, int *h); - -/* @} *//* Vulkan support functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_vulkan_h_ */ diff --git a/Windows/SDL2/include/begin_code.h b/Windows/SDL2/include/begin_code.h deleted file mode 100644 index 22c997c4..00000000 --- a/Windows/SDL2/include/begin_code.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file begin_code.h - * - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) - */ - -/* This shouldn't be nested -- included it around code only. */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -#ifndef SDL_DEPRECATED -# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ -# define SDL_DEPRECATED __attribute__((deprecated)) -# else -# define SDL_DEPRECATED -# endif -#endif - -#ifndef SDL_UNUSED -# ifdef __GNUC__ -# define SDL_UNUSED __attribute__((unused)) -# else -# define SDL_UNUSED -# endif -#endif - -/* Some compilers use a special export keyword */ -#ifndef DECLSPEC -# if defined(__WIN32__) || defined(__WINRT__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# elif defined(__OS2__) -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/* By default SDL uses the C calling convention */ -#ifndef SDLCALL -#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) -#define SDLCALL __cdecl -#elif defined(__OS2__) || defined(__EMX__) -#define SDLCALL _System -# if defined (__GNUC__) && !defined(_System) -# define _System /* for old EMX/GCC compat. */ -# endif -#else -#define SDLCALL -#endif -#endif /* SDLCALL */ - -/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ -#ifdef __SYMBIAN32__ -#undef DECLSPEC -#define DECLSPEC -#endif /* __SYMBIAN32__ */ - -/* Force structure packing at 4 byte alignment. - This is necessary if the header is included in code which has structure - packing set to an alternate value, say for loading structures from disk. - The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpragma-pack" -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#ifdef _M_X64 -/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ -#pragma pack(push,8) -#else -#pragma pack(push,4) -#endif -#endif /* Compiler needs structure packing set */ - -#ifndef SDL_INLINE -#if defined(__GNUC__) -#define SDL_INLINE __inline__ -#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) || defined(__CC_ARM) -#define SDL_INLINE __inline -#ifndef __inline__ -#define __inline__ __inline -#endif -#else -#define SDL_INLINE inline -#ifndef __inline__ -#define __inline__ inline -#endif -#endif -#endif /* SDL_INLINE not defined */ - -#ifndef SDL_FORCE_INLINE -#if defined(_MSC_VER) -#define SDL_FORCE_INLINE __forceinline -#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) -#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ -#else -#define SDL_FORCE_INLINE static SDL_INLINE -#endif -#endif /* SDL_FORCE_INLINE not defined */ - -#ifndef SDL_NORETURN -#if defined(__GNUC__) -#define SDL_NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define SDL_NORETURN __declspec(noreturn) -#else -#define SDL_NORETURN -#endif -#endif /* SDL_NORETURN not defined */ - -/* Apparently this is needed by several Windows compilers */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/Windows/SDL2/include/close_code.h b/Windows/SDL2/include/close_code.h deleted file mode 100644 index 8e4cac3d..00000000 --- a/Windows/SDL2/include/close_code.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file close_code.h - * - * This file reverses the effects of begin_code.h and should be included - * after you finish any function and structure declarations in your headers - */ - -#ifndef _begin_code_h -#error close_code.h included without matching begin_code.h -#endif -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#pragma pack(pop) -#endif /* Compiler needs structure packing set */ diff --git a/Windows/VisualStudio/quakespasm-sdl2.vcxproj b/Windows/VisualStudio/quakespasm-sdl2.vcxproj index 940f24f8..42e4effb 100644 --- a/Windows/VisualStudio/quakespasm-sdl2.vcxproj +++ b/Windows/VisualStudio/quakespasm-sdl2.vcxproj @@ -80,9 +80,10 @@ <OutDir>$(SolutionDir)Build-$(ProjectName)\$(Platform)\$(Configuration)\</OutDir> <IntDir>Build-$(ProjectName)\$(Platform)\$(Configuration)\</IntDir> <LinkIncremental>true</LinkIncremental> + <TargetName>quakevr-debug</TargetName> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <OutDir>$(SolutionDir)Build-$(ProjectName)\$(Platform)\Debug</OutDir> + <OutDir>$(SolutionDir)Build-$(ProjectName)\$(Platform)\Debug\</OutDir> <IntDir>Build-$(ProjectName)\$(Platform)\$(Configuration)\</IntDir> <LinkIncremental>false</LinkIncremental> <TargetName>quakevr</TargetName> @@ -149,8 +150,8 @@ copy "$(SolutionDir)\..\SDL2\lib\*.dll" "$(TargetDir)"</Command> </Midl> <ClCompile> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\..\glm;..\SDL2\include;..\codecs\include;..\misc\include;..\..\Quake;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;USE_SDL2;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;PARANOID;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..\..\glm;..\SDL2\include;..\codecs\include;..\misc\include;..\..\Quake;..\glew\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;USE_SDL2;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;PARANOID;__clang__;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>false</MinimalRebuild> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> @@ -160,11 +161,12 @@ copy "$(SolutionDir)\..\SDL2\lib\*.dll" "$(TargetDir)"</Command> <CompileAs>CompileAsCpp</CompileAs> <LanguageStandard>stdcpp17</LanguageStandard> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <AdditionalOptions>-ftime-trace</AdditionalOptions> + <AdditionalOptions> + </AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>C:\OHWorkspace\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;glew32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>C:\OHWorkspace\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;..\glew\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <IgnoreSpecificDefaultLibraries>msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> @@ -185,8 +187,8 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClCompile> <Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>../../glm;..\SDL2\include;..\codecs\include;..\misc\include;..\..\Quake;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;USE_SDL2;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>../../glm;..\SDL2\include;..\codecs\include;..\misc\include;..\..\Quake;..\glew\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;USE_SDL2;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;__clang__;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <FunctionLevelLinking>true</FunctionLevelLinking> <PrecompiledHeader /> @@ -199,10 +201,16 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <OmitFramePointers>true</OmitFramePointers> <AdditionalOptions>-flto=thin %(AdditionalOptions)</AdditionalOptions> + <FloatingPointModel>Fast</FloatingPointModel> + <ExceptionHandling>false</ExceptionHandling> + <BufferSecurityCheck>false</BufferSecurityCheck> + <ControlFlowGuard>false</ControlFlowGuard> + <FloatingPointExceptions>false</FloatingPointExceptions> + <RuntimeTypeInfo>false</RuntimeTypeInfo> </ClCompile> <Link> - <AdditionalDependencies>openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>C:\OHWorkspace\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;glew32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>C:\OHWorkspace\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;..\glew\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> @@ -219,9 +227,11 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\Quake\bgmusic.cpp" /> + <ClCompile Include="..\..\Quake\byteorder.cpp" /> <ClCompile Include="..\..\Quake\cd_sdl.cpp" /> <ClCompile Include="..\..\Quake\cfgfile.cpp" /> <ClCompile Include="..\..\Quake\chase.cpp" /> + <ClCompile Include="..\..\Quake\client.cpp" /> <ClCompile Include="..\..\Quake\cl_demo.cpp" /> <ClCompile Include="..\..\Quake\cl_input.cpp" /> <ClCompile Include="..\..\Quake\cl_main.cpp" /> @@ -232,6 +242,7 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClCompile Include="..\..\Quake\console.cpp" /> <ClCompile Include="..\..\Quake\crc.cpp" /> <ClCompile Include="..\..\Quake\cvar.cpp" /> + <ClCompile Include="..\..\Quake\fshandle.cpp" /> <ClCompile Include="..\..\Quake\gl_draw.cpp" /> <ClCompile Include="..\..\Quake\gl_fog.cpp" /> <ClCompile Include="..\..\Quake\gl_mesh.cpp" /> @@ -243,6 +254,7 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClCompile Include="..\..\Quake\gl_screen.cpp" /> <ClCompile Include="..\..\Quake\gl_sky.cpp" /> <ClCompile Include="..\..\Quake\gl_texmgr.cpp" /> + <ClCompile Include="..\..\Quake\gl_util.cpp" /> <ClCompile Include="..\..\Quake\gl_vidsdl.cpp" /> <ClCompile Include="..\..\Quake\gl_warp.cpp" /> <ClCompile Include="..\..\Quake\host.cpp" /> @@ -253,14 +265,15 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClCompile Include="..\..\Quake\main_sdl.cpp" /> <ClCompile Include="..\..\Quake\mathlib.cpp" /> <ClCompile Include="..\..\Quake\menu.cpp" /> + <ClCompile Include="..\..\Quake\menu_keyboard.cpp" /> <ClCompile Include="..\..\Quake\menu_util.cpp" /> + <ClCompile Include="..\..\Quake\msg.cpp" /> <ClCompile Include="..\..\Quake\net_dgrm.cpp" /> <ClCompile Include="..\..\Quake\net_loop.cpp" /> <ClCompile Include="..\..\Quake\net_main.cpp" /> <ClCompile Include="..\..\Quake\net_win.cpp" /> <ClCompile Include="..\..\Quake\net_wins.cpp" /> <ClCompile Include="..\..\Quake\net_wipx.cpp" /> - <ClCompile Include="..\..\Quake\opengl_ext.cpp" /> <ClCompile Include="..\..\Quake\pl_win.cpp" /> <ClCompile Include="..\..\Quake\pr_cmds.cpp" /> <ClCompile Include="..\..\Quake\pr_edict.cpp" /> @@ -277,7 +290,11 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> </ClCompile> <ClCompile Include="..\..\Quake\r_sprite.cpp" /> <ClCompile Include="..\..\Quake\r_world.cpp" /> + <ClCompile Include="..\..\Quake\saveutil.cpp" /> <ClCompile Include="..\..\Quake\sbar.cpp" /> + <ClCompile Include="..\..\Quake\server.cpp" /> + <ClCompile Include="..\..\Quake\shader.cpp" /> + <ClCompile Include="..\..\Quake\sizebuf.cpp" /> <ClCompile Include="..\..\Quake\snd_codec.cpp" /> <ClCompile Include="..\..\Quake\snd_dma.cpp" /> <ClCompile Include="..\..\Quake\snd_flac.cpp" /> @@ -301,6 +318,8 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClCompile Include="..\..\Quake\sys_sdl_win.cpp" /> <ClCompile Include="..\..\Quake\view.cpp" /> <ClCompile Include="..\..\Quake\vr.cpp" /> + <ClCompile Include="..\..\Quake\vr_cvars.cpp" /> + <ClCompile Include="..\..\Quake\vr_showfn.cpp" /> <ClCompile Include="..\..\Quake\wad.cpp" /> <ClCompile Include="..\..\Quake\world.cpp" /> <ClCompile Include="..\..\Quake\zone.cpp" /> @@ -338,7 +357,6 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClInclude Include="..\..\Quake\net_sys.hpp" /> <ClInclude Include="..\..\Quake\net_wins.hpp" /> <ClInclude Include="..\..\Quake\net_wipx.hpp" /> - <ClInclude Include="..\..\Quake\opengl_ext.hpp" /> <ClInclude Include="..\..\Quake\openvr.hpp" /> <ClInclude Include="..\..\Quake\openvr_driver.hpp" /> <ClInclude Include="..\..\Quake\platform.hpp" /> @@ -373,6 +391,9 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)"</Command> <ClInclude Include="..\..\Quake\vid.hpp" /> <ClInclude Include="..\..\Quake\view.hpp" /> <ClInclude Include="..\..\Quake\vr.hpp" /> + <ClInclude Include="..\..\Quake\vr_cvars.hpp" /> + <ClInclude Include="..\..\Quake\vr_macros.hpp" /> + <ClInclude Include="..\..\Quake\vr_showfn.hpp" /> <ClInclude Include="..\..\Quake\wad.hpp" /> <ClInclude Include="..\..\Quake\world.hpp" /> <ClInclude Include="..\..\Quake\wsaerror.hpp" /> diff --git a/Windows/VisualStudio/quakespasm-sdl2.vcxproj.filters b/Windows/VisualStudio/quakespasm-sdl2.vcxproj.filters index 5166a9d6..b2540f51 100644 --- a/Windows/VisualStudio/quakespasm-sdl2.vcxproj.filters +++ b/Windows/VisualStudio/quakespasm-sdl2.vcxproj.filters @@ -249,10 +249,43 @@ <ClCompile Include="..\..\Quake\menu_util.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\..\Quake\opengl_ext.cpp"> + <ClCompile Include="..\..\Quake\quakeglm.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\..\Quake\quakeglm.cpp"> + <ClCompile Include="..\..\Quake\vr_cvars.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\vr_showfn.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\fshandle.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\shader.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\sizebuf.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\byteorder.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\msg.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\server.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\client.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\saveutil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\gl_util.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\Quake\menu_keyboard.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> @@ -467,7 +500,13 @@ <ClInclude Include="..\..\Quake\menu_util.hpp"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\..\Quake\opengl_ext.hpp"> + <ClInclude Include="..\..\Quake\vr_cvars.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\Quake\vr_showfn.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\Quake\vr_macros.hpp"> <Filter>Header Files</Filter> </ClInclude> </ItemGroup> diff --git a/Windows/glew/LICENSE.txt b/Windows/glew/LICENSE.txt new file mode 100644 index 00000000..f7078042 --- /dev/null +++ b/Windows/glew/LICENSE.txt @@ -0,0 +1,73 @@ +The OpenGL Extension Wrangler Library +Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org> +Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org> +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + + +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/Windows/glew/Makefile b/Windows/glew/Makefile new file mode 100644 index 00000000..b991460a --- /dev/null +++ b/Windows/glew/Makefile @@ -0,0 +1,352 @@ +#!gmake +## The OpenGL Extension Wrangler Library +## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> +## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> +## Copyright (C) 2002, Lev Povalahev +## All rights reserved. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are met: +## +## * Redistributions of source code must retain the above copyright notice, +## this list of conditions and the following disclaimer. +## * Redistributions in binary form must reproduce the above copyright notice, +## this list of conditions and the following disclaimer in the documentation +## and/or other materials provided with the distribution. +## * The name of the author may be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +## THE POSSIBILITY OF SUCH DAMAGE. + +include config/version + +SHELL = /bin/sh +SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;') +SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1) + +ifeq ($(SYSTEM.SUPPORTED), 1) +include config/Makefile.$(SYSTEM) +else +$(error "Platform '$(SYSTEM)' not supported") +endif + +GLEW_PREFIX ?= /usr +GLEW_DEST ?= /usr +BINDIR ?= $(GLEW_DEST)/bin +LIBDIR ?= $(GLEW_DEST)/lib +INCDIR ?= $(GLEW_DEST)/include/GL +PKGDIR ?= $(GLEW_DEST)/lib/pkgconfig + +ifneq ($(GLEW_NO_GLU), -DGLEW_NO_GLU) +LIBGLU = glu +endif + +DIST_NAME ?= glew-$(GLEW_VERSION) +DIST_SRC_ZIP ?= $(shell pwd)/$(DIST_NAME).zip +DIST_SRC_TGZ ?= $(shell pwd)/$(DIST_NAME).tgz +DIST_WIN32 ?= $(shell pwd)/$(DIST_NAME)-win32.zip + +DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME) + +# To disable stripping of linked binaries either: +# - use STRIP= on gmake command-line +# - edit this makefile to set STRIP to the empty string +# (Note: STRIP does not affect the strip in the install step) +# +# To disable symlinks: +# - use LN= on gmake command-line + +AR ?= ar +ARFLAGS ?= cr +INSTALL ?= install +STRIP ?= strip +RM ?= rm -f +LN ?= ln -sf +UNIX2DOS ?= unix2dos -q +DOS2UNIX ?= dos2unix -q + +ifneq (,$(filter debug,$(MAKECMDGOALS))) +OPT = -g +else +OPT = $(POPT) +endif +INCLUDE = -Iinclude +CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA) + +all debug: glew.lib glew.bin + +# GLEW shared and static libraries + +LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL) +LIB.LIBS := $(GL_LDFLAGS) + +LIB.SRCS := src/glew.c +LIB.SRCS.NAMES := $(notdir $(LIB.SRCS)) + +LIB.OBJS := $(addprefix tmp/$(SYSTEM)/default/static/,$(LIB.SRCS.NAMES)) +LIB.OBJS := $(LIB.OBJS:.c=.o) +LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/default/shared/,$(LIB.SRCS.NAMES)) +LIB.SOBJS := $(LIB.SOBJS:.c=.o) + +glew.lib: glew.lib.shared glew.lib.static + +glew.lib.shared: lib lib/$(LIB.SHARED) glew.pc +glew.lib.static: lib lib/$(LIB.STATIC) glew.pc + +.PHONY: glew.lib glew.lib.shared glew.lib.static + +lib: + mkdir lib + +lib/$(LIB.STATIC): $(LIB.OBJS) +ifneq ($(AR),) + $(AR) $(ARFLAGS) $@ $^ +else ifneq ($(LIBTOOL),) + $(LIBTOOL) $@ $^ +endif +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +lib/$(LIB.SHARED): $(LIB.SOBJS) + $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) +ifneq ($(LN),) + $(LN) $(LIB.SHARED) lib/$(LIB.SONAME) + $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK) +endif +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +tmp/$(SYSTEM)/default/static/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU -DGLEW_STATIC $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +tmp/$(SYSTEM)/default/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU -DGLEW_BUILD $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +# Force re-write of glew.pc, GLEW_DEST can vary + +.PHONY: glew.pc + +glew.pc: glew.pc.in + sed \ + -e "s|@prefix@|$(GLEW_PREFIX)|g" \ + -e "s|@libdir@|$(LIBDIR)|g" \ + -e "s|@exec_prefix@|$(BINDIR)|g" \ + -e "s|@includedir@|$(INCDIR)|g" \ + -e "s|@version@|$(GLEW_VERSION)|g" \ + -e "s|@cflags@||g" \ + -e "s|@libname@|$(NAME)|g" \ + -e "s|@requireslib@|$(LIBGLU)|g" \ + < $< > $@ + +# GLEW utility programs + +BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL) + +GLEWINFO.BIN := glewinfo$(BIN.SUFFIX) +GLEWINFO.BIN.SRC := src/glewinfo.c +GLEWINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(GLEWINFO.BIN.SRC))) +GLEWINFO.BIN.OBJ := $(GLEWINFO.BIN.OBJ:.c=.o) + +VISUALINFO.BIN := visualinfo$(BIN.SUFFIX) +VISUALINFO.BIN.SRC := src/visualinfo.c +VISUALINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(VISUALINFO.BIN.SRC))) +VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o) + +# Don't build glewinfo or visualinfo for NaCL, yet. + +ifneq ($(filter nacl%,$(SYSTEM)),) +glew.bin: glew.lib bin +else +glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) +endif + +bin: + mkdir bin + +bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) lib/$(LIB.SHARED) + $(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS) +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) lib/$(LIB.SHARED) + $(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS) +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +$(GLEWINFO.BIN.OBJ): $(GLEWINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +$(VISUALINFO.BIN.OBJ): $(VISUALINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +# Install targets + +install.all: install install.bin + +install: install.include install.lib install.pkgconfig + +install.lib: glew.lib + $(INSTALL) -d -m 0755 "$(DESTDIR)$(LIBDIR)" +# runtime +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)" + $(INSTALL) -m 0755 lib/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/" +else + $(INSTALL) -m 0644 lib/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/" +endif +ifneq ($(LN),) + $(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)" +endif + +# development files +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(INSTALL) -m 0644 lib/$(LIB.DEVLNK) "$(DESTDIR)$(LIBDIR)/" +endif +ifneq ($(LN),) + $(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.DEVLNK)" +endif + $(INSTALL) -m 0644 lib/$(LIB.STATIC) "$(DESTDIR)$(LIBDIR)/" + +install.bin: glew.bin + $(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)" + $(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/" + +install.include: + $(INSTALL) -d -m 0755 "$(DESTDIR)$(INCDIR)" + $(INSTALL) -m 0644 include/GL/wglew.h "$(DESTDIR)$(INCDIR)/" + $(INSTALL) -m 0644 include/GL/glew.h "$(DESTDIR)$(INCDIR)/" + $(INSTALL) -m 0644 include/GL/glxew.h "$(DESTDIR)$(INCDIR)/" + +install.pkgconfig: glew.pc + $(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)" + $(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)" + $(INSTALL) -m 0644 glew.pc "$(DESTDIR)$(PKGDIR)/" + +uninstall: + $(RM) "$(DESTDIR)$(INCDIR)/wglew.h" + $(RM) "$(DESTDIR)$(INCDIR)/glew.h" + $(RM) "$(DESTDIR)$(INCDIR)/glxew.h" + $(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.DEVLNK)" +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(RM) "$(DESTDIR)$(BINDIR)/$(LIB.SHARED)" +else + $(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)" + $(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.SHARED)" +endif + $(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.STATIC)" + $(RM) "$(DESTDIR)$(BINDIR)/$(GLEWINFO.BIN)" "$(DESTDIR)$(BINDIR)/$(VISUALINFO.BIN)" + +clean: + $(RM) -r tmp/ + $(RM) -r lib/ + $(RM) -r bin/ + $(RM) glew.pc + +distclean: clean + find . -name \*~ | xargs $(RM) + find . -name .\*.sw\? | xargs $(RM) + +# Distributions + +dist-win32: + $(RM) -r $(DIST_DIR) + mkdir -p $(DIST_DIR) + cp -a include $(DIST_DIR) + cp -a doc $(DIST_DIR) + cp -a *.txt $(DIST_DIR) + cp -a bin $(DIST_DIR) + cp -a lib $(DIST_DIR) + $(RM) -f $(DIST_DIR)/bin/*/*/*.pdb $(DIST_DIR)/bin/*/*/*.exp + $(RM) -f $(DIST_DIR)/bin/*/*/glewinfo-*.exe $(DIST_DIR)/bin/*/*/visualinfo-*.exe + $(RM) -f $(DIST_DIR)/lib/*/*/*.pdb $(DIST_DIR)/lib/*/*/*.exp + $(UNIX2DOS) $(DIST_DIR)/include/GL/*.h + $(UNIX2DOS) $(DIST_DIR)/doc/*.txt + $(UNIX2DOS) $(DIST_DIR)/doc/*.html + $(UNIX2DOS) $(DIST_DIR)/*.txt + rm -f $(DIST_WIN32) + cd $(DIST_DIR)/.. && zip -rq9 $(DIST_WIN32) $(DIST_NAME) + $(RM) -r $(DIST_DIR) + +dist-src: + $(RM) -r $(DIST_DIR) + mkdir -p $(DIST_DIR) + mkdir -p $(DIST_DIR)/bin + mkdir -p $(DIST_DIR)/lib + cp -a auto $(DIST_DIR) + $(RM) -Rf $(DIST_DIR)/auto/registry + cp -a build $(DIST_DIR) + cp -a config $(DIST_DIR) + cp -a src $(DIST_DIR) + cp -a doc $(DIST_DIR) + cp -a include $(DIST_DIR) + cp -a *.md $(DIST_DIR) + cp -a *.txt $(DIST_DIR) + cp -a Makefile $(DIST_DIR) + cp -a glew.pc.in $(DIST_DIR) + find $(DIST_DIR) -name '*.o' | xargs $(RM) -r + find $(DIST_DIR) -name '*~' | xargs $(RM) -r + find $(DIST_DIR) -name CVS -o -name .cvsignore | xargs $(RM) -r + find $(DIST_DIR) -name .svn | xargs $(RM) -r + find $(DIST_DIR) -name "*.patch" | xargs $(RM) -r + $(DOS2UNIX) $(DIST_DIR)/Makefile + $(DOS2UNIX) $(DIST_DIR)/auto/Makefile + $(DOS2UNIX) $(DIST_DIR)/config/* + $(UNIX2DOS) $(DIST_DIR)/auto/core/* + $(UNIX2DOS) $(DIST_DIR)/auto/extensions/* + find $(DIST_DIR) -name '*.h' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.c' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.md' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.txt' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.html' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.css' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.sh' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.pl' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name 'Makefile' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.in' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.pm' | xargs $(UNIX2DOS) + find $(DIST_DIR) -name '*.rc' | xargs $(UNIX2DOS) + rm -f $(DIST_SRC_ZIP) + cd $(DIST_DIR)/.. && zip -rq9 $(DIST_SRC_ZIP) $(DIST_NAME) + $(DOS2UNIX) $(DIST_DIR)/Makefile + $(DOS2UNIX) $(DIST_DIR)/auto/Makefile + $(DOS2UNIX) $(DIST_DIR)/config/* + $(DOS2UNIX) $(DIST_DIR)/auto/core/* + $(DOS2UNIX) $(DIST_DIR)/auto/extensions/* + find $(DIST_DIR) -name '*.h' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.c' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.md' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.txt' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.html' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.css' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.sh' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.pl' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name 'Makefile' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.in' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.pm' | xargs $(DOS2UNIX) + find $(DIST_DIR) -name '*.rc' | xargs $(DOS2UNIX) + rm -f $(DIST_SRC_TGZ) + cd $(DIST_DIR)/.. && env GZIP=-9 tar czf $(DIST_SRC_TGZ) $(DIST_NAME) + $(RM) -r $(DIST_DIR) + +extensions: + $(MAKE) -C auto + +.PHONY: clean distclean tardist dist-win32 dist-src diff --git a/Windows/glew/README.md b/Windows/glew/README.md new file mode 100644 index 00000000..6d8245b4 --- /dev/null +++ b/Windows/glew/README.md @@ -0,0 +1,190 @@ +# GLEW - The OpenGL Extension Wrangler Library + +![](http://glew.sourceforge.net/glew.png) + +http://glew.sourceforge.net/ + +https://github.com/nigels-com/glew + +[![Build Status](https://travis-ci.org/nigels-com/glew.svg?branch=master)](https://travis-ci.org/nigels-com/glew) +[![Gitter](https://badges.gitter.im/nigels-com/glew.svg)](https://gitter.im/nigels-com/glew?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Download](https://img.shields.io/sourceforge/dm/glew.svg)](https://sourceforge.net/projects/glew/files/latest/download) + +## Downloads + +Current release is [2.1.0](https://sourceforge.net/projects/glew/files/glew/2.1.0/). +[(Change Log)](http://glew.sourceforge.net/log.html) + +Sources available as +[ZIP](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip/download) or +[TGZ](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download). + +Windows binaries for [32-bit and 64-bit](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download). + +### Recent snapshots + +Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases. + +## Build + +It is highly recommended to build from a tgz or zip release snapshot. +The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac. +For most end-users of GLEW the official releases are the best choice, with first class support. + +### Linux and Mac + +#### Using GNU Make + +##### Install build tools + +Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev` + +RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel` + +##### Build + + $ make + $ sudo make install + $ make clean + +Targets: `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall` + +Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=` + +_Note: may need to make **auto** folder_ + +#### Using cmake + +*CMake 2.8.12 or higher is required.* + +##### Install build tools + +Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev cmake` + +RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake` + +##### Build + + $ cd build + $ cmake ./cmake + $ make -j4 + +| Target | Description | +| ---------- | ----------- | +| glew | Build the glew shared library. | +| glew_s | Build the glew static library. | +| glewinfo | Build the `glewinfo` executable (requires `BUILD_UTILS` to be `ON`). | +| visualinfo | Build the `visualinfo` executable (requires `BUILD_UTILS` to be `ON`). | +| install | Install all enabled targets into `CMAKE_INSTALL_PREFIX`. | +| clean | Clean up build artifacts. | +| all | Build all enabled targets (default target). | + +| Variables | Description | +| --------------- | ----------- | +| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. | +| GLEW_REGAL | Build in Regal mode. | +| GLEW_OSMESA | Build in off-screen Mesa mode. | +| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. | + +### Windows + +#### Visual Studio + +Use the provided Visual Studio project file in build/vc12/ + +Projects for vc6 and vc10 are also provided + +#### MSYS/Mingw + +Available from [Mingw](http://www.mingw.org/) + +Requirements: bash, make, gcc + + $ mingw32-make + $ mingw32-make install + $ mingw32-make install.all + +Alternative toolchain: `SYSTEM=mingw-win32` + +#### MSYS2/Mingw-w64 + +Available from [Msys2](http://msys2.github.io/) and/or [Mingw-w64](http://mingw-w64.org/) + +Requirements: bash, make, gcc + + $ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc + $ make + $ make install + $ make install.all + +Alternative toolchain: `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64` + +## glewinfo + +`glewinfo` is a command-line tool useful for inspecting the capabilities of an +OpenGL implementation and GLEW support for that. Please include `glewinfo.txt` +with bug reports, as appropriate. + + --------------------------- + GLEW Extension Info + --------------------------- + + GLEW version 2.0.0 + Reporting capabilities of pixelformat 3 + Running on a Intel(R) HD Graphics 3000 from Intel + OpenGL version 3.1.0 - Build 9.17.10.4229 is supported + + GL_VERSION_1_1: OK + --------------- + + GL_VERSION_1_2: OK + --------------- + glCopyTexSubImage3D: OK + glDrawRangeElements: OK + glTexImage3D: OK + glTexSubImage3D: OK + + ... + +## Code Generation + +A Unix or Mac environment is needed for building GLEW from scratch to +include new extensions, or customize the code generation. The extension +data is regenerated from the top level source directory with: + + make extensions + +An alternative to generating the GLEW sources from scratch is to +download a pre-generated (unsupported) snapshot: + +https://sourceforge.net/projects/glew/files/glew/snapshots/ + +Travis-built snapshots are also available: + +https://glew.s3.amazonaws.com/index.html + +## Authors + +GLEW is currently maintained by [Nigel Stewart](https://github.com/nigels-com) +with bug fixes, new OpenGL extension support and new releases. + +GLEW was developed by [Milan Ikits](http://www.cs.utah.edu/~ikits/) +and [Marcelo Magallon](http://wwwvis.informatik.uni-stuttgart.de/~magallon/). +Aaron Lefohn, Joe Kniss, and Chris Wyman were the first users and also +assisted with the design and debugging process. + +The acronym GLEW originates from Aaron Lefohn. +Pasi Kärkkäinen identified and fixed several problems with +GLX and SDL. Nate Robins created the `wglinfo` utility, to +which modifications were made by Michael Wimmer. + +## Copyright and Licensing + +GLEW is originally derived from the EXTGL project by Lev Povalahev. +The source code is licensed under the +[Modified BSD License](http://glew.sourceforge.net/glew.txt), the +[Mesa 3-D License](http://glew.sourceforge.net/mesa.txt) (MIT) and the +[Khronos License](http://glew.sourceforge.net/khronos.txt) (MIT). + +The automatic code generation scripts are released under the +[GNU GPL](http://glew.sourceforge.net/gpl.txt). diff --git a/Windows/glew/auto/Makefile b/Windows/glew/auto/Makefile new file mode 100644 index 00000000..ff9dd361 --- /dev/null +++ b/Windows/glew/auto/Makefile @@ -0,0 +1,357 @@ +## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> +## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +include ../config/version + +#GLEW_SPLIT_SOURCE = yes + +SHELL = bash +PYTHON ?= python + +### Use git repository for GL extension specifications + +GIT_CLONE ?= git clone --branch glew https://github.com/nigels-com/glfixes.git + +### +### Conventional desktop OpenGL settings +### + +REGISTRY = registry/gl/specs +EXT = extensions/gl +FILTER = filter_gl_ext.sh +CORE = core/gl +REGISTRY_URL = http://www.opengl.org/registry/ + +### +### Experimental OpenGL ES settings +### + +# REGISTRY = registry/gles +# EXT = extensions/gles +# FILTER = filter_gles_ext.sh +# CORE = core/gles +# REGISTRY_URL = http://www.khronos.org/registry/gles/ + +BIN = bin +SRC = src +BLACKLIST = blacklist + +GL_CORE_SPEC := $(CORE)/GL_VERSION* +GLX_CORE_SPEC := $(CORE)/GLX_VERSION* +EGL_CORE_SPEC := $(CORE)/EGL_VERSION* +ifeq (custom,$(MAKECMDGOALS)) +#GL_CORE_SPEC := $(shell grep GL_VERSION custom.txt | perl -pi -e "s=^=$(CORE)/=g;") +GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | perl -pi -e "s=^=$(EXT)/=g;") +WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | perl -pi -e "s=^=$(EXT)/=g;") +#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | perl -pi -e "s=^=$(CORE)/=g;") +GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | perl -pi -e "s=^=$(EXT)/=g;") +EGL_EXT_SPEC := $(shell grep "^[ \t]*EGL_" custom.txt | grep -v EGL_VERSION | perl -pi -e "s=^=$(EXT)/=g;") +else +GL_EXT_SPEC := $(EXT)/GL_* +WGL_EXT_SPEC := $(EXT)/WGL_* +GLX_EXT_SPEC := $(EXT)/GLX_* +EGL_EXT_SPEC := $(EXT)/EGL_* +endif + +PARSE_SPEC = parse_spec.pl +SYSTEM = $(strip $(shell uname -s)) + +TOP = .. +I.DEST = $(TOP)/include/GL +S.DEST = $(TOP)/src +D.DEST = $(TOP)/doc +B.DEST = $(TOP)/build + +I.TARGETS = \ + $(I.DEST)/glew.h \ + $(I.DEST)/wglew.h \ + $(I.DEST)/glxew.h \ + $(I.DEST)/eglew.h + +ifeq (yes,$(GLEW_SPLIT_SOURCE)) +S.TARGETS = \ + $(S.DEST)/glew_def.c \ + $(S.DEST)/glew_init.c \ + $(S.DEST)/glew_str.c \ + $(S.DEST)/glewinfo.c +else +S.TARGETS = \ + $(S.DEST)/glew.c \ + $(S.DEST)/glewinfo.c +endif + +D.TARGETS = \ + $(D.DEST)/index.html \ + $(D.DEST)/install.html \ + $(D.DEST)/basic.html \ + $(D.DEST)/advanced.html \ + $(D.DEST)/build.html \ + $(D.DEST)/credits.html \ + $(D.DEST)/log.html \ + $(D.DEST)/glew.html \ + $(D.DEST)/wglew.html \ + $(D.DEST)/glxew.html + +B.TARGETS = \ + $(B.DEST)/glew.rc \ + $(B.DEST)/glewinfo.rc \ + $(B.DEST)/visualinfo.rc + +all custom: $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS) + +registry: $(REGISTRY)/.dummy +ext: $(EXT)/.dummy + +$(REGISTRY)/.dummy: + @echo "--------------------------------------------------------------------" + @echo "Downloading registry" + @echo "--------------------------------------------------------------------" + $(GIT_CLONE) registry + touch $@ + +$(EXT)/.dummy: $(REGISTRY)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating descriptors" + @echo "--------------------------------------------------------------------" + rm -rf $(EXT) + $(BIN)/update_ext.sh $(EXT) $(REGISTRY) $(BLACKLIST) + $(PYTHON) $(BIN)/parse_xml.py registry/xml/egl.xml --core core/gl --extensions extensions/gl + $(BIN)/$(FILTER) $(EXT) +ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin) + find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \ + xargs -J % cp % $(EXT) +else + find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \ + xargs cp --target-directory=$(EXT) +endif + touch $@ + +$(I.DEST)/glew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glew.h" + @echo "--------------------------------------------------------------------" + test -d $(I.DEST) || mkdir -p $(I.DEST) + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/mesa_license.h >> $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/glew_head.h >> $@ + $(BIN)/make_header.pl GLAPIENTRY GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_header.pl GLAPIENTRY GL $(GL_EXT_SPEC) >> $@ + echo -e "/* ------------------------------------------------------------------------- */\n\n" >> $@ + $(BIN)/make_struct_fun.pl GLEW_FUN_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + $(BIN)/make_struct_var.pl GLEW_VAR_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + perl -e "s/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/" -pi $@ + cat $(SRC)/glew_tail.h >> $@ + perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ + perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ + rm -f $@.bak + +$(I.DEST)/wglew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating wglew.h" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/wglew_head.h >> $@ + $(BIN)/make_header.pl WINAPI WGL $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/wglew_mid.h >> $@ + $(BIN)/make_struct_fun.pl WGLEW_FUN_EXPORT $(WGL_EXT_SPEC) >> $@ + $(BIN)/make_struct_var.pl WGLEW_VAR_EXPORT $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/wglew_tail.h >> $@ + +$(I.DEST)/glxew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glxew.h" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/mesa_license.h >> $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/glxew_head.h >> $@ + $(BIN)/make_header.pl "" GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_header.pl "" GLX $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glxew_mid.h >> $@ + $(BIN)/make_struct_fun.pl GLXEW_FUN_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + $(BIN)/make_struct_var.pl GLXEW_VAR_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + perl -e "s/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/" -pi $@ + cat $(SRC)/glxew_tail.h >> $@ + +$(I.DEST)/eglew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating eglew.h" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/mesa_license.h >> $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/eglew_head.h >> $@ + $(BIN)/make_header.pl "" EGL $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_header.pl "" EGL $(EGL_EXT_SPEC) >> $@ + cat $(SRC)/eglew_mid.h >> $@ + $(BIN)/make_struct_fun.pl EGLEW_FUN_EXPORT $(EGL_CORE_SPEC) $(EGL_EXT_SPEC) >> $@ + $(BIN)/make_struct_var.pl EGLEW_VAR_EXPORT $(EGL_CORE_SPEC) $(EGL_EXT_SPEC) >> $@ + cat $(SRC)/eglew_tail.h >> $@ + +$(S.DEST)/glew.c: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glew.c" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/glew_head.c >> $@ + $(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@ + $(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "\nstatic const char * _glewExtensionLookup[] = {" >> $@; + $(BIN)/make_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + echo -e " NULL\n};\n" >> $@; + $(BIN)/make_enable_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + $(BIN)/make_initd.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_initd.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "" >> $@; + $(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_gl.c >> $@ + $(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@ + $(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@ + $(BIN)/make_list2.pl $(GL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}\n" >> $@ + echo -e "\n#if defined(GLEW_OSMESA)" >> $@ + echo -e "\n#elif defined(GLEW_EGL)" >> $@ + $(BIN)/make_def_fun.pl EGL $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl EGL $(EGL_EXT_SPEC) >> $@ + $(BIN)/make_def_var.pl EGL $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl EGL $(EGL_EXT_SPEC) >> $@ + $(BIN)/make_init.pl EGL $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_init.pl EGL $(EGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_egl.c >> $@ + $(BIN)/make_list.pl $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_list.pl $(EGL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}" >> $@ + echo -e "\n#elif defined(_WIN32)" >> $@ + $(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@ + $(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@ + $(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_wgl.c >> $@ + $(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}" >> $@; + echo -e "\n#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@ + $(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@ + echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@ + echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@ + $(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@ + $(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_glx.c >> $@ + $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ + $(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}" >> $@ + echo -e "\n#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@; + cat $(SRC)/glew_init_tail.c >> $@ + cat $(SRC)/glew_str_head.c >> $@ + $(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_wgl.c >> $@ + $(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_glx.c >> $@ + $(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_egl.c >> $@ + $(BIN)/make_str.pl $(EGL_CORE_SPEC) $(EGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_tail.c >> $@ + perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ + perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ + perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(); _glewInit_GL_ARB_vertex_program(); }/g" -pi $@ + perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@ + rm -f $@.bak + +$(S.DEST)/glewinfo.c: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glewinfo.c" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/glewinfo_head.c >> $@ + $(BIN)/make_info.pl $(GL_CORE_SPEC) >> $@ + $(BIN)/make_info.pl $(GL_EXT_SPEC) >> $@ + echo -e "#if defined(GLEW_EGL)\n" >> $@ + $(BIN)/make_info.pl $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_info.pl $(EGL_EXT_SPEC) >> $@ + echo -e "#elif _WIN32\n" >> $@ + $(BIN)/make_info.pl $(WGL_EXT_SPEC) >> $@ + echo -e "#else /* _UNIX */\n" >> $@ + $(BIN)/make_info.pl $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_info.pl $(GLX_EXT_SPEC) >> $@ + echo -e "#endif /* _WIN32 */\n" >> $@ + + cat $(SRC)/glewinfo_gl.c >> $@ + $(BIN)/make_info_list.pl $(GL_CORE_SPEC) >> $@ + $(BIN)/make_info_list.pl $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_wgl.c >> $@ + $(BIN)/make_info_list.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_glx.c >> $@ + $(BIN)/make_info_list.pl $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_info_list.pl $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_egl.c >> $@ + $(BIN)/make_info_list.pl $(EGL_CORE_SPEC) >> $@ + $(BIN)/make_info_list.pl $(EGL_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_tail.c >> $@ + perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@ + rm -f $@.bak + +# Update documentation + +$(D.DEST)/%.html: doc/%.html + @echo "--------------------------------------------------------------------" + @echo "Creating $(@F)" + @echo "--------------------------------------------------------------------" + cat $(SRC)/header.html $< $(SRC)/footer.html | \ + perl -pe 's#<a href="$(@F)">(.*)</a>#\1#' > $@ + +$(D.DEST)/glew.html: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glew.html" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/header.html $@ + echo -e "<h2>Supported OpenGL Extensions</h2>\n" >> $@ + $(BIN)/make_html.pl $(GL_EXT_SPEC) >> $@ + cat $(SRC)/footer.html >> $@ + perl -i -pe 's#<a href="$(@F)">(.*)</a>#\1#' $@ + +$(D.DEST)/wglew.html: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating wglew.html" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/header.html $@ + echo -e "<h2>Supported WGL Extensions</h2>\n" >> $@ + $(BIN)/make_html.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/footer.html >> $@ + perl -i -pe 's#<a href="$(@F)">(.*)</a>#\1#' $@ + +$(D.DEST)/glxew.html: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glxew.html" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/header.html $@ + echo -e "<h2>Supported GLX Extensions</h2>\n" >> $@ + $(BIN)/make_html.pl $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/footer.html >> $@ + perl -i -pe 's#<a href="$(@F)">(.*)</a>#\1#' $@ + +$(B.DEST)/%.rc: src/%.rc $(EXT)/.dummy + perl -e "s/GLEW_MAJOR/$(GLEW_MAJOR)/g;s/GLEW_MINOR/$(GLEW_MINOR)/g;s/GLEW_MICRO/$(GLEW_MICRO)/g;" -p $< > $@ + +clean: + rm -rf $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS) + +clobber: clean + rm -rf $(EXT) + +destroy: clobber + rm -rf registry diff --git a/Windows/glew/auto/blacklist b/Windows/glew/auto/blacklist new file mode 100644 index 00000000..6cd0e114 --- /dev/null +++ b/Windows/glew/auto/blacklist @@ -0,0 +1,14 @@ +EXT/draw_range_elements.txt +EXT/static_vertex_array.txt +EXT/vertex_array_set.alt.txt +EXT/vertex_array_set.txt +EXT/nurbs_tessellator.txt +EXT/object_space_tess.txt +SGI/filter4_parameters.txt +SGIS/texture_color_mask.txt +SGIX/dmbuffer.txt +SGIX/instruments.txt +SGIX/video_source.txt +SGIX/hyperpipe_group.txt +OES/OES_fixed_point.txt +OES/OES_query_matrix.txt diff --git a/Windows/glew/auto/core/gl/EGL_VERSION_1_0 b/Windows/glew/auto/core/gl/EGL_VERSION_1_0 new file mode 100644 index 00000000..07e0651b --- /dev/null +++ b/Windows/glew/auto/core/gl/EGL_VERSION_1_0 @@ -0,0 +1,86 @@ +EGL_VERSION_1_0 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf + + + EGL_NO_CONTEXT ((EGLContext)0) + EGL_NO_DISPLAY ((EGLDisplay)0) + EGL_NO_SURFACE ((EGLSurface)0) + EGL_DONT_CARE ((EGLint)-1) + EGL_FALSE 0 + EGL_PBUFFER_BIT 0x0001 + EGL_PIXMAP_BIT 0x0002 + EGL_WINDOW_BIT 0x0004 + EGL_SUCCESS 0x3000 + EGL_NOT_INITIALIZED 0x3001 + EGL_BAD_ACCESS 0x3002 + EGL_BAD_ALLOC 0x3003 + EGL_BAD_ATTRIBUTE 0x3004 + EGL_BAD_CONFIG 0x3005 + EGL_BAD_CONTEXT 0x3006 + EGL_BAD_CURRENT_SURFACE 0x3007 + EGL_BAD_DISPLAY 0x3008 + EGL_BAD_MATCH 0x3009 + EGL_BAD_NATIVE_PIXMAP 0x300A + EGL_BAD_NATIVE_WINDOW 0x300B + EGL_BAD_PARAMETER 0x300C + EGL_BAD_SURFACE 0x300D + EGL_BUFFER_SIZE 0x3020 + EGL_ALPHA_SIZE 0x3021 + EGL_BLUE_SIZE 0x3022 + EGL_GREEN_SIZE 0x3023 + EGL_RED_SIZE 0x3024 + EGL_DEPTH_SIZE 0x3025 + EGL_STENCIL_SIZE 0x3026 + EGL_CONFIG_CAVEAT 0x3027 + EGL_CONFIG_ID 0x3028 + EGL_LEVEL 0x3029 + EGL_MAX_PBUFFER_HEIGHT 0x302A + EGL_MAX_PBUFFER_PIXELS 0x302B + EGL_MAX_PBUFFER_WIDTH 0x302C + EGL_NATIVE_RENDERABLE 0x302D + EGL_NATIVE_VISUAL_ID 0x302E + EGL_NATIVE_VISUAL_TYPE 0x302F + EGL_SAMPLES 0x3031 + EGL_SAMPLE_BUFFERS 0x3032 + EGL_SURFACE_TYPE 0x3033 + EGL_TRANSPARENT_TYPE 0x3034 + EGL_TRANSPARENT_BLUE_VALUE 0x3035 + EGL_TRANSPARENT_GREEN_VALUE 0x3036 + EGL_TRANSPARENT_RED_VALUE 0x3037 + EGL_NONE 0x3038 + EGL_SLOW_CONFIG 0x3050 + EGL_NON_CONFORMANT_CONFIG 0x3051 + EGL_TRANSPARENT_RGB 0x3052 + EGL_VENDOR 0x3053 + EGL_VERSION 0x3054 + EGL_EXTENSIONS 0x3055 + EGL_HEIGHT 0x3056 + EGL_WIDTH 0x3057 + EGL_LARGEST_PBUFFER 0x3058 + EGL_DRAW 0x3059 + EGL_READ 0x305A + EGL_CORE_NATIVE_ENGINE 0x305B + EGL_TRUE 1 + EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config) + EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) + EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list) + EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list) + EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list) + EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list) + EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx) + EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface) + EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value) + EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config) + EGLDisplay eglGetCurrentDisplay ( void ) + EGLSurface eglGetCurrentSurface (EGLint readdraw) + EGLDisplay eglGetDisplay (EGLNativeDisplayType display_id) + EGLint eglGetError ( void ) + EGLBoolean eglInitialize (EGLDisplay dpy, EGLint * major, EGLint * minor) + EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) + EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value) + const char * eglQueryString (EGLDisplay dpy, EGLint name) + EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value) + EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface surface) + EGLBoolean eglTerminate (EGLDisplay dpy) + EGLBoolean eglWaitGL ( void ) + EGLBoolean eglWaitNative (EGLint engine) diff --git a/Windows/glew/auto/core/gl/EGL_VERSION_1_1 b/Windows/glew/auto/core/gl/EGL_VERSION_1_1 new file mode 100644 index 00000000..550dc24c --- /dev/null +++ b/Windows/glew/auto/core/gl/EGL_VERSION_1_1 @@ -0,0 +1,22 @@ +EGL_VERSION_1_1 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf + + + EGL_CONTEXT_LOST 0x300E + EGL_BIND_TO_TEXTURE_RGB 0x3039 + EGL_BIND_TO_TEXTURE_RGBA 0x303A + EGL_MIN_SWAP_INTERVAL 0x303B + EGL_MAX_SWAP_INTERVAL 0x303C + EGL_NO_TEXTURE 0x305C + EGL_TEXTURE_RGB 0x305D + EGL_TEXTURE_RGBA 0x305E + EGL_TEXTURE_2D 0x305F + EGL_TEXTURE_FORMAT 0x3080 + EGL_TEXTURE_TARGET 0x3081 + EGL_MIPMAP_TEXTURE 0x3082 + EGL_MIPMAP_LEVEL 0x3083 + EGL_BACK_BUFFER 0x3084 + EGLBoolean eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer) + EGLBoolean eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer) + EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) + EGLBoolean eglSwapInterval (EGLDisplay dpy, EGLint interval) diff --git a/Windows/glew/auto/core/gl/EGL_VERSION_1_2 b/Windows/glew/auto/core/gl/EGL_VERSION_1_2 new file mode 100644 index 00000000..613dd6b0 --- /dev/null +++ b/Windows/glew/auto/core/gl/EGL_VERSION_1_2 @@ -0,0 +1,38 @@ +EGL_VERSION_1_2 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf + + + EGL_UNKNOWN ((EGLint)-1) + EGL_OPENGL_ES_BIT 0x0001 + EGL_OPENVG_BIT 0x0002 + EGL_LUMINANCE_SIZE 0x303D + EGL_ALPHA_MASK_SIZE 0x303E + EGL_COLOR_BUFFER_TYPE 0x303F + EGL_RENDERABLE_TYPE 0x3040 + EGL_SINGLE_BUFFER 0x3085 + EGL_RENDER_BUFFER 0x3086 + EGL_COLORSPACE 0x3087 + EGL_ALPHA_FORMAT 0x3088 + EGL_COLORSPACE_sRGB 0x3089 + EGL_COLORSPACE_LINEAR 0x308A + EGL_ALPHA_FORMAT_NONPRE 0x308B + EGL_ALPHA_FORMAT_PRE 0x308C + EGL_CLIENT_APIS 0x308D + EGL_RGB_BUFFER 0x308E + EGL_LUMINANCE_BUFFER 0x308F + EGL_HORIZONTAL_RESOLUTION 0x3090 + EGL_VERTICAL_RESOLUTION 0x3091 + EGL_PIXEL_ASPECT_RATIO 0x3092 + EGL_SWAP_BEHAVIOR 0x3093 + EGL_BUFFER_PRESERVED 0x3094 + EGL_BUFFER_DESTROYED 0x3095 + EGL_OPENVG_IMAGE 0x3096 + EGL_CONTEXT_CLIENT_TYPE 0x3097 + EGL_OPENGL_ES_API 0x30A0 + EGL_OPENVG_API 0x30A1 + EGL_DISPLAY_SCALING 10000 + EGLBoolean eglBindAPI (EGLenum api) + EGLSurface eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list) + EGLenum eglQueryAPI ( void ) + EGLBoolean eglReleaseThread ( void ) + EGLBoolean eglWaitClient ( void ) diff --git a/Windows/glew/auto/core/gl/EGL_VERSION_1_3 b/Windows/glew/auto/core/gl/EGL_VERSION_1_3 new file mode 100644 index 00000000..de1d34d0 --- /dev/null +++ b/Windows/glew/auto/core/gl/EGL_VERSION_1_3 @@ -0,0 +1,16 @@ +EGL_VERSION_1_3 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf + + + EGL_OPENGL_ES2_BIT 0x0004 + EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 + EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 + EGL_MATCH_NATIVE_PIXMAP 0x3041 + EGL_CONFORMANT 0x3042 + EGL_VG_COLORSPACE 0x3087 + EGL_VG_ALPHA_FORMAT 0x3088 + EGL_VG_COLORSPACE_sRGB 0x3089 + EGL_VG_COLORSPACE_LINEAR 0x308A + EGL_VG_ALPHA_FORMAT_NONPRE 0x308B + EGL_VG_ALPHA_FORMAT_PRE 0x308C + EGL_CONTEXT_CLIENT_VERSION 0x3098 diff --git a/Windows/glew/auto/core/gl/EGL_VERSION_1_4 b/Windows/glew/auto/core/gl/EGL_VERSION_1_4 new file mode 100644 index 00000000..bbd9e5cb --- /dev/null +++ b/Windows/glew/auto/core/gl/EGL_VERSION_1_4 @@ -0,0 +1,13 @@ +EGL_VERSION_1_4 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf + + + EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) + EGL_OPENGL_BIT 0x0008 + EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 + EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 + EGL_MULTISAMPLE_RESOLVE 0x3099 + EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A + EGL_MULTISAMPLE_RESOLVE_BOX 0x309B + EGL_OPENGL_API 0x30A2 + EGLContext eglGetCurrentContext ( void ) diff --git a/Windows/glew/auto/core/gl/EGL_VERSION_1_5 b/Windows/glew/auto/core/gl/EGL_VERSION_1_5 new file mode 100644 index 00000000..ced7b03b --- /dev/null +++ b/Windows/glew/auto/core/gl/EGL_VERSION_1_5 @@ -0,0 +1,59 @@ +EGL_VERSION_1_5 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf + + + EGL_NO_IMAGE ((EGLImage)0) + EGL_NO_SYNC ((EGLSync)0) + EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 + EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 + EGL_OPENGL_ES3_BIT 0x00000040 + EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 + EGL_GL_COLORSPACE_SRGB 0x3089 + EGL_GL_COLORSPACE_LINEAR 0x308A + EGL_CONTEXT_MAJOR_VERSION 0x3098 + EGL_CL_EVENT_HANDLE 0x309C + EGL_GL_COLORSPACE 0x309D + EGL_GL_TEXTURE_2D 0x30B1 + EGL_GL_TEXTURE_3D 0x30B2 + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 + EGL_GL_RENDERBUFFER 0x30B9 + EGL_GL_TEXTURE_LEVEL 0x30BC + EGL_GL_TEXTURE_ZOFFSET 0x30BD + EGL_IMAGE_PRESERVED 0x30D2 + EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 + EGL_SYNC_STATUS 0x30F1 + EGL_SIGNALED 0x30F2 + EGL_UNSIGNALED 0x30F3 + EGL_TIMEOUT_EXPIRED 0x30F5 + EGL_CONDITION_SATISFIED 0x30F6 + EGL_SYNC_TYPE 0x30F7 + EGL_SYNC_CONDITION 0x30F8 + EGL_SYNC_FENCE 0x30F9 + EGL_CONTEXT_MINOR_VERSION 0x30FB + EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD + EGL_SYNC_CL_EVENT 0x30FE + EGL_SYNC_CL_EVENT_COMPLETE 0x30FF + EGL_CONTEXT_OPENGL_DEBUG 0x31B0 + EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 + EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 + EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 + EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD + EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD + EGL_NO_RESET_NOTIFICATION 0x31BE + EGL_LOSE_CONTEXT_ON_RESET 0x31BF + EGL_FOREVER 0xFFFFFFFFFFFFFFFF + EGLint eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout) + EGLImage eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list) + EGLSurface eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list) + EGLSurface eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list) + EGLSync eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list) + EGLBoolean eglDestroyImage (EGLDisplay dpy, EGLImage image) + EGLBoolean eglDestroySync (EGLDisplay dpy, EGLSync sync) + EGLDisplay eglGetPlatformDisplay (EGLenum platform, void * native_display, const EGLAttrib * attrib_list) + EGLBoolean eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value) + EGLBoolean eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags) diff --git a/Windows/glew/auto/core/gl/GLX_AMD_gpu_association b/Windows/glew/auto/core/gl/GLX_AMD_gpu_association new file mode 100644 index 00000000..72264a98 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_AMD_gpu_association @@ -0,0 +1,23 @@ +GLX_AMD_gpu_association +http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt +GLX_AMD_gpu_association + + GLX_GPU_VENDOR_AMD 0x1F00 + GLX_GPU_RENDERER_STRING_AMD 0x1F01 + GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 + GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 + GLX_GPU_RAM_AMD 0x21A3 + GLX_GPU_CLOCK_AMD 0x21A4 + GLX_GPU_NUM_PIPES_AMD 0x21A5 + GLX_GPU_NUM_SIMD_AMD 0x21A6 + GLX_GPU_NUM_RB_AMD 0x21A7 + GLX_GPU_NUM_SPI_AMD 0x21A8 + void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + GLXContext glXCreateAssociatedContextAMD (unsigned int id, GLXContext share_list) + GLXContext glXCreateAssociatedContextAttribsAMD (unsigned int id, GLXContext share_context, const int* attribList) + Bool glXDeleteAssociatedContextAMD (GLXContext ctx) + unsigned int glXGetContextGPUIDAMD (GLXContext ctx) + GLXContext glXGetCurrentAssociatedContextAMD (void) + unsigned int glXGetGPUIDsAMD (unsigned int maxCount, unsigned int* ids) + int glXGetGPUInfoAMD (unsigned int id, int property, GLenum dataType, unsigned int size, void* data) + Bool glXMakeAssociatedContextCurrentAMD (GLXContext ctx) diff --git a/Windows/glew/auto/core/gl/GLX_ARB_get_proc_address b/Windows/glew/auto/core/gl/GLX_ARB_get_proc_address new file mode 100644 index 00000000..e2cb2c50 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_ARB_get_proc_address @@ -0,0 +1,5 @@ +GLX_ARB_get_proc_address +http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt +GLX_ARB_get_proc_address + + extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); diff --git a/Windows/glew/auto/core/gl/GLX_ATI_pixel_format_float b/Windows/glew/auto/core/gl/GLX_ATI_pixel_format_float new file mode 100644 index 00000000..5336da41 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_ATI_pixel_format_float @@ -0,0 +1,5 @@ +GLX_ATI_pixel_format_float + +GLX_ATI_pixel_format_float + + GLX_RGBA_FLOAT_ATI_BIT 0x00000100 diff --git a/Windows/glew/auto/core/gl/GLX_ATI_render_texture b/Windows/glew/auto/core/gl/GLX_ATI_render_texture new file mode 100644 index 00000000..6b358140 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_ATI_render_texture @@ -0,0 +1,42 @@ +GLX_ATI_render_texture + +GLX_ATI_render_texture + + GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 + GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 + GLX_TEXTURE_FORMAT_ATI 0x9802 + GLX_TEXTURE_TARGET_ATI 0x9803 + GLX_MIPMAP_TEXTURE_ATI 0x9804 + GLX_TEXTURE_RGB_ATI 0x9805 + GLX_TEXTURE_RGBA_ATI 0x9806 + GLX_NO_TEXTURE_ATI 0x9807 + GLX_TEXTURE_CUBE_MAP_ATI 0x9808 + GLX_TEXTURE_1D_ATI 0x9809 + GLX_TEXTURE_2D_ATI 0x980A + GLX_MIPMAP_LEVEL_ATI 0x980B + GLX_CUBE_MAP_FACE_ATI 0x980C + GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D + GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E + GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 + GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 + GLX_FRONT_LEFT_ATI 0x9813 + GLX_FRONT_RIGHT_ATI 0x9814 + GLX_BACK_LEFT_ATI 0x9815 + GLX_BACK_RIGHT_ATI 0x9816 + GLX_AUX0_ATI 0x9817 + GLX_AUX1_ATI 0x9818 + GLX_AUX2_ATI 0x9819 + GLX_AUX3_ATI 0x981A + GLX_AUX4_ATI 0x981B + GLX_AUX5_ATI 0x981C + GLX_AUX6_ATI 0x981D + GLX_AUX7_ATI 0x981E + GLX_AUX8_ATI 0x981F + GLX_AUX9_ATI 0x9820 + GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 + GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + void glXBindTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXReleaseTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXDrawableAttribATI (Display *dpy, GLXDrawable draw, const int *attrib_list) diff --git a/Windows/glew/auto/core/gl/GLX_EXT_create_context_es2_profile b/Windows/glew/auto/core/gl/GLX_EXT_create_context_es2_profile new file mode 100644 index 00000000..aea21df7 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_EXT_create_context_es2_profile @@ -0,0 +1,5 @@ +GLX_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es2_profile.txt +GLX_EXT_create_context_es2_profile + + GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/core/gl/GLX_EXT_create_context_es_profile b/Windows/glew/auto/core/gl/GLX_EXT_create_context_es_profile new file mode 100644 index 00000000..ea13e6e7 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_EXT_create_context_es_profile @@ -0,0 +1,5 @@ +GLX_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es_profile.txt +GLX_EXT_create_context_es_profile + + GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/core/gl/GLX_EXT_fbconfig_packed_float b/Windows/glew/auto/core/gl/GLX_EXT_fbconfig_packed_float new file mode 100644 index 00000000..ffd47e30 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_EXT_fbconfig_packed_float @@ -0,0 +1,6 @@ +GLX_EXT_fbconfig_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GLX_EXT_fbconfig_packed_float + + GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 diff --git a/Windows/glew/auto/core/gl/GLX_EXT_framebuffer_sRGB b/Windows/glew/auto/core/gl/GLX_EXT_framebuffer_sRGB new file mode 100644 index 00000000..83743bb6 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_EXT_framebuffer_sRGB @@ -0,0 +1,5 @@ +GLX_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GLX_EXT_framebuffer_sRGB + + GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 diff --git a/Windows/glew/auto/core/gl/GLX_MESA_swap_control b/Windows/glew/auto/core/gl/GLX_MESA_swap_control new file mode 100644 index 00000000..eb6e933f --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_MESA_swap_control @@ -0,0 +1,6 @@ +GLX_MESA_swap_control +http://cgit.freedesktop.org/mesa/mesa/plain/docs/MESA_swap_control.spec +GLX_MESA_swap_control + + int glXGetSwapIntervalMESA (void) + int glXSwapIntervalMESA (unsigned int interval) diff --git a/Windows/glew/auto/core/gl/GLX_NV_float_buffer b/Windows/glew/auto/core/gl/GLX_NV_float_buffer new file mode 100644 index 00000000..19b71e2e --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_NV_float_buffer @@ -0,0 +1,5 @@ +GLX_NV_float_buffer +http://cvs1.nvidia.com/inc/GL/glxtokens.h +GLX_NV_float_buffer + + GLX_FLOAT_COMPONENTS_NV 0x20B0 diff --git a/Windows/glew/auto/core/gl/GLX_NV_vertex_array_range b/Windows/glew/auto/core/gl/GLX_NV_vertex_array_range new file mode 100644 index 00000000..9250ec25 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_NV_vertex_array_range @@ -0,0 +1,6 @@ +GLX_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +GLX_NV_vertex_array_range + + void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void glXFreeMemoryNV (void *pointer) diff --git a/Windows/glew/auto/core/gl/GLX_SGIS_shared_multisample b/Windows/glew/auto/core/gl/GLX_SGIS_shared_multisample new file mode 100644 index 00000000..a2f4e123 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_SGIS_shared_multisample @@ -0,0 +1,6 @@ +GLX_SGIS_shared_multisample + +GLX_SGIS_shared_multisample + + GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 + GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 diff --git a/Windows/glew/auto/core/gl/GLX_SGIX_hyperpipe b/Windows/glew/auto/core/gl/GLX_SGIX_hyperpipe new file mode 100644 index 00000000..80fd7d6b --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_SGIX_hyperpipe @@ -0,0 +1,26 @@ +GLX_SGIX_hyperpipe +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt +GLX_SGIX_hyperpipe + + GLX_HYPERPIPE_ID_SGIX 0x8030 + GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 + GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 + GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 + GLX_PIPE_RECT_SGIX 0x00000001 + GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 + GLX_HYPERPIPE_STEREO_SGIX 0x00000003 + GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 + GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 + GLX_BAD_HYPERPIPE_SGIX 92 + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; } GLXHyperpipeNetworkSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int channel; unsigned int participationType; int timeSlice; } GLXHyperpipeConfigSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int srcXOrigin; int srcYOrigin; int srcWidth; int srcHeight; int destXOrigin; int destYOrigin; int destWidth; int destHeight; } GLXPipeRect; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int XOrigin; int YOrigin; int maxHeight; int maxWidth; } GLXPipeRectLimits; + GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes) + int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId) + GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes) + int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId) + int glXBindHyperpipeSGIX (Display *dpy, int hpId) + int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList) + int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList) + int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList) diff --git a/Windows/glew/auto/core/gl/GLX_SGIX_swap_barrier b/Windows/glew/auto/core/gl/GLX_SGIX_swap_barrier new file mode 100644 index 00000000..95a65c17 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_SGIX_swap_barrier @@ -0,0 +1,6 @@ +GLX_SGIX_swap_barrier +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt +GLX_SGIX_swap_barrier + + void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier) + Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max) diff --git a/Windows/glew/auto/core/gl/GLX_SGIX_swap_group b/Windows/glew/auto/core/gl/GLX_SGIX_swap_group new file mode 100644 index 00000000..1eb1cff3 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_SGIX_swap_group @@ -0,0 +1,5 @@ +GLX_SGIX_swap_group +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt +GLX_SGIX_swap_group + + void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member) diff --git a/Windows/glew/auto/core/gl/GLX_SGI_video_sync b/Windows/glew/auto/core/gl/GLX_SGI_video_sync new file mode 100644 index 00000000..74f13561 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_SGI_video_sync @@ -0,0 +1,6 @@ +GLX_SGI_video_sync +http://www.opengl.org/registry/specs/SGI/video_sync.txt +GLX_SGI_video_sync + + int glXGetVideoSyncSGI (unsigned int* count) + int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int* count) diff --git a/Windows/glew/auto/core/gl/GLX_SUN_video_resize b/Windows/glew/auto/core/gl/GLX_SUN_video_resize new file mode 100644 index 00000000..3a5a1760 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_SUN_video_resize @@ -0,0 +1,8 @@ +GLX_SUN_video_resize +http://wwws.sun.com/software/graphics/opengl/extensions/glx_sun_video_resize.txt +GLX_SUN_video_resize + + GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + GLX_VIDEO_RESIZE_SUN 0x8171 + int glXVideoResizeSUN (Display* display, GLXDrawable window, float factor) + int glXGetVideoResizeSUN (Display* display, GLXDrawable window, float* factor) diff --git a/Windows/glew/auto/core/gl/GLX_VERSION_1_2 b/Windows/glew/auto/core/gl/GLX_VERSION_1_2 new file mode 100644 index 00000000..8a12e847 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_VERSION_1_2 @@ -0,0 +1,5 @@ +GLX_VERSION_1_2 +http://www.opengl.org/documentation/specs/glx/glx1.2.ps +GLX_VERSION_1_2 + + Display* glXGetCurrentDisplay (void) diff --git a/Windows/glew/auto/core/gl/GLX_VERSION_1_3 b/Windows/glew/auto/core/gl/GLX_VERSION_1_3 new file mode 100644 index 00000000..1cf24be8 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_VERSION_1_3 @@ -0,0 +1,83 @@ +GLX_VERSION_1_3 +http://www.opengl.org/documentation/specs/glx/glx1.3.pdf +GLX_VERSION_1_3 + + GLX_WINDOW_BIT 0x00000001 + GLX_PIXMAP_BIT 0x00000002 + GLX_PBUFFER_BIT 0x00000004 + GLX_RGBA_BIT 0x00000001 + GLX_COLOR_INDEX_BIT 0x00000002 + GLX_PBUFFER_CLOBBER_MASK 0x08000000 + GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 + GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 + GLX_BACK_LEFT_BUFFER_BIT 0x00000004 + GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 + GLX_AUX_BUFFERS_BIT 0x00000010 + GLX_DEPTH_BUFFER_BIT 0x00000020 + GLX_STENCIL_BUFFER_BIT 0x00000040 + GLX_ACCUM_BUFFER_BIT 0x00000080 + GLX_CONFIG_CAVEAT 0x20 + GLX_X_VISUAL_TYPE 0x22 + GLX_TRANSPARENT_TYPE 0x23 + GLX_TRANSPARENT_INDEX_VALUE 0x24 + GLX_TRANSPARENT_RED_VALUE 0x25 + GLX_TRANSPARENT_GREEN_VALUE 0x26 + GLX_TRANSPARENT_BLUE_VALUE 0x27 + GLX_TRANSPARENT_ALPHA_VALUE 0x28 + GLX_DONT_CARE 0xFFFFFFFF + GLX_NONE 0x8000 + GLX_SLOW_CONFIG 0x8001 + GLX_TRUE_COLOR 0x8002 + GLX_DIRECT_COLOR 0x8003 + GLX_PSEUDO_COLOR 0x8004 + GLX_STATIC_COLOR 0x8005 + GLX_GRAY_SCALE 0x8006 + GLX_STATIC_GRAY 0x8007 + GLX_TRANSPARENT_RGB 0x8008 + GLX_TRANSPARENT_INDEX 0x8009 + GLX_VISUAL_ID 0x800B + GLX_SCREEN 0x800C + GLX_NON_CONFORMANT_CONFIG 0x800D + GLX_DRAWABLE_TYPE 0x8010 + GLX_RENDER_TYPE 0x8011 + GLX_X_RENDERABLE 0x8012 + GLX_FBCONFIG_ID 0x8013 + GLX_RGBA_TYPE 0x8014 + GLX_COLOR_INDEX_TYPE 0x8015 + GLX_MAX_PBUFFER_WIDTH 0x8016 + GLX_MAX_PBUFFER_HEIGHT 0x8017 + GLX_MAX_PBUFFER_PIXELS 0x8018 + GLX_PRESERVED_CONTENTS 0x801B + GLX_LARGEST_PBUFFER 0x801C + GLX_WIDTH 0x801D + GLX_HEIGHT 0x801E + GLX_EVENT_MASK 0x801F + GLX_DAMAGED 0x8020 + GLX_SAVED 0x8021 + GLX_WINDOW 0x8022 + GLX_PBUFFER 0x8023 + GLX_PBUFFER_HEIGHT 0x8040 + GLX_PBUFFER_WIDTH 0x8041 + GLXFBConfig* glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements) + GLXFBConfig* glXGetFBConfigs (Display *dpy, int screen, int *nelements) + XVisualInfo* glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config) + int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value) + GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list) + void glXDestroyWindow (Display *dpy, GLXWindow win) + GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list) + void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap) + GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list) + void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf) + void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value) + GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) + Bool glXMakeContextCurrent (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx) + GLXDrawable glXGetCurrentReadDrawable (void) + int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value) + void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask) + void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask) + typedef XID GLXWindow + typedef XID GLXPbuffer + typedef XID GLXFBConfigID + typedef struct __GLXFBConfigRec *GLXFBConfig + typedef struct { int event_type; int draw_type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; unsigned int buffer_mask; unsigned int aux_buffer; int x, y; int width, height; int count; } GLXPbufferClobberEvent; + typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; long pad[24]; } GLXEvent; diff --git a/Windows/glew/auto/core/gl/GLX_VERSION_1_4 b/Windows/glew/auto/core/gl/GLX_VERSION_1_4 new file mode 100644 index 00000000..9b9de3e0 --- /dev/null +++ b/Windows/glew/auto/core/gl/GLX_VERSION_1_4 @@ -0,0 +1,7 @@ +GLX_VERSION_1_4 +http://www.opengl.org/documentation/specs/glx/glx1.4.pdf +GLX_VERSION_1_4 + + GLX_SAMPLE_BUFFERS 100000 + GLX_SAMPLES 100001 + extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); diff --git a/Windows/glew/auto/core/gl/GL_APPLE_float_pixels b/Windows/glew/auto/core/gl/GL_APPLE_float_pixels new file mode 100644 index 00000000..3eacd421 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_APPLE_float_pixels @@ -0,0 +1,18 @@ +GL_APPLE_float_pixels +http://www.opengl.org/registry/specs/APPLE/float_pixels.txt +GL_APPLE_float_pixels + + GL_HALF_APPLE 0x140B + GL_COLOR_FLOAT_APPLE 0x8A0F + GL_RGBA_FLOAT32_APPLE 0x8814 + GL_RGB_FLOAT32_APPLE 0x8815 + GL_ALPHA_FLOAT32_APPLE 0x8816 + GL_INTENSITY_FLOAT32_APPLE 0x8817 + GL_LUMINANCE_FLOAT32_APPLE 0x8818 + GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 + GL_RGBA_FLOAT16_APPLE 0x881A + GL_RGB_FLOAT16_APPLE 0x881B + GL_ALPHA_FLOAT16_APPLE 0x881C + GL_INTENSITY_FLOAT16_APPLE 0x881D + GL_LUMINANCE_FLOAT16_APPLE 0x881E + GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F diff --git a/Windows/glew/auto/core/gl/GL_APPLE_pixel_buffer b/Windows/glew/auto/core/gl/GL_APPLE_pixel_buffer new file mode 100644 index 00000000..1a8ad970 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_APPLE_pixel_buffer @@ -0,0 +1,5 @@ +GL_APPLE_pixel_buffer + +GL_APPLE_pixel_buffer + + GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 diff --git a/Windows/glew/auto/core/gl/GL_APPLE_texture_range b/Windows/glew/auto/core/gl/GL_APPLE_texture_range new file mode 100644 index 00000000..e2bf85c3 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_APPLE_texture_range @@ -0,0 +1,13 @@ +GL_APPLE_texture_range +http://www.opengl.org/registry/specs/APPLE/texture_range.txt +GL_APPLE_texture_range + + GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC + GL_STORAGE_PRIVATE_APPLE 0x85BD + GL_STORAGE_CACHED_APPLE 0x85BE + GL_STORAGE_SHARED_APPLE 0x85BF + GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 + GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 + void glTextureRangeAPPLE (GLenum target, GLsizei length, void *pointer) + void glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params) + diff --git a/Windows/glew/auto/core/gl/GL_ARB_draw_instanced b/Windows/glew/auto/core/gl/GL_ARB_draw_instanced new file mode 100644 index 00000000..a730952d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_draw_instanced @@ -0,0 +1,4 @@ +GL_ARB_draw_instanced +http://www.opengl.org/registry/specs/ARB/draw_instanced.txt +GL_ARB_draw_instanced + diff --git a/Windows/glew/auto/core/gl/GL_ARB_imaging b/Windows/glew/auto/core/gl/GL_ARB_imaging new file mode 100644 index 00000000..727adf05 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_imaging @@ -0,0 +1,113 @@ +GL_ARB_imaging + +GL_ARB_imaging + + GL_CONSTANT_COLOR 0x8001 + GL_ONE_MINUS_CONSTANT_COLOR 0x8002 + GL_CONSTANT_ALPHA 0x8003 + GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 + GL_BLEND_COLOR 0x8005 + GL_FUNC_ADD 0x8006 + GL_MIN 0x8007 + GL_MAX 0x8008 + GL_BLEND_EQUATION 0x8009 + GL_FUNC_SUBTRACT 0x800A + GL_FUNC_REVERSE_SUBTRACT 0x800B + GL_CONVOLUTION_1D 0x8010 + GL_CONVOLUTION_2D 0x8011 + GL_SEPARABLE_2D 0x8012 + GL_CONVOLUTION_BORDER_MODE 0x8013 + GL_CONVOLUTION_FILTER_SCALE 0x8014 + GL_CONVOLUTION_FILTER_BIAS 0x8015 + GL_REDUCE 0x8016 + GL_CONVOLUTION_FORMAT 0x8017 + GL_CONVOLUTION_WIDTH 0x8018 + GL_CONVOLUTION_HEIGHT 0x8019 + GL_MAX_CONVOLUTION_WIDTH 0x801A + GL_MAX_CONVOLUTION_HEIGHT 0x801B + GL_POST_CONVOLUTION_RED_SCALE 0x801C + GL_POST_CONVOLUTION_GREEN_SCALE 0x801D + GL_POST_CONVOLUTION_BLUE_SCALE 0x801E + GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F + GL_POST_CONVOLUTION_RED_BIAS 0x8020 + GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 + GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 + GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 + GL_HISTOGRAM 0x8024 + GL_PROXY_HISTOGRAM 0x8025 + GL_HISTOGRAM_WIDTH 0x8026 + GL_HISTOGRAM_FORMAT 0x8027 + GL_HISTOGRAM_RED_SIZE 0x8028 + GL_HISTOGRAM_GREEN_SIZE 0x8029 + GL_HISTOGRAM_BLUE_SIZE 0x802A + GL_HISTOGRAM_ALPHA_SIZE 0x802B + GL_HISTOGRAM_LUMINANCE_SIZE 0x802C + GL_HISTOGRAM_SINK 0x802D + GL_MINMAX 0x802E + GL_MINMAX_FORMAT 0x802F + GL_MINMAX_SINK 0x8030 + GL_TABLE_TOO_LARGE 0x8031 + GL_COLOR_MATRIX 0x80B1 + GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 + GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 + GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB + GL_COLOR_TABLE 0x80D0 + GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 + GL_PROXY_COLOR_TABLE 0x80D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 + GL_COLOR_TABLE_SCALE 0x80D6 + GL_COLOR_TABLE_BIAS 0x80D7 + GL_COLOR_TABLE_FORMAT 0x80D8 + GL_COLOR_TABLE_WIDTH 0x80D9 + GL_COLOR_TABLE_RED_SIZE 0x80DA + GL_COLOR_TABLE_GREEN_SIZE 0x80DB + GL_COLOR_TABLE_BLUE_SIZE 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF + GL_IGNORE_BORDER 0x8150 + GL_CONSTANT_BORDER 0x8151 + GL_WRAP_BORDER 0x8152 + GL_REPLICATE_BORDER 0x8153 + GL_CONVOLUTION_BORDER_COLOR 0x8154 + void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table) + void glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data) + void glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params) + void glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) + void glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glGetColorTable (GLenum target, GLenum format, GLenum type, void *table) + void glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params) + void glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) + void glResetHistogram (GLenum target) + void glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values) + void glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params) + void glMinmax (GLenum target, GLenum internalformat, GLboolean sink) + void glResetMinmax (GLenum target) + void glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params) + void glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image) + void glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image) + void glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params) + void glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glConvolutionParameteri (GLenum target, GLenum pname, GLint params) + void glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params) + void glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) + void glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image) + void glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params) + void glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column) + void glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span) + void glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values) diff --git a/Windows/glew/auto/core/gl/GL_ARB_instanced_arrays b/Windows/glew/auto/core/gl/GL_ARB_instanced_arrays new file mode 100644 index 00000000..1487d39a --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_instanced_arrays @@ -0,0 +1,8 @@ +GL_ARB_instanced_arrays +http://www.opengl.org/registry/specs/ARB/instanced_arrays.txt +GL_ARB_instanced_arrays + + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + void glVertexAttribDivisorARB (GLuint index, GLuint divisor) + void glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount) diff --git a/Windows/glew/auto/core/gl/GL_ARB_internalformat_query2 b/Windows/glew/auto/core/gl/GL_ARB_internalformat_query2 new file mode 100644 index 00000000..7af5091e --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_internalformat_query2 @@ -0,0 +1,104 @@ +GL_ARB_internalformat_query2 +http://www.opengl.org/registry/specs/ARB/internalformat_query2.txt +GL_ARB_internalformat_query2 + + GL_INTERNALFORMAT_SUPPORTED 0x826F + GL_INTERNALFORMAT_PREFERRED 0x8270 + GL_INTERNALFORMAT_RED_SIZE 0x8271 + GL_INTERNALFORMAT_GREEN_SIZE 0x8272 + GL_INTERNALFORMAT_BLUE_SIZE 0x8273 + GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 + GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 + GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 + GL_INTERNALFORMAT_SHARED_SIZE 0x8277 + GL_INTERNALFORMAT_RED_TYPE 0x8278 + GL_INTERNALFORMAT_GREEN_TYPE 0x8279 + GL_INTERNALFORMAT_BLUE_TYPE 0x827A + GL_INTERNALFORMAT_ALPHA_TYPE 0x827B + GL_INTERNALFORMAT_DEPTH_TYPE 0x827C + GL_INTERNALFORMAT_STENCIL_TYPE 0x827D + GL_MAX_WIDTH 0x827E + GL_MAX_HEIGHT 0x827F + GL_MAX_DEPTH 0x8280 + GL_MAX_LAYERS 0x8281 + GL_MAX_COMBINED_DIMENSIONS 0x8282 + GL_COLOR_COMPONENTS 0x8283 + GL_DEPTH_COMPONENTS 0x8284 + GL_STENCIL_COMPONENTS 0x8285 + GL_COLOR_RENDERABLE 0x8286 + GL_DEPTH_RENDERABLE 0x8287 + GL_STENCIL_RENDERABLE 0x8288 + GL_FRAMEBUFFER_RENDERABLE 0x8289 + GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A + GL_FRAMEBUFFER_BLEND 0x828B + GL_READ_PIXELS 0x828C + GL_READ_PIXELS_FORMAT 0x828D + GL_READ_PIXELS_TYPE 0x828E + GL_TEXTURE_IMAGE_FORMAT 0x828F + GL_TEXTURE_IMAGE_TYPE 0x8290 + GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 + GL_GET_TEXTURE_IMAGE_TYPE 0x8292 + GL_MIPMAP 0x8293 + GL_MANUAL_GENERATE_MIPMAP 0x8294 + GL_AUTO_GENERATE_MIPMAP 0x8295 + GL_COLOR_ENCODING 0x8296 + GL_SRGB_READ 0x8297 + GL_SRGB_WRITE 0x8298 + GL_SRGB_DECODE_ARB 0x8299 + GL_FILTER 0x829A + GL_VERTEX_TEXTURE 0x829B + GL_TESS_CONTROL_TEXTURE 0x829C + GL_TESS_EVALUATION_TEXTURE 0x829D + GL_GEOMETRY_TEXTURE 0x829E + GL_FRAGMENT_TEXTURE 0x829F + GL_COMPUTE_TEXTURE 0x82A0 + GL_TEXTURE_SHADOW 0x82A1 + GL_TEXTURE_GATHER 0x82A2 + GL_TEXTURE_GATHER_SHADOW 0x82A3 + GL_SHADER_IMAGE_LOAD 0x82A4 + GL_SHADER_IMAGE_STORE 0x82A5 + GL_SHADER_IMAGE_ATOMIC 0x82A6 + GL_IMAGE_TEXEL_SIZE 0x82A7 + GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 + GL_IMAGE_PIXEL_FORMAT 0x82A9 + GL_IMAGE_PIXEL_TYPE 0x82AA + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 + GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 + GL_CLEAR_BUFFER 0x82B4 + GL_TEXTURE_VIEW 0x82B5 + GL_VIEW_COMPATIBILITY_CLASS 0x82B6 + GL_FULL_SUPPORT 0x82B7 + GL_CAVEAT_SUPPORT 0x82B8 + GL_IMAGE_CLASS_4_X_32 0x82B9 + GL_IMAGE_CLASS_2_X_32 0x82BA + GL_IMAGE_CLASS_1_X_32 0x82BB + GL_IMAGE_CLASS_4_X_16 0x82BC + GL_IMAGE_CLASS_2_X_16 0x82BD + GL_IMAGE_CLASS_1_X_16 0x82BE + GL_IMAGE_CLASS_4_X_8 0x82BF + GL_IMAGE_CLASS_2_X_8 0x82C0 + GL_IMAGE_CLASS_1_X_8 0x82C1 + GL_IMAGE_CLASS_11_11_10 0x82C2 + GL_IMAGE_CLASS_10_10_10_2 0x82C3 + GL_VIEW_CLASS_128_BITS 0x82C4 + GL_VIEW_CLASS_96_BITS 0x82C5 + GL_VIEW_CLASS_64_BITS 0x82C6 + GL_VIEW_CLASS_48_BITS 0x82C7 + GL_VIEW_CLASS_32_BITS 0x82C8 + GL_VIEW_CLASS_24_BITS 0x82C9 + GL_VIEW_CLASS_16_BITS 0x82CA + GL_VIEW_CLASS_8_BITS 0x82CB + GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC + GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD + GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE + GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF + GL_VIEW_CLASS_RGTC1_RED 0x82D0 + GL_VIEW_CLASS_RGTC2_RG 0x82D1 + GL_VIEW_CLASS_BPTC_UNORM 0x82D2 + GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + void glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params) diff --git a/Windows/glew/auto/core/gl/GL_ARB_matrix_palette b/Windows/glew/auto/core/gl/GL_ARB_matrix_palette new file mode 100644 index 00000000..98b0d0b9 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_matrix_palette @@ -0,0 +1,19 @@ +GL_ARB_matrix_palette +http://oss.sgi.com/projects/ogl-sample/registry/ARB/matrix_palette.txt +GL_ARB_matrix_palette + + GL_MATRIX_PALETTE_ARB 0x8840 + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 + GL_MAX_PALETTE_MATRICES_ARB 0x8842 + GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 + GL_MATRIX_INDEX_ARRAY_ARB 0x8844 + GL_CURRENT_MATRIX_INDEX_ARB 0x8845 + GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 + GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 + GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + void glCurrentPaletteMatrixARB (GLint index) + void glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, void *pointer) + void glMatrixIndexubvARB (GLint size, GLubyte *indices) + void glMatrixIndexusvARB (GLint size, GLushort *indices) + void glMatrixIndexuivARB (GLint size, GLuint *indices) diff --git a/Windows/glew/auto/core/gl/GL_ARB_multitexture b/Windows/glew/auto/core/gl/GL_ARB_multitexture new file mode 100644 index 00000000..46a95463 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_multitexture @@ -0,0 +1,73 @@ +GL_ARB_multitexture +http://oss.sgi.com/projects/ogl-sample/registry/ARB/multitexture.txt +GL_ARB_multitexture + + GL_TEXTURE0_ARB 0x84C0 + GL_TEXTURE1_ARB 0x84C1 + GL_TEXTURE2_ARB 0x84C2 + GL_TEXTURE3_ARB 0x84C3 + GL_TEXTURE4_ARB 0x84C4 + GL_TEXTURE5_ARB 0x84C5 + GL_TEXTURE6_ARB 0x84C6 + GL_TEXTURE7_ARB 0x84C7 + GL_TEXTURE8_ARB 0x84C8 + GL_TEXTURE9_ARB 0x84C9 + GL_TEXTURE10_ARB 0x84CA + GL_TEXTURE11_ARB 0x84CB + GL_TEXTURE12_ARB 0x84CC + GL_TEXTURE13_ARB 0x84CD + GL_TEXTURE14_ARB 0x84CE + GL_TEXTURE15_ARB 0x84CF + GL_TEXTURE16_ARB 0x84D0 + GL_TEXTURE17_ARB 0x84D1 + GL_TEXTURE18_ARB 0x84D2 + GL_TEXTURE19_ARB 0x84D3 + GL_TEXTURE20_ARB 0x84D4 + GL_TEXTURE21_ARB 0x84D5 + GL_TEXTURE22_ARB 0x84D6 + GL_TEXTURE23_ARB 0x84D7 + GL_TEXTURE24_ARB 0x84D8 + GL_TEXTURE25_ARB 0x84D9 + GL_TEXTURE26_ARB 0x84DA + GL_TEXTURE27_ARB 0x84DB + GL_TEXTURE28_ARB 0x84DC + GL_TEXTURE29_ARB 0x84DD + GL_TEXTURE30_ARB 0x84DE + GL_TEXTURE31_ARB 0x84DF + GL_ACTIVE_TEXTURE_ARB 0x84E0 + GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 + GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + void glActiveTextureARB (GLenum texture) + void glClientActiveTextureARB (GLenum texture) + void glMultiTexCoord1dARB (GLenum target, GLdouble s) + void glMultiTexCoord1dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord1fARB (GLenum target, GLfloat s) + void glMultiTexCoord1fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord1iARB (GLenum target, GLint s) + void glMultiTexCoord1ivARB (GLenum target, const GLint *v) + void glMultiTexCoord1sARB (GLenum target, GLshort s) + void glMultiTexCoord1svARB (GLenum target, const GLshort *v) + void glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t) + void glMultiTexCoord2dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t) + void glMultiTexCoord2fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord2iARB (GLenum target, GLint s, GLint t) + void glMultiTexCoord2ivARB (GLenum target, const GLint *v) + void glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t) + void glMultiTexCoord2svARB (GLenum target, const GLshort *v) + void glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r) + void glMultiTexCoord3dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r) + void glMultiTexCoord3fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r) + void glMultiTexCoord3ivARB (GLenum target, const GLint *v) + void glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r) + void glMultiTexCoord3svARB (GLenum target, const GLshort *v) + void glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) + void glMultiTexCoord4dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) + void glMultiTexCoord4fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q) + void glMultiTexCoord4ivARB (GLenum target, const GLint *v) + void glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) + void glMultiTexCoord4svARB (GLenum target, const GLshort *v) diff --git a/Windows/glew/auto/core/gl/GL_ARB_robustness b/Windows/glew/auto/core/gl/GL_ARB_robustness new file mode 100644 index 00000000..82d48d8d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_robustness @@ -0,0 +1,31 @@ +GL_ARB_robustness +http://www.opengl.org/registry/specs/ARB/robustness.txt +GL_ARB_robustness + + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 + GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + GL_GUILTY_CONTEXT_RESET_ARB 0x8253 + GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 + GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 + GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + GL_NO_RESET_NOTIFICATION_ARB 0x8261 + GLenum glGetGraphicsResetStatusARB (void) + void glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table) + void glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void* img) + void glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image) + void glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v) + void glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v) + void glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint* v) + void glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat* values) + void glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint* values) + void glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort* values) + void glGetnPolygonStippleARB (GLsizei bufSize, GLubyte* pattern) + void glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span) + void glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img) + void glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble* params) + void glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat* params) + void glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint* params) + void glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint* params) + void glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data) diff --git a/Windows/glew/auto/core/gl/GL_ARB_separate_shader_objects b/Windows/glew/auto/core/gl/GL_ARB_separate_shader_objects new file mode 100644 index 00000000..3d3d8696 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_separate_shader_objects @@ -0,0 +1,73 @@ +GL_ARB_separate_shader_objects +http://www.opengl.org/registry/specs/ARB/separate_shader_objects.txt +GL_ARB_separate_shader_objects + + GL_VERTEX_SHADER_BIT 0x00000001 + GL_FRAGMENT_SHADER_BIT 0x00000002 + GL_GEOMETRY_SHADER_BIT 0x00000004 + GL_TESS_CONTROL_SHADER_BIT 0x00000008 + GL_TESS_EVALUATION_SHADER_BIT 0x00000010 + GL_PROGRAM_SEPARABLE 0x8258 + GL_ACTIVE_PROGRAM 0x8259 + GL_PROGRAM_PIPELINE_BINDING 0x825A + GL_ALL_SHADER_BITS 0xFFFFFFFF + void glActiveShaderProgram (GLuint pipeline, GLuint program) + void glBindProgramPipeline (GLuint pipeline) + GLuint glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar * const * strings) + void glDeleteProgramPipelines (GLsizei n, const GLuint* pipelines) + void glGenProgramPipelines (GLsizei n, GLuint* pipelines) + void glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog) + void glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint* params) + GLboolean glIsProgramPipeline (GLuint pipeline) + void glProgramUniform1d (GLuint program, GLint location, GLdouble x) + void glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform1f (GLuint program, GLint location, GLfloat x) + void glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform1i (GLuint program, GLint location, GLint x) + void glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform1ui (GLuint program, GLint location, GLuint x) + void glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform2d (GLuint program, GLint location, GLdouble x, GLdouble y) + void glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform2f (GLuint program, GLint location, GLfloat x, GLfloat y) + void glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform2i (GLuint program, GLint location, GLint x, GLint y) + void glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform2ui (GLuint program, GLint location, GLuint x, GLuint y) + void glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform3d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) + void glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform3f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) + void glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform3i (GLuint program, GLint location, GLint x, GLint y, GLint z) + void glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform3ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z) + void glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform4d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform4f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform4i (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) + void glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform4ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program) + void glValidateProgramPipeline (GLuint pipeline) diff --git a/Windows/glew/auto/core/gl/GL_ARB_vertex_attrib_64bit b/Windows/glew/auto/core/gl/GL_ARB_vertex_attrib_64bit new file mode 100644 index 00000000..68117c5e --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_vertex_attrib_64bit @@ -0,0 +1,14 @@ +GL_ARB_vertex_attrib_64bit +http://www.opengl.org/registry/specs/ARB/vertex_attrib_64bit.txt +GL_ARB_vertex_attrib_64bit + + void glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble* params) + void glVertexAttribL1d (GLuint index, GLdouble x) + void glVertexAttribL1dv (GLuint index, const GLdouble* v) + void glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y) + void glVertexAttribL2dv (GLuint index, const GLdouble* v) + void glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttribL3dv (GLuint index, const GLdouble* v) + void glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttribL4dv (GLuint index, const GLdouble* v) + void glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer) diff --git a/Windows/glew/auto/core/gl/GL_ARB_vertex_blend b/Windows/glew/auto/core/gl/GL_ARB_vertex_blend new file mode 100644 index 00000000..f4b3f58d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ARB_vertex_blend @@ -0,0 +1,56 @@ +GL_ARB_vertex_blend +http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_blend.txt +GL_ARB_vertex_blend + + GL_MAX_VERTEX_UNITS_ARB 0x86A4 + GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 + GL_WEIGHT_SUM_UNITY_ARB 0x86A6 + GL_VERTEX_BLEND_ARB 0x86A7 + GL_CURRENT_WEIGHT_ARB 0x86A8 + GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 + GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA + GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB + GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC + GL_WEIGHT_ARRAY_ARB 0x86AD + GL_MODELVIEW0_ARB 0x1700 + GL_MODELVIEW1_ARB 0x850A + GL_MODELVIEW2_ARB 0x8722 + GL_MODELVIEW3_ARB 0x8723 + GL_MODELVIEW4_ARB 0x8724 + GL_MODELVIEW5_ARB 0x8725 + GL_MODELVIEW6_ARB 0x8726 + GL_MODELVIEW7_ARB 0x8727 + GL_MODELVIEW8_ARB 0x8728 + GL_MODELVIEW9_ARB 0x8729 + GL_MODELVIEW10_ARB 0x872A + GL_MODELVIEW11_ARB 0x872B + GL_MODELVIEW12_ARB 0x872C + GL_MODELVIEW13_ARB 0x872D + GL_MODELVIEW14_ARB 0x872E + GL_MODELVIEW15_ARB 0x872F + GL_MODELVIEW16_ARB 0x8730 + GL_MODELVIEW17_ARB 0x8731 + GL_MODELVIEW18_ARB 0x8732 + GL_MODELVIEW19_ARB 0x8733 + GL_MODELVIEW20_ARB 0x8734 + GL_MODELVIEW21_ARB 0x8735 + GL_MODELVIEW22_ARB 0x8736 + GL_MODELVIEW23_ARB 0x8737 + GL_MODELVIEW24_ARB 0x8738 + GL_MODELVIEW25_ARB 0x8739 + GL_MODELVIEW26_ARB 0x873A + GL_MODELVIEW27_ARB 0x873B + GL_MODELVIEW28_ARB 0x873C + GL_MODELVIEW29_ARB 0x873D + GL_MODELVIEW30_ARB 0x873E + GL_MODELVIEW31_ARB 0x873F + void glWeightbvARB (GLint size, GLbyte *weights) + void glWeightsvARB (GLint size, GLshort *weights) + void glWeightivARB (GLint size, GLint *weights) + void glWeightfvARB (GLint size, GLfloat *weights) + void glWeightdvARB (GLint size, GLdouble *weights) + void glWeightubvARB (GLint size, GLubyte *weights) + void glWeightusvARB (GLint size, GLushort *weights) + void glWeightuivARB (GLint size, GLuint *weights) + void glWeightPointerARB (GLint size, GLenum type, GLsizei stride, void *pointer) + void glVertexBlendARB (GLint count) diff --git a/Windows/glew/auto/core/gl/GL_ATIX_point_sprites b/Windows/glew/auto/core/gl/GL_ATIX_point_sprites new file mode 100644 index 00000000..d2434e7d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATIX_point_sprites @@ -0,0 +1,10 @@ +GL_ATIX_point_sprites +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_point_sprites + + GL_TEXTURE_POINT_MODE_ATIX 0x60B0 + GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 + GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 + GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 + GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 + GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 diff --git a/Windows/glew/auto/core/gl/GL_ATIX_texture_env_combine3 b/Windows/glew/auto/core/gl/GL_ATIX_texture_env_combine3 new file mode 100644 index 00000000..77f425d3 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATIX_texture_env_combine3 @@ -0,0 +1,7 @@ +GL_ATIX_texture_env_combine3 +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_texture_env_combine3 + + GL_MODULATE_ADD_ATIX 0x8744 + GL_MODULATE_SIGNED_ADD_ATIX 0x8745 + GL_MODULATE_SUBTRACT_ATIX 0x8746 diff --git a/Windows/glew/auto/core/gl/GL_ATIX_texture_env_route b/Windows/glew/auto/core/gl/GL_ATIX_texture_env_route new file mode 100644 index 00000000..d972fd19 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATIX_texture_env_route @@ -0,0 +1,7 @@ +GL_ATIX_texture_env_route +http://www.ati.com/developer/sdk/RadeonSDK/Html/Info/ATIX_texture_env_route.txt +GL_ATIX_texture_env_route + + GL_SECONDARY_COLOR_ATIX 0x8747 + GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 + GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 diff --git a/Windows/glew/auto/core/gl/GL_ATIX_vertex_shader_output_point_size b/Windows/glew/auto/core/gl/GL_ATIX_vertex_shader_output_point_size new file mode 100644 index 00000000..85a6d581 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATIX_vertex_shader_output_point_size @@ -0,0 +1,5 @@ +GL_ATIX_vertex_shader_output_point_size +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_vertex_shader_output_point_size + + GL_OUTPUT_POINT_SIZE_ATIX 0x610E diff --git a/Windows/glew/auto/core/gl/GL_ATI_envmap_bumpmap b/Windows/glew/auto/core/gl/GL_ATI_envmap_bumpmap new file mode 100644 index 00000000..09a41125 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_envmap_bumpmap @@ -0,0 +1,16 @@ +GL_ATI_envmap_bumpmap +http://oss.sgi.com/projects/ogl-sample/registry/ATI/envmap_bumpmap.txt +GL_ATI_envmap_bumpmap + + GL_BUMP_ROT_MATRIX_ATI 0x8775 + GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 + GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 + GL_BUMP_TEX_UNITS_ATI 0x8778 + GL_DUDV_ATI 0x8779 + GL_DU8DV8_ATI 0x877A + GL_BUMP_ENVMAP_ATI 0x877B + GL_BUMP_TARGET_ATI 0x877C + void glTexBumpParameterivATI (GLenum pname, GLint *param) + void glTexBumpParameterfvATI (GLenum pname, GLfloat *param) + void glGetTexBumpParameterivATI (GLenum pname, GLint *param) + void glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param) diff --git a/Windows/glew/auto/core/gl/GL_ATI_map_object_buffer b/Windows/glew/auto/core/gl/GL_ATI_map_object_buffer new file mode 100644 index 00000000..6a683d09 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_map_object_buffer @@ -0,0 +1,6 @@ +GL_ATI_map_object_buffer +http://www.opengl.org/registry/specs/ATI/map_object_buffer.txt +GL_ATI_map_object_buffer + + void * glMapObjectBufferATI (GLuint buffer) + void glUnmapObjectBufferATI (GLuint buffer) diff --git a/Windows/glew/auto/core/gl/GL_ATI_pn_triangles b/Windows/glew/auto/core/gl/GL_ATI_pn_triangles new file mode 100644 index 00000000..ca3923d1 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_pn_triangles @@ -0,0 +1,15 @@ +GL_ATI_pn_triangles +http://www.opengl.org/registry/specs/ATI/pn_triangles.txt +GL_ATI_pn_triangles + + GL_PN_TRIANGLES_ATI 0x87F0 + GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 + GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 + GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 + GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 + GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 + GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 + GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 + GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + void glPNTrianglesiATI (GLenum pname, GLint param) + void glPNTrianglesfATI (GLenum pname, GLfloat param) diff --git a/Windows/glew/auto/core/gl/GL_ATI_separate_stencil b/Windows/glew/auto/core/gl/GL_ATI_separate_stencil new file mode 100644 index 00000000..b7237e5c --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_separate_stencil @@ -0,0 +1,10 @@ +GL_ATI_separate_stencil +http://www.opengl.org/registry/specs/ATI/separate_stencil.txt +GL_ATI_separate_stencil + + GL_STENCIL_BACK_FUNC_ATI 0x8800 + GL_STENCIL_BACK_FAIL_ATI 0x8801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 + GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + void glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + void glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) diff --git a/Windows/glew/auto/core/gl/GL_ATI_shader_texture_lod b/Windows/glew/auto/core/gl/GL_ATI_shader_texture_lod new file mode 100644 index 00000000..e6e6c043 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_shader_texture_lod @@ -0,0 +1,4 @@ +GL_ATI_shader_texture_lod + +GL_ATI_shader_texture_lod + diff --git a/Windows/glew/auto/core/gl/GL_ATI_texture_compression_3dc b/Windows/glew/auto/core/gl/GL_ATI_texture_compression_3dc new file mode 100644 index 00000000..fc3ee441 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_texture_compression_3dc @@ -0,0 +1,5 @@ +GL_ATI_texture_compression_3dc + +GL_ATI_texture_compression_3dc + + GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 diff --git a/Windows/glew/auto/core/gl/GL_ATI_vertex_streams b/Windows/glew/auto/core/gl/GL_ATI_vertex_streams new file mode 100644 index 00000000..f6e64fd6 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_ATI_vertex_streams @@ -0,0 +1,59 @@ +GL_ATI_vertex_streams +http://www.opengl.org/registry/specs/ATI/vertex_streams.txt +GL_ATI_vertex_streams + + GL_MAX_VERTEX_STREAMS_ATI 0x876B + GL_VERTEX_SOURCE_ATI 0x876C + GL_VERTEX_STREAM0_ATI 0x876D + GL_VERTEX_STREAM1_ATI 0x876E + GL_VERTEX_STREAM2_ATI 0x876F + GL_VERTEX_STREAM3_ATI 0x8770 + GL_VERTEX_STREAM4_ATI 0x8771 + GL_VERTEX_STREAM5_ATI 0x8772 + GL_VERTEX_STREAM6_ATI 0x8773 + GL_VERTEX_STREAM7_ATI 0x8774 + void glClientActiveVertexStreamATI (GLenum stream) + void glVertexBlendEnviATI (GLenum pname, GLint param) + void glVertexBlendEnvfATI (GLenum pname, GLfloat param) + void glVertexStream1sATI (GLenum stream, GLshort x) + void glVertexStream1svATI (GLenum stream, const GLshort *coords) + void glVertexStream1iATI (GLenum stream, GLint x) + void glVertexStream1ivATI (GLenum stream, const GLint *coords) + void glVertexStream1fATI (GLenum stream, GLfloat x) + void glVertexStream1fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream1dATI (GLenum stream, GLdouble x) + void glVertexStream1dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream2sATI (GLenum stream, GLshort x, GLshort y) + void glVertexStream2svATI (GLenum stream, const GLshort *coords) + void glVertexStream2iATI (GLenum stream, GLint x, GLint y) + void glVertexStream2ivATI (GLenum stream, const GLint *coords) + void glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y) + void glVertexStream2fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y) + void glVertexStream2dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glVertexStream3svATI (GLenum stream, const GLshort *coords) + void glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glVertexStream3ivATI (GLenum stream, const GLint *coords) + void glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glVertexStream3fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glVertexStream3dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexStream4svATI (GLenum stream, const GLshort *coords) + void glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w) + void glVertexStream4ivATI (GLenum stream, const GLint *coords) + void glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexStream4fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexStream4dvATI (GLenum stream, const GLdouble *coords) + void glNormalStream3bATI (GLenum stream, GLbyte x, GLbyte y, GLbyte z) + void glNormalStream3bvATI (GLenum stream, const GLbyte *coords) + void glNormalStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glNormalStream3svATI (GLenum stream, const GLshort *coords) + void glNormalStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glNormalStream3ivATI (GLenum stream, const GLint *coords) + void glNormalStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glNormalStream3fvATI (GLenum stream, const GLfloat *coords) + void glNormalStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glNormalStream3dvATI (GLenum stream, const GLdouble *coords) diff --git a/Windows/glew/auto/core/gl/GL_EXT_Cg_shader b/Windows/glew/auto/core/gl/GL_EXT_Cg_shader new file mode 100644 index 00000000..b2df900f --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_Cg_shader @@ -0,0 +1,6 @@ +GL_EXT_Cg_shader +http://download.nvidia.com/developer/GLSL/GLSL%20Release%20Notes%20for%20Release%2060.pdf +GL_EXT_Cg_shader + + GL_CG_VERTEX_SHADER_EXT 0x890E + GL_CG_FRAGMENT_SHADER_EXT 0x890F diff --git a/Windows/glew/auto/core/gl/GL_EXT_bindable_uniform b/Windows/glew/auto/core/gl/GL_EXT_bindable_uniform new file mode 100644 index 00000000..00ec270c --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_bindable_uniform @@ -0,0 +1,13 @@ +GL_EXT_bindable_uniform +http://developer.download.nvidia.com/opengl/specs/GL_EXT_bindable_uniform.txt +GL_EXT_bindable_uniform + + GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 + GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 + GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 + GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED + GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + GL_UNIFORM_BUFFER_EXT 0x8DEE + void glUniformBufferEXT (GLuint program, GLint location, GLuint buffer) + GLint glGetUniformBufferSizeEXT (GLuint program, GLint location) + GLintptr glGetUniformOffsetEXT (GLuint program, GLint location) diff --git a/Windows/glew/auto/core/gl/GL_EXT_debug_marker b/Windows/glew/auto/core/gl/GL_EXT_debug_marker new file mode 100644 index 00000000..ce9ffe40 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_debug_marker @@ -0,0 +1,7 @@ +GL_EXT_debug_marker +http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_marker.txt +GL_EXT_debug_marker + + void glInsertEventMarkerEXT (GLsizei length, const GLchar* marker) + void glPushGroupMarkerEXT (GLsizei length, const GLchar* marker) + void glPopGroupMarkerEXT (void) diff --git a/Windows/glew/auto/core/gl/GL_EXT_depth_bounds_test b/Windows/glew/auto/core/gl/GL_EXT_depth_bounds_test new file mode 100644 index 00000000..da2a453d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_depth_bounds_test @@ -0,0 +1,7 @@ +GL_EXT_depth_bounds_test +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_depth_bounds_test.txt +GL_EXT_depth_bounds_test + + GL_DEPTH_BOUNDS_TEST_EXT 0x8890 + GL_DEPTH_BOUNDS_EXT 0x8891 + void glDepthBoundsEXT (GLclampd zmin, GLclampd zmax) diff --git a/Windows/glew/auto/core/gl/GL_EXT_draw_instanced b/Windows/glew/auto/core/gl/GL_EXT_draw_instanced new file mode 100644 index 00000000..ca7f17e0 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_draw_instanced @@ -0,0 +1,6 @@ +GL_EXT_draw_instanced +http://developer.download.nvidia.com/opengl/specs/GL_EXT_draw_instanced.txt +GL_EXT_draw_instanced + + void glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount) diff --git a/Windows/glew/auto/core/gl/GL_EXT_draw_range_elements b/Windows/glew/auto/core/gl/GL_EXT_draw_range_elements new file mode 100644 index 00000000..f5346de0 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_draw_range_elements @@ -0,0 +1,7 @@ +GL_EXT_draw_range_elements +http://oss.sgi.com/projects/ogl-sample/registry/EXT/draw_range_elements.txt +GL_EXT_draw_range_elements + + GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 + GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + void glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices) diff --git a/Windows/glew/auto/core/gl/GL_EXT_external_buffer b/Windows/glew/auto/core/gl/GL_EXT_external_buffer new file mode 100644 index 00000000..25a3ca64 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_external_buffer @@ -0,0 +1,7 @@ +GL_EXT_external_buffer +http://www.opengl.org/registry/specs/EXT/external_buffer.txt +GL_EXT_external_buffer + + void glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags) + void glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags) + typedef void* GLeglClientBufferEXT \ No newline at end of file diff --git a/Windows/glew/auto/core/gl/GL_EXT_fog_coord b/Windows/glew/auto/core/gl/GL_EXT_fog_coord new file mode 100644 index 00000000..148866a7 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_fog_coord @@ -0,0 +1,17 @@ +GL_EXT_fog_coord +http://oss.sgi.com/projects/ogl-sample/registry/EXT/fog_coord.txt +GL_EXT_fog_coord + + GL_FOG_COORDINATE_SOURCE_EXT 0x8450 + GL_FOG_COORDINATE_EXT 0x8451 + GL_FRAGMENT_DEPTH_EXT 0x8452 + GL_CURRENT_FOG_COORDINATE_EXT 0x8453 + GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 + GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 + GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 + GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + void glFogCoordfEXT (GLfloat coord) + void glFogCoordfvEXT (const GLfloat *coord) + void glFogCoorddEXT (GLdouble coord) + void glFogCoorddvEXT (const GLdouble *coord) + void glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer) diff --git a/Windows/glew/auto/core/gl/GL_EXT_framebuffer_sRGB b/Windows/glew/auto/core/gl/GL_EXT_framebuffer_sRGB new file mode 100644 index 00000000..2f4c6ff3 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_framebuffer_sRGB @@ -0,0 +1,6 @@ +GL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GL_EXT_framebuffer_sRGB + + GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA diff --git a/Windows/glew/auto/core/gl/GL_EXT_geometry_shader4 b/Windows/glew/auto/core/gl/GL_EXT_geometry_shader4 new file mode 100644 index 00000000..a463c4cb --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_geometry_shader4 @@ -0,0 +1,27 @@ +GL_EXT_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_geometry_shader4.txt +GL_EXT_geometry_shader4 + + GL_GEOMETRY_SHADER_EXT 0x8DD9 + GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD + GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE + GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA + GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB + GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 + GL_LINES_ADJACENCY_EXT 0xA + GL_LINE_STRIP_ADJACENCY_EXT 0xB + GL_TRIANGLES_ADJACENCY_EXT 0xC + GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 + GL_PROGRAM_POINT_SIZE_EXT 0x8642 + void glProgramParameteriEXT (GLuint program, GLenum pname, GLint value) + void glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level) + void glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) diff --git a/Windows/glew/auto/core/gl/GL_EXT_gpu_program_parameters b/Windows/glew/auto/core/gl/GL_EXT_gpu_program_parameters new file mode 100644 index 00000000..298bc36f --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_gpu_program_parameters @@ -0,0 +1,6 @@ +GL_EXT_gpu_program_parameters +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_program_parameters.txt +GL_EXT_gpu_program_parameters + + void glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) + void glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) diff --git a/Windows/glew/auto/core/gl/GL_EXT_gpu_shader4 b/Windows/glew/auto/core/gl/GL_EXT_gpu_shader4 new file mode 100644 index 00000000..7e95dbce --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_gpu_shader4 @@ -0,0 +1,64 @@ +GL_EXT_gpu_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_shader4.txt +GL_EXT_gpu_shader4 + + GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 + GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 + GL_SAMPLER_BUFFER_EXT 0x8DC2 + GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 + GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 + GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 + GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 + GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 + GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 + GL_INT_SAMPLER_1D_EXT 0x8DC9 + GL_INT_SAMPLER_2D_EXT 0x8DCA + GL_INT_SAMPLER_3D_EXT 0x8DCB + GL_INT_SAMPLER_CUBE_EXT 0x8DCC + GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD + GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE + GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF + GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 + GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 + GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 + GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 + GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 + GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 + GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD + void glGetUniformuivEXT (GLuint program, GLint location, GLuint *params) + void glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name) + GLint glGetFragDataLocationEXT (GLuint program, const GLchar *name) + void glUniform1uiEXT (GLint location, GLuint v0) + void glUniform2uiEXT (GLint location, GLuint v0, GLuint v1) + void glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2) + void glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value) + void glVertexAttribI1iEXT (GLuint index, GLint x) + void glVertexAttribI2iEXT (GLuint index, GLint x, GLint y) + void glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z) + void glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w) + void glVertexAttribI1uiEXT (GLuint index, GLuint x) + void glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y) + void glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z) + void glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glVertexAttribI1ivEXT (GLuint index, const GLint *v) + void glVertexAttribI2ivEXT (GLuint index, const GLint *v) + void glVertexAttribI3ivEXT (GLuint index, const GLint *v) + void glVertexAttribI4ivEXT (GLuint index, const GLint *v) + void glVertexAttribI1uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI2uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI3uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4bvEXT (GLuint index, const GLbyte *v) + void glVertexAttribI4svEXT (GLuint index, const GLshort *v) + void glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v) + void glVertexAttribI4usvEXT (GLuint index, const GLushort *v) + void glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer) + void glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params) + void glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params) diff --git a/Windows/glew/auto/core/gl/GL_EXT_memory_object b/Windows/glew/auto/core/gl/GL_EXT_memory_object new file mode 100644 index 00000000..1f4531d4 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_memory_object @@ -0,0 +1,41 @@ +GL_EXT_memory_object +http://www.opengl.org/registry/specs/EXT/external_objects.txt +GL_EXT_memory_object + + GL_UUID_SIZE_EXT 16 + GL_TEXTURE_TILING_EXT 0x9580 + GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 + GL_NUM_TILING_TYPES_EXT 0x9582 + GL_TILING_TYPES_EXT 0x9583 + GL_OPTIMAL_TILING_EXT 0x9584 + GL_LINEAR_TILING_EXT 0x9585 + GL_LAYOUT_GENERAL_EXT 0x958D + GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E + GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F + GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 + GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 + GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 + GL_LAYOUT_TRANSFER_DST_EXT 0x9593 + GL_NUM_DEVICE_UUIDS_EXT 0x9596 + GL_DEVICE_UUID_EXT 0x9597 + GL_DRIVER_UUID_EXT 0x9598 + GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B + void glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset) + void glCreateMemoryObjectsEXT (GLsizei n, GLuint* memoryObjects) + void glDeleteMemoryObjectsEXT (GLsizei n, const GLuint* memoryObjects) + void glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint* params) + void glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte* data) + void glGetUnsignedBytevEXT (GLenum pname, GLubyte* data) + GLboolean glIsMemoryObjectEXT (GLuint memoryObject) + void glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint* params) + void glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset) + void glTexStorageMem1DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset) + void glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset) + void glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) + void glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset) + void glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) + void glTextureStorageMem1DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset) + void glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset) + void glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) + void glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset) + void glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) diff --git a/Windows/glew/auto/core/gl/GL_EXT_memory_object_fd b/Windows/glew/auto/core/gl/GL_EXT_memory_object_fd new file mode 100644 index 00000000..38536c00 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_memory_object_fd @@ -0,0 +1,6 @@ +GL_EXT_memory_object_fd +http://www.opengl.org/registry/specs/EXT/external_objects_fd.txt +GL_EXT_memory_object_fd + + GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 + void glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd) diff --git a/Windows/glew/auto/core/gl/GL_EXT_memory_object_win32 b/Windows/glew/auto/core/gl/GL_EXT_memory_object_win32 new file mode 100644 index 00000000..6d36a69a --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_memory_object_win32 @@ -0,0 +1,17 @@ +GL_EXT_memory_object_win32 +http://www.opengl.org/registry/specs/EXT/external_objects_win32.txt +GL_EXT_memory_object_win32 + + GL_LUID_SIZE_EXT 8 + GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 + GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 + GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 + GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A + GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B + GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C + GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 + GL_D3D12_FENCE_VALUE_EXT 0x9595 + GL_DEVICE_LUID_EXT 0x9599 + GL_DEVICE_NODE_MASK_EXT 0x959A + void glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle) + void glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name) diff --git a/Windows/glew/auto/core/gl/GL_EXT_packed_float b/Windows/glew/auto/core/gl/GL_EXT_packed_float new file mode 100644 index 00000000..15ac6800 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_packed_float @@ -0,0 +1,7 @@ +GL_EXT_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GL_EXT_packed_float + + GL_R11F_G11F_B10F_EXT 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B + GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C diff --git a/Windows/glew/auto/core/gl/GL_EXT_pixel_buffer_object b/Windows/glew/auto/core/gl/GL_EXT_pixel_buffer_object new file mode 100644 index 00000000..f685e4c8 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_pixel_buffer_object @@ -0,0 +1,8 @@ +GL_EXT_pixel_buffer_object +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_pixel_buffer_object.txt +GL_EXT_pixel_buffer_object + + GL_PIXEL_PACK_BUFFER_EXT 0x88EB + GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF diff --git a/Windows/glew/auto/core/gl/GL_EXT_secondary_color b/Windows/glew/auto/core/gl/GL_EXT_secondary_color new file mode 100644 index 00000000..505761d2 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_secondary_color @@ -0,0 +1,28 @@ +GL_EXT_secondary_color +http://oss.sgi.com/projects/ogl-sample/registry/EXT/secondary_color.txt +GL_EXT_secondary_color + + GL_COLOR_SUM_EXT 0x8458 + GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C + GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D + GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + void glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue) + void glSecondaryColor3bvEXT (const GLbyte *v) + void glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue) + void glSecondaryColor3dvEXT (const GLdouble *v) + void glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue) + void glSecondaryColor3fvEXT (const GLfloat *v) + void glSecondaryColor3iEXT (GLint red, GLint green, GLint blue) + void glSecondaryColor3ivEXT (const GLint *v) + void glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue) + void glSecondaryColor3svEXT (const GLshort *v) + void glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue) + void glSecondaryColor3ubvEXT (const GLubyte *v) + void glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue) + void glSecondaryColor3uivEXT (const GLuint *v) + void glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue) + void glSecondaryColor3usvEXT (const GLushort *v) + void glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer) diff --git a/Windows/glew/auto/core/gl/GL_EXT_semaphore b/Windows/glew/auto/core/gl/GL_EXT_semaphore new file mode 100644 index 00000000..2e774d10 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_semaphore @@ -0,0 +1,11 @@ +GL_EXT_semaphore +http://www.opengl.org/registry/specs/EXT/external_objects.txt +GL_EXT_semaphore + + void glDeleteSemaphoresEXT (GLsizei n, const GLuint* semaphores) + void glGenSemaphoresEXT (GLsizei n, GLuint* semaphores) + void glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64* params) + GLboolean glIsSemaphoreEXT (GLuint semaphore) + void glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64* params) + void glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts) + void glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts) diff --git a/Windows/glew/auto/core/gl/GL_EXT_semaphore_fd b/Windows/glew/auto/core/gl/GL_EXT_semaphore_fd new file mode 100644 index 00000000..e3b2985b --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_semaphore_fd @@ -0,0 +1,5 @@ +GL_EXT_semaphore_fd +http://www.opengl.org/registry/specs/EXT/external_objects_fd.txt +GL_EXT_semaphore_fd + + void glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd) diff --git a/Windows/glew/auto/core/gl/GL_EXT_semaphore_win32 b/Windows/glew/auto/core/gl/GL_EXT_semaphore_win32 new file mode 100644 index 00000000..4854f58f --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_semaphore_win32 @@ -0,0 +1,6 @@ +GL_EXT_semaphore_win32 +http://www.opengl.org/registry/specs/EXT/external_objects_win32.txt +GL_EXT_semaphore_win32 + + void glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle) + void glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name) diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_array b/Windows/glew/auto/core/gl/GL_EXT_texture_array new file mode 100644 index 00000000..c5c2c9fa --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_array @@ -0,0 +1,13 @@ +GL_EXT_texture_array +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_array.txt +GL_EXT_texture_array + + GL_TEXTURE_1D_ARRAY_EXT 0x8C18 + GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 + GL_TEXTURE_2D_ARRAY_EXT 0x8C1A + GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B + GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C + GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF + GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E + void glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_buffer_object b/Windows/glew/auto/core/gl/GL_EXT_texture_buffer_object new file mode 100644 index 00000000..81b58351 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_buffer_object @@ -0,0 +1,10 @@ +GL_EXT_texture_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_buffer_object.txt +GL_EXT_texture_buffer_object + + GL_TEXTURE_BUFFER_EXT 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B + GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D + GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + void glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer) diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_compression_latc b/Windows/glew/auto/core/gl/GL_EXT_texture_compression_latc new file mode 100644 index 00000000..e8fcacc2 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_compression_latc @@ -0,0 +1,8 @@ +GL_EXT_texture_compression_latc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_latc.txt +GL_EXT_texture_compression_latc + + GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 + GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 + GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 + GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_compression_rgtc b/Windows/glew/auto/core/gl/GL_EXT_texture_compression_rgtc new file mode 100644 index 00000000..054b7f05 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_compression_rgtc @@ -0,0 +1,8 @@ +GL_EXT_texture_compression_rgtc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_rgtc.txt +GL_EXT_texture_compression_rgtc + + GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB + GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC + GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD + GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_cube_map b/Windows/glew/auto/core/gl/GL_EXT_texture_cube_map new file mode 100644 index 00000000..73a2c735 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_cube_map @@ -0,0 +1,16 @@ +GL_EXT_texture_cube_map +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_cube_map.txt +GL_EXT_texture_cube_map + + GL_NORMAL_MAP_EXT 0x8511 + GL_REFLECTION_MAP_EXT 0x8512 + GL_TEXTURE_CUBE_MAP_EXT 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A + GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_edge_clamp b/Windows/glew/auto/core/gl/GL_EXT_texture_edge_clamp new file mode 100644 index 00000000..c0b3e2a5 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_edge_clamp @@ -0,0 +1,5 @@ +GL_EXT_texture_edge_clamp +http://www.opengl.org/developers/documentation/Version1.2/1.2specs/texture_edge_clamp.txt +GL_EXT_texture_edge_clamp + + GL_CLAMP_TO_EDGE_EXT 0x812F diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_integer b/Windows/glew/auto/core/gl/GL_EXT_texture_integer new file mode 100644 index 00000000..43219cfe --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_integer @@ -0,0 +1,57 @@ +GL_EXT_texture_integer +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_integer.txt +GL_EXT_texture_integer + + GL_RGBA32UI_EXT 0x8D70 + GL_RGB32UI_EXT 0x8D71 + GL_ALPHA32UI_EXT 0x8D72 + GL_INTENSITY32UI_EXT 0x8D73 + GL_LUMINANCE32UI_EXT 0x8D74 + GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 + GL_RGBA16UI_EXT 0x8D76 + GL_RGB16UI_EXT 0x8D77 + GL_ALPHA16UI_EXT 0x8D78 + GL_INTENSITY16UI_EXT 0x8D79 + GL_LUMINANCE16UI_EXT 0x8D7A + GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B + GL_RGBA8UI_EXT 0x8D7C + GL_RGB8UI_EXT 0x8D7D + GL_ALPHA8UI_EXT 0x8D7E + GL_INTENSITY8UI_EXT 0x8D7F + GL_LUMINANCE8UI_EXT 0x8D80 + GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 + GL_RGBA32I_EXT 0x8D82 + GL_RGB32I_EXT 0x8D83 + GL_ALPHA32I_EXT 0x8D84 + GL_INTENSITY32I_EXT 0x8D85 + GL_LUMINANCE32I_EXT 0x8D86 + GL_LUMINANCE_ALPHA32I_EXT 0x8D87 + GL_RGBA16I_EXT 0x8D88 + GL_RGB16I_EXT 0x8D89 + GL_ALPHA16I_EXT 0x8D8A + GL_INTENSITY16I_EXT 0x8D8B + GL_LUMINANCE16I_EXT 0x8D8C + GL_LUMINANCE_ALPHA16I_EXT 0x8D8D + GL_RGBA8I_EXT 0x8D8E + GL_RGB8I_EXT 0x8D8F + GL_ALPHA8I_EXT 0x8D90 + GL_INTENSITY8I_EXT 0x8D91 + GL_LUMINANCE8I_EXT 0x8D92 + GL_LUMINANCE_ALPHA8I_EXT 0x8D93 + GL_RED_INTEGER_EXT 0x8D94 + GL_GREEN_INTEGER_EXT 0x8D95 + GL_BLUE_INTEGER_EXT 0x8D96 + GL_ALPHA_INTEGER_EXT 0x8D97 + GL_RGB_INTEGER_EXT 0x8D98 + GL_RGBA_INTEGER_EXT 0x8D99 + GL_BGR_INTEGER_EXT 0x8D9A + GL_BGRA_INTEGER_EXT 0x8D9B + GL_LUMINANCE_INTEGER_EXT 0x8D9C + GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D + GL_RGBA_INTEGER_MODE_EXT 0x8D9E + void glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params) + void glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params) + void glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params) + void glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params) + void glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha) + void glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha) diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_rectangle b/Windows/glew/auto/core/gl/GL_EXT_texture_rectangle new file mode 100644 index 00000000..13943112 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_rectangle @@ -0,0 +1,8 @@ +GL_EXT_texture_rectangle +http://developer.apple.com/opengl/extensions/ext_texture_rectangle.html +GL_EXT_texture_rectangle + + GL_TEXTURE_RECTANGLE_EXT 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 diff --git a/Windows/glew/auto/core/gl/GL_EXT_texture_shared_exponent b/Windows/glew/auto/core/gl/GL_EXT_texture_shared_exponent new file mode 100644 index 00000000..4c7d4616 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_texture_shared_exponent @@ -0,0 +1,7 @@ +GL_EXT_texture_shared_exponent +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_shared_exponent.txt +GL_EXT_texture_shared_exponent + + GL_RGB9_E5_EXT 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E + GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F diff --git a/Windows/glew/auto/core/gl/GL_EXT_timer_query b/Windows/glew/auto/core/gl/GL_EXT_timer_query new file mode 100644 index 00000000..530ba355 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_timer_query @@ -0,0 +1,7 @@ +GL_EXT_timer_query +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_timer_query.txt +GL_EXT_timer_query + + GL_TIME_ELAPSED_EXT 0x88BF + void glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params) + void glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params) diff --git a/Windows/glew/auto/core/gl/GL_EXT_vertex_shader b/Windows/glew/auto/core/gl/GL_EXT_vertex_shader new file mode 100644 index 00000000..8d3314fc --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_EXT_vertex_shader @@ -0,0 +1,157 @@ +GL_EXT_vertex_shader +http://oss.sgi.com/projects/ogl-sample/registry/EXT/vertex_shader.txt +GL_EXT_vertex_shader + + GL_VERTEX_SHADER_EXT 0x8780 + GL_VERTEX_SHADER_BINDING_EXT 0x8781 + GL_OP_INDEX_EXT 0x8782 + GL_OP_NEGATE_EXT 0x8783 + GL_OP_DOT3_EXT 0x8784 + GL_OP_DOT4_EXT 0x8785 + GL_OP_MUL_EXT 0x8786 + GL_OP_ADD_EXT 0x8787 + GL_OP_MADD_EXT 0x8788 + GL_OP_FRAC_EXT 0x8789 + GL_OP_MAX_EXT 0x878A + GL_OP_MIN_EXT 0x878B + GL_OP_SET_GE_EXT 0x878C + GL_OP_SET_LT_EXT 0x878D + GL_OP_CLAMP_EXT 0x878E + GL_OP_FLOOR_EXT 0x878F + GL_OP_ROUND_EXT 0x8790 + GL_OP_EXP_BASE_2_EXT 0x8791 + GL_OP_LOG_BASE_2_EXT 0x8792 + GL_OP_POWER_EXT 0x8793 + GL_OP_RECIP_EXT 0x8794 + GL_OP_RECIP_SQRT_EXT 0x8795 + GL_OP_SUB_EXT 0x8796 + GL_OP_CROSS_PRODUCT_EXT 0x8797 + GL_OP_MULTIPLY_MATRIX_EXT 0x8798 + GL_OP_MOV_EXT 0x8799 + GL_OUTPUT_VERTEX_EXT 0x879A + GL_OUTPUT_COLOR0_EXT 0x879B + GL_OUTPUT_COLOR1_EXT 0x879C + GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D + GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E + GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F + GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 + GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 + GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 + GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 + GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 + GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 + GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 + GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 + GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 + GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 + GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA + GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB + GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC + GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD + GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE + GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF + GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 + GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 + GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 + GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 + GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 + GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 + GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 + GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 + GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 + GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 + GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA + GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB + GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC + GL_OUTPUT_FOG_EXT 0x87BD + GL_SCALAR_EXT 0x87BE + GL_VECTOR_EXT 0x87BF + GL_MATRIX_EXT 0x87C0 + GL_VARIANT_EXT 0x87C1 + GL_INVARIANT_EXT 0x87C2 + GL_LOCAL_CONSTANT_EXT 0x87C3 + GL_LOCAL_EXT 0x87C4 + GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 + GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 + GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 + GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 + GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 + GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA + GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB + GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE + GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF + GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 + GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 + GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 + GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 + GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 + GL_X_EXT 0x87D5 + GL_Y_EXT 0x87D6 + GL_Z_EXT 0x87D7 + GL_W_EXT 0x87D8 + GL_NEGATIVE_X_EXT 0x87D9 + GL_NEGATIVE_Y_EXT 0x87DA + GL_NEGATIVE_Z_EXT 0x87DB + GL_NEGATIVE_W_EXT 0x87DC + GL_ZERO_EXT 0x87DD + GL_ONE_EXT 0x87DE + GL_NEGATIVE_ONE_EXT 0x87DF + GL_NORMALIZED_RANGE_EXT 0x87E0 + GL_FULL_RANGE_EXT 0x87E1 + GL_CURRENT_VERTEX_EXT 0x87E2 + GL_MVP_MATRIX_EXT 0x87E3 + GL_VARIANT_VALUE_EXT 0x87E4 + GL_VARIANT_DATATYPE_EXT 0x87E5 + GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 + GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 + GL_VARIANT_ARRAY_EXT 0x87E8 + GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 + GL_INVARIANT_VALUE_EXT 0x87EA + GL_INVARIANT_DATATYPE_EXT 0x87EB + GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC + GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + + void glBeginVertexShaderEXT (void) + void glEndVertexShaderEXT (void) + void glBindVertexShaderEXT (GLuint id) + GLuint glGenVertexShadersEXT (GLuint range) + void glDeleteVertexShaderEXT (GLuint id) + void glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1) + void glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2) + void glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3) + void glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glInsertComponentEXT (GLuint res, GLuint src, GLuint num) + void glExtractComponentEXT (GLuint res, GLuint src, GLuint num) + GLuint glGenSymbolsEXT (GLenum dataType, GLenum storageType, GLenum range, GLuint components) + void glSetInvariantEXT (GLuint id, GLenum type, void *addr) + void glSetLocalConstantEXT (GLuint id, GLenum type, void *addr) + void glVariantbvEXT (GLuint id, GLbyte *addr) + void glVariantsvEXT (GLuint id, GLshort *addr) + void glVariantivEXT (GLuint id, GLint *addr) + void glVariantfvEXT (GLuint id, GLfloat *addr) + void glVariantdvEXT (GLuint id, GLdouble *addr) + void glVariantubvEXT (GLuint id, GLubyte *addr) + void glVariantusvEXT (GLuint id, GLushort *addr) + void glVariantuivEXT (GLuint id, GLuint *addr) + void glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, void *addr) + void glEnableVariantClientStateEXT (GLuint id) + void glDisableVariantClientStateEXT (GLuint id) + GLuint glBindLightParameterEXT (GLenum light, GLenum value) + GLuint glBindMaterialParameterEXT (GLenum face, GLenum value) + GLuint glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value) + GLuint glBindTextureUnitParameterEXT (GLenum unit, GLenum value) + GLuint glBindParameterEXT (GLenum value) + GLboolean glIsVariantEnabledEXT (GLuint id, GLenum cap) + void glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetVariantPointervEXT (GLuint id, GLenum value, void **data) + void glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data) diff --git a/Windows/glew/auto/core/gl/GL_KTX_buffer_region b/Windows/glew/auto/core/gl/GL_KTX_buffer_region new file mode 100644 index 00000000..ef281b1d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_KTX_buffer_region @@ -0,0 +1,13 @@ +GL_KTX_buffer_region + +GL_KTX_buffer_region + + GL_KTX_FRONT_REGION 0x0 + GL_KTX_BACK_REGION 0x1 + GL_KTX_Z_REGION 0x2 + GL_KTX_STENCIL_REGION 0x3 + GLuint glBufferRegionEnabled (void) + GLuint glNewBufferRegion (GLenum region) + void glDeleteBufferRegion (GLenum region) + void glReadBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height) + void glDrawBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest) diff --git a/Windows/glew/auto/core/gl/GL_NVX_gpu_memory_info b/Windows/glew/auto/core/gl/GL_NVX_gpu_memory_info new file mode 100644 index 00000000..a8d97b9b --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NVX_gpu_memory_info @@ -0,0 +1,9 @@ +GL_NVX_gpu_memory_info +http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt +GL_NVX_gpu_memory_info + + GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 + GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 + GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 + GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A + GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B diff --git a/Windows/glew/auto/core/gl/GL_NV_depth_buffer_float b/Windows/glew/auto/core/gl/GL_NV_depth_buffer_float new file mode 100644 index 00000000..421d266d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_depth_buffer_float @@ -0,0 +1,11 @@ +GL_NV_depth_buffer_float +http://developer.download.nvidia.com/opengl/specs/GL_NV_depth_buffer_float.txt +GL_NV_depth_buffer_float + + GL_DEPTH_COMPONENT32F_NV 0x8DAB + GL_DEPTH32F_STENCIL8_NV 0x8DAC + GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD + GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + void glDepthRangedNV (GLdouble zNear, GLdouble zFar) + void glClearDepthdNV (GLdouble depth) + void glDepthBoundsdNV (GLdouble zmin, GLdouble zmax) diff --git a/Windows/glew/auto/core/gl/GL_NV_depth_range_unclamped b/Windows/glew/auto/core/gl/GL_NV_depth_range_unclamped new file mode 100644 index 00000000..b63a0eec --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_depth_range_unclamped @@ -0,0 +1,9 @@ +GL_NV_depth_range_unclamped + +GL_NV_depth_range_unclamped + + GL_SAMPLE_COUNT_BITS_NV 0x8864 + GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 + GL_QUERY_RESULT_NV 0x8866 + GL_QUERY_RESULT_AVAILABLE_NV 0x8867 + GL_SAMPLE_COUNT_NV 0x8914 diff --git a/Windows/glew/auto/core/gl/GL_NV_fragment_program2 b/Windows/glew/auto/core/gl/GL_NV_fragment_program2 new file mode 100644 index 00000000..79d4b631 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_fragment_program2 @@ -0,0 +1,9 @@ +GL_NV_fragment_program2 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program2.txt +GL_NV_fragment_program2 + + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 + GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 + GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 diff --git a/Windows/glew/auto/core/gl/GL_NV_fragment_program4 b/Windows/glew/auto/core/gl/GL_NV_fragment_program4 new file mode 100644 index 00000000..edd4383b --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_fragment_program4 @@ -0,0 +1,4 @@ +GL_NV_fragment_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_fragment_program4.txt +GL_NV_gpu_program4 + diff --git a/Windows/glew/auto/core/gl/GL_NV_fragment_program_option b/Windows/glew/auto/core/gl/GL_NV_fragment_program_option new file mode 100644 index 00000000..01b8ed6e --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_fragment_program_option @@ -0,0 +1,4 @@ +GL_NV_fragment_program_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txt +GL_NV_fragment_program_option + diff --git a/Windows/glew/auto/core/gl/GL_NV_framebuffer_multisample_coverage b/Windows/glew/auto/core/gl/GL_NV_framebuffer_multisample_coverage new file mode 100644 index 00000000..526d0f06 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_framebuffer_multisample_coverage @@ -0,0 +1,9 @@ +GL_NV_framebuffer_multisample_coverage +http://developer.download.nvidia.com/opengl/specs/GL_NV_framebuffer_multisample_coverage.txt +GL_NV_framebuffer_multisample_coverage + + GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB + GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 + GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 + GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + void glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/core/gl/GL_NV_geometry_program4 b/Windows/glew/auto/core/gl/GL_NV_geometry_program4 new file mode 100644 index 00000000..a6cb1640 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_geometry_program4 @@ -0,0 +1,8 @@ +GL_NV_geometry_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_program4.txt +GL_NV_gpu_program4 + + GL_GEOMETRY_PROGRAM_NV 0x8C26 + GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 + GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + void glProgramVertexLimitNV (GLenum target, GLint limit) diff --git a/Windows/glew/auto/core/gl/GL_NV_geometry_shader4 b/Windows/glew/auto/core/gl/GL_NV_geometry_shader4 new file mode 100644 index 00000000..1b004297 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_geometry_shader4 @@ -0,0 +1,4 @@ +GL_NV_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_shader4.txt +GL_NV_geometry_shader4 + diff --git a/Windows/glew/auto/core/gl/GL_NV_gpu_program4 b/Windows/glew/auto/core/gl/GL_NV_gpu_program4 new file mode 100644 index 00000000..19f71697 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_gpu_program4 @@ -0,0 +1,24 @@ +GL_NV_gpu_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_gpu_program4.txt +GL_NV_gpu_program4 + + GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 + GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 + GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 + GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 + GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 + GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 + GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 + GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + void glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) + void glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) diff --git a/Windows/glew/auto/core/gl/GL_NV_gpu_program5 b/Windows/glew/auto/core/gl/GL_NV_gpu_program5 new file mode 100644 index 00000000..68079f3c --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_gpu_program5 @@ -0,0 +1,10 @@ +GL_NV_gpu_program5 +http://www.opengl.org/registry/specs/NV/gpu_program5.txt +GL_NV_gpu_program5 + + GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C + GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F diff --git a/Windows/glew/auto/core/gl/GL_NV_parameter_buffer_object b/Windows/glew/auto/core/gl/GL_NV_parameter_buffer_object new file mode 100644 index 00000000..91494e31 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_parameter_buffer_object @@ -0,0 +1,12 @@ +GL_NV_parameter_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_NV_parameter_buffer_object.txt +GL_NV_parameter_buffer_object + + GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 + GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 + GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 + GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 + void glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params) + void glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params) + void glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params) diff --git a/Windows/glew/auto/core/gl/GL_NV_present_video b/Windows/glew/auto/core/gl/GL_NV_present_video new file mode 100644 index 00000000..1a5b8ce2 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_present_video @@ -0,0 +1,16 @@ +GL_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +GL_NV_present_video + + GL_FRAME_NV 0x8E26 + GL_FIELDS_NV 0x8E27 + GL_CURRENT_TIME_NV 0x8E28 + GL_NUM_FILL_STREAMS_NV 0x8E29 + GL_PRESENT_TIME_NV 0x8E2A + GL_PRESENT_DURATION_NV 0x8E2B + void glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT* params) + void glGetVideoivNV (GLuint video_slot, GLenum pname, GLint* params) + void glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT* params) + void glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint* params) + void glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3) + void glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1) diff --git a/Windows/glew/auto/core/gl/GL_NV_tessellation_program5 b/Windows/glew/auto/core/gl/GL_NV_tessellation_program5 new file mode 100644 index 00000000..75fd3c7c --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_tessellation_program5 @@ -0,0 +1,9 @@ +GL_NV_tessellation_program5 +http://www.opengl.org/registry/specs/NV/tessellation_program5.txt +GL_NV_gpu_program5 + + GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 + GL_TESS_CONTROL_PROGRAM_NV 0x891E + GL_TESS_EVALUATION_PROGRAM_NV 0x891F + GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 + GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 diff --git a/Windows/glew/auto/core/gl/GL_NV_transform_feedback b/Windows/glew/auto/core/gl/GL_NV_transform_feedback new file mode 100644 index 00000000..5f1816eb --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_transform_feedback @@ -0,0 +1,40 @@ +GL_NV_transform_feedback +http://developer.download.nvidia.com/opengl/specs/GL_NV_transform_feedback.txt +GL_NV_transform_feedback + + GL_BACK_PRIMARY_COLOR_NV 0x8C77 + GL_BACK_SECONDARY_COLOR_NV 0x8C78 + GL_TEXTURE_COORD_NV 0x8C79 + GL_CLIP_DISTANCE_NV 0x8C7A + GL_VERTEX_ID_NV 0x8C7B + GL_PRIMITIVE_ID_NV 0x8C7C + GL_GENERIC_ATTRIB_NV 0x8C7D + GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 + GL_ACTIVE_VARYINGS_NV 0x8C81 + GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 + GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 + GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 + GL_PRIMITIVES_GENERATED_NV 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 + GL_RASTERIZER_DISCARD_NV 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B + GL_INTERLEAVED_ATTRIBS_NV 0x8C8C + GL_SEPARATE_ATTRIBS_NV 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + void glBeginTransformFeedbackNV (GLenum primitiveMode) + void glEndTransformFeedbackNV (void) + void glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode) + void glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset) + void glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer) + void glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode) + void glActiveVaryingNV (GLuint program, const GLchar *name) + GLint glGetVaryingLocationNV (GLuint program, const GLchar *name) + void glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) + void glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location) diff --git a/Windows/glew/auto/core/gl/GL_NV_vdpau_interop b/Windows/glew/auto/core/gl/GL_NV_vdpau_interop new file mode 100644 index 00000000..f52949c9 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_vdpau_interop @@ -0,0 +1,19 @@ +GL_NV_vdpau_interop +http://www.opengl.org/registry/specs/NV/vdpau_interop.txt +GL_NV_vdpau_interop + + GL_SURFACE_STATE_NV 0x86EB + GL_SURFACE_REGISTERED_NV 0x86FD + GL_SURFACE_MAPPED_NV 0x8700 + GL_WRITE_DISCARD_NV 0x88BE + void glVDPAUFiniNV (void) + void glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values) + void glVDPAUInitNV (const void* vdpDevice, const void*getProcAddress) + void glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface) + void glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces) + GLvdpauSurfaceNV glVDPAURegisterOutputSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + GLvdpauSurfaceNV glVDPAURegisterVideoSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + void glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access) + void glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces) + void glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface) + typedef GLintptr GLvdpauSurfaceNV diff --git a/Windows/glew/auto/core/gl/GL_NV_vertex_program2_option b/Windows/glew/auto/core/gl/GL_NV_vertex_program2_option new file mode 100644 index 00000000..3e3e0b7a --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_vertex_program2_option @@ -0,0 +1,6 @@ +GL_NV_vertex_program2_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program2_option.txt +GL_NV_vertex_program2_option + + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 diff --git a/Windows/glew/auto/core/gl/GL_NV_vertex_program3 b/Windows/glew/auto/core/gl/GL_NV_vertex_program3 new file mode 100644 index 00000000..fbd38990 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_vertex_program3 @@ -0,0 +1,5 @@ +GL_NV_vertex_program3 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program3.txt +GL_NV_vertex_program3 + + MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C diff --git a/Windows/glew/auto/core/gl/GL_NV_vertex_program4 b/Windows/glew/auto/core/gl/GL_NV_vertex_program4 new file mode 100644 index 00000000..b1ff7f82 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_NV_vertex_program4 @@ -0,0 +1,5 @@ +GL_NV_vertex_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_vertex_program4.txt +GL_NV_gpu_program4 + + GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD diff --git a/Windows/glew/auto/core/gl/GL_SGIX_shadow b/Windows/glew/auto/core/gl/GL_SGIX_shadow new file mode 100644 index 00000000..3580721d --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_SGIX_shadow @@ -0,0 +1,8 @@ +GL_SGIX_shadow +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/shadow.txt +GL_SGIX_shadow + + GL_TEXTURE_COMPARE_SGIX 0x819A + GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B + GL_TEXTURE_LEQUAL_R_SGIX 0x819C + GL_TEXTURE_GEQUAL_R_SGIX 0x819D diff --git a/Windows/glew/auto/core/gl/GL_SUN_read_video_pixels b/Windows/glew/auto/core/gl/GL_SUN_read_video_pixels new file mode 100644 index 00000000..871e6f93 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_SUN_read_video_pixels @@ -0,0 +1,5 @@ +GL_SUN_read_video_pixels +http://wwws.sun.com/software/graphics/opengl/extensions/gl_sun_read_video_pixels.txt +GL_SUN_read_video_pixels + + void glReadVideoPixelsSUN (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_1_2 b/Windows/glew/auto/core/gl/GL_VERSION_1_2 new file mode 100644 index 00000000..fe610b67 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_1_2 @@ -0,0 +1,50 @@ +GL_VERSION_1_2 +http://www.opengl.org/documentation/specs/version1.2/opengl1.2.1.pdf + + + GL_UNSIGNED_BYTE_3_3_2 0x8032 + GL_UNSIGNED_SHORT_4_4_4_4 0x8033 + GL_UNSIGNED_SHORT_5_5_5_1 0x8034 + GL_UNSIGNED_INT_8_8_8_8 0x8035 + GL_UNSIGNED_INT_10_10_10_2 0x8036 + GL_RESCALE_NORMAL 0x803A + GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 + GL_UNSIGNED_SHORT_5_6_5 0x8363 + GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 + GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 + GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 + GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 + GL_BGR 0x80E0 + GL_BGRA 0x80E1 + GL_MAX_ELEMENTS_VERTICES 0x80E8 + GL_MAX_ELEMENTS_INDICES 0x80E9 + GL_CLAMP_TO_EDGE 0x812F + GL_TEXTURE_MIN_LOD 0x813A + GL_TEXTURE_MAX_LOD 0x813B + GL_TEXTURE_BASE_LEVEL 0x813C + GL_TEXTURE_MAX_LEVEL 0x813D + GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 + GL_SINGLE_COLOR 0x81F9 + GL_SEPARATE_SPECULAR_COLOR 0x81FA + GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 + GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 + GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 + GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 + GL_ALIASED_POINT_SIZE_RANGE 0x846D + GL_ALIASED_LINE_WIDTH_RANGE 0x846E + GL_PACK_SKIP_IMAGES 0x806B + GL_PACK_IMAGE_HEIGHT 0x806C + GL_UNPACK_SKIP_IMAGES 0x806D + GL_UNPACK_IMAGE_HEIGHT 0x806E + GL_TEXTURE_3D 0x806F + GL_PROXY_TEXTURE_3D 0x8070 + GL_TEXTURE_DEPTH 0x8071 + GL_TEXTURE_WRAP_R 0x8072 + GL_MAX_3D_TEXTURE_SIZE 0x8073 + GL_TEXTURE_BINDING_3D 0x806A + GL_MAX_ELEMENTS_VERTICES 0x80E8 + GL_MAX_ELEMENTS_INDICES 0x80E9 + void glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices) + void glTexImage3D (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) + void glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) + void glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_1_2_1 b/Windows/glew/auto/core/gl/GL_VERSION_1_2_1 new file mode 100644 index 00000000..42634cbf --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_1_2_1 @@ -0,0 +1,4 @@ +GL_VERSION_1_2_1 +http://www.opengl.org/documentation/specs/version1.2/opengl1.2.1.pdf + + diff --git a/Windows/glew/auto/core/gl/GL_VERSION_1_3 b/Windows/glew/auto/core/gl/GL_VERSION_1_3 new file mode 100644 index 00000000..d6342fa8 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_1_3 @@ -0,0 +1,147 @@ +GL_VERSION_1_3 +http://www.opengl.org/documentation/specs/version1.3/glspec13.pdf + + + GL_TEXTURE0 0x84C0 + GL_TEXTURE1 0x84C1 + GL_TEXTURE2 0x84C2 + GL_TEXTURE3 0x84C3 + GL_TEXTURE4 0x84C4 + GL_TEXTURE5 0x84C5 + GL_TEXTURE6 0x84C6 + GL_TEXTURE7 0x84C7 + GL_TEXTURE8 0x84C8 + GL_TEXTURE9 0x84C9 + GL_TEXTURE10 0x84CA + GL_TEXTURE11 0x84CB + GL_TEXTURE12 0x84CC + GL_TEXTURE13 0x84CD + GL_TEXTURE14 0x84CE + GL_TEXTURE15 0x84CF + GL_TEXTURE16 0x84D0 + GL_TEXTURE17 0x84D1 + GL_TEXTURE18 0x84D2 + GL_TEXTURE19 0x84D3 + GL_TEXTURE20 0x84D4 + GL_TEXTURE21 0x84D5 + GL_TEXTURE22 0x84D6 + GL_TEXTURE23 0x84D7 + GL_TEXTURE24 0x84D8 + GL_TEXTURE25 0x84D9 + GL_TEXTURE26 0x84DA + GL_TEXTURE27 0x84DB + GL_TEXTURE28 0x84DC + GL_TEXTURE29 0x84DD + GL_TEXTURE30 0x84DE + GL_TEXTURE31 0x84DF + GL_ACTIVE_TEXTURE 0x84E0 + GL_CLIENT_ACTIVE_TEXTURE 0x84E1 + GL_MAX_TEXTURE_UNITS 0x84E2 + GL_NORMAL_MAP 0x8511 + GL_REFLECTION_MAP 0x8512 + GL_TEXTURE_CUBE_MAP 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A + GL_PROXY_TEXTURE_CUBE_MAP 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C + GL_COMPRESSED_ALPHA 0x84E9 + GL_COMPRESSED_LUMINANCE 0x84EA + GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB + GL_COMPRESSED_INTENSITY 0x84EC + GL_COMPRESSED_RGB 0x84ED + GL_COMPRESSED_RGBA 0x84EE + GL_TEXTURE_COMPRESSION_HINT 0x84EF + GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 + GL_TEXTURE_COMPRESSED 0x86A1 + GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 + GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + GL_MULTISAMPLE 0x809D + GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E + GL_SAMPLE_ALPHA_TO_ONE 0x809F + GL_SAMPLE_COVERAGE 0x80A0 + GL_SAMPLE_BUFFERS 0x80A8 + GL_SAMPLES 0x80A9 + GL_SAMPLE_COVERAGE_VALUE 0x80AA + GL_SAMPLE_COVERAGE_INVERT 0x80AB + GL_MULTISAMPLE_BIT 0x20000000 + GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 + GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 + GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 + GL_TRANSPOSE_COLOR_MATRIX 0x84E6 + GL_COMBINE 0x8570 + GL_COMBINE_RGB 0x8571 + GL_COMBINE_ALPHA 0x8572 + GL_SOURCE0_RGB 0x8580 + GL_SOURCE1_RGB 0x8581 + GL_SOURCE2_RGB 0x8582 + GL_SOURCE0_ALPHA 0x8588 + GL_SOURCE1_ALPHA 0x8589 + GL_SOURCE2_ALPHA 0x858A + GL_OPERAND0_RGB 0x8590 + GL_OPERAND1_RGB 0x8591 + GL_OPERAND2_RGB 0x8592 + GL_OPERAND0_ALPHA 0x8598 + GL_OPERAND1_ALPHA 0x8599 + GL_OPERAND2_ALPHA 0x859A + GL_RGB_SCALE 0x8573 + GL_ADD_SIGNED 0x8574 + GL_INTERPOLATE 0x8575 + GL_SUBTRACT 0x84E7 + GL_CONSTANT 0x8576 + GL_PRIMARY_COLOR 0x8577 + GL_PREVIOUS 0x8578 + GL_DOT3_RGB 0x86AE + GL_DOT3_RGBA 0x86AF + GL_CLAMP_TO_BORDER 0x812D + + void glActiveTexture (GLenum texture) + void glClientActiveTexture (GLenum texture) + void glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) + void glGetCompressedTexImage (GLenum target, GLint lod, void *img) + void glLoadTransposeMatrixd (const GLdouble m[16]) + void glLoadTransposeMatrixf (const GLfloat m[16]) + void glMultTransposeMatrixd (const GLdouble m[16]) + void glMultTransposeMatrixf (const GLfloat m[16]) + void glMultiTexCoord1d (GLenum target, GLdouble s) + void glMultiTexCoord1dv (GLenum target, const GLdouble *v) + void glMultiTexCoord1f (GLenum target, GLfloat s) + void glMultiTexCoord1fv (GLenum target, const GLfloat *v) + void glMultiTexCoord1i (GLenum target, GLint s) + void glMultiTexCoord1iv (GLenum target, const GLint *v) + void glMultiTexCoord1s (GLenum target, GLshort s) + void glMultiTexCoord1sv (GLenum target, const GLshort *v) + void glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t) + void glMultiTexCoord2dv (GLenum target, const GLdouble *v) + void glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t) + void glMultiTexCoord2fv (GLenum target, const GLfloat *v) + void glMultiTexCoord2i (GLenum target, GLint s, GLint t) + void glMultiTexCoord2iv (GLenum target, const GLint *v) + void glMultiTexCoord2s (GLenum target, GLshort s, GLshort t) + void glMultiTexCoord2sv (GLenum target, const GLshort *v) + void glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r) + void glMultiTexCoord3dv (GLenum target, const GLdouble *v) + void glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r) + void glMultiTexCoord3fv (GLenum target, const GLfloat *v) + void glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r) + void glMultiTexCoord3iv (GLenum target, const GLint *v) + void glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r) + void glMultiTexCoord3sv (GLenum target, const GLshort *v) + void glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) + void glMultiTexCoord4dv (GLenum target, const GLdouble *v) + void glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) + void glMultiTexCoord4fv (GLenum target, const GLfloat *v) + void glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q) + void glMultiTexCoord4iv (GLenum target, const GLint *v) + void glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) + void glMultiTexCoord4sv (GLenum target, const GLshort *v) + void glSampleCoverage (GLclampf value, GLboolean invert) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_1_4 b/Windows/glew/auto/core/gl/GL_VERSION_1_4 new file mode 100644 index 00000000..8d0724af --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_1_4 @@ -0,0 +1,90 @@ +GL_VERSION_1_4 +http://www.opengl.org/documentation/specs/version1.4/glspec14.pdf + + + GL_GENERATE_MIPMAP 0x8191 + GL_GENERATE_MIPMAP_HINT 0x8192 + GL_DEPTH_COMPONENT16 0x81A5 + GL_DEPTH_COMPONENT24 0x81A6 + GL_DEPTH_COMPONENT32 0x81A7 + GL_TEXTURE_DEPTH_SIZE 0x884A + GL_DEPTH_TEXTURE_MODE 0x884B + GL_TEXTURE_COMPARE_MODE 0x884C + GL_TEXTURE_COMPARE_FUNC 0x884D + GL_COMPARE_R_TO_TEXTURE 0x884E + GL_FOG_COORDINATE_SOURCE 0x8450 + GL_FOG_COORDINATE 0x8451 + GL_FRAGMENT_DEPTH 0x8452 + GL_CURRENT_FOG_COORDINATE 0x8453 + GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 + GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 + GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 + GL_FOG_COORDINATE_ARRAY 0x8457 + GL_POINT_SIZE_MIN 0x8126 + GL_POINT_SIZE_MAX 0x8127 + GL_POINT_FADE_THRESHOLD_SIZE 0x8128 + GL_POINT_DISTANCE_ATTENUATION 0x8129 + GL_COLOR_SUM 0x8458 + GL_CURRENT_SECONDARY_COLOR 0x8459 + GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A + GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B + GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C + GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D + GL_SECONDARY_COLOR_ARRAY 0x845E + GL_BLEND_DST_RGB 0x80C8 + GL_BLEND_SRC_RGB 0x80C9 + GL_BLEND_DST_ALPHA 0x80CA + GL_BLEND_SRC_ALPHA 0x80CB + GL_INCR_WRAP 0x8507 + GL_DECR_WRAP 0x8508 + GL_TEXTURE_FILTER_CONTROL 0x8500 + GL_TEXTURE_LOD_BIAS 0x8501 + GL_MAX_TEXTURE_LOD_BIAS 0x84FD + GL_MIRRORED_REPEAT 0x8370 + void glBlendEquation (GLenum mode) + void glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) + void glFogCoordf (GLfloat coord) + void glFogCoordfv (const GLfloat *coord) + void glFogCoordd (GLdouble coord) + void glFogCoorddv (const GLdouble *coord) + void glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer) + void glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount) + void glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount) + void glPointParameteri (GLenum pname, GLint param) + void glPointParameteriv (GLenum pname, const GLint *params) + void glPointParameterf (GLenum pname, GLfloat param) + void glPointParameterfv (GLenum pname, const GLfloat *params) + void glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue) + void glSecondaryColor3bv (const GLbyte *v) + void glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue) + void glSecondaryColor3dv (const GLdouble *v) + void glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue) + void glSecondaryColor3fv (const GLfloat *v) + void glSecondaryColor3i (GLint red, GLint green, GLint blue) + void glSecondaryColor3iv (const GLint *v) + void glSecondaryColor3s (GLshort red, GLshort green, GLshort blue) + void glSecondaryColor3sv (const GLshort *v) + void glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue) + void glSecondaryColor3ubv (const GLubyte *v) + void glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue) + void glSecondaryColor3uiv (const GLuint *v) + void glSecondaryColor3us (GLushort red, GLushort green, GLushort blue) + void glSecondaryColor3usv (const GLushort *v) + void glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer) + void glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) + void glWindowPos2d (GLdouble x, GLdouble y) + void glWindowPos2f (GLfloat x, GLfloat y) + void glWindowPos2i (GLint x, GLint y) + void glWindowPos2s (GLshort x, GLshort y) + void glWindowPos2dv (const GLdouble *p) + void glWindowPos2fv (const GLfloat *p) + void glWindowPos2iv (const GLint *p) + void glWindowPos2sv (const GLshort *p) + void glWindowPos3d (GLdouble x, GLdouble y, GLdouble z) + void glWindowPos3f (GLfloat x, GLfloat y, GLfloat z) + void glWindowPos3i (GLint x, GLint y, GLint z) + void glWindowPos3s (GLshort x, GLshort y, GLshort z) + void glWindowPos3dv (const GLdouble *p) + void glWindowPos3fv (const GLfloat *p) + void glWindowPos3iv (const GLint *p) + void glWindowPos3sv (const GLshort *p) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_1_5 b/Windows/glew/auto/core/gl/GL_VERSION_1_5 new file mode 100644 index 00000000..439ecb6a --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_1_5 @@ -0,0 +1,75 @@ +GL_VERSION_1_5 +http://www.opengl.org/documentation/specs/version1.5/glspec15.pdf + + + GL_BUFFER_SIZE 0x8764 + GL_BUFFER_USAGE 0x8765 + GL_QUERY_COUNTER_BITS 0x8864 + GL_CURRENT_QUERY 0x8865 + GL_QUERY_RESULT 0x8866 + GL_QUERY_RESULT_AVAILABLE 0x8867 + GL_ARRAY_BUFFER 0x8892 + GL_ELEMENT_ARRAY_BUFFER 0x8893 + GL_ARRAY_BUFFER_BINDING 0x8894 + GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 + GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 + GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 + GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 + GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D + GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F + GL_READ_ONLY 0x88B8 + GL_WRITE_ONLY 0x88B9 + GL_READ_WRITE 0x88BA + GL_BUFFER_ACCESS 0x88BB + GL_BUFFER_MAPPED 0x88BC + GL_BUFFER_MAP_POINTER 0x88BD + GL_STREAM_DRAW 0x88E0 + GL_STREAM_READ 0x88E1 + GL_STREAM_COPY 0x88E2 + GL_STATIC_DRAW 0x88E4 + GL_STATIC_READ 0x88E5 + GL_STATIC_COPY 0x88E6 + GL_DYNAMIC_DRAW 0x88E8 + GL_DYNAMIC_READ 0x88E9 + GL_DYNAMIC_COPY 0x88EA + GL_SAMPLES_PASSED 0x8914 + GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE + GL_FOG_COORD GL_FOG_COORDINATE + GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE + GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE + GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE + GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER + GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY + GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING + GL_SRC0_RGB GL_SOURCE0_RGB + GL_SRC1_RGB GL_SOURCE1_RGB + GL_SRC2_RGB GL_SOURCE2_RGB + GL_SRC0_ALPHA GL_SOURCE0_ALPHA + GL_SRC1_ALPHA GL_SOURCE1_ALPHA + GL_SRC2_ALPHA GL_SOURCE2_ALPHA + void glGenQueries (GLsizei n, GLuint* ids) + void glDeleteQueries (GLsizei n, const GLuint* ids) + GLboolean glIsQuery (GLuint id) + void glBeginQuery (GLenum target, GLuint id) + void glEndQuery (GLenum target) + void glGetQueryiv (GLenum target, GLenum pname, GLint* params) + void glGetQueryObjectiv (GLuint id, GLenum pname, GLint* params) + void glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint* params) + void glBindBuffer (GLenum target, GLuint buffer) + void glDeleteBuffers (GLsizei n, const GLuint* buffers) + void glGenBuffers (GLsizei n, GLuint* buffers) + GLboolean glIsBuffer (GLuint buffer) + void glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage) + void glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data) + void glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void* data) + void* glMapBuffer (GLenum target, GLenum access) + GLboolean glUnmapBuffer (GLenum target) + void glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params) + void glGetBufferPointerv (GLenum target, GLenum pname, void** params) + typedef ptrdiff_t GLsizeiptr + typedef ptrdiff_t GLintptr diff --git a/Windows/glew/auto/core/gl/GL_VERSION_2_0 b/Windows/glew/auto/core/gl/GL_VERSION_2_0 new file mode 100644 index 00000000..5bf6988b --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_2_0 @@ -0,0 +1,181 @@ +GL_VERSION_2_0 +http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf + + + GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION + GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 + GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 + GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 + GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 + GL_CURRENT_VERTEX_ATTRIB 0x8626 + GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 + GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 + GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 + GL_STENCIL_BACK_FUNC 0x8800 + GL_STENCIL_BACK_FAIL 0x8801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 + GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 + GL_MAX_DRAW_BUFFERS 0x8824 + GL_DRAW_BUFFER0 0x8825 + GL_DRAW_BUFFER1 0x8826 + GL_DRAW_BUFFER2 0x8827 + GL_DRAW_BUFFER3 0x8828 + GL_DRAW_BUFFER4 0x8829 + GL_DRAW_BUFFER5 0x882A + GL_DRAW_BUFFER6 0x882B + GL_DRAW_BUFFER7 0x882C + GL_DRAW_BUFFER8 0x882D + GL_DRAW_BUFFER9 0x882E + GL_DRAW_BUFFER10 0x882F + GL_DRAW_BUFFER11 0x8830 + GL_DRAW_BUFFER12 0x8831 + GL_DRAW_BUFFER13 0x8832 + GL_DRAW_BUFFER14 0x8833 + GL_DRAW_BUFFER15 0x8834 + GL_BLEND_EQUATION_ALPHA 0x883D + GL_POINT_SPRITE 0x8861 + GL_COORD_REPLACE 0x8862 + GL_MAX_VERTEX_ATTRIBS 0x8869 + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A + GL_MAX_TEXTURE_COORDS 0x8871 + GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 + GL_FRAGMENT_SHADER 0x8B30 + GL_VERTEX_SHADER 0x8B31 + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 + GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A + GL_MAX_VARYING_FLOATS 0x8B4B + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D + GL_SHADER_TYPE 0x8B4F + GL_FLOAT_VEC2 0x8B50 + GL_FLOAT_VEC3 0x8B51 + GL_FLOAT_VEC4 0x8B52 + GL_INT_VEC2 0x8B53 + GL_INT_VEC3 0x8B54 + GL_INT_VEC4 0x8B55 + GL_BOOL 0x8B56 + GL_BOOL_VEC2 0x8B57 + GL_BOOL_VEC3 0x8B58 + GL_BOOL_VEC4 0x8B59 + GL_FLOAT_MAT2 0x8B5A + GL_FLOAT_MAT3 0x8B5B + GL_FLOAT_MAT4 0x8B5C + GL_SAMPLER_1D 0x8B5D + GL_SAMPLER_2D 0x8B5E + GL_SAMPLER_3D 0x8B5F + GL_SAMPLER_CUBE 0x8B60 + GL_SAMPLER_1D_SHADOW 0x8B61 + GL_SAMPLER_2D_SHADOW 0x8B62 + GL_DELETE_STATUS 0x8B80 + GL_COMPILE_STATUS 0x8B81 + GL_LINK_STATUS 0x8B82 + GL_VALIDATE_STATUS 0x8B83 + GL_INFO_LOG_LENGTH 0x8B84 + GL_ATTACHED_SHADERS 0x8B85 + GL_ACTIVE_UNIFORMS 0x8B86 + GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 + GL_SHADER_SOURCE_LENGTH 0x8B88 + GL_ACTIVE_ATTRIBUTES 0x8B89 + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A + GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B + GL_SHADING_LANGUAGE_VERSION 0x8B8C + GL_CURRENT_PROGRAM 0x8B8D + GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 + GL_LOWER_LEFT 0x8CA1 + GL_UPPER_LEFT 0x8CA2 + GL_STENCIL_BACK_REF 0x8CA3 + GL_STENCIL_BACK_VALUE_MASK 0x8CA4 + GL_STENCIL_BACK_WRITEMASK 0x8CA5 + void glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha) + void glDrawBuffers (GLsizei n, const GLenum* bufs) + void glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + void glStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) + void glStencilMaskSeparate (GLenum face, GLuint mask) + void glAttachShader (GLuint program, GLuint shader) + void glBindAttribLocation (GLuint program, GLuint index, const GLchar* name) + void glCompileShader (GLuint shader) + GLuint glCreateProgram (void) + GLuint glCreateShader (GLenum type) + void glDeleteProgram (GLuint program) + void glDeleteShader (GLuint shader) + void glDetachShader (GLuint program, GLuint shader) + void glDisableVertexAttribArray (GLuint index) + void glEnableVertexAttribArray (GLuint index) + void glGetActiveAttrib (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) + void glGetActiveUniform (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) + void glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders) + GLint glGetAttribLocation (GLuint program, const GLchar* name) + void glGetProgramiv (GLuint program, GLenum pname, GLint* param) + void glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog) + void glGetShaderiv (GLuint shader, GLenum pname, GLint* param) + void glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog) + void glShaderSource (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length) + GLint glGetUniformLocation (GLuint program, const GLchar* name) + void glGetUniformfv (GLuint program, GLint location, GLfloat* params) + void glGetUniformiv (GLuint program, GLint location, GLint* params) + void glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble* params) + void glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params) + void glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer) + GLboolean glIsProgram (GLuint program) + GLboolean glIsShader (GLuint shader) + void glLinkProgram (GLuint program) + void glGetShaderSource (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source) + void glUseProgram (GLuint program) + void glUniform1f (GLint location, GLfloat v0) + void glUniform1fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform1i (GLint location, GLint v0) + void glUniform1iv (GLint location, GLsizei count, const GLint* value) + void glUniform2f (GLint location, GLfloat v0, GLfloat v1) + void glUniform2fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform2i (GLint location, GLint v0, GLint v1) + void glUniform2iv (GLint location, GLsizei count, const GLint* value) + void glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + void glUniform3fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform3i (GLint location, GLint v0, GLint v1, GLint v2) + void glUniform3iv (GLint location, GLsizei count, const GLint* value) + void glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + void glUniform4fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + void glUniform4iv (GLint location, GLsizei count, const GLint* value) + void glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glValidateProgram (GLuint program) + void glVertexAttrib1d (GLuint index, GLdouble x) + void glVertexAttrib1dv (GLuint index, const GLdouble* v) + void glVertexAttrib1f (GLuint index, GLfloat x) + void glVertexAttrib1fv (GLuint index, const GLfloat* v) + void glVertexAttrib1s (GLuint index, GLshort x) + void glVertexAttrib1sv (GLuint index, const GLshort* v) + void glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y) + void glVertexAttrib2dv (GLuint index, const GLdouble* v) + void glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y) + void glVertexAttrib2fv (GLuint index, const GLfloat* v) + void glVertexAttrib2s (GLuint index, GLshort x, GLshort y) + void glVertexAttrib2sv (GLuint index, const GLshort* v) + void glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttrib3dv (GLuint index, const GLdouble* v) + void glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z) + void glVertexAttrib3fv (GLuint index, const GLfloat* v) + void glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z) + void glVertexAttrib3sv (GLuint index, const GLshort* v) + void glVertexAttrib4Nbv (GLuint index, const GLbyte* v) + void glVertexAttrib4Niv (GLuint index, const GLint* v) + void glVertexAttrib4Nsv (GLuint index, const GLshort* v) + void glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) + void glVertexAttrib4Nubv (GLuint index, const GLubyte* v) + void glVertexAttrib4Nuiv (GLuint index, const GLuint* v) + void glVertexAttrib4Nusv (GLuint index, const GLushort* v) + void glVertexAttrib4bv (GLuint index, const GLbyte* v) + void glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttrib4dv (GLuint index, const GLdouble* v) + void glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexAttrib4fv (GLuint index, const GLfloat* v) + void glVertexAttrib4iv (GLuint index, const GLint* v) + void glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexAttrib4sv (GLuint index, const GLshort* v) + void glVertexAttrib4ubv (GLuint index, const GLubyte* v) + void glVertexAttrib4uiv (GLuint index, const GLuint* v) + void glVertexAttrib4usv (GLuint index, const GLushort* v) + void glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_2_1 b/Windows/glew/auto/core/gl/GL_VERSION_2_1 new file mode 100644 index 00000000..88ecce8f --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_2_1 @@ -0,0 +1,33 @@ +GL_VERSION_2_1 +http://www.opengl.org/documentation/specs/version2.1/glspec21.pdf + + + GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F + GL_PIXEL_PACK_BUFFER 0x88EB + GL_PIXEL_UNPACK_BUFFER 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF + GL_FLOAT_MAT2x3 0x8B65 + GL_FLOAT_MAT2x4 0x8B66 + GL_FLOAT_MAT3x2 0x8B67 + GL_FLOAT_MAT3x4 0x8B68 + GL_FLOAT_MAT4x2 0x8B69 + GL_FLOAT_MAT4x3 0x8B6A + GL_SRGB 0x8C40 + GL_SRGB8 0x8C41 + GL_SRGB_ALPHA 0x8C42 + GL_SRGB8_ALPHA8 0x8C43 + GL_SLUMINANCE_ALPHA 0x8C44 + GL_SLUMINANCE8_ALPHA8 0x8C45 + GL_SLUMINANCE 0x8C46 + GL_SLUMINANCE8 0x8C47 + GL_COMPRESSED_SRGB 0x8C48 + GL_COMPRESSED_SRGB_ALPHA 0x8C49 + GL_COMPRESSED_SLUMINANCE 0x8C4A + GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + void glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_3_0 b/Windows/glew/auto/core/gl/GL_VERSION_3_0 new file mode 100644 index 00000000..4be5db06 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_3_0 @@ -0,0 +1,164 @@ +GL_VERSION_3_0 +https://www.opengl.org/registry/doc/glspec30.20080923.pdf + +GL_ARB_framebuffer_object GL_ARB_map_buffer_range GL_ARB_uniform_buffer_object GL_ARB_vertex_array_object + GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB + GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 + GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 + GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 + GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 + GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 + GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 + GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES + GL_MAJOR_VERSION 0x821B + GL_MINOR_VERSION 0x821C + GL_NUM_EXTENSIONS 0x821D + GL_CONTEXT_FLAGS 0x821E + GL_DEPTH_BUFFER 0x8223 + GL_STENCIL_BUFFER 0x8224 + GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 + GL_RGBA32F 0x8814 + GL_RGB32F 0x8815 + GL_RGBA16F 0x881A + GL_RGB16F 0x881B + GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD + GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF + GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 + GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 + GL_CLAMP_VERTEX_COLOR 0x891A + GL_CLAMP_FRAGMENT_COLOR 0x891B + GL_CLAMP_READ_COLOR 0x891C + GL_FIXED_ONLY 0x891D + GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS + GL_TEXTURE_RED_TYPE 0x8C10 + GL_TEXTURE_GREEN_TYPE 0x8C11 + GL_TEXTURE_BLUE_TYPE 0x8C12 + GL_TEXTURE_ALPHA_TYPE 0x8C13 + GL_TEXTURE_LUMINANCE_TYPE 0x8C14 + GL_TEXTURE_INTENSITY_TYPE 0x8C15 + GL_TEXTURE_DEPTH_TYPE 0x8C16 + GL_TEXTURE_1D_ARRAY 0x8C18 + GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 + GL_TEXTURE_2D_ARRAY 0x8C1A + GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B + GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C + GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D + GL_R11F_G11F_B10F 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + GL_RGB9_E5 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E + GL_TEXTURE_SHARED_SIZE 0x8C3F + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 + GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 + GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 + GL_PRIMITIVES_GENERATED 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 + GL_RASTERIZER_DISCARD 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B + GL_INTERLEAVED_ATTRIBS 0x8C8C + GL_SEPARATE_ATTRIBS 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F + GL_RGBA32UI 0x8D70 + GL_RGB32UI 0x8D71 + GL_RGBA16UI 0x8D76 + GL_RGB16UI 0x8D77 + GL_RGBA8UI 0x8D7C + GL_RGB8UI 0x8D7D + GL_RGBA32I 0x8D82 + GL_RGB32I 0x8D83 + GL_RGBA16I 0x8D88 + GL_RGB16I 0x8D89 + GL_RGBA8I 0x8D8E + GL_RGB8I 0x8D8F + GL_RED_INTEGER 0x8D94 + GL_GREEN_INTEGER 0x8D95 + GL_BLUE_INTEGER 0x8D96 + GL_ALPHA_INTEGER 0x8D97 + GL_RGB_INTEGER 0x8D98 + GL_RGBA_INTEGER 0x8D99 + GL_BGR_INTEGER 0x8D9A + GL_BGRA_INTEGER 0x8D9B + GL_SAMPLER_1D_ARRAY 0x8DC0 + GL_SAMPLER_2D_ARRAY 0x8DC1 + GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 + GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 + GL_SAMPLER_CUBE_SHADOW 0x8DC5 + GL_UNSIGNED_INT_VEC2 0x8DC6 + GL_UNSIGNED_INT_VEC3 0x8DC7 + GL_UNSIGNED_INT_VEC4 0x8DC8 + GL_INT_SAMPLER_1D 0x8DC9 + GL_INT_SAMPLER_2D 0x8DCA + GL_INT_SAMPLER_3D 0x8DCB + GL_INT_SAMPLER_CUBE 0x8DCC + GL_INT_SAMPLER_1D_ARRAY 0x8DCE + GL_INT_SAMPLER_2D_ARRAY 0x8DCF + GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 + GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 + GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 + GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 + GL_QUERY_WAIT 0x8E13 + GL_QUERY_NO_WAIT 0x8E14 + GL_QUERY_BY_REGION_WAIT 0x8E15 + GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + void glColorMaski (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) + void glGetBooleani_v (GLenum pname, GLuint index, GLboolean* data) + void glEnablei (GLenum cap, GLuint index) + void glDisablei (GLenum cap, GLuint index) + GLboolean glIsEnabledi (GLenum cap, GLuint index) + void glBeginTransformFeedback (GLenum primitiveMode) + void glEndTransformFeedback (void) + void glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode) + void glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) + void glClampColor (GLenum target, GLenum clamp) + void glBeginConditionalRender (GLuint id, GLenum mode) + void glEndConditionalRender (void) + void glVertexAttribI1i (GLuint index, GLint v0) + void glVertexAttribI2i (GLuint index, GLint v0, GLint v1) + void glVertexAttribI3i (GLuint index, GLint v0, GLint v1, GLint v2) + void glVertexAttribI4i (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3) + void glVertexAttribI1ui (GLuint index, GLuint v0) + void glVertexAttribI2ui (GLuint index, GLuint v0, GLuint v1) + void glVertexAttribI3ui (GLuint index, GLuint v0, GLuint v1, GLuint v2) + void glVertexAttribI4ui (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glVertexAttribI1iv (GLuint index, const GLint* v0) + void glVertexAttribI2iv (GLuint index, const GLint* v0) + void glVertexAttribI3iv (GLuint index, const GLint* v0) + void glVertexAttribI4iv (GLuint index, const GLint* v0) + void glVertexAttribI1uiv (GLuint index, const GLuint* v0) + void glVertexAttribI2uiv (GLuint index, const GLuint* v0) + void glVertexAttribI3uiv (GLuint index, const GLuint* v0) + void glVertexAttribI4uiv (GLuint index, const GLuint* v0) + void glVertexAttribI4bv (GLuint index, const GLbyte* v0) + void glVertexAttribI4sv (GLuint index, const GLshort* v0) + void glVertexAttribI4ubv (GLuint index, const GLubyte* v0) + void glVertexAttribI4usv (GLuint index, const GLushort* v0) + void glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer) + void glGetVertexAttribIiv (GLuint index, GLenum pname, GLint* params) + void glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint* params) + void glGetUniformuiv (GLuint program, GLint location, GLuint* params) + void glBindFragDataLocation (GLuint program, GLuint colorNumber, const GLchar* name) + GLint glGetFragDataLocation (GLuint program, const GLchar* name) + void glUniform1ui (GLint location, GLuint v0) + void glUniform2ui (GLint location, GLuint v0, GLuint v1) + void glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2) + void glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glUniform1uiv (GLint location, GLsizei count, const GLuint* value) + void glUniform2uiv (GLint location, GLsizei count, const GLuint* value) + void glUniform3uiv (GLint location, GLsizei count, const GLuint* value) + void glUniform4uiv (GLint location, GLsizei count, const GLuint* value) + void glTexParameterIiv (GLenum target, GLenum pname, const GLint* params) + void glTexParameterIuiv (GLenum target, GLenum pname, const GLuint* params) + void glGetTexParameterIiv (GLenum target, GLenum pname, GLint* params) + void glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint* params) + void glClearBufferiv (GLenum buffer, GLint drawBuffer, const GLint* value) + void glClearBufferuiv (GLenum buffer, GLint drawBuffer, const GLuint* value) + void glClearBufferfv (GLenum buffer, GLint drawBuffer, const GLfloat* value) + void glClearBufferfi (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil) + const GLubyte* glGetStringi (GLenum name, GLuint index) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_3_1 b/Windows/glew/auto/core/gl/GL_VERSION_3_1 new file mode 100644 index 00000000..c546704e --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_3_1 @@ -0,0 +1,42 @@ +GL_VERSION_3_1 +https://www.opengl.org/registry/doc/glspec31.20090528.pdf + +GL_ARB_copy_buffer + GL_SAMPLER_2D_RECT 0x8B63 + GL_SAMPLER_2D_RECT_SHADOW 0x8B64 + GL_SAMPLER_BUFFER 0x8DC2 + GL_INT_SAMPLER_2D_RECT 0x8DCD + GL_INT_SAMPLER_BUFFER 0x8DD0 + GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 + GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 + GL_TEXTURE_BUFFER 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B + GL_TEXTURE_BINDING_BUFFER 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D + GL_TEXTURE_BUFFER_FORMAT 0x8C2E + GL_TEXTURE_RECTANGLE 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 + GL_RED_SNORM 0x8F90 + GL_RG_SNORM 0x8F91 + GL_RGB_SNORM 0x8F92 + GL_RGBA_SNORM 0x8F93 + GL_R8_SNORM 0x8F94 + GL_RG8_SNORM 0x8F95 + GL_RGB8_SNORM 0x8F96 + GL_RGBA8_SNORM 0x8F97 + GL_R16_SNORM 0x8F98 + GL_RG16_SNORM 0x8F99 + GL_RGB16_SNORM 0x8F9A + GL_RGBA16_SNORM 0x8F9B + GL_SIGNED_NORMALIZED 0x8F9C + GL_PRIMITIVE_RESTART 0x8F9D + GL_PRIMITIVE_RESTART_INDEX 0x8F9E + GL_BUFFER_ACCESS_FLAGS 0x911F + GL_BUFFER_MAP_LENGTH 0x9120 + GL_BUFFER_MAP_OFFSET 0x9121 + void glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount) + void glTexBuffer (GLenum target, GLenum internalFormat, GLuint buffer) + void glPrimitiveRestartIndex (GLuint buffer) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_3_2 b/Windows/glew/auto/core/gl/GL_VERSION_3_2 new file mode 100644 index 00000000..a987541c --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_3_2 @@ -0,0 +1,29 @@ +GL_VERSION_3_2 +https://www.opengl.org/registry/doc/glspec32.compatibility.20091207.pdf + +GL_ARB_draw_elements_base_vertex GL_ARB_provoking_vertex GL_ARB_sync GL_ARB_texture_multisample + GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 + GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 + GL_LINES_ADJACENCY 0x000A + GL_LINE_STRIP_ADJACENCY 0x000B + GL_TRIANGLES_ADJACENCY 0x000C + GL_TRIANGLE_STRIP_ADJACENCY 0x000D + GL_PROGRAM_POINT_SIZE 0x8642 + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 + GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 + GL_GEOMETRY_SHADER 0x8DD9 + GL_GEOMETRY_VERTICES_OUT 0x8916 + GL_GEOMETRY_INPUT_TYPE 0x8917 + GL_GEOMETRY_OUTPUT_TYPE 0x8918 + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 + GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 + GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 + GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 + GL_CONTEXT_PROFILE_MASK 0x9126 + void glGetInteger64i_v (GLenum pname, GLuint index, GLint64 * data) + void glGetBufferParameteri64v (GLenum target, GLenum value, GLint64 * data) + void glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_3_3 b/Windows/glew/auto/core/gl/GL_VERSION_3_3 new file mode 100644 index 00000000..a80dbcc8 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_3_3 @@ -0,0 +1,7 @@ +GL_VERSION_3_3 +https://www.opengl.org/registry/doc/glspec33.compatibility.20100311.pdf + + + GL_RGB10_A2UI 0x906F + GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE + void glVertexAttribDivisor (GLuint index, GLuint divisor) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_0 b/Windows/glew/auto/core/gl/GL_VERSION_4_0 new file mode 100644 index 00000000..3715b40f --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_0 @@ -0,0 +1,21 @@ +GL_VERSION_4_0 +https://www.opengl.org/registry/doc/glspec40.compatibility.20100311.pdf + + + GL_SAMPLE_SHADING 0x8C36 + GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F + GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F + GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B + GL_SAMPLER_CUBE_MAP_ARRAY 0x900C + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D + GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + void glMinSampleShading (GLclampf value) + void glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendEquationi (GLuint buf, GLenum mode) + void glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) + void glBlendFunci (GLuint buf, GLenum src, GLenum dst) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_1 b/Windows/glew/auto/core/gl/GL_VERSION_4_1 new file mode 100644 index 00000000..6153c276 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_1 @@ -0,0 +1,3 @@ +GL_VERSION_4_1 +https://www.opengl.org/registry/doc/glspec41.compatibility.20100725.pdf + diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_2 b/Windows/glew/auto/core/gl/GL_VERSION_4_2 new file mode 100644 index 00000000..ff12b4c5 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_2 @@ -0,0 +1,13 @@ +GL_VERSION_4_2 +https://www.opengl.org/registry/doc/glspec42.compatibility.20120427.pdf + + + GL_COPY_READ_BUFFER_BINDING 0x8F36 + GL_COPY_WRITE_BUFFER_BINDING 0x8F37 + GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 + GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 + GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_3 b/Windows/glew/auto/core/gl/GL_VERSION_4_3 new file mode 100644 index 00000000..32fc35b0 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_3 @@ -0,0 +1,6 @@ +GL_VERSION_4_3 +https://www.opengl.org/registry/doc/glspec43.compatibility.20130214.pdf + + + GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_4 b/Windows/glew/auto/core/gl/GL_VERSION_4_4 new file mode 100644 index 00000000..cf6416ef --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_4 @@ -0,0 +1,8 @@ +GL_VERSION_4_4 +https://www.opengl.org/registry/doc/glspec44.compatibility.pdf + + + GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 + GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 + GL_TEXTURE_BUFFER_BINDING 0x8C2A + diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_5 b/Windows/glew/auto/core/gl/GL_VERSION_4_5 new file mode 100644 index 00000000..1ecda61f --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_5 @@ -0,0 +1,9 @@ +GL_VERSION_4_5 +https://www.opengl.org/registry/doc/glspec45.compatibility.pdf + + + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 + GLenum glGetGraphicsResetStatus (void) + void glGetnTexImage (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels) + void glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels) + void glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params) diff --git a/Windows/glew/auto/core/gl/GL_VERSION_4_6 b/Windows/glew/auto/core/gl/GL_VERSION_4_6 new file mode 100644 index 00000000..2efe9181 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_VERSION_4_6 @@ -0,0 +1,29 @@ +GL_VERSION_4_6 +https://www.opengl.org/registry/doc/glspec46.compatibility.pdf + + + GL_PARAMETER_BUFFER 0x80EE + GL_PARAMETER_BUFFER_BINDING 0x80EF + GL_VERTICES_SUBMITTED 0x82EE + GL_PRIMITIVES_SUBMITTED 0x82EF + GL_VERTEX_SHADER_INVOCATIONS 0x82F0 + GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 + GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 + GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 + GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 + GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 + GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 + GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 + GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC + GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED + GL_POLYGON_OFFSET_CLAMP 0x8E1B + GL_TEXTURE_MAX_ANISOTROPY 0x84FE + GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF + GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 + GL_SPIR_V_BINARY 0x9552 + GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 + GL_SPIR_V_EXTENSIONS 0x9553 + GL_NUM_SPIR_V_EXTENSIONS 0x9554 + void glMultiDrawArraysIndirectCount (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) + void glMultiDrawElementsIndirectCount (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) + void glSpecializeShader (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue) diff --git a/Windows/glew/auto/core/gl/GL_WIN_swap_hint b/Windows/glew/auto/core/gl/GL_WIN_swap_hint new file mode 100644 index 00000000..9bb490b4 --- /dev/null +++ b/Windows/glew/auto/core/gl/GL_WIN_swap_hint @@ -0,0 +1,5 @@ +GL_WIN_swap_hint +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_16zy.asp +GL_WIN_swap_hint + + void glAddSwapHintRectWIN (GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/core/gl/WGL_ARB_create_context b/Windows/glew/auto/core/gl/WGL_ARB_create_context new file mode 100644 index 00000000..7e7c163d --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_ARB_create_context @@ -0,0 +1,13 @@ +WGL_ARB_create_context +http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt +WGL_ARB_create_context + + WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 + WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 + WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 + WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 + WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 + WGL_CONTEXT_FLAGS_ARB 0x2094 + ERROR_INVALID_VERSION_ARB 0x2095 + ERROR_INVALID_PROFILE_ARB 0x2096 + HGLRC wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int* attribList) diff --git a/Windows/glew/auto/core/gl/WGL_ATI_render_texture_rectangle b/Windows/glew/auto/core/gl/WGL_ATI_render_texture_rectangle new file mode 100644 index 00000000..aba7be14 --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_ATI_render_texture_rectangle @@ -0,0 +1,5 @@ +WGL_ATI_render_texture_rectangle + +WGL_ATI_render_texture_rectangle + + WGL_TEXTURE_RECTANGLE_ATI 0x21A5 diff --git a/Windows/glew/auto/core/gl/WGL_EXT_create_context_es2_profile b/Windows/glew/auto/core/gl/WGL_EXT_create_context_es2_profile new file mode 100644 index 00000000..3105737e --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_EXT_create_context_es2_profile @@ -0,0 +1,5 @@ +WGL_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es2_profile.txt +WGL_EXT_create_context_es2_profile + + WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/core/gl/WGL_EXT_create_context_es_profile b/Windows/glew/auto/core/gl/WGL_EXT_create_context_es_profile new file mode 100644 index 00000000..5c7ce7e1 --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_EXT_create_context_es_profile @@ -0,0 +1,5 @@ +WGL_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es_profile.txt +WGL_EXT_create_context_es_profile + + WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/core/gl/WGL_EXT_framebuffer_sRGB b/Windows/glew/auto/core/gl/WGL_EXT_framebuffer_sRGB new file mode 100644 index 00000000..5f2f5b86 --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_EXT_framebuffer_sRGB @@ -0,0 +1,5 @@ +WGL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +WGL_EXT_framebuffer_sRGB + + WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 diff --git a/Windows/glew/auto/core/gl/WGL_EXT_pixel_format_packed_float b/Windows/glew/auto/core/gl/WGL_EXT_pixel_format_packed_float new file mode 100644 index 00000000..662a993b --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_EXT_pixel_format_packed_float @@ -0,0 +1,5 @@ +WGL_EXT_pixel_format_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +WGL_EXT_pixel_format_packed_float + + WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 diff --git a/Windows/glew/auto/core/gl/WGL_NV_gpu_affinity b/Windows/glew/auto/core/gl/WGL_NV_gpu_affinity new file mode 100644 index 00000000..61ed3f1e --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_NV_gpu_affinity @@ -0,0 +1,13 @@ +WGL_NV_gpu_affinity +http://developer.download.nvidia.com/opengl/specs/WGL_nv_gpu_affinity.txt +WGL_NV_gpu_affinity + + WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 + WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + BOOL wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu) + BOOL wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice) + HDC wglCreateAffinityDCNV (const HGPUNV *phGpuList) + BOOL wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu) + BOOL wglDeleteDCNV (HDC hdc) + DECLARE_HANDLE(HGPUNV); + typedef struct _GPU_DEVICE { DWORD cb; CHAR DeviceName[32]; CHAR DeviceString[128]; DWORD Flags; RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; diff --git a/Windows/glew/auto/core/gl/WGL_NV_vertex_array_range b/Windows/glew/auto/core/gl/WGL_NV_vertex_array_range new file mode 100644 index 00000000..27b43ce2 --- /dev/null +++ b/Windows/glew/auto/core/gl/WGL_NV_vertex_array_range @@ -0,0 +1,6 @@ +WGL_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +WGL_NV_vertex_array_range + + void * wglAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void wglFreeMemoryNV (void *pointer) diff --git a/Windows/glew/auto/custom.txt b/Windows/glew/auto/custom.txt new file mode 100644 index 00000000..b797b958 --- /dev/null +++ b/Windows/glew/auto/custom.txt @@ -0,0 +1,7 @@ +WGL_ARB_extensions_string +WGL_EXT_extensions_string +WGL_ARB_pixel_format +WGL_ARB_pbuffer +WGL_NV_float_buffer +WGL_ATI_pixel_format_float +WGL_ARB_multisample diff --git a/Windows/glew/auto/doc/advanced.html b/Windows/glew/auto/doc/advanced.html new file mode 100644 index 00000000..740a7976 --- /dev/null +++ b/Windows/glew/auto/doc/advanced.html @@ -0,0 +1,130 @@ +<h2>Automatic Code Generation</h2> + +<p> +Starting from release 1.1.0, the source code and parts of the +documentation are automatically generated from the extension +specifications in a two-step process. In the first step, +specification files from the OpenGL registry are downloaded and +parsed. Skeleton descriptors are created for each extension. These +descriptors contain all necessary information for creating the source +code and documentation in a simple and compact format, including the +name of the extension, url link to the specification, tokens, function +declarations, typedefs and struct definitions. In the second step, +the header files as well as the library and glewinfo source are +generated from the descriptor files. The code generation scripts are +located in the <tt>auto</tt> subdirectory. +</p> + +<p> +The code generation scripts require GNU make, wget, and perl. On +Windows, the simplest way to get access to these tools is to install +<a href="http://www.cygwin.com/">Cygwin</a>, but make sure that the +root directory is mounted in binary mode. The makefile in the +<tt>auto</tt> directory provides the following build targets: +</p> + +<table border=0 cellpadding=0 cellspacing=5> +<tr><td align="left" valign="top"><tt>make</tt></td> +<td align=left>Create the source files from the descriptors.<br/> If the +descriptors do not exist, create them from the spec files.<br/> If the spec +files do not exist, download them from the OpenGL repository.</td></tr> +<tr><td align="left" valign="top"><tt>make clean</tt></td> +<td align=left>Delete the source files.</td></tr> +<tr><td align="left" valign="top"><tt>make clobber</tt></td> +<td align=left>Delete the source files and the descriptors.</td></tr> +<tr><td align="left" valign="top"><tt>make destroy</tt></td> +<td align=left>Delete the source files, the descriptors, and the spec files.</td></tr> +<tr><td align="left" valign="top"><tt>make custom</tt></td> +<td align=left>Create the source files for the extensions +listed in <tt>auto/custom.txt</tt>.<br/> See "Custom Code +Generation" below for more details.</td></tr> +</table> + +<h3>Adding a New Extension</h3> + +<p> +To add a new extension, create a descriptor file for the extension in +<tt>auto/core</tt> and rerun the code generation scripts by typing +<tt>make clean; make</tt> in the <tt>auto</tt> directory. +</p> + +<p> +The format of the descriptor file is given below. Items in +brackets are optional. +</p> + +<p class="pre"> +<Extension Name><br> +[<URL of Specification File>]<br> +    [<Token Name> <Token Value>]<br> +    [<Token Name> <Token Value>]<br> +    ...<br> +    [<Typedef>]<br> +    [<Typedef>]<br> +    ...<br> +    [<Function Signature>]<br> +    [<Function Signature>]<br> +    ...<br> +<!--     [<Function Definition>]<br> +    [<Function Definition>]<br> +    ...<br> --> +</p> + +<!-- +<p> +Note that <tt>Function Definitions</tt> are copied to the header files +without changes and have to be terminated with a semicolon. In +contrast, <tt>Tokens</tt>, <tt>Function signatures</tt>, and +<tt>Typedefs</tt> should not be terminated with a semicolon. +</p> +--> + +<p> +Take a look at one of the files in <tt>auto/core</tt> for an +example. Note that typedefs and function signatures should not be +terminated with a semicolon. +</p> + +<h3>Custom Code Generation</h3> +<p> +Starting from GLEW 1.3.0, it is possible to control which extensions +to include in the libarary by specifying a list in +<tt>auto/custom.txt</tt>. This is useful when you do not need all the +extensions and would like to reduce the size of the source files. +Type <tt>make clean; make custom</tt> in the <tt>auto</tt> directory +to rerun the scripts with the custom list of extensions. +</p> + +<p> +For example, the following is the list of extensions needed to get GLEW and the +utilities to compile. +</p> + +<p class="pre"> +WGL_ARB_extensions_string<br> +WGL_ARB_multisample<br> +WGL_ARB_pixel_format<br> +WGL_ARB_pbuffer<br> +WGL_EXT_extensions_string<br> +WGL_ATI_pixel_format_float<br> +WGL_NV_float_buffer<br> +</p> + +<h2>Separate Namespace</h2> + +<p> +To avoid name clashes when linking with libraries that include the +same symbols, extension entry points are declared in a separate +namespace (release 1.1.0 and up). This is achieved by aliasing OpenGL +function names to their GLEW equivalents. For instance, +<tt>glFancyFunction</tt> is simply an alias to +<tt>glewFancyFunction</tt>. The separate namespace does not effect +token and function pointer definitions. +</p> + +<h2>Known Issues</h2> + +<p> +GLEW requires GLX 1.2 for compatibility with GLUT. +</p> + diff --git a/Windows/glew/auto/doc/basic.html b/Windows/glew/auto/doc/basic.html new file mode 100644 index 00000000..693575ba --- /dev/null +++ b/Windows/glew/auto/doc/basic.html @@ -0,0 +1,180 @@ +<h2>Initializing GLEW</h2> +<p> +First you need to create a valid OpenGL rendering context and call +<tt>glewInit()</tt> to initialize the extension entry points. If +<tt>glewInit()</tt> returns <tt>GLEW_OK</tt>, the initialization +succeeded and you can use the available extensions as well as core +OpenGL functionality. For example: +</p> + +<p class="pre"> +#include <GL/glew.h><br> +#include <GL/glut.h><br> +...<br> +glutInit(&argc, argv);<br> +glutCreateWindow("GLEW Test");<br> +GLenum err = glewInit();<br> +if (GLEW_OK != err)<br> +{<br> +  /* Problem: glewInit failed, something is seriously wrong. */<br> +  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));<br> +  ...<br> +}<br> +fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));<br> +</p> + +<h2>Checking for Extensions</h2> + +<p> +Starting from GLEW 1.1.0, you can find out if a particular extension +is available on your platform by querying globally defined variables +of the form <tt>GLEW_{extension_name}</tt>: +</p> + +<p class="pre"> +if (GLEW_ARB_vertex_program)<br> +{<br> +  /* It is safe to use the ARB_vertex_program extension here. */<br> +  glGenProgramsARB(...);<br> +}<br> +</p> + +<p> +<b>In GLEW 1.0.x, a global structure was used for this task. To ensure +binary compatibility between releases, the struct was replaced with a +set of variables.</b> +</p> + +<p> +You can also check for core OpenGL functionality. For example, to +see if OpenGL 1.3 is supported, do the following: +</p> + +<p class="pre"> +if (GLEW_VERSION_1_3)<br> +{<br> +  /* Yay! OpenGL 1.3 is supported! */<br> +}<br> +</p> + +<p> +In general, you can check if <tt>GLEW_{extension_name}</tt> or +<tt>GLEW_VERSION_{version}</tt> is true or false. +</p> + +<p> +It is also possible to perform extension checks from string +input. Starting from the 1.3.0 release, use <tt>glewIsSupported</tt> +to check if the required core or extension functionality is +available: +</p> + +<p class="pre"> +if (glewIsSupported("GL_VERSION_1_4  GL_ARB_point_sprite"))<br> +{<br> +  /* Great, we have OpenGL 1.4 + point sprites. */<br> +}<br> +</p> + +<p> +For extensions only, <tt>glewGetExtension</tt> provides a slower alternative +(GLEW 1.0.x-1.2.x). <b>Note that in the 1.3.0 release </b> +<tt>glewGetExtension</tt> <b>was replaced with </b> +<tt>glewIsSupported</tt>. +</p> + +<p class="pre"> +if (glewGetExtension("GL_ARB_fragment_program"))<br> +{<br> +  /* Looks like ARB_fragment_program is supported. */<br> +}<br> +</p> + +<h2>Experimental Drivers</h2> + +<p> +GLEW obtains information on the supported extensions from the graphics +driver. Experimental or pre-release drivers, however, might not +report every available extension through the standard mechanism, in +which case GLEW will report it unsupported. To circumvent this +situation, the <tt>glewExperimental</tt> global switch can be turned +on by setting it to <tt>GL_TRUE</tt> before calling +<tt>glewInit()</tt>, which ensures that all extensions with valid +entry points will be exposed. +</p> + +<h2>Platform Specific Extensions</h2> + +<p> +Platform specific extensions are separated into two header files: +<tt>wglew.h</tt> and <tt>glxew.h</tt>, which define the available +<tt>WGL</tt> and <tt>GLX</tt> extensions. To determine if a certain +extension is supported, query <tt>WGLEW_{extension name}</tt> or +<tt>GLXEW_{extension_name}</tt>. For example: +</p> + +<p class="pre"> +#include <GL/wglew.h><br> +<br> +if (WGLEW_ARB_pbuffer)<br> +{<br> +  /* OK, we can use pbuffers. */<br> +}<br> +else<br> +{<br> +  /* Sorry, pbuffers will not work on this platform. */<br> +}<br> +</p> + +<p> +Alternatively, use <tt>wglewIsSupported</tt> or +<tt>glxewIsSupported</tt> to check for extensions from a string: +</p> + +<p class="pre"> +if (wglewIsSupported("WGL_ARB_pbuffer"))<br> +{<br> +  /* OK, we can use pbuffers. */<br> +}<br> +</p> + +<h2>Utilities</h2> + +<p> +GLEW provides two command-line utilities: one for creating a list of +available extensions and visuals; and another for verifying extension +entry points. +</p> + +<h3>visualinfo: extensions and visuals</h3> + +<p> +<tt>visualinfo</tt> is an extended version of <tt>glxinfo</tt>. The +Windows version creates a file called <tt>visualinfo.txt</tt>, which +contains a list of available OpenGL, WGL, and GLU extensions as well +as a table of visuals aka. pixel formats. Pbuffer and MRT capable +visuals are also included. For additional usage information, type +<tt>visualinfo -h</tt>. +</p> + +<h3>glewinfo: extension verification utility</h3> + +<p> +<tt>glewinfo</tt> allows you to verify the entry points for the +extensions supported on your platform. The Windows version +reports the results to a text file called <tt>glewinfo.txt</tt>. The +Unix version prints the results to <tt>stdout</tt>. +</p> + +<p>Windows usage:</p> + <blockquote><pre>glewinfo [-pf <id>]</pre></blockquote> + +<p>where <tt><id></tt> is the pixel format id for which the +capabilities are displayed.</p> + +<p>Unix usage:</p> +<blockquote><pre>glewinfo [-display <dpy>] [-visual <id>]</pre></blockquote> + +<p>where <tt><dpy></tt> is the X11 display and <tt><id></tt> is +the visual id for which the capabilities are displayed.</p> + diff --git a/Windows/glew/auto/doc/build.html b/Windows/glew/auto/doc/build.html new file mode 100644 index 00000000..467a7f3c --- /dev/null +++ b/Windows/glew/auto/doc/build.html @@ -0,0 +1,49 @@ +<h2>Building GLEW</h2> + +<h3>Windows</h3> + +<p>A MS Visual Studio project is provided in the <tt>build/vc6</tt> directory.</p> +<p>Pre-built shared and static libraries are also available for <a href="index.html">download</a>.</p> + +<h3>Makefile</h3> + +<p>For platforms other than MS Windows, the provided <tt>Makefile</tt> is used.</p> + +<h4>Command-line variables</h4> + +<table border=0 cellpadding=0 cellspacing=10> +<tr><td valign=top><tt>SYSTEM</tt></td><td valign=top>auto</td> +<td align=left>Target system to build: darwin, linux, solaris, etc.<br/>For a full list of supported targets: <tt>ls config/Makefile.*</tt><br/> +<a href="http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree">config.guess</a> is used to auto detect, as necessary.</td></tr> +<tr><td valign=top><tt>GLEW_DEST</tt></td><td valign=top><tt>/usr</tt></td> +<td align=left>Base directory for installation.</td></tr> +</table> + +<h4>Make targets</h4> + +<table border=0 cellpadding=0 cellspacing=10> +<tr><td valign=top><tt>all</tt></td><td>Build everything.</td><tr> +<tr><td valign=top><tt>glew.lib</tt></td><td>Build static and dynamic GLEW libraries.</td><tr> +<tr><td valign=top><tt>glew.lib.mx</tt></td><td>Build static and dynamic GLEWmx libraries.</td><tr> +<tr><td valign=top><tt>glew.bin</tt></td><td>Build <tt>glewinfo</tt> and <tt>visualinfo</tt> utilities.</td><tr> +<tr><td valign=top><tt>clean</tt></td><td>Delete temporary and built files.</td><tr> +<tr><td valign=top><tt>install.all</tt></td><td>Install everything.</td><tr> +<tr><td valign=top><tt>install</tt></td><td>Install GLEW libraries.</td><tr> +<tr><td valign=top><tt>install.mx</tt></td><td>Install GLEWmx libraries.</td><tr> +<tr><td valign=top><tt>install.bin</tt></td><td>Install <tt>glewinfo</tt> and <tt>visualinfo</tt> utilities.</td><tr> +<tr><td valign=top><tt>uninstall</tt></td><td>Delete installed files.</td><tr> +</table> + +<h4>Requirements</h4> + +<ul> +<li>GNU make</li> +<li>perl</li> +<li>wget</li> +<li>GNU sed</li> +<li>gcc compiler</li> +<li>git</li> +</ul> + +Ubuntu: <pre>sudo apt-get install libXmu-dev libXi-dev libgl-dev dos2unix git wget</pre> +Fedora: <pre>sudo yum install libXmu-devel libXi-devel libGL-devel dos2unix git wget</pre> diff --git a/Windows/glew/auto/doc/credits.html b/Windows/glew/auto/doc/credits.html new file mode 100644 index 00000000..6c36de08 --- /dev/null +++ b/Windows/glew/auto/doc/credits.html @@ -0,0 +1,2 @@ +<p><a href="https://github.com/nigels-com/glew#copyright-and-licensing"> +Author, copyright and licensing information</a> on github.</p> diff --git a/Windows/glew/auto/doc/index.html b/Windows/glew/auto/doc/index.html new file mode 100644 index 00000000..13f4c987 --- /dev/null +++ b/Windows/glew/auto/doc/index.html @@ -0,0 +1,112 @@ +<p> +The OpenGL Extension Wrangler Library (GLEW) is a cross-platform +open-source C/C++ extension loading library. GLEW provides efficient +run-time mechanisms for determining which OpenGL extensions are +supported on the target platform. OpenGL core and extension +functionality is exposed in a single header file. GLEW has been +tested on a variety of operating systems, including Windows, Linux, +Mac OS X, FreeBSD, Irix, and Solaris. +</p> + +<h2>Downloads</h2> +<p> +<a href="http://sourceforge.net/projects/glew/">GLEW</a> is distributed +as source and precompiled binaries.<br/> +The latest release is +<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">2.1.0</a>[07-31-17]: +</p> +<p> +</p> +<p> +<table border="1" cellpadding="5" cellspacing="0" bgcolor="#f0f0f0" align="center"> +<tr> +<td> +<table border="0" cellpadding="3" cellspacing="0"> +<tr> +<td></td> +<td align="right"><b>Source</b></td> +<td></td> +<td align="left"> +<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip/download">ZIP</a> |  +<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download">TGZ</a></td> +<td></td> +</tr> +<tr> +<td></td> +<td align="right"><b>Binaries</b></td> +<td></td> +<td align="left"> +<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download">Windows 32-bit and 64-bit</a> +</td> +<td></td> +</tr> +</table> +</tr> +</table> + +<p></p> +<p> +An up-to-date copy is also available using <a href="http://git-scm.com/">git</a>: +</p> +<ul> +<li><a href="https://github.com/nigels-com/glew">github</a><br/> +<tt>git clone https://github.com/nigels-com/glew.git glew</tt><br/> </li> +</ul> + +<h2>Supported Extensions</h2> +<p> +The latest release contains support for OpenGL 4.6, compatibility and forward-compatible contexts and the following extensions: +</p> +<ul> +<li><a href="glew.html">OpenGL extensions</a> +<li><a href="wglew.html">WGL extensions</a> +<li><a href="glxew.html">GLX extensions</a> +</ul> + +<h2>News</h2> +<ul> +<li>[07-31-17] <a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">GLEW 2.1.0</a> adds support for OpenGL 4.6, new extensions and minor bug fixes</li> +<li>[07-24-16] <a href="https://sourceforge.net/projects/glew/files/glew/2.0.0/">GLEW 2.0.0</a> adds support for forward-compatible contexts, adds new extensions, OSMesa and EGL support, MX discontinued and minor bug fixes</li> +<li>[08-10-15] <a href="https://sourceforge.net/projects/glew/files/glew/1.13.0/">GLEW 1.13.0</a> adds support for new extensions, fixes minor bugs</li> +<li>[26-01-15] <a href="https://sourceforge.net/projects/glew/files/glew/1.12.0/">GLEW 1.12.0</a> fixes minor bugs and adds new extensions</li> +<li>[08-11-14] <a href="https://sourceforge.net/projects/glew/files/glew/1.11.0/">GLEW 1.11.0</a> adds support for OpenGL 4.5, new extensions</li> +<li>[07-22-13] <a href="https://sourceforge.net/projects/glew/files/glew/1.10.0/">GLEW 1.10.0</a> adds support for OpenGL 4.4, new extensions</li> +<li>[08-06-12] <a href="https://sourceforge.net/projects/glew/files/glew/1.9.0/">GLEW 1.9.0</a> adds support for OpenGL 4.3, new extensions</li> +<li>[07-17-12] <a href="https://sourceforge.net/projects/glew/files/glew/1.8.0/">GLEW 1.8.0</a> fixes minor bugs and adds new extensions</li> +<li>[08-26-11] <a href="https://sourceforge.net/projects/glew/files/glew/1.7.0/">GLEW 1.7.0</a> adds support for OpenGL 4.2, new extensions, fixes bugs</li> +<li>[04-27-11] <a href="https://sourceforge.net/projects/glew/files/glew/1.6.0/">GLEW 1.6.0</a> fixes minor bugs and adds eight new extensions</li> +<li>[01-31-11] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.8/">GLEW 1.5.8</a> fixes minor bugs and adds two new extensions</li> +<li>[11-03-10] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.7/">GLEW 1.5.7</a> fixes minor bugs and adds one new extension</li> +<li>[09-07-10] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.6/">GLEW 1.5.6</a> adds support for OpenGL 4.1, fixes bugs</li> +<li>[07-13-10] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.5/">GLEW 1.5.5</a> fixes minor bugs and adds new extensions</li> +<li>[04-21-10] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.4/">GLEW 1.5.4</a> adds support for OpenGL 3.3, OpenGL 4.0 and new extensions, fixes bugs</li> +<li>[02-28-10] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.3/">GLEW 1.5.3</a> fixes minor bugs and adds three new extensions</li> +<li>[12-31-09] <a href="https://sourceforge.net/projects/glew/files/glew/1.5.2/">GLEW 1.5.2</a> adds support for OpenGL 3.1, OpenGL 3.2 and new extensions</li> +<li>[11-03-08] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=637800">GLEW 1.5.1</a> adds support for OpenGL 3.0 and 31 new extensions</li> +<li>[12-27-07] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=564464">GLEW 1.5.0</a> is released under less restrictive licenses</li> +<li>[04-27-07] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=504079">GLEW 1.4.0</a> is released</li> +<li>[03-08-07] GLEW is included in the <a href="http://developer.nvidia.com/object/sdk_home.html">NVIDIA OpenGL SDK</a></li> +<li>[03-04-07] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=491113">GLEW 1.3.6</a> is released</li> +<li>[02-28-07] <a href="http://glew.svn.sourceforge.net/svnroot/glew/trunk/glew/">Repository</a> is migrated to SVN</li> +<li>[02-25-07] GLEW is included in the <a href="http://www.opengl.org/sdk/">OpenGL SDK</a></li> +<li>[11-21-06] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=465334">GLEW 1.3.5</a> adds OpenGL 2.1 and NVIDIA G80 extensions</li> +<li>[03-04-06] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=398455">GLEW 1.3.4</a> adds support for five new extensions</li> +<li>[05-16-05] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=327647">GLEW 1.3.3</a> is released</li> +<li>[03-16-05] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=313345">GLEW 1.3.2</a> adds support for GL_APPLE_pixel_buffer</li> +<li>[02-11-05] <a href="http://gljava.sourceforge.net/">gljava</a> and <a href="http://sdljava.sourceforge.net/">sdljava</a> provide a Java binding to OpenGL via GLEW</li> +<li>[02-02-05] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=302049">GLEW 1.3.1</a> adds support for <a href="http://www.opengl.org/documentation/extensions/EXT_framebuffer_object.txt">GL_EXT_framebuffer_object</a></li> +<li>[01-04-05] <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=294527">GLEW 1.3.0</a> adds core OpenGL 2.0 support plus many enhancements</li> +<li>[12-22-04] <a href="http://glewpy.sf.net/">GLEWpy</a> Python wrapper announced</li> +<li>[12-12-04] <a href="https://sourceforge.net/mail/?group_id=67586">Mailing lists</a> created on sourceforge</li> +<li>[12-06-04] <a href="http://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942&release_id=287948">GLEW 1.2.5</a> adds new extensions and support for FreeBSD</li> +</ul> + +<h2>Links</h2> +<ul> +<li><a href="http://www.opengl.org/sdk/">OpenGL Software Development Kit</a></li> +<li><a href="http://www.opengl.org/registry/">OpenGL Extension Registry</a></li> +<li><a href="https://www.opengl.org/wiki/OpenGL_Extension">OpenGL Wiki: Extensions</a></li> +<li><a href="http://developer.nvidia.com/nvidia-opengl-specs">NVIDIA OpenGL Extension Specifications</a></li> +<li><a href="http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGLExtensionsGuide/Reference/reference.html">Apple OpenGL Extensions Guide</a></li> +</ul> + diff --git a/Windows/glew/auto/doc/install.html b/Windows/glew/auto/doc/install.html new file mode 100644 index 00000000..448aafd8 --- /dev/null +++ b/Windows/glew/auto/doc/install.html @@ -0,0 +1,126 @@ +<h2>Installation</h2> + +<p> +To use the shared library version of GLEW, you need to copy the +headers and libraries into their destination directories. On Windows +this typically boils down to copying: +</p> + +<table border="0" cellpadding="0" cellspacing="0" align="center"> <!-- bgcolor="#f0f0f0" --> +<tr><td align="left"><tt>bin/glew32.dll</tt></td><td>    to    </td> +<td align="left"><tt>%SystemRoot%/system32</tt></td></tr> +<tr><td align="left"><tt>lib/glew32.lib</tt></td><td>    to    </td> +<td align="left"><tt>{VC Root}/Lib</tt></td></tr> +<tr><td align="left"><tt>include/GL/glew.h</tt></td><td>    to    </td> +<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr> +<tr><td align="left"><tt>include/GL/wglew.h</tt></td><td>    to    </td> +<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr> +</table> +<p> +</p> + +<p> +where <tt>{VC Root}</tt> is the Visual C++ root directory, typically +<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual +Studio 6.0 or <tt>C:/Program Files/Microsoft Visual +Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET. +</p> + +<p> +On Unix, typing <tt>make install</tt> will attempt to install GLEW +into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>. You can +customize the installation target via the <tt>GLEW_DEST</tt> +environment variable if you do not have write access to these +directories. +</p> + +<h2>Building Your Project with GLEW</h2> +<p> +There are two ways to build your project with GLEW. +</p> +<h3>Including the source files / project file</h3> +<p> +The simpler but less flexible way is to include <tt>glew.h</tt> and +<tt>glew.c</tt> into your project. On Windows, you also need to +define the <tt>GLEW_STATIC</tt> preprocessor token when building a +static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor +token when building a dll. You also need to replace +<tt><GL/gl.h></tt> and <tt><GL/glu.h></tt> with +<tt><glew.h></tt> in your code and set the appropriate include +flag (<tt>-I</tt>) to tell the compiler where to look for it. For +example: +</p> +<p class="pre"> +#include <glew.h><br> +#include <GL/glut.h><br> +<gl, glu, and glut functionality is available here><br> +</p> +<p> +Depending on where you put <tt>glew.h</tt> you may also need to change +the include directives in <tt>glew.c</tt>. Note that if you are using +GLEW together with GLUT, you have to include <tt>glew.h</tt> first. +In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not +need to include it separately. +</p> +<p> +On Windows, you also have the option of adding the supplied project +file <tt>glew_static.dsp</tt> to your workspace (solution) and compile +it together with your other projects. In this case you also need to +change the <tt>GLEW_BUILD</tt> preprocessor constant to +<tt>GLEW_STATIC</tt> when building a static library or executable, +otherwise you get build errors. +</p> +<p> +<b>Note that GLEW does not use the C +runtime library, so it does not matter which version (single-threaded, +multi-threaded or multi-threaded DLL) it is linked with (without +debugging information). It is, however, always a good idea to compile all +your projects including GLEW with the same C runtime settings.</b> +</p> + +<h3>Using GLEW as a shared library</h3> + +<p> +Alternatively, you can use the provided project files / makefile to +build a separate shared library you can link your projects with later. +In this case the best practice is to install <tt>glew.h</tt>, +<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to +where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and +<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located. Note that you +need administrative privileges to do this. If you do not have +administrator access and your system administrator will not do it for +you, you can install GLEW into your own lib and include subdirectories +and tell the compiler where to find it. Then you can just replace +<tt><GL/gl.h></tt> with <tt><GL/glew.h></tt> in your +program: +</p> + +<p class="pre"> +#include <GL/glew.h><br> +#include <GL/glut.h><br> +<gl, glu, and glut functionality is available here><br> +</p> + +<p> +or: +</p> + +<p class="pre"> +#include <GL/glew.h><br> +<gl and glu functionality is available here><br> +</p> + +<p> +Remember to link your project with <tt>glew32.lib</tt>, +<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and +<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on +Unix (<tt>-lGLEW -lGLU -lGL</tt>). +</p> + +<p> +It is important to keep in mind that <tt>glew.h</tt> includes neither +<tt>windows.h</tt> nor <tt>gl.h</tt>. Also, GLEW will warn you by +issuing a preprocessor error in case you have included <tt>gl.h</tt>, +<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>. +</p> + diff --git a/Windows/glew/auto/doc/log.html b/Windows/glew/auto/doc/log.html new file mode 100644 index 00000000..e6593383 --- /dev/null +++ b/Windows/glew/auto/doc/log.html @@ -0,0 +1,1136 @@ +<h2>Change Log</h2> + +<hr align="center"> +<ul class="none"> +<li><b>2.1.0</b> [07-31-17] +<ul> +<li> Enhancements: +<ul> +<li> OpenGL 4.6 support added +<li> Improved Mac OSX build support +<li> Improved cmake build support +</ul> +</ul> + +<ul> +<li> Bug fixes: +<ul> +<li> Resovled crash when glXGetCurrentDisplay() is NULL +<li> CMake: only install PDB files with MSVC +<li> wglGetProcAddress crash with NOGDI defined +<li> Mac: using -Os rather than -O2 +</ul> +</ul> + +<ul> +<li> New extensions: +<ul> +<li> GL_AMD_gpu_shader_half_float +<li> GL_AMD_shader_ballot +<li> GL_ARB_gl_spirv +<li> GL_EGL_KHR_context_flush_control +<li> GL_INTEL_conservative_rasterization +<li> GL_MESA_shader_integer_functions +<li> GL_NVX_blend_equation_advanced_multi_draw_buffers +<li> GL_NV_gpu_multicast +<li> EGL_ARM_implicit_external_sync +<li> EGL_EXT_gl_colorspace_bt2020_linear +<li> EGL_EXT_gl_colorspace_bt2020_pq +<li> EGL_EXT_gl_colorspace_scrgb_linear +<li> EGL_EXT_image_dma_buf_import_modifiers +<li> EGL_EXT_pixel_format_float +<li> EGL_EXT_surface_SMPTE2086_metadata +<li> EGL_KHR_context_flush_control +<li> EGL_KHR_no_config_context +<li> EGL_KHR_stream_attrib +<li> EGL_MESA_platform_surfaceless +<li> EGL_NV_stream_cross_display +<li> EGL_NV_stream_cross_object +<li> EGL_NV_stream_cross_partition +<li> EGL_NV_stream_cross_process +<li> EGL_NV_stream_cross_system +<li> EGL_NV_stream_fifo_next +<li> EGL_NV_stream_fifo_synchronous +<li> EGL_NV_stream_frame_limits +<li> EGL_NV_stream_remote +<li> EGL_NV_stream_reset +<li> EGL_NV_stream_socket +<li> EGL_NV_stream_socket_inet +<li> EGL_NV_stream_socket_unix +<li> WGL_EXT_colorspace +</ul> +</ul> + +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>2.0.0</b> [07-24-16] +<ul> +<li> Enhancements: +<ul> +<li> Forward context support added +<li> OSMesa support added +<li> EGL support added +<li> MX support discontinued +<li> Improved cmake build support +</ul> +</ul> +<ul> +<li> New extensions: +<ul> +<li> GL_AMD_shader_explicit_vertex_parameter +<li> GL_ARB_gl_spirv +<li> GL_EGL_NV_robustness_video_memory_purge +<li> GL_EXT_window_rectangles +<li> GL_INTEL_conservative_rasterization +<li> GL_KHR_texture_compression_astc_sliced_3d +<li> GL_MESA_shader_integer_functions +<li> GL_NVX_blend_equation_advanced_multi_draw_buffers +<li> GL_NVX_linked_gpu_multicast +<li> GL_NV_clip_space_w_scaling +<li> GL_NV_command_list +<li> GL_NV_conservative_raster_pre_snap_triangles +<li> GL_NV_draw_vulkan_image +<li> GL_NV_gpu_multicast +<li> GL_NV_robustness_video_memory_purge +<li> GL_NV_shader_atomic_float64 +<li> GL_NV_stereo_view_rendering +<li> GL_NV_viewport_swizzle +<li> GLX_EXT_libglvnd +<li> GLX_NV_robustness_video_memory_purge +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.13.0</b> [08-10-15] +<ul> +<li> Enhancements: +<ul> +<li> glxewInit, wglewInit +<li> glewinfo adds support for -version, -profile core|compatibility and -flag debug|forward parameters +<li> Improved cmake build support +</ul> +</ul> +<ul> +<li> New extensions: +<ul> +<li> GL_ARB_ES3_2_compatibility +<li> GL_ARB_fragment_shader_interlock +<li> GL_ARB_gpu_shader_int64 +<li> GL_ARB_parallel_shader_compile +<li> GL_ARB_post_depth_coverage +<li> GL_ARB_sample_locations +<li> GL_ARB_shader_atomic_counter_ops +<li> GL_ARB_shader_ballot +<li> GL_ARB_shader_clock +<li> GL_ARB_shader_viewport_layer_array +<li> GL_ARB_sparse_texture2 +<li> GL_ARB_sparse_texture_clamp +<li> GL_ARB_texture_filter_minmax +<li> GL_INTEL_framebuffer_CMAA +<li> GL_KHR_no_error +<li> GL_NV_conservative_raster_dilate +<li> GL_OVR_multiview +<li> GL_OVR_multiview2 +</ul> +<li> <a href="http://sourceforge.net/p/glew/bugs/milestone/1.13.0/">Bug fixes</a> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.12.0</b> [01-26-15] +<ul> +<li> New extensions: +<ul> +<li> GL_EXT_polygon_offset_clamp +<li> GL_EXT_post_depth_coverage +<li> GL_EXT_raster_multisample +<li> GL_EXT_sparse_texture2 +<li> GL_EXT_texture_filter_minmax +<li> GL_NV_conservative_raster +<li> GL_NV_fill_rectangle +<li> GL_NV_fragment_coverage_to_color +<li> GL_NV_fragment_shader_interlock +<li> GL_NV_framebuffer_mixed_samples +<li> GL_NV_geometry_shader_passthrough +<li> GL_NV_internalformat_sample_query +<li> GL_NV_sample_locations +<li> GL_NV_sample_mask_override_coverage +<li> GL_NV_shader_atomic_fp16_vector +<li> GL_NV_uniform_buffer_unified_memory +<li> GL_NV_viewport_array2 +</ul> +<li> <a href="http://sourceforge.net/p/glew/bugs/milestone/1.12.0/">Bug fixes</a> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.11.0</b> [08-11-14] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 4.5 +</ul> +<li> New extensions: +<ul> +<li> GL_AMD_gcn_shader +<li> GL_AMD_gpu_shader_int64 +<li> GL_AMD_occlusion_query_event +<li> GL_AMD_shader_atomic_counter_ops +<li> GL_AMD_shader_stencil_value_export +<li> GL_AMD_transform_feedback4 +<li> GL_ARB_ES3_1_compatibility +<li> GL_ARB_clip_control +<li> GL_ARB_conditional_render_inverted +<li> GL_ARB_cull_distance +<li> GL_ARB_derivative_control +<li> GL_ARB_direct_state_access +<li> GL_ARB_get_texture_sub_image +<li> GL_ARB_pipeline_statistics_query +<li> GL_ARB_shader_texture_image_samples +<li> GL_ARB_sparse_buffer +<li> GL_ARB_texture_barrier +<li> GL_ARB_transform_feedback_overflow_query +<li> GL_EXT_debug_label +<li> GL_EXT_shader_image_load_formatted +<li> GL_EXT_shader_integer_mix +<li> GL_INTEL_fragment_shader_ordering +<li> GL_INTEL_performance_query +<li> GL_KHR_blend_equation_advanced +<li> GL_KHR_blend_equation_advanced_coherent +<li> GL_KHR_context_flush_control +<li> GL_KHR_robust_buffer_access_behavior +<li> GL_KHR_robustness +<li> GL_KHR_texture_compression_astc_hdr +<li> GL_NV_bindless_multi_draw_indirect_count +<li> GL_NV_shader_atomic_int64 +<li> GL_NV_shader_thread_group +<li> GL_NV_shader_thread_shuffle +<li> GL_REGAL_proc_address +<li> GLX_ARB_context_flush_control +<li> GLX_EXT_stereo_tree +<li> GLX_MESA_query_renderer +<li> GLX_NV_copy_buffer +<li> GLX_NV_delay_before_swap +<li> WGL_ARB_context_flush_control +<li> WGL_NV_delay_before_swap +</ul> +<li> <a href="http://sourceforge.net/p/glew/bugs/milestone/1.11.0/">Bug fixes</a> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.10.0</b> [07-22-13] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 4.4 +</ul> +<li> New extensions: +<ul> +<li> GL_AMD_interleaved_elements +<li> GL_AMD_shader_trinary_minmax +<li> GL_AMD_sparse_texture +<li> GL_ANGLE_depth_texture +<li> GL_ANGLE_framebuffer_blit +<li> GL_ANGLE_framebuffer_multisample +<li> GL_ANGLE_instanced_arrays +<li> GL_ANGLE_pack_reverse_row_order +<li> GL_ANGLE_program_binary +<li> GL_ANGLE_texture_compression_dxt1 +<li> GL_ANGLE_texture_compression_dxt3 +<li> GL_ANGLE_texture_compression_dxt5 +<li> GL_ANGLE_texture_usage +<li> GL_ANGLE_timer_query +<li> GL_ANGLE_translated_shader_source +<li> GL_ARB_bindless_texture +<li> GL_ARB_buffer_storage +<li> GL_ARB_clear_texture +<li> GL_ARB_compute_variable_group_size +<li> GL_ARB_enhanced_layouts +<li> GL_ARB_indirect_parameters +<li> GL_ARB_multi_bind +<li> GL_ARB_query_buffer_object +<li> GL_ARB_seamless_cubemap_per_texture +<li> GL_ARB_shader_draw_parameters +<li> GL_ARB_shader_group_vote +<li> GL_ARB_sparse_texture +<li> GL_ARB_texture_mirror_clamp_to_edge +<li> GL_ARB_texture_stencil8 +<li> GL_ARB_vertex_type_10f_11f_11f_rev +<li> GL_INTEL_map_texture +<li> GL_NVX_conditional_render +<li> GL_NV_bindless_multi_draw_indirect +<li> GL_NV_blend_equation_advanced +<li> GL_NV_compute_program5 +<li> GL_NV_deep_texture3D +<li> GL_NV_draw_texture +<li> GL_NV_shader_atomic_counters +<li> GL_NV_shader_storage_buffer_object +<li> GL_REGAL_ES1_0_compatibility +<li> GL_REGAL_ES1_1_compatibility +<li> GL_REGAL_enable +<li> GLX_EXT_buffer_age +<li> WGL_ARB_robustness_application_isolation +<li> WGL_ARB_robustness_share_group_isolation +</ul> +<li> <a href="http://sourceforge.net/p/glew/bugs/milestone/1.10.0/">Bug fixes</a> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.9.0</b> [08-06-12] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 4.3 - + <a href="http://www.opengl.org/registry/doc/glspec43.compatibility.20120806.pdf">specification</a>, + <a href="http://www.khronos.org/assets/uploads/developers/library/overview/opengl_overview.pdf">overview</a>. +</ul> +<li> New extensions: +<ul> +<li> GL_ARB_ES3_compatibility +<li> GL_ARB_clear_buffer_object +<li> GL_ARB_compute_shader +<li> GL_ARB_copy_image +<li> GL_ARB_explicit_uniform_location +<li> GL_ARB_fragment_layer_viewport +<li> GL_ARB_framebuffer_no_attachments +<li> GL_ARB_internalformat_query2 +<li> GL_ARB_multi_draw_indirect +<li> GL_ARB_program_interface_query +<li> GL_ARB_robust_buffer_access_behavior +<li> GL_ARB_robustness_application_isolation +<li> GL_ARB_robustness_share_group_isolation +<li> GL_ARB_shader_image_size +<li> GL_ARB_shader_storage_buffer_object +<li> GL_ARB_stencil_texturing +<li> GL_ARB_texture_buffer_range +<li> GL_ARB_texture_query_levels +<li> GL_ARB_texture_storage_multisample +<li> GL_ARB_texture_view +<li> GL_ARB_vertex_attrib_binding +<li> GL_EXT_debug_marker +<li> GL_KHR_debug +<li> GL_REGAL_error_string +<li> GL_REGAL_extension_query +<li> GL_REGAL_log +<li> GLX_ARB_robustness_application_isolation +<li> GLX_ARB_robustness_share_group_isolation +<li> GLX_EXT_create_context_es_profile +<li> WGL_EXT_create_context_es_profile +</ul> +<li> Bug fixes: +<ul> +<li> Not using GLU library for Makefile builds. +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.8.0</b> [07-17-12] +<ul> +<li> New extensions: +<ul> +<li> GL_AMD_pinned_memory +<li> GL_AMD_query_buffer_object +<li> GL_AMD_stencil_operation_extended +<li> GL_AMD_vertex_shader_layer +<li> GL_AMD_vertex_shader_viewport_index +<li> GL_NV_bindless_texture +<li> GL_NV_shader_atomic_float +<li> GLX_EXT_swap_control_tear +<li> WGL_EXT_swap_control_tear +<li> WGL_NV_DX_interop2 +</ul> +<li> Bug fixes: +<ul> +<li> MS Visual Studio 2010 projects added +<li> GLX_NV_video_out replaces GLX_NV_video_output +<li> ANSI C prototype for glewInit +<li> Improved CentOS build support +<li> Improved GL_ARB_gpu_shader_fp64 support +<li> ARB_texture_compression_bptc and ARB_copy_buffer constants +<li> Linux needs to define GLEW_STATIC for static library builds +<li> Custom code generation problem resolved +<li> GLEWAPIENTRY added to glew.h for calling convention customization +<li> Correction for glPathStencilDepthOffsetNV +<li> Resolve OSX gcc warnings +<li> Added build support for NetBSD +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.7.0</b> [08-26-11] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 4.2 +</ul> +<li> New extensions: +<ul> +<li> GL_AMD_multi_draw_indirect +<li> GL_ARB_base_instance +<li> GL_ARB_compressed_texture_pixel_storage +<li> GL_ARB_conservative_depth +<li> GL_ARB_internalformat_query +<li> GL_ARB_map_buffer_alignment +<li> GL_ARB_shader_atomic_counters +<li> GL_ARB_shader_image_load_store +<li> GL_ARB_shading_language_420pack +<li> GL_ARB_shading_language_packing +<li> GL_ARB_texture_storage +<li> GL_ARB_transform_feedback_instanced +<li> GL_EXT_framebuffer_multisample_blit_scaled +<li> GL_NV_path_rendering +<li> GL_NV_path_rendering +<li> GLX_MESA_swap_control +</ul> +<li> Bug fixes: +<ul> +<li> const qualifiers for GL 1.4 MultiDrawArrays, MultiDrawElements +<li> Add glGetGraphicsResetStatusARB to GL_ARB_robustness +<li> Remove EXT suffix from GL_KTX_buffer_region entry points +<li> Solaris needs inttypes.h +<li> Add ERROR_INVALID_VERSION_ARB and ERROR_INVALID_PROFILE_ARB to WGL_ARB_create_context +<li> Add GLX_MESA_swap_control +<li> Set -install_name for OSX +<li> Add 64-bit darwin build option (SYSTEM=darwin_x86-64) +<li> Add GL_NV_path_rendering +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.6.0</b> [04-27-11] +<ul> +<li> New extensions: +<ul> +<li> GL_AMD_blend_minmax_factor +<li> GL_AMD_sample_positions +<li> GL_EXT_x11_sync_object +<li> GL_NV_texture_multisample +<li> GL_NV_video_capture +<li> GLX_NV_video_capture +<li> WGL_NV_DX_interop +<li> WGL_NV_video_capture +</ul> +<li> Bug fixes: +<ul> +<li> Define GLEW_NO_GLU for no glu dependency. +<li> mx suffix for GLEW MX libraries, build both libraries by default. +<li> Cygwin build improvements +<li> Soname of GLEWmx shared libraries +<li> Query GL extension string only once +<li> GLX_OML_sync_control no longer requires C99 +<li> glDraw*InstancedARB moved from GL_ARB_draw_instanced to GL_ARB_instanced_arrays +<li> glFramebufferTextureLayerEXT moved from GL_EXT_geometry_shader4 to GL_EXT_texture_array +<li> Fixes for BSD build +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.8</b> [01-31-11] +<ul> +<li> New extensions: +<ul> +<li> GL_AMD_depth_clamp_separate +<li> GL_EXT_texture_sRGB_decode +</ul> +<li> Bug fixes: +<ul> +<li> Borland C++ fix for __int64 +<li> GL_DOUBLE_MATNxM enumerants for OpenGL 4.0 +<li> Correction to glGetTransformFeedbackVarying +<li> Correction to glSecondaryColorPointer +<li> Corrections to glGetVertexAttribPointerv and glGetShaderSource +<li> Switched code repository from svn to git +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.7</b> [11-03-10] +<ul> +<li> New extension: +<ul> +<li> GL_NVX_gpu_memory_info +</ul> +<li> Bug fixes: +<ul> +<li> Improved mingw32 build support +<li> Improved cygwin build support +<li> glGetPointervEXT fix +<li> Add GLEW_VERSION_1_2_1 +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.6</b> [09-07-10] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 4.1 +</ul> +<li> New extensions: +<ul> +<li> GL_ARB_ES2_compatibility +<li> GL_ARB_cl_event +<li> GL_ARB_debug_output +<li> GL_ARB_get_program_binary +<li> GL_ARB_robustness +<li> GL_ARB_separate_shader_objects +<li> GL_ARB_shader_precision +<li> GL_ARB_shader_stencil_export +<li> GL_ARB_vertex_attrib_64bit +<li> GL_ARB_viewport_array +<li> GLX_ARB_create_context_robustness +<li> GLX_EXT_create_context_es2_profile +<li> WGL_ARB_create_context_robustness +<li> WGL_EXT_create_context_es2_profile +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.5</b> [07-13-10] +<ul> +<li> New extensions: +<ul> +<li> GL_AMD_debug_output +<li> GL_AMD_name_gen_delete +<li> GL_AMD_transform_feedback3_lines_triangles +<li> GL_NV_multisample_coverage +<li> GL_NV_vdpau_interop +<li> GLX_AMD_gpu_association +<li> GLX_NV_multisample_coverage +<li> WGL_NV_multisample_coverage +</ul> +<li> Bug fixes: +<ul> +<li> Compilation issue with GLX_SGI_video_sync +<li> OpenGL 4.0 double-precision uniform functions added +<li> Constness of glPointParameterfvARB and glPointParameterfvEXT +<li> Added glVertexAttribDivisor +<li> Compilation issue with Nvidia GLX headers +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.4</b> [04-21-10] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 3.3 +<li> Support for OpenGL 4.0 +</ul> +<li> New extensions: +<ul> +<li> GL_AMD_conservative_depth +<li> GL_ARB_blend_func_extended +<li> GL_ARB_draw_indirect +<li> GL_ARB_explicit_attrib_location +<li> GL_ARB_gpu_shader5 +<li> GL_ARB_gpu_shader_fp64 +<li> GL_ARB_occlusion_query2 +<li> GL_ARB_sampler_objects +<li> GL_ARB_shader_bit_encoding +<li> GL_ARB_shader_subroutine +<li> GL_ARB_shading_language_include +<li> GL_ARB_tessellation_shader +<li> GL_ARB_texture_buffer_object_rgb32 +<li> GL_ARB_texture_compression_bptc +<li> GL_ARB_texture_rgb10_a2ui +<li> GL_ARB_texture_swizzle +<li> GL_ARB_timer_query +<li> GL_ARB_transform_feedback2 +<li> GL_ARB_transform_feedback3 +<li> GL_ARB_vertex_type_2_10_10_10_rev +<li> GL_EXT_shader_image_load_store +<li> GL_EXT_vertex_attrib_64bit +<li> GL_NV_gpu_program5 +<li> GL_NV_gpu_program_fp64 +<li> GL_NV_gpu_shader5 +<li> GL_NV_tessellation_program5 +<li> GL_NV_vertex_attrib_integer_64bit +<li> GLX_ARB_vertex_buffer_object +</ul> +<li> Bug fixes: +<ul> +<li> Parameter constness fix for glPointParameteriv and glPointParameterfv +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.3</b> [02-28-10] +<ul> +<li> New extensions: +<ul> +<li> GLX_INTEL_swap_event +<li> GL_AMD_seamless_cubemap_per_texture +<li> GL_AMD_shader_stencil_export +</ul> +<li> Bug fixes: +<ul> +<li> Correct version detection for GL 3.1 and 3.2 +<li> Missing 3.1 enumerants +<li> Add glew.pc +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.2</b> [12-31-09] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 3.1 +<li> Support for OpenGL 3.2 +</ul> +<li> New extensions: +<ul> +<li> GL_AMD_draw_buffers_blend +<li> GL_AMD_performance_monitor +<li> GL_AMD_texture_texture4 +<li> GL_AMD_vertex_shader_tessellator +<li> GL_APPLE_aux_depth_stencil +<li> GL_APPLE_object_purgeable +<li> GL_APPLE_rgb_422 +<li> GL_APPLE_row_bytes +<li> GL_APPLE_vertex_program_evaluators +<li> GL_ARB_compatibility +<li> GL_ARB_copy_buffer +<li> GL_ARB_depth_clamp +<li> GL_ARB_draw_buffers_blend +<li> GL_ARB_draw_elements_base_vertex +<li> GL_ARB_fragment_coord_conventions +<li> GL_ARB_provoking_vertex +<li> GL_ARB_sample_shading +<li> GL_ARB_seamless_cube_map +<li> GL_ARB_shader_texture_lod +<li> GL_ARB_sync +<li> GL_ARB_texture_cube_map_array +<li> GL_ARB_texture_gather +<li> GL_ARB_texture_multisample +<li> GL_ARB_texture_query_lod +<li> GL_ARB_uniform_buffer_object +<li> GL_ARB_vertex_array_bgra +<li> GL_ATI_meminfo +<li> GL_EXT_provoking_vertex +<li> GL_EXT_separate_shader_objects +<li> GL_EXT_texture_snorm +<li> GL_NV_copy_image +<li> GL_NV_parameter_buffer_object2 +<li> GL_NV_shader_buffer_load +<li> GL_NV_texture_barrier +<li> GL_NV_transform_feedback2 +<li> GL_NV_vertex_buffer_unified_memory +<li> WGL_AMD_gpu_association +<li> WGL_ARB_create_context_profile +<li> WGL_NV_copy_image +<li> GLX_ARB_create_context_profile +<li> GLX_EXT_swap_control +<li> GLX_NV_copy_image +</ul> +<li> Bug fixes: +<ul> +<li> DOS line endings for windows .zip archives only. +<li> glTransformFeedbackVaryings arguments. +<li> Resource leak in glewinfo and visualinfo tools. +<li> WIN32_LEAN_AND_MEAN preprocessor pollution. +<li> Fixed version detection for GLEW_VERSION_2_1 and GLEW_VERSION_3_0. +<li> MesaGLUT glut.h GLAPIENTRY dependency. +<li> glFramebufferTextureLayer correction. +<li> OSX compiler warnings resolved. +<li> Cygwin linking to opengl32 by default, rather than X11 OpenGL. +<li> SnowLeopard (OSX 10.6) gl.h detection. +<li> Use $(STRIP) consistently. +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.1</b> [11-03-08] +<ul> +<li> New features: +<ul> +<li> Support for OpenGL 3.0 +</ul> +<li> New extensions: +<ul> +<li> GL_ARB_depth_buffer_float +<li> GL_ARB_draw_instance, +<li> GL_ARB_framebuffer_object +<li> GL_ARB_framebuffer_sRGB +<li> GL_ARB_geometry_shader4 +<li> GL_ARB_half_float_pixel +<li> GL_ARB_half_float_vertex +<li> GL_ARB_instanced_arrays +<li> GL_ARB_map_buffer_range +<li> GL_ARB_texture_buffer_object +<li> GL_ARB_texture_compression_rgtc +<li> GL_ARB_vertex_array_object +<li> GL_EXT_direct_state_access +<li> GL_EXT_texture_swizzle +<li> GL_EXT_transform_feedback +<li> GL_EXT_vertex_array_bgra +<li> GL_NV_conditional_render +<li> GL_NV_explicit_multisample +<li> GL_NV_present_video +<li> GL_SGIS_point_line_texgen +<li> GL_SGIX_convolution_accuracy +<li> WGL_ARB_create_context +<li> WGL_ARB_framebuffer_sRGB +<li> WGL_NV_present_video +<li> WGL_NV_swap_group +<li> WGL_NV_video_output +<li> GLX_ARB_create_context +<li> GLX_ARB_framebuffer_sRGB +<li> GLX_NV_present_video +<li> GLX_NV_swap_group +<li> GLX_NV_video_output +</ul> +<li> Bug fixes: +<ul> +<li> Licensing issues with documentation +<li> Problems with long long and _MSC_VER on MINGW +<li> Incorrect parameter for glGetUniformLocation +<li> glewGetExtension fails on last entry +<li> Incomplete GL_NV_texture_shader tokens +<li> Scripting problems on Cygwin +<li> Incorrect definition for GLint on OS X +</ul> +</ul> +</ul> + +<hr align="center"> +<ul class="none"> +<li><b>1.5.0</b> [12-27-07] +<ul> +<li> New features: +<ul> +<li> Licensing change (BSD, Mesa 3-D, Khronos) +<li> Switch to using registry on <a href="http://www.opengl.org/registry/">www.opengl.org</a> +<li> Support for major and minor version strings +</ul> +<li> New extensions: +<ul> +<li> GL_APPLE_flush_buffer_range +<li> GL_GREMEDY_frame_terminator +<li> GLX_EXT_texture_from_pixmap +</ul> +<li> Bug fixes: +<ul> +<li> Incorrent 64-bit type definitions +<li> Do not strip static library on install +<li> Missing tokens in GL_ATI_fragment_shader and WGL_{ARB,EXT}_make_current_read +<li> Missing tokens in GL_VERSION_2_1 +<li> Missing functions in GL_VERSION_1_4 +<li> Incorrect parameter type for glXCopyContext +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.4.0</b> [04-27-07] +<ul> +<li> New features: +<ul> +<li> Extension variables are declared const to avoid possible +corruption of their values +</ul> +<li> New extensions: +<ul> +<li> GL_NV_depth_range_unclamped +</ul> +<li> Bug fixes: +<ul> +<li> Incorrect tokens in GL_NV_transform_feedback and GL_NV_framebuffer_multisample_coverage +<li> Incorrect function names in GL_EXT_gpu_program_parameters +<li> Missing tokens in GL_EXT_framebuffer_multisample +<li> GLEW_MX initialization problem for WGL_{ARB,EXT}_extensions_string +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.6</b> [03-04-07] +<ul> +<li> New extensions: +<ul> +<li> GL_ATI_shader_texture_lod +<li> GL_EXT_gpu_program_parameters +<li> GL_NV_geometry_shader4 +<li> WGL_NV_gpu_affinity +<li> GLX_SGIX_hyperpipe +</ul> +<li> Bug fixes: +<ul> +<li> Missing include guards in glxew.h +<li> Makefile and install problems for Cygwin builds +<li> Install problem for Linux AMD64 builds +<li> Incorrent token in GL_ATI_texture_compression_3dc +<li> Missing tokens from GL_ATIX_point_sprites +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.5</b> [11-21-06] +<ul> +<li> New features: +<ul> +<li> Support for core OpenGL 2.1 +<li> Debug support for glewIsSupported +</ul> +<li> New extensions: +<ul> +<li> GL_EXT_bindable_uniform +<li> GL_EXT_draw_buffers2 +<li> GL_EXT_draw_instanced +<li> GL_EXT_framebuffer_sRGB +<li> GL_EXT_geometry_shader4 +<li> GL_EXT_gpu_shader4 +<li> GL_EXT_packed_float +<li> GL_EXT_texture_array +<li> GL_EXT_texture_buffer_object +<li> GL_EXT_texture_compression_latc +<li> GL_EXT_texture_compression_rgtc +<li> GL_EXT_texture_integer +<li> GL_EXT_texture_shared_exponent +<li> GL_EXT_timer_query +<li> GL_NV_depth_buffer_float +<li> GL_NV_fragment_program4 +<li> GL_NV_framebuffer_multisample_coverage +<li> GL_NV_geometry_program4 +<li> GL_NV_gpu_program4 +<li> GL_NV_parameter_buffer_object +<li> GL_NV_transform_feedback +<li> GL_NV_vertex_program4 +<li> GL_OES_byte_coordinates +<li> GL_OES_compressed_paletted_texture +<li> GL_OES_read_format +<li> GL_OES_single_precision +<li> WGL_EXT_pixel_format_packed_float +<li> WGL_EXT_framebuffer_sRGB +<li> GLX_EXT_fbconfig_packed_float +<li> GLX_EXT_framebuffer_sRGB +</ul> +<li> Bug fixes: +<ul> +<li> Wrong GLXContext definition on Solaris +<li> Makefile problem for parallel builds +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.4</b> [03-04-06] +<ul> +<li> New extensions: +<ul> +<li> GL_EXT_framebuffer_blit +<li> GL_EXT_framebuffer_multisample +<li> GL_EXT_packed_depth_stencil +<li> GL_MESAX_texture_stack +<li> WGL_3DL_stereo_control +</ul> +</ul> +<ul> +<li> Bug fixes: +<ul> +<li> glBlendEquation missing from GL_ARB_imaging +<li> Wrong APIENTRY definition for Cygwin +<li> Incorrect OS X OpenGL types +<li> Unix 64-bit installation patch +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.3</b> [05-16-05] +<ul> +<li> New feature: +<ul> +<li> Code generation option to split source into multiple files +</ul> +</ul> +<ul> +<li> Bug fixes: +<ul> +<li> OpenGL 2.0 core initialization problems +<li> Wrong value for token GL_SHADER_TYPE +<li> Missing tokens in GL_ATI_fragment_shader +<li> Missing entry points in GL_ARB_transpose_matrix +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.2</b> [03-16-05] +<ul> +<li> New extension: +<ul> +<li> GL_APPLE_pixel_buffer +</ul> +<li> Bug fixes: +<ul> +<li> Missing OpenGL 2.0 entry points +<li> Missing tokens in GL_SGIX_shadow +<li> MinGW makefile problem +<li> Check for incorrect OpenGL version string on SiS hardware +<li> Documentation update to meet the HTML 4.01 Transitional specification +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.1</b> [02-02-05] +<ul> +<li> New features: +<ul> +<li> Consistent Unix and Windows versioning +</ul> +<li> New extensions: +<ul> +<li> GL_EXT_framebuffer_object +<li> GL_ARB_pixel_buffer_object +</ul> +<li> Bug fixes: +<ul> +<li> Missing OpenGL 2.0 tokens +<li> Incorrect typedefs (GLhandleARB and GLhalf) +<li> Borland compiler problems +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.3.0</b> [01-04-05] +<ul> +<li> New features: +<ul> +<li> Support for core OpenGL 2.0 +<li> <tt>glewIsSupported</tt> provides efficient string-based extension checks +<li> Custom code generation from a list of extensions +<li> Makefile changes +</ul> +<li> New extensions: +<ul> +<li> WGL_ATI_render_texture_rectangle +</ul> +<li> Bug fixes: +<ul> +<li> Incorrect function signature in OpenGL 1.5 core +</ul> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.2.5</b> [12-06-04] +<ul> +<li> New extensions: +<ul> +<li>GL_ATI_texture_compression_3dc +<li>GL_EXT_Cg_shader +<li>GL_EXT_draw_range_elements +<li>GL_KTX_buffer_region +</ul> +<li> Bug fixes: +<ul> +<li> OpenGL version detection bug +<li> Problems with wxWindows and MinGW compilation +<li> <tt>visualinfo</tt> compilation problem with GLEW_MX specified +<li> Wrong token name in OpenGL 1.5 core +</ul> +<li> Support for FreeBSD +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.2.4</b> [09-06-04] +<ul> +<li> Added ARB_draw_buffers and ARB_texture_rectangle +<li> Fixed bug in ARB_shader_objects +<li> Replaced <tt>wglinfo</tt> with <tt>visualinfo</tt> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.2.3</b> [06-10-04] +<ul> +<li> Added GL_NV_fragment_program2, GL_NV_fragment_program_option, GL_NV_vertex_program2_option, GL_NV_vertex_program3 +<li> Bug fix in GL_ARB_vertex_blend +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.2.2</b> [05-08-04] +<ul> +<li> Added GL_EXT_pixel_buffer_object, removed GL_NV_element_array +<li> Fixed GLEW_MX problems +<li> Bug fix in GL_EXT_texture_rectangle and <tt>wglinfo</tt> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.2.1</b> [03-18-04] +<ul> +<li> Bug fix in OpenGL version query (early release of 1.2.0 contained this bug) +<li> Bug fix in GL_ARB_shader_objects and temporary bug fix in GL_ARB_vertex_shader +<li> Added flags on GDI support and multisampling to <tt>wglinfo</tt> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.2.0</b> [02-19-04] +<ul> +<li> Added full OpenGL 1.5 support +<li> Added support for multiple rendering contexts with different capabilities +<li> Added command line flags to <tt>glewinfo</tt> for selecting displays and visuals +<li> Added GLX_SGIS_multisample, GLX_SUN_video_resize, and GL_SUN_read_video_pixels +<li> Added MinGW/MSYS support +<li> Bug fixes in GL_ARB_shader_objects and the OS X build +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.1.4</b> [12-15-03] +<ul> +<li> Added GL_APPLE_float_pixels, GL_APPLE_texture_range, +GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, +GLX_ATI_pixel_format_float, and GLX_ATI_render_texture +<li> Bug fixes in GL_ATI_map_object_buffer and GL_ATI_fragment_shader +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.1.3</b> [10-28-03] +<ul> +<li> Added Solaris and Darwin support +<li> Added GL_ARB_fragment_shader, GL_ARB_shader_objects, and GL_ARB_vertex_shader +<li> Fixed bug in GL_WIN_swap_hint +<li> Removed <tt>glewinfo</tt>'s dependency on <tt>GLUT</tt> +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.1.2</b> [09-15-03] +<ul> +<li> Removed dependency on WGL_{ARB,EXT}_extensions_string to make GLEW run on Matrox cards +<li> Added glewGetString for querying the GLEW version string +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.1.1</b> [08-11-03] +<ul> +<li> Added GLX_NV_float_buffer, GL_ARB_shading_language_100, and GL_ARB_texture_non_power_of_two +<li> Fixed bug in GL_ARB_vertex_buffer_object +<li> Minor updates in documentation +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.1.0</b> [07-08-03] +<ul> +<li> Added automatic code generation +<li> Added almost every extension in the registry +<li> Added separate namespace +<li> Added Irix support +<li> Updated documentation +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.7</b> [06-29-03] +<ul> +<li> Added GL_EXT_depth_bounds_test +<li> Fixed typos +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.6</b> [05-05-03] +<ul> +<li> Added ARB_vertex_buffer_object and NV_half_float +<li> Updated <tt>wglinfo</tt> +<li> Temporary Linux bug fixes (problems with SDL and MESA) +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.5</b> [02-17-03] +<ul> +<li> Bug fixes +<li> Added <tt>wglinfo</tt> +<li> Updated documentation +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.4</b> [02-02-03] +<ul> +<li> Added NV_texture_expand_normal +<li> Added mingw support +<li> Updated documentation +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.3</b> [01-09-03] +<ul> +<li> Cleaned up ATI extensions +<li> Changed function prototypes to match glext.h +<li> Added EXT_texture3D +<li> Fixed typos in ATI_vertex_attrib_array_object and ATI_draw_buffers +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.2</b> [12-21-02] +<ul> +<li> Added list of supported extensions to documentation +<li> Added NV_half_float and NV_texgen_emboss +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.1</b> [12-17-02] +<ul> +<li> Bug fixes +<li> Added glewGetExtension +</ul> +</ul> +<hr align="center"> +<ul class="none"> +<li><b>1.0.0</b> [12-12-02] +<ul> +<li> Initial release +</ul> +</ul> +<hr align="center"> + diff --git a/MacOSX/SDL.framework/Headers b/Windows/glew/auto/extensions/gl/.dummy similarity index 100% rename from MacOSX/SDL.framework/Headers rename to Windows/glew/auto/extensions/gl/.dummy diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_blob_cache b/Windows/glew/auto/extensions/gl/EGL_ANDROID_blob_cache new file mode 100644 index 00000000..6570c527 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_blob_cache @@ -0,0 +1,5 @@ +EGL_ANDROID_blob_cache +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_blob_cache + + void eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get) diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_create_native_client_buffer b/Windows/glew/auto/extensions/gl/EGL_ANDROID_create_native_client_buffer new file mode 100644 index 00000000..7764b898 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_create_native_client_buffer @@ -0,0 +1,9 @@ +EGL_ANDROID_create_native_client_buffer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_create_native_client_buffer + + EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 + EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 + EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 + EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 + EGLClientBuffer eglCreateNativeClientBufferANDROID (const EGLint * attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_framebuffer_target b/Windows/glew/auto/extensions/gl/EGL_ANDROID_framebuffer_target new file mode 100644 index 00000000..3fdbdaac --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_framebuffer_target @@ -0,0 +1,5 @@ +EGL_ANDROID_framebuffer_target +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_framebuffer_target + + EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_front_buffer_auto_refresh b/Windows/glew/auto/extensions/gl/EGL_ANDROID_front_buffer_auto_refresh new file mode 100644 index 00000000..b49e6f59 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_front_buffer_auto_refresh @@ -0,0 +1,5 @@ +EGL_ANDROID_front_buffer_auto_refresh +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_front_buffer_auto_refresh + + EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_image_native_buffer b/Windows/glew/auto/extensions/gl/EGL_ANDROID_image_native_buffer new file mode 100644 index 00000000..fe040354 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_image_native_buffer @@ -0,0 +1,5 @@ +EGL_ANDROID_image_native_buffer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_image_native_buffer + + EGL_NATIVE_BUFFER_ANDROID 0x3140 diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_native_fence_sync b/Windows/glew/auto/extensions/gl/EGL_ANDROID_native_fence_sync new file mode 100644 index 00000000..fcb9f0dc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_native_fence_sync @@ -0,0 +1,9 @@ +EGL_ANDROID_native_fence_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_native_fence_sync + + EGL_NO_NATIVE_FENCE_FD_ANDROID -1 + EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 + EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 + EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 + EGLint eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync) diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_presentation_time b/Windows/glew/auto/extensions/gl/EGL_ANDROID_presentation_time new file mode 100644 index 00000000..9e12eb29 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_presentation_time @@ -0,0 +1,5 @@ +EGL_ANDROID_presentation_time +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_presentation_time + + EGLBoolean eglPresentationTimeANDROID (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time) diff --git a/Windows/glew/auto/extensions/gl/EGL_ANDROID_recordable b/Windows/glew/auto/extensions/gl/EGL_ANDROID_recordable new file mode 100644 index 00000000..17b8c314 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANDROID_recordable @@ -0,0 +1,5 @@ +EGL_ANDROID_recordable +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANDROID_recordable + + EGL_RECORDABLE_ANDROID 0x3142 diff --git a/Windows/glew/auto/extensions/gl/EGL_ANGLE_d3d_share_handle_client_buffer b/Windows/glew/auto/extensions/gl/EGL_ANGLE_d3d_share_handle_client_buffer new file mode 100644 index 00000000..fa9748e5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANGLE_d3d_share_handle_client_buffer @@ -0,0 +1,5 @@ +EGL_ANGLE_d3d_share_handle_client_buffer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANGLE_d3d_share_handle_client_buffer + + EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 diff --git a/Windows/glew/auto/extensions/gl/EGL_ANGLE_device_d3d b/Windows/glew/auto/extensions/gl/EGL_ANGLE_device_d3d new file mode 100644 index 00000000..aad1c1a0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANGLE_device_d3d @@ -0,0 +1,6 @@ +EGL_ANGLE_device_d3d +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANGLE_device_d3d + + EGL_D3D9_DEVICE_ANGLE 0x33A0 + EGL_D3D11_DEVICE_ANGLE 0x33A1 diff --git a/Windows/glew/auto/extensions/gl/EGL_ANGLE_query_surface_pointer b/Windows/glew/auto/extensions/gl/EGL_ANGLE_query_surface_pointer new file mode 100644 index 00000000..9a77a0a0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANGLE_query_surface_pointer @@ -0,0 +1,5 @@ +EGL_ANGLE_query_surface_pointer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANGLE_query_surface_pointer + + EGLBoolean eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void ** value) diff --git a/Windows/glew/auto/extensions/gl/EGL_ANGLE_surface_d3d_texture_2d_share_handle b/Windows/glew/auto/extensions/gl/EGL_ANGLE_surface_d3d_texture_2d_share_handle new file mode 100644 index 00000000..d5c1696e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANGLE_surface_d3d_texture_2d_share_handle @@ -0,0 +1,5 @@ +EGL_ANGLE_surface_d3d_texture_2d_share_handle +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANGLE_surface_d3d_texture_2d_share_handle + + EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 diff --git a/Windows/glew/auto/extensions/gl/EGL_ANGLE_window_fixed_size b/Windows/glew/auto/extensions/gl/EGL_ANGLE_window_fixed_size new file mode 100644 index 00000000..299b6c7b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ANGLE_window_fixed_size @@ -0,0 +1,5 @@ +EGL_ANGLE_window_fixed_size +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ANGLE_window_fixed_size + + EGL_FIXED_SIZE_ANGLE 0x3201 diff --git a/Windows/glew/auto/extensions/gl/EGL_ARM_implicit_external_sync b/Windows/glew/auto/extensions/gl/EGL_ARM_implicit_external_sync new file mode 100644 index 00000000..ec094f20 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ARM_implicit_external_sync @@ -0,0 +1,5 @@ +EGL_ARM_implicit_external_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ARM_implicit_external_sync + + EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A diff --git a/Windows/glew/auto/extensions/gl/EGL_ARM_pixmap_multisample_discard b/Windows/glew/auto/extensions/gl/EGL_ARM_pixmap_multisample_discard new file mode 100644 index 00000000..5f2b9e75 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_ARM_pixmap_multisample_discard @@ -0,0 +1,5 @@ +EGL_ARM_pixmap_multisample_discard +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_ARM_pixmap_multisample_discard + + EGL_DISCARD_SAMPLES_ARM 0x3286 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_buffer_age b/Windows/glew/auto/extensions/gl/EGL_EXT_buffer_age new file mode 100644 index 00000000..4dc18ad7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_buffer_age @@ -0,0 +1,5 @@ +EGL_EXT_buffer_age +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_buffer_age + + EGL_BUFFER_AGE_EXT 0x313D diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_client_extensions b/Windows/glew/auto/extensions/gl/EGL_EXT_client_extensions new file mode 100644 index 00000000..8251a199 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_client_extensions @@ -0,0 +1,4 @@ +EGL_EXT_client_extensions +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_client_extensions + diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_create_context_robustness b/Windows/glew/auto/extensions/gl/EGL_EXT_create_context_robustness new file mode 100644 index 00000000..e09b15cc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_create_context_robustness @@ -0,0 +1,8 @@ +EGL_EXT_create_context_robustness +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_create_context_robustness + + EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF + EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 + EGL_NO_RESET_NOTIFICATION_EXT 0x31BE + EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_device_base b/Windows/glew/auto/extensions/gl/EGL_EXT_device_base new file mode 100644 index 00000000..42fd834f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_device_base @@ -0,0 +1,7 @@ +EGL_EXT_device_base +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_device_base + + EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) + EGL_BAD_DEVICE_EXT 0x322B + EGL_DEVICE_EXT 0x322C diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_device_drm b/Windows/glew/auto/extensions/gl/EGL_EXT_device_drm new file mode 100644 index 00000000..0d2bc015 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_device_drm @@ -0,0 +1,5 @@ +EGL_EXT_device_drm +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_device_drm + + EGL_DRM_DEVICE_FILE_EXT 0x3233 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_device_enumeration b/Windows/glew/auto/extensions/gl/EGL_EXT_device_enumeration new file mode 100644 index 00000000..43f91dae --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_device_enumeration @@ -0,0 +1,5 @@ +EGL_EXT_device_enumeration +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_device_enumeration + + EGLBoolean eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT * devices, EGLint * num_devices) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_device_openwf b/Windows/glew/auto/extensions/gl/EGL_EXT_device_openwf new file mode 100644 index 00000000..88e74202 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_device_openwf @@ -0,0 +1,5 @@ +EGL_EXT_device_openwf +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_device_openwf + + EGL_OPENWF_DEVICE_ID_EXT 0x3237 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_device_query b/Windows/glew/auto/extensions/gl/EGL_EXT_device_query new file mode 100644 index 00000000..d8234438 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_device_query @@ -0,0 +1,10 @@ +EGL_EXT_device_query +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_device_query + + EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) + EGL_BAD_DEVICE_EXT 0x322B + EGL_DEVICE_EXT 0x322C + EGLBoolean eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib * value) + const char * eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name) + EGLBoolean eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib * value) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_bt2020_linear b/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_bt2020_linear new file mode 100644 index 00000000..72d7df14 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_bt2020_linear @@ -0,0 +1,5 @@ +EGL_EXT_gl_colorspace_bt2020_linear +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_gl_colorspace_bt2020_linear + + EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_bt2020_pq b/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_bt2020_pq new file mode 100644 index 00000000..99ef504e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_bt2020_pq @@ -0,0 +1,5 @@ +EGL_EXT_gl_colorspace_bt2020_pq +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_gl_colorspace_bt2020_pq + + EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_scrgb_linear b/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_scrgb_linear new file mode 100644 index 00000000..dd370cfb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_gl_colorspace_scrgb_linear @@ -0,0 +1,5 @@ +EGL_EXT_gl_colorspace_scrgb_linear +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_gl_colorspace_scrgb_linear + + EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_image_dma_buf_import b/Windows/glew/auto/extensions/gl/EGL_EXT_image_dma_buf_import new file mode 100644 index 00000000..419eb0f0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_image_dma_buf_import @@ -0,0 +1,26 @@ +EGL_EXT_image_dma_buf_import +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_image_dma_buf_import + + EGL_LINUX_DMA_BUF_EXT 0x3270 + EGL_LINUX_DRM_FOURCC_EXT 0x3271 + EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 + EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 + EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 + EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 + EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 + EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 + EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 + EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 + EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A + EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B + EGL_SAMPLE_RANGE_HINT_EXT 0x327C + EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D + EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E + EGL_ITU_REC601_EXT 0x327F + EGL_ITU_REC709_EXT 0x3280 + EGL_ITU_REC2020_EXT 0x3281 + EGL_YUV_FULL_RANGE_EXT 0x3282 + EGL_YUV_NARROW_RANGE_EXT 0x3283 + EGL_YUV_CHROMA_SITING_0_EXT 0x3284 + EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_image_dma_buf_import_modifiers b/Windows/glew/auto/extensions/gl/EGL_EXT_image_dma_buf_import_modifiers new file mode 100644 index 00000000..9fc39b76 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_image_dma_buf_import_modifiers @@ -0,0 +1,17 @@ +EGL_EXT_image_dma_buf_import_modifiers +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_image_dma_buf_import_modifiers + + EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 + EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 + EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 + EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 + EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 + EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 + EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 + EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 + EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 + EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 + EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A + EGLBoolean eglQueryDmaBufFormatsEXT (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats) + EGLBoolean eglQueryDmaBufModifiersEXT (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_multiview_window b/Windows/glew/auto/extensions/gl/EGL_EXT_multiview_window new file mode 100644 index 00000000..4ae01568 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_multiview_window @@ -0,0 +1,5 @@ +EGL_EXT_multiview_window +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_multiview_window + + EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_output_base b/Windows/glew/auto/extensions/gl/EGL_EXT_output_base new file mode 100644 index 00000000..a10f686f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_output_base @@ -0,0 +1,17 @@ +EGL_EXT_output_base +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_output_base + + EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) + EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) + EGL_BAD_OUTPUT_LAYER_EXT 0x322D + EGL_BAD_OUTPUT_PORT_EXT 0x322E + EGL_SWAP_INTERVAL_EXT 0x322F + EGLBoolean eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputLayerEXT * layers, EGLint max_layers, EGLint * num_layers) + EGLBoolean eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputPortEXT * ports, EGLint max_ports, EGLint * num_ports) + EGLBoolean eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value) + EGLBoolean eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value) + EGLBoolean eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib * value) + const char * eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name) + EGLBoolean eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib * value) + const char * eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_output_drm b/Windows/glew/auto/extensions/gl/EGL_EXT_output_drm new file mode 100644 index 00000000..4fa74c74 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_output_drm @@ -0,0 +1,7 @@ +EGL_EXT_output_drm +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_output_drm + + EGL_DRM_CRTC_EXT 0x3234 + EGL_DRM_PLANE_EXT 0x3235 + EGL_DRM_CONNECTOR_EXT 0x3236 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_output_openwf b/Windows/glew/auto/extensions/gl/EGL_EXT_output_openwf new file mode 100644 index 00000000..5c91d616 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_output_openwf @@ -0,0 +1,6 @@ +EGL_EXT_output_openwf +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_output_openwf + + EGL_OPENWF_PIPELINE_ID_EXT 0x3238 + EGL_OPENWF_PORT_ID_EXT 0x3239 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_pixel_format_float b/Windows/glew/auto/extensions/gl/EGL_EXT_pixel_format_float new file mode 100644 index 00000000..06e99598 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_pixel_format_float @@ -0,0 +1,7 @@ +EGL_EXT_pixel_format_float +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_pixel_format_float + + EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 + EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A + EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_platform_base b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_base new file mode 100644 index 00000000..2e8f2f4a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_base @@ -0,0 +1,7 @@ +EGL_EXT_platform_base +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_platform_base + + EGLSurface eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLint * attrib_list) + EGLSurface eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLint * attrib_list) + EGLDisplay eglGetPlatformDisplayEXT (EGLenum platform, void * native_display, const EGLint * attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_platform_device b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_device new file mode 100644 index 00000000..c2e8cfed --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_device @@ -0,0 +1,5 @@ +EGL_EXT_platform_device +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_platform_device + + EGL_PLATFORM_DEVICE_EXT 0x313F diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_platform_wayland b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_wayland new file mode 100644 index 00000000..d1f07783 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_wayland @@ -0,0 +1,5 @@ +EGL_EXT_platform_wayland +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_platform_wayland + + EGL_PLATFORM_WAYLAND_EXT 0x31D8 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_platform_x11 b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_x11 new file mode 100644 index 00000000..5fb32b1f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_platform_x11 @@ -0,0 +1,6 @@ +EGL_EXT_platform_x11 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_platform_x11 + + EGL_PLATFORM_X11_EXT 0x31D5 + EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_protected_content b/Windows/glew/auto/extensions/gl/EGL_EXT_protected_content new file mode 100644 index 00000000..8d274a2a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_protected_content @@ -0,0 +1,5 @@ +EGL_EXT_protected_content +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_protected_content + + EGL_PROTECTED_CONTENT_EXT 0x32C0 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_protected_surface b/Windows/glew/auto/extensions/gl/EGL_EXT_protected_surface new file mode 100644 index 00000000..b2444bc5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_protected_surface @@ -0,0 +1,5 @@ +EGL_EXT_protected_surface +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_protected_surface + + EGL_PROTECTED_CONTENT_EXT 0x32C0 diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_stream_consumer_egloutput b/Windows/glew/auto/extensions/gl/EGL_EXT_stream_consumer_egloutput new file mode 100644 index 00000000..0bf40039 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_stream_consumer_egloutput @@ -0,0 +1,5 @@ +EGL_EXT_stream_consumer_egloutput +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_stream_consumer_egloutput + + EGLBoolean eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_surface_SMPTE2086_metadata b/Windows/glew/auto/extensions/gl/EGL_EXT_surface_SMPTE2086_metadata new file mode 100644 index 00000000..e9e636d0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_surface_SMPTE2086_metadata @@ -0,0 +1,14 @@ +EGL_EXT_surface_SMPTE2086_metadata +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_surface_SMPTE2086_metadata + + EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 + EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 + EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 + EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 + EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 + EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 + EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 + EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 + EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 + EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_swap_buffers_with_damage b/Windows/glew/auto/extensions/gl/EGL_EXT_swap_buffers_with_damage new file mode 100644 index 00000000..ff066437 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_swap_buffers_with_damage @@ -0,0 +1,5 @@ +EGL_EXT_swap_buffers_with_damage +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_swap_buffers_with_damage + + EGLBoolean eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects) diff --git a/Windows/glew/auto/extensions/gl/EGL_EXT_yuv_surface b/Windows/glew/auto/extensions/gl/EGL_EXT_yuv_surface new file mode 100644 index 00000000..8c3f86e7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_EXT_yuv_surface @@ -0,0 +1,29 @@ +EGL_EXT_yuv_surface +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_EXT_yuv_surface + + EGL_YUV_BUFFER_EXT 0x3300 + EGL_YUV_ORDER_EXT 0x3301 + EGL_YUV_ORDER_YUV_EXT 0x3302 + EGL_YUV_ORDER_YVU_EXT 0x3303 + EGL_YUV_ORDER_YUYV_EXT 0x3304 + EGL_YUV_ORDER_UYVY_EXT 0x3305 + EGL_YUV_ORDER_YVYU_EXT 0x3306 + EGL_YUV_ORDER_VYUY_EXT 0x3307 + EGL_YUV_ORDER_AYUV_EXT 0x3308 + EGL_YUV_CSC_STANDARD_EXT 0x330A + EGL_YUV_CSC_STANDARD_601_EXT 0x330B + EGL_YUV_CSC_STANDARD_709_EXT 0x330C + EGL_YUV_CSC_STANDARD_2020_EXT 0x330D + EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 + EGL_YUV_SUBSAMPLE_EXT 0x3312 + EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 + EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 + EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 + EGL_YUV_DEPTH_RANGE_EXT 0x3317 + EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 + EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 + EGL_YUV_PLANE_BPP_EXT 0x331A + EGL_YUV_PLANE_BPP_0_EXT 0x331B + EGL_YUV_PLANE_BPP_8_EXT 0x331C + EGL_YUV_PLANE_BPP_10_EXT 0x331D diff --git a/Windows/glew/auto/extensions/gl/EGL_HI_clientpixmap b/Windows/glew/auto/extensions/gl/EGL_HI_clientpixmap new file mode 100644 index 00000000..be9824e6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_HI_clientpixmap @@ -0,0 +1,6 @@ +EGL_HI_clientpixmap +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_HI_clientpixmap + + EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 + EGLSurface eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI * pixmap) diff --git a/Windows/glew/auto/extensions/gl/EGL_HI_colorformats b/Windows/glew/auto/extensions/gl/EGL_HI_colorformats new file mode 100644 index 00000000..138a266c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_HI_colorformats @@ -0,0 +1,8 @@ +EGL_HI_colorformats +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_HI_colorformats + + EGL_COLOR_FORMAT_HI 0x8F70 + EGL_COLOR_RGB_HI 0x8F71 + EGL_COLOR_RGBA_HI 0x8F72 + EGL_COLOR_ARGB_HI 0x8F73 diff --git a/Windows/glew/auto/extensions/gl/EGL_IMG_context_priority b/Windows/glew/auto/extensions/gl/EGL_IMG_context_priority new file mode 100644 index 00000000..fce013b9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_IMG_context_priority @@ -0,0 +1,8 @@ +EGL_IMG_context_priority +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_IMG_context_priority + + EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 + EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 + EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 + EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 diff --git a/Windows/glew/auto/extensions/gl/EGL_IMG_image_plane_attribs b/Windows/glew/auto/extensions/gl/EGL_IMG_image_plane_attribs new file mode 100644 index 00000000..80c2c1b0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_IMG_image_plane_attribs @@ -0,0 +1,6 @@ +EGL_IMG_image_plane_attribs +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_IMG_image_plane_attribs + + EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 + EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_cl_event b/Windows/glew/auto/extensions/gl/EGL_KHR_cl_event new file mode 100644 index 00000000..1c70d957 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_cl_event @@ -0,0 +1,7 @@ +EGL_KHR_cl_event +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_cl_event + + EGL_CL_EVENT_HANDLE_KHR 0x309C + EGL_SYNC_CL_EVENT_KHR 0x30FE + EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_cl_event2 b/Windows/glew/auto/extensions/gl/EGL_KHR_cl_event2 new file mode 100644 index 00000000..c93a2f17 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_cl_event2 @@ -0,0 +1,8 @@ +EGL_KHR_cl_event2 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_cl_event2 + + EGL_CL_EVENT_HANDLE_KHR 0x309C + EGL_SYNC_CL_EVENT_KHR 0x30FE + EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + EGLSyncKHR eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR * attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_client_get_all_proc_addresses b/Windows/glew/auto/extensions/gl/EGL_KHR_client_get_all_proc_addresses new file mode 100644 index 00000000..3b5e9512 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_client_get_all_proc_addresses @@ -0,0 +1,4 @@ +EGL_KHR_client_get_all_proc_addresses +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_client_get_all_proc_addresses + diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_config_attribs b/Windows/glew/auto/extensions/gl/EGL_KHR_config_attribs new file mode 100644 index 00000000..31c556a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_config_attribs @@ -0,0 +1,7 @@ +EGL_KHR_config_attribs +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_config_attribs + + EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 + EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 + EGL_CONFORMANT_KHR 0x3042 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_context_flush_control b/Windows/glew/auto/extensions/gl/EGL_KHR_context_flush_control new file mode 100644 index 00000000..9064a7af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_context_flush_control @@ -0,0 +1,7 @@ +EGL_KHR_context_flush_control +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_context_flush_control + + EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 + EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 + EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_create_context b/Windows/glew/auto/extensions/gl/EGL_KHR_create_context new file mode 100644 index 00000000..e79485b1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_create_context @@ -0,0 +1,18 @@ +EGL_KHR_create_context +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_create_context + + EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 + EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 + EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 + EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 + EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 + EGL_OPENGL_ES3_BIT 0x00000040 + EGL_OPENGL_ES3_BIT_KHR 0x00000040 + EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 + EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB + EGL_CONTEXT_FLAGS_KHR 0x30FC + EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD + EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD + EGL_NO_RESET_NOTIFICATION_KHR 0x31BE + EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_create_context_no_error b/Windows/glew/auto/extensions/gl/EGL_KHR_create_context_no_error new file mode 100644 index 00000000..72a19281 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_create_context_no_error @@ -0,0 +1,5 @@ +EGL_KHR_create_context_no_error +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_create_context_no_error + + EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_debug b/Windows/glew/auto/extensions/gl/EGL_KHR_debug new file mode 100644 index 00000000..e06c10b8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_debug @@ -0,0 +1,19 @@ +EGL_KHR_debug +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_debug + + EGL_OBJECT_THREAD_KHR 0x33B0 + EGL_OBJECT_DISPLAY_KHR 0x33B1 + EGL_OBJECT_CONTEXT_KHR 0x33B2 + EGL_OBJECT_SURFACE_KHR 0x33B3 + EGL_OBJECT_IMAGE_KHR 0x33B4 + EGL_OBJECT_SYNC_KHR 0x33B5 + EGL_OBJECT_STREAM_KHR 0x33B6 + EGL_DEBUG_CALLBACK_KHR 0x33B8 + EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 + EGL_DEBUG_MSG_ERROR_KHR 0x33BA + EGL_DEBUG_MSG_WARN_KHR 0x33BB + EGL_DEBUG_MSG_INFO_KHR 0x33BC + EGLint eglDebugMessageControlKHR (EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list) + EGLint eglLabelObjectKHR (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label) + EGLBoolean eglQueryDebugKHR (EGLint attribute, EGLAttrib * value) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_fence_sync b/Windows/glew/auto/extensions/gl/EGL_KHR_fence_sync new file mode 100644 index 00000000..398b2922 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_fence_sync @@ -0,0 +1,7 @@ +EGL_KHR_fence_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_fence_sync + + EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 + EGL_SYNC_CONDITION_KHR 0x30F8 + EGL_SYNC_FENCE_KHR 0x30F9 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_get_all_proc_addresses b/Windows/glew/auto/extensions/gl/EGL_KHR_get_all_proc_addresses new file mode 100644 index 00000000..86e3b315 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_get_all_proc_addresses @@ -0,0 +1,4 @@ +EGL_KHR_get_all_proc_addresses +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_get_all_proc_addresses + diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_gl_colorspace b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_colorspace new file mode 100644 index 00000000..791e9dbf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_colorspace @@ -0,0 +1,7 @@ +EGL_KHR_gl_colorspace +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_gl_colorspace + + EGL_GL_COLORSPACE_SRGB_KHR 0x3089 + EGL_GL_COLORSPACE_LINEAR_KHR 0x308A + EGL_GL_COLORSPACE_KHR 0x309D diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_gl_renderbuffer_image b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_renderbuffer_image new file mode 100644 index 00000000..eac2ce61 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_renderbuffer_image @@ -0,0 +1,5 @@ +EGL_KHR_gl_renderbuffer_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_gl_renderbuffer_image + + EGL_GL_RENDERBUFFER_KHR 0x30B9 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_2D_image b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_2D_image new file mode 100644 index 00000000..68787eeb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_2D_image @@ -0,0 +1,6 @@ +EGL_KHR_gl_texture_2D_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_gl_texture_2D_image + + EGL_GL_TEXTURE_2D_KHR 0x30B1 + EGL_GL_TEXTURE_LEVEL_KHR 0x30BC diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_3D_image b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_3D_image new file mode 100644 index 00000000..ced8357f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_3D_image @@ -0,0 +1,6 @@ +EGL_KHR_gl_texture_3D_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_gl_texture_3D_image + + EGL_GL_TEXTURE_3D_KHR 0x30B2 + EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_cubemap_image b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_cubemap_image new file mode 100644 index 00000000..81079d9b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_gl_texture_cubemap_image @@ -0,0 +1,10 @@ +EGL_KHR_gl_texture_cubemap_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_gl_texture_cubemap_image + + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_image b/Windows/glew/auto/extensions/gl/EGL_KHR_image new file mode 100644 index 00000000..c72f09de --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_image @@ -0,0 +1,8 @@ +EGL_KHR_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_image + + EGL_NO_IMAGE_KHR ((EGLImageKHR)0) + EGL_NATIVE_PIXMAP_KHR 0x30B0 + EGLImageKHR eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint * attrib_list) + EGLBoolean eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_image_base b/Windows/glew/auto/extensions/gl/EGL_KHR_image_base new file mode 100644 index 00000000..4a082c10 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_image_base @@ -0,0 +1,6 @@ +EGL_KHR_image_base +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_image_base + + EGL_NO_IMAGE_KHR ((EGLImageKHR)0) + EGL_IMAGE_PRESERVED_KHR 0x30D2 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_image_pixmap b/Windows/glew/auto/extensions/gl/EGL_KHR_image_pixmap new file mode 100644 index 00000000..ab3b2433 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_image_pixmap @@ -0,0 +1,5 @@ +EGL_KHR_image_pixmap +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_image_pixmap + + EGL_NATIVE_PIXMAP_KHR 0x30B0 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface b/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface new file mode 100644 index 00000000..973bb155 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface @@ -0,0 +1,27 @@ +EGL_KHR_lock_surface +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_lock_surface + + EGL_READ_SURFACE_BIT_KHR 0x0001 + EGL_WRITE_SURFACE_BIT_KHR 0x0002 + EGL_LOCK_SURFACE_BIT_KHR 0x0080 + EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 + EGL_MATCH_FORMAT_KHR 0x3043 + EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 + EGL_FORMAT_RGB_565_KHR 0x30C1 + EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 + EGL_FORMAT_RGBA_8888_KHR 0x30C3 + EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 + EGL_LOCK_USAGE_HINT_KHR 0x30C5 + EGL_BITMAP_POINTER_KHR 0x30C6 + EGL_BITMAP_PITCH_KHR 0x30C7 + EGL_BITMAP_ORIGIN_KHR 0x30C8 + EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 + EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA + EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB + EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC + EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD + EGL_LOWER_LEFT_KHR 0x30CE + EGL_UPPER_LEFT_KHR 0x30CF + EGLBoolean eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint * attrib_list) + EGLBoolean eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface2 b/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface2 new file mode 100644 index 00000000..0c4fd147 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface2 @@ -0,0 +1,5 @@ +EGL_KHR_lock_surface2 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_lock_surface2 + + EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface3 b/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface3 new file mode 100644 index 00000000..4c0e13a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_lock_surface3 @@ -0,0 +1,27 @@ +EGL_KHR_lock_surface3 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_lock_surface3 + + EGL_READ_SURFACE_BIT_KHR 0x0001 + EGL_WRITE_SURFACE_BIT_KHR 0x0002 + EGL_LOCK_SURFACE_BIT_KHR 0x0080 + EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 + EGL_MATCH_FORMAT_KHR 0x3043 + EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 + EGL_FORMAT_RGB_565_KHR 0x30C1 + EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 + EGL_FORMAT_RGBA_8888_KHR 0x30C3 + EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 + EGL_LOCK_USAGE_HINT_KHR 0x30C5 + EGL_BITMAP_POINTER_KHR 0x30C6 + EGL_BITMAP_PITCH_KHR 0x30C7 + EGL_BITMAP_ORIGIN_KHR 0x30C8 + EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 + EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA + EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB + EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC + EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD + EGL_LOWER_LEFT_KHR 0x30CE + EGL_UPPER_LEFT_KHR 0x30CF + EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + EGLBoolean eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR * value) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_mutable_render_buffer b/Windows/glew/auto/extensions/gl/EGL_KHR_mutable_render_buffer new file mode 100644 index 00000000..fefff285 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_mutable_render_buffer @@ -0,0 +1,5 @@ +EGL_KHR_mutable_render_buffer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_mutable_render_buffer + + EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_no_config_context b/Windows/glew/auto/extensions/gl/EGL_KHR_no_config_context new file mode 100644 index 00000000..4cb685dd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_no_config_context @@ -0,0 +1,5 @@ +EGL_KHR_no_config_context +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_no_config_context + + EGL_NO_CONFIG_KHR ((EGLConfig)0) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_partial_update b/Windows/glew/auto/extensions/gl/EGL_KHR_partial_update new file mode 100644 index 00000000..7a03d3a9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_partial_update @@ -0,0 +1,6 @@ +EGL_KHR_partial_update +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_partial_update + + EGL_BUFFER_AGE_KHR 0x313D + EGLBoolean eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_platform_android b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_android new file mode 100644 index 00000000..b658e3fa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_android @@ -0,0 +1,5 @@ +EGL_KHR_platform_android +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_platform_android + + EGL_PLATFORM_ANDROID_KHR 0x3141 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_platform_gbm b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_gbm new file mode 100644 index 00000000..d14df5da --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_gbm @@ -0,0 +1,5 @@ +EGL_KHR_platform_gbm +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_platform_gbm + + EGL_PLATFORM_GBM_KHR 0x31D7 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_platform_wayland b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_wayland new file mode 100644 index 00000000..e0d13510 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_wayland @@ -0,0 +1,5 @@ +EGL_KHR_platform_wayland +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_platform_wayland + + EGL_PLATFORM_WAYLAND_KHR 0x31D8 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_platform_x11 b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_x11 new file mode 100644 index 00000000..ec9bd6cc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_platform_x11 @@ -0,0 +1,6 @@ +EGL_KHR_platform_x11 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_platform_x11 + + EGL_PLATFORM_X11_KHR 0x31D5 + EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_reusable_sync b/Windows/glew/auto/extensions/gl/EGL_KHR_reusable_sync new file mode 100644 index 00000000..2c82713f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_reusable_sync @@ -0,0 +1,19 @@ +EGL_KHR_reusable_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_reusable_sync + + EGL_NO_SYNC_KHR ((EGLSyncKHR)0) + EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 + EGL_SYNC_STATUS_KHR 0x30F1 + EGL_SIGNALED_KHR 0x30F2 + EGL_UNSIGNALED_KHR 0x30F3 + EGL_TIMEOUT_EXPIRED_KHR 0x30F5 + EGL_CONDITION_SATISFIED_KHR 0x30F6 + EGL_SYNC_TYPE_KHR 0x30F7 + EGL_SYNC_REUSABLE_KHR 0x30FA + EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFF + EGLint eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) + EGLSyncKHR eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint * attrib_list) + EGLBoolean eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync) + EGLBoolean eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint * value) + EGLBoolean eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream b/Windows/glew/auto/extensions/gl/EGL_KHR_stream new file mode 100644 index 00000000..49db7336 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream @@ -0,0 +1,22 @@ +EGL_KHR_stream +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream + + EGL_NO_STREAM_KHR ((EGLStreamKHR)0) + EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 + EGL_PRODUCER_FRAME_KHR 0x3212 + EGL_CONSUMER_FRAME_KHR 0x3213 + EGL_STREAM_STATE_KHR 0x3214 + EGL_STREAM_STATE_CREATED_KHR 0x3215 + EGL_STREAM_STATE_CONNECTING_KHR 0x3216 + EGL_STREAM_STATE_EMPTY_KHR 0x3217 + EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 + EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 + EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A + EGL_BAD_STREAM_KHR 0x321B + EGL_BAD_STATE_KHR 0x321C + EGLStreamKHR eglCreateStreamKHR (EGLDisplay dpy, const EGLint * attrib_list) + EGLBoolean eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream) + EGLBoolean eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint * value) + EGLBoolean eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR * value) + EGLBoolean eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream_attrib b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_attrib new file mode 100644 index 00000000..54d5516b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_attrib @@ -0,0 +1,13 @@ +EGL_KHR_stream_attrib +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream_attrib + + EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 + EGL_STREAM_STATE_KHR 0x3214 + EGL_STREAM_STATE_CREATED_KHR 0x3215 + EGL_STREAM_STATE_CONNECTING_KHR 0x3216 + EGLStreamKHR eglCreateStreamAttribKHR (EGLDisplay dpy, const EGLAttrib * attrib_list) + EGLBoolean eglQueryStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib * value) + EGLBoolean eglSetStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value) + EGLBoolean eglStreamConsumerAcquireAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list) + EGLBoolean eglStreamConsumerReleaseAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream_consumer_gltexture b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_consumer_gltexture new file mode 100644 index 00000000..fec6664b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_consumer_gltexture @@ -0,0 +1,8 @@ +EGL_KHR_stream_consumer_gltexture +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream_consumer_gltexture + + EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E + EGLBoolean eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream) + EGLBoolean eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream) + EGLBoolean eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream_cross_process_fd b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_cross_process_fd new file mode 100644 index 00000000..afd65526 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_cross_process_fd @@ -0,0 +1,7 @@ +EGL_KHR_stream_cross_process_fd +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream_cross_process_fd + + EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) + EGLStreamKHR eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor) + EGLNativeFileDescriptorKHR eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream_fifo b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_fifo new file mode 100644 index 00000000..905072ae --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_fifo @@ -0,0 +1,9 @@ +EGL_KHR_stream_fifo +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream_fifo + + EGL_STREAM_FIFO_LENGTH_KHR 0x31FC + EGL_STREAM_TIME_NOW_KHR 0x31FD + EGL_STREAM_TIME_CONSUMER_KHR 0x31FE + EGL_STREAM_TIME_PRODUCER_KHR 0x31FF + EGLBoolean eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR * value) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream_producer_aldatalocator b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_producer_aldatalocator new file mode 100644 index 00000000..27d08de3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_producer_aldatalocator @@ -0,0 +1,4 @@ +EGL_KHR_stream_producer_aldatalocator +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream_producer_aldatalocator + diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_stream_producer_eglsurface b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_producer_eglsurface new file mode 100644 index 00000000..ab67355b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_stream_producer_eglsurface @@ -0,0 +1,6 @@ +EGL_KHR_stream_producer_eglsurface +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_stream_producer_eglsurface + + EGL_STREAM_BIT_KHR 0x0800 + EGLSurface eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint * attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_surfaceless_context b/Windows/glew/auto/extensions/gl/EGL_KHR_surfaceless_context new file mode 100644 index 00000000..70ad0151 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_surfaceless_context @@ -0,0 +1,4 @@ +EGL_KHR_surfaceless_context +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_surfaceless_context + diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_swap_buffers_with_damage b/Windows/glew/auto/extensions/gl/EGL_KHR_swap_buffers_with_damage new file mode 100644 index 00000000..3fab45b7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_swap_buffers_with_damage @@ -0,0 +1,5 @@ +EGL_KHR_swap_buffers_with_damage +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_swap_buffers_with_damage + + EGLBoolean eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects) diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_vg_parent_image b/Windows/glew/auto/extensions/gl/EGL_KHR_vg_parent_image new file mode 100644 index 00000000..b2d3e393 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_vg_parent_image @@ -0,0 +1,5 @@ +EGL_KHR_vg_parent_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_vg_parent_image + + EGL_VG_PARENT_IMAGE_KHR 0x30BA diff --git a/Windows/glew/auto/extensions/gl/EGL_KHR_wait_sync b/Windows/glew/auto/extensions/gl/EGL_KHR_wait_sync new file mode 100644 index 00000000..22ccf2c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_KHR_wait_sync @@ -0,0 +1,5 @@ +EGL_KHR_wait_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_KHR_wait_sync + + EGLint eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) diff --git a/Windows/glew/auto/extensions/gl/EGL_MESA_drm_image b/Windows/glew/auto/extensions/gl/EGL_MESA_drm_image new file mode 100644 index 00000000..48191445 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_MESA_drm_image @@ -0,0 +1,13 @@ +EGL_MESA_drm_image +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_MESA_drm_image + + EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 + EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 + EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 + EGL_DRM_BUFFER_USE_MESA 0x31D1 + EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 + EGL_DRM_BUFFER_MESA 0x31D3 + EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 + EGLImageKHR eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint * attrib_list) + EGLBoolean eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint * name, EGLint * handle, EGLint * stride) diff --git a/Windows/glew/auto/extensions/gl/EGL_MESA_image_dma_buf_export b/Windows/glew/auto/extensions/gl/EGL_MESA_image_dma_buf_export new file mode 100644 index 00000000..3ab5abf0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_MESA_image_dma_buf_export @@ -0,0 +1,6 @@ +EGL_MESA_image_dma_buf_export +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_MESA_image_dma_buf_export + + EGLBoolean eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int * fds, EGLint * strides, EGLint * offsets) + EGLBoolean eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int * fourcc, int * num_planes, EGLuint64KHR * modifiers) diff --git a/Windows/glew/auto/extensions/gl/EGL_MESA_platform_gbm b/Windows/glew/auto/extensions/gl/EGL_MESA_platform_gbm new file mode 100644 index 00000000..c80e4e2a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_MESA_platform_gbm @@ -0,0 +1,5 @@ +EGL_MESA_platform_gbm +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_MESA_platform_gbm + + EGL_PLATFORM_GBM_MESA 0x31D7 diff --git a/Windows/glew/auto/extensions/gl/EGL_MESA_platform_surfaceless b/Windows/glew/auto/extensions/gl/EGL_MESA_platform_surfaceless new file mode 100644 index 00000000..88f553f9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_MESA_platform_surfaceless @@ -0,0 +1,5 @@ +EGL_MESA_platform_surfaceless +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_MESA_platform_surfaceless + + EGL_PLATFORM_SURFACELESS_MESA 0x31DD diff --git a/Windows/glew/auto/extensions/gl/EGL_NOK_swap_region b/Windows/glew/auto/extensions/gl/EGL_NOK_swap_region new file mode 100644 index 00000000..9891fa57 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NOK_swap_region @@ -0,0 +1,5 @@ +EGL_NOK_swap_region +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NOK_swap_region + + EGLBoolean eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects) diff --git a/Windows/glew/auto/extensions/gl/EGL_NOK_swap_region2 b/Windows/glew/auto/extensions/gl/EGL_NOK_swap_region2 new file mode 100644 index 00000000..befcd679 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NOK_swap_region2 @@ -0,0 +1,5 @@ +EGL_NOK_swap_region2 +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NOK_swap_region2 + + EGLBoolean eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects) diff --git a/Windows/glew/auto/extensions/gl/EGL_NOK_texture_from_pixmap b/Windows/glew/auto/extensions/gl/EGL_NOK_texture_from_pixmap new file mode 100644 index 00000000..34b9fa41 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NOK_texture_from_pixmap @@ -0,0 +1,5 @@ +EGL_NOK_texture_from_pixmap +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NOK_texture_from_pixmap + + EGL_Y_INVERTED_NOK 0x307F diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_3dvision_surface b/Windows/glew/auto/extensions/gl/EGL_NV_3dvision_surface new file mode 100644 index 00000000..82265383 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_3dvision_surface @@ -0,0 +1,5 @@ +EGL_NV_3dvision_surface +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_3dvision_surface + + EGL_AUTO_STEREO_NV 0x3136 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_coverage_sample b/Windows/glew/auto/extensions/gl/EGL_NV_coverage_sample new file mode 100644 index 00000000..85bbbe85 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_coverage_sample @@ -0,0 +1,6 @@ +EGL_NV_coverage_sample +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_coverage_sample + + EGL_COVERAGE_BUFFERS_NV 0x30E0 + EGL_COVERAGE_SAMPLES_NV 0x30E1 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_coverage_sample_resolve b/Windows/glew/auto/extensions/gl/EGL_NV_coverage_sample_resolve new file mode 100644 index 00000000..04e5345d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_coverage_sample_resolve @@ -0,0 +1,7 @@ +EGL_NV_coverage_sample_resolve +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_coverage_sample_resolve + + EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 + EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 + EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_cuda_event b/Windows/glew/auto/extensions/gl/EGL_NV_cuda_event new file mode 100644 index 00000000..9ecb5c8f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_cuda_event @@ -0,0 +1,7 @@ +EGL_NV_cuda_event +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_cuda_event + + EGL_CUDA_EVENT_HANDLE_NV 0x323B + EGL_SYNC_CUDA_EVENT_NV 0x323C + EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_depth_nonlinear b/Windows/glew/auto/extensions/gl/EGL_NV_depth_nonlinear new file mode 100644 index 00000000..c870064a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_depth_nonlinear @@ -0,0 +1,7 @@ +EGL_NV_depth_nonlinear +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_depth_nonlinear + + EGL_DEPTH_ENCODING_NONE_NV 0 + EGL_DEPTH_ENCODING_NV 0x30E2 + EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_device_cuda b/Windows/glew/auto/extensions/gl/EGL_NV_device_cuda new file mode 100644 index 00000000..7be003a1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_device_cuda @@ -0,0 +1,5 @@ +EGL_NV_device_cuda +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_device_cuda + + EGL_CUDA_DEVICE_NV 0x323A diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_native_query b/Windows/glew/auto/extensions/gl/EGL_NV_native_query new file mode 100644 index 00000000..ac97a5fb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_native_query @@ -0,0 +1,7 @@ +EGL_NV_native_query +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_native_query + + EGLBoolean eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType * display_id) + EGLBoolean eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType * pixmap) + EGLBoolean eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType * window) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_post_convert_rounding b/Windows/glew/auto/extensions/gl/EGL_NV_post_convert_rounding new file mode 100644 index 00000000..2997df35 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_post_convert_rounding @@ -0,0 +1,4 @@ +EGL_NV_post_convert_rounding +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_post_convert_rounding + diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_post_sub_buffer b/Windows/glew/auto/extensions/gl/EGL_NV_post_sub_buffer new file mode 100644 index 00000000..ae4152be --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_post_sub_buffer @@ -0,0 +1,6 @@ +EGL_NV_post_sub_buffer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_post_sub_buffer + + EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE + EGLBoolean eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_robustness_video_memory_purge b/Windows/glew/auto/extensions/gl/EGL_NV_robustness_video_memory_purge new file mode 100644 index 00000000..c069b18e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_robustness_video_memory_purge @@ -0,0 +1,5 @@ +EGL_NV_robustness_video_memory_purge +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_robustness_video_memory_purge + + EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_consumer_gltexture_yuv b/Windows/glew/auto/extensions/gl/EGL_NV_stream_consumer_gltexture_yuv new file mode 100644 index 00000000..5409bbde --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_consumer_gltexture_yuv @@ -0,0 +1,10 @@ +EGL_NV_stream_consumer_gltexture_yuv +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_consumer_gltexture_yuv + + EGL_YUV_BUFFER_EXT 0x3300 + EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 + EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C + EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D + EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E + EGLBoolean eglStreamConsumerGLTextureExternalAttribsNV (EGLDisplay dpy, EGLStreamKHR stream, EGLAttrib *attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_display b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_display new file mode 100644 index 00000000..0fefcd9b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_display @@ -0,0 +1,5 @@ +EGL_NV_stream_cross_display +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_cross_display + + EGL_STREAM_CROSS_DISPLAY_NV 0x334E diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_object b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_object new file mode 100644 index 00000000..3dbc0f53 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_object @@ -0,0 +1,5 @@ +EGL_NV_stream_cross_object +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_cross_object + + EGL_STREAM_CROSS_OBJECT_NV 0x334D diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_partition b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_partition new file mode 100644 index 00000000..d2ae4bf3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_partition @@ -0,0 +1,5 @@ +EGL_NV_stream_cross_partition +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_cross_partition + + EGL_STREAM_CROSS_PARTITION_NV 0x323F diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_process b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_process new file mode 100644 index 00000000..93245f28 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_process @@ -0,0 +1,5 @@ +EGL_NV_stream_cross_process +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_cross_process + + EGL_STREAM_CROSS_PROCESS_NV 0x3245 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_system b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_system new file mode 100644 index 00000000..1e180485 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_cross_system @@ -0,0 +1,5 @@ +EGL_NV_stream_cross_system +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_cross_system + + EGL_STREAM_CROSS_SYSTEM_NV 0x334F diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_fifo_next b/Windows/glew/auto/extensions/gl/EGL_NV_stream_fifo_next new file mode 100644 index 00000000..a313323b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_fifo_next @@ -0,0 +1,6 @@ +EGL_NV_stream_fifo_next +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_fifo_next + + EGL_PENDING_FRAME_NV 0x3329 + EGL_STREAM_TIME_PENDING_NV 0x332A diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_fifo_synchronous b/Windows/glew/auto/extensions/gl/EGL_NV_stream_fifo_synchronous new file mode 100644 index 00000000..d8631ba6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_fifo_synchronous @@ -0,0 +1,5 @@ +EGL_NV_stream_fifo_synchronous +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_fifo_synchronous + + EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_frame_limits b/Windows/glew/auto/extensions/gl/EGL_NV_stream_frame_limits new file mode 100644 index 00000000..2bad6f4f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_frame_limits @@ -0,0 +1,6 @@ +EGL_NV_stream_frame_limits +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_frame_limits + + EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 + EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_metadata b/Windows/glew/auto/extensions/gl/EGL_NV_stream_metadata new file mode 100644 index 00000000..24e0477c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_metadata @@ -0,0 +1,21 @@ +EGL_NV_stream_metadata +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_metadata + + EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 + EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 + EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 + EGL_PRODUCER_METADATA_NV 0x3253 + EGL_CONSUMER_METADATA_NV 0x3254 + EGL_METADATA0_SIZE_NV 0x3255 + EGL_METADATA1_SIZE_NV 0x3256 + EGL_METADATA2_SIZE_NV 0x3257 + EGL_METADATA3_SIZE_NV 0x3258 + EGL_METADATA0_TYPE_NV 0x3259 + EGL_METADATA1_TYPE_NV 0x325A + EGL_METADATA2_TYPE_NV 0x325B + EGL_METADATA3_TYPE_NV 0x325C + EGL_PENDING_METADATA_NV 0x3328 + EGLBoolean eglQueryDisplayAttribNV (EGLDisplay dpy, EGLint attribute, EGLAttrib * value) + EGLBoolean eglQueryStreamMetadataNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void * data) + EGLBoolean eglSetStreamMetadataNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void * data) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_remote b/Windows/glew/auto/extensions/gl/EGL_NV_stream_remote new file mode 100644 index 00000000..9912d751 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_remote @@ -0,0 +1,12 @@ +EGL_NV_stream_remote +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_remote + + EGL_STREAM_STATE_INITIALIZING_NV 0x3240 + EGL_STREAM_TYPE_NV 0x3241 + EGL_STREAM_PROTOCOL_NV 0x3242 + EGL_STREAM_ENDPOINT_NV 0x3243 + EGL_STREAM_LOCAL_NV 0x3244 + EGL_STREAM_PROTOCOL_FD_NV 0x3246 + EGL_STREAM_PRODUCER_NV 0x3247 + EGL_STREAM_CONSUMER_NV 0x3248 diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_reset b/Windows/glew/auto/extensions/gl/EGL_NV_stream_reset new file mode 100644 index 00000000..978baaed --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_reset @@ -0,0 +1,7 @@ +EGL_NV_stream_reset +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_reset + + EGL_SUPPORT_RESET_NV 0x3334 + EGL_SUPPORT_REUSE_NV 0x3335 + EGLBoolean eglResetStreamNV (EGLDisplay dpy, EGLStreamKHR stream) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket b/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket new file mode 100644 index 00000000..878cd9ce --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket @@ -0,0 +1,7 @@ +EGL_NV_stream_socket +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_socket + + EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B + EGL_SOCKET_HANDLE_NV 0x324C + EGL_SOCKET_TYPE_NV 0x324D diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket_inet b/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket_inet new file mode 100644 index 00000000..14f69fef --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket_inet @@ -0,0 +1,5 @@ +EGL_NV_stream_socket_inet +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_socket_inet + + EGL_SOCKET_TYPE_INET_NV 0x324F diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket_unix b/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket_unix new file mode 100644 index 00000000..12914702 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_socket_unix @@ -0,0 +1,5 @@ +EGL_NV_stream_socket_unix +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_socket_unix + + EGL_SOCKET_TYPE_UNIX_NV 0x324E diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_stream_sync b/Windows/glew/auto/extensions/gl/EGL_NV_stream_sync new file mode 100644 index 00000000..77bb3bff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_stream_sync @@ -0,0 +1,7 @@ +EGL_NV_stream_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_stream_sync + + EGL_SYNC_TYPE_KHR 0x30F7 + EGL_SYNC_NEW_FRAME_NV 0x321F + EGLSyncKHR eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint * attrib_list) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_sync b/Windows/glew/auto/extensions/gl/EGL_NV_sync new file mode 100644 index 00000000..0998ea13 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_sync @@ -0,0 +1,23 @@ +EGL_NV_sync +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_sync + + EGL_NO_SYNC_NV ((EGLSyncNV)0) + EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 + EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 + EGL_SYNC_STATUS_NV 0x30E7 + EGL_SIGNALED_NV 0x30E8 + EGL_UNSIGNALED_NV 0x30E9 + EGL_ALREADY_SIGNALED_NV 0x30EA + EGL_TIMEOUT_EXPIRED_NV 0x30EB + EGL_CONDITION_SATISFIED_NV 0x30EC + EGL_SYNC_TYPE_NV 0x30ED + EGL_SYNC_CONDITION_NV 0x30EE + EGL_SYNC_FENCE_NV 0x30EF + EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFF + EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout) + EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint * attrib_list) + EGLBoolean eglDestroySyncNV (EGLSyncNV sync) + EGLBoolean eglFenceNV (EGLSyncNV sync) + EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint * value) + EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode) diff --git a/Windows/glew/auto/extensions/gl/EGL_NV_system_time b/Windows/glew/auto/extensions/gl/EGL_NV_system_time new file mode 100644 index 00000000..4039e6e1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_NV_system_time @@ -0,0 +1,6 @@ +EGL_NV_system_time +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_NV_system_time + + EGLuint64NV eglGetSystemTimeFrequencyNV ( void ) + EGLuint64NV eglGetSystemTimeNV ( void ) diff --git a/Windows/glew/auto/extensions/gl/EGL_TIZEN_image_native_buffer b/Windows/glew/auto/extensions/gl/EGL_TIZEN_image_native_buffer new file mode 100644 index 00000000..eff695d3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_TIZEN_image_native_buffer @@ -0,0 +1,5 @@ +EGL_TIZEN_image_native_buffer +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_TIZEN_image_native_buffer + + EGL_NATIVE_BUFFER_TIZEN 0x32A0 diff --git a/Windows/glew/auto/extensions/gl/EGL_TIZEN_image_native_surface b/Windows/glew/auto/extensions/gl/EGL_TIZEN_image_native_surface new file mode 100644 index 00000000..7d3afbe5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/EGL_TIZEN_image_native_surface @@ -0,0 +1,5 @@ +EGL_TIZEN_image_native_surface +https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf +EGL_TIZEN_image_native_surface + + EGL_NATIVE_SURFACE_TIZEN 0x32A1 diff --git a/Windows/glew/auto/extensions/gl/GLX_3DFX_multisample b/Windows/glew/auto/extensions/gl/GLX_3DFX_multisample new file mode 100644 index 00000000..20957945 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_3DFX_multisample @@ -0,0 +1,6 @@ +GLX_3DFX_multisample +http://www.opengl.org/registry/specs/3DFX/multisample.txt +GLX_3DFX_multisample + + GLX_SAMPLE_BUFFERS_3DFX 0x8050 + GLX_SAMPLES_3DFX 0x8051 diff --git a/Windows/glew/auto/extensions/gl/GLX_AMD_gpu_association b/Windows/glew/auto/extensions/gl/GLX_AMD_gpu_association new file mode 100644 index 00000000..72264a98 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_AMD_gpu_association @@ -0,0 +1,23 @@ +GLX_AMD_gpu_association +http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt +GLX_AMD_gpu_association + + GLX_GPU_VENDOR_AMD 0x1F00 + GLX_GPU_RENDERER_STRING_AMD 0x1F01 + GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 + GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 + GLX_GPU_RAM_AMD 0x21A3 + GLX_GPU_CLOCK_AMD 0x21A4 + GLX_GPU_NUM_PIPES_AMD 0x21A5 + GLX_GPU_NUM_SIMD_AMD 0x21A6 + GLX_GPU_NUM_RB_AMD 0x21A7 + GLX_GPU_NUM_SPI_AMD 0x21A8 + void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + GLXContext glXCreateAssociatedContextAMD (unsigned int id, GLXContext share_list) + GLXContext glXCreateAssociatedContextAttribsAMD (unsigned int id, GLXContext share_context, const int* attribList) + Bool glXDeleteAssociatedContextAMD (GLXContext ctx) + unsigned int glXGetContextGPUIDAMD (GLXContext ctx) + GLXContext glXGetCurrentAssociatedContextAMD (void) + unsigned int glXGetGPUIDsAMD (unsigned int maxCount, unsigned int* ids) + int glXGetGPUInfoAMD (unsigned int id, int property, GLenum dataType, unsigned int size, void* data) + Bool glXMakeAssociatedContextCurrentAMD (GLXContext ctx) diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_context_flush_control b/Windows/glew/auto/extensions/gl/GLX_ARB_context_flush_control new file mode 100644 index 00000000..93f8792d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_context_flush_control @@ -0,0 +1,4 @@ +GLX_ARB_context_flush_control +http://www.opengl.org/registry/specs/KHR/context_flush_control.txt +GLX_ARB_context_flush_control + diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_create_context b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context new file mode 100644 index 00000000..800fbc49 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context @@ -0,0 +1,10 @@ +GLX_ARB_create_context +http://www.opengl.org/registry/specs/ARB/glx_create_context.txt +GLX_ARB_create_context + + GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 + GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 + GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 + GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 + GLX_CONTEXT_FLAGS_ARB 0x2094 + GLXContext glXCreateContextAttribsARB (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list) diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_no_error b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_no_error new file mode 100644 index 00000000..e82744e5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_no_error @@ -0,0 +1,4 @@ +GLX_ARB_create_context_no_error +http://www.opengl.org/registry/specs/ARB/create_context_no_error.txt +GLX_ARB_create_context_no_error + diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_profile b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_profile new file mode 100644 index 00000000..480ccfc1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_profile @@ -0,0 +1,7 @@ +GLX_ARB_create_context_profile +http://www.opengl.org/registry/specs/ARB/glx_create_context.txt +GLX_ARB_create_context_profile + + GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 + GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 + GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_robustness b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_robustness new file mode 100644 index 00000000..497d3f2c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_create_context_robustness @@ -0,0 +1,8 @@ +GLX_ARB_create_context_robustness +http://www.opengl.org/registry/specs/ARB/glx_create_context_robustness.txt +GLX_ARB_create_context_robustness + + GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 + GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + GLX_NO_RESET_NOTIFICATION_ARB 0x8261 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_fbconfig_float b/Windows/glew/auto/extensions/gl/GLX_ARB_fbconfig_float new file mode 100644 index 00000000..9d62656f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_fbconfig_float @@ -0,0 +1,6 @@ +GLX_ARB_fbconfig_float +http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt +GLX_ARB_fbconfig_float + + GLX_RGBA_FLOAT_BIT_ARB 0x00000004 + GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_framebuffer_sRGB b/Windows/glew/auto/extensions/gl/GLX_ARB_framebuffer_sRGB new file mode 100644 index 00000000..b2d03900 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_framebuffer_sRGB @@ -0,0 +1,5 @@ +GLX_ARB_framebuffer_sRGB +http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt +GLX_ARB_framebuffer_sRGB + + GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_get_proc_address b/Windows/glew/auto/extensions/gl/GLX_ARB_get_proc_address new file mode 100644 index 00000000..e2cb2c50 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_get_proc_address @@ -0,0 +1,5 @@ +GLX_ARB_get_proc_address +http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt +GLX_ARB_get_proc_address + + extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_multisample b/Windows/glew/auto/extensions/gl/GLX_ARB_multisample new file mode 100644 index 00000000..088fc674 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_multisample @@ -0,0 +1,6 @@ +GLX_ARB_multisample +http://www.opengl.org/registry/specs/ARB/multisample.txt +GLX_ARB_multisample + + GLX_SAMPLE_BUFFERS_ARB 100000 + GLX_SAMPLES_ARB 100001 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_robustness_application_isolation b/Windows/glew/auto/extensions/gl/GLX_ARB_robustness_application_isolation new file mode 100644 index 00000000..f07ced80 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_robustness_application_isolation @@ -0,0 +1,5 @@ +GLX_ARB_robustness_application_isolation +http://www.opengl.org/registry/specs/ARB/glx_robustness_isolation.txt +GLX_ARB_robustness_application_isolation + + GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_robustness_share_group_isolation b/Windows/glew/auto/extensions/gl/GLX_ARB_robustness_share_group_isolation new file mode 100644 index 00000000..50e2ed7a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_robustness_share_group_isolation @@ -0,0 +1,5 @@ +GLX_ARB_robustness_share_group_isolation +http://www.opengl.org/registry/specs/ARB/glx_robustness_isolation.txt +GLX_ARB_robustness_share_group_isolation + + GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 diff --git a/Windows/glew/auto/extensions/gl/GLX_ARB_vertex_buffer_object b/Windows/glew/auto/extensions/gl/GLX_ARB_vertex_buffer_object new file mode 100644 index 00000000..f570d022 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ARB_vertex_buffer_object @@ -0,0 +1,5 @@ +GLX_ARB_vertex_buffer_object +http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt +GLX_ARB_vertex_buffer_object + + GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 diff --git a/Windows/glew/auto/extensions/gl/GLX_ATI_pixel_format_float b/Windows/glew/auto/extensions/gl/GLX_ATI_pixel_format_float new file mode 100644 index 00000000..5336da41 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ATI_pixel_format_float @@ -0,0 +1,5 @@ +GLX_ATI_pixel_format_float + +GLX_ATI_pixel_format_float + + GLX_RGBA_FLOAT_ATI_BIT 0x00000100 diff --git a/Windows/glew/auto/extensions/gl/GLX_ATI_render_texture b/Windows/glew/auto/extensions/gl/GLX_ATI_render_texture new file mode 100644 index 00000000..6b358140 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_ATI_render_texture @@ -0,0 +1,42 @@ +GLX_ATI_render_texture + +GLX_ATI_render_texture + + GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 + GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 + GLX_TEXTURE_FORMAT_ATI 0x9802 + GLX_TEXTURE_TARGET_ATI 0x9803 + GLX_MIPMAP_TEXTURE_ATI 0x9804 + GLX_TEXTURE_RGB_ATI 0x9805 + GLX_TEXTURE_RGBA_ATI 0x9806 + GLX_NO_TEXTURE_ATI 0x9807 + GLX_TEXTURE_CUBE_MAP_ATI 0x9808 + GLX_TEXTURE_1D_ATI 0x9809 + GLX_TEXTURE_2D_ATI 0x980A + GLX_MIPMAP_LEVEL_ATI 0x980B + GLX_CUBE_MAP_FACE_ATI 0x980C + GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D + GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E + GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 + GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 + GLX_FRONT_LEFT_ATI 0x9813 + GLX_FRONT_RIGHT_ATI 0x9814 + GLX_BACK_LEFT_ATI 0x9815 + GLX_BACK_RIGHT_ATI 0x9816 + GLX_AUX0_ATI 0x9817 + GLX_AUX1_ATI 0x9818 + GLX_AUX2_ATI 0x9819 + GLX_AUX3_ATI 0x981A + GLX_AUX4_ATI 0x981B + GLX_AUX5_ATI 0x981C + GLX_AUX6_ATI 0x981D + GLX_AUX7_ATI 0x981E + GLX_AUX8_ATI 0x981F + GLX_AUX9_ATI 0x9820 + GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 + GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + void glXBindTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXReleaseTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXDrawableAttribATI (Display *dpy, GLXDrawable draw, const int *attrib_list) diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_buffer_age b/Windows/glew/auto/extensions/gl/GLX_EXT_buffer_age new file mode 100644 index 00000000..1e26fa03 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_buffer_age @@ -0,0 +1,5 @@ +GLX_EXT_buffer_age +http://www.opengl.org/registry/specs/EXT/glx_buffer_age.txt +GLX_EXT_buffer_age + + GLX_BACK_BUFFER_AGE_EXT 0x20F4 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_create_context_es2_profile b/Windows/glew/auto/extensions/gl/GLX_EXT_create_context_es2_profile new file mode 100644 index 00000000..aea21df7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_create_context_es2_profile @@ -0,0 +1,5 @@ +GLX_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es2_profile.txt +GLX_EXT_create_context_es2_profile + + GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_create_context_es_profile b/Windows/glew/auto/extensions/gl/GLX_EXT_create_context_es_profile new file mode 100644 index 00000000..ea13e6e7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_create_context_es_profile @@ -0,0 +1,5 @@ +GLX_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es_profile.txt +GLX_EXT_create_context_es_profile + + GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_fbconfig_packed_float b/Windows/glew/auto/extensions/gl/GLX_EXT_fbconfig_packed_float new file mode 100644 index 00000000..ffd47e30 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_fbconfig_packed_float @@ -0,0 +1,6 @@ +GLX_EXT_fbconfig_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GLX_EXT_fbconfig_packed_float + + GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_framebuffer_sRGB b/Windows/glew/auto/extensions/gl/GLX_EXT_framebuffer_sRGB new file mode 100644 index 00000000..83743bb6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_framebuffer_sRGB @@ -0,0 +1,5 @@ +GLX_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GLX_EXT_framebuffer_sRGB + + GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_import_context b/Windows/glew/auto/extensions/gl/GLX_EXT_import_context new file mode 100644 index 00000000..d7b70efc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_import_context @@ -0,0 +1,12 @@ +GLX_EXT_import_context +http://www.opengl.org/registry/specs/EXT/import_context.txt +GLX_EXT_import_context + + GLX_SHARE_CONTEXT_EXT 0x800A + GLX_VISUAL_ID_EXT 0x800B + GLX_SCREEN_EXT 0x800C + void glXFreeContextEXT (Display* dpy, GLXContext context) + GLXContextID glXGetContextIDEXT (const GLXContext context) + GLXContext glXImportContextEXT (Display* dpy, GLXContextID contextID) + int glXQueryContextInfoEXT (Display* dpy, GLXContext context, int attribute,int *value) + typedef XID GLXContextID diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_libglvnd b/Windows/glew/auto/extensions/gl/GLX_EXT_libglvnd new file mode 100644 index 00000000..cd1aa598 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_libglvnd @@ -0,0 +1,5 @@ +GLX_EXT_libglvnd +http://www.opengl.org/registry/specs/EXT/glx_libglvnd.txt +GLX_EXT_libglvnd + + GLX_VENDOR_NAMES_EXT 0x20F6 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_scene_marker b/Windows/glew/auto/extensions/gl/GLX_EXT_scene_marker new file mode 100644 index 00000000..560e5f13 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_scene_marker @@ -0,0 +1,4 @@ +GLX_EXT_scene_marker +http://www.opengl.org/registry/specs/EXT/scene_marker.txt +GLX_EXT_scene_marker + diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_stereo_tree b/Windows/glew/auto/extensions/gl/GLX_EXT_stereo_tree new file mode 100644 index 00000000..7b79f2dd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_stereo_tree @@ -0,0 +1,7 @@ +GLX_EXT_stereo_tree +http://www.opengl.org/registry/specs/EXT/glx_stereo_tree.txt +GLX_EXT_stereo_tree + + GLX_STEREO_NOTIFY_EXT 0x00000000 + GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 + GLX_STEREO_TREE_EXT 0x20F5 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_swap_control b/Windows/glew/auto/extensions/gl/GLX_EXT_swap_control new file mode 100644 index 00000000..519fab58 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_swap_control @@ -0,0 +1,7 @@ +GLX_EXT_swap_control +http://www.opengl.org/registry/specs/EXT/swap_control.txt +GLX_EXT_swap_control + + GLX_SWAP_INTERVAL_EXT 0x20F1 + GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + void glXSwapIntervalEXT (Display* dpy, GLXDrawable drawable, int interval) diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_swap_control_tear b/Windows/glew/auto/extensions/gl/GLX_EXT_swap_control_tear new file mode 100644 index 00000000..0d751042 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_swap_control_tear @@ -0,0 +1,5 @@ +GLX_EXT_swap_control_tear +http://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt +GLX_EXT_swap_control_tear + + GLX_LATE_SWAPS_TEAR_EXT 0x20F3 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_texture_from_pixmap b/Windows/glew/auto/extensions/gl/GLX_EXT_texture_from_pixmap new file mode 100644 index 00000000..44053c60 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_texture_from_pixmap @@ -0,0 +1,37 @@ +GLX_EXT_texture_from_pixmap +http://www.opengl.org/registry/specs/EXT/texture_from_pixmap.txt +GLX_EXT_texture_from_pixmap + + GLX_TEXTURE_1D_BIT_EXT 0x00000001 + GLX_TEXTURE_2D_BIT_EXT 0x00000002 + GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 + GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 + GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 + GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 + GLX_Y_INVERTED_EXT 0x20D4 + GLX_TEXTURE_FORMAT_EXT 0x20D5 + GLX_TEXTURE_TARGET_EXT 0x20D6 + GLX_MIPMAP_TEXTURE_EXT 0x20D7 + GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 + GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 + GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA + GLX_TEXTURE_1D_EXT 0x20DB + GLX_TEXTURE_2D_EXT 0x20DC + GLX_TEXTURE_RECTANGLE_EXT 0x20DD + GLX_FRONT_LEFT_EXT 0x20DE + GLX_FRONT_RIGHT_EXT 0x20DF + GLX_BACK_LEFT_EXT 0x20E0 + GLX_BACK_RIGHT_EXT 0x20E1 + GLX_AUX0_EXT 0x20E2 + GLX_AUX1_EXT 0x20E3 + GLX_AUX2_EXT 0x20E4 + GLX_AUX3_EXT 0x20E5 + GLX_AUX4_EXT 0x20E6 + GLX_AUX5_EXT 0x20E7 + GLX_AUX6_EXT 0x20E8 + GLX_AUX7_EXT 0x20E9 + GLX_AUX8_EXT 0x20EA + GLX_AUX9_EXT 0x20EB + void glXBindTexImageEXT (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list) + void glXReleaseTexImageEXT (Display* display, GLXDrawable drawable, int buffer) diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_visual_info b/Windows/glew/auto/extensions/gl/GLX_EXT_visual_info new file mode 100644 index 00000000..8e962ae2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_visual_info @@ -0,0 +1,20 @@ +GLX_EXT_visual_info +http://www.opengl.org/registry/specs/EXT/visual_info.txt +GLX_EXT_visual_info + + GLX_X_VISUAL_TYPE_EXT 0x22 + GLX_TRANSPARENT_TYPE_EXT 0x23 + GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 + GLX_TRANSPARENT_RED_VALUE_EXT 0x25 + GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 + GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 + GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 + GLX_NONE_EXT 0x8000 + GLX_TRUE_COLOR_EXT 0x8002 + GLX_DIRECT_COLOR_EXT 0x8003 + GLX_PSEUDO_COLOR_EXT 0x8004 + GLX_STATIC_COLOR_EXT 0x8005 + GLX_GRAY_SCALE_EXT 0x8006 + GLX_STATIC_GRAY_EXT 0x8007 + GLX_TRANSPARENT_RGB_EXT 0x8008 + GLX_TRANSPARENT_INDEX_EXT 0x8009 diff --git a/Windows/glew/auto/extensions/gl/GLX_EXT_visual_rating b/Windows/glew/auto/extensions/gl/GLX_EXT_visual_rating new file mode 100644 index 00000000..cfa72d33 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_EXT_visual_rating @@ -0,0 +1,7 @@ +GLX_EXT_visual_rating +http://www.opengl.org/registry/specs/EXT/visual_rating.txt +GLX_EXT_visual_rating + + GLX_VISUAL_CAVEAT_EXT 0x20 + GLX_SLOW_VISUAL_EXT 0x8001 + GLX_NON_CONFORMANT_VISUAL_EXT 0x800D diff --git a/Windows/glew/auto/extensions/gl/GLX_INTEL_swap_event b/Windows/glew/auto/extensions/gl/GLX_INTEL_swap_event new file mode 100644 index 00000000..f6832b98 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_INTEL_swap_event @@ -0,0 +1,8 @@ +GLX_INTEL_swap_event +http://www.opengl.org/registry/specs/INTEL/swap_event.txt +GLX_INTEL_swap_event + + GLX_EXCHANGE_COMPLETE_INTEL 0x8180 + GLX_COPY_COMPLETE_INTEL 0x8181 + GLX_FLIP_COMPLETE_INTEL 0x8182 + GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_agp_offset b/Windows/glew/auto/extensions/gl/GLX_MESA_agp_offset new file mode 100644 index 00000000..a037a0d5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_agp_offset @@ -0,0 +1,5 @@ +GLX_MESA_agp_offset +http://www.opengl.org/registry/specs/MESA/agp_offset.txt +GLX_MESA_agp_offset + + unsigned int glXGetAGPOffsetMESA (const void* pointer) diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_copy_sub_buffer b/Windows/glew/auto/extensions/gl/GLX_MESA_copy_sub_buffer new file mode 100644 index 00000000..21d9da6a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_copy_sub_buffer @@ -0,0 +1,5 @@ +GLX_MESA_copy_sub_buffer +http://www.opengl.org/registry/specs/MESA/copy_sub_buffer.txt +GLX_MESA_copy_sub_buffer + + void glXCopySubBufferMESA (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height) diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_pixmap_colormap b/Windows/glew/auto/extensions/gl/GLX_MESA_pixmap_colormap new file mode 100644 index 00000000..65364598 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_pixmap_colormap @@ -0,0 +1,5 @@ +GLX_MESA_pixmap_colormap +http://www.opengl.org/registry/specs/MESA/pixmap_colormap.txt +GLX_MESA_pixmap_colormap + + GLXPixmap glXCreateGLXPixmapMESA (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap) diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_query_renderer b/Windows/glew/auto/extensions/gl/GLX_MESA_query_renderer new file mode 100644 index 00000000..124be455 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_query_renderer @@ -0,0 +1,20 @@ +GLX_MESA_query_renderer +http://www.opengl.org/registry/specs/MESA/glx_query_renderer.txt +GLX_MESA_query_renderer + + GLX_RENDERER_VENDOR_ID_MESA 0x8183 + GLX_RENDERER_DEVICE_ID_MESA 0x8184 + GLX_RENDERER_VERSION_MESA 0x8185 + GLX_RENDERER_ACCELERATED_MESA 0x8186 + GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 + GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 + GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 + GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A + GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B + GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C + GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D + GLX_RENDERER_ID_MESA 0x818E + Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int* value) + const char* glXQueryCurrentRendererStringMESA (int attribute) + Bool glXQueryRendererIntegerMESA (Display* dpy, int screen, int renderer, int attribute, unsigned int *value) + const char* glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute) diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_release_buffers b/Windows/glew/auto/extensions/gl/GLX_MESA_release_buffers new file mode 100644 index 00000000..7c352b71 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_release_buffers @@ -0,0 +1,5 @@ +GLX_MESA_release_buffers +http://www.opengl.org/registry/specs/MESA/release_buffers.txt +GLX_MESA_release_buffers + + Bool glXReleaseBuffersMESA (Display* dpy, GLXDrawable d) diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_set_3dfx_mode b/Windows/glew/auto/extensions/gl/GLX_MESA_set_3dfx_mode new file mode 100644 index 00000000..55e32bbc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_set_3dfx_mode @@ -0,0 +1,7 @@ +GLX_MESA_set_3dfx_mode +http://www.opengl.org/registry/specs/MESA/set_3dfx_mode.txt +GLX_MESA_set_3dfx_mode + + GLX_3DFX_WINDOW_MODE_MESA 0x1 + GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + GLboolean glXSet3DfxModeMESA (GLint mode) diff --git a/Windows/glew/auto/extensions/gl/GLX_MESA_swap_control b/Windows/glew/auto/extensions/gl/GLX_MESA_swap_control new file mode 100644 index 00000000..eb6e933f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_MESA_swap_control @@ -0,0 +1,6 @@ +GLX_MESA_swap_control +http://cgit.freedesktop.org/mesa/mesa/plain/docs/MESA_swap_control.spec +GLX_MESA_swap_control + + int glXGetSwapIntervalMESA (void) + int glXSwapIntervalMESA (unsigned int interval) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_copy_buffer b/Windows/glew/auto/extensions/gl/GLX_NV_copy_buffer new file mode 100644 index 00000000..209916d2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_copy_buffer @@ -0,0 +1,6 @@ +GLX_NV_copy_buffer +http://www.opengl.org/registry/specs/NV/glx_copy_buffer.txt +GLX_NV_copy_buffer + + void glXCopyBufferSubDataNV (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) + void glXNamedCopyBufferSubDataNV (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_copy_image b/Windows/glew/auto/extensions/gl/GLX_NV_copy_image new file mode 100644 index 00000000..898a622e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_copy_image @@ -0,0 +1,5 @@ +GLX_NV_copy_image +http://www.opengl.org/registry/specs/NV/copy_image.txt +GLX_NV_copy_image + + void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_delay_before_swap b/Windows/glew/auto/extensions/gl/GLX_NV_delay_before_swap new file mode 100644 index 00000000..534a9ffe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_delay_before_swap @@ -0,0 +1,5 @@ +GLX_NV_delay_before_swap +http://www.opengl.org/registry/specs/NV/glx_delay_before_swap.txt +GLX_NV_delay_before_swap + + Bool glXDelayBeforeSwapNV (Display* dpy, GLXDrawable drawable, GLfloat seconds) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_float_buffer b/Windows/glew/auto/extensions/gl/GLX_NV_float_buffer new file mode 100644 index 00000000..19b71e2e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_float_buffer @@ -0,0 +1,5 @@ +GLX_NV_float_buffer +http://cvs1.nvidia.com/inc/GL/glxtokens.h +GLX_NV_float_buffer + + GLX_FLOAT_COMPONENTS_NV 0x20B0 diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_multisample_coverage b/Windows/glew/auto/extensions/gl/GLX_NV_multisample_coverage new file mode 100644 index 00000000..eb3794cf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_multisample_coverage @@ -0,0 +1,6 @@ +GLX_NV_multisample_coverage +http://www.opengl.org/registry/specs/NV/multisample_coverage.txt +GLX_NV_multisample_coverage + + GLX_COLOR_SAMPLES_NV 0x20B3 + GLX_COVERAGE_SAMPLES_NV 100001 diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_present_video b/Windows/glew/auto/extensions/gl/GLX_NV_present_video new file mode 100644 index 00000000..6d8b08de --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_present_video @@ -0,0 +1,7 @@ +GLX_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +GLX_NV_present_video + + GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + int glXBindVideoDeviceNV (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list) + unsigned int* glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_robustness_video_memory_purge b/Windows/glew/auto/extensions/gl/GLX_NV_robustness_video_memory_purge new file mode 100644 index 00000000..07a4d041 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_robustness_video_memory_purge @@ -0,0 +1,5 @@ +GLX_NV_robustness_video_memory_purge +http://www.opengl.org/registry/specs/NV/robustness_video_memory_purge.txt +GLX_NV_robustness_video_memory_purge + + GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7 diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_swap_group b/Windows/glew/auto/extensions/gl/GLX_NV_swap_group new file mode 100644 index 00000000..57ea6be3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_swap_group @@ -0,0 +1,10 @@ +GLX_NV_swap_group +http://www.opengl.org/registry/specs/NV/glx_swap_group.txt +GLX_NV_swap_group + + Bool glXBindSwapBarrierNV (Display* dpy, GLuint group, GLuint barrier) + Bool glXJoinSwapGroupNV (Display* dpy, GLXDrawable drawable, GLuint group) + Bool glXQueryFrameCountNV (Display* dpy, int screen, GLuint *count) + Bool glXQueryMaxSwapGroupsNV (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers) + Bool glXQuerySwapGroupNV (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier) + Bool glXResetFrameCountNV (Display* dpy, int screen) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_vertex_array_range b/Windows/glew/auto/extensions/gl/GLX_NV_vertex_array_range new file mode 100644 index 00000000..9250ec25 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_vertex_array_range @@ -0,0 +1,6 @@ +GLX_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +GLX_NV_vertex_array_range + + void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void glXFreeMemoryNV (void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_video_capture b/Windows/glew/auto/extensions/gl/GLX_NV_video_capture new file mode 100644 index 00000000..1fda33ed --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_video_capture @@ -0,0 +1,13 @@ +GLX_NV_video_capture +http://www.opengl.org/registry/specs/NV/video_capture.txt +GLX_NV_video_capture + + GLX_DEVICE_ID_NV 0x20CD + GLX_UNIQUE_ID_NV 0x20CE + GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + int glXBindVideoCaptureDeviceNV (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device) + GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display* dpy, int screen, int *nelements) + void glXLockVideoCaptureDeviceNV (Display* dpy, GLXVideoCaptureDeviceNV device) + int glXQueryVideoCaptureDeviceNV (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value) + void glXReleaseVideoCaptureDeviceNV (Display* dpy, GLXVideoCaptureDeviceNV device) + typedef XID GLXVideoCaptureDeviceNV diff --git a/Windows/glew/auto/extensions/gl/GLX_NV_video_out b/Windows/glew/auto/extensions/gl/GLX_NV_video_out new file mode 100644 index 00000000..78135eba --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_NV_video_out @@ -0,0 +1,20 @@ +GLX_NV_video_out +http://www.opengl.org/registry/specs/NV/glx_video_output.txt +GLX_NV_video_out + + GLX_VIDEO_OUT_COLOR_NV 0x20C3 + GLX_VIDEO_OUT_ALPHA_NV 0x20C4 + GLX_VIDEO_OUT_DEPTH_NV 0x20C5 + GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 + GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 + GLX_VIDEO_OUT_FRAME_NV 0x20C8 + GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 + GLX_VIDEO_OUT_FIELD_2_NV 0x20CA + GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB + GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + int glXBindVideoImageNV (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer) + int glXGetVideoDeviceNV (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice) + int glXGetVideoInfoNV (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo) + int glXReleaseVideoDeviceNV (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice) + int glXReleaseVideoImageNV (Display* dpy, GLXPbuffer pbuf) + int glXSendPbufferToVideoNV (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock) diff --git a/Windows/glew/auto/extensions/gl/GLX_OML_swap_method b/Windows/glew/auto/extensions/gl/GLX_OML_swap_method new file mode 100644 index 00000000..de90d7b4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_OML_swap_method @@ -0,0 +1,8 @@ +GLX_OML_swap_method +http://www.opengl.org/registry/specs/OML/glx_swap_method.txt +GLX_OML_swap_method + + GLX_SWAP_METHOD_OML 0x8060 + GLX_SWAP_EXCHANGE_OML 0x8061 + GLX_SWAP_COPY_OML 0x8062 + GLX_SWAP_UNDEFINED_OML 0x8063 diff --git a/Windows/glew/auto/extensions/gl/GLX_OML_sync_control b/Windows/glew/auto/extensions/gl/GLX_OML_sync_control new file mode 100644 index 00000000..e802656d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_OML_sync_control @@ -0,0 +1,9 @@ +GLX_OML_sync_control +http://www.opengl.org/registry/specs/OML/glx_sync_control.txt +GLX_OML_sync_control + + Bool glXGetMscRateOML (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator) + Bool glXGetSyncValuesOML (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc) + int64_t glXSwapBuffersMscOML (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder) + Bool glXWaitForMscOML (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc) + Bool glXWaitForSbcOML (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIS_blended_overlay b/Windows/glew/auto/extensions/gl/GLX_SGIS_blended_overlay new file mode 100644 index 00000000..a61d1484 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIS_blended_overlay @@ -0,0 +1,5 @@ +GLX_SGIS_blended_overlay +http://www.opengl.org/registry/specs/SGIS/blended_overlay.txt +GLX_SGIS_blended_overlay + + GLX_BLENDED_RGBA_SGIS 0x8025 diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIS_color_range b/Windows/glew/auto/extensions/gl/GLX_SGIS_color_range new file mode 100644 index 00000000..0c4ef399 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIS_color_range @@ -0,0 +1,4 @@ +GLX_SGIS_color_range +http://www.opengl.org/registry/specs/SGIS/color_range.txt +GLX_SGIS_color_range + diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIS_multisample b/Windows/glew/auto/extensions/gl/GLX_SGIS_multisample new file mode 100644 index 00000000..4b96d7b9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIS_multisample @@ -0,0 +1,6 @@ +GLX_SGIS_multisample +http://www.opengl.org/registry/specs/SGIS/multisample.txt +GLX_SGIS_multisample + + GLX_SAMPLE_BUFFERS_SGIS 100000 + GLX_SAMPLES_SGIS 100001 diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIS_shared_multisample b/Windows/glew/auto/extensions/gl/GLX_SGIS_shared_multisample new file mode 100644 index 00000000..a2f4e123 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIS_shared_multisample @@ -0,0 +1,6 @@ +GLX_SGIS_shared_multisample + +GLX_SGIS_shared_multisample + + GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 + GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_fbconfig b/Windows/glew/auto/extensions/gl/GLX_SGIX_fbconfig new file mode 100644 index 00000000..70bd6d2e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_fbconfig @@ -0,0 +1,23 @@ +GLX_SGIX_fbconfig +http://www.opengl.org/registry/specs/SGIX/fbconfig.txt +GLX_SGIX_fbconfig + + GLX_RGBA_BIT_SGIX 0x00000001 + GLX_WINDOW_BIT_SGIX 0x00000001 + GLX_COLOR_INDEX_BIT_SGIX 0x00000002 + GLX_PIXMAP_BIT_SGIX 0x00000002 + GLX_SCREEN_EXT 0x800C + GLX_DRAWABLE_TYPE_SGIX 0x8010 + GLX_RENDER_TYPE_SGIX 0x8011 + GLX_X_RENDERABLE_SGIX 0x8012 + GLX_FBCONFIG_ID_SGIX 0x8013 + GLX_RGBA_TYPE_SGIX 0x8014 + GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + GLXFBConfigSGIX* glXChooseFBConfigSGIX (Display *dpy, int screen, const int *attrib_list, int *nelements) + GLXContext glXCreateContextWithConfigSGIX (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) + GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display* dpy, GLXFBConfig config, Pixmap pixmap) + int glXGetFBConfigAttribSGIX (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value) + GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display* dpy, XVisualInfo *vis) + XVisualInfo* glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfig config) + typedef XID GLXFBConfigIDSGIX + typedef struct __GLXFBConfigRec *GLXFBConfigSGIX diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_hyperpipe b/Windows/glew/auto/extensions/gl/GLX_SGIX_hyperpipe new file mode 100644 index 00000000..80fd7d6b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_hyperpipe @@ -0,0 +1,26 @@ +GLX_SGIX_hyperpipe +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt +GLX_SGIX_hyperpipe + + GLX_HYPERPIPE_ID_SGIX 0x8030 + GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 + GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 + GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 + GLX_PIPE_RECT_SGIX 0x00000001 + GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 + GLX_HYPERPIPE_STEREO_SGIX 0x00000003 + GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 + GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 + GLX_BAD_HYPERPIPE_SGIX 92 + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; } GLXHyperpipeNetworkSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int channel; unsigned int participationType; int timeSlice; } GLXHyperpipeConfigSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int srcXOrigin; int srcYOrigin; int srcWidth; int srcHeight; int destXOrigin; int destYOrigin; int destWidth; int destHeight; } GLXPipeRect; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int XOrigin; int YOrigin; int maxHeight; int maxWidth; } GLXPipeRectLimits; + GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes) + int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId) + GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes) + int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId) + int glXBindHyperpipeSGIX (Display *dpy, int hpId) + int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList) + int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList) + int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_pbuffer b/Windows/glew/auto/extensions/gl/GLX_SGIX_pbuffer new file mode 100644 index 00000000..0fb1de3b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_pbuffer @@ -0,0 +1,36 @@ +GLX_SGIX_pbuffer +http://www.opengl.org/registry/specs/SGIX/pbuffer.txt +GLX_SGIX_pbuffer + + GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 + GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 + GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 + GLX_PBUFFER_BIT_SGIX 0x00000004 + GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 + GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 + GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 + GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 + GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 + GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 + GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 + GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 + GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 + GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 + GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A + GLX_PRESERVED_CONTENTS_SGIX 0x801B + GLX_LARGEST_PBUFFER_SGIX 0x801C + GLX_WIDTH_SGIX 0x801D + GLX_HEIGHT_SGIX 0x801E + GLX_EVENT_MASK_SGIX 0x801F + GLX_DAMAGED_SGIX 0x8020 + GLX_SAVED_SGIX 0x8021 + GLX_WINDOW_SGIX 0x8022 + GLX_PBUFFER_SGIX 0x8023 + GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + GLXPbuffer glXCreateGLXPbufferSGIX (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list) + void glXDestroyGLXPbufferSGIX (Display* dpy, GLXPbuffer pbuf) + void glXGetSelectedEventSGIX (Display* dpy, GLXDrawable drawable, unsigned long *mask) + void glXQueryGLXPbufferSGIX (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value) + void glXSelectEventSGIX (Display* dpy, GLXDrawable drawable, unsigned long mask) + typedef XID GLXPbufferSGIX + typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_swap_barrier b/Windows/glew/auto/extensions/gl/GLX_SGIX_swap_barrier new file mode 100644 index 00000000..95a65c17 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_swap_barrier @@ -0,0 +1,6 @@ +GLX_SGIX_swap_barrier +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt +GLX_SGIX_swap_barrier + + void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier) + Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_swap_group b/Windows/glew/auto/extensions/gl/GLX_SGIX_swap_group new file mode 100644 index 00000000..1eb1cff3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_swap_group @@ -0,0 +1,5 @@ +GLX_SGIX_swap_group +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt +GLX_SGIX_swap_group + + void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_video_resize b/Windows/glew/auto/extensions/gl/GLX_SGIX_video_resize new file mode 100644 index 00000000..04addf36 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_video_resize @@ -0,0 +1,11 @@ +GLX_SGIX_video_resize +http://www.opengl.org/registry/specs/SGIX/video_resize.txt +GLX_SGIX_video_resize + + GLX_SYNC_FRAME_SGIX 0x00000000 + GLX_SYNC_SWAP_SGIX 0x00000001 + int glXBindChannelToWindowSGIX (Display* display, int screen, int channel, Window window) + int glXChannelRectSGIX (Display* display, int screen, int channel, int x, int y, int w, int h) + int glXChannelRectSyncSGIX (Display* display, int screen, int channel, GLenum synctype) + int glXQueryChannelDeltasSGIX (Display* display, int screen, int channel, int *x, int *y, int *w, int *h) + int glXQueryChannelRectSGIX (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGIX_visual_select_group b/Windows/glew/auto/extensions/gl/GLX_SGIX_visual_select_group new file mode 100644 index 00000000..680b8bee --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGIX_visual_select_group @@ -0,0 +1,5 @@ +GLX_SGIX_visual_select_group +http://www.opengl.org/registry/specs/SGIX/visual_select_group.txt +GLX_SGIX_visual_select_group + + GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 diff --git a/Windows/glew/auto/extensions/gl/GLX_SGI_cushion b/Windows/glew/auto/extensions/gl/GLX_SGI_cushion new file mode 100644 index 00000000..c9291ca1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGI_cushion @@ -0,0 +1,5 @@ +GLX_SGI_cushion +http://www.opengl.org/registry/specs/SGI/cushion.txt +GLX_SGI_cushion + + void glXCushionSGI (Display* dpy, Window window, float cushion) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGI_make_current_read b/Windows/glew/auto/extensions/gl/GLX_SGI_make_current_read new file mode 100644 index 00000000..0e8ee991 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGI_make_current_read @@ -0,0 +1,6 @@ +GLX_SGI_make_current_read +http://www.opengl.org/registry/specs/SGI/make_current_read.txt +GLX_SGI_make_current_read + + GLXDrawable glXGetCurrentReadDrawableSGI (void) + Bool glXMakeCurrentReadSGI (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGI_swap_control b/Windows/glew/auto/extensions/gl/GLX_SGI_swap_control new file mode 100644 index 00000000..1e248511 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGI_swap_control @@ -0,0 +1,5 @@ +GLX_SGI_swap_control +http://www.opengl.org/registry/specs/SGI/swap_control.txt +GLX_SGI_swap_control + + int glXSwapIntervalSGI (int interval) diff --git a/Windows/glew/auto/extensions/gl/GLX_SGI_video_sync b/Windows/glew/auto/extensions/gl/GLX_SGI_video_sync new file mode 100644 index 00000000..74f13561 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SGI_video_sync @@ -0,0 +1,6 @@ +GLX_SGI_video_sync +http://www.opengl.org/registry/specs/SGI/video_sync.txt +GLX_SGI_video_sync + + int glXGetVideoSyncSGI (unsigned int* count) + int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int* count) diff --git a/Windows/glew/auto/extensions/gl/GLX_SUN_get_transparent_index b/Windows/glew/auto/extensions/gl/GLX_SUN_get_transparent_index new file mode 100644 index 00000000..5568c48c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SUN_get_transparent_index @@ -0,0 +1,5 @@ +GLX_SUN_get_transparent_index +http://www.opengl.org/registry/specs/SUN/get_transparent_index.txt +GLX_SUN_get_transparent_index + + Status glXGetTransparentIndexSUN (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex) diff --git a/Windows/glew/auto/extensions/gl/GLX_SUN_video_resize b/Windows/glew/auto/extensions/gl/GLX_SUN_video_resize new file mode 100644 index 00000000..3a5a1760 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GLX_SUN_video_resize @@ -0,0 +1,8 @@ +GLX_SUN_video_resize +http://wwws.sun.com/software/graphics/opengl/extensions/glx_sun_video_resize.txt +GLX_SUN_video_resize + + GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + GLX_VIDEO_RESIZE_SUN 0x8171 + int glXVideoResizeSUN (Display* display, GLXDrawable window, float factor) + int glXGetVideoResizeSUN (Display* display, GLXDrawable window, float* factor) diff --git a/Windows/glew/auto/extensions/gl/GL_3DFX_multisample b/Windows/glew/auto/extensions/gl/GL_3DFX_multisample new file mode 100644 index 00000000..75a9b11e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_3DFX_multisample @@ -0,0 +1,8 @@ +GL_3DFX_multisample +http://www.opengl.org/registry/specs/3DFX/multisample.txt +GL_3DFX_multisample + + GL_MULTISAMPLE_3DFX 0x86B2 + GL_SAMPLE_BUFFERS_3DFX 0x86B3 + GL_SAMPLES_3DFX 0x86B4 + GL_MULTISAMPLE_BIT_3DFX 0x20000000 diff --git a/Windows/glew/auto/extensions/gl/GL_3DFX_tbuffer b/Windows/glew/auto/extensions/gl/GL_3DFX_tbuffer new file mode 100644 index 00000000..66ef5946 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_3DFX_tbuffer @@ -0,0 +1,5 @@ +GL_3DFX_tbuffer +http://www.opengl.org/registry/specs/3DFX/tbuffer.txt +GL_3DFX_tbuffer + + void glTbufferMask3DFX (GLuint mask) diff --git a/Windows/glew/auto/extensions/gl/GL_3DFX_texture_compression_FXT1 b/Windows/glew/auto/extensions/gl/GL_3DFX_texture_compression_FXT1 new file mode 100644 index 00000000..38faf70a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_3DFX_texture_compression_FXT1 @@ -0,0 +1,6 @@ +GL_3DFX_texture_compression_FXT1 +http://www.opengl.org/registry/specs/3DFX/texture_compression_FXT1.txt +GL_3DFX_texture_compression_FXT1 + + GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 + GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_blend_minmax_factor b/Windows/glew/auto/extensions/gl/GL_AMD_blend_minmax_factor new file mode 100644 index 00000000..3644a1a4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_blend_minmax_factor @@ -0,0 +1,6 @@ +GL_AMD_blend_minmax_factor +http://www.opengl.org/registry/specs/AMD/blend_minmax_factor.txt +GL_AMD_blend_minmax_factor + + GL_FACTOR_MIN_AMD 0x901C + GL_FACTOR_MAX_AMD 0x901D diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_compressed_3DC_texture b/Windows/glew/auto/extensions/gl/GL_AMD_compressed_3DC_texture new file mode 100644 index 00000000..7308bbbc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_compressed_3DC_texture @@ -0,0 +1,6 @@ +GL_AMD_compressed_3DC_texture +http://www.opengl.org/registry/specs/AMD/compressed_3DC_texture.txt +GL_AMD_compressed_3DC_texture + + GL_3DC_X_AMD 0x87F9 + GL_3DC_XY_AMD 0x87FA diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_compressed_ATC_texture b/Windows/glew/auto/extensions/gl/GL_AMD_compressed_ATC_texture new file mode 100644 index 00000000..cfe2d5aa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_compressed_ATC_texture @@ -0,0 +1,7 @@ +GL_AMD_compressed_ATC_texture +http://www.opengl.org/registry/specs/AMD/compressed_ATC_texture.txt +GL_AMD_compressed_ATC_texture + + GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE + GL_ATC_RGB_AMD 0x8C92 + GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_conservative_depth b/Windows/glew/auto/extensions/gl/GL_AMD_conservative_depth new file mode 100644 index 00000000..df20fd9e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_conservative_depth @@ -0,0 +1,4 @@ +GL_AMD_conservative_depth +http://www.opengl.org/registry/specs/AMD/conservative_depth.txt +GL_AMD_conservative_depth + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_debug_output b/Windows/glew/auto/extensions/gl/GL_AMD_debug_output new file mode 100644 index 00000000..f4f7210a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_debug_output @@ -0,0 +1,23 @@ +GL_AMD_debug_output +http://www.opengl.org/registry/specs/AMD/debug_output.txt +GL_AMD_debug_output + + GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 + GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 + GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 + GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 + GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 + GL_DEBUG_SEVERITY_LOW_AMD 0x9148 + GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 + GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A + GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B + GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C + GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D + GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E + GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F + GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + void glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam) + void glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled) + void glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf) + GLuint glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message) + typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_depth_clamp_separate b/Windows/glew/auto/extensions/gl/GL_AMD_depth_clamp_separate new file mode 100644 index 00000000..06ba07b3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_depth_clamp_separate @@ -0,0 +1,6 @@ +GL_AMD_depth_clamp_separate +http://www.opengl.org/registry/specs/AMD/depth_clamp_separate.txt +GL_AMD_depth_clamp_separate + + GL_DEPTH_CLAMP_NEAR_AMD 0x901E + GL_DEPTH_CLAMP_FAR_AMD 0x901F diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_draw_buffers_blend b/Windows/glew/auto/extensions/gl/GL_AMD_draw_buffers_blend new file mode 100644 index 00000000..df8ff3e8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_draw_buffers_blend @@ -0,0 +1,8 @@ +GL_AMD_draw_buffers_blend +http://www.opengl.org/registry/specs/AMD/draw_buffers_blend.txt +GL_AMD_draw_buffers_blend + + void glBlendEquationIndexedAMD (GLuint buf, GLenum mode) + void glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst) + void glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_framebuffer_sample_positions b/Windows/glew/auto/extensions/gl/GL_AMD_framebuffer_sample_positions new file mode 100644 index 00000000..17f1c950 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_framebuffer_sample_positions @@ -0,0 +1,12 @@ +GL_AMD_framebuffer_sample_positions +http://www.opengl.org/registry/specs/AMD/framebuffer_sample_positions.txt +GL_AMD_framebuffer_sample_positions + + GL_SUBSAMPLE_DISTANCE_AMD 0x883F + GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE + GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF + GL_ALL_PIXELS_AMD 0xFFFFFFFF + void glFramebufferSamplePositionsfvAMD (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat* values) + void glGetFramebufferParameterfvAMD (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values) + void glGetNamedFramebufferParameterfvAMD (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values) + void glNamedFramebufferSamplePositionsfvAMD (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat* values) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_gcn_shader b/Windows/glew/auto/extensions/gl/GL_AMD_gcn_shader new file mode 100644 index 00000000..01f587e0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_gcn_shader @@ -0,0 +1,4 @@ +GL_AMD_gcn_shader +http://www.opengl.org/registry/specs/AMD/gcn_shader.txt +GL_AMD_gcn_shader + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_half_float b/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_half_float new file mode 100644 index 00000000..1be626d3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_half_float @@ -0,0 +1,17 @@ +GL_AMD_gpu_shader_half_float +http://www.opengl.org/registry/specs/AMD/gpu_shader_half_float.txt +GL_AMD_gpu_shader_half_float + + GL_FLOAT16_NV 0x8FF8 + GL_FLOAT16_VEC2_NV 0x8FF9 + GL_FLOAT16_VEC3_NV 0x8FFA + GL_FLOAT16_VEC4_NV 0x8FFB + GL_FLOAT16_MAT2_AMD 0x91C5 + GL_FLOAT16_MAT3_AMD 0x91C6 + GL_FLOAT16_MAT4_AMD 0x91C7 + GL_FLOAT16_MAT2x3_AMD 0x91C8 + GL_FLOAT16_MAT2x4_AMD 0x91C9 + GL_FLOAT16_MAT3x2_AMD 0x91CA + GL_FLOAT16_MAT3x4_AMD 0x91CB + GL_FLOAT16_MAT4x2_AMD 0x91CC + GL_FLOAT16_MAT4x3_AMD 0x91CD diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_int16 b/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_int16 new file mode 100644 index 00000000..800abde0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_int16 @@ -0,0 +1,4 @@ +GL_AMD_gpu_shader_int16 +http://www.opengl.org/registry/specs/AMD/gpu_shader_int16.txt +GL_AMD_gpu_shader_int16 + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_int64 b/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_int64 new file mode 100644 index 00000000..c5b9c2f1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_gpu_shader_int64 @@ -0,0 +1,4 @@ +GL_AMD_gpu_shader_int64 +http://www.opengl.org/registry/specs/AMD/gpu_shader_int64.txt +GL_AMD_gpu_shader_int64 + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_interleaved_elements b/Windows/glew/auto/extensions/gl/GL_AMD_interleaved_elements new file mode 100644 index 00000000..99d9d84d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_interleaved_elements @@ -0,0 +1,14 @@ +GL_AMD_interleaved_elements +http://www.opengl.org/registry/specs/AMD/interleaved_elements.txt +GL_AMD_interleaved_elements + + GL_RED 0x1903 + GL_GREEN 0x1904 + GL_BLUE 0x1905 + GL_ALPHA 0x1906 + GL_RG8UI 0x8238 + GL_RG16UI 0x823A + GL_RGBA8UI 0x8D7C + GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 + GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + void glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_multi_draw_indirect b/Windows/glew/auto/extensions/gl/GL_AMD_multi_draw_indirect new file mode 100644 index 00000000..237aad3c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_multi_draw_indirect @@ -0,0 +1,6 @@ +GL_AMD_multi_draw_indirect +http://www.opengl.org/registry/specs/AMD/multi_draw_indirect.txt +GL_AMD_multi_draw_indirect + + void glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride) + void glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_name_gen_delete b/Windows/glew/auto/extensions/gl/GL_AMD_name_gen_delete new file mode 100644 index 00000000..937bf5c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_name_gen_delete @@ -0,0 +1,12 @@ +GL_AMD_name_gen_delete +http://www.opengl.org/registry/specs/AMD/name_gen_delete.txt +GL_AMD_name_gen_delete + + GL_DATA_BUFFER_AMD 0x9151 + GL_PERFORMANCE_MONITOR_AMD 0x9152 + GL_QUERY_OBJECT_AMD 0x9153 + GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 + GL_SAMPLER_OBJECT_AMD 0x9155 + void glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint* names) + void glGenNamesAMD (GLenum identifier, GLuint num, GLuint* names) + GLboolean glIsNameAMD (GLenum identifier, GLuint name) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_occlusion_query_event b/Windows/glew/auto/extensions/gl/GL_AMD_occlusion_query_event new file mode 100644 index 00000000..6eaaaa6f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_occlusion_query_event @@ -0,0 +1,11 @@ +GL_AMD_occlusion_query_event +http://www.opengl.org/registry/specs/AMD/occlusion_query_event.txt +GL_AMD_occlusion_query_event + + GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 + GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 + GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 + GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 + GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F + GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF + void glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_performance_monitor b/Windows/glew/auto/extensions/gl/GL_AMD_performance_monitor new file mode 100644 index 00000000..ad1075bc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_performance_monitor @@ -0,0 +1,22 @@ +GL_AMD_performance_monitor +http://www.opengl.org/registry/specs/AMD/performance_monitor.txt +GL_AMD_performance_monitor + + GL_COUNTER_TYPE_AMD 0x8BC0 + GL_COUNTER_RANGE_AMD 0x8BC1 + GL_UNSIGNED_INT64_AMD 0x8BC2 + GL_PERCENTAGE_AMD 0x8BC3 + GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 + GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 + GL_PERFMON_RESULT_AMD 0x8BC6 + void glBeginPerfMonitorAMD (GLuint monitor) + void glDeletePerfMonitorsAMD (GLsizei n, GLuint* monitors) + void glEndPerfMonitorAMD (GLuint monitor) + void glGenPerfMonitorsAMD (GLsizei n, GLuint* monitors) + void glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten) + void glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data) + void glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString) + void glGetPerfMonitorCountersAMD (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters) + void glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString) + void glGetPerfMonitorGroupsAMD (GLint* numGroups, GLsizei groupsSize, GLuint *groups) + void glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_pinned_memory b/Windows/glew/auto/extensions/gl/GL_AMD_pinned_memory new file mode 100644 index 00000000..df73d809 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_pinned_memory @@ -0,0 +1,5 @@ +GL_AMD_pinned_memory +http://www.opengl.org/registry/specs/AMD/pinned_memory.txt +GL_AMD_pinned_memory + + GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_program_binary_Z400 b/Windows/glew/auto/extensions/gl/GL_AMD_program_binary_Z400 new file mode 100644 index 00000000..f37f59d3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_program_binary_Z400 @@ -0,0 +1,5 @@ +GL_AMD_program_binary_Z400 +http://www.opengl.org/registry/specs/AMD/program_binary_Z400.txt +GL_AMD_program_binary_Z400 + + GL_Z400_BINARY_AMD 0x8740 diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_query_buffer_object b/Windows/glew/auto/extensions/gl/GL_AMD_query_buffer_object new file mode 100644 index 00000000..745b38a6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_query_buffer_object @@ -0,0 +1,7 @@ +GL_AMD_query_buffer_object +http://www.opengl.org/registry/specs/AMD/query_buffer_object.txt +GL_AMD_query_buffer_object + + GL_QUERY_BUFFER_AMD 0x9192 + GL_QUERY_BUFFER_BINDING_AMD 0x9193 + GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_sample_positions b/Windows/glew/auto/extensions/gl/GL_AMD_sample_positions new file mode 100644 index 00000000..655cfc4b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_sample_positions @@ -0,0 +1,6 @@ +GL_AMD_sample_positions +http://www.opengl.org/registry/specs/AMD/sample_positions.txt +GL_AMD_sample_positions + + GL_SUBSAMPLE_DISTANCE_AMD 0x883F + void glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat* val) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_seamless_cubemap_per_texture b/Windows/glew/auto/extensions/gl/GL_AMD_seamless_cubemap_per_texture new file mode 100644 index 00000000..6a3f9a31 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_seamless_cubemap_per_texture @@ -0,0 +1,5 @@ +GL_AMD_seamless_cubemap_per_texture +http://www.opengl.org/registry/specs/AMD/seamless_cubemap_per_texture.txt +GL_AMD_seamless_cubemap_per_texture + + GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_shader_atomic_counter_ops b/Windows/glew/auto/extensions/gl/GL_AMD_shader_atomic_counter_ops new file mode 100644 index 00000000..ac44d813 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_shader_atomic_counter_ops @@ -0,0 +1,4 @@ +GL_AMD_shader_atomic_counter_ops +http://www.opengl.org/registry/specs/AMD/shader_atomic_counter_ops.txt +GL_AMD_shader_atomic_counter_ops + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_shader_ballot b/Windows/glew/auto/extensions/gl/GL_AMD_shader_ballot new file mode 100644 index 00000000..f4af7e4e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_shader_ballot @@ -0,0 +1,4 @@ +GL_AMD_shader_ballot +http://www.opengl.org/registry/specs/AMD/shader_ballot.txt +GL_AMD_shader_ballot + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_shader_explicit_vertex_parameter b/Windows/glew/auto/extensions/gl/GL_AMD_shader_explicit_vertex_parameter new file mode 100644 index 00000000..94d5e0ff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_shader_explicit_vertex_parameter @@ -0,0 +1,4 @@ +GL_AMD_shader_explicit_vertex_parameter +http://www.opengl.org/registry/specs/AMD/shader_explicit_vertex_parameter.txt +GL_AMD_shader_explicit_vertex_parameter + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_shader_stencil_export b/Windows/glew/auto/extensions/gl/GL_AMD_shader_stencil_export new file mode 100644 index 00000000..d9056690 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_shader_stencil_export @@ -0,0 +1,4 @@ +GL_AMD_shader_stencil_export +http://www.opengl.org/registry/specs/AMD/shader_stencil_export.txt +GL_AMD_shader_stencil_export + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_shader_stencil_value_export b/Windows/glew/auto/extensions/gl/GL_AMD_shader_stencil_value_export new file mode 100644 index 00000000..0ff5263b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_shader_stencil_value_export @@ -0,0 +1,4 @@ +GL_AMD_shader_stencil_value_export +http://www.opengl.org/registry/specs/AMD/shader_stencil_value_export.txt +GL_AMD_shader_stencil_value_export + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_shader_trinary_minmax b/Windows/glew/auto/extensions/gl/GL_AMD_shader_trinary_minmax new file mode 100644 index 00000000..50e274a9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_shader_trinary_minmax @@ -0,0 +1,4 @@ +GL_AMD_shader_trinary_minmax +http://www.opengl.org/registry/specs/AMD/shader_trinary_minmax.txt +GL_AMD_shader_trinary_minmax + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_sparse_texture b/Windows/glew/auto/extensions/gl/GL_AMD_sparse_texture new file mode 100644 index 00000000..4d8975b7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_sparse_texture @@ -0,0 +1,15 @@ +GL_AMD_sparse_texture +http://www.opengl.org/registry/specs/AMD/sparse_texture.txt +GL_AMD_sparse_texture + + GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 + GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 + GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 + GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 + GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 + GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 + GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A + GL_MIN_SPARSE_LEVEL_AMD 0x919B + GL_MIN_LOD_WARNING_AMD 0x919C + void glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags) + void glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_stencil_operation_extended b/Windows/glew/auto/extensions/gl/GL_AMD_stencil_operation_extended new file mode 100644 index 00000000..a80d352f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_stencil_operation_extended @@ -0,0 +1,9 @@ +GL_AMD_stencil_operation_extended +http://www.opengl.org/registry/specs/AMD/stencil_operation_extended.txt +GL_AMD_stencil_operation_extended + + GL_SET_AMD 0x874A + GL_REPLACE_VALUE_AMD 0x874B + GL_STENCIL_OP_VALUE_AMD 0x874C + GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + void glStencilOpValueAMD (GLenum face, GLuint value) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_texture_gather_bias_lod b/Windows/glew/auto/extensions/gl/GL_AMD_texture_gather_bias_lod new file mode 100644 index 00000000..b04584ab --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_texture_gather_bias_lod @@ -0,0 +1,4 @@ +GL_AMD_texture_gather_bias_lod +http://www.opengl.org/registry/specs/AMD/texture_gather_bias_lod.txt +GL_AMD_texture_gather_bias_lod + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_texture_texture4 b/Windows/glew/auto/extensions/gl/GL_AMD_texture_texture4 new file mode 100644 index 00000000..e3cb3966 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_texture_texture4 @@ -0,0 +1,4 @@ +GL_AMD_texture_texture4 +http://www.opengl.org/registry/specs/AMD/texture_texture4.txt +GL_AMD_texture_texture4 + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_transform_feedback3_lines_triangles b/Windows/glew/auto/extensions/gl/GL_AMD_transform_feedback3_lines_triangles new file mode 100644 index 00000000..10555065 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_transform_feedback3_lines_triangles @@ -0,0 +1,4 @@ +GL_AMD_transform_feedback3_lines_triangles +http://www.opengl.org/registry/specs/AMD/transform_feedback3_lines_triangles.txt +GL_AMD_transform_feedback3_lines_triangles + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_transform_feedback4 b/Windows/glew/auto/extensions/gl/GL_AMD_transform_feedback4 new file mode 100644 index 00000000..1fa831ed --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_transform_feedback4 @@ -0,0 +1,5 @@ +GL_AMD_transform_feedback4 +http://www.opengl.org/registry/specs/AMD/transform_feedback4.txt +GL_AMD_transform_feedback4 + + GL_STREAM_RASTERIZATION_AMD 0x91A0 diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_layer b/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_layer new file mode 100644 index 00000000..dcc0701c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_layer @@ -0,0 +1,4 @@ +GL_AMD_vertex_shader_layer +http://www.opengl.org/registry/specs/AMD/vertex_shader_layer.txt +GL_AMD_vertex_shader_layer + diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_tessellator b/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_tessellator new file mode 100644 index 00000000..5eacafb6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_tessellator @@ -0,0 +1,13 @@ +GL_AMD_vertex_shader_tessellator +http://www.opengl.org/registry/specs/AMD/vertex_shader_tessellator.txt +GL_AMD_vertex_shader_tessellator + + GL_SAMPLER_BUFFER_AMD 0x9001 + GL_INT_SAMPLER_BUFFER_AMD 0x9002 + GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 + GL_TESSELLATION_MODE_AMD 0x9004 + GL_TESSELLATION_FACTOR_AMD 0x9005 + GL_DISCRETE_AMD 0x9006 + GL_CONTINUOUS_AMD 0x9007 + void glTessellationFactorAMD (GLfloat factor) + void glTessellationModeAMD (GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_viewport_index b/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_viewport_index new file mode 100644 index 00000000..71352254 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_AMD_vertex_shader_viewport_index @@ -0,0 +1,4 @@ +GL_AMD_vertex_shader_viewport_index +http://www.opengl.org/registry/specs/AMD/vertex_shader_viewport_index.txt +GL_AMD_vertex_shader_viewport_index + diff --git a/Windows/glew/auto/extensions/gl/GL_ANDROID_extension_pack_es31a b/Windows/glew/auto/extensions/gl/GL_ANDROID_extension_pack_es31a new file mode 100644 index 00000000..5c0d620c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANDROID_extension_pack_es31a @@ -0,0 +1,4 @@ +GL_ANDROID_extension_pack_es31a +http://www.opengl.org/registry/specs/ANDROID/extension_pack_es31a.txt +GL_ANDROID_extension_pack_es31a + diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_depth_texture b/Windows/glew/auto/extensions/gl/GL_ANGLE_depth_texture new file mode 100644 index 00000000..1277317f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_depth_texture @@ -0,0 +1,4 @@ +GL_ANGLE_depth_texture +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_depth_texture + diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_framebuffer_blit b/Windows/glew/auto/extensions/gl/GL_ANGLE_framebuffer_blit new file mode 100644 index 00000000..51e12d57 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_framebuffer_blit @@ -0,0 +1,9 @@ +GL_ANGLE_framebuffer_blit +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_framebuffer_blit + + GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 + GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 + GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + void glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_framebuffer_multisample b/Windows/glew/auto/extensions/gl/GL_ANGLE_framebuffer_multisample new file mode 100644 index 00000000..ce5f0968 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_framebuffer_multisample @@ -0,0 +1,8 @@ +GL_ANGLE_framebuffer_multisample +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_framebuffer_multisample + + GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 + GL_MAX_SAMPLES_ANGLE 0x8D57 + void glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_instanced_arrays b/Windows/glew/auto/extensions/gl/GL_ANGLE_instanced_arrays new file mode 100644 index 00000000..b13733b2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_instanced_arrays @@ -0,0 +1,8 @@ +GL_ANGLE_instanced_arrays +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_instanced_arrays + + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + void glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount) + void glVertexAttribDivisorANGLE (GLuint index, GLuint divisor) diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_pack_reverse_row_order b/Windows/glew/auto/extensions/gl/GL_ANGLE_pack_reverse_row_order new file mode 100644 index 00000000..806f0fb2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_pack_reverse_row_order @@ -0,0 +1,5 @@ +GL_ANGLE_pack_reverse_row_order +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_pack_reverse_row_order + + GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_program_binary b/Windows/glew/auto/extensions/gl/GL_ANGLE_program_binary new file mode 100644 index 00000000..71e9cb69 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_program_binary @@ -0,0 +1,5 @@ +GL_ANGLE_program_binary +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_program_binary + + GL_PROGRAM_BINARY_ANGLE 0x93A6 diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt1 b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt1 new file mode 100644 index 00000000..8aefa518 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt1 @@ -0,0 +1,8 @@ +GL_ANGLE_texture_compression_dxt1 +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_texture_compression_dxt1 + + GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt3 b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt3 new file mode 100644 index 00000000..19ec89c7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt3 @@ -0,0 +1,8 @@ +GL_ANGLE_texture_compression_dxt3 +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_texture_compression_dxt3 + + GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt5 b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt5 new file mode 100644 index 00000000..c7d3aebe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_compression_dxt5 @@ -0,0 +1,8 @@ +GL_ANGLE_texture_compression_dxt5 +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_texture_compression_dxt5 + + GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_usage b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_usage new file mode 100644 index 00000000..7add3b9c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_texture_usage @@ -0,0 +1,6 @@ +GL_ANGLE_texture_usage +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_texture_usage + + GL_TEXTURE_USAGE_ANGLE 0x93A2 + GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_timer_query b/Windows/glew/auto/extensions/gl/GL_ANGLE_timer_query new file mode 100644 index 00000000..391695f3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_timer_query @@ -0,0 +1,21 @@ +GL_ANGLE_timer_query +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_timer_query + + GL_QUERY_COUNTER_BITS_ANGLE 0x8864 + GL_CURRENT_QUERY_ANGLE 0x8865 + GL_QUERY_RESULT_ANGLE 0x8866 + GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 + GL_TIME_ELAPSED_ANGLE 0x88BF + GL_TIMESTAMP_ANGLE 0x8E28 + void glBeginQueryANGLE (GLenum target, GLuint id) + void glDeleteQueriesANGLE (GLsizei n, const GLuint* ids) + void glEndQueryANGLE (GLenum target) + void glGenQueriesANGLE (GLsizei n, GLuint* ids) + void glGetQueryObjecti64vANGLE (GLuint id, GLenum pname, GLint64* params) + void glGetQueryObjectivANGLE (GLuint id, GLenum pname, GLint* params) + void glGetQueryObjectui64vANGLE (GLuint id, GLenum pname, GLuint64* params) + void glGetQueryObjectuivANGLE (GLuint id, GLenum pname, GLuint* params) + void glGetQueryivANGLE (GLenum target, GLenum pname, GLint* params) + GLboolean glIsQueryANGLE (GLuint id) + void glQueryCounterANGLE (GLuint id, GLenum target) diff --git a/Windows/glew/auto/extensions/gl/GL_ANGLE_translated_shader_source b/Windows/glew/auto/extensions/gl/GL_ANGLE_translated_shader_source new file mode 100644 index 00000000..0f091f2f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ANGLE_translated_shader_source @@ -0,0 +1,6 @@ +GL_ANGLE_translated_shader_source +https://code.google.com/p/angleproject/source/browse/#git%2Fextensions +GL_ANGLE_translated_shader_source + + GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + void glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_aux_depth_stencil b/Windows/glew/auto/extensions/gl/GL_APPLE_aux_depth_stencil new file mode 100644 index 00000000..e7bc9ae9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_aux_depth_stencil @@ -0,0 +1,5 @@ +GL_APPLE_aux_depth_stencil +http://www.opengl.org/registry/specs/APPLE/aux_depth_stencil.txt +GL_APPLE_aux_depth_stencil + + GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_client_storage b/Windows/glew/auto/extensions/gl/GL_APPLE_client_storage new file mode 100644 index 00000000..7aa17c74 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_client_storage @@ -0,0 +1,5 @@ +GL_APPLE_client_storage +http://www.opengl.org/registry/specs/APPLE/client_storage.txt +GL_APPLE_client_storage + + GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_clip_distance b/Windows/glew/auto/extensions/gl/GL_APPLE_clip_distance new file mode 100644 index 00000000..173d81ad --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_clip_distance @@ -0,0 +1,13 @@ +GL_APPLE_clip_distance +http://www.opengl.org/registry/specs/APPLE/clip_distance.txt +GL_APPLE_clip_distance + + GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 + GL_CLIP_DISTANCE0_APPLE 0x3000 + GL_CLIP_DISTANCE1_APPLE 0x3001 + GL_CLIP_DISTANCE2_APPLE 0x3002 + GL_CLIP_DISTANCE3_APPLE 0x3003 + GL_CLIP_DISTANCE4_APPLE 0x3004 + GL_CLIP_DISTANCE5_APPLE 0x3005 + GL_CLIP_DISTANCE6_APPLE 0x3006 + GL_CLIP_DISTANCE7_APPLE 0x3007 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_color_buffer_packed_float b/Windows/glew/auto/extensions/gl/GL_APPLE_color_buffer_packed_float new file mode 100644 index 00000000..715fa046 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_color_buffer_packed_float @@ -0,0 +1,4 @@ +GL_APPLE_color_buffer_packed_float +http://www.opengl.org/registry/specs/APPLE/color_buffer_packed_float.txt +GL_APPLE_color_buffer_packed_float + diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_copy_texture_levels b/Windows/glew/auto/extensions/gl/GL_APPLE_copy_texture_levels new file mode 100644 index 00000000..6e6212af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_copy_texture_levels @@ -0,0 +1,5 @@ +GL_APPLE_copy_texture_levels +http://www.opengl.org/registry/specs/APPLE/copy_texture_levels.txt +GL_APPLE_copy_texture_levels + + void glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_element_array b/Windows/glew/auto/extensions/gl/GL_APPLE_element_array new file mode 100644 index 00000000..8b047528 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_element_array @@ -0,0 +1,12 @@ +GL_APPLE_element_array +http://www.opengl.org/registry/specs/APPLE/element_array.txt +GL_APPLE_element_array + + GL_ELEMENT_ARRAY_APPLE 0x8A0C + GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D + GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + void glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count) + void glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count) + void glElementPointerAPPLE (GLenum type, const void *pointer) + void glMultiDrawElementArrayAPPLE (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount) + void glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_fence b/Windows/glew/auto/extensions/gl/GL_APPLE_fence new file mode 100644 index 00000000..bc0018b7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_fence @@ -0,0 +1,14 @@ +GL_APPLE_fence +http://www.opengl.org/registry/specs/APPLE/fence.txt +GL_APPLE_fence + + GL_DRAW_PIXELS_APPLE 0x8A0A + GL_FENCE_APPLE 0x8A0B + void glDeleteFencesAPPLE (GLsizei n, const GLuint* fences) + void glFinishFenceAPPLE (GLuint fence) + void glFinishObjectAPPLE (GLenum object, GLint name) + void glGenFencesAPPLE (GLsizei n, GLuint* fences) + GLboolean glIsFenceAPPLE (GLuint fence) + void glSetFenceAPPLE (GLuint fence) + GLboolean glTestFenceAPPLE (GLuint fence) + GLboolean glTestObjectAPPLE (GLenum object, GLuint name) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_float_pixels b/Windows/glew/auto/extensions/gl/GL_APPLE_float_pixels new file mode 100644 index 00000000..3eacd421 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_float_pixels @@ -0,0 +1,18 @@ +GL_APPLE_float_pixels +http://www.opengl.org/registry/specs/APPLE/float_pixels.txt +GL_APPLE_float_pixels + + GL_HALF_APPLE 0x140B + GL_COLOR_FLOAT_APPLE 0x8A0F + GL_RGBA_FLOAT32_APPLE 0x8814 + GL_RGB_FLOAT32_APPLE 0x8815 + GL_ALPHA_FLOAT32_APPLE 0x8816 + GL_INTENSITY_FLOAT32_APPLE 0x8817 + GL_LUMINANCE_FLOAT32_APPLE 0x8818 + GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 + GL_RGBA_FLOAT16_APPLE 0x881A + GL_RGB_FLOAT16_APPLE 0x881B + GL_ALPHA_FLOAT16_APPLE 0x881C + GL_INTENSITY_FLOAT16_APPLE 0x881D + GL_LUMINANCE_FLOAT16_APPLE 0x881E + GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_flush_buffer_range b/Windows/glew/auto/extensions/gl/GL_APPLE_flush_buffer_range new file mode 100644 index 00000000..a569dd0f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_flush_buffer_range @@ -0,0 +1,8 @@ +GL_APPLE_flush_buffer_range +http://www.opengl.org/registry/specs/APPLE/flush_buffer_range.txt +GL_APPLE_flush_buffer_range + + GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 + GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + void glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param) + void glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_framebuffer_multisample b/Windows/glew/auto/extensions/gl/GL_APPLE_framebuffer_multisample new file mode 100644 index 00000000..56d263e2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_framebuffer_multisample @@ -0,0 +1,13 @@ +GL_APPLE_framebuffer_multisample +http://www.opengl.org/registry/specs/APPLE/framebuffer_multisample.txt +GL_APPLE_framebuffer_multisample + + GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 + GL_READ_FRAMEBUFFER_APPLE 0x8CA8 + GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA + GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 + GL_MAX_SAMPLES_APPLE 0x8D57 + void glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + void glResolveMultisampleFramebufferAPPLE (void) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_object_purgeable b/Windows/glew/auto/extensions/gl/GL_APPLE_object_purgeable new file mode 100644 index 00000000..a539888a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_object_purgeable @@ -0,0 +1,13 @@ +GL_APPLE_object_purgeable +http://www.opengl.org/registry/specs/APPLE/object_purgeable.txt +GL_APPLE_object_purgeable + + GL_BUFFER_OBJECT_APPLE 0x85B3 + GL_RELEASED_APPLE 0x8A19 + GL_VOLATILE_APPLE 0x8A1A + GL_RETAINED_APPLE 0x8A1B + GL_UNDEFINED_APPLE 0x8A1C + GL_PURGEABLE_APPLE 0x8A1D + void glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint* params) + GLenum glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option) + GLenum glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_pixel_buffer b/Windows/glew/auto/extensions/gl/GL_APPLE_pixel_buffer new file mode 100644 index 00000000..1a8ad970 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_pixel_buffer @@ -0,0 +1,5 @@ +GL_APPLE_pixel_buffer + +GL_APPLE_pixel_buffer + + GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_rgb_422 b/Windows/glew/auto/extensions/gl/GL_APPLE_rgb_422 new file mode 100644 index 00000000..a3b232d7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_rgb_422 @@ -0,0 +1,8 @@ +GL_APPLE_rgb_422 +http://www.opengl.org/registry/specs/APPLE/rgb_422.txt +GL_APPLE_rgb_422 + + GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA + GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB + GL_RGB_422_APPLE 0x8A1F + GL_RGB_RAW_422_APPLE 0x8A51 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_row_bytes b/Windows/glew/auto/extensions/gl/GL_APPLE_row_bytes new file mode 100644 index 00000000..e79a6075 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_row_bytes @@ -0,0 +1,6 @@ +GL_APPLE_row_bytes +http://www.opengl.org/registry/specs/APPLE/row_bytes.txt +GL_APPLE_row_bytes + + GL_PACK_ROW_BYTES_APPLE 0x8A15 + GL_UNPACK_ROW_BYTES_APPLE 0x8A16 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_specular_vector b/Windows/glew/auto/extensions/gl/GL_APPLE_specular_vector new file mode 100644 index 00000000..14aa3659 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_specular_vector @@ -0,0 +1,5 @@ +GL_APPLE_specular_vector +http://www.opengl.org/registry/specs/APPLE/specular_vector.txt +GL_APPLE_specular_vector + + GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_sync b/Windows/glew/auto/extensions/gl/GL_APPLE_sync new file mode 100644 index 00000000..ee49e8a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_sync @@ -0,0 +1,27 @@ +GL_APPLE_sync +http://www.opengl.org/registry/specs/APPLE/sync.txt +GL_APPLE_sync + + GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull + GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 + GL_SYNC_OBJECT_APPLE 0x8A53 + GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 + GL_OBJECT_TYPE_APPLE 0x9112 + GL_SYNC_CONDITION_APPLE 0x9113 + GL_SYNC_STATUS_APPLE 0x9114 + GL_SYNC_FLAGS_APPLE 0x9115 + GL_SYNC_FENCE_APPLE 0x9116 + GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 + GL_UNSIGNALED_APPLE 0x9118 + GL_SIGNALED_APPLE 0x9119 + GL_ALREADY_SIGNALED_APPLE 0x911A + GL_TIMEOUT_EXPIRED_APPLE 0x911B + GL_CONDITION_SATISFIED_APPLE 0x911C + GL_WAIT_FAILED_APPLE 0x911D + GLenum glClientWaitSyncAPPLE (GLsync GLsync, GLbitfield flags, GLuint64 timeout) + void glDeleteSyncAPPLE (GLsync GLsync) + GLsync glFenceSyncAPPLE (GLenum condition, GLbitfield flags) + void glGetInteger64vAPPLE (GLenum pname, GLint64* params) + void glGetSyncivAPPLE (GLsync GLsync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values) + GLboolean glIsSyncAPPLE (GLsync GLsync) + void glWaitSyncAPPLE (GLsync GLsync, GLbitfield flags, GLuint64 timeout) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_texture_2D_limited_npot b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_2D_limited_npot new file mode 100644 index 00000000..ebb3a73b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_2D_limited_npot @@ -0,0 +1,4 @@ +GL_APPLE_texture_2D_limited_npot +http://www.opengl.org/registry/specs/APPLE/texture_2D_limited_npot.txt +GL_APPLE_texture_2D_limited_npot + diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_texture_format_BGRA8888 b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_format_BGRA8888 new file mode 100644 index 00000000..0b3cdaa7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_format_BGRA8888 @@ -0,0 +1,6 @@ +GL_APPLE_texture_format_BGRA8888 +http://www.opengl.org/registry/specs/APPLE/texture_format_BGRA8888.txt +GL_APPLE_texture_format_BGRA8888 + + GL_BGRA_EXT 0x80E1 + GL_BGRA8_EXT 0x93A1 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_texture_max_level b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_max_level new file mode 100644 index 00000000..184ebea7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_max_level @@ -0,0 +1,5 @@ +GL_APPLE_texture_max_level +http://www.opengl.org/registry/specs/APPLE/texture_max_level.txt +GL_APPLE_texture_max_level + + GL_TEXTURE_MAX_LEVEL_APPLE 0x813D diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_texture_packed_float b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_packed_float new file mode 100644 index 00000000..68c5e8c9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_packed_float @@ -0,0 +1,8 @@ +GL_APPLE_texture_packed_float +http://www.opengl.org/registry/specs/APPLE/texture_packed_float.txt +GL_APPLE_texture_packed_float + + GL_R11F_G11F_B10F_APPLE 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B + GL_RGB9_E5_APPLE 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_texture_range b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_range new file mode 100644 index 00000000..e2bf85c3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_texture_range @@ -0,0 +1,13 @@ +GL_APPLE_texture_range +http://www.opengl.org/registry/specs/APPLE/texture_range.txt +GL_APPLE_texture_range + + GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC + GL_STORAGE_PRIVATE_APPLE 0x85BD + GL_STORAGE_CACHED_APPLE 0x85BE + GL_STORAGE_SHARED_APPLE 0x85BF + GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 + GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 + void glTextureRangeAPPLE (GLenum target, GLsizei length, void *pointer) + void glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params) + diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_transform_hint b/Windows/glew/auto/extensions/gl/GL_APPLE_transform_hint new file mode 100644 index 00000000..fce7aab4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_transform_hint @@ -0,0 +1,5 @@ +GL_APPLE_transform_hint +http://www.opengl.org/registry/specs/APPLE/transform_hint.txt +GL_APPLE_transform_hint + + GL_TRANSFORM_HINT_APPLE 0x85B1 diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_array_object b/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_array_object new file mode 100644 index 00000000..3c627b3f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_array_object @@ -0,0 +1,9 @@ +GL_APPLE_vertex_array_object +http://www.opengl.org/registry/specs/APPLE/vertex_array_object.txt +GL_APPLE_vertex_array_object + + GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + void glBindVertexArrayAPPLE (GLuint array) + void glDeleteVertexArraysAPPLE (GLsizei n, const GLuint* arrays) + void glGenVertexArraysAPPLE (GLsizei n, const GLuint* arrays) + GLboolean glIsVertexArrayAPPLE (GLuint array) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_array_range b/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_array_range new file mode 100644 index 00000000..b65ce133 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_array_range @@ -0,0 +1,15 @@ +GL_APPLE_vertex_array_range +http://www.opengl.org/registry/specs/APPLE/vertex_array_range.txt +GL_APPLE_vertex_array_range + + GL_VERTEX_ARRAY_RANGE_APPLE 0x851D + GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E + GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 + GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 + GL_STORAGE_CLIENT_APPLE 0x85B4 + GL_STORAGE_CACHED_APPLE 0x85BE + GL_STORAGE_SHARED_APPLE 0x85BF + void glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer) + void glVertexArrayParameteriAPPLE (GLenum pname, GLint param) + void glVertexArrayRangeAPPLE (GLsizei length, void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_program_evaluators b/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_program_evaluators new file mode 100644 index 00000000..a9c06db0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_vertex_program_evaluators @@ -0,0 +1,21 @@ +GL_APPLE_vertex_program_evaluators +http://www.opengl.org/registry/specs/APPLE/vertex_program_evaluators.txt +GL_APPLE_vertex_program_evaluators + + GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 + GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 + GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 + GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 + GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 + GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 + GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 + GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 + GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 + GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + void glDisableVertexAttribAPPLE (GLuint index, GLenum pname) + void glEnableVertexAttribAPPLE (GLuint index, GLenum pname) + GLboolean glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname) + void glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points) + void glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points) + void glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points) + void glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points) diff --git a/Windows/glew/auto/extensions/gl/GL_APPLE_ycbcr_422 b/Windows/glew/auto/extensions/gl/GL_APPLE_ycbcr_422 new file mode 100644 index 00000000..b74e6176 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_APPLE_ycbcr_422 @@ -0,0 +1,5 @@ +GL_APPLE_ycbcr_422 +http://www.opengl.org/registry/specs/APPLE/ycbcr_422.txt +GL_APPLE_ycbcr_422 + + GL_YCBCR_422_APPLE 0x85B9 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_ES2_compatibility b/Windows/glew/auto/extensions/gl/GL_ARB_ES2_compatibility new file mode 100644 index 00000000..282651a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_ES2_compatibility @@ -0,0 +1,26 @@ +GL_ARB_ES2_compatibility +http://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt +GL_ARB_ES2_compatibility + + GL_FIXED 0x140C + GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A + GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B + GL_RGB565 0x8D62 + GL_LOW_FLOAT 0x8DF0 + GL_MEDIUM_FLOAT 0x8DF1 + GL_HIGH_FLOAT 0x8DF2 + GL_LOW_INT 0x8DF3 + GL_MEDIUM_INT 0x8DF4 + GL_HIGH_INT 0x8DF5 + GL_SHADER_BINARY_FORMATS 0x8DF8 + GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 + GL_SHADER_COMPILER 0x8DFA + GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB + GL_MAX_VARYING_VECTORS 0x8DFC + GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + void glClearDepthf (GLclampf d) + void glDepthRangef (GLclampf n, GLclampf f) + void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision) + void glReleaseShaderCompiler (void) + void glShaderBinary (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length) + typedef int GLfixed diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_ES3_1_compatibility b/Windows/glew/auto/extensions/gl/GL_ARB_ES3_1_compatibility new file mode 100644 index 00000000..40eccdea --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_ES3_1_compatibility @@ -0,0 +1,5 @@ +GL_ARB_ES3_1_compatibility +http://www.opengl.org/registry/specs/ARB/ES3_1_compatibility.txt +GL_ARB_ES3_1_compatibility + + void glMemoryBarrierByRegion (GLbitfield barriers) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_ES3_2_compatibility b/Windows/glew/auto/extensions/gl/GL_ARB_ES3_2_compatibility new file mode 100644 index 00000000..516b4253 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_ES3_2_compatibility @@ -0,0 +1,8 @@ +GL_ARB_ES3_2_compatibility +http://www.opengl.org/registry/specs/ARB/ES3_2_compatibility.txt +GL_ARB_ES3_2_compatibility + + GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE + GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 + GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 + void glPrimitiveBoundingBoxARB (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_ES3_compatibility b/Windows/glew/auto/extensions/gl/GL_ARB_ES3_compatibility new file mode 100644 index 00000000..13295ae0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_ES3_compatibility @@ -0,0 +1,18 @@ +GL_ARB_ES3_compatibility +http://www.opengl.org/registry/specs/ARB/ES3_compatibility.txt +GL_ARB_ES3_compatibility + + GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 + GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A + GL_MAX_ELEMENT_INDEX 0x8D6B + GL_COMPRESSED_R11_EAC 0x9270 + GL_COMPRESSED_SIGNED_R11_EAC 0x9271 + GL_COMPRESSED_RG11_EAC 0x9272 + GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 + GL_COMPRESSED_RGB8_ETC2 0x9274 + GL_COMPRESSED_SRGB8_ETC2 0x9275 + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 + GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_arrays_of_arrays b/Windows/glew/auto/extensions/gl/GL_ARB_arrays_of_arrays new file mode 100644 index 00000000..1b1696ab --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_arrays_of_arrays @@ -0,0 +1,4 @@ +GL_ARB_arrays_of_arrays +http://www.opengl.org/registry/specs/ARB/arrays_of_arrays.txt +GL_ARB_arrays_of_arrays + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_base_instance b/Windows/glew/auto/extensions/gl/GL_ARB_base_instance new file mode 100644 index 00000000..ad6913de --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_base_instance @@ -0,0 +1,7 @@ +GL_ARB_base_instance +http://www.opengl.org/registry/specs/ARB/base_instance.txt +GL_ARB_base_instance + + void glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance) + void glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance) + void glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_bindless_texture b/Windows/glew/auto/extensions/gl/GL_ARB_bindless_texture new file mode 100644 index 00000000..360a0650 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_bindless_texture @@ -0,0 +1,21 @@ +GL_ARB_bindless_texture +http://www.opengl.org/registry/specs/ARB/bindless_texture.txt +GL_ARB_bindless_texture + + GL_UNSIGNED_INT64_ARB 0x140F + GLuint64 glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format) + GLuint64 glGetTextureHandleARB (GLuint texture) + GLuint64 glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler) + void glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT* params) + GLboolean glIsImageHandleResidentARB (GLuint64 handle) + GLboolean glIsTextureHandleResidentARB (GLuint64 handle) + void glMakeImageHandleNonResidentARB (GLuint64 handle) + void glMakeImageHandleResidentARB (GLuint64 handle, GLenum access) + void glMakeTextureHandleNonResidentARB (GLuint64 handle) + void glMakeTextureHandleResidentARB (GLuint64 handle) + void glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value) + void glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64* values) + void glUniformHandleui64ARB (GLint location, GLuint64 value) + void glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64* value) + void glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x) + void glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT* v) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_blend_func_extended b/Windows/glew/auto/extensions/gl/GL_ARB_blend_func_extended new file mode 100644 index 00000000..0f9e9441 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_blend_func_extended @@ -0,0 +1,10 @@ +GL_ARB_blend_func_extended +http://www.opengl.org/registry/specs/ARB/blend_func_extended.txt +GL_ARB_blend_func_extended + + GL_SRC1_COLOR 0x88F9 + GL_ONE_MINUS_SRC1_COLOR 0x88FA + GL_ONE_MINUS_SRC1_ALPHA 0x88FB + GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + void glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name) + GLint glGetFragDataIndex (GLuint program, const GLchar * name) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_buffer_storage b/Windows/glew/auto/extensions/gl/GL_ARB_buffer_storage new file mode 100644 index 00000000..05e3684a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_buffer_storage @@ -0,0 +1,14 @@ +GL_ARB_buffer_storage +http://www.opengl.org/registry/specs/ARB/buffer_storage.txt +GL_ARB_buffer_storage + + GL_MAP_READ_BIT 0x0001 + GL_MAP_WRITE_BIT 0x0002 + GL_MAP_PERSISTENT_BIT 0x00000040 + GL_MAP_COHERENT_BIT 0x00000080 + GL_DYNAMIC_STORAGE_BIT 0x0100 + GL_CLIENT_STORAGE_BIT 0x0200 + GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 + GL_BUFFER_IMMUTABLE_STORAGE 0x821F + GL_BUFFER_STORAGE_FLAGS 0x8220 + void glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_cl_event b/Windows/glew/auto/extensions/gl/GL_ARB_cl_event new file mode 100644 index 00000000..8d658040 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_cl_event @@ -0,0 +1,9 @@ +GL_ARB_cl_event +http://www.opengl.org/registry/specs/ARB/cl_event.txt +GL_ARB_cl_event + + GL_SYNC_CL_EVENT_ARB 0x8240 + GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + GLsync glCreateSyncFromCLeventARB (cl_context context, cl_event event, GLbitfield flags) + typedef struct _cl_context *cl_context + typedef struct _cl_event *cl_event diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_clear_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_clear_buffer_object new file mode 100644 index 00000000..32ab9722 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_clear_buffer_object @@ -0,0 +1,8 @@ +GL_ARB_clear_buffer_object +http://www.opengl.org/registry/specs/ARB/clear_buffer_object.txt +GL_ARB_clear_buffer_object + + void glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data) + void glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data) + void glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data) + void glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_clear_texture b/Windows/glew/auto/extensions/gl/GL_ARB_clear_texture new file mode 100644 index 00000000..d908df3a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_clear_texture @@ -0,0 +1,7 @@ +GL_ARB_clear_texture +http://www.opengl.org/registry/specs/ARB/clear_texture.txt +GL_ARB_clear_texture + + GL_CLEAR_TEXTURE 0x9365 + void glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data) + void glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_clip_control b/Windows/glew/auto/extensions/gl/GL_ARB_clip_control new file mode 100644 index 00000000..a09d3643 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_clip_control @@ -0,0 +1,11 @@ +GL_ARB_clip_control +http://www.opengl.org/registry/specs/ARB/clip_control.txt +GL_ARB_clip_control + + GL_LOWER_LEFT 0x8CA1 + GL_UPPER_LEFT 0x8CA2 + GL_CLIP_ORIGIN 0x935C + GL_CLIP_DEPTH_MODE 0x935D + GL_NEGATIVE_ONE_TO_ONE 0x935E + GL_ZERO_TO_ONE 0x935F + void glClipControl (GLenum origin, GLenum depth) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_color_buffer_float b/Windows/glew/auto/extensions/gl/GL_ARB_color_buffer_float new file mode 100644 index 00000000..c2e7a5aa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_color_buffer_float @@ -0,0 +1,10 @@ +GL_ARB_color_buffer_float +http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt +GL_ARB_color_buffer_float + + GL_RGBA_FLOAT_MODE_ARB 0x8820 + GL_CLAMP_VERTEX_COLOR_ARB 0x891A + GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B + GL_CLAMP_READ_COLOR_ARB 0x891C + GL_FIXED_ONLY_ARB 0x891D + void glClampColorARB (GLenum target, GLenum clamp) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_compatibility b/Windows/glew/auto/extensions/gl/GL_ARB_compatibility new file mode 100644 index 00000000..41fa078a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_compatibility @@ -0,0 +1,4 @@ +GL_ARB_compatibility +http://www.opengl.org/registry/specs/ARB/compatibility.txt +GL_ARB_compatibility + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_compressed_texture_pixel_storage b/Windows/glew/auto/extensions/gl/GL_ARB_compressed_texture_pixel_storage new file mode 100644 index 00000000..1db920a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_compressed_texture_pixel_storage @@ -0,0 +1,12 @@ +GL_ARB_compressed_texture_pixel_storage +http://www.opengl.org/registry/specs/ARB/compressed_texture_pixel_storage.txt +GL_ARB_compressed_texture_pixel_storage + + GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 + GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 + GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A + GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B + GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C + GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D + GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_compute_shader b/Windows/glew/auto/extensions/gl/GL_ARB_compute_shader new file mode 100644 index 00000000..62baa736 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_compute_shader @@ -0,0 +1,24 @@ +GL_ARB_compute_shader +http://www.opengl.org/registry/specs/ARB/compute_shader.txt +GL_ARB_compute_shader + + GL_COMPUTE_SHADER_BIT 0x00000020 + GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 + GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 + GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 + GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 + GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 + GL_COMPUTE_WORK_GROUP_SIZE 0x8267 + GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB + GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED + GL_DISPATCH_INDIRECT_BUFFER 0x90EE + GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF + GL_COMPUTE_SHADER 0x91B9 + GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB + GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC + GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD + GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE + GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + void glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) + void glDispatchComputeIndirect (GLintptr indirect) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_compute_variable_group_size b/Windows/glew/auto/extensions/gl/GL_ARB_compute_variable_group_size new file mode 100644 index 00000000..c30ddd68 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_compute_variable_group_size @@ -0,0 +1,9 @@ +GL_ARB_compute_variable_group_size +http://www.opengl.org/registry/specs/ARB/compute_variable_group_size.txt +GL_ARB_compute_variable_group_size + + GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB + GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF + GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 + GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + void glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_conditional_render_inverted b/Windows/glew/auto/extensions/gl/GL_ARB_conditional_render_inverted new file mode 100644 index 00000000..d21a7a29 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_conditional_render_inverted @@ -0,0 +1,8 @@ +GL_ARB_conditional_render_inverted +http://www.opengl.org/registry/specs/ARB/conditional_render_inverted.txt +GL_ARB_conditional_render_inverted + + GL_QUERY_WAIT_INVERTED 0x8E17 + GL_QUERY_NO_WAIT_INVERTED 0x8E18 + GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 + GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_conservative_depth b/Windows/glew/auto/extensions/gl/GL_ARB_conservative_depth new file mode 100644 index 00000000..fb3d78dc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_conservative_depth @@ -0,0 +1,4 @@ +GL_ARB_conservative_depth +http://www.opengl.org/registry/specs/ARB/conservative_depth.txt +GL_ARB_conservative_depth + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_copy_buffer b/Windows/glew/auto/extensions/gl/GL_ARB_copy_buffer new file mode 100644 index 00000000..d896db94 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_copy_buffer @@ -0,0 +1,7 @@ +GL_ARB_copy_buffer +http://www.opengl.org/registry/specs/ARB/copy_buffer.txt +GL_ARB_copy_buffer + + GL_COPY_READ_BUFFER 0x8F36 + GL_COPY_WRITE_BUFFER 0x8F37 + void glCopyBufferSubData (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_copy_image b/Windows/glew/auto/extensions/gl/GL_ARB_copy_image new file mode 100644 index 00000000..804f64a8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_copy_image @@ -0,0 +1,5 @@ +GL_ARB_copy_image +http://www.opengl.org/registry/specs/ARB/copy_image.txt +GL_ARB_copy_image + + void glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_cull_distance b/Windows/glew/auto/extensions/gl/GL_ARB_cull_distance new file mode 100644 index 00000000..91dbc308 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_cull_distance @@ -0,0 +1,6 @@ +GL_ARB_cull_distance +http://www.opengl.org/registry/specs/ARB/cull_distance.txt +GL_ARB_cull_distance + + GL_MAX_CULL_DISTANCES 0x82F9 + GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_debug_output b/Windows/glew/auto/extensions/gl/GL_ARB_debug_output new file mode 100644 index 00000000..189c2729 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_debug_output @@ -0,0 +1,31 @@ +GL_ARB_debug_output +http://www.opengl.org/registry/specs/ARB/debug_output.txt +GL_ARB_debug_output + + GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 + GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 + GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 + GL_DEBUG_SOURCE_API_ARB 0x8246 + GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 + GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 + GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 + GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A + GL_DEBUG_SOURCE_OTHER_ARB 0x824B + GL_DEBUG_TYPE_ERROR_ARB 0x824C + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E + GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F + GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 + GL_DEBUG_TYPE_OTHER_ARB 0x8251 + GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 + GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 + GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 + GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 + GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 + GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + void glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam) + void glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled) + void glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf) + GLuint glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog) + typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_depth_buffer_float b/Windows/glew/auto/extensions/gl/GL_ARB_depth_buffer_float new file mode 100644 index 00000000..7fac9f1b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_depth_buffer_float @@ -0,0 +1,7 @@ +GL_ARB_depth_buffer_float +http://www.opengl.org/registry/specs/ARB/depth_buffer_float.txt +GL_ARB_depth_buffer_float + + GL_DEPTH_COMPONENT32F 0x8CAC + GL_DEPTH32F_STENCIL8 0x8CAD + GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_depth_clamp b/Windows/glew/auto/extensions/gl/GL_ARB_depth_clamp new file mode 100644 index 00000000..672594e2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_depth_clamp @@ -0,0 +1,5 @@ +GL_ARB_depth_clamp +http://www.opengl.org/registry/specs/ARB/depth_clamp.txt +GL_ARB_depth_clamp + + GL_DEPTH_CLAMP 0x864F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_depth_texture b/Windows/glew/auto/extensions/gl/GL_ARB_depth_texture new file mode 100644 index 00000000..dd56e61c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_depth_texture @@ -0,0 +1,9 @@ +GL_ARB_depth_texture +http://www.opengl.org/registry/specs/ARB/depth_texture.txt +GL_ARB_depth_texture + + GL_DEPTH_COMPONENT16_ARB 0x81A5 + GL_DEPTH_COMPONENT24_ARB 0x81A6 + GL_DEPTH_COMPONENT32_ARB 0x81A7 + GL_TEXTURE_DEPTH_SIZE_ARB 0x884A + GL_DEPTH_TEXTURE_MODE_ARB 0x884B diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_derivative_control b/Windows/glew/auto/extensions/gl/GL_ARB_derivative_control new file mode 100644 index 00000000..7498a5d6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_derivative_control @@ -0,0 +1,4 @@ +GL_ARB_derivative_control +http://www.opengl.org/registry/specs/ARB/derivative_control.txt +GL_ARB_derivative_control + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_direct_state_access b/Windows/glew/auto/extensions/gl/GL_ARB_direct_state_access new file mode 100644 index 00000000..b3ab7357 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_direct_state_access @@ -0,0 +1,103 @@ +GL_ARB_direct_state_access +http://www.opengl.org/registry/specs/ARB/direct_state_access.txt +GL_ARB_direct_state_access + + GL_TEXTURE_TARGET 0x1006 + GL_QUERY_TARGET 0x82EA + void glBindTextureUnit (GLuint unit, GLuint texture) + void glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + GLenum glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target) + void glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data) + void glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data) + void glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) + void glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat* value) + void glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value) + void glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value) + void glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) + void glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) + void glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCreateBuffers (GLsizei n, GLuint* buffers) + void glCreateFramebuffers (GLsizei n, GLuint* framebuffers) + void glCreateProgramPipelines (GLsizei n, GLuint* pipelines) + void glCreateQueries (GLenum target, GLsizei n, GLuint* ids) + void glCreateRenderbuffers (GLsizei n, GLuint* renderbuffers) + void glCreateSamplers (GLsizei n, GLuint* samplers) + void glCreateTextures (GLenum target, GLsizei n, GLuint* textures) + void glCreateTransformFeedbacks (GLsizei n, GLuint* ids) + void glCreateVertexArrays (GLsizei n, GLuint* arrays) + void glDisableVertexArrayAttrib (GLuint vaobj, GLuint index) + void glEnableVertexArrayAttrib (GLuint vaobj, GLuint index) + void glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length) + void glGenerateTextureMipmap (GLuint texture) + void glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels) + void glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64* params) + void glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint* params) + void glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void** params) + void glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data) + void glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params) + void glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint* param) + void glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint* params) + void glGetQueryBufferObjecti64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset) + void glGetQueryBufferObjectiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset) + void glGetQueryBufferObjectui64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset) + void glGetQueryBufferObjectuiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset) + void glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels) + void glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat* params) + void glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint* params) + void glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint* params) + void glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint* params) + void glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat* params) + void glGetTextureParameteriv (GLuint texture, GLenum pname, GLint* params) + void glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64* param) + void glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint* param) + void glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint* param) + void glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64* param) + void glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint* param) + void glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint* param) + void glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments) + void glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height) + void * glMapNamedBuffer (GLuint buffer, GLenum access) + void * glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access) + void glNamedBufferData (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage) + void glNamedBufferStorage (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags) + void glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data) + void glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum mode) + void glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum* bufs) + void glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param) + void glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum mode) + void glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) + void glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) + void glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) + void glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + void glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer) + void glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glTextureParameterIiv (GLuint texture, GLenum pname, const GLint* params) + void glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint* params) + void glTextureParameterf (GLuint texture, GLenum pname, GLfloat param) + void glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat* param) + void glTextureParameteri (GLuint texture, GLenum pname, GLint param) + void glTextureParameteriv (GLuint texture, GLenum pname, const GLint* param) + void glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width) + void glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) + void glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) + void glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) + void glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels) + void glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) + void glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) + void glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer) + void glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + GLboolean glUnmapNamedBuffer (GLuint buffer) + void glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex) + void glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) + void glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor) + void glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer) + void glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) + void glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_draw_buffers b/Windows/glew/auto/extensions/gl/GL_ARB_draw_buffers new file mode 100644 index 00000000..b520b110 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_draw_buffers @@ -0,0 +1,22 @@ +GL_ARB_draw_buffers +http://www.opengl.org/registry/specs/ARB/draw_buffers.txt +GL_ARB_draw_buffers + + GL_MAX_DRAW_BUFFERS_ARB 0x8824 + GL_DRAW_BUFFER0_ARB 0x8825 + GL_DRAW_BUFFER1_ARB 0x8826 + GL_DRAW_BUFFER2_ARB 0x8827 + GL_DRAW_BUFFER3_ARB 0x8828 + GL_DRAW_BUFFER4_ARB 0x8829 + GL_DRAW_BUFFER5_ARB 0x882A + GL_DRAW_BUFFER6_ARB 0x882B + GL_DRAW_BUFFER7_ARB 0x882C + GL_DRAW_BUFFER8_ARB 0x882D + GL_DRAW_BUFFER9_ARB 0x882E + GL_DRAW_BUFFER10_ARB 0x882F + GL_DRAW_BUFFER11_ARB 0x8830 + GL_DRAW_BUFFER12_ARB 0x8831 + GL_DRAW_BUFFER13_ARB 0x8832 + GL_DRAW_BUFFER14_ARB 0x8833 + GL_DRAW_BUFFER15_ARB 0x8834 + void glDrawBuffersARB (GLsizei n, const GLenum* bufs) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_draw_buffers_blend b/Windows/glew/auto/extensions/gl/GL_ARB_draw_buffers_blend new file mode 100644 index 00000000..9cbcbe76 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_draw_buffers_blend @@ -0,0 +1,8 @@ +GL_ARB_draw_buffers_blend +http://www.opengl.org/registry/specs/ARB/draw_buffers_blend.txt +GL_ARB_draw_buffers_blend + + void glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendEquationiARB (GLuint buf, GLenum mode) + void glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) + void glBlendFunciARB (GLuint buf, GLenum src, GLenum dst) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_draw_elements_base_vertex b/Windows/glew/auto/extensions/gl/GL_ARB_draw_elements_base_vertex new file mode 100644 index 00000000..3475d1a8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_draw_elements_base_vertex @@ -0,0 +1,8 @@ +GL_ARB_draw_elements_base_vertex +http://www.opengl.org/registry/specs/ARB/draw_elements_base_vertex.txt +GL_ARB_draw_elements_base_vertex + + void glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, void *indices, GLint basevertex) + void glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex) + void glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void *indices, GLint basevertex) + void glMultiDrawElementsBaseVertex (GLenum mode, GLsizei* count, GLenum type, void**indices, GLsizei primcount, GLint *basevertex) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_draw_indirect b/Windows/glew/auto/extensions/gl/GL_ARB_draw_indirect new file mode 100644 index 00000000..744cc630 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_draw_indirect @@ -0,0 +1,8 @@ +GL_ARB_draw_indirect +http://www.opengl.org/registry/specs/ARB/draw_indirect.txt +GL_ARB_draw_indirect + + GL_DRAW_INDIRECT_BUFFER 0x8F3F + GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + void glDrawArraysIndirect (GLenum mode, const void *indirect) + void glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_draw_instanced b/Windows/glew/auto/extensions/gl/GL_ARB_draw_instanced new file mode 100644 index 00000000..a730952d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_draw_instanced @@ -0,0 +1,4 @@ +GL_ARB_draw_instanced +http://www.opengl.org/registry/specs/ARB/draw_instanced.txt +GL_ARB_draw_instanced + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_enhanced_layouts b/Windows/glew/auto/extensions/gl/GL_ARB_enhanced_layouts new file mode 100644 index 00000000..fe9c5ecf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_enhanced_layouts @@ -0,0 +1,7 @@ +GL_ARB_enhanced_layouts +http://www.opengl.org/registry/specs/ARB/enhanced_layouts.txt +GL_ARB_enhanced_layouts + + GL_LOCATION_COMPONENT 0x934A + GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B + GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_explicit_attrib_location b/Windows/glew/auto/extensions/gl/GL_ARB_explicit_attrib_location new file mode 100644 index 00000000..c97cb072 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_explicit_attrib_location @@ -0,0 +1,4 @@ +GL_ARB_explicit_attrib_location +http://www.opengl.org/registry/specs/ARB/explicit_attrib_location.txt +GL_ARB_explicit_attrib_location + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_explicit_uniform_location b/Windows/glew/auto/extensions/gl/GL_ARB_explicit_uniform_location new file mode 100644 index 00000000..2e6d092b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_explicit_uniform_location @@ -0,0 +1,5 @@ +GL_ARB_explicit_uniform_location +http://www.opengl.org/registry/specs/ARB/explicit_uniform_location.txt +GL_ARB_explicit_uniform_location + + GL_MAX_UNIFORM_LOCATIONS 0x826E diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_fragment_coord_conventions b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_coord_conventions new file mode 100644 index 00000000..83be2169 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_coord_conventions @@ -0,0 +1,4 @@ +GL_ARB_fragment_coord_conventions +http://www.opengl.org/registry/specs/ARB/fragment_coord_conventions.txt +GL_ARB_fragment_coord_conventions + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_fragment_layer_viewport b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_layer_viewport new file mode 100644 index 00000000..47e40cf7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_layer_viewport @@ -0,0 +1,4 @@ +GL_ARB_fragment_layer_viewport +http://www.opengl.org/registry/specs/ARB/fragment_layer_viewport.txt +GL_ARB_fragment_layer_viewport + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_fragment_program b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_program new file mode 100644 index 00000000..1dc5fbe8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_program @@ -0,0 +1,19 @@ +GL_ARB_fragment_program +http://www.opengl.org/registry/specs/ARB/fragment_program.txt +GL_ARB_fragment_program + + GL_FRAGMENT_PROGRAM_ARB 0x8804 + GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 + GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 + GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 + GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 + GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 + GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A + GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B + GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C + GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D + GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E + GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F + GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 + GL_MAX_TEXTURE_COORDS_ARB 0x8871 + GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_fragment_program_shadow b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_program_shadow new file mode 100644 index 00000000..28be945d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_program_shadow @@ -0,0 +1,4 @@ +GL_ARB_fragment_program_shadow +http://www.opengl.org/registry/specs/ARB/fragment_program_shadow.txt +GL_ARB_fragment_program_shadow + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_fragment_shader b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_shader new file mode 100644 index 00000000..4c2f3254 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_shader @@ -0,0 +1,7 @@ +GL_ARB_fragment_shader +http://www.opengl.org/registry/specs/ARB/fragment_shader.txt +GL_ARB_fragment_shader + + GL_FRAGMENT_SHADER_ARB 0x8B30 + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 + GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_fragment_shader_interlock b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_shader_interlock new file mode 100644 index 00000000..7b121af9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_fragment_shader_interlock @@ -0,0 +1,4 @@ +GL_ARB_fragment_shader_interlock +http://www.opengl.org/registry/specs/ARB/fragment_shader_interlock.txt +GL_ARB_fragment_shader_interlock + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_no_attachments b/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_no_attachments new file mode 100644 index 00000000..4ac64dd7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_no_attachments @@ -0,0 +1,17 @@ +GL_ARB_framebuffer_no_attachments +http://www.opengl.org/registry/specs/ARB/framebuffer_no_attachments.txt +GL_ARB_framebuffer_no_attachments + + GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 + GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 + GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 + GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 + GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 + GL_MAX_FRAMEBUFFER_WIDTH 0x9315 + GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 + GL_MAX_FRAMEBUFFER_LAYERS 0x9317 + GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + void glFramebufferParameteri (GLenum target, GLenum pname, GLint param) + void glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint* params) + void glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint* params) + void glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_object new file mode 100644 index 00000000..1e130f9b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_object @@ -0,0 +1,98 @@ +GL_ARB_framebuffer_object +http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt +GL_ARB_framebuffer_object + + GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 + GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 + GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 + GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 + GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 + GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 + GL_FRAMEBUFFER_DEFAULT 0x8218 + GL_FRAMEBUFFER_UNDEFINED 0x8219 + GL_DEPTH_STENCIL_ATTACHMENT 0x821A + GL_INDEX 0x8222 + GL_MAX_RENDERBUFFER_SIZE 0x84E8 + GL_DEPTH_STENCIL 0x84F9 + GL_UNSIGNED_INT_24_8 0x84FA + GL_DEPTH24_STENCIL8 0x88F0 + GL_TEXTURE_STENCIL_SIZE 0x88F1 + GL_UNSIGNED_NORMALIZED 0x8C17 + GL_SRGB 0x8C40 + GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 + GL_FRAMEBUFFER_BINDING 0x8CA6 + GL_RENDERBUFFER_BINDING 0x8CA7 + GL_READ_FRAMEBUFFER 0x8CA8 + GL_DRAW_FRAMEBUFFER 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING 0x8CAA + GL_RENDERBUFFER_SAMPLES 0x8CAB + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 + GL_FRAMEBUFFER_COMPLETE 0x8CD5 + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC + GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD + GL_MAX_COLOR_ATTACHMENTS 0x8CDF + GL_COLOR_ATTACHMENT0 0x8CE0 + GL_COLOR_ATTACHMENT1 0x8CE1 + GL_COLOR_ATTACHMENT2 0x8CE2 + GL_COLOR_ATTACHMENT3 0x8CE3 + GL_COLOR_ATTACHMENT4 0x8CE4 + GL_COLOR_ATTACHMENT5 0x8CE5 + GL_COLOR_ATTACHMENT6 0x8CE6 + GL_COLOR_ATTACHMENT7 0x8CE7 + GL_COLOR_ATTACHMENT8 0x8CE8 + GL_COLOR_ATTACHMENT9 0x8CE9 + GL_COLOR_ATTACHMENT10 0x8CEA + GL_COLOR_ATTACHMENT11 0x8CEB + GL_COLOR_ATTACHMENT12 0x8CEC + GL_COLOR_ATTACHMENT13 0x8CED + GL_COLOR_ATTACHMENT14 0x8CEE + GL_COLOR_ATTACHMENT15 0x8CEF + GL_DEPTH_ATTACHMENT 0x8D00 + GL_STENCIL_ATTACHMENT 0x8D20 + GL_FRAMEBUFFER 0x8D40 + GL_RENDERBUFFER 0x8D41 + GL_RENDERBUFFER_WIDTH 0x8D42 + GL_RENDERBUFFER_HEIGHT 0x8D43 + GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 + GL_STENCIL_INDEX1 0x8D46 + GL_STENCIL_INDEX4 0x8D47 + GL_STENCIL_INDEX8 0x8D48 + GL_STENCIL_INDEX16 0x8D49 + GL_RENDERBUFFER_RED_SIZE 0x8D50 + GL_RENDERBUFFER_GREEN_SIZE 0x8D51 + GL_RENDERBUFFER_BLUE_SIZE 0x8D52 + GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 + GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 + GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 + GL_MAX_SAMPLES 0x8D57 + void glBindFramebuffer (GLenum target, GLuint framebuffer) + void glBindRenderbuffer (GLenum target, GLuint renderbuffer) + void glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + GLenum glCheckFramebufferStatus (GLenum target) + void glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers) + void glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers) + void glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) + void glFramebufferTextureLayer (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer) + void glGenFramebuffers (GLsizei n, GLuint* framebuffers) + void glGenRenderbuffers (GLsizei n, GLuint* renderbuffers) + void glGenerateMipmap (GLenum target) + void glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params) + void glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params) + GLboolean glIsFramebuffer (GLuint framebuffer) + GLboolean glIsRenderbuffer (GLuint renderbuffer) + void glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) + void glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_sRGB b/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_sRGB new file mode 100644 index 00000000..bda04120 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_framebuffer_sRGB @@ -0,0 +1,5 @@ +GL_ARB_framebuffer_sRGB +http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt +GL_ARB_framebuffer_sRGB + + GL_FRAMEBUFFER_SRGB 0x8DB9 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_geometry_shader4 b/Windows/glew/auto/extensions/gl/GL_ARB_geometry_shader4 new file mode 100644 index 00000000..bdb41ca8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_geometry_shader4 @@ -0,0 +1,27 @@ +GL_ARB_geometry_shader4 +http://www.opengl.org/registry/specs/ARB/geometry_shader4.txt +GL_ARB_geometry_shader4 + + GL_LINES_ADJACENCY_ARB 0xA + GL_LINE_STRIP_ADJACENCY_ARB 0xB + GL_TRIANGLES_ADJACENCY_ARB 0xC + GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD + GL_PROGRAM_POINT_SIZE_ARB 0x8642 + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 + GL_GEOMETRY_SHADER_ARB 0x8DD9 + GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA + GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB + GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC + GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD + GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + void glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level) + void glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) + void glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) + void glProgramParameteriARB (GLuint program, GLenum pname, GLint value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_get_program_binary b/Windows/glew/auto/extensions/gl/GL_ARB_get_program_binary new file mode 100644 index 00000000..e22881af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_get_program_binary @@ -0,0 +1,11 @@ +GL_ARB_get_program_binary +http://www.opengl.org/registry/specs/ARB/get_program_binary.txt +GL_ARB_get_program_binary + + GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 + GL_PROGRAM_BINARY_LENGTH 0x8741 + GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE + GL_PROGRAM_BINARY_FORMATS 0x87FF + void glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary) + void glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length) + void glProgramParameteri (GLuint program, GLenum pname, GLint value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_get_texture_sub_image b/Windows/glew/auto/extensions/gl/GL_ARB_get_texture_sub_image new file mode 100644 index 00000000..f84b1d34 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_get_texture_sub_image @@ -0,0 +1,6 @@ +GL_ARB_get_texture_sub_image +http://www.opengl.org/registry/specs/ARB/get_texture_sub_image.txt +GL_ARB_get_texture_sub_image + + void glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels) + void glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_gl_spirv b/Windows/glew/auto/extensions/gl/GL_ARB_gl_spirv new file mode 100644 index 00000000..ca23eae6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_gl_spirv @@ -0,0 +1,7 @@ +GL_ARB_gl_spirv +http://www.opengl.org/registry/specs/ARB/gl_spirv.txt +GL_ARB_gl_spirv + + GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 + GL_SPIR_V_BINARY_ARB 0x9552 + void glSpecializeShaderARB (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader5 b/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader5 new file mode 100644 index 00000000..3a8cda0c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader5 @@ -0,0 +1,10 @@ +GL_ARB_gpu_shader5 +http://www.opengl.org/registry/specs/ARB/gpu_shader5.txt +GL_ARB_gpu_shader5 + + GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D + GL_MAX_VERTEX_STREAMS 0x8E71 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader_fp64 b/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader_fp64 new file mode 100644 index 00000000..9839d50d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader_fp64 @@ -0,0 +1,34 @@ +GL_ARB_gpu_shader_fp64 +http://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt +GL_ARB_gpu_shader_fp64 + + GL_DOUBLE_MAT2 0x8F46 + GL_DOUBLE_MAT3 0x8F47 + GL_DOUBLE_MAT4 0x8F48 + GL_DOUBLE_MAT2x3 0x8F49 + GL_DOUBLE_MAT2x4 0x8F4A + GL_DOUBLE_MAT3x2 0x8F4B + GL_DOUBLE_MAT3x4 0x8F4C + GL_DOUBLE_MAT4x2 0x8F4D + GL_DOUBLE_MAT4x3 0x8F4E + GL_DOUBLE_VEC2 0x8FFC + GL_DOUBLE_VEC3 0x8FFD + GL_DOUBLE_VEC4 0x8FFE + void glGetUniformdv (GLuint program, GLint location, GLdouble* params) + void glUniform1d (GLint location, GLdouble x) + void glUniform1dv (GLint location, GLsizei count, const GLdouble* value) + void glUniform2d (GLint location, GLdouble x, GLdouble y) + void glUniform2dv (GLint location, GLsizei count, const GLdouble* value) + void glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z) + void glUniform3dv (GLint location, GLsizei count, const GLdouble* value) + void glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glUniform4dv (GLint location, GLsizei count, const GLdouble* value) + void glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader_int64 b/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader_int64 new file mode 100644 index 00000000..6b84f8af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_gpu_shader_int64 @@ -0,0 +1,48 @@ +GL_ARB_gpu_shader_int64 +http://www.opengl.org/registry/specs/ARB/gpu_shader_int64.txt +GL_ARB_gpu_shader_int64 + + GL_INT64_ARB 0x140E + GL_UNSIGNED_INT64_ARB 0x140F + GL_INT64_VEC2_ARB 0x8FE9 + GL_INT64_VEC3_ARB 0x8FEA + GL_INT64_VEC4_ARB 0x8FEB + GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 + GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 + GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 + void glGetUniformi64vARB (GLuint program, GLint location, GLint64* params) + void glGetUniformui64vARB (GLuint program, GLint location, GLuint64* params) + void glGetnUniformi64vARB (GLuint program, GLint location, GLsizei bufSize, GLint64* params) + void glGetnUniformui64vARB (GLuint program, GLint location, GLsizei bufSize, GLuint64* params) + void glProgramUniform1i64ARB (GLuint program, GLint location, GLint64 x) + void glProgramUniform1i64vARB (GLuint program, GLint location, GLsizei count, const GLint64* value) + void glProgramUniform1ui64ARB (GLuint program, GLint location, GLuint64 x) + void glProgramUniform1ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64* value) + void glProgramUniform2i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y) + void glProgramUniform2i64vARB (GLuint program, GLint location, GLsizei count, const GLint64* value) + void glProgramUniform2ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y) + void glProgramUniform2ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64* value) + void glProgramUniform3i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z) + void glProgramUniform3i64vARB (GLuint program, GLint location, GLsizei count, const GLint64* value) + void glProgramUniform3ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z) + void glProgramUniform3ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64* value) + void glProgramUniform4i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w) + void glProgramUniform4i64vARB (GLuint program, GLint location, GLsizei count, const GLint64* value) + void glProgramUniform4ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w) + void glProgramUniform4ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64* value) + void glUniform1i64ARB (GLint location, GLint64 x) + void glUniform1i64vARB (GLint location, GLsizei count, const GLint64* value) + void glUniform1ui64ARB (GLint location, GLuint64 x) + void glUniform1ui64vARB (GLint location, GLsizei count, const GLuint64* value) + void glUniform2i64ARB (GLint location, GLint64 x, GLint64 y) + void glUniform2i64vARB (GLint location, GLsizei count, const GLint64* value) + void glUniform2ui64ARB (GLint location, GLuint64 x, GLuint64 y) + void glUniform2ui64vARB (GLint location, GLsizei count, const GLuint64* value) + void glUniform3i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z) + void glUniform3i64vARB (GLint location, GLsizei count, const GLint64* value) + void glUniform3ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z) + void glUniform3ui64vARB (GLint location, GLsizei count, const GLuint64* value) + void glUniform4i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w) + void glUniform4i64vARB (GLint location, GLsizei count, const GLint64* value) + void glUniform4ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w) + void glUniform4ui64vARB (GLint location, GLsizei count, const GLuint64* value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_half_float_pixel b/Windows/glew/auto/extensions/gl/GL_ARB_half_float_pixel new file mode 100644 index 00000000..ef54964c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_half_float_pixel @@ -0,0 +1,5 @@ +GL_ARB_half_float_pixel +http://www.opengl.org/registry/specs/ARB/half_float_pixel.txt +GL_ARB_half_float_pixel + + GL_HALF_FLOAT_ARB 0x140B diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_half_float_vertex b/Windows/glew/auto/extensions/gl/GL_ARB_half_float_vertex new file mode 100644 index 00000000..4f391ba3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_half_float_vertex @@ -0,0 +1,5 @@ +GL_ARB_half_float_vertex +http://www.opengl.org/registry/specs/ARB/half_float_vertex.txt +GL_ARB_half_float_vertex + + GL_HALF_FLOAT 0x140B diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_imaging b/Windows/glew/auto/extensions/gl/GL_ARB_imaging new file mode 100644 index 00000000..727adf05 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_imaging @@ -0,0 +1,113 @@ +GL_ARB_imaging + +GL_ARB_imaging + + GL_CONSTANT_COLOR 0x8001 + GL_ONE_MINUS_CONSTANT_COLOR 0x8002 + GL_CONSTANT_ALPHA 0x8003 + GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 + GL_BLEND_COLOR 0x8005 + GL_FUNC_ADD 0x8006 + GL_MIN 0x8007 + GL_MAX 0x8008 + GL_BLEND_EQUATION 0x8009 + GL_FUNC_SUBTRACT 0x800A + GL_FUNC_REVERSE_SUBTRACT 0x800B + GL_CONVOLUTION_1D 0x8010 + GL_CONVOLUTION_2D 0x8011 + GL_SEPARABLE_2D 0x8012 + GL_CONVOLUTION_BORDER_MODE 0x8013 + GL_CONVOLUTION_FILTER_SCALE 0x8014 + GL_CONVOLUTION_FILTER_BIAS 0x8015 + GL_REDUCE 0x8016 + GL_CONVOLUTION_FORMAT 0x8017 + GL_CONVOLUTION_WIDTH 0x8018 + GL_CONVOLUTION_HEIGHT 0x8019 + GL_MAX_CONVOLUTION_WIDTH 0x801A + GL_MAX_CONVOLUTION_HEIGHT 0x801B + GL_POST_CONVOLUTION_RED_SCALE 0x801C + GL_POST_CONVOLUTION_GREEN_SCALE 0x801D + GL_POST_CONVOLUTION_BLUE_SCALE 0x801E + GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F + GL_POST_CONVOLUTION_RED_BIAS 0x8020 + GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 + GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 + GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 + GL_HISTOGRAM 0x8024 + GL_PROXY_HISTOGRAM 0x8025 + GL_HISTOGRAM_WIDTH 0x8026 + GL_HISTOGRAM_FORMAT 0x8027 + GL_HISTOGRAM_RED_SIZE 0x8028 + GL_HISTOGRAM_GREEN_SIZE 0x8029 + GL_HISTOGRAM_BLUE_SIZE 0x802A + GL_HISTOGRAM_ALPHA_SIZE 0x802B + GL_HISTOGRAM_LUMINANCE_SIZE 0x802C + GL_HISTOGRAM_SINK 0x802D + GL_MINMAX 0x802E + GL_MINMAX_FORMAT 0x802F + GL_MINMAX_SINK 0x8030 + GL_TABLE_TOO_LARGE 0x8031 + GL_COLOR_MATRIX 0x80B1 + GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 + GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 + GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB + GL_COLOR_TABLE 0x80D0 + GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 + GL_PROXY_COLOR_TABLE 0x80D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 + GL_COLOR_TABLE_SCALE 0x80D6 + GL_COLOR_TABLE_BIAS 0x80D7 + GL_COLOR_TABLE_FORMAT 0x80D8 + GL_COLOR_TABLE_WIDTH 0x80D9 + GL_COLOR_TABLE_RED_SIZE 0x80DA + GL_COLOR_TABLE_GREEN_SIZE 0x80DB + GL_COLOR_TABLE_BLUE_SIZE 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF + GL_IGNORE_BORDER 0x8150 + GL_CONSTANT_BORDER 0x8151 + GL_WRAP_BORDER 0x8152 + GL_REPLICATE_BORDER 0x8153 + GL_CONVOLUTION_BORDER_COLOR 0x8154 + void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table) + void glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data) + void glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params) + void glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) + void glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glGetColorTable (GLenum target, GLenum format, GLenum type, void *table) + void glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params) + void glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) + void glResetHistogram (GLenum target) + void glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values) + void glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params) + void glMinmax (GLenum target, GLenum internalformat, GLboolean sink) + void glResetMinmax (GLenum target) + void glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params) + void glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image) + void glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image) + void glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params) + void glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glConvolutionParameteri (GLenum target, GLenum pname, GLint params) + void glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params) + void glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) + void glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image) + void glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params) + void glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column) + void glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span) + void glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_indirect_parameters b/Windows/glew/auto/extensions/gl/GL_ARB_indirect_parameters new file mode 100644 index 00000000..2a22ff95 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_indirect_parameters @@ -0,0 +1,8 @@ +GL_ARB_indirect_parameters +http://www.opengl.org/registry/specs/ARB/indirect_parameters.txt +GL_ARB_indirect_parameters + + GL_PARAMETER_BUFFER_ARB 0x80EE + GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + void glMultiDrawArraysIndirectCountARB (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) + void glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_instanced_arrays b/Windows/glew/auto/extensions/gl/GL_ARB_instanced_arrays new file mode 100644 index 00000000..1487d39a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_instanced_arrays @@ -0,0 +1,8 @@ +GL_ARB_instanced_arrays +http://www.opengl.org/registry/specs/ARB/instanced_arrays.txt +GL_ARB_instanced_arrays + + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + void glVertexAttribDivisorARB (GLuint index, GLuint divisor) + void glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_internalformat_query b/Windows/glew/auto/extensions/gl/GL_ARB_internalformat_query new file mode 100644 index 00000000..acf890f5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_internalformat_query @@ -0,0 +1,6 @@ +GL_ARB_internalformat_query +http://www.opengl.org/registry/specs/ARB/internalformat_query.txt +GL_ARB_internalformat_query + + GL_NUM_SAMPLE_COUNTS 0x9380 + void glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_internalformat_query2 b/Windows/glew/auto/extensions/gl/GL_ARB_internalformat_query2 new file mode 100644 index 00000000..7af5091e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_internalformat_query2 @@ -0,0 +1,104 @@ +GL_ARB_internalformat_query2 +http://www.opengl.org/registry/specs/ARB/internalformat_query2.txt +GL_ARB_internalformat_query2 + + GL_INTERNALFORMAT_SUPPORTED 0x826F + GL_INTERNALFORMAT_PREFERRED 0x8270 + GL_INTERNALFORMAT_RED_SIZE 0x8271 + GL_INTERNALFORMAT_GREEN_SIZE 0x8272 + GL_INTERNALFORMAT_BLUE_SIZE 0x8273 + GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 + GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 + GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 + GL_INTERNALFORMAT_SHARED_SIZE 0x8277 + GL_INTERNALFORMAT_RED_TYPE 0x8278 + GL_INTERNALFORMAT_GREEN_TYPE 0x8279 + GL_INTERNALFORMAT_BLUE_TYPE 0x827A + GL_INTERNALFORMAT_ALPHA_TYPE 0x827B + GL_INTERNALFORMAT_DEPTH_TYPE 0x827C + GL_INTERNALFORMAT_STENCIL_TYPE 0x827D + GL_MAX_WIDTH 0x827E + GL_MAX_HEIGHT 0x827F + GL_MAX_DEPTH 0x8280 + GL_MAX_LAYERS 0x8281 + GL_MAX_COMBINED_DIMENSIONS 0x8282 + GL_COLOR_COMPONENTS 0x8283 + GL_DEPTH_COMPONENTS 0x8284 + GL_STENCIL_COMPONENTS 0x8285 + GL_COLOR_RENDERABLE 0x8286 + GL_DEPTH_RENDERABLE 0x8287 + GL_STENCIL_RENDERABLE 0x8288 + GL_FRAMEBUFFER_RENDERABLE 0x8289 + GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A + GL_FRAMEBUFFER_BLEND 0x828B + GL_READ_PIXELS 0x828C + GL_READ_PIXELS_FORMAT 0x828D + GL_READ_PIXELS_TYPE 0x828E + GL_TEXTURE_IMAGE_FORMAT 0x828F + GL_TEXTURE_IMAGE_TYPE 0x8290 + GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 + GL_GET_TEXTURE_IMAGE_TYPE 0x8292 + GL_MIPMAP 0x8293 + GL_MANUAL_GENERATE_MIPMAP 0x8294 + GL_AUTO_GENERATE_MIPMAP 0x8295 + GL_COLOR_ENCODING 0x8296 + GL_SRGB_READ 0x8297 + GL_SRGB_WRITE 0x8298 + GL_SRGB_DECODE_ARB 0x8299 + GL_FILTER 0x829A + GL_VERTEX_TEXTURE 0x829B + GL_TESS_CONTROL_TEXTURE 0x829C + GL_TESS_EVALUATION_TEXTURE 0x829D + GL_GEOMETRY_TEXTURE 0x829E + GL_FRAGMENT_TEXTURE 0x829F + GL_COMPUTE_TEXTURE 0x82A0 + GL_TEXTURE_SHADOW 0x82A1 + GL_TEXTURE_GATHER 0x82A2 + GL_TEXTURE_GATHER_SHADOW 0x82A3 + GL_SHADER_IMAGE_LOAD 0x82A4 + GL_SHADER_IMAGE_STORE 0x82A5 + GL_SHADER_IMAGE_ATOMIC 0x82A6 + GL_IMAGE_TEXEL_SIZE 0x82A7 + GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 + GL_IMAGE_PIXEL_FORMAT 0x82A9 + GL_IMAGE_PIXEL_TYPE 0x82AA + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 + GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 + GL_CLEAR_BUFFER 0x82B4 + GL_TEXTURE_VIEW 0x82B5 + GL_VIEW_COMPATIBILITY_CLASS 0x82B6 + GL_FULL_SUPPORT 0x82B7 + GL_CAVEAT_SUPPORT 0x82B8 + GL_IMAGE_CLASS_4_X_32 0x82B9 + GL_IMAGE_CLASS_2_X_32 0x82BA + GL_IMAGE_CLASS_1_X_32 0x82BB + GL_IMAGE_CLASS_4_X_16 0x82BC + GL_IMAGE_CLASS_2_X_16 0x82BD + GL_IMAGE_CLASS_1_X_16 0x82BE + GL_IMAGE_CLASS_4_X_8 0x82BF + GL_IMAGE_CLASS_2_X_8 0x82C0 + GL_IMAGE_CLASS_1_X_8 0x82C1 + GL_IMAGE_CLASS_11_11_10 0x82C2 + GL_IMAGE_CLASS_10_10_10_2 0x82C3 + GL_VIEW_CLASS_128_BITS 0x82C4 + GL_VIEW_CLASS_96_BITS 0x82C5 + GL_VIEW_CLASS_64_BITS 0x82C6 + GL_VIEW_CLASS_48_BITS 0x82C7 + GL_VIEW_CLASS_32_BITS 0x82C8 + GL_VIEW_CLASS_24_BITS 0x82C9 + GL_VIEW_CLASS_16_BITS 0x82CA + GL_VIEW_CLASS_8_BITS 0x82CB + GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC + GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD + GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE + GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF + GL_VIEW_CLASS_RGTC1_RED 0x82D0 + GL_VIEW_CLASS_RGTC2_RG 0x82D1 + GL_VIEW_CLASS_BPTC_UNORM 0x82D2 + GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + void glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_invalidate_subdata b/Windows/glew/auto/extensions/gl/GL_ARB_invalidate_subdata new file mode 100644 index 00000000..153e952e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_invalidate_subdata @@ -0,0 +1,10 @@ +GL_ARB_invalidate_subdata +http://www.opengl.org/registry/specs/ARB/invalidate_subdata.txt +GL_ARB_invalidate_subdata + + void glInvalidateBufferData (GLuint buffer) + void glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length) + void glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum* attachments) + void glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height) + void glInvalidateTexImage (GLuint texture, GLint level) + void glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_map_buffer_alignment b/Windows/glew/auto/extensions/gl/GL_ARB_map_buffer_alignment new file mode 100644 index 00000000..77fbfbdb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_map_buffer_alignment @@ -0,0 +1,5 @@ +GL_ARB_map_buffer_alignment +http://www.opengl.org/registry/specs/ARB/map_buffer_alignment.txt +GL_ARB_map_buffer_alignment + + GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_map_buffer_range b/Windows/glew/auto/extensions/gl/GL_ARB_map_buffer_range new file mode 100644 index 00000000..06f4275d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_map_buffer_range @@ -0,0 +1,12 @@ +GL_ARB_map_buffer_range +http://www.opengl.org/registry/specs/ARB/map_buffer_range.txt +GL_ARB_map_buffer_range + + GL_MAP_READ_BIT 0x0001 + GL_MAP_WRITE_BIT 0x0002 + GL_MAP_INVALIDATE_RANGE_BIT 0x0004 + GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 + GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 + GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + void glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length) + void * glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_matrix_palette b/Windows/glew/auto/extensions/gl/GL_ARB_matrix_palette new file mode 100644 index 00000000..98b0d0b9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_matrix_palette @@ -0,0 +1,19 @@ +GL_ARB_matrix_palette +http://oss.sgi.com/projects/ogl-sample/registry/ARB/matrix_palette.txt +GL_ARB_matrix_palette + + GL_MATRIX_PALETTE_ARB 0x8840 + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 + GL_MAX_PALETTE_MATRICES_ARB 0x8842 + GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 + GL_MATRIX_INDEX_ARRAY_ARB 0x8844 + GL_CURRENT_MATRIX_INDEX_ARB 0x8845 + GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 + GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 + GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + void glCurrentPaletteMatrixARB (GLint index) + void glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, void *pointer) + void glMatrixIndexubvARB (GLint size, GLubyte *indices) + void glMatrixIndexusvARB (GLint size, GLushort *indices) + void glMatrixIndexuivARB (GLint size, GLuint *indices) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_multi_bind b/Windows/glew/auto/extensions/gl/GL_ARB_multi_bind new file mode 100644 index 00000000..411e6777 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_multi_bind @@ -0,0 +1,10 @@ +GL_ARB_multi_bind +http://www.opengl.org/registry/specs/ARB/multi_bind.txt +GL_ARB_multi_bind + + void glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint* buffers) + void glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes) + void glBindImageTextures (GLuint first, GLsizei count, const GLuint* textures) + void glBindSamplers (GLuint first, GLsizei count, const GLuint* samplers) + void glBindTextures (GLuint first, GLsizei count, const GLuint* textures) + void glBindVertexBuffers (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_multi_draw_indirect b/Windows/glew/auto/extensions/gl/GL_ARB_multi_draw_indirect new file mode 100644 index 00000000..ebf70b78 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_multi_draw_indirect @@ -0,0 +1,6 @@ +GL_ARB_multi_draw_indirect +http://www.opengl.org/registry/specs/ARB/multi_draw_indirect.txt +GL_ARB_multi_draw_indirect + + void glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride) + void glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_multisample b/Windows/glew/auto/extensions/gl/GL_ARB_multisample new file mode 100644 index 00000000..b39817b9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_multisample @@ -0,0 +1,14 @@ +GL_ARB_multisample +http://www.opengl.org/registry/specs/ARB/multisample.txt +GL_ARB_multisample + + GL_MULTISAMPLE_ARB 0x809D + GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E + GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F + GL_SAMPLE_COVERAGE_ARB 0x80A0 + GL_SAMPLE_BUFFERS_ARB 0x80A8 + GL_SAMPLES_ARB 0x80A9 + GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA + GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB + GL_MULTISAMPLE_BIT_ARB 0x20000000 + void glSampleCoverageARB (GLclampf value, GLboolean invert) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_multitexture b/Windows/glew/auto/extensions/gl/GL_ARB_multitexture new file mode 100644 index 00000000..46a95463 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_multitexture @@ -0,0 +1,73 @@ +GL_ARB_multitexture +http://oss.sgi.com/projects/ogl-sample/registry/ARB/multitexture.txt +GL_ARB_multitexture + + GL_TEXTURE0_ARB 0x84C0 + GL_TEXTURE1_ARB 0x84C1 + GL_TEXTURE2_ARB 0x84C2 + GL_TEXTURE3_ARB 0x84C3 + GL_TEXTURE4_ARB 0x84C4 + GL_TEXTURE5_ARB 0x84C5 + GL_TEXTURE6_ARB 0x84C6 + GL_TEXTURE7_ARB 0x84C7 + GL_TEXTURE8_ARB 0x84C8 + GL_TEXTURE9_ARB 0x84C9 + GL_TEXTURE10_ARB 0x84CA + GL_TEXTURE11_ARB 0x84CB + GL_TEXTURE12_ARB 0x84CC + GL_TEXTURE13_ARB 0x84CD + GL_TEXTURE14_ARB 0x84CE + GL_TEXTURE15_ARB 0x84CF + GL_TEXTURE16_ARB 0x84D0 + GL_TEXTURE17_ARB 0x84D1 + GL_TEXTURE18_ARB 0x84D2 + GL_TEXTURE19_ARB 0x84D3 + GL_TEXTURE20_ARB 0x84D4 + GL_TEXTURE21_ARB 0x84D5 + GL_TEXTURE22_ARB 0x84D6 + GL_TEXTURE23_ARB 0x84D7 + GL_TEXTURE24_ARB 0x84D8 + GL_TEXTURE25_ARB 0x84D9 + GL_TEXTURE26_ARB 0x84DA + GL_TEXTURE27_ARB 0x84DB + GL_TEXTURE28_ARB 0x84DC + GL_TEXTURE29_ARB 0x84DD + GL_TEXTURE30_ARB 0x84DE + GL_TEXTURE31_ARB 0x84DF + GL_ACTIVE_TEXTURE_ARB 0x84E0 + GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 + GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + void glActiveTextureARB (GLenum texture) + void glClientActiveTextureARB (GLenum texture) + void glMultiTexCoord1dARB (GLenum target, GLdouble s) + void glMultiTexCoord1dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord1fARB (GLenum target, GLfloat s) + void glMultiTexCoord1fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord1iARB (GLenum target, GLint s) + void glMultiTexCoord1ivARB (GLenum target, const GLint *v) + void glMultiTexCoord1sARB (GLenum target, GLshort s) + void glMultiTexCoord1svARB (GLenum target, const GLshort *v) + void glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t) + void glMultiTexCoord2dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t) + void glMultiTexCoord2fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord2iARB (GLenum target, GLint s, GLint t) + void glMultiTexCoord2ivARB (GLenum target, const GLint *v) + void glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t) + void glMultiTexCoord2svARB (GLenum target, const GLshort *v) + void glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r) + void glMultiTexCoord3dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r) + void glMultiTexCoord3fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r) + void glMultiTexCoord3ivARB (GLenum target, const GLint *v) + void glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r) + void glMultiTexCoord3svARB (GLenum target, const GLshort *v) + void glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) + void glMultiTexCoord4dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) + void glMultiTexCoord4fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q) + void glMultiTexCoord4ivARB (GLenum target, const GLint *v) + void glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) + void glMultiTexCoord4svARB (GLenum target, const GLshort *v) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_occlusion_query b/Windows/glew/auto/extensions/gl/GL_ARB_occlusion_query new file mode 100644 index 00000000..b4579964 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_occlusion_query @@ -0,0 +1,17 @@ +GL_ARB_occlusion_query +http://www.opengl.org/registry/specs/ARB/occlusion_query.txt +GL_ARB_occlusion_query + + GL_QUERY_COUNTER_BITS_ARB 0x8864 + GL_CURRENT_QUERY_ARB 0x8865 + GL_QUERY_RESULT_ARB 0x8866 + GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 + GL_SAMPLES_PASSED_ARB 0x8914 + void glBeginQueryARB (GLenum target, GLuint id) + void glDeleteQueriesARB (GLsizei n, const GLuint* ids) + void glEndQueryARB (GLenum target) + void glGenQueriesARB (GLsizei n, GLuint* ids) + void glGetQueryObjectivARB (GLuint id, GLenum pname, GLint* params) + void glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint* params) + void glGetQueryivARB (GLenum target, GLenum pname, GLint* params) + GLboolean glIsQueryARB (GLuint id) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_occlusion_query2 b/Windows/glew/auto/extensions/gl/GL_ARB_occlusion_query2 new file mode 100644 index 00000000..5979e82c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_occlusion_query2 @@ -0,0 +1,5 @@ +GL_ARB_occlusion_query2 +http://www.opengl.org/registry/specs/ARB/occlusion_query2.txt +GL_ARB_occlusion_query2 + + GL_ANY_SAMPLES_PASSED 0x8C2F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_parallel_shader_compile b/Windows/glew/auto/extensions/gl/GL_ARB_parallel_shader_compile new file mode 100644 index 00000000..243222e0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_parallel_shader_compile @@ -0,0 +1,7 @@ +GL_ARB_parallel_shader_compile +http://www.opengl.org/registry/specs/ARB/parallel_shader_compile.txt +GL_ARB_parallel_shader_compile + + GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 + GL_COMPLETION_STATUS_ARB 0x91B1 + void glMaxShaderCompilerThreadsARB (GLuint count) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_pipeline_statistics_query b/Windows/glew/auto/extensions/gl/GL_ARB_pipeline_statistics_query new file mode 100644 index 00000000..e9299e47 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_pipeline_statistics_query @@ -0,0 +1,15 @@ +GL_ARB_pipeline_statistics_query +http://www.opengl.org/registry/specs/ARB/pipeline_statistics_query.txt +GL_ARB_pipeline_statistics_query + + GL_VERTICES_SUBMITTED_ARB 0x82EE + GL_PRIMITIVES_SUBMITTED_ARB 0x82EF + GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 + GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 + GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 + GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 + GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 + GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 + GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 + GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 + GL_GEOMETRY_SHADER_INVOCATIONS 0x887F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_pixel_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_pixel_buffer_object new file mode 100644 index 00000000..8673ddc1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_pixel_buffer_object @@ -0,0 +1,8 @@ +GL_ARB_pixel_buffer_object +http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt +GL_ARB_pixel_buffer_object + + GL_PIXEL_PACK_BUFFER_ARB 0x88EB + GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_point_parameters b/Windows/glew/auto/extensions/gl/GL_ARB_point_parameters new file mode 100644 index 00000000..e933b4ad --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_point_parameters @@ -0,0 +1,10 @@ +GL_ARB_point_parameters +http://www.opengl.org/registry/specs/ARB/point_parameters.txt +GL_ARB_point_parameters + + GL_POINT_SIZE_MIN_ARB 0x8126 + GL_POINT_SIZE_MAX_ARB 0x8127 + GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 + GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + void glPointParameterfARB (GLenum pname, GLfloat param) + void glPointParameterfvARB (GLenum pname, const GLfloat* params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_point_sprite b/Windows/glew/auto/extensions/gl/GL_ARB_point_sprite new file mode 100644 index 00000000..795b378f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_point_sprite @@ -0,0 +1,6 @@ +GL_ARB_point_sprite +http://www.opengl.org/registry/specs/ARB/point_sprite.txt +GL_ARB_point_sprite + + GL_POINT_SPRITE_ARB 0x8861 + GL_COORD_REPLACE_ARB 0x8862 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_polygon_offset_clamp b/Windows/glew/auto/extensions/gl/GL_ARB_polygon_offset_clamp new file mode 100644 index 00000000..ba27b712 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_polygon_offset_clamp @@ -0,0 +1,6 @@ +GL_ARB_polygon_offset_clamp +http://www.opengl.org/registry/specs/ARB/polygon_offset_clamp.txt +GL_ARB_polygon_offset_clamp + + GL_POLYGON_OFFSET_CLAMP 0x8E1B + void glPolygonOffsetClamp (GLfloat factor, GLfloat units, GLfloat clamp) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_post_depth_coverage b/Windows/glew/auto/extensions/gl/GL_ARB_post_depth_coverage new file mode 100644 index 00000000..a46759c6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_post_depth_coverage @@ -0,0 +1,4 @@ +GL_ARB_post_depth_coverage +http://www.opengl.org/registry/specs/ARB/post_depth_coverage.txt +GL_ARB_post_depth_coverage + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_program_interface_query b/Windows/glew/auto/extensions/gl/GL_ARB_program_interface_query new file mode 100644 index 00000000..96178180 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_program_interface_query @@ -0,0 +1,57 @@ +GL_ARB_program_interface_query +http://www.opengl.org/registry/specs/ARB/program_interface_query.txt +GL_ARB_program_interface_query + + GL_UNIFORM 0x92E1 + GL_UNIFORM_BLOCK 0x92E2 + GL_PROGRAM_INPUT 0x92E3 + GL_PROGRAM_OUTPUT 0x92E4 + GL_BUFFER_VARIABLE 0x92E5 + GL_SHADER_STORAGE_BLOCK 0x92E6 + GL_IS_PER_PATCH 0x92E7 + GL_VERTEX_SUBROUTINE 0x92E8 + GL_TESS_CONTROL_SUBROUTINE 0x92E9 + GL_TESS_EVALUATION_SUBROUTINE 0x92EA + GL_GEOMETRY_SUBROUTINE 0x92EB + GL_FRAGMENT_SUBROUTINE 0x92EC + GL_COMPUTE_SUBROUTINE 0x92ED + GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE + GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF + GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 + GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 + GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 + GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 + GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 + GL_ACTIVE_RESOURCES 0x92F5 + GL_MAX_NAME_LENGTH 0x92F6 + GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 + GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 + GL_NAME_LENGTH 0x92F9 + GL_TYPE 0x92FA + GL_ARRAY_SIZE 0x92FB + GL_OFFSET 0x92FC + GL_BLOCK_INDEX 0x92FD + GL_ARRAY_STRIDE 0x92FE + GL_MATRIX_STRIDE 0x92FF + GL_IS_ROW_MAJOR 0x9300 + GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 + GL_BUFFER_BINDING 0x9302 + GL_BUFFER_DATA_SIZE 0x9303 + GL_NUM_ACTIVE_VARIABLES 0x9304 + GL_ACTIVE_VARIABLES 0x9305 + GL_REFERENCED_BY_VERTEX_SHADER 0x9306 + GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 + GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 + GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 + GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A + GL_REFERENCED_BY_COMPUTE_SHADER 0x930B + GL_TOP_LEVEL_ARRAY_SIZE 0x930C + GL_TOP_LEVEL_ARRAY_STRIDE 0x930D + GL_LOCATION 0x930E + GL_LOCATION_INDEX 0x930F + void glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint* params) + GLuint glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar* name) + GLint glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar* name) + GLint glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar* name) + void glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name) + void glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_provoking_vertex b/Windows/glew/auto/extensions/gl/GL_ARB_provoking_vertex new file mode 100644 index 00000000..82edd793 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_provoking_vertex @@ -0,0 +1,9 @@ +GL_ARB_provoking_vertex +http://www.opengl.org/registry/specs/ARB/provoking_vertex.txt +GL_ARB_provoking_vertex + + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C + GL_FIRST_VERTEX_CONVENTION 0x8E4D + GL_LAST_VERTEX_CONVENTION 0x8E4E + GL_PROVOKING_VERTEX 0x8E4F + void glProvokingVertex (GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_query_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_query_buffer_object new file mode 100644 index 00000000..27bc5523 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_query_buffer_object @@ -0,0 +1,8 @@ +GL_ARB_query_buffer_object +http://www.opengl.org/registry/specs/ARB/query_buffer_object.txt +GL_ARB_query_buffer_object + + GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 + GL_QUERY_BUFFER 0x9192 + GL_QUERY_BUFFER_BINDING 0x9193 + GL_QUERY_RESULT_NO_WAIT 0x9194 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_robust_buffer_access_behavior b/Windows/glew/auto/extensions/gl/GL_ARB_robust_buffer_access_behavior new file mode 100644 index 00000000..357f4304 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_robust_buffer_access_behavior @@ -0,0 +1,4 @@ +GL_ARB_robust_buffer_access_behavior +http://www.opengl.org/registry/specs/ARB/robust_buffer_access_behavior.txt +GL_ARB_robust_buffer_access_behavior + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_robustness b/Windows/glew/auto/extensions/gl/GL_ARB_robustness new file mode 100644 index 00000000..82d48d8d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_robustness @@ -0,0 +1,31 @@ +GL_ARB_robustness +http://www.opengl.org/registry/specs/ARB/robustness.txt +GL_ARB_robustness + + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 + GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + GL_GUILTY_CONTEXT_RESET_ARB 0x8253 + GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 + GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 + GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + GL_NO_RESET_NOTIFICATION_ARB 0x8261 + GLenum glGetGraphicsResetStatusARB (void) + void glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table) + void glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void* img) + void glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image) + void glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v) + void glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v) + void glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint* v) + void glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat* values) + void glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint* values) + void glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort* values) + void glGetnPolygonStippleARB (GLsizei bufSize, GLubyte* pattern) + void glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span) + void glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img) + void glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble* params) + void glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat* params) + void glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint* params) + void glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint* params) + void glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_robustness_application_isolation b/Windows/glew/auto/extensions/gl/GL_ARB_robustness_application_isolation new file mode 100644 index 00000000..b7e3e68a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_robustness_application_isolation @@ -0,0 +1,4 @@ +GL_ARB_robustness_application_isolation +http://www.opengl.org/registry/specs/ARB/robustness_isolation.txt +GL_ARB_robustness_application_isolation + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_robustness_share_group_isolation b/Windows/glew/auto/extensions/gl/GL_ARB_robustness_share_group_isolation new file mode 100644 index 00000000..132e21e6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_robustness_share_group_isolation @@ -0,0 +1,4 @@ +GL_ARB_robustness_share_group_isolation +http://www.opengl.org/registry/specs/ARB/robustness_isolation.txt +GL_ARB_robustness_share_group_isolation + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sample_locations b/Windows/glew/auto/extensions/gl/GL_ARB_sample_locations new file mode 100644 index 00000000..08a588ff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sample_locations @@ -0,0 +1,14 @@ +GL_ARB_sample_locations +http://www.opengl.org/registry/specs/ARB/sample_locations.txt +GL_ARB_sample_locations + + GL_SAMPLE_LOCATION_ARB 0x8E50 + GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D + GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E + GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F + GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 + GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 + GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 + GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 + void glFramebufferSampleLocationsfvARB (GLenum target, GLuint start, GLsizei count, const GLfloat* v) + void glNamedFramebufferSampleLocationsfvARB (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sample_shading b/Windows/glew/auto/extensions/gl/GL_ARB_sample_shading new file mode 100644 index 00000000..bef825f2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sample_shading @@ -0,0 +1,7 @@ +GL_ARB_sample_shading +http://www.opengl.org/registry/specs/ARB/sample_shading.txt +GL_ARB_sample_shading + + GL_SAMPLE_SHADING_ARB 0x8C36 + GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + void glMinSampleShadingARB (GLclampf value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sampler_objects b/Windows/glew/auto/extensions/gl/GL_ARB_sampler_objects new file mode 100644 index 00000000..585fc7cb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sampler_objects @@ -0,0 +1,19 @@ +GL_ARB_sampler_objects +http://www.opengl.org/registry/specs/ARB/sampler_objects.txt +GL_ARB_sampler_objects + + GL_SAMPLER_BINDING 0x8919 + void glBindSampler (GLuint unit, GLuint sampler) + void glDeleteSamplers (GLsizei count, const GLuint * samplers) + void glGenSamplers (GLsizei count, GLuint* samplers) + void glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint* params) + void glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint* params) + void glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat* params) + void glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint* params) + GLboolean glIsSampler (GLuint sampler) + void glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint* params) + void glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint* params) + void glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param) + void glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat* params) + void glSamplerParameteri (GLuint sampler, GLenum pname, GLint param) + void glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_seamless_cube_map b/Windows/glew/auto/extensions/gl/GL_ARB_seamless_cube_map new file mode 100644 index 00000000..abfe25eb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_seamless_cube_map @@ -0,0 +1,5 @@ +GL_ARB_seamless_cube_map +http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt +GL_ARB_seamless_cube_map + + GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_seamless_cubemap_per_texture b/Windows/glew/auto/extensions/gl/GL_ARB_seamless_cubemap_per_texture new file mode 100644 index 00000000..147ac49e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_seamless_cubemap_per_texture @@ -0,0 +1,5 @@ +GL_ARB_seamless_cubemap_per_texture +http://www.opengl.org/registry/specs/ARB/seamless_cubemap_per_texture.txt +GL_ARB_seamless_cubemap_per_texture + + GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_separate_shader_objects b/Windows/glew/auto/extensions/gl/GL_ARB_separate_shader_objects new file mode 100644 index 00000000..3d3d8696 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_separate_shader_objects @@ -0,0 +1,73 @@ +GL_ARB_separate_shader_objects +http://www.opengl.org/registry/specs/ARB/separate_shader_objects.txt +GL_ARB_separate_shader_objects + + GL_VERTEX_SHADER_BIT 0x00000001 + GL_FRAGMENT_SHADER_BIT 0x00000002 + GL_GEOMETRY_SHADER_BIT 0x00000004 + GL_TESS_CONTROL_SHADER_BIT 0x00000008 + GL_TESS_EVALUATION_SHADER_BIT 0x00000010 + GL_PROGRAM_SEPARABLE 0x8258 + GL_ACTIVE_PROGRAM 0x8259 + GL_PROGRAM_PIPELINE_BINDING 0x825A + GL_ALL_SHADER_BITS 0xFFFFFFFF + void glActiveShaderProgram (GLuint pipeline, GLuint program) + void glBindProgramPipeline (GLuint pipeline) + GLuint glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar * const * strings) + void glDeleteProgramPipelines (GLsizei n, const GLuint* pipelines) + void glGenProgramPipelines (GLsizei n, GLuint* pipelines) + void glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog) + void glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint* params) + GLboolean glIsProgramPipeline (GLuint pipeline) + void glProgramUniform1d (GLuint program, GLint location, GLdouble x) + void glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform1f (GLuint program, GLint location, GLfloat x) + void glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform1i (GLuint program, GLint location, GLint x) + void glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform1ui (GLuint program, GLint location, GLuint x) + void glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform2d (GLuint program, GLint location, GLdouble x, GLdouble y) + void glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform2f (GLuint program, GLint location, GLfloat x, GLfloat y) + void glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform2i (GLuint program, GLint location, GLint x, GLint y) + void glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform2ui (GLuint program, GLint location, GLuint x, GLuint y) + void glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform3d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) + void glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform3f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) + void glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform3i (GLuint program, GLint location, GLint x, GLint y, GLint z) + void glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform3ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z) + void glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform4d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform4f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform4i (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) + void glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform4ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program) + void glValidateProgramPipeline (GLuint pipeline) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_atomic_counter_ops b/Windows/glew/auto/extensions/gl/GL_ARB_shader_atomic_counter_ops new file mode 100644 index 00000000..300b31b1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_atomic_counter_ops @@ -0,0 +1,4 @@ +GL_ARB_shader_atomic_counter_ops +http://www.opengl.org/registry/specs/ARB/shader_atomic_counter_ops.txt +GL_ARB_shader_atomic_counter_ops + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_atomic_counters b/Windows/glew/auto/extensions/gl/GL_ARB_shader_atomic_counters new file mode 100644 index 00000000..e09de066 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_atomic_counters @@ -0,0 +1,34 @@ +GL_ARB_shader_atomic_counters +http://www.opengl.org/registry/specs/ARB/shader_atomic_counters.txt +GL_ARB_shader_atomic_counters + + GL_ATOMIC_COUNTER_BUFFER 0x92C0 + GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 + GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 + GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 + GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB + GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 + GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 + GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 + GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 + GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 + GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 + GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA + GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + void glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_ballot b/Windows/glew/auto/extensions/gl/GL_ARB_shader_ballot new file mode 100644 index 00000000..cd612c08 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_ballot @@ -0,0 +1,4 @@ +GL_ARB_shader_ballot +http://www.opengl.org/registry/specs/ARB/shader_ballot.txt +GL_ARB_shader_ballot + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_bit_encoding b/Windows/glew/auto/extensions/gl/GL_ARB_shader_bit_encoding new file mode 100644 index 00000000..06911f17 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_bit_encoding @@ -0,0 +1,4 @@ +GL_ARB_shader_bit_encoding +http://www.opengl.org/registry/specs/ARB/shader_bit_encoding.txt +GL_ARB_shader_bit_encoding + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_clock b/Windows/glew/auto/extensions/gl/GL_ARB_shader_clock new file mode 100644 index 00000000..28227538 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_clock @@ -0,0 +1,4 @@ +GL_ARB_shader_clock +http://www.opengl.org/registry/specs/ARB/shader_clock.txt +GL_ARB_shader_clock + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_draw_parameters b/Windows/glew/auto/extensions/gl/GL_ARB_shader_draw_parameters new file mode 100644 index 00000000..4a3a8214 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_draw_parameters @@ -0,0 +1,4 @@ +GL_ARB_shader_draw_parameters +http://www.opengl.org/registry/specs/ARB/shader_draw_parameters.txt +GL_ARB_shader_draw_parameters + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_group_vote b/Windows/glew/auto/extensions/gl/GL_ARB_shader_group_vote new file mode 100644 index 00000000..81adfb9c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_group_vote @@ -0,0 +1,4 @@ +GL_ARB_shader_group_vote +http://www.opengl.org/registry/specs/ARB/shader_group_vote.txt +GL_ARB_shader_group_vote + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_image_load_store b/Windows/glew/auto/extensions/gl/GL_ARB_shader_image_load_store new file mode 100644 index 00000000..8751796f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_image_load_store @@ -0,0 +1,70 @@ +GL_ARB_shader_image_load_store +http://www.opengl.org/registry/specs/ARB/shader_image_load_store.txt +GL_ARB_shader_image_load_store + + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 + GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 + GL_UNIFORM_BARRIER_BIT 0x00000004 + GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 + GL_COMMAND_BARRIER_BIT 0x00000040 + GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 + GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 + GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 + GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 + GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 + GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 + GL_MAX_IMAGE_UNITS 0x8F38 + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 + GL_IMAGE_BINDING_NAME 0x8F3A + GL_IMAGE_BINDING_LEVEL 0x8F3B + GL_IMAGE_BINDING_LAYERED 0x8F3C + GL_IMAGE_BINDING_LAYER 0x8F3D + GL_IMAGE_BINDING_ACCESS 0x8F3E + GL_IMAGE_1D 0x904C + GL_IMAGE_2D 0x904D + GL_IMAGE_3D 0x904E + GL_IMAGE_2D_RECT 0x904F + GL_IMAGE_CUBE 0x9050 + GL_IMAGE_BUFFER 0x9051 + GL_IMAGE_1D_ARRAY 0x9052 + GL_IMAGE_2D_ARRAY 0x9053 + GL_IMAGE_CUBE_MAP_ARRAY 0x9054 + GL_IMAGE_2D_MULTISAMPLE 0x9055 + GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 + GL_INT_IMAGE_1D 0x9057 + GL_INT_IMAGE_2D 0x9058 + GL_INT_IMAGE_3D 0x9059 + GL_INT_IMAGE_2D_RECT 0x905A + GL_INT_IMAGE_CUBE 0x905B + GL_INT_IMAGE_BUFFER 0x905C + GL_INT_IMAGE_1D_ARRAY 0x905D + GL_INT_IMAGE_2D_ARRAY 0x905E + GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F + GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 + GL_UNSIGNED_INT_IMAGE_1D 0x9062 + GL_UNSIGNED_INT_IMAGE_2D 0x9063 + GL_UNSIGNED_INT_IMAGE_3D 0x9064 + GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 + GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 + GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 + GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 + GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C + GL_MAX_IMAGE_SAMPLES 0x906D + GL_IMAGE_BINDING_FORMAT 0x906E + GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 + GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 + GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 + GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC + GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD + GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE + GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF + GL_ALL_BARRIER_BITS 0xFFFFFFFF + void glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) + void glMemoryBarrier (GLbitfield barriers) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_image_size b/Windows/glew/auto/extensions/gl/GL_ARB_shader_image_size new file mode 100644 index 00000000..dfd1cb2d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_image_size @@ -0,0 +1,4 @@ +GL_ARB_shader_image_size +http://www.opengl.org/registry/specs/ARB/shader_image_size.txt +GL_ARB_shader_image_size + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_objects b/Windows/glew/auto/extensions/gl/GL_ARB_shader_objects new file mode 100644 index 00000000..95a7dfaa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_objects @@ -0,0 +1,79 @@ +GL_ARB_shader_objects +http://www.opengl.org/registry/specs/ARB/shader_objects.txt +GL_ARB_shader_objects + + GL_PROGRAM_OBJECT_ARB 0x8B40 + GL_SHADER_OBJECT_ARB 0x8B48 + GL_OBJECT_TYPE_ARB 0x8B4E + GL_OBJECT_SUBTYPE_ARB 0x8B4F + GL_FLOAT_VEC2_ARB 0x8B50 + GL_FLOAT_VEC3_ARB 0x8B51 + GL_FLOAT_VEC4_ARB 0x8B52 + GL_INT_VEC2_ARB 0x8B53 + GL_INT_VEC3_ARB 0x8B54 + GL_INT_VEC4_ARB 0x8B55 + GL_BOOL_ARB 0x8B56 + GL_BOOL_VEC2_ARB 0x8B57 + GL_BOOL_VEC3_ARB 0x8B58 + GL_BOOL_VEC4_ARB 0x8B59 + GL_FLOAT_MAT2_ARB 0x8B5A + GL_FLOAT_MAT3_ARB 0x8B5B + GL_FLOAT_MAT4_ARB 0x8B5C + GL_SAMPLER_1D_ARB 0x8B5D + GL_SAMPLER_2D_ARB 0x8B5E + GL_SAMPLER_3D_ARB 0x8B5F + GL_SAMPLER_CUBE_ARB 0x8B60 + GL_SAMPLER_1D_SHADOW_ARB 0x8B61 + GL_SAMPLER_2D_SHADOW_ARB 0x8B62 + GL_SAMPLER_2D_RECT_ARB 0x8B63 + GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + GL_OBJECT_DELETE_STATUS_ARB 0x8B80 + GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 + GL_OBJECT_LINK_STATUS_ARB 0x8B82 + GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 + GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 + GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 + GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 + GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 + GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + void glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj) + void glCompileShaderARB (GLhandleARB shaderObj) + GLhandleARB glCreateProgramObjectARB (void) + GLhandleARB glCreateShaderObjectARB (GLenum shaderType) + void glDeleteObjectARB (GLhandleARB obj) + void glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj) + void glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name) + void glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj) + GLhandleARB glGetHandleARB (GLenum pname) + void glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog) + void glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat* params) + void glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint* params) + void glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source) + GLint glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB* name) + void glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat* params) + void glGetUniformivARB (GLhandleARB programObj, GLint location, GLint* params) + void glLinkProgramARB (GLhandleARB programObj) + void glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length) + void glUniform1fARB (GLint location, GLfloat v0) + void glUniform1fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform1iARB (GLint location, GLint v0) + void glUniform1ivARB (GLint location, GLsizei count, const GLint* value) + void glUniform2fARB (GLint location, GLfloat v0, GLfloat v1) + void glUniform2fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform2iARB (GLint location, GLint v0, GLint v1) + void glUniform2ivARB (GLint location, GLsizei count, const GLint* value) + void glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + void glUniform3fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2) + void glUniform3ivARB (GLint location, GLsizei count, const GLint* value) + void glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + void glUniform4fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + void glUniform4ivARB (GLint location, GLsizei count, const GLint* value) + void glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUseProgramObjectARB (GLhandleARB programObj) + void glValidateProgramARB (GLhandleARB programObj) + typedef char GLcharARB + typedef unsigned int GLhandleARB diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_precision b/Windows/glew/auto/extensions/gl/GL_ARB_shader_precision new file mode 100644 index 00000000..60c74672 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_precision @@ -0,0 +1,4 @@ +GL_ARB_shader_precision +http://www.opengl.org/registry/specs/ARB/shader_precision.txt +GL_ARB_shader_precision + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_stencil_export b/Windows/glew/auto/extensions/gl/GL_ARB_shader_stencil_export new file mode 100644 index 00000000..8625619e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_stencil_export @@ -0,0 +1,4 @@ +GL_ARB_shader_stencil_export +http://www.opengl.org/registry/specs/ARB/shader_stencil_export.txt +GL_ARB_shader_stencil_export + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_storage_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_shader_storage_buffer_object new file mode 100644 index 00000000..b97e0495 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_storage_buffer_object @@ -0,0 +1,21 @@ +GL_ARB_shader_storage_buffer_object +http://www.opengl.org/registry/specs/ARB/shader_storage_buffer_object.txt +GL_ARB_shader_storage_buffer_object + + GL_SHADER_STORAGE_BARRIER_BIT 0x2000 + GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 + GL_SHADER_STORAGE_BUFFER 0x90D2 + GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 + GL_SHADER_STORAGE_BUFFER_START 0x90D4 + GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 + GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 + GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 + GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 + GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA + GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB + GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC + GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD + GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE + GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + void glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_subroutine b/Windows/glew/auto/extensions/gl/GL_ARB_shader_subroutine new file mode 100644 index 00000000..401d27a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_subroutine @@ -0,0 +1,21 @@ +GL_ARB_shader_subroutine +http://www.opengl.org/registry/specs/ARB/shader_subroutine.txt +GL_ARB_shader_subroutine + + GL_ACTIVE_SUBROUTINES 0x8DE5 + GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 + GL_MAX_SUBROUTINES 0x8DE7 + GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 + GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 + GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 + GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 + GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A + GL_COMPATIBLE_SUBROUTINES 0x8E4B + void glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name) + void glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name) + void glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values) + void glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint* values) + GLuint glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar* name) + GLint glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar* name) + void glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint* params) + void glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint* indices) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_texture_image_samples b/Windows/glew/auto/extensions/gl/GL_ARB_shader_texture_image_samples new file mode 100644 index 00000000..3d489ae5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_texture_image_samples @@ -0,0 +1,4 @@ +GL_ARB_shader_texture_image_samples +http://www.opengl.org/registry/specs/ARB/shader_texture_image_samples.txt +GL_ARB_shader_texture_image_samples + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_texture_lod b/Windows/glew/auto/extensions/gl/GL_ARB_shader_texture_lod new file mode 100644 index 00000000..e214a3a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_texture_lod @@ -0,0 +1,4 @@ +GL_ARB_shader_texture_lod +http://www.opengl.org/registry/specs/ARB/shader_texture_lod.txt +GL_ARB_shader_texture_lod + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shader_viewport_layer_array b/Windows/glew/auto/extensions/gl/GL_ARB_shader_viewport_layer_array new file mode 100644 index 00000000..9fcc727b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shader_viewport_layer_array @@ -0,0 +1,4 @@ +GL_ARB_shader_viewport_layer_array +http://www.opengl.org/registry/specs/ARB/shader_viewport_layer_array.txt +GL_ARB_shader_viewport_layer_array + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_100 b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_100 new file mode 100644 index 00000000..17f81a2c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_100 @@ -0,0 +1,5 @@ +GL_ARB_shading_language_100 +http://www.opengl.org/registry/specs/ARB/shading_language_100.txt +GL_ARB_shading_language_100 + + GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_420pack b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_420pack new file mode 100644 index 00000000..150de7af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_420pack @@ -0,0 +1,4 @@ +GL_ARB_shading_language_420pack +http://www.opengl.org/registry/specs/ARB/shading_language_420pack.txt +GL_ARB_shading_language_420pack + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_include b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_include new file mode 100644 index 00000000..9bd96449 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_include @@ -0,0 +1,13 @@ +GL_ARB_shading_language_include +http://www.opengl.org/registry/specs/ARB/shading_language_include.txt +GL_ARB_shading_language_include + + GL_SHADER_INCLUDE_ARB 0x8DAE + GL_NAMED_STRING_LENGTH_ARB 0x8DE9 + GL_NAMED_STRING_TYPE_ARB 0x8DEA + void glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length) + void glDeleteNamedStringARB (GLint namelen, const GLchar* name) + void glGetNamedStringARB (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string) + void glGetNamedStringivARB (GLint namelen, const GLchar* name, GLenum pname, GLint *params) + GLboolean glIsNamedStringARB (GLint namelen, const GLchar* name) + void glNamedStringARB (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_packing b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_packing new file mode 100644 index 00000000..fc88b05b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shading_language_packing @@ -0,0 +1,4 @@ +GL_ARB_shading_language_packing +http://www.opengl.org/registry/specs/ARB/shading_language_packing.txt +GL_ARB_shading_language_packing + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shadow b/Windows/glew/auto/extensions/gl/GL_ARB_shadow new file mode 100644 index 00000000..ef6f937e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shadow @@ -0,0 +1,7 @@ +GL_ARB_shadow +http://www.opengl.org/registry/specs/ARB/shadow.txt +GL_ARB_shadow + + GL_TEXTURE_COMPARE_MODE_ARB 0x884C + GL_TEXTURE_COMPARE_FUNC_ARB 0x884D + GL_COMPARE_R_TO_TEXTURE_ARB 0x884E diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_shadow_ambient b/Windows/glew/auto/extensions/gl/GL_ARB_shadow_ambient new file mode 100644 index 00000000..81fd3374 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_shadow_ambient @@ -0,0 +1,5 @@ +GL_ARB_shadow_ambient +http://www.opengl.org/registry/specs/ARB/shadow_ambient.txt +GL_ARB_shadow_ambient + + GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sparse_buffer b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_buffer new file mode 100644 index 00000000..a6d77d1d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_buffer @@ -0,0 +1,7 @@ +GL_ARB_sparse_buffer +http://www.opengl.org/registry/specs/ARB/sparse_buffer.txt +GL_ARB_sparse_buffer + + GL_SPARSE_STORAGE_BIT_ARB 0x0400 + GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 + void glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture new file mode 100644 index 00000000..ad0b9110 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture @@ -0,0 +1,16 @@ +GL_ARB_sparse_texture +http://www.opengl.org/registry/specs/ARB/sparse_texture.txt +GL_ARB_sparse_texture + + GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 + GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 + GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 + GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 + GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 + GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A + GL_TEXTURE_SPARSE_ARB 0x91A6 + GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 + GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 + GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 + GL_NUM_SPARSE_LEVELS_ARB 0x91AA + void glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture2 b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture2 new file mode 100644 index 00000000..612084c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture2 @@ -0,0 +1,4 @@ +GL_ARB_sparse_texture2 +http://www.opengl.org/registry/specs/ARB/sparse_texture2.txt +GL_ARB_sparse_texture2 + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture_clamp b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture_clamp new file mode 100644 index 00000000..32012d90 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sparse_texture_clamp @@ -0,0 +1,4 @@ +GL_ARB_sparse_texture_clamp +http://www.opengl.org/registry/specs/ARB/sparse_texture_clamp.txt +GL_ARB_sparse_texture_clamp + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_spirv_extensions b/Windows/glew/auto/extensions/gl/GL_ARB_spirv_extensions new file mode 100644 index 00000000..e235cabe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_spirv_extensions @@ -0,0 +1,6 @@ +GL_ARB_spirv_extensions +http://www.opengl.org/registry/specs/ARB/spirv_extensions.txt +GL_ARB_spirv_extensions + + GL_SPIR_V_EXTENSIONS 0x9553 + GL_NUM_SPIR_V_EXTENSIONS 0x9554 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_stencil_texturing b/Windows/glew/auto/extensions/gl/GL_ARB_stencil_texturing new file mode 100644 index 00000000..409dfcaf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_stencil_texturing @@ -0,0 +1,5 @@ +GL_ARB_stencil_texturing +http://www.opengl.org/registry/specs/ARB/stencil_texturing.txt +GL_ARB_stencil_texturing + + GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_sync b/Windows/glew/auto/extensions/gl/GL_ARB_sync new file mode 100644 index 00000000..2fa5a4a7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_sync @@ -0,0 +1,26 @@ +GL_ARB_sync +http://www.opengl.org/registry/specs/ARB/sync.txt +GL_ARB_sync + + GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull + GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 + GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 + GL_OBJECT_TYPE 0x9112 + GL_SYNC_CONDITION 0x9113 + GL_SYNC_STATUS 0x9114 + GL_SYNC_FLAGS 0x9115 + GL_SYNC_FENCE 0x9116 + GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 + GL_UNSIGNALED 0x9118 + GL_SIGNALED 0x9119 + GL_ALREADY_SIGNALED 0x911A + GL_TIMEOUT_EXPIRED 0x911B + GL_CONDITION_SATISFIED 0x911C + GL_WAIT_FAILED 0x911D + GLenum glClientWaitSync (GLsync GLsync,GLbitfield flags,GLuint64 timeout) + void glDeleteSync (GLsync GLsync) + GLsync glFenceSync (GLenum condition,GLbitfield flags) + void glGetInteger64v (GLenum pname, GLint64* params) + void glGetSynciv (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values) + GLboolean glIsSync (GLsync GLsync) + void glWaitSync (GLsync GLsync,GLbitfield flags,GLuint64 timeout) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_tessellation_shader b/Windows/glew/auto/extensions/gl/GL_ARB_tessellation_shader new file mode 100644 index 00000000..1be4c8b7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_tessellation_shader @@ -0,0 +1,38 @@ +GL_ARB_tessellation_shader +http://www.opengl.org/registry/specs/ARB/tessellation_shader.txt +GL_ARB_tessellation_shader + + GL_PATCHES 0xE + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 + GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C + GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D + GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E + GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F + GL_PATCH_VERTICES 0x8E72 + GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 + GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 + GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 + GL_TESS_GEN_MODE 0x8E76 + GL_TESS_GEN_SPACING 0x8E77 + GL_TESS_GEN_VERTEX_ORDER 0x8E78 + GL_TESS_GEN_POINT_MODE 0x8E79 + GL_ISOLINES 0x8E7A + GL_FRACTIONAL_ODD 0x8E7B + GL_FRACTIONAL_EVEN 0x8E7C + GL_MAX_PATCH_VERTICES 0x8E7D + GL_MAX_TESS_GEN_LEVEL 0x8E7E + GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F + GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 + GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 + GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 + GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 + GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 + GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 + GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 + GL_TESS_EVALUATION_SHADER 0x8E87 + GL_TESS_CONTROL_SHADER 0x8E88 + GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 + GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + void glPatchParameterfv (GLenum pname, const GLfloat* values) + void glPatchParameteri (GLenum pname, GLint value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_barrier b/Windows/glew/auto/extensions/gl/GL_ARB_texture_barrier new file mode 100644 index 00000000..204e99fc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_barrier @@ -0,0 +1,5 @@ +GL_ARB_texture_barrier +http://www.opengl.org/registry/specs/ARB/texture_barrier.txt +GL_ARB_texture_barrier + + void glTextureBarrier (void) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_border_clamp b/Windows/glew/auto/extensions/gl/GL_ARB_texture_border_clamp new file mode 100644 index 00000000..0ee527a7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_border_clamp @@ -0,0 +1,5 @@ +GL_ARB_texture_border_clamp +http://www.opengl.org/registry/specs/ARB/texture_border_clamp.txt +GL_ARB_texture_border_clamp + + GL_CLAMP_TO_BORDER_ARB 0x812D diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_object new file mode 100644 index 00000000..ad1cab82 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_object @@ -0,0 +1,10 @@ +GL_ARB_texture_buffer_object +http://www.opengl.org/registry/specs/ARB/texture_buffer_object.txt +GL_ARB_texture_buffer_object + + GL_TEXTURE_BUFFER_ARB 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B + GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D + GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + void glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_object_rgb32 b/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_object_rgb32 new file mode 100644 index 00000000..249e3975 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_object_rgb32 @@ -0,0 +1,4 @@ +GL_ARB_texture_buffer_object_rgb32 +http://www.opengl.org/registry/specs/ARB/texture_buffer_object_rgb32.txt +GL_ARB_texture_buffer_object_rgb32 + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_range b/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_range new file mode 100644 index 00000000..ee936cfa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_buffer_range @@ -0,0 +1,9 @@ +GL_ARB_texture_buffer_range +http://www.opengl.org/registry/specs/ARB/texture_buffer_range.txt +GL_ARB_texture_buffer_range + + GL_TEXTURE_BUFFER_OFFSET 0x919D + GL_TEXTURE_BUFFER_SIZE 0x919E + GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + void glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression b/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression new file mode 100644 index 00000000..8a487df3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression @@ -0,0 +1,22 @@ +GL_ARB_texture_compression +http://www.opengl.org/registry/specs/ARB/texture_compression.txt +GL_ARB_texture_compression + + GL_COMPRESSED_ALPHA_ARB 0x84E9 + GL_COMPRESSED_LUMINANCE_ARB 0x84EA + GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB + GL_COMPRESSED_INTENSITY_ARB 0x84EC + GL_COMPRESSED_RGB_ARB 0x84ED + GL_COMPRESSED_RGBA_ARB 0x84EE + GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF + GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 + GL_TEXTURE_COMPRESSED_ARB 0x86A1 + GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 + GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + void glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) + void glGetCompressedTexImageARB (GLenum target, GLint lod, void *img) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression_bptc b/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression_bptc new file mode 100644 index 00000000..a216dcb0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression_bptc @@ -0,0 +1,8 @@ +GL_ARB_texture_compression_bptc +http://www.opengl.org/registry/specs/ARB/texture_compression_bptc.txt +GL_ARB_texture_compression_bptc + + GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression_rgtc b/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression_rgtc new file mode 100644 index 00000000..58ce3a13 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_compression_rgtc @@ -0,0 +1,8 @@ +GL_ARB_texture_compression_rgtc +http://www.opengl.org/registry/specs/ARB/texture_compression_rgtc.txt +GL_ARB_texture_compression_rgtc + + GL_COMPRESSED_RED_RGTC1 0x8DBB + GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC + GL_COMPRESSED_RG_RGTC2 0x8DBD + GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_cube_map b/Windows/glew/auto/extensions/gl/GL_ARB_texture_cube_map new file mode 100644 index 00000000..8dde7112 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_cube_map @@ -0,0 +1,16 @@ +GL_ARB_texture_cube_map +http://www.opengl.org/registry/specs/ARB/texture_cube_map.txt +GL_ARB_texture_cube_map + + GL_NORMAL_MAP_ARB 0x8511 + GL_REFLECTION_MAP_ARB 0x8512 + GL_TEXTURE_CUBE_MAP_ARB 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A + GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_cube_map_array b/Windows/glew/auto/extensions/gl/GL_ARB_texture_cube_map_array new file mode 100644 index 00000000..2ad4d1de --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_cube_map_array @@ -0,0 +1,11 @@ +GL_ARB_texture_cube_map_array +http://www.opengl.org/registry/specs/ARB/texture_cube_map_array.txt +GL_ARB_texture_cube_map_array + + GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B + GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D + GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_add b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_add new file mode 100644 index 00000000..7e65f8f0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_add @@ -0,0 +1,4 @@ +GL_ARB_texture_env_add +http://www.opengl.org/registry/specs/ARB/texture_env_add.txt +GL_ARB_texture_env_add + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_combine b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_combine new file mode 100644 index 00000000..3643c859 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_combine @@ -0,0 +1,26 @@ +GL_ARB_texture_env_combine +http://www.opengl.org/registry/specs/ARB/texture_env_combine.txt +GL_ARB_texture_env_combine + + GL_SUBTRACT_ARB 0x84E7 + GL_COMBINE_ARB 0x8570 + GL_COMBINE_RGB_ARB 0x8571 + GL_COMBINE_ALPHA_ARB 0x8572 + GL_RGB_SCALE_ARB 0x8573 + GL_ADD_SIGNED_ARB 0x8574 + GL_INTERPOLATE_ARB 0x8575 + GL_CONSTANT_ARB 0x8576 + GL_PRIMARY_COLOR_ARB 0x8577 + GL_PREVIOUS_ARB 0x8578 + GL_SOURCE0_RGB_ARB 0x8580 + GL_SOURCE1_RGB_ARB 0x8581 + GL_SOURCE2_RGB_ARB 0x8582 + GL_SOURCE0_ALPHA_ARB 0x8588 + GL_SOURCE1_ALPHA_ARB 0x8589 + GL_SOURCE2_ALPHA_ARB 0x858A + GL_OPERAND0_RGB_ARB 0x8590 + GL_OPERAND1_RGB_ARB 0x8591 + GL_OPERAND2_RGB_ARB 0x8592 + GL_OPERAND0_ALPHA_ARB 0x8598 + GL_OPERAND1_ALPHA_ARB 0x8599 + GL_OPERAND2_ALPHA_ARB 0x859A diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_crossbar b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_crossbar new file mode 100644 index 00000000..06c94af6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_crossbar @@ -0,0 +1,4 @@ +GL_ARB_texture_env_crossbar +http://www.opengl.org/registry/specs/ARB/texture_env_crossbar.txt +GL_ARB_texture_env_crossbar + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_dot3 b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_dot3 new file mode 100644 index 00000000..f0223430 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_env_dot3 @@ -0,0 +1,6 @@ +GL_ARB_texture_env_dot3 +http://www.opengl.org/registry/specs/ARB/texture_env_dot3.txt +GL_ARB_texture_env_dot3 + + GL_DOT3_RGB_ARB 0x86AE + GL_DOT3_RGBA_ARB 0x86AF diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_filter_anisotropic b/Windows/glew/auto/extensions/gl/GL_ARB_texture_filter_anisotropic new file mode 100644 index 00000000..d53f18bd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_filter_anisotropic @@ -0,0 +1,6 @@ +GL_ARB_texture_filter_anisotropic +http://www.opengl.org/registry/specs/ARB/texture_filter_anisotropic.txt +GL_ARB_texture_filter_anisotropic + + GL_TEXTURE_MAX_ANISOTROPY 0x84FE + GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_filter_minmax b/Windows/glew/auto/extensions/gl/GL_ARB_texture_filter_minmax new file mode 100644 index 00000000..020a0387 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_filter_minmax @@ -0,0 +1,6 @@ +GL_ARB_texture_filter_minmax +http://www.opengl.org/registry/specs/ARB/texture_filter_minmax.txt +GL_ARB_texture_filter_minmax + + GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 + GL_WEIGHTED_AVERAGE_ARB 0x9367 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_float b/Windows/glew/auto/extensions/gl/GL_ARB_texture_float new file mode 100644 index 00000000..3abee3d2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_float @@ -0,0 +1,24 @@ +GL_ARB_texture_float +http://www.opengl.org/registry/specs/ARB/texture_float.txt +GL_ARB_texture_float + + GL_RGBA32F_ARB 0x8814 + GL_RGB32F_ARB 0x8815 + GL_ALPHA32F_ARB 0x8816 + GL_INTENSITY32F_ARB 0x8817 + GL_LUMINANCE32F_ARB 0x8818 + GL_LUMINANCE_ALPHA32F_ARB 0x8819 + GL_RGBA16F_ARB 0x881A + GL_RGB16F_ARB 0x881B + GL_ALPHA16F_ARB 0x881C + GL_INTENSITY16F_ARB 0x881D + GL_LUMINANCE16F_ARB 0x881E + GL_LUMINANCE_ALPHA16F_ARB 0x881F + GL_TEXTURE_RED_TYPE_ARB 0x8C10 + GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 + GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 + GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 + GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 + GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 + GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 + GL_UNSIGNED_NORMALIZED_ARB 0x8C17 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_gather b/Windows/glew/auto/extensions/gl/GL_ARB_texture_gather new file mode 100644 index 00000000..d7d3ced9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_gather @@ -0,0 +1,7 @@ +GL_ARB_texture_gather +http://www.opengl.org/registry/specs/ARB/texture_gather.txt +GL_ARB_texture_gather + + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F + GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_mirror_clamp_to_edge b/Windows/glew/auto/extensions/gl/GL_ARB_texture_mirror_clamp_to_edge new file mode 100644 index 00000000..e59cca9d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_mirror_clamp_to_edge @@ -0,0 +1,5 @@ +GL_ARB_texture_mirror_clamp_to_edge +http://www.opengl.org/registry/specs/ARB/texture_mirror_clamp_to_edge.txt +GL_ARB_texture_mirror_clamp_to_edge + + GL_MIRROR_CLAMP_TO_EDGE 0x8743 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_mirrored_repeat b/Windows/glew/auto/extensions/gl/GL_ARB_texture_mirrored_repeat new file mode 100644 index 00000000..bc6be98a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_mirrored_repeat @@ -0,0 +1,5 @@ +GL_ARB_texture_mirrored_repeat +http://www.opengl.org/registry/specs/ARB/texture_mirrored_repeat.txt +GL_ARB_texture_mirrored_repeat + + GL_MIRRORED_REPEAT_ARB 0x8370 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_multisample b/Windows/glew/auto/extensions/gl/GL_ARB_texture_multisample new file mode 100644 index 00000000..ba249a8d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_multisample @@ -0,0 +1,29 @@ +GL_ARB_texture_multisample +http://www.opengl.org/registry/specs/ARB/texture_multisample.txt +GL_ARB_texture_multisample + + GL_SAMPLE_POSITION 0x8E50 + GL_SAMPLE_MASK 0x8E51 + GL_SAMPLE_MASK_VALUE 0x8E52 + GL_MAX_SAMPLE_MASK_WORDS 0x8E59 + GL_TEXTURE_2D_MULTISAMPLE 0x9100 + GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 + GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 + GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 + GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 + GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 + GL_TEXTURE_SAMPLES 0x9106 + GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 + GL_SAMPLER_2D_MULTISAMPLE 0x9108 + GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A + GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B + GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D + GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E + GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F + GL_MAX_INTEGER_SAMPLES 0x9110 + void glGetMultisamplefv (GLenum pname, GLuint index, GLfloat* val) + void glSampleMaski (GLuint index, GLbitfield mask) + void glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_non_power_of_two b/Windows/glew/auto/extensions/gl/GL_ARB_texture_non_power_of_two new file mode 100644 index 00000000..a612deed --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_non_power_of_two @@ -0,0 +1,4 @@ +GL_ARB_texture_non_power_of_two +http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt +GL_ARB_texture_non_power_of_two + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_query_levels b/Windows/glew/auto/extensions/gl/GL_ARB_texture_query_levels new file mode 100644 index 00000000..a5904eb1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_query_levels @@ -0,0 +1,4 @@ +GL_ARB_texture_query_levels +http://www.opengl.org/registry/specs/ARB/texture_query_levels.txt +GL_ARB_texture_query_levels + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_query_lod b/Windows/glew/auto/extensions/gl/GL_ARB_texture_query_lod new file mode 100644 index 00000000..b982d965 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_query_lod @@ -0,0 +1,4 @@ +GL_ARB_texture_query_lod +http://www.opengl.org/registry/specs/ARB/texture_query_lod.txt +GL_ARB_texture_query_lod + diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_rectangle b/Windows/glew/auto/extensions/gl/GL_ARB_texture_rectangle new file mode 100644 index 00000000..b8580446 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_rectangle @@ -0,0 +1,10 @@ +GL_ARB_texture_rectangle +http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt +GL_ARB_texture_rectangle + + GL_TEXTURE_RECTANGLE_ARB 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 + GL_SAMPLER_2D_RECT_ARB 0x8B63 + GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_rg b/Windows/glew/auto/extensions/gl/GL_ARB_texture_rg new file mode 100644 index 00000000..c2e03a9b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_rg @@ -0,0 +1,28 @@ +GL_ARB_texture_rg +http://www.opengl.org/registry/specs/ARB/texture_rg.txt +GL_ARB_texture_rg + + GL_COMPRESSED_RED 0x8225 + GL_COMPRESSED_RG 0x8226 + GL_RG 0x8227 + GL_RG_INTEGER 0x8228 + GL_R8 0x8229 + GL_R16 0x822A + GL_RG8 0x822B + GL_RG16 0x822C + GL_R16F 0x822D + GL_R32F 0x822E + GL_RG16F 0x822F + GL_RG32F 0x8230 + GL_R8I 0x8231 + GL_R8UI 0x8232 + GL_R16I 0x8233 + GL_R16UI 0x8234 + GL_R32I 0x8235 + GL_R32UI 0x8236 + GL_RG8I 0x8237 + GL_RG8UI 0x8238 + GL_RG16I 0x8239 + GL_RG16UI 0x823A + GL_RG32I 0x823B + GL_RG32UI 0x823C diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_rgb10_a2ui b/Windows/glew/auto/extensions/gl/GL_ARB_texture_rgb10_a2ui new file mode 100644 index 00000000..5157db73 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_rgb10_a2ui @@ -0,0 +1,5 @@ +GL_ARB_texture_rgb10_a2ui +http://www.opengl.org/registry/specs/ARB/texture_rgb10_a2ui.txt +GL_ARB_texture_rgb10_a2ui + + GL_RGB10_A2UI 0x906F diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_stencil8 b/Windows/glew/auto/extensions/gl/GL_ARB_texture_stencil8 new file mode 100644 index 00000000..c6ccd9e6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_stencil8 @@ -0,0 +1,6 @@ +GL_ARB_texture_stencil8 +http://www.opengl.org/registry/specs/ARB/texture_stencil8.txt +GL_ARB_texture_stencil8 + + GL_STENCIL_INDEX 0x1901 + GL_STENCIL_INDEX8 0x8D48 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_storage b/Windows/glew/auto/extensions/gl/GL_ARB_texture_storage new file mode 100644 index 00000000..de22e09d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_storage @@ -0,0 +1,8 @@ +GL_ARB_texture_storage +http://www.opengl.org/registry/specs/ARB/texture_storage.txt +GL_ARB_texture_storage + + GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + void glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) + void glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) + void glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_storage_multisample b/Windows/glew/auto/extensions/gl/GL_ARB_texture_storage_multisample new file mode 100644 index 00000000..ebf7b6f2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_storage_multisample @@ -0,0 +1,8 @@ +GL_ARB_texture_storage_multisample +http://www.opengl.org/registry/specs/ARB/texture_storage_multisample.txt +GL_ARB_texture_storage_multisample + + void glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) + void glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_swizzle b/Windows/glew/auto/extensions/gl/GL_ARB_texture_swizzle new file mode 100644 index 00000000..4ce14972 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_swizzle @@ -0,0 +1,9 @@ +GL_ARB_texture_swizzle +http://www.opengl.org/registry/specs/ARB/texture_swizzle.txt +GL_ARB_texture_swizzle + + GL_TEXTURE_SWIZZLE_R 0x8E42 + GL_TEXTURE_SWIZZLE_G 0x8E43 + GL_TEXTURE_SWIZZLE_B 0x8E44 + GL_TEXTURE_SWIZZLE_A 0x8E45 + GL_TEXTURE_SWIZZLE_RGBA 0x8E46 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_texture_view b/Windows/glew/auto/extensions/gl/GL_ARB_texture_view new file mode 100644 index 00000000..27a8c92b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_texture_view @@ -0,0 +1,10 @@ +GL_ARB_texture_view +http://www.opengl.org/registry/specs/ARB/texture_view.txt +GL_ARB_texture_view + + GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB + GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC + GL_TEXTURE_VIEW_MIN_LAYER 0x82DD + GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE + GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + void glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_timer_query b/Windows/glew/auto/extensions/gl/GL_ARB_timer_query new file mode 100644 index 00000000..f9c43973 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_timer_query @@ -0,0 +1,9 @@ +GL_ARB_timer_query +http://www.opengl.org/registry/specs/ARB/timer_query.txt +GL_ARB_timer_query + + GL_TIME_ELAPSED 0x88BF + GL_TIMESTAMP 0x8E28 + void glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64* params) + void glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64* params) + void glQueryCounter (GLuint id, GLenum target) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback2 b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback2 new file mode 100644 index 00000000..828f8245 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback2 @@ -0,0 +1,15 @@ +GL_ARB_transform_feedback2 +http://www.opengl.org/registry/specs/ARB/transform_feedback2.txt +GL_ARB_transform_feedback2 + + GL_TRANSFORM_FEEDBACK 0x8E22 + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 + GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + void glBindTransformFeedback (GLenum target, GLuint id) + void glDeleteTransformFeedbacks (GLsizei n, const GLuint* ids) + void glDrawTransformFeedback (GLenum mode, GLuint id) + void glGenTransformFeedbacks (GLsizei n, GLuint* ids) + GLboolean glIsTransformFeedback (GLuint id) + void glPauseTransformFeedback (void) + void glResumeTransformFeedback (void) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback3 b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback3 new file mode 100644 index 00000000..2baeeb89 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback3 @@ -0,0 +1,10 @@ +GL_ARB_transform_feedback3 +http://www.opengl.org/registry/specs/ARB/transform_feedback3.txt +GL_ARB_transform_feedback3 + + GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 + GL_MAX_VERTEX_STREAMS 0x8E71 + void glBeginQueryIndexed (GLenum target, GLuint index, GLuint id) + void glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream) + void glEndQueryIndexed (GLenum target, GLuint index) + void glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback_instanced b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback_instanced new file mode 100644 index 00000000..a7102fc4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback_instanced @@ -0,0 +1,6 @@ +GL_ARB_transform_feedback_instanced +http://www.opengl.org/registry/specs/ARB/transform_feedback_instanced.txt +GL_ARB_transform_feedback_instanced + + void glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei primcount) + void glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback_overflow_query b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback_overflow_query new file mode 100644 index 00000000..dc392c4d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_transform_feedback_overflow_query @@ -0,0 +1,6 @@ +GL_ARB_transform_feedback_overflow_query +http://www.opengl.org/registry/specs/ARB/transform_feedback_overflow_query.txt +GL_ARB_transform_feedback_overflow_query + + GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC + GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_transpose_matrix b/Windows/glew/auto/extensions/gl/GL_ARB_transpose_matrix new file mode 100644 index 00000000..7754cf63 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_transpose_matrix @@ -0,0 +1,12 @@ +GL_ARB_transpose_matrix +http://www.opengl.org/registry/specs/ARB/transpose_matrix.txt +GL_ARB_transpose_matrix + + GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 + GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 + GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 + GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + void glLoadTransposeMatrixfARB (GLfloat m[16]) + void glLoadTransposeMatrixdARB (GLdouble m[16]) + void glMultTransposeMatrixfARB (GLfloat m[16]) + void glMultTransposeMatrixdARB (GLdouble m[16]) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_uniform_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_uniform_buffer_object new file mode 100644 index 00000000..cb77a924 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_uniform_buffer_object @@ -0,0 +1,47 @@ +GL_ARB_uniform_buffer_object +http://www.opengl.org/registry/specs/ARB/uniform_buffer_object.txt +GL_ARB_uniform_buffer_object + + GL_INVALID_INDEX 0xFFFFFFFFu + GL_UNIFORM_BUFFER 0x8A11 + GL_UNIFORM_BUFFER_BINDING 0x8A28 + GL_UNIFORM_BUFFER_START 0x8A29 + GL_UNIFORM_BUFFER_SIZE 0x8A2A + GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B + GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C + GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D + GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E + GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F + GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 + GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 + GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 + GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 + GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 + GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 + GL_UNIFORM_TYPE 0x8A37 + GL_UNIFORM_SIZE 0x8A38 + GL_UNIFORM_NAME_LENGTH 0x8A39 + GL_UNIFORM_BLOCK_INDEX 0x8A3A + GL_UNIFORM_OFFSET 0x8A3B + GL_UNIFORM_ARRAY_STRIDE 0x8A3C + GL_UNIFORM_MATRIX_STRIDE 0x8A3D + GL_UNIFORM_IS_ROW_MAJOR 0x8A3E + GL_UNIFORM_BLOCK_BINDING 0x8A3F + GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 + GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 + GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 + GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 + GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 + GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 + GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 + void glBindBufferBase (GLenum target, GLuint index, GLuint buffer) + void glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName) + void glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params) + void glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName) + void glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params) + void glGetIntegeri_v (GLenum target, GLuint index, GLint* data) + GLuint glGetUniformBlockIndex (GLuint program, const GLchar* uniformBlockName) + void glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices) + void glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_array_bgra b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_array_bgra new file mode 100644 index 00000000..56cba613 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_array_bgra @@ -0,0 +1,5 @@ +GL_ARB_vertex_array_bgra +http://www.opengl.org/registry/specs/ARB/vertex_array_bgra.txt +GL_ARB_vertex_array_bgra + + GL_BGRA 0x80E1 diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_array_object b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_array_object new file mode 100644 index 00000000..ed9bfb60 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_array_object @@ -0,0 +1,9 @@ +GL_ARB_vertex_array_object +http://www.opengl.org/registry/specs/ARB/vertex_array_object.txt +GL_ARB_vertex_array_object + + GL_VERTEX_ARRAY_BINDING 0x85B5 + void glBindVertexArray (GLuint array) + void glDeleteVertexArrays (GLsizei n, const GLuint* arrays) + void glGenVertexArrays (GLsizei n, GLuint* arrays) + GLboolean glIsVertexArray (GLuint array) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_attrib_64bit b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_attrib_64bit new file mode 100644 index 00000000..68117c5e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_attrib_64bit @@ -0,0 +1,14 @@ +GL_ARB_vertex_attrib_64bit +http://www.opengl.org/registry/specs/ARB/vertex_attrib_64bit.txt +GL_ARB_vertex_attrib_64bit + + void glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble* params) + void glVertexAttribL1d (GLuint index, GLdouble x) + void glVertexAttribL1dv (GLuint index, const GLdouble* v) + void glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y) + void glVertexAttribL2dv (GLuint index, const GLdouble* v) + void glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttribL3dv (GLuint index, const GLdouble* v) + void glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttribL4dv (GLuint index, const GLdouble* v) + void glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_attrib_binding b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_attrib_binding new file mode 100644 index 00000000..277a61d3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_attrib_binding @@ -0,0 +1,24 @@ +GL_ARB_vertex_attrib_binding +http://www.opengl.org/registry/specs/ARB/vertex_attrib_binding.txt +GL_ARB_vertex_attrib_binding + + GL_VERTEX_ATTRIB_BINDING 0x82D4 + GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 + GL_VERTEX_BINDING_DIVISOR 0x82D6 + GL_VERTEX_BINDING_OFFSET 0x82D7 + GL_VERTEX_BINDING_STRIDE 0x82D8 + GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 + GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + GL_VERTEX_BINDING_BUFFER 0x8F4F + void glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) + void glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) + void glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex) + void glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) + void glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor) + void glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) + void glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) + void glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_blend b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_blend new file mode 100644 index 00000000..f4b3f58d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_blend @@ -0,0 +1,56 @@ +GL_ARB_vertex_blend +http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_blend.txt +GL_ARB_vertex_blend + + GL_MAX_VERTEX_UNITS_ARB 0x86A4 + GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 + GL_WEIGHT_SUM_UNITY_ARB 0x86A6 + GL_VERTEX_BLEND_ARB 0x86A7 + GL_CURRENT_WEIGHT_ARB 0x86A8 + GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 + GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA + GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB + GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC + GL_WEIGHT_ARRAY_ARB 0x86AD + GL_MODELVIEW0_ARB 0x1700 + GL_MODELVIEW1_ARB 0x850A + GL_MODELVIEW2_ARB 0x8722 + GL_MODELVIEW3_ARB 0x8723 + GL_MODELVIEW4_ARB 0x8724 + GL_MODELVIEW5_ARB 0x8725 + GL_MODELVIEW6_ARB 0x8726 + GL_MODELVIEW7_ARB 0x8727 + GL_MODELVIEW8_ARB 0x8728 + GL_MODELVIEW9_ARB 0x8729 + GL_MODELVIEW10_ARB 0x872A + GL_MODELVIEW11_ARB 0x872B + GL_MODELVIEW12_ARB 0x872C + GL_MODELVIEW13_ARB 0x872D + GL_MODELVIEW14_ARB 0x872E + GL_MODELVIEW15_ARB 0x872F + GL_MODELVIEW16_ARB 0x8730 + GL_MODELVIEW17_ARB 0x8731 + GL_MODELVIEW18_ARB 0x8732 + GL_MODELVIEW19_ARB 0x8733 + GL_MODELVIEW20_ARB 0x8734 + GL_MODELVIEW21_ARB 0x8735 + GL_MODELVIEW22_ARB 0x8736 + GL_MODELVIEW23_ARB 0x8737 + GL_MODELVIEW24_ARB 0x8738 + GL_MODELVIEW25_ARB 0x8739 + GL_MODELVIEW26_ARB 0x873A + GL_MODELVIEW27_ARB 0x873B + GL_MODELVIEW28_ARB 0x873C + GL_MODELVIEW29_ARB 0x873D + GL_MODELVIEW30_ARB 0x873E + GL_MODELVIEW31_ARB 0x873F + void glWeightbvARB (GLint size, GLbyte *weights) + void glWeightsvARB (GLint size, GLshort *weights) + void glWeightivARB (GLint size, GLint *weights) + void glWeightfvARB (GLint size, GLfloat *weights) + void glWeightdvARB (GLint size, GLdouble *weights) + void glWeightubvARB (GLint size, GLubyte *weights) + void glWeightusvARB (GLint size, GLushort *weights) + void glWeightuivARB (GLint size, GLuint *weights) + void glWeightPointerARB (GLint size, GLenum type, GLsizei stride, void *pointer) + void glVertexBlendARB (GLint count) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_buffer_object b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_buffer_object new file mode 100644 index 00000000..0d4b1754 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_buffer_object @@ -0,0 +1,48 @@ +GL_ARB_vertex_buffer_object +http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt +GL_ARB_vertex_buffer_object + + GL_BUFFER_SIZE_ARB 0x8764 + GL_BUFFER_USAGE_ARB 0x8765 + GL_ARRAY_BUFFER_ARB 0x8892 + GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 + GL_ARRAY_BUFFER_BINDING_ARB 0x8894 + GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 + GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 + GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 + GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 + GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D + GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F + GL_READ_ONLY_ARB 0x88B8 + GL_WRITE_ONLY_ARB 0x88B9 + GL_READ_WRITE_ARB 0x88BA + GL_BUFFER_ACCESS_ARB 0x88BB + GL_BUFFER_MAPPED_ARB 0x88BC + GL_BUFFER_MAP_POINTER_ARB 0x88BD + GL_STREAM_DRAW_ARB 0x88E0 + GL_STREAM_READ_ARB 0x88E1 + GL_STREAM_COPY_ARB 0x88E2 + GL_STATIC_DRAW_ARB 0x88E4 + GL_STATIC_READ_ARB 0x88E5 + GL_STATIC_COPY_ARB 0x88E6 + GL_DYNAMIC_DRAW_ARB 0x88E8 + GL_DYNAMIC_READ_ARB 0x88E9 + GL_DYNAMIC_COPY_ARB 0x88EA + void glBindBufferARB (GLenum target, GLuint buffer) + void glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage) + void glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data) + void glDeleteBuffersARB (GLsizei n, const GLuint* buffers) + void glGenBuffersARB (GLsizei n, GLuint* buffers) + void glGetBufferParameterivARB (GLenum target, GLenum pname, GLint* params) + void glGetBufferPointervARB (GLenum target, GLenum pname, void** params) + void glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data) + GLboolean glIsBufferARB (GLuint buffer) + void * glMapBufferARB (GLenum target, GLenum access) + GLboolean glUnmapBufferARB (GLenum target) + typedef ptrdiff_t GLsizeiptrARB + typedef ptrdiff_t GLintptrARB diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_program b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_program new file mode 100644 index 00000000..edf8cf3b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_program @@ -0,0 +1,145 @@ +GL_ARB_vertex_program +http://www.opengl.org/registry/specs/ARB/vertex_program.txt +GL_ARB_vertex_program + + GL_COLOR_SUM_ARB 0x8458 + GL_VERTEX_PROGRAM_ARB 0x8620 + GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 + GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 + GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 + GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 + GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 + GL_PROGRAM_LENGTH_ARB 0x8627 + GL_PROGRAM_STRING_ARB 0x8628 + GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E + GL_MAX_PROGRAM_MATRICES_ARB 0x862F + GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 + GL_CURRENT_MATRIX_ARB 0x8641 + GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 + GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 + GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 + GL_PROGRAM_ERROR_POSITION_ARB 0x864B + GL_PROGRAM_BINDING_ARB 0x8677 + GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A + GL_PROGRAM_ERROR_STRING_ARB 0x8874 + GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 + GL_PROGRAM_FORMAT_ARB 0x8876 + GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 + GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 + GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 + GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 + GL_PROGRAM_TEMPORARIES_ARB 0x88A4 + GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 + GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 + GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 + GL_PROGRAM_PARAMETERS_ARB 0x88A8 + GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 + GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA + GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB + GL_PROGRAM_ATTRIBS_ARB 0x88AC + GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD + GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE + GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF + GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 + GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 + GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 + GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 + GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 + GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 + GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 + GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 + GL_MATRIX0_ARB 0x88C0 + GL_MATRIX1_ARB 0x88C1 + GL_MATRIX2_ARB 0x88C2 + GL_MATRIX3_ARB 0x88C3 + GL_MATRIX4_ARB 0x88C4 + GL_MATRIX5_ARB 0x88C5 + GL_MATRIX6_ARB 0x88C6 + GL_MATRIX7_ARB 0x88C7 + GL_MATRIX8_ARB 0x88C8 + GL_MATRIX9_ARB 0x88C9 + GL_MATRIX10_ARB 0x88CA + GL_MATRIX11_ARB 0x88CB + GL_MATRIX12_ARB 0x88CC + GL_MATRIX13_ARB 0x88CD + GL_MATRIX14_ARB 0x88CE + GL_MATRIX15_ARB 0x88CF + GL_MATRIX16_ARB 0x88D0 + GL_MATRIX17_ARB 0x88D1 + GL_MATRIX18_ARB 0x88D2 + GL_MATRIX19_ARB 0x88D3 + GL_MATRIX20_ARB 0x88D4 + GL_MATRIX21_ARB 0x88D5 + GL_MATRIX22_ARB 0x88D6 + GL_MATRIX23_ARB 0x88D7 + GL_MATRIX24_ARB 0x88D8 + GL_MATRIX25_ARB 0x88D9 + GL_MATRIX26_ARB 0x88DA + GL_MATRIX27_ARB 0x88DB + GL_MATRIX28_ARB 0x88DC + GL_MATRIX29_ARB 0x88DD + GL_MATRIX30_ARB 0x88DE + GL_MATRIX31_ARB 0x88DF + void glBindProgramARB (GLenum target, GLuint program) + void glDeleteProgramsARB (GLsizei n, const GLuint* programs) + void glDisableVertexAttribArrayARB (GLuint index) + void glEnableVertexAttribArrayARB (GLuint index) + void glGenProgramsARB (GLsizei n, GLuint* programs) + void glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble* params) + void glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat* params) + void glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble* params) + void glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat* params) + void glGetProgramStringARB (GLenum target, GLenum pname, void *string) + void glGetProgramivARB (GLenum target, GLenum pname, GLint* params) + void glGetVertexAttribPointervARB (GLuint index, GLenum pname, void** pointer) + void glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble* params) + void glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribivARB (GLuint index, GLenum pname, GLint* params) + GLboolean glIsProgramARB (GLuint program) + void glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble* params) + void glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat* params) + void glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble* params) + void glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat* params) + void glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string) + void glVertexAttrib1dARB (GLuint index, GLdouble x) + void glVertexAttrib1dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib1fARB (GLuint index, GLfloat x) + void glVertexAttrib1fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib1sARB (GLuint index, GLshort x) + void glVertexAttrib1svARB (GLuint index, const GLshort* v) + void glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y) + void glVertexAttrib2dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y) + void glVertexAttrib2fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y) + void glVertexAttrib2svARB (GLuint index, const GLshort* v) + void glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttrib3dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z) + void glVertexAttrib3fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z) + void glVertexAttrib3svARB (GLuint index, const GLshort* v) + void glVertexAttrib4NbvARB (GLuint index, const GLbyte* v) + void glVertexAttrib4NivARB (GLuint index, const GLint* v) + void glVertexAttrib4NsvARB (GLuint index, const GLshort* v) + void glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) + void glVertexAttrib4NubvARB (GLuint index, const GLubyte* v) + void glVertexAttrib4NuivARB (GLuint index, const GLuint* v) + void glVertexAttrib4NusvARB (GLuint index, const GLushort* v) + void glVertexAttrib4bvARB (GLuint index, const GLbyte* v) + void glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttrib4dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexAttrib4fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib4ivARB (GLuint index, const GLint* v) + void glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexAttrib4svARB (GLuint index, const GLshort* v) + void glVertexAttrib4ubvARB (GLuint index, const GLubyte* v) + void glVertexAttrib4uivARB (GLuint index, const GLuint* v) + void glVertexAttrib4usvARB (GLuint index, const GLushort* v) + void glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_shader b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_shader new file mode 100644 index 00000000..b84546a6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_shader @@ -0,0 +1,14 @@ +GL_ARB_vertex_shader +http://www.opengl.org/registry/specs/ARB/vertex_shader.txt +GL_ARB_vertex_shader + + GL_VERTEX_SHADER_ARB 0x8B31 + GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A + GL_MAX_VARYING_FLOATS_ARB 0x8B4B + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D + GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 + GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + void glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB* name) + void glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name) + GLint glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB* name) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_type_10f_11f_11f_rev b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_type_10f_11f_11f_rev new file mode 100644 index 00000000..a11a5881 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_type_10f_11f_11f_rev @@ -0,0 +1,5 @@ +GL_ARB_vertex_type_10f_11f_11f_rev +http://www.opengl.org/registry/specs/ARB/vertex_type_10f_11f_11f_rev.txt +GL_ARB_vertex_type_10f_11f_11f_rev + + GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_vertex_type_2_10_10_10_rev b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_type_2_10_10_10_rev new file mode 100644 index 00000000..2ccd2d8f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_vertex_type_2_10_10_10_rev @@ -0,0 +1,44 @@ +GL_ARB_vertex_type_2_10_10_10_rev +http://www.opengl.org/registry/specs/ARB/vertex_type_2_10_10_10_rev.txt +GL_ARB_vertex_type_2_10_10_10_rev + + GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 + GL_INT_2_10_10_10_REV 0x8D9F + void glColorP3ui (GLenum type, GLuint color) + void glColorP3uiv (GLenum type, const GLuint* color) + void glColorP4ui (GLenum type, GLuint color) + void glColorP4uiv (GLenum type, const GLuint* color) + void glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint* coords) + void glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint* coords) + void glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint* coords) + void glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint* coords) + void glNormalP3ui (GLenum type, GLuint coords) + void glNormalP3uiv (GLenum type, const GLuint* coords) + void glSecondaryColorP3ui (GLenum type, GLuint color) + void glSecondaryColorP3uiv (GLenum type, const GLuint* color) + void glTexCoordP1ui (GLenum type, GLuint coords) + void glTexCoordP1uiv (GLenum type, const GLuint* coords) + void glTexCoordP2ui (GLenum type, GLuint coords) + void glTexCoordP2uiv (GLenum type, const GLuint* coords) + void glTexCoordP3ui (GLenum type, GLuint coords) + void glTexCoordP3uiv (GLenum type, const GLuint* coords) + void glTexCoordP4ui (GLenum type, GLuint coords) + void glTexCoordP4uiv (GLenum type, const GLuint* coords) + void glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexP2ui (GLenum type, GLuint value) + void glVertexP2uiv (GLenum type, const GLuint* value) + void glVertexP3ui (GLenum type, GLuint value) + void glVertexP3uiv (GLenum type, const GLuint* value) + void glVertexP4ui (GLenum type, GLuint value) + void glVertexP4uiv (GLenum type, const GLuint* value) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_viewport_array b/Windows/glew/auto/extensions/gl/GL_ARB_viewport_array new file mode 100644 index 00000000..ab923b48 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_viewport_array @@ -0,0 +1,27 @@ +GL_ARB_viewport_array +http://www.opengl.org/registry/specs/ARB/viewport_array.txt +GL_ARB_viewport_array + + GL_DEPTH_RANGE 0x0B70 + GL_VIEWPORT 0x0BA2 + GL_SCISSOR_BOX 0x0C10 + GL_SCISSOR_TEST 0x0C11 + GL_MAX_VIEWPORTS 0x825B + GL_VIEWPORT_SUBPIXEL_BITS 0x825C + GL_VIEWPORT_BOUNDS_RANGE 0x825D + GL_LAYER_PROVOKING_VERTEX 0x825E + GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F + GL_UNDEFINED_VERTEX 0x8260 + GL_FIRST_VERTEX_CONVENTION 0x8E4D + GL_LAST_VERTEX_CONVENTION 0x8E4E + GL_PROVOKING_VERTEX 0x8E4F + void glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd * v) + void glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f) + void glGetDoublei_v (GLenum target, GLuint index, GLdouble* data) + void glGetFloati_v (GLenum target, GLuint index, GLfloat* data) + void glScissorArrayv (GLuint first, GLsizei count, const GLint * v) + void glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height) + void glScissorIndexedv (GLuint index, const GLint * v) + void glViewportArrayv (GLuint first, GLsizei count, const GLfloat * v) + void glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) + void glViewportIndexedfv (GLuint index, const GLfloat * v) diff --git a/Windows/glew/auto/extensions/gl/GL_ARB_window_pos b/Windows/glew/auto/extensions/gl/GL_ARB_window_pos new file mode 100644 index 00000000..1bdbfb03 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARB_window_pos @@ -0,0 +1,20 @@ +GL_ARB_window_pos +http://www.opengl.org/registry/specs/ARB/window_pos.txt +GL_ARB_window_pos + + void glWindowPos2dARB (GLdouble x, GLdouble y) + void glWindowPos2dvARB (const GLdouble* p) + void glWindowPos2fARB (GLfloat x, GLfloat y) + void glWindowPos2fvARB (const GLfloat* p) + void glWindowPos2iARB (GLint x, GLint y) + void glWindowPos2ivARB (const GLint* p) + void glWindowPos2sARB (GLshort x, GLshort y) + void glWindowPos2svARB (const GLshort* p) + void glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z) + void glWindowPos3dvARB (const GLdouble* p) + void glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z) + void glWindowPos3fvARB (const GLfloat* p) + void glWindowPos3iARB (GLint x, GLint y, GLint z) + void glWindowPos3ivARB (const GLint* p) + void glWindowPos3sARB (GLshort x, GLshort y, GLshort z) + void glWindowPos3svARB (const GLshort* p) diff --git a/Windows/glew/auto/extensions/gl/GL_ARM_mali_program_binary b/Windows/glew/auto/extensions/gl/GL_ARM_mali_program_binary new file mode 100644 index 00000000..a2634f1f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARM_mali_program_binary @@ -0,0 +1,5 @@ +GL_ARM_mali_program_binary +http://www.opengl.org/registry/specs/ARM/mali_program_binary.txt +GL_ARM_mali_program_binary + + GL_MALI_PROGRAM_BINARY_ARM 0x8F61 diff --git a/Windows/glew/auto/extensions/gl/GL_ARM_mali_shader_binary b/Windows/glew/auto/extensions/gl/GL_ARM_mali_shader_binary new file mode 100644 index 00000000..a1ccdff4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARM_mali_shader_binary @@ -0,0 +1,5 @@ +GL_ARM_mali_shader_binary +http://www.opengl.org/registry/specs/ARM/mali_shader_binary.txt +GL_ARM_mali_shader_binary + + GL_MALI_SHADER_BINARY_ARM 0x8F60 diff --git a/Windows/glew/auto/extensions/gl/GL_ARM_rgba8 b/Windows/glew/auto/extensions/gl/GL_ARM_rgba8 new file mode 100644 index 00000000..93bab4f3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARM_rgba8 @@ -0,0 +1,5 @@ +GL_ARM_rgba8 +http://www.opengl.org/registry/specs/ARM/rgba8.txt +GL_ARM_rgba8 + + GL_RGBA8_OES 0x8058 diff --git a/Windows/glew/auto/extensions/gl/GL_ARM_shader_framebuffer_fetch b/Windows/glew/auto/extensions/gl/GL_ARM_shader_framebuffer_fetch new file mode 100644 index 00000000..c8d14f99 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARM_shader_framebuffer_fetch @@ -0,0 +1,6 @@ +GL_ARM_shader_framebuffer_fetch +http://www.opengl.org/registry/specs/ARM/shader_framebuffer_fetch.txt +GL_ARM_shader_framebuffer_fetch + + GL_FETCH_PER_SAMPLE_ARM 0x8F65 + GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 diff --git a/Windows/glew/auto/extensions/gl/GL_ARM_shader_framebuffer_fetch_depth_stencil b/Windows/glew/auto/extensions/gl/GL_ARM_shader_framebuffer_fetch_depth_stencil new file mode 100644 index 00000000..2999a45e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ARM_shader_framebuffer_fetch_depth_stencil @@ -0,0 +1,4 @@ +GL_ARM_shader_framebuffer_fetch_depth_stencil +http://www.opengl.org/registry/specs/ARM/shader_framebuffer_fetch_depth_stencil.txt +GL_ARM_shader_framebuffer_fetch_depth_stencil + diff --git a/Windows/glew/auto/extensions/gl/GL_ATIX_point_sprites b/Windows/glew/auto/extensions/gl/GL_ATIX_point_sprites new file mode 100644 index 00000000..d2434e7d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATIX_point_sprites @@ -0,0 +1,10 @@ +GL_ATIX_point_sprites +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_point_sprites + + GL_TEXTURE_POINT_MODE_ATIX 0x60B0 + GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 + GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 + GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 + GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 + GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 diff --git a/Windows/glew/auto/extensions/gl/GL_ATIX_texture_env_combine3 b/Windows/glew/auto/extensions/gl/GL_ATIX_texture_env_combine3 new file mode 100644 index 00000000..77f425d3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATIX_texture_env_combine3 @@ -0,0 +1,7 @@ +GL_ATIX_texture_env_combine3 +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_texture_env_combine3 + + GL_MODULATE_ADD_ATIX 0x8744 + GL_MODULATE_SIGNED_ADD_ATIX 0x8745 + GL_MODULATE_SUBTRACT_ATIX 0x8746 diff --git a/Windows/glew/auto/extensions/gl/GL_ATIX_texture_env_route b/Windows/glew/auto/extensions/gl/GL_ATIX_texture_env_route new file mode 100644 index 00000000..d972fd19 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATIX_texture_env_route @@ -0,0 +1,7 @@ +GL_ATIX_texture_env_route +http://www.ati.com/developer/sdk/RadeonSDK/Html/Info/ATIX_texture_env_route.txt +GL_ATIX_texture_env_route + + GL_SECONDARY_COLOR_ATIX 0x8747 + GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 + GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 diff --git a/Windows/glew/auto/extensions/gl/GL_ATIX_vertex_shader_output_point_size b/Windows/glew/auto/extensions/gl/GL_ATIX_vertex_shader_output_point_size new file mode 100644 index 00000000..85a6d581 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATIX_vertex_shader_output_point_size @@ -0,0 +1,5 @@ +GL_ATIX_vertex_shader_output_point_size +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_vertex_shader_output_point_size + + GL_OUTPUT_POINT_SIZE_ATIX 0x610E diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_draw_buffers b/Windows/glew/auto/extensions/gl/GL_ATI_draw_buffers new file mode 100644 index 00000000..8f33ade4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_draw_buffers @@ -0,0 +1,22 @@ +GL_ATI_draw_buffers +http://www.opengl.org/registry/specs/ATI/draw_buffers.txt +GL_ATI_draw_buffers + + GL_MAX_DRAW_BUFFERS_ATI 0x8824 + GL_DRAW_BUFFER0_ATI 0x8825 + GL_DRAW_BUFFER1_ATI 0x8826 + GL_DRAW_BUFFER2_ATI 0x8827 + GL_DRAW_BUFFER3_ATI 0x8828 + GL_DRAW_BUFFER4_ATI 0x8829 + GL_DRAW_BUFFER5_ATI 0x882A + GL_DRAW_BUFFER6_ATI 0x882B + GL_DRAW_BUFFER7_ATI 0x882C + GL_DRAW_BUFFER8_ATI 0x882D + GL_DRAW_BUFFER9_ATI 0x882E + GL_DRAW_BUFFER10_ATI 0x882F + GL_DRAW_BUFFER11_ATI 0x8830 + GL_DRAW_BUFFER12_ATI 0x8831 + GL_DRAW_BUFFER13_ATI 0x8832 + GL_DRAW_BUFFER14_ATI 0x8833 + GL_DRAW_BUFFER15_ATI 0x8834 + void glDrawBuffersATI (GLsizei n, const GLenum* bufs) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_element_array b/Windows/glew/auto/extensions/gl/GL_ATI_element_array new file mode 100644 index 00000000..c568e6b0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_element_array @@ -0,0 +1,10 @@ +GL_ATI_element_array +http://www.opengl.org/registry/specs/ATI/element_array.txt +GL_ATI_element_array + + GL_ELEMENT_ARRAY_ATI 0x8768 + GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 + GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + void glDrawElementArrayATI (GLenum mode, GLsizei count) + void glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count) + void glElementPointerATI (GLenum type, const void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_envmap_bumpmap b/Windows/glew/auto/extensions/gl/GL_ATI_envmap_bumpmap new file mode 100644 index 00000000..09a41125 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_envmap_bumpmap @@ -0,0 +1,16 @@ +GL_ATI_envmap_bumpmap +http://oss.sgi.com/projects/ogl-sample/registry/ATI/envmap_bumpmap.txt +GL_ATI_envmap_bumpmap + + GL_BUMP_ROT_MATRIX_ATI 0x8775 + GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 + GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 + GL_BUMP_TEX_UNITS_ATI 0x8778 + GL_DUDV_ATI 0x8779 + GL_DU8DV8_ATI 0x877A + GL_BUMP_ENVMAP_ATI 0x877B + GL_BUMP_TARGET_ATI 0x877C + void glTexBumpParameterivATI (GLenum pname, GLint *param) + void glTexBumpParameterfvATI (GLenum pname, GLfloat *param) + void glGetTexBumpParameterivATI (GLenum pname, GLint *param) + void glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_fragment_shader b/Windows/glew/auto/extensions/gl/GL_ATI_fragment_shader new file mode 100644 index 00000000..c453c155 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_fragment_shader @@ -0,0 +1,72 @@ +GL_ATI_fragment_shader +http://www.opengl.org/registry/specs/ATI/fragment_shader.txt +GL_ATI_fragment_shader + + GL_2X_BIT_ATI 0x00000001 + GL_RED_BIT_ATI 0x00000001 + GL_4X_BIT_ATI 0x00000002 + GL_COMP_BIT_ATI 0x00000002 + GL_GREEN_BIT_ATI 0x00000002 + GL_8X_BIT_ATI 0x00000004 + GL_BLUE_BIT_ATI 0x00000004 + GL_NEGATE_BIT_ATI 0x00000004 + GL_BIAS_BIT_ATI 0x00000008 + GL_HALF_BIT_ATI 0x00000008 + GL_QUARTER_BIT_ATI 0x00000010 + GL_EIGHTH_BIT_ATI 0x00000020 + GL_SATURATE_BIT_ATI 0x00000040 + GL_FRAGMENT_SHADER_ATI 0x8920 + GL_REG_0_ATI 0x8921 + GL_REG_1_ATI 0x8922 + GL_REG_2_ATI 0x8923 + GL_REG_3_ATI 0x8924 + GL_REG_4_ATI 0x8925 + GL_REG_5_ATI 0x8926 + GL_CON_0_ATI 0x8941 + GL_CON_1_ATI 0x8942 + GL_CON_2_ATI 0x8943 + GL_CON_3_ATI 0x8944 + GL_CON_4_ATI 0x8945 + GL_CON_5_ATI 0x8946 + GL_CON_6_ATI 0x8947 + GL_CON_7_ATI 0x8948 + GL_MOV_ATI 0x8961 + GL_ADD_ATI 0x8963 + GL_MUL_ATI 0x8964 + GL_SUB_ATI 0x8965 + GL_DOT3_ATI 0x8966 + GL_DOT4_ATI 0x8967 + GL_MAD_ATI 0x8968 + GL_LERP_ATI 0x8969 + GL_CND_ATI 0x896A + GL_CND0_ATI 0x896B + GL_DOT2_ADD_ATI 0x896C + GL_SECONDARY_INTERPOLATOR_ATI 0x896D + GL_SWIZZLE_STR_ATI 0x8976 + GL_SWIZZLE_STQ_ATI 0x8977 + GL_SWIZZLE_STR_DR_ATI 0x8978 + GL_SWIZZLE_STQ_DQ_ATI 0x8979 + void glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) + void glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) + void glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) + void glBeginFragmentShaderATI (void) + void glBindFragmentShaderATI (GLuint id) + void glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) + void glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) + void glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) + void glDeleteFragmentShaderATI (GLuint id) + void glEndFragmentShaderATI (void) + GLuint glGenFragmentShadersATI (GLuint range) + void glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle) + void glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle) + void glSetFragmentShaderConstantATI (GLuint dst, const GLfloat* value) + GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E + GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F + GL_NUM_PASSES_ATI 0x8970 + GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 + GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 + GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 + GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 + GL_COLOR_ALPHA_PAIRING_ATI 0x8975 + GL_SWIZZLE_STRQ_ATI 0x897A + GL_SWIZZLE_STRQ_DQ_ATI 0x897B diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_map_object_buffer b/Windows/glew/auto/extensions/gl/GL_ATI_map_object_buffer new file mode 100644 index 00000000..6a683d09 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_map_object_buffer @@ -0,0 +1,6 @@ +GL_ATI_map_object_buffer +http://www.opengl.org/registry/specs/ATI/map_object_buffer.txt +GL_ATI_map_object_buffer + + void * glMapObjectBufferATI (GLuint buffer) + void glUnmapObjectBufferATI (GLuint buffer) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_meminfo b/Windows/glew/auto/extensions/gl/GL_ATI_meminfo new file mode 100644 index 00000000..8a4154cd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_meminfo @@ -0,0 +1,7 @@ +GL_ATI_meminfo +http://www.opengl.org/registry/specs/ATI/meminfo.txt +GL_ATI_meminfo + + GL_VBO_FREE_MEMORY_ATI 0x87FB + GL_TEXTURE_FREE_MEMORY_ATI 0x87FC + GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_pn_triangles b/Windows/glew/auto/extensions/gl/GL_ATI_pn_triangles new file mode 100644 index 00000000..ca3923d1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_pn_triangles @@ -0,0 +1,15 @@ +GL_ATI_pn_triangles +http://www.opengl.org/registry/specs/ATI/pn_triangles.txt +GL_ATI_pn_triangles + + GL_PN_TRIANGLES_ATI 0x87F0 + GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 + GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 + GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 + GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 + GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 + GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 + GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 + GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + void glPNTrianglesiATI (GLenum pname, GLint param) + void glPNTrianglesfATI (GLenum pname, GLfloat param) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_separate_stencil b/Windows/glew/auto/extensions/gl/GL_ATI_separate_stencil new file mode 100644 index 00000000..b7237e5c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_separate_stencil @@ -0,0 +1,10 @@ +GL_ATI_separate_stencil +http://www.opengl.org/registry/specs/ATI/separate_stencil.txt +GL_ATI_separate_stencil + + GL_STENCIL_BACK_FUNC_ATI 0x8800 + GL_STENCIL_BACK_FAIL_ATI 0x8801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 + GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + void glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + void glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_shader_texture_lod b/Windows/glew/auto/extensions/gl/GL_ATI_shader_texture_lod new file mode 100644 index 00000000..e6e6c043 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_shader_texture_lod @@ -0,0 +1,4 @@ +GL_ATI_shader_texture_lod + +GL_ATI_shader_texture_lod + diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_text_fragment_shader b/Windows/glew/auto/extensions/gl/GL_ATI_text_fragment_shader new file mode 100644 index 00000000..a11971c7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_text_fragment_shader @@ -0,0 +1,5 @@ +GL_ATI_text_fragment_shader +http://www.opengl.org/registry/specs/ATI/text_fragment_shader.txt +GL_ATI_text_fragment_shader + + GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_texture_compression_3dc b/Windows/glew/auto/extensions/gl/GL_ATI_texture_compression_3dc new file mode 100644 index 00000000..fc3ee441 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_texture_compression_3dc @@ -0,0 +1,5 @@ +GL_ATI_texture_compression_3dc + +GL_ATI_texture_compression_3dc + + GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_texture_env_combine3 b/Windows/glew/auto/extensions/gl/GL_ATI_texture_env_combine3 new file mode 100644 index 00000000..b780f3e3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_texture_env_combine3 @@ -0,0 +1,7 @@ +GL_ATI_texture_env_combine3 +http://www.opengl.org/registry/specs/ATI/texture_env_combine3.txt +GL_ATI_texture_env_combine3 + + GL_MODULATE_ADD_ATI 0x8744 + GL_MODULATE_SIGNED_ADD_ATI 0x8745 + GL_MODULATE_SUBTRACT_ATI 0x8746 diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_texture_float b/Windows/glew/auto/extensions/gl/GL_ATI_texture_float new file mode 100644 index 00000000..441e367b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_texture_float @@ -0,0 +1,16 @@ +GL_ATI_texture_float +http://www.opengl.org/registry/specs/ATI/texture_float.txt +GL_ATI_texture_float + + GL_RGBA_FLOAT32_ATI 0x8814 + GL_RGB_FLOAT32_ATI 0x8815 + GL_ALPHA_FLOAT32_ATI 0x8816 + GL_INTENSITY_FLOAT32_ATI 0x8817 + GL_LUMINANCE_FLOAT32_ATI 0x8818 + GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 + GL_RGBA_FLOAT16_ATI 0x881A + GL_RGB_FLOAT16_ATI 0x881B + GL_ALPHA_FLOAT16_ATI 0x881C + GL_INTENSITY_FLOAT16_ATI 0x881D + GL_LUMINANCE_FLOAT16_ATI 0x881E + GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_texture_mirror_once b/Windows/glew/auto/extensions/gl/GL_ATI_texture_mirror_once new file mode 100644 index 00000000..044e3487 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_texture_mirror_once @@ -0,0 +1,6 @@ +GL_ATI_texture_mirror_once +http://www.opengl.org/registry/specs/ATI/texture_mirror_once.txt +GL_ATI_texture_mirror_once + + GL_MIRROR_CLAMP_ATI 0x8742 + GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_vertex_array_object b/Windows/glew/auto/extensions/gl/GL_ATI_vertex_array_object new file mode 100644 index 00000000..d198595b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_vertex_array_object @@ -0,0 +1,24 @@ +GL_ATI_vertex_array_object +http://www.opengl.org/registry/specs/ATI/vertex_array_object.txt +GL_ATI_vertex_array_object + + GL_STATIC_ATI 0x8760 + GL_DYNAMIC_ATI 0x8761 + GL_PRESERVE_ATI 0x8762 + GL_DISCARD_ATI 0x8763 + GL_OBJECT_BUFFER_SIZE_ATI 0x8764 + GL_OBJECT_BUFFER_USAGE_ATI 0x8765 + GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 + GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + void glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) + void glFreeObjectBufferATI (GLuint buffer) + void glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat* params) + void glGetArrayObjectivATI (GLenum array, GLenum pname, GLint* params) + void glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat* params) + void glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint* params) + void glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat* params) + void glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint* params) + GLboolean glIsObjectBufferATI (GLuint buffer) + GLuint glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage) + void glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve) + void glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_vertex_attrib_array_object b/Windows/glew/auto/extensions/gl/GL_ATI_vertex_attrib_array_object new file mode 100644 index 00000000..bb0a4016 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_vertex_attrib_array_object @@ -0,0 +1,7 @@ +GL_ATI_vertex_attrib_array_object +http://www.opengl.org/registry/specs/ATI/vertex_attrib_array_object.txt +GL_ATI_vertex_attrib_array_object + + void glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint* params) + void glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset) diff --git a/Windows/glew/auto/extensions/gl/GL_ATI_vertex_streams b/Windows/glew/auto/extensions/gl/GL_ATI_vertex_streams new file mode 100644 index 00000000..f6e64fd6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_ATI_vertex_streams @@ -0,0 +1,59 @@ +GL_ATI_vertex_streams +http://www.opengl.org/registry/specs/ATI/vertex_streams.txt +GL_ATI_vertex_streams + + GL_MAX_VERTEX_STREAMS_ATI 0x876B + GL_VERTEX_SOURCE_ATI 0x876C + GL_VERTEX_STREAM0_ATI 0x876D + GL_VERTEX_STREAM1_ATI 0x876E + GL_VERTEX_STREAM2_ATI 0x876F + GL_VERTEX_STREAM3_ATI 0x8770 + GL_VERTEX_STREAM4_ATI 0x8771 + GL_VERTEX_STREAM5_ATI 0x8772 + GL_VERTEX_STREAM6_ATI 0x8773 + GL_VERTEX_STREAM7_ATI 0x8774 + void glClientActiveVertexStreamATI (GLenum stream) + void glVertexBlendEnviATI (GLenum pname, GLint param) + void glVertexBlendEnvfATI (GLenum pname, GLfloat param) + void glVertexStream1sATI (GLenum stream, GLshort x) + void glVertexStream1svATI (GLenum stream, const GLshort *coords) + void glVertexStream1iATI (GLenum stream, GLint x) + void glVertexStream1ivATI (GLenum stream, const GLint *coords) + void glVertexStream1fATI (GLenum stream, GLfloat x) + void glVertexStream1fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream1dATI (GLenum stream, GLdouble x) + void glVertexStream1dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream2sATI (GLenum stream, GLshort x, GLshort y) + void glVertexStream2svATI (GLenum stream, const GLshort *coords) + void glVertexStream2iATI (GLenum stream, GLint x, GLint y) + void glVertexStream2ivATI (GLenum stream, const GLint *coords) + void glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y) + void glVertexStream2fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y) + void glVertexStream2dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glVertexStream3svATI (GLenum stream, const GLshort *coords) + void glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glVertexStream3ivATI (GLenum stream, const GLint *coords) + void glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glVertexStream3fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glVertexStream3dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexStream4svATI (GLenum stream, const GLshort *coords) + void glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w) + void glVertexStream4ivATI (GLenum stream, const GLint *coords) + void glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexStream4fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexStream4dvATI (GLenum stream, const GLdouble *coords) + void glNormalStream3bATI (GLenum stream, GLbyte x, GLbyte y, GLbyte z) + void glNormalStream3bvATI (GLenum stream, const GLbyte *coords) + void glNormalStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glNormalStream3svATI (GLenum stream, const GLshort *coords) + void glNormalStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glNormalStream3ivATI (GLenum stream, const GLint *coords) + void glNormalStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glNormalStream3fvATI (GLenum stream, const GLfloat *coords) + void glNormalStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glNormalStream3dvATI (GLenum stream, const GLdouble *coords) diff --git a/Windows/glew/auto/extensions/gl/GL_EGL_KHR_context_flush_control b/Windows/glew/auto/extensions/gl/GL_EGL_KHR_context_flush_control new file mode 100644 index 00000000..a9f54b3f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EGL_KHR_context_flush_control @@ -0,0 +1,4 @@ +GL_EGL_KHR_context_flush_control +http://www.opengl.org/registry/specs/KHR/context_flush_control.txt +GL_EGL_KHR_context_flush_control + diff --git a/Windows/glew/auto/extensions/gl/GL_EGL_NV_robustness_video_memory_purge b/Windows/glew/auto/extensions/gl/GL_EGL_NV_robustness_video_memory_purge new file mode 100644 index 00000000..70116ea6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EGL_NV_robustness_video_memory_purge @@ -0,0 +1,6 @@ +GL_EGL_NV_robustness_video_memory_purge +http://www.opengl.org/registry/specs/NV/robustness_video_memory_purge.txt +GL_EGL_NV_robustness_video_memory_purge + + GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C + GL_PURGED_CONTEXT_RESET_NV 0x92BB diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_422_pixels b/Windows/glew/auto/extensions/gl/GL_EXT_422_pixels new file mode 100644 index 00000000..2b769029 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_422_pixels @@ -0,0 +1,8 @@ +GL_EXT_422_pixels +http://www.opengl.org/registry/specs/EXT/422_pixels.txt +GL_EXT_422_pixels + + GL_422_EXT 0x80CC + GL_422_REV_EXT 0x80CD + GL_422_AVERAGE_EXT 0x80CE + GL_422_REV_AVERAGE_EXT 0x80CF diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_Cg_shader b/Windows/glew/auto/extensions/gl/GL_EXT_Cg_shader new file mode 100644 index 00000000..b2df900f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_Cg_shader @@ -0,0 +1,6 @@ +GL_EXT_Cg_shader +http://download.nvidia.com/developer/GLSL/GLSL%20Release%20Notes%20for%20Release%2060.pdf +GL_EXT_Cg_shader + + GL_CG_VERTEX_SHADER_EXT 0x890E + GL_CG_FRAGMENT_SHADER_EXT 0x890F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_EGL_image_array b/Windows/glew/auto/extensions/gl/GL_EXT_EGL_image_array new file mode 100644 index 00000000..ce6644f2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_EGL_image_array @@ -0,0 +1,4 @@ +GL_EXT_EGL_image_array +http://www.opengl.org/registry/specs/EXT/EGL_image_array.txt +GL_EXT_EGL_image_array + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_YUV_target b/Windows/glew/auto/extensions/gl/GL_EXT_YUV_target new file mode 100644 index 00000000..abff9633 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_YUV_target @@ -0,0 +1,5 @@ +GL_EXT_YUV_target +http://www.opengl.org/registry/specs/EXT/YUV_target.txt +GL_EXT_YUV_target + + GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_abgr b/Windows/glew/auto/extensions/gl/GL_EXT_abgr new file mode 100644 index 00000000..3ce586e2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_abgr @@ -0,0 +1,5 @@ +GL_EXT_abgr +http://www.opengl.org/registry/specs/EXT/abgr.txt +GL_EXT_abgr + + GL_ABGR_EXT 0x8000 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_base_instance b/Windows/glew/auto/extensions/gl/GL_EXT_base_instance new file mode 100644 index 00000000..3071cd07 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_base_instance @@ -0,0 +1,7 @@ +GL_EXT_base_instance +http://www.opengl.org/registry/specs/EXT/base_instance.txt +GL_EXT_base_instance + + void glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance) + void glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance) + void glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_bgra b/Windows/glew/auto/extensions/gl/GL_EXT_bgra new file mode 100644 index 00000000..520838f1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_bgra @@ -0,0 +1,6 @@ +GL_EXT_bgra +http://www.opengl.org/registry/specs/EXT/bgra.txt +GL_EXT_bgra + + GL_BGR_EXT 0x80E0 + GL_BGRA_EXT 0x80E1 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_bindable_uniform b/Windows/glew/auto/extensions/gl/GL_EXT_bindable_uniform new file mode 100644 index 00000000..00ec270c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_bindable_uniform @@ -0,0 +1,13 @@ +GL_EXT_bindable_uniform +http://developer.download.nvidia.com/opengl/specs/GL_EXT_bindable_uniform.txt +GL_EXT_bindable_uniform + + GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 + GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 + GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 + GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED + GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + GL_UNIFORM_BUFFER_EXT 0x8DEE + void glUniformBufferEXT (GLuint program, GLint location, GLuint buffer) + GLint glGetUniformBufferSizeEXT (GLuint program, GLint location) + GLintptr glGetUniformOffsetEXT (GLuint program, GLint location) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_color b/Windows/glew/auto/extensions/gl/GL_EXT_blend_color new file mode 100644 index 00000000..764a1620 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_color @@ -0,0 +1,10 @@ +GL_EXT_blend_color +http://www.opengl.org/registry/specs/EXT/blend_color.txt +GL_EXT_blend_color + + GL_CONSTANT_COLOR_EXT 0x8001 + GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 + GL_CONSTANT_ALPHA_EXT 0x8003 + GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 + GL_BLEND_COLOR_EXT 0x8005 + void glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_equation_separate b/Windows/glew/auto/extensions/gl/GL_EXT_blend_equation_separate new file mode 100644 index 00000000..1d639c49 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_equation_separate @@ -0,0 +1,7 @@ +GL_EXT_blend_equation_separate +http://www.opengl.org/registry/specs/EXT/blend_equation_separate.txt +GL_EXT_blend_equation_separate + + GL_BLEND_EQUATION_RGB_EXT 0x8009 + GL_BLEND_EQUATION_ALPHA_EXT 0x883D + void glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_func_extended b/Windows/glew/auto/extensions/gl/GL_EXT_blend_func_extended new file mode 100644 index 00000000..f65e926d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_func_extended @@ -0,0 +1,14 @@ +GL_EXT_blend_func_extended +http://www.opengl.org/registry/specs/EXT/blend_func_extended.txt +GL_EXT_blend_func_extended + + GL_SRC_ALPHA_SATURATE_EXT 0x0308 + GL_SRC1_ALPHA_EXT 0x8589 + GL_SRC1_COLOR_EXT 0x88F9 + GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA + GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB + GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC + GL_LOCATION_INDEX_EXT 0x930F + void glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name) + GLint glGetFragDataIndexEXT (GLuint program, const GLchar * name) + GLint glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar* name) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_func_separate b/Windows/glew/auto/extensions/gl/GL_EXT_blend_func_separate new file mode 100644 index 00000000..4e8e68c6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_func_separate @@ -0,0 +1,9 @@ +GL_EXT_blend_func_separate +http://www.opengl.org/registry/specs/EXT/blend_func_separate.txt +GL_EXT_blend_func_separate + + GL_BLEND_DST_RGB_EXT 0x80C8 + GL_BLEND_SRC_RGB_EXT 0x80C9 + GL_BLEND_DST_ALPHA_EXT 0x80CA + GL_BLEND_SRC_ALPHA_EXT 0x80CB + void glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_logic_op b/Windows/glew/auto/extensions/gl/GL_EXT_blend_logic_op new file mode 100644 index 00000000..bdb7ecf1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_logic_op @@ -0,0 +1,4 @@ +GL_EXT_blend_logic_op +http://www.opengl.org/registry/specs/EXT/blend_logic_op.txt +GL_EXT_blend_logic_op + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_minmax b/Windows/glew/auto/extensions/gl/GL_EXT_blend_minmax new file mode 100644 index 00000000..0f1e136c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_minmax @@ -0,0 +1,9 @@ +GL_EXT_blend_minmax +http://www.opengl.org/registry/specs/EXT/blend_minmax.txt +GL_EXT_blend_minmax + + GL_FUNC_ADD_EXT 0x8006 + GL_MIN_EXT 0x8007 + GL_MAX_EXT 0x8008 + GL_BLEND_EQUATION_EXT 0x8009 + void glBlendEquationEXT (GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_blend_subtract b/Windows/glew/auto/extensions/gl/GL_EXT_blend_subtract new file mode 100644 index 00000000..04ebe37b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_blend_subtract @@ -0,0 +1,6 @@ +GL_EXT_blend_subtract +http://www.opengl.org/registry/specs/EXT/blend_subtract.txt +GL_EXT_blend_subtract + + GL_FUNC_SUBTRACT_EXT 0x800A + GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_buffer_storage b/Windows/glew/auto/extensions/gl/GL_EXT_buffer_storage new file mode 100644 index 00000000..76afaca0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_buffer_storage @@ -0,0 +1,15 @@ +GL_EXT_buffer_storage +http://www.opengl.org/registry/specs/EXT/buffer_storage.txt +GL_EXT_buffer_storage + + GL_MAP_READ_BIT 0x0001 + GL_MAP_WRITE_BIT 0x0002 + GL_MAP_PERSISTENT_BIT_EXT 0x0040 + GL_MAP_COHERENT_BIT_EXT 0x0080 + GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 + GL_CLIENT_STORAGE_BIT_EXT 0x0200 + GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 + GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F + GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + void glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags) + void glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_clear_texture b/Windows/glew/auto/extensions/gl/GL_EXT_clear_texture new file mode 100644 index 00000000..a50ced84 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_clear_texture @@ -0,0 +1,6 @@ +GL_EXT_clear_texture +http://www.opengl.org/registry/specs/EXT/clear_texture.txt +GL_EXT_clear_texture + + void glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data) + void glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_clip_cull_distance b/Windows/glew/auto/extensions/gl/GL_EXT_clip_cull_distance new file mode 100644 index 00000000..28d5eb20 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_clip_cull_distance @@ -0,0 +1,15 @@ +GL_EXT_clip_cull_distance +http://www.opengl.org/registry/specs/EXT/clip_cull_distance.txt +GL_EXT_clip_cull_distance + + GL_MAX_CLIP_DISTANCES_EXT 0x0D32 + GL_CLIP_DISTANCE0_EXT 0x3000 + GL_CLIP_DISTANCE1_EXT 0x3001 + GL_CLIP_DISTANCE2_EXT 0x3002 + GL_CLIP_DISTANCE3_EXT 0x3003 + GL_CLIP_DISTANCE4_EXT 0x3004 + GL_CLIP_DISTANCE5_EXT 0x3005 + GL_CLIP_DISTANCE6_EXT 0x3006 + GL_CLIP_DISTANCE7_EXT 0x3007 + GL_MAX_CULL_DISTANCES_EXT 0x82F9 + GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_clip_volume_hint b/Windows/glew/auto/extensions/gl/GL_EXT_clip_volume_hint new file mode 100644 index 00000000..cae57234 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_clip_volume_hint @@ -0,0 +1,5 @@ +GL_EXT_clip_volume_hint +http://www.opengl.org/registry/specs/EXT/clip_volume_hint.txt +GL_EXT_clip_volume_hint + + GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_cmyka b/Windows/glew/auto/extensions/gl/GL_EXT_cmyka new file mode 100644 index 00000000..0e21aabc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_cmyka @@ -0,0 +1,8 @@ +GL_EXT_cmyka +http://www.opengl.org/registry/specs/EXT/cmyka.txt +GL_EXT_cmyka + + GL_CMYK_EXT 0x800C + GL_CMYKA_EXT 0x800D + GL_PACK_CMYK_HINT_EXT 0x800E + GL_UNPACK_CMYK_HINT_EXT 0x800F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_color_buffer_float b/Windows/glew/auto/extensions/gl/GL_EXT_color_buffer_float new file mode 100644 index 00000000..4e3096b5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_color_buffer_float @@ -0,0 +1,4 @@ +GL_EXT_color_buffer_float +http://www.opengl.org/registry/specs/EXT/color_buffer_float.txt +GL_EXT_color_buffer_float + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_color_buffer_half_float b/Windows/glew/auto/extensions/gl/GL_EXT_color_buffer_half_float new file mode 100644 index 00000000..c494f7cc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_color_buffer_half_float @@ -0,0 +1,10 @@ +GL_EXT_color_buffer_half_float +http://www.opengl.org/registry/specs/EXT/color_buffer_half_float.txt +GL_EXT_color_buffer_half_float + + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 + GL_R16F_EXT 0x822D + GL_RG16F_EXT 0x822F + GL_RGBA16F_EXT 0x881A + GL_RGB16F_EXT 0x881B + GL_UNSIGNED_NORMALIZED_EXT 0x8C17 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_color_subtable b/Windows/glew/auto/extensions/gl/GL_EXT_color_subtable new file mode 100644 index 00000000..44d6ef53 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_color_subtable @@ -0,0 +1,6 @@ +GL_EXT_color_subtable +http://www.opengl.org/registry/specs/EXT/color_subtable.txt +GL_EXT_color_subtable + + void glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data) + void glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_compiled_vertex_array b/Windows/glew/auto/extensions/gl/GL_EXT_compiled_vertex_array new file mode 100644 index 00000000..dd590d98 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_compiled_vertex_array @@ -0,0 +1,8 @@ +GL_EXT_compiled_vertex_array +http://www.opengl.org/registry/specs/EXT/compiled_vertex_array.txt +GL_EXT_compiled_vertex_array + + GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 + GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + void glLockArraysEXT (GLint first, GLsizei count) + void glUnlockArraysEXT (void) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_compressed_ETC1_RGB8_sub_texture b/Windows/glew/auto/extensions/gl/GL_EXT_compressed_ETC1_RGB8_sub_texture new file mode 100644 index 00000000..1f7dc84d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_compressed_ETC1_RGB8_sub_texture @@ -0,0 +1,4 @@ +GL_EXT_compressed_ETC1_RGB8_sub_texture +http://www.opengl.org/registry/specs/EXT/compressed_ETC1_RGB8_sub_texture.txt +GL_EXT_compressed_ETC1_RGB8_sub_texture + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_conservative_depth b/Windows/glew/auto/extensions/gl/GL_EXT_conservative_depth new file mode 100644 index 00000000..8d0fc4d3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_conservative_depth @@ -0,0 +1,4 @@ +GL_EXT_conservative_depth +http://www.opengl.org/registry/specs/EXT/conservative_depth.txt +GL_EXT_conservative_depth + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_convolution b/Windows/glew/auto/extensions/gl/GL_EXT_convolution new file mode 100644 index 00000000..0702e78a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_convolution @@ -0,0 +1,37 @@ +GL_EXT_convolution +http://www.opengl.org/registry/specs/EXT/convolution.txt +GL_EXT_convolution + + GL_CONVOLUTION_1D_EXT 0x8010 + GL_CONVOLUTION_2D_EXT 0x8011 + GL_SEPARABLE_2D_EXT 0x8012 + GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 + GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 + GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 + GL_REDUCE_EXT 0x8016 + GL_CONVOLUTION_FORMAT_EXT 0x8017 + GL_CONVOLUTION_WIDTH_EXT 0x8018 + GL_CONVOLUTION_HEIGHT_EXT 0x8019 + GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A + GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B + GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C + GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D + GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E + GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F + GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 + GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 + GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 + GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + void glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image) + void glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image) + void glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat param) + void glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat* params) + void glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint param) + void glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint* params) + void glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) + void glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image) + void glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint* params) + void glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span) + void glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_coordinate_frame b/Windows/glew/auto/extensions/gl/GL_EXT_coordinate_frame new file mode 100644 index 00000000..30830024 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_coordinate_frame @@ -0,0 +1,20 @@ +GL_EXT_coordinate_frame +http://www.opengl.org/registry/specs/EXT/coordinate_frame.txt +GL_EXT_coordinate_frame + + GL_TANGENT_ARRAY_EXT 0x8439 + GL_BINORMAL_ARRAY_EXT 0x843A + GL_CURRENT_TANGENT_EXT 0x843B + GL_CURRENT_BINORMAL_EXT 0x843C + GL_TANGENT_ARRAY_TYPE_EXT 0x843E + GL_TANGENT_ARRAY_STRIDE_EXT 0x843F + GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 + GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 + GL_TANGENT_ARRAY_POINTER_EXT 0x8442 + GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 + GL_MAP1_TANGENT_EXT 0x8444 + GL_MAP2_TANGENT_EXT 0x8445 + GL_MAP1_BINORMAL_EXT 0x8446 + GL_MAP2_BINORMAL_EXT 0x8447 + void glBinormalPointerEXT (GLenum type, GLsizei stride, void *pointer) + void glTangentPointerEXT (GLenum type, GLsizei stride, void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_copy_image b/Windows/glew/auto/extensions/gl/GL_EXT_copy_image new file mode 100644 index 00000000..ba4d77a6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_copy_image @@ -0,0 +1,5 @@ +GL_EXT_copy_image +http://www.opengl.org/registry/specs/EXT/copy_image.txt +GL_EXT_copy_image + + void glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_copy_texture b/Windows/glew/auto/extensions/gl/GL_EXT_copy_texture new file mode 100644 index 00000000..d89223a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_copy_texture @@ -0,0 +1,9 @@ +GL_EXT_copy_texture +http://www.opengl.org/registry/specs/EXT/copy_texture.txt +GL_EXT_copy_texture + + void glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + void glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + void glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_cull_vertex b/Windows/glew/auto/extensions/gl/GL_EXT_cull_vertex new file mode 100644 index 00000000..8975a6e7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_cull_vertex @@ -0,0 +1,9 @@ +GL_EXT_cull_vertex +http://www.opengl.org/registry/specs/EXT/cull_vertex.txt +GL_EXT_cull_vertex + + GL_CULL_VERTEX_EXT 0x81AA + GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB + GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + void glCullParameterdvEXT (GLenum pname, GLdouble* params) + void glCullParameterfvEXT (GLenum pname, GLfloat* params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_debug_label b/Windows/glew/auto/extensions/gl/GL_EXT_debug_label new file mode 100644 index 00000000..002509bc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_debug_label @@ -0,0 +1,12 @@ +GL_EXT_debug_label +http://www.opengl.org/registry/specs/EXT/debug_label.txt +GL_EXT_debug_label + + GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F + GL_PROGRAM_OBJECT_EXT 0x8B40 + GL_SHADER_OBJECT_EXT 0x8B48 + GL_BUFFER_OBJECT_EXT 0x9151 + GL_QUERY_OBJECT_EXT 0x9153 + GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 + void glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label) + void glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar* label) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_debug_marker b/Windows/glew/auto/extensions/gl/GL_EXT_debug_marker new file mode 100644 index 00000000..ce9ffe40 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_debug_marker @@ -0,0 +1,7 @@ +GL_EXT_debug_marker +http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_marker.txt +GL_EXT_debug_marker + + void glInsertEventMarkerEXT (GLsizei length, const GLchar* marker) + void glPushGroupMarkerEXT (GLsizei length, const GLchar* marker) + void glPopGroupMarkerEXT (void) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_depth_bounds_test b/Windows/glew/auto/extensions/gl/GL_EXT_depth_bounds_test new file mode 100644 index 00000000..da2a453d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_depth_bounds_test @@ -0,0 +1,7 @@ +GL_EXT_depth_bounds_test +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_depth_bounds_test.txt +GL_EXT_depth_bounds_test + + GL_DEPTH_BOUNDS_TEST_EXT 0x8890 + GL_DEPTH_BOUNDS_EXT 0x8891 + void glDepthBoundsEXT (GLclampd zmin, GLclampd zmax) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_direct_state_access b/Windows/glew/auto/extensions/gl/GL_EXT_direct_state_access new file mode 100644 index 00000000..90bf5495 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_direct_state_access @@ -0,0 +1,221 @@ +GL_EXT_direct_state_access +http://www.opengl.org/registry/specs/EXT/direct_state_access.txt +GL_EXT_direct_state_access + + GL_PROGRAM_MATRIX_EXT 0x8E2D + GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E + GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + void glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture) + GLenum glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target) + void glClientAttribDefaultEXT (GLbitfield mask) + void glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data) + void glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) + void glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) + void glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data) + void glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) + void glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data) + void glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) + void glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) + void glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) + void glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) + void glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + void glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + void glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + void glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + void glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glDisableClientStateIndexedEXT (GLenum array, GLuint index) + void glDisableClientStateiEXT (GLenum array, GLuint index) + void glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index) + void glDisableVertexArrayEXT (GLuint vaobj, GLenum array) + void glEnableClientStateIndexedEXT (GLenum array, GLuint index) + void glEnableClientStateiEXT (GLenum array, GLuint index) + void glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index) + void glEnableVertexArrayEXT (GLuint vaobj, GLenum array) + void glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length) + void glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode) + void glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum* bufs) + void glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode) + void glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target) + void glGenerateTextureMipmapEXT (GLuint texture, GLenum target) + void glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, void *img) + void glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint level, void *img) + void glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble* params) + void glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble* params) + void glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat* params) + void glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat* params) + void glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint* param) + void glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat* params) + void glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint* params) + void glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params) + void glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params) + void glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint* params) + void glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels) + void glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params) + void glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params) + void glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint* params) + void glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint* params) + void glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat* params) + void glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint* params) + void glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint* params) + void glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void** params) + void glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data) + void glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params) + void glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint* params) + void glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint* params) + void glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble* params) + void glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat* params) + void glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string) + void glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint* params) + void glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint* params) + void glGetPointerIndexedvEXT (GLenum target, GLuint index, void** params) + void glGetPointeri_vEXT (GLenum pname, GLuint index, void** params) + void glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels) + void glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params) + void glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params) + void glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint* params) + void glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint* params) + void glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat* params) + void glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint* params) + void glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint* param) + void glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint* param) + void glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void** param) + void glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void** param) + void * glMapNamedBufferEXT (GLuint buffer, GLenum access) + void * glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access) + void glMatrixFrustumEXT (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) + void glMatrixLoadIdentityEXT (GLenum matrixMode) + void glMatrixLoadTransposedEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixLoadTransposefEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixLoaddEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixLoadfEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixMultTransposedEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixMultTransposefEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixMultdEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixMultfEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixOrthoEXT (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) + void glMatrixPopEXT (GLenum matrixMode) + void glMatrixPushEXT (GLenum matrixMode) + void glMatrixRotatedEXT (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) + void glMatrixRotatefEXT (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) + void glMatrixScaledEXT (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) + void glMatrixScalefEXT (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) + void glMatrixTranslatedEXT (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) + void glMatrixTranslatefEXT (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) + void glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer) + void glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer) + void glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param) + void glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params) + void glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param) + void glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint* params) + void glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param) + void glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params) + void glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param) + void glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params) + void glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param) + void glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint* params) + void glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels) + void glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) + void glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) + void glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint* params) + void glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint* params) + void glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param) + void glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param) + void glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param) + void glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint* param) + void glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer) + void glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels) + void glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) + void glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) + void glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage) + void glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data) + void glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) + void glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) + void glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) + void glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face) + void glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) + void glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble* params) + void glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat* params) + void glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint* params) + void glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint* params) + void glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params) + void glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params) + void glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params) + void glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string) + void glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) + void glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) + void glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + void glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0) + void glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform1iEXT (GLuint program, GLint location, GLint v0) + void glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0) + void glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1) + void glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1) + void glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1) + void glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + void glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2) + void glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) + void glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + void glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + void glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glPushClientAttribDefaultEXT (GLbitfield mask) + void glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer) + void glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels) + void glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) + void glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) + void glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint* params) + void glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint* params) + void glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param) + void glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat* param) + void glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param) + void glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint* param) + void glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer) + void glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels) + void glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) + void glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) + GLboolean glUnmapNamedBufferEXT (GLuint buffer) + void glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset) + void glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset) + void glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_discard_framebuffer b/Windows/glew/auto/extensions/gl/GL_EXT_discard_framebuffer new file mode 100644 index 00000000..0f2ca6fe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_discard_framebuffer @@ -0,0 +1,8 @@ +GL_EXT_discard_framebuffer +http://www.opengl.org/registry/specs/EXT/discard_framebuffer.txt +GL_EXT_discard_framebuffer + + GL_COLOR_EXT 0x1800 + GL_DEPTH_EXT 0x1801 + GL_STENCIL_EXT 0x1802 + void glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum* attachments) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers b/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers new file mode 100644 index 00000000..a5fc36c5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers @@ -0,0 +1,39 @@ +GL_EXT_draw_buffers +http://www.opengl.org/registry/specs/EXT/draw_buffers.txt +GL_EXT_draw_buffers + + GL_MAX_DRAW_BUFFERS_EXT 0x8824 + GL_DRAW_BUFFER0_EXT 0x8825 + GL_DRAW_BUFFER1_EXT 0x8826 + GL_DRAW_BUFFER2_EXT 0x8827 + GL_DRAW_BUFFER3_EXT 0x8828 + GL_DRAW_BUFFER4_EXT 0x8829 + GL_DRAW_BUFFER5_EXT 0x882A + GL_DRAW_BUFFER6_EXT 0x882B + GL_DRAW_BUFFER7_EXT 0x882C + GL_DRAW_BUFFER8_EXT 0x882D + GL_DRAW_BUFFER9_EXT 0x882E + GL_DRAW_BUFFER10_EXT 0x882F + GL_DRAW_BUFFER11_EXT 0x8830 + GL_DRAW_BUFFER12_EXT 0x8831 + GL_DRAW_BUFFER13_EXT 0x8832 + GL_DRAW_BUFFER14_EXT 0x8833 + GL_DRAW_BUFFER15_EXT 0x8834 + GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF + GL_COLOR_ATTACHMENT0_EXT 0x8CE0 + GL_COLOR_ATTACHMENT1_EXT 0x8CE1 + GL_COLOR_ATTACHMENT2_EXT 0x8CE2 + GL_COLOR_ATTACHMENT3_EXT 0x8CE3 + GL_COLOR_ATTACHMENT4_EXT 0x8CE4 + GL_COLOR_ATTACHMENT5_EXT 0x8CE5 + GL_COLOR_ATTACHMENT6_EXT 0x8CE6 + GL_COLOR_ATTACHMENT7_EXT 0x8CE7 + GL_COLOR_ATTACHMENT8_EXT 0x8CE8 + GL_COLOR_ATTACHMENT9_EXT 0x8CE9 + GL_COLOR_ATTACHMENT10_EXT 0x8CEA + GL_COLOR_ATTACHMENT11_EXT 0x8CEB + GL_COLOR_ATTACHMENT12_EXT 0x8CEC + GL_COLOR_ATTACHMENT13_EXT 0x8CED + GL_COLOR_ATTACHMENT14_EXT 0x8CEE + GL_COLOR_ATTACHMENT15_EXT 0x8CEF + void glDrawBuffersEXT (GLsizei n, const GLenum* bufs) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers2 b/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers2 new file mode 100644 index 00000000..5f0fd524 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers2 @@ -0,0 +1,10 @@ +GL_EXT_draw_buffers2 +http://www.opengl.org/registry/specs/EXT/draw_buffers2.txt +GL_EXT_draw_buffers2 + + void glColorMaskIndexedEXT (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) + void glDisableIndexedEXT (GLenum target, GLuint index) + void glEnableIndexedEXT (GLenum target, GLuint index) + void glGetBooleanIndexedvEXT (GLenum value, GLuint index, GLboolean* data) + void glGetIntegerIndexedvEXT (GLenum value, GLuint index, GLint* data) + GLboolean glIsEnabledIndexedEXT (GLenum target, GLuint index) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers_indexed b/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers_indexed new file mode 100644 index 00000000..8f0b1bf1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_draw_buffers_indexed @@ -0,0 +1,12 @@ +GL_EXT_draw_buffers_indexed +http://www.opengl.org/registry/specs/EXT/draw_buffers_indexed.txt +GL_EXT_draw_buffers_indexed + + void glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendEquationiEXT (GLuint buf, GLenum mode) + void glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) + void glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst) + void glColorMaskiEXT (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) + void glDisableiEXT (GLenum target, GLuint index) + void glEnableiEXT (GLenum target, GLuint index) + GLboolean glIsEnablediEXT (GLenum target, GLuint index) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_draw_elements_base_vertex b/Windows/glew/auto/extensions/gl/GL_EXT_draw_elements_base_vertex new file mode 100644 index 00000000..5930baea --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_draw_elements_base_vertex @@ -0,0 +1,8 @@ +GL_EXT_draw_elements_base_vertex +http://www.opengl.org/registry/specs/EXT/draw_elements_base_vertex.txt +GL_EXT_draw_elements_base_vertex + + void glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex) + void glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex) + void glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex) + void glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_draw_instanced b/Windows/glew/auto/extensions/gl/GL_EXT_draw_instanced new file mode 100644 index 00000000..ca7f17e0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_draw_instanced @@ -0,0 +1,6 @@ +GL_EXT_draw_instanced +http://developer.download.nvidia.com/opengl/specs/GL_EXT_draw_instanced.txt +GL_EXT_draw_instanced + + void glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_draw_range_elements b/Windows/glew/auto/extensions/gl/GL_EXT_draw_range_elements new file mode 100644 index 00000000..f5346de0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_draw_range_elements @@ -0,0 +1,7 @@ +GL_EXT_draw_range_elements +http://oss.sgi.com/projects/ogl-sample/registry/EXT/draw_range_elements.txt +GL_EXT_draw_range_elements + + GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 + GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + void glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_external_buffer b/Windows/glew/auto/extensions/gl/GL_EXT_external_buffer new file mode 100644 index 00000000..25a3ca64 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_external_buffer @@ -0,0 +1,7 @@ +GL_EXT_external_buffer +http://www.opengl.org/registry/specs/EXT/external_buffer.txt +GL_EXT_external_buffer + + void glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags) + void glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags) + typedef void* GLeglClientBufferEXT \ No newline at end of file diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_float_blend b/Windows/glew/auto/extensions/gl/GL_EXT_float_blend new file mode 100644 index 00000000..c5cd10b7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_float_blend @@ -0,0 +1,4 @@ +GL_EXT_float_blend +http://www.opengl.org/registry/specs/EXT/float_blend.txt +GL_EXT_float_blend + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_fog_coord b/Windows/glew/auto/extensions/gl/GL_EXT_fog_coord new file mode 100644 index 00000000..148866a7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_fog_coord @@ -0,0 +1,17 @@ +GL_EXT_fog_coord +http://oss.sgi.com/projects/ogl-sample/registry/EXT/fog_coord.txt +GL_EXT_fog_coord + + GL_FOG_COORDINATE_SOURCE_EXT 0x8450 + GL_FOG_COORDINATE_EXT 0x8451 + GL_FRAGMENT_DEPTH_EXT 0x8452 + GL_CURRENT_FOG_COORDINATE_EXT 0x8453 + GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 + GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 + GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 + GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + void glFogCoordfEXT (GLfloat coord) + void glFogCoordfvEXT (const GLfloat *coord) + void glFogCoorddEXT (GLdouble coord) + void glFogCoorddvEXT (const GLdouble *coord) + void glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_frag_depth b/Windows/glew/auto/extensions/gl/GL_EXT_frag_depth new file mode 100644 index 00000000..0a408774 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_frag_depth @@ -0,0 +1,4 @@ +GL_EXT_frag_depth +http://www.opengl.org/registry/specs/EXT/frag_depth.txt +GL_EXT_frag_depth + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_fragment_lighting b/Windows/glew/auto/extensions/gl/GL_EXT_fragment_lighting new file mode 100644 index 00000000..194574f9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_fragment_lighting @@ -0,0 +1,36 @@ +GL_EXT_fragment_lighting +http://www.opengl.org/registry/specs/EXT/fragment_lighting.txt +GL_EXT_fragment_lighting + + GL_FRAGMENT_LIGHTING_EXT 0x8400 + GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 + GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 + GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 + GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 + GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 + GL_CURRENT_RASTER_NORMAL_EXT 0x8406 + GL_LIGHT_ENV_MODE_EXT 0x8407 + GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 + GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 + GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A + GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B + GL_FRAGMENT_LIGHT0_EXT 0x840C + GL_FRAGMENT_LIGHT7_EXT 0x8413 + void glFragmentColorMaterialEXT (GLenum face, GLenum mode) + void glFragmentLightModelfEXT (GLenum pname, GLfloat param) + void glFragmentLightModelfvEXT (GLenum pname, GLfloat* params) + void glFragmentLightModeliEXT (GLenum pname, GLint param) + void glFragmentLightModelivEXT (GLenum pname, GLint* params) + void glFragmentLightfEXT (GLenum light, GLenum pname, GLfloat param) + void glFragmentLightfvEXT (GLenum light, GLenum pname, GLfloat* params) + void glFragmentLightiEXT (GLenum light, GLenum pname, GLint param) + void glFragmentLightivEXT (GLenum light, GLenum pname, GLint* params) + void glFragmentMaterialfEXT (GLenum face, GLenum pname, const GLfloat param) + void glFragmentMaterialfvEXT (GLenum face, GLenum pname, const GLfloat* params) + void glFragmentMaterialiEXT (GLenum face, GLenum pname, const GLint param) + void glFragmentMaterialivEXT (GLenum face, GLenum pname, const GLint* params) + void glGetFragmentLightfvEXT (GLenum light, GLenum pname, GLfloat* params) + void glGetFragmentLightivEXT (GLenum light, GLenum pname, GLint* params) + void glGetFragmentMaterialfvEXT (GLenum face, GLenum pname, const GLfloat* params) + void glGetFragmentMaterialivEXT (GLenum face, GLenum pname, const GLint* params) + void glLightEnviEXT (GLenum pname, GLint param) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_blit b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_blit new file mode 100644 index 00000000..973485a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_blit @@ -0,0 +1,9 @@ +GL_EXT_framebuffer_blit +http://www.opengl.org/registry/specs/EXT/framebuffer_blit.txt +GL_EXT_framebuffer_blit + + GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 + GL_READ_FRAMEBUFFER_EXT 0x8CA8 + GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + void glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_multisample b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_multisample new file mode 100644 index 00000000..dc4df984 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_multisample @@ -0,0 +1,10 @@ +GL_EXT_framebuffer_multisample +http://www.opengl.org/registry/specs/EXT/framebuffer_multisample.txt +GL_EXT_framebuffer_multisample + + GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 + GL_MAX_SAMPLES_EXT 0x8D57 + void glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 + GL_MAX_SAMPLES_EXT 0x8D57 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_multisample_blit_scaled b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_multisample_blit_scaled new file mode 100644 index 00000000..02fff147 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_multisample_blit_scaled @@ -0,0 +1,6 @@ +GL_EXT_framebuffer_multisample_blit_scaled +http://www.opengl.org/registry/specs/EXT/framebuffer_multisample_blit_scaled.txt +GL_EXT_framebuffer_multisample_blit_scaled + + GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA + GL_SCALED_RESOLVE_NICEST_EXT 0x90BB diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_object b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_object new file mode 100644 index 00000000..8a0475c4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_object @@ -0,0 +1,72 @@ +GL_EXT_framebuffer_object +http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt +GL_EXT_framebuffer_object + + GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 + GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 + GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 + GL_RENDERBUFFER_BINDING_EXT 0x8CA7 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 + GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 + GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 + GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC + GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD + GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF + GL_COLOR_ATTACHMENT0_EXT 0x8CE0 + GL_COLOR_ATTACHMENT1_EXT 0x8CE1 + GL_COLOR_ATTACHMENT2_EXT 0x8CE2 + GL_COLOR_ATTACHMENT3_EXT 0x8CE3 + GL_COLOR_ATTACHMENT4_EXT 0x8CE4 + GL_COLOR_ATTACHMENT5_EXT 0x8CE5 + GL_COLOR_ATTACHMENT6_EXT 0x8CE6 + GL_COLOR_ATTACHMENT7_EXT 0x8CE7 + GL_COLOR_ATTACHMENT8_EXT 0x8CE8 + GL_COLOR_ATTACHMENT9_EXT 0x8CE9 + GL_COLOR_ATTACHMENT10_EXT 0x8CEA + GL_COLOR_ATTACHMENT11_EXT 0x8CEB + GL_COLOR_ATTACHMENT12_EXT 0x8CEC + GL_COLOR_ATTACHMENT13_EXT 0x8CED + GL_COLOR_ATTACHMENT14_EXT 0x8CEE + GL_COLOR_ATTACHMENT15_EXT 0x8CEF + GL_DEPTH_ATTACHMENT_EXT 0x8D00 + GL_STENCIL_ATTACHMENT_EXT 0x8D20 + GL_FRAMEBUFFER_EXT 0x8D40 + GL_RENDERBUFFER_EXT 0x8D41 + GL_RENDERBUFFER_WIDTH_EXT 0x8D42 + GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 + GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 + GL_STENCIL_INDEX1_EXT 0x8D46 + GL_STENCIL_INDEX4_EXT 0x8D47 + GL_STENCIL_INDEX8_EXT 0x8D48 + GL_STENCIL_INDEX16_EXT 0x8D49 + GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 + GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 + GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 + GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 + GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 + GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + void glBindFramebufferEXT (GLenum target, GLuint framebuffer) + void glBindRenderbufferEXT (GLenum target, GLuint renderbuffer) + GLenum glCheckFramebufferStatusEXT (GLenum target) + void glDeleteFramebuffersEXT (GLsizei n, const GLuint* framebuffers) + void glDeleteRenderbuffersEXT (GLsizei n, const GLuint* renderbuffers) + void glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) + void glGenFramebuffersEXT (GLsizei n, GLuint* framebuffers) + void glGenRenderbuffersEXT (GLsizei n, GLuint* renderbuffers) + void glGenerateMipmapEXT (GLenum target) + void glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint* params) + void glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint* params) + GLboolean glIsFramebufferEXT (GLuint framebuffer) + GLboolean glIsRenderbufferEXT (GLuint renderbuffer) + void glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_sRGB b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_sRGB new file mode 100644 index 00000000..2f4c6ff3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_framebuffer_sRGB @@ -0,0 +1,6 @@ +GL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GL_EXT_framebuffer_sRGB + + GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_geometry_point_size b/Windows/glew/auto/extensions/gl/GL_EXT_geometry_point_size new file mode 100644 index 00000000..6aa7f12c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_geometry_point_size @@ -0,0 +1,37 @@ +GL_EXT_geometry_point_size +http://www.opengl.org/registry/specs/EXT/geometry_shader.txt +GL_EXT_geometry_point_size + + GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 + GL_LINES_ADJACENCY_EXT 0xA + GL_LINE_STRIP_ADJACENCY_EXT 0xB + GL_TRIANGLES_ADJACENCY_EXT 0xC + GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD + GL_LAYER_PROVOKING_VERTEX_EXT 0x825E + GL_UNDEFINED_VERTEX_EXT 0x8260 + GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F + GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 + GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 + GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 + GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 + GL_PRIMITIVES_GENERATED_EXT 0x8C87 + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 + GL_GEOMETRY_SHADER_EXT 0x8DD9 + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D + GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E + GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A + GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 + GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF + GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 + GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 + GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 + GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_geometry_shader b/Windows/glew/auto/extensions/gl/GL_EXT_geometry_shader new file mode 100644 index 00000000..0a644e18 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_geometry_shader @@ -0,0 +1,37 @@ +GL_EXT_geometry_shader +http://www.opengl.org/registry/specs/EXT/geometry_shader.txt +GL_EXT_geometry_shader + + GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 + GL_LINES_ADJACENCY_EXT 0xA + GL_LINE_STRIP_ADJACENCY_EXT 0xB + GL_TRIANGLES_ADJACENCY_EXT 0xC + GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD + GL_LAYER_PROVOKING_VERTEX_EXT 0x825E + GL_UNDEFINED_VERTEX_EXT 0x8260 + GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F + GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 + GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 + GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 + GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 + GL_PRIMITIVES_GENERATED_EXT 0x8C87 + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 + GL_GEOMETRY_SHADER_EXT 0x8DD9 + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D + GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E + GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A + GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 + GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF + GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 + GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 + GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 + GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_geometry_shader4 b/Windows/glew/auto/extensions/gl/GL_EXT_geometry_shader4 new file mode 100644 index 00000000..a463c4cb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_geometry_shader4 @@ -0,0 +1,27 @@ +GL_EXT_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_geometry_shader4.txt +GL_EXT_geometry_shader4 + + GL_GEOMETRY_SHADER_EXT 0x8DD9 + GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD + GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE + GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA + GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB + GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 + GL_LINES_ADJACENCY_EXT 0xA + GL_LINE_STRIP_ADJACENCY_EXT 0xB + GL_TRIANGLES_ADJACENCY_EXT 0xC + GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 + GL_PROGRAM_POINT_SIZE_EXT 0x8642 + void glProgramParameteriEXT (GLuint program, GLenum pname, GLint value) + void glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level) + void glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_gpu_program_parameters b/Windows/glew/auto/extensions/gl/GL_EXT_gpu_program_parameters new file mode 100644 index 00000000..298bc36f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_gpu_program_parameters @@ -0,0 +1,6 @@ +GL_EXT_gpu_program_parameters +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_program_parameters.txt +GL_EXT_gpu_program_parameters + + void glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) + void glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_gpu_shader4 b/Windows/glew/auto/extensions/gl/GL_EXT_gpu_shader4 new file mode 100644 index 00000000..7e95dbce --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_gpu_shader4 @@ -0,0 +1,64 @@ +GL_EXT_gpu_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_shader4.txt +GL_EXT_gpu_shader4 + + GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 + GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 + GL_SAMPLER_BUFFER_EXT 0x8DC2 + GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 + GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 + GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 + GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 + GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 + GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 + GL_INT_SAMPLER_1D_EXT 0x8DC9 + GL_INT_SAMPLER_2D_EXT 0x8DCA + GL_INT_SAMPLER_3D_EXT 0x8DCB + GL_INT_SAMPLER_CUBE_EXT 0x8DCC + GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD + GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE + GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF + GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 + GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 + GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 + GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 + GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 + GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 + GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD + void glGetUniformuivEXT (GLuint program, GLint location, GLuint *params) + void glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name) + GLint glGetFragDataLocationEXT (GLuint program, const GLchar *name) + void glUniform1uiEXT (GLint location, GLuint v0) + void glUniform2uiEXT (GLint location, GLuint v0, GLuint v1) + void glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2) + void glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value) + void glVertexAttribI1iEXT (GLuint index, GLint x) + void glVertexAttribI2iEXT (GLuint index, GLint x, GLint y) + void glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z) + void glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w) + void glVertexAttribI1uiEXT (GLuint index, GLuint x) + void glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y) + void glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z) + void glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glVertexAttribI1ivEXT (GLuint index, const GLint *v) + void glVertexAttribI2ivEXT (GLuint index, const GLint *v) + void glVertexAttribI3ivEXT (GLuint index, const GLint *v) + void glVertexAttribI4ivEXT (GLuint index, const GLint *v) + void glVertexAttribI1uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI2uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI3uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4bvEXT (GLuint index, const GLbyte *v) + void glVertexAttribI4svEXT (GLuint index, const GLshort *v) + void glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v) + void glVertexAttribI4usvEXT (GLuint index, const GLushort *v) + void glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer) + void glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params) + void glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_gpu_shader5 b/Windows/glew/auto/extensions/gl/GL_EXT_gpu_shader5 new file mode 100644 index 00000000..349eb7cb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_gpu_shader5 @@ -0,0 +1,4 @@ +GL_EXT_gpu_shader5 +http://www.opengl.org/registry/specs/EXT/gpu_shader5.txt +GL_EXT_gpu_shader5 + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_histogram b/Windows/glew/auto/extensions/gl/GL_EXT_histogram new file mode 100644 index 00000000..0c93f84e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_histogram @@ -0,0 +1,27 @@ +GL_EXT_histogram +http://www.opengl.org/registry/specs/EXT/histogram.txt +GL_EXT_histogram + + GL_HISTOGRAM_EXT 0x8024 + GL_PROXY_HISTOGRAM_EXT 0x8025 + GL_HISTOGRAM_WIDTH_EXT 0x8026 + GL_HISTOGRAM_FORMAT_EXT 0x8027 + GL_HISTOGRAM_RED_SIZE_EXT 0x8028 + GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 + GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A + GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B + GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C + GL_HISTOGRAM_SINK_EXT 0x802D + GL_MINMAX_EXT 0x802E + GL_MINMAX_FORMAT_EXT 0x802F + GL_MINMAX_SINK_EXT 0x8030 + void glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values) + void glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint* params) + void glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values) + void glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint* params) + void glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) + void glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink) + void glResetHistogramEXT (GLenum target) + void glResetMinmaxEXT (GLenum target) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_index_array_formats b/Windows/glew/auto/extensions/gl/GL_EXT_index_array_formats new file mode 100644 index 00000000..d16285a7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_index_array_formats @@ -0,0 +1,4 @@ +GL_EXT_index_array_formats +http://www.opengl.org/registry/specs/EXT/index_array_formats.txt +GL_EXT_index_array_formats + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_index_func b/Windows/glew/auto/extensions/gl/GL_EXT_index_func new file mode 100644 index 00000000..a4e32621 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_index_func @@ -0,0 +1,5 @@ +GL_EXT_index_func +http://www.opengl.org/registry/specs/EXT/index_func.txt +GL_EXT_index_func + + void glIndexFuncEXT (GLenum func, GLfloat ref) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_index_material b/Windows/glew/auto/extensions/gl/GL_EXT_index_material new file mode 100644 index 00000000..e5bd1aff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_index_material @@ -0,0 +1,5 @@ +GL_EXT_index_material +http://www.opengl.org/registry/specs/EXT/index_material.txt +GL_EXT_index_material + + void glIndexMaterialEXT (GLenum face, GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_index_texture b/Windows/glew/auto/extensions/gl/GL_EXT_index_texture new file mode 100644 index 00000000..6dc8dc99 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_index_texture @@ -0,0 +1,4 @@ +GL_EXT_index_texture +http://www.opengl.org/registry/specs/EXT/index_texture.txt +GL_EXT_index_texture + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_instanced_arrays b/Windows/glew/auto/extensions/gl/GL_EXT_instanced_arrays new file mode 100644 index 00000000..158541b6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_instanced_arrays @@ -0,0 +1,6 @@ +GL_EXT_instanced_arrays +http://www.opengl.org/registry/specs/EXT/instanced_arrays.txt +GL_EXT_instanced_arrays + + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE + void glVertexAttribDivisorEXT (GLuint index, GLuint divisor) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_light_texture b/Windows/glew/auto/extensions/gl/GL_EXT_light_texture new file mode 100644 index 00000000..0cb0ad15 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_light_texture @@ -0,0 +1,16 @@ +GL_EXT_light_texture +http://www.opengl.org/registry/specs/EXT/light_texture.txt +GL_EXT_light_texture + + GL_FRAGMENT_MATERIAL_EXT 0x8349 + GL_FRAGMENT_NORMAL_EXT 0x834A + GL_FRAGMENT_COLOR_EXT 0x834C + GL_ATTENUATION_EXT 0x834D + GL_SHADOW_ATTENUATION_EXT 0x834E + GL_TEXTURE_APPLICATION_MODE_EXT 0x834F + GL_TEXTURE_LIGHT_EXT 0x8350 + GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 + GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + void glApplyTextureEXT (GLenum mode) + void glTextureLightEXT (GLenum pname) + void glTextureMaterialEXT (GLenum face, GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_map_buffer_range b/Windows/glew/auto/extensions/gl/GL_EXT_map_buffer_range new file mode 100644 index 00000000..d7e38907 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_map_buffer_range @@ -0,0 +1,12 @@ +GL_EXT_map_buffer_range +http://www.opengl.org/registry/specs/EXT/map_buffer_range.txt +GL_EXT_map_buffer_range + + GL_MAP_READ_BIT_EXT 0x0001 + GL_MAP_WRITE_BIT_EXT 0x0002 + GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 + GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 + GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 + GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 + void glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length) + void * glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_memory_object b/Windows/glew/auto/extensions/gl/GL_EXT_memory_object new file mode 100644 index 00000000..1f4531d4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_memory_object @@ -0,0 +1,41 @@ +GL_EXT_memory_object +http://www.opengl.org/registry/specs/EXT/external_objects.txt +GL_EXT_memory_object + + GL_UUID_SIZE_EXT 16 + GL_TEXTURE_TILING_EXT 0x9580 + GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 + GL_NUM_TILING_TYPES_EXT 0x9582 + GL_TILING_TYPES_EXT 0x9583 + GL_OPTIMAL_TILING_EXT 0x9584 + GL_LINEAR_TILING_EXT 0x9585 + GL_LAYOUT_GENERAL_EXT 0x958D + GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E + GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F + GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 + GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 + GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 + GL_LAYOUT_TRANSFER_DST_EXT 0x9593 + GL_NUM_DEVICE_UUIDS_EXT 0x9596 + GL_DEVICE_UUID_EXT 0x9597 + GL_DRIVER_UUID_EXT 0x9598 + GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B + void glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset) + void glCreateMemoryObjectsEXT (GLsizei n, GLuint* memoryObjects) + void glDeleteMemoryObjectsEXT (GLsizei n, const GLuint* memoryObjects) + void glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint* params) + void glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte* data) + void glGetUnsignedBytevEXT (GLenum pname, GLubyte* data) + GLboolean glIsMemoryObjectEXT (GLuint memoryObject) + void glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint* params) + void glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset) + void glTexStorageMem1DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset) + void glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset) + void glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) + void glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset) + void glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) + void glTextureStorageMem1DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset) + void glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset) + void glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) + void glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset) + void glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_memory_object_fd b/Windows/glew/auto/extensions/gl/GL_EXT_memory_object_fd new file mode 100644 index 00000000..38536c00 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_memory_object_fd @@ -0,0 +1,6 @@ +GL_EXT_memory_object_fd +http://www.opengl.org/registry/specs/EXT/external_objects_fd.txt +GL_EXT_memory_object_fd + + GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 + void glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_memory_object_win32 b/Windows/glew/auto/extensions/gl/GL_EXT_memory_object_win32 new file mode 100644 index 00000000..6d36a69a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_memory_object_win32 @@ -0,0 +1,17 @@ +GL_EXT_memory_object_win32 +http://www.opengl.org/registry/specs/EXT/external_objects_win32.txt +GL_EXT_memory_object_win32 + + GL_LUID_SIZE_EXT 8 + GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 + GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 + GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 + GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A + GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B + GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C + GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 + GL_D3D12_FENCE_VALUE_EXT 0x9595 + GL_DEVICE_LUID_EXT 0x9599 + GL_DEVICE_NODE_MASK_EXT 0x959A + void glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle) + void glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_misc_attribute b/Windows/glew/auto/extensions/gl/GL_EXT_misc_attribute new file mode 100644 index 00000000..d652c784 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_misc_attribute @@ -0,0 +1,4 @@ +GL_EXT_misc_attribute +http://www.opengl.org/registry/specs/EXT/misc_attribute.txt +GL_EXT_misc_attribute + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multi_draw_arrays b/Windows/glew/auto/extensions/gl/GL_EXT_multi_draw_arrays new file mode 100644 index 00000000..a3771198 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multi_draw_arrays @@ -0,0 +1,6 @@ +GL_EXT_multi_draw_arrays +http://www.opengl.org/registry/specs/EXT/multi_draw_arrays.txt +GL_EXT_multi_draw_arrays + + void glMultiDrawArraysEXT (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount) + void glMultiDrawElementsEXT (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multi_draw_indirect b/Windows/glew/auto/extensions/gl/GL_EXT_multi_draw_indirect new file mode 100644 index 00000000..cd8a0729 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multi_draw_indirect @@ -0,0 +1,6 @@ +GL_EXT_multi_draw_indirect +http://www.opengl.org/registry/specs/EXT/multi_draw_indirect.txt +GL_EXT_multi_draw_indirect + + void glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride) + void glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multiple_textures b/Windows/glew/auto/extensions/gl/GL_EXT_multiple_textures new file mode 100644 index 00000000..6f87b3d9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multiple_textures @@ -0,0 +1,4 @@ +GL_EXT_multiple_textures +http://www.opengl.org/registry/specs/EXT/multiple_textures.txt +GL_EXT_multiple_textures + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multisample b/Windows/glew/auto/extensions/gl/GL_EXT_multisample new file mode 100644 index 00000000..bc196c63 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multisample @@ -0,0 +1,23 @@ +GL_EXT_multisample +http://www.opengl.org/registry/specs/EXT/wgl_multisample.txt +GL_EXT_multisample + + GL_MULTISAMPLE_EXT 0x809D + GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E + GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F + GL_SAMPLE_MASK_EXT 0x80A0 + GL_1PASS_EXT 0x80A1 + GL_2PASS_0_EXT 0x80A2 + GL_2PASS_1_EXT 0x80A3 + GL_4PASS_0_EXT 0x80A4 + GL_4PASS_1_EXT 0x80A5 + GL_4PASS_2_EXT 0x80A6 + GL_4PASS_3_EXT 0x80A7 + GL_SAMPLE_BUFFERS_EXT 0x80A8 + GL_SAMPLES_EXT 0x80A9 + GL_SAMPLE_MASK_VALUE_EXT 0x80AA + GL_SAMPLE_MASK_INVERT_EXT 0x80AB + GL_SAMPLE_PATTERN_EXT 0x80AC + GL_MULTISAMPLE_BIT_EXT 0x20000000 + void glSampleMaskEXT (GLclampf value, GLboolean invert) + void glSamplePatternEXT (GLenum pattern) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multisample_compatibility b/Windows/glew/auto/extensions/gl/GL_EXT_multisample_compatibility new file mode 100644 index 00000000..632b4f68 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multisample_compatibility @@ -0,0 +1,6 @@ +GL_EXT_multisample_compatibility +http://www.opengl.org/registry/specs/EXT/multisample_compatibility.txt +GL_EXT_multisample_compatibility + + GL_MULTISAMPLE_EXT 0x809D + GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multisampled_render_to_texture b/Windows/glew/auto/extensions/gl/GL_EXT_multisampled_render_to_texture new file mode 100644 index 00000000..016c163a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multisampled_render_to_texture @@ -0,0 +1,9 @@ +GL_EXT_multisampled_render_to_texture +http://www.opengl.org/registry/specs/EXT/multisampled_render_to_texture.txt +GL_EXT_multisampled_render_to_texture + + GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 + GL_MAX_SAMPLES_EXT 0x8D57 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C + void glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multisampled_render_to_texture2 b/Windows/glew/auto/extensions/gl/GL_EXT_multisampled_render_to_texture2 new file mode 100644 index 00000000..700db879 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multisampled_render_to_texture2 @@ -0,0 +1,4 @@ +GL_EXT_multisampled_render_to_texture2 +http://www.opengl.org/registry/specs/EXT/multisampled_render_to_texture2.txt +GL_EXT_multisampled_render_to_texture2 + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_multiview_draw_buffers b/Windows/glew/auto/extensions/gl/GL_EXT_multiview_draw_buffers new file mode 100644 index 00000000..ad958804 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_multiview_draw_buffers @@ -0,0 +1,12 @@ +GL_EXT_multiview_draw_buffers +http://www.opengl.org/registry/specs/EXT/multiview_draw_buffers.txt +GL_EXT_multiview_draw_buffers + + GL_DRAW_BUFFER_EXT 0x0C01 + GL_READ_BUFFER_EXT 0x0C02 + GL_COLOR_ATTACHMENT_EXT 0x90F0 + GL_MULTIVIEW_EXT 0x90F1 + GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 + void glDrawBuffersIndexedEXT (GLint n, const GLenum* location, const GLint *indices) + void glGetIntegeri_vEXT (GLenum target, GLuint index, GLint* data) + void glReadBufferIndexedEXT (GLenum src, GLint index) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_packed_depth_stencil b/Windows/glew/auto/extensions/gl/GL_EXT_packed_depth_stencil new file mode 100644 index 00000000..4286446e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_packed_depth_stencil @@ -0,0 +1,8 @@ +GL_EXT_packed_depth_stencil +http://www.opengl.org/registry/specs/EXT/packed_depth_stencil.txt +GL_EXT_packed_depth_stencil + + GL_DEPTH_STENCIL_EXT 0x84F9 + GL_UNSIGNED_INT_24_8_EXT 0x84FA + GL_DEPTH24_STENCIL8_EXT 0x88F0 + GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_packed_float b/Windows/glew/auto/extensions/gl/GL_EXT_packed_float new file mode 100644 index 00000000..15ac6800 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_packed_float @@ -0,0 +1,7 @@ +GL_EXT_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GL_EXT_packed_float + + GL_R11F_G11F_B10F_EXT 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B + GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_packed_pixels b/Windows/glew/auto/extensions/gl/GL_EXT_packed_pixels new file mode 100644 index 00000000..4a109bfe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_packed_pixels @@ -0,0 +1,9 @@ +GL_EXT_packed_pixels +http://www.opengl.org/registry/specs/EXT/packed_pixels.txt +GL_EXT_packed_pixels + + GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 + GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 + GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 + GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 + GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_paletted_texture b/Windows/glew/auto/extensions/gl/GL_EXT_paletted_texture new file mode 100644 index 00000000..ab94b3b3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_paletted_texture @@ -0,0 +1,29 @@ +GL_EXT_paletted_texture +http://www.opengl.org/registry/specs/EXT/paletted_texture.txt +GL_EXT_paletted_texture + + GL_TEXTURE_1D 0x0DE0 + GL_TEXTURE_2D 0x0DE1 + GL_PROXY_TEXTURE_1D 0x8063 + GL_PROXY_TEXTURE_2D 0x8064 + GL_COLOR_TABLE_FORMAT_EXT 0x80D8 + GL_COLOR_TABLE_WIDTH_EXT 0x80D9 + GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA + GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB + GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF + GL_COLOR_INDEX1_EXT 0x80E2 + GL_COLOR_INDEX2_EXT 0x80E3 + GL_COLOR_INDEX4_EXT 0x80E4 + GL_COLOR_INDEX8_EXT 0x80E5 + GL_COLOR_INDEX12_EXT 0x80E6 + GL_COLOR_INDEX16_EXT 0x80E7 + GL_TEXTURE_INDEX_SIZE_EXT 0x80ED + GL_TEXTURE_CUBE_MAP_ARB 0x8513 + GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + void glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data) + void glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data) + void glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_pixel_buffer_object b/Windows/glew/auto/extensions/gl/GL_EXT_pixel_buffer_object new file mode 100644 index 00000000..f685e4c8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_pixel_buffer_object @@ -0,0 +1,8 @@ +GL_EXT_pixel_buffer_object +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_pixel_buffer_object.txt +GL_EXT_pixel_buffer_object + + GL_PIXEL_PACK_BUFFER_EXT 0x88EB + GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_pixel_transform b/Windows/glew/auto/extensions/gl/GL_EXT_pixel_transform new file mode 100644 index 00000000..063c919c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_pixel_transform @@ -0,0 +1,19 @@ +GL_EXT_pixel_transform +http://www.opengl.org/registry/specs/EXT/pixel_transform.txt +GL_EXT_pixel_transform + + GL_PIXEL_TRANSFORM_2D_EXT 0x8330 + GL_PIXEL_MAG_FILTER_EXT 0x8331 + GL_PIXEL_MIN_FILTER_EXT 0x8332 + GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 + GL_CUBIC_EXT 0x8334 + GL_AVERAGE_EXT 0x8335 + GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 + GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 + GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + void glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat* params) + void glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint* params) + void glPixelTransformParameterfEXT (GLenum target, GLenum pname, const GLfloat param) + void glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat* params) + void glPixelTransformParameteriEXT (GLenum target, GLenum pname, const GLint param) + void glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_pixel_transform_color_table b/Windows/glew/auto/extensions/gl/GL_EXT_pixel_transform_color_table new file mode 100644 index 00000000..cb9c244f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_pixel_transform_color_table @@ -0,0 +1,4 @@ +GL_EXT_pixel_transform_color_table +http://www.opengl.org/registry/specs/EXT/pixel_transform_color_table.txt +GL_EXT_pixel_transform_color_table + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_point_parameters b/Windows/glew/auto/extensions/gl/GL_EXT_point_parameters new file mode 100644 index 00000000..f30f88dc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_point_parameters @@ -0,0 +1,10 @@ +GL_EXT_point_parameters +http://www.opengl.org/registry/specs/EXT/point_parameters.txt +GL_EXT_point_parameters + + GL_POINT_SIZE_MIN_EXT 0x8126 + GL_POINT_SIZE_MAX_EXT 0x8127 + GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 + GL_DISTANCE_ATTENUATION_EXT 0x8129 + void glPointParameterfEXT (GLenum pname, GLfloat param) + void glPointParameterfvEXT (GLenum pname, const GLfloat* params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_polygon_offset b/Windows/glew/auto/extensions/gl/GL_EXT_polygon_offset new file mode 100644 index 00000000..41d15ee9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_polygon_offset @@ -0,0 +1,8 @@ +GL_EXT_polygon_offset +http://www.opengl.org/registry/specs/EXT/polygon_offset.txt +GL_EXT_polygon_offset + + GL_POLYGON_OFFSET_EXT 0x8037 + GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 + GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + void glPolygonOffsetEXT (GLfloat factor, GLfloat bias) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_polygon_offset_clamp b/Windows/glew/auto/extensions/gl/GL_EXT_polygon_offset_clamp new file mode 100644 index 00000000..404db0af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_polygon_offset_clamp @@ -0,0 +1,6 @@ +GL_EXT_polygon_offset_clamp +http://www.opengl.org/registry/specs/EXT/polygon_offset_clamp.txt +GL_EXT_polygon_offset_clamp + + GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B + void glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_post_depth_coverage b/Windows/glew/auto/extensions/gl/GL_EXT_post_depth_coverage new file mode 100644 index 00000000..08cca40f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_post_depth_coverage @@ -0,0 +1,4 @@ +GL_EXT_post_depth_coverage +http://www.opengl.org/registry/specs/EXT/post_depth_coverage.txt +GL_EXT_post_depth_coverage + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_provoking_vertex b/Windows/glew/auto/extensions/gl/GL_EXT_provoking_vertex new file mode 100644 index 00000000..ef28bd92 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_provoking_vertex @@ -0,0 +1,9 @@ +GL_EXT_provoking_vertex +http://www.opengl.org/registry/specs/EXT/provoking_vertex.txt +GL_EXT_provoking_vertex + + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C + GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D + GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E + GL_PROVOKING_VERTEX_EXT 0x8E4F + void glProvokingVertexEXT (GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_pvrtc_sRGB b/Windows/glew/auto/extensions/gl/GL_EXT_pvrtc_sRGB new file mode 100644 index 00000000..16d7ed0c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_pvrtc_sRGB @@ -0,0 +1,8 @@ +GL_EXT_pvrtc_sRGB +http://www.opengl.org/registry/specs/EXT/pvrtc_sRGB.txt +GL_EXT_pvrtc_sRGB + + GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 + GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 + GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 + GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_raster_multisample b/Windows/glew/auto/extensions/gl/GL_EXT_raster_multisample new file mode 100644 index 00000000..faee3d52 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_raster_multisample @@ -0,0 +1,22 @@ +GL_EXT_raster_multisample +http://www.opengl.org/registry/specs/NV/framebuffer_mixed_samples.txt +GL_EXT_raster_multisample + + GL_COLOR_SAMPLES_NV 0x8E20 + GL_RASTER_MULTISAMPLE_EXT 0x9327 + GL_RASTER_SAMPLES_EXT 0x9328 + GL_MAX_RASTER_SAMPLES_EXT 0x9329 + GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A + GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B + GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C + GL_DEPTH_SAMPLES_NV 0x932D + GL_STENCIL_SAMPLES_NV 0x932E + GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F + GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 + GL_COVERAGE_MODULATION_TABLE_NV 0x9331 + GL_COVERAGE_MODULATION_NV 0x9332 + GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + void glCoverageModulationNV (GLenum components) + void glCoverageModulationTableNV (GLsizei n, const GLfloat* v) + void glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat* v) + void glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_read_format_bgra b/Windows/glew/auto/extensions/gl/GL_EXT_read_format_bgra new file mode 100644 index 00000000..7088dde6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_read_format_bgra @@ -0,0 +1,7 @@ +GL_EXT_read_format_bgra +http://www.opengl.org/registry/specs/EXT/read_format_bgra.txt +GL_EXT_read_format_bgra + + GL_BGRA_EXT 0x80E1 + GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 + GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_render_snorm b/Windows/glew/auto/extensions/gl/GL_EXT_render_snorm new file mode 100644 index 00000000..7bd94b10 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_render_snorm @@ -0,0 +1,12 @@ +GL_EXT_render_snorm +http://www.opengl.org/registry/specs/EXT/render_snorm.txt +GL_EXT_render_snorm + + GL_BYTE 0x1400 + GL_SHORT 0x1402 + GL_R8_SNORM 0x8F94 + GL_RG8_SNORM 0x8F95 + GL_RGBA8_SNORM 0x8F97 + GL_R16_SNORM_EXT 0x8F98 + GL_RG16_SNORM_EXT 0x8F99 + GL_RGBA16_SNORM_EXT 0x8F9B diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_rescale_normal b/Windows/glew/auto/extensions/gl/GL_EXT_rescale_normal new file mode 100644 index 00000000..fa025ae2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_rescale_normal @@ -0,0 +1,5 @@ +GL_EXT_rescale_normal +http://www.opengl.org/registry/specs/EXT/rescale_normal.txt +GL_EXT_rescale_normal + + GL_RESCALE_NORMAL_EXT 0x803A diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_sRGB b/Windows/glew/auto/extensions/gl/GL_EXT_sRGB new file mode 100644 index 00000000..e5fc229e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_sRGB @@ -0,0 +1,8 @@ +GL_EXT_sRGB +http://www.opengl.org/registry/specs/EXT/sRGB.txt +GL_EXT_sRGB + + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 + GL_SRGB_EXT 0x8C40 + GL_SRGB_ALPHA_EXT 0x8C42 + GL_SRGB8_ALPHA8_EXT 0x8C43 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_sRGB_write_control b/Windows/glew/auto/extensions/gl/GL_EXT_sRGB_write_control new file mode 100644 index 00000000..787a2c4b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_sRGB_write_control @@ -0,0 +1,5 @@ +GL_EXT_sRGB_write_control +http://www.opengl.org/registry/specs/EXT/sRGB_write_control.txt +GL_EXT_sRGB_write_control + + GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_scene_marker b/Windows/glew/auto/extensions/gl/GL_EXT_scene_marker new file mode 100644 index 00000000..1d8217c3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_scene_marker @@ -0,0 +1,6 @@ +GL_EXT_scene_marker +http://www.opengl.org/registry/specs/EXT/scene_marker.txt +GL_EXT_scene_marker + + void glBeginSceneEXT (void) + void glEndSceneEXT (void) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_secondary_color b/Windows/glew/auto/extensions/gl/GL_EXT_secondary_color new file mode 100644 index 00000000..505761d2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_secondary_color @@ -0,0 +1,28 @@ +GL_EXT_secondary_color +http://oss.sgi.com/projects/ogl-sample/registry/EXT/secondary_color.txt +GL_EXT_secondary_color + + GL_COLOR_SUM_EXT 0x8458 + GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C + GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D + GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + void glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue) + void glSecondaryColor3bvEXT (const GLbyte *v) + void glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue) + void glSecondaryColor3dvEXT (const GLdouble *v) + void glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue) + void glSecondaryColor3fvEXT (const GLfloat *v) + void glSecondaryColor3iEXT (GLint red, GLint green, GLint blue) + void glSecondaryColor3ivEXT (const GLint *v) + void glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue) + void glSecondaryColor3svEXT (const GLshort *v) + void glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue) + void glSecondaryColor3ubvEXT (const GLubyte *v) + void glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue) + void glSecondaryColor3uivEXT (const GLuint *v) + void glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue) + void glSecondaryColor3usvEXT (const GLushort *v) + void glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_semaphore b/Windows/glew/auto/extensions/gl/GL_EXT_semaphore new file mode 100644 index 00000000..2e774d10 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_semaphore @@ -0,0 +1,11 @@ +GL_EXT_semaphore +http://www.opengl.org/registry/specs/EXT/external_objects.txt +GL_EXT_semaphore + + void glDeleteSemaphoresEXT (GLsizei n, const GLuint* semaphores) + void glGenSemaphoresEXT (GLsizei n, GLuint* semaphores) + void glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64* params) + GLboolean glIsSemaphoreEXT (GLuint semaphore) + void glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64* params) + void glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts) + void glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_semaphore_fd b/Windows/glew/auto/extensions/gl/GL_EXT_semaphore_fd new file mode 100644 index 00000000..e3b2985b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_semaphore_fd @@ -0,0 +1,5 @@ +GL_EXT_semaphore_fd +http://www.opengl.org/registry/specs/EXT/external_objects_fd.txt +GL_EXT_semaphore_fd + + void glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_semaphore_win32 b/Windows/glew/auto/extensions/gl/GL_EXT_semaphore_win32 new file mode 100644 index 00000000..4854f58f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_semaphore_win32 @@ -0,0 +1,6 @@ +GL_EXT_semaphore_win32 +http://www.opengl.org/registry/specs/EXT/external_objects_win32.txt +GL_EXT_semaphore_win32 + + void glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle) + void glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_separate_shader_objects b/Windows/glew/auto/extensions/gl/GL_EXT_separate_shader_objects new file mode 100644 index 00000000..9e43c8dd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_separate_shader_objects @@ -0,0 +1,8 @@ +GL_EXT_separate_shader_objects +http://www.opengl.org/registry/specs/EXT/separate_shader_objects.txt +GL_EXT_separate_shader_objects + + GL_ACTIVE_PROGRAM_EXT 0x8B8D + void glActiveProgramEXT (GLuint program) + GLuint glCreateShaderProgramEXT (GLenum type, const GLchar* string) + void glUseShaderProgramEXT (GLenum type, GLuint program) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_separate_specular_color b/Windows/glew/auto/extensions/gl/GL_EXT_separate_specular_color new file mode 100644 index 00000000..a6607c00 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_separate_specular_color @@ -0,0 +1,7 @@ +GL_EXT_separate_specular_color +http://www.opengl.org/registry/specs/EXT/separate_specular_color.txt +GL_EXT_separate_specular_color + + GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 + GL_SINGLE_COLOR_EXT 0x81F9 + GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_framebuffer_fetch b/Windows/glew/auto/extensions/gl/GL_EXT_shader_framebuffer_fetch new file mode 100644 index 00000000..633a92f2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_framebuffer_fetch @@ -0,0 +1,5 @@ +GL_EXT_shader_framebuffer_fetch +http://www.opengl.org/registry/specs/EXT/shader_framebuffer_fetch.txt +GL_EXT_shader_framebuffer_fetch + + GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_group_vote b/Windows/glew/auto/extensions/gl/GL_EXT_shader_group_vote new file mode 100644 index 00000000..69c32bb2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_group_vote @@ -0,0 +1,4 @@ +GL_EXT_shader_group_vote +http://www.opengl.org/registry/specs/EXT/shader_group_vote.txt +GL_EXT_shader_group_vote + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_image_load_formatted b/Windows/glew/auto/extensions/gl/GL_EXT_shader_image_load_formatted new file mode 100644 index 00000000..5bf38795 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_image_load_formatted @@ -0,0 +1,4 @@ +GL_EXT_shader_image_load_formatted +http://www.opengl.org/registry/specs/EXT/shader_image_load_formatted.txt +GL_EXT_shader_image_load_formatted + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_image_load_store b/Windows/glew/auto/extensions/gl/GL_EXT_shader_image_load_store new file mode 100644 index 00000000..8a65c7b8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_image_load_store @@ -0,0 +1,61 @@ +GL_EXT_shader_image_load_store +http://www.opengl.org/registry/specs/EXT/shader_image_load_store.txt +GL_EXT_shader_image_load_store + + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 + GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 + GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 + GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 + GL_COMMAND_BARRIER_BIT_EXT 0x00000040 + GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 + GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 + GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 + GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 + GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 + GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 + GL_MAX_IMAGE_UNITS_EXT 0x8F38 + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 + GL_IMAGE_BINDING_NAME_EXT 0x8F3A + GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B + GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C + GL_IMAGE_BINDING_LAYER_EXT 0x8F3D + GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E + GL_IMAGE_1D_EXT 0x904C + GL_IMAGE_2D_EXT 0x904D + GL_IMAGE_3D_EXT 0x904E + GL_IMAGE_2D_RECT_EXT 0x904F + GL_IMAGE_CUBE_EXT 0x9050 + GL_IMAGE_BUFFER_EXT 0x9051 + GL_IMAGE_1D_ARRAY_EXT 0x9052 + GL_IMAGE_2D_ARRAY_EXT 0x9053 + GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 + GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 + GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 + GL_INT_IMAGE_1D_EXT 0x9057 + GL_INT_IMAGE_2D_EXT 0x9058 + GL_INT_IMAGE_3D_EXT 0x9059 + GL_INT_IMAGE_2D_RECT_EXT 0x905A + GL_INT_IMAGE_CUBE_EXT 0x905B + GL_INT_IMAGE_BUFFER_EXT 0x905C + GL_INT_IMAGE_1D_ARRAY_EXT 0x905D + GL_INT_IMAGE_2D_ARRAY_EXT 0x905E + GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F + GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 + GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 + GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 + GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 + GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 + GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 + GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 + GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 + GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C + GL_MAX_IMAGE_SAMPLES_EXT 0x906D + GL_IMAGE_BINDING_FORMAT_EXT 0x906E + GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + void glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format) + void glMemoryBarrierEXT (GLbitfield barriers) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_implicit_conversions b/Windows/glew/auto/extensions/gl/GL_EXT_shader_implicit_conversions new file mode 100644 index 00000000..0e04e0c6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_implicit_conversions @@ -0,0 +1,4 @@ +GL_EXT_shader_implicit_conversions +http://www.opengl.org/registry/specs/EXT/shader_implicit_conversions.txt +GL_EXT_shader_implicit_conversions + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_integer_mix b/Windows/glew/auto/extensions/gl/GL_EXT_shader_integer_mix new file mode 100644 index 00000000..3a94a3da --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_integer_mix @@ -0,0 +1,4 @@ +GL_EXT_shader_integer_mix +http://www.opengl.org/registry/specs/EXT/shader_integer_mix.txt +GL_EXT_shader_integer_mix + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_io_blocks b/Windows/glew/auto/extensions/gl/GL_EXT_shader_io_blocks new file mode 100644 index 00000000..9d115a9b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_io_blocks @@ -0,0 +1,4 @@ +GL_EXT_shader_io_blocks +http://www.opengl.org/registry/specs/EXT/shader_io_blocks.txt +GL_EXT_shader_io_blocks + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_non_constant_global_initializers b/Windows/glew/auto/extensions/gl/GL_EXT_shader_non_constant_global_initializers new file mode 100644 index 00000000..b3762354 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_non_constant_global_initializers @@ -0,0 +1,4 @@ +GL_EXT_shader_non_constant_global_initializers +http://www.opengl.org/registry/specs/EXT/shader_non_constant_global_initializers.txt +GL_EXT_shader_non_constant_global_initializers + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_pixel_local_storage b/Windows/glew/auto/extensions/gl/GL_EXT_shader_pixel_local_storage new file mode 100644 index 00000000..db91d84c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_pixel_local_storage @@ -0,0 +1,7 @@ +GL_EXT_shader_pixel_local_storage +http://www.opengl.org/registry/specs/EXT/shader_pixel_local_storage.txt +GL_EXT_shader_pixel_local_storage + + GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 + GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 + GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_pixel_local_storage2 b/Windows/glew/auto/extensions/gl/GL_EXT_shader_pixel_local_storage2 new file mode 100644 index 00000000..c1ddc6df --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_pixel_local_storage2 @@ -0,0 +1,10 @@ +GL_EXT_shader_pixel_local_storage2 +http://www.opengl.org/registry/specs/EXT/shader_pixel_local_storage2.txt +GL_EXT_shader_pixel_local_storage2 + + GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 + GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 + GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 + void glClearPixelLocalStorageuiEXT (GLsizei offset, GLsizei n, const GLuint* values) + void glFramebufferPixelLocalStorageSizeEXT (GLuint target, GLsizei size) + GLsizei glGetFramebufferPixelLocalStorageSizeEXT (GLuint target) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shader_texture_lod b/Windows/glew/auto/extensions/gl/GL_EXT_shader_texture_lod new file mode 100644 index 00000000..82df2fe2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shader_texture_lod @@ -0,0 +1,4 @@ +GL_EXT_shader_texture_lod +http://www.opengl.org/registry/specs/EXT/shader_texture_lod.txt +GL_EXT_shader_texture_lod + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shadow_funcs b/Windows/glew/auto/extensions/gl/GL_EXT_shadow_funcs new file mode 100644 index 00000000..d1896f97 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shadow_funcs @@ -0,0 +1,4 @@ +GL_EXT_shadow_funcs +http://www.opengl.org/registry/specs/EXT/shadow_funcs.txt +GL_EXT_shadow_funcs + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shadow_samplers b/Windows/glew/auto/extensions/gl/GL_EXT_shadow_samplers new file mode 100644 index 00000000..c67c6513 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shadow_samplers @@ -0,0 +1,8 @@ +GL_EXT_shadow_samplers +http://www.opengl.org/registry/specs/EXT/shadow_samplers.txt +GL_EXT_shadow_samplers + + GL_TEXTURE_COMPARE_MODE_EXT 0x884C + GL_TEXTURE_COMPARE_FUNC_EXT 0x884D + GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E + GL_SAMPLER_2D_SHADOW_EXT 0x8B62 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_shared_texture_palette b/Windows/glew/auto/extensions/gl/GL_EXT_shared_texture_palette new file mode 100644 index 00000000..39318bdf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_shared_texture_palette @@ -0,0 +1,5 @@ +GL_EXT_shared_texture_palette +http://www.opengl.org/registry/specs/EXT/shared_texture_palette.txt +GL_EXT_shared_texture_palette + + GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_sparse_texture b/Windows/glew/auto/extensions/gl/GL_EXT_sparse_texture new file mode 100644 index 00000000..a7f20622 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_sparse_texture @@ -0,0 +1,22 @@ +GL_EXT_sparse_texture +http://www.opengl.org/registry/specs/EXT/sparse_texture.txt +GL_EXT_sparse_texture + + GL_TEXTURE_2D 0x0DE1 + GL_TEXTURE_3D 0x806F + GL_TEXTURE_CUBE_MAP 0x8513 + GL_TEXTURE_2D_ARRAY 0x8C1A + GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 + GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 + GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 + GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 + GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 + GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 + GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A + GL_TEXTURE_SPARSE_EXT 0x91A6 + GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 + GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 + GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 + GL_NUM_SPARSE_LEVELS_EXT 0x91AA + void glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) + void glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_sparse_texture2 b/Windows/glew/auto/extensions/gl/GL_EXT_sparse_texture2 new file mode 100644 index 00000000..87f27e05 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_sparse_texture2 @@ -0,0 +1,4 @@ +GL_EXT_sparse_texture2 +http://www.opengl.org/registry/specs/EXT/sparse_texture2.txt +GL_EXT_sparse_texture2 + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_stencil_clear_tag b/Windows/glew/auto/extensions/gl/GL_EXT_stencil_clear_tag new file mode 100644 index 00000000..a4a2a619 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_stencil_clear_tag @@ -0,0 +1,6 @@ +GL_EXT_stencil_clear_tag +http://www.opengl.org/registry/specs/EXT/stencil_clear_tag.txt +GL_EXT_stencil_clear_tag + + GL_STENCIL_TAG_BITS_EXT 0x88F2 + GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_stencil_two_side b/Windows/glew/auto/extensions/gl/GL_EXT_stencil_two_side new file mode 100644 index 00000000..be253157 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_stencil_two_side @@ -0,0 +1,7 @@ +GL_EXT_stencil_two_side +http://www.opengl.org/registry/specs/EXT/stencil_two_side.txt +GL_EXT_stencil_two_side + + GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 + GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + void glActiveStencilFaceEXT (GLenum face) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_stencil_wrap b/Windows/glew/auto/extensions/gl/GL_EXT_stencil_wrap new file mode 100644 index 00000000..7b4eab8f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_stencil_wrap @@ -0,0 +1,6 @@ +GL_EXT_stencil_wrap +http://www.opengl.org/registry/specs/EXT/stencil_wrap.txt +GL_EXT_stencil_wrap + + GL_INCR_WRAP_EXT 0x8507 + GL_DECR_WRAP_EXT 0x8508 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_subtexture b/Windows/glew/auto/extensions/gl/GL_EXT_subtexture new file mode 100644 index 00000000..0a96624a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_subtexture @@ -0,0 +1,7 @@ +GL_EXT_subtexture +http://www.opengl.org/registry/specs/EXT/subtexture.txt +GL_EXT_subtexture + + void glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels) + void glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) + void glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture b/Windows/glew/auto/extensions/gl/GL_EXT_texture new file mode 100644 index 00000000..b74d1301 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture @@ -0,0 +1,46 @@ +GL_EXT_texture +http://www.opengl.org/registry/specs/EXT/texture.txt +GL_EXT_texture + + GL_ALPHA4_EXT 0x803B + GL_ALPHA8_EXT 0x803C + GL_ALPHA12_EXT 0x803D + GL_ALPHA16_EXT 0x803E + GL_LUMINANCE4_EXT 0x803F + GL_LUMINANCE8_EXT 0x8040 + GL_LUMINANCE12_EXT 0x8041 + GL_LUMINANCE16_EXT 0x8042 + GL_LUMINANCE4_ALPHA4_EXT 0x8043 + GL_LUMINANCE6_ALPHA2_EXT 0x8044 + GL_LUMINANCE8_ALPHA8_EXT 0x8045 + GL_LUMINANCE12_ALPHA4_EXT 0x8046 + GL_LUMINANCE12_ALPHA12_EXT 0x8047 + GL_LUMINANCE16_ALPHA16_EXT 0x8048 + GL_INTENSITY_EXT 0x8049 + GL_INTENSITY4_EXT 0x804A + GL_INTENSITY8_EXT 0x804B + GL_INTENSITY12_EXT 0x804C + GL_INTENSITY16_EXT 0x804D + GL_RGB2_EXT 0x804E + GL_RGB4_EXT 0x804F + GL_RGB5_EXT 0x8050 + GL_RGB8_EXT 0x8051 + GL_RGB10_EXT 0x8052 + GL_RGB12_EXT 0x8053 + GL_RGB16_EXT 0x8054 + GL_RGBA2_EXT 0x8055 + GL_RGBA4_EXT 0x8056 + GL_RGB5_A1_EXT 0x8057 + GL_RGBA8_EXT 0x8058 + GL_RGB10_A2_EXT 0x8059 + GL_RGBA12_EXT 0x805A + GL_RGBA16_EXT 0x805B + GL_TEXTURE_RED_SIZE_EXT 0x805C + GL_TEXTURE_GREEN_SIZE_EXT 0x805D + GL_TEXTURE_BLUE_SIZE_EXT 0x805E + GL_TEXTURE_ALPHA_SIZE_EXT 0x805F + GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 + GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 + GL_REPLACE_EXT 0x8062 + GL_PROXY_TEXTURE_1D_EXT 0x8063 + GL_PROXY_TEXTURE_2D_EXT 0x8064 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture3D b/Windows/glew/auto/extensions/gl/GL_EXT_texture3D new file mode 100644 index 00000000..cc78d0dd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture3D @@ -0,0 +1,14 @@ +GL_EXT_texture3D +http://www.opengl.org/registry/specs/EXT/texture3D.txt +GL_EXT_texture3D + + GL_PACK_SKIP_IMAGES_EXT 0x806B + GL_PACK_IMAGE_HEIGHT_EXT 0x806C + GL_UNPACK_SKIP_IMAGES_EXT 0x806D + GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E + GL_TEXTURE_3D_EXT 0x806F + GL_PROXY_TEXTURE_3D_EXT 0x8070 + GL_TEXTURE_DEPTH_EXT 0x8071 + GL_TEXTURE_WRAP_R_EXT 0x8072 + GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + void glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_array b/Windows/glew/auto/extensions/gl/GL_EXT_texture_array new file mode 100644 index 00000000..c5c2c9fa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_array @@ -0,0 +1,13 @@ +GL_EXT_texture_array +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_array.txt +GL_EXT_texture_array + + GL_TEXTURE_1D_ARRAY_EXT 0x8C18 + GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 + GL_TEXTURE_2D_ARRAY_EXT 0x8C1A + GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B + GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C + GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF + GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E + void glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_buffer_object b/Windows/glew/auto/extensions/gl/GL_EXT_texture_buffer_object new file mode 100644 index 00000000..81b58351 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_buffer_object @@ -0,0 +1,10 @@ +GL_EXT_texture_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_buffer_object.txt +GL_EXT_texture_buffer_object + + GL_TEXTURE_BUFFER_EXT 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B + GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D + GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + void glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_astc_decode_mode b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_astc_decode_mode new file mode 100644 index 00000000..5eb1d7ae --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_astc_decode_mode @@ -0,0 +1,5 @@ +GL_EXT_texture_compression_astc_decode_mode +http://www.opengl.org/registry/specs/EXT/texture_compression_astc_decode_mode.txt +GL_EXT_texture_compression_astc_decode_mode + + GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_astc_decode_mode_rgb9e5 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_astc_decode_mode_rgb9e5 new file mode 100644 index 00000000..72ad4f9e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_astc_decode_mode_rgb9e5 @@ -0,0 +1,5 @@ +GL_EXT_texture_compression_astc_decode_mode_rgb9e5 +http://www.opengl.org/registry/specs/EXT/texture_compression_astc_decode_mode.txt +GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + + GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_bptc b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_bptc new file mode 100644 index 00000000..3c1cd6a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_bptc @@ -0,0 +1,8 @@ +GL_EXT_texture_compression_bptc +http://www.opengl.org/registry/specs/EXT/texture_compression_bptc.txt +GL_EXT_texture_compression_bptc + + GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_dxt1 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_dxt1 new file mode 100644 index 00000000..c169bbd3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_dxt1 @@ -0,0 +1,4 @@ +GL_EXT_texture_compression_dxt1 +http://www.opengl.org/registry/specs/EXT/texture_compression_dxt1.txt +GL_EXT_texture_compression_dxt1 + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_latc b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_latc new file mode 100644 index 00000000..e8fcacc2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_latc @@ -0,0 +1,8 @@ +GL_EXT_texture_compression_latc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_latc.txt +GL_EXT_texture_compression_latc + + GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 + GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 + GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 + GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_rgtc b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_rgtc new file mode 100644 index 00000000..054b7f05 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_rgtc @@ -0,0 +1,8 @@ +GL_EXT_texture_compression_rgtc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_rgtc.txt +GL_EXT_texture_compression_rgtc + + GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB + GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC + GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD + GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_s3tc b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_s3tc new file mode 100644 index 00000000..cae61926 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_compression_s3tc @@ -0,0 +1,8 @@ +GL_EXT_texture_compression_s3tc +http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt +GL_EXT_texture_compression_s3tc + + GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_cube_map b/Windows/glew/auto/extensions/gl/GL_EXT_texture_cube_map new file mode 100644 index 00000000..73a2c735 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_cube_map @@ -0,0 +1,16 @@ +GL_EXT_texture_cube_map +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_cube_map.txt +GL_EXT_texture_cube_map + + GL_NORMAL_MAP_EXT 0x8511 + GL_REFLECTION_MAP_EXT 0x8512 + GL_TEXTURE_CUBE_MAP_EXT 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A + GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_cube_map_array b/Windows/glew/auto/extensions/gl/GL_EXT_texture_cube_map_array new file mode 100644 index 00000000..b04c1e64 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_cube_map_array @@ -0,0 +1,13 @@ +GL_EXT_texture_cube_map_array +http://www.opengl.org/registry/specs/EXT/texture_cube_map_array.txt +GL_EXT_texture_cube_map_array + + GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A + GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D + GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F + GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 + GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_edge_clamp b/Windows/glew/auto/extensions/gl/GL_EXT_texture_edge_clamp new file mode 100644 index 00000000..c0b3e2a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_edge_clamp @@ -0,0 +1,5 @@ +GL_EXT_texture_edge_clamp +http://www.opengl.org/developers/documentation/Version1.2/1.2specs/texture_edge_clamp.txt +GL_EXT_texture_edge_clamp + + GL_CLAMP_TO_EDGE_EXT 0x812F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_env b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env new file mode 100644 index 00000000..6373bdd7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env @@ -0,0 +1,4 @@ +GL_EXT_texture_env +http://www.opengl.org/registry/specs/EXT/texture_env.txt +GL_EXT_texture_env + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_add b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_add new file mode 100644 index 00000000..09a46466 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_add @@ -0,0 +1,4 @@ +GL_EXT_texture_env_add +http://www.opengl.org/registry/specs/EXT/texture_env_add.txt +GL_EXT_texture_env_add + diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_combine b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_combine new file mode 100644 index 00000000..83ae1545 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_combine @@ -0,0 +1,25 @@ +GL_EXT_texture_env_combine +http://www.opengl.org/registry/specs/EXT/texture_env_combine.txt +GL_EXT_texture_env_combine + + GL_COMBINE_EXT 0x8570 + GL_COMBINE_RGB_EXT 0x8571 + GL_COMBINE_ALPHA_EXT 0x8572 + GL_RGB_SCALE_EXT 0x8573 + GL_ADD_SIGNED_EXT 0x8574 + GL_INTERPOLATE_EXT 0x8575 + GL_CONSTANT_EXT 0x8576 + GL_PRIMARY_COLOR_EXT 0x8577 + GL_PREVIOUS_EXT 0x8578 + GL_SOURCE0_RGB_EXT 0x8580 + GL_SOURCE1_RGB_EXT 0x8581 + GL_SOURCE2_RGB_EXT 0x8582 + GL_SOURCE0_ALPHA_EXT 0x8588 + GL_SOURCE1_ALPHA_EXT 0x8589 + GL_SOURCE2_ALPHA_EXT 0x858A + GL_OPERAND0_RGB_EXT 0x8590 + GL_OPERAND1_RGB_EXT 0x8591 + GL_OPERAND2_RGB_EXT 0x8592 + GL_OPERAND0_ALPHA_EXT 0x8598 + GL_OPERAND1_ALPHA_EXT 0x8599 + GL_OPERAND2_ALPHA_EXT 0x859A diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_dot3 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_dot3 new file mode 100644 index 00000000..56d6408d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_env_dot3 @@ -0,0 +1,6 @@ +GL_EXT_texture_env_dot3 +http://www.opengl.org/registry/specs/EXT/texture_env_dot3.txt +GL_EXT_texture_env_dot3 + + GL_DOT3_RGB_EXT 0x8740 + GL_DOT3_RGBA_EXT 0x8741 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_filter_anisotropic b/Windows/glew/auto/extensions/gl/GL_EXT_texture_filter_anisotropic new file mode 100644 index 00000000..caa09fb7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_filter_anisotropic @@ -0,0 +1,6 @@ +GL_EXT_texture_filter_anisotropic +http://www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt +GL_EXT_texture_filter_anisotropic + + GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE + GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_filter_minmax b/Windows/glew/auto/extensions/gl/GL_EXT_texture_filter_minmax new file mode 100644 index 00000000..9eade7b8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_filter_minmax @@ -0,0 +1,6 @@ +GL_EXT_texture_filter_minmax +http://www.opengl.org/registry/specs/EXT/texture_filter_minmax.txt +GL_EXT_texture_filter_minmax + + GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 + GL_WEIGHTED_AVERAGE_EXT 0x9367 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_format_BGRA8888 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_format_BGRA8888 new file mode 100644 index 00000000..f456a46b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_format_BGRA8888 @@ -0,0 +1,5 @@ +GL_EXT_texture_format_BGRA8888 +http://www.opengl.org/registry/specs/EXT/texture_format_BGRA8888.txt +GL_EXT_texture_format_BGRA8888 + + GL_BGRA_EXT 0x80E1 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_integer b/Windows/glew/auto/extensions/gl/GL_EXT_texture_integer new file mode 100644 index 00000000..43219cfe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_integer @@ -0,0 +1,57 @@ +GL_EXT_texture_integer +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_integer.txt +GL_EXT_texture_integer + + GL_RGBA32UI_EXT 0x8D70 + GL_RGB32UI_EXT 0x8D71 + GL_ALPHA32UI_EXT 0x8D72 + GL_INTENSITY32UI_EXT 0x8D73 + GL_LUMINANCE32UI_EXT 0x8D74 + GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 + GL_RGBA16UI_EXT 0x8D76 + GL_RGB16UI_EXT 0x8D77 + GL_ALPHA16UI_EXT 0x8D78 + GL_INTENSITY16UI_EXT 0x8D79 + GL_LUMINANCE16UI_EXT 0x8D7A + GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B + GL_RGBA8UI_EXT 0x8D7C + GL_RGB8UI_EXT 0x8D7D + GL_ALPHA8UI_EXT 0x8D7E + GL_INTENSITY8UI_EXT 0x8D7F + GL_LUMINANCE8UI_EXT 0x8D80 + GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 + GL_RGBA32I_EXT 0x8D82 + GL_RGB32I_EXT 0x8D83 + GL_ALPHA32I_EXT 0x8D84 + GL_INTENSITY32I_EXT 0x8D85 + GL_LUMINANCE32I_EXT 0x8D86 + GL_LUMINANCE_ALPHA32I_EXT 0x8D87 + GL_RGBA16I_EXT 0x8D88 + GL_RGB16I_EXT 0x8D89 + GL_ALPHA16I_EXT 0x8D8A + GL_INTENSITY16I_EXT 0x8D8B + GL_LUMINANCE16I_EXT 0x8D8C + GL_LUMINANCE_ALPHA16I_EXT 0x8D8D + GL_RGBA8I_EXT 0x8D8E + GL_RGB8I_EXT 0x8D8F + GL_ALPHA8I_EXT 0x8D90 + GL_INTENSITY8I_EXT 0x8D91 + GL_LUMINANCE8I_EXT 0x8D92 + GL_LUMINANCE_ALPHA8I_EXT 0x8D93 + GL_RED_INTEGER_EXT 0x8D94 + GL_GREEN_INTEGER_EXT 0x8D95 + GL_BLUE_INTEGER_EXT 0x8D96 + GL_ALPHA_INTEGER_EXT 0x8D97 + GL_RGB_INTEGER_EXT 0x8D98 + GL_RGBA_INTEGER_EXT 0x8D99 + GL_BGR_INTEGER_EXT 0x8D9A + GL_BGRA_INTEGER_EXT 0x8D9B + GL_LUMINANCE_INTEGER_EXT 0x8D9C + GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D + GL_RGBA_INTEGER_MODE_EXT 0x8D9E + void glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params) + void glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params) + void glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params) + void glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params) + void glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha) + void glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_lod_bias b/Windows/glew/auto/extensions/gl/GL_EXT_texture_lod_bias new file mode 100644 index 00000000..cc0a5027 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_lod_bias @@ -0,0 +1,7 @@ +GL_EXT_texture_lod_bias +http://www.opengl.org/registry/specs/EXT/texture_lod_bias.txt +GL_EXT_texture_lod_bias + + GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD + GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 + GL_TEXTURE_LOD_BIAS_EXT 0x8501 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_mirror_clamp b/Windows/glew/auto/extensions/gl/GL_EXT_texture_mirror_clamp new file mode 100644 index 00000000..30e9f579 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_mirror_clamp @@ -0,0 +1,7 @@ +GL_EXT_texture_mirror_clamp +http://www.opengl.org/registry/specs/EXT/texture_mirror_clamp.txt +GL_EXT_texture_mirror_clamp + + GL_MIRROR_CLAMP_EXT 0x8742 + GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 + GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_norm16 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_norm16 new file mode 100644 index 00000000..a69c18f0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_norm16 @@ -0,0 +1,12 @@ +GL_EXT_texture_norm16 +http://www.opengl.org/registry/specs/EXT/texture_norm16.txt +GL_EXT_texture_norm16 + + GL_RGB16_EXT 0x8054 + GL_RGBA16_EXT 0x805B + GL_R16_EXT 0x822A + GL_RG16_EXT 0x822C + GL_R16_SNORM_EXT 0x8F98 + GL_RG16_SNORM_EXT 0x8F99 + GL_RGB16_SNORM_EXT 0x8F9A + GL_RGBA16_SNORM_EXT 0x8F9B diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_object b/Windows/glew/auto/extensions/gl/GL_EXT_texture_object new file mode 100644 index 00000000..3b5c6671 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_object @@ -0,0 +1,15 @@ +GL_EXT_texture_object +http://www.opengl.org/registry/specs/EXT/texture_object.txt +GL_EXT_texture_object + + GL_TEXTURE_PRIORITY_EXT 0x8066 + GL_TEXTURE_RESIDENT_EXT 0x8067 + GL_TEXTURE_1D_BINDING_EXT 0x8068 + GL_TEXTURE_2D_BINDING_EXT 0x8069 + GL_TEXTURE_3D_BINDING_EXT 0x806A + GLboolean glAreTexturesResidentEXT (GLsizei n, const GLuint* textures, GLboolean* residences) + void glBindTextureEXT (GLenum target, GLuint texture) + void glDeleteTexturesEXT (GLsizei n, const GLuint* textures) + void glGenTexturesEXT (GLsizei n, GLuint* textures) + GLboolean glIsTextureEXT (GLuint texture) + void glPrioritizeTexturesEXT (GLsizei n, const GLuint* textures, const GLclampf* priorities) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_perturb_normal b/Windows/glew/auto/extensions/gl/GL_EXT_texture_perturb_normal new file mode 100644 index 00000000..5d216509 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_perturb_normal @@ -0,0 +1,7 @@ +GL_EXT_texture_perturb_normal +http://www.opengl.org/registry/specs/EXT/texture_perturb_normal.txt +GL_EXT_texture_perturb_normal + + GL_PERTURB_EXT 0x85AE + GL_TEXTURE_NORMAL_EXT 0x85AF + void glTextureNormalEXT (GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_rectangle b/Windows/glew/auto/extensions/gl/GL_EXT_texture_rectangle new file mode 100644 index 00000000..13943112 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_rectangle @@ -0,0 +1,8 @@ +GL_EXT_texture_rectangle +http://developer.apple.com/opengl/extensions/ext_texture_rectangle.html +GL_EXT_texture_rectangle + + GL_TEXTURE_RECTANGLE_EXT 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_rg b/Windows/glew/auto/extensions/gl/GL_EXT_texture_rg new file mode 100644 index 00000000..bd3c0413 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_rg @@ -0,0 +1,8 @@ +GL_EXT_texture_rg +http://www.opengl.org/registry/specs/EXT/texture_rg.txt +GL_EXT_texture_rg + + GL_RED_EXT 0x1903 + GL_RG_EXT 0x8227 + GL_R8_EXT 0x8229 + GL_RG8_EXT 0x822B diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB new file mode 100644 index 00000000..7c5328d9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB @@ -0,0 +1,20 @@ +GL_EXT_texture_sRGB +http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt +GL_EXT_texture_sRGB + + GL_SRGB_EXT 0x8C40 + GL_SRGB8_EXT 0x8C41 + GL_SRGB_ALPHA_EXT 0x8C42 + GL_SRGB8_ALPHA8_EXT 0x8C43 + GL_SLUMINANCE_ALPHA_EXT 0x8C44 + GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 + GL_SLUMINANCE_EXT 0x8C46 + GL_SLUMINANCE8_EXT 0x8C47 + GL_COMPRESSED_SRGB_EXT 0x8C48 + GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 + GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A + GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B + GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_R8 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_R8 new file mode 100644 index 00000000..b94555fb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_R8 @@ -0,0 +1,5 @@ +GL_EXT_texture_sRGB_R8 +http://www.opengl.org/registry/specs/EXT/texture_sRGB_R8.txt +GL_EXT_texture_sRGB_R8 + + GL_SR8_EXT 0x8FBD diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_RG8 b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_RG8 new file mode 100644 index 00000000..ed3ed192 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_RG8 @@ -0,0 +1,5 @@ +GL_EXT_texture_sRGB_RG8 +http://www.opengl.org/registry/specs/EXT/texture_sRGB_RG8.txt +GL_EXT_texture_sRGB_RG8 + + GL_SRG8_EXT 0x8FBE diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_decode b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_decode new file mode 100644 index 00000000..a8177f36 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_sRGB_decode @@ -0,0 +1,7 @@ +GL_EXT_texture_sRGB_decode +http://www.opengl.org/registry/specs/EXT/texture_sRGB_decode.txt +GL_EXT_texture_sRGB_decode + + GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 + GL_DECODE_EXT 0x8A49 + GL_SKIP_DECODE_EXT 0x8A4A diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_shared_exponent b/Windows/glew/auto/extensions/gl/GL_EXT_texture_shared_exponent new file mode 100644 index 00000000..4c7d4616 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_shared_exponent @@ -0,0 +1,7 @@ +GL_EXT_texture_shared_exponent +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_shared_exponent.txt +GL_EXT_texture_shared_exponent + + GL_RGB9_E5_EXT 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E + GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_snorm b/Windows/glew/auto/extensions/gl/GL_EXT_texture_snorm new file mode 100644 index 00000000..696ae673 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_snorm @@ -0,0 +1,29 @@ +GL_EXT_texture_snorm +http://www.opengl.org/registry/specs/EXT/texture_snorm.txt +GL_EXT_texture_snorm + + GL_RED_SNORM 0x8F90 + GL_RG_SNORM 0x8F91 + GL_RGB_SNORM 0x8F92 + GL_RGBA_SNORM 0x8F93 + GL_R8_SNORM 0x8F94 + GL_RG8_SNORM 0x8F95 + GL_RGB8_SNORM 0x8F96 + GL_RGBA8_SNORM 0x8F97 + GL_R16_SNORM 0x8F98 + GL_RG16_SNORM 0x8F99 + GL_RGB16_SNORM 0x8F9A + GL_RGBA16_SNORM 0x8F9B + GL_SIGNED_NORMALIZED 0x8F9C + GL_ALPHA_SNORM 0x9010 + GL_LUMINANCE_SNORM 0x9011 + GL_LUMINANCE_ALPHA_SNORM 0x9012 + GL_INTENSITY_SNORM 0x9013 + GL_ALPHA8_SNORM 0x9014 + GL_LUMINANCE8_SNORM 0x9015 + GL_LUMINANCE8_ALPHA8_SNORM 0x9016 + GL_INTENSITY8_SNORM 0x9017 + GL_ALPHA16_SNORM 0x9018 + GL_LUMINANCE16_SNORM 0x9019 + GL_LUMINANCE16_ALPHA16_SNORM 0x901A + GL_INTENSITY16_SNORM 0x901B diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_storage b/Windows/glew/auto/extensions/gl/GL_EXT_texture_storage new file mode 100644 index 00000000..8a6ff899 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_storage @@ -0,0 +1,34 @@ +GL_EXT_texture_storage +http://www.opengl.org/registry/specs/EXT/texture_storage.txt +GL_EXT_texture_storage + + GL_ALPHA8_EXT 0x803C + GL_LUMINANCE8_EXT 0x8040 + GL_LUMINANCE8_ALPHA8_EXT 0x8045 + GL_RGB10_EXT 0x8052 + GL_RGB10_A2_EXT 0x8059 + GL_R8_EXT 0x8229 + GL_RG8_EXT 0x822B + GL_R16F_EXT 0x822D + GL_R32F_EXT 0x822E + GL_RG16F_EXT 0x822F + GL_RG32F_EXT 0x8230 + GL_RGBA32F_EXT 0x8814 + GL_RGB32F_EXT 0x8815 + GL_ALPHA32F_EXT 0x8816 + GL_LUMINANCE32F_EXT 0x8818 + GL_LUMINANCE_ALPHA32F_EXT 0x8819 + GL_RGBA16F_EXT 0x881A + GL_RGB16F_EXT 0x881B + GL_ALPHA16F_EXT 0x881C + GL_LUMINANCE16F_EXT 0x881E + GL_LUMINANCE_ALPHA16F_EXT 0x881F + GL_RGB_RAW_422_APPLE 0x8A51 + GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F + GL_BGRA8_EXT 0x93A1 + void glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) + void glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) + void glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) + void glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) + void glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) + void glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_swizzle b/Windows/glew/auto/extensions/gl/GL_EXT_texture_swizzle new file mode 100644 index 00000000..3d6b85e8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_swizzle @@ -0,0 +1,9 @@ +GL_EXT_texture_swizzle +http://www.opengl.org/registry/specs/EXT/texture_swizzle.txt +GL_EXT_texture_swizzle + + GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 + GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 + GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 + GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 + GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_type_2_10_10_10_REV b/Windows/glew/auto/extensions/gl/GL_EXT_texture_type_2_10_10_10_REV new file mode 100644 index 00000000..157c0408 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_type_2_10_10_10_REV @@ -0,0 +1,5 @@ +GL_EXT_texture_type_2_10_10_10_REV +http://www.opengl.org/registry/specs/EXT/texture_type_2_10_10_10_REV.txt +GL_EXT_texture_type_2_10_10_10_REV + + GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_texture_view b/Windows/glew/auto/extensions/gl/GL_EXT_texture_view new file mode 100644 index 00000000..9928d427 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_texture_view @@ -0,0 +1,10 @@ +GL_EXT_texture_view +http://www.opengl.org/registry/specs/EXT/texture_view.txt +GL_EXT_texture_view + + GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB + GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC + GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD + GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE + GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + void glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_timer_query b/Windows/glew/auto/extensions/gl/GL_EXT_timer_query new file mode 100644 index 00000000..530ba355 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_timer_query @@ -0,0 +1,7 @@ +GL_EXT_timer_query +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_timer_query.txt +GL_EXT_timer_query + + GL_TIME_ELAPSED_EXT 0x88BF + void glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params) + void glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_transform_feedback b/Windows/glew/auto/extensions/gl/GL_EXT_transform_feedback new file mode 100644 index 00000000..e5c03ddd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_transform_feedback @@ -0,0 +1,26 @@ +GL_EXT_transform_feedback +http://www.opengl.org/registry/specs/EXT/transform_feedback.txt +GL_EXT_transform_feedback + + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 + GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 + GL_PRIMITIVES_GENERATED_EXT 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 + GL_RASTERIZER_DISCARD_EXT 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B + GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C + GL_SEPARATE_ATTRIBS_EXT 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + void glBeginTransformFeedbackEXT (GLenum primitiveMode) + void glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer) + void glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset) + void glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glEndTransformFeedbackEXT (void) + void glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name) + void glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_unpack_subimage b/Windows/glew/auto/extensions/gl/GL_EXT_unpack_subimage new file mode 100644 index 00000000..6d934999 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_unpack_subimage @@ -0,0 +1,7 @@ +GL_EXT_unpack_subimage +http://www.opengl.org/registry/specs/EXT/unpack_subimage.txt +GL_EXT_unpack_subimage + + GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 + GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 + GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array new file mode 100644 index 00000000..95ac6d9c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array @@ -0,0 +1,45 @@ +GL_EXT_vertex_array +http://www.opengl.org/registry/specs/EXT/vertex_array.txt +GL_EXT_vertex_array + + GL_DOUBLE_EXT 0x140A + GL_VERTEX_ARRAY_EXT 0x8074 + GL_NORMAL_ARRAY_EXT 0x8075 + GL_COLOR_ARRAY_EXT 0x8076 + GL_INDEX_ARRAY_EXT 0x8077 + GL_TEXTURE_COORD_ARRAY_EXT 0x8078 + GL_EDGE_FLAG_ARRAY_EXT 0x8079 + GL_VERTEX_ARRAY_SIZE_EXT 0x807A + GL_VERTEX_ARRAY_TYPE_EXT 0x807B + GL_VERTEX_ARRAY_STRIDE_EXT 0x807C + GL_VERTEX_ARRAY_COUNT_EXT 0x807D + GL_NORMAL_ARRAY_TYPE_EXT 0x807E + GL_NORMAL_ARRAY_STRIDE_EXT 0x807F + GL_NORMAL_ARRAY_COUNT_EXT 0x8080 + GL_COLOR_ARRAY_SIZE_EXT 0x8081 + GL_COLOR_ARRAY_TYPE_EXT 0x8082 + GL_COLOR_ARRAY_STRIDE_EXT 0x8083 + GL_COLOR_ARRAY_COUNT_EXT 0x8084 + GL_INDEX_ARRAY_TYPE_EXT 0x8085 + GL_INDEX_ARRAY_STRIDE_EXT 0x8086 + GL_INDEX_ARRAY_COUNT_EXT 0x8087 + GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 + GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A + GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B + GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C + GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D + GL_VERTEX_ARRAY_POINTER_EXT 0x808E + GL_NORMAL_ARRAY_POINTER_EXT 0x808F + GL_COLOR_ARRAY_POINTER_EXT 0x8090 + GL_INDEX_ARRAY_POINTER_EXT 0x8091 + GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 + GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + void glArrayElementEXT (GLint i) + void glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer) + void glDrawArraysEXT (GLenum mode, GLint first, GLsizei count) + void glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean* pointer) + void glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer) + void glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer) + void glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer) + void glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array_bgra b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array_bgra new file mode 100644 index 00000000..6d675d79 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array_bgra @@ -0,0 +1,5 @@ +GL_EXT_vertex_array_bgra +http://www.opengl.org/registry/specs/EXT/vertex_array_bgra.txt +GL_EXT_vertex_array_bgra + + GL_BGRA 0x80E1 diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array_setXXX b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array_setXXX new file mode 100644 index 00000000..8e48be6c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_array_setXXX @@ -0,0 +1,7 @@ +GL_EXT_vertex_array_setXXX +http://www.opengl.org/registry/specs/EXT/vertex_array_setXXX.txt +GL_EXT_vertex_array_setXXX + + void glBindArraySetEXT (const void *arrayset) + const void * glCreateArraySetExt (void) + void glDeleteArraySetsEXT (GLsizei n, const void *arrayset[]) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_vertex_attrib_64bit b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_attrib_64bit new file mode 100644 index 00000000..71f877fe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_attrib_64bit @@ -0,0 +1,27 @@ +GL_EXT_vertex_attrib_64bit +http://www.opengl.org/registry/specs/EXT/vertex_attrib_64bit.txt +GL_EXT_vertex_attrib_64bit + + GL_DOUBLE_MAT2_EXT 0x8F46 + GL_DOUBLE_MAT3_EXT 0x8F47 + GL_DOUBLE_MAT4_EXT 0x8F48 + GL_DOUBLE_MAT2x3_EXT 0x8F49 + GL_DOUBLE_MAT2x4_EXT 0x8F4A + GL_DOUBLE_MAT3x2_EXT 0x8F4B + GL_DOUBLE_MAT3x4_EXT 0x8F4C + GL_DOUBLE_MAT4x2_EXT 0x8F4D + GL_DOUBLE_MAT4x3_EXT 0x8F4E + GL_DOUBLE_VEC2_EXT 0x8FFC + GL_DOUBLE_VEC3_EXT 0x8FFD + GL_DOUBLE_VEC4_EXT 0x8FFE + void glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble* params) + void glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexAttribL1dEXT (GLuint index, GLdouble x) + void glVertexAttribL1dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y) + void glVertexAttribL2dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttribL3dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttribL4dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_vertex_shader b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_shader new file mode 100644 index 00000000..8d3314fc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_shader @@ -0,0 +1,157 @@ +GL_EXT_vertex_shader +http://oss.sgi.com/projects/ogl-sample/registry/EXT/vertex_shader.txt +GL_EXT_vertex_shader + + GL_VERTEX_SHADER_EXT 0x8780 + GL_VERTEX_SHADER_BINDING_EXT 0x8781 + GL_OP_INDEX_EXT 0x8782 + GL_OP_NEGATE_EXT 0x8783 + GL_OP_DOT3_EXT 0x8784 + GL_OP_DOT4_EXT 0x8785 + GL_OP_MUL_EXT 0x8786 + GL_OP_ADD_EXT 0x8787 + GL_OP_MADD_EXT 0x8788 + GL_OP_FRAC_EXT 0x8789 + GL_OP_MAX_EXT 0x878A + GL_OP_MIN_EXT 0x878B + GL_OP_SET_GE_EXT 0x878C + GL_OP_SET_LT_EXT 0x878D + GL_OP_CLAMP_EXT 0x878E + GL_OP_FLOOR_EXT 0x878F + GL_OP_ROUND_EXT 0x8790 + GL_OP_EXP_BASE_2_EXT 0x8791 + GL_OP_LOG_BASE_2_EXT 0x8792 + GL_OP_POWER_EXT 0x8793 + GL_OP_RECIP_EXT 0x8794 + GL_OP_RECIP_SQRT_EXT 0x8795 + GL_OP_SUB_EXT 0x8796 + GL_OP_CROSS_PRODUCT_EXT 0x8797 + GL_OP_MULTIPLY_MATRIX_EXT 0x8798 + GL_OP_MOV_EXT 0x8799 + GL_OUTPUT_VERTEX_EXT 0x879A + GL_OUTPUT_COLOR0_EXT 0x879B + GL_OUTPUT_COLOR1_EXT 0x879C + GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D + GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E + GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F + GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 + GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 + GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 + GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 + GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 + GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 + GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 + GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 + GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 + GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 + GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA + GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB + GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC + GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD + GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE + GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF + GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 + GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 + GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 + GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 + GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 + GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 + GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 + GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 + GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 + GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 + GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA + GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB + GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC + GL_OUTPUT_FOG_EXT 0x87BD + GL_SCALAR_EXT 0x87BE + GL_VECTOR_EXT 0x87BF + GL_MATRIX_EXT 0x87C0 + GL_VARIANT_EXT 0x87C1 + GL_INVARIANT_EXT 0x87C2 + GL_LOCAL_CONSTANT_EXT 0x87C3 + GL_LOCAL_EXT 0x87C4 + GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 + GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 + GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 + GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 + GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 + GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA + GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB + GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE + GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF + GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 + GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 + GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 + GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 + GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 + GL_X_EXT 0x87D5 + GL_Y_EXT 0x87D6 + GL_Z_EXT 0x87D7 + GL_W_EXT 0x87D8 + GL_NEGATIVE_X_EXT 0x87D9 + GL_NEGATIVE_Y_EXT 0x87DA + GL_NEGATIVE_Z_EXT 0x87DB + GL_NEGATIVE_W_EXT 0x87DC + GL_ZERO_EXT 0x87DD + GL_ONE_EXT 0x87DE + GL_NEGATIVE_ONE_EXT 0x87DF + GL_NORMALIZED_RANGE_EXT 0x87E0 + GL_FULL_RANGE_EXT 0x87E1 + GL_CURRENT_VERTEX_EXT 0x87E2 + GL_MVP_MATRIX_EXT 0x87E3 + GL_VARIANT_VALUE_EXT 0x87E4 + GL_VARIANT_DATATYPE_EXT 0x87E5 + GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 + GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 + GL_VARIANT_ARRAY_EXT 0x87E8 + GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 + GL_INVARIANT_VALUE_EXT 0x87EA + GL_INVARIANT_DATATYPE_EXT 0x87EB + GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC + GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + + void glBeginVertexShaderEXT (void) + void glEndVertexShaderEXT (void) + void glBindVertexShaderEXT (GLuint id) + GLuint glGenVertexShadersEXT (GLuint range) + void glDeleteVertexShaderEXT (GLuint id) + void glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1) + void glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2) + void glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3) + void glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glInsertComponentEXT (GLuint res, GLuint src, GLuint num) + void glExtractComponentEXT (GLuint res, GLuint src, GLuint num) + GLuint glGenSymbolsEXT (GLenum dataType, GLenum storageType, GLenum range, GLuint components) + void glSetInvariantEXT (GLuint id, GLenum type, void *addr) + void glSetLocalConstantEXT (GLuint id, GLenum type, void *addr) + void glVariantbvEXT (GLuint id, GLbyte *addr) + void glVariantsvEXT (GLuint id, GLshort *addr) + void glVariantivEXT (GLuint id, GLint *addr) + void glVariantfvEXT (GLuint id, GLfloat *addr) + void glVariantdvEXT (GLuint id, GLdouble *addr) + void glVariantubvEXT (GLuint id, GLubyte *addr) + void glVariantusvEXT (GLuint id, GLushort *addr) + void glVariantuivEXT (GLuint id, GLuint *addr) + void glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, void *addr) + void glEnableVariantClientStateEXT (GLuint id) + void glDisableVariantClientStateEXT (GLuint id) + GLuint glBindLightParameterEXT (GLenum light, GLenum value) + GLuint glBindMaterialParameterEXT (GLenum face, GLenum value) + GLuint glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value) + GLuint glBindTextureUnitParameterEXT (GLenum unit, GLenum value) + GLuint glBindParameterEXT (GLenum value) + GLboolean glIsVariantEnabledEXT (GLuint id, GLenum cap) + void glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetVariantPointervEXT (GLuint id, GLenum value, void **data) + void glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_vertex_weighting b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_weighting new file mode 100644 index 00000000..e05ddeb9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_vertex_weighting @@ -0,0 +1,20 @@ +GL_EXT_vertex_weighting +http://www.opengl.org/registry/specs/EXT/vertex_weighting.txt +GL_EXT_vertex_weighting + + GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 + GL_MODELVIEW0_MATRIX_EXT 0x0BA6 + GL_MODELVIEW0_EXT 0x1700 + GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 + GL_MODELVIEW1_MATRIX_EXT 0x8506 + GL_VERTEX_WEIGHTING_EXT 0x8509 + GL_MODELVIEW1_EXT 0x850A + GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B + GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C + GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D + GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E + GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F + GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + void glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, void *pointer) + void glVertexWeightfEXT (GLfloat weight) + void glVertexWeightfvEXT (GLfloat* weight) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_win32_keyed_mutex b/Windows/glew/auto/extensions/gl/GL_EXT_win32_keyed_mutex new file mode 100644 index 00000000..1d9310e6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_win32_keyed_mutex @@ -0,0 +1,6 @@ +GL_EXT_win32_keyed_mutex +http://www.opengl.org/registry/specs/EXT/win32_keyed_mutex.txt +GL_EXT_win32_keyed_mutex + + GLboolean glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout) + GLboolean glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_window_rectangles b/Windows/glew/auto/extensions/gl/GL_EXT_window_rectangles new file mode 100644 index 00000000..2967042e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_window_rectangles @@ -0,0 +1,11 @@ +GL_EXT_window_rectangles +http://www.opengl.org/registry/specs/EXT/window_rectangles.txt +GL_EXT_window_rectangles + + GL_INCLUSIVE_EXT 0x8F10 + GL_EXCLUSIVE_EXT 0x8F11 + GL_WINDOW_RECTANGLE_EXT 0x8F12 + GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 + GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 + GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 + void glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint box[]) diff --git a/Windows/glew/auto/extensions/gl/GL_EXT_x11_sync_object b/Windows/glew/auto/extensions/gl/GL_EXT_x11_sync_object new file mode 100644 index 00000000..07694749 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_EXT_x11_sync_object @@ -0,0 +1,6 @@ +GL_EXT_x11_sync_object +http://www.opengl.org/registry/specs/EXT/x11_sync_object.txt +GL_EXT_x11_sync_object + + GL_SYNC_X11_FENCE_EXT 0x90E1 + GLsync glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags) diff --git a/Windows/glew/auto/extensions/gl/GL_GREMEDY_frame_terminator b/Windows/glew/auto/extensions/gl/GL_GREMEDY_frame_terminator new file mode 100644 index 00000000..b45d24fc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_GREMEDY_frame_terminator @@ -0,0 +1,5 @@ +GL_GREMEDY_frame_terminator +http://www.opengl.org/registry/specs/GREMEDY/frame_terminator.txt +GL_GREMEDY_frame_terminator + + void glFrameTerminatorGREMEDY (void) diff --git a/Windows/glew/auto/extensions/gl/GL_GREMEDY_string_marker b/Windows/glew/auto/extensions/gl/GL_GREMEDY_string_marker new file mode 100644 index 00000000..c1d1df4d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_GREMEDY_string_marker @@ -0,0 +1,5 @@ +GL_GREMEDY_string_marker +http://www.opengl.org/registry/specs/GREMEDY/string_marker.txt +GL_GREMEDY_string_marker + + void glStringMarkerGREMEDY (GLsizei len, const void *string) diff --git a/Windows/glew/auto/extensions/gl/GL_HP_convolution_border_modes b/Windows/glew/auto/extensions/gl/GL_HP_convolution_border_modes new file mode 100644 index 00000000..4b331c4e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_HP_convolution_border_modes @@ -0,0 +1,4 @@ +GL_HP_convolution_border_modes +http://www.opengl.org/registry/specs/HP/convolution_border_modes.txt +GL_HP_convolution_border_modes + diff --git a/Windows/glew/auto/extensions/gl/GL_HP_image_transform b/Windows/glew/auto/extensions/gl/GL_HP_image_transform new file mode 100644 index 00000000..adeb884e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_HP_image_transform @@ -0,0 +1,10 @@ +GL_HP_image_transform +http://www.opengl.org/registry/specs/HP/image_transform.txt +GL_HP_image_transform + + void glGetImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat* params) + void glGetImageTransformParameterivHP (GLenum target, GLenum pname, const GLint* params) + void glImageTransformParameterfHP (GLenum target, GLenum pname, const GLfloat param) + void glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat* params) + void glImageTransformParameteriHP (GLenum target, GLenum pname, const GLint param) + void glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_HP_occlusion_test b/Windows/glew/auto/extensions/gl/GL_HP_occlusion_test new file mode 100644 index 00000000..8328c9e6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_HP_occlusion_test @@ -0,0 +1,4 @@ +GL_HP_occlusion_test +http://www.opengl.org/registry/specs/HP/occlusion_test.txt +GL_HP_occlusion_test + diff --git a/Windows/glew/auto/extensions/gl/GL_HP_texture_lighting b/Windows/glew/auto/extensions/gl/GL_HP_texture_lighting new file mode 100644 index 00000000..0f4fd9a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_HP_texture_lighting @@ -0,0 +1,4 @@ +GL_HP_texture_lighting +http://www.opengl.org/registry/specs/HP/texture_lighting.txt +GL_HP_texture_lighting + diff --git a/Windows/glew/auto/extensions/gl/GL_IBM_cull_vertex b/Windows/glew/auto/extensions/gl/GL_IBM_cull_vertex new file mode 100644 index 00000000..95288ea5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_IBM_cull_vertex @@ -0,0 +1,5 @@ +GL_IBM_cull_vertex +http://www.opengl.org/registry/specs/IBM/cull_vertex.txt +GL_IBM_cull_vertex + + GL_CULL_VERTEX_IBM 103050 diff --git a/Windows/glew/auto/extensions/gl/GL_IBM_multimode_draw_arrays b/Windows/glew/auto/extensions/gl/GL_IBM_multimode_draw_arrays new file mode 100644 index 00000000..7c5b7e00 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_IBM_multimode_draw_arrays @@ -0,0 +1,6 @@ +GL_IBM_multimode_draw_arrays +http://www.opengl.org/registry/specs/IBM/multimode_draw_arrays.txt +GL_IBM_multimode_draw_arrays + + void glMultiModeDrawArraysIBM (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride) + void glMultiModeDrawElementsIBM (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride) diff --git a/Windows/glew/auto/extensions/gl/GL_IBM_rasterpos_clip b/Windows/glew/auto/extensions/gl/GL_IBM_rasterpos_clip new file mode 100644 index 00000000..36552bcc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_IBM_rasterpos_clip @@ -0,0 +1,5 @@ +GL_IBM_rasterpos_clip +http://www.opengl.org/registry/specs/IBM/rasterpos_clip.txt +GL_IBM_rasterpos_clip + + GL_RASTER_POSITION_UNCLIPPED_IBM 103010 diff --git a/Windows/glew/auto/extensions/gl/GL_IBM_static_data b/Windows/glew/auto/extensions/gl/GL_IBM_static_data new file mode 100644 index 00000000..a3075996 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_IBM_static_data @@ -0,0 +1,6 @@ +GL_IBM_static_data +http://www.opengl.org/registry/specs/IBM/static_data.txt +GL_IBM_static_data + + GL_ALL_STATIC_DATA_IBM 103060 + GL_STATIC_VERTEX_ARRAY_IBM 103061 diff --git a/Windows/glew/auto/extensions/gl/GL_IBM_texture_mirrored_repeat b/Windows/glew/auto/extensions/gl/GL_IBM_texture_mirrored_repeat new file mode 100644 index 00000000..4dd425c8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_IBM_texture_mirrored_repeat @@ -0,0 +1,5 @@ +GL_IBM_texture_mirrored_repeat +http://www.opengl.org/registry/specs/IBM/texture_mirrored_repeat.txt +GL_IBM_texture_mirrored_repeat + + GL_MIRRORED_REPEAT_IBM 0x8370 diff --git a/Windows/glew/auto/extensions/gl/GL_IBM_vertex_array_lists b/Windows/glew/auto/extensions/gl/GL_IBM_vertex_array_lists new file mode 100644 index 00000000..1a57612b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_IBM_vertex_array_lists @@ -0,0 +1,28 @@ +GL_IBM_vertex_array_lists +http://www.opengl.org/registry/specs/IBM/vertex_array_lists.txt +GL_IBM_vertex_array_lists + + GL_VERTEX_ARRAY_LIST_IBM 103070 + GL_NORMAL_ARRAY_LIST_IBM 103071 + GL_COLOR_ARRAY_LIST_IBM 103072 + GL_INDEX_ARRAY_LIST_IBM 103073 + GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 + GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 + GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 + GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 + GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 + GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 + GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 + GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 + GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 + GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 + GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 + GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + void glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride) + void glEdgeFlagPointerListIBM (GLint stride, const GLboolean ** pointer, GLint ptrstride) + void glFogCoordPointerListIBM (GLenum type, GLint stride, const void** pointer, GLint ptrstride) + void glIndexPointerListIBM (GLenum type, GLint stride, const void** pointer, GLint ptrstride) + void glNormalPointerListIBM (GLenum type, GLint stride, const void** pointer, GLint ptrstride) + void glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride) + void glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride) + void glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride) diff --git a/Windows/glew/auto/extensions/gl/GL_INGR_color_clamp b/Windows/glew/auto/extensions/gl/GL_INGR_color_clamp new file mode 100644 index 00000000..b589f641 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INGR_color_clamp @@ -0,0 +1,12 @@ +GL_INGR_color_clamp +http://www.opengl.org/registry/specs/INGR/color_clamp.txt +GL_INGR_color_clamp + + GL_RED_MIN_CLAMP_INGR 0x8560 + GL_GREEN_MIN_CLAMP_INGR 0x8561 + GL_BLUE_MIN_CLAMP_INGR 0x8562 + GL_ALPHA_MIN_CLAMP_INGR 0x8563 + GL_RED_MAX_CLAMP_INGR 0x8564 + GL_GREEN_MAX_CLAMP_INGR 0x8565 + GL_BLUE_MAX_CLAMP_INGR 0x8566 + GL_ALPHA_MAX_CLAMP_INGR 0x8567 diff --git a/Windows/glew/auto/extensions/gl/GL_INGR_interlace_read b/Windows/glew/auto/extensions/gl/GL_INGR_interlace_read new file mode 100644 index 00000000..5c1abe43 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INGR_interlace_read @@ -0,0 +1,5 @@ +GL_INGR_interlace_read +http://www.opengl.org/registry/specs/INGR/interlace_read.txt +GL_INGR_interlace_read + + GL_INTERLACE_READ_INGR 0x8568 diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_conservative_rasterization b/Windows/glew/auto/extensions/gl/GL_INTEL_conservative_rasterization new file mode 100644 index 00000000..3d5cc9b6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_conservative_rasterization @@ -0,0 +1,5 @@ +GL_INTEL_conservative_rasterization +http://www.opengl.org/registry/specs/INTEL/conservative_rasterization.txt +GL_INTEL_conservative_rasterization + + GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_fragment_shader_ordering b/Windows/glew/auto/extensions/gl/GL_INTEL_fragment_shader_ordering new file mode 100644 index 00000000..3a4ddb49 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_fragment_shader_ordering @@ -0,0 +1,4 @@ +GL_INTEL_fragment_shader_ordering +http://www.opengl.org/registry/specs/INTEL/fragment_shader_ordering.txt +GL_INTEL_fragment_shader_ordering + diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_framebuffer_CMAA b/Windows/glew/auto/extensions/gl/GL_INTEL_framebuffer_CMAA new file mode 100644 index 00000000..c52d6ddb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_framebuffer_CMAA @@ -0,0 +1,4 @@ +GL_INTEL_framebuffer_CMAA +http://www.opengl.org/registry/specs/INTEL/framebuffer_CMAA.txt +GL_INTEL_framebuffer_CMAA + diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_map_texture b/Windows/glew/auto/extensions/gl/GL_INTEL_map_texture new file mode 100644 index 00000000..c8670fb9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_map_texture @@ -0,0 +1,11 @@ +GL_INTEL_map_texture +http://www.opengl.org/registry/specs/INTEL/map_texture.txt +GL_INTEL_map_texture + + GL_LAYOUT_DEFAULT_INTEL 0 + GL_LAYOUT_LINEAR_INTEL 1 + GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 + GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + void * glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout) + void glSyncTextureINTEL (GLuint texture) + void glUnmapTexture2DINTEL (GLuint texture, GLint level) diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_parallel_arrays b/Windows/glew/auto/extensions/gl/GL_INTEL_parallel_arrays new file mode 100644 index 00000000..ce18621b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_parallel_arrays @@ -0,0 +1,13 @@ +GL_INTEL_parallel_arrays +http://www.opengl.org/registry/specs/INTEL/parallel_arrays.txt +GL_INTEL_parallel_arrays + + GL_PARALLEL_ARRAYS_INTEL 0x83F4 + GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 + GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 + GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 + GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + void glColorPointervINTEL (GLint size, GLenum type, const void** pointer) + void glNormalPointervINTEL (GLenum type, const void** pointer) + void glTexCoordPointervINTEL (GLint size, GLenum type, const void** pointer) + void glVertexPointervINTEL (GLint size, GLenum type, const void** pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_performance_query b/Windows/glew/auto/extensions/gl/GL_INTEL_performance_query new file mode 100644 index 00000000..64775f75 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_performance_query @@ -0,0 +1,34 @@ +GL_INTEL_performance_query +http://www.opengl.org/registry/specs/INTEL/performance_query.txt +GL_INTEL_performance_query + + GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 + GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 + GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 + GL_PERFQUERY_FLUSH_INTEL 0x83FA + GL_PERFQUERY_WAIT_INTEL 0x83FB + GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 + GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 + GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 + GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 + GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 + GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 + GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 + GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 + GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA + GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB + GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC + GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD + GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE + GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF + GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 + void glBeginPerfQueryINTEL (GLuint queryHandle) + void glCreatePerfQueryINTEL (GLuint queryId, GLuint* queryHandle) + void glDeletePerfQueryINTEL (GLuint queryHandle) + void glEndPerfQueryINTEL (GLuint queryHandle) + void glGetFirstPerfQueryIdINTEL (GLuint* queryId) + void glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint* nextQueryId) + void glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue) + void glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten) + void glGetPerfQueryIdByNameINTEL (GLchar* queryName, GLuint *queryId) + void glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask) diff --git a/Windows/glew/auto/extensions/gl/GL_INTEL_texture_scissor b/Windows/glew/auto/extensions/gl/GL_INTEL_texture_scissor new file mode 100644 index 00000000..f28d4842 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_INTEL_texture_scissor @@ -0,0 +1,6 @@ +GL_INTEL_texture_scissor +http://www.opengl.org/registry/specs/INTEL/texture_scissor.txt +GL_INTEL_texture_scissor + + void glTexScissorFuncINTEL (GLenum target, GLenum lfunc, GLenum hfunc) + void glTexScissorINTEL (GLenum target, GLclampf tlow, GLclampf thigh) diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_blend_equation_advanced b/Windows/glew/auto/extensions/gl/GL_KHR_blend_equation_advanced new file mode 100644 index 00000000..b15b09eb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_blend_equation_advanced @@ -0,0 +1,21 @@ +GL_KHR_blend_equation_advanced +http://www.opengl.org/registry/specs/KHR/blend_equation_advanced.txt +GL_KHR_blend_equation_advanced + + GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 + GL_MULTIPLY_KHR 0x9294 + GL_SCREEN_KHR 0x9295 + GL_OVERLAY_KHR 0x9296 + GL_DARKEN_KHR 0x9297 + GL_LIGHTEN_KHR 0x9298 + GL_COLORDODGE_KHR 0x9299 + GL_COLORBURN_KHR 0x929A + GL_HARDLIGHT_KHR 0x929B + GL_SOFTLIGHT_KHR 0x929C + GL_DIFFERENCE_KHR 0x929E + GL_EXCLUSION_KHR 0x92A0 + GL_HSL_HUE_KHR 0x92AD + GL_HSL_SATURATION_KHR 0x92AE + GL_HSL_COLOR_KHR 0x92AF + GL_HSL_LUMINOSITY_KHR 0x92B0 + void glBlendBarrierKHR (void) diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_blend_equation_advanced_coherent b/Windows/glew/auto/extensions/gl/GL_KHR_blend_equation_advanced_coherent new file mode 100644 index 00000000..840ae26b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_blend_equation_advanced_coherent @@ -0,0 +1,4 @@ +GL_KHR_blend_equation_advanced_coherent +http://www.opengl.org/registry/specs/KHR/blend_equation_advanced.txt +GL_KHR_blend_equation_advanced_coherent + diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_context_flush_control b/Windows/glew/auto/extensions/gl/GL_KHR_context_flush_control new file mode 100644 index 00000000..1c622204 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_context_flush_control @@ -0,0 +1,4 @@ +GL_KHR_context_flush_control +http://www.opengl.org/registry/specs/KHR/context_flush_control.txt +GL_KHR_context_flush_control + diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_debug b/Windows/glew/auto/extensions/gl/GL_KHR_debug new file mode 100644 index 00000000..a7c19158 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_debug @@ -0,0 +1,55 @@ +GL_KHR_debug +http://www.opengl.org/registry/specs/KHR/debug.txt +GL_KHR_debug + + GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 + GL_STACK_OVERFLOW 0x0503 + GL_STACK_UNDERFLOW 0x0504 + GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 + GL_DEBUG_CALLBACK_FUNCTION 0x8244 + GL_DEBUG_CALLBACK_USER_PARAM 0x8245 + GL_DEBUG_SOURCE_API 0x8246 + GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 + GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 + GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 + GL_DEBUG_SOURCE_APPLICATION 0x824A + GL_DEBUG_SOURCE_OTHER 0x824B + GL_DEBUG_TYPE_ERROR 0x824C + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E + GL_DEBUG_TYPE_PORTABILITY 0x824F + GL_DEBUG_TYPE_PERFORMANCE 0x8250 + GL_DEBUG_TYPE_OTHER 0x8251 + GL_DEBUG_TYPE_MARKER 0x8268 + GL_DEBUG_TYPE_PUSH_GROUP 0x8269 + GL_DEBUG_TYPE_POP_GROUP 0x826A + GL_DEBUG_SEVERITY_NOTIFICATION 0x826B + GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C + GL_DEBUG_GROUP_STACK_DEPTH 0x826D + GL_BUFFER 0x82E0 + GL_SHADER 0x82E1 + GL_PROGRAM 0x82E2 + GL_QUERY 0x82E3 + GL_PROGRAM_PIPELINE 0x82E4 + GL_SAMPLER 0x82E6 + GL_DISPLAY_LIST 0x82E7 + GL_MAX_LABEL_LENGTH 0x82E8 + GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 + GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 + GL_DEBUG_LOGGED_MESSAGES 0x9145 + GL_DEBUG_SEVERITY_HIGH 0x9146 + GL_DEBUG_SEVERITY_MEDIUM 0x9147 + GL_DEBUG_SEVERITY_LOW 0x9148 + GL_DEBUG_OUTPUT 0x92E0 + void glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam) + void glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled) + void glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf) + GLuint glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog) + void glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label) + void glGetObjectPtrLabel (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label) + void glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar* label) + void glObjectPtrLabel (void* ptr, GLsizei length, const GLchar* label) + void glPopDebugGroup (void) + void glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar * message) + typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_no_error b/Windows/glew/auto/extensions/gl/GL_KHR_no_error new file mode 100644 index 00000000..b22ff2c5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_no_error @@ -0,0 +1,5 @@ +GL_KHR_no_error +http://www.opengl.org/registry/specs/KHR/no_error.txt +GL_KHR_no_error + + GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_parallel_shader_compile b/Windows/glew/auto/extensions/gl/GL_KHR_parallel_shader_compile new file mode 100644 index 00000000..7470f7ee --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_parallel_shader_compile @@ -0,0 +1,7 @@ +GL_KHR_parallel_shader_compile +http://www.opengl.org/registry/specs/KHR/parallel_shader_compile.txt +GL_KHR_parallel_shader_compile + + GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 + GL_COMPLETION_STATUS_KHR 0x91B1 + void glMaxShaderCompilerThreadsKHR (GLuint count) diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_robust_buffer_access_behavior b/Windows/glew/auto/extensions/gl/GL_KHR_robust_buffer_access_behavior new file mode 100644 index 00000000..12ea32b4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_robust_buffer_access_behavior @@ -0,0 +1,4 @@ +GL_KHR_robust_buffer_access_behavior +http://www.opengl.org/registry/specs/KHR/robust_buffer_access_behavior.txt +GL_KHR_robust_buffer_access_behavior + diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_robustness b/Windows/glew/auto/extensions/gl/GL_KHR_robustness new file mode 100644 index 00000000..0fc0d24b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_robustness @@ -0,0 +1,16 @@ +GL_KHR_robustness +http://www.opengl.org/registry/specs/KHR/robustness.txt +GL_KHR_robustness + + GL_CONTEXT_LOST 0x0507 + GL_LOSE_CONTEXT_ON_RESET 0x8252 + GL_GUILTY_CONTEXT_RESET 0x8253 + GL_INNOCENT_CONTEXT_RESET 0x8254 + GL_UNKNOWN_CONTEXT_RESET 0x8255 + GL_RESET_NOTIFICATION_STRATEGY 0x8256 + GL_NO_RESET_NOTIFICATION 0x8261 + GL_CONTEXT_ROBUST_ACCESS 0x90F3 + void glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat* params) + void glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint* params) + void glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint* params) + void glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_hdr b/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_hdr new file mode 100644 index 00000000..32053bf2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_hdr @@ -0,0 +1,32 @@ +GL_KHR_texture_compression_astc_hdr +http://www.opengl.org/registry/specs/KHR/texture_compression_astc_hdr.txt +GL_KHR_texture_compression_astc_hdr + + GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 + GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 + GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 + GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 + GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 + GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 + GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 + GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 + GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 + GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 + GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA + GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB + GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC + GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_ldr b/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_ldr new file mode 100644 index 00000000..96d36c57 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_ldr @@ -0,0 +1,32 @@ +GL_KHR_texture_compression_astc_ldr +http://www.opengl.org/registry/specs/KHR/texture_compression_astc_hdr.txt +GL_KHR_texture_compression_astc_ldr + + GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 + GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 + GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 + GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 + GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 + GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 + GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 + GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 + GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 + GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 + GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA + GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB + GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC + GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD diff --git a/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_sliced_3d b/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_sliced_3d new file mode 100644 index 00000000..525455a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KHR_texture_compression_astc_sliced_3d @@ -0,0 +1,4 @@ +GL_KHR_texture_compression_astc_sliced_3d +http://www.opengl.org/registry/specs/KHR/texture_compression_astc_sliced_3d.txt +GL_KHR_texture_compression_astc_sliced_3d + diff --git a/Windows/glew/auto/extensions/gl/GL_KTX_buffer_region b/Windows/glew/auto/extensions/gl/GL_KTX_buffer_region new file mode 100644 index 00000000..ef281b1d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_KTX_buffer_region @@ -0,0 +1,13 @@ +GL_KTX_buffer_region + +GL_KTX_buffer_region + + GL_KTX_FRONT_REGION 0x0 + GL_KTX_BACK_REGION 0x1 + GL_KTX_Z_REGION 0x2 + GL_KTX_STENCIL_REGION 0x3 + GLuint glBufferRegionEnabled (void) + GLuint glNewBufferRegion (GLenum region) + void glDeleteBufferRegion (GLenum region) + void glReadBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height) + void glDrawBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest) diff --git a/Windows/glew/auto/extensions/gl/GL_MESAX_texture_stack b/Windows/glew/auto/extensions/gl/GL_MESAX_texture_stack new file mode 100644 index 00000000..8588740a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_MESAX_texture_stack @@ -0,0 +1,10 @@ +GL_MESAX_texture_stack +http://www.opengl.org/registry/specs/MESAX/texture_stack.txt +GL_MESAX_texture_stack + + GL_TEXTURE_1D_STACK_MESAX 0x8759 + GL_TEXTURE_2D_STACK_MESAX 0x875A + GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B + GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C + GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D + GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E diff --git a/Windows/glew/auto/extensions/gl/GL_MESA_pack_invert b/Windows/glew/auto/extensions/gl/GL_MESA_pack_invert new file mode 100644 index 00000000..0ac3ecf9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_MESA_pack_invert @@ -0,0 +1,5 @@ +GL_MESA_pack_invert +http://www.opengl.org/registry/specs/MESA/pack_invert.txt +GL_MESA_pack_invert + + GL_PACK_INVERT_MESA 0x8758 diff --git a/Windows/glew/auto/extensions/gl/GL_MESA_resize_buffers b/Windows/glew/auto/extensions/gl/GL_MESA_resize_buffers new file mode 100644 index 00000000..c96d322e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_MESA_resize_buffers @@ -0,0 +1,5 @@ +GL_MESA_resize_buffers +http://www.opengl.org/registry/specs/MESA/resize_buffers.txt +GL_MESA_resize_buffers + + void glResizeBuffersMESA (void) diff --git a/Windows/glew/auto/extensions/gl/GL_MESA_shader_integer_functions b/Windows/glew/auto/extensions/gl/GL_MESA_shader_integer_functions new file mode 100644 index 00000000..93be56f3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_MESA_shader_integer_functions @@ -0,0 +1,4 @@ +GL_MESA_shader_integer_functions +http://www.opengl.org/registry/specs/MESA/shader_integer_functions.txt +GL_MESA_shader_integer_functions + diff --git a/Windows/glew/auto/extensions/gl/GL_MESA_window_pos b/Windows/glew/auto/extensions/gl/GL_MESA_window_pos new file mode 100644 index 00000000..13bf7eef --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_MESA_window_pos @@ -0,0 +1,28 @@ +GL_MESA_window_pos +http://www.opengl.org/registry/specs/MESA/window_pos.txt +GL_MESA_window_pos + + void glWindowPos2dMESA (GLdouble x, GLdouble y) + void glWindowPos2dvMESA (const GLdouble* p) + void glWindowPos2fMESA (GLfloat x, GLfloat y) + void glWindowPos2fvMESA (const GLfloat* p) + void glWindowPos2iMESA (GLint x, GLint y) + void glWindowPos2ivMESA (const GLint* p) + void glWindowPos2sMESA (GLshort x, GLshort y) + void glWindowPos2svMESA (const GLshort* p) + void glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z) + void glWindowPos3dvMESA (const GLdouble* p) + void glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z) + void glWindowPos3fvMESA (const GLfloat* p) + void glWindowPos3iMESA (GLint x, GLint y, GLint z) + void glWindowPos3ivMESA (const GLint* p) + void glWindowPos3sMESA (GLshort x, GLshort y, GLshort z) + void glWindowPos3svMESA (const GLshort* p) + void glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble) + void glWindowPos4dvMESA (const GLdouble* p) + void glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glWindowPos4fvMESA (const GLfloat* p) + void glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w) + void glWindowPos4ivMESA (const GLint* p) + void glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w) + void glWindowPos4svMESA (const GLshort* p) diff --git a/Windows/glew/auto/extensions/gl/GL_MESA_ycbcr_texture b/Windows/glew/auto/extensions/gl/GL_MESA_ycbcr_texture new file mode 100644 index 00000000..d54bb413 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_MESA_ycbcr_texture @@ -0,0 +1,7 @@ +GL_MESA_ycbcr_texture +http://www.opengl.org/registry/specs/MESA/ycbcr_texture.txt +GL_MESA_ycbcr_texture + + GL_UNSIGNED_SHORT_8_8_MESA 0x85BA + GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB + GL_YCBCR_MESA 0x8757 diff --git a/Windows/glew/auto/extensions/gl/GL_NVX_blend_equation_advanced_multi_draw_buffers b/Windows/glew/auto/extensions/gl/GL_NVX_blend_equation_advanced_multi_draw_buffers new file mode 100644 index 00000000..346f87c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NVX_blend_equation_advanced_multi_draw_buffers @@ -0,0 +1,4 @@ +GL_NVX_blend_equation_advanced_multi_draw_buffers +http://www.opengl.org/registry/specs/NVX/nvx_blend_equation_advanced_multi_draw_buffers.txt +GL_NVX_blend_equation_advanced_multi_draw_buffers + diff --git a/Windows/glew/auto/extensions/gl/GL_NVX_conditional_render b/Windows/glew/auto/extensions/gl/GL_NVX_conditional_render new file mode 100644 index 00000000..d276f9c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NVX_conditional_render @@ -0,0 +1,6 @@ +GL_NVX_conditional_render +http://www.opengl.org/registry/specs/NVX/nvx_conditional_render.txt +GL_NVX_conditional_render + + void glBeginConditionalRenderNVX (GLuint id) + void glEndConditionalRenderNVX (void) diff --git a/Windows/glew/auto/extensions/gl/GL_NVX_gpu_memory_info b/Windows/glew/auto/extensions/gl/GL_NVX_gpu_memory_info new file mode 100644 index 00000000..a8d97b9b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NVX_gpu_memory_info @@ -0,0 +1,9 @@ +GL_NVX_gpu_memory_info +http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt +GL_NVX_gpu_memory_info + + GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 + GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 + GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 + GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A + GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B diff --git a/Windows/glew/auto/extensions/gl/GL_NVX_linked_gpu_multicast b/Windows/glew/auto/extensions/gl/GL_NVX_linked_gpu_multicast new file mode 100644 index 00000000..8c654120 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NVX_linked_gpu_multicast @@ -0,0 +1,9 @@ +GL_NVX_linked_gpu_multicast +http://www.opengl.org/registry/specs/NVX/nvx_linked_gpu_multicast.txt +GL_NVX_linked_gpu_multicast + + GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 + GL_MAX_LGPU_GPUS_NVX 0x92BA + void glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) + void glLGPUInterlockNVX (void) + void glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_3dvision_settings b/Windows/glew/auto/extensions/gl/GL_NV_3dvision_settings new file mode 100644 index 00000000..4b68a4d7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_3dvision_settings @@ -0,0 +1,13 @@ +GL_NV_3dvision_settings +http://www.opengl.org/registry/specs/NV/3dvision_settings.txt +GL_NV_3dvision_settings + + GL_3DVISION_STEREO_NV 0x90F4 + GL_STEREO_SEPARATION_NV 0x90F5 + GL_STEREO_CONVERGENCE_NV 0x90F6 + GL_STEREO_CUTOFF_NV 0x90F7 + GL_STEREO_PROJECTION_NV 0x90F8 + GL_STEREO_PROJECTION_PERSPECTIVE_NV 0x90F9 + GL_STEREO_PROJECTION_ORTHO_NV 0x90FA + void glStereoParameterfNV (GLenum pname, GLfloat param) + void glStereoParameteriNV (GLenum pname, GLint param) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_EGL_stream_consumer_external b/Windows/glew/auto/extensions/gl/GL_NV_EGL_stream_consumer_external new file mode 100644 index 00000000..0bd199be --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_EGL_stream_consumer_external @@ -0,0 +1,8 @@ +GL_NV_EGL_stream_consumer_external +http://www.opengl.org/registry/specs/NV/EGL_stream_consumer_external.txt +GL_NV_EGL_stream_consumer_external + + GL_TEXTURE_EXTERNAL_OES 0x8D65 + GL_SAMPLER_EXTERNAL_OES 0x8D66 + GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 + GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_alpha_to_coverage_dither_control b/Windows/glew/auto/extensions/gl/GL_NV_alpha_to_coverage_dither_control new file mode 100644 index 00000000..7d00582b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_alpha_to_coverage_dither_control @@ -0,0 +1,8 @@ +GL_NV_alpha_to_coverage_dither_control +http://www.opengl.org/registry/specs/NV/alpha_to_coverage_dither_control.txt +GL_NV_alpha_to_coverage_dither_control + + GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF + GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D + GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E + GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_bgr b/Windows/glew/auto/extensions/gl/GL_NV_bgr new file mode 100644 index 00000000..c8e0dccc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_bgr @@ -0,0 +1,5 @@ +GL_NV_bgr +http://www.opengl.org/registry/specs/NV/bgr.txt +GL_NV_bgr + + GL_BGR_NV 0x80E0 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_bindless_multi_draw_indirect b/Windows/glew/auto/extensions/gl/GL_NV_bindless_multi_draw_indirect new file mode 100644 index 00000000..a7c83082 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_bindless_multi_draw_indirect @@ -0,0 +1,6 @@ +GL_NV_bindless_multi_draw_indirect +http://www.opengl.org/registry/specs/NV/bindless_multi_draw_indirect.txt +GL_NV_bindless_multi_draw_indirect + + void glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount) + void glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_bindless_multi_draw_indirect_count b/Windows/glew/auto/extensions/gl/GL_NV_bindless_multi_draw_indirect_count new file mode 100644 index 00000000..2604c801 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_bindless_multi_draw_indirect_count @@ -0,0 +1,6 @@ +GL_NV_bindless_multi_draw_indirect_count +http://www.opengl.org/registry/specs/NV/bindless_multi_draw_indirect_count.txt +GL_NV_bindless_multi_draw_indirect_count + + void glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount) + void glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_bindless_texture b/Windows/glew/auto/extensions/gl/GL_NV_bindless_texture new file mode 100644 index 00000000..46f10e15 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_bindless_texture @@ -0,0 +1,17 @@ +GL_NV_bindless_texture +http://www.opengl.org/registry/specs/NV/bindless_texture.txt +GL_NV_bindless_texture + + GLuint64 glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format) + GLuint64 glGetTextureHandleNV (GLuint texture) + GLuint64 glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler) + GLboolean glIsImageHandleResidentNV (GLuint64 handle) + GLboolean glIsTextureHandleResidentNV (GLuint64 handle) + void glMakeImageHandleNonResidentNV (GLuint64 handle) + void glMakeImageHandleResidentNV (GLuint64 handle, GLenum access) + void glMakeTextureHandleNonResidentNV (GLuint64 handle) + void glMakeTextureHandleResidentNV (GLuint64 handle) + void glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value) + void glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64* values) + void glUniformHandleui64NV (GLint location, GLuint64 value) + void glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64* value) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_blend_equation_advanced b/Windows/glew/auto/extensions/gl/GL_NV_blend_equation_advanced new file mode 100644 index 00000000..8fa3c1d2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_blend_equation_advanced @@ -0,0 +1,56 @@ +GL_NV_blend_equation_advanced +http://www.opengl.org/registry/specs/NV/blend_equation_advanced.txt +GL_NV_blend_equation_advanced + + GL_XOR_NV 0x1506 + GL_RED_NV 0x1903 + GL_GREEN_NV 0x1904 + GL_BLUE_NV 0x1905 + GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 + GL_BLEND_OVERLAP_NV 0x9281 + GL_UNCORRELATED_NV 0x9282 + GL_DISJOINT_NV 0x9283 + GL_CONJOINT_NV 0x9284 + GL_BLEND_ADVANCED_COHERENT_NV 0x9285 + GL_SRC_NV 0x9286 + GL_DST_NV 0x9287 + GL_SRC_OVER_NV 0x9288 + GL_DST_OVER_NV 0x9289 + GL_SRC_IN_NV 0x928A + GL_DST_IN_NV 0x928B + GL_SRC_OUT_NV 0x928C + GL_DST_OUT_NV 0x928D + GL_SRC_ATOP_NV 0x928E + GL_DST_ATOP_NV 0x928F + GL_PLUS_NV 0x9291 + GL_PLUS_DARKER_NV 0x9292 + GL_MULTIPLY_NV 0x9294 + GL_SCREEN_NV 0x9295 + GL_OVERLAY_NV 0x9296 + GL_DARKEN_NV 0x9297 + GL_LIGHTEN_NV 0x9298 + GL_COLORDODGE_NV 0x9299 + GL_COLORBURN_NV 0x929A + GL_HARDLIGHT_NV 0x929B + GL_SOFTLIGHT_NV 0x929C + GL_DIFFERENCE_NV 0x929E + GL_MINUS_NV 0x929F + GL_EXCLUSION_NV 0x92A0 + GL_CONTRAST_NV 0x92A1 + GL_INVERT_RGB_NV 0x92A3 + GL_LINEARDODGE_NV 0x92A4 + GL_LINEARBURN_NV 0x92A5 + GL_VIVIDLIGHT_NV 0x92A6 + GL_LINEARLIGHT_NV 0x92A7 + GL_PINLIGHT_NV 0x92A8 + GL_HARDMIX_NV 0x92A9 + GL_HSL_HUE_NV 0x92AD + GL_HSL_SATURATION_NV 0x92AE + GL_HSL_COLOR_NV 0x92AF + GL_HSL_LUMINOSITY_NV 0x92B0 + GL_PLUS_CLAMPED_NV 0x92B1 + GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 + GL_MINUS_CLAMPED_NV 0x92B3 + GL_INVERT_OVG_NV 0x92B4 + void glBlendBarrierNV (void) + void glBlendParameteriNV (GLenum pname, GLint value) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_blend_equation_advanced_coherent b/Windows/glew/auto/extensions/gl/GL_NV_blend_equation_advanced_coherent new file mode 100644 index 00000000..ef9607a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_blend_equation_advanced_coherent @@ -0,0 +1,4 @@ +GL_NV_blend_equation_advanced_coherent +http://www.opengl.org/registry/specs/NV/blend_equation_advanced.txt +GL_NV_blend_equation_advanced_coherent + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_blend_minmax_factor b/Windows/glew/auto/extensions/gl/GL_NV_blend_minmax_factor new file mode 100644 index 00000000..8843d8de --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_blend_minmax_factor @@ -0,0 +1,6 @@ +GL_NV_blend_minmax_factor +http://www.opengl.org/registry/specs/NV/blend_minmax_factor.txt +GL_NV_blend_minmax_factor + + GL_FACTOR_MIN_AMD 0x901C + GL_FACTOR_MAX_AMD 0x901D diff --git a/Windows/glew/auto/extensions/gl/GL_NV_blend_square b/Windows/glew/auto/extensions/gl/GL_NV_blend_square new file mode 100644 index 00000000..85686c7e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_blend_square @@ -0,0 +1,4 @@ +GL_NV_blend_square +http://www.opengl.org/registry/specs/NV/blend_square.txt +GL_NV_blend_square + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_clip_space_w_scaling b/Windows/glew/auto/extensions/gl/GL_NV_clip_space_w_scaling new file mode 100644 index 00000000..c4e9a922 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_clip_space_w_scaling @@ -0,0 +1,8 @@ +GL_NV_clip_space_w_scaling +http://www.opengl.org/registry/specs/NV/clip_space_w_scaling.txt +GL_NV_clip_space_w_scaling + + GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C + GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D + GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E + void glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_command_list b/Windows/glew/auto/extensions/gl/GL_NV_command_list new file mode 100644 index 00000000..474221a2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_command_list @@ -0,0 +1,40 @@ +GL_NV_command_list +http://www.opengl.org/registry/specs/NV/command_list.txt +GL_NV_command_list + + GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 + GL_NOP_COMMAND_NV 0x0001 + GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 + GL_DRAW_ARRAYS_COMMAND_NV 0x0003 + GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 + GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 + GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 + GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 + GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 + GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 + GL_UNIFORM_ADDRESS_COMMAND_NV 0x000a + GL_BLEND_COLOR_COMMAND_NV 0x000b + GL_STENCIL_REF_COMMAND_NV 0x000c + GL_LINE_WIDTH_COMMAND_NV 0x000d + GL_POLYGON_OFFSET_COMMAND_NV 0x000e + GL_ALPHA_REF_COMMAND_NV 0x000f + GL_VIEWPORT_COMMAND_NV 0x0010 + GL_SCISSOR_COMMAND_NV 0x0011 + GL_FRONT_FACE_COMMAND_NV 0x0012 + void glCallCommandListNV (GLuint list) + void glCommandListSegmentsNV (GLuint list, GLuint segments) + void glCompileCommandListNV (GLuint list) + void glCreateCommandListsNV (GLsizei n, GLuint* lists) + void glCreateStatesNV (GLsizei n, GLuint* states) + void glDeleteCommandListsNV (GLsizei n, const GLuint* lists) + void glDeleteStatesNV (GLsizei n, const GLuint* states) + void glDrawCommandsAddressNV (GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count) + void glDrawCommandsNV (GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count) + void glDrawCommandsStatesAddressNV (const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count) + void glDrawCommandsStatesNV (GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count) + GLuint glGetCommandHeaderNV (GLenum tokenID, GLuint size) + GLushort glGetStageIndexNV (GLenum shadertype) + GLboolean glIsCommandListNV (GLuint list) + GLboolean glIsStateNV (GLuint state) + void glListDrawCommandsStatesClientNV (GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count) + void glStateCaptureNV (GLuint state, GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_compute_program5 b/Windows/glew/auto/extensions/gl/GL_NV_compute_program5 new file mode 100644 index 00000000..4592a062 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_compute_program5 @@ -0,0 +1,6 @@ +GL_NV_compute_program5 +http://www.opengl.org/registry/specs/NV/compute_program5.txt +GL_NV_compute_program5 + + GL_COMPUTE_PROGRAM_NV 0x90FB + GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC diff --git a/Windows/glew/auto/extensions/gl/GL_NV_conditional_render b/Windows/glew/auto/extensions/gl/GL_NV_conditional_render new file mode 100644 index 00000000..616dae8a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_conditional_render @@ -0,0 +1,10 @@ +GL_NV_conditional_render +http://www.opengl.org/registry/specs/NV/conditional_render.txt +GL_NV_conditional_render + + GL_QUERY_WAIT_NV 0x8E13 + GL_QUERY_NO_WAIT_NV 0x8E14 + GL_QUERY_BY_REGION_WAIT_NV 0x8E15 + GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + void glBeginConditionalRenderNV (GLuint id, GLenum mode) + void glEndConditionalRenderNV (void) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster b/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster new file mode 100644 index 00000000..d1feb8bd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster @@ -0,0 +1,9 @@ +GL_NV_conservative_raster +http://www.opengl.org/registry/specs/NV/conservative_raster.txt +GL_NV_conservative_raster + + GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 + GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 + GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 + GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 + void glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster_dilate b/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster_dilate new file mode 100644 index 00000000..9cea89cc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster_dilate @@ -0,0 +1,8 @@ +GL_NV_conservative_raster_dilate +http://www.opengl.org/registry/specs/NV/conservative_raster_dilate.txt +GL_NV_conservative_raster_dilate + + GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 + GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A + GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B + void glConservativeRasterParameterfNV (GLenum pname, GLfloat value) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster_pre_snap_triangles b/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster_pre_snap_triangles new file mode 100644 index 00000000..58521506 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_conservative_raster_pre_snap_triangles @@ -0,0 +1,8 @@ +GL_NV_conservative_raster_pre_snap_triangles +http://www.opengl.org/registry/specs/NV/conservative_raster_pre_snap_triangles.txt +GL_NV_conservative_raster_pre_snap_triangles + + GL_CONSERVATIVE_RASTER_MODE_NV 0x954D + GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E + GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F + void glConservativeRasterParameteriNV (GLenum pname, GLint param) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_copy_buffer b/Windows/glew/auto/extensions/gl/GL_NV_copy_buffer new file mode 100644 index 00000000..d489f50f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_copy_buffer @@ -0,0 +1,7 @@ +GL_NV_copy_buffer +http://www.opengl.org/registry/specs/NV/copy_buffer.txt +GL_NV_copy_buffer + + GL_COPY_READ_BUFFER_NV 0x8F36 + GL_COPY_WRITE_BUFFER_NV 0x8F37 + void glCopyBufferSubDataNV (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_copy_depth_to_color b/Windows/glew/auto/extensions/gl/GL_NV_copy_depth_to_color new file mode 100644 index 00000000..5c140705 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_copy_depth_to_color @@ -0,0 +1,6 @@ +GL_NV_copy_depth_to_color +http://www.opengl.org/registry/specs/NV/copy_depth_to_color.txt +GL_NV_copy_depth_to_color + + GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E + GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_copy_image b/Windows/glew/auto/extensions/gl/GL_NV_copy_image new file mode 100644 index 00000000..89bb757e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_copy_image @@ -0,0 +1,5 @@ +GL_NV_copy_image +http://www.opengl.org/registry/specs/NV/copy_image.txt +GL_NV_copy_image + + void glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_deep_texture3D b/Windows/glew/auto/extensions/gl/GL_NV_deep_texture3D new file mode 100644 index 00000000..64967cdf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_deep_texture3D @@ -0,0 +1,6 @@ +GL_NV_deep_texture3D +http://www.opengl.org/registry/specs/NV/deep_texture3D.txt +GL_NV_deep_texture3D + + GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 + GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_depth_buffer_float b/Windows/glew/auto/extensions/gl/GL_NV_depth_buffer_float new file mode 100644 index 00000000..421d266d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_depth_buffer_float @@ -0,0 +1,11 @@ +GL_NV_depth_buffer_float +http://developer.download.nvidia.com/opengl/specs/GL_NV_depth_buffer_float.txt +GL_NV_depth_buffer_float + + GL_DEPTH_COMPONENT32F_NV 0x8DAB + GL_DEPTH32F_STENCIL8_NV 0x8DAC + GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD + GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + void glDepthRangedNV (GLdouble zNear, GLdouble zFar) + void glClearDepthdNV (GLdouble depth) + void glDepthBoundsdNV (GLdouble zmin, GLdouble zmax) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_depth_clamp b/Windows/glew/auto/extensions/gl/GL_NV_depth_clamp new file mode 100644 index 00000000..b3283517 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_depth_clamp @@ -0,0 +1,5 @@ +GL_NV_depth_clamp +http://www.opengl.org/registry/specs/NV/depth_clamp.txt +GL_NV_depth_clamp + + GL_DEPTH_CLAMP_NV 0x864F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_depth_range_unclamped b/Windows/glew/auto/extensions/gl/GL_NV_depth_range_unclamped new file mode 100644 index 00000000..b63a0eec --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_depth_range_unclamped @@ -0,0 +1,9 @@ +GL_NV_depth_range_unclamped + +GL_NV_depth_range_unclamped + + GL_SAMPLE_COUNT_BITS_NV 0x8864 + GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 + GL_QUERY_RESULT_NV 0x8866 + GL_QUERY_RESULT_AVAILABLE_NV 0x8867 + GL_SAMPLE_COUNT_NV 0x8914 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_draw_buffers b/Windows/glew/auto/extensions/gl/GL_NV_draw_buffers new file mode 100644 index 00000000..0147709e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_draw_buffers @@ -0,0 +1,38 @@ +GL_NV_draw_buffers +http://www.opengl.org/registry/specs/NV/draw_buffers.txt +GL_NV_draw_buffers + + GL_MAX_DRAW_BUFFERS_NV 0x8824 + GL_DRAW_BUFFER0_NV 0x8825 + GL_DRAW_BUFFER1_NV 0x8826 + GL_DRAW_BUFFER2_NV 0x8827 + GL_DRAW_BUFFER3_NV 0x8828 + GL_DRAW_BUFFER4_NV 0x8829 + GL_DRAW_BUFFER5_NV 0x882A + GL_DRAW_BUFFER6_NV 0x882B + GL_DRAW_BUFFER7_NV 0x882C + GL_DRAW_BUFFER8_NV 0x882D + GL_DRAW_BUFFER9_NV 0x882E + GL_DRAW_BUFFER10_NV 0x882F + GL_DRAW_BUFFER11_NV 0x8830 + GL_DRAW_BUFFER12_NV 0x8831 + GL_DRAW_BUFFER13_NV 0x8832 + GL_DRAW_BUFFER14_NV 0x8833 + GL_DRAW_BUFFER15_NV 0x8834 + GL_COLOR_ATTACHMENT0_NV 0x8CE0 + GL_COLOR_ATTACHMENT1_NV 0x8CE1 + GL_COLOR_ATTACHMENT2_NV 0x8CE2 + GL_COLOR_ATTACHMENT3_NV 0x8CE3 + GL_COLOR_ATTACHMENT4_NV 0x8CE4 + GL_COLOR_ATTACHMENT5_NV 0x8CE5 + GL_COLOR_ATTACHMENT6_NV 0x8CE6 + GL_COLOR_ATTACHMENT7_NV 0x8CE7 + GL_COLOR_ATTACHMENT8_NV 0x8CE8 + GL_COLOR_ATTACHMENT9_NV 0x8CE9 + GL_COLOR_ATTACHMENT10_NV 0x8CEA + GL_COLOR_ATTACHMENT11_NV 0x8CEB + GL_COLOR_ATTACHMENT12_NV 0x8CEC + GL_COLOR_ATTACHMENT13_NV 0x8CED + GL_COLOR_ATTACHMENT14_NV 0x8CEE + GL_COLOR_ATTACHMENT15_NV 0x8CEF + void glDrawBuffersNV (GLsizei n, const GLenum* bufs) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_draw_instanced b/Windows/glew/auto/extensions/gl/GL_NV_draw_instanced new file mode 100644 index 00000000..4d5caa1c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_draw_instanced @@ -0,0 +1,6 @@ +GL_NV_draw_instanced +http://www.opengl.org/registry/specs/NV/draw_instanced.txt +GL_NV_draw_instanced + + void glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_draw_texture b/Windows/glew/auto/extensions/gl/GL_NV_draw_texture new file mode 100644 index 00000000..c764faad --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_draw_texture @@ -0,0 +1,5 @@ +GL_NV_draw_texture +http://www.opengl.org/registry/specs/NV/draw_texture.txt +GL_NV_draw_texture + + void glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_draw_vulkan_image b/Windows/glew/auto/extensions/gl/GL_NV_draw_vulkan_image new file mode 100644 index 00000000..5af132c1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_draw_vulkan_image @@ -0,0 +1,10 @@ +GL_NV_draw_vulkan_image +http://www.opengl.org/registry/specs/NV/draw_vulkan_image.txt +GL_NV_draw_vulkan_image + + void glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1) + GLVULKANPROCNV glGetVkProcAddrNV (const GLchar* name) + void glSignalVkFenceNV (GLuint64 vkFence) + void glSignalVkSemaphoreNV (GLuint64 vkSemaphore) + void glWaitVkSemaphoreNV (GLuint64 vkSemaphore) + typedef void (APIENTRY *GLVULKANPROCNV)(void) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_evaluators b/Windows/glew/auto/extensions/gl/GL_NV_evaluators new file mode 100644 index 00000000..8c3a5927 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_evaluators @@ -0,0 +1,37 @@ +GL_NV_evaluators +http://www.opengl.org/registry/specs/NV/evaluators.txt +GL_NV_evaluators + + GL_EVAL_2D_NV 0x86C0 + GL_EVAL_TRIANGULAR_2D_NV 0x86C1 + GL_MAP_TESSELLATION_NV 0x86C2 + GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 + GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 + GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 + GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 + GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 + GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 + GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 + GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA + GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB + GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC + GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD + GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE + GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF + GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 + GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 + GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 + GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 + GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 + GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 + GL_MAX_MAP_TESSELLATION_NV 0x86D6 + GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + void glEvalMapsNV (GLenum target, GLenum mode) + void glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat* params) + void glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint* params) + void glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points) + void glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat* params) + void glGetMapParameterivNV (GLenum target, GLenum pname, GLint* params) + void glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points) + void glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat* params) + void glMapParameterivNV (GLenum target, GLenum pname, const GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_explicit_attrib_location b/Windows/glew/auto/extensions/gl/GL_NV_explicit_attrib_location new file mode 100644 index 00000000..cbdcf0c4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_explicit_attrib_location @@ -0,0 +1,4 @@ +GL_NV_explicit_attrib_location +http://www.opengl.org/registry/specs/NV/explicit_attrib_location.txt +GL_NV_explicit_attrib_location + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_explicit_multisample b/Windows/glew/auto/extensions/gl/GL_NV_explicit_multisample new file mode 100644 index 00000000..74ef2060 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_explicit_multisample @@ -0,0 +1,17 @@ +GL_NV_explicit_multisample +http://www.opengl.org/registry/specs/NV/explicit_multisample.txt +GL_NV_explicit_multisample + + GL_SAMPLE_POSITION_NV 0x8E50 + GL_SAMPLE_MASK_NV 0x8E51 + GL_SAMPLE_MASK_VALUE_NV 0x8E52 + GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 + GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 + GL_TEXTURE_RENDERBUFFER_NV 0x8E55 + GL_SAMPLER_RENDERBUFFER_NV 0x8E56 + GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 + GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 + GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + void glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat* val) + void glSampleMaskIndexedNV (GLuint index, GLbitfield mask) + void glTexRenderbufferNV (GLenum target, GLuint renderbuffer) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fbo_color_attachments b/Windows/glew/auto/extensions/gl/GL_NV_fbo_color_attachments new file mode 100644 index 00000000..4233d14d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fbo_color_attachments @@ -0,0 +1,21 @@ +GL_NV_fbo_color_attachments +http://www.opengl.org/registry/specs/NV/fbo_color_attachments.txt +GL_NV_fbo_color_attachments + + GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF + GL_COLOR_ATTACHMENT0_NV 0x8CE0 + GL_COLOR_ATTACHMENT1_NV 0x8CE1 + GL_COLOR_ATTACHMENT2_NV 0x8CE2 + GL_COLOR_ATTACHMENT3_NV 0x8CE3 + GL_COLOR_ATTACHMENT4_NV 0x8CE4 + GL_COLOR_ATTACHMENT5_NV 0x8CE5 + GL_COLOR_ATTACHMENT6_NV 0x8CE6 + GL_COLOR_ATTACHMENT7_NV 0x8CE7 + GL_COLOR_ATTACHMENT8_NV 0x8CE8 + GL_COLOR_ATTACHMENT9_NV 0x8CE9 + GL_COLOR_ATTACHMENT10_NV 0x8CEA + GL_COLOR_ATTACHMENT11_NV 0x8CEB + GL_COLOR_ATTACHMENT12_NV 0x8CEC + GL_COLOR_ATTACHMENT13_NV 0x8CED + GL_COLOR_ATTACHMENT14_NV 0x8CEE + GL_COLOR_ATTACHMENT15_NV 0x8CEF diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fence b/Windows/glew/auto/extensions/gl/GL_NV_fence new file mode 100644 index 00000000..7a5ef294 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fence @@ -0,0 +1,14 @@ +GL_NV_fence +http://www.opengl.org/registry/specs/NV/fence.txt +GL_NV_fence + + GL_ALL_COMPLETED_NV 0x84F2 + GL_FENCE_STATUS_NV 0x84F3 + GL_FENCE_CONDITION_NV 0x84F4 + void glDeleteFencesNV (GLsizei n, const GLuint* fences) + void glFinishFenceNV (GLuint fence) + void glGenFencesNV (GLsizei n, GLuint* fences) + void glGetFenceivNV (GLuint fence, GLenum pname, GLint* params) + GLboolean glIsFenceNV (GLuint fence) + void glSetFenceNV (GLuint fence, GLenum condition) + GLboolean glTestFenceNV (GLuint fence) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fill_rectangle b/Windows/glew/auto/extensions/gl/GL_NV_fill_rectangle new file mode 100644 index 00000000..18d30b4d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fill_rectangle @@ -0,0 +1,5 @@ +GL_NV_fill_rectangle +http://www.opengl.org/registry/specs/NV/fill_rectangle.txt +GL_NV_fill_rectangle + + GL_FILL_RECTANGLE_NV 0x933C diff --git a/Windows/glew/auto/extensions/gl/GL_NV_float_buffer b/Windows/glew/auto/extensions/gl/GL_NV_float_buffer new file mode 100644 index 00000000..7fa464c6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_float_buffer @@ -0,0 +1,19 @@ +GL_NV_float_buffer +http://www.opengl.org/registry/specs/NV/float_buffer.txt +GL_NV_float_buffer + + GL_FLOAT_R_NV 0x8880 + GL_FLOAT_RG_NV 0x8881 + GL_FLOAT_RGB_NV 0x8882 + GL_FLOAT_RGBA_NV 0x8883 + GL_FLOAT_R16_NV 0x8884 + GL_FLOAT_R32_NV 0x8885 + GL_FLOAT_RG16_NV 0x8886 + GL_FLOAT_RG32_NV 0x8887 + GL_FLOAT_RGB16_NV 0x8888 + GL_FLOAT_RGB32_NV 0x8889 + GL_FLOAT_RGBA16_NV 0x888A + GL_FLOAT_RGBA32_NV 0x888B + GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C + GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D + GL_FLOAT_RGBA_MODE_NV 0x888E diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fog_distance b/Windows/glew/auto/extensions/gl/GL_NV_fog_distance new file mode 100644 index 00000000..16fb2495 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fog_distance @@ -0,0 +1,7 @@ +GL_NV_fog_distance +http://www.opengl.org/registry/specs/NV/fog_distance.txt +GL_NV_fog_distance + + GL_FOG_DISTANCE_MODE_NV 0x855A + GL_EYE_RADIAL_NV 0x855B + GL_EYE_PLANE_ABSOLUTE_NV 0x855C diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fragment_coverage_to_color b/Windows/glew/auto/extensions/gl/GL_NV_fragment_coverage_to_color new file mode 100644 index 00000000..e1c5ec40 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fragment_coverage_to_color @@ -0,0 +1,7 @@ +GL_NV_fragment_coverage_to_color +http://www.opengl.org/registry/specs/NV/fragment_coverage_to_color.txt +GL_NV_fragment_coverage_to_color + + GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD + GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE + void glFragmentCoverageColorNV (GLuint color) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fragment_program b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program new file mode 100644 index 00000000..e660ff00 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program @@ -0,0 +1,16 @@ +GL_NV_fragment_program +http://www.opengl.org/registry/specs/NV/fragment_program.txt +GL_NV_fragment_program + + GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 + GL_FRAGMENT_PROGRAM_NV 0x8870 + GL_MAX_TEXTURE_COORDS_NV 0x8871 + GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 + GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 + GL_PROGRAM_ERROR_STRING_NV 0x8874 + void glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params) + void glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params) + void glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]) + void glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fragment_program2 b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program2 new file mode 100644 index 00000000..79d4b631 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program2 @@ -0,0 +1,9 @@ +GL_NV_fragment_program2 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program2.txt +GL_NV_fragment_program2 + + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 + GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 + GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fragment_program4 b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program4 new file mode 100644 index 00000000..edd4383b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program4 @@ -0,0 +1,4 @@ +GL_NV_fragment_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_fragment_program4.txt +GL_NV_gpu_program4 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fragment_program_option b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program_option new file mode 100644 index 00000000..01b8ed6e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fragment_program_option @@ -0,0 +1,4 @@ +GL_NV_fragment_program_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txt +GL_NV_fragment_program_option + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_fragment_shader_interlock b/Windows/glew/auto/extensions/gl/GL_NV_fragment_shader_interlock new file mode 100644 index 00000000..0700d0b8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_fragment_shader_interlock @@ -0,0 +1,4 @@ +GL_NV_fragment_shader_interlock +http://www.opengl.org/registry/specs/NV/fragment_shader_interlock.txt +GL_NV_fragment_shader_interlock + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_blit b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_blit new file mode 100644 index 00000000..202762c9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_blit @@ -0,0 +1,9 @@ +GL_NV_framebuffer_blit +http://www.opengl.org/registry/specs/NV/framebuffer_blit.txt +GL_NV_framebuffer_blit + + GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 + GL_READ_FRAMEBUFFER_NV 0x8CA8 + GL_DRAW_FRAMEBUFFER_NV 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA + void glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_mixed_samples b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_mixed_samples new file mode 100644 index 00000000..4611efe9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_mixed_samples @@ -0,0 +1,18 @@ +GL_NV_framebuffer_mixed_samples +http://www.opengl.org/registry/specs/NV/framebuffer_mixed_samples.txt +GL_NV_framebuffer_mixed_samples + + GL_COLOR_SAMPLES_NV 0x8E20 + GL_RASTER_MULTISAMPLE_EXT 0x9327 + GL_RASTER_SAMPLES_EXT 0x9328 + GL_MAX_RASTER_SAMPLES_EXT 0x9329 + GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A + GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B + GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C + GL_DEPTH_SAMPLES_NV 0x932D + GL_STENCIL_SAMPLES_NV 0x932E + GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F + GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 + GL_COVERAGE_MODULATION_TABLE_NV 0x9331 + GL_COVERAGE_MODULATION_NV 0x9332 + GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_multisample b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_multisample new file mode 100644 index 00000000..d5a1bc21 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_multisample @@ -0,0 +1,8 @@ +GL_NV_framebuffer_multisample +http://www.opengl.org/registry/specs/NV/framebuffer_multisample.txt +GL_NV_framebuffer_multisample + + GL_RENDERBUFFER_SAMPLES_NV 0x8CAB + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 + GL_MAX_SAMPLES_NV 0x8D57 + void glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_multisample_coverage b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_multisample_coverage new file mode 100644 index 00000000..526d0f06 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_framebuffer_multisample_coverage @@ -0,0 +1,9 @@ +GL_NV_framebuffer_multisample_coverage +http://developer.download.nvidia.com/opengl/specs/GL_NV_framebuffer_multisample_coverage.txt +GL_NV_framebuffer_multisample_coverage + + GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB + GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 + GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 + GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + void glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_generate_mipmap_sRGB b/Windows/glew/auto/extensions/gl/GL_NV_generate_mipmap_sRGB new file mode 100644 index 00000000..6c2fce96 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_generate_mipmap_sRGB @@ -0,0 +1,4 @@ +GL_NV_generate_mipmap_sRGB +http://www.opengl.org/registry/specs/NV/generate_mipmap_sRGB.txt +GL_NV_generate_mipmap_sRGB + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_geometry_program4 b/Windows/glew/auto/extensions/gl/GL_NV_geometry_program4 new file mode 100644 index 00000000..a6cb1640 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_geometry_program4 @@ -0,0 +1,8 @@ +GL_NV_geometry_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_program4.txt +GL_NV_gpu_program4 + + GL_GEOMETRY_PROGRAM_NV 0x8C26 + GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 + GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + void glProgramVertexLimitNV (GLenum target, GLint limit) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_geometry_shader4 b/Windows/glew/auto/extensions/gl/GL_NV_geometry_shader4 new file mode 100644 index 00000000..1b004297 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_geometry_shader4 @@ -0,0 +1,4 @@ +GL_NV_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_shader4.txt +GL_NV_geometry_shader4 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_geometry_shader_passthrough b/Windows/glew/auto/extensions/gl/GL_NV_geometry_shader_passthrough new file mode 100644 index 00000000..708134b4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_geometry_shader_passthrough @@ -0,0 +1,4 @@ +GL_NV_geometry_shader_passthrough +http://www.opengl.org/registry/specs/NV/geometry_shader_passthrough.txt +GL_NV_geometry_shader_passthrough + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_gpu_multicast b/Windows/glew/auto/extensions/gl/GL_NV_gpu_multicast new file mode 100644 index 00000000..c4f7ddb0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_gpu_multicast @@ -0,0 +1,21 @@ +GL_NV_gpu_multicast +http://www.opengl.org/registry/specs/NV/gpu_multicast.txt +GL_NV_gpu_multicast + + GL_PER_GPU_STORAGE_BIT_NV 0x0800 + GL_MULTICAST_GPUS_NV 0x92BA + GL_PER_GPU_STORAGE_NV 0x9548 + GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 + GL_RENDER_GPU_MASK_NV 0x9558 + void glMulticastBarrierNV (void) + void glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + void glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data) + void glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) + void glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) + void glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v) + void glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64* params) + void glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint* params) + void glMulticastGetQueryObjectui64vNV (GLuint gpu, GLuint id, GLenum pname, GLuint64* params) + void glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint* params) + void glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask) + void glRenderGpuMaskNV (GLbitfield mask) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_gpu_program4 b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program4 new file mode 100644 index 00000000..19f71697 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program4 @@ -0,0 +1,24 @@ +GL_NV_gpu_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_gpu_program4.txt +GL_NV_gpu_program4 + + GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 + GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 + GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 + GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 + GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 + GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 + GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 + GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + void glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) + void glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_gpu_program5 b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program5 new file mode 100644 index 00000000..68079f3c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program5 @@ -0,0 +1,10 @@ +GL_NV_gpu_program5 +http://www.opengl.org/registry/specs/NV/gpu_program5.txt +GL_NV_gpu_program5 + + GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C + GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_gpu_program5_mem_extended b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program5_mem_extended new file mode 100644 index 00000000..e30b24be --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program5_mem_extended @@ -0,0 +1,4 @@ +GL_NV_gpu_program5_mem_extended +http://www.opengl.org/registry/specs/NV/gpu_program5_mem_extended.txt +GL_NV_gpu_program5_mem_extended + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_gpu_program_fp64 b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program_fp64 new file mode 100644 index 00000000..815dc976 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_gpu_program_fp64 @@ -0,0 +1,4 @@ +GL_NV_gpu_program_fp64 +http://www.opengl.org/registry/specs/NV/gpu_program5.txt +GL_NV_gpu_program_fp64 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_gpu_shader5 b/Windows/glew/auto/extensions/gl/GL_NV_gpu_shader5 new file mode 100644 index 00000000..530f70c9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_gpu_shader5 @@ -0,0 +1,66 @@ +GL_NV_gpu_shader5 +http://www.opengl.org/registry/specs/NV/gpu_shader5.txt +GL_NV_gpu_shader5 + + GL_INT64_NV 0x140E + GL_UNSIGNED_INT64_NV 0x140F + GL_INT8_NV 0x8FE0 + GL_INT8_VEC2_NV 0x8FE1 + GL_INT8_VEC3_NV 0x8FE2 + GL_INT8_VEC4_NV 0x8FE3 + GL_INT16_NV 0x8FE4 + GL_INT16_VEC2_NV 0x8FE5 + GL_INT16_VEC3_NV 0x8FE6 + GL_INT16_VEC4_NV 0x8FE7 + GL_INT64_VEC2_NV 0x8FE9 + GL_INT64_VEC3_NV 0x8FEA + GL_INT64_VEC4_NV 0x8FEB + GL_UNSIGNED_INT8_NV 0x8FEC + GL_UNSIGNED_INT8_VEC2_NV 0x8FED + GL_UNSIGNED_INT8_VEC3_NV 0x8FEE + GL_UNSIGNED_INT8_VEC4_NV 0x8FEF + GL_UNSIGNED_INT16_NV 0x8FF0 + GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 + GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 + GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 + GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 + GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 + GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 + GL_FLOAT16_NV 0x8FF8 + GL_FLOAT16_VEC2_NV 0x8FF9 + GL_FLOAT16_VEC3_NV 0x8FFA + GL_FLOAT16_VEC4_NV 0x8FFB + void glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT* params) + void glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT* params) + void glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x) + void glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x) + void glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y) + void glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y) + void glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) + void glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) + void glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) + void glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) + void glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform1i64NV (GLint location, GLint64EXT x) + void glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform1ui64NV (GLint location, GLuint64EXT x) + void glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y) + void glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y) + void glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) + void glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) + void glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) + void glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) + void glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_half_float b/Windows/glew/auto/extensions/gl/GL_NV_half_float new file mode 100644 index 00000000..29172208 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_half_float @@ -0,0 +1,52 @@ +GL_NV_half_float +http://www.opengl.org/registry/specs/NV/half_float.txt +GL_NV_half_float + + GL_HALF_FLOAT_NV 0x140B + void glColor3hNV (GLhalf red, GLhalf green, GLhalf blue) + void glColor3hvNV (const GLhalf* v) + void glColor4hNV (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha) + void glColor4hvNV (const GLhalf* v) + void glFogCoordhNV (GLhalf fog) + void glFogCoordhvNV (const GLhalf* fog) + void glMultiTexCoord1hNV (GLenum target, GLhalf s) + void glMultiTexCoord1hvNV (GLenum target, const GLhalf* v) + void glMultiTexCoord2hNV (GLenum target, GLhalf s, GLhalf t) + void glMultiTexCoord2hvNV (GLenum target, const GLhalf* v) + void glMultiTexCoord3hNV (GLenum target, GLhalf s, GLhalf t, GLhalf r) + void glMultiTexCoord3hvNV (GLenum target, const GLhalf* v) + void glMultiTexCoord4hNV (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q) + void glMultiTexCoord4hvNV (GLenum target, const GLhalf* v) + void glNormal3hNV (GLhalf nx, GLhalf ny, GLhalf nz) + void glNormal3hvNV (const GLhalf* v) + void glSecondaryColor3hNV (GLhalf red, GLhalf green, GLhalf blue) + void glSecondaryColor3hvNV (const GLhalf* v) + void glTexCoord1hNV (GLhalf s) + void glTexCoord1hvNV (const GLhalf* v) + void glTexCoord2hNV (GLhalf s, GLhalf t) + void glTexCoord2hvNV (const GLhalf* v) + void glTexCoord3hNV (GLhalf s, GLhalf t, GLhalf r) + void glTexCoord3hvNV (const GLhalf* v) + void glTexCoord4hNV (GLhalf s, GLhalf t, GLhalf r, GLhalf q) + void glTexCoord4hvNV (const GLhalf* v) + void glVertex2hNV (GLhalf x, GLhalf y) + void glVertex2hvNV (const GLhalf* v) + void glVertex3hNV (GLhalf x, GLhalf y, GLhalf z) + void glVertex3hvNV (const GLhalf* v) + void glVertex4hNV (GLhalf x, GLhalf y, GLhalf z, GLhalf w) + void glVertex4hvNV (const GLhalf* v) + void glVertexAttrib1hNV (GLuint index, GLhalf x) + void glVertexAttrib1hvNV (GLuint index, const GLhalf* v) + void glVertexAttrib2hNV (GLuint index, GLhalf x, GLhalf y) + void glVertexAttrib2hvNV (GLuint index, const GLhalf* v) + void glVertexAttrib3hNV (GLuint index, GLhalf x, GLhalf y, GLhalf z) + void glVertexAttrib3hvNV (GLuint index, const GLhalf* v) + void glVertexAttrib4hNV (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w) + void glVertexAttrib4hvNV (GLuint index, const GLhalf* v) + void glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexWeighthNV (GLhalf weight) + void glVertexWeighthvNV (const GLhalf* weight) + typedef unsigned short GLhalf diff --git a/Windows/glew/auto/extensions/gl/GL_NV_image_formats b/Windows/glew/auto/extensions/gl/GL_NV_image_formats new file mode 100644 index 00000000..6a906da5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_image_formats @@ -0,0 +1,4 @@ +GL_NV_image_formats +http://www.opengl.org/registry/specs/NV/image_formats.txt +GL_NV_image_formats + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_instanced_arrays b/Windows/glew/auto/extensions/gl/GL_NV_instanced_arrays new file mode 100644 index 00000000..14c0c076 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_instanced_arrays @@ -0,0 +1,6 @@ +GL_NV_instanced_arrays +http://www.opengl.org/registry/specs/NV/instanced_arrays.txt +GL_NV_instanced_arrays + + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE + void glVertexAttribDivisorNV (GLuint index, GLuint divisor) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_internalformat_sample_query b/Windows/glew/auto/extensions/gl/GL_NV_internalformat_sample_query new file mode 100644 index 00000000..cd187444 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_internalformat_sample_query @@ -0,0 +1,9 @@ +GL_NV_internalformat_sample_query +http://www.opengl.org/registry/specs/NV/internalformat_sample_query.txt +GL_NV_internalformat_sample_query + + GL_MULTISAMPLES_NV 0x9371 + GL_SUPERSAMPLE_SCALE_X_NV 0x9372 + GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 + GL_CONFORMANT_NV 0x9374 + void glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_light_max_exponent b/Windows/glew/auto/extensions/gl/GL_NV_light_max_exponent new file mode 100644 index 00000000..8140bb6a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_light_max_exponent @@ -0,0 +1,6 @@ +GL_NV_light_max_exponent +http://www.opengl.org/registry/specs/NV/light_max_exponent.txt +GL_NV_light_max_exponent + + GL_MAX_SHININESS_NV 0x8504 + GL_MAX_SPOT_EXPONENT_NV 0x8505 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_multisample_coverage b/Windows/glew/auto/extensions/gl/GL_NV_multisample_coverage new file mode 100644 index 00000000..880b6c88 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_multisample_coverage @@ -0,0 +1,5 @@ +GL_NV_multisample_coverage +http://www.opengl.org/registry/specs/NV/multisample_coverage.txt +GL_NV_multisample_coverage + + GL_COLOR_SAMPLES_NV 0x8E20 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_multisample_filter_hint b/Windows/glew/auto/extensions/gl/GL_NV_multisample_filter_hint new file mode 100644 index 00000000..7b8be2ef --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_multisample_filter_hint @@ -0,0 +1,5 @@ +GL_NV_multisample_filter_hint +http://www.opengl.org/registry/specs/NV/multisample_filter_hint.txt +GL_NV_multisample_filter_hint + + GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_non_square_matrices b/Windows/glew/auto/extensions/gl/GL_NV_non_square_matrices new file mode 100644 index 00000000..d27c2f2b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_non_square_matrices @@ -0,0 +1,16 @@ +GL_NV_non_square_matrices +http://www.opengl.org/registry/specs/NV/non_square_matrices.txt +GL_NV_non_square_matrices + + GL_FLOAT_MAT2x3_NV 0x8B65 + GL_FLOAT_MAT2x4_NV 0x8B66 + GL_FLOAT_MAT3x2_NV 0x8B67 + GL_FLOAT_MAT3x4_NV 0x8B68 + GL_FLOAT_MAT4x2_NV 0x8B69 + GL_FLOAT_MAT4x3_NV 0x8B6A + void glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_occlusion_query b/Windows/glew/auto/extensions/gl/GL_NV_occlusion_query new file mode 100644 index 00000000..4bf7ffde --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_occlusion_query @@ -0,0 +1,15 @@ +GL_NV_occlusion_query +http://www.opengl.org/registry/specs/NV/occlusion_query.txt +GL_NV_occlusion_query + + GL_PIXEL_COUNTER_BITS_NV 0x8864 + GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 + GL_PIXEL_COUNT_NV 0x8866 + GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + void glBeginOcclusionQueryNV (GLuint id) + void glDeleteOcclusionQueriesNV (GLsizei n, const GLuint* ids) + void glEndOcclusionQueryNV (void) + void glGenOcclusionQueriesNV (GLsizei n, GLuint* ids) + void glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint* params) + void glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint* params) + GLboolean glIsOcclusionQueryNV (GLuint id) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_pack_subimage b/Windows/glew/auto/extensions/gl/GL_NV_pack_subimage new file mode 100644 index 00000000..19aa009a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_pack_subimage @@ -0,0 +1,7 @@ +GL_NV_pack_subimage +http://www.opengl.org/registry/specs/NV/pack_subimage.txt +GL_NV_pack_subimage + + GL_PACK_ROW_LENGTH_NV 0x0D02 + GL_PACK_SKIP_ROWS_NV 0x0D03 + GL_PACK_SKIP_PIXELS_NV 0x0D04 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_packed_depth_stencil b/Windows/glew/auto/extensions/gl/GL_NV_packed_depth_stencil new file mode 100644 index 00000000..7957956c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_packed_depth_stencil @@ -0,0 +1,6 @@ +GL_NV_packed_depth_stencil +http://www.opengl.org/registry/specs/NV/packed_depth_stencil.txt +GL_NV_packed_depth_stencil + + GL_DEPTH_STENCIL_NV 0x84F9 + GL_UNSIGNED_INT_24_8_NV 0x84FA diff --git a/Windows/glew/auto/extensions/gl/GL_NV_packed_float b/Windows/glew/auto/extensions/gl/GL_NV_packed_float new file mode 100644 index 00000000..2e92770b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_packed_float @@ -0,0 +1,6 @@ +GL_NV_packed_float +http://www.opengl.org/registry/specs/NV/packed_float.txt +GL_NV_packed_float + + GL_R11F_G11F_B10F_NV 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B diff --git a/Windows/glew/auto/extensions/gl/GL_NV_packed_float_linear b/Windows/glew/auto/extensions/gl/GL_NV_packed_float_linear new file mode 100644 index 00000000..beb78bb2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_packed_float_linear @@ -0,0 +1,6 @@ +GL_NV_packed_float_linear +http://www.opengl.org/registry/specs/NV/packed_float.txt +GL_NV_packed_float_linear + + GL_R11F_G11F_B10F_NV 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B diff --git a/Windows/glew/auto/extensions/gl/GL_NV_parameter_buffer_object b/Windows/glew/auto/extensions/gl/GL_NV_parameter_buffer_object new file mode 100644 index 00000000..91494e31 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_parameter_buffer_object @@ -0,0 +1,12 @@ +GL_NV_parameter_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_NV_parameter_buffer_object.txt +GL_NV_parameter_buffer_object + + GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 + GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 + GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 + GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 + void glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params) + void glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params) + void glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_parameter_buffer_object2 b/Windows/glew/auto/extensions/gl/GL_NV_parameter_buffer_object2 new file mode 100644 index 00000000..f96e0236 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_parameter_buffer_object2 @@ -0,0 +1,4 @@ +GL_NV_parameter_buffer_object2 +http://www.opengl.org/registry/specs/NV/parameter_buffer_object2.txt +GL_NV_parameter_buffer_object2 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_path_rendering b/Windows/glew/auto/extensions/gl/GL_NV_path_rendering new file mode 100644 index 00000000..db80daba --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_path_rendering @@ -0,0 +1,217 @@ +GL_NV_path_rendering +http://www.opengl.org/registry/specs/NV/path_rendering.txt +GL_NV_path_rendering + + GL_CLOSE_PATH_NV 0x00 + GL_BOLD_BIT_NV 0x01 + GL_GLYPH_WIDTH_BIT_NV 0x01 + GL_GLYPH_HEIGHT_BIT_NV 0x02 + GL_ITALIC_BIT_NV 0x02 + GL_MOVE_TO_NV 0x02 + GL_RELATIVE_MOVE_TO_NV 0x03 + GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 + GL_LINE_TO_NV 0x04 + GL_RELATIVE_LINE_TO_NV 0x05 + GL_HORIZONTAL_LINE_TO_NV 0x06 + GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 + GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 + GL_VERTICAL_LINE_TO_NV 0x08 + GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 + GL_QUADRATIC_CURVE_TO_NV 0x0A + GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B + GL_CUBIC_CURVE_TO_NV 0x0C + GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D + GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E + GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F + GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 + GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 + GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 + GL_SMALL_CCW_ARC_TO_NV 0x12 + GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 + GL_SMALL_CW_ARC_TO_NV 0x14 + GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 + GL_LARGE_CCW_ARC_TO_NV 0x16 + GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 + GL_LARGE_CW_ARC_TO_NV 0x18 + GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 + GL_CONIC_CURVE_TO_NV 0x1A + GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B + GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 + GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 + GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 + GL_ROUNDED_RECT_NV 0xE8 + GL_RELATIVE_ROUNDED_RECT_NV 0xE9 + GL_ROUNDED_RECT2_NV 0xEA + GL_RELATIVE_ROUNDED_RECT2_NV 0xEB + GL_ROUNDED_RECT4_NV 0xEC + GL_RELATIVE_ROUNDED_RECT4_NV 0xED + GL_ROUNDED_RECT8_NV 0xEE + GL_RELATIVE_ROUNDED_RECT8_NV 0xEF + GL_RESTART_PATH_NV 0xF0 + GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 + GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 + GL_RECT_NV 0xF6 + GL_RELATIVE_RECT_NV 0xF7 + GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 + GL_CIRCULAR_CW_ARC_TO_NV 0xFA + GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC + GL_ARC_TO_NV 0xFE + GL_RELATIVE_ARC_TO_NV 0xFF + GL_GLYPH_HAS_KERNING_BIT_NV 0x100 + GL_PRIMARY_COLOR_NV 0x852C + GL_SECONDARY_COLOR_NV 0x852D + GL_PRIMARY_COLOR 0x8577 + GL_PATH_FORMAT_SVG_NV 0x9070 + GL_PATH_FORMAT_PS_NV 0x9071 + GL_STANDARD_FONT_NAME_NV 0x9072 + GL_SYSTEM_FONT_NAME_NV 0x9073 + GL_FILE_NAME_NV 0x9074 + GL_PATH_STROKE_WIDTH_NV 0x9075 + GL_PATH_END_CAPS_NV 0x9076 + GL_PATH_INITIAL_END_CAP_NV 0x9077 + GL_PATH_TERMINAL_END_CAP_NV 0x9078 + GL_PATH_JOIN_STYLE_NV 0x9079 + GL_PATH_MITER_LIMIT_NV 0x907A + GL_PATH_DASH_CAPS_NV 0x907B + GL_PATH_INITIAL_DASH_CAP_NV 0x907C + GL_PATH_TERMINAL_DASH_CAP_NV 0x907D + GL_PATH_DASH_OFFSET_NV 0x907E + GL_PATH_CLIENT_LENGTH_NV 0x907F + GL_PATH_FILL_MODE_NV 0x9080 + GL_PATH_FILL_MASK_NV 0x9081 + GL_PATH_FILL_COVER_MODE_NV 0x9082 + GL_PATH_STROKE_COVER_MODE_NV 0x9083 + GL_PATH_STROKE_MASK_NV 0x9084 + GL_PATH_STROKE_BOUND_NV 0x9086 + GL_COUNT_UP_NV 0x9088 + GL_COUNT_DOWN_NV 0x9089 + GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A + GL_CONVEX_HULL_NV 0x908B + GL_BOUNDING_BOX_NV 0x908D + GL_TRANSLATE_X_NV 0x908E + GL_TRANSLATE_Y_NV 0x908F + GL_TRANSLATE_2D_NV 0x9090 + GL_TRANSLATE_3D_NV 0x9091 + GL_AFFINE_2D_NV 0x9092 + GL_AFFINE_3D_NV 0x9094 + GL_TRANSPOSE_AFFINE_2D_NV 0x9096 + GL_TRANSPOSE_AFFINE_3D_NV 0x9098 + GL_UTF8_NV 0x909A + GL_UTF16_NV 0x909B + GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C + GL_PATH_COMMAND_COUNT_NV 0x909D + GL_PATH_COORD_COUNT_NV 0x909E + GL_PATH_DASH_ARRAY_COUNT_NV 0x909F + GL_PATH_COMPUTED_LENGTH_NV 0x90A0 + GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 + GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 + GL_SQUARE_NV 0x90A3 + GL_ROUND_NV 0x90A4 + GL_TRIANGULAR_NV 0x90A5 + GL_BEVEL_NV 0x90A6 + GL_MITER_REVERT_NV 0x90A7 + GL_MITER_TRUNCATE_NV 0x90A8 + GL_SKIP_MISSING_GLYPH_NV 0x90A9 + GL_USE_MISSING_GLYPH_NV 0x90AA + GL_PATH_ERROR_POSITION_NV 0x90AB + GL_PATH_FOG_GEN_MODE_NV 0x90AC + GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD + GL_ADJACENT_PAIRS_NV 0x90AE + GL_FIRST_TO_REST_NV 0x90AF + GL_PATH_GEN_MODE_NV 0x90B0 + GL_PATH_GEN_COEFF_NV 0x90B1 + GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 + GL_PATH_GEN_COMPONENTS_NV 0x90B3 + GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 + GL_MOVE_TO_RESETS_NV 0x90B5 + GL_MOVE_TO_CONTINUES_NV 0x90B6 + GL_PATH_STENCIL_FUNC_NV 0x90B7 + GL_PATH_STENCIL_REF_NV 0x90B8 + GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 + GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD + GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE + GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF + GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 + GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 + GL_FONT_UNAVAILABLE_NV 0x936A + GL_FONT_UNINTELLIGIBLE_NV 0x936B + GL_STANDARD_FONT_FORMAT_NV 0x936C + GL_FRAGMENT_INPUT_NV 0x936D + GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 + GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 + GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 + GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 + GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 + GL_FONT_ASCENDER_BIT_NV 0x00200000 + GL_FONT_DESCENDER_BIT_NV 0x00400000 + GL_FONT_HEIGHT_BIT_NV 0x00800000 + GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 + GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 + GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 + GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 + GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 + void glCopyPathNV (GLuint resultPath, GLuint srcPath) + void glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glCoverFillPathNV (GLuint path, GLenum coverMode) + void glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glCoverStrokePathNV (GLuint path, GLenum coverMode) + void glDeletePathsNV (GLuint path, GLsizei range) + GLuint glGenPathsNV (GLsizei range) + void glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat* value) + void glGetPathColorGenivNV (GLenum color, GLenum pname, GLint* value) + void glGetPathCommandsNV (GLuint path, GLubyte* commands) + void glGetPathCoordsNV (GLuint path, GLfloat* coords) + void glGetPathDashArrayNV (GLuint path, GLfloat* dashArray) + GLfloat glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments) + void glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics) + void glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics) + void glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat* value) + void glGetPathParameterivNV (GLuint path, GLenum pname, GLint* value) + void glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing) + void glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat* value) + void glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint* value) + void glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params) + void glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight) + GLboolean glIsPathNV (GLuint path) + GLboolean glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y) + GLboolean glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y) + void glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat* m) + void glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat* m) + void glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat* m) + void glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat* m) + void glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat* m) + void glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat* m) + void glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs) + void glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords) + void glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords) + void glPathCoverDepthFuncNV (GLenum zfunc) + void glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat* dashArray) + void glPathFogGenNV (GLenum genMode) + GLenum glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + GLenum glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]) + void glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + void glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + GLenum glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + void glPathParameterfNV (GLuint path, GLenum pname, GLfloat value) + void glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat* value) + void glPathParameteriNV (GLuint path, GLenum pname, GLint value) + void glPathParameterivNV (GLuint path, GLenum pname, const GLint* value) + void glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units) + void glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask) + void glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString) + void glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords) + void glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords) + void glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs) + GLboolean glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY) + void glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs) + void glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues) + void glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask) + void glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues) + void glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask) + void glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode) + void glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode) + void glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues) + void glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_path_rendering_shared_edge b/Windows/glew/auto/extensions/gl/GL_NV_path_rendering_shared_edge new file mode 100644 index 00000000..733031fa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_path_rendering_shared_edge @@ -0,0 +1,5 @@ +GL_NV_path_rendering_shared_edge +http://www.opengl.org/registry/specs/NV/path_rendering_shared_edge.txt +GL_NV_path_rendering_shared_edge + + GL_SHARED_EDGE_NV 0xC0 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_pixel_buffer_object b/Windows/glew/auto/extensions/gl/GL_NV_pixel_buffer_object new file mode 100644 index 00000000..990190bb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_pixel_buffer_object @@ -0,0 +1,8 @@ +GL_NV_pixel_buffer_object +http://www.opengl.org/registry/specs/NV/pixel_buffer_object.txt +GL_NV_pixel_buffer_object + + GL_PIXEL_PACK_BUFFER_NV 0x88EB + GL_PIXEL_UNPACK_BUFFER_NV 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF diff --git a/Windows/glew/auto/extensions/gl/GL_NV_pixel_data_range b/Windows/glew/auto/extensions/gl/GL_NV_pixel_data_range new file mode 100644 index 00000000..884cd8d5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_pixel_data_range @@ -0,0 +1,12 @@ +GL_NV_pixel_data_range +http://www.opengl.org/registry/specs/NV/pixel_data_range.txt +GL_NV_pixel_data_range + + GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 + GL_READ_PIXEL_DATA_RANGE_NV 0x8879 + GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A + GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B + GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C + GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + void glFlushPixelDataRangeNV (GLenum target) + void glPixelDataRangeNV (GLenum target, GLsizei length, void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_platform_binary b/Windows/glew/auto/extensions/gl/GL_NV_platform_binary new file mode 100644 index 00000000..a247f72f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_platform_binary @@ -0,0 +1,5 @@ +GL_NV_platform_binary +http://www.opengl.org/registry/specs/NV/platform_binary.txt +GL_NV_platform_binary + + GL_NVIDIA_PLATFORM_BINARY_NV 0x890B diff --git a/Windows/glew/auto/extensions/gl/GL_NV_point_sprite b/Windows/glew/auto/extensions/gl/GL_NV_point_sprite new file mode 100644 index 00000000..c9b8c3ff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_point_sprite @@ -0,0 +1,9 @@ +GL_NV_point_sprite +http://www.opengl.org/registry/specs/NV/point_sprite.txt +GL_NV_point_sprite + + GL_POINT_SPRITE_NV 0x8861 + GL_COORD_REPLACE_NV 0x8862 + GL_POINT_SPRITE_R_MODE_NV 0x8863 + void glPointParameteriNV (GLenum pname, GLint param) + void glPointParameterivNV (GLenum pname, const GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_polygon_mode b/Windows/glew/auto/extensions/gl/GL_NV_polygon_mode new file mode 100644 index 00000000..e3186871 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_polygon_mode @@ -0,0 +1,11 @@ +GL_NV_polygon_mode +http://www.opengl.org/registry/specs/NV/polygon_mode.txt +GL_NV_polygon_mode + + GL_POLYGON_MODE_NV 0x0B40 + GL_POINT_NV 0x1B00 + GL_LINE_NV 0x1B01 + GL_FILL_NV 0x1B02 + GL_POLYGON_OFFSET_POINT_NV 0x2A01 + GL_POLYGON_OFFSET_LINE_NV 0x2A02 + void glPolygonModeNV (GLenum face, GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_present_video b/Windows/glew/auto/extensions/gl/GL_NV_present_video new file mode 100644 index 00000000..1a5b8ce2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_present_video @@ -0,0 +1,16 @@ +GL_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +GL_NV_present_video + + GL_FRAME_NV 0x8E26 + GL_FIELDS_NV 0x8E27 + GL_CURRENT_TIME_NV 0x8E28 + GL_NUM_FILL_STREAMS_NV 0x8E29 + GL_PRESENT_TIME_NV 0x8E2A + GL_PRESENT_DURATION_NV 0x8E2B + void glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT* params) + void glGetVideoivNV (GLuint video_slot, GLenum pname, GLint* params) + void glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT* params) + void glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint* params) + void glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3) + void glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_primitive_restart b/Windows/glew/auto/extensions/gl/GL_NV_primitive_restart new file mode 100644 index 00000000..c2a895e0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_primitive_restart @@ -0,0 +1,8 @@ +GL_NV_primitive_restart +http://www.opengl.org/registry/specs/NV/primitive_restart.txt +GL_NV_primitive_restart + + GL_PRIMITIVE_RESTART_NV 0x8558 + GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + void glPrimitiveRestartIndexNV (GLuint index) + void glPrimitiveRestartNV (void) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_read_depth b/Windows/glew/auto/extensions/gl/GL_NV_read_depth new file mode 100644 index 00000000..abdd2154 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_read_depth @@ -0,0 +1,4 @@ +GL_NV_read_depth +http://www.opengl.org/registry/specs/NV/read_depth_stencil.txt +GL_NV_read_depth + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_read_depth_stencil b/Windows/glew/auto/extensions/gl/GL_NV_read_depth_stencil new file mode 100644 index 00000000..b815315c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_read_depth_stencil @@ -0,0 +1,4 @@ +GL_NV_read_depth_stencil +http://www.opengl.org/registry/specs/NV/read_depth_stencil.txt +GL_NV_read_depth_stencil + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_read_stencil b/Windows/glew/auto/extensions/gl/GL_NV_read_stencil new file mode 100644 index 00000000..78b6f239 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_read_stencil @@ -0,0 +1,4 @@ +GL_NV_read_stencil +http://www.opengl.org/registry/specs/NV/read_depth_stencil.txt +GL_NV_read_stencil + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_register_combiners b/Windows/glew/auto/extensions/gl/GL_NV_register_combiners new file mode 100644 index 00000000..782e0d7a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_register_combiners @@ -0,0 +1,68 @@ +GL_NV_register_combiners +http://www.opengl.org/registry/specs/NV/register_combiners.txt +GL_NV_register_combiners + + GL_REGISTER_COMBINERS_NV 0x8522 + GL_VARIABLE_A_NV 0x8523 + GL_VARIABLE_B_NV 0x8524 + GL_VARIABLE_C_NV 0x8525 + GL_VARIABLE_D_NV 0x8526 + GL_VARIABLE_E_NV 0x8527 + GL_VARIABLE_F_NV 0x8528 + GL_VARIABLE_G_NV 0x8529 + GL_CONSTANT_COLOR0_NV 0x852A + GL_CONSTANT_COLOR1_NV 0x852B + GL_PRIMARY_COLOR_NV 0x852C + GL_SECONDARY_COLOR_NV 0x852D + GL_SPARE0_NV 0x852E + GL_SPARE1_NV 0x852F + GL_DISCARD_NV 0x8530 + GL_E_TIMES_F_NV 0x8531 + GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 + GL_UNSIGNED_IDENTITY_NV 0x8536 + GL_UNSIGNED_INVERT_NV 0x8537 + GL_EXPAND_NORMAL_NV 0x8538 + GL_EXPAND_NEGATE_NV 0x8539 + GL_HALF_BIAS_NORMAL_NV 0x853A + GL_HALF_BIAS_NEGATE_NV 0x853B + GL_SIGNED_IDENTITY_NV 0x853C + GL_SIGNED_NEGATE_NV 0x853D + GL_SCALE_BY_TWO_NV 0x853E + GL_SCALE_BY_FOUR_NV 0x853F + GL_SCALE_BY_ONE_HALF_NV 0x8540 + GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 + GL_COMBINER_INPUT_NV 0x8542 + GL_COMBINER_MAPPING_NV 0x8543 + GL_COMBINER_COMPONENT_USAGE_NV 0x8544 + GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 + GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 + GL_COMBINER_MUX_SUM_NV 0x8547 + GL_COMBINER_SCALE_NV 0x8548 + GL_COMBINER_BIAS_NV 0x8549 + GL_COMBINER_AB_OUTPUT_NV 0x854A + GL_COMBINER_CD_OUTPUT_NV 0x854B + GL_COMBINER_SUM_OUTPUT_NV 0x854C + GL_MAX_GENERAL_COMBINERS_NV 0x854D + GL_NUM_GENERAL_COMBINERS_NV 0x854E + GL_COLOR_SUM_CLAMP_NV 0x854F + GL_COMBINER0_NV 0x8550 + GL_COMBINER1_NV 0x8551 + GL_COMBINER2_NV 0x8552 + GL_COMBINER3_NV 0x8553 + GL_COMBINER4_NV 0x8554 + GL_COMBINER5_NV 0x8555 + GL_COMBINER6_NV 0x8556 + GL_COMBINER7_NV 0x8557 + void glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) + void glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) + void glCombinerParameterfNV (GLenum pname, GLfloat param) + void glCombinerParameterfvNV (GLenum pname, const GLfloat* params) + void glCombinerParameteriNV (GLenum pname, GLint param) + void glCombinerParameterivNV (GLenum pname, const GLint* params) + void glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) + void glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params) + void glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params) + void glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat* params) + void glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint* params) + void glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat* params) + void glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_register_combiners2 b/Windows/glew/auto/extensions/gl/GL_NV_register_combiners2 new file mode 100644 index 00000000..91026516 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_register_combiners2 @@ -0,0 +1,7 @@ +GL_NV_register_combiners2 +http://www.opengl.org/registry/specs/NV/register_combiners2.txt +GL_NV_register_combiners2 + + GL_PER_STAGE_CONSTANTS_NV 0x8535 + void glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat* params) + void glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat* params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_robustness_video_memory_purge b/Windows/glew/auto/extensions/gl/GL_NV_robustness_video_memory_purge new file mode 100644 index 00000000..07a47a6c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_robustness_video_memory_purge @@ -0,0 +1,6 @@ +GL_NV_robustness_video_memory_purge +http://www.opengl.org/registry/specs/NV/robustness_video_memory_purge.txt +GL_NV_robustness_video_memory_purge + + GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C + GL_PURGED_CONTEXT_RESET_NV 0x92BB diff --git a/Windows/glew/auto/extensions/gl/GL_NV_sRGB_formats b/Windows/glew/auto/extensions/gl/GL_NV_sRGB_formats new file mode 100644 index 00000000..70c1ccb5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_sRGB_formats @@ -0,0 +1,14 @@ +GL_NV_sRGB_formats +http://www.opengl.org/registry/specs/NV/sRGB_formats.txt +GL_NV_sRGB_formats + + GL_ETC1_SRGB8_NV 0x88EE + GL_SRGB8_NV 0x8C41 + GL_SLUMINANCE_ALPHA_NV 0x8C44 + GL_SLUMINANCE8_ALPHA8_NV 0x8C45 + GL_SLUMINANCE_NV 0x8C46 + GL_SLUMINANCE8_NV 0x8C47 + GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_sample_locations b/Windows/glew/auto/extensions/gl/GL_NV_sample_locations new file mode 100644 index 00000000..4d9a2a60 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_sample_locations @@ -0,0 +1,14 @@ +GL_NV_sample_locations +http://www.opengl.org/registry/specs/NV/sample_locations.txt +GL_NV_sample_locations + + GL_SAMPLE_LOCATION_NV 0x8E50 + GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D + GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E + GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F + GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 + GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 + GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 + GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + void glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat* v) + void glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_sample_mask_override_coverage b/Windows/glew/auto/extensions/gl/GL_NV_sample_mask_override_coverage new file mode 100644 index 00000000..963094ef --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_sample_mask_override_coverage @@ -0,0 +1,4 @@ +GL_NV_sample_mask_override_coverage +http://www.opengl.org/registry/specs/NV/sample_mask_override_coverage.txt +GL_NV_sample_mask_override_coverage + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_counters b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_counters new file mode 100644 index 00000000..22ad1afa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_counters @@ -0,0 +1,4 @@ +GL_NV_shader_atomic_counters +http://www.opengl.org/registry/specs/NV/shader_atomic_counters.txt +GL_NV_shader_atomic_counters + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_float b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_float new file mode 100644 index 00000000..e2b6973f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_float @@ -0,0 +1,4 @@ +GL_NV_shader_atomic_float +http://www.opengl.org/registry/specs/NV/shader_atomic_float.txt +GL_NV_shader_atomic_float + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_float64 b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_float64 new file mode 100644 index 00000000..32316dff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_float64 @@ -0,0 +1,4 @@ +GL_NV_shader_atomic_float64 +http://www.opengl.org/registry/specs/NV/shader_atomic_float64.txt +GL_NV_shader_atomic_float64 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_fp16_vector b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_fp16_vector new file mode 100644 index 00000000..c2232a85 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_fp16_vector @@ -0,0 +1,4 @@ +GL_NV_shader_atomic_fp16_vector +http://www.opengl.org/registry/specs/NV/shader_atomic_fp16_vector.txt +GL_NV_shader_atomic_fp16_vector + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_int64 b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_int64 new file mode 100644 index 00000000..7f77c3c3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_atomic_int64 @@ -0,0 +1,4 @@ +GL_NV_shader_atomic_int64 +http://www.opengl.org/registry/specs/NV/shader_atomic_int64.txt +GL_NV_shader_atomic_int64 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_buffer_load b/Windows/glew/auto/extensions/gl/GL_NV_shader_buffer_load new file mode 100644 index 00000000..8b0d7690 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_buffer_load @@ -0,0 +1,20 @@ +GL_NV_shader_buffer_load +http://www.opengl.org/registry/specs/NV/shader_buffer_load.txt +GL_NV_shader_buffer_load + + GL_BUFFER_GPU_ADDRESS_NV 0x8F1D + GL_GPU_ADDRESS_NV 0x8F34 + GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + void glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT* params) + void glGetIntegerui64vNV (GLenum value, GLuint64EXT* result) + void glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT* params) + GLboolean glIsBufferResidentNV (GLenum target) + GLboolean glIsNamedBufferResidentNV (GLuint buffer) + void glMakeBufferNonResidentNV (GLenum target) + void glMakeBufferResidentNV (GLenum target, GLenum access) + void glMakeNamedBufferNonResidentNV (GLuint buffer) + void glMakeNamedBufferResidentNV (GLuint buffer, GLenum access) + void glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value) + void glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glUniformui64NV (GLint location, GLuint64EXT value) + void glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_noperspective_interpolation b/Windows/glew/auto/extensions/gl/GL_NV_shader_noperspective_interpolation new file mode 100644 index 00000000..bc456144 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_noperspective_interpolation @@ -0,0 +1,4 @@ +GL_NV_shader_noperspective_interpolation +http://www.opengl.org/registry/specs/NV/shader_noperspective_interpolation.txt +GL_NV_shader_noperspective_interpolation + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_storage_buffer_object b/Windows/glew/auto/extensions/gl/GL_NV_shader_storage_buffer_object new file mode 100644 index 00000000..573c3e13 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_storage_buffer_object @@ -0,0 +1,4 @@ +GL_NV_shader_storage_buffer_object +http://www.opengl.org/registry/specs/NV/shader_storage_buffer_object.txt +GL_NV_shader_storage_buffer_object + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_thread_group b/Windows/glew/auto/extensions/gl/GL_NV_shader_thread_group new file mode 100644 index 00000000..6b20469d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_thread_group @@ -0,0 +1,7 @@ +GL_NV_shader_thread_group +http://www.opengl.org/registry/specs/NV/shader_thread_group.txt +GL_NV_shader_thread_group + + GL_WARP_SIZE_NV 0x9339 + GL_WARPS_PER_SM_NV 0x933A + GL_SM_COUNT_NV 0x933B diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shader_thread_shuffle b/Windows/glew/auto/extensions/gl/GL_NV_shader_thread_shuffle new file mode 100644 index 00000000..ddb39d3b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shader_thread_shuffle @@ -0,0 +1,4 @@ +GL_NV_shader_thread_shuffle +http://www.opengl.org/registry/specs/NV/shader_thread_shuffle.txt +GL_NV_shader_thread_shuffle + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shadow_samplers_array b/Windows/glew/auto/extensions/gl/GL_NV_shadow_samplers_array new file mode 100644 index 00000000..51fd03ba --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shadow_samplers_array @@ -0,0 +1,5 @@ +GL_NV_shadow_samplers_array +http://www.opengl.org/registry/specs/NV/shadow_samplers_array.txt +GL_NV_shadow_samplers_array + + GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_shadow_samplers_cube b/Windows/glew/auto/extensions/gl/GL_NV_shadow_samplers_cube new file mode 100644 index 00000000..2ee29250 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_shadow_samplers_cube @@ -0,0 +1,5 @@ +GL_NV_shadow_samplers_cube +http://www.opengl.org/registry/specs/NV/shadow_samplers_cube.txt +GL_NV_shadow_samplers_cube + + GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_stereo_view_rendering b/Windows/glew/auto/extensions/gl/GL_NV_stereo_view_rendering new file mode 100644 index 00000000..42b16703 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_stereo_view_rendering @@ -0,0 +1,4 @@ +GL_NV_stereo_view_rendering +http://www.opengl.org/registry/specs/NV/stereo_view_rendering.txt +GL_NV_stereo_view_rendering + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_tessellation_program5 b/Windows/glew/auto/extensions/gl/GL_NV_tessellation_program5 new file mode 100644 index 00000000..75fd3c7c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_tessellation_program5 @@ -0,0 +1,9 @@ +GL_NV_tessellation_program5 +http://www.opengl.org/registry/specs/NV/tessellation_program5.txt +GL_NV_gpu_program5 + + GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 + GL_TESS_CONTROL_PROGRAM_NV 0x891E + GL_TESS_EVALUATION_PROGRAM_NV 0x891F + GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 + GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texgen_emboss b/Windows/glew/auto/extensions/gl/GL_NV_texgen_emboss new file mode 100644 index 00000000..6b9f4180 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texgen_emboss @@ -0,0 +1,7 @@ +GL_NV_texgen_emboss +http://www.opengl.org/registry/specs/NV/texgen_emboss.txt +GL_NV_texgen_emboss + + GL_EMBOSS_LIGHT_NV 0x855D + GL_EMBOSS_CONSTANT_NV 0x855E + GL_EMBOSS_MAP_NV 0x855F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texgen_reflection b/Windows/glew/auto/extensions/gl/GL_NV_texgen_reflection new file mode 100644 index 00000000..fcbce7ad --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texgen_reflection @@ -0,0 +1,6 @@ +GL_NV_texgen_reflection +http://www.opengl.org/registry/specs/NV/texgen_reflection.txt +GL_NV_texgen_reflection + + GL_NORMAL_MAP_NV 0x8511 + GL_REFLECTION_MAP_NV 0x8512 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_array b/Windows/glew/auto/extensions/gl/GL_NV_texture_array new file mode 100644 index 00000000..b0c5e6d9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_array @@ -0,0 +1,17 @@ +GL_NV_texture_array +http://www.opengl.org/registry/specs/NV/texture_array.txt +GL_NV_texture_array + + GL_UNPACK_SKIP_IMAGES_NV 0x806D + GL_UNPACK_IMAGE_HEIGHT_NV 0x806E + GL_MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF + GL_TEXTURE_2D_ARRAY_NV 0x8C1A + GL_TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4 + GL_SAMPLER_2D_ARRAY_NV 0x8DC1 + void glCompressedTexImage3DNV (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) + void glCompressedTexSubImage3DNV (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) + void glCopyTexSubImage3DNV (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glFramebufferTextureLayerNV (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) + void glTexImage3DNV (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) + void glTexSubImage3DNV (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_barrier b/Windows/glew/auto/extensions/gl/GL_NV_texture_barrier new file mode 100644 index 00000000..af97b24a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_barrier @@ -0,0 +1,5 @@ +GL_NV_texture_barrier +http://www.opengl.org/registry/specs/NV/texture_barrier.txt +GL_NV_texture_barrier + + void glTextureBarrierNV (void) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_border_clamp b/Windows/glew/auto/extensions/gl/GL_NV_texture_border_clamp new file mode 100644 index 00000000..156a63e3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_border_clamp @@ -0,0 +1,6 @@ +GL_NV_texture_border_clamp +http://www.opengl.org/registry/specs/NV/texture_border_clamp.txt +GL_NV_texture_border_clamp + + GL_TEXTURE_BORDER_COLOR_NV 0x1004 + GL_CLAMP_TO_BORDER_NV 0x812D diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_latc b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_latc new file mode 100644 index 00000000..2c4819f5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_latc @@ -0,0 +1,8 @@ +GL_NV_texture_compression_latc +http://www.opengl.org/registry/specs/NV/texture_compression_latc.txt +GL_NV_texture_compression_latc + + GL_COMPRESSED_LUMINANCE_LATC1_NV 0x8C70 + GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_NV 0x8C71 + GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_NV 0x8C72 + GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV 0x8C73 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_s3tc b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_s3tc new file mode 100644 index 00000000..b9f859e7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_s3tc @@ -0,0 +1,8 @@ +GL_NV_texture_compression_s3tc +http://www.opengl.org/registry/specs/NV/texture_compression_s3tc.txt +GL_NV_texture_compression_s3tc + + GL_COMPRESSED_RGB_S3TC_DXT1_NV 0x83F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_NV 0x83F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_NV 0x83F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_NV 0x83F3 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_s3tc_update b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_s3tc_update new file mode 100644 index 00000000..6e18b7af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_s3tc_update @@ -0,0 +1,4 @@ +GL_NV_texture_compression_s3tc_update +http://www.opengl.org/registry/specs/NV/texture_compression_s3tc_update.txt +GL_NV_texture_compression_s3tc_update + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_vtc b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_vtc new file mode 100644 index 00000000..6d0ba1af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_compression_vtc @@ -0,0 +1,4 @@ +GL_NV_texture_compression_vtc +http://www.opengl.org/registry/specs/NV/texture_compression_vtc.txt +GL_NV_texture_compression_vtc + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_env_combine4 b/Windows/glew/auto/extensions/gl/GL_NV_texture_env_combine4 new file mode 100644 index 00000000..8764628f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_env_combine4 @@ -0,0 +1,9 @@ +GL_NV_texture_env_combine4 +http://www.opengl.org/registry/specs/NV/texture_env_combine4.txt +GL_NV_texture_env_combine4 + + GL_COMBINE4_NV 0x8503 + GL_SOURCE3_RGB_NV 0x8583 + GL_SOURCE3_ALPHA_NV 0x858B + GL_OPERAND3_RGB_NV 0x8593 + GL_OPERAND3_ALPHA_NV 0x859B diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_expand_normal b/Windows/glew/auto/extensions/gl/GL_NV_texture_expand_normal new file mode 100644 index 00000000..525dd53d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_expand_normal @@ -0,0 +1,5 @@ +GL_NV_texture_expand_normal +http://www.opengl.org/registry/specs/NV/texture_expand_normal.txt +GL_NV_texture_expand_normal + + GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_multisample b/Windows/glew/auto/extensions/gl/GL_NV_texture_multisample new file mode 100644 index 00000000..bbae4726 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_multisample @@ -0,0 +1,12 @@ +GL_NV_texture_multisample +http://www.opengl.org/registry/specs/NV/texture_multisample.txt +GL_NV_texture_multisample + + GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 + GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + void glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations) + void glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations) + void glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations) + void glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations) + void glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations) + void glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_npot_2D_mipmap b/Windows/glew/auto/extensions/gl/GL_NV_texture_npot_2D_mipmap new file mode 100644 index 00000000..0cacfaaf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_npot_2D_mipmap @@ -0,0 +1,4 @@ +GL_NV_texture_npot_2D_mipmap +http://www.opengl.org/registry/specs/NV/texture_npot_2D_mipmap.txt +GL_NV_texture_npot_2D_mipmap + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_rectangle b/Windows/glew/auto/extensions/gl/GL_NV_texture_rectangle new file mode 100644 index 00000000..0a9fd6a8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_rectangle @@ -0,0 +1,8 @@ +GL_NV_texture_rectangle +http://www.opengl.org/registry/specs/NV/texture_rectangle.txt +GL_NV_texture_rectangle + + GL_TEXTURE_RECTANGLE_NV 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_rectangle_compressed b/Windows/glew/auto/extensions/gl/GL_NV_texture_rectangle_compressed new file mode 100644 index 00000000..c45646af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_rectangle_compressed @@ -0,0 +1,4 @@ +GL_NV_texture_rectangle_compressed +http://www.opengl.org/registry/specs/NV/texture_rectangle_compressed.txt +GL_NV_texture_rectangle_compressed + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_shader b/Windows/glew/auto/extensions/gl/GL_NV_texture_shader new file mode 100644 index 00000000..36e0471e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_shader @@ -0,0 +1,77 @@ +GL_NV_texture_shader +http://www.opengl.org/registry/specs/NV/texture_shader.txt +GL_NV_texture_shader + + GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C + GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D + GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E + GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 + GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA + GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB + GL_DSDT_MAG_INTENSITY_NV 0x86DC + GL_SHADER_CONSISTENT_NV 0x86DD + GL_TEXTURE_SHADER_NV 0x86DE + GL_SHADER_OPERATION_NV 0x86DF + GL_CULL_MODES_NV 0x86E0 + GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 + GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 + GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 + GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 + GL_CONST_EYE_NV 0x86E5 + GL_PASS_THROUGH_NV 0x86E6 + GL_CULL_FRAGMENT_NV 0x86E7 + GL_OFFSET_TEXTURE_2D_NV 0x86E8 + GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 + GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA + GL_DOT_PRODUCT_NV 0x86EC + GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED + GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE + GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 + GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 + GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 + GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 + GL_HILO_NV 0x86F4 + GL_DSDT_NV 0x86F5 + GL_DSDT_MAG_NV 0x86F6 + GL_DSDT_MAG_VIB_NV 0x86F7 + GL_HILO16_NV 0x86F8 + GL_SIGNED_HILO_NV 0x86F9 + GL_SIGNED_HILO16_NV 0x86FA + GL_SIGNED_RGBA_NV 0x86FB + GL_SIGNED_RGBA8_NV 0x86FC + GL_SIGNED_RGB_NV 0x86FE + GL_SIGNED_RGB8_NV 0x86FF + GL_SIGNED_LUMINANCE_NV 0x8701 + GL_SIGNED_LUMINANCE8_NV 0x8702 + GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 + GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 + GL_SIGNED_ALPHA_NV 0x8705 + GL_SIGNED_ALPHA8_NV 0x8706 + GL_SIGNED_INTENSITY_NV 0x8707 + GL_SIGNED_INTENSITY8_NV 0x8708 + GL_DSDT8_NV 0x8709 + GL_DSDT8_MAG8_NV 0x870A + GL_DSDT8_MAG8_INTENSITY8_NV 0x870B + GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C + GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + GL_HI_SCALE_NV 0x870E + GL_LO_SCALE_NV 0x870F + GL_DS_SCALE_NV 0x8710 + GL_DT_SCALE_NV 0x8711 + GL_MAGNITUDE_SCALE_NV 0x8712 + GL_VIBRANCE_SCALE_NV 0x8713 + GL_HI_BIAS_NV 0x8714 + GL_LO_BIAS_NV 0x8715 + GL_DS_BIAS_NV 0x8716 + GL_DT_BIAS_NV 0x8717 + GL_MAGNITUDE_BIAS_NV 0x8718 + GL_VIBRANCE_BIAS_NV 0x8719 + GL_TEXTURE_BORDER_VALUES_NV 0x871A + GL_TEXTURE_HI_SIZE_NV 0x871B + GL_TEXTURE_LO_SIZE_NV 0x871C + GL_TEXTURE_DS_SIZE_NV 0x871D + GL_TEXTURE_DT_SIZE_NV 0x871E + GL_TEXTURE_MAG_SIZE_NV 0x871F + GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 + GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 + GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_shader2 b/Windows/glew/auto/extensions/gl/GL_NV_texture_shader2 new file mode 100644 index 00000000..b4b27a2b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_shader2 @@ -0,0 +1,32 @@ +GL_NV_texture_shader2 +http://www.opengl.org/registry/specs/NV/texture_shader2.txt +GL_NV_texture_shader2 + + GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA + GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB + GL_DSDT_MAG_INTENSITY_NV 0x86DC + GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF + GL_HILO_NV 0x86F4 + GL_DSDT_NV 0x86F5 + GL_DSDT_MAG_NV 0x86F6 + GL_DSDT_MAG_VIB_NV 0x86F7 + GL_HILO16_NV 0x86F8 + GL_SIGNED_HILO_NV 0x86F9 + GL_SIGNED_HILO16_NV 0x86FA + GL_SIGNED_RGBA_NV 0x86FB + GL_SIGNED_RGBA8_NV 0x86FC + GL_SIGNED_RGB_NV 0x86FE + GL_SIGNED_RGB8_NV 0x86FF + GL_SIGNED_LUMINANCE_NV 0x8701 + GL_SIGNED_LUMINANCE8_NV 0x8702 + GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 + GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 + GL_SIGNED_ALPHA_NV 0x8705 + GL_SIGNED_ALPHA8_NV 0x8706 + GL_SIGNED_INTENSITY_NV 0x8707 + GL_SIGNED_INTENSITY8_NV 0x8708 + GL_DSDT8_NV 0x8709 + GL_DSDT8_MAG8_NV 0x870A + GL_DSDT8_MAG8_INTENSITY8_NV 0x870B + GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C + GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D diff --git a/Windows/glew/auto/extensions/gl/GL_NV_texture_shader3 b/Windows/glew/auto/extensions/gl/GL_NV_texture_shader3 new file mode 100644 index 00000000..bf6c1138 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_texture_shader3 @@ -0,0 +1,21 @@ +GL_NV_texture_shader3 +http://www.opengl.org/registry/specs/NV/texture_shader3.txt +GL_NV_texture_shader3 + + GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 + GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 + GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 + GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 + GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 + GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 + GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A + GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B + GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C + GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D + GL_HILO8_NV 0x885E + GL_SIGNED_HILO8_NV 0x885F + GL_FORCE_BLUE_TO_ONE_NV 0x8860 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_transform_feedback b/Windows/glew/auto/extensions/gl/GL_NV_transform_feedback new file mode 100644 index 00000000..5f1816eb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_transform_feedback @@ -0,0 +1,40 @@ +GL_NV_transform_feedback +http://developer.download.nvidia.com/opengl/specs/GL_NV_transform_feedback.txt +GL_NV_transform_feedback + + GL_BACK_PRIMARY_COLOR_NV 0x8C77 + GL_BACK_SECONDARY_COLOR_NV 0x8C78 + GL_TEXTURE_COORD_NV 0x8C79 + GL_CLIP_DISTANCE_NV 0x8C7A + GL_VERTEX_ID_NV 0x8C7B + GL_PRIMITIVE_ID_NV 0x8C7C + GL_GENERIC_ATTRIB_NV 0x8C7D + GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 + GL_ACTIVE_VARYINGS_NV 0x8C81 + GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 + GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 + GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 + GL_PRIMITIVES_GENERATED_NV 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 + GL_RASTERIZER_DISCARD_NV 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B + GL_INTERLEAVED_ATTRIBS_NV 0x8C8C + GL_SEPARATE_ATTRIBS_NV 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + void glBeginTransformFeedbackNV (GLenum primitiveMode) + void glEndTransformFeedbackNV (void) + void glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode) + void glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset) + void glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer) + void glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode) + void glActiveVaryingNV (GLuint program, const GLchar *name) + GLint glGetVaryingLocationNV (GLuint program, const GLchar *name) + void glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) + void glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_transform_feedback2 b/Windows/glew/auto/extensions/gl/GL_NV_transform_feedback2 new file mode 100644 index 00000000..ccb49296 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_transform_feedback2 @@ -0,0 +1,15 @@ +GL_NV_transform_feedback2 +http://www.opengl.org/registry/specs/NV/transform_feedback2.txt +GL_NV_transform_feedback2 + + GL_TRANSFORM_FEEDBACK_NV 0x8E22 + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 + GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + void glBindTransformFeedbackNV (GLenum target, GLuint id) + void glDeleteTransformFeedbacksNV (GLsizei n, const GLuint* ids) + void glDrawTransformFeedbackNV (GLenum mode, GLuint id) + void glGenTransformFeedbacksNV (GLsizei n, GLuint* ids) + GLboolean glIsTransformFeedbackNV (GLuint id) + void glPauseTransformFeedbackNV (void) + void glResumeTransformFeedbackNV (void) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_uniform_buffer_unified_memory b/Windows/glew/auto/extensions/gl/GL_NV_uniform_buffer_unified_memory new file mode 100644 index 00000000..d1c27437 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_uniform_buffer_unified_memory @@ -0,0 +1,7 @@ +GL_NV_uniform_buffer_unified_memory +http://www.opengl.org/registry/specs/NV/uniform_buffer_unified_memory.txt +GL_NV_uniform_buffer_unified_memory + + GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E + GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F + GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vdpau_interop b/Windows/glew/auto/extensions/gl/GL_NV_vdpau_interop new file mode 100644 index 00000000..f52949c9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vdpau_interop @@ -0,0 +1,19 @@ +GL_NV_vdpau_interop +http://www.opengl.org/registry/specs/NV/vdpau_interop.txt +GL_NV_vdpau_interop + + GL_SURFACE_STATE_NV 0x86EB + GL_SURFACE_REGISTERED_NV 0x86FD + GL_SURFACE_MAPPED_NV 0x8700 + GL_WRITE_DISCARD_NV 0x88BE + void glVDPAUFiniNV (void) + void glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values) + void glVDPAUInitNV (const void* vdpDevice, const void*getProcAddress) + void glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface) + void glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces) + GLvdpauSurfaceNV glVDPAURegisterOutputSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + GLvdpauSurfaceNV glVDPAURegisterVideoSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + void glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access) + void glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces) + void glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface) + typedef GLintptr GLvdpauSurfaceNV diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_array_range b/Windows/glew/auto/extensions/gl/GL_NV_vertex_array_range new file mode 100644 index 00000000..76e89435 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_array_range @@ -0,0 +1,11 @@ +GL_NV_vertex_array_range +http://www.opengl.org/registry/specs/NV/vertex_array_range.txt +GL_NV_vertex_array_range + + GL_VERTEX_ARRAY_RANGE_NV 0x851D + GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E + GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 + GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + void glFlushVertexArrayRangeNV (void) + void glVertexArrayRangeNV (GLsizei length, void *pointer) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_array_range2 b/Windows/glew/auto/extensions/gl/GL_NV_vertex_array_range2 new file mode 100644 index 00000000..769fdd50 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_array_range2 @@ -0,0 +1,5 @@ +GL_NV_vertex_array_range2 +http://www.opengl.org/registry/specs/NV/vertex_array_range2.txt +GL_NV_vertex_array_range2 + + GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_attrib_integer_64bit b/Windows/glew/auto/extensions/gl/GL_NV_vertex_attrib_integer_64bit new file mode 100644 index 00000000..9e340c1c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_attrib_integer_64bit @@ -0,0 +1,25 @@ +GL_NV_vertex_attrib_integer_64bit +http://www.opengl.org/registry/specs/NV/vertex_attrib_integer_64bit.txt +GL_NV_vertex_attrib_integer_64bit + + GL_INT64_NV 0x140E + GL_UNSIGNED_INT64_NV 0x140F + void glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT* params) + void glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT* params) + void glVertexAttribL1i64NV (GLuint index, GLint64EXT x) + void glVertexAttribL1i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x) + void glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y) + void glVertexAttribL2i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y) + void glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z) + void glVertexAttribL3i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) + void glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) + void glVertexAttribL4i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) + void glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_buffer_unified_memory b/Windows/glew/auto/extensions/gl/GL_NV_vertex_buffer_unified_memory new file mode 100644 index 00000000..e4c2317e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_buffer_unified_memory @@ -0,0 +1,41 @@ +GL_NV_vertex_buffer_unified_memory +http://www.opengl.org/registry/specs/NV/vertex_buffer_unified_memory.txt +GL_NV_vertex_buffer_unified_memory + + GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E + GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F + GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 + GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 + GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 + GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 + GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 + GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 + GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 + GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 + GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 + GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 + GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A + GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B + GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C + GL_COLOR_ARRAY_LENGTH_NV 0x8F2D + GL_INDEX_ARRAY_LENGTH_NV 0x8F2E + GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F + GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 + GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 + GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 + GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 + void glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length) + void glColorFormatNV (GLint size, GLenum type, GLsizei stride) + void glEdgeFlagFormatNV (GLsizei stride) + void glFogCoordFormatNV (GLenum type, GLsizei stride) + void glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT result[]) + void glIndexFormatNV (GLenum type, GLsizei stride) + void glNormalFormatNV (GLenum type, GLsizei stride) + void glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride) + void glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride) + void glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride) + void glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride) + void glVertexFormatNV (GLint size, GLenum type, GLsizei stride) + GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 + GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 + GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_program b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program new file mode 100644 index 00000000..a96f1bb0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program @@ -0,0 +1,151 @@ +GL_NV_vertex_program +http://www.opengl.org/registry/specs/NV/vertex_program.txt +GL_NV_vertex_program + + GL_VERTEX_PROGRAM_NV 0x8620 + GL_VERTEX_STATE_PROGRAM_NV 0x8621 + GL_ATTRIB_ARRAY_SIZE_NV 0x8623 + GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 + GL_ATTRIB_ARRAY_TYPE_NV 0x8625 + GL_CURRENT_ATTRIB_NV 0x8626 + GL_PROGRAM_LENGTH_NV 0x8627 + GL_PROGRAM_STRING_NV 0x8628 + GL_MODELVIEW_PROJECTION_NV 0x8629 + GL_IDENTITY_NV 0x862A + GL_INVERSE_NV 0x862B + GL_TRANSPOSE_NV 0x862C + GL_INVERSE_TRANSPOSE_NV 0x862D + GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E + GL_MAX_TRACK_MATRICES_NV 0x862F + GL_MATRIX0_NV 0x8630 + GL_MATRIX1_NV 0x8631 + GL_MATRIX2_NV 0x8632 + GL_MATRIX3_NV 0x8633 + GL_MATRIX4_NV 0x8634 + GL_MATRIX5_NV 0x8635 + GL_MATRIX6_NV 0x8636 + GL_MATRIX7_NV 0x8637 + GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 + GL_CURRENT_MATRIX_NV 0x8641 + GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 + GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 + GL_PROGRAM_PARAMETER_NV 0x8644 + GL_ATTRIB_ARRAY_POINTER_NV 0x8645 + GL_PROGRAM_TARGET_NV 0x8646 + GL_PROGRAM_RESIDENT_NV 0x8647 + GL_TRACK_MATRIX_NV 0x8648 + GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 + GL_VERTEX_PROGRAM_BINDING_NV 0x864A + GL_PROGRAM_ERROR_POSITION_NV 0x864B + GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 + GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 + GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 + GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 + GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 + GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 + GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 + GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 + GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 + GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 + GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A + GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B + GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C + GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D + GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E + GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F + GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 + GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 + GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 + GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 + GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 + GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 + GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 + GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 + GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 + GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 + GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A + GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B + GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C + GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D + GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E + GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F + GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 + GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 + GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 + GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 + GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 + GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 + GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 + GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 + GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 + GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 + GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A + GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B + GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C + GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D + GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E + GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + GLboolean glAreProgramsResidentNV (GLsizei n, const GLuint* ids, GLboolean *residences) + void glBindProgramNV (GLenum target, GLuint id) + void glDeleteProgramsNV (GLsizei n, const GLuint* ids) + void glExecuteProgramNV (GLenum target, GLuint id, const GLfloat* params) + void glGenProgramsNV (GLsizei n, GLuint* ids) + void glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble* params) + void glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat* params) + void glGetProgramStringNV (GLuint id, GLenum pname, GLubyte* program) + void glGetProgramivNV (GLuint id, GLenum pname, GLint* params) + void glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint* params) + void glGetVertexAttribPointervNV (GLuint index, GLenum pname, void** pointer) + void glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble* params) + void glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribivNV (GLuint index, GLenum pname, GLint* params) + GLboolean glIsProgramNV (GLuint id) + void glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte* program) + void glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble* params) + void glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat* params) + void glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei num, const GLdouble* params) + void glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei num, const GLfloat* params) + void glRequestResidentProgramsNV (GLsizei n, GLuint* ids) + void glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform) + void glVertexAttrib1dNV (GLuint index, GLdouble x) + void glVertexAttrib1dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib1fNV (GLuint index, GLfloat x) + void glVertexAttrib1fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib1sNV (GLuint index, GLshort x) + void glVertexAttrib1svNV (GLuint index, const GLshort* v) + void glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y) + void glVertexAttrib2dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y) + void glVertexAttrib2fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y) + void glVertexAttrib2svNV (GLuint index, const GLshort* v) + void glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttrib3dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z) + void glVertexAttrib3fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z) + void glVertexAttrib3svNV (GLuint index, const GLshort* v) + void glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttrib4dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexAttrib4fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexAttrib4svNV (GLuint index, const GLshort* v) + void glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) + void glVertexAttrib4ubvNV (GLuint index, const GLubyte* v) + void glVertexAttribPointerNV (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer) + void glVertexAttribs1dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs1fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs1svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs2dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs2fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs2svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs3dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs3fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs3svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs4dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs4fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs4svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs4ubvNV (GLuint index, GLsizei n, const GLubyte* v) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_program1_1 b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program1_1 new file mode 100644 index 00000000..28e597b6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program1_1 @@ -0,0 +1,4 @@ +GL_NV_vertex_program1_1 +http://www.opengl.org/registry/specs/NV/vertex_program1_1.txt +GL_NV_vertex_program1_1 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_program2 b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program2 new file mode 100644 index 00000000..c70f345f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program2 @@ -0,0 +1,4 @@ +GL_NV_vertex_program2 +http://www.opengl.org/registry/specs/NV/vertex_program2.txt +GL_NV_vertex_program2 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_program2_option b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program2_option new file mode 100644 index 00000000..3e3e0b7a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program2_option @@ -0,0 +1,6 @@ +GL_NV_vertex_program2_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program2_option.txt +GL_NV_vertex_program2_option + + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_program3 b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program3 new file mode 100644 index 00000000..fbd38990 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program3 @@ -0,0 +1,5 @@ +GL_NV_vertex_program3 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program3.txt +GL_NV_vertex_program3 + + MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C diff --git a/Windows/glew/auto/extensions/gl/GL_NV_vertex_program4 b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program4 new file mode 100644 index 00000000..b1ff7f82 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_vertex_program4 @@ -0,0 +1,5 @@ +GL_NV_vertex_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_vertex_program4.txt +GL_NV_gpu_program4 + + GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD diff --git a/Windows/glew/auto/extensions/gl/GL_NV_video_capture b/Windows/glew/auto/extensions/gl/GL_NV_video_capture new file mode 100644 index 00000000..1361f7f7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_video_capture @@ -0,0 +1,45 @@ +GL_NV_video_capture +http://www.opengl.org/registry/specs/NV/video_capture.txt +GL_NV_video_capture + + GL_VIDEO_BUFFER_NV 0x9020 + GL_VIDEO_BUFFER_BINDING_NV 0x9021 + GL_FIELD_UPPER_NV 0x9022 + GL_FIELD_LOWER_NV 0x9023 + GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 + GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 + GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 + GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 + GL_VIDEO_BUFFER_PITCH_NV 0x9028 + GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 + GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A + GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B + GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C + GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D + GL_PARTIAL_SUCCESS_NV 0x902E + GL_SUCCESS_NV 0x902F + GL_FAILURE_NV 0x9030 + GL_YCBYCR8_422_NV 0x9031 + GL_YCBAYCR8A_4224_NV 0x9032 + GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 + GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 + GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 + GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 + GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 + GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 + GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 + GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A + GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B + GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + void glBeginVideoCaptureNV (GLuint video_capture_slot) + void glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset) + void glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture) + void glEndVideoCaptureNV (GLuint video_capture_slot) + void glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint* params) + GLenum glVideoCaptureNV (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time) + void glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params) + void glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params) + void glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params) + void glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params) + void glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params) + void glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_viewport_array b/Windows/glew/auto/extensions/gl/GL_NV_viewport_array new file mode 100644 index 00000000..1ef8d2b8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_viewport_array @@ -0,0 +1,24 @@ +GL_NV_viewport_array +http://www.opengl.org/registry/specs/NV/viewport_array.txt +GL_NV_viewport_array + + GL_DEPTH_RANGE 0x0B70 + GL_VIEWPORT 0x0BA2 + GL_SCISSOR_BOX 0x0C10 + GL_SCISSOR_TEST 0x0C11 + GL_MAX_VIEWPORTS_NV 0x825B + GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C + GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D + GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F + void glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat * v) + void glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f) + void glDisableiNV (GLenum target, GLuint index) + void glEnableiNV (GLenum target, GLuint index) + void glGetFloati_vNV (GLenum target, GLuint index, GLfloat* data) + GLboolean glIsEnablediNV (GLenum target, GLuint index) + void glScissorArrayvNV (GLuint first, GLsizei count, const GLint * v) + void glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height) + void glScissorIndexedvNV (GLuint index, const GLint * v) + void glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat * v) + void glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) + void glViewportIndexedfvNV (GLuint index, const GLfloat * v) diff --git a/Windows/glew/auto/extensions/gl/GL_NV_viewport_array2 b/Windows/glew/auto/extensions/gl/GL_NV_viewport_array2 new file mode 100644 index 00000000..025389db --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_viewport_array2 @@ -0,0 +1,4 @@ +GL_NV_viewport_array2 +http://www.opengl.org/registry/specs/NV/viewport_array2.txt +GL_NV_viewport_array2 + diff --git a/Windows/glew/auto/extensions/gl/GL_NV_viewport_swizzle b/Windows/glew/auto/extensions/gl/GL_NV_viewport_swizzle new file mode 100644 index 00000000..c7e730cb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_NV_viewport_swizzle @@ -0,0 +1,17 @@ +GL_NV_viewport_swizzle +http://www.opengl.org/registry/specs/NV/viewport_swizzle.txt +GL_NV_viewport_swizzle + + GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 + GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 + GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 + GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 + GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 + GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 + GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 + GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 + GL_VIEWPORT_SWIZZLE_X_NV 0x9358 + GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 + GL_VIEWPORT_SWIZZLE_Z_NV 0x935A + GL_VIEWPORT_SWIZZLE_W_NV 0x935B + void glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew) diff --git a/Windows/glew/auto/extensions/gl/GL_OES_byte_coordinates b/Windows/glew/auto/extensions/gl/GL_OES_byte_coordinates new file mode 100644 index 00000000..825c8730 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OES_byte_coordinates @@ -0,0 +1,4 @@ +GL_OES_byte_coordinates +http://www.opengl.org/registry/specs/OES/OES_byte_coordinates.txt +GL_OES_byte_coordinates + diff --git a/Windows/glew/auto/extensions/gl/GL_OML_interlace b/Windows/glew/auto/extensions/gl/GL_OML_interlace new file mode 100644 index 00000000..52e75d69 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OML_interlace @@ -0,0 +1,6 @@ +GL_OML_interlace +http://www.opengl.org/registry/specs/OML/interlace.txt +GL_OML_interlace + + GL_INTERLACE_OML 0x8980 + GL_INTERLACE_READ_OML 0x8981 diff --git a/Windows/glew/auto/extensions/gl/GL_OML_resample b/Windows/glew/auto/extensions/gl/GL_OML_resample new file mode 100644 index 00000000..12d688bb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OML_resample @@ -0,0 +1,10 @@ +GL_OML_resample +http://www.opengl.org/registry/specs/OML/resample.txt +GL_OML_resample + + GL_PACK_RESAMPLE_OML 0x8984 + GL_UNPACK_RESAMPLE_OML 0x8985 + GL_RESAMPLE_REPLICATE_OML 0x8986 + GL_RESAMPLE_ZERO_FILL_OML 0x8987 + GL_RESAMPLE_AVERAGE_OML 0x8988 + GL_RESAMPLE_DECIMATE_OML 0x8989 diff --git a/Windows/glew/auto/extensions/gl/GL_OML_subsample b/Windows/glew/auto/extensions/gl/GL_OML_subsample new file mode 100644 index 00000000..48d50814 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OML_subsample @@ -0,0 +1,6 @@ +GL_OML_subsample +http://www.opengl.org/registry/specs/OML/subsample.txt +GL_OML_subsample + + GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 + GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 diff --git a/Windows/glew/auto/extensions/gl/GL_OVR_multiview b/Windows/glew/auto/extensions/gl/GL_OVR_multiview new file mode 100644 index 00000000..d7ee785e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OVR_multiview @@ -0,0 +1,9 @@ +GL_OVR_multiview +http://www.opengl.org/registry/specs/OVR/multiview.txt +GL_OVR_multiview + + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 + GL_MAX_VIEWS_OVR 0x9631 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 + GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 + void glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews) diff --git a/Windows/glew/auto/extensions/gl/GL_OVR_multiview2 b/Windows/glew/auto/extensions/gl/GL_OVR_multiview2 new file mode 100644 index 00000000..6b69e8b4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OVR_multiview2 @@ -0,0 +1,4 @@ +GL_OVR_multiview2 +http://www.opengl.org/registry/specs/OVR/multiview2.txt +GL_OVR_multiview2 + diff --git a/Windows/glew/auto/extensions/gl/GL_OVR_multiview_multisampled_render_to_texture b/Windows/glew/auto/extensions/gl/GL_OVR_multiview_multisampled_render_to_texture new file mode 100644 index 00000000..446a8535 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_OVR_multiview_multisampled_render_to_texture @@ -0,0 +1,5 @@ +GL_OVR_multiview_multisampled_render_to_texture +http://www.opengl.org/registry/specs/OVR/multiview_multisampled_render_to_texture.txt +GL_OVR_multiview_multisampled_render_to_texture + + void glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews) diff --git a/Windows/glew/auto/extensions/gl/GL_PGI_misc_hints b/Windows/glew/auto/extensions/gl/GL_PGI_misc_hints new file mode 100644 index 00000000..a4e6245e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_PGI_misc_hints @@ -0,0 +1,24 @@ +GL_PGI_misc_hints +http://www.opengl.org/registry/specs/PGI/misc_hints.txt +GL_PGI_misc_hints + + GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 + GL_CONSERVE_MEMORY_HINT_PGI 107005 + GL_RECLAIM_MEMORY_HINT_PGI 107006 + GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 + GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 + GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 + GL_ALWAYS_FAST_HINT_PGI 107020 + GL_ALWAYS_SOFT_HINT_PGI 107021 + GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 + GL_ALLOW_DRAW_WIN_HINT_PGI 107023 + GL_ALLOW_DRAW_FRG_HINT_PGI 107024 + GL_ALLOW_DRAW_MEM_HINT_PGI 107025 + GL_STRICT_DEPTHFUNC_HINT_PGI 107030 + GL_STRICT_LIGHTING_HINT_PGI 107031 + GL_STRICT_SCISSOR_HINT_PGI 107032 + GL_FULL_STIPPLE_HINT_PGI 107033 + GL_CLIP_NEAR_HINT_PGI 107040 + GL_CLIP_FAR_HINT_PGI 107041 + GL_WIDE_LINE_HINT_PGI 107042 + GL_BACK_NORMALS_HINT_PGI 107043 diff --git a/Windows/glew/auto/extensions/gl/GL_PGI_vertex_hints b/Windows/glew/auto/extensions/gl/GL_PGI_vertex_hints new file mode 100644 index 00000000..dd648805 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_PGI_vertex_hints @@ -0,0 +1,26 @@ +GL_PGI_vertex_hints +http://www.opengl.org/registry/specs/PGI/vertex_hints.txt +GL_PGI_vertex_hints + + GL_VERTEX23_BIT_PGI 0x00000004 + GL_VERTEX4_BIT_PGI 0x00000008 + GL_COLOR3_BIT_PGI 0x00010000 + GL_COLOR4_BIT_PGI 0x00020000 + GL_EDGEFLAG_BIT_PGI 0x00040000 + GL_INDEX_BIT_PGI 0x00080000 + GL_MAT_AMBIENT_BIT_PGI 0x00100000 + GL_VERTEX_DATA_HINT_PGI 107050 + GL_VERTEX_CONSISTENT_HINT_PGI 107051 + GL_MATERIAL_SIDE_HINT_PGI 107052 + GL_MAX_VERTEX_HINT_PGI 107053 + GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 + GL_MAT_DIFFUSE_BIT_PGI 0x00400000 + GL_MAT_EMISSION_BIT_PGI 0x00800000 + GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 + GL_MAT_SHININESS_BIT_PGI 0x02000000 + GL_MAT_SPECULAR_BIT_PGI 0x04000000 + GL_NORMAL_BIT_PGI 0x08000000 + GL_TEXCOORD1_BIT_PGI 0x10000000 + GL_TEXCOORD2_BIT_PGI 0x20000000 + GL_TEXCOORD3_BIT_PGI 0x40000000 + GL_TEXCOORD4_BIT_PGI 0x80000000 diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_alpha_test b/Windows/glew/auto/extensions/gl/GL_QCOM_alpha_test new file mode 100644 index 00000000..3236a284 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_alpha_test @@ -0,0 +1,8 @@ +GL_QCOM_alpha_test +http://www.opengl.org/registry/specs/QCOM/alpha_test.txt +GL_QCOM_alpha_test + + GL_ALPHA_TEST_QCOM 0x0BC0 + GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 + GL_ALPHA_TEST_REF_QCOM 0x0BC2 + void glAlphaFuncQCOM (GLenum func, GLclampf ref) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_binning_control b/Windows/glew/auto/extensions/gl/GL_QCOM_binning_control new file mode 100644 index 00000000..241b3e35 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_binning_control @@ -0,0 +1,9 @@ +GL_QCOM_binning_control +http://www.opengl.org/registry/specs/QCOM/binning_control.txt +GL_QCOM_binning_control + + GL_DONT_CARE 0x1100 + GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 + GL_CPU_OPTIMIZED_QCOM 0x8FB1 + GL_GPU_OPTIMIZED_QCOM 0x8FB2 + GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_driver_control b/Windows/glew/auto/extensions/gl/GL_QCOM_driver_control new file mode 100644 index 00000000..1ac3b059 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_driver_control @@ -0,0 +1,8 @@ +GL_QCOM_driver_control +http://www.opengl.org/registry/specs/QCOM/driver_control.txt +GL_QCOM_driver_control + + void glDisableDriverControlQCOM (GLuint driverControl) + void glEnableDriverControlQCOM (GLuint driverControl) + void glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar *driverControlString) + void glGetDriverControlsQCOM (GLint* num, GLsizei size, GLuint *driverControls) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_extended_get b/Windows/glew/auto/extensions/gl/GL_QCOM_extended_get new file mode 100644 index 00000000..b463ad70 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_extended_get @@ -0,0 +1,23 @@ +GL_QCOM_extended_get +http://www.opengl.org/registry/specs/QCOM/extended_get.txt +GL_QCOM_extended_get + + GL_TEXTURE_WIDTH_QCOM 0x8BD2 + GL_TEXTURE_HEIGHT_QCOM 0x8BD3 + GL_TEXTURE_DEPTH_QCOM 0x8BD4 + GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 + GL_TEXTURE_FORMAT_QCOM 0x8BD6 + GL_TEXTURE_TYPE_QCOM 0x8BD7 + GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 + GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 + GL_TEXTURE_TARGET_QCOM 0x8BDA + GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB + GL_STATE_RESTORE 0x8BDC + void glExtGetBufferPointervQCOM (GLenum target, void** params) + void glExtGetBuffersQCOM (GLuint* buffers, GLint maxBuffers, GLint* numBuffers) + void glExtGetFramebuffersQCOM (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers) + void glExtGetRenderbuffersQCOM (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers) + void glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params) + void glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels) + void glExtGetTexturesQCOM (GLuint* textures, GLint maxTextures, GLint* numTextures) + void glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_extended_get2 b/Windows/glew/auto/extensions/gl/GL_QCOM_extended_get2 new file mode 100644 index 00000000..93ca064e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_extended_get2 @@ -0,0 +1,8 @@ +GL_QCOM_extended_get2 +http://www.opengl.org/registry/specs/QCOM/extended_get2.txt +GL_QCOM_extended_get2 + + void glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar* source, GLint* length) + void glExtGetProgramsQCOM (GLuint* programs, GLint maxPrograms, GLint* numPrograms) + void glExtGetShadersQCOM (GLuint* shaders, GLint maxShaders, GLint* numShaders) + GLboolean glExtIsProgramBinaryQCOM (GLuint program) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_framebuffer_foveated b/Windows/glew/auto/extensions/gl/GL_QCOM_framebuffer_foveated new file mode 100644 index 00000000..3802fcc8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_framebuffer_foveated @@ -0,0 +1,8 @@ +GL_QCOM_framebuffer_foveated +http://www.opengl.org/registry/specs/QCOM/framebuffer_foveated.txt +GL_QCOM_framebuffer_foveated + + GL_FOVEATION_ENABLE_BIT_QCOM 0x1 + GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x2 + void glFramebufferFoveationConfigQCOM (GLuint fbo, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint* providedFeatures) + void glFramebufferFoveationParametersQCOM (GLuint fbo, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_perfmon_global_mode b/Windows/glew/auto/extensions/gl/GL_QCOM_perfmon_global_mode new file mode 100644 index 00000000..d3fa7557 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_perfmon_global_mode @@ -0,0 +1,5 @@ +GL_QCOM_perfmon_global_mode +http://www.opengl.org/registry/specs/QCOM/performance_monitor_global_mode.txt +GL_QCOM_perfmon_global_mode + + GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_shader_framebuffer_fetch_noncoherent b/Windows/glew/auto/extensions/gl/GL_QCOM_shader_framebuffer_fetch_noncoherent new file mode 100644 index 00000000..afe90501 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_shader_framebuffer_fetch_noncoherent @@ -0,0 +1,6 @@ +GL_QCOM_shader_framebuffer_fetch_noncoherent +http://www.opengl.org/registry/specs/QCOM/shader_framebuffer_fetch_noncoherent.txt +GL_QCOM_shader_framebuffer_fetch_noncoherent + + GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 + void glFramebufferFetchBarrierQCOM (void) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_tiled_rendering b/Windows/glew/auto/extensions/gl/GL_QCOM_tiled_rendering new file mode 100644 index 00000000..2e2615e3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_tiled_rendering @@ -0,0 +1,38 @@ +GL_QCOM_tiled_rendering +http://www.opengl.org/registry/specs/QCOM/tiled_rendering.txt +GL_QCOM_tiled_rendering + + GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 + GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 + GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 + GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 + GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 + GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 + GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 + GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 + GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 + GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 + GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 + GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 + GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 + GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 + GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 + GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 + GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 + GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 + GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 + GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 + GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 + GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 + GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 + GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 + GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 + GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 + GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 + GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 + GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 + GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 + GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 + GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 + void glEndTilingQCOM (GLbitfield preserveMask) + void glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) diff --git a/Windows/glew/auto/extensions/gl/GL_QCOM_writeonly_rendering b/Windows/glew/auto/extensions/gl/GL_QCOM_writeonly_rendering new file mode 100644 index 00000000..55557801 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_QCOM_writeonly_rendering @@ -0,0 +1,5 @@ +GL_QCOM_writeonly_rendering +http://www.opengl.org/registry/specs/QCOM/writeonly_rendering.txt +GL_QCOM_writeonly_rendering + + GL_WRITEONLY_RENDERING_QCOM 0x8823 diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_ES1_0_compatibility b/Windows/glew/auto/extensions/gl/GL_REGAL_ES1_0_compatibility new file mode 100644 index 00000000..e5e5df60 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_ES1_0_compatibility @@ -0,0 +1,36 @@ +GL_REGAL_ES1_0_compatibility +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_ES1_0_compatibility + + void glAlphaFuncx (GLenum func, GLclampx ref) + void glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) + void glClearDepthx (GLclampx depth) + void glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) + void glDepthRangex (GLclampx zNear, GLclampx zFar) + void glFogx (GLenum pname, GLfixed param) + void glFogxv (GLenum pname, const GLfixed* params) + void glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) + void glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) + void glLightModelx (GLenum pname, GLfixed param) + void glLightModelxv (GLenum pname, const GLfixed* params) + void glLightx (GLenum light, GLenum pname, GLfixed param) + void glLightxv (GLenum light, GLenum pname, const GLfixed* params) + void glLineWidthx (GLfixed width) + void glLoadMatrixx (const GLfixed* m) + void glMaterialx (GLenum face, GLenum pname, GLfixed param) + void glMaterialxv (GLenum face, GLenum pname, const GLfixed* params) + void glMultMatrixx (const GLfixed* m) + void glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) + void glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz) + void glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) + void glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) + void glPointSizex (GLfixed size) + void glPolygonOffsetx (GLfixed factor, GLfixed units) + void glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z) + void glSampleCoveragex (GLclampx value, GLboolean invert) + void glScalex (GLfixed x, GLfixed y, GLfixed z) + void glTexEnvx (GLenum target, GLenum pname, GLfixed param) + void glTexEnvxv (GLenum target, GLenum pname, const GLfixed* params) + void glTexParameterx (GLenum target, GLenum pname, GLfixed param) + void glTranslatex (GLfixed x, GLfixed y, GLfixed z) + typedef int GLclampx diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_ES1_1_compatibility b/Windows/glew/auto/extensions/gl/GL_REGAL_ES1_1_compatibility new file mode 100644 index 00000000..7b6427ca --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_ES1_1_compatibility @@ -0,0 +1,17 @@ +GL_REGAL_ES1_1_compatibility +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_ES1_1_compatibility + + void glClipPlanef (GLenum plane, const GLfloat* equation) + void glClipPlanex (GLenum plane, const GLfixed* equation) + void glGetClipPlanef (GLenum pname, GLfloat eqn[4]) + void glGetClipPlanex (GLenum pname, GLfixed eqn[4]) + void glGetFixedv (GLenum pname, GLfixed* params) + void glGetLightxv (GLenum light, GLenum pname, GLfixed* params) + void glGetMaterialxv (GLenum face, GLenum pname, GLfixed* params) + void glGetTexEnvxv (GLenum env, GLenum pname, GLfixed* params) + void glGetTexParameterxv (GLenum target, GLenum pname, GLfixed* params) + void glPointParameterx (GLenum pname, GLfixed param) + void glPointParameterxv (GLenum pname, const GLfixed* params) + void glPointSizePointerOES (GLenum type, GLsizei stride, const void *pointer) + void glTexParameterxv (GLenum target, GLenum pname, const GLfixed* params) diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_enable b/Windows/glew/auto/extensions/gl/GL_REGAL_enable new file mode 100644 index 00000000..f45a904c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_enable @@ -0,0 +1,14 @@ +GL_REGAL_enable +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_enable + + GL_ERROR_REGAL 0x9322 + GL_DEBUG_REGAL 0x9323 + GL_LOG_REGAL 0x9324 + GL_EMULATION_REGAL 0x9325 + GL_DRIVER_REGAL 0x9326 + GL_MISSING_REGAL 0x9360 + GL_TRACE_REGAL 0x9361 + GL_CACHE_REGAL 0x9362 + GL_CODE_REGAL 0x9363 + GL_STATISTICS_REGAL 0x9364 diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_error_string b/Windows/glew/auto/extensions/gl/GL_REGAL_error_string new file mode 100644 index 00000000..9f9777ab --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_error_string @@ -0,0 +1,5 @@ +GL_REGAL_error_string +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_error_string + + const GLchar* glErrorStringREGAL (GLenum error) diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_extension_query b/Windows/glew/auto/extensions/gl/GL_REGAL_extension_query new file mode 100644 index 00000000..19b40de5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_extension_query @@ -0,0 +1,6 @@ +GL_REGAL_extension_query +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_extension_query + + GLboolean glGetExtensionREGAL (const GLchar* ext) + GLboolean glIsSupportedREGAL (const GLchar* ext) diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_log b/Windows/glew/auto/extensions/gl/GL_REGAL_log new file mode 100644 index 00000000..6923283b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_log @@ -0,0 +1,15 @@ +GL_REGAL_log +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_log + + GL_LOG_ERROR_REGAL 0x9319 + GL_LOG_WARNING_REGAL 0x931A + GL_LOG_INFO_REGAL 0x931B + GL_LOG_APP_REGAL 0x931C + GL_LOG_DRIVER_REGAL 0x931D + GL_LOG_INTERNAL_REGAL 0x931E + GL_LOG_DEBUG_REGAL 0x931F + GL_LOG_STATUS_REGAL 0x9320 + GL_LOG_HTTP_REGAL 0x9321 + void glLogMessageCallbackREGAL (GLLOGPROCREGAL callback) + typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context) diff --git a/Windows/glew/auto/extensions/gl/GL_REGAL_proc_address b/Windows/glew/auto/extensions/gl/GL_REGAL_proc_address new file mode 100644 index 00000000..708b29ad --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REGAL_proc_address @@ -0,0 +1,5 @@ +GL_REGAL_proc_address +https://github.com/p3/regal/tree/master/doc/extensions +GL_REGAL_proc_address + + void * glGetProcAddressREGAL (const GLchar *name) diff --git a/Windows/glew/auto/extensions/gl/GL_REND_screen_coordinates b/Windows/glew/auto/extensions/gl/GL_REND_screen_coordinates new file mode 100644 index 00000000..6c9e38c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_REND_screen_coordinates @@ -0,0 +1,6 @@ +GL_REND_screen_coordinates +http://www.opengl.org/registry/specs/REND/screen_coordinates.txt +GL_REND_screen_coordinates + + GL_SCREEN_COORDINATES_REND 0x8490 + GL_INVERTED_SCREEN_W_REND 0x8491 diff --git a/Windows/glew/auto/extensions/gl/GL_S3_s3tc b/Windows/glew/auto/extensions/gl/GL_S3_s3tc new file mode 100644 index 00000000..956df285 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_S3_s3tc @@ -0,0 +1,10 @@ +GL_S3_s3tc +http://www.opengl.org/registry/specs/S3/s3tc.txt +GL_S3_s3tc + + GL_RGB_S3TC 0x83A0 + GL_RGB4_S3TC 0x83A1 + GL_RGBA_S3TC 0x83A2 + GL_RGBA4_S3TC 0x83A3 + GL_RGBA_DXT5_S3TC 0x83A4 + GL_RGBA4_DXT5_S3TC 0x83A5 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_clip_band_hint b/Windows/glew/auto/extensions/gl/GL_SGIS_clip_band_hint new file mode 100644 index 00000000..5d858583 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_clip_band_hint @@ -0,0 +1,4 @@ +GL_SGIS_clip_band_hint +http://www.opengl.org/registry/specs/SGIS/clip_band_hint.txt +GL_SGIS_clip_band_hint + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_color_range b/Windows/glew/auto/extensions/gl/GL_SGIS_color_range new file mode 100644 index 00000000..9b0be574 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_color_range @@ -0,0 +1,13 @@ +GL_SGIS_color_range +http://www.opengl.org/registry/specs/SGIS/color_range.txt +GL_SGIS_color_range + + GL_EXTENDED_RANGE_SGIS 0x85A5 + GL_MIN_RED_SGIS 0x85A6 + GL_MAX_RED_SGIS 0x85A7 + GL_MIN_GREEN_SGIS 0x85A8 + GL_MAX_GREEN_SGIS 0x85A9 + GL_MIN_BLUE_SGIS 0x85AA + GL_MAX_BLUE_SGIS 0x85AB + GL_MIN_ALPHA_SGIS 0x85AC + GL_MAX_ALPHA_SGIS 0x85AD diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_detail_texture b/Windows/glew/auto/extensions/gl/GL_SGIS_detail_texture new file mode 100644 index 00000000..0bdf94b8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_detail_texture @@ -0,0 +1,6 @@ +GL_SGIS_detail_texture +http://www.opengl.org/registry/specs/SGIS/detail_texture.txt +GL_SGIS_detail_texture + + void glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat* points) + void glGetDetailTexFuncSGIS (GLenum target, GLfloat* points) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_fog_function b/Windows/glew/auto/extensions/gl/GL_SGIS_fog_function new file mode 100644 index 00000000..71f888ba --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_fog_function @@ -0,0 +1,6 @@ +GL_SGIS_fog_function +http://www.opengl.org/registry/specs/SGIS/fog_function.txt +GL_SGIS_fog_function + + void glFogFuncSGIS (GLsizei n, const GLfloat* points) + void glGetFogFuncSGIS (GLfloat* points) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_generate_mipmap b/Windows/glew/auto/extensions/gl/GL_SGIS_generate_mipmap new file mode 100644 index 00000000..dd4d24f9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_generate_mipmap @@ -0,0 +1,6 @@ +GL_SGIS_generate_mipmap +http://www.opengl.org/registry/specs/SGIS/generate_mipmap.txt +GL_SGIS_generate_mipmap + + GL_GENERATE_MIPMAP_SGIS 0x8191 + GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_line_texgen b/Windows/glew/auto/extensions/gl/GL_SGIS_line_texgen new file mode 100644 index 00000000..968ff96c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_line_texgen @@ -0,0 +1,4 @@ +GL_SGIS_line_texgen +http://www.opengl.org/registry/specs/SGIS/line_texgen.txt +GL_SGIS_line_texgen + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_multisample b/Windows/glew/auto/extensions/gl/GL_SGIS_multisample new file mode 100644 index 00000000..8085b9c1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_multisample @@ -0,0 +1,22 @@ +GL_SGIS_multisample +http://www.opengl.org/registry/specs/SGIS/multisample.txt +GL_SGIS_multisample + + GL_MULTISAMPLE_SGIS 0x809D + GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E + GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F + GL_SAMPLE_MASK_SGIS 0x80A0 + GL_1PASS_SGIS 0x80A1 + GL_2PASS_0_SGIS 0x80A2 + GL_2PASS_1_SGIS 0x80A3 + GL_4PASS_0_SGIS 0x80A4 + GL_4PASS_1_SGIS 0x80A5 + GL_4PASS_2_SGIS 0x80A6 + GL_4PASS_3_SGIS 0x80A7 + GL_SAMPLE_BUFFERS_SGIS 0x80A8 + GL_SAMPLES_SGIS 0x80A9 + GL_SAMPLE_MASK_VALUE_SGIS 0x80AA + GL_SAMPLE_MASK_INVERT_SGIS 0x80AB + GL_SAMPLE_PATTERN_SGIS 0x80AC + void glSampleMaskSGIS (GLclampf value, GLboolean invert) + void glSamplePatternSGIS (GLenum pattern) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_multitexture b/Windows/glew/auto/extensions/gl/GL_SGIS_multitexture new file mode 100644 index 00000000..fb534dc3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_multitexture @@ -0,0 +1,19 @@ +GL_SGIS_multitexture +http://www.opengl.org/registry/specs/SGIS/multitexture.txt +GL_SGIS_multitexture + + GL_SELECTED_TEXTURE_SGIS 0x83C0 + GL_SELECTED_TEXTURE_COORD_SET_SGIS 0x83C1 + GL_SELECTED_TEXTURE_TRANSFORM_SGIS 0x83C2 + GL_MAX_TEXTURES_SGIS 0x83C3 + GL_MAX_TEXTURE_COORD_SETS_SGIS 0x83C4 + GL_TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS 0x83C5 + GL_TEXTURE_ENV_COORD_SET_SGIS 0x83C6 + GL_TEXTURE0_SGIS 0x83C7 + GL_TEXTURE1_SGIS 0x83C8 + GL_TEXTURE2_SGIS 0x83C9 + GL_TEXTURE3_SGIS 0x83CA + void glInterleavedTextureCoordSetsSGIS (GLint factor) + void glSelectTextureCoordSetSGIS (GLenum target) + void glSelectTextureSGIS (GLenum target) + void glSelectTextureTransformSGIS (GLenum target) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_pixel_texture b/Windows/glew/auto/extensions/gl/GL_SGIS_pixel_texture new file mode 100644 index 00000000..c9bd6075 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_pixel_texture @@ -0,0 +1,4 @@ +GL_SGIS_pixel_texture +http://www.opengl.org/registry/specs/SGIS/pixel_texture.txt +GL_SGIS_pixel_texture + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_point_line_texgen b/Windows/glew/auto/extensions/gl/GL_SGIS_point_line_texgen new file mode 100644 index 00000000..e99014c7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_point_line_texgen @@ -0,0 +1,12 @@ +GL_SGIS_point_line_texgen +http://www.opengl.org/registry/specs/SGIS/point_line_texgen.txt +GL_SGIS_point_line_texgen + + GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 + GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 + GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 + GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 + GL_EYE_POINT_SGIS 0x81F4 + GL_OBJECT_POINT_SGIS 0x81F5 + GL_EYE_LINE_SGIS 0x81F6 + GL_OBJECT_LINE_SGIS 0x81F7 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_shared_multisample b/Windows/glew/auto/extensions/gl/GL_SGIS_shared_multisample new file mode 100644 index 00000000..cb2816e0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_shared_multisample @@ -0,0 +1,5 @@ +GL_SGIS_shared_multisample +http://www.opengl.org/registry/specs/SGIS/shared_multisample.txt +GL_SGIS_shared_multisample + + void glMultisampleSubRectPosSGIS (GLint x, GLint y) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_sharpen_texture b/Windows/glew/auto/extensions/gl/GL_SGIS_sharpen_texture new file mode 100644 index 00000000..4fa6efbb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_sharpen_texture @@ -0,0 +1,6 @@ +GL_SGIS_sharpen_texture +http://www.opengl.org/registry/specs/SGIS/sharpen_texture.txt +GL_SGIS_sharpen_texture + + void glGetSharpenTexFuncSGIS (GLenum target, GLfloat* points) + void glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat* points) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_texture4D b/Windows/glew/auto/extensions/gl/GL_SGIS_texture4D new file mode 100644 index 00000000..428a88c4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_texture4D @@ -0,0 +1,6 @@ +GL_SGIS_texture4D +http://www.opengl.org/registry/specs/SGIS/texture4D.txt +GL_SGIS_texture4D + + void glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels) + void glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_texture_border_clamp b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_border_clamp new file mode 100644 index 00000000..db4ff3ef --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_border_clamp @@ -0,0 +1,5 @@ +GL_SGIS_texture_border_clamp +http://www.opengl.org/registry/specs/SGIS/texture_border_clamp.txt +GL_SGIS_texture_border_clamp + + GL_CLAMP_TO_BORDER_SGIS 0x812D diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_texture_edge_clamp b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_edge_clamp new file mode 100644 index 00000000..6b016c17 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_edge_clamp @@ -0,0 +1,5 @@ +GL_SGIS_texture_edge_clamp +http://www.opengl.org/registry/specs/SGIS/texture_edge_clamp.txt +GL_SGIS_texture_edge_clamp + + GL_CLAMP_TO_EDGE_SGIS 0x812F diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_texture_filter4 b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_filter4 new file mode 100644 index 00000000..db5bd049 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_filter4 @@ -0,0 +1,6 @@ +GL_SGIS_texture_filter4 +http://www.opengl.org/registry/specs/SGIS/texture_filter4.txt +GL_SGIS_texture_filter4 + + void glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat* weights) + void glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_texture_lod b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_lod new file mode 100644 index 00000000..a7297ec8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_lod @@ -0,0 +1,8 @@ +GL_SGIS_texture_lod +http://www.opengl.org/registry/specs/SGIS/texture_lod.txt +GL_SGIS_texture_lod + + GL_TEXTURE_MIN_LOD_SGIS 0x813A + GL_TEXTURE_MAX_LOD_SGIS 0x813B + GL_TEXTURE_BASE_LEVEL_SGIS 0x813C + GL_TEXTURE_MAX_LEVEL_SGIS 0x813D diff --git a/Windows/glew/auto/extensions/gl/GL_SGIS_texture_select b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_select new file mode 100644 index 00000000..3df4c231 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIS_texture_select @@ -0,0 +1,4 @@ +GL_SGIS_texture_select +http://www.opengl.org/registry/specs/SGIS/texture_select.txt +GL_SGIS_texture_select + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_async b/Windows/glew/auto/extensions/gl/GL_SGIX_async new file mode 100644 index 00000000..cc6b0cc6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_async @@ -0,0 +1,11 @@ +GL_SGIX_async +http://www.opengl.org/registry/specs/SGIX/async.txt +GL_SGIX_async + + GL_ASYNC_MARKER_SGIX 0x8329 + void glAsyncMarkerSGIX (GLuint marker) + void glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range) + GLint glFinishAsyncSGIX (GLuint* markerp) + GLuint glGenAsyncMarkersSGIX (GLsizei range) + GLboolean glIsAsyncMarkerSGIX (GLuint marker) + GLint glPollAsyncSGIX (GLuint* markerp) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_async_histogram b/Windows/glew/auto/extensions/gl/GL_SGIX_async_histogram new file mode 100644 index 00000000..e06d78d2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_async_histogram @@ -0,0 +1,6 @@ +GL_SGIX_async_histogram +http://www.opengl.org/registry/specs/SGIX/async_histogram.txt +GL_SGIX_async_histogram + + GL_ASYNC_HISTOGRAM_SGIX 0x832C + GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_async_pixel b/Windows/glew/auto/extensions/gl/GL_SGIX_async_pixel new file mode 100644 index 00000000..a6df72be --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_async_pixel @@ -0,0 +1,10 @@ +GL_SGIX_async_pixel +http://www.opengl.org/registry/specs/SGIX/async_pixel.txt +GL_SGIX_async_pixel + + GL_ASYNC_TEX_IMAGE_SGIX 0x835C + GL_ASYNC_DRAW_PIXELS_SGIX 0x835D + GL_ASYNC_READ_PIXELS_SGIX 0x835E + GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F + GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 + GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_bali_g_instruments b/Windows/glew/auto/extensions/gl/GL_SGIX_bali_g_instruments new file mode 100644 index 00000000..66205810 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_bali_g_instruments @@ -0,0 +1,8 @@ +GL_SGIX_bali_g_instruments +http://www.opengl.org/registry/specs/SGIX/bali_g_instruments.txt +GL_SGIX_bali_g_instruments + + GL_BALI_NUM_TRIS_CULLED_INSTRUMENT 0x6080 + GL_BALI_NUM_PRIMS_CLIPPED_INSTRUMENT 0x6081 + GL_BALI_NUM_PRIMS_REJECT_INSTRUMENT 0x6082 + GL_BALI_NUM_PRIMS_CLIP_RESULT_INSTRUMENT 0x6083 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_bali_r_instruments b/Windows/glew/auto/extensions/gl/GL_SGIX_bali_r_instruments new file mode 100644 index 00000000..17b795e5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_bali_r_instruments @@ -0,0 +1,7 @@ +GL_SGIX_bali_r_instruments +http://www.opengl.org/registry/specs/SGIX/bali_r_instruments.txt +GL_SGIX_bali_r_instruments + + GL_BALI_FRAGMENTS_GENERATED_INSTRUMENT 0x6090 + GL_BALI_DEPTH_PASS_INSTRUMENT 0x6091 + GL_BALI_R_CHIP_COUNT 0x6092 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_bali_timer_instruments b/Windows/glew/auto/extensions/gl/GL_SGIX_bali_timer_instruments new file mode 100644 index 00000000..a5c63a93 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_bali_timer_instruments @@ -0,0 +1,4 @@ +GL_SGIX_bali_timer_instruments +http://www.opengl.org/registry/specs/SGIX/bali_timer_instruments.txt +GL_SGIX_bali_timer_instruments + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_blend_alpha_minmax b/Windows/glew/auto/extensions/gl/GL_SGIX_blend_alpha_minmax new file mode 100644 index 00000000..0e741384 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_blend_alpha_minmax @@ -0,0 +1,6 @@ +GL_SGIX_blend_alpha_minmax +http://www.opengl.org/registry/specs/SGIX/blend_alpha_minmax.txt +GL_SGIX_blend_alpha_minmax + + GL_ALPHA_MIN_SGIX 0x8320 + GL_ALPHA_MAX_SGIX 0x8321 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_blend_cadd b/Windows/glew/auto/extensions/gl/GL_SGIX_blend_cadd new file mode 100644 index 00000000..8d14ce90 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_blend_cadd @@ -0,0 +1,5 @@ +GL_SGIX_blend_cadd +http://www.opengl.org/registry/specs/SGIX/blend_cadd.txt +GL_SGIX_blend_cadd + + GL_FUNC_COMPLEX_ADD_EXT 0x601C diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_blend_cmultiply b/Windows/glew/auto/extensions/gl/GL_SGIX_blend_cmultiply new file mode 100644 index 00000000..a65cbf88 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_blend_cmultiply @@ -0,0 +1,5 @@ +GL_SGIX_blend_cmultiply +http://www.opengl.org/registry/specs/SGIX/blend_cmultiply.txt +GL_SGIX_blend_cmultiply + + GL_FUNC_COMPLEX_MULTIPLY_EXT 0x601B diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_calligraphic_fragment b/Windows/glew/auto/extensions/gl/GL_SGIX_calligraphic_fragment new file mode 100644 index 00000000..ec0507dc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_calligraphic_fragment @@ -0,0 +1,4 @@ +GL_SGIX_calligraphic_fragment +http://www.opengl.org/registry/specs/SGIX/calligraphic_fragment.txt +GL_SGIX_calligraphic_fragment + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_clipmap b/Windows/glew/auto/extensions/gl/GL_SGIX_clipmap new file mode 100644 index 00000000..1f67f087 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_clipmap @@ -0,0 +1,4 @@ +GL_SGIX_clipmap +http://www.opengl.org/registry/specs/SGIX/clipmap.txt +GL_SGIX_clipmap + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_color_matrix_accuracy b/Windows/glew/auto/extensions/gl/GL_SGIX_color_matrix_accuracy new file mode 100644 index 00000000..281674de --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_color_matrix_accuracy @@ -0,0 +1,5 @@ +GL_SGIX_color_matrix_accuracy +http://www.opengl.org/registry/specs/SGIX/color_matrix_accuracy.txt +GL_SGIX_color_matrix_accuracy + + GL_COLOR_MATRIX_HINT 0x8317 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_color_table_index_mode b/Windows/glew/auto/extensions/gl/GL_SGIX_color_table_index_mode new file mode 100644 index 00000000..77e94726 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_color_table_index_mode @@ -0,0 +1,4 @@ +GL_SGIX_color_table_index_mode +http://www.opengl.org/registry/specs/SGIX/color_table_index_mode.txt +GL_SGIX_color_table_index_mode + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_complex_polar b/Windows/glew/auto/extensions/gl/GL_SGIX_complex_polar new file mode 100644 index 00000000..986e3392 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_complex_polar @@ -0,0 +1,4 @@ +GL_SGIX_complex_polar +http://www.opengl.org/registry/specs/SGIX/complex_polar.txt +GL_SGIX_complex_polar + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_convolution_accuracy b/Windows/glew/auto/extensions/gl/GL_SGIX_convolution_accuracy new file mode 100644 index 00000000..e2b968cc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_convolution_accuracy @@ -0,0 +1,5 @@ +GL_SGIX_convolution_accuracy +http://www.opengl.org/registry/specs/SGIX/convolution_accuracy.txt +GL_SGIX_convolution_accuracy + + GL_CONVOLUTION_HINT_SGIX 0x8316 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_cube_map b/Windows/glew/auto/extensions/gl/GL_SGIX_cube_map new file mode 100644 index 00000000..be4840e6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_cube_map @@ -0,0 +1,13 @@ +GL_SGIX_cube_map +http://www.opengl.org/registry/specs/SGIX/cube_map.txt +GL_SGIX_cube_map + + GL_ENV_MAP_SGIX 0x8340 + GL_CUBE_MAP_SGIX 0x8341 + GL_CUBE_MAP_ZP_SGIX 0x8342 + GL_CUBE_MAP_ZN_SGIX 0x8343 + GL_CUBE_MAP_XN_SGIX 0x8344 + GL_CUBE_MAP_XP_SGIX 0x8345 + GL_CUBE_MAP_YN_SGIX 0x8346 + GL_CUBE_MAP_YP_SGIX 0x8347 + GL_CUBE_MAP_BINDING_SGIX 0x8348 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_cylinder_texgen b/Windows/glew/auto/extensions/gl/GL_SGIX_cylinder_texgen new file mode 100644 index 00000000..26a96b96 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_cylinder_texgen @@ -0,0 +1,4 @@ +GL_SGIX_cylinder_texgen +http://www.opengl.org/registry/specs/SGIX/cylinder_texgen.txt +GL_SGIX_cylinder_texgen + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_datapipe b/Windows/glew/auto/extensions/gl/GL_SGIX_datapipe new file mode 100644 index 00000000..82e98012 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_datapipe @@ -0,0 +1,8 @@ +GL_SGIX_datapipe +http://www.opengl.org/registry/specs/SGIX/datapipe.txt +GL_SGIX_datapipe + + GL_GEOMETRY_BIT 0x1 + GL_IMAGE_BIT 0x2 + void glAddressSpace (GLenum space, GLbitfield mask) + GLint glDataPipe (GLenum space) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_decimation b/Windows/glew/auto/extensions/gl/GL_SGIX_decimation new file mode 100644 index 00000000..80a9561c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_decimation @@ -0,0 +1,4 @@ +GL_SGIX_decimation +http://www.opengl.org/registry/specs/SGIX/decimation.txt +GL_SGIX_decimation + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_depth_pass_instrument b/Windows/glew/auto/extensions/gl/GL_SGIX_depth_pass_instrument new file mode 100644 index 00000000..847c98ea --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_depth_pass_instrument @@ -0,0 +1,7 @@ +GL_SGIX_depth_pass_instrument +http://www.opengl.org/registry/specs/SGIX/depth_pass_instrument.txt +GL_SGIX_depth_pass_instrument + + GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 + GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 + GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_depth_texture b/Windows/glew/auto/extensions/gl/GL_SGIX_depth_texture new file mode 100644 index 00000000..d2c1a53d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_depth_texture @@ -0,0 +1,7 @@ +GL_SGIX_depth_texture +http://www.opengl.org/registry/specs/SGIX/depth_texture.txt +GL_SGIX_depth_texture + + GL_DEPTH_COMPONENT16_SGIX 0x81A5 + GL_DEPTH_COMPONENT24_SGIX 0x81A6 + GL_DEPTH_COMPONENT32_SGIX 0x81A7 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_dvc b/Windows/glew/auto/extensions/gl/GL_SGIX_dvc new file mode 100644 index 00000000..e1f16168 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_dvc @@ -0,0 +1,4 @@ +GL_SGIX_dvc +http://www.opengl.org/registry/specs/SGIX/dvc.txt +GL_SGIX_dvc + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_flush_raster b/Windows/glew/auto/extensions/gl/GL_SGIX_flush_raster new file mode 100644 index 00000000..12989203 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_flush_raster @@ -0,0 +1,5 @@ +GL_SGIX_flush_raster +http://www.opengl.org/registry/specs/SGIX/flush_raster.txt +GL_SGIX_flush_raster + + void glFlushRasterSGIX (void) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_blend b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_blend new file mode 100644 index 00000000..6c7b8169 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_blend @@ -0,0 +1,6 @@ +GL_SGIX_fog_blend +http://www.opengl.org/registry/specs/SGIX/fog_blend.txt +GL_SGIX_fog_blend + + GL_FOG_BLEND_ALPHA_SGIX 0x81FE + GL_FOG_BLEND_COLOR_SGIX 0x81FF diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_factor_to_alpha b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_factor_to_alpha new file mode 100644 index 00000000..153e03fa --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_factor_to_alpha @@ -0,0 +1,4 @@ +GL_SGIX_fog_factor_to_alpha +http://www.opengl.org/registry/specs/SGIX/fog_factor_to_alpha.txt +GL_SGIX_fog_factor_to_alpha + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_layers b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_layers new file mode 100644 index 00000000..5f5a2023 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_layers @@ -0,0 +1,12 @@ +GL_SGIX_fog_layers +http://www.opengl.org/registry/specs/SGIX/fog_layers.txt +GL_SGIX_fog_layers + + GL_FOG_TYPE_SGIX 0x8323 + GL_UNIFORM_SGIX 0x8324 + GL_LAYERED_SGIX 0x8325 + GL_FOG_GROUND_PLANE_SGIX 0x8326 + GL_FOG_LAYERS_POINTS_SGIX 0x8327 + GL_MAX_FOG_LAYERS_POINTS_SGIX 0x8328 + void glFogLayersSGIX (GLsizei n, const GLfloat* points) + void glGetFogLayersSGIX (GLfloat* points) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_offset b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_offset new file mode 100644 index 00000000..4e8c83b7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_offset @@ -0,0 +1,6 @@ +GL_SGIX_fog_offset +http://www.opengl.org/registry/specs/SGIX/fog_offset.txt +GL_SGIX_fog_offset + + GL_FOG_OFFSET_SGIX 0x8198 + GL_FOG_OFFSET_VALUE_SGIX 0x8199 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_patchy b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_patchy new file mode 100644 index 00000000..2520dfdc --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_patchy @@ -0,0 +1,4 @@ +GL_SGIX_fog_patchy +http://www.opengl.org/registry/specs/SGIX/fog_patchy.txt +GL_SGIX_fog_patchy + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_scale b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_scale new file mode 100644 index 00000000..5a918e95 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_scale @@ -0,0 +1,6 @@ +GL_SGIX_fog_scale +http://www.opengl.org/registry/specs/SGIX/fog_scale.txt +GL_SGIX_fog_scale + + GL_FOG_SCALE_SGIX 0x81FC + GL_FOG_SCALE_VALUE_SGIX 0x81FD diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fog_texture b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_texture new file mode 100644 index 00000000..bf8e0bfb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fog_texture @@ -0,0 +1,5 @@ +GL_SGIX_fog_texture +http://www.opengl.org/registry/specs/SGIX/fog_texture.txt +GL_SGIX_fog_texture + + void glTextureFogSGIX (GLenum pname) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fragment_lighting_space b/Windows/glew/auto/extensions/gl/GL_SGIX_fragment_lighting_space new file mode 100644 index 00000000..863cc5ff --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fragment_lighting_space @@ -0,0 +1,8 @@ +GL_SGIX_fragment_lighting_space +http://www.opengl.org/registry/specs/SGIX/fragment_lighting_space.txt +GL_SGIX_fragment_lighting_space + + GL_EYE_SPACE_SGIX 0x8436 + GL_TANGENT_SPACE_SGIX 0x8437 + GL_OBJECT_SPACE_SGIX 0x8438 + GL_FRAGMENT_LIGHT_SPACE_SGIX 0x843D diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fragment_specular_lighting b/Windows/glew/auto/extensions/gl/GL_SGIX_fragment_specular_lighting new file mode 100644 index 00000000..b5881cbf --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fragment_specular_lighting @@ -0,0 +1,21 @@ +GL_SGIX_fragment_specular_lighting +http://www.opengl.org/registry/specs/SGIX/fragment_specular_lighting.txt +GL_SGIX_fragment_specular_lighting + + void glFragmentColorMaterialSGIX (GLenum face, GLenum mode) + void glFragmentLightModelfSGIX (GLenum pname, GLfloat param) + void glFragmentLightModelfvSGIX (GLenum pname, GLfloat* params) + void glFragmentLightModeliSGIX (GLenum pname, GLint param) + void glFragmentLightModelivSGIX (GLenum pname, GLint* params) + void glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param) + void glFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat* params) + void glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param) + void glFragmentLightivSGIX (GLenum light, GLenum pname, GLint* params) + void glFragmentMaterialfSGIX (GLenum face, GLenum pname, const GLfloat param) + void glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat* params) + void glFragmentMaterialiSGIX (GLenum face, GLenum pname, const GLint param) + void glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint* params) + void glGetFragmentLightfvSGIX (GLenum light, GLenum value, GLfloat* data) + void glGetFragmentLightivSGIX (GLenum light, GLenum value, GLint* data) + void glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat* data) + void glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint* data) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_fragments_instrument b/Windows/glew/auto/extensions/gl/GL_SGIX_fragments_instrument new file mode 100644 index 00000000..13afa2f2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_fragments_instrument @@ -0,0 +1,7 @@ +GL_SGIX_fragments_instrument +http://www.opengl.org/registry/specs/SGIX/fragments_instrument.txt +GL_SGIX_fragments_instrument + + GL_FRAGMENTS_INSTRUMENT_SGIX 0x8313 + GL_FRAGMENTS_INSTRUMENT_COUNTERS_SGIX 0x8314 + GL_FRAGMENTS_INSTRUMENT_MAX_SGIX 0x8315 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_framezoom b/Windows/glew/auto/extensions/gl/GL_SGIX_framezoom new file mode 100644 index 00000000..5684e456 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_framezoom @@ -0,0 +1,5 @@ +GL_SGIX_framezoom +http://www.opengl.org/registry/specs/SGIX/framezoom.txt +GL_SGIX_framezoom + + void glFrameZoomSGIX (GLint factor) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_icc_texture b/Windows/glew/auto/extensions/gl/GL_SGIX_icc_texture new file mode 100644 index 00000000..4d486643 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_icc_texture @@ -0,0 +1,16 @@ +GL_SGIX_icc_texture +http://www.opengl.org/registry/specs/SGIX/icc_texture.txt +GL_SGIX_icc_texture + + GL_RGB_ICC_SGIX 0x8460 + GL_RGBA_ICC_SGIX 0x8461 + GL_ALPHA_ICC_SGIX 0x8462 + GL_LUMINANCE_ICC_SGIX 0x8463 + GL_INTENSITY_ICC_SGIX 0x8464 + GL_LUMINANCE_ALPHA_ICC_SGIX 0x8465 + GL_R5_G6_B5_ICC_SGIX 0x8466 + GL_R5_G6_B5_A8_ICC_SGIX 0x8467 + GL_ALPHA16_ICC_SGIX 0x8468 + GL_LUMINANCE16_ICC_SGIX 0x8469 + GL_INTENSITY16_ICC_SGIX 0x846A + GL_LUMINANCE16_ALPHA8_ICC_SGIX 0x846B diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_igloo_interface b/Windows/glew/auto/extensions/gl/GL_SGIX_igloo_interface new file mode 100644 index 00000000..4a8bc274 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_igloo_interface @@ -0,0 +1,13 @@ +GL_SGIX_igloo_interface +http://www.opengl.org/registry/specs/SGIX/igloo_interface.txt +GL_SGIX_igloo_interface + + GL_IGLOO_FULLSCREEN_SGIX 0x819E + GL_IGLOO_VIEWPORT_OFFSET_SGIX 0x819F + GL_IGLOO_SWAPTMESH_SGIX 0x81A0 + GL_IGLOO_COLORNORMAL_SGIX 0x81A1 + GL_IGLOO_IRISGL_MODE_SGIX 0x81A2 + GL_IGLOO_LMC_COLOR_SGIX 0x81A3 + GL_IGLOO_TMESHMODE_SGIX 0x81A4 + GL_LIGHT31 0xBEAD + void glIglooInterfaceSGIX (GLenum pname, void *param) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_image_compression b/Windows/glew/auto/extensions/gl/GL_SGIX_image_compression new file mode 100644 index 00000000..f4189b93 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_image_compression @@ -0,0 +1,4 @@ +GL_SGIX_image_compression +http://www.opengl.org/registry/specs/SGIX/image_compression.txt +GL_SGIX_image_compression + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_impact_pixel_texture b/Windows/glew/auto/extensions/gl/GL_SGIX_impact_pixel_texture new file mode 100644 index 00000000..d5e14cbb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_impact_pixel_texture @@ -0,0 +1,4 @@ +GL_SGIX_impact_pixel_texture +http://www.opengl.org/registry/specs/SGIX/impact_pixel_texture.txt +GL_SGIX_impact_pixel_texture + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_instrument_error b/Windows/glew/auto/extensions/gl/GL_SGIX_instrument_error new file mode 100644 index 00000000..b7e36ffb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_instrument_error @@ -0,0 +1,4 @@ +GL_SGIX_instrument_error +http://www.opengl.org/registry/specs/SGIX/instrument_error.txt +GL_SGIX_instrument_error + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_interlace b/Windows/glew/auto/extensions/gl/GL_SGIX_interlace new file mode 100644 index 00000000..856ca69e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_interlace @@ -0,0 +1,5 @@ +GL_SGIX_interlace +http://www.opengl.org/registry/specs/SGIX/interlace.txt +GL_SGIX_interlace + + GL_INTERLACE_SGIX 0x8094 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_ir_instrument1 b/Windows/glew/auto/extensions/gl/GL_SGIX_ir_instrument1 new file mode 100644 index 00000000..cf6cbf46 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_ir_instrument1 @@ -0,0 +1,4 @@ +GL_SGIX_ir_instrument1 +http://www.opengl.org/registry/specs/SGIX/ir_instrument1.txt +GL_SGIX_ir_instrument1 + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_line_quality_hint b/Windows/glew/auto/extensions/gl/GL_SGIX_line_quality_hint new file mode 100644 index 00000000..88ce78b0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_line_quality_hint @@ -0,0 +1,5 @@ +GL_SGIX_line_quality_hint +http://www.opengl.org/registry/specs/SGIX/line_quality_hint.txt +GL_SGIX_line_quality_hint + + GL_LINE_QUALITY_HINT_SGIX 0x835B diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_list_priority b/Windows/glew/auto/extensions/gl/GL_SGIX_list_priority new file mode 100644 index 00000000..f1fa5537 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_list_priority @@ -0,0 +1,4 @@ +GL_SGIX_list_priority +http://www.opengl.org/registry/specs/SGIX/list_priority.txt +GL_SGIX_list_priority + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_mpeg1 b/Windows/glew/auto/extensions/gl/GL_SGIX_mpeg1 new file mode 100644 index 00000000..85cf5c0d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_mpeg1 @@ -0,0 +1,15 @@ +GL_SGIX_mpeg1 +http://www.opengl.org/registry/specs/SGIX/mpeg1.txt +GL_SGIX_mpeg1 + + void glAllocMPEGPredictorsSGIX (GLsizei width, GLsizei height, GLsizei n, GLuint* predictors) + void glDeleteMPEGPredictorsSGIX (GLsizei n, GLuint* predictors) + void glGenMPEGPredictorsSGIX (GLsizei n, GLuint* predictors) + void glGetMPEGParameterfvSGIX (GLenum target, GLenum pname, GLfloat* params) + void glGetMPEGParameterivSGIX (GLenum target, GLenum pname, GLint* params) + void glGetMPEGPredictorSGIX (GLenum target, GLenum format, GLenum type, void *pixels) + void glGetMPEGQuantTableubv (GLenum target, GLubyte* values) + GLboolean glIsMPEGPredictorSGIX (GLuint predictor) + void glMPEGPredictorSGIX (GLenum target, GLenum format, GLenum type, void *pixels) + void glMPEGQuantTableubv (GLenum target, GLubyte* values) + void glSwapMPEGPredictorsSGIX (GLenum target0, GLenum target1) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_mpeg2 b/Windows/glew/auto/extensions/gl/GL_SGIX_mpeg2 new file mode 100644 index 00000000..192c9372 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_mpeg2 @@ -0,0 +1,4 @@ +GL_SGIX_mpeg2 +http://www.opengl.org/registry/specs/SGIX/mpeg2.txt +GL_SGIX_mpeg2 + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_nonlinear_lighting_pervertex b/Windows/glew/auto/extensions/gl/GL_SGIX_nonlinear_lighting_pervertex new file mode 100644 index 00000000..87b3cba9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_nonlinear_lighting_pervertex @@ -0,0 +1,8 @@ +GL_SGIX_nonlinear_lighting_pervertex +http://www.opengl.org/registry/specs/SGIX/nonlinear_lighting_pervertex.txt +GL_SGIX_nonlinear_lighting_pervertex + + void glGetNonlinLightfvSGIX (GLenum light, GLenum pname, GLint* terms, GLfloat *data) + void glGetNonlinMaterialfvSGIX (GLenum face, GLenum pname, GLint* terms, const GLfloat *data) + void glNonlinLightfvSGIX (GLenum light, GLenum pname, GLint terms, GLfloat* params) + void glNonlinMaterialfvSGIX (GLenum face, GLenum pname, GLint terms, const GLfloat* params) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_nurbs_eval b/Windows/glew/auto/extensions/gl/GL_SGIX_nurbs_eval new file mode 100644 index 00000000..6cb5cacd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_nurbs_eval @@ -0,0 +1,24 @@ +GL_SGIX_nurbs_eval +http://www.opengl.org/registry/specs/SGIX/nurbs_eval.txt +GL_SGIX_nurbs_eval + + GL_MAP1_VERTEX_3_NURBS_SGIX 0x81CB + GL_MAP1_VERTEX_4_NURBS_SGIX 0x81CC + GL_MAP1_INDEX_NURBS_SGIX 0x81CD + GL_MAP1_COLOR_4_NURBS_SGIX 0x81CE + GL_MAP1_NORMAL_NURBS_SGIX 0x81CF + GL_MAP1_TEXTURE_COORD_1_NURBS_SGIX 0x81E0 + GL_MAP1_TEXTURE_COORD_2_NURBS_SGIX 0x81E1 + GL_MAP1_TEXTURE_COORD_3_NURBS_SGIX 0x81E2 + GL_MAP1_TEXTURE_COORD_4_NURBS_SGIX 0x81E3 + GL_MAP2_VERTEX_3_NURBS_SGIX 0x81E4 + GL_MAP2_VERTEX_4_NURBS_SGIX 0x81E5 + GL_MAP2_INDEX_NURBS_SGIX 0x81E6 + GL_MAP2_COLOR_4_NURBS_SGIX 0x81E7 + GL_MAP2_NORMAL_NURBS_SGIX 0x81E8 + GL_MAP2_TEXTURE_COORD_1_NURBS_SGIX 0x81E9 + GL_MAP2_TEXTURE_COORD_2_NURBS_SGIX 0x81EA + GL_MAP2_TEXTURE_COORD_3_NURBS_SGIX 0x81EB + GL_MAP2_TEXTURE_COORD_4_NURBS_SGIX 0x81EC + GL_NURBS_KNOT_COUNT_SGIX 0x81ED + GL_NURBS_KNOT_VECTOR_SGIX 0x81EE diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_occlusion_instrument b/Windows/glew/auto/extensions/gl/GL_SGIX_occlusion_instrument new file mode 100644 index 00000000..b98a8ca3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_occlusion_instrument @@ -0,0 +1,5 @@ +GL_SGIX_occlusion_instrument +http://www.opengl.org/registry/specs/SGIX/occlusion_instrument.txt +GL_SGIX_occlusion_instrument + + GL_OCCLUSION_INSTRUMENT_SGIX 0x6060 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_packed_6bytes b/Windows/glew/auto/extensions/gl/GL_SGIX_packed_6bytes new file mode 100644 index 00000000..42b5f56d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_packed_6bytes @@ -0,0 +1,4 @@ +GL_SGIX_packed_6bytes +http://www.opengl.org/registry/specs/SGIX/packed_6bytes.txt +GL_SGIX_packed_6bytes + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture new file mode 100644 index 00000000..70a31a3e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture @@ -0,0 +1,5 @@ +GL_SGIX_pixel_texture +http://www.opengl.org/registry/specs/SGIX/sgix_pixel_texture.txt +GL_SGIX_pixel_texture + + void glPixelTexGenSGIX (GLenum mode) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture_bits b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture_bits new file mode 100644 index 00000000..93807f87 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture_bits @@ -0,0 +1,4 @@ +GL_SGIX_pixel_texture_bits +http://www.opengl.org/registry/specs/SGIX/pixel_texture_bits.txt +GL_SGIX_pixel_texture_bits + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture_lod b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture_lod new file mode 100644 index 00000000..0416f1eb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_texture_lod @@ -0,0 +1,4 @@ +GL_SGIX_pixel_texture_lod +http://www.opengl.org/registry/specs/SGIX/pixel_texture_lod.txt +GL_SGIX_pixel_texture_lod + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_tiles b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_tiles new file mode 100644 index 00000000..4e63597b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_pixel_tiles @@ -0,0 +1,4 @@ +GL_SGIX_pixel_tiles +http://www.opengl.org/registry/specs/SGIX/pixel_tiles.txt +GL_SGIX_pixel_tiles + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_polynomial_ffd b/Windows/glew/auto/extensions/gl/GL_SGIX_polynomial_ffd new file mode 100644 index 00000000..4dd7dfb6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_polynomial_ffd @@ -0,0 +1,8 @@ +GL_SGIX_polynomial_ffd +http://www.opengl.org/registry/specs/SGIX/polynomial_ffd.txt +GL_SGIX_polynomial_ffd + + GL_TEXTURE_DEFORMATION_BIT_SGIX 0x1 + GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x2 + void glDeformSGIX (GLbitfield mask) + void glLoadIdentityDeformationMapSGIX (GLbitfield mask) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_quad_mesh b/Windows/glew/auto/extensions/gl/GL_SGIX_quad_mesh new file mode 100644 index 00000000..4fd0d62b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_quad_mesh @@ -0,0 +1,6 @@ +GL_SGIX_quad_mesh +http://www.opengl.org/registry/specs/SGIX/quad_mesh.txt +GL_SGIX_quad_mesh + + void glMeshBreadthSGIX (GLint breadth) + void glMeshStrideSGIX (GLint stride) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_reference_plane b/Windows/glew/auto/extensions/gl/GL_SGIX_reference_plane new file mode 100644 index 00000000..b5a63db1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_reference_plane @@ -0,0 +1,5 @@ +GL_SGIX_reference_plane +http://www.opengl.org/registry/specs/SGIX/reference_plane.txt +GL_SGIX_reference_plane + + void glReferencePlaneSGIX (const GLdouble* equation) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_resample b/Windows/glew/auto/extensions/gl/GL_SGIX_resample new file mode 100644 index 00000000..21aac10e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_resample @@ -0,0 +1,9 @@ +GL_SGIX_resample +http://www.opengl.org/registry/specs/SGIX/resample.txt +GL_SGIX_resample + + GL_PACK_RESAMPLE_SGIX 0x842E + GL_UNPACK_RESAMPLE_SGIX 0x842F + GL_RESAMPLE_DECIMATE_SGIX 0x8430 + GL_RESAMPLE_REPLICATE_SGIX 0x8433 + GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_scalebias_hint b/Windows/glew/auto/extensions/gl/GL_SGIX_scalebias_hint new file mode 100644 index 00000000..16ce007a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_scalebias_hint @@ -0,0 +1,5 @@ +GL_SGIX_scalebias_hint +http://www.opengl.org/registry/specs/SGIX/scalebias_hint.txt +GL_SGIX_scalebias_hint + + GL_SCALEBIAS_HINT_SGIX 0x8322 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_shadow b/Windows/glew/auto/extensions/gl/GL_SGIX_shadow new file mode 100644 index 00000000..3580721d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_shadow @@ -0,0 +1,8 @@ +GL_SGIX_shadow +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/shadow.txt +GL_SGIX_shadow + + GL_TEXTURE_COMPARE_SGIX 0x819A + GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B + GL_TEXTURE_LEQUAL_R_SGIX 0x819C + GL_TEXTURE_GEQUAL_R_SGIX 0x819D diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_shadow_ambient b/Windows/glew/auto/extensions/gl/GL_SGIX_shadow_ambient new file mode 100644 index 00000000..44ca05f1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_shadow_ambient @@ -0,0 +1,5 @@ +GL_SGIX_shadow_ambient +http://www.opengl.org/registry/specs/SGIX/shadow_ambient.txt +GL_SGIX_shadow_ambient + + GL_SHADOW_AMBIENT_SGIX 0x80BF diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_slim b/Windows/glew/auto/extensions/gl/GL_SGIX_slim new file mode 100644 index 00000000..eb9eb5bb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_slim @@ -0,0 +1,8 @@ +GL_SGIX_slim +http://www.opengl.org/registry/specs/SGIX/slim.txt +GL_SGIX_slim + + GL_PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B + GL_SLIM8U_SGIX 0x831D + GL_SLIM10U_SGIX 0x831E + GL_SLIM12S_SGIX 0x831F diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_spotlight_cutoff b/Windows/glew/auto/extensions/gl/GL_SGIX_spotlight_cutoff new file mode 100644 index 00000000..8b669949 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_spotlight_cutoff @@ -0,0 +1,5 @@ +GL_SGIX_spotlight_cutoff +http://www.opengl.org/registry/specs/SGIX/spotlight_cutoff.txt +GL_SGIX_spotlight_cutoff + + GL_SPOT_CUTOFF_DELTA_SGIX 0x8193 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_sprite b/Windows/glew/auto/extensions/gl/GL_SGIX_sprite new file mode 100644 index 00000000..b903f714 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_sprite @@ -0,0 +1,8 @@ +GL_SGIX_sprite +http://www.opengl.org/registry/specs/SGIX/sprite.txt +GL_SGIX_sprite + + void glSpriteParameterfSGIX (GLenum pname, GLfloat param) + void glSpriteParameterfvSGIX (GLenum pname, GLfloat* params) + void glSpriteParameteriSGIX (GLenum pname, GLint param) + void glSpriteParameterivSGIX (GLenum pname, GLint* params) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_subdiv_patch b/Windows/glew/auto/extensions/gl/GL_SGIX_subdiv_patch new file mode 100644 index 00000000..a18ee25c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_subdiv_patch @@ -0,0 +1,4 @@ +GL_SGIX_subdiv_patch +http://www.opengl.org/registry/specs/SGIX/subdiv_patch.txt +GL_SGIX_subdiv_patch + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_subsample b/Windows/glew/auto/extensions/gl/GL_SGIX_subsample new file mode 100644 index 00000000..8358305a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_subsample @@ -0,0 +1,9 @@ +GL_SGIX_subsample +http://www.opengl.org/registry/specs/SGIX/subsample.txt +GL_SGIX_subsample + + GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 + GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 + GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 + GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 + GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_tag_sample_buffer b/Windows/glew/auto/extensions/gl/GL_SGIX_tag_sample_buffer new file mode 100644 index 00000000..bf52c053 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_tag_sample_buffer @@ -0,0 +1,5 @@ +GL_SGIX_tag_sample_buffer +http://www.opengl.org/registry/specs/SGIX/tag_sample_buffer.txt +GL_SGIX_tag_sample_buffer + + void glTagSampleBufferSGIX (void) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_add_env b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_add_env new file mode 100644 index 00000000..21da2b5a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_add_env @@ -0,0 +1,4 @@ +GL_SGIX_texture_add_env +http://www.opengl.org/registry/specs/SGIX/texture_env_add.txt +GL_SGIX_texture_add_env + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_coordinate_clamp b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_coordinate_clamp new file mode 100644 index 00000000..04704664 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_coordinate_clamp @@ -0,0 +1,7 @@ +GL_SGIX_texture_coordinate_clamp +http://www.opengl.org/registry/specs/SGIX/texture_coordinate_clamp.txt +GL_SGIX_texture_coordinate_clamp + + GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 + GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A + GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_lod_bias b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_lod_bias new file mode 100644 index 00000000..6a0a91f8 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_lod_bias @@ -0,0 +1,4 @@ +GL_SGIX_texture_lod_bias +http://www.opengl.org/registry/specs/SGIX/texture_lod_bias.txt +GL_SGIX_texture_lod_bias + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_mipmap_anisotropic b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_mipmap_anisotropic new file mode 100644 index 00000000..52592226 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_mipmap_anisotropic @@ -0,0 +1,6 @@ +GL_SGIX_texture_mipmap_anisotropic +http://www.opengl.org/registry/specs/SGIX/texture_mipmap_anisotropic.txt +GL_SGIX_texture_mipmap_anisotropic + + GL_TEXTURE_MIPMAP_ANISOTROPY_SGIX 0x832E + GL_MAX_MIPMAP_ANISOTROPY_SGIX 0x832F diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_multi_buffer b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_multi_buffer new file mode 100644 index 00000000..aeda38df --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_multi_buffer @@ -0,0 +1,5 @@ +GL_SGIX_texture_multi_buffer +http://www.opengl.org/registry/specs/SGIX/texture_multi_buffer.txt +GL_SGIX_texture_multi_buffer + + GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_phase b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_phase new file mode 100644 index 00000000..bdddd450 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_phase @@ -0,0 +1,5 @@ +GL_SGIX_texture_phase +http://www.opengl.org/registry/specs/SGIX/texture_phase.txt +GL_SGIX_texture_phase + + GL_PHASE_SGIX 0x832A diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_range b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_range new file mode 100644 index 00000000..1febea10 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_range @@ -0,0 +1,32 @@ +GL_SGIX_texture_range +http://www.opengl.org/registry/specs/SGIX/texture_range.txt +GL_SGIX_texture_range + + GL_RGB_SIGNED_SGIX 0x85E0 + GL_RGBA_SIGNED_SGIX 0x85E1 + GL_ALPHA_SIGNED_SGIX 0x85E2 + GL_LUMINANCE_SIGNED_SGIX 0x85E3 + GL_INTENSITY_SIGNED_SGIX 0x85E4 + GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 + GL_RGB16_SIGNED_SGIX 0x85E6 + GL_RGBA16_SIGNED_SGIX 0x85E7 + GL_ALPHA16_SIGNED_SGIX 0x85E8 + GL_LUMINANCE16_SIGNED_SGIX 0x85E9 + GL_INTENSITY16_SIGNED_SGIX 0x85EA + GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB + GL_RGB_EXTENDED_RANGE_SGIX 0x85EC + GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED + GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE + GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF + GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 + GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 + GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 + GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 + GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 + GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 + GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 + GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 + GL_MIN_LUMINANCE_SGIS 0x85F8 + GL_MAX_LUMINANCE_SGIS 0x85F9 + GL_MIN_INTENSITY_SGIS 0x85FA + GL_MAX_INTENSITY_SGIS 0x85FB diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_scale_bias b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_scale_bias new file mode 100644 index 00000000..41613979 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_scale_bias @@ -0,0 +1,8 @@ +GL_SGIX_texture_scale_bias +http://www.opengl.org/registry/specs/SGIX/texture_scale_bias.txt +GL_SGIX_texture_scale_bias + + GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 + GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A + GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B + GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_texture_supersample b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_supersample new file mode 100644 index 00000000..aebc5305 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_texture_supersample @@ -0,0 +1,4 @@ +GL_SGIX_texture_supersample +http://www.opengl.org/registry/specs/SGIX/texture_supersample.txt +GL_SGIX_texture_supersample + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_vector_ops b/Windows/glew/auto/extensions/gl/GL_SGIX_vector_ops new file mode 100644 index 00000000..7a976029 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_vector_ops @@ -0,0 +1,6 @@ +GL_SGIX_vector_ops +http://www.opengl.org/registry/specs/SGIX/vector_ops.txt +GL_SGIX_vector_ops + + void glGetVectorOperationSGIX (GLenum operation) + void glVectorOperationSGIX (GLenum operation) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_array_object b/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_array_object new file mode 100644 index 00000000..7ed0f678 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_array_object @@ -0,0 +1,10 @@ +GL_SGIX_vertex_array_object +http://www.opengl.org/registry/specs/SGIX/vertex_array_object.txt +GL_SGIX_vertex_array_object + + GLboolean glAreVertexArraysResidentSGIX (GLsizei n, const GLuint* arrays, GLboolean* residences) + void glBindVertexArraySGIX (GLuint array) + void glDeleteVertexArraysSGIX (GLsizei n, const GLuint* arrays) + void glGenVertexArraysSGIX (GLsizei n, GLuint* arrays) + GLboolean glIsVertexArraySGIX (GLuint array) + void glPrioritizeVertexArraysSGIX (GLsizei n, const GLuint* arrays, const GLclampf* priorities) diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_preclip b/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_preclip new file mode 100644 index 00000000..2a804a10 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_preclip @@ -0,0 +1,6 @@ +GL_SGIX_vertex_preclip +http://www.opengl.org/registry/specs/SGIX/vertex_preclip.txt +GL_SGIX_vertex_preclip + + GL_VERTEX_PRECLIP_SGIX 0x83EE + GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_preclip_hint b/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_preclip_hint new file mode 100644 index 00000000..9b37a56f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_vertex_preclip_hint @@ -0,0 +1,6 @@ +GL_SGIX_vertex_preclip_hint +http://www.opengl.org/registry/specs/SGIX/vertex_preclip.txt +GL_SGIX_vertex_preclip_hint + + GL_VERTEX_PRECLIP_SGIX 0x83EE + GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcb b/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcb new file mode 100644 index 00000000..a3b22e75 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcb @@ -0,0 +1,4 @@ +GL_SGIX_ycrcb +http://www.opengl.org/registry/specs/SGIX/ycrcb.txt +GL_SGIX_ycrcb + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcb_subsample b/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcb_subsample new file mode 100644 index 00000000..da217a67 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcb_subsample @@ -0,0 +1,4 @@ +GL_SGIX_ycrcb_subsample +http://www.opengl.org/registry/specs/SGIX/ycrcb_subsample.txt +GL_SGIX_ycrcb_subsample + diff --git a/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcba b/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcba new file mode 100644 index 00000000..e32dccea --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGIX_ycrcba @@ -0,0 +1,6 @@ +GL_SGIX_ycrcba +http://www.opengl.org/registry/specs/SGIX/ycrcba.txt +GL_SGIX_ycrcba + + GL_YCRCB_SGIX 0x8318 + GL_YCRCBA_SGIX 0x8319 diff --git a/Windows/glew/auto/extensions/gl/GL_SGI_color_matrix b/Windows/glew/auto/extensions/gl/GL_SGI_color_matrix new file mode 100644 index 00000000..0b918493 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGI_color_matrix @@ -0,0 +1,15 @@ +GL_SGI_color_matrix +http://www.opengl.org/registry/specs/SGI/color_matrix.txt +GL_SGI_color_matrix + + GL_COLOR_MATRIX_SGI 0x80B1 + GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 + GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 + GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB diff --git a/Windows/glew/auto/extensions/gl/GL_SGI_color_table b/Windows/glew/auto/extensions/gl/GL_SGI_color_table new file mode 100644 index 00000000..7608fd00 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGI_color_table @@ -0,0 +1,27 @@ +GL_SGI_color_table +http://www.opengl.org/registry/specs/SGI/color_table.txt +GL_SGI_color_table + + GL_COLOR_TABLE_SGI 0x80D0 + GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 + GL_PROXY_COLOR_TABLE_SGI 0x80D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 + GL_COLOR_TABLE_SCALE_SGI 0x80D6 + GL_COLOR_TABLE_BIAS_SGI 0x80D7 + GL_COLOR_TABLE_FORMAT_SGI 0x80D8 + GL_COLOR_TABLE_WIDTH_SGI 0x80D9 + GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA + GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB + GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + void glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat* params) + void glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint* params) + void glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table) + void glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat* params) + void glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint* params) + void glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table) diff --git a/Windows/glew/auto/extensions/gl/GL_SGI_complex b/Windows/glew/auto/extensions/gl/GL_SGI_complex new file mode 100644 index 00000000..7d5e0d2e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGI_complex @@ -0,0 +1,4 @@ +GL_SGI_complex +http://www.opengl.org/registry/specs/SGI/complex.txt +GL_SGI_complex + diff --git a/Windows/glew/auto/extensions/gl/GL_SGI_complex_type b/Windows/glew/auto/extensions/gl/GL_SGI_complex_type new file mode 100644 index 00000000..cf8350bb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGI_complex_type @@ -0,0 +1,11 @@ +GL_SGI_complex_type +http://www.opengl.org/registry/specs/SGI/complex_type.txt +GL_SGI_complex_type + + GL_COMPLEX_UNSIGNED_BYTE_SGI 0x81BD + GL_COMPLEX_BYTE_SGI 0x81BE + GL_COMPLEX_UNSIGNED_SHORT_SGI 0x81BF + GL_COMPLEX_SHORT_SGI 0x81C0 + GL_COMPLEX_UNSIGNED_INT_SGI 0x81C1 + GL_COMPLEX_INT_SGI 0x81C2 + GL_COMPLEX_FLOAT_SGI 0x81C3 diff --git a/Windows/glew/auto/extensions/gl/GL_SGI_fft b/Windows/glew/auto/extensions/gl/GL_SGI_fft new file mode 100644 index 00000000..d8851b70 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGI_fft @@ -0,0 +1,16 @@ +GL_SGI_fft +http://www.opengl.org/registry/specs/SGI/fft.txt +GL_SGI_fft + + GL_PIXEL_TRANSFORM_OPERATOR_SGI 0x81C4 + GL_CONVOLUTION_SGI 0x81C5 + GL_FFT_1D_SGI 0x81C6 + GL_PIXEL_TRANSFORM_SGI 0x81C7 + GL_MAX_FFT_WIDTH_SGI 0x81C8 + void glGetPixelTransformParameterfvSGI (GLenum target, GLenum pname, GLfloat* params) + void glGetPixelTransformParameterivSGI (GLenum target, GLenum pname, GLint* params) + void glPixelTransformParameterfSGI (GLenum target, GLenum pname, GLfloat param) + void glPixelTransformParameterfvSGI (GLenum target, GLenum pname, const GLfloat* params) + void glPixelTransformParameteriSGI (GLenum target, GLenum pname, GLint param) + void glPixelTransformParameterivSGI (GLenum target, GLenum pname, const GLint* params) + void glPixelTransformSGI (GLenum target) diff --git a/Windows/glew/auto/extensions/gl/GL_SGI_texture_color_table b/Windows/glew/auto/extensions/gl/GL_SGI_texture_color_table new file mode 100644 index 00000000..72e23c4c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SGI_texture_color_table @@ -0,0 +1,6 @@ +GL_SGI_texture_color_table +http://www.opengl.org/registry/specs/SGI/texture_color_table.txt +GL_SGI_texture_color_table + + GL_TEXTURE_COLOR_TABLE_SGI 0x80BC + GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD diff --git a/Windows/glew/auto/extensions/gl/GL_SUNX_constant_data b/Windows/glew/auto/extensions/gl/GL_SUNX_constant_data new file mode 100644 index 00000000..3580b989 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUNX_constant_data @@ -0,0 +1,7 @@ +GL_SUNX_constant_data +http://www.opengl.org/registry/specs/SUNX/constant_data.txt +GL_SUNX_constant_data + + GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 + GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + void glFinishTextureSUNX (void) diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_convolution_border_modes b/Windows/glew/auto/extensions/gl/GL_SUN_convolution_border_modes new file mode 100644 index 00000000..55738d71 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_convolution_border_modes @@ -0,0 +1,5 @@ +GL_SUN_convolution_border_modes +http://www.opengl.org/registry/specs/SUN/convolution_border_modes.txt +GL_SUN_convolution_border_modes + + GL_WRAP_BORDER_SUN 0x81D4 diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_global_alpha b/Windows/glew/auto/extensions/gl/GL_SUN_global_alpha new file mode 100644 index 00000000..7baaf6fe --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_global_alpha @@ -0,0 +1,14 @@ +GL_SUN_global_alpha +http://www.opengl.org/registry/specs/SUN/global_alpha.txt +GL_SUN_global_alpha + + GL_GLOBAL_ALPHA_SUN 0x81D9 + GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + void glGlobalAlphaFactorbSUN (GLbyte factor) + void glGlobalAlphaFactordSUN (GLdouble factor) + void glGlobalAlphaFactorfSUN (GLfloat factor) + void glGlobalAlphaFactoriSUN (GLint factor) + void glGlobalAlphaFactorsSUN (GLshort factor) + void glGlobalAlphaFactorubSUN (GLubyte factor) + void glGlobalAlphaFactoruiSUN (GLuint factor) + void glGlobalAlphaFactorusSUN (GLushort factor) diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_mesh_array b/Windows/glew/auto/extensions/gl/GL_SUN_mesh_array new file mode 100644 index 00000000..6742d44d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_mesh_array @@ -0,0 +1,6 @@ +GL_SUN_mesh_array +http://www.opengl.org/registry/specs/SUN/mesh_array.txt +GL_SUN_mesh_array + + GL_QUAD_MESH_SUN 0x8614 + GL_TRIANGLE_MESH_SUN 0x8615 diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_read_video_pixels b/Windows/glew/auto/extensions/gl/GL_SUN_read_video_pixels new file mode 100644 index 00000000..871e6f93 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_read_video_pixels @@ -0,0 +1,5 @@ +GL_SUN_read_video_pixels +http://wwws.sun.com/software/graphics/opengl/extensions/gl_sun_read_video_pixels.txt +GL_SUN_read_video_pixels + + void glReadVideoPixelsSUN (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_slice_accum b/Windows/glew/auto/extensions/gl/GL_SUN_slice_accum new file mode 100644 index 00000000..b018f4c3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_slice_accum @@ -0,0 +1,5 @@ +GL_SUN_slice_accum +http://www.opengl.org/registry/specs/SUN/slice_accum.txt +GL_SUN_slice_accum + + GL_SLICE_ACCUM_SUN 0x85CC diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_triangle_list b/Windows/glew/auto/extensions/gl/GL_SUN_triangle_list new file mode 100644 index 00000000..bbdf7fe9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_triangle_list @@ -0,0 +1,28 @@ +GL_SUN_triangle_list +http://www.opengl.org/registry/specs/SUN/triangle_list.txt +GL_SUN_triangle_list + + GL_RESTART_SUN 0x01 + GL_REPLACE_MIDDLE_SUN 0x02 + GL_REPLACE_OLDEST_SUN 0x03 + GL_TRIANGLE_LIST_SUN 0x81D7 + GL_REPLACEMENT_CODE_SUN 0x81D8 + GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 + GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 + GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 + GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 + GL_R1UI_V3F_SUN 0x85C4 + GL_R1UI_C4UB_V3F_SUN 0x85C5 + GL_R1UI_C3F_V3F_SUN 0x85C6 + GL_R1UI_N3F_V3F_SUN 0x85C7 + GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 + GL_R1UI_T2F_V3F_SUN 0x85C9 + GL_R1UI_T2F_N3F_V3F_SUN 0x85CA + GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + void glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void *pointer) + void glReplacementCodeubSUN (GLubyte code) + void glReplacementCodeubvSUN (const GLubyte* code) + void glReplacementCodeuiSUN (GLuint code) + void glReplacementCodeuivSUN (const GLuint* code) + void glReplacementCodeusSUN (GLushort code) + void glReplacementCodeusvSUN (const GLushort* code) diff --git a/Windows/glew/auto/extensions/gl/GL_SUN_vertex b/Windows/glew/auto/extensions/gl/GL_SUN_vertex new file mode 100644 index 00000000..1ecc632d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_SUN_vertex @@ -0,0 +1,44 @@ +GL_SUN_vertex +http://www.opengl.org/registry/specs/SUN/vertex.txt +GL_SUN_vertex + + void glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) + void glColor3fVertex3fvSUN (const GLfloat* c, const GLfloat *v) + void glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glColor4fNormal3fVertex3fvSUN (const GLfloat* c, const GLfloat *n, const GLfloat *v) + void glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y) + void glColor4ubVertex2fvSUN (const GLubyte* c, const GLfloat *v) + void glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) + void glColor4ubVertex3fvSUN (const GLubyte* c, const GLfloat *v) + void glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glNormal3fVertex3fvSUN (const GLfloat* n, const GLfloat *v) + void glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiColor3fVertex3fvSUN (const GLuint* rc, const GLfloat *c, const GLfloat *v) + void glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint* rc, const GLubyte *c, const GLfloat *v) + void glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint* rc, const GLfloat *tc, const GLfloat *v) + void glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiVertex3fvSUN (const GLuint* rc, const GLfloat *v) + void glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fColor3fVertex3fvSUN (const GLfloat* tc, const GLfloat *c, const GLfloat *v) + void glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fColor4ubVertex3fvSUN (const GLfloat* tc, const GLubyte *c, const GLfloat *v) + void glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fNormal3fVertex3fvSUN (const GLfloat* tc, const GLfloat *n, const GLfloat *v) + void glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fVertex3fvSUN (const GLfloat* tc, const GLfloat *v) + void glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glTexCoord4fVertex4fvSUN (const GLfloat* tc, const GLfloat *v) diff --git a/Windows/glew/auto/extensions/gl/GL_WIN_phong_shading b/Windows/glew/auto/extensions/gl/GL_WIN_phong_shading new file mode 100644 index 00000000..26eb4cd4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_WIN_phong_shading @@ -0,0 +1,6 @@ +GL_WIN_phong_shading +http://www.opengl.org/registry/specs/WIN/phong_shading.txt +GL_WIN_phong_shading + + GL_PHONG_WIN 0x80EA + GL_PHONG_HINT_WIN 0x80EB diff --git a/Windows/glew/auto/extensions/gl/GL_WIN_scene_markerXXX b/Windows/glew/auto/extensions/gl/GL_WIN_scene_markerXXX new file mode 100644 index 00000000..9e9e8ea9 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_WIN_scene_markerXXX @@ -0,0 +1,4 @@ +GL_WIN_scene_markerXXX +http://www.opengl.org/registry/specs/WIN/scene_markerXXX.txt +GL_WIN_scene_markerXXX + diff --git a/Windows/glew/auto/extensions/gl/GL_WIN_specular_fog b/Windows/glew/auto/extensions/gl/GL_WIN_specular_fog new file mode 100644 index 00000000..8fae5a0d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_WIN_specular_fog @@ -0,0 +1,5 @@ +GL_WIN_specular_fog +http://www.opengl.org/registry/specs/WIN/specular_fog.txt +GL_WIN_specular_fog + + GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC diff --git a/Windows/glew/auto/extensions/gl/GL_WIN_swap_hint b/Windows/glew/auto/extensions/gl/GL_WIN_swap_hint new file mode 100644 index 00000000..9bb490b4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/GL_WIN_swap_hint @@ -0,0 +1,5 @@ +GL_WIN_swap_hint +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_16zy.asp +GL_WIN_swap_hint + + void glAddSwapHintRectWIN (GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/Windows/glew/auto/extensions/gl/WGL_3DFX_multisample b/Windows/glew/auto/extensions/gl/WGL_3DFX_multisample new file mode 100644 index 00000000..09d12b12 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_3DFX_multisample @@ -0,0 +1,6 @@ +WGL_3DFX_multisample +http://www.opengl.org/registry/specs/3DFX/multisample.txt +WGL_3DFX_multisample + + WGL_SAMPLE_BUFFERS_3DFX 0x2060 + WGL_SAMPLES_3DFX 0x2061 diff --git a/Windows/glew/auto/extensions/gl/WGL_3DL_stereo_control b/Windows/glew/auto/extensions/gl/WGL_3DL_stereo_control new file mode 100644 index 00000000..d0c8a58d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_3DL_stereo_control @@ -0,0 +1,9 @@ +WGL_3DL_stereo_control +http://www.opengl.org/registry/specs/3DL/stereo_control.txt +WGL_3DL_stereo_control + + WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 + WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 + WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 + WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + BOOL wglSetStereoEmitterState3DL (HDC hDC, UINT uState) diff --git a/Windows/glew/auto/extensions/gl/WGL_AMD_gpu_association b/Windows/glew/auto/extensions/gl/WGL_AMD_gpu_association new file mode 100644 index 00000000..02a9ab13 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_AMD_gpu_association @@ -0,0 +1,23 @@ +WGL_AMD_gpu_association +http://www.opengl.org/registry/specs/AMD/wgl_gpu_association.txt +WGL_AMD_gpu_association + + WGL_GPU_VENDOR_AMD 0x1F00 + WGL_GPU_RENDERER_STRING_AMD 0x1F01 + WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 + WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 + WGL_GPU_RAM_AMD 0x21A3 + WGL_GPU_CLOCK_AMD 0x21A4 + WGL_GPU_NUM_PIPES_AMD 0x21A5 + WGL_GPU_NUM_SIMD_AMD 0x21A6 + WGL_GPU_NUM_RB_AMD 0x21A7 + WGL_GPU_NUM_SPI_AMD 0x21A8 + VOID wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + HGLRC wglCreateAssociatedContextAMD (UINT id) + HGLRC wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int* attribList) + BOOL wglDeleteAssociatedContextAMD (HGLRC hglrc) + UINT wglGetContextGPUIDAMD (HGLRC hglrc) + HGLRC wglGetCurrentAssociatedContextAMD (void) + UINT wglGetGPUIDsAMD (UINT maxCount, UINT* ids) + INT wglGetGPUInfoAMD (UINT id, INT property, GLenum dataType, UINT size, void* data) + BOOL wglMakeAssociatedContextCurrentAMD (HGLRC hglrc) diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_buffer_region b/Windows/glew/auto/extensions/gl/WGL_ARB_buffer_region new file mode 100644 index 00000000..a38e5f3e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_buffer_region @@ -0,0 +1,12 @@ +WGL_ARB_buffer_region +http://www.opengl.org/registry/specs/ARB/wgl_buffer_region.txt +WGL_ARB_buffer_region + + WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 + WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 + WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 + WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + HANDLE wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType) + VOID wglDeleteBufferRegionARB (HANDLE hRegion) + BOOL wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc) + BOOL wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height) diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_context_flush_control b/Windows/glew/auto/extensions/gl/WGL_ARB_context_flush_control new file mode 100644 index 00000000..32259fb2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_context_flush_control @@ -0,0 +1,4 @@ +WGL_ARB_context_flush_control +http://www.opengl.org/registry/specs/KHR/context_flush_control.txt +WGL_ARB_context_flush_control + diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_create_context b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context new file mode 100644 index 00000000..7e7c163d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context @@ -0,0 +1,13 @@ +WGL_ARB_create_context +http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt +WGL_ARB_create_context + + WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 + WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 + WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 + WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 + WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 + WGL_CONTEXT_FLAGS_ARB 0x2094 + ERROR_INVALID_VERSION_ARB 0x2095 + ERROR_INVALID_PROFILE_ARB 0x2096 + HGLRC wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int* attribList) diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_no_error b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_no_error new file mode 100644 index 00000000..09d9a3f6 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_no_error @@ -0,0 +1,4 @@ +WGL_ARB_create_context_no_error +http://www.opengl.org/registry/specs/ARB/create_context_no_error.txt +WGL_ARB_create_context_no_error + diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_profile b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_profile new file mode 100644 index 00000000..88b316c2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_profile @@ -0,0 +1,7 @@ +WGL_ARB_create_context_profile +http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt +WGL_ARB_create_context_profile + + WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 + WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 + WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_robustness b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_robustness new file mode 100644 index 00000000..b6a6dd60 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_create_context_robustness @@ -0,0 +1,8 @@ +WGL_ARB_create_context_robustness +http://www.opengl.org/registry/specs/ARB/wgl_create_context_robustness.txt +WGL_ARB_create_context_robustness + + WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 + WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + WGL_NO_RESET_NOTIFICATION_ARB 0x8261 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_extensions_string b/Windows/glew/auto/extensions/gl/WGL_ARB_extensions_string new file mode 100644 index 00000000..774a331a --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_extensions_string @@ -0,0 +1,5 @@ +WGL_ARB_extensions_string +http://www.opengl.org/registry/specs/ARB/wgl_extensions_string.txt +WGL_ARB_extensions_string + + const char* wglGetExtensionsStringARB (HDC hdc) diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_framebuffer_sRGB b/Windows/glew/auto/extensions/gl/WGL_ARB_framebuffer_sRGB new file mode 100644 index 00000000..6060aafb --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_framebuffer_sRGB @@ -0,0 +1,5 @@ +WGL_ARB_framebuffer_sRGB +http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt +WGL_ARB_framebuffer_sRGB + + WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_make_current_read b/Windows/glew/auto/extensions/gl/WGL_ARB_make_current_read new file mode 100644 index 00000000..2a291f20 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_make_current_read @@ -0,0 +1,8 @@ +WGL_ARB_make_current_read +http://www.opengl.org/registry/specs/ARB/wgl_make_current_read.txt +WGL_ARB_make_current_read + + HDC wglGetCurrentReadDCARB (VOID) + BOOL wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc) + ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 + ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_multisample b/Windows/glew/auto/extensions/gl/WGL_ARB_multisample new file mode 100644 index 00000000..6b57d1a5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_multisample @@ -0,0 +1,6 @@ +WGL_ARB_multisample +http://www.opengl.org/registry/specs/ARB/multisample.txt +WGL_ARB_multisample + + WGL_SAMPLE_BUFFERS_ARB 0x2041 + WGL_SAMPLES_ARB 0x2042 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_pbuffer b/Windows/glew/auto/extensions/gl/WGL_ARB_pbuffer new file mode 100644 index 00000000..5eea1da0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_pbuffer @@ -0,0 +1,18 @@ +WGL_ARB_pbuffer +http://www.opengl.org/registry/specs/ARB/wgl_pbuffer.txt +WGL_ARB_pbuffer + + WGL_DRAW_TO_PBUFFER_ARB 0x202D + WGL_MAX_PBUFFER_PIXELS_ARB 0x202E + WGL_MAX_PBUFFER_WIDTH_ARB 0x202F + WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 + WGL_PBUFFER_LARGEST_ARB 0x2033 + WGL_PBUFFER_WIDTH_ARB 0x2034 + WGL_PBUFFER_HEIGHT_ARB 0x2035 + WGL_PBUFFER_LOST_ARB 0x2036 + HPBUFFERARB wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList) + BOOL wglDestroyPbufferARB (HPBUFFERARB hPbuffer) + HDC wglGetPbufferDCARB (HPBUFFERARB hPbuffer) + BOOL wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int* piValue) + int wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC) + DECLARE_HANDLE(HPBUFFERARB); diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_pixel_format b/Windows/glew/auto/extensions/gl/WGL_ARB_pixel_format new file mode 100644 index 00000000..2028e588 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_pixel_format @@ -0,0 +1,56 @@ +WGL_ARB_pixel_format +http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt +WGL_ARB_pixel_format + + WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 + WGL_DRAW_TO_WINDOW_ARB 0x2001 + WGL_DRAW_TO_BITMAP_ARB 0x2002 + WGL_ACCELERATION_ARB 0x2003 + WGL_NEED_PALETTE_ARB 0x2004 + WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 + WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 + WGL_SWAP_METHOD_ARB 0x2007 + WGL_NUMBER_OVERLAYS_ARB 0x2008 + WGL_NUMBER_UNDERLAYS_ARB 0x2009 + WGL_TRANSPARENT_ARB 0x200A + WGL_SHARE_DEPTH_ARB 0x200C + WGL_SHARE_STENCIL_ARB 0x200D + WGL_SHARE_ACCUM_ARB 0x200E + WGL_SUPPORT_GDI_ARB 0x200F + WGL_SUPPORT_OPENGL_ARB 0x2010 + WGL_DOUBLE_BUFFER_ARB 0x2011 + WGL_STEREO_ARB 0x2012 + WGL_PIXEL_TYPE_ARB 0x2013 + WGL_COLOR_BITS_ARB 0x2014 + WGL_RED_BITS_ARB 0x2015 + WGL_RED_SHIFT_ARB 0x2016 + WGL_GREEN_BITS_ARB 0x2017 + WGL_GREEN_SHIFT_ARB 0x2018 + WGL_BLUE_BITS_ARB 0x2019 + WGL_BLUE_SHIFT_ARB 0x201A + WGL_ALPHA_BITS_ARB 0x201B + WGL_ALPHA_SHIFT_ARB 0x201C + WGL_ACCUM_BITS_ARB 0x201D + WGL_ACCUM_RED_BITS_ARB 0x201E + WGL_ACCUM_GREEN_BITS_ARB 0x201F + WGL_ACCUM_BLUE_BITS_ARB 0x2020 + WGL_ACCUM_ALPHA_BITS_ARB 0x2021 + WGL_DEPTH_BITS_ARB 0x2022 + WGL_STENCIL_BITS_ARB 0x2023 + WGL_AUX_BUFFERS_ARB 0x2024 + WGL_NO_ACCELERATION_ARB 0x2025 + WGL_GENERIC_ACCELERATION_ARB 0x2026 + WGL_FULL_ACCELERATION_ARB 0x2027 + WGL_SWAP_EXCHANGE_ARB 0x2028 + WGL_SWAP_COPY_ARB 0x2029 + WGL_SWAP_UNDEFINED_ARB 0x202A + WGL_TYPE_RGBA_ARB 0x202B + WGL_TYPE_COLORINDEX_ARB 0x202C + WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 + WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 + WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 + WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A + WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + BOOL wglChoosePixelFormatARB (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats) + BOOL wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues) + BOOL wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues) diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_pixel_format_float b/Windows/glew/auto/extensions/gl/WGL_ARB_pixel_format_float new file mode 100644 index 00000000..50c09a29 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_pixel_format_float @@ -0,0 +1,5 @@ +WGL_ARB_pixel_format_float +http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt +WGL_ARB_pixel_format_float + + WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_render_texture b/Windows/glew/auto/extensions/gl/WGL_ARB_render_texture new file mode 100644 index 00000000..3ff3a70f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_render_texture @@ -0,0 +1,40 @@ +WGL_ARB_render_texture +http://www.opengl.org/registry/specs/ARB/wgl_render_texture.txt +WGL_ARB_render_texture + + WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 + WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 + WGL_TEXTURE_FORMAT_ARB 0x2072 + WGL_TEXTURE_TARGET_ARB 0x2073 + WGL_MIPMAP_TEXTURE_ARB 0x2074 + WGL_TEXTURE_RGB_ARB 0x2075 + WGL_TEXTURE_RGBA_ARB 0x2076 + WGL_NO_TEXTURE_ARB 0x2077 + WGL_TEXTURE_CUBE_MAP_ARB 0x2078 + WGL_TEXTURE_1D_ARB 0x2079 + WGL_TEXTURE_2D_ARB 0x207A + WGL_MIPMAP_LEVEL_ARB 0x207B + WGL_CUBE_MAP_FACE_ARB 0x207C + WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D + WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E + WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 + WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 + WGL_FRONT_LEFT_ARB 0x2083 + WGL_FRONT_RIGHT_ARB 0x2084 + WGL_BACK_LEFT_ARB 0x2085 + WGL_BACK_RIGHT_ARB 0x2086 + WGL_AUX0_ARB 0x2087 + WGL_AUX1_ARB 0x2088 + WGL_AUX2_ARB 0x2089 + WGL_AUX3_ARB 0x208A + WGL_AUX4_ARB 0x208B + WGL_AUX5_ARB 0x208C + WGL_AUX6_ARB 0x208D + WGL_AUX7_ARB 0x208E + WGL_AUX8_ARB 0x208F + WGL_AUX9_ARB 0x2090 + BOOL wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) + BOOL wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) + BOOL wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int* piAttribList) diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_robustness_application_isolation b/Windows/glew/auto/extensions/gl/WGL_ARB_robustness_application_isolation new file mode 100644 index 00000000..1e917667 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_robustness_application_isolation @@ -0,0 +1,5 @@ +WGL_ARB_robustness_application_isolation +http://www.opengl.org/registry/specs/ARB/wgl_robustness_isolation.txt +WGL_ARB_robustness_application_isolation + + WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 diff --git a/Windows/glew/auto/extensions/gl/WGL_ARB_robustness_share_group_isolation b/Windows/glew/auto/extensions/gl/WGL_ARB_robustness_share_group_isolation new file mode 100644 index 00000000..145f0202 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ARB_robustness_share_group_isolation @@ -0,0 +1,5 @@ +WGL_ARB_robustness_share_group_isolation +http://www.opengl.org/registry/specs/ARB/wgl_robustness_isolation.txt +WGL_ARB_robustness_share_group_isolation + + WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 diff --git a/Windows/glew/auto/extensions/gl/WGL_ATI_pixel_format_float b/Windows/glew/auto/extensions/gl/WGL_ATI_pixel_format_float new file mode 100644 index 00000000..d4e6e204 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ATI_pixel_format_float @@ -0,0 +1,7 @@ +WGL_ATI_pixel_format_float +http://www.opengl.org/registry/specs/ATI/pixel_format_float.txt +WGL_ATI_pixel_format_float + + WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 + GL_RGBA_FLOAT_MODE_ATI 0x8820 + GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 diff --git a/Windows/glew/auto/extensions/gl/WGL_ATI_render_texture_rectangle b/Windows/glew/auto/extensions/gl/WGL_ATI_render_texture_rectangle new file mode 100644 index 00000000..aba7be14 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_ATI_render_texture_rectangle @@ -0,0 +1,5 @@ +WGL_ATI_render_texture_rectangle + +WGL_ATI_render_texture_rectangle + + WGL_TEXTURE_RECTANGLE_ATI 0x21A5 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_colorspace b/Windows/glew/auto/extensions/gl/WGL_EXT_colorspace new file mode 100644 index 00000000..db84fe7c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_colorspace @@ -0,0 +1,7 @@ +WGL_EXT_colorspace +http://www.opengl.org/registry/specs/EXT/wgl_colorspace.txt +WGL_EXT_colorspace + + WGL_COLORSPACE_SRGB_EXT 0x3089 + WGL_COLORSPACE_LINEAR_EXT 0x308A + WGL_COLORSPACE_EXT 0x309D diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_create_context_es2_profile b/Windows/glew/auto/extensions/gl/WGL_EXT_create_context_es2_profile new file mode 100644 index 00000000..3105737e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_create_context_es2_profile @@ -0,0 +1,5 @@ +WGL_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es2_profile.txt +WGL_EXT_create_context_es2_profile + + WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_create_context_es_profile b/Windows/glew/auto/extensions/gl/WGL_EXT_create_context_es_profile new file mode 100644 index 00000000..5c7ce7e1 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_create_context_es_profile @@ -0,0 +1,5 @@ +WGL_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es_profile.txt +WGL_EXT_create_context_es_profile + + WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_depth_float b/Windows/glew/auto/extensions/gl/WGL_EXT_depth_float new file mode 100644 index 00000000..65c414a0 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_depth_float @@ -0,0 +1,5 @@ +WGL_EXT_depth_float +http://www.opengl.org/registry/specs/EXT/wgl_depth_float.txt +WGL_EXT_depth_float + + WGL_DEPTH_FLOAT_EXT 0x2040 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_display_color_table b/Windows/glew/auto/extensions/gl/WGL_EXT_display_color_table new file mode 100644 index 00000000..27faf764 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_display_color_table @@ -0,0 +1,8 @@ +WGL_EXT_display_color_table +http://www.opengl.org/registry/specs/EXT/wgl_display_color_table.txt +WGL_EXT_display_color_table + + GLboolean wglBindDisplayColorTableEXT (GLushort id) + GLboolean wglCreateDisplayColorTableEXT (GLushort id) + void wglDestroyDisplayColorTableEXT (GLushort id) + GLboolean wglLoadDisplayColorTableEXT (GLushort* table, GLuint length) diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_extensions_string b/Windows/glew/auto/extensions/gl/WGL_EXT_extensions_string new file mode 100644 index 00000000..d7ac7a3c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_extensions_string @@ -0,0 +1,5 @@ +WGL_EXT_extensions_string +http://www.opengl.org/registry/specs/EXT/wgl_extensions_string.txt +WGL_EXT_extensions_string + + const char* wglGetExtensionsStringEXT (void) diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_framebuffer_sRGB b/Windows/glew/auto/extensions/gl/WGL_EXT_framebuffer_sRGB new file mode 100644 index 00000000..5f2f5b86 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_framebuffer_sRGB @@ -0,0 +1,5 @@ +WGL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +WGL_EXT_framebuffer_sRGB + + WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_make_current_read b/Windows/glew/auto/extensions/gl/WGL_EXT_make_current_read new file mode 100644 index 00000000..2e4b2691 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_make_current_read @@ -0,0 +1,7 @@ +WGL_EXT_make_current_read +http://www.opengl.org/registry/specs/EXT/wgl_make_current_read.txt +WGL_EXT_make_current_read + + HDC wglGetCurrentReadDCEXT (VOID) + BOOL wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc) + ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_multisample b/Windows/glew/auto/extensions/gl/WGL_EXT_multisample new file mode 100644 index 00000000..ea8eab6f --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_multisample @@ -0,0 +1,6 @@ +WGL_EXT_multisample +http://www.opengl.org/registry/specs/EXT/wgl_multisample.txt +WGL_EXT_multisample + + WGL_SAMPLE_BUFFERS_EXT 0x2041 + WGL_SAMPLES_EXT 0x2042 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_pbuffer b/Windows/glew/auto/extensions/gl/WGL_EXT_pbuffer new file mode 100644 index 00000000..83940f6e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_pbuffer @@ -0,0 +1,19 @@ +WGL_EXT_pbuffer +http://www.opengl.org/registry/specs/EXT/wgl_pbuffer.txt +WGL_EXT_pbuffer + + WGL_DRAW_TO_PBUFFER_EXT 0x202D + WGL_MAX_PBUFFER_PIXELS_EXT 0x202E + WGL_MAX_PBUFFER_WIDTH_EXT 0x202F + WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 + WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 + WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 + WGL_PBUFFER_LARGEST_EXT 0x2033 + WGL_PBUFFER_WIDTH_EXT 0x2034 + WGL_PBUFFER_HEIGHT_EXT 0x2035 + HPBUFFEREXT wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList) + BOOL wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer) + HDC wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer) + BOOL wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue) + int wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC) + DECLARE_HANDLE(HPBUFFEREXT); diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_pixel_format b/Windows/glew/auto/extensions/gl/WGL_EXT_pixel_format new file mode 100644 index 00000000..82ac2eea --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_pixel_format @@ -0,0 +1,52 @@ +WGL_EXT_pixel_format +http://www.opengl.org/registry/specs/EXT/wgl_pixel_format.txt +WGL_EXT_pixel_format + + WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 + WGL_DRAW_TO_WINDOW_EXT 0x2001 + WGL_DRAW_TO_BITMAP_EXT 0x2002 + WGL_ACCELERATION_EXT 0x2003 + WGL_NEED_PALETTE_EXT 0x2004 + WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 + WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 + WGL_SWAP_METHOD_EXT 0x2007 + WGL_NUMBER_OVERLAYS_EXT 0x2008 + WGL_NUMBER_UNDERLAYS_EXT 0x2009 + WGL_TRANSPARENT_EXT 0x200A + WGL_TRANSPARENT_VALUE_EXT 0x200B + WGL_SHARE_DEPTH_EXT 0x200C + WGL_SHARE_STENCIL_EXT 0x200D + WGL_SHARE_ACCUM_EXT 0x200E + WGL_SUPPORT_GDI_EXT 0x200F + WGL_SUPPORT_OPENGL_EXT 0x2010 + WGL_DOUBLE_BUFFER_EXT 0x2011 + WGL_STEREO_EXT 0x2012 + WGL_PIXEL_TYPE_EXT 0x2013 + WGL_COLOR_BITS_EXT 0x2014 + WGL_RED_BITS_EXT 0x2015 + WGL_RED_SHIFT_EXT 0x2016 + WGL_GREEN_BITS_EXT 0x2017 + WGL_GREEN_SHIFT_EXT 0x2018 + WGL_BLUE_BITS_EXT 0x2019 + WGL_BLUE_SHIFT_EXT 0x201A + WGL_ALPHA_BITS_EXT 0x201B + WGL_ALPHA_SHIFT_EXT 0x201C + WGL_ACCUM_BITS_EXT 0x201D + WGL_ACCUM_RED_BITS_EXT 0x201E + WGL_ACCUM_GREEN_BITS_EXT 0x201F + WGL_ACCUM_BLUE_BITS_EXT 0x2020 + WGL_ACCUM_ALPHA_BITS_EXT 0x2021 + WGL_DEPTH_BITS_EXT 0x2022 + WGL_STENCIL_BITS_EXT 0x2023 + WGL_AUX_BUFFERS_EXT 0x2024 + WGL_NO_ACCELERATION_EXT 0x2025 + WGL_GENERIC_ACCELERATION_EXT 0x2026 + WGL_FULL_ACCELERATION_EXT 0x2027 + WGL_SWAP_EXCHANGE_EXT 0x2028 + WGL_SWAP_COPY_EXT 0x2029 + WGL_SWAP_UNDEFINED_EXT 0x202A + WGL_TYPE_RGBA_EXT 0x202B + WGL_TYPE_COLORINDEX_EXT 0x202C + BOOL wglChoosePixelFormatEXT (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats) + BOOL wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues) + BOOL wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues) diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_pixel_format_packed_float b/Windows/glew/auto/extensions/gl/WGL_EXT_pixel_format_packed_float new file mode 100644 index 00000000..662a993b --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_pixel_format_packed_float @@ -0,0 +1,5 @@ +WGL_EXT_pixel_format_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +WGL_EXT_pixel_format_packed_float + + WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_swap_control b/Windows/glew/auto/extensions/gl/WGL_EXT_swap_control new file mode 100644 index 00000000..240c1d90 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_swap_control @@ -0,0 +1,6 @@ +WGL_EXT_swap_control +http://www.opengl.org/registry/specs/EXT/wgl_swap_control.txt +WGL_EXT_swap_control + + int wglGetSwapIntervalEXT (void) + BOOL wglSwapIntervalEXT (int interval) diff --git a/Windows/glew/auto/extensions/gl/WGL_EXT_swap_control_tear b/Windows/glew/auto/extensions/gl/WGL_EXT_swap_control_tear new file mode 100644 index 00000000..bd8bde9d --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_EXT_swap_control_tear @@ -0,0 +1,4 @@ +WGL_EXT_swap_control_tear +http://www.opengl.org/registry/specs/EXT/wgl_swap_control_tear.txt +WGL_EXT_swap_control_tear + diff --git a/Windows/glew/auto/extensions/gl/WGL_I3D_digital_video_control b/Windows/glew/auto/extensions/gl/WGL_I3D_digital_video_control new file mode 100644 index 00000000..6badab88 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_I3D_digital_video_control @@ -0,0 +1,10 @@ +WGL_I3D_digital_video_control +http://www.opengl.org/registry/specs/I3D/wgl_digital_video_control.txt +WGL_I3D_digital_video_control + + WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 + WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 + WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 + WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + BOOL wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int* piValue) + BOOL wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int* piValue) diff --git a/Windows/glew/auto/extensions/gl/WGL_I3D_gamma b/Windows/glew/auto/extensions/gl/WGL_I3D_gamma new file mode 100644 index 00000000..af951a72 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_I3D_gamma @@ -0,0 +1,10 @@ +WGL_I3D_gamma +http://www.opengl.org/registry/specs/I3D/wgl_gamma.txt +WGL_I3D_gamma + + WGL_GAMMA_TABLE_SIZE_I3D 0x204E + WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + BOOL wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue) + BOOL wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int* piValue) + BOOL wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue) + BOOL wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int* piValue) diff --git a/Windows/glew/auto/extensions/gl/WGL_I3D_genlock b/Windows/glew/auto/extensions/gl/WGL_I3D_genlock new file mode 100644 index 00000000..e1bc0d5c --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_I3D_genlock @@ -0,0 +1,25 @@ +WGL_I3D_genlock +http://www.opengl.org/registry/specs/I3D/wgl_genlock.txt +WGL_I3D_genlock + + WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 + WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 + WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 + WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 + WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 + WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 + WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A + WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B + WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + BOOL wglDisableGenlockI3D (HDC hDC) + BOOL wglEnableGenlockI3D (HDC hDC) + BOOL wglGenlockSampleRateI3D (HDC hDC, UINT uRate) + BOOL wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay) + BOOL wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge) + BOOL wglGenlockSourceI3D (HDC hDC, UINT uSource) + BOOL wglGetGenlockSampleRateI3D (HDC hDC, UINT* uRate) + BOOL wglGetGenlockSourceDelayI3D (HDC hDC, UINT* uDelay) + BOOL wglGetGenlockSourceEdgeI3D (HDC hDC, UINT* uEdge) + BOOL wglGetGenlockSourceI3D (HDC hDC, UINT* uSource) + BOOL wglIsEnabledGenlockI3D (HDC hDC, BOOL* pFlag) + BOOL wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay) diff --git a/Windows/glew/auto/extensions/gl/WGL_I3D_image_buffer b/Windows/glew/auto/extensions/gl/WGL_I3D_image_buffer new file mode 100644 index 00000000..cb65fec5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_I3D_image_buffer @@ -0,0 +1,10 @@ +WGL_I3D_image_buffer +http://www.opengl.org/registry/specs/I3D/wgl_image_buffer.txt +WGL_I3D_image_buffer + + WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 + WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + BOOL wglAssociateImageBufferEventsI3D (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count) + LPVOID wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags) + BOOL wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress) + BOOL wglReleaseImageBufferEventsI3D (HDC hdc, LPVOID* pAddress, UINT count) diff --git a/Windows/glew/auto/extensions/gl/WGL_I3D_swap_frame_lock b/Windows/glew/auto/extensions/gl/WGL_I3D_swap_frame_lock new file mode 100644 index 00000000..e5980a67 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_I3D_swap_frame_lock @@ -0,0 +1,8 @@ +WGL_I3D_swap_frame_lock +http://www.opengl.org/registry/specs/I3D/wgl_swap_frame_lock.txt +WGL_I3D_swap_frame_lock + + BOOL wglDisableFrameLockI3D (VOID) + BOOL wglEnableFrameLockI3D (VOID) + BOOL wglIsEnabledFrameLockI3D (BOOL* pFlag) + BOOL wglQueryFrameLockMasterI3D (BOOL* pFlag) diff --git a/Windows/glew/auto/extensions/gl/WGL_I3D_swap_frame_usage b/Windows/glew/auto/extensions/gl/WGL_I3D_swap_frame_usage new file mode 100644 index 00000000..e8f21f68 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_I3D_swap_frame_usage @@ -0,0 +1,8 @@ +WGL_I3D_swap_frame_usage +http://www.opengl.org/registry/specs/I3D/wgl_swap_frame_usage.txt +WGL_I3D_swap_frame_usage + + BOOL wglBeginFrameTrackingI3D (void) + BOOL wglEndFrameTrackingI3D (void) + BOOL wglGetFrameUsageI3D (float* pUsage) + BOOL wglQueryFrameTrackingI3D (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage) diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_DX_interop b/Windows/glew/auto/extensions/gl/WGL_NV_DX_interop new file mode 100644 index 00000000..0cde47f5 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_DX_interop @@ -0,0 +1,15 @@ +WGL_NV_DX_interop +http://www.opengl.org/registry/specs/NV/DX_interop.txt +WGL_NV_DX_interop + + WGL_ACCESS_READ_ONLY_NV 0x0000 + WGL_ACCESS_READ_WRITE_NV 0x0001 + WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + BOOL wglDXCloseDeviceNV (HANDLE hDevice) + BOOL wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE* hObjects) + BOOL wglDXObjectAccessNV (HANDLE hObject, GLenum access) + HANDLE wglDXOpenDeviceNV (void* dxDevice) + HANDLE wglDXRegisterObjectNV (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access) + BOOL wglDXSetResourceShareHandleNV (void* dxObject, HANDLE shareHandle) + BOOL wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE* hObjects) + BOOL wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject) diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_DX_interop2 b/Windows/glew/auto/extensions/gl/WGL_NV_DX_interop2 new file mode 100644 index 00000000..50cde4c3 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_DX_interop2 @@ -0,0 +1,4 @@ +WGL_NV_DX_interop2 +http://www.opengl.org/registry/specs/NV/DX_interop2.txt +WGL_NV_DX_interop2 + diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_copy_image b/Windows/glew/auto/extensions/gl/WGL_NV_copy_image new file mode 100644 index 00000000..50fdff4e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_copy_image @@ -0,0 +1,5 @@ +WGL_NV_copy_image +http://www.opengl.org/registry/specs/NV/copy_image.txt +WGL_NV_copy_image + + BOOL wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_delay_before_swap b/Windows/glew/auto/extensions/gl/WGL_NV_delay_before_swap new file mode 100644 index 00000000..146047fd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_delay_before_swap @@ -0,0 +1,5 @@ +WGL_NV_delay_before_swap +http://www.opengl.org/registry/specs/NV/wgl_delay_before_swap.txt +WGL_NV_delay_before_swap + + BOOL wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds) diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_float_buffer b/Windows/glew/auto/extensions/gl/WGL_NV_float_buffer new file mode 100644 index 00000000..bf0e69af --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_float_buffer @@ -0,0 +1,13 @@ +WGL_NV_float_buffer +http://www.opengl.org/registry/specs/NV/float_buffer.txt +WGL_NV_float_buffer + + WGL_FLOAT_COMPONENTS_NV 0x20B0 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 + WGL_TEXTURE_FLOAT_R_NV 0x20B5 + WGL_TEXTURE_FLOAT_RG_NV 0x20B6 + WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 + WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_gpu_affinity b/Windows/glew/auto/extensions/gl/WGL_NV_gpu_affinity new file mode 100644 index 00000000..61ed3f1e --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_gpu_affinity @@ -0,0 +1,13 @@ +WGL_NV_gpu_affinity +http://developer.download.nvidia.com/opengl/specs/WGL_nv_gpu_affinity.txt +WGL_NV_gpu_affinity + + WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 + WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + BOOL wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu) + BOOL wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice) + HDC wglCreateAffinityDCNV (const HGPUNV *phGpuList) + BOOL wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu) + BOOL wglDeleteDCNV (HDC hdc) + DECLARE_HANDLE(HGPUNV); + typedef struct _GPU_DEVICE { DWORD cb; CHAR DeviceName[32]; CHAR DeviceString[128]; DWORD Flags; RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_multisample_coverage b/Windows/glew/auto/extensions/gl/WGL_NV_multisample_coverage new file mode 100644 index 00000000..0af430c4 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_multisample_coverage @@ -0,0 +1,6 @@ +WGL_NV_multisample_coverage +http://www.opengl.org/registry/specs/NV/multisample_coverage.txt +WGL_NV_multisample_coverage + + WGL_COVERAGE_SAMPLES_NV 0x2042 + WGL_COLOR_SAMPLES_NV 0x20B9 diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_present_video b/Windows/glew/auto/extensions/gl/WGL_NV_present_video new file mode 100644 index 00000000..ccb0da30 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_present_video @@ -0,0 +1,9 @@ +WGL_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +WGL_NV_present_video + + WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + BOOL wglBindVideoDeviceNV (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList) + int wglEnumerateVideoDevicesNV (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList) + BOOL wglQueryCurrentContextNV (int iAttribute, int* piValue) + DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_render_depth_texture b/Windows/glew/auto/extensions/gl/WGL_NV_render_depth_texture new file mode 100644 index 00000000..5ff4e5e7 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_render_depth_texture @@ -0,0 +1,10 @@ +WGL_NV_render_depth_texture +http://www.opengl.org/registry/specs/NV/render_depth_texture.txt +WGL_NV_render_depth_texture + + WGL_NO_TEXTURE_ARB 0x2077 + WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 + WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 + WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 + WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 + WGL_DEPTH_COMPONENT_NV 0x20A7 diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_render_texture_rectangle b/Windows/glew/auto/extensions/gl/WGL_NV_render_texture_rectangle new file mode 100644 index 00000000..3e7ada53 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_render_texture_rectangle @@ -0,0 +1,7 @@ +WGL_NV_render_texture_rectangle +http://www.opengl.org/registry/specs/NV/render_texture_rectangle.txt +WGL_NV_render_texture_rectangle + + WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 + WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 + WGL_TEXTURE_RECTANGLE_NV 0x20A2 diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_swap_group b/Windows/glew/auto/extensions/gl/WGL_NV_swap_group new file mode 100644 index 00000000..04c9b0bd --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_swap_group @@ -0,0 +1,10 @@ +WGL_NV_swap_group +http://www.opengl.org/registry/specs/NV/wgl_swap_group.txt +WGL_NV_swap_group + + BOOL wglBindSwapBarrierNV (GLuint group, GLuint barrier) + BOOL wglJoinSwapGroupNV (HDC hDC, GLuint group) + BOOL wglQueryFrameCountNV (HDC hDC, GLuint* count) + BOOL wglQueryMaxSwapGroupsNV (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers) + BOOL wglQuerySwapGroupNV (HDC hDC, GLuint* group, GLuint *barrier) + BOOL wglResetFrameCountNV (HDC hDC) diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_vertex_array_range b/Windows/glew/auto/extensions/gl/WGL_NV_vertex_array_range new file mode 100644 index 00000000..27b43ce2 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_vertex_array_range @@ -0,0 +1,6 @@ +WGL_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +WGL_NV_vertex_array_range + + void * wglAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void wglFreeMemoryNV (void *pointer) diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_video_capture b/Windows/glew/auto/extensions/gl/WGL_NV_video_capture new file mode 100644 index 00000000..1fd8ae09 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_video_capture @@ -0,0 +1,12 @@ +WGL_NV_video_capture +http://www.opengl.org/registry/specs/NV/video_capture.txt +WGL_NV_video_capture + + WGL_UNIQUE_ID_NV 0x20CE + WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + BOOL wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice) + UINT wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList) + BOOL wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice) + BOOL wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue) + BOOL wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice) + DECLARE_HANDLE(HVIDEOINPUTDEVICENV); diff --git a/Windows/glew/auto/extensions/gl/WGL_NV_video_output b/Windows/glew/auto/extensions/gl/WGL_NV_video_output new file mode 100644 index 00000000..6d3ca692 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_NV_video_output @@ -0,0 +1,24 @@ +WGL_NV_video_output +http://www.opengl.org/registry/specs/NV/wgl_video_output.txt +WGL_NV_video_output + + WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 + WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 + WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 + WGL_VIDEO_OUT_COLOR_NV 0x20C3 + WGL_VIDEO_OUT_ALPHA_NV 0x20C4 + WGL_VIDEO_OUT_DEPTH_NV 0x20C5 + WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 + WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 + WGL_VIDEO_OUT_FRAME 0x20C8 + WGL_VIDEO_OUT_FIELD_1 0x20C9 + WGL_VIDEO_OUT_FIELD_2 0x20CA + WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB + WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + BOOL wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer) + BOOL wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice) + BOOL wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo) + BOOL wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice) + BOOL wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer) + BOOL wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock) + DECLARE_HANDLE(HPVIDEODEV); diff --git a/Windows/glew/auto/extensions/gl/WGL_OML_sync_control b/Windows/glew/auto/extensions/gl/WGL_OML_sync_control new file mode 100644 index 00000000..3506cf39 --- /dev/null +++ b/Windows/glew/auto/extensions/gl/WGL_OML_sync_control @@ -0,0 +1,10 @@ +WGL_OML_sync_control +http://www.opengl.org/registry/specs/OML/wgl_sync_control.txt +WGL_OML_sync_control + + BOOL wglGetMscRateOML (HDC hdc, INT32* numerator, INT32 *denominator) + BOOL wglGetSyncValuesOML (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc) + INT64 wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder) + INT64 wglSwapLayerBuffersMscOML (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder) + BOOL wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc) + BOOL wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc) diff --git a/Windows/glew/auto/src/eglew_head.h b/Windows/glew/auto/src/eglew_head.h new file mode 100644 index 00000000..df2f1d99 --- /dev/null +++ b/Windows/glew/auto/src/eglew_head.h @@ -0,0 +1,88 @@ +#ifndef __eglew_h__ +#define __eglew_h__ +#define __EGLEW_H__ + +#ifdef __eglext_h_ +#error eglext.h included before eglew.h +#endif + +#if defined(__egl_h_) +#error egl.h included before eglew.h +#endif + +#define __eglext_h_ + +#define __egl_h_ + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY +#endif +#ifndef EGLAPI +#define EGLAPI extern +#endif + +/* EGL Types */ +#include <sys/types.h> + +#include <KHR/khrplatform.h> +#include <EGL/eglplatform.h> + +#include <GL/glew.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t EGLint; + +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; + +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; + +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef void *EGLLabelKHR; +typedef void *EGLObjectKHR; +typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +typedef void *EGLImageKHR; +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +typedef int EGLNativeFileDescriptorKHR; +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void *EGLDeviceEXT; +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +typedef khronos_utime_nanoseconds_t EGLuint64NV; +typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; + +struct EGLClientPixmapHI; + +#define EGL_DONT_CARE ((EGLint)-1) + +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_IMAGE ((EGLImage)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_NO_SYNC ((EGLSync)0) + +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) + +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); diff --git a/Windows/glew/auto/src/eglew_mid.h b/Windows/glew/auto/src/eglew_mid.h new file mode 100644 index 00000000..f94a149c --- /dev/null +++ b/Windows/glew/auto/src/eglew_mid.h @@ -0,0 +1,4 @@ +/* ------------------------------------------------------------------------- */ + +#define EGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define EGLEW_VAR_EXPORT GLEW_VAR_EXPORT diff --git a/Windows/glew/auto/src/eglew_tail.h b/Windows/glew/auto/src/eglew_tail.h new file mode 100644 index 00000000..a91a76ef --- /dev/null +++ b/Windows/glew/auto/src/eglew_tail.h @@ -0,0 +1,15 @@ +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY eglewInit (EGLDisplay display); +GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name); + +#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define EGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __eglew_h__ */ diff --git a/Windows/glew/auto/src/footer.html b/Windows/glew/auto/src/footer.html new file mode 100644 index 00000000..3adb9c14 --- /dev/null +++ b/Windows/glew/auto/src/footer.html @@ -0,0 +1,4 @@ +<!-- begin footer.html --> +</td></tr></table></body> +<!-- end footer.html --> + diff --git a/Windows/glew/auto/src/glew.rc b/Windows/glew/auto/src/glew.rc new file mode 100644 index 00000000..e9302200 --- /dev/null +++ b/Windows/glew/auto/src/glew.rc @@ -0,0 +1,135 @@ + +#include <windows.h> + +#ifdef GLEW_STATIC +# ifdef _DEBUG +# define FILENAME "glew32sd.dll" +# else +# define FILENAME "glew32s.dll" +# endif +#else +# ifdef _DEBUG +# define FILENAME "glew32d.dll" +# else +# define FILENAME "glew32.dll" +# endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +VS_VERSION_INFO VERSIONINFO +FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS__WINDOWS32 +#ifdef GLEW_STATIC +FILETYPE VFT_STATIC_LIB +#else +FILETYPE VFT_DLL +#endif +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", + "The OpenGL Extension Wrangler Library\r\n" + "Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n" + "Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n" + "Copyright (C) 2002, Lev Povalahev\r\n" + "All rights reserved.\r\n" + "\r\n" + "Redistribution and use in source and binary forms, with or without \r\n" + "modification, are permitted provided that the following conditions are met:\r\n" + "\r\n" + "* Redistributions of source code must retain the above copyright notice, \r\n" + " this list of conditions and the following disclaimer.\r\n" + "* Redistributions in binary form must reproduce the above copyright notice, \r\n" + " this list of conditions and the following disclaimer in the documentation \r\n" + " and/or other materials provided with the distribution.\r\n" + "* The name of the author may be used to endorse or promote products \r\n" + " derived from this software without specific prior written permission.\r\n" + "\r\n" + "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n" + "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n" + "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n" + "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n" + "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n" + "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n" + "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n" + "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n" + "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n" + "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n" + "THE POSSIBILITY OF SUCH DAMAGE.\r\n" + "\r\n" + "\r\n" + "Mesa 3-D graphics library\r\n" + "\r\n" + "Version: 7.0\r\n" + "\r\n" + "Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n" + "\r\n" + "Permission is hereby granted, free of charge, to any person obtaining a\r\n" + "copy of this software and associated documentation files (the ''Software''),\r\n" + "to deal in the Software without restriction, including without limitation\r\n" + "the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n" + "and/or sell copies of the Software, and to permit persons to whom the\r\n" + "Software is furnished to do so, subject to the following conditions:\r\n" + "\r\n" + "The above copyright notice and this permission notice shall be included\r\n" + "in all copies or substantial portions of the Software.\r\n" + "\r\n" + "THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n" + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n" + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n" + "BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n" + "AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n" + "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n" + "\r\n" + "\r\n" + "Copyright (c) 2007 The Khronos Group Inc.\r\n" + "\r\n" + "Permission is hereby granted, free of charge, to any person obtaining a\r\n" + "copy of this software and/or associated documentation files (the\r\n" + "''Materials''), to deal in the Materials without restriction, including\r\n" + "without limitation the rights to use, copy, modify, merge, publish,\r\n" + "distribute, sublicense, and/or sell copies of the Materials, and to\r\n" + "permit persons to whom the Materials are furnished to do so, subject to\r\n" + "the following conditions:\r\n" + "\r\n" + "The above copyright notice and this permission notice shall be included\r\n" + "in all copies or substantial portions of the Materials.\r\n" + "\r\n" + "THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n" + "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n" + "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n" + "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n" + "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n" + "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n" + "MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "The OpenGL Extension Wrangler Library\0" + VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "InternalName", "GLEW\0" + VALUE "LegalCopyright", "© 2002-2008 Milan Ikits & Marcelo Magallon\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", FILENAME "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "The OpenGL Extension Wrangler Library\0" + VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/Windows/glew/auto/src/glew_head.c b/Windows/glew/auto/src/glew_head.c new file mode 100644 index 00000000..d153cde6 --- /dev/null +++ b/Windows/glew/auto/src/glew_head.c @@ -0,0 +1,289 @@ +#ifndef GLEW_INCLUDE +#include <GL/glew.h> +#else +#include GLEW_INCLUDE +#endif + +#if defined(GLEW_OSMESA) +# define GLAPI extern +# include <GL/osmesa.h> +#elif defined(GLEW_EGL) +# include <GL/eglew.h> +#elif defined(_WIN32) +/* + * If NOGDI is defined, wingdi.h won't be included by windows.h, and thus + * wglGetProcAddress won't be declared. It will instead be implicitly declared, + * potentially incorrectly, which we don't want. + */ +# if defined(NOGDI) +# undef NOGDI +# endif +# include <GL/wglew.h> +#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include <GL/glxew.h> +#endif + +#include <stddef.h> /* For size_t */ + +#if defined(GLEW_EGL) +#elif defined(GLEW_REGAL) + +/* In GLEW_REGAL mode we call direcly into the linked + libRegal.so glGetProcAddressREGAL for looking up + the GL function pointers. */ + +# undef glGetProcAddressREGAL +# ifdef WIN32 +extern void * __stdcall glGetProcAddressREGAL(const GLchar *name); +static void * (__stdcall * regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; +# else +extern void * glGetProcAddressREGAL(const GLchar *name); +static void * (*regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; +# endif +# define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +#include <dlfcn.h> +#include <stdio.h> +#include <stdlib.h> + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include <stdlib.h> +#include <string.h> +#include <AvailabilityMacros.h> + +#ifdef MAC_OS_X_VERSION_10_3 + +#include <dlfcn.h> + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include <mach-o/dyld.h> + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(GLEW_REGAL) +# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name) +#elif defined(GLEW_OSMESA) +# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name) +#elif defined(GLEW_EGL) +# define glewGetProcAddress(name) eglGetProcAddress((const char *)name) +#elif defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#elif defined(__native_client__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +#endif + +/* + * Redefine GLEW_GET_VAR etc without const cast + */ + +#undef GLEW_GET_VAR +# define GLEW_GET_VAR(x) (x) + +#ifdef WGLEW_GET_VAR +# undef WGLEW_GET_VAR +# define WGLEW_GET_VAR(x) (x) +#endif /* WGLEW_GET_VAR */ + +#ifdef GLXEW_GET_VAR +# undef GLXEW_GET_VAR +# define GLXEW_GET_VAR(x) (x) +#endif /* GLXEW_GET_VAR */ + +#ifdef EGLEW_GET_VAR +# undef EGLEW_GET_VAR +# define EGLEW_GET_VAR(x) (x) +#endif /* EGLEW_GET_VAR */ + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ + +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return i; +} + +static GLuint _glewStrCopy(char *d, const char *s, char c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) { d[i] = s[i]; i++; } + d[i] = '\0'; + return i; +} + +#if !defined(GLEW_OSMESA) +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} +#endif +#endif + +static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +#if !defined(GLEW_OSMESA) +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} +#endif +#endif diff --git a/Windows/glew/auto/src/glew_head.h b/Windows/glew/auto/src/glew_head.h new file mode 100644 index 00000000..c19cefb1 --- /dev/null +++ b/Windows/glew/auto/src/glew_head.h @@ -0,0 +1,1129 @@ +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define _GL_H +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include <windows.h> to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* <windef.h> and <gl.h>*/ +#ifdef APIENTRY +# ifndef GLAPIENTRY +# define GLAPIENTRY APIENTRY +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY APIENTRY +# endif +#else +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# ifndef GLAPIENTRY +# define GLAPIENTRY __stdcall +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY __stdcall +# endif +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* <winnt.h> */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* <wingdi.h> and <winnt.h> */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* <ctype.h> */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* <stddef.h> */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include <stddef.h> + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include <inttypes.h> +#else +#include <stdint.h> +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* <glu.h> */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#endif /* _WIN32 */ + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#define GLEW_VAR_EXPORT GLEWAPI +#define GLEW_FUN_EXPORT GLEWAPI + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include <inttypes.h> +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +# ifdef __APPLE__ +# include <Availability.h> +# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +# define GLEW_NO_GLU +# endif +# endif +#endif + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include <OpenGL/glu.h> +# else +# include <GL/glu.h> +# endif +#endif + diff --git a/Windows/glew/auto/src/glew_init_egl.c b/Windows/glew/auto/src/glew_init_egl.c new file mode 100644 index 00000000..784285fa --- /dev/null +++ b/Windows/glew/auto/src/glew_init_egl.c @@ -0,0 +1,45 @@ + /* ------------------------------------------------------------------------ */ + +GLboolean eglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + start = (const GLubyte*) eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum eglewInit (EGLDisplay display) +{ + EGLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + PFNEGLINITIALIZEPROC initialize = NULL; + PFNEGLQUERYSTRINGPROC queryString = NULL; + + /* Load necessary entry points */ + initialize = (PFNEGLINITIALIZEPROC) glewGetProcAddress("eglInitialize"); + queryString = (PFNEGLQUERYSTRINGPROC) glewGetProcAddress("eglQueryString"); + if (!initialize || !queryString) + return 1; + + /* query EGK version */ + if (initialize(display, &major, &minor) != EGL_TRUE) + return 1; + + EGLEW_VERSION_1_5 = ( major > 1 ) || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_4 = EGLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_3 = EGLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_2 = EGLEW_VERSION_1_3 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_1 = EGLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_0 = EGLEW_VERSION_1_1 == GL_TRUE || ( major == 1 && minor >= 0 ) ? GL_TRUE : GL_FALSE; + + /* query EGL extension string */ + extStart = (const GLubyte*) queryString(display, EGL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ diff --git a/Windows/glew/auto/src/glew_init_gl.c b/Windows/glew/auto/src/glew_init_gl.c new file mode 100644 index 00000000..4b3da568 --- /dev/null +++ b/Windows/glew/auto/src/glew_init_gl.c @@ -0,0 +1,207 @@ +/* ------------------------------------------------------------------------- */ + +static int _glewExtensionCompare(const char *s1, const char *s2) +{ + /* http://www.chanduthedev.com/2012/07/strcmp-implementation-in-c.html */ + while (*s1 || *s2) + { + if (*s1 > *s2) + return 1; + if (*s1 < *s2) + return -1; + s1++; + s2++; + } + return 0; +} + +static ptrdiff_t _glewBsearchExtension(const char* name) +{ + ptrdiff_t lo = 0, hi = sizeof(_glewExtensionLookup) / sizeof(char*) - 2; + + while (lo <= hi) + { + ptrdiff_t mid = (lo + hi) / 2; + const int cmp = _glewExtensionCompare(name, _glewExtensionLookup[mid]); + if (cmp < 0) hi = mid - 1; + else if (cmp > 0) lo = mid + 1; + else return mid; + } + return -1; +} + +static GLboolean *_glewGetExtensionString(const char *name) +{ + ptrdiff_t n = _glewBsearchExtension(name); + if (n >= 0) return &_glewExtensionString[n]; + return NULL; +} + +static GLboolean *_glewGetExtensionEnable(const char *name) +{ + ptrdiff_t n = _glewBsearchExtension(name); + if (n >= 0) return _glewExtensionEnabled[n]; + return NULL; +} + +static const char *_glewNextSpace(const char *i) +{ + const char *j = i; + if (j) + while (*j!=' ' && *j) ++j; + return j; +} + +static const char *_glewNextNonSpace(const char *i) +{ + const char *j = i; + if (j) + while (*j==' ') ++j; + return j; +} + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + GLboolean *enable = _glewGetExtensionString(name); + if (enable) + return *enable; + return GL_FALSE; +} + +/* ------------------------------------------------------------------------- */ + +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name); +typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params); + +static GLenum GLEWAPIENTRY glewContextInit () +{ + PFNGLGETSTRINGPROC getString; + const GLubyte* s; + GLuint dot; + GLint major, minor; + size_t n; + + #ifdef _WIN32 + getString = glGetString; + #else + getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString"); + if (!getString) + return GLEW_ERROR_NO_GL_VERSION; + #endif + + /* query opengl version */ + s = getString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + GLEW_VERSION_4_6 = ( major > 4 ) || ( major == 4 && minor >= 6 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_5 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_1 = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_0 = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_3 = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_2 = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_1 = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_0 = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_2_1 = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_2_0 = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_5 = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_4 = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_3 = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_2_1 = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_2 = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n) + _glewExtensionString[n] = GL_FALSE; + + if (GLEW_VERSION_3_0) + { + GLint n = 0; + GLint i; + PFNGLGETINTEGERVPROC getIntegerv; + PFNGLGETSTRINGIPROC getStringi; + const char *ext; + GLboolean *enable; + + #ifdef _WIN32 + getIntegerv = glGetIntegerv; + #else + getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv"); + #endif + + if (getIntegerv) + getIntegerv(GL_NUM_EXTENSIONS, &n); + + /* glGetStringi is OpenGL 3.0 */ + getStringi = (PFNGLGETSTRINGIPROC) glewGetProcAddress((const GLubyte*)"glGetStringi"); + if (getStringi) + for (i = 0; i<n; ++i) + { + ext = (const char *) getStringi(GL_EXTENSIONS, i); + + /* Based on extension string(s), glewGetExtension purposes */ + enable = _glewGetExtensionString(ext); + if (enable) + *enable = GL_TRUE; + + /* Based on extension string(s), experimental mode, glewIsSupported purposes */ + enable = _glewGetExtensionEnable(ext); + if (enable) + *enable = GL_TRUE; + } + } + else + { + const char *extensions; + const char *end; + const char *i; + const char *j; + char ext[128]; + GLboolean *enable; + + extensions = (const char *) getString(GL_EXTENSIONS); + + if (extensions) + { + end = extensions + _glewStrLen((const GLubyte *) extensions); + for (i=extensions; i<end; i = j + 1) + { + i = _glewNextNonSpace(i); + j = _glewNextSpace(i); + + /* Copy extension into NUL terminated string */ + if (j-i >= (ptrdiff_t) sizeof(ext)) + continue; + _glewStrCopy(ext, i, ' '); + + /* Based on extension string(s), glewGetExtension purposes */ + enable = _glewGetExtensionString(ext); + if (enable) + *enable = GL_TRUE; + + /* Based on extension string(s), experimental mode, glewIsSupported purposes */ + enable = _glewGetExtensionEnable(ext); + if (enable) + *enable = GL_TRUE; + } + } + } diff --git a/Windows/glew/auto/src/glew_init_glx.c b/Windows/glew/auto/src/glew_init_glx.c new file mode 100644 index 00000000..8397827f --- /dev/null +++ b/Windows/glew/auto/src/glew_init_glx.c @@ -0,0 +1,57 @@ +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum glxewInit () +{ + Display* display; + int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* check for a display */ + display = glXGetCurrentDisplay(); + if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY; + /* initialize flags */ + GLXEW_VERSION_1_0 = GL_TRUE; + GLXEW_VERSION_1_1 = GL_TRUE; + GLXEW_VERSION_1_2 = GL_TRUE; + GLXEW_VERSION_1_3 = GL_TRUE; + GLXEW_VERSION_1_4 = GL_TRUE; + /* query GLX version */ + glXQueryVersion(display, &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + GLXEW_VERSION_1_4 = GL_FALSE; + break; + case 2: + GLXEW_VERSION_1_4 = GL_FALSE; + GLXEW_VERSION_1_3 = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ diff --git a/Windows/glew/auto/src/glew_init_tail.c b/Windows/glew/auto/src/glew_init_tail.c new file mode 100644 index 00000000..e21ce96b --- /dev/null +++ b/Windows/glew/auto/src/glew_init_tail.c @@ -0,0 +1,67 @@ +/* ------------------------------------------------------------------------ */ + +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(size_t)error > max_error ? max_error : (size_t)error]; +} + +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"GLEW_VERSION_STRING", + (const GLubyte*)"GLEW_VERSION_MAJOR_STRING", + (const GLubyte*)"GLEW_VERSION_MINOR_STRING", + (const GLubyte*)"GLEW_VERSION_MICRO_STRING" + }; + const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(size_t)name > max_string ? 0 : (size_t)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +GLenum GLEWAPIENTRY glewInit (void) +{ + GLenum r; +#if defined(GLEW_EGL) + PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL; +#endif + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(GLEW_EGL) + getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay"); + return eglewInit(getCurrentDisplay()); +#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__) + return r; +#elif defined(_WIN32) + return wglewInit(); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ + return glxewInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#if defined(_WIN32) && defined(GLEW_BUILD) && defined(__GNUC__) +/* GCC requires a DLL entry point even without any standard library included. */ +/* Types extracted from windows.h to avoid polluting the rest of the file. */ +int __stdcall DllMainCRTStartup(void* instance, unsigned reason, void* reserved) +{ + (void) instance; + (void) reason; + (void) reserved; + return 1; +} +#endif diff --git a/Windows/glew/auto/src/glew_init_wgl.c b/Windows/glew/auto/src/glew_init_wgl.c new file mode 100644 index 00000000..978cf3cc --- /dev/null +++ b/Windows/glew/auto/src/glew_init_wgl.c @@ -0,0 +1,41 @@ +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY wglewInit () +{ + GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; diff --git a/Windows/glew/auto/src/glew_license.h b/Windows/glew/auto/src/glew_license.h new file mode 100644 index 00000000..f257ed20 --- /dev/null +++ b/Windows/glew/auto/src/glew_license.h @@ -0,0 +1,32 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart <nigels[]users sourceforge net> +** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> +** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + diff --git a/Windows/glew/auto/src/glew_str_egl.c b/Windows/glew/auto/src/glew_str_egl.c new file mode 100644 index 00000000..f0c52f92 --- /dev/null +++ b/Windows/glew/auto/src/glew_str_egl.c @@ -0,0 +1,17 @@ + } + ret = (len == 0); + } + return ret; +} + +#elif defined(GLEW_EGL) + +GLboolean eglewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"EGL_", 4)) + { diff --git a/Windows/glew/auto/src/glew_str_glx.c b/Windows/glew/auto/src/glew_str_glx.c new file mode 100644 index 00000000..893d741c --- /dev/null +++ b/Windows/glew/auto/src/glew_str_glx.c @@ -0,0 +1,17 @@ + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(GLEW_OSMESA) && !defined(GLEW_EGL) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +GLboolean glxewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { diff --git a/Windows/glew/auto/src/glew_str_head.c b/Windows/glew/auto/src/glew_str_head.c new file mode 100644 index 00000000..fed3a0f9 --- /dev/null +++ b/Windows/glew/auto/src/glew_str_head.c @@ -0,0 +1,9 @@ +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { diff --git a/Windows/glew/auto/src/glew_str_tail.c b/Windows/glew/auto/src/glew_str_tail.c new file mode 100644 index 00000000..caa95727 --- /dev/null +++ b/Windows/glew/auto/src/glew_str_tail.c @@ -0,0 +1,7 @@ + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/Windows/glew/auto/src/glew_str_wgl.c b/Windows/glew/auto/src/glew_str_wgl.c new file mode 100644 index 00000000..db67b516 --- /dev/null +++ b/Windows/glew/auto/src/glew_str_wgl.c @@ -0,0 +1,17 @@ + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA) + +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { diff --git a/Windows/glew/auto/src/glew_tail.h b/Windows/glew/auto/src/glew_tail.h new file mode 100644 index 00000000..09daadef --- /dev/null +++ b/Windows/glew/auto/src/glew_tail.h @@ -0,0 +1,68 @@ +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* ------------------------------------------------------------------------- */ + +/* GLEW version info */ + +/* +VERSION GLEW_VERSION_STRING +VERSION_MAJOR GLEW_VERSION_MAJOR_STRING +VERSION_MINOR GLEW_VERSION_MINOR_STRING +VERSION_MICRO GLEW_VERSION_MICRO_STRING +*/ + +/* API */ +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#ifndef GLEW_GET_VAR +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLEW_GET_FUN +#define GLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/Windows/glew/auto/src/glewinfo.rc b/Windows/glew/auto/src/glewinfo.rc new file mode 100644 index 00000000..2f46bc58 --- /dev/null +++ b/Windows/glew/auto/src/glewinfo.rc @@ -0,0 +1,123 @@ + +#include <windows.h> + +#ifdef _DEBUG +# define FILENAME "glewinfod.exe" +#else +# define FILENAME "glewinfo.exe" +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +VS_VERSION_INFO VERSIONINFO +FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", + "The OpenGL Extension Wrangler Library\r\n" + "Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n" + "Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n" + "Copyright (C) 2002, Lev Povalahev\r\n" + "All rights reserved.\r\n" + "\r\n" + "Redistribution and use in source and binary forms, with or without \r\n" + "modification, are permitted provided that the following conditions are met:\r\n" + "\r\n" + "* Redistributions of source code must retain the above copyright notice, \r\n" + " this list of conditions and the following disclaimer.\r\n" + "* Redistributions in binary form must reproduce the above copyright notice, \r\n" + " this list of conditions and the following disclaimer in the documentation \r\n" + " and/or other materials provided with the distribution.\r\n" + "* The name of the author may be used to endorse or promote products \r\n" + " derived from this software without specific prior written permission.\r\n" + "\r\n" + "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n" + "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n" + "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n" + "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n" + "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n" + "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n" + "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n" + "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n" + "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n" + "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n" + "THE POSSIBILITY OF SUCH DAMAGE.\r\n" + "\r\n" + "\r\n" + "Mesa 3-D graphics library\r\n" + "\r\n" + "Version: 7.0\r\n" + "\r\n" + "Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n" + "\r\n" + "Permission is hereby granted, free of charge, to any person obtaining a\r\n" + "copy of this software and associated documentation files (the ''Software''),\r\n" + "to deal in the Software without restriction, including without limitation\r\n" + "the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n" + "and/or sell copies of the Software, and to permit persons to whom the\r\n" + "Software is furnished to do so, subject to the following conditions:\r\n" + "\r\n" + "The above copyright notice and this permission notice shall be included\r\n" + "in all copies or substantial portions of the Software.\r\n" + "\r\n" + "THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n" + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n" + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n" + "BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n" + "AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n" + "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n" + "\r\n" + "\r\n" + "Copyright (c) 2007 The Khronos Group Inc.\r\n" + "\r\n" + "Permission is hereby granted, free of charge, to any person obtaining a\r\n" + "copy of this software and/or associated documentation files (the\r\n" + "''Materials''), to deal in the Materials without restriction, including\r\n" + "without limitation the rights to use, copy, modify, merge, publish,\r\n" + "distribute, sublicense, and/or sell copies of the Materials, and to\r\n" + "permit persons to whom the Materials are furnished to do so, subject to\r\n" + "the following conditions:\r\n" + "\r\n" + "The above copyright notice and this permission notice shall be included\r\n" + "in all copies or substantial portions of the Materials.\r\n" + "\r\n" + "THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n" + "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n" + "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n" + "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n" + "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n" + "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n" + "MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "Utility for verifying extension entry points\0" + VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "InternalName", "glewinfo\0" + VALUE "LegalCopyright", "© 2002-2008 Milan Ikits & Marcelo Magallon\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", FILENAME "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "The OpenGL Extension Wrangler Library\0" + VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/Windows/glew/auto/src/glewinfo_egl.c b/Windows/glew/auto/src/glewinfo_egl.c new file mode 100644 index 00000000..877e722d --- /dev/null +++ b/Windows/glew/auto/src/glewinfo_egl.c @@ -0,0 +1,6 @@ +} + +#elif defined(GLEW_EGL) + +static void eglewInfo () +{ diff --git a/Windows/glew/auto/src/glewinfo_gl.c b/Windows/glew/auto/src/glewinfo_gl.c new file mode 100644 index 00000000..9d7835d0 --- /dev/null +++ b/Windows/glew/auto/src/glewinfo_gl.c @@ -0,0 +1,7 @@ +/* ------------------------------------------------------------------------ */ + +static void glewInfo (void) +{ +#ifdef GL_VERSION_1_1 + _glewInfo_GL_VERSION_1_1(); +#endif /* GL_VERSION_1_1 */ diff --git a/Windows/glew/auto/src/glewinfo_glx.c b/Windows/glew/auto/src/glewinfo_glx.c new file mode 100644 index 00000000..e60b5499 --- /dev/null +++ b/Windows/glew/auto/src/glewinfo_glx.c @@ -0,0 +1,6 @@ +} + +#elif !defined(GLEW_EGL) && !defined(GLEW_OSMESA) /* _UNIX */ + +static void glxewInfo () +{ diff --git a/Windows/glew/auto/src/glewinfo_head.c b/Windows/glew/auto/src/glewinfo_head.c new file mode 100644 index 00000000..02089f67 --- /dev/null +++ b/Windows/glew/auto/src/glewinfo_head.c @@ -0,0 +1,89 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <GL/glew.h> +#if defined(GLEW_EGL) +#include <GL/eglew.h> +#elif defined(GLEW_OSMESA) +#define GLAPI extern +#include <GL/osmesa.h> +#elif defined(_WIN32) +#include <GL/wglew.h> +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +#include <GL/glxew.h> +#endif + +#if defined(__APPLE__) +#include <AvailabilityMacros.h> +#endif + +#ifdef GLEW_REGAL +#include <GL/Regal.h> +#endif + +static FILE* f; + +/* Command-line parameters for GL context creation */ + +struct createParams +{ +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + int pixelformat; +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) + const char* display; + int visual; +#endif + int major, minor; /* GL context version number */ + + /* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */ + int profile; /* core = 1, compatibility = 2 */ + int flags; /* debug = 1, forward compatible = 2 */ +}; + +GLboolean glewCreateContext (struct createParams *params); + +GLboolean glewParseArgs (int argc, char** argv, struct createParams *); + +void glewDestroyContext (); + +/* ------------------------------------------------------------------------- */ + +static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3) +{ + unsigned int i; + fprintf(f, "\n%s:", name); + for (i=0; i<62-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s ", def1 ? "OK" : "MISSING"); + if (def1 != def2) + fprintf(f, "[%s] ", def2 ? "OK" : "MISSING"); + if (def1 != def3) + fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING"); + else + fprintf(f, "\n"); + for (i=0; i<strlen(name)+1; i++) fprintf(f, "-"); + fprintf(f, "\n"); + fflush(f); +} + +static void glewInfoFunc (const char* name, GLint undefined) +{ + unsigned int i; + fprintf(f, " %s:", name); + for (i=0; i<60-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s\n", undefined ? "MISSING" : "OK"); + fflush(f); +} + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifdef GL_VERSION_1_1 + +static void _glewInfo_GL_VERSION_1_1 (void) +{ + glewPrintExt("GL_VERSION_1_1", GLEW_VERSION_1_1, GLEW_VERSION_1_1, GLEW_VERSION_1_1); +} + +#endif /* GL_VERSION_1_1 */ + diff --git a/Windows/glew/auto/src/glewinfo_tail.c b/Windows/glew/auto/src/glewinfo_tail.c new file mode 100644 index 00000000..4d455382 --- /dev/null +++ b/Windows/glew/auto/src/glewinfo_tail.c @@ -0,0 +1,598 @@ +} + +#endif /* _WIN32 */ + +/* ------------------------------------------------------------------------ */ + +int main (int argc, char** argv) +{ + GLuint err; + struct createParams params = + { +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + -1, /* pixelformat */ +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + "", /* display */ + -1, /* visual */ +#endif + 0, /* major */ + 0, /* minor */ + 0, /* profile mask */ + 0 /* flags */ + }; + +#if defined(GLEW_EGL) + typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name); + PFNGLGETSTRINGPROC getString; +#endif + + if (glewParseArgs(argc-1, argv+1, ¶ms)) + { + fprintf(stderr, "Usage: glewinfo " +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + "[-pf <pixelformat>] " +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + "[-display <display>] " + "[-visual <visual id>] " +#endif + "[-version <OpenGL version>] " + "[-profile core|compatibility] " + "[-flag debug|forward]" + "\n"); + return 1; + } + + if (GL_TRUE == glewCreateContext(¶ms)) + { + fprintf(stderr, "Error: glewCreateContext failed\n"); + glewDestroyContext(); + return 1; + } + glewExperimental = GL_TRUE; + err = glewInit(); + if (GLEW_OK != err) + { + fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); + glewDestroyContext(); + return 1; + } + +#if defined(GLEW_EGL) + getString = (PFNGLGETSTRINGPROC) eglGetProcAddress("glGetString"); + if (!getString) + { + fprintf(stderr, "Error: eglGetProcAddress failed to fetch glGetString\n"); + glewDestroyContext(); + return 1; + } +#endif + +#if defined(_WIN32) +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + if (fopen_s(&f, "glewinfo.txt", "w") != 0) + f = stdout; +#else + f = fopen("glewinfo.txt", "w"); +#endif + if (f == NULL) f = stdout; +#else + f = stdout; +#endif + fprintf(f, "---------------------------\n"); + fprintf(f, " GLEW Extension Info\n"); + fprintf(f, "---------------------------\n\n"); + fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION)); +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n", + params.display == NULL ? getenv("DISPLAY") : params.display, params.visual); +#endif +#if defined(GLEW_EGL) + fprintf(f, "Running on a %s from %s\n", + getString(GL_RENDERER), getString(GL_VENDOR)); + fprintf(f, "OpenGL version %s is supported\n", getString(GL_VERSION)); +#else + fprintf(f, "Running on a %s from %s\n", + glGetString(GL_RENDERER), glGetString(GL_VENDOR)); + fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION)); +#endif + glewInfo(); +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) + eglewInfo(); +#elif defined(_WIN32) + wglewInfo(); +#else + glxewInfo(); +#endif + if (f != stdout) fclose(f); + glewDestroyContext(); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) +{ + int p = 0; + while (p < argc) + { + if (!strcmp(argv[p], "-version")) + { + if (++p >= argc) return GL_TRUE; + if (sscanf(argv[p++], "%d.%d", ¶ms->major, ¶ms->minor) != 2) return GL_TRUE; + } + else if (!strcmp(argv[p], "-profile")) + { + if (++p >= argc) return GL_TRUE; + if (strcmp("core", argv[p]) == 0) params->profile |= 1; + else if (strcmp("compatibility",argv[p]) == 0) params->profile |= 2; + else return GL_TRUE; + ++p; + } + else if (!strcmp(argv[p], "-flag")) + { + if (++p >= argc) return GL_TRUE; + if (strcmp("debug", argv[p]) == 0) params->flags |= 1; + else if (strcmp("forward",argv[p]) == 0) params->flags |= 2; + else return GL_TRUE; + ++p; + } +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + params->pixelformat = strtol(argv[p++], NULL, 0); + } +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + else if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + params->display = argv[p++]; + } + else if (!strcmp(argv[p], "-visual")) + { + if (++p >= argc) return GL_TRUE; + params->visual = (int)strtol(argv[p++], NULL, 0); + } +#endif + else + return GL_TRUE; + } + return GL_FALSE; +} + +/* ------------------------------------------------------------------------ */ + +#if defined(GLEW_EGL) +EGLDisplay display; +EGLContext ctx; + +/* See: http://stackoverflow.com/questions/12662227/opengl-es2-0-offscreen-context-for-fbo-rendering */ + +GLboolean glewCreateContext (struct createParams *params) +{ + EGLDeviceEXT devices[1]; + EGLint numDevices; + EGLSurface surface; + EGLint majorVersion, minorVersion; + EGLint configAttribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RED_SIZE, 1, + EGL_GREEN_SIZE, 1, + EGL_BLUE_SIZE, 1, + EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, + EGL_NONE + }; + static const EGLint contextAttribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + static const EGLint pBufferAttribs[] = { + EGL_WIDTH, 128, + EGL_HEIGHT, 128, + EGL_NONE + }; + EGLConfig config; + EGLint numConfig; + EGLBoolean pBuffer; + + PFNEGLQUERYDEVICESEXTPROC queryDevices = NULL; + PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = NULL; + PFNEGLGETERRORPROC getError = NULL; + PFNEGLGETDISPLAYPROC getDisplay = NULL; + PFNEGLINITIALIZEPROC initialize = NULL; + PFNEGLBINDAPIPROC bindAPI = NULL; + PFNEGLCHOOSECONFIGPROC chooseConfig = NULL; + PFNEGLCREATEWINDOWSURFACEPROC createWindowSurface = NULL; + PFNEGLCREATECONTEXTPROC createContext = NULL; + PFNEGLMAKECURRENTPROC makeCurrent = NULL; + PFNEGLCREATEPBUFFERSURFACEPROC createPbufferSurface = NULL; + + /* Load necessary entry points */ + queryDevices = (PFNEGLQUERYDEVICESEXTPROC) eglGetProcAddress("eglQueryDevicesEXT"); + getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress("eglGetPlatformDisplayEXT"); + getError = (PFNEGLGETERRORPROC) eglGetProcAddress("eglGetError"); + getDisplay = (PFNEGLGETDISPLAYPROC) eglGetProcAddress("eglGetDisplay"); + initialize = (PFNEGLINITIALIZEPROC) eglGetProcAddress("eglInitialize"); + bindAPI = (PFNEGLBINDAPIPROC) eglGetProcAddress("eglBindAPI"); + chooseConfig = (PFNEGLCHOOSECONFIGPROC) eglGetProcAddress("eglChooseConfig"); + createWindowSurface = (PFNEGLCREATEWINDOWSURFACEPROC) eglGetProcAddress("eglCreateWindowSurface"); + createPbufferSurface = (PFNEGLCREATEPBUFFERSURFACEPROC) eglGetProcAddress("eglCreatePbufferSurface"); + createContext = (PFNEGLCREATECONTEXTPROC) eglGetProcAddress("eglCreateContext"); + makeCurrent = (PFNEGLMAKECURRENTPROC) eglGetProcAddress("eglMakeCurrent"); + if (!getError || !getDisplay || !initialize || !bindAPI || !chooseConfig || !createWindowSurface || !createContext || !makeCurrent) + return GL_TRUE; + + pBuffer = 0; + display = EGL_NO_DISPLAY; + if (queryDevices && getPlatformDisplay) + { + queryDevices(1, devices, &numDevices); + if (numDevices==1) + { + /* Nvidia EGL doesn't need X11 for p-buffer surface */ + display = getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, devices[0], 0); + configAttribs[1] = EGL_PBUFFER_BIT; + pBuffer = 1; + } + } + if (display==EGL_NO_DISPLAY) + { + /* Fall-back to X11 surface, works on Mesa */ + display = getDisplay(EGL_DEFAULT_DISPLAY); + } + if (display == EGL_NO_DISPLAY) + return GL_TRUE; + + eglewInit(display); + + if (bindAPI(EGL_OPENGL_API) != EGL_TRUE) + return GL_TRUE; + + if (chooseConfig(display, configAttribs, &config, 1, &numConfig) != EGL_TRUE || (numConfig != 1)) + return GL_TRUE; + + ctx = createContext(display, config, EGL_NO_CONTEXT, pBuffer ? contextAttribs : NULL); + if (NULL == ctx) + return GL_TRUE; + + surface = EGL_NO_SURFACE; + /* Create a p-buffer surface if possible */ + if (pBuffer && createPbufferSurface) + { + surface = createPbufferSurface(display, config, pBufferAttribs); + } + /* Create a generic surface without a native window, if necessary */ + if (surface==EGL_NO_SURFACE) + { + surface = createWindowSurface(display, config, (EGLNativeWindowType) NULL, NULL); + } +#if 0 + if (surface == EGL_NO_SURFACE) + return GL_TRUE; +#endif + + if (makeCurrent(display, surface, surface, ctx) != EGL_TRUE) + return GL_TRUE; + + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != ctx) eglDestroyContext(display, ctx); +} + +#elif defined(GLEW_OSMESA) +OSMesaContext ctx; + +static const GLint osmFormat = GL_UNSIGNED_BYTE; +static const GLint osmWidth = 640; +static const GLint osmHeight = 480; +static GLubyte *osmPixels = NULL; + +GLboolean glewCreateContext (struct createParams *params) +{ + ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); + if (NULL == ctx) return GL_TRUE; + if (NULL == osmPixels) + { + osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1); + } + if (!OSMesaMakeCurrent(ctx, osmPixels, GL_UNSIGNED_BYTE, osmWidth, osmHeight)) + { + return GL_TRUE; + } + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != ctx) OSMesaDestroyContext(ctx); +} + +#elif defined(_WIN32) + +HWND wnd = NULL; +HDC dc = NULL; +HGLRC rc = NULL; + +GLboolean glewCreateContext (struct createParams* params) +{ + WNDCLASS wc; + PIXELFORMATDESCRIPTOR pfd; + /* register window class */ + ZeroMemory(&wc, sizeof(WNDCLASS)); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "GLEW"; + if (0 == RegisterClass(&wc)) return GL_TRUE; + /* create window */ + wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), NULL); + if (NULL == wnd) return GL_TRUE; + /* get the device context */ + dc = GetDC(wnd); + if (NULL == dc) return GL_TRUE; + /* find pixel format */ + ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); + if (params->pixelformat == -1) /* find default */ + { + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + params->pixelformat = ChoosePixelFormat(dc, &pfd); + if (params->pixelformat == 0) return GL_TRUE; + } + /* set the pixel format for the dc */ + if (FALSE == SetPixelFormat(dc, params->pixelformat, &pfd)) return GL_TRUE; + /* create rendering context */ + rc = wglCreateContext(dc); + if (NULL == rc) return GL_TRUE; + if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE; + if (params->major || params->profile || params->flags) + { + HGLRC oldRC = rc; + int contextAttrs[20]; + int i; + + wglewInit(); + + /* Intel HD 3000 has WGL_ARB_create_context, but not WGL_ARB_create_context_profile */ + if (!wglewGetExtension("WGL_ARB_create_context")) + return GL_TRUE; + + i = 0; + if (params->major) + { + contextAttrs[i++] = WGL_CONTEXT_MAJOR_VERSION_ARB; + contextAttrs[i++] = params->major; + contextAttrs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB; + contextAttrs[i++] = params->minor; + } + if (params->profile) + { + contextAttrs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; + contextAttrs[i++] = params->profile; + } + if (params->flags) + { + contextAttrs[i++] = WGL_CONTEXT_FLAGS_ARB; + contextAttrs[i++] = params->flags; + } + contextAttrs[i++] = 0; + rc = wglCreateContextAttribsARB(dc, 0, contextAttrs); + + if (NULL == rc) return GL_TRUE; + if (!wglMakeCurrent(dc, rc)) return GL_TRUE; + + wglDeleteContext(oldRC); + } + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != rc) wglMakeCurrent(NULL, NULL); + if (NULL != rc) wglDeleteContext(rc); + if (NULL != wnd && NULL != dc) ReleaseDC(wnd, dc); + if (NULL != wnd) DestroyWindow(wnd); + UnregisterClass("GLEW", GetModuleHandle(NULL)); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +#include <OpenGL/OpenGL.h> +#include <OpenGL/CGLTypes.h> + +CGLContextObj ctx, octx; + +GLboolean glewCreateContext (struct createParams *params) +{ + CGLPixelFormatAttribute contextAttrs[20]; + int i; + CGLPixelFormatObj pf; + GLint npix; + CGLError error; + + i = 0; + contextAttrs[i++] = kCGLPFAAccelerated; /* No software rendering */ + + /* MAC_OS_X_VERSION_10_7 == 1070 */ + #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + if (params->profile & GL_CONTEXT_CORE_PROFILE_BIT) + { + if ((params->major==3 && params->minor>=2) || params->major>3) + { + contextAttrs[i++] = kCGLPFAOpenGLProfile; /* OSX 10.7 Lion onwards */ + contextAttrs[i++] = (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core; /* 3.2 Core Context */ + } + } + #endif + + contextAttrs[i++] = 0; + + error = CGLChoosePixelFormat(contextAttrs, &pf, &npix); + if (error) return GL_TRUE; + error = CGLCreateContext(pf, NULL, &ctx); + if (error) return GL_TRUE; + CGLReleasePixelFormat(pf); + octx = CGLGetCurrentContext(); + error = CGLSetCurrentContext(ctx); + if (error) return GL_TRUE; + /* Needed for Regal on the Mac */ + #if defined(GLEW_REGAL) && defined(__APPLE__) + RegalMakeCurrent(ctx); + #endif + return GL_FALSE; +} + +void glewDestroyContext () +{ + CGLSetCurrentContext(octx); + CGLReleaseContext(ctx); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__HAIKU__) + +GLboolean glewCreateContext (struct createParams *params) +{ + /* TODO: Haiku: We need to call C++ code here */ + return GL_FALSE; +} + +void glewDestroyContext () +{ + /* TODO: Haiku: We need to call C++ code here */ +} + +/* ------------------------------------------------------------------------ */ + +#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +Display* dpy = NULL; +XVisualInfo* vi = NULL; +XVisualInfo* vis = NULL; +GLXContext ctx = NULL; +Window wnd = 0; +Colormap cmap = 0; + +GLboolean glewCreateContext (struct createParams *params) +{ + int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; + int erb, evb; + XSetWindowAttributes swa; + /* open display */ + dpy = XOpenDisplay(params->display); + if (NULL == dpy) return GL_TRUE; + /* query for glx */ + if (!glXQueryExtension(dpy, &erb, &evb)) return GL_TRUE; + /* choose visual */ + if (params->visual == -1) + { + vi = glXChooseVisual(dpy, DefaultScreen(dpy), attrib); + if (NULL == vi) return GL_TRUE; + params->visual = (int)XVisualIDFromVisual(vi->visual); + } + else + { + int n_vis, i; + vis = XGetVisualInfo(dpy, 0, NULL, &n_vis); + for (i=0; i<n_vis; i++) + { + if ((int)XVisualIDFromVisual(vis[i].visual) == params->visual) + vi = &vis[i]; + } + if (vi == NULL) return GL_TRUE; + } + /* create context */ + ctx = glXCreateContext(dpy, vi, None, True); + if (NULL == ctx) return GL_TRUE; + /* create window */ + /*wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0);*/ + cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); + swa.border_pixel = 0; + swa.colormap = cmap; + wnd = XCreateWindow(dpy, RootWindow(dpy, vi->screen), + 0, 0, 1, 1, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap, &swa); + /* make context current */ + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + if (params->major || params->profile || params->flags) + { + GLXContext oldCtx = ctx; + GLXFBConfig *FBConfigs; + int FBConfigAttrs[] = { GLX_FBCONFIG_ID, 0, None }; + int contextAttrs[20]; + int nelems, i; + + glxewInit(); + + if (!glxewGetExtension("GLX_ARB_create_context")) + return GL_TRUE; + + if (glXQueryContext(dpy, oldCtx, GLX_FBCONFIG_ID, &FBConfigAttrs[1])) + return GL_TRUE; + FBConfigs = glXChooseFBConfig(dpy, vi->screen, FBConfigAttrs, &nelems); + + if (nelems < 1) + return GL_TRUE; + + i = 0; + if (params->major) + { + contextAttrs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB; + contextAttrs[i++] = params->major; + contextAttrs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB; + contextAttrs[i++] = params->minor; + } + if (params->profile) + { + contextAttrs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB; + contextAttrs[i++] = params->profile; + } + if (params->flags) + { + contextAttrs[i++] = GLX_CONTEXT_FLAGS_ARB; + contextAttrs[i++] = params->flags; + } + contextAttrs[i++] = None; + ctx = glXCreateContextAttribsARB(dpy, *FBConfigs, NULL, True, contextAttrs); + + if (NULL == ctx) return GL_TRUE; + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + + glXDestroyContext(dpy, oldCtx); + + XFree(FBConfigs); + } + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx); + if (NULL != dpy && 0 != wnd) XDestroyWindow(dpy, wnd); + if (NULL != dpy && 0 != cmap) XFreeColormap(dpy, cmap); + if (NULL != vis) + XFree(vis); + else if (NULL != vi) + XFree(vi); + if (NULL != dpy) XCloseDisplay(dpy); +} + +#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ diff --git a/Windows/glew/auto/src/glewinfo_wgl.c b/Windows/glew/auto/src/glewinfo_wgl.c new file mode 100644 index 00000000..94056677 --- /dev/null +++ b/Windows/glew/auto/src/glewinfo_wgl.c @@ -0,0 +1,8 @@ +} + +/* ------------------------------------------------------------------------ */ + +#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA) + +static void wglewInfo () +{ diff --git a/Windows/glew/auto/src/glxew_head.h b/Windows/glew/auto/src/glxew_head.h new file mode 100644 index 00000000..16fdfa41 --- /dev/null +++ b/Windows/glew/auto/src/glxew_head.h @@ -0,0 +1,106 @@ +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Xmd.h> +#include <GL/glew.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + diff --git a/Windows/glew/auto/src/glxew_mid.h b/Windows/glew/auto/src/glxew_mid.h new file mode 100644 index 00000000..7fcf5d63 --- /dev/null +++ b/Windows/glew/auto/src/glxew_mid.h @@ -0,0 +1,4 @@ +/* ------------------------------------------------------------------------- */ + +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT diff --git a/Windows/glew/auto/src/glxew_tail.h b/Windows/glew/auto/src/glxew_tail.h new file mode 100644 index 00000000..05ff1b1d --- /dev/null +++ b/Windows/glew/auto/src/glxew_tail.h @@ -0,0 +1,20 @@ +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY glxewInit (); +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#ifndef GLXEW_GET_VAR +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLXEW_GET_FUN +#define GLXEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/Windows/glew/auto/src/header.html b/Windows/glew/auto/src/header.html new file mode 100644 index 00000000..2505b91e --- /dev/null +++ b/Windows/glew/auto/src/header.html @@ -0,0 +1,98 @@ +<!-- begin header.html --> +<!-- +The OpenGL Extension Wrangler Library +Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net> +Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> +Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +--> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd"> +<html> +<head> +<title>GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + diff --git a/Windows/glew/auto/src/khronos_license.h b/Windows/glew/auto/src/khronos_license.h new file mode 100644 index 00000000..420cd722 --- /dev/null +++ b/Windows/glew/auto/src/khronos_license.h @@ -0,0 +1,23 @@ +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + diff --git a/Windows/glew/auto/src/mesa_license.h b/Windows/glew/auto/src/mesa_license.h new file mode 100644 index 00000000..3350cca3 --- /dev/null +++ b/Windows/glew/auto/src/mesa_license.h @@ -0,0 +1,24 @@ +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + diff --git a/Windows/glew/auto/src/visualinfo.rc b/Windows/glew/auto/src/visualinfo.rc new file mode 100644 index 00000000..5719592b --- /dev/null +++ b/Windows/glew/auto/src/visualinfo.rc @@ -0,0 +1,123 @@ + +#include + +#ifdef _DEBUG +# define FILENAME "visualinfod.exe" +#else +# define FILENAME "visualinfo.exe" +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +VS_VERSION_INFO VERSIONINFO +FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", + "The OpenGL Extension Wrangler Library\r\n" + "Copyright (C) 2002-2008, Milan Ikits \r\n" + "Copyright (C) 2002-2008, Marcelo E. Magallon \r\n" + "Copyright (C) 2002, Lev Povalahev\r\n" + "All rights reserved.\r\n" + "\r\n" + "Redistribution and use in source and binary forms, with or without \r\n" + "modification, are permitted provided that the following conditions are met:\r\n" + "\r\n" + "* Redistributions of source code must retain the above copyright notice, \r\n" + " this list of conditions and the following disclaimer.\r\n" + "* Redistributions in binary form must reproduce the above copyright notice, \r\n" + " this list of conditions and the following disclaimer in the documentation \r\n" + " and/or other materials provided with the distribution.\r\n" + "* The name of the author may be used to endorse or promote products \r\n" + " derived from this software without specific prior written permission.\r\n" + "\r\n" + "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n" + "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n" + "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n" + "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n" + "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n" + "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n" + "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n" + "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n" + "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n" + "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n" + "THE POSSIBILITY OF SUCH DAMAGE.\r\n" + "\r\n" + "\r\n" + "Mesa 3-D graphics library\r\n" + "\r\n" + "Version: 7.0\r\n" + "\r\n" + "Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n" + "\r\n" + "Permission is hereby granted, free of charge, to any person obtaining a\r\n" + "copy of this software and associated documentation files (the ''Software''),\r\n" + "to deal in the Software without restriction, including without limitation\r\n" + "the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n" + "and/or sell copies of the Software, and to permit persons to whom the\r\n" + "Software is furnished to do so, subject to the following conditions:\r\n" + "\r\n" + "The above copyright notice and this permission notice shall be included\r\n" + "in all copies or substantial portions of the Software.\r\n" + "\r\n" + "THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n" + "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n" + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n" + "BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n" + "AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n" + "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n" + "\r\n" + "\r\n" + "Copyright (c) 2007 The Khronos Group Inc.\r\n" + "\r\n" + "Permission is hereby granted, free of charge, to any person obtaining a\r\n" + "copy of this software and/or associated documentation files (the\r\n" + "''Materials''), to deal in the Materials without restriction, including\r\n" + "without limitation the rights to use, copy, modify, merge, publish,\r\n" + "distribute, sublicense, and/or sell copies of the Materials, and to\r\n" + "permit persons to whom the Materials are furnished to do so, subject to\r\n" + "the following conditions:\r\n" + "\r\n" + "The above copyright notice and this permission notice shall be included\r\n" + "in all copies or substantial portions of the Materials.\r\n" + "\r\n" + "THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n" + "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n" + "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n" + "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n" + "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n" + "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n" + "MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "Utility for listing pixelformat capabilities\0" + VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "InternalName", "visualinfo\0" + VALUE "LegalCopyright", "© 2002-2008 Milan Ikits & Marcelo Magallon\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", FILENAME "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "The OpenGL Extension Wrangler Library\0" + VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/Windows/glew/auto/src/wglew_head.h b/Windows/glew/auto/src/wglew_head.h new file mode 100644 index 00000000..df885039 --- /dev/null +++ b/Windows/glew/auto/src/wglew_head.h @@ -0,0 +1,36 @@ +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + diff --git a/Windows/glew/auto/src/wglew_mid.h b/Windows/glew/auto/src/wglew_mid.h new file mode 100644 index 00000000..25b1037b --- /dev/null +++ b/Windows/glew/auto/src/wglew_mid.h @@ -0,0 +1,4 @@ +/* ------------------------------------------------------------------------- */ + +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT diff --git a/Windows/glew/auto/src/wglew_tail.h b/Windows/glew/auto/src/wglew_tail.h new file mode 100644 index 00000000..89711581 --- /dev/null +++ b/Windows/glew/auto/src/wglew_tail.h @@ -0,0 +1,22 @@ +/* ------------------------------------------------------------------------- */ + +GLEWAPI GLenum GLEWAPIENTRY wglewInit (); +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#ifndef WGLEW_GET_VAR +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef WGLEW_GET_FUN +#define WGLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/Windows/glew/config/Makefile.cygming b/Windows/glew/config/Makefile.cygming new file mode 100644 index 00000000..dcd7b21c --- /dev/null +++ b/Windows/glew/config/Makefile.cygming @@ -0,0 +1,21 @@ +NAME = glew32 +GLEW_DEST = /usr +BINDIR = /usr/bin +LIBDIR = /usr/lib/mingw +INCDIR = /usr/include/mingw/GL +# use gcc for linking, with ld it does not work +CC := gcc -mno-cygwin +LD := gcc -mno-cygwin +LN := +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +LDFLAGS.EXTRA = -L$(LIBDIR) +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +LDFLAGS.EXTRA += -nostdlib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken +LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.cygwin b/Windows/glew/config/Makefile.cygwin new file mode 100644 index 00000000..bc7e2fd2 --- /dev/null +++ b/Windows/glew/config/Makefile.cygwin @@ -0,0 +1,19 @@ +NAME = GLEW +GLEW_DEST ?= /usr +# use gcc for linking, with ld it does not work +CC := cc +LD := cc +LN := +LDFLAGS.EXTRA = +LIBDIR = $(GLEW_DEST)/lib +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = cyg$(NAME)-$(GLEW_MAJOR)-$(GLEW_MINOR).dll +LIB.DEVLNK = lib$(NAME).dll.a +LIB.SHARED = cyg$(NAME)-$(GLEW_MAJOR)-$(GLEW_MINOR).dll +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.darwin b/Windows/glew/config/Makefile.darwin new file mode 100644 index 00000000..8030f054 --- /dev/null +++ b/Windows/glew/config/Makefile.darwin @@ -0,0 +1,27 @@ +GLEW_DEST = /usr/local +NAME = $(GLEW_NAME) +CC = cc +LD = cc +CFLAGS.EXTRA += -dynamic -fno-common +CFLAGS.EXTRA += -pedantic +CFLAGS.EXTRA += -fPIC +LDFLAGS.EXTRA = +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -std=c99 +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 +else +CFLAGS.EXTRA += -std=c89 +GLEW_NO_GLU = -DGLEW_NO_GLU +LDFLAGS.GL = -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -Os +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/Windows/glew/config/Makefile.darwin-gcc6 b/Windows/glew/config/Makefile.darwin-gcc6 new file mode 100644 index 00000000..ecb61b38 --- /dev/null +++ b/Windows/glew/config/Makefile.darwin-gcc6 @@ -0,0 +1,31 @@ +# For building with Brew gcc: +# $ brew install gcc +GLEW_DEST = /usr/local +NAME = $(GLEW_NAME) +CC = gcc-6 +LD = gcc-6 +CFLAGS.EXTRA += -dynamic -fno-common +CFLAGS.EXTRA += -fPIC +# Lots of warnings with -pedantic +# warning: ISO C forbids conversion of object pointer to function pointer type +#CFLAGS.EXTRA += -pedantic +LDFLAGS.EXTRA = +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -std=c99 +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 +else +CFLAGS.EXTRA += -std=c89 +GLEW_NO_GLU = -DGLEW_NO_GLU +LDFLAGS.GL = -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -Os +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/Windows/glew/config/Makefile.darwin-ppc b/Windows/glew/config/Makefile.darwin-ppc new file mode 100644 index 00000000..7a417361 --- /dev/null +++ b/Windows/glew/config/Makefile.darwin-ppc @@ -0,0 +1,30 @@ +# Note: Mac PPC is obsolete but the configuration +# is here for reference. +GLEW_DEST = /usr/local +NAME = $(GLEW_NAME) +CC = cc +LD = cc +CFLAGS.EXTRA += -arch ppc +CFLAGS.EXTRA += -dynamic -fno-common +CFLAGS.EXTRA += -pedantic +CFLAGS.EXTRA += -fPIC +LDFLAGS.EXTRA = -arch ppc +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -std=c99 +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 +else +CFLAGS.EXTRA += -std=c89 +GLEW_NO_GLU = -DGLEW_NO_GLU +LDFLAGS.GL = -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -Os +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/Windows/glew/config/Makefile.darwin-universal b/Windows/glew/config/Makefile.darwin-universal new file mode 100644 index 00000000..f2412e36 --- /dev/null +++ b/Windows/glew/config/Makefile.darwin-universal @@ -0,0 +1,33 @@ +# +# Needs to be clang toolchain for universal: -arch i386 -arch x86_64 +# +GLEW_DEST = /usr/local +NAME = $(GLEW_NAME) +CC = cc +LD = cc +AR = +LIBTOOL = libtool -static -o +STRIP = +CFLAGS.EXTRA = -dynamic -fno-common +CFLAGS.EXTRA += -pedantic +CFLAGS.EXTRA += -fPIC +CFLAGS.EXTRA += -arch i386 -arch x86_64 +LDFLAGS.EXTRA = -arch i386 -arch x86_64 +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -std=c99 +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 +else +CFLAGS.EXTRA += -std=c89 +GLEW_NO_GLU = -DGLEW_NO_GLU +LDFLAGS.GL = -framework OpenGL +endif +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -Os +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/Windows/glew/config/Makefile.darwin-x86_64 b/Windows/glew/config/Makefile.darwin-x86_64 new file mode 100644 index 00000000..dbed9679 --- /dev/null +++ b/Windows/glew/config/Makefile.darwin-x86_64 @@ -0,0 +1,28 @@ +GLEW_DEST = /usr/local +NAME = $(GLEW_NAME) +CC = cc +LD = cc +CFLAGS.EXTRA += -arch x86_64 +CFLAGS.EXTRA += -dynamic -fno-common +CFLAGS.EXTRA += -pedantic +CFLAGS.EXTRA += -fPIC +LDFLAGS.EXTRA = -arch x86_64 +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -std=c99 +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11 +else +CFLAGS.EXTRA += -std=c89 +GLEW_NO_GLU = -DGLEW_NO_GLU +LDFLAGS.GL = -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -Os +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/Windows/glew/config/Makefile.fedora-mingw32 b/Windows/glew/config/Makefile.fedora-mingw32 new file mode 100644 index 00000000..9bad92a3 --- /dev/null +++ b/Windows/glew/config/Makefile.fedora-mingw32 @@ -0,0 +1,12 @@ +# For cross-compiling from Linux to Windows x86 using mingw32 +# http://www.mingw.org/ +# +# $ make SYSTEM=fedora-mingw32 + +include config/Makefile.linux-mingw32 + +CC := i686-pc-mingw32-gcc +LD := i686-pc-mingw32-ld +LDFLAGS.GL += -L/usr/i686-pc-mingw32/sys-root/mingw/lib +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +LDFLAGS.EXTRA += -nostdlib diff --git a/Windows/glew/config/Makefile.freebsd b/Windows/glew/config/Makefile.freebsd new file mode 100644 index 00000000..4fb9b6ad --- /dev/null +++ b/Windows/glew/config/Makefile.freebsd @@ -0,0 +1,17 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +CFLAGS.EXTRA += -I/usr/X11R6/include -fPIC +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.gnu b/Windows/glew/config/Makefile.gnu new file mode 100644 index 00000000..8d4f07ee --- /dev/null +++ b/Windows/glew/config/Makefile.gnu @@ -0,0 +1,17 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +CFLAGS.EXTRA += -fPIC +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.haiku b/Windows/glew/config/Makefile.haiku new file mode 100644 index 00000000..b8b7bd11 --- /dev/null +++ b/Windows/glew/config/Makefile.haiku @@ -0,0 +1,20 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc + +LDFLAGS.GL = -lGL +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic + +NAME = GLEW +WARN = -Wall -W +POPT = -O2 + +BIN.SUFFIX = + +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) + diff --git a/Windows/glew/config/Makefile.irix b/Windows/glew/config/Makefile.irix new file mode 100644 index 00000000..ef8f830e --- /dev/null +++ b/Windows/glew/config/Makefile.irix @@ -0,0 +1,17 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +ABI = -64# -n32 +CC += $(ABI) +LD += $(ABI) +LDFLAGS.EXTRA = +LDFLAGS.GL = -lGL -lXext -lX11 +NAME = GLEW +WARN = -fullwarn -woff 1110,1498 +POPT = -O2 -OPT:Olimit=0 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.kfreebsd b/Windows/glew/config/Makefile.kfreebsd new file mode 100644 index 00000000..e2ff5c3d --- /dev/null +++ b/Windows/glew/config/Makefile.kfreebsd @@ -0,0 +1,17 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +CFLAGS.EXTRA += -fPIC +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname $(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.linux b/Windows/glew/config/Makefile.linux new file mode 100644 index 00000000..50b813c5 --- /dev/null +++ b/Windows/glew/config/Makefile.linux @@ -0,0 +1,34 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +M_ARCH ?= $(shell uname -m) +ARCH64 = false +ifeq (x86_64,${M_ARCH}) + ARCH64 = true +endif +ifeq (ppc64,${M_ARCH}) + ARCH64 = true +endif +ifeq (${ARCH64},true) + LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64 + LIBDIR = $(GLEW_DEST)/lib64 +else + LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib + LIBDIR = $(GLEW_DEST)/lib +endif +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +CFLAGS.EXTRA += -fPIC +CFLAGS.EXTRA += -Wcast-qual +CFLAGS.EXTRA += -ansi -pedantic +CFLAGS.EXTRA += -fno-stack-protector +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.linux-clang b/Windows/glew/config/Makefile.linux-clang new file mode 100644 index 00000000..2992b895 --- /dev/null +++ b/Windows/glew/config/Makefile.linux-clang @@ -0,0 +1,34 @@ +NAME = $(GLEW_NAME) +CC = clang +LD = clang +M_ARCH ?= $(shell uname -m) +ARCH64 = false +ifeq (x86_64,${M_ARCH}) + ARCH64 = true +endif +ifeq (ppc64,${M_ARCH}) + ARCH64 = true +endif +ifeq (${ARCH64},true) + LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64 + LIBDIR = $(GLEW_DEST)/lib64 +else + LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib + LIBDIR = $(GLEW_DEST)/lib +endif +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +CFLAGS.EXTRA += -fPIC +CFLAGS.EXTRA += -Wcast-qual +CFLAGS.EXTRA += -ansi -pedantic +CFLAGS.EXTRA += -fno-stack-protector +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.linux-clang-egl b/Windows/glew/config/Makefile.linux-clang-egl new file mode 100644 index 00000000..ca06419b --- /dev/null +++ b/Windows/glew/config/Makefile.linux-clang-egl @@ -0,0 +1,4 @@ +include config/Makefile.linux-clang + +LDFLAGS.GL = -lEGL -lGL +CFLAGS.EXTRA += -DGLEW_EGL diff --git a/Windows/glew/config/Makefile.linux-egl b/Windows/glew/config/Makefile.linux-egl new file mode 100644 index 00000000..bcdc3cb0 --- /dev/null +++ b/Windows/glew/config/Makefile.linux-egl @@ -0,0 +1,4 @@ +include config/Makefile.linux + +LDFLAGS.GL = -lEGL -lGL +CFLAGS.EXTRA += -DGLEW_EGL diff --git a/Windows/glew/config/Makefile.linux-mingw-w64 b/Windows/glew/config/Makefile.linux-mingw-w64 new file mode 100644 index 00000000..175f5a93 --- /dev/null +++ b/Windows/glew/config/Makefile.linux-mingw-w64 @@ -0,0 +1,22 @@ +# For cross-compiling from Linux to Windows x86 using mingw-w64 +# http://mingw-w64.sourceforge.net/ +# +# $ make SYSTEM=linux-mingw-w64 +# + +NAME := glew32 +CC := i686-w64-mingw32-gcc +LD := i686-w64-mingw32-ld +LN := +STRIP := +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +LDFLAGS.EXTRA += -nostdlib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken +LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.linux-mingw32 b/Windows/glew/config/Makefile.linux-mingw32 new file mode 100644 index 00000000..12dfb99a --- /dev/null +++ b/Windows/glew/config/Makefile.linux-mingw32 @@ -0,0 +1,22 @@ +# For cross-compiling from Linux to Windows x86 using mingw32 +# http://www.mingw.org/ +# +# $ make SYSTEM=linux-mingw32 + +NAME := glew32 +HOST := i586-mingw32msvc +CC := $(HOST)-gcc +LD := $(HOST)-ld +LN := +STRIP := +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +#LDFLAGS.EXTRA += -nostdlib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken +LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.linux-mingw64 b/Windows/glew/config/Makefile.linux-mingw64 new file mode 100644 index 00000000..f3e47a21 --- /dev/null +++ b/Windows/glew/config/Makefile.linux-mingw64 @@ -0,0 +1,22 @@ +# For cross-compiling from Linux to Windows amd64 using mingw32 +# http://www.mingw.org/ +# +# $ make SYSTEM=linux-mingw64 + +NAME := glew32 +HOST := i686-w64-mingw32 +CC := $(HOST)-gcc +LD := $(HOST)-ld +LN := +STRIP := +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +#LDFLAGS.EXTRA += -nostdlib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken +LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.linux-osmesa b/Windows/glew/config/Makefile.linux-osmesa new file mode 100644 index 00000000..c9578721 --- /dev/null +++ b/Windows/glew/config/Makefile.linux-osmesa @@ -0,0 +1,4 @@ +include config/Makefile.linux + +LDFLAGS.GL = -lOSMesa +CFLAGS.EXTRA += -DGLEW_OSMESA diff --git a/Windows/glew/config/Makefile.mingw b/Windows/glew/config/Makefile.mingw new file mode 100644 index 00000000..3f413ee6 --- /dev/null +++ b/Windows/glew/config/Makefile.mingw @@ -0,0 +1,17 @@ +NAME = glew32 +# use gcc for linking, with ld it does not work +CC := gcc -fno-builtin +LD := gcc +LN := +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +LDFLAGS.EXTRA = -L/mingw/lib +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +LDFLAGS.EXTRA += -nostdlib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken +LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.mingw-win32 b/Windows/glew/config/Makefile.mingw-win32 new file mode 100644 index 00000000..347efd64 --- /dev/null +++ b/Windows/glew/config/Makefile.mingw-win32 @@ -0,0 +1,5 @@ +include config/Makefile.mingw + +POPT := -march=i686 -mtune=generic -O2 +CFLAGS.EXTRA += -m32 +LDFLAGS.EXTRA += -m32 diff --git a/Windows/glew/config/Makefile.msys b/Windows/glew/config/Makefile.msys new file mode 100644 index 00000000..b5187afd --- /dev/null +++ b/Windows/glew/config/Makefile.msys @@ -0,0 +1,19 @@ +NAME = glew32 +# use gcc for linking, with ld it does not work +CC := gcc +LD := gcc +LN := +CFLAGS.EXTRA += -D_WIN32 +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +LDFLAGS.EXTRA = +CFLAGS.EXTRA += -fno-builtin -fno-stack-protector +LDFLAGS.EXTRA += -nostdlib +LIBDIR = $(GLEW_DEST)/bin +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken +LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) diff --git a/Windows/glew/config/Makefile.msys-win32 b/Windows/glew/config/Makefile.msys-win32 new file mode 100644 index 00000000..160d3ebf --- /dev/null +++ b/Windows/glew/config/Makefile.msys-win32 @@ -0,0 +1,5 @@ +include config/Makefile.msys + +POPT := -march=i686 -mtune=generic -O2 +CFLAGS.EXTRA += -m32 +LDFLAGS.EXTRA += -m32 diff --git a/Windows/glew/config/Makefile.msys-win64 b/Windows/glew/config/Makefile.msys-win64 new file mode 100644 index 00000000..c1c785a7 --- /dev/null +++ b/Windows/glew/config/Makefile.msys-win64 @@ -0,0 +1,5 @@ +include config/Makefile.msys + +POPT := -mtune=generic -O2 +CFLAGS.EXTRA += -m64 +LDFLAGS.EXTRA += -m64 diff --git a/Windows/glew/config/Makefile.nacl-32 b/Windows/glew/config/Makefile.nacl-32 new file mode 100644 index 00000000..2182ceeb --- /dev/null +++ b/Windows/glew/config/Makefile.nacl-32 @@ -0,0 +1,31 @@ +NAME = $(REGAL_NAME) + +M_PREFIX = i686 +M_NAME ?= $(shell uname -s) +ifeq (Linux,${M_NAME}) +M_PREFIX = i686 +endif + +CC = $(M_PREFIX)-nacl-gcc +CXX = $(M_PREFIX)-nacl-g++ +LD = $(M_PREFIX)-nacl-ld +STRIP ?= +EXT.DYNAMIC = so +LDFLAGS.EXTRA = +LIBDIR = +CFLAGS.EXTRA += -fPIC +CFLAGS.EXTRA += -m32 +LDFLAGS.EXTRA += -melf_nacl +LDFLAGS.GL = +LDFLAGS.GLU = -lRegalGLU +LDFLAGS.GLUT = -lRegalGLUT +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = -shared +WARN = -Wall -W -Wno-unused-parameter +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -soname=$(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.nacl-64 b/Windows/glew/config/Makefile.nacl-64 new file mode 100644 index 00000000..d6135ea7 --- /dev/null +++ b/Windows/glew/config/Makefile.nacl-64 @@ -0,0 +1,31 @@ +NAME = $(REGAL_NAME) + +M_PREFIX = i686 +M_NAME ?= $(shell uname -s) +ifeq (Linux,${M_NAME}) +M_PREFIX = i686 +endif + +CC = $(M_PREFIX)-nacl-gcc +CXX = $(M_PREFIX)-nacl-g++ +LD = $(M_PREFIX)-nacl-ld +STRIP ?= +EXT.DYNAMIC = so +LDFLAGS.EXTRA = +LIBDIR = +CFLAGS.EXTRA += -fPIC +CFLAGS.EXTRA += -m64 +LDFLAGS.EXTRA += -melf64_nacl +LDFLAGS.GL = +LDFLAGS.GLU = -lRegalGLU +LDFLAGS.GLUT = -lRegalGLUT +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = -shared +WARN = -Wall -W -Wno-unused-parameter +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -soname=$(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.netbsd b/Windows/glew/config/Makefile.netbsd new file mode 100644 index 00000000..d2db8a99 --- /dev/null +++ b/Windows/glew/config/Makefile.netbsd @@ -0,0 +1,17 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +LDFLAGS.EXTRA = -L/usr/X11R7/lib -R /usr/X11R7/lib +LDFLAGS.GL = -lGL -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +CFLAGS.EXTRA += -I/usr/X11R7/include -fPIC +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.openbsd b/Windows/glew/config/Makefile.openbsd new file mode 100644 index 00000000..b64910ce --- /dev/null +++ b/Windows/glew/config/Makefile.openbsd @@ -0,0 +1,17 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lGLU -lGL -lX11 -lm +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +CFLAGS.EXTRA += -I/usr/X11R6/include +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) diff --git a/Windows/glew/config/Makefile.solaris b/Windows/glew/config/Makefile.solaris new file mode 100644 index 00000000..bb2455fe --- /dev/null +++ b/Windows/glew/config/Makefile.solaris @@ -0,0 +1,14 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +CFLAGS.EXTRA = -I/usr/openwin/include -Kpic +LDFLAGS.SO = -G +LDFLAGS.EXTRA = -L/usr/openwin/lib +LDFLAGS.GL = -lGL -lX11 +NAME = GLEW +BIN.SUFFIX = +POPT = -xO2 +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a diff --git a/Windows/glew/config/Makefile.solaris-gcc b/Windows/glew/config/Makefile.solaris-gcc new file mode 100644 index 00000000..24a8531d --- /dev/null +++ b/Windows/glew/config/Makefile.solaris-gcc @@ -0,0 +1,15 @@ +NAME = $(GLEW_NAME) +CC = gcc +LD = ld +CFLAGS.EXTRA = -I/usr/openwin/include -fPIC +LDFLAGS.SO = -G +LDFLAGS.EXTRA = -L/usr/openwin/lib +LDFLAGS.GL = -lGL -lX11 +NAME = GLEW +BIN.SUFFIX = +POPT = -O2 +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) diff --git a/Windows/glew/config/config.guess b/Windows/glew/config/config.guess new file mode 100644 index 00000000..bbd48b60 --- /dev/null +++ b/Windows/glew/config/config.guess @@ -0,0 +1,1462 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-01-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/Windows/glew/config/version b/Windows/glew/config/version new file mode 100644 index 00000000..66d3d740 --- /dev/null +++ b/Windows/glew/config/version @@ -0,0 +1,7 @@ +GLEW_MAJOR = 2 +GLEW_MINOR = 1 +GLEW_MICRO = 0 +GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO) +GLEW_NAME = GLEW +SO_MAJOR = $(GLEW_MAJOR).$(GLEW_MINOR) +SO_VERSION = $(GLEW_VERSION) diff --git a/Windows/glew/doc/advanced.html b/Windows/glew/doc/advanced.html new file mode 100644 index 00000000..8e617b6e --- /dev/null +++ b/Windows/glew/doc/advanced.html @@ -0,0 +1,232 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Automatic Code Generation

+ +

+Starting from release 1.1.0, the source code and parts of the +documentation are automatically generated from the extension +specifications in a two-step process. In the first step, +specification files from the OpenGL registry are downloaded and +parsed. Skeleton descriptors are created for each extension. These +descriptors contain all necessary information for creating the source +code and documentation in a simple and compact format, including the +name of the extension, url link to the specification, tokens, function +declarations, typedefs and struct definitions. In the second step, +the header files as well as the library and glewinfo source are +generated from the descriptor files. The code generation scripts are +located in the auto subdirectory. +

+ +

+The code generation scripts require GNU make, wget, and perl. On +Windows, the simplest way to get access to these tools is to install +Cygwin, but make sure that the +root directory is mounted in binary mode. The makefile in the +auto directory provides the following build targets: +

+ + + + + + + + + + + + +
makeCreate the source files from the descriptors.
If the +descriptors do not exist, create them from the spec files.
If the spec +files do not exist, download them from the OpenGL repository.
make cleanDelete the source files.
make clobberDelete the source files and the descriptors.
make destroyDelete the source files, the descriptors, and the spec files.
make customCreate the source files for the extensions +listed in auto/custom.txt.
See "Custom Code +Generation" below for more details.
+ +

Adding a New Extension

+ +

+To add a new extension, create a descriptor file for the extension in +auto/core and rerun the code generation scripts by typing +make clean; make in the auto directory. +

+ +

+The format of the descriptor file is given below. Items in +brackets are optional. +

+ +

+<Extension Name>
+[<URL of Specification File>]
+    [<Token Name> <Token Value>]
+    [<Token Name> <Token Value>]
+    ...
+    [<Typedef>]
+    [<Typedef>]
+    ...
+    [<Function Signature>]
+    [<Function Signature>]
+    ...
+ +

+ + + +

+Take a look at one of the files in auto/core for an +example. Note that typedefs and function signatures should not be +terminated with a semicolon. +

+ +

Custom Code Generation

+

+Starting from GLEW 1.3.0, it is possible to control which extensions +to include in the libarary by specifying a list in +auto/custom.txt. This is useful when you do not need all the +extensions and would like to reduce the size of the source files. +Type make clean; make custom in the auto directory +to rerun the scripts with the custom list of extensions. +

+ +

+For example, the following is the list of extensions needed to get GLEW and the +utilities to compile. +

+ +

+WGL_ARB_extensions_string
+WGL_ARB_multisample
+WGL_ARB_pixel_format
+WGL_ARB_pbuffer
+WGL_EXT_extensions_string
+WGL_ATI_pixel_format_float
+WGL_NV_float_buffer
+

+ +

Separate Namespace

+ +

+To avoid name clashes when linking with libraries that include the +same symbols, extension entry points are declared in a separate +namespace (release 1.1.0 and up). This is achieved by aliasing OpenGL +function names to their GLEW equivalents. For instance, +glFancyFunction is simply an alias to +glewFancyFunction. The separate namespace does not effect +token and function pointer definitions. +

+ +

Known Issues

+ +

+GLEW requires GLX 1.2 for compatibility with GLUT. +

+ + +
+ + diff --git a/Windows/glew/doc/basic.html b/Windows/glew/doc/basic.html new file mode 100644 index 00000000..bc3497bc --- /dev/null +++ b/Windows/glew/doc/basic.html @@ -0,0 +1,282 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Initializing GLEW

+

+First you need to create a valid OpenGL rendering context and call +glewInit() to initialize the extension entry points. If +glewInit() returns GLEW_OK, the initialization +succeeded and you can use the available extensions as well as core +OpenGL functionality. For example: +

+ +

+#include <GL/glew.h>
+#include <GL/glut.h>
+...
+glutInit(&argc, argv);
+glutCreateWindow("GLEW Test");
+GLenum err = glewInit();
+if (GLEW_OK != err)
+{
+  /* Problem: glewInit failed, something is seriously wrong. */
+  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
+  ...
+}
+fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
+

+ +

Checking for Extensions

+ +

+Starting from GLEW 1.1.0, you can find out if a particular extension +is available on your platform by querying globally defined variables +of the form GLEW_{extension_name}: +

+ +

+if (GLEW_ARB_vertex_program)
+{
+  /* It is safe to use the ARB_vertex_program extension here. */
+  glGenProgramsARB(...);
+}
+

+ +

+In GLEW 1.0.x, a global structure was used for this task. To ensure +binary compatibility between releases, the struct was replaced with a +set of variables. +

+ +

+You can also check for core OpenGL functionality. For example, to +see if OpenGL 1.3 is supported, do the following: +

+ +

+if (GLEW_VERSION_1_3)
+{
+  /* Yay! OpenGL 1.3 is supported! */
+}
+

+ +

+In general, you can check if GLEW_{extension_name} or +GLEW_VERSION_{version} is true or false. +

+ +

+It is also possible to perform extension checks from string +input. Starting from the 1.3.0 release, use glewIsSupported +to check if the required core or extension functionality is +available: +

+ +

+if (glewIsSupported("GL_VERSION_1_4  GL_ARB_point_sprite"))
+{
+  /* Great, we have OpenGL 1.4 + point sprites. */
+}
+

+ +

+For extensions only, glewGetExtension provides a slower alternative +(GLEW 1.0.x-1.2.x). Note that in the 1.3.0 release +glewGetExtension was replaced with +glewIsSupported. +

+ +

+if (glewGetExtension("GL_ARB_fragment_program"))
+{
+  /* Looks like ARB_fragment_program is supported. */
+}
+

+ +

Experimental Drivers

+ +

+GLEW obtains information on the supported extensions from the graphics +driver. Experimental or pre-release drivers, however, might not +report every available extension through the standard mechanism, in +which case GLEW will report it unsupported. To circumvent this +situation, the glewExperimental global switch can be turned +on by setting it to GL_TRUE before calling +glewInit(), which ensures that all extensions with valid +entry points will be exposed. +

+ +

Platform Specific Extensions

+ +

+Platform specific extensions are separated into two header files: +wglew.h and glxew.h, which define the available +WGL and GLX extensions. To determine if a certain +extension is supported, query WGLEW_{extension name} or +GLXEW_{extension_name}. For example: +

+ +

+#include <GL/wglew.h>
+
+if (WGLEW_ARB_pbuffer)
+{
+  /* OK, we can use pbuffers. */
+}
+else
+{
+  /* Sorry, pbuffers will not work on this platform. */
+}
+

+ +

+Alternatively, use wglewIsSupported or +glxewIsSupported to check for extensions from a string: +

+ +

+if (wglewIsSupported("WGL_ARB_pbuffer"))
+{
+  /* OK, we can use pbuffers. */
+}
+

+ +

Utilities

+ +

+GLEW provides two command-line utilities: one for creating a list of +available extensions and visuals; and another for verifying extension +entry points. +

+ +

visualinfo: extensions and visuals

+ +

+visualinfo is an extended version of glxinfo. The +Windows version creates a file called visualinfo.txt, which +contains a list of available OpenGL, WGL, and GLU extensions as well +as a table of visuals aka. pixel formats. Pbuffer and MRT capable +visuals are also included. For additional usage information, type +visualinfo -h. +

+ +

glewinfo: extension verification utility

+ +

+glewinfo allows you to verify the entry points for the +extensions supported on your platform. The Windows version +reports the results to a text file called glewinfo.txt. The +Unix version prints the results to stdout. +

+ +

Windows usage:

+
glewinfo [-pf <id>]
+ +

where <id> is the pixel format id for which the +capabilities are displayed.

+ +

Unix usage:

+
glewinfo [-display <dpy>] [-visual <id>]
+ +

where <dpy> is the X11 display and <id> is +the visual id for which the capabilities are displayed.

+ + +
+ + diff --git a/Windows/glew/doc/build.html b/Windows/glew/doc/build.html new file mode 100644 index 00000000..8dd55808 --- /dev/null +++ b/Windows/glew/doc/build.html @@ -0,0 +1,151 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Building GLEW

+ +

Windows

+ +

A MS Visual Studio project is provided in the build/vc6 directory.

+

Pre-built shared and static libraries are also available for download.

+ +

Makefile

+ +

For platforms other than MS Windows, the provided Makefile is used.

+ +

Command-line variables

+ + + + + + +
SYSTEMautoTarget system to build: darwin, linux, solaris, etc.
For a full list of supported targets: ls config/Makefile.*
+config.guess is used to auto detect, as necessary.
GLEW_DEST/usrBase directory for installation.
+ +

Make targets

+ + + + + + + + + + + + +
allBuild everything.
glew.libBuild static and dynamic GLEW libraries.
glew.lib.mxBuild static and dynamic GLEWmx libraries.
glew.binBuild glewinfo and visualinfo utilities.
cleanDelete temporary and built files.
install.allInstall everything.
installInstall GLEW libraries.
install.mxInstall GLEWmx libraries.
install.binInstall glewinfo and visualinfo utilities.
uninstallDelete installed files.
+ +

Requirements

+ +
    +
  • GNU make
  • +
  • perl
  • +
  • wget
  • +
  • GNU sed
  • +
  • gcc compiler
  • +
  • git
  • +
+ +Ubuntu:
sudo apt-get install libXmu-dev libXi-dev libgl-dev dos2unix git wget
+Fedora:
sudo yum install libXmu-devel libXi-devel libGL-devel dos2unix git wget
+ +
+ + diff --git a/Windows/glew/doc/credits.html b/Windows/glew/doc/credits.html new file mode 100644 index 00000000..ecf88b13 --- /dev/null +++ b/Windows/glew/doc/credits.html @@ -0,0 +1,104 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

+Author, copyright and licensing information on github.

+ +
+ + diff --git a/Windows/glew/doc/github.png b/Windows/glew/doc/github.png new file mode 100644 index 00000000..540f7c0b Binary files /dev/null and b/Windows/glew/doc/github.png differ diff --git a/Windows/glew/doc/glew.css b/Windows/glew/doc/glew.css new file mode 100644 index 00000000..1bb7dd17 --- /dev/null +++ b/Windows/glew/doc/glew.css @@ -0,0 +1,187 @@ +h1 +{ + color: black; + font: 23px "Verdana", "Arial", "Helvetica", sans-serif; + font-weight: bold; + text-align: center; + margin-top: 12px; + margin-bottom: 18px; +} + +h2 +{ + color: black; + font: 18px "Verdana", "Arial", "Helvetica", sans-serif; + font-weight: bold; + text-align: left; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 18px; + margin-bottom: 12px; +} + +h3 +{ + color: black; + font: 17px "Verdana", "Arial", "Helvetica", sans-serif; + text-align: left; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 12px; + margin-bottom: 12px; +} + +small +{ + font: 8pt "Verdana", "Arial", "Helvetica", sans-serif; +} + +body +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: left; +} + +td +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; +} + +tt +{ + color: rgb(0,120,0); +} +/* color: maroon; */ + +td.num +{ + color: lightgrey; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: right; +} + +blockquote +{ + color: rgb(0,120,0); + background: #f0f0f0; + text-align: left; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 6px; + padding-bottom: 0px; + margin-top: 0px; + padding-top: 0px; + border-top: 0px; + border-width: 0px; +} + +pre +{ + color: rgb(0,120,0); + background: #f0f0f0; + text-align: left; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 6px; + padding-bottom: 0px; + margin-top: 0px; + padding-top: 0px; + border-top: 0px; + border-width: 0px; +} + +p +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: left; + margin-bottom: 0px; + padding-bottom: 6px; + margin-top: 0px; + padding-top: 0px; +} + +p.right +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: right; + margin-bottom: 0px; + padding-bottom: 6px; + margin-top: 0px; + padding-top: 0px; +} + +p.pre +{ + color: rgb(0,120,0); + font: 10pt "Courier New", "Courier", monospace; + background: #f0f0f0; + text-align: left; + margin-top: 0px; + margin-bottom: 6px; + margin-left: 40px; + margin-right: 40px; + padding-top: 0px; + padding-bottom: 6px; + padding-left: 6px; + padding-right: 6px; + border-top: 0px; + border-width: 0px; +} + +a:link +{ + color: rgb(0,0,139); + text-decoration: none; +} + +a:visited +{ + color: rgb(220,20,60); + text-decoration: none; +} + +a:hover +{ + color: rgb(220,20,60); + text-decoration: underline; + background: "#e8e8e8"; +} + +ul +{ + list-style-type: disc; + text-align: left; + margin-left: 40px; + margin-top: 0px; + padding-top: 0px; + margin-bottom: 0px; + padding-bottom: 3px; +} + +ul.none +{ + list-style-type: none; +} + +ol +{ + text-align: left; + margin-left: 40px; + margin-top: 0px; + padding-top: 0px; + margin-bottom: 0px; + padding-bottom: 12px; +} + +hr +{ + color: maroon; + background-color: maroon; + height: 1px; + border: 0px; + width: 80%; +} diff --git a/Windows/glew/doc/glew.html b/Windows/glew/doc/glew.html new file mode 100644 index 00000000..7216aac6 --- /dev/null +++ b/Windows/glew/doc/glew.html @@ -0,0 +1,924 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Supported OpenGL Extensions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1 3DFX_multisample
2 3DFX_tbuffer
3 3DFX_texture_compression_FXT1

4 AMD_blend_minmax_factor
5 AMD_compressed_3DC_texture
6 AMD_compressed_ATC_texture
7 AMD_conservative_depth
8 AMD_debug_output
9 AMD_depth_clamp_separate
10 AMD_draw_buffers_blend
11 AMD_framebuffer_sample_positions
12 AMD_gcn_shader
13 AMD_gpu_shader_half_float
14 AMD_gpu_shader_int16
15 AMD_gpu_shader_int64
16 AMD_interleaved_elements
17 AMD_multi_draw_indirect
18 AMD_name_gen_delete
19 AMD_occlusion_query_event
20 AMD_performance_monitor
21 AMD_pinned_memory
22 AMD_program_binary_Z400
23 AMD_query_buffer_object
24 AMD_sample_positions
25 AMD_seamless_cubemap_per_texture
26 AMD_shader_atomic_counter_ops
27 AMD_shader_ballot
28 AMD_shader_explicit_vertex_parameter
29 AMD_shader_stencil_export
30 AMD_shader_stencil_value_export
31 AMD_shader_trinary_minmax
32 AMD_sparse_texture
33 AMD_stencil_operation_extended
34 AMD_texture_gather_bias_lod
35 AMD_texture_texture4
36 AMD_transform_feedback3_lines_triangles
37 AMD_transform_feedback4
38 AMD_vertex_shader_layer
39 AMD_vertex_shader_tessellator
40 AMD_vertex_shader_viewport_index

41 ANDROID_extension_pack_es31a

42 ANGLE_depth_texture
43 ANGLE_framebuffer_blit
44 ANGLE_framebuffer_multisample
45 ANGLE_instanced_arrays
46 ANGLE_pack_reverse_row_order
47 ANGLE_program_binary
48 ANGLE_texture_compression_dxt1
49 ANGLE_texture_compression_dxt3
50 ANGLE_texture_compression_dxt5
51 ANGLE_texture_usage
52 ANGLE_timer_query
53 ANGLE_translated_shader_source

54 APPLE_aux_depth_stencil
55 APPLE_client_storage
56 APPLE_clip_distance
57 APPLE_color_buffer_packed_float
58 APPLE_copy_texture_levels
59 APPLE_element_array
60 APPLE_fence
61 APPLE_float_pixels
62 APPLE_flush_buffer_range
63 APPLE_framebuffer_multisample
64 APPLE_object_purgeable
65 APPLE_pixel_buffer
66 APPLE_rgb_422
67 APPLE_row_bytes
68 APPLE_specular_vector
69 APPLE_sync
70 APPLE_texture_2D_limited_npot
71 APPLE_texture_format_BGRA8888
72 APPLE_texture_max_level
73 APPLE_texture_packed_float
74 APPLE_texture_range
75 APPLE_transform_hint
76 APPLE_vertex_array_object
77 APPLE_vertex_array_range
78 APPLE_vertex_program_evaluators
79 APPLE_ycbcr_422

80 ARB_ES2_compatibility
81 ARB_ES3_1_compatibility
82 ARB_ES3_2_compatibility
83 ARB_ES3_compatibility
84 ARB_arrays_of_arrays
85 ARB_base_instance
86 ARB_bindless_texture
87 ARB_blend_func_extended
88 ARB_buffer_storage
89 ARB_cl_event
90 ARB_clear_buffer_object
91 ARB_clear_texture
92 ARB_clip_control
93 ARB_color_buffer_float
94 ARB_compatibility
95 ARB_compressed_texture_pixel_storage
96 ARB_compute_shader
97 ARB_compute_variable_group_size
98 ARB_conditional_render_inverted
99 ARB_conservative_depth
100 ARB_copy_buffer
101 ARB_copy_image
102 ARB_cull_distance
103 ARB_debug_output
104 ARB_depth_buffer_float
105 ARB_depth_clamp
106 ARB_depth_texture
107 ARB_derivative_control
108 ARB_direct_state_access
109 ARB_draw_buffers
110 ARB_draw_buffers_blend
111 ARB_draw_elements_base_vertex
112 ARB_draw_indirect
113 ARB_draw_instanced
114 ARB_enhanced_layouts
115 ARB_explicit_attrib_location
116 ARB_explicit_uniform_location
117 ARB_fragment_coord_conventions
118 ARB_fragment_layer_viewport
119 ARB_fragment_program
120 ARB_fragment_program_shadow
121 ARB_fragment_shader
122 ARB_fragment_shader_interlock
123 ARB_framebuffer_no_attachments
124 ARB_framebuffer_object
125 ARB_framebuffer_sRGB
126 ARB_geometry_shader4
127 ARB_get_program_binary
128 ARB_get_texture_sub_image
129 ARB_gl_spirv
130 ARB_gpu_shader5
131 ARB_gpu_shader_fp64
132 ARB_gpu_shader_int64
133 ARB_half_float_pixel
134 ARB_half_float_vertex
135 ARB_imaging
136 ARB_indirect_parameters
137 ARB_instanced_arrays
138 ARB_internalformat_query
139 ARB_internalformat_query2
140 ARB_invalidate_subdata
141 ARB_map_buffer_alignment
142 ARB_map_buffer_range
143 ARB_matrix_palette
144 ARB_multi_bind
145 ARB_multi_draw_indirect
146 ARB_multisample
147 ARB_multitexture
148 ARB_occlusion_query
149 ARB_occlusion_query2
150 ARB_parallel_shader_compile
151 ARB_pipeline_statistics_query
152 ARB_pixel_buffer_object
153 ARB_point_parameters
154 ARB_point_sprite
155 ARB_polygon_offset_clamp
156 ARB_post_depth_coverage
157 ARB_program_interface_query
158 ARB_provoking_vertex
159 ARB_query_buffer_object
160 ARB_robust_buffer_access_behavior
161 ARB_robustness
162 ARB_robustness_application_isolation
163 ARB_robustness_share_group_isolation
164 ARB_sample_locations
165 ARB_sample_shading
166 ARB_sampler_objects
167 ARB_seamless_cube_map
168 ARB_seamless_cubemap_per_texture
169 ARB_separate_shader_objects
170 ARB_shader_atomic_counter_ops
171 ARB_shader_atomic_counters
172 ARB_shader_ballot
173 ARB_shader_bit_encoding
174 ARB_shader_clock
175 ARB_shader_draw_parameters
176 ARB_shader_group_vote
177 ARB_shader_image_load_store
178 ARB_shader_image_size
179 ARB_shader_objects
180 ARB_shader_precision
181 ARB_shader_stencil_export
182 ARB_shader_storage_buffer_object
183 ARB_shader_subroutine
184 ARB_shader_texture_image_samples
185 ARB_shader_texture_lod
186 ARB_shader_viewport_layer_array
187 ARB_shading_language_100
188 ARB_shading_language_420pack
189 ARB_shading_language_include
190 ARB_shading_language_packing
191 ARB_shadow
192 ARB_shadow_ambient
193 ARB_sparse_buffer
194 ARB_sparse_texture
195 ARB_sparse_texture2
196 ARB_sparse_texture_clamp
197 ARB_spirv_extensions
198 ARB_stencil_texturing
199 ARB_sync
200 ARB_tessellation_shader
201 ARB_texture_barrier
202 ARB_texture_border_clamp
203 ARB_texture_buffer_object
204 ARB_texture_buffer_object_rgb32
205 ARB_texture_buffer_range
206 ARB_texture_compression
207 ARB_texture_compression_bptc
208 ARB_texture_compression_rgtc
209 ARB_texture_cube_map
210 ARB_texture_cube_map_array
211 ARB_texture_env_add
212 ARB_texture_env_combine
213 ARB_texture_env_crossbar
214 ARB_texture_env_dot3
215 ARB_texture_filter_anisotropic
216 ARB_texture_filter_minmax
217 ARB_texture_float
218 ARB_texture_gather
219 ARB_texture_mirror_clamp_to_edge
220 ARB_texture_mirrored_repeat
221 ARB_texture_multisample
222 ARB_texture_non_power_of_two
223 ARB_texture_query_levels
224 ARB_texture_query_lod
225 ARB_texture_rectangle
226 ARB_texture_rg
227 ARB_texture_rgb10_a2ui
228 ARB_texture_stencil8
229 ARB_texture_storage
230 ARB_texture_storage_multisample
231 ARB_texture_swizzle
232 ARB_texture_view
233 ARB_timer_query
234 ARB_transform_feedback2
235 ARB_transform_feedback3
236 ARB_transform_feedback_instanced
237 ARB_transform_feedback_overflow_query
238 ARB_transpose_matrix
239 ARB_uniform_buffer_object
240 ARB_vertex_array_bgra
241 ARB_vertex_array_object
242 ARB_vertex_attrib_64bit
243 ARB_vertex_attrib_binding
244 ARB_vertex_blend
245 ARB_vertex_buffer_object
246 ARB_vertex_program
247 ARB_vertex_shader
248 ARB_vertex_type_10f_11f_11f_rev
249 ARB_vertex_type_2_10_10_10_rev
250 ARB_viewport_array
251 ARB_window_pos

252 ARM_mali_program_binary
253 ARM_mali_shader_binary
254 ARM_rgba8
255 ARM_shader_framebuffer_fetch
256 ARM_shader_framebuffer_fetch_depth_stencil

257 ATIX_point_sprites
258 ATIX_texture_env_combine3
259 ATIX_texture_env_route
260 ATIX_vertex_shader_output_point_size

261 ATI_draw_buffers
262 ATI_element_array
263 ATI_envmap_bumpmap
264 ATI_fragment_shader
265 ATI_map_object_buffer
266 ATI_meminfo
267 ATI_pn_triangles
268 ATI_separate_stencil
269 ATI_shader_texture_lod
270 ATI_text_fragment_shader
271 ATI_texture_compression_3dc
272 ATI_texture_env_combine3
273 ATI_texture_float
274 ATI_texture_mirror_once
275 ATI_vertex_array_object
276 ATI_vertex_attrib_array_object
277 ATI_vertex_streams

278 EGL_KHR_context_flush_control
279 EGL_NV_robustness_video_memory_purge

280 EXT_422_pixels
281 EXT_Cg_shader
282 EXT_EGL_image_array
283 EXT_YUV_target
284 EXT_abgr
285 EXT_base_instance
286 EXT_bgra
287 EXT_bindable_uniform
288 EXT_blend_color
289 EXT_blend_equation_separate
290 EXT_blend_func_extended
291 EXT_blend_func_separate
292 EXT_blend_logic_op
293 EXT_blend_minmax
294 EXT_blend_subtract
295 EXT_buffer_storage
296 EXT_clear_texture
297 EXT_clip_cull_distance
298 EXT_clip_volume_hint
299 EXT_cmyka
300 EXT_color_buffer_float
301 EXT_color_buffer_half_float
302 EXT_color_subtable
303 EXT_compiled_vertex_array
304 EXT_compressed_ETC1_RGB8_sub_texture
305 EXT_conservative_depth
306 EXT_convolution
307 EXT_coordinate_frame
308 EXT_copy_image
309 EXT_copy_texture
310 EXT_cull_vertex
311 EXT_debug_label
312 EXT_debug_marker
313 EXT_depth_bounds_test
314 EXT_direct_state_access
315 EXT_discard_framebuffer
316 EXT_draw_buffers
317 EXT_draw_buffers2
318 EXT_draw_buffers_indexed
319 EXT_draw_elements_base_vertex
320 EXT_draw_instanced
321 EXT_draw_range_elements
322 EXT_external_buffer
323 EXT_float_blend
324 EXT_fog_coord
325 EXT_frag_depth
326 EXT_fragment_lighting
327 EXT_framebuffer_blit
328 EXT_framebuffer_multisample
329 EXT_framebuffer_multisample_blit_scaled
330 EXT_framebuffer_object
331 EXT_framebuffer_sRGB
332 EXT_geometry_point_size
333 EXT_geometry_shader
334 EXT_geometry_shader4
335 EXT_gpu_program_parameters
336 EXT_gpu_shader4
337 EXT_gpu_shader5
338 EXT_histogram
339 EXT_index_array_formats
340 EXT_index_func
341 EXT_index_material
342 EXT_index_texture
343 EXT_instanced_arrays
344 EXT_light_texture
345 EXT_map_buffer_range
346 EXT_memory_object
347 EXT_memory_object_fd
348 EXT_memory_object_win32
349 EXT_misc_attribute
350 EXT_multi_draw_arrays
351 EXT_multi_draw_indirect
352 EXT_multiple_textures
353 EXT_multisample
354 EXT_multisample_compatibility
355 EXT_multisampled_render_to_texture
356 EXT_multisampled_render_to_texture2
357 EXT_multiview_draw_buffers
358 EXT_packed_depth_stencil
359 EXT_packed_float
360 EXT_packed_pixels
361 EXT_paletted_texture
362 EXT_pixel_buffer_object
363 EXT_pixel_transform
364 EXT_pixel_transform_color_table
365 EXT_point_parameters
366 EXT_polygon_offset
367 EXT_polygon_offset_clamp
368 EXT_post_depth_coverage
369 EXT_provoking_vertex
370 EXT_pvrtc_sRGB
371 EXT_raster_multisample
372 EXT_read_format_bgra
373 EXT_render_snorm
374 EXT_rescale_normal
375 EXT_sRGB
376 EXT_sRGB_write_control
377 EXT_scene_marker
378 EXT_secondary_color
379 EXT_semaphore
380 EXT_semaphore_fd
381 EXT_semaphore_win32
382 EXT_separate_shader_objects
383 EXT_separate_specular_color
384 EXT_shader_framebuffer_fetch
385 EXT_shader_group_vote
386 EXT_shader_image_load_formatted
387 EXT_shader_image_load_store
388 EXT_shader_implicit_conversions
389 EXT_shader_integer_mix
390 EXT_shader_io_blocks
391 EXT_shader_non_constant_global_initializers
392 EXT_shader_pixel_local_storage
393 EXT_shader_pixel_local_storage2
394 EXT_shader_texture_lod
395 EXT_shadow_funcs
396 EXT_shadow_samplers
397 EXT_shared_texture_palette
398 EXT_sparse_texture
399 EXT_sparse_texture2
400 EXT_stencil_clear_tag
401 EXT_stencil_two_side
402 EXT_stencil_wrap
403 EXT_subtexture
404 EXT_texture
405 EXT_texture3D
406 EXT_texture_array
407 EXT_texture_buffer_object
408 EXT_texture_compression_astc_decode_mode
409 EXT_texture_compression_astc_decode_mode_rgb9e5
410 EXT_texture_compression_bptc
411 EXT_texture_compression_dxt1
412 EXT_texture_compression_latc
413 EXT_texture_compression_rgtc
414 EXT_texture_compression_s3tc
415 EXT_texture_cube_map
416 EXT_texture_cube_map_array
417 EXT_texture_edge_clamp
418 EXT_texture_env
419 EXT_texture_env_add
420 EXT_texture_env_combine
421 EXT_texture_env_dot3
422 EXT_texture_filter_anisotropic
423 EXT_texture_filter_minmax
424 EXT_texture_format_BGRA8888
425 EXT_texture_integer
426 EXT_texture_lod_bias
427 EXT_texture_mirror_clamp
428 EXT_texture_norm16
429 EXT_texture_object
430 EXT_texture_perturb_normal
431 EXT_texture_rectangle
432 EXT_texture_rg
433 EXT_texture_sRGB
434 EXT_texture_sRGB_R8
435 EXT_texture_sRGB_RG8
436 EXT_texture_sRGB_decode
437 EXT_texture_shared_exponent
438 EXT_texture_snorm
439 EXT_texture_storage
440 EXT_texture_swizzle
441 EXT_texture_type_2_10_10_10_REV
442 EXT_texture_view
443 EXT_timer_query
444 EXT_transform_feedback
445 EXT_unpack_subimage
446 EXT_vertex_array
447 EXT_vertex_array_bgra
448 EXT_vertex_array_setXXX
449 EXT_vertex_attrib_64bit
450 EXT_vertex_shader
451 EXT_vertex_weighting
452 EXT_win32_keyed_mutex
453 EXT_window_rectangles
454 EXT_x11_sync_object

455 GREMEDY_frame_terminator
456 GREMEDY_string_marker

457 HP_convolution_border_modes
458 HP_image_transform
459 HP_occlusion_test
460 HP_texture_lighting

461 IBM_cull_vertex
462 IBM_multimode_draw_arrays
463 IBM_rasterpos_clip
464 IBM_static_data
465 IBM_texture_mirrored_repeat
466 IBM_vertex_array_lists

467 INGR_color_clamp
468 INGR_interlace_read

469 INTEL_conservative_rasterization
470 INTEL_fragment_shader_ordering
471 INTEL_framebuffer_CMAA
472 INTEL_map_texture
473 INTEL_parallel_arrays
474 INTEL_performance_query
475 INTEL_texture_scissor

476 KHR_blend_equation_advanced
477 KHR_blend_equation_advanced_coherent
478 KHR_context_flush_control
479 KHR_debug
480 KHR_no_error
481 KHR_parallel_shader_compile
482 KHR_robust_buffer_access_behavior
483 KHR_robustness
484 KHR_texture_compression_astc_hdr
485 KHR_texture_compression_astc_ldr
486 KHR_texture_compression_astc_sliced_3d

487 KTX_buffer_region

488 MESAX_texture_stack

489 MESA_pack_invert
490 MESA_resize_buffers
491 MESA_shader_integer_functions
492 MESA_window_pos
493 MESA_ycbcr_texture

494 NVX_blend_equation_advanced_multi_draw_buffers
495 NVX_conditional_render
496 NVX_gpu_memory_info
497 NVX_linked_gpu_multicast

498 NV_3dvision_settings
499 NV_EGL_stream_consumer_external
500 NV_alpha_to_coverage_dither_control
501 NV_bgr
502 NV_bindless_multi_draw_indirect
503 NV_bindless_multi_draw_indirect_count
504 NV_bindless_texture
505 NV_blend_equation_advanced
506 NV_blend_equation_advanced_coherent
507 NV_blend_minmax_factor
508 NV_blend_square
509 NV_clip_space_w_scaling
510 NV_command_list
511 NV_compute_program5
512 NV_conditional_render
513 NV_conservative_raster
514 NV_conservative_raster_dilate
515 NV_conservative_raster_pre_snap_triangles
516 NV_copy_buffer
517 NV_copy_depth_to_color
518 NV_copy_image
519 NV_deep_texture3D
520 NV_depth_buffer_float
521 NV_depth_clamp
522 NV_depth_range_unclamped
523 NV_draw_buffers
524 NV_draw_instanced
525 NV_draw_texture
526 NV_draw_vulkan_image
527 NV_evaluators
528 NV_explicit_attrib_location
529 NV_explicit_multisample
530 NV_fbo_color_attachments
531 NV_fence
532 NV_fill_rectangle
533 NV_float_buffer
534 NV_fog_distance
535 NV_fragment_coverage_to_color
536 NV_fragment_program
537 NV_fragment_program2
538 NV_fragment_program4
539 NV_fragment_program_option
540 NV_fragment_shader_interlock
541 NV_framebuffer_blit
542 NV_framebuffer_mixed_samples
543 NV_framebuffer_multisample
544 NV_framebuffer_multisample_coverage
545 NV_generate_mipmap_sRGB
546 NV_geometry_program4
547 NV_geometry_shader4
548 NV_geometry_shader_passthrough
549 NV_gpu_multicast
550 NV_gpu_program4
551 NV_gpu_program5
552 NV_gpu_program5_mem_extended
553 NV_gpu_program_fp64
554 NV_gpu_shader5
555 NV_half_float
556 NV_image_formats
557 NV_instanced_arrays
558 NV_internalformat_sample_query
559 NV_light_max_exponent
560 NV_multisample_coverage
561 NV_multisample_filter_hint
562 NV_non_square_matrices
563 NV_occlusion_query
564 NV_pack_subimage
565 NV_packed_depth_stencil
566 NV_packed_float
567 NV_packed_float_linear
568 NV_parameter_buffer_object
569 NV_parameter_buffer_object2
570 NV_path_rendering
571 NV_path_rendering_shared_edge
572 NV_pixel_buffer_object
573 NV_pixel_data_range
574 NV_platform_binary
575 NV_point_sprite
576 NV_polygon_mode
577 NV_present_video
578 NV_primitive_restart
579 NV_read_depth
580 NV_read_depth_stencil
581 NV_read_stencil
582 NV_register_combiners
583 NV_register_combiners2
584 NV_robustness_video_memory_purge
585 NV_sRGB_formats
586 NV_sample_locations
587 NV_sample_mask_override_coverage
588 NV_shader_atomic_counters
589 NV_shader_atomic_float
590 NV_shader_atomic_float64
591 NV_shader_atomic_fp16_vector
592 NV_shader_atomic_int64
593 NV_shader_buffer_load
594 NV_shader_noperspective_interpolation
595 NV_shader_storage_buffer_object
596 NV_shader_thread_group
597 NV_shader_thread_shuffle
598 NV_shadow_samplers_array
599 NV_shadow_samplers_cube
600 NV_stereo_view_rendering
601 NV_tessellation_program5
602 NV_texgen_emboss
603 NV_texgen_reflection
604 NV_texture_array
605 NV_texture_barrier
606 NV_texture_border_clamp
607 NV_texture_compression_latc
608 NV_texture_compression_s3tc
609 NV_texture_compression_s3tc_update
610 NV_texture_compression_vtc
611 NV_texture_env_combine4
612 NV_texture_expand_normal
613 NV_texture_multisample
614 NV_texture_npot_2D_mipmap
615 NV_texture_rectangle
616 NV_texture_rectangle_compressed
617 NV_texture_shader
618 NV_texture_shader2
619 NV_texture_shader3
620 NV_transform_feedback
621 NV_transform_feedback2
622 NV_uniform_buffer_unified_memory
623 NV_vdpau_interop
624 NV_vertex_array_range
625 NV_vertex_array_range2
626 NV_vertex_attrib_integer_64bit
627 NV_vertex_buffer_unified_memory
628 NV_vertex_program
629 NV_vertex_program1_1
630 NV_vertex_program2
631 NV_vertex_program2_option
632 NV_vertex_program3
633 NV_vertex_program4
634 NV_video_capture
635 NV_viewport_array
636 NV_viewport_array2
637 NV_viewport_swizzle

638 OES_byte_coordinates

639 OML_interlace
640 OML_resample
641 OML_subsample

642 OVR_multiview
643 OVR_multiview2
644 OVR_multiview_multisampled_render_to_texture

645 PGI_misc_hints
646 PGI_vertex_hints

647 QCOM_alpha_test
648 QCOM_binning_control
649 QCOM_driver_control
650 QCOM_extended_get
651 QCOM_extended_get2
652 QCOM_framebuffer_foveated
653 QCOM_perfmon_global_mode
654 QCOM_shader_framebuffer_fetch_noncoherent
655 QCOM_tiled_rendering
656 QCOM_writeonly_rendering

657 REGAL_ES1_0_compatibility
658 REGAL_ES1_1_compatibility
659 REGAL_enable
660 REGAL_error_string
661 REGAL_extension_query
662 REGAL_log
663 REGAL_proc_address

664 REND_screen_coordinates

665 S3_s3tc

666 SGIS_clip_band_hint
667 SGIS_color_range
668 SGIS_detail_texture
669 SGIS_fog_function
670 SGIS_generate_mipmap
671 SGIS_line_texgen
672 SGIS_multisample
673 SGIS_multitexture
674 SGIS_pixel_texture
675 SGIS_point_line_texgen
676 SGIS_shared_multisample
677 SGIS_sharpen_texture
678 SGIS_texture4D
679 SGIS_texture_border_clamp
680 SGIS_texture_edge_clamp
681 SGIS_texture_filter4
682 SGIS_texture_lod
683 SGIS_texture_select

684 SGIX_async
685 SGIX_async_histogram
686 SGIX_async_pixel
687 SGIX_bali_g_instruments
688 SGIX_bali_r_instruments
689 SGIX_bali_timer_instruments
690 SGIX_blend_alpha_minmax
691 SGIX_blend_cadd
692 SGIX_blend_cmultiply
693 SGIX_calligraphic_fragment
694 SGIX_clipmap
695 SGIX_color_matrix_accuracy
696 SGIX_color_table_index_mode
697 SGIX_complex_polar
698 SGIX_convolution_accuracy
699 SGIX_cube_map
700 SGIX_cylinder_texgen
701 SGIX_datapipe
702 SGIX_decimation
703 SGIX_depth_pass_instrument
704 SGIX_depth_texture
705 SGIX_dvc
706 SGIX_flush_raster
707 SGIX_fog_blend
708 SGIX_fog_factor_to_alpha
709 SGIX_fog_layers
710 SGIX_fog_offset
711 SGIX_fog_patchy
712 SGIX_fog_scale
713 SGIX_fog_texture
714 SGIX_fragment_lighting_space
715 SGIX_fragment_specular_lighting
716 SGIX_fragments_instrument
717 SGIX_framezoom
718 SGIX_icc_texture
719 SGIX_igloo_interface
720 SGIX_image_compression
721 SGIX_impact_pixel_texture
722 SGIX_instrument_error
723 SGIX_interlace
724 SGIX_ir_instrument1
725 SGIX_line_quality_hint
726 SGIX_list_priority
727 SGIX_mpeg1
728 SGIX_mpeg2
729 SGIX_nonlinear_lighting_pervertex
730 SGIX_nurbs_eval
731 SGIX_occlusion_instrument
732 SGIX_packed_6bytes
733 SGIX_pixel_texture
734 SGIX_pixel_texture_bits
735 SGIX_pixel_texture_lod
736 SGIX_pixel_tiles
737 SGIX_polynomial_ffd
738 SGIX_quad_mesh
739 SGIX_reference_plane
740 SGIX_resample
741 SGIX_scalebias_hint
742 SGIX_shadow
743 SGIX_shadow_ambient
744 SGIX_slim
745 SGIX_spotlight_cutoff
746 SGIX_sprite
747 SGIX_subdiv_patch
748 SGIX_subsample
749 SGIX_tag_sample_buffer
750 SGIX_texture_add_env
751 SGIX_texture_coordinate_clamp
752 SGIX_texture_lod_bias
753 SGIX_texture_mipmap_anisotropic
754 SGIX_texture_multi_buffer
755 SGIX_texture_phase
756 SGIX_texture_range
757 SGIX_texture_scale_bias
758 SGIX_texture_supersample
759 SGIX_vector_ops
760 SGIX_vertex_array_object
761 SGIX_vertex_preclip
762 SGIX_vertex_preclip_hint
763 SGIX_ycrcb
764 SGIX_ycrcb_subsample
765 SGIX_ycrcba

766 SGI_color_matrix
767 SGI_color_table
768 SGI_complex
769 SGI_complex_type
770 SGI_fft
771 SGI_texture_color_table

772 SUNX_constant_data

773 SUN_convolution_border_modes
774 SUN_global_alpha
775 SUN_mesh_array
776 SUN_read_video_pixels
777 SUN_slice_accum
778 SUN_triangle_list
779 SUN_vertex

780 WIN_phong_shading
781 WIN_scene_markerXXX
782 WIN_specular_fog
783 WIN_swap_hint
+ +
+ + diff --git a/Windows/glew/doc/glew.png b/Windows/glew/doc/glew.png new file mode 100644 index 00000000..d46550f1 Binary files /dev/null and b/Windows/glew/doc/glew.png differ diff --git a/Windows/glew/doc/glew.txt b/Windows/glew/doc/glew.txt new file mode 100644 index 00000000..67b4affb --- /dev/null +++ b/Windows/glew/doc/glew.txt @@ -0,0 +1,29 @@ +The OpenGL Extension Wrangler Library +Copyright (C) 2008-2016, Nigel Stewart +Copyright (C) 2002-2008, Milan Ikits +Copyright (C) 2002-2008, Marcelo E. Magallon +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Windows/glew/doc/glxew.html b/Windows/glew/doc/glxew.html new file mode 100644 index 00000000..d1ee00c0 --- /dev/null +++ b/Windows/glew/doc/glxew.html @@ -0,0 +1,186 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Supported GLX Extensions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1 3DFX_multisample

2 AMD_gpu_association

3 ARB_context_flush_control
4 ARB_create_context
5 ARB_create_context_no_error
6 ARB_create_context_profile
7 ARB_create_context_robustness
8 ARB_fbconfig_float
9 ARB_framebuffer_sRGB
10 ARB_get_proc_address
11 ARB_multisample
12 ARB_robustness_application_isolation
13 ARB_robustness_share_group_isolation
14 ARB_vertex_buffer_object

15 ATI_pixel_format_float
16 ATI_render_texture

17 EXT_buffer_age
18 EXT_create_context_es2_profile
19 EXT_create_context_es_profile
20 EXT_fbconfig_packed_float
21 EXT_framebuffer_sRGB
22 EXT_import_context
23 EXT_libglvnd
24 EXT_scene_marker
25 EXT_stereo_tree
26 EXT_swap_control
27 EXT_swap_control_tear
28 EXT_texture_from_pixmap
29 EXT_visual_info
30 EXT_visual_rating

31 INTEL_swap_event

32 MESA_agp_offset
33 MESA_copy_sub_buffer
34 MESA_pixmap_colormap
35 MESA_query_renderer
36 MESA_release_buffers
37 MESA_set_3dfx_mode
38 MESA_swap_control

39 NV_copy_buffer
40 NV_copy_image
41 NV_delay_before_swap
42 NV_float_buffer
43 NV_multisample_coverage
44 NV_present_video
45 NV_robustness_video_memory_purge
46 NV_swap_group
47 NV_vertex_array_range
48 NV_video_capture
49 NV_video_out

50 OML_swap_method
51 OML_sync_control

52 SGIS_blended_overlay
53 SGIS_color_range
54 SGIS_multisample
55 SGIS_shared_multisample

56 SGIX_fbconfig
57 SGIX_hyperpipe
58 SGIX_pbuffer
59 SGIX_swap_barrier
60 SGIX_swap_group
61 SGIX_video_resize
62 SGIX_visual_select_group

63 SGI_cushion
64 SGI_make_current_read
65 SGI_swap_control
66 SGI_video_sync

67 SUN_get_transparent_index
68 SUN_video_resize
+ +
+ + diff --git a/Windows/glew/doc/gpl.txt b/Windows/glew/doc/gpl.txt new file mode 100644 index 00000000..b7b5f53d --- /dev/null +++ b/Windows/glew/doc/gpl.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Windows/glew/doc/index.html b/Windows/glew/doc/index.html new file mode 100644 index 00000000..84e74072 --- /dev/null +++ b/Windows/glew/doc/index.html @@ -0,0 +1,214 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

+The OpenGL Extension Wrangler Library (GLEW) is a cross-platform +open-source C/C++ extension loading library. GLEW provides efficient +run-time mechanisms for determining which OpenGL extensions are +supported on the target platform. OpenGL core and extension +functionality is exposed in a single header file. GLEW has been +tested on a variety of operating systems, including Windows, Linux, +Mac OS X, FreeBSD, Irix, and Solaris. +

+ +

Downloads

+

+GLEW is distributed +as source and precompiled binaries.
+The latest release is +2.1.0[07-31-17]: +

+

+

+

+ + + +
+ + + + + + + + + + + + + + + +
Source +ZIP |  +TGZ
Binaries +Windows 32-bit and 64-bit +
+
+ +

+

+An up-to-date copy is also available using git: +

+
    +
  • github
    +git clone https://github.com/nigels-com/glew.git glew
     
  • +
+ +

Supported Extensions

+

+The latest release contains support for OpenGL 4.6, compatibility and forward-compatible contexts and the following extensions: +

+ + +

News

+
    +
  • [07-31-17] GLEW 2.1.0 adds support for OpenGL 4.6, new extensions and minor bug fixes
  • +
  • [07-24-16] GLEW 2.0.0 adds support for forward-compatible contexts, adds new extensions, OSMesa and EGL support, MX discontinued and minor bug fixes
  • +
  • [08-10-15] GLEW 1.13.0 adds support for new extensions, fixes minor bugs
  • +
  • [26-01-15] GLEW 1.12.0 fixes minor bugs and adds new extensions
  • +
  • [08-11-14] GLEW 1.11.0 adds support for OpenGL 4.5, new extensions
  • +
  • [07-22-13] GLEW 1.10.0 adds support for OpenGL 4.4, new extensions
  • +
  • [08-06-12] GLEW 1.9.0 adds support for OpenGL 4.3, new extensions
  • +
  • [07-17-12] GLEW 1.8.0 fixes minor bugs and adds new extensions
  • +
  • [08-26-11] GLEW 1.7.0 adds support for OpenGL 4.2, new extensions, fixes bugs
  • +
  • [04-27-11] GLEW 1.6.0 fixes minor bugs and adds eight new extensions
  • +
  • [01-31-11] GLEW 1.5.8 fixes minor bugs and adds two new extensions
  • +
  • [11-03-10] GLEW 1.5.7 fixes minor bugs and adds one new extension
  • +
  • [09-07-10] GLEW 1.5.6 adds support for OpenGL 4.1, fixes bugs
  • +
  • [07-13-10] GLEW 1.5.5 fixes minor bugs and adds new extensions
  • +
  • [04-21-10] GLEW 1.5.4 adds support for OpenGL 3.3, OpenGL 4.0 and new extensions, fixes bugs
  • +
  • [02-28-10] GLEW 1.5.3 fixes minor bugs and adds three new extensions
  • +
  • [12-31-09] GLEW 1.5.2 adds support for OpenGL 3.1, OpenGL 3.2 and new extensions
  • +
  • [11-03-08] GLEW 1.5.1 adds support for OpenGL 3.0 and 31 new extensions
  • +
  • [12-27-07] GLEW 1.5.0 is released under less restrictive licenses
  • +
  • [04-27-07] GLEW 1.4.0 is released
  • +
  • [03-08-07] GLEW is included in the NVIDIA OpenGL SDK
  • +
  • [03-04-07] GLEW 1.3.6 is released
  • +
  • [02-28-07] Repository is migrated to SVN
  • +
  • [02-25-07] GLEW is included in the OpenGL SDK
  • +
  • [11-21-06] GLEW 1.3.5 adds OpenGL 2.1 and NVIDIA G80 extensions
  • +
  • [03-04-06] GLEW 1.3.4 adds support for five new extensions
  • +
  • [05-16-05] GLEW 1.3.3 is released
  • +
  • [03-16-05] GLEW 1.3.2 adds support for GL_APPLE_pixel_buffer
  • +
  • [02-11-05] gljava and sdljava provide a Java binding to OpenGL via GLEW
  • +
  • [02-02-05] GLEW 1.3.1 adds support for GL_EXT_framebuffer_object
  • +
  • [01-04-05] GLEW 1.3.0 adds core OpenGL 2.0 support plus many enhancements
  • +
  • [12-22-04] GLEWpy Python wrapper announced
  • +
  • [12-12-04] Mailing lists created on sourceforge
  • +
  • [12-06-04] GLEW 1.2.5 adds new extensions and support for FreeBSD
  • +
+ +

Links

+ + + +
+ + diff --git a/Windows/glew/doc/install.html b/Windows/glew/doc/install.html new file mode 100644 index 00000000..19129e3a --- /dev/null +++ b/Windows/glew/doc/install.html @@ -0,0 +1,228 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Installation

+ +

+To use the shared library version of GLEW, you need to copy the +headers and libraries into their destination directories. On Windows +this typically boils down to copying: +

+ + + + + + + + + + +
bin/glew32.dll    to    %SystemRoot%/system32
lib/glew32.lib    to    {VC Root}/Lib
include/GL/glew.h    to    {VC Root}/Include/GL
include/GL/wglew.h    to    {VC Root}/Include/GL
+

+

+ +

+where {VC Root} is the Visual C++ root directory, typically +C:/Program Files/Microsoft Visual Studio/VC98 for Visual +Studio 6.0 or C:/Program Files/Microsoft Visual +Studio .NET 2003/Vc7/PlatformSDK for Visual Studio .NET. +

+ +

+On Unix, typing make install will attempt to install GLEW +into /usr/include/GL and /usr/lib. You can +customize the installation target via the GLEW_DEST +environment variable if you do not have write access to these +directories. +

+ +

Building Your Project with GLEW

+

+There are two ways to build your project with GLEW. +

+

Including the source files / project file

+

+The simpler but less flexible way is to include glew.h and +glew.c into your project. On Windows, you also need to +define the GLEW_STATIC preprocessor token when building a +static library or executable, and the GLEW_BUILD preprocessor +token when building a dll. You also need to replace +<GL/gl.h> and <GL/glu.h> with +<glew.h> in your code and set the appropriate include +flag (-I) to tell the compiler where to look for it. For +example: +

+

+#include <glew.h>
+#include <GL/glut.h>
+<gl, glu, and glut functionality is available here>
+

+

+Depending on where you put glew.h you may also need to change +the include directives in glew.c. Note that if you are using +GLEW together with GLUT, you have to include glew.h first. +In addition, glew.h includes glu.h, so you do not +need to include it separately. +

+

+On Windows, you also have the option of adding the supplied project +file glew_static.dsp to your workspace (solution) and compile +it together with your other projects. In this case you also need to +change the GLEW_BUILD preprocessor constant to +GLEW_STATIC when building a static library or executable, +otherwise you get build errors. +

+

+Note that GLEW does not use the C +runtime library, so it does not matter which version (single-threaded, +multi-threaded or multi-threaded DLL) it is linked with (without +debugging information). It is, however, always a good idea to compile all +your projects including GLEW with the same C runtime settings. +

+ +

Using GLEW as a shared library

+ +

+Alternatively, you can use the provided project files / makefile to +build a separate shared library you can link your projects with later. +In this case the best practice is to install glew.h, +glew32.lib, and glew32.dll / libGLEW.so to +where the OpenGL equivalents gl.h, opengl32.lib, and +opengl32.dll / libGL.so are located. Note that you +need administrative privileges to do this. If you do not have +administrator access and your system administrator will not do it for +you, you can install GLEW into your own lib and include subdirectories +and tell the compiler where to find it. Then you can just replace +<GL/gl.h> with <GL/glew.h> in your +program: +

+ +

+#include <GL/glew.h>
+#include <GL/glut.h>
+<gl, glu, and glut functionality is available here>
+

+ +

+or: +

+ +

+#include <GL/glew.h>
+<gl and glu functionality is available here>
+

+ +

+Remember to link your project with glew32.lib, +glu32.lib, and opengl32.lib on Windows and +libGLEW.so, libGLU.so, and libGL.so on +Unix (-lGLEW -lGLU -lGL). +

+ +

+It is important to keep in mind that glew.h includes neither +windows.h nor gl.h. Also, GLEW will warn you by +issuing a preprocessor error in case you have included gl.h, +glext.h, or glATI.h before glew.h. +

+ + +
+ + diff --git a/Windows/glew/doc/khronos.txt b/Windows/glew/doc/khronos.txt new file mode 100644 index 00000000..ffc271c9 --- /dev/null +++ b/Windows/glew/doc/khronos.txt @@ -0,0 +1,20 @@ +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/Windows/glew/doc/log.html b/Windows/glew/doc/log.html new file mode 100644 index 00000000..a343f2bb --- /dev/null +++ b/Windows/glew/doc/log.html @@ -0,0 +1,1238 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Change Log

+ +
+
    +
  • 2.1.0 [07-31-17] +
      +
    • Enhancements: +
        +
      • OpenGL 4.6 support added +
      • Improved Mac OSX build support +
      • Improved cmake build support +
      +
    + +
      +
    • Bug fixes: +
        +
      • Resovled crash when glXGetCurrentDisplay() is NULL +
      • CMake: only install PDB files with MSVC +
      • wglGetProcAddress crash with NOGDI defined +
      • Mac: using -Os rather than -O2 +
      +
    + +
      +
    • New extensions: +
        +
      • GL_AMD_gpu_shader_half_float +
      • GL_AMD_shader_ballot +
      • GL_ARB_gl_spirv +
      • GL_EGL_KHR_context_flush_control +
      • GL_INTEL_conservative_rasterization +
      • GL_MESA_shader_integer_functions +
      • GL_NVX_blend_equation_advanced_multi_draw_buffers +
      • GL_NV_gpu_multicast +
      • EGL_ARM_implicit_external_sync +
      • EGL_EXT_gl_colorspace_bt2020_linear +
      • EGL_EXT_gl_colorspace_bt2020_pq +
      • EGL_EXT_gl_colorspace_scrgb_linear +
      • EGL_EXT_image_dma_buf_import_modifiers +
      • EGL_EXT_pixel_format_float +
      • EGL_EXT_surface_SMPTE2086_metadata +
      • EGL_KHR_context_flush_control +
      • EGL_KHR_no_config_context +
      • EGL_KHR_stream_attrib +
      • EGL_MESA_platform_surfaceless +
      • EGL_NV_stream_cross_display +
      • EGL_NV_stream_cross_object +
      • EGL_NV_stream_cross_partition +
      • EGL_NV_stream_cross_process +
      • EGL_NV_stream_cross_system +
      • EGL_NV_stream_fifo_next +
      • EGL_NV_stream_fifo_synchronous +
      • EGL_NV_stream_frame_limits +
      • EGL_NV_stream_remote +
      • EGL_NV_stream_reset +
      • EGL_NV_stream_socket +
      • EGL_NV_stream_socket_inet +
      • EGL_NV_stream_socket_unix +
      • WGL_EXT_colorspace +
      +
    + +
+ +
+
    +
  • 2.0.0 [07-24-16] +
      +
    • Enhancements: +
        +
      • Forward context support added +
      • OSMesa support added +
      • EGL support added +
      • MX support discontinued +
      • Improved cmake build support +
      +
    +
      +
    • New extensions: +
        +
      • GL_AMD_shader_explicit_vertex_parameter +
      • GL_ARB_gl_spirv +
      • GL_EGL_NV_robustness_video_memory_purge +
      • GL_EXT_window_rectangles +
      • GL_INTEL_conservative_rasterization +
      • GL_KHR_texture_compression_astc_sliced_3d +
      • GL_MESA_shader_integer_functions +
      • GL_NVX_blend_equation_advanced_multi_draw_buffers +
      • GL_NVX_linked_gpu_multicast +
      • GL_NV_clip_space_w_scaling +
      • GL_NV_command_list +
      • GL_NV_conservative_raster_pre_snap_triangles +
      • GL_NV_draw_vulkan_image +
      • GL_NV_gpu_multicast +
      • GL_NV_robustness_video_memory_purge +
      • GL_NV_shader_atomic_float64 +
      • GL_NV_stereo_view_rendering +
      • GL_NV_viewport_swizzle +
      • GLX_EXT_libglvnd +
      • GLX_NV_robustness_video_memory_purge +
      +
    +
+ +
+
    +
  • 1.13.0 [08-10-15] +
      +
    • Enhancements: +
        +
      • glxewInit, wglewInit +
      • glewinfo adds support for -version, -profile core|compatibility and -flag debug|forward parameters +
      • Improved cmake build support +
      +
    +
      +
    • New extensions: +
        +
      • GL_ARB_ES3_2_compatibility +
      • GL_ARB_fragment_shader_interlock +
      • GL_ARB_gpu_shader_int64 +
      • GL_ARB_parallel_shader_compile +
      • GL_ARB_post_depth_coverage +
      • GL_ARB_sample_locations +
      • GL_ARB_shader_atomic_counter_ops +
      • GL_ARB_shader_ballot +
      • GL_ARB_shader_clock +
      • GL_ARB_shader_viewport_layer_array +
      • GL_ARB_sparse_texture2 +
      • GL_ARB_sparse_texture_clamp +
      • GL_ARB_texture_filter_minmax +
      • GL_INTEL_framebuffer_CMAA +
      • GL_KHR_no_error +
      • GL_NV_conservative_raster_dilate +
      • GL_OVR_multiview +
      • GL_OVR_multiview2 +
      +
    • Bug fixes +
    +
+ +
+
    +
  • 1.12.0 [01-26-15] +
      +
    • New extensions: +
        +
      • GL_EXT_polygon_offset_clamp +
      • GL_EXT_post_depth_coverage +
      • GL_EXT_raster_multisample +
      • GL_EXT_sparse_texture2 +
      • GL_EXT_texture_filter_minmax +
      • GL_NV_conservative_raster +
      • GL_NV_fill_rectangle +
      • GL_NV_fragment_coverage_to_color +
      • GL_NV_fragment_shader_interlock +
      • GL_NV_framebuffer_mixed_samples +
      • GL_NV_geometry_shader_passthrough +
      • GL_NV_internalformat_sample_query +
      • GL_NV_sample_locations +
      • GL_NV_sample_mask_override_coverage +
      • GL_NV_shader_atomic_fp16_vector +
      • GL_NV_uniform_buffer_unified_memory +
      • GL_NV_viewport_array2 +
      +
    • Bug fixes +
    +
+ +
+
    +
  • 1.11.0 [08-11-14] +
      +
    • New features: +
        +
      • Support for OpenGL 4.5 +
      +
    • New extensions: +
        +
      • GL_AMD_gcn_shader +
      • GL_AMD_gpu_shader_int64 +
      • GL_AMD_occlusion_query_event +
      • GL_AMD_shader_atomic_counter_ops +
      • GL_AMD_shader_stencil_value_export +
      • GL_AMD_transform_feedback4 +
      • GL_ARB_ES3_1_compatibility +
      • GL_ARB_clip_control +
      • GL_ARB_conditional_render_inverted +
      • GL_ARB_cull_distance +
      • GL_ARB_derivative_control +
      • GL_ARB_direct_state_access +
      • GL_ARB_get_texture_sub_image +
      • GL_ARB_pipeline_statistics_query +
      • GL_ARB_shader_texture_image_samples +
      • GL_ARB_sparse_buffer +
      • GL_ARB_texture_barrier +
      • GL_ARB_transform_feedback_overflow_query +
      • GL_EXT_debug_label +
      • GL_EXT_shader_image_load_formatted +
      • GL_EXT_shader_integer_mix +
      • GL_INTEL_fragment_shader_ordering +
      • GL_INTEL_performance_query +
      • GL_KHR_blend_equation_advanced +
      • GL_KHR_blend_equation_advanced_coherent +
      • GL_KHR_context_flush_control +
      • GL_KHR_robust_buffer_access_behavior +
      • GL_KHR_robustness +
      • GL_KHR_texture_compression_astc_hdr +
      • GL_NV_bindless_multi_draw_indirect_count +
      • GL_NV_shader_atomic_int64 +
      • GL_NV_shader_thread_group +
      • GL_NV_shader_thread_shuffle +
      • GL_REGAL_proc_address +
      • GLX_ARB_context_flush_control +
      • GLX_EXT_stereo_tree +
      • GLX_MESA_query_renderer +
      • GLX_NV_copy_buffer +
      • GLX_NV_delay_before_swap +
      • WGL_ARB_context_flush_control +
      • WGL_NV_delay_before_swap +
      +
    • Bug fixes +
    +
+ +
+
    +
  • 1.10.0 [07-22-13] +
      +
    • New features: +
        +
      • Support for OpenGL 4.4 +
      +
    • New extensions: +
        +
      • GL_AMD_interleaved_elements +
      • GL_AMD_shader_trinary_minmax +
      • GL_AMD_sparse_texture +
      • GL_ANGLE_depth_texture +
      • GL_ANGLE_framebuffer_blit +
      • GL_ANGLE_framebuffer_multisample +
      • GL_ANGLE_instanced_arrays +
      • GL_ANGLE_pack_reverse_row_order +
      • GL_ANGLE_program_binary +
      • GL_ANGLE_texture_compression_dxt1 +
      • GL_ANGLE_texture_compression_dxt3 +
      • GL_ANGLE_texture_compression_dxt5 +
      • GL_ANGLE_texture_usage +
      • GL_ANGLE_timer_query +
      • GL_ANGLE_translated_shader_source +
      • GL_ARB_bindless_texture +
      • GL_ARB_buffer_storage +
      • GL_ARB_clear_texture +
      • GL_ARB_compute_variable_group_size +
      • GL_ARB_enhanced_layouts +
      • GL_ARB_indirect_parameters +
      • GL_ARB_multi_bind +
      • GL_ARB_query_buffer_object +
      • GL_ARB_seamless_cubemap_per_texture +
      • GL_ARB_shader_draw_parameters +
      • GL_ARB_shader_group_vote +
      • GL_ARB_sparse_texture +
      • GL_ARB_texture_mirror_clamp_to_edge +
      • GL_ARB_texture_stencil8 +
      • GL_ARB_vertex_type_10f_11f_11f_rev +
      • GL_INTEL_map_texture +
      • GL_NVX_conditional_render +
      • GL_NV_bindless_multi_draw_indirect +
      • GL_NV_blend_equation_advanced +
      • GL_NV_compute_program5 +
      • GL_NV_deep_texture3D +
      • GL_NV_draw_texture +
      • GL_NV_shader_atomic_counters +
      • GL_NV_shader_storage_buffer_object +
      • GL_REGAL_ES1_0_compatibility +
      • GL_REGAL_ES1_1_compatibility +
      • GL_REGAL_enable +
      • GLX_EXT_buffer_age +
      • WGL_ARB_robustness_application_isolation +
      • WGL_ARB_robustness_share_group_isolation +
      +
    • Bug fixes +
    +
+ +
+
    +
  • 1.9.0 [08-06-12] +
      +
    • New features: + +
    • New extensions: +
        +
      • GL_ARB_ES3_compatibility +
      • GL_ARB_clear_buffer_object +
      • GL_ARB_compute_shader +
      • GL_ARB_copy_image +
      • GL_ARB_explicit_uniform_location +
      • GL_ARB_fragment_layer_viewport +
      • GL_ARB_framebuffer_no_attachments +
      • GL_ARB_internalformat_query2 +
      • GL_ARB_multi_draw_indirect +
      • GL_ARB_program_interface_query +
      • GL_ARB_robust_buffer_access_behavior +
      • GL_ARB_robustness_application_isolation +
      • GL_ARB_robustness_share_group_isolation +
      • GL_ARB_shader_image_size +
      • GL_ARB_shader_storage_buffer_object +
      • GL_ARB_stencil_texturing +
      • GL_ARB_texture_buffer_range +
      • GL_ARB_texture_query_levels +
      • GL_ARB_texture_storage_multisample +
      • GL_ARB_texture_view +
      • GL_ARB_vertex_attrib_binding +
      • GL_EXT_debug_marker +
      • GL_KHR_debug +
      • GL_REGAL_error_string +
      • GL_REGAL_extension_query +
      • GL_REGAL_log +
      • GLX_ARB_robustness_application_isolation +
      • GLX_ARB_robustness_share_group_isolation +
      • GLX_EXT_create_context_es_profile +
      • WGL_EXT_create_context_es_profile +
      +
    • Bug fixes: +
        +
      • Not using GLU library for Makefile builds. +
      +
    +
+ +
+
    +
  • 1.8.0 [07-17-12] +
      +
    • New extensions: +
        +
      • GL_AMD_pinned_memory +
      • GL_AMD_query_buffer_object +
      • GL_AMD_stencil_operation_extended +
      • GL_AMD_vertex_shader_layer +
      • GL_AMD_vertex_shader_viewport_index +
      • GL_NV_bindless_texture +
      • GL_NV_shader_atomic_float +
      • GLX_EXT_swap_control_tear +
      • WGL_EXT_swap_control_tear +
      • WGL_NV_DX_interop2 +
      +
    • Bug fixes: +
        +
      • MS Visual Studio 2010 projects added +
      • GLX_NV_video_out replaces GLX_NV_video_output +
      • ANSI C prototype for glewInit +
      • Improved CentOS build support +
      • Improved GL_ARB_gpu_shader_fp64 support +
      • ARB_texture_compression_bptc and ARB_copy_buffer constants +
      • Linux needs to define GLEW_STATIC for static library builds +
      • Custom code generation problem resolved +
      • GLEWAPIENTRY added to glew.h for calling convention customization +
      • Correction for glPathStencilDepthOffsetNV +
      • Resolve OSX gcc warnings +
      • Added build support for NetBSD +
      +
    +
+ +
+
    +
  • 1.7.0 [08-26-11] +
      +
    • New features: +
        +
      • Support for OpenGL 4.2 +
      +
    • New extensions: +
        +
      • GL_AMD_multi_draw_indirect +
      • GL_ARB_base_instance +
      • GL_ARB_compressed_texture_pixel_storage +
      • GL_ARB_conservative_depth +
      • GL_ARB_internalformat_query +
      • GL_ARB_map_buffer_alignment +
      • GL_ARB_shader_atomic_counters +
      • GL_ARB_shader_image_load_store +
      • GL_ARB_shading_language_420pack +
      • GL_ARB_shading_language_packing +
      • GL_ARB_texture_storage +
      • GL_ARB_transform_feedback_instanced +
      • GL_EXT_framebuffer_multisample_blit_scaled +
      • GL_NV_path_rendering +
      • GL_NV_path_rendering +
      • GLX_MESA_swap_control +
      +
    • Bug fixes: +
        +
      • const qualifiers for GL 1.4 MultiDrawArrays, MultiDrawElements +
      • Add glGetGraphicsResetStatusARB to GL_ARB_robustness +
      • Remove EXT suffix from GL_KTX_buffer_region entry points +
      • Solaris needs inttypes.h +
      • Add ERROR_INVALID_VERSION_ARB and ERROR_INVALID_PROFILE_ARB to WGL_ARB_create_context +
      • Add GLX_MESA_swap_control +
      • Set -install_name for OSX +
      • Add 64-bit darwin build option (SYSTEM=darwin_x86-64) +
      • Add GL_NV_path_rendering +
      +
    +
+ +
+
    +
  • 1.6.0 [04-27-11] +
      +
    • New extensions: +
        +
      • GL_AMD_blend_minmax_factor +
      • GL_AMD_sample_positions +
      • GL_EXT_x11_sync_object +
      • GL_NV_texture_multisample +
      • GL_NV_video_capture +
      • GLX_NV_video_capture +
      • WGL_NV_DX_interop +
      • WGL_NV_video_capture +
      +
    • Bug fixes: +
        +
      • Define GLEW_NO_GLU for no glu dependency. +
      • mx suffix for GLEW MX libraries, build both libraries by default. +
      • Cygwin build improvements +
      • Soname of GLEWmx shared libraries +
      • Query GL extension string only once +
      • GLX_OML_sync_control no longer requires C99 +
      • glDraw*InstancedARB moved from GL_ARB_draw_instanced to GL_ARB_instanced_arrays +
      • glFramebufferTextureLayerEXT moved from GL_EXT_geometry_shader4 to GL_EXT_texture_array +
      • Fixes for BSD build +
      +
    +
+ +
+
    +
  • 1.5.8 [01-31-11] +
      +
    • New extensions: +
        +
      • GL_AMD_depth_clamp_separate +
      • GL_EXT_texture_sRGB_decode +
      +
    • Bug fixes: +
        +
      • Borland C++ fix for __int64 +
      • GL_DOUBLE_MATNxM enumerants for OpenGL 4.0 +
      • Correction to glGetTransformFeedbackVarying +
      • Correction to glSecondaryColorPointer +
      • Corrections to glGetVertexAttribPointerv and glGetShaderSource +
      • Switched code repository from svn to git +
      +
    +
+ +
+
    +
  • 1.5.7 [11-03-10] +
      +
    • New extension: +
        +
      • GL_NVX_gpu_memory_info +
      +
    • Bug fixes: +
        +
      • Improved mingw32 build support +
      • Improved cygwin build support +
      • glGetPointervEXT fix +
      • Add GLEW_VERSION_1_2_1 +
      +
    +
+ +
+
    +
  • 1.5.6 [09-07-10] +
      +
    • New features: +
        +
      • Support for OpenGL 4.1 +
      +
    • New extensions: +
        +
      • GL_ARB_ES2_compatibility +
      • GL_ARB_cl_event +
      • GL_ARB_debug_output +
      • GL_ARB_get_program_binary +
      • GL_ARB_robustness +
      • GL_ARB_separate_shader_objects +
      • GL_ARB_shader_precision +
      • GL_ARB_shader_stencil_export +
      • GL_ARB_vertex_attrib_64bit +
      • GL_ARB_viewport_array +
      • GLX_ARB_create_context_robustness +
      • GLX_EXT_create_context_es2_profile +
      • WGL_ARB_create_context_robustness +
      • WGL_EXT_create_context_es2_profile +
      +
    +
+ +
+
    +
  • 1.5.5 [07-13-10] +
      +
    • New extensions: +
        +
      • GL_AMD_debug_output +
      • GL_AMD_name_gen_delete +
      • GL_AMD_transform_feedback3_lines_triangles +
      • GL_NV_multisample_coverage +
      • GL_NV_vdpau_interop +
      • GLX_AMD_gpu_association +
      • GLX_NV_multisample_coverage +
      • WGL_NV_multisample_coverage +
      +
    • Bug fixes: +
        +
      • Compilation issue with GLX_SGI_video_sync +
      • OpenGL 4.0 double-precision uniform functions added +
      • Constness of glPointParameterfvARB and glPointParameterfvEXT +
      • Added glVertexAttribDivisor +
      • Compilation issue with Nvidia GLX headers +
      +
    +
+ +
+
    +
  • 1.5.4 [04-21-10] +
      +
    • New features: +
        +
      • Support for OpenGL 3.3 +
      • Support for OpenGL 4.0 +
      +
    • New extensions: +
        +
      • GL_AMD_conservative_depth +
      • GL_ARB_blend_func_extended +
      • GL_ARB_draw_indirect +
      • GL_ARB_explicit_attrib_location +
      • GL_ARB_gpu_shader5 +
      • GL_ARB_gpu_shader_fp64 +
      • GL_ARB_occlusion_query2 +
      • GL_ARB_sampler_objects +
      • GL_ARB_shader_bit_encoding +
      • GL_ARB_shader_subroutine +
      • GL_ARB_shading_language_include +
      • GL_ARB_tessellation_shader +
      • GL_ARB_texture_buffer_object_rgb32 +
      • GL_ARB_texture_compression_bptc +
      • GL_ARB_texture_rgb10_a2ui +
      • GL_ARB_texture_swizzle +
      • GL_ARB_timer_query +
      • GL_ARB_transform_feedback2 +
      • GL_ARB_transform_feedback3 +
      • GL_ARB_vertex_type_2_10_10_10_rev +
      • GL_EXT_shader_image_load_store +
      • GL_EXT_vertex_attrib_64bit +
      • GL_NV_gpu_program5 +
      • GL_NV_gpu_program_fp64 +
      • GL_NV_gpu_shader5 +
      • GL_NV_tessellation_program5 +
      • GL_NV_vertex_attrib_integer_64bit +
      • GLX_ARB_vertex_buffer_object +
      +
    • Bug fixes: +
        +
      • Parameter constness fix for glPointParameteriv and glPointParameterfv +
      +
    +
+ +
+
    +
  • 1.5.3 [02-28-10] +
      +
    • New extensions: +
        +
      • GLX_INTEL_swap_event +
      • GL_AMD_seamless_cubemap_per_texture +
      • GL_AMD_shader_stencil_export +
      +
    • Bug fixes: +
        +
      • Correct version detection for GL 3.1 and 3.2 +
      • Missing 3.1 enumerants +
      • Add glew.pc +
      +
    +
+ +
+
    +
  • 1.5.2 [12-31-09] +
      +
    • New features: +
        +
      • Support for OpenGL 3.1 +
      • Support for OpenGL 3.2 +
      +
    • New extensions: +
        +
      • GL_AMD_draw_buffers_blend +
      • GL_AMD_performance_monitor +
      • GL_AMD_texture_texture4 +
      • GL_AMD_vertex_shader_tessellator +
      • GL_APPLE_aux_depth_stencil +
      • GL_APPLE_object_purgeable +
      • GL_APPLE_rgb_422 +
      • GL_APPLE_row_bytes +
      • GL_APPLE_vertex_program_evaluators +
      • GL_ARB_compatibility +
      • GL_ARB_copy_buffer +
      • GL_ARB_depth_clamp +
      • GL_ARB_draw_buffers_blend +
      • GL_ARB_draw_elements_base_vertex +
      • GL_ARB_fragment_coord_conventions +
      • GL_ARB_provoking_vertex +
      • GL_ARB_sample_shading +
      • GL_ARB_seamless_cube_map +
      • GL_ARB_shader_texture_lod +
      • GL_ARB_sync +
      • GL_ARB_texture_cube_map_array +
      • GL_ARB_texture_gather +
      • GL_ARB_texture_multisample +
      • GL_ARB_texture_query_lod +
      • GL_ARB_uniform_buffer_object +
      • GL_ARB_vertex_array_bgra +
      • GL_ATI_meminfo +
      • GL_EXT_provoking_vertex +
      • GL_EXT_separate_shader_objects +
      • GL_EXT_texture_snorm +
      • GL_NV_copy_image +
      • GL_NV_parameter_buffer_object2 +
      • GL_NV_shader_buffer_load +
      • GL_NV_texture_barrier +
      • GL_NV_transform_feedback2 +
      • GL_NV_vertex_buffer_unified_memory +
      • WGL_AMD_gpu_association +
      • WGL_ARB_create_context_profile +
      • WGL_NV_copy_image +
      • GLX_ARB_create_context_profile +
      • GLX_EXT_swap_control +
      • GLX_NV_copy_image +
      +
    • Bug fixes: +
        +
      • DOS line endings for windows .zip archives only. +
      • glTransformFeedbackVaryings arguments. +
      • Resource leak in glewinfo and visualinfo tools. +
      • WIN32_LEAN_AND_MEAN preprocessor pollution. +
      • Fixed version detection for GLEW_VERSION_2_1 and GLEW_VERSION_3_0. +
      • MesaGLUT glut.h GLAPIENTRY dependency. +
      • glFramebufferTextureLayer correction. +
      • OSX compiler warnings resolved. +
      • Cygwin linking to opengl32 by default, rather than X11 OpenGL. +
      • SnowLeopard (OSX 10.6) gl.h detection. +
      • Use $(STRIP) consistently. +
      +
    +
+ +
+
    +
  • 1.5.1 [11-03-08] +
      +
    • New features: +
        +
      • Support for OpenGL 3.0 +
      +
    • New extensions: +
        +
      • GL_ARB_depth_buffer_float +
      • GL_ARB_draw_instance, +
      • GL_ARB_framebuffer_object +
      • GL_ARB_framebuffer_sRGB +
      • GL_ARB_geometry_shader4 +
      • GL_ARB_half_float_pixel +
      • GL_ARB_half_float_vertex +
      • GL_ARB_instanced_arrays +
      • GL_ARB_map_buffer_range +
      • GL_ARB_texture_buffer_object +
      • GL_ARB_texture_compression_rgtc +
      • GL_ARB_vertex_array_object +
      • GL_EXT_direct_state_access +
      • GL_EXT_texture_swizzle +
      • GL_EXT_transform_feedback +
      • GL_EXT_vertex_array_bgra +
      • GL_NV_conditional_render +
      • GL_NV_explicit_multisample +
      • GL_NV_present_video +
      • GL_SGIS_point_line_texgen +
      • GL_SGIX_convolution_accuracy +
      • WGL_ARB_create_context +
      • WGL_ARB_framebuffer_sRGB +
      • WGL_NV_present_video +
      • WGL_NV_swap_group +
      • WGL_NV_video_output +
      • GLX_ARB_create_context +
      • GLX_ARB_framebuffer_sRGB +
      • GLX_NV_present_video +
      • GLX_NV_swap_group +
      • GLX_NV_video_output +
      +
    • Bug fixes: +
        +
      • Licensing issues with documentation +
      • Problems with long long and _MSC_VER on MINGW +
      • Incorrect parameter for glGetUniformLocation +
      • glewGetExtension fails on last entry +
      • Incomplete GL_NV_texture_shader tokens +
      • Scripting problems on Cygwin +
      • Incorrect definition for GLint on OS X +
      +
    +
+ +
+
    +
  • 1.5.0 [12-27-07] +
      +
    • New features: +
        +
      • Licensing change (BSD, Mesa 3-D, Khronos) +
      • Switch to using registry on www.opengl.org +
      • Support for major and minor version strings +
      +
    • New extensions: +
        +
      • GL_APPLE_flush_buffer_range +
      • GL_GREMEDY_frame_terminator +
      • GLX_EXT_texture_from_pixmap +
      +
    • Bug fixes: +
        +
      • Incorrent 64-bit type definitions +
      • Do not strip static library on install +
      • Missing tokens in GL_ATI_fragment_shader and WGL_{ARB,EXT}_make_current_read +
      • Missing tokens in GL_VERSION_2_1 +
      • Missing functions in GL_VERSION_1_4 +
      • Incorrect parameter type for glXCopyContext +
      +
    +
+
+
    +
  • 1.4.0 [04-27-07] +
      +
    • New features: +
        +
      • Extension variables are declared const to avoid possible +corruption of their values +
      +
    • New extensions: +
        +
      • GL_NV_depth_range_unclamped +
      +
    • Bug fixes: +
        +
      • Incorrect tokens in GL_NV_transform_feedback and GL_NV_framebuffer_multisample_coverage +
      • Incorrect function names in GL_EXT_gpu_program_parameters +
      • Missing tokens in GL_EXT_framebuffer_multisample +
      • GLEW_MX initialization problem for WGL_{ARB,EXT}_extensions_string +
      +
    +
+
+
    +
  • 1.3.6 [03-04-07] +
      +
    • New extensions: +
        +
      • GL_ATI_shader_texture_lod +
      • GL_EXT_gpu_program_parameters +
      • GL_NV_geometry_shader4 +
      • WGL_NV_gpu_affinity +
      • GLX_SGIX_hyperpipe +
      +
    • Bug fixes: +
        +
      • Missing include guards in glxew.h +
      • Makefile and install problems for Cygwin builds +
      • Install problem for Linux AMD64 builds +
      • Incorrent token in GL_ATI_texture_compression_3dc +
      • Missing tokens from GL_ATIX_point_sprites +
      +
    +
+
+
    +
  • 1.3.5 [11-21-06] +
      +
    • New features: +
        +
      • Support for core OpenGL 2.1 +
      • Debug support for glewIsSupported +
      +
    • New extensions: +
        +
      • GL_EXT_bindable_uniform +
      • GL_EXT_draw_buffers2 +
      • GL_EXT_draw_instanced +
      • GL_EXT_framebuffer_sRGB +
      • GL_EXT_geometry_shader4 +
      • GL_EXT_gpu_shader4 +
      • GL_EXT_packed_float +
      • GL_EXT_texture_array +
      • GL_EXT_texture_buffer_object +
      • GL_EXT_texture_compression_latc +
      • GL_EXT_texture_compression_rgtc +
      • GL_EXT_texture_integer +
      • GL_EXT_texture_shared_exponent +
      • GL_EXT_timer_query +
      • GL_NV_depth_buffer_float +
      • GL_NV_fragment_program4 +
      • GL_NV_framebuffer_multisample_coverage +
      • GL_NV_geometry_program4 +
      • GL_NV_gpu_program4 +
      • GL_NV_parameter_buffer_object +
      • GL_NV_transform_feedback +
      • GL_NV_vertex_program4 +
      • GL_OES_byte_coordinates +
      • GL_OES_compressed_paletted_texture +
      • GL_OES_read_format +
      • GL_OES_single_precision +
      • WGL_EXT_pixel_format_packed_float +
      • WGL_EXT_framebuffer_sRGB +
      • GLX_EXT_fbconfig_packed_float +
      • GLX_EXT_framebuffer_sRGB +
      +
    • Bug fixes: +
        +
      • Wrong GLXContext definition on Solaris +
      • Makefile problem for parallel builds +
      +
    +
+
+
    +
  • 1.3.4 [03-04-06] +
      +
    • New extensions: +
        +
      • GL_EXT_framebuffer_blit +
      • GL_EXT_framebuffer_multisample +
      • GL_EXT_packed_depth_stencil +
      • GL_MESAX_texture_stack +
      • WGL_3DL_stereo_control +
      +
    +
      +
    • Bug fixes: +
        +
      • glBlendEquation missing from GL_ARB_imaging +
      • Wrong APIENTRY definition for Cygwin +
      • Incorrect OS X OpenGL types +
      • Unix 64-bit installation patch +
      +
    +
+
+
    +
  • 1.3.3 [05-16-05] +
      +
    • New feature: +
        +
      • Code generation option to split source into multiple files +
      +
    +
      +
    • Bug fixes: +
        +
      • OpenGL 2.0 core initialization problems +
      • Wrong value for token GL_SHADER_TYPE +
      • Missing tokens in GL_ATI_fragment_shader +
      • Missing entry points in GL_ARB_transpose_matrix +
      +
    +
+
+
    +
  • 1.3.2 [03-16-05] +
      +
    • New extension: +
        +
      • GL_APPLE_pixel_buffer +
      +
    • Bug fixes: +
        +
      • Missing OpenGL 2.0 entry points +
      • Missing tokens in GL_SGIX_shadow +
      • MinGW makefile problem +
      • Check for incorrect OpenGL version string on SiS hardware +
      • Documentation update to meet the HTML 4.01 Transitional specification +
      +
    +
+
+
    +
  • 1.3.1 [02-02-05] +
      +
    • New features: +
        +
      • Consistent Unix and Windows versioning +
      +
    • New extensions: +
        +
      • GL_EXT_framebuffer_object +
      • GL_ARB_pixel_buffer_object +
      +
    • Bug fixes: +
        +
      • Missing OpenGL 2.0 tokens +
      • Incorrect typedefs (GLhandleARB and GLhalf) +
      • Borland compiler problems +
      +
    +
+
+
    +
  • 1.3.0 [01-04-05] +
      +
    • New features: +
        +
      • Support for core OpenGL 2.0 +
      • glewIsSupported provides efficient string-based extension checks +
      • Custom code generation from a list of extensions +
      • Makefile changes +
      +
    • New extensions: +
        +
      • WGL_ATI_render_texture_rectangle +
      +
    • Bug fixes: +
        +
      • Incorrect function signature in OpenGL 1.5 core +
      +
    +
+
+
    +
  • 1.2.5 [12-06-04] +
      +
    • New extensions: +
        +
      • GL_ATI_texture_compression_3dc +
      • GL_EXT_Cg_shader +
      • GL_EXT_draw_range_elements +
      • GL_KTX_buffer_region +
      +
    • Bug fixes: +
        +
      • OpenGL version detection bug +
      • Problems with wxWindows and MinGW compilation +
      • visualinfo compilation problem with GLEW_MX specified +
      • Wrong token name in OpenGL 1.5 core +
      +
    • Support for FreeBSD +
    +
+
+
    +
  • 1.2.4 [09-06-04] +
      +
    • Added ARB_draw_buffers and ARB_texture_rectangle +
    • Fixed bug in ARB_shader_objects +
    • Replaced wglinfo with visualinfo +
    +
+
+
    +
  • 1.2.3 [06-10-04] +
      +
    • Added GL_NV_fragment_program2, GL_NV_fragment_program_option, GL_NV_vertex_program2_option, GL_NV_vertex_program3 +
    • Bug fix in GL_ARB_vertex_blend +
    +
+
+
    +
  • 1.2.2 [05-08-04] +
      +
    • Added GL_EXT_pixel_buffer_object, removed GL_NV_element_array +
    • Fixed GLEW_MX problems +
    • Bug fix in GL_EXT_texture_rectangle and wglinfo +
    +
+
+
    +
  • 1.2.1 [03-18-04] +
      +
    • Bug fix in OpenGL version query (early release of 1.2.0 contained this bug) +
    • Bug fix in GL_ARB_shader_objects and temporary bug fix in GL_ARB_vertex_shader +
    • Added flags on GDI support and multisampling to wglinfo +
    +
+
+
    +
  • 1.2.0 [02-19-04] +
      +
    • Added full OpenGL 1.5 support +
    • Added support for multiple rendering contexts with different capabilities +
    • Added command line flags to glewinfo for selecting displays and visuals +
    • Added GLX_SGIS_multisample, GLX_SUN_video_resize, and GL_SUN_read_video_pixels +
    • Added MinGW/MSYS support +
    • Bug fixes in GL_ARB_shader_objects and the OS X build +
    +
+
+
    +
  • 1.1.4 [12-15-03] +
      +
    • Added GL_APPLE_float_pixels, GL_APPLE_texture_range, +GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, +GLX_ATI_pixel_format_float, and GLX_ATI_render_texture +
    • Bug fixes in GL_ATI_map_object_buffer and GL_ATI_fragment_shader +
    +
+
+
    +
  • 1.1.3 [10-28-03] +
      +
    • Added Solaris and Darwin support +
    • Added GL_ARB_fragment_shader, GL_ARB_shader_objects, and GL_ARB_vertex_shader +
    • Fixed bug in GL_WIN_swap_hint +
    • Removed glewinfo's dependency on GLUT +
    +
+
+
    +
  • 1.1.2 [09-15-03] +
      +
    • Removed dependency on WGL_{ARB,EXT}_extensions_string to make GLEW run on Matrox cards +
    • Added glewGetString for querying the GLEW version string +
    +
+
+
    +
  • 1.1.1 [08-11-03] +
      +
    • Added GLX_NV_float_buffer, GL_ARB_shading_language_100, and GL_ARB_texture_non_power_of_two +
    • Fixed bug in GL_ARB_vertex_buffer_object +
    • Minor updates in documentation +
    +
+
+
    +
  • 1.1.0 [07-08-03] +
      +
    • Added automatic code generation +
    • Added almost every extension in the registry +
    • Added separate namespace +
    • Added Irix support +
    • Updated documentation +
    +
+
+
    +
  • 1.0.7 [06-29-03] +
      +
    • Added GL_EXT_depth_bounds_test +
    • Fixed typos +
    +
+
+
    +
  • 1.0.6 [05-05-03] +
      +
    • Added ARB_vertex_buffer_object and NV_half_float +
    • Updated wglinfo +
    • Temporary Linux bug fixes (problems with SDL and MESA) +
    +
+
+
    +
  • 1.0.5 [02-17-03] +
      +
    • Bug fixes +
    • Added wglinfo +
    • Updated documentation +
    +
+
+
    +
  • 1.0.4 [02-02-03] +
      +
    • Added NV_texture_expand_normal +
    • Added mingw support +
    • Updated documentation +
    +
+
+
    +
  • 1.0.3 [01-09-03] +
      +
    • Cleaned up ATI extensions +
    • Changed function prototypes to match glext.h +
    • Added EXT_texture3D +
    • Fixed typos in ATI_vertex_attrib_array_object and ATI_draw_buffers +
    +
+
+
    +
  • 1.0.2 [12-21-02] +
      +
    • Added list of supported extensions to documentation +
    • Added NV_half_float and NV_texgen_emboss +
    +
+
+
    +
  • 1.0.1 [12-17-02] +
      +
    • Bug fixes +
    • Added glewGetExtension +
    +
+
+
    +
  • 1.0.0 [12-12-02] +
      +
    • Initial release +
    +
+
+ + +
+ + diff --git a/Windows/glew/doc/mesa.txt b/Windows/glew/doc/mesa.txt new file mode 100644 index 00000000..a82dd4bd --- /dev/null +++ b/Windows/glew/doc/mesa.txt @@ -0,0 +1,21 @@ +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Windows/glew/doc/new.png b/Windows/glew/doc/new.png new file mode 100644 index 00000000..7ce2b479 Binary files /dev/null and b/Windows/glew/doc/new.png differ diff --git a/Windows/glew/doc/ogl_sm.jpg b/Windows/glew/doc/ogl_sm.jpg new file mode 100644 index 00000000..f318d765 Binary files /dev/null and b/Windows/glew/doc/ogl_sm.jpg differ diff --git a/Windows/glew/doc/travis.png b/Windows/glew/doc/travis.png new file mode 100644 index 00000000..caf2607e Binary files /dev/null and b/Windows/glew/doc/travis.png differ diff --git a/Windows/glew/doc/wglew.html b/Windows/glew/doc/wglew.html new file mode 100644 index 00000000..bf5c9da4 --- /dev/null +++ b/Windows/glew/doc/wglew.html @@ -0,0 +1,170 @@ + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
+ + + + + + + + +
+ + + + + + + +
Latest Release: 2.1.0

GLEW Logo

+ + + + + + + + + + + + + + + +
Download
Usage
Building
Installation
Source Generation
Change Log

GitHub
Issues
Pull Requests
Authors
Licensing

SourceForge Page
+

+
+ + + + +
Last Update: 07-31-17
+ OpenGL Logo
+ GitHub Logo
+ Travis Logo
+ SourceForge Logo +
+
+
+ +

The OpenGL Extension Wrangler Library

+ + + + +

Supported WGL Extensions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1 3DFX_multisample

2 3DL_stereo_control

3 AMD_gpu_association

4 ARB_buffer_region
5 ARB_context_flush_control
6 ARB_create_context
7 ARB_create_context_no_error
8 ARB_create_context_profile
9 ARB_create_context_robustness
10 ARB_extensions_string
11 ARB_framebuffer_sRGB
12 ARB_make_current_read
13 ARB_multisample
14 ARB_pbuffer
15 ARB_pixel_format
16 ARB_pixel_format_float
17 ARB_render_texture
18 ARB_robustness_application_isolation
19 ARB_robustness_share_group_isolation

20 ATI_pixel_format_float
21 ATI_render_texture_rectangle

22 EXT_colorspace
23 EXT_create_context_es2_profile
24 EXT_create_context_es_profile
25 EXT_depth_float
26 EXT_display_color_table
27 EXT_extensions_string
28 EXT_framebuffer_sRGB
29 EXT_make_current_read
30 EXT_multisample
31 EXT_pbuffer
32 EXT_pixel_format
33 EXT_pixel_format_packed_float
34 EXT_swap_control
35 EXT_swap_control_tear

36 I3D_digital_video_control
37 I3D_gamma
38 I3D_genlock
39 I3D_image_buffer
40 I3D_swap_frame_lock
41 I3D_swap_frame_usage

42 NV_DX_interop
43 NV_DX_interop2
44 NV_copy_image
45 NV_delay_before_swap
46 NV_float_buffer
47 NV_gpu_affinity
48 NV_multisample_coverage
49 NV_present_video
50 NV_render_depth_texture
51 NV_render_texture_rectangle
52 NV_swap_group
53 NV_vertex_array_range
54 NV_video_capture
55 NV_video_output

56 OML_sync_control
+ +
+ + diff --git a/Windows/glew/glew.pc.in b/Windows/glew/glew.pc.in new file mode 100644 index 00000000..6d3d070f --- /dev/null +++ b/Windows/glew/glew.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=@libdir@ +includedir=${prefix}/include + +Name: glew +Description: The OpenGL Extension Wrangler library +Version: @version@ +Cflags: -I${includedir} @cflags@ +Libs: -L${libdir} -l@libname@ +Requires: @requireslib@ diff --git a/Windows/glew/include/GL/eglew.h b/Windows/glew/include/GL/eglew.h new file mode 100644 index 00000000..46701479 --- /dev/null +++ b/Windows/glew/include/GL/eglew.h @@ -0,0 +1,2618 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __eglew_h__ +#define __eglew_h__ +#define __EGLEW_H__ + +#ifdef __eglext_h_ +#error eglext.h included before eglew.h +#endif + +#if defined(__egl_h_) +#error egl.h included before eglew.h +#endif + +#define __eglext_h_ + +#define __egl_h_ + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY +#endif +#ifndef EGLAPI +#define EGLAPI extern +#endif + +/* EGL Types */ +#include + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t EGLint; + +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; + +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; + +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef void *EGLLabelKHR; +typedef void *EGLObjectKHR; +typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +typedef void *EGLImageKHR; +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +typedef int EGLNativeFileDescriptorKHR; +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void *EGLDeviceEXT; +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +typedef khronos_utime_nanoseconds_t EGLuint64NV; +typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; + +struct EGLClientPixmapHI; + +#define EGL_DONT_CARE ((EGLint)-1) + +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_IMAGE ((EGLImage)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_NO_SYNC ((EGLSync)0) + +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) + +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +/* ---------------------------- EGL_VERSION_1_0 ---------------------------- */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 + +#define EGL_FALSE 0 +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_TRUE 1 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_WINDOW_BIT 0x0004 +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A +#define EGL_CORE_NATIVE_ENGINE 0x305B + +typedef EGLBoolean ( * PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLBoolean ( * PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +typedef EGLContext ( * PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); +typedef EGLBoolean ( * PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean ( * PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLDisplay ( * PFNEGLGETCURRENTDISPLAYPROC) ( void ); +typedef EGLSurface ( * PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); +typedef EGLDisplay ( * PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); +typedef EGLint ( * PFNEGLGETERRORPROC) ( void ); +typedef EGLBoolean ( * PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint * major, EGLint * minor); +typedef EGLBoolean ( * PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +typedef EGLBoolean ( * PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value); +typedef const char * ( * PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean ( * PFNEGLTERMINATEPROC) (EGLDisplay dpy); +typedef EGLBoolean ( * PFNEGLWAITGLPROC) ( void ); +typedef EGLBoolean ( * PFNEGLWAITNATIVEPROC) (EGLint engine); + +#define eglChooseConfig EGLEW_GET_FUN(__eglewChooseConfig) +#define eglCopyBuffers EGLEW_GET_FUN(__eglewCopyBuffers) +#define eglCreateContext EGLEW_GET_FUN(__eglewCreateContext) +#define eglCreatePbufferSurface EGLEW_GET_FUN(__eglewCreatePbufferSurface) +#define eglCreatePixmapSurface EGLEW_GET_FUN(__eglewCreatePixmapSurface) +#define eglCreateWindowSurface EGLEW_GET_FUN(__eglewCreateWindowSurface) +#define eglDestroyContext EGLEW_GET_FUN(__eglewDestroyContext) +#define eglDestroySurface EGLEW_GET_FUN(__eglewDestroySurface) +#define eglGetConfigAttrib EGLEW_GET_FUN(__eglewGetConfigAttrib) +#define eglGetConfigs EGLEW_GET_FUN(__eglewGetConfigs) +#define eglGetCurrentDisplay EGLEW_GET_FUN(__eglewGetCurrentDisplay) +#define eglGetCurrentSurface EGLEW_GET_FUN(__eglewGetCurrentSurface) +#define eglGetDisplay EGLEW_GET_FUN(__eglewGetDisplay) +#define eglGetError EGLEW_GET_FUN(__eglewGetError) +#define eglInitialize EGLEW_GET_FUN(__eglewInitialize) +#define eglMakeCurrent EGLEW_GET_FUN(__eglewMakeCurrent) +#define eglQueryContext EGLEW_GET_FUN(__eglewQueryContext) +#define eglQueryString EGLEW_GET_FUN(__eglewQueryString) +#define eglQuerySurface EGLEW_GET_FUN(__eglewQuerySurface) +#define eglSwapBuffers EGLEW_GET_FUN(__eglewSwapBuffers) +#define eglTerminate EGLEW_GET_FUN(__eglewTerminate) +#define eglWaitGL EGLEW_GET_FUN(__eglewWaitGL) +#define eglWaitNative EGLEW_GET_FUN(__eglewWaitNative) + +#define EGLEW_VERSION_1_0 EGLEW_GET_VAR(__EGLEW_VERSION_1_0) + +#endif /* EGL_VERSION_1_0 */ + +/* ---------------------------- EGL_VERSION_1_1 ---------------------------- */ + +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 + +#define EGL_CONTEXT_LOST 0x300E +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_BACK_BUFFER 0x3084 + +typedef EGLBoolean ( * PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean ( * PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean ( * PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +typedef EGLBoolean ( * PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); + +#define eglBindTexImage EGLEW_GET_FUN(__eglewBindTexImage) +#define eglReleaseTexImage EGLEW_GET_FUN(__eglewReleaseTexImage) +#define eglSurfaceAttrib EGLEW_GET_FUN(__eglewSurfaceAttrib) +#define eglSwapInterval EGLEW_GET_FUN(__eglewSwapInterval) + +#define EGLEW_VERSION_1_1 EGLEW_GET_VAR(__EGLEW_VERSION_1_1) + +#endif /* EGL_VERSION_1_1 */ + +/* ---------------------------- EGL_VERSION_1_2 ---------------------------- */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 + +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_COLORSPACE 0x3087 +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_CLIENT_APIS 0x308D +#define EGL_RGB_BUFFER 0x308E +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_DISPLAY_SCALING 10000 + +typedef EGLBoolean ( * PFNEGLBINDAPIPROC) (EGLenum api); +typedef EGLSurface ( * PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list); +typedef EGLenum ( * PFNEGLQUERYAPIPROC) ( void ); +typedef EGLBoolean ( * PFNEGLRELEASETHREADPROC) ( void ); +typedef EGLBoolean ( * PFNEGLWAITCLIENTPROC) ( void ); + +#define eglBindAPI EGLEW_GET_FUN(__eglewBindAPI) +#define eglCreatePbufferFromClientBuffer EGLEW_GET_FUN(__eglewCreatePbufferFromClientBuffer) +#define eglQueryAPI EGLEW_GET_FUN(__eglewQueryAPI) +#define eglReleaseThread EGLEW_GET_FUN(__eglewReleaseThread) +#define eglWaitClient EGLEW_GET_FUN(__eglewWaitClient) + +#define EGLEW_VERSION_1_2 EGLEW_GET_VAR(__EGLEW_VERSION_1_2) + +#endif /* EGL_VERSION_1_2 */ + +/* ---------------------------- EGL_VERSION_1_3 ---------------------------- */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 + +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_CONFORMANT 0x3042 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +#define EGLEW_VERSION_1_3 EGLEW_GET_VAR(__EGLEW_VERSION_1_3) + +#endif /* EGL_VERSION_1_3 */ + +/* ---------------------------- EGL_VERSION_1_4 ---------------------------- */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 + +#define EGL_OPENGL_BIT 0x0008 +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 + +typedef EGLContext ( * PFNEGLGETCURRENTCONTEXTPROC) ( void ); + +#define eglGetCurrentContext EGLEW_GET_FUN(__eglewGetCurrentContext) + +#define EGLEW_VERSION_1_4 EGLEW_GET_VAR(__EGLEW_VERSION_1_4) + +#endif /* EGL_VERSION_1_4 */ + +/* ---------------------------- EGL_VERSION_1_5 ---------------------------- */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +typedef EGLImage ( * PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list); +typedef EGLSync ( * PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); +typedef EGLDisplay ( * PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void * native_display, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); + +#define eglClientWaitSync EGLEW_GET_FUN(__eglewClientWaitSync) +#define eglCreateImage EGLEW_GET_FUN(__eglewCreateImage) +#define eglCreatePlatformPixmapSurface EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurface) +#define eglCreatePlatformWindowSurface EGLEW_GET_FUN(__eglewCreatePlatformWindowSurface) +#define eglCreateSync EGLEW_GET_FUN(__eglewCreateSync) +#define eglDestroyImage EGLEW_GET_FUN(__eglewDestroyImage) +#define eglDestroySync EGLEW_GET_FUN(__eglewDestroySync) +#define eglGetPlatformDisplay EGLEW_GET_FUN(__eglewGetPlatformDisplay) +#define eglGetSyncAttrib EGLEW_GET_FUN(__eglewGetSyncAttrib) +#define eglWaitSync EGLEW_GET_FUN(__eglewWaitSync) + +#define EGLEW_VERSION_1_5 EGLEW_GET_VAR(__EGLEW_VERSION_1_5) + +#endif /* EGL_VERSION_1_5 */ + +/* ------------------------- EGL_ANDROID_blob_cache ------------------------ */ + +#ifndef EGL_ANDROID_blob_cache +#define EGL_ANDROID_blob_cache 1 + +typedef void ( * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); + +#define eglSetBlobCacheFuncsANDROID EGLEW_GET_FUN(__eglewSetBlobCacheFuncsANDROID) + +#define EGLEW_ANDROID_blob_cache EGLEW_GET_VAR(__EGLEW_ANDROID_blob_cache) + +#endif /* EGL_ANDROID_blob_cache */ + +/* ---------------- EGL_ANDROID_create_native_client_buffer ---------------- */ + +#ifndef EGL_ANDROID_create_native_client_buffer +#define EGL_ANDROID_create_native_client_buffer 1 + +#define EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 +#define EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 +#define EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 +#define EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 + +typedef EGLClientBuffer ( * PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC) (const EGLint * attrib_list); + +#define eglCreateNativeClientBufferANDROID EGLEW_GET_FUN(__eglewCreateNativeClientBufferANDROID) + +#define EGLEW_ANDROID_create_native_client_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_create_native_client_buffer) + +#endif /* EGL_ANDROID_create_native_client_buffer */ + +/* --------------------- EGL_ANDROID_framebuffer_target -------------------- */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 + +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 + +#define EGLEW_ANDROID_framebuffer_target EGLEW_GET_VAR(__EGLEW_ANDROID_framebuffer_target) + +#endif /* EGL_ANDROID_framebuffer_target */ + +/* ----------------- EGL_ANDROID_front_buffer_auto_refresh ----------------- */ + +#ifndef EGL_ANDROID_front_buffer_auto_refresh +#define EGL_ANDROID_front_buffer_auto_refresh 1 + +#define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C + +#define EGLEW_ANDROID_front_buffer_auto_refresh EGLEW_GET_VAR(__EGLEW_ANDROID_front_buffer_auto_refresh) + +#endif /* EGL_ANDROID_front_buffer_auto_refresh */ + +/* -------------------- EGL_ANDROID_image_native_buffer -------------------- */ + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 + +#define EGLEW_ANDROID_image_native_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_image_native_buffer) + +#endif /* EGL_ANDROID_image_native_buffer */ + +/* --------------------- EGL_ANDROID_native_fence_sync --------------------- */ + +#ifndef EGL_ANDROID_native_fence_sync +#define EGL_ANDROID_native_fence_sync 1 + +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 + +typedef EGLint ( * PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); + +#define eglDupNativeFenceFDANDROID EGLEW_GET_FUN(__eglewDupNativeFenceFDANDROID) + +#define EGLEW_ANDROID_native_fence_sync EGLEW_GET_VAR(__EGLEW_ANDROID_native_fence_sync) + +#endif /* EGL_ANDROID_native_fence_sync */ + +/* --------------------- EGL_ANDROID_presentation_time --------------------- */ + +#ifndef EGL_ANDROID_presentation_time +#define EGL_ANDROID_presentation_time 1 + +typedef EGLBoolean ( * PFNEGLPRESENTATIONTIMEANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); + +#define eglPresentationTimeANDROID EGLEW_GET_FUN(__eglewPresentationTimeANDROID) + +#define EGLEW_ANDROID_presentation_time EGLEW_GET_VAR(__EGLEW_ANDROID_presentation_time) + +#endif /* EGL_ANDROID_presentation_time */ + +/* ------------------------- EGL_ANDROID_recordable ------------------------ */ + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 + +#define EGL_RECORDABLE_ANDROID 0x3142 + +#define EGLEW_ANDROID_recordable EGLEW_GET_VAR(__EGLEW_ANDROID_recordable) + +#endif /* EGL_ANDROID_recordable */ + +/* ---------------- EGL_ANGLE_d3d_share_handle_client_buffer --------------- */ + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_d3d_share_handle_client_buffer EGLEW_GET_VAR(__EGLEW_ANGLE_d3d_share_handle_client_buffer) + +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ + +/* -------------------------- EGL_ANGLE_device_d3d ------------------------- */ + +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 + +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 + +#define EGLEW_ANGLE_device_d3d EGLEW_GET_VAR(__EGLEW_ANGLE_device_d3d) + +#endif /* EGL_ANGLE_device_d3d */ + +/* -------------------- EGL_ANGLE_query_surface_pointer -------------------- */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 + +typedef EGLBoolean ( * PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void ** value); + +#define eglQuerySurfacePointerANGLE EGLEW_GET_FUN(__eglewQuerySurfacePointerANGLE) + +#define EGLEW_ANGLE_query_surface_pointer EGLEW_GET_VAR(__EGLEW_ANGLE_query_surface_pointer) + +#endif /* EGL_ANGLE_query_surface_pointer */ + +/* ------------- EGL_ANGLE_surface_d3d_texture_2d_share_handle ------------- */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_surface_d3d_texture_2d_share_handle EGLEW_GET_VAR(__EGLEW_ANGLE_surface_d3d_texture_2d_share_handle) + +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +/* ---------------------- EGL_ANGLE_window_fixed_size ---------------------- */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 + +#define EGL_FIXED_SIZE_ANGLE 0x3201 + +#define EGLEW_ANGLE_window_fixed_size EGLEW_GET_VAR(__EGLEW_ANGLE_window_fixed_size) + +#endif /* EGL_ANGLE_window_fixed_size */ + +/* --------------------- EGL_ARM_implicit_external_sync -------------------- */ + +#ifndef EGL_ARM_implicit_external_sync +#define EGL_ARM_implicit_external_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A + +#define EGLEW_ARM_implicit_external_sync EGLEW_GET_VAR(__EGLEW_ARM_implicit_external_sync) + +#endif /* EGL_ARM_implicit_external_sync */ + +/* ------------------- EGL_ARM_pixmap_multisample_discard ------------------ */ + +#ifndef EGL_ARM_pixmap_multisample_discard +#define EGL_ARM_pixmap_multisample_discard 1 + +#define EGL_DISCARD_SAMPLES_ARM 0x3286 + +#define EGLEW_ARM_pixmap_multisample_discard EGLEW_GET_VAR(__EGLEW_ARM_pixmap_multisample_discard) + +#endif /* EGL_ARM_pixmap_multisample_discard */ + +/* --------------------------- EGL_EXT_buffer_age -------------------------- */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 + +#define EGL_BUFFER_AGE_EXT 0x313D + +#define EGLEW_EXT_buffer_age EGLEW_GET_VAR(__EGLEW_EXT_buffer_age) + +#endif /* EGL_EXT_buffer_age */ + +/* ----------------------- EGL_EXT_client_extensions ----------------------- */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 + +#define EGLEW_EXT_client_extensions EGLEW_GET_VAR(__EGLEW_EXT_client_extensions) + +#endif /* EGL_EXT_client_extensions */ + +/* ------------------- EGL_EXT_create_context_robustness ------------------- */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 + +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF + +#define EGLEW_EXT_create_context_robustness EGLEW_GET_VAR(__EGLEW_EXT_create_context_robustness) + +#endif /* EGL_EXT_create_context_robustness */ + +/* -------------------------- EGL_EXT_device_base -------------------------- */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +#define EGLEW_EXT_device_base EGLEW_GET_VAR(__EGLEW_EXT_device_base) + +#endif /* EGL_EXT_device_base */ + +/* --------------------------- EGL_EXT_device_drm -------------------------- */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 + +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 + +#define EGLEW_EXT_device_drm EGLEW_GET_VAR(__EGLEW_EXT_device_drm) + +#endif /* EGL_EXT_device_drm */ + +/* ----------------------- EGL_EXT_device_enumeration ---------------------- */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 + +typedef EGLBoolean ( * PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT * devices, EGLint * num_devices); + +#define eglQueryDevicesEXT EGLEW_GET_FUN(__eglewQueryDevicesEXT) + +#define EGLEW_EXT_device_enumeration EGLEW_GET_VAR(__EGLEW_EXT_device_enumeration) + +#endif /* EGL_EXT_device_enumeration */ + +/* ------------------------- EGL_EXT_device_openwf ------------------------- */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 + +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 + +#define EGLEW_EXT_device_openwf EGLEW_GET_VAR(__EGLEW_EXT_device_openwf) + +#endif /* EGL_EXT_device_openwf */ + +/* -------------------------- EGL_EXT_device_query ------------------------- */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +typedef EGLBoolean ( * PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); + +#define eglQueryDeviceAttribEXT EGLEW_GET_FUN(__eglewQueryDeviceAttribEXT) +#define eglQueryDeviceStringEXT EGLEW_GET_FUN(__eglewQueryDeviceStringEXT) +#define eglQueryDisplayAttribEXT EGLEW_GET_FUN(__eglewQueryDisplayAttribEXT) + +#define EGLEW_EXT_device_query EGLEW_GET_VAR(__EGLEW_EXT_device_query) + +#endif /* EGL_EXT_device_query */ + +/* ------------------ EGL_EXT_gl_colorspace_bt2020_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_linear +#define EGL_EXT_gl_colorspace_bt2020_linear 1 + +#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F + +#define EGLEW_EXT_gl_colorspace_bt2020_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_linear) + +#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ + +/* -------------------- EGL_EXT_gl_colorspace_bt2020_pq -------------------- */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_pq +#define EGL_EXT_gl_colorspace_bt2020_pq 1 + +#define EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 + +#define EGLEW_EXT_gl_colorspace_bt2020_pq EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_pq) + +#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ + +/* ------------------- EGL_EXT_gl_colorspace_scrgb_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_scrgb_linear +#define EGL_EXT_gl_colorspace_scrgb_linear 1 + +#define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 + +#define EGLEW_EXT_gl_colorspace_scrgb_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_scrgb_linear) + +#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ + +/* ---------------------- EGL_EXT_image_dma_buf_import --------------------- */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 + +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 + +#define EGLEW_EXT_image_dma_buf_import EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import) + +#endif /* EGL_EXT_image_dma_buf_import */ + +/* ----------------- EGL_EXT_image_dma_buf_import_modifiers ---------------- */ + +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#define EGL_EXT_image_dma_buf_import_modifiers 1 + +#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 +#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 +#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 +#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 +#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 +#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 +#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 +#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 +#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 +#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 +#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A + +typedef EGLBoolean ( * PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); +typedef EGLBoolean ( * PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); + +#define eglQueryDmaBufFormatsEXT EGLEW_GET_FUN(__eglewQueryDmaBufFormatsEXT) +#define eglQueryDmaBufModifiersEXT EGLEW_GET_FUN(__eglewQueryDmaBufModifiersEXT) + +#define EGLEW_EXT_image_dma_buf_import_modifiers EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import_modifiers) + +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ + +/* ------------------------ EGL_EXT_multiview_window ----------------------- */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 + +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 + +#define EGLEW_EXT_multiview_window EGLEW_GET_VAR(__EGLEW_EXT_multiview_window) + +#endif /* EGL_EXT_multiview_window */ + +/* -------------------------- EGL_EXT_output_base -------------------------- */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 + +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F + +typedef EGLBoolean ( * PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputLayerEXT * layers, EGLint max_layers, EGLint * num_layers); +typedef EGLBoolean ( * PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputPortEXT * ports, EGLint max_ports, EGLint * num_ports); +typedef EGLBoolean ( * PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); + +#define eglGetOutputLayersEXT EGLEW_GET_FUN(__eglewGetOutputLayersEXT) +#define eglGetOutputPortsEXT EGLEW_GET_FUN(__eglewGetOutputPortsEXT) +#define eglOutputLayerAttribEXT EGLEW_GET_FUN(__eglewOutputLayerAttribEXT) +#define eglOutputPortAttribEXT EGLEW_GET_FUN(__eglewOutputPortAttribEXT) +#define eglQueryOutputLayerAttribEXT EGLEW_GET_FUN(__eglewQueryOutputLayerAttribEXT) +#define eglQueryOutputLayerStringEXT EGLEW_GET_FUN(__eglewQueryOutputLayerStringEXT) +#define eglQueryOutputPortAttribEXT EGLEW_GET_FUN(__eglewQueryOutputPortAttribEXT) +#define eglQueryOutputPortStringEXT EGLEW_GET_FUN(__eglewQueryOutputPortStringEXT) + +#define EGLEW_EXT_output_base EGLEW_GET_VAR(__EGLEW_EXT_output_base) + +#endif /* EGL_EXT_output_base */ + +/* --------------------------- EGL_EXT_output_drm -------------------------- */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 + +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 + +#define EGLEW_EXT_output_drm EGLEW_GET_VAR(__EGLEW_EXT_output_drm) + +#endif /* EGL_EXT_output_drm */ + +/* ------------------------- EGL_EXT_output_openwf ------------------------- */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 + +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 + +#define EGLEW_EXT_output_openwf EGLEW_GET_VAR(__EGLEW_EXT_output_openwf) + +#endif /* EGL_EXT_output_openwf */ + +/* ----------------------- EGL_EXT_pixel_format_float ---------------------- */ + +#ifndef EGL_EXT_pixel_format_float +#define EGL_EXT_pixel_format_float 1 + +#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 +#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A +#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B + +#define EGLEW_EXT_pixel_format_float EGLEW_GET_VAR(__EGLEW_EXT_pixel_format_float) + +#endif /* EGL_EXT_pixel_format_float */ + +/* ------------------------- EGL_EXT_platform_base ------------------------- */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 + +typedef EGLSurface ( * PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLint * attrib_list); +typedef EGLDisplay ( * PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void * native_display, const EGLint * attrib_list); + +#define eglCreatePlatformPixmapSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurfaceEXT) +#define eglCreatePlatformWindowSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformWindowSurfaceEXT) +#define eglGetPlatformDisplayEXT EGLEW_GET_FUN(__eglewGetPlatformDisplayEXT) + +#define EGLEW_EXT_platform_base EGLEW_GET_VAR(__EGLEW_EXT_platform_base) + +#endif /* EGL_EXT_platform_base */ + +/* ------------------------ EGL_EXT_platform_device ------------------------ */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 + +#define EGL_PLATFORM_DEVICE_EXT 0x313F + +#define EGLEW_EXT_platform_device EGLEW_GET_VAR(__EGLEW_EXT_platform_device) + +#endif /* EGL_EXT_platform_device */ + +/* ------------------------ EGL_EXT_platform_wayland ----------------------- */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 + +#define EGLEW_EXT_platform_wayland EGLEW_GET_VAR(__EGLEW_EXT_platform_wayland) + +#endif /* EGL_EXT_platform_wayland */ + +/* -------------------------- EGL_EXT_platform_x11 ------------------------- */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 + +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 + +#define EGLEW_EXT_platform_x11 EGLEW_GET_VAR(__EGLEW_EXT_platform_x11) + +#endif /* EGL_EXT_platform_x11 */ + +/* ----------------------- EGL_EXT_protected_content ----------------------- */ + +#ifndef EGL_EXT_protected_content +#define EGL_EXT_protected_content 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_content EGLEW_GET_VAR(__EGLEW_EXT_protected_content) + +#endif /* EGL_EXT_protected_content */ + +/* ----------------------- EGL_EXT_protected_surface ----------------------- */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_surface EGLEW_GET_VAR(__EGLEW_EXT_protected_surface) + +#endif /* EGL_EXT_protected_surface */ + +/* ------------------- EGL_EXT_stream_consumer_egloutput ------------------- */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); + +#define eglStreamConsumerOutputEXT EGLEW_GET_FUN(__eglewStreamConsumerOutputEXT) + +#define EGLEW_EXT_stream_consumer_egloutput EGLEW_GET_VAR(__EGLEW_EXT_stream_consumer_egloutput) + +#endif /* EGL_EXT_stream_consumer_egloutput */ + +/* ------------------- EGL_EXT_surface_SMPTE2086_metadata ------------------ */ + +#ifndef EGL_EXT_surface_SMPTE2086_metadata +#define EGL_EXT_surface_SMPTE2086_metadata 1 + +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 +#define EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 +#define EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 +#define EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 +#define EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A + +#define EGLEW_EXT_surface_SMPTE2086_metadata EGLEW_GET_VAR(__EGLEW_EXT_surface_SMPTE2086_metadata) + +#endif /* EGL_EXT_surface_SMPTE2086_metadata */ + +/* -------------------- EGL_EXT_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageEXT EGLEW_GET_FUN(__eglewSwapBuffersWithDamageEXT) + +#define EGLEW_EXT_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_EXT_swap_buffers_with_damage) + +#endif /* EGL_EXT_swap_buffers_with_damage */ + +/* -------------------------- EGL_EXT_yuv_surface -------------------------- */ + +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D + +#define EGLEW_EXT_yuv_surface EGLEW_GET_VAR(__EGLEW_EXT_yuv_surface) + +#endif /* EGL_EXT_yuv_surface */ + +/* -------------------------- EGL_HI_clientpixmap -------------------------- */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 + +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 + +typedef EGLSurface ( * PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI * pixmap); + +#define eglCreatePixmapSurfaceHI EGLEW_GET_FUN(__eglewCreatePixmapSurfaceHI) + +#define EGLEW_HI_clientpixmap EGLEW_GET_VAR(__EGLEW_HI_clientpixmap) + +#endif /* EGL_HI_clientpixmap */ + +/* -------------------------- EGL_HI_colorformats -------------------------- */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 + +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 + +#define EGLEW_HI_colorformats EGLEW_GET_VAR(__EGLEW_HI_colorformats) + +#endif /* EGL_HI_colorformats */ + +/* ------------------------ EGL_IMG_context_priority ----------------------- */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 + +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 + +#define EGLEW_IMG_context_priority EGLEW_GET_VAR(__EGLEW_IMG_context_priority) + +#endif /* EGL_IMG_context_priority */ + +/* ---------------------- EGL_IMG_image_plane_attribs ---------------------- */ + +#ifndef EGL_IMG_image_plane_attribs +#define EGL_IMG_image_plane_attribs 1 + +#define EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 +#define EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 + +#define EGLEW_IMG_image_plane_attribs EGLEW_GET_VAR(__EGLEW_IMG_image_plane_attribs) + +#endif /* EGL_IMG_image_plane_attribs */ + +/* ---------------------------- EGL_KHR_cl_event --------------------------- */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +#define EGLEW_KHR_cl_event EGLEW_GET_VAR(__EGLEW_KHR_cl_event) + +#endif /* EGL_KHR_cl_event */ + +/* --------------------------- EGL_KHR_cl_event2 --------------------------- */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +typedef EGLSyncKHR ( * PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR * attrib_list); + +#define eglCreateSync64KHR EGLEW_GET_FUN(__eglewCreateSync64KHR) + +#define EGLEW_KHR_cl_event2 EGLEW_GET_VAR(__EGLEW_KHR_cl_event2) + +#endif /* EGL_KHR_cl_event2 */ + +/* ----------------- EGL_KHR_client_get_all_proc_addresses ----------------- */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 + +#define EGLEW_KHR_client_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_client_get_all_proc_addresses) + +#endif /* EGL_KHR_client_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_config_attribs ------------------------ */ + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 + +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#define EGL_CONFORMANT_KHR 0x3042 + +#define EGLEW_KHR_config_attribs EGLEW_GET_VAR(__EGLEW_KHR_config_attribs) + +#endif /* EGL_KHR_config_attribs */ + +/* --------------------- EGL_KHR_context_flush_control --------------------- */ + +#ifndef EGL_KHR_context_flush_control +#define EGL_KHR_context_flush_control 1 + +#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 + +#define EGLEW_KHR_context_flush_control EGLEW_GET_VAR(__EGLEW_KHR_context_flush_control) + +#endif /* EGL_KHR_context_flush_control */ + +/* ------------------------- EGL_KHR_create_context ------------------------ */ + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF + +#define EGLEW_KHR_create_context EGLEW_GET_VAR(__EGLEW_KHR_create_context) + +#endif /* EGL_KHR_create_context */ + +/* -------------------- EGL_KHR_create_context_no_error -------------------- */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 + +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 + +#define EGLEW_KHR_create_context_no_error EGLEW_GET_VAR(__EGLEW_KHR_create_context_no_error) + +#endif /* EGL_KHR_create_context_no_error */ + +/* ----------------------------- EGL_KHR_debug ----------------------------- */ + +#ifndef EGL_KHR_debug +#define EGL_KHR_debug 1 + +#define EGL_OBJECT_THREAD_KHR 0x33B0 +#define EGL_OBJECT_DISPLAY_KHR 0x33B1 +#define EGL_OBJECT_CONTEXT_KHR 0x33B2 +#define EGL_OBJECT_SURFACE_KHR 0x33B3 +#define EGL_OBJECT_IMAGE_KHR 0x33B4 +#define EGL_OBJECT_SYNC_KHR 0x33B5 +#define EGL_OBJECT_STREAM_KHR 0x33B6 +#define EGL_DEBUG_CALLBACK_KHR 0x33B8 +#define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 +#define EGL_DEBUG_MSG_ERROR_KHR 0x33BA +#define EGL_DEBUG_MSG_WARN_KHR 0x33BB +#define EGL_DEBUG_MSG_INFO_KHR 0x33BC + +typedef EGLint ( * PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list); +typedef EGLint ( * PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); +typedef EGLBoolean ( * PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib * value); + +#define eglDebugMessageControlKHR EGLEW_GET_FUN(__eglewDebugMessageControlKHR) +#define eglLabelObjectKHR EGLEW_GET_FUN(__eglewLabelObjectKHR) +#define eglQueryDebugKHR EGLEW_GET_FUN(__eglewQueryDebugKHR) + +#define EGLEW_KHR_debug EGLEW_GET_VAR(__EGLEW_KHR_debug) + +#endif /* EGL_KHR_debug */ + +/* --------------------------- EGL_KHR_fence_sync -------------------------- */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 + +#define EGLEW_KHR_fence_sync EGLEW_GET_VAR(__EGLEW_KHR_fence_sync) + +#endif /* EGL_KHR_fence_sync */ + +/* --------------------- EGL_KHR_get_all_proc_addresses -------------------- */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 + +#define EGLEW_KHR_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_get_all_proc_addresses) + +#endif /* EGL_KHR_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_gl_colorspace ------------------------- */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 + +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#define EGL_GL_COLORSPACE_KHR 0x309D + +#define EGLEW_KHR_gl_colorspace EGLEW_GET_VAR(__EGLEW_KHR_gl_colorspace) + +#endif /* EGL_KHR_gl_colorspace */ + +/* --------------------- EGL_KHR_gl_renderbuffer_image --------------------- */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 + +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 + +#define EGLEW_KHR_gl_renderbuffer_image EGLEW_GET_VAR(__EGLEW_KHR_gl_renderbuffer_image) + +#endif /* EGL_KHR_gl_renderbuffer_image */ + +/* ---------------------- EGL_KHR_gl_texture_2D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 + +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC + +#define EGLEW_KHR_gl_texture_2D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_2D_image) + +#endif /* EGL_KHR_gl_texture_2D_image */ + +/* ---------------------- EGL_KHR_gl_texture_3D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 + +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD + +#define EGLEW_KHR_gl_texture_3D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_3D_image) + +#endif /* EGL_KHR_gl_texture_3D_image */ + +/* -------------------- EGL_KHR_gl_texture_cubemap_image ------------------- */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 + +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 + +#define EGLEW_KHR_gl_texture_cubemap_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_cubemap_image) + +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +/* ----------------------------- EGL_KHR_image ----------------------------- */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +typedef EGLImageKHR ( * PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); + +#define eglCreateImageKHR EGLEW_GET_FUN(__eglewCreateImageKHR) +#define eglDestroyImageKHR EGLEW_GET_FUN(__eglewDestroyImageKHR) + +#define EGLEW_KHR_image EGLEW_GET_VAR(__EGLEW_KHR_image) + +#endif /* EGL_KHR_image */ + +/* --------------------------- EGL_KHR_image_base -------------------------- */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 + +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 + +#define EGLEW_KHR_image_base EGLEW_GET_VAR(__EGLEW_KHR_image_base) + +#endif /* EGL_KHR_image_base */ + +/* -------------------------- EGL_KHR_image_pixmap ------------------------- */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +#define EGLEW_KHR_image_pixmap EGLEW_GET_VAR(__EGLEW_KHR_image_pixmap) + +#endif /* EGL_KHR_image_pixmap */ + +/* -------------------------- EGL_KHR_lock_surface ------------------------- */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF + +typedef EGLBoolean ( * PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); + +#define eglLockSurfaceKHR EGLEW_GET_FUN(__eglewLockSurfaceKHR) +#define eglUnlockSurfaceKHR EGLEW_GET_FUN(__eglewUnlockSurfaceKHR) + +#define EGLEW_KHR_lock_surface EGLEW_GET_VAR(__EGLEW_KHR_lock_surface) + +#endif /* EGL_KHR_lock_surface */ + +/* ------------------------- EGL_KHR_lock_surface2 ------------------------- */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 + +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +#define EGLEW_KHR_lock_surface2 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface2) + +#endif /* EGL_KHR_lock_surface2 */ + +/* ------------------------- EGL_KHR_lock_surface3 ------------------------- */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +typedef EGLBoolean ( * PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR * value); + +#define eglQuerySurface64KHR EGLEW_GET_FUN(__eglewQuerySurface64KHR) + +#define EGLEW_KHR_lock_surface3 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface3) + +#endif /* EGL_KHR_lock_surface3 */ + +/* --------------------- EGL_KHR_mutable_render_buffer --------------------- */ + +#ifndef EGL_KHR_mutable_render_buffer +#define EGL_KHR_mutable_render_buffer 1 + +#define EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 + +#define EGLEW_KHR_mutable_render_buffer EGLEW_GET_VAR(__EGLEW_KHR_mutable_render_buffer) + +#endif /* EGL_KHR_mutable_render_buffer */ + +/* ----------------------- EGL_KHR_no_config_context ----------------------- */ + +#ifndef EGL_KHR_no_config_context +#define EGL_KHR_no_config_context 1 + +#define EGLEW_KHR_no_config_context EGLEW_GET_VAR(__EGLEW_KHR_no_config_context) + +#endif /* EGL_KHR_no_config_context */ + +/* ------------------------- EGL_KHR_partial_update ------------------------ */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 + +#define EGL_BUFFER_AGE_KHR 0x313D + +typedef EGLBoolean ( * PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSetDamageRegionKHR EGLEW_GET_FUN(__eglewSetDamageRegionKHR) + +#define EGLEW_KHR_partial_update EGLEW_GET_VAR(__EGLEW_KHR_partial_update) + +#endif /* EGL_KHR_partial_update */ + +/* ------------------------ EGL_KHR_platform_android ----------------------- */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 + +#define EGL_PLATFORM_ANDROID_KHR 0x3141 + +#define EGLEW_KHR_platform_android EGLEW_GET_VAR(__EGLEW_KHR_platform_android) + +#endif /* EGL_KHR_platform_android */ + +/* -------------------------- EGL_KHR_platform_gbm ------------------------- */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 + +#define EGL_PLATFORM_GBM_KHR 0x31D7 + +#define EGLEW_KHR_platform_gbm EGLEW_GET_VAR(__EGLEW_KHR_platform_gbm) + +#endif /* EGL_KHR_platform_gbm */ + +/* ------------------------ EGL_KHR_platform_wayland ----------------------- */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 + +#define EGLEW_KHR_platform_wayland EGLEW_GET_VAR(__EGLEW_KHR_platform_wayland) + +#endif /* EGL_KHR_platform_wayland */ + +/* -------------------------- EGL_KHR_platform_x11 ------------------------- */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 + +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 + +#define EGLEW_KHR_platform_x11 EGLEW_GET_VAR(__EGLEW_KHR_platform_x11) + +#endif /* EGL_KHR_platform_x11 */ + +/* ------------------------- EGL_KHR_reusable_sync ------------------------- */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLSyncKHR ( * PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); + +#define eglClientWaitSyncKHR EGLEW_GET_FUN(__eglewClientWaitSyncKHR) +#define eglCreateSyncKHR EGLEW_GET_FUN(__eglewCreateSyncKHR) +#define eglDestroySyncKHR EGLEW_GET_FUN(__eglewDestroySyncKHR) +#define eglGetSyncAttribKHR EGLEW_GET_FUN(__eglewGetSyncAttribKHR) +#define eglSignalSyncKHR EGLEW_GET_FUN(__eglewSignalSyncKHR) + +#define EGLEW_KHR_reusable_sync EGLEW_GET_VAR(__EGLEW_KHR_reusable_sync) + +#endif /* EGL_KHR_reusable_sync */ + +/* ----------------------------- EGL_KHR_stream ---------------------------- */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR * value); +typedef EGLBoolean ( * PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); + +#define eglCreateStreamKHR EGLEW_GET_FUN(__eglewCreateStreamKHR) +#define eglDestroyStreamKHR EGLEW_GET_FUN(__eglewDestroyStreamKHR) +#define eglQueryStreamKHR EGLEW_GET_FUN(__eglewQueryStreamKHR) +#define eglQueryStreamu64KHR EGLEW_GET_FUN(__eglewQueryStreamu64KHR) +#define eglStreamAttribKHR EGLEW_GET_FUN(__eglewStreamAttribKHR) + +#define EGLEW_KHR_stream EGLEW_GET_VAR(__EGLEW_KHR_stream) + +#endif /* EGL_KHR_stream */ + +/* ------------------------- EGL_KHR_stream_attrib ------------------------- */ + +#ifndef EGL_KHR_stream_attrib +#define EGL_KHR_stream_attrib 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMATTRIBKHRPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); + +#define eglCreateStreamAttribKHR EGLEW_GET_FUN(__eglewCreateStreamAttribKHR) +#define eglQueryStreamAttribKHR EGLEW_GET_FUN(__eglewQueryStreamAttribKHR) +#define eglSetStreamAttribKHR EGLEW_GET_FUN(__eglewSetStreamAttribKHR) +#define eglStreamConsumerAcquireAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireAttribKHR) +#define eglStreamConsumerReleaseAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseAttribKHR) + +#define EGLEW_KHR_stream_attrib EGLEW_GET_VAR(__EGLEW_KHR_stream_attrib) + +#endif /* EGL_KHR_stream_attrib */ + +/* ------------------- EGL_KHR_stream_consumer_gltexture ------------------- */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 + +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglStreamConsumerAcquireKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireKHR) +#define eglStreamConsumerGLTextureExternalKHR EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalKHR) +#define eglStreamConsumerReleaseKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseKHR) + +#define EGLEW_KHR_stream_consumer_gltexture EGLEW_GET_VAR(__EGLEW_KHR_stream_consumer_gltexture) + +#endif /* EGL_KHR_stream_consumer_gltexture */ + +/* -------------------- EGL_KHR_stream_cross_process_fd -------------------- */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +typedef EGLNativeFileDescriptorKHR ( * PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglCreateStreamFromFileDescriptorKHR EGLEW_GET_FUN(__eglewCreateStreamFromFileDescriptorKHR) +#define eglGetStreamFileDescriptorKHR EGLEW_GET_FUN(__eglewGetStreamFileDescriptorKHR) + +#define EGLEW_KHR_stream_cross_process_fd EGLEW_GET_VAR(__EGLEW_KHR_stream_cross_process_fd) + +#endif /* EGL_KHR_stream_cross_process_fd */ + +/* -------------------------- EGL_KHR_stream_fifo -------------------------- */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 + +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF + +typedef EGLBoolean ( * PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR * value); + +#define eglQueryStreamTimeKHR EGLEW_GET_FUN(__eglewQueryStreamTimeKHR) + +#define EGLEW_KHR_stream_fifo EGLEW_GET_VAR(__EGLEW_KHR_stream_fifo) + +#endif /* EGL_KHR_stream_fifo */ + +/* ----------------- EGL_KHR_stream_producer_aldatalocator ----------------- */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 + +#define EGLEW_KHR_stream_producer_aldatalocator EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_aldatalocator) + +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +/* ------------------- EGL_KHR_stream_producer_eglsurface ------------------ */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 + +#define EGL_STREAM_BIT_KHR 0x0800 + +typedef EGLSurface ( * PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint * attrib_list); + +#define eglCreateStreamProducerSurfaceKHR EGLEW_GET_FUN(__eglewCreateStreamProducerSurfaceKHR) + +#define EGLEW_KHR_stream_producer_eglsurface EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_eglsurface) + +#endif /* EGL_KHR_stream_producer_eglsurface */ + +/* ---------------------- EGL_KHR_surfaceless_context ---------------------- */ + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 + +#define EGLEW_KHR_surfaceless_context EGLEW_GET_VAR(__EGLEW_KHR_surfaceless_context) + +#endif /* EGL_KHR_surfaceless_context */ + +/* -------------------- EGL_KHR_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageKHR EGLEW_GET_FUN(__eglewSwapBuffersWithDamageKHR) + +#define EGLEW_KHR_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_KHR_swap_buffers_with_damage) + +#endif /* EGL_KHR_swap_buffers_with_damage */ + +/* ------------------------ EGL_KHR_vg_parent_image ------------------------ */ + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 + +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA + +#define EGLEW_KHR_vg_parent_image EGLEW_GET_VAR(__EGLEW_KHR_vg_parent_image) + +#endif /* EGL_KHR_vg_parent_image */ + +/* --------------------------- EGL_KHR_wait_sync --------------------------- */ + +#ifndef EGL_KHR_wait_sync +#define EGL_KHR_wait_sync 1 + +typedef EGLint ( * PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); + +#define eglWaitSyncKHR EGLEW_GET_FUN(__eglewWaitSyncKHR) + +#define EGLEW_KHR_wait_sync EGLEW_GET_VAR(__EGLEW_KHR_wait_sync) + +#endif /* EGL_KHR_wait_sync */ + +/* --------------------------- EGL_MESA_drm_image -------------------------- */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 + +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 + +typedef EGLImageKHR ( * PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint * name, EGLint * handle, EGLint * stride); + +#define eglCreateDRMImageMESA EGLEW_GET_FUN(__eglewCreateDRMImageMESA) +#define eglExportDRMImageMESA EGLEW_GET_FUN(__eglewExportDRMImageMESA) + +#define EGLEW_MESA_drm_image EGLEW_GET_VAR(__EGLEW_MESA_drm_image) + +#endif /* EGL_MESA_drm_image */ + +/* --------------------- EGL_MESA_image_dma_buf_export --------------------- */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 + +typedef EGLBoolean ( * PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fds, EGLint * strides, EGLint * offsets); +typedef EGLBoolean ( * PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fourcc, int * num_planes, EGLuint64KHR * modifiers); + +#define eglExportDMABUFImageMESA EGLEW_GET_FUN(__eglewExportDMABUFImageMESA) +#define eglExportDMABUFImageQueryMESA EGLEW_GET_FUN(__eglewExportDMABUFImageQueryMESA) + +#define EGLEW_MESA_image_dma_buf_export EGLEW_GET_VAR(__EGLEW_MESA_image_dma_buf_export) + +#endif /* EGL_MESA_image_dma_buf_export */ + +/* ------------------------- EGL_MESA_platform_gbm ------------------------- */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 + +#define EGL_PLATFORM_GBM_MESA 0x31D7 + +#define EGLEW_MESA_platform_gbm EGLEW_GET_VAR(__EGLEW_MESA_platform_gbm) + +#endif /* EGL_MESA_platform_gbm */ + +/* --------------------- EGL_MESA_platform_surfaceless --------------------- */ + +#ifndef EGL_MESA_platform_surfaceless +#define EGL_MESA_platform_surfaceless 1 + +#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD + +#define EGLEW_MESA_platform_surfaceless EGLEW_GET_VAR(__EGLEW_MESA_platform_surfaceless) + +#endif /* EGL_MESA_platform_surfaceless */ + +/* -------------------------- EGL_NOK_swap_region -------------------------- */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegionNOK EGLEW_GET_FUN(__eglewSwapBuffersRegionNOK) + +#define EGLEW_NOK_swap_region EGLEW_GET_VAR(__EGLEW_NOK_swap_region) + +#endif /* EGL_NOK_swap_region */ + +/* -------------------------- EGL_NOK_swap_region2 ------------------------- */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegion2NOK EGLEW_GET_FUN(__eglewSwapBuffersRegion2NOK) + +#define EGLEW_NOK_swap_region2 EGLEW_GET_VAR(__EGLEW_NOK_swap_region2) + +#endif /* EGL_NOK_swap_region2 */ + +/* ---------------------- EGL_NOK_texture_from_pixmap ---------------------- */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 + +#define EGL_Y_INVERTED_NOK 0x307F + +#define EGLEW_NOK_texture_from_pixmap EGLEW_GET_VAR(__EGLEW_NOK_texture_from_pixmap) + +#endif /* EGL_NOK_texture_from_pixmap */ + +/* ------------------------ EGL_NV_3dvision_surface ------------------------ */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 + +#define EGL_AUTO_STEREO_NV 0x3136 + +#define EGLEW_NV_3dvision_surface EGLEW_GET_VAR(__EGLEW_NV_3dvision_surface) + +#endif /* EGL_NV_3dvision_surface */ + +/* ------------------------- EGL_NV_coverage_sample ------------------------ */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 + +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 + +#define EGLEW_NV_coverage_sample EGLEW_GET_VAR(__EGLEW_NV_coverage_sample) + +#endif /* EGL_NV_coverage_sample */ + +/* --------------------- EGL_NV_coverage_sample_resolve -------------------- */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 + +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 + +#define EGLEW_NV_coverage_sample_resolve EGLEW_GET_VAR(__EGLEW_NV_coverage_sample_resolve) + +#endif /* EGL_NV_coverage_sample_resolve */ + +/* --------------------------- EGL_NV_cuda_event --------------------------- */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 + +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D + +#define EGLEW_NV_cuda_event EGLEW_GET_VAR(__EGLEW_NV_cuda_event) + +#endif /* EGL_NV_cuda_event */ + +/* ------------------------- EGL_NV_depth_nonlinear ------------------------ */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 + +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 + +#define EGLEW_NV_depth_nonlinear EGLEW_GET_VAR(__EGLEW_NV_depth_nonlinear) + +#endif /* EGL_NV_depth_nonlinear */ + +/* --------------------------- EGL_NV_device_cuda -------------------------- */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 + +#define EGL_CUDA_DEVICE_NV 0x323A + +#define EGLEW_NV_device_cuda EGLEW_GET_VAR(__EGLEW_NV_device_cuda) + +#endif /* EGL_NV_device_cuda */ + +/* -------------------------- EGL_NV_native_query -------------------------- */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 + +typedef EGLBoolean ( * PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType * display_id); +typedef EGLBoolean ( * PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType * pixmap); +typedef EGLBoolean ( * PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType * window); + +#define eglQueryNativeDisplayNV EGLEW_GET_FUN(__eglewQueryNativeDisplayNV) +#define eglQueryNativePixmapNV EGLEW_GET_FUN(__eglewQueryNativePixmapNV) +#define eglQueryNativeWindowNV EGLEW_GET_FUN(__eglewQueryNativeWindowNV) + +#define EGLEW_NV_native_query EGLEW_GET_VAR(__EGLEW_NV_native_query) + +#endif /* EGL_NV_native_query */ + +/* ---------------------- EGL_NV_post_convert_rounding --------------------- */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 + +#define EGLEW_NV_post_convert_rounding EGLEW_GET_VAR(__EGLEW_NV_post_convert_rounding) + +#endif /* EGL_NV_post_convert_rounding */ + +/* ------------------------- EGL_NV_post_sub_buffer ------------------------ */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 + +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE + +typedef EGLBoolean ( * PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); + +#define eglPostSubBufferNV EGLEW_GET_FUN(__eglewPostSubBufferNV) + +#define EGLEW_NV_post_sub_buffer EGLEW_GET_VAR(__EGLEW_NV_post_sub_buffer) + +#endif /* EGL_NV_post_sub_buffer */ + +/* ------------------ EGL_NV_robustness_video_memory_purge ----------------- */ + +#ifndef EGL_NV_robustness_video_memory_purge +#define EGL_NV_robustness_video_memory_purge 1 + +#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C + +#define EGLEW_NV_robustness_video_memory_purge EGLEW_GET_VAR(__EGLEW_NV_robustness_video_memory_purge) + +#endif /* EGL_NV_robustness_video_memory_purge */ + +/* ------------------ EGL_NV_stream_consumer_gltexture_yuv ----------------- */ + +#ifndef EGL_NV_stream_consumer_gltexture_yuv +#define EGL_NV_stream_consumer_gltexture_yuv 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C +#define EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D +#define EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLAttrib *attrib_list); + +#define eglStreamConsumerGLTextureExternalAttribsNV EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalAttribsNV) + +#define EGLEW_NV_stream_consumer_gltexture_yuv EGLEW_GET_VAR(__EGLEW_NV_stream_consumer_gltexture_yuv) + +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ + +/* ---------------------- EGL_NV_stream_cross_display ---------------------- */ + +#ifndef EGL_NV_stream_cross_display +#define EGL_NV_stream_cross_display 1 + +#define EGL_STREAM_CROSS_DISPLAY_NV 0x334E + +#define EGLEW_NV_stream_cross_display EGLEW_GET_VAR(__EGLEW_NV_stream_cross_display) + +#endif /* EGL_NV_stream_cross_display */ + +/* ----------------------- EGL_NV_stream_cross_object ---------------------- */ + +#ifndef EGL_NV_stream_cross_object +#define EGL_NV_stream_cross_object 1 + +#define EGL_STREAM_CROSS_OBJECT_NV 0x334D + +#define EGLEW_NV_stream_cross_object EGLEW_GET_VAR(__EGLEW_NV_stream_cross_object) + +#endif /* EGL_NV_stream_cross_object */ + +/* --------------------- EGL_NV_stream_cross_partition --------------------- */ + +#ifndef EGL_NV_stream_cross_partition +#define EGL_NV_stream_cross_partition 1 + +#define EGL_STREAM_CROSS_PARTITION_NV 0x323F + +#define EGLEW_NV_stream_cross_partition EGLEW_GET_VAR(__EGLEW_NV_stream_cross_partition) + +#endif /* EGL_NV_stream_cross_partition */ + +/* ---------------------- EGL_NV_stream_cross_process ---------------------- */ + +#ifndef EGL_NV_stream_cross_process +#define EGL_NV_stream_cross_process 1 + +#define EGL_STREAM_CROSS_PROCESS_NV 0x3245 + +#define EGLEW_NV_stream_cross_process EGLEW_GET_VAR(__EGLEW_NV_stream_cross_process) + +#endif /* EGL_NV_stream_cross_process */ + +/* ----------------------- EGL_NV_stream_cross_system ---------------------- */ + +#ifndef EGL_NV_stream_cross_system +#define EGL_NV_stream_cross_system 1 + +#define EGL_STREAM_CROSS_SYSTEM_NV 0x334F + +#define EGLEW_NV_stream_cross_system EGLEW_GET_VAR(__EGLEW_NV_stream_cross_system) + +#endif /* EGL_NV_stream_cross_system */ + +/* ------------------------ EGL_NV_stream_fifo_next ------------------------ */ + +#ifndef EGL_NV_stream_fifo_next +#define EGL_NV_stream_fifo_next 1 + +#define EGL_PENDING_FRAME_NV 0x3329 +#define EGL_STREAM_TIME_PENDING_NV 0x332A + +#define EGLEW_NV_stream_fifo_next EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_next) + +#endif /* EGL_NV_stream_fifo_next */ + +/* --------------------- EGL_NV_stream_fifo_synchronous -------------------- */ + +#ifndef EGL_NV_stream_fifo_synchronous +#define EGL_NV_stream_fifo_synchronous 1 + +#define EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 + +#define EGLEW_NV_stream_fifo_synchronous EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_synchronous) + +#endif /* EGL_NV_stream_fifo_synchronous */ + +/* ----------------------- EGL_NV_stream_frame_limits ---------------------- */ + +#ifndef EGL_NV_stream_frame_limits +#define EGL_NV_stream_frame_limits 1 + +#define EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 +#define EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 + +#define EGLEW_NV_stream_frame_limits EGLEW_GET_VAR(__EGLEW_NV_stream_frame_limits) + +#endif /* EGL_NV_stream_frame_limits */ + +/* ------------------------- EGL_NV_stream_metadata ------------------------ */ + +#ifndef EGL_NV_stream_metadata +#define EGL_NV_stream_metadata 1 + +#define EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 +#define EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 +#define EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 +#define EGL_PRODUCER_METADATA_NV 0x3253 +#define EGL_CONSUMER_METADATA_NV 0x3254 +#define EGL_METADATA0_SIZE_NV 0x3255 +#define EGL_METADATA1_SIZE_NV 0x3256 +#define EGL_METADATA2_SIZE_NV 0x3257 +#define EGL_METADATA3_SIZE_NV 0x3258 +#define EGL_METADATA0_TYPE_NV 0x3259 +#define EGL_METADATA1_TYPE_NV 0x325A +#define EGL_METADATA2_TYPE_NV 0x325B +#define EGL_METADATA3_TYPE_NV 0x325C +#define EGL_PENDING_METADATA_NV 0x3328 + +typedef EGLBoolean ( * PFNEGLQUERYDISPLAYATTRIBNVPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void * data); +typedef EGLBoolean ( * PFNEGLSETSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void * data); + +#define eglQueryDisplayAttribNV EGLEW_GET_FUN(__eglewQueryDisplayAttribNV) +#define eglQueryStreamMetadataNV EGLEW_GET_FUN(__eglewQueryStreamMetadataNV) +#define eglSetStreamMetadataNV EGLEW_GET_FUN(__eglewSetStreamMetadataNV) + +#define EGLEW_NV_stream_metadata EGLEW_GET_VAR(__EGLEW_NV_stream_metadata) + +#endif /* EGL_NV_stream_metadata */ + +/* -------------------------- EGL_NV_stream_remote ------------------------- */ + +#ifndef EGL_NV_stream_remote +#define EGL_NV_stream_remote 1 + +#define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 +#define EGL_STREAM_TYPE_NV 0x3241 +#define EGL_STREAM_PROTOCOL_NV 0x3242 +#define EGL_STREAM_ENDPOINT_NV 0x3243 +#define EGL_STREAM_LOCAL_NV 0x3244 +#define EGL_STREAM_PROTOCOL_FD_NV 0x3246 +#define EGL_STREAM_PRODUCER_NV 0x3247 +#define EGL_STREAM_CONSUMER_NV 0x3248 + +#define EGLEW_NV_stream_remote EGLEW_GET_VAR(__EGLEW_NV_stream_remote) + +#endif /* EGL_NV_stream_remote */ + +/* -------------------------- EGL_NV_stream_reset -------------------------- */ + +#ifndef EGL_NV_stream_reset +#define EGL_NV_stream_reset 1 + +#define EGL_SUPPORT_RESET_NV 0x3334 +#define EGL_SUPPORT_REUSE_NV 0x3335 + +typedef EGLBoolean ( * PFNEGLRESETSTREAMNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglResetStreamNV EGLEW_GET_FUN(__eglewResetStreamNV) + +#define EGLEW_NV_stream_reset EGLEW_GET_VAR(__EGLEW_NV_stream_reset) + +#endif /* EGL_NV_stream_reset */ + +/* -------------------------- EGL_NV_stream_socket ------------------------- */ + +#ifndef EGL_NV_stream_socket +#define EGL_NV_stream_socket 1 + +#define EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B +#define EGL_SOCKET_HANDLE_NV 0x324C +#define EGL_SOCKET_TYPE_NV 0x324D + +#define EGLEW_NV_stream_socket EGLEW_GET_VAR(__EGLEW_NV_stream_socket) + +#endif /* EGL_NV_stream_socket */ + +/* ----------------------- EGL_NV_stream_socket_inet ----------------------- */ + +#ifndef EGL_NV_stream_socket_inet +#define EGL_NV_stream_socket_inet 1 + +#define EGL_SOCKET_TYPE_INET_NV 0x324F + +#define EGLEW_NV_stream_socket_inet EGLEW_GET_VAR(__EGLEW_NV_stream_socket_inet) + +#endif /* EGL_NV_stream_socket_inet */ + +/* ----------------------- EGL_NV_stream_socket_unix ----------------------- */ + +#ifndef EGL_NV_stream_socket_unix +#define EGL_NV_stream_socket_unix 1 + +#define EGL_SOCKET_TYPE_UNIX_NV 0x324E + +#define EGLEW_NV_stream_socket_unix EGLEW_GET_VAR(__EGLEW_NV_stream_socket_unix) + +#endif /* EGL_NV_stream_socket_unix */ + +/* --------------------------- EGL_NV_stream_sync -------------------------- */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 + +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_NEW_FRAME_NV 0x321F + +typedef EGLSyncKHR ( * PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint * attrib_list); + +#define eglCreateStreamSyncNV EGLEW_GET_FUN(__eglewCreateStreamSyncNV) + +#define EGLEW_NV_stream_sync EGLEW_GET_VAR(__EGLEW_NV_stream_sync) + +#endif /* EGL_NV_stream_sync */ + +/* ------------------------------ EGL_NV_sync ------------------------------ */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLSyncNV ( * PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean ( * PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); + +#define eglClientWaitSyncNV EGLEW_GET_FUN(__eglewClientWaitSyncNV) +#define eglCreateFenceSyncNV EGLEW_GET_FUN(__eglewCreateFenceSyncNV) +#define eglDestroySyncNV EGLEW_GET_FUN(__eglewDestroySyncNV) +#define eglFenceNV EGLEW_GET_FUN(__eglewFenceNV) +#define eglGetSyncAttribNV EGLEW_GET_FUN(__eglewGetSyncAttribNV) +#define eglSignalSyncNV EGLEW_GET_FUN(__eglewSignalSyncNV) + +#define EGLEW_NV_sync EGLEW_GET_VAR(__EGLEW_NV_sync) + +#endif /* EGL_NV_sync */ + +/* --------------------------- EGL_NV_system_time -------------------------- */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 + +typedef EGLuint64NV ( * PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) ( void ); +typedef EGLuint64NV ( * PFNEGLGETSYSTEMTIMENVPROC) ( void ); + +#define eglGetSystemTimeFrequencyNV EGLEW_GET_FUN(__eglewGetSystemTimeFrequencyNV) +#define eglGetSystemTimeNV EGLEW_GET_FUN(__eglewGetSystemTimeNV) + +#define EGLEW_NV_system_time EGLEW_GET_VAR(__EGLEW_NV_system_time) + +#endif /* EGL_NV_system_time */ + +/* --------------------- EGL_TIZEN_image_native_buffer --------------------- */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 + +#define EGLEW_TIZEN_image_native_buffer EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_buffer) + +#endif /* EGL_TIZEN_image_native_buffer */ + +/* --------------------- EGL_TIZEN_image_native_surface -------------------- */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 + +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 + +#define EGLEW_TIZEN_image_native_surface EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_surface) + +#endif /* EGL_TIZEN_image_native_surface */ + +/* ------------------------------------------------------------------------- */ + +#define EGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define EGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +EGLEW_FUN_EXPORT PFNEGLCHOOSECONFIGPROC __eglewChooseConfig; +EGLEW_FUN_EXPORT PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers; +EGLEW_FUN_EXPORT PFNEGLCREATECONTEXTPROC __eglewCreateContext; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERSURFACEPROC __eglewCreatePbufferSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEPROC __eglewCreatePixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEWINDOWSURFACEPROC __eglewCreateWindowSurface; +EGLEW_FUN_EXPORT PFNEGLDESTROYCONTEXTPROC __eglewDestroyContext; +EGLEW_FUN_EXPORT PFNEGLDESTROYSURFACEPROC __eglewDestroySurface; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGATTRIBPROC __eglewGetConfigAttrib; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGSPROC __eglewGetConfigs; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTDISPLAYPROC __eglewGetCurrentDisplay; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTSURFACEPROC __eglewGetCurrentSurface; +EGLEW_FUN_EXPORT PFNEGLGETDISPLAYPROC __eglewGetDisplay; +EGLEW_FUN_EXPORT PFNEGLGETERRORPROC __eglewGetError; +EGLEW_FUN_EXPORT PFNEGLINITIALIZEPROC __eglewInitialize; +EGLEW_FUN_EXPORT PFNEGLMAKECURRENTPROC __eglewMakeCurrent; +EGLEW_FUN_EXPORT PFNEGLQUERYCONTEXTPROC __eglewQueryContext; +EGLEW_FUN_EXPORT PFNEGLQUERYSTRINGPROC __eglewQueryString; +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPROC __eglewQuerySurface; +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSPROC __eglewSwapBuffers; +EGLEW_FUN_EXPORT PFNEGLTERMINATEPROC __eglewTerminate; +EGLEW_FUN_EXPORT PFNEGLWAITGLPROC __eglewWaitGL; +EGLEW_FUN_EXPORT PFNEGLWAITNATIVEPROC __eglewWaitNative; + +EGLEW_FUN_EXPORT PFNEGLBINDTEXIMAGEPROC __eglewBindTexImage; +EGLEW_FUN_EXPORT PFNEGLRELEASETEXIMAGEPROC __eglewReleaseTexImage; +EGLEW_FUN_EXPORT PFNEGLSURFACEATTRIBPROC __eglewSurfaceAttrib; +EGLEW_FUN_EXPORT PFNEGLSWAPINTERVALPROC __eglewSwapInterval; + +EGLEW_FUN_EXPORT PFNEGLBINDAPIPROC __eglewBindAPI; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC __eglewCreatePbufferFromClientBuffer; +EGLEW_FUN_EXPORT PFNEGLQUERYAPIPROC __eglewQueryAPI; +EGLEW_FUN_EXPORT PFNEGLRELEASETHREADPROC __eglewReleaseThread; +EGLEW_FUN_EXPORT PFNEGLWAITCLIENTPROC __eglewWaitClient; + +EGLEW_FUN_EXPORT PFNEGLGETCURRENTCONTEXTPROC __eglewGetCurrentContext; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCPROC __eglewClientWaitSync; +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEPROC __eglewCreateImage; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC __eglewCreatePlatformPixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEPROC __eglewCreatePlatformWindowSurface; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCPROC __eglewCreateSync; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEPROC __eglewDestroyImage; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCPROC __eglewDestroySync; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYPROC __eglewGetPlatformDisplay; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBPROC __eglewGetSyncAttrib; +EGLEW_FUN_EXPORT PFNEGLWAITSYNCPROC __eglewWaitSync; + +EGLEW_FUN_EXPORT PFNEGLSETBLOBCACHEFUNCSANDROIDPROC __eglewSetBlobCacheFuncsANDROID; + +EGLEW_FUN_EXPORT PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC __eglewCreateNativeClientBufferANDROID; + +EGLEW_FUN_EXPORT PFNEGLDUPNATIVEFENCEFDANDROIDPROC __eglewDupNativeFenceFDANDROID; + +EGLEW_FUN_EXPORT PFNEGLPRESENTATIONTIMEANDROIDPROC __eglewPresentationTimeANDROID; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPOINTERANGLEPROC __eglewQuerySurfacePointerANGLE; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESEXTPROC __eglewQueryDevicesEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC __eglewQueryDeviceAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESTRINGEXTPROC __eglewQueryDeviceStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBEXTPROC __eglewQueryDisplayAttribEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFFORMATSEXTPROC __eglewQueryDmaBufFormatsEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFMODIFIERSEXTPROC __eglewQueryDmaBufModifiersEXT; + +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTLAYERSEXTPROC __eglewGetOutputLayersEXT; +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTPORTSEXTPROC __eglewGetOutputPortsEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTLAYERATTRIBEXTPROC __eglewOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTPORTATTRIBEXTPROC __eglewOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC __eglewQueryOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC __eglewQueryOutputLayerStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC __eglewQueryOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC __eglewQueryOutputPortStringEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC __eglewCreatePlatformPixmapSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC __eglewCreatePlatformWindowSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYEXTPROC __eglewGetPlatformDisplayEXT; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMEROUTPUTEXTPROC __eglewStreamConsumerOutputEXT; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC __eglewSwapBuffersWithDamageEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEHIPROC __eglewCreatePixmapSurfaceHI; + +EGLEW_FUN_EXPORT PFNEGLCREATESYNC64KHRPROC __eglewCreateSync64KHR; + +EGLEW_FUN_EXPORT PFNEGLDEBUGMESSAGECONTROLKHRPROC __eglewDebugMessageControlKHR; +EGLEW_FUN_EXPORT PFNEGLLABELOBJECTKHRPROC __eglewLabelObjectKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYDEBUGKHRPROC __eglewQueryDebugKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEKHRPROC __eglewCreateImageKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEKHRPROC __eglewDestroyImageKHR; + +EGLEW_FUN_EXPORT PFNEGLLOCKSURFACEKHRPROC __eglewLockSurfaceKHR; +EGLEW_FUN_EXPORT PFNEGLUNLOCKSURFACEKHRPROC __eglewUnlockSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACE64KHRPROC __eglewQuerySurface64KHR; + +EGLEW_FUN_EXPORT PFNEGLSETDAMAGEREGIONKHRPROC __eglewSetDamageRegionKHR; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCKHRPROC __eglewClientWaitSyncKHR; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCKHRPROC __eglewCreateSyncKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCKHRPROC __eglewDestroySyncKHR; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBKHRPROC __eglewGetSyncAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCKHRPROC __eglewSignalSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMKHRPROC __eglewCreateStreamKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSTREAMKHRPROC __eglewDestroyStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMKHRPROC __eglewQueryStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMU64KHRPROC __eglewQueryStreamu64KHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMATTRIBKHRPROC __eglewStreamAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMATTRIBKHRPROC __eglewCreateStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMATTRIBKHRPROC __eglewQueryStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMATTRIBKHRPROC __eglewSetStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC __eglewStreamConsumerAcquireAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC __eglewStreamConsumerReleaseAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREKHRPROC __eglewStreamConsumerAcquireKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC __eglewStreamConsumerGLTextureExternalKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEKHRPROC __eglewStreamConsumerReleaseKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC __eglewCreateStreamFromFileDescriptorKHR; +EGLEW_FUN_EXPORT PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC __eglewGetStreamFileDescriptorKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMTIMEKHRPROC __eglewQueryStreamTimeKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC __eglewCreateStreamProducerSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC __eglewSwapBuffersWithDamageKHR; + +EGLEW_FUN_EXPORT PFNEGLWAITSYNCKHRPROC __eglewWaitSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEDRMIMAGEMESAPROC __eglewCreateDRMImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDRMIMAGEMESAPROC __eglewExportDRMImageMESA; + +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEMESAPROC __eglewExportDMABUFImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC __eglewExportDMABUFImageQueryMESA; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGIONNOKPROC __eglewSwapBuffersRegionNOK; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGION2NOKPROC __eglewSwapBuffersRegion2NOK; + +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEDISPLAYNVPROC __eglewQueryNativeDisplayNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEPIXMAPNVPROC __eglewQueryNativePixmapNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEWINDOWNVPROC __eglewQueryNativeWindowNV; + +EGLEW_FUN_EXPORT PFNEGLPOSTSUBBUFFERNVPROC __eglewPostSubBufferNV; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC __eglewStreamConsumerGLTextureExternalAttribsNV; + +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBNVPROC __eglewQueryDisplayAttribNV; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMMETADATANVPROC __eglewQueryStreamMetadataNV; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMMETADATANVPROC __eglewSetStreamMetadataNV; + +EGLEW_FUN_EXPORT PFNEGLRESETSTREAMNVPROC __eglewResetStreamNV; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMSYNCNVPROC __eglewCreateStreamSyncNV; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCNVPROC __eglewClientWaitSyncNV; +EGLEW_FUN_EXPORT PFNEGLCREATEFENCESYNCNVPROC __eglewCreateFenceSyncNV; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCNVPROC __eglewDestroySyncNV; +EGLEW_FUN_EXPORT PFNEGLFENCENVPROC __eglewFenceNV; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBNVPROC __eglewGetSyncAttribNV; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCNVPROC __eglewSignalSyncNV; + +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC __eglewGetSystemTimeFrequencyNV; +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMENVPROC __eglewGetSystemTimeNV; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_0; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_1; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_4; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_5; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_blob_cache; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_create_native_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_framebuffer_target; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_front_buffer_auto_refresh; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_native_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_presentation_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_recordable; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_d3d_share_handle_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_device_d3d; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_query_surface_pointer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_surface_d3d_texture_2d_share_handle; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_window_fixed_size; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_implicit_external_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_pixmap_multisample_discard; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_buffer_age; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_client_extensions; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_create_context_robustness; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_enumeration; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_pq; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_scrgb_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import_modifiers; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_multiview_window; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_pixel_format_float; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_device; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_content; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_stream_consumer_egloutput; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_surface_SMPTE2086_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_yuv_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_clientpixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_colorformats; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_context_priority; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_image_plane_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_client_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_config_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_context_flush_control; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context_no_error; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_debug; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_colorspace; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_renderbuffer_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_2D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_3D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_cubemap_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_mutable_render_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_no_config_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_partial_update; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_android; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_reusable_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_attrib; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_consumer_gltexture; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_cross_process_fd; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_fifo; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_aldatalocator; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_eglsurface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_surfaceless_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_vg_parent_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_wait_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_drm_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_image_dma_buf_export; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_surfaceless; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_texture_from_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_3dvision_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample_resolve; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_cuda_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_depth_nonlinear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_device_cuda; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_native_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_convert_rounding; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_sub_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_robustness_video_memory_purge; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_consumer_gltexture_yuv; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_display; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_object; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_partition; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_process; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_system; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_next; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_synchronous; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_frame_limits; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_remote; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_reset; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_inet; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_unix; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_system_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_surface; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY eglewInit (EGLDisplay display); +GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name); + +#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define EGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __eglew_h__ */ diff --git a/Windows/glew/include/GL/glew.h b/Windows/glew/include/GL/glew.h new file mode 100644 index 00000000..b5b6987f --- /dev/null +++ b/Windows/glew/include/GL/glew.h @@ -0,0 +1,23686 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define _GL_H +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* and */ +#ifdef APIENTRY +# ifndef GLAPIENTRY +# define GLAPIENTRY APIENTRY +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY APIENTRY +# endif +#else +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# ifndef GLAPIENTRY +# define GLAPIENTRY __stdcall +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY __stdcall +# endif +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#endif /* _WIN32 */ + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#define GLEW_VAR_EXPORT GLEWAPI +#define GLEW_FUN_EXPORT GLEWAPI + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +# ifdef __APPLE__ +# include +# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +# define GLEW_NO_GLU +# endif +# endif +#endif + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* ----------------------------- GL_VERSION_4_5 ---------------------------- */ + +#ifndef GL_VERSION_4_5 +#define GL_VERSION_4_5 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); + +#define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) +#define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) +#define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) +#define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) + +#define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) + +#endif /* GL_VERSION_4_5 */ + +/* ----------------------------- GL_VERSION_4_6 ---------------------------- */ + +#ifndef GL_VERSION_4_6 +#define GL_VERSION_4_6 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 +#define GL_PARAMETER_BUFFER 0x80EE +#define GL_PARAMETER_BUFFER_BINDING 0x80EF +#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED +#define GL_VERTICES_SUBMITTED 0x82EE +#define GL_PRIMITIVES_SUBMITTED 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B +#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 +#define GL_SPIR_V_BINARY 0x9552 +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); + +#define glMultiDrawArraysIndirectCount GLEW_GET_FUN(__glewMultiDrawArraysIndirectCount) +#define glMultiDrawElementsIndirectCount GLEW_GET_FUN(__glewMultiDrawElementsIndirectCount) +#define glSpecializeShader GLEW_GET_FUN(__glewSpecializeShader) + +#define GLEW_VERSION_4_6 GLEW_GET_VAR(__GLEW_VERSION_4_6) + +#endif /* GL_VERSION_4_6 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* --------------------- GL_AMD_compressed_3DC_texture --------------------- */ + +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 + +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA + +#define GLEW_AMD_compressed_3DC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_3DC_texture) + +#endif /* GL_AMD_compressed_3DC_texture */ + +/* --------------------- GL_AMD_compressed_ATC_texture --------------------- */ + +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 + +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 + +#define GLEW_AMD_compressed_ATC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_ATC_texture) + +#endif /* GL_AMD_compressed_ATC_texture */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ------------------ GL_AMD_framebuffer_sample_positions ------------------ */ + +#ifndef GL_AMD_framebuffer_sample_positions +#define GL_AMD_framebuffer_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE +#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF +#define GL_ALL_PIXELS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat* values); + +#define glFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewFramebufferSamplePositionsfvAMD) +#define glGetFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetFramebufferParameterfvAMD) +#define glGetNamedFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetNamedFramebufferParameterfvAMD) +#define glNamedFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewNamedFramebufferSamplePositionsfvAMD) + +#define GLEW_AMD_framebuffer_sample_positions GLEW_GET_VAR(__GLEW_AMD_framebuffer_sample_positions) + +#endif /* GL_AMD_framebuffer_sample_positions */ + +/* --------------------------- GL_AMD_gcn_shader --------------------------- */ + +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 + +#define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) + +#endif /* GL_AMD_gcn_shader */ + +/* ---------------------- GL_AMD_gpu_shader_half_float --------------------- */ + +#ifndef GL_AMD_gpu_shader_half_float +#define GL_AMD_gpu_shader_half_float 1 + +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_FLOAT16_MAT2_AMD 0x91C5 +#define GL_FLOAT16_MAT3_AMD 0x91C6 +#define GL_FLOAT16_MAT4_AMD 0x91C7 +#define GL_FLOAT16_MAT2x3_AMD 0x91C8 +#define GL_FLOAT16_MAT2x4_AMD 0x91C9 +#define GL_FLOAT16_MAT3x2_AMD 0x91CA +#define GL_FLOAT16_MAT3x4_AMD 0x91CB +#define GL_FLOAT16_MAT4x2_AMD 0x91CC +#define GL_FLOAT16_MAT4x3_AMD 0x91CD + +#define GLEW_AMD_gpu_shader_half_float GLEW_GET_VAR(__GLEW_AMD_gpu_shader_half_float) + +#endif /* GL_AMD_gpu_shader_half_float */ + +/* ------------------------ GL_AMD_gpu_shader_int16 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int16 +#define GL_AMD_gpu_shader_int16 1 + +#define GLEW_AMD_gpu_shader_int16 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int16) + +#endif /* GL_AMD_gpu_shader_int16 */ + +/* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 + +#define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) + +#endif /* GL_AMD_gpu_shader_int64 */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ---------------------- GL_AMD_occlusion_query_event --------------------- */ + +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 + +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); + +#define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) + +#define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) + +#endif /* GL_AMD_occlusion_query_event */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_program_binary_Z400 ---------------------- */ + +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 + +#define GL_Z400_BINARY_AMD 0x8740 + +#define GLEW_AMD_program_binary_Z400 GLEW_GET_VAR(__GLEW_AMD_program_binary_Z400) + +#endif /* GL_AMD_program_binary_Z400 */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */ + +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 + +#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) + +#endif /* GL_AMD_shader_atomic_counter_ops */ + +/* -------------------------- GL_AMD_shader_ballot ------------------------- */ + +#ifndef GL_AMD_shader_ballot +#define GL_AMD_shader_ballot 1 + +#define GLEW_AMD_shader_ballot GLEW_GET_VAR(__GLEW_AMD_shader_ballot) + +#endif /* GL_AMD_shader_ballot */ + +/* ---------------- GL_AMD_shader_explicit_vertex_parameter ---------------- */ + +#ifndef GL_AMD_shader_explicit_vertex_parameter +#define GL_AMD_shader_explicit_vertex_parameter 1 + +#define GLEW_AMD_shader_explicit_vertex_parameter GLEW_GET_VAR(__GLEW_AMD_shader_explicit_vertex_parameter) + +#endif /* GL_AMD_shader_explicit_vertex_parameter */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ------------------- GL_AMD_shader_stencil_value_export ------------------ */ + +#ifndef GL_AMD_shader_stencil_value_export +#define GL_AMD_shader_stencil_value_export 1 + +#define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) + +#endif /* GL_AMD_shader_stencil_value_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* --------------------- GL_AMD_texture_gather_bias_lod -------------------- */ + +#ifndef GL_AMD_texture_gather_bias_lod +#define GL_AMD_texture_gather_bias_lod 1 + +#define GLEW_AMD_texture_gather_bias_lod GLEW_GET_VAR(__GLEW_AMD_texture_gather_bias_lod) + +#endif /* GL_AMD_texture_gather_bias_lod */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_transform_feedback4 ---------------------- */ + +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 + +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 + +#define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) + +#endif /* GL_AMD_transform_feedback4 */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* -------------------- GL_ANDROID_extension_pack_es31a -------------------- */ + +#ifndef GL_ANDROID_extension_pack_es31a +#define GL_ANDROID_extension_pack_es31a 1 + +#define GLEW_ANDROID_extension_pack_es31a GLEW_GET_VAR(__GLEW_ANDROID_extension_pack_es31a) + +#endif /* GL_ANDROID_extension_pack_es31a */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_clip_distance ------------------------ */ + +#ifndef GL_APPLE_clip_distance +#define GL_APPLE_clip_distance 1 + +#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 +#define GL_CLIP_DISTANCE0_APPLE 0x3000 +#define GL_CLIP_DISTANCE1_APPLE 0x3001 +#define GL_CLIP_DISTANCE2_APPLE 0x3002 +#define GL_CLIP_DISTANCE3_APPLE 0x3003 +#define GL_CLIP_DISTANCE4_APPLE 0x3004 +#define GL_CLIP_DISTANCE5_APPLE 0x3005 +#define GL_CLIP_DISTANCE6_APPLE 0x3006 +#define GL_CLIP_DISTANCE7_APPLE 0x3007 + +#define GLEW_APPLE_clip_distance GLEW_GET_VAR(__GLEW_APPLE_clip_distance) + +#endif /* GL_APPLE_clip_distance */ + +/* ------------------- GL_APPLE_color_buffer_packed_float ------------------ */ + +#ifndef GL_APPLE_color_buffer_packed_float +#define GL_APPLE_color_buffer_packed_float 1 + +#define GLEW_APPLE_color_buffer_packed_float GLEW_GET_VAR(__GLEW_APPLE_color_buffer_packed_float) + +#endif /* GL_APPLE_color_buffer_packed_float */ + +/* ---------------------- GL_APPLE_copy_texture_levels --------------------- */ + +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); + +#define glCopyTextureLevelsAPPLE GLEW_GET_FUN(__glewCopyTextureLevelsAPPLE) + +#define GLEW_APPLE_copy_texture_levels GLEW_GET_VAR(__GLEW_APPLE_copy_texture_levels) + +#endif /* GL_APPLE_copy_texture_levels */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* -------------------- GL_APPLE_framebuffer_multisample ------------------- */ + +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); + +#define glRenderbufferStorageMultisampleAPPLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleAPPLE) +#define glResolveMultisampleFramebufferAPPLE GLEW_GET_FUN(__glewResolveMultisampleFramebufferAPPLE) + +#define GLEW_APPLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_APPLE_framebuffer_multisample) + +#endif /* GL_APPLE_framebuffer_multisample */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F +#define GL_RGB_RAW_422_APPLE 0x8A51 + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ----------------------------- GL_APPLE_sync ----------------------------- */ + +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCAPPLEPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVAPPLEPROC) (GLsync GLsync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCAPPLEPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); + +#define glClientWaitSyncAPPLE GLEW_GET_FUN(__glewClientWaitSyncAPPLE) +#define glDeleteSyncAPPLE GLEW_GET_FUN(__glewDeleteSyncAPPLE) +#define glFenceSyncAPPLE GLEW_GET_FUN(__glewFenceSyncAPPLE) +#define glGetInteger64vAPPLE GLEW_GET_FUN(__glewGetInteger64vAPPLE) +#define glGetSyncivAPPLE GLEW_GET_FUN(__glewGetSyncivAPPLE) +#define glIsSyncAPPLE GLEW_GET_FUN(__glewIsSyncAPPLE) +#define glWaitSyncAPPLE GLEW_GET_FUN(__glewWaitSyncAPPLE) + +#define GLEW_APPLE_sync GLEW_GET_VAR(__GLEW_APPLE_sync) + +#endif /* GL_APPLE_sync */ + +/* -------------------- GL_APPLE_texture_2D_limited_npot ------------------- */ + +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 + +#define GLEW_APPLE_texture_2D_limited_npot GLEW_GET_VAR(__GLEW_APPLE_texture_2D_limited_npot) + +#endif /* GL_APPLE_texture_2D_limited_npot */ + +/* -------------------- GL_APPLE_texture_format_BGRA8888 ------------------- */ + +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_BGRA8_EXT 0x93A1 + +#define GLEW_APPLE_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_APPLE_texture_format_BGRA8888) + +#endif /* GL_APPLE_texture_format_BGRA8888 */ + +/* ----------------------- GL_APPLE_texture_max_level ---------------------- */ + +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 + +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D + +#define GLEW_APPLE_texture_max_level GLEW_GET_VAR(__GLEW_APPLE_texture_max_level) + +#endif /* GL_APPLE_texture_max_level */ + +/* --------------------- GL_APPLE_texture_packed_float --------------------- */ + +#ifndef GL_APPLE_texture_packed_float +#define GL_APPLE_texture_packed_float 1 + +#define GL_R11F_G11F_B10F_APPLE 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B +#define GL_RGB9_E5_APPLE 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E + +#define GLEW_APPLE_texture_packed_float GLEW_GET_VAR(__GLEW_APPLE_texture_packed_float) + +#endif /* GL_APPLE_texture_packed_float */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ----------------------- GL_ARB_ES3_1_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); + +#define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) + +#define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) + +#endif /* GL_ARB_ES3_1_compatibility */ + +/* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_2_compatibility +#define GL_ARB_ES3_2_compatibility 1 + +#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE +#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 +#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); + +#define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) + +#define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) + +#endif /* GL_ARB_ES3_2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* -------------------------- GL_ARB_clip_control -------------------------- */ + +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 + +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F + +typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); + +#define glClipControl GLEW_GET_FUN(__glewClipControl) + +#define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) + +#endif /* GL_ARB_clip_control */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ------------------- GL_ARB_conditional_render_inverted ------------------ */ + +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 + +#define GL_QUERY_WAIT_INVERTED 0x8E17 +#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 +#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 +#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A + +#define GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) + +#endif /* GL_ARB_conditional_render_inverted */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_cull_distance ------------------------- */ + +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 + +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA + +#define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) + +#endif /* GL_ARB_cull_distance */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* ----------------------- GL_ARB_derivative_control ----------------------- */ + +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 + +#define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) + +#endif /* GL_ARB_derivative_control */ + +/* ----------------------- GL_ARB_direct_state_access ---------------------- */ + +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 + +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA + +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); +typedef void (GLAPIENTRY * PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); +typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) +#define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) +#define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) +#define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) +#define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) +#define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) +#define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) +#define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) +#define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) +#define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) +#define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) +#define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) +#define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) +#define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) +#define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) +#define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) +#define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) +#define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) +#define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) +#define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) +#define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) +#define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) +#define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) +#define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) +#define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) +#define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) +#define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) +#define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) +#define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) +#define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) +#define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) +#define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) +#define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) +#define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) +#define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) +#define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) +#define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) +#define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) +#define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) +#define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) +#define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) +#define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) +#define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) +#define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) +#define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) +#define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) +#define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) +#define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) +#define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) +#define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) +#define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) +#define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) +#define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) +#define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) +#define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) +#define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) +#define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) +#define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) +#define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) +#define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) +#define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) +#define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) +#define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) +#define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) +#define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) +#define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) +#define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) +#define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) +#define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) +#define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) +#define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) +#define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) +#define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) +#define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) +#define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) +#define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) +#define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) +#define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) +#define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) +#define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) +#define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) +#define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) +#define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) +#define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) +#define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) +#define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) +#define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) +#define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) +#define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) +#define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) +#define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) +#define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) +#define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) +#define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) +#define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) +#define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) +#define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) + +#define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) + +#endif /* GL_ARB_direct_state_access */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, void**indices, GLsizei primcount, GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* -------------------- GL_ARB_fragment_shader_interlock ------------------- */ + +#ifndef GL_ARB_fragment_shader_interlock +#define GL_ARB_fragment_shader_interlock 1 + +#define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) + +#endif /* GL_ARB_fragment_shader_interlock */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* ---------------------- GL_ARB_get_texture_sub_image --------------------- */ + +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 + +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); + +#define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) +#define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) + +#define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) + +#endif /* GL_ARB_get_texture_sub_image */ + +/* ---------------------------- GL_ARB_gl_spirv ---------------------------- */ + +#ifndef GL_ARB_gl_spirv +#define GL_ARB_gl_spirv 1 + +#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 +#define GL_SPIR_V_BINARY_ARB 0x9552 + +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue); + +#define glSpecializeShaderARB GLEW_GET_FUN(__glewSpecializeShaderARB) + +#define GLEW_ARB_gl_spirv GLEW_GET_VAR(__GLEW_ARB_gl_spirv) + +#endif /* GL_ARB_gl_spirv */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_gpu_shader_int64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_int64 +#define GL_ARB_gpu_shader_int64 1 + +#define GL_INT64_ARB 0x140E +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) +#define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) +#define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) +#define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) +#define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) +#define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) +#define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) +#define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) +#define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) +#define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) +#define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) +#define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) +#define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) +#define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) +#define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) +#define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) +#define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) +#define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) +#define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) +#define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) +#define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) +#define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) +#define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) +#define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) +#define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) +#define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) +#define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) +#define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) +#define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) +#define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) +#define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) +#define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) +#define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) +#define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) +#define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) +#define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) + +#define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) + +#endif /* GL_ARB_gpu_shader_int64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* --------------------- GL_ARB_parallel_shader_compile -------------------- */ + +#ifndef GL_ARB_parallel_shader_compile +#define GL_ARB_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 +#define GL_COMPLETION_STATUS_ARB 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) + +#define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) + +#endif /* GL_ARB_parallel_shader_compile */ + +/* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ + +#ifndef GL_ARB_pipeline_statistics_query +#define GL_ARB_pipeline_statistics_query 1 + +#define GL_VERTICES_SUBMITTED_ARB 0x82EE +#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + +#define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) + +#endif /* GL_ARB_pipeline_statistics_query */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* ---------------------- GL_ARB_polygon_offset_clamp ---------------------- */ + +#ifndef GL_ARB_polygon_offset_clamp +#define GL_ARB_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClamp GLEW_GET_FUN(__glewPolygonOffsetClamp) + +#define GLEW_ARB_polygon_offset_clamp GLEW_GET_VAR(__GLEW_ARB_polygon_offset_clamp) + +#endif /* GL_ARB_polygon_offset_clamp */ + +/* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ + +#ifndef GL_ARB_post_depth_coverage +#define GL_ARB_post_depth_coverage 1 + +#define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) + +#endif /* GL_ARB_post_depth_coverage */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------ GL_ARB_sample_locations ------------------------ */ + +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 + +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) +#define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) + +#define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) + +#endif /* GL_ARB_sample_locations */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar * const * strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* -------------------- GL_ARB_shader_atomic_counter_ops ------------------- */ + +#ifndef GL_ARB_shader_atomic_counter_ops +#define GL_ARB_shader_atomic_counter_ops 1 + +#define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) + +#endif /* GL_ARB_shader_atomic_counter_ops */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* -------------------------- GL_ARB_shader_ballot ------------------------- */ + +#ifndef GL_ARB_shader_ballot +#define GL_ARB_shader_ballot 1 + +#define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) + +#endif /* GL_ARB_shader_ballot */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* -------------------------- GL_ARB_shader_clock -------------------------- */ + +#ifndef GL_ARB_shader_clock +#define GL_ARB_shader_clock 1 + +#define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) + +#endif /* GL_ARB_shader_clock */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ------------------ GL_ARB_shader_texture_image_samples ------------------ */ + +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 + +#define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) + +#endif /* GL_ARB_shader_texture_image_samples */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ------------------- GL_ARB_shader_viewport_layer_array ------------------ */ + +#ifndef GL_ARB_shader_viewport_layer_array +#define GL_ARB_shader_viewport_layer_array 1 + +#define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) + +#endif /* GL_ARB_shader_viewport_layer_array */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* -------------------------- GL_ARB_sparse_buffer ------------------------- */ + +#ifndef GL_ARB_sparse_buffer +#define GL_ARB_sparse_buffer 1 + +#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 +#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 + +typedef void (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); + +#define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) + +#define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) + +#endif /* GL_ARB_sparse_buffer */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ + +#ifndef GL_ARB_sparse_texture2 +#define GL_ARB_sparse_texture2 1 + +#define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) + +#endif /* GL_ARB_sparse_texture2 */ + +/* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ + +#ifndef GL_ARB_sparse_texture_clamp +#define GL_ARB_sparse_texture_clamp 1 + +#define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) + +#endif /* GL_ARB_sparse_texture_clamp */ + +/* ------------------------ GL_ARB_spirv_extensions ------------------------ */ + +#ifndef GL_ARB_spirv_extensions +#define GL_ARB_spirv_extensions 1 + +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +#define GLEW_ARB_spirv_extensions GLEW_GET_VAR(__GLEW_ARB_spirv_extensions) + +#endif /* GL_ARB_spirv_extensions */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ------------------------- GL_ARB_texture_barrier ------------------------ */ + +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); + +#define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) + +#define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) + +#endif /* GL_ARB_texture_barrier */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void *img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* ------------------- GL_ARB_texture_filter_anisotropic ------------------- */ + +#ifndef GL_ARB_texture_filter_anisotropic +#define GL_ARB_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF + +#define GLEW_ARB_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_ARB_texture_filter_anisotropic) + +#endif /* GL_ARB_texture_filter_anisotropic */ + +/* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ + +#ifndef GL_ARB_texture_filter_minmax +#define GL_ARB_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 +#define GL_WEIGHTED_AVERAGE_ARB 0x9367 + +#define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) + +#endif /* GL_ARB_texture_filter_minmax */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ + +#ifndef GL_ARB_transform_feedback_overflow_query +#define GL_ARB_transform_feedback_overflow_query 1 + +#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED + +#define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) + +#endif /* GL_ARB_transform_feedback_overflow_query */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_VERTEX_BINDING_BUFFER 0x8F4F + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) +#define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) +#define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) +#define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) +#define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) +#define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ----------------------- GL_ARM_mali_program_binary ---------------------- */ + +#ifndef GL_ARM_mali_program_binary +#define GL_ARM_mali_program_binary 1 + +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 + +#define GLEW_ARM_mali_program_binary GLEW_GET_VAR(__GLEW_ARM_mali_program_binary) + +#endif /* GL_ARM_mali_program_binary */ + +/* ----------------------- GL_ARM_mali_shader_binary ----------------------- */ + +#ifndef GL_ARM_mali_shader_binary +#define GL_ARM_mali_shader_binary 1 + +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 + +#define GLEW_ARM_mali_shader_binary GLEW_GET_VAR(__GLEW_ARM_mali_shader_binary) + +#endif /* GL_ARM_mali_shader_binary */ + +/* ------------------------------ GL_ARM_rgba8 ----------------------------- */ + +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 + +#define GL_RGBA8_OES 0x8058 + +#define GLEW_ARM_rgba8 GLEW_GET_VAR(__GLEW_ARM_rgba8) + +#endif /* GL_ARM_rgba8 */ + +/* -------------------- GL_ARM_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch +#define GL_ARM_shader_framebuffer_fetch 1 + +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 + +#define GLEW_ARM_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch) + +#endif /* GL_ARM_shader_framebuffer_fetch */ + +/* ------------- GL_ARM_shader_framebuffer_fetch_depth_stencil ------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil +#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 + +#define GLEW_ARM_shader_framebuffer_fetch_depth_stencil GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch_depth_stencil) + +#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_2X_BIT_ATI 0x00000001 +#define GL_RED_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef void * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* -------------------- GL_EGL_KHR_context_flush_control ------------------- */ + +#ifndef GL_EGL_KHR_context_flush_control +#define GL_EGL_KHR_context_flush_control 1 + +#define GLEW_EGL_KHR_context_flush_control GLEW_GET_VAR(__GLEW_EGL_KHR_context_flush_control) + +#endif /* GL_EGL_KHR_context_flush_control */ + +/* ---------------- GL_EGL_NV_robustness_video_memory_purge ---------------- */ + +#ifndef GL_EGL_NV_robustness_video_memory_purge +#define GL_EGL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_EGL_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_EGL_NV_robustness_video_memory_purge) + +#endif /* GL_EGL_NV_robustness_video_memory_purge */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------- GL_EXT_EGL_image_array ------------------------ */ + +#ifndef GL_EXT_EGL_image_array +#define GL_EXT_EGL_image_array 1 + +#define GLEW_EXT_EGL_image_array GLEW_GET_VAR(__GLEW_EXT_EGL_image_array) + +#endif /* GL_EXT_EGL_image_array */ + +/* --------------------------- GL_EXT_YUV_target --------------------------- */ + +#ifndef GL_EXT_YUV_target +#define GL_EXT_YUV_target 1 + +#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 + +#define GLEW_EXT_YUV_target GLEW_GET_VAR(__GLEW_EXT_YUV_target) + +#endif /* GL_EXT_YUV_target */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* -------------------------- GL_EXT_base_instance ------------------------- */ + +#ifndef GL_EXT_base_instance +#define GL_EXT_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseVertexBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstanceEXT) + +#define GLEW_EXT_base_instance GLEW_GET_VAR(__GLEW_EXT_base_instance) + +#endif /* GL_EXT_base_instance */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_extended ---------------------- */ + +#ifndef GL_EXT_blend_func_extended +#define GL_EXT_blend_func_extended 1 + +#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 +#define GL_SRC1_ALPHA_EXT 0x8589 +#define GL_SRC1_COLOR_EXT 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC +#define GL_LOCATION_INDEX_EXT 0x930F + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar* name); + +#define glBindFragDataLocationIndexedEXT GLEW_GET_FUN(__glewBindFragDataLocationIndexedEXT) +#define glGetFragDataIndexEXT GLEW_GET_FUN(__glewGetFragDataIndexEXT) +#define glGetProgramResourceLocationIndexEXT GLEW_GET_FUN(__glewGetProgramResourceLocationIndexEXT) + +#define GLEW_EXT_blend_func_extended GLEW_GET_VAR(__GLEW_EXT_blend_func_extended) + +#endif /* GL_EXT_blend_func_extended */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------- GL_EXT_buffer_storage ------------------------- */ + +#ifndef GL_EXT_buffer_storage +#define GL_EXT_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorageEXT GLEW_GET_FUN(__glewBufferStorageEXT) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_EXT_buffer_storage GLEW_GET_VAR(__GLEW_EXT_buffer_storage) + +#endif /* GL_EXT_buffer_storage */ + +/* -------------------------- GL_EXT_clear_texture ------------------------- */ + +#ifndef GL_EXT_clear_texture +#define GL_EXT_clear_texture 1 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImageEXT GLEW_GET_FUN(__glewClearTexImageEXT) +#define glClearTexSubImageEXT GLEW_GET_FUN(__glewClearTexSubImageEXT) + +#define GLEW_EXT_clear_texture GLEW_GET_VAR(__GLEW_EXT_clear_texture) + +#endif /* GL_EXT_clear_texture */ + +/* ----------------------- GL_EXT_clip_cull_distance ----------------------- */ + +#ifndef GL_EXT_clip_cull_distance +#define GL_EXT_clip_cull_distance 1 + +#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 +#define GL_CLIP_DISTANCE0_EXT 0x3000 +#define GL_CLIP_DISTANCE1_EXT 0x3001 +#define GL_CLIP_DISTANCE2_EXT 0x3002 +#define GL_CLIP_DISTANCE3_EXT 0x3003 +#define GL_CLIP_DISTANCE4_EXT 0x3004 +#define GL_CLIP_DISTANCE5_EXT 0x3005 +#define GL_CLIP_DISTANCE6_EXT 0x3006 +#define GL_CLIP_DISTANCE7_EXT 0x3007 +#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA + +#define GLEW_EXT_clip_cull_distance GLEW_GET_VAR(__GLEW_EXT_clip_cull_distance) + +#endif /* GL_EXT_clip_cull_distance */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ----------------------- GL_EXT_color_buffer_float ----------------------- */ + +#ifndef GL_EXT_color_buffer_float +#define GL_EXT_color_buffer_float 1 + +#define GLEW_EXT_color_buffer_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_float) + +#endif /* GL_EXT_color_buffer_float */ + +/* --------------------- GL_EXT_color_buffer_half_float -------------------- */ + +#ifndef GL_EXT_color_buffer_half_float +#define GL_EXT_color_buffer_half_float 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 + +#define GLEW_EXT_color_buffer_half_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_half_float) + +#endif /* GL_EXT_color_buffer_half_float */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* ---------------- GL_EXT_compressed_ETC1_RGB8_sub_texture ---------------- */ + +#ifndef GL_EXT_compressed_ETC1_RGB8_sub_texture +#define GL_EXT_compressed_ETC1_RGB8_sub_texture 1 + +#define GLEW_EXT_compressed_ETC1_RGB8_sub_texture GLEW_GET_VAR(__GLEW_EXT_compressed_ETC1_RGB8_sub_texture) + +#endif /* GL_EXT_compressed_ETC1_RGB8_sub_texture */ + +/* ----------------------- GL_EXT_conservative_depth ----------------------- */ + +#ifndef GL_EXT_conservative_depth +#define GL_EXT_conservative_depth 1 + +#define GLEW_EXT_conservative_depth GLEW_GET_VAR(__GLEW_EXT_conservative_depth) + +#endif /* GL_EXT_conservative_depth */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* --------------------------- GL_EXT_copy_image --------------------------- */ + +#ifndef GL_EXT_copy_image +#define GL_EXT_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubDataEXT GLEW_GET_FUN(__glewCopyImageSubDataEXT) + +#define GLEW_EXT_copy_image GLEW_GET_VAR(__GLEW_EXT_copy_image) + +#endif /* GL_EXT_copy_image */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* --------------------------- GL_EXT_debug_label -------------------------- */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 + +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 + +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); + +#define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) +#define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) + +#define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) + +#endif /* GL_EXT_debug_label */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* ----------------------- GL_EXT_discard_framebuffer ---------------------- */ + +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 + +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 + +typedef void (GLAPIENTRY * PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); + +#define glDiscardFramebufferEXT GLEW_GET_FUN(__glewDiscardFramebufferEXT) + +#define GLEW_EXT_discard_framebuffer GLEW_GET_VAR(__GLEW_EXT_discard_framebuffer) + +#endif /* GL_EXT_discard_framebuffer */ + +/* -------------------------- GL_EXT_draw_buffers -------------------------- */ + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersEXT GLEW_GET_FUN(__glewDrawBuffersEXT) + +#define GLEW_EXT_draw_buffers GLEW_GET_VAR(__GLEW_EXT_draw_buffers) + +#endif /* GL_EXT_draw_buffers */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ---------------------- GL_EXT_draw_buffers_indexed ---------------------- */ + +#ifndef GL_EXT_draw_buffers_indexed +#define GL_EXT_draw_buffers_indexed 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); + +#define glBlendEquationSeparateiEXT GLEW_GET_FUN(__glewBlendEquationSeparateiEXT) +#define glBlendEquationiEXT GLEW_GET_FUN(__glewBlendEquationiEXT) +#define glBlendFuncSeparateiEXT GLEW_GET_FUN(__glewBlendFuncSeparateiEXT) +#define glBlendFunciEXT GLEW_GET_FUN(__glewBlendFunciEXT) +#define glColorMaskiEXT GLEW_GET_FUN(__glewColorMaskiEXT) +#define glDisableiEXT GLEW_GET_FUN(__glewDisableiEXT) +#define glEnableiEXT GLEW_GET_FUN(__glewEnableiEXT) +#define glIsEnablediEXT GLEW_GET_FUN(__glewIsEnablediEXT) + +#define GLEW_EXT_draw_buffers_indexed GLEW_GET_VAR(__GLEW_EXT_draw_buffers_indexed) + +#endif /* GL_EXT_draw_buffers_indexed */ + +/* -------------------- GL_EXT_draw_elements_base_vertex ------------------- */ + +#ifndef GL_EXT_draw_elements_base_vertex +#define GL_EXT_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsBaseVertexEXT) +#define glDrawElementsInstancedBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexEXT) +#define glDrawRangeElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawRangeElementsBaseVertexEXT) +#define glMultiDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewMultiDrawElementsBaseVertexEXT) + +#define GLEW_EXT_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_EXT_draw_elements_base_vertex) + +#endif /* GL_EXT_draw_elements_base_vertex */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ------------------------- GL_EXT_external_buffer ------------------------ */ + +#ifndef GL_EXT_external_buffer +#define GL_EXT_external_buffer 1 + +typedef void* GLeglClientBufferEXT; + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); + +#define glBufferStorageExternalEXT GLEW_GET_FUN(__glewBufferStorageExternalEXT) +#define glNamedBufferStorageExternalEXT GLEW_GET_FUN(__glewNamedBufferStorageExternalEXT) + +#define GLEW_EXT_external_buffer GLEW_GET_VAR(__GLEW_EXT_external_buffer) + +#endif /* GL_EXT_external_buffer */ + +/* --------------------------- GL_EXT_float_blend -------------------------- */ + +#ifndef GL_EXT_float_blend +#define GL_EXT_float_blend 1 + +#define GLEW_EXT_float_blend GLEW_GET_VAR(__GLEW_EXT_float_blend) + +#endif /* GL_EXT_float_blend */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* --------------------------- GL_EXT_frag_depth --------------------------- */ + +#ifndef GL_EXT_frag_depth +#define GL_EXT_frag_depth 1 + +#define GLEW_EXT_frag_depth GLEW_GET_VAR(__GLEW_EXT_frag_depth) + +#endif /* GL_EXT_frag_depth */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ----------------------- GL_EXT_geometry_point_size ---------------------- */ + +#ifndef GL_EXT_geometry_point_size +#define GL_EXT_geometry_point_size 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_point_size GLEW_GET_VAR(__GLEW_EXT_geometry_point_size) + +#endif /* GL_EXT_geometry_point_size */ + +/* ------------------------- GL_EXT_geometry_shader ------------------------ */ + +#ifndef GL_EXT_geometry_shader +#define GL_EXT_geometry_shader 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_shader GLEW_GET_VAR(__GLEW_EXT_geometry_shader) + +#endif /* GL_EXT_geometry_shader */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* --------------------------- GL_EXT_gpu_shader5 -------------------------- */ + +#ifndef GL_EXT_gpu_shader5 +#define GL_EXT_gpu_shader5 1 + +#define GLEW_EXT_gpu_shader5 GLEW_GET_VAR(__GLEW_EXT_gpu_shader5) + +#endif /* GL_EXT_gpu_shader5 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* ------------------------ GL_EXT_instanced_arrays ------------------------ */ + +#ifndef GL_EXT_instanced_arrays +#define GL_EXT_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexAttribDivisorEXT) + +#define GLEW_EXT_instanced_arrays GLEW_GET_VAR(__GLEW_EXT_instanced_arrays) + +#endif /* GL_EXT_instanced_arrays */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------ GL_EXT_map_buffer_range ------------------------ */ + +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 + +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedBufferRangeEXT) +#define glMapBufferRangeEXT GLEW_GET_FUN(__glewMapBufferRangeEXT) + +#define GLEW_EXT_map_buffer_range GLEW_GET_VAR(__GLEW_EXT_map_buffer_range) + +#endif /* GL_EXT_map_buffer_range */ + +/* -------------------------- GL_EXT_memory_object ------------------------- */ + +#ifndef GL_EXT_memory_object +#define GL_EXT_memory_object 1 + +#define GL_UUID_SIZE_EXT 16 +#define GL_TEXTURE_TILING_EXT 0x9580 +#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 +#define GL_NUM_TILING_TYPES_EXT 0x9582 +#define GL_TILING_TYPES_EXT 0x9583 +#define GL_OPTIMAL_TILING_EXT 0x9584 +#define GL_LINEAR_TILING_EXT 0x9585 +#define GL_LAYOUT_GENERAL_EXT 0x958D +#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E +#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F +#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 +#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 +#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 +#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 +#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 +#define GL_DEVICE_UUID_EXT 0x9597 +#define GL_DRIVER_UUID_EXT 0x9598 +#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte* data); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte* data); +typedef GLboolean (GLAPIENTRY * PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); +typedef void (GLAPIENTRY * PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); + +#define glBufferStorageMemEXT GLEW_GET_FUN(__glewBufferStorageMemEXT) +#define glCreateMemoryObjectsEXT GLEW_GET_FUN(__glewCreateMemoryObjectsEXT) +#define glDeleteMemoryObjectsEXT GLEW_GET_FUN(__glewDeleteMemoryObjectsEXT) +#define glGetMemoryObjectParameterivEXT GLEW_GET_FUN(__glewGetMemoryObjectParameterivEXT) +#define glGetUnsignedBytei_vEXT GLEW_GET_FUN(__glewGetUnsignedBytei_vEXT) +#define glGetUnsignedBytevEXT GLEW_GET_FUN(__glewGetUnsignedBytevEXT) +#define glIsMemoryObjectEXT GLEW_GET_FUN(__glewIsMemoryObjectEXT) +#define glMemoryObjectParameterivEXT GLEW_GET_FUN(__glewMemoryObjectParameterivEXT) +#define glNamedBufferStorageMemEXT GLEW_GET_FUN(__glewNamedBufferStorageMemEXT) +#define glTexStorageMem1DEXT GLEW_GET_FUN(__glewTexStorageMem1DEXT) +#define glTexStorageMem2DEXT GLEW_GET_FUN(__glewTexStorageMem2DEXT) +#define glTexStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem2DMultisampleEXT) +#define glTexStorageMem3DEXT GLEW_GET_FUN(__glewTexStorageMem3DEXT) +#define glTexStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem3DMultisampleEXT) +#define glTextureStorageMem1DEXT GLEW_GET_FUN(__glewTextureStorageMem1DEXT) +#define glTextureStorageMem2DEXT GLEW_GET_FUN(__glewTextureStorageMem2DEXT) +#define glTextureStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem2DMultisampleEXT) +#define glTextureStorageMem3DEXT GLEW_GET_FUN(__glewTextureStorageMem3DEXT) +#define glTextureStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem3DMultisampleEXT) + +#define GLEW_EXT_memory_object GLEW_GET_VAR(__GLEW_EXT_memory_object) + +#endif /* GL_EXT_memory_object */ + +/* ------------------------ GL_EXT_memory_object_fd ------------------------ */ + +#ifndef GL_EXT_memory_object_fd +#define GL_EXT_memory_object_fd 1 + +#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); + +#define glImportMemoryFdEXT GLEW_GET_FUN(__glewImportMemoryFdEXT) + +#define GLEW_EXT_memory_object_fd GLEW_GET_VAR(__GLEW_EXT_memory_object_fd) + +#endif /* GL_EXT_memory_object_fd */ + +/* ----------------------- GL_EXT_memory_object_win32 ---------------------- */ + +#ifndef GL_EXT_memory_object_win32 +#define GL_EXT_memory_object_win32 1 + +#define GL_LUID_SIZE_EXT 8 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 +#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 +#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A +#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B +#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C +#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 +#define GL_D3D12_FENCE_VALUE_EXT 0x9595 +#define GL_DEVICE_LUID_EXT 0x9599 +#define GL_DEVICE_NODE_MASK_EXT 0x959A + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); + +#define glImportMemoryWin32HandleEXT GLEW_GET_FUN(__glewImportMemoryWin32HandleEXT) +#define glImportMemoryWin32NameEXT GLEW_GET_FUN(__glewImportMemoryWin32NameEXT) + +#define GLEW_EXT_memory_object_win32 GLEW_GET_VAR(__GLEW_EXT_memory_object_win32) + +#endif /* GL_EXT_memory_object_win32 */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* ----------------------- GL_EXT_multi_draw_indirect ---------------------- */ + +#ifndef GL_EXT_multi_draw_indirect +#define GL_EXT_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectEXT GLEW_GET_FUN(__glewMultiDrawArraysIndirectEXT) +#define glMultiDrawElementsIndirectEXT GLEW_GET_FUN(__glewMultiDrawElementsIndirectEXT) + +#define GLEW_EXT_multi_draw_indirect GLEW_GET_VAR(__GLEW_EXT_multi_draw_indirect) + +#endif /* GL_EXT_multi_draw_indirect */ + +/* ------------------------ GL_EXT_multiple_textures ----------------------- */ + +#ifndef GL_EXT_multiple_textures +#define GL_EXT_multiple_textures 1 + +#define GLEW_EXT_multiple_textures GLEW_GET_VAR(__GLEW_EXT_multiple_textures) + +#endif /* GL_EXT_multiple_textures */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* -------------------- GL_EXT_multisample_compatibility ------------------- */ + +#ifndef GL_EXT_multisample_compatibility +#define GL_EXT_multisample_compatibility 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F + +#define GLEW_EXT_multisample_compatibility GLEW_GET_VAR(__GLEW_EXT_multisample_compatibility) + +#endif /* GL_EXT_multisample_compatibility */ + +/* ----------------- GL_EXT_multisampled_render_to_texture ----------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); + +#define glFramebufferTexture2DMultisampleEXT GLEW_GET_FUN(__glewFramebufferTexture2DMultisampleEXT) + +#define GLEW_EXT_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture) + +#endif /* GL_EXT_multisampled_render_to_texture */ + +/* ----------------- GL_EXT_multisampled_render_to_texture2 ---------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture2 +#define GL_EXT_multisampled_render_to_texture2 1 + +#define GLEW_EXT_multisampled_render_to_texture2 GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture2) + +#endif /* GL_EXT_multisampled_render_to_texture2 */ + +/* --------------------- GL_EXT_multiview_draw_buffers --------------------- */ + +#ifndef GL_EXT_multiview_draw_buffers +#define GL_EXT_multiview_draw_buffers 1 + +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum* location, const GLint *indices); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint* data); +typedef void (GLAPIENTRY * PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); + +#define glDrawBuffersIndexedEXT GLEW_GET_FUN(__glewDrawBuffersIndexedEXT) +#define glGetIntegeri_vEXT GLEW_GET_FUN(__glewGetIntegeri_vEXT) +#define glReadBufferIndexedEXT GLEW_GET_FUN(__glewReadBufferIndexedEXT) + +#define GLEW_EXT_multiview_draw_buffers GLEW_GET_VAR(__GLEW_EXT_multiview_draw_buffers) + +#endif /* GL_EXT_multiview_draw_buffers */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ---------------------- GL_EXT_polygon_offset_clamp ---------------------- */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) + +#define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) + +#endif /* GL_EXT_polygon_offset_clamp */ + +/* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 + +#define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) + +#endif /* GL_EXT_post_depth_coverage */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* --------------------------- GL_EXT_pvrtc_sRGB --------------------------- */ + +#ifndef GL_EXT_pvrtc_sRGB +#define GL_EXT_pvrtc_sRGB 1 + +#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 + +#define GLEW_EXT_pvrtc_sRGB GLEW_GET_VAR(__GLEW_EXT_pvrtc_sRGB) + +#endif /* GL_EXT_pvrtc_sRGB */ + +/* ----------------------- GL_EXT_raster_multisample ----------------------- */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); + +#define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) +#define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) +#define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) +#define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) + +#define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) + +#endif /* GL_EXT_raster_multisample */ + +/* ------------------------ GL_EXT_read_format_bgra ------------------------ */ + +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 + +#define GLEW_EXT_read_format_bgra GLEW_GET_VAR(__GLEW_EXT_read_format_bgra) + +#endif /* GL_EXT_read_format_bgra */ + +/* -------------------------- GL_EXT_render_snorm -------------------------- */ + +#ifndef GL_EXT_render_snorm +#define GL_EXT_render_snorm 1 + +#define GL_BYTE 0x1400 +#define GL_SHORT 0x1402 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_render_snorm GLEW_GET_VAR(__GLEW_EXT_render_snorm) + +#endif /* GL_EXT_render_snorm */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* ------------------------------ GL_EXT_sRGB ------------------------------ */ + +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 + +#define GLEW_EXT_sRGB GLEW_GET_VAR(__GLEW_EXT_sRGB) + +#endif /* GL_EXT_sRGB */ + +/* ----------------------- GL_EXT_sRGB_write_control ----------------------- */ + +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + +#define GLEW_EXT_sRGB_write_control GLEW_GET_VAR(__GLEW_EXT_sRGB_write_control) + +#endif /* GL_EXT_sRGB_write_control */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* ---------------------------- GL_EXT_semaphore --------------------------- */ + +#ifndef GL_EXT_semaphore +#define GL_EXT_semaphore 1 + +typedef void (GLAPIENTRY * PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); +typedef void (GLAPIENTRY * PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64* params); +typedef void (GLAPIENTRY * PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +typedef void (GLAPIENTRY * PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); + +#define glDeleteSemaphoresEXT GLEW_GET_FUN(__glewDeleteSemaphoresEXT) +#define glGenSemaphoresEXT GLEW_GET_FUN(__glewGenSemaphoresEXT) +#define glGetSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewGetSemaphoreParameterui64vEXT) +#define glIsSemaphoreEXT GLEW_GET_FUN(__glewIsSemaphoreEXT) +#define glSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewSemaphoreParameterui64vEXT) +#define glSignalSemaphoreEXT GLEW_GET_FUN(__glewSignalSemaphoreEXT) +#define glWaitSemaphoreEXT GLEW_GET_FUN(__glewWaitSemaphoreEXT) + +#define GLEW_EXT_semaphore GLEW_GET_VAR(__GLEW_EXT_semaphore) + +#endif /* GL_EXT_semaphore */ + +/* -------------------------- GL_EXT_semaphore_fd -------------------------- */ + +#ifndef GL_EXT_semaphore_fd +#define GL_EXT_semaphore_fd 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); + +#define glImportSemaphoreFdEXT GLEW_GET_FUN(__glewImportSemaphoreFdEXT) + +#define GLEW_EXT_semaphore_fd GLEW_GET_VAR(__GLEW_EXT_semaphore_fd) + +#endif /* GL_EXT_semaphore_fd */ + +/* ------------------------- GL_EXT_semaphore_win32 ------------------------ */ + +#ifndef GL_EXT_semaphore_win32 +#define GL_EXT_semaphore_win32 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); + +#define glImportSemaphoreWin32HandleEXT GLEW_GET_FUN(__glewImportSemaphoreWin32HandleEXT) +#define glImportSemaphoreWin32NameEXT GLEW_GET_FUN(__glewImportSemaphoreWin32NameEXT) + +#define GLEW_EXT_semaphore_win32 GLEW_GET_VAR(__GLEW_EXT_semaphore_win32) + +#endif /* GL_EXT_semaphore_win32 */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* -------------------- GL_EXT_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 + +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 + +#define GLEW_EXT_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_EXT_shader_framebuffer_fetch) + +#endif /* GL_EXT_shader_framebuffer_fetch */ + +/* ------------------------ GL_EXT_shader_group_vote ----------------------- */ + +#ifndef GL_EXT_shader_group_vote +#define GL_EXT_shader_group_vote 1 + +#define GLEW_EXT_shader_group_vote GLEW_GET_VAR(__GLEW_EXT_shader_group_vote) + +#endif /* GL_EXT_shader_group_vote */ + +/* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 + +#define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) + +#endif /* GL_EXT_shader_image_load_formatted */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* ------------------- GL_EXT_shader_implicit_conversions ------------------ */ + +#ifndef GL_EXT_shader_implicit_conversions +#define GL_EXT_shader_implicit_conversions 1 + +#define GLEW_EXT_shader_implicit_conversions GLEW_GET_VAR(__GLEW_EXT_shader_implicit_conversions) + +#endif /* GL_EXT_shader_implicit_conversions */ + +/* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 + +#define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) + +#endif /* GL_EXT_shader_integer_mix */ + +/* ------------------------ GL_EXT_shader_io_blocks ------------------------ */ + +#ifndef GL_EXT_shader_io_blocks +#define GL_EXT_shader_io_blocks 1 + +#define GLEW_EXT_shader_io_blocks GLEW_GET_VAR(__GLEW_EXT_shader_io_blocks) + +#endif /* GL_EXT_shader_io_blocks */ + +/* ------------- GL_EXT_shader_non_constant_global_initializers ------------ */ + +#ifndef GL_EXT_shader_non_constant_global_initializers +#define GL_EXT_shader_non_constant_global_initializers 1 + +#define GLEW_EXT_shader_non_constant_global_initializers GLEW_GET_VAR(__GLEW_EXT_shader_non_constant_global_initializers) + +#endif /* GL_EXT_shader_non_constant_global_initializers */ + +/* ------------------- GL_EXT_shader_pixel_local_storage ------------------- */ + +#ifndef GL_EXT_shader_pixel_local_storage +#define GL_EXT_shader_pixel_local_storage 1 + +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 +#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 + +#define GLEW_EXT_shader_pixel_local_storage GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage) + +#endif /* GL_EXT_shader_pixel_local_storage */ + +/* ------------------- GL_EXT_shader_pixel_local_storage2 ------------------ */ + +#ifndef GL_EXT_shader_pixel_local_storage2 +#define GL_EXT_shader_pixel_local_storage2 1 + +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 +#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 + +typedef void (GLAPIENTRY * PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint* values); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); +typedef GLsizei (GLAPIENTRY * PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); + +#define glClearPixelLocalStorageuiEXT GLEW_GET_FUN(__glewClearPixelLocalStorageuiEXT) +#define glFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewFramebufferPixelLocalStorageSizeEXT) +#define glGetFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewGetFramebufferPixelLocalStorageSizeEXT) + +#define GLEW_EXT_shader_pixel_local_storage2 GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage2) + +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +/* ----------------------- GL_EXT_shader_texture_lod ----------------------- */ + +#ifndef GL_EXT_shader_texture_lod +#define GL_EXT_shader_texture_lod 1 + +#define GLEW_EXT_shader_texture_lod GLEW_GET_VAR(__GLEW_EXT_shader_texture_lod) + +#endif /* GL_EXT_shader_texture_lod */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* ------------------------- GL_EXT_shadow_samplers ------------------------ */ + +#ifndef GL_EXT_shadow_samplers +#define GL_EXT_shadow_samplers 1 + +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 + +#define GLEW_EXT_shadow_samplers GLEW_GET_VAR(__GLEW_EXT_shadow_samplers) + +#endif /* GL_EXT_shadow_samplers */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------- GL_EXT_sparse_texture ------------------------- */ + +#ifndef GL_EXT_sparse_texture +#define GL_EXT_sparse_texture 1 + +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 +#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A +#define GL_TEXTURE_SPARSE_EXT 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 +#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentEXT GLEW_GET_FUN(__glewTexPageCommitmentEXT) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_EXT_sparse_texture GLEW_GET_VAR(__GLEW_EXT_sparse_texture) + +#endif /* GL_EXT_sparse_texture */ + +/* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 + +#define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) + +#endif /* GL_EXT_sparse_texture2 */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------- GL_EXT_texture_compression_astc_decode_mode -------------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode +#define GL_EXT_texture_compression_astc_decode_mode 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode) + +#endif /* GL_EXT_texture_compression_astc_decode_mode */ + +/* ----------- GL_EXT_texture_compression_astc_decode_mode_rgb9e5 ---------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 +#define GL_EXT_texture_compression_astc_decode_mode_rgb9e5 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5 GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5) + +#endif /* GL_EXT_texture_compression_astc_decode_mode_rgb9e5 */ + +/* -------------------- GL_EXT_texture_compression_bptc -------------------- */ + +#ifndef GL_EXT_texture_compression_bptc +#define GL_EXT_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F + +#define GLEW_EXT_texture_compression_bptc GLEW_GET_VAR(__GLEW_EXT_texture_compression_bptc) + +#endif /* GL_EXT_texture_compression_bptc */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* --------------------- GL_EXT_texture_cube_map_array --------------------- */ + +#ifndef GL_EXT_texture_cube_map_array +#define GL_EXT_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A +#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A + +#define GLEW_EXT_texture_cube_map_array GLEW_GET_VAR(__GLEW_EXT_texture_cube_map_array) + +#endif /* GL_EXT_texture_cube_map_array */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ---------------------- GL_EXT_texture_filter_minmax --------------------- */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 +#define GL_WEIGHTED_AVERAGE_EXT 0x9367 + +#define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) + +#endif /* GL_EXT_texture_filter_minmax */ + +/* --------------------- GL_EXT_texture_format_BGRA8888 -------------------- */ + +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_EXT_texture_format_BGRA8888) + +#endif /* GL_EXT_texture_format_BGRA8888 */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_norm16 ------------------------- */ + +#ifndef GL_EXT_texture_norm16 +#define GL_EXT_texture_norm16 1 + +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA16_EXT 0x805B +#define GL_R16_EXT 0x822A +#define GL_RG16_EXT 0x822C +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGB16_SNORM_EXT 0x8F9A +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_texture_norm16 GLEW_GET_VAR(__GLEW_EXT_texture_norm16) + +#endif /* GL_EXT_texture_norm16 */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* --------------------------- GL_EXT_texture_rg --------------------------- */ + +#ifndef GL_EXT_texture_rg +#define GL_EXT_texture_rg 1 + +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B + +#define GLEW_EXT_texture_rg GLEW_GET_VAR(__GLEW_EXT_texture_rg) + +#endif /* GL_EXT_texture_rg */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ------------------------- GL_EXT_texture_sRGB_R8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_R8 +#define GL_EXT_texture_sRGB_R8 1 + +#define GL_SR8_EXT 0x8FBD + +#define GLEW_EXT_texture_sRGB_R8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_R8) + +#endif /* GL_EXT_texture_sRGB_R8 */ + +/* ------------------------ GL_EXT_texture_sRGB_RG8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 + +#define GL_SRG8_EXT 0x8FBE + +#define GLEW_EXT_texture_sRGB_RG8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_RG8) + +#endif /* GL_EXT_texture_sRGB_RG8 */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_storage ------------------------ */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 + +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R16F_EXT 0x822D +#define GL_R32F_EXT 0x822E +#define GL_RG16F_EXT 0x822F +#define GL_RG32F_EXT 0x8230 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB_RAW_422_APPLE 0x8A51 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_BGRA8_EXT 0x93A1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1DEXT GLEW_GET_FUN(__glewTexStorage1DEXT) +#define glTexStorage2DEXT GLEW_GET_FUN(__glewTexStorage2DEXT) +#define glTexStorage3DEXT GLEW_GET_FUN(__glewTexStorage3DEXT) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_EXT_texture_storage GLEW_GET_VAR(__GLEW_EXT_texture_storage) + +#endif /* GL_EXT_texture_storage */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* ------------------- GL_EXT_texture_type_2_10_10_10_REV ------------------ */ + +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 + +#define GLEW_EXT_texture_type_2_10_10_10_REV GLEW_GET_VAR(__GLEW_EXT_texture_type_2_10_10_10_REV) + +#endif /* GL_EXT_texture_type_2_10_10_10_REV */ + +/* -------------------------- GL_EXT_texture_view -------------------------- */ + +#ifndef GL_EXT_texture_view +#define GL_EXT_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureViewEXT GLEW_GET_FUN(__glewTextureViewEXT) + +#define GLEW_EXT_texture_view GLEW_GET_VAR(__GLEW_EXT_texture_view) + +#endif /* GL_EXT_texture_view */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* ------------------------- GL_EXT_unpack_subimage ------------------------ */ + +#ifndef GL_EXT_unpack_subimage +#define GL_EXT_unpack_subimage 1 + +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 + +#define GLEW_EXT_unpack_subimage GLEW_GET_VAR(__GLEW_EXT_unpack_subimage) + +#endif /* GL_EXT_unpack_subimage */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_array_setXXX ---------------------- */ + +#ifndef GL_EXT_vertex_array_setXXX +#define GL_EXT_vertex_array_setXXX 1 + +typedef void (GLAPIENTRY * PFNGLBINDARRAYSETEXTPROC) (const void *arrayset); +typedef const void * (GLAPIENTRY * PFNGLCREATEARRAYSETEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEARRAYSETSEXTPROC) (GLsizei n, const void *arrayset[]); + +#define glBindArraySetEXT GLEW_GET_FUN(__glewBindArraySetEXT) +#define glCreateArraySetExt GLEW_GET_FUN(__glewCreateArraySetExt) +#define glDeleteArraySetsEXT GLEW_GET_FUN(__glewDeleteArraySetsEXT) + +#define GLEW_EXT_vertex_array_setXXX GLEW_GET_VAR(__GLEW_EXT_vertex_array_setXXX) + +#endif /* GL_EXT_vertex_array_setXXX */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, void *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, void *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------ GL_EXT_win32_keyed_mutex ----------------------- */ + +#ifndef GL_EXT_win32_keyed_mutex +#define GL_EXT_win32_keyed_mutex 1 + +typedef GLboolean (GLAPIENTRY * PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); +typedef GLboolean (GLAPIENTRY * PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); + +#define glAcquireKeyedMutexWin32EXT GLEW_GET_FUN(__glewAcquireKeyedMutexWin32EXT) +#define glReleaseKeyedMutexWin32EXT GLEW_GET_FUN(__glewReleaseKeyedMutexWin32EXT) + +#define GLEW_EXT_win32_keyed_mutex GLEW_GET_VAR(__GLEW_EXT_win32_keyed_mutex) + +#endif /* GL_EXT_win32_keyed_mutex */ + +/* ------------------------ GL_EXT_window_rectangles ----------------------- */ + +#ifndef GL_EXT_window_rectangles +#define GL_EXT_window_rectangles 1 + +#define GL_INCLUSIVE_EXT 0x8F10 +#define GL_EXCLUSIVE_EXT 0x8F11 +#define GL_WINDOW_RECTANGLE_EXT 0x8F12 +#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 +#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 +#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 + +typedef void (GLAPIENTRY * PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint box[]); + +#define glWindowRectanglesEXT GLEW_GET_FUN(__glewWindowRectanglesEXT) + +#define GLEW_EXT_window_rectangles GLEW_GET_VAR(__GLEW_EXT_window_rectangles) + +#endif /* GL_EXT_window_rectangles */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* ------------------ GL_INTEL_conservative_rasterization ------------------ */ + +#ifndef GL_INTEL_conservative_rasterization +#define GL_INTEL_conservative_rasterization 1 + +#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE + +#define GLEW_INTEL_conservative_rasterization GLEW_GET_VAR(__GLEW_INTEL_conservative_rasterization) + +#endif /* GL_INTEL_conservative_rasterization */ + +/* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 + +#define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) + +#endif /* GL_INTEL_fragment_shader_ordering */ + +/* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ + +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 + +#define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) + +#endif /* GL_INTEL_framebuffer_CMAA */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ----------------------- GL_INTEL_performance_query ---------------------- */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 + +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); +typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); +typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); +typedef void (GLAPIENTRY * PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); + +#define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) +#define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) +#define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) +#define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) +#define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) +#define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) +#define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) +#define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) +#define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) +#define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) + +#define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) + +#endif /* GL_INTEL_performance_query */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* --------------------- GL_KHR_blend_equation_advanced -------------------- */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 + +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); + +#define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) + +#define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) + +#endif /* GL_KHR_blend_equation_advanced */ + +/* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 + +#define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) + +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +/* ---------------------- GL_KHR_context_flush_control --------------------- */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 + +#define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) + +#endif /* GL_KHR_context_flush_control */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ---------------------------- GL_KHR_no_error ---------------------------- */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + +#define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) + +#endif /* GL_KHR_no_error */ + +/* --------------------- GL_KHR_parallel_shader_compile -------------------- */ + +#ifndef GL_KHR_parallel_shader_compile +#define GL_KHR_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 +#define GL_COMPLETION_STATUS_KHR 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsKHR GLEW_GET_FUN(__glewMaxShaderCompilerThreadsKHR) + +#define GLEW_KHR_parallel_shader_compile GLEW_GET_VAR(__GLEW_KHR_parallel_shader_compile) + +#endif /* GL_KHR_parallel_shader_compile */ + +/* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 + +#define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) + +#endif /* GL_KHR_robust_buffer_access_behavior */ + +/* --------------------------- GL_KHR_robustness --------------------------- */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 + +#define GL_CONTEXT_LOST 0x0507 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#define GL_GUILTY_CONTEXT_RESET 0x8253 +#define GL_INNOCENT_CONTEXT_RESET 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 +#define GL_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 + +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); + +#define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) +#define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) +#define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) +#define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) + +#define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) + +#endif /* GL_KHR_robustness */ + +/* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) + +#endif /* GL_KHR_texture_compression_astc_hdr */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* --------------- GL_KHR_texture_compression_astc_sliced_3d --------------- */ + +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 + +#define GLEW_KHR_texture_compression_astc_sliced_3d GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_sliced_3d) + +#endif /* GL_KHR_texture_compression_astc_sliced_3d */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* -------------------- GL_MESA_shader_integer_functions ------------------- */ + +#ifndef GL_MESA_shader_integer_functions +#define GL_MESA_shader_integer_functions 1 + +#define GLEW_MESA_shader_integer_functions GLEW_GET_VAR(__GLEW_MESA_shader_integer_functions) + +#endif /* GL_MESA_shader_integer_functions */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ----------- GL_NVX_blend_equation_advanced_multi_draw_buffers ----------- */ + +#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers +#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 + +#define GLEW_NVX_blend_equation_advanced_multi_draw_buffers GLEW_GET_VAR(__GLEW_NVX_blend_equation_advanced_multi_draw_buffers) + +#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ---------------------- GL_NVX_linked_gpu_multicast ---------------------- */ + +#ifndef GL_NVX_linked_gpu_multicast +#define GL_NVX_linked_gpu_multicast 1 + +#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 +#define GL_MAX_LGPU_GPUS_NVX 0x92BA + +typedef void (GLAPIENTRY * PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLLGPUINTERLOCKNVXPROC) (void); +typedef void (GLAPIENTRY * PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); + +#define glLGPUCopyImageSubDataNVX GLEW_GET_FUN(__glewLGPUCopyImageSubDataNVX) +#define glLGPUInterlockNVX GLEW_GET_FUN(__glewLGPUInterlockNVX) +#define glLGPUNamedBufferSubDataNVX GLEW_GET_FUN(__glewLGPUNamedBufferSubDataNVX) + +#define GLEW_NVX_linked_gpu_multicast GLEW_GET_VAR(__GLEW_NVX_linked_gpu_multicast) + +#endif /* GL_NVX_linked_gpu_multicast */ + +/* ------------------------ GL_NV_3dvision_settings ------------------------ */ + +#ifndef GL_NV_3dvision_settings +#define GL_NV_3dvision_settings 1 + +#define GL_3DVISION_STEREO_NV 0x90F4 +#define GL_STEREO_SEPARATION_NV 0x90F5 +#define GL_STEREO_CONVERGENCE_NV 0x90F6 +#define GL_STEREO_CUTOFF_NV 0x90F7 +#define GL_STEREO_PROJECTION_NV 0x90F8 +#define GL_STEREO_PROJECTION_PERSPECTIVE_NV 0x90F9 +#define GL_STEREO_PROJECTION_ORTHO_NV 0x90FA + +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glStereoParameterfNV GLEW_GET_FUN(__glewStereoParameterfNV) +#define glStereoParameteriNV GLEW_GET_FUN(__glewStereoParameteriNV) + +#define GLEW_NV_3dvision_settings GLEW_GET_VAR(__GLEW_NV_3dvision_settings) + +#endif /* GL_NV_3dvision_settings */ + +/* ------------------- GL_NV_EGL_stream_consumer_external ------------------ */ + +#ifndef GL_NV_EGL_stream_consumer_external +#define GL_NV_EGL_stream_consumer_external 1 + +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 + +#define GLEW_NV_EGL_stream_consumer_external GLEW_GET_VAR(__GLEW_NV_EGL_stream_consumer_external) + +#endif /* GL_NV_EGL_stream_consumer_external */ + +/* ----------------- GL_NV_alpha_to_coverage_dither_control ---------------- */ + +#ifndef GL_NV_alpha_to_coverage_dither_control +#define GL_NV_alpha_to_coverage_dither_control 1 + +#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF +#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D +#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E +#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F + +#define GLEW_NV_alpha_to_coverage_dither_control GLEW_GET_VAR(__GLEW_NV_alpha_to_coverage_dither_control) + +#endif /* GL_NV_alpha_to_coverage_dither_control */ + +/* ------------------------------- GL_NV_bgr ------------------------------- */ + +#ifndef GL_NV_bgr +#define GL_NV_bgr 1 + +#define GL_BGR_NV 0x80E0 + +#define GLEW_NV_bgr GLEW_GET_VAR(__GLEW_NV_bgr) + +#endif /* GL_NV_bgr */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ + +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) +#define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) + +#define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) + +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_XOR_NV 0x1506 +#define GL_RED_NV 0x1903 +#define GL_GREEN_NV 0x1904 +#define GL_BLUE_NV 0x1905 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* ----------------------- GL_NV_blend_minmax_factor ----------------------- */ + +#ifndef GL_NV_blend_minmax_factor +#define GL_NV_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_NV_blend_minmax_factor GLEW_GET_VAR(__GLEW_NV_blend_minmax_factor) + +#endif /* GL_NV_blend_minmax_factor */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ----------------------- GL_NV_clip_space_w_scaling ---------------------- */ + +#ifndef GL_NV_clip_space_w_scaling +#define GL_NV_clip_space_w_scaling 1 + +#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C +#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D +#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E + +typedef void (GLAPIENTRY * PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); + +#define glViewportPositionWScaleNV GLEW_GET_FUN(__glewViewportPositionWScaleNV) + +#define GLEW_NV_clip_space_w_scaling GLEW_GET_VAR(__GLEW_NV_clip_space_w_scaling) + +#endif /* GL_NV_clip_space_w_scaling */ + +/* --------------------------- GL_NV_command_list -------------------------- */ + +#ifndef GL_NV_command_list +#define GL_NV_command_list 1 + +#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 +#define GL_NOP_COMMAND_NV 0x0001 +#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 +#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 +#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 +#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 +#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 +#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 +#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 +#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 +#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000a +#define GL_BLEND_COLOR_COMMAND_NV 0x000b +#define GL_STENCIL_REF_COMMAND_NV 0x000c +#define GL_LINE_WIDTH_COMMAND_NV 0x000d +#define GL_POLYGON_OFFSET_COMMAND_NV 0x000e +#define GL_ALPHA_REF_COMMAND_NV 0x000f +#define GL_VIEWPORT_COMMAND_NV 0x0010 +#define GL_SCISSOR_COMMAND_NV 0x0011 +#define GL_FRONT_FACE_COMMAND_NV 0x0012 + +typedef void (GLAPIENTRY * PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); +typedef void (GLAPIENTRY * PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint* lists); +typedef void (GLAPIENTRY * PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint* states); +typedef void (GLAPIENTRY * PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint* lists); +typedef void (GLAPIENTRY * PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint* states); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef GLuint (GLAPIENTRY * PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); +typedef GLushort (GLAPIENTRY * PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); +typedef GLboolean (GLAPIENTRY * PFNGLISCOMMANDLISTNVPROC) (GLuint list); +typedef GLboolean (GLAPIENTRY * PFNGLISSTATENVPROC) (GLuint state); +typedef void (GLAPIENTRY * PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); + +#define glCallCommandListNV GLEW_GET_FUN(__glewCallCommandListNV) +#define glCommandListSegmentsNV GLEW_GET_FUN(__glewCommandListSegmentsNV) +#define glCompileCommandListNV GLEW_GET_FUN(__glewCompileCommandListNV) +#define glCreateCommandListsNV GLEW_GET_FUN(__glewCreateCommandListsNV) +#define glCreateStatesNV GLEW_GET_FUN(__glewCreateStatesNV) +#define glDeleteCommandListsNV GLEW_GET_FUN(__glewDeleteCommandListsNV) +#define glDeleteStatesNV GLEW_GET_FUN(__glewDeleteStatesNV) +#define glDrawCommandsAddressNV GLEW_GET_FUN(__glewDrawCommandsAddressNV) +#define glDrawCommandsNV GLEW_GET_FUN(__glewDrawCommandsNV) +#define glDrawCommandsStatesAddressNV GLEW_GET_FUN(__glewDrawCommandsStatesAddressNV) +#define glDrawCommandsStatesNV GLEW_GET_FUN(__glewDrawCommandsStatesNV) +#define glGetCommandHeaderNV GLEW_GET_FUN(__glewGetCommandHeaderNV) +#define glGetStageIndexNV GLEW_GET_FUN(__glewGetStageIndexNV) +#define glIsCommandListNV GLEW_GET_FUN(__glewIsCommandListNV) +#define glIsStateNV GLEW_GET_FUN(__glewIsStateNV) +#define glListDrawCommandsStatesClientNV GLEW_GET_FUN(__glewListDrawCommandsStatesClientNV) +#define glStateCaptureNV GLEW_GET_FUN(__glewStateCaptureNV) + +#define GLEW_NV_command_list GLEW_GET_VAR(__GLEW_NV_command_list) + +#endif /* GL_NV_command_list */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_conservative_raster ----------------------- */ + +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 + +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 + +typedef void (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); + +#define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) + +#define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) + +#endif /* GL_NV_conservative_raster */ + +/* -------------------- GL_NV_conservative_raster_dilate ------------------- */ + +#ifndef GL_NV_conservative_raster_dilate +#define GL_NV_conservative_raster_dilate 1 + +#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 +#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A +#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); + +#define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) + +#define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) + +#endif /* GL_NV_conservative_raster_dilate */ + +/* -------------- GL_NV_conservative_raster_pre_snap_triangles ------------- */ + +#ifndef GL_NV_conservative_raster_pre_snap_triangles +#define GL_NV_conservative_raster_pre_snap_triangles 1 + +#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D +#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glConservativeRasterParameteriNV GLEW_GET_FUN(__glewConservativeRasterParameteriNV) + +#define GLEW_NV_conservative_raster_pre_snap_triangles GLEW_GET_VAR(__GLEW_NV_conservative_raster_pre_snap_triangles) + +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +/* --------------------------- GL_NV_copy_buffer --------------------------- */ + +#ifndef GL_NV_copy_buffer +#define GL_NV_copy_buffer 1 + +#define GL_COPY_READ_BUFFER_NV 0x8F36 +#define GL_COPY_WRITE_BUFFER_NV 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubDataNV GLEW_GET_FUN(__glewCopyBufferSubDataNV) + +#define GLEW_NV_copy_buffer GLEW_GET_VAR(__GLEW_NV_copy_buffer) + +#endif /* GL_NV_copy_buffer */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* --------------------------- GL_NV_draw_buffers -------------------------- */ + +#ifndef GL_NV_draw_buffers +#define GL_NV_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersNV GLEW_GET_FUN(__glewDrawBuffersNV) + +#define GLEW_NV_draw_buffers GLEW_GET_VAR(__GLEW_NV_draw_buffers) + +#endif /* GL_NV_draw_buffers */ + +/* -------------------------- GL_NV_draw_instanced ------------------------- */ + +#ifndef GL_NV_draw_instanced +#define GL_NV_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + +#define glDrawArraysInstancedNV GLEW_GET_FUN(__glewDrawArraysInstancedNV) +#define glDrawElementsInstancedNV GLEW_GET_FUN(__glewDrawElementsInstancedNV) + +#define GLEW_NV_draw_instanced GLEW_GET_VAR(__GLEW_NV_draw_instanced) + +#endif /* GL_NV_draw_instanced */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ------------------------ GL_NV_draw_vulkan_image ------------------------ */ + +#ifndef GL_NV_draw_vulkan_image +#define GL_NV_draw_vulkan_image 1 + +typedef void (APIENTRY *GLVULKANPROCNV)(void); + +typedef void (GLAPIENTRY * PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +typedef GLVULKANPROCNV (GLAPIENTRY * PFNGLGETVKPROCADDRNVPROC) (const GLchar* name); +typedef void (GLAPIENTRY * PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); +typedef void (GLAPIENTRY * PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (GLAPIENTRY * PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); + +#define glDrawVkImageNV GLEW_GET_FUN(__glewDrawVkImageNV) +#define glGetVkProcAddrNV GLEW_GET_FUN(__glewGetVkProcAddrNV) +#define glSignalVkFenceNV GLEW_GET_FUN(__glewSignalVkFenceNV) +#define glSignalVkSemaphoreNV GLEW_GET_FUN(__glewSignalVkSemaphoreNV) +#define glWaitVkSemaphoreNV GLEW_GET_FUN(__glewWaitVkSemaphoreNV) + +#define GLEW_NV_draw_vulkan_image GLEW_GET_VAR(__GLEW_NV_draw_vulkan_image) + +#endif /* GL_NV_draw_vulkan_image */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* --------------------- GL_NV_explicit_attrib_location -------------------- */ + +#ifndef GL_NV_explicit_attrib_location +#define GL_NV_explicit_attrib_location 1 + +#define GLEW_NV_explicit_attrib_location GLEW_GET_VAR(__GLEW_NV_explicit_attrib_location) + +#endif /* GL_NV_explicit_attrib_location */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ---------------------- GL_NV_fbo_color_attachments ---------------------- */ + +#ifndef GL_NV_fbo_color_attachments +#define GL_NV_fbo_color_attachments 1 + +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +#define GLEW_NV_fbo_color_attachments GLEW_GET_VAR(__GLEW_NV_fbo_color_attachments) + +#endif /* GL_NV_fbo_color_attachments */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* -------------------------- GL_NV_fill_rectangle ------------------------- */ + +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 + +#define GL_FILL_RECTANGLE_NV 0x933C + +#define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) + +#endif /* GL_NV_fill_rectangle */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* -------------------- GL_NV_fragment_coverage_to_color ------------------- */ + +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 + +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); + +#define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) + +#define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) + +#endif /* GL_NV_fragment_coverage_to_color */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* -------------------- GL_NV_fragment_shader_interlock -------------------- */ + +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 + +#define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) + +#endif /* GL_NV_fragment_shader_interlock */ + +/* ------------------------- GL_NV_framebuffer_blit ------------------------ */ + +#ifndef GL_NV_framebuffer_blit +#define GL_NV_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferNV GLEW_GET_FUN(__glewBlitFramebufferNV) + +#define GLEW_NV_framebuffer_blit GLEW_GET_VAR(__GLEW_NV_framebuffer_blit) + +#endif /* GL_NV_framebuffer_blit */ + +/* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ + +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +#define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) + +#endif /* GL_NV_framebuffer_mixed_samples */ + +/* --------------------- GL_NV_framebuffer_multisample --------------------- */ + +#ifndef GL_NV_framebuffer_multisample +#define GL_NV_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleNV) + +#define GLEW_NV_framebuffer_multisample GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample) + +#endif /* GL_NV_framebuffer_multisample */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ----------------------- GL_NV_generate_mipmap_sRGB ---------------------- */ + +#ifndef GL_NV_generate_mipmap_sRGB +#define GL_NV_generate_mipmap_sRGB 1 + +#define GLEW_NV_generate_mipmap_sRGB GLEW_GET_VAR(__GLEW_NV_generate_mipmap_sRGB) + +#endif /* GL_NV_generate_mipmap_sRGB */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* ------------------- GL_NV_geometry_shader_passthrough ------------------- */ + +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 + +#define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) + +#endif /* GL_NV_geometry_shader_passthrough */ + +/* -------------------------- GL_NV_gpu_multicast -------------------------- */ + +#ifndef GL_NV_gpu_multicast +#define GL_NV_gpu_multicast 1 + +#define GL_PER_GPU_STORAGE_BIT_NV 0x0800 +#define GL_MULTICAST_GPUS_NV 0x92BA +#define GL_PER_GPU_STORAGE_NV 0x9548 +#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 +#define GL_RENDER_GPU_MASK_NV 0x9558 + +typedef void (GLAPIENTRY * PFNGLMULTICASTBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GLAPIENTRY * PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (GLAPIENTRY * PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (GLAPIENTRY * PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); + +#define glMulticastBarrierNV GLEW_GET_FUN(__glewMulticastBarrierNV) +#define glMulticastBlitFramebufferNV GLEW_GET_FUN(__glewMulticastBlitFramebufferNV) +#define glMulticastBufferSubDataNV GLEW_GET_FUN(__glewMulticastBufferSubDataNV) +#define glMulticastCopyBufferSubDataNV GLEW_GET_FUN(__glewMulticastCopyBufferSubDataNV) +#define glMulticastCopyImageSubDataNV GLEW_GET_FUN(__glewMulticastCopyImageSubDataNV) +#define glMulticastFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewMulticastFramebufferSampleLocationsfvNV) +#define glMulticastGetQueryObjecti64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjecti64vNV) +#define glMulticastGetQueryObjectivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectivNV) +#define glMulticastGetQueryObjectui64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjectui64vNV) +#define glMulticastGetQueryObjectuivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectuivNV) +#define glMulticastWaitSyncNV GLEW_GET_FUN(__glewMulticastWaitSyncNV) +#define glRenderGpuMaskNV GLEW_GET_FUN(__glewRenderGpuMaskNV) + +#define GLEW_NV_gpu_multicast GLEW_GET_VAR(__GLEW_NV_gpu_multicast) + +#endif /* GL_NV_gpu_multicast */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* -------------------------- GL_NV_image_formats -------------------------- */ + +#ifndef GL_NV_image_formats +#define GL_NV_image_formats 1 + +#define GLEW_NV_image_formats GLEW_GET_VAR(__GLEW_NV_image_formats) + +#endif /* GL_NV_image_formats */ + +/* ------------------------- GL_NV_instanced_arrays ------------------------ */ + +#ifndef GL_NV_instanced_arrays +#define GL_NV_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorNV GLEW_GET_FUN(__glewVertexAttribDivisorNV) + +#define GLEW_NV_instanced_arrays GLEW_GET_VAR(__GLEW_NV_instanced_arrays) + +#endif /* GL_NV_instanced_arrays */ + +/* ------------------- GL_NV_internalformat_sample_query ------------------- */ + +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 + +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) + +#define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) + +#endif /* GL_NV_internalformat_sample_query */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ----------------------- GL_NV_non_square_matrices ----------------------- */ + +#ifndef GL_NV_non_square_matrices +#define GL_NV_non_square_matrices 1 + +#define GL_FLOAT_MAT2x3_NV 0x8B65 +#define GL_FLOAT_MAT2x4_NV 0x8B66 +#define GL_FLOAT_MAT3x2_NV 0x8B67 +#define GL_FLOAT_MAT3x4_NV 0x8B68 +#define GL_FLOAT_MAT4x2_NV 0x8B69 +#define GL_FLOAT_MAT4x3_NV 0x8B6A + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); + +#define glUniformMatrix2x3fvNV GLEW_GET_FUN(__glewUniformMatrix2x3fvNV) +#define glUniformMatrix2x4fvNV GLEW_GET_FUN(__glewUniformMatrix2x4fvNV) +#define glUniformMatrix3x2fvNV GLEW_GET_FUN(__glewUniformMatrix3x2fvNV) +#define glUniformMatrix3x4fvNV GLEW_GET_FUN(__glewUniformMatrix3x4fvNV) +#define glUniformMatrix4x2fvNV GLEW_GET_FUN(__glewUniformMatrix4x2fvNV) +#define glUniformMatrix4x3fvNV GLEW_GET_FUN(__glewUniformMatrix4x3fvNV) + +#define GLEW_NV_non_square_matrices GLEW_GET_VAR(__GLEW_NV_non_square_matrices) + +#endif /* GL_NV_non_square_matrices */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* -------------------------- GL_NV_pack_subimage -------------------------- */ + +#ifndef GL_NV_pack_subimage +#define GL_NV_pack_subimage 1 + +#define GL_PACK_ROW_LENGTH_NV 0x0D02 +#define GL_PACK_SKIP_ROWS_NV 0x0D03 +#define GL_PACK_SKIP_PIXELS_NV 0x0D04 + +#define GLEW_NV_pack_subimage GLEW_GET_VAR(__GLEW_NV_pack_subimage) + +#endif /* GL_NV_pack_subimage */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------------- GL_NV_packed_float -------------------------- */ + +#ifndef GL_NV_packed_float +#define GL_NV_packed_float 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float GLEW_GET_VAR(__GLEW_NV_packed_float) + +#endif /* GL_NV_packed_float */ + +/* ----------------------- GL_NV_packed_float_linear ----------------------- */ + +#ifndef GL_NV_packed_float_linear +#define GL_NV_packed_float_linear 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float_linear GLEW_GET_VAR(__GLEW_NV_packed_float_linear) + +#endif /* GL_NV_packed_float_linear */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_PATH_STROKE_BOUND_NV 0x9086 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_FRAGMENT_INPUT_NV 0x936D +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) +#define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) +#define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) +#define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) +#define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) +#define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) +#define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) +#define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) +#define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) +#define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ + +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 + +#define GL_SHARED_EDGE_NV 0xC0 + +#define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) + +#endif /* GL_NV_path_rendering_shared_edge */ + +/* ----------------------- GL_NV_pixel_buffer_object ----------------------- */ + +#ifndef GL_NV_pixel_buffer_object +#define GL_NV_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_NV 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF + +#define GLEW_NV_pixel_buffer_object GLEW_GET_VAR(__GLEW_NV_pixel_buffer_object) + +#endif /* GL_NV_pixel_buffer_object */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void *pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* ------------------------- GL_NV_platform_binary ------------------------- */ + +#ifndef GL_NV_platform_binary +#define GL_NV_platform_binary 1 + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +#define GLEW_NV_platform_binary GLEW_GET_VAR(__GLEW_NV_platform_binary) + +#endif /* GL_NV_platform_binary */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* --------------------------- GL_NV_polygon_mode -------------------------- */ + +#ifndef GL_NV_polygon_mode +#define GL_NV_polygon_mode 1 + +#define GL_POLYGON_MODE_NV 0x0B40 +#define GL_POINT_NV 0x1B00 +#define GL_LINE_NV 0x1B01 +#define GL_FILL_NV 0x1B02 +#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 +#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 + +typedef void (GLAPIENTRY * PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); + +#define glPolygonModeNV GLEW_GET_FUN(__glewPolygonModeNV) + +#define GLEW_NV_polygon_mode GLEW_GET_VAR(__GLEW_NV_polygon_mode) + +#endif /* GL_NV_polygon_mode */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ---------------------------- GL_NV_read_depth --------------------------- */ + +#ifndef GL_NV_read_depth +#define GL_NV_read_depth 1 + +#define GLEW_NV_read_depth GLEW_GET_VAR(__GLEW_NV_read_depth) + +#endif /* GL_NV_read_depth */ + +/* ------------------------ GL_NV_read_depth_stencil ----------------------- */ + +#ifndef GL_NV_read_depth_stencil +#define GL_NV_read_depth_stencil 1 + +#define GLEW_NV_read_depth_stencil GLEW_GET_VAR(__GLEW_NV_read_depth_stencil) + +#endif /* GL_NV_read_depth_stencil */ + +/* --------------------------- GL_NV_read_stencil -------------------------- */ + +#ifndef GL_NV_read_stencil +#define GL_NV_read_stencil 1 + +#define GLEW_NV_read_stencil GLEW_GET_VAR(__GLEW_NV_read_stencil) + +#endif /* GL_NV_read_stencil */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ------------------ GL_NV_robustness_video_memory_purge ------------------ */ + +#ifndef GL_NV_robustness_video_memory_purge +#define GL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_NV_robustness_video_memory_purge) + +#endif /* GL_NV_robustness_video_memory_purge */ + +/* --------------------------- GL_NV_sRGB_formats -------------------------- */ + +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 + +#define GL_ETC1_SRGB8_NV 0x88EE +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F + +#define GLEW_NV_sRGB_formats GLEW_GET_VAR(__GLEW_NV_sRGB_formats) + +#endif /* GL_NV_sRGB_formats */ + +/* ------------------------- GL_NV_sample_locations ------------------------ */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 + +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) +#define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) + +#define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) + +#endif /* GL_NV_sample_locations */ + +/* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 + +#define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) + +#endif /* GL_NV_sample_mask_override_coverage */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ---------------------- GL_NV_shader_atomic_float64 ---------------------- */ + +#ifndef GL_NV_shader_atomic_float64 +#define GL_NV_shader_atomic_float64 1 + +#define GLEW_NV_shader_atomic_float64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_float64) + +#endif /* GL_NV_shader_atomic_float64 */ + +/* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ + +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 + +#define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) + +#endif /* GL_NV_shader_atomic_fp16_vector */ + +/* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ + +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 + +#define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) + +#endif /* GL_NV_shader_atomic_int64 */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ---------------- GL_NV_shader_noperspective_interpolation --------------- */ + +#ifndef GL_NV_shader_noperspective_interpolation +#define GL_NV_shader_noperspective_interpolation 1 + +#define GLEW_NV_shader_noperspective_interpolation GLEW_GET_VAR(__GLEW_NV_shader_noperspective_interpolation) + +#endif /* GL_NV_shader_noperspective_interpolation */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ----------------------- GL_NV_shader_thread_group ----------------------- */ + +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 + +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B + +#define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) + +#endif /* GL_NV_shader_thread_group */ + +/* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 + +#define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) + +#endif /* GL_NV_shader_thread_shuffle */ + +/* ---------------------- GL_NV_shadow_samplers_array ---------------------- */ + +#ifndef GL_NV_shadow_samplers_array +#define GL_NV_shadow_samplers_array 1 + +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 + +#define GLEW_NV_shadow_samplers_array GLEW_GET_VAR(__GLEW_NV_shadow_samplers_array) + +#endif /* GL_NV_shadow_samplers_array */ + +/* ----------------------- GL_NV_shadow_samplers_cube ---------------------- */ + +#ifndef GL_NV_shadow_samplers_cube +#define GL_NV_shadow_samplers_cube 1 + +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 + +#define GLEW_NV_shadow_samplers_cube GLEW_GET_VAR(__GLEW_NV_shadow_samplers_cube) + +#endif /* GL_NV_shadow_samplers_cube */ + +/* ---------------------- GL_NV_stereo_view_rendering ---------------------- */ + +#ifndef GL_NV_stereo_view_rendering +#define GL_NV_stereo_view_rendering 1 + +#define GLEW_NV_stereo_view_rendering GLEW_GET_VAR(__GLEW_NV_stereo_view_rendering) + +#endif /* GL_NV_stereo_view_rendering */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* -------------------------- GL_NV_texture_array -------------------------- */ + +#ifndef GL_NV_texture_array +#define GL_NV_texture_array 1 + +#define GL_UNPACK_SKIP_IMAGES_NV 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_NV 0x806E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF +#define GL_TEXTURE_2D_ARRAY_NV 0x8C1A +#define GL_TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4 +#define GL_SAMPLER_2D_ARRAY_NV 0x8DC1 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERNVPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glCompressedTexImage3DNV GLEW_GET_FUN(__glewCompressedTexImage3DNV) +#define glCompressedTexSubImage3DNV GLEW_GET_FUN(__glewCompressedTexSubImage3DNV) +#define glCopyTexSubImage3DNV GLEW_GET_FUN(__glewCopyTexSubImage3DNV) +#define glFramebufferTextureLayerNV GLEW_GET_FUN(__glewFramebufferTextureLayerNV) +#define glTexImage3DNV GLEW_GET_FUN(__glewTexImage3DNV) +#define glTexSubImage3DNV GLEW_GET_FUN(__glewTexSubImage3DNV) + +#define GLEW_NV_texture_array GLEW_GET_VAR(__GLEW_NV_texture_array) + +#endif /* GL_NV_texture_array */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* ----------------------- GL_NV_texture_border_clamp ---------------------- */ + +#ifndef GL_NV_texture_border_clamp +#define GL_NV_texture_border_clamp 1 + +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D + +#define GLEW_NV_texture_border_clamp GLEW_GET_VAR(__GLEW_NV_texture_border_clamp) + +#endif /* GL_NV_texture_border_clamp */ + +/* --------------------- GL_NV_texture_compression_latc -------------------- */ + +#ifndef GL_NV_texture_compression_latc +#define GL_NV_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_NV 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_NV 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_NV 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV 0x8C73 + +#define GLEW_NV_texture_compression_latc GLEW_GET_VAR(__GLEW_NV_texture_compression_latc) + +#endif /* GL_NV_texture_compression_latc */ + +/* --------------------- GL_NV_texture_compression_s3tc -------------------- */ + +#ifndef GL_NV_texture_compression_s3tc +#define GL_NV_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_NV 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_NV 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_NV 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_NV 0x83F3 + +#define GLEW_NV_texture_compression_s3tc GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc) + +#endif /* GL_NV_texture_compression_s3tc */ + +/* ----------------- GL_NV_texture_compression_s3tc_update ----------------- */ + +#ifndef GL_NV_texture_compression_s3tc_update +#define GL_NV_texture_compression_s3tc_update 1 + +#define GLEW_NV_texture_compression_s3tc_update GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc_update) + +#endif /* GL_NV_texture_compression_s3tc_update */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ---------------------- GL_NV_texture_npot_2D_mipmap --------------------- */ + +#ifndef GL_NV_texture_npot_2D_mipmap +#define GL_NV_texture_npot_2D_mipmap 1 + +#define GLEW_NV_texture_npot_2D_mipmap GLEW_GET_VAR(__GLEW_NV_texture_npot_2D_mipmap) + +#endif /* GL_NV_texture_npot_2D_mipmap */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* ------------------- GL_NV_texture_rectangle_compressed ------------------ */ + +#ifndef GL_NV_texture_rectangle_compressed +#define GL_NV_texture_rectangle_compressed 1 + +#define GLEW_NV_texture_rectangle_compressed GLEW_GET_VAR(__GLEW_NV_texture_rectangle_compressed) + +#endif /* GL_NV_texture_rectangle_compressed */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* ------------------ GL_NV_uniform_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_uniform_buffer_unified_memory +#define GL_NV_uniform_buffer_unified_memory 1 + +#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E +#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F +#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 + +#define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) + +#endif /* GL_NV_uniform_buffer_unified_memory */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const void*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void *pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* -------------------------- GL_NV_viewport_array ------------------------- */ + +#ifndef GL_NV_viewport_array +#define GL_NV_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS_NV 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLDISABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayfvNV GLEW_GET_FUN(__glewDepthRangeArrayfvNV) +#define glDepthRangeIndexedfNV GLEW_GET_FUN(__glewDepthRangeIndexedfNV) +#define glDisableiNV GLEW_GET_FUN(__glewDisableiNV) +#define glEnableiNV GLEW_GET_FUN(__glewEnableiNV) +#define glGetFloati_vNV GLEW_GET_FUN(__glewGetFloati_vNV) +#define glIsEnablediNV GLEW_GET_FUN(__glewIsEnablediNV) +#define glScissorArrayvNV GLEW_GET_FUN(__glewScissorArrayvNV) +#define glScissorIndexedNV GLEW_GET_FUN(__glewScissorIndexedNV) +#define glScissorIndexedvNV GLEW_GET_FUN(__glewScissorIndexedvNV) +#define glViewportArrayvNV GLEW_GET_FUN(__glewViewportArrayvNV) +#define glViewportIndexedfNV GLEW_GET_FUN(__glewViewportIndexedfNV) +#define glViewportIndexedfvNV GLEW_GET_FUN(__glewViewportIndexedfvNV) + +#define GLEW_NV_viewport_array GLEW_GET_VAR(__GLEW_NV_viewport_array) + +#endif /* GL_NV_viewport_array */ + +/* ------------------------- GL_NV_viewport_array2 ------------------------- */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 + +#define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) + +#endif /* GL_NV_viewport_array2 */ + +/* ------------------------- GL_NV_viewport_swizzle ------------------------ */ + +#ifndef GL_NV_viewport_swizzle +#define GL_NV_viewport_swizzle 1 + +#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 +#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 +#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 +#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A +#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B + +typedef void (GLAPIENTRY * PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); + +#define glViewportSwizzleNV GLEW_GET_FUN(__glewViewportSwizzleNV) + +#define GLEW_NV_viewport_swizzle GLEW_GET_VAR(__GLEW_NV_viewport_swizzle) + +#endif /* GL_NV_viewport_swizzle */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* ---------------------------- GL_OVR_multiview --------------------------- */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) + +#define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) + +#endif /* GL_OVR_multiview */ + +/* --------------------------- GL_OVR_multiview2 --------------------------- */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 + +#define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) + +#endif /* GL_OVR_multiview2 */ + +/* ------------ GL_OVR_multiview_multisampled_render_to_texture ------------ */ + +#ifndef GL_OVR_multiview_multisampled_render_to_texture +#define GL_OVR_multiview_multisampled_render_to_texture 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultisampleMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultisampleMultiviewOVR) + +#define GLEW_OVR_multiview_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_OVR_multiview_multisampled_render_to_texture) + +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* --------------------------- GL_QCOM_alpha_test -------------------------- */ + +#ifndef GL_QCOM_alpha_test +#define GL_QCOM_alpha_test 1 + +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); + +#define glAlphaFuncQCOM GLEW_GET_FUN(__glewAlphaFuncQCOM) + +#define GLEW_QCOM_alpha_test GLEW_GET_VAR(__GLEW_QCOM_alpha_test) + +#endif /* GL_QCOM_alpha_test */ + +/* ------------------------ GL_QCOM_binning_control ------------------------ */ + +#ifndef GL_QCOM_binning_control +#define GL_QCOM_binning_control 1 + +#define GL_DONT_CARE 0x1100 +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 + +#define GLEW_QCOM_binning_control GLEW_GET_VAR(__GLEW_QCOM_binning_control) + +#endif /* GL_QCOM_binning_control */ + +/* ------------------------- GL_QCOM_driver_control ------------------------ */ + +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 + +typedef void (GLAPIENTRY * PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar *driverControlString); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint* num, GLsizei size, GLuint *driverControls); + +#define glDisableDriverControlQCOM GLEW_GET_FUN(__glewDisableDriverControlQCOM) +#define glEnableDriverControlQCOM GLEW_GET_FUN(__glewEnableDriverControlQCOM) +#define glGetDriverControlStringQCOM GLEW_GET_FUN(__glewGetDriverControlStringQCOM) +#define glGetDriverControlsQCOM GLEW_GET_FUN(__glewGetDriverControlsQCOM) + +#define GLEW_QCOM_driver_control GLEW_GET_VAR(__GLEW_QCOM_driver_control) + +#endif /* GL_QCOM_driver_control */ + +/* -------------------------- GL_QCOM_extended_get ------------------------- */ + +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 + +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC + +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void** params); +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERSQCOMPROC) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXTURESQCOMPROC) (GLuint* textures, GLint maxTextures, GLint* numTextures); +typedef void (GLAPIENTRY * PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); + +#define glExtGetBufferPointervQCOM GLEW_GET_FUN(__glewExtGetBufferPointervQCOM) +#define glExtGetBuffersQCOM GLEW_GET_FUN(__glewExtGetBuffersQCOM) +#define glExtGetFramebuffersQCOM GLEW_GET_FUN(__glewExtGetFramebuffersQCOM) +#define glExtGetRenderbuffersQCOM GLEW_GET_FUN(__glewExtGetRenderbuffersQCOM) +#define glExtGetTexLevelParameterivQCOM GLEW_GET_FUN(__glewExtGetTexLevelParameterivQCOM) +#define glExtGetTexSubImageQCOM GLEW_GET_FUN(__glewExtGetTexSubImageQCOM) +#define glExtGetTexturesQCOM GLEW_GET_FUN(__glewExtGetTexturesQCOM) +#define glExtTexObjectStateOverrideiQCOM GLEW_GET_FUN(__glewExtTexObjectStateOverrideiQCOM) + +#define GLEW_QCOM_extended_get GLEW_GET_VAR(__GLEW_QCOM_extended_get) + +#endif /* GL_QCOM_extended_get */ + +/* ------------------------- GL_QCOM_extended_get2 ------------------------- */ + +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 + +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar* source, GLint* length); +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint* programs, GLint maxPrograms, GLint* numPrograms); +typedef void (GLAPIENTRY * PFNGLEXTGETSHADERSQCOMPROC) (GLuint* shaders, GLint maxShaders, GLint* numShaders); +typedef GLboolean (GLAPIENTRY * PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); + +#define glExtGetProgramBinarySourceQCOM GLEW_GET_FUN(__glewExtGetProgramBinarySourceQCOM) +#define glExtGetProgramsQCOM GLEW_GET_FUN(__glewExtGetProgramsQCOM) +#define glExtGetShadersQCOM GLEW_GET_FUN(__glewExtGetShadersQCOM) +#define glExtIsProgramBinaryQCOM GLEW_GET_FUN(__glewExtIsProgramBinaryQCOM) + +#define GLEW_QCOM_extended_get2 GLEW_GET_VAR(__GLEW_QCOM_extended_get2) + +#endif /* GL_QCOM_extended_get2 */ + +/* ---------------------- GL_QCOM_framebuffer_foveated --------------------- */ + +#ifndef GL_QCOM_framebuffer_foveated +#define GL_QCOM_framebuffer_foveated 1 + +#define GL_FOVEATION_ENABLE_BIT_QCOM 0x1 +#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint fbo, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint* providedFeatures); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint fbo, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); + +#define glFramebufferFoveationConfigQCOM GLEW_GET_FUN(__glewFramebufferFoveationConfigQCOM) +#define glFramebufferFoveationParametersQCOM GLEW_GET_FUN(__glewFramebufferFoveationParametersQCOM) + +#define GLEW_QCOM_framebuffer_foveated GLEW_GET_VAR(__GLEW_QCOM_framebuffer_foveated) + +#endif /* GL_QCOM_framebuffer_foveated */ + +/* ---------------------- GL_QCOM_perfmon_global_mode ---------------------- */ + +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 + +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 + +#define GLEW_QCOM_perfmon_global_mode GLEW_GET_VAR(__GLEW_QCOM_perfmon_global_mode) + +#endif /* GL_QCOM_perfmon_global_mode */ + +/* -------------- GL_QCOM_shader_framebuffer_fetch_noncoherent ------------- */ + +#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent +#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 + +#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); + +#define glFramebufferFetchBarrierQCOM GLEW_GET_FUN(__glewFramebufferFetchBarrierQCOM) + +#define GLEW_QCOM_shader_framebuffer_fetch_noncoherent GLEW_GET_VAR(__GLEW_QCOM_shader_framebuffer_fetch_noncoherent) + +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +/* ------------------------ GL_QCOM_tiled_rendering ------------------------ */ + +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 + +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 + +typedef void (GLAPIENTRY * PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +typedef void (GLAPIENTRY * PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); + +#define glEndTilingQCOM GLEW_GET_FUN(__glewEndTilingQCOM) +#define glStartTilingQCOM GLEW_GET_FUN(__glewStartTilingQCOM) + +#define GLEW_QCOM_tiled_rendering GLEW_GET_VAR(__GLEW_QCOM_tiled_rendering) + +#endif /* GL_QCOM_tiled_rendering */ + +/* ---------------------- GL_QCOM_writeonly_rendering ---------------------- */ + +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 + +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 + +#define GLEW_QCOM_writeonly_rendering GLEW_GET_VAR(__GLEW_QCOM_writeonly_rendering) + +#endif /* GL_QCOM_writeonly_rendering */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ------------------------- GL_REGAL_proc_address ------------------------- */ + +#ifndef GL_REGAL_proc_address +#define GL_REGAL_proc_address 1 + +typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); + +#define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) + +#endif /* GL_REGAL_proc_address */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* ------------------------- GL_SGIS_clip_band_hint ------------------------ */ + +#ifndef GL_SGIS_clip_band_hint +#define GL_SGIS_clip_band_hint 1 + +#define GLEW_SGIS_clip_band_hint GLEW_GET_VAR(__GLEW_SGIS_clip_band_hint) + +#endif /* GL_SGIS_clip_band_hint */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_line_texgen -------------------------- */ + +#ifndef GL_SGIS_line_texgen +#define GL_SGIS_line_texgen 1 + +#define GLEW_SGIS_line_texgen GLEW_GET_VAR(__GLEW_SGIS_line_texgen) + +#endif /* GL_SGIS_line_texgen */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* -------------------------- GL_SGIS_multitexture ------------------------- */ + +#ifndef GL_SGIS_multitexture +#define GL_SGIS_multitexture 1 + +#define GL_SELECTED_TEXTURE_SGIS 0x83C0 +#define GL_SELECTED_TEXTURE_COORD_SET_SGIS 0x83C1 +#define GL_SELECTED_TEXTURE_TRANSFORM_SGIS 0x83C2 +#define GL_MAX_TEXTURES_SGIS 0x83C3 +#define GL_MAX_TEXTURE_COORD_SETS_SGIS 0x83C4 +#define GL_TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS 0x83C5 +#define GL_TEXTURE_ENV_COORD_SET_SGIS 0x83C6 +#define GL_TEXTURE0_SGIS 0x83C7 +#define GL_TEXTURE1_SGIS 0x83C8 +#define GL_TEXTURE2_SGIS 0x83C9 +#define GL_TEXTURE3_SGIS 0x83CA + +typedef void (GLAPIENTRY * PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURECOORDSETSGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURESGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURETRANSFORMSGISPROC) (GLenum target); + +#define glInterleavedTextureCoordSetsSGIS GLEW_GET_FUN(__glewInterleavedTextureCoordSetsSGIS) +#define glSelectTextureCoordSetSGIS GLEW_GET_FUN(__glewSelectTextureCoordSetSGIS) +#define glSelectTextureSGIS GLEW_GET_FUN(__glewSelectTextureSGIS) +#define glSelectTextureTransformSGIS GLEW_GET_FUN(__glewSelectTextureTransformSGIS) + +#define GLEW_SGIS_multitexture GLEW_GET_VAR(__GLEW_SGIS_multitexture) + +#endif /* GL_SGIS_multitexture */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ----------------------- GL_SGIS_shared_multisample ---------------------- */ + +#ifndef GL_SGIS_shared_multisample +#define GL_SGIS_shared_multisample 1 + +typedef void (GLAPIENTRY * PFNGLMULTISAMPLESUBRECTPOSSGISPROC) (GLint x, GLint y); + +#define glMultisampleSubRectPosSGIS GLEW_GET_FUN(__glewMultisampleSubRectPosSGIS) + +#define GLEW_SGIS_shared_multisample GLEW_GET_VAR(__GLEW_SGIS_shared_multisample) + +#endif /* GL_SGIS_shared_multisample */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_bali_g_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_g_instruments +#define GL_SGIX_bali_g_instruments 1 + +#define GL_BALI_NUM_TRIS_CULLED_INSTRUMENT 0x6080 +#define GL_BALI_NUM_PRIMS_CLIPPED_INSTRUMENT 0x6081 +#define GL_BALI_NUM_PRIMS_REJECT_INSTRUMENT 0x6082 +#define GL_BALI_NUM_PRIMS_CLIP_RESULT_INSTRUMENT 0x6083 + +#define GLEW_SGIX_bali_g_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_g_instruments) + +#endif /* GL_SGIX_bali_g_instruments */ + +/* ----------------------- GL_SGIX_bali_r_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_r_instruments +#define GL_SGIX_bali_r_instruments 1 + +#define GL_BALI_FRAGMENTS_GENERATED_INSTRUMENT 0x6090 +#define GL_BALI_DEPTH_PASS_INSTRUMENT 0x6091 +#define GL_BALI_R_CHIP_COUNT 0x6092 + +#define GLEW_SGIX_bali_r_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_r_instruments) + +#endif /* GL_SGIX_bali_r_instruments */ + +/* --------------------- GL_SGIX_bali_timer_instruments -------------------- */ + +#ifndef GL_SGIX_bali_timer_instruments +#define GL_SGIX_bali_timer_instruments 1 + +#define GLEW_SGIX_bali_timer_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_timer_instruments) + +#endif /* GL_SGIX_bali_timer_instruments */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* --------------------------- GL_SGIX_blend_cadd -------------------------- */ + +#ifndef GL_SGIX_blend_cadd +#define GL_SGIX_blend_cadd 1 + +#define GL_FUNC_COMPLEX_ADD_EXT 0x601C + +#define GLEW_SGIX_blend_cadd GLEW_GET_VAR(__GLEW_SGIX_blend_cadd) + +#endif /* GL_SGIX_blend_cadd */ + +/* ------------------------ GL_SGIX_blend_cmultiply ------------------------ */ + +#ifndef GL_SGIX_blend_cmultiply +#define GL_SGIX_blend_cmultiply 1 + +#define GL_FUNC_COMPLEX_MULTIPLY_EXT 0x601B + +#define GLEW_SGIX_blend_cmultiply GLEW_GET_VAR(__GLEW_SGIX_blend_cmultiply) + +#endif /* GL_SGIX_blend_cmultiply */ + +/* --------------------- GL_SGIX_calligraphic_fragment --------------------- */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 + +#define GLEW_SGIX_calligraphic_fragment GLEW_GET_VAR(__GLEW_SGIX_calligraphic_fragment) + +#endif /* GL_SGIX_calligraphic_fragment */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* --------------------- GL_SGIX_color_matrix_accuracy --------------------- */ + +#ifndef GL_SGIX_color_matrix_accuracy +#define GL_SGIX_color_matrix_accuracy 1 + +#define GL_COLOR_MATRIX_HINT 0x8317 + +#define GLEW_SGIX_color_matrix_accuracy GLEW_GET_VAR(__GLEW_SGIX_color_matrix_accuracy) + +#endif /* GL_SGIX_color_matrix_accuracy */ + +/* --------------------- GL_SGIX_color_table_index_mode -------------------- */ + +#ifndef GL_SGIX_color_table_index_mode +#define GL_SGIX_color_table_index_mode 1 + +#define GLEW_SGIX_color_table_index_mode GLEW_GET_VAR(__GLEW_SGIX_color_table_index_mode) + +#endif /* GL_SGIX_color_table_index_mode */ + +/* ------------------------- GL_SGIX_complex_polar ------------------------- */ + +#ifndef GL_SGIX_complex_polar +#define GL_SGIX_complex_polar 1 + +#define GLEW_SGIX_complex_polar GLEW_GET_VAR(__GLEW_SGIX_complex_polar) + +#endif /* GL_SGIX_complex_polar */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ---------------------------- GL_SGIX_cube_map --------------------------- */ + +#ifndef GL_SGIX_cube_map +#define GL_SGIX_cube_map 1 + +#define GL_ENV_MAP_SGIX 0x8340 +#define GL_CUBE_MAP_SGIX 0x8341 +#define GL_CUBE_MAP_ZP_SGIX 0x8342 +#define GL_CUBE_MAP_ZN_SGIX 0x8343 +#define GL_CUBE_MAP_XN_SGIX 0x8344 +#define GL_CUBE_MAP_XP_SGIX 0x8345 +#define GL_CUBE_MAP_YN_SGIX 0x8346 +#define GL_CUBE_MAP_YP_SGIX 0x8347 +#define GL_CUBE_MAP_BINDING_SGIX 0x8348 + +#define GLEW_SGIX_cube_map GLEW_GET_VAR(__GLEW_SGIX_cube_map) + +#endif /* GL_SGIX_cube_map */ + +/* ------------------------ GL_SGIX_cylinder_texgen ------------------------ */ + +#ifndef GL_SGIX_cylinder_texgen +#define GL_SGIX_cylinder_texgen 1 + +#define GLEW_SGIX_cylinder_texgen GLEW_GET_VAR(__GLEW_SGIX_cylinder_texgen) + +#endif /* GL_SGIX_cylinder_texgen */ + +/* ---------------------------- GL_SGIX_datapipe --------------------------- */ + +#ifndef GL_SGIX_datapipe +#define GL_SGIX_datapipe 1 + +#define GL_GEOMETRY_BIT 0x1 +#define GL_IMAGE_BIT 0x2 + +typedef void (GLAPIENTRY * PFNGLADDRESSSPACEPROC) (GLenum space, GLbitfield mask); +typedef GLint (GLAPIENTRY * PFNGLDATAPIPEPROC) (GLenum space); + +#define glAddressSpace GLEW_GET_FUN(__glewAddressSpace) +#define glDataPipe GLEW_GET_FUN(__glewDataPipe) + +#define GLEW_SGIX_datapipe GLEW_GET_VAR(__GLEW_SGIX_datapipe) + +#endif /* GL_SGIX_datapipe */ + +/* --------------------------- GL_SGIX_decimation -------------------------- */ + +#ifndef GL_SGIX_decimation +#define GL_SGIX_decimation 1 + +#define GLEW_SGIX_decimation GLEW_GET_VAR(__GLEW_SGIX_decimation) + +#endif /* GL_SGIX_decimation */ + +/* --------------------- GL_SGIX_depth_pass_instrument --------------------- */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 + +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 + +#define GLEW_SGIX_depth_pass_instrument GLEW_GET_VAR(__GLEW_SGIX_depth_pass_instrument) + +#endif /* GL_SGIX_depth_pass_instrument */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* ------------------------------ GL_SGIX_dvc ------------------------------ */ + +#ifndef GL_SGIX_dvc +#define GL_SGIX_dvc 1 + +#define GLEW_SGIX_dvc GLEW_GET_VAR(__GLEW_SGIX_dvc) + +#endif /* GL_SGIX_dvc */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_blend --------------------------- */ + +#ifndef GL_SGIX_fog_blend +#define GL_SGIX_fog_blend 1 + +#define GL_FOG_BLEND_ALPHA_SGIX 0x81FE +#define GL_FOG_BLEND_COLOR_SGIX 0x81FF + +#define GLEW_SGIX_fog_blend GLEW_GET_VAR(__GLEW_SGIX_fog_blend) + +#endif /* GL_SGIX_fog_blend */ + +/* ---------------------- GL_SGIX_fog_factor_to_alpha ---------------------- */ + +#ifndef GL_SGIX_fog_factor_to_alpha +#define GL_SGIX_fog_factor_to_alpha 1 + +#define GLEW_SGIX_fog_factor_to_alpha GLEW_GET_VAR(__GLEW_SGIX_fog_factor_to_alpha) + +#endif /* GL_SGIX_fog_factor_to_alpha */ + +/* --------------------------- GL_SGIX_fog_layers -------------------------- */ + +#ifndef GL_SGIX_fog_layers +#define GL_SGIX_fog_layers 1 + +#define GL_FOG_TYPE_SGIX 0x8323 +#define GL_UNIFORM_SGIX 0x8324 +#define GL_LAYERED_SGIX 0x8325 +#define GL_FOG_GROUND_PLANE_SGIX 0x8326 +#define GL_FOG_LAYERS_POINTS_SGIX 0x8327 +#define GL_MAX_FOG_LAYERS_POINTS_SGIX 0x8328 + +typedef void (GLAPIENTRY * PFNGLFOGLAYERSSGIXPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGLAYERSSGIXPROC) (GLfloat* points); + +#define glFogLayersSGIX GLEW_GET_FUN(__glewFogLayersSGIX) +#define glGetFogLayersSGIX GLEW_GET_FUN(__glewGetFogLayersSGIX) + +#define GLEW_SGIX_fog_layers GLEW_GET_VAR(__GLEW_SGIX_fog_layers) + +#endif /* GL_SGIX_fog_layers */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* --------------------------- GL_SGIX_fog_patchy -------------------------- */ + +#ifndef GL_SGIX_fog_patchy +#define GL_SGIX_fog_patchy 1 + +#define GLEW_SGIX_fog_patchy GLEW_GET_VAR(__GLEW_SGIX_fog_patchy) + +#endif /* GL_SGIX_fog_patchy */ + +/* --------------------------- GL_SGIX_fog_scale --------------------------- */ + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 + +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD + +#define GLEW_SGIX_fog_scale GLEW_GET_VAR(__GLEW_SGIX_fog_scale) + +#endif /* GL_SGIX_fog_scale */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* -------------------- GL_SGIX_fragment_lighting_space -------------------- */ + +#ifndef GL_SGIX_fragment_lighting_space +#define GL_SGIX_fragment_lighting_space 1 + +#define GL_EYE_SPACE_SGIX 0x8436 +#define GL_TANGENT_SPACE_SGIX 0x8437 +#define GL_OBJECT_SPACE_SGIX 0x8438 +#define GL_FRAGMENT_LIGHT_SPACE_SGIX 0x843D + +#define GLEW_SGIX_fragment_lighting_space GLEW_GET_VAR(__GLEW_SGIX_fragment_lighting_space) + +#endif /* GL_SGIX_fragment_lighting_space */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* ---------------------- GL_SGIX_fragments_instrument --------------------- */ + +#ifndef GL_SGIX_fragments_instrument +#define GL_SGIX_fragments_instrument 1 + +#define GL_FRAGMENTS_INSTRUMENT_SGIX 0x8313 +#define GL_FRAGMENTS_INSTRUMENT_COUNTERS_SGIX 0x8314 +#define GL_FRAGMENTS_INSTRUMENT_MAX_SGIX 0x8315 + +#define GLEW_SGIX_fragments_instrument GLEW_GET_VAR(__GLEW_SGIX_fragments_instrument) + +#endif /* GL_SGIX_fragments_instrument */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* -------------------------- GL_SGIX_icc_texture -------------------------- */ + +#ifndef GL_SGIX_icc_texture +#define GL_SGIX_icc_texture 1 + +#define GL_RGB_ICC_SGIX 0x8460 +#define GL_RGBA_ICC_SGIX 0x8461 +#define GL_ALPHA_ICC_SGIX 0x8462 +#define GL_LUMINANCE_ICC_SGIX 0x8463 +#define GL_INTENSITY_ICC_SGIX 0x8464 +#define GL_LUMINANCE_ALPHA_ICC_SGIX 0x8465 +#define GL_R5_G6_B5_ICC_SGIX 0x8466 +#define GL_R5_G6_B5_A8_ICC_SGIX 0x8467 +#define GL_ALPHA16_ICC_SGIX 0x8468 +#define GL_LUMINANCE16_ICC_SGIX 0x8469 +#define GL_INTENSITY16_ICC_SGIX 0x846A +#define GL_LUMINANCE16_ALPHA8_ICC_SGIX 0x846B + +#define GLEW_SGIX_icc_texture GLEW_GET_VAR(__GLEW_SGIX_icc_texture) + +#endif /* GL_SGIX_icc_texture */ + +/* ------------------------ GL_SGIX_igloo_interface ------------------------ */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 + +#define GL_IGLOO_FULLSCREEN_SGIX 0x819E +#define GL_IGLOO_VIEWPORT_OFFSET_SGIX 0x819F +#define GL_IGLOO_SWAPTMESH_SGIX 0x81A0 +#define GL_IGLOO_COLORNORMAL_SGIX 0x81A1 +#define GL_IGLOO_IRISGL_MODE_SGIX 0x81A2 +#define GL_IGLOO_LMC_COLOR_SGIX 0x81A3 +#define GL_IGLOO_TMESHMODE_SGIX 0x81A4 +#define GL_LIGHT31 0xBEAD + +typedef void (GLAPIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, void *param); + +#define glIglooInterfaceSGIX GLEW_GET_FUN(__glewIglooInterfaceSGIX) + +#define GLEW_SGIX_igloo_interface GLEW_GET_VAR(__GLEW_SGIX_igloo_interface) + +#endif /* GL_SGIX_igloo_interface */ + +/* ----------------------- GL_SGIX_image_compression ----------------------- */ + +#ifndef GL_SGIX_image_compression +#define GL_SGIX_image_compression 1 + +#define GLEW_SGIX_image_compression GLEW_GET_VAR(__GLEW_SGIX_image_compression) + +#endif /* GL_SGIX_image_compression */ + +/* ---------------------- GL_SGIX_impact_pixel_texture --------------------- */ + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_SGIX_impact_pixel_texture 1 + +#define GLEW_SGIX_impact_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_impact_pixel_texture) + +#endif /* GL_SGIX_impact_pixel_texture */ + +/* ------------------------ GL_SGIX_instrument_error ----------------------- */ + +#ifndef GL_SGIX_instrument_error +#define GL_SGIX_instrument_error 1 + +#define GLEW_SGIX_instrument_error GLEW_GET_VAR(__GLEW_SGIX_instrument_error) + +#endif /* GL_SGIX_instrument_error */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ----------------------- GL_SGIX_line_quality_hint ----------------------- */ + +#ifndef GL_SGIX_line_quality_hint +#define GL_SGIX_line_quality_hint 1 + +#define GL_LINE_QUALITY_HINT_SGIX 0x835B + +#define GLEW_SGIX_line_quality_hint GLEW_GET_VAR(__GLEW_SGIX_line_quality_hint) + +#endif /* GL_SGIX_line_quality_hint */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ----------------------------- GL_SGIX_mpeg1 ----------------------------- */ + +#ifndef GL_SGIX_mpeg1 +#define GL_SGIX_mpeg1 1 + +typedef void (GLAPIENTRY * PFNGLALLOCMPEGPREDICTORSSGIXPROC) (GLsizei width, GLsizei height, GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLDELETEMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGENMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERFVSGIXPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERIVSGIXPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef GLboolean (GLAPIENTRY * PFNGLISMPEGPREDICTORSGIXPROC) (GLuint predictor); +typedef void (GLAPIENTRY * PFNGLMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef void (GLAPIENTRY * PFNGLSWAPMPEGPREDICTORSSGIXPROC) (GLenum target0, GLenum target1); + +#define glAllocMPEGPredictorsSGIX GLEW_GET_FUN(__glewAllocMPEGPredictorsSGIX) +#define glDeleteMPEGPredictorsSGIX GLEW_GET_FUN(__glewDeleteMPEGPredictorsSGIX) +#define glGenMPEGPredictorsSGIX GLEW_GET_FUN(__glewGenMPEGPredictorsSGIX) +#define glGetMPEGParameterfvSGIX GLEW_GET_FUN(__glewGetMPEGParameterfvSGIX) +#define glGetMPEGParameterivSGIX GLEW_GET_FUN(__glewGetMPEGParameterivSGIX) +#define glGetMPEGPredictorSGIX GLEW_GET_FUN(__glewGetMPEGPredictorSGIX) +#define glGetMPEGQuantTableubv GLEW_GET_FUN(__glewGetMPEGQuantTableubv) +#define glIsMPEGPredictorSGIX GLEW_GET_FUN(__glewIsMPEGPredictorSGIX) +#define glMPEGPredictorSGIX GLEW_GET_FUN(__glewMPEGPredictorSGIX) +#define glMPEGQuantTableubv GLEW_GET_FUN(__glewMPEGQuantTableubv) +#define glSwapMPEGPredictorsSGIX GLEW_GET_FUN(__glewSwapMPEGPredictorsSGIX) + +#define GLEW_SGIX_mpeg1 GLEW_GET_VAR(__GLEW_SGIX_mpeg1) + +#endif /* GL_SGIX_mpeg1 */ + +/* ----------------------------- GL_SGIX_mpeg2 ----------------------------- */ + +#ifndef GL_SGIX_mpeg2 +#define GL_SGIX_mpeg2 1 + +#define GLEW_SGIX_mpeg2 GLEW_GET_VAR(__GLEW_SGIX_mpeg2) + +#endif /* GL_SGIX_mpeg2 */ + +/* ------------------ GL_SGIX_nonlinear_lighting_pervertex ----------------- */ + +#ifndef GL_SGIX_nonlinear_lighting_pervertex +#define GL_SGIX_nonlinear_lighting_pervertex 1 + +typedef void (GLAPIENTRY * PFNGLGETNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint* terms, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint* terms, const GLfloat *data); +typedef void (GLAPIENTRY * PFNGLNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint terms, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint terms, const GLfloat* params); + +#define glGetNonlinLightfvSGIX GLEW_GET_FUN(__glewGetNonlinLightfvSGIX) +#define glGetNonlinMaterialfvSGIX GLEW_GET_FUN(__glewGetNonlinMaterialfvSGIX) +#define glNonlinLightfvSGIX GLEW_GET_FUN(__glewNonlinLightfvSGIX) +#define glNonlinMaterialfvSGIX GLEW_GET_FUN(__glewNonlinMaterialfvSGIX) + +#define GLEW_SGIX_nonlinear_lighting_pervertex GLEW_GET_VAR(__GLEW_SGIX_nonlinear_lighting_pervertex) + +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ + +/* --------------------------- GL_SGIX_nurbs_eval -------------------------- */ + +#ifndef GL_SGIX_nurbs_eval +#define GL_SGIX_nurbs_eval 1 + +#define GL_MAP1_VERTEX_3_NURBS_SGIX 0x81CB +#define GL_MAP1_VERTEX_4_NURBS_SGIX 0x81CC +#define GL_MAP1_INDEX_NURBS_SGIX 0x81CD +#define GL_MAP1_COLOR_4_NURBS_SGIX 0x81CE +#define GL_MAP1_NORMAL_NURBS_SGIX 0x81CF +#define GL_MAP1_TEXTURE_COORD_1_NURBS_SGIX 0x81E0 +#define GL_MAP1_TEXTURE_COORD_2_NURBS_SGIX 0x81E1 +#define GL_MAP1_TEXTURE_COORD_3_NURBS_SGIX 0x81E2 +#define GL_MAP1_TEXTURE_COORD_4_NURBS_SGIX 0x81E3 +#define GL_MAP2_VERTEX_3_NURBS_SGIX 0x81E4 +#define GL_MAP2_VERTEX_4_NURBS_SGIX 0x81E5 +#define GL_MAP2_INDEX_NURBS_SGIX 0x81E6 +#define GL_MAP2_COLOR_4_NURBS_SGIX 0x81E7 +#define GL_MAP2_NORMAL_NURBS_SGIX 0x81E8 +#define GL_MAP2_TEXTURE_COORD_1_NURBS_SGIX 0x81E9 +#define GL_MAP2_TEXTURE_COORD_2_NURBS_SGIX 0x81EA +#define GL_MAP2_TEXTURE_COORD_3_NURBS_SGIX 0x81EB +#define GL_MAP2_TEXTURE_COORD_4_NURBS_SGIX 0x81EC +#define GL_NURBS_KNOT_COUNT_SGIX 0x81ED +#define GL_NURBS_KNOT_VECTOR_SGIX 0x81EE + +#define GLEW_SGIX_nurbs_eval GLEW_GET_VAR(__GLEW_SGIX_nurbs_eval) + +#endif /* GL_SGIX_nurbs_eval */ + +/* ---------------------- GL_SGIX_occlusion_instrument --------------------- */ + +#ifndef GL_SGIX_occlusion_instrument +#define GL_SGIX_occlusion_instrument 1 + +#define GL_OCCLUSION_INSTRUMENT_SGIX 0x6060 + +#define GLEW_SGIX_occlusion_instrument GLEW_GET_VAR(__GLEW_SGIX_occlusion_instrument) + +#endif /* GL_SGIX_occlusion_instrument */ + +/* ------------------------- GL_SGIX_packed_6bytes ------------------------- */ + +#ifndef GL_SGIX_packed_6bytes +#define GL_SGIX_packed_6bytes 1 + +#define GLEW_SGIX_packed_6bytes GLEW_GET_VAR(__GLEW_SGIX_packed_6bytes) + +#endif /* GL_SGIX_packed_6bytes */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ----------------------- GL_SGIX_pixel_texture_lod ----------------------- */ + +#ifndef GL_SGIX_pixel_texture_lod +#define GL_SGIX_pixel_texture_lod 1 + +#define GLEW_SGIX_pixel_texture_lod GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_lod) + +#endif /* GL_SGIX_pixel_texture_lod */ + +/* -------------------------- GL_SGIX_pixel_tiles -------------------------- */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 + +#define GLEW_SGIX_pixel_tiles GLEW_GET_VAR(__GLEW_SGIX_pixel_tiles) + +#endif /* GL_SGIX_pixel_tiles */ + +/* ------------------------- GL_SGIX_polynomial_ffd ------------------------ */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 + +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x1 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x2 + +typedef void (GLAPIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); + +#define glDeformSGIX GLEW_GET_FUN(__glewDeformSGIX) +#define glLoadIdentityDeformationMapSGIX GLEW_GET_FUN(__glewLoadIdentityDeformationMapSGIX) + +#define GLEW_SGIX_polynomial_ffd GLEW_GET_VAR(__GLEW_SGIX_polynomial_ffd) + +#endif /* GL_SGIX_polynomial_ffd */ + +/* --------------------------- GL_SGIX_quad_mesh --------------------------- */ + +#ifndef GL_SGIX_quad_mesh +#define GL_SGIX_quad_mesh 1 + +typedef void (GLAPIENTRY * PFNGLMESHBREADTHSGIXPROC) (GLint breadth); +typedef void (GLAPIENTRY * PFNGLMESHSTRIDESGIXPROC) (GLint stride); + +#define glMeshBreadthSGIX GLEW_GET_FUN(__glewMeshBreadthSGIX) +#define glMeshStrideSGIX GLEW_GET_FUN(__glewMeshStrideSGIX) + +#define GLEW_SGIX_quad_mesh GLEW_GET_VAR(__GLEW_SGIX_quad_mesh) + +#endif /* GL_SGIX_quad_mesh */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ------------------------- GL_SGIX_scalebias_hint ------------------------ */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 + +#define GL_SCALEBIAS_HINT_SGIX 0x8322 + +#define GLEW_SGIX_scalebias_hint GLEW_GET_VAR(__GLEW_SGIX_scalebias_hint) + +#endif /* GL_SGIX_scalebias_hint */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ------------------------------ GL_SGIX_slim ----------------------------- */ + +#ifndef GL_SGIX_slim +#define GL_SGIX_slim 1 + +#define GL_PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B +#define GL_SLIM8U_SGIX 0x831D +#define GL_SLIM10U_SGIX 0x831E +#define GL_SLIM12S_SGIX 0x831F + +#define GLEW_SGIX_slim GLEW_GET_VAR(__GLEW_SGIX_slim) + +#endif /* GL_SGIX_slim */ + +/* ------------------------ GL_SGIX_spotlight_cutoff ----------------------- */ + +#ifndef GL_SGIX_spotlight_cutoff +#define GL_SGIX_spotlight_cutoff 1 + +#define GL_SPOT_CUTOFF_DELTA_SGIX 0x8193 + +#define GLEW_SGIX_spotlight_cutoff GLEW_GET_VAR(__GLEW_SGIX_spotlight_cutoff) + +#endif /* GL_SGIX_spotlight_cutoff */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* -------------------------- GL_SGIX_subdiv_patch ------------------------- */ + +#ifndef GL_SGIX_subdiv_patch +#define GL_SGIX_subdiv_patch 1 + +#define GLEW_SGIX_subdiv_patch GLEW_GET_VAR(__GLEW_SGIX_subdiv_patch) + +#endif /* GL_SGIX_subdiv_patch */ + +/* --------------------------- GL_SGIX_subsample --------------------------- */ + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 + +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 + +#define GLEW_SGIX_subsample GLEW_GET_VAR(__GLEW_SGIX_subsample) + +#endif /* GL_SGIX_subsample */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ------------------- GL_SGIX_texture_mipmap_anisotropic ------------------ */ + +#ifndef GL_SGIX_texture_mipmap_anisotropic +#define GL_SGIX_texture_mipmap_anisotropic 1 + +#define GL_TEXTURE_MIPMAP_ANISOTROPY_SGIX 0x832E +#define GL_MAX_MIPMAP_ANISOTROPY_SGIX 0x832F + +#define GLEW_SGIX_texture_mipmap_anisotropic GLEW_GET_VAR(__GLEW_SGIX_texture_mipmap_anisotropic) + +#endif /* GL_SGIX_texture_mipmap_anisotropic */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_phase ------------------------- */ + +#ifndef GL_SGIX_texture_phase +#define GL_SGIX_texture_phase 1 + +#define GL_PHASE_SGIX 0x832A + +#define GLEW_SGIX_texture_phase GLEW_GET_VAR(__GLEW_SGIX_texture_phase) + +#endif /* GL_SGIX_texture_phase */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ---------------------- GL_SGIX_texture_supersample ---------------------- */ + +#ifndef GL_SGIX_texture_supersample +#define GL_SGIX_texture_supersample 1 + +#define GLEW_SGIX_texture_supersample GLEW_GET_VAR(__GLEW_SGIX_texture_supersample) + +#endif /* GL_SGIX_texture_supersample */ + +/* --------------------------- GL_SGIX_vector_ops -------------------------- */ + +#ifndef GL_SGIX_vector_ops +#define GL_SGIX_vector_ops 1 + +typedef void (GLAPIENTRY * PFNGLGETVECTOROPERATIONSGIXPROC) (GLenum operation); +typedef void (GLAPIENTRY * PFNGLVECTOROPERATIONSGIXPROC) (GLenum operation); + +#define glGetVectorOperationSGIX GLEW_GET_FUN(__glewGetVectorOperationSGIX) +#define glVectorOperationSGIX GLEW_GET_FUN(__glewVectorOperationSGIX) + +#define GLEW_SGIX_vector_ops GLEW_GET_VAR(__GLEW_SGIX_vector_ops) + +#endif /* GL_SGIX_vector_ops */ + +/* ---------------------- GL_SGIX_vertex_array_object ---------------------- */ + +#ifndef GL_SGIX_vertex_array_object +#define GL_SGIX_vertex_array_object 1 + +typedef GLboolean (GLAPIENTRY * PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC) (GLsizei n, const GLuint* arrays, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSSGIXPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays, const GLclampf* priorities); + +#define glAreVertexArraysResidentSGIX GLEW_GET_FUN(__glewAreVertexArraysResidentSGIX) +#define glBindVertexArraySGIX GLEW_GET_FUN(__glewBindVertexArraySGIX) +#define glDeleteVertexArraysSGIX GLEW_GET_FUN(__glewDeleteVertexArraysSGIX) +#define glGenVertexArraysSGIX GLEW_GET_FUN(__glewGenVertexArraysSGIX) +#define glIsVertexArraySGIX GLEW_GET_FUN(__glewIsVertexArraySGIX) +#define glPrioritizeVertexArraysSGIX GLEW_GET_FUN(__glewPrioritizeVertexArraysSGIX) + +#define GLEW_SGIX_vertex_array_object GLEW_GET_VAR(__GLEW_SGIX_vertex_array_object) + +#endif /* GL_SGIX_vertex_array_object */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* ------------------------ GL_SGIX_ycrcb_subsample ------------------------ */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 + +#define GLEW_SGIX_ycrcb_subsample GLEW_GET_VAR(__GLEW_SGIX_ycrcb_subsample) + +#endif /* GL_SGIX_ycrcb_subsample */ + +/* ----------------------------- GL_SGIX_ycrcba ---------------------------- */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 + +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 + +#define GLEW_SGIX_ycrcba GLEW_GET_VAR(__GLEW_SGIX_ycrcba) + +#endif /* GL_SGIX_ycrcba */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------------- GL_SGI_complex ---------------------------- */ + +#ifndef GL_SGI_complex +#define GL_SGI_complex 1 + +#define GLEW_SGI_complex GLEW_GET_VAR(__GLEW_SGI_complex) + +#endif /* GL_SGI_complex */ + +/* -------------------------- GL_SGI_complex_type -------------------------- */ + +#ifndef GL_SGI_complex_type +#define GL_SGI_complex_type 1 + +#define GL_COMPLEX_UNSIGNED_BYTE_SGI 0x81BD +#define GL_COMPLEX_BYTE_SGI 0x81BE +#define GL_COMPLEX_UNSIGNED_SHORT_SGI 0x81BF +#define GL_COMPLEX_SHORT_SGI 0x81C0 +#define GL_COMPLEX_UNSIGNED_INT_SGI 0x81C1 +#define GL_COMPLEX_INT_SGI 0x81C2 +#define GL_COMPLEX_FLOAT_SGI 0x81C3 + +#define GLEW_SGI_complex_type GLEW_GET_VAR(__GLEW_SGI_complex_type) + +#endif /* GL_SGI_complex_type */ + +/* ------------------------------- GL_SGI_fft ------------------------------ */ + +#ifndef GL_SGI_fft +#define GL_SGI_fft 1 + +#define GL_PIXEL_TRANSFORM_OPERATOR_SGI 0x81C4 +#define GL_CONVOLUTION_SGI 0x81C5 +#define GL_FFT_1D_SGI 0x81C6 +#define GL_PIXEL_TRANSFORM_SGI 0x81C7 +#define GL_MAX_FFT_WIDTH_SGI 0x81C8 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFSGIPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERISGIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMSGIPROC) (GLenum target); + +#define glGetPixelTransformParameterfvSGI GLEW_GET_FUN(__glewGetPixelTransformParameterfvSGI) +#define glGetPixelTransformParameterivSGI GLEW_GET_FUN(__glewGetPixelTransformParameterivSGI) +#define glPixelTransformParameterfSGI GLEW_GET_FUN(__glewPixelTransformParameterfSGI) +#define glPixelTransformParameterfvSGI GLEW_GET_FUN(__glewPixelTransformParameterfvSGI) +#define glPixelTransformParameteriSGI GLEW_GET_FUN(__glewPixelTransformParameteriSGI) +#define glPixelTransformParameterivSGI GLEW_GET_FUN(__glewPixelTransformParameterivSGI) +#define glPixelTransformSGI GLEW_GET_FUN(__glewPixelTransformSGI) + +#define GLEW_SGI_fft GLEW_GET_VAR(__GLEW_SGI_fft) + +#endif /* GL_SGI_fft */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* ------------------------- GL_WIN_scene_markerXXX ------------------------ */ + +#ifndef GL_WIN_scene_markerXXX +#define GL_WIN_scene_markerXXX 1 + +#define GLEW_WIN_scene_markerXXX GLEW_GET_VAR(__GLEW_WIN_scene_markerXXX) + +#endif /* GL_WIN_scene_markerXXX */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + + + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC __glewMultiDrawArraysIndirectCount; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC __glewMultiDrawElementsIndirectCount; +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERPROC __glewSpecializeShader; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewFramebufferSamplePositionsfvAMD; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC __glewGetFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC __glewGetNamedFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewNamedFramebufferSamplePositionsfvAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLCOPYTEXTURELEVELSAPPLEPROC __glewCopyTextureLevelsAPPLE; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC __glewRenderbufferStorageMultisampleAPPLE; +GLEW_FUN_EXPORT PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC __glewResolveMultisampleFramebufferAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCAPPLEPROC __glewClientWaitSyncAPPLE; +GLEW_FUN_EXPORT PFNGLDELETESYNCAPPLEPROC __glewDeleteSyncAPPLE; +GLEW_FUN_EXPORT PFNGLFENCESYNCAPPLEPROC __glewFenceSyncAPPLE; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VAPPLEPROC __glewGetInteger64vAPPLE; +GLEW_FUN_EXPORT PFNGLGETSYNCIVAPPLEPROC __glewGetSyncivAPPLE; +GLEW_FUN_EXPORT PFNGLISSYNCAPPLEPROC __glewIsSyncAPPLE; +GLEW_FUN_EXPORT PFNGLWAITSYNCAPPLEPROC __glewWaitSyncAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; + +GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; +GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; +GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; +GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; +GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; +GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; +GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; +GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; + +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERARBPROC __glewSpecializeShaderARB; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPPROC __glewPolygonOffsetClamp; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC __glewDrawArraysInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseVertexBaseInstanceEXT; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC __glewBindFragDataLocationIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXEXTPROC __glewGetFragDataIndexEXT; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC __glewGetProgramResourceLocationIndexEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTPROC __glewBufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEEXTPROC __glewClearTexImageEXT; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEEXTPROC __glewClearTexSubImageEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAEXTPROC __glewCopyImageSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; +GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLDISCARDFRAMEBUFFEREXTPROC __glewDiscardFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSEXTPROC __glewDrawBuffersEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIEXTPROC __glewBlendEquationSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIEXTPROC __glewBlendEquationiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIEXTPROC __glewBlendFuncSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIEXTPROC __glewBlendFunciEXT; +GLEW_FUN_EXPORT PFNGLCOLORMASKIEXTPROC __glewColorMaskiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEIEXTPROC __glewDisableiEXT; +GLEW_FUN_EXPORT PFNGLENABLEIEXTPROC __glewEnableiEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDIEXTPROC __glewIsEnablediEXT; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXEXTPROC __glewDrawElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC __glewDrawElementsInstancedBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC __glewDrawRangeElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC __glewMultiDrawElementsBaseVertexEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTERNALEXTPROC __glewBufferStorageExternalEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC __glewNamedBufferStorageExternalEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISOREXTPROC __glewVertexAttribDivisorEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC __glewFlushMappedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEEXTPROC __glewMapBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEMEMEXTPROC __glewBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLCREATEMEMORYOBJECTSEXTPROC __glewCreateMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLDELETEMEMORYOBJECTSEXTPROC __glewDeleteMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC __glewGetMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEI_VEXTPROC __glewGetUnsignedBytei_vEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEVEXTPROC __glewGetUnsignedBytevEXT; +GLEW_FUN_EXPORT PFNGLISMEMORYOBJECTEXTPROC __glewIsMemoryObjectEXT; +GLEW_FUN_EXPORT PFNGLMEMORYOBJECTPARAMETERIVEXTPROC __glewMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC __glewNamedBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DEXTPROC __glewTexStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC __glewTexStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DEXTPROC __glewTexStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC __glewTexStorageMem3DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DEXTPROC __glewTextureStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC __glewTextureStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DEXTPROC __glewTextureStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC __glewTextureStorageMem3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYFDEXTPROC __glewImportMemoryFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC __glewImportMemoryWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32NAMEEXTPROC __glewImportMemoryWin32NameEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC __glewMultiDrawArraysIndirectEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC __glewMultiDrawElementsIndirectEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC __glewFramebufferTexture2DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSINDEXEDEXTPROC __glewDrawBuffersIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VEXTPROC __glewGetIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLREADBUFFERINDEXEDEXTPROC __glewReadBufferIndexedEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLDELETESEMAPHORESEXTPROC __glewDeleteSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGENSEMAPHORESEXTPROC __glewGenSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC __glewGetSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLISSEMAPHOREEXTPROC __glewIsSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLSEMAPHOREPARAMETERUI64VEXTPROC __glewSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLSIGNALSEMAPHOREEXTPROC __glewSignalSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLWAITSEMAPHOREEXTPROC __glewWaitSemaphoreEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREFDEXTPROC __glewImportSemaphoreFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC __glewImportSemaphoreWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC __glewImportSemaphoreWin32NameEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC __glewClearPixelLocalStorageuiEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewFramebufferPixelLocalStorageSizeEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewGetFramebufferPixelLocalStorageSizeEXT; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTEXTPROC __glewTexPageCommitmentEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DEXTPROC __glewTexStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DEXTPROC __glewTexStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DEXTPROC __glewTexStorage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWEXTPROC __glewTextureViewEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLBINDARRAYSETEXTPROC __glewBindArraySetEXT; +GLEW_FUN_EXPORT PFNGLCREATEARRAYSETEXTPROC __glewCreateArraySetExt; +GLEW_FUN_EXPORT PFNGLDELETEARRAYSETSEXTPROC __glewDeleteArraySetsEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC __glewAcquireKeyedMutexWin32EXT; +GLEW_FUN_EXPORT PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC __glewReleaseKeyedMutexWin32EXT; + +GLEW_FUN_EXPORT PFNGLWINDOWRECTANGLESEXTPROC __glewWindowRectanglesEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSKHRPROC __glewMaxShaderCompilerThreadsKHR; + +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; +GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLLGPUCOPYIMAGESUBDATANVXPROC __glewLGPUCopyImageSubDataNVX; +GLEW_FUN_EXPORT PFNGLLGPUINTERLOCKNVXPROC __glewLGPUInterlockNVX; +GLEW_FUN_EXPORT PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC __glewLGPUNamedBufferSubDataNVX; + +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERFNVPROC __glewStereoParameterfNV; +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERINVPROC __glewStereoParameteriNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTPOSITIONWSCALENVPROC __glewViewportPositionWScaleNV; + +GLEW_FUN_EXPORT PFNGLCALLCOMMANDLISTNVPROC __glewCallCommandListNV; +GLEW_FUN_EXPORT PFNGLCOMMANDLISTSEGMENTSNVPROC __glewCommandListSegmentsNV; +GLEW_FUN_EXPORT PFNGLCOMPILECOMMANDLISTNVPROC __glewCompileCommandListNV; +GLEW_FUN_EXPORT PFNGLCREATECOMMANDLISTSNVPROC __glewCreateCommandListsNV; +GLEW_FUN_EXPORT PFNGLCREATESTATESNVPROC __glewCreateStatesNV; +GLEW_FUN_EXPORT PFNGLDELETECOMMANDLISTSNVPROC __glewDeleteCommandListsNV; +GLEW_FUN_EXPORT PFNGLDELETESTATESNVPROC __glewDeleteStatesNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSADDRESSNVPROC __glewDrawCommandsAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSNVPROC __glewDrawCommandsNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC __glewDrawCommandsStatesAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESNVPROC __glewDrawCommandsStatesNV; +GLEW_FUN_EXPORT PFNGLGETCOMMANDHEADERNVPROC __glewGetCommandHeaderNV; +GLEW_FUN_EXPORT PFNGLGETSTAGEINDEXNVPROC __glewGetStageIndexNV; +GLEW_FUN_EXPORT PFNGLISCOMMANDLISTNVPROC __glewIsCommandListNV; +GLEW_FUN_EXPORT PFNGLISSTATENVPROC __glewIsStateNV; +GLEW_FUN_EXPORT PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC __glewListDrawCommandsStatesClientNV; +GLEW_FUN_EXPORT PFNGLSTATECAPTURENVPROC __glewStateCaptureNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERINVPROC __glewConservativeRasterParameteriNV; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATANVPROC __glewCopyBufferSubDataNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSNVPROC __glewDrawBuffersNV; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDNVPROC __glewDrawArraysInstancedNV; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDNVPROC __glewDrawElementsInstancedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLDRAWVKIMAGENVPROC __glewDrawVkImageNV; +GLEW_FUN_EXPORT PFNGLGETVKPROCADDRNVPROC __glewGetVkProcAddrNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKFENCENVPROC __glewSignalVkFenceNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKSEMAPHORENVPROC __glewSignalVkSemaphoreNV; +GLEW_FUN_EXPORT PFNGLWAITVKSEMAPHORENVPROC __glewWaitVkSemaphoreNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERNVPROC __glewBlitFramebufferNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC __glewRenderbufferStorageMultisampleNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLMULTICASTBARRIERNVPROC __glewMulticastBarrierNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBLITFRAMEBUFFERNVPROC __glewMulticastBlitFramebufferNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBUFFERSUBDATANVPROC __glewMulticastBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC __glewMulticastCopyBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYIMAGESUBDATANVPROC __glewMulticastCopyImageSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewMulticastFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC __glewMulticastGetQueryObjecti64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTIVNVPROC __glewMulticastGetQueryObjectivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC __glewMulticastGetQueryObjectui64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC __glewMulticastGetQueryObjectuivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTWAITSYNCNVPROC __glewMulticastWaitSyncNV; +GLEW_FUN_EXPORT PFNGLRENDERGPUMASKNVPROC __glewRenderGpuMaskNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORNVPROC __glewVertexAttribDivisorNV; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVNVPROC __glewUniformMatrix2x3fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVNVPROC __glewUniformMatrix2x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVNVPROC __glewUniformMatrix3x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVNVPROC __glewUniformMatrix3x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVNVPROC __glewUniformMatrix4x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVNVPROC __glewUniformMatrix4x3fvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLPOLYGONMODENVPROC __glewPolygonModeNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DNVPROC __glewCompressedTexImage3DNV; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC __glewCompressedTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DNVPROC __glewCopyTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERNVPROC __glewFramebufferTextureLayerNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DNVPROC __glewTexImage3DNV; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DNVPROC __glewTexSubImage3DNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYFVNVPROC __glewDepthRangeArrayfvNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDFNVPROC __glewDepthRangeIndexedfNV; +GLEW_FUN_EXPORT PFNGLDISABLEINVPROC __glewDisableiNV; +GLEW_FUN_EXPORT PFNGLENABLEINVPROC __glewEnableiNV; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VNVPROC __glewGetFloati_vNV; +GLEW_FUN_EXPORT PFNGLISENABLEDINVPROC __glewIsEnablediNV; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVNVPROC __glewScissorArrayvNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDNVPROC __glewScissorIndexedNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVNVPROC __glewScissorIndexedvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVNVPROC __glewViewportArrayvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFNVPROC __glewViewportIndexedfNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVNVPROC __glewViewportIndexedfvNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTSWIZZLENVPROC __glewViewportSwizzleNV; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC __glewFramebufferTextureMultisampleMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCQCOMPROC __glewAlphaFuncQCOM; + +GLEW_FUN_EXPORT PFNGLDISABLEDRIVERCONTROLQCOMPROC __glewDisableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLENABLEDRIVERCONTROLQCOMPROC __glewEnableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSTRINGQCOMPROC __glewGetDriverControlStringQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSQCOMPROC __glewGetDriverControlsQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERPOINTERVQCOMPROC __glewExtGetBufferPointervQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERSQCOMPROC __glewExtGetBuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETFRAMEBUFFERSQCOMPROC __glewExtGetFramebuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETRENDERBUFFERSQCOMPROC __glewExtGetRenderbuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC __glewExtGetTexLevelParameterivQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXSUBIMAGEQCOMPROC __glewExtGetTexSubImageQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXTURESQCOMPROC __glewExtGetTexturesQCOM; +GLEW_FUN_EXPORT PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC __glewExtTexObjectStateOverrideiQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC __glewExtGetProgramBinarySourceQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMSQCOMPROC __glewExtGetProgramsQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETSHADERSQCOMPROC __glewExtGetShadersQCOM; +GLEW_FUN_EXPORT PFNGLEXTISPROGRAMBINARYQCOMPROC __glewExtIsProgramBinaryQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC __glewFramebufferFoveationConfigQCOM; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC __glewFramebufferFoveationParametersQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC __glewFramebufferFetchBarrierQCOM; + +GLEW_FUN_EXPORT PFNGLENDTILINGQCOMPROC __glewEndTilingQCOM; +GLEW_FUN_EXPORT PFNGLSTARTTILINGQCOMPROC __glewStartTilingQCOM; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC __glewInterleavedTextureCoordSetsSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURECOORDSETSGISPROC __glewSelectTextureCoordSetSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURESGISPROC __glewSelectTextureSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURETRANSFORMSGISPROC __glewSelectTextureTransformSGIS; + +GLEW_FUN_EXPORT PFNGLMULTISAMPLESUBRECTPOSSGISPROC __glewMultisampleSubRectPosSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLADDRESSSPACEPROC __glewAddressSpace; +GLEW_FUN_EXPORT PFNGLDATAPIPEPROC __glewDataPipe; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLFOGLAYERSSGIXPROC __glewFogLayersSGIX; +GLEW_FUN_EXPORT PFNGLGETFOGLAYERSSGIXPROC __glewGetFogLayersSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLIGLOOINTERFACESGIXPROC __glewIglooInterfaceSGIX; + +GLEW_FUN_EXPORT PFNGLALLOCMPEGPREDICTORSSGIXPROC __glewAllocMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLDELETEMPEGPREDICTORSSGIXPROC __glewDeleteMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGENMPEGPREDICTORSSGIXPROC __glewGenMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERFVSGIXPROC __glewGetMPEGParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERIVSGIXPROC __glewGetMPEGParameterivSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPREDICTORSGIXPROC __glewGetMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGQUANTTABLEUBVPROC __glewGetMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLISMPEGPREDICTORSGIXPROC __glewIsMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGPREDICTORSGIXPROC __glewMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGQUANTTABLEUBVPROC __glewMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLSWAPMPEGPREDICTORSSGIXPROC __glewSwapMPEGPredictorsSGIX; + +GLEW_FUN_EXPORT PFNGLGETNONLINLIGHTFVSGIXPROC __glewGetNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETNONLINMATERIALFVSGIXPROC __glewGetNonlinMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINLIGHTFVSGIXPROC __glewNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINMATERIALFVSGIXPROC __glewNonlinMaterialfvSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLDEFORMSGIXPROC __glewDeformSGIX; +GLEW_FUN_EXPORT PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC __glewLoadIdentityDeformationMapSGIX; + +GLEW_FUN_EXPORT PFNGLMESHBREADTHSGIXPROC __glewMeshBreadthSGIX; +GLEW_FUN_EXPORT PFNGLMESHSTRIDESGIXPROC __glewMeshStrideSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLGETVECTOROPERATIONSGIXPROC __glewGetVectorOperationSGIX; +GLEW_FUN_EXPORT PFNGLVECTOROPERATIONSGIXPROC __glewVectorOperationSGIX; + +GLEW_FUN_EXPORT PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC __glewAreVertexArraysResidentSGIX; +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYSGIXPROC __glewBindVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSSGIXPROC __glewDeleteVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSSGIXPROC __glewGenVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYSGIXPROC __glewIsVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC __glewPrioritizeVertexArraysSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC __glewGetPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC __glewGetPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFSGIPROC __glewPixelTransformParameterfSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC __glewPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERISGIPROC __glewPixelTransformParameteriSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC __glewPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMSGIPROC __glewPixelTransformSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_6; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_3DC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_ATC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_framebuffer_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int16; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_program_binary_Z400; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_explicit_vertex_parameter; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_gather_bias_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANDROID_extension_pack_es31a; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_clip_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_color_buffer_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_copy_texture_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_2D_limited_npot; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_format_BGRA8888; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_max_level; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_derivative_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_texture_sub_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gl_spirv; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_spirv_extensions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_shader_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_rgba8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_EGL_image_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_YUV_target; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_cull_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compressed_ETC1_RGB8_sub_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_discard_framebuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers_indexed; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_external_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_float_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_frag_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_win32; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiple_textures; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiview_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pvrtc_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_read_format_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_render_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB_write_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_win32; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_implicit_conversions; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_io_blocks; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_non_constant_global_initializers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_samplers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_format_BGRA8888; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_norm16; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_R8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_RG8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_type_2_10_10_10_REV; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_unpack_subimage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_setXXX; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_win32_keyed_mutex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_window_rectangles; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_conservative_rasterization; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_sliced_3d; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_shader_integer_functions; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_blend_equation_advanced_multi_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_linked_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_3dvision_settings; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_EGL_stream_consumer_external; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_alpha_to_coverage_dither_control; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bgr; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_clip_space_w_scaling; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_command_list; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_pre_snap_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_vulkan_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fbo_color_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_generate_mipmap_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_image_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_non_square_matrices; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pack_subimage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float_linear; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_platform_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_polygon_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sRGB_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_noperspective_interpolation; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_cube; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_stereo_view_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc_update; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_npot_2D_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle_compressed; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_uniform_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_alpha_test; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_binning_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_driver_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get2; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_framebuffer_foveated; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_perfmon_global_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_shader_framebuffer_fetch_noncoherent; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_tiled_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_writeonly_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_clip_band_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_shared_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_g_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_r_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_timer_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cadd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cmultiply; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_calligraphic_fragment; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_matrix_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_table_index_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_complex_polar; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cylinder_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_datapipe; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_decimation; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_pass_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_dvc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_factor_to_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_layers; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_patchy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_scale; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_lighting_space; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragments_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_icc_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_igloo_interface; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_image_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_impact_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_instrument_error; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_line_quality_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg2; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nonlinear_lighting_pervertex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nurbs_eval; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_occlusion_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_packed_6bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_tiles; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_polynomial_ffd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_quad_mesh; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_scalebias_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_slim; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_spotlight_cutoff; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subdiv_patch; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_mipmap_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_phase; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_supersample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vector_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcba; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex_type; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_fft; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_scene_markerXXX; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* ------------------------------------------------------------------------- */ + +/* GLEW version info */ + +/* +VERSION 2.1.0 +VERSION_MAJOR 2 +VERSION_MINOR 1 +VERSION_MICRO 0 +*/ + +/* API */ +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#ifndef GLEW_GET_VAR +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLEW_GET_FUN +#define GLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/Windows/glew/include/GL/glxew.h b/Windows/glew/include/GL/glxew.h new file mode 100644 index 00000000..7e39c2fd --- /dev/null +++ b/Windows/glew/include/GL/glxew.h @@ -0,0 +1,1775 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); +typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); +typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); +typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); + +#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) +#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) +#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) +#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) +#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) +#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) +#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) +#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) +#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* --------------------- GLX_ARB_context_flush_control --------------------- */ + +#ifndef GLX_ARB_context_flush_control +#define GLX_ARB_context_flush_control 1 + +#define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) + +#endif /* GLX_ARB_context_flush_control */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* -------------------- GLX_ARB_create_context_no_error -------------------- */ + +#ifndef GLX_ARB_create_context_no_error +#define GLX_ARB_create_context_no_error 1 + +#define GLXEW_ARB_create_context_no_error GLXEW_GET_VAR(__GLXEW_ARB_create_context_no_error) + +#endif /* GLX_ARB_create_context_no_error */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* --------------------------- GLX_EXT_buffer_age -------------------------- */ + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 + +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 + +#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) + +#endif /* GLX_EXT_buffer_age */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* ---------------------------- GLX_EXT_libglvnd --------------------------- */ + +#ifndef GLX_EXT_libglvnd +#define GLX_EXT_libglvnd 1 + +#define GLX_VENDOR_NAMES_EXT 0x20F6 + +#define GLXEW_EXT_libglvnd GLXEW_GET_VAR(__GLXEW_EXT_libglvnd) + +#endif /* GLX_EXT_libglvnd */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_stereo_tree -------------------------- */ + +#ifndef GLX_EXT_stereo_tree +#define GLX_EXT_stereo_tree 1 + +#define GLX_STEREO_NOTIFY_EXT 0x00000000 +#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 +#define GLX_STEREO_TREE_EXT 0x20F5 + +#define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) + +#endif /* GLX_EXT_stereo_tree */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_query_renderer ------------------------ */ + +#ifndef GLX_MESA_query_renderer +#define GLX_MESA_query_renderer 1 + +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 +#define GLX_RENDERER_VERSION_MESA 0x8185 +#define GLX_RENDERER_ACCELERATED_MESA 0x8186 +#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 +#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 +#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 +#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A +#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B +#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C +#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D +#define GLX_RENDERER_ID_MESA 0x818E + +typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); +typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); +typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); +typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); + +#define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) +#define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) +#define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) +#define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) + +#define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) + +#endif /* GLX_MESA_query_renderer */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_buffer -------------------------- */ + +#ifndef GLX_NV_copy_buffer +#define GLX_NV_copy_buffer 1 + +typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + +#define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) +#define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) + +#define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) + +#endif /* GLX_NV_copy_buffer */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* ------------------------ GLX_NV_delay_before_swap ----------------------- */ + +#ifndef GLX_NV_delay_before_swap +#define GLX_NV_delay_before_swap 1 + +typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); + +#define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) + +#define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) + +#endif /* GLX_NV_delay_before_swap */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* ------------------ GLX_NV_robustness_video_memory_purge ----------------- */ + +#ifndef GLX_NV_robustness_video_memory_purge +#define GLX_NV_robustness_video_memory_purge 1 + +#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7 + +#define GLXEW_NV_robustness_video_memory_purge GLXEW_GET_VAR(__GLXEW_NV_robustness_video_memory_purge) + +#endif /* GLX_NV_robustness_video_memory_purge */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* ---------------------------- GLX_NV_video_out --------------------------- */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) + +#endif /* GLX_NV_video_out */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; +GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; +GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; +GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_no_error; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_libglvnd; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_robustness_video_memory_purge; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY glxewInit (); +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#ifndef GLXEW_GET_VAR +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLXEW_GET_FUN +#define GLXEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/Windows/glew/include/GL/wglew.h b/Windows/glew/include/GL/wglew.h new file mode 100644 index 00000000..2097c0f0 --- /dev/null +++ b/Windows/glew/include/GL/wglew.h @@ -0,0 +1,1447 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* --------------------- WGL_ARB_context_flush_control --------------------- */ + +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control 1 + +#define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) + +#endif /* WGL_ARB_context_flush_control */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* -------------------- WGL_ARB_create_context_no_error -------------------- */ + +#ifndef WGL_ARB_create_context_no_error +#define WGL_ARB_create_context_no_error 1 + +#define WGLEW_ARB_create_context_no_error WGLEW_GET_VAR(__WGLEW_ARB_create_context_no_error) + +#endif /* WGL_ARB_create_context_no_error */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* --------------------------- WGL_EXT_colorspace -------------------------- */ + +#ifndef WGL_EXT_colorspace +#define WGL_EXT_colorspace 1 + +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A +#define WGL_COLORSPACE_EXT 0x309D + +#define WGLEW_EXT_colorspace WGLEW_GET_VAR(__WGLEW_EXT_colorspace) + +#endif /* WGL_EXT_colorspace */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* ------------------------ WGL_NV_delay_before_swap ----------------------- */ + +#ifndef WGL_NV_delay_before_swap +#define WGL_NV_delay_before_swap 1 + +typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); + +#define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) + +#define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) + +#endif /* WGL_NV_delay_before_swap */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_no_error; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_colorspace; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; +/* ------------------------------------------------------------------------- */ + +GLEWAPI GLenum GLEWAPIENTRY wglewInit (); +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#ifndef WGLEW_GET_VAR +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef WGLEW_GET_FUN +#define WGLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/Windows/glew/lib/glew32.lib b/Windows/glew/lib/glew32.lib new file mode 100644 index 00000000..3d780d9a Binary files /dev/null and b/Windows/glew/lib/glew32.lib differ diff --git a/Windows/glew/lib/glew32s.lib b/Windows/glew/lib/glew32s.lib new file mode 100644 index 00000000..584c462e Binary files /dev/null and b/Windows/glew/lib/glew32s.lib differ diff --git a/Windows/glew/src/glew.c b/Windows/glew/src/glew.c new file mode 100644 index 00000000..18a2853d --- /dev/null +++ b/Windows/glew/src/glew.c @@ -0,0 +1,28581 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef GLEW_INCLUDE +#include +#else +#include GLEW_INCLUDE +#endif + +#if defined(GLEW_OSMESA) +# define GLAPI extern +# include +#elif defined(GLEW_EGL) +# include +#elif defined(_WIN32) +/* + * If NOGDI is defined, wingdi.h won't be included by windows.h, and thus + * wglGetProcAddress won't be declared. It will instead be implicitly declared, + * potentially incorrectly, which we don't want. + */ +# if defined(NOGDI) +# undef NOGDI +# endif +# include +#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include +#endif + +#include /* For size_t */ + +#if defined(GLEW_EGL) +#elif defined(GLEW_REGAL) + +/* In GLEW_REGAL mode we call direcly into the linked + libRegal.so glGetProcAddressREGAL for looking up + the GL function pointers. */ + +# undef glGetProcAddressREGAL +# ifdef WIN32 +extern void * __stdcall glGetProcAddressREGAL(const GLchar *name); +static void * (__stdcall * regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; +# else +extern void * glGetProcAddressREGAL(const GLchar *name); +static void * (*regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; +# endif +# define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(GLEW_REGAL) +# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name) +#elif defined(GLEW_OSMESA) +# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name) +#elif defined(GLEW_EGL) +# define glewGetProcAddress(name) eglGetProcAddress((const char *)name) +#elif defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#elif defined(__native_client__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +#endif + +/* + * Redefine GLEW_GET_VAR etc without const cast + */ + +#undef GLEW_GET_VAR +# define GLEW_GET_VAR(x) (x) + +#ifdef WGLEW_GET_VAR +# undef WGLEW_GET_VAR +# define WGLEW_GET_VAR(x) (x) +#endif /* WGLEW_GET_VAR */ + +#ifdef GLXEW_GET_VAR +# undef GLXEW_GET_VAR +# define GLXEW_GET_VAR(x) (x) +#endif /* GLXEW_GET_VAR */ + +#ifdef EGLEW_GET_VAR +# undef EGLEW_GET_VAR +# define EGLEW_GET_VAR(x) (x) +#endif /* EGLEW_GET_VAR */ + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ + +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return i; +} + +static GLuint _glewStrCopy(char *d, const char *s, char c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) { d[i] = s[i]; i++; } + d[i] = '\0'; + return i; +} + +#if !defined(GLEW_OSMESA) +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} +#endif +#endif + +static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +#if !defined(GLEW_OSMESA) +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} +#endif +#endif + +PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; +PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; +PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; +PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; + +PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; +PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; +PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; +PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; + +PFNGLBLENDCOLORPROC __glewBlendColor = NULL; +PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; +PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; +PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; +PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; +PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; +PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; +PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; +PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; +PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; +PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; +PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; +PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; + +PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; +PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; +PFNGLBUFFERDATAPROC __glewBufferData = NULL; +PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; +PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; +PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; +PFNGLENDQUERYPROC __glewEndQuery = NULL; +PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; +PFNGLGENQUERIESPROC __glewGenQueries = NULL; +PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; +PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; +PFNGLISBUFFERPROC __glewIsBuffer = NULL; +PFNGLISQUERYPROC __glewIsQuery = NULL; +PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; +PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; + +PFNGLATTACHSHADERPROC __glewAttachShader = NULL; +PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; +PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; +PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; +PFNGLCREATESHADERPROC __glewCreateShader = NULL; +PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; +PFNGLDELETESHADERPROC __glewDeleteShader = NULL; +PFNGLDETACHSHADERPROC __glewDetachShader = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; +PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; +PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; +PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; +PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; +PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; +PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; +PFNGLISPROGRAMPROC __glewIsProgram = NULL; +PFNGLISSHADERPROC __glewIsShader = NULL; +PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; +PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; +PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; +PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; +PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; +PFNGLUNIFORM1FPROC __glewUniform1f = NULL; +PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; +PFNGLUNIFORM1IPROC __glewUniform1i = NULL; +PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; +PFNGLUNIFORM2FPROC __glewUniform2f = NULL; +PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; +PFNGLUNIFORM2IPROC __glewUniform2i = NULL; +PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; +PFNGLUNIFORM3FPROC __glewUniform3f = NULL; +PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; +PFNGLUNIFORM3IPROC __glewUniform3i = NULL; +PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; +PFNGLUNIFORM4FPROC __glewUniform4f = NULL; +PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; +PFNGLUNIFORM4IPROC __glewUniform4i = NULL; +PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; +PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; +PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; + +PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; +PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; +PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; +PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; +PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; +PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; + +PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; +PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; +PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; +PFNGLCLAMPCOLORPROC __glewClampColor = NULL; +PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; +PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; +PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; +PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; +PFNGLCOLORMASKIPROC __glewColorMaski = NULL; +PFNGLDISABLEIPROC __glewDisablei = NULL; +PFNGLENABLEIPROC __glewEnablei = NULL; +PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; +PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; +PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; +PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; +PFNGLGETSTRINGIPROC __glewGetStringi = NULL; +PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; +PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; +PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; +PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; +PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; +PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; +PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; +PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; +PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; +PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; +PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; +PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; +PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; +PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; +PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; +PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; +PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; +PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; +PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; +PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; +PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; +PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; +PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; +PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; +PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; +PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; +PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; +PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; +PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; +PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; +PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; +PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; +PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; +PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; +PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; +PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; + +PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; +PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; +PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; +PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; + +PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; +PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; +PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; + +PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; + +PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; +PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; +PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; +PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; +PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; + +PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage = NULL; +PFNGLGETNTEXIMAGEPROC __glewGetnTexImage = NULL; +PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC __glewMultiDrawArraysIndirectCount = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC __glewMultiDrawElementsIndirectCount = NULL; +PFNGLSPECIALIZESHADERPROC __glewSpecializeShader = NULL; + +PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; + +PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; +PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; +PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; +PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; + +PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; +PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; + +PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewFramebufferSamplePositionsfvAMD = NULL; +PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC __glewGetFramebufferParameterfvAMD = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC __glewGetNamedFramebufferParameterfvAMD = NULL; +PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewNamedFramebufferSamplePositionsfvAMD = NULL; + +PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; + +PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; +PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; +PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; + +PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD = NULL; + +PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; +PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; +PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; +PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; +PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; + +PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; + +PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD = NULL; +PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD = NULL; + +PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; + +PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; +PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; + +PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE = NULL; + +PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE = NULL; +PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE = NULL; +PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE = NULL; + +PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE = NULL; +PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE = NULL; +PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE = NULL; +PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE = NULL; +PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE = NULL; +PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE = NULL; +PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE = NULL; +PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE = NULL; +PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE = NULL; +PFNGLISQUERYANGLEPROC __glewIsQueryANGLE = NULL; +PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE = NULL; + +PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE = NULL; + +PFNGLCOPYTEXTURELEVELSAPPLEPROC __glewCopyTextureLevelsAPPLE = NULL; + +PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; +PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; + +PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; +PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; +PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; +PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; +PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; +PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; +PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; +PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; + +PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC __glewRenderbufferStorageMultisampleAPPLE = NULL; +PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC __glewResolveMultisampleFramebufferAPPLE = NULL; + +PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; +PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; +PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; + +PFNGLCLIENTWAITSYNCAPPLEPROC __glewClientWaitSyncAPPLE = NULL; +PFNGLDELETESYNCAPPLEPROC __glewDeleteSyncAPPLE = NULL; +PFNGLFENCESYNCAPPLEPROC __glewFenceSyncAPPLE = NULL; +PFNGLGETINTEGER64VAPPLEPROC __glewGetInteger64vAPPLE = NULL; +PFNGLGETSYNCIVAPPLEPROC __glewGetSyncivAPPLE = NULL; +PFNGLISSYNCAPPLEPROC __glewIsSyncAPPLE = NULL; +PFNGLWAITSYNCAPPLEPROC __glewWaitSyncAPPLE = NULL; + +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; +PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; + +PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; +PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; +PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; +PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; + +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; +PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; + +PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; +PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; + +PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; +PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; +PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; +PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; +PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; + +PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion = NULL; + +PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB = NULL; + +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; + +PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB = NULL; +PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB = NULL; +PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB = NULL; +PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB = NULL; +PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB = NULL; +PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB = NULL; +PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB = NULL; +PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB = NULL; +PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB = NULL; +PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; +PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; + +PFNGLBUFFERSTORAGEPROC __glewBufferStorage = NULL; + +PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; + +PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; +PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; + +PFNGLCLEARTEXIMAGEPROC __glewClearTexImage = NULL; +PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage = NULL; + +PFNGLCLIPCONTROLPROC __glewClipControl = NULL; + +PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; + +PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; +PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; + +PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB = NULL; + +PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; + +PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; + +PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; +PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; +PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; +PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; + +PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit = NULL; +PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus = NULL; +PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D = NULL; +PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D = NULL; +PFNGLCREATEBUFFERSPROC __glewCreateBuffers = NULL; +PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers = NULL; +PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines = NULL; +PFNGLCREATEQUERIESPROC __glewCreateQueries = NULL; +PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers = NULL; +PFNGLCREATESAMPLERSPROC __glewCreateSamplers = NULL; +PFNGLCREATETEXTURESPROC __glewCreateTextures = NULL; +PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks = NULL; +PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib = NULL; +PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange = NULL; +PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage = NULL; +PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv = NULL; +PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv = NULL; +PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv = NULL; +PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v = NULL; +PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv = NULL; +PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v = NULL; +PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv = NULL; +PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv = NULL; +PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv = NULL; +PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv = NULL; +PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv = NULL; +PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv = NULL; +PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v = NULL; +PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v = NULL; +PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv = NULL; +PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv = NULL; +PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv = NULL; +PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv = NULL; +PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData = NULL; +PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData = NULL; +PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer = NULL; +PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange = NULL; +PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData = NULL; +PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage = NULL; +PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData = NULL; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer = NULL; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri = NULL; +PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample = NULL; +PFNGLTEXTUREBUFFERPROC __glewTextureBuffer = NULL; +PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange = NULL; +PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv = NULL; +PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv = NULL; +PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf = NULL; +PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv = NULL; +PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri = NULL; +PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv = NULL; +PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D = NULL; +PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample = NULL; +PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample = NULL; +PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D = NULL; +PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D = NULL; +PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D = NULL; +PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase = NULL; +PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange = NULL; +PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer = NULL; +PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding = NULL; +PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat = NULL; +PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat = NULL; +PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat = NULL; +PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor = NULL; +PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer = NULL; +PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer = NULL; +PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers = NULL; + +PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; + +PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; +PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; +PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; +PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; + +PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; +PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; + +PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; + +PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; +PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; +PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; +PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; +PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; +PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; +PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; +PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; +PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; +PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; +PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; +PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; +PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; +PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; +PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; + +PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; +PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; + +PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; +PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; +PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; + +PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage = NULL; +PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage = NULL; + +PFNGLSPECIALIZESHADERARBPROC __glewSpecializeShaderARB = NULL; + +PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; +PFNGLUNIFORM1DPROC __glewUniform1d = NULL; +PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; +PFNGLUNIFORM2DPROC __glewUniform2d = NULL; +PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; +PFNGLUNIFORM3DPROC __glewUniform3d = NULL; +PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; +PFNGLUNIFORM4DPROC __glewUniform4d = NULL; +PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; +PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; +PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; +PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; +PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; +PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; +PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; +PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; +PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; +PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; + +PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB = NULL; +PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB = NULL; +PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB = NULL; +PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB = NULL; +PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB = NULL; +PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB = NULL; +PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB = NULL; +PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB = NULL; +PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB = NULL; +PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB = NULL; +PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB = NULL; +PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB = NULL; +PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB = NULL; +PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB = NULL; +PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB = NULL; +PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB = NULL; +PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB = NULL; +PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB = NULL; +PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB = NULL; +PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB = NULL; +PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB = NULL; +PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB = NULL; +PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB = NULL; +PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB = NULL; +PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB = NULL; +PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB = NULL; +PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB = NULL; +PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB = NULL; +PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB = NULL; +PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB = NULL; +PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB = NULL; +PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB = NULL; +PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB = NULL; +PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB = NULL; +PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB = NULL; +PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB = NULL; + +PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; +PFNGLCOLORTABLEPROC __glewColorTable = NULL; +PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; +PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; +PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; +PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; +PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; +PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; +PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; +PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; +PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; +PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; +PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; +PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; +PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; +PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; +PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; +PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; +PFNGLGETMINMAXPROC __glewGetMinmax = NULL; +PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; +PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; +PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; +PFNGLHISTOGRAMPROC __glewHistogram = NULL; +PFNGLMINMAXPROC __glewMinmax = NULL; +PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; +PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; +PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB = NULL; + +PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; +PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; +PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; + +PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; + +PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; + +PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; +PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; +PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; +PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; +PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; +PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; +PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; + +PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; +PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; +PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; +PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; +PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; + +PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase = NULL; +PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange = NULL; +PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures = NULL; +PFNGLBINDSAMPLERSPROC __glewBindSamplers = NULL; +PFNGLBINDTEXTURESPROC __glewBindTextures = NULL; +PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; + +PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; + +PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; +PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; +PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; +PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; +PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; +PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; +PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; +PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; +PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; +PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; +PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; +PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; +PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; +PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; +PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; +PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; +PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; +PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; +PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; +PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; +PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; +PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; +PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; +PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; +PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; +PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; +PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; +PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; +PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; +PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; +PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; +PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; +PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; +PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; + +PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; +PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; +PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; +PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; +PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; +PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; +PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; +PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; + +PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB = NULL; + +PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; +PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; + +PFNGLPOLYGONOFFSETCLAMPPROC __glewPolygonOffsetClamp = NULL; + +PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; +PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; +PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; +PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; + +PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; + +PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; +PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; +PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; +PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; +PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; +PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; +PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; +PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; +PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; +PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; +PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; +PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; +PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; +PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; +PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; +PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; +PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; +PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; +PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; + +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB = NULL; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB = NULL; + +PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; + +PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; +PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; +PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; +PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; +PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; +PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; +PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; +PFNGLISSAMPLERPROC __glewIsSampler = NULL; +PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; +PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; +PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; +PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; +PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; +PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; + +PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; +PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; +PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; +PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; +PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; +PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; +PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; +PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; +PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; +PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; +PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; +PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; +PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; +PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; +PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; +PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; +PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; +PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; +PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; +PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; +PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; +PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; +PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; +PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; +PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; +PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; +PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; +PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; +PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; +PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; +PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; +PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; +PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; +PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; +PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; +PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; +PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; +PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; +PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; +PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; +PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; + +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; + +PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; +PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; + +PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; +PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; +PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; +PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; +PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; +PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; +PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; +PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; +PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; +PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; +PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; +PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; +PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; +PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; +PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; +PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; +PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; +PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; +PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; +PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; +PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; +PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; +PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; +PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; +PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; +PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; +PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; +PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; +PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; +PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; +PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; +PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; +PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; +PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; +PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; +PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; +PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; +PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; +PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; + +PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; + +PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; +PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; +PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; +PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; +PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; + +PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; +PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; +PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; +PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; + +PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB = NULL; + +PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB = NULL; + +PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; +PFNGLDELETESYNCPROC __glewDeleteSync = NULL; +PFNGLFENCESYNCPROC __glewFenceSync = NULL; +PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; +PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; +PFNGLISSYNCPROC __glewIsSync = NULL; +PFNGLWAITSYNCPROC __glewWaitSync = NULL; + +PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; +PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; + +PFNGLTEXTUREBARRIERPROC __glewTextureBarrier = NULL; + +PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; + +PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; +PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; + +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; + +PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; +PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; +PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; +PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; + +PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; +PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; +PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; + +PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; + +PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; + +PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; +PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; +PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; + +PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; +PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; +PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; +PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; +PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; +PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; +PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; + +PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; +PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; +PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; + +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; + +PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; +PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; +PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; +PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; + +PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; +PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; +PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; +PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; +PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; +PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; +PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; +PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; + +PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; +PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; +PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; +PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; + +PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; +PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; +PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; +PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; +PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; +PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; +PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; +PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; +PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; +PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; + +PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; +PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT = NULL; +PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT = NULL; +PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; +PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; +PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; +PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; +PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; + +PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; +PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; +PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; +PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; +PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; +PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; +PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; +PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; +PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; +PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; + +PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; +PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; +PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; +PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; +PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; +PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; +PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; +PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; +PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; +PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; +PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; + +PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; +PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; +PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; +PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; +PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; +PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; +PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; +PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; +PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; +PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; +PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; +PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; +PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; +PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; +PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; +PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; +PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; +PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; +PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; +PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; +PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; +PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; +PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; +PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; +PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; +PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; +PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; +PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; +PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; +PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; +PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; +PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; +PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; +PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; +PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; +PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; +PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; +PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; +PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; +PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; +PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; +PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; +PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; +PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; +PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; +PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; +PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; +PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; +PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; +PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; +PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; + +PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; +PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; +PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; + +PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; +PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; +PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; +PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; +PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; +PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; +PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; +PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; +PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; +PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; +PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; +PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; +PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; +PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; +PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; +PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; +PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; +PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; +PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; +PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; +PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; +PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; +PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; +PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; +PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; +PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; +PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; +PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; +PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; +PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; +PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; +PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; +PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; +PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; +PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; +PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; +PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; +PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; + +PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; +PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; +PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; +PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; +PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; +PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; +PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; +PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; +PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; +PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; + +PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; +PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; +PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; +PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; +PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; +PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; +PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; +PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; +PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; +PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; +PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; +PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; +PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; +PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; +PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; +PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; + +PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; + +PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; +PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; +PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; + +PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; +PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; +PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; +PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; + +PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; +PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; +PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; +PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; +PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; +PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; +PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; +PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; +PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; +PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; +PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; +PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; +PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; + +PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; +PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; + +PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; + +PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; +PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; + +PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; +PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; +PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; +PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; +PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; +PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; +PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; +PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; +PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; +PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; + +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; + +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; +PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; +PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; +PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; +PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; +PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; +PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; +PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; +PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; +PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; +PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; +PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; +PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; +PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; +PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; +PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; +PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; +PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; +PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; +PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; +PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; +PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; +PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; +PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; +PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; +PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; +PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; +PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; +PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; +PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; +PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; +PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; +PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; +PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; +PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; +PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; +PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; +PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; +PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; +PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; +PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; +PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; +PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; +PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; + +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC __glewDrawArraysInstancedBaseInstanceEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseInstanceEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseVertexBaseInstanceEXT = NULL; + +PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; +PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; +PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; + +PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC __glewBindFragDataLocationIndexedEXT = NULL; +PFNGLGETFRAGDATAINDEXEXTPROC __glewGetFragDataIndexEXT = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC __glewGetProgramResourceLocationIndexEXT = NULL; + +PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; + +PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; + +PFNGLBUFFERSTORAGEEXTPROC __glewBufferStorageEXT = NULL; +PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT = NULL; + +PFNGLCLEARTEXIMAGEEXTPROC __glewClearTexImageEXT = NULL; +PFNGLCLEARTEXSUBIMAGEEXTPROC __glewClearTexSubImageEXT = NULL; + +PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; +PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; + +PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; +PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; + +PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; +PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; +PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; +PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; +PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; + +PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; +PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; + +PFNGLCOPYIMAGESUBDATAEXTPROC __glewCopyImageSubDataEXT = NULL; + +PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; +PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; + +PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; +PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; + +PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT = NULL; +PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT = NULL; + +PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; +PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; +PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; + +PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; + +PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; +PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; +PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; +PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; +PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; +PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; +PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; +PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; +PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; +PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; +PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; +PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; +PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; +PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; +PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; +PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; +PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; +PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; +PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; +PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; +PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; +PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; +PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; +PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; +PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; +PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; +PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; +PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; +PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; +PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; +PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; +PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; +PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; +PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; +PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; +PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; +PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; +PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; +PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; +PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; +PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; +PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; +PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; +PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; +PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; +PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; +PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; +PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; +PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; +PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; +PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; +PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; +PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; +PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; +PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; +PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; +PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; +PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; +PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; +PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; +PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; +PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; +PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; +PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; +PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; +PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; +PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; +PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; +PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; +PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; +PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; +PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; +PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; +PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; +PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; +PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; +PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; +PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; +PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; +PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; +PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; +PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; +PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; +PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; +PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; +PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; +PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; +PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; +PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; +PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; +PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; +PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; +PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; +PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; +PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; +PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; +PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; +PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; +PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; +PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; +PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; +PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; +PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; +PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; +PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; +PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; +PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; +PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; + +PFNGLDISCARDFRAMEBUFFEREXTPROC __glewDiscardFramebufferEXT = NULL; + +PFNGLDRAWBUFFERSEXTPROC __glewDrawBuffersEXT = NULL; + +PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; +PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; +PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; +PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; +PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; +PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEIEXTPROC __glewBlendEquationSeparateiEXT = NULL; +PFNGLBLENDEQUATIONIEXTPROC __glewBlendEquationiEXT = NULL; +PFNGLBLENDFUNCSEPARATEIEXTPROC __glewBlendFuncSeparateiEXT = NULL; +PFNGLBLENDFUNCIEXTPROC __glewBlendFunciEXT = NULL; +PFNGLCOLORMASKIEXTPROC __glewColorMaskiEXT = NULL; +PFNGLDISABLEIEXTPROC __glewDisableiEXT = NULL; +PFNGLENABLEIEXTPROC __glewEnableiEXT = NULL; +PFNGLISENABLEDIEXTPROC __glewIsEnablediEXT = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXEXTPROC __glewDrawElementsBaseVertexEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC __glewDrawElementsInstancedBaseVertexEXT = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC __glewDrawRangeElementsBaseVertexEXT = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC __glewMultiDrawElementsBaseVertexEXT = NULL; + +PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; + +PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; + +PFNGLBUFFERSTORAGEEXTERNALEXTPROC __glewBufferStorageExternalEXT = NULL; +PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC __glewNamedBufferStorageExternalEXT = NULL; + +PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; +PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; +PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; +PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; +PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; + +PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; +PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; +PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; +PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; +PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; +PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; +PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; +PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; +PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; +PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; +PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; +PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; +PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; +PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; + +PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; + +PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; +PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; +PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; +PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; +PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; +PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; +PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; +PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; +PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; +PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; + +PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; +PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; + +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; + +PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; +PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; +PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; +PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; +PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; +PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; +PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; +PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; +PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; +PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; +PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; +PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; +PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; +PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; +PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; +PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; +PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; +PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; +PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; +PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; +PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; +PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; +PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; +PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; +PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; +PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; +PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; +PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; +PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; +PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; +PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; +PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; +PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; +PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; + +PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; +PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; +PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; +PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; +PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; +PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; +PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; +PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; + +PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; + +PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; + +PFNGLVERTEXATTRIBDIVISOREXTPROC __glewVertexAttribDivisorEXT = NULL; + +PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; +PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; +PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC __glewFlushMappedBufferRangeEXT = NULL; +PFNGLMAPBUFFERRANGEEXTPROC __glewMapBufferRangeEXT = NULL; + +PFNGLBUFFERSTORAGEMEMEXTPROC __glewBufferStorageMemEXT = NULL; +PFNGLCREATEMEMORYOBJECTSEXTPROC __glewCreateMemoryObjectsEXT = NULL; +PFNGLDELETEMEMORYOBJECTSEXTPROC __glewDeleteMemoryObjectsEXT = NULL; +PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC __glewGetMemoryObjectParameterivEXT = NULL; +PFNGLGETUNSIGNEDBYTEI_VEXTPROC __glewGetUnsignedBytei_vEXT = NULL; +PFNGLGETUNSIGNEDBYTEVEXTPROC __glewGetUnsignedBytevEXT = NULL; +PFNGLISMEMORYOBJECTEXTPROC __glewIsMemoryObjectEXT = NULL; +PFNGLMEMORYOBJECTPARAMETERIVEXTPROC __glewMemoryObjectParameterivEXT = NULL; +PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC __glewNamedBufferStorageMemEXT = NULL; +PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT = NULL; +PFNGLTEXSTORAGEMEM2DEXTPROC __glewTexStorageMem2DEXT = NULL; +PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC __glewTexStorageMem2DMultisampleEXT = NULL; +PFNGLTEXSTORAGEMEM3DEXTPROC __glewTexStorageMem3DEXT = NULL; +PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC __glewTexStorageMem3DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT = NULL; +PFNGLTEXTURESTORAGEMEM2DEXTPROC __glewTextureStorageMem2DEXT = NULL; +PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC __glewTextureStorageMem2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGEMEM3DEXTPROC __glewTextureStorageMem3DEXT = NULL; +PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC __glewTextureStorageMem3DMultisampleEXT = NULL; + +PFNGLIMPORTMEMORYFDEXTPROC __glewImportMemoryFdEXT = NULL; + +PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC __glewImportMemoryWin32HandleEXT = NULL; +PFNGLIMPORTMEMORYWIN32NAMEEXTPROC __glewImportMemoryWin32NameEXT = NULL; + +PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; +PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC __glewMultiDrawArraysIndirectEXT = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC __glewMultiDrawElementsIndirectEXT = NULL; + +PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; +PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; + +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC __glewFramebufferTexture2DMultisampleEXT = NULL; + +PFNGLDRAWBUFFERSINDEXEDEXTPROC __glewDrawBuffersIndexedEXT = NULL; +PFNGLGETINTEGERI_VEXTPROC __glewGetIntegeri_vEXT = NULL; +PFNGLREADBUFFERINDEXEDEXTPROC __glewReadBufferIndexedEXT = NULL; + +PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; +PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; + +PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; +PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; + +PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; + +PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT = NULL; + +PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; + +PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV = NULL; +PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV = NULL; +PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV = NULL; +PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT = NULL; + +PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; +PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; + +PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; +PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; +PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; +PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; +PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; +PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; +PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; +PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; +PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; +PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; +PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; +PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; +PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; +PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; +PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; +PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; +PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; + +PFNGLDELETESEMAPHORESEXTPROC __glewDeleteSemaphoresEXT = NULL; +PFNGLGENSEMAPHORESEXTPROC __glewGenSemaphoresEXT = NULL; +PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC __glewGetSemaphoreParameterui64vEXT = NULL; +PFNGLISSEMAPHOREEXTPROC __glewIsSemaphoreEXT = NULL; +PFNGLSEMAPHOREPARAMETERUI64VEXTPROC __glewSemaphoreParameterui64vEXT = NULL; +PFNGLSIGNALSEMAPHOREEXTPROC __glewSignalSemaphoreEXT = NULL; +PFNGLWAITSEMAPHOREEXTPROC __glewWaitSemaphoreEXT = NULL; + +PFNGLIMPORTSEMAPHOREFDEXTPROC __glewImportSemaphoreFdEXT = NULL; + +PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC __glewImportSemaphoreWin32HandleEXT = NULL; +PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC __glewImportSemaphoreWin32NameEXT = NULL; + +PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; +PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; +PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; + +PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; +PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; + +PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC __glewClearPixelLocalStorageuiEXT = NULL; +PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewFramebufferPixelLocalStorageSizeEXT = NULL; +PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewGetFramebufferPixelLocalStorageSizeEXT = NULL; + +PFNGLTEXPAGECOMMITMENTEXTPROC __glewTexPageCommitmentEXT = NULL; +PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT = NULL; + +PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; + +PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; +PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; +PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; + +PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; + +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; + +PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; + +PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; +PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; +PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; +PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; +PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; +PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; + +PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; +PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; +PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; +PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; +PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; +PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; + +PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; + +PFNGLTEXSTORAGE1DEXTPROC __glewTexStorage1DEXT = NULL; +PFNGLTEXSTORAGE2DEXTPROC __glewTexStorage2DEXT = NULL; +PFNGLTEXSTORAGE3DEXTPROC __glewTexStorage3DEXT = NULL; +PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; +PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; +PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; + +PFNGLTEXTUREVIEWEXTPROC __glewTextureViewEXT = NULL; + +PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; +PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; + +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; +PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; +PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; +PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; +PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; + +PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; +PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; +PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; +PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; +PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; +PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; +PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; +PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; + +PFNGLBINDARRAYSETEXTPROC __glewBindArraySetEXT = NULL; +PFNGLCREATEARRAYSETEXTPROC __glewCreateArraySetExt = NULL; +PFNGLDELETEARRAYSETSEXTPROC __glewDeleteArraySetsEXT = NULL; + +PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; +PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; +PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; +PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; +PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; +PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; +PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; +PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; +PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; +PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; + +PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; +PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; +PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; +PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; +PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; +PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; +PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; +PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; +PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; +PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; +PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; +PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; +PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; +PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; +PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; +PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; +PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; +PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; +PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; +PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; +PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; +PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; +PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; +PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; +PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; +PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; +PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; +PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; +PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; +PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; +PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; +PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; +PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; +PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; +PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; +PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; + +PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; +PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; +PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; + +PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC __glewAcquireKeyedMutexWin32EXT = NULL; +PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC __glewReleaseKeyedMutexWin32EXT = NULL; + +PFNGLWINDOWRECTANGLESEXTPROC __glewWindowRectanglesEXT = NULL; + +PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; + +PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; + +PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; + +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; + +PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; + +PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; +PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; +PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; +PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; +PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; +PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; +PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; + +PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL = NULL; +PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL = NULL; +PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL = NULL; + +PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; +PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; +PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; +PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; + +PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL = NULL; +PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL = NULL; +PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL = NULL; +PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL = NULL; +PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL = NULL; +PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL = NULL; +PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL = NULL; +PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL = NULL; +PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL = NULL; +PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL = NULL; + +PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; +PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; + +PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR = NULL; + +PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; +PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; +PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; +PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; +PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; +PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; +PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; +PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; +PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL; +PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; + +PFNGLMAXSHADERCOMPILERTHREADSKHRPROC __glewMaxShaderCompilerThreadsKHR = NULL; + +PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv = NULL; +PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv = NULL; +PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv = NULL; +PFNGLREADNPIXELSPROC __glewReadnPixels = NULL; + +PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; +PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; +PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; +PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; +PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; + +PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; + +PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; +PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; +PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; +PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; +PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; +PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; +PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; +PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; +PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; +PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; +PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; +PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; +PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; +PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; +PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; +PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; +PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; +PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; +PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; +PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; +PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; +PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; +PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; +PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; + +PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX = NULL; +PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX = NULL; + +PFNGLLGPUCOPYIMAGESUBDATANVXPROC __glewLGPUCopyImageSubDataNVX = NULL; +PFNGLLGPUINTERLOCKNVXPROC __glewLGPUInterlockNVX = NULL; +PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC __glewLGPUNamedBufferSubDataNVX = NULL; + +PFNGLSTEREOPARAMETERFNVPROC __glewStereoParameterfNV = NULL; +PFNGLSTEREOPARAMETERINVPROC __glewStereoParameteriNV = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV = NULL; + +PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; +PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; +PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; +PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; +PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; +PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; +PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; + +PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV = NULL; +PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV = NULL; + +PFNGLVIEWPORTPOSITIONWSCALENVPROC __glewViewportPositionWScaleNV = NULL; + +PFNGLCALLCOMMANDLISTNVPROC __glewCallCommandListNV = NULL; +PFNGLCOMMANDLISTSEGMENTSNVPROC __glewCommandListSegmentsNV = NULL; +PFNGLCOMPILECOMMANDLISTNVPROC __glewCompileCommandListNV = NULL; +PFNGLCREATECOMMANDLISTSNVPROC __glewCreateCommandListsNV = NULL; +PFNGLCREATESTATESNVPROC __glewCreateStatesNV = NULL; +PFNGLDELETECOMMANDLISTSNVPROC __glewDeleteCommandListsNV = NULL; +PFNGLDELETESTATESNVPROC __glewDeleteStatesNV = NULL; +PFNGLDRAWCOMMANDSADDRESSNVPROC __glewDrawCommandsAddressNV = NULL; +PFNGLDRAWCOMMANDSNVPROC __glewDrawCommandsNV = NULL; +PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC __glewDrawCommandsStatesAddressNV = NULL; +PFNGLDRAWCOMMANDSSTATESNVPROC __glewDrawCommandsStatesNV = NULL; +PFNGLGETCOMMANDHEADERNVPROC __glewGetCommandHeaderNV = NULL; +PFNGLGETSTAGEINDEXNVPROC __glewGetStageIndexNV = NULL; +PFNGLISCOMMANDLISTNVPROC __glewIsCommandListNV = NULL; +PFNGLISSTATENVPROC __glewIsStateNV = NULL; +PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC __glewListDrawCommandsStatesClientNV = NULL; +PFNGLSTATECAPTURENVPROC __glewStateCaptureNV = NULL; + +PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; +PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; + +PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV = NULL; + +PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV = NULL; + +PFNGLCONSERVATIVERASTERPARAMETERINVPROC __glewConservativeRasterParameteriNV = NULL; + +PFNGLCOPYBUFFERSUBDATANVPROC __glewCopyBufferSubDataNV = NULL; + +PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; + +PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; +PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; +PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; + +PFNGLDRAWBUFFERSNVPROC __glewDrawBuffersNV = NULL; + +PFNGLDRAWARRAYSINSTANCEDNVPROC __glewDrawArraysInstancedNV = NULL; +PFNGLDRAWELEMENTSINSTANCEDNVPROC __glewDrawElementsInstancedNV = NULL; + +PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV = NULL; + +PFNGLDRAWVKIMAGENVPROC __glewDrawVkImageNV = NULL; +PFNGLGETVKPROCADDRNVPROC __glewGetVkProcAddrNV = NULL; +PFNGLSIGNALVKFENCENVPROC __glewSignalVkFenceNV = NULL; +PFNGLSIGNALVKSEMAPHORENVPROC __glewSignalVkSemaphoreNV = NULL; +PFNGLWAITVKSEMAPHORENVPROC __glewWaitVkSemaphoreNV = NULL; + +PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; +PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; +PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; +PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; +PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; +PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; +PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; + +PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; +PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; +PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; + +PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; +PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; +PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; +PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; +PFNGLISFENCENVPROC __glewIsFenceNV = NULL; +PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; +PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; + +PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV = NULL; + +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; + +PFNGLBLITFRAMEBUFFERNVPROC __glewBlitFramebufferNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC __glewRenderbufferStorageMultisampleNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; + +PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; + +PFNGLMULTICASTBARRIERNVPROC __glewMulticastBarrierNV = NULL; +PFNGLMULTICASTBLITFRAMEBUFFERNVPROC __glewMulticastBlitFramebufferNV = NULL; +PFNGLMULTICASTBUFFERSUBDATANVPROC __glewMulticastBufferSubDataNV = NULL; +PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC __glewMulticastCopyBufferSubDataNV = NULL; +PFNGLMULTICASTCOPYIMAGESUBDATANVPROC __glewMulticastCopyImageSubDataNV = NULL; +PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewMulticastFramebufferSampleLocationsfvNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC __glewMulticastGetQueryObjecti64vNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTIVNVPROC __glewMulticastGetQueryObjectivNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC __glewMulticastGetQueryObjectui64vNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC __glewMulticastGetQueryObjectuivNV = NULL; +PFNGLMULTICASTWAITSYNCNVPROC __glewMulticastWaitSyncNV = NULL; +PFNGLRENDERGPUMASKNVPROC __glewRenderGpuMaskNV = NULL; + +PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; + +PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; +PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; +PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; +PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; +PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; +PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; +PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; +PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; +PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; +PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; +PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; +PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; +PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; +PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; +PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; +PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; +PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; +PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; +PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; +PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; +PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; +PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; +PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; +PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; +PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; +PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; +PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; +PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; +PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; +PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; +PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; +PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; +PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; +PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; + +PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; +PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; +PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; +PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; +PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; +PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; +PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; +PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; +PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; +PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; +PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; +PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; +PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; +PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; +PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; +PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; +PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; +PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; +PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; +PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; +PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; +PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; +PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; +PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; +PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; +PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; +PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; +PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; +PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; +PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; +PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; +PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; +PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; +PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; +PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; +PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; +PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; +PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; +PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; +PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; +PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; +PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; +PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; +PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; +PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; +PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; + +PFNGLVERTEXATTRIBDIVISORNVPROC __glewVertexAttribDivisorNV = NULL; + +PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV = NULL; + +PFNGLUNIFORMMATRIX2X3FVNVPROC __glewUniformMatrix2x3fvNV = NULL; +PFNGLUNIFORMMATRIX2X4FVNVPROC __glewUniformMatrix2x4fvNV = NULL; +PFNGLUNIFORMMATRIX3X2FVNVPROC __glewUniformMatrix3x2fvNV = NULL; +PFNGLUNIFORMMATRIX3X4FVNVPROC __glewUniformMatrix3x4fvNV = NULL; +PFNGLUNIFORMMATRIX4X2FVNVPROC __glewUniformMatrix4x2fvNV = NULL; +PFNGLUNIFORMMATRIX4X3FVNVPROC __glewUniformMatrix4x3fvNV = NULL; + +PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; +PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; +PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; +PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; +PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; +PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; +PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; + +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; + +PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; +PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; +PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; +PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; +PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; +PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; +PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; +PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; +PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; +PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; +PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; +PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; +PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; +PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; +PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; +PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; +PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; +PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; +PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; +PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV = NULL; +PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; +PFNGLISPATHNVPROC __glewIsPathNV = NULL; +PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; +PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; +PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV = NULL; +PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV = NULL; +PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV = NULL; +PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV = NULL; +PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV = NULL; +PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV = NULL; +PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; +PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; +PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; +PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; +PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; +PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; +PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV = NULL; +PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV = NULL; +PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; +PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; +PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV = NULL; +PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; +PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; +PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; +PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; +PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; +PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; +PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; +PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; +PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; +PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; +PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV = NULL; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; +PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; +PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; +PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV = NULL; +PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV = NULL; +PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV = NULL; +PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV = NULL; +PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; +PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; + +PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; +PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; + +PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; +PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; + +PFNGLPOLYGONMODENVPROC __glewPolygonModeNV = NULL; + +PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; +PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; +PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; +PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; +PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; +PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; + +PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; +PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; + +PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; +PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; +PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; +PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; +PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; +PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; +PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; + +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; + +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV = NULL; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV = NULL; + +PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; +PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; +PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; +PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; +PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; +PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; +PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; +PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; +PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; +PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; + +PFNGLCOMPRESSEDTEXIMAGE3DNVPROC __glewCompressedTexImage3DNV = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC __glewCompressedTexSubImage3DNV = NULL; +PFNGLCOPYTEXSUBIMAGE3DNVPROC __glewCopyTexSubImage3DNV = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERNVPROC __glewFramebufferTextureLayerNV = NULL; +PFNGLTEXIMAGE3DNVPROC __glewTexImage3DNV = NULL; +PFNGLTEXSUBIMAGE3DNVPROC __glewTexSubImage3DNV = NULL; + +PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; + +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; + +PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; +PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; +PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; +PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; +PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; +PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; +PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; + +PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; +PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; +PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; + +PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; +PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; +PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; +PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; +PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; +PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; +PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; +PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; + +PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; +PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; + +PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; +PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; +PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; +PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; +PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; +PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; +PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; +PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; +PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; +PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; +PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; +PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; +PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; +PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; +PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; +PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; +PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; +PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; +PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; + +PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; +PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; +PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; +PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; +PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; +PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; +PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; +PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; +PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; +PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; +PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; +PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; + +PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; +PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; +PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; +PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; +PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; +PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; +PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; +PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; +PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; +PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; +PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; +PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; +PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; +PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; +PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; +PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; +PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; +PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; +PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; +PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; +PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; +PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; +PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; +PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; +PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; +PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; +PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; +PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; +PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; +PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; +PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; +PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; +PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; +PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; +PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; +PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; +PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; +PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; +PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; +PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; +PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; +PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; +PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; +PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; +PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; +PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; +PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; +PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; +PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; +PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; +PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; +PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; +PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; +PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; +PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; +PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; +PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; +PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; +PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; +PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; +PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; +PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; + +PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; +PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; +PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; +PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; + +PFNGLDEPTHRANGEARRAYFVNVPROC __glewDepthRangeArrayfvNV = NULL; +PFNGLDEPTHRANGEINDEXEDFNVPROC __glewDepthRangeIndexedfNV = NULL; +PFNGLDISABLEINVPROC __glewDisableiNV = NULL; +PFNGLENABLEINVPROC __glewEnableiNV = NULL; +PFNGLGETFLOATI_VNVPROC __glewGetFloati_vNV = NULL; +PFNGLISENABLEDINVPROC __glewIsEnablediNV = NULL; +PFNGLSCISSORARRAYVNVPROC __glewScissorArrayvNV = NULL; +PFNGLSCISSORINDEXEDNVPROC __glewScissorIndexedNV = NULL; +PFNGLSCISSORINDEXEDVNVPROC __glewScissorIndexedvNV = NULL; +PFNGLVIEWPORTARRAYVNVPROC __glewViewportArrayvNV = NULL; +PFNGLVIEWPORTINDEXEDFNVPROC __glewViewportIndexedfNV = NULL; +PFNGLVIEWPORTINDEXEDFVNVPROC __glewViewportIndexedfvNV = NULL; + +PFNGLVIEWPORTSWIZZLENVPROC __glewViewportSwizzleNV = NULL; + +PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR = NULL; + +PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC __glewFramebufferTextureMultisampleMultiviewOVR = NULL; + +PFNGLALPHAFUNCQCOMPROC __glewAlphaFuncQCOM = NULL; + +PFNGLDISABLEDRIVERCONTROLQCOMPROC __glewDisableDriverControlQCOM = NULL; +PFNGLENABLEDRIVERCONTROLQCOMPROC __glewEnableDriverControlQCOM = NULL; +PFNGLGETDRIVERCONTROLSTRINGQCOMPROC __glewGetDriverControlStringQCOM = NULL; +PFNGLGETDRIVERCONTROLSQCOMPROC __glewGetDriverControlsQCOM = NULL; + +PFNGLEXTGETBUFFERPOINTERVQCOMPROC __glewExtGetBufferPointervQCOM = NULL; +PFNGLEXTGETBUFFERSQCOMPROC __glewExtGetBuffersQCOM = NULL; +PFNGLEXTGETFRAMEBUFFERSQCOMPROC __glewExtGetFramebuffersQCOM = NULL; +PFNGLEXTGETRENDERBUFFERSQCOMPROC __glewExtGetRenderbuffersQCOM = NULL; +PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC __glewExtGetTexLevelParameterivQCOM = NULL; +PFNGLEXTGETTEXSUBIMAGEQCOMPROC __glewExtGetTexSubImageQCOM = NULL; +PFNGLEXTGETTEXTURESQCOMPROC __glewExtGetTexturesQCOM = NULL; +PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC __glewExtTexObjectStateOverrideiQCOM = NULL; + +PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC __glewExtGetProgramBinarySourceQCOM = NULL; +PFNGLEXTGETPROGRAMSQCOMPROC __glewExtGetProgramsQCOM = NULL; +PFNGLEXTGETSHADERSQCOMPROC __glewExtGetShadersQCOM = NULL; +PFNGLEXTISPROGRAMBINARYQCOMPROC __glewExtIsProgramBinaryQCOM = NULL; + +PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC __glewFramebufferFoveationConfigQCOM = NULL; +PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC __glewFramebufferFoveationParametersQCOM = NULL; + +PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC __glewFramebufferFetchBarrierQCOM = NULL; + +PFNGLENDTILINGQCOMPROC __glewEndTilingQCOM = NULL; +PFNGLSTARTTILINGQCOMPROC __glewStartTilingQCOM = NULL; + +PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL; +PFNGLCLEARCOLORXPROC __glewClearColorx = NULL; +PFNGLCLEARDEPTHXPROC __glewClearDepthx = NULL; +PFNGLCOLOR4XPROC __glewColor4x = NULL; +PFNGLDEPTHRANGEXPROC __glewDepthRangex = NULL; +PFNGLFOGXPROC __glewFogx = NULL; +PFNGLFOGXVPROC __glewFogxv = NULL; +PFNGLFRUSTUMFPROC __glewFrustumf = NULL; +PFNGLFRUSTUMXPROC __glewFrustumx = NULL; +PFNGLLIGHTMODELXPROC __glewLightModelx = NULL; +PFNGLLIGHTMODELXVPROC __glewLightModelxv = NULL; +PFNGLLIGHTXPROC __glewLightx = NULL; +PFNGLLIGHTXVPROC __glewLightxv = NULL; +PFNGLLINEWIDTHXPROC __glewLineWidthx = NULL; +PFNGLLOADMATRIXXPROC __glewLoadMatrixx = NULL; +PFNGLMATERIALXPROC __glewMaterialx = NULL; +PFNGLMATERIALXVPROC __glewMaterialxv = NULL; +PFNGLMULTMATRIXXPROC __glewMultMatrixx = NULL; +PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x = NULL; +PFNGLNORMAL3XPROC __glewNormal3x = NULL; +PFNGLORTHOFPROC __glewOrthof = NULL; +PFNGLORTHOXPROC __glewOrthox = NULL; +PFNGLPOINTSIZEXPROC __glewPointSizex = NULL; +PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx = NULL; +PFNGLROTATEXPROC __glewRotatex = NULL; +PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex = NULL; +PFNGLSCALEXPROC __glewScalex = NULL; +PFNGLTEXENVXPROC __glewTexEnvx = NULL; +PFNGLTEXENVXVPROC __glewTexEnvxv = NULL; +PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL; +PFNGLTRANSLATEXPROC __glewTranslatex = NULL; + +PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL; +PFNGLCLIPPLANEXPROC __glewClipPlanex = NULL; +PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL; +PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex = NULL; +PFNGLGETFIXEDVPROC __glewGetFixedv = NULL; +PFNGLGETLIGHTXVPROC __glewGetLightxv = NULL; +PFNGLGETMATERIALXVPROC __glewGetMaterialxv = NULL; +PFNGLGETTEXENVXVPROC __glewGetTexEnvxv = NULL; +PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv = NULL; +PFNGLPOINTPARAMETERXPROC __glewPointParameterx = NULL; +PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv = NULL; +PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES = NULL; +PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL; + +PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; + +PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; +PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; + +PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL = NULL; + +PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL = NULL; + +PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; +PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; + +PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; +PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; + +PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; +PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; + +PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC __glewInterleavedTextureCoordSetsSGIS = NULL; +PFNGLSELECTTEXTURECOORDSETSGISPROC __glewSelectTextureCoordSetSGIS = NULL; +PFNGLSELECTTEXTURESGISPROC __glewSelectTextureSGIS = NULL; +PFNGLSELECTTEXTURETRANSFORMSGISPROC __glewSelectTextureTransformSGIS = NULL; + +PFNGLMULTISAMPLESUBRECTPOSSGISPROC __glewMultisampleSubRectPosSGIS = NULL; + +PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; +PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; + +PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; +PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; + +PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; +PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; + +PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; +PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; +PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; +PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; +PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; +PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; + +PFNGLADDRESSSPACEPROC __glewAddressSpace = NULL; +PFNGLDATAPIPEPROC __glewDataPipe = NULL; + +PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; + +PFNGLFOGLAYERSSGIXPROC __glewFogLayersSGIX = NULL; +PFNGLGETFOGLAYERSSGIXPROC __glewGetFogLayersSGIX = NULL; + +PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; + +PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; +PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; +PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; +PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; +PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; +PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; +PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; +PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; +PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; + +PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; + +PFNGLIGLOOINTERFACESGIXPROC __glewIglooInterfaceSGIX = NULL; + +PFNGLALLOCMPEGPREDICTORSSGIXPROC __glewAllocMPEGPredictorsSGIX = NULL; +PFNGLDELETEMPEGPREDICTORSSGIXPROC __glewDeleteMPEGPredictorsSGIX = NULL; +PFNGLGENMPEGPREDICTORSSGIXPROC __glewGenMPEGPredictorsSGIX = NULL; +PFNGLGETMPEGPARAMETERFVSGIXPROC __glewGetMPEGParameterfvSGIX = NULL; +PFNGLGETMPEGPARAMETERIVSGIXPROC __glewGetMPEGParameterivSGIX = NULL; +PFNGLGETMPEGPREDICTORSGIXPROC __glewGetMPEGPredictorSGIX = NULL; +PFNGLGETMPEGQUANTTABLEUBVPROC __glewGetMPEGQuantTableubv = NULL; +PFNGLISMPEGPREDICTORSGIXPROC __glewIsMPEGPredictorSGIX = NULL; +PFNGLMPEGPREDICTORSGIXPROC __glewMPEGPredictorSGIX = NULL; +PFNGLMPEGQUANTTABLEUBVPROC __glewMPEGQuantTableubv = NULL; +PFNGLSWAPMPEGPREDICTORSSGIXPROC __glewSwapMPEGPredictorsSGIX = NULL; + +PFNGLGETNONLINLIGHTFVSGIXPROC __glewGetNonlinLightfvSGIX = NULL; +PFNGLGETNONLINMATERIALFVSGIXPROC __glewGetNonlinMaterialfvSGIX = NULL; +PFNGLNONLINLIGHTFVSGIXPROC __glewNonlinLightfvSGIX = NULL; +PFNGLNONLINMATERIALFVSGIXPROC __glewNonlinMaterialfvSGIX = NULL; + +PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; + +PFNGLDEFORMSGIXPROC __glewDeformSGIX = NULL; +PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC __glewLoadIdentityDeformationMapSGIX = NULL; + +PFNGLMESHBREADTHSGIXPROC __glewMeshBreadthSGIX = NULL; +PFNGLMESHSTRIDESGIXPROC __glewMeshStrideSGIX = NULL; + +PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; + +PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; +PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; +PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; +PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; + +PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; + +PFNGLGETVECTOROPERATIONSGIXPROC __glewGetVectorOperationSGIX = NULL; +PFNGLVECTOROPERATIONSGIXPROC __glewVectorOperationSGIX = NULL; + +PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC __glewAreVertexArraysResidentSGIX = NULL; +PFNGLBINDVERTEXARRAYSGIXPROC __glewBindVertexArraySGIX = NULL; +PFNGLDELETEVERTEXARRAYSSGIXPROC __glewDeleteVertexArraysSGIX = NULL; +PFNGLGENVERTEXARRAYSSGIXPROC __glewGenVertexArraysSGIX = NULL; +PFNGLISVERTEXARRAYSGIXPROC __glewIsVertexArraySGIX = NULL; +PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC __glewPrioritizeVertexArraysSGIX = NULL; + +PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; +PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; +PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; +PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; +PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC __glewGetPixelTransformParameterfvSGI = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC __glewGetPixelTransformParameterivSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERFSGIPROC __glewPixelTransformParameterfSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC __glewPixelTransformParameterfvSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERISGIPROC __glewPixelTransformParameteriSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC __glewPixelTransformParameterivSGI = NULL; +PFNGLPIXELTRANSFORMSGIPROC __glewPixelTransformSGI = NULL; + +PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; + +PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; +PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; +PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; +PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; +PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; +PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; +PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; +PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; + +PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; + +PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; +PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; +PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; +PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; +PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; +PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; +PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; + +PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; +PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; +PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; +PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; +PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; +PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; +PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; +PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; + +PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLEW_VERSION_1_5 = GL_FALSE; +GLboolean __GLEW_VERSION_2_0 = GL_FALSE; +GLboolean __GLEW_VERSION_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_0 = GL_FALSE; +GLboolean __GLEW_VERSION_3_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_2 = GL_FALSE; +GLboolean __GLEW_VERSION_3_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_0 = GL_FALSE; +GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_VERSION_4_2 = GL_FALSE; +GLboolean __GLEW_VERSION_4_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_4 = GL_FALSE; +GLboolean __GLEW_VERSION_4_5 = GL_FALSE; +GLboolean __GLEW_VERSION_4_6 = GL_FALSE; +GLboolean __GLEW_3DFX_multisample = GL_FALSE; +GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; +GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; +GLboolean __GLEW_AMD_compressed_3DC_texture = GL_FALSE; +GLboolean __GLEW_AMD_compressed_ATC_texture = GL_FALSE; +GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; +GLboolean __GLEW_AMD_debug_output = GL_FALSE; +GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; +GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_framebuffer_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_gcn_shader = GL_FALSE; +GLboolean __GLEW_AMD_gpu_shader_half_float = GL_FALSE; +GLboolean __GLEW_AMD_gpu_shader_int16 = GL_FALSE; +GLboolean __GLEW_AMD_gpu_shader_int64 = GL_FALSE; +GLboolean __GLEW_AMD_interleaved_elements = GL_FALSE; +GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; +GLboolean __GLEW_AMD_occlusion_query_event = GL_FALSE; +GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; +GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; +GLboolean __GLEW_AMD_program_binary_Z400 = GL_FALSE; +GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; +GLboolean __GLEW_AMD_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_AMD_shader_atomic_counter_ops = GL_FALSE; +GLboolean __GLEW_AMD_shader_ballot = GL_FALSE; +GLboolean __GLEW_AMD_shader_explicit_vertex_parameter = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_value_export = GL_FALSE; +GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE; +GLboolean __GLEW_AMD_sparse_texture = GL_FALSE; +GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; +GLboolean __GLEW_AMD_texture_gather_bias_lod = GL_FALSE; +GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback4 = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; +GLboolean __GLEW_ANDROID_extension_pack_es31a = GL_FALSE; +GLboolean __GLEW_ANGLE_depth_texture = GL_FALSE; +GLboolean __GLEW_ANGLE_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_ANGLE_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_ANGLE_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ANGLE_pack_reverse_row_order = GL_FALSE; +GLboolean __GLEW_ANGLE_program_binary = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt3 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt5 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_usage = GL_FALSE; +GLboolean __GLEW_ANGLE_timer_query = GL_FALSE; +GLboolean __GLEW_ANGLE_translated_shader_source = GL_FALSE; +GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; +GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_clip_distance = GL_FALSE; +GLboolean __GLEW_APPLE_color_buffer_packed_float = GL_FALSE; +GLboolean __GLEW_APPLE_copy_texture_levels = GL_FALSE; +GLboolean __GLEW_APPLE_element_array = GL_FALSE; +GLboolean __GLEW_APPLE_fence = GL_FALSE; +GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; +GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; +GLboolean __GLEW_APPLE_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; +GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; +GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; +GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_sync = GL_FALSE; +GLboolean __GLEW_APPLE_texture_2D_limited_npot = GL_FALSE; +GLboolean __GLEW_APPLE_texture_format_BGRA8888 = GL_FALSE; +GLboolean __GLEW_APPLE_texture_max_level = GL_FALSE; +GLboolean __GLEW_APPLE_texture_packed_float = GL_FALSE; +GLboolean __GLEW_APPLE_texture_range = GL_FALSE; +GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; +GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_1_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; +GLboolean __GLEW_ARB_base_instance = GL_FALSE; +GLboolean __GLEW_ARB_bindless_texture = GL_FALSE; +GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; +GLboolean __GLEW_ARB_buffer_storage = GL_FALSE; +GLboolean __GLEW_ARB_cl_event = GL_FALSE; +GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_clear_texture = GL_FALSE; +GLboolean __GLEW_ARB_clip_control = GL_FALSE; +GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; +GLboolean __GLEW_ARB_compute_shader = GL_FALSE; +GLboolean __GLEW_ARB_compute_variable_group_size = GL_FALSE; +GLboolean __GLEW_ARB_conditional_render_inverted = GL_FALSE; +GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; +GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; +GLboolean __GLEW_ARB_copy_image = GL_FALSE; +GLboolean __GLEW_ARB_cull_distance = GL_FALSE; +GLboolean __GLEW_ARB_debug_output = GL_FALSE; +GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; +GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_derivative_control = GL_FALSE; +GLboolean __GLEW_ARB_direct_state_access = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; +GLboolean __GLEW_ARB_enhanced_layouts = GL_FALSE; +GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; +GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; +GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader_interlock = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; +GLboolean __GLEW_ARB_get_texture_sub_image = GL_FALSE; +GLboolean __GLEW_ARB_gl_spirv = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_int64 = GL_FALSE; +GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; +GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_indirect_parameters = GL_FALSE; +GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; +GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multi_bind = GL_FALSE; +GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_multisample = GL_FALSE; +GLboolean __GLEW_ARB_multitexture = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; +GLboolean __GLEW_ARB_parallel_shader_compile = GL_FALSE; +GLboolean __GLEW_ARB_pipeline_statistics_query = GL_FALSE; +GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_point_parameters = GL_FALSE; +GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_polygon_offset_clamp = GL_FALSE; +GLboolean __GLEW_ARB_post_depth_coverage = GL_FALSE; +GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; +GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; +GLboolean __GLEW_ARB_query_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_ARB_robustness = GL_FALSE; +GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLEW_ARB_sample_locations = GL_FALSE; +GLboolean __GLEW_ARB_sample_shading = GL_FALSE; +GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counter_ops = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_ARB_shader_ballot = GL_FALSE; +GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_clock = GL_FALSE; +GLboolean __GLEW_ARB_shader_draw_parameters = GL_FALSE; +GLboolean __GLEW_ARB_shader_group_vote = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; +GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_precision = GL_FALSE; +GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_image_samples = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ARB_shader_viewport_layer_array = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; +GLboolean __GLEW_ARB_shadow = GL_FALSE; +GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_sparse_buffer = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture2 = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture_clamp = GL_FALSE; +GLboolean __GLEW_ARB_spirv_extensions = GL_FALSE; +GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; +GLboolean __GLEW_ARB_sync = GL_FALSE; +GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; +GLboolean __GLEW_ARB_texture_barrier = GL_FALSE; +GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_ARB_texture_filter_minmax = GL_FALSE; +GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_gather = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; +GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_texture_rg = GL_FALSE; +GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_stencil8 = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; +GLboolean __GLEW_ARB_texture_view = GL_FALSE; +GLboolean __GLEW_ARB_timer_query = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_overflow_query = GL_FALSE; +GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; +GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; +GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_program = GL_FALSE; +GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; +GLboolean __GLEW_ARB_viewport_array = GL_FALSE; +GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ARM_mali_program_binary = GL_FALSE; +GLboolean __GLEW_ARM_mali_shader_binary = GL_FALSE; +GLboolean __GLEW_ARM_rgba8 = GL_FALSE; +GLboolean __GLEW_ARM_shader_framebuffer_fetch = GL_FALSE; +GLboolean __GLEW_ARM_shader_framebuffer_fetch_depth_stencil = GL_FALSE; +GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; +GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; +GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; +GLboolean __GLEW_ATI_element_array = GL_FALSE; +GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; +GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_meminfo = GL_FALSE; +GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; +GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; +GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; +GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATI_texture_float = GL_FALSE; +GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; +GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EGL_KHR_context_flush_control = GL_FALSE; +GLboolean __GLEW_EGL_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __GLEW_EXT_422_pixels = GL_FALSE; +GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_EGL_image_array = GL_FALSE; +GLboolean __GLEW_EXT_YUV_target = GL_FALSE; +GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_base_instance = GL_FALSE; +GLboolean __GLEW_EXT_bgra = GL_FALSE; +GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; +GLboolean __GLEW_EXT_blend_color = GL_FALSE; +GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_extended = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; +GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; +GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_buffer_storage = GL_FALSE; +GLboolean __GLEW_EXT_clear_texture = GL_FALSE; +GLboolean __GLEW_EXT_clip_cull_distance = GL_FALSE; +GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; +GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_buffer_float = GL_FALSE; +GLboolean __GLEW_EXT_color_buffer_half_float = GL_FALSE; +GLboolean __GLEW_EXT_color_subtable = GL_FALSE; +GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_compressed_ETC1_RGB8_sub_texture = GL_FALSE; +GLboolean __GLEW_EXT_conservative_depth = GL_FALSE; +GLboolean __GLEW_EXT_convolution = GL_FALSE; +GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_image = GL_FALSE; +GLboolean __GLEW_EXT_copy_texture = GL_FALSE; +GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_debug_label = GL_FALSE; +GLboolean __GLEW_EXT_debug_marker = GL_FALSE; +GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; +GLboolean __GLEW_EXT_discard_framebuffer = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers_indexed = GL_FALSE; +GLboolean __GLEW_EXT_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; +GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_external_buffer = GL_FALSE; +GLboolean __GLEW_EXT_float_blend = GL_FALSE; +GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_frag_depth = GL_FALSE; +GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_geometry_point_size = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_EXT_histogram = GL_FALSE; +GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; +GLboolean __GLEW_EXT_index_func = GL_FALSE; +GLboolean __GLEW_EXT_index_material = GL_FALSE; +GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_instanced_arrays = GL_FALSE; +GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_map_buffer_range = GL_FALSE; +GLboolean __GLEW_EXT_memory_object = GL_FALSE; +GLboolean __GLEW_EXT_memory_object_fd = GL_FALSE; +GLboolean __GLEW_EXT_memory_object_win32 = GL_FALSE; +GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_EXT_multiple_textures = GL_FALSE; +GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_multisample_compatibility = GL_FALSE; +GLboolean __GLEW_EXT_multisampled_render_to_texture = GL_FALSE; +GLboolean __GLEW_EXT_multisampled_render_to_texture2 = GL_FALSE; +GLboolean __GLEW_EXT_multiview_draw_buffers = GL_FALSE; +GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_EXT_packed_float = GL_FALSE; +GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; +GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; +GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean __GLEW_EXT_point_parameters = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset_clamp = GL_FALSE; +GLboolean __GLEW_EXT_post_depth_coverage = GL_FALSE; +GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; +GLboolean __GLEW_EXT_pvrtc_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_raster_multisample = GL_FALSE; +GLboolean __GLEW_EXT_read_format_bgra = GL_FALSE; +GLboolean __GLEW_EXT_render_snorm = GL_FALSE; +GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_sRGB_write_control = GL_FALSE; +GLboolean __GLEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_semaphore = GL_FALSE; +GLboolean __GLEW_EXT_semaphore_fd = GL_FALSE; +GLboolean __GLEW_EXT_semaphore_win32 = GL_FALSE; +GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shader_framebuffer_fetch = GL_FALSE; +GLboolean __GLEW_EXT_shader_group_vote = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_formatted = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_EXT_shader_implicit_conversions = GL_FALSE; +GLboolean __GLEW_EXT_shader_integer_mix = GL_FALSE; +GLboolean __GLEW_EXT_shader_io_blocks = GL_FALSE; +GLboolean __GLEW_EXT_shader_non_constant_global_initializers = GL_FALSE; +GLboolean __GLEW_EXT_shader_pixel_local_storage = GL_FALSE; +GLboolean __GLEW_EXT_shader_pixel_local_storage2 = GL_FALSE; +GLboolean __GLEW_EXT_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shadow_samplers = GL_FALSE; +GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_sparse_texture = GL_FALSE; +GLboolean __GLEW_EXT_sparse_texture2 = GL_FALSE; +GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; +GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; +GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; +GLboolean __GLEW_EXT_subtexture = GL_FALSE; +GLboolean __GLEW_EXT_texture = GL_FALSE; +GLboolean __GLEW_EXT_texture3D = GL_FALSE; +GLboolean __GLEW_EXT_texture_array = GL_FALSE; +GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_astc_decode_mode = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map_array = GL_FALSE; +GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_env = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_minmax = GL_FALSE; +GLboolean __GLEW_EXT_texture_format_BGRA8888 = GL_FALSE; +GLboolean __GLEW_EXT_texture_integer = GL_FALSE; +GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_norm16 = GL_FALSE; +GLboolean __GLEW_EXT_texture_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; +GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_rg = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_R8 = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_RG8 = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; +GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; +GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; +GLboolean __GLEW_EXT_texture_storage = GL_FALSE; +GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; +GLboolean __GLEW_EXT_texture_type_2_10_10_10_REV = GL_FALSE; +GLboolean __GLEW_EXT_texture_view = GL_FALSE; +GLboolean __GLEW_EXT_timer_query = GL_FALSE; +GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; +GLboolean __GLEW_EXT_unpack_subimage = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_setXXX = GL_FALSE; +GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; +GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_EXT_win32_keyed_mutex = GL_FALSE; +GLboolean __GLEW_EXT_window_rectangles = GL_FALSE; +GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; +GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; +GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; +GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_HP_image_transform = GL_FALSE; +GLboolean __GLEW_HP_occlusion_test = GL_FALSE; +GLboolean __GLEW_HP_texture_lighting = GL_FALSE; +GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; +GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; +GLboolean __GLEW_IBM_static_data = GL_FALSE; +GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; +GLboolean __GLEW_INGR_color_clamp = GL_FALSE; +GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_conservative_rasterization = GL_FALSE; +GLboolean __GLEW_INTEL_fragment_shader_ordering = GL_FALSE; +GLboolean __GLEW_INTEL_framebuffer_CMAA = GL_FALSE; +GLboolean __GLEW_INTEL_map_texture = GL_FALSE; +GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_performance_query = GL_FALSE; +GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KHR_blend_equation_advanced = GL_FALSE; +GLboolean __GLEW_KHR_blend_equation_advanced_coherent = GL_FALSE; +GLboolean __GLEW_KHR_context_flush_control = GL_FALSE; +GLboolean __GLEW_KHR_debug = GL_FALSE; +GLboolean __GLEW_KHR_no_error = GL_FALSE; +GLboolean __GLEW_KHR_parallel_shader_compile = GL_FALSE; +GLboolean __GLEW_KHR_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_KHR_robustness = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_hdr = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_sliced_3d = GL_FALSE; +GLboolean __GLEW_KTX_buffer_region = GL_FALSE; +GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; +GLboolean __GLEW_MESA_pack_invert = GL_FALSE; +GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_shader_integer_functions = GL_FALSE; +GLboolean __GLEW_MESA_window_pos = GL_FALSE; +GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NVX_blend_equation_advanced_multi_draw_buffers = GL_FALSE; +GLboolean __GLEW_NVX_conditional_render = GL_FALSE; +GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; +GLboolean __GLEW_NVX_linked_gpu_multicast = GL_FALSE; +GLboolean __GLEW_NV_3dvision_settings = GL_FALSE; +GLboolean __GLEW_NV_EGL_stream_consumer_external = GL_FALSE; +GLboolean __GLEW_NV_alpha_to_coverage_dither_control = GL_FALSE; +GLboolean __GLEW_NV_bgr = GL_FALSE; +GLboolean __GLEW_NV_bindless_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_NV_bindless_multi_draw_indirect_count = GL_FALSE; +GLboolean __GLEW_NV_bindless_texture = GL_FALSE; +GLboolean __GLEW_NV_blend_equation_advanced = GL_FALSE; +GLboolean __GLEW_NV_blend_equation_advanced_coherent = GL_FALSE; +GLboolean __GLEW_NV_blend_minmax_factor = GL_FALSE; +GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_clip_space_w_scaling = GL_FALSE; +GLboolean __GLEW_NV_command_list = GL_FALSE; +GLboolean __GLEW_NV_compute_program5 = GL_FALSE; +GLboolean __GLEW_NV_conditional_render = GL_FALSE; +GLboolean __GLEW_NV_conservative_raster = GL_FALSE; +GLboolean __GLEW_NV_conservative_raster_dilate = GL_FALSE; +GLboolean __GLEW_NV_conservative_raster_pre_snap_triangles = GL_FALSE; +GLboolean __GLEW_NV_copy_buffer = GL_FALSE; +GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_copy_image = GL_FALSE; +GLboolean __GLEW_NV_deep_texture3D = GL_FALSE; +GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_NV_depth_clamp = GL_FALSE; +GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; +GLboolean __GLEW_NV_draw_buffers = GL_FALSE; +GLboolean __GLEW_NV_draw_instanced = GL_FALSE; +GLboolean __GLEW_NV_draw_texture = GL_FALSE; +GLboolean __GLEW_NV_draw_vulkan_image = GL_FALSE; +GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; +GLboolean __GLEW_NV_fbo_color_attachments = GL_FALSE; +GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_fill_rectangle = GL_FALSE; +GLboolean __GLEW_NV_float_buffer = GL_FALSE; +GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_coverage_to_color = GL_FALSE; +GLboolean __GLEW_NV_fragment_program = GL_FALSE; +GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_fragment_shader_interlock = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_mixed_samples = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_generate_mipmap_sRGB = GL_FALSE; +GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader_passthrough = GL_FALSE; +GLboolean __GLEW_NV_gpu_multicast = GL_FALSE; +GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5_mem_extended = GL_FALSE; +GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; +GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_image_formats = GL_FALSE; +GLboolean __GLEW_NV_instanced_arrays = GL_FALSE; +GLboolean __GLEW_NV_internalformat_sample_query = GL_FALSE; +GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_non_square_matrices = GL_FALSE; +GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_pack_subimage = GL_FALSE; +GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_packed_float = GL_FALSE; +GLboolean __GLEW_NV_packed_float_linear = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_path_rendering = GL_FALSE; +GLboolean __GLEW_NV_path_rendering_shared_edge = GL_FALSE; +GLboolean __GLEW_NV_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_platform_binary = GL_FALSE; +GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_polygon_mode = GL_FALSE; +GLboolean __GLEW_NV_present_video = GL_FALSE; +GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_read_depth = GL_FALSE; +GLboolean __GLEW_NV_read_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_read_stencil = GL_FALSE; +GLboolean __GLEW_NV_register_combiners = GL_FALSE; +GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __GLEW_NV_sRGB_formats = GL_FALSE; +GLboolean __GLEW_NV_sample_locations = GL_FALSE; +GLboolean __GLEW_NV_sample_mask_override_coverage = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float64 = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_fp16_vector = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_int64 = GL_FALSE; +GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; +GLboolean __GLEW_NV_shader_noperspective_interpolation = GL_FALSE; +GLboolean __GLEW_NV_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_shader_thread_group = GL_FALSE; +GLboolean __GLEW_NV_shader_thread_shuffle = GL_FALSE; +GLboolean __GLEW_NV_shadow_samplers_array = GL_FALSE; +GLboolean __GLEW_NV_shadow_samplers_cube = GL_FALSE; +GLboolean __GLEW_NV_stereo_view_rendering = GL_FALSE; +GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; +GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; +GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_array = GL_FALSE; +GLboolean __GLEW_NV_texture_barrier = GL_FALSE; +GLboolean __GLEW_NV_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_s3tc_update = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; +GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; +GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_multisample = GL_FALSE; +GLboolean __GLEW_NV_texture_npot_2D_mipmap = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle_compressed = GL_FALSE; +GLboolean __GLEW_NV_texture_shader = GL_FALSE; +GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; +GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_NV_uniform_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; +GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vertex_program = GL_FALSE; +GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; +GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; +GLboolean __GLEW_NV_video_capture = GL_FALSE; +GLboolean __GLEW_NV_viewport_array = GL_FALSE; +GLboolean __GLEW_NV_viewport_array2 = GL_FALSE; +GLboolean __GLEW_NV_viewport_swizzle = GL_FALSE; +GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; +GLboolean __GLEW_OML_interlace = GL_FALSE; +GLboolean __GLEW_OML_resample = GL_FALSE; +GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_OVR_multiview = GL_FALSE; +GLboolean __GLEW_OVR_multiview2 = GL_FALSE; +GLboolean __GLEW_OVR_multiview_multisampled_render_to_texture = GL_FALSE; +GLboolean __GLEW_PGI_misc_hints = GL_FALSE; +GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_QCOM_alpha_test = GL_FALSE; +GLboolean __GLEW_QCOM_binning_control = GL_FALSE; +GLboolean __GLEW_QCOM_driver_control = GL_FALSE; +GLboolean __GLEW_QCOM_extended_get = GL_FALSE; +GLboolean __GLEW_QCOM_extended_get2 = GL_FALSE; +GLboolean __GLEW_QCOM_framebuffer_foveated = GL_FALSE; +GLboolean __GLEW_QCOM_perfmon_global_mode = GL_FALSE; +GLboolean __GLEW_QCOM_shader_framebuffer_fetch_noncoherent = GL_FALSE; +GLboolean __GLEW_QCOM_tiled_rendering = GL_FALSE; +GLboolean __GLEW_QCOM_writeonly_rendering = GL_FALSE; +GLboolean __GLEW_REGAL_ES1_0_compatibility = GL_FALSE; +GLboolean __GLEW_REGAL_ES1_1_compatibility = GL_FALSE; +GLboolean __GLEW_REGAL_enable = GL_FALSE; +GLboolean __GLEW_REGAL_error_string = GL_FALSE; +GLboolean __GLEW_REGAL_extension_query = GL_FALSE; +GLboolean __GLEW_REGAL_log = GL_FALSE; +GLboolean __GLEW_REGAL_proc_address = GL_FALSE; +GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; +GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_clip_band_hint = GL_FALSE; +GLboolean __GLEW_SGIS_color_range = GL_FALSE; +GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; +GLboolean __GLEW_SGIS_fog_function = GL_FALSE; +GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_multitexture = GL_FALSE; +GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; +GLboolean __GLEW_SGIS_texture4D = GL_FALSE; +GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; +GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIS_texture_select = GL_FALSE; +GLboolean __GLEW_SGIX_async = GL_FALSE; +GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; +GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_bali_g_instruments = GL_FALSE; +GLboolean __GLEW_SGIX_bali_r_instruments = GL_FALSE; +GLboolean __GLEW_SGIX_bali_timer_instruments = GL_FALSE; +GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_blend_cadd = GL_FALSE; +GLboolean __GLEW_SGIX_blend_cmultiply = GL_FALSE; +GLboolean __GLEW_SGIX_calligraphic_fragment = GL_FALSE; +GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_color_matrix_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_color_table_index_mode = GL_FALSE; +GLboolean __GLEW_SGIX_complex_polar = GL_FALSE; +GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_cube_map = GL_FALSE; +GLboolean __GLEW_SGIX_cylinder_texgen = GL_FALSE; +GLboolean __GLEW_SGIX_datapipe = GL_FALSE; +GLboolean __GLEW_SGIX_decimation = GL_FALSE; +GLboolean __GLEW_SGIX_depth_pass_instrument = GL_FALSE; +GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_dvc = GL_FALSE; +GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_blend = GL_FALSE; +GLboolean __GLEW_SGIX_fog_factor_to_alpha = GL_FALSE; +GLboolean __GLEW_SGIX_fog_layers = GL_FALSE; +GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_patchy = GL_FALSE; +GLboolean __GLEW_SGIX_fog_scale = GL_FALSE; +GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_lighting_space = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_fragments_instrument = GL_FALSE; +GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_icc_texture = GL_FALSE; +GLboolean __GLEW_SGIX_igloo_interface = GL_FALSE; +GLboolean __GLEW_SGIX_image_compression = GL_FALSE; +GLboolean __GLEW_SGIX_impact_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_instrument_error = GL_FALSE; +GLboolean __GLEW_SGIX_interlace = GL_FALSE; +GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_line_quality_hint = GL_FALSE; +GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_mpeg1 = GL_FALSE; +GLboolean __GLEW_SGIX_mpeg2 = GL_FALSE; +GLboolean __GLEW_SGIX_nonlinear_lighting_pervertex = GL_FALSE; +GLboolean __GLEW_SGIX_nurbs_eval = GL_FALSE; +GLboolean __GLEW_SGIX_occlusion_instrument = GL_FALSE; +GLboolean __GLEW_SGIX_packed_6bytes = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_tiles = GL_FALSE; +GLboolean __GLEW_SGIX_polynomial_ffd = GL_FALSE; +GLboolean __GLEW_SGIX_quad_mesh = GL_FALSE; +GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; +GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_scalebias_hint = GL_FALSE; +GLboolean __GLEW_SGIX_shadow = GL_FALSE; +GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_slim = GL_FALSE; +GLboolean __GLEW_SGIX_spotlight_cutoff = GL_FALSE; +GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_subdiv_patch = GL_FALSE; +GLboolean __GLEW_SGIX_subsample = GL_FALSE; +GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; +GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_mipmap_anisotropic = GL_FALSE; +GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_phase = GL_FALSE; +GLboolean __GLEW_SGIX_texture_range = GL_FALSE; +GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_supersample = GL_FALSE; +GLboolean __GLEW_SGIX_vector_ops = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_array_object = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb_subsample = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcba = GL_FALSE; +GLboolean __GLEW_SGI_color_matrix = GL_FALSE; +GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_complex = GL_FALSE; +GLboolean __GLEW_SGI_complex_type = GL_FALSE; +GLboolean __GLEW_SGI_fft = GL_FALSE; +GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; +GLboolean __GLEW_SUNX_constant_data = GL_FALSE; +GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_SUN_global_alpha = GL_FALSE; +GLboolean __GLEW_SUN_mesh_array = GL_FALSE; +GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; +GLboolean __GLEW_SUN_slice_accum = GL_FALSE; +GLboolean __GLEW_SUN_triangle_list = GL_FALSE; +GLboolean __GLEW_SUN_vertex = GL_FALSE; +GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_scene_markerXXX = GL_FALSE; +GLboolean __GLEW_WIN_specular_fog = GL_FALSE; +GLboolean __GLEW_WIN_swap_hint = GL_FALSE; + +static const char * _glewExtensionLookup[] = { +#ifdef GL_VERSION_1_2 + "GL_VERSION_1_2", +#endif +#ifdef GL_VERSION_1_2_1 + "GL_VERSION_1_2_1", +#endif +#ifdef GL_VERSION_1_3 + "GL_VERSION_1_3", +#endif +#ifdef GL_VERSION_1_4 + "GL_VERSION_1_4", +#endif +#ifdef GL_VERSION_1_5 + "GL_VERSION_1_5", +#endif +#ifdef GL_VERSION_2_0 + "GL_VERSION_2_0", +#endif +#ifdef GL_VERSION_2_1 + "GL_VERSION_2_1", +#endif +#ifdef GL_VERSION_3_0 + "GL_VERSION_3_0", +#endif +#ifdef GL_VERSION_3_1 + "GL_VERSION_3_1", +#endif +#ifdef GL_VERSION_3_2 + "GL_VERSION_3_2", +#endif +#ifdef GL_VERSION_3_3 + "GL_VERSION_3_3", +#endif +#ifdef GL_VERSION_4_0 + "GL_VERSION_4_0", +#endif +#ifdef GL_VERSION_4_1 + "GL_VERSION_4_1", +#endif +#ifdef GL_VERSION_4_2 + "GL_VERSION_4_2", +#endif +#ifdef GL_VERSION_4_3 + "GL_VERSION_4_3", +#endif +#ifdef GL_VERSION_4_4 + "GL_VERSION_4_4", +#endif +#ifdef GL_VERSION_4_5 + "GL_VERSION_4_5", +#endif +#ifdef GL_VERSION_4_6 + "GL_VERSION_4_6", +#endif +#ifdef GL_3DFX_multisample + "GL_3DFX_multisample", +#endif +#ifdef GL_3DFX_tbuffer + "GL_3DFX_tbuffer", +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + "GL_3DFX_texture_compression_FXT1", +#endif +#ifdef GL_AMD_blend_minmax_factor + "GL_AMD_blend_minmax_factor", +#endif +#ifdef GL_AMD_compressed_3DC_texture + "GL_AMD_compressed_3DC_texture", +#endif +#ifdef GL_AMD_compressed_ATC_texture + "GL_AMD_compressed_ATC_texture", +#endif +#ifdef GL_AMD_conservative_depth + "GL_AMD_conservative_depth", +#endif +#ifdef GL_AMD_debug_output + "GL_AMD_debug_output", +#endif +#ifdef GL_AMD_depth_clamp_separate + "GL_AMD_depth_clamp_separate", +#endif +#ifdef GL_AMD_draw_buffers_blend + "GL_AMD_draw_buffers_blend", +#endif +#ifdef GL_AMD_framebuffer_sample_positions + "GL_AMD_framebuffer_sample_positions", +#endif +#ifdef GL_AMD_gcn_shader + "GL_AMD_gcn_shader", +#endif +#ifdef GL_AMD_gpu_shader_half_float + "GL_AMD_gpu_shader_half_float", +#endif +#ifdef GL_AMD_gpu_shader_int16 + "GL_AMD_gpu_shader_int16", +#endif +#ifdef GL_AMD_gpu_shader_int64 + "GL_AMD_gpu_shader_int64", +#endif +#ifdef GL_AMD_interleaved_elements + "GL_AMD_interleaved_elements", +#endif +#ifdef GL_AMD_multi_draw_indirect + "GL_AMD_multi_draw_indirect", +#endif +#ifdef GL_AMD_name_gen_delete + "GL_AMD_name_gen_delete", +#endif +#ifdef GL_AMD_occlusion_query_event + "GL_AMD_occlusion_query_event", +#endif +#ifdef GL_AMD_performance_monitor + "GL_AMD_performance_monitor", +#endif +#ifdef GL_AMD_pinned_memory + "GL_AMD_pinned_memory", +#endif +#ifdef GL_AMD_program_binary_Z400 + "GL_AMD_program_binary_Z400", +#endif +#ifdef GL_AMD_query_buffer_object + "GL_AMD_query_buffer_object", +#endif +#ifdef GL_AMD_sample_positions + "GL_AMD_sample_positions", +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + "GL_AMD_seamless_cubemap_per_texture", +#endif +#ifdef GL_AMD_shader_atomic_counter_ops + "GL_AMD_shader_atomic_counter_ops", +#endif +#ifdef GL_AMD_shader_ballot + "GL_AMD_shader_ballot", +#endif +#ifdef GL_AMD_shader_explicit_vertex_parameter + "GL_AMD_shader_explicit_vertex_parameter", +#endif +#ifdef GL_AMD_shader_stencil_export + "GL_AMD_shader_stencil_export", +#endif +#ifdef GL_AMD_shader_stencil_value_export + "GL_AMD_shader_stencil_value_export", +#endif +#ifdef GL_AMD_shader_trinary_minmax + "GL_AMD_shader_trinary_minmax", +#endif +#ifdef GL_AMD_sparse_texture + "GL_AMD_sparse_texture", +#endif +#ifdef GL_AMD_stencil_operation_extended + "GL_AMD_stencil_operation_extended", +#endif +#ifdef GL_AMD_texture_gather_bias_lod + "GL_AMD_texture_gather_bias_lod", +#endif +#ifdef GL_AMD_texture_texture4 + "GL_AMD_texture_texture4", +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + "GL_AMD_transform_feedback3_lines_triangles", +#endif +#ifdef GL_AMD_transform_feedback4 + "GL_AMD_transform_feedback4", +#endif +#ifdef GL_AMD_vertex_shader_layer + "GL_AMD_vertex_shader_layer", +#endif +#ifdef GL_AMD_vertex_shader_tessellator + "GL_AMD_vertex_shader_tessellator", +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + "GL_AMD_vertex_shader_viewport_index", +#endif +#ifdef GL_ANDROID_extension_pack_es31a + "GL_ANDROID_extension_pack_es31a", +#endif +#ifdef GL_ANGLE_depth_texture + "GL_ANGLE_depth_texture", +#endif +#ifdef GL_ANGLE_framebuffer_blit + "GL_ANGLE_framebuffer_blit", +#endif +#ifdef GL_ANGLE_framebuffer_multisample + "GL_ANGLE_framebuffer_multisample", +#endif +#ifdef GL_ANGLE_instanced_arrays + "GL_ANGLE_instanced_arrays", +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + "GL_ANGLE_pack_reverse_row_order", +#endif +#ifdef GL_ANGLE_program_binary + "GL_ANGLE_program_binary", +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + "GL_ANGLE_texture_compression_dxt1", +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + "GL_ANGLE_texture_compression_dxt3", +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + "GL_ANGLE_texture_compression_dxt5", +#endif +#ifdef GL_ANGLE_texture_usage + "GL_ANGLE_texture_usage", +#endif +#ifdef GL_ANGLE_timer_query + "GL_ANGLE_timer_query", +#endif +#ifdef GL_ANGLE_translated_shader_source + "GL_ANGLE_translated_shader_source", +#endif +#ifdef GL_APPLE_aux_depth_stencil + "GL_APPLE_aux_depth_stencil", +#endif +#ifdef GL_APPLE_client_storage + "GL_APPLE_client_storage", +#endif +#ifdef GL_APPLE_clip_distance + "GL_APPLE_clip_distance", +#endif +#ifdef GL_APPLE_color_buffer_packed_float + "GL_APPLE_color_buffer_packed_float", +#endif +#ifdef GL_APPLE_copy_texture_levels + "GL_APPLE_copy_texture_levels", +#endif +#ifdef GL_APPLE_element_array + "GL_APPLE_element_array", +#endif +#ifdef GL_APPLE_fence + "GL_APPLE_fence", +#endif +#ifdef GL_APPLE_float_pixels + "GL_APPLE_float_pixels", +#endif +#ifdef GL_APPLE_flush_buffer_range + "GL_APPLE_flush_buffer_range", +#endif +#ifdef GL_APPLE_framebuffer_multisample + "GL_APPLE_framebuffer_multisample", +#endif +#ifdef GL_APPLE_object_purgeable + "GL_APPLE_object_purgeable", +#endif +#ifdef GL_APPLE_pixel_buffer + "GL_APPLE_pixel_buffer", +#endif +#ifdef GL_APPLE_rgb_422 + "GL_APPLE_rgb_422", +#endif +#ifdef GL_APPLE_row_bytes + "GL_APPLE_row_bytes", +#endif +#ifdef GL_APPLE_specular_vector + "GL_APPLE_specular_vector", +#endif +#ifdef GL_APPLE_sync + "GL_APPLE_sync", +#endif +#ifdef GL_APPLE_texture_2D_limited_npot + "GL_APPLE_texture_2D_limited_npot", +#endif +#ifdef GL_APPLE_texture_format_BGRA8888 + "GL_APPLE_texture_format_BGRA8888", +#endif +#ifdef GL_APPLE_texture_max_level + "GL_APPLE_texture_max_level", +#endif +#ifdef GL_APPLE_texture_packed_float + "GL_APPLE_texture_packed_float", +#endif +#ifdef GL_APPLE_texture_range + "GL_APPLE_texture_range", +#endif +#ifdef GL_APPLE_transform_hint + "GL_APPLE_transform_hint", +#endif +#ifdef GL_APPLE_vertex_array_object + "GL_APPLE_vertex_array_object", +#endif +#ifdef GL_APPLE_vertex_array_range + "GL_APPLE_vertex_array_range", +#endif +#ifdef GL_APPLE_vertex_program_evaluators + "GL_APPLE_vertex_program_evaluators", +#endif +#ifdef GL_APPLE_ycbcr_422 + "GL_APPLE_ycbcr_422", +#endif +#ifdef GL_ARB_ES2_compatibility + "GL_ARB_ES2_compatibility", +#endif +#ifdef GL_ARB_ES3_1_compatibility + "GL_ARB_ES3_1_compatibility", +#endif +#ifdef GL_ARB_ES3_2_compatibility + "GL_ARB_ES3_2_compatibility", +#endif +#ifdef GL_ARB_ES3_compatibility + "GL_ARB_ES3_compatibility", +#endif +#ifdef GL_ARB_arrays_of_arrays + "GL_ARB_arrays_of_arrays", +#endif +#ifdef GL_ARB_base_instance + "GL_ARB_base_instance", +#endif +#ifdef GL_ARB_bindless_texture + "GL_ARB_bindless_texture", +#endif +#ifdef GL_ARB_blend_func_extended + "GL_ARB_blend_func_extended", +#endif +#ifdef GL_ARB_buffer_storage + "GL_ARB_buffer_storage", +#endif +#ifdef GL_ARB_cl_event + "GL_ARB_cl_event", +#endif +#ifdef GL_ARB_clear_buffer_object + "GL_ARB_clear_buffer_object", +#endif +#ifdef GL_ARB_clear_texture + "GL_ARB_clear_texture", +#endif +#ifdef GL_ARB_clip_control + "GL_ARB_clip_control", +#endif +#ifdef GL_ARB_color_buffer_float + "GL_ARB_color_buffer_float", +#endif +#ifdef GL_ARB_compatibility + "GL_ARB_compatibility", +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + "GL_ARB_compressed_texture_pixel_storage", +#endif +#ifdef GL_ARB_compute_shader + "GL_ARB_compute_shader", +#endif +#ifdef GL_ARB_compute_variable_group_size + "GL_ARB_compute_variable_group_size", +#endif +#ifdef GL_ARB_conditional_render_inverted + "GL_ARB_conditional_render_inverted", +#endif +#ifdef GL_ARB_conservative_depth + "GL_ARB_conservative_depth", +#endif +#ifdef GL_ARB_copy_buffer + "GL_ARB_copy_buffer", +#endif +#ifdef GL_ARB_copy_image + "GL_ARB_copy_image", +#endif +#ifdef GL_ARB_cull_distance + "GL_ARB_cull_distance", +#endif +#ifdef GL_ARB_debug_output + "GL_ARB_debug_output", +#endif +#ifdef GL_ARB_depth_buffer_float + "GL_ARB_depth_buffer_float", +#endif +#ifdef GL_ARB_depth_clamp + "GL_ARB_depth_clamp", +#endif +#ifdef GL_ARB_depth_texture + "GL_ARB_depth_texture", +#endif +#ifdef GL_ARB_derivative_control + "GL_ARB_derivative_control", +#endif +#ifdef GL_ARB_direct_state_access + "GL_ARB_direct_state_access", +#endif +#ifdef GL_ARB_draw_buffers + "GL_ARB_draw_buffers", +#endif +#ifdef GL_ARB_draw_buffers_blend + "GL_ARB_draw_buffers_blend", +#endif +#ifdef GL_ARB_draw_elements_base_vertex + "GL_ARB_draw_elements_base_vertex", +#endif +#ifdef GL_ARB_draw_indirect + "GL_ARB_draw_indirect", +#endif +#ifdef GL_ARB_draw_instanced + "GL_ARB_draw_instanced", +#endif +#ifdef GL_ARB_enhanced_layouts + "GL_ARB_enhanced_layouts", +#endif +#ifdef GL_ARB_explicit_attrib_location + "GL_ARB_explicit_attrib_location", +#endif +#ifdef GL_ARB_explicit_uniform_location + "GL_ARB_explicit_uniform_location", +#endif +#ifdef GL_ARB_fragment_coord_conventions + "GL_ARB_fragment_coord_conventions", +#endif +#ifdef GL_ARB_fragment_layer_viewport + "GL_ARB_fragment_layer_viewport", +#endif +#ifdef GL_ARB_fragment_program + "GL_ARB_fragment_program", +#endif +#ifdef GL_ARB_fragment_program_shadow + "GL_ARB_fragment_program_shadow", +#endif +#ifdef GL_ARB_fragment_shader + "GL_ARB_fragment_shader", +#endif +#ifdef GL_ARB_fragment_shader_interlock + "GL_ARB_fragment_shader_interlock", +#endif +#ifdef GL_ARB_framebuffer_no_attachments + "GL_ARB_framebuffer_no_attachments", +#endif +#ifdef GL_ARB_framebuffer_object + "GL_ARB_framebuffer_object", +#endif +#ifdef GL_ARB_framebuffer_sRGB + "GL_ARB_framebuffer_sRGB", +#endif +#ifdef GL_ARB_geometry_shader4 + "GL_ARB_geometry_shader4", +#endif +#ifdef GL_ARB_get_program_binary + "GL_ARB_get_program_binary", +#endif +#ifdef GL_ARB_get_texture_sub_image + "GL_ARB_get_texture_sub_image", +#endif +#ifdef GL_ARB_gl_spirv + "GL_ARB_gl_spirv", +#endif +#ifdef GL_ARB_gpu_shader5 + "GL_ARB_gpu_shader5", +#endif +#ifdef GL_ARB_gpu_shader_fp64 + "GL_ARB_gpu_shader_fp64", +#endif +#ifdef GL_ARB_gpu_shader_int64 + "GL_ARB_gpu_shader_int64", +#endif +#ifdef GL_ARB_half_float_pixel + "GL_ARB_half_float_pixel", +#endif +#ifdef GL_ARB_half_float_vertex + "GL_ARB_half_float_vertex", +#endif +#ifdef GL_ARB_imaging + "GL_ARB_imaging", +#endif +#ifdef GL_ARB_indirect_parameters + "GL_ARB_indirect_parameters", +#endif +#ifdef GL_ARB_instanced_arrays + "GL_ARB_instanced_arrays", +#endif +#ifdef GL_ARB_internalformat_query + "GL_ARB_internalformat_query", +#endif +#ifdef GL_ARB_internalformat_query2 + "GL_ARB_internalformat_query2", +#endif +#ifdef GL_ARB_invalidate_subdata + "GL_ARB_invalidate_subdata", +#endif +#ifdef GL_ARB_map_buffer_alignment + "GL_ARB_map_buffer_alignment", +#endif +#ifdef GL_ARB_map_buffer_range + "GL_ARB_map_buffer_range", +#endif +#ifdef GL_ARB_matrix_palette + "GL_ARB_matrix_palette", +#endif +#ifdef GL_ARB_multi_bind + "GL_ARB_multi_bind", +#endif +#ifdef GL_ARB_multi_draw_indirect + "GL_ARB_multi_draw_indirect", +#endif +#ifdef GL_ARB_multisample + "GL_ARB_multisample", +#endif +#ifdef GL_ARB_multitexture + "GL_ARB_multitexture", +#endif +#ifdef GL_ARB_occlusion_query + "GL_ARB_occlusion_query", +#endif +#ifdef GL_ARB_occlusion_query2 + "GL_ARB_occlusion_query2", +#endif +#ifdef GL_ARB_parallel_shader_compile + "GL_ARB_parallel_shader_compile", +#endif +#ifdef GL_ARB_pipeline_statistics_query + "GL_ARB_pipeline_statistics_query", +#endif +#ifdef GL_ARB_pixel_buffer_object + "GL_ARB_pixel_buffer_object", +#endif +#ifdef GL_ARB_point_parameters + "GL_ARB_point_parameters", +#endif +#ifdef GL_ARB_point_sprite + "GL_ARB_point_sprite", +#endif +#ifdef GL_ARB_polygon_offset_clamp + "GL_ARB_polygon_offset_clamp", +#endif +#ifdef GL_ARB_post_depth_coverage + "GL_ARB_post_depth_coverage", +#endif +#ifdef GL_ARB_program_interface_query + "GL_ARB_program_interface_query", +#endif +#ifdef GL_ARB_provoking_vertex + "GL_ARB_provoking_vertex", +#endif +#ifdef GL_ARB_query_buffer_object + "GL_ARB_query_buffer_object", +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + "GL_ARB_robust_buffer_access_behavior", +#endif +#ifdef GL_ARB_robustness + "GL_ARB_robustness", +#endif +#ifdef GL_ARB_robustness_application_isolation + "GL_ARB_robustness_application_isolation", +#endif +#ifdef GL_ARB_robustness_share_group_isolation + "GL_ARB_robustness_share_group_isolation", +#endif +#ifdef GL_ARB_sample_locations + "GL_ARB_sample_locations", +#endif +#ifdef GL_ARB_sample_shading + "GL_ARB_sample_shading", +#endif +#ifdef GL_ARB_sampler_objects + "GL_ARB_sampler_objects", +#endif +#ifdef GL_ARB_seamless_cube_map + "GL_ARB_seamless_cube_map", +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + "GL_ARB_seamless_cubemap_per_texture", +#endif +#ifdef GL_ARB_separate_shader_objects + "GL_ARB_separate_shader_objects", +#endif +#ifdef GL_ARB_shader_atomic_counter_ops + "GL_ARB_shader_atomic_counter_ops", +#endif +#ifdef GL_ARB_shader_atomic_counters + "GL_ARB_shader_atomic_counters", +#endif +#ifdef GL_ARB_shader_ballot + "GL_ARB_shader_ballot", +#endif +#ifdef GL_ARB_shader_bit_encoding + "GL_ARB_shader_bit_encoding", +#endif +#ifdef GL_ARB_shader_clock + "GL_ARB_shader_clock", +#endif +#ifdef GL_ARB_shader_draw_parameters + "GL_ARB_shader_draw_parameters", +#endif +#ifdef GL_ARB_shader_group_vote + "GL_ARB_shader_group_vote", +#endif +#ifdef GL_ARB_shader_image_load_store + "GL_ARB_shader_image_load_store", +#endif +#ifdef GL_ARB_shader_image_size + "GL_ARB_shader_image_size", +#endif +#ifdef GL_ARB_shader_objects + "GL_ARB_shader_objects", +#endif +#ifdef GL_ARB_shader_precision + "GL_ARB_shader_precision", +#endif +#ifdef GL_ARB_shader_stencil_export + "GL_ARB_shader_stencil_export", +#endif +#ifdef GL_ARB_shader_storage_buffer_object + "GL_ARB_shader_storage_buffer_object", +#endif +#ifdef GL_ARB_shader_subroutine + "GL_ARB_shader_subroutine", +#endif +#ifdef GL_ARB_shader_texture_image_samples + "GL_ARB_shader_texture_image_samples", +#endif +#ifdef GL_ARB_shader_texture_lod + "GL_ARB_shader_texture_lod", +#endif +#ifdef GL_ARB_shader_viewport_layer_array + "GL_ARB_shader_viewport_layer_array", +#endif +#ifdef GL_ARB_shading_language_100 + "GL_ARB_shading_language_100", +#endif +#ifdef GL_ARB_shading_language_420pack + "GL_ARB_shading_language_420pack", +#endif +#ifdef GL_ARB_shading_language_include + "GL_ARB_shading_language_include", +#endif +#ifdef GL_ARB_shading_language_packing + "GL_ARB_shading_language_packing", +#endif +#ifdef GL_ARB_shadow + "GL_ARB_shadow", +#endif +#ifdef GL_ARB_shadow_ambient + "GL_ARB_shadow_ambient", +#endif +#ifdef GL_ARB_sparse_buffer + "GL_ARB_sparse_buffer", +#endif +#ifdef GL_ARB_sparse_texture + "GL_ARB_sparse_texture", +#endif +#ifdef GL_ARB_sparse_texture2 + "GL_ARB_sparse_texture2", +#endif +#ifdef GL_ARB_sparse_texture_clamp + "GL_ARB_sparse_texture_clamp", +#endif +#ifdef GL_ARB_spirv_extensions + "GL_ARB_spirv_extensions", +#endif +#ifdef GL_ARB_stencil_texturing + "GL_ARB_stencil_texturing", +#endif +#ifdef GL_ARB_sync + "GL_ARB_sync", +#endif +#ifdef GL_ARB_tessellation_shader + "GL_ARB_tessellation_shader", +#endif +#ifdef GL_ARB_texture_barrier + "GL_ARB_texture_barrier", +#endif +#ifdef GL_ARB_texture_border_clamp + "GL_ARB_texture_border_clamp", +#endif +#ifdef GL_ARB_texture_buffer_object + "GL_ARB_texture_buffer_object", +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + "GL_ARB_texture_buffer_object_rgb32", +#endif +#ifdef GL_ARB_texture_buffer_range + "GL_ARB_texture_buffer_range", +#endif +#ifdef GL_ARB_texture_compression + "GL_ARB_texture_compression", +#endif +#ifdef GL_ARB_texture_compression_bptc + "GL_ARB_texture_compression_bptc", +#endif +#ifdef GL_ARB_texture_compression_rgtc + "GL_ARB_texture_compression_rgtc", +#endif +#ifdef GL_ARB_texture_cube_map + "GL_ARB_texture_cube_map", +#endif +#ifdef GL_ARB_texture_cube_map_array + "GL_ARB_texture_cube_map_array", +#endif +#ifdef GL_ARB_texture_env_add + "GL_ARB_texture_env_add", +#endif +#ifdef GL_ARB_texture_env_combine + "GL_ARB_texture_env_combine", +#endif +#ifdef GL_ARB_texture_env_crossbar + "GL_ARB_texture_env_crossbar", +#endif +#ifdef GL_ARB_texture_env_dot3 + "GL_ARB_texture_env_dot3", +#endif +#ifdef GL_ARB_texture_filter_anisotropic + "GL_ARB_texture_filter_anisotropic", +#endif +#ifdef GL_ARB_texture_filter_minmax + "GL_ARB_texture_filter_minmax", +#endif +#ifdef GL_ARB_texture_float + "GL_ARB_texture_float", +#endif +#ifdef GL_ARB_texture_gather + "GL_ARB_texture_gather", +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + "GL_ARB_texture_mirror_clamp_to_edge", +#endif +#ifdef GL_ARB_texture_mirrored_repeat + "GL_ARB_texture_mirrored_repeat", +#endif +#ifdef GL_ARB_texture_multisample + "GL_ARB_texture_multisample", +#endif +#ifdef GL_ARB_texture_non_power_of_two + "GL_ARB_texture_non_power_of_two", +#endif +#ifdef GL_ARB_texture_query_levels + "GL_ARB_texture_query_levels", +#endif +#ifdef GL_ARB_texture_query_lod + "GL_ARB_texture_query_lod", +#endif +#ifdef GL_ARB_texture_rectangle + "GL_ARB_texture_rectangle", +#endif +#ifdef GL_ARB_texture_rg + "GL_ARB_texture_rg", +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + "GL_ARB_texture_rgb10_a2ui", +#endif +#ifdef GL_ARB_texture_stencil8 + "GL_ARB_texture_stencil8", +#endif +#ifdef GL_ARB_texture_storage + "GL_ARB_texture_storage", +#endif +#ifdef GL_ARB_texture_storage_multisample + "GL_ARB_texture_storage_multisample", +#endif +#ifdef GL_ARB_texture_swizzle + "GL_ARB_texture_swizzle", +#endif +#ifdef GL_ARB_texture_view + "GL_ARB_texture_view", +#endif +#ifdef GL_ARB_timer_query + "GL_ARB_timer_query", +#endif +#ifdef GL_ARB_transform_feedback2 + "GL_ARB_transform_feedback2", +#endif +#ifdef GL_ARB_transform_feedback3 + "GL_ARB_transform_feedback3", +#endif +#ifdef GL_ARB_transform_feedback_instanced + "GL_ARB_transform_feedback_instanced", +#endif +#ifdef GL_ARB_transform_feedback_overflow_query + "GL_ARB_transform_feedback_overflow_query", +#endif +#ifdef GL_ARB_transpose_matrix + "GL_ARB_transpose_matrix", +#endif +#ifdef GL_ARB_uniform_buffer_object + "GL_ARB_uniform_buffer_object", +#endif +#ifdef GL_ARB_vertex_array_bgra + "GL_ARB_vertex_array_bgra", +#endif +#ifdef GL_ARB_vertex_array_object + "GL_ARB_vertex_array_object", +#endif +#ifdef GL_ARB_vertex_attrib_64bit + "GL_ARB_vertex_attrib_64bit", +#endif +#ifdef GL_ARB_vertex_attrib_binding + "GL_ARB_vertex_attrib_binding", +#endif +#ifdef GL_ARB_vertex_blend + "GL_ARB_vertex_blend", +#endif +#ifdef GL_ARB_vertex_buffer_object + "GL_ARB_vertex_buffer_object", +#endif +#ifdef GL_ARB_vertex_program + "GL_ARB_vertex_program", +#endif +#ifdef GL_ARB_vertex_shader + "GL_ARB_vertex_shader", +#endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + "GL_ARB_vertex_type_10f_11f_11f_rev", +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + "GL_ARB_vertex_type_2_10_10_10_rev", +#endif +#ifdef GL_ARB_viewport_array + "GL_ARB_viewport_array", +#endif +#ifdef GL_ARB_window_pos + "GL_ARB_window_pos", +#endif +#ifdef GL_ARM_mali_program_binary + "GL_ARM_mali_program_binary", +#endif +#ifdef GL_ARM_mali_shader_binary + "GL_ARM_mali_shader_binary", +#endif +#ifdef GL_ARM_rgba8 + "GL_ARM_rgba8", +#endif +#ifdef GL_ARM_shader_framebuffer_fetch + "GL_ARM_shader_framebuffer_fetch", +#endif +#ifdef GL_ARM_shader_framebuffer_fetch_depth_stencil + "GL_ARM_shader_framebuffer_fetch_depth_stencil", +#endif +#ifdef GL_ATIX_point_sprites + "GL_ATIX_point_sprites", +#endif +#ifdef GL_ATIX_texture_env_combine3 + "GL_ATIX_texture_env_combine3", +#endif +#ifdef GL_ATIX_texture_env_route + "GL_ATIX_texture_env_route", +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + "GL_ATIX_vertex_shader_output_point_size", +#endif +#ifdef GL_ATI_draw_buffers + "GL_ATI_draw_buffers", +#endif +#ifdef GL_ATI_element_array + "GL_ATI_element_array", +#endif +#ifdef GL_ATI_envmap_bumpmap + "GL_ATI_envmap_bumpmap", +#endif +#ifdef GL_ATI_fragment_shader + "GL_ATI_fragment_shader", +#endif +#ifdef GL_ATI_map_object_buffer + "GL_ATI_map_object_buffer", +#endif +#ifdef GL_ATI_meminfo + "GL_ATI_meminfo", +#endif +#ifdef GL_ATI_pn_triangles + "GL_ATI_pn_triangles", +#endif +#ifdef GL_ATI_separate_stencil + "GL_ATI_separate_stencil", +#endif +#ifdef GL_ATI_shader_texture_lod + "GL_ATI_shader_texture_lod", +#endif +#ifdef GL_ATI_text_fragment_shader + "GL_ATI_text_fragment_shader", +#endif +#ifdef GL_ATI_texture_compression_3dc + "GL_ATI_texture_compression_3dc", +#endif +#ifdef GL_ATI_texture_env_combine3 + "GL_ATI_texture_env_combine3", +#endif +#ifdef GL_ATI_texture_float + "GL_ATI_texture_float", +#endif +#ifdef GL_ATI_texture_mirror_once + "GL_ATI_texture_mirror_once", +#endif +#ifdef GL_ATI_vertex_array_object + "GL_ATI_vertex_array_object", +#endif +#ifdef GL_ATI_vertex_attrib_array_object + "GL_ATI_vertex_attrib_array_object", +#endif +#ifdef GL_ATI_vertex_streams + "GL_ATI_vertex_streams", +#endif +#ifdef GL_EGL_KHR_context_flush_control + "GL_EGL_KHR_context_flush_control", +#endif +#ifdef GL_EGL_NV_robustness_video_memory_purge + "GL_EGL_NV_robustness_video_memory_purge", +#endif +#ifdef GL_EXT_422_pixels + "GL_EXT_422_pixels", +#endif +#ifdef GL_EXT_Cg_shader + "GL_EXT_Cg_shader", +#endif +#ifdef GL_EXT_EGL_image_array + "GL_EXT_EGL_image_array", +#endif +#ifdef GL_EXT_YUV_target + "GL_EXT_YUV_target", +#endif +#ifdef GL_EXT_abgr + "GL_EXT_abgr", +#endif +#ifdef GL_EXT_base_instance + "GL_EXT_base_instance", +#endif +#ifdef GL_EXT_bgra + "GL_EXT_bgra", +#endif +#ifdef GL_EXT_bindable_uniform + "GL_EXT_bindable_uniform", +#endif +#ifdef GL_EXT_blend_color + "GL_EXT_blend_color", +#endif +#ifdef GL_EXT_blend_equation_separate + "GL_EXT_blend_equation_separate", +#endif +#ifdef GL_EXT_blend_func_extended + "GL_EXT_blend_func_extended", +#endif +#ifdef GL_EXT_blend_func_separate + "GL_EXT_blend_func_separate", +#endif +#ifdef GL_EXT_blend_logic_op + "GL_EXT_blend_logic_op", +#endif +#ifdef GL_EXT_blend_minmax + "GL_EXT_blend_minmax", +#endif +#ifdef GL_EXT_blend_subtract + "GL_EXT_blend_subtract", +#endif +#ifdef GL_EXT_buffer_storage + "GL_EXT_buffer_storage", +#endif +#ifdef GL_EXT_clear_texture + "GL_EXT_clear_texture", +#endif +#ifdef GL_EXT_clip_cull_distance + "GL_EXT_clip_cull_distance", +#endif +#ifdef GL_EXT_clip_volume_hint + "GL_EXT_clip_volume_hint", +#endif +#ifdef GL_EXT_cmyka + "GL_EXT_cmyka", +#endif +#ifdef GL_EXT_color_buffer_float + "GL_EXT_color_buffer_float", +#endif +#ifdef GL_EXT_color_buffer_half_float + "GL_EXT_color_buffer_half_float", +#endif +#ifdef GL_EXT_color_subtable + "GL_EXT_color_subtable", +#endif +#ifdef GL_EXT_compiled_vertex_array + "GL_EXT_compiled_vertex_array", +#endif +#ifdef GL_EXT_compressed_ETC1_RGB8_sub_texture + "GL_EXT_compressed_ETC1_RGB8_sub_texture", +#endif +#ifdef GL_EXT_conservative_depth + "GL_EXT_conservative_depth", +#endif +#ifdef GL_EXT_convolution + "GL_EXT_convolution", +#endif +#ifdef GL_EXT_coordinate_frame + "GL_EXT_coordinate_frame", +#endif +#ifdef GL_EXT_copy_image + "GL_EXT_copy_image", +#endif +#ifdef GL_EXT_copy_texture + "GL_EXT_copy_texture", +#endif +#ifdef GL_EXT_cull_vertex + "GL_EXT_cull_vertex", +#endif +#ifdef GL_EXT_debug_label + "GL_EXT_debug_label", +#endif +#ifdef GL_EXT_debug_marker + "GL_EXT_debug_marker", +#endif +#ifdef GL_EXT_depth_bounds_test + "GL_EXT_depth_bounds_test", +#endif +#ifdef GL_EXT_direct_state_access + "GL_EXT_direct_state_access", +#endif +#ifdef GL_EXT_discard_framebuffer + "GL_EXT_discard_framebuffer", +#endif +#ifdef GL_EXT_draw_buffers + "GL_EXT_draw_buffers", +#endif +#ifdef GL_EXT_draw_buffers2 + "GL_EXT_draw_buffers2", +#endif +#ifdef GL_EXT_draw_buffers_indexed + "GL_EXT_draw_buffers_indexed", +#endif +#ifdef GL_EXT_draw_elements_base_vertex + "GL_EXT_draw_elements_base_vertex", +#endif +#ifdef GL_EXT_draw_instanced + "GL_EXT_draw_instanced", +#endif +#ifdef GL_EXT_draw_range_elements + "GL_EXT_draw_range_elements", +#endif +#ifdef GL_EXT_external_buffer + "GL_EXT_external_buffer", +#endif +#ifdef GL_EXT_float_blend + "GL_EXT_float_blend", +#endif +#ifdef GL_EXT_fog_coord + "GL_EXT_fog_coord", +#endif +#ifdef GL_EXT_frag_depth + "GL_EXT_frag_depth", +#endif +#ifdef GL_EXT_fragment_lighting + "GL_EXT_fragment_lighting", +#endif +#ifdef GL_EXT_framebuffer_blit + "GL_EXT_framebuffer_blit", +#endif +#ifdef GL_EXT_framebuffer_multisample + "GL_EXT_framebuffer_multisample", +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + "GL_EXT_framebuffer_multisample_blit_scaled", +#endif +#ifdef GL_EXT_framebuffer_object + "GL_EXT_framebuffer_object", +#endif +#ifdef GL_EXT_framebuffer_sRGB + "GL_EXT_framebuffer_sRGB", +#endif +#ifdef GL_EXT_geometry_point_size + "GL_EXT_geometry_point_size", +#endif +#ifdef GL_EXT_geometry_shader + "GL_EXT_geometry_shader", +#endif +#ifdef GL_EXT_geometry_shader4 + "GL_EXT_geometry_shader4", +#endif +#ifdef GL_EXT_gpu_program_parameters + "GL_EXT_gpu_program_parameters", +#endif +#ifdef GL_EXT_gpu_shader4 + "GL_EXT_gpu_shader4", +#endif +#ifdef GL_EXT_gpu_shader5 + "GL_EXT_gpu_shader5", +#endif +#ifdef GL_EXT_histogram + "GL_EXT_histogram", +#endif +#ifdef GL_EXT_index_array_formats + "GL_EXT_index_array_formats", +#endif +#ifdef GL_EXT_index_func + "GL_EXT_index_func", +#endif +#ifdef GL_EXT_index_material + "GL_EXT_index_material", +#endif +#ifdef GL_EXT_index_texture + "GL_EXT_index_texture", +#endif +#ifdef GL_EXT_instanced_arrays + "GL_EXT_instanced_arrays", +#endif +#ifdef GL_EXT_light_texture + "GL_EXT_light_texture", +#endif +#ifdef GL_EXT_map_buffer_range + "GL_EXT_map_buffer_range", +#endif +#ifdef GL_EXT_memory_object + "GL_EXT_memory_object", +#endif +#ifdef GL_EXT_memory_object_fd + "GL_EXT_memory_object_fd", +#endif +#ifdef GL_EXT_memory_object_win32 + "GL_EXT_memory_object_win32", +#endif +#ifdef GL_EXT_misc_attribute + "GL_EXT_misc_attribute", +#endif +#ifdef GL_EXT_multi_draw_arrays + "GL_EXT_multi_draw_arrays", +#endif +#ifdef GL_EXT_multi_draw_indirect + "GL_EXT_multi_draw_indirect", +#endif +#ifdef GL_EXT_multiple_textures + "GL_EXT_multiple_textures", +#endif +#ifdef GL_EXT_multisample + "GL_EXT_multisample", +#endif +#ifdef GL_EXT_multisample_compatibility + "GL_EXT_multisample_compatibility", +#endif +#ifdef GL_EXT_multisampled_render_to_texture + "GL_EXT_multisampled_render_to_texture", +#endif +#ifdef GL_EXT_multisampled_render_to_texture2 + "GL_EXT_multisampled_render_to_texture2", +#endif +#ifdef GL_EXT_multiview_draw_buffers + "GL_EXT_multiview_draw_buffers", +#endif +#ifdef GL_EXT_packed_depth_stencil + "GL_EXT_packed_depth_stencil", +#endif +#ifdef GL_EXT_packed_float + "GL_EXT_packed_float", +#endif +#ifdef GL_EXT_packed_pixels + "GL_EXT_packed_pixels", +#endif +#ifdef GL_EXT_paletted_texture + "GL_EXT_paletted_texture", +#endif +#ifdef GL_EXT_pixel_buffer_object + "GL_EXT_pixel_buffer_object", +#endif +#ifdef GL_EXT_pixel_transform + "GL_EXT_pixel_transform", +#endif +#ifdef GL_EXT_pixel_transform_color_table + "GL_EXT_pixel_transform_color_table", +#endif +#ifdef GL_EXT_point_parameters + "GL_EXT_point_parameters", +#endif +#ifdef GL_EXT_polygon_offset + "GL_EXT_polygon_offset", +#endif +#ifdef GL_EXT_polygon_offset_clamp + "GL_EXT_polygon_offset_clamp", +#endif +#ifdef GL_EXT_post_depth_coverage + "GL_EXT_post_depth_coverage", +#endif +#ifdef GL_EXT_provoking_vertex + "GL_EXT_provoking_vertex", +#endif +#ifdef GL_EXT_pvrtc_sRGB + "GL_EXT_pvrtc_sRGB", +#endif +#ifdef GL_EXT_raster_multisample + "GL_EXT_raster_multisample", +#endif +#ifdef GL_EXT_read_format_bgra + "GL_EXT_read_format_bgra", +#endif +#ifdef GL_EXT_render_snorm + "GL_EXT_render_snorm", +#endif +#ifdef GL_EXT_rescale_normal + "GL_EXT_rescale_normal", +#endif +#ifdef GL_EXT_sRGB + "GL_EXT_sRGB", +#endif +#ifdef GL_EXT_sRGB_write_control + "GL_EXT_sRGB_write_control", +#endif +#ifdef GL_EXT_scene_marker + "GL_EXT_scene_marker", +#endif +#ifdef GL_EXT_secondary_color + "GL_EXT_secondary_color", +#endif +#ifdef GL_EXT_semaphore + "GL_EXT_semaphore", +#endif +#ifdef GL_EXT_semaphore_fd + "GL_EXT_semaphore_fd", +#endif +#ifdef GL_EXT_semaphore_win32 + "GL_EXT_semaphore_win32", +#endif +#ifdef GL_EXT_separate_shader_objects + "GL_EXT_separate_shader_objects", +#endif +#ifdef GL_EXT_separate_specular_color + "GL_EXT_separate_specular_color", +#endif +#ifdef GL_EXT_shader_framebuffer_fetch + "GL_EXT_shader_framebuffer_fetch", +#endif +#ifdef GL_EXT_shader_group_vote + "GL_EXT_shader_group_vote", +#endif +#ifdef GL_EXT_shader_image_load_formatted + "GL_EXT_shader_image_load_formatted", +#endif +#ifdef GL_EXT_shader_image_load_store + "GL_EXT_shader_image_load_store", +#endif +#ifdef GL_EXT_shader_implicit_conversions + "GL_EXT_shader_implicit_conversions", +#endif +#ifdef GL_EXT_shader_integer_mix + "GL_EXT_shader_integer_mix", +#endif +#ifdef GL_EXT_shader_io_blocks + "GL_EXT_shader_io_blocks", +#endif +#ifdef GL_EXT_shader_non_constant_global_initializers + "GL_EXT_shader_non_constant_global_initializers", +#endif +#ifdef GL_EXT_shader_pixel_local_storage + "GL_EXT_shader_pixel_local_storage", +#endif +#ifdef GL_EXT_shader_pixel_local_storage2 + "GL_EXT_shader_pixel_local_storage2", +#endif +#ifdef GL_EXT_shader_texture_lod + "GL_EXT_shader_texture_lod", +#endif +#ifdef GL_EXT_shadow_funcs + "GL_EXT_shadow_funcs", +#endif +#ifdef GL_EXT_shadow_samplers + "GL_EXT_shadow_samplers", +#endif +#ifdef GL_EXT_shared_texture_palette + "GL_EXT_shared_texture_palette", +#endif +#ifdef GL_EXT_sparse_texture + "GL_EXT_sparse_texture", +#endif +#ifdef GL_EXT_sparse_texture2 + "GL_EXT_sparse_texture2", +#endif +#ifdef GL_EXT_stencil_clear_tag + "GL_EXT_stencil_clear_tag", +#endif +#ifdef GL_EXT_stencil_two_side + "GL_EXT_stencil_two_side", +#endif +#ifdef GL_EXT_stencil_wrap + "GL_EXT_stencil_wrap", +#endif +#ifdef GL_EXT_subtexture + "GL_EXT_subtexture", +#endif +#ifdef GL_EXT_texture + "GL_EXT_texture", +#endif +#ifdef GL_EXT_texture3D + "GL_EXT_texture3D", +#endif +#ifdef GL_EXT_texture_array + "GL_EXT_texture_array", +#endif +#ifdef GL_EXT_texture_buffer_object + "GL_EXT_texture_buffer_object", +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode + "GL_EXT_texture_compression_astc_decode_mode", +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + "GL_EXT_texture_compression_astc_decode_mode_rgb9e5", +#endif +#ifdef GL_EXT_texture_compression_bptc + "GL_EXT_texture_compression_bptc", +#endif +#ifdef GL_EXT_texture_compression_dxt1 + "GL_EXT_texture_compression_dxt1", +#endif +#ifdef GL_EXT_texture_compression_latc + "GL_EXT_texture_compression_latc", +#endif +#ifdef GL_EXT_texture_compression_rgtc + "GL_EXT_texture_compression_rgtc", +#endif +#ifdef GL_EXT_texture_compression_s3tc + "GL_EXT_texture_compression_s3tc", +#endif +#ifdef GL_EXT_texture_cube_map + "GL_EXT_texture_cube_map", +#endif +#ifdef GL_EXT_texture_cube_map_array + "GL_EXT_texture_cube_map_array", +#endif +#ifdef GL_EXT_texture_edge_clamp + "GL_EXT_texture_edge_clamp", +#endif +#ifdef GL_EXT_texture_env + "GL_EXT_texture_env", +#endif +#ifdef GL_EXT_texture_env_add + "GL_EXT_texture_env_add", +#endif +#ifdef GL_EXT_texture_env_combine + "GL_EXT_texture_env_combine", +#endif +#ifdef GL_EXT_texture_env_dot3 + "GL_EXT_texture_env_dot3", +#endif +#ifdef GL_EXT_texture_filter_anisotropic + "GL_EXT_texture_filter_anisotropic", +#endif +#ifdef GL_EXT_texture_filter_minmax + "GL_EXT_texture_filter_minmax", +#endif +#ifdef GL_EXT_texture_format_BGRA8888 + "GL_EXT_texture_format_BGRA8888", +#endif +#ifdef GL_EXT_texture_integer + "GL_EXT_texture_integer", +#endif +#ifdef GL_EXT_texture_lod_bias + "GL_EXT_texture_lod_bias", +#endif +#ifdef GL_EXT_texture_mirror_clamp + "GL_EXT_texture_mirror_clamp", +#endif +#ifdef GL_EXT_texture_norm16 + "GL_EXT_texture_norm16", +#endif +#ifdef GL_EXT_texture_object + "GL_EXT_texture_object", +#endif +#ifdef GL_EXT_texture_perturb_normal + "GL_EXT_texture_perturb_normal", +#endif +#ifdef GL_EXT_texture_rectangle + "GL_EXT_texture_rectangle", +#endif +#ifdef GL_EXT_texture_rg + "GL_EXT_texture_rg", +#endif +#ifdef GL_EXT_texture_sRGB + "GL_EXT_texture_sRGB", +#endif +#ifdef GL_EXT_texture_sRGB_R8 + "GL_EXT_texture_sRGB_R8", +#endif +#ifdef GL_EXT_texture_sRGB_RG8 + "GL_EXT_texture_sRGB_RG8", +#endif +#ifdef GL_EXT_texture_sRGB_decode + "GL_EXT_texture_sRGB_decode", +#endif +#ifdef GL_EXT_texture_shared_exponent + "GL_EXT_texture_shared_exponent", +#endif +#ifdef GL_EXT_texture_snorm + "GL_EXT_texture_snorm", +#endif +#ifdef GL_EXT_texture_storage + "GL_EXT_texture_storage", +#endif +#ifdef GL_EXT_texture_swizzle + "GL_EXT_texture_swizzle", +#endif +#ifdef GL_EXT_texture_type_2_10_10_10_REV + "GL_EXT_texture_type_2_10_10_10_REV", +#endif +#ifdef GL_EXT_texture_view + "GL_EXT_texture_view", +#endif +#ifdef GL_EXT_timer_query + "GL_EXT_timer_query", +#endif +#ifdef GL_EXT_transform_feedback + "GL_EXT_transform_feedback", +#endif +#ifdef GL_EXT_unpack_subimage + "GL_EXT_unpack_subimage", +#endif +#ifdef GL_EXT_vertex_array + "GL_EXT_vertex_array", +#endif +#ifdef GL_EXT_vertex_array_bgra + "GL_EXT_vertex_array_bgra", +#endif +#ifdef GL_EXT_vertex_array_setXXX + "GL_EXT_vertex_array_setXXX", +#endif +#ifdef GL_EXT_vertex_attrib_64bit + "GL_EXT_vertex_attrib_64bit", +#endif +#ifdef GL_EXT_vertex_shader + "GL_EXT_vertex_shader", +#endif +#ifdef GL_EXT_vertex_weighting + "GL_EXT_vertex_weighting", +#endif +#ifdef GL_EXT_win32_keyed_mutex + "GL_EXT_win32_keyed_mutex", +#endif +#ifdef GL_EXT_window_rectangles + "GL_EXT_window_rectangles", +#endif +#ifdef GL_EXT_x11_sync_object + "GL_EXT_x11_sync_object", +#endif +#ifdef GL_GREMEDY_frame_terminator + "GL_GREMEDY_frame_terminator", +#endif +#ifdef GL_GREMEDY_string_marker + "GL_GREMEDY_string_marker", +#endif +#ifdef GL_HP_convolution_border_modes + "GL_HP_convolution_border_modes", +#endif +#ifdef GL_HP_image_transform + "GL_HP_image_transform", +#endif +#ifdef GL_HP_occlusion_test + "GL_HP_occlusion_test", +#endif +#ifdef GL_HP_texture_lighting + "GL_HP_texture_lighting", +#endif +#ifdef GL_IBM_cull_vertex + "GL_IBM_cull_vertex", +#endif +#ifdef GL_IBM_multimode_draw_arrays + "GL_IBM_multimode_draw_arrays", +#endif +#ifdef GL_IBM_rasterpos_clip + "GL_IBM_rasterpos_clip", +#endif +#ifdef GL_IBM_static_data + "GL_IBM_static_data", +#endif +#ifdef GL_IBM_texture_mirrored_repeat + "GL_IBM_texture_mirrored_repeat", +#endif +#ifdef GL_IBM_vertex_array_lists + "GL_IBM_vertex_array_lists", +#endif +#ifdef GL_INGR_color_clamp + "GL_INGR_color_clamp", +#endif +#ifdef GL_INGR_interlace_read + "GL_INGR_interlace_read", +#endif +#ifdef GL_INTEL_conservative_rasterization + "GL_INTEL_conservative_rasterization", +#endif +#ifdef GL_INTEL_fragment_shader_ordering + "GL_INTEL_fragment_shader_ordering", +#endif +#ifdef GL_INTEL_framebuffer_CMAA + "GL_INTEL_framebuffer_CMAA", +#endif +#ifdef GL_INTEL_map_texture + "GL_INTEL_map_texture", +#endif +#ifdef GL_INTEL_parallel_arrays + "GL_INTEL_parallel_arrays", +#endif +#ifdef GL_INTEL_performance_query + "GL_INTEL_performance_query", +#endif +#ifdef GL_INTEL_texture_scissor + "GL_INTEL_texture_scissor", +#endif +#ifdef GL_KHR_blend_equation_advanced + "GL_KHR_blend_equation_advanced", +#endif +#ifdef GL_KHR_blend_equation_advanced_coherent + "GL_KHR_blend_equation_advanced_coherent", +#endif +#ifdef GL_KHR_context_flush_control + "GL_KHR_context_flush_control", +#endif +#ifdef GL_KHR_debug + "GL_KHR_debug", +#endif +#ifdef GL_KHR_no_error + "GL_KHR_no_error", +#endif +#ifdef GL_KHR_parallel_shader_compile + "GL_KHR_parallel_shader_compile", +#endif +#ifdef GL_KHR_robust_buffer_access_behavior + "GL_KHR_robust_buffer_access_behavior", +#endif +#ifdef GL_KHR_robustness + "GL_KHR_robustness", +#endif +#ifdef GL_KHR_texture_compression_astc_hdr + "GL_KHR_texture_compression_astc_hdr", +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + "GL_KHR_texture_compression_astc_ldr", +#endif +#ifdef GL_KHR_texture_compression_astc_sliced_3d + "GL_KHR_texture_compression_astc_sliced_3d", +#endif +#ifdef GL_KTX_buffer_region + "GL_KTX_buffer_region", +#endif +#ifdef GL_MESAX_texture_stack + "GL_MESAX_texture_stack", +#endif +#ifdef GL_MESA_pack_invert + "GL_MESA_pack_invert", +#endif +#ifdef GL_MESA_resize_buffers + "GL_MESA_resize_buffers", +#endif +#ifdef GL_MESA_shader_integer_functions + "GL_MESA_shader_integer_functions", +#endif +#ifdef GL_MESA_window_pos + "GL_MESA_window_pos", +#endif +#ifdef GL_MESA_ycbcr_texture + "GL_MESA_ycbcr_texture", +#endif +#ifdef GL_NVX_blend_equation_advanced_multi_draw_buffers + "GL_NVX_blend_equation_advanced_multi_draw_buffers", +#endif +#ifdef GL_NVX_conditional_render + "GL_NVX_conditional_render", +#endif +#ifdef GL_NVX_gpu_memory_info + "GL_NVX_gpu_memory_info", +#endif +#ifdef GL_NVX_linked_gpu_multicast + "GL_NVX_linked_gpu_multicast", +#endif +#ifdef GL_NV_3dvision_settings + "GL_NV_3dvision_settings", +#endif +#ifdef GL_NV_EGL_stream_consumer_external + "GL_NV_EGL_stream_consumer_external", +#endif +#ifdef GL_NV_alpha_to_coverage_dither_control + "GL_NV_alpha_to_coverage_dither_control", +#endif +#ifdef GL_NV_bgr + "GL_NV_bgr", +#endif +#ifdef GL_NV_bindless_multi_draw_indirect + "GL_NV_bindless_multi_draw_indirect", +#endif +#ifdef GL_NV_bindless_multi_draw_indirect_count + "GL_NV_bindless_multi_draw_indirect_count", +#endif +#ifdef GL_NV_bindless_texture + "GL_NV_bindless_texture", +#endif +#ifdef GL_NV_blend_equation_advanced + "GL_NV_blend_equation_advanced", +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + "GL_NV_blend_equation_advanced_coherent", +#endif +#ifdef GL_NV_blend_minmax_factor + "GL_NV_blend_minmax_factor", +#endif +#ifdef GL_NV_blend_square + "GL_NV_blend_square", +#endif +#ifdef GL_NV_clip_space_w_scaling + "GL_NV_clip_space_w_scaling", +#endif +#ifdef GL_NV_command_list + "GL_NV_command_list", +#endif +#ifdef GL_NV_compute_program5 + "GL_NV_compute_program5", +#endif +#ifdef GL_NV_conditional_render + "GL_NV_conditional_render", +#endif +#ifdef GL_NV_conservative_raster + "GL_NV_conservative_raster", +#endif +#ifdef GL_NV_conservative_raster_dilate + "GL_NV_conservative_raster_dilate", +#endif +#ifdef GL_NV_conservative_raster_pre_snap_triangles + "GL_NV_conservative_raster_pre_snap_triangles", +#endif +#ifdef GL_NV_copy_buffer + "GL_NV_copy_buffer", +#endif +#ifdef GL_NV_copy_depth_to_color + "GL_NV_copy_depth_to_color", +#endif +#ifdef GL_NV_copy_image + "GL_NV_copy_image", +#endif +#ifdef GL_NV_deep_texture3D + "GL_NV_deep_texture3D", +#endif +#ifdef GL_NV_depth_buffer_float + "GL_NV_depth_buffer_float", +#endif +#ifdef GL_NV_depth_clamp + "GL_NV_depth_clamp", +#endif +#ifdef GL_NV_depth_range_unclamped + "GL_NV_depth_range_unclamped", +#endif +#ifdef GL_NV_draw_buffers + "GL_NV_draw_buffers", +#endif +#ifdef GL_NV_draw_instanced + "GL_NV_draw_instanced", +#endif +#ifdef GL_NV_draw_texture + "GL_NV_draw_texture", +#endif +#ifdef GL_NV_draw_vulkan_image + "GL_NV_draw_vulkan_image", +#endif +#ifdef GL_NV_evaluators + "GL_NV_evaluators", +#endif +#ifdef GL_NV_explicit_attrib_location + "GL_NV_explicit_attrib_location", +#endif +#ifdef GL_NV_explicit_multisample + "GL_NV_explicit_multisample", +#endif +#ifdef GL_NV_fbo_color_attachments + "GL_NV_fbo_color_attachments", +#endif +#ifdef GL_NV_fence + "GL_NV_fence", +#endif +#ifdef GL_NV_fill_rectangle + "GL_NV_fill_rectangle", +#endif +#ifdef GL_NV_float_buffer + "GL_NV_float_buffer", +#endif +#ifdef GL_NV_fog_distance + "GL_NV_fog_distance", +#endif +#ifdef GL_NV_fragment_coverage_to_color + "GL_NV_fragment_coverage_to_color", +#endif +#ifdef GL_NV_fragment_program + "GL_NV_fragment_program", +#endif +#ifdef GL_NV_fragment_program2 + "GL_NV_fragment_program2", +#endif +#ifdef GL_NV_fragment_program4 + "GL_NV_fragment_program4", +#endif +#ifdef GL_NV_fragment_program_option + "GL_NV_fragment_program_option", +#endif +#ifdef GL_NV_fragment_shader_interlock + "GL_NV_fragment_shader_interlock", +#endif +#ifdef GL_NV_framebuffer_blit + "GL_NV_framebuffer_blit", +#endif +#ifdef GL_NV_framebuffer_mixed_samples + "GL_NV_framebuffer_mixed_samples", +#endif +#ifdef GL_NV_framebuffer_multisample + "GL_NV_framebuffer_multisample", +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + "GL_NV_framebuffer_multisample_coverage", +#endif +#ifdef GL_NV_generate_mipmap_sRGB + "GL_NV_generate_mipmap_sRGB", +#endif +#ifdef GL_NV_geometry_program4 + "GL_NV_geometry_program4", +#endif +#ifdef GL_NV_geometry_shader4 + "GL_NV_geometry_shader4", +#endif +#ifdef GL_NV_geometry_shader_passthrough + "GL_NV_geometry_shader_passthrough", +#endif +#ifdef GL_NV_gpu_multicast + "GL_NV_gpu_multicast", +#endif +#ifdef GL_NV_gpu_program4 + "GL_NV_gpu_program4", +#endif +#ifdef GL_NV_gpu_program5 + "GL_NV_gpu_program5", +#endif +#ifdef GL_NV_gpu_program5_mem_extended + "GL_NV_gpu_program5_mem_extended", +#endif +#ifdef GL_NV_gpu_program_fp64 + "GL_NV_gpu_program_fp64", +#endif +#ifdef GL_NV_gpu_shader5 + "GL_NV_gpu_shader5", +#endif +#ifdef GL_NV_half_float + "GL_NV_half_float", +#endif +#ifdef GL_NV_image_formats + "GL_NV_image_formats", +#endif +#ifdef GL_NV_instanced_arrays + "GL_NV_instanced_arrays", +#endif +#ifdef GL_NV_internalformat_sample_query + "GL_NV_internalformat_sample_query", +#endif +#ifdef GL_NV_light_max_exponent + "GL_NV_light_max_exponent", +#endif +#ifdef GL_NV_multisample_coverage + "GL_NV_multisample_coverage", +#endif +#ifdef GL_NV_multisample_filter_hint + "GL_NV_multisample_filter_hint", +#endif +#ifdef GL_NV_non_square_matrices + "GL_NV_non_square_matrices", +#endif +#ifdef GL_NV_occlusion_query + "GL_NV_occlusion_query", +#endif +#ifdef GL_NV_pack_subimage + "GL_NV_pack_subimage", +#endif +#ifdef GL_NV_packed_depth_stencil + "GL_NV_packed_depth_stencil", +#endif +#ifdef GL_NV_packed_float + "GL_NV_packed_float", +#endif +#ifdef GL_NV_packed_float_linear + "GL_NV_packed_float_linear", +#endif +#ifdef GL_NV_parameter_buffer_object + "GL_NV_parameter_buffer_object", +#endif +#ifdef GL_NV_parameter_buffer_object2 + "GL_NV_parameter_buffer_object2", +#endif +#ifdef GL_NV_path_rendering + "GL_NV_path_rendering", +#endif +#ifdef GL_NV_path_rendering_shared_edge + "GL_NV_path_rendering_shared_edge", +#endif +#ifdef GL_NV_pixel_buffer_object + "GL_NV_pixel_buffer_object", +#endif +#ifdef GL_NV_pixel_data_range + "GL_NV_pixel_data_range", +#endif +#ifdef GL_NV_platform_binary + "GL_NV_platform_binary", +#endif +#ifdef GL_NV_point_sprite + "GL_NV_point_sprite", +#endif +#ifdef GL_NV_polygon_mode + "GL_NV_polygon_mode", +#endif +#ifdef GL_NV_present_video + "GL_NV_present_video", +#endif +#ifdef GL_NV_primitive_restart + "GL_NV_primitive_restart", +#endif +#ifdef GL_NV_read_depth + "GL_NV_read_depth", +#endif +#ifdef GL_NV_read_depth_stencil + "GL_NV_read_depth_stencil", +#endif +#ifdef GL_NV_read_stencil + "GL_NV_read_stencil", +#endif +#ifdef GL_NV_register_combiners + "GL_NV_register_combiners", +#endif +#ifdef GL_NV_register_combiners2 + "GL_NV_register_combiners2", +#endif +#ifdef GL_NV_robustness_video_memory_purge + "GL_NV_robustness_video_memory_purge", +#endif +#ifdef GL_NV_sRGB_formats + "GL_NV_sRGB_formats", +#endif +#ifdef GL_NV_sample_locations + "GL_NV_sample_locations", +#endif +#ifdef GL_NV_sample_mask_override_coverage + "GL_NV_sample_mask_override_coverage", +#endif +#ifdef GL_NV_shader_atomic_counters + "GL_NV_shader_atomic_counters", +#endif +#ifdef GL_NV_shader_atomic_float + "GL_NV_shader_atomic_float", +#endif +#ifdef GL_NV_shader_atomic_float64 + "GL_NV_shader_atomic_float64", +#endif +#ifdef GL_NV_shader_atomic_fp16_vector + "GL_NV_shader_atomic_fp16_vector", +#endif +#ifdef GL_NV_shader_atomic_int64 + "GL_NV_shader_atomic_int64", +#endif +#ifdef GL_NV_shader_buffer_load + "GL_NV_shader_buffer_load", +#endif +#ifdef GL_NV_shader_noperspective_interpolation + "GL_NV_shader_noperspective_interpolation", +#endif +#ifdef GL_NV_shader_storage_buffer_object + "GL_NV_shader_storage_buffer_object", +#endif +#ifdef GL_NV_shader_thread_group + "GL_NV_shader_thread_group", +#endif +#ifdef GL_NV_shader_thread_shuffle + "GL_NV_shader_thread_shuffle", +#endif +#ifdef GL_NV_shadow_samplers_array + "GL_NV_shadow_samplers_array", +#endif +#ifdef GL_NV_shadow_samplers_cube + "GL_NV_shadow_samplers_cube", +#endif +#ifdef GL_NV_stereo_view_rendering + "GL_NV_stereo_view_rendering", +#endif +#ifdef GL_NV_tessellation_program5 + "GL_NV_tessellation_program5", +#endif +#ifdef GL_NV_texgen_emboss + "GL_NV_texgen_emboss", +#endif +#ifdef GL_NV_texgen_reflection + "GL_NV_texgen_reflection", +#endif +#ifdef GL_NV_texture_array + "GL_NV_texture_array", +#endif +#ifdef GL_NV_texture_barrier + "GL_NV_texture_barrier", +#endif +#ifdef GL_NV_texture_border_clamp + "GL_NV_texture_border_clamp", +#endif +#ifdef GL_NV_texture_compression_latc + "GL_NV_texture_compression_latc", +#endif +#ifdef GL_NV_texture_compression_s3tc + "GL_NV_texture_compression_s3tc", +#endif +#ifdef GL_NV_texture_compression_s3tc_update + "GL_NV_texture_compression_s3tc_update", +#endif +#ifdef GL_NV_texture_compression_vtc + "GL_NV_texture_compression_vtc", +#endif +#ifdef GL_NV_texture_env_combine4 + "GL_NV_texture_env_combine4", +#endif +#ifdef GL_NV_texture_expand_normal + "GL_NV_texture_expand_normal", +#endif +#ifdef GL_NV_texture_multisample + "GL_NV_texture_multisample", +#endif +#ifdef GL_NV_texture_npot_2D_mipmap + "GL_NV_texture_npot_2D_mipmap", +#endif +#ifdef GL_NV_texture_rectangle + "GL_NV_texture_rectangle", +#endif +#ifdef GL_NV_texture_rectangle_compressed + "GL_NV_texture_rectangle_compressed", +#endif +#ifdef GL_NV_texture_shader + "GL_NV_texture_shader", +#endif +#ifdef GL_NV_texture_shader2 + "GL_NV_texture_shader2", +#endif +#ifdef GL_NV_texture_shader3 + "GL_NV_texture_shader3", +#endif +#ifdef GL_NV_transform_feedback + "GL_NV_transform_feedback", +#endif +#ifdef GL_NV_transform_feedback2 + "GL_NV_transform_feedback2", +#endif +#ifdef GL_NV_uniform_buffer_unified_memory + "GL_NV_uniform_buffer_unified_memory", +#endif +#ifdef GL_NV_vdpau_interop + "GL_NV_vdpau_interop", +#endif +#ifdef GL_NV_vertex_array_range + "GL_NV_vertex_array_range", +#endif +#ifdef GL_NV_vertex_array_range2 + "GL_NV_vertex_array_range2", +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + "GL_NV_vertex_attrib_integer_64bit", +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + "GL_NV_vertex_buffer_unified_memory", +#endif +#ifdef GL_NV_vertex_program + "GL_NV_vertex_program", +#endif +#ifdef GL_NV_vertex_program1_1 + "GL_NV_vertex_program1_1", +#endif +#ifdef GL_NV_vertex_program2 + "GL_NV_vertex_program2", +#endif +#ifdef GL_NV_vertex_program2_option + "GL_NV_vertex_program2_option", +#endif +#ifdef GL_NV_vertex_program3 + "GL_NV_vertex_program3", +#endif +#ifdef GL_NV_vertex_program4 + "GL_NV_vertex_program4", +#endif +#ifdef GL_NV_video_capture + "GL_NV_video_capture", +#endif +#ifdef GL_NV_viewport_array + "GL_NV_viewport_array", +#endif +#ifdef GL_NV_viewport_array2 + "GL_NV_viewport_array2", +#endif +#ifdef GL_NV_viewport_swizzle + "GL_NV_viewport_swizzle", +#endif +#ifdef GL_OES_byte_coordinates + "GL_OES_byte_coordinates", +#endif +#ifdef GL_OML_interlace + "GL_OML_interlace", +#endif +#ifdef GL_OML_resample + "GL_OML_resample", +#endif +#ifdef GL_OML_subsample + "GL_OML_subsample", +#endif +#ifdef GL_OVR_multiview + "GL_OVR_multiview", +#endif +#ifdef GL_OVR_multiview2 + "GL_OVR_multiview2", +#endif +#ifdef GL_OVR_multiview_multisampled_render_to_texture + "GL_OVR_multiview_multisampled_render_to_texture", +#endif +#ifdef GL_PGI_misc_hints + "GL_PGI_misc_hints", +#endif +#ifdef GL_PGI_vertex_hints + "GL_PGI_vertex_hints", +#endif +#ifdef GL_QCOM_alpha_test + "GL_QCOM_alpha_test", +#endif +#ifdef GL_QCOM_binning_control + "GL_QCOM_binning_control", +#endif +#ifdef GL_QCOM_driver_control + "GL_QCOM_driver_control", +#endif +#ifdef GL_QCOM_extended_get + "GL_QCOM_extended_get", +#endif +#ifdef GL_QCOM_extended_get2 + "GL_QCOM_extended_get2", +#endif +#ifdef GL_QCOM_framebuffer_foveated + "GL_QCOM_framebuffer_foveated", +#endif +#ifdef GL_QCOM_perfmon_global_mode + "GL_QCOM_perfmon_global_mode", +#endif +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + "GL_QCOM_shader_framebuffer_fetch_noncoherent", +#endif +#ifdef GL_QCOM_tiled_rendering + "GL_QCOM_tiled_rendering", +#endif +#ifdef GL_QCOM_writeonly_rendering + "GL_QCOM_writeonly_rendering", +#endif +#ifdef GL_REGAL_ES1_0_compatibility + "GL_REGAL_ES1_0_compatibility", +#endif +#ifdef GL_REGAL_ES1_1_compatibility + "GL_REGAL_ES1_1_compatibility", +#endif +#ifdef GL_REGAL_enable + "GL_REGAL_enable", +#endif +#ifdef GL_REGAL_error_string + "GL_REGAL_error_string", +#endif +#ifdef GL_REGAL_extension_query + "GL_REGAL_extension_query", +#endif +#ifdef GL_REGAL_log + "GL_REGAL_log", +#endif +#ifdef GL_REGAL_proc_address + "GL_REGAL_proc_address", +#endif +#ifdef GL_REND_screen_coordinates + "GL_REND_screen_coordinates", +#endif +#ifdef GL_S3_s3tc + "GL_S3_s3tc", +#endif +#ifdef GL_SGIS_clip_band_hint + "GL_SGIS_clip_band_hint", +#endif +#ifdef GL_SGIS_color_range + "GL_SGIS_color_range", +#endif +#ifdef GL_SGIS_detail_texture + "GL_SGIS_detail_texture", +#endif +#ifdef GL_SGIS_fog_function + "GL_SGIS_fog_function", +#endif +#ifdef GL_SGIS_generate_mipmap + "GL_SGIS_generate_mipmap", +#endif +#ifdef GL_SGIS_line_texgen + "GL_SGIS_line_texgen", +#endif +#ifdef GL_SGIS_multisample + "GL_SGIS_multisample", +#endif +#ifdef GL_SGIS_multitexture + "GL_SGIS_multitexture", +#endif +#ifdef GL_SGIS_pixel_texture + "GL_SGIS_pixel_texture", +#endif +#ifdef GL_SGIS_point_line_texgen + "GL_SGIS_point_line_texgen", +#endif +#ifdef GL_SGIS_shared_multisample + "GL_SGIS_shared_multisample", +#endif +#ifdef GL_SGIS_sharpen_texture + "GL_SGIS_sharpen_texture", +#endif +#ifdef GL_SGIS_texture4D + "GL_SGIS_texture4D", +#endif +#ifdef GL_SGIS_texture_border_clamp + "GL_SGIS_texture_border_clamp", +#endif +#ifdef GL_SGIS_texture_edge_clamp + "GL_SGIS_texture_edge_clamp", +#endif +#ifdef GL_SGIS_texture_filter4 + "GL_SGIS_texture_filter4", +#endif +#ifdef GL_SGIS_texture_lod + "GL_SGIS_texture_lod", +#endif +#ifdef GL_SGIS_texture_select + "GL_SGIS_texture_select", +#endif +#ifdef GL_SGIX_async + "GL_SGIX_async", +#endif +#ifdef GL_SGIX_async_histogram + "GL_SGIX_async_histogram", +#endif +#ifdef GL_SGIX_async_pixel + "GL_SGIX_async_pixel", +#endif +#ifdef GL_SGIX_bali_g_instruments + "GL_SGIX_bali_g_instruments", +#endif +#ifdef GL_SGIX_bali_r_instruments + "GL_SGIX_bali_r_instruments", +#endif +#ifdef GL_SGIX_bali_timer_instruments + "GL_SGIX_bali_timer_instruments", +#endif +#ifdef GL_SGIX_blend_alpha_minmax + "GL_SGIX_blend_alpha_minmax", +#endif +#ifdef GL_SGIX_blend_cadd + "GL_SGIX_blend_cadd", +#endif +#ifdef GL_SGIX_blend_cmultiply + "GL_SGIX_blend_cmultiply", +#endif +#ifdef GL_SGIX_calligraphic_fragment + "GL_SGIX_calligraphic_fragment", +#endif +#ifdef GL_SGIX_clipmap + "GL_SGIX_clipmap", +#endif +#ifdef GL_SGIX_color_matrix_accuracy + "GL_SGIX_color_matrix_accuracy", +#endif +#ifdef GL_SGIX_color_table_index_mode + "GL_SGIX_color_table_index_mode", +#endif +#ifdef GL_SGIX_complex_polar + "GL_SGIX_complex_polar", +#endif +#ifdef GL_SGIX_convolution_accuracy + "GL_SGIX_convolution_accuracy", +#endif +#ifdef GL_SGIX_cube_map + "GL_SGIX_cube_map", +#endif +#ifdef GL_SGIX_cylinder_texgen + "GL_SGIX_cylinder_texgen", +#endif +#ifdef GL_SGIX_datapipe + "GL_SGIX_datapipe", +#endif +#ifdef GL_SGIX_decimation + "GL_SGIX_decimation", +#endif +#ifdef GL_SGIX_depth_pass_instrument + "GL_SGIX_depth_pass_instrument", +#endif +#ifdef GL_SGIX_depth_texture + "GL_SGIX_depth_texture", +#endif +#ifdef GL_SGIX_dvc + "GL_SGIX_dvc", +#endif +#ifdef GL_SGIX_flush_raster + "GL_SGIX_flush_raster", +#endif +#ifdef GL_SGIX_fog_blend + "GL_SGIX_fog_blend", +#endif +#ifdef GL_SGIX_fog_factor_to_alpha + "GL_SGIX_fog_factor_to_alpha", +#endif +#ifdef GL_SGIX_fog_layers + "GL_SGIX_fog_layers", +#endif +#ifdef GL_SGIX_fog_offset + "GL_SGIX_fog_offset", +#endif +#ifdef GL_SGIX_fog_patchy + "GL_SGIX_fog_patchy", +#endif +#ifdef GL_SGIX_fog_scale + "GL_SGIX_fog_scale", +#endif +#ifdef GL_SGIX_fog_texture + "GL_SGIX_fog_texture", +#endif +#ifdef GL_SGIX_fragment_lighting_space + "GL_SGIX_fragment_lighting_space", +#endif +#ifdef GL_SGIX_fragment_specular_lighting + "GL_SGIX_fragment_specular_lighting", +#endif +#ifdef GL_SGIX_fragments_instrument + "GL_SGIX_fragments_instrument", +#endif +#ifdef GL_SGIX_framezoom + "GL_SGIX_framezoom", +#endif +#ifdef GL_SGIX_icc_texture + "GL_SGIX_icc_texture", +#endif +#ifdef GL_SGIX_igloo_interface + "GL_SGIX_igloo_interface", +#endif +#ifdef GL_SGIX_image_compression + "GL_SGIX_image_compression", +#endif +#ifdef GL_SGIX_impact_pixel_texture + "GL_SGIX_impact_pixel_texture", +#endif +#ifdef GL_SGIX_instrument_error + "GL_SGIX_instrument_error", +#endif +#ifdef GL_SGIX_interlace + "GL_SGIX_interlace", +#endif +#ifdef GL_SGIX_ir_instrument1 + "GL_SGIX_ir_instrument1", +#endif +#ifdef GL_SGIX_line_quality_hint + "GL_SGIX_line_quality_hint", +#endif +#ifdef GL_SGIX_list_priority + "GL_SGIX_list_priority", +#endif +#ifdef GL_SGIX_mpeg1 + "GL_SGIX_mpeg1", +#endif +#ifdef GL_SGIX_mpeg2 + "GL_SGIX_mpeg2", +#endif +#ifdef GL_SGIX_nonlinear_lighting_pervertex + "GL_SGIX_nonlinear_lighting_pervertex", +#endif +#ifdef GL_SGIX_nurbs_eval + "GL_SGIX_nurbs_eval", +#endif +#ifdef GL_SGIX_occlusion_instrument + "GL_SGIX_occlusion_instrument", +#endif +#ifdef GL_SGIX_packed_6bytes + "GL_SGIX_packed_6bytes", +#endif +#ifdef GL_SGIX_pixel_texture + "GL_SGIX_pixel_texture", +#endif +#ifdef GL_SGIX_pixel_texture_bits + "GL_SGIX_pixel_texture_bits", +#endif +#ifdef GL_SGIX_pixel_texture_lod + "GL_SGIX_pixel_texture_lod", +#endif +#ifdef GL_SGIX_pixel_tiles + "GL_SGIX_pixel_tiles", +#endif +#ifdef GL_SGIX_polynomial_ffd + "GL_SGIX_polynomial_ffd", +#endif +#ifdef GL_SGIX_quad_mesh + "GL_SGIX_quad_mesh", +#endif +#ifdef GL_SGIX_reference_plane + "GL_SGIX_reference_plane", +#endif +#ifdef GL_SGIX_resample + "GL_SGIX_resample", +#endif +#ifdef GL_SGIX_scalebias_hint + "GL_SGIX_scalebias_hint", +#endif +#ifdef GL_SGIX_shadow + "GL_SGIX_shadow", +#endif +#ifdef GL_SGIX_shadow_ambient + "GL_SGIX_shadow_ambient", +#endif +#ifdef GL_SGIX_slim + "GL_SGIX_slim", +#endif +#ifdef GL_SGIX_spotlight_cutoff + "GL_SGIX_spotlight_cutoff", +#endif +#ifdef GL_SGIX_sprite + "GL_SGIX_sprite", +#endif +#ifdef GL_SGIX_subdiv_patch + "GL_SGIX_subdiv_patch", +#endif +#ifdef GL_SGIX_subsample + "GL_SGIX_subsample", +#endif +#ifdef GL_SGIX_tag_sample_buffer + "GL_SGIX_tag_sample_buffer", +#endif +#ifdef GL_SGIX_texture_add_env + "GL_SGIX_texture_add_env", +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + "GL_SGIX_texture_coordinate_clamp", +#endif +#ifdef GL_SGIX_texture_lod_bias + "GL_SGIX_texture_lod_bias", +#endif +#ifdef GL_SGIX_texture_mipmap_anisotropic + "GL_SGIX_texture_mipmap_anisotropic", +#endif +#ifdef GL_SGIX_texture_multi_buffer + "GL_SGIX_texture_multi_buffer", +#endif +#ifdef GL_SGIX_texture_phase + "GL_SGIX_texture_phase", +#endif +#ifdef GL_SGIX_texture_range + "GL_SGIX_texture_range", +#endif +#ifdef GL_SGIX_texture_scale_bias + "GL_SGIX_texture_scale_bias", +#endif +#ifdef GL_SGIX_texture_supersample + "GL_SGIX_texture_supersample", +#endif +#ifdef GL_SGIX_vector_ops + "GL_SGIX_vector_ops", +#endif +#ifdef GL_SGIX_vertex_array_object + "GL_SGIX_vertex_array_object", +#endif +#ifdef GL_SGIX_vertex_preclip + "GL_SGIX_vertex_preclip", +#endif +#ifdef GL_SGIX_vertex_preclip_hint + "GL_SGIX_vertex_preclip_hint", +#endif +#ifdef GL_SGIX_ycrcb + "GL_SGIX_ycrcb", +#endif +#ifdef GL_SGIX_ycrcb_subsample + "GL_SGIX_ycrcb_subsample", +#endif +#ifdef GL_SGIX_ycrcba + "GL_SGIX_ycrcba", +#endif +#ifdef GL_SGI_color_matrix + "GL_SGI_color_matrix", +#endif +#ifdef GL_SGI_color_table + "GL_SGI_color_table", +#endif +#ifdef GL_SGI_complex + "GL_SGI_complex", +#endif +#ifdef GL_SGI_complex_type + "GL_SGI_complex_type", +#endif +#ifdef GL_SGI_fft + "GL_SGI_fft", +#endif +#ifdef GL_SGI_texture_color_table + "GL_SGI_texture_color_table", +#endif +#ifdef GL_SUNX_constant_data + "GL_SUNX_constant_data", +#endif +#ifdef GL_SUN_convolution_border_modes + "GL_SUN_convolution_border_modes", +#endif +#ifdef GL_SUN_global_alpha + "GL_SUN_global_alpha", +#endif +#ifdef GL_SUN_mesh_array + "GL_SUN_mesh_array", +#endif +#ifdef GL_SUN_read_video_pixels + "GL_SUN_read_video_pixels", +#endif +#ifdef GL_SUN_slice_accum + "GL_SUN_slice_accum", +#endif +#ifdef GL_SUN_triangle_list + "GL_SUN_triangle_list", +#endif +#ifdef GL_SUN_vertex + "GL_SUN_vertex", +#endif +#ifdef GL_WIN_phong_shading + "GL_WIN_phong_shading", +#endif +#ifdef GL_WIN_scene_markerXXX + "GL_WIN_scene_markerXXX", +#endif +#ifdef GL_WIN_specular_fog + "GL_WIN_specular_fog", +#endif +#ifdef GL_WIN_swap_hint + "GL_WIN_swap_hint", +#endif + NULL +}; + +/* Detected in the extension string or strings */ +static GLboolean _glewExtensionString[801]; +/* Detected via extension string or experimental mode */ +static GLboolean* _glewExtensionEnabled[] = { +#ifdef GL_VERSION_1_2 + &__GLEW_VERSION_1_2, +#endif +#ifdef GL_VERSION_1_2_1 + &__GLEW_VERSION_1_2_1, +#endif +#ifdef GL_VERSION_1_3 + &__GLEW_VERSION_1_3, +#endif +#ifdef GL_VERSION_1_4 + &__GLEW_VERSION_1_4, +#endif +#ifdef GL_VERSION_1_5 + &__GLEW_VERSION_1_5, +#endif +#ifdef GL_VERSION_2_0 + &__GLEW_VERSION_2_0, +#endif +#ifdef GL_VERSION_2_1 + &__GLEW_VERSION_2_1, +#endif +#ifdef GL_VERSION_3_0 + &__GLEW_VERSION_3_0, +#endif +#ifdef GL_VERSION_3_1 + &__GLEW_VERSION_3_1, +#endif +#ifdef GL_VERSION_3_2 + &__GLEW_VERSION_3_2, +#endif +#ifdef GL_VERSION_3_3 + &__GLEW_VERSION_3_3, +#endif +#ifdef GL_VERSION_4_0 + &__GLEW_VERSION_4_0, +#endif +#ifdef GL_VERSION_4_1 + &__GLEW_VERSION_4_1, +#endif +#ifdef GL_VERSION_4_2 + &__GLEW_VERSION_4_2, +#endif +#ifdef GL_VERSION_4_3 + &__GLEW_VERSION_4_3, +#endif +#ifdef GL_VERSION_4_4 + &__GLEW_VERSION_4_4, +#endif +#ifdef GL_VERSION_4_5 + &__GLEW_VERSION_4_5, +#endif +#ifdef GL_VERSION_4_6 + &__GLEW_VERSION_4_6, +#endif +#ifdef GL_3DFX_multisample + &__GLEW_3DFX_multisample, +#endif +#ifdef GL_3DFX_tbuffer + &__GLEW_3DFX_tbuffer, +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + &__GLEW_3DFX_texture_compression_FXT1, +#endif +#ifdef GL_AMD_blend_minmax_factor + &__GLEW_AMD_blend_minmax_factor, +#endif +#ifdef GL_AMD_compressed_3DC_texture + &__GLEW_AMD_compressed_3DC_texture, +#endif +#ifdef GL_AMD_compressed_ATC_texture + &__GLEW_AMD_compressed_ATC_texture, +#endif +#ifdef GL_AMD_conservative_depth + &__GLEW_AMD_conservative_depth, +#endif +#ifdef GL_AMD_debug_output + &__GLEW_AMD_debug_output, +#endif +#ifdef GL_AMD_depth_clamp_separate + &__GLEW_AMD_depth_clamp_separate, +#endif +#ifdef GL_AMD_draw_buffers_blend + &__GLEW_AMD_draw_buffers_blend, +#endif +#ifdef GL_AMD_framebuffer_sample_positions + &__GLEW_AMD_framebuffer_sample_positions, +#endif +#ifdef GL_AMD_gcn_shader + &__GLEW_AMD_gcn_shader, +#endif +#ifdef GL_AMD_gpu_shader_half_float + &__GLEW_AMD_gpu_shader_half_float, +#endif +#ifdef GL_AMD_gpu_shader_int16 + &__GLEW_AMD_gpu_shader_int16, +#endif +#ifdef GL_AMD_gpu_shader_int64 + &__GLEW_AMD_gpu_shader_int64, +#endif +#ifdef GL_AMD_interleaved_elements + &__GLEW_AMD_interleaved_elements, +#endif +#ifdef GL_AMD_multi_draw_indirect + &__GLEW_AMD_multi_draw_indirect, +#endif +#ifdef GL_AMD_name_gen_delete + &__GLEW_AMD_name_gen_delete, +#endif +#ifdef GL_AMD_occlusion_query_event + &__GLEW_AMD_occlusion_query_event, +#endif +#ifdef GL_AMD_performance_monitor + &__GLEW_AMD_performance_monitor, +#endif +#ifdef GL_AMD_pinned_memory + &__GLEW_AMD_pinned_memory, +#endif +#ifdef GL_AMD_program_binary_Z400 + &__GLEW_AMD_program_binary_Z400, +#endif +#ifdef GL_AMD_query_buffer_object + &__GLEW_AMD_query_buffer_object, +#endif +#ifdef GL_AMD_sample_positions + &__GLEW_AMD_sample_positions, +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + &__GLEW_AMD_seamless_cubemap_per_texture, +#endif +#ifdef GL_AMD_shader_atomic_counter_ops + &__GLEW_AMD_shader_atomic_counter_ops, +#endif +#ifdef GL_AMD_shader_ballot + &__GLEW_AMD_shader_ballot, +#endif +#ifdef GL_AMD_shader_explicit_vertex_parameter + &__GLEW_AMD_shader_explicit_vertex_parameter, +#endif +#ifdef GL_AMD_shader_stencil_export + &__GLEW_AMD_shader_stencil_export, +#endif +#ifdef GL_AMD_shader_stencil_value_export + &__GLEW_AMD_shader_stencil_value_export, +#endif +#ifdef GL_AMD_shader_trinary_minmax + &__GLEW_AMD_shader_trinary_minmax, +#endif +#ifdef GL_AMD_sparse_texture + &__GLEW_AMD_sparse_texture, +#endif +#ifdef GL_AMD_stencil_operation_extended + &__GLEW_AMD_stencil_operation_extended, +#endif +#ifdef GL_AMD_texture_gather_bias_lod + &__GLEW_AMD_texture_gather_bias_lod, +#endif +#ifdef GL_AMD_texture_texture4 + &__GLEW_AMD_texture_texture4, +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + &__GLEW_AMD_transform_feedback3_lines_triangles, +#endif +#ifdef GL_AMD_transform_feedback4 + &__GLEW_AMD_transform_feedback4, +#endif +#ifdef GL_AMD_vertex_shader_layer + &__GLEW_AMD_vertex_shader_layer, +#endif +#ifdef GL_AMD_vertex_shader_tessellator + &__GLEW_AMD_vertex_shader_tessellator, +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + &__GLEW_AMD_vertex_shader_viewport_index, +#endif +#ifdef GL_ANDROID_extension_pack_es31a + &__GLEW_ANDROID_extension_pack_es31a, +#endif +#ifdef GL_ANGLE_depth_texture + &__GLEW_ANGLE_depth_texture, +#endif +#ifdef GL_ANGLE_framebuffer_blit + &__GLEW_ANGLE_framebuffer_blit, +#endif +#ifdef GL_ANGLE_framebuffer_multisample + &__GLEW_ANGLE_framebuffer_multisample, +#endif +#ifdef GL_ANGLE_instanced_arrays + &__GLEW_ANGLE_instanced_arrays, +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + &__GLEW_ANGLE_pack_reverse_row_order, +#endif +#ifdef GL_ANGLE_program_binary + &__GLEW_ANGLE_program_binary, +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + &__GLEW_ANGLE_texture_compression_dxt1, +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + &__GLEW_ANGLE_texture_compression_dxt3, +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + &__GLEW_ANGLE_texture_compression_dxt5, +#endif +#ifdef GL_ANGLE_texture_usage + &__GLEW_ANGLE_texture_usage, +#endif +#ifdef GL_ANGLE_timer_query + &__GLEW_ANGLE_timer_query, +#endif +#ifdef GL_ANGLE_translated_shader_source + &__GLEW_ANGLE_translated_shader_source, +#endif +#ifdef GL_APPLE_aux_depth_stencil + &__GLEW_APPLE_aux_depth_stencil, +#endif +#ifdef GL_APPLE_client_storage + &__GLEW_APPLE_client_storage, +#endif +#ifdef GL_APPLE_clip_distance + &__GLEW_APPLE_clip_distance, +#endif +#ifdef GL_APPLE_color_buffer_packed_float + &__GLEW_APPLE_color_buffer_packed_float, +#endif +#ifdef GL_APPLE_copy_texture_levels + &__GLEW_APPLE_copy_texture_levels, +#endif +#ifdef GL_APPLE_element_array + &__GLEW_APPLE_element_array, +#endif +#ifdef GL_APPLE_fence + &__GLEW_APPLE_fence, +#endif +#ifdef GL_APPLE_float_pixels + &__GLEW_APPLE_float_pixels, +#endif +#ifdef GL_APPLE_flush_buffer_range + &__GLEW_APPLE_flush_buffer_range, +#endif +#ifdef GL_APPLE_framebuffer_multisample + &__GLEW_APPLE_framebuffer_multisample, +#endif +#ifdef GL_APPLE_object_purgeable + &__GLEW_APPLE_object_purgeable, +#endif +#ifdef GL_APPLE_pixel_buffer + &__GLEW_APPLE_pixel_buffer, +#endif +#ifdef GL_APPLE_rgb_422 + &__GLEW_APPLE_rgb_422, +#endif +#ifdef GL_APPLE_row_bytes + &__GLEW_APPLE_row_bytes, +#endif +#ifdef GL_APPLE_specular_vector + &__GLEW_APPLE_specular_vector, +#endif +#ifdef GL_APPLE_sync + &__GLEW_APPLE_sync, +#endif +#ifdef GL_APPLE_texture_2D_limited_npot + &__GLEW_APPLE_texture_2D_limited_npot, +#endif +#ifdef GL_APPLE_texture_format_BGRA8888 + &__GLEW_APPLE_texture_format_BGRA8888, +#endif +#ifdef GL_APPLE_texture_max_level + &__GLEW_APPLE_texture_max_level, +#endif +#ifdef GL_APPLE_texture_packed_float + &__GLEW_APPLE_texture_packed_float, +#endif +#ifdef GL_APPLE_texture_range + &__GLEW_APPLE_texture_range, +#endif +#ifdef GL_APPLE_transform_hint + &__GLEW_APPLE_transform_hint, +#endif +#ifdef GL_APPLE_vertex_array_object + &__GLEW_APPLE_vertex_array_object, +#endif +#ifdef GL_APPLE_vertex_array_range + &__GLEW_APPLE_vertex_array_range, +#endif +#ifdef GL_APPLE_vertex_program_evaluators + &__GLEW_APPLE_vertex_program_evaluators, +#endif +#ifdef GL_APPLE_ycbcr_422 + &__GLEW_APPLE_ycbcr_422, +#endif +#ifdef GL_ARB_ES2_compatibility + &__GLEW_ARB_ES2_compatibility, +#endif +#ifdef GL_ARB_ES3_1_compatibility + &__GLEW_ARB_ES3_1_compatibility, +#endif +#ifdef GL_ARB_ES3_2_compatibility + &__GLEW_ARB_ES3_2_compatibility, +#endif +#ifdef GL_ARB_ES3_compatibility + &__GLEW_ARB_ES3_compatibility, +#endif +#ifdef GL_ARB_arrays_of_arrays + &__GLEW_ARB_arrays_of_arrays, +#endif +#ifdef GL_ARB_base_instance + &__GLEW_ARB_base_instance, +#endif +#ifdef GL_ARB_bindless_texture + &__GLEW_ARB_bindless_texture, +#endif +#ifdef GL_ARB_blend_func_extended + &__GLEW_ARB_blend_func_extended, +#endif +#ifdef GL_ARB_buffer_storage + &__GLEW_ARB_buffer_storage, +#endif +#ifdef GL_ARB_cl_event + &__GLEW_ARB_cl_event, +#endif +#ifdef GL_ARB_clear_buffer_object + &__GLEW_ARB_clear_buffer_object, +#endif +#ifdef GL_ARB_clear_texture + &__GLEW_ARB_clear_texture, +#endif +#ifdef GL_ARB_clip_control + &__GLEW_ARB_clip_control, +#endif +#ifdef GL_ARB_color_buffer_float + &__GLEW_ARB_color_buffer_float, +#endif +#ifdef GL_ARB_compatibility + &__GLEW_ARB_compatibility, +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + &__GLEW_ARB_compressed_texture_pixel_storage, +#endif +#ifdef GL_ARB_compute_shader + &__GLEW_ARB_compute_shader, +#endif +#ifdef GL_ARB_compute_variable_group_size + &__GLEW_ARB_compute_variable_group_size, +#endif +#ifdef GL_ARB_conditional_render_inverted + &__GLEW_ARB_conditional_render_inverted, +#endif +#ifdef GL_ARB_conservative_depth + &__GLEW_ARB_conservative_depth, +#endif +#ifdef GL_ARB_copy_buffer + &__GLEW_ARB_copy_buffer, +#endif +#ifdef GL_ARB_copy_image + &__GLEW_ARB_copy_image, +#endif +#ifdef GL_ARB_cull_distance + &__GLEW_ARB_cull_distance, +#endif +#ifdef GL_ARB_debug_output + &__GLEW_ARB_debug_output, +#endif +#ifdef GL_ARB_depth_buffer_float + &__GLEW_ARB_depth_buffer_float, +#endif +#ifdef GL_ARB_depth_clamp + &__GLEW_ARB_depth_clamp, +#endif +#ifdef GL_ARB_depth_texture + &__GLEW_ARB_depth_texture, +#endif +#ifdef GL_ARB_derivative_control + &__GLEW_ARB_derivative_control, +#endif +#ifdef GL_ARB_direct_state_access + &__GLEW_ARB_direct_state_access, +#endif +#ifdef GL_ARB_draw_buffers + &__GLEW_ARB_draw_buffers, +#endif +#ifdef GL_ARB_draw_buffers_blend + &__GLEW_ARB_draw_buffers_blend, +#endif +#ifdef GL_ARB_draw_elements_base_vertex + &__GLEW_ARB_draw_elements_base_vertex, +#endif +#ifdef GL_ARB_draw_indirect + &__GLEW_ARB_draw_indirect, +#endif +#ifdef GL_ARB_draw_instanced + &__GLEW_ARB_draw_instanced, +#endif +#ifdef GL_ARB_enhanced_layouts + &__GLEW_ARB_enhanced_layouts, +#endif +#ifdef GL_ARB_explicit_attrib_location + &__GLEW_ARB_explicit_attrib_location, +#endif +#ifdef GL_ARB_explicit_uniform_location + &__GLEW_ARB_explicit_uniform_location, +#endif +#ifdef GL_ARB_fragment_coord_conventions + &__GLEW_ARB_fragment_coord_conventions, +#endif +#ifdef GL_ARB_fragment_layer_viewport + &__GLEW_ARB_fragment_layer_viewport, +#endif +#ifdef GL_ARB_fragment_program + &__GLEW_ARB_fragment_program, +#endif +#ifdef GL_ARB_fragment_program_shadow + &__GLEW_ARB_fragment_program_shadow, +#endif +#ifdef GL_ARB_fragment_shader + &__GLEW_ARB_fragment_shader, +#endif +#ifdef GL_ARB_fragment_shader_interlock + &__GLEW_ARB_fragment_shader_interlock, +#endif +#ifdef GL_ARB_framebuffer_no_attachments + &__GLEW_ARB_framebuffer_no_attachments, +#endif +#ifdef GL_ARB_framebuffer_object + &__GLEW_ARB_framebuffer_object, +#endif +#ifdef GL_ARB_framebuffer_sRGB + &__GLEW_ARB_framebuffer_sRGB, +#endif +#ifdef GL_ARB_geometry_shader4 + &__GLEW_ARB_geometry_shader4, +#endif +#ifdef GL_ARB_get_program_binary + &__GLEW_ARB_get_program_binary, +#endif +#ifdef GL_ARB_get_texture_sub_image + &__GLEW_ARB_get_texture_sub_image, +#endif +#ifdef GL_ARB_gl_spirv + &__GLEW_ARB_gl_spirv, +#endif +#ifdef GL_ARB_gpu_shader5 + &__GLEW_ARB_gpu_shader5, +#endif +#ifdef GL_ARB_gpu_shader_fp64 + &__GLEW_ARB_gpu_shader_fp64, +#endif +#ifdef GL_ARB_gpu_shader_int64 + &__GLEW_ARB_gpu_shader_int64, +#endif +#ifdef GL_ARB_half_float_pixel + &__GLEW_ARB_half_float_pixel, +#endif +#ifdef GL_ARB_half_float_vertex + &__GLEW_ARB_half_float_vertex, +#endif +#ifdef GL_ARB_imaging + &__GLEW_ARB_imaging, +#endif +#ifdef GL_ARB_indirect_parameters + &__GLEW_ARB_indirect_parameters, +#endif +#ifdef GL_ARB_instanced_arrays + &__GLEW_ARB_instanced_arrays, +#endif +#ifdef GL_ARB_internalformat_query + &__GLEW_ARB_internalformat_query, +#endif +#ifdef GL_ARB_internalformat_query2 + &__GLEW_ARB_internalformat_query2, +#endif +#ifdef GL_ARB_invalidate_subdata + &__GLEW_ARB_invalidate_subdata, +#endif +#ifdef GL_ARB_map_buffer_alignment + &__GLEW_ARB_map_buffer_alignment, +#endif +#ifdef GL_ARB_map_buffer_range + &__GLEW_ARB_map_buffer_range, +#endif +#ifdef GL_ARB_matrix_palette + &__GLEW_ARB_matrix_palette, +#endif +#ifdef GL_ARB_multi_bind + &__GLEW_ARB_multi_bind, +#endif +#ifdef GL_ARB_multi_draw_indirect + &__GLEW_ARB_multi_draw_indirect, +#endif +#ifdef GL_ARB_multisample + &__GLEW_ARB_multisample, +#endif +#ifdef GL_ARB_multitexture + &__GLEW_ARB_multitexture, +#endif +#ifdef GL_ARB_occlusion_query + &__GLEW_ARB_occlusion_query, +#endif +#ifdef GL_ARB_occlusion_query2 + &__GLEW_ARB_occlusion_query2, +#endif +#ifdef GL_ARB_parallel_shader_compile + &__GLEW_ARB_parallel_shader_compile, +#endif +#ifdef GL_ARB_pipeline_statistics_query + &__GLEW_ARB_pipeline_statistics_query, +#endif +#ifdef GL_ARB_pixel_buffer_object + &__GLEW_ARB_pixel_buffer_object, +#endif +#ifdef GL_ARB_point_parameters + &__GLEW_ARB_point_parameters, +#endif +#ifdef GL_ARB_point_sprite + &__GLEW_ARB_point_sprite, +#endif +#ifdef GL_ARB_polygon_offset_clamp + &__GLEW_ARB_polygon_offset_clamp, +#endif +#ifdef GL_ARB_post_depth_coverage + &__GLEW_ARB_post_depth_coverage, +#endif +#ifdef GL_ARB_program_interface_query + &__GLEW_ARB_program_interface_query, +#endif +#ifdef GL_ARB_provoking_vertex + &__GLEW_ARB_provoking_vertex, +#endif +#ifdef GL_ARB_query_buffer_object + &__GLEW_ARB_query_buffer_object, +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + &__GLEW_ARB_robust_buffer_access_behavior, +#endif +#ifdef GL_ARB_robustness + &__GLEW_ARB_robustness, +#endif +#ifdef GL_ARB_robustness_application_isolation + &__GLEW_ARB_robustness_application_isolation, +#endif +#ifdef GL_ARB_robustness_share_group_isolation + &__GLEW_ARB_robustness_share_group_isolation, +#endif +#ifdef GL_ARB_sample_locations + &__GLEW_ARB_sample_locations, +#endif +#ifdef GL_ARB_sample_shading + &__GLEW_ARB_sample_shading, +#endif +#ifdef GL_ARB_sampler_objects + &__GLEW_ARB_sampler_objects, +#endif +#ifdef GL_ARB_seamless_cube_map + &__GLEW_ARB_seamless_cube_map, +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + &__GLEW_ARB_seamless_cubemap_per_texture, +#endif +#ifdef GL_ARB_separate_shader_objects + &__GLEW_ARB_separate_shader_objects, +#endif +#ifdef GL_ARB_shader_atomic_counter_ops + &__GLEW_ARB_shader_atomic_counter_ops, +#endif +#ifdef GL_ARB_shader_atomic_counters + &__GLEW_ARB_shader_atomic_counters, +#endif +#ifdef GL_ARB_shader_ballot + &__GLEW_ARB_shader_ballot, +#endif +#ifdef GL_ARB_shader_bit_encoding + &__GLEW_ARB_shader_bit_encoding, +#endif +#ifdef GL_ARB_shader_clock + &__GLEW_ARB_shader_clock, +#endif +#ifdef GL_ARB_shader_draw_parameters + &__GLEW_ARB_shader_draw_parameters, +#endif +#ifdef GL_ARB_shader_group_vote + &__GLEW_ARB_shader_group_vote, +#endif +#ifdef GL_ARB_shader_image_load_store + &__GLEW_ARB_shader_image_load_store, +#endif +#ifdef GL_ARB_shader_image_size + &__GLEW_ARB_shader_image_size, +#endif +#ifdef GL_ARB_shader_objects + &__GLEW_ARB_shader_objects, +#endif +#ifdef GL_ARB_shader_precision + &__GLEW_ARB_shader_precision, +#endif +#ifdef GL_ARB_shader_stencil_export + &__GLEW_ARB_shader_stencil_export, +#endif +#ifdef GL_ARB_shader_storage_buffer_object + &__GLEW_ARB_shader_storage_buffer_object, +#endif +#ifdef GL_ARB_shader_subroutine + &__GLEW_ARB_shader_subroutine, +#endif +#ifdef GL_ARB_shader_texture_image_samples + &__GLEW_ARB_shader_texture_image_samples, +#endif +#ifdef GL_ARB_shader_texture_lod + &__GLEW_ARB_shader_texture_lod, +#endif +#ifdef GL_ARB_shader_viewport_layer_array + &__GLEW_ARB_shader_viewport_layer_array, +#endif +#ifdef GL_ARB_shading_language_100 + &__GLEW_ARB_shading_language_100, +#endif +#ifdef GL_ARB_shading_language_420pack + &__GLEW_ARB_shading_language_420pack, +#endif +#ifdef GL_ARB_shading_language_include + &__GLEW_ARB_shading_language_include, +#endif +#ifdef GL_ARB_shading_language_packing + &__GLEW_ARB_shading_language_packing, +#endif +#ifdef GL_ARB_shadow + &__GLEW_ARB_shadow, +#endif +#ifdef GL_ARB_shadow_ambient + &__GLEW_ARB_shadow_ambient, +#endif +#ifdef GL_ARB_sparse_buffer + &__GLEW_ARB_sparse_buffer, +#endif +#ifdef GL_ARB_sparse_texture + &__GLEW_ARB_sparse_texture, +#endif +#ifdef GL_ARB_sparse_texture2 + &__GLEW_ARB_sparse_texture2, +#endif +#ifdef GL_ARB_sparse_texture_clamp + &__GLEW_ARB_sparse_texture_clamp, +#endif +#ifdef GL_ARB_spirv_extensions + &__GLEW_ARB_spirv_extensions, +#endif +#ifdef GL_ARB_stencil_texturing + &__GLEW_ARB_stencil_texturing, +#endif +#ifdef GL_ARB_sync + &__GLEW_ARB_sync, +#endif +#ifdef GL_ARB_tessellation_shader + &__GLEW_ARB_tessellation_shader, +#endif +#ifdef GL_ARB_texture_barrier + &__GLEW_ARB_texture_barrier, +#endif +#ifdef GL_ARB_texture_border_clamp + &__GLEW_ARB_texture_border_clamp, +#endif +#ifdef GL_ARB_texture_buffer_object + &__GLEW_ARB_texture_buffer_object, +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + &__GLEW_ARB_texture_buffer_object_rgb32, +#endif +#ifdef GL_ARB_texture_buffer_range + &__GLEW_ARB_texture_buffer_range, +#endif +#ifdef GL_ARB_texture_compression + &__GLEW_ARB_texture_compression, +#endif +#ifdef GL_ARB_texture_compression_bptc + &__GLEW_ARB_texture_compression_bptc, +#endif +#ifdef GL_ARB_texture_compression_rgtc + &__GLEW_ARB_texture_compression_rgtc, +#endif +#ifdef GL_ARB_texture_cube_map + &__GLEW_ARB_texture_cube_map, +#endif +#ifdef GL_ARB_texture_cube_map_array + &__GLEW_ARB_texture_cube_map_array, +#endif +#ifdef GL_ARB_texture_env_add + &__GLEW_ARB_texture_env_add, +#endif +#ifdef GL_ARB_texture_env_combine + &__GLEW_ARB_texture_env_combine, +#endif +#ifdef GL_ARB_texture_env_crossbar + &__GLEW_ARB_texture_env_crossbar, +#endif +#ifdef GL_ARB_texture_env_dot3 + &__GLEW_ARB_texture_env_dot3, +#endif +#ifdef GL_ARB_texture_filter_anisotropic + &__GLEW_ARB_texture_filter_anisotropic, +#endif +#ifdef GL_ARB_texture_filter_minmax + &__GLEW_ARB_texture_filter_minmax, +#endif +#ifdef GL_ARB_texture_float + &__GLEW_ARB_texture_float, +#endif +#ifdef GL_ARB_texture_gather + &__GLEW_ARB_texture_gather, +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + &__GLEW_ARB_texture_mirror_clamp_to_edge, +#endif +#ifdef GL_ARB_texture_mirrored_repeat + &__GLEW_ARB_texture_mirrored_repeat, +#endif +#ifdef GL_ARB_texture_multisample + &__GLEW_ARB_texture_multisample, +#endif +#ifdef GL_ARB_texture_non_power_of_two + &__GLEW_ARB_texture_non_power_of_two, +#endif +#ifdef GL_ARB_texture_query_levels + &__GLEW_ARB_texture_query_levels, +#endif +#ifdef GL_ARB_texture_query_lod + &__GLEW_ARB_texture_query_lod, +#endif +#ifdef GL_ARB_texture_rectangle + &__GLEW_ARB_texture_rectangle, +#endif +#ifdef GL_ARB_texture_rg + &__GLEW_ARB_texture_rg, +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + &__GLEW_ARB_texture_rgb10_a2ui, +#endif +#ifdef GL_ARB_texture_stencil8 + &__GLEW_ARB_texture_stencil8, +#endif +#ifdef GL_ARB_texture_storage + &__GLEW_ARB_texture_storage, +#endif +#ifdef GL_ARB_texture_storage_multisample + &__GLEW_ARB_texture_storage_multisample, +#endif +#ifdef GL_ARB_texture_swizzle + &__GLEW_ARB_texture_swizzle, +#endif +#ifdef GL_ARB_texture_view + &__GLEW_ARB_texture_view, +#endif +#ifdef GL_ARB_timer_query + &__GLEW_ARB_timer_query, +#endif +#ifdef GL_ARB_transform_feedback2 + &__GLEW_ARB_transform_feedback2, +#endif +#ifdef GL_ARB_transform_feedback3 + &__GLEW_ARB_transform_feedback3, +#endif +#ifdef GL_ARB_transform_feedback_instanced + &__GLEW_ARB_transform_feedback_instanced, +#endif +#ifdef GL_ARB_transform_feedback_overflow_query + &__GLEW_ARB_transform_feedback_overflow_query, +#endif +#ifdef GL_ARB_transpose_matrix + &__GLEW_ARB_transpose_matrix, +#endif +#ifdef GL_ARB_uniform_buffer_object + &__GLEW_ARB_uniform_buffer_object, +#endif +#ifdef GL_ARB_vertex_array_bgra + &__GLEW_ARB_vertex_array_bgra, +#endif +#ifdef GL_ARB_vertex_array_object + &__GLEW_ARB_vertex_array_object, +#endif +#ifdef GL_ARB_vertex_attrib_64bit + &__GLEW_ARB_vertex_attrib_64bit, +#endif +#ifdef GL_ARB_vertex_attrib_binding + &__GLEW_ARB_vertex_attrib_binding, +#endif +#ifdef GL_ARB_vertex_blend + &__GLEW_ARB_vertex_blend, +#endif +#ifdef GL_ARB_vertex_buffer_object + &__GLEW_ARB_vertex_buffer_object, +#endif +#ifdef GL_ARB_vertex_program + &__GLEW_ARB_vertex_program, +#endif +#ifdef GL_ARB_vertex_shader + &__GLEW_ARB_vertex_shader, +#endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + &__GLEW_ARB_vertex_type_10f_11f_11f_rev, +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + &__GLEW_ARB_vertex_type_2_10_10_10_rev, +#endif +#ifdef GL_ARB_viewport_array + &__GLEW_ARB_viewport_array, +#endif +#ifdef GL_ARB_window_pos + &__GLEW_ARB_window_pos, +#endif +#ifdef GL_ARM_mali_program_binary + &__GLEW_ARM_mali_program_binary, +#endif +#ifdef GL_ARM_mali_shader_binary + &__GLEW_ARM_mali_shader_binary, +#endif +#ifdef GL_ARM_rgba8 + &__GLEW_ARM_rgba8, +#endif +#ifdef GL_ARM_shader_framebuffer_fetch + &__GLEW_ARM_shader_framebuffer_fetch, +#endif +#ifdef GL_ARM_shader_framebuffer_fetch_depth_stencil + &__GLEW_ARM_shader_framebuffer_fetch_depth_stencil, +#endif +#ifdef GL_ATIX_point_sprites + &__GLEW_ATIX_point_sprites, +#endif +#ifdef GL_ATIX_texture_env_combine3 + &__GLEW_ATIX_texture_env_combine3, +#endif +#ifdef GL_ATIX_texture_env_route + &__GLEW_ATIX_texture_env_route, +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + &__GLEW_ATIX_vertex_shader_output_point_size, +#endif +#ifdef GL_ATI_draw_buffers + &__GLEW_ATI_draw_buffers, +#endif +#ifdef GL_ATI_element_array + &__GLEW_ATI_element_array, +#endif +#ifdef GL_ATI_envmap_bumpmap + &__GLEW_ATI_envmap_bumpmap, +#endif +#ifdef GL_ATI_fragment_shader + &__GLEW_ATI_fragment_shader, +#endif +#ifdef GL_ATI_map_object_buffer + &__GLEW_ATI_map_object_buffer, +#endif +#ifdef GL_ATI_meminfo + &__GLEW_ATI_meminfo, +#endif +#ifdef GL_ATI_pn_triangles + &__GLEW_ATI_pn_triangles, +#endif +#ifdef GL_ATI_separate_stencil + &__GLEW_ATI_separate_stencil, +#endif +#ifdef GL_ATI_shader_texture_lod + &__GLEW_ATI_shader_texture_lod, +#endif +#ifdef GL_ATI_text_fragment_shader + &__GLEW_ATI_text_fragment_shader, +#endif +#ifdef GL_ATI_texture_compression_3dc + &__GLEW_ATI_texture_compression_3dc, +#endif +#ifdef GL_ATI_texture_env_combine3 + &__GLEW_ATI_texture_env_combine3, +#endif +#ifdef GL_ATI_texture_float + &__GLEW_ATI_texture_float, +#endif +#ifdef GL_ATI_texture_mirror_once + &__GLEW_ATI_texture_mirror_once, +#endif +#ifdef GL_ATI_vertex_array_object + &__GLEW_ATI_vertex_array_object, +#endif +#ifdef GL_ATI_vertex_attrib_array_object + &__GLEW_ATI_vertex_attrib_array_object, +#endif +#ifdef GL_ATI_vertex_streams + &__GLEW_ATI_vertex_streams, +#endif +#ifdef GL_EGL_KHR_context_flush_control + &__GLEW_EGL_KHR_context_flush_control, +#endif +#ifdef GL_EGL_NV_robustness_video_memory_purge + &__GLEW_EGL_NV_robustness_video_memory_purge, +#endif +#ifdef GL_EXT_422_pixels + &__GLEW_EXT_422_pixels, +#endif +#ifdef GL_EXT_Cg_shader + &__GLEW_EXT_Cg_shader, +#endif +#ifdef GL_EXT_EGL_image_array + &__GLEW_EXT_EGL_image_array, +#endif +#ifdef GL_EXT_YUV_target + &__GLEW_EXT_YUV_target, +#endif +#ifdef GL_EXT_abgr + &__GLEW_EXT_abgr, +#endif +#ifdef GL_EXT_base_instance + &__GLEW_EXT_base_instance, +#endif +#ifdef GL_EXT_bgra + &__GLEW_EXT_bgra, +#endif +#ifdef GL_EXT_bindable_uniform + &__GLEW_EXT_bindable_uniform, +#endif +#ifdef GL_EXT_blend_color + &__GLEW_EXT_blend_color, +#endif +#ifdef GL_EXT_blend_equation_separate + &__GLEW_EXT_blend_equation_separate, +#endif +#ifdef GL_EXT_blend_func_extended + &__GLEW_EXT_blend_func_extended, +#endif +#ifdef GL_EXT_blend_func_separate + &__GLEW_EXT_blend_func_separate, +#endif +#ifdef GL_EXT_blend_logic_op + &__GLEW_EXT_blend_logic_op, +#endif +#ifdef GL_EXT_blend_minmax + &__GLEW_EXT_blend_minmax, +#endif +#ifdef GL_EXT_blend_subtract + &__GLEW_EXT_blend_subtract, +#endif +#ifdef GL_EXT_buffer_storage + &__GLEW_EXT_buffer_storage, +#endif +#ifdef GL_EXT_clear_texture + &__GLEW_EXT_clear_texture, +#endif +#ifdef GL_EXT_clip_cull_distance + &__GLEW_EXT_clip_cull_distance, +#endif +#ifdef GL_EXT_clip_volume_hint + &__GLEW_EXT_clip_volume_hint, +#endif +#ifdef GL_EXT_cmyka + &__GLEW_EXT_cmyka, +#endif +#ifdef GL_EXT_color_buffer_float + &__GLEW_EXT_color_buffer_float, +#endif +#ifdef GL_EXT_color_buffer_half_float + &__GLEW_EXT_color_buffer_half_float, +#endif +#ifdef GL_EXT_color_subtable + &__GLEW_EXT_color_subtable, +#endif +#ifdef GL_EXT_compiled_vertex_array + &__GLEW_EXT_compiled_vertex_array, +#endif +#ifdef GL_EXT_compressed_ETC1_RGB8_sub_texture + &__GLEW_EXT_compressed_ETC1_RGB8_sub_texture, +#endif +#ifdef GL_EXT_conservative_depth + &__GLEW_EXT_conservative_depth, +#endif +#ifdef GL_EXT_convolution + &__GLEW_EXT_convolution, +#endif +#ifdef GL_EXT_coordinate_frame + &__GLEW_EXT_coordinate_frame, +#endif +#ifdef GL_EXT_copy_image + &__GLEW_EXT_copy_image, +#endif +#ifdef GL_EXT_copy_texture + &__GLEW_EXT_copy_texture, +#endif +#ifdef GL_EXT_cull_vertex + &__GLEW_EXT_cull_vertex, +#endif +#ifdef GL_EXT_debug_label + &__GLEW_EXT_debug_label, +#endif +#ifdef GL_EXT_debug_marker + &__GLEW_EXT_debug_marker, +#endif +#ifdef GL_EXT_depth_bounds_test + &__GLEW_EXT_depth_bounds_test, +#endif +#ifdef GL_EXT_direct_state_access + &__GLEW_EXT_direct_state_access, +#endif +#ifdef GL_EXT_discard_framebuffer + &__GLEW_EXT_discard_framebuffer, +#endif +#ifdef GL_EXT_draw_buffers + &__GLEW_EXT_draw_buffers, +#endif +#ifdef GL_EXT_draw_buffers2 + &__GLEW_EXT_draw_buffers2, +#endif +#ifdef GL_EXT_draw_buffers_indexed + &__GLEW_EXT_draw_buffers_indexed, +#endif +#ifdef GL_EXT_draw_elements_base_vertex + &__GLEW_EXT_draw_elements_base_vertex, +#endif +#ifdef GL_EXT_draw_instanced + &__GLEW_EXT_draw_instanced, +#endif +#ifdef GL_EXT_draw_range_elements + &__GLEW_EXT_draw_range_elements, +#endif +#ifdef GL_EXT_external_buffer + &__GLEW_EXT_external_buffer, +#endif +#ifdef GL_EXT_float_blend + &__GLEW_EXT_float_blend, +#endif +#ifdef GL_EXT_fog_coord + &__GLEW_EXT_fog_coord, +#endif +#ifdef GL_EXT_frag_depth + &__GLEW_EXT_frag_depth, +#endif +#ifdef GL_EXT_fragment_lighting + &__GLEW_EXT_fragment_lighting, +#endif +#ifdef GL_EXT_framebuffer_blit + &__GLEW_EXT_framebuffer_blit, +#endif +#ifdef GL_EXT_framebuffer_multisample + &__GLEW_EXT_framebuffer_multisample, +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + &__GLEW_EXT_framebuffer_multisample_blit_scaled, +#endif +#ifdef GL_EXT_framebuffer_object + &__GLEW_EXT_framebuffer_object, +#endif +#ifdef GL_EXT_framebuffer_sRGB + &__GLEW_EXT_framebuffer_sRGB, +#endif +#ifdef GL_EXT_geometry_point_size + &__GLEW_EXT_geometry_point_size, +#endif +#ifdef GL_EXT_geometry_shader + &__GLEW_EXT_geometry_shader, +#endif +#ifdef GL_EXT_geometry_shader4 + &__GLEW_EXT_geometry_shader4, +#endif +#ifdef GL_EXT_gpu_program_parameters + &__GLEW_EXT_gpu_program_parameters, +#endif +#ifdef GL_EXT_gpu_shader4 + &__GLEW_EXT_gpu_shader4, +#endif +#ifdef GL_EXT_gpu_shader5 + &__GLEW_EXT_gpu_shader5, +#endif +#ifdef GL_EXT_histogram + &__GLEW_EXT_histogram, +#endif +#ifdef GL_EXT_index_array_formats + &__GLEW_EXT_index_array_formats, +#endif +#ifdef GL_EXT_index_func + &__GLEW_EXT_index_func, +#endif +#ifdef GL_EXT_index_material + &__GLEW_EXT_index_material, +#endif +#ifdef GL_EXT_index_texture + &__GLEW_EXT_index_texture, +#endif +#ifdef GL_EXT_instanced_arrays + &__GLEW_EXT_instanced_arrays, +#endif +#ifdef GL_EXT_light_texture + &__GLEW_EXT_light_texture, +#endif +#ifdef GL_EXT_map_buffer_range + &__GLEW_EXT_map_buffer_range, +#endif +#ifdef GL_EXT_memory_object + &__GLEW_EXT_memory_object, +#endif +#ifdef GL_EXT_memory_object_fd + &__GLEW_EXT_memory_object_fd, +#endif +#ifdef GL_EXT_memory_object_win32 + &__GLEW_EXT_memory_object_win32, +#endif +#ifdef GL_EXT_misc_attribute + &__GLEW_EXT_misc_attribute, +#endif +#ifdef GL_EXT_multi_draw_arrays + &__GLEW_EXT_multi_draw_arrays, +#endif +#ifdef GL_EXT_multi_draw_indirect + &__GLEW_EXT_multi_draw_indirect, +#endif +#ifdef GL_EXT_multiple_textures + &__GLEW_EXT_multiple_textures, +#endif +#ifdef GL_EXT_multisample + &__GLEW_EXT_multisample, +#endif +#ifdef GL_EXT_multisample_compatibility + &__GLEW_EXT_multisample_compatibility, +#endif +#ifdef GL_EXT_multisampled_render_to_texture + &__GLEW_EXT_multisampled_render_to_texture, +#endif +#ifdef GL_EXT_multisampled_render_to_texture2 + &__GLEW_EXT_multisampled_render_to_texture2, +#endif +#ifdef GL_EXT_multiview_draw_buffers + &__GLEW_EXT_multiview_draw_buffers, +#endif +#ifdef GL_EXT_packed_depth_stencil + &__GLEW_EXT_packed_depth_stencil, +#endif +#ifdef GL_EXT_packed_float + &__GLEW_EXT_packed_float, +#endif +#ifdef GL_EXT_packed_pixels + &__GLEW_EXT_packed_pixels, +#endif +#ifdef GL_EXT_paletted_texture + &__GLEW_EXT_paletted_texture, +#endif +#ifdef GL_EXT_pixel_buffer_object + &__GLEW_EXT_pixel_buffer_object, +#endif +#ifdef GL_EXT_pixel_transform + &__GLEW_EXT_pixel_transform, +#endif +#ifdef GL_EXT_pixel_transform_color_table + &__GLEW_EXT_pixel_transform_color_table, +#endif +#ifdef GL_EXT_point_parameters + &__GLEW_EXT_point_parameters, +#endif +#ifdef GL_EXT_polygon_offset + &__GLEW_EXT_polygon_offset, +#endif +#ifdef GL_EXT_polygon_offset_clamp + &__GLEW_EXT_polygon_offset_clamp, +#endif +#ifdef GL_EXT_post_depth_coverage + &__GLEW_EXT_post_depth_coverage, +#endif +#ifdef GL_EXT_provoking_vertex + &__GLEW_EXT_provoking_vertex, +#endif +#ifdef GL_EXT_pvrtc_sRGB + &__GLEW_EXT_pvrtc_sRGB, +#endif +#ifdef GL_EXT_raster_multisample + &__GLEW_EXT_raster_multisample, +#endif +#ifdef GL_EXT_read_format_bgra + &__GLEW_EXT_read_format_bgra, +#endif +#ifdef GL_EXT_render_snorm + &__GLEW_EXT_render_snorm, +#endif +#ifdef GL_EXT_rescale_normal + &__GLEW_EXT_rescale_normal, +#endif +#ifdef GL_EXT_sRGB + &__GLEW_EXT_sRGB, +#endif +#ifdef GL_EXT_sRGB_write_control + &__GLEW_EXT_sRGB_write_control, +#endif +#ifdef GL_EXT_scene_marker + &__GLEW_EXT_scene_marker, +#endif +#ifdef GL_EXT_secondary_color + &__GLEW_EXT_secondary_color, +#endif +#ifdef GL_EXT_semaphore + &__GLEW_EXT_semaphore, +#endif +#ifdef GL_EXT_semaphore_fd + &__GLEW_EXT_semaphore_fd, +#endif +#ifdef GL_EXT_semaphore_win32 + &__GLEW_EXT_semaphore_win32, +#endif +#ifdef GL_EXT_separate_shader_objects + &__GLEW_EXT_separate_shader_objects, +#endif +#ifdef GL_EXT_separate_specular_color + &__GLEW_EXT_separate_specular_color, +#endif +#ifdef GL_EXT_shader_framebuffer_fetch + &__GLEW_EXT_shader_framebuffer_fetch, +#endif +#ifdef GL_EXT_shader_group_vote + &__GLEW_EXT_shader_group_vote, +#endif +#ifdef GL_EXT_shader_image_load_formatted + &__GLEW_EXT_shader_image_load_formatted, +#endif +#ifdef GL_EXT_shader_image_load_store + &__GLEW_EXT_shader_image_load_store, +#endif +#ifdef GL_EXT_shader_implicit_conversions + &__GLEW_EXT_shader_implicit_conversions, +#endif +#ifdef GL_EXT_shader_integer_mix + &__GLEW_EXT_shader_integer_mix, +#endif +#ifdef GL_EXT_shader_io_blocks + &__GLEW_EXT_shader_io_blocks, +#endif +#ifdef GL_EXT_shader_non_constant_global_initializers + &__GLEW_EXT_shader_non_constant_global_initializers, +#endif +#ifdef GL_EXT_shader_pixel_local_storage + &__GLEW_EXT_shader_pixel_local_storage, +#endif +#ifdef GL_EXT_shader_pixel_local_storage2 + &__GLEW_EXT_shader_pixel_local_storage2, +#endif +#ifdef GL_EXT_shader_texture_lod + &__GLEW_EXT_shader_texture_lod, +#endif +#ifdef GL_EXT_shadow_funcs + &__GLEW_EXT_shadow_funcs, +#endif +#ifdef GL_EXT_shadow_samplers + &__GLEW_EXT_shadow_samplers, +#endif +#ifdef GL_EXT_shared_texture_palette + &__GLEW_EXT_shared_texture_palette, +#endif +#ifdef GL_EXT_sparse_texture + &__GLEW_EXT_sparse_texture, +#endif +#ifdef GL_EXT_sparse_texture2 + &__GLEW_EXT_sparse_texture2, +#endif +#ifdef GL_EXT_stencil_clear_tag + &__GLEW_EXT_stencil_clear_tag, +#endif +#ifdef GL_EXT_stencil_two_side + &__GLEW_EXT_stencil_two_side, +#endif +#ifdef GL_EXT_stencil_wrap + &__GLEW_EXT_stencil_wrap, +#endif +#ifdef GL_EXT_subtexture + &__GLEW_EXT_subtexture, +#endif +#ifdef GL_EXT_texture + &__GLEW_EXT_texture, +#endif +#ifdef GL_EXT_texture3D + &__GLEW_EXT_texture3D, +#endif +#ifdef GL_EXT_texture_array + &__GLEW_EXT_texture_array, +#endif +#ifdef GL_EXT_texture_buffer_object + &__GLEW_EXT_texture_buffer_object, +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode + &__GLEW_EXT_texture_compression_astc_decode_mode, +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + &__GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5, +#endif +#ifdef GL_EXT_texture_compression_bptc + &__GLEW_EXT_texture_compression_bptc, +#endif +#ifdef GL_EXT_texture_compression_dxt1 + &__GLEW_EXT_texture_compression_dxt1, +#endif +#ifdef GL_EXT_texture_compression_latc + &__GLEW_EXT_texture_compression_latc, +#endif +#ifdef GL_EXT_texture_compression_rgtc + &__GLEW_EXT_texture_compression_rgtc, +#endif +#ifdef GL_EXT_texture_compression_s3tc + &__GLEW_EXT_texture_compression_s3tc, +#endif +#ifdef GL_EXT_texture_cube_map + &__GLEW_EXT_texture_cube_map, +#endif +#ifdef GL_EXT_texture_cube_map_array + &__GLEW_EXT_texture_cube_map_array, +#endif +#ifdef GL_EXT_texture_edge_clamp + &__GLEW_EXT_texture_edge_clamp, +#endif +#ifdef GL_EXT_texture_env + &__GLEW_EXT_texture_env, +#endif +#ifdef GL_EXT_texture_env_add + &__GLEW_EXT_texture_env_add, +#endif +#ifdef GL_EXT_texture_env_combine + &__GLEW_EXT_texture_env_combine, +#endif +#ifdef GL_EXT_texture_env_dot3 + &__GLEW_EXT_texture_env_dot3, +#endif +#ifdef GL_EXT_texture_filter_anisotropic + &__GLEW_EXT_texture_filter_anisotropic, +#endif +#ifdef GL_EXT_texture_filter_minmax + &__GLEW_EXT_texture_filter_minmax, +#endif +#ifdef GL_EXT_texture_format_BGRA8888 + &__GLEW_EXT_texture_format_BGRA8888, +#endif +#ifdef GL_EXT_texture_integer + &__GLEW_EXT_texture_integer, +#endif +#ifdef GL_EXT_texture_lod_bias + &__GLEW_EXT_texture_lod_bias, +#endif +#ifdef GL_EXT_texture_mirror_clamp + &__GLEW_EXT_texture_mirror_clamp, +#endif +#ifdef GL_EXT_texture_norm16 + &__GLEW_EXT_texture_norm16, +#endif +#ifdef GL_EXT_texture_object + &__GLEW_EXT_texture_object, +#endif +#ifdef GL_EXT_texture_perturb_normal + &__GLEW_EXT_texture_perturb_normal, +#endif +#ifdef GL_EXT_texture_rectangle + &__GLEW_EXT_texture_rectangle, +#endif +#ifdef GL_EXT_texture_rg + &__GLEW_EXT_texture_rg, +#endif +#ifdef GL_EXT_texture_sRGB + &__GLEW_EXT_texture_sRGB, +#endif +#ifdef GL_EXT_texture_sRGB_R8 + &__GLEW_EXT_texture_sRGB_R8, +#endif +#ifdef GL_EXT_texture_sRGB_RG8 + &__GLEW_EXT_texture_sRGB_RG8, +#endif +#ifdef GL_EXT_texture_sRGB_decode + &__GLEW_EXT_texture_sRGB_decode, +#endif +#ifdef GL_EXT_texture_shared_exponent + &__GLEW_EXT_texture_shared_exponent, +#endif +#ifdef GL_EXT_texture_snorm + &__GLEW_EXT_texture_snorm, +#endif +#ifdef GL_EXT_texture_storage + &__GLEW_EXT_texture_storage, +#endif +#ifdef GL_EXT_texture_swizzle + &__GLEW_EXT_texture_swizzle, +#endif +#ifdef GL_EXT_texture_type_2_10_10_10_REV + &__GLEW_EXT_texture_type_2_10_10_10_REV, +#endif +#ifdef GL_EXT_texture_view + &__GLEW_EXT_texture_view, +#endif +#ifdef GL_EXT_timer_query + &__GLEW_EXT_timer_query, +#endif +#ifdef GL_EXT_transform_feedback + &__GLEW_EXT_transform_feedback, +#endif +#ifdef GL_EXT_unpack_subimage + &__GLEW_EXT_unpack_subimage, +#endif +#ifdef GL_EXT_vertex_array + &__GLEW_EXT_vertex_array, +#endif +#ifdef GL_EXT_vertex_array_bgra + &__GLEW_EXT_vertex_array_bgra, +#endif +#ifdef GL_EXT_vertex_array_setXXX + &__GLEW_EXT_vertex_array_setXXX, +#endif +#ifdef GL_EXT_vertex_attrib_64bit + &__GLEW_EXT_vertex_attrib_64bit, +#endif +#ifdef GL_EXT_vertex_shader + &__GLEW_EXT_vertex_shader, +#endif +#ifdef GL_EXT_vertex_weighting + &__GLEW_EXT_vertex_weighting, +#endif +#ifdef GL_EXT_win32_keyed_mutex + &__GLEW_EXT_win32_keyed_mutex, +#endif +#ifdef GL_EXT_window_rectangles + &__GLEW_EXT_window_rectangles, +#endif +#ifdef GL_EXT_x11_sync_object + &__GLEW_EXT_x11_sync_object, +#endif +#ifdef GL_GREMEDY_frame_terminator + &__GLEW_GREMEDY_frame_terminator, +#endif +#ifdef GL_GREMEDY_string_marker + &__GLEW_GREMEDY_string_marker, +#endif +#ifdef GL_HP_convolution_border_modes + &__GLEW_HP_convolution_border_modes, +#endif +#ifdef GL_HP_image_transform + &__GLEW_HP_image_transform, +#endif +#ifdef GL_HP_occlusion_test + &__GLEW_HP_occlusion_test, +#endif +#ifdef GL_HP_texture_lighting + &__GLEW_HP_texture_lighting, +#endif +#ifdef GL_IBM_cull_vertex + &__GLEW_IBM_cull_vertex, +#endif +#ifdef GL_IBM_multimode_draw_arrays + &__GLEW_IBM_multimode_draw_arrays, +#endif +#ifdef GL_IBM_rasterpos_clip + &__GLEW_IBM_rasterpos_clip, +#endif +#ifdef GL_IBM_static_data + &__GLEW_IBM_static_data, +#endif +#ifdef GL_IBM_texture_mirrored_repeat + &__GLEW_IBM_texture_mirrored_repeat, +#endif +#ifdef GL_IBM_vertex_array_lists + &__GLEW_IBM_vertex_array_lists, +#endif +#ifdef GL_INGR_color_clamp + &__GLEW_INGR_color_clamp, +#endif +#ifdef GL_INGR_interlace_read + &__GLEW_INGR_interlace_read, +#endif +#ifdef GL_INTEL_conservative_rasterization + &__GLEW_INTEL_conservative_rasterization, +#endif +#ifdef GL_INTEL_fragment_shader_ordering + &__GLEW_INTEL_fragment_shader_ordering, +#endif +#ifdef GL_INTEL_framebuffer_CMAA + &__GLEW_INTEL_framebuffer_CMAA, +#endif +#ifdef GL_INTEL_map_texture + &__GLEW_INTEL_map_texture, +#endif +#ifdef GL_INTEL_parallel_arrays + &__GLEW_INTEL_parallel_arrays, +#endif +#ifdef GL_INTEL_performance_query + &__GLEW_INTEL_performance_query, +#endif +#ifdef GL_INTEL_texture_scissor + &__GLEW_INTEL_texture_scissor, +#endif +#ifdef GL_KHR_blend_equation_advanced + &__GLEW_KHR_blend_equation_advanced, +#endif +#ifdef GL_KHR_blend_equation_advanced_coherent + &__GLEW_KHR_blend_equation_advanced_coherent, +#endif +#ifdef GL_KHR_context_flush_control + &__GLEW_KHR_context_flush_control, +#endif +#ifdef GL_KHR_debug + &__GLEW_KHR_debug, +#endif +#ifdef GL_KHR_no_error + &__GLEW_KHR_no_error, +#endif +#ifdef GL_KHR_parallel_shader_compile + &__GLEW_KHR_parallel_shader_compile, +#endif +#ifdef GL_KHR_robust_buffer_access_behavior + &__GLEW_KHR_robust_buffer_access_behavior, +#endif +#ifdef GL_KHR_robustness + &__GLEW_KHR_robustness, +#endif +#ifdef GL_KHR_texture_compression_astc_hdr + &__GLEW_KHR_texture_compression_astc_hdr, +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + &__GLEW_KHR_texture_compression_astc_ldr, +#endif +#ifdef GL_KHR_texture_compression_astc_sliced_3d + &__GLEW_KHR_texture_compression_astc_sliced_3d, +#endif +#ifdef GL_KTX_buffer_region + &__GLEW_KTX_buffer_region, +#endif +#ifdef GL_MESAX_texture_stack + &__GLEW_MESAX_texture_stack, +#endif +#ifdef GL_MESA_pack_invert + &__GLEW_MESA_pack_invert, +#endif +#ifdef GL_MESA_resize_buffers + &__GLEW_MESA_resize_buffers, +#endif +#ifdef GL_MESA_shader_integer_functions + &__GLEW_MESA_shader_integer_functions, +#endif +#ifdef GL_MESA_window_pos + &__GLEW_MESA_window_pos, +#endif +#ifdef GL_MESA_ycbcr_texture + &__GLEW_MESA_ycbcr_texture, +#endif +#ifdef GL_NVX_blend_equation_advanced_multi_draw_buffers + &__GLEW_NVX_blend_equation_advanced_multi_draw_buffers, +#endif +#ifdef GL_NVX_conditional_render + &__GLEW_NVX_conditional_render, +#endif +#ifdef GL_NVX_gpu_memory_info + &__GLEW_NVX_gpu_memory_info, +#endif +#ifdef GL_NVX_linked_gpu_multicast + &__GLEW_NVX_linked_gpu_multicast, +#endif +#ifdef GL_NV_3dvision_settings + &__GLEW_NV_3dvision_settings, +#endif +#ifdef GL_NV_EGL_stream_consumer_external + &__GLEW_NV_EGL_stream_consumer_external, +#endif +#ifdef GL_NV_alpha_to_coverage_dither_control + &__GLEW_NV_alpha_to_coverage_dither_control, +#endif +#ifdef GL_NV_bgr + &__GLEW_NV_bgr, +#endif +#ifdef GL_NV_bindless_multi_draw_indirect + &__GLEW_NV_bindless_multi_draw_indirect, +#endif +#ifdef GL_NV_bindless_multi_draw_indirect_count + &__GLEW_NV_bindless_multi_draw_indirect_count, +#endif +#ifdef GL_NV_bindless_texture + &__GLEW_NV_bindless_texture, +#endif +#ifdef GL_NV_blend_equation_advanced + &__GLEW_NV_blend_equation_advanced, +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + &__GLEW_NV_blend_equation_advanced_coherent, +#endif +#ifdef GL_NV_blend_minmax_factor + &__GLEW_NV_blend_minmax_factor, +#endif +#ifdef GL_NV_blend_square + &__GLEW_NV_blend_square, +#endif +#ifdef GL_NV_clip_space_w_scaling + &__GLEW_NV_clip_space_w_scaling, +#endif +#ifdef GL_NV_command_list + &__GLEW_NV_command_list, +#endif +#ifdef GL_NV_compute_program5 + &__GLEW_NV_compute_program5, +#endif +#ifdef GL_NV_conditional_render + &__GLEW_NV_conditional_render, +#endif +#ifdef GL_NV_conservative_raster + &__GLEW_NV_conservative_raster, +#endif +#ifdef GL_NV_conservative_raster_dilate + &__GLEW_NV_conservative_raster_dilate, +#endif +#ifdef GL_NV_conservative_raster_pre_snap_triangles + &__GLEW_NV_conservative_raster_pre_snap_triangles, +#endif +#ifdef GL_NV_copy_buffer + &__GLEW_NV_copy_buffer, +#endif +#ifdef GL_NV_copy_depth_to_color + &__GLEW_NV_copy_depth_to_color, +#endif +#ifdef GL_NV_copy_image + &__GLEW_NV_copy_image, +#endif +#ifdef GL_NV_deep_texture3D + &__GLEW_NV_deep_texture3D, +#endif +#ifdef GL_NV_depth_buffer_float + &__GLEW_NV_depth_buffer_float, +#endif +#ifdef GL_NV_depth_clamp + &__GLEW_NV_depth_clamp, +#endif +#ifdef GL_NV_depth_range_unclamped + &__GLEW_NV_depth_range_unclamped, +#endif +#ifdef GL_NV_draw_buffers + &__GLEW_NV_draw_buffers, +#endif +#ifdef GL_NV_draw_instanced + &__GLEW_NV_draw_instanced, +#endif +#ifdef GL_NV_draw_texture + &__GLEW_NV_draw_texture, +#endif +#ifdef GL_NV_draw_vulkan_image + &__GLEW_NV_draw_vulkan_image, +#endif +#ifdef GL_NV_evaluators + &__GLEW_NV_evaluators, +#endif +#ifdef GL_NV_explicit_attrib_location + &__GLEW_NV_explicit_attrib_location, +#endif +#ifdef GL_NV_explicit_multisample + &__GLEW_NV_explicit_multisample, +#endif +#ifdef GL_NV_fbo_color_attachments + &__GLEW_NV_fbo_color_attachments, +#endif +#ifdef GL_NV_fence + &__GLEW_NV_fence, +#endif +#ifdef GL_NV_fill_rectangle + &__GLEW_NV_fill_rectangle, +#endif +#ifdef GL_NV_float_buffer + &__GLEW_NV_float_buffer, +#endif +#ifdef GL_NV_fog_distance + &__GLEW_NV_fog_distance, +#endif +#ifdef GL_NV_fragment_coverage_to_color + &__GLEW_NV_fragment_coverage_to_color, +#endif +#ifdef GL_NV_fragment_program + &__GLEW_NV_fragment_program, +#endif +#ifdef GL_NV_fragment_program2 + &__GLEW_NV_fragment_program2, +#endif +#ifdef GL_NV_fragment_program4 + &__GLEW_NV_fragment_program4, +#endif +#ifdef GL_NV_fragment_program_option + &__GLEW_NV_fragment_program_option, +#endif +#ifdef GL_NV_fragment_shader_interlock + &__GLEW_NV_fragment_shader_interlock, +#endif +#ifdef GL_NV_framebuffer_blit + &__GLEW_NV_framebuffer_blit, +#endif +#ifdef GL_NV_framebuffer_mixed_samples + &__GLEW_NV_framebuffer_mixed_samples, +#endif +#ifdef GL_NV_framebuffer_multisample + &__GLEW_NV_framebuffer_multisample, +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + &__GLEW_NV_framebuffer_multisample_coverage, +#endif +#ifdef GL_NV_generate_mipmap_sRGB + &__GLEW_NV_generate_mipmap_sRGB, +#endif +#ifdef GL_NV_geometry_program4 + &__GLEW_NV_geometry_program4, +#endif +#ifdef GL_NV_geometry_shader4 + &__GLEW_NV_geometry_shader4, +#endif +#ifdef GL_NV_geometry_shader_passthrough + &__GLEW_NV_geometry_shader_passthrough, +#endif +#ifdef GL_NV_gpu_multicast + &__GLEW_NV_gpu_multicast, +#endif +#ifdef GL_NV_gpu_program4 + &__GLEW_NV_gpu_program4, +#endif +#ifdef GL_NV_gpu_program5 + &__GLEW_NV_gpu_program5, +#endif +#ifdef GL_NV_gpu_program5_mem_extended + &__GLEW_NV_gpu_program5_mem_extended, +#endif +#ifdef GL_NV_gpu_program_fp64 + &__GLEW_NV_gpu_program_fp64, +#endif +#ifdef GL_NV_gpu_shader5 + &__GLEW_NV_gpu_shader5, +#endif +#ifdef GL_NV_half_float + &__GLEW_NV_half_float, +#endif +#ifdef GL_NV_image_formats + &__GLEW_NV_image_formats, +#endif +#ifdef GL_NV_instanced_arrays + &__GLEW_NV_instanced_arrays, +#endif +#ifdef GL_NV_internalformat_sample_query + &__GLEW_NV_internalformat_sample_query, +#endif +#ifdef GL_NV_light_max_exponent + &__GLEW_NV_light_max_exponent, +#endif +#ifdef GL_NV_multisample_coverage + &__GLEW_NV_multisample_coverage, +#endif +#ifdef GL_NV_multisample_filter_hint + &__GLEW_NV_multisample_filter_hint, +#endif +#ifdef GL_NV_non_square_matrices + &__GLEW_NV_non_square_matrices, +#endif +#ifdef GL_NV_occlusion_query + &__GLEW_NV_occlusion_query, +#endif +#ifdef GL_NV_pack_subimage + &__GLEW_NV_pack_subimage, +#endif +#ifdef GL_NV_packed_depth_stencil + &__GLEW_NV_packed_depth_stencil, +#endif +#ifdef GL_NV_packed_float + &__GLEW_NV_packed_float, +#endif +#ifdef GL_NV_packed_float_linear + &__GLEW_NV_packed_float_linear, +#endif +#ifdef GL_NV_parameter_buffer_object + &__GLEW_NV_parameter_buffer_object, +#endif +#ifdef GL_NV_parameter_buffer_object2 + &__GLEW_NV_parameter_buffer_object2, +#endif +#ifdef GL_NV_path_rendering + &__GLEW_NV_path_rendering, +#endif +#ifdef GL_NV_path_rendering_shared_edge + &__GLEW_NV_path_rendering_shared_edge, +#endif +#ifdef GL_NV_pixel_buffer_object + &__GLEW_NV_pixel_buffer_object, +#endif +#ifdef GL_NV_pixel_data_range + &__GLEW_NV_pixel_data_range, +#endif +#ifdef GL_NV_platform_binary + &__GLEW_NV_platform_binary, +#endif +#ifdef GL_NV_point_sprite + &__GLEW_NV_point_sprite, +#endif +#ifdef GL_NV_polygon_mode + &__GLEW_NV_polygon_mode, +#endif +#ifdef GL_NV_present_video + &__GLEW_NV_present_video, +#endif +#ifdef GL_NV_primitive_restart + &__GLEW_NV_primitive_restart, +#endif +#ifdef GL_NV_read_depth + &__GLEW_NV_read_depth, +#endif +#ifdef GL_NV_read_depth_stencil + &__GLEW_NV_read_depth_stencil, +#endif +#ifdef GL_NV_read_stencil + &__GLEW_NV_read_stencil, +#endif +#ifdef GL_NV_register_combiners + &__GLEW_NV_register_combiners, +#endif +#ifdef GL_NV_register_combiners2 + &__GLEW_NV_register_combiners2, +#endif +#ifdef GL_NV_robustness_video_memory_purge + &__GLEW_NV_robustness_video_memory_purge, +#endif +#ifdef GL_NV_sRGB_formats + &__GLEW_NV_sRGB_formats, +#endif +#ifdef GL_NV_sample_locations + &__GLEW_NV_sample_locations, +#endif +#ifdef GL_NV_sample_mask_override_coverage + &__GLEW_NV_sample_mask_override_coverage, +#endif +#ifdef GL_NV_shader_atomic_counters + &__GLEW_NV_shader_atomic_counters, +#endif +#ifdef GL_NV_shader_atomic_float + &__GLEW_NV_shader_atomic_float, +#endif +#ifdef GL_NV_shader_atomic_float64 + &__GLEW_NV_shader_atomic_float64, +#endif +#ifdef GL_NV_shader_atomic_fp16_vector + &__GLEW_NV_shader_atomic_fp16_vector, +#endif +#ifdef GL_NV_shader_atomic_int64 + &__GLEW_NV_shader_atomic_int64, +#endif +#ifdef GL_NV_shader_buffer_load + &__GLEW_NV_shader_buffer_load, +#endif +#ifdef GL_NV_shader_noperspective_interpolation + &__GLEW_NV_shader_noperspective_interpolation, +#endif +#ifdef GL_NV_shader_storage_buffer_object + &__GLEW_NV_shader_storage_buffer_object, +#endif +#ifdef GL_NV_shader_thread_group + &__GLEW_NV_shader_thread_group, +#endif +#ifdef GL_NV_shader_thread_shuffle + &__GLEW_NV_shader_thread_shuffle, +#endif +#ifdef GL_NV_shadow_samplers_array + &__GLEW_NV_shadow_samplers_array, +#endif +#ifdef GL_NV_shadow_samplers_cube + &__GLEW_NV_shadow_samplers_cube, +#endif +#ifdef GL_NV_stereo_view_rendering + &__GLEW_NV_stereo_view_rendering, +#endif +#ifdef GL_NV_tessellation_program5 + &__GLEW_NV_tessellation_program5, +#endif +#ifdef GL_NV_texgen_emboss + &__GLEW_NV_texgen_emboss, +#endif +#ifdef GL_NV_texgen_reflection + &__GLEW_NV_texgen_reflection, +#endif +#ifdef GL_NV_texture_array + &__GLEW_NV_texture_array, +#endif +#ifdef GL_NV_texture_barrier + &__GLEW_NV_texture_barrier, +#endif +#ifdef GL_NV_texture_border_clamp + &__GLEW_NV_texture_border_clamp, +#endif +#ifdef GL_NV_texture_compression_latc + &__GLEW_NV_texture_compression_latc, +#endif +#ifdef GL_NV_texture_compression_s3tc + &__GLEW_NV_texture_compression_s3tc, +#endif +#ifdef GL_NV_texture_compression_s3tc_update + &__GLEW_NV_texture_compression_s3tc_update, +#endif +#ifdef GL_NV_texture_compression_vtc + &__GLEW_NV_texture_compression_vtc, +#endif +#ifdef GL_NV_texture_env_combine4 + &__GLEW_NV_texture_env_combine4, +#endif +#ifdef GL_NV_texture_expand_normal + &__GLEW_NV_texture_expand_normal, +#endif +#ifdef GL_NV_texture_multisample + &__GLEW_NV_texture_multisample, +#endif +#ifdef GL_NV_texture_npot_2D_mipmap + &__GLEW_NV_texture_npot_2D_mipmap, +#endif +#ifdef GL_NV_texture_rectangle + &__GLEW_NV_texture_rectangle, +#endif +#ifdef GL_NV_texture_rectangle_compressed + &__GLEW_NV_texture_rectangle_compressed, +#endif +#ifdef GL_NV_texture_shader + &__GLEW_NV_texture_shader, +#endif +#ifdef GL_NV_texture_shader2 + &__GLEW_NV_texture_shader2, +#endif +#ifdef GL_NV_texture_shader3 + &__GLEW_NV_texture_shader3, +#endif +#ifdef GL_NV_transform_feedback + &__GLEW_NV_transform_feedback, +#endif +#ifdef GL_NV_transform_feedback2 + &__GLEW_NV_transform_feedback2, +#endif +#ifdef GL_NV_uniform_buffer_unified_memory + &__GLEW_NV_uniform_buffer_unified_memory, +#endif +#ifdef GL_NV_vdpau_interop + &__GLEW_NV_vdpau_interop, +#endif +#ifdef GL_NV_vertex_array_range + &__GLEW_NV_vertex_array_range, +#endif +#ifdef GL_NV_vertex_array_range2 + &__GLEW_NV_vertex_array_range2, +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + &__GLEW_NV_vertex_attrib_integer_64bit, +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + &__GLEW_NV_vertex_buffer_unified_memory, +#endif +#ifdef GL_NV_vertex_program + &__GLEW_NV_vertex_program, +#endif +#ifdef GL_NV_vertex_program1_1 + &__GLEW_NV_vertex_program1_1, +#endif +#ifdef GL_NV_vertex_program2 + &__GLEW_NV_vertex_program2, +#endif +#ifdef GL_NV_vertex_program2_option + &__GLEW_NV_vertex_program2_option, +#endif +#ifdef GL_NV_vertex_program3 + &__GLEW_NV_vertex_program3, +#endif +#ifdef GL_NV_vertex_program4 + &__GLEW_NV_vertex_program4, +#endif +#ifdef GL_NV_video_capture + &__GLEW_NV_video_capture, +#endif +#ifdef GL_NV_viewport_array + &__GLEW_NV_viewport_array, +#endif +#ifdef GL_NV_viewport_array2 + &__GLEW_NV_viewport_array2, +#endif +#ifdef GL_NV_viewport_swizzle + &__GLEW_NV_viewport_swizzle, +#endif +#ifdef GL_OES_byte_coordinates + &__GLEW_OES_byte_coordinates, +#endif +#ifdef GL_OML_interlace + &__GLEW_OML_interlace, +#endif +#ifdef GL_OML_resample + &__GLEW_OML_resample, +#endif +#ifdef GL_OML_subsample + &__GLEW_OML_subsample, +#endif +#ifdef GL_OVR_multiview + &__GLEW_OVR_multiview, +#endif +#ifdef GL_OVR_multiview2 + &__GLEW_OVR_multiview2, +#endif +#ifdef GL_OVR_multiview_multisampled_render_to_texture + &__GLEW_OVR_multiview_multisampled_render_to_texture, +#endif +#ifdef GL_PGI_misc_hints + &__GLEW_PGI_misc_hints, +#endif +#ifdef GL_PGI_vertex_hints + &__GLEW_PGI_vertex_hints, +#endif +#ifdef GL_QCOM_alpha_test + &__GLEW_QCOM_alpha_test, +#endif +#ifdef GL_QCOM_binning_control + &__GLEW_QCOM_binning_control, +#endif +#ifdef GL_QCOM_driver_control + &__GLEW_QCOM_driver_control, +#endif +#ifdef GL_QCOM_extended_get + &__GLEW_QCOM_extended_get, +#endif +#ifdef GL_QCOM_extended_get2 + &__GLEW_QCOM_extended_get2, +#endif +#ifdef GL_QCOM_framebuffer_foveated + &__GLEW_QCOM_framebuffer_foveated, +#endif +#ifdef GL_QCOM_perfmon_global_mode + &__GLEW_QCOM_perfmon_global_mode, +#endif +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + &__GLEW_QCOM_shader_framebuffer_fetch_noncoherent, +#endif +#ifdef GL_QCOM_tiled_rendering + &__GLEW_QCOM_tiled_rendering, +#endif +#ifdef GL_QCOM_writeonly_rendering + &__GLEW_QCOM_writeonly_rendering, +#endif +#ifdef GL_REGAL_ES1_0_compatibility + &__GLEW_REGAL_ES1_0_compatibility, +#endif +#ifdef GL_REGAL_ES1_1_compatibility + &__GLEW_REGAL_ES1_1_compatibility, +#endif +#ifdef GL_REGAL_enable + &__GLEW_REGAL_enable, +#endif +#ifdef GL_REGAL_error_string + &__GLEW_REGAL_error_string, +#endif +#ifdef GL_REGAL_extension_query + &__GLEW_REGAL_extension_query, +#endif +#ifdef GL_REGAL_log + &__GLEW_REGAL_log, +#endif +#ifdef GL_REGAL_proc_address + &__GLEW_REGAL_proc_address, +#endif +#ifdef GL_REND_screen_coordinates + &__GLEW_REND_screen_coordinates, +#endif +#ifdef GL_S3_s3tc + &__GLEW_S3_s3tc, +#endif +#ifdef GL_SGIS_clip_band_hint + &__GLEW_SGIS_clip_band_hint, +#endif +#ifdef GL_SGIS_color_range + &__GLEW_SGIS_color_range, +#endif +#ifdef GL_SGIS_detail_texture + &__GLEW_SGIS_detail_texture, +#endif +#ifdef GL_SGIS_fog_function + &__GLEW_SGIS_fog_function, +#endif +#ifdef GL_SGIS_generate_mipmap + &__GLEW_SGIS_generate_mipmap, +#endif +#ifdef GL_SGIS_line_texgen + &__GLEW_SGIS_line_texgen, +#endif +#ifdef GL_SGIS_multisample + &__GLEW_SGIS_multisample, +#endif +#ifdef GL_SGIS_multitexture + &__GLEW_SGIS_multitexture, +#endif +#ifdef GL_SGIS_pixel_texture + &__GLEW_SGIS_pixel_texture, +#endif +#ifdef GL_SGIS_point_line_texgen + &__GLEW_SGIS_point_line_texgen, +#endif +#ifdef GL_SGIS_shared_multisample + &__GLEW_SGIS_shared_multisample, +#endif +#ifdef GL_SGIS_sharpen_texture + &__GLEW_SGIS_sharpen_texture, +#endif +#ifdef GL_SGIS_texture4D + &__GLEW_SGIS_texture4D, +#endif +#ifdef GL_SGIS_texture_border_clamp + &__GLEW_SGIS_texture_border_clamp, +#endif +#ifdef GL_SGIS_texture_edge_clamp + &__GLEW_SGIS_texture_edge_clamp, +#endif +#ifdef GL_SGIS_texture_filter4 + &__GLEW_SGIS_texture_filter4, +#endif +#ifdef GL_SGIS_texture_lod + &__GLEW_SGIS_texture_lod, +#endif +#ifdef GL_SGIS_texture_select + &__GLEW_SGIS_texture_select, +#endif +#ifdef GL_SGIX_async + &__GLEW_SGIX_async, +#endif +#ifdef GL_SGIX_async_histogram + &__GLEW_SGIX_async_histogram, +#endif +#ifdef GL_SGIX_async_pixel + &__GLEW_SGIX_async_pixel, +#endif +#ifdef GL_SGIX_bali_g_instruments + &__GLEW_SGIX_bali_g_instruments, +#endif +#ifdef GL_SGIX_bali_r_instruments + &__GLEW_SGIX_bali_r_instruments, +#endif +#ifdef GL_SGIX_bali_timer_instruments + &__GLEW_SGIX_bali_timer_instruments, +#endif +#ifdef GL_SGIX_blend_alpha_minmax + &__GLEW_SGIX_blend_alpha_minmax, +#endif +#ifdef GL_SGIX_blend_cadd + &__GLEW_SGIX_blend_cadd, +#endif +#ifdef GL_SGIX_blend_cmultiply + &__GLEW_SGIX_blend_cmultiply, +#endif +#ifdef GL_SGIX_calligraphic_fragment + &__GLEW_SGIX_calligraphic_fragment, +#endif +#ifdef GL_SGIX_clipmap + &__GLEW_SGIX_clipmap, +#endif +#ifdef GL_SGIX_color_matrix_accuracy + &__GLEW_SGIX_color_matrix_accuracy, +#endif +#ifdef GL_SGIX_color_table_index_mode + &__GLEW_SGIX_color_table_index_mode, +#endif +#ifdef GL_SGIX_complex_polar + &__GLEW_SGIX_complex_polar, +#endif +#ifdef GL_SGIX_convolution_accuracy + &__GLEW_SGIX_convolution_accuracy, +#endif +#ifdef GL_SGIX_cube_map + &__GLEW_SGIX_cube_map, +#endif +#ifdef GL_SGIX_cylinder_texgen + &__GLEW_SGIX_cylinder_texgen, +#endif +#ifdef GL_SGIX_datapipe + &__GLEW_SGIX_datapipe, +#endif +#ifdef GL_SGIX_decimation + &__GLEW_SGIX_decimation, +#endif +#ifdef GL_SGIX_depth_pass_instrument + &__GLEW_SGIX_depth_pass_instrument, +#endif +#ifdef GL_SGIX_depth_texture + &__GLEW_SGIX_depth_texture, +#endif +#ifdef GL_SGIX_dvc + &__GLEW_SGIX_dvc, +#endif +#ifdef GL_SGIX_flush_raster + &__GLEW_SGIX_flush_raster, +#endif +#ifdef GL_SGIX_fog_blend + &__GLEW_SGIX_fog_blend, +#endif +#ifdef GL_SGIX_fog_factor_to_alpha + &__GLEW_SGIX_fog_factor_to_alpha, +#endif +#ifdef GL_SGIX_fog_layers + &__GLEW_SGIX_fog_layers, +#endif +#ifdef GL_SGIX_fog_offset + &__GLEW_SGIX_fog_offset, +#endif +#ifdef GL_SGIX_fog_patchy + &__GLEW_SGIX_fog_patchy, +#endif +#ifdef GL_SGIX_fog_scale + &__GLEW_SGIX_fog_scale, +#endif +#ifdef GL_SGIX_fog_texture + &__GLEW_SGIX_fog_texture, +#endif +#ifdef GL_SGIX_fragment_lighting_space + &__GLEW_SGIX_fragment_lighting_space, +#endif +#ifdef GL_SGIX_fragment_specular_lighting + &__GLEW_SGIX_fragment_specular_lighting, +#endif +#ifdef GL_SGIX_fragments_instrument + &__GLEW_SGIX_fragments_instrument, +#endif +#ifdef GL_SGIX_framezoom + &__GLEW_SGIX_framezoom, +#endif +#ifdef GL_SGIX_icc_texture + &__GLEW_SGIX_icc_texture, +#endif +#ifdef GL_SGIX_igloo_interface + &__GLEW_SGIX_igloo_interface, +#endif +#ifdef GL_SGIX_image_compression + &__GLEW_SGIX_image_compression, +#endif +#ifdef GL_SGIX_impact_pixel_texture + &__GLEW_SGIX_impact_pixel_texture, +#endif +#ifdef GL_SGIX_instrument_error + &__GLEW_SGIX_instrument_error, +#endif +#ifdef GL_SGIX_interlace + &__GLEW_SGIX_interlace, +#endif +#ifdef GL_SGIX_ir_instrument1 + &__GLEW_SGIX_ir_instrument1, +#endif +#ifdef GL_SGIX_line_quality_hint + &__GLEW_SGIX_line_quality_hint, +#endif +#ifdef GL_SGIX_list_priority + &__GLEW_SGIX_list_priority, +#endif +#ifdef GL_SGIX_mpeg1 + &__GLEW_SGIX_mpeg1, +#endif +#ifdef GL_SGIX_mpeg2 + &__GLEW_SGIX_mpeg2, +#endif +#ifdef GL_SGIX_nonlinear_lighting_pervertex + &__GLEW_SGIX_nonlinear_lighting_pervertex, +#endif +#ifdef GL_SGIX_nurbs_eval + &__GLEW_SGIX_nurbs_eval, +#endif +#ifdef GL_SGIX_occlusion_instrument + &__GLEW_SGIX_occlusion_instrument, +#endif +#ifdef GL_SGIX_packed_6bytes + &__GLEW_SGIX_packed_6bytes, +#endif +#ifdef GL_SGIX_pixel_texture + &__GLEW_SGIX_pixel_texture, +#endif +#ifdef GL_SGIX_pixel_texture_bits + &__GLEW_SGIX_pixel_texture_bits, +#endif +#ifdef GL_SGIX_pixel_texture_lod + &__GLEW_SGIX_pixel_texture_lod, +#endif +#ifdef GL_SGIX_pixel_tiles + &__GLEW_SGIX_pixel_tiles, +#endif +#ifdef GL_SGIX_polynomial_ffd + &__GLEW_SGIX_polynomial_ffd, +#endif +#ifdef GL_SGIX_quad_mesh + &__GLEW_SGIX_quad_mesh, +#endif +#ifdef GL_SGIX_reference_plane + &__GLEW_SGIX_reference_plane, +#endif +#ifdef GL_SGIX_resample + &__GLEW_SGIX_resample, +#endif +#ifdef GL_SGIX_scalebias_hint + &__GLEW_SGIX_scalebias_hint, +#endif +#ifdef GL_SGIX_shadow + &__GLEW_SGIX_shadow, +#endif +#ifdef GL_SGIX_shadow_ambient + &__GLEW_SGIX_shadow_ambient, +#endif +#ifdef GL_SGIX_slim + &__GLEW_SGIX_slim, +#endif +#ifdef GL_SGIX_spotlight_cutoff + &__GLEW_SGIX_spotlight_cutoff, +#endif +#ifdef GL_SGIX_sprite + &__GLEW_SGIX_sprite, +#endif +#ifdef GL_SGIX_subdiv_patch + &__GLEW_SGIX_subdiv_patch, +#endif +#ifdef GL_SGIX_subsample + &__GLEW_SGIX_subsample, +#endif +#ifdef GL_SGIX_tag_sample_buffer + &__GLEW_SGIX_tag_sample_buffer, +#endif +#ifdef GL_SGIX_texture_add_env + &__GLEW_SGIX_texture_add_env, +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + &__GLEW_SGIX_texture_coordinate_clamp, +#endif +#ifdef GL_SGIX_texture_lod_bias + &__GLEW_SGIX_texture_lod_bias, +#endif +#ifdef GL_SGIX_texture_mipmap_anisotropic + &__GLEW_SGIX_texture_mipmap_anisotropic, +#endif +#ifdef GL_SGIX_texture_multi_buffer + &__GLEW_SGIX_texture_multi_buffer, +#endif +#ifdef GL_SGIX_texture_phase + &__GLEW_SGIX_texture_phase, +#endif +#ifdef GL_SGIX_texture_range + &__GLEW_SGIX_texture_range, +#endif +#ifdef GL_SGIX_texture_scale_bias + &__GLEW_SGIX_texture_scale_bias, +#endif +#ifdef GL_SGIX_texture_supersample + &__GLEW_SGIX_texture_supersample, +#endif +#ifdef GL_SGIX_vector_ops + &__GLEW_SGIX_vector_ops, +#endif +#ifdef GL_SGIX_vertex_array_object + &__GLEW_SGIX_vertex_array_object, +#endif +#ifdef GL_SGIX_vertex_preclip + &__GLEW_SGIX_vertex_preclip, +#endif +#ifdef GL_SGIX_vertex_preclip_hint + &__GLEW_SGIX_vertex_preclip_hint, +#endif +#ifdef GL_SGIX_ycrcb + &__GLEW_SGIX_ycrcb, +#endif +#ifdef GL_SGIX_ycrcb_subsample + &__GLEW_SGIX_ycrcb_subsample, +#endif +#ifdef GL_SGIX_ycrcba + &__GLEW_SGIX_ycrcba, +#endif +#ifdef GL_SGI_color_matrix + &__GLEW_SGI_color_matrix, +#endif +#ifdef GL_SGI_color_table + &__GLEW_SGI_color_table, +#endif +#ifdef GL_SGI_complex + &__GLEW_SGI_complex, +#endif +#ifdef GL_SGI_complex_type + &__GLEW_SGI_complex_type, +#endif +#ifdef GL_SGI_fft + &__GLEW_SGI_fft, +#endif +#ifdef GL_SGI_texture_color_table + &__GLEW_SGI_texture_color_table, +#endif +#ifdef GL_SUNX_constant_data + &__GLEW_SUNX_constant_data, +#endif +#ifdef GL_SUN_convolution_border_modes + &__GLEW_SUN_convolution_border_modes, +#endif +#ifdef GL_SUN_global_alpha + &__GLEW_SUN_global_alpha, +#endif +#ifdef GL_SUN_mesh_array + &__GLEW_SUN_mesh_array, +#endif +#ifdef GL_SUN_read_video_pixels + &__GLEW_SUN_read_video_pixels, +#endif +#ifdef GL_SUN_slice_accum + &__GLEW_SUN_slice_accum, +#endif +#ifdef GL_SUN_triangle_list + &__GLEW_SUN_triangle_list, +#endif +#ifdef GL_SUN_vertex + &__GLEW_SUN_vertex, +#endif +#ifdef GL_WIN_phong_shading + &__GLEW_WIN_phong_shading, +#endif +#ifdef GL_WIN_scene_markerXXX + &__GLEW_WIN_scene_markerXXX, +#endif +#ifdef GL_WIN_specular_fog + &__GLEW_WIN_specular_fog, +#endif +#ifdef GL_WIN_swap_hint + &__GLEW_WIN_swap_hint, +#endif + NULL +}; +static GLboolean _glewInit_GL_VERSION_1_2 (); +static GLboolean _glewInit_GL_VERSION_1_3 (); +static GLboolean _glewInit_GL_VERSION_1_4 (); +static GLboolean _glewInit_GL_VERSION_1_5 (); +static GLboolean _glewInit_GL_VERSION_2_0 (); +static GLboolean _glewInit_GL_VERSION_2_1 (); +static GLboolean _glewInit_GL_VERSION_3_0 (); +static GLboolean _glewInit_GL_VERSION_3_1 (); +static GLboolean _glewInit_GL_VERSION_3_2 (); +static GLboolean _glewInit_GL_VERSION_3_3 (); +static GLboolean _glewInit_GL_VERSION_4_0 (); +static GLboolean _glewInit_GL_VERSION_4_5 (); +static GLboolean _glewInit_GL_VERSION_4_6 (); +static GLboolean _glewInit_GL_3DFX_tbuffer (); +static GLboolean _glewInit_GL_AMD_debug_output (); +static GLboolean _glewInit_GL_AMD_draw_buffers_blend (); +static GLboolean _glewInit_GL_AMD_framebuffer_sample_positions (); +static GLboolean _glewInit_GL_AMD_interleaved_elements (); +static GLboolean _glewInit_GL_AMD_multi_draw_indirect (); +static GLboolean _glewInit_GL_AMD_name_gen_delete (); +static GLboolean _glewInit_GL_AMD_occlusion_query_event (); +static GLboolean _glewInit_GL_AMD_performance_monitor (); +static GLboolean _glewInit_GL_AMD_sample_positions (); +static GLboolean _glewInit_GL_AMD_sparse_texture (); +static GLboolean _glewInit_GL_AMD_stencil_operation_extended (); +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (); +static GLboolean _glewInit_GL_ANGLE_framebuffer_blit (); +static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample (); +static GLboolean _glewInit_GL_ANGLE_instanced_arrays (); +static GLboolean _glewInit_GL_ANGLE_timer_query (); +static GLboolean _glewInit_GL_ANGLE_translated_shader_source (); +static GLboolean _glewInit_GL_APPLE_copy_texture_levels (); +static GLboolean _glewInit_GL_APPLE_element_array (); +static GLboolean _glewInit_GL_APPLE_fence (); +static GLboolean _glewInit_GL_APPLE_flush_buffer_range (); +static GLboolean _glewInit_GL_APPLE_framebuffer_multisample (); +static GLboolean _glewInit_GL_APPLE_object_purgeable (); +static GLboolean _glewInit_GL_APPLE_sync (); +static GLboolean _glewInit_GL_APPLE_texture_range (); +static GLboolean _glewInit_GL_APPLE_vertex_array_object (); +static GLboolean _glewInit_GL_APPLE_vertex_array_range (); +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (); +static GLboolean _glewInit_GL_ARB_ES2_compatibility (); +static GLboolean _glewInit_GL_ARB_ES3_1_compatibility (); +static GLboolean _glewInit_GL_ARB_ES3_2_compatibility (); +static GLboolean _glewInit_GL_ARB_base_instance (); +static GLboolean _glewInit_GL_ARB_bindless_texture (); +static GLboolean _glewInit_GL_ARB_blend_func_extended (); +static GLboolean _glewInit_GL_ARB_buffer_storage (); +static GLboolean _glewInit_GL_ARB_cl_event (); +static GLboolean _glewInit_GL_ARB_clear_buffer_object (); +static GLboolean _glewInit_GL_ARB_clear_texture (); +static GLboolean _glewInit_GL_ARB_clip_control (); +static GLboolean _glewInit_GL_ARB_color_buffer_float (); +static GLboolean _glewInit_GL_ARB_compute_shader (); +static GLboolean _glewInit_GL_ARB_compute_variable_group_size (); +static GLboolean _glewInit_GL_ARB_copy_buffer (); +static GLboolean _glewInit_GL_ARB_copy_image (); +static GLboolean _glewInit_GL_ARB_debug_output (); +static GLboolean _glewInit_GL_ARB_direct_state_access (); +static GLboolean _glewInit_GL_ARB_draw_buffers (); +static GLboolean _glewInit_GL_ARB_draw_buffers_blend (); +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (); +static GLboolean _glewInit_GL_ARB_draw_indirect (); +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (); +static GLboolean _glewInit_GL_ARB_framebuffer_object (); +static GLboolean _glewInit_GL_ARB_geometry_shader4 (); +static GLboolean _glewInit_GL_ARB_get_program_binary (); +static GLboolean _glewInit_GL_ARB_get_texture_sub_image (); +static GLboolean _glewInit_GL_ARB_gl_spirv (); +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (); +static GLboolean _glewInit_GL_ARB_gpu_shader_int64 (); +static GLboolean _glewInit_GL_ARB_imaging (); +static GLboolean _glewInit_GL_ARB_indirect_parameters (); +static GLboolean _glewInit_GL_ARB_instanced_arrays (); +static GLboolean _glewInit_GL_ARB_internalformat_query (); +static GLboolean _glewInit_GL_ARB_internalformat_query2 (); +static GLboolean _glewInit_GL_ARB_invalidate_subdata (); +static GLboolean _glewInit_GL_ARB_map_buffer_range (); +static GLboolean _glewInit_GL_ARB_matrix_palette (); +static GLboolean _glewInit_GL_ARB_multi_bind (); +static GLboolean _glewInit_GL_ARB_multi_draw_indirect (); +static GLboolean _glewInit_GL_ARB_multisample (); +static GLboolean _glewInit_GL_ARB_multitexture (); +static GLboolean _glewInit_GL_ARB_occlusion_query (); +static GLboolean _glewInit_GL_ARB_parallel_shader_compile (); +static GLboolean _glewInit_GL_ARB_point_parameters (); +static GLboolean _glewInit_GL_ARB_polygon_offset_clamp (); +static GLboolean _glewInit_GL_ARB_program_interface_query (); +static GLboolean _glewInit_GL_ARB_provoking_vertex (); +static GLboolean _glewInit_GL_ARB_robustness (); +static GLboolean _glewInit_GL_ARB_sample_locations (); +static GLboolean _glewInit_GL_ARB_sample_shading (); +static GLboolean _glewInit_GL_ARB_sampler_objects (); +static GLboolean _glewInit_GL_ARB_separate_shader_objects (); +static GLboolean _glewInit_GL_ARB_shader_atomic_counters (); +static GLboolean _glewInit_GL_ARB_shader_image_load_store (); +static GLboolean _glewInit_GL_ARB_shader_objects (); +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (); +static GLboolean _glewInit_GL_ARB_shader_subroutine (); +static GLboolean _glewInit_GL_ARB_shading_language_include (); +static GLboolean _glewInit_GL_ARB_sparse_buffer (); +static GLboolean _glewInit_GL_ARB_sparse_texture (); +static GLboolean _glewInit_GL_ARB_sync (); +static GLboolean _glewInit_GL_ARB_tessellation_shader (); +static GLboolean _glewInit_GL_ARB_texture_barrier (); +static GLboolean _glewInit_GL_ARB_texture_buffer_object (); +static GLboolean _glewInit_GL_ARB_texture_buffer_range (); +static GLboolean _glewInit_GL_ARB_texture_compression (); +static GLboolean _glewInit_GL_ARB_texture_multisample (); +static GLboolean _glewInit_GL_ARB_texture_storage (); +static GLboolean _glewInit_GL_ARB_texture_storage_multisample (); +static GLboolean _glewInit_GL_ARB_texture_view (); +static GLboolean _glewInit_GL_ARB_timer_query (); +static GLboolean _glewInit_GL_ARB_transform_feedback2 (); +static GLboolean _glewInit_GL_ARB_transform_feedback3 (); +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (); +static GLboolean _glewInit_GL_ARB_transpose_matrix (); +static GLboolean _glewInit_GL_ARB_uniform_buffer_object (); +static GLboolean _glewInit_GL_ARB_vertex_array_object (); +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (); +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (); +static GLboolean _glewInit_GL_ARB_vertex_blend (); +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (); +static GLboolean _glewInit_GL_ARB_vertex_program (); +static GLboolean _glewInit_GL_ARB_vertex_shader (); +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (); +static GLboolean _glewInit_GL_ARB_viewport_array (); +static GLboolean _glewInit_GL_ARB_window_pos (); +static GLboolean _glewInit_GL_ATI_draw_buffers (); +static GLboolean _glewInit_GL_ATI_element_array (); +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (); +static GLboolean _glewInit_GL_ATI_fragment_shader (); +static GLboolean _glewInit_GL_ATI_map_object_buffer (); +static GLboolean _glewInit_GL_ATI_pn_triangles (); +static GLboolean _glewInit_GL_ATI_separate_stencil (); +static GLboolean _glewInit_GL_ATI_vertex_array_object (); +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (); +static GLboolean _glewInit_GL_ATI_vertex_streams (); +static GLboolean _glewInit_GL_EXT_base_instance (); +static GLboolean _glewInit_GL_EXT_bindable_uniform (); +static GLboolean _glewInit_GL_EXT_blend_color (); +static GLboolean _glewInit_GL_EXT_blend_equation_separate (); +static GLboolean _glewInit_GL_EXT_blend_func_extended (); +static GLboolean _glewInit_GL_EXT_blend_func_separate (); +static GLboolean _glewInit_GL_EXT_blend_minmax (); +static GLboolean _glewInit_GL_EXT_buffer_storage (); +static GLboolean _glewInit_GL_EXT_clear_texture (); +static GLboolean _glewInit_GL_EXT_color_subtable (); +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (); +static GLboolean _glewInit_GL_EXT_convolution (); +static GLboolean _glewInit_GL_EXT_coordinate_frame (); +static GLboolean _glewInit_GL_EXT_copy_image (); +static GLboolean _glewInit_GL_EXT_copy_texture (); +static GLboolean _glewInit_GL_EXT_cull_vertex (); +static GLboolean _glewInit_GL_EXT_debug_label (); +static GLboolean _glewInit_GL_EXT_debug_marker (); +static GLboolean _glewInit_GL_EXT_depth_bounds_test (); +static GLboolean _glewInit_GL_EXT_direct_state_access (); +static GLboolean _glewInit_GL_EXT_discard_framebuffer (); +static GLboolean _glewInit_GL_EXT_draw_buffers (); +static GLboolean _glewInit_GL_EXT_draw_buffers2 (); +static GLboolean _glewInit_GL_EXT_draw_buffers_indexed (); +static GLboolean _glewInit_GL_EXT_draw_elements_base_vertex (); +static GLboolean _glewInit_GL_EXT_draw_instanced (); +static GLboolean _glewInit_GL_EXT_draw_range_elements (); +static GLboolean _glewInit_GL_EXT_external_buffer (); +static GLboolean _glewInit_GL_EXT_fog_coord (); +static GLboolean _glewInit_GL_EXT_fragment_lighting (); +static GLboolean _glewInit_GL_EXT_framebuffer_blit (); +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (); +static GLboolean _glewInit_GL_EXT_framebuffer_object (); +static GLboolean _glewInit_GL_EXT_geometry_shader4 (); +static GLboolean _glewInit_GL_EXT_gpu_program_parameters (); +static GLboolean _glewInit_GL_EXT_gpu_shader4 (); +static GLboolean _glewInit_GL_EXT_histogram (); +static GLboolean _glewInit_GL_EXT_index_func (); +static GLboolean _glewInit_GL_EXT_index_material (); +static GLboolean _glewInit_GL_EXT_instanced_arrays (); +static GLboolean _glewInit_GL_EXT_light_texture (); +static GLboolean _glewInit_GL_EXT_map_buffer_range (); +static GLboolean _glewInit_GL_EXT_memory_object (); +static GLboolean _glewInit_GL_EXT_memory_object_fd (); +static GLboolean _glewInit_GL_EXT_memory_object_win32 (); +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (); +static GLboolean _glewInit_GL_EXT_multi_draw_indirect (); +static GLboolean _glewInit_GL_EXT_multisample (); +static GLboolean _glewInit_GL_EXT_multisampled_render_to_texture (); +static GLboolean _glewInit_GL_EXT_multiview_draw_buffers (); +static GLboolean _glewInit_GL_EXT_paletted_texture (); +static GLboolean _glewInit_GL_EXT_pixel_transform (); +static GLboolean _glewInit_GL_EXT_point_parameters (); +static GLboolean _glewInit_GL_EXT_polygon_offset (); +static GLboolean _glewInit_GL_EXT_polygon_offset_clamp (); +static GLboolean _glewInit_GL_EXT_provoking_vertex (); +static GLboolean _glewInit_GL_EXT_raster_multisample (); +static GLboolean _glewInit_GL_EXT_scene_marker (); +static GLboolean _glewInit_GL_EXT_secondary_color (); +static GLboolean _glewInit_GL_EXT_semaphore (); +static GLboolean _glewInit_GL_EXT_semaphore_fd (); +static GLboolean _glewInit_GL_EXT_semaphore_win32 (); +static GLboolean _glewInit_GL_EXT_separate_shader_objects (); +static GLboolean _glewInit_GL_EXT_shader_image_load_store (); +static GLboolean _glewInit_GL_EXT_shader_pixel_local_storage2 (); +static GLboolean _glewInit_GL_EXT_sparse_texture (); +static GLboolean _glewInit_GL_EXT_stencil_two_side (); +static GLboolean _glewInit_GL_EXT_subtexture (); +static GLboolean _glewInit_GL_EXT_texture3D (); +static GLboolean _glewInit_GL_EXT_texture_array (); +static GLboolean _glewInit_GL_EXT_texture_buffer_object (); +static GLboolean _glewInit_GL_EXT_texture_integer (); +static GLboolean _glewInit_GL_EXT_texture_object (); +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (); +static GLboolean _glewInit_GL_EXT_texture_storage (); +static GLboolean _glewInit_GL_EXT_texture_view (); +static GLboolean _glewInit_GL_EXT_timer_query (); +static GLboolean _glewInit_GL_EXT_transform_feedback (); +static GLboolean _glewInit_GL_EXT_vertex_array (); +static GLboolean _glewInit_GL_EXT_vertex_array_setXXX (); +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (); +static GLboolean _glewInit_GL_EXT_vertex_shader (); +static GLboolean _glewInit_GL_EXT_vertex_weighting (); +static GLboolean _glewInit_GL_EXT_win32_keyed_mutex (); +static GLboolean _glewInit_GL_EXT_window_rectangles (); +static GLboolean _glewInit_GL_EXT_x11_sync_object (); +static GLboolean _glewInit_GL_GREMEDY_frame_terminator (); +static GLboolean _glewInit_GL_GREMEDY_string_marker (); +static GLboolean _glewInit_GL_HP_image_transform (); +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (); +static GLboolean _glewInit_GL_IBM_vertex_array_lists (); +static GLboolean _glewInit_GL_INTEL_map_texture (); +static GLboolean _glewInit_GL_INTEL_parallel_arrays (); +static GLboolean _glewInit_GL_INTEL_performance_query (); +static GLboolean _glewInit_GL_INTEL_texture_scissor (); +static GLboolean _glewInit_GL_KHR_blend_equation_advanced (); +static GLboolean _glewInit_GL_KHR_debug (); +static GLboolean _glewInit_GL_KHR_parallel_shader_compile (); +static GLboolean _glewInit_GL_KHR_robustness (); +static GLboolean _glewInit_GL_KTX_buffer_region (); +static GLboolean _glewInit_GL_MESA_resize_buffers (); +static GLboolean _glewInit_GL_MESA_window_pos (); +static GLboolean _glewInit_GL_NVX_conditional_render (); +static GLboolean _glewInit_GL_NVX_linked_gpu_multicast (); +static GLboolean _glewInit_GL_NV_3dvision_settings (); +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect (); +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect_count (); +static GLboolean _glewInit_GL_NV_bindless_texture (); +static GLboolean _glewInit_GL_NV_blend_equation_advanced (); +static GLboolean _glewInit_GL_NV_clip_space_w_scaling (); +static GLboolean _glewInit_GL_NV_command_list (); +static GLboolean _glewInit_GL_NV_conditional_render (); +static GLboolean _glewInit_GL_NV_conservative_raster (); +static GLboolean _glewInit_GL_NV_conservative_raster_dilate (); +static GLboolean _glewInit_GL_NV_conservative_raster_pre_snap_triangles (); +static GLboolean _glewInit_GL_NV_copy_buffer (); +static GLboolean _glewInit_GL_NV_copy_image (); +static GLboolean _glewInit_GL_NV_depth_buffer_float (); +static GLboolean _glewInit_GL_NV_draw_buffers (); +static GLboolean _glewInit_GL_NV_draw_instanced (); +static GLboolean _glewInit_GL_NV_draw_texture (); +static GLboolean _glewInit_GL_NV_draw_vulkan_image (); +static GLboolean _glewInit_GL_NV_evaluators (); +static GLboolean _glewInit_GL_NV_explicit_multisample (); +static GLboolean _glewInit_GL_NV_fence (); +static GLboolean _glewInit_GL_NV_fragment_coverage_to_color (); +static GLboolean _glewInit_GL_NV_fragment_program (); +static GLboolean _glewInit_GL_NV_framebuffer_blit (); +static GLboolean _glewInit_GL_NV_framebuffer_multisample (); +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (); +static GLboolean _glewInit_GL_NV_geometry_program4 (); +static GLboolean _glewInit_GL_NV_gpu_multicast (); +static GLboolean _glewInit_GL_NV_gpu_program4 (); +static GLboolean _glewInit_GL_NV_gpu_shader5 (); +static GLboolean _glewInit_GL_NV_half_float (); +static GLboolean _glewInit_GL_NV_instanced_arrays (); +static GLboolean _glewInit_GL_NV_internalformat_sample_query (); +static GLboolean _glewInit_GL_NV_non_square_matrices (); +static GLboolean _glewInit_GL_NV_occlusion_query (); +static GLboolean _glewInit_GL_NV_parameter_buffer_object (); +static GLboolean _glewInit_GL_NV_path_rendering (); +static GLboolean _glewInit_GL_NV_pixel_data_range (); +static GLboolean _glewInit_GL_NV_point_sprite (); +static GLboolean _glewInit_GL_NV_polygon_mode (); +static GLboolean _glewInit_GL_NV_present_video (); +static GLboolean _glewInit_GL_NV_primitive_restart (); +static GLboolean _glewInit_GL_NV_register_combiners (); +static GLboolean _glewInit_GL_NV_register_combiners2 (); +static GLboolean _glewInit_GL_NV_sample_locations (); +static GLboolean _glewInit_GL_NV_shader_buffer_load (); +static GLboolean _glewInit_GL_NV_texture_array (); +static GLboolean _glewInit_GL_NV_texture_barrier (); +static GLboolean _glewInit_GL_NV_texture_multisample (); +static GLboolean _glewInit_GL_NV_transform_feedback (); +static GLboolean _glewInit_GL_NV_transform_feedback2 (); +static GLboolean _glewInit_GL_NV_vdpau_interop (); +static GLboolean _glewInit_GL_NV_vertex_array_range (); +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (); +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (); +static GLboolean _glewInit_GL_NV_vertex_program (); +static GLboolean _glewInit_GL_NV_video_capture (); +static GLboolean _glewInit_GL_NV_viewport_array (); +static GLboolean _glewInit_GL_NV_viewport_swizzle (); +static GLboolean _glewInit_GL_OVR_multiview (); +static GLboolean _glewInit_GL_OVR_multiview_multisampled_render_to_texture (); +static GLboolean _glewInit_GL_QCOM_alpha_test (); +static GLboolean _glewInit_GL_QCOM_driver_control (); +static GLboolean _glewInit_GL_QCOM_extended_get (); +static GLboolean _glewInit_GL_QCOM_extended_get2 (); +static GLboolean _glewInit_GL_QCOM_framebuffer_foveated (); +static GLboolean _glewInit_GL_QCOM_shader_framebuffer_fetch_noncoherent (); +static GLboolean _glewInit_GL_QCOM_tiled_rendering (); +static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility (); +static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility (); +static GLboolean _glewInit_GL_REGAL_error_string (); +static GLboolean _glewInit_GL_REGAL_extension_query (); +static GLboolean _glewInit_GL_REGAL_log (); +static GLboolean _glewInit_GL_REGAL_proc_address (); +static GLboolean _glewInit_GL_SGIS_detail_texture (); +static GLboolean _glewInit_GL_SGIS_fog_function (); +static GLboolean _glewInit_GL_SGIS_multisample (); +static GLboolean _glewInit_GL_SGIS_multitexture (); +static GLboolean _glewInit_GL_SGIS_shared_multisample (); +static GLboolean _glewInit_GL_SGIS_sharpen_texture (); +static GLboolean _glewInit_GL_SGIS_texture4D (); +static GLboolean _glewInit_GL_SGIS_texture_filter4 (); +static GLboolean _glewInit_GL_SGIX_async (); +static GLboolean _glewInit_GL_SGIX_datapipe (); +static GLboolean _glewInit_GL_SGIX_flush_raster (); +static GLboolean _glewInit_GL_SGIX_fog_layers (); +static GLboolean _glewInit_GL_SGIX_fog_texture (); +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (); +static GLboolean _glewInit_GL_SGIX_framezoom (); +static GLboolean _glewInit_GL_SGIX_igloo_interface (); +static GLboolean _glewInit_GL_SGIX_mpeg1 (); +static GLboolean _glewInit_GL_SGIX_nonlinear_lighting_pervertex (); +static GLboolean _glewInit_GL_SGIX_pixel_texture (); +static GLboolean _glewInit_GL_SGIX_polynomial_ffd (); +static GLboolean _glewInit_GL_SGIX_quad_mesh (); +static GLboolean _glewInit_GL_SGIX_reference_plane (); +static GLboolean _glewInit_GL_SGIX_sprite (); +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (); +static GLboolean _glewInit_GL_SGIX_vector_ops (); +static GLboolean _glewInit_GL_SGIX_vertex_array_object (); +static GLboolean _glewInit_GL_SGI_color_table (); +static GLboolean _glewInit_GL_SGI_fft (); +static GLboolean _glewInit_GL_SUNX_constant_data (); +static GLboolean _glewInit_GL_SUN_global_alpha (); +static GLboolean _glewInit_GL_SUN_read_video_pixels (); +static GLboolean _glewInit_GL_SUN_triangle_list (); +static GLboolean _glewInit_GL_SUN_vertex (); +static GLboolean _glewInit_GL_WIN_swap_hint (); + +#ifdef GL_VERSION_1_2 + +static GLboolean _glewInit_GL_VERSION_1_2 () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; + r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; + r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; + r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_2 */ + +#ifdef GL_VERSION_1_3 + +static GLboolean _glewInit_GL_VERSION_1_3 () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; + r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; + r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; + r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; + r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; + r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; + r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; + r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; + r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; + r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; + r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; + r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; + r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; + r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; + r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; + r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; + r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; + r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; + r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; + r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; + r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; + r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; + r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; + r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; + r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; + r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; + r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; + r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; + r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; + r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; + r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; + r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; + r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; + r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; + r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; + r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; + r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; + r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; + r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; + r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; + r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; + r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; + r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; + r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; + r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; + r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_3 */ + +#ifdef GL_VERSION_1_4 + +static GLboolean _glewInit_GL_VERSION_1_4 () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; + r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; + r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; + r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; + r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; + r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; + r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; + r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; + r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; + r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; + r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; + r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; + r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; + r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; + r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; + r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; + r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; + r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; + r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; + r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; + r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; + r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; + r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; + r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; + r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; + r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; + r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; + r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; + r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; + r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; + r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; + r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; + r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; + r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; + r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; + r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; + r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; + r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; + r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; + r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; + r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; + r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; + r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; + r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; + r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_4 */ + +#ifdef GL_VERSION_1_5 + +static GLboolean _glewInit_GL_VERSION_1_5 () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; + r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; + r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; + r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; + r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; + r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; + r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; + r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; + r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; + r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; + r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; + r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; + r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; + r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; + r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; + r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; + r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; + r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; + r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_5 */ + +#ifdef GL_VERSION_2_0 + +static GLboolean _glewInit_GL_VERSION_2_0 () +{ + GLboolean r = GL_FALSE; + + r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; + r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; + r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; + r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; + r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; + r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; + r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; + r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; + r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; + r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; + r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; + r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; + r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; + r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; + r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; + r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; + r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; + r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; + r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; + r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; + r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; + r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; + r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; + r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; + r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; + r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; + r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; + r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; + r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; + r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; + r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; + r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; + r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; + r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; + r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; + r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; + r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; + r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; + r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; + r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; + r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; + r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; + r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; + r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; + r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; + r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; + r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; + r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; + r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; + r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; + r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; + r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; + r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; + r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; + r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; + r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; + r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; + r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; + r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; + r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; + r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; + r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; + r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; + r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; + r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; + r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; + r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; + r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; + r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; + r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; + r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; + r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; + r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; + r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; + r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; + r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; + r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; + r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; + r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; + r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; + r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; + r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; + r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; + r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; + r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; + r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; + r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; + r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; + r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; + r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; + r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; + r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; + r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_0 */ + +#ifdef GL_VERSION_2_1 + +static GLboolean _glewInit_GL_VERSION_2_1 () +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; + r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; + r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; + r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; + r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; + r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_1 */ + +#ifdef GL_VERSION_3_0 + +static GLboolean _glewInit_GL_VERSION_3_0 () +{ + GLboolean r = GL_FALSE; + + r = _glewInit_GL_ARB_framebuffer_object() || r; + r = _glewInit_GL_ARB_map_buffer_range() || r; + r = _glewInit_GL_ARB_uniform_buffer_object() || r; + r = _glewInit_GL_ARB_vertex_array_object() || r; + + r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; + r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; + r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; + r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; + r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; + r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; + r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; + r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; + r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; + r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; + r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; + r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; + r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; + r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; + r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; + r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; + r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; + r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; + r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; + r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; + r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; + r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; + r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; + r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; + r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; + r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; + r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; + r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; + r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; + r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; + r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; + r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; + r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; + r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; + r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; + r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; + r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; + r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; + r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; + r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; + r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; + r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; + r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; + r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; + r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; + r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; + r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; + r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; + r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; + r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; + r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; + r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; + r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; + r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; + r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_0 */ + +#ifdef GL_VERSION_3_1 + +static GLboolean _glewInit_GL_VERSION_3_1 () +{ + GLboolean r = GL_FALSE; + + r = _glewInit_GL_ARB_copy_buffer() || r; + + r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; + r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; + r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; + r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_1 */ + +#ifdef GL_VERSION_3_2 + +static GLboolean _glewInit_GL_VERSION_3_2 () +{ + GLboolean r = GL_FALSE; + + r = _glewInit_GL_ARB_draw_elements_base_vertex() || r; + r = _glewInit_GL_ARB_provoking_vertex() || r; + r = _glewInit_GL_ARB_sync() || r; + r = _glewInit_GL_ARB_texture_multisample() || r; + + r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; + r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; + r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_2 */ + +#ifdef GL_VERSION_3_3 + +static GLboolean _glewInit_GL_VERSION_3_3 () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_3 */ + +#ifdef GL_VERSION_4_0 + +static GLboolean _glewInit_GL_VERSION_4_0 () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; + r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; + r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; + r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; + r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_0 */ + +#ifdef GL_VERSION_4_5 + +static GLboolean _glewInit_GL_VERSION_4_5 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatus")) == NULL) || r; + r = ((glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImage")) == NULL) || r; + r = ((glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImage")) == NULL) || r; + r = ((glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_5 */ + +#ifdef GL_VERSION_4_6 + +static GLboolean _glewInit_GL_VERSION_4_6 () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCount")) == NULL) || r; + r = ((glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCount")) == NULL) || r; + r = ((glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)glewGetProcAddress((const GLubyte*)"glSpecializeShader")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_6 */ + +#ifdef GL_3DFX_tbuffer + +static GLboolean _glewInit_GL_3DFX_tbuffer () +{ + GLboolean r = GL_FALSE; + + r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; + + return r; +} + +#endif /* GL_3DFX_tbuffer */ + +#ifdef GL_AMD_debug_output + +static GLboolean _glewInit_GL_AMD_debug_output () +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; + r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; + r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; + r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_debug_output */ + +#ifdef GL_AMD_draw_buffers_blend + +static GLboolean _glewInit_GL_AMD_draw_buffers_blend () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; + r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; + r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; + r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_draw_buffers_blend */ + +#ifdef GL_AMD_framebuffer_sample_positions + +static GLboolean _glewInit_GL_AMD_framebuffer_sample_positions () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferSamplePositionsfvAMD = (PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSamplePositionsfvAMD")) == NULL) || r; + r = ((glGetFramebufferParameterfvAMD = (PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterfvAMD")) == NULL) || r; + r = ((glGetNamedFramebufferParameterfvAMD = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterfvAMD")) == NULL) || r; + r = ((glNamedFramebufferSamplePositionsfvAMD = (PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSamplePositionsfvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_framebuffer_sample_positions */ + +#ifdef GL_AMD_interleaved_elements + +static GLboolean _glewInit_GL_AMD_interleaved_elements () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribParameteriAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_interleaved_elements */ + +#ifdef GL_AMD_multi_draw_indirect + +static GLboolean _glewInit_GL_AMD_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; + r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_multi_draw_indirect */ + +#ifdef GL_AMD_name_gen_delete + +static GLboolean _glewInit_GL_AMD_name_gen_delete () +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; + r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; + r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_name_gen_delete */ + +#ifdef GL_AMD_occlusion_query_event + +static GLboolean _glewInit_GL_AMD_occlusion_query_event () +{ + GLboolean r = GL_FALSE; + + r = ((glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)glewGetProcAddress((const GLubyte*)"glQueryObjectParameteruiAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_occlusion_query_event */ + +#ifdef GL_AMD_performance_monitor + +static GLboolean _glewInit_GL_AMD_performance_monitor () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; + r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; + r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; + r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; + r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_performance_monitor */ + +#ifdef GL_AMD_sample_positions + +static GLboolean _glewInit_GL_AMD_sample_positions () +{ + GLboolean r = GL_FALSE; + + r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sample_positions */ + +#ifdef GL_AMD_sparse_texture + +static GLboolean _glewInit_GL_AMD_sparse_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTexStorageSparseAMD")) == NULL) || r; + r = ((glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageSparseAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sparse_texture */ + +#ifdef GL_AMD_stencil_operation_extended + +static GLboolean _glewInit_GL_AMD_stencil_operation_extended () +{ + GLboolean r = GL_FALSE; + + r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_stencil_operation_extended */ + +#ifdef GL_AMD_vertex_shader_tessellator + +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator () +{ + GLboolean r = GL_FALSE; + + r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; + r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifdef GL_ANGLE_framebuffer_blit + +static GLboolean _glewInit_GL_ANGLE_framebuffer_blit () +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_framebuffer_blit */ + +#ifdef GL_ANGLE_framebuffer_multisample + +static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_framebuffer_multisample */ + +#ifdef GL_ANGLE_instanced_arrays + +static GLboolean _glewInit_GL_ANGLE_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedANGLE")) == NULL) || r; + r = ((glDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedANGLE")) == NULL) || r; + r = ((glVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_instanced_arrays */ + +#ifdef GL_ANGLE_timer_query + +static GLboolean _glewInit_GL_ANGLE_timer_query () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryANGLE = (PFNGLBEGINQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryANGLE")) == NULL) || r; + r = ((glDeleteQueriesANGLE = (PFNGLDELETEQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesANGLE")) == NULL) || r; + r = ((glEndQueryANGLE = (PFNGLENDQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glEndQueryANGLE")) == NULL) || r; + r = ((glGenQueriesANGLE = (PFNGLGENQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesANGLE")) == NULL) || r; + r = ((glGetQueryObjecti64vANGLE = (PFNGLGETQUERYOBJECTI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vANGLE")) == NULL) || r; + r = ((glGetQueryObjectivANGLE = (PFNGLGETQUERYOBJECTIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivANGLE")) == NULL) || r; + r = ((glGetQueryObjectui64vANGLE = (PFNGLGETQUERYOBJECTUI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vANGLE")) == NULL) || r; + r = ((glGetQueryObjectuivANGLE = (PFNGLGETQUERYOBJECTUIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivANGLE")) == NULL) || r; + r = ((glGetQueryivANGLE = (PFNGLGETQUERYIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivANGLE")) == NULL) || r; + r = ((glIsQueryANGLE = (PFNGLISQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glIsQueryANGLE")) == NULL) || r; + r = ((glQueryCounterANGLE = (PFNGLQUERYCOUNTERANGLEPROC)glewGetProcAddress((const GLubyte*)"glQueryCounterANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_timer_query */ + +#ifdef GL_ANGLE_translated_shader_source + +static GLboolean _glewInit_GL_ANGLE_translated_shader_source () +{ + GLboolean r = GL_FALSE; + + r = ((glGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetTranslatedShaderSourceANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_translated_shader_source */ + +#ifdef GL_APPLE_copy_texture_levels + +static GLboolean _glewInit_GL_APPLE_copy_texture_levels () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTextureLevelsAPPLE = (PFNGLCOPYTEXTURELEVELSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureLevelsAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_copy_texture_levels */ + +#ifdef GL_APPLE_element_array + +static GLboolean _glewInit_GL_APPLE_element_array () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; + r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; + r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; + r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; + r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_element_array */ + +#ifdef GL_APPLE_fence + +static GLboolean _glewInit_GL_APPLE_fence () +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; + r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; + r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; + r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; + r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; + r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; + r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; + r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_fence */ + +#ifdef GL_APPLE_flush_buffer_range + +static GLboolean _glewInit_GL_APPLE_flush_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; + r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_flush_buffer_range */ + +#ifdef GL_APPLE_framebuffer_multisample + +static GLboolean _glewInit_GL_APPLE_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleAPPLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleAPPLE")) == NULL) || r; + r = ((glResolveMultisampleFramebufferAPPLE = (PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glResolveMultisampleFramebufferAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_framebuffer_multisample */ + +#ifdef GL_APPLE_object_purgeable + +static GLboolean _glewInit_GL_APPLE_object_purgeable () +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; + r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; + r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_object_purgeable */ + +#ifdef GL_APPLE_sync + +static GLboolean _glewInit_GL_APPLE_sync () +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSyncAPPLE = (PFNGLCLIENTWAITSYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSyncAPPLE")) == NULL) || r; + r = ((glDeleteSyncAPPLE = (PFNGLDELETESYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteSyncAPPLE")) == NULL) || r; + r = ((glFenceSyncAPPLE = (PFNGLFENCESYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFenceSyncAPPLE")) == NULL) || r; + r = ((glGetInteger64vAPPLE = (PFNGLGETINTEGER64VAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64vAPPLE")) == NULL) || r; + r = ((glGetSyncivAPPLE = (PFNGLGETSYNCIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetSyncivAPPLE")) == NULL) || r; + r = ((glIsSyncAPPLE = (PFNGLISSYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsSyncAPPLE")) == NULL) || r; + r = ((glWaitSyncAPPLE = (PFNGLWAITSYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glWaitSyncAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_sync */ + +#ifdef GL_APPLE_texture_range + +static GLboolean _glewInit_GL_APPLE_texture_range () +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; + r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_texture_range */ + +#ifdef GL_APPLE_vertex_array_object + +static GLboolean _glewInit_GL_APPLE_vertex_array_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; + r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; + r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; + r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_object */ + +#ifdef GL_APPLE_vertex_array_range + +static GLboolean _glewInit_GL_APPLE_vertex_array_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; + r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; + r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_range */ + +#ifdef GL_APPLE_vertex_program_evaluators + +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators () +{ + GLboolean r = GL_FALSE; + + r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; + r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; + r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifdef GL_ARB_ES2_compatibility + +static GLboolean _glewInit_GL_ARB_ES2_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; + r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; + r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; + r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; + r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES2_compatibility */ + +#ifdef GL_ARB_ES3_1_compatibility + +static GLboolean _glewInit_GL_ARB_ES3_1_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierByRegion")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES3_1_compatibility */ + +#ifdef GL_ARB_ES3_2_compatibility + +static GLboolean _glewInit_GL_ARB_ES3_2_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveBoundingBoxARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES3_2_compatibility */ + +#ifdef GL_ARB_base_instance + +static GLboolean _glewInit_GL_ARB_base_instance () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_base_instance */ + +#ifdef GL_ARB_bindless_texture + +static GLboolean _glewInit_GL_ARB_bindless_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleARB")) == NULL) || r; + r = ((glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleARB")) == NULL) || r; + r = ((glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleARB")) == NULL) || r; + r = ((glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vARB")) == NULL) || r; + r = ((glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentARB")) == NULL) || r; + r = ((glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentARB")) == NULL) || r; + r = ((glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentARB")) == NULL) || r; + r = ((glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentARB")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentARB")) == NULL) || r; + r = ((glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentARB")) == NULL) || r; + r = ((glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64ARB")) == NULL) || r; + r = ((glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vARB")) == NULL) || r; + r = ((glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64ARB")) == NULL) || r; + r = ((glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vARB")) == NULL) || r; + r = ((glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64ARB")) == NULL) || r; + r = ((glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_bindless_texture */ + +#ifdef GL_ARB_blend_func_extended + +static GLboolean _glewInit_GL_ARB_blend_func_extended () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; + r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_blend_func_extended */ + +#ifdef GL_ARB_buffer_storage + +static GLboolean _glewInit_GL_ARB_buffer_storage () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorage = (PFNGLBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glBufferStorage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_buffer_storage */ + +#ifdef GL_ARB_cl_event + +static GLboolean _glewInit_GL_ARB_cl_event () +{ + GLboolean r = GL_FALSE; + + r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_cl_event */ + +#ifdef GL_ARB_clear_buffer_object + +static GLboolean _glewInit_GL_ARB_clear_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; + r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; + r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; + r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_buffer_object */ + +#ifdef GL_ARB_clear_texture + +static GLboolean _glewInit_GL_ARB_clear_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexImage")) == NULL) || r; + r = ((glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_texture */ + +#ifdef GL_ARB_clip_control + +static GLboolean _glewInit_GL_ARB_clip_control () +{ + GLboolean r = GL_FALSE; + + r = ((glClipControl = (PFNGLCLIPCONTROLPROC)glewGetProcAddress((const GLubyte*)"glClipControl")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clip_control */ + +#ifdef GL_ARB_color_buffer_float + +static GLboolean _glewInit_GL_ARB_color_buffer_float () +{ + GLboolean r = GL_FALSE; + + r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_color_buffer_float */ + +#ifdef GL_ARB_compute_shader + +static GLboolean _glewInit_GL_ARB_compute_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; + r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_shader */ + +#ifdef GL_ARB_compute_variable_group_size + +static GLboolean _glewInit_GL_ARB_compute_variable_group_size () +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeGroupSizeARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_variable_group_size */ + +#ifdef GL_ARB_copy_buffer + +static GLboolean _glewInit_GL_ARB_copy_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_buffer */ + +#ifdef GL_ARB_copy_image + +static GLboolean _glewInit_GL_ARB_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_image */ + +#ifdef GL_ARB_debug_output + +static GLboolean _glewInit_GL_ARB_debug_output () +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; + r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; + r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; + r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_debug_output */ + +#ifdef GL_ARB_direct_state_access + +static GLboolean _glewInit_GL_ARB_direct_state_access () +{ + GLboolean r = GL_FALSE; + + r = ((glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnit")) == NULL) || r; + r = ((glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitNamedFramebuffer")) == NULL) || r; + r = ((glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatus")) == NULL) || r; + r = ((glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferData")) == NULL) || r; + r = ((glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubData")) == NULL) || r; + r = ((glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfi")) == NULL) || r; + r = ((glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfv")) == NULL) || r; + r = ((glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferiv")) == NULL) || r; + r = ((glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferuiv")) == NULL) || r; + r = ((glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1D")) == NULL) || r; + r = ((glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2D")) == NULL) || r; + r = ((glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3D")) == NULL) || r; + r = ((glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyNamedBufferSubData")) == NULL) || r; + r = ((glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1D")) == NULL) || r; + r = ((glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2D")) == NULL) || r; + r = ((glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3D")) == NULL) || r; + r = ((glCreateBuffers = (PFNGLCREATEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateBuffers")) == NULL) || r; + r = ((glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateFramebuffers")) == NULL) || r; + r = ((glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramPipelines")) == NULL) || r; + r = ((glCreateQueries = (PFNGLCREATEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glCreateQueries")) == NULL) || r; + r = ((glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateRenderbuffers")) == NULL) || r; + r = ((glCreateSamplers = (PFNGLCREATESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glCreateSamplers")) == NULL) || r; + r = ((glCreateTextures = (PFNGLCREATETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glCreateTextures")) == NULL) || r; + r = ((glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glCreateTransformFeedbacks")) == NULL) || r; + r = ((glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glCreateVertexArrays")) == NULL) || r; + r = ((glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttrib")) == NULL) || r; + r = ((glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttrib")) == NULL) || r; + r = ((glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRange")) == NULL) || r; + r = ((glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmap")) == NULL) || r; + r = ((glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImage")) == NULL) || r; + r = ((glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteri64v")) == NULL) || r; + r = ((glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteriv")) == NULL) || r; + r = ((glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointerv")) == NULL) || r; + r = ((glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubData")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameteriv")) == NULL) || r; + r = ((glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjecti64v")) == NULL) || r; + r = ((glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectiv")) == NULL) || r; + r = ((glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectui64v")) == NULL) || r; + r = ((glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectuiv")) == NULL) || r; + r = ((glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImage")) == NULL) || r; + r = ((glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfv")) == NULL) || r; + r = ((glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameteriv")) == NULL) || r; + r = ((glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIiv")) == NULL) || r; + r = ((glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuiv")) == NULL) || r; + r = ((glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfv")) == NULL) || r; + r = ((glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameteriv")) == NULL) || r; + r = ((glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki64_v")) == NULL) || r; + r = ((glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki_v")) == NULL) || r; + r = ((glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackiv")) == NULL) || r; + r = ((glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexed64iv")) == NULL) || r; + r = ((glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexediv")) == NULL) || r; + r = ((glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayiv")) == NULL) || r; + r = ((glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferData")) == NULL) || r; + r = ((glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferSubData")) == NULL) || r; + r = ((glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBuffer")) == NULL) || r; + r = ((glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRange")) == NULL) || r; + r = ((glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferData")) == NULL) || r; + r = ((glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorage")) == NULL) || r; + r = ((glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubData")) == NULL) || r; + r = ((glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffer")) == NULL) || r; + r = ((glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffers")) == NULL) || r; + r = ((glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteri")) == NULL) || r; + r = ((glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferReadBuffer")) == NULL) || r; + r = ((glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbuffer")) == NULL) || r; + r = ((glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture")) == NULL) || r; + r = ((glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayer")) == NULL) || r; + r = ((glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorage")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisample")) == NULL) || r; + r = ((glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTextureBuffer")) == NULL) || r; + r = ((glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRange")) == NULL) || r; + r = ((glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIiv")) == NULL) || r; + r = ((glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuiv")) == NULL) || r; + r = ((glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterf")) == NULL) || r; + r = ((glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfv")) == NULL) || r; + r = ((glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteri")) == NULL) || r; + r = ((glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriv")) == NULL) || r; + r = ((glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1D")) == NULL) || r; + r = ((glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2D")) == NULL) || r; + r = ((glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisample")) == NULL) || r; + r = ((glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3D")) == NULL) || r; + r = ((glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisample")) == NULL) || r; + r = ((glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1D")) == NULL) || r; + r = ((glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2D")) == NULL) || r; + r = ((glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3D")) == NULL) || r; + r = ((glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferBase")) == NULL) || r; + r = ((glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferRange")) == NULL) || r; + r = ((glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBuffer")) == NULL) || r; + r = ((glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribBinding")) == NULL) || r; + r = ((glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribFormat")) == NULL) || r; + r = ((glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribIFormat")) == NULL) || r; + r = ((glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribLFormat")) == NULL) || r; + r = ((glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindingDivisor")) == NULL) || r; + r = ((glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayElementBuffer")) == NULL) || r; + r = ((glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffer")) == NULL) || r; + r = ((glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffers")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_direct_state_access */ + +#ifdef GL_ARB_draw_buffers + +static GLboolean _glewInit_GL_ARB_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers */ + +#ifdef GL_ARB_draw_buffers_blend + +static GLboolean _glewInit_GL_ARB_draw_buffers_blend () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; + r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; + r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; + r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers_blend */ + +#ifdef GL_ARB_draw_elements_base_vertex + +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifdef GL_ARB_draw_indirect + +static GLboolean _glewInit_GL_ARB_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; + r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_indirect */ + +#ifdef GL_ARB_framebuffer_no_attachments + +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; + r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; + r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifdef GL_ARB_framebuffer_object + +static GLboolean _glewInit_GL_ARB_framebuffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; + r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; + r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; + r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; + r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; + r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; + r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; + r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; + r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; + r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; + r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; + r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; + r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; + r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; + r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; + r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; + r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_object */ + +#ifdef GL_ARB_geometry_shader4 + +static GLboolean _glewInit_GL_ARB_geometry_shader4 () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; + r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; + r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; + r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_geometry_shader4 */ + +#ifdef GL_ARB_get_program_binary + +static GLboolean _glewInit_GL_ARB_get_program_binary () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; + r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; + r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_program_binary */ + +#ifdef GL_ARB_get_texture_sub_image + +static GLboolean _glewInit_GL_ARB_get_texture_sub_image () +{ + GLboolean r = GL_FALSE; + + r = ((glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureSubImage")) == NULL) || r; + r = ((glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_texture_sub_image */ + +#ifdef GL_ARB_gl_spirv + +static GLboolean _glewInit_GL_ARB_gl_spirv () +{ + GLboolean r = GL_FALSE; + + r = ((glSpecializeShaderARB = (PFNGLSPECIALIZESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glSpecializeShaderARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gl_spirv */ + +#ifdef GL_ARB_gpu_shader_fp64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; + r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; + r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; + r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; + r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; + r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; + r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; + r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; + r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; + r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; + r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; + r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; + r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; + r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; + r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; + r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; + r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; + r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifdef GL_ARB_gpu_shader_int64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_int64 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vARB")) == NULL) || r; + r = ((glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vARB")) == NULL) || r; + r = ((glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformi64vARB")) == NULL) || r; + r = ((glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformui64vARB")) == NULL) || r; + r = ((glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64ARB")) == NULL) || r; + r = ((glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vARB")) == NULL) || r; + r = ((glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64ARB")) == NULL) || r; + r = ((glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vARB")) == NULL) || r; + r = ((glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64ARB")) == NULL) || r; + r = ((glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vARB")) == NULL) || r; + r = ((glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64ARB")) == NULL) || r; + r = ((glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vARB")) == NULL) || r; + r = ((glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64ARB")) == NULL) || r; + r = ((glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vARB")) == NULL) || r; + r = ((glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64ARB")) == NULL) || r; + r = ((glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vARB")) == NULL) || r; + r = ((glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64ARB")) == NULL) || r; + r = ((glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vARB")) == NULL) || r; + r = ((glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64ARB")) == NULL) || r; + r = ((glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vARB")) == NULL) || r; + r = ((glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64ARB")) == NULL) || r; + r = ((glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vARB")) == NULL) || r; + r = ((glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64ARB")) == NULL) || r; + r = ((glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vARB")) == NULL) || r; + r = ((glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64ARB")) == NULL) || r; + r = ((glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vARB")) == NULL) || r; + r = ((glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64ARB")) == NULL) || r; + r = ((glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vARB")) == NULL) || r; + r = ((glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64ARB")) == NULL) || r; + r = ((glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vARB")) == NULL) || r; + r = ((glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64ARB")) == NULL) || r; + r = ((glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vARB")) == NULL) || r; + r = ((glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64ARB")) == NULL) || r; + r = ((glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vARB")) == NULL) || r; + r = ((glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64ARB")) == NULL) || r; + r = ((glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_int64 */ + +#ifdef GL_ARB_imaging + +static GLboolean _glewInit_GL_ARB_imaging () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; + r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; + r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; + r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; + r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; + r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; + r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; + r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; + r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; + r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; + r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; + r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; + r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; + r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; + r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; + r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; + r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; + r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; + r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; + r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; + r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; + r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; + r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; + r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; + r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; + r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; + r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; + r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; + r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; + r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; + r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; + r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_imaging */ + +#ifdef GL_ARB_indirect_parameters + +static GLboolean _glewInit_GL_ARB_indirect_parameters () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCountARB")) == NULL) || r; + r = ((glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCountARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_indirect_parameters */ + +#ifdef GL_ARB_instanced_arrays + +static GLboolean _glewInit_GL_ARB_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; + r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; + r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_instanced_arrays */ + +#ifdef GL_ARB_internalformat_query + +static GLboolean _glewInit_GL_ARB_internalformat_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query */ + +#ifdef GL_ARB_internalformat_query2 + +static GLboolean _glewInit_GL_ARB_internalformat_query2 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query2 */ + +#ifdef GL_ARB_invalidate_subdata + +static GLboolean _glewInit_GL_ARB_invalidate_subdata () +{ + GLboolean r = GL_FALSE; + + r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; + r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; + r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; + r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; + r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; + r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_invalidate_subdata */ + +#ifdef GL_ARB_map_buffer_range + +static GLboolean _glewInit_GL_ARB_map_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; + r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_map_buffer_range */ + +#ifdef GL_ARB_matrix_palette + +static GLboolean _glewInit_GL_ARB_matrix_palette () +{ + GLboolean r = GL_FALSE; + + r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; + r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; + r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; + r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; + r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_matrix_palette */ + +#ifdef GL_ARB_multi_bind + +static GLboolean _glewInit_GL_ARB_multi_bind () +{ + GLboolean r = GL_FALSE; + + r = ((glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersBase")) == NULL) || r; + r = ((glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersRange")) == NULL) || r; + r = ((glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextures")) == NULL) || r; + r = ((glBindSamplers = (PFNGLBINDSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glBindSamplers")) == NULL) || r; + r = ((glBindTextures = (PFNGLBINDTEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindTextures")) == NULL) || r; + r = ((glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffers")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_bind */ + +#ifdef GL_ARB_multi_draw_indirect + +static GLboolean _glewInit_GL_ARB_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; + r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_draw_indirect */ + +#ifdef GL_ARB_multisample + +static GLboolean _glewInit_GL_ARB_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multisample */ + +#ifdef GL_ARB_multitexture + +static GLboolean _glewInit_GL_ARB_multitexture () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; + r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; + r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; + r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; + r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; + r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; + r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; + r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; + r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; + r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; + r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; + r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; + r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; + r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; + r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; + r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; + r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; + r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; + r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; + r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; + r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; + r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; + r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; + r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; + r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; + r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; + r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; + r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; + r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; + r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; + r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; + r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; + r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; + r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multitexture */ + +#ifdef GL_ARB_occlusion_query + +static GLboolean _glewInit_GL_ARB_occlusion_query () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; + r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; + r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; + r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; + r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; + r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; + r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; + r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_occlusion_query */ + +#ifdef GL_ARB_parallel_shader_compile + +static GLboolean _glewInit_GL_ARB_parallel_shader_compile () +{ + GLboolean r = GL_FALSE; + + r = ((glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)glewGetProcAddress((const GLubyte*)"glMaxShaderCompilerThreadsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_parallel_shader_compile */ + +#ifdef GL_ARB_point_parameters + +static GLboolean _glewInit_GL_ARB_point_parameters () +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; + r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_point_parameters */ + +#ifdef GL_ARB_polygon_offset_clamp + +static GLboolean _glewInit_GL_ARB_polygon_offset_clamp () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetClamp")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_polygon_offset_clamp */ + +#ifdef GL_ARB_program_interface_query + +static GLboolean _glewInit_GL_ARB_program_interface_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; + r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; + r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; + r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; + r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; + r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_program_interface_query */ + +#ifdef GL_ARB_provoking_vertex + +static GLboolean _glewInit_GL_ARB_provoking_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_provoking_vertex */ + +#ifdef GL_ARB_robustness + +static GLboolean _glewInit_GL_ARB_robustness () +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; + r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; + r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; + r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; + r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; + r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; + r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; + r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; + r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; + r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; + r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; + r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; + r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; + r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; + r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; + r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; + r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; + r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; + r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; + r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_robustness */ + +#ifdef GL_ARB_sample_locations + +static GLboolean _glewInit_GL_ARB_sample_locations () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvARB")) == NULL) || r; + r = ((glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_locations */ + +#ifdef GL_ARB_sample_shading + +static GLboolean _glewInit_GL_ARB_sample_shading () +{ + GLboolean r = GL_FALSE; + + r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_shading */ + +#ifdef GL_ARB_sampler_objects + +static GLboolean _glewInit_GL_ARB_sampler_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; + r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; + r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; + r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; + r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; + r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; + r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; + r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; + r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; + r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; + r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; + r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; + r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; + r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sampler_objects */ + +#ifdef GL_ARB_separate_shader_objects + +static GLboolean _glewInit_GL_ARB_separate_shader_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; + r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; + r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; + r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; + r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; + r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; + r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; + r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; + r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; + r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; + r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; + r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; + r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; + r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; + r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; + r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; + r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; + r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; + r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; + r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; + r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; + r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; + r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; + r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; + r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; + r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; + r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; + r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; + r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; + r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; + r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; + r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; + r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; + r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; + r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; + r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; + r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; + r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; + r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; + r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; + r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; + r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; + r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; + r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; + r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; + r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_separate_shader_objects */ + +#ifdef GL_ARB_shader_atomic_counters + +static GLboolean _glewInit_GL_ARB_shader_atomic_counters () +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_atomic_counters */ + +#ifdef GL_ARB_shader_image_load_store + +static GLboolean _glewInit_GL_ARB_shader_image_load_store () +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; + r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_image_load_store */ + +#ifdef GL_ARB_shader_objects + +static GLboolean _glewInit_GL_ARB_shader_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; + r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; + r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; + r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; + r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; + r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; + r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; + r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; + r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; + r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; + r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; + r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; + r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; + r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; + r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; + r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; + r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; + r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; + r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; + r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; + r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; + r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; + r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; + r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; + r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; + r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; + r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; + r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; + r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; + r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; + r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; + r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; + r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; + r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; + r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; + r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; + r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; + r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; + r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_objects */ + +#ifdef GL_ARB_shader_storage_buffer_object + +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifdef GL_ARB_shader_subroutine + +static GLboolean _glewInit_GL_ARB_shader_subroutine () +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; + r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; + r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; + r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; + r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; + r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_subroutine */ + +#ifdef GL_ARB_shading_language_include + +static GLboolean _glewInit_GL_ARB_shading_language_include () +{ + GLboolean r = GL_FALSE; + + r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; + r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; + r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; + r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shading_language_include */ + +#ifdef GL_ARB_sparse_buffer + +static GLboolean _glewInit_GL_ARB_sparse_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glBufferPageCommitmentARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sparse_buffer */ + +#ifdef GL_ARB_sparse_texture + +static GLboolean _glewInit_GL_ARB_sparse_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sparse_texture */ + +#ifdef GL_ARB_sync + +static GLboolean _glewInit_GL_ARB_sync () +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; + r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; + r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; + r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; + r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; + r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; + r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sync */ + +#ifdef GL_ARB_tessellation_shader + +static GLboolean _glewInit_GL_ARB_tessellation_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; + r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_tessellation_shader */ + +#ifdef GL_ARB_texture_barrier + +static GLboolean _glewInit_GL_ARB_texture_barrier () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_barrier */ + +#ifdef GL_ARB_texture_buffer_object + +static GLboolean _glewInit_GL_ARB_texture_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_object */ + +#ifdef GL_ARB_texture_buffer_range + +static GLboolean _glewInit_GL_ARB_texture_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; + r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_range */ + +#ifdef GL_ARB_texture_compression + +static GLboolean _glewInit_GL_ARB_texture_compression () +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; + r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; + r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; + r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; + r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; + r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; + r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_compression */ + +#ifdef GL_ARB_texture_multisample + +static GLboolean _glewInit_GL_ARB_texture_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; + r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; + r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; + r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_multisample */ + +#ifdef GL_ARB_texture_storage + +static GLboolean _glewInit_GL_ARB_texture_storage () +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; + r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; + r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage */ + +#ifdef GL_ARB_texture_storage_multisample + +static GLboolean _glewInit_GL_ARB_texture_storage_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; + r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; + r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage_multisample */ + +#ifdef GL_ARB_texture_view + +static GLboolean _glewInit_GL_ARB_texture_view () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_view */ + +#ifdef GL_ARB_timer_query + +static GLboolean _glewInit_GL_ARB_timer_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; + r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; + r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_timer_query */ + +#ifdef GL_ARB_transform_feedback2 + +static GLboolean _glewInit_GL_ARB_transform_feedback2 () +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; + r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; + r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; + r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; + r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; + r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; + r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback2 */ + +#ifdef GL_ARB_transform_feedback3 + +static GLboolean _glewInit_GL_ARB_transform_feedback3 () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; + r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; + r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; + r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback3 */ + +#ifdef GL_ARB_transform_feedback_instanced + +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; + r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifdef GL_ARB_transpose_matrix + +static GLboolean _glewInit_GL_ARB_transpose_matrix () +{ + GLboolean r = GL_FALSE; + + r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; + r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; + r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; + r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transpose_matrix */ + +#ifdef GL_ARB_uniform_buffer_object + +static GLboolean _glewInit_GL_ARB_uniform_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; + r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; + r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; + r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; + r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; + r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; + r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; + r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; + r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; + r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_uniform_buffer_object */ + +#ifdef GL_ARB_vertex_array_object + +static GLboolean _glewInit_GL_ARB_vertex_array_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; + r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; + r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; + r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_array_object */ + +#ifdef GL_ARB_vertex_attrib_64bit + +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; + r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; + r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; + r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; + r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; + r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; + r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; + r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; + r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; + r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifdef GL_ARB_vertex_attrib_binding + +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding () +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; + r = ((glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindVertexBufferEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribBindingEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribFormatEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIFormatEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLFormatEXT")) == NULL) || r; + r = ((glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBindingDivisorEXT")) == NULL) || r; + r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; + r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; + r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; + r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; + r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifdef GL_ARB_vertex_blend + +static GLboolean _glewInit_GL_ARB_vertex_blend () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; + r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; + r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; + r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; + r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; + r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; + r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; + r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; + r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; + r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_blend */ + +#ifdef GL_ARB_vertex_buffer_object + +static GLboolean _glewInit_GL_ARB_vertex_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; + r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; + r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; + r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; + r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; + r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; + r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; + r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; + r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; + r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; + r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_buffer_object */ + +#ifdef GL_ARB_vertex_program + +static GLboolean _glewInit_GL_ARB_vertex_program () +{ + GLboolean r = GL_FALSE; + + r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; + r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; + r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; + r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; + r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; + r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; + r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; + r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; + r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; + r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; + r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; + r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; + r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; + r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; + r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; + r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; + r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; + r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; + r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; + r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; + r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; + r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; + r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; + r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; + r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; + r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; + r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; + r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; + r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; + r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; + r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; + r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; + r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; + r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; + r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; + r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; + r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; + r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; + r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; + r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; + r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; + r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; + r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; + r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; + r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; + r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; + r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; + r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; + r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; + r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; + r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; + r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; + r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; + r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; + r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; + r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; + r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; + r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; + r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; + r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_program */ + +#ifdef GL_ARB_vertex_shader + +static GLboolean _glewInit_GL_ARB_vertex_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; + r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; + r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_shader */ + +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev () +{ + GLboolean r = GL_FALSE; + + r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; + r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; + r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; + r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; + r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; + r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; + r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; + r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; + r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; + r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; + r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; + r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; + r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; + r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; + r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; + r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; + r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; + r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; + r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; + r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; + r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; + r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; + r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; + r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; + r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; + r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; + r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; + r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; + r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; + r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; + r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; + r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; + r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; + r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; + r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; + r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; + r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; + r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifdef GL_ARB_viewport_array + +static GLboolean _glewInit_GL_ARB_viewport_array () +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; + r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; + r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; + r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; + r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; + r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; + r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; + r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; + r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; + r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_viewport_array */ + +#ifdef GL_ARB_window_pos + +static GLboolean _glewInit_GL_ARB_window_pos () +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; + r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; + r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; + r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; + r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; + r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; + r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; + r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; + r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; + r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; + r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; + r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; + r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; + r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; + r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; + r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_window_pos */ + +#ifdef GL_ATI_draw_buffers + +static GLboolean _glewInit_GL_ATI_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_draw_buffers */ + +#ifdef GL_ATI_element_array + +static GLboolean _glewInit_GL_ATI_element_array () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; + r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; + r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_element_array */ + +#ifdef GL_ATI_envmap_bumpmap + +static GLboolean _glewInit_GL_ATI_envmap_bumpmap () +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; + r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; + r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; + r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_envmap_bumpmap */ + +#ifdef GL_ATI_fragment_shader + +static GLboolean _glewInit_GL_ATI_fragment_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; + r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; + r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; + r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; + r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; + r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; + r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; + r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; + r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; + r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; + r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; + r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; + r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; + r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_fragment_shader */ + +#ifdef GL_ATI_map_object_buffer + +static GLboolean _glewInit_GL_ATI_map_object_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; + r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_map_object_buffer */ + +#ifdef GL_ATI_pn_triangles + +static GLboolean _glewInit_GL_ATI_pn_triangles () +{ + GLboolean r = GL_FALSE; + + r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; + r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_pn_triangles */ + +#ifdef GL_ATI_separate_stencil + +static GLboolean _glewInit_GL_ATI_separate_stencil () +{ + GLboolean r = GL_FALSE; + + r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; + r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_separate_stencil */ + +#ifdef GL_ATI_vertex_array_object + +static GLboolean _glewInit_GL_ATI_vertex_array_object () +{ + GLboolean r = GL_FALSE; + + r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; + r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; + r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; + r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; + r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; + r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; + r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; + r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; + r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; + r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; + r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; + r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_array_object */ + +#ifdef GL_ATI_vertex_attrib_array_object + +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; + r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; + r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifdef GL_ATI_vertex_streams + +static GLboolean _glewInit_GL_ATI_vertex_streams () +{ + GLboolean r = GL_FALSE; + + r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; + r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; + r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; + r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; + r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; + r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; + r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; + r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; + r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; + r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; + r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; + r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; + r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; + r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; + r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; + r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; + r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; + r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; + r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; + r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; + r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; + r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; + r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; + r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; + r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; + r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; + r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; + r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; + r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; + r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; + r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; + r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; + r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; + r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; + r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; + r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; + r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; + r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; + r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; + r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; + r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; + r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; + r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; + r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_streams */ + +#ifdef GL_EXT_base_instance + +static GLboolean _glewInit_GL_EXT_base_instance () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstanceEXT = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstanceEXT")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstanceEXT = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstanceEXT")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstanceEXT = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstanceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_base_instance */ + +#ifdef GL_EXT_bindable_uniform + +static GLboolean _glewInit_GL_EXT_bindable_uniform () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; + r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; + r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_bindable_uniform */ + +#ifdef GL_EXT_blend_color + +static GLboolean _glewInit_GL_EXT_blend_color () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_color */ + +#ifdef GL_EXT_blend_equation_separate + +static GLboolean _glewInit_GL_EXT_blend_equation_separate () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_equation_separate */ + +#ifdef GL_EXT_blend_func_extended + +static GLboolean _glewInit_GL_EXT_blend_func_extended () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexedEXT = (PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexedEXT")) == NULL) || r; + r = ((glGetFragDataIndexEXT = (PFNGLGETFRAGDATAINDEXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndexEXT")) == NULL) || r; + r = ((glGetProgramResourceLocationIndexEXT = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_extended */ + +#ifdef GL_EXT_blend_func_separate + +static GLboolean _glewInit_GL_EXT_blend_func_separate () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_separate */ + +#ifdef GL_EXT_blend_minmax + +static GLboolean _glewInit_GL_EXT_blend_minmax () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_minmax */ + +#ifdef GL_EXT_buffer_storage + +static GLboolean _glewInit_GL_EXT_buffer_storage () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorageEXT = (PFNGLBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferStorageEXT")) == NULL) || r; + r = ((glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_buffer_storage */ + +#ifdef GL_EXT_clear_texture + +static GLboolean _glewInit_GL_EXT_clear_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glClearTexImageEXT = (PFNGLCLEARTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glClearTexImageEXT")) == NULL) || r; + r = ((glClearTexSubImageEXT = (PFNGLCLEARTEXSUBIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_clear_texture */ + +#ifdef GL_EXT_color_subtable + +static GLboolean _glewInit_GL_EXT_color_subtable () +{ + GLboolean r = GL_FALSE; + + r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; + r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_color_subtable */ + +#ifdef GL_EXT_compiled_vertex_array + +static GLboolean _glewInit_GL_EXT_compiled_vertex_array () +{ + GLboolean r = GL_FALSE; + + r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; + r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_compiled_vertex_array */ + +#ifdef GL_EXT_convolution + +static GLboolean _glewInit_GL_EXT_convolution () +{ + GLboolean r = GL_FALSE; + + r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; + r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; + r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; + r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; + r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; + r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; + r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; + r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; + r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; + r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; + r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_convolution */ + +#ifdef GL_EXT_coordinate_frame + +static GLboolean _glewInit_GL_EXT_coordinate_frame () +{ + GLboolean r = GL_FALSE; + + r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; + r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_coordinate_frame */ + +#ifdef GL_EXT_copy_image + +static GLboolean _glewInit_GL_EXT_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataEXT = (PFNGLCOPYIMAGESUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_image */ + +#ifdef GL_EXT_copy_texture + +static GLboolean _glewInit_GL_EXT_copy_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; + r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_texture */ + +#ifdef GL_EXT_cull_vertex + +static GLboolean _glewInit_GL_EXT_cull_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; + r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_cull_vertex */ + +#ifdef GL_EXT_debug_label + +static GLboolean _glewInit_GL_EXT_debug_label () +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabelEXT")) == NULL) || r; + r = ((glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)glewGetProcAddress((const GLubyte*)"glLabelObjectEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_label */ + +#ifdef GL_EXT_debug_marker + +static GLboolean _glewInit_GL_EXT_debug_marker () +{ + GLboolean r = GL_FALSE; + + r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; + r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; + r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_marker */ + +#ifdef GL_EXT_depth_bounds_test + +static GLboolean _glewInit_GL_EXT_depth_bounds_test () +{ + GLboolean r = GL_FALSE; + + r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_depth_bounds_test */ + +#ifdef GL_EXT_direct_state_access + +static GLboolean _glewInit_GL_EXT_direct_state_access () +{ + GLboolean r = GL_FALSE; + + r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; + r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; + r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; + r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; + r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; + r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; + r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; + r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; + r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; + r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; + r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; + r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; + r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; + r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; + r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; + r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; + r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; + r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; + r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; + r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; + r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; + r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; + r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; + r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; + r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; + r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; + r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; + r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; + r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; + r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; + r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; + r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; + r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; + r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; + r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; + r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; + r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; + r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; + r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; + r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; + r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; + r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; + r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; + r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; + r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; + r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; + r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; + r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; + r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; + r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; + r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; + r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; + r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; + r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; + r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; + r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; + r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; + r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; + r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; + r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; + r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; + r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; + r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; + r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; + r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; + r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; + r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; + r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; + r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; + r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; + r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; + r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; + r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; + r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; + r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; + r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; + r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; + r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; + r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; + r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; + r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; + r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; + r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; + r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; + r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; + r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; + r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; + r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; + r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; + r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; + r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; + r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; + r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; + r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; + r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; + r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; + r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; + r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; + r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; + r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; + r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; + r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; + r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; + r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; + r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; + r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; + r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; + r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; + r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; + r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; + r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; + r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; + r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; + r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; + r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; + r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; + r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; + r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; + r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; + r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; + r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; + r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; + r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; + r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; + r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; + r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; + r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; + r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; + r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; + r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; + r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; + r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; + r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribDivisorEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_direct_state_access */ + +#ifdef GL_EXT_discard_framebuffer + +static GLboolean _glewInit_GL_EXT_discard_framebuffer () +{ + GLboolean r = GL_FALSE; + + r = ((glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glDiscardFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_discard_framebuffer */ + +#ifdef GL_EXT_draw_buffers + +static GLboolean _glewInit_GL_EXT_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersEXT = (PFNGLDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers */ + +#ifdef GL_EXT_draw_buffers2 + +static GLboolean _glewInit_GL_EXT_draw_buffers2 () +{ + GLboolean r = GL_FALSE; + + r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; + r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; + r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; + r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; + r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; + r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers2 */ + +#ifdef GL_EXT_draw_buffers_indexed + +static GLboolean _glewInit_GL_EXT_draw_buffers_indexed () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiEXT = (PFNGLBLENDEQUATIONSEPARATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiEXT")) == NULL) || r; + r = ((glBlendEquationiEXT = (PFNGLBLENDEQUATIONIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiEXT")) == NULL) || r; + r = ((glBlendFuncSeparateiEXT = (PFNGLBLENDFUNCSEPARATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiEXT")) == NULL) || r; + r = ((glBlendFunciEXT = (PFNGLBLENDFUNCIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciEXT")) == NULL) || r; + r = ((glColorMaskiEXT = (PFNGLCOLORMASKIEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskiEXT")) == NULL) || r; + r = ((glDisableiEXT = (PFNGLDISABLEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableiEXT")) == NULL) || r; + r = ((glEnableiEXT = (PFNGLENABLEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableiEXT")) == NULL) || r; + r = ((glIsEnablediEXT = (PFNGLISENABLEDIEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnablediEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers_indexed */ + +#ifdef GL_EXT_draw_elements_base_vertex + +static GLboolean _glewInit_GL_EXT_draw_elements_base_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertexEXT = (PFNGLDRAWELEMENTSBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertexEXT")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexEXT = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexEXT")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertexEXT = (PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertexEXT")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertexEXT = (PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_elements_base_vertex */ + +#ifdef GL_EXT_draw_instanced + +static GLboolean _glewInit_GL_EXT_draw_instanced () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; + r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_instanced */ + +#ifdef GL_EXT_draw_range_elements + +static GLboolean _glewInit_GL_EXT_draw_range_elements () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_range_elements */ + +#ifdef GL_EXT_external_buffer + +static GLboolean _glewInit_GL_EXT_external_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorageExternalEXT = (PFNGLBUFFERSTORAGEEXTERNALEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferStorageExternalEXT")) == NULL) || r; + r = ((glNamedBufferStorageExternalEXT = (PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageExternalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_external_buffer */ + +#ifdef GL_EXT_fog_coord + +static GLboolean _glewInit_GL_EXT_fog_coord () +{ + GLboolean r = GL_FALSE; + + r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; + r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; + r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; + r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; + r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fog_coord */ + +#ifdef GL_EXT_fragment_lighting + +static GLboolean _glewInit_GL_EXT_fragment_lighting () +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; + r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; + r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; + r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; + r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; + r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; + r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; + r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; + r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; + r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; + r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; + r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; + r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; + r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; + r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; + r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; + r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; + r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fragment_lighting */ + +#ifdef GL_EXT_framebuffer_blit + +static GLboolean _glewInit_GL_EXT_framebuffer_blit () +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_blit */ + +#ifdef GL_EXT_framebuffer_multisample + +static GLboolean _glewInit_GL_EXT_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_multisample */ + +#ifdef GL_EXT_framebuffer_object + +static GLboolean _glewInit_GL_EXT_framebuffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; + r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; + r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; + r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; + r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; + r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; + r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; + r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; + r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; + r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; + r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; + r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; + r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; + r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_object */ + +#ifdef GL_EXT_geometry_shader4 + +static GLboolean _glewInit_GL_EXT_geometry_shader4 () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; + r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_geometry_shader4 */ + +#ifdef GL_EXT_gpu_program_parameters + +static GLboolean _glewInit_GL_EXT_gpu_program_parameters () +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; + r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_program_parameters */ + +#ifdef GL_EXT_gpu_shader4 + +static GLboolean _glewInit_GL_EXT_gpu_shader4 () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; + r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; + r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; + r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; + r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; + r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; + r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; + r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; + r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; + r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; + r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; + r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; + r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; + r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; + r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; + r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; + r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; + r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; + r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; + r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; + r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; + r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; + r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; + r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; + r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; + r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; + r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; + r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; + r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; + r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; + r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; + r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; + r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; + r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_shader4 */ + +#ifdef GL_EXT_histogram + +static GLboolean _glewInit_GL_EXT_histogram () +{ + GLboolean r = GL_FALSE; + + r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; + r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; + r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; + r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; + r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; + r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; + r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; + r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; + r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; + r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_histogram */ + +#ifdef GL_EXT_index_func + +static GLboolean _glewInit_GL_EXT_index_func () +{ + GLboolean r = GL_FALSE; + + r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_func */ + +#ifdef GL_EXT_index_material + +static GLboolean _glewInit_GL_EXT_index_material () +{ + GLboolean r = GL_FALSE; + + r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_material */ + +#ifdef GL_EXT_instanced_arrays + +static GLboolean _glewInit_GL_EXT_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisorEXT = (PFNGLVERTEXATTRIBDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_instanced_arrays */ + +#ifdef GL_EXT_light_texture + +static GLboolean _glewInit_GL_EXT_light_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; + r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; + r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_light_texture */ + +#ifdef GL_EXT_map_buffer_range + +static GLboolean _glewInit_GL_EXT_map_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRangeEXT = (PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeEXT")) == NULL) || r; + r = ((glMapBufferRangeEXT = (PFNGLMAPBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_map_buffer_range */ + +#ifdef GL_EXT_memory_object + +static GLboolean _glewInit_GL_EXT_memory_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorageMemEXT = (PFNGLBUFFERSTORAGEMEMEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferStorageMemEXT")) == NULL) || r; + r = ((glCreateMemoryObjectsEXT = (PFNGLCREATEMEMORYOBJECTSEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateMemoryObjectsEXT")) == NULL) || r; + r = ((glDeleteMemoryObjectsEXT = (PFNGLDELETEMEMORYOBJECTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteMemoryObjectsEXT")) == NULL) || r; + r = ((glGetMemoryObjectParameterivEXT = (PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMemoryObjectParameterivEXT")) == NULL) || r; + r = ((glGetUnsignedBytei_vEXT = (PFNGLGETUNSIGNEDBYTEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUnsignedBytei_vEXT")) == NULL) || r; + r = ((glGetUnsignedBytevEXT = (PFNGLGETUNSIGNEDBYTEVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUnsignedBytevEXT")) == NULL) || r; + r = ((glIsMemoryObjectEXT = (PFNGLISMEMORYOBJECTEXTPROC)glewGetProcAddress((const GLubyte*)"glIsMemoryObjectEXT")) == NULL) || r; + r = ((glMemoryObjectParameterivEXT = (PFNGLMEMORYOBJECTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryObjectParameterivEXT")) == NULL) || r; + r = ((glNamedBufferStorageMemEXT = (PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageMemEXT")) == NULL) || r; + r = ((glTexStorageMem1DEXT = (PFNGLTEXSTORAGEMEM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem1DEXT")) == NULL) || r; + r = ((glTexStorageMem2DEXT = (PFNGLTEXSTORAGEMEM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem2DEXT")) == NULL) || r; + r = ((glTexStorageMem2DMultisampleEXT = (PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem2DMultisampleEXT")) == NULL) || r; + r = ((glTexStorageMem3DEXT = (PFNGLTEXSTORAGEMEM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem3DEXT")) == NULL) || r; + r = ((glTexStorageMem3DMultisampleEXT = (PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem3DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorageMem1DEXT = (PFNGLTEXTURESTORAGEMEM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem1DEXT")) == NULL) || r; + r = ((glTextureStorageMem2DEXT = (PFNGLTEXTURESTORAGEMEM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem2DEXT")) == NULL) || r; + r = ((glTextureStorageMem2DMultisampleEXT = (PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorageMem3DEXT = (PFNGLTEXTURESTORAGEMEM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem3DEXT")) == NULL) || r; + r = ((glTextureStorageMem3DMultisampleEXT = (PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem3DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_memory_object */ + +#ifdef GL_EXT_memory_object_fd + +static GLboolean _glewInit_GL_EXT_memory_object_fd () +{ + GLboolean r = GL_FALSE; + + r = ((glImportMemoryFdEXT = (PFNGLIMPORTMEMORYFDEXTPROC)glewGetProcAddress((const GLubyte*)"glImportMemoryFdEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_memory_object_fd */ + +#ifdef GL_EXT_memory_object_win32 + +static GLboolean _glewInit_GL_EXT_memory_object_win32 () +{ + GLboolean r = GL_FALSE; + + r = ((glImportMemoryWin32HandleEXT = (PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportMemoryWin32HandleEXT")) == NULL) || r; + r = ((glImportMemoryWin32NameEXT = (PFNGLIMPORTMEMORYWIN32NAMEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportMemoryWin32NameEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_memory_object_win32 */ + +#ifdef GL_EXT_multi_draw_arrays + +static GLboolean _glewInit_GL_EXT_multi_draw_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; + r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_arrays */ + +#ifdef GL_EXT_multi_draw_indirect + +static GLboolean _glewInit_GL_EXT_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectEXT = (PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectEXT")) == NULL) || r; + r = ((glMultiDrawElementsIndirectEXT = (PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_indirect */ + +#ifdef GL_EXT_multisample + +static GLboolean _glewInit_GL_EXT_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; + r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisample */ + +#ifdef GL_EXT_multisampled_render_to_texture + +static GLboolean _glewInit_GL_EXT_multisampled_render_to_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisampled_render_to_texture */ + +#ifdef GL_EXT_multiview_draw_buffers + +static GLboolean _glewInit_GL_EXT_multiview_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersIndexedEXT = (PFNGLDRAWBUFFERSINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersIndexedEXT")) == NULL) || r; + r = ((glGetIntegeri_vEXT = (PFNGLGETINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_vEXT")) == NULL) || r; + r = ((glReadBufferIndexedEXT = (PFNGLREADBUFFERINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glReadBufferIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multiview_draw_buffers */ + +#ifdef GL_EXT_paletted_texture + +static GLboolean _glewInit_GL_EXT_paletted_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; + r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; + r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; + r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_paletted_texture */ + +#ifdef GL_EXT_pixel_transform + +static GLboolean _glewInit_GL_EXT_pixel_transform () +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; + r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; + r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; + r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_pixel_transform */ + +#ifdef GL_EXT_point_parameters + +static GLboolean _glewInit_GL_EXT_point_parameters () +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; + r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_point_parameters */ + +#ifdef GL_EXT_polygon_offset + +static GLboolean _glewInit_GL_EXT_polygon_offset () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset */ + +#ifdef GL_EXT_polygon_offset_clamp + +static GLboolean _glewInit_GL_EXT_polygon_offset_clamp () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetClampEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset_clamp */ + +#ifdef GL_EXT_provoking_vertex + +static GLboolean _glewInit_GL_EXT_provoking_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_provoking_vertex */ + +#ifdef GL_EXT_raster_multisample + +static GLboolean _glewInit_GL_EXT_raster_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationNV")) == NULL) || r; + r = ((glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationTableNV")) == NULL) || r; + r = ((glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glGetCoverageModulationTableNV")) == NULL) || r; + r = ((glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)glewGetProcAddress((const GLubyte*)"glRasterSamplesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_raster_multisample */ + +#ifdef GL_EXT_scene_marker + +static GLboolean _glewInit_GL_EXT_scene_marker () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; + r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_scene_marker */ + +#ifdef GL_EXT_secondary_color + +static GLboolean _glewInit_GL_EXT_secondary_color () +{ + GLboolean r = GL_FALSE; + + r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; + r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; + r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; + r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; + r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; + r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; + r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; + r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; + r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; + r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; + r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; + r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; + r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; + r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; + r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; + r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; + r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_secondary_color */ + +#ifdef GL_EXT_semaphore + +static GLboolean _glewInit_GL_EXT_semaphore () +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteSemaphoresEXT = (PFNGLDELETESEMAPHORESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteSemaphoresEXT")) == NULL) || r; + r = ((glGenSemaphoresEXT = (PFNGLGENSEMAPHORESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSemaphoresEXT")) == NULL) || r; + r = ((glGetSemaphoreParameterui64vEXT = (PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetSemaphoreParameterui64vEXT")) == NULL) || r; + r = ((glIsSemaphoreEXT = (PFNGLISSEMAPHOREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsSemaphoreEXT")) == NULL) || r; + r = ((glSemaphoreParameterui64vEXT = (PFNGLSEMAPHOREPARAMETERUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glSemaphoreParameterui64vEXT")) == NULL) || r; + r = ((glSignalSemaphoreEXT = (PFNGLSIGNALSEMAPHOREEXTPROC)glewGetProcAddress((const GLubyte*)"glSignalSemaphoreEXT")) == NULL) || r; + r = ((glWaitSemaphoreEXT = (PFNGLWAITSEMAPHOREEXTPROC)glewGetProcAddress((const GLubyte*)"glWaitSemaphoreEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_semaphore */ + +#ifdef GL_EXT_semaphore_fd + +static GLboolean _glewInit_GL_EXT_semaphore_fd () +{ + GLboolean r = GL_FALSE; + + r = ((glImportSemaphoreFdEXT = (PFNGLIMPORTSEMAPHOREFDEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSemaphoreFdEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_semaphore_fd */ + +#ifdef GL_EXT_semaphore_win32 + +static GLboolean _glewInit_GL_EXT_semaphore_win32 () +{ + GLboolean r = GL_FALSE; + + r = ((glImportSemaphoreWin32HandleEXT = (PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSemaphoreWin32HandleEXT")) == NULL) || r; + r = ((glImportSemaphoreWin32NameEXT = (PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSemaphoreWin32NameEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_semaphore_win32 */ + +#ifdef GL_EXT_separate_shader_objects + +static GLboolean _glewInit_GL_EXT_separate_shader_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; + r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; + r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_separate_shader_objects */ + +#ifdef GL_EXT_shader_image_load_store + +static GLboolean _glewInit_GL_EXT_shader_image_load_store () +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; + r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_image_load_store */ + +#ifdef GL_EXT_shader_pixel_local_storage2 + +static GLboolean _glewInit_GL_EXT_shader_pixel_local_storage2 () +{ + GLboolean r = GL_FALSE; + + r = ((glClearPixelLocalStorageuiEXT = (PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearPixelLocalStorageuiEXT")) == NULL) || r; + r = ((glFramebufferPixelLocalStorageSizeEXT = (PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferPixelLocalStorageSizeEXT")) == NULL) || r; + r = ((glGetFramebufferPixelLocalStorageSizeEXT = (PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferPixelLocalStorageSizeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +#ifdef GL_EXT_sparse_texture + +static GLboolean _glewInit_GL_EXT_sparse_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexPageCommitmentEXT = (PFNGLTEXPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentEXT")) == NULL) || r; + r = ((glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexturePageCommitmentEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_sparse_texture */ + +#ifdef GL_EXT_stencil_two_side + +static GLboolean _glewInit_GL_EXT_stencil_two_side () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_stencil_two_side */ + +#ifdef GL_EXT_subtexture + +static GLboolean _glewInit_GL_EXT_subtexture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; + r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; + r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_subtexture */ + +#ifdef GL_EXT_texture3D + +static GLboolean _glewInit_GL_EXT_texture3D () +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture3D */ + +#ifdef GL_EXT_texture_array + +static GLboolean _glewInit_GL_EXT_texture_array () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_array */ + +#ifdef GL_EXT_texture_buffer_object + +static GLboolean _glewInit_GL_EXT_texture_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_buffer_object */ + +#ifdef GL_EXT_texture_integer + +static GLboolean _glewInit_GL_EXT_texture_integer () +{ + GLboolean r = GL_FALSE; + + r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; + r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; + r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; + r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; + r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; + r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_integer */ + +#ifdef GL_EXT_texture_object + +static GLboolean _glewInit_GL_EXT_texture_object () +{ + GLboolean r = GL_FALSE; + + r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; + r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; + r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; + r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; + r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; + r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_object */ + +#ifdef GL_EXT_texture_perturb_normal + +static GLboolean _glewInit_GL_EXT_texture_perturb_normal () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_perturb_normal */ + +#ifdef GL_EXT_texture_storage + +static GLboolean _glewInit_GL_EXT_texture_storage () +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage1DEXT = (PFNGLTEXSTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1DEXT")) == NULL) || r; + r = ((glTexStorage2DEXT = (PFNGLTEXSTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DEXT")) == NULL) || r; + r = ((glTexStorage3DEXT = (PFNGLTEXSTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DEXT")) == NULL) || r; + r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; + r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; + r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_storage */ + +#ifdef GL_EXT_texture_view + +static GLboolean _glewInit_GL_EXT_texture_view () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureViewEXT = (PFNGLTEXTUREVIEWEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureViewEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_view */ + +#ifdef GL_EXT_timer_query + +static GLboolean _glewInit_GL_EXT_timer_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; + r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_timer_query */ + +#ifdef GL_EXT_transform_feedback + +static GLboolean _glewInit_GL_EXT_transform_feedback () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; + r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; + r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; + r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; + r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; + r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_transform_feedback */ + +#ifdef GL_EXT_vertex_array + +static GLboolean _glewInit_GL_EXT_vertex_array () +{ + GLboolean r = GL_FALSE; + + r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; + r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; + r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; + r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; + r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; + r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; + r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; + r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array */ + +#ifdef GL_EXT_vertex_array_setXXX + +static GLboolean _glewInit_GL_EXT_vertex_array_setXXX () +{ + GLboolean r = GL_FALSE; + + r = ((glBindArraySetEXT = (PFNGLBINDARRAYSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindArraySetEXT")) == NULL) || r; + r = ((glCreateArraySetExt = (PFNGLCREATEARRAYSETEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateArraySetExt")) == NULL) || r; + r = ((glDeleteArraySetsEXT = (PFNGLDELETEARRAYSETSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteArraySetsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array_setXXX */ + +#ifdef GL_EXT_vertex_attrib_64bit + +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; + r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; + r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; + r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; + r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; + r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; + r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; + r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; + r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; + r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifdef GL_EXT_vertex_shader + +static GLboolean _glewInit_GL_EXT_vertex_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; + r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; + r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; + r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; + r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; + r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; + r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; + r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; + r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; + r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; + r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; + r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; + r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; + r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; + r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; + r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; + r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; + r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; + r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; + r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; + r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; + r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; + r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; + r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; + r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; + r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; + r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; + r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; + r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; + r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; + r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; + r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; + r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; + r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; + r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; + r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; + r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; + r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; + r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; + r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; + r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; + r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_shader */ + +#ifdef GL_EXT_vertex_weighting + +static GLboolean _glewInit_GL_EXT_vertex_weighting () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; + r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; + r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_weighting */ + +#ifdef GL_EXT_win32_keyed_mutex + +static GLboolean _glewInit_GL_EXT_win32_keyed_mutex () +{ + GLboolean r = GL_FALSE; + + r = ((glAcquireKeyedMutexWin32EXT = (PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC)glewGetProcAddress((const GLubyte*)"glAcquireKeyedMutexWin32EXT")) == NULL) || r; + r = ((glReleaseKeyedMutexWin32EXT = (PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC)glewGetProcAddress((const GLubyte*)"glReleaseKeyedMutexWin32EXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_win32_keyed_mutex */ + +#ifdef GL_EXT_window_rectangles + +static GLboolean _glewInit_GL_EXT_window_rectangles () +{ + GLboolean r = GL_FALSE; + + r = ((glWindowRectanglesEXT = (PFNGLWINDOWRECTANGLESEXTPROC)glewGetProcAddress((const GLubyte*)"glWindowRectanglesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_window_rectangles */ + +#ifdef GL_EXT_x11_sync_object + +static GLboolean _glewInit_GL_EXT_x11_sync_object () +{ + GLboolean r = GL_FALSE; + + r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_x11_sync_object */ + +#ifdef GL_GREMEDY_frame_terminator + +static GLboolean _glewInit_GL_GREMEDY_frame_terminator () +{ + GLboolean r = GL_FALSE; + + r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_frame_terminator */ + +#ifdef GL_GREMEDY_string_marker + +static GLboolean _glewInit_GL_GREMEDY_string_marker () +{ + GLboolean r = GL_FALSE; + + r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_string_marker */ + +#ifdef GL_HP_image_transform + +static GLboolean _glewInit_GL_HP_image_transform () +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; + r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; + r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; + r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; + r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; + r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; + + return r; +} + +#endif /* GL_HP_image_transform */ + +#ifdef GL_IBM_multimode_draw_arrays + +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; + r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifdef GL_IBM_vertex_array_lists + +static GLboolean _glewInit_GL_IBM_vertex_array_lists () +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; + r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; + r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; + r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; + r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; + r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; + r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; + r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_vertex_array_lists */ + +#ifdef GL_INTEL_map_texture + +static GLboolean _glewInit_GL_INTEL_map_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glMapTexture2DINTEL")) == NULL) || r; + r = ((glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)glewGetProcAddress((const GLubyte*)"glSyncTextureINTEL")) == NULL) || r; + r = ((glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glUnmapTexture2DINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_map_texture */ + +#ifdef GL_INTEL_parallel_arrays + +static GLboolean _glewInit_GL_INTEL_parallel_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; + r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; + r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; + r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_parallel_arrays */ + +#ifdef GL_INTEL_performance_query + +static GLboolean _glewInit_GL_INTEL_performance_query () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfQueryINTEL")) == NULL) || r; + r = ((glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glCreatePerfQueryINTEL")) == NULL) || r; + r = ((glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfQueryINTEL")) == NULL) || r; + r = ((glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glEndPerfQueryINTEL")) == NULL) || r; + r = ((glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetFirstPerfQueryIdINTEL")) == NULL) || r; + r = ((glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetNextPerfQueryIdINTEL")) == NULL) || r; + r = ((glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfCounterInfoINTEL")) == NULL) || r; + r = ((glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryDataINTEL")) == NULL) || r; + r = ((glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryIdByNameINTEL")) == NULL) || r; + r = ((glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryInfoINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_performance_query */ + +#ifdef GL_INTEL_texture_scissor + +static GLboolean _glewInit_GL_INTEL_texture_scissor () +{ + GLboolean r = GL_FALSE; + + r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; + r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_texture_scissor */ + +#ifdef GL_KHR_blend_equation_advanced + +static GLboolean _glewInit_GL_KHR_blend_equation_advanced () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierKHR")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_blend_equation_advanced */ + +#ifdef GL_KHR_debug + +static GLboolean _glewInit_GL_KHR_debug () +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; + r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; + r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; + r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; + r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; + r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; + r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; + r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; + r = ((glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPopDebugGroup")) == NULL) || r; + r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_debug */ + +#ifdef GL_KHR_parallel_shader_compile + +static GLboolean _glewInit_GL_KHR_parallel_shader_compile () +{ + GLboolean r = GL_FALSE; + + r = ((glMaxShaderCompilerThreadsKHR = (PFNGLMAXSHADERCOMPILERTHREADSKHRPROC)glewGetProcAddress((const GLubyte*)"glMaxShaderCompilerThreadsKHR")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_parallel_shader_compile */ + +#ifdef GL_KHR_robustness + +static GLboolean _glewInit_GL_KHR_robustness () +{ + GLboolean r = GL_FALSE; + + r = ((glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfv")) == NULL) || r; + r = ((glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformiv")) == NULL) || r; + r = ((glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuiv")) == NULL) || r; + r = ((glReadnPixels = (PFNGLREADNPIXELSPROC)glewGetProcAddress((const GLubyte*)"glReadnPixels")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_robustness */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; + r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; + r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; + r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; + r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; + + return r; +} + +#endif /* GL_KTX_buffer_region */ + +#ifdef GL_MESA_resize_buffers + +static GLboolean _glewInit_GL_MESA_resize_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_resize_buffers */ + +#ifdef GL_MESA_window_pos + +static GLboolean _glewInit_GL_MESA_window_pos () +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; + r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; + r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; + r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; + r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; + r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; + r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; + r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; + r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; + r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; + r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; + r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; + r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; + r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; + r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; + r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; + r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; + r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; + r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; + r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; + r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; + r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; + r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; + r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_window_pos */ + +#ifdef GL_NVX_conditional_render + +static GLboolean _glewInit_GL_NVX_conditional_render () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNVX")) == NULL) || r; + r = ((glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNVX")) == NULL) || r; + + return r; +} + +#endif /* GL_NVX_conditional_render */ + +#ifdef GL_NVX_linked_gpu_multicast + +static GLboolean _glewInit_GL_NVX_linked_gpu_multicast () +{ + GLboolean r = GL_FALSE; + + r = ((glLGPUCopyImageSubDataNVX = (PFNGLLGPUCOPYIMAGESUBDATANVXPROC)glewGetProcAddress((const GLubyte*)"glLGPUCopyImageSubDataNVX")) == NULL) || r; + r = ((glLGPUInterlockNVX = (PFNGLLGPUINTERLOCKNVXPROC)glewGetProcAddress((const GLubyte*)"glLGPUInterlockNVX")) == NULL) || r; + r = ((glLGPUNamedBufferSubDataNVX = (PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC)glewGetProcAddress((const GLubyte*)"glLGPUNamedBufferSubDataNVX")) == NULL) || r; + + return r; +} + +#endif /* GL_NVX_linked_gpu_multicast */ + +#ifdef GL_NV_3dvision_settings + +static GLboolean _glewInit_GL_NV_3dvision_settings () +{ + GLboolean r = GL_FALSE; + + r = ((glStereoParameterfNV = (PFNGLSTEREOPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glStereoParameterfNV")) == NULL) || r; + r = ((glStereoParameteriNV = (PFNGLSTEREOPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glStereoParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_3dvision_settings */ + +#ifdef GL_NV_bindless_multi_draw_indirect + +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessNV")) == NULL) || r; + r = ((glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +#ifdef GL_NV_bindless_multi_draw_indirect_count + +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect_count () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessCountNV")) == NULL) || r; + r = ((glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessCountNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +#ifdef GL_NV_bindless_texture + +static GLboolean _glewInit_GL_NV_bindless_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; + r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; + r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; + r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; + r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; + r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; + r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; + r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; + r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; + r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; + r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_texture */ + +#ifdef GL_NV_blend_equation_advanced + +static GLboolean _glewInit_GL_NV_blend_equation_advanced () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierNV")) == NULL) || r; + r = ((glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glBlendParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_blend_equation_advanced */ + +#ifdef GL_NV_clip_space_w_scaling + +static GLboolean _glewInit_GL_NV_clip_space_w_scaling () +{ + GLboolean r = GL_FALSE; + + r = ((glViewportPositionWScaleNV = (PFNGLVIEWPORTPOSITIONWSCALENVPROC)glewGetProcAddress((const GLubyte*)"glViewportPositionWScaleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_clip_space_w_scaling */ + +#ifdef GL_NV_command_list + +static GLboolean _glewInit_GL_NV_command_list () +{ + GLboolean r = GL_FALSE; + + r = ((glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)glewGetProcAddress((const GLubyte*)"glCallCommandListNV")) == NULL) || r; + r = ((glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)glewGetProcAddress((const GLubyte*)"glCommandListSegmentsNV")) == NULL) || r; + r = ((glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)glewGetProcAddress((const GLubyte*)"glCompileCommandListNV")) == NULL) || r; + r = ((glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)glewGetProcAddress((const GLubyte*)"glCreateCommandListsNV")) == NULL) || r; + r = ((glCreateStatesNV = (PFNGLCREATESTATESNVPROC)glewGetProcAddress((const GLubyte*)"glCreateStatesNV")) == NULL) || r; + r = ((glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteCommandListsNV")) == NULL) || r; + r = ((glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteStatesNV")) == NULL) || r; + r = ((glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsAddressNV")) == NULL) || r; + r = ((glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsNV")) == NULL) || r; + r = ((glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsStatesAddressNV")) == NULL) || r; + r = ((glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsStatesNV")) == NULL) || r; + r = ((glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)glewGetProcAddress((const GLubyte*)"glGetCommandHeaderNV")) == NULL) || r; + r = ((glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glGetStageIndexNV")) == NULL) || r; + r = ((glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)glewGetProcAddress((const GLubyte*)"glIsCommandListNV")) == NULL) || r; + r = ((glIsStateNV = (PFNGLISSTATENVPROC)glewGetProcAddress((const GLubyte*)"glIsStateNV")) == NULL) || r; + r = ((glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)glewGetProcAddress((const GLubyte*)"glListDrawCommandsStatesClientNV")) == NULL) || r; + r = ((glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glStateCaptureNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_command_list */ + +#ifdef GL_NV_conditional_render + +static GLboolean _glewInit_GL_NV_conditional_render () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; + r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conditional_render */ + +#ifdef GL_NV_conservative_raster + +static GLboolean _glewInit_GL_NV_conservative_raster () +{ + GLboolean r = GL_FALSE; + + r = ((glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)glewGetProcAddress((const GLubyte*)"glSubpixelPrecisionBiasNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conservative_raster */ + +#ifdef GL_NV_conservative_raster_dilate + +static GLboolean _glewInit_GL_NV_conservative_raster_dilate () +{ + GLboolean r = GL_FALSE; + + r = ((glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glConservativeRasterParameterfNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conservative_raster_dilate */ + +#ifdef GL_NV_conservative_raster_pre_snap_triangles + +static GLboolean _glewInit_GL_NV_conservative_raster_pre_snap_triangles () +{ + GLboolean r = GL_FALSE; + + r = ((glConservativeRasterParameteriNV = (PFNGLCONSERVATIVERASTERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glConservativeRasterParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +#ifdef GL_NV_copy_buffer + +static GLboolean _glewInit_GL_NV_copy_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubDataNV = (PFNGLCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_buffer */ + +#ifdef GL_NV_copy_image + +static GLboolean _glewInit_GL_NV_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_image */ + +#ifdef GL_NV_depth_buffer_float + +static GLboolean _glewInit_GL_NV_depth_buffer_float () +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; + r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; + r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_depth_buffer_float */ + +#ifdef GL_NV_draw_buffers + +static GLboolean _glewInit_GL_NV_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersNV = (PFNGLDRAWBUFFERSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_buffers */ + +#ifdef GL_NV_draw_instanced + +static GLboolean _glewInit_GL_NV_draw_instanced () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedNV = (PFNGLDRAWARRAYSINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedNV")) == NULL) || r; + r = ((glDrawElementsInstancedNV = (PFNGLDRAWELEMENTSINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_instanced */ + +#ifdef GL_NV_draw_texture + +static GLboolean _glewInit_GL_NV_draw_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glDrawTextureNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_texture */ + +#ifdef GL_NV_draw_vulkan_image + +static GLboolean _glewInit_GL_NV_draw_vulkan_image () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawVkImageNV = (PFNGLDRAWVKIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glDrawVkImageNV")) == NULL) || r; + r = ((glGetVkProcAddrNV = (PFNGLGETVKPROCADDRNVPROC)glewGetProcAddress((const GLubyte*)"glGetVkProcAddrNV")) == NULL) || r; + r = ((glSignalVkFenceNV = (PFNGLSIGNALVKFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSignalVkFenceNV")) == NULL) || r; + r = ((glSignalVkSemaphoreNV = (PFNGLSIGNALVKSEMAPHORENVPROC)glewGetProcAddress((const GLubyte*)"glSignalVkSemaphoreNV")) == NULL) || r; + r = ((glWaitVkSemaphoreNV = (PFNGLWAITVKSEMAPHORENVPROC)glewGetProcAddress((const GLubyte*)"glWaitVkSemaphoreNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_vulkan_image */ + +#ifdef GL_NV_evaluators + +static GLboolean _glewInit_GL_NV_evaluators () +{ + GLboolean r = GL_FALSE; + + r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; + r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; + r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; + r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; + r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; + r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; + r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; + r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; + r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_evaluators */ + +#ifdef GL_NV_explicit_multisample + +static GLboolean _glewInit_GL_NV_explicit_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; + r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; + r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_explicit_multisample */ + +#ifdef GL_NV_fence + +static GLboolean _glewInit_GL_NV_fence () +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; + r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; + r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; + r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; + r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; + r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; + r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fence */ + +#ifdef GL_NV_fragment_coverage_to_color + +static GLboolean _glewInit_GL_NV_fragment_coverage_to_color () +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)glewGetProcAddress((const GLubyte*)"glFragmentCoverageColorNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_coverage_to_color */ + +#ifdef GL_NV_fragment_program + +static GLboolean _glewInit_GL_NV_fragment_program () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; + r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; + r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; + r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; + r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; + r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_program */ + +#ifdef GL_NV_framebuffer_blit + +static GLboolean _glewInit_GL_NV_framebuffer_blit () +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferNV = (PFNGLBLITFRAMEBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_blit */ + +#ifdef GL_NV_framebuffer_multisample + +static GLboolean _glewInit_GL_NV_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample */ + +#ifdef GL_NV_framebuffer_multisample_coverage + +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifdef GL_NV_geometry_program4 + +static GLboolean _glewInit_GL_NV_geometry_program4 () +{ + GLboolean r = GL_FALSE; + + r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_geometry_program4 */ + +#ifdef GL_NV_gpu_multicast + +static GLboolean _glewInit_GL_NV_gpu_multicast () +{ + GLboolean r = GL_FALSE; + + r = ((glMulticastBarrierNV = (PFNGLMULTICASTBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastBarrierNV")) == NULL) || r; + r = ((glMulticastBlitFramebufferNV = (PFNGLMULTICASTBLITFRAMEBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastBlitFramebufferNV")) == NULL) || r; + r = ((glMulticastBufferSubDataNV = (PFNGLMULTICASTBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glMulticastBufferSubDataNV")) == NULL) || r; + r = ((glMulticastCopyBufferSubDataNV = (PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glMulticastCopyBufferSubDataNV")) == NULL) || r; + r = ((glMulticastCopyImageSubDataNV = (PFNGLMULTICASTCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glMulticastCopyImageSubDataNV")) == NULL) || r; + r = ((glMulticastFramebufferSampleLocationsfvNV = (PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastFramebufferSampleLocationsfvNV")) == NULL) || r; + r = ((glMulticastGetQueryObjecti64vNV = (PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjecti64vNV")) == NULL) || r; + r = ((glMulticastGetQueryObjectivNV = (PFNGLMULTICASTGETQUERYOBJECTIVNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjectivNV")) == NULL) || r; + r = ((glMulticastGetQueryObjectui64vNV = (PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjectui64vNV")) == NULL) || r; + r = ((glMulticastGetQueryObjectuivNV = (PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjectuivNV")) == NULL) || r; + r = ((glMulticastWaitSyncNV = (PFNGLMULTICASTWAITSYNCNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastWaitSyncNV")) == NULL) || r; + r = ((glRenderGpuMaskNV = (PFNGLRENDERGPUMASKNVPROC)glewGetProcAddress((const GLubyte*)"glRenderGpuMaskNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_multicast */ + +#ifdef GL_NV_gpu_program4 + +static GLboolean _glewInit_GL_NV_gpu_program4 () +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; + r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; + r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_program4 */ + +#ifdef GL_NV_gpu_shader5 + +static GLboolean _glewInit_GL_NV_gpu_shader5 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; + r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; + r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; + r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; + r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; + r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; + r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; + r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; + r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; + r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; + r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; + r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; + r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; + r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; + r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; + r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; + r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; + r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; + r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; + r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; + r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; + r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; + r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; + r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; + r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; + r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; + r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; + r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; + r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; + r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; + r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; + r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; + r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; + r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_shader5 */ + +#ifdef GL_NV_half_float + +static GLboolean _glewInit_GL_NV_half_float () +{ + GLboolean r = GL_FALSE; + + r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; + r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; + r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; + r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; + r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; + r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; + r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; + r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; + r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; + r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; + r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; + r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; + r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; + r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; + r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; + r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; + r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; + r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; + r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; + r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; + r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; + r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; + r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; + r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; + r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; + r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; + r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; + r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; + r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; + r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; + r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; + r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; + r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; + r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; + r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; + r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; + r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; + r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; + r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; + r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; + r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; + r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; + r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; + r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; + r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; + r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_half_float */ + +#ifdef GL_NV_instanced_arrays + +static GLboolean _glewInit_GL_NV_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisorNV = (PFNGLVERTEXATTRIBDIVISORNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_instanced_arrays */ + +#ifdef GL_NV_internalformat_sample_query + +static GLboolean _glewInit_GL_NV_internalformat_sample_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformatSampleivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_internalformat_sample_query */ + +#ifdef GL_NV_non_square_matrices + +static GLboolean _glewInit_GL_NV_non_square_matrices () +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fvNV = (PFNGLUNIFORMMATRIX2X3FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fvNV")) == NULL) || r; + r = ((glUniformMatrix2x4fvNV = (PFNGLUNIFORMMATRIX2X4FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fvNV")) == NULL) || r; + r = ((glUniformMatrix3x2fvNV = (PFNGLUNIFORMMATRIX3X2FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fvNV")) == NULL) || r; + r = ((glUniformMatrix3x4fvNV = (PFNGLUNIFORMMATRIX3X4FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fvNV")) == NULL) || r; + r = ((glUniformMatrix4x2fvNV = (PFNGLUNIFORMMATRIX4X2FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fvNV")) == NULL) || r; + r = ((glUniformMatrix4x3fvNV = (PFNGLUNIFORMMATRIX4X3FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_non_square_matrices */ + +#ifdef GL_NV_occlusion_query + +static GLboolean _glewInit_GL_NV_occlusion_query () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; + r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; + r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; + r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; + r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; + r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; + r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_occlusion_query */ + +#ifdef GL_NV_parameter_buffer_object + +static GLboolean _glewInit_GL_NV_parameter_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; + r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; + r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_parameter_buffer_object */ + +#ifdef GL_NV_path_rendering + +static GLboolean _glewInit_GL_NV_path_rendering () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; + r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; + r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; + r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; + r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; + r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; + r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; + r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; + r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; + r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; + r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; + r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; + r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; + r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; + r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; + r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; + r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; + r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; + r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; + r = ((glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourcefvNV")) == NULL) || r; + r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; + r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; + r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; + r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; + r = ((glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x2fNV")) == NULL) || r; + r = ((glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x3fNV")) == NULL) || r; + r = ((glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTranspose3x3fNV")) == NULL) || r; + r = ((glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x2fNV")) == NULL) || r; + r = ((glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x3fNV")) == NULL) || r; + r = ((glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTranspose3x3fNV")) == NULL) || r; + r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; + r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; + r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; + r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; + r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; + r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; + r = ((glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexArrayNV")) == NULL) || r; + r = ((glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexRangeNV")) == NULL) || r; + r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; + r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; + r = ((glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathMemoryGlyphIndexArrayNV")) == NULL) || r; + r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; + r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; + r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; + r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; + r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; + r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; + r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; + r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; + r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; + r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; + r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; + r = ((glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)glewGetProcAddress((const GLubyte*)"glProgramPathFragmentInputGenNV")) == NULL) || r; + r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; + r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; + r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; + r = ((glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathInstancedNV")) == NULL) || r; + r = ((glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathNV")) == NULL) || r; + r = ((glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathNV")) == NULL) || r; + r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; + r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_path_rendering */ + +#ifdef GL_NV_pixel_data_range + +static GLboolean _glewInit_GL_NV_pixel_data_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; + r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_pixel_data_range */ + +#ifdef GL_NV_point_sprite + +static GLboolean _glewInit_GL_NV_point_sprite () +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; + r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_point_sprite */ + +#ifdef GL_NV_polygon_mode + +static GLboolean _glewInit_GL_NV_polygon_mode () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonModeNV = (PFNGLPOLYGONMODENVPROC)glewGetProcAddress((const GLubyte*)"glPolygonModeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_polygon_mode */ + +#ifdef GL_NV_present_video + +static GLboolean _glewInit_GL_NV_present_video () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; + r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; + r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; + r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; + r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; + r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_present_video */ + +#ifdef GL_NV_primitive_restart + +static GLboolean _glewInit_GL_NV_primitive_restart () +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; + r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_primitive_restart */ + +#ifdef GL_NV_register_combiners + +static GLboolean _glewInit_GL_NV_register_combiners () +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; + r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; + r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; + r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; + r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; + r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; + r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; + r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners */ + +#ifdef GL_NV_register_combiners2 + +static GLboolean _glewInit_GL_NV_register_combiners2 () +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; + r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners2 */ + +#ifdef GL_NV_sample_locations + +static GLboolean _glewInit_GL_NV_sample_locations () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvNV")) == NULL) || r; + r = ((glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_sample_locations */ + +#ifdef GL_NV_shader_buffer_load + +static GLboolean _glewInit_GL_NV_shader_buffer_load () +{ + GLboolean r = GL_FALSE; + + r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; + r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; + r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; + r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; + r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; + r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; + r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; + r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; + r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; + r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; + r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_shader_buffer_load */ + +#ifdef GL_NV_texture_array + +static GLboolean _glewInit_GL_NV_texture_array () +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage3DNV = (PFNGLCOMPRESSEDTEXIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DNV")) == NULL) || r; + r = ((glCompressedTexSubImage3DNV = (PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DNV")) == NULL) || r; + r = ((glCopyTexSubImage3DNV = (PFNGLCOPYTEXSUBIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DNV")) == NULL) || r; + r = ((glFramebufferTextureLayerNV = (PFNGLFRAMEBUFFERTEXTURELAYERNVPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerNV")) == NULL) || r; + r = ((glTexImage3DNV = (PFNGLTEXIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DNV")) == NULL) || r; + r = ((glTexSubImage3DNV = (PFNGLTEXSUBIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_array */ + +#ifdef GL_NV_texture_barrier + +static GLboolean _glewInit_GL_NV_texture_barrier () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_barrier */ + +#ifdef GL_NV_texture_multisample + +static GLboolean _glewInit_GL_NV_texture_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_multisample */ + +#ifdef GL_NV_transform_feedback + +static GLboolean _glewInit_GL_NV_transform_feedback () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; + r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; + r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; + r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; + r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; + r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; + r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; + r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; + r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; + r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback */ + +#ifdef GL_NV_transform_feedback2 + +static GLboolean _glewInit_GL_NV_transform_feedback2 () +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; + r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; + r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; + r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; + r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; + r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; + r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback2 */ + +#ifdef GL_NV_vdpau_interop + +static GLboolean _glewInit_GL_NV_vdpau_interop () +{ + GLboolean r = GL_FALSE; + + r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; + r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; + r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; + r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; + r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; + r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; + r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; + r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; + r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; + r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vdpau_interop */ + +#ifdef GL_NV_vertex_array_range + +static GLboolean _glewInit_GL_NV_vertex_array_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; + r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_array_range */ + +#ifdef GL_NV_vertex_attrib_integer_64bit + +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; + r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; + r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; + r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; + r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; + r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; + r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; + r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; + r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; + r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; + r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; + r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; + r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; + r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; + r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; + r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; + r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; + r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; + r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifdef GL_NV_vertex_buffer_unified_memory + +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; + r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; + r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; + r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; + r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; + r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; + r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; + r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; + r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; + r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; + r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; + r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifdef GL_NV_vertex_program + +static GLboolean _glewInit_GL_NV_vertex_program () +{ + GLboolean r = GL_FALSE; + + r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; + r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; + r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; + r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; + r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; + r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; + r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; + r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; + r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; + r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; + r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; + r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; + r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; + r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; + r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; + r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; + r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; + r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; + r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; + r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; + r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; + r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; + r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; + r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; + r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; + r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; + r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; + r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; + r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; + r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; + r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; + r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; + r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; + r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; + r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; + r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; + r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; + r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; + r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; + r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; + r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; + r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; + r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; + r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; + r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; + r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; + r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; + r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; + r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; + r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; + r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; + r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; + r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; + r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; + r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; + r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; + r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; + r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; + r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; + r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; + r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; + r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; + r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; + r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_program */ + +#ifdef GL_NV_video_capture + +static GLboolean _glewInit_GL_NV_video_capture () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; + r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; + r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; + r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_video_capture */ + +#ifdef GL_NV_viewport_array + +static GLboolean _glewInit_GL_NV_viewport_array () +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayfvNV = (PFNGLDEPTHRANGEARRAYFVNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayfvNV")) == NULL) || r; + r = ((glDepthRangeIndexedfNV = (PFNGLDEPTHRANGEINDEXEDFNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexedfNV")) == NULL) || r; + r = ((glDisableiNV = (PFNGLDISABLEINVPROC)glewGetProcAddress((const GLubyte*)"glDisableiNV")) == NULL) || r; + r = ((glEnableiNV = (PFNGLENABLEINVPROC)glewGetProcAddress((const GLubyte*)"glEnableiNV")) == NULL) || r; + r = ((glGetFloati_vNV = (PFNGLGETFLOATI_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vNV")) == NULL) || r; + r = ((glIsEnablediNV = (PFNGLISENABLEDINVPROC)glewGetProcAddress((const GLubyte*)"glIsEnablediNV")) == NULL) || r; + r = ((glScissorArrayvNV = (PFNGLSCISSORARRAYVNVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayvNV")) == NULL) || r; + r = ((glScissorIndexedNV = (PFNGLSCISSORINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedNV")) == NULL) || r; + r = ((glScissorIndexedvNV = (PFNGLSCISSORINDEXEDVNVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedvNV")) == NULL) || r; + r = ((glViewportArrayvNV = (PFNGLVIEWPORTARRAYVNVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayvNV")) == NULL) || r; + r = ((glViewportIndexedfNV = (PFNGLVIEWPORTINDEXEDFNVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfNV")) == NULL) || r; + r = ((glViewportIndexedfvNV = (PFNGLVIEWPORTINDEXEDFVNVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_viewport_array */ + +#ifdef GL_NV_viewport_swizzle + +static GLboolean _glewInit_GL_NV_viewport_swizzle () +{ + GLboolean r = GL_FALSE; + + r = ((glViewportSwizzleNV = (PFNGLVIEWPORTSWIZZLENVPROC)glewGetProcAddress((const GLubyte*)"glViewportSwizzleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_viewport_swizzle */ + +#ifdef GL_OVR_multiview + +static GLboolean _glewInit_GL_OVR_multiview () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureMultiviewOVR")) == NULL) || r; + + return r; +} + +#endif /* GL_OVR_multiview */ + +#ifdef GL_OVR_multiview_multisampled_render_to_texture + +static GLboolean _glewInit_GL_OVR_multiview_multisampled_render_to_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureMultisampleMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureMultisampleMultiviewOVR")) == NULL) || r; + + return r; +} + +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + +#ifdef GL_QCOM_alpha_test + +static GLboolean _glewInit_GL_QCOM_alpha_test () +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFuncQCOM = (PFNGLALPHAFUNCQCOMPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_alpha_test */ + +#ifdef GL_QCOM_driver_control + +static GLboolean _glewInit_GL_QCOM_driver_control () +{ + GLboolean r = GL_FALSE; + + r = ((glDisableDriverControlQCOM = (PFNGLDISABLEDRIVERCONTROLQCOMPROC)glewGetProcAddress((const GLubyte*)"glDisableDriverControlQCOM")) == NULL) || r; + r = ((glEnableDriverControlQCOM = (PFNGLENABLEDRIVERCONTROLQCOMPROC)glewGetProcAddress((const GLubyte*)"glEnableDriverControlQCOM")) == NULL) || r; + r = ((glGetDriverControlStringQCOM = (PFNGLGETDRIVERCONTROLSTRINGQCOMPROC)glewGetProcAddress((const GLubyte*)"glGetDriverControlStringQCOM")) == NULL) || r; + r = ((glGetDriverControlsQCOM = (PFNGLGETDRIVERCONTROLSQCOMPROC)glewGetProcAddress((const GLubyte*)"glGetDriverControlsQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_driver_control */ + +#ifdef GL_QCOM_extended_get + +static GLboolean _glewInit_GL_QCOM_extended_get () +{ + GLboolean r = GL_FALSE; + + r = ((glExtGetBufferPointervQCOM = (PFNGLEXTGETBUFFERPOINTERVQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetBufferPointervQCOM")) == NULL) || r; + r = ((glExtGetBuffersQCOM = (PFNGLEXTGETBUFFERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetBuffersQCOM")) == NULL) || r; + r = ((glExtGetFramebuffersQCOM = (PFNGLEXTGETFRAMEBUFFERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetFramebuffersQCOM")) == NULL) || r; + r = ((glExtGetRenderbuffersQCOM = (PFNGLEXTGETRENDERBUFFERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetRenderbuffersQCOM")) == NULL) || r; + r = ((glExtGetTexLevelParameterivQCOM = (PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetTexLevelParameterivQCOM")) == NULL) || r; + r = ((glExtGetTexSubImageQCOM = (PFNGLEXTGETTEXSUBIMAGEQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetTexSubImageQCOM")) == NULL) || r; + r = ((glExtGetTexturesQCOM = (PFNGLEXTGETTEXTURESQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetTexturesQCOM")) == NULL) || r; + r = ((glExtTexObjectStateOverrideiQCOM = (PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtTexObjectStateOverrideiQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_extended_get */ + +#ifdef GL_QCOM_extended_get2 + +static GLboolean _glewInit_GL_QCOM_extended_get2 () +{ + GLboolean r = GL_FALSE; + + r = ((glExtGetProgramBinarySourceQCOM = (PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetProgramBinarySourceQCOM")) == NULL) || r; + r = ((glExtGetProgramsQCOM = (PFNGLEXTGETPROGRAMSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetProgramsQCOM")) == NULL) || r; + r = ((glExtGetShadersQCOM = (PFNGLEXTGETSHADERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetShadersQCOM")) == NULL) || r; + r = ((glExtIsProgramBinaryQCOM = (PFNGLEXTISPROGRAMBINARYQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtIsProgramBinaryQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_extended_get2 */ + +#ifdef GL_QCOM_framebuffer_foveated + +static GLboolean _glewInit_GL_QCOM_framebuffer_foveated () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferFoveationConfigQCOM = (PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC)glewGetProcAddress((const GLubyte*)"glFramebufferFoveationConfigQCOM")) == NULL) || r; + r = ((glFramebufferFoveationParametersQCOM = (PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glFramebufferFoveationParametersQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_framebuffer_foveated */ + +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + +static GLboolean _glewInit_GL_QCOM_shader_framebuffer_fetch_noncoherent () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferFetchBarrierQCOM = (PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC)glewGetProcAddress((const GLubyte*)"glFramebufferFetchBarrierQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +#ifdef GL_QCOM_tiled_rendering + +static GLboolean _glewInit_GL_QCOM_tiled_rendering () +{ + GLboolean r = GL_FALSE; + + r = ((glEndTilingQCOM = (PFNGLENDTILINGQCOMPROC)glewGetProcAddress((const GLubyte*)"glEndTilingQCOM")) == NULL) || r; + r = ((glStartTilingQCOM = (PFNGLSTARTTILINGQCOMPROC)glewGetProcAddress((const GLubyte*)"glStartTilingQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_tiled_rendering */ + +#ifdef GL_REGAL_ES1_0_compatibility + +static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFuncx = (PFNGLALPHAFUNCXPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncx")) == NULL) || r; + r = ((glClearColorx = (PFNGLCLEARCOLORXPROC)glewGetProcAddress((const GLubyte*)"glClearColorx")) == NULL) || r; + r = ((glClearDepthx = (PFNGLCLEARDEPTHXPROC)glewGetProcAddress((const GLubyte*)"glClearDepthx")) == NULL) || r; + r = ((glColor4x = (PFNGLCOLOR4XPROC)glewGetProcAddress((const GLubyte*)"glColor4x")) == NULL) || r; + r = ((glDepthRangex = (PFNGLDEPTHRANGEXPROC)glewGetProcAddress((const GLubyte*)"glDepthRangex")) == NULL) || r; + r = ((glFogx = (PFNGLFOGXPROC)glewGetProcAddress((const GLubyte*)"glFogx")) == NULL) || r; + r = ((glFogxv = (PFNGLFOGXVPROC)glewGetProcAddress((const GLubyte*)"glFogxv")) == NULL) || r; + r = ((glFrustumf = (PFNGLFRUSTUMFPROC)glewGetProcAddress((const GLubyte*)"glFrustumf")) == NULL) || r; + r = ((glFrustumx = (PFNGLFRUSTUMXPROC)glewGetProcAddress((const GLubyte*)"glFrustumx")) == NULL) || r; + r = ((glLightModelx = (PFNGLLIGHTMODELXPROC)glewGetProcAddress((const GLubyte*)"glLightModelx")) == NULL) || r; + r = ((glLightModelxv = (PFNGLLIGHTMODELXVPROC)glewGetProcAddress((const GLubyte*)"glLightModelxv")) == NULL) || r; + r = ((glLightx = (PFNGLLIGHTXPROC)glewGetProcAddress((const GLubyte*)"glLightx")) == NULL) || r; + r = ((glLightxv = (PFNGLLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glLightxv")) == NULL) || r; + r = ((glLineWidthx = (PFNGLLINEWIDTHXPROC)glewGetProcAddress((const GLubyte*)"glLineWidthx")) == NULL) || r; + r = ((glLoadMatrixx = (PFNGLLOADMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glLoadMatrixx")) == NULL) || r; + r = ((glMaterialx = (PFNGLMATERIALXPROC)glewGetProcAddress((const GLubyte*)"glMaterialx")) == NULL) || r; + r = ((glMaterialxv = (PFNGLMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glMaterialxv")) == NULL) || r; + r = ((glMultMatrixx = (PFNGLMULTMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glMultMatrixx")) == NULL) || r; + r = ((glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4x")) == NULL) || r; + r = ((glNormal3x = (PFNGLNORMAL3XPROC)glewGetProcAddress((const GLubyte*)"glNormal3x")) == NULL) || r; + r = ((glOrthof = (PFNGLORTHOFPROC)glewGetProcAddress((const GLubyte*)"glOrthof")) == NULL) || r; + r = ((glOrthox = (PFNGLORTHOXPROC)glewGetProcAddress((const GLubyte*)"glOrthox")) == NULL) || r; + r = ((glPointSizex = (PFNGLPOINTSIZEXPROC)glewGetProcAddress((const GLubyte*)"glPointSizex")) == NULL) || r; + r = ((glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetx")) == NULL) || r; + r = ((glRotatex = (PFNGLROTATEXPROC)glewGetProcAddress((const GLubyte*)"glRotatex")) == NULL) || r; + r = ((glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)glewGetProcAddress((const GLubyte*)"glSampleCoveragex")) == NULL) || r; + r = ((glScalex = (PFNGLSCALEXPROC)glewGetProcAddress((const GLubyte*)"glScalex")) == NULL) || r; + r = ((glTexEnvx = (PFNGLTEXENVXPROC)glewGetProcAddress((const GLubyte*)"glTexEnvx")) == NULL) || r; + r = ((glTexEnvxv = (PFNGLTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glTexEnvxv")) == NULL) || r; + r = ((glTexParameterx = (PFNGLTEXPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glTexParameterx")) == NULL) || r; + r = ((glTranslatex = (PFNGLTRANSLATEXPROC)glewGetProcAddress((const GLubyte*)"glTranslatex")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_ES1_0_compatibility */ + +#ifdef GL_REGAL_ES1_1_compatibility + +static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glClipPlanef = (PFNGLCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glClipPlanef")) == NULL) || r; + r = ((glClipPlanex = (PFNGLCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glClipPlanex")) == NULL) || r; + r = ((glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanef")) == NULL) || r; + r = ((glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanex")) == NULL) || r; + r = ((glGetFixedv = (PFNGLGETFIXEDVPROC)glewGetProcAddress((const GLubyte*)"glGetFixedv")) == NULL) || r; + r = ((glGetLightxv = (PFNGLGETLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glGetLightxv")) == NULL) || r; + r = ((glGetMaterialxv = (PFNGLGETMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glGetMaterialxv")) == NULL) || r; + r = ((glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexEnvxv")) == NULL) || r; + r = ((glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterxv")) == NULL) || r; + r = ((glPointParameterx = (PFNGLPOINTPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glPointParameterx")) == NULL) || r; + r = ((glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterxv")) == NULL) || r; + r = ((glPointSizePointerOES = (PFNGLPOINTSIZEPOINTEROESPROC)glewGetProcAddress((const GLubyte*)"glPointSizePointerOES")) == NULL) || r; + r = ((glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterxv")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_ES1_1_compatibility */ + +#ifdef GL_REGAL_error_string + +static GLboolean _glewInit_GL_REGAL_error_string () +{ + GLboolean r = GL_FALSE; + + r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_error_string */ + +#ifdef GL_REGAL_extension_query + +static GLboolean _glewInit_GL_REGAL_extension_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; + r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_extension_query */ + +#ifdef GL_REGAL_log + +static GLboolean _glewInit_GL_REGAL_log () +{ + GLboolean r = GL_FALSE; + + r = ((glLogMessageCallbackREGAL = (PFNGLLOGMESSAGECALLBACKREGALPROC)glewGetProcAddress((const GLubyte*)"glLogMessageCallbackREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_log */ + +#ifdef GL_REGAL_proc_address + +static GLboolean _glewInit_GL_REGAL_proc_address () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProcAddressREGAL = (PFNGLGETPROCADDRESSREGALPROC)glewGetProcAddress((const GLubyte*)"glGetProcAddressREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_proc_address */ + +#ifdef GL_SGIS_detail_texture + +static GLboolean _glewInit_GL_SGIS_detail_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; + r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_detail_texture */ + +#ifdef GL_SGIS_fog_function + +static GLboolean _glewInit_GL_SGIS_fog_function () +{ + GLboolean r = GL_FALSE; + + r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; + r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_fog_function */ + +#ifdef GL_SGIS_multisample + +static GLboolean _glewInit_GL_SGIS_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; + r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multisample */ + +#ifdef GL_SGIS_multitexture + +static GLboolean _glewInit_GL_SGIS_multitexture () +{ + GLboolean r = GL_FALSE; + + r = ((glInterleavedTextureCoordSetsSGIS = (PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC)glewGetProcAddress((const GLubyte*)"glInterleavedTextureCoordSetsSGIS")) == NULL) || r; + r = ((glSelectTextureCoordSetSGIS = (PFNGLSELECTTEXTURECOORDSETSGISPROC)glewGetProcAddress((const GLubyte*)"glSelectTextureCoordSetSGIS")) == NULL) || r; + r = ((glSelectTextureSGIS = (PFNGLSELECTTEXTURESGISPROC)glewGetProcAddress((const GLubyte*)"glSelectTextureSGIS")) == NULL) || r; + r = ((glSelectTextureTransformSGIS = (PFNGLSELECTTEXTURETRANSFORMSGISPROC)glewGetProcAddress((const GLubyte*)"glSelectTextureTransformSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multitexture */ + +#ifdef GL_SGIS_shared_multisample + +static GLboolean _glewInit_GL_SGIS_shared_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glMultisampleSubRectPosSGIS = (PFNGLMULTISAMPLESUBRECTPOSSGISPROC)glewGetProcAddress((const GLubyte*)"glMultisampleSubRectPosSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_shared_multisample */ + +#ifdef GL_SGIS_sharpen_texture + +static GLboolean _glewInit_GL_SGIS_sharpen_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; + r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_sharpen_texture */ + +#ifdef GL_SGIS_texture4D + +static GLboolean _glewInit_GL_SGIS_texture4D () +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; + r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture4D */ + +#ifdef GL_SGIS_texture_filter4 + +static GLboolean _glewInit_GL_SGIS_texture_filter4 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; + r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture_filter4 */ + +#ifdef GL_SGIX_async + +static GLboolean _glewInit_GL_SGIX_async () +{ + GLboolean r = GL_FALSE; + + r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; + r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; + r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; + r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; + r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; + r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_async */ + +#ifdef GL_SGIX_datapipe + +static GLboolean _glewInit_GL_SGIX_datapipe () +{ + GLboolean r = GL_FALSE; + + r = ((glAddressSpace = (PFNGLADDRESSSPACEPROC)glewGetProcAddress((const GLubyte*)"glAddressSpace")) == NULL) || r; + r = ((glDataPipe = (PFNGLDATAPIPEPROC)glewGetProcAddress((const GLubyte*)"glDataPipe")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_datapipe */ + +#ifdef GL_SGIX_flush_raster + +static GLboolean _glewInit_GL_SGIX_flush_raster () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_flush_raster */ + +#ifdef GL_SGIX_fog_layers + +static GLboolean _glewInit_GL_SGIX_fog_layers () +{ + GLboolean r = GL_FALSE; + + r = ((glFogLayersSGIX = (PFNGLFOGLAYERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glFogLayersSGIX")) == NULL) || r; + r = ((glGetFogLayersSGIX = (PFNGLGETFOGLAYERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFogLayersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_layers */ + +#ifdef GL_SGIX_fog_texture + +static GLboolean _glewInit_GL_SGIX_fog_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_texture */ + +#ifdef GL_SGIX_fragment_specular_lighting + +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting () +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; + r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; + r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; + r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; + r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; + r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; + r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; + r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; + r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; + r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; + r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; + r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; + r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; + r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fragment_specular_lighting */ + +#ifdef GL_SGIX_framezoom + +static GLboolean _glewInit_GL_SGIX_framezoom () +{ + GLboolean r = GL_FALSE; + + r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_framezoom */ + +#ifdef GL_SGIX_igloo_interface + +static GLboolean _glewInit_GL_SGIX_igloo_interface () +{ + GLboolean r = GL_FALSE; + + r = ((glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)glewGetProcAddress((const GLubyte*)"glIglooInterfaceSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_igloo_interface */ + +#ifdef GL_SGIX_mpeg1 + +static GLboolean _glewInit_GL_SGIX_mpeg1 () +{ + GLboolean r = GL_FALSE; + + r = ((glAllocMPEGPredictorsSGIX = (PFNGLALLOCMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glAllocMPEGPredictorsSGIX")) == NULL) || r; + r = ((glDeleteMPEGPredictorsSGIX = (PFNGLDELETEMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteMPEGPredictorsSGIX")) == NULL) || r; + r = ((glGenMPEGPredictorsSGIX = (PFNGLGENMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenMPEGPredictorsSGIX")) == NULL) || r; + r = ((glGetMPEGParameterfvSGIX = (PFNGLGETMPEGPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGParameterfvSGIX")) == NULL) || r; + r = ((glGetMPEGParameterivSGIX = (PFNGLGETMPEGPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGParameterivSGIX")) == NULL) || r; + r = ((glGetMPEGPredictorSGIX = (PFNGLGETMPEGPREDICTORSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGPredictorSGIX")) == NULL) || r; + r = ((glGetMPEGQuantTableubv = (PFNGLGETMPEGQUANTTABLEUBVPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGQuantTableubv")) == NULL) || r; + r = ((glIsMPEGPredictorSGIX = (PFNGLISMPEGPREDICTORSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsMPEGPredictorSGIX")) == NULL) || r; + r = ((glMPEGPredictorSGIX = (PFNGLMPEGPREDICTORSGIXPROC)glewGetProcAddress((const GLubyte*)"glMPEGPredictorSGIX")) == NULL) || r; + r = ((glMPEGQuantTableubv = (PFNGLMPEGQUANTTABLEUBVPROC)glewGetProcAddress((const GLubyte*)"glMPEGQuantTableubv")) == NULL) || r; + r = ((glSwapMPEGPredictorsSGIX = (PFNGLSWAPMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glSwapMPEGPredictorsSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_mpeg1 */ + +#ifdef GL_SGIX_nonlinear_lighting_pervertex + +static GLboolean _glewInit_GL_SGIX_nonlinear_lighting_pervertex () +{ + GLboolean r = GL_FALSE; + + r = ((glGetNonlinLightfvSGIX = (PFNGLGETNONLINLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetNonlinLightfvSGIX")) == NULL) || r; + r = ((glGetNonlinMaterialfvSGIX = (PFNGLGETNONLINMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetNonlinMaterialfvSGIX")) == NULL) || r; + r = ((glNonlinLightfvSGIX = (PFNGLNONLINLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glNonlinLightfvSGIX")) == NULL) || r; + r = ((glNonlinMaterialfvSGIX = (PFNGLNONLINMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glNonlinMaterialfvSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ + +#ifdef GL_SGIX_pixel_texture + +static GLboolean _glewInit_GL_SGIX_pixel_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_pixel_texture */ + +#ifdef GL_SGIX_polynomial_ffd + +static GLboolean _glewInit_GL_SGIX_polynomial_ffd () +{ + GLboolean r = GL_FALSE; + + r = ((glDeformSGIX = (PFNGLDEFORMSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeformSGIX")) == NULL) || r; + r = ((glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)glewGetProcAddress((const GLubyte*)"glLoadIdentityDeformationMapSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_polynomial_ffd */ + +#ifdef GL_SGIX_quad_mesh + +static GLboolean _glewInit_GL_SGIX_quad_mesh () +{ + GLboolean r = GL_FALSE; + + r = ((glMeshBreadthSGIX = (PFNGLMESHBREADTHSGIXPROC)glewGetProcAddress((const GLubyte*)"glMeshBreadthSGIX")) == NULL) || r; + r = ((glMeshStrideSGIX = (PFNGLMESHSTRIDESGIXPROC)glewGetProcAddress((const GLubyte*)"glMeshStrideSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_quad_mesh */ + +#ifdef GL_SGIX_reference_plane + +static GLboolean _glewInit_GL_SGIX_reference_plane () +{ + GLboolean r = GL_FALSE; + + r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_reference_plane */ + +#ifdef GL_SGIX_sprite + +static GLboolean _glewInit_GL_SGIX_sprite () +{ + GLboolean r = GL_FALSE; + + r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; + r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; + r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; + r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_sprite */ + +#ifdef GL_SGIX_tag_sample_buffer + +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifdef GL_SGIX_vector_ops + +static GLboolean _glewInit_GL_SGIX_vector_ops () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVectorOperationSGIX = (PFNGLGETVECTOROPERATIONSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetVectorOperationSGIX")) == NULL) || r; + r = ((glVectorOperationSGIX = (PFNGLVECTOROPERATIONSGIXPROC)glewGetProcAddress((const GLubyte*)"glVectorOperationSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_vector_ops */ + +#ifdef GL_SGIX_vertex_array_object + +static GLboolean _glewInit_GL_SGIX_vertex_array_object () +{ + GLboolean r = GL_FALSE; + + r = ((glAreVertexArraysResidentSGIX = (PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glAreVertexArraysResidentSGIX")) == NULL) || r; + r = ((glBindVertexArraySGIX = (PFNGLBINDVERTEXARRAYSGIXPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArraySGIX")) == NULL) || r; + r = ((glDeleteVertexArraysSGIX = (PFNGLDELETEVERTEXARRAYSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysSGIX")) == NULL) || r; + r = ((glGenVertexArraysSGIX = (PFNGLGENVERTEXARRAYSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysSGIX")) == NULL) || r; + r = ((glIsVertexArraySGIX = (PFNGLISVERTEXARRAYSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArraySGIX")) == NULL) || r; + r = ((glPrioritizeVertexArraysSGIX = (PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeVertexArraysSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_vertex_array_object */ + +#ifdef GL_SGI_color_table + +static GLboolean _glewInit_GL_SGI_color_table () +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; + r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; + r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; + r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; + r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; + r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; + r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_color_table */ + +#ifdef GL_SGI_fft + +static GLboolean _glewInit_GL_SGI_fft () +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvSGI = (PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvSGI")) == NULL) || r; + r = ((glGetPixelTransformParameterivSGI = (PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivSGI")) == NULL) || r; + r = ((glPixelTransformParameterfSGI = (PFNGLPIXELTRANSFORMPARAMETERFSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfSGI")) == NULL) || r; + r = ((glPixelTransformParameterfvSGI = (PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvSGI")) == NULL) || r; + r = ((glPixelTransformParameteriSGI = (PFNGLPIXELTRANSFORMPARAMETERISGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriSGI")) == NULL) || r; + r = ((glPixelTransformParameterivSGI = (PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivSGI")) == NULL) || r; + r = ((glPixelTransformSGI = (PFNGLPIXELTRANSFORMSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_fft */ + +#ifdef GL_SUNX_constant_data + +static GLboolean _glewInit_GL_SUNX_constant_data () +{ + GLboolean r = GL_FALSE; + + r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; + + return r; +} + +#endif /* GL_SUNX_constant_data */ + +#ifdef GL_SUN_global_alpha + +static GLboolean _glewInit_GL_SUN_global_alpha () +{ + GLboolean r = GL_FALSE; + + r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; + r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_global_alpha */ + +#ifdef GL_SUN_read_video_pixels + +static GLboolean _glewInit_GL_SUN_read_video_pixels () +{ + GLboolean r = GL_FALSE; + + r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_read_video_pixels */ + +#ifdef GL_SUN_triangle_list + +static GLboolean _glewInit_GL_SUN_triangle_list () +{ + GLboolean r = GL_FALSE; + + r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; + r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; + r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; + r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; + r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; + r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; + r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_triangle_list */ + +#ifdef GL_SUN_vertex + +static GLboolean _glewInit_GL_SUN_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; + r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; + r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; + r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; + r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; + r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_vertex */ + +#ifdef GL_WIN_swap_hint + +static GLboolean _glewInit_GL_WIN_swap_hint () +{ + GLboolean r = GL_FALSE; + + r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; + + return r; +} + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +static int _glewExtensionCompare(const char *s1, const char *s2) +{ + /* http://www.chanduthedev.com/2012/07/strcmp-implementation-in-c.html */ + while (*s1 || *s2) + { + if (*s1 > *s2) + return 1; + if (*s1 < *s2) + return -1; + s1++; + s2++; + } + return 0; +} + +static ptrdiff_t _glewBsearchExtension(const char* name) +{ + ptrdiff_t lo = 0, hi = sizeof(_glewExtensionLookup) / sizeof(char*) - 2; + + while (lo <= hi) + { + ptrdiff_t mid = (lo + hi) / 2; + const int cmp = _glewExtensionCompare(name, _glewExtensionLookup[mid]); + if (cmp < 0) hi = mid - 1; + else if (cmp > 0) lo = mid + 1; + else return mid; + } + return -1; +} + +static GLboolean *_glewGetExtensionString(const char *name) +{ + ptrdiff_t n = _glewBsearchExtension(name); + if (n >= 0) return &_glewExtensionString[n]; + return NULL; +} + +static GLboolean *_glewGetExtensionEnable(const char *name) +{ + ptrdiff_t n = _glewBsearchExtension(name); + if (n >= 0) return _glewExtensionEnabled[n]; + return NULL; +} + +static const char *_glewNextSpace(const char *i) +{ + const char *j = i; + if (j) + while (*j!=' ' && *j) ++j; + return j; +} + +static const char *_glewNextNonSpace(const char *i) +{ + const char *j = i; + if (j) + while (*j==' ') ++j; + return j; +} + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + GLboolean *enable = _glewGetExtensionString(name); + if (enable) + return *enable; + return GL_FALSE; +} + +/* ------------------------------------------------------------------------- */ + +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name); +typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params); + +static GLenum GLEWAPIENTRY glewContextInit () +{ + PFNGLGETSTRINGPROC getString; + const GLubyte* s; + GLuint dot; + GLint major, minor; + size_t n; + + #ifdef _WIN32 + getString = glGetString; + #else + getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString"); + if (!getString) + return GLEW_ERROR_NO_GL_VERSION; + #endif + + /* query opengl version */ + s = getString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + GLEW_VERSION_4_6 = ( major > 4 ) || ( major == 4 && minor >= 6 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_5 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_1 = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_0 = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_3 = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_2 = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_1 = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_0 = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_2_1 = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_2_0 = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_5 = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_4 = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_3 = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_2_1 = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_2 = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n) + _glewExtensionString[n] = GL_FALSE; + + if (GLEW_VERSION_3_0) + { + GLint n = 0; + GLint i; + PFNGLGETINTEGERVPROC getIntegerv; + PFNGLGETSTRINGIPROC getStringi; + const char *ext; + GLboolean *enable; + + #ifdef _WIN32 + getIntegerv = glGetIntegerv; + #else + getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv"); + #endif + + if (getIntegerv) + getIntegerv(GL_NUM_EXTENSIONS, &n); + + /* glGetStringi is OpenGL 3.0 */ + getStringi = (PFNGLGETSTRINGIPROC) glewGetProcAddress((const GLubyte*)"glGetStringi"); + if (getStringi) + for (i = 0; i= (ptrdiff_t) sizeof(ext)) + continue; + _glewStrCopy(ext, i, ' '); + + /* Based on extension string(s), glewGetExtension purposes */ + enable = _glewGetExtensionString(ext); + if (enable) + *enable = GL_TRUE; + + /* Based on extension string(s), experimental mode, glewIsSupported purposes */ + enable = _glewGetExtensionEnable(ext); + if (enable) + *enable = GL_TRUE; + } + } + } +#ifdef GL_VERSION_1_2 + if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(); +#endif /* GL_VERSION_1_2 */ +#ifdef GL_VERSION_1_3 + if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(); +#endif /* GL_VERSION_1_3 */ +#ifdef GL_VERSION_1_4 + if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(); +#endif /* GL_VERSION_1_4 */ +#ifdef GL_VERSION_1_5 + if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(); +#endif /* GL_VERSION_1_5 */ +#ifdef GL_VERSION_2_0 + if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(); +#endif /* GL_VERSION_2_0 */ +#ifdef GL_VERSION_2_1 + if (glewExperimental || GLEW_VERSION_2_1) GLEW_VERSION_2_1 = !_glewInit_GL_VERSION_2_1(); +#endif /* GL_VERSION_2_1 */ +#ifdef GL_VERSION_3_0 + if (glewExperimental || GLEW_VERSION_3_0) GLEW_VERSION_3_0 = !_glewInit_GL_VERSION_3_0(); +#endif /* GL_VERSION_3_0 */ +#ifdef GL_VERSION_3_1 + if (glewExperimental || GLEW_VERSION_3_1) GLEW_VERSION_3_1 = !_glewInit_GL_VERSION_3_1(); +#endif /* GL_VERSION_3_1 */ +#ifdef GL_VERSION_3_2 + if (glewExperimental || GLEW_VERSION_3_2) GLEW_VERSION_3_2 = !_glewInit_GL_VERSION_3_2(); +#endif /* GL_VERSION_3_2 */ +#ifdef GL_VERSION_3_3 + if (glewExperimental || GLEW_VERSION_3_3) GLEW_VERSION_3_3 = !_glewInit_GL_VERSION_3_3(); +#endif /* GL_VERSION_3_3 */ +#ifdef GL_VERSION_4_0 + if (glewExperimental || GLEW_VERSION_4_0) GLEW_VERSION_4_0 = !_glewInit_GL_VERSION_4_0(); +#endif /* GL_VERSION_4_0 */ +#ifdef GL_VERSION_4_5 + if (glewExperimental || GLEW_VERSION_4_5) GLEW_VERSION_4_5 = !_glewInit_GL_VERSION_4_5(); +#endif /* GL_VERSION_4_5 */ +#ifdef GL_VERSION_4_6 + if (glewExperimental || GLEW_VERSION_4_6) GLEW_VERSION_4_6 = !_glewInit_GL_VERSION_4_6(); +#endif /* GL_VERSION_4_6 */ +#ifdef GL_3DFX_tbuffer + if (glewExperimental || GLEW_3DFX_tbuffer) GLEW_3DFX_tbuffer = !_glewInit_GL_3DFX_tbuffer(); +#endif /* GL_3DFX_tbuffer */ +#ifdef GL_AMD_debug_output + if (glewExperimental || GLEW_AMD_debug_output) GLEW_AMD_debug_output = !_glewInit_GL_AMD_debug_output(); +#endif /* GL_AMD_debug_output */ +#ifdef GL_AMD_draw_buffers_blend + if (glewExperimental || GLEW_AMD_draw_buffers_blend) GLEW_AMD_draw_buffers_blend = !_glewInit_GL_AMD_draw_buffers_blend(); +#endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_framebuffer_sample_positions + if (glewExperimental || GLEW_AMD_framebuffer_sample_positions) GLEW_AMD_framebuffer_sample_positions = !_glewInit_GL_AMD_framebuffer_sample_positions(); +#endif /* GL_AMD_framebuffer_sample_positions */ +#ifdef GL_AMD_interleaved_elements + if (glewExperimental || GLEW_AMD_interleaved_elements) GLEW_AMD_interleaved_elements = !_glewInit_GL_AMD_interleaved_elements(); +#endif /* GL_AMD_interleaved_elements */ +#ifdef GL_AMD_multi_draw_indirect + if (glewExperimental || GLEW_AMD_multi_draw_indirect) GLEW_AMD_multi_draw_indirect = !_glewInit_GL_AMD_multi_draw_indirect(); +#endif /* GL_AMD_multi_draw_indirect */ +#ifdef GL_AMD_name_gen_delete + if (glewExperimental || GLEW_AMD_name_gen_delete) GLEW_AMD_name_gen_delete = !_glewInit_GL_AMD_name_gen_delete(); +#endif /* GL_AMD_name_gen_delete */ +#ifdef GL_AMD_occlusion_query_event + if (glewExperimental || GLEW_AMD_occlusion_query_event) GLEW_AMD_occlusion_query_event = !_glewInit_GL_AMD_occlusion_query_event(); +#endif /* GL_AMD_occlusion_query_event */ +#ifdef GL_AMD_performance_monitor + if (glewExperimental || GLEW_AMD_performance_monitor) GLEW_AMD_performance_monitor = !_glewInit_GL_AMD_performance_monitor(); +#endif /* GL_AMD_performance_monitor */ +#ifdef GL_AMD_sample_positions + if (glewExperimental || GLEW_AMD_sample_positions) GLEW_AMD_sample_positions = !_glewInit_GL_AMD_sample_positions(); +#endif /* GL_AMD_sample_positions */ +#ifdef GL_AMD_sparse_texture + if (glewExperimental || GLEW_AMD_sparse_texture) GLEW_AMD_sparse_texture = !_glewInit_GL_AMD_sparse_texture(); +#endif /* GL_AMD_sparse_texture */ +#ifdef GL_AMD_stencil_operation_extended + if (glewExperimental || GLEW_AMD_stencil_operation_extended) GLEW_AMD_stencil_operation_extended = !_glewInit_GL_AMD_stencil_operation_extended(); +#endif /* GL_AMD_stencil_operation_extended */ +#ifdef GL_AMD_vertex_shader_tessellator + if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) GLEW_AMD_vertex_shader_tessellator = !_glewInit_GL_AMD_vertex_shader_tessellator(); +#endif /* GL_AMD_vertex_shader_tessellator */ +#ifdef GL_ANGLE_framebuffer_blit + if (glewExperimental || GLEW_ANGLE_framebuffer_blit) GLEW_ANGLE_framebuffer_blit = !_glewInit_GL_ANGLE_framebuffer_blit(); +#endif /* GL_ANGLE_framebuffer_blit */ +#ifdef GL_ANGLE_framebuffer_multisample + if (glewExperimental || GLEW_ANGLE_framebuffer_multisample) GLEW_ANGLE_framebuffer_multisample = !_glewInit_GL_ANGLE_framebuffer_multisample(); +#endif /* GL_ANGLE_framebuffer_multisample */ +#ifdef GL_ANGLE_instanced_arrays + if (glewExperimental || GLEW_ANGLE_instanced_arrays) GLEW_ANGLE_instanced_arrays = !_glewInit_GL_ANGLE_instanced_arrays(); +#endif /* GL_ANGLE_instanced_arrays */ +#ifdef GL_ANGLE_timer_query + if (glewExperimental || GLEW_ANGLE_timer_query) GLEW_ANGLE_timer_query = !_glewInit_GL_ANGLE_timer_query(); +#endif /* GL_ANGLE_timer_query */ +#ifdef GL_ANGLE_translated_shader_source + if (glewExperimental || GLEW_ANGLE_translated_shader_source) GLEW_ANGLE_translated_shader_source = !_glewInit_GL_ANGLE_translated_shader_source(); +#endif /* GL_ANGLE_translated_shader_source */ +#ifdef GL_APPLE_copy_texture_levels + if (glewExperimental || GLEW_APPLE_copy_texture_levels) GLEW_APPLE_copy_texture_levels = !_glewInit_GL_APPLE_copy_texture_levels(); +#endif /* GL_APPLE_copy_texture_levels */ +#ifdef GL_APPLE_element_array + if (glewExperimental || GLEW_APPLE_element_array) GLEW_APPLE_element_array = !_glewInit_GL_APPLE_element_array(); +#endif /* GL_APPLE_element_array */ +#ifdef GL_APPLE_fence + if (glewExperimental || GLEW_APPLE_fence) GLEW_APPLE_fence = !_glewInit_GL_APPLE_fence(); +#endif /* GL_APPLE_fence */ +#ifdef GL_APPLE_flush_buffer_range + if (glewExperimental || GLEW_APPLE_flush_buffer_range) GLEW_APPLE_flush_buffer_range = !_glewInit_GL_APPLE_flush_buffer_range(); +#endif /* GL_APPLE_flush_buffer_range */ +#ifdef GL_APPLE_framebuffer_multisample + if (glewExperimental || GLEW_APPLE_framebuffer_multisample) GLEW_APPLE_framebuffer_multisample = !_glewInit_GL_APPLE_framebuffer_multisample(); +#endif /* GL_APPLE_framebuffer_multisample */ +#ifdef GL_APPLE_object_purgeable + if (glewExperimental || GLEW_APPLE_object_purgeable) GLEW_APPLE_object_purgeable = !_glewInit_GL_APPLE_object_purgeable(); +#endif /* GL_APPLE_object_purgeable */ +#ifdef GL_APPLE_sync + if (glewExperimental || GLEW_APPLE_sync) GLEW_APPLE_sync = !_glewInit_GL_APPLE_sync(); +#endif /* GL_APPLE_sync */ +#ifdef GL_APPLE_texture_range + if (glewExperimental || GLEW_APPLE_texture_range) GLEW_APPLE_texture_range = !_glewInit_GL_APPLE_texture_range(); +#endif /* GL_APPLE_texture_range */ +#ifdef GL_APPLE_vertex_array_object + if (glewExperimental || GLEW_APPLE_vertex_array_object) GLEW_APPLE_vertex_array_object = !_glewInit_GL_APPLE_vertex_array_object(); +#endif /* GL_APPLE_vertex_array_object */ +#ifdef GL_APPLE_vertex_array_range + if (glewExperimental || GLEW_APPLE_vertex_array_range) GLEW_APPLE_vertex_array_range = !_glewInit_GL_APPLE_vertex_array_range(); +#endif /* GL_APPLE_vertex_array_range */ +#ifdef GL_APPLE_vertex_program_evaluators + if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) GLEW_APPLE_vertex_program_evaluators = !_glewInit_GL_APPLE_vertex_program_evaluators(); +#endif /* GL_APPLE_vertex_program_evaluators */ +#ifdef GL_ARB_ES2_compatibility + if (glewExperimental || GLEW_ARB_ES2_compatibility) GLEW_ARB_ES2_compatibility = !_glewInit_GL_ARB_ES2_compatibility(); +#endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_ES3_1_compatibility + if (glewExperimental || GLEW_ARB_ES3_1_compatibility) GLEW_ARB_ES3_1_compatibility = !_glewInit_GL_ARB_ES3_1_compatibility(); +#endif /* GL_ARB_ES3_1_compatibility */ +#ifdef GL_ARB_ES3_2_compatibility + if (glewExperimental || GLEW_ARB_ES3_2_compatibility) GLEW_ARB_ES3_2_compatibility = !_glewInit_GL_ARB_ES3_2_compatibility(); +#endif /* GL_ARB_ES3_2_compatibility */ +#ifdef GL_ARB_base_instance + if (glewExperimental || GLEW_ARB_base_instance) GLEW_ARB_base_instance = !_glewInit_GL_ARB_base_instance(); +#endif /* GL_ARB_base_instance */ +#ifdef GL_ARB_bindless_texture + if (glewExperimental || GLEW_ARB_bindless_texture) GLEW_ARB_bindless_texture = !_glewInit_GL_ARB_bindless_texture(); +#endif /* GL_ARB_bindless_texture */ +#ifdef GL_ARB_blend_func_extended + if (glewExperimental || GLEW_ARB_blend_func_extended) GLEW_ARB_blend_func_extended = !_glewInit_GL_ARB_blend_func_extended(); +#endif /* GL_ARB_blend_func_extended */ +#ifdef GL_ARB_buffer_storage + if (glewExperimental || GLEW_ARB_buffer_storage) GLEW_ARB_buffer_storage = !_glewInit_GL_ARB_buffer_storage(); +#endif /* GL_ARB_buffer_storage */ +#ifdef GL_ARB_cl_event + if (glewExperimental || GLEW_ARB_cl_event) GLEW_ARB_cl_event = !_glewInit_GL_ARB_cl_event(); +#endif /* GL_ARB_cl_event */ +#ifdef GL_ARB_clear_buffer_object + if (glewExperimental || GLEW_ARB_clear_buffer_object) GLEW_ARB_clear_buffer_object = !_glewInit_GL_ARB_clear_buffer_object(); +#endif /* GL_ARB_clear_buffer_object */ +#ifdef GL_ARB_clear_texture + if (glewExperimental || GLEW_ARB_clear_texture) GLEW_ARB_clear_texture = !_glewInit_GL_ARB_clear_texture(); +#endif /* GL_ARB_clear_texture */ +#ifdef GL_ARB_clip_control + if (glewExperimental || GLEW_ARB_clip_control) GLEW_ARB_clip_control = !_glewInit_GL_ARB_clip_control(); +#endif /* GL_ARB_clip_control */ +#ifdef GL_ARB_color_buffer_float + if (glewExperimental || GLEW_ARB_color_buffer_float) GLEW_ARB_color_buffer_float = !_glewInit_GL_ARB_color_buffer_float(); +#endif /* GL_ARB_color_buffer_float */ +#ifdef GL_ARB_compute_shader + if (glewExperimental || GLEW_ARB_compute_shader) GLEW_ARB_compute_shader = !_glewInit_GL_ARB_compute_shader(); +#endif /* GL_ARB_compute_shader */ +#ifdef GL_ARB_compute_variable_group_size + if (glewExperimental || GLEW_ARB_compute_variable_group_size) GLEW_ARB_compute_variable_group_size = !_glewInit_GL_ARB_compute_variable_group_size(); +#endif /* GL_ARB_compute_variable_group_size */ +#ifdef GL_ARB_copy_buffer + if (glewExperimental || GLEW_ARB_copy_buffer) GLEW_ARB_copy_buffer = !_glewInit_GL_ARB_copy_buffer(); +#endif /* GL_ARB_copy_buffer */ +#ifdef GL_ARB_copy_image + if (glewExperimental || GLEW_ARB_copy_image) GLEW_ARB_copy_image = !_glewInit_GL_ARB_copy_image(); +#endif /* GL_ARB_copy_image */ +#ifdef GL_ARB_debug_output + if (glewExperimental || GLEW_ARB_debug_output) GLEW_ARB_debug_output = !_glewInit_GL_ARB_debug_output(); +#endif /* GL_ARB_debug_output */ +#ifdef GL_ARB_direct_state_access + if (glewExperimental || GLEW_ARB_direct_state_access) GLEW_ARB_direct_state_access = !_glewInit_GL_ARB_direct_state_access(); +#endif /* GL_ARB_direct_state_access */ +#ifdef GL_ARB_draw_buffers + if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(); +#endif /* GL_ARB_draw_buffers */ +#ifdef GL_ARB_draw_buffers_blend + if (glewExperimental || GLEW_ARB_draw_buffers_blend) GLEW_ARB_draw_buffers_blend = !_glewInit_GL_ARB_draw_buffers_blend(); +#endif /* GL_ARB_draw_buffers_blend */ +#ifdef GL_ARB_draw_elements_base_vertex + if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) GLEW_ARB_draw_elements_base_vertex = !_glewInit_GL_ARB_draw_elements_base_vertex(); +#endif /* GL_ARB_draw_elements_base_vertex */ +#ifdef GL_ARB_draw_indirect + if (glewExperimental || GLEW_ARB_draw_indirect) GLEW_ARB_draw_indirect = !_glewInit_GL_ARB_draw_indirect(); +#endif /* GL_ARB_draw_indirect */ +#ifdef GL_ARB_framebuffer_no_attachments + if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) GLEW_ARB_framebuffer_no_attachments = !_glewInit_GL_ARB_framebuffer_no_attachments(); +#endif /* GL_ARB_framebuffer_no_attachments */ +#ifdef GL_ARB_framebuffer_object + if (glewExperimental || GLEW_ARB_framebuffer_object) GLEW_ARB_framebuffer_object = !_glewInit_GL_ARB_framebuffer_object(); +#endif /* GL_ARB_framebuffer_object */ +#ifdef GL_ARB_geometry_shader4 + if (glewExperimental || GLEW_ARB_geometry_shader4) GLEW_ARB_geometry_shader4 = !_glewInit_GL_ARB_geometry_shader4(); +#endif /* GL_ARB_geometry_shader4 */ +#ifdef GL_ARB_get_program_binary + if (glewExperimental || GLEW_ARB_get_program_binary) GLEW_ARB_get_program_binary = !_glewInit_GL_ARB_get_program_binary(); +#endif /* GL_ARB_get_program_binary */ +#ifdef GL_ARB_get_texture_sub_image + if (glewExperimental || GLEW_ARB_get_texture_sub_image) GLEW_ARB_get_texture_sub_image = !_glewInit_GL_ARB_get_texture_sub_image(); +#endif /* GL_ARB_get_texture_sub_image */ +#ifdef GL_ARB_gl_spirv + if (glewExperimental || GLEW_ARB_gl_spirv) GLEW_ARB_gl_spirv = !_glewInit_GL_ARB_gl_spirv(); +#endif /* GL_ARB_gl_spirv */ +#ifdef GL_ARB_gpu_shader_fp64 + if (glewExperimental || GLEW_ARB_gpu_shader_fp64) GLEW_ARB_gpu_shader_fp64 = !_glewInit_GL_ARB_gpu_shader_fp64(); +#endif /* GL_ARB_gpu_shader_fp64 */ +#ifdef GL_ARB_gpu_shader_int64 + if (glewExperimental || GLEW_ARB_gpu_shader_int64) GLEW_ARB_gpu_shader_int64 = !_glewInit_GL_ARB_gpu_shader_int64(); +#endif /* GL_ARB_gpu_shader_int64 */ +#ifdef GL_ARB_imaging + if (glewExperimental || GLEW_ARB_imaging) GLEW_ARB_imaging = !_glewInit_GL_ARB_imaging(); +#endif /* GL_ARB_imaging */ +#ifdef GL_ARB_indirect_parameters + if (glewExperimental || GLEW_ARB_indirect_parameters) GLEW_ARB_indirect_parameters = !_glewInit_GL_ARB_indirect_parameters(); +#endif /* GL_ARB_indirect_parameters */ +#ifdef GL_ARB_instanced_arrays + if (glewExperimental || GLEW_ARB_instanced_arrays) GLEW_ARB_instanced_arrays = !_glewInit_GL_ARB_instanced_arrays(); +#endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + if (glewExperimental || GLEW_ARB_internalformat_query) GLEW_ARB_internalformat_query = !_glewInit_GL_ARB_internalformat_query(); +#endif /* GL_ARB_internalformat_query */ +#ifdef GL_ARB_internalformat_query2 + if (glewExperimental || GLEW_ARB_internalformat_query2) GLEW_ARB_internalformat_query2 = !_glewInit_GL_ARB_internalformat_query2(); +#endif /* GL_ARB_internalformat_query2 */ +#ifdef GL_ARB_invalidate_subdata + if (glewExperimental || GLEW_ARB_invalidate_subdata) GLEW_ARB_invalidate_subdata = !_glewInit_GL_ARB_invalidate_subdata(); +#endif /* GL_ARB_invalidate_subdata */ +#ifdef GL_ARB_map_buffer_range + if (glewExperimental || GLEW_ARB_map_buffer_range) GLEW_ARB_map_buffer_range = !_glewInit_GL_ARB_map_buffer_range(); +#endif /* GL_ARB_map_buffer_range */ +#ifdef GL_ARB_matrix_palette + if (glewExperimental || GLEW_ARB_matrix_palette) GLEW_ARB_matrix_palette = !_glewInit_GL_ARB_matrix_palette(); +#endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multi_bind + if (glewExperimental || GLEW_ARB_multi_bind) GLEW_ARB_multi_bind = !_glewInit_GL_ARB_multi_bind(); +#endif /* GL_ARB_multi_bind */ +#ifdef GL_ARB_multi_draw_indirect + if (glewExperimental || GLEW_ARB_multi_draw_indirect) GLEW_ARB_multi_draw_indirect = !_glewInit_GL_ARB_multi_draw_indirect(); +#endif /* GL_ARB_multi_draw_indirect */ +#ifdef GL_ARB_multisample + if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(); +#endif /* GL_ARB_multisample */ +#ifdef GL_ARB_multitexture + if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(); +#endif /* GL_ARB_multitexture */ +#ifdef GL_ARB_occlusion_query + if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(); +#endif /* GL_ARB_occlusion_query */ +#ifdef GL_ARB_parallel_shader_compile + if (glewExperimental || GLEW_ARB_parallel_shader_compile) GLEW_ARB_parallel_shader_compile = !_glewInit_GL_ARB_parallel_shader_compile(); +#endif /* GL_ARB_parallel_shader_compile */ +#ifdef GL_ARB_point_parameters + if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(); +#endif /* GL_ARB_point_parameters */ +#ifdef GL_ARB_polygon_offset_clamp + if (glewExperimental || GLEW_ARB_polygon_offset_clamp) GLEW_ARB_polygon_offset_clamp = !_glewInit_GL_ARB_polygon_offset_clamp(); +#endif /* GL_ARB_polygon_offset_clamp */ +#ifdef GL_ARB_program_interface_query + if (glewExperimental || GLEW_ARB_program_interface_query) GLEW_ARB_program_interface_query = !_glewInit_GL_ARB_program_interface_query(); +#endif /* GL_ARB_program_interface_query */ +#ifdef GL_ARB_provoking_vertex + if (glewExperimental || GLEW_ARB_provoking_vertex) GLEW_ARB_provoking_vertex = !_glewInit_GL_ARB_provoking_vertex(); +#endif /* GL_ARB_provoking_vertex */ +#ifdef GL_ARB_robustness + if (glewExperimental || GLEW_ARB_robustness) GLEW_ARB_robustness = !_glewInit_GL_ARB_robustness(); +#endif /* GL_ARB_robustness */ +#ifdef GL_ARB_sample_locations + if (glewExperimental || GLEW_ARB_sample_locations) GLEW_ARB_sample_locations = !_glewInit_GL_ARB_sample_locations(); +#endif /* GL_ARB_sample_locations */ +#ifdef GL_ARB_sample_shading + if (glewExperimental || GLEW_ARB_sample_shading) GLEW_ARB_sample_shading = !_glewInit_GL_ARB_sample_shading(); +#endif /* GL_ARB_sample_shading */ +#ifdef GL_ARB_sampler_objects + if (glewExperimental || GLEW_ARB_sampler_objects) GLEW_ARB_sampler_objects = !_glewInit_GL_ARB_sampler_objects(); +#endif /* GL_ARB_sampler_objects */ +#ifdef GL_ARB_separate_shader_objects + if (glewExperimental || GLEW_ARB_separate_shader_objects) GLEW_ARB_separate_shader_objects = !_glewInit_GL_ARB_separate_shader_objects(); +#endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + if (glewExperimental || GLEW_ARB_shader_atomic_counters) GLEW_ARB_shader_atomic_counters = !_glewInit_GL_ARB_shader_atomic_counters(); +#endif /* GL_ARB_shader_atomic_counters */ +#ifdef GL_ARB_shader_image_load_store + if (glewExperimental || GLEW_ARB_shader_image_load_store) GLEW_ARB_shader_image_load_store = !_glewInit_GL_ARB_shader_image_load_store(); +#endif /* GL_ARB_shader_image_load_store */ +#ifdef GL_ARB_shader_objects + if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(); +#endif /* GL_ARB_shader_objects */ +#ifdef GL_ARB_shader_storage_buffer_object + if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) GLEW_ARB_shader_storage_buffer_object = !_glewInit_GL_ARB_shader_storage_buffer_object(); +#endif /* GL_ARB_shader_storage_buffer_object */ +#ifdef GL_ARB_shader_subroutine + if (glewExperimental || GLEW_ARB_shader_subroutine) GLEW_ARB_shader_subroutine = !_glewInit_GL_ARB_shader_subroutine(); +#endif /* GL_ARB_shader_subroutine */ +#ifdef GL_ARB_shading_language_include + if (glewExperimental || GLEW_ARB_shading_language_include) GLEW_ARB_shading_language_include = !_glewInit_GL_ARB_shading_language_include(); +#endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_sparse_buffer + if (glewExperimental || GLEW_ARB_sparse_buffer) GLEW_ARB_sparse_buffer = !_glewInit_GL_ARB_sparse_buffer(); +#endif /* GL_ARB_sparse_buffer */ +#ifdef GL_ARB_sparse_texture + if (glewExperimental || GLEW_ARB_sparse_texture) GLEW_ARB_sparse_texture = !_glewInit_GL_ARB_sparse_texture(); +#endif /* GL_ARB_sparse_texture */ +#ifdef GL_ARB_sync + if (glewExperimental || GLEW_ARB_sync) GLEW_ARB_sync = !_glewInit_GL_ARB_sync(); +#endif /* GL_ARB_sync */ +#ifdef GL_ARB_tessellation_shader + if (glewExperimental || GLEW_ARB_tessellation_shader) GLEW_ARB_tessellation_shader = !_glewInit_GL_ARB_tessellation_shader(); +#endif /* GL_ARB_tessellation_shader */ +#ifdef GL_ARB_texture_barrier + if (glewExperimental || GLEW_ARB_texture_barrier) GLEW_ARB_texture_barrier = !_glewInit_GL_ARB_texture_barrier(); +#endif /* GL_ARB_texture_barrier */ +#ifdef GL_ARB_texture_buffer_object + if (glewExperimental || GLEW_ARB_texture_buffer_object) GLEW_ARB_texture_buffer_object = !_glewInit_GL_ARB_texture_buffer_object(); +#endif /* GL_ARB_texture_buffer_object */ +#ifdef GL_ARB_texture_buffer_range + if (glewExperimental || GLEW_ARB_texture_buffer_range) GLEW_ARB_texture_buffer_range = !_glewInit_GL_ARB_texture_buffer_range(); +#endif /* GL_ARB_texture_buffer_range */ +#ifdef GL_ARB_texture_compression + if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(); +#endif /* GL_ARB_texture_compression */ +#ifdef GL_ARB_texture_multisample + if (glewExperimental || GLEW_ARB_texture_multisample) GLEW_ARB_texture_multisample = !_glewInit_GL_ARB_texture_multisample(); +#endif /* GL_ARB_texture_multisample */ +#ifdef GL_ARB_texture_storage + if (glewExperimental || GLEW_ARB_texture_storage) GLEW_ARB_texture_storage = !_glewInit_GL_ARB_texture_storage(); +#endif /* GL_ARB_texture_storage */ +#ifdef GL_ARB_texture_storage_multisample + if (glewExperimental || GLEW_ARB_texture_storage_multisample) GLEW_ARB_texture_storage_multisample = !_glewInit_GL_ARB_texture_storage_multisample(); +#endif /* GL_ARB_texture_storage_multisample */ +#ifdef GL_ARB_texture_view + if (glewExperimental || GLEW_ARB_texture_view) GLEW_ARB_texture_view = !_glewInit_GL_ARB_texture_view(); +#endif /* GL_ARB_texture_view */ +#ifdef GL_ARB_timer_query + if (glewExperimental || GLEW_ARB_timer_query) GLEW_ARB_timer_query = !_glewInit_GL_ARB_timer_query(); +#endif /* GL_ARB_timer_query */ +#ifdef GL_ARB_transform_feedback2 + if (glewExperimental || GLEW_ARB_transform_feedback2) GLEW_ARB_transform_feedback2 = !_glewInit_GL_ARB_transform_feedback2(); +#endif /* GL_ARB_transform_feedback2 */ +#ifdef GL_ARB_transform_feedback3 + if (glewExperimental || GLEW_ARB_transform_feedback3) GLEW_ARB_transform_feedback3 = !_glewInit_GL_ARB_transform_feedback3(); +#endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + if (glewExperimental || GLEW_ARB_transform_feedback_instanced) GLEW_ARB_transform_feedback_instanced = !_glewInit_GL_ARB_transform_feedback_instanced(); +#endif /* GL_ARB_transform_feedback_instanced */ +#ifdef GL_ARB_transpose_matrix + if (glewExperimental || GLEW_ARB_transpose_matrix) GLEW_ARB_transpose_matrix = !_glewInit_GL_ARB_transpose_matrix(); +#endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + if (glewExperimental || GLEW_ARB_uniform_buffer_object) GLEW_ARB_uniform_buffer_object = !_glewInit_GL_ARB_uniform_buffer_object(); +#endif /* GL_ARB_uniform_buffer_object */ +#ifdef GL_ARB_vertex_array_object + if (glewExperimental || GLEW_ARB_vertex_array_object) GLEW_ARB_vertex_array_object = !_glewInit_GL_ARB_vertex_array_object(); +#endif /* GL_ARB_vertex_array_object */ +#ifdef GL_ARB_vertex_attrib_64bit + if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) GLEW_ARB_vertex_attrib_64bit = !_glewInit_GL_ARB_vertex_attrib_64bit(); +#endif /* GL_ARB_vertex_attrib_64bit */ +#ifdef GL_ARB_vertex_attrib_binding + if (glewExperimental || GLEW_ARB_vertex_attrib_binding) GLEW_ARB_vertex_attrib_binding = !_glewInit_GL_ARB_vertex_attrib_binding(); +#endif /* GL_ARB_vertex_attrib_binding */ +#ifdef GL_ARB_vertex_blend + if (glewExperimental || GLEW_ARB_vertex_blend) GLEW_ARB_vertex_blend = !_glewInit_GL_ARB_vertex_blend(); +#endif /* GL_ARB_vertex_blend */ +#ifdef GL_ARB_vertex_buffer_object + if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(); +#endif /* GL_ARB_vertex_buffer_object */ +#ifdef GL_ARB_vertex_program + if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(); +#endif /* GL_ARB_vertex_program */ +#ifdef GL_ARB_vertex_shader + if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(); _glewInit_GL_ARB_vertex_program(); } +#endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) GLEW_ARB_vertex_type_2_10_10_10_rev = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_ARB_viewport_array + if (glewExperimental || GLEW_ARB_viewport_array) GLEW_ARB_viewport_array = !_glewInit_GL_ARB_viewport_array(); +#endif /* GL_ARB_viewport_array */ +#ifdef GL_ARB_window_pos + if (glewExperimental || GLEW_ARB_window_pos) GLEW_ARB_window_pos = !_glewInit_GL_ARB_window_pos(); +#endif /* GL_ARB_window_pos */ +#ifdef GL_ATI_draw_buffers + if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(); +#endif /* GL_ATI_draw_buffers */ +#ifdef GL_ATI_element_array + if (glewExperimental || GLEW_ATI_element_array) GLEW_ATI_element_array = !_glewInit_GL_ATI_element_array(); +#endif /* GL_ATI_element_array */ +#ifdef GL_ATI_envmap_bumpmap + if (glewExperimental || GLEW_ATI_envmap_bumpmap) GLEW_ATI_envmap_bumpmap = !_glewInit_GL_ATI_envmap_bumpmap(); +#endif /* GL_ATI_envmap_bumpmap */ +#ifdef GL_ATI_fragment_shader + if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(); +#endif /* GL_ATI_fragment_shader */ +#ifdef GL_ATI_map_object_buffer + if (glewExperimental || GLEW_ATI_map_object_buffer) GLEW_ATI_map_object_buffer = !_glewInit_GL_ATI_map_object_buffer(); +#endif /* GL_ATI_map_object_buffer */ +#ifdef GL_ATI_pn_triangles + if (glewExperimental || GLEW_ATI_pn_triangles) GLEW_ATI_pn_triangles = !_glewInit_GL_ATI_pn_triangles(); +#endif /* GL_ATI_pn_triangles */ +#ifdef GL_ATI_separate_stencil + if (glewExperimental || GLEW_ATI_separate_stencil) GLEW_ATI_separate_stencil = !_glewInit_GL_ATI_separate_stencil(); +#endif /* GL_ATI_separate_stencil */ +#ifdef GL_ATI_vertex_array_object + if (glewExperimental || GLEW_ATI_vertex_array_object) GLEW_ATI_vertex_array_object = !_glewInit_GL_ATI_vertex_array_object(); +#endif /* GL_ATI_vertex_array_object */ +#ifdef GL_ATI_vertex_attrib_array_object + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) GLEW_ATI_vertex_attrib_array_object = !_glewInit_GL_ATI_vertex_attrib_array_object(); +#endif /* GL_ATI_vertex_attrib_array_object */ +#ifdef GL_ATI_vertex_streams + if (glewExperimental || GLEW_ATI_vertex_streams) GLEW_ATI_vertex_streams = !_glewInit_GL_ATI_vertex_streams(); +#endif /* GL_ATI_vertex_streams */ +#ifdef GL_EXT_base_instance + if (glewExperimental || GLEW_EXT_base_instance) GLEW_EXT_base_instance = !_glewInit_GL_EXT_base_instance(); +#endif /* GL_EXT_base_instance */ +#ifdef GL_EXT_bindable_uniform + if (glewExperimental || GLEW_EXT_bindable_uniform) GLEW_EXT_bindable_uniform = !_glewInit_GL_EXT_bindable_uniform(); +#endif /* GL_EXT_bindable_uniform */ +#ifdef GL_EXT_blend_color + if (glewExperimental || GLEW_EXT_blend_color) GLEW_EXT_blend_color = !_glewInit_GL_EXT_blend_color(); +#endif /* GL_EXT_blend_color */ +#ifdef GL_EXT_blend_equation_separate + if (glewExperimental || GLEW_EXT_blend_equation_separate) GLEW_EXT_blend_equation_separate = !_glewInit_GL_EXT_blend_equation_separate(); +#endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_extended + if (glewExperimental || GLEW_EXT_blend_func_extended) GLEW_EXT_blend_func_extended = !_glewInit_GL_EXT_blend_func_extended(); +#endif /* GL_EXT_blend_func_extended */ +#ifdef GL_EXT_blend_func_separate + if (glewExperimental || GLEW_EXT_blend_func_separate) GLEW_EXT_blend_func_separate = !_glewInit_GL_EXT_blend_func_separate(); +#endif /* GL_EXT_blend_func_separate */ +#ifdef GL_EXT_blend_minmax + if (glewExperimental || GLEW_EXT_blend_minmax) GLEW_EXT_blend_minmax = !_glewInit_GL_EXT_blend_minmax(); +#endif /* GL_EXT_blend_minmax */ +#ifdef GL_EXT_buffer_storage + if (glewExperimental || GLEW_EXT_buffer_storage) GLEW_EXT_buffer_storage = !_glewInit_GL_EXT_buffer_storage(); +#endif /* GL_EXT_buffer_storage */ +#ifdef GL_EXT_clear_texture + if (glewExperimental || GLEW_EXT_clear_texture) GLEW_EXT_clear_texture = !_glewInit_GL_EXT_clear_texture(); +#endif /* GL_EXT_clear_texture */ +#ifdef GL_EXT_color_subtable + if (glewExperimental || GLEW_EXT_color_subtable) GLEW_EXT_color_subtable = !_glewInit_GL_EXT_color_subtable(); +#endif /* GL_EXT_color_subtable */ +#ifdef GL_EXT_compiled_vertex_array + if (glewExperimental || GLEW_EXT_compiled_vertex_array) GLEW_EXT_compiled_vertex_array = !_glewInit_GL_EXT_compiled_vertex_array(); +#endif /* GL_EXT_compiled_vertex_array */ +#ifdef GL_EXT_convolution + if (glewExperimental || GLEW_EXT_convolution) GLEW_EXT_convolution = !_glewInit_GL_EXT_convolution(); +#endif /* GL_EXT_convolution */ +#ifdef GL_EXT_coordinate_frame + if (glewExperimental || GLEW_EXT_coordinate_frame) GLEW_EXT_coordinate_frame = !_glewInit_GL_EXT_coordinate_frame(); +#endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_image + if (glewExperimental || GLEW_EXT_copy_image) GLEW_EXT_copy_image = !_glewInit_GL_EXT_copy_image(); +#endif /* GL_EXT_copy_image */ +#ifdef GL_EXT_copy_texture + if (glewExperimental || GLEW_EXT_copy_texture) GLEW_EXT_copy_texture = !_glewInit_GL_EXT_copy_texture(); +#endif /* GL_EXT_copy_texture */ +#ifdef GL_EXT_cull_vertex + if (glewExperimental || GLEW_EXT_cull_vertex) GLEW_EXT_cull_vertex = !_glewInit_GL_EXT_cull_vertex(); +#endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_debug_label + if (glewExperimental || GLEW_EXT_debug_label) GLEW_EXT_debug_label = !_glewInit_GL_EXT_debug_label(); +#endif /* GL_EXT_debug_label */ +#ifdef GL_EXT_debug_marker + if (glewExperimental || GLEW_EXT_debug_marker) GLEW_EXT_debug_marker = !_glewInit_GL_EXT_debug_marker(); +#endif /* GL_EXT_debug_marker */ +#ifdef GL_EXT_depth_bounds_test + if (glewExperimental || GLEW_EXT_depth_bounds_test) GLEW_EXT_depth_bounds_test = !_glewInit_GL_EXT_depth_bounds_test(); +#endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + if (glewExperimental || GLEW_EXT_direct_state_access) GLEW_EXT_direct_state_access = !_glewInit_GL_EXT_direct_state_access(); +#endif /* GL_EXT_direct_state_access */ +#ifdef GL_EXT_discard_framebuffer + if (glewExperimental || GLEW_EXT_discard_framebuffer) GLEW_EXT_discard_framebuffer = !_glewInit_GL_EXT_discard_framebuffer(); +#endif /* GL_EXT_discard_framebuffer */ +#ifdef GL_EXT_draw_buffers + if (glewExperimental || GLEW_EXT_draw_buffers) GLEW_EXT_draw_buffers = !_glewInit_GL_EXT_draw_buffers(); +#endif /* GL_EXT_draw_buffers */ +#ifdef GL_EXT_draw_buffers2 + if (glewExperimental || GLEW_EXT_draw_buffers2) GLEW_EXT_draw_buffers2 = !_glewInit_GL_EXT_draw_buffers2(); +#endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_buffers_indexed + if (glewExperimental || GLEW_EXT_draw_buffers_indexed) GLEW_EXT_draw_buffers_indexed = !_glewInit_GL_EXT_draw_buffers_indexed(); +#endif /* GL_EXT_draw_buffers_indexed */ +#ifdef GL_EXT_draw_elements_base_vertex + if (glewExperimental || GLEW_EXT_draw_elements_base_vertex) GLEW_EXT_draw_elements_base_vertex = !_glewInit_GL_EXT_draw_elements_base_vertex(); +#endif /* GL_EXT_draw_elements_base_vertex */ +#ifdef GL_EXT_draw_instanced + if (glewExperimental || GLEW_EXT_draw_instanced) GLEW_EXT_draw_instanced = !_glewInit_GL_EXT_draw_instanced(); +#endif /* GL_EXT_draw_instanced */ +#ifdef GL_EXT_draw_range_elements + if (glewExperimental || GLEW_EXT_draw_range_elements) GLEW_EXT_draw_range_elements = !_glewInit_GL_EXT_draw_range_elements(); +#endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_external_buffer + if (glewExperimental || GLEW_EXT_external_buffer) GLEW_EXT_external_buffer = !_glewInit_GL_EXT_external_buffer(); +#endif /* GL_EXT_external_buffer */ +#ifdef GL_EXT_fog_coord + if (glewExperimental || GLEW_EXT_fog_coord) GLEW_EXT_fog_coord = !_glewInit_GL_EXT_fog_coord(); +#endif /* GL_EXT_fog_coord */ +#ifdef GL_EXT_fragment_lighting + if (glewExperimental || GLEW_EXT_fragment_lighting) GLEW_EXT_fragment_lighting = !_glewInit_GL_EXT_fragment_lighting(); +#endif /* GL_EXT_fragment_lighting */ +#ifdef GL_EXT_framebuffer_blit + if (glewExperimental || GLEW_EXT_framebuffer_blit) GLEW_EXT_framebuffer_blit = !_glewInit_GL_EXT_framebuffer_blit(); +#endif /* GL_EXT_framebuffer_blit */ +#ifdef GL_EXT_framebuffer_multisample + if (glewExperimental || GLEW_EXT_framebuffer_multisample) GLEW_EXT_framebuffer_multisample = !_glewInit_GL_EXT_framebuffer_multisample(); +#endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_object + if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(); +#endif /* GL_EXT_framebuffer_object */ +#ifdef GL_EXT_geometry_shader4 + if (glewExperimental || GLEW_EXT_geometry_shader4) GLEW_EXT_geometry_shader4 = !_glewInit_GL_EXT_geometry_shader4(); +#endif /* GL_EXT_geometry_shader4 */ +#ifdef GL_EXT_gpu_program_parameters + if (glewExperimental || GLEW_EXT_gpu_program_parameters) GLEW_EXT_gpu_program_parameters = !_glewInit_GL_EXT_gpu_program_parameters(); +#endif /* GL_EXT_gpu_program_parameters */ +#ifdef GL_EXT_gpu_shader4 + if (glewExperimental || GLEW_EXT_gpu_shader4) GLEW_EXT_gpu_shader4 = !_glewInit_GL_EXT_gpu_shader4(); +#endif /* GL_EXT_gpu_shader4 */ +#ifdef GL_EXT_histogram + if (glewExperimental || GLEW_EXT_histogram) GLEW_EXT_histogram = !_glewInit_GL_EXT_histogram(); +#endif /* GL_EXT_histogram */ +#ifdef GL_EXT_index_func + if (glewExperimental || GLEW_EXT_index_func) GLEW_EXT_index_func = !_glewInit_GL_EXT_index_func(); +#endif /* GL_EXT_index_func */ +#ifdef GL_EXT_index_material + if (glewExperimental || GLEW_EXT_index_material) GLEW_EXT_index_material = !_glewInit_GL_EXT_index_material(); +#endif /* GL_EXT_index_material */ +#ifdef GL_EXT_instanced_arrays + if (glewExperimental || GLEW_EXT_instanced_arrays) GLEW_EXT_instanced_arrays = !_glewInit_GL_EXT_instanced_arrays(); +#endif /* GL_EXT_instanced_arrays */ +#ifdef GL_EXT_light_texture + if (glewExperimental || GLEW_EXT_light_texture) GLEW_EXT_light_texture = !_glewInit_GL_EXT_light_texture(); +#endif /* GL_EXT_light_texture */ +#ifdef GL_EXT_map_buffer_range + if (glewExperimental || GLEW_EXT_map_buffer_range) GLEW_EXT_map_buffer_range = !_glewInit_GL_EXT_map_buffer_range(); +#endif /* GL_EXT_map_buffer_range */ +#ifdef GL_EXT_memory_object + if (glewExperimental || GLEW_EXT_memory_object) GLEW_EXT_memory_object = !_glewInit_GL_EXT_memory_object(); +#endif /* GL_EXT_memory_object */ +#ifdef GL_EXT_memory_object_fd + if (glewExperimental || GLEW_EXT_memory_object_fd) GLEW_EXT_memory_object_fd = !_glewInit_GL_EXT_memory_object_fd(); +#endif /* GL_EXT_memory_object_fd */ +#ifdef GL_EXT_memory_object_win32 + if (glewExperimental || GLEW_EXT_memory_object_win32) GLEW_EXT_memory_object_win32 = !_glewInit_GL_EXT_memory_object_win32(); +#endif /* GL_EXT_memory_object_win32 */ +#ifdef GL_EXT_multi_draw_arrays + if (glewExperimental || GLEW_EXT_multi_draw_arrays) GLEW_EXT_multi_draw_arrays = !_glewInit_GL_EXT_multi_draw_arrays(); +#endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multi_draw_indirect + if (glewExperimental || GLEW_EXT_multi_draw_indirect) GLEW_EXT_multi_draw_indirect = !_glewInit_GL_EXT_multi_draw_indirect(); +#endif /* GL_EXT_multi_draw_indirect */ +#ifdef GL_EXT_multisample + if (glewExperimental || GLEW_EXT_multisample) GLEW_EXT_multisample = !_glewInit_GL_EXT_multisample(); +#endif /* GL_EXT_multisample */ +#ifdef GL_EXT_multisampled_render_to_texture + if (glewExperimental || GLEW_EXT_multisampled_render_to_texture) GLEW_EXT_multisampled_render_to_texture = !_glewInit_GL_EXT_multisampled_render_to_texture(); +#endif /* GL_EXT_multisampled_render_to_texture */ +#ifdef GL_EXT_multiview_draw_buffers + if (glewExperimental || GLEW_EXT_multiview_draw_buffers) GLEW_EXT_multiview_draw_buffers = !_glewInit_GL_EXT_multiview_draw_buffers(); +#endif /* GL_EXT_multiview_draw_buffers */ +#ifdef GL_EXT_paletted_texture + if (glewExperimental || GLEW_EXT_paletted_texture) GLEW_EXT_paletted_texture = !_glewInit_GL_EXT_paletted_texture(); +#endif /* GL_EXT_paletted_texture */ +#ifdef GL_EXT_pixel_transform + if (glewExperimental || GLEW_EXT_pixel_transform) GLEW_EXT_pixel_transform = !_glewInit_GL_EXT_pixel_transform(); +#endif /* GL_EXT_pixel_transform */ +#ifdef GL_EXT_point_parameters + if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(); +#endif /* GL_EXT_point_parameters */ +#ifdef GL_EXT_polygon_offset + if (glewExperimental || GLEW_EXT_polygon_offset) GLEW_EXT_polygon_offset = !_glewInit_GL_EXT_polygon_offset(); +#endif /* GL_EXT_polygon_offset */ +#ifdef GL_EXT_polygon_offset_clamp + if (glewExperimental || GLEW_EXT_polygon_offset_clamp) GLEW_EXT_polygon_offset_clamp = !_glewInit_GL_EXT_polygon_offset_clamp(); +#endif /* GL_EXT_polygon_offset_clamp */ +#ifdef GL_EXT_provoking_vertex + if (glewExperimental || GLEW_EXT_provoking_vertex) GLEW_EXT_provoking_vertex = !_glewInit_GL_EXT_provoking_vertex(); +#endif /* GL_EXT_provoking_vertex */ +#ifdef GL_EXT_raster_multisample + if (glewExperimental || GLEW_EXT_raster_multisample) GLEW_EXT_raster_multisample = !_glewInit_GL_EXT_raster_multisample(); +#endif /* GL_EXT_raster_multisample */ +#ifdef GL_EXT_scene_marker + if (glewExperimental || GLEW_EXT_scene_marker) GLEW_EXT_scene_marker = !_glewInit_GL_EXT_scene_marker(); +#endif /* GL_EXT_scene_marker */ +#ifdef GL_EXT_secondary_color + if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(); +#endif /* GL_EXT_secondary_color */ +#ifdef GL_EXT_semaphore + if (glewExperimental || GLEW_EXT_semaphore) GLEW_EXT_semaphore = !_glewInit_GL_EXT_semaphore(); +#endif /* GL_EXT_semaphore */ +#ifdef GL_EXT_semaphore_fd + if (glewExperimental || GLEW_EXT_semaphore_fd) GLEW_EXT_semaphore_fd = !_glewInit_GL_EXT_semaphore_fd(); +#endif /* GL_EXT_semaphore_fd */ +#ifdef GL_EXT_semaphore_win32 + if (glewExperimental || GLEW_EXT_semaphore_win32) GLEW_EXT_semaphore_win32 = !_glewInit_GL_EXT_semaphore_win32(); +#endif /* GL_EXT_semaphore_win32 */ +#ifdef GL_EXT_separate_shader_objects + if (glewExperimental || GLEW_EXT_separate_shader_objects) GLEW_EXT_separate_shader_objects = !_glewInit_GL_EXT_separate_shader_objects(); +#endif /* GL_EXT_separate_shader_objects */ +#ifdef GL_EXT_shader_image_load_store + if (glewExperimental || GLEW_EXT_shader_image_load_store) GLEW_EXT_shader_image_load_store = !_glewInit_GL_EXT_shader_image_load_store(); +#endif /* GL_EXT_shader_image_load_store */ +#ifdef GL_EXT_shader_pixel_local_storage2 + if (glewExperimental || GLEW_EXT_shader_pixel_local_storage2) GLEW_EXT_shader_pixel_local_storage2 = !_glewInit_GL_EXT_shader_pixel_local_storage2(); +#endif /* GL_EXT_shader_pixel_local_storage2 */ +#ifdef GL_EXT_sparse_texture + if (glewExperimental || GLEW_EXT_sparse_texture) GLEW_EXT_sparse_texture = !_glewInit_GL_EXT_sparse_texture(); +#endif /* GL_EXT_sparse_texture */ +#ifdef GL_EXT_stencil_two_side + if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(); +#endif /* GL_EXT_stencil_two_side */ +#ifdef GL_EXT_subtexture + if (glewExperimental || GLEW_EXT_subtexture) GLEW_EXT_subtexture = !_glewInit_GL_EXT_subtexture(); +#endif /* GL_EXT_subtexture */ +#ifdef GL_EXT_texture3D + if (glewExperimental || GLEW_EXT_texture3D) GLEW_EXT_texture3D = !_glewInit_GL_EXT_texture3D(); +#endif /* GL_EXT_texture3D */ +#ifdef GL_EXT_texture_array + if (glewExperimental || GLEW_EXT_texture_array) GLEW_EXT_texture_array = !_glewInit_GL_EXT_texture_array(); +#endif /* GL_EXT_texture_array */ +#ifdef GL_EXT_texture_buffer_object + if (glewExperimental || GLEW_EXT_texture_buffer_object) GLEW_EXT_texture_buffer_object = !_glewInit_GL_EXT_texture_buffer_object(); +#endif /* GL_EXT_texture_buffer_object */ +#ifdef GL_EXT_texture_integer + if (glewExperimental || GLEW_EXT_texture_integer) GLEW_EXT_texture_integer = !_glewInit_GL_EXT_texture_integer(); +#endif /* GL_EXT_texture_integer */ +#ifdef GL_EXT_texture_object + if (glewExperimental || GLEW_EXT_texture_object) GLEW_EXT_texture_object = !_glewInit_GL_EXT_texture_object(); +#endif /* GL_EXT_texture_object */ +#ifdef GL_EXT_texture_perturb_normal + if (glewExperimental || GLEW_EXT_texture_perturb_normal) GLEW_EXT_texture_perturb_normal = !_glewInit_GL_EXT_texture_perturb_normal(); +#endif /* GL_EXT_texture_perturb_normal */ +#ifdef GL_EXT_texture_storage + if (glewExperimental || GLEW_EXT_texture_storage) GLEW_EXT_texture_storage = !_glewInit_GL_EXT_texture_storage(); +#endif /* GL_EXT_texture_storage */ +#ifdef GL_EXT_texture_view + if (glewExperimental || GLEW_EXT_texture_view) GLEW_EXT_texture_view = !_glewInit_GL_EXT_texture_view(); +#endif /* GL_EXT_texture_view */ +#ifdef GL_EXT_timer_query + if (glewExperimental || GLEW_EXT_timer_query) GLEW_EXT_timer_query = !_glewInit_GL_EXT_timer_query(); +#endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + if (glewExperimental || GLEW_EXT_transform_feedback) GLEW_EXT_transform_feedback = !_glewInit_GL_EXT_transform_feedback(); +#endif /* GL_EXT_transform_feedback */ +#ifdef GL_EXT_vertex_array + if (glewExperimental || GLEW_EXT_vertex_array) GLEW_EXT_vertex_array = !_glewInit_GL_EXT_vertex_array(); +#endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_setXXX + if (glewExperimental || GLEW_EXT_vertex_array_setXXX) GLEW_EXT_vertex_array_setXXX = !_glewInit_GL_EXT_vertex_array_setXXX(); +#endif /* GL_EXT_vertex_array_setXXX */ +#ifdef GL_EXT_vertex_attrib_64bit + if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) GLEW_EXT_vertex_attrib_64bit = !_glewInit_GL_EXT_vertex_attrib_64bit(); +#endif /* GL_EXT_vertex_attrib_64bit */ +#ifdef GL_EXT_vertex_shader + if (glewExperimental || GLEW_EXT_vertex_shader) GLEW_EXT_vertex_shader = !_glewInit_GL_EXT_vertex_shader(); +#endif /* GL_EXT_vertex_shader */ +#ifdef GL_EXT_vertex_weighting + if (glewExperimental || GLEW_EXT_vertex_weighting) GLEW_EXT_vertex_weighting = !_glewInit_GL_EXT_vertex_weighting(); +#endif /* GL_EXT_vertex_weighting */ +#ifdef GL_EXT_win32_keyed_mutex + if (glewExperimental || GLEW_EXT_win32_keyed_mutex) GLEW_EXT_win32_keyed_mutex = !_glewInit_GL_EXT_win32_keyed_mutex(); +#endif /* GL_EXT_win32_keyed_mutex */ +#ifdef GL_EXT_window_rectangles + if (glewExperimental || GLEW_EXT_window_rectangles) GLEW_EXT_window_rectangles = !_glewInit_GL_EXT_window_rectangles(); +#endif /* GL_EXT_window_rectangles */ +#ifdef GL_EXT_x11_sync_object + if (glewExperimental || GLEW_EXT_x11_sync_object) GLEW_EXT_x11_sync_object = !_glewInit_GL_EXT_x11_sync_object(); +#endif /* GL_EXT_x11_sync_object */ +#ifdef GL_GREMEDY_frame_terminator + if (glewExperimental || GLEW_GREMEDY_frame_terminator) GLEW_GREMEDY_frame_terminator = !_glewInit_GL_GREMEDY_frame_terminator(); +#endif /* GL_GREMEDY_frame_terminator */ +#ifdef GL_GREMEDY_string_marker + if (glewExperimental || GLEW_GREMEDY_string_marker) GLEW_GREMEDY_string_marker = !_glewInit_GL_GREMEDY_string_marker(); +#endif /* GL_GREMEDY_string_marker */ +#ifdef GL_HP_image_transform + if (glewExperimental || GLEW_HP_image_transform) GLEW_HP_image_transform = !_glewInit_GL_HP_image_transform(); +#endif /* GL_HP_image_transform */ +#ifdef GL_IBM_multimode_draw_arrays + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) GLEW_IBM_multimode_draw_arrays = !_glewInit_GL_IBM_multimode_draw_arrays(); +#endif /* GL_IBM_multimode_draw_arrays */ +#ifdef GL_IBM_vertex_array_lists + if (glewExperimental || GLEW_IBM_vertex_array_lists) GLEW_IBM_vertex_array_lists = !_glewInit_GL_IBM_vertex_array_lists(); +#endif /* GL_IBM_vertex_array_lists */ +#ifdef GL_INTEL_map_texture + if (glewExperimental || GLEW_INTEL_map_texture) GLEW_INTEL_map_texture = !_glewInit_GL_INTEL_map_texture(); +#endif /* GL_INTEL_map_texture */ +#ifdef GL_INTEL_parallel_arrays + if (glewExperimental || GLEW_INTEL_parallel_arrays) GLEW_INTEL_parallel_arrays = !_glewInit_GL_INTEL_parallel_arrays(); +#endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_performance_query + if (glewExperimental || GLEW_INTEL_performance_query) GLEW_INTEL_performance_query = !_glewInit_GL_INTEL_performance_query(); +#endif /* GL_INTEL_performance_query */ +#ifdef GL_INTEL_texture_scissor + if (glewExperimental || GLEW_INTEL_texture_scissor) GLEW_INTEL_texture_scissor = !_glewInit_GL_INTEL_texture_scissor(); +#endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KHR_blend_equation_advanced + if (glewExperimental || GLEW_KHR_blend_equation_advanced) GLEW_KHR_blend_equation_advanced = !_glewInit_GL_KHR_blend_equation_advanced(); +#endif /* GL_KHR_blend_equation_advanced */ +#ifdef GL_KHR_debug + if (glewExperimental || GLEW_KHR_debug) GLEW_KHR_debug = !_glewInit_GL_KHR_debug(); +#endif /* GL_KHR_debug */ +#ifdef GL_KHR_parallel_shader_compile + if (glewExperimental || GLEW_KHR_parallel_shader_compile) GLEW_KHR_parallel_shader_compile = !_glewInit_GL_KHR_parallel_shader_compile(); +#endif /* GL_KHR_parallel_shader_compile */ +#ifdef GL_KHR_robustness + if (glewExperimental || GLEW_KHR_robustness) GLEW_KHR_robustness = !_glewInit_GL_KHR_robustness(); +#endif /* GL_KHR_robustness */ +#ifdef GL_KTX_buffer_region + if (glewExperimental || GLEW_KTX_buffer_region) GLEW_KTX_buffer_region = !_glewInit_GL_KTX_buffer_region(); +#endif /* GL_KTX_buffer_region */ +#ifdef GL_MESA_resize_buffers + if (glewExperimental || GLEW_MESA_resize_buffers) GLEW_MESA_resize_buffers = !_glewInit_GL_MESA_resize_buffers(); +#endif /* GL_MESA_resize_buffers */ +#ifdef GL_MESA_window_pos + if (glewExperimental || GLEW_MESA_window_pos) GLEW_MESA_window_pos = !_glewInit_GL_MESA_window_pos(); +#endif /* GL_MESA_window_pos */ +#ifdef GL_NVX_conditional_render + if (glewExperimental || GLEW_NVX_conditional_render) GLEW_NVX_conditional_render = !_glewInit_GL_NVX_conditional_render(); +#endif /* GL_NVX_conditional_render */ +#ifdef GL_NVX_linked_gpu_multicast + if (glewExperimental || GLEW_NVX_linked_gpu_multicast) GLEW_NVX_linked_gpu_multicast = !_glewInit_GL_NVX_linked_gpu_multicast(); +#endif /* GL_NVX_linked_gpu_multicast */ +#ifdef GL_NV_3dvision_settings + if (glewExperimental || GLEW_NV_3dvision_settings) GLEW_NV_3dvision_settings = !_glewInit_GL_NV_3dvision_settings(); +#endif /* GL_NV_3dvision_settings */ +#ifdef GL_NV_bindless_multi_draw_indirect + if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect) GLEW_NV_bindless_multi_draw_indirect = !_glewInit_GL_NV_bindless_multi_draw_indirect(); +#endif /* GL_NV_bindless_multi_draw_indirect */ +#ifdef GL_NV_bindless_multi_draw_indirect_count + if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect_count) GLEW_NV_bindless_multi_draw_indirect_count = !_glewInit_GL_NV_bindless_multi_draw_indirect_count(); +#endif /* GL_NV_bindless_multi_draw_indirect_count */ +#ifdef GL_NV_bindless_texture + if (glewExperimental || GLEW_NV_bindless_texture) GLEW_NV_bindless_texture = !_glewInit_GL_NV_bindless_texture(); +#endif /* GL_NV_bindless_texture */ +#ifdef GL_NV_blend_equation_advanced + if (glewExperimental || GLEW_NV_blend_equation_advanced) GLEW_NV_blend_equation_advanced = !_glewInit_GL_NV_blend_equation_advanced(); +#endif /* GL_NV_blend_equation_advanced */ +#ifdef GL_NV_clip_space_w_scaling + if (glewExperimental || GLEW_NV_clip_space_w_scaling) GLEW_NV_clip_space_w_scaling = !_glewInit_GL_NV_clip_space_w_scaling(); +#endif /* GL_NV_clip_space_w_scaling */ +#ifdef GL_NV_command_list + if (glewExperimental || GLEW_NV_command_list) GLEW_NV_command_list = !_glewInit_GL_NV_command_list(); +#endif /* GL_NV_command_list */ +#ifdef GL_NV_conditional_render + if (glewExperimental || GLEW_NV_conditional_render) GLEW_NV_conditional_render = !_glewInit_GL_NV_conditional_render(); +#endif /* GL_NV_conditional_render */ +#ifdef GL_NV_conservative_raster + if (glewExperimental || GLEW_NV_conservative_raster) GLEW_NV_conservative_raster = !_glewInit_GL_NV_conservative_raster(); +#endif /* GL_NV_conservative_raster */ +#ifdef GL_NV_conservative_raster_dilate + if (glewExperimental || GLEW_NV_conservative_raster_dilate) GLEW_NV_conservative_raster_dilate = !_glewInit_GL_NV_conservative_raster_dilate(); +#endif /* GL_NV_conservative_raster_dilate */ +#ifdef GL_NV_conservative_raster_pre_snap_triangles + if (glewExperimental || GLEW_NV_conservative_raster_pre_snap_triangles) GLEW_NV_conservative_raster_pre_snap_triangles = !_glewInit_GL_NV_conservative_raster_pre_snap_triangles(); +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ +#ifdef GL_NV_copy_buffer + if (glewExperimental || GLEW_NV_copy_buffer) GLEW_NV_copy_buffer = !_glewInit_GL_NV_copy_buffer(); +#endif /* GL_NV_copy_buffer */ +#ifdef GL_NV_copy_image + if (glewExperimental || GLEW_NV_copy_image) GLEW_NV_copy_image = !_glewInit_GL_NV_copy_image(); +#endif /* GL_NV_copy_image */ +#ifdef GL_NV_depth_buffer_float + if (glewExperimental || GLEW_NV_depth_buffer_float) GLEW_NV_depth_buffer_float = !_glewInit_GL_NV_depth_buffer_float(); +#endif /* GL_NV_depth_buffer_float */ +#ifdef GL_NV_draw_buffers + if (glewExperimental || GLEW_NV_draw_buffers) GLEW_NV_draw_buffers = !_glewInit_GL_NV_draw_buffers(); +#endif /* GL_NV_draw_buffers */ +#ifdef GL_NV_draw_instanced + if (glewExperimental || GLEW_NV_draw_instanced) GLEW_NV_draw_instanced = !_glewInit_GL_NV_draw_instanced(); +#endif /* GL_NV_draw_instanced */ +#ifdef GL_NV_draw_texture + if (glewExperimental || GLEW_NV_draw_texture) GLEW_NV_draw_texture = !_glewInit_GL_NV_draw_texture(); +#endif /* GL_NV_draw_texture */ +#ifdef GL_NV_draw_vulkan_image + if (glewExperimental || GLEW_NV_draw_vulkan_image) GLEW_NV_draw_vulkan_image = !_glewInit_GL_NV_draw_vulkan_image(); +#endif /* GL_NV_draw_vulkan_image */ +#ifdef GL_NV_evaluators + if (glewExperimental || GLEW_NV_evaluators) GLEW_NV_evaluators = !_glewInit_GL_NV_evaluators(); +#endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + if (glewExperimental || GLEW_NV_explicit_multisample) GLEW_NV_explicit_multisample = !_glewInit_GL_NV_explicit_multisample(); +#endif /* GL_NV_explicit_multisample */ +#ifdef GL_NV_fence + if (glewExperimental || GLEW_NV_fence) GLEW_NV_fence = !_glewInit_GL_NV_fence(); +#endif /* GL_NV_fence */ +#ifdef GL_NV_fragment_coverage_to_color + if (glewExperimental || GLEW_NV_fragment_coverage_to_color) GLEW_NV_fragment_coverage_to_color = !_glewInit_GL_NV_fragment_coverage_to_color(); +#endif /* GL_NV_fragment_coverage_to_color */ +#ifdef GL_NV_fragment_program + if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(); +#endif /* GL_NV_fragment_program */ +#ifdef GL_NV_framebuffer_blit + if (glewExperimental || GLEW_NV_framebuffer_blit) GLEW_NV_framebuffer_blit = !_glewInit_GL_NV_framebuffer_blit(); +#endif /* GL_NV_framebuffer_blit */ +#ifdef GL_NV_framebuffer_multisample + if (glewExperimental || GLEW_NV_framebuffer_multisample) GLEW_NV_framebuffer_multisample = !_glewInit_GL_NV_framebuffer_multisample(); +#endif /* GL_NV_framebuffer_multisample */ +#ifdef GL_NV_framebuffer_multisample_coverage + if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) GLEW_NV_framebuffer_multisample_coverage = !_glewInit_GL_NV_framebuffer_multisample_coverage(); +#endif /* GL_NV_framebuffer_multisample_coverage */ +#ifdef GL_NV_geometry_program4 + if (glewExperimental || GLEW_NV_geometry_program4) GLEW_NV_geometry_program4 = !_glewInit_GL_NV_geometry_program4(); +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_gpu_multicast + if (glewExperimental || GLEW_NV_gpu_multicast) GLEW_NV_gpu_multicast = !_glewInit_GL_NV_gpu_multicast(); +#endif /* GL_NV_gpu_multicast */ +#ifdef GL_NV_gpu_program4 + if (glewExperimental || GLEW_NV_gpu_program4) GLEW_NV_gpu_program4 = !_glewInit_GL_NV_gpu_program4(); +#endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_shader5 + if (glewExperimental || GLEW_NV_gpu_shader5) GLEW_NV_gpu_shader5 = !_glewInit_GL_NV_gpu_shader5(); +#endif /* GL_NV_gpu_shader5 */ +#ifdef GL_NV_half_float + if (glewExperimental || GLEW_NV_half_float) GLEW_NV_half_float = !_glewInit_GL_NV_half_float(); +#endif /* GL_NV_half_float */ +#ifdef GL_NV_instanced_arrays + if (glewExperimental || GLEW_NV_instanced_arrays) GLEW_NV_instanced_arrays = !_glewInit_GL_NV_instanced_arrays(); +#endif /* GL_NV_instanced_arrays */ +#ifdef GL_NV_internalformat_sample_query + if (glewExperimental || GLEW_NV_internalformat_sample_query) GLEW_NV_internalformat_sample_query = !_glewInit_GL_NV_internalformat_sample_query(); +#endif /* GL_NV_internalformat_sample_query */ +#ifdef GL_NV_non_square_matrices + if (glewExperimental || GLEW_NV_non_square_matrices) GLEW_NV_non_square_matrices = !_glewInit_GL_NV_non_square_matrices(); +#endif /* GL_NV_non_square_matrices */ +#ifdef GL_NV_occlusion_query + if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(); +#endif /* GL_NV_occlusion_query */ +#ifdef GL_NV_parameter_buffer_object + if (glewExperimental || GLEW_NV_parameter_buffer_object) GLEW_NV_parameter_buffer_object = !_glewInit_GL_NV_parameter_buffer_object(); +#endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_path_rendering + if (glewExperimental || GLEW_NV_path_rendering) GLEW_NV_path_rendering = !_glewInit_GL_NV_path_rendering(); +#endif /* GL_NV_path_rendering */ +#ifdef GL_NV_pixel_data_range + if (glewExperimental || GLEW_NV_pixel_data_range) GLEW_NV_pixel_data_range = !_glewInit_GL_NV_pixel_data_range(); +#endif /* GL_NV_pixel_data_range */ +#ifdef GL_NV_point_sprite + if (glewExperimental || GLEW_NV_point_sprite) GLEW_NV_point_sprite = !_glewInit_GL_NV_point_sprite(); +#endif /* GL_NV_point_sprite */ +#ifdef GL_NV_polygon_mode + if (glewExperimental || GLEW_NV_polygon_mode) GLEW_NV_polygon_mode = !_glewInit_GL_NV_polygon_mode(); +#endif /* GL_NV_polygon_mode */ +#ifdef GL_NV_present_video + if (glewExperimental || GLEW_NV_present_video) GLEW_NV_present_video = !_glewInit_GL_NV_present_video(); +#endif /* GL_NV_present_video */ +#ifdef GL_NV_primitive_restart + if (glewExperimental || GLEW_NV_primitive_restart) GLEW_NV_primitive_restart = !_glewInit_GL_NV_primitive_restart(); +#endif /* GL_NV_primitive_restart */ +#ifdef GL_NV_register_combiners + if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(); +#endif /* GL_NV_register_combiners */ +#ifdef GL_NV_register_combiners2 + if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(); +#endif /* GL_NV_register_combiners2 */ +#ifdef GL_NV_sample_locations + if (glewExperimental || GLEW_NV_sample_locations) GLEW_NV_sample_locations = !_glewInit_GL_NV_sample_locations(); +#endif /* GL_NV_sample_locations */ +#ifdef GL_NV_shader_buffer_load + if (glewExperimental || GLEW_NV_shader_buffer_load) GLEW_NV_shader_buffer_load = !_glewInit_GL_NV_shader_buffer_load(); +#endif /* GL_NV_shader_buffer_load */ +#ifdef GL_NV_texture_array + if (glewExperimental || GLEW_NV_texture_array) GLEW_NV_texture_array = !_glewInit_GL_NV_texture_array(); +#endif /* GL_NV_texture_array */ +#ifdef GL_NV_texture_barrier + if (glewExperimental || GLEW_NV_texture_barrier) GLEW_NV_texture_barrier = !_glewInit_GL_NV_texture_barrier(); +#endif /* GL_NV_texture_barrier */ +#ifdef GL_NV_texture_multisample + if (glewExperimental || GLEW_NV_texture_multisample) GLEW_NV_texture_multisample = !_glewInit_GL_NV_texture_multisample(); +#endif /* GL_NV_texture_multisample */ +#ifdef GL_NV_transform_feedback + if (glewExperimental || GLEW_NV_transform_feedback) GLEW_NV_transform_feedback = !_glewInit_GL_NV_transform_feedback(); +#endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + if (glewExperimental || GLEW_NV_transform_feedback2) GLEW_NV_transform_feedback2 = !_glewInit_GL_NV_transform_feedback2(); +#endif /* GL_NV_transform_feedback2 */ +#ifdef GL_NV_vdpau_interop + if (glewExperimental || GLEW_NV_vdpau_interop) GLEW_NV_vdpau_interop = !_glewInit_GL_NV_vdpau_interop(); +#endif /* GL_NV_vdpau_interop */ +#ifdef GL_NV_vertex_array_range + if (glewExperimental || GLEW_NV_vertex_array_range) GLEW_NV_vertex_array_range = !_glewInit_GL_NV_vertex_array_range(); +#endif /* GL_NV_vertex_array_range */ +#ifdef GL_NV_vertex_attrib_integer_64bit + if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) GLEW_NV_vertex_attrib_integer_64bit = !_glewInit_GL_NV_vertex_attrib_integer_64bit(); +#endif /* GL_NV_vertex_attrib_integer_64bit */ +#ifdef GL_NV_vertex_buffer_unified_memory + if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) GLEW_NV_vertex_buffer_unified_memory = !_glewInit_GL_NV_vertex_buffer_unified_memory(); +#endif /* GL_NV_vertex_buffer_unified_memory */ +#ifdef GL_NV_vertex_program + if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(); +#endif /* GL_NV_vertex_program */ +#ifdef GL_NV_video_capture + if (glewExperimental || GLEW_NV_video_capture) GLEW_NV_video_capture = !_glewInit_GL_NV_video_capture(); +#endif /* GL_NV_video_capture */ +#ifdef GL_NV_viewport_array + if (glewExperimental || GLEW_NV_viewport_array) GLEW_NV_viewport_array = !_glewInit_GL_NV_viewport_array(); +#endif /* GL_NV_viewport_array */ +#ifdef GL_NV_viewport_swizzle + if (glewExperimental || GLEW_NV_viewport_swizzle) GLEW_NV_viewport_swizzle = !_glewInit_GL_NV_viewport_swizzle(); +#endif /* GL_NV_viewport_swizzle */ +#ifdef GL_OVR_multiview + if (glewExperimental || GLEW_OVR_multiview) GLEW_OVR_multiview = !_glewInit_GL_OVR_multiview(); +#endif /* GL_OVR_multiview */ +#ifdef GL_OVR_multiview_multisampled_render_to_texture + if (glewExperimental || GLEW_OVR_multiview_multisampled_render_to_texture) GLEW_OVR_multiview_multisampled_render_to_texture = !_glewInit_GL_OVR_multiview_multisampled_render_to_texture(); +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ +#ifdef GL_QCOM_alpha_test + if (glewExperimental || GLEW_QCOM_alpha_test) GLEW_QCOM_alpha_test = !_glewInit_GL_QCOM_alpha_test(); +#endif /* GL_QCOM_alpha_test */ +#ifdef GL_QCOM_driver_control + if (glewExperimental || GLEW_QCOM_driver_control) GLEW_QCOM_driver_control = !_glewInit_GL_QCOM_driver_control(); +#endif /* GL_QCOM_driver_control */ +#ifdef GL_QCOM_extended_get + if (glewExperimental || GLEW_QCOM_extended_get) GLEW_QCOM_extended_get = !_glewInit_GL_QCOM_extended_get(); +#endif /* GL_QCOM_extended_get */ +#ifdef GL_QCOM_extended_get2 + if (glewExperimental || GLEW_QCOM_extended_get2) GLEW_QCOM_extended_get2 = !_glewInit_GL_QCOM_extended_get2(); +#endif /* GL_QCOM_extended_get2 */ +#ifdef GL_QCOM_framebuffer_foveated + if (glewExperimental || GLEW_QCOM_framebuffer_foveated) GLEW_QCOM_framebuffer_foveated = !_glewInit_GL_QCOM_framebuffer_foveated(); +#endif /* GL_QCOM_framebuffer_foveated */ +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + if (glewExperimental || GLEW_QCOM_shader_framebuffer_fetch_noncoherent) GLEW_QCOM_shader_framebuffer_fetch_noncoherent = !_glewInit_GL_QCOM_shader_framebuffer_fetch_noncoherent(); +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ +#ifdef GL_QCOM_tiled_rendering + if (glewExperimental || GLEW_QCOM_tiled_rendering) GLEW_QCOM_tiled_rendering = !_glewInit_GL_QCOM_tiled_rendering(); +#endif /* GL_QCOM_tiled_rendering */ +#ifdef GL_REGAL_ES1_0_compatibility + if (glewExperimental || GLEW_REGAL_ES1_0_compatibility) GLEW_REGAL_ES1_0_compatibility = !_glewInit_GL_REGAL_ES1_0_compatibility(); +#endif /* GL_REGAL_ES1_0_compatibility */ +#ifdef GL_REGAL_ES1_1_compatibility + if (glewExperimental || GLEW_REGAL_ES1_1_compatibility) GLEW_REGAL_ES1_1_compatibility = !_glewInit_GL_REGAL_ES1_1_compatibility(); +#endif /* GL_REGAL_ES1_1_compatibility */ +#ifdef GL_REGAL_error_string + if (glewExperimental || GLEW_REGAL_error_string) GLEW_REGAL_error_string = !_glewInit_GL_REGAL_error_string(); +#endif /* GL_REGAL_error_string */ +#ifdef GL_REGAL_extension_query + if (glewExperimental || GLEW_REGAL_extension_query) GLEW_REGAL_extension_query = !_glewInit_GL_REGAL_extension_query(); +#endif /* GL_REGAL_extension_query */ +#ifdef GL_REGAL_log + if (glewExperimental || GLEW_REGAL_log) GLEW_REGAL_log = !_glewInit_GL_REGAL_log(); +#endif /* GL_REGAL_log */ +#ifdef GL_REGAL_proc_address + if (glewExperimental || GLEW_REGAL_proc_address) GLEW_REGAL_proc_address = !_glewInit_GL_REGAL_proc_address(); +#endif /* GL_REGAL_proc_address */ +#ifdef GL_SGIS_detail_texture + if (glewExperimental || GLEW_SGIS_detail_texture) GLEW_SGIS_detail_texture = !_glewInit_GL_SGIS_detail_texture(); +#endif /* GL_SGIS_detail_texture */ +#ifdef GL_SGIS_fog_function + if (glewExperimental || GLEW_SGIS_fog_function) GLEW_SGIS_fog_function = !_glewInit_GL_SGIS_fog_function(); +#endif /* GL_SGIS_fog_function */ +#ifdef GL_SGIS_multisample + if (glewExperimental || GLEW_SGIS_multisample) GLEW_SGIS_multisample = !_glewInit_GL_SGIS_multisample(); +#endif /* GL_SGIS_multisample */ +#ifdef GL_SGIS_multitexture + if (glewExperimental || GLEW_SGIS_multitexture) GLEW_SGIS_multitexture = !_glewInit_GL_SGIS_multitexture(); +#endif /* GL_SGIS_multitexture */ +#ifdef GL_SGIS_shared_multisample + if (glewExperimental || GLEW_SGIS_shared_multisample) GLEW_SGIS_shared_multisample = !_glewInit_GL_SGIS_shared_multisample(); +#endif /* GL_SGIS_shared_multisample */ +#ifdef GL_SGIS_sharpen_texture + if (glewExperimental || GLEW_SGIS_sharpen_texture) GLEW_SGIS_sharpen_texture = !_glewInit_GL_SGIS_sharpen_texture(); +#endif /* GL_SGIS_sharpen_texture */ +#ifdef GL_SGIS_texture4D + if (glewExperimental || GLEW_SGIS_texture4D) GLEW_SGIS_texture4D = !_glewInit_GL_SGIS_texture4D(); +#endif /* GL_SGIS_texture4D */ +#ifdef GL_SGIS_texture_filter4 + if (glewExperimental || GLEW_SGIS_texture_filter4) GLEW_SGIS_texture_filter4 = !_glewInit_GL_SGIS_texture_filter4(); +#endif /* GL_SGIS_texture_filter4 */ +#ifdef GL_SGIX_async + if (glewExperimental || GLEW_SGIX_async) GLEW_SGIX_async = !_glewInit_GL_SGIX_async(); +#endif /* GL_SGIX_async */ +#ifdef GL_SGIX_datapipe + if (glewExperimental || GLEW_SGIX_datapipe) GLEW_SGIX_datapipe = !_glewInit_GL_SGIX_datapipe(); +#endif /* GL_SGIX_datapipe */ +#ifdef GL_SGIX_flush_raster + if (glewExperimental || GLEW_SGIX_flush_raster) GLEW_SGIX_flush_raster = !_glewInit_GL_SGIX_flush_raster(); +#endif /* GL_SGIX_flush_raster */ +#ifdef GL_SGIX_fog_layers + if (glewExperimental || GLEW_SGIX_fog_layers) GLEW_SGIX_fog_layers = !_glewInit_GL_SGIX_fog_layers(); +#endif /* GL_SGIX_fog_layers */ +#ifdef GL_SGIX_fog_texture + if (glewExperimental || GLEW_SGIX_fog_texture) GLEW_SGIX_fog_texture = !_glewInit_GL_SGIX_fog_texture(); +#endif /* GL_SGIX_fog_texture */ +#ifdef GL_SGIX_fragment_specular_lighting + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) GLEW_SGIX_fragment_specular_lighting = !_glewInit_GL_SGIX_fragment_specular_lighting(); +#endif /* GL_SGIX_fragment_specular_lighting */ +#ifdef GL_SGIX_framezoom + if (glewExperimental || GLEW_SGIX_framezoom) GLEW_SGIX_framezoom = !_glewInit_GL_SGIX_framezoom(); +#endif /* GL_SGIX_framezoom */ +#ifdef GL_SGIX_igloo_interface + if (glewExperimental || GLEW_SGIX_igloo_interface) GLEW_SGIX_igloo_interface = !_glewInit_GL_SGIX_igloo_interface(); +#endif /* GL_SGIX_igloo_interface */ +#ifdef GL_SGIX_mpeg1 + if (glewExperimental || GLEW_SGIX_mpeg1) GLEW_SGIX_mpeg1 = !_glewInit_GL_SGIX_mpeg1(); +#endif /* GL_SGIX_mpeg1 */ +#ifdef GL_SGIX_nonlinear_lighting_pervertex + if (glewExperimental || GLEW_SGIX_nonlinear_lighting_pervertex) GLEW_SGIX_nonlinear_lighting_pervertex = !_glewInit_GL_SGIX_nonlinear_lighting_pervertex(); +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ +#ifdef GL_SGIX_pixel_texture + if (glewExperimental || GLEW_SGIX_pixel_texture) GLEW_SGIX_pixel_texture = !_glewInit_GL_SGIX_pixel_texture(); +#endif /* GL_SGIX_pixel_texture */ +#ifdef GL_SGIX_polynomial_ffd + if (glewExperimental || GLEW_SGIX_polynomial_ffd) GLEW_SGIX_polynomial_ffd = !_glewInit_GL_SGIX_polynomial_ffd(); +#endif /* GL_SGIX_polynomial_ffd */ +#ifdef GL_SGIX_quad_mesh + if (glewExperimental || GLEW_SGIX_quad_mesh) GLEW_SGIX_quad_mesh = !_glewInit_GL_SGIX_quad_mesh(); +#endif /* GL_SGIX_quad_mesh */ +#ifdef GL_SGIX_reference_plane + if (glewExperimental || GLEW_SGIX_reference_plane) GLEW_SGIX_reference_plane = !_glewInit_GL_SGIX_reference_plane(); +#endif /* GL_SGIX_reference_plane */ +#ifdef GL_SGIX_sprite + if (glewExperimental || GLEW_SGIX_sprite) GLEW_SGIX_sprite = !_glewInit_GL_SGIX_sprite(); +#endif /* GL_SGIX_sprite */ +#ifdef GL_SGIX_tag_sample_buffer + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) GLEW_SGIX_tag_sample_buffer = !_glewInit_GL_SGIX_tag_sample_buffer(); +#endif /* GL_SGIX_tag_sample_buffer */ +#ifdef GL_SGIX_vector_ops + if (glewExperimental || GLEW_SGIX_vector_ops) GLEW_SGIX_vector_ops = !_glewInit_GL_SGIX_vector_ops(); +#endif /* GL_SGIX_vector_ops */ +#ifdef GL_SGIX_vertex_array_object + if (glewExperimental || GLEW_SGIX_vertex_array_object) GLEW_SGIX_vertex_array_object = !_glewInit_GL_SGIX_vertex_array_object(); +#endif /* GL_SGIX_vertex_array_object */ +#ifdef GL_SGI_color_table + if (glewExperimental || GLEW_SGI_color_table) GLEW_SGI_color_table = !_glewInit_GL_SGI_color_table(); +#endif /* GL_SGI_color_table */ +#ifdef GL_SGI_fft + if (glewExperimental || GLEW_SGI_fft) GLEW_SGI_fft = !_glewInit_GL_SGI_fft(); +#endif /* GL_SGI_fft */ +#ifdef GL_SUNX_constant_data + if (glewExperimental || GLEW_SUNX_constant_data) GLEW_SUNX_constant_data = !_glewInit_GL_SUNX_constant_data(); +#endif /* GL_SUNX_constant_data */ +#ifdef GL_SUN_global_alpha + if (glewExperimental || GLEW_SUN_global_alpha) GLEW_SUN_global_alpha = !_glewInit_GL_SUN_global_alpha(); +#endif /* GL_SUN_global_alpha */ +#ifdef GL_SUN_read_video_pixels + if (glewExperimental || GLEW_SUN_read_video_pixels) GLEW_SUN_read_video_pixels = !_glewInit_GL_SUN_read_video_pixels(); +#endif /* GL_SUN_read_video_pixels */ +#ifdef GL_SUN_triangle_list + if (glewExperimental || GLEW_SUN_triangle_list) GLEW_SUN_triangle_list = !_glewInit_GL_SUN_triangle_list(); +#endif /* GL_SUN_triangle_list */ +#ifdef GL_SUN_vertex + if (glewExperimental || GLEW_SUN_vertex) GLEW_SUN_vertex = !_glewInit_GL_SUN_vertex(); +#endif /* GL_SUN_vertex */ +#ifdef GL_WIN_swap_hint + if (glewExperimental || GLEW_WIN_swap_hint) GLEW_WIN_swap_hint = !_glewInit_GL_WIN_swap_hint(); +#endif /* GL_WIN_swap_hint */ +#ifdef GL_NV_fragment_program4 + GLEW_NV_fragment_program4 = GLEW_NV_gpu_program4; +#endif /* GL_NV_fragment_program4 */ +#ifdef GL_NV_geometry_program4 + GLEW_NV_geometry_program4 = GLEW_NV_gpu_program4; +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_tessellation_program5 + GLEW_NV_tessellation_program5 = GLEW_NV_gpu_program5; +#endif /* GL_NV_tessellation_program5 */ +#ifdef GL_NV_vertex_program4 + GLEW_NV_vertex_program4 = GLEW_NV_gpu_program4; +#endif /* GL_NV_vertex_program4 */ + + return GLEW_OK; +} + + +#if defined(GLEW_OSMESA) + +#elif defined(GLEW_EGL) + +PFNEGLCHOOSECONFIGPROC __eglewChooseConfig = NULL; +PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers = NULL; +PFNEGLCREATECONTEXTPROC __eglewCreateContext = NULL; +PFNEGLCREATEPBUFFERSURFACEPROC __eglewCreatePbufferSurface = NULL; +PFNEGLCREATEPIXMAPSURFACEPROC __eglewCreatePixmapSurface = NULL; +PFNEGLCREATEWINDOWSURFACEPROC __eglewCreateWindowSurface = NULL; +PFNEGLDESTROYCONTEXTPROC __eglewDestroyContext = NULL; +PFNEGLDESTROYSURFACEPROC __eglewDestroySurface = NULL; +PFNEGLGETCONFIGATTRIBPROC __eglewGetConfigAttrib = NULL; +PFNEGLGETCONFIGSPROC __eglewGetConfigs = NULL; +PFNEGLGETCURRENTDISPLAYPROC __eglewGetCurrentDisplay = NULL; +PFNEGLGETCURRENTSURFACEPROC __eglewGetCurrentSurface = NULL; +PFNEGLGETDISPLAYPROC __eglewGetDisplay = NULL; +PFNEGLGETERRORPROC __eglewGetError = NULL; +PFNEGLINITIALIZEPROC __eglewInitialize = NULL; +PFNEGLMAKECURRENTPROC __eglewMakeCurrent = NULL; +PFNEGLQUERYCONTEXTPROC __eglewQueryContext = NULL; +PFNEGLQUERYSTRINGPROC __eglewQueryString = NULL; +PFNEGLQUERYSURFACEPROC __eglewQuerySurface = NULL; +PFNEGLSWAPBUFFERSPROC __eglewSwapBuffers = NULL; +PFNEGLTERMINATEPROC __eglewTerminate = NULL; +PFNEGLWAITGLPROC __eglewWaitGL = NULL; +PFNEGLWAITNATIVEPROC __eglewWaitNative = NULL; + +PFNEGLBINDTEXIMAGEPROC __eglewBindTexImage = NULL; +PFNEGLRELEASETEXIMAGEPROC __eglewReleaseTexImage = NULL; +PFNEGLSURFACEATTRIBPROC __eglewSurfaceAttrib = NULL; +PFNEGLSWAPINTERVALPROC __eglewSwapInterval = NULL; + +PFNEGLBINDAPIPROC __eglewBindAPI = NULL; +PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC __eglewCreatePbufferFromClientBuffer = NULL; +PFNEGLQUERYAPIPROC __eglewQueryAPI = NULL; +PFNEGLRELEASETHREADPROC __eglewReleaseThread = NULL; +PFNEGLWAITCLIENTPROC __eglewWaitClient = NULL; + +PFNEGLGETCURRENTCONTEXTPROC __eglewGetCurrentContext = NULL; + +PFNEGLCLIENTWAITSYNCPROC __eglewClientWaitSync = NULL; +PFNEGLCREATEIMAGEPROC __eglewCreateImage = NULL; +PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC __eglewCreatePlatformPixmapSurface = NULL; +PFNEGLCREATEPLATFORMWINDOWSURFACEPROC __eglewCreatePlatformWindowSurface = NULL; +PFNEGLCREATESYNCPROC __eglewCreateSync = NULL; +PFNEGLDESTROYIMAGEPROC __eglewDestroyImage = NULL; +PFNEGLDESTROYSYNCPROC __eglewDestroySync = NULL; +PFNEGLGETPLATFORMDISPLAYPROC __eglewGetPlatformDisplay = NULL; +PFNEGLGETSYNCATTRIBPROC __eglewGetSyncAttrib = NULL; +PFNEGLWAITSYNCPROC __eglewWaitSync = NULL; + +PFNEGLSETBLOBCACHEFUNCSANDROIDPROC __eglewSetBlobCacheFuncsANDROID = NULL; + +PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC __eglewCreateNativeClientBufferANDROID = NULL; + +PFNEGLDUPNATIVEFENCEFDANDROIDPROC __eglewDupNativeFenceFDANDROID = NULL; + +PFNEGLPRESENTATIONTIMEANDROIDPROC __eglewPresentationTimeANDROID = NULL; + +PFNEGLQUERYSURFACEPOINTERANGLEPROC __eglewQuerySurfacePointerANGLE = NULL; + +PFNEGLQUERYDEVICESEXTPROC __eglewQueryDevicesEXT = NULL; + +PFNEGLQUERYDEVICEATTRIBEXTPROC __eglewQueryDeviceAttribEXT = NULL; +PFNEGLQUERYDEVICESTRINGEXTPROC __eglewQueryDeviceStringEXT = NULL; +PFNEGLQUERYDISPLAYATTRIBEXTPROC __eglewQueryDisplayAttribEXT = NULL; + +PFNEGLQUERYDMABUFFORMATSEXTPROC __eglewQueryDmaBufFormatsEXT = NULL; +PFNEGLQUERYDMABUFMODIFIERSEXTPROC __eglewQueryDmaBufModifiersEXT = NULL; + +PFNEGLGETOUTPUTLAYERSEXTPROC __eglewGetOutputLayersEXT = NULL; +PFNEGLGETOUTPUTPORTSEXTPROC __eglewGetOutputPortsEXT = NULL; +PFNEGLOUTPUTLAYERATTRIBEXTPROC __eglewOutputLayerAttribEXT = NULL; +PFNEGLOUTPUTPORTATTRIBEXTPROC __eglewOutputPortAttribEXT = NULL; +PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC __eglewQueryOutputLayerAttribEXT = NULL; +PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC __eglewQueryOutputLayerStringEXT = NULL; +PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC __eglewQueryOutputPortAttribEXT = NULL; +PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC __eglewQueryOutputPortStringEXT = NULL; + +PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC __eglewCreatePlatformPixmapSurfaceEXT = NULL; +PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC __eglewCreatePlatformWindowSurfaceEXT = NULL; +PFNEGLGETPLATFORMDISPLAYEXTPROC __eglewGetPlatformDisplayEXT = NULL; + +PFNEGLSTREAMCONSUMEROUTPUTEXTPROC __eglewStreamConsumerOutputEXT = NULL; + +PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC __eglewSwapBuffersWithDamageEXT = NULL; + +PFNEGLCREATEPIXMAPSURFACEHIPROC __eglewCreatePixmapSurfaceHI = NULL; + +PFNEGLCREATESYNC64KHRPROC __eglewCreateSync64KHR = NULL; + +PFNEGLDEBUGMESSAGECONTROLKHRPROC __eglewDebugMessageControlKHR = NULL; +PFNEGLLABELOBJECTKHRPROC __eglewLabelObjectKHR = NULL; +PFNEGLQUERYDEBUGKHRPROC __eglewQueryDebugKHR = NULL; + +PFNEGLCREATEIMAGEKHRPROC __eglewCreateImageKHR = NULL; +PFNEGLDESTROYIMAGEKHRPROC __eglewDestroyImageKHR = NULL; + +PFNEGLLOCKSURFACEKHRPROC __eglewLockSurfaceKHR = NULL; +PFNEGLUNLOCKSURFACEKHRPROC __eglewUnlockSurfaceKHR = NULL; + +PFNEGLQUERYSURFACE64KHRPROC __eglewQuerySurface64KHR = NULL; + +PFNEGLSETDAMAGEREGIONKHRPROC __eglewSetDamageRegionKHR = NULL; + +PFNEGLCLIENTWAITSYNCKHRPROC __eglewClientWaitSyncKHR = NULL; +PFNEGLCREATESYNCKHRPROC __eglewCreateSyncKHR = NULL; +PFNEGLDESTROYSYNCKHRPROC __eglewDestroySyncKHR = NULL; +PFNEGLGETSYNCATTRIBKHRPROC __eglewGetSyncAttribKHR = NULL; +PFNEGLSIGNALSYNCKHRPROC __eglewSignalSyncKHR = NULL; + +PFNEGLCREATESTREAMKHRPROC __eglewCreateStreamKHR = NULL; +PFNEGLDESTROYSTREAMKHRPROC __eglewDestroyStreamKHR = NULL; +PFNEGLQUERYSTREAMKHRPROC __eglewQueryStreamKHR = NULL; +PFNEGLQUERYSTREAMU64KHRPROC __eglewQueryStreamu64KHR = NULL; +PFNEGLSTREAMATTRIBKHRPROC __eglewStreamAttribKHR = NULL; + +PFNEGLCREATESTREAMATTRIBKHRPROC __eglewCreateStreamAttribKHR = NULL; +PFNEGLQUERYSTREAMATTRIBKHRPROC __eglewQueryStreamAttribKHR = NULL; +PFNEGLSETSTREAMATTRIBKHRPROC __eglewSetStreamAttribKHR = NULL; +PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC __eglewStreamConsumerAcquireAttribKHR = NULL; +PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC __eglewStreamConsumerReleaseAttribKHR = NULL; + +PFNEGLSTREAMCONSUMERACQUIREKHRPROC __eglewStreamConsumerAcquireKHR = NULL; +PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC __eglewStreamConsumerGLTextureExternalKHR = NULL; +PFNEGLSTREAMCONSUMERRELEASEKHRPROC __eglewStreamConsumerReleaseKHR = NULL; + +PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC __eglewCreateStreamFromFileDescriptorKHR = NULL; +PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC __eglewGetStreamFileDescriptorKHR = NULL; + +PFNEGLQUERYSTREAMTIMEKHRPROC __eglewQueryStreamTimeKHR = NULL; + +PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC __eglewCreateStreamProducerSurfaceKHR = NULL; + +PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC __eglewSwapBuffersWithDamageKHR = NULL; + +PFNEGLWAITSYNCKHRPROC __eglewWaitSyncKHR = NULL; + +PFNEGLCREATEDRMIMAGEMESAPROC __eglewCreateDRMImageMESA = NULL; +PFNEGLEXPORTDRMIMAGEMESAPROC __eglewExportDRMImageMESA = NULL; + +PFNEGLEXPORTDMABUFIMAGEMESAPROC __eglewExportDMABUFImageMESA = NULL; +PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC __eglewExportDMABUFImageQueryMESA = NULL; + +PFNEGLSWAPBUFFERSREGIONNOKPROC __eglewSwapBuffersRegionNOK = NULL; + +PFNEGLSWAPBUFFERSREGION2NOKPROC __eglewSwapBuffersRegion2NOK = NULL; + +PFNEGLQUERYNATIVEDISPLAYNVPROC __eglewQueryNativeDisplayNV = NULL; +PFNEGLQUERYNATIVEPIXMAPNVPROC __eglewQueryNativePixmapNV = NULL; +PFNEGLQUERYNATIVEWINDOWNVPROC __eglewQueryNativeWindowNV = NULL; + +PFNEGLPOSTSUBBUFFERNVPROC __eglewPostSubBufferNV = NULL; + +PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC __eglewStreamConsumerGLTextureExternalAttribsNV = NULL; + +PFNEGLQUERYDISPLAYATTRIBNVPROC __eglewQueryDisplayAttribNV = NULL; +PFNEGLQUERYSTREAMMETADATANVPROC __eglewQueryStreamMetadataNV = NULL; +PFNEGLSETSTREAMMETADATANVPROC __eglewSetStreamMetadataNV = NULL; + +PFNEGLRESETSTREAMNVPROC __eglewResetStreamNV = NULL; + +PFNEGLCREATESTREAMSYNCNVPROC __eglewCreateStreamSyncNV = NULL; + +PFNEGLCLIENTWAITSYNCNVPROC __eglewClientWaitSyncNV = NULL; +PFNEGLCREATEFENCESYNCNVPROC __eglewCreateFenceSyncNV = NULL; +PFNEGLDESTROYSYNCNVPROC __eglewDestroySyncNV = NULL; +PFNEGLFENCENVPROC __eglewFenceNV = NULL; +PFNEGLGETSYNCATTRIBNVPROC __eglewGetSyncAttribNV = NULL; +PFNEGLSIGNALSYNCNVPROC __eglewSignalSyncNV = NULL; + +PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC __eglewGetSystemTimeFrequencyNV = NULL; +PFNEGLGETSYSTEMTIMENVPROC __eglewGetSystemTimeNV = NULL; +GLboolean __EGLEW_VERSION_1_0 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_1 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_2 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_3 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_4 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_5 = GL_FALSE; +GLboolean __EGLEW_ANDROID_blob_cache = GL_FALSE; +GLboolean __EGLEW_ANDROID_create_native_client_buffer = GL_FALSE; +GLboolean __EGLEW_ANDROID_framebuffer_target = GL_FALSE; +GLboolean __EGLEW_ANDROID_front_buffer_auto_refresh = GL_FALSE; +GLboolean __EGLEW_ANDROID_image_native_buffer = GL_FALSE; +GLboolean __EGLEW_ANDROID_native_fence_sync = GL_FALSE; +GLboolean __EGLEW_ANDROID_presentation_time = GL_FALSE; +GLboolean __EGLEW_ANDROID_recordable = GL_FALSE; +GLboolean __EGLEW_ANGLE_d3d_share_handle_client_buffer = GL_FALSE; +GLboolean __EGLEW_ANGLE_device_d3d = GL_FALSE; +GLboolean __EGLEW_ANGLE_query_surface_pointer = GL_FALSE; +GLboolean __EGLEW_ANGLE_surface_d3d_texture_2d_share_handle = GL_FALSE; +GLboolean __EGLEW_ANGLE_window_fixed_size = GL_FALSE; +GLboolean __EGLEW_ARM_implicit_external_sync = GL_FALSE; +GLboolean __EGLEW_ARM_pixmap_multisample_discard = GL_FALSE; +GLboolean __EGLEW_EXT_buffer_age = GL_FALSE; +GLboolean __EGLEW_EXT_client_extensions = GL_FALSE; +GLboolean __EGLEW_EXT_create_context_robustness = GL_FALSE; +GLboolean __EGLEW_EXT_device_base = GL_FALSE; +GLboolean __EGLEW_EXT_device_drm = GL_FALSE; +GLboolean __EGLEW_EXT_device_enumeration = GL_FALSE; +GLboolean __EGLEW_EXT_device_openwf = GL_FALSE; +GLboolean __EGLEW_EXT_device_query = GL_FALSE; +GLboolean __EGLEW_EXT_gl_colorspace_bt2020_linear = GL_FALSE; +GLboolean __EGLEW_EXT_gl_colorspace_bt2020_pq = GL_FALSE; +GLboolean __EGLEW_EXT_gl_colorspace_scrgb_linear = GL_FALSE; +GLboolean __EGLEW_EXT_image_dma_buf_import = GL_FALSE; +GLboolean __EGLEW_EXT_image_dma_buf_import_modifiers = GL_FALSE; +GLboolean __EGLEW_EXT_multiview_window = GL_FALSE; +GLboolean __EGLEW_EXT_output_base = GL_FALSE; +GLboolean __EGLEW_EXT_output_drm = GL_FALSE; +GLboolean __EGLEW_EXT_output_openwf = GL_FALSE; +GLboolean __EGLEW_EXT_pixel_format_float = GL_FALSE; +GLboolean __EGLEW_EXT_platform_base = GL_FALSE; +GLboolean __EGLEW_EXT_platform_device = GL_FALSE; +GLboolean __EGLEW_EXT_platform_wayland = GL_FALSE; +GLboolean __EGLEW_EXT_platform_x11 = GL_FALSE; +GLboolean __EGLEW_EXT_protected_content = GL_FALSE; +GLboolean __EGLEW_EXT_protected_surface = GL_FALSE; +GLboolean __EGLEW_EXT_stream_consumer_egloutput = GL_FALSE; +GLboolean __EGLEW_EXT_surface_SMPTE2086_metadata = GL_FALSE; +GLboolean __EGLEW_EXT_swap_buffers_with_damage = GL_FALSE; +GLboolean __EGLEW_EXT_yuv_surface = GL_FALSE; +GLboolean __EGLEW_HI_clientpixmap = GL_FALSE; +GLboolean __EGLEW_HI_colorformats = GL_FALSE; +GLboolean __EGLEW_IMG_context_priority = GL_FALSE; +GLboolean __EGLEW_IMG_image_plane_attribs = GL_FALSE; +GLboolean __EGLEW_KHR_cl_event = GL_FALSE; +GLboolean __EGLEW_KHR_cl_event2 = GL_FALSE; +GLboolean __EGLEW_KHR_client_get_all_proc_addresses = GL_FALSE; +GLboolean __EGLEW_KHR_config_attribs = GL_FALSE; +GLboolean __EGLEW_KHR_context_flush_control = GL_FALSE; +GLboolean __EGLEW_KHR_create_context = GL_FALSE; +GLboolean __EGLEW_KHR_create_context_no_error = GL_FALSE; +GLboolean __EGLEW_KHR_debug = GL_FALSE; +GLboolean __EGLEW_KHR_fence_sync = GL_FALSE; +GLboolean __EGLEW_KHR_get_all_proc_addresses = GL_FALSE; +GLboolean __EGLEW_KHR_gl_colorspace = GL_FALSE; +GLboolean __EGLEW_KHR_gl_renderbuffer_image = GL_FALSE; +GLboolean __EGLEW_KHR_gl_texture_2D_image = GL_FALSE; +GLboolean __EGLEW_KHR_gl_texture_3D_image = GL_FALSE; +GLboolean __EGLEW_KHR_gl_texture_cubemap_image = GL_FALSE; +GLboolean __EGLEW_KHR_image = GL_FALSE; +GLboolean __EGLEW_KHR_image_base = GL_FALSE; +GLboolean __EGLEW_KHR_image_pixmap = GL_FALSE; +GLboolean __EGLEW_KHR_lock_surface = GL_FALSE; +GLboolean __EGLEW_KHR_lock_surface2 = GL_FALSE; +GLboolean __EGLEW_KHR_lock_surface3 = GL_FALSE; +GLboolean __EGLEW_KHR_mutable_render_buffer = GL_FALSE; +GLboolean __EGLEW_KHR_no_config_context = GL_FALSE; +GLboolean __EGLEW_KHR_partial_update = GL_FALSE; +GLboolean __EGLEW_KHR_platform_android = GL_FALSE; +GLboolean __EGLEW_KHR_platform_gbm = GL_FALSE; +GLboolean __EGLEW_KHR_platform_wayland = GL_FALSE; +GLboolean __EGLEW_KHR_platform_x11 = GL_FALSE; +GLboolean __EGLEW_KHR_reusable_sync = GL_FALSE; +GLboolean __EGLEW_KHR_stream = GL_FALSE; +GLboolean __EGLEW_KHR_stream_attrib = GL_FALSE; +GLboolean __EGLEW_KHR_stream_consumer_gltexture = GL_FALSE; +GLboolean __EGLEW_KHR_stream_cross_process_fd = GL_FALSE; +GLboolean __EGLEW_KHR_stream_fifo = GL_FALSE; +GLboolean __EGLEW_KHR_stream_producer_aldatalocator = GL_FALSE; +GLboolean __EGLEW_KHR_stream_producer_eglsurface = GL_FALSE; +GLboolean __EGLEW_KHR_surfaceless_context = GL_FALSE; +GLboolean __EGLEW_KHR_swap_buffers_with_damage = GL_FALSE; +GLboolean __EGLEW_KHR_vg_parent_image = GL_FALSE; +GLboolean __EGLEW_KHR_wait_sync = GL_FALSE; +GLboolean __EGLEW_MESA_drm_image = GL_FALSE; +GLboolean __EGLEW_MESA_image_dma_buf_export = GL_FALSE; +GLboolean __EGLEW_MESA_platform_gbm = GL_FALSE; +GLboolean __EGLEW_MESA_platform_surfaceless = GL_FALSE; +GLboolean __EGLEW_NOK_swap_region = GL_FALSE; +GLboolean __EGLEW_NOK_swap_region2 = GL_FALSE; +GLboolean __EGLEW_NOK_texture_from_pixmap = GL_FALSE; +GLboolean __EGLEW_NV_3dvision_surface = GL_FALSE; +GLboolean __EGLEW_NV_coverage_sample = GL_FALSE; +GLboolean __EGLEW_NV_coverage_sample_resolve = GL_FALSE; +GLboolean __EGLEW_NV_cuda_event = GL_FALSE; +GLboolean __EGLEW_NV_depth_nonlinear = GL_FALSE; +GLboolean __EGLEW_NV_device_cuda = GL_FALSE; +GLboolean __EGLEW_NV_native_query = GL_FALSE; +GLboolean __EGLEW_NV_post_convert_rounding = GL_FALSE; +GLboolean __EGLEW_NV_post_sub_buffer = GL_FALSE; +GLboolean __EGLEW_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __EGLEW_NV_stream_consumer_gltexture_yuv = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_display = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_object = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_partition = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_process = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_system = GL_FALSE; +GLboolean __EGLEW_NV_stream_fifo_next = GL_FALSE; +GLboolean __EGLEW_NV_stream_fifo_synchronous = GL_FALSE; +GLboolean __EGLEW_NV_stream_frame_limits = GL_FALSE; +GLboolean __EGLEW_NV_stream_metadata = GL_FALSE; +GLboolean __EGLEW_NV_stream_remote = GL_FALSE; +GLboolean __EGLEW_NV_stream_reset = GL_FALSE; +GLboolean __EGLEW_NV_stream_socket = GL_FALSE; +GLboolean __EGLEW_NV_stream_socket_inet = GL_FALSE; +GLboolean __EGLEW_NV_stream_socket_unix = GL_FALSE; +GLboolean __EGLEW_NV_stream_sync = GL_FALSE; +GLboolean __EGLEW_NV_sync = GL_FALSE; +GLboolean __EGLEW_NV_system_time = GL_FALSE; +GLboolean __EGLEW_TIZEN_image_native_buffer = GL_FALSE; +GLboolean __EGLEW_TIZEN_image_native_surface = GL_FALSE; +#ifdef EGL_VERSION_1_0 + +static GLboolean _glewInit_EGL_VERSION_1_0 () +{ + GLboolean r = GL_FALSE; + + r = ((eglChooseConfig = (PFNEGLCHOOSECONFIGPROC)glewGetProcAddress((const GLubyte*)"eglChooseConfig")) == NULL) || r; + r = ((eglCopyBuffers = (PFNEGLCOPYBUFFERSPROC)glewGetProcAddress((const GLubyte*)"eglCopyBuffers")) == NULL) || r; + r = ((eglCreateContext = (PFNEGLCREATECONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglCreateContext")) == NULL) || r; + r = ((eglCreatePbufferSurface = (PFNEGLCREATEPBUFFERSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePbufferSurface")) == NULL) || r; + r = ((eglCreatePixmapSurface = (PFNEGLCREATEPIXMAPSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePixmapSurface")) == NULL) || r; + r = ((eglCreateWindowSurface = (PFNEGLCREATEWINDOWSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreateWindowSurface")) == NULL) || r; + r = ((eglDestroyContext = (PFNEGLDESTROYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglDestroyContext")) == NULL) || r; + r = ((eglDestroySurface = (PFNEGLDESTROYSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglDestroySurface")) == NULL) || r; + r = ((eglGetConfigAttrib = (PFNEGLGETCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"eglGetConfigAttrib")) == NULL) || r; + r = ((eglGetConfigs = (PFNEGLGETCONFIGSPROC)glewGetProcAddress((const GLubyte*)"eglGetConfigs")) == NULL) || r; + r = ((eglGetCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"eglGetCurrentDisplay")) == NULL) || r; + r = ((eglGetCurrentSurface = (PFNEGLGETCURRENTSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglGetCurrentSurface")) == NULL) || r; + r = ((eglGetDisplay = (PFNEGLGETDISPLAYPROC)glewGetProcAddress((const GLubyte*)"eglGetDisplay")) == NULL) || r; + r = ((eglGetError = (PFNEGLGETERRORPROC)glewGetProcAddress((const GLubyte*)"eglGetError")) == NULL) || r; + r = ((eglInitialize = (PFNEGLINITIALIZEPROC)glewGetProcAddress((const GLubyte*)"eglInitialize")) == NULL) || r; + r = ((eglMakeCurrent = (PFNEGLMAKECURRENTPROC)glewGetProcAddress((const GLubyte*)"eglMakeCurrent")) == NULL) || r; + r = ((eglQueryContext = (PFNEGLQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryContext")) == NULL) || r; + r = ((eglQueryString = (PFNEGLQUERYSTRINGPROC)glewGetProcAddress((const GLubyte*)"eglQueryString")) == NULL) || r; + r = ((eglQuerySurface = (PFNEGLQUERYSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglQuerySurface")) == NULL) || r; + r = ((eglSwapBuffers = (PFNEGLSWAPBUFFERSPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffers")) == NULL) || r; + r = ((eglTerminate = (PFNEGLTERMINATEPROC)glewGetProcAddress((const GLubyte*)"eglTerminate")) == NULL) || r; + r = ((eglWaitGL = (PFNEGLWAITGLPROC)glewGetProcAddress((const GLubyte*)"eglWaitGL")) == NULL) || r; + r = ((eglWaitNative = (PFNEGLWAITNATIVEPROC)glewGetProcAddress((const GLubyte*)"eglWaitNative")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_0 */ + +#ifdef EGL_VERSION_1_1 + +static GLboolean _glewInit_EGL_VERSION_1_1 () +{ + GLboolean r = GL_FALSE; + + r = ((eglBindTexImage = (PFNEGLBINDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglBindTexImage")) == NULL) || r; + r = ((eglReleaseTexImage = (PFNEGLRELEASETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglReleaseTexImage")) == NULL) || r; + r = ((eglSurfaceAttrib = (PFNEGLSURFACEATTRIBPROC)glewGetProcAddress((const GLubyte*)"eglSurfaceAttrib")) == NULL) || r; + r = ((eglSwapInterval = (PFNEGLSWAPINTERVALPROC)glewGetProcAddress((const GLubyte*)"eglSwapInterval")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_1 */ + +#ifdef EGL_VERSION_1_2 + +static GLboolean _glewInit_EGL_VERSION_1_2 () +{ + GLboolean r = GL_FALSE; + + r = ((eglBindAPI = (PFNEGLBINDAPIPROC)glewGetProcAddress((const GLubyte*)"eglBindAPI")) == NULL) || r; + r = ((eglCreatePbufferFromClientBuffer = (PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC)glewGetProcAddress((const GLubyte*)"eglCreatePbufferFromClientBuffer")) == NULL) || r; + r = ((eglQueryAPI = (PFNEGLQUERYAPIPROC)glewGetProcAddress((const GLubyte*)"eglQueryAPI")) == NULL) || r; + r = ((eglReleaseThread = (PFNEGLRELEASETHREADPROC)glewGetProcAddress((const GLubyte*)"eglReleaseThread")) == NULL) || r; + r = ((eglWaitClient = (PFNEGLWAITCLIENTPROC)glewGetProcAddress((const GLubyte*)"eglWaitClient")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_2 */ + +#ifdef EGL_VERSION_1_4 + +static GLboolean _glewInit_EGL_VERSION_1_4 () +{ + GLboolean r = GL_FALSE; + + r = ((eglGetCurrentContext = (PFNEGLGETCURRENTCONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetCurrentContext")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_4 */ + +#ifdef EGL_VERSION_1_5 + +static GLboolean _glewInit_EGL_VERSION_1_5 () +{ + GLboolean r = GL_FALSE; + + r = ((eglClientWaitSync = (PFNEGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"eglClientWaitSync")) == NULL) || r; + r = ((eglCreateImage = (PFNEGLCREATEIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglCreateImage")) == NULL) || r; + r = ((eglCreatePlatformPixmapSurface = (PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformPixmapSurface")) == NULL) || r; + r = ((eglCreatePlatformWindowSurface = (PFNEGLCREATEPLATFORMWINDOWSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformWindowSurface")) == NULL) || r; + r = ((eglCreateSync = (PFNEGLCREATESYNCPROC)glewGetProcAddress((const GLubyte*)"eglCreateSync")) == NULL) || r; + r = ((eglDestroyImage = (PFNEGLDESTROYIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglDestroyImage")) == NULL) || r; + r = ((eglDestroySync = (PFNEGLDESTROYSYNCPROC)glewGetProcAddress((const GLubyte*)"eglDestroySync")) == NULL) || r; + r = ((eglGetPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYPROC)glewGetProcAddress((const GLubyte*)"eglGetPlatformDisplay")) == NULL) || r; + r = ((eglGetSyncAttrib = (PFNEGLGETSYNCATTRIBPROC)glewGetProcAddress((const GLubyte*)"eglGetSyncAttrib")) == NULL) || r; + r = ((eglWaitSync = (PFNEGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"eglWaitSync")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_5 */ + +#ifdef EGL_ANDROID_blob_cache + +static GLboolean _glewInit_EGL_ANDROID_blob_cache () +{ + GLboolean r = GL_FALSE; + + r = ((eglSetBlobCacheFuncsANDROID = (PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglSetBlobCacheFuncsANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_blob_cache */ + +#ifdef EGL_ANDROID_create_native_client_buffer + +static GLboolean _glewInit_EGL_ANDROID_create_native_client_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateNativeClientBufferANDROID = (PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglCreateNativeClientBufferANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_create_native_client_buffer */ + +#ifdef EGL_ANDROID_native_fence_sync + +static GLboolean _glewInit_EGL_ANDROID_native_fence_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglDupNativeFenceFDANDROID = (PFNEGLDUPNATIVEFENCEFDANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglDupNativeFenceFDANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_native_fence_sync */ + +#ifdef EGL_ANDROID_presentation_time + +static GLboolean _glewInit_EGL_ANDROID_presentation_time () +{ + GLboolean r = GL_FALSE; + + r = ((eglPresentationTimeANDROID = (PFNEGLPRESENTATIONTIMEANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglPresentationTimeANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_presentation_time */ + +#ifdef EGL_ANGLE_query_surface_pointer + +static GLboolean _glewInit_EGL_ANGLE_query_surface_pointer () +{ + GLboolean r = GL_FALSE; + + r = ((eglQuerySurfacePointerANGLE = (PFNEGLQUERYSURFACEPOINTERANGLEPROC)glewGetProcAddress((const GLubyte*)"eglQuerySurfacePointerANGLE")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANGLE_query_surface_pointer */ + +#ifdef EGL_EXT_device_enumeration + +static GLboolean _glewInit_EGL_EXT_device_enumeration () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDevicesEXT = (PFNEGLQUERYDEVICESEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDevicesEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_device_enumeration */ + +#ifdef EGL_EXT_device_query + +static GLboolean _glewInit_EGL_EXT_device_query () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDeviceAttribEXT = (PFNEGLQUERYDEVICEATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDeviceAttribEXT")) == NULL) || r; + r = ((eglQueryDeviceStringEXT = (PFNEGLQUERYDEVICESTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDeviceStringEXT")) == NULL) || r; + r = ((eglQueryDisplayAttribEXT = (PFNEGLQUERYDISPLAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDisplayAttribEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_device_query */ + +#ifdef EGL_EXT_image_dma_buf_import_modifiers + +static GLboolean _glewInit_EGL_EXT_image_dma_buf_import_modifiers () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDmaBufFormatsEXT = (PFNEGLQUERYDMABUFFORMATSEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDmaBufFormatsEXT")) == NULL) || r; + r = ((eglQueryDmaBufModifiersEXT = (PFNEGLQUERYDMABUFMODIFIERSEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDmaBufModifiersEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ + +#ifdef EGL_EXT_output_base + +static GLboolean _glewInit_EGL_EXT_output_base () +{ + GLboolean r = GL_FALSE; + + r = ((eglGetOutputLayersEXT = (PFNEGLGETOUTPUTLAYERSEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetOutputLayersEXT")) == NULL) || r; + r = ((eglGetOutputPortsEXT = (PFNEGLGETOUTPUTPORTSEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetOutputPortsEXT")) == NULL) || r; + r = ((eglOutputLayerAttribEXT = (PFNEGLOUTPUTLAYERATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglOutputLayerAttribEXT")) == NULL) || r; + r = ((eglOutputPortAttribEXT = (PFNEGLOUTPUTPORTATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglOutputPortAttribEXT")) == NULL) || r; + r = ((eglQueryOutputLayerAttribEXT = (PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputLayerAttribEXT")) == NULL) || r; + r = ((eglQueryOutputLayerStringEXT = (PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputLayerStringEXT")) == NULL) || r; + r = ((eglQueryOutputPortAttribEXT = (PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputPortAttribEXT")) == NULL) || r; + r = ((eglQueryOutputPortStringEXT = (PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputPortStringEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_output_base */ + +#ifdef EGL_EXT_platform_base + +static GLboolean _glewInit_EGL_EXT_platform_base () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreatePlatformPixmapSurfaceEXT = (PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformPixmapSurfaceEXT")) == NULL) || r; + r = ((eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformWindowSurfaceEXT")) == NULL) || r; + r = ((eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetPlatformDisplayEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_platform_base */ + +#ifdef EGL_EXT_stream_consumer_egloutput + +static GLboolean _glewInit_EGL_EXT_stream_consumer_egloutput () +{ + GLboolean r = GL_FALSE; + + r = ((eglStreamConsumerOutputEXT = (PFNEGLSTREAMCONSUMEROUTPUTEXTPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerOutputEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_stream_consumer_egloutput */ + +#ifdef EGL_EXT_swap_buffers_with_damage + +static GLboolean _glewInit_EGL_EXT_swap_buffers_with_damage () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersWithDamageEXT = (PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersWithDamageEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_swap_buffers_with_damage */ + +#ifdef EGL_HI_clientpixmap + +static GLboolean _glewInit_EGL_HI_clientpixmap () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreatePixmapSurfaceHI = (PFNEGLCREATEPIXMAPSURFACEHIPROC)glewGetProcAddress((const GLubyte*)"eglCreatePixmapSurfaceHI")) == NULL) || r; + + return r; +} + +#endif /* EGL_HI_clientpixmap */ + +#ifdef EGL_KHR_cl_event2 + +static GLboolean _glewInit_EGL_KHR_cl_event2 () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateSync64KHR = (PFNEGLCREATESYNC64KHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateSync64KHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_cl_event2 */ + +#ifdef EGL_KHR_debug + +static GLboolean _glewInit_EGL_KHR_debug () +{ + GLboolean r = GL_FALSE; + + r = ((eglDebugMessageControlKHR = (PFNEGLDEBUGMESSAGECONTROLKHRPROC)glewGetProcAddress((const GLubyte*)"eglDebugMessageControlKHR")) == NULL) || r; + r = ((eglLabelObjectKHR = (PFNEGLLABELOBJECTKHRPROC)glewGetProcAddress((const GLubyte*)"eglLabelObjectKHR")) == NULL) || r; + r = ((eglQueryDebugKHR = (PFNEGLQUERYDEBUGKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryDebugKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_debug */ + +#ifdef EGL_KHR_image + +static GLboolean _glewInit_EGL_KHR_image () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateImageKHR")) == NULL) || r; + r = ((eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)glewGetProcAddress((const GLubyte*)"eglDestroyImageKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_image */ + +#ifdef EGL_KHR_lock_surface + +static GLboolean _glewInit_EGL_KHR_lock_surface () +{ + GLboolean r = GL_FALSE; + + r = ((eglLockSurfaceKHR = (PFNEGLLOCKSURFACEKHRPROC)glewGetProcAddress((const GLubyte*)"eglLockSurfaceKHR")) == NULL) || r; + r = ((eglUnlockSurfaceKHR = (PFNEGLUNLOCKSURFACEKHRPROC)glewGetProcAddress((const GLubyte*)"eglUnlockSurfaceKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_lock_surface */ + +#ifdef EGL_KHR_lock_surface3 + +static GLboolean _glewInit_EGL_KHR_lock_surface3 () +{ + GLboolean r = GL_FALSE; + + r = ((eglQuerySurface64KHR = (PFNEGLQUERYSURFACE64KHRPROC)glewGetProcAddress((const GLubyte*)"eglQuerySurface64KHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_lock_surface3 */ + +#ifdef EGL_KHR_partial_update + +static GLboolean _glewInit_EGL_KHR_partial_update () +{ + GLboolean r = GL_FALSE; + + r = ((eglSetDamageRegionKHR = (PFNEGLSETDAMAGEREGIONKHRPROC)glewGetProcAddress((const GLubyte*)"eglSetDamageRegionKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_partial_update */ + +#ifdef EGL_KHR_reusable_sync + +static GLboolean _glewInit_EGL_KHR_reusable_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglClientWaitSyncKHR = (PFNEGLCLIENTWAITSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglClientWaitSyncKHR")) == NULL) || r; + r = ((eglCreateSyncKHR = (PFNEGLCREATESYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateSyncKHR")) == NULL) || r; + r = ((eglDestroySyncKHR = (PFNEGLDESTROYSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglDestroySyncKHR")) == NULL) || r; + r = ((eglGetSyncAttribKHR = (PFNEGLGETSYNCATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglGetSyncAttribKHR")) == NULL) || r; + r = ((eglSignalSyncKHR = (PFNEGLSIGNALSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglSignalSyncKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_reusable_sync */ + +#ifdef EGL_KHR_stream + +static GLboolean _glewInit_EGL_KHR_stream () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamKHR = (PFNEGLCREATESTREAMKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamKHR")) == NULL) || r; + r = ((eglDestroyStreamKHR = (PFNEGLDESTROYSTREAMKHRPROC)glewGetProcAddress((const GLubyte*)"eglDestroyStreamKHR")) == NULL) || r; + r = ((eglQueryStreamKHR = (PFNEGLQUERYSTREAMKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamKHR")) == NULL) || r; + r = ((eglQueryStreamu64KHR = (PFNEGLQUERYSTREAMU64KHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamu64KHR")) == NULL) || r; + r = ((eglStreamAttribKHR = (PFNEGLSTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamAttribKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream */ + +#ifdef EGL_KHR_stream_attrib + +static GLboolean _glewInit_EGL_KHR_stream_attrib () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamAttribKHR = (PFNEGLCREATESTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamAttribKHR")) == NULL) || r; + r = ((eglQueryStreamAttribKHR = (PFNEGLQUERYSTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamAttribKHR")) == NULL) || r; + r = ((eglSetStreamAttribKHR = (PFNEGLSETSTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglSetStreamAttribKHR")) == NULL) || r; + r = ((eglStreamConsumerAcquireAttribKHR = (PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerAcquireAttribKHR")) == NULL) || r; + r = ((eglStreamConsumerReleaseAttribKHR = (PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerReleaseAttribKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_attrib */ + +#ifdef EGL_KHR_stream_consumer_gltexture + +static GLboolean _glewInit_EGL_KHR_stream_consumer_gltexture () +{ + GLboolean r = GL_FALSE; + + r = ((eglStreamConsumerAcquireKHR = (PFNEGLSTREAMCONSUMERACQUIREKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerAcquireKHR")) == NULL) || r; + r = ((eglStreamConsumerGLTextureExternalKHR = (PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerGLTextureExternalKHR")) == NULL) || r; + r = ((eglStreamConsumerReleaseKHR = (PFNEGLSTREAMCONSUMERRELEASEKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerReleaseKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_consumer_gltexture */ + +#ifdef EGL_KHR_stream_cross_process_fd + +static GLboolean _glewInit_EGL_KHR_stream_cross_process_fd () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamFromFileDescriptorKHR = (PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamFromFileDescriptorKHR")) == NULL) || r; + r = ((eglGetStreamFileDescriptorKHR = (PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)glewGetProcAddress((const GLubyte*)"eglGetStreamFileDescriptorKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_cross_process_fd */ + +#ifdef EGL_KHR_stream_fifo + +static GLboolean _glewInit_EGL_KHR_stream_fifo () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryStreamTimeKHR = (PFNEGLQUERYSTREAMTIMEKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamTimeKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_fifo */ + +#ifdef EGL_KHR_stream_producer_eglsurface + +static GLboolean _glewInit_EGL_KHR_stream_producer_eglsurface () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamProducerSurfaceKHR = (PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamProducerSurfaceKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_producer_eglsurface */ + +#ifdef EGL_KHR_swap_buffers_with_damage + +static GLboolean _glewInit_EGL_KHR_swap_buffers_with_damage () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersWithDamageKHR = (PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersWithDamageKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_swap_buffers_with_damage */ + +#ifdef EGL_KHR_wait_sync + +static GLboolean _glewInit_EGL_KHR_wait_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglWaitSyncKHR = (PFNEGLWAITSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglWaitSyncKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_wait_sync */ + +#ifdef EGL_MESA_drm_image + +static GLboolean _glewInit_EGL_MESA_drm_image () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateDRMImageMESA = (PFNEGLCREATEDRMIMAGEMESAPROC)glewGetProcAddress((const GLubyte*)"eglCreateDRMImageMESA")) == NULL) || r; + r = ((eglExportDRMImageMESA = (PFNEGLEXPORTDRMIMAGEMESAPROC)glewGetProcAddress((const GLubyte*)"eglExportDRMImageMESA")) == NULL) || r; + + return r; +} + +#endif /* EGL_MESA_drm_image */ + +#ifdef EGL_MESA_image_dma_buf_export + +static GLboolean _glewInit_EGL_MESA_image_dma_buf_export () +{ + GLboolean r = GL_FALSE; + + r = ((eglExportDMABUFImageMESA = (PFNEGLEXPORTDMABUFIMAGEMESAPROC)glewGetProcAddress((const GLubyte*)"eglExportDMABUFImageMESA")) == NULL) || r; + r = ((eglExportDMABUFImageQueryMESA = (PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC)glewGetProcAddress((const GLubyte*)"eglExportDMABUFImageQueryMESA")) == NULL) || r; + + return r; +} + +#endif /* EGL_MESA_image_dma_buf_export */ + +#ifdef EGL_NOK_swap_region + +static GLboolean _glewInit_EGL_NOK_swap_region () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersRegionNOK = (PFNEGLSWAPBUFFERSREGIONNOKPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersRegionNOK")) == NULL) || r; + + return r; +} + +#endif /* EGL_NOK_swap_region */ + +#ifdef EGL_NOK_swap_region2 + +static GLboolean _glewInit_EGL_NOK_swap_region2 () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersRegion2NOK = (PFNEGLSWAPBUFFERSREGION2NOKPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersRegion2NOK")) == NULL) || r; + + return r; +} + +#endif /* EGL_NOK_swap_region2 */ + +#ifdef EGL_NV_native_query + +static GLboolean _glewInit_EGL_NV_native_query () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryNativeDisplayNV = (PFNEGLQUERYNATIVEDISPLAYNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryNativeDisplayNV")) == NULL) || r; + r = ((eglQueryNativePixmapNV = (PFNEGLQUERYNATIVEPIXMAPNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryNativePixmapNV")) == NULL) || r; + r = ((eglQueryNativeWindowNV = (PFNEGLQUERYNATIVEWINDOWNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryNativeWindowNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_native_query */ + +#ifdef EGL_NV_post_sub_buffer + +static GLboolean _glewInit_EGL_NV_post_sub_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((eglPostSubBufferNV = (PFNEGLPOSTSUBBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"eglPostSubBufferNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_post_sub_buffer */ + +#ifdef EGL_NV_stream_consumer_gltexture_yuv + +static GLboolean _glewInit_EGL_NV_stream_consumer_gltexture_yuv () +{ + GLboolean r = GL_FALSE; + + r = ((eglStreamConsumerGLTextureExternalAttribsNV = (PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerGLTextureExternalAttribsNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ + +#ifdef EGL_NV_stream_metadata + +static GLboolean _glewInit_EGL_NV_stream_metadata () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDisplayAttribNV = (PFNEGLQUERYDISPLAYATTRIBNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryDisplayAttribNV")) == NULL) || r; + r = ((eglQueryStreamMetadataNV = (PFNEGLQUERYSTREAMMETADATANVPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamMetadataNV")) == NULL) || r; + r = ((eglSetStreamMetadataNV = (PFNEGLSETSTREAMMETADATANVPROC)glewGetProcAddress((const GLubyte*)"eglSetStreamMetadataNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_metadata */ + +#ifdef EGL_NV_stream_reset + +static GLboolean _glewInit_EGL_NV_stream_reset () +{ + GLboolean r = GL_FALSE; + + r = ((eglResetStreamNV = (PFNEGLRESETSTREAMNVPROC)glewGetProcAddress((const GLubyte*)"eglResetStreamNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_reset */ + +#ifdef EGL_NV_stream_sync + +static GLboolean _glewInit_EGL_NV_stream_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamSyncNV = (PFNEGLCREATESTREAMSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamSyncNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_sync */ + +#ifdef EGL_NV_sync + +static GLboolean _glewInit_EGL_NV_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglClientWaitSyncNV = (PFNEGLCLIENTWAITSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglClientWaitSyncNV")) == NULL) || r; + r = ((eglCreateFenceSyncNV = (PFNEGLCREATEFENCESYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglCreateFenceSyncNV")) == NULL) || r; + r = ((eglDestroySyncNV = (PFNEGLDESTROYSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglDestroySyncNV")) == NULL) || r; + r = ((eglFenceNV = (PFNEGLFENCENVPROC)glewGetProcAddress((const GLubyte*)"eglFenceNV")) == NULL) || r; + r = ((eglGetSyncAttribNV = (PFNEGLGETSYNCATTRIBNVPROC)glewGetProcAddress((const GLubyte*)"eglGetSyncAttribNV")) == NULL) || r; + r = ((eglSignalSyncNV = (PFNEGLSIGNALSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglSignalSyncNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_sync */ + +#ifdef EGL_NV_system_time + +static GLboolean _glewInit_EGL_NV_system_time () +{ + GLboolean r = GL_FALSE; + + r = ((eglGetSystemTimeFrequencyNV = (PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)glewGetProcAddress((const GLubyte*)"eglGetSystemTimeFrequencyNV")) == NULL) || r; + r = ((eglGetSystemTimeNV = (PFNEGLGETSYSTEMTIMENVPROC)glewGetProcAddress((const GLubyte*)"eglGetSystemTimeNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_system_time */ + + /* ------------------------------------------------------------------------ */ + +GLboolean eglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + start = (const GLubyte*) eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum eglewInit (EGLDisplay display) +{ + EGLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + PFNEGLINITIALIZEPROC initialize = NULL; + PFNEGLQUERYSTRINGPROC queryString = NULL; + + /* Load necessary entry points */ + initialize = (PFNEGLINITIALIZEPROC) glewGetProcAddress("eglInitialize"); + queryString = (PFNEGLQUERYSTRINGPROC) glewGetProcAddress("eglQueryString"); + if (!initialize || !queryString) + return 1; + + /* query EGK version */ + if (initialize(display, &major, &minor) != EGL_TRUE) + return 1; + + EGLEW_VERSION_1_5 = ( major > 1 ) || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_4 = EGLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_3 = EGLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_2 = EGLEW_VERSION_1_3 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_1 = EGLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_0 = EGLEW_VERSION_1_1 == GL_TRUE || ( major == 1 && minor >= 0 ) ? GL_TRUE : GL_FALSE; + + /* query EGL extension string */ + extStart = (const GLubyte*) queryString(display, EGL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ +#ifdef EGL_VERSION_1_0 + if (glewExperimental || EGLEW_VERSION_1_0) EGLEW_VERSION_1_0 = !_glewInit_EGL_VERSION_1_0(); +#endif /* EGL_VERSION_1_0 */ +#ifdef EGL_VERSION_1_1 + if (glewExperimental || EGLEW_VERSION_1_1) EGLEW_VERSION_1_1 = !_glewInit_EGL_VERSION_1_1(); +#endif /* EGL_VERSION_1_1 */ +#ifdef EGL_VERSION_1_2 + if (glewExperimental || EGLEW_VERSION_1_2) EGLEW_VERSION_1_2 = !_glewInit_EGL_VERSION_1_2(); +#endif /* EGL_VERSION_1_2 */ +#ifdef EGL_VERSION_1_4 + if (glewExperimental || EGLEW_VERSION_1_4) EGLEW_VERSION_1_4 = !_glewInit_EGL_VERSION_1_4(); +#endif /* EGL_VERSION_1_4 */ +#ifdef EGL_VERSION_1_5 + if (glewExperimental || EGLEW_VERSION_1_5) EGLEW_VERSION_1_5 = !_glewInit_EGL_VERSION_1_5(); +#endif /* EGL_VERSION_1_5 */ +#ifdef EGL_ANDROID_blob_cache + EGLEW_ANDROID_blob_cache = _glewSearchExtension("EGL_ANDROID_blob_cache", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_blob_cache) EGLEW_ANDROID_blob_cache = !_glewInit_EGL_ANDROID_blob_cache(); +#endif /* EGL_ANDROID_blob_cache */ +#ifdef EGL_ANDROID_create_native_client_buffer + EGLEW_ANDROID_create_native_client_buffer = _glewSearchExtension("EGL_ANDROID_create_native_client_buffer", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_create_native_client_buffer) EGLEW_ANDROID_create_native_client_buffer = !_glewInit_EGL_ANDROID_create_native_client_buffer(); +#endif /* EGL_ANDROID_create_native_client_buffer */ +#ifdef EGL_ANDROID_framebuffer_target + EGLEW_ANDROID_framebuffer_target = _glewSearchExtension("EGL_ANDROID_framebuffer_target", extStart, extEnd); +#endif /* EGL_ANDROID_framebuffer_target */ +#ifdef EGL_ANDROID_front_buffer_auto_refresh + EGLEW_ANDROID_front_buffer_auto_refresh = _glewSearchExtension("EGL_ANDROID_front_buffer_auto_refresh", extStart, extEnd); +#endif /* EGL_ANDROID_front_buffer_auto_refresh */ +#ifdef EGL_ANDROID_image_native_buffer + EGLEW_ANDROID_image_native_buffer = _glewSearchExtension("EGL_ANDROID_image_native_buffer", extStart, extEnd); +#endif /* EGL_ANDROID_image_native_buffer */ +#ifdef EGL_ANDROID_native_fence_sync + EGLEW_ANDROID_native_fence_sync = _glewSearchExtension("EGL_ANDROID_native_fence_sync", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_native_fence_sync) EGLEW_ANDROID_native_fence_sync = !_glewInit_EGL_ANDROID_native_fence_sync(); +#endif /* EGL_ANDROID_native_fence_sync */ +#ifdef EGL_ANDROID_presentation_time + EGLEW_ANDROID_presentation_time = _glewSearchExtension("EGL_ANDROID_presentation_time", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_presentation_time) EGLEW_ANDROID_presentation_time = !_glewInit_EGL_ANDROID_presentation_time(); +#endif /* EGL_ANDROID_presentation_time */ +#ifdef EGL_ANDROID_recordable + EGLEW_ANDROID_recordable = _glewSearchExtension("EGL_ANDROID_recordable", extStart, extEnd); +#endif /* EGL_ANDROID_recordable */ +#ifdef EGL_ANGLE_d3d_share_handle_client_buffer + EGLEW_ANGLE_d3d_share_handle_client_buffer = _glewSearchExtension("EGL_ANGLE_d3d_share_handle_client_buffer", extStart, extEnd); +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ +#ifdef EGL_ANGLE_device_d3d + EGLEW_ANGLE_device_d3d = _glewSearchExtension("EGL_ANGLE_device_d3d", extStart, extEnd); +#endif /* EGL_ANGLE_device_d3d */ +#ifdef EGL_ANGLE_query_surface_pointer + EGLEW_ANGLE_query_surface_pointer = _glewSearchExtension("EGL_ANGLE_query_surface_pointer", extStart, extEnd); + if (glewExperimental || EGLEW_ANGLE_query_surface_pointer) EGLEW_ANGLE_query_surface_pointer = !_glewInit_EGL_ANGLE_query_surface_pointer(); +#endif /* EGL_ANGLE_query_surface_pointer */ +#ifdef EGL_ANGLE_surface_d3d_texture_2d_share_handle + EGLEW_ANGLE_surface_d3d_texture_2d_share_handle = _glewSearchExtension("EGL_ANGLE_surface_d3d_texture_2d_share_handle", extStart, extEnd); +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ +#ifdef EGL_ANGLE_window_fixed_size + EGLEW_ANGLE_window_fixed_size = _glewSearchExtension("EGL_ANGLE_window_fixed_size", extStart, extEnd); +#endif /* EGL_ANGLE_window_fixed_size */ +#ifdef EGL_ARM_implicit_external_sync + EGLEW_ARM_implicit_external_sync = _glewSearchExtension("EGL_ARM_implicit_external_sync", extStart, extEnd); +#endif /* EGL_ARM_implicit_external_sync */ +#ifdef EGL_ARM_pixmap_multisample_discard + EGLEW_ARM_pixmap_multisample_discard = _glewSearchExtension("EGL_ARM_pixmap_multisample_discard", extStart, extEnd); +#endif /* EGL_ARM_pixmap_multisample_discard */ +#ifdef EGL_EXT_buffer_age + EGLEW_EXT_buffer_age = _glewSearchExtension("EGL_EXT_buffer_age", extStart, extEnd); +#endif /* EGL_EXT_buffer_age */ +#ifdef EGL_EXT_client_extensions + EGLEW_EXT_client_extensions = _glewSearchExtension("EGL_EXT_client_extensions", extStart, extEnd); +#endif /* EGL_EXT_client_extensions */ +#ifdef EGL_EXT_create_context_robustness + EGLEW_EXT_create_context_robustness = _glewSearchExtension("EGL_EXT_create_context_robustness", extStart, extEnd); +#endif /* EGL_EXT_create_context_robustness */ +#ifdef EGL_EXT_device_base + EGLEW_EXT_device_base = _glewSearchExtension("EGL_EXT_device_base", extStart, extEnd); +#endif /* EGL_EXT_device_base */ +#ifdef EGL_EXT_device_drm + EGLEW_EXT_device_drm = _glewSearchExtension("EGL_EXT_device_drm", extStart, extEnd); +#endif /* EGL_EXT_device_drm */ +#ifdef EGL_EXT_device_enumeration + EGLEW_EXT_device_enumeration = _glewSearchExtension("EGL_EXT_device_enumeration", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_device_enumeration) EGLEW_EXT_device_enumeration = !_glewInit_EGL_EXT_device_enumeration(); +#endif /* EGL_EXT_device_enumeration */ +#ifdef EGL_EXT_device_openwf + EGLEW_EXT_device_openwf = _glewSearchExtension("EGL_EXT_device_openwf", extStart, extEnd); +#endif /* EGL_EXT_device_openwf */ +#ifdef EGL_EXT_device_query + EGLEW_EXT_device_query = _glewSearchExtension("EGL_EXT_device_query", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_device_query) EGLEW_EXT_device_query = !_glewInit_EGL_EXT_device_query(); +#endif /* EGL_EXT_device_query */ +#ifdef EGL_EXT_gl_colorspace_bt2020_linear + EGLEW_EXT_gl_colorspace_bt2020_linear = _glewSearchExtension("EGL_EXT_gl_colorspace_bt2020_linear", extStart, extEnd); +#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ +#ifdef EGL_EXT_gl_colorspace_bt2020_pq + EGLEW_EXT_gl_colorspace_bt2020_pq = _glewSearchExtension("EGL_EXT_gl_colorspace_bt2020_pq", extStart, extEnd); +#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ +#ifdef EGL_EXT_gl_colorspace_scrgb_linear + EGLEW_EXT_gl_colorspace_scrgb_linear = _glewSearchExtension("EGL_EXT_gl_colorspace_scrgb_linear", extStart, extEnd); +#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ +#ifdef EGL_EXT_image_dma_buf_import + EGLEW_EXT_image_dma_buf_import = _glewSearchExtension("EGL_EXT_image_dma_buf_import", extStart, extEnd); +#endif /* EGL_EXT_image_dma_buf_import */ +#ifdef EGL_EXT_image_dma_buf_import_modifiers + EGLEW_EXT_image_dma_buf_import_modifiers = _glewSearchExtension("EGL_EXT_image_dma_buf_import_modifiers", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_image_dma_buf_import_modifiers) EGLEW_EXT_image_dma_buf_import_modifiers = !_glewInit_EGL_EXT_image_dma_buf_import_modifiers(); +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ +#ifdef EGL_EXT_multiview_window + EGLEW_EXT_multiview_window = _glewSearchExtension("EGL_EXT_multiview_window", extStart, extEnd); +#endif /* EGL_EXT_multiview_window */ +#ifdef EGL_EXT_output_base + EGLEW_EXT_output_base = _glewSearchExtension("EGL_EXT_output_base", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_output_base) EGLEW_EXT_output_base = !_glewInit_EGL_EXT_output_base(); +#endif /* EGL_EXT_output_base */ +#ifdef EGL_EXT_output_drm + EGLEW_EXT_output_drm = _glewSearchExtension("EGL_EXT_output_drm", extStart, extEnd); +#endif /* EGL_EXT_output_drm */ +#ifdef EGL_EXT_output_openwf + EGLEW_EXT_output_openwf = _glewSearchExtension("EGL_EXT_output_openwf", extStart, extEnd); +#endif /* EGL_EXT_output_openwf */ +#ifdef EGL_EXT_pixel_format_float + EGLEW_EXT_pixel_format_float = _glewSearchExtension("EGL_EXT_pixel_format_float", extStart, extEnd); +#endif /* EGL_EXT_pixel_format_float */ +#ifdef EGL_EXT_platform_base + EGLEW_EXT_platform_base = _glewSearchExtension("EGL_EXT_platform_base", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_platform_base) EGLEW_EXT_platform_base = !_glewInit_EGL_EXT_platform_base(); +#endif /* EGL_EXT_platform_base */ +#ifdef EGL_EXT_platform_device + EGLEW_EXT_platform_device = _glewSearchExtension("EGL_EXT_platform_device", extStart, extEnd); +#endif /* EGL_EXT_platform_device */ +#ifdef EGL_EXT_platform_wayland + EGLEW_EXT_platform_wayland = _glewSearchExtension("EGL_EXT_platform_wayland", extStart, extEnd); +#endif /* EGL_EXT_platform_wayland */ +#ifdef EGL_EXT_platform_x11 + EGLEW_EXT_platform_x11 = _glewSearchExtension("EGL_EXT_platform_x11", extStart, extEnd); +#endif /* EGL_EXT_platform_x11 */ +#ifdef EGL_EXT_protected_content + EGLEW_EXT_protected_content = _glewSearchExtension("EGL_EXT_protected_content", extStart, extEnd); +#endif /* EGL_EXT_protected_content */ +#ifdef EGL_EXT_protected_surface + EGLEW_EXT_protected_surface = _glewSearchExtension("EGL_EXT_protected_surface", extStart, extEnd); +#endif /* EGL_EXT_protected_surface */ +#ifdef EGL_EXT_stream_consumer_egloutput + EGLEW_EXT_stream_consumer_egloutput = _glewSearchExtension("EGL_EXT_stream_consumer_egloutput", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_stream_consumer_egloutput) EGLEW_EXT_stream_consumer_egloutput = !_glewInit_EGL_EXT_stream_consumer_egloutput(); +#endif /* EGL_EXT_stream_consumer_egloutput */ +#ifdef EGL_EXT_surface_SMPTE2086_metadata + EGLEW_EXT_surface_SMPTE2086_metadata = _glewSearchExtension("EGL_EXT_surface_SMPTE2086_metadata", extStart, extEnd); +#endif /* EGL_EXT_surface_SMPTE2086_metadata */ +#ifdef EGL_EXT_swap_buffers_with_damage + EGLEW_EXT_swap_buffers_with_damage = _glewSearchExtension("EGL_EXT_swap_buffers_with_damage", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_swap_buffers_with_damage) EGLEW_EXT_swap_buffers_with_damage = !_glewInit_EGL_EXT_swap_buffers_with_damage(); +#endif /* EGL_EXT_swap_buffers_with_damage */ +#ifdef EGL_EXT_yuv_surface + EGLEW_EXT_yuv_surface = _glewSearchExtension("EGL_EXT_yuv_surface", extStart, extEnd); +#endif /* EGL_EXT_yuv_surface */ +#ifdef EGL_HI_clientpixmap + EGLEW_HI_clientpixmap = _glewSearchExtension("EGL_HI_clientpixmap", extStart, extEnd); + if (glewExperimental || EGLEW_HI_clientpixmap) EGLEW_HI_clientpixmap = !_glewInit_EGL_HI_clientpixmap(); +#endif /* EGL_HI_clientpixmap */ +#ifdef EGL_HI_colorformats + EGLEW_HI_colorformats = _glewSearchExtension("EGL_HI_colorformats", extStart, extEnd); +#endif /* EGL_HI_colorformats */ +#ifdef EGL_IMG_context_priority + EGLEW_IMG_context_priority = _glewSearchExtension("EGL_IMG_context_priority", extStart, extEnd); +#endif /* EGL_IMG_context_priority */ +#ifdef EGL_IMG_image_plane_attribs + EGLEW_IMG_image_plane_attribs = _glewSearchExtension("EGL_IMG_image_plane_attribs", extStart, extEnd); +#endif /* EGL_IMG_image_plane_attribs */ +#ifdef EGL_KHR_cl_event + EGLEW_KHR_cl_event = _glewSearchExtension("EGL_KHR_cl_event", extStart, extEnd); +#endif /* EGL_KHR_cl_event */ +#ifdef EGL_KHR_cl_event2 + EGLEW_KHR_cl_event2 = _glewSearchExtension("EGL_KHR_cl_event2", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_cl_event2) EGLEW_KHR_cl_event2 = !_glewInit_EGL_KHR_cl_event2(); +#endif /* EGL_KHR_cl_event2 */ +#ifdef EGL_KHR_client_get_all_proc_addresses + EGLEW_KHR_client_get_all_proc_addresses = _glewSearchExtension("EGL_KHR_client_get_all_proc_addresses", extStart, extEnd); +#endif /* EGL_KHR_client_get_all_proc_addresses */ +#ifdef EGL_KHR_config_attribs + EGLEW_KHR_config_attribs = _glewSearchExtension("EGL_KHR_config_attribs", extStart, extEnd); +#endif /* EGL_KHR_config_attribs */ +#ifdef EGL_KHR_context_flush_control + EGLEW_KHR_context_flush_control = _glewSearchExtension("EGL_KHR_context_flush_control", extStart, extEnd); +#endif /* EGL_KHR_context_flush_control */ +#ifdef EGL_KHR_create_context + EGLEW_KHR_create_context = _glewSearchExtension("EGL_KHR_create_context", extStart, extEnd); +#endif /* EGL_KHR_create_context */ +#ifdef EGL_KHR_create_context_no_error + EGLEW_KHR_create_context_no_error = _glewSearchExtension("EGL_KHR_create_context_no_error", extStart, extEnd); +#endif /* EGL_KHR_create_context_no_error */ +#ifdef EGL_KHR_debug + EGLEW_KHR_debug = _glewSearchExtension("EGL_KHR_debug", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_debug) EGLEW_KHR_debug = !_glewInit_EGL_KHR_debug(); +#endif /* EGL_KHR_debug */ +#ifdef EGL_KHR_fence_sync + EGLEW_KHR_fence_sync = _glewSearchExtension("EGL_KHR_fence_sync", extStart, extEnd); +#endif /* EGL_KHR_fence_sync */ +#ifdef EGL_KHR_get_all_proc_addresses + EGLEW_KHR_get_all_proc_addresses = _glewSearchExtension("EGL_KHR_get_all_proc_addresses", extStart, extEnd); +#endif /* EGL_KHR_get_all_proc_addresses */ +#ifdef EGL_KHR_gl_colorspace + EGLEW_KHR_gl_colorspace = _glewSearchExtension("EGL_KHR_gl_colorspace", extStart, extEnd); +#endif /* EGL_KHR_gl_colorspace */ +#ifdef EGL_KHR_gl_renderbuffer_image + EGLEW_KHR_gl_renderbuffer_image = _glewSearchExtension("EGL_KHR_gl_renderbuffer_image", extStart, extEnd); +#endif /* EGL_KHR_gl_renderbuffer_image */ +#ifdef EGL_KHR_gl_texture_2D_image + EGLEW_KHR_gl_texture_2D_image = _glewSearchExtension("EGL_KHR_gl_texture_2D_image", extStart, extEnd); +#endif /* EGL_KHR_gl_texture_2D_image */ +#ifdef EGL_KHR_gl_texture_3D_image + EGLEW_KHR_gl_texture_3D_image = _glewSearchExtension("EGL_KHR_gl_texture_3D_image", extStart, extEnd); +#endif /* EGL_KHR_gl_texture_3D_image */ +#ifdef EGL_KHR_gl_texture_cubemap_image + EGLEW_KHR_gl_texture_cubemap_image = _glewSearchExtension("EGL_KHR_gl_texture_cubemap_image", extStart, extEnd); +#endif /* EGL_KHR_gl_texture_cubemap_image */ +#ifdef EGL_KHR_image + EGLEW_KHR_image = _glewSearchExtension("EGL_KHR_image", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_image) EGLEW_KHR_image = !_glewInit_EGL_KHR_image(); +#endif /* EGL_KHR_image */ +#ifdef EGL_KHR_image_base + EGLEW_KHR_image_base = _glewSearchExtension("EGL_KHR_image_base", extStart, extEnd); +#endif /* EGL_KHR_image_base */ +#ifdef EGL_KHR_image_pixmap + EGLEW_KHR_image_pixmap = _glewSearchExtension("EGL_KHR_image_pixmap", extStart, extEnd); +#endif /* EGL_KHR_image_pixmap */ +#ifdef EGL_KHR_lock_surface + EGLEW_KHR_lock_surface = _glewSearchExtension("EGL_KHR_lock_surface", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_lock_surface) EGLEW_KHR_lock_surface = !_glewInit_EGL_KHR_lock_surface(); +#endif /* EGL_KHR_lock_surface */ +#ifdef EGL_KHR_lock_surface2 + EGLEW_KHR_lock_surface2 = _glewSearchExtension("EGL_KHR_lock_surface2", extStart, extEnd); +#endif /* EGL_KHR_lock_surface2 */ +#ifdef EGL_KHR_lock_surface3 + EGLEW_KHR_lock_surface3 = _glewSearchExtension("EGL_KHR_lock_surface3", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_lock_surface3) EGLEW_KHR_lock_surface3 = !_glewInit_EGL_KHR_lock_surface3(); +#endif /* EGL_KHR_lock_surface3 */ +#ifdef EGL_KHR_mutable_render_buffer + EGLEW_KHR_mutable_render_buffer = _glewSearchExtension("EGL_KHR_mutable_render_buffer", extStart, extEnd); +#endif /* EGL_KHR_mutable_render_buffer */ +#ifdef EGL_KHR_no_config_context + EGLEW_KHR_no_config_context = _glewSearchExtension("EGL_KHR_no_config_context", extStart, extEnd); +#endif /* EGL_KHR_no_config_context */ +#ifdef EGL_KHR_partial_update + EGLEW_KHR_partial_update = _glewSearchExtension("EGL_KHR_partial_update", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_partial_update) EGLEW_KHR_partial_update = !_glewInit_EGL_KHR_partial_update(); +#endif /* EGL_KHR_partial_update */ +#ifdef EGL_KHR_platform_android + EGLEW_KHR_platform_android = _glewSearchExtension("EGL_KHR_platform_android", extStart, extEnd); +#endif /* EGL_KHR_platform_android */ +#ifdef EGL_KHR_platform_gbm + EGLEW_KHR_platform_gbm = _glewSearchExtension("EGL_KHR_platform_gbm", extStart, extEnd); +#endif /* EGL_KHR_platform_gbm */ +#ifdef EGL_KHR_platform_wayland + EGLEW_KHR_platform_wayland = _glewSearchExtension("EGL_KHR_platform_wayland", extStart, extEnd); +#endif /* EGL_KHR_platform_wayland */ +#ifdef EGL_KHR_platform_x11 + EGLEW_KHR_platform_x11 = _glewSearchExtension("EGL_KHR_platform_x11", extStart, extEnd); +#endif /* EGL_KHR_platform_x11 */ +#ifdef EGL_KHR_reusable_sync + EGLEW_KHR_reusable_sync = _glewSearchExtension("EGL_KHR_reusable_sync", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_reusable_sync) EGLEW_KHR_reusable_sync = !_glewInit_EGL_KHR_reusable_sync(); +#endif /* EGL_KHR_reusable_sync */ +#ifdef EGL_KHR_stream + EGLEW_KHR_stream = _glewSearchExtension("EGL_KHR_stream", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream) EGLEW_KHR_stream = !_glewInit_EGL_KHR_stream(); +#endif /* EGL_KHR_stream */ +#ifdef EGL_KHR_stream_attrib + EGLEW_KHR_stream_attrib = _glewSearchExtension("EGL_KHR_stream_attrib", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_attrib) EGLEW_KHR_stream_attrib = !_glewInit_EGL_KHR_stream_attrib(); +#endif /* EGL_KHR_stream_attrib */ +#ifdef EGL_KHR_stream_consumer_gltexture + EGLEW_KHR_stream_consumer_gltexture = _glewSearchExtension("EGL_KHR_stream_consumer_gltexture", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_consumer_gltexture) EGLEW_KHR_stream_consumer_gltexture = !_glewInit_EGL_KHR_stream_consumer_gltexture(); +#endif /* EGL_KHR_stream_consumer_gltexture */ +#ifdef EGL_KHR_stream_cross_process_fd + EGLEW_KHR_stream_cross_process_fd = _glewSearchExtension("EGL_KHR_stream_cross_process_fd", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_cross_process_fd) EGLEW_KHR_stream_cross_process_fd = !_glewInit_EGL_KHR_stream_cross_process_fd(); +#endif /* EGL_KHR_stream_cross_process_fd */ +#ifdef EGL_KHR_stream_fifo + EGLEW_KHR_stream_fifo = _glewSearchExtension("EGL_KHR_stream_fifo", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_fifo) EGLEW_KHR_stream_fifo = !_glewInit_EGL_KHR_stream_fifo(); +#endif /* EGL_KHR_stream_fifo */ +#ifdef EGL_KHR_stream_producer_aldatalocator + EGLEW_KHR_stream_producer_aldatalocator = _glewSearchExtension("EGL_KHR_stream_producer_aldatalocator", extStart, extEnd); +#endif /* EGL_KHR_stream_producer_aldatalocator */ +#ifdef EGL_KHR_stream_producer_eglsurface + EGLEW_KHR_stream_producer_eglsurface = _glewSearchExtension("EGL_KHR_stream_producer_eglsurface", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_producer_eglsurface) EGLEW_KHR_stream_producer_eglsurface = !_glewInit_EGL_KHR_stream_producer_eglsurface(); +#endif /* EGL_KHR_stream_producer_eglsurface */ +#ifdef EGL_KHR_surfaceless_context + EGLEW_KHR_surfaceless_context = _glewSearchExtension("EGL_KHR_surfaceless_context", extStart, extEnd); +#endif /* EGL_KHR_surfaceless_context */ +#ifdef EGL_KHR_swap_buffers_with_damage + EGLEW_KHR_swap_buffers_with_damage = _glewSearchExtension("EGL_KHR_swap_buffers_with_damage", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_swap_buffers_with_damage) EGLEW_KHR_swap_buffers_with_damage = !_glewInit_EGL_KHR_swap_buffers_with_damage(); +#endif /* EGL_KHR_swap_buffers_with_damage */ +#ifdef EGL_KHR_vg_parent_image + EGLEW_KHR_vg_parent_image = _glewSearchExtension("EGL_KHR_vg_parent_image", extStart, extEnd); +#endif /* EGL_KHR_vg_parent_image */ +#ifdef EGL_KHR_wait_sync + EGLEW_KHR_wait_sync = _glewSearchExtension("EGL_KHR_wait_sync", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_wait_sync) EGLEW_KHR_wait_sync = !_glewInit_EGL_KHR_wait_sync(); +#endif /* EGL_KHR_wait_sync */ +#ifdef EGL_MESA_drm_image + EGLEW_MESA_drm_image = _glewSearchExtension("EGL_MESA_drm_image", extStart, extEnd); + if (glewExperimental || EGLEW_MESA_drm_image) EGLEW_MESA_drm_image = !_glewInit_EGL_MESA_drm_image(); +#endif /* EGL_MESA_drm_image */ +#ifdef EGL_MESA_image_dma_buf_export + EGLEW_MESA_image_dma_buf_export = _glewSearchExtension("EGL_MESA_image_dma_buf_export", extStart, extEnd); + if (glewExperimental || EGLEW_MESA_image_dma_buf_export) EGLEW_MESA_image_dma_buf_export = !_glewInit_EGL_MESA_image_dma_buf_export(); +#endif /* EGL_MESA_image_dma_buf_export */ +#ifdef EGL_MESA_platform_gbm + EGLEW_MESA_platform_gbm = _glewSearchExtension("EGL_MESA_platform_gbm", extStart, extEnd); +#endif /* EGL_MESA_platform_gbm */ +#ifdef EGL_MESA_platform_surfaceless + EGLEW_MESA_platform_surfaceless = _glewSearchExtension("EGL_MESA_platform_surfaceless", extStart, extEnd); +#endif /* EGL_MESA_platform_surfaceless */ +#ifdef EGL_NOK_swap_region + EGLEW_NOK_swap_region = _glewSearchExtension("EGL_NOK_swap_region", extStart, extEnd); + if (glewExperimental || EGLEW_NOK_swap_region) EGLEW_NOK_swap_region = !_glewInit_EGL_NOK_swap_region(); +#endif /* EGL_NOK_swap_region */ +#ifdef EGL_NOK_swap_region2 + EGLEW_NOK_swap_region2 = _glewSearchExtension("EGL_NOK_swap_region2", extStart, extEnd); + if (glewExperimental || EGLEW_NOK_swap_region2) EGLEW_NOK_swap_region2 = !_glewInit_EGL_NOK_swap_region2(); +#endif /* EGL_NOK_swap_region2 */ +#ifdef EGL_NOK_texture_from_pixmap + EGLEW_NOK_texture_from_pixmap = _glewSearchExtension("EGL_NOK_texture_from_pixmap", extStart, extEnd); +#endif /* EGL_NOK_texture_from_pixmap */ +#ifdef EGL_NV_3dvision_surface + EGLEW_NV_3dvision_surface = _glewSearchExtension("EGL_NV_3dvision_surface", extStart, extEnd); +#endif /* EGL_NV_3dvision_surface */ +#ifdef EGL_NV_coverage_sample + EGLEW_NV_coverage_sample = _glewSearchExtension("EGL_NV_coverage_sample", extStart, extEnd); +#endif /* EGL_NV_coverage_sample */ +#ifdef EGL_NV_coverage_sample_resolve + EGLEW_NV_coverage_sample_resolve = _glewSearchExtension("EGL_NV_coverage_sample_resolve", extStart, extEnd); +#endif /* EGL_NV_coverage_sample_resolve */ +#ifdef EGL_NV_cuda_event + EGLEW_NV_cuda_event = _glewSearchExtension("EGL_NV_cuda_event", extStart, extEnd); +#endif /* EGL_NV_cuda_event */ +#ifdef EGL_NV_depth_nonlinear + EGLEW_NV_depth_nonlinear = _glewSearchExtension("EGL_NV_depth_nonlinear", extStart, extEnd); +#endif /* EGL_NV_depth_nonlinear */ +#ifdef EGL_NV_device_cuda + EGLEW_NV_device_cuda = _glewSearchExtension("EGL_NV_device_cuda", extStart, extEnd); +#endif /* EGL_NV_device_cuda */ +#ifdef EGL_NV_native_query + EGLEW_NV_native_query = _glewSearchExtension("EGL_NV_native_query", extStart, extEnd); + if (glewExperimental || EGLEW_NV_native_query) EGLEW_NV_native_query = !_glewInit_EGL_NV_native_query(); +#endif /* EGL_NV_native_query */ +#ifdef EGL_NV_post_convert_rounding + EGLEW_NV_post_convert_rounding = _glewSearchExtension("EGL_NV_post_convert_rounding", extStart, extEnd); +#endif /* EGL_NV_post_convert_rounding */ +#ifdef EGL_NV_post_sub_buffer + EGLEW_NV_post_sub_buffer = _glewSearchExtension("EGL_NV_post_sub_buffer", extStart, extEnd); + if (glewExperimental || EGLEW_NV_post_sub_buffer) EGLEW_NV_post_sub_buffer = !_glewInit_EGL_NV_post_sub_buffer(); +#endif /* EGL_NV_post_sub_buffer */ +#ifdef EGL_NV_robustness_video_memory_purge + EGLEW_NV_robustness_video_memory_purge = _glewSearchExtension("EGL_NV_robustness_video_memory_purge", extStart, extEnd); +#endif /* EGL_NV_robustness_video_memory_purge */ +#ifdef EGL_NV_stream_consumer_gltexture_yuv + EGLEW_NV_stream_consumer_gltexture_yuv = _glewSearchExtension("EGL_NV_stream_consumer_gltexture_yuv", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_consumer_gltexture_yuv) EGLEW_NV_stream_consumer_gltexture_yuv = !_glewInit_EGL_NV_stream_consumer_gltexture_yuv(); +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ +#ifdef EGL_NV_stream_cross_display + EGLEW_NV_stream_cross_display = _glewSearchExtension("EGL_NV_stream_cross_display", extStart, extEnd); +#endif /* EGL_NV_stream_cross_display */ +#ifdef EGL_NV_stream_cross_object + EGLEW_NV_stream_cross_object = _glewSearchExtension("EGL_NV_stream_cross_object", extStart, extEnd); +#endif /* EGL_NV_stream_cross_object */ +#ifdef EGL_NV_stream_cross_partition + EGLEW_NV_stream_cross_partition = _glewSearchExtension("EGL_NV_stream_cross_partition", extStart, extEnd); +#endif /* EGL_NV_stream_cross_partition */ +#ifdef EGL_NV_stream_cross_process + EGLEW_NV_stream_cross_process = _glewSearchExtension("EGL_NV_stream_cross_process", extStart, extEnd); +#endif /* EGL_NV_stream_cross_process */ +#ifdef EGL_NV_stream_cross_system + EGLEW_NV_stream_cross_system = _glewSearchExtension("EGL_NV_stream_cross_system", extStart, extEnd); +#endif /* EGL_NV_stream_cross_system */ +#ifdef EGL_NV_stream_fifo_next + EGLEW_NV_stream_fifo_next = _glewSearchExtension("EGL_NV_stream_fifo_next", extStart, extEnd); +#endif /* EGL_NV_stream_fifo_next */ +#ifdef EGL_NV_stream_fifo_synchronous + EGLEW_NV_stream_fifo_synchronous = _glewSearchExtension("EGL_NV_stream_fifo_synchronous", extStart, extEnd); +#endif /* EGL_NV_stream_fifo_synchronous */ +#ifdef EGL_NV_stream_frame_limits + EGLEW_NV_stream_frame_limits = _glewSearchExtension("EGL_NV_stream_frame_limits", extStart, extEnd); +#endif /* EGL_NV_stream_frame_limits */ +#ifdef EGL_NV_stream_metadata + EGLEW_NV_stream_metadata = _glewSearchExtension("EGL_NV_stream_metadata", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_metadata) EGLEW_NV_stream_metadata = !_glewInit_EGL_NV_stream_metadata(); +#endif /* EGL_NV_stream_metadata */ +#ifdef EGL_NV_stream_remote + EGLEW_NV_stream_remote = _glewSearchExtension("EGL_NV_stream_remote", extStart, extEnd); +#endif /* EGL_NV_stream_remote */ +#ifdef EGL_NV_stream_reset + EGLEW_NV_stream_reset = _glewSearchExtension("EGL_NV_stream_reset", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_reset) EGLEW_NV_stream_reset = !_glewInit_EGL_NV_stream_reset(); +#endif /* EGL_NV_stream_reset */ +#ifdef EGL_NV_stream_socket + EGLEW_NV_stream_socket = _glewSearchExtension("EGL_NV_stream_socket", extStart, extEnd); +#endif /* EGL_NV_stream_socket */ +#ifdef EGL_NV_stream_socket_inet + EGLEW_NV_stream_socket_inet = _glewSearchExtension("EGL_NV_stream_socket_inet", extStart, extEnd); +#endif /* EGL_NV_stream_socket_inet */ +#ifdef EGL_NV_stream_socket_unix + EGLEW_NV_stream_socket_unix = _glewSearchExtension("EGL_NV_stream_socket_unix", extStart, extEnd); +#endif /* EGL_NV_stream_socket_unix */ +#ifdef EGL_NV_stream_sync + EGLEW_NV_stream_sync = _glewSearchExtension("EGL_NV_stream_sync", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_sync) EGLEW_NV_stream_sync = !_glewInit_EGL_NV_stream_sync(); +#endif /* EGL_NV_stream_sync */ +#ifdef EGL_NV_sync + EGLEW_NV_sync = _glewSearchExtension("EGL_NV_sync", extStart, extEnd); + if (glewExperimental || EGLEW_NV_sync) EGLEW_NV_sync = !_glewInit_EGL_NV_sync(); +#endif /* EGL_NV_sync */ +#ifdef EGL_NV_system_time + EGLEW_NV_system_time = _glewSearchExtension("EGL_NV_system_time", extStart, extEnd); + if (glewExperimental || EGLEW_NV_system_time) EGLEW_NV_system_time = !_glewInit_EGL_NV_system_time(); +#endif /* EGL_NV_system_time */ +#ifdef EGL_TIZEN_image_native_buffer + EGLEW_TIZEN_image_native_buffer = _glewSearchExtension("EGL_TIZEN_image_native_buffer", extStart, extEnd); +#endif /* EGL_TIZEN_image_native_buffer */ +#ifdef EGL_TIZEN_image_native_surface + EGLEW_TIZEN_image_native_surface = _glewSearchExtension("EGL_TIZEN_image_native_surface", extStart, extEnd); +#endif /* EGL_TIZEN_image_native_surface */ + + return GLEW_OK; +} + +#elif defined(_WIN32) + +PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; + +PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; +PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; +PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; +PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; +PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; +PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; + +PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; +PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; +PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; +PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; + +PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; + +PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; + +PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; +PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; + +PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; +PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; +PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; +PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; +PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; + +PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; + +PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; +PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; +PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; + +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; + +PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; + +PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; +PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; + +PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; +PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; +PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; +PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; +PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; + +PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; + +PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; +PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; + +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; + +PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; +PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; + +PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; +PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; +PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; +PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; +PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; +PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; +PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; +PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; + +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; +PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; +PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; + +PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; +PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; +PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; + +PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; +PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; +PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; +PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; + +PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; +PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; +PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; +PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; +PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; +PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; +PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; +PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; + +PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; + +PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV = NULL; + +PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; +PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; +PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; +PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; +PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; + +PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; +PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; +PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; + +PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; +PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; +PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; +PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; +PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; +PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; + +PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; +PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; + +PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; +PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; +PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; +PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; +PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; + +PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; +PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; +PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; +PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; +PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; +PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; + +PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; +PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; +PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; +PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; +PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; +GLboolean __WGLEW_3DFX_multisample = GL_FALSE; +GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; +GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_context_flush_control = GL_FALSE; +GLboolean __WGLEW_ARB_create_context = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_no_error = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; +GLboolean __WGLEW_ARB_multisample = GL_FALSE; +GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __WGLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_colorspace = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __WGLEW_EXT_depth_float = GL_FALSE; +GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; +GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; +GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; +GLboolean __WGLEW_EXT_multisample = GL_FALSE; +GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; +GLboolean __WGLEW_I3D_gamma = GL_FALSE; +GLboolean __WGLEW_I3D_genlock = GL_FALSE; +GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; +GLboolean __WGLEW_NV_copy_image = GL_FALSE; +GLboolean __WGLEW_NV_delay_before_swap = GL_FALSE; +GLboolean __WGLEW_NV_float_buffer = GL_FALSE; +GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; +GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __WGLEW_NV_present_video = GL_FALSE; +GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; +GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_swap_group = GL_FALSE; +GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_NV_video_capture = GL_FALSE; +GLboolean __WGLEW_NV_video_output = GL_FALSE; +GLboolean __WGLEW_OML_sync_control = GL_FALSE; +#ifdef WGL_3DL_stereo_control + +static GLboolean _glewInit_WGL_3DL_stereo_control () +{ + GLboolean r = GL_FALSE; + + r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; + + return r; +} + +#endif /* WGL_3DL_stereo_control */ + +#ifdef WGL_AMD_gpu_association + +static GLboolean _glewInit_WGL_AMD_gpu_association () +{ + GLboolean r = GL_FALSE; + + r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; + r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; + r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; + r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; + r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* WGL_AMD_gpu_association */ + +#ifdef WGL_ARB_buffer_region + +static GLboolean _glewInit_WGL_ARB_buffer_region () +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; + r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; + r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; + r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_buffer_region */ + +#ifdef WGL_ARB_create_context + +static GLboolean _glewInit_WGL_ARB_create_context () +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_create_context */ + +#ifdef WGL_ARB_extensions_string + +static GLboolean _glewInit_WGL_ARB_extensions_string () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_extensions_string */ + +#ifdef WGL_ARB_make_current_read + +static GLboolean _glewInit_WGL_ARB_make_current_read () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; + r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_make_current_read */ + +#ifdef WGL_ARB_pbuffer + +static GLboolean _glewInit_WGL_ARB_pbuffer () +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; + r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; + r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; + r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; + r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pbuffer */ + +#ifdef WGL_ARB_pixel_format + +static GLboolean _glewInit_WGL_ARB_pixel_format () +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pixel_format */ + +#ifdef WGL_ARB_render_texture + +static GLboolean _glewInit_WGL_ARB_render_texture () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; + r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; + r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_render_texture */ + +#ifdef WGL_EXT_display_color_table + +static GLboolean _glewInit_WGL_EXT_display_color_table () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; + r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; + r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; + r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_display_color_table */ + +#ifdef WGL_EXT_extensions_string + +static GLboolean _glewInit_WGL_EXT_extensions_string () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_extensions_string */ + +#ifdef WGL_EXT_make_current_read + +static GLboolean _glewInit_WGL_EXT_make_current_read () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; + r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_make_current_read */ + +#ifdef WGL_EXT_pbuffer + +static GLboolean _glewInit_WGL_EXT_pbuffer () +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; + r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; + r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; + r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; + r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pbuffer */ + +#ifdef WGL_EXT_pixel_format + +static GLboolean _glewInit_WGL_EXT_pixel_format () +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pixel_format */ + +#ifdef WGL_EXT_swap_control + +static GLboolean _glewInit_WGL_EXT_swap_control () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; + r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_swap_control */ + +#ifdef WGL_I3D_digital_video_control + +static GLboolean _glewInit_WGL_I3D_digital_video_control () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; + r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_digital_video_control */ + +#ifdef WGL_I3D_gamma + +static GLboolean _glewInit_WGL_I3D_gamma () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; + r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; + r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; + r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_gamma */ + +#ifdef WGL_I3D_genlock + +static GLboolean _glewInit_WGL_I3D_genlock () +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; + r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; + r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; + r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; + r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; + r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_genlock */ + +#ifdef WGL_I3D_image_buffer + +static GLboolean _glewInit_WGL_I3D_image_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; + r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; + r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; + r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_image_buffer */ + +#ifdef WGL_I3D_swap_frame_lock + +static GLboolean _glewInit_WGL_I3D_swap_frame_lock () +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; + r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; + r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; + r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_lock */ + +#ifdef WGL_I3D_swap_frame_usage + +static GLboolean _glewInit_WGL_I3D_swap_frame_usage () +{ + GLboolean r = GL_FALSE; + + r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; + r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; + r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; + r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_usage */ + +#ifdef WGL_NV_DX_interop + +static GLboolean _glewInit_WGL_NV_DX_interop () +{ + GLboolean r = GL_FALSE; + + r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; + r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; + r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; + r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; + r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; + r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; + r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; + r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_DX_interop */ + +#ifdef WGL_NV_copy_image + +static GLboolean _glewInit_WGL_NV_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_copy_image */ + +#ifdef WGL_NV_delay_before_swap + +static GLboolean _glewInit_WGL_NV_delay_before_swap () +{ + GLboolean r = GL_FALSE; + + r = ((wglDelayBeforeSwapNV = (PFNWGLDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"wglDelayBeforeSwapNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_delay_before_swap */ + +#ifdef WGL_NV_gpu_affinity + +static GLboolean _glewInit_WGL_NV_gpu_affinity () +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; + r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; + r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; + r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; + r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_gpu_affinity */ + +#ifdef WGL_NV_present_video + +static GLboolean _glewInit_WGL_NV_present_video () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; + r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_present_video */ + +#ifdef WGL_NV_swap_group + +static GLboolean _glewInit_WGL_NV_swap_group () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; + r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; + r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; + r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; + r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_swap_group */ + +#ifdef WGL_NV_vertex_array_range + +static GLboolean _glewInit_WGL_NV_vertex_array_range () +{ + GLboolean r = GL_FALSE; + + r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; + r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_vertex_array_range */ + +#ifdef WGL_NV_video_capture + +static GLboolean _glewInit_WGL_NV_video_capture () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_capture */ + +#ifdef WGL_NV_video_output + +static GLboolean _glewInit_WGL_NV_video_output () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; + r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; + r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; + r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; + r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_output */ + +#ifdef WGL_OML_sync_control + +static GLboolean _glewInit_WGL_OML_sync_control () +{ + GLboolean r = GL_FALSE; + + r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; + r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; + r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; + r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; + r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; + r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY wglewInit () +{ + GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; +#ifdef WGL_3DFX_multisample + WGLEW_3DFX_multisample = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); +#endif /* WGL_3DFX_multisample */ +#ifdef WGL_3DL_stereo_control + WGLEW_3DL_stereo_control = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) WGLEW_3DL_stereo_control= !_glewInit_WGL_3DL_stereo_control(); +#endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + WGLEW_AMD_gpu_association = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) WGLEW_AMD_gpu_association= !_glewInit_WGL_AMD_gpu_association(); +#endif /* WGL_AMD_gpu_association */ +#ifdef WGL_ARB_buffer_region + WGLEW_ARB_buffer_region = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) WGLEW_ARB_buffer_region= !_glewInit_WGL_ARB_buffer_region(); +#endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_context_flush_control + WGLEW_ARB_context_flush_control = _glewSearchExtension("WGL_ARB_context_flush_control", extStart, extEnd); +#endif /* WGL_ARB_context_flush_control */ +#ifdef WGL_ARB_create_context + WGLEW_ARB_create_context = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_create_context|| crippled) WGLEW_ARB_create_context= !_glewInit_WGL_ARB_create_context(); +#endif /* WGL_ARB_create_context */ +#ifdef WGL_ARB_create_context_no_error + WGLEW_ARB_create_context_no_error = _glewSearchExtension("WGL_ARB_create_context_no_error", extStart, extEnd); +#endif /* WGL_ARB_create_context_no_error */ +#ifdef WGL_ARB_create_context_profile + WGLEW_ARB_create_context_profile = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); +#endif /* WGL_ARB_create_context_profile */ +#ifdef WGL_ARB_create_context_robustness + WGLEW_ARB_create_context_robustness = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); +#endif /* WGL_ARB_create_context_robustness */ +#ifdef WGL_ARB_extensions_string + WGLEW_ARB_extensions_string = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(); +#endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_framebuffer_sRGB + WGLEW_ARB_framebuffer_sRGB = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_ARB_framebuffer_sRGB */ +#ifdef WGL_ARB_make_current_read + WGLEW_ARB_make_current_read = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) WGLEW_ARB_make_current_read= !_glewInit_WGL_ARB_make_current_read(); +#endif /* WGL_ARB_make_current_read */ +#ifdef WGL_ARB_multisample + WGLEW_ARB_multisample = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); +#endif /* WGL_ARB_multisample */ +#ifdef WGL_ARB_pbuffer + WGLEW_ARB_pbuffer = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(); +#endif /* WGL_ARB_pbuffer */ +#ifdef WGL_ARB_pixel_format + WGLEW_ARB_pixel_format = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(); +#endif /* WGL_ARB_pixel_format */ +#ifdef WGL_ARB_pixel_format_float + WGLEW_ARB_pixel_format_float = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); +#endif /* WGL_ARB_pixel_format_float */ +#ifdef WGL_ARB_render_texture + WGLEW_ARB_render_texture = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(); +#endif /* WGL_ARB_render_texture */ +#ifdef WGL_ARB_robustness_application_isolation + WGLEW_ARB_robustness_application_isolation = _glewSearchExtension("WGL_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* WGL_ARB_robustness_application_isolation */ +#ifdef WGL_ARB_robustness_share_group_isolation + WGLEW_ARB_robustness_share_group_isolation = _glewSearchExtension("WGL_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* WGL_ARB_robustness_share_group_isolation */ +#ifdef WGL_ATI_pixel_format_float + WGLEW_ATI_pixel_format_float = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); +#endif /* WGL_ATI_pixel_format_float */ +#ifdef WGL_ATI_render_texture_rectangle + WGLEW_ATI_render_texture_rectangle = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_colorspace + WGLEW_EXT_colorspace = _glewSearchExtension("WGL_EXT_colorspace", extStart, extEnd); +#endif /* WGL_EXT_colorspace */ +#ifdef WGL_EXT_create_context_es2_profile + WGLEW_EXT_create_context_es2_profile = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es2_profile */ +#ifdef WGL_EXT_create_context_es_profile + WGLEW_EXT_create_context_es_profile = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es_profile */ +#ifdef WGL_EXT_depth_float + WGLEW_EXT_depth_float = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); +#endif /* WGL_EXT_depth_float */ +#ifdef WGL_EXT_display_color_table + WGLEW_EXT_display_color_table = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) WGLEW_EXT_display_color_table= !_glewInit_WGL_EXT_display_color_table(); +#endif /* WGL_EXT_display_color_table */ +#ifdef WGL_EXT_extensions_string + WGLEW_EXT_extensions_string = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(); +#endif /* WGL_EXT_extensions_string */ +#ifdef WGL_EXT_framebuffer_sRGB + WGLEW_EXT_framebuffer_sRGB = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_EXT_framebuffer_sRGB */ +#ifdef WGL_EXT_make_current_read + WGLEW_EXT_make_current_read = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) WGLEW_EXT_make_current_read= !_glewInit_WGL_EXT_make_current_read(); +#endif /* WGL_EXT_make_current_read */ +#ifdef WGL_EXT_multisample + WGLEW_EXT_multisample = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); +#endif /* WGL_EXT_multisample */ +#ifdef WGL_EXT_pbuffer + WGLEW_EXT_pbuffer = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) WGLEW_EXT_pbuffer= !_glewInit_WGL_EXT_pbuffer(); +#endif /* WGL_EXT_pbuffer */ +#ifdef WGL_EXT_pixel_format + WGLEW_EXT_pixel_format = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) WGLEW_EXT_pixel_format= !_glewInit_WGL_EXT_pixel_format(); +#endif /* WGL_EXT_pixel_format */ +#ifdef WGL_EXT_pixel_format_packed_float + WGLEW_EXT_pixel_format_packed_float = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); +#endif /* WGL_EXT_pixel_format_packed_float */ +#ifdef WGL_EXT_swap_control + WGLEW_EXT_swap_control = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(); +#endif /* WGL_EXT_swap_control */ +#ifdef WGL_EXT_swap_control_tear + WGLEW_EXT_swap_control_tear = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); +#endif /* WGL_EXT_swap_control_tear */ +#ifdef WGL_I3D_digital_video_control + WGLEW_I3D_digital_video_control = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) WGLEW_I3D_digital_video_control= !_glewInit_WGL_I3D_digital_video_control(); +#endif /* WGL_I3D_digital_video_control */ +#ifdef WGL_I3D_gamma + WGLEW_I3D_gamma = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) WGLEW_I3D_gamma= !_glewInit_WGL_I3D_gamma(); +#endif /* WGL_I3D_gamma */ +#ifdef WGL_I3D_genlock + WGLEW_I3D_genlock = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) WGLEW_I3D_genlock= !_glewInit_WGL_I3D_genlock(); +#endif /* WGL_I3D_genlock */ +#ifdef WGL_I3D_image_buffer + WGLEW_I3D_image_buffer = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) WGLEW_I3D_image_buffer= !_glewInit_WGL_I3D_image_buffer(); +#endif /* WGL_I3D_image_buffer */ +#ifdef WGL_I3D_swap_frame_lock + WGLEW_I3D_swap_frame_lock = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) WGLEW_I3D_swap_frame_lock= !_glewInit_WGL_I3D_swap_frame_lock(); +#endif /* WGL_I3D_swap_frame_lock */ +#ifdef WGL_I3D_swap_frame_usage + WGLEW_I3D_swap_frame_usage = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) WGLEW_I3D_swap_frame_usage= !_glewInit_WGL_I3D_swap_frame_usage(); +#endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_DX_interop + WGLEW_NV_DX_interop = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); + if (glewExperimental || WGLEW_NV_DX_interop|| crippled) WGLEW_NV_DX_interop= !_glewInit_WGL_NV_DX_interop(); +#endif /* WGL_NV_DX_interop */ +#ifdef WGL_NV_DX_interop2 + WGLEW_NV_DX_interop2 = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); +#endif /* WGL_NV_DX_interop2 */ +#ifdef WGL_NV_copy_image + WGLEW_NV_copy_image = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); + if (glewExperimental || WGLEW_NV_copy_image|| crippled) WGLEW_NV_copy_image= !_glewInit_WGL_NV_copy_image(); +#endif /* WGL_NV_copy_image */ +#ifdef WGL_NV_delay_before_swap + WGLEW_NV_delay_before_swap = _glewSearchExtension("WGL_NV_delay_before_swap", extStart, extEnd); + if (glewExperimental || WGLEW_NV_delay_before_swap|| crippled) WGLEW_NV_delay_before_swap= !_glewInit_WGL_NV_delay_before_swap(); +#endif /* WGL_NV_delay_before_swap */ +#ifdef WGL_NV_float_buffer + WGLEW_NV_float_buffer = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); +#endif /* WGL_NV_float_buffer */ +#ifdef WGL_NV_gpu_affinity + WGLEW_NV_gpu_affinity = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); + if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) WGLEW_NV_gpu_affinity= !_glewInit_WGL_NV_gpu_affinity(); +#endif /* WGL_NV_gpu_affinity */ +#ifdef WGL_NV_multisample_coverage + WGLEW_NV_multisample_coverage = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); +#endif /* WGL_NV_multisample_coverage */ +#ifdef WGL_NV_present_video + WGLEW_NV_present_video = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); + if (glewExperimental || WGLEW_NV_present_video|| crippled) WGLEW_NV_present_video= !_glewInit_WGL_NV_present_video(); +#endif /* WGL_NV_present_video */ +#ifdef WGL_NV_render_depth_texture + WGLEW_NV_render_depth_texture = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); +#endif /* WGL_NV_render_depth_texture */ +#ifdef WGL_NV_render_texture_rectangle + WGLEW_NV_render_texture_rectangle = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_swap_group + WGLEW_NV_swap_group = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); + if (glewExperimental || WGLEW_NV_swap_group|| crippled) WGLEW_NV_swap_group= !_glewInit_WGL_NV_swap_group(); +#endif /* WGL_NV_swap_group */ +#ifdef WGL_NV_vertex_array_range + WGLEW_NV_vertex_array_range = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) WGLEW_NV_vertex_array_range= !_glewInit_WGL_NV_vertex_array_range(); +#endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_capture + WGLEW_NV_video_capture = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_capture|| crippled) WGLEW_NV_video_capture= !_glewInit_WGL_NV_video_capture(); +#endif /* WGL_NV_video_capture */ +#ifdef WGL_NV_video_output + WGLEW_NV_video_output = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_output|| crippled) WGLEW_NV_video_output= !_glewInit_WGL_NV_video_output(); +#endif /* WGL_NV_video_output */ +#ifdef WGL_OML_sync_control + WGLEW_OML_sync_control = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) WGLEW_OML_sync_control= !_glewInit_WGL_OML_sync_control(); +#endif /* WGL_OML_sync_control */ + + return GLEW_OK; +} + +#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) + +PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; + +PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; +PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; +PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; +PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; +PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; +PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; +PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; +PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; +PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; +PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; +PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; +PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; +PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; +PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; +PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; +PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; +PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; + +PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD = NULL; +PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD = NULL; +PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD = NULL; +PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD = NULL; +PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD = NULL; +PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD = NULL; +PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD = NULL; +PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD = NULL; +PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD = NULL; + +PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; + +PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; +PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; +PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; + +PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; +PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; +PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; +PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; + +PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; + +PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; +PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; + +PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; + +PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; + +PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; + +PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA = NULL; +PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA = NULL; +PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA = NULL; +PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA = NULL; + +PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; + +PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; + +PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; +PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; + +PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV = NULL; +PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV = NULL; + +PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; + +PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV = NULL; + +PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; +PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; + +PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; +PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; +PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; +PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; +PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; +PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; + +PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; +PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; + +PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; +PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; +PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; +PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; +PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; + +PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; +PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; +PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; +PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; +PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; +PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; + +PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; +PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; +PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; +PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; +PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; + +PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; +PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; + +PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; +PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; +PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; +PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; + +PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; +PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; +PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; +PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; +PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; + +PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; + +PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; + +PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; +PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; +PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; +PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; +PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; + +PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; + +PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; +PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; + +PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; + +PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; +PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; + +PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; + +PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; +PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; +GLboolean __GLXEW_ARB_context_flush_control = GL_FALSE; +GLboolean __GLXEW_ARB_create_context = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_no_error = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; +GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_buffer_age = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; +GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_libglvnd = GL_FALSE; +GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_stereo_tree = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; +GLboolean __GLXEW_EXT_visual_info = GL_FALSE; +GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; +GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; +GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; +GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_query_renderer = GL_FALSE; +GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; +GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_MESA_swap_control = GL_FALSE; +GLboolean __GLXEW_NV_copy_buffer = GL_FALSE; +GLboolean __GLXEW_NV_copy_image = GL_FALSE; +GLboolean __GLXEW_NV_delay_before_swap = GL_FALSE; +GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLXEW_NV_present_video = GL_FALSE; +GLboolean __GLXEW_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __GLXEW_NV_swap_group = GL_FALSE; +GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_NV_video_capture = GL_FALSE; +GLboolean __GLXEW_NV_video_out = GL_FALSE; +GLboolean __GLXEW_OML_swap_method = GL_FALSE; +GLboolean __GLXEW_OML_sync_control = GL_FALSE; +GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; +GLboolean __GLXEW_SGIS_color_range = GL_FALSE; +GLboolean __GLXEW_SGIS_multisample = GL_FALSE; +GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; +GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; +GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; +GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; +GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; +GLboolean __GLXEW_SGI_cushion = GL_FALSE; +GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; +GLboolean __GLXEW_SGI_swap_control = GL_FALSE; +GLboolean __GLXEW_SGI_video_sync = GL_FALSE; +GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; +GLboolean __GLXEW_SUN_video_resize = GL_FALSE; +#ifdef GLX_VERSION_1_2 + +static GLboolean _glewInit_GLX_VERSION_1_2 () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_2 */ + +#ifdef GLX_VERSION_1_3 + +static GLboolean _glewInit_GLX_VERSION_1_3 () +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; + r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; + r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; + r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; + r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; + r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; + r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; + r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; + r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; + r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; + r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; + r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; + r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; + r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; + r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; + r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; + r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_3 */ + +#ifdef GLX_AMD_gpu_association + +static GLboolean _glewInit_GLX_AMD_gpu_association () +{ + GLboolean r = GL_FALSE; + + r = ((glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"glXBlitContextFramebufferAMD")) == NULL) || r; + r = ((glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAMD")) == NULL) || r; + r = ((glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXDeleteAssociatedContextAMD")) == NULL) || r; + r = ((glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetContextGPUIDAMD")) == NULL) || r; + r = ((glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUIDsAMD")) == NULL) || r; + r = ((glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUInfoAMD")) == NULL) || r; + r = ((glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"glXMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* GLX_AMD_gpu_association */ + +#ifdef GLX_ARB_create_context + +static GLboolean _glewInit_GLX_ARB_create_context () +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* GLX_ARB_create_context */ + +#ifdef GLX_ATI_render_texture + +static GLboolean _glewInit_GLX_ATI_render_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; + r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; + r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; + + return r; +} + +#endif /* GLX_ATI_render_texture */ + +#ifdef GLX_EXT_import_context + +static GLboolean _glewInit_GLX_EXT_import_context () +{ + GLboolean r = GL_FALSE; + + r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; + r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; + r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; + r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_import_context */ + +#ifdef GLX_EXT_swap_control + +static GLboolean _glewInit_GLX_EXT_swap_control () +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_swap_control */ + +#ifdef GLX_EXT_texture_from_pixmap + +static GLboolean _glewInit_GLX_EXT_texture_from_pixmap () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; + r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_texture_from_pixmap */ + +#ifdef GLX_MESA_agp_offset + +static GLboolean _glewInit_GLX_MESA_agp_offset () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_agp_offset */ + +#ifdef GLX_MESA_copy_sub_buffer + +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_copy_sub_buffer */ + +#ifdef GLX_MESA_pixmap_colormap + +static GLboolean _glewInit_GLX_MESA_pixmap_colormap () +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_pixmap_colormap */ + +#ifdef GLX_MESA_query_renderer + +static GLboolean _glewInit_GLX_MESA_query_renderer () +{ + GLboolean r = GL_FALSE; + + r = ((glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererIntegerMESA")) == NULL) || r; + r = ((glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererStringMESA")) == NULL) || r; + r = ((glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererIntegerMESA")) == NULL) || r; + r = ((glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererStringMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_query_renderer */ + +#ifdef GLX_MESA_release_buffers + +static GLboolean _glewInit_GLX_MESA_release_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_release_buffers */ + +#ifdef GLX_MESA_set_3dfx_mode + +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode () +{ + GLboolean r = GL_FALSE; + + r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_set_3dfx_mode */ + +#ifdef GLX_MESA_swap_control + +static GLboolean _glewInit_GLX_MESA_swap_control () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; + r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_swap_control */ + +#ifdef GLX_NV_copy_buffer + +static GLboolean _glewInit_GLX_NV_copy_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyBufferSubDataNV")) == NULL) || r; + r = ((glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXNamedCopyBufferSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_buffer */ + +#ifdef GLX_NV_copy_image + +static GLboolean _glewInit_GLX_NV_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_image */ + +#ifdef GLX_NV_delay_before_swap + +static GLboolean _glewInit_GLX_NV_delay_before_swap () +{ + GLboolean r = GL_FALSE; + + r = ((glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"glXDelayBeforeSwapNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_delay_before_swap */ + +#ifdef GLX_NV_present_video + +static GLboolean _glewInit_GLX_NV_present_video () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_present_video */ + +#ifdef GLX_NV_swap_group + +static GLboolean _glewInit_GLX_NV_swap_group () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; + r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; + r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; + r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; + r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_swap_group */ + +#ifdef GLX_NV_vertex_array_range + +static GLboolean _glewInit_GLX_NV_vertex_array_range () +{ + GLboolean r = GL_FALSE; + + r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; + r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_vertex_array_range */ + +#ifdef GLX_NV_video_capture + +static GLboolean _glewInit_GLX_NV_video_capture () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_capture */ + +#ifdef GLX_NV_video_out + +static GLboolean _glewInit_GLX_NV_video_out () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; + r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; + r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; + r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; + r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_out */ + +#ifdef GLX_OML_sync_control + +static GLboolean _glewInit_GLX_OML_sync_control () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; + r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; + r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; + r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; + r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* GLX_OML_sync_control */ + +#ifdef GLX_SGIX_fbconfig + +static GLboolean _glewInit_GLX_SGIX_fbconfig () +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; + r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; + r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; + r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; + r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; + r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_fbconfig */ + +#ifdef GLX_SGIX_hyperpipe + +static GLboolean _glewInit_GLX_SGIX_hyperpipe () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; + r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_hyperpipe */ + +#ifdef GLX_SGIX_pbuffer + +static GLboolean _glewInit_GLX_SGIX_pbuffer () +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; + r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; + r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; + r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; + r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_pbuffer */ + +#ifdef GLX_SGIX_swap_barrier + +static GLboolean _glewInit_GLX_SGIX_swap_barrier () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; + r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_barrier */ + +#ifdef GLX_SGIX_swap_group + +static GLboolean _glewInit_GLX_SGIX_swap_group () +{ + GLboolean r = GL_FALSE; + + r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_group */ + +#ifdef GLX_SGIX_video_resize + +static GLboolean _glewInit_GLX_SGIX_video_resize () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; + r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; + r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; + r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; + r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_video_resize */ + +#ifdef GLX_SGI_cushion + +static GLboolean _glewInit_GLX_SGI_cushion () +{ + GLboolean r = GL_FALSE; + + r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_cushion */ + +#ifdef GLX_SGI_make_current_read + +static GLboolean _glewInit_GLX_SGI_make_current_read () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; + r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_make_current_read */ + +#ifdef GLX_SGI_swap_control + +static GLboolean _glewInit_GLX_SGI_swap_control () +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_swap_control */ + +#ifdef GLX_SGI_video_sync + +static GLboolean _glewInit_GLX_SGI_video_sync () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; + r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_video_sync */ + +#ifdef GLX_SUN_get_transparent_index + +static GLboolean _glewInit_GLX_SUN_get_transparent_index () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_get_transparent_index */ + +#ifdef GLX_SUN_video_resize + +static GLboolean _glewInit_GLX_SUN_video_resize () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; + r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum glxewInit () +{ + Display* display; + int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* check for a display */ + display = glXGetCurrentDisplay(); + if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY; + /* initialize flags */ + GLXEW_VERSION_1_0 = GL_TRUE; + GLXEW_VERSION_1_1 = GL_TRUE; + GLXEW_VERSION_1_2 = GL_TRUE; + GLXEW_VERSION_1_3 = GL_TRUE; + GLXEW_VERSION_1_4 = GL_TRUE; + /* query GLX version */ + glXQueryVersion(display, &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + GLXEW_VERSION_1_4 = GL_FALSE; + break; + case 2: + GLXEW_VERSION_1_4 = GL_FALSE; + GLXEW_VERSION_1_3 = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ +#ifdef GLX_VERSION_1_3 + if (glewExperimental || GLXEW_VERSION_1_3) GLXEW_VERSION_1_3 = !_glewInit_GLX_VERSION_1_3(); +#endif /* GLX_VERSION_1_3 */ +#ifdef GLX_3DFX_multisample + GLXEW_3DFX_multisample = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); +#endif /* GLX_3DFX_multisample */ +#ifdef GLX_AMD_gpu_association + GLXEW_AMD_gpu_association = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || GLXEW_AMD_gpu_association) GLXEW_AMD_gpu_association = !_glewInit_GLX_AMD_gpu_association(); +#endif /* GLX_AMD_gpu_association */ +#ifdef GLX_ARB_context_flush_control + GLXEW_ARB_context_flush_control = _glewSearchExtension("GLX_ARB_context_flush_control", extStart, extEnd); +#endif /* GLX_ARB_context_flush_control */ +#ifdef GLX_ARB_create_context + GLXEW_ARB_create_context = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); + if (glewExperimental || GLXEW_ARB_create_context) GLXEW_ARB_create_context = !_glewInit_GLX_ARB_create_context(); +#endif /* GLX_ARB_create_context */ +#ifdef GLX_ARB_create_context_no_error + GLXEW_ARB_create_context_no_error = _glewSearchExtension("GLX_ARB_create_context_no_error", extStart, extEnd); +#endif /* GLX_ARB_create_context_no_error */ +#ifdef GLX_ARB_create_context_profile + GLXEW_ARB_create_context_profile = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); +#endif /* GLX_ARB_create_context_profile */ +#ifdef GLX_ARB_create_context_robustness + GLXEW_ARB_create_context_robustness = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); +#endif /* GLX_ARB_create_context_robustness */ +#ifdef GLX_ARB_fbconfig_float + GLXEW_ARB_fbconfig_float = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); +#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_framebuffer_sRGB + GLXEW_ARB_framebuffer_sRGB = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_ARB_framebuffer_sRGB */ +#ifdef GLX_ARB_get_proc_address + GLXEW_ARB_get_proc_address = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); +#endif /* GLX_ARB_get_proc_address */ +#ifdef GLX_ARB_multisample + GLXEW_ARB_multisample = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); +#endif /* GLX_ARB_multisample */ +#ifdef GLX_ARB_robustness_application_isolation + GLXEW_ARB_robustness_application_isolation = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_application_isolation */ +#ifdef GLX_ARB_robustness_share_group_isolation + GLXEW_ARB_robustness_share_group_isolation = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_share_group_isolation */ +#ifdef GLX_ARB_vertex_buffer_object + GLXEW_ARB_vertex_buffer_object = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); +#endif /* GLX_ARB_vertex_buffer_object */ +#ifdef GLX_ATI_pixel_format_float + GLXEW_ATI_pixel_format_float = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); +#endif /* GLX_ATI_pixel_format_float */ +#ifdef GLX_ATI_render_texture + GLXEW_ATI_render_texture = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); + if (glewExperimental || GLXEW_ATI_render_texture) GLXEW_ATI_render_texture = !_glewInit_GLX_ATI_render_texture(); +#endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_buffer_age + GLXEW_EXT_buffer_age = _glewSearchExtension("GLX_EXT_buffer_age", extStart, extEnd); +#endif /* GLX_EXT_buffer_age */ +#ifdef GLX_EXT_create_context_es2_profile + GLXEW_EXT_create_context_es2_profile = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es2_profile */ +#ifdef GLX_EXT_create_context_es_profile + GLXEW_EXT_create_context_es_profile = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es_profile */ +#ifdef GLX_EXT_fbconfig_packed_float + GLXEW_EXT_fbconfig_packed_float = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); +#endif /* GLX_EXT_fbconfig_packed_float */ +#ifdef GLX_EXT_framebuffer_sRGB + GLXEW_EXT_framebuffer_sRGB = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_EXT_framebuffer_sRGB */ +#ifdef GLX_EXT_import_context + GLXEW_EXT_import_context = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_import_context) GLXEW_EXT_import_context = !_glewInit_GLX_EXT_import_context(); +#endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_libglvnd + GLXEW_EXT_libglvnd = _glewSearchExtension("GLX_EXT_libglvnd", extStart, extEnd); +#endif /* GLX_EXT_libglvnd */ +#ifdef GLX_EXT_scene_marker + GLXEW_EXT_scene_marker = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); +#endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_stereo_tree + GLXEW_EXT_stereo_tree = _glewSearchExtension("GLX_EXT_stereo_tree", extStart, extEnd); +#endif /* GLX_EXT_stereo_tree */ +#ifdef GLX_EXT_swap_control + GLXEW_EXT_swap_control = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_swap_control) GLXEW_EXT_swap_control = !_glewInit_GLX_EXT_swap_control(); +#endif /* GLX_EXT_swap_control */ +#ifdef GLX_EXT_swap_control_tear + GLXEW_EXT_swap_control_tear = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); +#endif /* GLX_EXT_swap_control_tear */ +#ifdef GLX_EXT_texture_from_pixmap + GLXEW_EXT_texture_from_pixmap = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_texture_from_pixmap) GLXEW_EXT_texture_from_pixmap = !_glewInit_GLX_EXT_texture_from_pixmap(); +#endif /* GLX_EXT_texture_from_pixmap */ +#ifdef GLX_EXT_visual_info + GLXEW_EXT_visual_info = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); +#endif /* GLX_EXT_visual_info */ +#ifdef GLX_EXT_visual_rating + GLXEW_EXT_visual_rating = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); +#endif /* GLX_EXT_visual_rating */ +#ifdef GLX_INTEL_swap_event + GLXEW_INTEL_swap_event = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); +#endif /* GLX_INTEL_swap_event */ +#ifdef GLX_MESA_agp_offset + GLXEW_MESA_agp_offset = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_agp_offset) GLXEW_MESA_agp_offset = !_glewInit_GLX_MESA_agp_offset(); +#endif /* GLX_MESA_agp_offset */ +#ifdef GLX_MESA_copy_sub_buffer + GLXEW_MESA_copy_sub_buffer = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) GLXEW_MESA_copy_sub_buffer = !_glewInit_GLX_MESA_copy_sub_buffer(); +#endif /* GLX_MESA_copy_sub_buffer */ +#ifdef GLX_MESA_pixmap_colormap + GLXEW_MESA_pixmap_colormap = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) GLXEW_MESA_pixmap_colormap = !_glewInit_GLX_MESA_pixmap_colormap(); +#endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_query_renderer + GLXEW_MESA_query_renderer = _glewSearchExtension("GLX_MESA_query_renderer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_query_renderer) GLXEW_MESA_query_renderer = !_glewInit_GLX_MESA_query_renderer(); +#endif /* GLX_MESA_query_renderer */ +#ifdef GLX_MESA_release_buffers + GLXEW_MESA_release_buffers = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_release_buffers) GLXEW_MESA_release_buffers = !_glewInit_GLX_MESA_release_buffers(); +#endif /* GLX_MESA_release_buffers */ +#ifdef GLX_MESA_set_3dfx_mode + GLXEW_MESA_set_3dfx_mode = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) GLXEW_MESA_set_3dfx_mode = !_glewInit_GLX_MESA_set_3dfx_mode(); +#endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + GLXEW_MESA_swap_control = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_swap_control) GLXEW_MESA_swap_control = !_glewInit_GLX_MESA_swap_control(); +#endif /* GLX_MESA_swap_control */ +#ifdef GLX_NV_copy_buffer + GLXEW_NV_copy_buffer = _glewSearchExtension("GLX_NV_copy_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_buffer) GLXEW_NV_copy_buffer = !_glewInit_GLX_NV_copy_buffer(); +#endif /* GLX_NV_copy_buffer */ +#ifdef GLX_NV_copy_image + GLXEW_NV_copy_image = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_image) GLXEW_NV_copy_image = !_glewInit_GLX_NV_copy_image(); +#endif /* GLX_NV_copy_image */ +#ifdef GLX_NV_delay_before_swap + GLXEW_NV_delay_before_swap = _glewSearchExtension("GLX_NV_delay_before_swap", extStart, extEnd); + if (glewExperimental || GLXEW_NV_delay_before_swap) GLXEW_NV_delay_before_swap = !_glewInit_GLX_NV_delay_before_swap(); +#endif /* GLX_NV_delay_before_swap */ +#ifdef GLX_NV_float_buffer + GLXEW_NV_float_buffer = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); +#endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_multisample_coverage + GLXEW_NV_multisample_coverage = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); +#endif /* GLX_NV_multisample_coverage */ +#ifdef GLX_NV_present_video + GLXEW_NV_present_video = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); + if (glewExperimental || GLXEW_NV_present_video) GLXEW_NV_present_video = !_glewInit_GLX_NV_present_video(); +#endif /* GLX_NV_present_video */ +#ifdef GLX_NV_robustness_video_memory_purge + GLXEW_NV_robustness_video_memory_purge = _glewSearchExtension("GLX_NV_robustness_video_memory_purge", extStart, extEnd); +#endif /* GLX_NV_robustness_video_memory_purge */ +#ifdef GLX_NV_swap_group + GLXEW_NV_swap_group = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_NV_swap_group) GLXEW_NV_swap_group = !_glewInit_GLX_NV_swap_group(); +#endif /* GLX_NV_swap_group */ +#ifdef GLX_NV_vertex_array_range + GLXEW_NV_vertex_array_range = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLXEW_NV_vertex_array_range) GLXEW_NV_vertex_array_range = !_glewInit_GLX_NV_vertex_array_range(); +#endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_NV_video_capture + GLXEW_NV_video_capture = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_capture) GLXEW_NV_video_capture = !_glewInit_GLX_NV_video_capture(); +#endif /* GLX_NV_video_capture */ +#ifdef GLX_NV_video_out + GLXEW_NV_video_out = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_out) GLXEW_NV_video_out = !_glewInit_GLX_NV_video_out(); +#endif /* GLX_NV_video_out */ +#ifdef GLX_OML_swap_method + GLXEW_OML_swap_method = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); +#endif /* GLX_OML_swap_method */ +#ifdef GLX_OML_sync_control + GLXEW_OML_sync_control = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); + if (glewExperimental || GLXEW_OML_sync_control) GLXEW_OML_sync_control = !_glewInit_GLX_OML_sync_control(); +#endif /* GLX_OML_sync_control */ +#ifdef GLX_SGIS_blended_overlay + GLXEW_SGIS_blended_overlay = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); +#endif /* GLX_SGIS_blended_overlay */ +#ifdef GLX_SGIS_color_range + GLXEW_SGIS_color_range = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); +#endif /* GLX_SGIS_color_range */ +#ifdef GLX_SGIS_multisample + GLXEW_SGIS_multisample = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); +#endif /* GLX_SGIS_multisample */ +#ifdef GLX_SGIS_shared_multisample + GLXEW_SGIS_shared_multisample = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); +#endif /* GLX_SGIS_shared_multisample */ +#ifdef GLX_SGIX_fbconfig + GLXEW_SGIX_fbconfig = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_fbconfig) GLXEW_SGIX_fbconfig = !_glewInit_GLX_SGIX_fbconfig(); +#endif /* GLX_SGIX_fbconfig */ +#ifdef GLX_SGIX_hyperpipe + GLXEW_SGIX_hyperpipe = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_hyperpipe) GLXEW_SGIX_hyperpipe = !_glewInit_GLX_SGIX_hyperpipe(); +#endif /* GLX_SGIX_hyperpipe */ +#ifdef GLX_SGIX_pbuffer + GLXEW_SGIX_pbuffer = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_pbuffer) GLXEW_SGIX_pbuffer = !_glewInit_GLX_SGIX_pbuffer(); +#endif /* GLX_SGIX_pbuffer */ +#ifdef GLX_SGIX_swap_barrier + GLXEW_SGIX_swap_barrier = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_barrier) GLXEW_SGIX_swap_barrier = !_glewInit_GLX_SGIX_swap_barrier(); +#endif /* GLX_SGIX_swap_barrier */ +#ifdef GLX_SGIX_swap_group + GLXEW_SGIX_swap_group = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_group) GLXEW_SGIX_swap_group = !_glewInit_GLX_SGIX_swap_group(); +#endif /* GLX_SGIX_swap_group */ +#ifdef GLX_SGIX_video_resize + GLXEW_SGIX_video_resize = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_video_resize) GLXEW_SGIX_video_resize = !_glewInit_GLX_SGIX_video_resize(); +#endif /* GLX_SGIX_video_resize */ +#ifdef GLX_SGIX_visual_select_group + GLXEW_SGIX_visual_select_group = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); +#endif /* GLX_SGIX_visual_select_group */ +#ifdef GLX_SGI_cushion + GLXEW_SGI_cushion = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_cushion) GLXEW_SGI_cushion = !_glewInit_GLX_SGI_cushion(); +#endif /* GLX_SGI_cushion */ +#ifdef GLX_SGI_make_current_read + GLXEW_SGI_make_current_read = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_make_current_read) GLXEW_SGI_make_current_read = !_glewInit_GLX_SGI_make_current_read(); +#endif /* GLX_SGI_make_current_read */ +#ifdef GLX_SGI_swap_control + GLXEW_SGI_swap_control = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_swap_control) GLXEW_SGI_swap_control = !_glewInit_GLX_SGI_swap_control(); +#endif /* GLX_SGI_swap_control */ +#ifdef GLX_SGI_video_sync + GLXEW_SGI_video_sync = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_video_sync) GLXEW_SGI_video_sync = !_glewInit_GLX_SGI_video_sync(); +#endif /* GLX_SGI_video_sync */ +#ifdef GLX_SUN_get_transparent_index + GLXEW_SUN_get_transparent_index = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_get_transparent_index) GLXEW_SUN_get_transparent_index = !_glewInit_GLX_SUN_get_transparent_index(); +#endif /* GLX_SUN_get_transparent_index */ +#ifdef GLX_SUN_video_resize + GLXEW_SUN_video_resize = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_video_resize) GLXEW_SUN_video_resize = !_glewInit_GLX_SUN_video_resize(); +#endif /* GLX_SUN_video_resize */ + + return GLEW_OK; +} + +#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ + +/* ------------------------------------------------------------------------ */ + +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(size_t)error > max_error ? max_error : (size_t)error]; +} + +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"2.1.0", + (const GLubyte*)"2", + (const GLubyte*)"1", + (const GLubyte*)"0" + }; + const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(size_t)name > max_string ? 0 : (size_t)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +GLenum GLEWAPIENTRY glewInit (void) +{ + GLenum r; +#if defined(GLEW_EGL) + PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL; +#endif + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(GLEW_EGL) + getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay"); + return eglewInit(getCurrentDisplay()); +#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__) + return r; +#elif defined(_WIN32) + return wglewInit(); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ + return glxewInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#if defined(_WIN32) && defined(GLEW_BUILD) && defined(__GNUC__) +/* GCC requires a DLL entry point even without any standard library included. */ +/* Types extracted from windows.h to avoid polluting the rest of the file. */ +int __stdcall DllMainCRTStartup(void* instance, unsigned reason, void* reserved) +{ + (void) instance; + (void) reason; + (void) reserved; + return 1; +} +#endif +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLEW_VERSION_1_2; + continue; + } +#endif +#ifdef GL_VERSION_1_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) + { + ret = GLEW_VERSION_1_2_1; + continue; + } +#endif +#ifdef GL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLEW_VERSION_1_3; + continue; + } +#endif +#ifdef GL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLEW_VERSION_1_4; + continue; + } +#endif +#ifdef GL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = GLEW_VERSION_1_5; + continue; + } +#endif +#ifdef GL_VERSION_2_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) + { + ret = GLEW_VERSION_2_0; + continue; + } +#endif +#ifdef GL_VERSION_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) + { + ret = GLEW_VERSION_2_1; + continue; + } +#endif +#ifdef GL_VERSION_3_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) + { + ret = GLEW_VERSION_3_0; + continue; + } +#endif +#ifdef GL_VERSION_3_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) + { + ret = GLEW_VERSION_3_1; + continue; + } +#endif +#ifdef GL_VERSION_3_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) + { + ret = GLEW_VERSION_3_2; + continue; + } +#endif +#ifdef GL_VERSION_3_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) + { + ret = GLEW_VERSION_3_3; + continue; + } +#endif +#ifdef GL_VERSION_4_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) + { + ret = GLEW_VERSION_4_0; + continue; + } +#endif +#ifdef GL_VERSION_4_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) + { + ret = GLEW_VERSION_4_1; + continue; + } +#endif +#ifdef GL_VERSION_4_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) + { + ret = GLEW_VERSION_4_2; + continue; + } +#endif +#ifdef GL_VERSION_4_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) + { + ret = GLEW_VERSION_4_3; + continue; + } +#endif +#ifdef GL_VERSION_4_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_4", 3)) + { + ret = GLEW_VERSION_4_4; + continue; + } +#endif +#ifdef GL_VERSION_4_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_5", 3)) + { + ret = GLEW_VERSION_4_5; + continue; + } +#endif +#ifdef GL_VERSION_4_6 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_6", 3)) + { + ret = GLEW_VERSION_4_6; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_3DFX_multisample; + continue; + } +#endif +#ifdef GL_3DFX_tbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) + { + ret = GLEW_3DFX_tbuffer; + continue; + } +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) + { + ret = GLEW_3DFX_texture_compression_FXT1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GL_AMD_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_AMD_blend_minmax_factor; + continue; + } +#endif +#ifdef GL_AMD_compressed_3DC_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_3DC_texture", 22)) + { + ret = GLEW_AMD_compressed_3DC_texture; + continue; + } +#endif +#ifdef GL_AMD_compressed_ATC_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_ATC_texture", 22)) + { + ret = GLEW_AMD_compressed_ATC_texture; + continue; + } +#endif +#ifdef GL_AMD_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_AMD_conservative_depth; + continue; + } +#endif +#ifdef GL_AMD_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_AMD_debug_output; + continue; + } +#endif +#ifdef GL_AMD_depth_clamp_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) + { + ret = GLEW_AMD_depth_clamp_separate; + continue; + } +#endif +#ifdef GL_AMD_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_AMD_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_AMD_framebuffer_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sample_positions", 28)) + { + ret = GLEW_AMD_framebuffer_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_gcn_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gcn_shader", 10)) + { + ret = GLEW_AMD_gcn_shader; + continue; + } +#endif +#ifdef GL_AMD_gpu_shader_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_half_float", 21)) + { + ret = GLEW_AMD_gpu_shader_half_float; + continue; + } +#endif +#ifdef GL_AMD_gpu_shader_int16 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int16", 16)) + { + ret = GLEW_AMD_gpu_shader_int16; + continue; + } +#endif +#ifdef GL_AMD_gpu_shader_int64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) + { + ret = GLEW_AMD_gpu_shader_int64; + continue; + } +#endif +#ifdef GL_AMD_interleaved_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interleaved_elements", 20)) + { + ret = GLEW_AMD_interleaved_elements; + continue; + } +#endif +#ifdef GL_AMD_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_AMD_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_AMD_name_gen_delete + if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) + { + ret = GLEW_AMD_name_gen_delete; + continue; + } +#endif +#ifdef GL_AMD_occlusion_query_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query_event", 21)) + { + ret = GLEW_AMD_occlusion_query_event; + continue; + } +#endif +#ifdef GL_AMD_performance_monitor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) + { + ret = GLEW_AMD_performance_monitor; + continue; + } +#endif +#ifdef GL_AMD_pinned_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) + { + ret = GLEW_AMD_pinned_memory; + continue; + } +#endif +#ifdef GL_AMD_program_binary_Z400 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary_Z400", 19)) + { + ret = GLEW_AMD_program_binary_Z400; + continue; + } +#endif +#ifdef GL_AMD_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_AMD_query_buffer_object; + continue; + } +#endif +#ifdef GL_AMD_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) + { + ret = GLEW_AMD_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_AMD_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_AMD_shader_atomic_counter_ops + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) + { + ret = GLEW_AMD_shader_atomic_counter_ops; + continue; + } +#endif +#ifdef GL_AMD_shader_ballot + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_ballot", 13)) + { + ret = GLEW_AMD_shader_ballot; + continue; + } +#endif +#ifdef GL_AMD_shader_explicit_vertex_parameter + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_explicit_vertex_parameter", 32)) + { + ret = GLEW_AMD_shader_explicit_vertex_parameter; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_AMD_shader_stencil_export; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_value_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_value_export", 27)) + { + ret = GLEW_AMD_shader_stencil_value_export; + continue; + } +#endif +#ifdef GL_AMD_shader_trinary_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_trinary_minmax", 21)) + { + ret = GLEW_AMD_shader_trinary_minmax; + continue; + } +#endif +#ifdef GL_AMD_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_AMD_sparse_texture; + continue; + } +#endif +#ifdef GL_AMD_stencil_operation_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) + { + ret = GLEW_AMD_stencil_operation_extended; + continue; + } +#endif +#ifdef GL_AMD_texture_gather_bias_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather_bias_lod", 23)) + { + ret = GLEW_AMD_texture_gather_bias_lod; + continue; + } +#endif +#ifdef GL_AMD_texture_texture4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) + { + ret = GLEW_AMD_texture_texture4; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) + { + ret = GLEW_AMD_transform_feedback3_lines_triangles; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback4", 19)) + { + ret = GLEW_AMD_transform_feedback4; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_layer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) + { + ret = GLEW_AMD_vertex_shader_layer; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_tessellator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) + { + ret = GLEW_AMD_vertex_shader_tessellator; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) + { + ret = GLEW_AMD_vertex_shader_viewport_index; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANDROID_", 8)) + { +#ifdef GL_ANDROID_extension_pack_es31a + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_pack_es31a", 20)) + { + ret = GLEW_ANDROID_extension_pack_es31a; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) + { +#ifdef GL_ANGLE_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ANGLE_depth_texture; + continue; + } +#endif +#ifdef GL_ANGLE_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_ANGLE_framebuffer_blit; + continue; + } +#endif +#ifdef GL_ANGLE_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_ANGLE_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_ANGLE_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ANGLE_instanced_arrays; + continue; + } +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_reverse_row_order", 22)) + { + ret = GLEW_ANGLE_pack_reverse_row_order; + continue; + } +#endif +#ifdef GL_ANGLE_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary", 14)) + { + ret = GLEW_ANGLE_program_binary; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt3", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt3; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt5", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt5; + continue; + } +#endif +#ifdef GL_ANGLE_texture_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_usage", 13)) + { + ret = GLEW_ANGLE_texture_usage; + continue; + } +#endif +#ifdef GL_ANGLE_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ANGLE_timer_query; + continue; + } +#endif +#ifdef GL_ANGLE_translated_shader_source + if (_glewStrSame3(&pos, &len, (const GLubyte*)"translated_shader_source", 24)) + { + ret = GLEW_ANGLE_translated_shader_source; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) + { +#ifdef GL_APPLE_aux_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) + { + ret = GLEW_APPLE_aux_depth_stencil; + continue; + } +#endif +#ifdef GL_APPLE_client_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) + { + ret = GLEW_APPLE_client_storage; + continue; + } +#endif +#ifdef GL_APPLE_clip_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_distance", 13)) + { + ret = GLEW_APPLE_clip_distance; + continue; + } +#endif +#ifdef GL_APPLE_color_buffer_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_packed_float", 25)) + { + ret = GLEW_APPLE_color_buffer_packed_float; + continue; + } +#endif +#ifdef GL_APPLE_copy_texture_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture_levels", 19)) + { + ret = GLEW_APPLE_copy_texture_levels; + continue; + } +#endif +#ifdef GL_APPLE_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_APPLE_element_array; + continue; + } +#endif +#ifdef GL_APPLE_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_APPLE_fence; + continue; + } +#endif +#ifdef GL_APPLE_float_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) + { + ret = GLEW_APPLE_float_pixels; + continue; + } +#endif +#ifdef GL_APPLE_flush_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) + { + ret = GLEW_APPLE_flush_buffer_range; + continue; + } +#endif +#ifdef GL_APPLE_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_APPLE_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_APPLE_object_purgeable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) + { + ret = GLEW_APPLE_object_purgeable; + continue; + } +#endif +#ifdef GL_APPLE_pixel_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) + { + ret = GLEW_APPLE_pixel_buffer; + continue; + } +#endif +#ifdef GL_APPLE_rgb_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) + { + ret = GLEW_APPLE_rgb_422; + continue; + } +#endif +#ifdef GL_APPLE_row_bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) + { + ret = GLEW_APPLE_row_bytes; + continue; + } +#endif +#ifdef GL_APPLE_specular_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) + { + ret = GLEW_APPLE_specular_vector; + continue; + } +#endif +#ifdef GL_APPLE_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_APPLE_sync; + continue; + } +#endif +#ifdef GL_APPLE_texture_2D_limited_npot + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_2D_limited_npot", 23)) + { + ret = GLEW_APPLE_texture_2D_limited_npot; + continue; + } +#endif +#ifdef GL_APPLE_texture_format_BGRA8888 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_format_BGRA8888", 23)) + { + ret = GLEW_APPLE_texture_format_BGRA8888; + continue; + } +#endif +#ifdef GL_APPLE_texture_max_level + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_max_level", 17)) + { + ret = GLEW_APPLE_texture_max_level; + continue; + } +#endif +#ifdef GL_APPLE_texture_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_packed_float", 20)) + { + ret = GLEW_APPLE_texture_packed_float; + continue; + } +#endif +#ifdef GL_APPLE_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_APPLE_texture_range; + continue; + } +#endif +#ifdef GL_APPLE_transform_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) + { + ret = GLEW_APPLE_transform_hint; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_APPLE_vertex_array_object; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_APPLE_vertex_array_range; + continue; + } +#endif +#ifdef GL_APPLE_vertex_program_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) + { + ret = GLEW_APPLE_vertex_program_evaluators; + continue; + } +#endif +#ifdef GL_APPLE_ycbcr_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) + { + ret = GLEW_APPLE_ycbcr_422; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GL_ARB_ES2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) + { + ret = GLEW_ARB_ES2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_1_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_1_compatibility", 19)) + { + ret = GLEW_ARB_ES3_1_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_2_compatibility", 19)) + { + ret = GLEW_ARB_ES3_2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) + { + ret = GLEW_ARB_ES3_compatibility; + continue; + } +#endif +#ifdef GL_ARB_arrays_of_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) + { + ret = GLEW_ARB_arrays_of_arrays; + continue; + } +#endif +#ifdef GL_ARB_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_ARB_base_instance; + continue; + } +#endif +#ifdef GL_ARB_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_ARB_bindless_texture; + continue; + } +#endif +#ifdef GL_ARB_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_ARB_blend_func_extended; + continue; + } +#endif +#ifdef GL_ARB_buffer_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) + { + ret = GLEW_ARB_buffer_storage; + continue; + } +#endif +#ifdef GL_ARB_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = GLEW_ARB_cl_event; + continue; + } +#endif +#ifdef GL_ARB_clear_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) + { + ret = GLEW_ARB_clear_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_clear_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) + { + ret = GLEW_ARB_clear_texture; + continue; + } +#endif +#ifdef GL_ARB_clip_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_control", 12)) + { + ret = GLEW_ARB_clip_control; + continue; + } +#endif +#ifdef GL_ARB_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_ARB_color_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) + { + ret = GLEW_ARB_compatibility; + continue; + } +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) + { + ret = GLEW_ARB_compressed_texture_pixel_storage; + continue; + } +#endif +#ifdef GL_ARB_compute_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) + { + ret = GLEW_ARB_compute_shader; + continue; + } +#endif +#ifdef GL_ARB_compute_variable_group_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_variable_group_size", 27)) + { + ret = GLEW_ARB_compute_variable_group_size; + continue; + } +#endif +#ifdef GL_ARB_conditional_render_inverted + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render_inverted", 27)) + { + ret = GLEW_ARB_conditional_render_inverted; + continue; + } +#endif +#ifdef GL_ARB_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_ARB_conservative_depth; + continue; + } +#endif +#ifdef GL_ARB_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_ARB_copy_buffer; + continue; + } +#endif +#ifdef GL_ARB_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_ARB_copy_image; + continue; + } +#endif +#ifdef GL_ARB_cull_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_distance", 13)) + { + ret = GLEW_ARB_cull_distance; + continue; + } +#endif +#ifdef GL_ARB_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_ARB_debug_output; + continue; + } +#endif +#ifdef GL_ARB_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_ARB_depth_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_ARB_depth_clamp; + continue; + } +#endif +#ifdef GL_ARB_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ARB_depth_texture; + continue; + } +#endif +#ifdef GL_ARB_derivative_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"derivative_control", 18)) + { + ret = GLEW_ARB_derivative_control; + continue; + } +#endif +#ifdef GL_ARB_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_ARB_direct_state_access; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ARB_draw_buffers; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_ARB_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_ARB_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_ARB_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_ARB_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) + { + ret = GLEW_ARB_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_ARB_draw_instanced; + continue; + } +#endif +#ifdef GL_ARB_enhanced_layouts + if (_glewStrSame3(&pos, &len, (const GLubyte*)"enhanced_layouts", 16)) + { + ret = GLEW_ARB_enhanced_layouts; + continue; + } +#endif +#ifdef GL_ARB_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_ARB_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_ARB_explicit_uniform_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) + { + ret = GLEW_ARB_explicit_uniform_location; + continue; + } +#endif +#ifdef GL_ARB_fragment_coord_conventions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) + { + ret = GLEW_ARB_fragment_coord_conventions; + continue; + } +#endif +#ifdef GL_ARB_fragment_layer_viewport + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) + { + ret = GLEW_ARB_fragment_layer_viewport; + continue; + } +#endif +#ifdef GL_ARB_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_ARB_fragment_program; + continue; + } +#endif +#ifdef GL_ARB_fragment_program_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) + { + ret = GLEW_ARB_fragment_program_shadow; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ARB_fragment_shader; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader_interlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) + { + ret = GLEW_ARB_fragment_shader_interlock; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_no_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) + { + ret = GLEW_ARB_framebuffer_no_attachments; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_ARB_framebuffer_object; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_ARB_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_ARB_geometry_shader4; + continue; + } +#endif +#ifdef GL_ARB_get_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) + { + ret = GLEW_ARB_get_program_binary; + continue; + } +#endif +#ifdef GL_ARB_get_texture_sub_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_texture_sub_image", 21)) + { + ret = GLEW_ARB_get_texture_sub_image; + continue; + } +#endif +#ifdef GL_ARB_gl_spirv + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_spirv", 8)) + { + ret = GLEW_ARB_gl_spirv; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_ARB_gpu_shader5; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) + { + ret = GLEW_ARB_gpu_shader_fp64; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_int64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) + { + ret = GLEW_ARB_gpu_shader_int64; + continue; + } +#endif +#ifdef GL_ARB_half_float_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) + { + ret = GLEW_ARB_half_float_pixel; + continue; + } +#endif +#ifdef GL_ARB_half_float_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) + { + ret = GLEW_ARB_half_float_vertex; + continue; + } +#endif +#ifdef GL_ARB_imaging + if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) + { + ret = GLEW_ARB_imaging; + continue; + } +#endif +#ifdef GL_ARB_indirect_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"indirect_parameters", 19)) + { + ret = GLEW_ARB_indirect_parameters; + continue; + } +#endif +#ifdef GL_ARB_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ARB_instanced_arrays; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) + { + ret = GLEW_ARB_internalformat_query; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) + { + ret = GLEW_ARB_internalformat_query2; + continue; + } +#endif +#ifdef GL_ARB_invalidate_subdata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) + { + ret = GLEW_ARB_invalidate_subdata; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_alignment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) + { + ret = GLEW_ARB_map_buffer_alignment; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_ARB_map_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_matrix_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) + { + ret = GLEW_ARB_matrix_palette; + continue; + } +#endif +#ifdef GL_ARB_multi_bind + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_bind", 10)) + { + ret = GLEW_ARB_multi_bind; + continue; + } +#endif +#ifdef GL_ARB_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_ARB_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_ARB_multisample; + continue; + } +#endif +#ifdef GL_ARB_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_ARB_multitexture; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_ARB_occlusion_query; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) + { + ret = GLEW_ARB_occlusion_query2; + continue; + } +#endif +#ifdef GL_ARB_parallel_shader_compile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_shader_compile", 23)) + { + ret = GLEW_ARB_parallel_shader_compile; + continue; + } +#endif +#ifdef GL_ARB_pipeline_statistics_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pipeline_statistics_query", 25)) + { + ret = GLEW_ARB_pipeline_statistics_query; + continue; + } +#endif +#ifdef GL_ARB_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_ARB_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_ARB_point_parameters; + continue; + } +#endif +#ifdef GL_ARB_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_ARB_point_sprite; + continue; + } +#endif +#ifdef GL_ARB_polygon_offset_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset_clamp", 20)) + { + ret = GLEW_ARB_polygon_offset_clamp; + continue; + } +#endif +#ifdef GL_ARB_post_depth_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) + { + ret = GLEW_ARB_post_depth_coverage; + continue; + } +#endif +#ifdef GL_ARB_program_interface_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) + { + ret = GLEW_ARB_program_interface_query; + continue; + } +#endif +#ifdef GL_ARB_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_ARB_provoking_vertex; + continue; + } +#endif +#ifdef GL_ARB_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_ARB_query_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_ARB_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_ARB_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_ARB_robustness; + continue; + } +#endif +#ifdef GL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GL_ARB_sample_locations + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) + { + ret = GLEW_ARB_sample_locations; + continue; + } +#endif +#ifdef GL_ARB_sample_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) + { + ret = GLEW_ARB_sample_shading; + continue; + } +#endif +#ifdef GL_ARB_sampler_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) + { + ret = GLEW_ARB_sampler_objects; + continue; + } +#endif +#ifdef GL_ARB_seamless_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) + { + ret = GLEW_ARB_seamless_cube_map; + continue; + } +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_ARB_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_ARB_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_ARB_separate_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counter_ops + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) + { + ret = GLEW_ARB_shader_atomic_counter_ops; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_ARB_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_ARB_shader_ballot + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_ballot", 13)) + { + ret = GLEW_ARB_shader_ballot; + continue; + } +#endif +#ifdef GL_ARB_shader_bit_encoding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) + { + ret = GLEW_ARB_shader_bit_encoding; + continue; + } +#endif +#ifdef GL_ARB_shader_clock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_clock", 12)) + { + ret = GLEW_ARB_shader_clock; + continue; + } +#endif +#ifdef GL_ARB_shader_draw_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_draw_parameters", 22)) + { + ret = GLEW_ARB_shader_draw_parameters; + continue; + } +#endif +#ifdef GL_ARB_shader_group_vote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) + { + ret = GLEW_ARB_shader_group_vote; + continue; + } +#endif +#ifdef GL_ARB_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_ARB_shader_image_load_store; + continue; + } +#endif +#ifdef GL_ARB_shader_image_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) + { + ret = GLEW_ARB_shader_image_size; + continue; + } +#endif +#ifdef GL_ARB_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) + { + ret = GLEW_ARB_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) + { + ret = GLEW_ARB_shader_precision; + continue; + } +#endif +#ifdef GL_ARB_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_ARB_shader_stencil_export; + continue; + } +#endif +#ifdef GL_ARB_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_ARB_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_shader_subroutine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) + { + ret = GLEW_ARB_shader_subroutine; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_image_samples + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_image_samples", 28)) + { + ret = GLEW_ARB_shader_texture_image_samples; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ARB_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ARB_shader_viewport_layer_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_viewport_layer_array", 27)) + { + ret = GLEW_ARB_shader_viewport_layer_array; + continue; + } +#endif +#ifdef GL_ARB_shading_language_100 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) + { + ret = GLEW_ARB_shading_language_100; + continue; + } +#endif +#ifdef GL_ARB_shading_language_420pack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) + { + ret = GLEW_ARB_shading_language_420pack; + continue; + } +#endif +#ifdef GL_ARB_shading_language_include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) + { + ret = GLEW_ARB_shading_language_include; + continue; + } +#endif +#ifdef GL_ARB_shading_language_packing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) + { + ret = GLEW_ARB_shading_language_packing; + continue; + } +#endif +#ifdef GL_ARB_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_ARB_shadow; + continue; + } +#endif +#ifdef GL_ARB_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_ARB_shadow_ambient; + continue; + } +#endif +#ifdef GL_ARB_sparse_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_buffer", 13)) + { + ret = GLEW_ARB_sparse_buffer; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_ARB_sparse_texture; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) + { + ret = GLEW_ARB_sparse_texture2; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture_clamp", 20)) + { + ret = GLEW_ARB_sparse_texture_clamp; + continue; + } +#endif +#ifdef GL_ARB_spirv_extensions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"spirv_extensions", 16)) + { + ret = GLEW_ARB_spirv_extensions; + continue; + } +#endif +#ifdef GL_ARB_stencil_texturing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) + { + ret = GLEW_ARB_stencil_texturing; + continue; + } +#endif +#ifdef GL_ARB_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_ARB_sync; + continue; + } +#endif +#ifdef GL_ARB_tessellation_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) + { + ret = GLEW_ARB_tessellation_shader; + continue; + } +#endif +#ifdef GL_ARB_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_ARB_texture_barrier; + continue; + } +#endif +#ifdef GL_ARB_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_ARB_texture_border_clamp; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_ARB_texture_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) + { + ret = GLEW_ARB_texture_buffer_object_rgb32; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) + { + ret = GLEW_ARB_texture_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_texture_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) + { + ret = GLEW_ARB_texture_compression; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_ARB_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_ARB_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_ARB_texture_cube_map; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_ARB_texture_cube_map_array; + continue; + } +#endif +#ifdef GL_ARB_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_ARB_texture_env_add; + continue; + } +#endif +#ifdef GL_ARB_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_ARB_texture_env_combine; + continue; + } +#endif +#ifdef GL_ARB_texture_env_crossbar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) + { + ret = GLEW_ARB_texture_env_crossbar; + continue; + } +#endif +#ifdef GL_ARB_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_ARB_texture_env_dot3; + continue; + } +#endif +#ifdef GL_ARB_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_ARB_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_ARB_texture_filter_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) + { + ret = GLEW_ARB_texture_filter_minmax; + continue; + } +#endif +#ifdef GL_ARB_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ARB_texture_float; + continue; + } +#endif +#ifdef GL_ARB_texture_gather + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) + { + ret = GLEW_ARB_texture_gather; + continue; + } +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp_to_edge", 28)) + { + ret = GLEW_ARB_texture_mirror_clamp_to_edge; + continue; + } +#endif +#ifdef GL_ARB_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_ARB_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_ARB_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_ARB_texture_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_non_power_of_two + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) + { + ret = GLEW_ARB_texture_non_power_of_two; + continue; + } +#endif +#ifdef GL_ARB_texture_query_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) + { + ret = GLEW_ARB_texture_query_levels; + continue; + } +#endif +#ifdef GL_ARB_texture_query_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) + { + ret = GLEW_ARB_texture_query_lod; + continue; + } +#endif +#ifdef GL_ARB_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_ARB_texture_rectangle; + continue; + } +#endif +#ifdef GL_ARB_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_ARB_texture_rg; + continue; + } +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) + { + ret = GLEW_ARB_texture_rgb10_a2ui; + continue; + } +#endif +#ifdef GL_ARB_texture_stencil8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stencil8", 16)) + { + ret = GLEW_ARB_texture_stencil8; + continue; + } +#endif +#ifdef GL_ARB_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_ARB_texture_storage; + continue; + } +#endif +#ifdef GL_ARB_texture_storage_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) + { + ret = GLEW_ARB_texture_storage_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_ARB_texture_swizzle; + continue; + } +#endif +#ifdef GL_ARB_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_ARB_texture_view; + continue; + } +#endif +#ifdef GL_ARB_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ARB_timer_query; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_ARB_transform_feedback2; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) + { + ret = GLEW_ARB_transform_feedback3; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) + { + ret = GLEW_ARB_transform_feedback_instanced; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_overflow_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_overflow_query", 33)) + { + ret = GLEW_ARB_transform_feedback_overflow_query; + continue; + } +#endif +#ifdef GL_ARB_transpose_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) + { + ret = GLEW_ARB_transpose_matrix; + continue; + } +#endif +#ifdef GL_ARB_uniform_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) + { + ret = GLEW_ARB_uniform_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_ARB_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ARB_vertex_array_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_ARB_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_binding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) + { + ret = GLEW_ARB_vertex_attrib_binding; + continue; + } +#endif +#ifdef GL_ARB_vertex_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) + { + ret = GLEW_ARB_vertex_blend; + continue; + } +#endif +#ifdef GL_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLEW_ARB_vertex_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_ARB_vertex_program; + continue; + } +#endif +#ifdef GL_ARB_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_ARB_vertex_shader; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_10f_11f_11f_rev", 27)) + { + ret = GLEW_ARB_vertex_type_10f_11f_11f_rev; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) + { + ret = GLEW_ARB_vertex_type_2_10_10_10_rev; + continue; + } +#endif +#ifdef GL_ARB_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_ARB_viewport_array; + continue; + } +#endif +#ifdef GL_ARB_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_ARB_window_pos; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARM_", 4)) + { +#ifdef GL_ARM_mali_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mali_program_binary", 19)) + { + ret = GLEW_ARM_mali_program_binary; + continue; + } +#endif +#ifdef GL_ARM_mali_shader_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mali_shader_binary", 18)) + { + ret = GLEW_ARM_mali_shader_binary; + continue; + } +#endif +#ifdef GL_ARM_rgba8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgba8", 5)) + { + ret = GLEW_ARM_rgba8; + continue; + } +#endif +#ifdef GL_ARM_shader_framebuffer_fetch + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch", 24)) + { + ret = GLEW_ARM_shader_framebuffer_fetch; + continue; + } +#endif +#ifdef GL_ARM_shader_framebuffer_fetch_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch_depth_stencil", 38)) + { + ret = GLEW_ARM_shader_framebuffer_fetch_depth_stencil; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) + { +#ifdef GL_ATIX_point_sprites + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) + { + ret = GLEW_ATIX_point_sprites; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATIX_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_route + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) + { + ret = GLEW_ATIX_texture_env_route; + continue; + } +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) + { + ret = GLEW_ATIX_vertex_shader_output_point_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GL_ATI_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ATI_draw_buffers; + continue; + } +#endif +#ifdef GL_ATI_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_ATI_element_array; + continue; + } +#endif +#ifdef GL_ATI_envmap_bumpmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) + { + ret = GLEW_ATI_envmap_bumpmap; + continue; + } +#endif +#ifdef GL_ATI_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ATI_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_map_object_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) + { + ret = GLEW_ATI_map_object_buffer; + continue; + } +#endif +#ifdef GL_ATI_meminfo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) + { + ret = GLEW_ATI_meminfo; + continue; + } +#endif +#ifdef GL_ATI_pn_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) + { + ret = GLEW_ATI_pn_triangles; + continue; + } +#endif +#ifdef GL_ATI_separate_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) + { + ret = GLEW_ATI_separate_stencil; + continue; + } +#endif +#ifdef GL_ATI_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ATI_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ATI_text_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) + { + ret = GLEW_ATI_text_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_texture_compression_3dc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) + { + ret = GLEW_ATI_texture_compression_3dc; + continue; + } +#endif +#ifdef GL_ATI_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATI_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATI_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ATI_texture_float; + continue; + } +#endif +#ifdef GL_ATI_texture_mirror_once + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) + { + ret = GLEW_ATI_texture_mirror_once; + continue; + } +#endif +#ifdef GL_ATI_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ATI_vertex_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_attrib_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) + { + ret = GLEW_ATI_vertex_attrib_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_streams + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) + { + ret = GLEW_ATI_vertex_streams; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EGL_", 4)) + { +#ifdef GL_EGL_KHR_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"KHR_context_flush_control", 25)) + { + ret = GLEW_EGL_KHR_context_flush_control; + continue; + } +#endif +#ifdef GL_EGL_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"NV_robustness_video_memory_purge", 32)) + { + ret = GLEW_EGL_NV_robustness_video_memory_purge; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GL_EXT_422_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) + { + ret = GLEW_EXT_422_pixels; + continue; + } +#endif +#ifdef GL_EXT_Cg_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) + { + ret = GLEW_EXT_Cg_shader; + continue; + } +#endif +#ifdef GL_EXT_EGL_image_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"EGL_image_array", 15)) + { + ret = GLEW_EXT_EGL_image_array; + continue; + } +#endif +#ifdef GL_EXT_YUV_target + if (_glewStrSame3(&pos, &len, (const GLubyte*)"YUV_target", 10)) + { + ret = GLEW_EXT_YUV_target; + continue; + } +#endif +#ifdef GL_EXT_abgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) + { + ret = GLEW_EXT_abgr; + continue; + } +#endif +#ifdef GL_EXT_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_EXT_base_instance; + continue; + } +#endif +#ifdef GL_EXT_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) + { + ret = GLEW_EXT_bgra; + continue; + } +#endif +#ifdef GL_EXT_bindable_uniform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) + { + ret = GLEW_EXT_bindable_uniform; + continue; + } +#endif +#ifdef GL_EXT_blend_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) + { + ret = GLEW_EXT_blend_color; + continue; + } +#endif +#ifdef GL_EXT_blend_equation_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) + { + ret = GLEW_EXT_blend_equation_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_EXT_blend_func_extended; + continue; + } +#endif +#ifdef GL_EXT_blend_func_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) + { + ret = GLEW_EXT_blend_func_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_logic_op + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) + { + ret = GLEW_EXT_blend_logic_op; + continue; + } +#endif +#ifdef GL_EXT_blend_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) + { + ret = GLEW_EXT_blend_minmax; + continue; + } +#endif +#ifdef GL_EXT_blend_subtract + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) + { + ret = GLEW_EXT_blend_subtract; + continue; + } +#endif +#ifdef GL_EXT_buffer_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) + { + ret = GLEW_EXT_buffer_storage; + continue; + } +#endif +#ifdef GL_EXT_clear_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) + { + ret = GLEW_EXT_clear_texture; + continue; + } +#endif +#ifdef GL_EXT_clip_cull_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_cull_distance", 18)) + { + ret = GLEW_EXT_clip_cull_distance; + continue; + } +#endif +#ifdef GL_EXT_clip_volume_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) + { + ret = GLEW_EXT_clip_volume_hint; + continue; + } +#endif +#ifdef GL_EXT_cmyka + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) + { + ret = GLEW_EXT_cmyka; + continue; + } +#endif +#ifdef GL_EXT_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_EXT_color_buffer_float; + continue; + } +#endif +#ifdef GL_EXT_color_buffer_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_half_float", 23)) + { + ret = GLEW_EXT_color_buffer_half_float; + continue; + } +#endif +#ifdef GL_EXT_color_subtable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) + { + ret = GLEW_EXT_color_subtable; + continue; + } +#endif +#ifdef GL_EXT_compiled_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) + { + ret = GLEW_EXT_compiled_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_compressed_ETC1_RGB8_sub_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_ETC1_RGB8_sub_texture", 32)) + { + ret = GLEW_EXT_compressed_ETC1_RGB8_sub_texture; + continue; + } +#endif +#ifdef GL_EXT_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_EXT_conservative_depth; + continue; + } +#endif +#ifdef GL_EXT_convolution + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) + { + ret = GLEW_EXT_convolution; + continue; + } +#endif +#ifdef GL_EXT_coordinate_frame + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) + { + ret = GLEW_EXT_coordinate_frame; + continue; + } +#endif +#ifdef GL_EXT_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_EXT_copy_image; + continue; + } +#endif +#ifdef GL_EXT_copy_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) + { + ret = GLEW_EXT_copy_texture; + continue; + } +#endif +#ifdef GL_EXT_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_EXT_cull_vertex; + continue; + } +#endif +#ifdef GL_EXT_debug_label + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_label", 11)) + { + ret = GLEW_EXT_debug_label; + continue; + } +#endif +#ifdef GL_EXT_debug_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) + { + ret = GLEW_EXT_debug_marker; + continue; + } +#endif +#ifdef GL_EXT_depth_bounds_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) + { + ret = GLEW_EXT_depth_bounds_test; + continue; + } +#endif +#ifdef GL_EXT_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_EXT_direct_state_access; + continue; + } +#endif +#ifdef GL_EXT_discard_framebuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"discard_framebuffer", 19)) + { + ret = GLEW_EXT_discard_framebuffer; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_EXT_draw_buffers; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) + { + ret = GLEW_EXT_draw_buffers2; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers_indexed + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_indexed", 20)) + { + ret = GLEW_EXT_draw_buffers_indexed; + continue; + } +#endif +#ifdef GL_EXT_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_EXT_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_EXT_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_EXT_draw_instanced; + continue; + } +#endif +#ifdef GL_EXT_draw_range_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) + { + ret = GLEW_EXT_draw_range_elements; + continue; + } +#endif +#ifdef GL_EXT_external_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"external_buffer", 15)) + { + ret = GLEW_EXT_external_buffer; + continue; + } +#endif +#ifdef GL_EXT_float_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_blend", 11)) + { + ret = GLEW_EXT_float_blend; + continue; + } +#endif +#ifdef GL_EXT_fog_coord + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) + { + ret = GLEW_EXT_fog_coord; + continue; + } +#endif +#ifdef GL_EXT_frag_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frag_depth", 10)) + { + ret = GLEW_EXT_frag_depth; + continue; + } +#endif +#ifdef GL_EXT_fragment_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) + { + ret = GLEW_EXT_fragment_lighting; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_EXT_framebuffer_blit; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_EXT_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) + { + ret = GLEW_EXT_framebuffer_multisample_blit_scaled; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_EXT_framebuffer_object; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_EXT_geometry_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_point_size", 19)) + { + ret = GLEW_EXT_geometry_point_size; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader", 15)) + { + ret = GLEW_EXT_geometry_shader; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_EXT_geometry_shader4; + continue; + } +#endif +#ifdef GL_EXT_gpu_program_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) + { + ret = GLEW_EXT_gpu_program_parameters; + continue; + } +#endif +#ifdef GL_EXT_gpu_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) + { + ret = GLEW_EXT_gpu_shader4; + continue; + } +#endif +#ifdef GL_EXT_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_EXT_gpu_shader5; + continue; + } +#endif +#ifdef GL_EXT_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) + { + ret = GLEW_EXT_histogram; + continue; + } +#endif +#ifdef GL_EXT_index_array_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) + { + ret = GLEW_EXT_index_array_formats; + continue; + } +#endif +#ifdef GL_EXT_index_func + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) + { + ret = GLEW_EXT_index_func; + continue; + } +#endif +#ifdef GL_EXT_index_material + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) + { + ret = GLEW_EXT_index_material; + continue; + } +#endif +#ifdef GL_EXT_index_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) + { + ret = GLEW_EXT_index_texture; + continue; + } +#endif +#ifdef GL_EXT_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_EXT_instanced_arrays; + continue; + } +#endif +#ifdef GL_EXT_light_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) + { + ret = GLEW_EXT_light_texture; + continue; + } +#endif +#ifdef GL_EXT_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_EXT_map_buffer_range; + continue; + } +#endif +#ifdef GL_EXT_memory_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"memory_object", 13)) + { + ret = GLEW_EXT_memory_object; + continue; + } +#endif +#ifdef GL_EXT_memory_object_fd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"memory_object_fd", 16)) + { + ret = GLEW_EXT_memory_object_fd; + continue; + } +#endif +#ifdef GL_EXT_memory_object_win32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"memory_object_win32", 19)) + { + ret = GLEW_EXT_memory_object_win32; + continue; + } +#endif +#ifdef GL_EXT_misc_attribute + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) + { + ret = GLEW_EXT_misc_attribute; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) + { + ret = GLEW_EXT_multi_draw_arrays; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_EXT_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_EXT_multiple_textures + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiple_textures", 17)) + { + ret = GLEW_EXT_multiple_textures; + continue; + } +#endif +#ifdef GL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_EXT_multisample; + continue; + } +#endif +#ifdef GL_EXT_multisample_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_compatibility", 25)) + { + ret = GLEW_EXT_multisample_compatibility; + continue; + } +#endif +#ifdef GL_EXT_multisampled_render_to_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisampled_render_to_texture", 30)) + { + ret = GLEW_EXT_multisampled_render_to_texture; + continue; + } +#endif +#ifdef GL_EXT_multisampled_render_to_texture2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisampled_render_to_texture2", 31)) + { + ret = GLEW_EXT_multisampled_render_to_texture2; + continue; + } +#endif +#ifdef GL_EXT_multiview_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview_draw_buffers", 22)) + { + ret = GLEW_EXT_multiview_draw_buffers; + continue; + } +#endif +#ifdef GL_EXT_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_EXT_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_EXT_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_EXT_packed_float; + continue; + } +#endif +#ifdef GL_EXT_packed_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) + { + ret = GLEW_EXT_packed_pixels; + continue; + } +#endif +#ifdef GL_EXT_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) + { + ret = GLEW_EXT_paletted_texture; + continue; + } +#endif +#ifdef GL_EXT_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_EXT_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) + { + ret = GLEW_EXT_pixel_transform; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) + { + ret = GLEW_EXT_pixel_transform_color_table; + continue; + } +#endif +#ifdef GL_EXT_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_EXT_point_parameters; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) + { + ret = GLEW_EXT_polygon_offset; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset_clamp", 20)) + { + ret = GLEW_EXT_polygon_offset_clamp; + continue; + } +#endif +#ifdef GL_EXT_post_depth_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) + { + ret = GLEW_EXT_post_depth_coverage; + continue; + } +#endif +#ifdef GL_EXT_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_EXT_provoking_vertex; + continue; + } +#endif +#ifdef GL_EXT_pvrtc_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pvrtc_sRGB", 10)) + { + ret = GLEW_EXT_pvrtc_sRGB; + continue; + } +#endif +#ifdef GL_EXT_raster_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"raster_multisample", 18)) + { + ret = GLEW_EXT_raster_multisample; + continue; + } +#endif +#ifdef GL_EXT_read_format_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format_bgra", 16)) + { + ret = GLEW_EXT_read_format_bgra; + continue; + } +#endif +#ifdef GL_EXT_render_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_snorm", 12)) + { + ret = GLEW_EXT_render_snorm; + continue; + } +#endif +#ifdef GL_EXT_rescale_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) + { + ret = GLEW_EXT_rescale_normal; + continue; + } +#endif +#ifdef GL_EXT_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sRGB", 4)) + { + ret = GLEW_EXT_sRGB; + continue; + } +#endif +#ifdef GL_EXT_sRGB_write_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sRGB_write_control", 18)) + { + ret = GLEW_EXT_sRGB_write_control; + continue; + } +#endif +#ifdef GL_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GL_EXT_secondary_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) + { + ret = GLEW_EXT_secondary_color; + continue; + } +#endif +#ifdef GL_EXT_semaphore + if (_glewStrSame3(&pos, &len, (const GLubyte*)"semaphore", 9)) + { + ret = GLEW_EXT_semaphore; + continue; + } +#endif +#ifdef GL_EXT_semaphore_fd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"semaphore_fd", 12)) + { + ret = GLEW_EXT_semaphore_fd; + continue; + } +#endif +#ifdef GL_EXT_semaphore_win32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"semaphore_win32", 15)) + { + ret = GLEW_EXT_semaphore_win32; + continue; + } +#endif +#ifdef GL_EXT_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_EXT_separate_shader_objects; + continue; + } +#endif +#ifdef GL_EXT_separate_specular_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) + { + ret = GLEW_EXT_separate_specular_color; + continue; + } +#endif +#ifdef GL_EXT_shader_framebuffer_fetch + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch", 24)) + { + ret = GLEW_EXT_shader_framebuffer_fetch; + continue; + } +#endif +#ifdef GL_EXT_shader_group_vote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) + { + ret = GLEW_EXT_shader_group_vote; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_formatted + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_formatted", 27)) + { + ret = GLEW_EXT_shader_image_load_formatted; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_EXT_shader_image_load_store; + continue; + } +#endif +#ifdef GL_EXT_shader_implicit_conversions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_implicit_conversions", 27)) + { + ret = GLEW_EXT_shader_implicit_conversions; + continue; + } +#endif +#ifdef GL_EXT_shader_integer_mix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_integer_mix", 18)) + { + ret = GLEW_EXT_shader_integer_mix; + continue; + } +#endif +#ifdef GL_EXT_shader_io_blocks + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_io_blocks", 16)) + { + ret = GLEW_EXT_shader_io_blocks; + continue; + } +#endif +#ifdef GL_EXT_shader_non_constant_global_initializers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_non_constant_global_initializers", 39)) + { + ret = GLEW_EXT_shader_non_constant_global_initializers; + continue; + } +#endif +#ifdef GL_EXT_shader_pixel_local_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_pixel_local_storage", 26)) + { + ret = GLEW_EXT_shader_pixel_local_storage; + continue; + } +#endif +#ifdef GL_EXT_shader_pixel_local_storage2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_pixel_local_storage2", 27)) + { + ret = GLEW_EXT_shader_pixel_local_storage2; + continue; + } +#endif +#ifdef GL_EXT_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_EXT_shader_texture_lod; + continue; + } +#endif +#ifdef GL_EXT_shadow_funcs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) + { + ret = GLEW_EXT_shadow_funcs; + continue; + } +#endif +#ifdef GL_EXT_shadow_samplers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_samplers", 15)) + { + ret = GLEW_EXT_shadow_samplers; + continue; + } +#endif +#ifdef GL_EXT_shared_texture_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) + { + ret = GLEW_EXT_shared_texture_palette; + continue; + } +#endif +#ifdef GL_EXT_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_EXT_sparse_texture; + continue; + } +#endif +#ifdef GL_EXT_sparse_texture2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) + { + ret = GLEW_EXT_sparse_texture2; + continue; + } +#endif +#ifdef GL_EXT_stencil_clear_tag + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) + { + ret = GLEW_EXT_stencil_clear_tag; + continue; + } +#endif +#ifdef GL_EXT_stencil_two_side + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) + { + ret = GLEW_EXT_stencil_two_side; + continue; + } +#endif +#ifdef GL_EXT_stencil_wrap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) + { + ret = GLEW_EXT_stencil_wrap; + continue; + } +#endif +#ifdef GL_EXT_subtexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) + { + ret = GLEW_EXT_subtexture; + continue; + } +#endif +#ifdef GL_EXT_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) + { + ret = GLEW_EXT_texture; + continue; + } +#endif +#ifdef GL_EXT_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) + { + ret = GLEW_EXT_texture3D; + continue; + } +#endif +#ifdef GL_EXT_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_EXT_texture_array; + continue; + } +#endif +#ifdef GL_EXT_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_EXT_texture_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_decode_mode", 36)) + { + ret = GLEW_EXT_texture_compression_astc_decode_mode; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_decode_mode_rgb9e5", 43)) + { + ret = GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_EXT_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_EXT_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_EXT_texture_compression_latc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_EXT_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_EXT_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_EXT_texture_cube_map; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_EXT_texture_cube_map_array; + continue; + } +#endif +#ifdef GL_EXT_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_EXT_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) + { + ret = GLEW_EXT_texture_env; + continue; + } +#endif +#ifdef GL_EXT_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_EXT_texture_env_add; + continue; + } +#endif +#ifdef GL_EXT_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_EXT_texture_env_combine; + continue; + } +#endif +#ifdef GL_EXT_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_EXT_texture_env_dot3; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_EXT_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) + { + ret = GLEW_EXT_texture_filter_minmax; + continue; + } +#endif +#ifdef GL_EXT_texture_format_BGRA8888 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_format_BGRA8888", 23)) + { + ret = GLEW_EXT_texture_format_BGRA8888; + continue; + } +#endif +#ifdef GL_EXT_texture_integer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) + { + ret = GLEW_EXT_texture_integer; + continue; + } +#endif +#ifdef GL_EXT_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_EXT_texture_lod_bias; + continue; + } +#endif +#ifdef GL_EXT_texture_mirror_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) + { + ret = GLEW_EXT_texture_mirror_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_norm16 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_norm16", 14)) + { + ret = GLEW_EXT_texture_norm16; + continue; + } +#endif +#ifdef GL_EXT_texture_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) + { + ret = GLEW_EXT_texture_object; + continue; + } +#endif +#ifdef GL_EXT_texture_perturb_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) + { + ret = GLEW_EXT_texture_perturb_normal; + continue; + } +#endif +#ifdef GL_EXT_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_EXT_texture_rectangle; + continue; + } +#endif +#ifdef GL_EXT_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_EXT_texture_rg; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) + { + ret = GLEW_EXT_texture_sRGB; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_R8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_R8", 15)) + { + ret = GLEW_EXT_texture_sRGB_R8; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_RG8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_RG8", 16)) + { + ret = GLEW_EXT_texture_sRGB_RG8; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_decode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) + { + ret = GLEW_EXT_texture_sRGB_decode; + continue; + } +#endif +#ifdef GL_EXT_texture_shared_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) + { + ret = GLEW_EXT_texture_shared_exponent; + continue; + } +#endif +#ifdef GL_EXT_texture_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) + { + ret = GLEW_EXT_texture_snorm; + continue; + } +#endif +#ifdef GL_EXT_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_EXT_texture_storage; + continue; + } +#endif +#ifdef GL_EXT_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_EXT_texture_swizzle; + continue; + } +#endif +#ifdef GL_EXT_texture_type_2_10_10_10_REV + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_type_2_10_10_10_REV", 27)) + { + ret = GLEW_EXT_texture_type_2_10_10_10_REV; + continue; + } +#endif +#ifdef GL_EXT_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_EXT_texture_view; + continue; + } +#endif +#ifdef GL_EXT_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_EXT_timer_query; + continue; + } +#endif +#ifdef GL_EXT_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_EXT_transform_feedback; + continue; + } +#endif +#ifdef GL_EXT_unpack_subimage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"unpack_subimage", 15)) + { + ret = GLEW_EXT_unpack_subimage; + continue; + } +#endif +#ifdef GL_EXT_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) + { + ret = GLEW_EXT_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_EXT_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_setXXX + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_setXXX", 19)) + { + ret = GLEW_EXT_vertex_array_setXXX; + continue; + } +#endif +#ifdef GL_EXT_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_EXT_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_EXT_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_EXT_vertex_shader; + continue; + } +#endif +#ifdef GL_EXT_vertex_weighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) + { + ret = GLEW_EXT_vertex_weighting; + continue; + } +#endif +#ifdef GL_EXT_win32_keyed_mutex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"win32_keyed_mutex", 17)) + { + ret = GLEW_EXT_win32_keyed_mutex; + continue; + } +#endif +#ifdef GL_EXT_window_rectangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_rectangles", 17)) + { + ret = GLEW_EXT_window_rectangles; + continue; + } +#endif +#ifdef GL_EXT_x11_sync_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) + { + ret = GLEW_EXT_x11_sync_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) + { +#ifdef GL_GREMEDY_frame_terminator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) + { + ret = GLEW_GREMEDY_frame_terminator; + continue; + } +#endif +#ifdef GL_GREMEDY_string_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) + { + ret = GLEW_GREMEDY_string_marker; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) + { +#ifdef GL_HP_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_HP_convolution_border_modes; + continue; + } +#endif +#ifdef GL_HP_image_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) + { + ret = GLEW_HP_image_transform; + continue; + } +#endif +#ifdef GL_HP_occlusion_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) + { + ret = GLEW_HP_occlusion_test; + continue; + } +#endif +#ifdef GL_HP_texture_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) + { + ret = GLEW_HP_texture_lighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) + { +#ifdef GL_IBM_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_IBM_cull_vertex; + continue; + } +#endif +#ifdef GL_IBM_multimode_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) + { + ret = GLEW_IBM_multimode_draw_arrays; + continue; + } +#endif +#ifdef GL_IBM_rasterpos_clip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) + { + ret = GLEW_IBM_rasterpos_clip; + continue; + } +#endif +#ifdef GL_IBM_static_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) + { + ret = GLEW_IBM_static_data; + continue; + } +#endif +#ifdef GL_IBM_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_IBM_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_IBM_vertex_array_lists + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) + { + ret = GLEW_IBM_vertex_array_lists; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) + { +#ifdef GL_INGR_color_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) + { + ret = GLEW_INGR_color_clamp; + continue; + } +#endif +#ifdef GL_INGR_interlace_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) + { + ret = GLEW_INGR_interlace_read; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GL_INTEL_conservative_rasterization + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_rasterization", 26)) + { + ret = GLEW_INTEL_conservative_rasterization; + continue; + } +#endif +#ifdef GL_INTEL_fragment_shader_ordering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_ordering", 24)) + { + ret = GLEW_INTEL_fragment_shader_ordering; + continue; + } +#endif +#ifdef GL_INTEL_framebuffer_CMAA + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_CMAA", 16)) + { + ret = GLEW_INTEL_framebuffer_CMAA; + continue; + } +#endif +#ifdef GL_INTEL_map_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_texture", 11)) + { + ret = GLEW_INTEL_map_texture; + continue; + } +#endif +#ifdef GL_INTEL_parallel_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) + { + ret = GLEW_INTEL_parallel_arrays; + continue; + } +#endif +#ifdef GL_INTEL_performance_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_query", 17)) + { + ret = GLEW_INTEL_performance_query; + continue; + } +#endif +#ifdef GL_INTEL_texture_scissor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) + { + ret = GLEW_INTEL_texture_scissor; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef GL_KHR_blend_equation_advanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) + { + ret = GLEW_KHR_blend_equation_advanced; + continue; + } +#endif +#ifdef GL_KHR_blend_equation_advanced_coherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) + { + ret = GLEW_KHR_blend_equation_advanced_coherent; + continue; + } +#endif +#ifdef GL_KHR_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = GLEW_KHR_context_flush_control; + continue; + } +#endif +#ifdef GL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = GLEW_KHR_debug; + continue; + } +#endif +#ifdef GL_KHR_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"no_error", 8)) + { + ret = GLEW_KHR_no_error; + continue; + } +#endif +#ifdef GL_KHR_parallel_shader_compile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_shader_compile", 23)) + { + ret = GLEW_KHR_parallel_shader_compile; + continue; + } +#endif +#ifdef GL_KHR_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_KHR_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_KHR_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_KHR_robustness; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_hdr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_hdr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_hdr; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_ldr; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_sliced_3d + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_sliced_3d", 34)) + { + ret = GLEW_KHR_texture_compression_astc_sliced_3d; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) + { +#ifdef GL_KTX_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = GLEW_KTX_buffer_region; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) + { +#ifdef GL_MESAX_texture_stack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) + { + ret = GLEW_MESAX_texture_stack; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GL_MESA_pack_invert + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) + { + ret = GLEW_MESA_pack_invert; + continue; + } +#endif +#ifdef GL_MESA_resize_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) + { + ret = GLEW_MESA_resize_buffers; + continue; + } +#endif +#ifdef GL_MESA_shader_integer_functions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_integer_functions", 24)) + { + ret = GLEW_MESA_shader_integer_functions; + continue; + } +#endif +#ifdef GL_MESA_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_MESA_window_pos; + continue; + } +#endif +#ifdef GL_MESA_ycbcr_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) + { + ret = GLEW_MESA_ycbcr_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) + { +#ifdef GL_NVX_blend_equation_advanced_multi_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_multi_draw_buffers", 42)) + { + ret = GLEW_NVX_blend_equation_advanced_multi_draw_buffers; + continue; + } +#endif +#ifdef GL_NVX_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NVX_conditional_render; + continue; + } +#endif +#ifdef GL_NVX_gpu_memory_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) + { + ret = GLEW_NVX_gpu_memory_info; + continue; + } +#endif +#ifdef GL_NVX_linked_gpu_multicast + if (_glewStrSame3(&pos, &len, (const GLubyte*)"linked_gpu_multicast", 20)) + { + ret = GLEW_NVX_linked_gpu_multicast; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GL_NV_3dvision_settings + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3dvision_settings", 17)) + { + ret = GLEW_NV_3dvision_settings; + continue; + } +#endif +#ifdef GL_NV_EGL_stream_consumer_external + if (_glewStrSame3(&pos, &len, (const GLubyte*)"EGL_stream_consumer_external", 28)) + { + ret = GLEW_NV_EGL_stream_consumer_external; + continue; + } +#endif +#ifdef GL_NV_alpha_to_coverage_dither_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"alpha_to_coverage_dither_control", 32)) + { + ret = GLEW_NV_alpha_to_coverage_dither_control; + continue; + } +#endif +#ifdef GL_NV_bgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgr", 3)) + { + ret = GLEW_NV_bgr; + continue; + } +#endif +#ifdef GL_NV_bindless_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect", 28)) + { + ret = GLEW_NV_bindless_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_NV_bindless_multi_draw_indirect_count + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect_count", 34)) + { + ret = GLEW_NV_bindless_multi_draw_indirect_count; + continue; + } +#endif +#ifdef GL_NV_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_NV_bindless_texture; + continue; + } +#endif +#ifdef GL_NV_blend_equation_advanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) + { + ret = GLEW_NV_blend_equation_advanced; + continue; + } +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) + { + ret = GLEW_NV_blend_equation_advanced_coherent; + continue; + } +#endif +#ifdef GL_NV_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_NV_blend_minmax_factor; + continue; + } +#endif +#ifdef GL_NV_blend_square + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) + { + ret = GLEW_NV_blend_square; + continue; + } +#endif +#ifdef GL_NV_clip_space_w_scaling + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_space_w_scaling", 20)) + { + ret = GLEW_NV_clip_space_w_scaling; + continue; + } +#endif +#ifdef GL_NV_command_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"command_list", 12)) + { + ret = GLEW_NV_command_list; + continue; + } +#endif +#ifdef GL_NV_compute_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_program5", 16)) + { + ret = GLEW_NV_compute_program5; + continue; + } +#endif +#ifdef GL_NV_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NV_conditional_render; + continue; + } +#endif +#ifdef GL_NV_conservative_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster", 19)) + { + ret = GLEW_NV_conservative_raster; + continue; + } +#endif +#ifdef GL_NV_conservative_raster_dilate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster_dilate", 26)) + { + ret = GLEW_NV_conservative_raster_dilate; + continue; + } +#endif +#ifdef GL_NV_conservative_raster_pre_snap_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster_pre_snap_triangles", 38)) + { + ret = GLEW_NV_conservative_raster_pre_snap_triangles; + continue; + } +#endif +#ifdef GL_NV_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_NV_copy_buffer; + continue; + } +#endif +#ifdef GL_NV_copy_depth_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) + { + ret = GLEW_NV_copy_depth_to_color; + continue; + } +#endif +#ifdef GL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_NV_copy_image; + continue; + } +#endif +#ifdef GL_NV_deep_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"deep_texture3D", 14)) + { + ret = GLEW_NV_deep_texture3D; + continue; + } +#endif +#ifdef GL_NV_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_NV_depth_buffer_float; + continue; + } +#endif +#ifdef GL_NV_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_NV_depth_clamp; + continue; + } +#endif +#ifdef GL_NV_depth_range_unclamped + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) + { + ret = GLEW_NV_depth_range_unclamped; + continue; + } +#endif +#ifdef GL_NV_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_NV_draw_buffers; + continue; + } +#endif +#ifdef GL_NV_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_NV_draw_instanced; + continue; + } +#endif +#ifdef GL_NV_draw_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_texture", 12)) + { + ret = GLEW_NV_draw_texture; + continue; + } +#endif +#ifdef GL_NV_draw_vulkan_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_vulkan_image", 17)) + { + ret = GLEW_NV_draw_vulkan_image; + continue; + } +#endif +#ifdef GL_NV_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) + { + ret = GLEW_NV_evaluators; + continue; + } +#endif +#ifdef GL_NV_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_NV_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_NV_explicit_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) + { + ret = GLEW_NV_explicit_multisample; + continue; + } +#endif +#ifdef GL_NV_fbo_color_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbo_color_attachments", 21)) + { + ret = GLEW_NV_fbo_color_attachments; + continue; + } +#endif +#ifdef GL_NV_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_NV_fence; + continue; + } +#endif +#ifdef GL_NV_fill_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fill_rectangle", 14)) + { + ret = GLEW_NV_fill_rectangle; + continue; + } +#endif +#ifdef GL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLEW_NV_float_buffer; + continue; + } +#endif +#ifdef GL_NV_fog_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) + { + ret = GLEW_NV_fog_distance; + continue; + } +#endif +#ifdef GL_NV_fragment_coverage_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coverage_to_color", 26)) + { + ret = GLEW_NV_fragment_coverage_to_color; + continue; + } +#endif +#ifdef GL_NV_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_NV_fragment_program; + continue; + } +#endif +#ifdef GL_NV_fragment_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) + { + ret = GLEW_NV_fragment_program2; + continue; + } +#endif +#ifdef GL_NV_fragment_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) + { + ret = GLEW_NV_fragment_program4; + continue; + } +#endif +#ifdef GL_NV_fragment_program_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) + { + ret = GLEW_NV_fragment_program_option; + continue; + } +#endif +#ifdef GL_NV_fragment_shader_interlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) + { + ret = GLEW_NV_fragment_shader_interlock; + continue; + } +#endif +#ifdef GL_NV_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_NV_framebuffer_blit; + continue; + } +#endif +#ifdef GL_NV_framebuffer_mixed_samples + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_mixed_samples", 25)) + { + ret = GLEW_NV_framebuffer_mixed_samples; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_NV_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) + { + ret = GLEW_NV_framebuffer_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_generate_mipmap_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap_sRGB", 20)) + { + ret = GLEW_NV_generate_mipmap_sRGB; + continue; + } +#endif +#ifdef GL_NV_geometry_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) + { + ret = GLEW_NV_geometry_program4; + continue; + } +#endif +#ifdef GL_NV_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_NV_geometry_shader4; + continue; + } +#endif +#ifdef GL_NV_geometry_shader_passthrough + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader_passthrough", 27)) + { + ret = GLEW_NV_geometry_shader_passthrough; + continue; + } +#endif +#ifdef GL_NV_gpu_multicast + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_multicast", 13)) + { + ret = GLEW_NV_gpu_multicast; + continue; + } +#endif +#ifdef GL_NV_gpu_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) + { + ret = GLEW_NV_gpu_program4; + continue; + } +#endif +#ifdef GL_NV_gpu_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) + { + ret = GLEW_NV_gpu_program5; + continue; + } +#endif +#ifdef GL_NV_gpu_program5_mem_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5_mem_extended", 25)) + { + ret = GLEW_NV_gpu_program5_mem_extended; + continue; + } +#endif +#ifdef GL_NV_gpu_program_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) + { + ret = GLEW_NV_gpu_program_fp64; + continue; + } +#endif +#ifdef GL_NV_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_NV_gpu_shader5; + continue; + } +#endif +#ifdef GL_NV_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) + { + ret = GLEW_NV_half_float; + continue; + } +#endif +#ifdef GL_NV_image_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_formats", 13)) + { + ret = GLEW_NV_image_formats; + continue; + } +#endif +#ifdef GL_NV_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_NV_instanced_arrays; + continue; + } +#endif +#ifdef GL_NV_internalformat_sample_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_sample_query", 27)) + { + ret = GLEW_NV_internalformat_sample_query; + continue; + } +#endif +#ifdef GL_NV_light_max_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) + { + ret = GLEW_NV_light_max_exponent; + continue; + } +#endif +#ifdef GL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_multisample_filter_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) + { + ret = GLEW_NV_multisample_filter_hint; + continue; + } +#endif +#ifdef GL_NV_non_square_matrices + if (_glewStrSame3(&pos, &len, (const GLubyte*)"non_square_matrices", 19)) + { + ret = GLEW_NV_non_square_matrices; + continue; + } +#endif +#ifdef GL_NV_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_NV_occlusion_query; + continue; + } +#endif +#ifdef GL_NV_pack_subimage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_subimage", 13)) + { + ret = GLEW_NV_pack_subimage; + continue; + } +#endif +#ifdef GL_NV_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_NV_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_NV_packed_float; + continue; + } +#endif +#ifdef GL_NV_packed_float_linear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float_linear", 19)) + { + ret = GLEW_NV_packed_float_linear; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) + { + ret = GLEW_NV_parameter_buffer_object; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) + { + ret = GLEW_NV_parameter_buffer_object2; + continue; + } +#endif +#ifdef GL_NV_path_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) + { + ret = GLEW_NV_path_rendering; + continue; + } +#endif +#ifdef GL_NV_path_rendering_shared_edge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering_shared_edge", 26)) + { + ret = GLEW_NV_path_rendering_shared_edge; + continue; + } +#endif +#ifdef GL_NV_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_NV_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_NV_pixel_data_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) + { + ret = GLEW_NV_pixel_data_range; + continue; + } +#endif +#ifdef GL_NV_platform_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_binary", 15)) + { + ret = GLEW_NV_platform_binary; + continue; + } +#endif +#ifdef GL_NV_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_NV_point_sprite; + continue; + } +#endif +#ifdef GL_NV_polygon_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_mode", 12)) + { + ret = GLEW_NV_polygon_mode; + continue; + } +#endif +#ifdef GL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLEW_NV_present_video; + continue; + } +#endif +#ifdef GL_NV_primitive_restart + if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) + { + ret = GLEW_NV_primitive_restart; + continue; + } +#endif +#ifdef GL_NV_read_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_depth", 10)) + { + ret = GLEW_NV_read_depth; + continue; + } +#endif +#ifdef GL_NV_read_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_depth_stencil", 18)) + { + ret = GLEW_NV_read_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_read_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_stencil", 12)) + { + ret = GLEW_NV_read_stencil; + continue; + } +#endif +#ifdef GL_NV_register_combiners + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) + { + ret = GLEW_NV_register_combiners; + continue; + } +#endif +#ifdef GL_NV_register_combiners2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) + { + ret = GLEW_NV_register_combiners2; + continue; + } +#endif +#ifdef GL_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_video_memory_purge", 29)) + { + ret = GLEW_NV_robustness_video_memory_purge; + continue; + } +#endif +#ifdef GL_NV_sRGB_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sRGB_formats", 12)) + { + ret = GLEW_NV_sRGB_formats; + continue; + } +#endif +#ifdef GL_NV_sample_locations + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) + { + ret = GLEW_NV_sample_locations; + continue; + } +#endif +#ifdef GL_NV_sample_mask_override_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_mask_override_coverage", 29)) + { + ret = GLEW_NV_sample_mask_override_coverage; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_NV_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) + { + ret = GLEW_NV_shader_atomic_float; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float64", 21)) + { + ret = GLEW_NV_shader_atomic_float64; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_fp16_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_fp16_vector", 25)) + { + ret = GLEW_NV_shader_atomic_fp16_vector; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_int64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_int64", 19)) + { + ret = GLEW_NV_shader_atomic_int64; + continue; + } +#endif +#ifdef GL_NV_shader_buffer_load + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) + { + ret = GLEW_NV_shader_buffer_load; + continue; + } +#endif +#ifdef GL_NV_shader_noperspective_interpolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_noperspective_interpolation", 34)) + { + ret = GLEW_NV_shader_noperspective_interpolation; + continue; + } +#endif +#ifdef GL_NV_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_NV_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_NV_shader_thread_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_group", 19)) + { + ret = GLEW_NV_shader_thread_group; + continue; + } +#endif +#ifdef GL_NV_shader_thread_shuffle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_shuffle", 21)) + { + ret = GLEW_NV_shader_thread_shuffle; + continue; + } +#endif +#ifdef GL_NV_shadow_samplers_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_samplers_array", 21)) + { + ret = GLEW_NV_shadow_samplers_array; + continue; + } +#endif +#ifdef GL_NV_shadow_samplers_cube + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_samplers_cube", 20)) + { + ret = GLEW_NV_shadow_samplers_cube; + continue; + } +#endif +#ifdef GL_NV_stereo_view_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_view_rendering", 21)) + { + ret = GLEW_NV_stereo_view_rendering; + continue; + } +#endif +#ifdef GL_NV_tessellation_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) + { + ret = GLEW_NV_tessellation_program5; + continue; + } +#endif +#ifdef GL_NV_texgen_emboss + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) + { + ret = GLEW_NV_texgen_emboss; + continue; + } +#endif +#ifdef GL_NV_texgen_reflection + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) + { + ret = GLEW_NV_texgen_reflection; + continue; + } +#endif +#ifdef GL_NV_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_NV_texture_array; + continue; + } +#endif +#ifdef GL_NV_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_NV_texture_barrier; + continue; + } +#endif +#ifdef GL_NV_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_NV_texture_border_clamp; + continue; + } +#endif +#ifdef GL_NV_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_NV_texture_compression_latc; + continue; + } +#endif +#ifdef GL_NV_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_NV_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_NV_texture_compression_s3tc_update + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc_update", 31)) + { + ret = GLEW_NV_texture_compression_s3tc_update; + continue; + } +#endif +#ifdef GL_NV_texture_compression_vtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) + { + ret = GLEW_NV_texture_compression_vtc; + continue; + } +#endif +#ifdef GL_NV_texture_env_combine4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) + { + ret = GLEW_NV_texture_env_combine4; + continue; + } +#endif +#ifdef GL_NV_texture_expand_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) + { + ret = GLEW_NV_texture_expand_normal; + continue; + } +#endif +#ifdef GL_NV_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_NV_texture_multisample; + continue; + } +#endif +#ifdef GL_NV_texture_npot_2D_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_npot_2D_mipmap", 22)) + { + ret = GLEW_NV_texture_npot_2D_mipmap; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_NV_texture_rectangle; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle_compressed + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle_compressed", 28)) + { + ret = GLEW_NV_texture_rectangle_compressed; + continue; + } +#endif +#ifdef GL_NV_texture_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) + { + ret = GLEW_NV_texture_shader; + continue; + } +#endif +#ifdef GL_NV_texture_shader2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) + { + ret = GLEW_NV_texture_shader2; + continue; + } +#endif +#ifdef GL_NV_texture_shader3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) + { + ret = GLEW_NV_texture_shader3; + continue; + } +#endif +#ifdef GL_NV_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_NV_transform_feedback; + continue; + } +#endif +#ifdef GL_NV_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_NV_transform_feedback2; + continue; + } +#endif +#ifdef GL_NV_uniform_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_unified_memory", 29)) + { + ret = GLEW_NV_uniform_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vdpau_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) + { + ret = GLEW_NV_vdpau_interop; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) + { + ret = GLEW_NV_vertex_array_range2; + continue; + } +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) + { + ret = GLEW_NV_vertex_attrib_integer_64bit; + continue; + } +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) + { + ret = GLEW_NV_vertex_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_NV_vertex_program; + continue; + } +#endif +#ifdef GL_NV_vertex_program1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) + { + ret = GLEW_NV_vertex_program1_1; + continue; + } +#endif +#ifdef GL_NV_vertex_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) + { + ret = GLEW_NV_vertex_program2; + continue; + } +#endif +#ifdef GL_NV_vertex_program2_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) + { + ret = GLEW_NV_vertex_program2_option; + continue; + } +#endif +#ifdef GL_NV_vertex_program3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) + { + ret = GLEW_NV_vertex_program3; + continue; + } +#endif +#ifdef GL_NV_vertex_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) + { + ret = GLEW_NV_vertex_program4; + continue; + } +#endif +#ifdef GL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLEW_NV_video_capture; + continue; + } +#endif +#ifdef GL_NV_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_NV_viewport_array; + continue; + } +#endif +#ifdef GL_NV_viewport_array2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array2", 15)) + { + ret = GLEW_NV_viewport_array2; + continue; + } +#endif +#ifdef GL_NV_viewport_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_swizzle", 16)) + { + ret = GLEW_NV_viewport_swizzle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) + { +#ifdef GL_OES_byte_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) + { + ret = GLEW_OES_byte_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GL_OML_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_OML_interlace; + continue; + } +#endif +#ifdef GL_OML_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_OML_resample; + continue; + } +#endif +#ifdef GL_OML_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_OML_subsample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OVR_", 4)) + { +#ifdef GL_OVR_multiview + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview", 9)) + { + ret = GLEW_OVR_multiview; + continue; + } +#endif +#ifdef GL_OVR_multiview2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview2", 10)) + { + ret = GLEW_OVR_multiview2; + continue; + } +#endif +#ifdef GL_OVR_multiview_multisampled_render_to_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview_multisampled_render_to_texture", 40)) + { + ret = GLEW_OVR_multiview_multisampled_render_to_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) + { +#ifdef GL_PGI_misc_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) + { + ret = GLEW_PGI_misc_hints; + continue; + } +#endif +#ifdef GL_PGI_vertex_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) + { + ret = GLEW_PGI_vertex_hints; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"QCOM_", 5)) + { +#ifdef GL_QCOM_alpha_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"alpha_test", 10)) + { + ret = GLEW_QCOM_alpha_test; + continue; + } +#endif +#ifdef GL_QCOM_binning_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"binning_control", 15)) + { + ret = GLEW_QCOM_binning_control; + continue; + } +#endif +#ifdef GL_QCOM_driver_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"driver_control", 14)) + { + ret = GLEW_QCOM_driver_control; + continue; + } +#endif +#ifdef GL_QCOM_extended_get + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extended_get", 12)) + { + ret = GLEW_QCOM_extended_get; + continue; + } +#endif +#ifdef GL_QCOM_extended_get2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extended_get2", 13)) + { + ret = GLEW_QCOM_extended_get2; + continue; + } +#endif +#ifdef GL_QCOM_framebuffer_foveated + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_foveated", 20)) + { + ret = GLEW_QCOM_framebuffer_foveated; + continue; + } +#endif +#ifdef GL_QCOM_perfmon_global_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"perfmon_global_mode", 19)) + { + ret = GLEW_QCOM_perfmon_global_mode; + continue; + } +#endif +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch_noncoherent", 36)) + { + ret = GLEW_QCOM_shader_framebuffer_fetch_noncoherent; + continue; + } +#endif +#ifdef GL_QCOM_tiled_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tiled_rendering", 15)) + { + ret = GLEW_QCOM_tiled_rendering; + continue; + } +#endif +#ifdef GL_QCOM_writeonly_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"writeonly_rendering", 19)) + { + ret = GLEW_QCOM_writeonly_rendering; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) + { +#ifdef GL_REGAL_ES1_0_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_0_compatibility", 19)) + { + ret = GLEW_REGAL_ES1_0_compatibility; + continue; + } +#endif +#ifdef GL_REGAL_ES1_1_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_1_compatibility", 19)) + { + ret = GLEW_REGAL_ES1_1_compatibility; + continue; + } +#endif +#ifdef GL_REGAL_enable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"enable", 6)) + { + ret = GLEW_REGAL_enable; + continue; + } +#endif +#ifdef GL_REGAL_error_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) + { + ret = GLEW_REGAL_error_string; + continue; + } +#endif +#ifdef GL_REGAL_extension_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) + { + ret = GLEW_REGAL_extension_query; + continue; + } +#endif +#ifdef GL_REGAL_log + if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) + { + ret = GLEW_REGAL_log; + continue; + } +#endif +#ifdef GL_REGAL_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"proc_address", 12)) + { + ret = GLEW_REGAL_proc_address; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) + { +#ifdef GL_REND_screen_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) + { + ret = GLEW_REND_screen_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) + { +#ifdef GL_S3_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) + { + ret = GLEW_S3_s3tc; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GL_SGIS_clip_band_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_band_hint", 14)) + { + ret = GLEW_SGIS_clip_band_hint; + continue; + } +#endif +#ifdef GL_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLEW_SGIS_color_range; + continue; + } +#endif +#ifdef GL_SGIS_detail_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) + { + ret = GLEW_SGIS_detail_texture; + continue; + } +#endif +#ifdef GL_SGIS_fog_function + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) + { + ret = GLEW_SGIS_fog_function; + continue; + } +#endif +#ifdef GL_SGIS_generate_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) + { + ret = GLEW_SGIS_generate_mipmap; + continue; + } +#endif +#ifdef GL_SGIS_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"line_texgen", 11)) + { + ret = GLEW_SGIS_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_SGIS_multisample; + continue; + } +#endif +#ifdef GL_SGIS_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_SGIS_multitexture; + continue; + } +#endif +#ifdef GL_SGIS_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIS_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIS_point_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) + { + ret = GLEW_SGIS_point_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLEW_SGIS_shared_multisample; + continue; + } +#endif +#ifdef GL_SGIS_sharpen_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) + { + ret = GLEW_SGIS_sharpen_texture; + continue; + } +#endif +#ifdef GL_SGIS_texture4D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) + { + ret = GLEW_SGIS_texture4D; + continue; + } +#endif +#ifdef GL_SGIS_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_SGIS_texture_border_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_SGIS_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_filter4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) + { + ret = GLEW_SGIS_texture_filter4; + continue; + } +#endif +#ifdef GL_SGIS_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) + { + ret = GLEW_SGIS_texture_lod; + continue; + } +#endif +#ifdef GL_SGIS_texture_select + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) + { + ret = GLEW_SGIS_texture_select; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GL_SGIX_async + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) + { + ret = GLEW_SGIX_async; + continue; + } +#endif +#ifdef GL_SGIX_async_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) + { + ret = GLEW_SGIX_async_histogram; + continue; + } +#endif +#ifdef GL_SGIX_async_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) + { + ret = GLEW_SGIX_async_pixel; + continue; + } +#endif +#ifdef GL_SGIX_bali_g_instruments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bali_g_instruments", 18)) + { + ret = GLEW_SGIX_bali_g_instruments; + continue; + } +#endif +#ifdef GL_SGIX_bali_r_instruments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bali_r_instruments", 18)) + { + ret = GLEW_SGIX_bali_r_instruments; + continue; + } +#endif +#ifdef GL_SGIX_bali_timer_instruments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bali_timer_instruments", 22)) + { + ret = GLEW_SGIX_bali_timer_instruments; + continue; + } +#endif +#ifdef GL_SGIX_blend_alpha_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) + { + ret = GLEW_SGIX_blend_alpha_minmax; + continue; + } +#endif +#ifdef GL_SGIX_blend_cadd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_cadd", 10)) + { + ret = GLEW_SGIX_blend_cadd; + continue; + } +#endif +#ifdef GL_SGIX_blend_cmultiply + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_cmultiply", 15)) + { + ret = GLEW_SGIX_blend_cmultiply; + continue; + } +#endif +#ifdef GL_SGIX_calligraphic_fragment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"calligraphic_fragment", 21)) + { + ret = GLEW_SGIX_calligraphic_fragment; + continue; + } +#endif +#ifdef GL_SGIX_clipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) + { + ret = GLEW_SGIX_clipmap; + continue; + } +#endif +#ifdef GL_SGIX_color_matrix_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix_accuracy", 21)) + { + ret = GLEW_SGIX_color_matrix_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_color_table_index_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table_index_mode", 22)) + { + ret = GLEW_SGIX_color_table_index_mode; + continue; + } +#endif +#ifdef GL_SGIX_complex_polar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"complex_polar", 13)) + { + ret = GLEW_SGIX_complex_polar; + continue; + } +#endif +#ifdef GL_SGIX_convolution_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) + { + ret = GLEW_SGIX_convolution_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cube_map", 8)) + { + ret = GLEW_SGIX_cube_map; + continue; + } +#endif +#ifdef GL_SGIX_cylinder_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cylinder_texgen", 15)) + { + ret = GLEW_SGIX_cylinder_texgen; + continue; + } +#endif +#ifdef GL_SGIX_datapipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"datapipe", 8)) + { + ret = GLEW_SGIX_datapipe; + continue; + } +#endif +#ifdef GL_SGIX_decimation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"decimation", 10)) + { + ret = GLEW_SGIX_decimation; + continue; + } +#endif +#ifdef GL_SGIX_depth_pass_instrument + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_pass_instrument", 21)) + { + ret = GLEW_SGIX_depth_pass_instrument; + continue; + } +#endif +#ifdef GL_SGIX_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_SGIX_depth_texture; + continue; + } +#endif +#ifdef GL_SGIX_dvc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"dvc", 3)) + { + ret = GLEW_SGIX_dvc; + continue; + } +#endif +#ifdef GL_SGIX_flush_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) + { + ret = GLEW_SGIX_flush_raster; + continue; + } +#endif +#ifdef GL_SGIX_fog_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_blend", 9)) + { + ret = GLEW_SGIX_fog_blend; + continue; + } +#endif +#ifdef GL_SGIX_fog_factor_to_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_factor_to_alpha", 19)) + { + ret = GLEW_SGIX_fog_factor_to_alpha; + continue; + } +#endif +#ifdef GL_SGIX_fog_layers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_layers", 10)) + { + ret = GLEW_SGIX_fog_layers; + continue; + } +#endif +#ifdef GL_SGIX_fog_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) + { + ret = GLEW_SGIX_fog_offset; + continue; + } +#endif +#ifdef GL_SGIX_fog_patchy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_patchy", 10)) + { + ret = GLEW_SGIX_fog_patchy; + continue; + } +#endif +#ifdef GL_SGIX_fog_scale + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_scale", 9)) + { + ret = GLEW_SGIX_fog_scale; + continue; + } +#endif +#ifdef GL_SGIX_fog_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) + { + ret = GLEW_SGIX_fog_texture; + continue; + } +#endif +#ifdef GL_SGIX_fragment_lighting_space + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting_space", 23)) + { + ret = GLEW_SGIX_fragment_lighting_space; + continue; + } +#endif +#ifdef GL_SGIX_fragment_specular_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) + { + ret = GLEW_SGIX_fragment_specular_lighting; + continue; + } +#endif +#ifdef GL_SGIX_fragments_instrument + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragments_instrument", 20)) + { + ret = GLEW_SGIX_fragments_instrument; + continue; + } +#endif +#ifdef GL_SGIX_framezoom + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) + { + ret = GLEW_SGIX_framezoom; + continue; + } +#endif +#ifdef GL_SGIX_icc_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"icc_texture", 11)) + { + ret = GLEW_SGIX_icc_texture; + continue; + } +#endif +#ifdef GL_SGIX_igloo_interface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"igloo_interface", 15)) + { + ret = GLEW_SGIX_igloo_interface; + continue; + } +#endif +#ifdef GL_SGIX_image_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_compression", 17)) + { + ret = GLEW_SGIX_image_compression; + continue; + } +#endif +#ifdef GL_SGIX_impact_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"impact_pixel_texture", 20)) + { + ret = GLEW_SGIX_impact_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_instrument_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instrument_error", 16)) + { + ret = GLEW_SGIX_instrument_error; + continue; + } +#endif +#ifdef GL_SGIX_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_SGIX_interlace; + continue; + } +#endif +#ifdef GL_SGIX_ir_instrument1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) + { + ret = GLEW_SGIX_ir_instrument1; + continue; + } +#endif +#ifdef GL_SGIX_line_quality_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"line_quality_hint", 17)) + { + ret = GLEW_SGIX_line_quality_hint; + continue; + } +#endif +#ifdef GL_SGIX_list_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) + { + ret = GLEW_SGIX_list_priority; + continue; + } +#endif +#ifdef GL_SGIX_mpeg1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mpeg1", 5)) + { + ret = GLEW_SGIX_mpeg1; + continue; + } +#endif +#ifdef GL_SGIX_mpeg2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mpeg2", 5)) + { + ret = GLEW_SGIX_mpeg2; + continue; + } +#endif +#ifdef GL_SGIX_nonlinear_lighting_pervertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"nonlinear_lighting_pervertex", 28)) + { + ret = GLEW_SGIX_nonlinear_lighting_pervertex; + continue; + } +#endif +#ifdef GL_SGIX_nurbs_eval + if (_glewStrSame3(&pos, &len, (const GLubyte*)"nurbs_eval", 10)) + { + ret = GLEW_SGIX_nurbs_eval; + continue; + } +#endif +#ifdef GL_SGIX_occlusion_instrument + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_instrument", 20)) + { + ret = GLEW_SGIX_occlusion_instrument; + continue; + } +#endif +#ifdef GL_SGIX_packed_6bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_6bytes", 13)) + { + ret = GLEW_SGIX_packed_6bytes; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIX_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_bits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) + { + ret = GLEW_SGIX_pixel_texture_bits; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_lod", 17)) + { + ret = GLEW_SGIX_pixel_texture_lod; + continue; + } +#endif +#ifdef GL_SGIX_pixel_tiles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_tiles", 11)) + { + ret = GLEW_SGIX_pixel_tiles; + continue; + } +#endif +#ifdef GL_SGIX_polynomial_ffd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polynomial_ffd", 14)) + { + ret = GLEW_SGIX_polynomial_ffd; + continue; + } +#endif +#ifdef GL_SGIX_quad_mesh + if (_glewStrSame3(&pos, &len, (const GLubyte*)"quad_mesh", 9)) + { + ret = GLEW_SGIX_quad_mesh; + continue; + } +#endif +#ifdef GL_SGIX_reference_plane + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) + { + ret = GLEW_SGIX_reference_plane; + continue; + } +#endif +#ifdef GL_SGIX_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_SGIX_resample; + continue; + } +#endif +#ifdef GL_SGIX_scalebias_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scalebias_hint", 14)) + { + ret = GLEW_SGIX_scalebias_hint; + continue; + } +#endif +#ifdef GL_SGIX_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_SGIX_shadow; + continue; + } +#endif +#ifdef GL_SGIX_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_SGIX_shadow_ambient; + continue; + } +#endif +#ifdef GL_SGIX_slim + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slim", 4)) + { + ret = GLEW_SGIX_slim; + continue; + } +#endif +#ifdef GL_SGIX_spotlight_cutoff + if (_glewStrSame3(&pos, &len, (const GLubyte*)"spotlight_cutoff", 16)) + { + ret = GLEW_SGIX_spotlight_cutoff; + continue; + } +#endif +#ifdef GL_SGIX_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) + { + ret = GLEW_SGIX_sprite; + continue; + } +#endif +#ifdef GL_SGIX_subdiv_patch + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subdiv_patch", 12)) + { + ret = GLEW_SGIX_subdiv_patch; + continue; + } +#endif +#ifdef GL_SGIX_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_SGIX_subsample; + continue; + } +#endif +#ifdef GL_SGIX_tag_sample_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) + { + ret = GLEW_SGIX_tag_sample_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_add_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) + { + ret = GLEW_SGIX_texture_add_env; + continue; + } +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) + { + ret = GLEW_SGIX_texture_coordinate_clamp; + continue; + } +#endif +#ifdef GL_SGIX_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_SGIX_texture_lod_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_mipmap_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mipmap_anisotropic", 26)) + { + ret = GLEW_SGIX_texture_mipmap_anisotropic; + continue; + } +#endif +#ifdef GL_SGIX_texture_multi_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) + { + ret = GLEW_SGIX_texture_multi_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_phase + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_phase", 13)) + { + ret = GLEW_SGIX_texture_phase; + continue; + } +#endif +#ifdef GL_SGIX_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_SGIX_texture_range; + continue; + } +#endif +#ifdef GL_SGIX_texture_scale_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) + { + ret = GLEW_SGIX_texture_scale_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_supersample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_supersample", 19)) + { + ret = GLEW_SGIX_texture_supersample; + continue; + } +#endif +#ifdef GL_SGIX_vector_ops + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vector_ops", 10)) + { + ret = GLEW_SGIX_vector_ops; + continue; + } +#endif +#ifdef GL_SGIX_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_SGIX_vertex_array_object; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) + { + ret = GLEW_SGIX_vertex_preclip; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) + { + ret = GLEW_SGIX_vertex_preclip_hint; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) + { + ret = GLEW_SGIX_ycrcb; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb_subsample", 15)) + { + ret = GLEW_SGIX_ycrcb_subsample; + continue; + } +#endif +#ifdef GL_SGIX_ycrcba + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcba", 6)) + { + ret = GLEW_SGIX_ycrcba; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GL_SGI_color_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) + { + ret = GLEW_SGI_color_matrix; + continue; + } +#endif +#ifdef GL_SGI_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) + { + ret = GLEW_SGI_color_table; + continue; + } +#endif +#ifdef GL_SGI_complex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"complex", 7)) + { + ret = GLEW_SGI_complex; + continue; + } +#endif +#ifdef GL_SGI_complex_type + if (_glewStrSame3(&pos, &len, (const GLubyte*)"complex_type", 12)) + { + ret = GLEW_SGI_complex_type; + continue; + } +#endif +#ifdef GL_SGI_fft + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fft", 3)) + { + ret = GLEW_SGI_fft; + continue; + } +#endif +#ifdef GL_SGI_texture_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) + { + ret = GLEW_SGI_texture_color_table; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) + { +#ifdef GL_SUNX_constant_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) + { + ret = GLEW_SUNX_constant_data; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GL_SUN_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_SUN_convolution_border_modes; + continue; + } +#endif +#ifdef GL_SUN_global_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) + { + ret = GLEW_SUN_global_alpha; + continue; + } +#endif +#ifdef GL_SUN_mesh_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) + { + ret = GLEW_SUN_mesh_array; + continue; + } +#endif +#ifdef GL_SUN_read_video_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) + { + ret = GLEW_SUN_read_video_pixels; + continue; + } +#endif +#ifdef GL_SUN_slice_accum + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) + { + ret = GLEW_SUN_slice_accum; + continue; + } +#endif +#ifdef GL_SUN_triangle_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) + { + ret = GLEW_SUN_triangle_list; + continue; + } +#endif +#ifdef GL_SUN_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) + { + ret = GLEW_SUN_vertex; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) + { +#ifdef GL_WIN_phong_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) + { + ret = GLEW_WIN_phong_shading; + continue; + } +#endif +#ifdef GL_WIN_scene_markerXXX + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_markerXXX", 15)) + { + ret = GLEW_WIN_scene_markerXXX; + continue; + } +#endif +#ifdef GL_WIN_specular_fog + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) + { + ret = GLEW_WIN_specular_fog; + continue; + } +#endif +#ifdef GL_WIN_swap_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) + { + ret = GLEW_WIN_swap_hint; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA) + +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef WGL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) + { +#ifdef WGL_3DL_stereo_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) + { + ret = WGLEW_3DL_stereo_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef WGL_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = WGLEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef WGL_ARB_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = WGLEW_ARB_buffer_region; + continue; + } +#endif +#ifdef WGL_ARB_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = WGLEW_ARB_context_flush_control; + continue; + } +#endif +#ifdef WGL_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = WGLEW_ARB_create_context; + continue; + } +#endif +#ifdef WGL_ARB_create_context_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_no_error", 23)) + { + ret = WGLEW_ARB_create_context_no_error; + continue; + } +#endif +#ifdef WGL_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = WGLEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef WGL_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = WGLEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef WGL_ARB_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_ARB_extensions_string; + continue; + } +#endif +#ifdef WGL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_ARB_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_ARB_make_current_read; + continue; + } +#endif +#ifdef WGL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_ARB_multisample; + continue; + } +#endif +#ifdef WGL_ARB_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_ARB_pbuffer; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_ARB_pixel_format; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ARB_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ARB_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = WGLEW_ARB_render_texture; + continue; + } +#endif +#ifdef WGL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = WGLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef WGL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = WGLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef WGL_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ATI_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_ATI_render_texture_rectangle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef WGL_EXT_colorspace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"colorspace", 10)) + { + ret = WGLEW_EXT_colorspace; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = WGLEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = WGLEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef WGL_EXT_depth_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) + { + ret = WGLEW_EXT_depth_float; + continue; + } +#endif +#ifdef WGL_EXT_display_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) + { + ret = WGLEW_EXT_display_color_table; + continue; + } +#endif +#ifdef WGL_EXT_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_EXT_extensions_string; + continue; + } +#endif +#ifdef WGL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_EXT_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_EXT_make_current_read; + continue; + } +#endif +#ifdef WGL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_EXT_multisample; + continue; + } +#endif +#ifdef WGL_EXT_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_EXT_pbuffer; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_EXT_pixel_format; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) + { + ret = WGLEW_EXT_pixel_format_packed_float; + continue; + } +#endif +#ifdef WGL_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = WGLEW_EXT_swap_control; + continue; + } +#endif +#ifdef WGL_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = WGLEW_EXT_swap_control_tear; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) + { +#ifdef WGL_I3D_digital_video_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) + { + ret = WGLEW_I3D_digital_video_control; + continue; + } +#endif +#ifdef WGL_I3D_gamma + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) + { + ret = WGLEW_I3D_gamma; + continue; + } +#endif +#ifdef WGL_I3D_genlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) + { + ret = WGLEW_I3D_genlock; + continue; + } +#endif +#ifdef WGL_I3D_image_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) + { + ret = WGLEW_I3D_image_buffer; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_lock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) + { + ret = WGLEW_I3D_swap_frame_lock; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) + { + ret = WGLEW_I3D_swap_frame_usage; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef WGL_NV_DX_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) + { + ret = WGLEW_NV_DX_interop; + continue; + } +#endif +#ifdef WGL_NV_DX_interop2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) + { + ret = WGLEW_NV_DX_interop2; + continue; + } +#endif +#ifdef WGL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = WGLEW_NV_copy_image; + continue; + } +#endif +#ifdef WGL_NV_delay_before_swap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) + { + ret = WGLEW_NV_delay_before_swap; + continue; + } +#endif +#ifdef WGL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = WGLEW_NV_float_buffer; + continue; + } +#endif +#ifdef WGL_NV_gpu_affinity + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) + { + ret = WGLEW_NV_gpu_affinity; + continue; + } +#endif +#ifdef WGL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = WGLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef WGL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = WGLEW_NV_present_video; + continue; + } +#endif +#ifdef WGL_NV_render_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) + { + ret = WGLEW_NV_render_depth_texture; + continue; + } +#endif +#ifdef WGL_NV_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_NV_render_texture_rectangle; + continue; + } +#endif +#ifdef WGL_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = WGLEW_NV_swap_group; + continue; + } +#endif +#ifdef WGL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = WGLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef WGL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = WGLEW_NV_video_capture; + continue; + } +#endif +#ifdef WGL_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = WGLEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef WGL_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = WGLEW_OML_sync_control; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(GLEW_OSMESA) && !defined(GLEW_EGL) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +GLboolean glxewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GLX_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLXEW_VERSION_1_2; + continue; + } +#endif +#ifdef GLX_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLXEW_VERSION_1_3; + continue; + } +#endif +#ifdef GLX_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLXEW_VERSION_1_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GLX_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GLX_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = GLXEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GLX_ARB_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = GLXEW_ARB_context_flush_control; + continue; + } +#endif +#ifdef GLX_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = GLXEW_ARB_create_context; + continue; + } +#endif +#ifdef GLX_ARB_create_context_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_no_error", 23)) + { + ret = GLXEW_ARB_create_context_no_error; + continue; + } +#endif +#ifdef GLX_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = GLXEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef GLX_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = GLXEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef GLX_ARB_fbconfig_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) + { + ret = GLXEW_ARB_fbconfig_float; + continue; + } +#endif +#ifdef GLX_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_ARB_get_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) + { + ret = GLXEW_ARB_get_proc_address; + continue; + } +#endif +#ifdef GLX_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_ARB_multisample; + continue; + } +#endif +#ifdef GLX_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLXEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GLX_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLXEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GLX_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLXEW_ARB_vertex_buffer_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GLX_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = GLXEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef GLX_ATI_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = GLXEW_ATI_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GLX_EXT_buffer_age + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) + { + ret = GLXEW_EXT_buffer_age; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = GLXEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = GLXEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef GLX_EXT_fbconfig_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) + { + ret = GLXEW_EXT_fbconfig_packed_float; + continue; + } +#endif +#ifdef GLX_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_EXT_import_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) + { + ret = GLXEW_EXT_import_context; + continue; + } +#endif +#ifdef GLX_EXT_libglvnd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"libglvnd", 8)) + { + ret = GLXEW_EXT_libglvnd; + continue; + } +#endif +#ifdef GLX_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLXEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GLX_EXT_stereo_tree + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_tree", 11)) + { + ret = GLXEW_EXT_stereo_tree; + continue; + } +#endif +#ifdef GLX_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_EXT_swap_control; + continue; + } +#endif +#ifdef GLX_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = GLXEW_EXT_swap_control_tear; + continue; + } +#endif +#ifdef GLX_EXT_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = GLXEW_EXT_texture_from_pixmap; + continue; + } +#endif +#ifdef GLX_EXT_visual_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) + { + ret = GLXEW_EXT_visual_info; + continue; + } +#endif +#ifdef GLX_EXT_visual_rating + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) + { + ret = GLXEW_EXT_visual_rating; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GLX_INTEL_swap_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) + { + ret = GLXEW_INTEL_swap_event; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GLX_MESA_agp_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) + { + ret = GLXEW_MESA_agp_offset; + continue; + } +#endif +#ifdef GLX_MESA_copy_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) + { + ret = GLXEW_MESA_copy_sub_buffer; + continue; + } +#endif +#ifdef GLX_MESA_pixmap_colormap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) + { + ret = GLXEW_MESA_pixmap_colormap; + continue; + } +#endif +#ifdef GLX_MESA_query_renderer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_renderer", 14)) + { + ret = GLXEW_MESA_query_renderer; + continue; + } +#endif +#ifdef GLX_MESA_release_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) + { + ret = GLXEW_MESA_release_buffers; + continue; + } +#endif +#ifdef GLX_MESA_set_3dfx_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) + { + ret = GLXEW_MESA_set_3dfx_mode; + continue; + } +#endif +#ifdef GLX_MESA_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_MESA_swap_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GLX_NV_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLXEW_NV_copy_buffer; + continue; + } +#endif +#ifdef GLX_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLXEW_NV_copy_image; + continue; + } +#endif +#ifdef GLX_NV_delay_before_swap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) + { + ret = GLXEW_NV_delay_before_swap; + continue; + } +#endif +#ifdef GLX_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLXEW_NV_float_buffer; + continue; + } +#endif +#ifdef GLX_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLXEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GLX_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLXEW_NV_present_video; + continue; + } +#endif +#ifdef GLX_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_video_memory_purge", 29)) + { + ret = GLXEW_NV_robustness_video_memory_purge; + continue; + } +#endif +#ifdef GLX_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_NV_swap_group; + continue; + } +#endif +#ifdef GLX_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLXEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GLX_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLXEW_NV_video_capture; + continue; + } +#endif +#ifdef GLX_NV_video_out + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) + { + ret = GLXEW_NV_video_out; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GLX_OML_swap_method + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) + { + ret = GLXEW_OML_swap_method; + continue; + } +#endif +#ifdef GLX_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = GLXEW_OML_sync_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GLX_SGIS_blended_overlay + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) + { + ret = GLXEW_SGIS_blended_overlay; + continue; + } +#endif +#ifdef GLX_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLXEW_SGIS_color_range; + continue; + } +#endif +#ifdef GLX_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_SGIS_multisample; + continue; + } +#endif +#ifdef GLX_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLXEW_SGIS_shared_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GLX_SGIX_fbconfig + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) + { + ret = GLXEW_SGIX_fbconfig; + continue; + } +#endif +#ifdef GLX_SGIX_hyperpipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) + { + ret = GLXEW_SGIX_hyperpipe; + continue; + } +#endif +#ifdef GLX_SGIX_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = GLXEW_SGIX_pbuffer; + continue; + } +#endif +#ifdef GLX_SGIX_swap_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) + { + ret = GLXEW_SGIX_swap_barrier; + continue; + } +#endif +#ifdef GLX_SGIX_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_SGIX_swap_group; + continue; + } +#endif +#ifdef GLX_SGIX_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SGIX_video_resize; + continue; + } +#endif +#ifdef GLX_SGIX_visual_select_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) + { + ret = GLXEW_SGIX_visual_select_group; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GLX_SGI_cushion + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) + { + ret = GLXEW_SGI_cushion; + continue; + } +#endif +#ifdef GLX_SGI_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = GLXEW_SGI_make_current_read; + continue; + } +#endif +#ifdef GLX_SGI_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_SGI_swap_control; + continue; + } +#endif +#ifdef GLX_SGI_video_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) + { + ret = GLXEW_SGI_video_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GLX_SUN_get_transparent_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) + { + ret = GLXEW_SUN_get_transparent_index; + continue; + } +#endif +#ifdef GLX_SUN_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SUN_video_resize; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif defined(GLEW_EGL) + +GLboolean eglewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"EGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef EGL_VERSION_1_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_0", 3)) + { + ret = EGLEW_VERSION_1_0; + continue; + } +#endif +#ifdef EGL_VERSION_1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_1", 3)) + { + ret = EGLEW_VERSION_1_1; + continue; + } +#endif +#ifdef EGL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = EGLEW_VERSION_1_2; + continue; + } +#endif +#ifdef EGL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = EGLEW_VERSION_1_3; + continue; + } +#endif +#ifdef EGL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = EGLEW_VERSION_1_4; + continue; + } +#endif +#ifdef EGL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = EGLEW_VERSION_1_5; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANDROID_", 8)) + { +#ifdef EGL_ANDROID_blob_cache + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blob_cache", 10)) + { + ret = EGLEW_ANDROID_blob_cache; + continue; + } +#endif +#ifdef EGL_ANDROID_create_native_client_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_native_client_buffer", 27)) + { + ret = EGLEW_ANDROID_create_native_client_buffer; + continue; + } +#endif +#ifdef EGL_ANDROID_framebuffer_target + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_target", 18)) + { + ret = EGLEW_ANDROID_framebuffer_target; + continue; + } +#endif +#ifdef EGL_ANDROID_front_buffer_auto_refresh + if (_glewStrSame3(&pos, &len, (const GLubyte*)"front_buffer_auto_refresh", 25)) + { + ret = EGLEW_ANDROID_front_buffer_auto_refresh; + continue; + } +#endif +#ifdef EGL_ANDROID_image_native_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_native_buffer", 19)) + { + ret = EGLEW_ANDROID_image_native_buffer; + continue; + } +#endif +#ifdef EGL_ANDROID_native_fence_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"native_fence_sync", 17)) + { + ret = EGLEW_ANDROID_native_fence_sync; + continue; + } +#endif +#ifdef EGL_ANDROID_presentation_time + if (_glewStrSame3(&pos, &len, (const GLubyte*)"presentation_time", 17)) + { + ret = EGLEW_ANDROID_presentation_time; + continue; + } +#endif +#ifdef EGL_ANDROID_recordable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"recordable", 10)) + { + ret = EGLEW_ANDROID_recordable; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) + { +#ifdef EGL_ANGLE_d3d_share_handle_client_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"d3d_share_handle_client_buffer", 30)) + { + ret = EGLEW_ANGLE_d3d_share_handle_client_buffer; + continue; + } +#endif +#ifdef EGL_ANGLE_device_d3d + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_d3d", 10)) + { + ret = EGLEW_ANGLE_device_d3d; + continue; + } +#endif +#ifdef EGL_ANGLE_query_surface_pointer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_surface_pointer", 21)) + { + ret = EGLEW_ANGLE_query_surface_pointer; + continue; + } +#endif +#ifdef EGL_ANGLE_surface_d3d_texture_2d_share_handle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"surface_d3d_texture_2d_share_handle", 35)) + { + ret = EGLEW_ANGLE_surface_d3d_texture_2d_share_handle; + continue; + } +#endif +#ifdef EGL_ANGLE_window_fixed_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_fixed_size", 17)) + { + ret = EGLEW_ANGLE_window_fixed_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARM_", 4)) + { +#ifdef EGL_ARM_implicit_external_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"implicit_external_sync", 22)) + { + ret = EGLEW_ARM_implicit_external_sync; + continue; + } +#endif +#ifdef EGL_ARM_pixmap_multisample_discard + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_multisample_discard", 26)) + { + ret = EGLEW_ARM_pixmap_multisample_discard; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef EGL_EXT_buffer_age + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) + { + ret = EGLEW_EXT_buffer_age; + continue; + } +#endif +#ifdef EGL_EXT_client_extensions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_extensions", 17)) + { + ret = EGLEW_EXT_client_extensions; + continue; + } +#endif +#ifdef EGL_EXT_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = EGLEW_EXT_create_context_robustness; + continue; + } +#endif +#ifdef EGL_EXT_device_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_base", 11)) + { + ret = EGLEW_EXT_device_base; + continue; + } +#endif +#ifdef EGL_EXT_device_drm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_drm", 10)) + { + ret = EGLEW_EXT_device_drm; + continue; + } +#endif +#ifdef EGL_EXT_device_enumeration + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_enumeration", 18)) + { + ret = EGLEW_EXT_device_enumeration; + continue; + } +#endif +#ifdef EGL_EXT_device_openwf + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_openwf", 13)) + { + ret = EGLEW_EXT_device_openwf; + continue; + } +#endif +#ifdef EGL_EXT_device_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_query", 12)) + { + ret = EGLEW_EXT_device_query; + continue; + } +#endif +#ifdef EGL_EXT_gl_colorspace_bt2020_linear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace_bt2020_linear", 27)) + { + ret = EGLEW_EXT_gl_colorspace_bt2020_linear; + continue; + } +#endif +#ifdef EGL_EXT_gl_colorspace_bt2020_pq + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace_bt2020_pq", 23)) + { + ret = EGLEW_EXT_gl_colorspace_bt2020_pq; + continue; + } +#endif +#ifdef EGL_EXT_gl_colorspace_scrgb_linear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace_scrgb_linear", 26)) + { + ret = EGLEW_EXT_gl_colorspace_scrgb_linear; + continue; + } +#endif +#ifdef EGL_EXT_image_dma_buf_import + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_dma_buf_import", 20)) + { + ret = EGLEW_EXT_image_dma_buf_import; + continue; + } +#endif +#ifdef EGL_EXT_image_dma_buf_import_modifiers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_dma_buf_import_modifiers", 30)) + { + ret = EGLEW_EXT_image_dma_buf_import_modifiers; + continue; + } +#endif +#ifdef EGL_EXT_multiview_window + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview_window", 16)) + { + ret = EGLEW_EXT_multiview_window; + continue; + } +#endif +#ifdef EGL_EXT_output_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"output_base", 11)) + { + ret = EGLEW_EXT_output_base; + continue; + } +#endif +#ifdef EGL_EXT_output_drm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"output_drm", 10)) + { + ret = EGLEW_EXT_output_drm; + continue; + } +#endif +#ifdef EGL_EXT_output_openwf + if (_glewStrSame3(&pos, &len, (const GLubyte*)"output_openwf", 13)) + { + ret = EGLEW_EXT_output_openwf; + continue; + } +#endif +#ifdef EGL_EXT_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = EGLEW_EXT_pixel_format_float; + continue; + } +#endif +#ifdef EGL_EXT_platform_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_base", 13)) + { + ret = EGLEW_EXT_platform_base; + continue; + } +#endif +#ifdef EGL_EXT_platform_device + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_device", 15)) + { + ret = EGLEW_EXT_platform_device; + continue; + } +#endif +#ifdef EGL_EXT_platform_wayland + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_wayland", 16)) + { + ret = EGLEW_EXT_platform_wayland; + continue; + } +#endif +#ifdef EGL_EXT_platform_x11 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_x11", 12)) + { + ret = EGLEW_EXT_platform_x11; + continue; + } +#endif +#ifdef EGL_EXT_protected_content + if (_glewStrSame3(&pos, &len, (const GLubyte*)"protected_content", 17)) + { + ret = EGLEW_EXT_protected_content; + continue; + } +#endif +#ifdef EGL_EXT_protected_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"protected_surface", 17)) + { + ret = EGLEW_EXT_protected_surface; + continue; + } +#endif +#ifdef EGL_EXT_stream_consumer_egloutput + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_consumer_egloutput", 25)) + { + ret = EGLEW_EXT_stream_consumer_egloutput; + continue; + } +#endif +#ifdef EGL_EXT_surface_SMPTE2086_metadata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"surface_SMPTE2086_metadata", 26)) + { + ret = EGLEW_EXT_surface_SMPTE2086_metadata; + continue; + } +#endif +#ifdef EGL_EXT_swap_buffers_with_damage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_buffers_with_damage", 24)) + { + ret = EGLEW_EXT_swap_buffers_with_damage; + continue; + } +#endif +#ifdef EGL_EXT_yuv_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"yuv_surface", 11)) + { + ret = EGLEW_EXT_yuv_surface; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HI_", 3)) + { +#ifdef EGL_HI_clientpixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clientpixmap", 12)) + { + ret = EGLEW_HI_clientpixmap; + continue; + } +#endif +#ifdef EGL_HI_colorformats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"colorformats", 12)) + { + ret = EGLEW_HI_colorformats; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IMG_", 4)) + { +#ifdef EGL_IMG_context_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_priority", 16)) + { + ret = EGLEW_IMG_context_priority; + continue; + } +#endif +#ifdef EGL_IMG_image_plane_attribs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_plane_attribs", 19)) + { + ret = EGLEW_IMG_image_plane_attribs; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef EGL_KHR_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = EGLEW_KHR_cl_event; + continue; + } +#endif +#ifdef EGL_KHR_cl_event2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event2", 9)) + { + ret = EGLEW_KHR_cl_event2; + continue; + } +#endif +#ifdef EGL_KHR_client_get_all_proc_addresses + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_get_all_proc_addresses", 29)) + { + ret = EGLEW_KHR_client_get_all_proc_addresses; + continue; + } +#endif +#ifdef EGL_KHR_config_attribs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"config_attribs", 14)) + { + ret = EGLEW_KHR_config_attribs; + continue; + } +#endif +#ifdef EGL_KHR_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = EGLEW_KHR_context_flush_control; + continue; + } +#endif +#ifdef EGL_KHR_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = EGLEW_KHR_create_context; + continue; + } +#endif +#ifdef EGL_KHR_create_context_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_no_error", 23)) + { + ret = EGLEW_KHR_create_context_no_error; + continue; + } +#endif +#ifdef EGL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = EGLEW_KHR_debug; + continue; + } +#endif +#ifdef EGL_KHR_fence_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence_sync", 10)) + { + ret = EGLEW_KHR_fence_sync; + continue; + } +#endif +#ifdef EGL_KHR_get_all_proc_addresses + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_all_proc_addresses", 22)) + { + ret = EGLEW_KHR_get_all_proc_addresses; + continue; + } +#endif +#ifdef EGL_KHR_gl_colorspace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace", 13)) + { + ret = EGLEW_KHR_gl_colorspace; + continue; + } +#endif +#ifdef EGL_KHR_gl_renderbuffer_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_renderbuffer_image", 21)) + { + ret = EGLEW_KHR_gl_renderbuffer_image; + continue; + } +#endif +#ifdef EGL_KHR_gl_texture_2D_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_texture_2D_image", 19)) + { + ret = EGLEW_KHR_gl_texture_2D_image; + continue; + } +#endif +#ifdef EGL_KHR_gl_texture_3D_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_texture_3D_image", 19)) + { + ret = EGLEW_KHR_gl_texture_3D_image; + continue; + } +#endif +#ifdef EGL_KHR_gl_texture_cubemap_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_texture_cubemap_image", 24)) + { + ret = EGLEW_KHR_gl_texture_cubemap_image; + continue; + } +#endif +#ifdef EGL_KHR_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image", 5)) + { + ret = EGLEW_KHR_image; + continue; + } +#endif +#ifdef EGL_KHR_image_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_base", 10)) + { + ret = EGLEW_KHR_image_base; + continue; + } +#endif +#ifdef EGL_KHR_image_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_pixmap", 12)) + { + ret = EGLEW_KHR_image_pixmap; + continue; + } +#endif +#ifdef EGL_KHR_lock_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"lock_surface", 12)) + { + ret = EGLEW_KHR_lock_surface; + continue; + } +#endif +#ifdef EGL_KHR_lock_surface2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"lock_surface2", 13)) + { + ret = EGLEW_KHR_lock_surface2; + continue; + } +#endif +#ifdef EGL_KHR_lock_surface3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"lock_surface3", 13)) + { + ret = EGLEW_KHR_lock_surface3; + continue; + } +#endif +#ifdef EGL_KHR_mutable_render_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mutable_render_buffer", 21)) + { + ret = EGLEW_KHR_mutable_render_buffer; + continue; + } +#endif +#ifdef EGL_KHR_no_config_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"no_config_context", 17)) + { + ret = EGLEW_KHR_no_config_context; + continue; + } +#endif +#ifdef EGL_KHR_partial_update + if (_glewStrSame3(&pos, &len, (const GLubyte*)"partial_update", 14)) + { + ret = EGLEW_KHR_partial_update; + continue; + } +#endif +#ifdef EGL_KHR_platform_android + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_android", 16)) + { + ret = EGLEW_KHR_platform_android; + continue; + } +#endif +#ifdef EGL_KHR_platform_gbm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_gbm", 12)) + { + ret = EGLEW_KHR_platform_gbm; + continue; + } +#endif +#ifdef EGL_KHR_platform_wayland + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_wayland", 16)) + { + ret = EGLEW_KHR_platform_wayland; + continue; + } +#endif +#ifdef EGL_KHR_platform_x11 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_x11", 12)) + { + ret = EGLEW_KHR_platform_x11; + continue; + } +#endif +#ifdef EGL_KHR_reusable_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reusable_sync", 13)) + { + ret = EGLEW_KHR_reusable_sync; + continue; + } +#endif +#ifdef EGL_KHR_stream + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream", 6)) + { + ret = EGLEW_KHR_stream; + continue; + } +#endif +#ifdef EGL_KHR_stream_attrib + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_attrib", 13)) + { + ret = EGLEW_KHR_stream_attrib; + continue; + } +#endif +#ifdef EGL_KHR_stream_consumer_gltexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_consumer_gltexture", 25)) + { + ret = EGLEW_KHR_stream_consumer_gltexture; + continue; + } +#endif +#ifdef EGL_KHR_stream_cross_process_fd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_process_fd", 23)) + { + ret = EGLEW_KHR_stream_cross_process_fd; + continue; + } +#endif +#ifdef EGL_KHR_stream_fifo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_fifo", 11)) + { + ret = EGLEW_KHR_stream_fifo; + continue; + } +#endif +#ifdef EGL_KHR_stream_producer_aldatalocator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_producer_aldatalocator", 29)) + { + ret = EGLEW_KHR_stream_producer_aldatalocator; + continue; + } +#endif +#ifdef EGL_KHR_stream_producer_eglsurface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_producer_eglsurface", 26)) + { + ret = EGLEW_KHR_stream_producer_eglsurface; + continue; + } +#endif +#ifdef EGL_KHR_surfaceless_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"surfaceless_context", 19)) + { + ret = EGLEW_KHR_surfaceless_context; + continue; + } +#endif +#ifdef EGL_KHR_swap_buffers_with_damage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_buffers_with_damage", 24)) + { + ret = EGLEW_KHR_swap_buffers_with_damage; + continue; + } +#endif +#ifdef EGL_KHR_vg_parent_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vg_parent_image", 15)) + { + ret = EGLEW_KHR_vg_parent_image; + continue; + } +#endif +#ifdef EGL_KHR_wait_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"wait_sync", 9)) + { + ret = EGLEW_KHR_wait_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef EGL_MESA_drm_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"drm_image", 9)) + { + ret = EGLEW_MESA_drm_image; + continue; + } +#endif +#ifdef EGL_MESA_image_dma_buf_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_dma_buf_export", 20)) + { + ret = EGLEW_MESA_image_dma_buf_export; + continue; + } +#endif +#ifdef EGL_MESA_platform_gbm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_gbm", 12)) + { + ret = EGLEW_MESA_platform_gbm; + continue; + } +#endif +#ifdef EGL_MESA_platform_surfaceless + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_surfaceless", 20)) + { + ret = EGLEW_MESA_platform_surfaceless; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NOK_", 4)) + { +#ifdef EGL_NOK_swap_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_region", 11)) + { + ret = EGLEW_NOK_swap_region; + continue; + } +#endif +#ifdef EGL_NOK_swap_region2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_region2", 12)) + { + ret = EGLEW_NOK_swap_region2; + continue; + } +#endif +#ifdef EGL_NOK_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = EGLEW_NOK_texture_from_pixmap; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef EGL_NV_3dvision_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3dvision_surface", 16)) + { + ret = EGLEW_NV_3dvision_surface; + continue; + } +#endif +#ifdef EGL_NV_coverage_sample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coverage_sample", 15)) + { + ret = EGLEW_NV_coverage_sample; + continue; + } +#endif +#ifdef EGL_NV_coverage_sample_resolve + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coverage_sample_resolve", 23)) + { + ret = EGLEW_NV_coverage_sample_resolve; + continue; + } +#endif +#ifdef EGL_NV_cuda_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cuda_event", 10)) + { + ret = EGLEW_NV_cuda_event; + continue; + } +#endif +#ifdef EGL_NV_depth_nonlinear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_nonlinear", 15)) + { + ret = EGLEW_NV_depth_nonlinear; + continue; + } +#endif +#ifdef EGL_NV_device_cuda + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_cuda", 11)) + { + ret = EGLEW_NV_device_cuda; + continue; + } +#endif +#ifdef EGL_NV_native_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"native_query", 12)) + { + ret = EGLEW_NV_native_query; + continue; + } +#endif +#ifdef EGL_NV_post_convert_rounding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_convert_rounding", 21)) + { + ret = EGLEW_NV_post_convert_rounding; + continue; + } +#endif +#ifdef EGL_NV_post_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_sub_buffer", 15)) + { + ret = EGLEW_NV_post_sub_buffer; + continue; + } +#endif +#ifdef EGL_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_video_memory_purge", 29)) + { + ret = EGLEW_NV_robustness_video_memory_purge; + continue; + } +#endif +#ifdef EGL_NV_stream_consumer_gltexture_yuv + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_consumer_gltexture_yuv", 29)) + { + ret = EGLEW_NV_stream_consumer_gltexture_yuv; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_display + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_display", 20)) + { + ret = EGLEW_NV_stream_cross_display; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_object", 19)) + { + ret = EGLEW_NV_stream_cross_object; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_partition + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_partition", 22)) + { + ret = EGLEW_NV_stream_cross_partition; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_process + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_process", 20)) + { + ret = EGLEW_NV_stream_cross_process; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_system + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_system", 19)) + { + ret = EGLEW_NV_stream_cross_system; + continue; + } +#endif +#ifdef EGL_NV_stream_fifo_next + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_fifo_next", 16)) + { + ret = EGLEW_NV_stream_fifo_next; + continue; + } +#endif +#ifdef EGL_NV_stream_fifo_synchronous + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_fifo_synchronous", 23)) + { + ret = EGLEW_NV_stream_fifo_synchronous; + continue; + } +#endif +#ifdef EGL_NV_stream_frame_limits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_frame_limits", 19)) + { + ret = EGLEW_NV_stream_frame_limits; + continue; + } +#endif +#ifdef EGL_NV_stream_metadata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_metadata", 15)) + { + ret = EGLEW_NV_stream_metadata; + continue; + } +#endif +#ifdef EGL_NV_stream_remote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_remote", 13)) + { + ret = EGLEW_NV_stream_remote; + continue; + } +#endif +#ifdef EGL_NV_stream_reset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_reset", 12)) + { + ret = EGLEW_NV_stream_reset; + continue; + } +#endif +#ifdef EGL_NV_stream_socket + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_socket", 13)) + { + ret = EGLEW_NV_stream_socket; + continue; + } +#endif +#ifdef EGL_NV_stream_socket_inet + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_socket_inet", 18)) + { + ret = EGLEW_NV_stream_socket_inet; + continue; + } +#endif +#ifdef EGL_NV_stream_socket_unix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_socket_unix", 18)) + { + ret = EGLEW_NV_stream_socket_unix; + continue; + } +#endif +#ifdef EGL_NV_stream_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_sync", 11)) + { + ret = EGLEW_NV_stream_sync; + continue; + } +#endif +#ifdef EGL_NV_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = EGLEW_NV_sync; + continue; + } +#endif +#ifdef EGL_NV_system_time + if (_glewStrSame3(&pos, &len, (const GLubyte*)"system_time", 11)) + { + ret = EGLEW_NV_system_time; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"TIZEN_", 6)) + { +#ifdef EGL_TIZEN_image_native_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_native_buffer", 19)) + { + ret = EGLEW_TIZEN_image_native_buffer; + continue; + } +#endif +#ifdef EGL_TIZEN_image_native_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_native_surface", 20)) + { + ret = EGLEW_TIZEN_image_native_surface; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/Windows/glew/src/glewinfo.c b/Windows/glew/src/glewinfo.c new file mode 100644 index 00000000..882654d6 --- /dev/null +++ b/Windows/glew/src/glewinfo.c @@ -0,0 +1,16881 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#if defined(GLEW_EGL) +#include +#elif defined(GLEW_OSMESA) +#define GLAPI extern +#include +#elif defined(_WIN32) +#include +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +#include +#endif + +#if defined(__APPLE__) +#include +#endif + +#ifdef GLEW_REGAL +#include +#endif + +static FILE* f; + +/* Command-line parameters for GL context creation */ + +struct createParams +{ +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + int pixelformat; +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) + const char* display; + int visual; +#endif + int major, minor; /* GL context version number */ + + /* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */ + int profile; /* core = 1, compatibility = 2 */ + int flags; /* debug = 1, forward compatible = 2 */ +}; + +GLboolean glewCreateContext (struct createParams *params); + +GLboolean glewParseArgs (int argc, char** argv, struct createParams *); + +void glewDestroyContext (); + +/* ------------------------------------------------------------------------- */ + +static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3) +{ + unsigned int i; + fprintf(f, "\n%s:", name); + for (i=0; i<62-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s ", def1 ? "OK" : "MISSING"); + if (def1 != def2) + fprintf(f, "[%s] ", def2 ? "OK" : "MISSING"); + if (def1 != def3) + fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING"); + else + fprintf(f, "\n"); + for (i=0; i] " +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + "[-display ] " + "[-visual ] " +#endif + "[-version ] " + "[-profile core|compatibility] " + "[-flag debug|forward]" + "\n"); + return 1; + } + + if (GL_TRUE == glewCreateContext(¶ms)) + { + fprintf(stderr, "Error: glewCreateContext failed\n"); + glewDestroyContext(); + return 1; + } + glewExperimental = GL_TRUE; + err = glewInit(); + if (GLEW_OK != err) + { + fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); + glewDestroyContext(); + return 1; + } + +#if defined(GLEW_EGL) + getString = (PFNGLGETSTRINGPROC) eglGetProcAddress("glGetString"); + if (!getString) + { + fprintf(stderr, "Error: eglGetProcAddress failed to fetch glGetString\n"); + glewDestroyContext(); + return 1; + } +#endif + +#if defined(_WIN32) +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + if (fopen_s(&f, "glewinfo.txt", "w") != 0) + f = stdout; +#else + f = fopen("glewinfo.txt", "w"); +#endif + if (f == NULL) f = stdout; +#else + f = stdout; +#endif + fprintf(f, "---------------------------\n"); + fprintf(f, " GLEW Extension Info\n"); + fprintf(f, "---------------------------\n\n"); + fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION)); +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n", + params.display == NULL ? getenv("DISPLAY") : params.display, params.visual); +#endif +#if defined(GLEW_EGL) + fprintf(f, "Running on a %s from %s\n", + getString(GL_RENDERER), getString(GL_VENDOR)); + fprintf(f, "OpenGL version %s is supported\n", getString(GL_VERSION)); +#else + fprintf(f, "Running on a %s from %s\n", + glGetString(GL_RENDERER), glGetString(GL_VENDOR)); + fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION)); +#endif + glewInfo(); +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) + eglewInfo(); +#elif defined(_WIN32) + wglewInfo(); +#else + glxewInfo(); +#endif + if (f != stdout) fclose(f); + glewDestroyContext(); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) +{ + int p = 0; + while (p < argc) + { + if (!strcmp(argv[p], "-version")) + { + if (++p >= argc) return GL_TRUE; + if (sscanf(argv[p++], "%d.%d", ¶ms->major, ¶ms->minor) != 2) return GL_TRUE; + } + else if (!strcmp(argv[p], "-profile")) + { + if (++p >= argc) return GL_TRUE; + if (strcmp("core", argv[p]) == 0) params->profile |= 1; + else if (strcmp("compatibility",argv[p]) == 0) params->profile |= 2; + else return GL_TRUE; + ++p; + } + else if (!strcmp(argv[p], "-flag")) + { + if (++p >= argc) return GL_TRUE; + if (strcmp("debug", argv[p]) == 0) params->flags |= 1; + else if (strcmp("forward",argv[p]) == 0) params->flags |= 2; + else return GL_TRUE; + ++p; + } +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + params->pixelformat = strtol(argv[p++], NULL, 0); + } +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + else if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + params->display = argv[p++]; + } + else if (!strcmp(argv[p], "-visual")) + { + if (++p >= argc) return GL_TRUE; + params->visual = (int)strtol(argv[p++], NULL, 0); + } +#endif + else + return GL_TRUE; + } + return GL_FALSE; +} + +/* ------------------------------------------------------------------------ */ + +#if defined(GLEW_EGL) +EGLDisplay display; +EGLContext ctx; + +/* See: http://stackoverflow.com/questions/12662227/opengl-es2-0-offscreen-context-for-fbo-rendering */ + +GLboolean glewCreateContext (struct createParams *params) +{ + EGLDeviceEXT devices[1]; + EGLint numDevices; + EGLSurface surface; + EGLint majorVersion, minorVersion; + EGLint configAttribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RED_SIZE, 1, + EGL_GREEN_SIZE, 1, + EGL_BLUE_SIZE, 1, + EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, + EGL_NONE + }; + static const EGLint contextAttribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + static const EGLint pBufferAttribs[] = { + EGL_WIDTH, 128, + EGL_HEIGHT, 128, + EGL_NONE + }; + EGLConfig config; + EGLint numConfig; + EGLBoolean pBuffer; + + PFNEGLQUERYDEVICESEXTPROC queryDevices = NULL; + PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = NULL; + PFNEGLGETERRORPROC getError = NULL; + PFNEGLGETDISPLAYPROC getDisplay = NULL; + PFNEGLINITIALIZEPROC initialize = NULL; + PFNEGLBINDAPIPROC bindAPI = NULL; + PFNEGLCHOOSECONFIGPROC chooseConfig = NULL; + PFNEGLCREATEWINDOWSURFACEPROC createWindowSurface = NULL; + PFNEGLCREATECONTEXTPROC createContext = NULL; + PFNEGLMAKECURRENTPROC makeCurrent = NULL; + PFNEGLCREATEPBUFFERSURFACEPROC createPbufferSurface = NULL; + + /* Load necessary entry points */ + queryDevices = (PFNEGLQUERYDEVICESEXTPROC) eglGetProcAddress("eglQueryDevicesEXT"); + getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress("eglGetPlatformDisplayEXT"); + getError = (PFNEGLGETERRORPROC) eglGetProcAddress("eglGetError"); + getDisplay = (PFNEGLGETDISPLAYPROC) eglGetProcAddress("eglGetDisplay"); + initialize = (PFNEGLINITIALIZEPROC) eglGetProcAddress("eglInitialize"); + bindAPI = (PFNEGLBINDAPIPROC) eglGetProcAddress("eglBindAPI"); + chooseConfig = (PFNEGLCHOOSECONFIGPROC) eglGetProcAddress("eglChooseConfig"); + createWindowSurface = (PFNEGLCREATEWINDOWSURFACEPROC) eglGetProcAddress("eglCreateWindowSurface"); + createPbufferSurface = (PFNEGLCREATEPBUFFERSURFACEPROC) eglGetProcAddress("eglCreatePbufferSurface"); + createContext = (PFNEGLCREATECONTEXTPROC) eglGetProcAddress("eglCreateContext"); + makeCurrent = (PFNEGLMAKECURRENTPROC) eglGetProcAddress("eglMakeCurrent"); + if (!getError || !getDisplay || !initialize || !bindAPI || !chooseConfig || !createWindowSurface || !createContext || !makeCurrent) + return GL_TRUE; + + pBuffer = 0; + display = EGL_NO_DISPLAY; + if (queryDevices && getPlatformDisplay) + { + queryDevices(1, devices, &numDevices); + if (numDevices==1) + { + /* Nvidia EGL doesn't need X11 for p-buffer surface */ + display = getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, devices[0], 0); + configAttribs[1] = EGL_PBUFFER_BIT; + pBuffer = 1; + } + } + if (display==EGL_NO_DISPLAY) + { + /* Fall-back to X11 surface, works on Mesa */ + display = getDisplay(EGL_DEFAULT_DISPLAY); + } + if (display == EGL_NO_DISPLAY) + return GL_TRUE; + + eglewInit(display); + + if (bindAPI(EGL_OPENGL_API) != EGL_TRUE) + return GL_TRUE; + + if (chooseConfig(display, configAttribs, &config, 1, &numConfig) != EGL_TRUE || (numConfig != 1)) + return GL_TRUE; + + ctx = createContext(display, config, EGL_NO_CONTEXT, pBuffer ? contextAttribs : NULL); + if (NULL == ctx) + return GL_TRUE; + + surface = EGL_NO_SURFACE; + /* Create a p-buffer surface if possible */ + if (pBuffer && createPbufferSurface) + { + surface = createPbufferSurface(display, config, pBufferAttribs); + } + /* Create a generic surface without a native window, if necessary */ + if (surface==EGL_NO_SURFACE) + { + surface = createWindowSurface(display, config, (EGLNativeWindowType) NULL, NULL); + } +#if 0 + if (surface == EGL_NO_SURFACE) + return GL_TRUE; +#endif + + if (makeCurrent(display, surface, surface, ctx) != EGL_TRUE) + return GL_TRUE; + + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != ctx) eglDestroyContext(display, ctx); +} + +#elif defined(GLEW_OSMESA) +OSMesaContext ctx; + +static const GLint osmFormat = GL_UNSIGNED_BYTE; +static const GLint osmWidth = 640; +static const GLint osmHeight = 480; +static GLubyte *osmPixels = NULL; + +GLboolean glewCreateContext (struct createParams *params) +{ + ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); + if (NULL == ctx) return GL_TRUE; + if (NULL == osmPixels) + { + osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1); + } + if (!OSMesaMakeCurrent(ctx, osmPixels, GL_UNSIGNED_BYTE, osmWidth, osmHeight)) + { + return GL_TRUE; + } + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != ctx) OSMesaDestroyContext(ctx); +} + +#elif defined(_WIN32) + +HWND wnd = NULL; +HDC dc = NULL; +HGLRC rc = NULL; + +GLboolean glewCreateContext (struct createParams* params) +{ + WNDCLASS wc; + PIXELFORMATDESCRIPTOR pfd; + /* register window class */ + ZeroMemory(&wc, sizeof(WNDCLASS)); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "GLEW"; + if (0 == RegisterClass(&wc)) return GL_TRUE; + /* create window */ + wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), NULL); + if (NULL == wnd) return GL_TRUE; + /* get the device context */ + dc = GetDC(wnd); + if (NULL == dc) return GL_TRUE; + /* find pixel format */ + ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); + if (params->pixelformat == -1) /* find default */ + { + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + params->pixelformat = ChoosePixelFormat(dc, &pfd); + if (params->pixelformat == 0) return GL_TRUE; + } + /* set the pixel format for the dc */ + if (FALSE == SetPixelFormat(dc, params->pixelformat, &pfd)) return GL_TRUE; + /* create rendering context */ + rc = wglCreateContext(dc); + if (NULL == rc) return GL_TRUE; + if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE; + if (params->major || params->profile || params->flags) + { + HGLRC oldRC = rc; + int contextAttrs[20]; + int i; + + wglewInit(); + + /* Intel HD 3000 has WGL_ARB_create_context, but not WGL_ARB_create_context_profile */ + if (!wglewGetExtension("WGL_ARB_create_context")) + return GL_TRUE; + + i = 0; + if (params->major) + { + contextAttrs[i++] = WGL_CONTEXT_MAJOR_VERSION_ARB; + contextAttrs[i++] = params->major; + contextAttrs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB; + contextAttrs[i++] = params->minor; + } + if (params->profile) + { + contextAttrs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; + contextAttrs[i++] = params->profile; + } + if (params->flags) + { + contextAttrs[i++] = WGL_CONTEXT_FLAGS_ARB; + contextAttrs[i++] = params->flags; + } + contextAttrs[i++] = 0; + rc = wglCreateContextAttribsARB(dc, 0, contextAttrs); + + if (NULL == rc) return GL_TRUE; + if (!wglMakeCurrent(dc, rc)) return GL_TRUE; + + wglDeleteContext(oldRC); + } + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != rc) wglMakeCurrent(NULL, NULL); + if (NULL != rc) wglDeleteContext(rc); + if (NULL != wnd && NULL != dc) ReleaseDC(wnd, dc); + if (NULL != wnd) DestroyWindow(wnd); + UnregisterClass("GLEW", GetModuleHandle(NULL)); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +#include +#include + +CGLContextObj ctx, octx; + +GLboolean glewCreateContext (struct createParams *params) +{ + CGLPixelFormatAttribute contextAttrs[20]; + int i; + CGLPixelFormatObj pf; + GLint npix; + CGLError error; + + i = 0; + contextAttrs[i++] = kCGLPFAAccelerated; /* No software rendering */ + + /* MAC_OS_X_VERSION_10_7 == 1070 */ + #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + if (params->profile & GL_CONTEXT_CORE_PROFILE_BIT) + { + if ((params->major==3 && params->minor>=2) || params->major>3) + { + contextAttrs[i++] = kCGLPFAOpenGLProfile; /* OSX 10.7 Lion onwards */ + contextAttrs[i++] = (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core; /* 3.2 Core Context */ + } + } + #endif + + contextAttrs[i++] = 0; + + error = CGLChoosePixelFormat(contextAttrs, &pf, &npix); + if (error) return GL_TRUE; + error = CGLCreateContext(pf, NULL, &ctx); + if (error) return GL_TRUE; + CGLReleasePixelFormat(pf); + octx = CGLGetCurrentContext(); + error = CGLSetCurrentContext(ctx); + if (error) return GL_TRUE; + /* Needed for Regal on the Mac */ + #if defined(GLEW_REGAL) && defined(__APPLE__) + RegalMakeCurrent(ctx); + #endif + return GL_FALSE; +} + +void glewDestroyContext () +{ + CGLSetCurrentContext(octx); + CGLReleaseContext(ctx); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__HAIKU__) + +GLboolean glewCreateContext (struct createParams *params) +{ + /* TODO: Haiku: We need to call C++ code here */ + return GL_FALSE; +} + +void glewDestroyContext () +{ + /* TODO: Haiku: We need to call C++ code here */ +} + +/* ------------------------------------------------------------------------ */ + +#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +Display* dpy = NULL; +XVisualInfo* vi = NULL; +XVisualInfo* vis = NULL; +GLXContext ctx = NULL; +Window wnd = 0; +Colormap cmap = 0; + +GLboolean glewCreateContext (struct createParams *params) +{ + int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; + int erb, evb; + XSetWindowAttributes swa; + /* open display */ + dpy = XOpenDisplay(params->display); + if (NULL == dpy) return GL_TRUE; + /* query for glx */ + if (!glXQueryExtension(dpy, &erb, &evb)) return GL_TRUE; + /* choose visual */ + if (params->visual == -1) + { + vi = glXChooseVisual(dpy, DefaultScreen(dpy), attrib); + if (NULL == vi) return GL_TRUE; + params->visual = (int)XVisualIDFromVisual(vi->visual); + } + else + { + int n_vis, i; + vis = XGetVisualInfo(dpy, 0, NULL, &n_vis); + for (i=0; ivisual) + vi = &vis[i]; + } + if (vi == NULL) return GL_TRUE; + } + /* create context */ + ctx = glXCreateContext(dpy, vi, None, True); + if (NULL == ctx) return GL_TRUE; + /* create window */ + /*wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0);*/ + cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); + swa.border_pixel = 0; + swa.colormap = cmap; + wnd = XCreateWindow(dpy, RootWindow(dpy, vi->screen), + 0, 0, 1, 1, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap, &swa); + /* make context current */ + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + if (params->major || params->profile || params->flags) + { + GLXContext oldCtx = ctx; + GLXFBConfig *FBConfigs; + int FBConfigAttrs[] = { GLX_FBCONFIG_ID, 0, None }; + int contextAttrs[20]; + int nelems, i; + + glxewInit(); + + if (!glxewGetExtension("GLX_ARB_create_context")) + return GL_TRUE; + + if (glXQueryContext(dpy, oldCtx, GLX_FBCONFIG_ID, &FBConfigAttrs[1])) + return GL_TRUE; + FBConfigs = glXChooseFBConfig(dpy, vi->screen, FBConfigAttrs, &nelems); + + if (nelems < 1) + return GL_TRUE; + + i = 0; + if (params->major) + { + contextAttrs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB; + contextAttrs[i++] = params->major; + contextAttrs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB; + contextAttrs[i++] = params->minor; + } + if (params->profile) + { + contextAttrs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB; + contextAttrs[i++] = params->profile; + } + if (params->flags) + { + contextAttrs[i++] = GLX_CONTEXT_FLAGS_ARB; + contextAttrs[i++] = params->flags; + } + contextAttrs[i++] = None; + ctx = glXCreateContextAttribsARB(dpy, *FBConfigs, NULL, True, contextAttrs); + + if (NULL == ctx) return GL_TRUE; + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + + glXDestroyContext(dpy, oldCtx); + + XFree(FBConfigs); + } + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx); + if (NULL != dpy && 0 != wnd) XDestroyWindow(dpy, wnd); + if (NULL != dpy && 0 != cmap) XFreeColormap(dpy, cmap); + if (NULL != vis) + XFree(vis); + else if (NULL != vi) + XFree(vi); + if (NULL != dpy) XCloseDisplay(dpy); +} + +#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ diff --git a/Windows/glew/src/visualinfo.c b/Windows/glew/src/visualinfo.c new file mode 100644 index 00000000..99e8c635 --- /dev/null +++ b/Windows/glew/src/visualinfo.c @@ -0,0 +1,1297 @@ +/* +** visualinfo.c +** +** Copyright (C) Nate Robins, 1997 +** Michael Wimmer, 1999 +** Milan Ikits, 2002-2008 +** Nigel Stewart, 2008-2013 +** +** visualinfo is a small utility that displays all available visuals, +** aka. pixelformats, in an OpenGL system along with renderer version +** information. It shows a table of all the visuals that support OpenGL +** along with their capabilities. The format of the table is similar to +** that of glxinfo on Unix systems: +** +** visual ~= pixel format descriptor +** id = visual id (integer from 1 - max visuals) +** tp = type (wn: window, pb: pbuffer, wp: window & pbuffer, bm: bitmap) +** ac = acceleration (ge: generic, fu: full, no: none) +** fm = format (i: integer, f: float, c: color index) +** db = double buffer (y = yes) +** sw = swap method (x: exchange, c: copy, u: undefined) +** st = stereo (y = yes) +** sz = total # bits +** r = # bits of red +** g = # bits of green +** b = # bits of blue +** a = # bits of alpha +** axbf = # aux buffers +** dpth = # bits of depth +** stcl = # bits of stencil +*/ + +#include +#include +#include +#include +#if defined(GLEW_OSMESA) +#define GLAPI extern +#include +#elif defined(GLEW_EGL) +#include +#elif defined(_WIN32) +#include +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +#include +#include +#elif !defined(__HAIKU__) +#include +#endif + +#ifdef GLEW_MX +GLEWContext _glewctx; +# define glewGetContext() (&_glewctx) +# ifdef _WIN32 +WGLEWContext _wglewctx; +# define wglewGetContext() (&_wglewctx) +# elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +GLXEWContext _glxewctx; +# define glxewGetContext() (&_glxewctx) +# endif +#endif /* GLEW_MX */ + +typedef struct GLContextStruct +{ +#if defined(GLEW_OSMESA) + OSMesaContext ctx; +#elif defined(GLEW_EGL) + EGLContext ctx; +#elif defined(_WIN32) + HWND wnd; + HDC dc; + HGLRC rc; +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + CGLContextObj ctx, octx; +#elif !defined(__HAIKU__) + Display* dpy; + XVisualInfo* vi; + GLXContext ctx; + Window wnd; + Colormap cmap; +#endif +} GLContext; + +void InitContext (GLContext* ctx); +GLboolean CreateContext (GLContext* ctx); +void DestroyContext (GLContext* ctx); +void VisualInfo (GLContext* ctx); +void PrintExtensions (const char* s); +GLboolean ParseArgs (int argc, char** argv); + +int showall = 0; +int displaystdout = 0; +int verbose = 0; +int drawableonly = 0; + +char* display = NULL; +int visual = -1; + +FILE* file = 0; + +int +main (int argc, char** argv) +{ + GLenum err; + GLContext ctx; + + /* ---------------------------------------------------------------------- */ + /* parse arguments */ + if (GL_TRUE == ParseArgs(argc-1, argv+1)) + { +#if defined(_WIN32) + fprintf(stderr, "Usage: visualinfo [-a] [-s] [-h] [-pf ]\n"); + fprintf(stderr, " -a: show all visuals\n"); + fprintf(stderr, " -s: display to stdout instead of visualinfo.txt\n"); + fprintf(stderr, " -pf : use given pixelformat\n"); + fprintf(stderr, " -h: this screen\n"); +#else + fprintf(stderr, "Usage: visualinfo [-h] [-display ] [-visual ]\n"); + fprintf(stderr, " -h: this screen\n"); + fprintf(stderr, " -display : use given display\n"); + fprintf(stderr, " -visual : use given visual\n"); +#endif + return 1; + } + + /* ---------------------------------------------------------------------- */ + /* create OpenGL rendering context */ + InitContext(&ctx); + if (GL_TRUE == CreateContext(&ctx)) + { + fprintf(stderr, "Error: CreateContext failed\n"); + DestroyContext(&ctx); + return 1; + } + + /* ---------------------------------------------------------------------- */ + /* initialize GLEW */ + glewExperimental = GL_TRUE; +#ifdef GLEW_MX + err = glewContextInit(glewGetContext()); +# ifdef _WIN32 + err = err || wglewContextInit(wglewGetContext()); +# elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) + err = err || glxewContextInit(glxewGetContext()); +# endif +#else + err = glewInit(); +#endif + if (GLEW_OK != err) + { + fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); + DestroyContext(&ctx); + return 1; + } + + /* ---------------------------------------------------------------------- */ + /* open file */ +#if defined(_WIN32) + if (!displaystdout) + { +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + if (fopen_s(&file, "visualinfo.txt", "w") != 0) + file = stdout; +#else + file = fopen("visualinfo.txt", "w"); +#endif + } + if (file == NULL) + file = stdout; +#else + file = stdout; +#endif + + /* ---------------------------------------------------------------------- */ + /* output header information */ + /* OpenGL extensions */ + fprintf(file, "OpenGL vendor string: %s\n", glGetString(GL_VENDOR)); + fprintf(file, "OpenGL renderer string: %s\n", glGetString(GL_RENDERER)); + fprintf(file, "OpenGL version string: %s\n", glGetString(GL_VERSION)); + fprintf(file, "OpenGL extensions (GL_): \n"); + PrintExtensions((const char*)glGetString(GL_EXTENSIONS)); + +#ifndef GLEW_NO_GLU + /* GLU extensions */ + fprintf(file, "GLU version string: %s\n", gluGetString(GLU_VERSION)); + fprintf(file, "GLU extensions (GLU_): \n"); + PrintExtensions((const char*)gluGetString(GLU_EXTENSIONS)); +#endif + + /* ---------------------------------------------------------------------- */ + /* extensions string */ +#if defined(GLEW_OSMESA) +#elif defined(GLEW_EGL) +#elif defined(_WIN32) + /* WGL extensions */ + if (WGLEW_ARB_extensions_string || WGLEW_EXT_extensions_string) + { + fprintf(file, "WGL extensions (WGL_): \n"); + PrintExtensions(wglGetExtensionsStringARB ? + (const char*)wglGetExtensionsStringARB(ctx.dc) : + (const char*)wglGetExtensionsStringEXT()); + } +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +#elif defined(__HAIKU__) + + /* TODO */ + +#else + /* GLX extensions */ + fprintf(file, "GLX extensions (GLX_): \n"); + PrintExtensions(glXQueryExtensionsString(glXGetCurrentDisplay(), + DefaultScreen(glXGetCurrentDisplay()))); +#endif + + /* ---------------------------------------------------------------------- */ + /* enumerate all the formats */ + VisualInfo(&ctx); + + /* ---------------------------------------------------------------------- */ + /* release resources */ + DestroyContext(&ctx); + if (file != stdout) + fclose(file); + return 0; +} + +/* do the magic to separate all extensions with comma's, except + for the last one that _may_ terminate in a space. */ +void PrintExtensions (const char* s) +{ + char t[80]; + int i=0; + char* p=0; + + t[79] = '\0'; + while (*s) + { + t[i++] = *s; + if(*s == ' ') + { + if (*(s+1) != '\0') { + t[i-1] = ','; + t[i] = ' '; + p = &t[i++]; + } + else /* zoinks! last one terminated in a space! */ + { + t[i-1] = '\0'; + } + } + if(i > 80 - 5) + { + *p = t[i] = '\0'; + fprintf(file, " %s\n", t); + p++; + i = (int)strlen(p); +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + strcpy_s(t, sizeof(t), p); +#else + strcpy(t, p); +#endif + } + s++; + } + t[i] = '\0'; + fprintf(file, " %s.\n", t); +} + +/* ---------------------------------------------------------------------- */ + +#if defined(GLEW_OSMESA) || defined(GLEW_EGL) + +void +VisualInfo (GLContext* ctx) +{ +} + +#elif defined(_WIN32) + +void +VisualInfoARB (GLContext* ctx) +{ + int attrib[32], value[32], n_attrib, n_pbuffer=0, n_float=0; + int i, pf, maxpf; + unsigned int c; + + /* to get pbuffer capable pixel formats */ + attrib[0] = WGL_DRAW_TO_PBUFFER_ARB; + attrib[1] = GL_TRUE; + attrib[2] = 0; + wglChoosePixelFormatARB(ctx->dc, attrib, 0, 1, &pf, &c); + /* query number of pixel formats */ + attrib[0] = WGL_NUMBER_PIXEL_FORMATS_ARB; + wglGetPixelFormatAttribivARB(ctx->dc, 0, 0, 1, attrib, value); + maxpf = value[0]; + for (i=0; i<32; i++) + value[i] = 0; + + attrib[0] = WGL_SUPPORT_OPENGL_ARB; + attrib[1] = WGL_DRAW_TO_WINDOW_ARB; + attrib[2] = WGL_DRAW_TO_BITMAP_ARB; + attrib[3] = WGL_ACCELERATION_ARB; + /* WGL_NO_ACCELERATION_ARB, WGL_GENERIC_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB */ + attrib[4] = WGL_SWAP_METHOD_ARB; + /* WGL_SWAP_EXCHANGE_ARB, WGL_SWAP_COPY_ARB, WGL_SWAP_UNDEFINED_ARB */ + attrib[5] = WGL_DOUBLE_BUFFER_ARB; + attrib[6] = WGL_STEREO_ARB; + attrib[7] = WGL_PIXEL_TYPE_ARB; + /* WGL_TYPE_RGBA_ARB, WGL_TYPE_COLORINDEX_ARB, + WGL_TYPE_RGBA_FLOAT_ATI (WGL_ATI_pixel_format_float) */ + /* Color buffer information */ + attrib[8] = WGL_COLOR_BITS_ARB; + attrib[9] = WGL_RED_BITS_ARB; + attrib[10] = WGL_GREEN_BITS_ARB; + attrib[11] = WGL_BLUE_BITS_ARB; + attrib[12] = WGL_ALPHA_BITS_ARB; + /* Accumulation buffer information */ + attrib[13] = WGL_ACCUM_BITS_ARB; + attrib[14] = WGL_ACCUM_RED_BITS_ARB; + attrib[15] = WGL_ACCUM_GREEN_BITS_ARB; + attrib[16] = WGL_ACCUM_BLUE_BITS_ARB; + attrib[17] = WGL_ACCUM_ALPHA_BITS_ARB; + /* Depth, stencil, and aux buffer information */ + attrib[18] = WGL_DEPTH_BITS_ARB; + attrib[19] = WGL_STENCIL_BITS_ARB; + attrib[20] = WGL_AUX_BUFFERS_ARB; + /* Layer information */ + attrib[21] = WGL_NUMBER_OVERLAYS_ARB; + attrib[22] = WGL_NUMBER_UNDERLAYS_ARB; + attrib[23] = WGL_SWAP_LAYER_BUFFERS_ARB; + attrib[24] = WGL_SAMPLES_ARB; + attrib[25] = WGL_SUPPORT_GDI_ARB; + n_attrib = 26; + if (WGLEW_ARB_pbuffer) + { + attrib[n_attrib] = WGL_DRAW_TO_PBUFFER_ARB; + n_pbuffer = n_attrib; + n_attrib++; + } + if (WGLEW_NV_float_buffer) + { + attrib[n_attrib] = WGL_FLOAT_COMPONENTS_NV; + n_float = n_attrib; + n_attrib++; + } + + if (!verbose) + { + /* print table header */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + fprintf(file, " | | visual | color | ax dp st | accum | layer |\n"); + fprintf(file, " | id | tp ac gd fm db sw st ms | sz r g b a | bf th cl | sz r g b a | ov un sw |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + wglGetPixelFormatAttribivARB(ctx->dc, i, 0, n_attrib, attrib, value); + /* only describe this format if it supports OpenGL */ + if (!value[0]) continue; + /* by default show only fully accelerated window or pbuffer capable visuals */ + if (!showall + && ((value[2] && !value[1]) + || (!WGLEW_ARB_pbuffer || !value[n_pbuffer]) + || (value[3] != WGL_FULL_ACCELERATION_ARB))) continue; + /* print out the information for this visual */ + /* visual id */ + fprintf(file, " |% 4d | ", i); + /* visual type */ + if (value[1]) + { + if (WGLEW_ARB_pbuffer && value[n_pbuffer]) fprintf(file, "wp "); + else fprintf(file, "wn "); + } + else + { + if (value[2]) fprintf(file, "bm "); + else if (WGLEW_ARB_pbuffer && value[n_pbuffer]) fprintf(file, "pb "); + } + /* acceleration */ + fprintf(file, "%s ", value[3] == WGL_FULL_ACCELERATION_ARB ? "fu" : + value[3] == WGL_GENERIC_ACCELERATION_ARB ? "ge" : + value[3] == WGL_NO_ACCELERATION_ARB ? "no" : ". "); + /* gdi support */ + fprintf(file, " %c ", value[25] ? 'y' : '.'); + /* format */ + if (WGLEW_NV_float_buffer && value[n_float]) fprintf(file, " f "); + else if (WGLEW_ATI_pixel_format_float && value[7] == WGL_TYPE_RGBA_FLOAT_ATI) fprintf(file, " f "); + else if (value[7] == WGL_TYPE_RGBA_ARB) fprintf(file, " i "); + else if (value[7] == WGL_TYPE_COLORINDEX_ARB) fprintf(file, " c "); + else if (value[7] == WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT) fprintf(file," p "); + else fprintf(file," ? "); + /* double buffer */ + fprintf(file, " %c ", value[5] ? 'y' : '.'); + /* swap method */ + if (value[4] == WGL_SWAP_EXCHANGE_ARB) fprintf(file, " x "); + else if (value[4] == WGL_SWAP_COPY_ARB) fprintf(file, " c "); + else if (value[4] == WGL_SWAP_UNDEFINED_ARB) fprintf(file, " . "); + else fprintf(file, " . "); + /* stereo */ + fprintf(file, " %c ", value[6] ? 'y' : '.'); + /* multisample */ + if (value[24] > 0) + fprintf(file, "%2d | ", value[24]); + else + fprintf(file, " . | "); + /* color size */ + if (value[8]) fprintf(file, "%3d ", value[8]); + else fprintf(file, " . "); + /* red */ + if (value[9]) fprintf(file, "%2d ", value[9]); + else fprintf(file, " . "); + /* green */ + if (value[10]) fprintf(file, "%2d ", value[10]); + else fprintf(file, " . "); + /* blue */ + if (value[11]) fprintf(file, "%2d ", value[11]); + else fprintf(file, " . "); + /* alpha */ + if (value[12]) fprintf(file, "%2d | ", value[12]); + else fprintf(file, " . | "); + /* aux buffers */ + if (value[20]) fprintf(file, "%2d ", value[20]); + else fprintf(file, " . "); + /* depth */ + if (value[18]) fprintf(file, "%2d ", value[18]); + else fprintf(file, " . "); + /* stencil */ + if (value[19]) fprintf(file, "%2d | ", value[19]); + else fprintf(file, " . | "); + /* accum size */ + if (value[13]) fprintf(file, "%3d ", value[13]); + else fprintf(file, " . "); + /* accum red */ + if (value[14]) fprintf(file, "%2d ", value[14]); + else fprintf(file, " . "); + /* accum green */ + if (value[15]) fprintf(file, "%2d ", value[15]); + else fprintf(file, " . "); + /* accum blue */ + if (value[16]) fprintf(file, "%2d ", value[16]); + else fprintf(file, " . "); + /* accum alpha */ + if (value[17]) fprintf(file, "%2d | ", value[17]); + else fprintf(file, " . | "); + /* overlay */ + if (value[21]) fprintf(file, "%2d ", value[21]); + else fprintf(file, " . "); + /* underlay */ + if (value[22]) fprintf(file, "%2d ", value[22]); + else fprintf(file, " . "); + /* layer swap */ + if (value[23]) fprintf(file, "y "); + else fprintf(file, " . "); + fprintf(file, "|\n"); + } + /* print table footer */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + fprintf(file, " | | visual | color | ax dp st | accum | layer |\n"); + fprintf(file, " | id | tp ac gd fm db sw st ms | sz r g b a | bf th cl | sz r g b a | ov un sw |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + } + else /* verbose */ + { +#if 0 + fprintf(file, "\n"); + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + DescribePixelFormat(ctx->dc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + /* only describe this format if it supports OpenGL */ + if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL) + || (drawableonly && !(pfd.dwFlags & PFD_DRAW_TO_WINDOW))) continue; + fprintf(file, "Visual ID: %2d depth=%d class=%s\n", i, pfd.cDepthBits, + pfd.cColorBits <= 8 ? "PseudoColor" : "TrueColor"); + fprintf(file, " bufferSize=%d level=%d renderType=%s doubleBuffer=%d stereo=%d\n", pfd.cColorBits, pfd.bReserved, pfd.iPixelType == PFD_TYPE_RGBA ? "rgba" : "ci", pfd.dwFlags & PFD_DOUBLEBUFFER, pfd.dwFlags & PFD_STEREO); + fprintf(file, " generic=%d generic accelerated=%d\n", (pfd.dwFlags & PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT, (pfd.dwFlags & PFD_GENERIC_ACCELERATED) == PFD_GENERIC_ACCELERATED); + fprintf(file, " rgba: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits, pfd.cAlphaBits); + fprintf(file, " auxBuffers=%d depthSize=%d stencilSize=%d\n", pfd.cAuxBuffers, pfd.cDepthBits, pfd.cStencilBits); + fprintf(file, " accum: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cAccumRedBits, pfd.cAccumGreenBits, pfd.cAccumBlueBits, pfd.cAccumAlphaBits); + fprintf(file, " multiSample=%d multisampleBuffers=%d\n", 0, 0); + fprintf(file, " Opaque.\n"); + } +#endif + } +} + +void +VisualInfoGDI (GLContext* ctx) +{ + int i, maxpf; + PIXELFORMATDESCRIPTOR pfd; + + /* calling DescribePixelFormat() with NULL pfd (!!!) return maximum + number of pixel formats */ + maxpf = DescribePixelFormat(ctx->dc, 1, 0, NULL); + + if (!verbose) + { + fprintf(file, "-----------------------------------------------------------------------------\n"); + fprintf(file, " visual x bf lv rg d st ge ge r g b a ax dp st accum buffs ms \n"); + fprintf(file, " id dep tp sp sz l ci b ro ne ac sz sz sz sz bf th cl sz r g b a ns b\n"); + fprintf(file, "-----------------------------------------------------------------------------\n"); + + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + DescribePixelFormat(ctx->dc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + /* only describe this format if it supports OpenGL */ + if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL) + || (drawableonly && (pfd.dwFlags & PFD_DRAW_TO_BITMAP))) continue; + /* other criteria could be tested here for actual pixel format + choosing in an application: + + for (...each pixel format...) { + if (pfd.dwFlags & PFD_SUPPORT_OPENGL && + pfd.dwFlags & PFD_DOUBLEBUFFER && + pfd.cDepthBits >= 24 && + pfd.cColorBits >= 24) + { + goto found; + } + } + ... not found so exit ... + found: + ... found so use it ... + */ + /* print out the information for this pixel format */ + fprintf(file, "0x%02x ", i); + fprintf(file, "%3d ", pfd.cColorBits); + if(pfd.dwFlags & PFD_DRAW_TO_WINDOW) fprintf(file, "wn "); + else if(pfd.dwFlags & PFD_DRAW_TO_BITMAP) fprintf(file, "bm "); + else fprintf(file, "pb "); + /* should find transparent pixel from LAYERPLANEDESCRIPTOR */ + fprintf(file, " . "); + fprintf(file, "%3d ", pfd.cColorBits); + /* bReserved field indicates number of over/underlays */ + if(pfd.bReserved) fprintf(file, " %d ", pfd.bReserved); + else fprintf(file, " . "); + fprintf(file, " %c ", pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : 'c'); + fprintf(file, "%c ", pfd.dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.'); + fprintf(file, " %c ", pfd.dwFlags & PFD_STEREO ? 'y' : '.'); + /* added: */ + fprintf(file, " %c ", pfd.dwFlags & PFD_GENERIC_FORMAT ? 'y' : '.'); + fprintf(file, " %c ", pfd.dwFlags & PFD_GENERIC_ACCELERATED ? 'y' : '.'); + if(pfd.cRedBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cRedBits); + else fprintf(file, " . "); + if(pfd.cGreenBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cGreenBits); + else fprintf(file, " . "); + if(pfd.cBlueBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cBlueBits); + else fprintf(file, " . "); + if(pfd.cAlphaBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cAlphaBits); + else fprintf(file, " . "); + if(pfd.cAuxBuffers) fprintf(file, "%2d ", pfd.cAuxBuffers); + else fprintf(file, " . "); + if(pfd.cDepthBits) fprintf(file, "%2d ", pfd.cDepthBits); + else fprintf(file, " . "); + if(pfd.cStencilBits) fprintf(file, "%2d ", pfd.cStencilBits); + else fprintf(file, " . "); + if(pfd.cAccumBits) fprintf(file, "%3d ", pfd.cAccumBits); + else fprintf(file, " . "); + if(pfd.cAccumRedBits) fprintf(file, "%2d ", pfd.cAccumRedBits); + else fprintf(file, " . "); + if(pfd.cAccumGreenBits) fprintf(file, "%2d ", pfd.cAccumGreenBits); + else fprintf(file, " . "); + if(pfd.cAccumBlueBits) fprintf(file, "%2d ", pfd.cAccumBlueBits); + else fprintf(file, " . "); + if(pfd.cAccumAlphaBits) fprintf(file, "%2d ", pfd.cAccumAlphaBits); + else fprintf(file, " . "); + /* no multisample in win32 */ + fprintf(file, " . .\n"); + } + /* print table footer */ + fprintf(file, "-----------------------------------------------------------------------------\n"); + fprintf(file, " visual x bf lv rg d st ge ge r g b a ax dp st accum buffs ms \n"); + fprintf(file, " id dep tp sp sz l ci b ro ne ac sz sz sz sz bf th cl sz r g b a ns b\n"); + fprintf(file, "-----------------------------------------------------------------------------\n"); + } + else /* verbose */ + { + fprintf(file, "\n"); + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + DescribePixelFormat(ctx->dc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + /* only describe this format if it supports OpenGL */ + if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL) + || (drawableonly && !(pfd.dwFlags & PFD_DRAW_TO_WINDOW))) continue; + fprintf(file, "Visual ID: %2d depth=%d class=%s\n", i, pfd.cDepthBits, + pfd.cColorBits <= 8 ? "PseudoColor" : "TrueColor"); + fprintf(file, " bufferSize=%d level=%d renderType=%s doubleBuffer=%ld stereo=%ld\n", pfd.cColorBits, pfd.bReserved, pfd.iPixelType == PFD_TYPE_RGBA ? "rgba" : "ci", pfd.dwFlags & PFD_DOUBLEBUFFER, pfd.dwFlags & PFD_STEREO); + fprintf(file, " generic=%d generic accelerated=%d\n", (pfd.dwFlags & PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT, (pfd.dwFlags & PFD_GENERIC_ACCELERATED) == PFD_GENERIC_ACCELERATED); + fprintf(file, " rgba: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits, pfd.cAlphaBits); + fprintf(file, " auxBuffers=%d depthSize=%d stencilSize=%d\n", pfd.cAuxBuffers, pfd.cDepthBits, pfd.cStencilBits); + fprintf(file, " accum: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cAccumRedBits, pfd.cAccumGreenBits, pfd.cAccumBlueBits, pfd.cAccumAlphaBits); + fprintf(file, " multiSample=%d multisampleBuffers=%d\n", 0, 0); + fprintf(file, " Opaque.\n"); + } + } +} + +void +VisualInfo (GLContext* ctx) +{ + if (WGLEW_ARB_pixel_format) + VisualInfoARB(ctx); + else + VisualInfoGDI(ctx); +} + +/* ---------------------------------------------------------------------- */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +void +VisualInfo (__attribute__((unused)) GLContext* ctx) +{ +/* + int attrib[] = { AGL_RGBA, AGL_NONE }; + AGLPixelFormat pf; + GLint value; + pf = aglChoosePixelFormat(NULL, 0, attrib); + while (pf != NULL) + { + aglDescribePixelFormat(pf, GL_RGBA, &value); + fprintf(stderr, "%d\n", value); + pf = aglNextPixelFormat(pf); + } +*/ +} + +/* ---------------------------------------------------------------------- */ + +#elif defined(__HAIKU__) + +void +VisualInfo (GLContext* ctx) +{ + /* TODO */ +} + +#else /* GLX */ + +void +VisualInfo (GLContext* ctx) +{ + int n_fbc; + GLXFBConfig* fbc; + int value, ret, i; + + fbc = glXGetFBConfigs(ctx->dpy, DefaultScreen(ctx->dpy), &n_fbc); + + if (fbc) + { + if (!verbose) + { + /* print table header */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + fprintf(file, " | | visual | color | ax dp st | accum | ms | cav |\n"); + fprintf(file, " | id | tp xr cl fm db st lv xp | sz r g b a | bf th cl | r g b a | ns b | eat |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + /* loop through all the fbcs */ + for (i=0; idpy, fbc[i], GLX_FBCONFIG_ID, &value); + if (ret != Success) + { + fprintf(file, "| ? |"); + } + else + { + fprintf(file, " |% 4d | ", value); + } + /* visual type */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_DRAWABLE_TYPE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + if (value & GLX_WINDOW_BIT) + { + if (value & GLX_PBUFFER_BIT) + { + fprintf(file, "wp "); + } + else + { + fprintf(file, "wn "); + } + } + else + { + if (value & GLX_PBUFFER_BIT) + { + fprintf(file, "pb "); + } + else if (value & GLX_PIXMAP_BIT) + { + fprintf(file, "pm "); + } + else + { + fprintf(file, " ? "); + } + } + } + /* x renderable */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_X_RENDERABLE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + fprintf(file, value ? " y " : " n "); + } + /* class */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_X_VISUAL_TYPE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + if (GLX_TRUE_COLOR == value) + fprintf(file, "tc "); + else if (GLX_DIRECT_COLOR == value) + fprintf(file, "dc "); + else if (GLX_PSEUDO_COLOR == value) + fprintf(file, "pc "); + else if (GLX_STATIC_COLOR == value) + fprintf(file, "sc "); + else if (GLX_GRAY_SCALE == value) + fprintf(file, "gs "); + else if (GLX_STATIC_GRAY == value) + fprintf(file, "sg "); + else if (GLX_X_VISUAL_TYPE == value) + fprintf(file, " . "); + else + fprintf(file, " ? "); + } + /* format */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_RENDER_TYPE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + if (GLXEW_NV_float_buffer) + { + int ret2, value2; + ret2 = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_FLOAT_COMPONENTS_NV, &value2); + if (Success == ret2 && GL_TRUE == value2) + { + fprintf(file, " f "); + } + else if (value & GLX_RGBA_BIT) + fprintf(file, " i "); + else if (value & GLX_COLOR_INDEX_BIT) + fprintf(file, " c "); + else + fprintf(file, " ? "); + } + else + { + if (value & GLX_RGBA_FLOAT_ATI_BIT) + fprintf(file, " f "); + else if (value & GLX_RGBA_BIT) + fprintf(file, " i "); + else if (value & GLX_COLOR_INDEX_BIT) + fprintf(file, " c "); + else + fprintf(file, " ? "); + } + } + /* double buffer */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_DOUBLEBUFFER, &value); + fprintf(file, " %c ", Success != ret ? '?' : (value ? 'y' : '.')); + /* stereo */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_STEREO, &value); + fprintf(file, " %c ", Success != ret ? '?' : (value ? 'y' : '.')); + /* level */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_LEVEL, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + fprintf(file, "%2d ", value); + } + /* transparency */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_TRANSPARENT_TYPE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (GLX_TRANSPARENT_RGB == value) + fprintf(file, " r | "); + else if (GLX_TRANSPARENT_INDEX == value) + fprintf(file, " i | "); + else if (GLX_NONE == value) + fprintf(file, " . | "); + else + fprintf(file, " ? | "); + } + /* color size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_BUFFER_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%3d ", value); + else + fprintf(file, " . "); + } + /* red size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_RED_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* green size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_GREEN_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* blue size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_BLUE_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* alpha size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ALPHA_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (value) + fprintf(file, "%2d | ", value); + else + fprintf(file, " . | "); + } + /* aux buffers */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_AUX_BUFFERS, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* depth size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_DEPTH_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* stencil size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_STENCIL_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (value) + fprintf(file, "%2d | ", value); + else + fprintf(file, " . | "); + } + /* accum red size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_RED_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* accum green size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_GREEN_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* accum blue size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_BLUE_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* accum alpha size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_ALPHA_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (value) + fprintf(file, "%2d | ", value); + else + fprintf(file, " . | "); + } + /* multisample */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_SAMPLES, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + fprintf(file, "%2d ", value); + } + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_SAMPLE_BUFFERS, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + fprintf(file, "%2d | ", value); + } + /* caveat */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_CONFIG_CAVEAT, &value); + if (Success != ret) + { + fprintf(file, "???? |"); + } + else + { + if (GLX_NONE == value) + fprintf(file, "none |\n"); + else if (GLX_SLOW_CONFIG == value) + fprintf(file, "slow |\n"); + else if (GLX_NON_CONFORMANT_CONFIG == value) + fprintf(file, "ncft |\n"); + else + fprintf(file, "???? |\n"); + } + } + /* print table footer */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + fprintf(file, " | id | tp xr cl fm db st lv xp | sz r g b a | bf th cl | r g b a | ns b | eat |\n"); + fprintf(file, " | | visual | color | ax dp st | accum | ms | cav |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + } + } +} + +#endif + +/* ------------------------------------------------------------------------ */ + +#if defined(GLEW_OSMESA) +void InitContext (GLContext* ctx) +{ + ctx->ctx = NULL; +} + +static const GLint osmFormat = GL_UNSIGNED_BYTE; +static const GLint osmWidth = 640; +static const GLint osmHeight = 480; +static GLubyte *osmPixels = NULL; + +GLboolean CreateContext (GLContext* ctx) +{ + if (NULL == ctx) return GL_TRUE; + ctx->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); + if (NULL == ctx->ctx) return GL_TRUE; + if (NULL == osmPixels) + { + osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1); + } + if (!OSMesaMakeCurrent(ctx->ctx, osmPixels, GL_UNSIGNED_BYTE, osmWidth, osmHeight)) + { + return GL_TRUE; + } + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL == ctx) return; + if (NULL != ctx->ctx) OSMesaDestroyContext(ctx->ctx); +} +/* ------------------------------------------------------------------------ */ + +#elif defined(GLEW_EGL) +void InitContext (GLContext* ctx) +{ + ctx->ctx = NULL; +} + +GLboolean CreateContext (GLContext* ctx) +{ + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL == ctx) return; + return; +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(_WIN32) + +void InitContext (GLContext* ctx) +{ + ctx->wnd = NULL; + ctx->dc = NULL; + ctx->rc = NULL; +} + +GLboolean CreateContext (GLContext* ctx) +{ + WNDCLASS wc; + PIXELFORMATDESCRIPTOR pfd; + /* check for input */ + if (NULL == ctx) return GL_TRUE; + /* register window class */ + ZeroMemory(&wc, sizeof(WNDCLASS)); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "GLEW"; + if (0 == RegisterClass(&wc)) return GL_TRUE; + /* create window */ + ctx->wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, + GetModuleHandle(NULL), NULL); + if (NULL == ctx->wnd) return GL_TRUE; + /* get the device context */ + ctx->dc = GetDC(ctx->wnd); + if (NULL == ctx->dc) return GL_TRUE; + /* find pixel format */ + ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); + if (visual == -1) /* find default */ + { + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + visual = ChoosePixelFormat(ctx->dc, &pfd); + if (0 == visual) return GL_TRUE; + } + /* set the pixel format for the dc */ + if (FALSE == SetPixelFormat(ctx->dc, visual, &pfd)) return GL_TRUE; + /* create rendering context */ + ctx->rc = wglCreateContext(ctx->dc); + if (NULL == ctx->rc) return GL_TRUE; + if (FALSE == wglMakeCurrent(ctx->dc, ctx->rc)) return GL_TRUE; + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL == ctx) return; + if (NULL != ctx->rc) wglMakeCurrent(NULL, NULL); + if (NULL != ctx->rc) wglDeleteContext(wglGetCurrentContext()); + if (NULL != ctx->wnd && NULL != ctx->dc) ReleaseDC(ctx->wnd, ctx->dc); + if (NULL != ctx->wnd) DestroyWindow(ctx->wnd); + UnregisterClass("GLEW", GetModuleHandle(NULL)); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +void InitContext (GLContext* ctx) +{ + ctx->ctx = NULL; + ctx->octx = NULL; +} + +GLboolean CreateContext (GLContext* ctx) +{ + CGLPixelFormatAttribute attrib[] = { kCGLPFAAccelerated, 0 }; + CGLPixelFormatObj pf; + GLint npix; + CGLError error; + /* check input */ + if (NULL == ctx) return GL_TRUE; + error = CGLChoosePixelFormat(attrib, &pf, &npix); + if (error) return GL_TRUE; + error = CGLCreateContext(pf, NULL, &ctx->ctx); + if (error) return GL_TRUE; + CGLReleasePixelFormat(pf); + ctx->octx = CGLGetCurrentContext(); + error = CGLSetCurrentContext(ctx->ctx); + if (error) return GL_TRUE; + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL == ctx) return; + CGLSetCurrentContext(ctx->octx); + if (NULL != ctx->ctx) CGLReleaseContext(ctx->ctx); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__HAIKU__) + +void +InitContext (GLContext* ctx) +{ + /* TODO */ +} + +GLboolean +CreateContext (GLContext* ctx) +{ + /* TODO */ + return GL_FALSE; +} + +void +DestroyContext (GLContext* ctx) +{ + /* TODO */ +} + +/* ------------------------------------------------------------------------ */ + +#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +void InitContext (GLContext* ctx) +{ + ctx->dpy = NULL; + ctx->vi = NULL; + ctx->ctx = NULL; + ctx->wnd = 0; + ctx->cmap = 0; +} + +GLboolean CreateContext (GLContext* ctx) +{ + int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; + int erb, evb; + XSetWindowAttributes swa; + /* check input */ + if (NULL == ctx) return GL_TRUE; + /* open display */ + ctx->dpy = XOpenDisplay(display); + if (NULL == ctx->dpy) return GL_TRUE; + /* query for glx */ + if (!glXQueryExtension(ctx->dpy, &erb, &evb)) return GL_TRUE; + /* choose visual */ + ctx->vi = glXChooseVisual(ctx->dpy, DefaultScreen(ctx->dpy), attrib); + if (NULL == ctx->vi) return GL_TRUE; + /* create context */ + ctx->ctx = glXCreateContext(ctx->dpy, ctx->vi, None, True); + if (NULL == ctx->ctx) return GL_TRUE; + /* create window */ + /*wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0);*/ + ctx->cmap = XCreateColormap(ctx->dpy, RootWindow(ctx->dpy, ctx->vi->screen), + ctx->vi->visual, AllocNone); + swa.border_pixel = 0; + swa.colormap = ctx->cmap; + ctx->wnd = XCreateWindow(ctx->dpy, RootWindow(ctx->dpy, ctx->vi->screen), + 0, 0, 1, 1, 0, ctx->vi->depth, InputOutput, ctx->vi->visual, + CWBorderPixel | CWColormap, &swa); + /* make context current */ + if (!glXMakeCurrent(ctx->dpy, ctx->wnd, ctx->ctx)) return GL_TRUE; + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL != ctx->dpy && NULL != ctx->ctx) glXDestroyContext(ctx->dpy, ctx->ctx); + if (NULL != ctx->dpy && 0 != ctx->wnd) XDestroyWindow(ctx->dpy, ctx->wnd); + if (NULL != ctx->dpy && 0 != ctx->cmap) XFreeColormap(ctx->dpy, ctx->cmap); + if (NULL != ctx->vi) XFree(ctx->vi); + if (NULL != ctx->dpy) XCloseDisplay(ctx->dpy); +} + +#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +GLboolean ParseArgs (int argc, char** argv) +{ + int p = 0; + while (p < argc) + { +#if defined(_WIN32) + if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + display = NULL; + visual = strtol(argv[p], NULL, 0); + } + else if (!strcmp(argv[p], "-a")) + { + showall = 1; + } + else if (!strcmp(argv[p], "-s")) + { + displaystdout = 1; + } + else if (!strcmp(argv[p], "-h")) + { + return GL_TRUE; + } + else + return GL_TRUE; +#else + if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + display = argv[p]; + } + else if (!strcmp(argv[p], "-visual")) + { + if (++p >= argc) return GL_TRUE; + visual = (int)strtol(argv[p], NULL, 0); + } + else if (!strcmp(argv[p], "-h")) + { + return GL_TRUE; + } + else + return GL_TRUE; +#endif + p++; + } + return GL_FALSE; +} diff --git a/glm/CMakeLists.txt b/glm/glm/CMakeLists.txt similarity index 100% rename from glm/CMakeLists.txt rename to glm/glm/CMakeLists.txt diff --git a/glm/common.hpp b/glm/glm/common.hpp similarity index 100% rename from glm/common.hpp rename to glm/glm/common.hpp diff --git a/glm/detail/_features.hpp b/glm/glm/detail/_features.hpp similarity index 100% rename from glm/detail/_features.hpp rename to glm/glm/detail/_features.hpp diff --git a/glm/detail/_fixes.hpp b/glm/glm/detail/_fixes.hpp similarity index 100% rename from glm/detail/_fixes.hpp rename to glm/glm/detail/_fixes.hpp diff --git a/glm/detail/_noise.hpp b/glm/glm/detail/_noise.hpp similarity index 100% rename from glm/detail/_noise.hpp rename to glm/glm/detail/_noise.hpp diff --git a/glm/detail/_swizzle.hpp b/glm/glm/detail/_swizzle.hpp similarity index 100% rename from glm/detail/_swizzle.hpp rename to glm/glm/detail/_swizzle.hpp diff --git a/glm/detail/_swizzle_func.hpp b/glm/glm/detail/_swizzle_func.hpp similarity index 100% rename from glm/detail/_swizzle_func.hpp rename to glm/glm/detail/_swizzle_func.hpp diff --git a/glm/detail/_vectorize.hpp b/glm/glm/detail/_vectorize.hpp similarity index 100% rename from glm/detail/_vectorize.hpp rename to glm/glm/detail/_vectorize.hpp diff --git a/glm/detail/compute_common.hpp b/glm/glm/detail/compute_common.hpp similarity index 100% rename from glm/detail/compute_common.hpp rename to glm/glm/detail/compute_common.hpp diff --git a/glm/detail/compute_vector_relational.hpp b/glm/glm/detail/compute_vector_relational.hpp similarity index 100% rename from glm/detail/compute_vector_relational.hpp rename to glm/glm/detail/compute_vector_relational.hpp diff --git a/glm/detail/func_common.inl b/glm/glm/detail/func_common.inl similarity index 100% rename from glm/detail/func_common.inl rename to glm/glm/detail/func_common.inl diff --git a/glm/detail/func_common_simd.inl b/glm/glm/detail/func_common_simd.inl similarity index 100% rename from glm/detail/func_common_simd.inl rename to glm/glm/detail/func_common_simd.inl diff --git a/glm/detail/func_exponential.inl b/glm/glm/detail/func_exponential.inl similarity index 100% rename from glm/detail/func_exponential.inl rename to glm/glm/detail/func_exponential.inl diff --git a/glm/detail/func_exponential_simd.inl b/glm/glm/detail/func_exponential_simd.inl similarity index 100% rename from glm/detail/func_exponential_simd.inl rename to glm/glm/detail/func_exponential_simd.inl diff --git a/glm/detail/func_geometric.inl b/glm/glm/detail/func_geometric.inl similarity index 100% rename from glm/detail/func_geometric.inl rename to glm/glm/detail/func_geometric.inl diff --git a/glm/detail/func_geometric_simd.inl b/glm/glm/detail/func_geometric_simd.inl similarity index 100% rename from glm/detail/func_geometric_simd.inl rename to glm/glm/detail/func_geometric_simd.inl diff --git a/glm/detail/func_integer.inl b/glm/glm/detail/func_integer.inl similarity index 100% rename from glm/detail/func_integer.inl rename to glm/glm/detail/func_integer.inl diff --git a/glm/detail/func_integer_simd.inl b/glm/glm/detail/func_integer_simd.inl similarity index 100% rename from glm/detail/func_integer_simd.inl rename to glm/glm/detail/func_integer_simd.inl diff --git a/glm/detail/func_matrix.inl b/glm/glm/detail/func_matrix.inl similarity index 100% rename from glm/detail/func_matrix.inl rename to glm/glm/detail/func_matrix.inl diff --git a/glm/detail/func_matrix_simd.inl b/glm/glm/detail/func_matrix_simd.inl similarity index 100% rename from glm/detail/func_matrix_simd.inl rename to glm/glm/detail/func_matrix_simd.inl diff --git a/glm/detail/func_packing.inl b/glm/glm/detail/func_packing.inl similarity index 100% rename from glm/detail/func_packing.inl rename to glm/glm/detail/func_packing.inl diff --git a/glm/detail/func_packing_simd.inl b/glm/glm/detail/func_packing_simd.inl similarity index 100% rename from glm/detail/func_packing_simd.inl rename to glm/glm/detail/func_packing_simd.inl diff --git a/glm/detail/func_trigonometric.inl b/glm/glm/detail/func_trigonometric.inl similarity index 100% rename from glm/detail/func_trigonometric.inl rename to glm/glm/detail/func_trigonometric.inl diff --git a/glm/detail/func_trigonometric_simd.inl b/glm/glm/detail/func_trigonometric_simd.inl similarity index 100% rename from glm/detail/func_trigonometric_simd.inl rename to glm/glm/detail/func_trigonometric_simd.inl diff --git a/glm/detail/func_vector_relational.inl b/glm/glm/detail/func_vector_relational.inl similarity index 100% rename from glm/detail/func_vector_relational.inl rename to glm/glm/detail/func_vector_relational.inl diff --git a/glm/detail/func_vector_relational_simd.inl b/glm/glm/detail/func_vector_relational_simd.inl similarity index 100% rename from glm/detail/func_vector_relational_simd.inl rename to glm/glm/detail/func_vector_relational_simd.inl diff --git a/glm/detail/glm.cpp b/glm/glm/detail/glm.cpp similarity index 100% rename from glm/detail/glm.cpp rename to glm/glm/detail/glm.cpp diff --git a/glm/detail/qualifier.hpp b/glm/glm/detail/qualifier.hpp similarity index 100% rename from glm/detail/qualifier.hpp rename to glm/glm/detail/qualifier.hpp diff --git a/glm/detail/setup.hpp b/glm/glm/detail/setup.hpp similarity index 100% rename from glm/detail/setup.hpp rename to glm/glm/detail/setup.hpp diff --git a/glm/detail/type_float.hpp b/glm/glm/detail/type_float.hpp similarity index 100% rename from glm/detail/type_float.hpp rename to glm/glm/detail/type_float.hpp diff --git a/glm/detail/type_half.hpp b/glm/glm/detail/type_half.hpp similarity index 100% rename from glm/detail/type_half.hpp rename to glm/glm/detail/type_half.hpp diff --git a/glm/detail/type_half.inl b/glm/glm/detail/type_half.inl similarity index 100% rename from glm/detail/type_half.inl rename to glm/glm/detail/type_half.inl diff --git a/glm/detail/type_mat2x2.hpp b/glm/glm/detail/type_mat2x2.hpp similarity index 100% rename from glm/detail/type_mat2x2.hpp rename to glm/glm/detail/type_mat2x2.hpp diff --git a/glm/detail/type_mat2x2.inl b/glm/glm/detail/type_mat2x2.inl similarity index 100% rename from glm/detail/type_mat2x2.inl rename to glm/glm/detail/type_mat2x2.inl diff --git a/glm/detail/type_mat2x3.hpp b/glm/glm/detail/type_mat2x3.hpp similarity index 100% rename from glm/detail/type_mat2x3.hpp rename to glm/glm/detail/type_mat2x3.hpp diff --git a/glm/detail/type_mat2x3.inl b/glm/glm/detail/type_mat2x3.inl similarity index 100% rename from glm/detail/type_mat2x3.inl rename to glm/glm/detail/type_mat2x3.inl diff --git a/glm/detail/type_mat2x4.hpp b/glm/glm/detail/type_mat2x4.hpp similarity index 100% rename from glm/detail/type_mat2x4.hpp rename to glm/glm/detail/type_mat2x4.hpp diff --git a/glm/detail/type_mat2x4.inl b/glm/glm/detail/type_mat2x4.inl similarity index 100% rename from glm/detail/type_mat2x4.inl rename to glm/glm/detail/type_mat2x4.inl diff --git a/glm/detail/type_mat3x2.hpp b/glm/glm/detail/type_mat3x2.hpp similarity index 100% rename from glm/detail/type_mat3x2.hpp rename to glm/glm/detail/type_mat3x2.hpp diff --git a/glm/detail/type_mat3x2.inl b/glm/glm/detail/type_mat3x2.inl similarity index 100% rename from glm/detail/type_mat3x2.inl rename to glm/glm/detail/type_mat3x2.inl diff --git a/glm/detail/type_mat3x3.hpp b/glm/glm/detail/type_mat3x3.hpp similarity index 100% rename from glm/detail/type_mat3x3.hpp rename to glm/glm/detail/type_mat3x3.hpp diff --git a/glm/detail/type_mat3x3.inl b/glm/glm/detail/type_mat3x3.inl similarity index 100% rename from glm/detail/type_mat3x3.inl rename to glm/glm/detail/type_mat3x3.inl diff --git a/glm/detail/type_mat3x4.hpp b/glm/glm/detail/type_mat3x4.hpp similarity index 100% rename from glm/detail/type_mat3x4.hpp rename to glm/glm/detail/type_mat3x4.hpp diff --git a/glm/detail/type_mat3x4.inl b/glm/glm/detail/type_mat3x4.inl similarity index 100% rename from glm/detail/type_mat3x4.inl rename to glm/glm/detail/type_mat3x4.inl diff --git a/glm/detail/type_mat4x2.hpp b/glm/glm/detail/type_mat4x2.hpp similarity index 100% rename from glm/detail/type_mat4x2.hpp rename to glm/glm/detail/type_mat4x2.hpp diff --git a/glm/detail/type_mat4x2.inl b/glm/glm/detail/type_mat4x2.inl similarity index 100% rename from glm/detail/type_mat4x2.inl rename to glm/glm/detail/type_mat4x2.inl diff --git a/glm/detail/type_mat4x3.hpp b/glm/glm/detail/type_mat4x3.hpp similarity index 100% rename from glm/detail/type_mat4x3.hpp rename to glm/glm/detail/type_mat4x3.hpp diff --git a/glm/detail/type_mat4x3.inl b/glm/glm/detail/type_mat4x3.inl similarity index 100% rename from glm/detail/type_mat4x3.inl rename to glm/glm/detail/type_mat4x3.inl diff --git a/glm/detail/type_mat4x4.hpp b/glm/glm/detail/type_mat4x4.hpp similarity index 100% rename from glm/detail/type_mat4x4.hpp rename to glm/glm/detail/type_mat4x4.hpp diff --git a/glm/detail/type_mat4x4.inl b/glm/glm/detail/type_mat4x4.inl similarity index 100% rename from glm/detail/type_mat4x4.inl rename to glm/glm/detail/type_mat4x4.inl diff --git a/glm/detail/type_mat4x4_simd.inl b/glm/glm/detail/type_mat4x4_simd.inl similarity index 100% rename from glm/detail/type_mat4x4_simd.inl rename to glm/glm/detail/type_mat4x4_simd.inl diff --git a/glm/detail/type_quat.hpp b/glm/glm/detail/type_quat.hpp similarity index 100% rename from glm/detail/type_quat.hpp rename to glm/glm/detail/type_quat.hpp diff --git a/glm/detail/type_quat.inl b/glm/glm/detail/type_quat.inl similarity index 100% rename from glm/detail/type_quat.inl rename to glm/glm/detail/type_quat.inl diff --git a/glm/detail/type_quat_simd.inl b/glm/glm/detail/type_quat_simd.inl similarity index 100% rename from glm/detail/type_quat_simd.inl rename to glm/glm/detail/type_quat_simd.inl diff --git a/glm/detail/type_vec1.hpp b/glm/glm/detail/type_vec1.hpp similarity index 100% rename from glm/detail/type_vec1.hpp rename to glm/glm/detail/type_vec1.hpp diff --git a/glm/detail/type_vec1.inl b/glm/glm/detail/type_vec1.inl similarity index 100% rename from glm/detail/type_vec1.inl rename to glm/glm/detail/type_vec1.inl diff --git a/glm/detail/type_vec2.hpp b/glm/glm/detail/type_vec2.hpp similarity index 100% rename from glm/detail/type_vec2.hpp rename to glm/glm/detail/type_vec2.hpp diff --git a/glm/detail/type_vec2.inl b/glm/glm/detail/type_vec2.inl similarity index 100% rename from glm/detail/type_vec2.inl rename to glm/glm/detail/type_vec2.inl diff --git a/glm/detail/type_vec3.hpp b/glm/glm/detail/type_vec3.hpp similarity index 100% rename from glm/detail/type_vec3.hpp rename to glm/glm/detail/type_vec3.hpp diff --git a/glm/detail/type_vec3.inl b/glm/glm/detail/type_vec3.inl similarity index 100% rename from glm/detail/type_vec3.inl rename to glm/glm/detail/type_vec3.inl diff --git a/glm/detail/type_vec4.hpp b/glm/glm/detail/type_vec4.hpp similarity index 100% rename from glm/detail/type_vec4.hpp rename to glm/glm/detail/type_vec4.hpp diff --git a/glm/detail/type_vec4.inl b/glm/glm/detail/type_vec4.inl similarity index 100% rename from glm/detail/type_vec4.inl rename to glm/glm/detail/type_vec4.inl diff --git a/glm/detail/type_vec4_simd.inl b/glm/glm/detail/type_vec4_simd.inl similarity index 100% rename from glm/detail/type_vec4_simd.inl rename to glm/glm/detail/type_vec4_simd.inl diff --git a/glm/exponential.hpp b/glm/glm/exponential.hpp similarity index 100% rename from glm/exponential.hpp rename to glm/glm/exponential.hpp diff --git a/glm/ext.hpp b/glm/glm/ext.hpp similarity index 100% rename from glm/ext.hpp rename to glm/glm/ext.hpp diff --git a/glm/ext/matrix_clip_space.hpp b/glm/glm/ext/matrix_clip_space.hpp similarity index 100% rename from glm/ext/matrix_clip_space.hpp rename to glm/glm/ext/matrix_clip_space.hpp diff --git a/glm/ext/matrix_clip_space.inl b/glm/glm/ext/matrix_clip_space.inl similarity index 100% rename from glm/ext/matrix_clip_space.inl rename to glm/glm/ext/matrix_clip_space.inl diff --git a/glm/ext/matrix_common.hpp b/glm/glm/ext/matrix_common.hpp similarity index 100% rename from glm/ext/matrix_common.hpp rename to glm/glm/ext/matrix_common.hpp diff --git a/glm/ext/matrix_common.inl b/glm/glm/ext/matrix_common.inl similarity index 100% rename from glm/ext/matrix_common.inl rename to glm/glm/ext/matrix_common.inl diff --git a/glm/ext/matrix_double2x2.hpp b/glm/glm/ext/matrix_double2x2.hpp similarity index 100% rename from glm/ext/matrix_double2x2.hpp rename to glm/glm/ext/matrix_double2x2.hpp diff --git a/glm/ext/matrix_double2x2_precision.hpp b/glm/glm/ext/matrix_double2x2_precision.hpp similarity index 100% rename from glm/ext/matrix_double2x2_precision.hpp rename to glm/glm/ext/matrix_double2x2_precision.hpp diff --git a/glm/ext/matrix_double2x3.hpp b/glm/glm/ext/matrix_double2x3.hpp similarity index 100% rename from glm/ext/matrix_double2x3.hpp rename to glm/glm/ext/matrix_double2x3.hpp diff --git a/glm/ext/matrix_double2x3_precision.hpp b/glm/glm/ext/matrix_double2x3_precision.hpp similarity index 100% rename from glm/ext/matrix_double2x3_precision.hpp rename to glm/glm/ext/matrix_double2x3_precision.hpp diff --git a/glm/ext/matrix_double2x4.hpp b/glm/glm/ext/matrix_double2x4.hpp similarity index 100% rename from glm/ext/matrix_double2x4.hpp rename to glm/glm/ext/matrix_double2x4.hpp diff --git a/glm/ext/matrix_double2x4_precision.hpp b/glm/glm/ext/matrix_double2x4_precision.hpp similarity index 100% rename from glm/ext/matrix_double2x4_precision.hpp rename to glm/glm/ext/matrix_double2x4_precision.hpp diff --git a/glm/ext/matrix_double3x2.hpp b/glm/glm/ext/matrix_double3x2.hpp similarity index 100% rename from glm/ext/matrix_double3x2.hpp rename to glm/glm/ext/matrix_double3x2.hpp diff --git a/glm/ext/matrix_double3x2_precision.hpp b/glm/glm/ext/matrix_double3x2_precision.hpp similarity index 100% rename from glm/ext/matrix_double3x2_precision.hpp rename to glm/glm/ext/matrix_double3x2_precision.hpp diff --git a/glm/ext/matrix_double3x3.hpp b/glm/glm/ext/matrix_double3x3.hpp similarity index 100% rename from glm/ext/matrix_double3x3.hpp rename to glm/glm/ext/matrix_double3x3.hpp diff --git a/glm/ext/matrix_double3x3_precision.hpp b/glm/glm/ext/matrix_double3x3_precision.hpp similarity index 100% rename from glm/ext/matrix_double3x3_precision.hpp rename to glm/glm/ext/matrix_double3x3_precision.hpp diff --git a/glm/ext/matrix_double3x4.hpp b/glm/glm/ext/matrix_double3x4.hpp similarity index 100% rename from glm/ext/matrix_double3x4.hpp rename to glm/glm/ext/matrix_double3x4.hpp diff --git a/glm/ext/matrix_double3x4_precision.hpp b/glm/glm/ext/matrix_double3x4_precision.hpp similarity index 100% rename from glm/ext/matrix_double3x4_precision.hpp rename to glm/glm/ext/matrix_double3x4_precision.hpp diff --git a/glm/ext/matrix_double4x2.hpp b/glm/glm/ext/matrix_double4x2.hpp similarity index 100% rename from glm/ext/matrix_double4x2.hpp rename to glm/glm/ext/matrix_double4x2.hpp diff --git a/glm/ext/matrix_double4x2_precision.hpp b/glm/glm/ext/matrix_double4x2_precision.hpp similarity index 100% rename from glm/ext/matrix_double4x2_precision.hpp rename to glm/glm/ext/matrix_double4x2_precision.hpp diff --git a/glm/ext/matrix_double4x3.hpp b/glm/glm/ext/matrix_double4x3.hpp similarity index 100% rename from glm/ext/matrix_double4x3.hpp rename to glm/glm/ext/matrix_double4x3.hpp diff --git a/glm/ext/matrix_double4x3_precision.hpp b/glm/glm/ext/matrix_double4x3_precision.hpp similarity index 100% rename from glm/ext/matrix_double4x3_precision.hpp rename to glm/glm/ext/matrix_double4x3_precision.hpp diff --git a/glm/ext/matrix_double4x4.hpp b/glm/glm/ext/matrix_double4x4.hpp similarity index 100% rename from glm/ext/matrix_double4x4.hpp rename to glm/glm/ext/matrix_double4x4.hpp diff --git a/glm/ext/matrix_double4x4_precision.hpp b/glm/glm/ext/matrix_double4x4_precision.hpp similarity index 100% rename from glm/ext/matrix_double4x4_precision.hpp rename to glm/glm/ext/matrix_double4x4_precision.hpp diff --git a/glm/ext/matrix_float2x2.hpp b/glm/glm/ext/matrix_float2x2.hpp similarity index 100% rename from glm/ext/matrix_float2x2.hpp rename to glm/glm/ext/matrix_float2x2.hpp diff --git a/glm/ext/matrix_float2x2_precision.hpp b/glm/glm/ext/matrix_float2x2_precision.hpp similarity index 100% rename from glm/ext/matrix_float2x2_precision.hpp rename to glm/glm/ext/matrix_float2x2_precision.hpp diff --git a/glm/ext/matrix_float2x3.hpp b/glm/glm/ext/matrix_float2x3.hpp similarity index 100% rename from glm/ext/matrix_float2x3.hpp rename to glm/glm/ext/matrix_float2x3.hpp diff --git a/glm/ext/matrix_float2x3_precision.hpp b/glm/glm/ext/matrix_float2x3_precision.hpp similarity index 100% rename from glm/ext/matrix_float2x3_precision.hpp rename to glm/glm/ext/matrix_float2x3_precision.hpp diff --git a/glm/ext/matrix_float2x4.hpp b/glm/glm/ext/matrix_float2x4.hpp similarity index 100% rename from glm/ext/matrix_float2x4.hpp rename to glm/glm/ext/matrix_float2x4.hpp diff --git a/glm/ext/matrix_float2x4_precision.hpp b/glm/glm/ext/matrix_float2x4_precision.hpp similarity index 100% rename from glm/ext/matrix_float2x4_precision.hpp rename to glm/glm/ext/matrix_float2x4_precision.hpp diff --git a/glm/ext/matrix_float3x2.hpp b/glm/glm/ext/matrix_float3x2.hpp similarity index 100% rename from glm/ext/matrix_float3x2.hpp rename to glm/glm/ext/matrix_float3x2.hpp diff --git a/glm/ext/matrix_float3x2_precision.hpp b/glm/glm/ext/matrix_float3x2_precision.hpp similarity index 100% rename from glm/ext/matrix_float3x2_precision.hpp rename to glm/glm/ext/matrix_float3x2_precision.hpp diff --git a/glm/ext/matrix_float3x3.hpp b/glm/glm/ext/matrix_float3x3.hpp similarity index 100% rename from glm/ext/matrix_float3x3.hpp rename to glm/glm/ext/matrix_float3x3.hpp diff --git a/glm/ext/matrix_float3x3_precision.hpp b/glm/glm/ext/matrix_float3x3_precision.hpp similarity index 100% rename from glm/ext/matrix_float3x3_precision.hpp rename to glm/glm/ext/matrix_float3x3_precision.hpp diff --git a/glm/ext/matrix_float3x4.hpp b/glm/glm/ext/matrix_float3x4.hpp similarity index 100% rename from glm/ext/matrix_float3x4.hpp rename to glm/glm/ext/matrix_float3x4.hpp diff --git a/glm/ext/matrix_float3x4_precision.hpp b/glm/glm/ext/matrix_float3x4_precision.hpp similarity index 100% rename from glm/ext/matrix_float3x4_precision.hpp rename to glm/glm/ext/matrix_float3x4_precision.hpp diff --git a/glm/ext/matrix_float4x2.hpp b/glm/glm/ext/matrix_float4x2.hpp similarity index 100% rename from glm/ext/matrix_float4x2.hpp rename to glm/glm/ext/matrix_float4x2.hpp diff --git a/glm/ext/matrix_float4x2_precision.hpp b/glm/glm/ext/matrix_float4x2_precision.hpp similarity index 100% rename from glm/ext/matrix_float4x2_precision.hpp rename to glm/glm/ext/matrix_float4x2_precision.hpp diff --git a/glm/ext/matrix_float4x3.hpp b/glm/glm/ext/matrix_float4x3.hpp similarity index 100% rename from glm/ext/matrix_float4x3.hpp rename to glm/glm/ext/matrix_float4x3.hpp diff --git a/glm/ext/matrix_float4x3_precision.hpp b/glm/glm/ext/matrix_float4x3_precision.hpp similarity index 100% rename from glm/ext/matrix_float4x3_precision.hpp rename to glm/glm/ext/matrix_float4x3_precision.hpp diff --git a/glm/ext/matrix_float4x4.hpp b/glm/glm/ext/matrix_float4x4.hpp similarity index 100% rename from glm/ext/matrix_float4x4.hpp rename to glm/glm/ext/matrix_float4x4.hpp diff --git a/glm/ext/matrix_float4x4_precision.hpp b/glm/glm/ext/matrix_float4x4_precision.hpp similarity index 100% rename from glm/ext/matrix_float4x4_precision.hpp rename to glm/glm/ext/matrix_float4x4_precision.hpp diff --git a/glm/ext/matrix_projection.hpp b/glm/glm/ext/matrix_projection.hpp similarity index 100% rename from glm/ext/matrix_projection.hpp rename to glm/glm/ext/matrix_projection.hpp diff --git a/glm/ext/matrix_projection.inl b/glm/glm/ext/matrix_projection.inl similarity index 100% rename from glm/ext/matrix_projection.inl rename to glm/glm/ext/matrix_projection.inl diff --git a/glm/ext/matrix_relational.hpp b/glm/glm/ext/matrix_relational.hpp similarity index 100% rename from glm/ext/matrix_relational.hpp rename to glm/glm/ext/matrix_relational.hpp diff --git a/glm/ext/matrix_relational.inl b/glm/glm/ext/matrix_relational.inl similarity index 100% rename from glm/ext/matrix_relational.inl rename to glm/glm/ext/matrix_relational.inl diff --git a/glm/ext/matrix_transform.hpp b/glm/glm/ext/matrix_transform.hpp similarity index 100% rename from glm/ext/matrix_transform.hpp rename to glm/glm/ext/matrix_transform.hpp diff --git a/glm/ext/matrix_transform.inl b/glm/glm/ext/matrix_transform.inl similarity index 100% rename from glm/ext/matrix_transform.inl rename to glm/glm/ext/matrix_transform.inl diff --git a/glm/ext/quaternion_common.hpp b/glm/glm/ext/quaternion_common.hpp similarity index 100% rename from glm/ext/quaternion_common.hpp rename to glm/glm/ext/quaternion_common.hpp diff --git a/glm/ext/quaternion_common.inl b/glm/glm/ext/quaternion_common.inl similarity index 100% rename from glm/ext/quaternion_common.inl rename to glm/glm/ext/quaternion_common.inl diff --git a/glm/ext/quaternion_common_simd.inl b/glm/glm/ext/quaternion_common_simd.inl similarity index 100% rename from glm/ext/quaternion_common_simd.inl rename to glm/glm/ext/quaternion_common_simd.inl diff --git a/glm/ext/quaternion_double.hpp b/glm/glm/ext/quaternion_double.hpp similarity index 100% rename from glm/ext/quaternion_double.hpp rename to glm/glm/ext/quaternion_double.hpp diff --git a/glm/ext/quaternion_double_precision.hpp b/glm/glm/ext/quaternion_double_precision.hpp similarity index 100% rename from glm/ext/quaternion_double_precision.hpp rename to glm/glm/ext/quaternion_double_precision.hpp diff --git a/glm/ext/quaternion_exponential.hpp b/glm/glm/ext/quaternion_exponential.hpp similarity index 100% rename from glm/ext/quaternion_exponential.hpp rename to glm/glm/ext/quaternion_exponential.hpp diff --git a/glm/ext/quaternion_exponential.inl b/glm/glm/ext/quaternion_exponential.inl similarity index 100% rename from glm/ext/quaternion_exponential.inl rename to glm/glm/ext/quaternion_exponential.inl diff --git a/glm/ext/quaternion_float.hpp b/glm/glm/ext/quaternion_float.hpp similarity index 100% rename from glm/ext/quaternion_float.hpp rename to glm/glm/ext/quaternion_float.hpp diff --git a/glm/ext/quaternion_float_precision.hpp b/glm/glm/ext/quaternion_float_precision.hpp similarity index 100% rename from glm/ext/quaternion_float_precision.hpp rename to glm/glm/ext/quaternion_float_precision.hpp diff --git a/glm/ext/quaternion_geometric.hpp b/glm/glm/ext/quaternion_geometric.hpp similarity index 100% rename from glm/ext/quaternion_geometric.hpp rename to glm/glm/ext/quaternion_geometric.hpp diff --git a/glm/ext/quaternion_geometric.inl b/glm/glm/ext/quaternion_geometric.inl similarity index 100% rename from glm/ext/quaternion_geometric.inl rename to glm/glm/ext/quaternion_geometric.inl diff --git a/glm/ext/quaternion_relational.hpp b/glm/glm/ext/quaternion_relational.hpp similarity index 100% rename from glm/ext/quaternion_relational.hpp rename to glm/glm/ext/quaternion_relational.hpp diff --git a/glm/ext/quaternion_relational.inl b/glm/glm/ext/quaternion_relational.inl similarity index 100% rename from glm/ext/quaternion_relational.inl rename to glm/glm/ext/quaternion_relational.inl diff --git a/glm/ext/quaternion_transform.hpp b/glm/glm/ext/quaternion_transform.hpp similarity index 100% rename from glm/ext/quaternion_transform.hpp rename to glm/glm/ext/quaternion_transform.hpp diff --git a/glm/ext/quaternion_transform.inl b/glm/glm/ext/quaternion_transform.inl similarity index 100% rename from glm/ext/quaternion_transform.inl rename to glm/glm/ext/quaternion_transform.inl diff --git a/glm/ext/quaternion_trigonometric.hpp b/glm/glm/ext/quaternion_trigonometric.hpp similarity index 100% rename from glm/ext/quaternion_trigonometric.hpp rename to glm/glm/ext/quaternion_trigonometric.hpp diff --git a/glm/ext/quaternion_trigonometric.inl b/glm/glm/ext/quaternion_trigonometric.inl similarity index 100% rename from glm/ext/quaternion_trigonometric.inl rename to glm/glm/ext/quaternion_trigonometric.inl diff --git a/glm/ext/scalar_common.hpp b/glm/glm/ext/scalar_common.hpp similarity index 100% rename from glm/ext/scalar_common.hpp rename to glm/glm/ext/scalar_common.hpp diff --git a/glm/ext/scalar_common.inl b/glm/glm/ext/scalar_common.inl similarity index 100% rename from glm/ext/scalar_common.inl rename to glm/glm/ext/scalar_common.inl diff --git a/glm/ext/scalar_constants.hpp b/glm/glm/ext/scalar_constants.hpp similarity index 100% rename from glm/ext/scalar_constants.hpp rename to glm/glm/ext/scalar_constants.hpp diff --git a/glm/ext/scalar_constants.inl b/glm/glm/ext/scalar_constants.inl similarity index 100% rename from glm/ext/scalar_constants.inl rename to glm/glm/ext/scalar_constants.inl diff --git a/glm/ext/scalar_int_sized.hpp b/glm/glm/ext/scalar_int_sized.hpp similarity index 100% rename from glm/ext/scalar_int_sized.hpp rename to glm/glm/ext/scalar_int_sized.hpp diff --git a/glm/ext/scalar_integer.hpp b/glm/glm/ext/scalar_integer.hpp similarity index 100% rename from glm/ext/scalar_integer.hpp rename to glm/glm/ext/scalar_integer.hpp diff --git a/glm/ext/scalar_integer.inl b/glm/glm/ext/scalar_integer.inl similarity index 100% rename from glm/ext/scalar_integer.inl rename to glm/glm/ext/scalar_integer.inl diff --git a/glm/ext/scalar_packing.hpp b/glm/glm/ext/scalar_packing.hpp similarity index 100% rename from glm/ext/scalar_packing.hpp rename to glm/glm/ext/scalar_packing.hpp diff --git a/glm/ext/scalar_packing.inl b/glm/glm/ext/scalar_packing.inl similarity index 100% rename from glm/ext/scalar_packing.inl rename to glm/glm/ext/scalar_packing.inl diff --git a/glm/ext/scalar_relational.hpp b/glm/glm/ext/scalar_relational.hpp similarity index 100% rename from glm/ext/scalar_relational.hpp rename to glm/glm/ext/scalar_relational.hpp diff --git a/glm/ext/scalar_relational.inl b/glm/glm/ext/scalar_relational.inl similarity index 100% rename from glm/ext/scalar_relational.inl rename to glm/glm/ext/scalar_relational.inl diff --git a/glm/ext/scalar_uint_sized.hpp b/glm/glm/ext/scalar_uint_sized.hpp similarity index 100% rename from glm/ext/scalar_uint_sized.hpp rename to glm/glm/ext/scalar_uint_sized.hpp diff --git a/glm/ext/scalar_ulp.hpp b/glm/glm/ext/scalar_ulp.hpp similarity index 100% rename from glm/ext/scalar_ulp.hpp rename to glm/glm/ext/scalar_ulp.hpp diff --git a/glm/ext/scalar_ulp.inl b/glm/glm/ext/scalar_ulp.inl similarity index 100% rename from glm/ext/scalar_ulp.inl rename to glm/glm/ext/scalar_ulp.inl diff --git a/glm/ext/vector_bool1.hpp b/glm/glm/ext/vector_bool1.hpp similarity index 100% rename from glm/ext/vector_bool1.hpp rename to glm/glm/ext/vector_bool1.hpp diff --git a/glm/ext/vector_bool1_precision.hpp b/glm/glm/ext/vector_bool1_precision.hpp similarity index 100% rename from glm/ext/vector_bool1_precision.hpp rename to glm/glm/ext/vector_bool1_precision.hpp diff --git a/glm/ext/vector_bool2.hpp b/glm/glm/ext/vector_bool2.hpp similarity index 100% rename from glm/ext/vector_bool2.hpp rename to glm/glm/ext/vector_bool2.hpp diff --git a/glm/ext/vector_bool2_precision.hpp b/glm/glm/ext/vector_bool2_precision.hpp similarity index 100% rename from glm/ext/vector_bool2_precision.hpp rename to glm/glm/ext/vector_bool2_precision.hpp diff --git a/glm/ext/vector_bool3.hpp b/glm/glm/ext/vector_bool3.hpp similarity index 100% rename from glm/ext/vector_bool3.hpp rename to glm/glm/ext/vector_bool3.hpp diff --git a/glm/ext/vector_bool3_precision.hpp b/glm/glm/ext/vector_bool3_precision.hpp similarity index 100% rename from glm/ext/vector_bool3_precision.hpp rename to glm/glm/ext/vector_bool3_precision.hpp diff --git a/glm/ext/vector_bool4.hpp b/glm/glm/ext/vector_bool4.hpp similarity index 100% rename from glm/ext/vector_bool4.hpp rename to glm/glm/ext/vector_bool4.hpp diff --git a/glm/ext/vector_bool4_precision.hpp b/glm/glm/ext/vector_bool4_precision.hpp similarity index 100% rename from glm/ext/vector_bool4_precision.hpp rename to glm/glm/ext/vector_bool4_precision.hpp diff --git a/glm/ext/vector_common.hpp b/glm/glm/ext/vector_common.hpp similarity index 100% rename from glm/ext/vector_common.hpp rename to glm/glm/ext/vector_common.hpp diff --git a/glm/ext/vector_common.inl b/glm/glm/ext/vector_common.inl similarity index 100% rename from glm/ext/vector_common.inl rename to glm/glm/ext/vector_common.inl diff --git a/glm/ext/vector_double1.hpp b/glm/glm/ext/vector_double1.hpp similarity index 100% rename from glm/ext/vector_double1.hpp rename to glm/glm/ext/vector_double1.hpp diff --git a/glm/ext/vector_double1_precision.hpp b/glm/glm/ext/vector_double1_precision.hpp similarity index 100% rename from glm/ext/vector_double1_precision.hpp rename to glm/glm/ext/vector_double1_precision.hpp diff --git a/glm/ext/vector_double2.hpp b/glm/glm/ext/vector_double2.hpp similarity index 100% rename from glm/ext/vector_double2.hpp rename to glm/glm/ext/vector_double2.hpp diff --git a/glm/ext/vector_double2_precision.hpp b/glm/glm/ext/vector_double2_precision.hpp similarity index 100% rename from glm/ext/vector_double2_precision.hpp rename to glm/glm/ext/vector_double2_precision.hpp diff --git a/glm/ext/vector_double3.hpp b/glm/glm/ext/vector_double3.hpp similarity index 100% rename from glm/ext/vector_double3.hpp rename to glm/glm/ext/vector_double3.hpp diff --git a/glm/ext/vector_double3_precision.hpp b/glm/glm/ext/vector_double3_precision.hpp similarity index 100% rename from glm/ext/vector_double3_precision.hpp rename to glm/glm/ext/vector_double3_precision.hpp diff --git a/glm/ext/vector_double4.hpp b/glm/glm/ext/vector_double4.hpp similarity index 100% rename from glm/ext/vector_double4.hpp rename to glm/glm/ext/vector_double4.hpp diff --git a/glm/ext/vector_double4_precision.hpp b/glm/glm/ext/vector_double4_precision.hpp similarity index 100% rename from glm/ext/vector_double4_precision.hpp rename to glm/glm/ext/vector_double4_precision.hpp diff --git a/glm/ext/vector_float1.hpp b/glm/glm/ext/vector_float1.hpp similarity index 100% rename from glm/ext/vector_float1.hpp rename to glm/glm/ext/vector_float1.hpp diff --git a/glm/ext/vector_float1_precision.hpp b/glm/glm/ext/vector_float1_precision.hpp similarity index 100% rename from glm/ext/vector_float1_precision.hpp rename to glm/glm/ext/vector_float1_precision.hpp diff --git a/glm/ext/vector_float2.hpp b/glm/glm/ext/vector_float2.hpp similarity index 100% rename from glm/ext/vector_float2.hpp rename to glm/glm/ext/vector_float2.hpp diff --git a/glm/ext/vector_float2_precision.hpp b/glm/glm/ext/vector_float2_precision.hpp similarity index 100% rename from glm/ext/vector_float2_precision.hpp rename to glm/glm/ext/vector_float2_precision.hpp diff --git a/glm/ext/vector_float3.hpp b/glm/glm/ext/vector_float3.hpp similarity index 100% rename from glm/ext/vector_float3.hpp rename to glm/glm/ext/vector_float3.hpp diff --git a/glm/ext/vector_float3_precision.hpp b/glm/glm/ext/vector_float3_precision.hpp similarity index 100% rename from glm/ext/vector_float3_precision.hpp rename to glm/glm/ext/vector_float3_precision.hpp diff --git a/glm/ext/vector_float4.hpp b/glm/glm/ext/vector_float4.hpp similarity index 100% rename from glm/ext/vector_float4.hpp rename to glm/glm/ext/vector_float4.hpp diff --git a/glm/ext/vector_float4_precision.hpp b/glm/glm/ext/vector_float4_precision.hpp similarity index 100% rename from glm/ext/vector_float4_precision.hpp rename to glm/glm/ext/vector_float4_precision.hpp diff --git a/glm/ext/vector_int1.hpp b/glm/glm/ext/vector_int1.hpp similarity index 100% rename from glm/ext/vector_int1.hpp rename to glm/glm/ext/vector_int1.hpp diff --git a/glm/ext/vector_int1_precision.hpp b/glm/glm/ext/vector_int1_precision.hpp similarity index 100% rename from glm/ext/vector_int1_precision.hpp rename to glm/glm/ext/vector_int1_precision.hpp diff --git a/glm/ext/vector_int1_sized.hpp b/glm/glm/ext/vector_int1_sized.hpp similarity index 100% rename from glm/ext/vector_int1_sized.hpp rename to glm/glm/ext/vector_int1_sized.hpp diff --git a/glm/ext/vector_int2.hpp b/glm/glm/ext/vector_int2.hpp similarity index 100% rename from glm/ext/vector_int2.hpp rename to glm/glm/ext/vector_int2.hpp diff --git a/glm/ext/vector_int2_precision.hpp b/glm/glm/ext/vector_int2_precision.hpp similarity index 100% rename from glm/ext/vector_int2_precision.hpp rename to glm/glm/ext/vector_int2_precision.hpp diff --git a/glm/ext/vector_int2_sized.hpp b/glm/glm/ext/vector_int2_sized.hpp similarity index 100% rename from glm/ext/vector_int2_sized.hpp rename to glm/glm/ext/vector_int2_sized.hpp diff --git a/glm/ext/vector_int3.hpp b/glm/glm/ext/vector_int3.hpp similarity index 100% rename from glm/ext/vector_int3.hpp rename to glm/glm/ext/vector_int3.hpp diff --git a/glm/ext/vector_int3_precision.hpp b/glm/glm/ext/vector_int3_precision.hpp similarity index 100% rename from glm/ext/vector_int3_precision.hpp rename to glm/glm/ext/vector_int3_precision.hpp diff --git a/glm/ext/vector_int3_sized.hpp b/glm/glm/ext/vector_int3_sized.hpp similarity index 100% rename from glm/ext/vector_int3_sized.hpp rename to glm/glm/ext/vector_int3_sized.hpp diff --git a/glm/ext/vector_int4.hpp b/glm/glm/ext/vector_int4.hpp similarity index 100% rename from glm/ext/vector_int4.hpp rename to glm/glm/ext/vector_int4.hpp diff --git a/glm/ext/vector_int4_precision.hpp b/glm/glm/ext/vector_int4_precision.hpp similarity index 100% rename from glm/ext/vector_int4_precision.hpp rename to glm/glm/ext/vector_int4_precision.hpp diff --git a/glm/ext/vector_int4_sized.hpp b/glm/glm/ext/vector_int4_sized.hpp similarity index 100% rename from glm/ext/vector_int4_sized.hpp rename to glm/glm/ext/vector_int4_sized.hpp diff --git a/glm/ext/vector_integer.hpp b/glm/glm/ext/vector_integer.hpp similarity index 100% rename from glm/ext/vector_integer.hpp rename to glm/glm/ext/vector_integer.hpp diff --git a/glm/ext/vector_integer.inl b/glm/glm/ext/vector_integer.inl similarity index 100% rename from glm/ext/vector_integer.inl rename to glm/glm/ext/vector_integer.inl diff --git a/glm/ext/vector_packing.hpp b/glm/glm/ext/vector_packing.hpp similarity index 100% rename from glm/ext/vector_packing.hpp rename to glm/glm/ext/vector_packing.hpp diff --git a/glm/ext/vector_packing.inl b/glm/glm/ext/vector_packing.inl similarity index 100% rename from glm/ext/vector_packing.inl rename to glm/glm/ext/vector_packing.inl diff --git a/glm/ext/vector_relational.hpp b/glm/glm/ext/vector_relational.hpp similarity index 100% rename from glm/ext/vector_relational.hpp rename to glm/glm/ext/vector_relational.hpp diff --git a/glm/ext/vector_relational.inl b/glm/glm/ext/vector_relational.inl similarity index 100% rename from glm/ext/vector_relational.inl rename to glm/glm/ext/vector_relational.inl diff --git a/glm/ext/vector_uint1.hpp b/glm/glm/ext/vector_uint1.hpp similarity index 100% rename from glm/ext/vector_uint1.hpp rename to glm/glm/ext/vector_uint1.hpp diff --git a/glm/ext/vector_uint1_precision.hpp b/glm/glm/ext/vector_uint1_precision.hpp similarity index 100% rename from glm/ext/vector_uint1_precision.hpp rename to glm/glm/ext/vector_uint1_precision.hpp diff --git a/glm/ext/vector_uint1_sized.hpp b/glm/glm/ext/vector_uint1_sized.hpp similarity index 100% rename from glm/ext/vector_uint1_sized.hpp rename to glm/glm/ext/vector_uint1_sized.hpp diff --git a/glm/ext/vector_uint2.hpp b/glm/glm/ext/vector_uint2.hpp similarity index 100% rename from glm/ext/vector_uint2.hpp rename to glm/glm/ext/vector_uint2.hpp diff --git a/glm/ext/vector_uint2_precision.hpp b/glm/glm/ext/vector_uint2_precision.hpp similarity index 100% rename from glm/ext/vector_uint2_precision.hpp rename to glm/glm/ext/vector_uint2_precision.hpp diff --git a/glm/ext/vector_uint2_sized.hpp b/glm/glm/ext/vector_uint2_sized.hpp similarity index 100% rename from glm/ext/vector_uint2_sized.hpp rename to glm/glm/ext/vector_uint2_sized.hpp diff --git a/glm/ext/vector_uint3.hpp b/glm/glm/ext/vector_uint3.hpp similarity index 100% rename from glm/ext/vector_uint3.hpp rename to glm/glm/ext/vector_uint3.hpp diff --git a/glm/ext/vector_uint3_precision.hpp b/glm/glm/ext/vector_uint3_precision.hpp similarity index 100% rename from glm/ext/vector_uint3_precision.hpp rename to glm/glm/ext/vector_uint3_precision.hpp diff --git a/glm/ext/vector_uint3_sized.hpp b/glm/glm/ext/vector_uint3_sized.hpp similarity index 100% rename from glm/ext/vector_uint3_sized.hpp rename to glm/glm/ext/vector_uint3_sized.hpp diff --git a/glm/ext/vector_uint4.hpp b/glm/glm/ext/vector_uint4.hpp similarity index 100% rename from glm/ext/vector_uint4.hpp rename to glm/glm/ext/vector_uint4.hpp diff --git a/glm/ext/vector_uint4_precision.hpp b/glm/glm/ext/vector_uint4_precision.hpp similarity index 100% rename from glm/ext/vector_uint4_precision.hpp rename to glm/glm/ext/vector_uint4_precision.hpp diff --git a/glm/ext/vector_uint4_sized.hpp b/glm/glm/ext/vector_uint4_sized.hpp similarity index 100% rename from glm/ext/vector_uint4_sized.hpp rename to glm/glm/ext/vector_uint4_sized.hpp diff --git a/glm/ext/vector_ulp.hpp b/glm/glm/ext/vector_ulp.hpp similarity index 100% rename from glm/ext/vector_ulp.hpp rename to glm/glm/ext/vector_ulp.hpp diff --git a/glm/ext/vector_ulp.inl b/glm/glm/ext/vector_ulp.inl similarity index 100% rename from glm/ext/vector_ulp.inl rename to glm/glm/ext/vector_ulp.inl diff --git a/glm/fwd.hpp b/glm/glm/fwd.hpp similarity index 99% rename from glm/fwd.hpp rename to glm/glm/fwd.hpp index 474d44f7..5ee327c1 100644 --- a/glm/fwd.hpp +++ b/glm/glm/fwd.hpp @@ -676,7 +676,7 @@ namespace glm typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; - + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; diff --git a/glm/geometric.hpp b/glm/glm/geometric.hpp similarity index 100% rename from glm/geometric.hpp rename to glm/glm/geometric.hpp diff --git a/glm/glm.hpp b/glm/glm/glm.hpp similarity index 100% rename from glm/glm.hpp rename to glm/glm/glm.hpp diff --git a/glm/gtc/bitfield.hpp b/glm/glm/gtc/bitfield.hpp similarity index 100% rename from glm/gtc/bitfield.hpp rename to glm/glm/gtc/bitfield.hpp diff --git a/glm/gtc/bitfield.inl b/glm/glm/gtc/bitfield.inl similarity index 100% rename from glm/gtc/bitfield.inl rename to glm/glm/gtc/bitfield.inl diff --git a/glm/gtc/color_space.hpp b/glm/glm/gtc/color_space.hpp similarity index 100% rename from glm/gtc/color_space.hpp rename to glm/glm/gtc/color_space.hpp diff --git a/glm/gtc/color_space.inl b/glm/glm/gtc/color_space.inl similarity index 100% rename from glm/gtc/color_space.inl rename to glm/glm/gtc/color_space.inl diff --git a/glm/gtc/constants.hpp b/glm/glm/gtc/constants.hpp similarity index 100% rename from glm/gtc/constants.hpp rename to glm/glm/gtc/constants.hpp diff --git a/glm/gtc/constants.inl b/glm/glm/gtc/constants.inl similarity index 100% rename from glm/gtc/constants.inl rename to glm/glm/gtc/constants.inl diff --git a/glm/gtc/epsilon.hpp b/glm/glm/gtc/epsilon.hpp similarity index 100% rename from glm/gtc/epsilon.hpp rename to glm/glm/gtc/epsilon.hpp diff --git a/glm/gtc/epsilon.inl b/glm/glm/gtc/epsilon.inl similarity index 100% rename from glm/gtc/epsilon.inl rename to glm/glm/gtc/epsilon.inl diff --git a/glm/gtc/integer.hpp b/glm/glm/gtc/integer.hpp similarity index 100% rename from glm/gtc/integer.hpp rename to glm/glm/gtc/integer.hpp diff --git a/glm/gtc/integer.inl b/glm/glm/gtc/integer.inl similarity index 100% rename from glm/gtc/integer.inl rename to glm/glm/gtc/integer.inl diff --git a/glm/gtc/matrix_access.hpp b/glm/glm/gtc/matrix_access.hpp similarity index 100% rename from glm/gtc/matrix_access.hpp rename to glm/glm/gtc/matrix_access.hpp diff --git a/glm/gtc/matrix_access.inl b/glm/glm/gtc/matrix_access.inl similarity index 100% rename from glm/gtc/matrix_access.inl rename to glm/glm/gtc/matrix_access.inl diff --git a/glm/gtc/matrix_integer.hpp b/glm/glm/gtc/matrix_integer.hpp similarity index 100% rename from glm/gtc/matrix_integer.hpp rename to glm/glm/gtc/matrix_integer.hpp diff --git a/glm/gtc/matrix_inverse.hpp b/glm/glm/gtc/matrix_inverse.hpp similarity index 100% rename from glm/gtc/matrix_inverse.hpp rename to glm/glm/gtc/matrix_inverse.hpp diff --git a/glm/gtc/matrix_inverse.inl b/glm/glm/gtc/matrix_inverse.inl similarity index 100% rename from glm/gtc/matrix_inverse.inl rename to glm/glm/gtc/matrix_inverse.inl diff --git a/glm/gtc/matrix_transform.hpp b/glm/glm/gtc/matrix_transform.hpp similarity index 100% rename from glm/gtc/matrix_transform.hpp rename to glm/glm/gtc/matrix_transform.hpp diff --git a/glm/gtc/matrix_transform.inl b/glm/glm/gtc/matrix_transform.inl similarity index 100% rename from glm/gtc/matrix_transform.inl rename to glm/glm/gtc/matrix_transform.inl diff --git a/glm/gtc/noise.hpp b/glm/glm/gtc/noise.hpp similarity index 100% rename from glm/gtc/noise.hpp rename to glm/glm/gtc/noise.hpp diff --git a/glm/gtc/noise.inl b/glm/glm/gtc/noise.inl similarity index 100% rename from glm/gtc/noise.inl rename to glm/glm/gtc/noise.inl diff --git a/glm/gtc/packing.hpp b/glm/glm/gtc/packing.hpp similarity index 100% rename from glm/gtc/packing.hpp rename to glm/glm/gtc/packing.hpp diff --git a/glm/gtc/packing.inl b/glm/glm/gtc/packing.inl similarity index 100% rename from glm/gtc/packing.inl rename to glm/glm/gtc/packing.inl diff --git a/glm/gtc/quaternion.hpp b/glm/glm/gtc/quaternion.hpp similarity index 100% rename from glm/gtc/quaternion.hpp rename to glm/glm/gtc/quaternion.hpp diff --git a/glm/gtc/quaternion.inl b/glm/glm/gtc/quaternion.inl similarity index 100% rename from glm/gtc/quaternion.inl rename to glm/glm/gtc/quaternion.inl diff --git a/glm/gtc/quaternion_simd.inl b/glm/glm/gtc/quaternion_simd.inl similarity index 100% rename from glm/gtc/quaternion_simd.inl rename to glm/glm/gtc/quaternion_simd.inl diff --git a/glm/gtc/random.hpp b/glm/glm/gtc/random.hpp similarity index 100% rename from glm/gtc/random.hpp rename to glm/glm/gtc/random.hpp diff --git a/glm/gtc/random.inl b/glm/glm/gtc/random.inl similarity index 100% rename from glm/gtc/random.inl rename to glm/glm/gtc/random.inl diff --git a/glm/gtc/reciprocal.hpp b/glm/glm/gtc/reciprocal.hpp similarity index 100% rename from glm/gtc/reciprocal.hpp rename to glm/glm/gtc/reciprocal.hpp diff --git a/glm/gtc/reciprocal.inl b/glm/glm/gtc/reciprocal.inl similarity index 100% rename from glm/gtc/reciprocal.inl rename to glm/glm/gtc/reciprocal.inl diff --git a/glm/gtc/round.hpp b/glm/glm/gtc/round.hpp similarity index 100% rename from glm/gtc/round.hpp rename to glm/glm/gtc/round.hpp diff --git a/glm/gtc/round.inl b/glm/glm/gtc/round.inl similarity index 100% rename from glm/gtc/round.inl rename to glm/glm/gtc/round.inl diff --git a/glm/gtc/type_aligned.hpp b/glm/glm/gtc/type_aligned.hpp similarity index 100% rename from glm/gtc/type_aligned.hpp rename to glm/glm/gtc/type_aligned.hpp diff --git a/glm/gtc/type_precision.hpp b/glm/glm/gtc/type_precision.hpp similarity index 100% rename from glm/gtc/type_precision.hpp rename to glm/glm/gtc/type_precision.hpp diff --git a/glm/gtc/type_precision.inl b/glm/glm/gtc/type_precision.inl similarity index 100% rename from glm/gtc/type_precision.inl rename to glm/glm/gtc/type_precision.inl diff --git a/glm/gtc/type_ptr.hpp b/glm/glm/gtc/type_ptr.hpp similarity index 100% rename from glm/gtc/type_ptr.hpp rename to glm/glm/gtc/type_ptr.hpp diff --git a/glm/gtc/type_ptr.inl b/glm/glm/gtc/type_ptr.inl similarity index 100% rename from glm/gtc/type_ptr.inl rename to glm/glm/gtc/type_ptr.inl diff --git a/glm/gtc/ulp.hpp b/glm/glm/gtc/ulp.hpp similarity index 100% rename from glm/gtc/ulp.hpp rename to glm/glm/gtc/ulp.hpp diff --git a/glm/gtc/ulp.inl b/glm/glm/gtc/ulp.inl similarity index 100% rename from glm/gtc/ulp.inl rename to glm/glm/gtc/ulp.inl diff --git a/glm/gtc/vec1.hpp b/glm/glm/gtc/vec1.hpp similarity index 100% rename from glm/gtc/vec1.hpp rename to glm/glm/gtc/vec1.hpp diff --git a/glm/gtx/associated_min_max.hpp b/glm/glm/gtx/associated_min_max.hpp similarity index 100% rename from glm/gtx/associated_min_max.hpp rename to glm/glm/gtx/associated_min_max.hpp diff --git a/glm/gtx/associated_min_max.inl b/glm/glm/gtx/associated_min_max.inl similarity index 100% rename from glm/gtx/associated_min_max.inl rename to glm/glm/gtx/associated_min_max.inl diff --git a/glm/gtx/bit.hpp b/glm/glm/gtx/bit.hpp similarity index 100% rename from glm/gtx/bit.hpp rename to glm/glm/gtx/bit.hpp diff --git a/glm/gtx/bit.inl b/glm/glm/gtx/bit.inl similarity index 100% rename from glm/gtx/bit.inl rename to glm/glm/gtx/bit.inl diff --git a/glm/gtx/closest_point.hpp b/glm/glm/gtx/closest_point.hpp similarity index 100% rename from glm/gtx/closest_point.hpp rename to glm/glm/gtx/closest_point.hpp diff --git a/glm/gtx/closest_point.inl b/glm/glm/gtx/closest_point.inl similarity index 100% rename from glm/gtx/closest_point.inl rename to glm/glm/gtx/closest_point.inl diff --git a/glm/gtx/color_encoding.hpp b/glm/glm/gtx/color_encoding.hpp similarity index 100% rename from glm/gtx/color_encoding.hpp rename to glm/glm/gtx/color_encoding.hpp diff --git a/glm/gtx/color_encoding.inl b/glm/glm/gtx/color_encoding.inl similarity index 100% rename from glm/gtx/color_encoding.inl rename to glm/glm/gtx/color_encoding.inl diff --git a/glm/gtx/color_space.hpp b/glm/glm/gtx/color_space.hpp similarity index 100% rename from glm/gtx/color_space.hpp rename to glm/glm/gtx/color_space.hpp diff --git a/glm/gtx/color_space.inl b/glm/glm/gtx/color_space.inl similarity index 100% rename from glm/gtx/color_space.inl rename to glm/glm/gtx/color_space.inl diff --git a/glm/gtx/color_space_YCoCg.hpp b/glm/glm/gtx/color_space_YCoCg.hpp similarity index 100% rename from glm/gtx/color_space_YCoCg.hpp rename to glm/glm/gtx/color_space_YCoCg.hpp diff --git a/glm/gtx/color_space_YCoCg.inl b/glm/glm/gtx/color_space_YCoCg.inl similarity index 100% rename from glm/gtx/color_space_YCoCg.inl rename to glm/glm/gtx/color_space_YCoCg.inl diff --git a/glm/gtx/common.hpp b/glm/glm/gtx/common.hpp similarity index 100% rename from glm/gtx/common.hpp rename to glm/glm/gtx/common.hpp diff --git a/glm/gtx/common.inl b/glm/glm/gtx/common.inl similarity index 100% rename from glm/gtx/common.inl rename to glm/glm/gtx/common.inl diff --git a/glm/gtx/compatibility.hpp b/glm/glm/gtx/compatibility.hpp similarity index 100% rename from glm/gtx/compatibility.hpp rename to glm/glm/gtx/compatibility.hpp diff --git a/glm/gtx/compatibility.inl b/glm/glm/gtx/compatibility.inl similarity index 100% rename from glm/gtx/compatibility.inl rename to glm/glm/gtx/compatibility.inl diff --git a/glm/gtx/component_wise.hpp b/glm/glm/gtx/component_wise.hpp similarity index 100% rename from glm/gtx/component_wise.hpp rename to glm/glm/gtx/component_wise.hpp diff --git a/glm/gtx/component_wise.inl b/glm/glm/gtx/component_wise.inl similarity index 100% rename from glm/gtx/component_wise.inl rename to glm/glm/gtx/component_wise.inl diff --git a/glm/gtx/dual_quaternion.hpp b/glm/glm/gtx/dual_quaternion.hpp similarity index 100% rename from glm/gtx/dual_quaternion.hpp rename to glm/glm/gtx/dual_quaternion.hpp diff --git a/glm/gtx/dual_quaternion.inl b/glm/glm/gtx/dual_quaternion.inl similarity index 100% rename from glm/gtx/dual_quaternion.inl rename to glm/glm/gtx/dual_quaternion.inl diff --git a/glm/gtx/easing.hpp b/glm/glm/gtx/easing.hpp similarity index 100% rename from glm/gtx/easing.hpp rename to glm/glm/gtx/easing.hpp diff --git a/glm/gtx/easing.inl b/glm/glm/gtx/easing.inl similarity index 100% rename from glm/gtx/easing.inl rename to glm/glm/gtx/easing.inl diff --git a/glm/gtx/euler_angles.hpp b/glm/glm/gtx/euler_angles.hpp similarity index 100% rename from glm/gtx/euler_angles.hpp rename to glm/glm/gtx/euler_angles.hpp diff --git a/glm/gtx/euler_angles.inl b/glm/glm/gtx/euler_angles.inl similarity index 100% rename from glm/gtx/euler_angles.inl rename to glm/glm/gtx/euler_angles.inl diff --git a/glm/gtx/extend.hpp b/glm/glm/gtx/extend.hpp similarity index 100% rename from glm/gtx/extend.hpp rename to glm/glm/gtx/extend.hpp diff --git a/glm/gtx/extend.inl b/glm/glm/gtx/extend.inl similarity index 100% rename from glm/gtx/extend.inl rename to glm/glm/gtx/extend.inl diff --git a/glm/gtx/extended_min_max.hpp b/glm/glm/gtx/extended_min_max.hpp similarity index 100% rename from glm/gtx/extended_min_max.hpp rename to glm/glm/gtx/extended_min_max.hpp diff --git a/glm/gtx/extended_min_max.inl b/glm/glm/gtx/extended_min_max.inl similarity index 100% rename from glm/gtx/extended_min_max.inl rename to glm/glm/gtx/extended_min_max.inl diff --git a/glm/gtx/exterior_product.hpp b/glm/glm/gtx/exterior_product.hpp similarity index 100% rename from glm/gtx/exterior_product.hpp rename to glm/glm/gtx/exterior_product.hpp diff --git a/glm/gtx/exterior_product.inl b/glm/glm/gtx/exterior_product.inl similarity index 100% rename from glm/gtx/exterior_product.inl rename to glm/glm/gtx/exterior_product.inl diff --git a/glm/gtx/fast_exponential.hpp b/glm/glm/gtx/fast_exponential.hpp similarity index 100% rename from glm/gtx/fast_exponential.hpp rename to glm/glm/gtx/fast_exponential.hpp diff --git a/glm/gtx/fast_exponential.inl b/glm/glm/gtx/fast_exponential.inl similarity index 100% rename from glm/gtx/fast_exponential.inl rename to glm/glm/gtx/fast_exponential.inl diff --git a/glm/gtx/fast_square_root.hpp b/glm/glm/gtx/fast_square_root.hpp similarity index 100% rename from glm/gtx/fast_square_root.hpp rename to glm/glm/gtx/fast_square_root.hpp diff --git a/glm/gtx/fast_square_root.inl b/glm/glm/gtx/fast_square_root.inl similarity index 100% rename from glm/gtx/fast_square_root.inl rename to glm/glm/gtx/fast_square_root.inl diff --git a/glm/gtx/fast_trigonometry.hpp b/glm/glm/gtx/fast_trigonometry.hpp similarity index 100% rename from glm/gtx/fast_trigonometry.hpp rename to glm/glm/gtx/fast_trigonometry.hpp diff --git a/glm/gtx/fast_trigonometry.inl b/glm/glm/gtx/fast_trigonometry.inl similarity index 100% rename from glm/gtx/fast_trigonometry.inl rename to glm/glm/gtx/fast_trigonometry.inl diff --git a/glm/gtx/float_notmalize.inl b/glm/glm/gtx/float_notmalize.inl similarity index 100% rename from glm/gtx/float_notmalize.inl rename to glm/glm/gtx/float_notmalize.inl diff --git a/glm/gtx/functions.hpp b/glm/glm/gtx/functions.hpp similarity index 100% rename from glm/gtx/functions.hpp rename to glm/glm/gtx/functions.hpp diff --git a/glm/gtx/functions.inl b/glm/glm/gtx/functions.inl similarity index 100% rename from glm/gtx/functions.inl rename to glm/glm/gtx/functions.inl diff --git a/glm/gtx/gradient_paint.hpp b/glm/glm/gtx/gradient_paint.hpp similarity index 100% rename from glm/gtx/gradient_paint.hpp rename to glm/glm/gtx/gradient_paint.hpp diff --git a/glm/gtx/gradient_paint.inl b/glm/glm/gtx/gradient_paint.inl similarity index 100% rename from glm/gtx/gradient_paint.inl rename to glm/glm/gtx/gradient_paint.inl diff --git a/glm/gtx/handed_coordinate_space.hpp b/glm/glm/gtx/handed_coordinate_space.hpp similarity index 100% rename from glm/gtx/handed_coordinate_space.hpp rename to glm/glm/gtx/handed_coordinate_space.hpp diff --git a/glm/gtx/handed_coordinate_space.inl b/glm/glm/gtx/handed_coordinate_space.inl similarity index 100% rename from glm/gtx/handed_coordinate_space.inl rename to glm/glm/gtx/handed_coordinate_space.inl diff --git a/glm/gtx/hash.hpp b/glm/glm/gtx/hash.hpp similarity index 100% rename from glm/gtx/hash.hpp rename to glm/glm/gtx/hash.hpp diff --git a/glm/gtx/hash.inl b/glm/glm/gtx/hash.inl similarity index 100% rename from glm/gtx/hash.inl rename to glm/glm/gtx/hash.inl diff --git a/glm/gtx/integer.hpp b/glm/glm/gtx/integer.hpp similarity index 100% rename from glm/gtx/integer.hpp rename to glm/glm/gtx/integer.hpp diff --git a/glm/gtx/integer.inl b/glm/glm/gtx/integer.inl similarity index 100% rename from glm/gtx/integer.inl rename to glm/glm/gtx/integer.inl diff --git a/glm/gtx/intersect.hpp b/glm/glm/gtx/intersect.hpp similarity index 100% rename from glm/gtx/intersect.hpp rename to glm/glm/gtx/intersect.hpp diff --git a/glm/gtx/intersect.inl b/glm/glm/gtx/intersect.inl similarity index 100% rename from glm/gtx/intersect.inl rename to glm/glm/gtx/intersect.inl diff --git a/glm/gtx/io.hpp b/glm/glm/gtx/io.hpp similarity index 100% rename from glm/gtx/io.hpp rename to glm/glm/gtx/io.hpp diff --git a/glm/gtx/io.inl b/glm/glm/gtx/io.inl similarity index 100% rename from glm/gtx/io.inl rename to glm/glm/gtx/io.inl diff --git a/glm/gtx/log_base.hpp b/glm/glm/gtx/log_base.hpp similarity index 100% rename from glm/gtx/log_base.hpp rename to glm/glm/gtx/log_base.hpp diff --git a/glm/gtx/log_base.inl b/glm/glm/gtx/log_base.inl similarity index 100% rename from glm/gtx/log_base.inl rename to glm/glm/gtx/log_base.inl diff --git a/glm/gtx/matrix_cross_product.hpp b/glm/glm/gtx/matrix_cross_product.hpp similarity index 100% rename from glm/gtx/matrix_cross_product.hpp rename to glm/glm/gtx/matrix_cross_product.hpp diff --git a/glm/gtx/matrix_cross_product.inl b/glm/glm/gtx/matrix_cross_product.inl similarity index 100% rename from glm/gtx/matrix_cross_product.inl rename to glm/glm/gtx/matrix_cross_product.inl diff --git a/glm/gtx/matrix_decompose.hpp b/glm/glm/gtx/matrix_decompose.hpp similarity index 100% rename from glm/gtx/matrix_decompose.hpp rename to glm/glm/gtx/matrix_decompose.hpp diff --git a/glm/gtx/matrix_decompose.inl b/glm/glm/gtx/matrix_decompose.inl similarity index 100% rename from glm/gtx/matrix_decompose.inl rename to glm/glm/gtx/matrix_decompose.inl diff --git a/glm/gtx/matrix_factorisation.hpp b/glm/glm/gtx/matrix_factorisation.hpp similarity index 100% rename from glm/gtx/matrix_factorisation.hpp rename to glm/glm/gtx/matrix_factorisation.hpp diff --git a/glm/gtx/matrix_factorisation.inl b/glm/glm/gtx/matrix_factorisation.inl similarity index 100% rename from glm/gtx/matrix_factorisation.inl rename to glm/glm/gtx/matrix_factorisation.inl diff --git a/glm/gtx/matrix_interpolation.hpp b/glm/glm/gtx/matrix_interpolation.hpp similarity index 100% rename from glm/gtx/matrix_interpolation.hpp rename to glm/glm/gtx/matrix_interpolation.hpp diff --git a/glm/gtx/matrix_interpolation.inl b/glm/glm/gtx/matrix_interpolation.inl similarity index 100% rename from glm/gtx/matrix_interpolation.inl rename to glm/glm/gtx/matrix_interpolation.inl diff --git a/glm/gtx/matrix_major_storage.hpp b/glm/glm/gtx/matrix_major_storage.hpp similarity index 100% rename from glm/gtx/matrix_major_storage.hpp rename to glm/glm/gtx/matrix_major_storage.hpp diff --git a/glm/gtx/matrix_major_storage.inl b/glm/glm/gtx/matrix_major_storage.inl similarity index 100% rename from glm/gtx/matrix_major_storage.inl rename to glm/glm/gtx/matrix_major_storage.inl diff --git a/glm/gtx/matrix_operation.hpp b/glm/glm/gtx/matrix_operation.hpp similarity index 100% rename from glm/gtx/matrix_operation.hpp rename to glm/glm/gtx/matrix_operation.hpp diff --git a/glm/gtx/matrix_operation.inl b/glm/glm/gtx/matrix_operation.inl similarity index 100% rename from glm/gtx/matrix_operation.inl rename to glm/glm/gtx/matrix_operation.inl diff --git a/glm/gtx/matrix_query.hpp b/glm/glm/gtx/matrix_query.hpp similarity index 100% rename from glm/gtx/matrix_query.hpp rename to glm/glm/gtx/matrix_query.hpp diff --git a/glm/gtx/matrix_query.inl b/glm/glm/gtx/matrix_query.inl similarity index 100% rename from glm/gtx/matrix_query.inl rename to glm/glm/gtx/matrix_query.inl diff --git a/glm/gtx/matrix_transform_2d.hpp b/glm/glm/gtx/matrix_transform_2d.hpp similarity index 100% rename from glm/gtx/matrix_transform_2d.hpp rename to glm/glm/gtx/matrix_transform_2d.hpp diff --git a/glm/gtx/matrix_transform_2d.inl b/glm/glm/gtx/matrix_transform_2d.inl similarity index 100% rename from glm/gtx/matrix_transform_2d.inl rename to glm/glm/gtx/matrix_transform_2d.inl diff --git a/glm/gtx/mixed_product.hpp b/glm/glm/gtx/mixed_product.hpp similarity index 100% rename from glm/gtx/mixed_product.hpp rename to glm/glm/gtx/mixed_product.hpp diff --git a/glm/gtx/mixed_product.inl b/glm/glm/gtx/mixed_product.inl similarity index 100% rename from glm/gtx/mixed_product.inl rename to glm/glm/gtx/mixed_product.inl diff --git a/glm/gtx/norm.hpp b/glm/glm/gtx/norm.hpp similarity index 100% rename from glm/gtx/norm.hpp rename to glm/glm/gtx/norm.hpp diff --git a/glm/gtx/norm.inl b/glm/glm/gtx/norm.inl similarity index 100% rename from glm/gtx/norm.inl rename to glm/glm/gtx/norm.inl diff --git a/glm/gtx/normal.hpp b/glm/glm/gtx/normal.hpp similarity index 100% rename from glm/gtx/normal.hpp rename to glm/glm/gtx/normal.hpp diff --git a/glm/gtx/normal.inl b/glm/glm/gtx/normal.inl similarity index 100% rename from glm/gtx/normal.inl rename to glm/glm/gtx/normal.inl diff --git a/glm/gtx/normalize_dot.hpp b/glm/glm/gtx/normalize_dot.hpp similarity index 100% rename from glm/gtx/normalize_dot.hpp rename to glm/glm/gtx/normalize_dot.hpp diff --git a/glm/gtx/normalize_dot.inl b/glm/glm/gtx/normalize_dot.inl similarity index 100% rename from glm/gtx/normalize_dot.inl rename to glm/glm/gtx/normalize_dot.inl diff --git a/glm/gtx/number_precision.hpp b/glm/glm/gtx/number_precision.hpp similarity index 100% rename from glm/gtx/number_precision.hpp rename to glm/glm/gtx/number_precision.hpp diff --git a/glm/gtx/number_precision.inl b/glm/glm/gtx/number_precision.inl similarity index 100% rename from glm/gtx/number_precision.inl rename to glm/glm/gtx/number_precision.inl diff --git a/glm/gtx/optimum_pow.hpp b/glm/glm/gtx/optimum_pow.hpp similarity index 100% rename from glm/gtx/optimum_pow.hpp rename to glm/glm/gtx/optimum_pow.hpp diff --git a/glm/gtx/optimum_pow.inl b/glm/glm/gtx/optimum_pow.inl similarity index 100% rename from glm/gtx/optimum_pow.inl rename to glm/glm/gtx/optimum_pow.inl diff --git a/glm/gtx/orthonormalize.hpp b/glm/glm/gtx/orthonormalize.hpp similarity index 100% rename from glm/gtx/orthonormalize.hpp rename to glm/glm/gtx/orthonormalize.hpp diff --git a/glm/gtx/orthonormalize.inl b/glm/glm/gtx/orthonormalize.inl similarity index 100% rename from glm/gtx/orthonormalize.inl rename to glm/glm/gtx/orthonormalize.inl diff --git a/glm/gtx/perpendicular.hpp b/glm/glm/gtx/perpendicular.hpp similarity index 100% rename from glm/gtx/perpendicular.hpp rename to glm/glm/gtx/perpendicular.hpp diff --git a/glm/gtx/perpendicular.inl b/glm/glm/gtx/perpendicular.inl similarity index 100% rename from glm/gtx/perpendicular.inl rename to glm/glm/gtx/perpendicular.inl diff --git a/glm/gtx/polar_coordinates.hpp b/glm/glm/gtx/polar_coordinates.hpp similarity index 100% rename from glm/gtx/polar_coordinates.hpp rename to glm/glm/gtx/polar_coordinates.hpp diff --git a/glm/gtx/polar_coordinates.inl b/glm/glm/gtx/polar_coordinates.inl similarity index 100% rename from glm/gtx/polar_coordinates.inl rename to glm/glm/gtx/polar_coordinates.inl diff --git a/glm/gtx/projection.hpp b/glm/glm/gtx/projection.hpp similarity index 100% rename from glm/gtx/projection.hpp rename to glm/glm/gtx/projection.hpp diff --git a/glm/gtx/projection.inl b/glm/glm/gtx/projection.inl similarity index 100% rename from glm/gtx/projection.inl rename to glm/glm/gtx/projection.inl diff --git a/glm/gtx/quaternion.hpp b/glm/glm/gtx/quaternion.hpp similarity index 100% rename from glm/gtx/quaternion.hpp rename to glm/glm/gtx/quaternion.hpp diff --git a/glm/gtx/quaternion.inl b/glm/glm/gtx/quaternion.inl similarity index 100% rename from glm/gtx/quaternion.inl rename to glm/glm/gtx/quaternion.inl diff --git a/glm/gtx/range.hpp b/glm/glm/gtx/range.hpp similarity index 100% rename from glm/gtx/range.hpp rename to glm/glm/gtx/range.hpp diff --git a/glm/gtx/raw_data.hpp b/glm/glm/gtx/raw_data.hpp similarity index 100% rename from glm/gtx/raw_data.hpp rename to glm/glm/gtx/raw_data.hpp diff --git a/glm/gtx/raw_data.inl b/glm/glm/gtx/raw_data.inl similarity index 100% rename from glm/gtx/raw_data.inl rename to glm/glm/gtx/raw_data.inl diff --git a/glm/gtx/rotate_normalized_axis.hpp b/glm/glm/gtx/rotate_normalized_axis.hpp similarity index 100% rename from glm/gtx/rotate_normalized_axis.hpp rename to glm/glm/gtx/rotate_normalized_axis.hpp diff --git a/glm/gtx/rotate_normalized_axis.inl b/glm/glm/gtx/rotate_normalized_axis.inl similarity index 100% rename from glm/gtx/rotate_normalized_axis.inl rename to glm/glm/gtx/rotate_normalized_axis.inl diff --git a/glm/gtx/rotate_vector.hpp b/glm/glm/gtx/rotate_vector.hpp similarity index 100% rename from glm/gtx/rotate_vector.hpp rename to glm/glm/gtx/rotate_vector.hpp diff --git a/glm/gtx/rotate_vector.inl b/glm/glm/gtx/rotate_vector.inl similarity index 100% rename from glm/gtx/rotate_vector.inl rename to glm/glm/gtx/rotate_vector.inl diff --git a/glm/gtx/scalar_multiplication.hpp b/glm/glm/gtx/scalar_multiplication.hpp similarity index 100% rename from glm/gtx/scalar_multiplication.hpp rename to glm/glm/gtx/scalar_multiplication.hpp diff --git a/glm/gtx/scalar_relational.hpp b/glm/glm/gtx/scalar_relational.hpp similarity index 100% rename from glm/gtx/scalar_relational.hpp rename to glm/glm/gtx/scalar_relational.hpp diff --git a/glm/gtx/scalar_relational.inl b/glm/glm/gtx/scalar_relational.inl similarity index 100% rename from glm/gtx/scalar_relational.inl rename to glm/glm/gtx/scalar_relational.inl diff --git a/glm/gtx/spline.hpp b/glm/glm/gtx/spline.hpp similarity index 100% rename from glm/gtx/spline.hpp rename to glm/glm/gtx/spline.hpp diff --git a/glm/gtx/spline.inl b/glm/glm/gtx/spline.inl similarity index 100% rename from glm/gtx/spline.inl rename to glm/glm/gtx/spline.inl diff --git a/glm/gtx/std_based_type.hpp b/glm/glm/gtx/std_based_type.hpp similarity index 100% rename from glm/gtx/std_based_type.hpp rename to glm/glm/gtx/std_based_type.hpp diff --git a/glm/gtx/std_based_type.inl b/glm/glm/gtx/std_based_type.inl similarity index 100% rename from glm/gtx/std_based_type.inl rename to glm/glm/gtx/std_based_type.inl diff --git a/glm/gtx/string_cast.hpp b/glm/glm/gtx/string_cast.hpp similarity index 100% rename from glm/gtx/string_cast.hpp rename to glm/glm/gtx/string_cast.hpp diff --git a/glm/gtx/string_cast.inl b/glm/glm/gtx/string_cast.inl similarity index 100% rename from glm/gtx/string_cast.inl rename to glm/glm/gtx/string_cast.inl diff --git a/glm/gtx/texture.hpp b/glm/glm/gtx/texture.hpp similarity index 100% rename from glm/gtx/texture.hpp rename to glm/glm/gtx/texture.hpp diff --git a/glm/gtx/texture.inl b/glm/glm/gtx/texture.inl similarity index 100% rename from glm/gtx/texture.inl rename to glm/glm/gtx/texture.inl diff --git a/glm/gtx/transform.hpp b/glm/glm/gtx/transform.hpp similarity index 100% rename from glm/gtx/transform.hpp rename to glm/glm/gtx/transform.hpp diff --git a/glm/gtx/transform.inl b/glm/glm/gtx/transform.inl similarity index 100% rename from glm/gtx/transform.inl rename to glm/glm/gtx/transform.inl diff --git a/glm/gtx/transform2.hpp b/glm/glm/gtx/transform2.hpp similarity index 100% rename from glm/gtx/transform2.hpp rename to glm/glm/gtx/transform2.hpp diff --git a/glm/gtx/transform2.inl b/glm/glm/gtx/transform2.inl similarity index 100% rename from glm/gtx/transform2.inl rename to glm/glm/gtx/transform2.inl diff --git a/glm/gtx/type_aligned.hpp b/glm/glm/gtx/type_aligned.hpp similarity index 100% rename from glm/gtx/type_aligned.hpp rename to glm/glm/gtx/type_aligned.hpp diff --git a/glm/gtx/type_aligned.inl b/glm/glm/gtx/type_aligned.inl similarity index 100% rename from glm/gtx/type_aligned.inl rename to glm/glm/gtx/type_aligned.inl diff --git a/glm/gtx/type_trait.hpp b/glm/glm/gtx/type_trait.hpp similarity index 100% rename from glm/gtx/type_trait.hpp rename to glm/glm/gtx/type_trait.hpp diff --git a/glm/gtx/type_trait.inl b/glm/glm/gtx/type_trait.inl similarity index 100% rename from glm/gtx/type_trait.inl rename to glm/glm/gtx/type_trait.inl diff --git a/glm/gtx/vec_swizzle.hpp b/glm/glm/gtx/vec_swizzle.hpp similarity index 100% rename from glm/gtx/vec_swizzle.hpp rename to glm/glm/gtx/vec_swizzle.hpp diff --git a/glm/gtx/vector_angle.hpp b/glm/glm/gtx/vector_angle.hpp similarity index 100% rename from glm/gtx/vector_angle.hpp rename to glm/glm/gtx/vector_angle.hpp diff --git a/glm/gtx/vector_angle.inl b/glm/glm/gtx/vector_angle.inl similarity index 100% rename from glm/gtx/vector_angle.inl rename to glm/glm/gtx/vector_angle.inl diff --git a/glm/gtx/vector_query.hpp b/glm/glm/gtx/vector_query.hpp similarity index 100% rename from glm/gtx/vector_query.hpp rename to glm/glm/gtx/vector_query.hpp diff --git a/glm/gtx/vector_query.inl b/glm/glm/gtx/vector_query.inl similarity index 100% rename from glm/gtx/vector_query.inl rename to glm/glm/gtx/vector_query.inl diff --git a/glm/gtx/wrap.hpp b/glm/glm/gtx/wrap.hpp similarity index 100% rename from glm/gtx/wrap.hpp rename to glm/glm/gtx/wrap.hpp diff --git a/glm/gtx/wrap.inl b/glm/glm/gtx/wrap.inl similarity index 100% rename from glm/gtx/wrap.inl rename to glm/glm/gtx/wrap.inl diff --git a/glm/integer.hpp b/glm/glm/integer.hpp similarity index 100% rename from glm/integer.hpp rename to glm/glm/integer.hpp diff --git a/glm/mat2x2.hpp b/glm/glm/mat2x2.hpp similarity index 100% rename from glm/mat2x2.hpp rename to glm/glm/mat2x2.hpp diff --git a/glm/mat2x3.hpp b/glm/glm/mat2x3.hpp similarity index 100% rename from glm/mat2x3.hpp rename to glm/glm/mat2x3.hpp diff --git a/glm/mat2x4.hpp b/glm/glm/mat2x4.hpp similarity index 100% rename from glm/mat2x4.hpp rename to glm/glm/mat2x4.hpp diff --git a/glm/mat3x2.hpp b/glm/glm/mat3x2.hpp similarity index 100% rename from glm/mat3x2.hpp rename to glm/glm/mat3x2.hpp diff --git a/glm/mat3x3.hpp b/glm/glm/mat3x3.hpp similarity index 100% rename from glm/mat3x3.hpp rename to glm/glm/mat3x3.hpp diff --git a/glm/mat3x4.hpp b/glm/glm/mat3x4.hpp similarity index 100% rename from glm/mat3x4.hpp rename to glm/glm/mat3x4.hpp diff --git a/glm/mat4x2.hpp b/glm/glm/mat4x2.hpp similarity index 100% rename from glm/mat4x2.hpp rename to glm/glm/mat4x2.hpp diff --git a/glm/mat4x3.hpp b/glm/glm/mat4x3.hpp similarity index 100% rename from glm/mat4x3.hpp rename to glm/glm/mat4x3.hpp diff --git a/glm/mat4x4.hpp b/glm/glm/mat4x4.hpp similarity index 100% rename from glm/mat4x4.hpp rename to glm/glm/mat4x4.hpp diff --git a/glm/matrix.hpp b/glm/glm/matrix.hpp similarity index 100% rename from glm/matrix.hpp rename to glm/glm/matrix.hpp diff --git a/glm/packing.hpp b/glm/glm/packing.hpp similarity index 100% rename from glm/packing.hpp rename to glm/glm/packing.hpp diff --git a/glm/simd/common.h b/glm/glm/simd/common.h similarity index 100% rename from glm/simd/common.h rename to glm/glm/simd/common.h diff --git a/glm/simd/exponential.h b/glm/glm/simd/exponential.h similarity index 100% rename from glm/simd/exponential.h rename to glm/glm/simd/exponential.h diff --git a/glm/simd/geometric.h b/glm/glm/simd/geometric.h similarity index 100% rename from glm/simd/geometric.h rename to glm/glm/simd/geometric.h diff --git a/glm/simd/integer.h b/glm/glm/simd/integer.h similarity index 100% rename from glm/simd/integer.h rename to glm/glm/simd/integer.h diff --git a/glm/simd/matrix.h b/glm/glm/simd/matrix.h similarity index 100% rename from glm/simd/matrix.h rename to glm/glm/simd/matrix.h diff --git a/glm/simd/neon.h b/glm/glm/simd/neon.h similarity index 100% rename from glm/simd/neon.h rename to glm/glm/simd/neon.h diff --git a/glm/simd/packing.h b/glm/glm/simd/packing.h similarity index 100% rename from glm/simd/packing.h rename to glm/glm/simd/packing.h diff --git a/glm/simd/platform.h b/glm/glm/simd/platform.h similarity index 100% rename from glm/simd/platform.h rename to glm/glm/simd/platform.h diff --git a/glm/simd/trigonometric.h b/glm/glm/simd/trigonometric.h similarity index 100% rename from glm/simd/trigonometric.h rename to glm/glm/simd/trigonometric.h diff --git a/glm/simd/vector_relational.h b/glm/glm/simd/vector_relational.h similarity index 100% rename from glm/simd/vector_relational.h rename to glm/glm/simd/vector_relational.h diff --git a/glm/trigonometric.hpp b/glm/glm/trigonometric.hpp similarity index 100% rename from glm/trigonometric.hpp rename to glm/glm/trigonometric.hpp diff --git a/glm/vec2.hpp b/glm/glm/vec2.hpp similarity index 100% rename from glm/vec2.hpp rename to glm/glm/vec2.hpp diff --git a/glm/vec3.hpp b/glm/glm/vec3.hpp similarity index 100% rename from glm/vec3.hpp rename to glm/glm/vec3.hpp diff --git a/glm/vec4.hpp b/glm/glm/vec4.hpp similarity index 100% rename from glm/vec4.hpp rename to glm/glm/vec4.hpp diff --git a/glm/vector_relational.hpp b/glm/glm/vector_relational.hpp similarity index 100% rename from glm/vector_relational.hpp rename to glm/glm/vector_relational.hpp diff --git a/make_pak.bat b/make_pak.bat index 83e59e5c..71d0c169 100644 --- a/make_pak.bat +++ b/make_pak.bat @@ -1,8 +1,9 @@ C: cd C:\OHWorkspace\quakevr\QC -.\fteqcc64.exe -O3 -Fautoproto -progdefs -Olo -Fiffloat -Fifvector -Fvectorlogic -.\pak.exe -c -v pak11.pak progs.dat + +.\fteqcc64.exe -O3 -Fautoproto -progdefs -Olo -Fiffloat -Fifvector -Fvectorlogic -Flo -Fsubscope -Wall -Wextra -Wno-F209 -Wno-F208 + +.\pak.exe -c -v pak11.pak vrprogs.dat xcopy /y C:\OHWorkspace\quakevr\QC\pak11.pak C:\OHWorkspace\quakevr\ReleaseFiles\Id1 -:: echo F | xcopy /y C:\OHWorkspace\quakevr\QC\progdefs.h C:\OHWorkspace\quakevr\Quake\progdefs_generated.hpp -:: xcopy /y C:\OHWorkspace\quakevr\QC\pak11.pak C:\OHWorkspace\quakevr\Windows\VisualStudio\Build-quakespasm-sdl2\x64\Debug\Id1 +:: echo F | xcopy /y C:\OHWorkspace\quakevr\QC\progdefs.h C:\OHWorkspace\quakevr\Quake\progdefs_generated.hpp diff --git a/map_src/quakelogovr.psd b/map_src/quakelogovr.psd new file mode 100644 index 00000000..00512a56 Binary files /dev/null and b/map_src/quakelogovr.psd differ diff --git a/map_src/quakelogovr.tga b/map_src/quakelogovr.tga new file mode 100644 index 00000000..1a188e8f Binary files /dev/null and b/map_src/quakelogovr.tga differ diff --git a/map_src/quakevrlogo.psd b/map_src/quakevrlogo.psd new file mode 100644 index 00000000..32c894f0 Binary files /dev/null and b/map_src/quakevrlogo.psd differ diff --git a/map_src/testvr.map b/map_src/testvr.map new file mode 100644 index 00000000..742b76c8 --- /dev/null +++ b/map_src/testvr.map @@ -0,0 +1,1806 @@ +// Game: Quake +// Format: Standard +// entity 0 +{ +"classname" "worldspawn" +"wad" "C:/OHWorkspace/TrenchBroom/Q.wad" +"_tb_def" "builtin:Quake.fgd" +// brush 0 +{ +( -192 576 16 ) ( -192 591 16 ) ( -192 576 17 ) city4_8 12.7999 0 0 5 1 +( 1168 -1344 -16 ) ( 1157.3749999999995 -1344 -16 ) ( 1168 -1344 -15 ) city4_8 9.78831 0 180 3.54166 1 +( 1168 -1344 -16 ) ( 1168 -1329 -16 ) ( 1157.3749999999995 -1344 -16 ) city4_8 9.78831 12.7999 180 3.54166 5 +( -192 576 16 ) ( -202.62499999999997 576 16 ) ( -192 591 16 ) city4_8 9.78831 12.7999 180 3.54166 5 +( -192 576 16 ) ( -192 576 17 ) ( -202.62499999999997 576 16 ) city4_8 9.78831 0 180 3.54166 1 +( 1168 -1344 -16 ) ( 1168 -1344 -15 ) ( 1168 -1329 -16 ) city4_8 12.7999 0 0 5 1 +} +// brush 1 +{ +( -128 -64 16 ) ( -128 -128 48 ) ( -128 -128 16 ) city4_7 0 0 0 1 1 +( -64 -128 16 ) ( -128 -128 48 ) ( -64 -128 48 ) city4_7 0 0 0 1 1 +( -128 -64 16 ) ( -64 -128 16 ) ( -64 -64 16 ) city4_7 0 0 0 1 1 +( -128 -64 48 ) ( -64 -128 48 ) ( -128 -128 48 ) city4_7 0 0 0 1 1 +( -128 -64 16 ) ( -64 -64 48 ) ( -128 -64 48 ) city4_7 0 0 0 1 1 +( -64 -64 16 ) ( -64 -128 48 ) ( -64 -64 48 ) city4_7 0 0 0 1 1 +} +// brush 2 +{ +( 64 -64 16 ) ( 64 -64 48 ) ( 64 -128 48 ) city4_7 0 0 0 1 1 +( 128 -128 48 ) ( 128 -128 16 ) ( 64 -128 16 ) city4_7 0 0 0 1 1 +( 64 -128 16 ) ( 128 -128 16 ) ( 128 -64 16 ) city4_7 0 0 0 1 1 +( 128 -64 48 ) ( 128 -128 48 ) ( 64 -128 48 ) city4_7 0 0 0 1 1 +( 128 -64 16 ) ( 128 -64 48 ) ( 64 -64 48 ) city4_7 0 0 0 1 1 +( 128 -64 16 ) ( 128 -128 16 ) ( 128 -128 48 ) city4_7 0 0 0 1 1 +} +// brush 3 +{ +( 64 128 16 ) ( 64 64 48 ) ( 64 64 16 ) city4_7 0 0 0 1 1 +( 128 64 16 ) ( 64 64 48 ) ( 128 64 48 ) city4_7 0 0 0 1 1 +( 64 128 16 ) ( 128 64 16 ) ( 128 128 16 ) city4_7 0 0 0 1 1 +( 64 128 48 ) ( 128 64 48 ) ( 64 64 48 ) city4_7 0 0 0 1 1 +( 64 128 16 ) ( 128 128 48 ) ( 64 128 48 ) city4_7 0 0 0 1 1 +( 128 128 16 ) ( 128 64 48 ) ( 128 128 48 ) city4_7 0 0 0 1 1 +} +// brush 4 +{ +( 256 -64 16 ) ( 256 -64 48 ) ( 256 -128 48 ) city4_7 0 0 0 1 1 +( 320 -128 48 ) ( 320 -128 16 ) ( 256 -128 16 ) city4_7 0 0 0 1 1 +( 256 -128 16 ) ( 320 -128 16 ) ( 320 -64 16 ) city4_7 0 0 0 1 1 +( 320 -64 48 ) ( 320 -128 48 ) ( 256 -128 48 ) city4_7 0 0 0 1 1 +( 320 -64 16 ) ( 320 -64 48 ) ( 256 -64 48 ) city4_7 0 0 0 1 1 +( 320 -64 16 ) ( 320 -128 16 ) ( 320 -128 48 ) city4_7 0 0 0 1 1 +} +// brush 5 +{ +( 256 128 16 ) ( 256 128 48 ) ( 256 64 48 ) city4_7 0 0 0 1 1 +( 320 64 48 ) ( 320 64 16 ) ( 256 64 16 ) city4_7 0 0 0 1 1 +( 256 64 16 ) ( 320 64 16 ) ( 320 128 16 ) city4_7 0 0 0 1 1 +( 320 128 48 ) ( 320 64 48 ) ( 256 64 48 ) city4_7 0 0 0 1 1 +( 320 128 16 ) ( 320 128 48 ) ( 256 128 48 ) city4_7 0 0 0 1 1 +( 320 128 16 ) ( 320 64 16 ) ( 320 64 48 ) city4_7 0 0 0 1 1 +} +// brush 6 +{ +( 256 320 16 ) ( 256 320 48 ) ( 256 256 48 ) city4_7 0 0 0 1 1 +( 320 256 48 ) ( 320 256 16 ) ( 256 256 16 ) city4_7 0 0 0 1 1 +( 256 256 16 ) ( 320 256 16 ) ( 320 320 16 ) city4_7 0 0 0 1 1 +( 320 320 48 ) ( 320 256 48 ) ( 256 256 48 ) city4_7 0 0 0 1 1 +( 320 320 16 ) ( 320 320 48 ) ( 256 320 48 ) city4_7 0 0 0 1 1 +( 320 320 16 ) ( 320 256 16 ) ( 320 256 48 ) city4_7 0 0 0 1 1 +} +// brush 7 +{ +( 64 320 16 ) ( 64 320 48 ) ( 64 256 48 ) city4_7 0 0 0 1 1 +( 128 256 48 ) ( 128 256 16 ) ( 64 256 16 ) city4_7 0 0 0 1 1 +( 64 256 16 ) ( 128 256 16 ) ( 128 320 16 ) city4_7 0 0 0 1 1 +( 128 320 48 ) ( 128 256 48 ) ( 64 256 48 ) city4_7 0 0 0 1 1 +( 128 320 16 ) ( 128 320 48 ) ( 64 320 48 ) city4_7 0 0 0 1 1 +( 128 320 16 ) ( 128 256 16 ) ( 128 256 48 ) city4_7 0 0 0 1 1 +} +// brush 8 +{ +( 64 512 16 ) ( 64 512 48 ) ( 64 448 48 ) city4_7 0 0 0 1 1 +( 128 448 48 ) ( 128 448 16 ) ( 64 448 16 ) city4_7 0 0 0 1 1 +( 64 448 16 ) ( 128 448 16 ) ( 128 512 16 ) city4_7 0 0 0 1 1 +( 128 512 48 ) ( 128 448 48 ) ( 64 448 48 ) city4_7 0 0 0 1 1 +( 128 512 16 ) ( 128 512 48 ) ( 64 512 48 ) city4_7 0 0 0 1 1 +( 128 512 16 ) ( 128 448 16 ) ( 128 448 48 ) city4_7 0 0 0 1 1 +} +// brush 9 +{ +( 256 512 16 ) ( 256 512 48 ) ( 256 448 48 ) city4_7 0 0 0 1 1 +( 320 448 48 ) ( 320 448 16 ) ( 256 448 16 ) city4_7 0 0 0 1 1 +( 256 448 16 ) ( 320 448 16 ) ( 320 512 16 ) city4_7 0 0 0 1 1 +( 320 512 48 ) ( 320 448 48 ) ( 256 448 48 ) city4_7 0 0 0 1 1 +( 320 512 16 ) ( 320 512 48 ) ( 256 512 48 ) city4_7 0 0 0 1 1 +( 320 512 16 ) ( 320 448 16 ) ( 320 448 48 ) city4_7 0 0 0 1 1 +} +// brush 10 +{ +( 448 512 16 ) ( 448 512 48 ) ( 448 448 48 ) city4_7 0 0 0 1 1 +( 512 448 48 ) ( 512 448 16 ) ( 448 448 16 ) city4_7 0 0 0 1 1 +( 448 448 16 ) ( 512 448 16 ) ( 512 512 16 ) city4_7 0 0 0 1 1 +( 512 512 48 ) ( 512 448 48 ) ( 448 448 48 ) city4_7 0 0 0 1 1 +( 512 512 16 ) ( 512 512 48 ) ( 448 512 48 ) city4_7 0 0 0 1 1 +( 512 512 16 ) ( 512 448 16 ) ( 512 448 48 ) city4_7 0 0 0 1 1 +} +// brush 11 +{ +( 448 320 16 ) ( 448 320 48 ) ( 448 256 48 ) city4_7 0 0 0 1 1 +( 512 256 48 ) ( 512 256 16 ) ( 448 256 16 ) city4_7 0 0 0 1 1 +( 448 256 16 ) ( 512 256 16 ) ( 512 320 16 ) city4_7 0 0 0 1 1 +( 512 320 48 ) ( 512 256 48 ) ( 448 256 48 ) city4_7 0 0 0 1 1 +( 512 320 16 ) ( 512 320 48 ) ( 448 320 48 ) city4_7 0 0 0 1 1 +( 512 320 16 ) ( 512 256 16 ) ( 512 256 48 ) city4_7 0 0 0 1 1 +} +// brush 12 +{ +( 448 128 16 ) ( 448 128 48 ) ( 448 64 48 ) city4_7 0 0 0 1 1 +( 512 64 48 ) ( 512 64 16 ) ( 448 64 16 ) city4_7 0 0 0 1 1 +( 448 64 16 ) ( 512 64 16 ) ( 512 128 16 ) city4_7 0 0 0 1 1 +( 512 128 48 ) ( 512 64 48 ) ( 448 64 48 ) city4_7 0 0 0 1 1 +( 512 128 16 ) ( 512 128 48 ) ( 448 128 48 ) city4_7 0 0 0 1 1 +( 512 128 16 ) ( 512 64 16 ) ( 512 64 48 ) city4_7 0 0 0 1 1 +} +// brush 13 +{ +( 448 -64 16 ) ( 448 -64 48 ) ( 448 -128 48 ) city4_7 0 0 0 1 1 +( 512 -128 48 ) ( 512 -128 16 ) ( 448 -128 16 ) city4_7 0 0 0 1 1 +( 448 -128 16 ) ( 512 -128 16 ) ( 512 -64 16 ) city4_7 0 0 0 1 1 +( 512 -64 48 ) ( 512 -128 48 ) ( 448 -128 48 ) city4_7 0 0 0 1 1 +( 512 -64 16 ) ( 512 -64 48 ) ( 448 -64 48 ) city4_7 0 0 0 1 1 +( 512 -64 16 ) ( 512 -128 16 ) ( 512 -128 48 ) city4_7 0 0 0 1 1 +} +// brush 14 +{ +( 504 120 48 ) ( 504 121 48 ) ( 504 120 49 ) city4_7 -16 32 0 1 1 +( 504 120 48 ) ( 504 120 49 ) ( 504.01041666666669 120 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 120 48 ) ( 504.01041666666669 120 48 ) ( 504 121 48 ) city4_7 -0.0664063 16 0 0.0104167 1 +( 512 128 144 ) ( 512 129 144 ) ( 512.01041666666663 128 144 ) city4_7 -0.0664063 16 0 0.0104167 1 +( 512 128 144 ) ( 512.01041666666663 128 144 ) ( 512 128 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 128 144 ) ( 512 128 145 ) ( 512 129 144 ) city4_7 -16 32 0 1 1 +} +// brush 15 +{ +( 504 312 48 ) ( 504 313 48 ) ( 504 312 49 ) city4_7 -16 32 0 1 1 +( 504 312 48 ) ( 504 312 49 ) ( 504.01041666666674 312 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 312 48 ) ( 504.01041666666674 312 48 ) ( 504 313 48 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 320 144 ) ( 512 321 144 ) ( 512.01041666666663 320 144 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 320 144 ) ( 512.01041666666663 320 144 ) ( 512 320 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 320 144 ) ( 512 320 145 ) ( 512 321 144 ) city4_7 -16 32 0 1 1 +} +// brush 16 +{ +( 504 504 48 ) ( 504 505 48 ) ( 504 504 49 ) city4_7 -16 32 0 1 1 +( 504 504 48 ) ( 504 504 49 ) ( 504.01041666666674 504 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 504 48 ) ( 504.01041666666674 504 48 ) ( 504 505 48 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 512 144 ) ( 512 513 144 ) ( 512.01041666666663 512 144 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 512 144 ) ( 512.01041666666663 512 144 ) ( 512 512 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 512 144 ) ( 512 512 145 ) ( 512 513 144 ) city4_7 -16 32 0 1 1 +} +// brush 17 +{ +( 504 -72 48 ) ( 504 -71 48 ) ( 504 -72 49 ) city4_7 48 32 0 1 1 +( 504 -72 48 ) ( 504 -72 49 ) ( 504.01041666666674 -72 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -72 48 ) ( 504.01041666666674 -72 48 ) ( 504 -71 48 ) city4_7 63.9336 -48 0 0.0104167 1 +( 512 -64 144 ) ( 512 -63 144 ) ( 512.01041666666663 -64 144 ) city4_7 63.9336 -48 0 0.0104167 1 +( 512 -64 144 ) ( 512.01041666666663 -64 144 ) ( 512 -64 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -64 144 ) ( 512 -64 145 ) ( 512 -63 144 ) city4_7 48 32 0 1 1 +} +// brush 18 +{ +( 448 448 48 ) ( 448 449 48 ) ( 448 448 49 ) city4_7 40 32 0 1 1 +( 448 448 48 ) ( 448 448 49 ) ( 448.01041666666674 448 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 448 48 ) ( 448.01041666666674 448 48 ) ( 448 449 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 456 144 ) ( 456 457 144 ) ( 456.01041666666663 456 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 456 144 ) ( 456.01041666666663 456 144 ) ( 456 456 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 456 144 ) ( 456 456 145 ) ( 456 457 144 ) city4_7 40 32 0 1 1 +} +// brush 19 +{ +( 448 256 48 ) ( 448 257 48 ) ( 448 256 49 ) city4_7 40 32 0 1 1 +( 448 256 48 ) ( 448 256 49 ) ( 448.01041666666674 256 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 256 48 ) ( 448.01041666666674 256 48 ) ( 448 257 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 264 144 ) ( 456 265 144 ) ( 456.01041666666663 264 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 264 144 ) ( 456.01041666666663 264 144 ) ( 456 264 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 264 144 ) ( 456 264 145 ) ( 456 265 144 ) city4_7 40 32 0 1 1 +} +// brush 20 +{ +( 448 64 48 ) ( 448 65 48 ) ( 448 64 49 ) city4_7 40 32 0 1 1 +( 448 64 48 ) ( 448 64 49 ) ( 448.01041666666674 64 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 64 48 ) ( 448.01041666666674 64 48 ) ( 448 65 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 72 144 ) ( 456 73 144 ) ( 456.01041666666663 72 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 72 144 ) ( 456.01041666666663 72 144 ) ( 456 72 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 72 144 ) ( 456 72 145 ) ( 456 73 144 ) city4_7 40 32 0 1 1 +} +// brush 21 +{ +( 448 -128 48 ) ( 448 -127 48 ) ( 448 -128 49 ) city4_7 40 32 0 1 1 +( 448 -128 48 ) ( 448 -128 49 ) ( 448.01041666666674 -128 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -128 48 ) ( 448.01041666666674 -128 48 ) ( 448 -127 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -120 144 ) ( 456 -119 144 ) ( 456.01041666666663 -120 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -120 144 ) ( 456.01041666666663 -120 144 ) ( 456 -120 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -120 144 ) ( 456 -120 145 ) ( 456 -119 144 ) city4_7 40 32 0 1 1 +} +// brush 22 +{ +( 504 448 48 ) ( 504 449 48 ) ( 504 448 49 ) city4_7 40 32 0 1 1 +( 504 448 48 ) ( 504 448 49 ) ( 504.01041666666674 448 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 448 48 ) ( 504.01041666666674 448 48 ) ( 504 449 48 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 456 144 ) ( 512 457 144 ) ( 512.01041666666663 456 144 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 456 144 ) ( 512.01041666666663 456 144 ) ( 512 456 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 456 144 ) ( 512 456 145 ) ( 512 457 144 ) city4_7 40 32 0 1 1 +} +// brush 23 +{ +( 504 256 48 ) ( 504 257 48 ) ( 504 256 49 ) city4_7 40 32 0 1 1 +( 504 256 48 ) ( 504 256 49 ) ( 504.01041666666674 256 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 256 48 ) ( 504.01041666666674 256 48 ) ( 504 257 48 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 264 144 ) ( 512 265 144 ) ( 512.01041666666663 264 144 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 264 144 ) ( 512.01041666666663 264 144 ) ( 512 264 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 264 144 ) ( 512 264 145 ) ( 512 265 144 ) city4_7 40 32 0 1 1 +} +// brush 24 +{ +( 504 64 48 ) ( 504 65 48 ) ( 504 64 49 ) city4_7 40 32 0 1 1 +( 504 64 48 ) ( 504 64 49 ) ( 504.01041666666674 64 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 64 48 ) ( 504.01041666666674 64 48 ) ( 504 65 48 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 72 144 ) ( 512 73 144 ) ( 512.01041666666663 72 144 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 72 144 ) ( 512.01041666666663 72 144 ) ( 512 72 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 72 144 ) ( 512 72 145 ) ( 512 73 144 ) city4_7 40 32 0 1 1 +} +// brush 25 +{ +( 504 -128 48 ) ( 504 -127 48 ) ( 504 -128 49 ) city4_7 40 32 0 1 1 +( 504 -128 48 ) ( 504 -128 49 ) ( 504.01041666666674 -128 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 -128 48 ) ( 504.01041666666674 -128 48 ) ( 504 -127 48 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 -120 144 ) ( 512 -119 144 ) ( 512.01041666666663 -120 144 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 -120 144 ) ( 512.01041666666663 -120 144 ) ( 512 -120 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 -120 144 ) ( 512 -120 145 ) ( 512 -119 144 ) city4_7 40 32 0 1 1 +} +// brush 26 +{ +( 448 504 48 ) ( 448 505 48 ) ( 448 504 49 ) city4_7 48 32 0 1 1 +( 448 504 48 ) ( 448 504 49 ) ( 448.01041666666674 504 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 504 48 ) ( 448.01041666666674 504 48 ) ( 448 505 48 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 512 144 ) ( 456 513 144 ) ( 456.01041666666663 512 144 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 512 144 ) ( 456.01041666666663 512 144 ) ( 456 512 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 512 144 ) ( 456 512 145 ) ( 456 513 144 ) city4_7 48 32 0 1 1 +} +// brush 27 +{ +( 448 312 48 ) ( 448 313 48 ) ( 448 312 49 ) city4_7 48 32 0 1 1 +( 448 312 48 ) ( 448 312 49 ) ( 448.01041666666674 312 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 312 48 ) ( 448.01041666666674 312 48 ) ( 448 313 48 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 320 144 ) ( 456 321 144 ) ( 456.01041666666663 320 144 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 320 144 ) ( 456.01041666666663 320 144 ) ( 456 320 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 320 144 ) ( 456 320 145 ) ( 456 321 144 ) city4_7 48 32 0 1 1 +} +// brush 28 +{ +( 448 120 48 ) ( 448 121 48 ) ( 448 120 49 ) city4_7 48 32 0 1 1 +( 448 120 48 ) ( 448 120 49 ) ( 448.01041666666674 120 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 120 48 ) ( 448.01041666666674 120 48 ) ( 448 121 48 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 128 144 ) ( 456 129 144 ) ( 456.01041666666663 128 144 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 128 144 ) ( 456.01041666666663 128 144 ) ( 456 128 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 128 144 ) ( 456 128 145 ) ( 456 129 144 ) city4_7 48 32 0 1 1 +} +// brush 29 +{ +( 448 -72 48 ) ( 448 -71 48 ) ( 448 -72 49 ) city4_7 48 32 0 1 1 +( 448 -72 48 ) ( 448 -72 49 ) ( 448.01041666666674 -72 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -72 48 ) ( 448.01041666666674 -72 48 ) ( 448 -71 48 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 -64 144 ) ( 456 -63 144 ) ( 456.01041666666663 -64 144 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 -64 144 ) ( 456.01041666666663 -64 144 ) ( 456 -64 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -64 144 ) ( 456 -64 145 ) ( 456 -63 144 ) city4_7 48 32 0 1 1 +} +// brush 30 +{ +( 640 512 16 ) ( 640 512 48 ) ( 640 448 48 ) city4_7 0 0 0 1 1 +( 704 448 48 ) ( 704 448 16 ) ( 640 448 16 ) city4_7 0 0 0 1 1 +( 640 448 16 ) ( 704 448 16 ) ( 704 512 16 ) city4_7 0 0 0 1 1 +( 704 512 48 ) ( 704 448 48 ) ( 640 448 48 ) city4_7 0 0 0 1 1 +( 704 512 16 ) ( 704 512 48 ) ( 640 512 48 ) city4_7 0 0 0 1 1 +( 704 512 16 ) ( 704 448 16 ) ( 704 448 48 ) city4_7 0 0 0 1 1 +} +// brush 31 +{ +( 640 320 16 ) ( 640 320 48 ) ( 640 256 48 ) city4_7 0 0 0 1 1 +( 704 256 48 ) ( 704 256 16 ) ( 640 256 16 ) city4_7 0 0 0 1 1 +( 640 256 16 ) ( 704 256 16 ) ( 704 320 16 ) city4_7 0 0 0 1 1 +( 704 320 48 ) ( 704 256 48 ) ( 640 256 48 ) city4_7 0 0 0 1 1 +( 704 320 16 ) ( 704 320 48 ) ( 640 320 48 ) city4_7 0 0 0 1 1 +( 704 320 16 ) ( 704 256 16 ) ( 704 256 48 ) city4_7 0 0 0 1 1 +} +// brush 32 +{ +( 640 128 16 ) ( 640 128 48 ) ( 640 64 48 ) city4_7 0 0 0 1 1 +( 704 64 48 ) ( 704 64 16 ) ( 640 64 16 ) city4_7 0 0 0 1 1 +( 640 64 16 ) ( 704 64 16 ) ( 704 128 16 ) city4_7 0 0 0 1 1 +( 704 128 48 ) ( 704 64 48 ) ( 640 64 48 ) city4_7 0 0 0 1 1 +( 704 128 16 ) ( 704 128 48 ) ( 640 128 48 ) city4_7 0 0 0 1 1 +( 704 128 16 ) ( 704 64 16 ) ( 704 64 48 ) city4_7 0 0 0 1 1 +} +// brush 33 +{ +( 640 -64 16 ) ( 640 -64 48 ) ( 640 -128 48 ) city4_7 0 0 0 1 1 +( 704 -128 48 ) ( 704 -128 16 ) ( 640 -128 16 ) city4_7 0 0 0 1 1 +( 640 -128 16 ) ( 704 -128 16 ) ( 704 -64 16 ) city4_7 0 0 0 1 1 +( 704 -64 48 ) ( 704 -128 48 ) ( 640 -128 48 ) city4_7 0 0 0 1 1 +( 704 -64 16 ) ( 704 -64 48 ) ( 640 -64 48 ) city4_7 0 0 0 1 1 +( 704 -64 16 ) ( 704 -128 16 ) ( 704 -128 48 ) city4_7 0 0 0 1 1 +} +// brush 34 +{ +( 688 496 48 ) ( 688 497 48 ) ( 688 496 49 ) city4_7 -8 32 0 1 1 +( 688 496 48 ) ( 688 496 49 ) ( 688.01041666666674 496 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 496 48 ) ( 688.01041666666674 496 48 ) ( 688 497 48 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 504 144 ) ( 696 505 144 ) ( 696.01041666666663 504 144 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 504 144 ) ( 696.01041666666663 504 144 ) ( 696 504 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 504 144 ) ( 696 504 145 ) ( 696 505 144 ) city4_7 -8 32 0 1 1 +} +// brush 35 +{ +( 688 304 48 ) ( 688 305 48 ) ( 688 304 49 ) city4_7 -8 32 0 1 1 +( 688 304 48 ) ( 688 304 49 ) ( 688.01041666666674 304 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 304 48 ) ( 688.01041666666674 304 48 ) ( 688 305 48 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 312 144 ) ( 696 313 144 ) ( 696.01041666666663 312 144 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 312 144 ) ( 696.01041666666663 312 144 ) ( 696 312 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 312 144 ) ( 696 312 145 ) ( 696 313 144 ) city4_7 -8 32 0 1 1 +} +// brush 36 +{ +( 688 112 48 ) ( 688 113 48 ) ( 688 112 49 ) city4_7 -8 32 0 1 1 +( 688 112 48 ) ( 688 112 49 ) ( 688.01041666666674 112 48 ) city4_7 -0.09375 32 0 0.0104167 1 +( 688 112 48 ) ( 688.01041666666674 112 48 ) ( 688 113 48 ) city4_7 -0.09375 8 0 0.0104167 1 +( 696 120 144 ) ( 696 121 144 ) ( 696.01041666666663 120 144 ) city4_7 -0.09375 8 0 0.0104167 1 +( 696 120 144 ) ( 696.01041666666663 120 144 ) ( 696 120 145 ) city4_7 -0.09375 32 0 0.0104167 1 +( 696 120 144 ) ( 696 120 145 ) ( 696 121 144 ) city4_7 -8 32 0 1 1 +} +// brush 37 +{ +( 688 -80 48 ) ( 688 -79 48 ) ( 688 -80 49 ) city4_7 -8 32 0 1 1 +( 688 -80 48 ) ( 688 -80 49 ) ( 688.01041666666674 -80 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -80 48 ) ( 688.01041666666674 -80 48 ) ( 688 -79 48 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -72 144 ) ( 696 -71 144 ) ( 696.01041666666663 -72 144 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -72 144 ) ( 696.01041666666663 -72 144 ) ( 696 -72 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -72 144 ) ( 696 -72 145 ) ( 696 -71 144 ) city4_7 -8 32 0 1 1 +} +// brush 38 +{ +( 648 -120 48 ) ( 648 -119 48 ) ( 648 -120 49 ) city4_7 32 32 0 1 1 +( 648 -120 48 ) ( 648 -120 49 ) ( 648.01041666666674 -120 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -120 48 ) ( 648.01041666666674 -120 48 ) ( 648 -119 48 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -112 144 ) ( 656 -111 144 ) ( 656.01041666666663 -112 144 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -112 144 ) ( 656.01041666666663 -112 144 ) ( 656 -112 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -112 144 ) ( 656 -112 145 ) ( 656 -111 144 ) city4_7 32 32 0 1 1 +} +// brush 39 +{ +( 688 -120 48 ) ( 688 -119 48 ) ( 688 -120 49 ) city4_7 32 32 0 1 1 +( 688 -120 48 ) ( 688 -120 49 ) ( 688.01041666666674 -120 48 ) city4_7 -0.09375 32 0 0.0104167 1 +( 688 -120 48 ) ( 688.01041666666674 -120 48 ) ( 688 -119 48 ) city4_7 -0.09375 -32 0 0.0104167 1 +( 696 -112 144 ) ( 696 -111 144 ) ( 696.01041666666663 -112 144 ) city4_7 -0.09375 -32 0 0.0104167 1 +( 696 -112 144 ) ( 696.01041666666663 -112 144 ) ( 696 -112 145 ) city4_7 -0.09375 32 0 0.0104167 1 +( 696 -112 144 ) ( 696 -112 145 ) ( 696 -111 144 ) city4_7 32 32 0 1 1 +} +// brush 40 +{ +( 648 -80 48 ) ( 648 -79 48 ) ( 648 -80 49 ) city4_7 -8 32 0 1 1 +( 648 -80 48 ) ( 648 -80 49 ) ( 648.01041666666674 -80 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -80 48 ) ( 648.01041666666674 -80 48 ) ( 648 -79 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -72 144 ) ( 656 -71 144 ) ( 656.01041666666663 -72 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -72 144 ) ( 656.01041666666663 -72 144 ) ( 656 -72 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -72 144 ) ( 656 -72 145 ) ( 656 -71 144 ) city4_7 -8 32 0 1 1 +} +// brush 41 +{ +( 648 72 48 ) ( 648 73 48 ) ( 648 72 49 ) city4_7 -32 32 0 1 1 +( 648 72 48 ) ( 648 72 49 ) ( 648.01041666666674 72 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 72 48 ) ( 648.01041666666674 72 48 ) ( 648 73 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 80 144 ) ( 656 81 144 ) ( 656.01041666666663 80 144 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 80 144 ) ( 656.01041666666663 80 144 ) ( 656 80 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 80 144 ) ( 656 80 145 ) ( 656 81 144 ) city4_7 -32 32 0 1 1 +} +// brush 42 +{ +( 688 72 48 ) ( 688 73 48 ) ( 688 72 49 ) city4_7 -32 32 0 1 1 +( 688 72 48 ) ( 688 72 49 ) ( 688.01041666666674 72 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 72 48 ) ( 688.01041666666674 72 48 ) ( 688 73 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 80 144 ) ( 696 81 144 ) ( 696.01041666666663 80 144 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 80 144 ) ( 696.01041666666663 80 144 ) ( 696 80 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 80 144 ) ( 696 80 145 ) ( 696 81 144 ) city4_7 -32 32 0 1 1 +} +// brush 43 +{ +( 648 112 48 ) ( 648 113 48 ) ( 648 112 49 ) city4_7 -8 32 0 1 1 +( 648 112 48 ) ( 648 112 49 ) ( 648.01041666666674 112 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 112 48 ) ( 648.01041666666674 112 48 ) ( 648 113 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 120 144 ) ( 656 121 144 ) ( 656.01041666666663 120 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 120 144 ) ( 656.01041666666663 120 144 ) ( 656 120 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 120 144 ) ( 656 120 145 ) ( 656 121 144 ) city4_7 -8 32 0 1 1 +} +// brush 44 +{ +( 648 264 48 ) ( 648 265 48 ) ( 648 264 49 ) city4_7 -32 32 0 1 1 +( 648 264 48 ) ( 648 264 49 ) ( 648.01041666666674 264 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 264 48 ) ( 648.01041666666674 264 48 ) ( 648 265 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 272 144 ) ( 656 273 144 ) ( 656.01041666666663 272 144 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 272 144 ) ( 656.01041666666663 272 144 ) ( 656 272 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 272 144 ) ( 656 272 145 ) ( 656 273 144 ) city4_7 -32 32 0 1 1 +} +// brush 45 +{ +( 688 264 48 ) ( 688 265 48 ) ( 688 264 49 ) city4_7 -32 32 0 1 1 +( 688 264 48 ) ( 688 264 49 ) ( 688.01041666666674 264 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 264 48 ) ( 688.01041666666674 264 48 ) ( 688 265 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 272 144 ) ( 696 273 144 ) ( 696.01041666666663 272 144 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 272 144 ) ( 696.01041666666663 272 144 ) ( 696 272 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 272 144 ) ( 696 272 145 ) ( 696 273 144 ) city4_7 -32 32 0 1 1 +} +// brush 46 +{ +( 648 304 48 ) ( 648 305 48 ) ( 648 304 49 ) city4_7 -8 32 0 1 1 +( 648 304 48 ) ( 648 304 49 ) ( 648.01041666666674 304 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 304 48 ) ( 648.01041666666674 304 48 ) ( 648 305 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 312 144 ) ( 656 313 144 ) ( 656.01041666666663 312 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 312 144 ) ( 656.01041666666663 312 144 ) ( 656 312 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 312 144 ) ( 656 312 145 ) ( 656 313 144 ) city4_7 -8 32 0 1 1 +} +// brush 47 +{ +( 648 456 48 ) ( 648 457 48 ) ( 648 456 49 ) city4_7 -32 32 0 1 1 +( 648 456 48 ) ( 648 456 49 ) ( 648.01041666666674 456 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 456 48 ) ( 648.01041666666674 456 48 ) ( 648 457 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 464 144 ) ( 656 465 144 ) ( 656.01041666666663 464 144 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 464 144 ) ( 656.01041666666663 464 144 ) ( 656 464 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 464 144 ) ( 656 464 145 ) ( 656 465 144 ) city4_7 -32 32 0 1 1 +} +// brush 48 +{ +( 688 456 48 ) ( 688 457 48 ) ( 688 456 49 ) city4_7 -32 32 0 1 1 +( 688 456 48 ) ( 688 456 49 ) ( 688.01041666666674 456 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 456 48 ) ( 688.01041666666674 456 48 ) ( 688 457 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 464 144 ) ( 696 465 144 ) ( 696.01041666666663 464 144 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 464 144 ) ( 696.01041666666663 464 144 ) ( 696 464 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 464 144 ) ( 696 464 145 ) ( 696 465 144 ) city4_7 -32 32 0 1 1 +} +// brush 49 +{ +( 648 496 48 ) ( 648 497 48 ) ( 648 496 49 ) city4_7 -8 32 0 1 1 +( 648 496 48 ) ( 648 496 49 ) ( 648.01041666666674 496 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 496 48 ) ( 648.01041666666674 496 48 ) ( 648 497 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 504 144 ) ( 656 505 144 ) ( 656.01041666666663 504 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 504 144 ) ( 656.01041666666663 504 144 ) ( 656 504 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 504 144 ) ( 656 504 145 ) ( 656 505 144 ) city4_7 -8 32 0 1 1 +} +// brush 50 +{ +( 64 -256 16 ) ( 64 -256 48 ) ( 64 -320 48 ) city4_7 0 0 0 1 1 +( 128 -320 48 ) ( 128 -320 16 ) ( 64 -320 16 ) city4_7 0 0 0 1 1 +( 64 -320 16 ) ( 128 -320 16 ) ( 128 -256 16 ) city4_7 0 0 0 1 1 +( 128 -256 48 ) ( 128 -320 48 ) ( 64 -320 48 ) city4_7 0 0 0 1 1 +( 128 -256 16 ) ( 128 -256 48 ) ( 64 -256 48 ) city4_7 0 0 0 1 1 +( 128 -256 16 ) ( 128 -320 16 ) ( 128 -320 48 ) city4_7 0 0 0 1 1 +} +// brush 51 +{ +( 256 -256 16 ) ( 256 -256 48 ) ( 256 -320 48 ) city4_7 0 0 0 1 1 +( 320 -320 48 ) ( 320 -320 16 ) ( 256 -320 16 ) city4_7 0 0 0 1 1 +( 256 -320 16 ) ( 320 -320 16 ) ( 320 -256 16 ) city4_7 0 0 0 1 1 +( 320 -256 48 ) ( 320 -320 48 ) ( 256 -320 48 ) city4_7 0 0 0 1 1 +( 320 -256 16 ) ( 320 -256 48 ) ( 256 -256 48 ) city4_7 0 0 0 1 1 +( 320 -256 16 ) ( 320 -320 16 ) ( 320 -320 48 ) city4_7 0 0 0 1 1 +} +// brush 52 +{ +( 448 -320 48 ) ( 448 -319 48 ) ( 448 -320 49 ) city4_7 40 32 0 1 1 +( 448 -320 48 ) ( 448 -320 49 ) ( 448.01041666666674 -320 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -320 48 ) ( 448.01041666666674 -320 48 ) ( 448 -319 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -312 144 ) ( 456 -311 144 ) ( 456.01041666666663 -312 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -312 144 ) ( 456.01041666666663 -312 144 ) ( 456 -312 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -312 144 ) ( 456 -312 145 ) ( 456 -311 144 ) city4_7 40 32 0 1 1 +} +// brush 53 +{ +( 504 -320 48 ) ( 504 -319 48 ) ( 504 -320 49 ) city4_7 40 32 0 1 1 +( 504 -320 48 ) ( 504 -320 49 ) ( 504.01041666666674 -320 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -320 48 ) ( 504.01041666666674 -320 48 ) ( 504 -319 48 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -312 144 ) ( 512 -311 144 ) ( 512.01041666666663 -312 144 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -312 144 ) ( 512.01041666666663 -312 144 ) ( 512 -312 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -312 144 ) ( 512 -312 145 ) ( 512 -311 144 ) city4_7 40 32 0 1 1 +} +// brush 54 +{ +( 448 -256 16 ) ( 448 -256 48 ) ( 448 -320 48 ) city4_7 0 0 0 1 1 +( 512 -320 48 ) ( 512 -320 16 ) ( 448 -320 16 ) city4_7 0 0 0 1 1 +( 448 -320 16 ) ( 512 -320 16 ) ( 512 -256 16 ) city4_7 0 0 0 1 1 +( 512 -256 48 ) ( 512 -320 48 ) ( 448 -320 48 ) city4_7 0 0 0 1 1 +( 512 -256 16 ) ( 512 -256 48 ) ( 448 -256 48 ) city4_7 0 0 0 1 1 +( 512 -256 16 ) ( 512 -320 16 ) ( 512 -320 48 ) city4_7 0 0 0 1 1 +} +// brush 55 +{ +( 504 -264 48 ) ( 504 -263 48 ) ( 504 -264 49 ) city4_7 48 32 0 1 1 +( 504 -264 48 ) ( 504 -264 49 ) ( 504.01041666666674 -264 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -264 48 ) ( 504.01041666666674 -264 48 ) ( 504 -263 48 ) city4_7 63.9336 -48 0 0.0104167 1 +( 512 -256 144 ) ( 512 -255 144 ) ( 512.01041666666663 -256 144 ) city4_7 63.9336 -48 0 0.0104167 1 +( 512 -256 144 ) ( 512.01041666666663 -256 144 ) ( 512 -256 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -256 144 ) ( 512 -256 145 ) ( 512 -255 144 ) city4_7 48 32 0 1 1 +} +// brush 56 +{ +( 448 -264 48 ) ( 448 -263 48 ) ( 448 -264 49 ) city4_7 48 32 0 1 1 +( 448 -264 48 ) ( 448 -264 49 ) ( 448.01041666666674 -264 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -264 48 ) ( 448.01041666666674 -264 48 ) ( 448 -263 48 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 -256 144 ) ( 456 -255 144 ) ( 456.01041666666663 -256 144 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 -256 144 ) ( 456.01041666666663 -256 144 ) ( 456 -256 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -256 144 ) ( 456 -256 145 ) ( 456 -255 144 ) city4_7 48 32 0 1 1 +} +// brush 57 +{ +( 640 -256 16 ) ( 640 -256 48 ) ( 640 -320 48 ) city4_7 0 0 0 1 1 +( 704 -320 48 ) ( 704 -320 16 ) ( 640 -320 16 ) city4_7 0 0 0 1 1 +( 640 -320 16 ) ( 704 -320 16 ) ( 704 -256 16 ) city4_7 0 0 0 1 1 +( 704 -256 48 ) ( 704 -320 48 ) ( 640 -320 48 ) city4_7 0 0 0 1 1 +( 704 -256 16 ) ( 704 -256 48 ) ( 640 -256 48 ) city4_7 0 0 0 1 1 +( 704 -256 16 ) ( 704 -320 16 ) ( 704 -320 48 ) city4_7 0 0 0 1 1 +} +// brush 58 +{ +( 648 -272 48 ) ( 648 -271 48 ) ( 648 -272 49 ) city4_7 56 32 0 1 1 +( 648 -272 48 ) ( 648 -272 49 ) ( 648.01041666666674 -272 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -272 48 ) ( 648.01041666666674 -272 48 ) ( 648 -271 48 ) city4_7 63.9141 -56 0 0.0104167 1 +( 656 -264 144 ) ( 656 -263 144 ) ( 656.01041666666663 -264 144 ) city4_7 63.9141 -56 0 0.0104167 1 +( 656 -264 144 ) ( 656.01041666666663 -264 144 ) ( 656 -264 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -264 144 ) ( 656 -264 145 ) ( 656 -263 144 ) city4_7 56 32 0 1 1 +} +// brush 59 +{ +( 688 -272 48 ) ( 688 -271 48 ) ( 688 -272 49 ) city4_7 56 32 0 1 1 +( 688 -272 48 ) ( 688 -272 49 ) ( 688.01041666666674 -272 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -272 48 ) ( 688.01041666666674 -272 48 ) ( 688 -271 48 ) city4_7 63.9063 -56 0 0.0104167 1 +( 696 -264 144 ) ( 696 -263 144 ) ( 696.01041666666663 -264 144 ) city4_7 63.9063 -56 0 0.0104167 1 +( 696 -264 144 ) ( 696.01041666666663 -264 144 ) ( 696 -264 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -264 144 ) ( 696 -264 145 ) ( 696 -263 144 ) city4_7 56 32 0 1 1 +} +// brush 60 +{ +( 688 -312 48 ) ( 688 -311 48 ) ( 688 -312 49 ) city4_7 32 32 0 1 1 +( 688 -312 48 ) ( 688 -312 49 ) ( 688.01041666666674 -312 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -312 48 ) ( 688.01041666666674 -312 48 ) ( 688 -311 48 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -304 144 ) ( 696 -303 144 ) ( 696.01041666666663 -304 144 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -304 144 ) ( 696.01041666666663 -304 144 ) ( 696 -304 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -304 144 ) ( 696 -304 145 ) ( 696 -303 144 ) city4_7 32 32 0 1 1 +} +// brush 61 +{ +( 648 -312 48 ) ( 648 -311 48 ) ( 648 -312 49 ) city4_7 32 32 0 1 1 +( 648 -312 48 ) ( 648 -312 49 ) ( 648.01041666666674 -312 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -312 48 ) ( 648.01041666666674 -312 48 ) ( 648 -311 48 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -304 144 ) ( 656 -303 144 ) ( 656.01041666666663 -304 144 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -304 144 ) ( 656.01041666666663 -304 144 ) ( 656 -304 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -304 144 ) ( 656 -304 145 ) ( 656 -303 144 ) city4_7 32 32 0 1 1 +} +// brush 62 +{ +( 888 -128 48 ) ( 888 -127 48 ) ( 888 -128 49 ) city4_7 -24 32 0 1 1 +( 888 -128 48 ) ( 888 -128 49 ) ( 888.01041666666674 -128 48 ) city4_7 -0.117188 32 0 0.0104167 1 +( 888 -128 48 ) ( 888.01041666666674 -128 48 ) ( 888 -127 48 ) city4_7 -0.117188 24 0 0.0104167 1 +( 896 -120 144 ) ( 896 -119 144 ) ( 896.01041666666663 -120 144 ) city4_7 -0.117188 24 0 0.0104167 1 +( 896 -120 144 ) ( 896.01041666666663 -120 144 ) ( 896 -120 145 ) city4_7 -0.117188 32 0 0.0104167 1 +( 896 -120 144 ) ( 896 -120 145 ) ( 896 -119 144 ) city4_7 -24 32 0 1 1 +} +// brush 63 +{ +( 832 -128 48 ) ( 832 -127 48 ) ( 832 -128 49 ) city4_7 -24 32 0 1 1 +( 832 -128 48 ) ( 832 -128 49 ) ( 832.01041666666674 -128 48 ) city4_7 -0.109375 32 0 0.0104167 1 +( 832 -128 48 ) ( 832.01041666666674 -128 48 ) ( 832 -127 48 ) city4_7 -0.109375 24 0 0.0104167 1 +( 840 -120 144 ) ( 840 -119 144 ) ( 840.01041666666663 -120 144 ) city4_7 -0.109375 24 0 0.0104167 1 +( 840 -120 144 ) ( 840.01041666666663 -120 144 ) ( 840 -120 145 ) city4_7 -0.109375 32 0 0.0104167 1 +( 840 -120 144 ) ( 840 -120 145 ) ( 840 -119 144 ) city4_7 -24 32 0 1 1 +} +// brush 64 +{ +( 832 -72 48 ) ( 832 -71 48 ) ( 832 -72 49 ) city4_7 -16 32 0 1 1 +( 832 -72 48 ) ( 832 -72 49 ) ( 832.01041666666674 -72 48 ) city4_7 -0.109375 32 0 0.0104167 1 +( 832 -72 48 ) ( 832.01041666666674 -72 48 ) ( 832 -71 48 ) city4_7 -0.109375 16 0 0.0104167 1 +( 840 -64 144 ) ( 840 -63 144 ) ( 840.01041666666663 -64 144 ) city4_7 -0.109375 16 0 0.0104167 1 +( 840 -64 144 ) ( 840.01041666666663 -64 144 ) ( 840 -64 145 ) city4_7 -0.109375 32 0 0.0104167 1 +( 840 -64 144 ) ( 840 -64 145 ) ( 840 -63 144 ) city4_7 -16 32 0 1 1 +} +// brush 65 +{ +( 888 -72 48 ) ( 888 -71 48 ) ( 888 -72 49 ) city4_7 -16 32 0 1 1 +( 888 -72 48 ) ( 888 -72 49 ) ( 888.01041666666674 -72 48 ) city4_7 -0.117188 32 0 0.0104167 1 +( 888 -72 48 ) ( 888.01041666666674 -72 48 ) ( 888 -71 48 ) city4_7 -0.117188 16 0 0.0104167 1 +( 896 -64 144 ) ( 896 -63 144 ) ( 896.01041666666663 -64 144 ) city4_7 -0.117188 16 0 0.0104167 1 +( 896 -64 144 ) ( 896.01041666666663 -64 144 ) ( 896 -64 145 ) city4_7 -0.117188 32 0 0.0104167 1 +( 896 -64 144 ) ( 896 -64 145 ) ( 896 -63 144 ) city4_7 -16 32 0 1 1 +} +// brush 66 +{ +( 832 -64 16 ) ( 832 -64 48 ) ( 832 -128 48 ) city4_7 0 0 0 1 1 +( 896 -128 48 ) ( 896 -128 16 ) ( 832 -128 16 ) city4_7 0 0 0 1 1 +( 832 -128 16 ) ( 896 -128 16 ) ( 896 -64 16 ) city4_7 0 0 0 1 1 +( 896 -64 48 ) ( 896 -128 48 ) ( 832 -128 48 ) city4_7 0 0 0 1 1 +( 896 -64 16 ) ( 896 -64 48 ) ( 832 -64 48 ) city4_7 0 0 0 1 1 +( 896 -64 16 ) ( 896 -128 16 ) ( 896 -128 48 ) city4_7 0 0 0 1 1 +} +// brush 67 +{ +( 888 64 48 ) ( 888 65 48 ) ( 888 64 49 ) city4_7 -24 32 0 1 1 +( 888 64 48 ) ( 888 64 49 ) ( 888.01041666666674 64 48 ) city4_7 -0.117188 32 0 0.0104167 1 +( 888 64 48 ) ( 888.01041666666674 64 48 ) ( 888 65 48 ) city4_7 -0.117188 24 0 0.0104167 1 +( 896 72 144 ) ( 896 73 144 ) ( 896.01041666666652 72 144 ) city4_7 -0.117188 24 0 0.0104167 1 +( 896 72 144 ) ( 896.01041666666652 72 144 ) ( 896 72 145 ) city4_7 -0.117188 32 0 0.0104167 1 +( 896 72 144 ) ( 896 72 145 ) ( 896 73 144 ) city4_7 -24 32 0 1 1 +} +// brush 68 +{ +( 832 64 48 ) ( 832 65 48 ) ( 832 64 49 ) city4_7 -24 32 0 1 1 +( 832 64 48 ) ( 832 64 49 ) ( 832.01041666666674 64 48 ) city4_7 -0.109375 32 0 0.0104167 1 +( 832 64 48 ) ( 832.01041666666674 64 48 ) ( 832 65 48 ) city4_7 -0.109375 24 0 0.0104167 1 +( 840 72 144 ) ( 840 73 144 ) ( 840.01041666666652 72 144 ) city4_7 -0.109375 24 0 0.0104167 1 +( 840 72 144 ) ( 840.01041666666652 72 144 ) ( 840 72 145 ) city4_7 -0.109375 32 0 0.0104167 1 +( 840 72 144 ) ( 840 72 145 ) ( 840 73 144 ) city4_7 -24 32 0 1 1 +} +// brush 69 +{ +( 832 120 48 ) ( 832 121 48 ) ( 832 120 49 ) city4_7 -16 32 0 1 1 +( 832 120 48 ) ( 832 120 49 ) ( 832.01041666666674 120 48 ) city4_7 -0.109375 32 0 0.0104167 1 +( 832 120 48 ) ( 832.01041666666674 120 48 ) ( 832 121 48 ) city4_7 -0.109375 16 0 0.0104167 1 +( 840 128 144 ) ( 840 129 144 ) ( 840.01041666666652 128 144 ) city4_7 -0.109375 16 0 0.0104167 1 +( 840 128 144 ) ( 840.01041666666652 128 144 ) ( 840 128 145 ) city4_7 -0.109375 32 0 0.0104167 1 +( 840 128 144 ) ( 840 128 145 ) ( 840 129 144 ) city4_7 -16 32 0 1 1 +} +// brush 70 +{ +( 888 120 48 ) ( 888 121 48 ) ( 888 120 49 ) city4_7 -16 32 0 1 1 +( 888 120 48 ) ( 888 120 49 ) ( 888.01041666666674 120 48 ) city4_7 -0.117188 32 0 0.0104167 1 +( 888 120 48 ) ( 888.01041666666674 120 48 ) ( 888 121 48 ) city4_7 -0.117188 16 0 0.0104167 1 +( 896 128 144 ) ( 896 129 144 ) ( 896.01041666666652 128 144 ) city4_7 -0.117188 16 0 0.0104167 1 +( 896 128 144 ) ( 896.01041666666652 128 144 ) ( 896 128 145 ) city4_7 -0.117188 32 0 0.0104167 1 +( 896 128 144 ) ( 896 128 145 ) ( 896 129 144 ) city4_7 -16 32 0 1 1 +} +// brush 71 +{ +( 832 128 16 ) ( 832 128 48 ) ( 832 64 48 ) city4_7 0 0 0 1 1 +( 896 64 48 ) ( 896 64 16 ) ( 832 64 16 ) city4_7 0 0 0 1 1 +( 832 64 16 ) ( 896 64 16 ) ( 896 128 16 ) city4_7 0 0 0 1 1 +( 896 128 48 ) ( 896 64 48 ) ( 832 64 48 ) city4_7 0 0 0 1 1 +( 896 128 16 ) ( 896 128 48 ) ( 832 128 48 ) city4_7 0 0 0 1 1 +( 896 128 16 ) ( 896 64 16 ) ( 896 64 48 ) city4_7 0 0 0 1 1 +} +// brush 72 +{ +( 888 256 48 ) ( 888 257 48 ) ( 888 256 49 ) city4_7 -24 32 0 1 1 +( 888 256 48 ) ( 888 256 49 ) ( 888.01041666666674 256 48 ) city4_7 63.8828 32 0 0.0104167 1 +( 888 256 48 ) ( 888.01041666666674 256 48 ) ( 888 257 48 ) city4_7 63.8828 24 0 0.0104167 1 +( 896 264 144 ) ( 896 265 144 ) ( 896.01041666666652 264 144 ) city4_7 63.8828 24 0 0.0104167 1 +( 896 264 144 ) ( 896.01041666666652 264 144 ) ( 896 264 145 ) city4_7 63.8828 32 0 0.0104167 1 +( 896 264 144 ) ( 896 264 145 ) ( 896 265 144 ) city4_7 -24 32 0 1 1 +} +// brush 73 +{ +( 832 256 48 ) ( 832 257 48 ) ( 832 256 49 ) city4_7 -24 32 0 1 1 +( 832 256 48 ) ( 832 256 49 ) ( 832.01041666666674 256 48 ) city4_7 63.8906 32 0 0.0104167 1 +( 832 256 48 ) ( 832.01041666666674 256 48 ) ( 832 257 48 ) city4_7 63.8906 24 0 0.0104167 1 +( 840 264 144 ) ( 840 265 144 ) ( 840.01041666666652 264 144 ) city4_7 63.8906 24 0 0.0104167 1 +( 840 264 144 ) ( 840.01041666666652 264 144 ) ( 840 264 145 ) city4_7 63.8906 32 0 0.0104167 1 +( 840 264 144 ) ( 840 264 145 ) ( 840 265 144 ) city4_7 -24 32 0 1 1 +} +// brush 74 +{ +( 832 312 48 ) ( 832 313 48 ) ( 832 312 49 ) city4_7 -16 32 0 1 1 +( 832 312 48 ) ( 832 312 49 ) ( 832.01041666666674 312 48 ) city4_7 63.8906 32 0 0.0104167 1 +( 832 312 48 ) ( 832.01041666666674 312 48 ) ( 832 313 48 ) city4_7 63.8906 16 0 0.0104167 1 +( 840 320 144 ) ( 840 321 144 ) ( 840.01041666666652 320 144 ) city4_7 63.8906 16 0 0.0104167 1 +( 840 320 144 ) ( 840.01041666666652 320 144 ) ( 840 320 145 ) city4_7 63.8906 32 0 0.0104167 1 +( 840 320 144 ) ( 840 320 145 ) ( 840 321 144 ) city4_7 -16 32 0 1 1 +} +// brush 75 +{ +( 888 312 48 ) ( 888 313 48 ) ( 888 312 49 ) city4_7 -16 32 0 1 1 +( 888 312 48 ) ( 888 312 49 ) ( 888.01041666666674 312 48 ) city4_7 63.8828 32 0 0.0104167 1 +( 888 312 48 ) ( 888.01041666666674 312 48 ) ( 888 313 48 ) city4_7 63.8828 16 0 0.0104167 1 +( 896 320 144 ) ( 896 321 144 ) ( 896.01041666666652 320 144 ) city4_7 63.8828 16 0 0.0104167 1 +( 896 320 144 ) ( 896.01041666666652 320 144 ) ( 896 320 145 ) city4_7 63.8828 32 0 0.0104167 1 +( 896 320 144 ) ( 896 320 145 ) ( 896 321 144 ) city4_7 -16 32 0 1 1 +} +// brush 76 +{ +( 832 320 16 ) ( 832 320 48 ) ( 832 256 48 ) city4_7 0 0 0 1 1 +( 896 256 48 ) ( 896 256 16 ) ( 832 256 16 ) city4_7 0 0 0 1 1 +( 832 256 16 ) ( 896 256 16 ) ( 896 320 16 ) city4_7 0 0 0 1 1 +( 896 320 48 ) ( 896 256 48 ) ( 832 256 48 ) city4_7 0 0 0 1 1 +( 896 320 16 ) ( 896 320 48 ) ( 832 320 48 ) city4_7 0 0 0 1 1 +( 896 320 16 ) ( 896 256 16 ) ( 896 256 48 ) city4_7 0 0 0 1 1 +} +// brush 77 +{ +( 888 448 48 ) ( 888 449 48 ) ( 888 448 49 ) city4_7 -24 32 0 1 1 +( 888 448 48 ) ( 888 448 49 ) ( 888.01041666666674 448 48 ) city4_7 63.8828 32 0 0.0104167 1 +( 888 448 48 ) ( 888.01041666666674 448 48 ) ( 888 449 48 ) city4_7 63.8828 24 0 0.0104167 1 +( 896 456 144 ) ( 896 457 144 ) ( 896.01041666666663 456 144 ) city4_7 63.8828 24 0 0.0104167 1 +( 896 456 144 ) ( 896.01041666666663 456 144 ) ( 896 456 145 ) city4_7 63.8828 32 0 0.0104167 1 +( 896 456 144 ) ( 896 456 145 ) ( 896 457 144 ) city4_7 -24 32 0 1 1 +} +// brush 78 +{ +( 832 448 48 ) ( 832 449 48 ) ( 832 448 49 ) city4_7 -24 32 0 1 1 +( 832 448 48 ) ( 832 448 49 ) ( 832.01041666666674 448 48 ) city4_7 63.8906 32 0 0.0104167 1 +( 832 448 48 ) ( 832.01041666666674 448 48 ) ( 832 449 48 ) city4_7 63.8906 24 0 0.0104167 1 +( 840 456 144 ) ( 840 457 144 ) ( 840.01041666666663 456 144 ) city4_7 63.8906 24 0 0.0104167 1 +( 840 456 144 ) ( 840.01041666666663 456 144 ) ( 840 456 145 ) city4_7 63.8906 32 0 0.0104167 1 +( 840 456 144 ) ( 840 456 145 ) ( 840 457 144 ) city4_7 -24 32 0 1 1 +} +// brush 79 +{ +( 832 504 48 ) ( 832 505 48 ) ( 832 504 49 ) city4_7 -16 32 0 1 1 +( 832 504 48 ) ( 832 504 49 ) ( 832.01041666666674 504 48 ) city4_7 63.8906 32 0 0.0104167 1 +( 832 504 48 ) ( 832.01041666666674 504 48 ) ( 832 505 48 ) city4_7 63.8906 16 0 0.0104167 1 +( 840 512 144 ) ( 840 513 144 ) ( 840.01041666666663 512 144 ) city4_7 63.8906 16 0 0.0104167 1 +( 840 512 144 ) ( 840.01041666666663 512 144 ) ( 840 512 145 ) city4_7 63.8906 32 0 0.0104167 1 +( 840 512 144 ) ( 840 512 145 ) ( 840 513 144 ) city4_7 -16 32 0 1 1 +} +// brush 80 +{ +( 888 504 48 ) ( 888 505 48 ) ( 888 504 49 ) city4_7 -16 32 0 1 1 +( 888 504 48 ) ( 888 504 49 ) ( 888.01041666666674 504 48 ) city4_7 63.8828 32 0 0.0104167 1 +( 888 504 48 ) ( 888.01041666666674 504 48 ) ( 888 505 48 ) city4_7 63.8828 16 0 0.0104167 1 +( 896 512 144 ) ( 896 513 144 ) ( 896.01041666666663 512 144 ) city4_7 63.8828 16 0 0.0104167 1 +( 896 512 144 ) ( 896.01041666666663 512 144 ) ( 896 512 145 ) city4_7 63.8828 32 0 0.0104167 1 +( 896 512 144 ) ( 896 512 145 ) ( 896 513 144 ) city4_7 -16 32 0 1 1 +} +// brush 81 +{ +( 832 512 16 ) ( 832 512 48 ) ( 832 448 48 ) city4_7 0 0 0 1 1 +( 896 448 48 ) ( 896 448 16 ) ( 832 448 16 ) city4_7 0 0 0 1 1 +( 832 448 16 ) ( 896 448 16 ) ( 896 512 16 ) city4_7 0 0 0 1 1 +( 896 512 48 ) ( 896 448 48 ) ( 832 448 48 ) city4_7 0 0 0 1 1 +( 896 512 16 ) ( 896 512 48 ) ( 832 512 48 ) city4_7 0 0 0 1 1 +( 896 512 16 ) ( 896 448 16 ) ( 896 448 48 ) city4_7 0 0 0 1 1 +} +// brush 82 +{ +( 64 -448 16 ) ( 64 -448 48 ) ( 64 -512 48 ) city4_7 0 0 0 1 1 +( 128 -512 48 ) ( 128 -512 16 ) ( 64 -512 16 ) city4_7 0 0 0 1 1 +( 64 -512 16 ) ( 128 -512 16 ) ( 128 -448 16 ) city4_7 0 0 0 1 1 +( 128 -448 48 ) ( 128 -512 48 ) ( 64 -512 48 ) city4_7 0 0 0 1 1 +( 128 -448 16 ) ( 128 -448 48 ) ( 64 -448 48 ) city4_7 0 0 0 1 1 +( 128 -448 16 ) ( 128 -512 16 ) ( 128 -512 48 ) city4_7 0 0 0 1 1 +} +// brush 83 +{ +( 256 -448 16 ) ( 256 -448 48 ) ( 256 -512 48 ) city4_7 0 0 0 1 1 +( 320 -512 48 ) ( 320 -512 16 ) ( 256 -512 16 ) city4_7 0 0 0 1 1 +( 256 -512 16 ) ( 320 -512 16 ) ( 320 -448 16 ) city4_7 0 0 0 1 1 +( 320 -448 48 ) ( 320 -512 48 ) ( 256 -512 48 ) city4_7 0 0 0 1 1 +( 320 -448 16 ) ( 320 -448 48 ) ( 256 -448 48 ) city4_7 0 0 0 1 1 +( 320 -448 16 ) ( 320 -512 16 ) ( 320 -512 48 ) city4_7 0 0 0 1 1 +} +// brush 84 +{ +( 448 -448 16 ) ( 448 -448 48 ) ( 448 -512 48 ) city4_7 0 0 0 1 1 +( 512 -512 48 ) ( 512 -512 16 ) ( 448 -512 16 ) city4_7 0 0 0 1 1 +( 448 -512 16 ) ( 512 -512 16 ) ( 512 -448 16 ) city4_7 0 0 0 1 1 +( 512 -448 48 ) ( 512 -512 48 ) ( 448 -512 48 ) city4_7 0 0 0 1 1 +( 512 -448 16 ) ( 512 -448 48 ) ( 448 -448 48 ) city4_7 0 0 0 1 1 +( 512 -448 16 ) ( 512 -512 16 ) ( 512 -512 48 ) city4_7 0 0 0 1 1 +} +// brush 85 +{ +( 448 -512 48 ) ( 448 -511 48 ) ( 448 -512 49 ) city4_7 40 32 0 1 1 +( 448 -512 48 ) ( 448 -512 49 ) ( 448.01041666666674 -512 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -512 48 ) ( 448.01041666666674 -512 48 ) ( 448 -511 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -504 144 ) ( 456 -503 144 ) ( 456.01041666666663 -504 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -504 144 ) ( 456.01041666666663 -504 144 ) ( 456 -504 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -504 144 ) ( 456 -504 145 ) ( 456 -503 144 ) city4_7 40 32 0 1 1 +} +// brush 86 +{ +( 448 -456 48 ) ( 448 -455 48 ) ( 448 -456 49 ) city4_7 -16 32 0 1 1 +( 448 -456 48 ) ( 448 -456 49 ) ( 448.01041666666674 -456 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -456 48 ) ( 448.01041666666674 -456 48 ) ( 448 -455 48 ) city4_7 63.9375 16 0 0.0104167 1 +( 456 -448 144 ) ( 456 -447 144 ) ( 456.01041666666663 -448 144 ) city4_7 63.9375 16 0 0.0104167 1 +( 456 -448 144 ) ( 456.01041666666663 -448 144 ) ( 456 -448 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -448 144 ) ( 456 -448 145 ) ( 456 -447 144 ) city4_7 -16 32 0 1 1 +} +// brush 87 +{ +( 504 -456 48 ) ( 504 -455 48 ) ( 504 -456 49 ) city4_7 -16 32 0 1 1 +( 504 -456 48 ) ( 504 -456 49 ) ( 504.01041666666674 -456 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -456 48 ) ( 504.01041666666674 -456 48 ) ( 504 -455 48 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 -448 144 ) ( 512 -447 144 ) ( 512.01041666666663 -448 144 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 -448 144 ) ( 512.01041666666663 -448 144 ) ( 512 -448 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -448 144 ) ( 512 -448 145 ) ( 512 -447 144 ) city4_7 -16 32 0 1 1 +} +// brush 88 +{ +( 504 -512 48 ) ( 504 -511 48 ) ( 504 -512 49 ) city4_7 40 32 0 1 1 +( 504 -512 48 ) ( 504 -512 49 ) ( 504.01041666666674 -512 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -512 48 ) ( 504.01041666666674 -512 48 ) ( 504 -511 48 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -504 144 ) ( 512 -503 144 ) ( 512.01041666666663 -504 144 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -504 144 ) ( 512.01041666666663 -504 144 ) ( 512 -504 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -504 144 ) ( 512 -504 145 ) ( 512 -503 144 ) city4_7 40 32 0 1 1 +} +// brush 89 +{ +( 640 -448 16 ) ( 640 -448 48 ) ( 640 -512 48 ) city4_7 0 0 0 1 1 +( 704 -512 48 ) ( 704 -512 16 ) ( 640 -512 16 ) city4_7 0 0 0 1 1 +( 640 -512 16 ) ( 704 -512 16 ) ( 704 -448 16 ) city4_7 0 0 0 1 1 +( 704 -448 48 ) ( 704 -512 48 ) ( 640 -512 48 ) city4_7 0 0 0 1 1 +( 704 -448 16 ) ( 704 -448 48 ) ( 640 -448 48 ) city4_7 0 0 0 1 1 +( 704 -448 16 ) ( 704 -512 16 ) ( 704 -512 48 ) city4_7 0 0 0 1 1 +} +// brush 90 +{ +( 648 -504 48 ) ( 648 -503 48 ) ( 648 -504 49 ) city4_7 32 32 0 1 1 +( 648 -504 48 ) ( 648 -504 49 ) ( 648.01041666666674 -504 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -504 48 ) ( 648.01041666666674 -504 48 ) ( 648 -503 48 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -496 144 ) ( 656 -495 144 ) ( 656.01041666666663 -496 144 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -496 144 ) ( 656.01041666666663 -496 144 ) ( 656 -496 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -496 144 ) ( 656 -496 145 ) ( 656 -495 144 ) city4_7 32 32 0 1 1 +} +// brush 91 +{ +( 688 -504 48 ) ( 688 -503 48 ) ( 688 -504 49 ) city4_7 32 32 0 1 1 +( 688 -504 48 ) ( 688 -504 49 ) ( 688.01041666666674 -504 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -504 48 ) ( 688.01041666666674 -504 48 ) ( 688 -503 48 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -496 144 ) ( 696 -495 144 ) ( 696.01041666666663 -496 144 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -496 144 ) ( 696.01041666666663 -496 144 ) ( 696 -496 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -496 144 ) ( 696 -496 145 ) ( 696 -495 144 ) city4_7 32 32 0 1 1 +} +// brush 92 +{ +( 688 -464 48 ) ( 688 -463 48 ) ( 688 -464 49 ) city4_7 -8 32 0 1 1 +( 688 -464 48 ) ( 688 -464 49 ) ( 688.01041666666674 -464 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -464 48 ) ( 688.01041666666674 -464 48 ) ( 688 -463 48 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -456 144 ) ( 696 -455 144 ) ( 696.01041666666663 -456 144 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -456 144 ) ( 696.01041666666663 -456 144 ) ( 696 -456 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -456 144 ) ( 696 -456 145 ) ( 696 -455 144 ) city4_7 -8 32 0 1 1 +} +// brush 93 +{ +( 648 -464 48 ) ( 648 -463 48 ) ( 648 -464 49 ) city4_7 -8 32 0 1 1 +( 648 -464 48 ) ( 648 -464 49 ) ( 648.01041666666674 -464 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -464 48 ) ( 648.01041666666674 -464 48 ) ( 648 -463 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -456 144 ) ( 656 -455 144 ) ( 656.01041666666663 -456 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -456 144 ) ( 656.01041666666663 -456 144 ) ( 656 -456 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -456 144 ) ( 656 -456 145 ) ( 656 -455 144 ) city4_7 -8 32 0 1 1 +} +// brush 94 +{ +( 64 -640 16 ) ( 64 -640 48 ) ( 64 -704 48 ) city4_7 0 0 0 1 1 +( 128 -704 48 ) ( 128 -704 16 ) ( 64 -704 16 ) city4_7 0 0 0 1 1 +( 64 -704 16 ) ( 128 -704 16 ) ( 128 -640 16 ) city4_7 0 0 0 1 1 +( 128 -640 48 ) ( 128 -704 48 ) ( 64 -704 48 ) city4_7 0 0 0 1 1 +( 128 -640 16 ) ( 128 -640 48 ) ( 64 -640 48 ) city4_7 0 0 0 1 1 +( 128 -640 16 ) ( 128 -704 16 ) ( 128 -704 48 ) city4_7 0 0 0 1 1 +} +// brush 95 +{ +( 256 -640 16 ) ( 256 -640 48 ) ( 256 -704 48 ) city4_7 0 0 0 1 1 +( 320 -704 48 ) ( 320 -704 16 ) ( 256 -704 16 ) city4_7 0 0 0 1 1 +( 256 -704 16 ) ( 320 -704 16 ) ( 320 -640 16 ) city4_7 0 0 0 1 1 +( 320 -640 48 ) ( 320 -704 48 ) ( 256 -704 48 ) city4_7 0 0 0 1 1 +( 320 -640 16 ) ( 320 -640 48 ) ( 256 -640 48 ) city4_7 0 0 0 1 1 +( 320 -640 16 ) ( 320 -704 16 ) ( 320 -704 48 ) city4_7 0 0 0 1 1 +} +// brush 96 +{ +( 448 -640 16 ) ( 448 -640 48 ) ( 448 -704 48 ) city4_7 0 0 0 1 1 +( 512 -704 48 ) ( 512 -704 16 ) ( 448 -704 16 ) city4_7 0 0 0 1 1 +( 448 -704 16 ) ( 512 -704 16 ) ( 512 -640 16 ) city4_7 0 0 0 1 1 +( 512 -640 48 ) ( 512 -704 48 ) ( 448 -704 48 ) city4_7 0 0 0 1 1 +( 512 -640 16 ) ( 512 -640 48 ) ( 448 -640 48 ) city4_7 0 0 0 1 1 +( 512 -640 16 ) ( 512 -704 16 ) ( 512 -704 48 ) city4_7 0 0 0 1 1 +} +// brush 97 +{ +( 448 -704 48 ) ( 448 -703 48 ) ( 448 -704 49 ) city4_7 40 32 0 1 1 +( 448 -704 48 ) ( 448 -704 49 ) ( 448.01041666666674 -704 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -704 48 ) ( 448.01041666666674 -704 48 ) ( 448 -703 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -696 144 ) ( 456 -695 144 ) ( 456.01041666666663 -696 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -696 144 ) ( 456.01041666666663 -696 144 ) ( 456 -696 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -696 144 ) ( 456 -696 145 ) ( 456 -695 144 ) city4_7 40 32 0 1 1 +} +// brush 98 +{ +( 448 -648 48 ) ( 448 -647 48 ) ( 448 -648 49 ) city4_7 -16 32 0 1 1 +( 448 -648 48 ) ( 448 -648 49 ) ( 448.01041666666674 -648 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -648 48 ) ( 448.01041666666674 -648 48 ) ( 448 -647 48 ) city4_7 63.9375 16 0 0.0104167 1 +( 456 -640 144 ) ( 456 -639 144 ) ( 456.01041666666663 -640 144 ) city4_7 63.9375 16 0 0.0104167 1 +( 456 -640 144 ) ( 456.01041666666663 -640 144 ) ( 456 -640 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -640 144 ) ( 456 -640 145 ) ( 456 -639 144 ) city4_7 -16 32 0 1 1 +} +// brush 99 +{ +( 504 -648 48 ) ( 504 -647 48 ) ( 504 -648 49 ) city4_7 -16 32 0 1 1 +( 504 -648 48 ) ( 504 -648 49 ) ( 504.01041666666674 -648 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -648 48 ) ( 504.01041666666674 -648 48 ) ( 504 -647 48 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 -640 144 ) ( 512 -639 144 ) ( 512.01041666666663 -640 144 ) city4_7 63.9336 16 0 0.0104167 1 +( 512 -640 144 ) ( 512.01041666666663 -640 144 ) ( 512 -640 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -640 144 ) ( 512 -640 145 ) ( 512 -639 144 ) city4_7 -16 32 0 1 1 +} +// brush 100 +{ +( 504 -704 48 ) ( 504 -703 48 ) ( 504 -704 49 ) city4_7 40 32 0 1 1 +( 504 -704 48 ) ( 504 -704 49 ) ( 504.01041666666674 -704 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -704 48 ) ( 504.01041666666674 -704 48 ) ( 504 -703 48 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -696 144 ) ( 512 -695 144 ) ( 512.01041666666663 -696 144 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -696 144 ) ( 512.01041666666663 -696 144 ) ( 512 -696 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -696 144 ) ( 512 -696 145 ) ( 512 -695 144 ) city4_7 40 32 0 1 1 +} +// brush 101 +{ +( 640 -640 16 ) ( 640 -640 48 ) ( 640 -704 48 ) city4_7 0 0 0 1 1 +( 704 -704 48 ) ( 704 -704 16 ) ( 640 -704 16 ) city4_7 0 0 0 1 1 +( 640 -704 16 ) ( 704 -704 16 ) ( 704 -640 16 ) city4_7 0 0 0 1 1 +( 704 -640 48 ) ( 704 -704 48 ) ( 640 -704 48 ) city4_7 0 0 0 1 1 +( 704 -640 16 ) ( 704 -640 48 ) ( 640 -640 48 ) city4_7 0 0 0 1 1 +( 704 -640 16 ) ( 704 -704 16 ) ( 704 -704 48 ) city4_7 0 0 0 1 1 +} +// brush 102 +{ +( 648 -696 48 ) ( 648 -695 48 ) ( 648 -696 49 ) city4_7 32 32 0 1 1 +( 648 -696 48 ) ( 648 -696 49 ) ( 648.01041666666674 -696 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -696 48 ) ( 648.01041666666674 -696 48 ) ( 648 -695 48 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -688 144 ) ( 656 -687 144 ) ( 656.01041666666663 -688 144 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -688 144 ) ( 656.01041666666663 -688 144 ) ( 656 -688 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -688 144 ) ( 656 -688 145 ) ( 656 -687 144 ) city4_7 32 32 0 1 1 +} +// brush 103 +{ +( 688 -696 48 ) ( 688 -695 48 ) ( 688 -696 49 ) city4_7 32 32 0 1 1 +( 688 -696 48 ) ( 688 -696 49 ) ( 688.01041666666674 -696 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -696 48 ) ( 688.01041666666674 -696 48 ) ( 688 -695 48 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -688 144 ) ( 696 -687 144 ) ( 696.01041666666663 -688 144 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -688 144 ) ( 696.01041666666663 -688 144 ) ( 696 -688 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -688 144 ) ( 696 -688 145 ) ( 696 -687 144 ) city4_7 32 32 0 1 1 +} +// brush 104 +{ +( 688 -656 48 ) ( 688 -655 48 ) ( 688 -656 49 ) city4_7 -8 32 0 1 1 +( 688 -656 48 ) ( 688 -656 49 ) ( 688.01041666666674 -656 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -656 48 ) ( 688.01041666666674 -656 48 ) ( 688 -655 48 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -648 144 ) ( 696 -647 144 ) ( 696.01041666666663 -648 144 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -648 144 ) ( 696.01041666666663 -648 144 ) ( 696 -648 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -648 144 ) ( 696 -648 145 ) ( 696 -647 144 ) city4_7 -8 32 0 1 1 +} +// brush 105 +{ +( 648 -656 48 ) ( 648 -655 48 ) ( 648 -656 49 ) city4_7 -8 32 0 1 1 +( 648 -656 48 ) ( 648 -656 49 ) ( 648.01041666666674 -656 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -656 48 ) ( 648.01041666666674 -656 48 ) ( 648 -655 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -648 144 ) ( 656 -647 144 ) ( 656.01041666666663 -648 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -648 144 ) ( 656.01041666666663 -648 144 ) ( 656 -648 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -648 144 ) ( 656 -648 145 ) ( 656 -647 144 ) city4_7 -8 32 0 1 1 +} +// brush 106 +{ +( 448 -832 16 ) ( 448 -832 48 ) ( 448 -896 48 ) city4_7 0 0 0 1 1 +( 512 -896 48 ) ( 512 -896 16 ) ( 448 -896 16 ) city4_7 0 0 0 1 1 +( 448 -896 16 ) ( 512 -896 16 ) ( 512 -832 16 ) city4_7 0 0 0 1 1 +( 512 -832 48 ) ( 512 -896 48 ) ( 448 -896 48 ) city4_7 0 0 0 1 1 +( 512 -832 16 ) ( 512 -832 48 ) ( 448 -832 48 ) city4_7 0 0 0 1 1 +( 512 -832 16 ) ( 512 -896 16 ) ( 512 -896 48 ) city4_7 0 0 0 1 1 +} +// brush 107 +{ +( 448 -896 48 ) ( 448 -895 48 ) ( 448 -896 49 ) city4_7 40 32 0 1 1 +( 448 -896 48 ) ( 448 -896 49 ) ( 448.01041666666674 -896 48 ) city4_7 -0.0625 32 0 0.0104167 1 +( 448 -896 48 ) ( 448.01041666666674 -896 48 ) ( 448 -895 48 ) city4_7 -0.0625 -40 0 0.0104167 1 +( 456 -888 144 ) ( 456 -887 144 ) ( 456.01041666666663 -888 144 ) city4_7 -0.0625 -40 0 0.0104167 1 +( 456 -888 144 ) ( 456.01041666666663 -888 144 ) ( 456 -888 145 ) city4_7 -0.0625 32 0 0.0104167 1 +( 456 -888 144 ) ( 456 -888 145 ) ( 456 -887 144 ) city4_7 40 32 0 1 1 +} +// brush 108 +{ +( 448 -840 48 ) ( 448 -839 48 ) ( 448 -840 49 ) city4_7 -16 32 0 1 1 +( 448 -840 48 ) ( 448 -840 49 ) ( 448.01041666666674 -840 48 ) city4_7 -0.0625 32 0 0.0104167 1 +( 448 -840 48 ) ( 448.01041666666674 -840 48 ) ( 448 -839 48 ) city4_7 -0.0625 16 0 0.0104167 1 +( 456 -832 144 ) ( 456 -831 144 ) ( 456.01041666666663 -832 144 ) city4_7 -0.0625 16 0 0.0104167 1 +( 456 -832 144 ) ( 456.01041666666663 -832 144 ) ( 456 -832 145 ) city4_7 -0.0625 32 0 0.0104167 1 +( 456 -832 144 ) ( 456 -832 145 ) ( 456 -831 144 ) city4_7 -16 32 0 1 1 +} +// brush 109 +{ +( 504 -840 48 ) ( 504 -839 48 ) ( 504 -840 49 ) city4_7 -16 32 0 1 1 +( 504 -840 48 ) ( 504 -840 49 ) ( 504.01041666666674 -840 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 -840 48 ) ( 504.01041666666674 -840 48 ) ( 504 -839 48 ) city4_7 -0.0664063 16 0 0.0104167 1 +( 512 -832 144 ) ( 512 -831 144 ) ( 512.01041666666663 -832 144 ) city4_7 -0.0664063 16 0 0.0104167 1 +( 512 -832 144 ) ( 512.01041666666663 -832 144 ) ( 512 -832 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 -832 144 ) ( 512 -832 145 ) ( 512 -831 144 ) city4_7 -16 32 0 1 1 +} +// brush 110 +{ +( 504 -896 48 ) ( 504 -895 48 ) ( 504 -896 49 ) city4_7 40 32 0 1 1 +( 504 -896 48 ) ( 504 -896 49 ) ( 504.01041666666674 -896 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 -896 48 ) ( 504.01041666666674 -896 48 ) ( 504 -895 48 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 -888 144 ) ( 512 -887 144 ) ( 512.01041666666663 -888 144 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 -888 144 ) ( 512.01041666666663 -888 144 ) ( 512 -888 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 -888 144 ) ( 512 -888 145 ) ( 512 -887 144 ) city4_7 40 32 0 1 1 +} +// brush 111 +{ +( 256 -832 16 ) ( 256 -832 48 ) ( 256 -896 48 ) city4_7 0 0 0 1 1 +( 320 -896 48 ) ( 320 -896 16 ) ( 256 -896 16 ) city4_7 0 0 0 1 1 +( 256 -896 16 ) ( 320 -896 16 ) ( 320 -832 16 ) city4_7 0 0 0 1 1 +( 320 -832 48 ) ( 320 -896 48 ) ( 256 -896 48 ) city4_7 0 0 0 1 1 +( 320 -832 16 ) ( 320 -832 48 ) ( 256 -832 48 ) city4_7 0 0 0 1 1 +( 320 -832 16 ) ( 320 -896 16 ) ( 320 -896 48 ) city4_7 0 0 0 1 1 +} +// brush 112 +{ +( 64 -832 16 ) ( 64 -832 48 ) ( 64 -896 48 ) city4_7 0 0 0 1 1 +( 128 -896 48 ) ( 128 -896 16 ) ( 64 -896 16 ) city4_7 0 0 0 1 1 +( 64 -896 16 ) ( 128 -896 16 ) ( 128 -832 16 ) city4_7 0 0 0 1 1 +( 128 -832 48 ) ( 128 -896 48 ) ( 64 -896 48 ) city4_7 0 0 0 1 1 +( 128 -832 16 ) ( 128 -832 48 ) ( 64 -832 48 ) city4_7 0 0 0 1 1 +( 128 -832 16 ) ( 128 -896 16 ) ( 128 -896 48 ) city4_7 0 0 0 1 1 +} +// brush 113 +{ +( 648 -888 48 ) ( 648 -887 48 ) ( 648 -888 49 ) city4_7 32 32 0 1 1 +( 648 -888 48 ) ( 648 -888 49 ) ( 648.01041666666674 -888 48 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 648 -888 48 ) ( 648.01041666666674 -888 48 ) ( 648 -887 48 ) city4_7 -0.0859375 -32 0 0.0104167 1 +( 656 -880 144 ) ( 656 -879 144 ) ( 656.01041666666663 -880 144 ) city4_7 -0.0859375 -32 0 0.0104167 1 +( 656 -880 144 ) ( 656.01041666666663 -880 144 ) ( 656 -880 145 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 656 -880 144 ) ( 656 -880 145 ) ( 656 -879 144 ) city4_7 32 32 0 1 1 +} +// brush 114 +{ +( 688 -888 48 ) ( 688 -887 48 ) ( 688 -888 49 ) city4_7 32 32 0 1 1 +( 688 -888 48 ) ( 688 -888 49 ) ( 688.01041666666674 -888 48 ) city4_7 -0.09375 32 0 0.0104167 1 +( 688 -888 48 ) ( 688.01041666666674 -888 48 ) ( 688 -887 48 ) city4_7 -0.09375 -32 0 0.0104167 1 +( 696 -880 144 ) ( 696 -879 144 ) ( 696.01041666666663 -880 144 ) city4_7 -0.09375 -32 0 0.0104167 1 +( 696 -880 144 ) ( 696.01041666666663 -880 144 ) ( 696 -880 145 ) city4_7 -0.09375 32 0 0.0104167 1 +( 696 -880 144 ) ( 696 -880 145 ) ( 696 -879 144 ) city4_7 32 32 0 1 1 +} +// brush 115 +{ +( 648 -848 48 ) ( 648 -847 48 ) ( 648 -848 49 ) city4_7 -8 32 0 1 1 +( 648 -848 48 ) ( 648 -848 49 ) ( 648.01041666666674 -848 48 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 648 -848 48 ) ( 648.01041666666674 -848 48 ) ( 648 -847 48 ) city4_7 -0.0859375 8 0 0.0104167 1 +( 656 -840 144 ) ( 656 -839 144 ) ( 656.01041666666663 -840 144 ) city4_7 -0.0859375 8 0 0.0104167 1 +( 656 -840 144 ) ( 656.01041666666663 -840 144 ) ( 656 -840 145 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 656 -840 144 ) ( 656 -840 145 ) ( 656 -839 144 ) city4_7 -8 32 0 1 1 +} +// brush 116 +{ +( 640 -832 16 ) ( 640 -832 48 ) ( 640 -896 48 ) city4_7 0 0 0 1 1 +( 704 -896 48 ) ( 704 -896 16 ) ( 640 -896 16 ) city4_7 0 0 0 1 1 +( 640 -896 16 ) ( 704 -896 16 ) ( 704 -832 16 ) city4_7 0 0 0 1 1 +( 704 -832 48 ) ( 704 -896 48 ) ( 640 -896 48 ) city4_7 0 0 0 1 1 +( 704 -832 16 ) ( 704 -832 48 ) ( 640 -832 48 ) city4_7 0 0 0 1 1 +( 704 -832 16 ) ( 704 -896 16 ) ( 704 -896 48 ) city4_7 0 0 0 1 1 +} +// brush 117 +{ +( 688 -848 48 ) ( 688 -847 48 ) ( 688 -848 49 ) city4_7 -8 32 0 1 1 +( 688 -848 48 ) ( 688 -848 49 ) ( 688.01041666666674 -848 48 ) city4_7 -0.09375 32 0 0.0104167 1 +( 688 -848 48 ) ( 688.01041666666674 -848 48 ) ( 688 -847 48 ) city4_7 -0.09375 8 0 0.0104167 1 +( 696 -840 144 ) ( 696 -839 144 ) ( 696.01041666666663 -840 144 ) city4_7 -0.09375 8 0 0.0104167 1 +( 696 -840 144 ) ( 696.01041666666663 -840 144 ) ( 696 -840 145 ) city4_7 -0.09375 32 0 0.0104167 1 +( 696 -840 144 ) ( 696 -840 145 ) ( 696 -839 144 ) city4_7 -8 32 0 1 1 +} +// brush 118 +{ +( 448 -1024 16 ) ( 448 -1024 48 ) ( 448 -1088 48 ) city4_7 0 0 0 1 1 +( 512 -1088 48 ) ( 512 -1088 16 ) ( 448 -1088 16 ) city4_7 0 0 0 1 1 +( 448 -1088 16 ) ( 512 -1088 16 ) ( 512 -1024 16 ) city4_7 0 0 0 1 1 +( 512 -1024 48 ) ( 512 -1088 48 ) ( 448 -1088 48 ) city4_7 0 0 0 1 1 +( 512 -1024 16 ) ( 512 -1024 48 ) ( 448 -1024 48 ) city4_7 0 0 0 1 1 +( 512 -1024 16 ) ( 512 -1088 16 ) ( 512 -1088 48 ) city4_7 0 0 0 1 1 +} +// brush 119 +{ +( 448 -1088 48 ) ( 448 -1087 48 ) ( 448 -1088 49 ) city4_7 40 32 0 1 1 +( 448 -1088 48 ) ( 448 -1088 49 ) ( 448.01041666666674 -1088 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -1088 48 ) ( 448.01041666666674 -1088 48 ) ( 448 -1087 48 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -1080 144 ) ( 456 -1079 144 ) ( 456.01041666666663 -1080 144 ) city4_7 63.9375 -40 0 0.0104167 1 +( 456 -1080 144 ) ( 456.01041666666663 -1080 144 ) ( 456 -1080 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -1080 144 ) ( 456 -1080 145 ) ( 456 -1079 144 ) city4_7 40 32 0 1 1 +} +// brush 120 +{ +( 448 -1032 48 ) ( 448 -1031 48 ) ( 448 -1032 49 ) city4_7 48 32 0 1 1 +( 448 -1032 48 ) ( 448 -1032 49 ) ( 448.01041666666674 -1032 48 ) city4_7 63.9375 32 0 0.0104167 1 +( 448 -1032 48 ) ( 448.01041666666674 -1032 48 ) ( 448 -1031 48 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 -1024 144 ) ( 456 -1023 144 ) ( 456.01041666666663 -1024 144 ) city4_7 63.9375 -48 0 0.0104167 1 +( 456 -1024 144 ) ( 456.01041666666663 -1024 144 ) ( 456 -1024 145 ) city4_7 63.9375 32 0 0.0104167 1 +( 456 -1024 144 ) ( 456 -1024 145 ) ( 456 -1023 144 ) city4_7 48 32 0 1 1 +} +// brush 121 +{ +( 504 -1032 48 ) ( 504 -1031 48 ) ( 504 -1032 49 ) city4_7 48 32 0 1 1 +( 504 -1032 48 ) ( 504 -1032 49 ) ( 504.01041666666674 -1032 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -1032 48 ) ( 504.01041666666674 -1032 48 ) ( 504 -1031 48 ) city4_7 63.9336 -48 0 0.0104167 1 +( 512 -1024 144 ) ( 512 -1023 144 ) ( 512.01041666666663 -1024 144 ) city4_7 63.9336 -48 0 0.0104167 1 +( 512 -1024 144 ) ( 512.01041666666663 -1024 144 ) ( 512 -1024 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -1024 144 ) ( 512 -1024 145 ) ( 512 -1023 144 ) city4_7 48 32 0 1 1 +} +// brush 122 +{ +( 504 -1088 48 ) ( 504 -1087 48 ) ( 504 -1088 49 ) city4_7 40 32 0 1 1 +( 504 -1088 48 ) ( 504 -1088 49 ) ( 504.01041666666674 -1088 48 ) city4_7 63.9336 32 0 0.0104167 1 +( 504 -1088 48 ) ( 504.01041666666674 -1088 48 ) ( 504 -1087 48 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -1080 144 ) ( 512 -1079 144 ) ( 512.01041666666663 -1080 144 ) city4_7 63.9336 -40 0 0.0104167 1 +( 512 -1080 144 ) ( 512.01041666666663 -1080 144 ) ( 512 -1080 145 ) city4_7 63.9336 32 0 0.0104167 1 +( 512 -1080 144 ) ( 512 -1080 145 ) ( 512 -1079 144 ) city4_7 40 32 0 1 1 +} +// brush 123 +{ +( 256 -1024 16 ) ( 256 -1024 48 ) ( 256 -1088 48 ) city4_7 0 0 0 1 1 +( 320 -1088 48 ) ( 320 -1088 16 ) ( 256 -1088 16 ) city4_7 0 0 0 1 1 +( 256 -1088 16 ) ( 320 -1088 16 ) ( 320 -1024 16 ) city4_7 0 0 0 1 1 +( 320 -1024 48 ) ( 320 -1088 48 ) ( 256 -1088 48 ) city4_7 0 0 0 1 1 +( 320 -1024 16 ) ( 320 -1024 48 ) ( 256 -1024 48 ) city4_7 0 0 0 1 1 +( 320 -1024 16 ) ( 320 -1088 16 ) ( 320 -1088 48 ) city4_7 0 0 0 1 1 +} +// brush 124 +{ +( 64 -1024 16 ) ( 64 -1024 48 ) ( 64 -1088 48 ) city4_7 0 0 0 1 1 +( 128 -1088 48 ) ( 128 -1088 16 ) ( 64 -1088 16 ) city4_7 0 0 0 1 1 +( 64 -1088 16 ) ( 128 -1088 16 ) ( 128 -1024 16 ) city4_7 0 0 0 1 1 +( 128 -1024 48 ) ( 128 -1088 48 ) ( 64 -1088 48 ) city4_7 0 0 0 1 1 +( 128 -1024 16 ) ( 128 -1024 48 ) ( 64 -1024 48 ) city4_7 0 0 0 1 1 +( 128 -1024 16 ) ( 128 -1088 16 ) ( 128 -1088 48 ) city4_7 0 0 0 1 1 +} +// brush 125 +{ +( 648 -1080 48 ) ( 648 -1079 48 ) ( 648 -1080 49 ) city4_7 32 32 0 1 1 +( 648 -1080 48 ) ( 648 -1080 49 ) ( 648.01041666666674 -1080 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -1080 48 ) ( 648.01041666666674 -1080 48 ) ( 648 -1079 48 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -1072 144 ) ( 656 -1071 144 ) ( 656.01041666666663 -1072 144 ) city4_7 63.9141 -32 0 0.0104167 1 +( 656 -1072 144 ) ( 656.01041666666663 -1072 144 ) ( 656 -1072 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -1072 144 ) ( 656 -1072 145 ) ( 656 -1071 144 ) city4_7 32 32 0 1 1 +} +// brush 126 +{ +( 688 -1080 48 ) ( 688 -1079 48 ) ( 688 -1080 49 ) city4_7 32 32 0 1 1 +( 688 -1080 48 ) ( 688 -1080 49 ) ( 688.01041666666674 -1080 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -1080 48 ) ( 688.01041666666674 -1080 48 ) ( 688 -1079 48 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -1072 144 ) ( 696 -1071 144 ) ( 696.01041666666663 -1072 144 ) city4_7 63.9063 -32 0 0.0104167 1 +( 696 -1072 144 ) ( 696.01041666666663 -1072 144 ) ( 696 -1072 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -1072 144 ) ( 696 -1072 145 ) ( 696 -1071 144 ) city4_7 32 32 0 1 1 +} +// brush 127 +{ +( 648 -1040 48 ) ( 648 -1039 48 ) ( 648 -1040 49 ) city4_7 -8 32 0 1 1 +( 648 -1040 48 ) ( 648 -1040 49 ) ( 648.01041666666674 -1040 48 ) city4_7 63.9141 32 0 0.0104167 1 +( 648 -1040 48 ) ( 648.01041666666674 -1040 48 ) ( 648 -1039 48 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -1032 144 ) ( 656 -1031 144 ) ( 656.01041666666663 -1032 144 ) city4_7 63.9141 8 0 0.0104167 1 +( 656 -1032 144 ) ( 656.01041666666663 -1032 144 ) ( 656 -1032 145 ) city4_7 63.9141 32 0 0.0104167 1 +( 656 -1032 144 ) ( 656 -1032 145 ) ( 656 -1031 144 ) city4_7 -8 32 0 1 1 +} +// brush 128 +{ +( 640 -1024 16 ) ( 640 -1024 48 ) ( 640 -1088 48 ) city4_7 0 0 0 1 1 +( 704 -1088 48 ) ( 704 -1088 16 ) ( 640 -1088 16 ) city4_7 0 0 0 1 1 +( 640 -1088 16 ) ( 704 -1088 16 ) ( 704 -1024 16 ) city4_7 0 0 0 1 1 +( 704 -1024 48 ) ( 704 -1088 48 ) ( 640 -1088 48 ) city4_7 0 0 0 1 1 +( 704 -1024 16 ) ( 704 -1024 48 ) ( 640 -1024 48 ) city4_7 0 0 0 1 1 +( 704 -1024 16 ) ( 704 -1088 16 ) ( 704 -1088 48 ) city4_7 0 0 0 1 1 +} +// brush 129 +{ +( 688 -1040 48 ) ( 688 -1039 48 ) ( 688 -1040 49 ) city4_7 -8 32 0 1 1 +( 688 -1040 48 ) ( 688 -1040 49 ) ( 688.01041666666674 -1040 48 ) city4_7 63.9063 32 0 0.0104167 1 +( 688 -1040 48 ) ( 688.01041666666674 -1040 48 ) ( 688 -1039 48 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -1032 144 ) ( 696 -1031 144 ) ( 696.01041666666663 -1032 144 ) city4_7 63.9063 8 0 0.0104167 1 +( 696 -1032 144 ) ( 696.01041666666663 -1032 144 ) ( 696 -1032 145 ) city4_7 63.9063 32 0 0.0104167 1 +( 696 -1032 144 ) ( 696 -1032 145 ) ( 696 -1031 144 ) city4_7 -8 32 0 1 1 +} +// brush 130 +{ +( 448 -1216 16 ) ( 448 -1216 48 ) ( 448 -1280 48 ) city4_7 0 0 0 1 1 +( 512 -1280 48 ) ( 512 -1280 16 ) ( 448 -1280 16 ) city4_7 0 0 0 1 1 +( 448 -1280 16 ) ( 512 -1280 16 ) ( 512 -1216 16 ) city4_7 0 0 0 1 1 +( 512 -1216 48 ) ( 512 -1280 48 ) ( 448 -1280 48 ) city4_7 0 0 0 1 1 +( 512 -1216 16 ) ( 512 -1216 48 ) ( 448 -1216 48 ) city4_7 0 0 0 1 1 +( 512 -1216 16 ) ( 512 -1280 16 ) ( 512 -1280 48 ) city4_7 0 0 0 1 1 +} +// brush 131 +{ +( 448 -1280 48 ) ( 448 -1279 48 ) ( 448 -1280 49 ) city4_7 40 32 0 1 1 +( 448 -1280 48 ) ( 448 -1280 49 ) ( 448.01041666666674 -1280 48 ) city4_7 -0.0625 32 0 0.0104167 1 +( 448 -1280 48 ) ( 448.01041666666674 -1280 48 ) ( 448 -1279 48 ) city4_7 -0.0625 -40 0 0.0104167 1 +( 456 -1272 144 ) ( 456 -1271 144 ) ( 456.01041666666663 -1272 144 ) city4_7 -0.0625 -40 0 0.0104167 1 +( 456 -1272 144 ) ( 456.01041666666663 -1272 144 ) ( 456 -1272 145 ) city4_7 -0.0625 32 0 0.0104167 1 +( 456 -1272 144 ) ( 456 -1272 145 ) ( 456 -1271 144 ) city4_7 40 32 0 1 1 +} +// brush 132 +{ +( 448 -1224 48 ) ( 448 -1223 48 ) ( 448 -1224 49 ) city4_7 48 32 0 1 1 +( 448 -1224 48 ) ( 448 -1224 49 ) ( 448.01041666666674 -1224 48 ) city4_7 -0.0625 32 0 0.0104167 1 +( 448 -1224 48 ) ( 448.01041666666674 -1224 48 ) ( 448 -1223 48 ) city4_7 -0.0625 -48 0 0.0104167 1 +( 456 -1216 144 ) ( 456 -1215 144 ) ( 456.01041666666663 -1216 144 ) city4_7 -0.0625 -48 0 0.0104167 1 +( 456 -1216 144 ) ( 456.01041666666663 -1216 144 ) ( 456 -1216 145 ) city4_7 -0.0625 32 0 0.0104167 1 +( 456 -1216 144 ) ( 456 -1216 145 ) ( 456 -1215 144 ) city4_7 48 32 0 1 1 +} +// brush 133 +{ +( 504 -1224 48 ) ( 504 -1223 48 ) ( 504 -1224 49 ) city4_7 48 32 0 1 1 +( 504 -1224 48 ) ( 504 -1224 49 ) ( 504.01041666666674 -1224 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 -1224 48 ) ( 504.01041666666674 -1224 48 ) ( 504 -1223 48 ) city4_7 -0.0664063 -48 0 0.0104167 1 +( 512 -1216 144 ) ( 512 -1215 144 ) ( 512.01041666666663 -1216 144 ) city4_7 -0.0664063 -48 0 0.0104167 1 +( 512 -1216 144 ) ( 512.01041666666663 -1216 144 ) ( 512 -1216 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 -1216 144 ) ( 512 -1216 145 ) ( 512 -1215 144 ) city4_7 48 32 0 1 1 +} +// brush 134 +{ +( 504 -1280 48 ) ( 504 -1279 48 ) ( 504 -1280 49 ) city4_7 40 32 0 1 1 +( 504 -1280 48 ) ( 504 -1280 49 ) ( 504.01041666666674 -1280 48 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 504 -1280 48 ) ( 504.01041666666674 -1280 48 ) ( 504 -1279 48 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 -1272 144 ) ( 512 -1271 144 ) ( 512.01041666666663 -1272 144 ) city4_7 -0.0664063 -40 0 0.0104167 1 +( 512 -1272 144 ) ( 512.01041666666663 -1272 144 ) ( 512 -1272 145 ) city4_7 -0.0664063 32 0 0.0104167 1 +( 512 -1272 144 ) ( 512 -1272 145 ) ( 512 -1271 144 ) city4_7 40 32 0 1 1 +} +// brush 135 +{ +( 256 -1216 16 ) ( 256 -1216 48 ) ( 256 -1280 48 ) city4_7 0 0 0 1 1 +( 320 -1280 48 ) ( 320 -1280 16 ) ( 256 -1280 16 ) city4_7 0 0 0 1 1 +( 256 -1280 16 ) ( 320 -1280 16 ) ( 320 -1216 16 ) city4_7 0 0 0 1 1 +( 320 -1216 48 ) ( 320 -1280 48 ) ( 256 -1280 48 ) city4_7 0 0 0 1 1 +( 320 -1216 16 ) ( 320 -1216 48 ) ( 256 -1216 48 ) city4_7 0 0 0 1 1 +( 320 -1216 16 ) ( 320 -1280 16 ) ( 320 -1280 48 ) city4_7 0 0 0 1 1 +} +// brush 136 +{ +( 64 -1216 16 ) ( 64 -1216 48 ) ( 64 -1280 48 ) city4_7 0 0 0 1 1 +( 128 -1280 48 ) ( 128 -1280 16 ) ( 64 -1280 16 ) city4_7 0 0 0 1 1 +( 64 -1280 16 ) ( 128 -1280 16 ) ( 128 -1216 16 ) city4_7 0 0 0 1 1 +( 128 -1216 48 ) ( 128 -1280 48 ) ( 64 -1280 48 ) city4_7 0 0 0 1 1 +( 128 -1216 16 ) ( 128 -1216 48 ) ( 64 -1216 48 ) city4_7 0 0 0 1 1 +( 128 -1216 16 ) ( 128 -1280 16 ) ( 128 -1280 48 ) city4_7 0 0 0 1 1 +} +// brush 137 +{ +( 648 -1272 48 ) ( 648 -1271 48 ) ( 648 -1272 49 ) city4_7 32 32 0 1 1 +( 648 -1272 48 ) ( 648 -1272 49 ) ( 648.01041666666674 -1272 48 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 648 -1272 48 ) ( 648.01041666666674 -1272 48 ) ( 648 -1271 48 ) city4_7 -0.0859375 -32 0 0.0104167 1 +( 656 -1264 144 ) ( 656 -1263 144 ) ( 656.01041666666663 -1264 144 ) city4_7 -0.0859375 -32 0 0.0104167 1 +( 656 -1264 144 ) ( 656.01041666666663 -1264 144 ) ( 656 -1264 145 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 656 -1264 144 ) ( 656 -1264 145 ) ( 656 -1263 144 ) city4_7 32 32 0 1 1 +} +// brush 138 +{ +( 688 -1272 48 ) ( 688 -1271 48 ) ( 688 -1272 49 ) city4_7 32 32 0 1 1 +( 688 -1272 48 ) ( 688 -1272 49 ) ( 688.01041666666674 -1272 48 ) city4_7 -0.09375 32 0 0.0104167 1 +( 688 -1272 48 ) ( 688.01041666666674 -1272 48 ) ( 688 -1271 48 ) city4_7 -0.09375 -32 0 0.0104167 1 +( 696 -1264 144 ) ( 696 -1263 144 ) ( 696.01041666666663 -1264 144 ) city4_7 -0.09375 -32 0 0.0104167 1 +( 696 -1264 144 ) ( 696.01041666666663 -1264 144 ) ( 696 -1264 145 ) city4_7 -0.09375 32 0 0.0104167 1 +( 696 -1264 144 ) ( 696 -1264 145 ) ( 696 -1263 144 ) city4_7 32 32 0 1 1 +} +// brush 139 +{ +( 648 -1232 48 ) ( 648 -1231 48 ) ( 648 -1232 49 ) city4_7 -8 32 0 1 1 +( 648 -1232 48 ) ( 648 -1232 49 ) ( 648.01041666666674 -1232 48 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 648 -1232 48 ) ( 648.01041666666674 -1232 48 ) ( 648 -1231 48 ) city4_7 -0.0859375 8 0 0.0104167 1 +( 656 -1224 144 ) ( 656 -1223 144 ) ( 656.01041666666663 -1224 144 ) city4_7 -0.0859375 8 0 0.0104167 1 +( 656 -1224 144 ) ( 656.01041666666663 -1224 144 ) ( 656 -1224 145 ) city4_7 -0.0859375 32 0 0.0104167 1 +( 656 -1224 144 ) ( 656 -1224 145 ) ( 656 -1223 144 ) city4_7 -8 32 0 1 1 +} +// brush 140 +{ +( 640 -1216 16 ) ( 640 -1216 48 ) ( 640 -1280 48 ) city4_7 0 0 0 1 1 +( 704 -1280 48 ) ( 704 -1280 16 ) ( 640 -1280 16 ) city4_7 0 0 0 1 1 +( 640 -1280 16 ) ( 704 -1280 16 ) ( 704 -1216 16 ) city4_7 0 0 0 1 1 +( 704 -1216 48 ) ( 704 -1280 48 ) ( 640 -1280 48 ) city4_7 0 0 0 1 1 +( 704 -1216 16 ) ( 704 -1216 48 ) ( 640 -1216 48 ) city4_7 0 0 0 1 1 +( 704 -1216 16 ) ( 704 -1280 16 ) ( 704 -1280 48 ) city4_7 0 0 0 1 1 +} +// brush 141 +{ +( 688 -1232 48 ) ( 688 -1231 48 ) ( 688 -1232 49 ) city4_7 -8 32 0 1 1 +( 688 -1232 48 ) ( 688 -1232 49 ) ( 688.01041666666674 -1232 48 ) city4_7 -0.09375 32 0 0.0104167 1 +( 688 -1232 48 ) ( 688.01041666666674 -1232 48 ) ( 688 -1231 48 ) city4_7 -0.09375 8 0 0.0104167 1 +( 696 -1224 144 ) ( 696 -1223 144 ) ( 696.01041666666663 -1224 144 ) city4_7 -0.09375 8 0 0.0104167 1 +( 696 -1224 144 ) ( 696.01041666666663 -1224 144 ) ( 696 -1224 145 ) city4_7 -0.09375 32 0 0.0104167 1 +( 696 -1224 144 ) ( 696 -1224 145 ) ( 696 -1223 144 ) city4_7 -8 32 0 1 1 +} +// brush 142 +{ +( 752 -544 200 ) ( 752 -542.88888888888869 200 ) ( 752 -544 201.25 ) city4_7 -38.4 -16 0 1.11111 1.25 +( 752 -544 200 ) ( 752 -544 201.25 ) ( 752.95238095238096 -544 200 ) city4_7 -37.6 -16 0 0.952381 1.25 +( 752 -544 200 ) ( 752.95238095238096 -544 200 ) ( 752 -542.88888888888869 200 ) city4_7 -37.6 38.4 0 0.952381 1.11111 +( 912 -224 240 ) ( 912 -222.88888888888877 240 ) ( 912.95238095238096 -224 240 ) city4_7 -37.6 38.4 0 0.952381 1.11111 +( 912 -224 240 ) ( 912.95238095238096 -224 240 ) ( 912 -224 241.25 ) city4_7 -37.6 -16 0 0.952381 1.25 +( 912 -224 240 ) ( 912 -224 241.25 ) ( 912 -222.88888888888877 240 ) city4_7 -38.4 -16 0 1.11111 1.25 +} +// brush 143 +{ +( 800 -448 16 ) ( 800 -448 48 ) ( 800 -512 48 ) city4_7 0 0 0 1 1 +( 864 -512 48 ) ( 864 -512 16 ) ( 800 -512 16 ) city4_7 -32 0 0 1 1 +( 800 -512 16 ) ( 864 -512 16 ) ( 864 -448 16 ) city4_7 -32 0 0 1 1 +( 864 -448 48 ) ( 864 -512 48 ) ( 800 -512 48 ) city4_7 -32 0 0 1 1 +( 864 -448 16 ) ( 864 -448 48 ) ( 800 -448 48 ) city4_7 -32 0 0 1 1 +( 864 -448 16 ) ( 864 -512 16 ) ( 864 -512 48 ) city4_7 0 0 0 1 1 +} +// brush 144 +{ +( 800 -352 16 ) ( 800 -352 48 ) ( 800 -416 48 ) city4_7 32 0 0 1 1 +( 864 -416 48 ) ( 864 -416 16 ) ( 800 -416 16 ) city4_7 32 0 0 1 1 +( 800 -416 16 ) ( 864 -416 16 ) ( 864 -352 16 ) city4_7 32 -32 0 1 1 +( 864 -352 48 ) ( 864 -416 48 ) ( 800 -416 48 ) city4_7 32 -32 0 1 1 +( 864 -352 16 ) ( 864 -352 48 ) ( 800 -352 48 ) city4_7 32 0 0 1 1 +( 864 -352 16 ) ( 864 -416 16 ) ( 864 -416 48 ) city4_7 32 0 0 1 1 +} +// brush 145 +{ +( 800 -256 16 ) ( 800 -256 48 ) ( 800 -320 48 ) city4_7 0 0 0 1 1 +( 864 -320 48 ) ( 864 -320 16 ) ( 800 -320 16 ) city4_7 32 0 0 1 1 +( 800 -320 16 ) ( 864 -320 16 ) ( 864 -256 16 ) city4_7 32 0 0 1 1 +( 864 -256 48 ) ( 864 -320 48 ) ( 800 -320 48 ) city4_7 32 0 0 1 1 +( 864 -256 16 ) ( 864 -256 48 ) ( 800 -256 48 ) city4_7 32 0 0 1 1 +( 864 -256 16 ) ( 864 -320 16 ) ( 864 -320 48 ) city4_7 0 0 0 1 1 +} +// brush 146 +{ +( 800 -448 240 ) ( 800 -448 272 ) ( 800 -512 272 ) city4_7 0 32 0 1 1 +( 864 -512 272 ) ( 864 -512 240 ) ( 800 -512 240 ) city4_7 32 32 0 1 1 +( 800 -512 240 ) ( 864 -512 240 ) ( 864 -448 240 ) city4_7 32 0 0 1 1 +( 864 -448 272 ) ( 864 -512 272 ) ( 800 -512 272 ) city4_7 32 0 0 1 1 +( 864 -448 240 ) ( 864 -448 272 ) ( 800 -448 272 ) city4_7 32 32 0 1 1 +( 864 -448 240 ) ( 864 -512 240 ) ( 864 -512 272 ) city4_7 0 32 0 1 1 +} +// brush 147 +{ +( 800 -352 240 ) ( 800 -352 272 ) ( 800 -416 272 ) city4_7 32 32 0 1 1 +( 864 -416 272 ) ( 864 -416 240 ) ( 800 -416 240 ) city4_7 32 32 0 1 1 +( 800 -416 240 ) ( 864 -416 240 ) ( 864 -352 240 ) city4_7 32 -32 0 1 1 +( 864 -352 272 ) ( 864 -416 272 ) ( 800 -416 272 ) city4_7 32 -32 0 1 1 +( 864 -352 240 ) ( 864 -352 272 ) ( 800 -352 272 ) city4_7 32 32 0 1 1 +( 864 -352 240 ) ( 864 -416 240 ) ( 864 -416 272 ) city4_7 32 32 0 1 1 +} +// brush 148 +{ +( 800 -256 240 ) ( 800 -256 272 ) ( 800 -320 272 ) city4_7 0 32 0 1 1 +( 864 -320 272 ) ( 864 -320 240 ) ( 800 -320 240 ) city4_7 32 32 0 1 1 +( 800 -320 240 ) ( 864 -320 240 ) ( 864 -256 240 ) city4_7 32 0 0 1 1 +( 864 -256 272 ) ( 864 -320 272 ) ( 800 -320 272 ) city4_7 32 0 0 1 1 +( 864 -256 240 ) ( 864 -256 272 ) ( 800 -256 272 ) city4_7 32 32 0 1 1 +( 864 -256 240 ) ( 864 -320 240 ) ( 864 -320 272 ) city4_7 0 32 0 1 1 +} +// brush 149 +{ +( 752 -544 424 ) ( 752 -542.88888888888869 424 ) ( 752 -544 425 ) city4_7 25.6 56 0 1.11111 1 +( 752 -544 424 ) ( 752 -544 425 ) ( 752.95238095238096 -544 424 ) city4_7 26.4 56 0 0.952381 1 +( 752 -544 424 ) ( 752.95238095238096 -544 424 ) ( 752 -542.88888888888869 424 ) city4_7 26.4 -25.6 0 0.952381 1.11111 +( 912 -224 456 ) ( 912 -222.8888888888888 456 ) ( 912.95238095238096 -224 456 ) city4_7 26.4 -25.6 0 0.952381 1.11111 +( 912 -224 456 ) ( 912.95238095238096 -224 456 ) ( 912 -224 457 ) city4_7 26.4 56 0 0.952381 1 +( 912 -224 456 ) ( 912 -224 457 ) ( 912 -222.8888888888888 456 ) city4_7 25.6 56 0 1.11111 1 +} +// brush 150 +{ +( 1016 -448 16 ) ( 1016 -448 48 ) ( 1016 -512 48 ) city4_7 0 0 0 1 1 +( 1080 -512 48 ) ( 1080 -512 16 ) ( 1016 -512 16 ) city4_7 8 0 0 1 1 +( 1016 -512 16 ) ( 1080 -512 16 ) ( 1080 -448 16 ) city4_7 8 0 0 1 1 +( 1080 -448 48 ) ( 1080 -512 48 ) ( 1016 -512 48 ) city4_7 8 0 0 1 1 +( 1080 -448 16 ) ( 1080 -448 48 ) ( 1016 -448 48 ) city4_7 8 0 0 1 1 +( 1080 -448 16 ) ( 1080 -512 16 ) ( 1080 -512 48 ) city4_7 0 0 0 1 1 +} +// brush 151 +{ +( 1016 -352 16 ) ( 1016 -352 48 ) ( 1016 -416 48 ) city4_7 -32 0 0 1 1 +( 1080 -416 48 ) ( 1080 -416 16 ) ( 1016 -416 16 ) city4_7 8 0 0 1 1 +( 1016 -416 16 ) ( 1080 -416 16 ) ( 1080 -352 16 ) city4_7 8 32 0 1 1 +( 1080 -352 48 ) ( 1080 -416 48 ) ( 1016 -416 48 ) city4_7 8 32 0 1 1 +( 1080 -352 16 ) ( 1080 -352 48 ) ( 1016 -352 48 ) city4_7 8 0 0 1 1 +( 1080 -352 16 ) ( 1080 -416 16 ) ( 1080 -416 48 ) city4_7 -32 0 0 1 1 +} +// brush 152 +{ +( 1016 -256 16 ) ( 1016 -256 48 ) ( 1016 -320 48 ) city4_7 0 0 0 1 1 +( 1080 -320 48 ) ( 1080 -320 16 ) ( 1016 -320 16 ) city4_7 8 0 0 1 1 +( 1016 -320 16 ) ( 1080 -320 16 ) ( 1080 -256 16 ) city4_7 8 0 0 1 1 +( 1080 -256 48 ) ( 1080 -320 48 ) ( 1016 -320 48 ) city4_7 8 0 0 1 1 +( 1080 -256 16 ) ( 1080 -256 48 ) ( 1016 -256 48 ) city4_7 8 0 0 1 1 +( 1080 -256 16 ) ( 1080 -320 16 ) ( 1080 -320 48 ) city4_7 0 0 0 1 1 +} +// brush 153 +{ +( 968 -544 200 ) ( 968 -542.88888888888869 200 ) ( 968 -544 201 ) city4_7 -38.4 -40 0 1.11111 1 +( 968 -544 200 ) ( 968 -544 201 ) ( 968.95238095238096 -544 200 ) city4_7 -8.3999 -40 0 0.952381 1 +( 968 -544 200 ) ( 968.95238095238096 -544 200 ) ( 968 -542.88888888888869 200 ) city4_7 -8.3999 38.4 0 0.952381 1.11111 +( 1128 -224 232 ) ( 1128 -222.8888888888888 232 ) ( 1128.952380952381 -224 232 ) city4_7 -8.3999 38.4 0 0.952381 1.11111 +( 1128 -224 232 ) ( 1128.952380952381 -224 232 ) ( 1128 -224 233 ) city4_7 -8.3999 -40 0 0.952381 1 +( 1128 -224 232 ) ( 1128 -224 233 ) ( 1128 -222.8888888888888 232 ) city4_7 -38.4 -40 0 1.11111 1 +} +// brush 154 +{ +( -648 8376 8416 ) ( -648 -8008 8416 ) ( -648 8376 -7968 ) ground1_6 56 -32 180 1 -1 +( -9288 -456 8416 ) ( 7096 -456 8416 ) ( 7096 -456 -7968 ) ground1_6 -8 32 180 1 1 +( -9288 -8008 -16 ) ( 7096 -8008 -16 ) ( -9288 8376 -16 ) ground1_6 56 -8 270 1 1 +( 7096 -8008 0 ) ( -9288 -8008 0 ) ( -9288 8376 0 ) ground1_6 56 -8 270 1 1 +( 7096 -24 8416 ) ( -9288 -24 8416 ) ( 7096 -24 -7968 ) ground1_6 -8 32 180 1 1 +( -200 -8008 8416 ) ( -200 8376 8416 ) ( -200 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +} +// brush 155 +{ +( -264 8376 8416 ) ( -264 -8008 8416 ) ( -264 8376 -7968 ) uwall1_2 -56 32 0 1 -1 +( 6972 1733 8416 ) ( -8834 -2577 8416 ) ( 6972 1733 -7968 ) uwall1_2 8 -32 0 1 1 +( -9288 -456 8416 ) ( 7096 -456 8416 ) ( 7096 -456 -7968 ) uwall1_2 8 -32 0 1 1 +( -9288 -8008 0 ) ( 7096 -8008 0 ) ( -9288 8376 0 ) uwall1_2 8 56 0 1 1 +( 7096 -8008 368 ) ( -9288 -8008 368 ) ( -9288 8376 368 ) uwall1_2 8 56 0 1 1 +( -200 -8008 8416 ) ( -200 8376 8416 ) ( -200 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +} +// brush 156 +{ +( -264 8376 8416 ) ( -264 -8008 8416 ) ( -264 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +( -9288 -8008 0 ) ( 7096 -8008 0 ) ( -9288 8376 0 ) uwall1_2 56 -8 270 1 1 +( 7096 -8008 368 ) ( -9288 -8008 368 ) ( -9288 8376 368 ) uwall1_2 56 -8 270 1 1 +( -8834 -2577 8416 ) ( 6972 1733 8416 ) ( 6972 1733 -7968 ) uwall1_2 -8 32 180 1 1 +( 4450 -5857 8416 ) ( -6038 6729 8416 ) ( -6038 6729 -7968 ) uwall1_2 56 -32 180 1 -1 +} +// brush 157 +{ +( -264 8376 8416 ) ( -264 -8008 8416 ) ( -264 8376 -7968 ) sky4 -72 -32 180 1 -1 +( -9288 -456 8416 ) ( 7096 -456 8416 ) ( 7096 -456 -7968 ) sky4 -72 32 180 1 1 +( -9288 -8008 368 ) ( 7096 -8008 368 ) ( -9288 8376 368 ) sky4 -72 -72 270 1 1 +( 7096 -8008 432 ) ( -9288 -8008 432 ) ( -9288 8376 432 ) sky4 -72 -72 270 1 1 +( 7096 -24 8416 ) ( -9288 -24 8416 ) ( 7096 -24 -7968 ) sky4 -72 32 180 1 1 +( -200 -8008 8416 ) ( -200 8376 8416 ) ( -200 8376 -7968 ) sky4 -72 -32 180 1 -1 +} +// brush 158 +{ +( -6636 6228 8416 ) ( 4948 -5356 8416 ) ( 4948 -5356 -7968 ) sky4 80 32 0 1 -1 +( -9288 -8008 368 ) ( 7096 -8008 368 ) ( -9288 8376 368 ) sky4 -72 -72 270 1 1 +( 7096 -8008 432 ) ( -9288 -8008 432 ) ( -9288 8376 432 ) sky4 -72 -72 270 1 1 +( 7096 -24 8416 ) ( -9288 -24 8416 ) ( 7096 -24 -7968 ) sky4 -72 32 180 1 1 +( -264 -8008 8416 ) ( -264 8376 8416 ) ( -264 8376 -7968 ) sky4 -72 -32 180 1 -1 +} +// brush 159 +{ +( -304 8376 8416 ) ( -304 -8008 8416 ) ( -304 8376 -7968 ) tech04_3 0 0 180 1 -1 +( -9288 -456 8416 ) ( 7096 -456 8416 ) ( 7096 -456 -7968 ) tech04_3 0 0 180 1 1 +( -9288 -8008 224 ) ( 7096 -8008 224 ) ( -9288 8376 224 ) tech04_3 0 0 270 1 1 +( 7096 -8008 432 ) ( -9288 -8008 432 ) ( -9288 8376 432 ) tech04_3 0 0 270 1 1 +( 4948 -5356 8416 ) ( -6636 6228 8416 ) ( 4948 -5356 -7968 ) uwall1_2 48 -32 180 1 -1 +( -264 -8008 8416 ) ( -264 8376 8416 ) ( -264 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +} +// brush 160 +{ +( -328 8376 8416 ) ( -328 -8008 8416 ) ( -328 8376 -7968 ) tech08_1 56 -32 180 1 -1 +( -7853 4816 8416 ) ( 5779 -4271 8416 ) ( 5779 -4271 -7968 ) tech04_3 0 0 0 1 1 +( -9288 -8008 224 ) ( 7096 -8008 224 ) ( -9288 8376 224 ) uwall1_2 8 56 0 1 1 +( 7096 -8008 368 ) ( -9288 -8008 368 ) ( -9288 8376 368 ) uwall1_2 8 56 0 1 1 +( 7096 -96 8416 ) ( -9288 -96 8416 ) ( 7096 -96 -7968 ) uwall1_2 8 -32 0 1 1 +( 4948 -5356 8416 ) ( -6636 6228 8416 ) ( 4948 -5356 -7968 ) uwall1_2 48 -32 180 1 -1 +( -304 -8008 8416 ) ( -304 8376 8416 ) ( -304 8376 -7968 ) uwall1_2 -56 32 0 1 -1 +} +// brush 161 +{ +( -440 8376 8416 ) ( -440 -8008 8416 ) ( -440 8376 -7968 ) uwall1_2 -56 32 0 1 -1 +( -9288 -56 8416 ) ( 7096 -56 8416 ) ( 7096 -56 -7968 ) uwall1_2 8 -32 0 1 1 +( -9288 -8008 0 ) ( 7096 -8008 0 ) ( -9288 8376 0 ) uwall1_2 8 56 0 1 1 +( 7096 -8008 224 ) ( -9288 -8008 224 ) ( -9288 8376 224 ) uwall1_2 56 -8 270 1 1 +( 7096 -24 8416 ) ( -9288 -24 8416 ) ( 7096 -24 -7968 ) uwall1_2 8 -32 0 1 1 +( 6299 -3341 8416 ) ( -8354 3985 8416 ) ( 6299 -3341 -7968 ) uwall1_2 8 -32 0 1 1 +( -288 -8008 8416 ) ( -288 8376 8416 ) ( -288 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +} +// brush 162 +{ +( -392 8376 8416 ) ( -392 -8008 8416 ) ( -392 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +( -9288 -96 8416 ) ( 7096 -96 8416 ) ( 7096 -96 -7968 ) uwall1_2 -8 32 180 1 1 +( -9288 -8008 0 ) ( 7096 -8008 0 ) ( -9288 8376 0 ) uwall1_2 56 -8 270 1 1 +( 7096 -8008 224 ) ( -9288 -8008 224 ) ( -9288 8376 224 ) uwall1_2 56 -8 270 1 1 +( 7096 -56 8416 ) ( -9288 -56 8416 ) ( 7096 -56 -7968 ) uwall1_2 -8 32 180 1 1 +( -288 -8008 8416 ) ( -288 8376 8416 ) ( -288 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +} +// brush 163 +{ +( -360 8376 8416 ) ( -360 -8008 8416 ) ( -360 8376 -7968 ) uwall1_2 -56 32 0 1 -1 +( 5865 4555 8416 ) ( -7241 -5275 8416 ) ( 5865 4555 -7968 ) uwall1_2 7.99997 -32 0 1 1 +( -9288 -456 8416 ) ( 7096 -456 8416 ) ( 7096 -456 -7968 ) uwall1_2 8 -32 0 1 1 +( -9288 -8008 0 ) ( 7096 -8008 0 ) ( -9288 8376 0 ) uwall1_2 8 56 0 1 1 +( 7096 -8008 224 ) ( -9288 -8008 224 ) ( -9288 8376 224 ) sfloor4_2 56 -8 270 1 1 +( 7096 -96 8416 ) ( -9288 -96 8416 ) ( 7096 -96 -7968 ) uwall1_2 7.99997 -32 0 1 1 +( 4948 -5356 8416 ) ( -6636 6228 8416 ) ( 4948 -5356 -7968 ) uwall1_2 48 -32 180 1 -1 +( -264 -8008 8416 ) ( -264 8376 8416 ) ( -264 8376 -7968 ) uwall1_2 56 -32 180 1 -1 +} +} +// entity 1 +{ +"classname" "info_player_start" +"origin" "-96 -96 104" +"angle" "180" +} +// entity 2 +{ +"classname" "light" +"origin" "0 192 224" +"angle" "0" +"light" "1200" +} +// entity 3 +{ +"classname" "light" +"origin" "192 0 224" +"angle" "0" +"light" "1200" +} +// entity 4 +{ +"classname" "item_artifact_envirosuit" +"origin" "96 -96 104" +} +// entity 5 +{ +"classname" "item_artifact_super_damage" +"origin" "96 96 104" +} +// entity 6 +{ +"classname" "monster_enforcer" +"origin" "288 288 104" +"angle" "90" +} +// entity 7 +{ +"classname" "item_artifact_envirosuit" +"origin" "288 -96 104" +"angle" "90" +} +// entity 8 +{ +"classname" "item_artifact_super_damage" +"origin" "288 96 104" +"angle" "90" +} +// entity 9 +{ +"classname" "monster_enforcer" +"origin" "96 288 104" +"angle" "0" +} +// entity 10 +{ +"classname" "light" +"origin" "192 384 224" +"angle" "0" +"light" "1200" +} +// entity 11 +{ +"classname" "monster_ogre" +"origin" "96 480 104" +} +// entity 12 +{ +"classname" "monster_ogre" +"origin" "288 480 104" +"angle" "90" +} +// entity 13 +{ +"classname" "item_artifact_envirosuit" +"origin" "480 -96 104" +"angle" "90" +} +// entity 14 +{ +"classname" "item_artifact_super_damage" +"origin" "480 96 104" +"angle" "90" +} +// entity 15 +{ +"classname" "monster_enforcer" +"origin" "480 288 104" +"angle" "90" +} +// entity 16 +{ +"classname" "monster_ogre" +"origin" "480 480 104" +"angle" "90" +} +// entity 17 +{ +"classname" "item_artifact_envirosuit" +"origin" "672 -96 104" +"angle" "90" +} +// entity 18 +{ +"classname" "item_artifact_super_damage" +"origin" "672 96 104" +"angle" "90" +} +// entity 19 +{ +"classname" "monster_enforcer" +"origin" "672 288 104" +"angle" "90" +} +// entity 20 +{ +"classname" "monster_ogre" +"origin" "672 480 104" +"angle" "90" +} +// entity 21 +{ +"classname" "item_key2" +"origin" "96 -288 104" +} +// entity 22 +{ +"classname" "item_key2" +"origin" "288 -288 104" +"angle" "90" +} +// entity 23 +{ +"classname" "item_key2" +"origin" "480 -288 104" +"angle" "90" +} +// entity 24 +{ +"classname" "item_key2" +"origin" "672 -288 104" +"angle" "90" +} +// entity 25 +{ +"classname" "item_spikes" +"origin" "848 464 48" +} +// entity 26 +{ +"classname" "item_spikes" +"origin" "848 272 96" +} +// entity 27 +{ +"classname" "item_health" +"origin" "848 80 48" +} +// entity 28 +{ +"classname" "item_health" +"origin" "848 -112 88" +} +// entity 29 +{ +"classname" "item_artifact_super_damage" +"origin" "96 -480 72" +} +// entity 30 +{ +"classname" "item_artifact_envirosuit" +"origin" "96 -672 72" +} +// entity 31 +{ +"classname" "item_artifact_envirosuit" +"origin" "288 -672 72" +} +// entity 32 +{ +"classname" "item_artifact_envirosuit" +"origin" "480 -672 72" +} +// entity 33 +{ +"classname" "item_artifact_envirosuit" +"origin" "672 -672 72" +} +// entity 34 +{ +"classname" "item_artifact_super_damage" +"origin" "288 -480 72" +} +// entity 35 +{ +"classname" "item_artifact_super_damage" +"origin" "480 -480 72" +} +// entity 36 +{ +"classname" "item_artifact_super_damage" +"origin" "672 -480 72" +} +// entity 37 +{ +"classname" "monster_ogre" +"origin" "96 -864 72" +} +// entity 38 +{ +"classname" "monster_enforcer" +"origin" "96 -1056 72" +"angle" "0" +} +// entity 39 +{ +"classname" "monster_ogre" +"origin" "288 -864 72" +} +// entity 40 +{ +"classname" "monster_enforcer" +"origin" "288 -1056 72" +"angle" "0" +} +// entity 41 +{ +"classname" "monster_ogre" +"origin" "480 -864 72" +} +// entity 42 +{ +"classname" "monster_enforcer" +"origin" "480 -1056 72" +"angle" "0" +} +// entity 43 +{ +"classname" "monster_ogre" +"origin" "672 -864 72" +} +// entity 44 +{ +"classname" "monster_enforcer" +"origin" "672 -1056 72" +"angle" "0" +} +// entity 45 +{ +"classname" "item_rockets" +"origin" "80 -1264 48" +} +// entity 46 +{ +"classname" "item_rockets" +"origin" "272 -1264 48" +} +// entity 47 +{ +"classname" "item_rockets" +"origin" "464 -1264 48" +} +// entity 48 +{ +"classname" "item_rockets" +"origin" "656 -1264 48" +} +// entity 49 +{ +"classname" "item_artifact_envirosuit" +"origin" "832 -480 72" +"angle" "0" +} +// entity 50 +{ +"classname" "monster_army" +"origin" "832 -384 72" +} +// entity 51 +{ +"classname" "monster_knight" +"origin" "832 -288 72" +} +// entity 52 +{ +"classname" "item_artifact_envirosuit" +"origin" "832 -480 296" +"angle" "0" +} +// entity 53 +{ +"classname" "monster_army" +"origin" "832 -384 296" +} +// entity 54 +{ +"classname" "monster_knight" +"origin" "832 -288 296" +} +// entity 55 +{ +"classname" "item_artifact_envirosuit" +"origin" "1048 -480 136" +"angle" "0" +} +// entity 56 +{ +"classname" "monster_army" +"origin" "1048 -384 136" +} +// entity 57 +{ +"classname" "monster_knight" +"origin" "1048 -288 136" +} +// entity 58 +{ +"classname" "item_health" +"origin" "-248 -176 0" +} diff --git a/map_src/vrstart-crash.map b/map_src/vrstart-crash.map new file mode 100644 index 00000000..2dd05617 --- /dev/null +++ b/map_src/vrstart-crash.map @@ -0,0 +1,1016 @@ +// Game: Quake +// Format: Standard +// entity 0 +{ +"classname" "worldspawn" +"wad" "C:/OHWorkspace/TrenchBroom/Q.wad" +// brush 0 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 1 +{ +( 32 8992 8384 ) ( 32 -7392 8384 ) ( 32 8992 -8000 ) slipbotsd 0 32 270 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipbotsd 0 -32 270 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) +0slipbot 32 32 0 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) +0slipbot 32 32 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipbotsd 0 -32 270 1 1 +( 96 -7392 8384 ) ( 96 8992 8384 ) ( 96 8992 -8000 ) slipbotsd 0 32 270 1 1 +} +// brush 2 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 3 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 4 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 5 +{ +( 0 384 176 ) ( 0 512 176 ) ( 0 512 240 ) city6_4 32 -28 0 2 4 +( 0 384 176 ) ( 0 384 240 ) ( 128 384 240 ) city6_4 32 -32 0 2 2 +( 128 512 176 ) ( 0 512 176 ) ( 0 384 176 ) city6_4 32 -32 0 2 2 +( 128 384 240 ) ( 0 384 240 ) ( 0 512 240 ) city6_4 32 -32 0 2 2 +( 0 512 240 ) ( 0 512 176 ) ( 128 512 176 ) city6_4 32 -32 0 2 2 +( 128 512 240 ) ( 128 512 176 ) ( 128 384 176 ) city6_4 32 -28 0 2 4 +} +// brush 6 +{ +( -192 192 96 ) ( -192 704 96 ) ( -192 256 176 ) wgrass1_1 21.7358 28.448 0 1 0.835664 +( -192 704 96 ) ( -128 672 208 ) ( -192 256 176 ) wgrass1_1 47.7745 -61.2241 4.39873 0.869227 1.12493 +( -128 672 208 ) ( 192 288 208 ) ( -192 256 176 ) wgrass1_1 58.3448 19.515 4.76366 0.802773 0.98685 +( -192 256 176 ) ( 320 192 96 ) ( -192 192 96 ) wgrass1_1 1.1673 49.3623 4.08562 0.818747 0.883493 +( -192 192 96 ) ( 320 192 96 ) ( 320 704 96 ) wgrass1_1 0 0 0 1 1 +( 320 704 96 ) ( -128 672 208 ) ( -192 704 96 ) wgrass1_1 -29.7428 -54.8004 0 1 1.26543 +( -192 256 176 ) ( 192 288 208 ) ( 320 192 96 ) wgrass1_1 -43.5572 46.5876 4.76366 0.702426 1.01392 +( 256 576 176 ) ( 192 288 208 ) ( -128 672 208 ) wgrass1_1 61.1883 2.5107 358.637 1.07789 0.921205 +( 256 576 176 ) ( -128 672 208 ) ( 320 704 96 ) wgrass1_1 17.4665 -37.6948 345.964 0.824621 -1.36883 +( 320 192 96 ) ( 192 288 208 ) ( 256 576 176 ) wgrass1_1 -2.85219 -38.8333 77.4712 0.827395 1.11266 +( 320 704 96 ) ( 320 192 96 ) ( 256 576 176 ) wgrass1_1 -56.9837 11.5199 353.66 0.812663 0.923053 +} +// brush 7 +{ +( -192 -288 288 ) ( -192 -286 288 ) ( -192 -288 289 ) quakevrlogo 640 64 180 1 -0.5 +( -192 -288 288 ) ( -192 -288 289 ) ( -191 -288 288 ) quakevrlogo 640 64 180 0.5 -0.5 +( -192 -288 288 ) ( -191 -288 288 ) ( -192 -286 288 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 320 -254 544 ) ( 321 -256 544 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 321 -256 544 ) ( 320 -256 545 ) quakevrlogo 640 64 180 0.5 -0.5 +( 320 -256 544 ) ( 320 -256 545 ) ( 320 -254 544 ) quakevrlogo 640 64 180 1 -0.5 +} +// brush 8 +{ +( -448 -288 288 ) ( -448 -286 288 ) ( -448 -288 289 ) city5_4 -10 8 0 8 4 +( -448 -288 288 ) ( -448 -288 289 ) ( -447 -288 288 ) city5_4 20 8 0 4 4 +( -448 -288 288 ) ( -447 -288 288 ) ( -448 -286 288 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -192 -254 544 ) ( -191 -256 544 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -191 -256 544 ) ( -192 -256 545 ) city5_4 20 8 0 4 4 +( -192 -256 544 ) ( -192 -256 545 ) ( -192 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 9 +{ +( 320 -288 288 ) ( 320 -286 288 ) ( 320 -288 289 ) city5_4 -10 8 0 8 4 +( 320 -288 288 ) ( 320 -288 289 ) ( 321 -288 288 ) city5_4 20 8 0 4 4 +( 320 -288 288 ) ( 321 -288 288 ) ( 320 -286 288 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 576 -254 544 ) ( 577 -256 544 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 577 -256 544 ) ( 576 -256 545 ) city5_4 20 8 0 4 4 +( 576 -256 544 ) ( 576 -256 545 ) ( 576 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 10 +{ +( 576 -304 -192 ) ( 576 -303.00339673913044 -192 ) ( 576 -304 -189 ) city6_4 0 -63 0 1 1 +( 576 -304 -192 ) ( 576 -304 -189 ) ( 577 -304 -192 ) city6_4 0 -63 0 1 1 +( 576 -304 -192 ) ( 577 -304 -192 ) ( 576 -303.00339673913044 -192 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -239.22078804347998 576 ) ( 641 -240.21739130434952 576 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 641 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) ( 640 -239.22078804347998 576 ) city6_4 0 -63 0 1 1 +} +// brush 11 +{ +( -512 -304 -192 ) ( -512 -303.00339673913044 -192 ) ( -512 -304 -189 ) city6_4 320 -63 -720 1 1 +( -512 -304 -192 ) ( -512 -304 -189 ) ( -511 -304 -192 ) city6_4 320 -63 -720 1 1 +( -512 -304 -192 ) ( -511 -304 -192 ) ( -512 -303.00339673913044 -192 ) city6_4 320 -63 -720 1 1 +( -448 -240.21739130434949 576 ) ( -448 -239.22078804347996 576 ) ( -447 -240.21739130434949 576 ) city6_4 320 -63 -720 1 1 +( -448 -240.21739130434949 576 ) ( -447 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) city6_4 320 -63 -720 1 1 +( -448 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) ( -448 -239.22078804347996 576 ) city6_4 365.604 -63.7841 -720 0.869554 0.995933 +} +// brush 12 +{ +( -1024 -831.5 704 ) ( -1024 -830.22799545712599 704 ) ( -1024 -831.5 704.5 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1024 -831.5 704.5 ) ( -1023.042253521126 -831.5 704 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1023.042253521126 -831.5 704 ) ( -1024 -830.22799545712599 704 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1409.7720045428748 736 ) ( 1152.9577464788731 1408.5 736 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152.9577464788731 1408.5 736 ) ( 1152 1408.5 736.5 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1408.5 736.5 ) ( 1152 1409.7720045428748 736 ) sky4 0 0 0 1 1 +} +// brush 13 +{ +( -576 -448 -256 ) ( -576 -446.85714285714261 -256 ) ( -576 -448 -255 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -576 -448 -255 ) ( -574.74999999999977 -448 -256 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -574.74999999999977 -448 -256 ) ( -576 -446.85714285714261 -256 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1089.1428571428576 -192 ) ( 705.25000000000034 1088 -192 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 705.25000000000034 1088 -192 ) ( 704 1088 -191 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1088 -191 ) ( 704 1089.1428571428576 -192 ) rock5_2 0 0 0 1 1 +} +// brush 14 +{ +( -576 -448 -192 ) ( -576 -447 -192 ) ( -576 -448 -191 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -576 -448 -191 ) ( -574.74999999999977 -448 -192 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -574.74999999999977 -448 -192 ) ( -576 -447 -192 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1089 96 ) ( 705.25000000000011 1088 96 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 705.25000000000011 1088 96 ) ( 704 1088 97 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1088 97 ) ( 704 1089 96 ) *04awater1 0 0 0 1 1 +} +// brush 15 +{ +( 1152 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) ( 1152 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152.4999999999998 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184.5000000000005 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152 -830.22799545712599 736 ) ( 1152.4999999999998 -831.5 736 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) ( 1184.5000000000005 1408.5 -1440 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 16 +{ +( -1056 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) ( -1056 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1055.5000000000002 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1023.4999999999995 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1056 -830.22799545712599 736 ) ( -1055.5000000000002 -831.5 736 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) ( -1023.4999999999995 1408.5 -1440 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 17 +{ +( -1055.5 1440 736 ) ( -1055.5 1439.5000000000005 736 ) ( -1055.5 1440 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1185.772004542875 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1407.4999999999991 -1440 ) ( 1185.772004542875 1408 -1440 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1054.2279954571259 1440 736 ) ( -1055.5 1439.5000000000005 736 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1055.5 1440 735.04225352112644 ) ( -1054.2279954571259 1440 736 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) ( 1184.5 1407.4999999999991 -1440 ) sky4 0 0 0 1 1 +} +// brush 18 +{ +( -1055.5 -832 736 ) ( -1055.5 -832.49999999999955 736 ) ( -1055.5 -832 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1185.772004542875 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864.50000000000091 -1440 ) ( 1185.772004542875 -864 -1440 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1054.2279954571259 -832 736 ) ( -1055.5 -832.49999999999955 736 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1055.5 -832 735.04225352112644 ) ( -1054.2279954571259 -832 736 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) ( 1184.5 -864.50000000000091 -1440 ) sky4 0 0 0 1 1 +} +// brush 19 +{ +( 216 48 96 ) ( 216 50.5 96 ) ( 216 48 98.5 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 216 48 98.5 ) ( 217 48 96 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 217 48 96 ) ( 216 50.5 96 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 288 90.5 108 ) ( 289 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 289 88 116 ) ( 288 88 118.5 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 288 88 118.5 ) ( 288 90.5 116 ) rock3_7 0 0 0 1 1 +} +// brush 20 +{ +( 216 88 108 ) ( 216 90.5 108 ) ( 216 88 110.5 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 216 88 110.5 ) ( 217 88 108 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 217 88 108 ) ( 216 90.5 108 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 288 130.5 120 ) ( 289 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 289 128 128 ) ( 288 128 130.5 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 288 128 130.5 ) ( 288 130.5 128 ) rock3_7 0 0 0 1 1 +} +// brush 21 +{ +( 216 128 120 ) ( 216 130.5 120 ) ( 216 128 122.5 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 216 128 122.5 ) ( 217 128 120 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 217 128 120 ) ( 216 130.5 120 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 288 170.5 132 ) ( 289 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 289 168 140 ) ( 288 168 142.5 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 288 168 142.5 ) ( 288 170.5 140 ) rock3_7 0 0 0 1 1 +} +// brush 22 +{ +( 216 168 132 ) ( 216 170.5 132 ) ( 216 168 134.5 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 216 168 134.5 ) ( 217 168 132 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 217 168 132 ) ( 216 170.5 132 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 288 210.5 144 ) ( 289 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 289 208 152 ) ( 288 208 154.5 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 288 208 154.5 ) ( 288 210.5 152 ) rock3_7 0 0 0 1 1 +} +// brush 23 +{ +( 216 208 144 ) ( 216 210.5 144 ) ( 216 208 146.5 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 216 208 146.5 ) ( 217 208 144 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 217 208 144 ) ( 216 210.5 144 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 288 250.5 156 ) ( 289 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 289 248 164 ) ( 288 248 166.5 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 288 248 166.5 ) ( 288 250.5 164 ) rock3_7 0 0 0 1 1 +} +// brush 24 +{ +( 216 248 156 ) ( 216 250.50000000000003 156 ) ( 216 248 158.5 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 216 248 158.5 ) ( 217 248 156 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 217 248 156 ) ( 216 250.50000000000003 156 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 288 290.5 168 ) ( 289 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 289 288 176 ) ( 288 288 178.5 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 288 288 178.5 ) ( 288 290.5 176 ) rock3_7 0 0 0 1 1 +} +// brush 25 +{ +( 216 288 168 ) ( 216 290.5 168 ) ( 216 288 170.5 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 216 288 170.5 ) ( 217 288 168 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 217 288 168 ) ( 216 290.5 168 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 288 330.5 180 ) ( 289 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 289 328 188 ) ( 288 328 190.5 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 288 328 190.5 ) ( 288 330.5 188 ) rock3_7 0 0 0 1 1 +} +// brush 26 +{ +( 216 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) ( 216 328 182.22774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 216 328 182.22774480533857 ) ( 217 328 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 217 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 191.72774480533857 ) ( 288 370.5 191.72774480533857 ) ( 289 368 191.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 289 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) ( 288 370.5 199.72774480533857 ) rock3_7 0 0 0 1 1 +} +// brush 27 +{ +( 216 368 191.70557387552577 ) ( 216 370.5 191.70557387552577 ) ( 216 368 194.20557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 191.70557387552577 ) ( 216 368 194.20557387552577 ) ( 217 368 191.70557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 192 ) ( 217 368 192 ) ( 216 370.5 192 ) rock3_7 0 0 0 1 1 +( 288 408 203.70557387552577 ) ( 288 410.5 203.70557387552577 ) ( 289 408 203.70557387552577 ) rock3_7 0 0 0 1 1 +( 288 496 211.70557387552577 ) ( 289 496 211.70557387552577 ) ( 288 496 214.20557387552577 ) rock3_7 0 0 0 1 1 +( 288 408 211.70557387552577 ) ( 288 408 214.20557387552577 ) ( 288 410.5 211.70557387552577 ) rock3_7 0 0 0 1 1 +} +// brush 28 +{ +( 144 368 156.04154748824237 ) ( 144 370.5 156.04154748824237 ) ( 144 368 158.54154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 204.04154748824237 ) ( 216 410.5 204.04154748824237 ) ( 217 408 204.54154748824226 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 144 368 158.54154748824237 ) ( 145 368 156.54154748824226 ) rock3_7 0 0 0 1 1 +( 216 496 212.04154748824237 ) ( 217 496 212.54154748824226 ) ( 216 496 214.54154748824237 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 145 368 156.54154748824226 ) ( 144 370.5 156.04154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 212.04154748824237 ) ( 216 408 214.54154748824237 ) ( 216 410.5 212.04154748824237 ) rock3_7 0 0 0 1 1 +} +// brush 29 +{ +( 280 488 96 ) ( 280 489 96 ) ( 280 488 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 280 488 120.5 ) ( 281 488 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 281 488 96 ) ( 280 489 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 192 ) ( 288 497 192 ) ( 289 496 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 289 496 194 ) ( 288 496 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 288 496 218.5 ) ( 288 497 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 30 +{ +( 280 368 96 ) ( 280 369 96 ) ( 280 368 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 280 368 120.5 ) ( 281 368 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 281 368 96 ) ( 280 369 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 192 ) ( 288 377 192 ) ( 289 376 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 289 376 194 ) ( 288 376 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 288 376 218.5 ) ( 288 377 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 31 +{ +( 280 320 96 ) ( 280 321 96 ) ( 280 320 114 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 280 320 114 ) ( 281 320 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 281 320 96 ) ( 280 321 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 329 168 ) ( 289 328 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 289 328 168 ) ( 288 328 186 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 328 186 ) ( 288 329 168 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 32 +{ +( 280 280 84 ) ( 280 281 84 ) ( 280 280 102 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 84 ) ( 280 280 102 ) ( 281 280 84 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 96 ) ( 281 280 96 ) ( 280 281 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 289 156 ) ( 289 288 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 289 288 156 ) ( 288 288 174 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 288 174 ) ( 288 289 156 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 33 +{ +( 280 240 72 ) ( 280 241 72 ) ( 280 240 90 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 72 ) ( 280 240 90 ) ( 281 240 72 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 96 ) ( 281 240 96 ) ( 280 241 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 249 144 ) ( 289 248 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 289 248 144 ) ( 288 248 162 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 248 162 ) ( 288 249 144 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 34 +{ +( 280 200 60 ) ( 280 201 60 ) ( 280 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 60 ) ( 280 200 78 ) ( 281 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 96 ) ( 281 200 96 ) ( 280 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 209 132 ) ( 289 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 289 208 132 ) ( 288 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 208 150 ) ( 288 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 35 +{ +( 280 160 48 ) ( 280 161 48 ) ( 280 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 48 ) ( 280 160 66 ) ( 281 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 96 ) ( 281 160 96 ) ( 280 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 169 120 ) ( 289 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 289 168 120 ) ( 288 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 168 138 ) ( 288 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 36 +{ +( 280 120 36 ) ( 280 121 36 ) ( 280 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 36 ) ( 280 120 54 ) ( 281 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 96 ) ( 281 120 96 ) ( 280 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 129 108 ) ( 289 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 289 128 108 ) ( 288 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 128 126 ) ( 288 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 37 +{ +( -236 724 96 ) ( -236 34 96 ) ( -236 34 64 ) rock5_2 0 0 0 1 1 +( -236 724 34 ) ( -236 34 64 ) ( 360 34 44 ) rock5_2 0 0 0 1 1 +( -236 34 64 ) ( -236 34 96 ) ( 360 34 96 ) rock5_2 0 0 0 1 1 +( 360 34 96 ) ( -236 34 96 ) ( -236 724 96 ) rock5_2 0 0 0 1 1 +( 360 724 96 ) ( -236 724 96 ) ( -236 724 34 ) rock5_2 0 0 0 1 1 +( 360 724 64 ) ( -236 724 34 ) ( 360 34 44 ) rock5_2 0 0 0 1 1 +( 360 724 64 ) ( 360 34 44 ) ( 360 34 96 ) rock5_2 0 0 0 1 1 +} +// brush 38 +{ +( -236 112 114 ) ( -236 34 96 ) ( -236 303 96 ) rock5_2 16.815 0 0 1.97847 1 +( -226 41 114 ) ( -236 34 96 ) ( -236 112 114 ) rock5_2 19.3038 -0.889084 0 1.80092 1.01176 +( -186 34 114 ) ( -236 34 96 ) ( -226 41 114 ) rock5_2 110.083 -0.0819645 0 0.816327 1.01743 +( -116 34 96 ) ( -236 34 96 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -236 34 96 ) ( -116 34 96 ) rock5_2 0 0 0 1 1 +( -236 112 114 ) ( -186 112 114 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -186 112 114 ) ( -236 112 114 ) rock5_2 -3.95884 3.85601 0 1 -10.668 +( -186 34 114 ) ( -186 112 114 ) ( -116 34 96 ) rock5_2 -9.04656 -65.2849 90 1 3.93803 +( -129 117 96 ) ( -186 112 114 ) ( -236 303 96 ) rock5_2 -43.1704 -70.9503 299.911 4.29162 -3.11322 +( -116 34 96 ) ( -186 112 114 ) ( -129 117 96 ) rock5_2 -9.80276 -60.6771 98.8998 1.05129 3.21752 +} +// brush 39 +{ +( 216 120 36 ) ( 216 121 36 ) ( 216 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 36 ) ( 216 120 54 ) ( 217 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 96 ) ( 217 120 96 ) ( 216 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 129 108 ) ( 225 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 225 128 108 ) ( 224 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 128 126 ) ( 224 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 40 +{ +( 216 160 48 ) ( 216 161 48 ) ( 216 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 48 ) ( 216 160 66 ) ( 217 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 96 ) ( 217 160 96 ) ( 216 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 169 120 ) ( 225 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 225 168 120 ) ( 224 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 168 138 ) ( 224 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 41 +{ +( 216 200 60 ) ( 216 201 60 ) ( 216 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 60 ) ( 216 200 78 ) ( 217 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 96 ) ( 217 200 96 ) ( 216 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 209 132 ) ( 225 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 225 208 132 ) ( 224 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 208 150 ) ( 224 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 42 +{ +( 216 100 108 ) ( 216 88 108 ) ( 216 88 96 ) rock3_7 0 0 0 1 1.11111 +( 216 88 96 ) ( 216 88 108 ) ( 288 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 216 88 108 ) ( 216 100 108 ) rock3_7 0 0 0 1 1 +( 288 100 108 ) ( 216 100 108 ) ( 216 88 96 ) rock3_7 0 -52 0 1 1 +( 288 88 96 ) ( 288 88 108 ) ( 288 100 108 ) rock3_7 0 0 0 1 1.11111 +} +// brush 43 +{ +( 216 140 120 ) ( 216 128 120 ) ( 216 128 108 ) rock3_7 0 0 0 1 1.11111 +( 216 128 108 ) ( 216 128 120 ) ( 288 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 216 128 120 ) ( 216 140 120 ) rock3_7 0 0 0 1 1 +( 288 140 120 ) ( 216 140 120 ) ( 216 128 108 ) rock3_7 0 -52 0 1 1 +( 288 128 108 ) ( 288 128 120 ) ( 288 140 120 ) rock3_7 0 0 0 1 1.11111 +} +// brush 44 +{ +( 216 180 132 ) ( 216 168 132 ) ( 216 168 120 ) rock3_7 0 0 0 1 1.11111 +( 216 168 120 ) ( 216 168 132 ) ( 288 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 216 168 132 ) ( 216 180 132 ) rock3_7 0 0 0 1 1 +( 288 180 132 ) ( 216 180 132 ) ( 216 168 120 ) rock3_7 0 -52 0 1 1 +( 288 168 120 ) ( 288 168 132 ) ( 288 180 132 ) rock3_7 0 0 0 1 1.11111 +} +// brush 45 +{ +( 216 220 144 ) ( 216 208 144 ) ( 216 208 132 ) rock3_7 0 0 0 1 1.11111 +( 216 208 132 ) ( 216 208 144 ) ( 288 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 216 208 144 ) ( 216 220 144 ) rock3_7 0 0 0 1 1 +( 288 220 144 ) ( 216 220 144 ) ( 216 208 132 ) rock3_7 0 -52 0 1 1 +( 288 208 132 ) ( 288 208 144 ) ( 288 220 144 ) rock3_7 0 0 0 1 1.11111 +} +// brush 46 +{ +( 216 260 156 ) ( 216 248 156 ) ( 216 248 144 ) rock3_7 0 0 0 1 1.11111 +( 216 248 144 ) ( 216 248 156 ) ( 288 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 216 248 156 ) ( 216 260 156 ) rock3_7 0 0 0 1 1 +( 288 260 156 ) ( 216 260 156 ) ( 216 248 144 ) rock3_7 0 -52 0 1 1 +( 288 248 144 ) ( 288 248 156 ) ( 288 260 156 ) rock3_7 0 0 0 1 1.11111 +} +// brush 47 +{ +( 216 300 168 ) ( 216 288 168 ) ( 216 288 156 ) rock3_7 0 0 0 1 1.11111 +( 216 288 156 ) ( 216 288 168 ) ( 288 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 216 288 168 ) ( 216 300 168 ) rock3_7 0 0 0 1 1 +( 288 300 168 ) ( 216 300 168 ) ( 216 288 156 ) rock3_7 0 -52 0 1 1 +( 288 288 156 ) ( 288 288 168 ) ( 288 300 168 ) rock3_7 0 0 0 1 1.11111 +} +// brush 48 +{ +( 216 340 180 ) ( 216 328 180 ) ( 216 328 168 ) rock3_7 0 0 0 1 1.11111 +( 216 328 168 ) ( 216 328 180 ) ( 288 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 216 328 180 ) ( 216 340 180 ) rock3_7 0 0 0 1 1 +( 288 340 180 ) ( 216 340 180 ) ( 216 328 168 ) rock3_7 0 -52 0 1 1 +( 288 328 168 ) ( 288 328 180 ) ( 288 340 180 ) rock3_7 0 0 0 1 1.11111 +} +// brush 49 +{ +( 216 380 192 ) ( 216 368 192 ) ( 216 368 180 ) rock3_7 0 0 0 1 1.11111 +( 216 368 180 ) ( 216 368 192 ) ( 288 368 192 ) rock3_7 0 0 0 1 1 +( 288 368 192 ) ( 216 368 192 ) ( 216 380 192 ) rock3_7 0 0 0 1 1 +( 288 380 192 ) ( 216 380 192 ) ( 216 368 180 ) rock3_7 0 -52 0 1 1 +( 288 368 180 ) ( 288 368 192 ) ( 288 380 192 ) rock3_7 0 0 0 1 1.11111 +} +// brush 50 +{ +( 280 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) ( 280 488 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 280 488 228.45753068742539 ) ( 281 488 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 281 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 236 ) ( 288 497 236 ) ( 289 496 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 289 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) ( 288 497 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 51 +{ +( 280 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) ( 280 368 228.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 280 368 228.20557387552628 ) ( 281 368 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 281 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 235.74804318810089 ) ( 288 377 235.74804318810089 ) ( 289 376 235.74804318810089 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 289 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) ( 288 377 301.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 52 +{ +( 280 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) ( 280 430 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 280 430 228.45753068742539 ) ( 281 430 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 281 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 236 ) ( 288 439 236 ) ( 289 438 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 289 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) ( 288 439 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 53 +{ +( 280 429.70557387552628 244 ) ( 280 429.70557387552628 243 ) ( 280 454.20557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 280 368 244 ) ( 281 368 244 ) ( 280 368 243 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 289 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) wood1_1 0 0 270 0.5 0.5 +( 280 429.70557387552628 244 ) ( 280 454.20557387552628 244 ) ( 281 429.70557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 288 496 236 ) ( 288 496 235 ) ( 289 496 236 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) ( 288 527.70557387552628 235 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 54 +{ +( 280 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) ( 280 328 216.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 280 328 216.45753068742539 ) ( 281 328 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 281 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 232 ) ( 288 337 232 ) ( 289 336 232 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 289 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) ( 288 337 289.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 55 +{ +( 280 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) ( 280 288 204.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 280 288 204.45753068742539 ) ( 281 288 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 281 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 220 ) ( 288 297 220 ) ( 289 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 289 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) ( 288 297 277.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 56 +{ +( 280 248 168 ) ( 280 249 168 ) ( 280 248 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 280 248 192.50000000000051 ) ( 281 248 168 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 281 248 168 ) ( 280 249 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 208 ) ( 288 257 208 ) ( 289 256 208 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 289 256 266 ) ( 288 256 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 288 256 290.50000000000051 ) ( 288 257 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 57 +{ +( 280 208 156 ) ( 280 209 156 ) ( 280 208 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 280 208 180.50000000000051 ) ( 281 208 156 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 281 208 156 ) ( 280 209 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 196 ) ( 288 217 196 ) ( 289 216 196 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 289 216 254 ) ( 288 216 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 288 216 278.50000000000051 ) ( 288 217 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 58 +{ +( 280 168 144 ) ( 280 169 144 ) ( 280 168 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 280 168 168.50000000000051 ) ( 281 168 144 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 281 168 144 ) ( 280 169 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 184 ) ( 288 177 184 ) ( 289 176 184 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 289 176 242 ) ( 288 176 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 288 176 266.50000000000051 ) ( 288 177 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 59 +{ +( 280 128 132 ) ( 280 129 132 ) ( 280 128 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 280 128 156.50000000000051 ) ( 281 128 132 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 281 128 132 ) ( 280 129 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 172 ) ( 288 137 172 ) ( 289 136 172 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 289 136 230 ) ( 288 136 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 288 136 254.50000000000051 ) ( 288 137 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 60 +{ +( 280 88 120 ) ( 280 89 120 ) ( 280 88 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 280 88 144.50000000000051 ) ( 281 88 120 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 281 88 120 ) ( 280 89 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 160 ) ( 288 97 160 ) ( 289 96 160 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 289 96 218 ) ( 288 96 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 288 96 242.50000000000051 ) ( 288 97 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 61 +{ +( 280 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) ( 280 48 138.57441256965544 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 280 48 138.57441256965544 ) ( 281 48 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 281 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 148 ) ( 288 57 148 ) ( 289 56 148 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 289 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) ( 288 57 230.42505821634469 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 62 +{ +( 280 56 148 ) ( 280 56 147 ) ( 280 80.500000000000512 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 281 56 148 ) ( 280 56 147 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 280 80.500000000000512 151.05844094111507 ) ( 281 56 148 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 289 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 88.042469312575122 144 ) ( 288 88.042469312575122 143 ) ( 289 88.042469312575122 144 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) ( 288 154 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 63 +{ +( 280 96 160 ) ( 280 96 159 ) ( 280 120.50000000000051 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 281 96 160 ) ( 280 96 159 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 280 120.50000000000051 163.05844094111507 ) ( 281 96 160 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 289 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 128.04246931257512 156 ) ( 288 128.04246931257512 155 ) ( 289 128.04246931257512 156 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) ( 288 194 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 64 +{ +( 280 136 172 ) ( 280 136 171 ) ( 280 160.50000000000051 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 281 136 172 ) ( 280 136 171 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 280 160.50000000000051 175.05844094111507 ) ( 281 136 172 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 289 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 168.04246931257512 168 ) ( 288 168.04246931257512 167 ) ( 289 168.04246931257512 168 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) ( 288 234 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 65 +{ +( 280 176 184 ) ( 280 176 183 ) ( 280 200.50000000000051 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 281 176 184 ) ( 280 176 183 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 280 200.50000000000051 187.05844094111507 ) ( 281 176 184 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 289 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 208.04246931257512 180 ) ( 288 208.04246931257512 179 ) ( 289 208.04246931257512 180 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) ( 288 274 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 66 +{ +( 280 216 196 ) ( 280 216 195 ) ( 280 240.50000000000051 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 281 216 196 ) ( 280 216 195 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 280 240.50000000000051 199.05844094111507 ) ( 281 216 196 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 289 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 248.04246931257512 192 ) ( 288 248.04246931257512 191 ) ( 289 248.04246931257512 192 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) ( 288 314 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 67 +{ +( 280 256 208 ) ( 280 256 207 ) ( 280 280.50000000000051 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 281 256 208 ) ( 280 256 207 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 280 280.50000000000051 211.05844094111507 ) ( 281 256 208 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 289 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 288.04246931257512 204 ) ( 288 288.04246931257512 203 ) ( 289 288.04246931257512 204 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) ( 288 354 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 68 +{ +( 280 296 220 ) ( 280 296 219 ) ( 280 320.50000000000051 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 281 296 220 ) ( 280 296 219 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 280 320.50000000000051 223.05844094111507 ) ( 281 296 220 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 289 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 328.04246931257512 216 ) ( 288 328.04246931257512 215 ) ( 289 328.04246931257512 216 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) ( 288 394 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 69 +{ +( 280 336 232 ) ( 280 336 231 ) ( 280 360.50000000000051 235.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 281 336 232 ) ( 280 336 231 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 280 360.50000000000051 235.05844094111507 ) ( 281 336 232 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 289 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 368.04246931257512 228 ) ( 288 368.04246931257512 227 ) ( 289 368.04246931257512 228 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) ( 288 434 235.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 70 +{ +( 216 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) ( 217 47.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 217 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 148 ) ( 224 56.957530687424878 148 ) ( 225 55.957530687424878 148 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 225 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) ( 224 56.957530687424878 230.42505821634472 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 71 +{ +( 216 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) ( 216 80.45753068742539 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 217 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 216 80.45753068742539 151.05844094111507 ) ( 217 55.957530687424878 148 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 225 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 88 144 ) ( 224 88 143 ) ( 225 88 144 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) ( 224 153.95753068742488 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 72 +{ +( 216 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) ( 217 87.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 217 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 160 ) ( 224 96.957530687424878 160 ) ( 225 95.957530687424878 160 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 225 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) ( 224 96.957530687424878 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 73 +{ +( 216 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) ( 216 120.45753068742539 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 217 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 216 120.45753068742539 163.05844094111507 ) ( 217 95.957530687424878 160 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 225 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 128 156 ) ( 224 128 155 ) ( 225 128 156 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) ( 224 193.95753068742488 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 74 +{ +( 216 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) ( 217 127.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 217 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 172 ) ( 224 136.95753068742488 172 ) ( 225 135.95753068742488 172 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 225 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) ( 224 136.95753068742488 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 75 +{ +( 216 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) ( 216 160.45753068742539 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 217 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 216 160.45753068742539 175.05844094111507 ) ( 217 135.95753068742488 172 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 225 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 168 168 ) ( 224 168 167 ) ( 225 168 168 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) ( 224 233.95753068742488 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 76 +{ +( 216 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) ( 217 167.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 217 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 184 ) ( 224 176.95753068742488 184 ) ( 225 175.95753068742488 184 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 225 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) ( 224 176.95753068742488 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 77 +{ +( 216 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) ( 216 200.45753068742539 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 217 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 216 200.45753068742539 187.05844094111507 ) ( 217 175.95753068742488 184 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 225 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 208 180 ) ( 224 208 179 ) ( 225 208 180 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) ( 224 273.95753068742488 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 78 +{ +( 216 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) ( 217 207.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 217 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 196 ) ( 224 216.95753068742488 196 ) ( 225 215.95753068742488 196 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 225 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) ( 224 216.95753068742488 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 79 +{ +( 216 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) ( 216 240.45753068742539 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 217 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 216 240.45753068742539 199.05844094111507 ) ( 217 215.95753068742488 196 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 225 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 248 192 ) ( 224 248 191 ) ( 225 248 192 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) ( 224 313.95753068742488 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 80 +{ +( 216 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) ( 217 247.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 217 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 208 ) ( 224 256.95753068742488 208 ) ( 225 255.95753068742488 208 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 225 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) ( 224 256.95753068742488 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 81 +{ +( 216 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) ( 216 280.45753068742539 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 217 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 216 280.45753068742539 211.05844094111507 ) ( 217 255.95753068742488 208 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 225 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 288 204 ) ( 224 288 203 ) ( 225 288 204 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) ( 224 353.95753068742488 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 82 +{ +( 216 288 180 ) ( 216 289 180 ) ( 216 288 204.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 216 288 204.50000000000051 ) ( 217 288 180 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 217 288 180 ) ( 216 289 180 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 220 ) ( 224 297 220 ) ( 225 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 225 296 278 ) ( 224 296 302.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 224 296 302.50000000000051 ) ( 224 297 278 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 83 +{ +( 176 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) ( 176 288 216.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 176 288 216.30347303743031 ) ( 177 288 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 177 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 231.8034730374298 ) ( 184 297 231.8034730374298 ) ( 185 296 231.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 185 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) ( 184 297 289.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 84 +{ +( 184 296 216 ) ( 184 296 215 ) ( 184 297 216 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 118.04246931257512 297 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 288 219 ) ( 191.54246931257461 288 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) ( 118.04246931257512 296 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 191.54246931257461 288 223.05844094111507 ) ( 216.04246931257512 289 220 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 289 220 ) ( 216.04246931257512 288 219 ) wood1_1 0 0 270 0.5 0.5 +} +} +// entity 1 +{ +"classname" "info_player_start" +"origin" "64 448 280" +"angle" "270" +} +// entity 2 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "Slipgate" +"_tb_id" "239" +} +// entity 3 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "QuakeVRBillboard" +"_tb_id" "240" +} +// entity 4 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "BigSlipgate" +"_tb_id" "241" +// brush 0 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 1 +{ +( -492 10084 8671.7307831234339 ) ( -492 -6300 8671.7307831234339 ) ( -492 10084 -7712.2692168765661 ) +0slip 0 -24 180 1 1 +( -8652 516 8671.7307831234339 ) ( 6768.2352941176468 516 8671.7307831234339 ) ( 6768.2352941176468 516 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -8652 -6300 199.73078312343421 ) ( 6768.2352941176468 -6300 199.73078312343421 ) ( -8652 10084 199.73078312343421 ) +0slip 0 -24 90 1 1 +( 6768.2352941176468 -6300 391.73078312343421 ) ( -8652 -6300 391.73078312343421 ) ( -8652 10084 391.73078312343421 ) +0slip 32 0 0 1 1 +( 6768.2352941176468 644 8671.7307831234339 ) ( -8652 644 8671.7307831234339 ) ( 6768.2352941176468 644 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -460 -6300 8671.7307831234339 ) ( -460 10084 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slip1 32 -88 0 1 1 +} +// brush 2 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 3 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 14 10 180 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 4 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 5 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 14 10 180 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 6 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +( -9164 548 8671.7307831234339 ) ( 7220 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipbotsd -82 24 180 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) +0slipbot -82 24 0 1 1 +( 7220 612 8671.7307831234339 ) ( -9164 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +} +// brush 7 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 8 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 9 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +( -9164 548 8671.7307831234339 ) ( 7220 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) +0sliptop 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) sliptopsd 0 0 90 1 1 +( 7220 612 8671.7307831234339 ) ( -9164 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +} +// brush 10 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 11 +{ +( -512 384 152 ) ( -512 385.0526315789474 152 ) ( -512 384 152.16666666666666 ) rock3_7 0 0 0 1 1 +( -512 144 152 ) ( -512 144 152.16666666666666 ) ( -511 144 152 ) rock3_7 0 0 0 1 1 +( -512 384 152 ) ( -511 384 152 ) ( -512 385.0526315789474 152 ) rock3_7 0 0 0 1 1 +( -320 704 200 ) ( -320 705.05263157894728 200 ) ( -319 704 200 ) rock3_7 0 0 0 1 1 +( -320 704 200 ) ( -319 704 200 ) ( -320 704 200.16666666666666 ) rock3_7 0 0 0 1 1 +( -272 704 200 ) ( -272 704 200.16666666666666 ) ( -272 705.05263157894728 200 ) rock3_7 0 0 0 1 1 +} +// brush 12 +{ +( -500 8580 8472 ) ( -500 -7804 8472 ) ( -500 8580 -7912 ) tech10_1 208 0 0 1 1 +( -11332 404 8472 ) ( 5052 404 8472 ) ( 5052 404 -7912 ) tech10_1 208 0 0 1 1 +( -11332 -7804 200 ) ( 5052 -7804 200 ) ( -11332 8580 200 ) tech10_1 208 0 0 1 1 +( 5052 -7804 280 ) ( -11332 -7804 280 ) ( -11332 8580 280 ) tech10_1 208 0 0 1 1 +( 5052 468 8472 ) ( -11332 468 8472 ) ( 5052 468 -7912 ) tech10_1 208 0 0 1 1 +( -484 -7804 8472 ) ( -484 8580 8472 ) ( -484 8580 -7912 ) tech10_1 208 0 0 1 1 +} +} +// entity 5 +{ +"classname" "trigger_changelevel" +"map" "start" +"_tb_layer" "241" +// brush 0 +{ +( -452 10084 8671.7307831234339 ) ( -452 -6300 8671.7307831234339 ) ( -452 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 556 8671.7307831234339 ) ( 7220 556 8671.7307831234339 ) ( 7220 556 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) trigger 0 0 0 1 1 +( 7220 -6300 351.73078312343421 ) ( -9164 -6300 351.73078312343421 ) ( -9164 10084 351.73078312343421 ) trigger 0 0 0 1 1 +( 7220 604 8671.7307831234339 ) ( -9164 604 8671.7307831234339 ) ( 7220 604 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -404 -6300 8671.7307831234339 ) ( -404 10084 8671.7307831234339 ) ( -404 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +} +} +// entity 6 +{ +"spawnflags" "1792" +"classname" "func_wall" +"_tb_layer" "241" +// brush 0 +{ +( -380 10084 8671.7307831234339 ) ( -380 -6300 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 564 8671.7307831234339 ) ( 7220 564 8671.7307831234339 ) ( 7220 564 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 596 8671.7307831234339 ) ( -9164 596 8671.7307831234339 ) ( 7220 596 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -372 -6300 8671.7307831234339 ) ( -372 10084 8671.7307831234339 ) ( -372 10084 -7712.2692168765661 ) z_exit 22 6 180 -1 -1 +} +} +// entity 7 +{ +"spawnflags" "1792" +"classname" "func_wall" +"_tb_layer" "241" +// brush 0 +{ +( -396 10084 8671.7307831234339 ) ( -396 -6300 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -380 -6300 8671.7307831234339 ) ( -380 10084 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 1 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 532 8671.7307831234339 ) ( -9164 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 2 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 628 8671.7307831234339 ) ( 7220 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 0 0 1 1 +} +} +// entity 8 +{ +"classname" "func_button" +"angle" "180" +"speed" "50" +"target" "testtarget" +"sounds" "1" +"wait" "-1" +"lip" "4" +"_tb_layer" "241" +// brush 0 +{ +( -484 8580 8472 ) ( -484 -7804 8472 ) ( -484 8580 -7912 ) door02_1 -4 8 0 1 1 +( -11332 420 8472 ) ( 5052 420 8472 ) ( 5052 420 -7912 ) door02_1 -4 8 0 1 1 +( -11332 -7804 232 ) ( 5052 -7804 232 ) ( -11332 8580 232 ) door02_1 -4 8 0 1 1 +( 5052 -7804 264 ) ( -11332 -7804 264 ) ( -11332 8580 264 ) door02_1 -4 8 0 1 1 +( 5052 452 8472 ) ( -11332 452 8472 ) ( 5052 452 -7912 ) door02_1 -4 8 0 1 1 +( -476 -7804 8472 ) ( -476 8580 8472 ) ( -476 8580 -7912 ) +0basebtn -4 8 0 1 1 +} +} +// entity 9 +{ +"classname" "trigger_testvr" +"targetname" "testtarget" +"_tb_layer" "241" +// brush 0 +{ +( -484 348 316 ) ( -484 349 316 ) ( -484 348 317 ) rock3_7 0 0 0 1 1 +( -484 348 316 ) ( -484 348 317 ) ( -483 348 316 ) rock3_7 0 0 0 1 1 +( -484 348 316 ) ( -483 348 316 ) ( -484 349 316 ) rock3_7 0 0 0 1 1 +( -460 360 320 ) ( -460 361 320 ) ( -459 360 320 ) rock3_7 0 0 0 1 1 +( -460 360 320 ) ( -459 360 320 ) ( -460 360 321 ) rock3_7 0 0 0 1 1 +( -460 360 320 ) ( -460 360 321 ) ( -460 361 320 ) rock3_7 0 0 0 1 1 +} +} diff --git a/map_src/vrstart-crash.txt b/map_src/vrstart-crash.txt new file mode 100644 index 00000000..ba3fd0e8 --- /dev/null +++ b/map_src/vrstart-crash.txt @@ -0,0 +1,156 @@ +OS: Windows 10 (10.0) +Qt: 5.12.8 +GL_VENDOR: NVIDIA Corporation +GL_RENDERER: GeForce RTX 2080 Ti/PCIe/SSE2 +GL_VERSION: 4.6.0 NVIDIA 445.87 +TrenchBroom Version: 2020.1 +TrenchBroom Build: v2020.1-RC2 Release +Reason: TrenchBroomUnhandledExceptionFilter +Stack trace: +SymInit: Symbol-SearchPath: '.;C:\OHWorkspace\TrenchBroom;C:\OHWorkspace\TrenchBroom;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'vittorio' +OS-Version: 6.2.9200 () 0x100-0x1 +C:\OHWorkspace\TrenchBroom\TrenchBroom.exe:TrenchBroom.exe (00D00000), size: 6148096 (result: 0), SymType: 'PDB', PDB: '.\TrenchBroom-stripped.pdb', fileVersion: 2020.1.0.0 +C:\Windows\SYSTEM32\ntdll.dll:ntdll.dll (77520000), size: 1679360 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\ntdll.dll', fileVersion: 6.2.18362.815 +C:\Windows\System32\KERNEL32.DLL:KERNEL32.DLL (76D30000), size: 917504 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\KERNEL32.DLL', fileVersion: 6.2.18362.778 +C:\Windows\System32\KERNELBASE.dll:KERNELBASE.dll (756B0000), size: 2088960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\KERNELBASE.dll', fileVersion: 6.2.18362.815 +C:\Windows\System32\ADVAPI32.dll:ADVAPI32.dll (770B0000), size: 495616 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ADVAPI32.dll', fileVersion: 6.2.18362.752 +C:\Windows\System32\msvcrt.dll:msvcrt.dll (77130000), size: 782336 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\msvcrt.dll', fileVersion: 7.0.18362.1 +C:\Windows\System32\sechost.dll:sechost.dll (75EE0000), size: 483328 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\sechost.dll', fileVersion: 6.2.18362.693 +C:\Windows\SYSTEM32\OPENGL32.dll:OPENGL32.dll (6BCC0000), size: 1044480 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\OPENGL32.dll', fileVersion: 6.2.18362.387 +C:\Windows\System32\RPCRT4.dll:RPCRT4.dll (755F0000), size: 765952 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\RPCRT4.dll', fileVersion: 6.2.18362.628 +C:\Windows\System32\USER32.dll:USER32.dll (75F70000), size: 1667072 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\USER32.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\SspiCli.dll:SspiCli.dll (74CF0000), size: 131072 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\SspiCli.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\CRYPTBASE.dll:CRYPTBASE.dll (74CE0000), size: 40960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\CRYPTBASE.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\win32u.dll:win32u.dll (77090000), size: 94208 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\win32u.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (77440000), size: 389120 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\bcryptPrimitives.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\GDI32.dll:GDI32.dll (753C0000), size: 135168 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\GDI32.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\ucrtbase.dll:ucrtbase.dll (768F0000), size: 1175552 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ucrtbase.dll', fileVersion: 6.2.18362.815 +C:\Windows\System32\gdi32full.dll:gdi32full.dll (76BD0000), size: 1417216 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\gdi32full.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\SHELL32.dll:SHELL32.dll (758D0000), size: 5726208 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\SHELL32.dll', fileVersion: 6.2.18362.815 +C:\Windows\System32\msvcp_win.dll:msvcp_win.dll (76240000), size: 507904 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\msvcp_win.dll', fileVersion: 6.2.18362.815 +C:\Windows\System32\cfgmgr32.dll:cfgmgr32.dll (76190000), size: 241664 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\cfgmgr32.dll', fileVersion: 6.2.18362.387 +C:\Windows\System32\combase.dll:combase.dll (76E10000), size: 2576384 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\combase.dll', fileVersion: 6.2.18362.815 +C:\Windows\System32\shcore.dll:shcore.dll (75E50000), size: 540672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\shcore.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\windows.storage.dll:windows.storage.dll (74D20000), size: 6049792 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\windows.storage.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\profapi.dll:profapi.dll (753A0000), size: 110592 (result: 0), SymType: '-nosymbols-', PDB: 'C:\Windows\System32\profapi.dll', fileVersion: 6.2.18362.693 +C:\Windows\System32\powrprof.dll:powrprof.dll (75350000), size: 274432 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\powrprof.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\UMPDC.dll:UMPDC.dll (763F0000), size: 53248 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\UMPDC.dll' +C:\Windows\System32\shlwapi.dll:shlwapi.dll (77240000), size: 278528 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\shlwapi.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\kernel.appcore.dll:kernel.appcore.dll (763E0000), size: 61440 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\kernel.appcore.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\cryptsp.dll:cryptsp.dll (774F0000), size: 77824 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\cryptsp.dll', fileVersion: 6.2.18362.1 +C:\OHWorkspace\TrenchBroom\freetype6.dll:freetype6.dll (6B400000), size: 544768 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\freetype6.dll', fileVersion: 2.3.5.2742 +C:\OHWorkspace\TrenchBroom\FreeImage.dll:FreeImage.dll (10000000), size: 2809856 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\FreeImage.dll', fileVersion: 3.15.4.0 +C:\Windows\System32\WS2_32.dll:WS2_32.dll (76A10000), size: 385024 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\WS2_32.dll', fileVersion: 6.2.18362.387 +C:\Windows\SYSTEM32\MSVCP140.dll:MSVCP140.dll (6FD50000), size: 458752 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\MSVCP140.dll', fileVersion: 14.25.28508.3 +C:\Windows\SYSTEM32\VERSION.dll:VERSION.dll (747C0000), size: 32768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\VERSION.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\VCRUNTIME140.dll:VCRUNTIME140.dll (6FDC0000), size: 81920 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\VCRUNTIME140.dll', fileVersion: 14.25.28508.3 +C:\Windows\SYSTEM32\GLU32.dll:GLU32.dll (6BC80000), size: 258048 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\GLU32.dll', fileVersion: 6.2.18362.387 +C:\OHWorkspace\TrenchBroom\zlib1.dll:zlib1.dll (62E80000), size: 98304 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\zlib1.dll', fileVersion: 1.2.3.2532 +C:\Windows\SYSTEM32\dxcore.dll:dxcore.dll (71250000), size: 102400 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\dxcore.dll', fileVersion: 6.2.18362.1 +C:\OHWorkspace\TrenchBroom\Qt5Widgets.dll:Qt5Widgets.dll (79490000), size: 4558848 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\Qt5Widgets.dll', fileVersion: 5.12.8.0 +C:\OHWorkspace\TrenchBroom\Qt5Core.dll:Qt5Core.dll (78940000), size: 5152768 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\Qt5Core.dll', fileVersion: 5.12.8.0 +C:\Windows\SYSTEM32\UxTheme.dll:UxTheme.dll (70F90000), size: 499712 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\UxTheme.dll', fileVersion: 6.2.18362.449 +C:\Windows\SYSTEM32\dwmapi.dll:dwmapi.dll (70C80000), size: 151552 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\dwmapi.dll', fileVersion: 6.2.18362.267 +C:\Windows\System32\ole32.dll:ole32.dll (77340000), size: 1011712 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ole32.dll', fileVersion: 6.2.18362.693 +C:\Windows\SYSTEM32\MPR.dll:MPR.dll (71A30000), size: 98304 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\MPR.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\NETAPI32.dll:NETAPI32.dll (74C60000), size: 77824 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\NETAPI32.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\USERENV.dll:USERENV.dll (747D0000), size: 122880 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\USERENV.dll', fileVersion: 6.2.18362.387 +C:\Windows\SYSTEM32\WINMM.dll:WINMM.dll (71EB0000), size: 147456 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\WINMM.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\winmmbase.dll:winmmbase.dll (71370000), size: 143360 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\winmmbase.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\SRVCLI.DLL:SRVCLI.DLL (66590000), size: 114688 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\SRVCLI.DLL', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\NETUTILS.DLL:NETUTILS.DLL (747B0000), size: 45056 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\NETUTILS.DLL', fileVersion: 6.2.18362.1 +C:\OHWorkspace\TrenchBroom\Qt5Gui.dll:Qt5Gui.dll (78F60000), size: 5419008 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\Qt5Gui.dll', fileVersion: 5.12.8.0 +C:\Windows\System32\IMM32.DLL:IMM32.DLL (77210000), size: 151552 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\IMM32.DLL', fileVersion: 6.2.18362.387 +C:\OHWorkspace\TrenchBroom\platforms\qwindows.dll:qwindows.dll (78E30000), size: 1241088 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\platforms\qwindows.dll', fileVersion: 5.12.8.0 +C:\Windows\System32\OLEAUT32.dll:OLEAUT32.dll (76850000), size: 598016 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\OLEAUT32.dll', fileVersion: 6.2.18362.836 +C:\Windows\SYSTEM32\WTSAPI32.dll:WTSAPI32.dll (71A20000), size: 61440 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\WTSAPI32.dll', fileVersion: 6.2.18362.1 +C:\Windows\system32\d3d9.dll:d3d9.dll (66B90000), size: 1630208 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\d3d9.dll', fileVersion: 6.2.18362.387 +C:\Windows\System32\crypt32.dll:crypt32.dll (76A70000), size: 1028096 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\crypt32.dll', fileVersion: 6.2.18362.592 +C:\Windows\System32\MSASN1.dll:MSASN1.dll (761D0000), size: 57344 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\MSASN1.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\cryptnet.dll:cryptnet.dll (70710000), size: 155648 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\cryptnet.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\WINTRUST.DLL:WINTRUST.DLL (774A0000), size: 286720 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\WINTRUST.DLL', fileVersion: 6.2.18362.387 +C:\Windows\System32\imagehlp.dll:imagehlp.dll (758B0000), size: 110592 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\imagehlp.dll', fileVersion: 6.2.18362.1 +C:\Windows\system32\rsaenh.dll:rsaenh.dll (73C80000), size: 192512 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\rsaenh.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\bcrypt.dll:bcrypt.dll (771F0000), size: 102400 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\bcrypt.dll', fileVersion: 6.2.18362.267 +C:\Windows\System32\MSCTF.dll:MSCTF.dll (762D0000), size: 1060864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\MSCTF.dll', fileVersion: 6.2.18362.752 +C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_95bdb3a23d6478de\nvoglv32.dll:nvoglv32.dll (52600000), size: 30617600 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_95bdb3a23d6478de\nvoglv32.dll', fileVersion: 26.21.14.4587 +C:\Windows\System32\SETUPAPI.dll:SETUPAPI.dll (76400000), size: 4493312 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\SETUPAPI.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\DEVOBJ.dll:DEVOBJ.dll (738A0000), size: 143360 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\DEVOBJ.dll', fileVersion: 6.2.18362.387 +C:\Windows\SYSTEM32\ntmarta.dll:ntmarta.dll (73DC0000), size: 167936 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\ntmarta.dll', fileVersion: 6.2.18362.1 +C:\Windows\system32\nvspcap.dll:nvspcap.dll (77BD0000), size: 2191360 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\nvspcap.dll', fileVersion: 3.20.3.63 +C:\Windows\SYSTEM32\WINSTA.dll:WINSTA.dll (69540000), size: 278528 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\WINSTA.dll', fileVersion: 6.2.18362.836 +C:\OHWorkspace\TrenchBroom\styles\qwindowsvistastyle.dll:qwindowsvistastyle.dll (7C790000), size: 143360 (result: 0), SymType: '-exported-', PDB: 'C:\OHWorkspace\TrenchBroom\styles\qwindowsvistastyle.dll', fileVersion: 5.12.8.0 +C:\Windows\system32\dwrite.dll:dwrite.dll (0FB00000), size: 2621440 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dwrite.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\clbcatq.dll:clbcatq.dll (76110000), size: 524288 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\clbcatq.dll', fileVersion: 2001.12.10941.16384 +C:\Windows\system32\dataexchange.dll:dataexchange.dll (6BA00000), size: 200704 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dataexchange.dll', fileVersion: 6.2.18362.836 +C:\Windows\system32\d3d11.dll:d3d11.dll (6B820000), size: 1957888 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\d3d11.dll', fileVersion: 6.2.18362.387 +C:\Windows\system32\dcomp.dll:dcomp.dll (6B6B0000), size: 1482752 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dcomp.dll', fileVersion: 6.2.18362.836 +C:\Windows\system32\dxgi.dll:dxgi.dll (70EC0000), size: 790528 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dxgi.dll', fileVersion: 6.2.18362.815 +C:\Windows\system32\twinapi.appcore.dll:twinapi.appcore.dll (6B4C0000), size: 1986560 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\twinapi.appcore.dll', fileVersion: 6.2.18362.836 +C:\Windows\system32\RMCLIENT.dll:RMCLIENT.dll (6B4A0000), size: 126976 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\RMCLIENT.dll', fileVersion: 6.2.18362.267 +C:\Windows\System32\TextInputFramework.dll:TextInputFramework.dll (69800000), size: 540672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\TextInputFramework.dll', fileVersion: 6.2.18362.207 +C:\Windows\System32\CoreUIComponents.dll:CoreUIComponents.dll (6ECC0000), size: 2482176 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\CoreUIComponents.dll', fileVersion: 6.2.18362.207 +C:\Windows\System32\CoreMessaging.dll:CoreMessaging.dll (6EF20000), size: 561152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\CoreMessaging.dll', fileVersion: 6.2.18362.836 +C:\Windows\SYSTEM32\wintypes.dll:wintypes.dll (6EFB0000), size: 892928 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\wintypes.dll', fileVersion: 6.2.18362.836 +C:\Windows\System32\iertutil.dll:iertutil.dll (66FD0000), size: 2265088 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\iertutil.dll', fileVersion: 11.0.18362.815 +C:\Windows\SYSTEM32\edputil.dll:edputil.dll (680B0000), size: 110592 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\edputil.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\comdlg32.dll:comdlg32.dll (77290000), size: 720896 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\comdlg32.dll', fileVersion: 6.2.18362.815 +C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.18362.836_none_71d337c15ae77c22\COMCTL32.dll:COMCTL32.dll (6B0E0000), size: 577536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.18362.836_none_71d337c15ae77c22\COMCTL32.dll', fileVersion: 5.82.18362.836 +C:\Windows\system32\propsys.dll:propsys.dll (718D0000), size: 811008 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\propsys.dll', fileVersion: 7.0.18362.815 +C:\Windows\System32\DUI70.dll:DUI70.dll (79910000), size: 1470464 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\DUI70.dll', fileVersion: 6.2.18362.1 +C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.836_none_2e71f01a278b41f3\Comctl32.dll:Comctl32.dll (71040000), size: 2158592 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.836_none_2e71f01a278b41f3\Comctl32.dll', fileVersion: 6.10.18362.836 +C:\Windows\System32\DUser.dll:DUser.dll (79A80000), size: 487424 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\DUser.dll', fileVersion: 6.2.18362.1 +C:\Windows\system32\explorerframe.dll:explorerframe.dll (67200000), size: 1585152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\explorerframe.dll', fileVersion: 6.2.18362.418 +C:\Windows\SYSTEM32\WindowsCodecs.dll:WindowsCodecs.dll (6ABA0000), size: 1478656 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\WindowsCodecs.dll', fileVersion: 6.2.18362.778 +C:\Windows\System32\thumbcache.dll:thumbcache.dll (79B00000), size: 303104 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\thumbcache.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\policymanager.dll:policymanager.dll (664F0000), size: 471040 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\policymanager.dll', fileVersion: 6.2.18362.815 +C:\Windows\SYSTEM32\msvcp110_win.dll:msvcp110_win.dll (66480000), size: 413696 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\msvcp110_win.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\Windows.UI.FileExplorer.dll:Windows.UI.FileExplorer.dll (79B50000), size: 512000 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\Windows.UI.FileExplorer.dll', fileVersion: 6.2.18362.657 +C:\Windows\System32\OLEACC.dll:OLEACC.dll (6E0D0000), size: 339968 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\OLEACC.dll', fileVersion: 7.2.18362.1 +C:\Windows\SYSTEM32\ntshrui.dll:ntshrui.dll (665B0000), size: 401408 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\ntshrui.dll', fileVersion: 6.2.18362.752 +C:\Windows\SYSTEM32\cscapi.dll:cscapi.dll (71030000), size: 57344 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\cscapi.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\StructuredQuery.dll:StructuredQuery.dll (79BD0000), size: 544768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\StructuredQuery.dll', fileVersion: 7.0.18362.657 +C:\Windows\SYSTEM32\atlthunk.dll:atlthunk.dll (713A0000), size: 53248 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\atlthunk.dll', fileVersion: 6.2.18362.1 +C:\Windows\system32\Windows.Storage.Search.dll:Windows.Storage.Search.dll (79C60000), size: 643072 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\Windows.Storage.Search.dll', fileVersion: 6.2.18362.387 +C:\Windows\System32\Windows.StateRepositoryPS.dll:Windows.StateRepositoryPS.dll (7BE70000), size: 569344 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\Windows.StateRepositoryPS.dll', fileVersion: 6.2.18362.836 +C:\Windows\SYSTEM32\samcli.dll:samcli.dll (776E0000), size: 86016 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\samcli.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\SAMLIB.dll:SAMLIB.dll (79D00000), size: 102400 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\SAMLIB.dll', fileVersion: 6.2.18362.1 +C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll:tiptsf.dll (72190000), size: 532480 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\CLDAPI.dll:CLDAPI.dll (69160000), size: 110592 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\CLDAPI.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\FLTLIB.DLL:FLTLIB.DLL (69150000), size: 32768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\FLTLIB.DLL', fileVersion: 6.2.18362.1 +C:\Windows\System32\coml2.dll:coml2.dll (76B70000), size: 385024 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\coml2.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\drprov.dll:drprov.dll (50690000), size: 36864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\drprov.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\ntlanman.dll:ntlanman.dll (7C700000), size: 73728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ntlanman.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\davclnt.dll:davclnt.dll (7C720000), size: 102400 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\davclnt.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\DAVHLPR.dll:DAVHLPR.dll (7C740000), size: 40960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\DAVHLPR.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\wkscli.dll:wkscli.dll (5D610000), size: 65536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\wkscli.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\LINKINFO.dll:LINKINFO.dll (666E0000), size: 45056 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\LINKINFO.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\twinapi.dll:twinapi.dll (698D0000), size: 532480 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\twinapi.dll', fileVersion: 6.2.18362.836 +C:\Windows\SYSTEM32\apphelp.dll:apphelp.dll (72340000), size: 651264 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\apphelp.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\dlnashext.dll:dlnashext.dll (79D20000), size: 274432 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\dlnashext.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\PlayToDevice.dll:PlayToDevice.dll (79D70000), size: 299008 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\PlayToDevice.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\DevDispItemProvider.dll:DevDispItemProvider.dll (79DC0000), size: 110592 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\DevDispItemProvider.dll', fileVersion: 6.2.18362.1 +C:\Windows\system32\NetworkExplorer.dll:NetworkExplorer.dll (79DE0000), size: 77824 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\NetworkExplorer.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\MMDevApi.dll:MMDevApi.dll (69BD0000), size: 401408 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\MMDevApi.dll', fileVersion: 6.2.18362.387 +C:\Windows\System32\urlmon.dll:urlmon.dll (67390000), size: 1744896 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\urlmon.dll', fileVersion: 11.0.18362.815 +C:\Windows\System32\PortableDeviceApi.dll:PortableDeviceApi.dll (79EB0000), size: 536576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\PortableDeviceApi.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\PortableDeviceTypes.dll:PortableDeviceTypes.dll (79F40000), size: 159744 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\PortableDeviceTypes.dll', fileVersion: 6.2.18362.1 +C:\Program Files (x86)\Common Files\TortoiseOverlays\TortoiseOverlays.dll:TortoiseOverlays.dll (7A200000), size: 106496 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files (x86)\Common Files\TortoiseOverlays\TortoiseOverlays.dll', fileVersion: 1.1.4.26626 +C:\Program Files\TortoiseSVN\bin\TortoiseStub32.dll:TortoiseStub32.dll (7BF80000), size: 94208 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files\TortoiseSVN\bin\TortoiseStub32.dll', fileVersion: 1.13.1.28686 +C:\Program Files\TortoiseSVN\bin\TortoiseSVN32.dll:TortoiseSVN32.dll (7BFA0000), size: 6934528 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files\TortoiseSVN\bin\TortoiseSVN32.dll', fileVersion: 1.13.1.28686 +C:\Windows\SYSTEM32\WININET.dll:WININET.dll (71A50000), size: 4567040 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\WININET.dll', fileVersion: 11.0.18362.753 +C:\Program Files\Microsoft Office\root\VFS\ProgramFilesX86\Microsoft Office\Office16\GROOVEEX.DLL:GROOVEEX.DLL (7A220000), size: 2625536 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files\Microsoft Office\root\VFS\ProgramFilesX86\Microsoft Office\Office16\GROOVEEX.DLL', fileVersion: 16.0.12228.20104 +C:\Windows\SYSTEM32\msi.dll:msi.dll (748F0000), size: 3543040 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\msi.dll', fileVersion: 5.0.18362.836 +C:\Program Files\Microsoft Office\root\VFS\ProgramFilesX86\Microsoft Office\Office16\1033\GrooveIntlResource.dll:GrooveIntlResource.dll (1E920000), size: 8929280 (result: 0), SymType: '-nosymbols-', PDB: 'C:\Program Files\Microsoft Office\root\VFS\ProgramFilesX86\Microsoft Office\Office16\1033\GrooveIntlResource.dll', fileVersion: 16.0.10001.10000 +C:\Program Files\LinkShellExtension\32\HardlinkShellExt.dll:HardlinkShellExt.dll (7BF00000), size: 491520 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files\LinkShellExtension\32\HardlinkShellExt.dll', fileVersion: 3.9.3.3 +C:\Windows\system32\IconCodecService.dll:IconCodecService.dll (508A0000), size: 32768 (result: 0), SymType: '-nosymbols-', PDB: 'C:\Windows\system32\IconCodecService.dll', fileVersion: 6.2.18362.1 +C:\Windows\System32\ActXPrxy.dll:ActXPrxy.dll (7A550000), size: 299008 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ActXPrxy.dll', fileVersion: 6.2.18362.329 +C:\Windows\System32\provsvc.dll:provsvc.dll (67FD0000), size: 401408 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\provsvc.dll', fileVersion: 6.2.18362.1 +C:\Windows\SYSTEM32\dbghelp.dll:dbghelp.dll (70D30000), size: 1634304 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\dbghelp.dll', fileVersion: 6.2.18362.1 +ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 78FE9C8F) +78FE9C8F (Qt5Gui): (filename not available): QPixmapCache::remove +ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 78A7A61D) +78A7A61D (Qt5Core): (filename not available): QModelIndex::data +ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 78ADE4CB) +78ADE4CB (Qt5Core): (filename not available): QTranslator::translate + diff --git a/map_src/vrstart.bak.map b/map_src/vrstart.bak.map new file mode 100644 index 00000000..4a534465 --- /dev/null +++ b/map_src/vrstart.bak.map @@ -0,0 +1,136 @@ +// Game: Quake +// Format: Standard +// entity 0 +{ +"classname" "worldspawn" +"wad" "C:/OHWorkspace/TrenchBroom/Q.wad" +} +// entity 1 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "Slipgate" +"_tb_id" "69" +// brush 0 +{ +( -48 8992 8160 ) ( -48 -7392 8160 ) ( -48 8992 -8224 ) slipside 0 0 0 1 1 +( -8672 464 8160 ) ( 7712 464 8160 ) ( -8672 464 -8224 ) slipside 0 0 0 1 1 +( 7712 -7392 16 ) ( 7712 8992 16 ) ( -8672 -7392 16 ) slipside 0 0 90 1 1 +( 7712 8992 32 ) ( 7712 -7392 32 ) ( -8672 -7392 32 ) sliplite 0 0 0 1 1 +( 7712 480 8160 ) ( -8672 480 8160 ) ( -8672 480 -8224 ) slipside 0 0 0 1 1 +( -32 -7392 8160 ) ( -32 8992 8160 ) ( -32 8992 -8224 ) slipside 0 0 0 1 1 +} +// brush 1 +{ +( -32 8992 8160 ) ( -32 -7392 8160 ) ( -32 8992 -8224 ) slipbotsd 0 32 270 1 1 +( -8672 416 8160 ) ( 7712 416 8160 ) ( -8672 416 -8224 ) slipbotsd 0 -32 270 1 1 +( 7712 -7392 16 ) ( 7712 8992 16 ) ( -8672 -7392 16 ) +0slipbot 32 32 0 1 1 +( 7712 8992 32 ) ( 7712 -7392 32 ) ( -8672 -7392 32 ) +0slipbot 32 32 0 1 1 +( 7712 480 8160 ) ( -8672 480 8160 ) ( -8672 480 -8224 ) slipbotsd 0 -32 270 1 1 +( 32 -7392 8160 ) ( 32 8992 8160 ) ( 32 8992 -8224 ) slipbotsd 0 32 270 1 1 +} +// brush 2 +{ +( 32 8992 8160 ) ( 32 -7392 8160 ) ( 32 8992 -8224 ) slipside 0 0 0 1 1 +( -8672 464 8160 ) ( 7712 464 8160 ) ( -8672 464 -8224 ) slipside 0 0 0 1 1 +( 7712 -7392 16 ) ( 7712 8992 16 ) ( -8672 -7392 16 ) slipside 0 0 90 1 1 +( 7712 8992 32 ) ( 7712 -7392 32 ) ( -8672 -7392 32 ) sliplite 0 0 0 1 1 +( 7712 480 8160 ) ( -8672 480 8160 ) ( -8672 480 -8224 ) slipside 0 0 0 1 1 +( 48 -7392 8160 ) ( 48 8992 8160 ) ( 48 8992 -8224 ) slipside 0 0 0 1 1 +} +// brush 3 +{ +( 32 8992 8160 ) ( 32 -7392 8160 ) ( 32 8992 -8224 ) slipside 0 0 0 1 1 +( -8672 416 8160 ) ( 7712 416 8160 ) ( -8672 416 -8224 ) slipside 0 0 0 1 1 +( 7712 -7392 16 ) ( 7712 8992 16 ) ( -8672 -7392 16 ) slipside 0 0 90 1 1 +( 7712 8992 32 ) ( 7712 -7392 32 ) ( -8672 -7392 32 ) sliplite 0 0 0 1 1 +( 7712 432 8160 ) ( -8672 432 8160 ) ( -8672 432 -8224 ) slipside 0 0 0 1 1 +( 48 -7392 8160 ) ( 48 8992 8160 ) ( 48 8992 -8224 ) slipside 0 0 0 1 1 +} +// brush 4 +{ +( -48 8992 8160 ) ( -48 -7392 8160 ) ( -48 8992 -8224 ) slipside 0 0 0 1 1 +( -8672 416 8160 ) ( 7712 416 8160 ) ( -8672 416 -8224 ) slipside 0 0 0 1 1 +( 7712 -7392 16 ) ( 7712 8992 16 ) ( -8672 -7392 16 ) slipside 0 0 90 1 1 +( 7712 8992 32 ) ( 7712 -7392 32 ) ( -8672 -7392 32 ) sliplite 0 0 0 1 1 +( 7712 432 8160 ) ( -8672 432 8160 ) ( -8672 432 -8224 ) slipside 0 0 0 1 1 +( -32 -7392 8160 ) ( -32 8992 8160 ) ( -32 8992 -8224 ) slipside 0 0 0 1 1 +} +// brush 5 +{ +( -64 384 -16 ) ( -64 385 -16 ) ( -64 384 -15 ) city6_4 32 -32 0 2 2 +( -64 384 -16 ) ( -64 384 -15 ) ( -63 384 -16 ) city6_4 32 -32 0 2 2 +( -64 384 -16 ) ( -63 384 -16 ) ( -64 385 -16 ) city6_4 32 -32 0 2 2 +( 64 512 16 ) ( 64 513 16 ) ( 65 512 16 ) city6_4 32 -32 0 2 2 +( 64 512 16 ) ( 65 512 16 ) ( 64 512 17 ) city6_4 32 -32 0 2 2 +( 64 512 16 ) ( 64 512 17 ) ( 64 513 16 ) city6_4 32 -32 0 2 2 +} +// brush 6 +{ +( -256 192 -128 ) ( -256 193 -128 ) ( -256 192 -126.92307692307693 ) wgrass1_1 0 0 0 1 1 +( -256 192 -128 ) ( -256 192 -126.92307692307693 ) ( -255 192 -128 ) wgrass1_1 0 0 0 1 1 +( -256 192 -128 ) ( -255 192 -128 ) ( -256 193 -128 ) wgrass1_1 0 0 0 1 1 +( 256 704 -16 ) ( 256 705 -16 ) ( 257 704 -16 ) wgrass1_1 0 0 0 1 1 +( 256 704 -16 ) ( 257 704 -16 ) ( 256 704 -14.923076923076927 ) wgrass1_1 0 0 0 1 1 +( 256 704 -16 ) ( 256 704 -14.923076923076927 ) ( 256 705 -16 ) wgrass1_1 0 0 0 1 1 +} +} +// entity 2 +{ +"classname" "info_player_start" +"origin" "0 448 56" +"angle" "270" +"_tb_layer" "69" +} +// entity 3 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "QuakeVRBillboard" +"_tb_id" "70" +// brush 0 +{ +( -256 -272 64 ) ( -256 -270 64 ) ( -256 -272 65 ) quakevrlogo -224 128 180 1 -0.5 +( -256 -272 64 ) ( -256 -272 65 ) ( -255 -272 64 ) quakevrlogo -496 128 180 0.5 -0.5 +( -256 -272 64 ) ( -255 -272 64 ) ( -256 -270 64 ) quakevrlogo -496 144 180 0.5 -1 +( 256 -240 320 ) ( 256 -238 320 ) ( 257 -240 320 ) quakevrlogo -496 144 180 0.5 -1 +( 256 -240 320 ) ( 257 -240 320 ) ( 256 -240 321 ) quakevrlogo -496 128 180 0.5 -0.5 +( 256 -240 320 ) ( 256 -240 321 ) ( 256 -238 320 ) quakevrlogo -224 128 180 1 -0.5 +} +// brush 1 +{ +( -512 -272 64 ) ( -512 -270 64 ) ( -512 -272 65 ) city5_4 -10 16 0 8 4 +( -512 -272 64 ) ( -512 -272 65 ) ( -511 -272 64 ) city5_4 20 16 0 4 4 +( -512 -272 64 ) ( -511 -272 64 ) ( -512 -270 64 ) city5_4 20 18 0 4 8 +( -256 -240 320 ) ( -256 -238 320 ) ( -255 -240 320 ) city5_4 20 18 0 4 8 +( -256 -240 320 ) ( -255 -240 320 ) ( -256 -240 321 ) city5_4 20 16 0 4 4 +( -256 -240 320 ) ( -256 -240 321 ) ( -256 -238 320 ) city5_4 -10 16 0 8 4 +} +// brush 2 +{ +( 256 -272 64 ) ( 256 -270 64 ) ( 256 -272 65 ) city5_4 -10 16 0 8 4 +( 256 -272 64 ) ( 256 -272 65 ) ( 257 -272 64 ) city5_4 20 16 0 4 4 +( 256 -272 64 ) ( 257 -272 64 ) ( 256 -270 64 ) city5_4 20 18 0 4 8 +( 512 -240 320 ) ( 512 -238 320 ) ( 513 -240 320 ) city5_4 20 18 0 4 8 +( 512 -240 320 ) ( 513 -240 320 ) ( 512 -240 321 ) city5_4 20 16 0 4 4 +( 512 -240 320 ) ( 512 -240 321 ) ( 512 -238 320 ) city5_4 -10 16 0 8 4 +} +// brush 3 +{ +( -576 -288 -224 ) ( -576 -287 -224 ) ( -576 -288 -221.74999999999994 ) city6_4 320 -31 0 1 1 +( -576 -288 -224 ) ( -576 -288 -221.74999999999994 ) ( -575 -288 -224 ) city6_4 320 -31 0 1 1 +( -576 -288 -224 ) ( -575 -288 -224 ) ( -576 -287 -224 ) city6_4 320 -31 0 1 1 +( -512 -224 352 ) ( -512 -223 352 ) ( -511 -224 352 ) city6_4 320 -31 0 1 1 +( -512 -224 352 ) ( -511 -224 352 ) ( -512 -224 354.25 ) city6_4 320 -31 0 1 1 +( -512 -224 352 ) ( -512 -224 354.25 ) ( -512 -223 352 ) city6_4 320 -31 0 1 1 +} +// brush 4 +{ +( 512 -288 -224 ) ( 512 -287 -224 ) ( 512 -288 -221.75 ) city6_4 0 -31 0 1 1 +( 512 -288 -224 ) ( 512 -288 -221.75 ) ( 513 -288 -224 ) city6_4 0 -31 0 1 1 +( 512 -288 -224 ) ( 513 -288 -224 ) ( 512 -287 -224 ) city6_4 0 -31 0 1 1 +( 576 -224 352 ) ( 576 -223 352 ) ( 577 -224 352 ) city6_4 0 -31 0 1 1 +( 576 -224 352 ) ( 577 -224 352 ) ( 576 -224 354.25 ) city6_4 0 -31 0 1 1 +( 576 -224 352 ) ( 576 -224 354.25 ) ( 576 -223 352 ) city6_4 0 -31 0 1 1 +} +} diff --git a/map_src/vrstart.bak2.map b/map_src/vrstart.bak2.map new file mode 100644 index 00000000..d975ad85 --- /dev/null +++ b/map_src/vrstart.bak2.map @@ -0,0 +1,2234 @@ +// Game: Quake +// Format: Standard +// entity 0 +{ +"classname" "worldspawn" +"wad" "C:/OHWorkspace/TrenchBroom/Q.wad" +"light" "300" +// brush 0 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 1 +{ +( 32 8992 8384 ) ( 32 -7392 8384 ) ( 32 8992 -8000 ) slipbotsd 0 32 270 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipbotsd 0 -32 270 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) +0slipbot 32 32 0 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) +0slipbot 32 32 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipbotsd 0 -32 270 1 1 +( 96 -7392 8384 ) ( 96 8992 8384 ) ( 96 8992 -8000 ) slipbotsd 0 32 270 1 1 +} +// brush 2 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 3 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 4 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 5 +{ +( 0 384 176 ) ( 0 512 176 ) ( 0 512 240 ) city6_4 32 -28 0 2 4 +( 0 384 176 ) ( 0 384 240 ) ( 128 384 240 ) city6_4 32 -32 0 2 2 +( 128 512 176 ) ( 0 512 176 ) ( 0 384 176 ) city6_4 32 -32 0 2 2 +( 128 384 240 ) ( 0 384 240 ) ( 0 512 240 ) city6_4 32 -32 0 2 2 +( 0 512 240 ) ( 0 512 176 ) ( 128 512 176 ) city6_4 32 -32 0 2 2 +( 128 512 240 ) ( 128 512 176 ) ( 128 384 176 ) city6_4 32 -28 0 2 4 +} +// brush 6 +{ +( -192 192 96 ) ( -192 704 96 ) ( -192 256 176 ) wgrass1_1 21.7358 28.448 0 1 0.835664 +( -192 704 96 ) ( -128 672 208 ) ( -192 256 176 ) wgrass1_1 47.7745 -61.2241 4.39873 0.869227 1.12493 +( -128 672 208 ) ( 192 288 208 ) ( -192 256 176 ) wgrass1_1 58.3448 19.515 4.76366 0.802773 0.98685 +( -192 256 176 ) ( 320 192 96 ) ( -192 192 96 ) wgrass1_1 1.1673 49.3623 4.08562 0.818747 0.883493 +( -192 192 96 ) ( 320 192 96 ) ( 320 704 96 ) wgrass1_1 0 0 0 1 1 +( 320 704 96 ) ( -128 672 208 ) ( -192 704 96 ) wgrass1_1 -29.7428 -54.8004 0 1 1.26543 +( -192 256 176 ) ( 192 288 208 ) ( 320 192 96 ) wgrass1_1 -43.5572 46.5876 4.76366 0.702426 1.01392 +( 256 576 176 ) ( 192 288 208 ) ( -128 672 208 ) wgrass1_1 61.1883 2.5107 358.637 1.07789 0.921205 +( 256 576 176 ) ( -128 672 208 ) ( 320 704 96 ) wgrass1_1 17.4665 -37.6948 345.964 0.824621 -1.36883 +( 320 192 96 ) ( 192 288 208 ) ( 256 576 176 ) wgrass1_1 -2.85219 -38.8333 77.4712 0.827395 1.11266 +( 320 704 96 ) ( 320 192 96 ) ( 256 576 176 ) wgrass1_1 -56.9837 11.5199 353.66 0.812663 0.923053 +} +// brush 7 +{ +( -192 -288 288 ) ( -192 -286 288 ) ( -192 -288 289 ) quakevrlogo 640 64 180 1 -0.5 +( -192 -288 288 ) ( -192 -288 289 ) ( -191 -288 288 ) quakevrlogo 640 64 180 0.5 -0.5 +( -192 -288 288 ) ( -191 -288 288 ) ( -192 -286 288 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 320 -254 544 ) ( 321 -256 544 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 321 -256 544 ) ( 320 -256 545 ) quakevrlogo 640 64 180 0.5 -0.5 +( 320 -256 544 ) ( 320 -256 545 ) ( 320 -254 544 ) quakevrlogo 640 64 180 1 -0.5 +} +// brush 8 +{ +( -448 -288 288 ) ( -448 -286 288 ) ( -448 -288 289 ) city5_4 -10 8 0 8 4 +( -448 -288 288 ) ( -448 -288 289 ) ( -447 -288 288 ) city5_4 20 8 0 4 4 +( -448 -288 288 ) ( -447 -288 288 ) ( -448 -286 288 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -192 -254 544 ) ( -191 -256 544 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -191 -256 544 ) ( -192 -256 545 ) city5_4 20 8 0 4 4 +( -192 -256 544 ) ( -192 -256 545 ) ( -192 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 9 +{ +( 320 -288 288 ) ( 320 -286 288 ) ( 320 -288 289 ) city5_4 -10 8 0 8 4 +( 320 -288 288 ) ( 320 -288 289 ) ( 321 -288 288 ) city5_4 20 8 0 4 4 +( 320 -288 288 ) ( 321 -288 288 ) ( 320 -286 288 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 576 -254 544 ) ( 577 -256 544 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 577 -256 544 ) ( 576 -256 545 ) city5_4 20 8 0 4 4 +( 576 -256 544 ) ( 576 -256 545 ) ( 576 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 10 +{ +( 576 -304 -192 ) ( 576 -303.00339673913044 -192 ) ( 576 -304 -189 ) city6_4 -16 -63 0 1 1 +( 576 -304 -192 ) ( 576 -304 -189 ) ( 577 -304 -192 ) city6_4 0 -63 0 1 1 +( 576 -304 -192 ) ( 577 -304 -192 ) ( 576 -303.00339673913044 -192 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -239.22078804347998 576 ) ( 641 -240.21739130434952 576 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 641 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) ( 640 -239.22078804347998 576 ) city6_4 0 -63 0 1 1 +} +// brush 11 +{ +( -512 -304 -192 ) ( -512 -303.00339673913044 -192 ) ( -512 -304 -189 ) city6_4 320 -63 0 1 1 +( -512 -304 -192 ) ( -512 -304 -189 ) ( -511 -304 -192 ) city6_4 320 -63 0 1 1 +( -512 -304 -192 ) ( -511 -304 -192 ) ( -512 -303.00339673913044 -192 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -448 -239.22078804347996 576 ) ( -447 -240.21739130434949 576 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -447 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) ( -448 -239.22078804347996 576 ) city6_4 303 -63 0 1 1 +} +// brush 12 +{ +( -1024 -831.5 704 ) ( -1024 -830.22799545712599 704 ) ( -1024 -831.5 704.5 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1024 -831.5 704.5 ) ( -1023.042253521126 -831.5 704 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1023.042253521126 -831.5 704 ) ( -1024 -830.22799545712599 704 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1409.7720045428748 736 ) ( 1152.9577464788731 1408.5 736 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152.9577464788731 1408.5 736 ) ( 1152 1408.5 736.5 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1408.5 736.5 ) ( 1152 1409.7720045428748 736 ) sky4 0 0 0 1 1 +} +// brush 13 +{ +( -576 -448 -256 ) ( -576 -446.85714285714261 -256 ) ( -576 -448 -255 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -576 -448 -255 ) ( -574.74999999999977 -448 -256 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -574.74999999999977 -448 -256 ) ( -576 -446.85714285714261 -256 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1089.1428571428576 -192 ) ( 705.25000000000034 1088 -192 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 705.25000000000034 1088 -192 ) ( 704 1088 -191 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1088 -191 ) ( 704 1089.1428571428576 -192 ) rock5_2 0 0 0 1 1 +} +// brush 14 +{ +( -576 -448 -192 ) ( -576 -447 -192 ) ( -576 -448 -191 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -576 -448 -191 ) ( -574.74999999999977 -448 -192 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -574.74999999999977 -448 -192 ) ( -576 -447 -192 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1089 96 ) ( 705.25000000000011 1088 96 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 705.25000000000011 1088 96 ) ( 704 1088 97 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1088 97 ) ( 704 1089 96 ) *04awater1 0 0 0 1 1 +} +// brush 15 +{ +( 1152 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) ( 1152 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152.4999999999998 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184.5000000000005 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152 -830.22799545712599 736 ) ( 1152.4999999999998 -831.5 736 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) ( 1184.5000000000005 1408.5 -1440 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 16 +{ +( -1056 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) ( -1056 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1055.5000000000002 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1023.4999999999995 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1056 -830.22799545712599 736 ) ( -1055.5000000000002 -831.5 736 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) ( -1023.4999999999995 1408.5 -1440 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 17 +{ +( -1055.5 1440 736 ) ( -1055.5 1439.5000000000005 736 ) ( -1055.5 1440 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1185.772004542875 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1407.4999999999991 -1440 ) ( 1185.772004542875 1408 -1440 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1054.2279954571259 1440 736 ) ( -1055.5 1439.5000000000005 736 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1055.5 1440 735.04225352112644 ) ( -1054.2279954571259 1440 736 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) ( 1184.5 1407.4999999999991 -1440 ) sky4 0 0 0 1 1 +} +// brush 18 +{ +( -1055.5 -832 736 ) ( -1055.5 -832.49999999999955 736 ) ( -1055.5 -832 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1185.772004542875 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864.50000000000091 -1440 ) ( 1185.772004542875 -864 -1440 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1054.2279954571259 -832 736 ) ( -1055.5 -832.49999999999955 736 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1055.5 -832 735.04225352112644 ) ( -1054.2279954571259 -832 736 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) ( 1184.5 -864.50000000000091 -1440 ) sky4 0 0 0 1 1 +} +// brush 19 +{ +( 216 48 96 ) ( 216 50.5 96 ) ( 216 48 98.5 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 216 48 98.5 ) ( 217 48 96 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 217 48 96 ) ( 216 50.5 96 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 288 90.5 108 ) ( 289 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 289 88 116 ) ( 288 88 118.5 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 288 88 118.5 ) ( 288 90.5 116 ) rock3_7 0 0 0 1 1 +} +// brush 20 +{ +( 216 88 108 ) ( 216 90.5 108 ) ( 216 88 110.5 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 216 88 110.5 ) ( 217 88 108 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 217 88 108 ) ( 216 90.5 108 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 288 130.5 120 ) ( 289 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 289 128 128 ) ( 288 128 130.5 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 288 128 130.5 ) ( 288 130.5 128 ) rock3_7 0 0 0 1 1 +} +// brush 21 +{ +( 216 128 120 ) ( 216 130.5 120 ) ( 216 128 122.5 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 216 128 122.5 ) ( 217 128 120 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 217 128 120 ) ( 216 130.5 120 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 288 170.5 132 ) ( 289 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 289 168 140 ) ( 288 168 142.5 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 288 168 142.5 ) ( 288 170.5 140 ) rock3_7 0 0 0 1 1 +} +// brush 22 +{ +( 216 168 132 ) ( 216 170.5 132 ) ( 216 168 134.5 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 216 168 134.5 ) ( 217 168 132 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 217 168 132 ) ( 216 170.5 132 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 288 210.5 144 ) ( 289 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 289 208 152 ) ( 288 208 154.5 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 288 208 154.5 ) ( 288 210.5 152 ) rock3_7 0 0 0 1 1 +} +// brush 23 +{ +( 216 208 144 ) ( 216 210.5 144 ) ( 216 208 146.5 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 216 208 146.5 ) ( 217 208 144 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 217 208 144 ) ( 216 210.5 144 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 288 250.5 156 ) ( 289 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 289 248 164 ) ( 288 248 166.5 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 288 248 166.5 ) ( 288 250.5 164 ) rock3_7 0 0 0 1 1 +} +// brush 24 +{ +( 216 248 156 ) ( 216 250.50000000000003 156 ) ( 216 248 158.5 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 216 248 158.5 ) ( 217 248 156 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 217 248 156 ) ( 216 250.50000000000003 156 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 288 290.5 168 ) ( 289 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 289 288 176 ) ( 288 288 178.5 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 288 288 178.5 ) ( 288 290.5 176 ) rock3_7 0 0 0 1 1 +} +// brush 25 +{ +( 216 288 168 ) ( 216 290.5 168 ) ( 216 288 170.5 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 216 288 170.5 ) ( 217 288 168 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 217 288 168 ) ( 216 290.5 168 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 288 330.5 180 ) ( 289 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 289 328 188 ) ( 288 328 190.5 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 288 328 190.5 ) ( 288 330.5 188 ) rock3_7 0 0 0 1 1 +} +// brush 26 +{ +( 216 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) ( 216 328 182.22774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 216 328 182.22774480533857 ) ( 217 328 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 217 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 191.72774480533857 ) ( 288 370.5 191.72774480533857 ) ( 289 368 191.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 289 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) ( 288 370.5 199.72774480533857 ) rock3_7 0 0 0 1 1 +} +// brush 27 +{ +( 216 368 191.70557387552577 ) ( 216 370.5 191.70557387552577 ) ( 216 368 194.20557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 191.70557387552577 ) ( 216 368 194.20557387552577 ) ( 217 368 191.70557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 192 ) ( 217 368 192 ) ( 216 370.5 192 ) rock3_7 0 0 0 1 1 +( 288 408 203.70557387552577 ) ( 288 410.5 203.70557387552577 ) ( 289 408 203.70557387552577 ) rock3_7 0 0 0 1 1 +( 288 496 211.70557387552577 ) ( 289 496 211.70557387552577 ) ( 288 496 214.20557387552577 ) rock3_7 0 0 0 1 1 +( 288 408 211.70557387552577 ) ( 288 408 214.20557387552577 ) ( 288 410.5 211.70557387552577 ) rock3_7 0 0 0 1 1 +} +// brush 28 +{ +( 144 368 156.04154748824237 ) ( 144 370.5 156.04154748824237 ) ( 144 368 158.54154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 204.04154748824237 ) ( 216 410.5 204.04154748824237 ) ( 217 408 204.54154748824226 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 144 368 158.54154748824237 ) ( 145 368 156.54154748824226 ) rock3_7 0 0 0 1 1 +( 216 496 212.04154748824237 ) ( 217 496 212.54154748824226 ) ( 216 496 214.54154748824237 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 145 368 156.54154748824226 ) ( 144 370.5 156.04154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 212.04154748824237 ) ( 216 408 214.54154748824237 ) ( 216 410.5 212.04154748824237 ) rock3_7 0 0 0 1 1 +} +// brush 29 +{ +( 280 488 96 ) ( 280 489 96 ) ( 280 488 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 280 488 120.5 ) ( 281 488 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 281 488 96 ) ( 280 489 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 192 ) ( 288 497 192 ) ( 289 496 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 289 496 194 ) ( 288 496 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 288 496 218.5 ) ( 288 497 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 30 +{ +( 280 368 96 ) ( 280 369 96 ) ( 280 368 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 280 368 120.5 ) ( 281 368 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 281 368 96 ) ( 280 369 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 192 ) ( 288 377 192 ) ( 289 376 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 289 376 194 ) ( 288 376 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 288 376 218.5 ) ( 288 377 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 31 +{ +( 280 320 96 ) ( 280 321 96 ) ( 280 320 114 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 280 320 114 ) ( 281 320 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 281 320 96 ) ( 280 321 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 329 168 ) ( 289 328 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 289 328 168 ) ( 288 328 186 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 328 186 ) ( 288 329 168 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 32 +{ +( 280 280 84 ) ( 280 281 84 ) ( 280 280 102 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 84 ) ( 280 280 102 ) ( 281 280 84 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 96 ) ( 281 280 96 ) ( 280 281 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 289 156 ) ( 289 288 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 289 288 156 ) ( 288 288 174 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 288 174 ) ( 288 289 156 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 33 +{ +( 280 240 72 ) ( 280 241 72 ) ( 280 240 90 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 72 ) ( 280 240 90 ) ( 281 240 72 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 96 ) ( 281 240 96 ) ( 280 241 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 249 144 ) ( 289 248 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 289 248 144 ) ( 288 248 162 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 248 162 ) ( 288 249 144 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 34 +{ +( 280 200 60 ) ( 280 201 60 ) ( 280 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 60 ) ( 280 200 78 ) ( 281 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 96 ) ( 281 200 96 ) ( 280 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 209 132 ) ( 289 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 289 208 132 ) ( 288 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 208 150 ) ( 288 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 35 +{ +( 280 160 48 ) ( 280 161 48 ) ( 280 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 48 ) ( 280 160 66 ) ( 281 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 96 ) ( 281 160 96 ) ( 280 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 169 120 ) ( 289 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 289 168 120 ) ( 288 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 168 138 ) ( 288 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 36 +{ +( 280 120 36 ) ( 280 121 36 ) ( 280 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 36 ) ( 280 120 54 ) ( 281 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 96 ) ( 281 120 96 ) ( 280 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 129 108 ) ( 289 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 289 128 108 ) ( 288 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 128 126 ) ( 288 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 37 +{ +( -236 724 96 ) ( -236 34 96 ) ( -236 34 64 ) rock5_2 0 0 0 1 1 +( -236 724 34 ) ( -236 34 64 ) ( 360 34 44 ) rock5_2 0 0 0 1 1 +( -236 34 64 ) ( -236 34 96 ) ( 360 34 96 ) rock5_2 0 0 0 1 1 +( 360 34 96 ) ( -236 34 96 ) ( -236 724 96 ) rock5_2 0 0 0 1 1 +( 360 724 96 ) ( -236 724 96 ) ( -236 724 34 ) rock5_2 0 0 0 1 1 +( 360 724 64 ) ( -236 724 34 ) ( 360 34 44 ) rock5_2 0 0 0 1 1 +( 360 724 64 ) ( 360 34 44 ) ( 360 34 96 ) rock5_2 0 0 0 1 1 +} +// brush 38 +{ +( -236 112 114 ) ( -236 34 96 ) ( -236 303 96 ) rock5_2 16.815 0 0 1.97847 1 +( -226 41 114 ) ( -236 34 96 ) ( -236 112 114 ) rock5_2 19.3038 -0.889084 0 1.80092 1.01176 +( -186 34 114 ) ( -236 34 96 ) ( -226 41 114 ) rock5_2 110.083 -0.0819645 0 0.816327 1.01743 +( -116 34 96 ) ( -236 34 96 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -236 34 96 ) ( -116 34 96 ) rock5_2 0 0 0 1 1 +( -236 112 114 ) ( -186 112 114 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -186 112 114 ) ( -236 112 114 ) rock5_2 -3.95884 3.85601 0 1 -10.668 +( -186 34 114 ) ( -186 112 114 ) ( -116 34 96 ) rock5_2 -9.04656 -65.2849 90 1 3.93803 +( -129 117 96 ) ( -186 112 114 ) ( -236 303 96 ) rock5_2 -43.1704 -70.9503 299.911 4.29162 -3.11322 +( -116 34 96 ) ( -186 112 114 ) ( -129 117 96 ) rock5_2 -9.80276 -60.6771 98.8998 1.05129 3.21752 +} +// brush 39 +{ +( 216 120 36 ) ( 216 121 36 ) ( 216 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 36 ) ( 216 120 54 ) ( 217 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 96 ) ( 217 120 96 ) ( 216 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 129 108 ) ( 225 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 225 128 108 ) ( 224 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 128 126 ) ( 224 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 40 +{ +( 216 160 48 ) ( 216 161 48 ) ( 216 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 48 ) ( 216 160 66 ) ( 217 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 96 ) ( 217 160 96 ) ( 216 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 169 120 ) ( 225 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 225 168 120 ) ( 224 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 168 138 ) ( 224 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 41 +{ +( 216 200 60 ) ( 216 201 60 ) ( 216 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 60 ) ( 216 200 78 ) ( 217 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 96 ) ( 217 200 96 ) ( 216 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 209 132 ) ( 225 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 225 208 132 ) ( 224 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 208 150 ) ( 224 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 42 +{ +( 216 100 108 ) ( 216 88 108 ) ( 216 88 96 ) rock3_7 0 0 0 1 1.11111 +( 216 88 96 ) ( 216 88 108 ) ( 288 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 216 88 108 ) ( 216 100 108 ) rock3_7 0 0 0 1 1 +( 288 100 108 ) ( 216 100 108 ) ( 216 88 96 ) rock3_7 0 -52 0 1 1 +( 288 88 96 ) ( 288 88 108 ) ( 288 100 108 ) rock3_7 0 0 0 1 1.11111 +} +// brush 43 +{ +( 216 140 120 ) ( 216 128 120 ) ( 216 128 108 ) rock3_7 0 0 0 1 1.11111 +( 216 128 108 ) ( 216 128 120 ) ( 288 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 216 128 120 ) ( 216 140 120 ) rock3_7 0 0 0 1 1 +( 288 140 120 ) ( 216 140 120 ) ( 216 128 108 ) rock3_7 0 -52 0 1 1 +( 288 128 108 ) ( 288 128 120 ) ( 288 140 120 ) rock3_7 0 0 0 1 1.11111 +} +// brush 44 +{ +( 216 180 132 ) ( 216 168 132 ) ( 216 168 120 ) rock3_7 0 0 0 1 1.11111 +( 216 168 120 ) ( 216 168 132 ) ( 288 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 216 168 132 ) ( 216 180 132 ) rock3_7 0 0 0 1 1 +( 288 180 132 ) ( 216 180 132 ) ( 216 168 120 ) rock3_7 0 -52 0 1 1 +( 288 168 120 ) ( 288 168 132 ) ( 288 180 132 ) rock3_7 0 0 0 1 1.11111 +} +// brush 45 +{ +( 216 220 144 ) ( 216 208 144 ) ( 216 208 132 ) rock3_7 0 0 0 1 1.11111 +( 216 208 132 ) ( 216 208 144 ) ( 288 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 216 208 144 ) ( 216 220 144 ) rock3_7 0 0 0 1 1 +( 288 220 144 ) ( 216 220 144 ) ( 216 208 132 ) rock3_7 0 -52 0 1 1 +( 288 208 132 ) ( 288 208 144 ) ( 288 220 144 ) rock3_7 0 0 0 1 1.11111 +} +// brush 46 +{ +( 216 260 156 ) ( 216 248 156 ) ( 216 248 144 ) rock3_7 0 0 0 1 1.11111 +( 216 248 144 ) ( 216 248 156 ) ( 288 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 216 248 156 ) ( 216 260 156 ) rock3_7 0 0 0 1 1 +( 288 260 156 ) ( 216 260 156 ) ( 216 248 144 ) rock3_7 0 -52 0 1 1 +( 288 248 144 ) ( 288 248 156 ) ( 288 260 156 ) rock3_7 0 0 0 1 1.11111 +} +// brush 47 +{ +( 216 300 168 ) ( 216 288 168 ) ( 216 288 156 ) rock3_7 0 0 0 1 1.11111 +( 216 288 156 ) ( 216 288 168 ) ( 288 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 216 288 168 ) ( 216 300 168 ) rock3_7 0 0 0 1 1 +( 288 300 168 ) ( 216 300 168 ) ( 216 288 156 ) rock3_7 0 -52 0 1 1 +( 288 288 156 ) ( 288 288 168 ) ( 288 300 168 ) rock3_7 0 0 0 1 1.11111 +} +// brush 48 +{ +( 216 340 180 ) ( 216 328 180 ) ( 216 328 168 ) rock3_7 0 0 0 1 1.11111 +( 216 328 168 ) ( 216 328 180 ) ( 288 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 216 328 180 ) ( 216 340 180 ) rock3_7 0 0 0 1 1 +( 288 340 180 ) ( 216 340 180 ) ( 216 328 168 ) rock3_7 0 -52 0 1 1 +( 288 328 168 ) ( 288 328 180 ) ( 288 340 180 ) rock3_7 0 0 0 1 1.11111 +} +// brush 49 +{ +( 216 380 192 ) ( 216 368 192 ) ( 216 368 180 ) rock3_7 0 0 0 1 1.11111 +( 216 368 180 ) ( 216 368 192 ) ( 288 368 192 ) rock3_7 0 0 0 1 1 +( 288 368 192 ) ( 216 368 192 ) ( 216 380 192 ) rock3_7 0 0 0 1 1 +( 288 380 192 ) ( 216 380 192 ) ( 216 368 180 ) rock3_7 0 -52 0 1 1 +( 288 368 180 ) ( 288 368 192 ) ( 288 380 192 ) rock3_7 0 0 0 1 1.11111 +} +// brush 50 +{ +( 280 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) ( 280 488 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 280 488 228.45753068742539 ) ( 281 488 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 281 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 236 ) ( 288 497 236 ) ( 289 496 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 289 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) ( 288 497 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 51 +{ +( 280 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) ( 280 368 228.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 280 368 228.20557387552628 ) ( 281 368 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 281 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 235.74804318810089 ) ( 288 377 235.74804318810089 ) ( 289 376 235.74804318810089 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 289 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) ( 288 377 301.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 52 +{ +( 280 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) ( 280 430 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 280 430 228.45753068742539 ) ( 281 430 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 281 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 236 ) ( 288 439 236 ) ( 289 438 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 289 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) ( 288 439 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 53 +{ +( 280 429.70557387552628 244 ) ( 280 429.70557387552628 243 ) ( 280 454.20557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 280 368 244 ) ( 281 368 244 ) ( 280 368 243 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 289 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) wood1_1 0 0 270 0.5 0.5 +( 280 429.70557387552628 244 ) ( 280 454.20557387552628 244 ) ( 281 429.70557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 288 496 236 ) ( 288 496 235 ) ( 289 496 236 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) ( 288 527.70557387552628 235 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 54 +{ +( 280 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) ( 280 328 216.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 280 328 216.45753068742539 ) ( 281 328 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 281 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 232 ) ( 288 337 232 ) ( 289 336 232 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 289 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) ( 288 337 289.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 55 +{ +( 280 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) ( 280 288 204.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 280 288 204.45753068742539 ) ( 281 288 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 281 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 220 ) ( 288 297 220 ) ( 289 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 289 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) ( 288 297 277.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 56 +{ +( 280 248 168 ) ( 280 249 168 ) ( 280 248 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 280 248 192.50000000000051 ) ( 281 248 168 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 281 248 168 ) ( 280 249 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 208 ) ( 288 257 208 ) ( 289 256 208 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 289 256 266 ) ( 288 256 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 288 256 290.50000000000051 ) ( 288 257 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 57 +{ +( 280 208 156 ) ( 280 209 156 ) ( 280 208 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 280 208 180.50000000000051 ) ( 281 208 156 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 281 208 156 ) ( 280 209 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 196 ) ( 288 217 196 ) ( 289 216 196 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 289 216 254 ) ( 288 216 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 288 216 278.50000000000051 ) ( 288 217 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 58 +{ +( 280 168 144 ) ( 280 169 144 ) ( 280 168 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 280 168 168.50000000000051 ) ( 281 168 144 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 281 168 144 ) ( 280 169 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 184 ) ( 288 177 184 ) ( 289 176 184 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 289 176 242 ) ( 288 176 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 288 176 266.50000000000051 ) ( 288 177 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 59 +{ +( 280 128 132 ) ( 280 129 132 ) ( 280 128 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 280 128 156.50000000000051 ) ( 281 128 132 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 281 128 132 ) ( 280 129 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 172 ) ( 288 137 172 ) ( 289 136 172 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 289 136 230 ) ( 288 136 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 288 136 254.50000000000051 ) ( 288 137 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 60 +{ +( 280 88 120 ) ( 280 89 120 ) ( 280 88 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 280 88 144.50000000000051 ) ( 281 88 120 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 281 88 120 ) ( 280 89 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 160 ) ( 288 97 160 ) ( 289 96 160 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 289 96 218 ) ( 288 96 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 288 96 242.50000000000051 ) ( 288 97 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 61 +{ +( 280 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) ( 280 48 138.57441256965544 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 280 48 138.57441256965544 ) ( 281 48 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 281 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 148 ) ( 288 57 148 ) ( 289 56 148 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 289 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) ( 288 57 230.42505821634469 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 62 +{ +( 280 56 148 ) ( 280 56 147 ) ( 280 80.500000000000512 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 281 56 148 ) ( 280 56 147 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 280 80.500000000000512 151.05844094111507 ) ( 281 56 148 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 289 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 88.042469312575122 144 ) ( 288 88.042469312575122 143 ) ( 289 88.042469312575122 144 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) ( 288 154 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 63 +{ +( 280 96 160 ) ( 280 96 159 ) ( 280 120.50000000000051 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 281 96 160 ) ( 280 96 159 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 280 120.50000000000051 163.05844094111507 ) ( 281 96 160 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 289 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 128.04246931257512 156 ) ( 288 128.04246931257512 155 ) ( 289 128.04246931257512 156 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) ( 288 194 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 64 +{ +( 280 136 172 ) ( 280 136 171 ) ( 280 160.50000000000051 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 281 136 172 ) ( 280 136 171 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 280 160.50000000000051 175.05844094111507 ) ( 281 136 172 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 289 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 168.04246931257512 168 ) ( 288 168.04246931257512 167 ) ( 289 168.04246931257512 168 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) ( 288 234 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 65 +{ +( 280 176 184 ) ( 280 176 183 ) ( 280 200.50000000000051 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 281 176 184 ) ( 280 176 183 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 280 200.50000000000051 187.05844094111507 ) ( 281 176 184 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 289 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 208.04246931257512 180 ) ( 288 208.04246931257512 179 ) ( 289 208.04246931257512 180 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) ( 288 274 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 66 +{ +( 280 216 196 ) ( 280 216 195 ) ( 280 240.50000000000051 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 281 216 196 ) ( 280 216 195 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 280 240.50000000000051 199.05844094111507 ) ( 281 216 196 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 289 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 248.04246931257512 192 ) ( 288 248.04246931257512 191 ) ( 289 248.04246931257512 192 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) ( 288 314 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 67 +{ +( 280 256 208 ) ( 280 256 207 ) ( 280 280.50000000000051 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 281 256 208 ) ( 280 256 207 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 280 280.50000000000051 211.05844094111507 ) ( 281 256 208 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 289 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 288.04246931257512 204 ) ( 288 288.04246931257512 203 ) ( 289 288.04246931257512 204 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) ( 288 354 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 68 +{ +( 280 296 220 ) ( 280 296 219 ) ( 280 320.50000000000051 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 281 296 220 ) ( 280 296 219 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 280 320.50000000000051 223.05844094111507 ) ( 281 296 220 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 289 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 328.04246931257512 216 ) ( 288 328.04246931257512 215 ) ( 289 328.04246931257512 216 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) ( 288 394 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 69 +{ +( 280 336 232 ) ( 280 336 231 ) ( 280 360.50000000000051 235.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 281 336 232 ) ( 280 336 231 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 280 360.50000000000051 235.05844094111507 ) ( 281 336 232 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 289 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 368.04246931257512 228 ) ( 288 368.04246931257512 227 ) ( 289 368.04246931257512 228 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) ( 288 434 235.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 70 +{ +( 216 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) ( 217 47.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 217 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 148 ) ( 224 56.957530687424878 148 ) ( 225 55.957530687424878 148 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 225 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) ( 224 56.957530687424878 230.42505821634472 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 71 +{ +( 216 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) ( 216 80.45753068742539 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 217 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 216 80.45753068742539 151.05844094111507 ) ( 217 55.957530687424878 148 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 225 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 88 144 ) ( 224 88 143 ) ( 225 88 144 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) ( 224 153.95753068742488 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 72 +{ +( 216 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) ( 217 87.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 217 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 160 ) ( 224 96.957530687424878 160 ) ( 225 95.957530687424878 160 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 225 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) ( 224 96.957530687424878 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 73 +{ +( 216 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) ( 216 120.45753068742539 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 217 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 216 120.45753068742539 163.05844094111507 ) ( 217 95.957530687424878 160 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 225 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 128 156 ) ( 224 128 155 ) ( 225 128 156 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) ( 224 193.95753068742488 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 74 +{ +( 216 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) ( 217 127.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 217 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 172 ) ( 224 136.95753068742488 172 ) ( 225 135.95753068742488 172 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 225 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) ( 224 136.95753068742488 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 75 +{ +( 216 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) ( 216 160.45753068742539 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 217 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 216 160.45753068742539 175.05844094111507 ) ( 217 135.95753068742488 172 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 225 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 168 168 ) ( 224 168 167 ) ( 225 168 168 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) ( 224 233.95753068742488 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 76 +{ +( 216 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) ( 217 167.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 217 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 184 ) ( 224 176.95753068742488 184 ) ( 225 175.95753068742488 184 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 225 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) ( 224 176.95753068742488 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 77 +{ +( 216 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) ( 216 200.45753068742539 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 217 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 216 200.45753068742539 187.05844094111507 ) ( 217 175.95753068742488 184 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 225 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 208 180 ) ( 224 208 179 ) ( 225 208 180 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) ( 224 273.95753068742488 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 78 +{ +( 216 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) ( 217 207.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 217 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 196 ) ( 224 216.95753068742488 196 ) ( 225 215.95753068742488 196 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 225 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) ( 224 216.95753068742488 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 79 +{ +( 216 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) ( 216 240.45753068742539 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 217 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 216 240.45753068742539 199.05844094111507 ) ( 217 215.95753068742488 196 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 225 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 248 192 ) ( 224 248 191 ) ( 225 248 192 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) ( 224 313.95753068742488 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 80 +{ +( 216 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) ( 217 247.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 217 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 208 ) ( 224 256.95753068742488 208 ) ( 225 255.95753068742488 208 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 225 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) ( 224 256.95753068742488 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 81 +{ +( 216 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) ( 216 280.45753068742539 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 217 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 216 280.45753068742539 211.05844094111507 ) ( 217 255.95753068742488 208 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 225 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 288 204 ) ( 224 288 203 ) ( 225 288 204 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) ( 224 353.95753068742488 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 82 +{ +( 216 288 180 ) ( 216 289 180 ) ( 216 288 204.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 216 288 204.50000000000051 ) ( 217 288 180 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 217 288 180 ) ( 216 289 180 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 220 ) ( 224 297 220 ) ( 225 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 225 296 278 ) ( 224 296 302.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 224 296 302.50000000000051 ) ( 224 297 278 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 83 +{ +( 176 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) ( 176 288 216.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 176 288 216.30347303743031 ) ( 177 288 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 177 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 231.8034730374298 ) ( 184 297 231.8034730374298 ) ( 185 296 231.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 185 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) ( 184 297 289.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 84 +{ +( 184 296 216 ) ( 184 296 215 ) ( 184 297 216 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 118.04246931257512 297 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 288 219 ) ( 191.54246931257461 288 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) ( 118.04246931257512 296 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 191.54246931257461 288 223.05844094111507 ) ( 216.04246931257512 289 220 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 289 220 ) ( 216.04246931257512 288 219 ) wood1_1 0 0 270 0.5 0.5 +} +} +// entity 1 +{ +"classname" "info_player_start" +"origin" "64 448 280" +"angle" "270" +} +// entity 2 +{ +"origin" "312 -440 104" +"classname" "func_particle_emitter" +} +// entity 3 +{ +"origin" "184 -440 104" +"classname" "func_particle_emitter" +} +// entity 4 +{ +"origin" "56 -440 104" +"classname" "func_particle_emitter" +} +// entity 5 +{ +"origin" "-72 -440 104" +"classname" "func_particle_emitter" +} +// entity 6 +{ +"origin" "-200 -440 104" +"classname" "func_particle_emitter" +} +// entity 7 +{ +"origin" "-520 -440 104" +"classname" "func_particle_emitter" +} +// entity 8 +{ +"origin" "-456 -440 104" +"classname" "func_particle_emitter" +} +// entity 9 +{ +"origin" "-392 -440 104" +"classname" "func_particle_emitter" +} +// entity 10 +{ +"origin" "-328 -440 104" +"classname" "func_particle_emitter" +} +// entity 11 +{ +"origin" "-264 -440 104" +"classname" "func_particle_emitter" +} +// entity 12 +{ +"origin" "-136 -440 104" +"classname" "func_particle_emitter" +} +// entity 13 +{ +"origin" "-8 -440 104" +"classname" "func_particle_emitter" +} +// entity 14 +{ +"origin" "120 -440 104" +"classname" "func_particle_emitter" +} +// entity 15 +{ +"origin" "248 -440 104" +"classname" "func_particle_emitter" +} +// entity 16 +{ +"origin" "376 -440 104" +"classname" "func_particle_emitter" +} +// entity 17 +{ +"origin" "440 -440 104" +"classname" "func_particle_emitter" +} +// entity 18 +{ +"origin" "504 -440 104" +"classname" "func_particle_emitter" +} +// entity 19 +{ +"origin" "568 -440 104" +"classname" "func_particle_emitter" +} +// entity 20 +{ +"origin" "632 -440 104" +"classname" "func_particle_emitter" +} +// entity 21 +{ +"origin" "696 -440 104" +"classname" "func_particle_emitter" +} +// entity 22 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "Slipgate" +"_tb_id" "68" +} +// entity 23 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "QuakeVRBillboard" +"_tb_id" "69" +} +// entity 24 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "BigSlipgate" +"_tb_id" "70" +// brush 0 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 1 +{ +( -492 10084 8671.7307831234339 ) ( -492 -6300 8671.7307831234339 ) ( -492 10084 -7712.2692168765661 ) +0slip 0 -24 180 1 1 +( -8652 516 8671.7307831234339 ) ( 6768.2352941176468 516 8671.7307831234339 ) ( 6768.2352941176468 516 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -8652 -6300 199.73078312343421 ) ( 6768.2352941176468 -6300 199.73078312343421 ) ( -8652 10084 199.73078312343421 ) +0slip 0 -24 90 1 1 +( 6768.2352941176468 -6300 391.73078312343421 ) ( -8652 -6300 391.73078312343421 ) ( -8652 10084 391.73078312343421 ) +0slip 32 0 0 1 1 +( 6768.2352941176468 644 8671.7307831234339 ) ( -8652 644 8671.7307831234339 ) ( 6768.2352941176468 644 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -460 -6300 8671.7307831234339 ) ( -460 10084 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slip1 32 -88 0 1 1 +} +// brush 2 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 3 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 14 10 180 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 4 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 5 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 14 10 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipside 14 10 0 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) sliplite 14 10 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 14 10 180 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 14 10 0 1 1 +} +// brush 6 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +( -9164 548 8671.7307831234339 ) ( 7220 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) slipbotsd -82 24 180 1 1 +( 7220 -6300 215.73078312343421 ) ( -9164 -6300 215.73078312343421 ) ( -9164 10084 215.73078312343421 ) +0slipbot -82 24 0 1 1 +( 7220 612 8671.7307831234339 ) ( -9164 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipbotsd -82 24 90 1 1 +} +// brush 7 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 8 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 532 8671.7307831234339 ) ( 7220 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 548 8671.7307831234339 ) ( -9164 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -444 -6300 8671.7307831234339 ) ( -444 10084 8671.7307831234339 ) ( -444 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 9 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +( -9164 548 8671.7307831234339 ) ( 7220 548 8671.7307831234339 ) ( 7220 548 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) +0sliptop 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) sliptopsd 0 0 90 1 1 +( 7220 612 8671.7307831234339 ) ( -9164 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) sliptopsd 0 0 90 1 1 +} +// brush 10 +{ +( -412 10084 8671.7307831234339 ) ( -412 -6300 8671.7307831234339 ) ( -412 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -9164 612 8671.7307831234339 ) ( 7220 612 8671.7307831234339 ) ( 7220 612 -7712.2692168765661 ) slipside 0 -8 180 1 1 +( -9164 -6300 375.73078312343421 ) ( 7220 -6300 375.73078312343421 ) ( -9164 10084 375.73078312343421 ) sliplite 0 0 0 1 1 +( 7220 -6300 391.73078312343421 ) ( -9164 -6300 391.73078312343421 ) ( -9164 10084 391.73078312343421 ) slipside 0 -8 0 1 1 +( 7220 628 8671.7307831234339 ) ( -9164 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) slipside 0 -8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) slipside 0 -8 0 1 1 +} +// brush 11 +{ +( -512 384 152 ) ( -512 385.0526315789474 152 ) ( -512 384 152.16666666666666 ) rock3_7 0 0 0 1 1 +( -512 144 152 ) ( -512 144 152.16666666666666 ) ( -511 144 152 ) rock3_7 0 0 0 1 1 +( -512 384 152 ) ( -511 384 152 ) ( -512 385.0526315789474 152 ) rock3_7 0 0 0 1 1 +( -320 704 200 ) ( -320 705.05263157894728 200 ) ( -319 704 200 ) rock3_7 0 0 0 1 1 +( -320 704 200 ) ( -319 704 200 ) ( -320 704 200.16666666666666 ) rock3_7 0 0 0 1 1 +( -272 704 200 ) ( -272 704 200.16666666666666 ) ( -272 705.05263157894728 200 ) rock3_7 0 0 0 1 1 +} +// brush 12 +{ +( -500 8580 8472 ) ( -500 -7804 8472 ) ( -500 8580 -7912 ) tech10_1 208 0 0 1 1 +( -11332 404 8472 ) ( 5052 404 8472 ) ( 5052 404 -7912 ) tech10_1 208 0 0 1 1 +( -11332 -7804 200 ) ( 5052 -7804 200 ) ( -11332 8580 200 ) tech10_1 208 0 0 1 1 +( 5052 -7804 280 ) ( -11332 -7804 280 ) ( -11332 8580 280 ) tech10_1 208 0 0 1 1 +( 5052 468 8472 ) ( -11332 468 8472 ) ( 5052 468 -7912 ) tech10_1 208 0 0 1 1 +( -484 -7804 8472 ) ( -484 8580 8472 ) ( -484 8580 -7912 ) tech10_1 236 -32 0 1 1.25 +} +} +// entity 25 +{ +"classname" "trigger_changelevel" +"map" "start" +"_tb_layer" "70" +// brush 0 +{ +( -452 10084 8671.7307831234339 ) ( -452 -6300 8671.7307831234339 ) ( -452 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 556 8671.7307831234339 ) ( 7220 556 8671.7307831234339 ) ( 7220 556 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) trigger 0 0 0 1 1 +( 7220 -6300 351.73078312343421 ) ( -9164 -6300 351.73078312343421 ) ( -9164 10084 351.73078312343421 ) trigger 0 0 0 1 1 +( 7220 604 8671.7307831234339 ) ( -9164 604 8671.7307831234339 ) ( 7220 604 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -404 -6300 8671.7307831234339 ) ( -404 10084 8671.7307831234339 ) ( -404 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +} +} +// entity 26 +{ +"spawnflags" "1792" +"classname" "func_wall" +"_tb_layer" "70" +// brush 0 +{ +( -380 10084 8671.7307831234339 ) ( -380 -6300 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 564 8671.7307831234339 ) ( 7220 564 8671.7307831234339 ) ( 7220 564 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 596 8671.7307831234339 ) ( -9164 596 8671.7307831234339 ) ( 7220 596 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -372 -6300 8671.7307831234339 ) ( -372 10084 8671.7307831234339 ) ( -372 10084 -7712.2692168765661 ) z_exit 22 6 180 -1 -1 +} +} +// entity 27 +{ +"spawnflags" "1792" +"classname" "func_wall" +"_tb_layer" "70" +// brush 0 +{ +( -396 10084 8671.7307831234339 ) ( -396 -6300 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -380 -6300 8671.7307831234339 ) ( -380 10084 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 1 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 532 8671.7307831234339 ) ( -9164 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 2 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 628 8671.7307831234339 ) ( 7220 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 0 0 1 1 +} +} +// entity 28 +{ +"classname" "func_button" +"angle" "180" +"speed" "50" +"sounds" "1" +"wait" "1" +"lip" "4" +"effects" "1" +"targetname" "w" +"_tb_layer" "70" +// brush 0 +{ +( -484 8580 8480 ) ( -484 -7804 8480 ) ( -484 8580 -7904 ) door02_1 -4 16 0 1 1 +( -11332 420 8480 ) ( 5052 420 8480 ) ( 5052 420 -7904 ) door02_1 -4 16 0 1 1 +( -11332 -7804 240 ) ( 5052 -7804 240 ) ( -11332 8580 240 ) door02_1 -4 8 0 1 1 +( 5052 -7804 272 ) ( -11332 -7804 272 ) ( -11332 8580 272 ) door02_1 -4 8 0 1 1 +( 5052 452 8480 ) ( -11332 452 8480 ) ( 5052 452 -7904 ) door02_1 -4 16 0 1 1 +( -476 -7804 8480 ) ( -476 8580 8480 ) ( -476 8580 -7904 ) +0basebtn -4 16 0 1 1 +} +} +// entity 29 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "Emitter Row" +"_tb_id" "71" +} +// entity 30 +{ +"origin" "632 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 31 +{ +"origin" "696 504 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 32 +{ +"origin" "696 312 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 33 +{ +"origin" "696 952 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 34 +{ +"origin" "696 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 35 +{ +"origin" "-392 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 36 +{ +"origin" "-328 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 37 +{ +"origin" "-264 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 38 +{ +"origin" "568 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 39 +{ +"origin" "-520 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 40 +{ +"origin" "-456 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 41 +{ +"origin" "-568 -136 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 42 +{ +"origin" "184 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 43 +{ +"origin" "-568 -200 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 44 +{ +"origin" "-456 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 45 +{ +"origin" "568 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 46 +{ +"origin" "632 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 47 +{ +"origin" "-392 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 48 +{ +"origin" "696 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 49 +{ +"origin" "-568 56 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 50 +{ +"origin" "-568 184 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 51 +{ +"origin" "-568 888 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 52 +{ +"origin" "-568 888 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 53 +{ +"origin" "-568 696 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 54 +{ +"origin" "-200 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 55 +{ +"origin" "-568 568 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 56 +{ +"origin" "-568 1016 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 57 +{ +"origin" "-568 568 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 58 +{ +"origin" "-568 376 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 59 +{ +"origin" "-568 248 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 60 +{ +"origin" "-568 -72 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 61 +{ +"origin" "-568 -200 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 62 +{ +"origin" "-568 824 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 63 +{ +"origin" "-568 120 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 64 +{ +"origin" "-568 760 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 65 +{ +"origin" "-568 952 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 66 +{ +"origin" "-568 696 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 67 +{ +"origin" "-568 632 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 68 +{ +"origin" "-568 312 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 69 +{ +"origin" "-568 -8 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 70 +{ +"origin" "-568 504 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 71 +{ +"origin" "-568 -136 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 72 +{ +"origin" "-568 1016 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 73 +{ +"origin" "-568 824 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 74 +{ +"origin" "-568 632 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 75 +{ +"origin" "-568 440 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 76 +{ +"origin" "-568 952 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 77 +{ +"origin" "-568 504 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 78 +{ +"origin" "-568 312 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 79 +{ +"origin" "-568 -328 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 80 +{ +"origin" "-568 -264 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 81 +{ +"origin" "-568 -264 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 82 +{ +"origin" "696 -264 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 83 +{ +"origin" "696 -328 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 84 +{ +"origin" "696 -392 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 85 +{ +"origin" "696 -328 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 86 +{ +"origin" "-568 -8 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 87 +{ +"origin" "-328 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 88 +{ +"origin" "-264 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 89 +{ +"origin" "696 -264 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 90 +{ +"origin" "696 -392 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 91 +{ +"origin" "-568 376 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 92 +{ +"origin" "-568 248 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 93 +{ +"origin" "-568 184 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 94 +{ +"origin" "-568 440 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 95 +{ +"origin" "-568 56 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 96 +{ +"origin" "-568 120 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 97 +{ +"origin" "-568 -328 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 98 +{ +"origin" "-568 -392 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 99 +{ +"origin" "-568 -392 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 100 +{ +"origin" "-264 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 101 +{ +"origin" "-392 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 102 +{ +"origin" "-136 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 103 +{ +"origin" "-328 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 104 +{ +"origin" "-200 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 105 +{ +"origin" "-520 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 106 +{ +"origin" "312 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 107 +{ +"origin" "-72 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 108 +{ +"origin" "-136 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 109 +{ +"origin" "-8 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 110 +{ +"origin" "-72 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 111 +{ +"origin" "-8 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 112 +{ +"origin" "184 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 113 +{ +"origin" "-200 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 114 +{ +"origin" "-456 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 115 +{ +"origin" "56 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 116 +{ +"origin" "120 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 117 +{ +"origin" "-520 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 118 +{ +"origin" "696 -136 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 119 +{ +"origin" "376 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 120 +{ +"origin" "248 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 121 +{ +"origin" "504 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 122 +{ +"origin" "696 760 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 123 +{ +"origin" "696 888 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 124 +{ +"origin" "696 824 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 125 +{ +"origin" "696 696 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 126 +{ +"origin" "696 1016 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 127 +{ +"origin" "696 632 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 128 +{ +"origin" "696 568 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 129 +{ +"origin" "440 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 130 +{ +"origin" "696 56 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 131 +{ +"origin" "696 184 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 132 +{ +"origin" "696 -72 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 133 +{ +"origin" "-568 760 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 134 +{ +"origin" "312 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 135 +{ +"origin" "696 -200 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 136 +{ +"origin" "120 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 137 +{ +"origin" "56 1080 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 138 +{ +"origin" "-136 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 139 +{ +"origin" "56 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 140 +{ +"origin" "-200 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 141 +{ +"origin" "-72 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 142 +{ +"origin" "696 120 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 143 +{ +"origin" "696 376 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 144 +{ +"origin" "696 -8 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 145 +{ +"origin" "696 440 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 146 +{ +"origin" "696 120 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 147 +{ +"origin" "696 248 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 148 +{ +"origin" "696 -8 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 149 +{ +"origin" "696 56 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 150 +{ +"origin" "696 184 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 151 +{ +"origin" "696 248 104" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 152 +{ +"origin" "-392 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 153 +{ +"origin" "-520 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 154 +{ +"origin" "-568 -72 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 155 +{ +"origin" "696 -200 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 156 +{ +"origin" "696 -72 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 157 +{ +"origin" "696 760 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 158 +{ +"origin" "696 632 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 159 +{ +"origin" "696 568 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 160 +{ +"origin" "696 952 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 161 +{ +"origin" "696 440 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 162 +{ +"origin" "696 376 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 163 +{ +"origin" "696 -136 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 164 +{ +"origin" "696 824 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 165 +{ +"origin" "696 696 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 166 +{ +"origin" "696 1016 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 167 +{ +"origin" "696 504 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 168 +{ +"origin" "-456 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 169 +{ +"origin" "696 312 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 170 +{ +"origin" "696 888 -184" +"classname" "func_particle_emitter" +"angle" "270" +"_tb_layer" "71" +} +// entity 171 +{ +"origin" "440 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 172 +{ +"origin" "632 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 173 +{ +"origin" "376 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 174 +{ +"origin" "504 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 175 +{ +"origin" "56 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 176 +{ +"origin" "-8 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 177 +{ +"origin" "120 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 178 +{ +"origin" "312 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 179 +{ +"origin" "248 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 180 +{ +"origin" "184 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 181 +{ +"origin" "-72 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 182 +{ +"origin" "568 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 183 +{ +"origin" "696 1080 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 184 +{ +"origin" "376 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 185 +{ +"origin" "504 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 186 +{ +"origin" "632 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 187 +{ +"origin" "248 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 188 +{ +"origin" "184 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 189 +{ +"origin" "248 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 190 +{ +"origin" "376 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 191 +{ +"origin" "-136 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 192 +{ +"origin" "504 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 193 +{ +"origin" "568 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 194 +{ +"origin" "440 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 195 +{ +"origin" "312 -440 -184" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 196 +{ +"origin" "-264 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 197 +{ +"origin" "120 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 198 +{ +"origin" "-328 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 199 +{ +"origin" "696 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 200 +{ +"origin" "440 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} +// entity 201 +{ +"origin" "-8 -440 104" +"classname" "func_particle_emitter" +"_tb_layer" "71" +} diff --git a/map_src/vrstart.map b/map_src/vrstart.map new file mode 100644 index 00000000..eda39ee8 --- /dev/null +++ b/map_src/vrstart.map @@ -0,0 +1,2837 @@ +// Game: Quake +// Format: Standard +// entity 0 +{ +"classname" "worldspawn" +"wad" "C:/OHWorkspace/TrenchBroom/Q.wad" +"light" "300" +"worldtext" "There are two possible\nlocomotion options.$Smooth locomotion is the\nrecommended option.$You can also bind a button\nto 'Teleport' in the\nSteamVR bindings." +// brush 0 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 1 +{ +( 32 8992 8384 ) ( 32 -7392 8384 ) ( 32 8992 -8000 ) slipbotsd 0 32 270 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipbotsd 0 -32 270 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) +0slipbot 32 32 0 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) +0slipbot 32 32 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipbotsd 0 -32 270 1 1 +( 96 -7392 8384 ) ( 96 8992 8384 ) ( 96 8992 -8000 ) slipbotsd 0 32 270 1 1 +} +// brush 2 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 3 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 4 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 5 +{ +( -24 520 176 ) ( 0 512 240 ) ( -72 344 176 ) city6_4 0.785011 -28.0187 0 2.44444 4.03352 +( -72 344 176 ) ( 0 512 240 ) ( 0 384 240 ) city6_4 32.374 -19.2478 90 2 -5.20568 +( 88 536.8000000000003 188.7999999999993 ) ( 0 512 240 ) ( -24 520 176 ) city6_4 59.1635 -39.4009 351.016 2.11688 2.13901 +( -72 344 176 ) ( 0 384 240 ) ( 128 352 208 ) city6_4 2.18861 -31.2442 0 2.10771 2.02943 +( -24 520 176 ) ( 160 528 176 ) ( 88 536.8000000000003 188.7999999999993 ) city6_4 52.3236 11.7734 0 2.09091 0.902909 +( 128 352 208 ) ( 0 384 240 ) ( 128 384 240 ) city6_4 31.8552 35.9458 0 2.21053 2.34541 +( 128 384 176 ) ( 160 528 176 ) ( -24 520 176 ) city6_4 32 -32 0 2 2 +( 0 512 240 ) ( 128 512 240 ) ( 128 384 240 ) city6_4 32 -32 0 2 2 +( 88 536.8000000000003 188.7999999999993 ) ( 128 512 240 ) ( 0 512 240 ) city6_4 47.0733 -5.66277 0 2 2.97754 +( -72 344 176 ) ( 128 352 208 ) ( 128 384 176 ) city6_4 32.0849 -14.9539 11.3099 2.34823 -2.39236 +( 160 528 176 ) ( 128 512 240 ) ( 88 536.8000000000003 188.7999999999993 ) city6_4 26.5962 -63.8725 15.5241 2.07573 2.28998 +( 128 384 240 ) ( 128 512 240 ) ( 160 528 176 ) city6_4 -22.4926 -29.0793 0 2.23529 4.32242 +( 128 352 208 ) ( 160 528 176 ) ( 128 384 176 ) city6_4 23.0016 -27.9739 0 2.51471 4.07487 +( 128 384 240 ) ( 160 528 176 ) ( 128 352 208 ) city6_4 0.468662 -28.023 0 2.42157 4.03361 +} +// brush 6 +{ +( -192 256 176 ) ( -192 192 96 ) ( -192 704 96 ) wgrass1_1 21.7358 28.448 0 1 1 +( -192 704 96 ) ( -179.63025210084788 352 200 ) ( -192 256 176 ) wgrass1_1 24.1474 -6.53467 4.66686 1 1 +( -179.63025210084788 352 200 ) ( -176 296 202.68522888154857 ) ( -192 256 176 ) wgrass1_1 -8.05246 -52.6528 4.76366 1 1 +( -96 648 208 ) ( -179.63025210084788 352 200 ) ( -192 704 96 ) wgrass1_1 24.1474 -6.53467 4.66686 1 1 +( -96 648 208 ) ( -176 296 202.68522888154857 ) ( -179.63025210084788 352 200 ) wgrass1_1 21.4258 38.5945 4.76366 1 1 +( -192 704 96 ) ( -76 718 96 ) ( -96 648 208 ) wgrass1_1 -20.5928 -59.9753 0 1 1 +( 56 168 96 ) ( -192 192 96 ) ( -192 256 176 ) wgrass1_1 1.17828 49.3632 4.08562 1 1 +( -176 296 202.68522888154857 ) ( 192 288 208 ) ( -192 256 176 ) wgrass1_1 21.4258 38.5945 4.76366 1 1 +( -96 648 208 ) ( 192 288 208 ) ( -176 296 202.68522888154857 ) wgrass1_1 21.4258 38.5945 4.76366 1 1 +( 192 288 208 ) ( 56 168 96 ) ( -192 256 176 ) wgrass1_1 15.5252 40.8665 4.76366 1 1 +( 56 168 96 ) ( 320 192 96 ) ( 336 424 96 ) wgrass1_1 0 0 0 1 1 +( -96 648 208 ) ( -76 718 96 ) ( 320 704 96 ) wgrass1_1 -17.8815 -59.9915 0 1 1 +( 192 288 208 ) ( 320 192 96 ) ( 56 168 96 ) wgrass1_1 22.8036 -16.8397 4.76366 1 1 +( -96 648 208 ) ( 256 576 176 ) ( 192 288 208 ) wgrass1_1 -12.1401 6.4073 356.955 1 1 +( 320 704 96 ) ( 256 576 176 ) ( -96 648 208 ) wgrass1_1 20.378 -37.934 349.657 1 1 +( 256 576 176 ) ( 320 192 96 ) ( 192 288 208 ) wgrass1_1 -2.85219 -38.8333 77.4712 1 1 +( 341.48571428570062 608 96 ) ( 256 576 176 ) ( 320 704 96 ) wgrass1_1 58.6595 5.88304 354.42 1 1 +( 336 424 96 ) ( 320 192 96 ) ( 256 576 176 ) wgrass1_1 -63.8217 -63.0989 78.9861 1 1 +( 336 424 96 ) ( 256 576 176 ) ( 341.48571428570062 608 96 ) wgrass1_1 -57.3016 -37.1865 81.6253 1 1 +} +// brush 7 +{ +( -192 -288 288 ) ( -192 -286 288 ) ( -192 -288 289 ) quakevrlogo 640 64 180 1 -0.5 +( -192 -288 288 ) ( -192 -288 289 ) ( -191 -288 288 ) quakevrlogo 640 64 180 0.5 -0.5 +( -192 -288 288 ) ( -191 -288 288 ) ( -192 -286 288 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 320 -254 544 ) ( 321 -256 544 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 321 -256 544 ) ( 320 -256 545 ) quakevrlogo 640 64 180 0.5 -0.5 +( 320 -256 544 ) ( 320 -256 545 ) ( 320 -254 544 ) quakevrlogo 640 64 180 1 -0.5 +} +// brush 8 +{ +( -448 -288 288 ) ( -448 -286 288 ) ( -448 -288 289 ) city5_4 -10 8 0 8 4 +( -448 -288 288 ) ( -448 -288 289 ) ( -447 -288 288 ) city5_4 20 8 0 4 4 +( -448 -288 288 ) ( -447 -288 288 ) ( -448 -286 288 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -192 -254 544 ) ( -191 -256 544 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -191 -256 544 ) ( -192 -256 545 ) city5_4 20 8 0 4 4 +( -192 -256 544 ) ( -192 -256 545 ) ( -192 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 9 +{ +( 320 -288 288 ) ( 320 -286 288 ) ( 320 -288 289 ) city5_4 -10 8 0 8 4 +( 320 -288 288 ) ( 320 -288 289 ) ( 321 -288 288 ) city5_4 20 8 0 4 4 +( 320 -288 288 ) ( 321 -288 288 ) ( 320 -286 288 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 576 -254 544 ) ( 577 -256 544 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 577 -256 544 ) ( 576 -256 545 ) city5_4 20 8 0 4 4 +( 576 -256 544 ) ( 576 -256 545 ) ( 576 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 10 +{ +( 576 -304 -192 ) ( 576 -303.00339673913044 -192 ) ( 576 -304 -189 ) city6_4 -16 -63 0 1 1 +( 576 -304 -192 ) ( 576 -304 -189 ) ( 577 -304 -192 ) city6_4 0 -63 0 1 1 +( 576 -304 -192 ) ( 577 -304 -192 ) ( 576 -303.00339673913044 -192 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -239.22078804347998 576 ) ( 641 -240.21739130434952 576 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 641 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) ( 640 -239.22078804347998 576 ) city6_4 0 -63 0 1 1 +} +// brush 11 +{ +( -512 -304 -192 ) ( -512 -303.00339673913044 -192 ) ( -512 -304 -189 ) city6_4 320 -63 0 1 1 +( -512 -304 -192 ) ( -512 -304 -189 ) ( -511 -304 -192 ) city6_4 320 -63 0 1 1 +( -512 -304 -192 ) ( -511 -304 -192 ) ( -512 -303.00339673913044 -192 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -448 -239.22078804347996 576 ) ( -447 -240.21739130434949 576 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -447 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) ( -448 -239.22078804347996 576 ) city6_4 303 -63 0 1 1 +} +// brush 12 +{ +( -1024 -831.5 704 ) ( -1024 -830.22799545712599 704 ) ( -1024 -831.5 704.5 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1024 -831.5 704.5 ) ( -1023.042253521126 -831.5 704 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1023.042253521126 -831.5 704 ) ( -1024 -830.22799545712599 704 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1409.7720045428748 736 ) ( 1152.9577464788731 1408.5 736 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152.9577464788731 1408.5 736 ) ( 1152 1408.5 736.5 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1408.5 736.5 ) ( 1152 1409.7720045428748 736 ) sky4 0 0 0 1 1 +} +// brush 13 +{ +( -576 -448 -256 ) ( -576 -446.85714285714261 -256 ) ( -576 -448 -255 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -576 -448 -255 ) ( -574.74999999999977 -448 -256 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -574.74999999999977 -448 -256 ) ( -576 -446.85714285714261 -256 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1089.1428571428576 -192 ) ( 705.25000000000034 1088 -192 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 705.25000000000034 1088 -192 ) ( 704 1088 -191 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1088 -191 ) ( 704 1089.1428571428576 -192 ) rock5_2 0 0 0 1 1 +} +// brush 14 +{ +( -576 -448 -192 ) ( -576 -447 -192 ) ( -576 -448 -191 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -576 -448 -191 ) ( -574.74999999999977 -448 -192 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -574.74999999999977 -448 -192 ) ( -576 -447 -192 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1089 96 ) ( 705.25000000000011 1088 96 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 705.25000000000011 1088 96 ) ( 704 1088 97 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1088 97 ) ( 704 1089 96 ) *04awater1 0 0 0 1 1 +} +// brush 15 +{ +( 1152 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) ( 1152 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152.4999999999998 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184.5000000000005 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152 -830.22799545712599 736 ) ( 1152.4999999999998 -831.5 736 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) ( 1184.5000000000005 1408.5 -1440 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 16 +{ +( -1056 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) ( -1056 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1055.5000000000002 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1023.4999999999995 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1056 -830.22799545712599 736 ) ( -1055.5000000000002 -831.5 736 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) ( -1023.4999999999995 1408.5 -1440 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 17 +{ +( -1055.5 1440 736 ) ( -1055.5 1439.5000000000005 736 ) ( -1055.5 1440 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1185.772004542875 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1407.4999999999991 -1440 ) ( 1185.772004542875 1408 -1440 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1054.2279954571259 1440 736 ) ( -1055.5 1439.5000000000005 736 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1055.5 1440 735.04225352112644 ) ( -1054.2279954571259 1440 736 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) ( 1184.5 1407.4999999999991 -1440 ) sky4 0 0 0 1 1 +} +// brush 18 +{ +( -1055.5 -832 736 ) ( -1055.5 -832.49999999999955 736 ) ( -1055.5 -832 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1185.772004542875 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864.50000000000091 -1440 ) ( 1185.772004542875 -864 -1440 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1054.2279954571259 -832 736 ) ( -1055.5 -832.49999999999955 736 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1055.5 -832 735.04225352112644 ) ( -1054.2279954571259 -832 736 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) ( 1184.5 -864.50000000000091 -1440 ) sky4 0 0 0 1 1 +} +// brush 19 +{ +( 216 48 96 ) ( 216 50.5 96 ) ( 216 48 98.5 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 216 48 98.5 ) ( 217 48 96 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 217 48 96 ) ( 216 50.5 96 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 288 90.5 108 ) ( 289 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 289 88 116 ) ( 288 88 118.5 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 288 88 118.5 ) ( 288 90.5 116 ) rock3_7 0 0 0 1 1 +} +// brush 20 +{ +( 216 88 108 ) ( 216 90.5 108 ) ( 216 88 110.5 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 216 88 110.5 ) ( 217 88 108 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 217 88 108 ) ( 216 90.5 108 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 288 130.5 120 ) ( 289 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 289 128 128 ) ( 288 128 130.5 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 288 128 130.5 ) ( 288 130.5 128 ) rock3_7 0 0 0 1 1 +} +// brush 21 +{ +( 216 128 120 ) ( 216 130.5 120 ) ( 216 128 122.5 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 216 128 122.5 ) ( 217 128 120 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 217 128 120 ) ( 216 130.5 120 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 288 170.5 132 ) ( 289 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 289 168 140 ) ( 288 168 142.5 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 288 168 142.5 ) ( 288 170.5 140 ) rock3_7 0 0 0 1 1 +} +// brush 22 +{ +( 216 168 132 ) ( 216 170.5 132 ) ( 216 168 134.5 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 216 168 134.5 ) ( 217 168 132 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 217 168 132 ) ( 216 170.5 132 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 288 210.5 144 ) ( 289 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 289 208 152 ) ( 288 208 154.5 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 288 208 154.5 ) ( 288 210.5 152 ) rock3_7 0 0 0 1 1 +} +// brush 23 +{ +( 216 208 144 ) ( 216 210.5 144 ) ( 216 208 146.5 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 216 208 146.5 ) ( 217 208 144 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 217 208 144 ) ( 216 210.5 144 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 288 250.5 156 ) ( 289 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 289 248 164 ) ( 288 248 166.5 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 288 248 166.5 ) ( 288 250.5 164 ) rock3_7 0 0 0 1 1 +} +// brush 24 +{ +( 216 248 156 ) ( 216 250.50000000000003 156 ) ( 216 248 158.5 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 216 248 158.5 ) ( 217 248 156 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 217 248 156 ) ( 216 250.50000000000003 156 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 288 290.5 168 ) ( 289 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 289 288 176 ) ( 288 288 178.5 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 288 288 178.5 ) ( 288 290.5 176 ) rock3_7 0 0 0 1 1 +} +// brush 25 +{ +( 216 288 168 ) ( 216 290.5 168 ) ( 216 288 170.5 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 216 288 170.5 ) ( 217 288 168 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 217 288 168 ) ( 216 290.5 168 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 288 330.5 180 ) ( 289 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 289 328 188 ) ( 288 328 190.5 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 288 328 190.5 ) ( 288 330.5 188 ) rock3_7 0 0 0 1 1 +} +// brush 26 +{ +( 216 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) ( 216 328 182.22774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 216 328 182.22774480533857 ) ( 217 328 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 217 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 191.72774480533857 ) ( 288 370.5 191.72774480533857 ) ( 289 368 191.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 289 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) ( 288 370.5 199.72774480533857 ) rock3_7 0 0 0 1 1 +} +// brush 27 +{ +( 216 368 191.70557387552577 ) ( 216 370.5 191.70557387552577 ) ( 216 368 194.20557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 191.70557387552577 ) ( 216 368 194.20557387552577 ) ( 217 368 191.70557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 192 ) ( 217 368 192 ) ( 216 370.5 192 ) rock3_7 0 0 0 1 1 +( 288 408 203.70557387552577 ) ( 288 410.5 203.70557387552577 ) ( 289 408 203.70557387552577 ) rock3_7 0 0 0 1 1 +( 288 496 211.70557387552577 ) ( 289 496 211.70557387552577 ) ( 288 496 214.20557387552577 ) rock3_7 0 0 0 1 1 +( 288 408 211.70557387552577 ) ( 288 408 214.20557387552577 ) ( 288 410.5 211.70557387552577 ) rock3_7 0 0 0 1 1 +} +// brush 28 +{ +( 144 368 156.04154748824237 ) ( 144 370.5 156.04154748824237 ) ( 144 368 158.54154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 204.04154748824237 ) ( 216 410.5 204.04154748824237 ) ( 217 408 204.54154748824226 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 144 368 158.54154748824237 ) ( 145 368 156.54154748824226 ) rock3_7 0 0 0 1 1 +( 216 496 212.04154748824237 ) ( 217 496 212.54154748824226 ) ( 216 496 214.54154748824237 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 145 368 156.54154748824226 ) ( 144 370.5 156.04154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 212.04154748824237 ) ( 216 408 214.54154748824237 ) ( 216 410.5 212.04154748824237 ) rock3_7 0 0 0 1 1 +} +// brush 29 +{ +( 280 488 96 ) ( 280 489 96 ) ( 280 488 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 280 488 120.5 ) ( 281 488 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 281 488 96 ) ( 280 489 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 192 ) ( 288 497 192 ) ( 289 496 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 289 496 194 ) ( 288 496 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 288 496 218.5 ) ( 288 497 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 30 +{ +( 280 368 96 ) ( 280 369 96 ) ( 280 368 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 280 368 120.5 ) ( 281 368 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 281 368 96 ) ( 280 369 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 192 ) ( 288 377 192 ) ( 289 376 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 289 376 194 ) ( 288 376 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 288 376 218.5 ) ( 288 377 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 31 +{ +( 280 320 96 ) ( 280 321 96 ) ( 280 320 114 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 280 320 114 ) ( 281 320 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 281 320 96 ) ( 280 321 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 329 168 ) ( 289 328 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 289 328 168 ) ( 288 328 186 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 328 186 ) ( 288 329 168 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 32 +{ +( 280 280 84 ) ( 280 281 84 ) ( 280 280 102 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 84 ) ( 280 280 102 ) ( 281 280 84 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 96 ) ( 281 280 96 ) ( 280 281 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 289 156 ) ( 289 288 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 289 288 156 ) ( 288 288 174 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 288 174 ) ( 288 289 156 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 33 +{ +( 280 240 72 ) ( 280 241 72 ) ( 280 240 90 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 72 ) ( 280 240 90 ) ( 281 240 72 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 96 ) ( 281 240 96 ) ( 280 241 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 249 144 ) ( 289 248 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 289 248 144 ) ( 288 248 162 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 248 162 ) ( 288 249 144 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 34 +{ +( 280 200 60 ) ( 280 201 60 ) ( 280 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 60 ) ( 280 200 78 ) ( 281 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 96 ) ( 281 200 96 ) ( 280 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 209 132 ) ( 289 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 289 208 132 ) ( 288 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 208 150 ) ( 288 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 35 +{ +( 280 160 48 ) ( 280 161 48 ) ( 280 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 48 ) ( 280 160 66 ) ( 281 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 96 ) ( 281 160 96 ) ( 280 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 169 120 ) ( 289 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 289 168 120 ) ( 288 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 168 138 ) ( 288 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 36 +{ +( 280 120 36 ) ( 280 121 36 ) ( 280 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 36 ) ( 280 120 54 ) ( 281 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 96 ) ( 281 120 96 ) ( 280 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 129 108 ) ( 289 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 289 128 108 ) ( 288 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 128 126 ) ( 288 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 37 +{ +( -601 -159 -224 ) ( -567 896 -211 ) ( -254 696 96 ) rock5_2 -99.7577 -56.0318 91.3726 1.00041 -1.56658 +( -254 696 96 ) ( -236 34 96 ) ( -601 -159 -224 ) rock5_2 -99.7577 -56.0318 91.3726 1.00041 -1.56658 +( -254 696 96 ) ( -567 896 -211 ) ( -236 724 96 ) rock5_2 25.0672 -91.2499 57.2648 1.41747 -1.15095 +( -567 896 -211 ) ( 26 758.41632653068245 96 ) ( -236 724 96 ) rock5_2 54.115 -3.54416 0 1 1.01977 +( -601 -159 -224 ) ( -236 34 96 ) ( 254 16 96 ) rock5_2 -0.190712 -0.174206 0 0.995935 1.02211 +( 466.80769235638519 798 -213.29615384619328 ) ( -567 896 -211 ) ( -601 -159 -224 ) rock5_2 14.8242 -25.4298 0.26393 1.17597 1.16455 +( 399.44680855628229 368 96 ) ( 360 34 96 ) ( 254 16 96 ) rock5_2 0 0 0 1 1 +( -601 -159 -224 ) ( 412 -30 -207 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 14.8242 -25.4298 0.26393 1.17597 1.16455 +( 382 750 64 ) ( 26 758.41632653068245 96 ) ( -567 896 -211 ) rock5_2 54.115 -3.54416 0 1 1.01977 +( 254 736 96 ) ( 26 758.41632653068245 96 ) ( 382 750 64 ) rock5_2 61.8293 -4.19315 0 0.991304 1.02155 +( 382 750 64 ) ( 360 724 96 ) ( 254 736 96 ) rock5_2 54.0778 -3.51178 0 1 1.01968 +( 382 750 64 ) ( -567 896 -211 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 47.5125 -4.02612 0 0.998117 1.02231 +( 254 16 96 ) ( 412 -30 -207 ) ( -601 -159 -224 ) rock5_2 -32.5638 -0.0357803 0 1.0204 1.01254 +( 254 16 96 ) ( 360 34 96 ) ( 412 -30 -207 ) rock5_2 -23.0535 -0.0373173 0 1.04132 1.00839 +( 399.44680855628229 368 96 ) ( 360 724 96 ) ( 382 750 64 ) rock5_2 27.7235 -58.1963 4.24132 1.18369 1.03307 +( 399.44680855628229 368 96 ) ( 382 750 64 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 115.415 -52.8551 4.14293 1.21176 0.997091 +( 412 -30 -207 ) ( 360 34 96 ) ( 399.44680855628229 368 96 ) rock5_2 119.865 -53.6034 4.02599 1.24689 0.989531 +( 412 -30 -207 ) ( 399.44680855628229 368 96 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 115.415 -52.8551 4.14293 1.21176 0.997091 +} +// brush 38 +{ +( -236 112 114 ) ( -236 34 96 ) ( -236 303 96 ) rock5_2 16.815 0 0 1 1 +( -226 41 114 ) ( -236 34 96 ) ( -236 112 114 ) rock5_2 19.3038 -0.889084 0 1 1 +( -186 34 114 ) ( -236 34 96 ) ( -226 41 114 ) rock5_2 110.083 -0.0819645 0 1 1 +( -116 34 96 ) ( -236 34 96 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -236 34 96 ) ( -116 34 96 ) rock5_2 0 0 0 1 1 +( -236 112 114 ) ( -186 112 114 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -186 112 114 ) ( -236 112 114 ) rock5_2 -3.95884 3.85601 0 1 1 +( -186 34 114 ) ( -186 112 114 ) ( -116 34 96 ) rock5_2 -9.04656 -65.2849 90 1 1 +( -129 117 96 ) ( -186 112 114 ) ( -236 303 96 ) rock5_2 -43.1704 -70.9503 299.911 1 1 +( -116 34 96 ) ( -186 112 114 ) ( -129 117 96 ) rock5_2 -9.80276 -60.6771 98.8998 1 1 +} +// brush 39 +{ +( 216 120 36 ) ( 216 121 36 ) ( 216 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 36 ) ( 216 120 54 ) ( 217 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 96 ) ( 217 120 96 ) ( 216 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 129 108 ) ( 225 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 225 128 108 ) ( 224 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 128 126 ) ( 224 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 40 +{ +( 216 160 48 ) ( 216 161 48 ) ( 216 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 48 ) ( 216 160 66 ) ( 217 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 96 ) ( 217 160 96 ) ( 216 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 169 120 ) ( 225 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 225 168 120 ) ( 224 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 168 138 ) ( 224 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 41 +{ +( 216 200 60 ) ( 216 201 60 ) ( 216 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 60 ) ( 216 200 78 ) ( 217 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 96 ) ( 217 200 96 ) ( 216 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 209 132 ) ( 225 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 225 208 132 ) ( 224 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 208 150 ) ( 224 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 42 +{ +( 216 100 108 ) ( 216 88 108 ) ( 216 88 96 ) rock3_7 0 0 0 1 1.11111 +( 216 88 96 ) ( 216 88 108 ) ( 288 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 216 88 108 ) ( 216 100 108 ) rock3_7 0 0 0 1 1 +( 288 100 108 ) ( 216 100 108 ) ( 216 88 96 ) rock3_7 0 -52 0 1 1 +( 288 88 96 ) ( 288 88 108 ) ( 288 100 108 ) rock3_7 0 0 0 1 1.11111 +} +// brush 43 +{ +( 216 140 120 ) ( 216 128 120 ) ( 216 128 108 ) rock3_7 0 0 0 1 1.11111 +( 216 128 108 ) ( 216 128 120 ) ( 288 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 216 128 120 ) ( 216 140 120 ) rock3_7 0 0 0 1 1 +( 288 140 120 ) ( 216 140 120 ) ( 216 128 108 ) rock3_7 0 -52 0 1 1 +( 288 128 108 ) ( 288 128 120 ) ( 288 140 120 ) rock3_7 0 0 0 1 1.11111 +} +// brush 44 +{ +( 216 180 132 ) ( 216 168 132 ) ( 216 168 120 ) rock3_7 0 0 0 1 1.11111 +( 216 168 120 ) ( 216 168 132 ) ( 288 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 216 168 132 ) ( 216 180 132 ) rock3_7 0 0 0 1 1 +( 288 180 132 ) ( 216 180 132 ) ( 216 168 120 ) rock3_7 0 -52 0 1 1 +( 288 168 120 ) ( 288 168 132 ) ( 288 180 132 ) rock3_7 0 0 0 1 1.11111 +} +// brush 45 +{ +( 216 220 144 ) ( 216 208 144 ) ( 216 208 132 ) rock3_7 0 0 0 1 1.11111 +( 216 208 132 ) ( 216 208 144 ) ( 288 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 216 208 144 ) ( 216 220 144 ) rock3_7 0 0 0 1 1 +( 288 220 144 ) ( 216 220 144 ) ( 216 208 132 ) rock3_7 0 -52 0 1 1 +( 288 208 132 ) ( 288 208 144 ) ( 288 220 144 ) rock3_7 0 0 0 1 1.11111 +} +// brush 46 +{ +( 216 260 156 ) ( 216 248 156 ) ( 216 248 144 ) rock3_7 0 0 0 1 1.11111 +( 216 248 144 ) ( 216 248 156 ) ( 288 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 216 248 156 ) ( 216 260 156 ) rock3_7 0 0 0 1 1 +( 288 260 156 ) ( 216 260 156 ) ( 216 248 144 ) rock3_7 0 -52 0 1 1 +( 288 248 144 ) ( 288 248 156 ) ( 288 260 156 ) rock3_7 0 0 0 1 1.11111 +} +// brush 47 +{ +( 216 300 168 ) ( 216 288 168 ) ( 216 288 156 ) rock3_7 0 0 0 1 1.11111 +( 216 288 156 ) ( 216 288 168 ) ( 288 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 216 288 168 ) ( 216 300 168 ) rock3_7 0 0 0 1 1 +( 288 300 168 ) ( 216 300 168 ) ( 216 288 156 ) rock3_7 0 -52 0 1 1 +( 288 288 156 ) ( 288 288 168 ) ( 288 300 168 ) rock3_7 0 0 0 1 1.11111 +} +// brush 48 +{ +( 216 340 180 ) ( 216 328 180 ) ( 216 328 168 ) rock3_7 0 0 0 1 1.11111 +( 216 328 168 ) ( 216 328 180 ) ( 288 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 216 328 180 ) ( 216 340 180 ) rock3_7 0 0 0 1 1 +( 288 340 180 ) ( 216 340 180 ) ( 216 328 168 ) rock3_7 0 -52 0 1 1 +( 288 328 168 ) ( 288 328 180 ) ( 288 340 180 ) rock3_7 0 0 0 1 1.11111 +} +// brush 49 +{ +( 216 380 192 ) ( 216 368 192 ) ( 216 368 180 ) rock3_7 0 0 0 1 1.11111 +( 216 368 180 ) ( 216 368 192 ) ( 288 368 192 ) rock3_7 0 0 0 1 1 +( 288 368 192 ) ( 216 368 192 ) ( 216 380 192 ) rock3_7 0 0 0 1 1 +( 288 380 192 ) ( 216 380 192 ) ( 216 368 180 ) rock3_7 0 -52 0 1 1 +( 288 368 180 ) ( 288 368 192 ) ( 288 380 192 ) rock3_7 0 0 0 1 1.11111 +} +// brush 50 +{ +( 280 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) ( 280 488 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 280 488 228.45753068742539 ) ( 281 488 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 281 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 236 ) ( 288 497 236 ) ( 289 496 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 289 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) ( 288 497 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 51 +{ +( 280 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) ( 280 368 228.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 280 368 228.20557387552628 ) ( 281 368 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 281 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 235.74804318810089 ) ( 288 377 235.74804318810089 ) ( 289 376 235.74804318810089 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 289 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) ( 288 377 301.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 52 +{ +( 280 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) ( 280 430 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 280 430 228.45753068742539 ) ( 281 430 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 281 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 236 ) ( 288 439 236 ) ( 289 438 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 289 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) ( 288 439 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 53 +{ +( 280 429.70557387552628 244 ) ( 280 429.70557387552628 243 ) ( 280 454.20557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 280 368 244 ) ( 281 368 244 ) ( 280 368 243 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 289 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) wood1_1 0 0 270 0.5 0.5 +( 280 429.70557387552628 244 ) ( 280 454.20557387552628 244 ) ( 281 429.70557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 288 496 236 ) ( 288 496 235 ) ( 289 496 236 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) ( 288 527.70557387552628 235 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 54 +{ +( 280 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) ( 280 328 216.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 280 328 216.45753068742539 ) ( 281 328 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 281 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 232 ) ( 288 337 232 ) ( 289 336 232 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 289 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) ( 288 337 289.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 55 +{ +( 280 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) ( 280 288 204.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 280 288 204.45753068742539 ) ( 281 288 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 281 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 220 ) ( 288 297 220 ) ( 289 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 289 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) ( 288 297 277.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 56 +{ +( 280 248 168 ) ( 280 249 168 ) ( 280 248 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 280 248 192.50000000000051 ) ( 281 248 168 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 281 248 168 ) ( 280 249 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 208 ) ( 288 257 208 ) ( 289 256 208 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 289 256 266 ) ( 288 256 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 288 256 290.50000000000051 ) ( 288 257 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 57 +{ +( 280 208 156 ) ( 280 209 156 ) ( 280 208 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 280 208 180.50000000000051 ) ( 281 208 156 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 281 208 156 ) ( 280 209 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 196 ) ( 288 217 196 ) ( 289 216 196 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 289 216 254 ) ( 288 216 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 288 216 278.50000000000051 ) ( 288 217 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 58 +{ +( 280 168 144 ) ( 280 169 144 ) ( 280 168 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 280 168 168.50000000000051 ) ( 281 168 144 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 281 168 144 ) ( 280 169 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 184 ) ( 288 177 184 ) ( 289 176 184 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 289 176 242 ) ( 288 176 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 288 176 266.50000000000051 ) ( 288 177 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 59 +{ +( 280 128 132 ) ( 280 129 132 ) ( 280 128 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 280 128 156.50000000000051 ) ( 281 128 132 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 281 128 132 ) ( 280 129 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 172 ) ( 288 137 172 ) ( 289 136 172 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 289 136 230 ) ( 288 136 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 288 136 254.50000000000051 ) ( 288 137 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 60 +{ +( 280 88 120 ) ( 280 89 120 ) ( 280 88 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 280 88 144.50000000000051 ) ( 281 88 120 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 281 88 120 ) ( 280 89 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 160 ) ( 288 97 160 ) ( 289 96 160 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 289 96 218 ) ( 288 96 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 288 96 242.50000000000051 ) ( 288 97 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 61 +{ +( 280 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) ( 280 48 138.57441256965544 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 280 48 138.57441256965544 ) ( 281 48 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 281 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 148 ) ( 288 57 148 ) ( 289 56 148 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 289 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) ( 288 57 230.42505821634469 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 62 +{ +( 280 56 148 ) ( 280 56 147 ) ( 280 80.500000000000512 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 281 56 148 ) ( 280 56 147 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 280 80.500000000000512 151.05844094111507 ) ( 281 56 148 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 289 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 88.042469312575122 144 ) ( 288 88.042469312575122 143 ) ( 289 88.042469312575122 144 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) ( 288 154 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 63 +{ +( 280 96 160 ) ( 280 96 159 ) ( 280 120.50000000000051 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 281 96 160 ) ( 280 96 159 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 280 120.50000000000051 163.05844094111507 ) ( 281 96 160 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 289 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 128.04246931257512 156 ) ( 288 128.04246931257512 155 ) ( 289 128.04246931257512 156 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) ( 288 194 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 64 +{ +( 280 136 172 ) ( 280 136 171 ) ( 280 160.50000000000051 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 281 136 172 ) ( 280 136 171 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 280 160.50000000000051 175.05844094111507 ) ( 281 136 172 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 289 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 168.04246931257512 168 ) ( 288 168.04246931257512 167 ) ( 289 168.04246931257512 168 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) ( 288 234 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 65 +{ +( 280 176 184 ) ( 280 176 183 ) ( 280 200.50000000000051 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 281 176 184 ) ( 280 176 183 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 280 200.50000000000051 187.05844094111507 ) ( 281 176 184 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 289 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 208.04246931257512 180 ) ( 288 208.04246931257512 179 ) ( 289 208.04246931257512 180 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) ( 288 274 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 66 +{ +( 280 216 196 ) ( 280 216 195 ) ( 280 240.50000000000051 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 281 216 196 ) ( 280 216 195 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 280 240.50000000000051 199.05844094111507 ) ( 281 216 196 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 289 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 248.04246931257512 192 ) ( 288 248.04246931257512 191 ) ( 289 248.04246931257512 192 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) ( 288 314 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 67 +{ +( 280 256 208 ) ( 280 256 207 ) ( 280 280.50000000000051 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 281 256 208 ) ( 280 256 207 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 280 280.50000000000051 211.05844094111507 ) ( 281 256 208 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 289 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 288.04246931257512 204 ) ( 288 288.04246931257512 203 ) ( 289 288.04246931257512 204 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) ( 288 354 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 68 +{ +( 280 296 220 ) ( 280 296 219 ) ( 280 320.50000000000051 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 281 296 220 ) ( 280 296 219 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 280 320.50000000000051 223.05844094111507 ) ( 281 296 220 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 289 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 328.04246931257512 216 ) ( 288 328.04246931257512 215 ) ( 289 328.04246931257512 216 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) ( 288 394 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 69 +{ +( 280 336 232 ) ( 280 336 231 ) ( 280 360.50000000000051 235.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 281 336 232 ) ( 280 336 231 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 280 360.50000000000051 235.05844094111507 ) ( 281 336 232 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 289 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 368.04246931257512 228 ) ( 288 368.04246931257512 227 ) ( 289 368.04246931257512 228 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) ( 288 434 235.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 70 +{ +( 216 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) ( 217 47.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 217 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 148 ) ( 224 56.957530687424878 148 ) ( 225 55.957530687424878 148 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 225 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) ( 224 56.957530687424878 230.42505821634472 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 71 +{ +( 216 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) ( 216 80.45753068742539 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 217 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 216 80.45753068742539 151.05844094111507 ) ( 217 55.957530687424878 148 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 225 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 88 144 ) ( 224 88 143 ) ( 225 88 144 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) ( 224 153.95753068742488 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 72 +{ +( 216 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) ( 217 87.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 217 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 160 ) ( 224 96.957530687424878 160 ) ( 225 95.957530687424878 160 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 225 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) ( 224 96.957530687424878 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 73 +{ +( 216 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) ( 216 120.45753068742539 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 217 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 216 120.45753068742539 163.05844094111507 ) ( 217 95.957530687424878 160 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 225 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 128 156 ) ( 224 128 155 ) ( 225 128 156 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) ( 224 193.95753068742488 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 74 +{ +( 216 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) ( 217 127.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 217 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 172 ) ( 224 136.95753068742488 172 ) ( 225 135.95753068742488 172 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 225 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) ( 224 136.95753068742488 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 75 +{ +( 216 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) ( 216 160.45753068742539 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 217 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 216 160.45753068742539 175.05844094111507 ) ( 217 135.95753068742488 172 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 225 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 168 168 ) ( 224 168 167 ) ( 225 168 168 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) ( 224 233.95753068742488 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 76 +{ +( 216 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) ( 217 167.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 217 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 184 ) ( 224 176.95753068742488 184 ) ( 225 175.95753068742488 184 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 225 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) ( 224 176.95753068742488 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 77 +{ +( 216 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) ( 216 200.45753068742539 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 217 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 216 200.45753068742539 187.05844094111507 ) ( 217 175.95753068742488 184 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 225 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 208 180 ) ( 224 208 179 ) ( 225 208 180 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) ( 224 273.95753068742488 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 78 +{ +( 216 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) ( 217 207.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 217 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 196 ) ( 224 216.95753068742488 196 ) ( 225 215.95753068742488 196 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 225 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) ( 224 216.95753068742488 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 79 +{ +( 216 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) ( 216 240.45753068742539 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 217 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 216 240.45753068742539 199.05844094111507 ) ( 217 215.95753068742488 196 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 225 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 248 192 ) ( 224 248 191 ) ( 225 248 192 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) ( 224 313.95753068742488 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 80 +{ +( 216 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) ( 217 247.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 217 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 208 ) ( 224 256.95753068742488 208 ) ( 225 255.95753068742488 208 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 225 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) ( 224 256.95753068742488 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 81 +{ +( 216 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) ( 216 280.45753068742539 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 217 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 216 280.45753068742539 211.05844094111507 ) ( 217 255.95753068742488 208 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 225 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 288 204 ) ( 224 288 203 ) ( 225 288 204 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) ( 224 353.95753068742488 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 82 +{ +( 216 288 180 ) ( 216 289 180 ) ( 216 288 204.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 216 288 204.50000000000051 ) ( 217 288 180 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 217 288 180 ) ( 216 289 180 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 220 ) ( 224 297 220 ) ( 225 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 225 296 278 ) ( 224 296 302.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 224 296 302.50000000000051 ) ( 224 297 278 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 83 +{ +( 176 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) ( 176 288 216.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 176 288 216.30347303743031 ) ( 177 288 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 177 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 231.8034730374298 ) ( 184 297 231.8034730374298 ) ( 185 296 231.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 185 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) ( 184 297 289.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 84 +{ +( 184 296 216 ) ( 184 296 215 ) ( 184 297 216 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 118.04246931257512 297 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 288 219 ) ( 191.54246931257461 288 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) ( 118.04246931257512 296 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 191.54246931257461 288 223.05844094111507 ) ( 216.04246931257512 289 220 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 289 220 ) ( 216.04246931257512 288 219 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 85 +{ +( -64 48 96 ) ( -32 136 96 ) ( -32 136 104 ) rock5_2 0 0 0 1 1 +( -32 136 96 ) ( 144 160 96 ) ( -32 136 104 ) rock5_2 -2.90909 0 0 1 1 +( -32 136 104 ) ( -8 72 104 ) ( -64 48 96 ) rock5_2 -43.879 26.0995 110.556 1 1 +( -32 136 104 ) ( 96 104 112 ) ( -8 72 104 ) rock5_2 0 0 0 1 1 +( -64 48 96 ) ( -8 72 104 ) ( 128 64 104 ) rock5_2 110.318 -62.5274 2.07141 1 1 +( -8 72 104 ) ( 96 104 112 ) ( 128 64 104 ) rock5_2 0 0 0 1 1 +( -64 48 96 ) ( 152 56 96 ) ( 144 160 96 ) rock5_2 0 0 0 1 1 +( 144 160 96 ) ( 96 104 112 ) ( -32 136 104 ) rock5_2 17.3006 6.65796 345.964 1 1 +( 128 64 104 ) ( 152 56 96 ) ( -64 48 96 ) rock5_2 -9.94592 -54.1466 3.01279 1 1 +( 128 64 104 ) ( 96 104 112 ) ( 144 160 96 ) rock5_2 70.3425 4.33401 105.255 1 1 +( 144 160 96 ) ( 152 56 96 ) ( 128 64 104 ) rock5_2 -102.044 -5.47133 90 1 1 +} +// brush 86 +{ +( -573 354 -192 ) ( -576 982 -192 ) ( -576 35 96 ) rock5_2 0 0 0 1 1 +( -576 982 -192 ) ( -536 883 95 ) ( -576 35 96 ) rock5_2 0 0 0 1 1 +( -576 35 96 ) ( -536 883 95 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -576 35 96 ) ( -346 354 -192 ) ( -573 354 -192 ) rock5_2 0 34 0 1 1 +( -573 354 -192 ) ( -346 354 -192 ) ( -346 747 -192 ) rock5_2 0 0 0 1 1 +( -536 883 95 ) ( -319 866 97 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -271 78 68 ) ( -346 354 -192 ) ( -576 35 96 ) rock5_2 115.919 96.1237 0 1 1 +( -576 982 -192 ) ( -319 866 97 ) ( -536 883 95 ) rock5_2 126 0 0 1 1 +( -271 78 68 ) ( -576 35 96 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -319 866 97 ) ( -245.61737958491773 821 96.220196353471479 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -282 822 109.52639018344834 ) ( -245.61737958491773 821 96.220196353471479 ) ( -271 78 68 ) rock5_2 0 0 0 1 1 +( -576 982 -192 ) ( -245.61737958491773 821 96.220196353471479 ) ( -319 866 97 ) rock5_2 108.883 -64.1155 0 1 1 +( -346 747 -192 ) ( -245.61737958491773 821 96.220196353471479 ) ( -576 982 -192 ) rock5_2 -48.8613 -112.517 0 1 1 +( -346 354 -192 ) ( -245.61737958491773 821 96.220196353471479 ) ( -346 747 -192 ) rock5_2 -97 -97 0 1 1 +( -271 78 68 ) ( -245.61737958491773 821 96.220196353471479 ) ( -346 354 -192 ) rock5_2 -34.4345 -80.7516 0 1 1 +} +// brush 87 +{ +( -288 304 200 ) ( -288 305 200 ) ( -288 304 201 ) wizwood1_4 0 0 0 1 1 +( -288 304 200 ) ( -288 304 201 ) ( -287 304 200 ) wizwood1_4 0 0 0 1 1 +( -288 304 200 ) ( -287 304 200 ) ( -288 305 200 ) wizwood1_4 0 0 0 1 1 +( -164 364 204 ) ( -164 365 204 ) ( -163 364 204 ) wizwood1_4 -15.9126 87.3333 0 1.01022 0.76 +( -164 364 204 ) ( -163 364 204 ) ( -164 364 205 ) wizwood1_4 0 0 0 1 1 +( -164 364 204 ) ( -164 364 205 ) ( -164 365 204 ) wizwood1_4 0 0 0 1 1 +} +// brush 88 +{ +( -289 312 200 ) ( -289 312 224.50000000000011 ) ( -289 311 200 ) wood1_1 0 0 0 0.5 0.5 +( -281 304 298 ) ( -281 304 322.50000000000011 ) ( -280 304 298 ) wood1_1 0 0 0 0.5 0.5 +( -289 312 200 ) ( -289 311 200 ) ( -288 312 200 ) wood1_1 0 0 0 0.5 0.5 +( -281 304 232.04246931257472 ) ( -280 304 232.04246931257472 ) ( -281 303 232.04246931257472 ) wood1_1 0 0 0 0.5 0.5 +( -289 312 200 ) ( -288 312 200 ) ( -289 312 224.50000000000011 ) wood1_1 0 0 0 0.5 0.5 +( -281 304 298 ) ( -281 303 298 ) ( -281 304 322.50000000000011 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 89 +{ +( -289 312 240.29442612447383 ) ( -289 311 240.29442612447383 ) ( -289 312 239.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 304 232.29442612447383 ) ( -104.79442612447366 304 232.29442612447383 ) ( -129.29442612447366 304 231.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 304 232.29442612447383 ) ( -129.29442612447366 303 232.29442612447383 ) ( -104.79442612447366 304 232.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 312 240.29442612447383 ) ( -202.79442612447366 312 240.29442612447383 ) ( -227.29442612447366 311 240.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 312 240.29442612447383 ) ( -227.29442612447366 312 239.29442612447383 ) ( -202.79442612447366 312 240.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -161 304 232.29442612447383 ) ( -161 304 231.29442612447383 ) ( -161 303 232.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 90 +{ +( -227 312 200.25195681189922 ) ( -227 312 224.75195681189922 ) ( -227 311 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -219 304 298.25195681189922 ) ( -219 304 322.75195681189922 ) ( -218 304 298.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -227 312 200.25195681189922 ) ( -227 311 200.25195681189922 ) ( -226 312 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -219 304 232.29442612447383 ) ( -218 304 232.29442612447383 ) ( -219 303 232.29442612447383 ) wood1_1 0 0 0 0.5 0.5 +( -227 312 200.25195681189922 ) ( -226 312 200.25195681189922 ) ( -227 312 224.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -219 304 298.25195681189922 ) ( -219 303 298.25195681189922 ) ( -219 304 322.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 91 +{ +( -169 312 200.25195681189922 ) ( -169 312 224.75195681189922 ) ( -169 311 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -161 304 298.25195681189922 ) ( -161 304 322.75195681189922 ) ( -160 304 298.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -169 312 200.25195681189922 ) ( -169 311 200.25195681189922 ) ( -168 312 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -161 304 232.29442612447383 ) ( -160 304 232.29442612447383 ) ( -161 303 232.29442612447383 ) wood1_1 0 0 0 0.5 0.5 +( -169 312 200.25195681189922 ) ( -168 312 200.25195681189922 ) ( -169 312 224.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -161 304 298.25195681189922 ) ( -161 303 298.25195681189922 ) ( -161 304 322.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 92 +{ +( -289 364 199.42942638075561 ) ( -289 364 223.92942638075573 ) ( -289 363 199.42942638075561 ) wood1_1 0 0 0 0.5 0.5 +( -281 356 297.42942638075561 ) ( -281 356 321.92942638075573 ) ( -280 356 297.42942638075561 ) wood1_1 0 0 0 0.5 0.5 +( -289 364 199.42942638075561 ) ( -289 363 199.42942638075561 ) ( -288 364 199.42942638075561 ) wood1_1 0 0 0 0.5 0.5 +( -281 356 231.47189569333034 ) ( -280 356 231.47189569333034 ) ( -281 355 231.47189569333034 ) wood1_1 0 0 0 0.5 0.5 +( -289 364 199.42942638075561 ) ( -288 364 199.42942638075561 ) ( -289 364 223.92942638075573 ) wood1_1 0 0 0 0.5 0.5 +( -281 356 297.42942638075561 ) ( -281 355 297.42942638075561 ) ( -281 356 321.92942638075573 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 93 +{ +( -289 364 239.72385250522944 ) ( -289 363 239.72385250522944 ) ( -289 364 238.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 356 231.72385250522944 ) ( -104.79442612447366 356 231.72385250522944 ) ( -129.29442612447366 356 230.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 356 231.72385250522944 ) ( -129.29442612447366 355 231.72385250522944 ) ( -104.79442612447366 356 231.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 364 239.72385250522944 ) ( -202.79442612447366 364 239.72385250522944 ) ( -227.29442612447366 363 239.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 364 239.72385250522944 ) ( -227.29442612447366 364 238.72385250522944 ) ( -202.79442612447366 364 239.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -161 356 231.72385250522944 ) ( -161 356 230.72385250522944 ) ( -161 355 231.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 94 +{ +( -227 364 199.68138319265483 ) ( -227 364 224.18138319265483 ) ( -227 363 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -219 356 297.68138319265483 ) ( -219 356 322.18138319265483 ) ( -218 356 297.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -227 364 199.68138319265483 ) ( -227 363 199.68138319265483 ) ( -226 364 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -219 356 231.72385250522944 ) ( -218 356 231.72385250522944 ) ( -219 355 231.72385250522944 ) wood1_1 0 0 0 0.5 0.5 +( -227 364 199.68138319265483 ) ( -226 364 199.68138319265483 ) ( -227 364 224.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -219 356 297.68138319265483 ) ( -219 355 297.68138319265483 ) ( -219 356 322.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 95 +{ +( -169 364 199.68138319265483 ) ( -169 364 224.18138319265483 ) ( -169 363 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -161 356 297.68138319265483 ) ( -161 356 322.18138319265483 ) ( -160 356 297.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -169 364 199.68138319265483 ) ( -169 363 199.68138319265483 ) ( -168 364 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -161 356 231.72385250522944 ) ( -160 356 231.72385250522944 ) ( -161 355 231.72385250522944 ) wood1_1 0 0 0 0.5 0.5 +( -169 364 199.68138319265483 ) ( -168 364 199.68138319265483 ) ( -169 364 224.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -161 356 297.68138319265483 ) ( -161 355 297.68138319265483 ) ( -161 356 322.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 96 +{ +( 602.79030032089656 32 342.54545454540494 ) ( 592 800 -192 ) ( 608.56701126942755 608 288 ) rock5_2 -21.0294 0 0 0.971939 1.00004 +( 642.05128205128426 64 -176 ) ( 592 800 -192 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -5.97406 -0.00647736 0 1.00067 1.0003 +( 704 -448 -256 ) ( 642.05128205128426 64 -176 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -6.33521 -0.00655365 0 0.995248 1.00029 +( 592 800 -192 ) ( 704 1088 384 ) ( 608.56701126942755 608 288 ) rock5_2 0 0 0 1 1 +( 704 -448 384 ) ( 704 -448 -256 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -14.9333 0 0 1.03448 1 +( 704 -448 -256 ) ( 592 800 -192 ) ( 642.05128205128426 64 -176 ) rock5_2 0 0 0 1 1 +( 608.56701126942755 608 288 ) ( 704 1088 384 ) ( 720 976 480 ) rock5_2 0 0 0 1 1 +( 704 1088 -256 ) ( 704 1088 384 ) ( 592 800 -192 ) rock5_2 0 0 0 1 1 +( 602.79030032089656 32 342.54545454540494 ) ( 608.56701126942755 608 288 ) ( 712.62921348343843 320 563.77528089944826 ) rock5_2 -41.6048 0.0569458 0 0.962897 1.00035 +( 608.56701126942755 608 288 ) ( 720 976 480 ) ( 712.62921348343843 320 563.77528089944826 ) rock5_2 0 0 0 1 1 +( 712.62921348343843 320 563.77528089944826 ) ( 704 -448 384 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -86.8117 0.675323 0 1.03139 1.00381 +( 712.62921348343843 320 563.77528089944826 ) ( 736 -384 430.98127340805593 ) ( 704 -448 384 ) rock5_2 107.333 105.688 0 1 1 +( 704 1088 -256 ) ( 592 800 -192 ) ( 704 -448 -256 ) rock5_2 -90.6667 101.333 0 1 1 +( 768 -448 -256 ) ( 704 -448 -256 ) ( 704 -448 384 ) rock5_2 0 0 0 1 1 +( 736 -384 430.98127340805593 ) ( 768 -448 384 ) ( 704 -448 384 ) rock5_2 0 0 0 1 1 +( 704 1088 -256 ) ( 704 -448 -256 ) ( 768 -448 -256 ) rock5_2 0 0 0 1 1 +( 720 976 480 ) ( 704 1088 384 ) ( 768 1088 384 ) rock5_2 0 0 0 1 1 +( 768 1088 384 ) ( 704 1088 384 ) ( 704 1088 -256 ) rock5_2 0 0 0 1 1 +( 712.62921348343843 320 563.77528089944826 ) ( 768 -448 384 ) ( 736 -384 430.98127340805593 ) rock5_2 19.4806 105.306 0 1 1 +( 712.62921348343843 320 563.77528089944826 ) ( 720 976 480 ) ( 768 1088 384 ) rock5_2 101.333 -26.6667 0 1 1 +( 924.4444444446334 208 128 ) ( 768 -448 384 ) ( 712.62921348343843 320 563.77528089944826 ) rock5_2 101.333 -26.6667 0 1 1 +( 924.4444444446334 208 128 ) ( 712.62921348343843 320 563.77528089944826 ) ( 768 1088 384 ) rock5_2 101.333 -26.6667 0 1 1 +( 924.4444444446334 208 128 ) ( 768 1088 -256 ) ( 768 -448 -256 ) rock5_2 0 0 0 1 1 +( 768 -448 -256 ) ( 768 -448 384 ) ( 924.4444444446334 208 128 ) rock5_2 0 0 0 1 1 +( 848 704 112 ) ( 768 1088 384 ) ( 768 1088 -256 ) rock5_2 0 0 0 1 1 +( 924.4444444446334 208 128 ) ( 768 1088 384 ) ( 848 704 112 ) rock5_2 0 0 0 1 1 +( 848 704 112 ) ( 768 1088 -256 ) ( 924.4444444446334 208 128 ) rock5_2 0 0 0 1 1 +} +// brush 97 +{ +( -643.55557174006481 -448 -256 ) ( -800 432 128 ) ( -723.55556364779704 -64 112 ) rock5_2 0 0 0 1 1 +( -723.55556364779704 -64 112 ) ( -800 432 128 ) ( -643.55557173997511 -448 384 ) rock5_2 0 0 0 1 1 +( -643.55557173997511 -448 384 ) ( -643.55557174006481 -448 -256 ) ( -723.55556364779704 -64 112 ) rock5_2 0 0 0 1 1 +( -643.55553937122022 1088 -256 ) ( -643.55553937111335 1088 384 ) ( -800 432 128 ) rock5_2 0 0 0 1 1 +( -643.55553937122022 1088 -256 ) ( -800 432 128 ) ( -643.55557174006481 -448 -256 ) rock5_2 0 0 0 1 1 +( -643.55557173997511 -448 384 ) ( -800 432 128 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 101.333 -26.6667 0 1 1 +( -800 432 128 ) ( -643.55553937111335 1088 384 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 101.333 -26.6667 0 1 1 +( -588.1847690384011 320 563.77528089871885 ) ( -595.55556937973358 -336 480 ) ( -643.55557173997511 -448 384 ) rock5_2 101.333 -26.6667 0 1 1 +( -643.55553937111335 1088 384 ) ( -611.55554071989502 1024 430.98127340813278 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 19.4806 105.306 0 1 1 +( -579.5555717399327 -448 384 ) ( -579.55557173951888 -448 -256 ) ( -643.55557174006481 -448 -256 ) rock5_2 0 0 0 1 1 +( -643.55557173997511 -448 384 ) ( -595.55556937973358 -336 480 ) ( -579.5555717399327 -448 384 ) rock5_2 0 0 0 1 1 +( -643.55557174006481 -448 -256 ) ( -579.55557173951888 -448 -256 ) ( -579.55553937117986 1088 -256 ) rock5_2 0 0 0 1 1 +( -579.55553937127502 1088 384 ) ( -611.55554071989502 1024 430.98127340813278 ) ( -643.55553937111335 1088 384 ) rock5_2 0 0 0 1 1 +( -579.55553937127502 1088 384 ) ( -643.55553937111335 1088 384 ) ( -643.55553937122022 1088 -256 ) rock5_2 0 0 0 1 1 +( -579.55553937117986 1088 -256 ) ( -579.55557173951888 -448 -256 ) ( -467.55556567078224 -160 -192 ) rock5_2 -90.6667 101.333 0 1 1 +( -588.1847690384011 320 563.77528089871885 ) ( -611.55554071989502 1024 430.98127340813278 ) ( -579.55553937127502 1088 384 ) rock5_2 107.333 105.688 0 1 1 +( -467.55556567078224 -160 -192 ) ( -579.55557173951888 -448 -256 ) ( -579.5555717399327 -448 384 ) rock5_2 0 0 0 1 1 +( -508.12257289416505 60 288 ) ( -595.55556937973358 -336 480 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 -75.3996 0.161095 0 1.01496 1.00124 +( -467.55556567078224 -160 -192 ) ( -517.60683221204999 576 -176 ) ( -579.55553937117986 1088 -256 ) rock5_2 0 0 0 1 1 +( -579.5555717399327 -448 384 ) ( -595.55556937973358 -336 480 ) ( -508.12257289416505 60 288 ) rock5_2 -46.3535 0.0297318 0 1.0473 1.00027 +( -508.12257289416505 60 288 ) ( -588.1847690384011 320 563.77528089871885 ) ( -579.55553937127502 1088 384 ) rock5_2 -61.9465 0.0656891 0 0.980902 1.00062 +( -467.55556567078224 -160 -192 ) ( -579.5555717399327 -448 384 ) ( -508.12257289416505 60 288 ) rock5_2 -13.9124 0 0 1.06481 1.00009 +( -579.55553937117986 1088 -256 ) ( -517.60683221204999 576 -176 ) ( -579.55553937127502 1088 384 ) rock5_2 0 0 0 1 1 +( -467.55556567078224 -160 -192 ) ( -508.12257289416505 60 288 ) ( -579.55553937127502 1088 384 ) rock5_2 -19.2738 0.00149345 0 0.970478 1.00011 +( -579.55553937127502 1088 384 ) ( -517.60683221204999 576 -176 ) ( -467.55556567078224 -160 -192 ) rock5_2 -18.286 0 0 0.975212 1.00006 +} +// brush 98 +{ +( -688 -512 384 ) ( -688 -512 -256 ) ( -688 -448 -256 ) rock5_2 0 0 0 1 1 +( -576 -496 480 ) ( -688 -512 384 ) ( -688 -448 384 ) rock5_2 0 0 0 1 1 +( -688 -512 384 ) ( -400 -624 -192 ) ( -688 -512 -256 ) rock5_2 0 0 0 1 1 +( -304 -368 112 ) ( -688 -448 384 ) ( -688 -448 -256 ) rock5_2 0 0 0 1 1 +( -688 -512 384 ) ( -208 -607.4329927766596 288 ) ( -400 -624 -192 ) rock5_2 0 0 0 1 1 +( 192 -291.55556567081601 128 ) ( -688 -448 384 ) ( -304 -368 112 ) rock5_2 0 0 0 1 1 +( -304 -368 112 ) ( -688 -448 -256 ) ( 192 -291.55556567081601 128 ) rock5_2 0 0 0 1 1 +( -576 -496 480 ) ( -208 -607.4329927766596 288 ) ( -688 -512 384 ) rock5_2 0 0 0 1 1 +( -576 -496 480 ) ( 80 -503.37079663222687 563.7752808984078 ) ( -208 -607.4329927766596 288 ) rock5_2 0 0 0 1 1 +( -688 -448 384 ) ( 80 -503.37079663222687 563.7752808984078 ) ( -576 -496 480 ) rock5_2 101.333 -26.6667 0 1 1 +( 192 -291.55556567081601 128 ) ( 80 -503.37079663222687 563.7752808984078 ) ( -688 -448 384 ) rock5_2 101.333 -26.6667 0 1 1 +( -688 -512 -256 ) ( -400 -624 -192 ) ( 848 -512 -256 ) rock5_2 -90.6667 101.333 0 1 1 +( -688 -512 -256 ) ( 848 -512 -256 ) ( 848 -448 -256 ) rock5_2 0 0 0 1 1 +( 192 -291.55556567081601 128 ) ( -688 -448 -256 ) ( 848 -448 -256 ) rock5_2 0 0 0 1 1 +( 192 -291.55556567081601 128 ) ( 848 -448 384 ) ( 80 -503.37079663222687 563.7752808984078 ) rock5_2 101.333 -26.6667 0 1 1 +( -208 -607.4329927766596 288 ) ( 80 -503.37079663222687 563.7752808984078 ) ( 848 -512 384 ) rock5_2 0 0 0 1 1 +( -400 -624 -192 ) ( -208 -607.4329927766596 288 ) ( 336 -573.94873345875158 -176 ) rock5_2 0 0 0 1 1 +( 848 -512 -256 ) ( -400 -624 -192 ) ( 336 -573.94873345875158 -176 ) rock5_2 0 0 0 1 1 +( 336 -573.94873345875158 -176 ) ( -208 -607.4329927766596 288 ) ( 848 -512 384 ) rock5_2 0 0 0 1 1 +( 80 -503.37079663222687 563.7752808984078 ) ( 848 -448 384 ) ( 784 -480 430.98127340820633 ) rock5_2 19.4806 105.306 0 1 1 +( 848 -512 384 ) ( 848 -512 -256 ) ( 336 -573.94873345875158 -176 ) rock5_2 0 0 0 1 1 +( 80 -503.37079663222687 563.7752808984078 ) ( 784 -480 430.98127340820633 ) ( 848 -512 384 ) rock5_2 107.333 105.688 0 1 1 +( 848 -448 -256 ) ( 848 -448 384 ) ( 192 -291.55556567081601 128 ) rock5_2 0 0 0 1 1 +( 784 -480 430.98127340820633 ) ( 848 -448 384 ) ( 848 -512 384 ) rock5_2 0 0 0 1 1 +( 848 -512 384 ) ( 848 -448 384 ) ( 848 -448 -256 ) rock5_2 0 0 0 1 1 +} +// brush 99 +{ +( -688 1024 384 ) ( -688 1024 -256 ) ( -688 1088 -256 ) rock5_2 0 0 0 1 1 +( -576 1040 480 ) ( -688 1024 384 ) ( -688 1088 384 ) rock5_2 0 0 0 1 1 +( -400 912 -192 ) ( -688 1024 -256 ) ( -688 1024 384 ) rock5_2 0 0 0 1 1 +( -204 876.56700722334244 288 ) ( -400 912 -192 ) ( -688 1024 384 ) rock5_2 -4.31247 0 0 1.00926 1.00003 +( -304 1168 112 ) ( -688 1088 384 ) ( -688 1088 -256 ) rock5_2 0 0 0 1 1 +( -204 876.56700722334244 288 ) ( -688 1024 384 ) ( -576 1040 480 ) rock5_2 -9.53002 0.0226288 0 1.00676 1.00009 +( 192 1244.4444343291811 128 ) ( -688 1088 384 ) ( -304 1168 112 ) rock5_2 0 0 0 1 1 +( -688 1088 -256 ) ( 192 1244.4444343291811 128 ) ( -304 1168 112 ) rock5_2 0 0 0 1 1 +( -576 1040 480 ) ( 80 1032.6292033677735 563.77528089840416 ) ( -204 876.56700722334244 288 ) rock5_2 -14.382 0.129059 0 1.00214 1.00042 +( -576 1040 480 ) ( -688 1088 384 ) ( 80 1032.6292033677735 563.77528089840416 ) rock5_2 101.333 -26.6667 0 1 1 +( 80 1032.6292033677735 563.77528089840416 ) ( -688 1088 384 ) ( 192 1244.4444343291811 128 ) rock5_2 101.333 -26.6667 0 1 1 +( 848 1024 -256 ) ( -688 1024 -256 ) ( -400 912 -192 ) rock5_2 -90.6667 101.333 0 1 1 +( -688 1088 -256 ) ( -688 1024 -256 ) ( 848 1024 -256 ) rock5_2 0 0 0 1 1 +( 848 1088 -256 ) ( 192 1244.4444343291811 128 ) ( -688 1088 -256 ) rock5_2 0 0 0 1 1 +( 848 1088 384 ) ( 80 1032.6292033677735 563.77528089840416 ) ( 192 1244.4444343291811 128 ) rock5_2 101.333 -26.6667 0 1 1 +( -204 876.56700722334244 288 ) ( 336 962.05126654124797 -176 ) ( -400 912 -192 ) rock5_2 -2.00022 -0.00639343 0 0.999817 1.00011 +( -400 912 -192 ) ( 336 962.05126654124797 -176 ) ( 848 1024 -256 ) rock5_2 0 0 0 1 1 +( 80 1032.6292033677735 563.77528089840416 ) ( 848 1024 384 ) ( -204 876.56700722334244 288 ) rock5_2 -10.0317 0.0568237 0 0.997272 1.0002 +( 784 1056 430.9812734082015 ) ( 80 1032.6292033677735 563.77528089840416 ) ( 848 1088 384 ) rock5_2 19.4806 105.306 0 1 1 +( 848 1024 -256 ) ( 336 962.05126654124797 -176 ) ( -204 876.56700722334244 288 ) rock5_2 0.0120392 0 0 1 1.00011 +( -204 876.56700722334244 288 ) ( 848 1024 384 ) ( 848 1024 -256 ) rock5_2 0 0 0 1 1 +( 784 1056 430.9812734082015 ) ( 848 1024 384 ) ( 80 1032.6292033677735 563.77528089840416 ) rock5_2 107.333 105.688 0 1 1 +( 848 1088 384 ) ( 192 1244.4444343291811 128 ) ( 848 1088 -256 ) rock5_2 0 0 0 1 1 +( 848 1088 384 ) ( 848 1024 384 ) ( 784 1056 430.9812734082015 ) rock5_2 0 0 0 1 1 +( 848 1024 -256 ) ( 848 1024 384 ) ( 848 1088 384 ) rock5_2 0 0 0 1 1 +} +// brush 100 +{ +( -460 9252 8348 ) ( -460 -7132 8348 ) ( -460 9252 -8036 ) slipbotsd -4 -36 90 -1 1 +( -8268 548 8348 ) ( 8116 548 8348 ) ( 8116 548 -8036 ) slipbotsd -4 -12 270 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) +0slipbot 36 -12 270 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) +0slipbot 36 -12 270 1 1 +( 8116 612 8348 ) ( -8268 612 8348 ) ( 8116 612 -8036 ) slipbotsd -4 -12 270 1 1 +( -396 -7132 8348 ) ( -396 9252 8348 ) ( -396 9252 -8036 ) slipbotsd -4 -36 90 -1 1 +} +// brush 101 +{ +( -412 9252 8348 ) ( -412 -7132 8348 ) ( -412 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 532 8348 ) ( 8116 532 8348 ) ( 8116 532 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 548 8348 ) ( -8268 548 8348 ) ( 8116 548 -8036 ) slipside -4 -4 0 1 1 +( -396 -7132 8348 ) ( -396 9252 8348 ) ( -396 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 102 +{ +( -460 9252 8348 ) ( -460 -7132 8348 ) ( -460 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 532 8348 ) ( 8116 532 8348 ) ( 8116 532 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 548 8348 ) ( -8268 548 8348 ) ( 8116 548 -8036 ) slipside -4 -4 0 1 1 +( -444 -7132 8348 ) ( -444 9252 8348 ) ( -444 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 103 +{ +( -412 9252 8348 ) ( -412 -7132 8348 ) ( -412 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 612 8348 ) ( 8116 612 8348 ) ( 8116 612 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 628 8348 ) ( -8268 628 8348 ) ( 8116 628 -8036 ) slipside -4 -4 0 1 1 +( -396 -7132 8348 ) ( -396 9252 8348 ) ( -396 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 104 +{ +( -460 9252 8348 ) ( -460 -7132 8348 ) ( -460 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 612 8348 ) ( 8116 612 8348 ) ( 8116 612 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 628 8348 ) ( -8268 628 8348 ) ( 8116 628 -8036 ) slipside -4 -4 0 1 1 +( -444 -7132 8348 ) ( -444 9252 8348 ) ( -444 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 105 +{ +( -460.68305078289859 9252 8512 ) ( -460.68305078289859 -7132 8512 ) ( -460.68305078289859 9252 -7872 ) slipbotsd 0 28 90 -1 1 +( -8268.6830507828981 548 8512 ) ( 8115.3169492171019 548 8512 ) ( 8115.3169492171019 548 -7872 ) slipbotsd 0 51.317 270 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) +0slipbot -28 51.317 270 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) +0slipbot -28 51.317 270 1 1 +( 8115.3169492171019 612 8512 ) ( -8268.6830507828981 612 8512 ) ( 8115.3169492171019 612 -7872 ) slipbotsd 0 51.317 270 1 1 +( -396.68305078289859 -7132 8512 ) ( -396.68305078289859 9252 8512 ) ( -396.68305078289859 9252 -7872 ) slipbotsd 0 28 90 -1 1 +} +// brush 106 +{ +( -412.68305078289859 9252 8512 ) ( -412.68305078289859 -7132 8512 ) ( -412.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 532 8512 ) ( 8115.3169492171019 532 8512 ) ( 8115.3169492171019 532 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 548 8512 ) ( -8268.6830507828981 548 8512 ) ( 8115.3169492171019 548 -7872 ) slipside -3.31696 0 0 1 1 +( -396.68305078289859 -7132 8512 ) ( -396.68305078289859 9252 8512 ) ( -396.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 107 +{ +( -460.68305078289859 9252 8512 ) ( -460.68305078289859 -7132 8512 ) ( -460.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 532 8512 ) ( 8115.3169492171019 532 8512 ) ( 8115.3169492171019 532 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 548 8512 ) ( -8268.6830507828981 548 8512 ) ( 8115.3169492171019 548 -7872 ) slipside -3.31696 0 0 1 1 +( -444.68305078289859 -7132 8512 ) ( -444.68305078289859 9252 8512 ) ( -444.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 108 +{ +( -412.68305078289859 9252 8512 ) ( -412.68305078289859 -7132 8512 ) ( -412.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 612 8512 ) ( 8115.3169492171019 612 8512 ) ( 8115.3169492171019 612 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 628 8512 ) ( -8268.6830507828981 628 8512 ) ( 8115.3169492171019 628 -7872 ) slipside -3.31696 0 0 1 1 +( -396.68305078289859 -7132 8512 ) ( -396.68305078289859 9252 8512 ) ( -396.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 109 +{ +( -460.68305078289859 9252 8512 ) ( -460.68305078289859 -7132 8512 ) ( -460.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 612 8512 ) ( 8115.3169492171019 612 8512 ) ( 8115.3169492171019 612 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 628 8512 ) ( -8268.6830507828981 628 8512 ) ( 8115.3169492171019 628 -7872 ) slipside -3.31696 0 0 1 1 +( -444.68305078289859 -7132 8512 ) ( -444.68305078289859 9252 8512 ) ( -444.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 110 +{ +( 204 4 72 ) ( 212 32 92 ) ( 212 -8 92 ) rock5_2 52.8205 -37.0778 0 1 2.11149 +( 212 -8 92 ) ( 288 -16 72 ) ( 204 4 72 ) rock5_2 12.4079 16.4704 357.221 1.05226 1.73207 +( 289.66666666657449 16 60.666666666677905 ) ( 212 32 92 ) ( 204 4 72 ) rock5_2 -36.8217 24.8842 55.9902 0.579428 3.20696 +( 284 32 80 ) ( 212 32 92 ) ( 289.66666666657449 16 60.666666666677905 ) rock5_2 -48.7906 35.4409 60.8903 0.453788 3.64757 +( 204 4 72 ) ( 288 -16 72 ) ( 289.66666666657449 16 60.666666666677905 ) rock5_2 -9.34389 34.054 78.1146 1.48223 6.09644 +( 284 -8 92 ) ( 288 -16 72 ) ( 212 -8 92 ) rock5_2 -13.9255 0.620201 0 1 2.1654 +( 212 -8 92 ) ( 212 32 92 ) ( 284 32 92 ) rock5_2 4 -56 0 1 1 +( 284 32 92 ) ( 212 32 92 ) ( 284 32 80 ) rock5_2 -45.0904 -46.4015 0 0.785714 -0.104336 +( 289.66666666657449 16 60.666666666677905 ) ( 284 32 92 ) ( 284 32 80 ) rock5_2 48 -16 0 0.8 1 +( 284 32 92 ) ( 288 -16 72 ) ( 284 -8 92 ) rock5_2 56 -16 0 1 1 +( 289.66666666657449 16 60.666666666677905 ) ( 288 -16 72 ) ( 284 32 92 ) rock5_2 51.4641 -16.7497 0 1.07246 1.01501 +} +// brush 111 +{ +( -493.46410161514081 5745.4641016151372 8468 ) ( -493.4641016151308 -10638.535898384862 8468 ) ( -493.46410161514081 5745.4641016151372 -7916 ) tech10_1 -37.4641 -4 0 1 1 +( 7778.5358983848619 209.46410161514336 8468 ) ( -8605.4641016151381 209.46410161513381 8468 ) ( -8605.4641016151381 209.46410161513381 -7916 ) tech10_1 -45.4641 28.8 180 1 -1.25 +( 7778.5358983848682 -10638.535898384855 196 ) ( 7778.5358983848573 5745.4641016151436 196 ) ( -8605.4641016151309 -10638.535898384866 196 ) tech10_1 -37.4641 25.4641 90 1 1 +( 7778.5358983848573 5745.4641016151436 276 ) ( 7778.5358983848682 -10638.535898384855 276 ) ( -8605.4641016151309 -10638.535898384866 276 ) tech10_1 -37.4641 25.4641 90 1 1 +( -8605.4641016151363 193.46410161513427 8468 ) ( 7778.535898384861 193.46410161514291 8468 ) ( -8605.4641016151363 193.46410161513427 -7916 ) tech10_1 -9.46411 -4 180 1 -1 +( -429.46410161513171 -10638.535898384862 8468 ) ( -429.46410161514081 5745.4641016151372 8468 ) ( -429.46410161514081 5745.4641016151372 -7916 ) tech10_1 -37.4641 -4 0 1 1 +} +// brush 112 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 113 +{ +( 32 8992 8384 ) ( 32 -7392 8384 ) ( 32 8992 -8000 ) slipbotsd 0 32 270 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipbotsd 0 -32 270 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) +0slipbot 32 32 0 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) +0slipbot 32 32 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipbotsd 0 -32 270 1 1 +( 96 -7392 8384 ) ( 96 8992 8384 ) ( 96 8992 -8000 ) slipbotsd 0 32 270 1 1 +} +// brush 114 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 464 8384 ) ( 7776 464 8384 ) ( -8608 464 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 480 8384 ) ( -8608 480 8384 ) ( -8608 480 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 115 +{ +( 96 8992 8384 ) ( 96 -7392 8384 ) ( 96 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 112 -7392 8384 ) ( 112 8992 8384 ) ( 112 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 116 +{ +( 16 8992 8384 ) ( 16 -7392 8384 ) ( 16 8992 -8000 ) slipside 0 0 0 1 1 +( -8608 416 8384 ) ( 7776 416 8384 ) ( -8608 416 -8000 ) slipside 0 0 0 1 1 +( 7776 -7392 240 ) ( 7776 8992 240 ) ( -8608 -7392 240 ) slipside 0 0 90 1 1 +( 7776 8992 256 ) ( 7776 -7392 256 ) ( -8608 -7392 256 ) sliplite 0 0 0 1 1 +( 7776 432 8384 ) ( -8608 432 8384 ) ( -8608 432 -8000 ) slipside 0 0 0 1 1 +( 32 -7392 8384 ) ( 32 8992 8384 ) ( 32 8992 -8000 ) slipside 0 0 0 1 1 +} +// brush 117 +{ +( -24 520 176 ) ( 0 512 240 ) ( -72 344 176 ) city6_4 0.785011 -28.0187 0 2.44444 4.03352 +( -72 344 176 ) ( 0 512 240 ) ( 0 384 240 ) city6_4 32.374 -19.2478 90 2 -5.20568 +( 88 536.8000000000003 188.7999999999993 ) ( 0 512 240 ) ( -24 520 176 ) city6_4 59.1635 -39.4009 351.016 2.11688 2.13901 +( -72 344 176 ) ( 0 384 240 ) ( 128 352 208 ) city6_4 2.18861 -31.2442 0 2.10771 2.02943 +( -24 520 176 ) ( 160 528 176 ) ( 88 536.8000000000003 188.7999999999993 ) city6_4 52.3236 11.7734 0 2.09091 0.902909 +( 128 352 208 ) ( 0 384 240 ) ( 128 384 240 ) city6_4 31.8552 35.9458 0 2.21053 2.34541 +( 128 384 176 ) ( 160 528 176 ) ( -24 520 176 ) city6_4 32 -32 0 2 2 +( 0 512 240 ) ( 128 512 240 ) ( 128 384 240 ) city6_4 32 -32 0 2 2 +( 88 536.8000000000003 188.7999999999993 ) ( 128 512 240 ) ( 0 512 240 ) city6_4 47.0733 -5.66277 0 2 2.97754 +( -72 344 176 ) ( 128 352 208 ) ( 128 384 176 ) city6_4 32.0849 -14.9539 11.3099 2.34823 -2.39236 +( 160 528 176 ) ( 128 512 240 ) ( 88 536.8000000000003 188.7999999999993 ) city6_4 26.5962 -63.8725 15.5241 2.07573 2.28998 +( 128 384 240 ) ( 128 512 240 ) ( 160 528 176 ) city6_4 -22.4926 -29.0793 0 2.23529 4.32242 +( 128 352 208 ) ( 160 528 176 ) ( 128 384 176 ) city6_4 23.0016 -27.9739 0 2.51471 4.07487 +( 128 384 240 ) ( 160 528 176 ) ( 128 352 208 ) city6_4 0.468662 -28.023 0 2.42157 4.03361 +} +// brush 118 +{ +( -192 256 176 ) ( -192 192 96 ) ( -192 704 96 ) wgrass1_1 21.7358 28.448 0 1 1 +( -192 704 96 ) ( -179.63025210084788 352 200 ) ( -192 256 176 ) wgrass1_1 24.1474 -6.53467 4.66686 1 1 +( -179.63025210084788 352 200 ) ( -176 296 202.68522888154857 ) ( -192 256 176 ) wgrass1_1 -8.05246 -52.6528 4.76366 1 1 +( -96 648 208 ) ( -179.63025210084788 352 200 ) ( -192 704 96 ) wgrass1_1 24.1474 -6.53467 4.66686 1 1 +( -96 648 208 ) ( -176 296 202.68522888154857 ) ( -179.63025210084788 352 200 ) wgrass1_1 21.4258 38.5945 4.76366 1 1 +( -192 704 96 ) ( -76 718 96 ) ( -96 648 208 ) wgrass1_1 -20.5928 -59.9753 0 1 1 +( 56 168 96 ) ( -192 192 96 ) ( -192 256 176 ) wgrass1_1 1.17828 49.3632 4.08562 1 1 +( -176 296 202.68522888154857 ) ( 192 288 208 ) ( -192 256 176 ) wgrass1_1 21.4258 38.5945 4.76366 1 1 +( -96 648 208 ) ( 192 288 208 ) ( -176 296 202.68522888154857 ) wgrass1_1 21.4258 38.5945 4.76366 1 1 +( 192 288 208 ) ( 56 168 96 ) ( -192 256 176 ) wgrass1_1 15.5252 40.8665 4.76366 1 1 +( 56 168 96 ) ( 320 192 96 ) ( 336 424 96 ) wgrass1_1 0 0 0 1 1 +( -96 648 208 ) ( -76 718 96 ) ( 320 704 96 ) wgrass1_1 -17.8815 -59.9915 0 1 1 +( 192 288 208 ) ( 320 192 96 ) ( 56 168 96 ) wgrass1_1 22.8036 -16.8397 4.76366 1 1 +( -96 648 208 ) ( 256 576 176 ) ( 192 288 208 ) wgrass1_1 -12.1401 6.4073 356.955 1 1 +( 320 704 96 ) ( 256 576 176 ) ( -96 648 208 ) wgrass1_1 20.378 -37.934 349.657 1 1 +( 256 576 176 ) ( 320 192 96 ) ( 192 288 208 ) wgrass1_1 -2.85219 -38.8333 77.4712 1 1 +( 341.48571428570062 608 96 ) ( 256 576 176 ) ( 320 704 96 ) wgrass1_1 58.6595 5.88304 354.42 1 1 +( 336 424 96 ) ( 320 192 96 ) ( 256 576 176 ) wgrass1_1 -63.8217 -63.0989 78.9861 1 1 +( 336 424 96 ) ( 256 576 176 ) ( 341.48571428570062 608 96 ) wgrass1_1 -57.3016 -37.1865 81.6253 1 1 +} +// brush 119 +{ +( -192 -288 288 ) ( -192 -286 288 ) ( -192 -288 289 ) quakevrlogo 640 64 180 1 -0.5 +( -192 -288 288 ) ( -192 -288 289 ) ( -191 -288 288 ) quakevrlogo 640 64 180 0.5 -0.5 +( -192 -288 288 ) ( -191 -288 288 ) ( -192 -286 288 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 320 -254 544 ) ( 321 -256 544 ) quakevrlogo 640 64 180 0.5 -1 +( 320 -256 544 ) ( 321 -256 544 ) ( 320 -256 545 ) quakevrlogo 640 64 180 0.5 -0.5 +( 320 -256 544 ) ( 320 -256 545 ) ( 320 -254 544 ) quakevrlogo 640 64 180 1 -0.5 +} +// brush 120 +{ +( -448 -288 288 ) ( -448 -286 288 ) ( -448 -288 289 ) city5_4 -10 8 0 8 4 +( -448 -288 288 ) ( -448 -288 289 ) ( -447 -288 288 ) city5_4 20 8 0 4 4 +( -448 -288 288 ) ( -447 -288 288 ) ( -448 -286 288 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -192 -254 544 ) ( -191 -256 544 ) city5_4 20 8 0 4 8 +( -192 -256 544 ) ( -191 -256 544 ) ( -192 -256 545 ) city5_4 20 8 0 4 4 +( -192 -256 544 ) ( -192 -256 545 ) ( -192 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 121 +{ +( 320 -288 288 ) ( 320 -286 288 ) ( 320 -288 289 ) city5_4 -10 8 0 8 4 +( 320 -288 288 ) ( 320 -288 289 ) ( 321 -288 288 ) city5_4 20 8 0 4 4 +( 320 -288 288 ) ( 321 -288 288 ) ( 320 -286 288 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 576 -254 544 ) ( 577 -256 544 ) city5_4 20 8 0 4 8 +( 576 -256 544 ) ( 577 -256 544 ) ( 576 -256 545 ) city5_4 20 8 0 4 4 +( 576 -256 544 ) ( 576 -256 545 ) ( 576 -254 544 ) city5_4 -10 8 0 8 4 +} +// brush 122 +{ +( 576 -304 -192 ) ( 576 -303.00339673913044 -192 ) ( 576 -304 -189 ) city6_4 -16 -63 0 1 1 +( 576 -304 -192 ) ( 576 -304 -189 ) ( 577 -304 -192 ) city6_4 0 -63 0 1 1 +( 576 -304 -192 ) ( 577 -304 -192 ) ( 576 -303.00339673913044 -192 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -239.22078804347998 576 ) ( 641 -240.21739130434952 576 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 641 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) city6_4 0 -63 0 1 1 +( 640 -240.21739130434952 576 ) ( 640 -240.21739130434952 579 ) ( 640 -239.22078804347998 576 ) city6_4 0 -63 0 1 1 +} +// brush 123 +{ +( -512 -304 -192 ) ( -512 -303.00339673913044 -192 ) ( -512 -304 -189 ) city6_4 320 -63 0 1 1 +( -512 -304 -192 ) ( -512 -304 -189 ) ( -511 -304 -192 ) city6_4 320 -63 0 1 1 +( -512 -304 -192 ) ( -511 -304 -192 ) ( -512 -303.00339673913044 -192 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -448 -239.22078804347996 576 ) ( -447 -240.21739130434949 576 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -447 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) city6_4 320 -63 0 1 1 +( -448 -240.21739130434949 576 ) ( -448 -240.21739130434949 579 ) ( -448 -239.22078804347996 576 ) city6_4 303 -63 0 1 1 +} +// brush 124 +{ +( -1024 -831.5 704 ) ( -1024 -830.22799545712599 704 ) ( -1024 -831.5 704.5 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1024 -831.5 704.5 ) ( -1023.042253521126 -831.5 704 ) sky4 0 0 0 1 1 +( -1024 -831.5 704 ) ( -1023.042253521126 -831.5 704 ) ( -1024 -830.22799545712599 704 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1409.7720045428748 736 ) ( 1152.9577464788731 1408.5 736 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152.9577464788731 1408.5 736 ) ( 1152 1408.5 736.5 ) sky4 0 0 0 1 1 +( 1152 1408.5 736 ) ( 1152 1408.5 736.5 ) ( 1152 1409.7720045428748 736 ) sky4 0 0 0 1 1 +} +// brush 125 +{ +( -576 -448 -256 ) ( -576 -446.85714285714261 -256 ) ( -576 -448 -255 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -576 -448 -255 ) ( -574.74999999999977 -448 -256 ) rock5_2 0 0 0 1 1 +( -576 -448 -256 ) ( -574.74999999999977 -448 -256 ) ( -576 -446.85714285714261 -256 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1089.1428571428576 -192 ) ( 705.25000000000034 1088 -192 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 705.25000000000034 1088 -192 ) ( 704 1088 -191 ) rock5_2 0 0 0 1 1 +( 704 1088 -192 ) ( 704 1088 -191 ) ( 704 1089.1428571428576 -192 ) rock5_2 0 0 0 1 1 +} +// brush 126 +{ +( -576 -448 -192 ) ( -576 -447 -192 ) ( -576 -448 -191 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -576 -448 -191 ) ( -574.74999999999977 -448 -192 ) *04awater1 0 0 0 1 1 +( -576 -448 -192 ) ( -574.74999999999977 -448 -192 ) ( -576 -447 -192 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1089 96 ) ( 705.25000000000011 1088 96 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 705.25000000000011 1088 96 ) ( 704 1088 97 ) *04awater1 0 0 0 1 1 +( 704 1088 96 ) ( 704 1088 97 ) ( 704 1089 96 ) *04awater1 0 0 0 1 1 +} +// brush 127 +{ +( 1152 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) ( 1152 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152.4999999999998 -831.5 736 ) ( 1152 -831.5 735.04225352112621 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184.5000000000005 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( 1152 -831.5 736 ) ( 1152 -830.22799545712599 736 ) ( 1152.4999999999998 -831.5 736 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) ( 1184.5000000000005 1408.5 -1440 ) sky4 0 0 0 1 1 +( 1184 1408.5 -1440 ) ( 1184 1409.7720045428748 -1440 ) ( 1184 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 128 +{ +( -1056 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) ( -1056 -830.22799545712599 736 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1055.5000000000002 -831.5 736 ) ( -1056 -831.5 735.04225352112644 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1023.4999999999995 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) sky4 0 0 0 1 1 +( -1056 -831.5 736 ) ( -1056 -830.22799545712599 736 ) ( -1055.5000000000002 -831.5 736 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) ( -1023.4999999999995 1408.5 -1440 ) sky4 0 0 0 1 1 +( -1024 1408.5 -1440 ) ( -1024 1409.7720045428748 -1440 ) ( -1024 1408.5 -1440.9577464788731 ) sky4 0 0 0 1 1 +} +// brush 129 +{ +( -1055.5 1440 736 ) ( -1055.5 1439.5000000000005 736 ) ( -1055.5 1440 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1185.772004542875 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1407.4999999999991 -1440 ) ( 1185.772004542875 1408 -1440 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1054.2279954571259 1440 736 ) ( -1055.5 1439.5000000000005 736 ) sky4 0 0 0 1 1 +( -1055.5 1440 736 ) ( -1055.5 1440 735.04225352112644 ) ( -1054.2279954571259 1440 736 ) sky4 0 0 0 1 1 +( 1184.5 1408 -1440 ) ( 1184.5 1408 -1440.9577464788731 ) ( 1184.5 1407.4999999999991 -1440 ) sky4 0 0 0 1 1 +} +// brush 130 +{ +( -1055.5 -832 736 ) ( -1055.5 -832.49999999999955 736 ) ( -1055.5 -832 735.04225352112644 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1185.772004542875 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864.50000000000091 -1440 ) ( 1185.772004542875 -864 -1440 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1054.2279954571259 -832 736 ) ( -1055.5 -832.49999999999955 736 ) sky4 0 0 0 1 1 +( -1055.5 -832 736 ) ( -1055.5 -832 735.04225352112644 ) ( -1054.2279954571259 -832 736 ) sky4 0 0 0 1 1 +( 1184.5 -864 -1440 ) ( 1184.5 -864 -1440.9577464788731 ) ( 1184.5 -864.50000000000091 -1440 ) sky4 0 0 0 1 1 +} +// brush 131 +{ +( 216 48 96 ) ( 216 50.5 96 ) ( 216 48 98.5 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 216 48 98.5 ) ( 217 48 96 ) rock3_7 0 0 0 1 1 +( 216 48 96 ) ( 217 48 96 ) ( 216 50.5 96 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 288 90.5 108 ) ( 289 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 289 88 116 ) ( 288 88 118.5 ) rock3_7 0 0 0 1 1 +( 288 88 116 ) ( 288 88 118.5 ) ( 288 90.5 116 ) rock3_7 0 0 0 1 1 +} +// brush 132 +{ +( 216 88 108 ) ( 216 90.5 108 ) ( 216 88 110.5 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 216 88 110.5 ) ( 217 88 108 ) rock3_7 0 0 0 1 1 +( 216 88 108 ) ( 217 88 108 ) ( 216 90.5 108 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 288 130.5 120 ) ( 289 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 289 128 128 ) ( 288 128 130.5 ) rock3_7 0 0 0 1 1 +( 288 128 128 ) ( 288 128 130.5 ) ( 288 130.5 128 ) rock3_7 0 0 0 1 1 +} +// brush 133 +{ +( 216 128 120 ) ( 216 130.5 120 ) ( 216 128 122.5 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 216 128 122.5 ) ( 217 128 120 ) rock3_7 0 0 0 1 1 +( 216 128 120 ) ( 217 128 120 ) ( 216 130.5 120 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 288 170.5 132 ) ( 289 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 289 168 140 ) ( 288 168 142.5 ) rock3_7 0 0 0 1 1 +( 288 168 140 ) ( 288 168 142.5 ) ( 288 170.5 140 ) rock3_7 0 0 0 1 1 +} +// brush 134 +{ +( 216 168 132 ) ( 216 170.5 132 ) ( 216 168 134.5 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 216 168 134.5 ) ( 217 168 132 ) rock3_7 0 0 0 1 1 +( 216 168 132 ) ( 217 168 132 ) ( 216 170.5 132 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 288 210.5 144 ) ( 289 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 289 208 152 ) ( 288 208 154.5 ) rock3_7 0 0 0 1 1 +( 288 208 152 ) ( 288 208 154.5 ) ( 288 210.5 152 ) rock3_7 0 0 0 1 1 +} +// brush 135 +{ +( 216 208 144 ) ( 216 210.5 144 ) ( 216 208 146.5 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 216 208 146.5 ) ( 217 208 144 ) rock3_7 0 0 0 1 1 +( 216 208 144 ) ( 217 208 144 ) ( 216 210.5 144 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 288 250.5 156 ) ( 289 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 289 248 164 ) ( 288 248 166.5 ) rock3_7 0 0 0 1 1 +( 288 248 164 ) ( 288 248 166.5 ) ( 288 250.5 164 ) rock3_7 0 0 0 1 1 +} +// brush 136 +{ +( 216 248 156 ) ( 216 250.50000000000003 156 ) ( 216 248 158.5 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 216 248 158.5 ) ( 217 248 156 ) rock3_7 0 0 0 1 1 +( 216 248 156 ) ( 217 248 156 ) ( 216 250.50000000000003 156 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 288 290.5 168 ) ( 289 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 289 288 176 ) ( 288 288 178.5 ) rock3_7 0 0 0 1 1 +( 288 288 176 ) ( 288 288 178.5 ) ( 288 290.5 176 ) rock3_7 0 0 0 1 1 +} +// brush 137 +{ +( 216 288 168 ) ( 216 290.5 168 ) ( 216 288 170.5 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 216 288 170.5 ) ( 217 288 168 ) rock3_7 0 0 0 1 1 +( 216 288 168 ) ( 217 288 168 ) ( 216 290.5 168 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 288 330.5 180 ) ( 289 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 289 328 188 ) ( 288 328 190.5 ) rock3_7 0 0 0 1 1 +( 288 328 188 ) ( 288 328 190.5 ) ( 288 330.5 188 ) rock3_7 0 0 0 1 1 +} +// brush 138 +{ +( 216 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) ( 216 328 182.22774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 216 328 182.22774480533857 ) ( 217 328 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 216 328 179.72774480533857 ) ( 217 328 179.72774480533857 ) ( 216 330.5 179.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 191.72774480533857 ) ( 288 370.5 191.72774480533857 ) ( 289 368 191.72774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 289 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) rock3_7 0 0 0 1 1 +( 288 368 199.72774480533857 ) ( 288 368 202.22774480533857 ) ( 288 370.5 199.72774480533857 ) rock3_7 0 0 0 1 1 +} +// brush 139 +{ +( 216 368 191.70557387552577 ) ( 216 370.5 191.70557387552577 ) ( 216 368 194.20557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 191.70557387552577 ) ( 216 368 194.20557387552577 ) ( 217 368 191.70557387552577 ) rock3_7 0 0 0 1 1 +( 216 368 192 ) ( 217 368 192 ) ( 216 370.5 192 ) rock3_7 0 0 0 1 1 +( 288 408 203.70557387552577 ) ( 288 410.5 203.70557387552577 ) ( 289 408 203.70557387552577 ) rock3_7 0 0 0 1 1 +( 288 496 211.70557387552577 ) ( 289 496 211.70557387552577 ) ( 288 496 214.20557387552577 ) rock3_7 0 0 0 1 1 +( 288 408 211.70557387552577 ) ( 288 408 214.20557387552577 ) ( 288 410.5 211.70557387552577 ) rock3_7 0 0 0 1 1 +} +// brush 140 +{ +( 144 368 156.04154748824237 ) ( 144 370.5 156.04154748824237 ) ( 144 368 158.54154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 204.04154748824237 ) ( 216 410.5 204.04154748824237 ) ( 217 408 204.54154748824226 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 144 368 158.54154748824237 ) ( 145 368 156.54154748824226 ) rock3_7 0 0 0 1 1 +( 216 496 212.04154748824237 ) ( 217 496 212.54154748824226 ) ( 216 496 214.54154748824237 ) rock3_7 0 0 0 1 1 +( 144 368 156.04154748824237 ) ( 145 368 156.54154748824226 ) ( 144 370.5 156.04154748824237 ) rock3_7 0 0 0 1 1 +( 216 408 212.04154748824237 ) ( 216 408 214.54154748824237 ) ( 216 410.5 212.04154748824237 ) rock3_7 0 0 0 1 1 +} +// brush 141 +{ +( 280 488 96 ) ( 280 489 96 ) ( 280 488 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 280 488 120.5 ) ( 281 488 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 96 ) ( 281 488 96 ) ( 280 489 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 192 ) ( 288 497 192 ) ( 289 496 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 289 496 194 ) ( 288 496 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 194 ) ( 288 496 218.5 ) ( 288 497 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 142 +{ +( 280 368 96 ) ( 280 369 96 ) ( 280 368 120.5 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 280 368 120.5 ) ( 281 368 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 96 ) ( 281 368 96 ) ( 280 369 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 192 ) ( 288 377 192 ) ( 289 376 192 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 289 376 194 ) ( 288 376 218.5 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 194 ) ( 288 376 218.5 ) ( 288 377 194 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 143 +{ +( 280 320 96 ) ( 280 321 96 ) ( 280 320 114 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 280 320 114 ) ( 281 320 96 ) wood1_1 0 0 0 0.5 0.5 +( 280 320 96 ) ( 281 320 96 ) ( 280 321 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 329 168 ) ( 289 328 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 289 328 168 ) ( 288 328 186 ) wood1_1 0 0 0 0.5 0.5 +( 288 328 168 ) ( 288 328 186 ) ( 288 329 168 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 144 +{ +( 280 280 84 ) ( 280 281 84 ) ( 280 280 102 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 84 ) ( 280 280 102 ) ( 281 280 84 ) wood1_1 0 0 0 0.5 0.5 +( 280 280 96 ) ( 281 280 96 ) ( 280 281 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 289 156 ) ( 289 288 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 289 288 156 ) ( 288 288 174 ) wood1_1 0 0 0 0.5 0.5 +( 288 288 156 ) ( 288 288 174 ) ( 288 289 156 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 145 +{ +( 280 240 72 ) ( 280 241 72 ) ( 280 240 90 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 72 ) ( 280 240 90 ) ( 281 240 72 ) wood1_1 0 0 0 0.5 0.5 +( 280 240 96 ) ( 281 240 96 ) ( 280 241 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 249 144 ) ( 289 248 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 289 248 144 ) ( 288 248 162 ) wood1_1 0 0 0 0.5 0.5 +( 288 248 144 ) ( 288 248 162 ) ( 288 249 144 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 146 +{ +( 280 200 60 ) ( 280 201 60 ) ( 280 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 60 ) ( 280 200 78 ) ( 281 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 280 200 96 ) ( 281 200 96 ) ( 280 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 209 132 ) ( 289 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 289 208 132 ) ( 288 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 288 208 132 ) ( 288 208 150 ) ( 288 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 147 +{ +( 280 160 48 ) ( 280 161 48 ) ( 280 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 48 ) ( 280 160 66 ) ( 281 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 280 160 96 ) ( 281 160 96 ) ( 280 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 169 120 ) ( 289 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 289 168 120 ) ( 288 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 288 168 120 ) ( 288 168 138 ) ( 288 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 148 +{ +( 280 120 36 ) ( 280 121 36 ) ( 280 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 36 ) ( 280 120 54 ) ( 281 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 280 120 96 ) ( 281 120 96 ) ( 280 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 129 108 ) ( 289 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 289 128 108 ) ( 288 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 288 128 108 ) ( 288 128 126 ) ( 288 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 149 +{ +( -601 -159 -224 ) ( -567 896 -211 ) ( -254 696 96 ) rock5_2 -99.7577 -56.0318 91.3726 1.00041 -1.56658 +( -254 696 96 ) ( -236 34 96 ) ( -601 -159 -224 ) rock5_2 -99.7577 -56.0318 91.3726 1.00041 -1.56658 +( -254 696 96 ) ( -567 896 -211 ) ( -236 724 96 ) rock5_2 25.0672 -91.2499 57.2648 1.41747 -1.15095 +( -567 896 -211 ) ( 26 758.41632653068245 96 ) ( -236 724 96 ) rock5_2 54.115 -3.54416 0 1 1.01977 +( -601 -159 -224 ) ( -236 34 96 ) ( 254 16 96 ) rock5_2 -0.190712 -0.174206 0 0.995935 1.02211 +( 466.80769235638519 798 -213.29615384619328 ) ( -567 896 -211 ) ( -601 -159 -224 ) rock5_2 14.8242 -25.4298 0.26393 1.17597 1.16455 +( 399.44680855628229 368 96 ) ( 360 34 96 ) ( 254 16 96 ) rock5_2 0 0 0 1 1 +( -601 -159 -224 ) ( 412 -30 -207 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 14.8242 -25.4298 0.26393 1.17597 1.16455 +( 382 750 64 ) ( 26 758.41632653068245 96 ) ( -567 896 -211 ) rock5_2 54.115 -3.54416 0 1 1.01977 +( 254 736 96 ) ( 26 758.41632653068245 96 ) ( 382 750 64 ) rock5_2 61.8293 -4.19315 0 0.991304 1.02155 +( 382 750 64 ) ( 360 724 96 ) ( 254 736 96 ) rock5_2 54.0778 -3.51178 0 1 1.01968 +( 382 750 64 ) ( -567 896 -211 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 47.5125 -4.02612 0 0.998117 1.02231 +( 254 16 96 ) ( 412 -30 -207 ) ( -601 -159 -224 ) rock5_2 -32.5638 -0.0357803 0 1.0204 1.01254 +( 254 16 96 ) ( 360 34 96 ) ( 412 -30 -207 ) rock5_2 -23.0535 -0.0373173 0 1.04132 1.00839 +( 399.44680855628229 368 96 ) ( 360 724 96 ) ( 382 750 64 ) rock5_2 27.7235 -58.1963 4.24132 1.18369 1.03307 +( 399.44680855628229 368 96 ) ( 382 750 64 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 115.415 -52.8551 4.14293 1.21176 0.997091 +( 412 -30 -207 ) ( 360 34 96 ) ( 399.44680855628229 368 96 ) rock5_2 119.865 -53.6034 4.02599 1.24689 0.989531 +( 412 -30 -207 ) ( 399.44680855628229 368 96 ) ( 466.80769235638519 798 -213.29615384619328 ) rock5_2 115.415 -52.8551 4.14293 1.21176 0.997091 +} +// brush 150 +{ +( -236 112 114 ) ( -236 34 96 ) ( -236 303 96 ) rock5_2 16.815 0 0 1 1 +( -226 41 114 ) ( -236 34 96 ) ( -236 112 114 ) rock5_2 19.3038 -0.889084 0 1 1 +( -186 34 114 ) ( -236 34 96 ) ( -226 41 114 ) rock5_2 110.083 -0.0819645 0 1 1 +( -116 34 96 ) ( -236 34 96 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -236 34 96 ) ( -116 34 96 ) rock5_2 0 0 0 1 1 +( -236 112 114 ) ( -186 112 114 ) ( -186 34 114 ) rock5_2 0 0 0 1 1 +( -236 303 96 ) ( -186 112 114 ) ( -236 112 114 ) rock5_2 -3.95884 3.85601 0 1 1 +( -186 34 114 ) ( -186 112 114 ) ( -116 34 96 ) rock5_2 -9.04656 -65.2849 90 1 1 +( -129 117 96 ) ( -186 112 114 ) ( -236 303 96 ) rock5_2 -43.1704 -70.9503 299.911 1 1 +( -116 34 96 ) ( -186 112 114 ) ( -129 117 96 ) rock5_2 -9.80276 -60.6771 98.8998 1 1 +} +// brush 151 +{ +( 216 120 36 ) ( 216 121 36 ) ( 216 120 54 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 36 ) ( 216 120 54 ) ( 217 120 36 ) wood1_1 0 0 0 0.5 0.5 +( 216 120 96 ) ( 217 120 96 ) ( 216 121 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 129 108 ) ( 225 128 108 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 225 128 108 ) ( 224 128 126 ) wood1_1 0 0 0 0.5 0.5 +( 224 128 108 ) ( 224 128 126 ) ( 224 129 108 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 152 +{ +( 216 160 48 ) ( 216 161 48 ) ( 216 160 66 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 48 ) ( 216 160 66 ) ( 217 160 48 ) wood1_1 0 0 0 0.5 0.5 +( 216 160 96 ) ( 217 160 96 ) ( 216 161 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 169 120 ) ( 225 168 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 225 168 120 ) ( 224 168 138 ) wood1_1 0 0 0 0.5 0.5 +( 224 168 120 ) ( 224 168 138 ) ( 224 169 120 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 153 +{ +( 216 200 60 ) ( 216 201 60 ) ( 216 200 78 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 60 ) ( 216 200 78 ) ( 217 200 60 ) wood1_1 0 0 0 0.5 0.5 +( 216 200 96 ) ( 217 200 96 ) ( 216 201 96 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 209 132 ) ( 225 208 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 225 208 132 ) ( 224 208 150 ) wood1_1 0 0 0 0.5 0.5 +( 224 208 132 ) ( 224 208 150 ) ( 224 209 132 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 154 +{ +( 216 100 108 ) ( 216 88 108 ) ( 216 88 96 ) rock3_7 0 0 0 1 1.11111 +( 216 88 96 ) ( 216 88 108 ) ( 288 88 108 ) rock3_7 0 0 0 1 1 +( 288 88 108 ) ( 216 88 108 ) ( 216 100 108 ) rock3_7 0 0 0 1 1 +( 288 100 108 ) ( 216 100 108 ) ( 216 88 96 ) rock3_7 0 -52 0 1 1 +( 288 88 96 ) ( 288 88 108 ) ( 288 100 108 ) rock3_7 0 0 0 1 1.11111 +} +// brush 155 +{ +( 216 140 120 ) ( 216 128 120 ) ( 216 128 108 ) rock3_7 0 0 0 1 1.11111 +( 216 128 108 ) ( 216 128 120 ) ( 288 128 120 ) rock3_7 0 0 0 1 1 +( 288 128 120 ) ( 216 128 120 ) ( 216 140 120 ) rock3_7 0 0 0 1 1 +( 288 140 120 ) ( 216 140 120 ) ( 216 128 108 ) rock3_7 0 -52 0 1 1 +( 288 128 108 ) ( 288 128 120 ) ( 288 140 120 ) rock3_7 0 0 0 1 1.11111 +} +// brush 156 +{ +( 216 180 132 ) ( 216 168 132 ) ( 216 168 120 ) rock3_7 0 0 0 1 1.11111 +( 216 168 120 ) ( 216 168 132 ) ( 288 168 132 ) rock3_7 0 0 0 1 1 +( 288 168 132 ) ( 216 168 132 ) ( 216 180 132 ) rock3_7 0 0 0 1 1 +( 288 180 132 ) ( 216 180 132 ) ( 216 168 120 ) rock3_7 0 -52 0 1 1 +( 288 168 120 ) ( 288 168 132 ) ( 288 180 132 ) rock3_7 0 0 0 1 1.11111 +} +// brush 157 +{ +( 216 220 144 ) ( 216 208 144 ) ( 216 208 132 ) rock3_7 0 0 0 1 1.11111 +( 216 208 132 ) ( 216 208 144 ) ( 288 208 144 ) rock3_7 0 0 0 1 1 +( 288 208 144 ) ( 216 208 144 ) ( 216 220 144 ) rock3_7 0 0 0 1 1 +( 288 220 144 ) ( 216 220 144 ) ( 216 208 132 ) rock3_7 0 -52 0 1 1 +( 288 208 132 ) ( 288 208 144 ) ( 288 220 144 ) rock3_7 0 0 0 1 1.11111 +} +// brush 158 +{ +( 216 260 156 ) ( 216 248 156 ) ( 216 248 144 ) rock3_7 0 0 0 1 1.11111 +( 216 248 144 ) ( 216 248 156 ) ( 288 248 156 ) rock3_7 0 0 0 1 1 +( 288 248 156 ) ( 216 248 156 ) ( 216 260 156 ) rock3_7 0 0 0 1 1 +( 288 260 156 ) ( 216 260 156 ) ( 216 248 144 ) rock3_7 0 -52 0 1 1 +( 288 248 144 ) ( 288 248 156 ) ( 288 260 156 ) rock3_7 0 0 0 1 1.11111 +} +// brush 159 +{ +( 216 300 168 ) ( 216 288 168 ) ( 216 288 156 ) rock3_7 0 0 0 1 1.11111 +( 216 288 156 ) ( 216 288 168 ) ( 288 288 168 ) rock3_7 0 0 0 1 1 +( 288 288 168 ) ( 216 288 168 ) ( 216 300 168 ) rock3_7 0 0 0 1 1 +( 288 300 168 ) ( 216 300 168 ) ( 216 288 156 ) rock3_7 0 -52 0 1 1 +( 288 288 156 ) ( 288 288 168 ) ( 288 300 168 ) rock3_7 0 0 0 1 1.11111 +} +// brush 160 +{ +( 216 340 180 ) ( 216 328 180 ) ( 216 328 168 ) rock3_7 0 0 0 1 1.11111 +( 216 328 168 ) ( 216 328 180 ) ( 288 328 180 ) rock3_7 0 0 0 1 1 +( 288 328 180 ) ( 216 328 180 ) ( 216 340 180 ) rock3_7 0 0 0 1 1 +( 288 340 180 ) ( 216 340 180 ) ( 216 328 168 ) rock3_7 0 -52 0 1 1 +( 288 328 168 ) ( 288 328 180 ) ( 288 340 180 ) rock3_7 0 0 0 1 1.11111 +} +// brush 161 +{ +( 216 380 192 ) ( 216 368 192 ) ( 216 368 180 ) rock3_7 0 0 0 1 1.11111 +( 216 368 180 ) ( 216 368 192 ) ( 288 368 192 ) rock3_7 0 0 0 1 1 +( 288 368 192 ) ( 216 368 192 ) ( 216 380 192 ) rock3_7 0 0 0 1 1 +( 288 380 192 ) ( 216 380 192 ) ( 216 368 180 ) rock3_7 0 -52 0 1 1 +( 288 368 180 ) ( 288 368 192 ) ( 288 380 192 ) rock3_7 0 0 0 1 1.11111 +} +// brush 162 +{ +( 280 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) ( 280 488 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 280 488 228.45753068742539 ) ( 281 488 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 488 203.95753068742539 ) ( 281 488 203.95753068742539 ) ( 280 489 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 236 ) ( 288 497 236 ) ( 289 496 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 289 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 496 301.95753068742539 ) ( 288 496 326.45753068742539 ) ( 288 497 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 163 +{ +( 280 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) ( 280 368 228.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 280 368 228.20557387552628 ) ( 281 368 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 280 368 203.70557387552628 ) ( 281 368 203.70557387552628 ) ( 280 369 203.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 235.74804318810089 ) ( 288 377 235.74804318810089 ) ( 289 376 235.74804318810089 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 289 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) wood1_1 0 0 0 0.5 0.5 +( 288 376 301.70557387552628 ) ( 288 376 326.20557387552628 ) ( 288 377 301.70557387552628 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 164 +{ +( 280 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) ( 280 430 228.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 280 430 228.45753068742539 ) ( 281 430 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 430 203.95753068742539 ) ( 281 430 203.95753068742539 ) ( 280 431 203.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 236 ) ( 288 439 236 ) ( 289 438 236 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 289 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 438 301.95753068742539 ) ( 288 438 326.45753068742539 ) ( 288 439 301.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 165 +{ +( 280 429.70557387552628 244 ) ( 280 429.70557387552628 243 ) ( 280 454.20557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 280 368 244 ) ( 281 368 244 ) ( 280 368 243 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 289 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) wood1_1 0 0 270 0.5 0.5 +( 280 429.70557387552628 244 ) ( 280 454.20557387552628 244 ) ( 281 429.70557387552628 244 ) wood1_1 0 0 270 0.5 0.5 +( 288 496 236 ) ( 288 496 235 ) ( 289 496 236 ) wood1_1 0 0 270 0.5 0.5 +( 288 527.70557387552628 236 ) ( 288 552.20557387552628 236 ) ( 288 527.70557387552628 235 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 166 +{ +( 280 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) ( 280 328 216.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 280 328 216.45753068742539 ) ( 281 328 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 328 191.95753068742539 ) ( 281 328 191.95753068742539 ) ( 280 329 191.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 232 ) ( 288 337 232 ) ( 289 336 232 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 289 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 336 289.95753068742539 ) ( 288 336 314.45753068742539 ) ( 288 337 289.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 167 +{ +( 280 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) ( 280 288 204.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 280 288 204.45753068742539 ) ( 281 288 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 280 288 179.95753068742539 ) ( 281 288 179.95753068742539 ) ( 280 289 179.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 220 ) ( 288 297 220 ) ( 289 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 289 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) wood1_1 0 0 0 0.5 0.5 +( 288 296 277.95753068742539 ) ( 288 296 302.45753068742539 ) ( 288 297 277.95753068742539 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 168 +{ +( 280 248 168 ) ( 280 249 168 ) ( 280 248 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 280 248 192.50000000000051 ) ( 281 248 168 ) wood1_1 0 0 0 0.5 0.5 +( 280 248 168 ) ( 281 248 168 ) ( 280 249 168 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 208 ) ( 288 257 208 ) ( 289 256 208 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 289 256 266 ) ( 288 256 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 256 266 ) ( 288 256 290.50000000000051 ) ( 288 257 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 169 +{ +( 280 208 156 ) ( 280 209 156 ) ( 280 208 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 280 208 180.50000000000051 ) ( 281 208 156 ) wood1_1 0 0 0 0.5 0.5 +( 280 208 156 ) ( 281 208 156 ) ( 280 209 156 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 196 ) ( 288 217 196 ) ( 289 216 196 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 289 216 254 ) ( 288 216 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 216 254 ) ( 288 216 278.50000000000051 ) ( 288 217 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 170 +{ +( 280 168 144 ) ( 280 169 144 ) ( 280 168 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 280 168 168.50000000000051 ) ( 281 168 144 ) wood1_1 0 0 0 0.5 0.5 +( 280 168 144 ) ( 281 168 144 ) ( 280 169 144 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 184 ) ( 288 177 184 ) ( 289 176 184 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 289 176 242 ) ( 288 176 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 176 242 ) ( 288 176 266.50000000000051 ) ( 288 177 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 171 +{ +( 280 128 132 ) ( 280 129 132 ) ( 280 128 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 280 128 156.50000000000051 ) ( 281 128 132 ) wood1_1 0 0 0 0.5 0.5 +( 280 128 132 ) ( 281 128 132 ) ( 280 129 132 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 172 ) ( 288 137 172 ) ( 289 136 172 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 289 136 230 ) ( 288 136 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 136 230 ) ( 288 136 254.50000000000051 ) ( 288 137 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 172 +{ +( 280 88 120 ) ( 280 89 120 ) ( 280 88 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 280 88 144.50000000000051 ) ( 281 88 120 ) wood1_1 0 0 0 0.5 0.5 +( 280 88 120 ) ( 281 88 120 ) ( 280 89 120 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 160 ) ( 288 97 160 ) ( 289 96 160 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 289 96 218 ) ( 288 96 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 288 96 218 ) ( 288 96 242.50000000000051 ) ( 288 97 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 173 +{ +( 280 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) ( 280 48 138.57441256965544 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 280 48 138.57441256965544 ) ( 281 48 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 280 48 107.95753068742488 ) ( 281 48 107.95753068742488 ) ( 280 49 107.95753068742488 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 148 ) ( 288 57 148 ) ( 289 56 148 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 289 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 288 56 230.42505821634469 ) ( 288 56 261.04194009857531 ) ( 288 57 230.42505821634469 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 174 +{ +( 280 56 148 ) ( 280 56 147 ) ( 280 80.500000000000512 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 281 56 148 ) ( 280 56 147 ) wood1_1 0 0 270 0.5 0.5 +( 280 56 148 ) ( 280 80.500000000000512 151.05844094111507 ) ( 281 56 148 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 289 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 88.042469312575122 144 ) ( 288 88.042469312575122 143 ) ( 289 88.042469312575122 144 ) wood1_1 0 0 270 0.5 0.5 +( 288 154 152.23376376445992 ) ( 288 178.5000000000006 155.29220470557499 ) ( 288 154 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 175 +{ +( 280 96 160 ) ( 280 96 159 ) ( 280 120.50000000000051 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 281 96 160 ) ( 280 96 159 ) wood1_1 0 0 270 0.5 0.5 +( 280 96 160 ) ( 280 120.50000000000051 163.05844094111507 ) ( 281 96 160 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 289 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 128.04246931257512 156 ) ( 288 128.04246931257512 155 ) ( 289 128.04246931257512 156 ) wood1_1 0 0 270 0.5 0.5 +( 288 194 164.23376376445992 ) ( 288 218.5000000000006 167.29220470557499 ) ( 288 194 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 176 +{ +( 280 136 172 ) ( 280 136 171 ) ( 280 160.50000000000051 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 281 136 172 ) ( 280 136 171 ) wood1_1 0 0 270 0.5 0.5 +( 280 136 172 ) ( 280 160.50000000000051 175.05844094111507 ) ( 281 136 172 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 289 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 168.04246931257512 168 ) ( 288 168.04246931257512 167 ) ( 289 168.04246931257512 168 ) wood1_1 0 0 270 0.5 0.5 +( 288 234 176.23376376445992 ) ( 288 258.50000000000057 179.29220470557499 ) ( 288 234 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 177 +{ +( 280 176 184 ) ( 280 176 183 ) ( 280 200.50000000000051 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 281 176 184 ) ( 280 176 183 ) wood1_1 0 0 270 0.5 0.5 +( 280 176 184 ) ( 280 200.50000000000051 187.05844094111507 ) ( 281 176 184 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 289 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 208.04246931257512 180 ) ( 288 208.04246931257512 179 ) ( 289 208.04246931257512 180 ) wood1_1 0 0 270 0.5 0.5 +( 288 274 188.23376376445992 ) ( 288 298.50000000000057 191.29220470557499 ) ( 288 274 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 178 +{ +( 280 216 196 ) ( 280 216 195 ) ( 280 240.50000000000051 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 281 216 196 ) ( 280 216 195 ) wood1_1 0 0 270 0.5 0.5 +( 280 216 196 ) ( 280 240.50000000000051 199.05844094111507 ) ( 281 216 196 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 289 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 248.04246931257512 192 ) ( 288 248.04246931257512 191 ) ( 289 248.04246931257512 192 ) wood1_1 0 0 270 0.5 0.5 +( 288 314 200.23376376445992 ) ( 288 338.50000000000057 203.29220470557499 ) ( 288 314 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 179 +{ +( 280 256 208 ) ( 280 256 207 ) ( 280 280.50000000000051 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 281 256 208 ) ( 280 256 207 ) wood1_1 0 0 270 0.5 0.5 +( 280 256 208 ) ( 280 280.50000000000051 211.05844094111507 ) ( 281 256 208 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 289 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 288.04246931257512 204 ) ( 288 288.04246931257512 203 ) ( 289 288.04246931257512 204 ) wood1_1 0 0 270 0.5 0.5 +( 288 354 212.23376376445992 ) ( 288 378.50000000000057 215.29220470557499 ) ( 288 354 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 180 +{ +( 280 296 220 ) ( 280 296 219 ) ( 280 320.50000000000051 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 281 296 220 ) ( 280 296 219 ) wood1_1 0 0 270 0.5 0.5 +( 280 296 220 ) ( 280 320.50000000000051 223.05844094111507 ) ( 281 296 220 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 289 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 328.04246931257512 216 ) ( 288 328.04246931257512 215 ) ( 289 328.04246931257512 216 ) wood1_1 0 0 270 0.5 0.5 +( 288 394 224.23376376445992 ) ( 288 418.50000000000057 227.29220470557499 ) ( 288 394 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 181 +{ +( 280 336 232 ) ( 280 336 231 ) ( 280 360.50000000000051 235.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 281 336 232 ) ( 280 336 231 ) wood1_1 0 0 270 0.5 0.5 +( 280 336 232 ) ( 280 360.50000000000051 235.05844094111507 ) ( 281 336 232 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 289 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 288 368.04246931257512 228 ) ( 288 368.04246931257512 227 ) ( 289 368.04246931257512 228 ) wood1_1 0 0 270 0.5 0.5 +( 288 434 236.23376376445992 ) ( 288 458.50000000000057 239.29220470557499 ) ( 288 434 235.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 182 +{ +( 216 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 216 47.957530687424878 138.57441256965546 ) ( 217 47.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 216 47.957530687424878 107.95753068742489 ) ( 217 47.957530687424878 107.95753068742489 ) ( 216 48.957530687424878 107.95753068742489 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 148 ) ( 224 56.957530687424878 148 ) ( 225 55.957530687424878 148 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 225 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) wood1_1 0 0 0 0.5 0.5 +( 224 55.957530687424878 230.42505821634472 ) ( 224 55.957530687424878 261.04194009857531 ) ( 224 56.957530687424878 230.42505821634472 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 183 +{ +( 216 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) ( 216 80.45753068742539 151.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 217 55.957530687424878 148 ) ( 216 55.957530687424878 147 ) wood1_1 0 0 270 0.5 0.5 +( 216 55.957530687424878 148 ) ( 216 80.45753068742539 151.05844094111507 ) ( 217 55.957530687424878 148 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 225 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 88 144 ) ( 224 88 143 ) ( 225 88 144 ) wood1_1 0 0 270 0.5 0.5 +( 224 153.95753068742488 152.23376376445992 ) ( 224 178.45753068742547 155.29220470557499 ) ( 224 153.95753068742488 151.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 184 +{ +( 216 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 216 87.957530687424878 144.50000000000051 ) ( 217 87.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 216 87.957530687424878 120 ) ( 217 87.957530687424878 120 ) ( 216 88.957530687424878 120 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 160 ) ( 224 96.957530687424878 160 ) ( 225 95.957530687424878 160 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 225 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 95.957530687424878 218 ) ( 224 95.957530687424878 242.50000000000051 ) ( 224 96.957530687424878 218 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 185 +{ +( 216 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) ( 216 120.45753068742539 163.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 217 95.957530687424878 160 ) ( 216 95.957530687424878 159 ) wood1_1 0 0 270 0.5 0.5 +( 216 95.957530687424878 160 ) ( 216 120.45753068742539 163.05844094111507 ) ( 217 95.957530687424878 160 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 225 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 128 156 ) ( 224 128 155 ) ( 225 128 156 ) wood1_1 0 0 270 0.5 0.5 +( 224 193.95753068742488 164.23376376445992 ) ( 224 218.45753068742545 167.29220470557499 ) ( 224 193.95753068742488 163.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 186 +{ +( 216 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 216 127.95753068742488 156.50000000000051 ) ( 217 127.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 216 127.95753068742488 132 ) ( 217 127.95753068742488 132 ) ( 216 128.95753068742488 132 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 172 ) ( 224 136.95753068742488 172 ) ( 225 135.95753068742488 172 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 225 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 135.95753068742488 230 ) ( 224 135.95753068742488 254.50000000000051 ) ( 224 136.95753068742488 230 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 187 +{ +( 216 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) ( 216 160.45753068742539 175.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 217 135.95753068742488 172 ) ( 216 135.95753068742488 171 ) wood1_1 0 0 270 0.5 0.5 +( 216 135.95753068742488 172 ) ( 216 160.45753068742539 175.05844094111507 ) ( 217 135.95753068742488 172 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 225 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 168 168 ) ( 224 168 167 ) ( 225 168 168 ) wood1_1 0 0 270 0.5 0.5 +( 224 233.95753068742488 176.23376376445992 ) ( 224 258.45753068742545 179.29220470557499 ) ( 224 233.95753068742488 175.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 188 +{ +( 216 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 216 167.95753068742488 168.50000000000051 ) ( 217 167.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 216 167.95753068742488 144 ) ( 217 167.95753068742488 144 ) ( 216 168.95753068742488 144 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 184 ) ( 224 176.95753068742488 184 ) ( 225 175.95753068742488 184 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 225 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 175.95753068742488 242 ) ( 224 175.95753068742488 266.50000000000051 ) ( 224 176.95753068742488 242 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 189 +{ +( 216 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) ( 216 200.45753068742539 187.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 217 175.95753068742488 184 ) ( 216 175.95753068742488 183 ) wood1_1 0 0 270 0.5 0.5 +( 216 175.95753068742488 184 ) ( 216 200.45753068742539 187.05844094111507 ) ( 217 175.95753068742488 184 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 225 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 208 180 ) ( 224 208 179 ) ( 225 208 180 ) wood1_1 0 0 270 0.5 0.5 +( 224 273.95753068742488 188.23376376445992 ) ( 224 298.45753068742545 191.29220470557499 ) ( 224 273.95753068742488 187.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 190 +{ +( 216 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 216 207.95753068742488 180.50000000000051 ) ( 217 207.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 216 207.95753068742488 156 ) ( 217 207.95753068742488 156 ) ( 216 208.95753068742488 156 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 196 ) ( 224 216.95753068742488 196 ) ( 225 215.95753068742488 196 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 225 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 215.95753068742488 254 ) ( 224 215.95753068742488 278.50000000000051 ) ( 224 216.95753068742488 254 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 191 +{ +( 216 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) ( 216 240.45753068742539 199.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 217 215.95753068742488 196 ) ( 216 215.95753068742488 195 ) wood1_1 0 0 270 0.5 0.5 +( 216 215.95753068742488 196 ) ( 216 240.45753068742539 199.05844094111507 ) ( 217 215.95753068742488 196 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 225 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 248 192 ) ( 224 248 191 ) ( 225 248 192 ) wood1_1 0 0 270 0.5 0.5 +( 224 313.95753068742488 200.23376376445992 ) ( 224 338.45753068742545 203.29220470557499 ) ( 224 313.95753068742488 199.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 192 +{ +( 216 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 216 247.95753068742488 192.50000000000051 ) ( 217 247.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 216 247.95753068742488 168 ) ( 217 247.95753068742488 168 ) ( 216 248.95753068742488 168 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 208 ) ( 224 256.95753068742488 208 ) ( 225 255.95753068742488 208 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 225 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 255.95753068742488 266 ) ( 224 255.95753068742488 290.50000000000051 ) ( 224 256.95753068742488 266 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 193 +{ +( 216 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) ( 216 280.45753068742539 211.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 217 255.95753068742488 208 ) ( 216 255.95753068742488 207 ) wood1_1 0 0 270 0.5 0.5 +( 216 255.95753068742488 208 ) ( 216 280.45753068742539 211.05844094111507 ) ( 217 255.95753068742488 208 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 225 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 224 288 204 ) ( 224 288 203 ) ( 225 288 204 ) wood1_1 0 0 270 0.5 0.5 +( 224 353.95753068742488 212.23376376445992 ) ( 224 378.45753068742545 215.29220470557499 ) ( 224 353.95753068742488 211.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 194 +{ +( 216 288 180 ) ( 216 289 180 ) ( 216 288 204.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 216 288 204.50000000000051 ) ( 217 288 180 ) wood1_1 0 0 0 0.5 0.5 +( 216 288 180 ) ( 217 288 180 ) ( 216 289 180 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 220 ) ( 224 297 220 ) ( 225 296 220 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 225 296 278 ) ( 224 296 302.50000000000051 ) wood1_1 0 0 0 0.5 0.5 +( 224 296 278 ) ( 224 296 302.50000000000051 ) ( 224 297 278 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 195 +{ +( 176 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) ( 176 288 216.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 176 288 216.30347303743031 ) ( 177 288 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 176 288 191.8034730374298 ) ( 177 288 191.8034730374298 ) ( 176 289 191.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 231.8034730374298 ) ( 184 297 231.8034730374298 ) ( 185 296 231.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 185 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) wood1_1 0 0 0 0.5 0.5 +( 184 296 289.8034730374298 ) ( 184 296 314.30347303743031 ) ( 184 297 289.8034730374298 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 196 +{ +( 184 296 216 ) ( 184 296 215 ) ( 184 297 216 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 118.04246931257512 297 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 288 219 ) ( 191.54246931257461 288 223.05844094111507 ) wood1_1 0 0 270 0.5 0.5 +( 118.04246931257512 296 224.23376376445992 ) ( 93.542469312574553 296 227.29220470557499 ) ( 118.04246931257512 296 223.23376376445992 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 191.54246931257461 288 223.05844094111507 ) ( 216.04246931257512 289 220 ) wood1_1 0 0 270 0.5 0.5 +( 216.04246931257512 288 220 ) ( 216.04246931257512 289 220 ) ( 216.04246931257512 288 219 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 197 +{ +( -64 48 96 ) ( -32 136 96 ) ( -32 136 104 ) rock5_2 0 0 0 1 1 +( -32 136 96 ) ( 144 160 96 ) ( -32 136 104 ) rock5_2 -2.90909 0 0 1 1 +( -32 136 104 ) ( -8 72 104 ) ( -64 48 96 ) rock5_2 -43.879 26.0995 110.556 1 1 +( -32 136 104 ) ( 96 104 112 ) ( -8 72 104 ) rock5_2 0 0 0 1 1 +( -64 48 96 ) ( -8 72 104 ) ( 128 64 104 ) rock5_2 110.318 -62.5274 2.07141 1 1 +( -8 72 104 ) ( 96 104 112 ) ( 128 64 104 ) rock5_2 0 0 0 1 1 +( -64 48 96 ) ( 152 56 96 ) ( 144 160 96 ) rock5_2 0 0 0 1 1 +( 144 160 96 ) ( 96 104 112 ) ( -32 136 104 ) rock5_2 17.3006 6.65796 345.964 1 1 +( 128 64 104 ) ( 152 56 96 ) ( -64 48 96 ) rock5_2 -9.94592 -54.1466 3.01279 1 1 +( 128 64 104 ) ( 96 104 112 ) ( 144 160 96 ) rock5_2 70.3425 4.33401 105.255 1 1 +( 144 160 96 ) ( 152 56 96 ) ( 128 64 104 ) rock5_2 -102.044 -5.47133 90 1 1 +} +// brush 198 +{ +( -573 354 -192 ) ( -576 982 -192 ) ( -576 35 96 ) rock5_2 0 0 0 1 1 +( -576 982 -192 ) ( -536 883 95 ) ( -576 35 96 ) rock5_2 0 0 0 1 1 +( -576 35 96 ) ( -536 883 95 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -576 35 96 ) ( -346 354 -192 ) ( -573 354 -192 ) rock5_2 0 34 0 1 1 +( -573 354 -192 ) ( -346 354 -192 ) ( -346 747 -192 ) rock5_2 0 0 0 1 1 +( -536 883 95 ) ( -319 866 97 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -271 78 68 ) ( -346 354 -192 ) ( -576 35 96 ) rock5_2 115.919 96.1237 0 1 1 +( -576 982 -192 ) ( -319 866 97 ) ( -536 883 95 ) rock5_2 126 0 0 1 1 +( -271 78 68 ) ( -576 35 96 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -319 866 97 ) ( -245.61737958491773 821 96.220196353471479 ) ( -282 822 109.52639018344834 ) rock5_2 0 0 0 1 1 +( -282 822 109.52639018344834 ) ( -245.61737958491773 821 96.220196353471479 ) ( -271 78 68 ) rock5_2 0 0 0 1 1 +( -576 982 -192 ) ( -245.61737958491773 821 96.220196353471479 ) ( -319 866 97 ) rock5_2 108.883 -64.1155 0 1 1 +( -346 747 -192 ) ( -245.61737958491773 821 96.220196353471479 ) ( -576 982 -192 ) rock5_2 -48.8613 -112.517 0 1 1 +( -346 354 -192 ) ( -245.61737958491773 821 96.220196353471479 ) ( -346 747 -192 ) rock5_2 -97 -97 0 1 1 +( -271 78 68 ) ( -245.61737958491773 821 96.220196353471479 ) ( -346 354 -192 ) rock5_2 -34.4345 -80.7516 0 1 1 +} +// brush 199 +{ +( -288 304 200 ) ( -288 305 200 ) ( -288 304 201 ) wizwood1_4 0 0 0 1 1 +( -288 304 200 ) ( -288 304 201 ) ( -287 304 200 ) wizwood1_4 0 0 0 1 1 +( -288 304 200 ) ( -287 304 200 ) ( -288 305 200 ) wizwood1_4 0 0 0 1 1 +( -164 364 204 ) ( -164 365 204 ) ( -163 364 204 ) wizwood1_4 -15.9126 87.3333 0 1.01022 0.76 +( -164 364 204 ) ( -163 364 204 ) ( -164 364 205 ) wizwood1_4 0 0 0 1 1 +( -164 364 204 ) ( -164 364 205 ) ( -164 365 204 ) wizwood1_4 0 0 0 1 1 +} +// brush 200 +{ +( -289 312 200 ) ( -289 312 224.50000000000011 ) ( -289 311 200 ) wood1_1 0 0 0 0.5 0.5 +( -281 304 298 ) ( -281 304 322.50000000000011 ) ( -280 304 298 ) wood1_1 0 0 0 0.5 0.5 +( -289 312 200 ) ( -289 311 200 ) ( -288 312 200 ) wood1_1 0 0 0 0.5 0.5 +( -281 304 232.04246931257472 ) ( -280 304 232.04246931257472 ) ( -281 303 232.04246931257472 ) wood1_1 0 0 0 0.5 0.5 +( -289 312 200 ) ( -288 312 200 ) ( -289 312 224.50000000000011 ) wood1_1 0 0 0 0.5 0.5 +( -281 304 298 ) ( -281 303 298 ) ( -281 304 322.50000000000011 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 201 +{ +( -289 312 240.29442612447383 ) ( -289 311 240.29442612447383 ) ( -289 312 239.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 304 232.29442612447383 ) ( -104.79442612447366 304 232.29442612447383 ) ( -129.29442612447366 304 231.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 304 232.29442612447383 ) ( -129.29442612447366 303 232.29442612447383 ) ( -104.79442612447366 304 232.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 312 240.29442612447383 ) ( -202.79442612447366 312 240.29442612447383 ) ( -227.29442612447366 311 240.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 312 240.29442612447383 ) ( -227.29442612447366 312 239.29442612447383 ) ( -202.79442612447366 312 240.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +( -161 304 232.29442612447383 ) ( -161 304 231.29442612447383 ) ( -161 303 232.29442612447383 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 202 +{ +( -227 312 200.25195681189922 ) ( -227 312 224.75195681189922 ) ( -227 311 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -219 304 298.25195681189922 ) ( -219 304 322.75195681189922 ) ( -218 304 298.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -227 312 200.25195681189922 ) ( -227 311 200.25195681189922 ) ( -226 312 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -219 304 232.29442612447383 ) ( -218 304 232.29442612447383 ) ( -219 303 232.29442612447383 ) wood1_1 0 0 0 0.5 0.5 +( -227 312 200.25195681189922 ) ( -226 312 200.25195681189922 ) ( -227 312 224.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -219 304 298.25195681189922 ) ( -219 303 298.25195681189922 ) ( -219 304 322.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 203 +{ +( -169 312 200.25195681189922 ) ( -169 312 224.75195681189922 ) ( -169 311 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -161 304 298.25195681189922 ) ( -161 304 322.75195681189922 ) ( -160 304 298.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -169 312 200.25195681189922 ) ( -169 311 200.25195681189922 ) ( -168 312 200.25195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -161 304 232.29442612447383 ) ( -160 304 232.29442612447383 ) ( -161 303 232.29442612447383 ) wood1_1 0 0 0 0.5 0.5 +( -169 312 200.25195681189922 ) ( -168 312 200.25195681189922 ) ( -169 312 224.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +( -161 304 298.25195681189922 ) ( -161 303 298.25195681189922 ) ( -161 304 322.75195681189922 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 204 +{ +( -289 364 199.42942638075561 ) ( -289 364 223.92942638075573 ) ( -289 363 199.42942638075561 ) wood1_1 0 0 0 0.5 0.5 +( -281 356 297.42942638075561 ) ( -281 356 321.92942638075573 ) ( -280 356 297.42942638075561 ) wood1_1 0 0 0 0.5 0.5 +( -289 364 199.42942638075561 ) ( -289 363 199.42942638075561 ) ( -288 364 199.42942638075561 ) wood1_1 0 0 0 0.5 0.5 +( -281 356 231.47189569333034 ) ( -280 356 231.47189569333034 ) ( -281 355 231.47189569333034 ) wood1_1 0 0 0 0.5 0.5 +( -289 364 199.42942638075561 ) ( -288 364 199.42942638075561 ) ( -289 364 223.92942638075573 ) wood1_1 0 0 0 0.5 0.5 +( -281 356 297.42942638075561 ) ( -281 355 297.42942638075561 ) ( -281 356 321.92942638075573 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 205 +{ +( -289 364 239.72385250522944 ) ( -289 363 239.72385250522944 ) ( -289 364 238.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 356 231.72385250522944 ) ( -104.79442612447366 356 231.72385250522944 ) ( -129.29442612447366 356 230.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -129.29442612447366 356 231.72385250522944 ) ( -129.29442612447366 355 231.72385250522944 ) ( -104.79442612447366 356 231.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 364 239.72385250522944 ) ( -202.79442612447366 364 239.72385250522944 ) ( -227.29442612447366 363 239.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -227.29442612447366 364 239.72385250522944 ) ( -227.29442612447366 364 238.72385250522944 ) ( -202.79442612447366 364 239.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +( -161 356 231.72385250522944 ) ( -161 356 230.72385250522944 ) ( -161 355 231.72385250522944 ) wood1_1 0 0 270 0.5 0.5 +} +// brush 206 +{ +( -227 364 199.68138319265483 ) ( -227 364 224.18138319265483 ) ( -227 363 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -219 356 297.68138319265483 ) ( -219 356 322.18138319265483 ) ( -218 356 297.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -227 364 199.68138319265483 ) ( -227 363 199.68138319265483 ) ( -226 364 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -219 356 231.72385250522944 ) ( -218 356 231.72385250522944 ) ( -219 355 231.72385250522944 ) wood1_1 0 0 0 0.5 0.5 +( -227 364 199.68138319265483 ) ( -226 364 199.68138319265483 ) ( -227 364 224.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -219 356 297.68138319265483 ) ( -219 355 297.68138319265483 ) ( -219 356 322.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 207 +{ +( -169 364 199.68138319265483 ) ( -169 364 224.18138319265483 ) ( -169 363 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -161 356 297.68138319265483 ) ( -161 356 322.18138319265483 ) ( -160 356 297.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -169 364 199.68138319265483 ) ( -169 363 199.68138319265483 ) ( -168 364 199.68138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -161 356 231.72385250522944 ) ( -160 356 231.72385250522944 ) ( -161 355 231.72385250522944 ) wood1_1 0 0 0 0.5 0.5 +( -169 364 199.68138319265483 ) ( -168 364 199.68138319265483 ) ( -169 364 224.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +( -161 356 297.68138319265483 ) ( -161 355 297.68138319265483 ) ( -161 356 322.18138319265483 ) wood1_1 0 0 0 0.5 0.5 +} +// brush 208 +{ +( 602.79030032089656 32 342.54545454540494 ) ( 592 800 -192 ) ( 608.56701126942755 608 288 ) rock5_2 -21.0294 0 0 0.971939 1.00004 +( 642.05128205128426 64 -176 ) ( 592 800 -192 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -5.97406 -0.00647736 0 1.00067 1.0003 +( 704 -448 -256 ) ( 642.05128205128426 64 -176 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -6.33521 -0.00655365 0 0.995248 1.00029 +( 592 800 -192 ) ( 704 1088 384 ) ( 608.56701126942755 608 288 ) rock5_2 0 0 0 1 1 +( 704 -448 384 ) ( 704 -448 -256 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -14.9333 0 0 1.03448 1 +( 704 -448 -256 ) ( 592 800 -192 ) ( 642.05128205128426 64 -176 ) rock5_2 0 0 0 1 1 +( 608.56701126942755 608 288 ) ( 704 1088 384 ) ( 720 976 480 ) rock5_2 0 0 0 1 1 +( 704 1088 -256 ) ( 704 1088 384 ) ( 592 800 -192 ) rock5_2 0 0 0 1 1 +( 602.79030032089656 32 342.54545454540494 ) ( 608.56701126942755 608 288 ) ( 712.62921348343843 320 563.77528089944826 ) rock5_2 -41.6048 0.0569458 0 0.962897 1.00035 +( 608.56701126942755 608 288 ) ( 720 976 480 ) ( 712.62921348343843 320 563.77528089944826 ) rock5_2 0 0 0 1 1 +( 712.62921348343843 320 563.77528089944826 ) ( 704 -448 384 ) ( 602.79030032089656 32 342.54545454540494 ) rock5_2 -86.8117 0.675323 0 1.03139 1.00381 +( 712.62921348343843 320 563.77528089944826 ) ( 736 -384 430.98127340805593 ) ( 704 -448 384 ) rock5_2 107.333 105.688 0 1 1 +( 704 1088 -256 ) ( 592 800 -192 ) ( 704 -448 -256 ) rock5_2 -90.6667 101.333 0 1 1 +( 768 -448 -256 ) ( 704 -448 -256 ) ( 704 -448 384 ) rock5_2 0 0 0 1 1 +( 736 -384 430.98127340805593 ) ( 768 -448 384 ) ( 704 -448 384 ) rock5_2 0 0 0 1 1 +( 704 1088 -256 ) ( 704 -448 -256 ) ( 768 -448 -256 ) rock5_2 0 0 0 1 1 +( 720 976 480 ) ( 704 1088 384 ) ( 768 1088 384 ) rock5_2 0 0 0 1 1 +( 768 1088 384 ) ( 704 1088 384 ) ( 704 1088 -256 ) rock5_2 0 0 0 1 1 +( 712.62921348343843 320 563.77528089944826 ) ( 768 -448 384 ) ( 736 -384 430.98127340805593 ) rock5_2 19.4806 105.306 0 1 1 +( 712.62921348343843 320 563.77528089944826 ) ( 720 976 480 ) ( 768 1088 384 ) rock5_2 101.333 -26.6667 0 1 1 +( 924.4444444446334 208 128 ) ( 768 -448 384 ) ( 712.62921348343843 320 563.77528089944826 ) rock5_2 101.333 -26.6667 0 1 1 +( 924.4444444446334 208 128 ) ( 712.62921348343843 320 563.77528089944826 ) ( 768 1088 384 ) rock5_2 101.333 -26.6667 0 1 1 +( 924.4444444446334 208 128 ) ( 768 1088 -256 ) ( 768 -448 -256 ) rock5_2 0 0 0 1 1 +( 768 -448 -256 ) ( 768 -448 384 ) ( 924.4444444446334 208 128 ) rock5_2 0 0 0 1 1 +( 848 704 112 ) ( 768 1088 384 ) ( 768 1088 -256 ) rock5_2 0 0 0 1 1 +( 924.4444444446334 208 128 ) ( 768 1088 384 ) ( 848 704 112 ) rock5_2 0 0 0 1 1 +( 848 704 112 ) ( 768 1088 -256 ) ( 924.4444444446334 208 128 ) rock5_2 0 0 0 1 1 +} +// brush 209 +{ +( -643.55557174006481 -448 -256 ) ( -800 432 128 ) ( -723.55556364779704 -64 112 ) rock5_2 0 0 0 1 1 +( -723.55556364779704 -64 112 ) ( -800 432 128 ) ( -643.55557173997511 -448 384 ) rock5_2 0 0 0 1 1 +( -643.55557173997511 -448 384 ) ( -643.55557174006481 -448 -256 ) ( -723.55556364779704 -64 112 ) rock5_2 0 0 0 1 1 +( -643.55553937122022 1088 -256 ) ( -643.55553937111335 1088 384 ) ( -800 432 128 ) rock5_2 0 0 0 1 1 +( -643.55553937122022 1088 -256 ) ( -800 432 128 ) ( -643.55557174006481 -448 -256 ) rock5_2 0 0 0 1 1 +( -643.55557173997511 -448 384 ) ( -800 432 128 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 101.333 -26.6667 0 1 1 +( -800 432 128 ) ( -643.55553937111335 1088 384 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 101.333 -26.6667 0 1 1 +( -588.1847690384011 320 563.77528089871885 ) ( -595.55556937973358 -336 480 ) ( -643.55557173997511 -448 384 ) rock5_2 101.333 -26.6667 0 1 1 +( -643.55553937111335 1088 384 ) ( -611.55554071989502 1024 430.98127340813278 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 19.4806 105.306 0 1 1 +( -579.5555717399327 -448 384 ) ( -579.55557173951888 -448 -256 ) ( -643.55557174006481 -448 -256 ) rock5_2 0 0 0 1 1 +( -643.55557173997511 -448 384 ) ( -595.55556937973358 -336 480 ) ( -579.5555717399327 -448 384 ) rock5_2 0 0 0 1 1 +( -643.55557174006481 -448 -256 ) ( -579.55557173951888 -448 -256 ) ( -579.55553937117986 1088 -256 ) rock5_2 0 0 0 1 1 +( -579.55553937127502 1088 384 ) ( -611.55554071989502 1024 430.98127340813278 ) ( -643.55553937111335 1088 384 ) rock5_2 0 0 0 1 1 +( -579.55553937127502 1088 384 ) ( -643.55553937111335 1088 384 ) ( -643.55553937122022 1088 -256 ) rock5_2 0 0 0 1 1 +( -579.55553937117986 1088 -256 ) ( -579.55557173951888 -448 -256 ) ( -467.55556567078224 -160 -192 ) rock5_2 -90.6667 101.333 0 1 1 +( -588.1847690384011 320 563.77528089871885 ) ( -611.55554071989502 1024 430.98127340813278 ) ( -579.55553937127502 1088 384 ) rock5_2 107.333 105.688 0 1 1 +( -467.55556567078224 -160 -192 ) ( -579.55557173951888 -448 -256 ) ( -579.5555717399327 -448 384 ) rock5_2 0 0 0 1 1 +( -508.12257289416505 60 288 ) ( -595.55556937973358 -336 480 ) ( -588.1847690384011 320 563.77528089871885 ) rock5_2 -75.3996 0.161095 0 1.01496 1.00124 +( -467.55556567078224 -160 -192 ) ( -517.60683221204999 576 -176 ) ( -579.55553937117986 1088 -256 ) rock5_2 0 0 0 1 1 +( -579.5555717399327 -448 384 ) ( -595.55556937973358 -336 480 ) ( -508.12257289416505 60 288 ) rock5_2 -46.3535 0.0297318 0 1.0473 1.00027 +( -508.12257289416505 60 288 ) ( -588.1847690384011 320 563.77528089871885 ) ( -579.55553937127502 1088 384 ) rock5_2 -61.9465 0.0656891 0 0.980902 1.00062 +( -467.55556567078224 -160 -192 ) ( -579.5555717399327 -448 384 ) ( -508.12257289416505 60 288 ) rock5_2 -13.9124 0 0 1.06481 1.00009 +( -579.55553937117986 1088 -256 ) ( -517.60683221204999 576 -176 ) ( -579.55553937127502 1088 384 ) rock5_2 0 0 0 1 1 +( -467.55556567078224 -160 -192 ) ( -508.12257289416505 60 288 ) ( -579.55553937127502 1088 384 ) rock5_2 -19.2738 0.00149345 0 0.970478 1.00011 +( -579.55553937127502 1088 384 ) ( -517.60683221204999 576 -176 ) ( -467.55556567078224 -160 -192 ) rock5_2 -18.286 0 0 0.975212 1.00006 +} +// brush 210 +{ +( -688 -512 384 ) ( -688 -512 -256 ) ( -688 -448 -256 ) rock5_2 0 0 0 1 1 +( -576 -496 480 ) ( -688 -512 384 ) ( -688 -448 384 ) rock5_2 0 0 0 1 1 +( -688 -512 384 ) ( -400 -624 -192 ) ( -688 -512 -256 ) rock5_2 0 0 0 1 1 +( -304 -368 112 ) ( -688 -448 384 ) ( -688 -448 -256 ) rock5_2 0 0 0 1 1 +( -688 -512 384 ) ( -208 -607.4329927766596 288 ) ( -400 -624 -192 ) rock5_2 0 0 0 1 1 +( 192 -291.55556567081601 128 ) ( -688 -448 384 ) ( -304 -368 112 ) rock5_2 0 0 0 1 1 +( -304 -368 112 ) ( -688 -448 -256 ) ( 192 -291.55556567081601 128 ) rock5_2 0 0 0 1 1 +( -576 -496 480 ) ( -208 -607.4329927766596 288 ) ( -688 -512 384 ) rock5_2 0 0 0 1 1 +( -576 -496 480 ) ( 80 -503.37079663222687 563.7752808984078 ) ( -208 -607.4329927766596 288 ) rock5_2 0 0 0 1 1 +( -688 -448 384 ) ( 80 -503.37079663222687 563.7752808984078 ) ( -576 -496 480 ) rock5_2 101.333 -26.6667 0 1 1 +( 192 -291.55556567081601 128 ) ( 80 -503.37079663222687 563.7752808984078 ) ( -688 -448 384 ) rock5_2 101.333 -26.6667 0 1 1 +( -688 -512 -256 ) ( -400 -624 -192 ) ( 848 -512 -256 ) rock5_2 -90.6667 101.333 0 1 1 +( -688 -512 -256 ) ( 848 -512 -256 ) ( 848 -448 -256 ) rock5_2 0 0 0 1 1 +( 192 -291.55556567081601 128 ) ( -688 -448 -256 ) ( 848 -448 -256 ) rock5_2 0 0 0 1 1 +( 192 -291.55556567081601 128 ) ( 848 -448 384 ) ( 80 -503.37079663222687 563.7752808984078 ) rock5_2 101.333 -26.6667 0 1 1 +( -208 -607.4329927766596 288 ) ( 80 -503.37079663222687 563.7752808984078 ) ( 848 -512 384 ) rock5_2 0 0 0 1 1 +( -400 -624 -192 ) ( -208 -607.4329927766596 288 ) ( 336 -573.94873345875158 -176 ) rock5_2 0 0 0 1 1 +( 848 -512 -256 ) ( -400 -624 -192 ) ( 336 -573.94873345875158 -176 ) rock5_2 0 0 0 1 1 +( 336 -573.94873345875158 -176 ) ( -208 -607.4329927766596 288 ) ( 848 -512 384 ) rock5_2 0 0 0 1 1 +( 80 -503.37079663222687 563.7752808984078 ) ( 848 -448 384 ) ( 784 -480 430.98127340820633 ) rock5_2 19.4806 105.306 0 1 1 +( 848 -512 384 ) ( 848 -512 -256 ) ( 336 -573.94873345875158 -176 ) rock5_2 0 0 0 1 1 +( 80 -503.37079663222687 563.7752808984078 ) ( 784 -480 430.98127340820633 ) ( 848 -512 384 ) rock5_2 107.333 105.688 0 1 1 +( 848 -448 -256 ) ( 848 -448 384 ) ( 192 -291.55556567081601 128 ) rock5_2 0 0 0 1 1 +( 784 -480 430.98127340820633 ) ( 848 -448 384 ) ( 848 -512 384 ) rock5_2 0 0 0 1 1 +( 848 -512 384 ) ( 848 -448 384 ) ( 848 -448 -256 ) rock5_2 0 0 0 1 1 +} +// brush 211 +{ +( -688 1024 384 ) ( -688 1024 -256 ) ( -688 1088 -256 ) rock5_2 0 0 0 1 1 +( -576 1040 480 ) ( -688 1024 384 ) ( -688 1088 384 ) rock5_2 0 0 0 1 1 +( -400 912 -192 ) ( -688 1024 -256 ) ( -688 1024 384 ) rock5_2 0 0 0 1 1 +( -204 876.56700722334244 288 ) ( -400 912 -192 ) ( -688 1024 384 ) rock5_2 -4.31247 0 0 1.00926 1.00003 +( -304 1168 112 ) ( -688 1088 384 ) ( -688 1088 -256 ) rock5_2 0 0 0 1 1 +( -204 876.56700722334244 288 ) ( -688 1024 384 ) ( -576 1040 480 ) rock5_2 -9.53002 0.0226288 0 1.00676 1.00009 +( 192 1244.4444343291811 128 ) ( -688 1088 384 ) ( -304 1168 112 ) rock5_2 0 0 0 1 1 +( -688 1088 -256 ) ( 192 1244.4444343291811 128 ) ( -304 1168 112 ) rock5_2 0 0 0 1 1 +( -576 1040 480 ) ( 80 1032.6292033677735 563.77528089840416 ) ( -204 876.56700722334244 288 ) rock5_2 -14.382 0.129059 0 1.00214 1.00042 +( -576 1040 480 ) ( -688 1088 384 ) ( 80 1032.6292033677735 563.77528089840416 ) rock5_2 101.333 -26.6667 0 1 1 +( 80 1032.6292033677735 563.77528089840416 ) ( -688 1088 384 ) ( 192 1244.4444343291811 128 ) rock5_2 101.333 -26.6667 0 1 1 +( 848 1024 -256 ) ( -688 1024 -256 ) ( -400 912 -192 ) rock5_2 -90.6667 101.333 0 1 1 +( -688 1088 -256 ) ( -688 1024 -256 ) ( 848 1024 -256 ) rock5_2 0 0 0 1 1 +( 848 1088 -256 ) ( 192 1244.4444343291811 128 ) ( -688 1088 -256 ) rock5_2 0 0 0 1 1 +( 848 1088 384 ) ( 80 1032.6292033677735 563.77528089840416 ) ( 192 1244.4444343291811 128 ) rock5_2 101.333 -26.6667 0 1 1 +( -204 876.56700722334244 288 ) ( 336 962.05126654124797 -176 ) ( -400 912 -192 ) rock5_2 -2.00022 -0.00639343 0 0.999817 1.00011 +( -400 912 -192 ) ( 336 962.05126654124797 -176 ) ( 848 1024 -256 ) rock5_2 0 0 0 1 1 +( 80 1032.6292033677735 563.77528089840416 ) ( 848 1024 384 ) ( -204 876.56700722334244 288 ) rock5_2 -10.0317 0.0568237 0 0.997272 1.0002 +( 784 1056 430.9812734082015 ) ( 80 1032.6292033677735 563.77528089840416 ) ( 848 1088 384 ) rock5_2 19.4806 105.306 0 1 1 +( 848 1024 -256 ) ( 336 962.05126654124797 -176 ) ( -204 876.56700722334244 288 ) rock5_2 0.0120392 0 0 1 1.00011 +( -204 876.56700722334244 288 ) ( 848 1024 384 ) ( 848 1024 -256 ) rock5_2 0 0 0 1 1 +( 784 1056 430.9812734082015 ) ( 848 1024 384 ) ( 80 1032.6292033677735 563.77528089840416 ) rock5_2 107.333 105.688 0 1 1 +( 848 1088 384 ) ( 192 1244.4444343291811 128 ) ( 848 1088 -256 ) rock5_2 0 0 0 1 1 +( 848 1088 384 ) ( 848 1024 384 ) ( 784 1056 430.9812734082015 ) rock5_2 0 0 0 1 1 +( 848 1024 -256 ) ( 848 1024 384 ) ( 848 1088 384 ) rock5_2 0 0 0 1 1 +} +// brush 212 +{ +( -460 9252 8348 ) ( -460 -7132 8348 ) ( -460 9252 -8036 ) slipbotsd -4 -36 90 -1 1 +( -8268 548 8348 ) ( 8116 548 8348 ) ( 8116 548 -8036 ) slipbotsd -4 -12 270 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) +0slipbot 36 -12 270 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) +0slipbot 36 -12 270 1 1 +( 8116 612 8348 ) ( -8268 612 8348 ) ( 8116 612 -8036 ) slipbotsd -4 -12 270 1 1 +( -396 -7132 8348 ) ( -396 9252 8348 ) ( -396 9252 -8036 ) slipbotsd -4 -36 90 -1 1 +} +// brush 213 +{ +( -412 9252 8348 ) ( -412 -7132 8348 ) ( -412 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 532 8348 ) ( 8116 532 8348 ) ( 8116 532 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 548 8348 ) ( -8268 548 8348 ) ( 8116 548 -8036 ) slipside -4 -4 0 1 1 +( -396 -7132 8348 ) ( -396 9252 8348 ) ( -396 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 214 +{ +( -460 9252 8348 ) ( -460 -7132 8348 ) ( -460 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 532 8348 ) ( 8116 532 8348 ) ( 8116 532 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 548 8348 ) ( -8268 548 8348 ) ( 8116 548 -8036 ) slipside -4 -4 0 1 1 +( -444 -7132 8348 ) ( -444 9252 8348 ) ( -444 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 215 +{ +( -412 9252 8348 ) ( -412 -7132 8348 ) ( -412 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 612 8348 ) ( 8116 612 8348 ) ( 8116 612 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 628 8348 ) ( -8268 628 8348 ) ( 8116 628 -8036 ) slipside -4 -4 0 1 1 +( -396 -7132 8348 ) ( -396 9252 8348 ) ( -396 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 216 +{ +( -460 9252 8348 ) ( -460 -7132 8348 ) ( -460 9252 -8036 ) slipside 4 -4 180 1 -1 +( -8268 612 8348 ) ( 8116 612 8348 ) ( 8116 612 -8036 ) slipside -4 -4 0 1 1 +( -8268 -7132 204 ) ( 8116 -7132 204 ) ( -8268 9252 204 ) slipside -4 4 0 1 1 +( 8116 -7132 220 ) ( -8268 -7132 220 ) ( -8268 9252 220 ) sliplite 4 4 270 1 1 +( 8116 628 8348 ) ( -8268 628 8348 ) ( 8116 628 -8036 ) slipside -4 -4 0 1 1 +( -444 -7132 8348 ) ( -444 9252 8348 ) ( -444 9252 -8036 ) slipside 4 -4 180 1 -1 +} +// brush 217 +{ +( -460.68305078289859 9252 8512 ) ( -460.68305078289859 -7132 8512 ) ( -460.68305078289859 9252 -7872 ) slipbotsd 0 28 90 -1 1 +( -8268.6830507828981 548 8512 ) ( 8115.3169492171019 548 8512 ) ( 8115.3169492171019 548 -7872 ) slipbotsd 0 51.317 270 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) +0slipbot -28 51.317 270 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) +0slipbot -28 51.317 270 1 1 +( 8115.3169492171019 612 8512 ) ( -8268.6830507828981 612 8512 ) ( 8115.3169492171019 612 -7872 ) slipbotsd 0 51.317 270 1 1 +( -396.68305078289859 -7132 8512 ) ( -396.68305078289859 9252 8512 ) ( -396.68305078289859 9252 -7872 ) slipbotsd 0 28 90 -1 1 +} +// brush 218 +{ +( -412.68305078289859 9252 8512 ) ( -412.68305078289859 -7132 8512 ) ( -412.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 532 8512 ) ( 8115.3169492171019 532 8512 ) ( 8115.3169492171019 532 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 548 8512 ) ( -8268.6830507828981 548 8512 ) ( 8115.3169492171019 548 -7872 ) slipside -3.31696 0 0 1 1 +( -396.68305078289859 -7132 8512 ) ( -396.68305078289859 9252 8512 ) ( -396.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 219 +{ +( -460.68305078289859 9252 8512 ) ( -460.68305078289859 -7132 8512 ) ( -460.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 532 8512 ) ( 8115.3169492171019 532 8512 ) ( 8115.3169492171019 532 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 548 8512 ) ( -8268.6830507828981 548 8512 ) ( 8115.3169492171019 548 -7872 ) slipside -3.31696 0 0 1 1 +( -444.68305078289859 -7132 8512 ) ( -444.68305078289859 9252 8512 ) ( -444.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 220 +{ +( -412.68305078289859 9252 8512 ) ( -412.68305078289859 -7132 8512 ) ( -412.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 612 8512 ) ( 8115.3169492171019 612 8512 ) ( 8115.3169492171019 612 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 628 8512 ) ( -8268.6830507828981 628 8512 ) ( 8115.3169492171019 628 -7872 ) slipside -3.31696 0 0 1 1 +( -396.68305078289859 -7132 8512 ) ( -396.68305078289859 9252 8512 ) ( -396.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 221 +{ +( -460.68305078289859 9252 8512 ) ( -460.68305078289859 -7132 8512 ) ( -460.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +( -8268.6830507828981 612 8512 ) ( 8115.3169492171019 612 8512 ) ( 8115.3169492171019 612 -7872 ) slipside -3.31696 0 0 1 1 +( -8268.6830507828981 -7132 368 ) ( 8115.3169492171019 -7132 368 ) ( -8268.6830507828981 9252 368 ) slipside -3.31696 4 0 1 1 +( 8115.3169492171019 -7132 384 ) ( -8268.6830507828981 -7132 384 ) ( -8268.6830507828981 9252 384 ) sliplite 4 3.31696 270 1 1 +( 8115.3169492171019 628 8512 ) ( -8268.6830507828981 628 8512 ) ( 8115.3169492171019 628 -7872 ) slipside -3.31696 0 0 1 1 +( -444.68305078289859 -7132 8512 ) ( -444.68305078289859 9252 8512 ) ( -444.68305078289859 9252 -7872 ) slipside 4 0 180 1 -1 +} +// brush 222 +{ +( 204 4 72 ) ( 212 32 92 ) ( 212 -8 92 ) rock5_2 52.8205 -37.0778 0 1 2.11149 +( 212 -8 92 ) ( 288 -16 72 ) ( 204 4 72 ) rock5_2 12.4079 16.4704 357.221 1.05226 1.73207 +( 289.66666666657449 16 60.666666666677905 ) ( 212 32 92 ) ( 204 4 72 ) rock5_2 -36.8217 24.8842 55.9902 0.579428 3.20696 +( 284 32 80 ) ( 212 32 92 ) ( 289.66666666657449 16 60.666666666677905 ) rock5_2 -48.7906 35.4409 60.8903 0.453788 3.64757 +( 204 4 72 ) ( 288 -16 72 ) ( 289.66666666657449 16 60.666666666677905 ) rock5_2 -9.34389 34.054 78.1146 1.48223 6.09644 +( 284 -8 92 ) ( 288 -16 72 ) ( 212 -8 92 ) rock5_2 -13.9255 0.620201 0 1 2.1654 +( 212 -8 92 ) ( 212 32 92 ) ( 284 32 92 ) rock5_2 4 -56 0 1 1 +( 284 32 92 ) ( 212 32 92 ) ( 284 32 80 ) rock5_2 -45.0904 -46.4015 0 0.785714 -0.104336 +( 289.66666666657449 16 60.666666666677905 ) ( 284 32 92 ) ( 284 32 80 ) rock5_2 48 -16 0 0.8 1 +( 284 32 92 ) ( 288 -16 72 ) ( 284 -8 92 ) rock5_2 56 -16 0 1 1 +( 289.66666666657449 16 60.666666666677905 ) ( 288 -16 72 ) ( 284 32 92 ) rock5_2 51.4641 -16.7497 0 1.07246 1.01501 +} +// brush 223 +{ +( -488 8448 8472 ) ( -488 -7936 8472 ) ( -488 8448 -7912 ) tech10_1 20 0 0 1 1 +( -11320 272 8472 ) ( 5064 272 8472 ) ( 5064 272 -7912 ) tech10_1 4 0 0 1 1 +( -11320 -7936 200 ) ( 5064 -7936 200 ) ( -11320 8448 200 ) tech10_1 4 -4 0 1 1 +( 5064 -7936 280 ) ( -11320 -7936 280 ) ( -11320 8448 280 ) tech10_1 4 -4 0 1 1 +( 5064 336 8472 ) ( -11320 336 8472 ) ( 5064 336 -7912 ) tech10_1 4 0 0 1 1 +( -472 -7936 8472 ) ( -472 8448 8472 ) ( -472 8448 -7912 ) tech10_1 48 32 0 1 1.25 +} +// brush 224 +{ +( -492 10084 8671.7307831234339 ) ( -492 -6300 8671.7307831234339 ) ( -492 10084 -7712.2692168765661 ) +0slip 0 -24 180 1 1 +( -8652 516 8671.7307831234339 ) ( 6768.2352941176468 516 8671.7307831234339 ) ( 6768.2352941176468 516 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -8652 -6300 199.73078312343421 ) ( 6768.2352941176468 -6300 199.73078312343421 ) ( -8652 10084 199.73078312343421 ) +0slip 0 -24 90 1 1 +( 6768.2352941176468 -6300 391.73078312343421 ) ( -8652 -6300 391.73078312343421 ) ( -8652 10084 391.73078312343421 ) +0slip 32 0 0 1 1 +( 6768.2352941176468 644 8671.7307831234339 ) ( -8652 644 8671.7307831234339 ) ( 6768.2352941176468 644 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -460 -6300 8671.7307831234339 ) ( -460 10084 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slip1 32 -88 0 1 1 +} +// brush 225 +{ +( -576 66 96 ) ( -576 842 96 ) ( -512 704 200 ) wgrass1_1 2.42151 4.35867 359.98 1 1 +( -512 144 181 ) ( -576 66 96 ) ( -512 704 200 ) wgrass1_1 2.42151 4.35867 359.98 1 1 +( -492 165 194.40264550268026 ) ( -512 144 181 ) ( -512 704 200 ) wgrass1_1 63.9887 63.9891 0 1 1 +( -492 165 194.40264550268026 ) ( -512 704 200 ) ( -486 388 201.12525331369628 ) wgrass1_1 0 0 0 1 1 +( -512 144 181 ) ( -424 20.27764751822987 96 ) ( -576 66 96 ) wgrass1_1 -25.3486 1.01028 0 1 1 +( -512 704 200 ) ( -576 842 96 ) ( -426 886 96.011856770189553 ) wgrass1_1 -20.6821 -10.4593 15.4564 1 1 +( -270 80 66 ) ( -576 842 96 ) ( -576 66 96 ) wgrass1_1 0 0 0 1 1 +( -576 66 96 ) ( -424 20.27764751822987 96 ) ( -270 80 66 ) wgrass1_1 8.26799 -30.4505 2.60767 1 1 +( -512 704 200 ) ( -385 484 205.61752284345388 ) ( -486 388 201.12525331369628 ) wgrass1_1 0 0 0 1 1 +( -309 670 206.86816262128895 ) ( -385 484 205.61752284345388 ) ( -512 704 200 ) wgrass1_1 0 0 0 1 1 +( -296 166 200 ) ( -492 165 194.40264550268026 ) ( -486 388 201.12525331369628 ) wgrass1_1 0 0 0 1 1 +( -486 388 201.12525331369628 ) ( -385 484 205.61752284345388 ) ( -296 166 200 ) wgrass1_1 0 0 0 1 1 +( -296 166 200 ) ( -512 144 181 ) ( -492 165 194.40264550268026 ) wgrass1_1 12.6248 28.5396 5.80981 1 1 +( -296 166 200 ) ( -424 20.27764751822987 96 ) ( -512 144 181 ) wgrass1_1 12.6248 28.5396 5.80981 1 1 +( -426 886 96.011856770189553 ) ( -576 842 96 ) ( -270 80 66 ) wgrass1_1 -9.36369 39.6651 10.1462 1 1 +( -309 670 206.86816262128895 ) ( -512 704 200 ) ( -272 704 200 ) wgrass1_1 0 0 0 1 1 +( -272 704 200 ) ( -512 704 200 ) ( -426 886 96.011856770189553 ) wgrass1_1 -15.1927 56.9781 0 1 1 +( -296 166 200 ) ( -385 484 205.61752284345388 ) ( -270 364 203.30969135337739 ) wgrass1_1 0 0 0 1 1 +( -270 80 66 ) ( -320 866 96 ) ( -426 886 96.011856770189553 ) wgrass1_1 -0.780757 -6.6537 345.272 1 1 +( -270 364 203.30969135337739 ) ( -385 484 205.61752284345388 ) ( -309 670 206.86816262128895 ) wgrass1_1 0 0 0 1 1 +( -270.38848945708014 208 200 ) ( -296 166 200 ) ( -270 364 203.30969135337739 ) wgrass1_1 0 0 0 1 1 +( -426 886 96.011856770189553 ) ( -320 866 96 ) ( -272 704 200 ) wgrass1_1 34.7765 39.9387 349.317 1 1 +( -309 670 206.86816262128895 ) ( -245.5024632827585 426 200 ) ( -270 364 203.30969135337739 ) wgrass1_1 0 0 0 1 1 +( -270 80 66 ) ( -269.96194171176285 754 98 ) ( -320 866 96 ) wgrass1_1 -11.1547 19.4794 93.8317 1 1 +( -272 704 200 ) ( -245.5024632827585 426 200 ) ( -309 670 206.86816262128895 ) wgrass1_1 0 0 0 1 1 +( -270 364 203.30969135337739 ) ( -245.5024632827585 426 200 ) ( -270.38848945708014 208 200 ) wgrass1_1 0 0 0 1 1 +( -270 80 66 ) ( -424 20.27764751822987 96 ) ( -296 166 200 ) wgrass1_1 -11.0723 -7.23012 354.378 1 1 +( -270 80 66 ) ( -296 166 200 ) ( -270.38848945708014 208 200 ) wgrass1_1 41.8398 -59.8936 0 1 1 +( -320 866 96 ) ( -269.96194171176285 754 98 ) ( -272 704 200 ) wgrass1_1 -20.1577 -62.6304 2.32178 1 1 +( -245.5024632827585 426 200 ) ( -269.96194171176285 754 98 ) ( -270 80 66 ) wgrass1_1 25.177 -60.1174 0 1 1 +( -270.38848945708014 208 200 ) ( -245.5024632827585 426 200 ) ( -270 80 66 ) wgrass1_1 13.9578 -60.0984 0 1 1 +( -272 704 200 ) ( -269.96194171176285 754 98 ) ( -245.5024632827585 426 200 ) wgrass1_1 32.1528 -59.7352 0 1 1 +} +// brush 226 +{ +( 3597.6076951545965 7462.9108884204634 8472 ) ( -4594.3923048454226 -6726.0493271837677 8472 ) ( 3597.6076951545965 7462.9108884204634 -7912 ) tech10_1 -21.4272 0 0 0.866025 1 +( -9871.1794786384453 5798.2871870789113 8472 ) ( 4317.7807369657867 -2393.7128129211087 8472 ) ( 4317.7807369657867 -2393.7128129211087 -7912 ) tech10_1 18.2563 0 0 0.866025 1 +( -13975.179478638454 -1310.0493271837552 200 ) ( 213.78073696577599 -9502.0493271837749 200 ) ( -5783.1794786384344 12878.910888420476 200 ) tech10_1 3.83582 -62.1257 330 1 1 +( 213.78073696577599 -9502.0493271837749 280 ) ( -13975.179478638454 -1310.0493271837552 280 ) ( -5783.1794786384344 12878.910888420476 280 ) tech10_1 3.83582 -62.1257 330 1 1 +( 4349.7807369657867 -2338.2871870789049 8472 ) ( -9839.1794786384453 5853.7128129211151 8472 ) ( 4349.7807369657867 -2338.2871870789049 -7912 ) tech10_1 45.3058 0 0 0.866025 1 +( -4580.5358983848719 -6734.0493271837677 8472 ) ( 3611.4641016151472 7454.9108884204634 8472 ) ( 3611.4641016151472 7454.9108884204634 -7912 ) tech10_1 -48.1896 -32 0 0.866025 1.25 +} +} +// entity 1 +{ +"classname" "info_player_start" +"origin" "64 448 280" +"angle" "270" +} +// entity 2 +{ +"classname" "func_button" +"angle" "270" +"speed" "50" +"sounds" "1" +"wait" "1" +"lip" "4" +"effects" "1" +"targetname" "w" +// brush 0 +{ +( -477.46410161514081 5745.4641016151372 8476 ) ( -477.46410161513171 -10638.535898384862 8476 ) ( -477.46410161514081 5745.4641016151372 -7908 ) door02_1 -9.46411 12 0 1 1 +( 7778.535898384861 217.46410161514336 8476 ) ( -8605.4641016151363 217.46410161513381 8476 ) ( -8605.4641016151363 217.46410161513381 -7908 ) +0basebtn -29.4641 12 180 1 -1 +( 7778.5358983848682 -10638.535898384855 236 ) ( 7778.5358983848573 5745.4641016151436 236 ) ( -8605.4641016151309 -10638.535898384866 236 ) door02_1 -9.46411 33.4641 90 1 1 +( 7778.5358983848573 5745.4641016151436 268 ) ( 7778.5358983848682 -10638.535898384855 268 ) ( -8605.4641016151309 -10638.535898384866 268 ) door02_1 -9.46411 33.4641 90 1 1 +( -8605.4641016151381 209.46410161513381 8476 ) ( 7778.5358983848619 209.46410161514336 8476 ) ( -8605.4641016151381 209.46410161513381 -7908 ) door02_1 -13.4641 12 0 -1 1 +( -445.4641016151308 -10638.535898384862 8476 ) ( -445.46410161514081 5745.4641016151372 8476 ) ( -445.46410161514081 5745.4641016151372 -7908 ) door02_1 -9.46411 12 0 1 1 +} +} +// entity 3 +{ +"classname" "info_player_start" +"origin" "64 448 280" +"angle" "270" +} +// entity 4 +{ +"classname" "func_button" +"angle" "180" +"speed" "50" +"sounds" "1" +"wait" "1" +"lip" "4" +"effects" "1" +"targetname" "w" +// brush 0 +{ +( -472 8448 8480 ) ( -472 -7936 8480 ) ( -472 8448 -7904 ) door02_1 0 16 0 1 1 +( -11320 288 8480 ) ( 5064 288 8480 ) ( 5064 288 -7904 ) door02_1 0 16 0 1 1 +( -11320 -7936 240 ) ( 5064 -7936 240 ) ( -11320 8448 240 ) door02_1 0 -124 0 1 1 +( 5064 -7936 272 ) ( -11320 -7936 272 ) ( -11320 8448 272 ) door02_1 0 -124 0 1 1 +( 5064 320 8480 ) ( -11320 320 8480 ) ( 5064 320 -7904 ) door02_1 0 16 0 1 1 +( -464 -7936 8480 ) ( -464 8448 8480 ) ( -464 8448 -7904 ) +0basebtn 0 16 0 1 1 +} +} +// entity 5 +{ +"classname" "trigger_changelevel" +"map" "start" +// brush 0 +{ +( -452 10084 8671.7307831234339 ) ( -452 -6300 8671.7307831234339 ) ( -452 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 556 8671.7307831234339 ) ( 7220 556 8671.7307831234339 ) ( 7220 556 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) trigger 0 0 0 1 1 +( 7220 -6300 351.73078312343421 ) ( -9164 -6300 351.73078312343421 ) ( -9164 10084 351.73078312343421 ) trigger 0 0 0 1 1 +( 7220 604 8671.7307831234339 ) ( -9164 604 8671.7307831234339 ) ( 7220 604 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -404 -6300 8671.7307831234339 ) ( -404 10084 8671.7307831234339 ) ( -404 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +} +} +// entity 6 +{ +"spawnflags" "1792" +"classname" "func_wall" +// brush 0 +{ +( -380 10084 8671.7307831234339 ) ( -380 -6300 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 564 8671.7307831234339 ) ( 7220 564 8671.7307831234339 ) ( 7220 564 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 596 8671.7307831234339 ) ( -9164 596 8671.7307831234339 ) ( 7220 596 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -372 -6300 8671.7307831234339 ) ( -372 10084 8671.7307831234339 ) ( -372 10084 -7712.2692168765661 ) z_exit 12 7.73078 180 -1 -1 +} +} +// entity 7 +{ +"spawnflags" "1792" +"classname" "func_wall" +// brush 0 +{ +( -396 10084 8671.7307831234339 ) ( -396 -6300 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -380 -6300 8671.7307831234339 ) ( -380 10084 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 1 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 532 8671.7307831234339 ) ( -9164 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 2 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 628 8671.7307831234339 ) ( 7220 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 0 0 1 1 +} +} +// entity 8 +{ +"classname" "func_button" +"angle" "135" +"speed" "50" +"sounds" "1" +"wait" "1" +"lip" "4" +"effects" "1" +"targetname" "w" +// brush 0 +{ +( 3611.4641016151472 7454.9108884204634 8480 ) ( -4580.5358983848719 -6734.0493271837677 8480 ) ( 3611.4641016151472 7454.9108884204634 -7904 ) door02_1 -0.189636 16 0 0.866025 1 +( -9863.1794786384453 5812.143593539462 8480 ) ( 4325.7807369657867 -2379.856406460558 8480 ) ( 4325.7807369657867 -2379.856406460558 -7904 ) door02_1 5.01868 16 0 0.866025 1 +( -13975.179478638454 -1310.0493271837552 240 ) ( 213.78073696577599 -9502.0493271837749 240 ) ( -5783.1794786384344 12878.910888420476 240 ) door02_1 15.8358 -54.1257 330 1 1 +( 213.78073696577599 -9502.0493271837749 272 ) ( -13975.179478638454 -1310.0493271837552 272 ) ( -5783.1794786384344 12878.910888420476 272 ) door02_1 15.8358 -54.1257 330 1 1 +( 4341.7807369657867 -2352.1435935394557 8480 ) ( -9847.1794786384453 5839.8564064605644 8480 ) ( 4341.7807369657867 -2352.1435935394557 -7904 ) door02_1 2.54346 16 0 0.866025 1 +( -4573.6076951545965 -6738.0493271837677 8480 ) ( 3618.3923048454226 7450.9108884204634 8480 ) ( 3618.3923048454226 7450.9108884204634 -7904 ) +0basebtn -27.5708 16 0 0.866025 1 +} +} +// entity 9 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Banner" +"_tb_id" "1" +// brush 0 +{ +( -234.43229914393856 255.63043136842782 289.80952380952385 ) ( -234.43229914393856 255.63043136842782 289.8498736549551 ) ( -235.53438026668658 253.72157086976574 289.80952380952385 ) twall2_2 0 0 0 1 1 +( -234.43229914393856 255.63043136842782 289.80952380952385 ) ( -235.70486607414568 256.36514822814479 289.80952380952385 ) ( -234.43229914393856 255.63043136842782 289.8498736549551 ) twall2_2 0 0 0 1 1 +( -26.413296930073216 145.71112192383671 284.12551522154797 ) ( -27.685863860287796 146.44583878355792 284.12551522154797 ) ( -27.51534694256587 143.80231530971753 284.12551522154797 ) twall2_2 0 0 0 1 1 +( -234.43229914393856 255.63043136842782 289.80952380952385 ) ( -235.53438026668658 253.72157086976574 289.80952380952385 ) ( -235.70486607414568 256.36514822814479 289.80952380952385 ) twall2_2 0 0 0 1 1 +( -26.413296930073216 145.71112192383671 284.12551522154797 ) ( -26.413296930073216 145.71112192383671 284.16586506698002 ) ( -27.685863860287796 146.44583878355792 284.12551522154797 ) twall2_2 0 0 0 1 1 +( -26.413296930073216 145.71112192383671 284.12551522154797 ) ( -27.51534694256587 143.80231530971753 284.12551522154797 ) ( -26.413296930073216 145.71112192383671 284.16586506698002 ) twall2_2 0 0 0 1 1 +} +// brush 1 +{ +( -240.99200836176422 256.02415147574584 289.80952380952385 ) ( -240.99200836176422 256.02415147574584 290.19410553701482 ) ( -241.35943618011095 255.38774782625507 289.80952380952385 ) twall2_2 0 0 0 1 1 +( -240.99200836176422 256.02415147574584 289.80952380952385 ) ( -242.32952719725441 256.79636833546226 289.80952380952385 ) ( -240.99200836176422 256.02415147574584 290.19410553701482 ) twall2_2 0 0 0 1 1 +( -25.519553186224428 135.01460125259754 235.63420248023485 ) ( -26.857072021717244 135.7868181123155 235.63420248023485 ) ( -25.886913560473829 134.37831441971005 235.63420248023485 ) twall2_2 0 0 0 1 1 +( -240.99200836176422 256.02415147574584 289.80952380952385 ) ( -241.35943618011095 255.38774782625507 289.80952380952385 ) ( -242.32952719725441 256.79636833546226 289.80952380952385 ) twall2_2 0 0 0 1 1 +( -25.519553186224428 135.01460125259754 235.63420248023485 ) ( -25.519553186224428 135.01460125259754 236.01775372311107 ) ( -26.857072021717244 135.7868181123155 235.63420248023485 ) twall2_2 0 0 0 1 1 +( -25.519553186224428 135.01460125259754 235.63420248023485 ) ( -25.886913560473829 134.37831441971005 235.63420248023485 ) ( -25.519553186224428 135.01460125259754 236.01775372311107 ) twall2_2 0 0 0 1 1 +} +// brush 2 +{ +( -234.43229914393856 255.63043136842782 283.73806264203029 ) ( -234.43229914393856 255.63043136842782 284.03919421629462 ) ( -235.16701989243739 254.35785770265284 283.73806264203029 ) black 0 0 0 1 1 +( -234.43229914393856 255.63043136842782 283.73806264203029 ) ( -235.0685826090421 255.99778979828625 283.73806264203029 ) ( -234.43229914393856 255.63043136842782 284.03919421629462 ) black 0 0 0 1 1 +( -129.68806173337907 201.94337725417842 241.31821106821215 ) ( -130.3243451984865 202.31073568403912 241.31821106821215 ) ( -130.42278248187785 200.67080358840354 241.31821106821215 ) black 0 0 0 1 1 +( -234.43229914393856 255.63043136842782 283.73806264203029 ) ( -235.16701989243739 254.35785770265284 283.73806264203029 ) ( -235.0685826090421 255.99778979828625 283.73806264203029 ) black 0 0 0 1 1 +( -129.68806173337907 201.94337725417842 241.31821106821215 ) ( -129.68806173337907 201.94337725417842 241.61934264247466 ) ( -130.3243451984865 202.31073568403912 241.31821106821215 ) black 0 0 0 1 1 +( -129.68806173337907 201.94337725417842 241.31821106821215 ) ( -130.42278248187785 200.67080358840354 241.31821106821215 ) ( -129.68806173337907 201.94337725417842 241.61934264247466 ) black 0 0 0 1 1 +} +// brush 3 +{ +( -132.62694472737405 196.85308259107899 283.73806264203029 ) ( -132.62694472737405 196.85308259107899 284.03919421629462 ) ( -133.36166547587288 195.580508925304 283.73806264203029 ) black 0 0 0 1 1 +( -132.62694472737405 196.85308259107899 283.73806264203029 ) ( -133.26322819248148 197.22044102093969 283.73806264203029 ) ( -132.62694472737405 196.85308259107899 284.03919421629462 ) black 0 0 0 1 1 +( -27.882707316815285 143.16602847683001 241.31821106821215 ) ( -28.51899078192443 143.53338690669167 241.31821106821215 ) ( -28.617428065314044 141.89345481105514 241.31821106821215 ) black 0 0 0 1 1 +( -132.62694472737405 196.85308259107899 283.73806264203029 ) ( -133.36166547587288 195.580508925304 283.73806264203029 ) ( -133.26322819248148 197.22044102093969 283.73806264203029 ) black 0 0 0 1 1 +( -27.882707316815285 143.16602847683001 241.31821106821215 ) ( -27.882707316815285 143.16602847683001 241.61934264247466 ) ( -28.51899078192443 143.53338690669167 241.31821106821215 ) black 0 0 0 1 1 +( -27.882707316815285 143.16602847683001 241.31821106821215 ) ( -28.617428065314044 141.89345481105514 241.31821106821215 ) ( -27.882707316815285 143.16602847683001 241.61934264247466 ) black 0 0 0 1 1 +} +// brush 4 +{ +( -30.821590310810265 138.07573381373058 289.61579751976467 ) ( -30.821590310810265 138.07573381373058 290 ) ( -31.923671433558269 136.16687331506847 289.61579751976467 ) twall2_2 0 0 0 1 1 +( -30.821590310810265 138.07573381373058 289.61579751976467 ) ( -30.853404484072954 138.09410173522784 289.61579751976467 ) ( -30.821590310810265 138.07573381373058 290 ) twall2_2 0 0 0 1 1 +( -21.323029209244254 142.77225448496884 235.44047619047578 ) ( -21.354843382507909 142.79062240646664 235.44047619047578 ) ( -22.425079221736908 140.86344787084965 235.44047619047578 ) twall2_2 0 0 0 1 1 +( -30.821590310810265 138.07573381373058 289.61579751976467 ) ( -31.923671433558269 136.16687331506847 289.61579751976467 ) ( -30.853404484072954 138.09410173522784 289.61579751976467 ) twall2_2 0 0 0 1 1 +( -21.323029209244254 142.77225448496884 235.44047619047578 ) ( -21.323029209244254 142.77225448496884 235.82505791796106 ) ( -21.354843382507909 142.79062240646664 235.44047619047578 ) twall2_2 0 0 0 1 1 +( -21.323029209244254 142.77225448496884 235.44047619047578 ) ( -22.425079221736908 140.86344787084965 235.44047619047578 ) ( -21.323029209244254 142.77225448496884 235.82505791796106 ) twall2_2 0 0 0 1 1 +} +// brush 5 +{ +( -234.43229914393856 255.63043136842782 241.12413491658833 ) ( -234.43229914393856 255.63043136842782 241.16468814230137 ) ( -235.53438026668658 253.72157086976574 241.12413491658833 ) twall2_2 0 0 0 1 1 +( -234.43229914393856 255.63043136842782 241.12413491658833 ) ( -235.70486607414568 256.36514822814479 241.12413491658833 ) ( -234.43229914393856 255.63043136842782 241.16468814230137 ) twall2_2 0 0 0 1 1 +( -26.413296930073216 145.71112192383671 235.44047619047578 ) ( -27.685863860287796 146.44583878355792 235.44047619047578 ) ( -27.51534694256587 143.80231530971753 235.44047619047578 ) twall2_2 0 0 0 1 1 +( -234.43229914393856 255.63043136842782 241.12413491658833 ) ( -235.53438026668658 253.72157086976574 241.12413491658833 ) ( -235.70486607414568 256.36514822814479 241.12413491658833 ) twall2_2 0 0 0 1 1 +( -26.413296930073216 145.71112192383671 235.44047619047578 ) ( -26.413296930073216 145.71112192383671 235.48082603590808 ) ( -27.685863860287796 146.44583878355792 235.44047619047578 ) twall2_2 0 0 0 1 1 +( -26.413296930073216 145.71112192383671 235.44047619047578 ) ( -27.51534694256587 143.80231530971753 235.44047619047578 ) ( -26.413296930073216 145.71112192383671 235.48082603590808 ) twall2_2 0 0 0 1 1 +} +// brush 6 +{ +( -239.52256686476687 258.56929880729535 289.61579751976467 ) ( -239.52256686476687 258.56929880729535 290 ) ( -240.62464798751486 256.66043830863322 289.61579751976467 ) twall2_2 0 0 0 1 1 +( -239.52256686476687 258.56929880729535 289.61579751976467 ) ( -239.55438103802163 258.58766672878801 289.61579751976467 ) ( -239.52256686476687 258.56929880729535 290 ) twall2_2 0 0 0 1 1 +( -230.02400576320153 263.26581947853401 235.44047619047578 ) ( -230.05581993645652 263.28418740002678 235.44047619047578 ) ( -231.12605577569417 261.3570128644148 235.44047619047578 ) twall2_2 0 0 0 1 1 +( -239.52256686476687 258.56929880729535 289.61579751976467 ) ( -240.62464798751486 256.66043830863322 289.61579751976467 ) ( -239.55438103802163 258.58766672878801 289.61579751976467 ) twall2_2 0 0 0 1 1 +( -230.02400576320153 263.26581947853401 235.44047619047578 ) ( -230.02400576320153 263.26581947853401 235.82505791796106 ) ( -230.05581993645652 263.28418740002678 235.44047619047578 ) twall2_2 0 0 0 1 1 +( -230.02400576320153 263.26581947853401 235.44047619047578 ) ( -231.12605577569417 261.3570128644148 235.44047619047578 ) ( -230.02400576320153 263.26581947853401 235.82505791796106 ) twall2_2 0 0 0 1 1 +} +} +// entity 10 +{ +"classname" "func_worldtext_banner" +"origin" "-129 203 263" +"angle" "60" +"worldtext" "Please set up your preferred\ncontroller bindings\nin the SteamVR dashboard." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "1" +} +// entity 11 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Banner" +"_tb_id" "2" +// brush 0 +{ +( -182.30559878361225 228.20933735087135 330.24408928484627 ) ( -182.30559878361225 228.20933735087135 330.27430570986235 ) ( -183.1511747168845 226.7447568727863 330.24408928484627 ) twall2_2 0 0 0 1 1 +( -182.30559878361225 228.20933735087135 330.24408928484627 ) ( -183.26653116508868 228.76413191998972 330.24408928484627 ) ( -182.30559878361225 228.20933735087135 330.27430570986235 ) twall2_2 0 0 0 1 1 +( -25.17413788379794 145.30048686116461 325.98755701190225 ) ( -26.135070265279936 145.85528143028625 325.98755701190225 ) ( -26.019689947608484 143.83594772620003 325.98755701190225 ) twall2_2 0 0 0 1 1 +( -182.30559878361225 228.20933735087135 330.24408928484627 ) ( -183.1511747168845 226.7447568727863 330.24408928484627 ) ( -183.26653116508868 228.76413191998972 330.24408928484627 ) twall2_2 0 0 0 1 1 +( -25.17413788379794 145.30048686116461 325.98755701190225 ) ( -25.17413788379794 145.30048686116461 326.01777343691811 ) ( -26.135070265279936 145.85528143028625 325.98755701190225 ) twall2_2 0 0 0 1 1 +( -25.17413788379794 145.30048686116461 325.98755701190225 ) ( -26.019689947608484 143.83594772620003 325.98755701190225 ) ( -25.17413788379794 145.30048686116461 326.01777343691811 ) twall2_2 0 0 0 1 1 +} +// brush 1 +{ +( -187.27676288721324 228.47574165656454 330.24408928484627 ) ( -187.27676288721324 228.47574165656454 330.53208753631179 ) ( -187.55867327837763 227.98745853588616 330.24408928484627 ) twall2_2 0 0 0 1 1 +( -187.27676288721324 228.47574165656454 330.24408928484627 ) ( -188.28674132477005 229.05885297936368 330.24408928484627 ) ( -187.27676288721324 228.47574165656454 330.53208753631179 ) twall2_2 0 0 0 1 1 +( -24.552778300354447 137.1307039794396 289.67430476286995 ) ( -25.562756737922484 137.71381530224522 289.67430476286995 ) ( -24.834636944778509 136.64251048674464 289.67430476286995 ) twall2_2 0 0 0 1 1 +( -187.27676288721324 228.47574165656454 330.24408928484627 ) ( -187.55867327837763 227.98745853588616 330.24408928484627 ) ( -188.28674132477005 229.05885297936368 330.24408928484627 ) twall2_2 0 0 0 1 1 +( -24.552778300354447 137.1307039794396 289.67430476286995 ) ( -24.552778300354447 137.1307039794396 289.96153132461109 ) ( -25.562756737922484 137.71381530224522 289.67430476286995 ) twall2_2 0 0 0 1 1 +( -24.552778300354447 137.1307039794396 289.67430476286995 ) ( -24.834636944778509 136.64251048674464 289.67430476286995 ) ( -24.552778300354447 137.1307039794396 289.96153132461109 ) twall2_2 0 0 0 1 1 +} +// brush 2 +{ +( -182.30559878361225 228.20933735087135 325.6974088913588 ) ( -182.30559878361225 228.20933735087135 325.9229145788363 ) ( -182.86931607246055 227.23295036548109 325.6974088913588 ) black 0 0 0 1 1 +( -182.30559878361225 228.20933735087135 325.6974088913588 ) ( -182.78606497435038 228.48673463543048 325.6974088913588 ) ( -182.30559878361225 228.20933735087135 325.9229145788363 ) black 0 0 0 1 1 +( -103.1762985977077 187.73104352237317 293.93039519996262 ) ( -103.65676478844856 188.00844080693389 293.93039519996262 ) ( -103.73985639897401 186.75493277757812 293.93039519996262 ) black 0 0 0 1 1 +( -182.30559878361225 228.20933735087135 325.6974088913588 ) ( -182.86931607246055 227.23295036548109 325.6974088913588 ) ( -182.78606497435038 228.48673463543048 325.6974088913588 ) black 0 0 0 1 1 +( -103.1762985977077 187.73104352237317 293.93039519996262 ) ( -103.1762985977077 187.73104352237317 294.15634272329135 ) ( -103.65676478844856 188.00844080693389 293.93039519996262 ) black 0 0 0 1 1 +( -103.1762985977077 187.73104352237317 293.93039519996262 ) ( -103.73985639897401 186.75493277757812 293.93039519996262 ) ( -103.1762985977077 187.73104352237317 294.15634272329135 ) black 0 0 0 1 1 +} +// brush 3 +{ +( -105.43100826551873 183.82577182140773 325.6974088913588 ) ( -105.43100826551873 183.82577182140773 325.9229145788363 ) ( -105.99472555436702 182.84938483601746 325.6974088913588 ) black 0 0 0 1 1 +( -105.43100826551873 183.82577182140773 325.6974088913588 ) ( -105.91147445625958 184.10316910596845 325.6974088913588 ) ( -105.43100826551873 183.82577182140773 325.9229145788363 ) black 0 0 0 1 1 +( -26.301708079614585 143.3474779929098 293.93039519996262 ) ( -26.782174270356919 143.6248752774714 293.93039519996262 ) ( -26.865265880880898 142.37136724811475 293.93039519996262 ) black 0 0 0 1 1 +( -105.43100826551873 183.82577182140773 325.6974088913588 ) ( -105.99472555436702 182.84938483601746 325.6974088913588 ) ( -105.91147445625958 184.10316910596845 325.6974088913588 ) black 0 0 0 1 1 +( -26.301708079614585 143.3474779929098 293.93039519996262 ) ( -26.301708079614585 143.3474779929098 294.15634272329135 ) ( -26.782174270356919 143.6248752774714 293.93039519996262 ) black 0 0 0 1 1 +( -26.301708079614585 143.3474779929098 293.93039519996262 ) ( -26.865265880880898 142.37136724811475 293.93039519996262 ) ( -26.301708079614585 143.3474779929098 294.15634272329135 ) black 0 0 0 1 1 +} +// brush 4 +{ +( -28.556417747425613 139.44220629194436 330.09901522457471 ) ( -28.556417747425613 139.44220629194436 330.38672947256589 ) ( -29.401993680697856 137.97762581385936 330.09901522457471 ) twall2_2 0 0 0 1 1 +( -28.556417747425613 139.44220629194436 330.09901522457471 ) ( -28.580441056968326 139.45607615617567 330.09901522457471 ) ( -28.556417747425613 139.44220629194436 330.38672947256589 ) twall2_2 0 0 0 1 1 +( -21.330408357892679 143.08130858469107 289.52923070259834 ) ( -21.354431667436089 143.09517844892278 289.52923070259834 ) ( -22.175960421703223 141.61676944972649 289.52923070259834 ) twall2_2 0 0 0 1 1 +( -28.556417747425613 139.44220629194436 330.09901522457471 ) ( -29.401993680697856 137.97762581385936 330.09901522457471 ) ( -28.580441056968326 139.45607615617567 330.09901522457471 ) twall2_2 0 0 0 1 1 +( -21.330408357892679 143.08130858469107 289.52923070259834 ) ( -21.330408357892679 143.08130858469107 289.81722895405926 ) ( -21.354431667436089 143.09517844892278 289.52923070259834 ) twall2_2 0 0 0 1 1 +( -21.330408357892679 143.08130858469107 289.52923070259834 ) ( -22.175960421703223 141.61676944972649 289.52923070259834 ) ( -21.330408357892679 143.08130858469107 289.81722895405926 ) twall2_2 0 0 0 1 1 +} +// brush 5 +{ +( -182.30559878361225 228.20933735087135 293.78550097764287 ) ( -182.30559878361225 228.20933735087135 293.81586970621674 ) ( -183.1511747168845 226.7447568727863 293.78550097764287 ) twall2_2 0 0 0 1 1 +( -182.30559878361225 228.20933735087135 293.78550097764287 ) ( -183.26653116508868 228.76413191998972 293.78550097764287 ) ( -182.30559878361225 228.20933735087135 293.81586970621674 ) twall2_2 0 0 0 1 1 +( -25.17413788379794 145.30048686116461 289.52923070259834 ) ( -26.135070265279936 145.85528143028625 289.52923070259834 ) ( -26.019689947608484 143.83594772620003 289.52923070259834 ) twall2_2 0 0 0 1 1 +( -182.30559878361225 228.20933735087135 293.78550097764287 ) ( -183.1511747168845 226.7447568727863 293.78550097764287 ) ( -183.26653116508868 228.76413191998972 293.78550097764287 ) twall2_2 0 0 0 1 1 +( -25.17413788379794 145.30048686116461 289.52923070259834 ) ( -25.17413788379794 145.30048686116461 289.55944712761465 ) ( -26.135070265279936 145.85528143028625 289.52923070259834 ) twall2_2 0 0 0 1 1 +( -25.17413788379794 145.30048686116461 289.52923070259834 ) ( -26.019689947608484 143.83594772620003 289.52923070259834 ) ( -25.17413788379794 145.30048686116461 289.55944712761465 ) twall2_2 0 0 0 1 1 +} +// brush 6 +{ +( -186.14932830951693 230.4285156273445 330.09901522457471 ) ( -186.14932830951693 230.4285156273445 330.38672947256589 ) ( -186.99490424278918 228.9639351492595 330.09901522457471 ) twall2_2 0 0 0 1 1 +( -186.14932830951693 230.4285156273445 330.09901522457471 ) ( -186.17335161905396 230.44238549157251 330.09901522457471 ) ( -186.14932830951693 230.4285156273445 330.38672947256589 ) twall2_2 0 0 0 1 1 +( -178.92331891998458 234.06761792009161 289.52923070259834 ) ( -178.94734222952161 234.08148778431962 289.52923070259834 ) ( -179.76887098379513 232.60307878512697 289.52923070259834 ) twall2_2 0 0 0 1 1 +( -186.14932830951693 230.4285156273445 330.09901522457471 ) ( -186.99490424278918 228.9639351492595 330.09901522457471 ) ( -186.17335161905396 230.44238549157251 330.09901522457471 ) twall2_2 0 0 0 1 1 +( -178.92331891998458 234.06761792009161 289.52923070259834 ) ( -178.92331891998458 234.06761792009161 289.81722895405926 ) ( -178.94734222952161 234.08148778431962 289.52923070259834 ) twall2_2 0 0 0 1 1 +( -178.92331891998458 234.06761792009161 289.52923070259834 ) ( -179.76887098379513 232.60307878512697 289.52923070259834 ) ( -178.92331891998458 234.06761792009161 289.81722895405926 ) twall2_2 0 0 0 1 1 +} +} +// entity 12 +{ +"classname" "func_worldtext_banner" +"origin" "-103 188 310" +"angle" "60" +"worldtext" "Welcome to Quake VR!" +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "2" +} +// entity 13 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Banner" +"_tb_id" "3" +// brush 0 +{ +( -84.574255548968836 563.10926993469434 323.4775281847966 ) ( -83.839538689251867 564.38183686490152 323.4775281847966 ) ( -84.574255548968836 563.10926993469434 323.51787803022785 ) twall2_2 0 0 0 1 1 +( -194.49356499355997 355.09026772082905 317.79351959682072 ) ( -196.40237160767913 356.19231773332172 317.79351959682072 ) ( -194.49356499355997 355.09026772082905 317.83386944225276 ) twall2_2 0 0 0 1 1 +( -194.49356499355997 355.09026772082905 317.79351959682072 ) ( -193.75884813383874 356.36283465104361 317.79351959682072 ) ( -196.40237160767913 356.19231773332172 317.79351959682072 ) twall2_2 0 0 0 1 1 +( -84.574255548968836 563.10926993469434 323.4775281847966 ) ( -86.483116047630858 564.21135105744236 323.4775281847966 ) ( -83.839538689251867 564.38183686490152 323.4775281847966 ) twall2_2 0 0 0 1 1 +( -84.574255548968836 563.10926993469434 323.4775281847966 ) ( -84.574255548968836 563.10926993469434 323.51787803022785 ) ( -86.483116047630858 564.21135105744236 323.4775281847966 ) twall2_2 0 0 0 1 1 +( -194.49356499355997 355.09026772082905 317.79351959682072 ) ( -194.49356499355997 355.09026772082905 317.83386944225276 ) ( -193.75884813383874 356.36283465104361 317.79351959682072 ) twall2_2 0 0 0 1 1 +} +// brush 1 +{ +( -84.180535441650818 569.66897915252002 323.4775281847966 ) ( -83.408318581934395 571.00649798801021 323.4775281847966 ) ( -84.180535441650818 569.66897915252002 323.86210991228756 ) twall2_2 0 0 0 1 1 +( -205.19008566479908 354.19652397698025 269.30220685550762 ) ( -205.82637249768663 354.56388435122966 269.30220685550762 ) ( -205.19008566479908 354.19652397698025 269.68575809838387 ) twall2_2 0 0 0 1 1 +( -205.19008566479908 354.19652397698025 269.30220685550762 ) ( -204.41786880508118 355.53404281247305 269.30220685550762 ) ( -205.82637249768663 354.56388435122966 269.30220685550762 ) twall2_2 0 0 0 1 1 +( -84.180535441650818 569.66897915252002 323.4775281847966 ) ( -84.816939091141649 570.03640697086666 323.4775281847966 ) ( -83.408318581934395 571.00649798801021 323.4775281847966 ) twall2_2 0 0 0 1 1 +( -84.180535441650818 569.66897915252002 323.4775281847966 ) ( -84.180535441650818 569.66897915252002 323.86210991228756 ) ( -84.816939091141649 570.03640697086666 323.4775281847966 ) twall2_2 0 0 0 1 1 +( -205.19008566479908 354.19652397698025 269.30220685550762 ) ( -205.19008566479908 354.19652397698025 269.68575809838387 ) ( -204.41786880508118 355.53404281247305 269.30220685550762 ) twall2_2 0 0 0 1 1 +} +// brush 2 +{ +( -84.574255548968836 563.10926993469434 317.40606701730303 ) ( -84.206897119110408 563.74555339979793 317.40606701730303 ) ( -84.574255548968836 563.10926993469434 317.70719859156736 ) black 0 0 0 1 1 +( -138.26130966321819 458.3650325241349 274.98621544348492 ) ( -139.53388332899306 459.09975327263362 274.98621544348492 ) ( -138.26130966321819 458.3650325241349 275.28734701774744 ) black 0 0 0 1 1 +( -138.26130966321819 458.3650325241349 274.98621544348492 ) ( -137.89395123335748 459.00131598924224 274.98621544348492 ) ( -139.53388332899306 459.09975327263362 274.98621544348492 ) black 0 0 0 1 1 +( -84.574255548968836 563.10926993469434 317.40606701730303 ) ( -85.846829214743764 563.84399068319317 317.40606701730303 ) ( -84.206897119110408 563.74555339979793 317.40606701730303 ) black 0 0 0 1 1 +( -84.574255548968836 563.10926993469434 317.40606701730303 ) ( -84.574255548968836 563.10926993469434 317.70719859156736 ) ( -85.846829214743764 563.84399068319317 317.40606701730303 ) black 0 0 0 1 1 +( -138.26130966321819 458.3650325241349 274.98621544348492 ) ( -138.26130966321819 458.3650325241349 275.28734701774744 ) ( -137.89395123335748 459.00131598924224 274.98621544348492 ) black 0 0 0 1 1 +} +// brush 3 +{ +( -143.35160432631761 461.30391551812988 317.40606701730303 ) ( -142.98424589645691 461.94019898323722 317.40606701730303 ) ( -143.35160432631761 461.30391551812988 317.70719859156736 ) black 0 0 0 1 1 +( -197.03865844056668 356.55967810757113 274.98621544348492 ) ( -198.31123210634155 357.2943988560699 274.98621544348492 ) ( -197.03865844056668 356.55967810757113 275.28734701774744 ) black 0 0 0 1 1 +( -197.03865844056668 356.55967810757113 274.98621544348492 ) ( -196.67130001070495 357.19596157268023 274.98621544348492 ) ( -198.31123210634155 357.2943988560699 274.98621544348492 ) black 0 0 0 1 1 +( -143.35160432631761 461.30391551812988 317.40606701730303 ) ( -144.6241779920926 462.03863626662871 317.40606701730303 ) ( -142.98424589645691 461.94019898323722 317.40606701730303 ) black 0 0 0 1 1 +( -143.35160432631761 461.30391551812988 317.40606701730303 ) ( -143.35160432631761 461.30391551812988 317.70719859156736 ) ( -144.6241779920926 462.03863626662871 317.40606701730303 ) black 0 0 0 1 1 +( -197.03865844056668 356.55967810757113 274.98621544348492 ) ( -197.03865844056668 356.55967810757113 275.28734701774744 ) ( -196.67130001070495 357.19596157268023 274.98621544348492 ) black 0 0 0 1 1 +} +// brush 4 +{ +( -202.12895310366605 359.49856110156611 323.28380189503741 ) ( -202.11058518216885 359.53037527482877 323.28380189503741 ) ( -202.12895310366605 359.49856110156611 323.66800437527274 ) twall2_2 0 0 0 1 1 +( -197.43243243242785 350 269.10848056574855 ) ( -199.341239046547 351.10205001249273 269.10848056574855 ) ( -197.43243243242785 350 269.49306229323383 ) twall2_2 0 0 0 1 1 +( -197.43243243242785 350 269.10848056574855 ) ( -197.41406451093002 350.03181417326374 269.10848056574855 ) ( -199.341239046547 351.10205001249273 269.10848056574855 ) twall2_2 0 0 0 1 1 +( -202.12895310366605 359.49856110156611 323.28380189503741 ) ( -204.03781360232819 360.60064222431407 323.28380189503741 ) ( -202.11058518216885 359.53037527482877 323.28380189503741 ) twall2_2 0 0 0 1 1 +( -202.12895310366605 359.49856110156611 323.28380189503741 ) ( -202.12895310366605 359.49856110156611 323.66800437527274 ) ( -204.03781360232819 360.60064222431407 323.28380189503741 ) twall2_2 0 0 0 1 1 +( -197.43243243242785 350 269.10848056574855 ) ( -197.43243243242785 350 269.49306229323383 ) ( -197.41406451093002 350.03181417326374 269.10848056574855 ) twall2_2 0 0 0 1 1 +} +// brush 5 +{ +( -84.574255548968836 563.10926993469434 274.79213929186108 ) ( -83.839538689251867 564.38183686490152 274.79213929186108 ) ( -84.574255548968836 563.10926993469434 274.83269251757417 ) twall2_2 0 0 0 1 1 +( -194.49356499355997 355.09026772082905 269.10848056574855 ) ( -196.40237160767913 356.19231773332172 269.10848056574855 ) ( -194.49356499355997 355.09026772082905 269.14883041118082 ) twall2_2 0 0 0 1 1 +( -194.49356499355997 355.09026772082905 269.10848056574855 ) ( -193.75884813383874 356.36283465104361 269.10848056574855 ) ( -196.40237160767913 356.19231773332172 269.10848056574855 ) twall2_2 0 0 0 1 1 +( -84.574255548968836 563.10926993469434 274.79213929186108 ) ( -86.483116047630858 564.21135105744236 274.79213929186108 ) ( -83.839538689251867 564.38183686490152 274.79213929186108 ) twall2_2 0 0 0 1 1 +( -84.574255548968836 563.10926993469434 274.79213929186108 ) ( -84.574255548968836 563.10926993469434 274.83269251757417 ) ( -86.483116047630858 564.21135105744236 274.79213929186108 ) twall2_2 0 0 0 1 1 +( -194.49356499355997 355.09026772082905 269.10848056574855 ) ( -194.49356499355997 355.09026772082905 269.14883041118082 ) ( -193.75884813383874 356.36283465104361 269.10848056574855 ) twall2_2 0 0 0 1 1 +} +// brush 6 +{ +( -81.635388110101303 568.19953765552259 323.28380189503741 ) ( -81.617020188608649 568.23135182877741 323.28380189503741 ) ( -81.635388110101303 568.19953765552259 323.66800437527274 ) twall2_2 0 0 0 1 1 +( -76.938867438862644 558.70097655395728 269.10848056574855 ) ( -78.847674052981802 559.80302656644994 269.10848056574855 ) ( -76.938867438862644 558.70097655395728 269.49306229323383 ) twall2_2 0 0 0 1 1 +( -76.938867438862644 558.70097655395728 269.10848056574855 ) ( -76.920499517369876 558.73279072721232 269.10848056574855 ) ( -78.847674052981802 559.80302656644994 269.10848056574855 ) twall2_2 0 0 0 1 1 +( -81.635388110101303 568.19953765552259 323.28380189503741 ) ( -83.544248608763382 569.30161877827061 323.28380189503741 ) ( -81.617020188608649 568.23135182877741 323.28380189503741 ) twall2_2 0 0 0 1 1 +( -81.635388110101303 568.19953765552259 323.28380189503741 ) ( -81.635388110101303 568.19953765552259 323.66800437527274 ) ( -83.544248608763382 569.30161877827061 323.28380189503741 ) twall2_2 0 0 0 1 1 +( -76.938867438862644 558.70097655395728 269.10848056574855 ) ( -76.938867438862644 558.70097655395728 269.49306229323383 ) ( -76.920499517369876 558.73279072721232 269.10848056574855 ) twall2_2 0 0 0 1 1 +} +} +// entity 14 +{ +"classname" "func_worldtext_banner" +"origin" "-137 458 297" +"angle" "330" +"worldtext" "There are two possible\nlocomotion options.$Smooth locomotion is the\nrecommended option.$You can also bind a button\nto 'Teleport' in the\nSteamVR bindings." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "3" +} +// entity 15 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "Slipgate" +"_tb_id" "4" +} +// entity 16 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "QuakeVRBillboard" +"_tb_id" "5" +} +// entity 17 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "BigSlipgate" +"_tb_id" "6" +// brush 0 +{ +( -492 10084 8671.7307831234339 ) ( -492 -6300 8671.7307831234339 ) ( -492 10084 -7712.2692168765661 ) +0slip 0 -24 180 1 1 +( -8652 516 8671.7307831234339 ) ( 6768.2352941176468 516 8671.7307831234339 ) ( 6768.2352941176468 516 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -8652 -6300 199.73078312343421 ) ( 6768.2352941176468 -6300 199.73078312343421 ) ( -8652 10084 199.73078312343421 ) +0slip 0 -24 90 1 1 +( 6768.2352941176468 -6300 391.73078312343421 ) ( -8652 -6300 391.73078312343421 ) ( -8652 10084 391.73078312343421 ) +0slip 32 0 0 1 1 +( 6768.2352941176468 644 8671.7307831234339 ) ( -8652 644 8671.7307831234339 ) ( 6768.2352941176468 644 -7712.2692168765661 ) +0slip 0 -24 0 1 1 +( -460 -6300 8671.7307831234339 ) ( -460 10084 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) slip1 32 -88 0 1 1 +} +// brush 1 +{ +( -576 66 96 ) ( -576 842 96 ) ( -512 704 200 ) wgrass1_1 2.42151 4.35867 359.98 1 1 +( -512 144 181 ) ( -576 66 96 ) ( -512 704 200 ) wgrass1_1 2.42151 4.35867 359.98 1 1 +( -492 165 194.40264550268026 ) ( -512 144 181 ) ( -512 704 200 ) wgrass1_1 63.9887 63.9891 0 1 1 +( -492 165 194.40264550268026 ) ( -512 704 200 ) ( -486 388 201.12525331369628 ) wgrass1_1 0 0 0 1 1 +( -512 144 181 ) ( -424 20.27764751822987 96 ) ( -576 66 96 ) wgrass1_1 -25.3486 1.01028 0 1 1 +( -512 704 200 ) ( -576 842 96 ) ( -426 886 96.011856770189553 ) wgrass1_1 -20.6821 -10.4593 15.4564 1 1 +( -270 80 66 ) ( -576 842 96 ) ( -576 66 96 ) wgrass1_1 0 0 0 1 1 +( -576 66 96 ) ( -424 20.27764751822987 96 ) ( -270 80 66 ) wgrass1_1 8.26799 -30.4505 2.60767 1 1 +( -512 704 200 ) ( -385 484 205.61752284345388 ) ( -486 388 201.12525331369628 ) wgrass1_1 0 0 0 1 1 +( -309 670 206.86816262128895 ) ( -385 484 205.61752284345388 ) ( -512 704 200 ) wgrass1_1 0 0 0 1 1 +( -296 166 200 ) ( -492 165 194.40264550268026 ) ( -486 388 201.12525331369628 ) wgrass1_1 0 0 0 1 1 +( -486 388 201.12525331369628 ) ( -385 484 205.61752284345388 ) ( -296 166 200 ) wgrass1_1 0 0 0 1 1 +( -296 166 200 ) ( -512 144 181 ) ( -492 165 194.40264550268026 ) wgrass1_1 12.6248 28.5396 5.80981 1 1 +( -296 166 200 ) ( -424 20.27764751822987 96 ) ( -512 144 181 ) wgrass1_1 12.6248 28.5396 5.80981 1 1 +( -426 886 96.011856770189553 ) ( -576 842 96 ) ( -270 80 66 ) wgrass1_1 -9.36369 39.6651 10.1462 1 1 +( -309 670 206.86816262128895 ) ( -512 704 200 ) ( -272 704 200 ) wgrass1_1 0 0 0 1 1 +( -272 704 200 ) ( -512 704 200 ) ( -426 886 96.011856770189553 ) wgrass1_1 -15.1927 56.9781 0 1 1 +( -296 166 200 ) ( -385 484 205.61752284345388 ) ( -270 364 203.30969135337739 ) wgrass1_1 0 0 0 1 1 +( -270 80 66 ) ( -320 866 96 ) ( -426 886 96.011856770189553 ) wgrass1_1 -0.780757 -6.6537 345.272 1 1 +( -270 364 203.30969135337739 ) ( -385 484 205.61752284345388 ) ( -309 670 206.86816262128895 ) wgrass1_1 0 0 0 1 1 +( -270.38848945708014 208 200 ) ( -296 166 200 ) ( -270 364 203.30969135337739 ) wgrass1_1 0 0 0 1 1 +( -426 886 96.011856770189553 ) ( -320 866 96 ) ( -272 704 200 ) wgrass1_1 34.7765 39.9387 349.317 1 1 +( -309 670 206.86816262128895 ) ( -245.5024632827585 426 200 ) ( -270 364 203.30969135337739 ) wgrass1_1 0 0 0 1 1 +( -270 80 66 ) ( -269.96194171176285 754 98 ) ( -320 866 96 ) wgrass1_1 -11.1547 19.4794 93.8317 1 1 +( -272 704 200 ) ( -245.5024632827585 426 200 ) ( -309 670 206.86816262128895 ) wgrass1_1 0 0 0 1 1 +( -270 364 203.30969135337739 ) ( -245.5024632827585 426 200 ) ( -270.38848945708014 208 200 ) wgrass1_1 0 0 0 1 1 +( -270 80 66 ) ( -424 20.27764751822987 96 ) ( -296 166 200 ) wgrass1_1 -11.0723 -7.23012 354.378 1 1 +( -270 80 66 ) ( -296 166 200 ) ( -270.38848945708014 208 200 ) wgrass1_1 41.8398 -59.8936 0 1 1 +( -320 866 96 ) ( -269.96194171176285 754 98 ) ( -272 704 200 ) wgrass1_1 -20.1577 -62.6304 2.32178 1 1 +( -245.5024632827585 426 200 ) ( -269.96194171176285 754 98 ) ( -270 80 66 ) wgrass1_1 25.177 -60.1174 0 1 1 +( -270.38848945708014 208 200 ) ( -245.5024632827585 426 200 ) ( -270 80 66 ) wgrass1_1 13.9578 -60.0984 0 1 1 +( -272 704 200 ) ( -269.96194171176285 754 98 ) ( -245.5024632827585 426 200 ) wgrass1_1 32.1528 -59.7352 0 1 1 +} +} +// entity 18 +{ +"classname" "trigger_changelevel" +"map" "start" +"_tb_layer" "6" +// brush 0 +{ +( -452 10084 8671.7307831234339 ) ( -452 -6300 8671.7307831234339 ) ( -452 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 556 8671.7307831234339 ) ( 7220 556 8671.7307831234339 ) ( 7220 556 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) trigger 0 0 0 1 1 +( 7220 -6300 351.73078312343421 ) ( -9164 -6300 351.73078312343421 ) ( -9164 10084 351.73078312343421 ) trigger 0 0 0 1 1 +( 7220 604 8671.7307831234339 ) ( -9164 604 8671.7307831234339 ) ( 7220 604 -7712.2692168765661 ) trigger 0 0 0 1 1 +( -404 -6300 8671.7307831234339 ) ( -404 10084 8671.7307831234339 ) ( -404 10084 -7712.2692168765661 ) trigger 0 0 0 1 1 +} +} +// entity 19 +{ +"spawnflags" "1792" +"classname" "func_wall" +"_tb_layer" "6" +// brush 0 +{ +( -380 10084 8671.7307831234339 ) ( -380 -6300 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 564 8671.7307831234339 ) ( 7220 564 8671.7307831234339 ) ( 7220 564 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 22 6 0 -1 -1 +( 7220 596 8671.7307831234339 ) ( -9164 596 8671.7307831234339 ) ( 7220 596 -7712.2692168765661 ) tech04_1 22 6 0 -1 -1 +( -372 -6300 8671.7307831234339 ) ( -372 10084 8671.7307831234339 ) ( -372 10084 -7712.2692168765661 ) z_exit 12 7.73078 180 -1 -1 +} +} +// entity 20 +{ +"spawnflags" "1792" +"classname" "func_wall" +"_tb_layer" "6" +// brush 0 +{ +( -396 10084 8671.7307831234339 ) ( -396 -6300 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -380 -6300 8671.7307831234339 ) ( -380 10084 8671.7307831234339 ) ( -380 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 1 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 516 8671.7307831234339 ) ( 7220 516 8671.7307831234339 ) ( 7220 516 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 532 8671.7307831234339 ) ( -9164 532 8671.7307831234339 ) ( 7220 532 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +} +// brush 2 +{ +( -460 10084 8671.7307831234339 ) ( -460 -6300 8671.7307831234339 ) ( -460 10084 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 628 8671.7307831234339 ) ( 7220 628 8671.7307831234339 ) ( 7220 628 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -9164 -6300 199.73078312343421 ) ( 7220 -6300 199.73078312343421 ) ( -9164 10084 199.73078312343421 ) tech04_1 0 8 0 1 1 +( 7220 -6300 231.73078312343421 ) ( -9164 -6300 231.73078312343421 ) ( -9164 10084 231.73078312343421 ) tech04_1 0 0 0 1 1 +( 7220 644 8671.7307831234339 ) ( -9164 644 8671.7307831234339 ) ( 7220 644 -7712.2692168765661 ) tech04_1 0 8 0 1 1 +( -396 -6300 8671.7307831234339 ) ( -396 10084 8671.7307831234339 ) ( -396 10084 -7712.2692168765661 ) tech04_1 0 0 0 1 1 +} +} +// entity 21 +{ +"classname" "func_group" +"_tb_type" "_tb_layer" +"_tb_name" "Emitter Row" +"_tb_id" "7" +} diff --git a/map_src/vrtutorial.map b/map_src/vrtutorial.map new file mode 100644 index 00000000..993bedc6 --- /dev/null +++ b/map_src/vrtutorial.map @@ -0,0 +1,3786 @@ +// Game: Quake +// Format: Standard +// entity 0 +{ +"classname" "worldspawn" +"wad" "C:/OHWorkspace/TrenchBroom/Q.wad" +"count" "1" +"dmg" "1" +"health" "9" +// brush 0 +{ +( -624 128 12.118281722604934 ) ( -624 128 17.078755282366501 ) ( -624 -1024 17.078755282366501 ) sfloor4_2 20.2105 -2.79423 0 1.1875 1.29328 +( 236 -1024 17.078755282366501 ) ( 236 -1024 12.118281722604934 ) ( -624 -1024 12.118281722604934 ) sfloor4_2 -14.4817 -2.79423 0 1.29328 1.29328 +( -624 -1024 12.118281722604934 ) ( 236 -1024 12.118281722604934 ) ( 236 128 12.118281722604934 ) sfloor4_2 -14.4817 -20.2105 0 1.29328 1.1875 +( 236 128 17.078755282366501 ) ( 236 -1024 17.078755282366501 ) ( -624 -1024 17.078755282366501 ) sfloor4_2 -14.4817 -20.2105 0 1.29328 1.1875 +( 236 128 12.118281722604934 ) ( 236 128 17.078755282366501 ) ( -624 128 17.078755282366501 ) sfloor4_2 -14.4817 -2.79423 0 1.29328 1.29328 +( 236 128 12.118281722604934 ) ( 236 -1024 12.118281722604934 ) ( 236 -1024 17.078755282366501 ) sfloor4_2 20.2105 -2.79423 0 1.1875 1.29328 +} +// brush 1 +{ +( 128 128 8 ) ( 128 128 32 ) ( 128 -128 32 ) tech04_1 0 0 0 1 1 +( 136 -128 32 ) ( 136 -128 8 ) ( 128 -128 8 ) tech04_1 0 0 0 1 1 +( 128 -128 8 ) ( 136 -128 8 ) ( 136 128 8 ) tech04_1 0 0 0 1 1 +( 136 128 32 ) ( 136 -128 32 ) ( 128 -128 32 ) tech04_1 0 0 0 1 1 +( 136 128 8 ) ( 136 128 32 ) ( 128 128 32 ) tech04_1 0 0 0 1 1 +( 136 128 8 ) ( 136 -128 8 ) ( 136 -128 32 ) tech04_1 0 0 0 1 1 +} +// brush 2 +{ +( 128 128 32 ) ( 128 128 152 ) ( 128 -128 152 ) tech03_1 64 32 0 1 1 +( 136 -128 152 ) ( 136 -128 32 ) ( 128 -128 32 ) tech03_1 64 32 0 1 1 +( 128 -128 32 ) ( 136 -128 32 ) ( 136 128 32 ) tech03_1 64 32 0 1 1 +( 136 128 152 ) ( 136 -128 152 ) ( 128 -128 152 ) tech03_1 64 32 0 1 1 +( 136 128 32 ) ( 136 128 152 ) ( 128 128 152 ) tech03_1 64 32 0 1 1 +( 136 128 32 ) ( 136 -128 32 ) ( 136 -128 152 ) tech03_1 64 32 0 1 1 +} +// brush 3 +{ +( 128 128 152 ) ( 128 128 168 ) ( 128 -128 168 ) tech04_1 0 -8 0 1 1 +( 136 -128 168 ) ( 136 -128 152 ) ( 128 -128 152 ) tech04_1 0 -8 0 1 1 +( 128 -128 152 ) ( 136 -128 152 ) ( 136 128 152 ) tech04_1 0 -8 0 1 1 +( 136 128 168 ) ( 136 -128 168 ) ( 128 -128 168 ) tech04_1 0 -8 0 1 1 +( 136 128 152 ) ( 136 128 168 ) ( 128 128 168 ) tech04_1 0 -8 0 1 1 +( 136 128 152 ) ( 136 -128 152 ) ( 136 -128 168 ) tech04_1 0 -8 0 1 1 +} +// brush 4 +{ +( -264 136.33333333333331 32 ) ( -264 136.33333333333331 33 ) ( -264 135.81250000000003 32 ) tech03_1 64 32 0 1 1 +( 136 128 152 ) ( 136 128 153 ) ( 137.25 128 152 ) tech03_1 64 32 0 1 1 +( -264 136.33333333333331 32 ) ( -264 135.81250000000003 32 ) ( -262.74999999999989 136.33333333333331 32 ) tech03_1 64 32 0 1 1 +( 136 128 152 ) ( 137.25 128 152 ) ( 136 127.47916666666666 152 ) tech03_1 64 32 0 1 1 +( -264 136.33333333333331 32 ) ( -262.74999999999989 136.33333333333331 32 ) ( -264 136.33333333333331 33 ) tech03_1 64 32 0 1 1 +( 136 128 152 ) ( 136 127.47916666666666 152 ) ( 136 128 153 ) tech03_1 64 32 0 1 1 +} +// brush 5 +{ +( -264 128 168 ) ( -264 128 152 ) ( -264 136.33333333333331 152 ) tech04_1 0 -8 0 1 1 +( 136 128 152 ) ( -264 128 152 ) ( -264 128 168 ) tech04_1 0 -8 0 1 1 +( -264 136.33333333333331 152 ) ( -264 128 152 ) ( 136 128 152 ) tech04_1 0 -8 0 1 1 +( 136 128 168 ) ( -264 128 168 ) ( -264 136.33333333333331 168 ) tech04_1 0 -8 0 1 1 +( 136 136.33333333333331 152 ) ( 136 136.33333333333331 168 ) ( -264 136.33333333333331 168 ) tech04_1 0 -8 0 1 1 +( 136 128 152 ) ( 136 128 168 ) ( 136 136.33333333333331 168 ) tech04_1 0 -8 0 1 1 +} +// brush 6 +{ +( -264 128 32 ) ( -264 128 8 ) ( -264 136.33333333333331 8 ) tech04_1 0 0 0 1 1 +( 136 128 8 ) ( -264 128 8 ) ( -264 128 32 ) tech04_1 0 0 0 1 1 +( -264 136.33333333333331 8 ) ( -264 128 8 ) ( 136 128 8 ) tech04_1 0 0 0 1 1 +( 136 128 32 ) ( -264 128 32 ) ( -264 136.33333333333331 32 ) tech04_1 0 0 0 1 1 +( 136 136.33333333333331 8 ) ( 136 136.33333333333331 32 ) ( -264 136.33333333333331 32 ) tech04_1 0 0 0 1 1 +( 136 128 8 ) ( 136 128 32 ) ( 136 136.33333333333331 32 ) tech04_1 0 0 0 1 1 +} +// brush 7 +{ +( -128 -128.12121212121212 32 ) ( -128 -128.12121212121212 33 ) ( -128 -128.6136363636362 32 ) tech03_1 64 32 180 1 -1 +( 136 -136 152 ) ( 136 -136 153 ) ( 136.82500000000016 -136 152 ) tech03_1 64 32 0 1 1 +( -128 -128.12121212121212 32 ) ( -128 -128.6136363636362 32 ) ( -127.17500000000005 -128.12121212121212 32 ) tech03_1 64 -96 270 1 1 +( 136 -136 152 ) ( 136.82500000000016 -136 152 ) ( 136 -136.49242424242448 152 ) tech03_1 64 -96 270 1 1 +( -128 -128.12121212121212 32 ) ( -127.17500000000005 -128.12121212121212 32 ) ( -128 -128.12121212121212 33 ) tech03_1 64 32 0 1 1 +( 136 -136 152 ) ( 136 -136.49242424242448 152 ) ( 136 -136 153 ) tech03_1 64 32 180 1 -1 +} +// brush 8 +{ +( -128 -136 32 ) ( -128 -136 8 ) ( -128 -128.12121212121212 8 ) tech04_1 0 0 180 1 -1 +( 136 -136 8 ) ( -128 -136 8 ) ( -128 -136 32 ) tech04_1 0 0 0 1 1 +( -128 -128.12121212121212 8 ) ( -128 -136 8 ) ( 136 -136 8 ) tech04_1 0 0 270 1 1 +( 136 -136 32 ) ( -128 -136 32 ) ( -128 -128.12121212121212 32 ) tech04_1 0 0 270 1 1 +( 136 -128.12121212121212 8 ) ( 136 -128.12121212121212 32 ) ( -128 -128.12121212121212 32 ) tech04_1 0 0 0 1 1 +( 136 -136 8 ) ( 136 -136 32 ) ( 136 -128.12121212121212 32 ) tech04_1 0 0 180 1 -1 +} +// brush 9 +{ +( -128 -136 168 ) ( -128 -136 152 ) ( -128 -128.12121212121212 152 ) tech04_1 0 8 180 1 -1 +( 136 -136 152 ) ( -128 -136 152 ) ( -128 -136 168 ) tech04_1 0 8 0 1 1 +( -128 -128.12121212121212 152 ) ( -128 -136 152 ) ( 136 -136 152 ) tech04_1 0 8 270 1 1 +( 136 -136 168 ) ( -128 -136 168 ) ( -128 -128.12121212121212 168 ) tech04_1 0 8 270 1 1 +( 136 -128.12121212121212 152 ) ( 136 -128.12121212121212 168 ) ( -128 -128.12121212121212 168 ) tech04_1 0 8 0 1 1 +( 136 -136 152 ) ( 136 -136 168 ) ( 136 -128.12121212121212 168 ) tech04_1 0 8 180 1 -1 +} +// brush 10 +{ +( -96 -128 64 ) ( -96 -127.5 64 ) ( -96 -128 65 ) tech01_1 -4 0 0 1 1 +( -96 -128 64 ) ( -96 -128 65 ) ( -94.499999999999929 -128 64 ) tech01_1 -16 0 0 1.5 1 +( -96 -128 64 ) ( -94.499999999999929 -128 64 ) ( -96 -127.5 64 ) tech01_1 -16 4 0 1.5 1 +( 96 -124 128 ) ( 96 -123.5 128 ) ( 97.500000000000043 -124 128 ) tech01_1 -16 4 0 1.5 1 +( 96 -124 128 ) ( 97.500000000000043 -124 128 ) ( 96 -124 129 ) tech01_1 -16 0 0 1.5 1 +( 96 -124 128 ) ( 96 -124 129 ) ( 96 -123.5 128 ) tech01_1 -4 0 0 1 1 +} +// brush 11 +{ +( -94 -124 66 ) ( -94 -123.75 66 ) ( -94 -124 66.9375 ) black 8 6.4 0 0.25 0.9375 +( -94 -124 66 ) ( -94 -124 66.9375 ) ( -92.53125 -124 66 ) black 0 6.4 0 1.46875 0.9375 +( -94 -124 66 ) ( -92.53125 -124 66 ) ( -94 -123.75 66 ) black 0 -8 0 1.46875 0.25 +( 94 -122 126 ) ( 94 -121.75 126 ) ( 95.468749999999943 -122 126 ) black 0 -8 0 1.46875 0.25 +( 94 -122 126 ) ( 95.468749999999943 -122 126 ) ( 94 -122 126.93750000000001 ) black 0 6.4 0 1.46875 0.9375 +( 94 -122 126 ) ( 94 -122 126.93750000000001 ) ( 94 -121.75 126 ) black 8 6.4 0 0.25 0.9375 +} +// brush 12 +{ +( -96 -124 126 ) ( -96 -123.75 126 ) ( -96 -124 126.03125 ) tech02_1 -12 0 0 1 1 +( -96 -124 126 ) ( -96 -124 126.03125 ) ( -94.499999999999929 -124 126 ) tech02_1 -3 0 0 1.5 1 +( -96 -124 126 ) ( -94.499999999999929 -124 126 ) ( -96 -123.75 126 ) tech02_1 -3 12 0 1.5 1 +( 96 -122 128 ) ( 96 -121.75 128 ) ( 97.500000000000043 -122 128 ) tech02_1 -3 12 0 1.5 1 +( 96 -122 128 ) ( 97.500000000000043 -122 128 ) ( 96 -122 128.03125 ) tech02_1 -40.8996 41.2452 0 1.65804 0.163584 +( 96 -122 128 ) ( 96 -122 128.03125 ) ( 96 -121.75 128 ) tech02_1 -12 0 0 1 1 +} +// brush 13 +{ +( -96 -124 64 ) ( -96 -123.75 64 ) ( -96 -124 64.03125 ) tech02_1 -12 0 0 1 1 +( -96 -124 64 ) ( -96 -124 64.03125 ) ( -94.499999999999929 -124 64 ) tech02_1 -3 0 0 1.5 1 +( -96 -124 64 ) ( -94.499999999999929 -124 64 ) ( -96 -123.75 64 ) tech02_1 -3 12 0 1.5 1 +( 96 -122 66 ) ( 96 -121.75 66 ) ( 97.500000000000043 -122 66 ) tech02_1 -3 12 0 1.5 1 +( 96 -122 66 ) ( 97.500000000000043 -122 66 ) ( 96 -122 66.03125 ) tech02_1 -13 49.3299 0 1.5 0.248708 +( 96 -122 66 ) ( 96 -122 66.03125 ) ( 96 -121.75 66 ) tech02_1 -12 0 0 1 1 +} +// brush 14 +{ +( -96 -122 66 ) ( -96 -122 126 ) ( -96 -124 126 ) tech02_1 -35 12 90 0.2 0.3 +( -94 -124 126 ) ( -94 -124 66 ) ( -96 -124 66 ) tech02_1 -35 0 90 0.2 0.3 +( -96 -124 66 ) ( -94 -124 66 ) ( -94 -122 66 ) tech02_1 -12 0 90 0.2 0.3 +( -94 -122 126 ) ( -94 -124 126 ) ( -96 -124 126 ) tech02_1 -12 0 90 0.2 0.3 +( -94 -122 66 ) ( -94 -122 126 ) ( -96 -122 126 ) tech02_1 -38 154.311 90 0.2 0.202399 +( -94 -122 66 ) ( -94 -124 66 ) ( -94 -124 126 ) tech02_1 -35 12 90 0.2 0.3 +} +// brush 15 +{ +( 94 -122 66 ) ( 94 -122 126 ) ( 94 -124 126 ) tech02_1 -35 12 90 0.2 0.3 +( 96 -124 126 ) ( 96 -124 66 ) ( 94 -124 66 ) tech02_1 -35 -21.3333 90 0.2 0.3 +( 94 -124 66 ) ( 96 -124 66 ) ( 96 -122 66 ) tech02_1 -12 -21.3333 90 0.2 0.3 +( 96 -122 126 ) ( 96 -124 126 ) ( 94 -124 126 ) tech02_1 -12 -21.3333 90 0.2 0.3 +( 96 -122 66 ) ( 96 -122 126 ) ( 94 -122 126 ) tech02_1 -36 -30.2461 90 0.2 0.241259 +( 96 -122 66 ) ( 96 -124 66 ) ( 96 -124 126 ) tech02_1 -35 12 90 0.2 0.3 +} +// brush 16 +{ +( -240 126 16 ) ( -240 127 16 ) ( -240 126 17 ) tech02_1 0 0 0 1 1 +( -240 126 16 ) ( -240 126 17 ) ( -239 126 16 ) tech02_1 0 0 0 1 1 +( -240 126 16 ) ( -239 126 16 ) ( -240 127 16 ) tech02_1 0 0 0 1 1 +( -239 127 70 ) ( -239 128 70 ) ( -238 127 70 ) tech02_1 0 0 0 1 1 +( -239 127 70 ) ( -238 127 70 ) ( -239 127 71 ) tech02_1 0 0 0 1 1 +( -239 127 70 ) ( -239 127 71 ) ( -239 128 70 ) tech02_1 0 0 0 1 1 +} +// brush 17 +{ +( -96 -126 136 ) ( -96 -120 152 ) ( -96 -128 152 ) tlight02 8 8 180 1 -1 +( 96 -128 152 ) ( 96 -128 136 ) ( -96 -128 136 ) tlight02 -64 8 0 0.5 1 +( -96 -128 136 ) ( 96 -128 136 ) ( 96 -126 136 ) tlight02 8 40 270 1 0.5 +( 96 -120 152 ) ( 96 -128 152 ) ( -96 -128 152 ) tlight02 -24 8.00006 0 1.5 0.333333 +( 96 -126 136 ) ( 96 -120 152 ) ( -96 -120 152 ) tlight02 -16.4041 42.0723 0 0.664801 0.931046 +( 96 -126 136 ) ( 96 -128 136 ) ( 96 -128 152 ) tlight02 8 8 180 1 -1 +} +// brush 18 +{ +( -264 136 168 ) ( -264 136 172 ) ( -264 -136 172 ) tech01_6 0 0 0 1 1 +( 136 -136 172 ) ( 136 -136 168 ) ( -264 -136 168 ) tech01_6 0 0 0 1 1 +( -264 -136 168 ) ( 136 -136 168 ) ( 136 136 168 ) tech01_6 0 0 0 1 1 +( 136 136 172 ) ( 136 -136 172 ) ( -264 -136 172 ) tech01_6 0 0 0 1 1 +( 136 136 168 ) ( 136 136 172 ) ( -264 136 172 ) tech01_6 0 0 0 1 1 +( 136 136 168 ) ( 136 -136 168 ) ( 136 -136 172 ) tech01_6 0 0 0 1 1 +} +// brush 19 +{ +( -96 6064 4160 ) ( -96 -6224 4160 ) ( -96 6064 -4032 ) tech04_1 -8 8 0 1 1 +( -8736 -32 4160 ) ( 7648 -32 4160 ) ( -8736 -32 -4032 ) tech04_1 32 8 0 1 1 +( 7648 -6224 160 ) ( 7648 6064 160 ) ( -8736 -6224 160 ) tlight02 32 8 0 1 1 +( 7648 6064 168 ) ( 7648 -6224 168 ) ( -8736 -6224 168 ) tech04_1 -8 0 90 1 1 +( 7648 16 4160 ) ( -8736 16 4160 ) ( -8736 16 -4032 ) tech04_1 32 8 0 1 1 +( -32 -6224 4160 ) ( -32 6064 4160 ) ( -32 6064 -4032 ) tech04_1 -8 8 0 1 1 +} +// brush 20 +{ +( -256 0 164 ) ( -256 0 168 ) ( -256 -16 168 ) tech02_1 -8 8 0 1 1 +( -96 -16 168 ) ( -96 -16 164 ) ( -256 -16 164 ) tech02_1 32 8 0 1 1 +( -256 -16 164 ) ( -96 -16 164 ) ( -96 0 164 ) tech02_1 34 8.44743 0 1 0.298772 +( -96 0 168 ) ( -96 -16 168 ) ( -256 -16 168 ) tech02_1 -8 0 90 1 1 +( -96 0 164 ) ( -96 0 168 ) ( -256 0 168 ) tech02_1 32 8 0 1 1 +( -96 0 164 ) ( -96 -16 164 ) ( -96 -16 168 ) tech02_1 -8 8 0 1 1 +} +// brush 21 +{ +( -144 -128 16 ) ( -144 -128 168 ) ( -144 -136 168 ) tech04_1 0 0 180 1 -1 +( -128 -136 168 ) ( -128 -136 16 ) ( -144 -136 16 ) tech04_1 0 0 180 1 -1 +( -144 -136 16 ) ( -128 -136 16 ) ( -128 -128 16 ) tech04_1 0 0 180 1 -1 +( -128 -128 168 ) ( -128 -136 168 ) ( -144 -136 168 ) tech04_1 0 0 180 1 -1 +( -128 -128 16 ) ( -128 -128 168 ) ( -144 -128 168 ) tech04_1 0 -0.842106 180 1 -1.05556 +( -128 -128 16 ) ( -128 -136 16 ) ( -128 -136 168 ) tech04_1 0 0 180 1 -1 +} +// brush 22 +{ +( -234 -128 16 ) ( -234 -128 168 ) ( -234 -136 168 ) tech04_1 0 0 180 1 -1 +( -218 -136 168 ) ( -218 -136 16 ) ( -234 -136 16 ) tech04_1 6 0 180 1 -1 +( -234 -136 16 ) ( -218 -136 16 ) ( -218 -128 16 ) tech04_1 6 0 180 1 -1 +( -218 -128 168 ) ( -218 -136 168 ) ( -234 -136 168 ) tech04_1 6 0 180 1 -1 +( -218 -128 16 ) ( -218 -128 168 ) ( -234 -128 168 ) tech04_1 6 -0.84211 180 1 -1.05556 +( -218 -128 16 ) ( -218 -136 16 ) ( -218 -136 168 ) tech04_1 0 0 180 1 -1 +} +// brush 23 +{ +( -250 -128 16 ) ( -250 -128 168 ) ( -250 -136 168 ) tech04_1 0 0 180 1 -1 +( -234 -136 168 ) ( -234 -136 16 ) ( -250 -136 16 ) tech04_1 6 0 180 1 -1 +( -250 -136 16 ) ( -234 -136 16 ) ( -234 -128 16 ) tech04_1 6 0 180 1 -1 +( -234 -128 168 ) ( -234 -136 168 ) ( -250 -136 168 ) tech04_1 6 0 180 1 -1 +( -234 -128 16 ) ( -234 -128 168 ) ( -250 -128 168 ) tech04_1 6 -0.84211 180 1 -1.05556 +( -234 -128 16 ) ( -234 -136 16 ) ( -234 -136 168 ) tech04_1 0 0 180 1 -1 +} +// brush 24 +{ +( -260 136 170.01999999999853 ) ( -260 136 172 ) ( -260 -136 172 ) tech01_6 0 1.73737 0 1 0.99 +( 136 -136 172 ) ( 136 -136 170.01999999999853 ) ( -260 -136 170.01999999999853 ) tech01_6 -1.37374 1.73737 0 0.99 0.99 +( -260 -136 170.01999999999853 ) ( 136 -136 170.01999999999853 ) ( 136 136 170.01999999999853 ) tech01_6 -1.37374 0 0 0.99 1 +( 136 136 172 ) ( 136 -136 172 ) ( -260 -136 172 ) tech01_6 -1.37374 0 0 0.99 1 +( 136 136 170.01999999999853 ) ( 136 136 172 ) ( -260 136 172 ) tech01_6 -1.37374 1.73737 0 0.99 0.99 +( 136 136 170.01999999999853 ) ( 136 -136 170.01999999999853 ) ( 136 -136 172 ) tech01_6 0 1.73737 0 1 0.99 +} +// brush 25 +{ +( 128 128 32 ) ( 128 128 152 ) ( 128 -128 152 ) tech03_1 64 32 0 1 1 +( 136 -128 152 ) ( 136 -128 32 ) ( 128 -128 32 ) tech03_1 64 32 0 1 1 +( 128 -128 32 ) ( 136 -128 32 ) ( 136 128 32 ) tech03_1 64 32 0 1 1 +( 136 128 152 ) ( 136 -128 152 ) ( 128 -128 152 ) tech03_1 64 32 0 1 1 +( 136 128 32 ) ( 136 128 152 ) ( 128 128 152 ) tech03_1 64 32 0 1 1 +( 136 128 32 ) ( 136 -128 32 ) ( 136 -128 152 ) tech03_1 64 32 0 1 1 +} +// brush 26 +{ +( 128 128 152 ) ( 128 128 168 ) ( 128 -128 168 ) tech04_1 0 -8 0 1 1 +( 136 -128 168 ) ( 136 -128 152 ) ( 128 -128 152 ) tech04_1 0 -8 0 1 1 +( 128 -128 152 ) ( 136 -128 152 ) ( 136 128 152 ) tech04_1 0 -8 0 1 1 +( 136 128 168 ) ( 136 -128 168 ) ( 128 -128 168 ) tech04_1 0 -8 0 1 1 +( 136 128 152 ) ( 136 128 168 ) ( 128 128 168 ) tech04_1 0 -8 0 1 1 +( 136 128 152 ) ( 136 -128 152 ) ( 136 -128 168 ) tech04_1 0 -8 0 1 1 +} +// brush 27 +{ +( -260 -136 168.70588235293641 ) ( -260 -136 175.50000000000159 ) ( -260 -1028 175.50000000000159 ) tech01_6 16 0 0 1 1 +( 136 -1028 175.50000000000159 ) ( 136 -1028 168.70588235293641 ) ( -260 -1028 168.70588235293641 ) tech01_6 -1.37374 0 0 0.99 1 +( -260 -1028 168.70588235293641 ) ( 136 -1028 168.70588235293641 ) ( 136 -136 168.70588235293641 ) tech01_6 -1.37374 -16 0 0.99 1 +( 136 -136 175.50000000000159 ) ( 136 -1028 175.50000000000159 ) ( -260 -1028 175.50000000000159 ) tech01_6 -1.37374 -16 0 0.99 1 +( 136 -136 168.70588235293641 ) ( 136 -136 175.50000000000159 ) ( -260 -136 175.50000000000159 ) tech01_6 -1.37374 0 0 0.99 1 +( 136 -136 168.70588235293641 ) ( 136 -1028 168.70588235293641 ) ( 136 -1028 175.50000000000159 ) tech01_6 16 0 0 1 1 +} +// brush 28 +{ +( 123.5 -136 32 ) ( 123.5 -136 152 ) ( 123.5 -1028 152 ) tech03_1 72 32 0 1 1 +( 136 -1028 152 ) ( 136 -1028 32 ) ( 123.5 -1028 32 ) tech03_1 64 32 0 1 1 +( 123.5 -1028 32 ) ( 136 -1028 32 ) ( 136 -136 32 ) tech03_1 64 -104 0 1 1 +( 136 -136 152 ) ( 136 -1028 152 ) ( 123.5 -1028 152 ) tech03_1 64 -104 0 1 1 +( 136 -136 32 ) ( 136 -136 152 ) ( 123.5 -136 152 ) tech03_1 64 32 0 1 1 +( 136 -136 32 ) ( 136 -1028 32 ) ( 136 -1028 152 ) tech03_1 72 32 0 1 1 +} +// brush 29 +{ +( 123.5 -136 152 ) ( 123.5 -136 168 ) ( 123.5 -1028 168 ) tech04_1 8 -8 0 1 1 +( 136 -1028 168 ) ( 136 -1028 152 ) ( 123.5 -1028 152 ) tech04_1 0 -8 0 1 1 +( 123.5 -1028 152 ) ( 136 -1028 152 ) ( 136 -136 152 ) tech04_1 0 0 0 1 1 +( 136 -136 168 ) ( 136 -1028 168 ) ( 123.5 -1028 168 ) tech04_1 0 0 0 1 1 +( 136 -136 152 ) ( 136 -136 168 ) ( 123.5 -136 168 ) tech04_1 0 -8 0 1 1 +( 136 -136 152 ) ( 136 -1028 152 ) ( 136 -1028 168 ) tech04_1 8 -8 0 1 1 +} +// brush 30 +{ +( 123.5 -136 8 ) ( 123.5 -136 32 ) ( 123.5 -1028 32 ) tech04_1 8 0 0 1 1 +( 136 -1028 32 ) ( 136 -1028 8 ) ( 123.5 -1028 8 ) tech04_1 0 0 0 1 1 +( 123.5 -1028 8 ) ( 136 -1028 8 ) ( 136 -136 8 ) tech04_1 0 -8 0 1 1 +( 136 -136 32 ) ( 136 -1028 32 ) ( 123.5 -1028 32 ) tech04_1 0 -8 0 1 1 +( 136 -136 8 ) ( 136 -136 32 ) ( 123.5 -136 32 ) tech04_1 0 0 0 1 1 +( 136 -136 8 ) ( 136 -1028 8 ) ( 136 -1028 32 ) tech04_1 8 0 0 1 1 +} +// brush 31 +{ +( -96 5792 4160 ) ( -96 -6496 4160 ) ( -96 5792 -4032 ) tech04_1 8 -8 0 1 1 +( -8736 -304 4160 ) ( 7648 -304 4160 ) ( -8736 -304 -4032 ) tech04_1 32 -8 0 1 1 +( 7648 -6496 160 ) ( 7648 5792 160 ) ( -8736 -6496 160 ) tlight02 32 -8 0 1 1 +( 7648 5792 168 ) ( 7648 -6496 168 ) ( -8736 -6496 168 ) tech04_1 8 0 90 1 1 +( 7648 -256 4160 ) ( -8736 -256 4160 ) ( -8736 -256 -4032 ) tech04_1 32 -8 0 1 1 +( -32 -6496 4160 ) ( -32 5792 4160 ) ( -32 5792 -4032 ) tech04_1 8 -8 0 1 1 +} +// brush 32 +{ +( -32 -272 164 ) ( -32 -272 168 ) ( -32 -288 168 ) tech02_1 8 8 0 1 1 +( 128 -288 168 ) ( 128 -288 164 ) ( -32 -288 164 ) tech02_1 0 8 0 1 1 +( -32 -288 164 ) ( 128 -288 164 ) ( 128 -272 164 ) tech02_1 2 -5.94617 0 1 0.298772 +( 128 -272 168 ) ( 128 -288 168 ) ( -32 -288 168 ) tech02_1 8 -32 90 1 1 +( 128 -272 164 ) ( 128 -272 168 ) ( -32 -272 168 ) tech02_1 0 8 0 1 1 +( 128 -272 164 ) ( 128 -288 164 ) ( 128 -288 168 ) tech02_1 8 8 0 1 1 +} +// brush 33 +{ +( -256 -392 8 ) ( -256 -392 32 ) ( -256 -400 32 ) tech04_1 -8 0 180 1 -1 +( 8 -400 32 ) ( 8 -400 8 ) ( -256 -400 8 ) tech04_1 0 0 0 1 1 +( -256 -400 8 ) ( 8 -400 8 ) ( 8 -392 8 ) tech04_1 -8 0 270 1 1 +( 8 -392 32 ) ( 8 -400 32 ) ( -256 -400 32 ) tech04_1 -8 0 270 1 1 +( 8 -392 8 ) ( 8 -392 32 ) ( -256 -392 32 ) tech04_1 0 0 0 1 1 +( 8 -392 8 ) ( 8 -400 8 ) ( 8 -400 32 ) tech04_1 -8 0 180 1 -1 +} +// brush 34 +{ +( -256 -392 32 ) ( -256 -392 152 ) ( -256 -400 152 ) tech03_1 -72 32 180 1 -1 +( 8 -400 152 ) ( 8 -400 32 ) ( -256 -400 32 ) tech03_1 64 32 0 1 1 +( -256 -400 32 ) ( 8 -400 32 ) ( 8 -392 32 ) tech03_1 -72 -96 270 1 1 +( 8 -392 152 ) ( 8 -400 152 ) ( -256 -400 152 ) tech03_1 -72 -96 270 1 1 +( 8 -392 32 ) ( 8 -392 152 ) ( -256 -392 152 ) tech03_1 64 32 0 1 1 +( 8 -392 32 ) ( 8 -400 32 ) ( 8 -400 152 ) tech03_1 -72 32 180 1 -1 +} +// brush 35 +{ +( 8 -392 16 ) ( 8 -392 168 ) ( 8 -400 168 ) tech04_1 -8 0 180 1 -1 +( 24 -400 168 ) ( 24 -400 16 ) ( 8 -400 16 ) tech04_1 24 0 180 1 -1 +( 8 -400 16 ) ( 24 -400 16 ) ( 24 -392 16 ) tech04_1 24 -8 180 1 -1 +( 24 -392 168 ) ( 24 -400 168 ) ( 8 -400 168 ) tech04_1 24 -8 180 1 -1 +( 24 -392 16 ) ( 24 -392 168 ) ( 8 -392 168 ) tech04_1 24 -0.84211 180 1 -1.05556 +( 24 -392 16 ) ( 24 -400 16 ) ( 24 -400 168 ) tech04_1 -8 0 180 1 -1 +} +// brush 36 +{ +( 112 -392 16 ) ( 112 -392 168 ) ( 112 -400 168 ) tech04_1 -8 0 180 1 -1 +( 128 -400 168 ) ( 128 -400 16 ) ( 112 -400 16 ) tech04_1 96 0 180 1 -1 +( 112 -400 16 ) ( 128 -400 16 ) ( 128 -392 16 ) tech04_1 96 -8 180 1 -1 +( 128 -392 168 ) ( 128 -400 168 ) ( 112 -400 168 ) tech04_1 96 -8 180 1 -1 +( 128 -392 16 ) ( 128 -392 168 ) ( 112 -392 168 ) tech04_1 96 -0.84211 180 1 -1.05556 +( 128 -392 16 ) ( 128 -400 16 ) ( 128 -400 168 ) tech04_1 -8 0 180 1 -1 +} +// brush 37 +{ +( 96 -392 16 ) ( 96 -392 168 ) ( 96 -400 168 ) tech04_1 -8 0 180 1 -1 +( 112 -400 168 ) ( 112 -400 16 ) ( 96 -400 16 ) tech04_1 96 0 180 1 -1 +( 96 -400 16 ) ( 112 -400 16 ) ( 112 -392 16 ) tech04_1 96 -8 180 1 -1 +( 112 -392 168 ) ( 112 -400 168 ) ( 96 -400 168 ) tech04_1 96 -8 180 1 -1 +( 112 -392 16 ) ( 112 -392 168 ) ( 96 -392 168 ) tech04_1 96 -0.84211 180 1 -1.05556 +( 112 -392 16 ) ( 112 -400 16 ) ( 112 -400 168 ) tech04_1 -8 0 180 1 -1 +} +// brush 38 +{ +( -250 -224 16 ) ( -250 -224 96 ) ( -250 -288 96 ) tech10_1 4 8.35088 0 1 1 +( -234 -288 96 ) ( -234 -288 16 ) ( -250 -288 16 ) tech10_1 22 8.35088 0 1 1 +( -250 -288 16 ) ( -234 -288 16 ) ( -234 -224 16 ) tech10_1 22 12 0 1 1 +( -234 -224 96 ) ( -234 -288 96 ) ( -250 -288 96 ) tech10_1 22 12 0 1 1 +( -234 -224 16 ) ( -234 -224 96 ) ( -250 -224 96 ) tech10_1 22 8.35088 0 1 1 +( -234 -224 16 ) ( -234 -288 16 ) ( -234 -288 96 ) tech10_1 32 -51.0766 0 1 1.26556 +} +// brush 39 +{ +( 86 -224 16 ) ( 86 -224 48 ) ( 86 -288 48 ) tech10_1 32 -32 0 1 0.5 +( 126 -288 48 ) ( 126 -288 16 ) ( 86 -288 16 ) tech10_1 -330.509 -32 0 0.622194 0.5 +( 86 -288 16 ) ( 126 -288 16 ) ( 126 -224 16 ) tech10_1 -6.4 12 0 2.5 1 +( 126 -224 48 ) ( 126 -288 48 ) ( 86 -288 48 ) tech10_1 -352 -73.6 90 1 0.625 +( 126 -224 16 ) ( 126 -224 48 ) ( 86 -224 48 ) tech10_1 -330.509 -32 0 0.622194 0.5 +( 126 -224 16 ) ( 126 -288 16 ) ( 126 -288 48 ) tech10_1 -32 31.8874 0 1 0.506223 +} +// brush 40 +{ +( -120 -528 8 ) ( -120 -528 32 ) ( -120 -536 32 ) tech04_1 -16 0 180 1 -1 +( 128 -536 32 ) ( 128 -536 8 ) ( -120 -536 8 ) tech04_1 -120 0 0 1 1 +( -120 -536 8 ) ( 128 -536 8 ) ( 128 -528 8 ) tech04_1 -16 8 270 1 1 +( 128 -528 32 ) ( 128 -536 32 ) ( -120 -536 32 ) tech04_1 -16 8 270 1 1 +( 128 -528 8 ) ( 128 -528 32 ) ( -120 -528 32 ) tech04_1 -120 0 0 1 1 +( 128 -528 8 ) ( 128 -536 8 ) ( 128 -536 32 ) tech04_1 -16 0 180 1 -1 +} +// brush 41 +{ +( -120 -528 32 ) ( -120 -528 152 ) ( -120 -536 152 ) tech03_1 48 32 180 1 -1 +( 128 -536 152 ) ( 128 -536 32 ) ( -120 -536 32 ) tech03_1 -56 32 0 1 1 +( -120 -536 32 ) ( 128 -536 32 ) ( 128 -528 32 ) tech03_1 48 24 270 1 1 +( 128 -528 152 ) ( 128 -536 152 ) ( -120 -536 152 ) tech03_1 48 24 270 1 1 +( 128 -528 32 ) ( 128 -528 152 ) ( -120 -528 152 ) tech03_1 -56 32 0 1 1 +( 128 -528 32 ) ( 128 -536 32 ) ( 128 -536 152 ) tech03_1 48 32 180 1 -1 +} +// brush 42 +{ +( -120 -528 152 ) ( -120 -528 168 ) ( -120 -536 168 ) tech04_1 -16 8 180 1 -1 +( 128 -536 168 ) ( 128 -536 152 ) ( -120 -536 152 ) tech04_1 -120 8 0 1 1 +( -120 -536 152 ) ( 128 -536 152 ) ( 128 -528 152 ) tech04_1 -16 0 270 1 1 +( 128 -528 168 ) ( 128 -536 168 ) ( -120 -536 168 ) tech04_1 -16 0 270 1 1 +( 128 -528 152 ) ( 128 -528 168 ) ( -120 -528 168 ) tech04_1 -120 8 0 1 1 +( 128 -528 152 ) ( 128 -536 152 ) ( 128 -536 168 ) tech04_1 -16 8 180 1 -1 +} +// brush 43 +{ +( -136 -536 32 ) ( -136 -536 152 ) ( -136 -768 152 ) tech03_1 64 32 0 1 1 +( -120 -768 152 ) ( -120 -768 32 ) ( -136 -768 32 ) tech03_1 -64 32 0 1 1 +( -136 -768 32 ) ( -120 -768 32 ) ( -120 -536 32 ) tech03_1 -64 16 0 1 1 +( -120 -536 152 ) ( -120 -768 152 ) ( -136 -768 152 ) tech03_1 -64 16 0 1 1 +( -120 -536 32 ) ( -120 -536 152 ) ( -136 -536 152 ) tech03_1 -64 32 0 1 1 +( -120 -536 32 ) ( -120 -768 32 ) ( -120 -768 152 ) tech03_1 80 32 0 1 1 +} +// brush 44 +{ +( -136 -536 8 ) ( -136 -536 32 ) ( -136 -768 32 ) tech04_1 16 0 0 1 1 +( -120 -768 32 ) ( -120 -768 8 ) ( -136 -768 8 ) tech04_1 0 0 0 1 1 +( -136 -768 8 ) ( -120 -768 8 ) ( -120 -536 8 ) tech04_1 0 0 0 1 1 +( -120 -536 32 ) ( -120 -768 32 ) ( -136 -768 32 ) tech04_1 0 0 0 1 1 +( -120 -536 8 ) ( -120 -536 32 ) ( -136 -536 32 ) tech04_1 0 0 0 1 1 +( -120 -536 8 ) ( -120 -768 8 ) ( -120 -768 32 ) tech04_1 16 0 0 1 1 +} +// brush 45 +{ +( -136 -536 152 ) ( -136 -536 168 ) ( -136 -768 168 ) tech04_1 16 -8 0 1 1 +( -120 -768 168 ) ( -120 -768 152 ) ( -136 -768 152 ) tech04_1 0 -8 0 1 1 +( -136 -768 152 ) ( -120 -768 152 ) ( -120 -536 152 ) tech04_1 0 8 0 1 1 +( -120 -536 168 ) ( -120 -768 168 ) ( -136 -768 168 ) tech04_1 0 8 0 1 1 +( -120 -536 152 ) ( -120 -536 168 ) ( -136 -536 168 ) tech04_1 0 -8 0 1 1 +( -120 -536 152 ) ( -120 -768 152 ) ( -120 -768 168 ) tech04_1 16 -8 0 1 1 +} +// brush 46 +{ +( -264 128 12 ) ( -264 128 32 ) ( -264 -899 32 ) tech04_1 0 0 0 1 1 +( -249.8102189781022 -899 32 ) ( -249.8102189781022 -899 12 ) ( -264 -899 12 ) tech04_1 0 0 0 1 1 +( -264 -899 12 ) ( -249.8102189781022 -899 12 ) ( -249.8102189781022 128 12 ) tech04_1 0 0 0 1 1 +( -249.8102189781022 128 32 ) ( -249.8102189781022 -899 32 ) ( -264 -899 32 ) tech04_1 0 0 0 1 1 +( -249.8102189781022 128 12 ) ( -249.8102189781022 128 32 ) ( -264 128 32 ) tech04_1 0 0 0 1 1 +( -249.8102189781022 128 12 ) ( -249.8102189781022 -899 12 ) ( -249.8102189781022 -899 32 ) tech04_1 0 0 0 1 1 +} +// brush 47 +{ +( -264 -899 32 ) ( -264 -895.79062499999895 32 ) ( -264 -899 33 ) tech03_1 64 32 0 1 1 +( -264 -899 32 ) ( -264 -899 33 ) ( -263.11313868613126 -899 32 ) tech03_1 64 32 0 1 1 +( -264 -899 32 ) ( -263.11313868613126 -899 32 ) ( -264 -895.79062499999895 32 ) tech03_1 64 32 0 1 1 +( -249.8102189781022 128 152 ) ( -249.8102189781022 131.20937499999815 152 ) ( -248.92335766423361 128 152 ) tech03_1 64 32 0 1 1 +( -249.8102189781022 128 152 ) ( -248.92335766423361 128 152 ) ( -249.8102189781022 128 153 ) tech03_1 64 32 0 1 1 +( -249.8102189781022 128 152 ) ( -249.8102189781022 128 153 ) ( -249.8102189781022 131.20937499999815 152 ) tech03_1 64 32 0 1 1 +} +// brush 48 +{ +( -264 128 152 ) ( -264 128 168 ) ( -264 -899 168 ) tech04_1 0 -8 0 1 1 +( -249.8102189781022 -899 168 ) ( -249.8102189781022 -899 152 ) ( -264 -899 152 ) tech04_1 0 -8 0 1 1 +( -264 -899 152 ) ( -249.8102189781022 -899 152 ) ( -249.8102189781022 128 152 ) tech04_1 0 -8 0 1 1 +( -249.8102189781022 128 168 ) ( -249.8102189781022 -899 168 ) ( -264 -899 168 ) tech04_1 0 -8 0 1 1 +( -249.8102189781022 128 152 ) ( -249.8102189781022 128 168 ) ( -264 128 168 ) tech04_1 0 -8 0 1 1 +( -249.8102189781022 128 152 ) ( -249.8102189781022 -899 152 ) ( -249.8102189781022 -899 168 ) tech04_1 0 -8 0 1 1 +} +// brush 49 +{ +( -216 5600 4160 ) ( -216 -6688 4160 ) ( -216 5600 -4032 ) tech04_1 72 -8 0 1 1 +( -8856 -496 4160 ) ( 7528 -496 4160 ) ( -8856 -496 -4032 ) tech04_1 24 -8 0 1 1 +( 7528 -6688 160 ) ( 7528 5600 160 ) ( -8856 -6688 160 ) tlight02 24 -8 0 1 1 +( 7528 5600 168 ) ( 7528 -6688 168 ) ( -8856 -6688 168 ) tech04_1 72 -8 90 1 1 +( 7528 -448 4160 ) ( -8856 -448 4160 ) ( -8856 -448 -4032 ) tech04_1 24 -8 0 1 1 +( -152 -6688 4160 ) ( -152 5600 4160 ) ( -152 5600 -4032 ) tech04_1 72 -8 0 1 1 +} +// brush 50 +{ +( -256 -464 164 ) ( -256 -464 168 ) ( -256 -480 168 ) tech02_1 8 8 0 1 1 +( -216 -480 168 ) ( -216 -480 164 ) ( -256 -480 164 ) tech02_1 31.9999 8 0 0.25 1 +( -256 -480 164 ) ( -216 -480 164 ) ( -216 -464 164 ) tech02_1 -29.9999 -8.57703 0 0.25 0.298772 +( -216 -464 168 ) ( -216 -480 168 ) ( -256 -480 168 ) tech02_1 8 0 90 1 0.25 +( -216 -464 164 ) ( -216 -464 168 ) ( -256 -464 168 ) tech02_1 31.9999 8 0 0.25 1 +( -216 -464 164 ) ( -216 -480 164 ) ( -216 -480 168 ) tech02_1 8 8 0 1 1 +} +// brush 51 +{ +( -136 -528 16 ) ( -136 -528 168 ) ( -136 -536 168 ) tech04_1 -8 0 180 1 -1 +( -120 -536 168 ) ( -120 -536 16 ) ( -136 -536 16 ) tech04_1 96 0 180 1 -1 +( -136 -536 16 ) ( -120 -536 16 ) ( -120 -528 16 ) tech04_1 96 -8 180 1 -1 +( -120 -528 168 ) ( -120 -536 168 ) ( -136 -536 168 ) tech04_1 96 -8 180 1 -1 +( -120 -528 16 ) ( -120 -528 168 ) ( -136 -528 168 ) tech04_1 88 -0.842109 180 1 -1.05556 +( -120 -528 16 ) ( -120 -536 16 ) ( -120 -536 168 ) tech04_1 -8 0 180 1 -1 +} +// brush 52 +{ +( -250 -1016 152 ) ( -250 -1016 168 ) ( -250 -1027.4545454545455 168 ) tech04_1 -8 8 180 1 -1 +( 128 -1027.4545454545455 168 ) ( 128 -1027.4545454545455 152 ) ( -250 -1027.4545454545455 152 ) tech04_1 0 8 0 1 1 +( -250 -1027.4545454545455 152 ) ( 128 -1027.4545454545455 152 ) ( 128 -1016 152 ) tech04_1 -8 -8 270 1 1 +( 128 -1016 168 ) ( 128 -1027.4545454545455 168 ) ( -250 -1027.4545454545455 168 ) tech04_1 -8 -8 270 1 1 +( 128 -1016 152 ) ( 128 -1016 168 ) ( -250 -1016 168 ) tech04_1 0 8 0 1 1 +( 128 -1016 152 ) ( 128 -1027.4545454545455 152 ) ( 128 -1027.4545454545455 168 ) tech04_1 -8 8 180 1 -1 +} +// brush 53 +{ +( -250 -1016 32 ) ( -250 -1016 152 ) ( -250 -1027.4545454545455 152 ) tech03_1 -72 32 180 1 -1 +( 128 -1027.4545454545455 152 ) ( 128 -1027.4545454545455 32 ) ( -250 -1027.4545454545455 32 ) tech03_1 64 32 0 1 1 +( -250 -1027.4545454545455 32 ) ( 128 -1027.4545454545455 32 ) ( 128 -1016 32 ) tech03_1 -72 -96 270 1 1 +( 128 -1016 152 ) ( 128 -1027.4545454545455 152 ) ( -250 -1027.4545454545455 152 ) tech03_1 -72 -96 270 1 1 +( 128 -1016 32 ) ( 128 -1016 152 ) ( -250 -1016 152 ) tech03_1 64 32 0 1 1 +( 128 -1016 32 ) ( 128 -1027.4545454545455 32 ) ( 128 -1027.4545454545455 152 ) tech03_1 -72 32 180 1 -1 +} +// brush 54 +{ +( -250 -1016 8 ) ( -250 -1016 32 ) ( -250 -1027.4545454545455 32 ) tech04_1 -8 0 180 1 -1 +( 128 -1027.4545454545455 32 ) ( 128 -1027.4545454545455 8 ) ( -250 -1027.4545454545455 8 ) tech04_1 0 0 0 1 1 +( -250 -1027.4545454545455 8 ) ( 128 -1027.4545454545455 8 ) ( 128 -1016 8 ) tech04_1 -8 0 270 1 1 +( 128 -1016 32 ) ( 128 -1027.4545454545455 32 ) ( -250 -1027.4545454545455 32 ) tech04_1 -8 0 270 1 1 +( 128 -1016 8 ) ( 128 -1016 32 ) ( -250 -1016 32 ) tech04_1 0 0 0 1 1 +( 128 -1016 8 ) ( 128 -1027.4545454545455 8 ) ( 128 -1027.4545454545455 32 ) tech04_1 -8 0 180 1 -1 +} +// brush 55 +{ +( -90 5320 4160 ) ( -90 -6968 4160 ) ( -90 -6968 -4032 ) tech04_1 -16 8 180 1 -1 +( -7770 -920 4160 ) ( 8614 -920 4160 ) ( 8614 -920 -4032 ) tech04_1 -90 8 180 1 -1 +( -7770 5320 160 ) ( -7770 -6968 160 ) ( 8614 5320 160 ) tlight02 -26 16 180 1 1 +( -7770 -6968 168 ) ( -7770 5320 168 ) ( 8614 5320 168 ) tech04_1 -16 -10 270 1 1 +( 8614 -872 4160 ) ( -7770 -872 4160 ) ( 8614 -872 -4032 ) tech04_1 -90 8 180 1 -1 +( -26 -6968 4160 ) ( -26 5320 4160 ) ( -26 -6968 -4032 ) tech04_1 -16 8 180 1 -1 +} +// brush 56 +{ +( -250 -904 164 ) ( -250 -888 164 ) ( -250 -888 168 ) tech02_1 -16 8 180 1 -1 +( -250 -904 164 ) ( -250 -904 168 ) ( -90 -904 168 ) tech02_1 -58 8 180 1 -1 +( -90 -888 164 ) ( -250 -888 164 ) ( -250 -904 164 ) tech02_1 -56 26.1677 180 1 0.298772 +( -250 -904 168 ) ( -250 -888 168 ) ( -90 -888 168 ) tech02_1 -16 -26 270 1 1 +( -250 -888 168 ) ( -250 -888 164 ) ( -90 -888 164 ) tech02_1 -58 8 180 1 -1 +( -90 -904 164 ) ( -90 -904 168 ) ( -90 -888 168 ) tech02_1 -16 8 180 1 -1 +} +// brush 57 +{ +( -136 -768 16 ) ( -136 -768 168 ) ( -136 -784 168 ) tech04_1 -112 -0.842105 180 1 -1.05556 +( -120 -784 168 ) ( -120 -784 16 ) ( -136 -784 16 ) tech04_1 -104 -0.842106 180 1 -1.05556 +( -136 -784 16 ) ( -120 -784 16 ) ( -120 -768 16 ) tech04_1 96 -8 180 1 -1 +( -120 -768 168 ) ( -120 -784 168 ) ( -136 -784 168 ) tech04_1 96 -8 180 1 -1 +( -120 -768 16 ) ( -120 -768 168 ) ( -136 -768 168 ) tech04_1 88 -0.84211 180 1 -1.05556 +( -120 -768 16 ) ( -120 -784 16 ) ( -120 -784 168 ) tech04_1 -112 -0.842105 180 1 -1.05556 +} +// brush 58 +{ +( -68 -632 81 ) ( -68 -632 113 ) ( -68 -640 113 ) tech04_2 -7.625 0 0 0.984615 0.25 +( -36 -640 113 ) ( -36 -640 81 ) ( -68 -640 81 ) basebutn3 4.5625 -15.4221 0 0.984615 1.01244 +( -68 -640 81 ) ( -36 -640 81 ) ( -36 -632 81 ) tech04_2 4.5625 0 0 0.984615 0.25 +( -36 -632 113 ) ( -36 -640 113 ) ( -68 -640 113 ) tech04_2 4.5625 0 0 0.984615 0.25 +( -36 -632 81 ) ( -36 -632 113 ) ( -68 -632 113 ) tech04_2 4.5625 0 0 0.984615 0.25 +( -36 -632 81 ) ( -36 -640 81 ) ( -36 -640 113 ) tech04_2 -7.625 0 0 0.984615 0.25 +} +// brush 59 +{ +( 8 -596 59.921244717633499 ) ( 8 -596 91.921244717633499 ) ( 8 -604 91.921244717633499 ) tech04_2 -44.1875 -4.31503 0 0.984615 0.25 +( 40 -604 91.921244717633499 ) ( 40 -604 59.921244717633499 ) ( 8 -604 59.921244717633499 ) basebutn3 -8.625 -4.24175 0 0.984615 1.01244 +( 8 -604 59.921244717633499 ) ( 40 -604 59.921244717633499 ) ( 40 -596 59.921244717633499 ) tech04_2 -72.625 0 0 0.984615 0.25 +( 40 -596 91.921244717633499 ) ( 40 -604 91.921244717633499 ) ( 8 -604 91.921244717633499 ) tech04_2 -72.625 0 0 0.984615 0.25 +( 40 -596 59.921244717633499 ) ( 40 -596 91.921244717633499 ) ( 8 -596 91.921244717633499 ) tech04_2 -72.625 -4.31503 0 0.984615 0.25 +( 40 -596 59.921244717633499 ) ( 40 -604 59.921244717633499 ) ( 40 -604 91.921244717633499 ) tech04_2 -44.1875 -4.31503 0 0.984615 0.25 +} +// brush 60 +{ +( 60 -672 67.921244717633499 ) ( 60 -672 99.921244717633499 ) ( 60 -680 99.921244717633499 ) tech04_2 33 -4.31503 0 0.984615 0.25 +( 92 -680 99.921244717633499 ) ( 92 -680 67.921244717633499 ) ( 60 -680 67.921244717633499 ) basebutn3 2.5625 3.65992 0 0.984615 1.01244 +( 60 -680 67.921244717633499 ) ( 92 -680 67.921244717633499 ) ( 92 -672 67.921244717633499 ) tech04_2 2.5625 0 0 0.984615 0.25 +( 92 -672 99.921244717633499 ) ( 92 -680 99.921244717633499 ) ( 60 -680 99.921244717633499 ) tech04_2 2.5625 0 0 0.984615 0.25 +( 92 -672 67.921244717633499 ) ( 92 -672 99.921244717633499 ) ( 60 -672 99.921244717633499 ) tech04_2 2.5625 -4.31503 0 0.984615 0.25 +( 92 -672 67.921244717633499 ) ( 92 -680 67.921244717633499 ) ( 92 -680 99.921244717633499 ) tech04_2 33 -4.31503 0 0.984615 0.25 +} +// brush 61 +{ +( -120 -624 94 ) ( -120 -624 102 ) ( -120 -632 102 ) tech04_2 -15.75 12.0002 0 0.984615 0.0625 +( -48 -632 102 ) ( -48 -632 94 ) ( -120 -632 94 ) tech04_2 -23.875 12.0002 0 0.984615 0.0625 +( -120 -632 94 ) ( -48 -632 94 ) ( -48 -624 94 ) tech04_2 16.75 0 0 0.984615 0.25 +( -48 -624 102 ) ( -48 -632 102 ) ( -120 -632 102 ) tech04_2 16.75 0 0 0.984615 0.25 +( -48 -624 94 ) ( -48 -624 102 ) ( -120 -624 102 ) tech04_2 16.75 12.0002 0 0.984615 0.0625 +( -48 -624 94 ) ( -48 -632 94 ) ( -48 -632 102 ) tech04_2 -15.75 12.0002 0 0.984615 0.0625 +} +// brush 62 +{ +( 72 -664 80 ) ( 72 -664 88 ) ( 72 -672 88 ) tech04_2 -15.75 12.0002 0 0.984615 0.0625 +( 144 -672 88 ) ( 144 -672 80 ) ( 72 -672 80 ) tech04_2 -23.875 12.0002 0 0.984615 0.0625 +( 72 -672 80 ) ( 144 -672 80 ) ( 144 -664 80 ) tech04_2 16.75 0 0 0.984615 0.25 +( 144 -664 88 ) ( 144 -672 88 ) ( 72 -672 88 ) tech04_2 16.75 0 0 0.984615 0.25 +( 144 -664 80 ) ( 144 -664 88 ) ( 72 -664 88 ) tech04_2 16.75 12.0002 0 0.984615 0.0625 +( 144 -664 80 ) ( 144 -672 80 ) ( 144 -672 88 ) tech04_2 -15.75 12.0002 0 0.984615 0.0625 +} +// brush 63 +{ +( 20 -596 84 ) ( 20 -596 12 ) ( 20 -588 12 ) tech04_2 16.75 0 0 0.984615 0.25 +( 28 -596 12 ) ( 20 -596 12 ) ( 20 -596 84 ) tech04_2 -23.875 12.0002 0 0.984615 0.0625 +( 20 -588 12 ) ( 20 -596 12 ) ( 28 -596 12 ) tech04_2 -15.75 12.0002 0 0.984615 0.0625 +( 20 -588 84 ) ( 28 -588 84 ) ( 28 -596 84 ) tech04_2 -15.75 12.0002 0 0.984615 0.0625 +( 20 -588 12 ) ( 28 -588 12 ) ( 28 -588 84 ) tech04_2 16.75 12.0002 0 0.984615 0.0625 +( 28 -588 12 ) ( 28 -596 12 ) ( 28 -596 84 ) tech04_2 16.75 0 0 0.984615 0.25 +} +// brush 64 +{ +( 67 -1016 62 ) ( 67 -1016 17 ) ( 67 -992 17 ) tech10_1 30.4473 24.1778 180 0.373316 -0.703125 +( 124 -1016 17 ) ( 67 -1016 17 ) ( 67 -1016 62 ) tech10_1 -11.2281 24.1613 0 0.890625 0.711875 +( 67 -992 17 ) ( 67 -1016 17 ) ( 124 -1016 17 ) tech10_1 6.66669 55.2281 270 1.5 0.890625 +( 124 -992 44 ) ( 124 -1016 62 ) ( 67 -1016 62 ) tech10_1 -11.2281 42.6665 0 0.890625 0.375 +( 124 -992 17 ) ( 124 -992 44 ) ( 67 -992 44 ) tech10_1 -11.2281 24.1778 0 0.890625 0.703125 +( 124 -992 17 ) ( 124 -1016 17 ) ( 124 -1016 62 ) tech10_1 30.4473 24.1778 180 0.373316 -0.703125 +} +// brush 65 +{ +( -6 -1000 17.078755282366501 ) ( -6 -1000 97.078755282366501 ) ( -6 -1016 97.078755282366501 ) tech10_1 20 9.42963 0 1 1 +( -6 -1016 17.078755282366501 ) ( -6 -1016 97.078755282366501 ) ( 58 -1016 97.078755282366501 ) tech10_1 -34 9.42963 180 1 -1 +( 58 -1016 17.078755282366501 ) ( 58 -1000 17.078755282366501 ) ( -6 -1000 17.078755282366501 ) tech10_1 20 50 90 1 1 +( -6 -1000 97.078755282366501 ) ( 58 -1000 97.078755282366501 ) ( 58 -1016 97.078755282366501 ) tech10_1 20 50 90 1 1 +( -6 -1000 17.078755282366501 ) ( 58 -1000 17.078755282366501 ) ( 58 -1000 97.078755282366501 ) tech10_1 -6 -50.2242 180 1 -1.26556 +( 58 -1000 97.078755282366501 ) ( 58 -1000 17.078755282366501 ) ( 58 -1016 17.078755282366501 ) tech10_1 20 9.42963 0 1 1 +} +// brush 66 +{ +( 119.32786885245899 -980 123 ) ( 119.32786885245899 -980 168 ) ( 119.32786885245899 -1016 168 ) cop1_3 -32.9316 46.9333 180 0.622194 -0.703125 +( 124 -1016 168 ) ( 124 -1016 123 ) ( 119.32786885245899 -1016 123 ) cop1_3 -11.2281 45.0639 0 0.890625 0.711875 +( 119.32786885245899 -1016 123 ) ( 124 -1016 123 ) ( 124 -980 123 ) cop1_3 29.0789 11.3811 90 0.623611 -0.888817 +( 124 -980 168 ) ( 124 -1016 168 ) ( 119.32786885245899 -1016 168 ) cop1_3 -11.2281 -25.6001 0 0.890625 0.625 +( 124 -980 123 ) ( 124 -980 168 ) ( 119.32786885245899 -980 168 ) cop1_3 -11.2281 46.9333 0 0.890625 0.703125 +( 124 -980 123 ) ( 124 -1016 123 ) ( 124 -1016 168 ) cop1_3 -32.9316 46.9333 180 0.622194 -0.703125 +} +// brush 67 +{ +( 67 -980 123 ) ( 67 -980 168 ) ( 67 -1028 168 ) cop1_3 -32.9316 46.9333 180 0.622194 -0.703125 +( 71.672131147540981 -1028 168 ) ( 71.672131147540981 -1028 123 ) ( 67 -1028 123 ) cop1_3 -11.2281 45.0639 0 0.890625 0.711875 +( 67 -1028 123 ) ( 71.672131147540981 -1028 123 ) ( 71.672131147540981 -980 123 ) cop1_3 29.0789 11.3811 90 0.623611 -0.888817 +( 71.672131147540981 -980 168 ) ( 71.672131147540981 -1028 168 ) ( 67 -1028 168 ) cop1_3 -11.2281 -25.6001 0 0.890625 0.625 +( 71.672131147540981 -980 123 ) ( 71.672131147540981 -980 168 ) ( 67 -980 168 ) cop1_3 -11.2281 46.9333 0 0.890625 0.703125 +( 71.672131147540981 -980 123 ) ( 71.672131147540981 -1028 123 ) ( 71.672131147540981 -1028 168 ) cop1_3 -32.9316 46.9333 180 0.622194 -0.703125 +} +// brush 68 +{ +( 67 -975.71929824561403 123 ) ( 67 -975.71929824561403 168 ) ( 67 -980 168 ) cop1_3 -32.9316 46.9333 180 0.622194 -0.703125 +( 124 -980 168 ) ( 124 -980 123 ) ( 67 -980 123 ) cop1_3 -11.2281 45.0639 0 0.890625 0.711875 +( 67 -980 123 ) ( 124 -980 123 ) ( 124 -975.71929824561403 123 ) cop1_3 29.0789 11.3811 90 0.623611 -0.888817 +( 124 -975.71929824561403 168 ) ( 124 -980 168 ) ( 67 -980 168 ) cop1_3 -11.2281 -25.6001 0 0.890625 0.625 +( 124 -975.71929824561403 123 ) ( 124 -975.71929824561403 168 ) ( 67 -975.71929824561403 168 ) cop1_3 -11.2281 46.9333 0 0.890625 0.703125 +( 124 -975.71929824561403 123 ) ( 124 -980 123 ) ( 124 -980 168 ) cop1_3 -32.9316 46.9333 180 0.622194 -0.703125 +} +// brush 69 +{ +( 68 -1016 161.71929824561403 ) ( 68 -976 161.71929824561403 ) ( 68 -976 166 ) black -32.9316 46.9333 180 0.622194 -0.703125 +( 68 -1016 166 ) ( 127 -1016 166 ) ( 127 -1016 161.71929824561403 ) black 29.0789 6.43806 90 0.623611 -0.95119 +( 127 -1016 161.71929824561403 ) ( 127 -976 161.71929824561403 ) ( 68 -976 161.71929824561403 ) black -6.29508 46.9333 0 0.953125 0.703125 +( 127 -976 166 ) ( 127 -1016 166 ) ( 68 -1016 166 ) black -6.29508 45.0639 0 0.953125 0.711875 +( 127 -976 161.71929824561403 ) ( 127 -976 166 ) ( 68 -976 166 ) black -6.29508 -25.6001 0 0.953125 0.625 +( 127 -1016 161.71929824561403 ) ( 127 -1016 166 ) ( 127 -976 166 ) black -32.9316 46.9333 180 0.622194 -0.703125 +} +// brush 70 +{ +( -266 -899 16.705882352936413 ) ( -266 -899 168.70588235293641 ) ( -266 -915 168.70588235293641 ) tech04_1 -115 -0.17337 180 1 -1.05556 +( -250 -915 168.70588235293641 ) ( -250 -915 16.705882352936413 ) ( -266 -915 16.705882352936413 ) tech04_1 -106 -0.17337 180 1 -1.05556 +( -266 -915 16.705882352936413 ) ( -250 -915 16.705882352936413 ) ( -250 -899 16.705882352936413 ) tech04_1 -34 5 180 1 -1 +( -250 -899 168.70588235293641 ) ( -250 -915 168.70588235293641 ) ( -266 -915 168.70588235293641 ) tech04_1 -34 5 180 1 -1 +( -250 -899 16.705882352936413 ) ( -250 -899 168.70588235293641 ) ( -266 -899 168.70588235293641 ) tech04_1 -42 -0.173378 180 1 -1.05556 +( -250 -899 16.705882352936413 ) ( -250 -915 16.705882352936413 ) ( -250 -915 168.70588235293641 ) tech04_1 -115 -0.17337 180 1 -1.05556 +} +// brush 71 +{ +( -266 -1015 16.705882352936413 ) ( -266 -1015 168.70588235293641 ) ( -266 -1031 168.70588235293641 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -250 -1031 168.70588235293641 ) ( -250 -1031 16.705882352936413 ) ( -266 -1031 16.705882352936413 ) tech04_1 -106 -0.17337 180 1 -1.05556 +( -266 -1031 16.705882352936413 ) ( -250 -1031 16.705882352936413 ) ( -250 -1015 16.705882352936413 ) tech04_1 -34 -15 180 1 -1 +( -250 -1015 168.70588235293641 ) ( -250 -1031 168.70588235293641 ) ( -266 -1031 168.70588235293641 ) tech04_1 -34 -15 180 1 -1 +( -250 -1015 16.705882352936413 ) ( -250 -1015 168.70588235293641 ) ( -266 -1015 168.70588235293641 ) tech04_1 -42 -0.173378 180 1 -1.05556 +( -250 -1015 16.705882352936413 ) ( -250 -1031 16.705882352936413 ) ( -250 -1031 168.70588235293641 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 72 +{ +( -265 140 167.96727622714218 ) ( -225 140 258 ) ( -225 -1031 258 ) tech04_1 0 -6 0 1 1 +( -204.4992939589585 -1031 258 ) ( -244.49929395895936 -1031 167.96727622714218 ) ( -265 -1031 167.96727622714218 ) tech04_1 -3 -6 0 1 1 +( -265 -1031 167.96727622714218 ) ( -244.49929395895936 -1031 167.96727622714218 ) ( -244.49929395895936 140 167.96727622714218 ) tech04_1 -2.99998 -8 0 1 1 +( -204.4992939589585 140 258 ) ( -204.4992939589585 -1031 258 ) ( -225 -1031 258 ) tech04_1 -3 -8 0 1 1 +( -244.49929395895936 140 167.96727622714218 ) ( -204.4992939589585 140 258 ) ( -225 140 258 ) tech04_1 -3 -6 0 1 1 +( -244.49929395895936 140 167.96727622714218 ) ( -244.49929395895936 -1031 167.96727622714218 ) ( -204.4992939589585 -1031 258 ) tech04_1 0 -6 0 1 1 +} +// brush 73 +{ +( -1268 -1432 388 ) ( -1268 -1430.7279954571259 388 ) ( -1268 -1432 388.5 ) sky4 0 0 0 1 1 +( -1268 -1432 388 ) ( -1268 -1432 388.5 ) ( -1267.042253521126 -1432 388 ) sky4 0 0 0 1 1 +( -1268 -1432 388 ) ( -1267.042253521126 -1432 388 ) ( -1268 -1430.7279954571259 388 ) sky4 0 0 0 1 1 +( 908 808 420 ) ( 908 809.27200454287481 420 ) ( 908.9577464788731 808 420 ) sky4 0 0 0 1 1 +( 908 808 420 ) ( 908.9577464788731 808 420 ) ( 908 808 420.5 ) sky4 0 0 0 1 1 +( 908 808 420 ) ( 908 808 420.5 ) ( 908 809.27200454287481 420 ) sky4 0 0 0 1 1 +} +// brush 74 +{ +( -1064 -1436 -116.83557434849899 ) ( -1044 584 -84.835574329006164 ) ( -884 -1296 12.078755282361044 ) wgrass1_1 30.3157 -62.0492 0 1.1875 1.28125 +( -1044 584 -84.835574329006164 ) ( -884 456 12.078755282357777 ) ( -884 -1296 12.078755282361044 ) wgrass1_1 30.3157 -62.0492 0 1.1875 1.28125 +( -884 -1296 12.078755282361044 ) ( -884 456 12.078755282357777 ) ( 576 456 12.078755282361152 ) wgrass1_1 -14.0482 -0.000115633 0 1.28125 1.1875 +( 576 456 12.078755282361152 ) ( -884 456 12.078755282357777 ) ( -1044 584 -84.835574329006164 ) wgrass1_1 -16.1951 23.8052 0 1.28125 1.28125 +( 576 -1296 12.078755282364423 ) ( -1064 -1436 -116.83557434849899 ) ( -884 -1296 12.078755282361044 ) wgrass1_1 -16.1951 -63.6105 0 1.28125 1.28125 +( 576 -1296 12.078755282364423 ) ( 680.28819410162941 -1371.873947200362 -68 ) ( -1064 -1436 -116.83557434849899 ) wgrass1_1 -16.1951 0.0653687 0 1.28125 1.28125 +( -1064 -1436 -116.83557434849899 ) ( 680.28819410162941 -1371.873947200362 -68 ) ( -1044 584 -84.835574329006164 ) wgrass1_1 -16.1951 -20.2105 0 1.28125 1.1875 +( -1044 584 -84.835574329006164 ) ( 680.28819410162941 -1371.873947200362 -68 ) ( 576 456 7.1644256630876271 ) wgrass1_1 -16.1951 -20.2105 0 1.28125 1.1875 +( -1044 584 -84.835574329006164 ) ( 576 456 7.1644256630876271 ) ( 576 456 12.078755282361152 ) wgrass1_1 -16.1951 -2.67023 0 1.28125 1.28125 +( 576 456 12.078755282361152 ) ( 680.28819410162941 -1371.873947200362 -68 ) ( 576 -1296 12.078755282364423 ) wgrass1_1 -41.5437 -56.8459 0 1.1875 1.28125 +( 576 456 7.1644256630876271 ) ( 680.28819410162941 -1371.873947200362 -68 ) ( 576 456 12.078755282361152 ) wgrass1_1 20.2105 -2.67023 0 1.1875 1.28125 +} +// brush 75 +{ +( -300 -1015 16.705882352936506 ) ( -300 -1015 112.7058823529364 ) ( -300 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -284 -1031 112.7058823529364 ) ( -284 -1031 16.705882352936506 ) ( -300 -1031 16.705882352936506 ) tech04_1 -108 -0.17337 180 1 -1.05556 +( -300 -1031 16.705882352936506 ) ( -284 -1031 16.705882352936506 ) ( -284 -1015 16.705882352936506 ) tech04_1 -36 -15 180 1 -1 +( -284 -1015 112.7058823529364 ) ( -284 -1031 112.7058823529364 ) ( -300 -1031 112.7058823529364 ) tech04_1 -36 -15 180 1 -1 +( -284 -1015 16.705882352936506 ) ( -284 -1015 112.7058823529364 ) ( -300 -1015 112.7058823529364 ) tech04_1 -44 -0.173378 180 1 -1.05556 +( -284 -1015 16.705882352936506 ) ( -284 -1031 16.705882352936506 ) ( -284 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 76 +{ +( -336 -1015 16.705882352936506 ) ( -336 -1015 112.7058823529364 ) ( -336 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -320 -1031 112.7058823529364 ) ( -320 -1031 16.705882352936506 ) ( -336 -1031 16.705882352936506 ) tech04_1 -16 -0.17337 180 1 -1.05556 +( -336 -1031 16.705882352936506 ) ( -320 -1031 16.705882352936506 ) ( -320 -1015 16.705882352936506 ) tech04_1 -72 -15 180 1 -1 +( -320 -1015 112.7058823529364 ) ( -320 -1031 112.7058823529364 ) ( -336 -1031 112.7058823529364 ) tech04_1 -72 -15 180 1 -1 +( -320 -1015 16.705882352936506 ) ( -320 -1015 112.7058823529364 ) ( -336 -1015 112.7058823529364 ) tech04_1 -80 -0.173378 180 1 -1.05556 +( -320 -1015 16.705882352936506 ) ( -320 -1031 16.705882352936506 ) ( -320 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 77 +{ +( -372 -1015 16.705882352936506 ) ( -372 -1015 112.7058823529364 ) ( -372 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -356 -1031 112.7058823529364 ) ( -356 -1031 16.705882352936506 ) ( -372 -1031 16.705882352936506 ) tech04_1 -52 -0.17337 180 1 -1.05556 +( -372 -1031 16.705882352936506 ) ( -356 -1031 16.705882352936506 ) ( -356 -1015 16.705882352936506 ) tech04_1 -108 -15 180 1 -1 +( -356 -1015 112.7058823529364 ) ( -356 -1031 112.7058823529364 ) ( -372 -1031 112.7058823529364 ) tech04_1 -108 -15 180 1 -1 +( -356 -1015 16.705882352936506 ) ( -356 -1015 112.7058823529364 ) ( -372 -1015 112.7058823529364 ) tech04_1 -116 -0.173378 180 1 -1.05556 +( -356 -1015 16.705882352936506 ) ( -356 -1031 16.705882352936506 ) ( -356 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 78 +{ +( -408 -1015 16.705882352936506 ) ( -408 -1015 112.7058823529364 ) ( -408 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -392 -1031 112.7058823529364 ) ( -392 -1031 16.705882352936506 ) ( -408 -1031 16.705882352936506 ) tech04_1 -88 -0.17337 180 1 -1.05556 +( -408 -1031 16.705882352936506 ) ( -392 -1031 16.705882352936506 ) ( -392 -1015 16.705882352936506 ) tech04_1 -16 -15 180 1 -1 +( -392 -1015 112.7058823529364 ) ( -392 -1031 112.7058823529364 ) ( -408 -1031 112.7058823529364 ) tech04_1 -16 -15 180 1 -1 +( -392 -1015 16.705882352936506 ) ( -392 -1015 112.7058823529364 ) ( -408 -1015 112.7058823529364 ) tech04_1 -24 -0.173378 180 1 -1.05556 +( -392 -1015 16.705882352936506 ) ( -392 -1031 16.705882352936506 ) ( -392 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 79 +{ +( -552 -1015 16.705882352936506 ) ( -552 -1015 112.7058823529364 ) ( -552 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -536 -1031 112.7058823529364 ) ( -536 -1031 16.705882352936506 ) ( -552 -1031 16.705882352936506 ) tech04_1 -104 -0.17337 180 1 -1.05556 +( -552 -1031 16.705882352936506 ) ( -536 -1031 16.705882352936506 ) ( -536 -1015 16.705882352936506 ) tech04_1 -32 -15 180 1 -1 +( -536 -1015 112.7058823529364 ) ( -536 -1031 112.7058823529364 ) ( -552 -1031 112.7058823529364 ) tech04_1 -32 -15 180 1 -1 +( -536 -1015 16.705882352936506 ) ( -536 -1015 112.7058823529364 ) ( -552 -1015 112.7058823529364 ) tech04_1 -40 -0.173378 180 1 -1.05556 +( -536 -1015 16.705882352936506 ) ( -536 -1031 16.705882352936506 ) ( -536 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 80 +{ +( -516 -1015 16.705882352936506 ) ( -516 -1015 112.7058823529364 ) ( -516 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -500 -1031 112.7058823529364 ) ( -500 -1031 16.705882352936506 ) ( -516 -1031 16.705882352936506 ) tech04_1 -68 -0.17337 180 1 -1.05556 +( -516 -1031 16.705882352936506 ) ( -500 -1031 16.705882352936506 ) ( -500 -1015 16.705882352936506 ) tech04_1 -124 1 180 1 -1 +( -500 -1015 112.7058823529364 ) ( -500 -1031 112.7058823529364 ) ( -516 -1031 112.7058823529364 ) tech04_1 -124 1 180 1 -1 +( -500 -1015 16.705882352936506 ) ( -500 -1015 112.7058823529364 ) ( -516 -1015 112.7058823529364 ) tech04_1 -4 -0.173378 180 1 -1.05556 +( -500 -1015 16.705882352936506 ) ( -500 -1031 16.705882352936506 ) ( -500 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 81 +{ +( -480 -1015 16.705882352936506 ) ( -480 -1015 112.7058823529364 ) ( -480 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -464 -1031 112.7058823529364 ) ( -464 -1031 16.705882352936506 ) ( -480 -1031 16.705882352936506 ) tech04_1 -32 -0.17337 180 1 -1.05556 +( -480 -1031 16.705882352936506 ) ( -464 -1031 16.705882352936506 ) ( -464 -1015 16.705882352936506 ) tech04_1 -88 1 180 1 -1 +( -464 -1015 112.7058823529364 ) ( -464 -1031 112.7058823529364 ) ( -480 -1031 112.7058823529364 ) tech04_1 -88 1 180 1 -1 +( -464 -1015 16.705882352936506 ) ( -464 -1015 112.7058823529364 ) ( -480 -1015 112.7058823529364 ) tech04_1 -96 -0.173378 180 1 -1.05556 +( -464 -1015 16.705882352936506 ) ( -464 -1031 16.705882352936506 ) ( -464 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 82 +{ +( -444 -1015 16.705882352936506 ) ( -444 -1015 112.7058823529364 ) ( -444 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -428 -1031 112.7058823529364 ) ( -428 -1031 16.705882352936506 ) ( -444 -1031 16.705882352936506 ) tech04_1 -124 -0.17337 180 1 -1.05556 +( -444 -1031 16.705882352936506 ) ( -428 -1031 16.705882352936506 ) ( -428 -1015 16.705882352936506 ) tech04_1 -52 1 180 1 -1 +( -428 -1015 112.7058823529364 ) ( -428 -1031 112.7058823529364 ) ( -444 -1031 112.7058823529364 ) tech04_1 -52 1 180 1 -1 +( -428 -1015 16.705882352936506 ) ( -428 -1015 112.7058823529364 ) ( -444 -1015 112.7058823529364 ) tech04_1 -60 -0.173378 180 1 -1.05556 +( -428 -1015 16.705882352936506 ) ( -428 -1031 16.705882352936506 ) ( -428 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 83 +{ +( -588 -1015 16.705882352936506 ) ( -588 -1015 112.7058823529364 ) ( -588 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -572 -1031 112.7058823529364 ) ( -572 -1031 16.705882352936506 ) ( -588 -1031 16.705882352936506 ) tech04_1 -12 -0.17337 180 1 -1.05556 +( -588 -1031 16.705882352936506 ) ( -572 -1031 16.705882352936506 ) ( -572 -1015 16.705882352936506 ) tech04_1 -68 -15 180 1 -1 +( -572 -1015 112.7058823529364 ) ( -572 -1031 112.7058823529364 ) ( -588 -1031 112.7058823529364 ) tech04_1 -68 -15 180 1 -1 +( -572 -1015 16.705882352936506 ) ( -572 -1015 112.7058823529364 ) ( -588 -1015 112.7058823529364 ) tech04_1 -76 -0.173378 180 1 -1.05556 +( -572 -1015 16.705882352936506 ) ( -572 -1031 16.705882352936506 ) ( -572 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 84 +{ +( -624 -1015 16.705882352936506 ) ( -624 -1015 112.7058823529364 ) ( -624 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +( -608 -1031 112.7058823529364 ) ( -608 -1031 16.705882352936506 ) ( -624 -1031 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -1031 16.705882352936506 ) ( -608 -1031 16.705882352936506 ) ( -608 -1015 16.705882352936506 ) tech04_1 -104 -15 180 1 -1 +( -608 -1015 112.7058823529364 ) ( -608 -1031 112.7058823529364 ) ( -624 -1031 112.7058823529364 ) tech04_1 -104 -15 180 1 -1 +( -608 -1015 16.705882352936506 ) ( -608 -1015 112.7058823529364 ) ( -624 -1015 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -1015 16.705882352936506 ) ( -608 -1031 16.705882352936506 ) ( -608 -1031 112.7058823529364 ) tech04_1 -103 -0.17337 180 1 -1.05556 +} +// brush 85 +{ +( -624.7058823529369 -1019 128 ) ( -624.70588235293781 -1031 128 ) ( -624.70588235293781 -1031 112 ) tech04_1 -36 -7 180 1 -1 +( -624.70588235293781 -1031 112 ) ( -624.70588235293781 -1031 128 ) ( -264.7058823529369 -1031 128 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -624.70588235293781 -1015 112 ) ( -624.70588235293781 -1031 112 ) ( -264.70588235293656 -1031 112 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -264.7058823529369 -1031 128 ) ( -624.70588235293781 -1031 128 ) ( -624.7058823529369 -1019 128 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -264.7058823529369 -1019 128 ) ( -624.7058823529369 -1019 128 ) ( -624.70588235293781 -1015 112 ) tech04_1 -61 -5.89474 180 1 -1.05556 +( -264.70588235293656 -1031 112 ) ( -264.7058823529369 -1031 128 ) ( -264.7058823529369 -1019 128 ) tech04_1 -36 -7 180 1 -1 +} +// brush 86 +{ +( -1300 808 420 ) ( -1300 809.27200454287481 420 ) ( -1300 808 420.526408450703 ) sky4 0 0 0 1 1 +( -1268 -1432 -776 ) ( -1268.4999999999998 -1432 -776 ) ( -1268 -1432 -775.47359154929609 ) sky4 0 0 0 1 1 +( -1268 -1432 -776 ) ( -1268 -1430.7279954571259 -776 ) ( -1268.4999999999998 -1432 -776 ) sky4 0 0 0 1 1 +( -1300 808 420 ) ( -1300.5 808 420 ) ( -1300 809.27200454287481 420 ) sky4 0 0 0 1 1 +( -1300 808 420 ) ( -1300 808 420.526408450703 ) ( -1300.5 808 420 ) sky4 0 0 0 1 1 +( -1268 -1432 -776 ) ( -1268 -1432 -775.47359154929609 ) ( -1268 -1430.7279954571259 -776 ) sky4 0 0 0 1 1 +} +// brush 87 +{ +( 908 808 420 ) ( 908 809.27200454287481 420 ) ( 908 808 420.526408450703 ) sky4 0 0 0 1 1 +( 940 -1432 -776 ) ( 939.50000000000023 -1432 -776 ) ( 940 -1432 -775.47359154929609 ) sky4 0 0 0 1 1 +( 940 -1432 -776 ) ( 940 -1430.7279954571259 -776 ) ( 939.50000000000023 -1432 -776 ) sky4 0 0 0 1 1 +( 908 808 420 ) ( 907.5 808 420 ) ( 908 809.27200454287481 420 ) sky4 0 0 0 1 1 +( 908 808 420 ) ( 908 808 420.526408450703 ) ( 907.5 808 420 ) sky4 0 0 0 1 1 +( 940 -1432 -776 ) ( 940 -1432 -775.47359154929609 ) ( 940 -1430.7279954571259 -776 ) sky4 0 0 0 1 1 +} +// brush 88 +{ +( -624.7058823529369 -1019 20 ) ( -624.70588235293781 -1031 20 ) ( -624.70588235293781 -1031 4 ) tech04_1 -36 -7 180 1 -1 +( -624.70588235293781 -1031 4 ) ( -624.70588235293781 -1031 20 ) ( -264.7058823529369 -1031 20 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -624.70588235293781 -1015 4 ) ( -624.70588235293781 -1031 4 ) ( -264.70588235293656 -1031 4 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -264.7058823529369 -1031 20 ) ( -624.70588235293781 -1031 20 ) ( -624.7058823529369 -1019 20 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -264.7058823529369 -1019 20 ) ( -624.7058823529369 -1019 20 ) ( -624.70588235293781 -1015 4 ) tech04_1 -61 -5.89474 180 1 -1.05556 +( -264.70588235293656 -1031 4 ) ( -264.7058823529369 -1031 20 ) ( -264.7058823529369 -1019 20 ) tech04_1 -36 -7 180 1 -1 +} +// brush 89 +{ +( -624.7058823529369 -1019 24 ) ( -624.70588235293781 -1031 24 ) ( -624.70588235293781 -1031 8 ) tech04_1 -36 -7 180 1 -1 +( -624.70588235293781 -1031 8 ) ( -624.70588235293781 -1031 24 ) ( -264.7058823529369 -1031 24 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -624.70588235293781 -1015 8 ) ( -624.70588235293781 -1031 8 ) ( -264.70588235293656 -1031 8 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -264.7058823529369 -1031 24 ) ( -624.70588235293781 -1031 24 ) ( -624.7058823529369 -1019 24 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -264.7058823529369 -1019 24 ) ( -624.7058823529369 -1019 24 ) ( -624.70588235293781 -1015 8 ) tech04_1 -61 -5.89474 180 1 -1.05556 +( -264.70588235293656 -1031 8 ) ( -264.7058823529369 -1031 24 ) ( -264.7058823529369 -1019 24 ) tech04_1 -36 -7 180 1 -1 +} +// brush 90 +{ +( -1300 -1464 -776 ) ( -1300 -1463.5 -776 ) ( -1300 -1464 -775.47359154929609 ) sky4 0 0 0 1 1 +( -1300 -1464 -776 ) ( -1300 -1464 -775.47359154929609 ) ( -1298.7257240204422 -1464 -776 ) sky4 0 0 0 1 1 +( -1300 -1464 -776 ) ( -1298.7257240204422 -1464 -776 ) ( -1300 -1463.5 -776 ) sky4 0 0 0 1 1 +( 944 -1432 420 ) ( 944 -1431.5000000000002 420 ) ( 945.27427597955841 -1432 420 ) sky4 0 0 0 1 1 +( 944 -1432 420 ) ( 945.27427597955841 -1432 420 ) ( 944 -1432 420.526408450703 ) sky4 0 0 0 1 1 +( 944 -1432 420 ) ( 944 -1432 420.526408450703 ) ( 944 -1431.5000000000002 420 ) sky4 0 0 0 1 1 +} +// brush 91 +{ +( -1304 808 -776 ) ( -1304 808.5 -776 ) ( -1304 808 -775.47359154929609 ) sky4 0 0 0 1 1 +( -1304 808 -776 ) ( -1304 808 -775.47359154929609 ) ( -1302.7257240204422 808 -776 ) sky4 0 0 0 1 1 +( -1304 808 -776 ) ( -1302.7257240204422 808 -776 ) ( -1304 808.5 -776 ) sky4 0 0 0 1 1 +( 940 840 420 ) ( 940 840.49999999999977 420 ) ( 941.2742759795583 840 420 ) sky4 0 0 0 1 1 +( 940 840 420 ) ( 941.2742759795583 840 420 ) ( 940 840 420.526408450703 ) sky4 0 0 0 1 1 +( 940 840 420 ) ( 940 840 420.526408450703 ) ( 940 840.49999999999977 420 ) sky4 0 0 0 1 1 +} +// brush 92 +{ +( -810 -1052 12 ) ( -810 -1052 14.145485184664981 ) ( -775.10952380952381 -1263 14.145485184664981 ) wgrass1_1 0 0 0 1 1 +( -775.10952380952381 -1263 14.145485184664981 ) ( -810 -1052 14.145485184664981 ) ( -750.48095238095243 -1172 44.796697063393793 ) wgrass1_1 0 0 0 1 1 +( -810 -1052 14.145485184664981 ) ( -617.07619047619062 -1108 56.716132433064615 ) ( -750.48095238095243 -1172 44.796697063393793 ) wgrass1_1 0 0 0 1 1 +( -750.48095238095243 -1172 44.796697063393793 ) ( -432.3619047619049 -1224 62.570798087534158 ) ( -775.10952380952381 -1263 14.145485184664981 ) wgrass1_1 0 0 0 1 1 +( -750.48095238095243 -1172 44.796697063393793 ) ( -617.07619047619062 -1108 56.716132433064615 ) ( -432.3619047619049 -1224 62.570798087534158 ) wgrass1_1 0 0 0 1 1 +( -775.10952380952381 -1263 14.145485184664981 ) ( -379 -1276 14.145485184664981 ) ( -379 -1276 12 ) wgrass1_1 0 0 0 1 1 +( -432.3619047619049 -1224 62.570798087534158 ) ( -379 -1276 14.145485184664981 ) ( -775.10952380952381 -1263 14.145485184664981 ) wgrass1_1 0 0 0 1 1 +( -775.10952380952381 -1263 12 ) ( -379 -1276 12 ) ( -409.78571428571428 -1072 12 ) wgrass1_1 0 0 0 1 1 +( -409.78571428571428 -1072 12 ) ( -617.07619047619062 -1108 56.716132433064615 ) ( -810 -1052 14.145485184664981 ) wgrass1_1 0 -35.6505 0 1 1 +( -409.78571428571428 -1072 12 ) ( -810 -1052 14.145485184664981 ) ( -810 -1052 12 ) wgrass1_1 0 0 0 1 1 +( -432.3619047619049 -1224 62.570798087534158 ) ( -617.07619047619062 -1108 56.716132433064615 ) ( -409.78571428571428 -1072 12 ) wgrass1_1 0 -35.6505 0 1 1 +( -409.78571428571428 -1072 12 ) ( -379 -1276 14.145485184664981 ) ( -432.3619047619049 -1224 62.570798087534158 ) wgrass1_1 8.99512 48.8306 0 1 1 +( -379 -1276 12 ) ( -379 -1276 14.145485184664981 ) ( -409.78571428571428 -1072 12 ) wgrass1_1 0 0 0 1 1 +} +// brush 93 +{ +( -397.62771152992173 -1108.2732443918221 11.063083057428312 ) ( -397.62771152992173 -1108.2732443918221 13.378269750932414 ) ( -315.09190981967635 -1283.8021605865042 11.063083057428312 ) wgrass1_1 0 0 0 1 1 +( -315.09190981967635 -1283.8021605865042 11.063083057428312 ) ( -397.62771152992173 -1108.2732443918221 13.378269750932414 ) ( -332.62547923508635 -1142.0801849514646 65.633881144960043 ) wgrass1_1 8.99512 48.8306 0 1 1 +( -11.65064485688737 -1024.7575682311349 13.378269750932414 ) ( -397.62771152992173 -1108.2732443918221 13.378269750932414 ) ( -397.62771152992173 -1108.2732443918221 11.063083057428312 ) wgrass1_1 0 0 0 1 1 +( -332.62547923508635 -1142.0801849514646 65.633881144960043 ) ( -397.62771152992173 -1108.2732443918221 13.378269750932414 ) ( -11.65064485688737 -1024.7575682311349 13.378269750932414 ) wgrass1_1 0 0 0 1 1 +( -332.62547923508635 -1142.0801849514646 65.633881144960043 ) ( -124.18217094721786 -1201.7157365768614 59.316128817874954 ) ( -315.09190981967635 -1283.8021605865042 11.063083057428312 ) wgrass1_1 0 -35.6505 0 1 1 +( -11.65064485688737 -1024.7575682311349 11.063083057428312 ) ( -397.62771152992173 -1108.2732443918221 11.063083057428312 ) ( -315.09190981967635 -1283.8021605865042 11.063083057428312 ) wgrass1_1 0 0 0 1 1 +( -11.887484960020332 -1112.2742780163246 46.453901495502016 ) ( -332.62547923508635 -1142.0801849514646 65.633881144960043 ) ( -11.65064485688737 -1024.7575682311349 13.378269750932414 ) wgrass1_1 0 0 0 1 1 +( -11.887484960020332 -1112.2742780163246 46.453901495502016 ) ( -124.18217094721786 -1201.7157365768614 59.316128817874954 ) ( -332.62547923508635 -1142.0801849514646 65.633881144960043 ) wgrass1_1 0 0 0 1 1 +( -315.09190981967635 -1283.8021605865042 11.063083057428312 ) ( -124.18217094721786 -1201.7157365768614 59.316128817874954 ) ( 76.661785703653024 -1205.5771030051208 13.378269750932414 ) wgrass1_1 0 -35.6505 0 1 1 +( -315.09190981967635 -1283.8021605865042 11.063083057428312 ) ( 76.661785703653024 -1205.5771030051208 13.378269750932414 ) ( 76.661785703653024 -1205.5771030051208 11.063083057428312 ) wgrass1_1 0 0 0 1 1 +( 76.661785703653024 -1205.5771030051208 13.378269750932414 ) ( -124.18217094721786 -1201.7157365768614 59.316128817874954 ) ( -11.887484960020332 -1112.2742780163246 46.453901495502016 ) wgrass1_1 0 0 0 1 1 +( -11.65064485688737 -1024.7575682311349 13.378269750932414 ) ( 76.661785703653024 -1205.5771030051208 13.378269750932414 ) ( -11.887484960020332 -1112.2742780163246 46.453901495502016 ) wgrass1_1 0 0 0 1 1 +( 76.661785703653024 -1205.5771030051208 11.063083057428312 ) ( 76.661785703653024 -1205.5771030051208 13.378269750932414 ) ( -11.65064485688737 -1024.7575682311349 13.378269750932414 ) wgrass1_1 0 0 0 1 1 +} +// brush 94 +{ +( -1378 -1457 -776 ) ( -1378 -1456.5 -776 ) ( -1378 -1457 -775.47359154929609 ) sky4 0 0 0 1 1 +( -1378 -1457 -776 ) ( -1378 -1457 -775.47359154929609 ) ( -1376.7257240204422 -1457 -776 ) sky4 0 0 0 1 1 +( -1378 -1457 -776 ) ( -1376.7257240204422 -1457 -776 ) ( -1378 -1456.5 -776 ) sky4 0 0 0 1 1 +( 866 -1425 420 ) ( 866 -1424.5000000000002 420 ) ( 867.27427597955841 -1425 420 ) sky4 0 0 0 1 1 +( 866 -1425 420 ) ( 867.27427597955841 -1425 420 ) ( 866 -1425 420.526408450703 ) sky4 0 0 0 1 1 +( 866 -1425 420 ) ( 866 -1425 420.526408450703 ) ( 866 -1424.5000000000002 420 ) sky4 0 0 0 1 1 +} +// brush 95 +{ +( -625 -655 7.078755282366501 ) ( -625 -655 23.078755282366501 ) ( -625 -1015 23.078755282366501 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -625 -1015 7.078755282366501 ) ( -625 -1015 23.078755282366501 ) ( -613 -1015 23.078755282366501 ) tech04_1 -36 -7 180 1 -1 +( -609 -655 7.078755282366501 ) ( -625 -655 7.078755282366501 ) ( -625 -1015 7.078755282366501 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -625 -1015 23.078755282366501 ) ( -625 -655 23.078755282366501 ) ( -613 -655 23.078755282366501 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -613 -655 23.078755282366501 ) ( -625 -655 23.078755282366501 ) ( -625 -655 7.078755282366501 ) tech04_1 -36 -7 180 1 -1 +( -613 -1015 23.078755282366501 ) ( -613 -655 23.078755282366501 ) ( -609 -655 7.078755282366501 ) tech04_1 -61 -5.89474 180 1 -1.05556 +} +// brush 96 +{ +( -625 -655 127.07875528236764 ) ( -625 -1019 127.07875528236764 ) ( -625 -1015 111.07875528236036 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -625 -1015 111.07875528236036 ) ( -625 -1019 127.07875528236764 ) ( -613 -1019 127.07875528236764 ) tech04_1 -36 -7 180 1 -1 +( -613 -1019 127.07875528236764 ) ( -625 -1019 127.07875528236764 ) ( -625 -655 127.07875528236764 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -625 -655 127.07875528236764 ) ( -625 -655 111.07875528236052 ) ( -609 -655 111.07875528236053 ) tech04_1 -36 -7 180 1 -1 +( -609 -655 111.07875528236053 ) ( -625 -655 111.07875528236052 ) ( -625 -1015 111.07875528236036 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -613 -655 127.07875528236764 ) ( -609 -655 111.07875528236053 ) ( -609 -1015 111.07875528236038 ) tech04_1 -61 -5.89474 180 1 -1.05556 +} +// brush 97 +{ +( -625 -295 7.078755282366501 ) ( -625 -295 23.078755282366501 ) ( -625 -655 23.078755282366501 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -625 -655 7.078755282366501 ) ( -625 -655 23.078755282366501 ) ( -613 -655 23.078755282366501 ) tech04_1 -36 -7 180 1 -1 +( -609 -295 7.078755282366501 ) ( -625 -295 7.078755282366501 ) ( -625 -655 7.078755282366501 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -625 -655 23.078755282366501 ) ( -625 -295 23.078755282366501 ) ( -613 -295 23.078755282366501 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -613 -295 23.078755282366501 ) ( -625 -295 23.078755282366501 ) ( -625 -295 7.078755282366501 ) tech04_1 -36 -7 180 1 -1 +( -613 -655 23.078755282366501 ) ( -613 -295 23.078755282366501 ) ( -609 -295 7.078755282366501 ) tech04_1 -61 -5.89474 180 1 -1.05556 +} +// brush 98 +{ +( -625 -295 111.0787552823665 ) ( -625 -295 127.0787552823665 ) ( -625 -655 127.0787552823665 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -625 -655 111.0787552823665 ) ( -625 -655 127.0787552823665 ) ( -613 -655 127.0787552823665 ) tech04_1 -36 -7 180 1 -1 +( -609 -295 111.0787552823665 ) ( -625 -295 111.0787552823665 ) ( -625 -655 111.0787552823665 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -625 -655 127.0787552823665 ) ( -625 -295 127.0787552823665 ) ( -613 -295 127.0787552823665 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -613 -295 127.0787552823665 ) ( -625 -295 127.0787552823665 ) ( -625 -295 111.0787552823665 ) tech04_1 -36 -7 180 1 -1 +( -613 -655 127.0787552823665 ) ( -613 -295 127.0787552823665 ) ( -609 -295 111.0787552823665 ) tech04_1 -61 -5.89474 180 1 -1.05556 +} +// brush 99 +{ +( -625 128 7.078755282366501 ) ( -625 128 23.078755282366501 ) ( -625 -295 23.078755282366501 ) tech04_1 0 -7.75232 180 1 -1.05556 +( -625 -295 7.078755282366501 ) ( -625 -295 23.078755282366501 ) ( -613 -295 23.078755282366501 ) tech04_1 -36 -7 180 1 -1 +( -609 128 7.078755282366501 ) ( -625 128 7.078755282366501 ) ( -625 -295 7.078755282366501 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -625 -295 23.078755282366501 ) ( -625 128 23.078755282366501 ) ( -613 128 23.078755282366501 ) tech04_1 -123 -0.173401 180 1 -1.05556 +( -613 128 23.078755282366501 ) ( -625 128 23.078755282366501 ) ( -625 128 7.078755282366501 ) tech04_1 -36 -7 180 1 -1 +( -613 -295 23.078755282366501 ) ( -613 128 23.078755282366501 ) ( -609 128 7.078755282366501 ) tech04_1 -61 -5.89474 180 1 -1.05556 +} +// brush 100 +{ +( -625 136 111.0787552823665 ) ( -625 136 127.0787552823665 ) ( -625 -295 127.0787552823665 ) tech04_1 5.47564 -7.75232 180 1.01891 -1.05556 +( -625 -295 111.0787552823665 ) ( -625 -295 127.0787552823665 ) ( -613 -295 127.0787552823665 ) tech04_1 -36 -7 180 1 -1 +( -609 136 111.0787552823665 ) ( -625 136 111.0787552823665 ) ( -625 -295 111.0787552823665 ) tech04_1 -123 5.01405 180 1 -1.07552 +( -625 -295 127.0787552823665 ) ( -625 136 127.0787552823665 ) ( -613 136 127.0787552823665 ) tech04_1 -123 5.01405 180 1 -1.07552 +( -613 136 127.0787552823665 ) ( -625 136 127.0787552823665 ) ( -625 136 111.0787552823665 ) tech04_1 -36 -7 180 1 -1 +( -613 -295 127.0787552823665 ) ( -613 136 127.0787552823665 ) ( -609 136 111.0787552823665 ) tech04_1 -55.5244 -5.89474 180 1.01891 -1.05556 +} +// brush 101 +{ +( -328 -896 16 ) ( -328 -895 16 ) ( -328 -896 24 ) crate1_side 0 16 0 1 1 +( -328 -896 16 ) ( -328 -896 24 ) ( -327 -896 16 ) crate1_side 8 16 0 1 1 +( -328 -896 16 ) ( -327 -896 16 ) ( -328 -895 16 ) crate0_top 8 0 0 1 1 +( -264 -832 80 ) ( -264 -831 80 ) ( -263 -832 80 ) crate0_top 8 0 0 1 1 +( -264 -832 80 ) ( -263 -832 80 ) ( -264 -832 88 ) crate1_side 8 16 0 1 1 +( -264 -832 80 ) ( -264 -832 88 ) ( -264 -831 80 ) crate1_side 0 16 0 1 1 +} +// brush 102 +{ +( -353.71281292110211 -797.71281292110189 16 ) ( -353.21281292110211 -796.84678751731735 16 ) ( -353.71281292110211 -797.71281292110189 24 ) crate1_side 25.1194 16 0 0.866025 1 +( -353.71281292110211 -797.71281292110189 16 ) ( -353.71281292110211 -797.71281292110189 24 ) ( -352.84678751731781 -798.21281292110189 16 ) crate1_side 24.4324 16 0 0.866025 1 +( -353.71281292110211 -797.71281292110189 16 ) ( -352.84678751731781 -798.21281292110189 16 ) ( -353.21281292110211 -796.84678751731735 16 ) crate0_top -28.5321 -35.696 330 1 1 +( -266.287187078898 -774.28718707889811 80 ) ( -265.787187078898 -773.42116167511358 80 ) ( -265.42116167511358 -774.78718707889811 80 ) crate0_top -28.5321 -35.696 330 1 1 +( -266.287187078898 -774.28718707889811 80 ) ( -265.42116167511358 -774.78718707889811 80 ) ( -266.287187078898 -774.28718707889811 88 ) crate1_side -12.518 16 0 0.866025 1 +( -266.287187078898 -774.28718707889811 80 ) ( -266.287187078898 -774.28718707889811 88 ) ( -265.787187078898 -773.42116167511358 80 ) crate1_side 62.0698 16 0 0.866025 1 +} +// brush 103 +{ +( -326.62741699796948 -863.19183588453086 80 ) ( -326.88623604307202 -862.22591005824177 80 ) ( -326.62741699796948 -863.19183588453086 88 ) crate1_side -2.35803 16 0 0.965926 1 +( -281.37258300203047 -784.80816411546903 144 ) ( -280.40665717574143 -784.5493450703666 144 ) ( -281.37258300203047 -784.80816411546903 152 ) crate1_side 35.2983 16 0 0.965926 1 +( -326.62741699796948 -863.19183588453086 80 ) ( -325.66149117168038 -862.93301683942832 80 ) ( -326.88623604307202 -862.22591005824177 80 ) crate0_top 26.9084 18.7581 15 1 1 +( -281.37258300203047 -784.80816411546903 144 ) ( -281.63140204713295 -783.84223828918005 144 ) ( -280.40665717574143 -784.5493450703666 144 ) crate0_top 26.9084 18.7581 15 1 1 +( -326.62741699796948 -863.19183588453086 80 ) ( -326.62741699796948 -863.19183588453086 88 ) ( -325.66149117168038 -862.93301683942832 80 ) crate1_side 18.1496 16 0 0.965926 1 +( -281.37258300203047 -784.80816411546903 144 ) ( -281.37258300203047 -784.80816411546903 152 ) ( -281.63140204713295 -783.84223828918005 144 ) crate1_side -19.5068 16 0 0.965926 1 +} +// brush 104 +{ +( -542 -56 97 ) ( -542 -56 129 ) ( -542 -64 129 ) tech04_2 -9.5 0 0 0.984615 0.25 +( -510 -64 129 ) ( -510 -64 97 ) ( -542 -64 97 ) basebutn3 -25.5313 -0.585608 0 0.984615 1.01244 +( -542 -64 97 ) ( -510 -64 97 ) ( -510 -56 97 ) tech04_2 89.7813 0 0 0.984615 0.25 +( -510 -56 129 ) ( -510 -64 129 ) ( -542 -64 129 ) tech04_2 89.7813 0 0 0.984615 0.25 +( -510 -56 97 ) ( -510 -56 129 ) ( -542 -56 129 ) tech04_2 89.7813 0 0 0.984615 0.25 +( -510 -56 97 ) ( -510 -64 97 ) ( -510 -64 129 ) tech04_2 -9.5 0 0 0.984615 0.25 +} +// brush 105 +{ +( -530 -60.564306142486274 121.07875528236652 ) ( -530 -60.564306142486274 8 ) ( -530 -48 8 ) tech04_2 -73.6109 -11.6249 0 1.54638 0.392635 +( -522 -60.564306142486274 8 ) ( -530 -60.564306142486274 8 ) ( -530 -60.564306142486274 121.07875528236652 ) tech04_2 10.5313 -2.49921 0 0.984615 0.0981587 +( -530 -48 8 ) ( -530 -60.564306142486274 8 ) ( -522 -60.564306142486274 8 ) tech04_2 18.6563 -2.49739 0 0.984615 0.0981587 +( -530 -48 121.07875528236652 ) ( -522 -48 121.07875528236652 ) ( -522 -60.564306142486274 121.07875528236652 ) tech04_2 18.6563 -2.49739 0 0.984615 0.0981587 +( -530 -48 8 ) ( -522 -48 8 ) ( -522 -48 121.07875528236652 ) tech04_2 51.1563 -2.49921 0 0.984615 0.0981587 +( -522 -48 8 ) ( -522 -60.564306142486274 8 ) ( -522 -60.564306142486274 121.07875528236652 ) tech04_2 -73.6109 -11.6249 0 1.54638 0.392635 +} +// brush 106 +{ +( -395 -200 65 ) ( -395 -200 97 ) ( -395 -208 97 ) tech04_2 57.5 0 0 0.984615 0.25 +( -363 -208 97 ) ( -363 -208 65 ) ( -395 -208 65 ) basebutn3 17.1719 -0.192279 0 0.984615 1.01244 +( -395 -208 65 ) ( -363 -208 65 ) ( -363 -200 65 ) tech04_2 -83.8906 0 0 0.984615 0.25 +( -363 -200 97 ) ( -363 -208 97 ) ( -395 -208 97 ) tech04_2 -83.8906 0 0 0.984615 0.25 +( -363 -200 65 ) ( -363 -200 97 ) ( -395 -200 97 ) tech04_2 -83.8906 0 0 0.984615 0.25 +( -363 -200 65 ) ( -363 -208 65 ) ( -363 -208 97 ) tech04_2 57.5 0 0 0.984615 0.25 +} +// brush 107 +{ +( -383 -200 89.078755282366501 ) ( -383 -200 17.078755282366501 ) ( -383 -192 17.078755282366501 ) tech04_2 -9.5625 4.31503 0 0.984615 0.25 +( -375 -200 17.078755282366501 ) ( -383 -200 17.078755282366501 ) ( -383 -200 89.078755282366501 ) tech04_2 -35.1406 13.2604 0 0.984615 0.0625 +( -383 -192 17.078755282366501 ) ( -383 -200 17.078755282366501 ) ( -375 -200 17.078755282366501 ) tech04_2 -27.0156 12.0015 0 0.984615 0.0625 +( -383 -192 89.078755282366501 ) ( -375 -192 89.078755282366501 ) ( -375 -200 89.078755282366501 ) tech04_2 -27.0156 12.0015 0 0.984615 0.0625 +( -383 -192 17.078755282366501 ) ( -375 -192 17.078755282366501 ) ( -375 -192 89.078755282366501 ) tech04_2 5.48438 13.2604 0 0.984615 0.0625 +( -375 -192 17.078755282366501 ) ( -375 -200 17.078755282366501 ) ( -375 -200 89.078755282366501 ) tech04_2 -9.5625 4.31503 0 0.984615 0.25 +} +// brush 108 +{ +( -624 -979 16.705882352936506 ) ( -624 -979 112.7058823529364 ) ( -624 -995 112.7058823529364 ) tech04_1 -67 -0.17337 180 1 -1.05556 +( -608 -995 112.7058823529364 ) ( -608 -995 16.705882352936506 ) ( -624 -995 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -995 16.705882352936506 ) ( -608 -995 16.705882352936506 ) ( -608 -979 16.705882352936506 ) tech04_1 -104 5 180 1 -1 +( -608 -979 112.7058823529364 ) ( -608 -995 112.7058823529364 ) ( -624 -995 112.7058823529364 ) tech04_1 -104 5 180 1 -1 +( -608 -979 16.705882352936506 ) ( -608 -979 112.7058823529364 ) ( -624 -979 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -979 16.705882352936506 ) ( -608 -995 16.705882352936506 ) ( -608 -995 112.7058823529364 ) tech04_1 -67 -0.17337 180 1 -1.05556 +} +// brush 109 +{ +( -624 -943 16.705882352936506 ) ( -624 -943 112.7058823529364 ) ( -624 -959 112.7058823529364 ) tech04_1 -31 -0.17337 180 1 -1.05556 +( -608 -959 112.7058823529364 ) ( -608 -959 16.705882352936506 ) ( -624 -959 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -959 16.705882352936506 ) ( -608 -959 16.705882352936506 ) ( -608 -943 16.705882352936506 ) tech04_1 -104 9 180 1 -1 +( -608 -943 112.7058823529364 ) ( -608 -959 112.7058823529364 ) ( -624 -959 112.7058823529364 ) tech04_1 -104 9 180 1 -1 +( -608 -943 16.705882352936506 ) ( -608 -943 112.7058823529364 ) ( -624 -943 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -943 16.705882352936506 ) ( -608 -959 16.705882352936506 ) ( -608 -959 112.7058823529364 ) tech04_1 -31 -0.17337 180 1 -1.05556 +} +// brush 110 +{ +( -624 -907 16.705882352936506 ) ( -624 -907 112.7058823529364 ) ( -624 -923 112.7058823529364 ) tech04_1 5 -0.17337 180 1 -1.05556 +( -608 -923 112.7058823529364 ) ( -608 -923 16.705882352936506 ) ( -624 -923 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -923 16.705882352936506 ) ( -608 -923 16.705882352936506 ) ( -608 -907 16.705882352936506 ) tech04_1 -104 13 180 1 -1 +( -608 -907 112.7058823529364 ) ( -608 -923 112.7058823529364 ) ( -624 -923 112.7058823529364 ) tech04_1 -104 13 180 1 -1 +( -608 -907 16.705882352936506 ) ( -608 -907 112.7058823529364 ) ( -624 -907 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -907 16.705882352936506 ) ( -608 -923 16.705882352936506 ) ( -608 -923 112.7058823529364 ) tech04_1 5 -0.17337 180 1 -1.05556 +} +// brush 111 +{ +( -624 -871 16.705882352936506 ) ( -624 -871 112.7058823529364 ) ( -624 -887 112.7058823529364 ) tech04_1 41 -0.17337 180 1 -1.05556 +( -608 -887 112.7058823529364 ) ( -608 -887 16.705882352936506 ) ( -624 -887 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -887 16.705882352936506 ) ( -608 -887 16.705882352936506 ) ( -608 -871 16.705882352936506 ) tech04_1 -104 1 180 1 -1 +( -608 -871 112.7058823529364 ) ( -608 -887 112.7058823529364 ) ( -624 -887 112.7058823529364 ) tech04_1 -104 1 180 1 -1 +( -608 -871 16.705882352936506 ) ( -608 -871 112.7058823529364 ) ( -624 -871 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -871 16.705882352936506 ) ( -608 -887 16.705882352936506 ) ( -608 -887 112.7058823529364 ) tech04_1 41 -0.17337 180 1 -1.05556 +} +// brush 112 +{ +( -624 -727 16.705882352936506 ) ( -624 -727 112.7058823529364 ) ( -624 -743 112.7058823529364 ) tech04_1 57 -0.17337 180 1 -1.05556 +( -608 -743 112.7058823529364 ) ( -608 -743 16.705882352936506 ) ( -624 -743 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -743 16.705882352936506 ) ( -608 -743 16.705882352936506 ) ( -608 -727 16.705882352936506 ) tech04_1 -104 1 180 1 -1 +( -608 -727 112.7058823529364 ) ( -608 -743 112.7058823529364 ) ( -624 -743 112.7058823529364 ) tech04_1 -104 1 180 1 -1 +( -608 -727 16.705882352936506 ) ( -608 -727 112.7058823529364 ) ( -624 -727 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -727 16.705882352936506 ) ( -608 -743 16.705882352936506 ) ( -608 -743 112.7058823529364 ) tech04_1 57 -0.17337 180 1 -1.05556 +} +// brush 113 +{ +( -624 -835 16.705882352936506 ) ( -624 -835 112.7058823529364 ) ( -624 -851 112.7058823529364 ) tech04_1 77 -0.17337 180 1 -1.05556 +( -608 -851 112.7058823529364 ) ( -608 -851 16.705882352936506 ) ( -624 -851 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -851 16.705882352936506 ) ( -608 -851 16.705882352936506 ) ( -608 -835 16.705882352936506 ) tech04_1 -104 5 180 1 -1 +( -608 -835 112.7058823529364 ) ( -608 -851 112.7058823529364 ) ( -624 -851 112.7058823529364 ) tech04_1 -104 5 180 1 -1 +( -608 -835 16.705882352936506 ) ( -608 -835 112.7058823529364 ) ( -624 -835 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -835 16.705882352936506 ) ( -608 -851 16.705882352936506 ) ( -608 -851 112.7058823529364 ) tech04_1 77 -0.17337 180 1 -1.05556 +} +// brush 114 +{ +( -624 -799 16.705882352936506 ) ( -624 -799 112.7058823529364 ) ( -624 -815 112.7058823529364 ) tech04_1 113 -0.17337 180 1 -1.05556 +( -608 -815 112.7058823529364 ) ( -608 -815 16.705882352936506 ) ( -624 -815 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -815 16.705882352936506 ) ( -608 -815 16.705882352936506 ) ( -608 -799 16.705882352936506 ) tech04_1 -104 9 180 1 -1 +( -608 -799 112.7058823529364 ) ( -608 -815 112.7058823529364 ) ( -624 -815 112.7058823529364 ) tech04_1 -104 9 180 1 -1 +( -608 -799 16.705882352936506 ) ( -608 -799 112.7058823529364 ) ( -624 -799 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -799 16.705882352936506 ) ( -608 -815 16.705882352936506 ) ( -608 -815 112.7058823529364 ) tech04_1 113 -0.17337 180 1 -1.05556 +} +// brush 115 +{ +( -624 -763 16.705882352936506 ) ( -624 -763 112.7058823529364 ) ( -624 -779 112.7058823529364 ) tech04_1 21 -0.17337 180 1 -1.05556 +( -608 -779 112.7058823529364 ) ( -608 -779 16.705882352936506 ) ( -624 -779 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -779 16.705882352936506 ) ( -608 -779 16.705882352936506 ) ( -608 -763 16.705882352936506 ) tech04_1 -104 13 180 1 -1 +( -608 -763 112.7058823529364 ) ( -608 -779 112.7058823529364 ) ( -624 -779 112.7058823529364 ) tech04_1 -104 13 180 1 -1 +( -608 -763 16.705882352936506 ) ( -608 -763 112.7058823529364 ) ( -624 -763 112.7058823529364 ) tech04_1 -112 -0.173378 180 1 -1.05556 +( -608 -763 16.705882352936506 ) ( -608 -779 16.705882352936506 ) ( -608 -779 112.7058823529364 ) tech04_1 21 -0.17337 180 1 -1.05556 +} +// brush 116 +{ +( -624 -439 16.705882352936506 ) ( -624 -439 112.7058823529364 ) ( -624 -455 112.7058823529364 ) tech04_1 89 -0.17337 180 1 -1.05556 +( -608 -455 112.7058823529364 ) ( -608 -455 16.705882352936506 ) ( -624 -455 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -455 16.705882352936506 ) ( -608 -455 16.705882352936506 ) ( -608 -439 16.705882352936506 ) tech04_1 -104 -15 180 1 -1 +( -608 -439 112.7058823529364 ) ( -608 -455 112.7058823529364 ) ( -624 -455 112.7058823529364 ) tech04_1 -104 -15 180 1 -1 +( -608 -439 16.705882352936506 ) ( -608 -439 112.7058823529364 ) ( -624 -439 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -439 16.705882352936506 ) ( -608 -455 16.705882352936506 ) ( -608 -455 112.7058823529364 ) tech04_1 89 -0.17337 180 1 -1.05556 +} +// brush 117 +{ +( -624 -547 16.705882352936506 ) ( -624 -547 112.7058823529364 ) ( -624 -563 112.7058823529364 ) tech04_1 -19 -0.17337 180 1 -1.05556 +( -608 -563 112.7058823529364 ) ( -608 -563 16.705882352936506 ) ( -624 -563 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -563 16.705882352936506 ) ( -608 -563 16.705882352936506 ) ( -608 -547 16.705882352936506 ) tech04_1 -104 -11 180 1 -1 +( -608 -547 112.7058823529364 ) ( -608 -563 112.7058823529364 ) ( -624 -563 112.7058823529364 ) tech04_1 -104 -11 180 1 -1 +( -608 -547 16.705882352936506 ) ( -608 -547 112.7058823529364 ) ( -624 -547 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -547 16.705882352936506 ) ( -608 -563 16.705882352936506 ) ( -608 -563 112.7058823529364 ) tech04_1 -19 -0.17337 180 1 -1.05556 +} +// brush 118 +{ +( -624 -511 16.705882352936506 ) ( -624 -511 112.7058823529364 ) ( -624 -527 112.7058823529364 ) tech04_1 17 -0.17337 180 1 -1.05556 +( -608 -527 112.7058823529364 ) ( -608 -527 16.705882352936506 ) ( -624 -527 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -527 16.705882352936506 ) ( -608 -527 16.705882352936506 ) ( -608 -511 16.705882352936506 ) tech04_1 -104 -7 180 1 -1 +( -608 -511 112.7058823529364 ) ( -608 -527 112.7058823529364 ) ( -624 -527 112.7058823529364 ) tech04_1 -104 -7 180 1 -1 +( -608 -511 16.705882352936506 ) ( -608 -511 112.7058823529364 ) ( -624 -511 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -511 16.705882352936506 ) ( -608 -527 16.705882352936506 ) ( -608 -527 112.7058823529364 ) tech04_1 17 -0.17337 180 1 -1.05556 +} +// brush 119 +{ +( -624 -475 16.705882352936506 ) ( -624 -475 112.7058823529364 ) ( -624 -491 112.7058823529364 ) tech04_1 53 -0.17337 180 1 -1.05556 +( -608 -491 112.7058823529364 ) ( -608 -491 16.705882352936506 ) ( -624 -491 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -491 16.705882352936506 ) ( -608 -491 16.705882352936506 ) ( -608 -475 16.705882352936506 ) tech04_1 -104 -3 180 1 -1 +( -608 -475 112.7058823529364 ) ( -608 -491 112.7058823529364 ) ( -624 -491 112.7058823529364 ) tech04_1 -104 -3 180 1 -1 +( -608 -475 16.705882352936506 ) ( -608 -475 112.7058823529364 ) ( -624 -475 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -475 16.705882352936506 ) ( -608 -491 16.705882352936506 ) ( -608 -491 112.7058823529364 ) tech04_1 53 -0.17337 180 1 -1.05556 +} +// brush 120 +{ +( -624 -583 16.705882352936506 ) ( -624 -583 112.7058823529364 ) ( -624 -599 112.7058823529364 ) tech04_1 73 -0.17337 180 1 -1.05556 +( -608 -599 112.7058823529364 ) ( -608 -599 16.705882352936506 ) ( -624 -599 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -599 16.705882352936506 ) ( -608 -599 16.705882352936506 ) ( -608 -583 16.705882352936506 ) tech04_1 -104 -15 180 1 -1 +( -608 -583 112.7058823529364 ) ( -608 -599 112.7058823529364 ) ( -624 -599 112.7058823529364 ) tech04_1 -104 -15 180 1 -1 +( -608 -583 16.705882352936506 ) ( -608 -583 112.7058823529364 ) ( -624 -583 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -583 16.705882352936506 ) ( -608 -599 16.705882352936506 ) ( -608 -599 112.7058823529364 ) tech04_1 73 -0.17337 180 1 -1.05556 +} +// brush 121 +{ +( -624 -619 16.705882352936506 ) ( -624 -619 112.7058823529364 ) ( -624 -635 112.7058823529364 ) tech04_1 37 -0.17337 180 1 -1.05556 +( -608 -635 112.7058823529364 ) ( -608 -635 16.705882352936506 ) ( -624 -635 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -635 16.705882352936506 ) ( -608 -635 16.705882352936506 ) ( -608 -619 16.705882352936506 ) tech04_1 -104 -3 180 1 -1 +( -608 -619 112.7058823529364 ) ( -608 -635 112.7058823529364 ) ( -624 -635 112.7058823529364 ) tech04_1 -104 -3 180 1 -1 +( -608 -619 16.705882352936506 ) ( -608 -619 112.7058823529364 ) ( -624 -619 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -619 16.705882352936506 ) ( -608 -635 16.705882352936506 ) ( -608 -635 112.7058823529364 ) tech04_1 37 -0.17337 180 1 -1.05556 +} +// brush 122 +{ +( -624 -655 16.705882352936506 ) ( -624 -655 112.7058823529364 ) ( -624 -671 112.7058823529364 ) tech04_1 1 -0.17337 180 1 -1.05556 +( -608 -671 112.7058823529364 ) ( -608 -671 16.705882352936506 ) ( -624 -671 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -671 16.705882352936506 ) ( -608 -671 16.705882352936506 ) ( -608 -655 16.705882352936506 ) tech04_1 -104 -7 180 1 -1 +( -608 -655 112.7058823529364 ) ( -608 -671 112.7058823529364 ) ( -624 -671 112.7058823529364 ) tech04_1 -104 -7 180 1 -1 +( -608 -655 16.705882352936506 ) ( -608 -655 112.7058823529364 ) ( -624 -655 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -655 16.705882352936506 ) ( -608 -671 16.705882352936506 ) ( -608 -671 112.7058823529364 ) tech04_1 1 -0.17337 180 1 -1.05556 +} +// brush 123 +{ +( -624 -691 16.705882352936506 ) ( -624 -691 112.7058823529364 ) ( -624 -707 112.7058823529364 ) tech04_1 93 -0.17337 180 1 -1.05556 +( -608 -707 112.7058823529364 ) ( -608 -707 16.705882352936506 ) ( -624 -707 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -707 16.705882352936506 ) ( -608 -707 16.705882352936506 ) ( -608 -691 16.705882352936506 ) tech04_1 -104 -11 180 1 -1 +( -608 -691 112.7058823529364 ) ( -608 -707 112.7058823529364 ) ( -624 -707 112.7058823529364 ) tech04_1 -104 -11 180 1 -1 +( -608 -691 16.705882352936506 ) ( -608 -691 112.7058823529364 ) ( -624 -691 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -691 16.705882352936506 ) ( -608 -707 16.705882352936506 ) ( -608 -707 112.7058823529364 ) tech04_1 93 -0.17337 180 1 -1.05556 +} +// brush 124 +{ +( -624 -151 16.705882352936506 ) ( -624 -151 112.7058823529364 ) ( -624 -167 112.7058823529364 ) tech04_1 121 -0.17337 180 1 -1.05556 +( -608 -167 112.7058823529364 ) ( -608 -167 16.705882352936506 ) ( -624 -167 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -167 16.705882352936506 ) ( -608 -167 16.705882352936506 ) ( -608 -151 16.705882352936506 ) tech04_1 -104 1 180 1 -1 +( -608 -151 112.7058823529364 ) ( -608 -167 112.7058823529364 ) ( -624 -167 112.7058823529364 ) tech04_1 -104 1 180 1 -1 +( -608 -151 16.705882352936506 ) ( -608 -151 112.7058823529364 ) ( -624 -151 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -151 16.705882352936506 ) ( -608 -167 16.705882352936506 ) ( -608 -167 112.7058823529364 ) tech04_1 121 -0.17337 180 1 -1.05556 +} +// brush 125 +{ +( -624 -259 16.705882352936506 ) ( -624 -259 112.7058823529364 ) ( -624 -275 112.7058823529364 ) tech04_1 13 -0.17337 180 1 -1.05556 +( -608 -275 112.7058823529364 ) ( -608 -275 16.705882352936506 ) ( -624 -275 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -275 16.705882352936506 ) ( -608 -275 16.705882352936506 ) ( -608 -259 16.705882352936506 ) tech04_1 -104 5 180 1 -1 +( -608 -259 112.7058823529364 ) ( -608 -275 112.7058823529364 ) ( -624 -275 112.7058823529364 ) tech04_1 -104 5 180 1 -1 +( -608 -259 16.705882352936506 ) ( -608 -259 112.7058823529364 ) ( -624 -259 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -259 16.705882352936506 ) ( -608 -275 16.705882352936506 ) ( -608 -275 112.7058823529364 ) tech04_1 13 -0.17337 180 1 -1.05556 +} +// brush 126 +{ +( -624 -223 16.705882352936506 ) ( -624 -223 112.7058823529364 ) ( -624 -239 112.7058823529364 ) tech04_1 49 -0.17337 180 1 -1.05556 +( -608 -239 112.7058823529364 ) ( -608 -239 16.705882352936506 ) ( -624 -239 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -239 16.705882352936506 ) ( -608 -239 16.705882352936506 ) ( -608 -223 16.705882352936506 ) tech04_1 -104 9 180 1 -1 +( -608 -223 112.7058823529364 ) ( -608 -239 112.7058823529364 ) ( -624 -239 112.7058823529364 ) tech04_1 -104 9 180 1 -1 +( -608 -223 16.705882352936506 ) ( -608 -223 112.7058823529364 ) ( -624 -223 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -223 16.705882352936506 ) ( -608 -239 16.705882352936506 ) ( -608 -239 112.7058823529364 ) tech04_1 49 -0.17337 180 1 -1.05556 +} +// brush 127 +{ +( -624 -187 16.705882352936506 ) ( -624 -187 112.7058823529364 ) ( -624 -203 112.7058823529364 ) tech04_1 85 -0.17337 180 1 -1.05556 +( -608 -203 112.7058823529364 ) ( -608 -203 16.705882352936506 ) ( -624 -203 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -203 16.705882352936506 ) ( -608 -203 16.705882352936506 ) ( -608 -187 16.705882352936506 ) tech04_1 -104 -3 180 1 -1 +( -608 -187 112.7058823529364 ) ( -608 -203 112.7058823529364 ) ( -624 -203 112.7058823529364 ) tech04_1 -104 -3 180 1 -1 +( -608 -187 16.705882352936506 ) ( -608 -187 112.7058823529364 ) ( -624 -187 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -187 16.705882352936506 ) ( -608 -203 16.705882352936506 ) ( -608 -203 112.7058823529364 ) tech04_1 85 -0.17337 180 1 -1.05556 +} +// brush 128 +{ +( -624 -295 16.705882352936506 ) ( -624 -295 112.7058823529364 ) ( -624 -311 112.7058823529364 ) tech04_1 105 -0.17337 180 1 -1.05556 +( -608 -311 112.7058823529364 ) ( -608 -311 16.705882352936506 ) ( -624 -311 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -311 16.705882352936506 ) ( -608 -311 16.705882352936506 ) ( -608 -295 16.705882352936506 ) tech04_1 -104 1 180 1 -1 +( -608 -295 112.7058823529364 ) ( -608 -311 112.7058823529364 ) ( -624 -311 112.7058823529364 ) tech04_1 -104 1 180 1 -1 +( -608 -295 16.705882352936506 ) ( -608 -295 112.7058823529364 ) ( -624 -295 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -295 16.705882352936506 ) ( -608 -311 16.705882352936506 ) ( -608 -311 112.7058823529364 ) tech04_1 105 -0.17337 180 1 -1.05556 +} +// brush 129 +{ +( -624 -331 16.705882352936506 ) ( -624 -331 112.7058823529364 ) ( -624 -347 112.7058823529364 ) tech04_1 69 -0.17337 180 1 -1.05556 +( -608 -347 112.7058823529364 ) ( -608 -347 16.705882352936506 ) ( -624 -347 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -347 16.705882352936506 ) ( -608 -347 16.705882352936506 ) ( -608 -331 16.705882352936506 ) tech04_1 -104 -3 180 1 -1 +( -608 -331 112.7058823529364 ) ( -608 -347 112.7058823529364 ) ( -624 -347 112.7058823529364 ) tech04_1 -104 -3 180 1 -1 +( -608 -331 16.705882352936506 ) ( -608 -331 112.7058823529364 ) ( -624 -331 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -331 16.705882352936506 ) ( -608 -347 16.705882352936506 ) ( -608 -347 112.7058823529364 ) tech04_1 69 -0.17337 180 1 -1.05556 +} +// brush 130 +{ +( -624 -367 16.705882352936506 ) ( -624 -367 112.7058823529364 ) ( -624 -383 112.7058823529364 ) tech04_1 33 -0.17337 180 1 -1.05556 +( -608 -383 112.7058823529364 ) ( -608 -383 16.705882352936506 ) ( -624 -383 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -383 16.705882352936506 ) ( -608 -383 16.705882352936506 ) ( -608 -367 16.705882352936506 ) tech04_1 -104 9 180 1 -1 +( -608 -367 112.7058823529364 ) ( -608 -383 112.7058823529364 ) ( -624 -383 112.7058823529364 ) tech04_1 -104 9 180 1 -1 +( -608 -367 16.705882352936506 ) ( -608 -367 112.7058823529364 ) ( -624 -367 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -367 16.705882352936506 ) ( -608 -383 16.705882352936506 ) ( -608 -383 112.7058823529364 ) tech04_1 33 -0.17337 180 1 -1.05556 +} +// brush 131 +{ +( -624 -403 16.705882352936506 ) ( -624 -403 112.7058823529364 ) ( -624 -419 112.7058823529364 ) tech04_1 -3 -0.17337 180 1 -1.05556 +( -608 -419 112.7058823529364 ) ( -608 -419 16.705882352936506 ) ( -624 -419 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -419 16.705882352936506 ) ( -608 -419 16.705882352936506 ) ( -608 -403 16.705882352936506 ) tech04_1 -104 5 180 1 -1 +( -608 -403 112.7058823529364 ) ( -608 -419 112.7058823529364 ) ( -624 -419 112.7058823529364 ) tech04_1 -104 5 180 1 -1 +( -608 -403 16.705882352936506 ) ( -608 -403 112.7058823529364 ) ( -624 -403 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -403 16.705882352936506 ) ( -608 -419 16.705882352936506 ) ( -608 -419 112.7058823529364 ) tech04_1 -3 -0.17337 180 1 -1.05556 +} +// brush 132 +{ +( -624 137 16.705882352936506 ) ( -624 137 112.7058823529364 ) ( -624 121 112.7058823529364 ) tech04_1 25 -0.17337 180 1 -1.05556 +( -608 121 112.7058823529364 ) ( -608 121 16.705882352936506 ) ( -624 121 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 121 16.705882352936506 ) ( -608 121 16.705882352936506 ) ( -608 137 16.705882352936506 ) tech04_1 24 1 180 1 -1 +( -608 137 112.7058823529364 ) ( -608 121 112.7058823529364 ) ( -624 121 112.7058823529364 ) tech04_1 24 1 180 1 -1 +( -608 137 16.705882352936506 ) ( -608 137 112.7058823529364 ) ( -624 137 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 137 16.705882352936506 ) ( -608 121 16.705882352936506 ) ( -608 121 112.7058823529364 ) tech04_1 25 -0.17337 180 1 -1.05556 +} +// brush 133 +{ +( -624 29 16.705882352936506 ) ( -624 29 112.7058823529364 ) ( -624 13 112.7058823529364 ) tech04_1 45 -0.17337 180 1 -1.05556 +( -608 13 112.7058823529364 ) ( -608 13 16.705882352936506 ) ( -624 13 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 13 16.705882352936506 ) ( -608 13 16.705882352936506 ) ( -608 29 16.705882352936506 ) tech04_1 24 5 180 1 -1 +( -608 29 112.7058823529364 ) ( -608 13 112.7058823529364 ) ( -624 13 112.7058823529364 ) tech04_1 24 5 180 1 -1 +( -608 29 16.705882352936506 ) ( -608 29 112.7058823529364 ) ( -624 29 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 29 16.705882352936506 ) ( -608 13 16.705882352936506 ) ( -608 13 112.7058823529364 ) tech04_1 45 -0.17337 180 1 -1.05556 +} +// brush 134 +{ +( -624 65 16.705882352936506 ) ( -624 65 112.7058823529364 ) ( -624 49 112.7058823529364 ) tech04_1 81 -0.17337 180 1 -1.05556 +( -608 49 112.7058823529364 ) ( -608 49 16.705882352936506 ) ( -624 49 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 49 16.705882352936506 ) ( -608 49 16.705882352936506 ) ( -608 65 16.705882352936506 ) tech04_1 24 9 180 1 -1 +( -608 65 112.7058823529364 ) ( -608 49 112.7058823529364 ) ( -624 49 112.7058823529364 ) tech04_1 24 9 180 1 -1 +( -608 65 16.705882352936506 ) ( -608 65 112.7058823529364 ) ( -624 65 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 65 16.705882352936506 ) ( -608 49 16.705882352936506 ) ( -608 49 112.7058823529364 ) tech04_1 81 -0.17337 180 1 -1.05556 +} +// brush 135 +{ +( -624 101 16.705882352936506 ) ( -624 101 112.7058823529364 ) ( -624 85 112.7058823529364 ) tech04_1 117 -0.17337 180 1 -1.05556 +( -608 85 112.7058823529364 ) ( -608 85 16.705882352936506 ) ( -624 85 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 85 16.705882352936506 ) ( -608 85 16.705882352936506 ) ( -608 101 16.705882352936506 ) tech04_1 24 -3 180 1 -1 +( -608 101 112.7058823529364 ) ( -608 85 112.7058823529364 ) ( -624 85 112.7058823529364 ) tech04_1 24 -3 180 1 -1 +( -608 101 16.705882352936506 ) ( -608 101 112.7058823529364 ) ( -624 101 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 101 16.705882352936506 ) ( -608 85 16.705882352936506 ) ( -608 85 112.7058823529364 ) tech04_1 117 -0.17337 180 1 -1.05556 +} +// brush 136 +{ +( -624 -7 16.705882352936506 ) ( -624 -7 112.7058823529364 ) ( -624 -23 112.7058823529364 ) tech04_1 9 -0.17337 180 1 -1.05556 +( -608 -23 112.7058823529364 ) ( -608 -23 16.705882352936506 ) ( -624 -23 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -23 16.705882352936506 ) ( -608 -23 16.705882352936506 ) ( -608 -7 16.705882352936506 ) tech04_1 24 1 180 1 -1 +( -608 -7 112.7058823529364 ) ( -608 -23 112.7058823529364 ) ( -624 -23 112.7058823529364 ) tech04_1 24 1 180 1 -1 +( -608 -7 16.705882352936506 ) ( -608 -7 112.7058823529364 ) ( -624 -7 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -7 16.705882352936506 ) ( -608 -23 16.705882352936506 ) ( -608 -23 112.7058823529364 ) tech04_1 9 -0.17337 180 1 -1.05556 +} +// brush 137 +{ +( -624 -43 16.705882352936506 ) ( -624 -43 112.7058823529364 ) ( -624 -59 112.7058823529364 ) tech04_1 101 -0.17337 180 1 -1.05556 +( -608 -59 112.7058823529364 ) ( -608 -59 16.705882352936506 ) ( -624 -59 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -59 16.705882352936506 ) ( -608 -59 16.705882352936506 ) ( -608 -43 16.705882352936506 ) tech04_1 24 -3 180 1 -1 +( -608 -43 112.7058823529364 ) ( -608 -59 112.7058823529364 ) ( -624 -59 112.7058823529364 ) tech04_1 24 -3 180 1 -1 +( -608 -43 16.705882352936506 ) ( -608 -43 112.7058823529364 ) ( -624 -43 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -43 16.705882352936506 ) ( -608 -59 16.705882352936506 ) ( -608 -59 112.7058823529364 ) tech04_1 101 -0.17337 180 1 -1.05556 +} +// brush 138 +{ +( -624 -79 16.705882352936506 ) ( -624 -79 112.7058823529364 ) ( -624 -95 112.7058823529364 ) tech04_1 65 -0.17337 180 1 -1.05556 +( -608 -95 112.7058823529364 ) ( -608 -95 16.705882352936506 ) ( -624 -95 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -95 16.705882352936506 ) ( -608 -95 16.705882352936506 ) ( -608 -79 16.705882352936506 ) tech04_1 24 9 180 1 -1 +( -608 -79 112.7058823529364 ) ( -608 -95 112.7058823529364 ) ( -624 -95 112.7058823529364 ) tech04_1 24 9 180 1 -1 +( -608 -79 16.705882352936506 ) ( -608 -79 112.7058823529364 ) ( -624 -79 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -79 16.705882352936506 ) ( -608 -95 16.705882352936506 ) ( -608 -95 112.7058823529364 ) tech04_1 65 -0.17337 180 1 -1.05556 +} +// brush 139 +{ +( -624 -115 16.705882352936506 ) ( -624 -115 112.7058823529364 ) ( -624 -131 112.7058823529364 ) tech04_1 29 -0.17337 180 1 -1.05556 +( -608 -131 112.7058823529364 ) ( -608 -131 16.705882352936506 ) ( -624 -131 16.705882352936506 ) tech04_1 -48 -0.17337 180 1 -1.05556 +( -624 -131 16.705882352936506 ) ( -608 -131 16.705882352936506 ) ( -608 -115 16.705882352936506 ) tech04_1 24 5 180 1 -1 +( -608 -115 112.7058823529364 ) ( -608 -131 112.7058823529364 ) ( -624 -131 112.7058823529364 ) tech04_1 24 5 180 1 -1 +( -608 -115 16.705882352936506 ) ( -608 -115 112.7058823529364 ) ( -624 -115 112.7058823529364 ) tech04_1 16 -0.173378 180 1 -1.05556 +( -608 -115 16.705882352936506 ) ( -608 -131 16.705882352936506 ) ( -608 -131 112.7058823529364 ) tech04_1 29 -0.17337 180 1 -1.05556 +} +// brush 140 +{ +( -576 -768 16 ) ( -576 -767 16 ) ( -576 -768 17 ) sfloor3_2 0 0 0 1 1 +( -576 -768 16 ) ( -576 -768 17 ) ( -575 -768 16 ) sfloor3_2 0 0 0 1 1 +( -576 -768 16 ) ( -575 -768 16 ) ( -576 -767 16 ) sfloor3_2 0 0 0 1 1 +( -512 -704 20 ) ( -512 -703 20 ) ( -511 -704 20 ) sfloor3_2 0 0 0 1 1 +( -512 -704 20 ) ( -511 -704 20 ) ( -512 -704 21 ) sfloor3_2 0 0 0 1 1 +( -512 -704 20 ) ( -512 -704 21 ) ( -512 -703 20 ) sfloor3_2 0 0 0 1 1 +} +// brush 141 +{ +( -576 -688 16 ) ( -576 -687 16 ) ( -576 -688 17 ) sfloor3_2 -16 0 0 1 1 +( -576 -688 16 ) ( -576 -688 17 ) ( -575 -688 16 ) sfloor3_2 0 0 0 1 1 +( -576 -688 16 ) ( -575 -688 16 ) ( -576 -687 16 ) sfloor3_2 0 16 0 1 1 +( -512 -624 20 ) ( -512 -623 20 ) ( -511 -624 20 ) sfloor3_2 0 16 0 1 1 +( -512 -624 20 ) ( -511 -624 20 ) ( -512 -624 21 ) sfloor3_2 0 0 0 1 1 +( -512 -624 20 ) ( -512 -624 21 ) ( -512 -623 20 ) sfloor3_2 -16 0 0 1 1 +} +// brush 142 +{ +( -576 -608 16 ) ( -576 -607 16 ) ( -576 -608 17 ) sfloor3_2 -32 0 0 1 1 +( -576 -608 16 ) ( -576 -608 17 ) ( -575 -608 16 ) sfloor3_2 0 0 0 1 1 +( -576 -608 16 ) ( -575 -608 16 ) ( -576 -607 16 ) sfloor3_2 0 32 0 1 1 +( -512 -544 20 ) ( -512 -543 20 ) ( -511 -544 20 ) sfloor3_2 0 32 0 1 1 +( -512 -544 20 ) ( -511 -544 20 ) ( -512 -544 21 ) sfloor3_2 0 0 0 1 1 +( -512 -544 20 ) ( -512 -544 21 ) ( -512 -543 20 ) sfloor3_2 -32 0 0 1 1 +} +// brush 143 +{ +( -576 -528 16 ) ( -576 -527 16 ) ( -576 -528 17 ) sfloor3_2 -48 0 0 1 1 +( -576 -528 16 ) ( -576 -528 17 ) ( -575 -528 16 ) sfloor3_2 0 0 0 1 1 +( -576 -528 16 ) ( -575 -528 16 ) ( -576 -527 16 ) sfloor3_2 0 48 0 1 1 +( -512 -464 20 ) ( -512 -463 20 ) ( -511 -464 20 ) sfloor3_2 0 48 0 1 1 +( -512 -464 20 ) ( -511 -464 20 ) ( -512 -464 21 ) sfloor3_2 0 0 0 1 1 +( -512 -464 20 ) ( -512 -464 21 ) ( -512 -463 20 ) sfloor3_2 -48 0 0 1 1 +} +// brush 144 +{ +( -496 -528 16.155678359289553 ) ( -496 -527 16.155678359289553 ) ( -496 -528 17.386447590058786 ) sfloor3_2 16 1.07875 0 1 1 +( -496 -528 16.155678359289553 ) ( -496 -528 17.386447590058786 ) ( -495 -528 16.155678359289553 ) sfloor3_2 -16 1.07875 0 1 1 +( -496 -528 16.155678359289553 ) ( -495 -528 16.155678359289553 ) ( -496 -527 16.155678359289553 ) sfloor3_2 -16 -16 0 1 1 +( -432 -464 21.078755282366501 ) ( -432 -463 21.078755282366501 ) ( -431 -464 21.078755282366501 ) sfloor3_2 -16 -16 0 1 1 +( -432 -464 21.078755282366501 ) ( -431 -464 21.078755282366501 ) ( -432 -464 22.309524513135727 ) sfloor3_2 -16 1.07875 0 1 1 +( -432 -464 21.078755282366501 ) ( -432 -464 22.309524513135727 ) ( -432 -463 21.078755282366501 ) sfloor3_2 16 1.07875 0 1 1 +} +// brush 145 +{ +( -496 -608 16.155678359289553 ) ( -496 -607 16.155678359289553 ) ( -496 -608 17.386447590058786 ) sfloor3_2 16 1.07875 0 1 1 +( -496 -608 16.155678359289553 ) ( -496 -608 17.386447590058786 ) ( -495 -608 16.155678359289553 ) sfloor3_2 -16 1.07875 0 1 1 +( -496 -608 16.155678359289553 ) ( -495 -608 16.155678359289553 ) ( -496 -607 16.155678359289553 ) sfloor3_2 -16 -16 0 1 1 +( -432 -544 21.078755282366501 ) ( -432 -543 21.078755282366501 ) ( -431 -544 21.078755282366501 ) sfloor3_2 -16 -16 0 1 1 +( -432 -544 21.078755282366501 ) ( -431 -544 21.078755282366501 ) ( -432 -544 22.309524513135727 ) sfloor3_2 -16 1.07875 0 1 1 +( -432 -544 21.078755282366501 ) ( -432 -544 22.309524513135727 ) ( -432 -543 21.078755282366501 ) sfloor3_2 16 1.07875 0 1 1 +} +// brush 146 +{ +( -496 -688 16.155678359289553 ) ( -496 -687 16.155678359289553 ) ( -496 -688 17.386447590058786 ) sfloor3_2 16 1.07875 0 1 1 +( -496 -688 16.155678359289553 ) ( -496 -688 17.386447590058786 ) ( -495 -688 16.155678359289553 ) sfloor3_2 -16 1.07875 0 1 1 +( -496 -688 16.155678359289553 ) ( -495 -688 16.155678359289553 ) ( -496 -687 16.155678359289553 ) sfloor3_2 -16 -16 0 1 1 +( -432 -624 21.078755282366501 ) ( -432 -623 21.078755282366501 ) ( -431 -624 21.078755282366501 ) sfloor3_2 -16 -16 0 1 1 +( -432 -624 21.078755282366501 ) ( -431 -624 21.078755282366501 ) ( -432 -624 22.309524513135727 ) sfloor3_2 -16 1.07875 0 1 1 +( -432 -624 21.078755282366501 ) ( -432 -624 22.309524513135727 ) ( -432 -623 21.078755282366501 ) sfloor3_2 16 1.07875 0 1 1 +} +// brush 147 +{ +( -496 -768 16.155678359289553 ) ( -496 -767 16.155678359289553 ) ( -496 -768 17.386447590058786 ) sfloor3_2 16 1.07875 0 1 1 +( -496 -768 16.155678359289553 ) ( -496 -768 17.386447590058786 ) ( -495 -768 16.155678359289553 ) sfloor3_2 -16 1.07875 0 1 1 +( -496 -768 16.155678359289553 ) ( -495 -768 16.155678359289553 ) ( -496 -767 16.155678359289553 ) sfloor3_2 -16 -16 0 1 1 +( -432 -704 21.078755282366501 ) ( -432 -703 21.078755282366501 ) ( -431 -704 21.078755282366501 ) sfloor3_2 -16 -16 0 1 1 +( -432 -704 21.078755282366501 ) ( -431 -704 21.078755282366501 ) ( -432 -704 22.309524513135727 ) sfloor3_2 -16 1.07875 0 1 1 +( -432 -704 21.078755282366501 ) ( -432 -704 22.309524513135727 ) ( -432 -703 21.078755282366501 ) sfloor3_2 16 1.07875 0 1 1 +} +// brush 148 +{ +( -610.48148148148175 135 111.07875528237156 ) ( -613 135 127.07875528237129 ) ( -613 123 127.07875528235827 ) tech04_1 -58 -7 0 1 1 +( -392 119 111.07875528237142 ) ( -392 135 111.07875528237142 ) ( -610.48148148148175 135 111.07875528237156 ) tech04_1 -17 1.06192 90 1 -1.07552 +( -613 135 127.07875528237129 ) ( -392 135 127.07875528237129 ) ( -392 123 127.0787552823582 ) tech04_1 -17 1.06192 90 1 -1.07552 +( -392 135 111.07875528237142 ) ( -392 135 127.07875528237129 ) ( -613 135 127.07875528237129 ) tech04_1 81.304 -7.75232 180 1.01891 -1.05556 +( -392 123 127.0787552823582 ) ( -392 119 111.07875528237142 ) ( -610.48148148148175 119 111.07875528237156 ) tech04_1 20.304 -5.89474 180 1.01891 -1.05556 +( -392 123 127.0787552823582 ) ( -392 135 127.07875528237129 ) ( -392 135 111.07875528237142 ) tech04_1 -58 -7 0 1 1 +} +// brush 149 +{ +( -609 135 7.0787552823663233 ) ( -609 135 23.07875528236633 ) ( -609 123 23.07875528236633 ) tech04_1 -58 -7 0 1 1 +( -609 123 23.07875528236633 ) ( -260.44083526682107 123 23.07875528236633 ) ( -260.44083526682107 119 7.0787552823663233 ) tech04_1 9 -5.89474 180 1 -1.05556 +( -260.44083526682107 119 7.0787552823663233 ) ( -260.44083526682107 135 7.0787552823663233 ) ( -609 135 7.0787552823663233 ) tech04_1 -17 6.35291 90 1 -1.05556 +( -609 135 23.07875528236633 ) ( -260.44083526682107 135 23.07875528236633 ) ( -260.44083526682107 123 23.07875528236633 ) tech04_1 -17 6.35291 90 1 -1.05556 +( -260.44083526682107 135 7.0787552823663233 ) ( -260.44083526682107 135 23.07875528236633 ) ( -609 135 23.07875528236633 ) tech04_1 70 -7.75232 180 1 -1.05556 +( -260.44083526682107 123 23.07875528236633 ) ( -260.44083526682107 135 23.07875528236633 ) ( -260.44083526682107 135 7.0787552823663233 ) tech04_1 -58 -7 0 1 1 +} +// brush 150 +{ +( -409 118 112.7058823529364 ) ( -409 118 16.705882352936506 ) ( -409 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -393 118 16.705882352936506 ) ( -409 118 16.705882352936506 ) ( -409 118 112.7058823529364 ) tech04_1 7 -0.17337 180 1 -1.05556 +( -409 134 16.705882352936506 ) ( -409 118 16.705882352936506 ) ( -393 118 16.705882352936506 ) tech04_1 2 -1 90 1 -1 +( -393 118 112.7058823529364 ) ( -409 118 112.7058823529364 ) ( -409 134 112.7058823529364 ) tech04_1 2 -1 90 1 -1 +( -393 134 16.705882352936506 ) ( -393 134 112.7058823529364 ) ( -409 134 112.7058823529364 ) tech04_1 7 -0.17337 180 1 -1.05556 +( -393 118 16.705882352936506 ) ( -393 118 112.7058823529364 ) ( -393 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 151 +{ +( -445 118 112.7058823529364 ) ( -445 118 16.705882352936506 ) ( -445 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -429 118 16.705882352936506 ) ( -445 118 16.705882352936506 ) ( -445 118 112.7058823529364 ) tech04_1 99 -0.17337 180 1 -1.05556 +( -445 134 16.705882352936506 ) ( -445 118 16.705882352936506 ) ( -429 118 16.705882352936506 ) tech04_1 2 11 90 1 -1 +( -429 118 112.7058823529364 ) ( -445 118 112.7058823529364 ) ( -445 134 112.7058823529364 ) tech04_1 2 11 90 1 -1 +( -429 134 16.705882352936506 ) ( -429 134 112.7058823529364 ) ( -445 134 112.7058823529364 ) tech04_1 99 -0.17337 180 1 -1.05556 +( -429 118 16.705882352936506 ) ( -429 118 112.7058823529364 ) ( -429 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 152 +{ +( -481 118 112.7058823529364 ) ( -481 118 16.705882352936506 ) ( -481 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -465 118 16.705882352936506 ) ( -481 118 16.705882352936506 ) ( -481 118 112.7058823529364 ) tech04_1 63 -0.17337 180 1 -1.05556 +( -481 134 16.705882352936506 ) ( -481 118 16.705882352936506 ) ( -465 118 16.705882352936506 ) tech04_1 2 7 90 1 -1 +( -465 118 112.7058823529364 ) ( -481 118 112.7058823529364 ) ( -481 134 112.7058823529364 ) tech04_1 2 7 90 1 -1 +( -465 134 16.705882352936506 ) ( -465 134 112.7058823529364 ) ( -481 134 112.7058823529364 ) tech04_1 63 -0.17337 180 1 -1.05556 +( -465 118 16.705882352936506 ) ( -465 118 112.7058823529364 ) ( -465 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 153 +{ +( -517 118 112.7058823529364 ) ( -517 118 16.705882352936506 ) ( -517 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -501 118 16.705882352936506 ) ( -517 118 16.705882352936506 ) ( -517 118 112.7058823529364 ) tech04_1 27 -0.17337 180 1 -1.05556 +( -517 134 16.705882352936506 ) ( -517 118 16.705882352936506 ) ( -501 118 16.705882352936506 ) tech04_1 2 3 90 1 -1 +( -501 118 112.7058823529364 ) ( -517 118 112.7058823529364 ) ( -517 134 112.7058823529364 ) tech04_1 2 3 90 1 -1 +( -501 134 16.705882352936506 ) ( -501 134 112.7058823529364 ) ( -517 134 112.7058823529364 ) tech04_1 27 -0.17337 180 1 -1.05556 +( -501 118 16.705882352936506 ) ( -501 118 112.7058823529364 ) ( -501 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 154 +{ +( -553 118 112.7058823529364 ) ( -553 118 16.705882352936506 ) ( -553 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -537 118 16.705882352936506 ) ( -553 118 16.705882352936506 ) ( -553 118 112.7058823529364 ) tech04_1 119 -0.17337 180 1 -1.05556 +( -553 134 16.705882352936506 ) ( -553 118 16.705882352936506 ) ( -537 118 16.705882352936506 ) tech04_1 2 -1 90 1 -1 +( -537 118 112.7058823529364 ) ( -553 118 112.7058823529364 ) ( -553 134 112.7058823529364 ) tech04_1 2 -1 90 1 -1 +( -537 134 16.705882352936506 ) ( -537 134 112.7058823529364 ) ( -553 134 112.7058823529364 ) tech04_1 119 -0.17337 180 1 -1.05556 +( -537 118 16.705882352936506 ) ( -537 118 112.7058823529364 ) ( -537 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 155 +{ +( -589 118 112.7058823529364 ) ( -589 118 16.705882352936506 ) ( -589 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -573 118 16.705882352936506 ) ( -589 118 16.705882352936506 ) ( -589 118 112.7058823529364 ) tech04_1 83 -0.17337 180 1 -1.05556 +( -589 134 16.705882352936506 ) ( -589 118 16.705882352936506 ) ( -573 118 16.705882352936506 ) tech04_1 2 11 90 1 -1 +( -573 118 112.7058823529364 ) ( -589 118 112.7058823529364 ) ( -589 134 112.7058823529364 ) tech04_1 2 11 90 1 -1 +( -573 134 16.705882352936506 ) ( -573 134 112.7058823529364 ) ( -589 134 112.7058823529364 ) tech04_1 83 -0.17337 180 1 -1.05556 +( -573 118 16.705882352936506 ) ( -573 118 112.7058823529364 ) ( -573 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 156 +{ +( -360 8005 8165.347972158931 ) ( -360 -8379 8165.347972158931 ) ( -360 -8379 -8218.6520278410699 ) slipbotsd -10.652 -5 90 -1 1 +( -8040 133 8165.347972158931 ) ( 8344 133 8165.347972158931 ) ( 8344 133 -8218.6520278410699 ) slipbotsd -10.652 40 90 -1 1 +( -8040 8005 21.347972158930816 ) ( -8040 -8379 21.347972158930816 ) ( 8344 8005 21.347972158930816 ) +0slipbot -40 -5 180 1 1 +( -8040 -8379 37.347972158930816 ) ( -8040 8005 37.347972158930816 ) ( 8344 8005 37.347972158930816 ) +0slipbot -40 -5 180 1 1 +( 8344 197 8165.347972158931 ) ( -8040 197 8165.347972158931 ) ( 8344 197 -8218.6520278410699 ) slipbotsd -10.652 40 90 -1 1 +( -296 -8379 8165.347972158931 ) ( -296 8005 8165.347972158931 ) ( -296 -8379 -8218.6520278410699 ) slipbotsd -10.652 -5 90 -1 1 +} +// brush 157 +{ +( -376 8005 8165.347972158931 ) ( -376 -8379 8165.347972158931 ) ( -376 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +( -8040 133 8165.347972158931 ) ( 8344 133 8165.347972158931 ) ( 8344 133 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -8040 8005 21.347972158930816 ) ( -8040 -8379 21.347972158930816 ) ( 8344 8005 21.347972158930816 ) slipside 5 -8 270 1 1 +( -8040 -8379 37.347972158930816 ) ( -8040 8005 37.347972158930816 ) ( 8344 8005 37.347972158930816 ) sliplite -8 -5 180 1 1 +( 8344 149 8165.347972158931 ) ( -8040 149 8165.347972158931 ) ( 8344 149 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -360 -8379 8165.347972158931 ) ( -360 8005 8165.347972158931 ) ( -360 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +} +// brush 158 +{ +( -296 8005 8165.347972158931 ) ( -296 -8379 8165.347972158931 ) ( -296 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +( -8040 133 8165.347972158931 ) ( 8344 133 8165.347972158931 ) ( 8344 133 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -8040 8005 21.347972158930816 ) ( -8040 -8379 21.347972158930816 ) ( 8344 8005 21.347972158930816 ) slipside 5 -8 270 1 1 +( -8040 -8379 37.347972158930816 ) ( -8040 8005 37.347972158930816 ) ( 8344 8005 37.347972158930816 ) sliplite -8 -5 180 1 1 +( 8344 149 8165.347972158931 ) ( -8040 149 8165.347972158931 ) ( 8344 149 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -280 -8379 8165.347972158931 ) ( -280 8005 8165.347972158931 ) ( -280 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +} +// brush 159 +{ +( -376 8005 8165.347972158931 ) ( -376 -8379 8165.347972158931 ) ( -376 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +( -8040 181 8165.347972158931 ) ( 8344 181 8165.347972158931 ) ( 8344 181 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -8040 8005 21.347972158930816 ) ( -8040 -8379 21.347972158930816 ) ( 8344 8005 21.347972158930816 ) slipside 5 -8 270 1 1 +( -8040 -8379 37.347972158930816 ) ( -8040 8005 37.347972158930816 ) ( 8344 8005 37.347972158930816 ) sliplite -8 -5 180 1 1 +( 8344 197 8165.347972158931 ) ( -8040 197 8165.347972158931 ) ( 8344 197 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -360 -8379 8165.347972158931 ) ( -360 8005 8165.347972158931 ) ( -360 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +} +// brush 160 +{ +( -296 8005 8165.347972158931 ) ( -296 -8379 8165.347972158931 ) ( -296 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +( -8040 181 8165.347972158931 ) ( 8344 181 8165.347972158931 ) ( 8344 181 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -8040 8005 21.347972158930816 ) ( -8040 -8379 21.347972158930816 ) ( 8344 8005 21.347972158930816 ) slipside 5 -8 270 1 1 +( -8040 -8379 37.347972158930816 ) ( -8040 8005 37.347972158930816 ) ( 8344 8005 37.347972158930816 ) sliplite -8 -5 180 1 1 +( 8344 197 8165.347972158931 ) ( -8040 197 8165.347972158931 ) ( 8344 197 -8218.6520278410699 ) slipside -8 -10.652 180 1 -1 +( -280 -8379 8165.347972158931 ) ( -280 8005 8165.347972158931 ) ( -280 -8379 -8218.6520278410699 ) slipside 5 -10.652 180 1 -1 +} +// brush 161 +{ +( -392 8389 8489.078755282364 ) ( -392 -7031.2352941176468 8489.078755282364 ) ( -392 -7031.2352941176468 -7894.9212447176351 ) +0slip 202 17.0788 180 0.5 -1 +( -7208 197 8489.078755282364 ) ( 9176 197 8489.078755282364 ) ( 9176 197 -7894.9212447176351 ) slip1 8 -174.921 0 1 1 +( -7208 8389 17.078755282365023 ) ( -7208 -7031.2352941176459 17.078755282365023 ) ( 9176 8389 17.078755282365023 ) +0slip 12 33 0 1 1 +( -7208 -7031.2352941176459 209.07875528236502 ) ( -7208 8389 209.07875528236502 ) ( 9176 8389 209.07875528236502 ) +0slip 253.688 -8 270 0.516129 1 +( 9176 229 8489.078755282364 ) ( -7208 229 8489.078755282364 ) ( 9176 229 -7894.9212447176351 ) +0slip -8 46.9212 180 1 1 +( -264 -7031.2352941176468 8489.078755282364 ) ( -264 8389 8489.078755282364 ) ( -264 -7031.2352941176468 -7894.9212447176351 ) +0slip 202 17.0788 180 0.5 -1 +} +// brush 162 +{ +( -296 8005.6830507828981 8329.3479721589301 ) ( -296 -8378.3169492171019 8329.3479721589301 ) ( -296 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +( -8040 133.68305078289998 8329.3479721589301 ) ( 8344 133.68305078289697 8329.3479721589301 ) ( 8344 133.68305078289697 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -8040 8005.6830507829 185.34797215893082 ) ( -8040 -8378.3169492171 185.34797215893082 ) ( 8344 8005.6830507828963 185.34797215893082 ) slipside 5.68304 -8 270 1 1 +( -8040 -8378.3169492171 201.34797215893082 ) ( -8040 8005.6830507829 201.34797215893082 ) ( 8344 8005.6830507828963 201.34797215893082 ) sliplite -8 -5.68304 180 1 1 +( 8344 149.683050782897 8329.3479721589301 ) ( -8040 149.68305078289995 8329.3479721589301 ) ( 8344 149.683050782897 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -280 -8378.3169492171019 8329.3479721589301 ) ( -280 8005.6830507828981 8329.3479721589301 ) ( -280 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +} +// brush 163 +{ +( -296 8005.6830507828981 8329.3479721589301 ) ( -296 -8378.3169492171019 8329.3479721589301 ) ( -296 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +( -8040 181.68305078289995 8329.3479721589301 ) ( 8344 181.683050782897 8329.3479721589301 ) ( 8344 181.683050782897 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -8040 8005.6830507829 185.34797215893082 ) ( -8040 -8378.3169492171 185.34797215893082 ) ( 8344 8005.6830507828963 185.34797215893082 ) slipside 5.68304 -8 270 1 1 +( -8040 -8378.3169492171 201.34797215893082 ) ( -8040 8005.6830507829 201.34797215893082 ) ( 8344 8005.6830507828963 201.34797215893082 ) sliplite -8 -5.68304 180 1 1 +( 8344 197.683050782897 8329.3479721589301 ) ( -8040 197.68305078289995 8329.3479721589301 ) ( 8344 197.683050782897 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -280 -8378.3169492171019 8329.3479721589301 ) ( -280 8005.6830507828981 8329.3479721589301 ) ( -280 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +} +// brush 164 +{ +( -360 8005.6830507828981 8329.3479721589301 ) ( -360 -8378.3169492171019 8329.3479721589301 ) ( -360 -8378.3169492171019 -8054.652027841069 ) slipbotsd -6.65202 -5.68298 90 -1 1 +( -8040 133.68305078289998 8329.3479721589301 ) ( 8344 133.68305078289697 8329.3479721589301 ) ( 8344 133.68305078289697 -8054.652027841069 ) slipbotsd -6.65202 40 90 -1 1 +( -8040 8005.6830507829 185.34797215893082 ) ( -8040 -8378.3169492171 185.34797215893082 ) ( 8344 8005.6830507828963 185.34797215893082 ) +0slipbot -40 -5.68298 180 1 1 +( -8040 -8378.3169492171 201.34797215893082 ) ( -8040 8005.6830507829 201.34797215893082 ) ( 8344 8005.6830507828963 201.34797215893082 ) +0slipbot -40 -5.68298 180 1 1 +( 8344 197.683050782897 8329.3479721589301 ) ( -8040 197.68305078289995 8329.3479721589301 ) ( 8344 197.683050782897 -8054.652027841069 ) slipbotsd -6.65202 40 90 -1 1 +( -296 -8378.3169492171019 8329.3479721589301 ) ( -296 8005.6830507828981 8329.3479721589301 ) ( -296 -8378.3169492171019 -8054.652027841069 ) slipbotsd -6.65202 -5.68298 90 -1 1 +} +// brush 165 +{ +( -376 8005.6830507828981 8329.3479721589301 ) ( -376 -8378.3169492171019 8329.3479721589301 ) ( -376 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +( -8040 133.68305078289998 8329.3479721589301 ) ( 8344 133.68305078289697 8329.3479721589301 ) ( 8344 133.68305078289697 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -8040 8005.6830507829 185.34797215893082 ) ( -8040 -8378.3169492171 185.34797215893082 ) ( 8344 8005.6830507828963 185.34797215893082 ) slipside 5.68304 -8 270 1 1 +( -8040 -8378.3169492171 201.34797215893082 ) ( -8040 8005.6830507829 201.34797215893082 ) ( 8344 8005.6830507828963 201.34797215893082 ) sliplite -8 -5.68304 180 1 1 +( 8344 149.683050782897 8329.3479721589301 ) ( -8040 149.68305078289995 8329.3479721589301 ) ( 8344 149.683050782897 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -360 -8378.3169492171019 8329.3479721589301 ) ( -360 8005.6830507828981 8329.3479721589301 ) ( -360 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +} +// brush 166 +{ +( -376 8005.6830507828981 8329.3479721589301 ) ( -376 -8378.3169492171019 8329.3479721589301 ) ( -376 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +( -8040 181.68305078289995 8329.3479721589301 ) ( 8344 181.683050782897 8329.3479721589301 ) ( 8344 181.683050782897 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -8040 8005.6830507829 185.34797215893082 ) ( -8040 -8378.3169492171 185.34797215893082 ) ( 8344 8005.6830507828963 185.34797215893082 ) slipside 5.68304 -8 270 1 1 +( -8040 -8378.3169492171 201.34797215893082 ) ( -8040 8005.6830507829 201.34797215893082 ) ( 8344 8005.6830507828963 201.34797215893082 ) sliplite -8 -5.68304 180 1 1 +( 8344 197.683050782897 8329.3479721589301 ) ( -8040 197.68305078289995 8329.3479721589301 ) ( 8344 197.683050782897 -8054.652027841069 ) slipside -8 -6.65202 180 1 -1 +( -360 -8378.3169492171019 8329.3479721589301 ) ( -360 8005.6830507828981 8329.3479721589301 ) ( -360 -8378.3169492171019 -8054.652027841069 ) slipside 5.68304 -6.65202 180 1 -1 +} +// brush 167 +{ +( -406.25 229 32 ) ( -406.25 122.44083526682131 32 ) ( -411 122.44083526682131 16 ) tech04_1 42 13.9254 180 1 -1.05556 +( -406.25 122.44083526682131 32 ) ( -392 122.44083526682131 32 ) ( -392 122.44083526682131 16 ) tech04_1 -73 13.9212 0 1 1 +( -411 122.44083526682131 16 ) ( -392 122.44083526682131 16 ) ( -392 229 16 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -392 229 32 ) ( -392 122.44083526682131 32 ) ( -406.25 122.44083526682131 32 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -392 229 16 ) ( -392 229 32 ) ( -406.25 229 32 ) tech04_1 -73 13.9212 0 1 1 +( -392 122.44083526682131 16 ) ( -392 122.44083526682131 32 ) ( -392 229 32 ) tech04_1 103 12.0678 180 1 -1.05556 +} +// brush 168 +{ +( -264 229 13 ) ( -264 229 29 ) ( -264 132.44083514761226 29 ) tech04_1 103 12.0678 180 1 -1.05556 +( -244 229 13 ) ( -264 229 13 ) ( -264 132.44083514761226 13 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -264 132.44083514761226 29 ) ( -264 229 29 ) ( -249 229 29 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -249 229 29 ) ( -264 229 29 ) ( -264 229 13 ) tech04_1 -73 13.9212 0 1 1 +( -264 132.44083514761226 13 ) ( -264 132.44083514761226 29 ) ( -249 132.44083529082931 29 ) tech04_1 -73 13.9212 0 1 1 +( -249 132.44083529082931 29 ) ( -249 229 29 ) ( -244 229 13 ) tech04_1 42 13.9254 180 1 -1.05556 +} +// brush 169 +{ +( -409 154 112 ) ( -409 154 16 ) ( -409 170 16 ) tech04_1 -106 -0.842102 0 1 1.05556 +( -393 154 16 ) ( -409 154 16 ) ( -409 154 112 ) tech04_1 13 -0.842102 180 1 -1.05556 +( -409 170 16 ) ( -409 154 16 ) ( -393 154 16 ) tech04_1 -34 5 90 1 -1 +( -393 154 112 ) ( -409 154 112 ) ( -409 170 112 ) tech04_1 -34 5 90 1 -1 +( -393 170 16 ) ( -393 170 112 ) ( -409 170 112 ) tech04_1 13 -0.842102 180 1 -1.05556 +( -393 154 16 ) ( -393 154 112 ) ( -393 170 112 ) tech04_1 -42 -0.84211 0 1 1.05556 +} +// brush 170 +{ +( -409 190 112 ) ( -409 190 16 ) ( -409 206 16 ) tech04_1 -14 -0.842102 0 1 1.05556 +( -393 190 16 ) ( -409 190 16 ) ( -409 190 112 ) tech04_1 13 -0.842102 180 1 -1.05556 +( -409 206 16 ) ( -409 190 16 ) ( -393 190 16 ) tech04_1 -70 5 90 1 -1 +( -393 190 112 ) ( -409 190 112 ) ( -409 206 112 ) tech04_1 -70 5 90 1 -1 +( -393 206 16 ) ( -393 206 112 ) ( -409 206 112 ) tech04_1 13 -0.842102 180 1 -1.05556 +( -393 190 16 ) ( -393 190 112 ) ( -393 206 112 ) tech04_1 -78 -0.84211 0 1 1.05556 +} +// brush 171 +{ +( -263 190 112 ) ( -263 190 16 ) ( -263 206 16 ) tech04_1 -14 -0.842102 0 1 1.05556 +( -247 190 16 ) ( -263 190 16 ) ( -263 190 112 ) tech04_1 17 -0.842102 180 1 -1.05556 +( -263 206 16 ) ( -263 190 16 ) ( -247 190 16 ) tech04_1 -70 9 90 1 -1 +( -247 190 112 ) ( -263 190 112 ) ( -263 206 112 ) tech04_1 -70 9 90 1 -1 +( -247 206 16 ) ( -247 206 112 ) ( -263 206 112 ) tech04_1 17 -0.842102 180 1 -1.05556 +( -247 190 16 ) ( -247 190 112 ) ( -247 206 112 ) tech04_1 -78 -0.84211 0 1 1.05556 +} +// brush 172 +{ +( -263 154 112 ) ( -263 154 16 ) ( -263 170 16 ) tech04_1 -106 -0.842102 0 1 1.05556 +( -247 154 16 ) ( -263 154 16 ) ( -263 154 112 ) tech04_1 17 -0.842102 180 1 -1.05556 +( -263 170 16 ) ( -263 154 16 ) ( -247 154 16 ) tech04_1 -34 9 90 1 -1 +( -247 154 112 ) ( -263 154 112 ) ( -263 170 112 ) tech04_1 -34 9 90 1 -1 +( -247 170 16 ) ( -247 170 112 ) ( -263 170 112 ) tech04_1 17 -0.842102 180 1 -1.05556 +( -247 154 16 ) ( -247 154 112 ) ( -247 170 112 ) tech04_1 -42 -0.84211 0 1 1.05556 +} +// brush 173 +{ +( -404 229 127 ) ( -404 134.44083526682121 127 ) ( -408 134.44083526682121 111 ) tech04_1 42 -3.33778 180 1 -1.05556 +( -404 134.44083526682121 127 ) ( -392 134.44083526682121 127 ) ( -392 134.44083526682121 111 ) tech04_1 -73 1.92125 0 1 1 +( -408 134.44083526682121 111 ) ( -392 134.44083526682121 111 ) ( -392 229 111 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -392 229 127 ) ( -392 134.44083526682121 127 ) ( -404 134.44083526682121 127 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -392 229 111 ) ( -392 229 127 ) ( -404 229 127 ) tech04_1 -73 1.92125 0 1 1 +( -392 134.44083526682121 111 ) ( -392 134.44083526682121 127 ) ( -392 229 127 ) tech04_1 103 10.8046 180 1 -1.05556 +} +// brush 174 +{ +( -264 229 108 ) ( -264 229 124 ) ( -264 132.44083514761226 124 ) tech04_1 103 10.8046 180 1 -1.05556 +( -248 229 108 ) ( -264 229 108 ) ( -264 132.44083514761226 108 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -264 132.44083514761226 124 ) ( -264 229 124 ) ( -252 229 124 ) tech04_1 -32 5.61606 90 1 -1.05556 +( -252 229 124 ) ( -264 229 124 ) ( -264 229 108 ) tech04_1 -73 1.92125 0 1 1 +( -264 132.44083514761226 108 ) ( -264 132.44083514761226 124 ) ( -252 132.44083529082931 124 ) tech04_1 -73 1.92125 0 1 1 +( -252 132.44083529082931 124 ) ( -252 229 124 ) ( -248 229 108 ) tech04_1 42 -3.33778 180 1 -1.05556 +} +// brush 175 +{ +( -265 118 112.7058823529364 ) ( -265 118 16.705882352936506 ) ( -265 134 16.705882352936506 ) tech04_1 -70 -0.17337 0 1 1.05556 +( -249 118 16.705882352936506 ) ( -265 118 16.705882352936506 ) ( -265 118 112.7058823529364 ) tech04_1 23 -0.17337 180 1 -1.05556 +( -265 134 16.705882352936506 ) ( -265 118 16.705882352936506 ) ( -249 118 16.705882352936506 ) tech04_1 2 -1 90 1 -1 +( -249 118 112.7058823529364 ) ( -265 118 112.7058823529364 ) ( -265 134 112.7058823529364 ) tech04_1 2 -1 90 1 -1 +( -249 134 16.705882352936506 ) ( -249 134 112.7058823529364 ) ( -265 134 112.7058823529364 ) tech04_1 23 -0.17337 180 1 -1.05556 +( -249 118 16.705882352936506 ) ( -249 118 112.7058823529364 ) ( -249 134 112.7058823529364 ) tech04_1 -6 -0.173378 0 1 1.05556 +} +// brush 176 +{ +( -859.19783941350113 65.794656751276193 12.511604039704544 ) ( -872.19783941350113 -565.59105753445704 12.511604039704544 ) ( -872.19783941350113 -565.59105753445704 10.366118855039534 ) wgrass1_1 0 0 0 1 1 +( -820.19783941350113 -480.53391467731086 60.936916942574371 ) ( -872.19783941350113 -565.59105753445704 12.511604039704544 ) ( -859.19783941350113 65.794656751276193 12.511604039704544 ) wgrass1_1 0 0 0 1 1 +( -768.1978394135017 26.537513894132147 43.162815918433765 ) ( -820.19783941350113 -480.53391467731086 60.936916942574371 ) ( -859.19783941350113 65.794656751276193 12.511604039704544 ) wgrass1_1 0 0 0 1 1 +( -648.19783941350192 121.40894246556337 10.366118855039534 ) ( -648.19783941350192 121.40894246556337 12.511604039704544 ) ( -859.19783941350113 65.794656751276193 12.511604039704544 ) wgrass1_1 0 0 0 1 1 +( -859.19783941350113 65.794656751276193 12.511604039704544 ) ( -648.19783941350192 121.40894246556337 12.511604039704544 ) ( -768.1978394135017 26.537513894132147 43.162815918433765 ) wgrass1_1 0 0 0 1 1 +( -768.1978394135017 26.537513894132147 43.162815918433765 ) ( -704.19783941350147 -186.10450946310863 55.082251288104764 ) ( -820.19783941350113 -480.53391467731086 60.936916942574371 ) wgrass1_1 0 0 0 1 1 +( -859.19783941350113 65.794656751276193 10.366118855039534 ) ( -872.19783941350113 -565.59105753445704 10.366118855039534 ) ( -668.1978394135017 -516.51962896302666 10.366118855039534 ) wgrass1_1 0 0 0 1 1 +( -668.1978394135017 -516.51962896302666 10.366118855039534 ) ( -872.19783941350113 -565.59105753445704 12.511604039704544 ) ( -820.19783941350113 -480.53391467731086 60.936916942574371 ) wgrass1_1 8.99512 48.8306 0 1 1 +( -648.19783941350192 121.40894246556337 12.511604039704544 ) ( -704.19783941350147 -186.10450946310863 55.082251288104764 ) ( -768.1978394135017 26.537513894132147 43.162815918433765 ) wgrass1_1 0 0 0 1 1 +( -872.19783941350113 -565.59105753445704 10.366118855039534 ) ( -872.19783941350113 -565.59105753445704 12.511604039704544 ) ( -668.1978394135017 -516.51962896302666 10.366118855039534 ) wgrass1_1 0 0 0 1 1 +( -820.19783941350113 -480.53391467731086 60.936916942574371 ) ( -704.19783941350147 -186.10450946310863 55.082251288104764 ) ( -668.1978394135017 -516.51962896302666 10.366118855039534 ) wgrass1_1 0 -35.6505 0 1 1 +( -668.1978394135017 -516.51962896302666 10.366118855039534 ) ( -704.19783941350147 -186.10450946310863 55.082251288104764 ) ( -648.19783941350192 121.40894246556337 12.511604039704544 ) wgrass1_1 0 -35.6505 0 1 1 +( -668.1978394135017 -516.51962896302666 10.366118855039534 ) ( -648.19783941350192 121.40894246556337 12.511604039704544 ) ( -648.19783941350192 121.40894246556337 10.366118855039534 ) wgrass1_1 0 0 0 1 1 +} +// brush 177 +{ +( -880 -629.49914771477916 9.4292019124678461 ) ( -801.77494241862087 -1021.2528432381089 11.744388605971949 ) ( -801.77494241862087 -1021.2528432381089 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +( -880 -629.49914771477916 9.4292019124678461 ) ( -797.91357599036155 -820.40888658723793 57.682247672914485 ) ( -801.77494241862087 -1021.2528432381089 11.744388605971949 ) wgrass1_1 0 -35.6505 0 1 1 +( -704.47108380532245 -546.96334600453406 9.4292019124678461 ) ( -704.47108380532245 -546.96334600453406 11.744388605971949 ) ( -880 -629.49914771477916 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +( -738.27802436496472 -611.96557829936955 64 ) ( -797.91357599036155 -820.40888658723793 57.682247672914485 ) ( -880 -629.49914771477916 9.4292019124678461 ) wgrass1_1 0 -35.6505 0 1 1 +( -880 -629.49914771477916 9.4292019124678461 ) ( -704.47108380532245 -546.96334600453406 11.744388605971949 ) ( -738.27802436496472 -611.96557829936955 64 ) wgrass1_1 8.99512 48.8306 0 1 1 +( -801.77494241862087 -1021.2528432381089 11.744388605971949 ) ( -797.91357599036155 -820.40888658723793 57.682247672914485 ) ( -708.47211742982472 -932.70357257443538 44.820020350541554 ) wgrass1_1 0 0 0 1 1 +( -620.95540764463499 -932.94041267756825 9.4292019124678461 ) ( -704.47108380532245 -546.96334600453406 9.4292019124678461 ) ( -880 -629.49914771477916 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +( -708.47211742982472 -932.70357257443538 44.820020350541554 ) ( -797.91357599036155 -820.40888658723793 57.682247672914485 ) ( -738.27802436496472 -611.96557829936955 64 ) wgrass1_1 0 0 0 1 1 +( -620.95540764463499 -932.94041267756825 11.744388605971949 ) ( -801.77494241862087 -1021.2528432381089 11.744388605971949 ) ( -708.47211742982472 -932.70357257443538 44.820020350541554 ) wgrass1_1 0 0 0 1 1 +( -708.47211742982472 -932.70357257443538 44.820020350541554 ) ( -738.27802436496472 -611.96557829936955 64 ) ( -620.95540764463499 -932.94041267756825 11.744388605971949 ) wgrass1_1 0 0 0 1 1 +( -801.77494241862087 -1021.2528432381089 9.4292019124678461 ) ( -801.77494241862087 -1021.2528432381089 11.744388605971949 ) ( -620.95540764463499 -932.94041267756825 11.744388605971949 ) wgrass1_1 0 0 0 1 1 +( -738.27802436496472 -611.96557829936955 64 ) ( -704.47108380532245 -546.96334600453406 11.744388605971949 ) ( -620.95540764463499 -932.94041267756825 11.744388605971949 ) wgrass1_1 0 0 0 1 1 +( -620.95540764463499 -932.94041267756825 11.744388605971949 ) ( -704.47108380532245 -546.96334600453406 11.744388605971949 ) ( -704.47108380532245 -546.96334600453406 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +} +// brush 178 +{ +( -864.15630872551583 275.18112328704035 9.4292019124678461 ) ( -864.15630872551583 275.18112328704035 11.744388605971949 ) ( -732.05351193864465 123.37980369963492 11.744388605971949 ) wgrass1_1 0 0 0 1 1 +( -732.05351193864465 123.37980369963492 11.744388605971949 ) ( -864.15630872551583 275.18112328704035 11.744388605971949 ) ( -754.47573322344488 207.97575264232978 44.820020350541554 ) wgrass1_1 0 0 0 1 1 +( -505.99743138164968 452.13404405857557 9.4292019124678461 ) ( -864.15630872551583 275.18112328704035 11.744388605971949 ) ( -864.15630872551583 275.18112328704035 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +( -505.99743138164968 452.13404405857557 9.4292019124678461 ) ( -669.15654877060445 323.43357080420958 57.682247672914485 ) ( -864.15630872551583 275.18112328704035 11.744388605971949 ) wgrass1_1 0 -35.6505 0 1 1 +( -864.15630872551583 275.18112328704035 11.744388605971949 ) ( -669.15654877060445 323.43357080420958 57.682247672914485 ) ( -754.47573322344488 207.97575264232978 44.820020350541554 ) wgrass1_1 0 0 0 1 1 +( -754.47573322344488 207.97575264232978 44.820020350541554 ) ( -669.15654877060445 323.43357080420958 57.682247672914485 ) ( -452.38095745237092 319.77914933332011 64 ) wgrass1_1 0 0 0 1 1 +( -452.38095745237092 319.77914933332011 64 ) ( -669.15654877060445 323.43357080420958 57.682247672914485 ) ( -505.99743138164968 452.13404405857557 9.4292019124678461 ) wgrass1_1 0 -35.6505 0 1 1 +( -732.05351193864465 123.37980369963492 9.4292019124678461 ) ( -380.84374243886373 303.94796803102383 9.4292019124678461 ) ( -505.99743138164968 452.13404405857557 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +( -754.47573322344488 207.97575264232978 44.820020350541554 ) ( -452.38095745237092 319.77914933332011 64 ) ( -732.05351193864465 123.37980369963492 11.744388605971949 ) wgrass1_1 0 0 0 1 1 +( -452.38095745237092 319.77914933332011 64 ) ( -380.84374243886373 303.94796803102383 11.744388605971949 ) ( -732.05351193864465 123.37980369963492 11.744388605971949 ) wgrass1_1 0 0 0 1 1 +( -732.05351193864465 123.37980369963492 11.744388605971949 ) ( -380.84374243886373 303.94796803102383 11.744388605971949 ) ( -380.84374243886373 303.94796803102383 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +( -505.99743138164968 452.13404405857557 9.4292019124678461 ) ( -380.84374243886373 303.94796803102383 11.744388605971949 ) ( -452.38095745237092 319.77914933332011 64 ) wgrass1_1 8.99512 48.8306 0 1 1 +( -380.84374243886373 303.94796803102383 9.4292019124678461 ) ( -380.84374243886373 303.94796803102383 11.744388605971949 ) ( -505.99743138164968 452.13404405857557 9.4292019124678461 ) wgrass1_1 0 0 0 1 1 +} +// brush 179 +{ +( -239.65439854751423 441.75940441512449 11.700946482925875 ) ( -239.65439854751423 441.75940441512449 13.337327141072954 ) ( -291.26693086893511 297.52044508034146 11.700946482925875 ) wgrass1_1 0 0 0 1 1 +( -291.26693086893511 297.52044508034146 11.700946482925875 ) ( -239.65439854751423 441.75940441512449 13.337327141072954 ) ( -222.21723190977602 386.4879949348707 50.271744570457614 ) wgrass1_1 8.99512 48.8306 0 1 1 +( -291.26693086893511 297.52044508034146 11.700946482925875 ) ( -29.345644443203057 121.89346508923413 13.337327141072954 ) ( -29.345644443203057 121.89346508923413 11.700946482925875 ) wgrass1_1 0 0 0 1 1 +( -291.26693086893511 297.52044508034146 11.700946482925875 ) ( -139.17369448668444 236.48861446875119 45.806338933835221 ) ( -29.345644443203057 121.89346508923413 13.337327141072954 ) wgrass1_1 0 -35.6505 0 1 1 +( -222.21723190977602 386.4879949348707 50.271744570457614 ) ( -139.17369448668444 236.48861446875119 45.806338933835221 ) ( -291.26693086893511 297.52044508034146 11.700946482925875 ) wgrass1_1 0 -35.6505 0 1 1 +( 21.988885232302032 272.32116799180324 11.700946482925875 ) ( -239.65439854751423 441.75940441512449 11.700946482925875 ) ( -291.26693086893511 297.52044508034146 11.700946482925875 ) wgrass1_1 0 0 0 1 1 +( -29.345644443203057 121.89346508923413 13.337327141072954 ) ( -139.17369448668444 236.48861446875119 45.806338933835221 ) ( -26.819555976975977 223.57567637756381 36.715279422273383 ) wgrass1_1 0 0 0 1 1 +( -26.819555976975977 223.57567637756381 36.715279422273383 ) ( -139.17369448668444 236.48861446875119 45.806338933835221 ) ( -222.21723190977602 386.4879949348707 50.271744570457614 ) wgrass1_1 0 0 0 1 1 +( -26.819555976975977 223.57567637756381 36.715279422273383 ) ( -222.21723190977602 386.4879949348707 50.271744570457614 ) ( 21.988885232302032 272.32116799180324 13.337327141072954 ) wgrass1_1 0 0 0 1 1 +( -222.21723190977602 386.4879949348707 50.271744570457614 ) ( -239.65439854751423 441.75940441512449 13.337327141072954 ) ( 21.988885232302032 272.32116799180324 13.337327141072954 ) wgrass1_1 0 0 0 1 1 +( 21.988885232302032 272.32116799180324 13.337327141072954 ) ( -239.65439854751423 441.75940441512449 13.337327141072954 ) ( -239.65439854751423 441.75940441512449 11.700946482925875 ) wgrass1_1 0 0 0 1 1 +( 21.988885232302032 272.32116799180324 13.337327141072954 ) ( -29.345644443203057 121.89346508923413 13.337327141072954 ) ( -26.819555976975977 223.57567637756381 36.715279422273383 ) wgrass1_1 0 0 0 1 1 +( -29.345644443203057 121.89346508923413 11.700946482925875 ) ( -29.345644443203057 121.89346508923413 13.337327141072954 ) ( 21.988885232302032 272.32116799180324 13.337327141072954 ) wgrass1_1 0 0 0 1 1 +} +// brush 180 +{ +( 2 -744 116 ) ( 2 -744 169 ) ( 2 -784 169 ) tech10_1 -44.0575 -51.9245 180 0.622194 -0.828125 +( 63 -784 169 ) ( 63 -784 116 ) ( 2 -784 116 ) tech10_1 -2.09836 -53.3656 0 0.953125 0.838431 +( 2 -784 116 ) ( 63 -784 116 ) ( 63 -744 116 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 63 -744 169 ) ( 63 -784 169 ) ( 2 -784 169 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 63 -744 116 ) ( 63 -744 169 ) ( 2 -744 169 ) tech10_1 -2.09836 -51.9245 0 0.953125 0.828125 +( 63 -744 116 ) ( 63 -784 116 ) ( 63 -784 169 ) tech10_1 -44.0575 -51.9245 180 0.622194 -0.828125 +} +// brush 181 +{ +( 63 -744 16 ) ( 63 -744 69 ) ( 63 -784 69 ) tech10_1 -44.0575 19.3208 180 0.622194 -0.828125 +( 124 -784 69 ) ( 124 -784 16 ) ( 63 -784 16 ) tech10_1 -2.09836 19.364 0 0.953125 0.838431 +( 63 -784 16 ) ( 124 -784 16 ) ( 124 -744 16 ) tech10_1 -13.6 46.0984 270 2.5 0.953125 +( 124 -744 69 ) ( 124 -784 69 ) ( 63 -784 69 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 124 -744 16 ) ( 124 -744 69 ) ( 63 -744 69 ) tech10_1 -2.09836 19.3208 0 0.953125 0.828125 +( 124 -744 16 ) ( 124 -784 16 ) ( 124 -784 69 ) tech10_1 -44.0575 19.3208 180 0.622194 -0.828125 +} +// brush 182 +{ +( -120 -744 16 ) ( -120 -744 65 ) ( -120 -784 65 ) tech10_1 -44.0575 -43.102 180 0.622194 -0.765625 +( -59 -784 65 ) ( -59 -784 16 ) ( -120 -784 16 ) tech10_1 -2.09836 20.9218 0 0.953125 0.775153 +( -120 -784 16 ) ( -59 -784 16 ) ( -59 -744 16 ) tech10_1 -13.6 -17.9016 270 2.5 0.953125 +( -59 -744 65 ) ( -59 -784 65 ) ( -120 -784 65 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( -59 -744 16 ) ( -59 -744 65 ) ( -120 -744 65 ) tech10_1 -2.09836 -43.102 0 0.953125 0.765625 +( -59 -744 16 ) ( -59 -784 16 ) ( -59 -784 65 ) tech10_1 -44.0575 -43.102 180 0.622194 -0.765625 +} +// brush 183 +{ +( -59 -744 16 ) ( -59 -744 69 ) ( -59 -784 69 ) tech10_1 -44.0575 -44.6792 180 0.622194 -0.828125 +( 2 -784 69 ) ( 2 -784 16 ) ( -59 -784 16 ) tech10_1 -2.09836 19.364 0 0.953125 0.838431 +( -59 -784 16 ) ( 2 -784 16 ) ( 2 -744 16 ) tech10_1 -13.6 46.0984 270 2.5 0.953125 +( 2 -744 69 ) ( 2 -784 69 ) ( -59 -784 69 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 2 -744 16 ) ( 2 -744 69 ) ( -59 -744 69 ) tech10_1 -2.09836 -44.6792 0 0.953125 0.828125 +( 2 -744 16 ) ( 2 -784 16 ) ( 2 -784 69 ) tech10_1 -44.0575 -44.6792 180 0.622194 -0.828125 +} +// brush 184 +{ +( 2 -744 16 ) ( 2 -744 65 ) ( 2 -784 65 ) tech10_1 -44.0575 20.898 180 0.622194 -0.765625 +( 63 -784 65 ) ( 63 -784 16 ) ( 2 -784 16 ) tech10_1 -2.09836 20.9218 0 0.953125 0.775153 +( 2 -784 16 ) ( 63 -784 16 ) ( 63 -744 16 ) tech10_1 -13.6 -17.9016 270 2.5 0.953125 +( 63 -744 65 ) ( 63 -784 65 ) ( 2 -784 65 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 63 -744 16 ) ( 63 -744 65 ) ( 2 -744 65 ) tech10_1 -2.09836 20.898 0 0.953125 0.765625 +( 63 -744 16 ) ( 63 -784 16 ) ( 63 -784 65 ) tech10_1 -44.0575 20.898 180 0.622194 -0.765625 +} +// brush 185 +{ +( 63 -744 120 ) ( 63 -744 169 ) ( 63 -784 169 ) tech10_1 -44.0575 -35.2652 180 0.622194 -0.765625 +( 124 -784 169 ) ( 124 -784 120 ) ( 63 -784 120 ) tech10_1 -2.09836 -36.9111 0 0.953125 0.775153 +( 63 -784 120 ) ( 124 -784 120 ) ( 124 -744 120 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 124 -744 169 ) ( 124 -784 169 ) ( 63 -784 169 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 124 -744 120 ) ( 124 -744 169 ) ( 63 -744 169 ) tech10_1 -2.09836 -35.2653 0 0.953125 0.765625 +( 124 -744 120 ) ( 124 -784 120 ) ( 124 -784 169 ) tech10_1 -44.0575 -35.2652 180 0.622194 -0.765625 +} +// brush 186 +{ +( -59 -744 120 ) ( -59 -744 169 ) ( -59 -784 169 ) tech10_1 -44.0575 -35.2652 180 0.622194 -0.765625 +( 2 -784 169 ) ( 2 -784 120 ) ( -59 -784 120 ) tech10_1 -2.09836 -36.9111 0 0.953125 0.775153 +( -59 -784 120 ) ( 2 -784 120 ) ( 2 -744 120 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 2 -744 169 ) ( 2 -784 169 ) ( -59 -784 169 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( 2 -744 120 ) ( 2 -744 169 ) ( -59 -744 169 ) tech10_1 -2.09836 -35.2653 0 0.953125 0.765625 +( 2 -744 120 ) ( 2 -784 120 ) ( 2 -784 169 ) tech10_1 -44.0575 -35.2652 180 0.622194 -0.765625 +} +// brush 187 +{ +( -120 -744 116 ) ( -120 -744 169 ) ( -120 -784 169 ) tech10_1 -44.0575 -51.9245 180 0.622194 -0.828125 +( -59 -784 169 ) ( -59 -784 116 ) ( -120 -784 116 ) tech10_1 -2.09836 -53.3656 0 0.953125 0.838431 +( -120 -784 116 ) ( -59 -784 116 ) ( -59 -744 116 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( -59 -744 169 ) ( -59 -784 169 ) ( -120 -784 169 ) tech10_1 -2.09836 -38.4 0 0.953125 0.625 +( -59 -744 116 ) ( -59 -744 169 ) ( -120 -744 169 ) tech10_1 -2.09836 -51.9245 0 0.953125 0.828125 +( -59 -744 116 ) ( -59 -784 116 ) ( -59 -784 169 ) tech10_1 -44.0575 -51.9245 180 0.622194 -0.828125 +} +} +// entity 1 +{ +"classname" "func_button" +"angle" "180" +"speed" "50" +"sounds" "1" +"wait" "1" +"lip" "4" +"targetname" "" +"buttonEffect" "2" +// brush 0 +{ +( -234 -240 56 ) ( -234 -240 88 ) ( -234 -272 88 ) door02_1 0 -39.6491 0 1 1 +( -226 -272 88 ) ( -226 -272 56 ) ( -234 -272 56 ) door02_1 2 -39.6491 0 1 1 +( -234 -272 56 ) ( -226 -272 56 ) ( -226 -240 56 ) door02_1 2 -44 0 1 1 +( -226 -240 88 ) ( -226 -272 88 ) ( -234 -272 88 ) door02_1 2 -44 0 1 1 +( -226 -240 56 ) ( -226 -240 88 ) ( -234 -240 88 ) door02_1 2 -39.6491 0 1 1 +( -226 -240 56 ) ( -226 -272 56 ) ( -226 -272 88 ) +0basebtn -16 -7.64912 0 1 1 +} +} +// entity 2 +{ +"classname" "trigger_damagethreshold" +"target" "t1" +"health" "7" +"angle" "180" +// brush 0 +{ +( -236.73874857417957 -566.40222299426955 19.944147273163303 ) ( -215.20111149713512 -556.97950677332074 148.09308787805861 ) ( -243.46926015998201 -608.80444598853933 13.536700242918531 ) rock5_2 0 -39.6491 0 1 1 +( -236.73874857417957 -566.40222299426955 19.944147273163303 ) ( -215.20111149713512 -542.8454324418974 116.05585272683484 ) ( -215.20111149713512 -556.97950677332074 148.09308787805861 ) rock5_2 0 -39.6491 0 1 1 +( -215.20111149713512 -542.8454324418974 13.536700242918531 ) ( -215.20111149713512 -542.8454324418974 116.05585272683484 ) ( -236.73874857417957 -566.40222299426955 19.944147273163303 ) rock5_2 0 -39.6491 0 1 1 +( -215.20111149713512 -556.97950677332074 148.09308787805861 ) ( -186.93296283428816 -599.3817297675904 128.87074678732438 ) ( -243.46926015998201 -608.80444598853933 13.536700242918531 ) rock5_2 111.809 26.8571 0 1 1 +( -215.20111149713512 -542.8454324418974 13.536700242918531 ) ( -182.2216047238137 -524 13.536700242918531 ) ( -215.20111149713512 -542.8454324418974 116.05585272683484 ) rock5_2 -14 -39.6491 0 1 1 +( -186.93296283428816 -599.3817297675904 128.87074678732438 ) ( -215.20111149713512 -629.96874999753936 2.3236679399901856 ) ( -243.46926015998201 -608.80444598853933 13.536700242918531 ) rock5_2 -14 -39.6491 0 1 1 +( -243.46926015998201 -608.80444598853933 13.536700242918531 ) ( -215.20111149713512 -542.8454324418974 13.536700242918531 ) ( -236.73874857417957 -566.40222299426955 19.944147273163303 ) rock5_2 -90.8703 -121.672 0 1 1 +( -215.20111149713512 -629.96874999753936 2.3236679399901856 ) ( -168.08753039239025 -614.10472385689172 -12.09308787806054 ) ( -243.46926015998201 -608.80444598853933 13.536700242918531 ) rock5_2 -13.2963 -127.984 0 1 1 +( -243.46926015998201 -608.80444598853933 13.536700242918531 ) ( -168.08753039239025 -614.10472385689172 -12.09308787806054 ) ( -215.20111149713512 -542.8454324418974 13.536700242918531 ) rock5_2 -13.2963 -127.984 0 1 1 +( -168.08753039239025 -614.10472385689172 -12.09308787806054 ) ( -144.53073984001787 -538.13407433142322 -5.6856408478157761 ) ( -215.20111149713512 -542.8454324418974 13.536700242918531 ) rock5_2 -13.2963 -127.984 0 1 1 +( -215.20111149713512 -542.8454324418974 13.536700242918531 ) ( -144.53073984001787 -538.13407433142322 -5.6856408478157761 ) ( -182.2216047238137 -524 13.536700242918531 ) rock5_2 -14 -12 0 1 1 +( -215.20111149713512 -556.97950677332074 148.09308787805861 ) ( -215.20111149713512 -542.8454324418974 116.05585272683484 ) ( -168.08753039239025 -542.8454324418974 116.05585272683484 ) rock5_2 -14 108 0 1 1 +( -215.20111149713512 -542.8454324418974 116.05585272683484 ) ( -182.2216047238137 -524 13.536700242918531 ) ( -168.08753039239025 -542.8454324418974 116.05585272683484 ) rock5_2 -14 -39.6491 0 1 1 +( -168.08753039239025 -556.97950677332074 128.87074678732438 ) ( -215.20111149713512 -556.97950677332074 148.09308787805861 ) ( -168.08753039239025 -542.8454324418974 116.05585272683484 ) rock5_2 -14 -12 0 1 1 +( -186.93296283428816 -599.3817297675904 128.87074678732438 ) ( -168.08753039239025 -614.10472385689172 -12.09308787806054 ) ( -215.20111149713512 -629.96874999753936 2.3236679399901856 ) rock5_2 -14 -39.6491 0 1 1 +( -168.08753039239025 -556.97950677332074 128.87074678732438 ) ( -186.93296283428816 -599.3817297675904 128.87074678732438 ) ( -215.20111149713512 -556.97950677332074 148.09308787805861 ) rock5_2 -14 -12 0 1 1 +( -182.2216047238137 -524 13.536700242918531 ) ( -144.53073984001787 -538.13407433142322 -5.6856408478157761 ) ( -168.08753039239025 -542.8454324418974 116.05585272683484 ) rock5_2 -81.0012 -7.64912 0 1 1 +( -168.08753039239025 -556.97950677332074 128.87074678732438 ) ( -168.08753039239025 -580.53629732569266 116.05585272683484 ) ( -186.93296283428816 -599.3817297675904 128.87074678732438 ) rock5_2 -14 -12 0 1 1 +( -186.93296283428816 -599.3817297675904 128.87074678732438 ) ( -168.08753039239025 -580.53629732569266 116.05585272683484 ) ( -168.08753039239025 -614.10472385689172 -12.09308787806054 ) rock5_2 6 -39.6491 0 1 1 +( -168.08753039239025 -614.10472385689172 -12.09308787806054 ) ( -168.08753039239025 -580.53629732569266 116.05585272683484 ) ( -144.53073984001787 -538.13407433142322 -5.6856408478157761 ) rock5_2 16 -7.64912 0 1 1 +( -168.08753039239025 -542.8454324418974 116.05585272683484 ) ( -144.53073984001787 -538.13407433142322 -5.6856408478157761 ) ( -168.08753039239025 -556.97950677332074 128.87074678732438 ) rock5_2 16 -7.64912 0 1 1 +( -144.53073984001787 -538.13407433142322 -5.6856408478157761 ) ( -168.08753039239025 -580.53629732569266 116.05585272683484 ) ( -168.08753039239025 -556.97950677332074 128.87074678732438 ) rock5_2 16 -7.64912 0 1 1 +} +} +// entity 3 +{ +"classname" "trigger_damagethreshold" +"angle" "180" +"target" "t2" +"health" "7" +// brush 0 +{ +( -225.1545675581026 -727.20111149713512 116.05585272683484 ) ( -244 -694.2216047238137 13.536700242918531 ) ( -225.1545675581026 -680.08753039239036 116.05585272683484 ) rock5_2 -14 -39.6491 0 1 1 +( -211.02049322667926 -727.20111149713512 148.09308787805861 ) ( -225.1545675581026 -727.20111149713512 116.05585272683484 ) ( -225.1545675581026 -680.08753039239036 116.05585272683484 ) rock5_2 -14 108 0 1 1 +( -244 -694.2216047238137 13.536700242918531 ) ( -229.86592566857678 -656.53073984001787 -5.6856408478157761 ) ( -225.1545675581026 -680.08753039239036 116.05585272683484 ) rock5_2 -81.0012 -7.64912 0 1 1 +( -225.1545675581026 -727.20111149713512 13.536700242918531 ) ( -244 -694.2216047238137 13.536700242918531 ) ( -225.1545675581026 -727.20111149713512 116.05585272683484 ) rock5_2 -14 -39.6491 0 1 1 +( -225.1545675581026 -727.20111149713512 13.536700242918531 ) ( -225.1545675581026 -727.20111149713512 116.05585272683484 ) ( -201.59777700573045 -748.73874857417957 19.944147273163303 ) rock5_2 -120 -39.6491 0 1 1 +( -211.02049322667926 -680.08753039239036 128.87074678732438 ) ( -211.02049322667926 -727.20111149713512 148.09308787805861 ) ( -225.1545675581026 -680.08753039239036 116.05585272683484 ) rock5_2 -6.00002 -12 0 1 1 +( -225.1545675581026 -727.20111149713512 13.536700242918531 ) ( -229.86592566857678 -656.53073984001787 -5.6856408478157761 ) ( -244 -694.2216047238137 13.536700242918531 ) rock5_2 -6 -12 0 1 1 +( -201.59777700573045 -748.73874857417957 19.944147273163303 ) ( -225.1545675581026 -727.20111149713512 116.05585272683484 ) ( -211.02049322667926 -727.20111149713512 148.09308787805861 ) rock5_2 -120 -39.6491 0 1 1 +( -159.19555401146067 -755.46926015998201 13.536700242918531 ) ( -225.1545675581026 -727.20111149713512 13.536700242918531 ) ( -201.59777700573045 -748.73874857417957 19.944147273163303 ) rock5_2 -82.8703 -121.672 0 1 1 +( -225.1545675581026 -680.08753039239036 116.05585272683484 ) ( -229.86592566857678 -656.53073984001787 -5.6856408478157761 ) ( -211.02049322667926 -680.08753039239036 128.87074678732438 ) rock5_2 -104 -7.64912 0 1 1 +( -153.89527614310828 -680.08753039239025 -12.09308787806054 ) ( -229.86592566857678 -656.53073984001787 -5.6856408478157761 ) ( -225.1545675581026 -727.20111149713512 13.536700242918531 ) rock5_2 -5.29633 -127.984 0 1 1 +( -159.19555401146067 -755.46926015998201 13.536700242918531 ) ( -153.89527614310828 -680.08753039239025 -12.09308787806054 ) ( -225.1545675581026 -727.20111149713512 13.536700242918531 ) rock5_2 -5.29633 -127.984 0 1 1 +( -201.59777700573045 -748.73874857417957 19.944147273163303 ) ( -211.02049322667926 -727.20111149713512 148.09308787805861 ) ( -159.19555401146067 -755.46926015998201 13.536700242918531 ) rock5_2 -120 -39.6491 0 1 1 +( -138.03125000246064 -727.20111149713512 2.3236679399901856 ) ( -153.89527614310828 -680.08753039239025 -12.09308787806054 ) ( -159.19555401146067 -755.46926015998201 13.536700242918531 ) rock5_2 -5.29633 -127.984 0 1 1 +( -229.86592566857678 -656.53073984001787 -5.6856408478157761 ) ( -187.46370267430734 -680.08753039239036 116.05585272683484 ) ( -211.02049322667926 -680.08753039239036 128.87074678732438 ) rock5_2 -104 -7.64912 0 1 1 +( -211.02049322667926 -680.08753039239036 128.87074678732438 ) ( -168.6182702324096 -698.93296283428822 128.87074678732438 ) ( -211.02049322667926 -727.20111149713512 148.09308787805861 ) rock5_2 -6 -12 0 1 1 +( -153.89527614310828 -680.08753039239025 -12.09308787806054 ) ( -187.46370267430734 -680.08753039239036 116.05585272683484 ) ( -229.86592566857678 -656.53073984001787 -5.6856408478157761 ) rock5_2 -104 -7.64912 0 1 1 +( -211.02049322667926 -680.08753039239036 128.87074678732438 ) ( -187.46370267430734 -680.08753039239036 116.05585272683484 ) ( -168.6182702324096 -698.93296283428822 128.87074678732438 ) rock5_2 -6 -12 0 1 1 +( -211.02049322667926 -727.20111149713512 148.09308787805861 ) ( -168.6182702324096 -698.93296283428822 128.87074678732438 ) ( -159.19555401146067 -755.46926015998201 13.536700242918531 ) rock5_2 -8.19051 26.8571 0 1 1 +( -168.6182702324096 -698.93296283428822 128.87074678732438 ) ( -187.46370267430734 -680.08753039239036 116.05585272683484 ) ( -153.89527614310828 -680.08753039239025 -12.09308787806054 ) rock5_2 -114 -39.6491 0 1 1 +( -168.6182702324096 -698.93296283428822 128.87074678732438 ) ( -138.03125000246064 -727.20111149713512 2.3236679399901856 ) ( -159.19555401146067 -755.46926015998201 13.536700242918531 ) rock5_2 -14 -39.6491 0 1 1 +( -168.6182702324096 -698.93296283428822 128.87074678732438 ) ( -153.89527614310828 -680.08753039239025 -12.09308787806054 ) ( -138.03125000246064 -727.20111149713512 2.3236679399901856 ) rock5_2 -14 -39.6491 0 1 1 +} +} +// entity 4 +{ +"health" "1" +"target" "" +"classname" "trigger_multiple" +// brush 0 +{ +( -68 1924 8289.0787552823658 ) ( -68 -6268 8289.0787552823658 ) ( -68 1924 -8094.9212447176333 ) trigger 56 33.0788 0 0.5 1 +( -8404 -644 8289.0787552823658 ) ( 7980 -644 8289.0787552823658 ) ( -8404 -644 -8094.9212447176333 ) trigger 20 33.0788 0 1 1 +( 7980 -6268 81.078755282366501 ) ( 7980 1924 81.078755282366501 ) ( -8404 -6268 81.078755282366501 ) trigger 20 -56 0 1 0.5 +( 7980 1924 113.0787552823665 ) ( 7980 -6268 113.0787552823665 ) ( -8404 -6268 113.0787552823665 ) trigger 20 -56 0 1 0.5 +( 7980 -640 8289.0787552823658 ) ( -8404 -640 8289.0787552823658 ) ( -8404 -640 -8094.9212447176333 ) trigger 20 33.0788 0 1 1 +( -36 -6268 8289.0787552823658 ) ( -36 1924 8289.0787552823658 ) ( -36 1924 -8094.9212447176333 ) trigger 56 33.0788 0 0.5 1 +} +} +// entity 5 +{ +"health" "1" +"target" "" +"classname" "trigger_multiple" +// brush 0 +{ +( 8 1960 8268 ) ( 8 -6232 8268 ) ( 8 1960 -8116 ) trigger -16 12 0 0.5 1 +( -8328 -608 8268 ) ( 8056 -608 8268 ) ( -8328 -608 -8116 ) trigger -56 12 0 1 1 +( 8056 -6232 60 ) ( 8056 1960 60 ) ( -8328 -6232 60 ) trigger -56 16 0 1 0.5 +( 8056 1960 92 ) ( 8056 -6232 92 ) ( -8328 -6232 92 ) trigger -56 16 0 1 0.5 +( 8056 -604 8268 ) ( -8328 -604 8268 ) ( -8328 -604 -8116 ) trigger -56 12 0 1 1 +( 40 -6232 8268 ) ( 40 1960 8268 ) ( 40 1960 -8116 ) trigger -16 12 0 0.5 1 +} +} +// entity 6 +{ +"health" "1" +"target" "" +"classname" "trigger_multiple" +// brush 0 +{ +( 60 1884 8276 ) ( 60 -6308 8276 ) ( 60 1884 -8108 ) trigger 8 20 0 0.5 1 +( -8276 -684 8276 ) ( 8108 -684 8276 ) ( -8276 -684 -8108 ) trigger -44 20 0 1 1 +( 8108 -6308 68 ) ( 8108 1884 68 ) ( -8276 -6308 68 ) trigger -44 -8 0 1 0.5 +( 8108 1884 100 ) ( 8108 -6308 100 ) ( -8276 -6308 100 ) trigger -44 -8 0 1 0.5 +( 8108 -680 8276 ) ( -8276 -680 8276 ) ( -8276 -680 -8108 ) trigger -44 20 0 1 1 +( 92 -6308 8276 ) ( 92 1884 8276 ) ( 92 1884 -8108 ) trigger 8 20 0 0.5 1 +} +} +// entity 7 +{ +"classname" "func_button" +"angle" "270" +"speed" "50" +"sounds" "1" +"wait" "1" +"lip" "4" +"targetname" "" +"target" "t3" +// brush 0 +{ +( 10 -992 57.078755282366501 ) ( 10 -992 89.078755282366501 ) ( 10 -1000 89.078755282366501 ) door02_1 0 -38.5704 0 1 1 +( 10 -1000 57.078755282366501 ) ( 10 -1000 89.078755282366501 ) ( 42 -1000 89.078755282366501 ) door02_1 -6 -38.5704 0 -1 1 +( 42 -1000 57.078755282366501 ) ( 42 -992 57.078755282366501 ) ( 10 -992 57.078755282366501 ) door02_1 0 58 90 1 1 +( 10 -992 89.078755282366501 ) ( 42 -992 89.078755282366501 ) ( 42 -1000 89.078755282366501 ) door02_1 0 58 90 1 1 +( 10 -992 57.078755282366501 ) ( 42 -992 57.078755282366501 ) ( 42 -992 89.078755282366501 ) +0basebtn -22 -6.57037 180 1 -1 +( 42 -992 89.078755282366501 ) ( 42 -992 57.078755282366501 ) ( 42 -1000 57.078755282366501 ) door02_1 0 -38.5704 0 1 1 +} +} +// entity 8 +{ +"health" "1" +"target" "" +"classname" "trigger_multiple" +// brush 0 +{ +( -542 2500 8305.0787552823658 ) ( -542 -5692 8305.0787552823658 ) ( -542 2500 -8078.9212447176333 ) trigger 8 49.0788 0 0.5 1 +( -8878 -68 8305.0787552823658 ) ( 7506 -68 8305.0787552823658 ) ( -8878 -68 -8078.9212447176333 ) trigger 34 49.0788 0 1 1 +( 7506 -5692 97.078755282366515 ) ( 7506 2500 97.078755282366515 ) ( -8878 -5692 97.078755282366515 ) trigger 34 -8 0 1 0.5 +( 7506 2500 129.0787552823665 ) ( 7506 -5692 129.0787552823665 ) ( -8878 -5692 129.0787552823665 ) trigger 34 -8 0 1 0.5 +( 7506 -64 8305.0787552823658 ) ( -8878 -64 8305.0787552823658 ) ( -8878 -64 -8078.9212447176333 ) trigger 34 49.0788 0 1 1 +( -510 -5692 8305.0787552823658 ) ( -510 2500 8305.0787552823658 ) ( -510 2500 -8078.9212447176333 ) trigger 8 49.0788 0 0.5 1 +} +} +// entity 9 +{ +"health" "1" +"target" "" +"classname" "trigger_multiple" +// brush 0 +{ +( -395 2356 8273.0787552823658 ) ( -395 -5836 8273.0787552823658 ) ( -395 2356 -8110.9212447176333 ) trigger 8 17.0788 0 0.5 1 +( -8731 -212 8273.0787552823658 ) ( 7653 -212 8273.0787552823658 ) ( -8731 -212 -8110.9212447176333 ) trigger -9 17.0788 0 1 1 +( 7653 -5836 65.078755282366501 ) ( 7653 2356 65.078755282366501 ) ( -8731 -5836 65.078755282366501 ) trigger -9 -8 0 1 0.5 +( 7653 2356 97.078755282366501 ) ( 7653 -5836 97.078755282366501 ) ( -8731 -5836 97.078755282366501 ) trigger -9 -8 0 1 0.5 +( 7653 -208 8273.0787552823658 ) ( -8731 -208 8273.0787552823658 ) ( -8731 -208 -8110.9212447176333 ) trigger -9 17.0788 0 1 1 +( -363 -5836 8273.0787552823658 ) ( -363 2356 8273.0787552823658 ) ( -363 2356 -8110.9212447176333 ) trigger 8 17.0788 0 0.5 1 +} +} +// entity 10 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "1" +// brush 0 +{ +( 96 120 16 ) ( 104 113 70 ) ( 104 103 70 ) tlight11 0 0 0 1 1 +( 112 103 70 ) ( 120 96 16 ) ( 96 96 16 ) tlight11 0 0 0 1 1 +( 96 96 16 ) ( 120 96 16 ) ( 120 120 16 ) tlight11 0 0 0 1 1 +( 112 113 70 ) ( 112 103 70 ) ( 104 103 70 ) tlight11 -3.71002 16 0 1 1 +( 120 120 16 ) ( 112 113 70 ) ( 104 113 70 ) tlight11 0 0 0 1 1 +( 120 120 16 ) ( 120 96 16 ) ( 112 103 70 ) tlight11 0 0 0 1 1 +} +} +// entity 11 +{ +"classname" "light" +"origin" "88 108 46" +"light" "200" +"_tb_group" "1" +} +// entity 12 +{ +"classname" "light" +"origin" "128 108 46" +"light" "200" +"_tb_group" "1" +} +// entity 13 +{ +"classname" "light" +"origin" "108 88 46" +"light" "200" +"_tb_group" "1" +} +// entity 14 +{ +"classname" "light" +"origin" "108 128 46" +"light" "200" +"_tb_group" "1" +} +// entity 15 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Player Start Slipgate" +"_tb_id" "2" +// brush 0 +{ +( -96 7920 8160 ) ( -96 -8464 8160 ) ( -96 -8464 -8224 ) slipbotsd 0 -48 90 -1 1 +( -7776 48 8160 ) ( 8608 48 8160 ) ( 8608 48 -8224 ) slipbotsd 0 -33 90 -1 1 +( -7776 7920 16 ) ( -7776 -8464 16 ) ( 8608 7920 16 ) +0slipbot 33 -48 180 1 1 +( -7776 -8464 32 ) ( -7776 7920 32 ) ( 8608 7920 32 ) +0slipbot 33 -48 180 1 1 +( 8608 112 8160 ) ( -7776 112 8160 ) ( 8608 112 -8224 ) slipbotsd 0 -33 90 -1 1 +( -32 -8464 8160 ) ( -32 7920 8160 ) ( -32 -8464 -8224 ) slipbotsd 0 -48 90 -1 1 +} +// brush 1 +{ +( -32 7920 8160 ) ( -32 -8464 8160 ) ( -32 -8464 -8224 ) slipside 0 0 180 1 -1 +( -7776 96 8160 ) ( 8608 96 8160 ) ( 8608 96 -8224 ) slipside 1 0 180 1 -1 +( -7776 7920 16 ) ( -7776 -8464 16 ) ( 8608 7920 16 ) slipside 0 1 270 1 1 +( -7776 -8464 32 ) ( -7776 7920 32 ) ( 8608 7920 32 ) sliplite 1 0 180 1 1 +( 8608 112 8160 ) ( -7776 112 8160 ) ( 8608 112 -8224 ) slipside 1 0 180 1 -1 +( -16 -8464 8160 ) ( -16 7920 8160 ) ( -16 -8464 -8224 ) slipside 0 0 180 1 -1 +} +// brush 2 +{ +( -112 7920 8160 ) ( -112 -8464 8160 ) ( -112 -8464 -8224 ) slipside 0 0 180 1 -1 +( -7776 96 8160 ) ( 8608 96 8160 ) ( 8608 96 -8224 ) slipside 1 0 180 1 -1 +( -7776 7920 16 ) ( -7776 -8464 16 ) ( 8608 7920 16 ) slipside 0 1 270 1 1 +( -7776 -8464 32 ) ( -7776 7920 32 ) ( 8608 7920 32 ) sliplite 1 0 180 1 1 +( 8608 112 8160 ) ( -7776 112 8160 ) ( 8608 112 -8224 ) slipside 1 0 180 1 -1 +( -96 -8464 8160 ) ( -96 7920 8160 ) ( -96 -8464 -8224 ) slipside 0 0 180 1 -1 +} +// brush 3 +{ +( -112 7920 8160 ) ( -112 -8464 8160 ) ( -112 -8464 -8224 ) slipside 0 0 180 1 -1 +( -7776 48 8160 ) ( 8608 48 8160 ) ( 8608 48 -8224 ) slipside 1 0 180 1 -1 +( -7776 7920 16 ) ( -7776 -8464 16 ) ( 8608 7920 16 ) slipside 0 1 270 1 1 +( -7776 -8464 32 ) ( -7776 7920 32 ) ( 8608 7920 32 ) sliplite 1 0 180 1 1 +( 8608 64 8160 ) ( -7776 64 8160 ) ( 8608 64 -8224 ) slipside 1 0 180 1 -1 +( -96 -8464 8160 ) ( -96 7920 8160 ) ( -96 -8464 -8224 ) slipside 0 0 180 1 -1 +} +// brush 4 +{ +( -32 7920 8160 ) ( -32 -8464 8160 ) ( -32 -8464 -8224 ) slipside 0 0 180 1 -1 +( -7776 48 8160 ) ( 8608 48 8160 ) ( 8608 48 -8224 ) slipside 1 0 180 1 -1 +( -7776 7920 16 ) ( -7776 -8464 16 ) ( 8608 7920 16 ) slipside 0 1 270 1 1 +( -7776 -8464 32 ) ( -7776 7920 32 ) ( 8608 7920 32 ) sliplite 1 0 180 1 1 +( 8608 64 8160 ) ( -7776 64 8160 ) ( 8608 64 -8224 ) slipside 1 0 180 1 -1 +( -16 -8464 8160 ) ( -16 7920 8160 ) ( -16 -8464 -8224 ) slipside 0 0 180 1 -1 +} +} +// entity 16 +{ +"angle" "270" +"origin" "-64 80 56" +"classname" "info_player_start" +"_tb_group" "2" +} +// entity 17 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "3" +// brush 0 +{ +( -248 120 16 ) ( -240 113 70 ) ( -240 103 70 ) tlight11 0 0 0 1 1 +( -232 103 70 ) ( -224 96 16 ) ( -248 96 16 ) tlight11 8 0 0 1 1 +( -248 96 16 ) ( -224 96 16 ) ( -224 120 16 ) tlight11 8 0 0 1 1 +( -232 113 70 ) ( -232 103 70 ) ( -240 103 70 ) tlight11 4.28998 16 0 1 1 +( -224 120 16 ) ( -232 113 70 ) ( -240 113 70 ) tlight11 8 0 0 1 1 +( -224 120 16 ) ( -224 96 16 ) ( -232 103 70 ) tlight11 0 0 0 1 1 +} +} +// entity 18 +{ +"classname" "light" +"origin" "-216 108 46" +"light" "200" +"_tb_group" "3" +} +// entity 19 +{ +"classname" "light" +"origin" "-236 88 46" +"light" "200" +"_tb_group" "3" +} +// entity 20 +{ +"classname" "light" +"origin" "-236 128 46" +"light" "200" +"_tb_group" "3" +} +// entity 21 +{ +"classname" "light" +"origin" "-88 -112 136" +"light" "200" +} +// entity 22 +{ +"classname" "light" +"origin" "88 -112 136" +"light" "200" +} +// entity 23 +{ +"classname" "light" +"origin" "0 -112 136" +"light" "200" +} +// entity 24 +{ +"classname" "func_worldtext_banner" +"origin" "0 -121 96" +"angle" "90" +"worldtext" "--------------\n \nWelcome to Quake VR!\n \n--------------$Please set up your\npreferred controller\nbindings in the\nSteamVR dashboard.$Once you're done,\nlook to your right." +"worldtext_halign" "1" +"speed" "0.085" +} +// entity 25 +{ +"light" "250" +"origin" "-64 -8 148" +"classname" "light" +"angle" "0" +} +// entity 26 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "4" +// brush 0 +{ +( -128 -126 144 ) ( -136 -126 152 ) ( -136 -134 152 ) c-white 0 0 0 1 1 +( -136 -134 152 ) ( -136 -126 152 ) ( -128 -126 160 ) c-white 0 0 0 1 1 +( -128 -134 160 ) ( -128 -134 144 ) ( -136 -134 152 ) c-white 0 0 0 1 1 +( -128 -126 160 ) ( -136 -126 152 ) ( -128 -126 144 ) c-white 0 0 0 1 1 +( -128 -126 160 ) ( -128 -126 144 ) ( -128 -134 144 ) c-white 0 0 0 1 1 +} +// brush 1 +{ +( -128 -126 148 ) ( -128 -126 156 ) ( -128 -134 156 ) c-white 0 0 0 1 1 +( -120 -134 156 ) ( -120 -134 148 ) ( -128 -134 148 ) c-white 0 0 0 1 1 +( -128 -134 148 ) ( -120 -134 148 ) ( -120 -126 148 ) c-white 0 0 0 1 1 +( -120 -126 156 ) ( -120 -134 156 ) ( -128 -134 156 ) c-white 0 0 0 1 1 +( -120 -126 148 ) ( -120 -126 156 ) ( -128 -126 156 ) c-white 0 0 0 1 1 +( -120 -126 148 ) ( -120 -134 148 ) ( -120 -134 156 ) c-white 0 0 0 1 1 +} +} +// entity 27 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "5" +// brush 0 +{ +( -128 -126 24 ) ( -136 -126 32 ) ( -136 -134 32 ) c-white 0 0 0 1 1 +( -136 -134 32 ) ( -136 -126 32 ) ( -128 -126 40 ) c-white 0 0 0 1 1 +( -128 -134 40 ) ( -128 -134 24 ) ( -136 -134 32 ) c-white 0 0 0 1 1 +( -128 -126 40 ) ( -136 -126 32 ) ( -128 -126 24 ) c-white 0 0 0 1 1 +( -128 -126 40 ) ( -128 -126 24 ) ( -128 -134 24 ) c-white 0 0 0 1 1 +} +// brush 1 +{ +( -128 -126 28 ) ( -128 -126 36 ) ( -128 -134 36 ) c-white 0 0 0 1 1 +( -120 -134 36 ) ( -120 -134 28 ) ( -128 -134 28 ) c-white 0 0 0 1 1 +( -128 -134 28 ) ( -120 -134 28 ) ( -120 -126 28 ) c-white 0 0 0 1 1 +( -120 -126 36 ) ( -120 -134 36 ) ( -128 -134 36 ) c-white 0 0 0 1 1 +( -120 -126 28 ) ( -120 -126 36 ) ( -128 -126 36 ) c-white 0 0 0 1 1 +( -120 -126 28 ) ( -120 -134 28 ) ( -120 -134 36 ) c-white 0 0 0 1 1 +} +} +// entity 28 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "6" +// brush 0 +{ +( -234 -126 24 ) ( -234 -126 40 ) ( -234 -134 40 ) c-white 0 0 0 1 1 +( -234 -134 24 ) ( -234 -134 40 ) ( -226 -134 32 ) c-white -6 0 0 1 1 +( -234 -126 24 ) ( -226 -126 32 ) ( -234 -126 40 ) c-white -6 0 0 1 1 +( -226 -134 32 ) ( -226 -126 32 ) ( -234 -126 24 ) c-white -6 0 0 1 1 +( -234 -126 40 ) ( -226 -126 32 ) ( -226 -134 32 ) c-white -6 0 0 1 1 +} +// brush 1 +{ +( -242 -126 36 ) ( -242 -134 36 ) ( -242 -134 28 ) c-white 0 0 0 1 1 +( -242 -134 28 ) ( -242 -134 36 ) ( -234 -134 36 ) c-white -6 0 0 1 1 +( -242 -126 28 ) ( -242 -134 28 ) ( -234 -134 28 ) c-white -6 0 0 1 1 +( -234 -134 36 ) ( -242 -134 36 ) ( -242 -126 36 ) c-white -6 0 0 1 1 +( -242 -126 36 ) ( -242 -126 28 ) ( -234 -126 28 ) c-white -6 0 0 1 1 +( -234 -126 36 ) ( -234 -126 28 ) ( -234 -134 28 ) c-white 0 0 0 1 1 +} +} +// entity 29 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "7" +// brush 0 +{ +( -234 -126 144 ) ( -234 -126 160 ) ( -234 -134 160 ) c-white 0 0 0 1 1 +( -234 -134 144 ) ( -234 -134 160 ) ( -226 -134 152 ) c-white -6 0 0 1 1 +( -234 -126 144 ) ( -226 -126 152 ) ( -234 -126 160 ) c-white -6 0 0 1 1 +( -226 -134 152 ) ( -226 -126 152 ) ( -234 -126 144 ) c-white -6 0 0 1 1 +( -234 -126 160 ) ( -226 -126 152 ) ( -226 -134 152 ) c-white -6 0 0 1 1 +} +// brush 1 +{ +( -242 -126 156 ) ( -242 -134 156 ) ( -242 -134 148 ) c-white 0 0 0 1 1 +( -242 -134 148 ) ( -242 -134 156 ) ( -234 -134 156 ) c-white -6 0 0 1 1 +( -242 -126 148 ) ( -242 -134 148 ) ( -234 -134 148 ) c-white -6 0 0 1 1 +( -234 -134 156 ) ( -242 -134 156 ) ( -242 -126 156 ) c-white -6 0 0 1 1 +( -242 -126 156 ) ( -242 -126 148 ) ( -234 -126 148 ) c-white -6 0 0 1 1 +( -234 -126 156 ) ( -234 -126 148 ) ( -234 -134 148 ) c-white 0 0 0 1 1 +} +} +// entity 30 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "8" +// brush 0 +{ +( -247 94 66 ) ( -247 94 66.9375 ) ( -247 92.53125 66 ) black 0 6.4 180 1.46875 -0.9375 +( -245 -94 126 ) ( -245 -94 126.93750000000001 ) ( -244.75 -94 126 ) black -12 6.4 0 0.25 0.9375 +( -247 94 66 ) ( -247 92.53125 66 ) ( -246.75 94 66 ) black 0 12 270 1.46875 0.25 +( -245 -94 126 ) ( -244.75 -94 126 ) ( -245 -95.468749999999943 126 ) black 0 12 270 1.46875 0.25 +( -247 94 66 ) ( -246.75 94 66 ) ( -247 94 66.9375 ) black -12 6.4 0 0.25 0.9375 +( -245 -94 126 ) ( -245 -95.468749999999943 126 ) ( -245 -94 126.93750000000001 ) black 0 6.4 180 1.46875 -0.9375 +} +// brush 1 +{ +( -251 -96 152 ) ( -251 -96 136 ) ( -251 96 136 ) tlight02 63.9999 8 180 0.5 -1 +( -249 -96 136 ) ( -251 -96 136 ) ( -251 -96 152 ) tlight02 13 8 180 1 -1 +( -251 96 136 ) ( -251 -96 136 ) ( -249 -96 136 ) tlight02 13 -24 180 1 0.5 +( -243 -96 152 ) ( -251 -96 152 ) ( -251 96 152 ) tlight02 40 23.0002 270 1.5 0.333333 +( -249 96 136 ) ( -243 96 152 ) ( -251 96 152 ) tlight02 13 8 180 1 -1 +( -249 -96 136 ) ( -243 -96 152 ) ( -243 96 152 ) tlight02 47.5959 42.0723 180 0.664801 -0.931046 +} +// brush 2 +{ +( -247 96 126 ) ( -247 96 126.03125 ) ( -247 94.499999999999943 126 ) tech02_1 61 0 180 1.5 -1 +( -245 -96 128 ) ( -245 -96 128.03125 ) ( -244.75 -96 128 ) tech02_1 47 0 0 1 1 +( -247 96 126 ) ( -247 94.499999999999943 126 ) ( -246.75 96 126 ) tech02_1 61 -47 270 1.5 1 +( -245 -96 128 ) ( -244.75 -96 128 ) ( -245 -97.500000000000028 128 ) tech02_1 61 -47 270 1.5 1 +( -247 96 126 ) ( -246.75 96 126 ) ( -247 96 126.03125 ) tech02_1 47 0 0 1 1 +( -245 -96 128 ) ( -245 -97.500000000000028 128 ) ( -245 -96 128.03125 ) tech02_1 23.1004 41.2452 180 1.65804 -0.163584 +} +// brush 3 +{ +( -247 -96 126 ) ( -247 -96 66 ) ( -247 -94 66 ) tech02_1 -35 42.6667 90 0.2 -0.3 +( -245 -96 66 ) ( -247 -96 66 ) ( -247 -96 126 ) tech02_1 -35 -26.0001 90 0.2 0.3 +( -247 -94 66 ) ( -247 -96 66 ) ( -245 -96 66 ) tech02_1 27 42.6667 0 0.2 0.3 +( -245 -96 126 ) ( -247 -96 126 ) ( -247 -94 126 ) tech02_1 27 42.6667 0 0.2 0.3 +( -245 -94 66 ) ( -245 -94 126 ) ( -247 -94 126 ) tech02_1 -35 -26.0001 90 0.2 0.3 +( -245 -96 66 ) ( -245 -96 126 ) ( -245 -94 126 ) tech02_1 -36 33.7539 90 0.2 -0.241259 +} +// brush 4 +{ +( -247 96 64 ) ( -247 96 64.03125 ) ( -247 94.499999999999943 64 ) tech02_1 61 0 180 1.5 -1 +( -245 -96 66 ) ( -245 -96 66.03125 ) ( -244.75 -96 66 ) tech02_1 47 0 0 1 1 +( -247 96 64 ) ( -247 94.499999999999943 64 ) ( -246.75 96 64 ) tech02_1 61 -47 270 1.5 1 +( -245 -96 66 ) ( -244.75 -96 66 ) ( -245 -97.500000000000028 66 ) tech02_1 61 -47 270 1.5 1 +( -247 96 64 ) ( -246.75 96 64 ) ( -247 96 64.03125 ) tech02_1 47 0 0 1 1 +( -245 -96 66 ) ( -245 -97.500000000000028 66 ) ( -245 -96 66.03125 ) tech02_1 51 49.3299 180 1.5 -0.248708 +} +// brush 5 +{ +( -247 94 126 ) ( -247 94 66 ) ( -247 96 66 ) tech02_1 -35 0 90 0.2 -0.3 +( -245 94 66 ) ( -247 94 66 ) ( -247 94 126 ) tech02_1 -35 -26.0001 90 0.2 0.3 +( -247 96 66 ) ( -247 94 66 ) ( -245 94 66 ) tech02_1 27 0 0 0.2 0.3 +( -245 94 126 ) ( -247 94 126 ) ( -247 96 126 ) tech02_1 27 0 0 0.2 0.3 +( -245 96 66 ) ( -245 96 126 ) ( -247 96 126 ) tech02_1 -35 -26.0001 90 0.2 0.3 +( -245 94 66 ) ( -245 94 126 ) ( -245 96 126 ) tech02_1 -38 26.3111 90 0.2 -0.202399 +} +// brush 6 +{ +( -251 96 64 ) ( -251 96 65 ) ( -251 94.499999999999943 64 ) tech01_1 48 0 180 1.5 -1 +( -247 -96 128 ) ( -247 -96 129 ) ( -246.5 -96 128 ) tech01_1 -9 0 0 1 1 +( -251 96 64 ) ( -251 94.499999999999943 64 ) ( -250.5 96 64 ) tech01_1 48 9 270 1.5 1 +( -247 -96 128 ) ( -246.5 -96 128 ) ( -247 -97.5 128 ) tech01_1 48 9 270 1.5 1 +( -251 96 64 ) ( -250.5 96 64 ) ( -251 96 65 ) tech01_1 -9 0 0 1 1 +( -247 -96 128 ) ( -247 -97.5 128 ) ( -247 -96 129 ) tech01_1 48 0 180 1.5 -1 +} +} +// entity 31 +{ +"classname" "light" +"origin" "-235 88 136" +"light" "200" +"angle" "270" +"_tb_group" "8" +} +// entity 32 +{ +"classname" "light" +"origin" "-235 0 136" +"light" "200" +"angle" "270" +"_tb_group" "8" +} +// entity 33 +{ +"classname" "light" +"origin" "-235 -88 136" +"light" "200" +"angle" "270" +"_tb_group" "8" +} +// entity 34 +{ +"classname" "func_worldtext_banner" +"origin" "-244 0 96" +"angle" "0" +"worldtext" "There are two possible\nlocomotion options.$Smooth locomotion is\nthe recommended option.$You can also bind a\nbutton to 'Teleport' \nin the SteamVR\nbindings.$You can customize\nlocomotion settings\nfrom the 'Quake VR\nsettings' menu." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "8" +} +// entity 35 +{ +"light" "250" +"origin" "-64 -280 148" +"classname" "light" +"angle" "0" +} +// entity 36 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "9" +// brush 0 +{ +( 112 -390 24 ) ( 104 -390 32 ) ( 104 -398 32 ) c-white 0 -8 0 1 1 +( 104 -398 32 ) ( 104 -390 32 ) ( 112 -390 40 ) c-white 0 -8 0 1 1 +( 112 -398 40 ) ( 112 -398 24 ) ( 104 -398 32 ) c-white 0 0 0 1 1 +( 112 -390 40 ) ( 104 -390 32 ) ( 112 -390 24 ) c-white 0 0 0 1 1 +( 112 -390 40 ) ( 112 -390 24 ) ( 112 -398 24 ) c-white 8 0 0 1 1 +} +// brush 1 +{ +( 112 -390 28 ) ( 112 -390 36 ) ( 112 -398 36 ) c-white 8 0 0 1 1 +( 120 -398 36 ) ( 120 -398 28 ) ( 112 -398 28 ) c-white 0 0 0 1 1 +( 112 -398 28 ) ( 120 -398 28 ) ( 120 -390 28 ) c-white 0 -8 0 1 1 +( 120 -390 36 ) ( 120 -398 36 ) ( 112 -398 36 ) c-white 0 -8 0 1 1 +( 120 -390 28 ) ( 120 -390 36 ) ( 112 -390 36 ) c-white 0 0 0 1 1 +( 120 -390 28 ) ( 120 -398 28 ) ( 120 -398 36 ) c-white 8 0 0 1 1 +} +} +// entity 37 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "10" +// brush 0 +{ +( 8 -390 24 ) ( 8 -390 40 ) ( 8 -398 40 ) c-white 8 0 0 1 1 +( 8 -398 24 ) ( 8 -398 40 ) ( 16 -398 32 ) c-white 8 0 0 1 1 +( 8 -390 24 ) ( 16 -390 32 ) ( 8 -390 40 ) c-white 8 0 0 1 1 +( 16 -398 32 ) ( 16 -390 32 ) ( 8 -390 24 ) c-white 8 -8 0 1 1 +( 8 -390 40 ) ( 16 -390 32 ) ( 16 -398 32 ) c-white 8 -8 0 1 1 +} +// brush 1 +{ +( 0 -390 36 ) ( 0 -398 36 ) ( 0 -398 28 ) c-white 8 0 0 1 1 +( 0 -398 28 ) ( 0 -398 36 ) ( 8 -398 36 ) c-white 8 0 0 1 1 +( 0 -390 28 ) ( 0 -398 28 ) ( 8 -398 28 ) c-white 8 -8 0 1 1 +( 8 -398 36 ) ( 0 -398 36 ) ( 0 -390 36 ) c-white 8 -8 0 1 1 +( 0 -390 36 ) ( 0 -390 28 ) ( 8 -390 28 ) c-white 8 0 0 1 1 +( 8 -390 36 ) ( 8 -390 28 ) ( 8 -398 28 ) c-white 8 0 0 1 1 +} +} +// entity 38 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "11" +// brush 0 +{ +( 112 -390 144 ) ( 104 -390 152 ) ( 104 -398 152 ) c-white 0 -8 0 1 1 +( 104 -398 152 ) ( 104 -390 152 ) ( 112 -390 160 ) c-white 0 -8 0 1 1 +( 112 -398 160 ) ( 112 -398 144 ) ( 104 -398 152 ) c-white 0 0 0 1 1 +( 112 -390 160 ) ( 104 -390 152 ) ( 112 -390 144 ) c-white 0 0 0 1 1 +( 112 -390 160 ) ( 112 -390 144 ) ( 112 -398 144 ) c-white 8 0 0 1 1 +} +// brush 1 +{ +( 112 -390 148 ) ( 112 -390 156 ) ( 112 -398 156 ) c-white 8 0 0 1 1 +( 120 -398 156 ) ( 120 -398 148 ) ( 112 -398 148 ) c-white 0 0 0 1 1 +( 112 -398 148 ) ( 120 -398 148 ) ( 120 -390 148 ) c-white 0 -8 0 1 1 +( 120 -390 156 ) ( 120 -398 156 ) ( 112 -398 156 ) c-white 0 -8 0 1 1 +( 120 -390 148 ) ( 120 -390 156 ) ( 112 -390 156 ) c-white 0 0 0 1 1 +( 120 -390 148 ) ( 120 -398 148 ) ( 120 -398 156 ) c-white 8 0 0 1 1 +} +} +// entity 39 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "12" +// brush 0 +{ +( 8 -390 144 ) ( 8 -390 160 ) ( 8 -398 160 ) c-white 8 0 0 1 1 +( 8 -398 144 ) ( 8 -398 160 ) ( 16 -398 152 ) c-white 8 0 0 1 1 +( 8 -390 144 ) ( 16 -390 152 ) ( 8 -390 160 ) c-white 8 0 0 1 1 +( 16 -398 152 ) ( 16 -390 152 ) ( 8 -390 144 ) c-white 8 -8 0 1 1 +( 8 -390 160 ) ( 16 -390 152 ) ( 16 -398 152 ) c-white 8 -8 0 1 1 +} +// brush 1 +{ +( 0 -390 156 ) ( 0 -398 156 ) ( 0 -398 148 ) c-white 8 0 0 1 1 +( 0 -398 148 ) ( 0 -398 156 ) ( 8 -398 156 ) c-white 8 0 0 1 1 +( 0 -390 148 ) ( 0 -398 148 ) ( 8 -398 148 ) c-white 8 -8 0 1 1 +( 8 -398 156 ) ( 0 -398 156 ) ( 0 -390 156 ) c-white 8 -8 0 1 1 +( 0 -390 156 ) ( 0 -390 148 ) ( 8 -390 148 ) c-white 8 0 0 1 1 +( 8 -390 156 ) ( 8 -390 148 ) ( 8 -398 148 ) c-white 8 0 0 1 1 +} +} +// entity 40 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "13" +// brush 0 +{ +( 96 -144 16 ) ( 104 -151 70 ) ( 104 -161 70 ) tlight11 8 0 0 1 1 +( 112 -161 70 ) ( 120 -168 16 ) ( 96 -168 16 ) tlight11 0 0 0 1 1 +( 96 -168 16 ) ( 120 -168 16 ) ( 120 -144 16 ) tlight11 0 -8 0 1 1 +( 112 -151 70 ) ( 112 -161 70 ) ( 104 -161 70 ) tlight11 -3.71002 8 0 1 1 +( 120 -144 16 ) ( 112 -151 70 ) ( 104 -151 70 ) tlight11 0 0 0 1 1 +( 120 -144 16 ) ( 120 -168 16 ) ( 112 -161 70 ) tlight11 8 0 0 1 1 +} +} +// entity 41 +{ +"classname" "light" +"origin" "88 -156 46" +"light" "200" +"_tb_group" "13" +} +// entity 42 +{ +"classname" "light" +"origin" "128 -156 46" +"light" "200" +"_tb_group" "13" +} +// entity 43 +{ +"classname" "light" +"origin" "108 -176 46" +"light" "200" +"_tb_group" "13" +} +// entity 44 +{ +"classname" "light" +"origin" "108 -136 46" +"light" "200" +"_tb_group" "13" +} +// entity 45 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "14" +// brush 0 +{ +( -244 -360 16 ) ( -236 -367 70 ) ( -236 -377 70 ) tlight11 0 0 0 1 1 +( -228 -377 70 ) ( -220 -384 16 ) ( -244 -384 16 ) tlight11 4 0 0 1 1 +( -244 -384 16 ) ( -220 -384 16 ) ( -220 -360 16 ) tlight11 4 -32 0 1 1 +( -228 -367 70 ) ( -228 -377 70 ) ( -236 -377 70 ) tlight11 0.289978 -16 0 1 1 +( -220 -360 16 ) ( -228 -367 70 ) ( -236 -367 70 ) tlight11 4 0 0 1 1 +( -220 -360 16 ) ( -220 -384 16 ) ( -228 -377 70 ) tlight11 0 0 0 1 1 +} +} +// entity 46 +{ +"classname" "light" +"origin" "-252 -372 46" +"light" "200" +"_tb_group" "14" +} +// entity 47 +{ +"classname" "light" +"origin" "-212 -372 46" +"light" "200" +"_tb_group" "14" +} +// entity 48 +{ +"classname" "light" +"origin" "-232 -392 46" +"light" "200" +"_tb_group" "14" +} +// entity 49 +{ +"classname" "light" +"origin" "-232 -352 46" +"light" "200" +"_tb_group" "14" +} +// entity 50 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "15" +// brush 0 +{ +( -257 -207.49999999999883 64 ) ( -257 -207.49999999999883 80 ) ( -257 -215.49999999999883 72 ) c-white 0.5 8 180 1 -1 +( -257 -215.49999999999883 72 ) ( -249 -215.49999999999883 72 ) ( -249 -207.49999999999883 64 ) c-white 0.5 5 270 1 1 +( -249 -207.49999999999883 80 ) ( -249 -215.49999999999883 72 ) ( -257 -215.49999999999883 72 ) c-white 0.5 5 270 1 1 +( -249 -207.49999999999883 64 ) ( -249 -207.49999999999883 80 ) ( -257 -207.49999999999883 80 ) c-white -5 8 0 1 1 +( -249 -207.49999999999883 64 ) ( -249 -215.49999999999883 72 ) ( -249 -207.49999999999883 80 ) c-white 0.5 8 180 1 -1 +} +// brush 1 +{ +( -257 -199.49999999999883 68 ) ( -257 -199.49999999999883 76 ) ( -257 -207.49999999999883 76 ) c-white 0.5 8 180 1 -1 +( -249 -207.49999999999883 76 ) ( -249 -207.49999999999883 68 ) ( -257 -207.49999999999883 68 ) c-white -5 8 0 1 1 +( -249 -199.49999999999883 68 ) ( -257 -199.49999999999883 68 ) ( -257 -207.49999999999883 68 ) c-white 0.5 5 270 1 1 +( -257 -207.49999999999883 76 ) ( -257 -199.49999999999883 76 ) ( -249 -199.49999999999883 76 ) c-white 0.5 5 270 1 1 +( -249 -199.49999999999883 76 ) ( -257 -199.49999999999883 76 ) ( -257 -199.49999999999883 68 ) c-white -5 8 0 1 1 +( -249 -199.49999999999883 76 ) ( -249 -199.49999999999883 68 ) ( -249 -207.49999999999883 68 ) c-white 0.5 8 180 1 -1 +} +} +// entity 51 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "16" +// brush 0 +{ +( -257 -304.50000000000114 80 ) ( -257 -304.50000000000114 64 ) ( -257 -296.50000000000114 72 ) c-white 0.5 -8 0 1 -1 +( -249 -304.50000000000114 80 ) ( -249 -304.50000000000114 64 ) ( -257 -304.50000000000114 64 ) c-white -5 -8 0 1 -1 +( -249 -304.50000000000114 64 ) ( -249 -296.50000000000114 72 ) ( -257 -296.50000000000114 72 ) c-white 0.5 5 90 1 -1 +( -257 -296.50000000000114 72 ) ( -249 -296.50000000000114 72 ) ( -249 -304.50000000000114 80 ) c-white 0.5 5 90 1 -1 +( -249 -304.50000000000114 80 ) ( -249 -296.50000000000114 72 ) ( -249 -304.50000000000114 64 ) c-white 0.5 -8 0 1 -1 +} +// brush 1 +{ +( -257 -312.50000000000114 76 ) ( -257 -312.50000000000114 68 ) ( -257 -304.50000000000114 68 ) c-white 0.5 -8 0 1 -1 +( -249 -312.50000000000114 68 ) ( -257 -312.50000000000114 68 ) ( -257 -312.50000000000114 76 ) c-white -5 -8 0 1 -1 +( -257 -304.50000000000114 68 ) ( -257 -312.50000000000114 68 ) ( -249 -312.50000000000114 68 ) c-white 0.5 5 90 1 -1 +( -249 -312.50000000000114 76 ) ( -257 -312.50000000000114 76 ) ( -257 -304.50000000000114 76 ) c-white 0.5 5 90 1 -1 +( -249 -304.50000000000114 68 ) ( -249 -304.50000000000114 76 ) ( -257 -304.50000000000114 76 ) c-white -5 -8 0 1 -1 +( -249 -312.50000000000114 68 ) ( -249 -312.50000000000114 76 ) ( -249 -304.50000000000114 76 ) c-white 0.5 -8 0 1 -1 +} +} +// entity 52 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "17" +// brush 0 +{ +( -208 -387 65 ) ( -208 -386.74999999999994 65 ) ( -208 -387 65.9375 ) black -12 5.33334 0 0.25 0.9375 +( -208 -387 65 ) ( -208 -387 65.9375 ) ( -206.53125 -387 65 ) black 13.617 5.33334 0 1.46875 0.9375 +( -208 -387 65 ) ( -206.53125 -387 65 ) ( -208 -386.74999999999994 65 ) black 13.617 12 0 1.46875 0.25 +( -20 -385 125 ) ( -20 -384.75 125 ) ( -18.53125 -385 125 ) black 13.617 12 0 1.46875 0.25 +( -20 -385 125 ) ( -18.53125 -385 125 ) ( -20 -385 125.93750000000001 ) black 13.617 5.33334 0 1.46875 0.9375 +( -20 -385 125 ) ( -20 -385 125.93750000000001 ) ( -20 -384.75 125 ) black -12 5.33334 0 0.25 0.9375 +} +// brush 1 +{ +( -210 -389 135 ) ( -210 -383 151 ) ( -210 -391 151 ) tlight02 1 7 180 1 -1 +( -18 -391 151 ) ( -18 -391 135 ) ( -210 -391 135 ) tlight02 35.9995 7 0 0.5 1 +( -210 -391 135 ) ( -18 -391 135 ) ( -18 -389 135 ) tlight02 1 -59.9994 270 1 0.5 +( -18 -383 151 ) ( -18 -391 151 ) ( -210 -391 151 ) tlight02 52 51 0 1.5 0.333333 +( -18 -389 135 ) ( -18 -383 151 ) ( -210 -383 151 ) tlight02 27.0757 40.9983 0 0.664801 0.931046 +( -18 -389 135 ) ( -18 -391 135 ) ( -18 -391 151 ) tlight02 1 7 180 1 -1 +} +// brush 2 +{ +( -210 -387 125 ) ( -210 -386.74999999999994 125 ) ( -210 -387 125.03125 ) tech02_1 -5 63 0 1 1 +( -210 -387 125 ) ( -210 -387 125.03125 ) ( -208.49999999999994 -387 125 ) tech02_1 8.99999 63 0 1.5 1 +( -210 -387 125 ) ( -208.49999999999994 -387 125 ) ( -210 -386.74999999999994 125 ) tech02_1 8.99999 5 0 1.5 1 +( -18 -385 127 ) ( -18 -384.75 127 ) ( -16.5 -385 127 ) tech02_1 8.99999 5 0 1.5 1 +( -18 -385 127 ) ( -16.5 -385 127 ) ( -18 -385 127.03125 ) tech02_1 27.8562 35.132 0 1.65804 0.163584 +( -18 -385 127 ) ( -18 -385 127.03125 ) ( -18 -384.75 127 ) tech02_1 -5 63 0 1 1 +} +// brush 3 +{ +( -20 -385 65 ) ( -20 -385 125 ) ( -20 -387 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +( -18 -387 125 ) ( -18 -387 65 ) ( -20 -387 65 ) tech02_1 -30 38.6665 90 0.2 0.3 +( -20 -387 65 ) ( -18 -387 65 ) ( -18 -385 65 ) tech02_1 -41 38.6665 90 0.2 0.3 +( -18 -385 125 ) ( -18 -387 125 ) ( -20 -387 125 ) tech02_1 -41 38.6665 90 0.2 0.3 +( -18 -385 65 ) ( -18 -385 125 ) ( -20 -385 125 ) tech02_1 -31 -5.7246 90 0.2 0.241259 +( -18 -385 65 ) ( -18 -387 65 ) ( -18 -387 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +} +// brush 4 +{ +( -210 -387 63 ) ( -210 -386.74999999999994 63 ) ( -210 -387 63.03125 ) tech02_1 -5 63 0 1 1 +( -210 -387 63 ) ( -210 -387 63.03125 ) ( -208.49999999999994 -387 63 ) tech02_1 8.99999 63 0 1.5 1 +( -210 -387 63 ) ( -208.49999999999994 -387 63 ) ( -210 -386.74999999999994 63 ) tech02_1 8.99999 5 0 1.5 1 +( -18 -385 65 ) ( -18 -384.75 65 ) ( -16.5 -385 65 ) tech02_1 8.99999 5 0 1.5 1 +( -18 -385 65 ) ( -16.5 -385 65 ) ( -18 -385 65.03125 ) tech02_1 -1.00001 45.3091 0 1.5 0.248708 +( -18 -385 65 ) ( -18 -385 65.03125 ) ( -18 -384.75 65 ) tech02_1 -5 63 0 1 1 +} +// brush 5 +{ +( -210 -385 65 ) ( -210 -385 125 ) ( -210 -387 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +( -208 -387 125 ) ( -208 -387 65 ) ( -210 -387 65 ) tech02_1 -30 -4.00012 90 0.2 0.3 +( -210 -387 65 ) ( -208 -387 65 ) ( -208 -385 65 ) tech02_1 -41 -4.00012 90 0.2 0.3 +( -208 -385 125 ) ( -208 -387 125 ) ( -210 -387 125 ) tech02_1 -41 -4.00012 90 0.2 0.3 +( -208 -385 65 ) ( -208 -385 125 ) ( -210 -385 125 ) tech02_1 -33 13.5558 90 0.2 0.202399 +( -208 -385 65 ) ( -208 -387 65 ) ( -208 -387 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +} +// brush 6 +{ +( -210 -391 63 ) ( -210 -390.49999999999994 63 ) ( -210 -391 64 ) tech01_1 3 63 0 1 1 +( -210 -391 63 ) ( -210 -391 64 ) ( -208.49999999999994 -391 63 ) tech01_1 60 63 0 1.5 1 +( -210 -391 63 ) ( -208.49999999999994 -391 63 ) ( -210 -390.49999999999994 63 ) tech01_1 60 -3 0 1.5 1 +( -18 -387 127 ) ( -18 -386.5 127 ) ( -16.5 -387 127 ) tech01_1 60 -3 0 1.5 1 +( -18 -387 127 ) ( -16.5 -387 127 ) ( -18 -387 128 ) tech01_1 60 63 0 1.5 1 +( -18 -387 127 ) ( -18 -387 128 ) ( -18 -386.5 127 ) tech01_1 3 63 0 1 1 +} +} +// entity 53 +{ +"classname" "light" +"origin" "-202 -375 135" +"light" "200" +"angle" "0" +"_tb_group" "17" +} +// entity 54 +{ +"classname" "light" +"origin" "-114 -375 135" +"light" "200" +"angle" "0" +"_tb_group" "17" +} +// entity 55 +{ +"classname" "light" +"origin" "-26 -375 135" +"light" "200" +"angle" "0" +"_tb_group" "17" +} +// entity 56 +{ +"classname" "func_worldtext_banner" +"origin" "-114 -384 95" +"angle" "90" +"worldtext" "You can interact with\nthe environment by\nusing your hands.$Try pressing the button\nor picking up ammo.$If you'd rather\ninteract with your \nwhole body, check\nthe 'Immersion\n'Settings' menu." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "17" +} +// entity 57 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "18" +// brush 0 +{ +( 127 -304.50000000000114 80 ) ( 127 -304.50000000000114 64 ) ( 127 -296.50000000000114 72 ) c-white 0.5 -8 0 1 -1 +( 135 -304.50000000000114 80 ) ( 135 -304.50000000000114 64 ) ( 127 -304.50000000000114 64 ) c-white -5 -8 0 1 -1 +( 135 -304.50000000000114 64 ) ( 135 -296.50000000000114 72 ) ( 127 -296.50000000000114 72 ) c-white 0.5 5 90 1 -1 +( 127 -296.50000000000114 72 ) ( 135 -296.50000000000114 72 ) ( 135 -304.50000000000114 80 ) c-white 0.5 5 90 1 -1 +( 135 -304.50000000000114 80 ) ( 135 -296.50000000000114 72 ) ( 135 -304.50000000000114 64 ) c-white 0.5 -8 0 1 -1 +} +// brush 1 +{ +( 127 -312.50000000000114 76 ) ( 127 -312.50000000000114 68 ) ( 127 -304.50000000000114 68 ) c-white 0.5 -8 0 1 -1 +( 135 -312.50000000000114 68 ) ( 127 -312.50000000000114 68 ) ( 127 -312.50000000000114 76 ) c-white -5 -8 0 1 -1 +( 127 -304.50000000000114 68 ) ( 127 -312.50000000000114 68 ) ( 135 -312.50000000000114 68 ) c-white 0.5 5 90 1 -1 +( 135 -312.50000000000114 76 ) ( 127 -312.50000000000114 76 ) ( 127 -304.50000000000114 76 ) c-white 0.5 5 90 1 -1 +( 135 -304.50000000000114 68 ) ( 135 -304.50000000000114 76 ) ( 127 -304.50000000000114 76 ) c-white -5 -8 0 1 -1 +( 135 -312.50000000000114 68 ) ( 135 -312.50000000000114 76 ) ( 135 -304.50000000000114 76 ) c-white 0.5 -8 0 1 -1 +} +} +// entity 58 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "19" +// brush 0 +{ +( 127 -207.49999999999883 64 ) ( 127 -207.49999999999883 80 ) ( 127 -215.49999999999883 72 ) c-white 0.5 8 180 1 -1 +( 127 -215.49999999999883 72 ) ( 135 -215.49999999999883 72 ) ( 135 -207.49999999999883 64 ) c-white 0.5 5 270 1 1 +( 135 -207.49999999999883 80 ) ( 135 -215.49999999999883 72 ) ( 127 -215.49999999999883 72 ) c-white 0.5 5 270 1 1 +( 135 -207.49999999999883 64 ) ( 135 -207.49999999999883 80 ) ( 127 -207.49999999999883 80 ) c-white -5 8 0 1 1 +( 135 -207.49999999999883 64 ) ( 135 -215.49999999999883 72 ) ( 135 -207.49999999999883 80 ) c-white 0.5 8 180 1 -1 +} +// brush 1 +{ +( 127 -199.49999999999883 68 ) ( 127 -199.49999999999883 76 ) ( 127 -207.49999999999883 76 ) c-white 0.5 8 180 1 -1 +( 135 -207.49999999999883 76 ) ( 135 -207.49999999999883 68 ) ( 127 -207.49999999999883 68 ) c-white -5 8 0 1 1 +( 135 -199.49999999999883 68 ) ( 127 -199.49999999999883 68 ) ( 127 -207.49999999999883 68 ) c-white 0.5 5 270 1 1 +( 127 -207.49999999999883 76 ) ( 127 -199.49999999999883 76 ) ( 135 -199.49999999999883 76 ) c-white 0.5 5 270 1 1 +( 135 -199.49999999999883 76 ) ( 127 -199.49999999999883 76 ) ( 127 -199.49999999999883 68 ) c-white -5 8 0 1 1 +( 135 -199.49999999999883 76 ) ( 135 -199.49999999999883 68 ) ( 135 -207.49999999999883 68 ) c-white 0.5 8 180 1 -1 +} +} +// entity 59 +{ +"classname" "item_rockets" +"origin" "96 -248 48" +} +// entity 60 +{ +"classname" "item_shells" +"origin" "96 -280 48" +} +// entity 61 +{ +"classname" "func_rubble" +"origin" "-196 -572 88" +"count" "15" +"targetname" "t1" +"dmg" "1" +} +// entity 62 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "20" +// brush 0 +{ +( -88 -523 65 ) ( -88 -522.75 65 ) ( -88 -523 65.9375 ) black 4 5.33334 0 0.25 0.9375 +( -88 -523 65 ) ( -88 -523 65.9375 ) ( -86.53125 -523 65 ) black -4.08511 5.33334 0 1.46875 0.9375 +( -88 -523 65 ) ( -86.53125 -523 65 ) ( -88 -522.75 65 ) black -4.08511 -4 0 1.46875 0.25 +( 100 -521 125 ) ( 100 -520.75 125 ) ( 101.46875 -521 125 ) black -4.08511 -4 0 1.46875 0.25 +( 100 -521 125 ) ( 101.46875 -521 125 ) ( 100 -521 125.93750000000001 ) black -4.08511 5.33334 0 1.46875 0.9375 +( 100 -521 125 ) ( 100 -521 125.93750000000001 ) ( 100 -520.75 125 ) black 4 5.33334 0 0.25 0.9375 +} +// brush 1 +{ +( -90 -525 135 ) ( -90 -519 151 ) ( -90 -527 151 ) tlight02 -7 7 180 1 -1 +( 102 -527 151 ) ( 102 -527 135 ) ( -90 -527 135 ) tlight02 -12.0004 7 0 0.5 1 +( -90 -527 135 ) ( 102 -527 135 ) ( 102 -525 135 ) tlight02 -7 52.0005 270 1 0.5 +( 102 -519 151 ) ( 102 -527 151 ) ( -90 -527 151 ) tlight02 -28 -36.9999 0 1.5 0.333333 +( 102 -525 135 ) ( 102 -519 151 ) ( -90 -519 151 ) tlight02 -25.4294 40.9983 0 0.664801 0.931046 +( 102 -525 135 ) ( 102 -527 135 ) ( 102 -527 151 ) tlight02 -7 7 180 1 -1 +} +// brush 2 +{ +( -90 -523 125 ) ( -90 -522.75 125 ) ( -90 -523 125.03125 ) tech02_1 3 63 0 1 1 +( -90 -523 125 ) ( -90 -523 125.03125 ) ( -88.499999999999943 -523 125 ) tech02_1 -7.00001 63 0 1.5 1 +( -90 -523 125 ) ( -88.499999999999943 -523 125 ) ( -90 -522.75 125 ) tech02_1 -7.00001 -3 0 1.5 1 +( 102 -521 127 ) ( 102 -520.75 127 ) ( 103.5 -521 127 ) tech02_1 -7.00001 -3 0 1.5 1 +( 102 -521 127 ) ( 103.5 -521 127 ) ( 102 -521 127.03125 ) tech02_1 -44.5183 35.132 0 1.65804 0.163584 +( 102 -521 127 ) ( 102 -521 127.03125 ) ( 102 -520.75 127 ) tech02_1 3 63 0 1 1 +} +// brush 3 +{ +( 100 -521 65 ) ( 100 -521 125 ) ( 100 -523 125 ) tech02_1 -30 -2.00012 90 0.2 0.3 +( 102 -523 125 ) ( 102 -523 65 ) ( 100 -523 65 ) tech02_1 -30 -41.3335 90 0.2 0.3 +( 100 -523 65 ) ( 102 -523 65 ) ( 102 -521 65 ) tech02_1 63 -41.3335 90 0.2 0.3 +( 102 -521 125 ) ( 102 -523 125 ) ( 100 -523 125 ) tech02_1 63 -41.3335 90 0.2 0.3 +( 102 -521 65 ) ( 102 -521 125 ) ( 100 -521 125 ) tech02_1 -31 -55.1155 90 0.2 0.241259 +( 102 -521 65 ) ( 102 -523 65 ) ( 102 -523 125 ) tech02_1 -30 -2.00012 90 0.2 0.3 +} +// brush 4 +{ +( -90 -523 63 ) ( -90 -522.75 63 ) ( -90 -523 63.03125 ) tech02_1 3 63 0 1 1 +( -90 -523 63 ) ( -90 -523 63.03125 ) ( -88.499999999999943 -523 63 ) tech02_1 -7.00001 63 0 1.5 1 +( -90 -523 63 ) ( -88.499999999999943 -523 63 ) ( -90 -522.75 63 ) tech02_1 -7.00001 -3 0 1.5 1 +( 102 -521 65 ) ( 102 -520.75 65 ) ( 103.5 -521 65 ) tech02_1 -7.00001 -3 0 1.5 1 +( 102 -521 65 ) ( 103.5 -521 65 ) ( 102 -521 65.03125 ) tech02_1 -17 45.3091 0 1.5 0.248708 +( 102 -521 65 ) ( 102 -521 65.03125 ) ( 102 -520.75 65 ) tech02_1 3 63 0 1 1 +} +// brush 5 +{ +( -90 -521 65 ) ( -90 -521 125 ) ( -90 -523 125 ) tech02_1 -30 -2.00012 90 0.2 0.3 +( -88 -523 125 ) ( -88 -523 65 ) ( -90 -523 65 ) tech02_1 -30 -20.0001 90 0.2 0.3 +( -90 -523 65 ) ( -88 -523 65 ) ( -88 -521 65 ) tech02_1 63 -20.0001 90 0.2 0.3 +( -88 -521 125 ) ( -88 -523 125 ) ( -90 -523 125 ) tech02_1 63 -20.0001 90 0.2 0.3 +( -88 -521 65 ) ( -88 -521 125 ) ( -90 -521 125 ) tech02_1 -33 -3.33328 90 0.2 0.202399 +( -88 -521 65 ) ( -88 -523 65 ) ( -88 -523 125 ) tech02_1 -30 -2.00012 90 0.2 0.3 +} +// brush 6 +{ +( -90 -527 63 ) ( -90 -526.5 63 ) ( -90 -527 64 ) tech01_1 11 63 0 1 1 +( -90 -527 63 ) ( -90 -527 64 ) ( -88.499999999999943 -527 63 ) tech01_1 -20 63 0 1.5 1 +( -90 -527 63 ) ( -88.499999999999943 -527 63 ) ( -90 -526.5 63 ) tech01_1 -20 -11 0 1.5 1 +( 102 -523 127 ) ( 102 -522.5 127 ) ( 103.5 -523 127 ) tech01_1 -20 -11 0 1.5 1 +( 102 -523 127 ) ( 103.5 -523 127 ) ( 102 -523 128 ) tech01_1 -20 63 0 1.5 1 +( 102 -523 127 ) ( 102 -523 128 ) ( 102 -522.5 127 ) tech01_1 11 63 0 1 1 +} +} +// entity 63 +{ +"classname" "light" +"origin" "-82 -511 135" +"light" "200" +"angle" "0" +"_tb_group" "20" +} +// entity 64 +{ +"classname" "light" +"origin" "6 -511 135" +"light" "200" +"angle" "0" +"_tb_group" "20" +} +// entity 65 +{ +"classname" "light" +"origin" "94 -511 135" +"light" "200" +"angle" "0" +"_tb_group" "20" +} +// entity 66 +{ +"classname" "func_worldtext_banner" +"origin" "6 -520 95" +"angle" "90" +"worldtext" "Use your fists!\nThe harder you\npunch, the more\ndamage you will\ndeal." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "20" +} +// entity 67 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "21" +// brush 0 +{ +( -120 -526 24 ) ( -128 -526 32 ) ( -128 -534 32 ) c-white 0 -8 0 1 1 +( -128 -534 32 ) ( -128 -526 32 ) ( -120 -526 40 ) c-white 0 -8 0 1 1 +( -120 -534 40 ) ( -120 -534 24 ) ( -128 -534 32 ) c-white 0 0 0 1 1 +( -120 -526 40 ) ( -128 -526 32 ) ( -120 -526 24 ) c-white 0 0 0 1 1 +( -120 -526 40 ) ( -120 -526 24 ) ( -120 -534 24 ) c-white 8 0 0 1 1 +} +// brush 1 +{ +( -120 -526 28 ) ( -120 -526 36 ) ( -120 -534 36 ) c-white 8 0 0 1 1 +( -112 -534 36 ) ( -112 -534 28 ) ( -120 -534 28 ) c-white 0 0 0 1 1 +( -120 -534 28 ) ( -112 -534 28 ) ( -112 -526 28 ) c-white 0 -8 0 1 1 +( -112 -526 36 ) ( -112 -534 36 ) ( -120 -534 36 ) c-white 0 -8 0 1 1 +( -112 -526 28 ) ( -112 -526 36 ) ( -120 -526 36 ) c-white 0 0 0 1 1 +( -112 -526 28 ) ( -112 -534 28 ) ( -112 -534 36 ) c-white 8 0 0 1 1 +} +} +// entity 68 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "22" +// brush 0 +{ +( -120 -526 144 ) ( -128 -526 152 ) ( -128 -534 152 ) c-white 0 -8 0 1 1 +( -128 -534 152 ) ( -128 -526 152 ) ( -120 -526 160 ) c-white 0 -8 0 1 1 +( -120 -534 160 ) ( -120 -534 144 ) ( -128 -534 152 ) c-white 0 0 0 1 1 +( -120 -526 160 ) ( -128 -526 152 ) ( -120 -526 144 ) c-white 0 0 0 1 1 +( -120 -526 160 ) ( -120 -526 144 ) ( -120 -534 144 ) c-white 8 0 0 1 1 +} +// brush 1 +{ +( -120 -526 148 ) ( -120 -526 156 ) ( -120 -534 156 ) c-white 8 0 0 1 1 +( -112 -534 156 ) ( -112 -534 148 ) ( -120 -534 148 ) c-white 0 0 0 1 1 +( -120 -534 148 ) ( -112 -534 148 ) ( -112 -526 148 ) c-white 0 -8 0 1 1 +( -112 -526 156 ) ( -112 -534 156 ) ( -120 -534 156 ) c-white 0 -8 0 1 1 +( -112 -526 148 ) ( -112 -526 156 ) ( -120 -526 156 ) c-white 0 0 0 1 1 +( -112 -526 148 ) ( -112 -534 148 ) ( -112 -534 156 ) c-white 8 0 0 1 1 +} +} +// entity 69 +{ +"classname" "func_rubble" +"origin" "-188 -708 88" +"count" "15" +"targetname" "t2" +"angle" "90" +"dmg" "1" +} +// entity 70 +{ +"light" "250" +"origin" "-184 -472 148" +"classname" "light" +"angle" "0" +} +// entity 71 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "23" +// brush 0 +{ +( -202 -1011 65 ) ( -202 -1010.75 65 ) ( -202 -1011 65.9375 ) black -12 5.33334 0 0.25 0.9375 +( -202 -1011 65 ) ( -202 -1011 65.9375 ) ( -200.53125 -1011 65 ) black 13.617 5.33334 0 1.46875 0.9375 +( -202 -1011 65 ) ( -200.53125 -1011 65 ) ( -202 -1010.75 65 ) black 13.617 12 0 1.46875 0.25 +( -14 -1009 125 ) ( -14 -1008.75 125 ) ( -12.53125 -1009 125 ) black 13.617 12 0 1.46875 0.25 +( -14 -1009 125 ) ( -12.53125 -1009 125 ) ( -14 -1009 125.93750000000001 ) black 13.617 5.33334 0 1.46875 0.9375 +( -14 -1009 125 ) ( -14 -1009 125.93750000000001 ) ( -14 -1008.75 125 ) black -12 5.33334 0 0.25 0.9375 +} +// brush 1 +{ +( -204 -1013 135 ) ( -204 -1007 151 ) ( -204 -1015 151 ) tlight02 1 7 180 1 -1 +( -12 -1015 151 ) ( -12 -1015 135 ) ( -204 -1015 135 ) tlight02 35.9995 7 0 0.5 1 +( -204 -1015 135 ) ( -12 -1015 135 ) ( -12 -1013 135 ) tlight02 1 -59.9994 270 1 0.5 +( -12 -1007 151 ) ( -12 -1015 151 ) ( -204 -1015 151 ) tlight02 52 51 0 1.5 0.333333 +( -12 -1013 135 ) ( -12 -1007 151 ) ( -204 -1007 151 ) tlight02 27.0757 40.9983 0 0.664801 0.931046 +( -12 -1013 135 ) ( -12 -1015 135 ) ( -12 -1015 151 ) tlight02 1 7 180 1 -1 +} +// brush 2 +{ +( -204 -1011 125 ) ( -204 -1010.75 125 ) ( -204 -1011 125.03125 ) tech02_1 -5 63 0 1 1 +( -204 -1011 125 ) ( -204 -1011 125.03125 ) ( -202.49999999999994 -1011 125 ) tech02_1 8.99999 63 0 1.5 1 +( -204 -1011 125 ) ( -202.49999999999994 -1011 125 ) ( -204 -1010.75 125 ) tech02_1 8.99999 5 0 1.5 1 +( -12 -1009 127 ) ( -12 -1008.75 127 ) ( -10.5 -1009 127 ) tech02_1 8.99999 5 0 1.5 1 +( -12 -1009 127 ) ( -10.5 -1009 127 ) ( -12 -1009 127.03125 ) tech02_1 27.8562 35.132 0 1.65804 0.163584 +( -12 -1009 127 ) ( -12 -1009 127.03125 ) ( -12 -1008.75 127 ) tech02_1 -5 63 0 1 1 +} +// brush 3 +{ +( -14 -1009 65 ) ( -14 -1009 125 ) ( -14 -1011 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +( -12 -1011 125 ) ( -12 -1011 65 ) ( -14 -1011 65 ) tech02_1 -30 38.6665 90 0.2 0.3 +( -14 -1011 65 ) ( -12 -1011 65 ) ( -12 -1009 65 ) tech02_1 -41 38.6665 90 0.2 0.3 +( -12 -1009 125 ) ( -12 -1011 125 ) ( -14 -1011 125 ) tech02_1 -41 38.6665 90 0.2 0.3 +( -12 -1009 65 ) ( -12 -1009 125 ) ( -14 -1009 125 ) tech02_1 -31 -5.7246 90 0.2 0.241259 +( -12 -1009 65 ) ( -12 -1011 65 ) ( -12 -1011 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +} +// brush 4 +{ +( -204 -1011 63 ) ( -204 -1010.75 63 ) ( -204 -1011 63.03125 ) tech02_1 -5 63 0 1 1 +( -204 -1011 63 ) ( -204 -1011 63.03125 ) ( -202.49999999999994 -1011 63 ) tech02_1 8.99999 63 0 1.5 1 +( -204 -1011 63 ) ( -202.49999999999994 -1011 63 ) ( -204 -1010.75 63 ) tech02_1 8.99999 5 0 1.5 1 +( -12 -1009 65 ) ( -12 -1008.75 65 ) ( -10.5 -1009 65 ) tech02_1 8.99999 5 0 1.5 1 +( -12 -1009 65 ) ( -10.5 -1009 65 ) ( -12 -1009 65.03125 ) tech02_1 -1.00001 45.3091 0 1.5 0.248708 +( -12 -1009 65 ) ( -12 -1009 65.03125 ) ( -12 -1008.75 65 ) tech02_1 -5 63 0 1 1 +} +// brush 5 +{ +( -204 -1009 65 ) ( -204 -1009 125 ) ( -204 -1011 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +( -202 -1011 125 ) ( -202 -1011 65 ) ( -204 -1011 65 ) tech02_1 -30 -4.00012 90 0.2 0.3 +( -204 -1011 65 ) ( -202 -1011 65 ) ( -202 -1009 65 ) tech02_1 -41 -4.00012 90 0.2 0.3 +( -202 -1009 125 ) ( -202 -1011 125 ) ( -204 -1011 125 ) tech02_1 -41 -4.00012 90 0.2 0.3 +( -202 -1009 65 ) ( -202 -1009 125 ) ( -204 -1009 125 ) tech02_1 -33 13.5558 90 0.2 0.202399 +( -202 -1009 65 ) ( -202 -1011 65 ) ( -202 -1011 125 ) tech02_1 -30 -7.33337 90 0.2 0.3 +} +// brush 6 +{ +( -204 -1015 63 ) ( -204 -1014.5 63 ) ( -204 -1015 64 ) tech01_1 3 63 0 1 1 +( -204 -1015 63 ) ( -204 -1015 64 ) ( -202.49999999999994 -1015 63 ) tech01_1 60 63 0 1.5 1 +( -204 -1015 63 ) ( -202.49999999999994 -1015 63 ) ( -204 -1014.5 63 ) tech01_1 60 -3 0 1.5 1 +( -12 -1011 127 ) ( -12 -1010.5 127 ) ( -10.5 -1011 127 ) tech01_1 60 -3 0 1.5 1 +( -12 -1011 127 ) ( -10.5 -1011 127 ) ( -12 -1011 128 ) tech01_1 60 63 0 1.5 1 +( -12 -1011 127 ) ( -12 -1011 128 ) ( -12 -1010.5 127 ) tech01_1 3 63 0 1 1 +} +} +// entity 72 +{ +"classname" "light" +"origin" "-196 -999 135" +"light" "200" +"angle" "0" +"_tb_group" "23" +} +// entity 73 +{ +"classname" "light" +"origin" "-108 -999 135" +"light" "200" +"angle" "0" +"_tb_group" "23" +} +// entity 74 +{ +"classname" "light" +"origin" "-20 -999 135" +"light" "200" +"angle" "0" +"_tb_group" "23" +} +// entity 75 +{ +"classname" "func_worldtext_banner" +"origin" "-108 -1008 95" +"angle" "90" +"worldtext" "You can pick weapons\nup by grabbing them.\nNaturally swing and\nthrow them to deal\ndamage.$Try to hit the three\ntargets by throwing\naxes.$You can also pull\nweapons towards you\nby pointing at them\nand pressing trigger.\nTry it!" +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "23" +} +// entity 76 +{ +"light" "250" +"origin" "-58 -896 148" +"classname" "light" +"angle" "180" +} +// entity 77 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "24" +// brush 0 +{ +( -112 -544 17.078755282366501 ) ( -104 -551 71.078755282366501 ) ( -104 -561 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( -96 -561 71.078755282366501 ) ( -88 -568 17.078755282366501 ) ( -112 -568 17.078755282366501 ) tlight11 0 1.07875 0 1 1 +( -112 -568 17.078755282366501 ) ( -88 -568 17.078755282366501 ) ( -88 -544 17.078755282366501 ) tlight11 0 40 0 1 1 +( -96 -551 71.078755282366501 ) ( -96 -561 71.078755282366501 ) ( -104 -561 71.078755282366501 ) tlight11 12.29 56 0 1 1 +( -88 -544 17.078755282366501 ) ( -96 -551 71.078755282366501 ) ( -104 -551 71.078755282366501 ) tlight11 0 1.07875 0 1 1 +( -88 -544 17.078755282366501 ) ( -88 -568 17.078755282366501 ) ( -96 -561 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +} +} +// entity 78 +{ +"classname" "light" +"origin" "-120 -556 47" +"light" "200" +"_tb_group" "24" +} +// entity 79 +{ +"classname" "light" +"origin" "-80 -556 47" +"light" "200" +"_tb_group" "24" +} +// entity 80 +{ +"classname" "light" +"origin" "-100 -576 47" +"light" "200" +"_tb_group" "24" +} +// entity 81 +{ +"classname" "light" +"origin" "-100 -536 47" +"light" "200" +"_tb_group" "24" +} +// entity 82 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "25" +// brush 0 +{ +( 92 -544 17.078755282366501 ) ( 100 -551 71.078755282366501 ) ( 100 -561 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( 108 -561 71.078755282366501 ) ( 116 -568 17.078755282366501 ) ( 92 -568 17.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( 92 -568 17.078755282366501 ) ( 116 -568 17.078755282366501 ) ( 116 -544 17.078755282366501 ) tlight11 -8 40 0 1 1 +( 108 -551 71.078755282366501 ) ( 108 -561 71.078755282366501 ) ( 100 -561 71.078755282366501 ) tlight11 -11.71 56 0 1 1 +( 116 -544 17.078755282366501 ) ( 108 -551 71.078755282366501 ) ( 100 -551 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( 116 -544 17.078755282366501 ) ( 116 -568 17.078755282366501 ) ( 108 -561 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +} +} +// entity 83 +{ +"classname" "light" +"origin" "84 -556 47" +"light" "200" +"_tb_group" "25" +} +// entity 84 +{ +"classname" "light" +"origin" "124 -556 47" +"light" "200" +"_tb_group" "25" +} +// entity 85 +{ +"classname" "light" +"origin" "104 -576 47" +"light" "200" +"_tb_group" "25" +} +// entity 86 +{ +"classname" "light" +"origin" "104 -536 47" +"light" "200" +"_tb_group" "25" +} +// entity 87 +{ +"classname" "func_weapon_dispenser" +"origin" "97 -1001 148" +"targetname" "t3" +"weapon" "2" +"angle" "0" +} +// entity 88 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "26" +// brush 0 +{ +( 92 -876 17.078755282365382 ) ( 100 -883 71.078755282365378 ) ( 100 -893 71.078755282365378 ) tlight11 -8 1.07875 0 1 1 +( 108 -893 71.078755282365378 ) ( 116 -900 17.078755282365382 ) ( 92 -900 17.078755282365382 ) tlight11 -8 1.07875 0 1 1 +( 92 -900 17.078755282365382 ) ( 116 -900 17.078755282365382 ) ( 116 -876 17.078755282365382 ) tlight11 -8 40 0 1 1 +( 108 -883 71.078755282365378 ) ( 108 -893 71.078755282365378 ) ( 100 -893 71.078755282365378 ) tlight11 -11.71 56 0 1 1 +( 116 -876 17.078755282365382 ) ( 108 -883 71.078755282365378 ) ( 100 -883 71.078755282365378 ) tlight11 -8 1.07875 0 1 1 +( 116 -876 17.078755282365382 ) ( 116 -900 17.078755282365382 ) ( 108 -893 71.078755282365378 ) tlight11 -8 1.07875 0 1 1 +} +} +// entity 89 +{ +"classname" "light" +"origin" "84 -888 47" +"light" "200" +"_tb_group" "26" +} +// entity 90 +{ +"classname" "light" +"origin" "124 -888 47" +"light" "200" +"_tb_group" "26" +} +// entity 91 +{ +"classname" "light" +"origin" "104 -908 47" +"light" "200" +"_tb_group" "26" +} +// entity 92 +{ +"classname" "light" +"origin" "104 -868 47" +"light" "200" +"_tb_group" "26" +} +// entity 93 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "27" +// brush 0 +{ +( -256 -898 41.078755282366501 ) ( -256 -906 33.078755282366501 ) ( -256 -898 25.078755282366501 ) c-white 0 0 0 1 1 +( -256 -898 25.078755282366501 ) ( -256 -906 33.078755282366501 ) ( -248 -906 33.078755282366501 ) c-white 0 -8 0 1 1 +( -248 -906 33.078755282366501 ) ( -256 -906 33.078755282366501 ) ( -256 -898 41.078755282366501 ) c-white 0 -8 0 1 1 +( -256 -898 41.078755282366501 ) ( -256 -898 25.078755282366501 ) ( -248 -898 25.078755282366501 ) c-white 8 0 0 1 1 +( -248 -898 41.078755282366501 ) ( -248 -898 25.078755282366501 ) ( -248 -906 33.078755282366501 ) c-white 0 0 0 1 1 +} +// brush 1 +{ +( -256 -890 29.078755282366501 ) ( -256 -890 37.078755282366501 ) ( -256 -898 37.078755282366501 ) c-white 0 0 0 1 1 +( -256 -898 29.078755282366501 ) ( -256 -898 37.078755282366501 ) ( -248 -898 37.078755282366501 ) c-white 8 0 0 1 1 +( -248 -898 29.078755282366501 ) ( -248 -890 29.078755282366501 ) ( -256 -890 29.078755282366501 ) c-white 0 -8 0 1 1 +( -256 -890 37.078755282366501 ) ( -248 -890 37.078755282366501 ) ( -248 -898 37.078755282366501 ) c-white 0 -8 0 1 1 +( -256 -890 29.078755282366501 ) ( -248 -890 29.078755282366501 ) ( -248 -890 37.078755282366501 ) c-white 8 0 0 1 1 +( -248 -890 37.078755282366501 ) ( -248 -890 29.078755282366501 ) ( -248 -898 29.078755282366501 ) c-white 0 0 0 1 1 +} +} +// entity 94 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Arrow" +"_tb_id" "28" +// brush 0 +{ +( -256 -898 161.0787552823665 ) ( -256 -906 153.0787552823665 ) ( -256 -898 145.0787552823665 ) c-white 0 0 0 1 1 +( -256 -898 145.0787552823665 ) ( -256 -906 153.0787552823665 ) ( -248 -906 153.0787552823665 ) c-white 0 -8 0 1 1 +( -248 -906 153.0787552823665 ) ( -256 -906 153.0787552823665 ) ( -256 -898 161.0787552823665 ) c-white 0 -8 0 1 1 +( -256 -898 161.0787552823665 ) ( -256 -898 145.0787552823665 ) ( -248 -898 145.0787552823665 ) c-white 8 0 0 1 1 +( -248 -898 161.0787552823665 ) ( -248 -898 145.0787552823665 ) ( -248 -906 153.0787552823665 ) c-white 0 0 0 1 1 +} +// brush 1 +{ +( -256 -890 149.0787552823665 ) ( -256 -890 157.0787552823665 ) ( -256 -898 157.0787552823665 ) c-white 0 0 0 1 1 +( -256 -898 149.0787552823665 ) ( -256 -898 157.0787552823665 ) ( -248 -898 157.0787552823665 ) c-white 8 0 0 1 1 +( -248 -898 149.0787552823665 ) ( -248 -890 149.0787552823665 ) ( -256 -890 149.0787552823665 ) c-white 0 -8 0 1 1 +( -256 -890 157.0787552823665 ) ( -248 -890 157.0787552823665 ) ( -248 -898 157.0787552823665 ) c-white 0 -8 0 1 1 +( -256 -890 149.0787552823665 ) ( -248 -890 149.0787552823665 ) ( -248 -890 157.0787552823665 ) c-white 8 0 0 1 1 +( -248 -890 157.0787552823665 ) ( -248 -890 149.0787552823665 ) ( -248 -898 149.0787552823665 ) c-white 0 0 0 1 1 +} +} +// entity 95 +{ +"classname" "light" +"origin" "-512 -908 373" +"light" "1200" +"angle" "0" +} +// entity 96 +{ +"classname" "light" +"origin" "208 -948 373" +"light" "1200" +"angle" "0" +} +// entity 97 +{ +"classname" "light" +"origin" "-816 -372 373" +"light" "1200" +"angle" "0" +} +// entity 98 +{ +"classname" "light" +"origin" "-496 252 373" +"light" "1200" +"angle" "0" +} +// entity 99 +{ +"classname" "light" +"origin" "256 300 373" +"light" "1200" +"angle" "0" +} +// entity 100 +{ +"classname" "light" +"origin" "640 -380 373" +"light" "1200" +"angle" "0" +} +// entity 101 +{ +"classname" "light" +"origin" "664 652 373" +"light" "1200" +"angle" "0" +} +// entity 102 +{ +"classname" "light" +"origin" "-104 676 373" +"light" "1200" +"angle" "0" +} +// entity 103 +{ +"classname" "light" +"origin" "-1024 684 373" +"light" "1200" +"angle" "0" +} +// entity 104 +{ +"classname" "light" +"origin" "-1136 12 373" +"light" "1200" +"angle" "0" +} +// entity 105 +{ +"classname" "light" +"origin" "-1128 -732 373" +"light" "1200" +"angle" "0" +} +// entity 106 +{ +"classname" "light" +"origin" "-904 -1204 373" +"light" "1200" +"angle" "0" +} +// entity 107 +{ +"classname" "light" +"origin" "-200 -1348 373" +"light" "1200" +"angle" "0" +} +// entity 108 +{ +"classname" "light" +"origin" "640 -1268 373" +"light" "1200" +"angle" "0" +} +// entity 109 +{ +"classname" "light" +"origin" "808 -772 373" +"light" "1200" +"angle" "0" +} +// entity 110 +{ +"classname" "light" +"origin" "816 84 373" +"light" "1200" +"angle" "0" +} +// entity 111 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "29" +// brush 0 +{ +( -607 -791 46 ) ( -607 -791 46.9375 ) ( -607 -792.46875 46 ) black -6.46808 1.06667 180 1.46875 -0.9375 +( -605 -979 106 ) ( -605 -979 106.93750000000001 ) ( -604.75000000000011 -979 106 ) black 4 1.06667 0 0.25 0.9375 +( -607 -791 46 ) ( -607 -792.46875 46 ) ( -606.74999999999989 -791 46 ) black -6.46808 -4 270 1.46875 0.25 +( -605 -979 106 ) ( -604.75000000000011 -979 106 ) ( -605 -980.46875 106 ) black -6.46808 -4 270 1.46875 0.25 +( -607 -791 46 ) ( -606.74999999999989 -791 46 ) ( -607 -791 46.9375 ) black 4 1.06667 0 0.25 0.9375 +( -605 -979 106 ) ( -605 -980.46875 106 ) ( -605 -979 106.93750000000001 ) black -6.46808 1.06667 180 1.46875 -0.9375 +} +// brush 1 +{ +( -616 -788 132 ) ( -616 -980 132 ) ( -611 -981 116 ) tlight02 -30 -12 180 0.5 -1 +( -616 -980 132 ) ( -603 -981 132 ) ( -611 -981 116 ) tlight02 21 -12 180 1 -1 +( -611 -981 116 ) ( -603 -981 132 ) ( -609 -981 116 ) tlight02 21 -12 180 1 -1 +( -609 -981 116 ) ( -609 -789 116 ) ( -611 -789 116 ) tlight02 21 5.9989 180 1 0.5 +( -603 -789 132 ) ( -603 -981 132 ) ( -616 -980 132 ) tlight02 30 -17 270 1.5 0.333333 +( -611 -789 116 ) ( -609 -789 116 ) ( -616 -788 132 ) tlight02 21 -12 180 1 -1 +( -616 -788 132 ) ( -609 -789 116 ) ( -603 -789 132 ) tlight02 21 -12 180 1 -1 +( -603 -789 132 ) ( -609 -789 116 ) ( -609 -981 116 ) tlight02 5.396 20.5911 180 0.664801 -0.931046 +} +// brush 2 +{ +( -607 -789 106 ) ( -607 -789 106.03125 ) ( -607 -790.50000000000011 106 ) tech02_1 -13 44 180 1.5 -1 +( -605 -981 108 ) ( -605 -981 108.03125 ) ( -604.75000000000011 -981 108 ) tech02_1 -25 44 0 1 1 +( -607 -789 106 ) ( -607 -790.50000000000011 106 ) ( -606.74999999999989 -789 106 ) tech02_1 -13 25 270 1.5 1 +( -605 -981 108 ) ( -604.75000000000011 -981 108 ) ( -605 -982.5 108 ) tech02_1 -13 25 270 1.5 1 +( -607 -789 106 ) ( -606.74999999999989 -789 106 ) ( -607 -789 106.03125 ) tech02_1 -25 44 0 1 1 +( -605 -981 108 ) ( -605 -982.5 108 ) ( -605 -981 108.03125 ) tech02_1 4.95752 46.9839 180 1.65804 -0.163584 +} +// brush 3 +{ +( -607 -981 106 ) ( -607 -981 46 ) ( -607 -979 46 ) tech02_1 1 -7.33325 90 0.2 -0.3 +( -605 -981 46 ) ( -607 -981 46 ) ( -607 -981 106 ) tech02_1 1 -10 90 0.2 0.3 +( -607 -979 46 ) ( -607 -981 46 ) ( -605 -981 46 ) tech02_1 -13 -7.33325 0 0.2 0.3 +( -605 -981 106 ) ( -607 -981 106 ) ( -607 -979 106 ) tech02_1 -13 -7.33325 0 0.2 0.3 +( -605 -979 46 ) ( -605 -979 106 ) ( -607 -979 106 ) tech02_1 1 -10 90 0.2 0.3 +( -605 -981 46 ) ( -605 -981 106 ) ( -605 -979 106 ) tech02_1 0 38.3652 90 0.2 -0.241259 +} +// brush 4 +{ +( -607 -789 44 ) ( -607 -789 44.03125 ) ( -607 -790.50000000000011 44 ) tech02_1 -13 44 180 1.5 -1 +( -605 -981 46 ) ( -605 -981 46.03125 ) ( -604.75000000000011 -981 46 ) tech02_1 -25 44 0 1 1 +( -607 -789 44 ) ( -607 -790.50000000000011 44 ) ( -606.74999999999989 -789 44 ) tech02_1 -13 25 270 1.5 1 +( -605 -981 46 ) ( -604.75000000000011 -981 46 ) ( -605 -982.5 46 ) tech02_1 -13 25 270 1.5 1 +( -607 -789 44 ) ( -606.74999999999989 -789 44 ) ( -607 -789 44.03125 ) tech02_1 -25 44 0 1 1 +( -605 -981 46 ) ( -605 -982.5 46 ) ( -605 -981 46.03125 ) tech02_1 41 32.9143 180 1.5 -0.248708 +} +// brush 5 +{ +( -607 -791 106 ) ( -607 -791 46 ) ( -607 -789 46 ) tech02_1 1 14 90 0.2 -0.3 +( -605 -791 46 ) ( -607 -791 46 ) ( -607 -791 106 ) tech02_1 1 -10 90 0.2 0.3 +( -607 -789 46 ) ( -607 -791 46 ) ( -605 -791 46 ) tech02_1 -13 14 0 0.2 0.3 +( -605 -791 106 ) ( -607 -791 106 ) ( -607 -789 106 ) tech02_1 -13 14 0 0.2 0.3 +( -605 -789 46 ) ( -605 -789 106 ) ( -607 -789 106 ) tech02_1 1 -10 90 0.2 0.3 +( -605 -791 46 ) ( -605 -791 106 ) ( -605 -789 106 ) tech02_1 -2 35.3987 90 0.2 -0.202399 +} +// brush 6 +{ +( -611 -789 44 ) ( -611 -789 45 ) ( -611 -790.50000000000011 44 ) tech01_1 38 44 180 1.5 -1 +( -607 -981 108 ) ( -607 -981 109 ) ( -606.50000000000011 -981 108 ) tech01_1 -17 44 0 1 1 +( -611 -789 44 ) ( -611 -790.50000000000011 44 ) ( -610.49999999999989 -789 44 ) tech01_1 38 17 270 1.5 1 +( -607 -981 108 ) ( -606.50000000000011 -981 108 ) ( -607 -982.5 108 ) tech01_1 38 17 270 1.5 1 +( -611 -789 44 ) ( -610.49999999999989 -789 44 ) ( -611 -789 45 ) tech01_1 -17 44 0 1 1 +( -607 -981 108 ) ( -607 -982.5 108 ) ( -607 -981 109 ) tech01_1 38 44 180 1.5 -1 +} +} +// entity 112 +{ +"classname" "light" +"origin" "-595 -797 116" +"light" "200" +"angle" "270" +"_tb_group" "29" +} +// entity 113 +{ +"classname" "light" +"origin" "-595 -885 116" +"light" "200" +"angle" "270" +"_tb_group" "29" +} +// entity 114 +{ +"classname" "light" +"origin" "-595 -973 116" +"light" "200" +"angle" "270" +"_tb_group" "29" +} +// entity 115 +{ +"classname" "func_worldtext_banner" +"origin" "-604 -885 76" +"angle" "0" +"worldtext" "Finding a weapon in\na map makes you\n'eligible' for it to\nbe dropped by enemies.$You can dual-wield\nany weapon or use\nthem for melee.\nYou can also aim\ntwo-handed.$Practice on the two\ntargets in the range." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "29" +} +// entity 116 +{ +"classname" "weapon_supershotgun" +"origin" "-544 -656 20" +} +// entity 117 +{ +"classname" "weapon_shotgun" +"origin" "-544 -736 52" +} +// entity 118 +{ +"classname" "weapon_nailgun" +"origin" "-544 -576 20" +} +// entity 119 +{ +"classname" "weapon_lightning" +"origin" "-544 -496 20" +} +// entity 120 +{ +"classname" "item_spikes" +"origin" "-496 -572 29" +} +// entity 121 +{ +"classname" "item_lava_spikes" +"origin" "-496 -604 37" +} +// entity 122 +{ +"classname" "item_cells" +"origin" "-496 -492 29" +} +// entity 123 +{ +"classname" "item_cells" +"origin" "-464 -492 29" +} +// entity 124 +{ +"classname" "item_shells" +"origin" "-496 -652 29" +} +// entity 125 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "30" +// brush 0 +{ +( -269 -507.56322217813931 119 ) ( -269 -506.09447217813931 119 ) ( -269 -507.56322217813931 119.93750000000001 ) black 13.6601 14.9333 0 1.46875 0.9375 +( -267 -695.56322217813931 59 ) ( -267.24999999999989 -695.56322217813931 59 ) ( -267 -695.56322217813931 59.9375 ) black -4 14.9333 180 0.25 -0.9375 +( -267 -695.56322217813931 59 ) ( -267 -694.09447217813931 59 ) ( -267.24999999999989 -695.56322217813931 59 ) black 13.6601 4 90 1.46875 0.25 +( -269 -507.56322217813931 119 ) ( -269.25 -507.56322217813931 119 ) ( -269 -506.09447217813931 119 ) black 13.6601 4 90 1.46875 0.25 +( -269 -507.56322217813931 119 ) ( -269 -507.56322217813931 119.93750000000001 ) ( -269.25 -507.56322217813931 119 ) black -4 14.9333 180 0.25 -0.9375 +( -267 -695.56322217813931 59 ) ( -267 -695.56322217813931 59.9375 ) ( -267 -694.09447217813931 59 ) black 13.6601 14.9333 0 1.46875 0.9375 +} +// brush 1 +{ +( -265 -505.56322217813931 129 ) ( -271 -505.56322217813931 145 ) ( -271 -697.56322217813931 145 ) tlight02 1.49799 34.5539 0 0.664801 0.931046 +( -265 -697.56322217813931 129 ) ( -271 -697.56322217813931 145 ) ( -263 -697.56322217813931 145 ) tlight02 -1 1 0 1 1 +( -263 -697.56322217813931 129 ) ( -263 -505.56322217813931 129 ) ( -265 -505.56322217813931 129 ) tlight02 -1 -23.1254 0 1 0.5 +( -271 -505.56322217813931 145 ) ( -263 -505.56322217813931 145 ) ( -263 -697.56322217813931 145 ) tlight02 61.0421 -19.0019 90 1.5 0.333333 +( -265 -505.56322217813931 129 ) ( -263 -505.56322217813931 129 ) ( -263 -505.56322217813931 145 ) tlight02 -1 1 0 1 1 +( -263 -505.56322217813931 145 ) ( -263 -505.56322217813931 129 ) ( -263 -697.56322217813931 129 ) tlight02 63.1254 1 0 0.5 1 +} +// brush 2 +{ +( -269 -505.56322217813931 121 ) ( -269 -504.06322217813931 121 ) ( -269 -505.56322217813931 121.03125 ) tech02_1 5.5343 62.4537 0 1.65804 0.163584 +( -267 -697.56322217813931 119 ) ( -267.24999999999989 -697.56322217813931 119 ) ( -267 -697.56322217813931 119.03125 ) tech02_1 -3 57 180 1 -1 +( -267 -697.56322217813931 119 ) ( -267 -696.06322217813931 119 ) ( -267.24999999999989 -697.56322217813931 119 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -505.56322217813931 121 ) ( -269.25 -505.56322217813931 121 ) ( -269 -504.06322217813931 121 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -505.56322217813931 121 ) ( -269 -505.56322217813931 121.03125 ) ( -269.25 -505.56322217813931 121 ) tech02_1 -3 57 180 1 -1 +( -267 -697.56322217813931 119 ) ( -267 -697.56322217813931 119.03125 ) ( -267 -696.06322217813931 119 ) tech02_1 18.0421 57 0 1.5 1 +} +// brush 3 +{ +( -269 -505.56322217813931 59 ) ( -269 -505.56322217813931 119 ) ( -269 -507.56322217813931 119 ) tech02_1 -1 56.0576 90 0.2 0.241259 +( -269 -507.56322217813931 59 ) ( -269 -507.56322217813931 119 ) ( -267 -507.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -507.56322217813931 59 ) ( -267 -505.56322217813931 59 ) ( -269 -505.56322217813931 59 ) tech02_1 -31 19.8773 180 0.2 0.3 +( -269 -505.56322217813931 119 ) ( -267 -505.56322217813931 119 ) ( -267 -507.56322217813931 119 ) tech02_1 -31 19.8773 180 0.2 0.3 +( -269 -505.56322217813931 59 ) ( -267 -505.56322217813931 59 ) ( -267 -505.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -505.56322217813931 119 ) ( -267 -505.56322217813931 59 ) ( -267 -507.56322217813931 59 ) tech02_1 0 19.8773 90 0.2 0.3 +} +// brush 4 +{ +( -269 -505.56322217813931 59 ) ( -269 -504.06322217813931 59 ) ( -269 -505.56322217813931 59.03125 ) tech02_1 8.04214 21.1844 0 1.5 0.248708 +( -267 -697.56322217813931 57 ) ( -267.24999999999989 -697.56322217813931 57 ) ( -267 -697.56322217813931 57.03125 ) tech02_1 -3 57 180 1 -1 +( -267 -697.56322217813931 57 ) ( -267 -696.06322217813931 57 ) ( -267.24999999999989 -697.56322217813931 57 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -505.56322217813931 59 ) ( -269.25 -505.56322217813931 59 ) ( -269 -504.06322217813931 59 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -505.56322217813931 59 ) ( -269 -505.56322217813931 59.03125 ) ( -269.25 -505.56322217813931 59 ) tech02_1 -3 57 180 1 -1 +( -267 -697.56322217813931 57 ) ( -267 -697.56322217813931 57.03125 ) ( -267 -696.06322217813931 57 ) tech02_1 18.0421 57 0 1.5 1 +} +// brush 5 +{ +( -269 -695.56322217813931 59 ) ( -269 -695.56322217813931 119 ) ( -269 -697.56322217813931 119 ) tech02_1 -3 20.1245 90 0.2 0.202399 +( -269 -697.56322217813931 59 ) ( -269 -697.56322217813931 119 ) ( -267 -697.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -697.56322217813931 59 ) ( -267 -695.56322217813931 59 ) ( -269 -695.56322217813931 59 ) tech02_1 -31 41.2104 180 0.2 0.3 +( -269 -695.56322217813931 119 ) ( -267 -695.56322217813931 119 ) ( -267 -697.56322217813931 119 ) tech02_1 -31 41.2104 180 0.2 0.3 +( -269 -695.56322217813931 59 ) ( -267 -695.56322217813931 59 ) ( -267 -695.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -695.56322217813931 119 ) ( -267 -695.56322217813931 59 ) ( -267 -697.56322217813931 59 ) tech02_1 0 41.2104 90 0.2 0.3 +} +// brush 6 +{ +( -267 -505.56322217813931 121 ) ( -267 -504.06322217813931 121 ) ( -267 -505.56322217813931 122 ) tech01_1 5.04214 57 0 1.5 1 +( -263 -697.56322217813931 57 ) ( -263.49999999999989 -697.56322217813931 57 ) ( -263 -697.56322217813931 58 ) tech01_1 5 57 180 1 -1 +( -263 -697.56322217813931 57 ) ( -263 -696.06322217813931 57 ) ( -263.49999999999989 -697.56322217813931 57 ) tech01_1 5.04214 -5 90 1.5 1 +( -267 -505.56322217813931 121 ) ( -267.5 -505.56322217813931 121 ) ( -267 -504.06322217813931 121 ) tech01_1 5.04214 -5 90 1.5 1 +( -267 -505.56322217813931 121 ) ( -267 -505.56322217813931 122 ) ( -267.5 -505.56322217813931 121 ) tech01_1 5 57 180 1 -1 +( -263 -697.56322217813931 57 ) ( -263 -697.56322217813931 58 ) ( -263 -696.06322217813931 57 ) tech01_1 5.04214 57 0 1.5 1 +} +} +// entity 126 +{ +"classname" "light" +"origin" "-279 -690 129" +"light" "200" +"angle" "90" +"_tb_group" "30" +} +// entity 127 +{ +"classname" "light" +"origin" "-279 -602 129" +"light" "200" +"angle" "90" +"_tb_group" "30" +} +// entity 128 +{ +"classname" "light" +"origin" "-279 -514 129" +"light" "200" +"angle" "90" +"_tb_group" "30" +} +// entity 129 +{ +"classname" "func_worldtext_banner" +"origin" "-270 -602 89" +"angle" "180" +"worldtext" "Guns can be holstered\nin six spots on your\nbody. Thighs, hips\nand shoulders.\nTry it out!$You can tweak\nholster positions and\nthresholds in the VR\nsettings menu." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "30" +} +// entity 130 +{ +"classname" "item_spikes" +"origin" "-468 -572 29" +} +// entity 131 +{ +"classname" "item_lava_spikes" +"origin" "-468 -604 37" +} +// entity 132 +{ +"classname" "item_shells" +"origin" "-496 -732 29" +} +// entity 133 +{ +"classname" "item_shells" +"origin" "-468 -652 29" +} +// entity 134 +{ +"classname" "item_shells" +"origin" "-468 -732 29" +} +// entity 135 +{ +"classname" "item_plasma" +"origin" "-464 -524 37" +} +// entity 136 +{ +"classname" "item_plasma" +"origin" "-496 -524 37" +} +// entity 137 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "BigBanner" +"_tb_id" "31" +// brush 0 +{ +( -269 -247.56322217813931 119 ) ( -269 -246.09447217813931 119 ) ( -269 -247.56322217813931 119.93750000000001 ) black 13.6601 14.9333 0 1.46875 0.9375 +( -267 -435.56322217813931 59 ) ( -267.25 -435.56322217813931 59 ) ( -267 -435.56322217813931 59.9375 ) black -4 14.9333 180 0.25 -0.9375 +( -267 -435.56322217813931 59 ) ( -267 -434.09447217813931 59 ) ( -267.25 -435.56322217813931 59 ) black 13.6601 4 90 1.46875 0.25 +( -269 -247.56322217813931 119 ) ( -269.25 -247.56322217813931 119 ) ( -269 -246.09447217813931 119 ) black 13.6601 4 90 1.46875 0.25 +( -269 -247.56322217813931 119 ) ( -269 -247.56322217813931 119.93750000000001 ) ( -269.25 -247.56322217813931 119 ) black -4 14.9333 180 0.25 -0.9375 +( -267 -435.56322217813931 59 ) ( -267 -435.56322217813931 59.9375 ) ( -267 -434.09447217813931 59 ) black 13.6601 14.9333 0 1.46875 0.9375 +} +// brush 1 +{ +( -265 -245.56322217813931 129 ) ( -271 -245.56322217813931 145 ) ( -271 -437.56322217813931 145 ) tlight02 1.49799 34.5539 0 0.664801 0.931046 +( -265 -437.56322217813931 129 ) ( -271 -437.56322217813931 145 ) ( -263 -437.56322217813931 145 ) tlight02 -1 1 0 1 1 +( -263 -437.56322217813931 129 ) ( -263 -245.56322217813931 129 ) ( -265 -245.56322217813931 129 ) tlight02 -1 -23.1254 0 1 0.5 +( -271 -245.56322217813931 145 ) ( -263 -245.56322217813931 145 ) ( -263 -437.56322217813931 145 ) tlight02 61.0421 -19.0019 90 1.5 0.333333 +( -265 -245.56322217813931 129 ) ( -263 -245.56322217813931 129 ) ( -263 -245.56322217813931 145 ) tlight02 -1 1 0 1 1 +( -263 -245.56322217813931 145 ) ( -263 -245.56322217813931 129 ) ( -263 -437.56322217813931 129 ) tlight02 63.1254 1 0 0.5 1 +} +// brush 2 +{ +( -269 -245.56322217813931 121 ) ( -269 -244.06322217813931 121 ) ( -269 -245.56322217813931 121.03125 ) tech02_1 5.5343 62.4537 0 1.65804 0.163584 +( -267 -437.56322217813931 119 ) ( -267.25 -437.56322217813931 119 ) ( -267 -437.56322217813931 119.03125 ) tech02_1 -3 57 180 1 -1 +( -267 -437.56322217813931 119 ) ( -267 -436.06322217813931 119 ) ( -267.25 -437.56322217813931 119 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -245.56322217813931 121 ) ( -269.25 -245.56322217813931 121 ) ( -269 -244.06322217813931 121 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -245.56322217813931 121 ) ( -269 -245.56322217813931 121.03125 ) ( -269.25 -245.56322217813931 121 ) tech02_1 -3 57 180 1 -1 +( -267 -437.56322217813931 119 ) ( -267 -437.56322217813931 119.03125 ) ( -267 -436.06322217813931 119 ) tech02_1 18.0421 57 0 1.5 1 +} +// brush 3 +{ +( -269 -245.56322217813931 59 ) ( -269 -245.56322217813931 119 ) ( -269 -247.56322217813931 119 ) tech02_1 -1 56.0576 90 0.2 0.241259 +( -269 -247.56322217813931 59 ) ( -269 -247.56322217813931 119 ) ( -267 -247.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -247.56322217813931 59 ) ( -267 -245.56322217813931 59 ) ( -269 -245.56322217813931 59 ) tech02_1 -31 19.8773 180 0.2 0.3 +( -269 -245.56322217813931 119 ) ( -267 -245.56322217813931 119 ) ( -267 -247.56322217813931 119 ) tech02_1 -31 19.8773 180 0.2 0.3 +( -269 -245.56322217813931 59 ) ( -267 -245.56322217813931 59 ) ( -267 -245.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -245.56322217813931 119 ) ( -267 -245.56322217813931 59 ) ( -267 -247.56322217813931 59 ) tech02_1 0 19.8773 90 0.2 0.3 +} +// brush 4 +{ +( -269 -245.56322217813931 59 ) ( -269 -244.06322217813931 59 ) ( -269 -245.56322217813931 59.03125 ) tech02_1 8.04214 21.1844 0 1.5 0.248708 +( -267 -437.56322217813931 57 ) ( -267.25 -437.56322217813931 57 ) ( -267 -437.56322217813931 57.03125 ) tech02_1 -3 57 180 1 -1 +( -267 -437.56322217813931 57 ) ( -267 -436.06322217813931 57 ) ( -267.25 -437.56322217813931 57 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -245.56322217813931 59 ) ( -269.25 -245.56322217813931 59 ) ( -269 -244.06322217813931 59 ) tech02_1 18.0421 3 90 1.5 1 +( -269 -245.56322217813931 59 ) ( -269 -245.56322217813931 59.03125 ) ( -269.25 -245.56322217813931 59 ) tech02_1 -3 57 180 1 -1 +( -267 -437.56322217813931 57 ) ( -267 -437.56322217813931 57.03125 ) ( -267 -436.06322217813931 57 ) tech02_1 18.0421 57 0 1.5 1 +} +// brush 5 +{ +( -269 -435.56322217813931 59 ) ( -269 -435.56322217813931 119 ) ( -269 -437.56322217813931 119 ) tech02_1 -3 20.1245 90 0.2 0.202399 +( -269 -437.56322217813931 59 ) ( -269 -437.56322217813931 119 ) ( -267 -437.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -437.56322217813931 59 ) ( -267 -435.56322217813931 59 ) ( -269 -435.56322217813931 59 ) tech02_1 -31 41.2104 180 0.2 0.3 +( -269 -435.56322217813931 119 ) ( -267 -435.56322217813931 119 ) ( -267 -437.56322217813931 119 ) tech02_1 -31 41.2104 180 0.2 0.3 +( -269 -435.56322217813931 59 ) ( -267 -435.56322217813931 59 ) ( -267 -435.56322217813931 119 ) tech02_1 0 20.6669 90 0.2 -0.3 +( -267 -435.56322217813931 119 ) ( -267 -435.56322217813931 59 ) ( -267 -437.56322217813931 59 ) tech02_1 0 41.2104 90 0.2 0.3 +} +// brush 6 +{ +( -267 -245.56322217813931 121 ) ( -267 -244.06322217813931 121 ) ( -267 -245.56322217813931 122 ) tech01_1 5.04214 57 0 1.5 1 +( -263 -437.56322217813931 57 ) ( -263.5 -437.56322217813931 57 ) ( -263 -437.56322217813931 58 ) tech01_1 5 57 180 1 -1 +( -263 -437.56322217813931 57 ) ( -263 -436.06322217813931 57 ) ( -263.5 -437.56322217813931 57 ) tech01_1 5.04214 -5 90 1.5 1 +( -267 -245.56322217813931 121 ) ( -267.5 -245.56322217813931 121 ) ( -267 -244.06322217813931 121 ) tech01_1 5.04214 -5 90 1.5 1 +( -267 -245.56322217813931 121 ) ( -267 -245.56322217813931 122 ) ( -267.5 -245.56322217813931 121 ) tech01_1 5 57 180 1 -1 +( -263 -437.56322217813931 57 ) ( -263 -437.56322217813931 58 ) ( -263 -436.06322217813931 57 ) tech01_1 5.04214 57 0 1.5 1 +} +} +// entity 138 +{ +"classname" "light" +"origin" "-279 -430 129" +"light" "200" +"angle" "90" +"_tb_group" "31" +} +// entity 139 +{ +"classname" "light" +"origin" "-279 -342 129" +"light" "200" +"angle" "90" +"_tb_group" "31" +} +// entity 140 +{ +"classname" "light" +"origin" "-279 -254 129" +"light" "200" +"angle" "90" +"_tb_group" "31" +} +// entity 141 +{ +"classname" "func_worldtext_banner" +"origin" "-270 -342 89" +"angle" "180" +"worldtext" "Some weapons have\nalternate firing modes.\nLook for a button on\nthe weapon itself, and\npress it with your\nother hand." +"worldtext_halign" "1" +"speed" "0.085" +"_tb_group" "31" +} +// entity 142 +{ +"classname" "trigger_changelevel" +"map" "start" +// brush 0 +{ +( -352 8901 8489.078755282364 ) ( -352 -7483 8489.078755282364 ) ( -352 -7483 -7894.9212447176351 ) trigger -7 -54.652 180 1 -1 +( -7208 141 8489.078755282364 ) ( 9176 141 8489.078755282364 ) ( 9176 141 -7894.9212447176351 ) trigger 12 -54.652 0 1 1 +( -7208 8901 17.078755282365023 ) ( -7208 -7483 17.078755282365023 ) ( 9176 8901 17.078755282365023 ) trigger -7 -12 270 1 1 +( -7208 -7483 169.07875528236502 ) ( -7208 8901 169.07875528236502 ) ( 9176 8901 169.07875528236502 ) trigger -7 -12 270 1 1 +( 9176 189 8489.078755282364 ) ( -7208 189 8489.078755282364 ) ( 9176 189 -7894.9212447176351 ) trigger 12 -54.652 0 1 1 +( -304 -7483 8489.078755282364 ) ( -304 8901 8489.078755282364 ) ( -304 -7483 -7894.9212447176351 ) trigger -7 -54.652 180 1 -1 +} +} +// entity 143 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "32" +// brush 0 +{ +( -112 -712 17.078755282366501 ) ( -104 -719 71.078755282366501 ) ( -104 -729 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( -96 -729 71.078755282366501 ) ( -88 -736 17.078755282366501 ) ( -112 -736 17.078755282366501 ) tlight11 0 1.07875 0 1 1 +( -112 -736 17.078755282366501 ) ( -88 -736 17.078755282366501 ) ( -88 -712 17.078755282366501 ) tlight11 0 40 0 1 1 +( -96 -719 71.078755282366501 ) ( -96 -729 71.078755282366501 ) ( -104 -729 71.078755282366501 ) tlight11 12.29 56 0 1 1 +( -88 -712 17.078755282366501 ) ( -96 -719 71.078755282366501 ) ( -104 -719 71.078755282366501 ) tlight11 0 1.07875 0 1 1 +( -88 -712 17.078755282366501 ) ( -88 -736 17.078755282366501 ) ( -96 -729 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +} +} +// entity 144 +{ +"classname" "light" +"origin" "-120 -724 47" +"light" "200" +"_tb_group" "32" +} +// entity 145 +{ +"classname" "light" +"origin" "-80 -724 47" +"light" "200" +"_tb_group" "32" +} +// entity 146 +{ +"classname" "light" +"origin" "-100 -744 47" +"light" "200" +"_tb_group" "32" +} +// entity 147 +{ +"classname" "light" +"origin" "-100 -704 47" +"light" "200" +"_tb_group" "32" +} +// entity 148 +{ +"classname" "func_group" +"_tb_type" "_tb_group" +"_tb_name" "Light post" +"_tb_id" "33" +// brush 0 +{ +( 92 -716 17.078755282366501 ) ( 100 -723 71.078755282366501 ) ( 100 -733 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( 108 -733 71.078755282366501 ) ( 116 -740 17.078755282366501 ) ( 92 -740 17.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( 92 -740 17.078755282366501 ) ( 116 -740 17.078755282366501 ) ( 116 -716 17.078755282366501 ) tlight11 -8 40 0 1 1 +( 108 -723 71.078755282366501 ) ( 108 -733 71.078755282366501 ) ( 100 -733 71.078755282366501 ) tlight11 -11.71 56 0 1 1 +( 116 -716 17.078755282366501 ) ( 108 -723 71.078755282366501 ) ( 100 -723 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +( 116 -716 17.078755282366501 ) ( 116 -740 17.078755282366501 ) ( 108 -733 71.078755282366501 ) tlight11 -8 1.07875 0 1 1 +} +} +// entity 149 +{ +"classname" "light" +"origin" "84 -728 47" +"light" "200" +"_tb_group" "33" +} +// entity 150 +{ +"classname" "light" +"origin" "124 -728 47" +"light" "200" +"_tb_group" "33" +} +// entity 151 +{ +"classname" "light" +"origin" "104 -748 47" +"light" "200" +"_tb_group" "33" +} +// entity 152 +{ +"classname" "light" +"origin" "104 -708 47" +"light" "200" +"_tb_group" "33" +} diff --git a/models/finger_index.mdl b/models/finger_index.mdl new file mode 100644 index 00000000..4f877d88 Binary files /dev/null and b/models/finger_index.mdl differ diff --git a/models/finger_middle.mdl b/models/finger_middle.mdl new file mode 100644 index 00000000..16dd0952 Binary files /dev/null and b/models/finger_middle.mdl differ diff --git a/models/finger_pinky.mdl b/models/finger_pinky.mdl new file mode 100644 index 00000000..1a17a4cc Binary files /dev/null and b/models/finger_pinky.mdl differ diff --git a/models/finger_ring.mdl b/models/finger_ring.mdl new file mode 100644 index 00000000..e787ce46 Binary files /dev/null and b/models/finger_ring.mdl differ diff --git a/models/finger_thumb.mdl b/models/finger_thumb.mdl new file mode 100644 index 00000000..80d20cee Binary files /dev/null and b/models/finger_thumb.mdl differ diff --git a/models/g_shot.mdl b/models/g_shot.mdl new file mode 100644 index 00000000..a3885681 Binary files /dev/null and b/models/g_shot.mdl differ diff --git a/models/g_shot0.mdl b/models/g_shot0.mdl new file mode 100644 index 00000000..af2ddaac Binary files /dev/null and b/models/g_shot0.mdl differ diff --git a/models/hand.mdl b/models/hand.mdl index fa61ef74..12b0226d 100644 Binary files a/models/hand.mdl and b/models/hand.mdl differ diff --git a/models/hand_004.blend b/models/hand_004.blend new file mode 100644 index 00000000..f83f0c44 Binary files /dev/null and b/models/hand_004.blend differ diff --git a/models/hand_and_fingers.blend b/models/hand_and_fingers.blend new file mode 100644 index 00000000..cb70b3a0 Binary files /dev/null and b/models/hand_and_fingers.blend differ diff --git a/models/hand_base.mdl b/models/hand_base.mdl new file mode 100644 index 00000000..ee71e35a Binary files /dev/null and b/models/hand_base.mdl differ diff --git a/models/hand_new.mdl b/models/hand_new.mdl new file mode 100644 index 00000000..2cf48192 Binary files /dev/null and b/models/hand_new.mdl differ diff --git a/models/hand_new_tweaked.blend b/models/hand_new_tweaked.blend new file mode 100644 index 00000000..755b0ec2 Binary files /dev/null and b/models/hand_new_tweaked.blend differ diff --git a/models/handnew.blend b/models/handnew.blend new file mode 100644 index 00000000..a1707359 Binary files /dev/null and b/models/handnew.blend differ diff --git a/models/openhand.blend b/models/openhand.blend new file mode 100644 index 00000000..25f1ac5b Binary files /dev/null and b/models/openhand.blend differ diff --git a/models/openhand.mdl b/models/openhand.mdl new file mode 100644 index 00000000..8989c85e Binary files /dev/null and b/models/openhand.mdl differ diff --git a/models/textures/handopen.png b/models/textures/handopen.png new file mode 100644 index 00000000..840599b9 Binary files /dev/null and b/models/textures/handopen.png differ diff --git a/models/textures/v_lava2_vr.png b/models/textures/v_lava2_vr.png new file mode 100644 index 00000000..f8725a50 Binary files /dev/null and b/models/textures/v_lava2_vr.png differ diff --git a/models/textures/v_lava2_vr.psd b/models/textures/v_lava2_vr.psd new file mode 100644 index 00000000..598b0535 Binary files /dev/null and b/models/textures/v_lava2_vr.psd differ diff --git a/models/textures/v_lava_vr.png b/models/textures/v_lava_vr.png new file mode 100644 index 00000000..189938fd Binary files /dev/null and b/models/textures/v_lava_vr.png differ diff --git a/models/textures/v_lava_vr.psd b/models/textures/v_lava_vr.psd new file mode 100644 index 00000000..772f8ca7 Binary files /dev/null and b/models/textures/v_lava_vr.psd differ diff --git a/models/textures/v_light_1.png b/models/textures/v_light_1.png new file mode 100644 index 00000000..10814ca3 Binary files /dev/null and b/models/textures/v_light_1.png differ diff --git a/models/textures/v_multi2_vr.png b/models/textures/v_multi2_vr.png new file mode 100644 index 00000000..618101e3 Binary files /dev/null and b/models/textures/v_multi2_vr.png differ diff --git a/models/textures/v_multi2_vr.psd b/models/textures/v_multi2_vr.psd new file mode 100644 index 00000000..75154aa0 Binary files /dev/null and b/models/textures/v_multi2_vr.psd differ diff --git a/models/textures/v_multi_vr.png b/models/textures/v_multi_vr.png new file mode 100644 index 00000000..9ae6535b Binary files /dev/null and b/models/textures/v_multi_vr.png differ diff --git a/models/textures/v_multi_vr.psd b/models/textures/v_multi_vr.psd new file mode 100644 index 00000000..c53c1879 Binary files /dev/null and b/models/textures/v_multi_vr.psd differ diff --git a/models/textures/v_plasma_vr.png b/models/textures/v_plasma_vr.png new file mode 100644 index 00000000..b6a36110 Binary files /dev/null and b/models/textures/v_plasma_vr.png differ diff --git a/models/textures/v_plasma_vr.psd b/models/textures/v_plasma_vr.psd new file mode 100644 index 00000000..8d94f7c6 Binary files /dev/null and b/models/textures/v_plasma_vr.psd differ diff --git a/models/v_lava.blend b/models/v_lava.blend new file mode 100644 index 00000000..c95464d1 Binary files /dev/null and b/models/v_lava.blend differ diff --git a/models/v_lava.mdl b/models/v_lava.mdl new file mode 100644 index 00000000..f092c7dc Binary files /dev/null and b/models/v_lava.mdl differ diff --git a/models/v_lava2.blend b/models/v_lava2.blend new file mode 100644 index 00000000..59da6519 Binary files /dev/null and b/models/v_lava2.blend differ diff --git a/models/v_lava2.mdl b/models/v_lava2.mdl new file mode 100644 index 00000000..8117f7ea Binary files /dev/null and b/models/v_lava2.mdl differ diff --git a/models/v_multi.blend b/models/v_multi.blend new file mode 100644 index 00000000..72b6c78f Binary files /dev/null and b/models/v_multi.blend differ diff --git a/models/v_multi.mdl b/models/v_multi.mdl new file mode 100644 index 00000000..f99699a1 Binary files /dev/null and b/models/v_multi.mdl differ diff --git a/models/v_multi2.mdl b/models/v_multi2.mdl new file mode 100644 index 00000000..209f90f0 Binary files /dev/null and b/models/v_multi2.mdl differ diff --git a/models/v_nail2.blend1 b/models/v_nail2.blend1 index da1022db..faefa851 100644 Binary files a/models/v_nail2.blend1 and b/models/v_nail2.blend1 differ diff --git a/models/v_plasma.blend b/models/v_plasma.blend new file mode 100644 index 00000000..db5da819 Binary files /dev/null and b/models/v_plasma.blend differ diff --git a/models/v_plasma.mdl b/models/v_plasma.mdl new file mode 100644 index 00000000..c66dba69 Binary files /dev/null and b/models/v_plasma.mdl differ diff --git a/models/v_rock.blend b/models/v_rock.blend index e09d68b2..7a309633 100644 Binary files a/models/v_rock.blend and b/models/v_rock.blend differ diff --git a/models/v_rock.blend1 b/models/v_rock.blend1 index 5151a221..e09d68b2 100644 Binary files a/models/v_rock.blend1 and b/models/v_rock.blend1 differ diff --git a/models/v_rock2.blend b/models/v_rock2.blend index 6adf497b..8d24aca8 100644 Binary files a/models/v_rock2.blend and b/models/v_rock2.blend differ diff --git a/models/v_rock2.blend1 b/models/v_rock2.blend1 index 75331269..85db241e 100644 Binary files a/models/v_rock2.blend1 and b/models/v_rock2.blend1 differ diff --git a/models/v_star.mdl b/models/v_star.mdl new file mode 100644 index 00000000..f3dc3cfb Binary files /dev/null and b/models/v_star.mdl differ diff --git a/models/wpnbutton.blend b/models/wpnbutton.blend new file mode 100644 index 00000000..7a6fd3e3 Binary files /dev/null and b/models/wpnbutton.blend differ diff --git a/models/wpnbutton.mdl b/models/wpnbutton.mdl new file mode 100644 index 00000000..0cf60c61 Binary files /dev/null and b/models/wpnbutton.mdl differ diff --git a/Misc/QuakeSpasm_512.png b/old/Misc/QuakeSpasm_512.png similarity index 100% rename from Misc/QuakeSpasm_512.png rename to old/Misc/QuakeSpasm_512.png diff --git a/Misc/authmdl_offsets.cfg b/old/Misc/authmdl_offsets.cfg similarity index 100% rename from Misc/authmdl_offsets.cfg rename to old/Misc/authmdl_offsets.cfg diff --git a/Misc/fitzquake080.txt b/old/Misc/fitzquake080.txt similarity index 100% rename from Misc/fitzquake080.txt rename to old/Misc/fitzquake080.txt diff --git a/Misc/fitzquake080sdl.txt b/old/Misc/fitzquake080sdl.txt similarity index 100% rename from Misc/fitzquake080sdl.txt rename to old/Misc/fitzquake080sdl.txt diff --git a/Misc/fitzquake085.txt b/old/Misc/fitzquake085.txt similarity index 100% rename from Misc/fitzquake085.txt rename to old/Misc/fitzquake085.txt diff --git a/Misc/fs_search_order.patch b/old/Misc/fs_search_order.patch similarity index 100% rename from Misc/fs_search_order.patch rename to old/Misc/fs_search_order.patch diff --git a/Misc/mk_header.c b/old/Misc/mk_header.c similarity index 100% rename from Misc/mk_header.c rename to old/Misc/mk_header.c diff --git a/Misc/qs_pak/Makefile b/old/Misc/qs_pak/Makefile similarity index 100% rename from Misc/qs_pak/Makefile rename to old/Misc/qs_pak/Makefile diff --git a/Misc/qs_pak/default.cfg b/old/Misc/qs_pak/default.cfg similarity index 100% rename from Misc/qs_pak/default.cfg rename to old/Misc/qs_pak/default.cfg diff --git a/Misc/qs_pak/default.cfg.orig b/old/Misc/qs_pak/default.cfg.orig similarity index 100% rename from Misc/qs_pak/default.cfg.orig rename to old/Misc/qs_pak/default.cfg.orig diff --git a/Misc/qs_pak/gfx/conback.lmp b/old/Misc/qs_pak/gfx/conback.lmp similarity index 100% rename from Misc/qs_pak/gfx/conback.lmp rename to old/Misc/qs_pak/gfx/conback.lmp diff --git a/Misc/qs_pak/maps/e1m1.ent b/old/Misc/qs_pak/maps/e1m1.ent similarity index 100% rename from Misc/qs_pak/maps/e1m1.ent rename to old/Misc/qs_pak/maps/e1m1.ent diff --git a/Misc/qs_pak/maps/e1m1.ent.orig b/old/Misc/qs_pak/maps/e1m1.ent.orig similarity index 100% rename from Misc/qs_pak/maps/e1m1.ent.orig rename to old/Misc/qs_pak/maps/e1m1.ent.orig diff --git a/Misc/qs_pak/maps/e1m2.ent b/old/Misc/qs_pak/maps/e1m2.ent similarity index 100% rename from Misc/qs_pak/maps/e1m2.ent rename to old/Misc/qs_pak/maps/e1m2.ent diff --git a/Misc/qs_pak/maps/e1m2.ent.orig b/old/Misc/qs_pak/maps/e1m2.ent.orig similarity index 100% rename from Misc/qs_pak/maps/e1m2.ent.orig rename to old/Misc/qs_pak/maps/e1m2.ent.orig diff --git a/Misc/qs_pak/maps/e1m4.ent b/old/Misc/qs_pak/maps/e1m4.ent similarity index 100% rename from Misc/qs_pak/maps/e1m4.ent rename to old/Misc/qs_pak/maps/e1m4.ent diff --git a/Misc/qs_pak/maps/e1m4.ent.orig b/old/Misc/qs_pak/maps/e1m4.ent.orig similarity index 100% rename from Misc/qs_pak/maps/e1m4.ent.orig rename to old/Misc/qs_pak/maps/e1m4.ent.orig diff --git a/Misc/qs_pak/maps/e2m2.ent b/old/Misc/qs_pak/maps/e2m2.ent similarity index 100% rename from Misc/qs_pak/maps/e2m2.ent rename to old/Misc/qs_pak/maps/e2m2.ent diff --git a/Misc/qs_pak/maps/e2m2.ent.orig b/old/Misc/qs_pak/maps/e2m2.ent.orig similarity index 100% rename from Misc/qs_pak/maps/e2m2.ent.orig rename to old/Misc/qs_pak/maps/e2m2.ent.orig diff --git a/Misc/qs_pak/maps/e2m3.ent b/old/Misc/qs_pak/maps/e2m3.ent similarity index 100% rename from Misc/qs_pak/maps/e2m3.ent rename to old/Misc/qs_pak/maps/e2m3.ent diff --git a/Misc/qs_pak/maps/e2m3.ent.orig b/old/Misc/qs_pak/maps/e2m3.ent.orig similarity index 100% rename from Misc/qs_pak/maps/e2m3.ent.orig rename to old/Misc/qs_pak/maps/e2m3.ent.orig diff --git a/Misc/qs_pak/maps/e2m7.ent b/old/Misc/qs_pak/maps/e2m7.ent similarity index 100% rename from Misc/qs_pak/maps/e2m7.ent rename to old/Misc/qs_pak/maps/e2m7.ent diff --git a/Misc/qs_pak/maps/e2m7.ent.orig b/old/Misc/qs_pak/maps/e2m7.ent.orig similarity index 100% rename from Misc/qs_pak/maps/e2m7.ent.orig rename to old/Misc/qs_pak/maps/e2m7.ent.orig diff --git a/Misc/qs_pak/mkpak.sh b/old/Misc/qs_pak/mkpak.sh similarity index 100% rename from Misc/qs_pak/mkpak.sh rename to old/Misc/qs_pak/mkpak.sh diff --git a/Misc/quake_retexturing_project.patch b/old/Misc/quake_retexturing_project.patch similarity index 100% rename from Misc/quake_retexturing_project.patch rename to old/Misc/quake_retexturing_project.patch diff --git a/Misc/run_clang_tidy.py b/old/Misc/run_clang_tidy.py similarity index 100% rename from Misc/run_clang_tidy.py rename to old/Misc/run_clang_tidy.py diff --git a/Misc/systest.c b/old/Misc/systest.c similarity index 100% rename from Misc/systest.c rename to old/Misc/systest.c diff --git a/Quakespasm-Music.txt b/old/Quakespasm-Music.txt similarity index 100% rename from Quakespasm-Music.txt rename to old/Quakespasm-Music.txt diff --git a/Quakespasm.html b/old/Quakespasm.html similarity index 100% rename from Quakespasm.html rename to old/Quakespasm.html diff --git a/Quakespasm.txt b/old/Quakespasm.txt similarity index 100% rename from Quakespasm.txt rename to old/Quakespasm.txt diff --git a/old/asancrash0.txt b/old/asancrash0.txt new file mode 100644 index 00000000..7d421a39 --- /dev/null +++ b/old/asancrash0.txt @@ -0,0 +1,55 @@ +================================================================= +==42788==ERROR: AddressSanitizer: SEGV on unknown address 0x7f6ac96b88f9 (pc 0x56026e8a5c34 bp 0x7ffe9e7d6250 sp 0x7ffe9e7d44a0 T0) +==42788==The signal is caused by a READ memory access. + #0 0x56026e8a5c33 in PR_ExecuteProgram(int) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/pr_exec.cpp + #1 0x56026e9df578 in bool SV_RunThinkImpl<&entvars_s::nextthink, &entvars_s::think, true>(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:160 + #2 0x56026e9b31e4 in SV_RunThink(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:187 + #3 0x56026e9d8cb7 in SV_Physics_Step(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:1605 + #4 0x56026e9d93e2 in SV_Physics() /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:1679 + #5 0x56026e736d02 in Host_ServerFrame() /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:777 + #6 0x56026e737063 in _Host_Frame(float) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:871 + #7 0x56026e737320 in Host_Frame(float) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:950 + #8 0x56026e77c7ff in main /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/main_sdl.cpp:201 + #9 0x7f6a9df4c022 in __libc_start_main (/usr/lib/libc.so.6+0x27022) + #10 0x56026e500f0d in _start (/run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Windows/buildlx/quakespasm-sdl2+0xb3f0d) + +AddressSanitizer can not provide additional info. +SUMMARY: AddressSanitizer: SEGV /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/pr_exec.cpp in PR_ExecuteProgram(int) +==42788==ABORTING + + + +================================================================= +==43203==ERROR: AddressSanitizer: SEGV on unknown address 0x7f6220dfc980 (pc 0x55fb875ba874 bp 0x7ffdafd69cb0 sp 0x7ffdafd67f00 T0) +==43203==The signal is caused by a READ memory access. + #0 0x55fb875ba873 in PR_ExecuteProgram(int) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/pr_exec.cpp + #1 0x55fb876f464d in bool SV_RunThinkImpl<&entvars_s::nextthink, &entvars_s::think, true>(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:165 + #2 0x55fb876c81e4 in SV_RunThink(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:192 + #3 0x55fb876edcb7 in SV_Physics_Step(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:1610 + #4 0x55fb876ee3e2 in SV_Physics() /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:1684 + #5 0x55fb8744bd02 in Host_ServerFrame() /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:777 + #6 0x55fb8744c063 in _Host_Frame(float) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:871 + #7 0x55fb8744c320 in Host_Frame(float) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:950 + #8 0x55fb874917ff in main /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/main_sdl.cpp:201 + #9 0x7f628411d022 in __libc_start_main (/usr/lib/libc.so.6+0x27022) + #10 0x55fb87215f0d in _start (/run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Windows/buildlx/quakespasm-sdl2+0xb3f0d) + + + +================================================================ +==43979==ERROR: AddressSanitizer: SEGV on unknown address 0x7f11d0ef3328 (pc 0x56422a560237 bp 0x7ffd17eef950 sp 0x7ffd17eef8f0 T0) +==43979==The signal is caused by a READ memory access. + #0 0x56422a560236 in PR_ExecuteProgram(int) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/pr_exec.cpp:544 + #1 0x56422a63f66a in bool SV_RunThinkImpl<&entvars_s::nextthink, &entvars_s::think, true>(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:165 + #2 0x56422a620bdc in SV_RunThink(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:192 + #3 0x56422a63e10d in SV_Physics_Step(edict_t*) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:1610 + #4 0x56422a63e622 in SV_Physics() /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/sv_phys.cpp:1684 + #5 0x56422a44c2d1 in Host_ServerFrame() /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:777 + #6 0x56422a44c546 in _Host_Frame(float) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:871 + #7 0x56422a44c7ee in Host_Frame(float) /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/host.cpp:950 + #8 0x56422a47ce7b in main /run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Quake/main_sdl.cpp:201 + #9 0x7f12344f3022 in __libc_start_main (/usr/lib/libc.so.6+0x27022) + #10 0x56422a28250d in _start (/run/media/vittorioromeo/D2703413703400B1/OHWorkspace/quakevr/Windows/buildlx/quakespasm-sdl2+0x18e50d) + + +Host_Error: NUM_FOR_EDICT: bad pointer diff --git a/old/config10.cfg b/old/config10.cfg new file mode 100644 index 00000000..de7887c1 --- /dev/null +++ b/old/config10.cfg @@ -0,0 +1,2243 @@ +unbindall +bind "TAB" "+showscores" +bind "ENTER" "+jump" +bind "ESCAPE" "togglemenu" +bind "SPACE" "+jump" +bind "+" "sizeup" +bind "," "+moveleft" +bind "-" "sizedown" +bind "." "+moveright" +bind "/" "impulse 10" +bind "0" "impulse 0" +bind "1" "impulse 10" +bind "2" "impulse 2" +bind "3" "impulse 12" +bind "4" "impulse 15" +bind "5" "impulse 16" +bind "6" "impulse 6" +bind "7" "impulse 7" +bind "8" "impulse 8" +bind "=" "sizeup" +bind "\" "+mlook" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+movedown" +bind "d" "+moveright" +bind "k" "+grableft" +bind "l" "+grabright" +bind "s" "+back" +bind "t" "messagemode" +bind "w" "+forward" +bind "z" "+lookdown" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "impulse 10" +bind "RIGHTARROW" "+right" +bind "ALT" "+strafe" +bind "CTRL" "+attack" +bind "SHIFT" "+speed" +bind "F1" "help" +bind "F2" "menu_save" +bind "F3" "menu_load" +bind "F4" "menu_options" +bind "F5" "menu_multiplayer" +bind "F6" "echo Quicksaving...; wait; save quick" +bind "F9" "echo Quickloading...; wait; load quick" +bind "F10" "quit" +bind "F11" "zoom_in" +bind "F12" "screenshot" +bind "INS" "+klook" +bind "DEL" "+lookdown" +bind "PGDN" "+lookup" +bind "END" "centerview" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+offhandattack" +bind "MOUSE3" "+mlook" +bind "MWHEELDOWN" "impulse 12" +bind "PAUSE" "pause" +_cl_color "0" +_cl_name "player" +_snd_mixahead "0.1" +bgm_extmusic "1" +bgmvolume "1" +cfg_unbindall "1" +cl_alwaysrun "1" +cl_backspeed "200" +cl_forwardspeed "400" +cl_maxpitch "90" +cl_minpitch "-90" +cl_movespeedkey "0.5" +contrast "1" +crosshair "0" +external_ents "1" +fov_adapt "1" +gamma "1" +gl_farclip "16384" +gl_flashblend "0" +gl_fullbrights "1" +gl_overbright "1" +gl_overbright_models "1" +gl_subdivide_size "128" +gl_texture_anisotropy "1" +gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" +gl_triplebuffer "1" +host_maxfps "72" +joy_deadzone "0.175" +joy_deadzone_trigger "0.2" +joy_enable "1" +joy_exponent "3" +joy_exponent_move "3" +joy_invert "0" +joy_sensitivity_pitch "150" +joy_sensitivity_yaw "300" +joy_swapmovelook "0" +lookspring "1" +lookstrafe "0" +m_forward "1" +m_pitch "0.022" +m_side "0.8" +m_yaw "0.022" +r_clearcolor "2" +r_dynamic "1" +r_lavaalpha "0" +r_novis "0" +r_oldwater "1" +r_particle_mult "1" +r_particles "1" +r_scale "1" +r_shadows "1" +r_slimealpha "0" +r_telealpha "0" +r_viewmodel_quake "0" +r_wateralpha "0.333" +saved1 "0" +saved2 "0" +saved3 "0" +saved4 "0" +savedgamecfg "0" +scr_conalpha "0.5" +scr_conscale "1.1" +scr_conspeed "500" +scr_conwidth "0" +scr_crosshairscale "1" +scr_menuscale "1.1" +scr_sbaralpha "0.75" +scr_sbarscale "1.1" +sensitivity "3.5" +sv_altnoclip "1" +sys_throttle "0.02" +vid_borderless "0" +vid_bpp "24" +vid_desktopfullscreen "0" +vid_fsaa "0" +vid_fullscreen "0" +vid_height "900" +vid_refreshrate "60" +vid_vsync "0" +vid_width "1600" +viewsize "100" +volume "0.8" +vr_2h_angle_threshold "0.65" +vr_2h_mode "2" +vr_2h_virtual_stock_factor "0.5" +vr_aimmode "6" +vr_ammobox_drops "0" +vr_ammobox_drops_chance_mult "1.0" +vr_body_interactions "1" +vr_crosshair "2" +vr_crosshair_alpha "0.85" +vr_crosshair_depth "0" +vr_crosshair_size "1" +vr_crosshairy "0" +vr_deadzone "25" +vr_debug_print_handvel "0" +vr_debug_show_hand_pos_and_rot "0" +vr_enable_joystick_turn "1" +vr_enemy_drops "0" +vr_enemy_drops_chance_mult "1.0" +vr_finger_base_x "0" +vr_finger_base_y "0.0" +vr_finger_base_z "0.0" +vr_finger_index_x "-0.325" +vr_finger_index_y "0.6125" +vr_finger_index_z "-1.825" +vr_finger_middle_x "-0.3625" +vr_finger_middle_y "0.5125" +vr_finger_middle_z "-0.3125" +vr_finger_pinky_x "-0.325" +vr_finger_pinky_y "1.1625" +vr_finger_pinky_z "1.6375" +vr_finger_ring_x "-0.3625" +vr_finger_ring_y "0.7" +vr_finger_ring_z "0.65" +vr_finger_thumb_x "-0.3625" +vr_finger_thumb_y "3.2" +vr_finger_thumb_z "-1.925" +vr_fingers_and_base_offhand_x "0" +vr_fingers_and_base_offhand_y "0" +vr_fingers_and_base_offhand_z "0.0" +vr_fingers_and_base_x "-0.625" +vr_fingers_and_base_y "-0.125" +vr_fingers_and_base_z "-1.625" +vr_fingers_x "-5.05" +vr_fingers_y "-0.1" +vr_fingers_z "-0.1875" +vr_floor_offset "-21" +vr_forcegrab_eligible_haptics "1" +vr_forcegrab_eligible_particles "1" +vr_forcegrab_mode "1" +vr_forcegrab_powermult "1.0" +vr_forcegrab_radius "18" +vr_forcegrab_range "150.0" +vr_gun_z_offset "-1" +vr_gunangle "39.5" +vr_gunmodelpitch "7" +vr_gunmodelscale "0.7" +vr_gunmodely "1.3" +vr_gunyaw "4" +vr_height_calibration "1.57799" +vr_hip_holster_thresh "6.5" +vr_hip_offset_x "-3.5" +vr_hip_offset_y "7.0" +vr_hip_offset_z "0" +vr_holster_haptics "2" +vr_holster_mode "0" +vr_hud_scale "0.025" +vr_leg_holster_model_enabled "1" +vr_leg_holster_model_scale "0.5" +vr_leg_holster_model_x_offset "1" +vr_leg_holster_model_y_offset "1.25" +vr_leg_holster_model_z_offset "2.25" +vr_melee_bloodlust "0" +vr_melee_bloodlust_mult "1.0" +vr_melee_dmg_multiplier "1.0" +vr_melee_range_multiplier "1.0" +vr_melee_threshold "7" +vr_menu_distance "76" +vr_menu_scale "0.2" +vr_menumode "0" +vr_movement_mode "1" +vr_msaa "9" +vr_offhandpitch "40.25" +vr_offhandyaw "-4" +vr_openhand_offset_x "0" +vr_openhand_offset_y "0" +vr_openhand_offset_z "0" +vr_openhand_pitch "0.0" +vr_openhand_roll "0.0" +vr_openhand_yaw "0.0" +vr_player_shadows "2" +vr_positional_damage "1" +vr_roomscale_jump "1" +vr_roomscale_jump_threshold "0.8" +vr_roomscale_move_mult "1" +vr_sbar_mode "1" +vr_sbar_offset_pitch "1" +vr_sbar_offset_roll "-0.3" +vr_sbar_offset_x "-12" +vr_sbar_offset_y "1" +vr_sbar_offset_yaw "1.6" +vr_sbar_offset_z "-3" +vr_shoulder_holster_offset_x "-0.5" +vr_shoulder_holster_offset_y "2.25" +vr_shoulder_holster_offset_z "-0.25" +vr_shoulder_holster_thresh "7.8" +vr_shoulder_offset_x "-1" +vr_shoulder_offset_y "1.75" +vr_shoulder_offset_z "16" +vr_show_hip_holsters "0" +vr_show_shoulder_holsters "0" +vr_show_upper_holsters "0" +vr_show_virtual_stock "0" +vr_snap_turn "0" +vr_teleport_enabled "0" +vr_teleport_range "400" +vr_turn_speed "3.25" +vr_upper_holster_offset_x "-4.25" +vr_upper_holster_offset_y "7" +vr_upper_holster_offset_z "8.5" +vr_upper_holster_thresh "6.5" +vr_virtual_stock_thresh "10" +vr_vrtorso_debuglines_enabled "0" +vr_vrtorso_enabled "1" +vr_vrtorso_head_z_mult "33" +vr_vrtorso_pitch "1.5" +vr_vrtorso_roll "0" +vr_vrtorso_x_offset "-2.75" +vr_vrtorso_x_scale "0.675" +vr_vrtorso_y_offset "-4.75" +vr_vrtorso_y_scale "0.675" +vr_vrtorso_yaw "0" +vr_vrtorso_z_offset "-45" +vr_vrtorso_z_scale "1.1" +vr_weapon_cycle_mode "1" +vr_weapon_throw_damage_mult "1.0" +vr_weapon_throw_mode "0" +vr_weapon_throw_velocity_mult "1.0" +vr_weapondrop_particles "1" +vr_wofs_2h_dispmd_01 "0.0" +vr_wofs_2h_dispmd_02 "1" +vr_wofs_2h_dispmd_03 "1" +vr_wofs_2h_dispmd_04 "1" +vr_wofs_2h_dispmd_05 "1" +vr_wofs_2h_dispmd_06 "1" +vr_wofs_2h_dispmd_07 "1" +vr_wofs_2h_dispmd_08 "1" +vr_wofs_2h_dispmd_09 "0" +vr_wofs_2h_dispmd_10 "1" +vr_wofs_2h_dispmd_11 "1" +vr_wofs_2h_dispmd_12 "1" +vr_wofs_2h_dispmd_13 "1" +vr_wofs_2h_dispmd_14 "1" +vr_wofs_2h_dispmd_15 "1" +vr_wofs_2h_dispmd_16 "1" +vr_wofs_2h_dispmd_17 "0.0" +vr_wofs_2h_dispmd_18 "0.0" +vr_wofs_2h_dispmd_19 "0.0" +vr_wofs_2h_dispmd_20 "0.0" +vr_wofs_2h_dispmd_21 "0.0" +vr_wofs_2h_dispmd_22 "0.0" +vr_wofs_2h_dispmd_23 "0.0" +vr_wofs_2h_dispmd_24 "0.0" +vr_wofs_2h_dispmd_25 "0.0" +vr_wofs_2h_dispmd_26 "0.0" +vr_wofs_2h_dispmd_27 "0.0" +vr_wofs_2h_dispmd_28 "0.0" +vr_wofs_2h_dispmd_29 "0.0" +vr_wofs_2h_dispmd_30 "0.0" +vr_wofs_2h_dispmd_31 "0.0" +vr_wofs_2h_dispmd_32 "0.0" +vr_wofs_2h_fxd_hp_01 "0.0" +vr_wofs_2h_fxd_hp_02 "0.0" +vr_wofs_2h_fxd_hp_03 "0.0" +vr_wofs_2h_fxd_hp_04 "0.0" +vr_wofs_2h_fxd_hp_05 "0.0" +vr_wofs_2h_fxd_hp_06 "0.0" +vr_wofs_2h_fxd_hp_07 "0.0" +vr_wofs_2h_fxd_hp_08 "0.0" +vr_wofs_2h_fxd_hp_09 "0.0" +vr_wofs_2h_fxd_hp_10 "0.0" +vr_wofs_2h_fxd_hp_11 "0.0" +vr_wofs_2h_fxd_hp_12 "0.0" +vr_wofs_2h_fxd_hp_13 "0.0" +vr_wofs_2h_fxd_hp_14 "0.0" +vr_wofs_2h_fxd_hp_15 "0.0" +vr_wofs_2h_fxd_hp_16 "0.0" +vr_wofs_2h_fxd_hp_17 "0.0" +vr_wofs_2h_fxd_hp_18 "0.0" +vr_wofs_2h_fxd_hp_19 "0.0" +vr_wofs_2h_fxd_hp_20 "0.0" +vr_wofs_2h_fxd_hp_21 "0.0" +vr_wofs_2h_fxd_hp_22 "0.0" +vr_wofs_2h_fxd_hp_23 "0.0" +vr_wofs_2h_fxd_hp_24 "0.0" +vr_wofs_2h_fxd_hp_25 "0.0" +vr_wofs_2h_fxd_hp_26 "0.0" +vr_wofs_2h_fxd_hp_27 "0.0" +vr_wofs_2h_fxd_hp_28 "0.0" +vr_wofs_2h_fxd_hp_29 "0.0" +vr_wofs_2h_fxd_hp_30 "0.0" +vr_wofs_2h_fxd_hp_31 "0.0" +vr_wofs_2h_fxd_hp_32 "0.0" +vr_wofs_2h_fxd_hr_01 "0.0" +vr_wofs_2h_fxd_hr_02 "-67.799927" +vr_wofs_2h_fxd_hr_03 "-52.199963" +vr_wofs_2h_fxd_hr_04 "-76.799904" +vr_wofs_2h_fxd_hr_05 "21.600008" +vr_wofs_2h_fxd_hr_06 "-78.599899" +vr_wofs_2h_fxd_hr_07 "-82.999886" +vr_wofs_2h_fxd_hr_08 "-90.400024" +vr_wofs_2h_fxd_hr_09 "0.0" +vr_wofs_2h_fxd_hr_10 "75.799942" +vr_wofs_2h_fxd_hr_11 "-78.599899" +vr_wofs_2h_fxd_hr_12 "-76.799904" +vr_wofs_2h_fxd_hr_13 "21.600008" +vr_wofs_2h_fxd_hr_14 "-78.599899" +vr_wofs_2h_fxd_hr_15 "-82.999886" +vr_wofs_2h_fxd_hr_16 "-90.400024" +vr_wofs_2h_fxd_hr_17 "0.0" +vr_wofs_2h_fxd_hr_18 "0.0" +vr_wofs_2h_fxd_hr_19 "0.0" +vr_wofs_2h_fxd_hr_20 "0.0" +vr_wofs_2h_fxd_hr_21 "0.0" +vr_wofs_2h_fxd_hr_22 "0.0" +vr_wofs_2h_fxd_hr_23 "0.0" +vr_wofs_2h_fxd_hr_24 "0.0" +vr_wofs_2h_fxd_hr_25 "0.0" +vr_wofs_2h_fxd_hr_26 "0.0" +vr_wofs_2h_fxd_hr_27 "0.0" +vr_wofs_2h_fxd_hr_28 "0.0" +vr_wofs_2h_fxd_hr_29 "0.0" +vr_wofs_2h_fxd_hr_30 "0.0" +vr_wofs_2h_fxd_hr_31 "0.0" +vr_wofs_2h_fxd_hr_32 "0.0" +vr_wofs_2h_fxd_hy_01 "0.0" +vr_wofs_2h_fxd_hy_02 "-17.400005" +vr_wofs_2h_fxd_hy_03 "-21.600008" +vr_wofs_2h_fxd_hy_04 "-26.400011" +vr_wofs_2h_fxd_hy_05 "0.0" +vr_wofs_2h_fxd_hy_06 "-29.000013" +vr_wofs_2h_fxd_hy_07 "-27.600012" +vr_wofs_2h_fxd_hy_08 "-32.650013" +vr_wofs_2h_fxd_hy_09 "0.0" +vr_wofs_2h_fxd_hy_10 "0.0" +vr_wofs_2h_fxd_hy_11 "-29.000013" +vr_wofs_2h_fxd_hy_12 "-26.400011" +vr_wofs_2h_fxd_hy_13 "0.0" +vr_wofs_2h_fxd_hy_14 "-29.000013" +vr_wofs_2h_fxd_hy_15 "-27.600012" +vr_wofs_2h_fxd_hy_16 "-32.650013" +vr_wofs_2h_fxd_hy_17 "0.0" +vr_wofs_2h_fxd_hy_18 "0.0" +vr_wofs_2h_fxd_hy_19 "0.0" +vr_wofs_2h_fxd_hy_20 "0.0" +vr_wofs_2h_fxd_hy_21 "0.0" +vr_wofs_2h_fxd_hy_22 "0.0" +vr_wofs_2h_fxd_hy_23 "0.0" +vr_wofs_2h_fxd_hy_24 "0.0" +vr_wofs_2h_fxd_hy_25 "0.0" +vr_wofs_2h_fxd_hy_26 "0.0" +vr_wofs_2h_fxd_hy_27 "0.0" +vr_wofs_2h_fxd_hy_28 "0.0" +vr_wofs_2h_fxd_hy_29 "0.0" +vr_wofs_2h_fxd_hy_30 "0.0" +vr_wofs_2h_fxd_hy_31 "0.0" +vr_wofs_2h_fxd_hy_32 "0.0" +vr_wofs_2h_fxd_mh_ox_01 "0.0" +vr_wofs_2h_fxd_mh_ox_02 "0.0" +vr_wofs_2h_fxd_mh_ox_03 "0" +vr_wofs_2h_fxd_mh_ox_04 "0" +vr_wofs_2h_fxd_mh_ox_05 "0" +vr_wofs_2h_fxd_mh_ox_06 "0.0" +vr_wofs_2h_fxd_mh_ox_07 "0.0" +vr_wofs_2h_fxd_mh_ox_08 "0.0" +vr_wofs_2h_fxd_mh_ox_09 "0.0" +vr_wofs_2h_fxd_mh_ox_10 "0.0" +vr_wofs_2h_fxd_mh_ox_11 "0.0" +vr_wofs_2h_fxd_mh_ox_12 "0" +vr_wofs_2h_fxd_mh_ox_13 "0" +vr_wofs_2h_fxd_mh_ox_14 "0.0" +vr_wofs_2h_fxd_mh_ox_15 "0.0" +vr_wofs_2h_fxd_mh_ox_16 "0.0" +vr_wofs_2h_fxd_mh_ox_17 "0" +vr_wofs_2h_fxd_mh_ox_18 "0.0" +vr_wofs_2h_fxd_mh_ox_19 "0.0" +vr_wofs_2h_fxd_mh_ox_20 "0.0" +vr_wofs_2h_fxd_mh_ox_21 "0.0" +vr_wofs_2h_fxd_mh_ox_22 "0.0" +vr_wofs_2h_fxd_mh_ox_23 "0.0" +vr_wofs_2h_fxd_mh_ox_24 "0.0" +vr_wofs_2h_fxd_mh_ox_25 "0.0" +vr_wofs_2h_fxd_mh_ox_26 "0.0" +vr_wofs_2h_fxd_mh_ox_27 "0.0" +vr_wofs_2h_fxd_mh_ox_28 "0.0" +vr_wofs_2h_fxd_mh_ox_29 "0.0" +vr_wofs_2h_fxd_mh_ox_30 "0.0" +vr_wofs_2h_fxd_mh_ox_31 "0.0" +vr_wofs_2h_fxd_mh_ox_32 "0.0" +vr_wofs_2h_fxd_mh_oy_01 "0.0" +vr_wofs_2h_fxd_mh_oy_02 "0.7" +vr_wofs_2h_fxd_mh_oy_03 "5.4" +vr_wofs_2h_fxd_mh_oy_04 "3.9" +vr_wofs_2h_fxd_mh_oy_05 "1.9" +vr_wofs_2h_fxd_mh_oy_06 "6.6" +vr_wofs_2h_fxd_mh_oy_07 "5.95" +vr_wofs_2h_fxd_mh_oy_08 "3.8" +vr_wofs_2h_fxd_mh_oy_09 "0.0" +vr_wofs_2h_fxd_mh_oy_10 "-4.4" +vr_wofs_2h_fxd_mh_oy_11 "6.6" +vr_wofs_2h_fxd_mh_oy_12 "3.9" +vr_wofs_2h_fxd_mh_oy_13 "1.9" +vr_wofs_2h_fxd_mh_oy_14 "6.6" +vr_wofs_2h_fxd_mh_oy_15 "5.95" +vr_wofs_2h_fxd_mh_oy_16 "3.8" +vr_wofs_2h_fxd_mh_oy_17 "0" +vr_wofs_2h_fxd_mh_oy_18 "0.0" +vr_wofs_2h_fxd_mh_oy_19 "0.0" +vr_wofs_2h_fxd_mh_oy_20 "0.0" +vr_wofs_2h_fxd_mh_oy_21 "0.0" +vr_wofs_2h_fxd_mh_oy_22 "0.0" +vr_wofs_2h_fxd_mh_oy_23 "0.0" +vr_wofs_2h_fxd_mh_oy_24 "0.0" +vr_wofs_2h_fxd_mh_oy_25 "0.0" +vr_wofs_2h_fxd_mh_oy_26 "0.0" +vr_wofs_2h_fxd_mh_oy_27 "0.0" +vr_wofs_2h_fxd_mh_oy_28 "0.0" +vr_wofs_2h_fxd_mh_oy_29 "0.0" +vr_wofs_2h_fxd_mh_oy_30 "0.0" +vr_wofs_2h_fxd_mh_oy_31 "0.0" +vr_wofs_2h_fxd_mh_oy_32 "0.0" +vr_wofs_2h_fxd_mh_oz_01 "0.0" +vr_wofs_2h_fxd_mh_oz_02 "0.0" +vr_wofs_2h_fxd_mh_oz_03 "0.0" +vr_wofs_2h_fxd_mh_oz_04 "0.0" +vr_wofs_2h_fxd_mh_oz_05 "0.0" +vr_wofs_2h_fxd_mh_oz_06 "0.0" +vr_wofs_2h_fxd_mh_oz_07 "0.0" +vr_wofs_2h_fxd_mh_oz_08 "0.0" +vr_wofs_2h_fxd_mh_oz_09 "0.0" +vr_wofs_2h_fxd_mh_oz_10 "0.0" +vr_wofs_2h_fxd_mh_oz_11 "0.0" +vr_wofs_2h_fxd_mh_oz_12 "0.0" +vr_wofs_2h_fxd_mh_oz_13 "0.0" +vr_wofs_2h_fxd_mh_oz_14 "0.0" +vr_wofs_2h_fxd_mh_oz_15 "0.0" +vr_wofs_2h_fxd_mh_oz_16 "0.0" +vr_wofs_2h_fxd_mh_oz_17 "0" +vr_wofs_2h_fxd_mh_oz_18 "0.0" +vr_wofs_2h_fxd_mh_oz_19 "0.0" +vr_wofs_2h_fxd_mh_oz_20 "0.0" +vr_wofs_2h_fxd_mh_oz_21 "0.0" +vr_wofs_2h_fxd_mh_oz_22 "0.0" +vr_wofs_2h_fxd_mh_oz_23 "0.0" +vr_wofs_2h_fxd_mh_oz_24 "0.0" +vr_wofs_2h_fxd_mh_oz_25 "0.0" +vr_wofs_2h_fxd_mh_oz_26 "0.0" +vr_wofs_2h_fxd_mh_oz_27 "0.0" +vr_wofs_2h_fxd_mh_oz_28 "0.0" +vr_wofs_2h_fxd_mh_oz_29 "0.0" +vr_wofs_2h_fxd_mh_oz_30 "0.0" +vr_wofs_2h_fxd_mh_oz_31 "0.0" +vr_wofs_2h_fxd_mh_oz_32 "0.0" +vr_wofs_2h_fxd_ox_01 "0.0" +vr_wofs_2h_fxd_ox_02 "-1.2" +vr_wofs_2h_fxd_ox_03 "-2.4" +vr_wofs_2h_fxd_ox_04 "1.8" +vr_wofs_2h_fxd_ox_05 "3.4" +vr_wofs_2h_fxd_ox_06 "4.2" +vr_wofs_2h_fxd_ox_07 "3" +vr_wofs_2h_fxd_ox_08 "0.0" +vr_wofs_2h_fxd_ox_09 "0.0" +vr_wofs_2h_fxd_ox_10 "2.4" +vr_wofs_2h_fxd_ox_11 "4.2" +vr_wofs_2h_fxd_ox_12 "1.8" +vr_wofs_2h_fxd_ox_13 "3.4" +vr_wofs_2h_fxd_ox_14 "4.2" +vr_wofs_2h_fxd_ox_15 "3" +vr_wofs_2h_fxd_ox_16 "0.0" +vr_wofs_2h_fxd_ox_17 "0.0" +vr_wofs_2h_fxd_ox_18 "0.0" +vr_wofs_2h_fxd_ox_19 "0.0" +vr_wofs_2h_fxd_ox_20 "0.0" +vr_wofs_2h_fxd_ox_21 "0.0" +vr_wofs_2h_fxd_ox_22 "0.0" +vr_wofs_2h_fxd_ox_23 "0.0" +vr_wofs_2h_fxd_ox_24 "0.0" +vr_wofs_2h_fxd_ox_25 "0.0" +vr_wofs_2h_fxd_ox_26 "0.0" +vr_wofs_2h_fxd_ox_27 "0.0" +vr_wofs_2h_fxd_ox_28 "0.0" +vr_wofs_2h_fxd_ox_29 "0.0" +vr_wofs_2h_fxd_ox_30 "0.0" +vr_wofs_2h_fxd_ox_31 "0.0" +vr_wofs_2h_fxd_ox_32 "0.0" +vr_wofs_2h_fxd_oy_01 "0.0" +vr_wofs_2h_fxd_oy_02 "-2.4" +vr_wofs_2h_fxd_oy_03 "0" +vr_wofs_2h_fxd_oy_04 "0.0" +vr_wofs_2h_fxd_oy_05 "-1.2" +vr_wofs_2h_fxd_oy_06 "1.2" +vr_wofs_2h_fxd_oy_07 "1" +vr_wofs_2h_fxd_oy_08 "0.4" +vr_wofs_2h_fxd_oy_09 "0.0" +vr_wofs_2h_fxd_oy_10 "-0.2" +vr_wofs_2h_fxd_oy_11 "1.2" +vr_wofs_2h_fxd_oy_12 "0.0" +vr_wofs_2h_fxd_oy_13 "-1.2" +vr_wofs_2h_fxd_oy_14 "1.2" +vr_wofs_2h_fxd_oy_15 "1" +vr_wofs_2h_fxd_oy_16 "0.4" +vr_wofs_2h_fxd_oy_17 "0.0" +vr_wofs_2h_fxd_oy_18 "0.0" +vr_wofs_2h_fxd_oy_19 "0.0" +vr_wofs_2h_fxd_oy_20 "0.0" +vr_wofs_2h_fxd_oy_21 "0.0" +vr_wofs_2h_fxd_oy_22 "0.0" +vr_wofs_2h_fxd_oy_23 "0.0" +vr_wofs_2h_fxd_oy_24 "0.0" +vr_wofs_2h_fxd_oy_25 "0.0" +vr_wofs_2h_fxd_oy_26 "0.0" +vr_wofs_2h_fxd_oy_27 "0.0" +vr_wofs_2h_fxd_oy_28 "0.0" +vr_wofs_2h_fxd_oy_29 "0.0" +vr_wofs_2h_fxd_oy_30 "0.0" +vr_wofs_2h_fxd_oy_31 "0.0" +vr_wofs_2h_fxd_oy_32 "0.0" +vr_wofs_2h_fxd_oz_01 "0.0" +vr_wofs_2h_fxd_oz_02 "0.0" +vr_wofs_2h_fxd_oz_03 "-2" +vr_wofs_2h_fxd_oz_04 "0.2" +vr_wofs_2h_fxd_oz_05 "-0.8" +vr_wofs_2h_fxd_oz_06 "-2.8" +vr_wofs_2h_fxd_oz_07 "-1.6" +vr_wofs_2h_fxd_oz_08 "0.8" +vr_wofs_2h_fxd_oz_09 "0.0" +vr_wofs_2h_fxd_oz_10 "-4.6" +vr_wofs_2h_fxd_oz_11 "-2.8" +vr_wofs_2h_fxd_oz_12 "0.2" +vr_wofs_2h_fxd_oz_13 "-0.8" +vr_wofs_2h_fxd_oz_14 "-2.8" +vr_wofs_2h_fxd_oz_15 "-1.6" +vr_wofs_2h_fxd_oz_16 "0.8" +vr_wofs_2h_fxd_oz_17 "0.0" +vr_wofs_2h_fxd_oz_18 "0.0" +vr_wofs_2h_fxd_oz_19 "0.0" +vr_wofs_2h_fxd_oz_20 "0.0" +vr_wofs_2h_fxd_oz_21 "0.0" +vr_wofs_2h_fxd_oz_22 "0.0" +vr_wofs_2h_fxd_oz_23 "0.0" +vr_wofs_2h_fxd_oz_24 "0.0" +vr_wofs_2h_fxd_oz_25 "0.0" +vr_wofs_2h_fxd_oz_26 "0.0" +vr_wofs_2h_fxd_oz_27 "0.0" +vr_wofs_2h_fxd_oz_28 "0.0" +vr_wofs_2h_fxd_oz_29 "0.0" +vr_wofs_2h_fxd_oz_30 "0.0" +vr_wofs_2h_fxd_oz_31 "0.0" +vr_wofs_2h_fxd_oz_32 "0.0" +vr_wofs_2h_hand_av_01 "0" +vr_wofs_2h_hand_av_02 "48" +vr_wofs_2h_hand_av_03 "29" +vr_wofs_2h_hand_av_04 "51" +vr_wofs_2h_hand_av_05 "94" +vr_wofs_2h_hand_av_06 "57" +vr_wofs_2h_hand_av_07 "3" +vr_wofs_2h_hand_av_08 "208" +vr_wofs_2h_hand_av_09 "3" +vr_wofs_2h_hand_av_10 "19" +vr_wofs_2h_hand_av_11 "57" +vr_wofs_2h_hand_av_12 "51" +vr_wofs_2h_hand_av_13 "94" +vr_wofs_2h_hand_av_14 "57" +vr_wofs_2h_hand_av_15 "3" +vr_wofs_2h_hand_av_16 "203" +vr_wofs_2h_hand_av_17 "0.0" +vr_wofs_2h_hand_av_18 "0" +vr_wofs_2h_hand_av_19 "0.0" +vr_wofs_2h_hand_av_20 "0.0" +vr_wofs_2h_hand_av_21 "0.0" +vr_wofs_2h_hand_av_22 "0.0" +vr_wofs_2h_hand_av_23 "0.0" +vr_wofs_2h_hand_av_24 "0.0" +vr_wofs_2h_hand_av_25 "0.0" +vr_wofs_2h_hand_av_26 "0.0" +vr_wofs_2h_hand_av_27 "0.0" +vr_wofs_2h_hand_av_28 "0.0" +vr_wofs_2h_hand_av_29 "0.0" +vr_wofs_2h_hand_av_30 "0.0" +vr_wofs_2h_hand_av_31 "0.0" +vr_wofs_2h_hand_av_32 "0.0" +vr_wofs_2h_mode_01 "2" +vr_wofs_2h_mode_02 "0" +vr_wofs_2h_mode_03 "0.0" +vr_wofs_2h_mode_04 "0.0" +vr_wofs_2h_mode_05 "0.0" +vr_wofs_2h_mode_06 "0.0" +vr_wofs_2h_mode_07 "0.0" +vr_wofs_2h_mode_08 "0.0" +vr_wofs_2h_mode_09 "2" +vr_wofs_2h_mode_10 "1" +vr_wofs_2h_mode_11 "0.0" +vr_wofs_2h_mode_12 "0.0" +vr_wofs_2h_mode_13 "0.0" +vr_wofs_2h_mode_14 "0.0" +vr_wofs_2h_mode_15 "0.0" +vr_wofs_2h_mode_16 "0.0" +vr_wofs_2h_mode_17 "2" +vr_wofs_2h_mode_18 "2" +vr_wofs_2h_mode_19 "0.0" +vr_wofs_2h_mode_20 "0.0" +vr_wofs_2h_mode_21 "0.0" +vr_wofs_2h_mode_22 "0.0" +vr_wofs_2h_mode_23 "0.0" +vr_wofs_2h_mode_24 "0.0" +vr_wofs_2h_mode_25 "0.0" +vr_wofs_2h_mode_26 "0.0" +vr_wofs_2h_mode_27 "0.0" +vr_wofs_2h_mode_28 "0.0" +vr_wofs_2h_mode_29 "0.0" +vr_wofs_2h_mode_30 "0.0" +vr_wofs_2h_mode_31 "0.0" +vr_wofs_2h_mode_32 "0.0" +vr_wofs_2h_pitch_01 "0.0" +vr_wofs_2h_pitch_02 "0" +vr_wofs_2h_pitch_03 "0.0" +vr_wofs_2h_pitch_04 "0.0" +vr_wofs_2h_pitch_05 "0.0" +vr_wofs_2h_pitch_06 "0.0" +vr_wofs_2h_pitch_07 "0" +vr_wofs_2h_pitch_08 "0.0" +vr_wofs_2h_pitch_09 "0.0" +vr_wofs_2h_pitch_10 "0" +vr_wofs_2h_pitch_11 "0.0" +vr_wofs_2h_pitch_12 "0.0" +vr_wofs_2h_pitch_13 "0.0" +vr_wofs_2h_pitch_14 "0.0" +vr_wofs_2h_pitch_15 "0" +vr_wofs_2h_pitch_16 "0.0" +vr_wofs_2h_pitch_17 "0.0" +vr_wofs_2h_pitch_18 "0.0" +vr_wofs_2h_pitch_19 "0.0" +vr_wofs_2h_pitch_20 "0.0" +vr_wofs_2h_pitch_21 "0.0" +vr_wofs_2h_pitch_22 "0.0" +vr_wofs_2h_pitch_23 "0.0" +vr_wofs_2h_pitch_24 "0.0" +vr_wofs_2h_pitch_25 "0.0" +vr_wofs_2h_pitch_26 "0.0" +vr_wofs_2h_pitch_27 "0.0" +vr_wofs_2h_pitch_28 "0.0" +vr_wofs_2h_pitch_29 "0.0" +vr_wofs_2h_pitch_30 "0.0" +vr_wofs_2h_pitch_31 "0.0" +vr_wofs_2h_pitch_32 "0.0" +vr_wofs_2h_roll_01 "0.0" +vr_wofs_2h_roll_02 "0.0" +vr_wofs_2h_roll_03 "0.0" +vr_wofs_2h_roll_04 "0.0" +vr_wofs_2h_roll_05 "0.0" +vr_wofs_2h_roll_06 "0.0" +vr_wofs_2h_roll_07 "0.0" +vr_wofs_2h_roll_08 "0.0" +vr_wofs_2h_roll_09 "0.0" +vr_wofs_2h_roll_10 "0.0" +vr_wofs_2h_roll_11 "0.0" +vr_wofs_2h_roll_12 "0.0" +vr_wofs_2h_roll_13 "0.0" +vr_wofs_2h_roll_14 "0.0" +vr_wofs_2h_roll_15 "0.0" +vr_wofs_2h_roll_16 "0.0" +vr_wofs_2h_roll_17 "0.0" +vr_wofs_2h_roll_18 "0.0" +vr_wofs_2h_roll_19 "0.0" +vr_wofs_2h_roll_20 "0.0" +vr_wofs_2h_roll_21 "0.0" +vr_wofs_2h_roll_22 "0.0" +vr_wofs_2h_roll_23 "0.0" +vr_wofs_2h_roll_24 "0.0" +vr_wofs_2h_roll_25 "0.0" +vr_wofs_2h_roll_26 "0.0" +vr_wofs_2h_roll_27 "0.0" +vr_wofs_2h_roll_28 "0.0" +vr_wofs_2h_roll_29 "0.0" +vr_wofs_2h_roll_30 "0.0" +vr_wofs_2h_roll_31 "0.0" +vr_wofs_2h_roll_32 "0.0" +vr_wofs_2h_x_01 "0.0" +vr_wofs_2h_x_02 "0" +vr_wofs_2h_x_03 "0.0" +vr_wofs_2h_x_04 "0" +vr_wofs_2h_x_05 "0.8" +vr_wofs_2h_x_06 "0.0" +vr_wofs_2h_x_07 "0.0" +vr_wofs_2h_x_08 "0" +vr_wofs_2h_x_09 "0.0" +vr_wofs_2h_x_10 "0.000001" +vr_wofs_2h_x_11 "0.0" +vr_wofs_2h_x_12 "0" +vr_wofs_2h_x_13 "0.8" +vr_wofs_2h_x_14 "0.0" +vr_wofs_2h_x_15 "0.0" +vr_wofs_2h_x_16 "0" +vr_wofs_2h_x_17 "0.0" +vr_wofs_2h_x_18 "0.0" +vr_wofs_2h_x_19 "0.0" +vr_wofs_2h_x_20 "0.0" +vr_wofs_2h_x_21 "0.0" +vr_wofs_2h_x_22 "0.0" +vr_wofs_2h_x_23 "0.0" +vr_wofs_2h_x_24 "0.0" +vr_wofs_2h_x_25 "0.0" +vr_wofs_2h_x_26 "0.0" +vr_wofs_2h_x_27 "0.0" +vr_wofs_2h_x_28 "0.0" +vr_wofs_2h_x_29 "0.0" +vr_wofs_2h_x_30 "0.0" +vr_wofs_2h_x_31 "0.0" +vr_wofs_2h_x_32 "0.0" +vr_wofs_2h_y_01 "0.0" +vr_wofs_2h_y_02 "0" +vr_wofs_2h_y_03 "0.0" +vr_wofs_2h_y_04 "0.0" +vr_wofs_2h_y_05 "1.8" +vr_wofs_2h_y_06 "0.0" +vr_wofs_2h_y_07 "0.0" +vr_wofs_2h_y_08 "0.0" +vr_wofs_2h_y_09 "0.0" +vr_wofs_2h_y_10 "-1.6" +vr_wofs_2h_y_11 "0.0" +vr_wofs_2h_y_12 "0.0" +vr_wofs_2h_y_13 "1.8" +vr_wofs_2h_y_14 "0.0" +vr_wofs_2h_y_15 "0.0" +vr_wofs_2h_y_16 "0.0" +vr_wofs_2h_y_17 "0.0" +vr_wofs_2h_y_18 "0.0" +vr_wofs_2h_y_19 "0.0" +vr_wofs_2h_y_20 "0.0" +vr_wofs_2h_y_21 "0.0" +vr_wofs_2h_y_22 "0.0" +vr_wofs_2h_y_23 "0.0" +vr_wofs_2h_y_24 "0.0" +vr_wofs_2h_y_25 "0.0" +vr_wofs_2h_y_26 "0.0" +vr_wofs_2h_y_27 "0.0" +vr_wofs_2h_y_28 "0.0" +vr_wofs_2h_y_29 "0.0" +vr_wofs_2h_y_30 "0.0" +vr_wofs_2h_y_31 "0.0" +vr_wofs_2h_y_32 "0.0" +vr_wofs_2h_yaw_01 "0.0" +vr_wofs_2h_yaw_02 "0.0" +vr_wofs_2h_yaw_03 "0.0" +vr_wofs_2h_yaw_04 "0.0" +vr_wofs_2h_yaw_05 "0.0" +vr_wofs_2h_yaw_06 "0.0" +vr_wofs_2h_yaw_07 "0" +vr_wofs_2h_yaw_08 "0.0" +vr_wofs_2h_yaw_09 "0.0" +vr_wofs_2h_yaw_10 "0" +vr_wofs_2h_yaw_11 "0.0" +vr_wofs_2h_yaw_12 "0.0" +vr_wofs_2h_yaw_13 "0.0" +vr_wofs_2h_yaw_14 "0.0" +vr_wofs_2h_yaw_15 "0" +vr_wofs_2h_yaw_16 "0.0" +vr_wofs_2h_yaw_17 "0.0" +vr_wofs_2h_yaw_18 "0.0" +vr_wofs_2h_yaw_19 "0.0" +vr_wofs_2h_yaw_20 "0.0" +vr_wofs_2h_yaw_21 "0.0" +vr_wofs_2h_yaw_22 "0.0" +vr_wofs_2h_yaw_23 "0.0" +vr_wofs_2h_yaw_24 "0.0" +vr_wofs_2h_yaw_25 "0.0" +vr_wofs_2h_yaw_26 "0.0" +vr_wofs_2h_yaw_27 "0.0" +vr_wofs_2h_yaw_28 "0.0" +vr_wofs_2h_yaw_29 "0.0" +vr_wofs_2h_yaw_30 "0.0" +vr_wofs_2h_yaw_31 "0.0" +vr_wofs_2h_yaw_32 "0.0" +vr_wofs_2h_z_01 "0.0" +vr_wofs_2h_z_02 "-1" +vr_wofs_2h_z_03 "0.0" +vr_wofs_2h_z_04 "0.0" +vr_wofs_2h_z_05 "-3.4" +vr_wofs_2h_z_06 "2" +vr_wofs_2h_z_07 "1.8" +vr_wofs_2h_z_08 "1" +vr_wofs_2h_z_09 "0.0" +vr_wofs_2h_z_10 "-1" +vr_wofs_2h_z_11 "2" +vr_wofs_2h_z_12 "0.0" +vr_wofs_2h_z_13 "-3.4" +vr_wofs_2h_z_14 "2" +vr_wofs_2h_z_15 "1.8" +vr_wofs_2h_z_16 "1" +vr_wofs_2h_z_17 "0.0" +vr_wofs_2h_z_18 "0.0" +vr_wofs_2h_z_19 "0.0" +vr_wofs_2h_z_20 "0.0" +vr_wofs_2h_z_21 "0.0" +vr_wofs_2h_z_22 "0.0" +vr_wofs_2h_z_23 "0.0" +vr_wofs_2h_z_24 "0.0" +vr_wofs_2h_z_25 "0.0" +vr_wofs_2h_z_26 "0.0" +vr_wofs_2h_z_27 "0.0" +vr_wofs_2h_z_28 "0.0" +vr_wofs_2h_z_29 "0.0" +vr_wofs_2h_z_30 "0.0" +vr_wofs_2h_z_31 "0.0" +vr_wofs_2h_z_32 "0.0" +vr_wofs_ch_mode_z_01 "1" +vr_wofs_ch_mode_z_02 "0.0" +vr_wofs_ch_mode_z_03 "0.0" +vr_wofs_ch_mode_z_04 "0.0" +vr_wofs_ch_mode_z_05 "0.0" +vr_wofs_ch_mode_z_06 "0.0" +vr_wofs_ch_mode_z_07 "0.0" +vr_wofs_ch_mode_z_08 "0.0" +vr_wofs_ch_mode_z_09 "1" +vr_wofs_ch_mode_z_10 "0.0" +vr_wofs_ch_mode_z_11 "0.0" +vr_wofs_ch_mode_z_12 "0.0" +vr_wofs_ch_mode_z_13 "0.0" +vr_wofs_ch_mode_z_14 "0.0" +vr_wofs_ch_mode_z_15 "0.0" +vr_wofs_ch_mode_z_16 "0.0" +vr_wofs_ch_mode_z_17 "1" +vr_wofs_ch_mode_z_18 "0.0" +vr_wofs_ch_mode_z_19 "0.0" +vr_wofs_ch_mode_z_20 "0.0" +vr_wofs_ch_mode_z_21 "0.0" +vr_wofs_ch_mode_z_22 "0.0" +vr_wofs_ch_mode_z_23 "0.0" +vr_wofs_ch_mode_z_24 "0.0" +vr_wofs_ch_mode_z_25 "0.0" +vr_wofs_ch_mode_z_26 "0.0" +vr_wofs_ch_mode_z_27 "0.0" +vr_wofs_ch_mode_z_28 "0.0" +vr_wofs_ch_mode_z_29 "0.0" +vr_wofs_ch_mode_z_30 "0.0" +vr_wofs_ch_mode_z_31 "0.0" +vr_wofs_ch_mode_z_32 "0.0" +vr_wofs_gunoff_x_01 "0.0" +vr_wofs_gunoff_x_02 "0.0" +vr_wofs_gunoff_x_03 "0.0" +vr_wofs_gunoff_x_04 "0.0" +vr_wofs_gunoff_x_05 "0.0" +vr_wofs_gunoff_x_06 "0.0" +vr_wofs_gunoff_x_07 "0.0" +vr_wofs_gunoff_x_08 "0.0" +vr_wofs_gunoff_x_09 "0.0" +vr_wofs_gunoff_x_10 "0.0" +vr_wofs_gunoff_x_11 "0.0" +vr_wofs_gunoff_x_12 "0.0" +vr_wofs_gunoff_x_13 "0.0" +vr_wofs_gunoff_x_14 "0.0" +vr_wofs_gunoff_x_15 "0.0" +vr_wofs_gunoff_x_16 "0.0" +vr_wofs_gunoff_x_17 "0.0" +vr_wofs_gunoff_x_18 "0.0" +vr_wofs_gunoff_x_19 "0.0" +vr_wofs_gunoff_x_20 "0.0" +vr_wofs_gunoff_x_21 "0.0" +vr_wofs_gunoff_x_22 "0.0" +vr_wofs_gunoff_x_23 "0.0" +vr_wofs_gunoff_x_24 "0.0" +vr_wofs_gunoff_x_25 "0.0" +vr_wofs_gunoff_x_26 "0.0" +vr_wofs_gunoff_x_27 "0.0" +vr_wofs_gunoff_x_28 "0.0" +vr_wofs_gunoff_x_29 "0.0" +vr_wofs_gunoff_x_30 "0.0" +vr_wofs_gunoff_x_31 "0.0" +vr_wofs_gunoff_x_32 "0.0" +vr_wofs_gunoff_y_01 "0.0" +vr_wofs_gunoff_y_02 "0.0" +vr_wofs_gunoff_y_03 "0.0" +vr_wofs_gunoff_y_04 "0.0" +vr_wofs_gunoff_y_05 "0.0" +vr_wofs_gunoff_y_06 "0.0" +vr_wofs_gunoff_y_07 "0.0" +vr_wofs_gunoff_y_08 "0.0" +vr_wofs_gunoff_y_09 "0.0" +vr_wofs_gunoff_y_10 "0.0" +vr_wofs_gunoff_y_11 "0.0" +vr_wofs_gunoff_y_12 "0.0" +vr_wofs_gunoff_y_13 "0.0" +vr_wofs_gunoff_y_14 "0.0" +vr_wofs_gunoff_y_15 "0.0" +vr_wofs_gunoff_y_16 "0.0" +vr_wofs_gunoff_y_17 "0.0" +vr_wofs_gunoff_y_18 "0.0" +vr_wofs_gunoff_y_19 "0.0" +vr_wofs_gunoff_y_20 "0.0" +vr_wofs_gunoff_y_21 "0.0" +vr_wofs_gunoff_y_22 "0.0" +vr_wofs_gunoff_y_23 "0.0" +vr_wofs_gunoff_y_24 "0.0" +vr_wofs_gunoff_y_25 "0.0" +vr_wofs_gunoff_y_26 "0.0" +vr_wofs_gunoff_y_27 "0.0" +vr_wofs_gunoff_y_28 "0.0" +vr_wofs_gunoff_y_29 "0.0" +vr_wofs_gunoff_y_30 "0.0" +vr_wofs_gunoff_y_31 "0.0" +vr_wofs_gunoff_y_32 "0.0" +vr_wofs_gunoff_z_01 "0" +vr_wofs_gunoff_z_02 "0.0" +vr_wofs_gunoff_z_03 "0.0" +vr_wofs_gunoff_z_04 "0.0" +vr_wofs_gunoff_z_05 "0.0" +vr_wofs_gunoff_z_06 "0.0" +vr_wofs_gunoff_z_07 "0.0" +vr_wofs_gunoff_z_08 "0.0" +vr_wofs_gunoff_z_09 "0.0" +vr_wofs_gunoff_z_10 "0.0" +vr_wofs_gunoff_z_11 "0.0" +vr_wofs_gunoff_z_12 "0.0" +vr_wofs_gunoff_z_13 "0.0" +vr_wofs_gunoff_z_14 "0.0" +vr_wofs_gunoff_z_15 "0.0" +vr_wofs_gunoff_z_16 "0.0" +vr_wofs_gunoff_z_17 "0.0" +vr_wofs_gunoff_z_18 "0.0" +vr_wofs_gunoff_z_19 "0.0" +vr_wofs_gunoff_z_20 "0.0" +vr_wofs_gunoff_z_21 "0.0" +vr_wofs_gunoff_z_22 "0.0" +vr_wofs_gunoff_z_23 "0.0" +vr_wofs_gunoff_z_24 "0.0" +vr_wofs_gunoff_z_25 "0.0" +vr_wofs_gunoff_z_26 "0.0" +vr_wofs_gunoff_z_27 "0.0" +vr_wofs_gunoff_z_28 "0.0" +vr_wofs_gunoff_z_29 "0.0" +vr_wofs_gunoff_z_30 "0.0" +vr_wofs_gunoff_z_31 "0.0" +vr_wofs_gunoff_z_32 "0.0" +vr_wofs_hand_av_01 "2" +vr_wofs_hand_av_02 "165" +vr_wofs_hand_av_03 "65" +vr_wofs_hand_av_04 "5" +vr_wofs_hand_av_05 "28" +vr_wofs_hand_av_06 "33" +vr_wofs_hand_av_07 "12" +vr_wofs_hand_av_08 "57" +vr_wofs_hand_av_09 "0.0" +vr_wofs_hand_av_10 "4" +vr_wofs_hand_av_11 "33" +vr_wofs_hand_av_12 "5" +vr_wofs_hand_av_13 "44" +vr_wofs_hand_av_14 "33" +vr_wofs_hand_av_15 "12" +vr_wofs_hand_av_16 "57" +vr_wofs_hand_av_17 "0" +vr_wofs_hand_av_18 "68" +vr_wofs_hand_av_19 "0.0" +vr_wofs_hand_av_20 "0.0" +vr_wofs_hand_av_21 "0.0" +vr_wofs_hand_av_22 "0.0" +vr_wofs_hand_av_23 "0.0" +vr_wofs_hand_av_24 "0.0" +vr_wofs_hand_av_25 "0.0" +vr_wofs_hand_av_26 "0.0" +vr_wofs_hand_av_27 "0.0" +vr_wofs_hand_av_28 "0.0" +vr_wofs_hand_av_29 "0.0" +vr_wofs_hand_av_30 "0.0" +vr_wofs_hand_av_31 "0.0" +vr_wofs_hand_av_32 "0.0" +vr_wofs_hand_x_01 "3.4" +vr_wofs_hand_x_02 "2.399994" +vr_wofs_hand_x_03 "-3.25" +vr_wofs_hand_x_04 "0.8" +vr_wofs_hand_x_05 "-0.8" +vr_wofs_hand_x_06 "0.4" +vr_wofs_hand_x_07 "2.100005" +vr_wofs_hand_x_08 "2.4" +vr_wofs_hand_x_09 "1.9" +vr_wofs_hand_x_10 "-16.200041" +vr_wofs_hand_x_11 "0.4" +vr_wofs_hand_x_12 "0.8" +vr_wofs_hand_x_13 "-0.8" +vr_wofs_hand_x_14 "0.4" +vr_wofs_hand_x_15 "2.100005" +vr_wofs_hand_x_16 "2.4" +vr_wofs_hand_x_17 "1.7" +vr_wofs_hand_x_18 "1.7" +vr_wofs_hand_x_19 "0.0" +vr_wofs_hand_x_20 "0.0" +vr_wofs_hand_x_21 "0.0" +vr_wofs_hand_x_22 "0.0" +vr_wofs_hand_x_23 "0.0" +vr_wofs_hand_x_24 "0.0" +vr_wofs_hand_x_25 "0.0" +vr_wofs_hand_x_26 "0.0" +vr_wofs_hand_x_27 "0.0" +vr_wofs_hand_x_28 "0.0" +vr_wofs_hand_x_29 "0.0" +vr_wofs_hand_x_30 "0.0" +vr_wofs_hand_x_31 "0.0" +vr_wofs_hand_x_32 "0.0" +vr_wofs_hand_y_01 "0" +vr_wofs_hand_y_02 "0.2" +vr_wofs_hand_y_03 "1.1" +vr_wofs_hand_y_04 "-1.299998" +vr_wofs_hand_y_05 "0.2" +vr_wofs_hand_y_06 "-1.5" +vr_wofs_hand_y_07 "-0.8" +vr_wofs_hand_y_08 "0.700002" +vr_wofs_hand_y_09 "0" +vr_wofs_hand_y_10 "1.9" +vr_wofs_hand_y_11 "-1.5" +vr_wofs_hand_y_12 "-1.299998" +vr_wofs_hand_y_13 "0.2" +vr_wofs_hand_y_14 "-1.5" +vr_wofs_hand_y_15 "-0.8" +vr_wofs_hand_y_16 "0.700002" +vr_wofs_hand_y_17 "-4.25" +vr_wofs_hand_y_18 "-0.2" +vr_wofs_hand_y_19 "0.0" +vr_wofs_hand_y_20 "0.0" +vr_wofs_hand_y_21 "0.0" +vr_wofs_hand_y_22 "0.0" +vr_wofs_hand_y_23 "0.0" +vr_wofs_hand_y_24 "0.0" +vr_wofs_hand_y_25 "0.0" +vr_wofs_hand_y_26 "0.0" +vr_wofs_hand_y_27 "0.0" +vr_wofs_hand_y_28 "0.0" +vr_wofs_hand_y_29 "0.0" +vr_wofs_hand_y_30 "0.0" +vr_wofs_hand_y_31 "0.0" +vr_wofs_hand_y_32 "0.0" +vr_wofs_hand_z_01 "3.6" +vr_wofs_hand_z_02 "0.7" +vr_wofs_hand_z_03 "1.25" +vr_wofs_hand_z_04 "0.1" +vr_wofs_hand_z_05 "2.6" +vr_wofs_hand_z_06 "2" +vr_wofs_hand_z_07 "1" +vr_wofs_hand_z_08 "-1.35" +vr_wofs_hand_z_09 "4.5" +vr_wofs_hand_z_10 "10.3" +vr_wofs_hand_z_11 "2" +vr_wofs_hand_z_12 "0.1" +vr_wofs_hand_z_13 "2.6" +vr_wofs_hand_z_14 "2" +vr_wofs_hand_z_15 "1" +vr_wofs_hand_z_16 "-1.35" +vr_wofs_hand_z_17 "2" +vr_wofs_hand_z_18 "1.1" +vr_wofs_hand_z_19 "0.0" +vr_wofs_hand_z_20 "0.0" +vr_wofs_hand_z_21 "0.0" +vr_wofs_hand_z_22 "0.0" +vr_wofs_hand_z_23 "0.0" +vr_wofs_hand_z_24 "0.0" +vr_wofs_hand_z_25 "0.0" +vr_wofs_hand_z_26 "0.0" +vr_wofs_hand_z_27 "0.0" +vr_wofs_hand_z_28 "0.0" +vr_wofs_hand_z_29 "0.0" +vr_wofs_hand_z_30 "0.0" +vr_wofs_hand_z_31 "0.0" +vr_wofs_hand_z_32 "0.0" +vr_wofs_hide_hand_01 "0.0" +vr_wofs_hide_hand_02 "0" +vr_wofs_hide_hand_03 "0.0" +vr_wofs_hide_hand_04 "0.0" +vr_wofs_hide_hand_05 "0.0" +vr_wofs_hide_hand_06 "0" +vr_wofs_hide_hand_07 "0.0" +vr_wofs_hide_hand_08 "0.0" +vr_wofs_hide_hand_09 "0.0" +vr_wofs_hide_hand_10 "0.0" +vr_wofs_hide_hand_11 "0.0" +vr_wofs_hide_hand_12 "0.0" +vr_wofs_hide_hand_13 "0.0" +vr_wofs_hide_hand_14 "0" +vr_wofs_hide_hand_15 "0.0" +vr_wofs_hide_hand_16 "0.0" +vr_wofs_hide_hand_17 "0" +vr_wofs_hide_hand_18 "0.0" +vr_wofs_hide_hand_19 "0.0" +vr_wofs_hide_hand_20 "0.0" +vr_wofs_hide_hand_21 "0.0" +vr_wofs_hide_hand_22 "0.0" +vr_wofs_hide_hand_23 "0.0" +vr_wofs_hide_hand_24 "0.0" +vr_wofs_hide_hand_25 "0.0" +vr_wofs_hide_hand_26 "0.0" +vr_wofs_hide_hand_27 "0.0" +vr_wofs_hide_hand_28 "0.0" +vr_wofs_hide_hand_29 "0.0" +vr_wofs_hide_hand_30 "0.0" +vr_wofs_hide_hand_31 "0.0" +vr_wofs_hide_hand_32 "0.0" +vr_wofs_id_01 "progs/v_axe.mdl" +vr_wofs_id_02 "progs/v_shot.mdl" +vr_wofs_id_03 "progs/v_shot2.mdl" +vr_wofs_id_04 "progs/v_nail.mdl" +vr_wofs_id_05 "progs/v_nail2.mdl" +vr_wofs_id_06 "progs/v_rock.mdl" +vr_wofs_id_07 "progs/v_rock2.mdl" +vr_wofs_id_08 "progs/v_light.mdl" +vr_wofs_id_09 "progs/v_hammer.mdl" +vr_wofs_id_10 "progs/v_laserg.mdl" +vr_wofs_id_11 "progs/v_prox.mdl" +vr_wofs_id_12 "progs/v_lava.mdl" +vr_wofs_id_13 "progs/v_lava2.mdl" +vr_wofs_id_14 "progs/v_multi.mdl" +vr_wofs_id_15 "progs/v_multi2.mdl" +vr_wofs_id_16 "progs/v_plasma.mdl" +vr_wofs_id_17 "progs/hand.mdl" +vr_wofs_id_18 "progs/v_grpple.mdl" +vr_wofs_id_19 "-1" +vr_wofs_id_20 "-1" +vr_wofs_id_21 "-1" +vr_wofs_id_22 "-1" +vr_wofs_id_23 "-1" +vr_wofs_id_24 "-1" +vr_wofs_id_25 "-1" +vr_wofs_id_26 "-1" +vr_wofs_id_27 "-1" +vr_wofs_id_28 "-1" +vr_wofs_id_29 "-1" +vr_wofs_id_30 "-1" +vr_wofs_id_31 "-1" +vr_wofs_id_32 "-1" +vr_wofs_length_01 "0.0" +vr_wofs_length_02 "0.0" +vr_wofs_length_03 "0.0" +vr_wofs_length_04 "0.0" +vr_wofs_length_05 "0.0" +vr_wofs_length_06 "0.0" +vr_wofs_length_07 "0.0" +vr_wofs_length_08 "0.0" +vr_wofs_length_09 "0.0" +vr_wofs_length_10 "0" +vr_wofs_length_11 "0.0" +vr_wofs_length_12 "0.0" +vr_wofs_length_13 "0.0" +vr_wofs_length_14 "0.0" +vr_wofs_length_15 "0.0" +vr_wofs_length_16 "0.0" +vr_wofs_length_17 "0.0" +vr_wofs_length_18 "0.0" +vr_wofs_length_19 "0.0" +vr_wofs_length_20 "0.0" +vr_wofs_length_21 "0.0" +vr_wofs_length_22 "0.0" +vr_wofs_length_23 "0.0" +vr_wofs_length_24 "0.0" +vr_wofs_length_25 "0.0" +vr_wofs_length_26 "0.0" +vr_wofs_length_27 "0.0" +vr_wofs_length_28 "0.0" +vr_wofs_length_29 "0.0" +vr_wofs_length_30 "0.0" +vr_wofs_length_31 "0.0" +vr_wofs_length_32 "0.0" +vr_wofs_muzzle_av_01 "41" +vr_wofs_muzzle_av_02 "1" +vr_wofs_muzzle_av_03 "13" +vr_wofs_muzzle_av_04 "33" +vr_wofs_muzzle_av_05 "129" +vr_wofs_muzzle_av_06 "0.0" +vr_wofs_muzzle_av_07 "17" +vr_wofs_muzzle_av_08 "104" +vr_wofs_muzzle_av_09 "36" +vr_wofs_muzzle_av_10 "22" +vr_wofs_muzzle_av_11 "0.0" +vr_wofs_muzzle_av_12 "33" +vr_wofs_muzzle_av_13 "128" +vr_wofs_muzzle_av_14 "0.0" +vr_wofs_muzzle_av_15 "17" +vr_wofs_muzzle_av_16 "104" +vr_wofs_muzzle_av_17 "0" +vr_wofs_muzzle_av_18 "90" +vr_wofs_muzzle_av_19 "0.0" +vr_wofs_muzzle_av_20 "0.0" +vr_wofs_muzzle_av_21 "0.0" +vr_wofs_muzzle_av_22 "0.0" +vr_wofs_muzzle_av_23 "0.0" +vr_wofs_muzzle_av_24 "0.0" +vr_wofs_muzzle_av_25 "0.0" +vr_wofs_muzzle_av_26 "0.0" +vr_wofs_muzzle_av_27 "0.0" +vr_wofs_muzzle_av_28 "0.0" +vr_wofs_muzzle_av_29 "0.0" +vr_wofs_muzzle_av_30 "0.0" +vr_wofs_muzzle_av_31 "0.0" +vr_wofs_muzzle_av_32 "0.0" +vr_wofs_muzzle_x_01 "-0.700006" +vr_wofs_muzzle_x_02 "-0.000021" +vr_wofs_muzzle_x_03 "0.499997" +vr_wofs_muzzle_x_04 "-0.000004" +vr_wofs_muzzle_x_05 "-0.000009" +vr_wofs_muzzle_x_06 "0" +vr_wofs_muzzle_x_07 "-0.000006" +vr_wofs_muzzle_x_08 "-0.000005" +vr_wofs_muzzle_x_09 "0" +vr_wofs_muzzle_x_10 "3.000157" +vr_wofs_muzzle_x_11 "0" +vr_wofs_muzzle_x_12 "-0.000004" +vr_wofs_muzzle_x_13 "-0.000009" +vr_wofs_muzzle_x_14 "0" +vr_wofs_muzzle_x_15 "-0.000006" +vr_wofs_muzzle_x_16 "-0.000005" +vr_wofs_muzzle_x_17 "-0.000001" +vr_wofs_muzzle_x_18 "1.59998" +vr_wofs_muzzle_x_19 "0.0" +vr_wofs_muzzle_x_20 "0.0" +vr_wofs_muzzle_x_21 "0.0" +vr_wofs_muzzle_x_22 "0.0" +vr_wofs_muzzle_x_23 "0.0" +vr_wofs_muzzle_x_24 "0.0" +vr_wofs_muzzle_x_25 "0.0" +vr_wofs_muzzle_x_26 "0.0" +vr_wofs_muzzle_x_27 "0.0" +vr_wofs_muzzle_x_28 "0.0" +vr_wofs_muzzle_x_29 "0.0" +vr_wofs_muzzle_x_30 "0.0" +vr_wofs_muzzle_x_31 "0.0" +vr_wofs_muzzle_x_32 "0.0" +vr_wofs_muzzle_y_01 "0" +vr_wofs_muzzle_y_02 "0.35" +vr_wofs_muzzle_y_03 "0.35" +vr_wofs_muzzle_y_04 "0.85" +vr_wofs_muzzle_y_05 "0.499991" +vr_wofs_muzzle_y_06 "0" +vr_wofs_muzzle_y_07 "-0.000003" +vr_wofs_muzzle_y_08 "-0.000014" +vr_wofs_muzzle_y_09 "0.0" +vr_wofs_muzzle_y_10 "0.399987" +vr_wofs_muzzle_y_11 "0" +vr_wofs_muzzle_y_12 "0.85" +vr_wofs_muzzle_y_13 "0.499991" +vr_wofs_muzzle_y_14 "0" +vr_wofs_muzzle_y_15 "-0.000003" +vr_wofs_muzzle_y_16 "-0.000014" +vr_wofs_muzzle_y_17 "0" +vr_wofs_muzzle_y_18 "0.399997" +vr_wofs_muzzle_y_19 "0.0" +vr_wofs_muzzle_y_20 "0.0" +vr_wofs_muzzle_y_21 "0.0" +vr_wofs_muzzle_y_22 "0.0" +vr_wofs_muzzle_y_23 "0.0" +vr_wofs_muzzle_y_24 "0.0" +vr_wofs_muzzle_y_25 "0.0" +vr_wofs_muzzle_y_26 "0.0" +vr_wofs_muzzle_y_27 "0.0" +vr_wofs_muzzle_y_28 "0.0" +vr_wofs_muzzle_y_29 "0.0" +vr_wofs_muzzle_y_30 "0.0" +vr_wofs_muzzle_y_31 "0.0" +vr_wofs_muzzle_y_32 "0.0" +vr_wofs_muzzle_z_01 "-2.100002" +vr_wofs_muzzle_z_02 "0.6" +vr_wofs_muzzle_z_03 "-0.7" +vr_wofs_muzzle_z_04 "-0.9" +vr_wofs_muzzle_z_05 "-0.999995" +vr_wofs_muzzle_z_06 "0.000004" +vr_wofs_muzzle_z_07 "-1.299994" +vr_wofs_muzzle_z_08 "-0.500006" +vr_wofs_muzzle_z_09 "-2.60001" +vr_wofs_muzzle_z_10 "-1.500035" +vr_wofs_muzzle_z_11 "-0.000007" +vr_wofs_muzzle_z_12 "-0.9" +vr_wofs_muzzle_z_13 "-0.999995" +vr_wofs_muzzle_z_14 "0.000004" +vr_wofs_muzzle_z_15 "-1.299994" +vr_wofs_muzzle_z_16 "-0.500006" +vr_wofs_muzzle_z_17 "0.000003" +vr_wofs_muzzle_z_18 "1.2" +vr_wofs_muzzle_z_19 "0.0" +vr_wofs_muzzle_z_20 "0.0" +vr_wofs_muzzle_z_21 "0.0" +vr_wofs_muzzle_z_22 "0.0" +vr_wofs_muzzle_z_23 "0.0" +vr_wofs_muzzle_z_24 "0.0" +vr_wofs_muzzle_z_25 "0.0" +vr_wofs_muzzle_z_26 "0.0" +vr_wofs_muzzle_z_27 "0.0" +vr_wofs_muzzle_z_28 "0.0" +vr_wofs_muzzle_z_29 "0.0" +vr_wofs_muzzle_z_30 "0.0" +vr_wofs_muzzle_z_31 "0.0" +vr_wofs_muzzle_z_32 "0.0" +vr_wofs_offhand_x_01 "0" +vr_wofs_offhand_x_02 "0" +vr_wofs_offhand_x_03 "0" +vr_wofs_offhand_x_04 "0.0" +vr_wofs_offhand_x_05 "0" +vr_wofs_offhand_x_06 "0" +vr_wofs_offhand_x_07 "0.0" +vr_wofs_offhand_x_08 "0" +vr_wofs_offhand_x_09 "0.0" +vr_wofs_offhand_x_10 "0.0" +vr_wofs_offhand_x_11 "0.0" +vr_wofs_offhand_x_12 "0.0" +vr_wofs_offhand_x_13 "0" +vr_wofs_offhand_x_14 "0" +vr_wofs_offhand_x_15 "0.0" +vr_wofs_offhand_x_16 "0" +vr_wofs_offhand_x_17 "0.1" +vr_wofs_offhand_x_18 "0" +vr_wofs_offhand_x_19 "0.0" +vr_wofs_offhand_x_20 "0.0" +vr_wofs_offhand_x_21 "0.0" +vr_wofs_offhand_x_22 "0.0" +vr_wofs_offhand_x_23 "0.0" +vr_wofs_offhand_x_24 "0.0" +vr_wofs_offhand_x_25 "0.0" +vr_wofs_offhand_x_26 "0.0" +vr_wofs_offhand_x_27 "0.0" +vr_wofs_offhand_x_28 "0.0" +vr_wofs_offhand_x_29 "0.0" +vr_wofs_offhand_x_30 "0.0" +vr_wofs_offhand_x_31 "0.0" +vr_wofs_offhand_x_32 "0.0" +vr_wofs_offhand_y_01 "0" +vr_wofs_offhand_y_02 "0" +vr_wofs_offhand_y_03 "0" +vr_wofs_offhand_y_04 "0" +vr_wofs_offhand_y_05 "0" +vr_wofs_offhand_y_06 "0" +vr_wofs_offhand_y_07 "0" +vr_wofs_offhand_y_08 "0" +vr_wofs_offhand_y_09 "0" +vr_wofs_offhand_y_10 "0" +vr_wofs_offhand_y_11 "0" +vr_wofs_offhand_y_12 "0" +vr_wofs_offhand_y_13 "0" +vr_wofs_offhand_y_14 "0" +vr_wofs_offhand_y_15 "0" +vr_wofs_offhand_y_16 "0.5" +vr_wofs_offhand_y_17 "0.8" +vr_wofs_offhand_y_18 "0" +vr_wofs_offhand_y_19 "0.0" +vr_wofs_offhand_y_20 "0.0" +vr_wofs_offhand_y_21 "0.0" +vr_wofs_offhand_y_22 "0.0" +vr_wofs_offhand_y_23 "0.0" +vr_wofs_offhand_y_24 "0.0" +vr_wofs_offhand_y_25 "0.0" +vr_wofs_offhand_y_26 "0.0" +vr_wofs_offhand_y_27 "0.0" +vr_wofs_offhand_y_28 "0.0" +vr_wofs_offhand_y_29 "0.0" +vr_wofs_offhand_y_30 "0.0" +vr_wofs_offhand_y_31 "0.0" +vr_wofs_offhand_y_32 "0.0" +vr_wofs_offhand_z_01 "0.0" +vr_wofs_offhand_z_02 "0" +vr_wofs_offhand_z_03 "0.0" +vr_wofs_offhand_z_04 "0.0" +vr_wofs_offhand_z_05 "0.0" +vr_wofs_offhand_z_06 "0" +vr_wofs_offhand_z_07 "0" +vr_wofs_offhand_z_08 "0" +vr_wofs_offhand_z_09 "0.0" +vr_wofs_offhand_z_10 "0" +vr_wofs_offhand_z_11 "0" +vr_wofs_offhand_z_12 "0.0" +vr_wofs_offhand_z_13 "0.0" +vr_wofs_offhand_z_14 "0" +vr_wofs_offhand_z_15 "0" +vr_wofs_offhand_z_16 "0" +vr_wofs_offhand_z_17 "0" +vr_wofs_offhand_z_18 "0.0" +vr_wofs_offhand_z_19 "0.0" +vr_wofs_offhand_z_20 "0.0" +vr_wofs_offhand_z_21 "0.0" +vr_wofs_offhand_z_22 "0.0" +vr_wofs_offhand_z_23 "0.0" +vr_wofs_offhand_z_24 "0.0" +vr_wofs_offhand_z_25 "0.0" +vr_wofs_offhand_z_26 "0.0" +vr_wofs_offhand_z_27 "0.0" +vr_wofs_offhand_z_28 "0.0" +vr_wofs_offhand_z_29 "0.0" +vr_wofs_offhand_z_30 "0.0" +vr_wofs_offhand_z_31 "0.0" +vr_wofs_offhand_z_32 "0.0" +vr_wofs_pitch_01 "0" +vr_wofs_pitch_02 "-6" +vr_wofs_pitch_03 "-8" +vr_wofs_pitch_04 "-5" +vr_wofs_pitch_05 "-6.5" +vr_wofs_pitch_06 "-8.5" +vr_wofs_pitch_07 "-4.5" +vr_wofs_pitch_08 "-7" +vr_wofs_pitch_09 "-8" +vr_wofs_pitch_10 "-5.5" +vr_wofs_pitch_11 "-8.5" +vr_wofs_pitch_12 "-5" +vr_wofs_pitch_13 "-6.5" +vr_wofs_pitch_14 "-8.5" +vr_wofs_pitch_15 "-4.5" +vr_wofs_pitch_16 "-7" +vr_wofs_pitch_17 "-8.500001" +vr_wofs_pitch_18 "-4.8" +vr_wofs_pitch_19 "0.0" +vr_wofs_pitch_20 "0.0" +vr_wofs_pitch_21 "0.0" +vr_wofs_pitch_22 "0.0" +vr_wofs_pitch_23 "0.0" +vr_wofs_pitch_24 "0.0" +vr_wofs_pitch_25 "0.0" +vr_wofs_pitch_26 "0.0" +vr_wofs_pitch_27 "0.0" +vr_wofs_pitch_28 "0.0" +vr_wofs_pitch_29 "0.0" +vr_wofs_pitch_30 "0.0" +vr_wofs_pitch_31 "0.0" +vr_wofs_pitch_32 "0.0" +vr_wofs_roll_01 "0" +vr_wofs_roll_02 "0" +vr_wofs_roll_03 "0.0" +vr_wofs_roll_04 "0.0" +vr_wofs_roll_05 "0.0" +vr_wofs_roll_06 "0.0" +vr_wofs_roll_07 "0.0" +vr_wofs_roll_08 "0.0" +vr_wofs_roll_09 "0" +vr_wofs_roll_10 "0.0" +vr_wofs_roll_11 "0.0" +vr_wofs_roll_12 "0.0" +vr_wofs_roll_13 "0.0" +vr_wofs_roll_14 "0.0" +vr_wofs_roll_15 "0.0" +vr_wofs_roll_16 "0.0" +vr_wofs_roll_17 "-0.000002" +vr_wofs_roll_18 "0" +vr_wofs_roll_19 "0.0" +vr_wofs_roll_20 "0.0" +vr_wofs_roll_21 "0.0" +vr_wofs_roll_22 "0.0" +vr_wofs_roll_23 "0.0" +vr_wofs_roll_24 "0.0" +vr_wofs_roll_25 "0.0" +vr_wofs_roll_26 "0.0" +vr_wofs_roll_27 "0.0" +vr_wofs_roll_28 "0.0" +vr_wofs_roll_29 "0.0" +vr_wofs_roll_30 "0.0" +vr_wofs_roll_31 "0.0" +vr_wofs_roll_32 "0.0" +vr_wofs_scale_01 "0.34" +vr_wofs_scale_02 "0.44" +vr_wofs_scale_03 "0.48" +vr_wofs_scale_04 "0.48" +vr_wofs_scale_05 "0.38" +vr_wofs_scale_06 "0.38" +vr_wofs_scale_07 "0.34" +vr_wofs_scale_08 "0.35" +vr_wofs_scale_09 "0.34" +vr_wofs_scale_10 "0.34" +vr_wofs_scale_11 "0.38" +vr_wofs_scale_12 "0.48" +vr_wofs_scale_13 "0.38" +vr_wofs_scale_14 "0.38" +vr_wofs_scale_15 "0.34" +vr_wofs_scale_16 "0.35" +vr_wofs_scale_17 "0.34" +vr_wofs_scale_18 "0.33" +vr_wofs_scale_19 "0.5" +vr_wofs_scale_20 "0.5" +vr_wofs_scale_21 "0.5" +vr_wofs_scale_22 "0.5" +vr_wofs_scale_23 "0.5" +vr_wofs_scale_24 "0.5" +vr_wofs_scale_25 "0.5" +vr_wofs_scale_26 "0.5" +vr_wofs_scale_27 "0.5" +vr_wofs_scale_28 "0.5" +vr_wofs_scale_29 "0.5" +vr_wofs_scale_30 "0.5" +vr_wofs_scale_31 "0.5" +vr_wofs_scale_32 "0.5" +vr_wofs_w_2hdirmult_01 "1.0" +vr_wofs_w_2hdirmult_02 "1.0" +vr_wofs_w_2hdirmult_03 "1.0" +vr_wofs_w_2hdirmult_04 "1.0" +vr_wofs_w_2hdirmult_05 "1.0" +vr_wofs_w_2hdirmult_06 "1.0" +vr_wofs_w_2hdirmult_07 "1.0" +vr_wofs_w_2hdirmult_08 "1.0" +vr_wofs_w_2hdirmult_09 "1.0" +vr_wofs_w_2hdirmult_10 "1.0" +vr_wofs_w_2hdirmult_11 "1.0" +vr_wofs_w_2hdirmult_12 "1.0" +vr_wofs_w_2hdirmult_13 "1.0" +vr_wofs_w_2hdirmult_14 "1.0" +vr_wofs_w_2hdirmult_15 "1.0" +vr_wofs_w_2hdirmult_16 "1.0" +vr_wofs_w_2hdirmult_17 "1.0" +vr_wofs_w_2hdirmult_18 "1.0" +vr_wofs_w_2hdirmult_19 "1.0" +vr_wofs_w_2hdirmult_20 "1.0" +vr_wofs_w_2hdirmult_21 "1.0" +vr_wofs_w_2hdirmult_22 "1.0" +vr_wofs_w_2hdirmult_23 "1.0" +vr_wofs_w_2hdirmult_24 "1.0" +vr_wofs_w_2hdirmult_25 "1.0" +vr_wofs_w_2hdirmult_26 "1.0" +vr_wofs_w_2hdirmult_27 "1.0" +vr_wofs_w_2hdirmult_28 "1.0" +vr_wofs_w_2hdirmult_29 "1.0" +vr_wofs_w_2hdirmult_30 "1.0" +vr_wofs_w_2hdirmult_31 "1.0" +vr_wofs_w_2hdirmult_32 "1.0" +vr_wofs_w_2hposmult_01 "1.0" +vr_wofs_w_2hposmult_02 "1.0" +vr_wofs_w_2hposmult_03 "1.0" +vr_wofs_w_2hposmult_04 "1.0" +vr_wofs_w_2hposmult_05 "1.0" +vr_wofs_w_2hposmult_06 "1.0" +vr_wofs_w_2hposmult_07 "1.0" +vr_wofs_w_2hposmult_08 "1.0" +vr_wofs_w_2hposmult_09 "1.0" +vr_wofs_w_2hposmult_10 "1" +vr_wofs_w_2hposmult_11 "1.0" +vr_wofs_w_2hposmult_12 "1.0" +vr_wofs_w_2hposmult_13 "1.0" +vr_wofs_w_2hposmult_14 "1.0" +vr_wofs_w_2hposmult_15 "1.0" +vr_wofs_w_2hposmult_16 "1.0" +vr_wofs_w_2hposmult_17 "1.0" +vr_wofs_w_2hposmult_18 "1.0" +vr_wofs_w_2hposmult_19 "1.0" +vr_wofs_w_2hposmult_20 "1.0" +vr_wofs_w_2hposmult_21 "1.0" +vr_wofs_w_2hposmult_22 "1.0" +vr_wofs_w_2hposmult_23 "1.0" +vr_wofs_w_2hposmult_24 "1.0" +vr_wofs_w_2hposmult_25 "1.0" +vr_wofs_w_2hposmult_26 "1.0" +vr_wofs_w_2hposmult_27 "1.0" +vr_wofs_w_2hposmult_28 "1.0" +vr_wofs_w_2hposmult_29 "1.0" +vr_wofs_w_2hposmult_30 "1.0" +vr_wofs_w_2hposmult_31 "1.0" +vr_wofs_w_2hposmult_32 "1.0" +vr_wofs_w_dirmult_01 "1.0" +vr_wofs_w_dirmult_02 "1.0" +vr_wofs_w_dirmult_03 "1.0" +vr_wofs_w_dirmult_04 "1.0" +vr_wofs_w_dirmult_05 "0.73" +vr_wofs_w_dirmult_06 "0.95" +vr_wofs_w_dirmult_07 "1.0" +vr_wofs_w_dirmult_08 "1.0" +vr_wofs_w_dirmult_09 "1.0" +vr_wofs_w_dirmult_10 "0.4" +vr_wofs_w_dirmult_11 "0.95" +vr_wofs_w_dirmult_12 "1.0" +vr_wofs_w_dirmult_13 "0.73" +vr_wofs_w_dirmult_14 "0.95" +vr_wofs_w_dirmult_15 "1.0" +vr_wofs_w_dirmult_16 "1.0" +vr_wofs_w_dirmult_17 "1.0" +vr_wofs_w_dirmult_18 "1.0" +vr_wofs_w_dirmult_19 "1.0" +vr_wofs_w_dirmult_20 "1.0" +vr_wofs_w_dirmult_21 "1.0" +vr_wofs_w_dirmult_22 "1.0" +vr_wofs_w_dirmult_23 "1.0" +vr_wofs_w_dirmult_24 "1.0" +vr_wofs_w_dirmult_25 "1.0" +vr_wofs_w_dirmult_26 "1.0" +vr_wofs_w_dirmult_27 "1.0" +vr_wofs_w_dirmult_28 "1.0" +vr_wofs_w_dirmult_29 "1.0" +vr_wofs_w_dirmult_30 "1.0" +vr_wofs_w_dirmult_31 "1.0" +vr_wofs_w_dirmult_32 "1.0" +vr_wofs_w_htvelmult_01 "1" +vr_wofs_w_htvelmult_02 "1.0" +vr_wofs_w_htvelmult_03 "1.0" +vr_wofs_w_htvelmult_04 "1.0" +vr_wofs_w_htvelmult_05 "0.9" +vr_wofs_w_htvelmult_06 "0.95" +vr_wofs_w_htvelmult_07 "1.0" +vr_wofs_w_htvelmult_08 "1.0" +vr_wofs_w_htvelmult_09 "1.0" +vr_wofs_w_htvelmult_10 "1.0" +vr_wofs_w_htvelmult_11 "1.0" +vr_wofs_w_htvelmult_12 "1.0" +vr_wofs_w_htvelmult_13 "0.9" +vr_wofs_w_htvelmult_14 "0.95" +vr_wofs_w_htvelmult_15 "1.0" +vr_wofs_w_htvelmult_16 "1.0" +vr_wofs_w_htvelmult_17 "1.0" +vr_wofs_w_htvelmult_18 "1.0" +vr_wofs_w_htvelmult_19 "1.0" +vr_wofs_w_htvelmult_20 "1.0" +vr_wofs_w_htvelmult_21 "1.0" +vr_wofs_w_htvelmult_22 "1.0" +vr_wofs_w_htvelmult_23 "1.0" +vr_wofs_w_htvelmult_24 "1.0" +vr_wofs_w_htvelmult_25 "1.0" +vr_wofs_w_htvelmult_26 "1.0" +vr_wofs_w_htvelmult_27 "1.0" +vr_wofs_w_htvelmult_28 "1.0" +vr_wofs_w_htvelmult_29 "1.0" +vr_wofs_w_htvelmult_30 "1.0" +vr_wofs_w_htvelmult_31 "1.0" +vr_wofs_w_htvelmult_32 "1.0" +vr_wofs_w_hvelmult_01 "1.02" +vr_wofs_w_hvelmult_02 "1.0" +vr_wofs_w_hvelmult_03 "1.0" +vr_wofs_w_hvelmult_04 "1.0" +vr_wofs_w_hvelmult_05 "0.95" +vr_wofs_w_hvelmult_06 "0.95" +vr_wofs_w_hvelmult_07 "1.0" +vr_wofs_w_hvelmult_08 "1.0" +vr_wofs_w_hvelmult_09 "1.0" +vr_wofs_w_hvelmult_10 "1.0" +vr_wofs_w_hvelmult_11 "0.95" +vr_wofs_w_hvelmult_12 "1.0" +vr_wofs_w_hvelmult_13 "0.95" +vr_wofs_w_hvelmult_14 "0.95" +vr_wofs_w_hvelmult_15 "1.0" +vr_wofs_w_hvelmult_16 "1.0" +vr_wofs_w_hvelmult_17 "1.0" +vr_wofs_w_hvelmult_18 "1.0" +vr_wofs_w_hvelmult_19 "1.0" +vr_wofs_w_hvelmult_20 "1.0" +vr_wofs_w_hvelmult_21 "1.0" +vr_wofs_w_hvelmult_22 "1.0" +vr_wofs_w_hvelmult_23 "1.0" +vr_wofs_w_hvelmult_24 "1.0" +vr_wofs_w_hvelmult_25 "1.0" +vr_wofs_w_hvelmult_26 "1.0" +vr_wofs_w_hvelmult_27 "1.0" +vr_wofs_w_hvelmult_28 "1.0" +vr_wofs_w_hvelmult_29 "1.0" +vr_wofs_w_hvelmult_30 "1.0" +vr_wofs_w_hvelmult_31 "1.0" +vr_wofs_w_hvelmult_32 "1.0" +vr_wofs_w_posmult_01 "1.0" +vr_wofs_w_posmult_02 "1.0" +vr_wofs_w_posmult_03 "1.0" +vr_wofs_w_posmult_04 "1.0" +vr_wofs_w_posmult_05 "0.73" +vr_wofs_w_posmult_06 "0.95" +vr_wofs_w_posmult_07 "1.0" +vr_wofs_w_posmult_08 "1.0" +vr_wofs_w_posmult_09 "1.0" +vr_wofs_w_posmult_10 "0.95" +vr_wofs_w_posmult_11 "0.95" +vr_wofs_w_posmult_12 "1.0" +vr_wofs_w_posmult_13 "0.73" +vr_wofs_w_posmult_14 "0.95" +vr_wofs_w_posmult_15 "1.0" +vr_wofs_w_posmult_16 "1.0" +vr_wofs_w_posmult_17 "1.0" +vr_wofs_w_posmult_18 "1.0" +vr_wofs_w_posmult_19 "1.0" +vr_wofs_w_posmult_20 "1.0" +vr_wofs_w_posmult_21 "1.0" +vr_wofs_w_posmult_22 "1.0" +vr_wofs_w_posmult_23 "1.0" +vr_wofs_w_posmult_24 "1.0" +vr_wofs_w_posmult_25 "1.0" +vr_wofs_w_posmult_26 "1.0" +vr_wofs_w_posmult_27 "1.0" +vr_wofs_w_posmult_28 "1.0" +vr_wofs_w_posmult_29 "1.0" +vr_wofs_w_posmult_30 "1.0" +vr_wofs_w_posmult_31 "1.0" +vr_wofs_w_posmult_32 "1.0" +vr_wofs_weight_01 "0.6" +vr_wofs_weight_02 "0.65" +vr_wofs_weight_03 "0.7" +vr_wofs_weight_04 "0.65" +vr_wofs_weight_05 "0.76" +vr_wofs_weight_06 "0.82" +vr_wofs_weight_07 "0.9" +vr_wofs_weight_08 "0.8" +vr_wofs_weight_09 "0.78" +vr_wofs_weight_10 "0.96" +vr_wofs_weight_11 "0.82" +vr_wofs_weight_12 "0.65" +vr_wofs_weight_13 "0.76" +vr_wofs_weight_14 "0.82" +vr_wofs_weight_15 "0.9" +vr_wofs_weight_16 "0.8" +vr_wofs_weight_17 "0" +vr_wofs_weight_18 "0.4" +vr_wofs_weight_19 "0.0" +vr_wofs_weight_20 "0.0" +vr_wofs_weight_21 "0.0" +vr_wofs_weight_22 "0.0" +vr_wofs_weight_23 "0.0" +vr_wofs_weight_24 "0.0" +vr_wofs_weight_25 "0.0" +vr_wofs_weight_26 "0.0" +vr_wofs_weight_27 "0.0" +vr_wofs_weight_28 "0.0" +vr_wofs_weight_29 "0.0" +vr_wofs_weight_30 "0.0" +vr_wofs_weight_31 "0.0" +vr_wofs_weight_32 "0.0" +vr_wofs_wpnbtn_av_01 "0.0" +vr_wofs_wpnbtn_av_02 "0" +vr_wofs_wpnbtn_av_03 "0.0" +vr_wofs_wpnbtn_av_04 "97" +vr_wofs_wpnbtn_av_05 "28" +vr_wofs_wpnbtn_av_06 "33" +vr_wofs_wpnbtn_av_07 "12" +vr_wofs_wpnbtn_av_08 "57" +vr_wofs_wpnbtn_av_09 "0.0" +vr_wofs_wpnbtn_av_10 "0.0" +vr_wofs_wpnbtn_av_11 "0.0" +vr_wofs_wpnbtn_av_12 "97" +vr_wofs_wpnbtn_av_13 "44" +vr_wofs_wpnbtn_av_14 "33" +vr_wofs_wpnbtn_av_15 "12" +vr_wofs_wpnbtn_av_16 "57" +vr_wofs_wpnbtn_av_17 "0.0" +vr_wofs_wpnbtn_av_18 "0.0" +vr_wofs_wpnbtn_av_19 "0.0" +vr_wofs_wpnbtn_av_20 "0.0" +vr_wofs_wpnbtn_av_21 "0.0" +vr_wofs_wpnbtn_av_22 "0.0" +vr_wofs_wpnbtn_av_23 "0.0" +vr_wofs_wpnbtn_av_24 "0.0" +vr_wofs_wpnbtn_av_25 "0.0" +vr_wofs_wpnbtn_av_26 "0.0" +vr_wofs_wpnbtn_av_27 "0.0" +vr_wofs_wpnbtn_av_28 "0.0" +vr_wofs_wpnbtn_av_29 "0.0" +vr_wofs_wpnbtn_av_30 "0.0" +vr_wofs_wpnbtn_av_31 "0.0" +vr_wofs_wpnbtn_av_32 "0.0" +vr_wofs_wpnbtn_oh_x_01 "0.0" +vr_wofs_wpnbtn_oh_x_02 "0.0" +vr_wofs_wpnbtn_oh_x_03 "0.0" +vr_wofs_wpnbtn_oh_x_04 "0.0" +vr_wofs_wpnbtn_oh_x_05 "0.0" +vr_wofs_wpnbtn_oh_x_06 "0.0" +vr_wofs_wpnbtn_oh_x_07 "0.0" +vr_wofs_wpnbtn_oh_x_08 "0.0" +vr_wofs_wpnbtn_oh_x_09 "0.0" +vr_wofs_wpnbtn_oh_x_10 "0.0" +vr_wofs_wpnbtn_oh_x_11 "0.0" +vr_wofs_wpnbtn_oh_x_12 "0.0" +vr_wofs_wpnbtn_oh_x_13 "0.0" +vr_wofs_wpnbtn_oh_x_14 "0.0" +vr_wofs_wpnbtn_oh_x_15 "0.0" +vr_wofs_wpnbtn_oh_x_16 "0.0" +vr_wofs_wpnbtn_oh_x_17 "0.0" +vr_wofs_wpnbtn_oh_x_18 "0.0" +vr_wofs_wpnbtn_oh_x_19 "0.0" +vr_wofs_wpnbtn_oh_x_20 "0.0" +vr_wofs_wpnbtn_oh_x_21 "0.0" +vr_wofs_wpnbtn_oh_x_22 "0.0" +vr_wofs_wpnbtn_oh_x_23 "0.0" +vr_wofs_wpnbtn_oh_x_24 "0.0" +vr_wofs_wpnbtn_oh_x_25 "0.0" +vr_wofs_wpnbtn_oh_x_26 "0.0" +vr_wofs_wpnbtn_oh_x_27 "0.0" +vr_wofs_wpnbtn_oh_x_28 "0.0" +vr_wofs_wpnbtn_oh_x_29 "0.0" +vr_wofs_wpnbtn_oh_x_30 "0.0" +vr_wofs_wpnbtn_oh_x_31 "0.0" +vr_wofs_wpnbtn_oh_x_32 "0.0" +vr_wofs_wpnbtn_oh_y_01 "0.0" +vr_wofs_wpnbtn_oh_y_02 "0.0" +vr_wofs_wpnbtn_oh_y_03 "0.0" +vr_wofs_wpnbtn_oh_y_04 "-0.000001" +vr_wofs_wpnbtn_oh_y_05 "0" +vr_wofs_wpnbtn_oh_y_06 "0" +vr_wofs_wpnbtn_oh_y_07 "0" +vr_wofs_wpnbtn_oh_y_08 "0" +vr_wofs_wpnbtn_oh_y_09 "0.0" +vr_wofs_wpnbtn_oh_y_10 "0.0" +vr_wofs_wpnbtn_oh_y_11 "0.0" +vr_wofs_wpnbtn_oh_y_12 "0" +vr_wofs_wpnbtn_oh_y_13 "0" +vr_wofs_wpnbtn_oh_y_14 "0" +vr_wofs_wpnbtn_oh_y_15 "0" +vr_wofs_wpnbtn_oh_y_16 "0" +vr_wofs_wpnbtn_oh_y_17 "0.0" +vr_wofs_wpnbtn_oh_y_18 "0.0" +vr_wofs_wpnbtn_oh_y_19 "0.0" +vr_wofs_wpnbtn_oh_y_20 "0.0" +vr_wofs_wpnbtn_oh_y_21 "0.0" +vr_wofs_wpnbtn_oh_y_22 "0.0" +vr_wofs_wpnbtn_oh_y_23 "0.0" +vr_wofs_wpnbtn_oh_y_24 "0.0" +vr_wofs_wpnbtn_oh_y_25 "0.0" +vr_wofs_wpnbtn_oh_y_26 "0.0" +vr_wofs_wpnbtn_oh_y_27 "0.0" +vr_wofs_wpnbtn_oh_y_28 "0.0" +vr_wofs_wpnbtn_oh_y_29 "0.0" +vr_wofs_wpnbtn_oh_y_30 "0.0" +vr_wofs_wpnbtn_oh_y_31 "0.0" +vr_wofs_wpnbtn_oh_y_32 "0.0" +vr_wofs_wpnbtn_oh_z_01 "0.0" +vr_wofs_wpnbtn_oh_z_02 "0.0" +vr_wofs_wpnbtn_oh_z_03 "0.0" +vr_wofs_wpnbtn_oh_z_04 "0" +vr_wofs_wpnbtn_oh_z_05 "0.0" +vr_wofs_wpnbtn_oh_z_06 "0.0" +vr_wofs_wpnbtn_oh_z_07 "0.0" +vr_wofs_wpnbtn_oh_z_08 "0.0" +vr_wofs_wpnbtn_oh_z_09 "0.0" +vr_wofs_wpnbtn_oh_z_10 "0.0" +vr_wofs_wpnbtn_oh_z_11 "0.0" +vr_wofs_wpnbtn_oh_z_12 "0.0" +vr_wofs_wpnbtn_oh_z_13 "0.0" +vr_wofs_wpnbtn_oh_z_14 "0.0" +vr_wofs_wpnbtn_oh_z_15 "0.0" +vr_wofs_wpnbtn_oh_z_16 "0.0" +vr_wofs_wpnbtn_oh_z_17 "0.0" +vr_wofs_wpnbtn_oh_z_18 "0.0" +vr_wofs_wpnbtn_oh_z_19 "0.0" +vr_wofs_wpnbtn_oh_z_20 "0.0" +vr_wofs_wpnbtn_oh_z_21 "0.0" +vr_wofs_wpnbtn_oh_z_22 "0.0" +vr_wofs_wpnbtn_oh_z_23 "0.0" +vr_wofs_wpnbtn_oh_z_24 "0.0" +vr_wofs_wpnbtn_oh_z_25 "0.0" +vr_wofs_wpnbtn_oh_z_26 "0.0" +vr_wofs_wpnbtn_oh_z_27 "0.0" +vr_wofs_wpnbtn_oh_z_28 "0.0" +vr_wofs_wpnbtn_oh_z_29 "0.0" +vr_wofs_wpnbtn_oh_z_30 "0.0" +vr_wofs_wpnbtn_oh_z_31 "0.0" +vr_wofs_wpnbtn_oh_z_32 "0.0" +vr_wofs_wpnbtn_pitch_01 "0.0" +vr_wofs_wpnbtn_pitch_02 "0.0" +vr_wofs_wpnbtn_pitch_03 "0.0" +vr_wofs_wpnbtn_pitch_04 "0.0" +vr_wofs_wpnbtn_pitch_05 "0.0" +vr_wofs_wpnbtn_pitch_06 "0.0" +vr_wofs_wpnbtn_pitch_07 "0.0" +vr_wofs_wpnbtn_pitch_08 "0.0" +vr_wofs_wpnbtn_pitch_09 "0.0" +vr_wofs_wpnbtn_pitch_10 "0.0" +vr_wofs_wpnbtn_pitch_11 "0.0" +vr_wofs_wpnbtn_pitch_12 "0.0" +vr_wofs_wpnbtn_pitch_13 "0.0" +vr_wofs_wpnbtn_pitch_14 "0.0" +vr_wofs_wpnbtn_pitch_15 "0.0" +vr_wofs_wpnbtn_pitch_16 "0.0" +vr_wofs_wpnbtn_pitch_17 "0.0" +vr_wofs_wpnbtn_pitch_18 "0.0" +vr_wofs_wpnbtn_pitch_19 "0.0" +vr_wofs_wpnbtn_pitch_20 "0.0" +vr_wofs_wpnbtn_pitch_21 "0.0" +vr_wofs_wpnbtn_pitch_22 "0.0" +vr_wofs_wpnbtn_pitch_23 "0.0" +vr_wofs_wpnbtn_pitch_24 "0.0" +vr_wofs_wpnbtn_pitch_25 "0.0" +vr_wofs_wpnbtn_pitch_26 "0.0" +vr_wofs_wpnbtn_pitch_27 "0.0" +vr_wofs_wpnbtn_pitch_28 "0.0" +vr_wofs_wpnbtn_pitch_29 "0.0" +vr_wofs_wpnbtn_pitch_30 "0.0" +vr_wofs_wpnbtn_pitch_31 "0.0" +vr_wofs_wpnbtn_pitch_32 "0.0" +vr_wofs_wpnbtn_roll_01 "0.0" +vr_wofs_wpnbtn_roll_02 "0.0" +vr_wofs_wpnbtn_roll_03 "0.0" +vr_wofs_wpnbtn_roll_04 "0.0" +vr_wofs_wpnbtn_roll_05 "-65.399933" +vr_wofs_wpnbtn_roll_06 "56.999977" +vr_wofs_wpnbtn_roll_07 "32.400013" +vr_wofs_wpnbtn_roll_08 "0.0" +vr_wofs_wpnbtn_roll_09 "0.0" +vr_wofs_wpnbtn_roll_10 "0.0" +vr_wofs_wpnbtn_roll_11 "0.0" +vr_wofs_wpnbtn_roll_12 "0.0" +vr_wofs_wpnbtn_roll_13 "-65.399933" +vr_wofs_wpnbtn_roll_14 "56.999962" +vr_wofs_wpnbtn_roll_15 "32.400013" +vr_wofs_wpnbtn_roll_16 "0.0" +vr_wofs_wpnbtn_roll_17 "0.0" +vr_wofs_wpnbtn_roll_18 "0.0" +vr_wofs_wpnbtn_roll_19 "0.0" +vr_wofs_wpnbtn_roll_20 "0.0" +vr_wofs_wpnbtn_roll_21 "0.0" +vr_wofs_wpnbtn_roll_22 "0.0" +vr_wofs_wpnbtn_roll_23 "0.0" +vr_wofs_wpnbtn_roll_24 "0.0" +vr_wofs_wpnbtn_roll_25 "0.0" +vr_wofs_wpnbtn_roll_26 "0.0" +vr_wofs_wpnbtn_roll_27 "0.0" +vr_wofs_wpnbtn_roll_28 "0.0" +vr_wofs_wpnbtn_roll_29 "0.0" +vr_wofs_wpnbtn_roll_30 "0.0" +vr_wofs_wpnbtn_roll_31 "0.0" +vr_wofs_wpnbtn_roll_32 "0.0" +vr_wofs_wpnbtn_x_01 "0.0" +vr_wofs_wpnbtn_x_02 "-7.9" +vr_wofs_wpnbtn_x_03 "0.0" +vr_wofs_wpnbtn_x_04 "1.6" +vr_wofs_wpnbtn_x_05 "-1.6" +vr_wofs_wpnbtn_x_06 "-0.2" +vr_wofs_wpnbtn_x_07 "1.8" +vr_wofs_wpnbtn_x_08 "5.4" +vr_wofs_wpnbtn_x_09 "0.0" +vr_wofs_wpnbtn_x_10 "0.0" +vr_wofs_wpnbtn_x_11 "0.0" +vr_wofs_wpnbtn_x_12 "1.6" +vr_wofs_wpnbtn_x_13 "-1.6" +vr_wofs_wpnbtn_x_14 "-0.2" +vr_wofs_wpnbtn_x_15 "1.8" +vr_wofs_wpnbtn_x_16 "5.4" +vr_wofs_wpnbtn_x_17 "0.0" +vr_wofs_wpnbtn_x_18 "0.0" +vr_wofs_wpnbtn_x_19 "0.0" +vr_wofs_wpnbtn_x_20 "0.0" +vr_wofs_wpnbtn_x_21 "0.0" +vr_wofs_wpnbtn_x_22 "0.0" +vr_wofs_wpnbtn_x_23 "0.0" +vr_wofs_wpnbtn_x_24 "0.0" +vr_wofs_wpnbtn_x_25 "0.0" +vr_wofs_wpnbtn_x_26 "0.0" +vr_wofs_wpnbtn_x_27 "0.0" +vr_wofs_wpnbtn_x_28 "0.0" +vr_wofs_wpnbtn_x_29 "0.0" +vr_wofs_wpnbtn_x_30 "0.0" +vr_wofs_wpnbtn_x_31 "0.0" +vr_wofs_wpnbtn_x_32 "0.0" +vr_wofs_wpnbtn_y_01 "0.0" +vr_wofs_wpnbtn_y_02 "-2.0" +vr_wofs_wpnbtn_y_03 "0.0" +vr_wofs_wpnbtn_y_04 "-0.45" +vr_wofs_wpnbtn_y_05 "1.500001" +vr_wofs_wpnbtn_y_06 "-2.9" +vr_wofs_wpnbtn_y_07 "-1.5" +vr_wofs_wpnbtn_y_08 "-0.7" +vr_wofs_wpnbtn_y_09 "0.0" +vr_wofs_wpnbtn_y_10 "0.0" +vr_wofs_wpnbtn_y_11 "0.0" +vr_wofs_wpnbtn_y_12 "-0.45" +vr_wofs_wpnbtn_y_13 "1.500001" +vr_wofs_wpnbtn_y_14 "-2.9" +vr_wofs_wpnbtn_y_15 "-1.5" +vr_wofs_wpnbtn_y_16 "-0.7" +vr_wofs_wpnbtn_y_17 "0.0" +vr_wofs_wpnbtn_y_18 "0.0" +vr_wofs_wpnbtn_y_19 "0.0" +vr_wofs_wpnbtn_y_20 "0.0" +vr_wofs_wpnbtn_y_21 "0.0" +vr_wofs_wpnbtn_y_22 "0.0" +vr_wofs_wpnbtn_y_23 "0.0" +vr_wofs_wpnbtn_y_24 "0.0" +vr_wofs_wpnbtn_y_25 "0.0" +vr_wofs_wpnbtn_y_26 "0.0" +vr_wofs_wpnbtn_y_27 "0.0" +vr_wofs_wpnbtn_y_28 "0.0" +vr_wofs_wpnbtn_y_29 "0.0" +vr_wofs_wpnbtn_y_30 "0.0" +vr_wofs_wpnbtn_y_31 "0.0" +vr_wofs_wpnbtn_y_32 "0.0" +vr_wofs_wpnbtn_yaw_01 "0.0" +vr_wofs_wpnbtn_yaw_02 "0.0" +vr_wofs_wpnbtn_yaw_03 "0.0" +vr_wofs_wpnbtn_yaw_04 "0.0" +vr_wofs_wpnbtn_yaw_05 "0.0" +vr_wofs_wpnbtn_yaw_06 "0.0" +vr_wofs_wpnbtn_yaw_07 "0.0" +vr_wofs_wpnbtn_yaw_08 "0.0" +vr_wofs_wpnbtn_yaw_09 "0.0" +vr_wofs_wpnbtn_yaw_10 "0.0" +vr_wofs_wpnbtn_yaw_11 "0.0" +vr_wofs_wpnbtn_yaw_12 "0.0" +vr_wofs_wpnbtn_yaw_13 "0.0" +vr_wofs_wpnbtn_yaw_14 "0.0" +vr_wofs_wpnbtn_yaw_15 "0.0" +vr_wofs_wpnbtn_yaw_16 "0.0" +vr_wofs_wpnbtn_yaw_17 "0.0" +vr_wofs_wpnbtn_yaw_18 "0.0" +vr_wofs_wpnbtn_yaw_19 "0.0" +vr_wofs_wpnbtn_yaw_20 "0.0" +vr_wofs_wpnbtn_yaw_21 "0.0" +vr_wofs_wpnbtn_yaw_22 "0.0" +vr_wofs_wpnbtn_yaw_23 "0.0" +vr_wofs_wpnbtn_yaw_24 "0.0" +vr_wofs_wpnbtn_yaw_25 "0.0" +vr_wofs_wpnbtn_yaw_26 "0.0" +vr_wofs_wpnbtn_yaw_27 "0.0" +vr_wofs_wpnbtn_yaw_28 "0.0" +vr_wofs_wpnbtn_yaw_29 "0.0" +vr_wofs_wpnbtn_yaw_30 "0.0" +vr_wofs_wpnbtn_yaw_31 "0.0" +vr_wofs_wpnbtn_yaw_32 "0.0" +vr_wofs_wpnbtn_z_01 "0.0" +vr_wofs_wpnbtn_z_02 "1" +vr_wofs_wpnbtn_z_03 "0.0" +vr_wofs_wpnbtn_z_04 "-0.2" +vr_wofs_wpnbtn_z_05 "3" +vr_wofs_wpnbtn_z_06 "1.8" +vr_wofs_wpnbtn_z_07 "1.3" +vr_wofs_wpnbtn_z_08 "-1" +vr_wofs_wpnbtn_z_09 "0.0" +vr_wofs_wpnbtn_z_10 "0.0" +vr_wofs_wpnbtn_z_11 "0.0" +vr_wofs_wpnbtn_z_12 "-0.2" +vr_wofs_wpnbtn_z_13 "3" +vr_wofs_wpnbtn_z_14 "1.8" +vr_wofs_wpnbtn_z_15 "1.3" +vr_wofs_wpnbtn_z_16 "-1" +vr_wofs_wpnbtn_z_17 "0.0" +vr_wofs_wpnbtn_z_18 "0.0" +vr_wofs_wpnbtn_z_19 "0.0" +vr_wofs_wpnbtn_z_20 "0.0" +vr_wofs_wpnbtn_z_21 "0.0" +vr_wofs_wpnbtn_z_22 "0.0" +vr_wofs_wpnbtn_z_23 "0.0" +vr_wofs_wpnbtn_z_24 "0.0" +vr_wofs_wpnbtn_z_25 "0.0" +vr_wofs_wpnbtn_z_26 "0.0" +vr_wofs_wpnbtn_z_27 "0.0" +vr_wofs_wpnbtn_z_28 "0.0" +vr_wofs_wpnbtn_z_29 "0.0" +vr_wofs_wpnbtn_z_30 "0.0" +vr_wofs_wpnbtn_z_31 "0.0" +vr_wofs_wpnbtn_z_32 "0.0" +vr_wofs_wpnbtnmode_01 "0" +vr_wofs_wpnbtnmode_02 "0" +vr_wofs_wpnbtnmode_03 "0.0" +vr_wofs_wpnbtnmode_04 "1" +vr_wofs_wpnbtnmode_05 "1" +vr_wofs_wpnbtnmode_06 "1" +vr_wofs_wpnbtnmode_07 "1" +vr_wofs_wpnbtnmode_08 "1" +vr_wofs_wpnbtnmode_09 "0.0" +vr_wofs_wpnbtnmode_10 "0.0" +vr_wofs_wpnbtnmode_11 "0.0" +vr_wofs_wpnbtnmode_12 "1" +vr_wofs_wpnbtnmode_13 "1" +vr_wofs_wpnbtnmode_14 "1" +vr_wofs_wpnbtnmode_15 "1" +vr_wofs_wpnbtnmode_16 "1" +vr_wofs_wpnbtnmode_17 "0.0" +vr_wofs_wpnbtnmode_18 "0.0" +vr_wofs_wpnbtnmode_19 "0.0" +vr_wofs_wpnbtnmode_20 "0.0" +vr_wofs_wpnbtnmode_21 "0.0" +vr_wofs_wpnbtnmode_22 "0.0" +vr_wofs_wpnbtnmode_23 "0.0" +vr_wofs_wpnbtnmode_24 "0.0" +vr_wofs_wpnbtnmode_25 "0.0" +vr_wofs_wpnbtnmode_26 "0.0" +vr_wofs_wpnbtnmode_27 "0.0" +vr_wofs_wpnbtnmode_28 "0.0" +vr_wofs_wpnbtnmode_29 "0.0" +vr_wofs_wpnbtnmode_30 "0.0" +vr_wofs_wpnbtnmode_31 "0.0" +vr_wofs_wpnbtnmode_32 "0.0" +vr_wofs_x_01 "-0.6" +vr_wofs_x_02 "0.950001" +vr_wofs_x_03 "6.099997" +vr_wofs_x_04 "3.6" +vr_wofs_x_05 "1.3" +vr_wofs_x_06 "11.100024" +vr_wofs_x_07 "6.60001" +vr_wofs_x_08 "2.25" +vr_wofs_x_09 "1.2" +vr_wofs_x_10 "-1.4" +vr_wofs_x_11 "11.099998" +vr_wofs_x_12 "3.6" +vr_wofs_x_13 "1.05" +vr_wofs_x_14 "11.000022" +vr_wofs_x_15 "6.50001" +vr_wofs_x_16 "2.25" +vr_wofs_x_17 "2.25" +vr_wofs_x_18 "-2.15" +vr_wofs_x_19 "1.5" +vr_wofs_x_20 "1.5" +vr_wofs_x_21 "1.5" +vr_wofs_x_22 "1.5" +vr_wofs_x_23 "1.5" +vr_wofs_x_24 "1.5" +vr_wofs_x_25 "1.5" +vr_wofs_x_26 "1.5" +vr_wofs_x_27 "1.5" +vr_wofs_x_28 "1.5" +vr_wofs_x_29 "1.5" +vr_wofs_x_30 "1.5" +vr_wofs_x_31 "1.5" +vr_wofs_x_32 "1.5" +vr_wofs_y_01 "1.1" +vr_wofs_y_02 "1.350002" +vr_wofs_y_03 "1.35" +vr_wofs_y_04 "2.75" +vr_wofs_y_05 "4.55" +vr_wofs_y_06 "2.25" +vr_wofs_y_07 "7.1" +vr_wofs_y_08 "6.05" +vr_wofs_y_09 "3.2" +vr_wofs_y_10 "5.9" +vr_wofs_y_11 "2.25" +vr_wofs_y_12 "2.75" +vr_wofs_y_13 "4.55" +vr_wofs_y_14 "2.25" +vr_wofs_y_15 "7.05" +vr_wofs_y_16 "6.05" +vr_wofs_y_17 "2.25" +vr_wofs_y_18 "5" +vr_wofs_y_19 "1" +vr_wofs_y_20 "1" +vr_wofs_y_21 "1" +vr_wofs_y_22 "1" +vr_wofs_y_23 "1" +vr_wofs_y_24 "1" +vr_wofs_y_25 "1" +vr_wofs_y_26 "1" +vr_wofs_y_27 "1" +vr_wofs_y_28 "1" +vr_wofs_y_29 "1" +vr_wofs_y_30 "1" +vr_wofs_y_31 "1" +vr_wofs_y_32 "1" +vr_wofs_yaw_01 "0.79998" +vr_wofs_yaw_02 "0" +vr_wofs_yaw_03 "0" +vr_wofs_yaw_04 "0.0" +vr_wofs_yaw_05 "0.0" +vr_wofs_yaw_06 "0.5" +vr_wofs_yaw_07 "0.5" +vr_wofs_yaw_08 "0" +vr_wofs_yaw_09 "-2.5" +vr_wofs_yaw_10 "0" +vr_wofs_yaw_11 "0.5" +vr_wofs_yaw_12 "0.0" +vr_wofs_yaw_13 "0.0" +vr_wofs_yaw_14 "0.5" +vr_wofs_yaw_15 "0.5" +vr_wofs_yaw_16 "0" +vr_wofs_yaw_17 "0" +vr_wofs_yaw_18 "0.0" +vr_wofs_yaw_19 "0.0" +vr_wofs_yaw_20 "0.0" +vr_wofs_yaw_21 "0.0" +vr_wofs_yaw_22 "0.0" +vr_wofs_yaw_23 "0.0" +vr_wofs_yaw_24 "0.0" +vr_wofs_yaw_25 "0.0" +vr_wofs_yaw_26 "0.0" +vr_wofs_yaw_27 "0.0" +vr_wofs_yaw_28 "0.0" +vr_wofs_yaw_29 "0.0" +vr_wofs_yaw_30 "0.0" +vr_wofs_yaw_31 "0.0" +vr_wofs_yaw_32 "0.0" +vr_wofs_z_01 "-0.8" +vr_wofs_z_02 "-0.050021" +vr_wofs_z_03 "-2.350011" +vr_wofs_z_04 "0.799975" +vr_wofs_z_05 "2.05" +vr_wofs_z_06 "-1.850028" +vr_wofs_z_07 "-0.350044" +vr_wofs_z_08 "-3.95" +vr_wofs_z_09 "-1.45" +vr_wofs_z_10 "12.299991" +vr_wofs_z_11 "-1.85" +vr_wofs_z_12 "0.799975" +vr_wofs_z_13 "2.05" +vr_wofs_z_14 "-1.950028" +vr_wofs_z_15 "-0.350044" +vr_wofs_z_16 "-3.95" +vr_wofs_z_17 "-0.5" +vr_wofs_z_18 "-0.9" +vr_wofs_z_19 "10" +vr_wofs_z_20 "10" +vr_wofs_z_21 "10" +vr_wofs_z_22 "10" +vr_wofs_z_23 "10" +vr_wofs_z_24 "10" +vr_wofs_z_25 "10" +vr_wofs_z_26 "10" +vr_wofs_z_27 "10" +vr_wofs_z_28 "10" +vr_wofs_z_29 "10" +vr_wofs_z_30 "10" +vr_wofs_z_31 "10" +vr_wofs_z_32 "10" +vr_world_scale "1.25" +vr_wpn_dir_weight "1" +vr_wpn_dir_weight_2h_help_mult "1.0" +vr_wpn_dir_weight_2h_help_offset "0.3" +vr_wpn_dir_weight_mult "1" +vr_wpn_dir_weight_offset "0.05" +vr_wpn_pos_weight "1" +vr_wpn_pos_weight_2h_help_mult "1.0" +vr_wpn_pos_weight_2h_help_offset "0.3" +vr_wpn_pos_weight_mult "1.0" +vr_wpn_pos_weight_offset "0.0" +vid_restart ++mlook diff --git a/old/config11.cfg b/old/config11.cfg new file mode 100644 index 00000000..12fe1a9d --- /dev/null +++ b/old/config11.cfg @@ -0,0 +1,2129 @@ +unbindall +bind "TAB" "+showscores" +bind "ENTER" "+jump" +bind "ESCAPE" "togglemenu" +bind "SPACE" "+jump" +bind "+" "sizeup" +bind "," "+moveleft" +bind "-" "sizedown" +bind "." "+moveright" +bind "/" "impulse 10" +bind "0" "impulse 0" +bind "1" "impulse 10" +bind "2" "impulse 2" +bind "3" "impulse 12" +bind "4" "impulse 15" +bind "5" "impulse 16" +bind "6" "impulse 6" +bind "7" "impulse 42" +bind "8" "impulse 43" +bind "=" "sizeup" +bind "\" "+mlook" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+movedown" +bind "d" "+moveright" +bind "k" "+grableft" +bind "l" "+grabright" +bind "s" "+back" +bind "t" "messagemode" +bind "w" "+forward" +bind "z" "+lookdown" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "impulse 10" +bind "RIGHTARROW" "+right" +bind "ALT" "+strafe" +bind "CTRL" "+attack" +bind "SHIFT" "+speed" +bind "F1" "help" +bind "F2" "menu_save" +bind "F3" "menu_load" +bind "F4" "menu_options" +bind "F5" "menu_multiplayer" +bind "F6" "echo Quicksaving...; wait; save quick" +bind "F9" "echo Quickloading...; wait; load quick" +bind "F10" "quit" +bind "F11" "zoom_in" +bind "F12" "screenshot" +bind "INS" "+klook" +bind "DEL" "+lookdown" +bind "PGDN" "+lookup" +bind "END" "centerview" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+offhandattack" +bind "MOUSE3" "+mlook" +bind "MWHEELDOWN" "impulse 12" +bind "PAUSE" "pause" +_cl_color "84" +_cl_name "vee" +_snd_mixahead "0.1" +bgm_extmusic "1" +bgmvolume "0" +cfg_unbindall "1" +cl_alwaysrun "1" +cl_backspeed "200" +cl_forwardspeed "400" +cl_maxpitch "90" +cl_minpitch "-90" +cl_movespeedkey "0.5" +contrast "1" +crosshair "1" +external_ents "1" +fov_adapt "1" +gamma "0.5" +gl_farclip "16384" +gl_flashblend "0" +gl_fullbrights "1" +gl_overbright "1" +gl_overbright_models "1" +gl_subdivide_size "128" +gl_texture_anisotropy "1" +gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" +gl_triplebuffer "1" +host_maxfps "72" +joy_deadzone "0.175" +joy_deadzone_trigger "0.2" +joy_enable "1" +joy_exponent "3" +joy_exponent_move "3" +joy_invert "0" +joy_sensitivity_pitch "150" +joy_sensitivity_yaw "300" +joy_swapmovelook "0" +lookspring "1" +lookstrafe "0" +m_forward "1" +m_pitch "0.022" +m_side "0.8" +m_yaw "0.022" +r_clearcolor "2" +r_dynamic "1" +r_lavaalpha "0.8" +r_novis "0" +r_oldwater "1" +r_particle_mult "1" +r_particles "1" +r_scale "1" +r_shadows "1" +r_slimealpha "0" +r_telealpha "0.9" +r_viewmodel_quake "0" +r_wateralpha "0.8" +saved1 "0" +saved2 "-288" +saved3 "270" +saved4 "0" +savedgamecfg "0" +scr_conalpha "0.5" +scr_conscale "1" +scr_conspeed "5000" +scr_conwidth "0" +scr_crosshairscale "1" +scr_menuscale "1.1" +scr_sbaralpha "0.75" +scr_sbarscale "1.1" +sensitivity "3.5" +sv_altnoclip "1" +sys_throttle "0.02" +vid_borderless "0" +vid_bpp "24" +vid_desktopfullscreen "0" +vid_fsaa "0" +vid_fullscreen "0" +vid_height "600" +vid_refreshrate "144" +vid_vsync "0" +vid_width "800" +viewsize "100" +volume "0.8" +vr_2h_angle_threshold "0.65" +vr_2h_disable_angle_threshold "0" +vr_2h_mode "2" +vr_2h_spread_reduction "0.5" +vr_2h_throw_velocity_mult "1.4" +vr_2h_virtual_stock_factor "0.5" +vr_activestartpaknameidx "1" +vr_aimmode "6" +vr_ammobox_drops "0" +vr_ammobox_drops_chance_mult "1" +vr_autosave_on_changelevel "1" +vr_autosave_seconds "240" +vr_autosave_show_message "0" +vr_body_interactions "0" +vr_crosshair "0" +vr_crosshair_alpha "0.85" +vr_crosshair_depth "0" +vr_crosshair_size "1" +vr_crosshairy "0" +vr_deadzone "25" +vr_debug_print_handvel "0" +vr_debug_print_headvel "0" +vr_debug_show_hand_pos_and_rot "0" +vr_enable_joystick_turn "1" +vr_enemy_drops "0" +vr_enemy_drops_chance_mult "1" +vr_finger_auto_close_thumb "1" +vr_finger_base_x "0" +vr_finger_base_y "0.0" +vr_finger_base_z "0.0" +vr_finger_blending "1" +vr_finger_blending_speed "50" +vr_finger_grip_bias "0" +vr_finger_index_x "-0.325" +vr_finger_index_y "0.6125" +vr_finger_index_z "-1.825" +vr_finger_middle_x "-0.3625" +vr_finger_middle_y "0.5125" +vr_finger_middle_z "-0.3125" +vr_finger_pinky_x "-0.325" +vr_finger_pinky_y "1.15" +vr_finger_pinky_z "1.6375" +vr_finger_ring_x "-0.3625" +vr_finger_ring_y "0.7" +vr_finger_ring_z "0.65" +vr_finger_thumb_x "-0.3625" +vr_finger_thumb_y "3.2625" +vr_finger_thumb_z "-1.9375" +vr_fingers_and_base_offhand_x "0" +vr_fingers_and_base_offhand_y "0" +vr_fingers_and_base_offhand_z "0.0" +vr_fingers_and_base_x "1.925" +vr_fingers_and_base_y "-2.825" +vr_fingers_and_base_z "-2.075" +vr_fingers_x "-5.05" +vr_fingers_y "-0.1" +vr_fingers_z "-0.1875" +vr_floor_offset "-21" +vr_forcegrab_eligible_haptics "1" +vr_forcegrab_eligible_particles "1" +vr_forcegrab_mode "1" +vr_forcegrab_powermult "1.0" +vr_forcegrab_radius "18" +vr_forcegrab_range "150.0" +vr_forcegrabbable_ammo_boxes "1" +vr_forcegrabbable_health_boxes "1" +vr_forcegrabbable_return_time_deathmatch "4" +vr_forcegrabbable_return_time_singleplayer "0" +vr_gun_z_offset "-1" +vr_gunangle "39.5" +vr_gunmodelpitch "7" +vr_gunmodelscale "0.7" +vr_gunmodely "1.3" +vr_gunyaw "4" +vr_headbutt_damage_mult "32" +vr_headbutt_velocity_threshold "2.02" +vr_height_calibration "1.57799" +vr_hip_holster_thresh "6.5" +vr_hip_offset_x "-3.5" +vr_hip_offset_y "7.0" +vr_hip_offset_z "0" +vr_holster_haptics "2" +vr_holster_mode "0" +vr_hud_scale "0.025" +vr_leg_holster_model_enabled "1" +vr_leg_holster_model_scale "0.5" +vr_leg_holster_model_x_offset "1" +vr_leg_holster_model_y_offset "1.25" +vr_leg_holster_model_z_offset "2.25" +vr_melee_bloodlust "0" +vr_melee_bloodlust_mult "1.0" +vr_melee_dmg_multiplier "1.0" +vr_melee_range_multiplier "1.0" +vr_melee_threshold "7" +vr_menu_distance "80" +vr_menu_scale "0.15" +vr_menumode "0" +vr_movement_mode "1" +vr_msaa "9" +vr_offhandpitch "40.25" +vr_offhandyaw "-4" +vr_player_shadows "2" +vr_positional_damage "1" +vr_roomscale_jump "1" +vr_roomscale_jump_threshold "0.8" +vr_roomscale_move_mult "1" +vr_sbar_mode "1" +vr_sbar_offset_pitch "1" +vr_sbar_offset_roll "-0.3" +vr_sbar_offset_x "-12" +vr_sbar_offset_y "1" +vr_sbar_offset_yaw "1.6" +vr_sbar_offset_z "-3" +vr_shoulder_holster_offset_x "-0.5" +vr_shoulder_holster_offset_y "2.25" +vr_shoulder_holster_offset_z "-0.25" +vr_shoulder_holster_thresh "7.8" +vr_shoulder_offset_x "-1" +vr_shoulder_offset_y "1.75" +vr_shoulder_offset_z "16" +vr_show_hip_holsters "0" +vr_show_shoulder_holsters "0" +vr_show_upper_holsters "0" +vr_show_virtual_stock "0" +vr_snap_turn "0" +vr_teleport_enabled "0" +vr_teleport_range "400" +vr_throw_up_center_of_mass "0.065" +vr_turn_speed "3.25" +vr_upper_holster_offset_x "-4.25" +vr_upper_holster_offset_y "7" +vr_upper_holster_offset_z "8.5" +vr_upper_holster_thresh "6.5" +vr_verbosebots "0" +vr_virtual_stock_thresh "10" +vr_vrtorso_debuglines_enabled "0" +vr_vrtorso_enabled "1" +vr_vrtorso_head_z_mult "33" +vr_vrtorso_pitch "1.5" +vr_vrtorso_roll "0" +vr_vrtorso_x_offset "-2.75" +vr_vrtorso_x_scale "0.675" +vr_vrtorso_y_offset "-4.75" +vr_vrtorso_y_scale "0.675" +vr_vrtorso_yaw "0" +vr_vrtorso_z_offset "-45" +vr_vrtorso_z_scale "1.1" +vr_weapon_cycle_mode "0" +vr_weapon_throw_damage_mult "1.0" +vr_weapon_throw_mode "0" +vr_weapon_throw_velocity_mult "1.0" +vr_weapondrop_particles "1" +vr_wofs_2h_dispmd_01 "0.0" +vr_wofs_2h_dispmd_02 "1" +vr_wofs_2h_dispmd_03 "1" +vr_wofs_2h_dispmd_04 "1" +vr_wofs_2h_dispmd_05 "1" +vr_wofs_2h_dispmd_06 "1" +vr_wofs_2h_dispmd_07 "1" +vr_wofs_2h_dispmd_08 "1" +vr_wofs_2h_dispmd_09 "0" +vr_wofs_2h_dispmd_10 "1" +vr_wofs_2h_dispmd_11 "1" +vr_wofs_2h_dispmd_12 "1" +vr_wofs_2h_dispmd_13 "1" +vr_wofs_2h_dispmd_14 "1" +vr_wofs_2h_dispmd_15 "1" +vr_wofs_2h_dispmd_16 "1" +vr_wofs_2h_dispmd_17 "0.0" +vr_wofs_2h_dispmd_18 "0.0" +vr_wofs_2h_dispmd_19 "0.0" +vr_wofs_2h_dispmd_20 "0.0" +vr_wofs_2h_dispmd_21 "0.0" +vr_wofs_2h_dispmd_22 "0.0" +vr_wofs_2h_dispmd_23 "0.0" +vr_wofs_2h_dispmd_24 "0.0" +vr_wofs_2h_dispmd_25 "0.0" +vr_wofs_2h_dispmd_26 "0.0" +vr_wofs_2h_dispmd_27 "0.0" +vr_wofs_2h_dispmd_28 "0.0" +vr_wofs_2h_dispmd_29 "0.0" +vr_wofs_2h_dispmd_30 "0.0" +vr_wofs_2h_dispmd_31 "0.0" +vr_wofs_2h_dispmd_32 "0.0" +vr_wofs_2h_fxd_hp_01 "0.0" +vr_wofs_2h_fxd_hp_02 "0.0" +vr_wofs_2h_fxd_hp_03 "0.0" +vr_wofs_2h_fxd_hp_04 "0.0" +vr_wofs_2h_fxd_hp_05 "0.0" +vr_wofs_2h_fxd_hp_06 "0.0" +vr_wofs_2h_fxd_hp_07 "0.0" +vr_wofs_2h_fxd_hp_08 "0.0" +vr_wofs_2h_fxd_hp_09 "0.0" +vr_wofs_2h_fxd_hp_10 "0.0" +vr_wofs_2h_fxd_hp_11 "0.0" +vr_wofs_2h_fxd_hp_12 "0.0" +vr_wofs_2h_fxd_hp_13 "0.0" +vr_wofs_2h_fxd_hp_14 "0.0" +vr_wofs_2h_fxd_hp_15 "0.0" +vr_wofs_2h_fxd_hp_16 "0.0" +vr_wofs_2h_fxd_hp_17 "0.0" +vr_wofs_2h_fxd_hp_18 "0.0" +vr_wofs_2h_fxd_hp_19 "0.0" +vr_wofs_2h_fxd_hp_20 "0.0" +vr_wofs_2h_fxd_hp_21 "0.0" +vr_wofs_2h_fxd_hp_22 "0.0" +vr_wofs_2h_fxd_hp_23 "0.0" +vr_wofs_2h_fxd_hp_24 "0.0" +vr_wofs_2h_fxd_hp_25 "0.0" +vr_wofs_2h_fxd_hp_26 "0.0" +vr_wofs_2h_fxd_hp_27 "0.0" +vr_wofs_2h_fxd_hp_28 "0.0" +vr_wofs_2h_fxd_hp_29 "0.0" +vr_wofs_2h_fxd_hp_30 "0.0" +vr_wofs_2h_fxd_hp_31 "0.0" +vr_wofs_2h_fxd_hp_32 "0.0" +vr_wofs_2h_fxd_hr_01 "0.0" +vr_wofs_2h_fxd_hr_02 "-84.599884" +vr_wofs_2h_fxd_hr_03 "-71.399948" +vr_wofs_2h_fxd_hr_04 "-86.399879" +vr_wofs_2h_fxd_hr_05 "21.600008" +vr_wofs_2h_fxd_hr_06 "-78.599899" +vr_wofs_2h_fxd_hr_07 "-82.999886" +vr_wofs_2h_fxd_hr_08 "-90.400024" +vr_wofs_2h_fxd_hr_09 "0.0" +vr_wofs_2h_fxd_hr_10 "75.799942" +vr_wofs_2h_fxd_hr_11 "-78.599899" +vr_wofs_2h_fxd_hr_12 "-76.799904" +vr_wofs_2h_fxd_hr_13 "21.600008" +vr_wofs_2h_fxd_hr_14 "-78.599899" +vr_wofs_2h_fxd_hr_15 "-82.999886" +vr_wofs_2h_fxd_hr_16 "-90.400024" +vr_wofs_2h_fxd_hr_17 "0.0" +vr_wofs_2h_fxd_hr_18 "0.0" +vr_wofs_2h_fxd_hr_19 "0.0" +vr_wofs_2h_fxd_hr_20 "0.0" +vr_wofs_2h_fxd_hr_21 "0.0" +vr_wofs_2h_fxd_hr_22 "0.0" +vr_wofs_2h_fxd_hr_23 "0.0" +vr_wofs_2h_fxd_hr_24 "0.0" +vr_wofs_2h_fxd_hr_25 "0.0" +vr_wofs_2h_fxd_hr_26 "0.0" +vr_wofs_2h_fxd_hr_27 "0.0" +vr_wofs_2h_fxd_hr_28 "0.0" +vr_wofs_2h_fxd_hr_29 "0.0" +vr_wofs_2h_fxd_hr_30 "0.0" +vr_wofs_2h_fxd_hr_31 "0.0" +vr_wofs_2h_fxd_hr_32 "0.0" +vr_wofs_2h_fxd_hy_01 "0.0" +vr_wofs_2h_fxd_hy_02 "-17.400005" +vr_wofs_2h_fxd_hy_03 "-21.600008" +vr_wofs_2h_fxd_hy_04 "-26.400011" +vr_wofs_2h_fxd_hy_05 "0" +vr_wofs_2h_fxd_hy_06 "-29.000013" +vr_wofs_2h_fxd_hy_07 "-24.200008" +vr_wofs_2h_fxd_hy_08 "-32.650013" +vr_wofs_2h_fxd_hy_09 "0.0" +vr_wofs_2h_fxd_hy_10 "0.0" +vr_wofs_2h_fxd_hy_11 "-29.000013" +vr_wofs_2h_fxd_hy_12 "-26.400011" +vr_wofs_2h_fxd_hy_13 "0.0" +vr_wofs_2h_fxd_hy_14 "-29.000013" +vr_wofs_2h_fxd_hy_15 "-24.20001" +vr_wofs_2h_fxd_hy_16 "-32.650013" +vr_wofs_2h_fxd_hy_17 "0.0" +vr_wofs_2h_fxd_hy_18 "0.0" +vr_wofs_2h_fxd_hy_19 "0.0" +vr_wofs_2h_fxd_hy_20 "0.0" +vr_wofs_2h_fxd_hy_21 "0.0" +vr_wofs_2h_fxd_hy_22 "0.0" +vr_wofs_2h_fxd_hy_23 "0.0" +vr_wofs_2h_fxd_hy_24 "0.0" +vr_wofs_2h_fxd_hy_25 "0.0" +vr_wofs_2h_fxd_hy_26 "0.0" +vr_wofs_2h_fxd_hy_27 "0.0" +vr_wofs_2h_fxd_hy_28 "0.0" +vr_wofs_2h_fxd_hy_29 "0.0" +vr_wofs_2h_fxd_hy_30 "0.0" +vr_wofs_2h_fxd_hy_31 "0.0" +vr_wofs_2h_fxd_hy_32 "0.0" +vr_wofs_2h_fxd_mh_ox_01 "0.0" +vr_wofs_2h_fxd_mh_ox_02 "0.0" +vr_wofs_2h_fxd_mh_ox_03 "0" +vr_wofs_2h_fxd_mh_ox_04 "0" +vr_wofs_2h_fxd_mh_ox_05 "0" +vr_wofs_2h_fxd_mh_ox_06 "0.0" +vr_wofs_2h_fxd_mh_ox_07 "0.0" +vr_wofs_2h_fxd_mh_ox_08 "0.0" +vr_wofs_2h_fxd_mh_ox_09 "0.0" +vr_wofs_2h_fxd_mh_ox_10 "0.0" +vr_wofs_2h_fxd_mh_ox_11 "0.0" +vr_wofs_2h_fxd_mh_ox_12 "0" +vr_wofs_2h_fxd_mh_ox_13 "0" +vr_wofs_2h_fxd_mh_ox_14 "0.0" +vr_wofs_2h_fxd_mh_ox_15 "0.0" +vr_wofs_2h_fxd_mh_ox_16 "0.0" +vr_wofs_2h_fxd_mh_ox_17 "0" +vr_wofs_2h_fxd_mh_ox_18 "0.0" +vr_wofs_2h_fxd_mh_ox_19 "0.0" +vr_wofs_2h_fxd_mh_ox_20 "0.0" +vr_wofs_2h_fxd_mh_ox_21 "0.0" +vr_wofs_2h_fxd_mh_ox_22 "0.0" +vr_wofs_2h_fxd_mh_ox_23 "0.0" +vr_wofs_2h_fxd_mh_ox_24 "0.0" +vr_wofs_2h_fxd_mh_ox_25 "0.0" +vr_wofs_2h_fxd_mh_ox_26 "0.0" +vr_wofs_2h_fxd_mh_ox_27 "0.0" +vr_wofs_2h_fxd_mh_ox_28 "0.0" +vr_wofs_2h_fxd_mh_ox_29 "0.0" +vr_wofs_2h_fxd_mh_ox_30 "0.0" +vr_wofs_2h_fxd_mh_ox_31 "0.0" +vr_wofs_2h_fxd_mh_ox_32 "0.0" +vr_wofs_2h_fxd_mh_oy_01 "0.0" +vr_wofs_2h_fxd_mh_oy_02 "0" +vr_wofs_2h_fxd_mh_oy_03 "5.4" +vr_wofs_2h_fxd_mh_oy_04 "3.9" +vr_wofs_2h_fxd_mh_oy_05 "1.9" +vr_wofs_2h_fxd_mh_oy_06 "6.6" +vr_wofs_2h_fxd_mh_oy_07 "5.95" +vr_wofs_2h_fxd_mh_oy_08 "3.8" +vr_wofs_2h_fxd_mh_oy_09 "0.0" +vr_wofs_2h_fxd_mh_oy_10 "-4.4" +vr_wofs_2h_fxd_mh_oy_11 "6.6" +vr_wofs_2h_fxd_mh_oy_12 "3.9" +vr_wofs_2h_fxd_mh_oy_13 "1.9" +vr_wofs_2h_fxd_mh_oy_14 "6.6" +vr_wofs_2h_fxd_mh_oy_15 "5.95" +vr_wofs_2h_fxd_mh_oy_16 "3.8" +vr_wofs_2h_fxd_mh_oy_17 "0" +vr_wofs_2h_fxd_mh_oy_18 "0.0" +vr_wofs_2h_fxd_mh_oy_19 "0.0" +vr_wofs_2h_fxd_mh_oy_20 "0.0" +vr_wofs_2h_fxd_mh_oy_21 "0.0" +vr_wofs_2h_fxd_mh_oy_22 "0.0" +vr_wofs_2h_fxd_mh_oy_23 "0.0" +vr_wofs_2h_fxd_mh_oy_24 "0.0" +vr_wofs_2h_fxd_mh_oy_25 "0.0" +vr_wofs_2h_fxd_mh_oy_26 "0.0" +vr_wofs_2h_fxd_mh_oy_27 "0.0" +vr_wofs_2h_fxd_mh_oy_28 "0.0" +vr_wofs_2h_fxd_mh_oy_29 "0.0" +vr_wofs_2h_fxd_mh_oy_30 "0.0" +vr_wofs_2h_fxd_mh_oy_31 "0.0" +vr_wofs_2h_fxd_mh_oy_32 "0.0" +vr_wofs_2h_fxd_mh_oz_01 "0.0" +vr_wofs_2h_fxd_mh_oz_02 "0.0" +vr_wofs_2h_fxd_mh_oz_03 "0.0" +vr_wofs_2h_fxd_mh_oz_04 "0.0" +vr_wofs_2h_fxd_mh_oz_05 "0.0" +vr_wofs_2h_fxd_mh_oz_06 "0.0" +vr_wofs_2h_fxd_mh_oz_07 "0.0" +vr_wofs_2h_fxd_mh_oz_08 "0.0" +vr_wofs_2h_fxd_mh_oz_09 "0.0" +vr_wofs_2h_fxd_mh_oz_10 "0.0" +vr_wofs_2h_fxd_mh_oz_11 "0.0" +vr_wofs_2h_fxd_mh_oz_12 "0.0" +vr_wofs_2h_fxd_mh_oz_13 "0.0" +vr_wofs_2h_fxd_mh_oz_14 "0" +vr_wofs_2h_fxd_mh_oz_15 "0.0" +vr_wofs_2h_fxd_mh_oz_16 "0.0" +vr_wofs_2h_fxd_mh_oz_17 "0" +vr_wofs_2h_fxd_mh_oz_18 "0.0" +vr_wofs_2h_fxd_mh_oz_19 "0.0" +vr_wofs_2h_fxd_mh_oz_20 "0.0" +vr_wofs_2h_fxd_mh_oz_21 "0.0" +vr_wofs_2h_fxd_mh_oz_22 "0.0" +vr_wofs_2h_fxd_mh_oz_23 "0.0" +vr_wofs_2h_fxd_mh_oz_24 "0.0" +vr_wofs_2h_fxd_mh_oz_25 "0.0" +vr_wofs_2h_fxd_mh_oz_26 "0.0" +vr_wofs_2h_fxd_mh_oz_27 "0.0" +vr_wofs_2h_fxd_mh_oz_28 "0.0" +vr_wofs_2h_fxd_mh_oz_29 "0.0" +vr_wofs_2h_fxd_mh_oz_30 "0.0" +vr_wofs_2h_fxd_mh_oz_31 "0.0" +vr_wofs_2h_fxd_mh_oz_32 "0.0" +vr_wofs_2h_fxd_ox_01 "0.0" +vr_wofs_2h_fxd_ox_02 "0" +vr_wofs_2h_fxd_ox_03 "0" +vr_wofs_2h_fxd_ox_04 "1.8" +vr_wofs_2h_fxd_ox_05 "2" +vr_wofs_2h_fxd_ox_06 "0.6" +vr_wofs_2h_fxd_ox_07 "3" +vr_wofs_2h_fxd_ox_08 "0.8" +vr_wofs_2h_fxd_ox_09 "0.0" +vr_wofs_2h_fxd_ox_10 "-1.7" +vr_wofs_2h_fxd_ox_11 "0.6" +vr_wofs_2h_fxd_ox_12 "1.8" +vr_wofs_2h_fxd_ox_13 "2" +vr_wofs_2h_fxd_ox_14 "0.6" +vr_wofs_2h_fxd_ox_15 "3" +vr_wofs_2h_fxd_ox_16 "0.8" +vr_wofs_2h_fxd_ox_17 "0.0" +vr_wofs_2h_fxd_ox_18 "0.0" +vr_wofs_2h_fxd_ox_19 "0.0" +vr_wofs_2h_fxd_ox_20 "0.0" +vr_wofs_2h_fxd_ox_21 "0.0" +vr_wofs_2h_fxd_ox_22 "0.0" +vr_wofs_2h_fxd_ox_23 "0.0" +vr_wofs_2h_fxd_ox_24 "0.0" +vr_wofs_2h_fxd_ox_25 "0.0" +vr_wofs_2h_fxd_ox_26 "0.0" +vr_wofs_2h_fxd_ox_27 "0.0" +vr_wofs_2h_fxd_ox_28 "0.0" +vr_wofs_2h_fxd_ox_29 "0.0" +vr_wofs_2h_fxd_ox_30 "0.0" +vr_wofs_2h_fxd_ox_31 "0.0" +vr_wofs_2h_fxd_ox_32 "0.0" +vr_wofs_2h_fxd_oy_01 "0.0" +vr_wofs_2h_fxd_oy_02 "-0.7" +vr_wofs_2h_fxd_oy_03 "0.6" +vr_wofs_2h_fxd_oy_04 "0.2" +vr_wofs_2h_fxd_oy_05 "0.9" +vr_wofs_2h_fxd_oy_06 "-2.9" +vr_wofs_2h_fxd_oy_07 "1.1" +vr_wofs_2h_fxd_oy_08 "0.9" +vr_wofs_2h_fxd_oy_09 "0.0" +vr_wofs_2h_fxd_oy_10 "4.3" +vr_wofs_2h_fxd_oy_11 "-2.9" +vr_wofs_2h_fxd_oy_12 "0.0" +vr_wofs_2h_fxd_oy_13 "0.9" +vr_wofs_2h_fxd_oy_14 "-2.9" +vr_wofs_2h_fxd_oy_15 "1.1" +vr_wofs_2h_fxd_oy_16 "0.9" +vr_wofs_2h_fxd_oy_17 "0.0" +vr_wofs_2h_fxd_oy_18 "0.0" +vr_wofs_2h_fxd_oy_19 "0.0" +vr_wofs_2h_fxd_oy_20 "0.0" +vr_wofs_2h_fxd_oy_21 "0.0" +vr_wofs_2h_fxd_oy_22 "0.0" +vr_wofs_2h_fxd_oy_23 "0.0" +vr_wofs_2h_fxd_oy_24 "0.0" +vr_wofs_2h_fxd_oy_25 "0.0" +vr_wofs_2h_fxd_oy_26 "0.0" +vr_wofs_2h_fxd_oy_27 "0.0" +vr_wofs_2h_fxd_oy_28 "0.0" +vr_wofs_2h_fxd_oy_29 "0.0" +vr_wofs_2h_fxd_oy_30 "0.0" +vr_wofs_2h_fxd_oy_31 "0.0" +vr_wofs_2h_fxd_oy_32 "0.0" +vr_wofs_2h_fxd_oz_01 "0.0" +vr_wofs_2h_fxd_oz_02 "0.7" +vr_wofs_2h_fxd_oz_03 "0" +vr_wofs_2h_fxd_oz_04 "0.2" +vr_wofs_2h_fxd_oz_05 "1.6" +vr_wofs_2h_fxd_oz_06 "-0.2" +vr_wofs_2h_fxd_oz_07 "-1" +vr_wofs_2h_fxd_oz_08 "-0.4" +vr_wofs_2h_fxd_oz_09 "0.0" +vr_wofs_2h_fxd_oz_10 "10.000004" +vr_wofs_2h_fxd_oz_11 "-0.2" +vr_wofs_2h_fxd_oz_12 "0.2" +vr_wofs_2h_fxd_oz_13 "1.6" +vr_wofs_2h_fxd_oz_14 "-0.2" +vr_wofs_2h_fxd_oz_15 "-1" +vr_wofs_2h_fxd_oz_16 "-0.4" +vr_wofs_2h_fxd_oz_17 "0" +vr_wofs_2h_fxd_oz_18 "0.0" +vr_wofs_2h_fxd_oz_19 "0.0" +vr_wofs_2h_fxd_oz_20 "0.0" +vr_wofs_2h_fxd_oz_21 "0.0" +vr_wofs_2h_fxd_oz_22 "0.0" +vr_wofs_2h_fxd_oz_23 "0.0" +vr_wofs_2h_fxd_oz_24 "0.0" +vr_wofs_2h_fxd_oz_25 "0.0" +vr_wofs_2h_fxd_oz_26 "0.0" +vr_wofs_2h_fxd_oz_27 "0.0" +vr_wofs_2h_fxd_oz_28 "0.0" +vr_wofs_2h_fxd_oz_29 "0.0" +vr_wofs_2h_fxd_oz_30 "0.0" +vr_wofs_2h_fxd_oz_31 "0.0" +vr_wofs_2h_fxd_oz_32 "0.0" +vr_wofs_2h_hand_av_01 "0" +vr_wofs_2h_hand_av_02 "48" +vr_wofs_2h_hand_av_03 "29" +vr_wofs_2h_hand_av_04 "51" +vr_wofs_2h_hand_av_05 "94" +vr_wofs_2h_hand_av_06 "15" +vr_wofs_2h_hand_av_07 "3" +vr_wofs_2h_hand_av_08 "230" +vr_wofs_2h_hand_av_09 "3" +vr_wofs_2h_hand_av_10 "4" +vr_wofs_2h_hand_av_11 "15" +vr_wofs_2h_hand_av_12 "51" +vr_wofs_2h_hand_av_13 "94" +vr_wofs_2h_hand_av_14 "15" +vr_wofs_2h_hand_av_15 "3" +vr_wofs_2h_hand_av_16 "203" +vr_wofs_2h_hand_av_17 "0.0" +vr_wofs_2h_hand_av_18 "0" +vr_wofs_2h_hand_av_19 "0.0" +vr_wofs_2h_hand_av_20 "0.0" +vr_wofs_2h_hand_av_21 "0.0" +vr_wofs_2h_hand_av_22 "0.0" +vr_wofs_2h_hand_av_23 "0.0" +vr_wofs_2h_hand_av_24 "0.0" +vr_wofs_2h_hand_av_25 "0.0" +vr_wofs_2h_hand_av_26 "0.0" +vr_wofs_2h_hand_av_27 "0.0" +vr_wofs_2h_hand_av_28 "0.0" +vr_wofs_2h_hand_av_29 "0.0" +vr_wofs_2h_hand_av_30 "0.0" +vr_wofs_2h_hand_av_31 "0.0" +vr_wofs_2h_hand_av_32 "0.0" +vr_wofs_2h_mode_01 "2" +vr_wofs_2h_mode_02 "0" +vr_wofs_2h_mode_03 "0.0" +vr_wofs_2h_mode_04 "0.0" +vr_wofs_2h_mode_05 "0.0" +vr_wofs_2h_mode_06 "0.0" +vr_wofs_2h_mode_07 "0.0" +vr_wofs_2h_mode_08 "0.0" +vr_wofs_2h_mode_09 "2" +vr_wofs_2h_mode_10 "1" +vr_wofs_2h_mode_11 "0.0" +vr_wofs_2h_mode_12 "0.0" +vr_wofs_2h_mode_13 "0.0" +vr_wofs_2h_mode_14 "0.0" +vr_wofs_2h_mode_15 "0.0" +vr_wofs_2h_mode_16 "0.0" +vr_wofs_2h_mode_17 "2" +vr_wofs_2h_mode_18 "2" +vr_wofs_2h_mode_19 "0.0" +vr_wofs_2h_mode_20 "0.0" +vr_wofs_2h_mode_21 "0.0" +vr_wofs_2h_mode_22 "0.0" +vr_wofs_2h_mode_23 "0.0" +vr_wofs_2h_mode_24 "0.0" +vr_wofs_2h_mode_25 "0.0" +vr_wofs_2h_mode_26 "0.0" +vr_wofs_2h_mode_27 "0.0" +vr_wofs_2h_mode_28 "0.0" +vr_wofs_2h_mode_29 "0.0" +vr_wofs_2h_mode_30 "0.0" +vr_wofs_2h_mode_31 "0.0" +vr_wofs_2h_mode_32 "0.0" +vr_wofs_2h_pitch_01 "0.0" +vr_wofs_2h_pitch_02 "0" +vr_wofs_2h_pitch_03 "0.0" +vr_wofs_2h_pitch_04 "0.0" +vr_wofs_2h_pitch_05 "0.0" +vr_wofs_2h_pitch_06 "0.0" +vr_wofs_2h_pitch_07 "4.8" +vr_wofs_2h_pitch_08 "0.0" +vr_wofs_2h_pitch_09 "0.0" +vr_wofs_2h_pitch_10 "0" +vr_wofs_2h_pitch_11 "0.0" +vr_wofs_2h_pitch_12 "0.0" +vr_wofs_2h_pitch_13 "0.0" +vr_wofs_2h_pitch_14 "0.0" +vr_wofs_2h_pitch_15 "4.8" +vr_wofs_2h_pitch_16 "0.0" +vr_wofs_2h_pitch_17 "0.0" +vr_wofs_2h_pitch_18 "0.0" +vr_wofs_2h_pitch_19 "0.0" +vr_wofs_2h_pitch_20 "0.0" +vr_wofs_2h_pitch_21 "0.0" +vr_wofs_2h_pitch_22 "0.0" +vr_wofs_2h_pitch_23 "0.0" +vr_wofs_2h_pitch_24 "0.0" +vr_wofs_2h_pitch_25 "0.0" +vr_wofs_2h_pitch_26 "0.0" +vr_wofs_2h_pitch_27 "0.0" +vr_wofs_2h_pitch_28 "0.0" +vr_wofs_2h_pitch_29 "0.0" +vr_wofs_2h_pitch_30 "0.0" +vr_wofs_2h_pitch_31 "0.0" +vr_wofs_2h_pitch_32 "0.0" +vr_wofs_2h_roll_01 "0.0" +vr_wofs_2h_roll_02 "0.0" +vr_wofs_2h_roll_03 "0.0" +vr_wofs_2h_roll_04 "0.0" +vr_wofs_2h_roll_05 "0.0" +vr_wofs_2h_roll_06 "0.0" +vr_wofs_2h_roll_07 "0.0" +vr_wofs_2h_roll_08 "0.0" +vr_wofs_2h_roll_09 "0.0" +vr_wofs_2h_roll_10 "0.0" +vr_wofs_2h_roll_11 "0.0" +vr_wofs_2h_roll_12 "0.0" +vr_wofs_2h_roll_13 "0.0" +vr_wofs_2h_roll_14 "0.0" +vr_wofs_2h_roll_15 "0.0" +vr_wofs_2h_roll_16 "0.0" +vr_wofs_2h_roll_17 "0.0" +vr_wofs_2h_roll_18 "0.0" +vr_wofs_2h_roll_19 "0.0" +vr_wofs_2h_roll_20 "0.0" +vr_wofs_2h_roll_21 "0.0" +vr_wofs_2h_roll_22 "0.0" +vr_wofs_2h_roll_23 "0.0" +vr_wofs_2h_roll_24 "0.0" +vr_wofs_2h_roll_25 "0.0" +vr_wofs_2h_roll_26 "0.0" +vr_wofs_2h_roll_27 "0.0" +vr_wofs_2h_roll_28 "0.0" +vr_wofs_2h_roll_29 "0.0" +vr_wofs_2h_roll_30 "0.0" +vr_wofs_2h_roll_31 "0.0" +vr_wofs_2h_roll_32 "0.0" +vr_wofs_2h_x_01 "0.0" +vr_wofs_2h_x_02 "0" +vr_wofs_2h_x_03 "0.0" +vr_wofs_2h_x_04 "0" +vr_wofs_2h_x_05 "0.8" +vr_wofs_2h_x_06 "0.0" +vr_wofs_2h_x_07 "0.0" +vr_wofs_2h_x_08 "0" +vr_wofs_2h_x_09 "0.0" +vr_wofs_2h_x_10 "0.000001" +vr_wofs_2h_x_11 "0.0" +vr_wofs_2h_x_12 "0" +vr_wofs_2h_x_13 "0.8" +vr_wofs_2h_x_14 "0.0" +vr_wofs_2h_x_15 "0.0" +vr_wofs_2h_x_16 "0" +vr_wofs_2h_x_17 "0.0" +vr_wofs_2h_x_18 "0.0" +vr_wofs_2h_x_19 "0.0" +vr_wofs_2h_x_20 "0.0" +vr_wofs_2h_x_21 "0.0" +vr_wofs_2h_x_22 "0.0" +vr_wofs_2h_x_23 "0.0" +vr_wofs_2h_x_24 "0.0" +vr_wofs_2h_x_25 "0.0" +vr_wofs_2h_x_26 "0.0" +vr_wofs_2h_x_27 "0.0" +vr_wofs_2h_x_28 "0.0" +vr_wofs_2h_x_29 "0.0" +vr_wofs_2h_x_30 "0.0" +vr_wofs_2h_x_31 "0.0" +vr_wofs_2h_x_32 "0.0" +vr_wofs_2h_y_01 "0.0" +vr_wofs_2h_y_02 "0" +vr_wofs_2h_y_03 "0.0" +vr_wofs_2h_y_04 "0.0" +vr_wofs_2h_y_05 "1.8" +vr_wofs_2h_y_06 "0.0" +vr_wofs_2h_y_07 "0.0" +vr_wofs_2h_y_08 "0.0" +vr_wofs_2h_y_09 "0.0" +vr_wofs_2h_y_10 "-1.6" +vr_wofs_2h_y_11 "0.0" +vr_wofs_2h_y_12 "0.0" +vr_wofs_2h_y_13 "1.8" +vr_wofs_2h_y_14 "0.0" +vr_wofs_2h_y_15 "0.0" +vr_wofs_2h_y_16 "0.0" +vr_wofs_2h_y_17 "0.0" +vr_wofs_2h_y_18 "0.0" +vr_wofs_2h_y_19 "0.0" +vr_wofs_2h_y_20 "0.0" +vr_wofs_2h_y_21 "0.0" +vr_wofs_2h_y_22 "0.0" +vr_wofs_2h_y_23 "0.0" +vr_wofs_2h_y_24 "0.0" +vr_wofs_2h_y_25 "0.0" +vr_wofs_2h_y_26 "0.0" +vr_wofs_2h_y_27 "0.0" +vr_wofs_2h_y_28 "0.0" +vr_wofs_2h_y_29 "0.0" +vr_wofs_2h_y_30 "0.0" +vr_wofs_2h_y_31 "0.0" +vr_wofs_2h_y_32 "0.0" +vr_wofs_2h_yaw_01 "0.0" +vr_wofs_2h_yaw_02 "0.0" +vr_wofs_2h_yaw_03 "0.0" +vr_wofs_2h_yaw_04 "0.0" +vr_wofs_2h_yaw_05 "6" +vr_wofs_2h_yaw_06 "0.0" +vr_wofs_2h_yaw_07 "0" +vr_wofs_2h_yaw_08 "-9.399998" +vr_wofs_2h_yaw_09 "0.0" +vr_wofs_2h_yaw_10 "0" +vr_wofs_2h_yaw_11 "0.0" +vr_wofs_2h_yaw_12 "0.0" +vr_wofs_2h_yaw_13 "6" +vr_wofs_2h_yaw_14 "0.0" +vr_wofs_2h_yaw_15 "0" +vr_wofs_2h_yaw_16 "-9.399999" +vr_wofs_2h_yaw_17 "-0.000001" +vr_wofs_2h_yaw_18 "0.0" +vr_wofs_2h_yaw_19 "0.0" +vr_wofs_2h_yaw_20 "0.0" +vr_wofs_2h_yaw_21 "0.0" +vr_wofs_2h_yaw_22 "0.0" +vr_wofs_2h_yaw_23 "0.0" +vr_wofs_2h_yaw_24 "0.0" +vr_wofs_2h_yaw_25 "0.0" +vr_wofs_2h_yaw_26 "0.0" +vr_wofs_2h_yaw_27 "0.0" +vr_wofs_2h_yaw_28 "0.0" +vr_wofs_2h_yaw_29 "0.0" +vr_wofs_2h_yaw_30 "0.0" +vr_wofs_2h_yaw_31 "0.0" +vr_wofs_2h_yaw_32 "0.0" +vr_wofs_2h_z_01 "0.0" +vr_wofs_2h_z_02 "-1" +vr_wofs_2h_z_03 "0.0" +vr_wofs_2h_z_04 "0.0" +vr_wofs_2h_z_05 "-3.4" +vr_wofs_2h_z_06 "2" +vr_wofs_2h_z_07 "1.8" +vr_wofs_2h_z_08 "1" +vr_wofs_2h_z_09 "0.0" +vr_wofs_2h_z_10 "-1" +vr_wofs_2h_z_11 "2" +vr_wofs_2h_z_12 "0.0" +vr_wofs_2h_z_13 "-3.4" +vr_wofs_2h_z_14 "2" +vr_wofs_2h_z_15 "1.8" +vr_wofs_2h_z_16 "1" +vr_wofs_2h_z_17 "0.0" +vr_wofs_2h_z_18 "0.0" +vr_wofs_2h_z_19 "0.0" +vr_wofs_2h_z_20 "0.0" +vr_wofs_2h_z_21 "0.0" +vr_wofs_2h_z_22 "0.0" +vr_wofs_2h_z_23 "0.0" +vr_wofs_2h_z_24 "0.0" +vr_wofs_2h_z_25 "0.0" +vr_wofs_2h_z_26 "0.0" +vr_wofs_2h_z_27 "0.0" +vr_wofs_2h_z_28 "0.0" +vr_wofs_2h_z_29 "0.0" +vr_wofs_2h_z_30 "0.0" +vr_wofs_2h_z_31 "0.0" +vr_wofs_2h_z_32 "0.0" +vr_wofs_ch_mode_z_01 "1" +vr_wofs_ch_mode_z_02 "0.0" +vr_wofs_ch_mode_z_03 "0.0" +vr_wofs_ch_mode_z_04 "0.0" +vr_wofs_ch_mode_z_05 "0.0" +vr_wofs_ch_mode_z_06 "0.0" +vr_wofs_ch_mode_z_07 "0.0" +vr_wofs_ch_mode_z_08 "0.0" +vr_wofs_ch_mode_z_09 "1" +vr_wofs_ch_mode_z_10 "0.0" +vr_wofs_ch_mode_z_11 "0.0" +vr_wofs_ch_mode_z_12 "0.0" +vr_wofs_ch_mode_z_13 "0.0" +vr_wofs_ch_mode_z_14 "0.0" +vr_wofs_ch_mode_z_15 "0.0" +vr_wofs_ch_mode_z_16 "0.0" +vr_wofs_ch_mode_z_17 "1" +vr_wofs_ch_mode_z_18 "0.0" +vr_wofs_ch_mode_z_19 "0.0" +vr_wofs_ch_mode_z_20 "0.0" +vr_wofs_ch_mode_z_21 "0.0" +vr_wofs_ch_mode_z_22 "0.0" +vr_wofs_ch_mode_z_23 "0.0" +vr_wofs_ch_mode_z_24 "0.0" +vr_wofs_ch_mode_z_25 "0.0" +vr_wofs_ch_mode_z_26 "0.0" +vr_wofs_ch_mode_z_27 "0.0" +vr_wofs_ch_mode_z_28 "0.0" +vr_wofs_ch_mode_z_29 "0.0" +vr_wofs_ch_mode_z_30 "0.0" +vr_wofs_ch_mode_z_31 "0.0" +vr_wofs_ch_mode_z_32 "0.0" +vr_wofs_gunoff_x_01 "0.0" +vr_wofs_gunoff_x_02 "0.0" +vr_wofs_gunoff_x_03 "0.0" +vr_wofs_gunoff_x_04 "0.0" +vr_wofs_gunoff_x_05 "0.0" +vr_wofs_gunoff_x_06 "0.0" +vr_wofs_gunoff_x_07 "0.0" +vr_wofs_gunoff_x_08 "0.0" +vr_wofs_gunoff_x_09 "0.0" +vr_wofs_gunoff_x_10 "0.0" +vr_wofs_gunoff_x_11 "0.0" +vr_wofs_gunoff_x_12 "0.0" +vr_wofs_gunoff_x_13 "0.0" +vr_wofs_gunoff_x_14 "0.0" +vr_wofs_gunoff_x_15 "0.0" +vr_wofs_gunoff_x_16 "0.0" +vr_wofs_gunoff_x_17 "0.0" +vr_wofs_gunoff_x_18 "0.0" +vr_wofs_gunoff_x_19 "0.0" +vr_wofs_gunoff_x_20 "0.0" +vr_wofs_gunoff_x_21 "0.0" +vr_wofs_gunoff_x_22 "0.0" +vr_wofs_gunoff_x_23 "0.0" +vr_wofs_gunoff_x_24 "0.0" +vr_wofs_gunoff_x_25 "0.0" +vr_wofs_gunoff_x_26 "0.0" +vr_wofs_gunoff_x_27 "0.0" +vr_wofs_gunoff_x_28 "0.0" +vr_wofs_gunoff_x_29 "0.0" +vr_wofs_gunoff_x_30 "0.0" +vr_wofs_gunoff_x_31 "0.0" +vr_wofs_gunoff_x_32 "0.0" +vr_wofs_gunoff_y_01 "0.0" +vr_wofs_gunoff_y_02 "0.0" +vr_wofs_gunoff_y_03 "0.0" +vr_wofs_gunoff_y_04 "0.0" +vr_wofs_gunoff_y_05 "0.0" +vr_wofs_gunoff_y_06 "0.0" +vr_wofs_gunoff_y_07 "0.0" +vr_wofs_gunoff_y_08 "0.0" +vr_wofs_gunoff_y_09 "0.0" +vr_wofs_gunoff_y_10 "0.0" +vr_wofs_gunoff_y_11 "0.0" +vr_wofs_gunoff_y_12 "0.0" +vr_wofs_gunoff_y_13 "0.0" +vr_wofs_gunoff_y_14 "0.0" +vr_wofs_gunoff_y_15 "0.0" +vr_wofs_gunoff_y_16 "0.0" +vr_wofs_gunoff_y_17 "0.0" +vr_wofs_gunoff_y_18 "0.0" +vr_wofs_gunoff_y_19 "0.0" +vr_wofs_gunoff_y_20 "0.0" +vr_wofs_gunoff_y_21 "0.0" +vr_wofs_gunoff_y_22 "0.0" +vr_wofs_gunoff_y_23 "0.0" +vr_wofs_gunoff_y_24 "0.0" +vr_wofs_gunoff_y_25 "0.0" +vr_wofs_gunoff_y_26 "0.0" +vr_wofs_gunoff_y_27 "0.0" +vr_wofs_gunoff_y_28 "0.0" +vr_wofs_gunoff_y_29 "0.0" +vr_wofs_gunoff_y_30 "0.0" +vr_wofs_gunoff_y_31 "0.0" +vr_wofs_gunoff_y_32 "0.0" +vr_wofs_gunoff_z_01 "0" +vr_wofs_gunoff_z_02 "0.0" +vr_wofs_gunoff_z_03 "0.0" +vr_wofs_gunoff_z_04 "0.0" +vr_wofs_gunoff_z_05 "0.0" +vr_wofs_gunoff_z_06 "0.0" +vr_wofs_gunoff_z_07 "0.0" +vr_wofs_gunoff_z_08 "0.0" +vr_wofs_gunoff_z_09 "0.0" +vr_wofs_gunoff_z_10 "0.0" +vr_wofs_gunoff_z_11 "0.0" +vr_wofs_gunoff_z_12 "0.0" +vr_wofs_gunoff_z_13 "0.0" +vr_wofs_gunoff_z_14 "0.0" +vr_wofs_gunoff_z_15 "0.0" +vr_wofs_gunoff_z_16 "0.0" +vr_wofs_gunoff_z_17 "0.0" +vr_wofs_gunoff_z_18 "0.0" +vr_wofs_gunoff_z_19 "0.0" +vr_wofs_gunoff_z_20 "0.0" +vr_wofs_gunoff_z_21 "0.0" +vr_wofs_gunoff_z_22 "0.0" +vr_wofs_gunoff_z_23 "0.0" +vr_wofs_gunoff_z_24 "0.0" +vr_wofs_gunoff_z_25 "0.0" +vr_wofs_gunoff_z_26 "0.0" +vr_wofs_gunoff_z_27 "0.0" +vr_wofs_gunoff_z_28 "0.0" +vr_wofs_gunoff_z_29 "0.0" +vr_wofs_gunoff_z_30 "0.0" +vr_wofs_gunoff_z_31 "0.0" +vr_wofs_gunoff_z_32 "0.0" +vr_wofs_hand_av_01 "2" +vr_wofs_hand_av_02 "165" +vr_wofs_hand_av_03 "65" +vr_wofs_hand_av_04 "5" +vr_wofs_hand_av_05 "28" +vr_wofs_hand_av_06 "33" +vr_wofs_hand_av_07 "12" +vr_wofs_hand_av_08 "57" +vr_wofs_hand_av_09 "0.0" +vr_wofs_hand_av_10 "4" +vr_wofs_hand_av_11 "33" +vr_wofs_hand_av_12 "5" +vr_wofs_hand_av_13 "44" +vr_wofs_hand_av_14 "33" +vr_wofs_hand_av_15 "12" +vr_wofs_hand_av_16 "57" +vr_wofs_hand_av_17 "0" +vr_wofs_hand_av_18 "68" +vr_wofs_hand_av_19 "0.0" +vr_wofs_hand_av_20 "0.0" +vr_wofs_hand_av_21 "0.0" +vr_wofs_hand_av_22 "0.0" +vr_wofs_hand_av_23 "0.0" +vr_wofs_hand_av_24 "0.0" +vr_wofs_hand_av_25 "0.0" +vr_wofs_hand_av_26 "0.0" +vr_wofs_hand_av_27 "0.0" +vr_wofs_hand_av_28 "0.0" +vr_wofs_hand_av_29 "0.0" +vr_wofs_hand_av_30 "0.0" +vr_wofs_hand_av_31 "0.0" +vr_wofs_hand_av_32 "0.0" +vr_wofs_hand_x_01 "3.4" +vr_wofs_hand_x_02 "2.399994" +vr_wofs_hand_x_03 "-3.25" +vr_wofs_hand_x_04 "0.8" +vr_wofs_hand_x_05 "-0.8" +vr_wofs_hand_x_06 "0.4" +vr_wofs_hand_x_07 "2.100005" +vr_wofs_hand_x_08 "2.4" +vr_wofs_hand_x_09 "1.9" +vr_wofs_hand_x_10 "-16.200041" +vr_wofs_hand_x_11 "0.4" +vr_wofs_hand_x_12 "0.8" +vr_wofs_hand_x_13 "-0.8" +vr_wofs_hand_x_14 "0.4" +vr_wofs_hand_x_15 "2.100005" +vr_wofs_hand_x_16 "2.4" +vr_wofs_hand_x_17 "1.7" +vr_wofs_hand_x_18 "1.7" +vr_wofs_hand_x_19 "0.0" +vr_wofs_hand_x_20 "0.0" +vr_wofs_hand_x_21 "0.0" +vr_wofs_hand_x_22 "0.0" +vr_wofs_hand_x_23 "0.0" +vr_wofs_hand_x_24 "0.0" +vr_wofs_hand_x_25 "0.0" +vr_wofs_hand_x_26 "0.0" +vr_wofs_hand_x_27 "0.0" +vr_wofs_hand_x_28 "0.0" +vr_wofs_hand_x_29 "0.0" +vr_wofs_hand_x_30 "0.0" +vr_wofs_hand_x_31 "0.0" +vr_wofs_hand_x_32 "0.0" +vr_wofs_hand_y_01 "0" +vr_wofs_hand_y_02 "0.2" +vr_wofs_hand_y_03 "1.1" +vr_wofs_hand_y_04 "-1.299998" +vr_wofs_hand_y_05 "0.2" +vr_wofs_hand_y_06 "-1.5" +vr_wofs_hand_y_07 "-0.8" +vr_wofs_hand_y_08 "0.700002" +vr_wofs_hand_y_09 "0" +vr_wofs_hand_y_10 "1.9" +vr_wofs_hand_y_11 "-1.5" +vr_wofs_hand_y_12 "-1.299998" +vr_wofs_hand_y_13 "0.2" +vr_wofs_hand_y_14 "-1.5" +vr_wofs_hand_y_15 "-0.8" +vr_wofs_hand_y_16 "0.700002" +vr_wofs_hand_y_17 "-4.25" +vr_wofs_hand_y_18 "-0.2" +vr_wofs_hand_y_19 "0.0" +vr_wofs_hand_y_20 "0.0" +vr_wofs_hand_y_21 "0.0" +vr_wofs_hand_y_22 "0.0" +vr_wofs_hand_y_23 "0.0" +vr_wofs_hand_y_24 "0.0" +vr_wofs_hand_y_25 "0.0" +vr_wofs_hand_y_26 "0.0" +vr_wofs_hand_y_27 "0.0" +vr_wofs_hand_y_28 "0.0" +vr_wofs_hand_y_29 "0.0" +vr_wofs_hand_y_30 "0.0" +vr_wofs_hand_y_31 "0.0" +vr_wofs_hand_y_32 "0.0" +vr_wofs_hand_z_01 "3.6" +vr_wofs_hand_z_02 "0.7" +vr_wofs_hand_z_03 "1.25" +vr_wofs_hand_z_04 "0.1" +vr_wofs_hand_z_05 "2.6" +vr_wofs_hand_z_06 "2" +vr_wofs_hand_z_07 "1" +vr_wofs_hand_z_08 "-1.35" +vr_wofs_hand_z_09 "4.5" +vr_wofs_hand_z_10 "10.3" +vr_wofs_hand_z_11 "2" +vr_wofs_hand_z_12 "0.1" +vr_wofs_hand_z_13 "2.6" +vr_wofs_hand_z_14 "2" +vr_wofs_hand_z_15 "1" +vr_wofs_hand_z_16 "-1.35" +vr_wofs_hand_z_17 "2" +vr_wofs_hand_z_18 "1.1" +vr_wofs_hand_z_19 "0.0" +vr_wofs_hand_z_20 "0.0" +vr_wofs_hand_z_21 "0.0" +vr_wofs_hand_z_22 "0.0" +vr_wofs_hand_z_23 "0.0" +vr_wofs_hand_z_24 "0.0" +vr_wofs_hand_z_25 "0.0" +vr_wofs_hand_z_26 "0.0" +vr_wofs_hand_z_27 "0.0" +vr_wofs_hand_z_28 "0.0" +vr_wofs_hand_z_29 "0.0" +vr_wofs_hand_z_30 "0.0" +vr_wofs_hand_z_31 "0.0" +vr_wofs_hand_z_32 "0.0" +vr_wofs_hide_hand_01 "0.0" +vr_wofs_hide_hand_02 "0" +vr_wofs_hide_hand_03 "0.0" +vr_wofs_hide_hand_04 "0.0" +vr_wofs_hide_hand_05 "0.0" +vr_wofs_hide_hand_06 "0" +vr_wofs_hide_hand_07 "0.0" +vr_wofs_hide_hand_08 "0.0" +vr_wofs_hide_hand_09 "0.0" +vr_wofs_hide_hand_10 "0.0" +vr_wofs_hide_hand_11 "0.0" +vr_wofs_hide_hand_12 "0.0" +vr_wofs_hide_hand_13 "0.0" +vr_wofs_hide_hand_14 "0" +vr_wofs_hide_hand_15 "0.0" +vr_wofs_hide_hand_16 "0.0" +vr_wofs_hide_hand_17 "0" +vr_wofs_hide_hand_18 "0.0" +vr_wofs_hide_hand_19 "0.0" +vr_wofs_hide_hand_20 "0.0" +vr_wofs_hide_hand_21 "0.0" +vr_wofs_hide_hand_22 "0.0" +vr_wofs_hide_hand_23 "0.0" +vr_wofs_hide_hand_24 "0.0" +vr_wofs_hide_hand_25 "0.0" +vr_wofs_hide_hand_26 "0.0" +vr_wofs_hide_hand_27 "0.0" +vr_wofs_hide_hand_28 "0.0" +vr_wofs_hide_hand_29 "0.0" +vr_wofs_hide_hand_30 "0.0" +vr_wofs_hide_hand_31 "0.0" +vr_wofs_hide_hand_32 "0.0" +vr_wofs_id_01 "progs/v_axe.mdl" +vr_wofs_id_02 "progs/v_shot.mdl" +vr_wofs_id_03 "progs/v_shot2.mdl" +vr_wofs_id_04 "progs/v_nail.mdl" +vr_wofs_id_05 "progs/v_nail2.mdl" +vr_wofs_id_06 "progs/v_rock.mdl" +vr_wofs_id_07 "progs/v_rock2.mdl" +vr_wofs_id_08 "progs/v_light.mdl" +vr_wofs_id_09 "progs/v_hammer.mdl" +vr_wofs_id_10 "progs/v_laserg.mdl" +vr_wofs_id_11 "progs/v_prox.mdl" +vr_wofs_id_12 "progs/v_lava.mdl" +vr_wofs_id_13 "progs/v_lava2.mdl" +vr_wofs_id_14 "progs/v_multi.mdl" +vr_wofs_id_15 "progs/v_multi2.mdl" +vr_wofs_id_16 "progs/v_plasma.mdl" +vr_wofs_id_17 "progs/hand.mdl" +vr_wofs_id_18 "progs/v_grpple.mdl" +vr_wofs_id_19 "-1" +vr_wofs_id_20 "-1" +vr_wofs_id_21 "-1" +vr_wofs_id_22 "-1" +vr_wofs_id_23 "-1" +vr_wofs_id_24 "-1" +vr_wofs_id_25 "-1" +vr_wofs_id_26 "-1" +vr_wofs_id_27 "-1" +vr_wofs_id_28 "-1" +vr_wofs_id_29 "-1" +vr_wofs_id_30 "-1" +vr_wofs_id_31 "-1" +vr_wofs_id_32 "-1" +vr_wofs_length_01 "0.0" +vr_wofs_length_02 "0.0" +vr_wofs_length_03 "0.0" +vr_wofs_length_04 "0.0" +vr_wofs_length_05 "0.0" +vr_wofs_length_06 "0.0" +vr_wofs_length_07 "0.0" +vr_wofs_length_08 "0.0" +vr_wofs_length_09 "0.0" +vr_wofs_length_10 "0" +vr_wofs_length_11 "0.0" +vr_wofs_length_12 "0.0" +vr_wofs_length_13 "0.0" +vr_wofs_length_14 "0.0" +vr_wofs_length_15 "0.0" +vr_wofs_length_16 "0.0" +vr_wofs_length_17 "0.0" +vr_wofs_length_18 "0.0" +vr_wofs_length_19 "0.0" +vr_wofs_length_20 "0.0" +vr_wofs_length_21 "0.0" +vr_wofs_length_22 "0.0" +vr_wofs_length_23 "0.0" +vr_wofs_length_24 "0.0" +vr_wofs_length_25 "0.0" +vr_wofs_length_26 "0.0" +vr_wofs_length_27 "0.0" +vr_wofs_length_28 "0.0" +vr_wofs_length_29 "0.0" +vr_wofs_length_30 "0.0" +vr_wofs_length_31 "0.0" +vr_wofs_length_32 "0.0" +vr_wofs_muzzle_av_01 "41" +vr_wofs_muzzle_av_02 "1" +vr_wofs_muzzle_av_03 "13" +vr_wofs_muzzle_av_04 "33" +vr_wofs_muzzle_av_05 "129" +vr_wofs_muzzle_av_06 "0.0" +vr_wofs_muzzle_av_07 "17" +vr_wofs_muzzle_av_08 "104" +vr_wofs_muzzle_av_09 "36" +vr_wofs_muzzle_av_10 "22" +vr_wofs_muzzle_av_11 "0.0" +vr_wofs_muzzle_av_12 "33" +vr_wofs_muzzle_av_13 "128" +vr_wofs_muzzle_av_14 "0.0" +vr_wofs_muzzle_av_15 "17" +vr_wofs_muzzle_av_16 "104" +vr_wofs_muzzle_av_17 "0" +vr_wofs_muzzle_av_18 "90" +vr_wofs_muzzle_av_19 "0.0" +vr_wofs_muzzle_av_20 "0.0" +vr_wofs_muzzle_av_21 "0.0" +vr_wofs_muzzle_av_22 "0.0" +vr_wofs_muzzle_av_23 "0.0" +vr_wofs_muzzle_av_24 "0.0" +vr_wofs_muzzle_av_25 "0.0" +vr_wofs_muzzle_av_26 "0.0" +vr_wofs_muzzle_av_27 "0.0" +vr_wofs_muzzle_av_28 "0.0" +vr_wofs_muzzle_av_29 "0.0" +vr_wofs_muzzle_av_30 "0.0" +vr_wofs_muzzle_av_31 "0.0" +vr_wofs_muzzle_av_32 "0.0" +vr_wofs_muzzle_x_01 "-0.700006" +vr_wofs_muzzle_x_02 "0.899979" +vr_wofs_muzzle_x_03 "0.499997" +vr_wofs_muzzle_x_04 "-0.000004" +vr_wofs_muzzle_x_05 "-0.000009" +vr_wofs_muzzle_x_06 "0" +vr_wofs_muzzle_x_07 "-0.000006" +vr_wofs_muzzle_x_08 "-0.000005" +vr_wofs_muzzle_x_09 "0" +vr_wofs_muzzle_x_10 "3.000157" +vr_wofs_muzzle_x_11 "0" +vr_wofs_muzzle_x_12 "-0.000004" +vr_wofs_muzzle_x_13 "-0.000009" +vr_wofs_muzzle_x_14 "0" +vr_wofs_muzzle_x_15 "-0.000006" +vr_wofs_muzzle_x_16 "-0.000005" +vr_wofs_muzzle_x_17 "-0.000001" +vr_wofs_muzzle_x_18 "1.59998" +vr_wofs_muzzle_x_19 "0.0" +vr_wofs_muzzle_x_20 "0.0" +vr_wofs_muzzle_x_21 "0.0" +vr_wofs_muzzle_x_22 "0.0" +vr_wofs_muzzle_x_23 "0.0" +vr_wofs_muzzle_x_24 "0.0" +vr_wofs_muzzle_x_25 "0.0" +vr_wofs_muzzle_x_26 "0.0" +vr_wofs_muzzle_x_27 "0.0" +vr_wofs_muzzle_x_28 "0.0" +vr_wofs_muzzle_x_29 "0.0" +vr_wofs_muzzle_x_30 "0.0" +vr_wofs_muzzle_x_31 "0.0" +vr_wofs_muzzle_x_32 "0.0" +vr_wofs_muzzle_y_01 "0" +vr_wofs_muzzle_y_02 "0.35" +vr_wofs_muzzle_y_03 "0.35" +vr_wofs_muzzle_y_04 "0.85" +vr_wofs_muzzle_y_05 "0.499991" +vr_wofs_muzzle_y_06 "0" +vr_wofs_muzzle_y_07 "-0.000003" +vr_wofs_muzzle_y_08 "-0.000014" +vr_wofs_muzzle_y_09 "0.0" +vr_wofs_muzzle_y_10 "0.399987" +vr_wofs_muzzle_y_11 "0" +vr_wofs_muzzle_y_12 "0.85" +vr_wofs_muzzle_y_13 "0.499991" +vr_wofs_muzzle_y_14 "0" +vr_wofs_muzzle_y_15 "-0.000003" +vr_wofs_muzzle_y_16 "-0.000014" +vr_wofs_muzzle_y_17 "0" +vr_wofs_muzzle_y_18 "0.399997" +vr_wofs_muzzle_y_19 "0.0" +vr_wofs_muzzle_y_20 "0.0" +vr_wofs_muzzle_y_21 "0.0" +vr_wofs_muzzle_y_22 "0.0" +vr_wofs_muzzle_y_23 "0.0" +vr_wofs_muzzle_y_24 "0.0" +vr_wofs_muzzle_y_25 "0.0" +vr_wofs_muzzle_y_26 "0.0" +vr_wofs_muzzle_y_27 "0.0" +vr_wofs_muzzle_y_28 "0.0" +vr_wofs_muzzle_y_29 "0.0" +vr_wofs_muzzle_y_30 "0.0" +vr_wofs_muzzle_y_31 "0.0" +vr_wofs_muzzle_y_32 "0.0" +vr_wofs_muzzle_z_01 "-2.100002" +vr_wofs_muzzle_z_02 "0.6" +vr_wofs_muzzle_z_03 "-0.7" +vr_wofs_muzzle_z_04 "-0.9" +vr_wofs_muzzle_z_05 "-0.999995" +vr_wofs_muzzle_z_06 "0.000004" +vr_wofs_muzzle_z_07 "-1.299994" +vr_wofs_muzzle_z_08 "-0.500006" +vr_wofs_muzzle_z_09 "-2.60001" +vr_wofs_muzzle_z_10 "-1.500035" +vr_wofs_muzzle_z_11 "-0.000007" +vr_wofs_muzzle_z_12 "-0.9" +vr_wofs_muzzle_z_13 "-0.999995" +vr_wofs_muzzle_z_14 "0.000004" +vr_wofs_muzzle_z_15 "-1.299994" +vr_wofs_muzzle_z_16 "-0.500006" +vr_wofs_muzzle_z_17 "0.000003" +vr_wofs_muzzle_z_18 "1.2" +vr_wofs_muzzle_z_19 "0.0" +vr_wofs_muzzle_z_20 "0.0" +vr_wofs_muzzle_z_21 "0.0" +vr_wofs_muzzle_z_22 "0.0" +vr_wofs_muzzle_z_23 "0.0" +vr_wofs_muzzle_z_24 "0.0" +vr_wofs_muzzle_z_25 "0.0" +vr_wofs_muzzle_z_26 "0.0" +vr_wofs_muzzle_z_27 "0.0" +vr_wofs_muzzle_z_28 "0.0" +vr_wofs_muzzle_z_29 "0.0" +vr_wofs_muzzle_z_30 "0.0" +vr_wofs_muzzle_z_31 "0.0" +vr_wofs_muzzle_z_32 "0.0" +vr_wofs_pitch_01 "0" +vr_wofs_pitch_02 "-6" +vr_wofs_pitch_03 "-8" +vr_wofs_pitch_04 "-5" +vr_wofs_pitch_05 "-6.5" +vr_wofs_pitch_06 "-8.5" +vr_wofs_pitch_07 "-4.5" +vr_wofs_pitch_08 "-7" +vr_wofs_pitch_09 "-8" +vr_wofs_pitch_10 "-5.5" +vr_wofs_pitch_11 "-8.5" +vr_wofs_pitch_12 "-5" +vr_wofs_pitch_13 "-6.5" +vr_wofs_pitch_14 "-8.5" +vr_wofs_pitch_15 "-4.5" +vr_wofs_pitch_16 "-7" +vr_wofs_pitch_17 "-8.500001" +vr_wofs_pitch_18 "-4.8" +vr_wofs_pitch_19 "0.0" +vr_wofs_pitch_20 "0.0" +vr_wofs_pitch_21 "0.0" +vr_wofs_pitch_22 "0.0" +vr_wofs_pitch_23 "0.0" +vr_wofs_pitch_24 "0.0" +vr_wofs_pitch_25 "0.0" +vr_wofs_pitch_26 "0.0" +vr_wofs_pitch_27 "0.0" +vr_wofs_pitch_28 "0.0" +vr_wofs_pitch_29 "0.0" +vr_wofs_pitch_30 "0.0" +vr_wofs_pitch_31 "0.0" +vr_wofs_pitch_32 "0.0" +vr_wofs_roll_01 "0" +vr_wofs_roll_02 "0" +vr_wofs_roll_03 "0.0" +vr_wofs_roll_04 "0.0" +vr_wofs_roll_05 "0.0" +vr_wofs_roll_06 "0.0" +vr_wofs_roll_07 "0.0" +vr_wofs_roll_08 "0.0" +vr_wofs_roll_09 "0" +vr_wofs_roll_10 "0.0" +vr_wofs_roll_11 "0.0" +vr_wofs_roll_12 "0.0" +vr_wofs_roll_13 "0.0" +vr_wofs_roll_14 "0.0" +vr_wofs_roll_15 "0.0" +vr_wofs_roll_16 "0.0" +vr_wofs_roll_17 "-0.000002" +vr_wofs_roll_18 "0" +vr_wofs_roll_19 "0.0" +vr_wofs_roll_20 "0.0" +vr_wofs_roll_21 "0.0" +vr_wofs_roll_22 "0.0" +vr_wofs_roll_23 "0.0" +vr_wofs_roll_24 "0.0" +vr_wofs_roll_25 "0.0" +vr_wofs_roll_26 "0.0" +vr_wofs_roll_27 "0.0" +vr_wofs_roll_28 "0.0" +vr_wofs_roll_29 "0.0" +vr_wofs_roll_30 "0.0" +vr_wofs_roll_31 "0.0" +vr_wofs_roll_32 "0.0" +vr_wofs_scale_01 "0.34" +vr_wofs_scale_02 "0.44" +vr_wofs_scale_03 "0.48" +vr_wofs_scale_04 "0.48" +vr_wofs_scale_05 "0.38" +vr_wofs_scale_06 "0.38" +vr_wofs_scale_07 "0.34" +vr_wofs_scale_08 "0.35" +vr_wofs_scale_09 "0.34" +vr_wofs_scale_10 "0.34" +vr_wofs_scale_11 "0.38" +vr_wofs_scale_12 "0.48" +vr_wofs_scale_13 "0.38" +vr_wofs_scale_14 "0.38" +vr_wofs_scale_15 "0.34" +vr_wofs_scale_16 "0.35" +vr_wofs_scale_17 "0.34" +vr_wofs_scale_18 "0.33" +vr_wofs_scale_19 "0.5" +vr_wofs_scale_20 "0.5" +vr_wofs_scale_21 "0.5" +vr_wofs_scale_22 "0.5" +vr_wofs_scale_23 "0.5" +vr_wofs_scale_24 "0.5" +vr_wofs_scale_25 "0.5" +vr_wofs_scale_26 "0.5" +vr_wofs_scale_27 "0.5" +vr_wofs_scale_28 "0.5" +vr_wofs_scale_29 "0.5" +vr_wofs_scale_30 "0.5" +vr_wofs_scale_31 "0.5" +vr_wofs_scale_32 "0.5" +vr_wofs_w_2hdirmult_01 "1.0" +vr_wofs_w_2hdirmult_02 "1.0" +vr_wofs_w_2hdirmult_03 "1.0" +vr_wofs_w_2hdirmult_04 "1.0" +vr_wofs_w_2hdirmult_05 "1.0" +vr_wofs_w_2hdirmult_06 "1.0" +vr_wofs_w_2hdirmult_07 "1.0" +vr_wofs_w_2hdirmult_08 "1.0" +vr_wofs_w_2hdirmult_09 "1.0" +vr_wofs_w_2hdirmult_10 "1.0" +vr_wofs_w_2hdirmult_11 "1.0" +vr_wofs_w_2hdirmult_12 "1.0" +vr_wofs_w_2hdirmult_13 "1.0" +vr_wofs_w_2hdirmult_14 "1.0" +vr_wofs_w_2hdirmult_15 "1.0" +vr_wofs_w_2hdirmult_16 "1.0" +vr_wofs_w_2hdirmult_17 "1.0" +vr_wofs_w_2hdirmult_18 "1.0" +vr_wofs_w_2hdirmult_19 "1.0" +vr_wofs_w_2hdirmult_20 "1.0" +vr_wofs_w_2hdirmult_21 "1.0" +vr_wofs_w_2hdirmult_22 "1.0" +vr_wofs_w_2hdirmult_23 "1.0" +vr_wofs_w_2hdirmult_24 "1.0" +vr_wofs_w_2hdirmult_25 "1.0" +vr_wofs_w_2hdirmult_26 "1.0" +vr_wofs_w_2hdirmult_27 "1.0" +vr_wofs_w_2hdirmult_28 "1.0" +vr_wofs_w_2hdirmult_29 "1.0" +vr_wofs_w_2hdirmult_30 "1.0" +vr_wofs_w_2hdirmult_31 "1.0" +vr_wofs_w_2hdirmult_32 "1.0" +vr_wofs_w_2hposmult_01 "1.0" +vr_wofs_w_2hposmult_02 "1.0" +vr_wofs_w_2hposmult_03 "1.0" +vr_wofs_w_2hposmult_04 "1.0" +vr_wofs_w_2hposmult_05 "1.0" +vr_wofs_w_2hposmult_06 "1.0" +vr_wofs_w_2hposmult_07 "1.0" +vr_wofs_w_2hposmult_08 "1.0" +vr_wofs_w_2hposmult_09 "1.0" +vr_wofs_w_2hposmult_10 "1" +vr_wofs_w_2hposmult_11 "1.0" +vr_wofs_w_2hposmult_12 "1.0" +vr_wofs_w_2hposmult_13 "1.0" +vr_wofs_w_2hposmult_14 "1.0" +vr_wofs_w_2hposmult_15 "1.0" +vr_wofs_w_2hposmult_16 "1.0" +vr_wofs_w_2hposmult_17 "1.0" +vr_wofs_w_2hposmult_18 "1.0" +vr_wofs_w_2hposmult_19 "1.0" +vr_wofs_w_2hposmult_20 "1.0" +vr_wofs_w_2hposmult_21 "1.0" +vr_wofs_w_2hposmult_22 "1.0" +vr_wofs_w_2hposmult_23 "1.0" +vr_wofs_w_2hposmult_24 "1.0" +vr_wofs_w_2hposmult_25 "1.0" +vr_wofs_w_2hposmult_26 "1.0" +vr_wofs_w_2hposmult_27 "1.0" +vr_wofs_w_2hposmult_28 "1.0" +vr_wofs_w_2hposmult_29 "1.0" +vr_wofs_w_2hposmult_30 "1.0" +vr_wofs_w_2hposmult_31 "1.0" +vr_wofs_w_2hposmult_32 "1.0" +vr_wofs_w_dirmult_01 "1.0" +vr_wofs_w_dirmult_02 "1.0" +vr_wofs_w_dirmult_03 "1.0" +vr_wofs_w_dirmult_04 "1.0" +vr_wofs_w_dirmult_05 "0.73" +vr_wofs_w_dirmult_06 "0.95" +vr_wofs_w_dirmult_07 "1.0" +vr_wofs_w_dirmult_08 "1.0" +vr_wofs_w_dirmult_09 "1.0" +vr_wofs_w_dirmult_10 "0.4" +vr_wofs_w_dirmult_11 "0.95" +vr_wofs_w_dirmult_12 "1.0" +vr_wofs_w_dirmult_13 "0.73" +vr_wofs_w_dirmult_14 "0.95" +vr_wofs_w_dirmult_15 "1.0" +vr_wofs_w_dirmult_16 "1.0" +vr_wofs_w_dirmult_17 "1.0" +vr_wofs_w_dirmult_18 "1.0" +vr_wofs_w_dirmult_19 "1.0" +vr_wofs_w_dirmult_20 "1.0" +vr_wofs_w_dirmult_21 "1.0" +vr_wofs_w_dirmult_22 "1.0" +vr_wofs_w_dirmult_23 "1.0" +vr_wofs_w_dirmult_24 "1.0" +vr_wofs_w_dirmult_25 "1.0" +vr_wofs_w_dirmult_26 "1.0" +vr_wofs_w_dirmult_27 "1.0" +vr_wofs_w_dirmult_28 "1.0" +vr_wofs_w_dirmult_29 "1.0" +vr_wofs_w_dirmult_30 "1.0" +vr_wofs_w_dirmult_31 "1.0" +vr_wofs_w_dirmult_32 "1.0" +vr_wofs_w_htvelmult_01 "1" +vr_wofs_w_htvelmult_02 "1.0" +vr_wofs_w_htvelmult_03 "1.0" +vr_wofs_w_htvelmult_04 "1.0" +vr_wofs_w_htvelmult_05 "0.9" +vr_wofs_w_htvelmult_06 "0.95" +vr_wofs_w_htvelmult_07 "1.0" +vr_wofs_w_htvelmult_08 "1.0" +vr_wofs_w_htvelmult_09 "1.0" +vr_wofs_w_htvelmult_10 "1.0" +vr_wofs_w_htvelmult_11 "1.0" +vr_wofs_w_htvelmult_12 "1.0" +vr_wofs_w_htvelmult_13 "0.9" +vr_wofs_w_htvelmult_14 "0.95" +vr_wofs_w_htvelmult_15 "1.0" +vr_wofs_w_htvelmult_16 "1.0" +vr_wofs_w_htvelmult_17 "1.0" +vr_wofs_w_htvelmult_18 "1.0" +vr_wofs_w_htvelmult_19 "1.0" +vr_wofs_w_htvelmult_20 "1.0" +vr_wofs_w_htvelmult_21 "1.0" +vr_wofs_w_htvelmult_22 "1.0" +vr_wofs_w_htvelmult_23 "1.0" +vr_wofs_w_htvelmult_24 "1.0" +vr_wofs_w_htvelmult_25 "1.0" +vr_wofs_w_htvelmult_26 "1.0" +vr_wofs_w_htvelmult_27 "1.0" +vr_wofs_w_htvelmult_28 "1.0" +vr_wofs_w_htvelmult_29 "1.0" +vr_wofs_w_htvelmult_30 "1.0" +vr_wofs_w_htvelmult_31 "1.0" +vr_wofs_w_htvelmult_32 "1.0" +vr_wofs_w_hvelmult_01 "1.02" +vr_wofs_w_hvelmult_02 "1.0" +vr_wofs_w_hvelmult_03 "1.0" +vr_wofs_w_hvelmult_04 "1.0" +vr_wofs_w_hvelmult_05 "0.95" +vr_wofs_w_hvelmult_06 "0.95" +vr_wofs_w_hvelmult_07 "1.0" +vr_wofs_w_hvelmult_08 "1.0" +vr_wofs_w_hvelmult_09 "1.0" +vr_wofs_w_hvelmult_10 "1.0" +vr_wofs_w_hvelmult_11 "0.95" +vr_wofs_w_hvelmult_12 "1.0" +vr_wofs_w_hvelmult_13 "0.95" +vr_wofs_w_hvelmult_14 "0.95" +vr_wofs_w_hvelmult_15 "1.0" +vr_wofs_w_hvelmult_16 "1.0" +vr_wofs_w_hvelmult_17 "1.0" +vr_wofs_w_hvelmult_18 "1.0" +vr_wofs_w_hvelmult_19 "1.0" +vr_wofs_w_hvelmult_20 "1.0" +vr_wofs_w_hvelmult_21 "1.0" +vr_wofs_w_hvelmult_22 "1.0" +vr_wofs_w_hvelmult_23 "1.0" +vr_wofs_w_hvelmult_24 "1.0" +vr_wofs_w_hvelmult_25 "1.0" +vr_wofs_w_hvelmult_26 "1.0" +vr_wofs_w_hvelmult_27 "1.0" +vr_wofs_w_hvelmult_28 "1.0" +vr_wofs_w_hvelmult_29 "1.0" +vr_wofs_w_hvelmult_30 "1.0" +vr_wofs_w_hvelmult_31 "1.0" +vr_wofs_w_hvelmult_32 "1.0" +vr_wofs_w_posmult_01 "1.0" +vr_wofs_w_posmult_02 "1.0" +vr_wofs_w_posmult_03 "1.0" +vr_wofs_w_posmult_04 "1.0" +vr_wofs_w_posmult_05 "0.73" +vr_wofs_w_posmult_06 "0.95" +vr_wofs_w_posmult_07 "1.0" +vr_wofs_w_posmult_08 "1.0" +vr_wofs_w_posmult_09 "1.0" +vr_wofs_w_posmult_10 "0.95" +vr_wofs_w_posmult_11 "0.95" +vr_wofs_w_posmult_12 "1.0" +vr_wofs_w_posmult_13 "0.73" +vr_wofs_w_posmult_14 "0.95" +vr_wofs_w_posmult_15 "1.0" +vr_wofs_w_posmult_16 "1.0" +vr_wofs_w_posmult_17 "1.0" +vr_wofs_w_posmult_18 "1.0" +vr_wofs_w_posmult_19 "1.0" +vr_wofs_w_posmult_20 "1.0" +vr_wofs_w_posmult_21 "1.0" +vr_wofs_w_posmult_22 "1.0" +vr_wofs_w_posmult_23 "1.0" +vr_wofs_w_posmult_24 "1.0" +vr_wofs_w_posmult_25 "1.0" +vr_wofs_w_posmult_26 "1.0" +vr_wofs_w_posmult_27 "1.0" +vr_wofs_w_posmult_28 "1.0" +vr_wofs_w_posmult_29 "1.0" +vr_wofs_w_posmult_30 "1.0" +vr_wofs_w_posmult_31 "1.0" +vr_wofs_w_posmult_32 "1.0" +vr_wofs_weight_01 "0.6" +vr_wofs_weight_02 "0.65" +vr_wofs_weight_03 "0.7" +vr_wofs_weight_04 "0.65" +vr_wofs_weight_05 "0.76" +vr_wofs_weight_06 "0.82" +vr_wofs_weight_07 "0.9" +vr_wofs_weight_08 "0.8" +vr_wofs_weight_09 "0.78" +vr_wofs_weight_10 "0.96" +vr_wofs_weight_11 "0.82" +vr_wofs_weight_12 "0.65" +vr_wofs_weight_13 "0.76" +vr_wofs_weight_14 "0.82" +vr_wofs_weight_15 "0.9" +vr_wofs_weight_16 "0.8" +vr_wofs_weight_17 "0" +vr_wofs_weight_18 "0.4" +vr_wofs_weight_19 "0.0" +vr_wofs_weight_20 "0.0" +vr_wofs_weight_21 "0.0" +vr_wofs_weight_22 "0.0" +vr_wofs_weight_23 "0.0" +vr_wofs_weight_24 "0.0" +vr_wofs_weight_25 "0.0" +vr_wofs_weight_26 "0.0" +vr_wofs_weight_27 "0.0" +vr_wofs_weight_28 "0.0" +vr_wofs_weight_29 "0.0" +vr_wofs_weight_30 "0.0" +vr_wofs_weight_31 "0.0" +vr_wofs_weight_32 "0.0" +vr_wofs_wpnbtn_av_01 "0" +vr_wofs_wpnbtn_av_02 "0" +vr_wofs_wpnbtn_av_03 "0.0" +vr_wofs_wpnbtn_av_04 "97" +vr_wofs_wpnbtn_av_05 "28" +vr_wofs_wpnbtn_av_06 "33" +vr_wofs_wpnbtn_av_07 "12" +vr_wofs_wpnbtn_av_08 "57" +vr_wofs_wpnbtn_av_09 "0.0" +vr_wofs_wpnbtn_av_10 "0.0" +vr_wofs_wpnbtn_av_11 "0.0" +vr_wofs_wpnbtn_av_12 "97" +vr_wofs_wpnbtn_av_13 "44" +vr_wofs_wpnbtn_av_14 "33" +vr_wofs_wpnbtn_av_15 "12" +vr_wofs_wpnbtn_av_16 "57" +vr_wofs_wpnbtn_av_17 "0.0" +vr_wofs_wpnbtn_av_18 "0.0" +vr_wofs_wpnbtn_av_19 "0.0" +vr_wofs_wpnbtn_av_20 "0.0" +vr_wofs_wpnbtn_av_21 "0.0" +vr_wofs_wpnbtn_av_22 "0.0" +vr_wofs_wpnbtn_av_23 "0.0" +vr_wofs_wpnbtn_av_24 "0.0" +vr_wofs_wpnbtn_av_25 "0.0" +vr_wofs_wpnbtn_av_26 "0.0" +vr_wofs_wpnbtn_av_27 "0.0" +vr_wofs_wpnbtn_av_28 "0.0" +vr_wofs_wpnbtn_av_29 "0.0" +vr_wofs_wpnbtn_av_30 "0.0" +vr_wofs_wpnbtn_av_31 "0.0" +vr_wofs_wpnbtn_av_32 "0.0" +vr_wofs_wpnbtn_pitch_01 "0.0" +vr_wofs_wpnbtn_pitch_02 "0.0" +vr_wofs_wpnbtn_pitch_03 "0.0" +vr_wofs_wpnbtn_pitch_04 "0.0" +vr_wofs_wpnbtn_pitch_05 "0.0" +vr_wofs_wpnbtn_pitch_06 "0.0" +vr_wofs_wpnbtn_pitch_07 "0.0" +vr_wofs_wpnbtn_pitch_08 "0.0" +vr_wofs_wpnbtn_pitch_09 "0.0" +vr_wofs_wpnbtn_pitch_10 "0.0" +vr_wofs_wpnbtn_pitch_11 "0.0" +vr_wofs_wpnbtn_pitch_12 "0.0" +vr_wofs_wpnbtn_pitch_13 "0.0" +vr_wofs_wpnbtn_pitch_14 "0.0" +vr_wofs_wpnbtn_pitch_15 "0.0" +vr_wofs_wpnbtn_pitch_16 "0.0" +vr_wofs_wpnbtn_pitch_17 "0.0" +vr_wofs_wpnbtn_pitch_18 "0.0" +vr_wofs_wpnbtn_pitch_19 "0.0" +vr_wofs_wpnbtn_pitch_20 "0.0" +vr_wofs_wpnbtn_pitch_21 "0.0" +vr_wofs_wpnbtn_pitch_22 "0.0" +vr_wofs_wpnbtn_pitch_23 "0.0" +vr_wofs_wpnbtn_pitch_24 "0.0" +vr_wofs_wpnbtn_pitch_25 "0.0" +vr_wofs_wpnbtn_pitch_26 "0.0" +vr_wofs_wpnbtn_pitch_27 "0.0" +vr_wofs_wpnbtn_pitch_28 "0.0" +vr_wofs_wpnbtn_pitch_29 "0.0" +vr_wofs_wpnbtn_pitch_30 "0.0" +vr_wofs_wpnbtn_pitch_31 "0.0" +vr_wofs_wpnbtn_pitch_32 "0.0" +vr_wofs_wpnbtn_roll_01 "0.0" +vr_wofs_wpnbtn_roll_02 "0.0" +vr_wofs_wpnbtn_roll_03 "0.0" +vr_wofs_wpnbtn_roll_04 "0.0" +vr_wofs_wpnbtn_roll_05 "-65.399933" +vr_wofs_wpnbtn_roll_06 "56.999977" +vr_wofs_wpnbtn_roll_07 "32.400013" +vr_wofs_wpnbtn_roll_08 "0.0" +vr_wofs_wpnbtn_roll_09 "0.0" +vr_wofs_wpnbtn_roll_10 "0.0" +vr_wofs_wpnbtn_roll_11 "0.0" +vr_wofs_wpnbtn_roll_12 "0.0" +vr_wofs_wpnbtn_roll_13 "-65.399933" +vr_wofs_wpnbtn_roll_14 "56.999962" +vr_wofs_wpnbtn_roll_15 "32.400013" +vr_wofs_wpnbtn_roll_16 "0.0" +vr_wofs_wpnbtn_roll_17 "0.0" +vr_wofs_wpnbtn_roll_18 "0.0" +vr_wofs_wpnbtn_roll_19 "0.0" +vr_wofs_wpnbtn_roll_20 "0.0" +vr_wofs_wpnbtn_roll_21 "0.0" +vr_wofs_wpnbtn_roll_22 "0.0" +vr_wofs_wpnbtn_roll_23 "0.0" +vr_wofs_wpnbtn_roll_24 "0.0" +vr_wofs_wpnbtn_roll_25 "0.0" +vr_wofs_wpnbtn_roll_26 "0.0" +vr_wofs_wpnbtn_roll_27 "0.0" +vr_wofs_wpnbtn_roll_28 "0.0" +vr_wofs_wpnbtn_roll_29 "0.0" +vr_wofs_wpnbtn_roll_30 "0.0" +vr_wofs_wpnbtn_roll_31 "0.0" +vr_wofs_wpnbtn_roll_32 "0.0" +vr_wofs_wpnbtn_x_01 "0.0" +vr_wofs_wpnbtn_x_02 "-7.9" +vr_wofs_wpnbtn_x_03 "0.0" +vr_wofs_wpnbtn_x_04 "1.6" +vr_wofs_wpnbtn_x_05 "-1.6" +vr_wofs_wpnbtn_x_06 "-0.2" +vr_wofs_wpnbtn_x_07 "1.8" +vr_wofs_wpnbtn_x_08 "5.4" +vr_wofs_wpnbtn_x_09 "0.0" +vr_wofs_wpnbtn_x_10 "0.0" +vr_wofs_wpnbtn_x_11 "0.0" +vr_wofs_wpnbtn_x_12 "1.6" +vr_wofs_wpnbtn_x_13 "-1.6" +vr_wofs_wpnbtn_x_14 "-0.2" +vr_wofs_wpnbtn_x_15 "1.8" +vr_wofs_wpnbtn_x_16 "5.4" +vr_wofs_wpnbtn_x_17 "0.0" +vr_wofs_wpnbtn_x_18 "0.0" +vr_wofs_wpnbtn_x_19 "0.0" +vr_wofs_wpnbtn_x_20 "0.0" +vr_wofs_wpnbtn_x_21 "0.0" +vr_wofs_wpnbtn_x_22 "0.0" +vr_wofs_wpnbtn_x_23 "0.0" +vr_wofs_wpnbtn_x_24 "0.0" +vr_wofs_wpnbtn_x_25 "0.0" +vr_wofs_wpnbtn_x_26 "0.0" +vr_wofs_wpnbtn_x_27 "0.0" +vr_wofs_wpnbtn_x_28 "0.0" +vr_wofs_wpnbtn_x_29 "0.0" +vr_wofs_wpnbtn_x_30 "0.0" +vr_wofs_wpnbtn_x_31 "0.0" +vr_wofs_wpnbtn_x_32 "0.0" +vr_wofs_wpnbtn_y_01 "0.0" +vr_wofs_wpnbtn_y_02 "-2.0" +vr_wofs_wpnbtn_y_03 "0.0" +vr_wofs_wpnbtn_y_04 "-0.45" +vr_wofs_wpnbtn_y_05 "1.500001" +vr_wofs_wpnbtn_y_06 "-2.9" +vr_wofs_wpnbtn_y_07 "-1.5" +vr_wofs_wpnbtn_y_08 "-0.7" +vr_wofs_wpnbtn_y_09 "0.0" +vr_wofs_wpnbtn_y_10 "0.0" +vr_wofs_wpnbtn_y_11 "0.0" +vr_wofs_wpnbtn_y_12 "-0.45" +vr_wofs_wpnbtn_y_13 "1.500001" +vr_wofs_wpnbtn_y_14 "-2.9" +vr_wofs_wpnbtn_y_15 "-1.5" +vr_wofs_wpnbtn_y_16 "-0.7" +vr_wofs_wpnbtn_y_17 "0.0" +vr_wofs_wpnbtn_y_18 "0.0" +vr_wofs_wpnbtn_y_19 "0.0" +vr_wofs_wpnbtn_y_20 "0.0" +vr_wofs_wpnbtn_y_21 "0.0" +vr_wofs_wpnbtn_y_22 "0.0" +vr_wofs_wpnbtn_y_23 "0.0" +vr_wofs_wpnbtn_y_24 "0.0" +vr_wofs_wpnbtn_y_25 "0.0" +vr_wofs_wpnbtn_y_26 "0.0" +vr_wofs_wpnbtn_y_27 "0.0" +vr_wofs_wpnbtn_y_28 "0.0" +vr_wofs_wpnbtn_y_29 "0.0" +vr_wofs_wpnbtn_y_30 "0.0" +vr_wofs_wpnbtn_y_31 "0.0" +vr_wofs_wpnbtn_y_32 "0.0" +vr_wofs_wpnbtn_yaw_01 "0.0" +vr_wofs_wpnbtn_yaw_02 "0.0" +vr_wofs_wpnbtn_yaw_03 "0.0" +vr_wofs_wpnbtn_yaw_04 "0.0" +vr_wofs_wpnbtn_yaw_05 "0.0" +vr_wofs_wpnbtn_yaw_06 "0.0" +vr_wofs_wpnbtn_yaw_07 "0.0" +vr_wofs_wpnbtn_yaw_08 "0.0" +vr_wofs_wpnbtn_yaw_09 "0.0" +vr_wofs_wpnbtn_yaw_10 "0.0" +vr_wofs_wpnbtn_yaw_11 "0.0" +vr_wofs_wpnbtn_yaw_12 "0.0" +vr_wofs_wpnbtn_yaw_13 "0.0" +vr_wofs_wpnbtn_yaw_14 "0.0" +vr_wofs_wpnbtn_yaw_15 "0.0" +vr_wofs_wpnbtn_yaw_16 "0.0" +vr_wofs_wpnbtn_yaw_17 "0.0" +vr_wofs_wpnbtn_yaw_18 "0.0" +vr_wofs_wpnbtn_yaw_19 "0.0" +vr_wofs_wpnbtn_yaw_20 "0.0" +vr_wofs_wpnbtn_yaw_21 "0.0" +vr_wofs_wpnbtn_yaw_22 "0.0" +vr_wofs_wpnbtn_yaw_23 "0.0" +vr_wofs_wpnbtn_yaw_24 "0.0" +vr_wofs_wpnbtn_yaw_25 "0.0" +vr_wofs_wpnbtn_yaw_26 "0.0" +vr_wofs_wpnbtn_yaw_27 "0.0" +vr_wofs_wpnbtn_yaw_28 "0.0" +vr_wofs_wpnbtn_yaw_29 "0.0" +vr_wofs_wpnbtn_yaw_30 "0.0" +vr_wofs_wpnbtn_yaw_31 "0.0" +vr_wofs_wpnbtn_yaw_32 "0.0" +vr_wofs_wpnbtn_z_01 "0.0" +vr_wofs_wpnbtn_z_02 "1" +vr_wofs_wpnbtn_z_03 "0.0" +vr_wofs_wpnbtn_z_04 "-0.2" +vr_wofs_wpnbtn_z_05 "3" +vr_wofs_wpnbtn_z_06 "1.8" +vr_wofs_wpnbtn_z_07 "1.3" +vr_wofs_wpnbtn_z_08 "-1" +vr_wofs_wpnbtn_z_09 "0.0" +vr_wofs_wpnbtn_z_10 "0.0" +vr_wofs_wpnbtn_z_11 "0.0" +vr_wofs_wpnbtn_z_12 "-0.2" +vr_wofs_wpnbtn_z_13 "3" +vr_wofs_wpnbtn_z_14 "1.8" +vr_wofs_wpnbtn_z_15 "1.3" +vr_wofs_wpnbtn_z_16 "-1" +vr_wofs_wpnbtn_z_17 "0.0" +vr_wofs_wpnbtn_z_18 "0.0" +vr_wofs_wpnbtn_z_19 "0.0" +vr_wofs_wpnbtn_z_20 "0.0" +vr_wofs_wpnbtn_z_21 "0.0" +vr_wofs_wpnbtn_z_22 "0.0" +vr_wofs_wpnbtn_z_23 "0.0" +vr_wofs_wpnbtn_z_24 "0.0" +vr_wofs_wpnbtn_z_25 "0.0" +vr_wofs_wpnbtn_z_26 "0.0" +vr_wofs_wpnbtn_z_27 "0.0" +vr_wofs_wpnbtn_z_28 "0.0" +vr_wofs_wpnbtn_z_29 "0.0" +vr_wofs_wpnbtn_z_30 "0.0" +vr_wofs_wpnbtn_z_31 "0.0" +vr_wofs_wpnbtn_z_32 "0.0" +vr_wofs_wpnbtnmode_01 "0" +vr_wofs_wpnbtnmode_02 "0" +vr_wofs_wpnbtnmode_03 "0.0" +vr_wofs_wpnbtnmode_04 "1" +vr_wofs_wpnbtnmode_05 "1" +vr_wofs_wpnbtnmode_06 "1" +vr_wofs_wpnbtnmode_07 "1" +vr_wofs_wpnbtnmode_08 "1" +vr_wofs_wpnbtnmode_09 "0.0" +vr_wofs_wpnbtnmode_10 "0.0" +vr_wofs_wpnbtnmode_11 "0.0" +vr_wofs_wpnbtnmode_12 "1" +vr_wofs_wpnbtnmode_13 "1" +vr_wofs_wpnbtnmode_14 "1" +vr_wofs_wpnbtnmode_15 "1" +vr_wofs_wpnbtnmode_16 "1" +vr_wofs_wpnbtnmode_17 "0.0" +vr_wofs_wpnbtnmode_18 "0.0" +vr_wofs_wpnbtnmode_19 "0.0" +vr_wofs_wpnbtnmode_20 "0.0" +vr_wofs_wpnbtnmode_21 "0.0" +vr_wofs_wpnbtnmode_22 "0.0" +vr_wofs_wpnbtnmode_23 "0.0" +vr_wofs_wpnbtnmode_24 "0.0" +vr_wofs_wpnbtnmode_25 "0.0" +vr_wofs_wpnbtnmode_26 "0.0" +vr_wofs_wpnbtnmode_27 "0.0" +vr_wofs_wpnbtnmode_28 "0.0" +vr_wofs_wpnbtnmode_29 "0.0" +vr_wofs_wpnbtnmode_30 "0.0" +vr_wofs_wpnbtnmode_31 "0.0" +vr_wofs_wpnbtnmode_32 "0.0" +vr_wofs_x_01 "-0.6" +vr_wofs_x_02 "0.950001" +vr_wofs_x_03 "6.099997" +vr_wofs_x_04 "3.6" +vr_wofs_x_05 "1.3" +vr_wofs_x_06 "11.100024" +vr_wofs_x_07 "6.60001" +vr_wofs_x_08 "2.25" +vr_wofs_x_09 "1.2" +vr_wofs_x_10 "-1.4" +vr_wofs_x_11 "11.099998" +vr_wofs_x_12 "3.6" +vr_wofs_x_13 "1.05" +vr_wofs_x_14 "11.000022" +vr_wofs_x_15 "6.50001" +vr_wofs_x_16 "2.25" +vr_wofs_x_17 "0.0" +vr_wofs_x_18 "-2.15" +vr_wofs_x_19 "1.5" +vr_wofs_x_20 "1.5" +vr_wofs_x_21 "1.5" +vr_wofs_x_22 "1.5" +vr_wofs_x_23 "1.5" +vr_wofs_x_24 "1.5" +vr_wofs_x_25 "1.5" +vr_wofs_x_26 "1.5" +vr_wofs_x_27 "1.5" +vr_wofs_x_28 "1.5" +vr_wofs_x_29 "1.5" +vr_wofs_x_30 "1.5" +vr_wofs_x_31 "1.5" +vr_wofs_x_32 "1.5" +vr_wofs_y_01 "1.1" +vr_wofs_y_02 "1.350002" +vr_wofs_y_03 "1.35" +vr_wofs_y_04 "2.75" +vr_wofs_y_05 "4.55" +vr_wofs_y_06 "2.25" +vr_wofs_y_07 "7.1" +vr_wofs_y_08 "6.05" +vr_wofs_y_09 "3.2" +vr_wofs_y_10 "5.9" +vr_wofs_y_11 "2.25" +vr_wofs_y_12 "2.75" +vr_wofs_y_13 "4.55" +vr_wofs_y_14 "2.25" +vr_wofs_y_15 "7.05" +vr_wofs_y_16 "6.05" +vr_wofs_y_17 "0.0" +vr_wofs_y_18 "5" +vr_wofs_y_19 "1" +vr_wofs_y_20 "1" +vr_wofs_y_21 "1" +vr_wofs_y_22 "1" +vr_wofs_y_23 "1" +vr_wofs_y_24 "1" +vr_wofs_y_25 "1" +vr_wofs_y_26 "1" +vr_wofs_y_27 "1" +vr_wofs_y_28 "1" +vr_wofs_y_29 "1" +vr_wofs_y_30 "1" +vr_wofs_y_31 "1" +vr_wofs_y_32 "1" +vr_wofs_yaw_01 "0.79998" +vr_wofs_yaw_02 "0" +vr_wofs_yaw_03 "0" +vr_wofs_yaw_04 "0.0" +vr_wofs_yaw_05 "0.0" +vr_wofs_yaw_06 "0.5" +vr_wofs_yaw_07 "0.5" +vr_wofs_yaw_08 "0" +vr_wofs_yaw_09 "-2.5" +vr_wofs_yaw_10 "0" +vr_wofs_yaw_11 "0.5" +vr_wofs_yaw_12 "0.0" +vr_wofs_yaw_13 "0.0" +vr_wofs_yaw_14 "0.5" +vr_wofs_yaw_15 "0.5" +vr_wofs_yaw_16 "0" +vr_wofs_yaw_17 "0" +vr_wofs_yaw_18 "0.0" +vr_wofs_yaw_19 "0.0" +vr_wofs_yaw_20 "0.0" +vr_wofs_yaw_21 "0.0" +vr_wofs_yaw_22 "0.0" +vr_wofs_yaw_23 "0.0" +vr_wofs_yaw_24 "0.0" +vr_wofs_yaw_25 "0.0" +vr_wofs_yaw_26 "0.0" +vr_wofs_yaw_27 "0.0" +vr_wofs_yaw_28 "0.0" +vr_wofs_yaw_29 "0.0" +vr_wofs_yaw_30 "0.0" +vr_wofs_yaw_31 "0.0" +vr_wofs_yaw_32 "0.0" +vr_wofs_z_01 "-0.8" +vr_wofs_z_02 "-0.050021" +vr_wofs_z_03 "-2.350011" +vr_wofs_z_04 "0.799975" +vr_wofs_z_05 "2.05" +vr_wofs_z_06 "-1.850028" +vr_wofs_z_07 "-0.350044" +vr_wofs_z_08 "-3.95" +vr_wofs_z_09 "-1.45" +vr_wofs_z_10 "12.299991" +vr_wofs_z_11 "-1.85" +vr_wofs_z_12 "0.799975" +vr_wofs_z_13 "2.05" +vr_wofs_z_14 "-1.950028" +vr_wofs_z_15 "-0.350044" +vr_wofs_z_16 "-3.95" +vr_wofs_z_17 "0.0" +vr_wofs_z_18 "-0.9" +vr_wofs_z_19 "10" +vr_wofs_z_20 "10" +vr_wofs_z_21 "10" +vr_wofs_z_22 "10" +vr_wofs_z_23 "10" +vr_wofs_z_24 "10" +vr_wofs_z_25 "10" +vr_wofs_z_26 "10" +vr_wofs_z_27 "10" +vr_wofs_z_28 "10" +vr_wofs_z_29 "10" +vr_wofs_z_30 "10" +vr_wofs_z_31 "10" +vr_wofs_z_32 "10" +vr_wofs_zb_01 "0.0" +vr_wofs_zb_02 "0" +vr_wofs_zb_03 "0.0" +vr_wofs_zb_04 "0.0" +vr_wofs_zb_05 "0.0" +vr_wofs_zb_06 "0.0" +vr_wofs_zb_07 "0.0" +vr_wofs_zb_08 "0.0" +vr_wofs_zb_09 "0.0" +vr_wofs_zb_10 "0.0" +vr_wofs_zb_11 "0.0" +vr_wofs_zb_12 "0.0" +vr_wofs_zb_13 "0.0" +vr_wofs_zb_14 "0.0" +vr_wofs_zb_15 "0.0" +vr_wofs_zb_16 "0.0" +vr_wofs_zb_17 "0.0" +vr_wofs_zb_18 "0.0" +vr_wofs_zb_19 "0.0" +vr_wofs_zb_20 "0.0" +vr_wofs_zb_21 "0.0" +vr_wofs_zb_22 "0.0" +vr_wofs_zb_23 "0.0" +vr_wofs_zb_24 "0.0" +vr_wofs_zb_25 "0.0" +vr_wofs_zb_26 "0.0" +vr_wofs_zb_27 "0.0" +vr_wofs_zb_28 "0.0" +vr_wofs_zb_29 "0.0" +vr_wofs_zb_2h_01 "0.0" +vr_wofs_zb_2h_02 "0.8" +vr_wofs_zb_2h_03 "0.8" +vr_wofs_zb_2h_04 "0.0" +vr_wofs_zb_2h_05 "0.0" +vr_wofs_zb_2h_06 "0.75" +vr_wofs_zb_2h_07 "0.75" +vr_wofs_zb_2h_08 "0.0" +vr_wofs_zb_2h_09 "0.0" +vr_wofs_zb_2h_10 "0.0" +vr_wofs_zb_2h_11 "0.75" +vr_wofs_zb_2h_12 "0.0" +vr_wofs_zb_2h_13 "0.0" +vr_wofs_zb_2h_14 "0.0" +vr_wofs_zb_2h_15 "0.0" +vr_wofs_zb_2h_16 "0.0" +vr_wofs_zb_2h_17 "0.0" +vr_wofs_zb_2h_18 "0.0" +vr_wofs_zb_2h_19 "0.0" +vr_wofs_zb_2h_20 "0.0" +vr_wofs_zb_2h_21 "0.0" +vr_wofs_zb_2h_22 "0.0" +vr_wofs_zb_2h_23 "0.0" +vr_wofs_zb_2h_24 "0.0" +vr_wofs_zb_2h_25 "0.0" +vr_wofs_zb_2h_26 "0.0" +vr_wofs_zb_2h_27 "0.0" +vr_wofs_zb_2h_28 "0.0" +vr_wofs_zb_2h_29 "0.0" +vr_wofs_zb_2h_30 "0.0" +vr_wofs_zb_2h_31 "0.0" +vr_wofs_zb_2h_32 "0.0" +vr_wofs_zb_30 "0.0" +vr_wofs_zb_31 "0.0" +vr_wofs_zb_32 "0.0" +vr_world_scale "1.25" +vr_wpn_dir_weight "1" +vr_wpn_dir_weight_2h_help_mult "1.0" +vr_wpn_dir_weight_2h_help_offset "0.3" +vr_wpn_dir_weight_mult "1" +vr_wpn_dir_weight_offset "0.05" +vr_wpn_pos_weight "1" +vr_wpn_pos_weight_2h_help_mult "1.0" +vr_wpn_pos_weight_2h_help_offset "0.3" +vr_wpn_pos_weight_mult "1.0" +vr_wpn_pos_weight_offset "0.0" +vid_restart ++mlook diff --git a/old/config9.cfg b/old/config9.cfg new file mode 100644 index 00000000..219fff48 --- /dev/null +++ b/old/config9.cfg @@ -0,0 +1,1826 @@ +unbindall +bind "TAB" "+showscores" +bind "ENTER" "+jump" +bind "ESCAPE" "togglemenu" +bind "SPACE" "+jump" +bind "+" "sizeup" +bind "," "+moveleft" +bind "-" "sizedown" +bind "." "+moveright" +bind "/" "impulse 10" +bind "0" "impulse 0" +bind "1" "impulse 10" +bind "2" "impulse 2" +bind "3" "impulse 12" +bind "4" "impulse 15" +bind "5" "impulse 16" +bind "6" "impulse 6" +bind "7" "impulse 7" +bind "8" "impulse 8" +bind "=" "sizeup" +bind "\" "+mlook" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+movedown" +bind "d" "+moveright" +bind "k" "+grableft" +bind "l" "+grabright" +bind "s" "+back" +bind "t" "messagemode" +bind "w" "+forward" +bind "z" "+lookdown" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "impulse 10" +bind "RIGHTARROW" "+right" +bind "ALT" "+strafe" +bind "CTRL" "+attack" +bind "SHIFT" "+speed" +bind "F1" "help" +bind "F2" "menu_save" +bind "F3" "menu_load" +bind "F4" "menu_options" +bind "F5" "menu_multiplayer" +bind "F6" "echo Quicksaving...; wait; save quick" +bind "F9" "echo Quickloading...; wait; load quick" +bind "F10" "quit" +bind "F11" "zoom_in" +bind "F12" "screenshot" +bind "INS" "+klook" +bind "DEL" "+lookdown" +bind "PGDN" "+lookup" +bind "END" "centerview" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+offhandattack" +bind "MOUSE3" "+mlook" +bind "MWHEELDOWN" "impulse 12" +bind "PAUSE" "pause" +_cl_color "0" +_cl_name "player" +_snd_mixahead "0.1" +bgm_extmusic "1" +bgmvolume "1" +cfg_unbindall "1" +cl_alwaysrun "1" +cl_backspeed "200" +cl_forwardspeed "400" +cl_maxpitch "90" +cl_minpitch "-90" +cl_movespeedkey "0.5" +contrast "1" +crosshair "0" +external_ents "1" +fov_adapt "1" +gamma "1" +gl_farclip "16384" +gl_flashblend "0" +gl_fullbrights "1" +gl_overbright "1" +gl_overbright_models "1" +gl_subdivide_size "128" +gl_texture_anisotropy "1" +gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" +gl_triplebuffer "1" +host_maxfps "72" +joy_deadzone "0.175" +joy_deadzone_trigger "0.2" +joy_enable "1" +joy_exponent "3" +joy_exponent_move "3" +joy_invert "0" +joy_sensitivity_pitch "150" +joy_sensitivity_yaw "300" +joy_swapmovelook "0" +lookspring "1" +lookstrafe "0" +m_forward "1" +m_pitch "0.022" +m_side "0.8" +m_yaw "0.022" +r_clearcolor "2" +r_dynamic "1" +r_lavaalpha "0" +r_novis "0" +r_oldwater "1" +r_particle_mult "1" +r_particles "1" +r_scale "1" +r_shadows "1" +r_slimealpha "0" +r_telealpha "0" +r_viewmodel_quake "0" +r_wateralpha "0.5" +saved1 "0" +saved2 "0" +saved3 "0" +saved4 "0" +savedgamecfg "0" +scr_conalpha "0.5" +scr_conscale "1.1" +scr_conspeed "500" +scr_conwidth "0" +scr_crosshairscale "1" +scr_menuscale "1.1" +scr_sbaralpha "0.75" +scr_sbarscale "1.1" +sensitivity "3.5" +sv_altnoclip "1" +sys_throttle "0.02" +vid_borderless "0" +vid_bpp "24" +vid_desktopfullscreen "0" +vid_fsaa "0" +vid_fullscreen "0" +vid_height "900" +vid_refreshrate "60" +vid_vsync "0" +vid_width "1600" +viewsize "100" +volume "0.8" +vr_2h_angle_threshold "0.65" +vr_2h_mode "2" +vr_2h_virtual_stock_factor "0.5" +vr_aimmode "6" +vr_ammobox_drops "0" +vr_ammobox_drops_chance_mult "1.0" +vr_body_interactions "0" +vr_crosshair "0" +vr_crosshair_alpha "0.85" +vr_crosshair_depth "0" +vr_crosshair_size "1" +vr_crosshairy "0" +vr_deadzone "25" +vr_debug_print_handvel "0" +vr_debug_show_hand_pos_and_rot "0" +vr_enable_joystick_turn "1" +vr_enemy_drops "0" +vr_enemy_drops_chance_mult "1.0" +vr_floor_offset "-21" +vr_forcegrab_eligible_haptics "1" +vr_forcegrab_eligible_particles "1" +vr_forcegrab_mode "1" +vr_forcegrab_powermult "1.0" +vr_forcegrab_radius "18" +vr_forcegrab_range "150.0" +vr_gun_z_offset "-1" +vr_gunangle "39.5" +vr_gunmodelpitch "7" +vr_gunmodelscale "0.7" +vr_gunmodely "1.3" +vr_gunyaw "4" +vr_height_calibration "1.57799" +vr_hip_holster_thresh "6.5" +vr_hip_offset_x "-3.5" +vr_hip_offset_y "7.0" +vr_hip_offset_z "0" +vr_holster_haptics "2" +vr_holster_mode "0" +vr_hud_scale "0.025" +vr_leg_holster_model_enabled "1" +vr_leg_holster_model_scale "0.5" +vr_leg_holster_model_x_offset "1" +vr_leg_holster_model_y_offset "1.25" +vr_leg_holster_model_z_offset "2.25" +vr_melee_bloodlust "0" +vr_melee_bloodlust_mult "1.0" +vr_melee_dmg_multiplier "1.0" +vr_melee_range_multiplier "1.0" +vr_melee_threshold "7" +vr_menu_distance "76" +vr_menu_scale "0.2" +vr_menumode "0" +vr_movement_mode "1" +vr_msaa "9" +vr_offhandpitch "40.25" +vr_offhandyaw "-4" +vr_player_shadows "2" +vr_positional_damage "1" +vr_roomscale_jump "1" +vr_roomscale_jump_threshold "0.8" +vr_roomscale_move_mult "1" +vr_sbar_mode "1" +vr_sbar_offset_pitch "1" +vr_sbar_offset_roll "-0.3" +vr_sbar_offset_x "-12" +vr_sbar_offset_y "1" +vr_sbar_offset_yaw "1.6" +vr_sbar_offset_z "-3" +vr_shoulder_holster_offset_x "-0.5" +vr_shoulder_holster_offset_y "2.25" +vr_shoulder_holster_offset_z "-0.25" +vr_shoulder_holster_thresh "7.8" +vr_shoulder_offset_x "-1" +vr_shoulder_offset_y "1.75" +vr_shoulder_offset_z "16" +vr_show_hip_holsters "0" +vr_show_shoulder_holsters "0" +vr_show_upper_holsters "0" +vr_show_virtual_stock "0" +vr_snap_turn "0" +vr_teleport_enabled "1" +vr_teleport_range "400" +vr_turn_speed "3.25" +vr_upper_holster_offset_x "-4.25" +vr_upper_holster_offset_y "7" +vr_upper_holster_offset_z "8.5" +vr_upper_holster_thresh "6.5" +vr_virtual_stock_thresh "10" +vr_vrtorso_debuglines_enabled "0" +vr_vrtorso_enabled "1" +vr_vrtorso_head_z_mult "33" +vr_vrtorso_pitch "1.5" +vr_vrtorso_roll "0" +vr_vrtorso_x_offset "-2.75" +vr_vrtorso_x_scale "0.675" +vr_vrtorso_y_offset "-4.75" +vr_vrtorso_y_scale "0.675" +vr_vrtorso_yaw "0" +vr_vrtorso_z_offset "-45" +vr_vrtorso_z_scale "1.1" +vr_weapon_cycle_mode "0" +vr_weapon_throw_damage_mult "1.0" +vr_weapon_throw_mode "0" +vr_weapon_throw_velocity_mult "1.0" +vr_weapondrop_particles "1" +vr_wofs_2h_dispmd_01 "0.0" +vr_wofs_2h_dispmd_02 "1" +vr_wofs_2h_dispmd_03 "1" +vr_wofs_2h_dispmd_04 "1" +vr_wofs_2h_dispmd_05 "1" +vr_wofs_2h_dispmd_06 "1" +vr_wofs_2h_dispmd_07 "1" +vr_wofs_2h_dispmd_08 "1" +vr_wofs_2h_dispmd_09 "0" +vr_wofs_2h_dispmd_10 "1" +vr_wofs_2h_dispmd_11 "1" +vr_wofs_2h_dispmd_12 "0.0" +vr_wofs_2h_dispmd_13 "0.0" +vr_wofs_2h_dispmd_14 "0.0" +vr_wofs_2h_dispmd_15 "0.0" +vr_wofs_2h_dispmd_16 "0.0" +vr_wofs_2h_dispmd_17 "0.0" +vr_wofs_2h_dispmd_18 "0.0" +vr_wofs_2h_dispmd_19 "0.0" +vr_wofs_2h_dispmd_20 "0.0" +vr_wofs_2h_dispmd_21 "0.0" +vr_wofs_2h_dispmd_22 "0.0" +vr_wofs_2h_dispmd_23 "0.0" +vr_wofs_2h_dispmd_24 "0.0" +vr_wofs_2h_dispmd_25 "0.0" +vr_wofs_2h_dispmd_26 "0.0" +vr_wofs_2h_dispmd_27 "0.0" +vr_wofs_2h_dispmd_28 "0.0" +vr_wofs_2h_dispmd_29 "0.0" +vr_wofs_2h_dispmd_30 "0.0" +vr_wofs_2h_dispmd_31 "0.0" +vr_wofs_2h_dispmd_32 "0.0" +vr_wofs_2h_fxd_hp_01 "0.0" +vr_wofs_2h_fxd_hp_02 "0.0" +vr_wofs_2h_fxd_hp_03 "0.0" +vr_wofs_2h_fxd_hp_04 "0.0" +vr_wofs_2h_fxd_hp_05 "0.0" +vr_wofs_2h_fxd_hp_06 "0.0" +vr_wofs_2h_fxd_hp_07 "0.0" +vr_wofs_2h_fxd_hp_08 "0.0" +vr_wofs_2h_fxd_hp_09 "0.0" +vr_wofs_2h_fxd_hp_10 "0.0" +vr_wofs_2h_fxd_hp_11 "0.0" +vr_wofs_2h_fxd_hp_12 "0.0" +vr_wofs_2h_fxd_hp_13 "0.0" +vr_wofs_2h_fxd_hp_14 "0.0" +vr_wofs_2h_fxd_hp_15 "0.0" +vr_wofs_2h_fxd_hp_16 "0.0" +vr_wofs_2h_fxd_hp_17 "0.0" +vr_wofs_2h_fxd_hp_18 "0.0" +vr_wofs_2h_fxd_hp_19 "0.0" +vr_wofs_2h_fxd_hp_20 "0.0" +vr_wofs_2h_fxd_hp_21 "0.0" +vr_wofs_2h_fxd_hp_22 "0.0" +vr_wofs_2h_fxd_hp_23 "0.0" +vr_wofs_2h_fxd_hp_24 "0.0" +vr_wofs_2h_fxd_hp_25 "0.0" +vr_wofs_2h_fxd_hp_26 "0.0" +vr_wofs_2h_fxd_hp_27 "0.0" +vr_wofs_2h_fxd_hp_28 "0.0" +vr_wofs_2h_fxd_hp_29 "0.0" +vr_wofs_2h_fxd_hp_30 "0.0" +vr_wofs_2h_fxd_hp_31 "0.0" +vr_wofs_2h_fxd_hp_32 "0.0" +vr_wofs_2h_fxd_hr_01 "0.0" +vr_wofs_2h_fxd_hr_02 "-67.799927" +vr_wofs_2h_fxd_hr_03 "-52.199963" +vr_wofs_2h_fxd_hr_04 "-76.799904" +vr_wofs_2h_fxd_hr_05 "21.600008" +vr_wofs_2h_fxd_hr_06 "-78.599899" +vr_wofs_2h_fxd_hr_07 "-82.999886" +vr_wofs_2h_fxd_hr_08 "-90.400024" +vr_wofs_2h_fxd_hr_09 "0.0" +vr_wofs_2h_fxd_hr_10 "75.799942" +vr_wofs_2h_fxd_hr_11 "-78.599899" +vr_wofs_2h_fxd_hr_12 "0.0" +vr_wofs_2h_fxd_hr_13 "0.0" +vr_wofs_2h_fxd_hr_14 "0.0" +vr_wofs_2h_fxd_hr_15 "0.0" +vr_wofs_2h_fxd_hr_16 "0.0" +vr_wofs_2h_fxd_hr_17 "0.0" +vr_wofs_2h_fxd_hr_18 "0.0" +vr_wofs_2h_fxd_hr_19 "0.0" +vr_wofs_2h_fxd_hr_20 "0.0" +vr_wofs_2h_fxd_hr_21 "0.0" +vr_wofs_2h_fxd_hr_22 "0.0" +vr_wofs_2h_fxd_hr_23 "0.0" +vr_wofs_2h_fxd_hr_24 "0.0" +vr_wofs_2h_fxd_hr_25 "0.0" +vr_wofs_2h_fxd_hr_26 "0.0" +vr_wofs_2h_fxd_hr_27 "0.0" +vr_wofs_2h_fxd_hr_28 "0.0" +vr_wofs_2h_fxd_hr_29 "0.0" +vr_wofs_2h_fxd_hr_30 "0.0" +vr_wofs_2h_fxd_hr_31 "0.0" +vr_wofs_2h_fxd_hr_32 "0.0" +vr_wofs_2h_fxd_hy_01 "0.0" +vr_wofs_2h_fxd_hy_02 "-17.400005" +vr_wofs_2h_fxd_hy_03 "-21.600008" +vr_wofs_2h_fxd_hy_04 "-26.400011" +vr_wofs_2h_fxd_hy_05 "0.0" +vr_wofs_2h_fxd_hy_06 "-29.000013" +vr_wofs_2h_fxd_hy_07 "-27.600012" +vr_wofs_2h_fxd_hy_08 "-32.650013" +vr_wofs_2h_fxd_hy_09 "0.0" +vr_wofs_2h_fxd_hy_10 "0.0" +vr_wofs_2h_fxd_hy_11 "-29.000013" +vr_wofs_2h_fxd_hy_12 "0.0" +vr_wofs_2h_fxd_hy_13 "0.0" +vr_wofs_2h_fxd_hy_14 "0.0" +vr_wofs_2h_fxd_hy_15 "0.0" +vr_wofs_2h_fxd_hy_16 "0.0" +vr_wofs_2h_fxd_hy_17 "0.0" +vr_wofs_2h_fxd_hy_18 "0.0" +vr_wofs_2h_fxd_hy_19 "0.0" +vr_wofs_2h_fxd_hy_20 "0.0" +vr_wofs_2h_fxd_hy_21 "0.0" +vr_wofs_2h_fxd_hy_22 "0.0" +vr_wofs_2h_fxd_hy_23 "0.0" +vr_wofs_2h_fxd_hy_24 "0.0" +vr_wofs_2h_fxd_hy_25 "0.0" +vr_wofs_2h_fxd_hy_26 "0.0" +vr_wofs_2h_fxd_hy_27 "0.0" +vr_wofs_2h_fxd_hy_28 "0.0" +vr_wofs_2h_fxd_hy_29 "0.0" +vr_wofs_2h_fxd_hy_30 "0.0" +vr_wofs_2h_fxd_hy_31 "0.0" +vr_wofs_2h_fxd_hy_32 "0.0" +vr_wofs_2h_fxd_mh_ox_01 "0.0" +vr_wofs_2h_fxd_mh_ox_02 "0.0" +vr_wofs_2h_fxd_mh_ox_03 "0" +vr_wofs_2h_fxd_mh_ox_04 "0" +vr_wofs_2h_fxd_mh_ox_05 "0" +vr_wofs_2h_fxd_mh_ox_06 "0.0" +vr_wofs_2h_fxd_mh_ox_07 "0.0" +vr_wofs_2h_fxd_mh_ox_08 "0.0" +vr_wofs_2h_fxd_mh_ox_09 "0.0" +vr_wofs_2h_fxd_mh_ox_10 "0.0" +vr_wofs_2h_fxd_mh_ox_11 "0.0" +vr_wofs_2h_fxd_mh_ox_12 "0.0" +vr_wofs_2h_fxd_mh_ox_13 "0.0" +vr_wofs_2h_fxd_mh_ox_14 "0.0" +vr_wofs_2h_fxd_mh_ox_15 "0.0" +vr_wofs_2h_fxd_mh_ox_16 "0.0" +vr_wofs_2h_fxd_mh_ox_17 "0" +vr_wofs_2h_fxd_mh_ox_18 "0.0" +vr_wofs_2h_fxd_mh_ox_19 "0.0" +vr_wofs_2h_fxd_mh_ox_20 "0.0" +vr_wofs_2h_fxd_mh_ox_21 "0.0" +vr_wofs_2h_fxd_mh_ox_22 "0.0" +vr_wofs_2h_fxd_mh_ox_23 "0.0" +vr_wofs_2h_fxd_mh_ox_24 "0.0" +vr_wofs_2h_fxd_mh_ox_25 "0.0" +vr_wofs_2h_fxd_mh_ox_26 "0.0" +vr_wofs_2h_fxd_mh_ox_27 "0.0" +vr_wofs_2h_fxd_mh_ox_28 "0.0" +vr_wofs_2h_fxd_mh_ox_29 "0.0" +vr_wofs_2h_fxd_mh_ox_30 "0.0" +vr_wofs_2h_fxd_mh_ox_31 "0.0" +vr_wofs_2h_fxd_mh_ox_32 "0.0" +vr_wofs_2h_fxd_mh_oy_01 "0.0" +vr_wofs_2h_fxd_mh_oy_02 "0.7" +vr_wofs_2h_fxd_mh_oy_03 "5.4" +vr_wofs_2h_fxd_mh_oy_04 "3.9" +vr_wofs_2h_fxd_mh_oy_05 "1.9" +vr_wofs_2h_fxd_mh_oy_06 "6.6" +vr_wofs_2h_fxd_mh_oy_07 "5.95" +vr_wofs_2h_fxd_mh_oy_08 "3.8" +vr_wofs_2h_fxd_mh_oy_09 "0.0" +vr_wofs_2h_fxd_mh_oy_10 "-4.4" +vr_wofs_2h_fxd_mh_oy_11 "6.6" +vr_wofs_2h_fxd_mh_oy_12 "0.0" +vr_wofs_2h_fxd_mh_oy_13 "0.0" +vr_wofs_2h_fxd_mh_oy_14 "0.0" +vr_wofs_2h_fxd_mh_oy_15 "0.0" +vr_wofs_2h_fxd_mh_oy_16 "0.0" +vr_wofs_2h_fxd_mh_oy_17 "0" +vr_wofs_2h_fxd_mh_oy_18 "0.0" +vr_wofs_2h_fxd_mh_oy_19 "0.0" +vr_wofs_2h_fxd_mh_oy_20 "0.0" +vr_wofs_2h_fxd_mh_oy_21 "0.0" +vr_wofs_2h_fxd_mh_oy_22 "0.0" +vr_wofs_2h_fxd_mh_oy_23 "0.0" +vr_wofs_2h_fxd_mh_oy_24 "0.0" +vr_wofs_2h_fxd_mh_oy_25 "0.0" +vr_wofs_2h_fxd_mh_oy_26 "0.0" +vr_wofs_2h_fxd_mh_oy_27 "0.0" +vr_wofs_2h_fxd_mh_oy_28 "0.0" +vr_wofs_2h_fxd_mh_oy_29 "0.0" +vr_wofs_2h_fxd_mh_oy_30 "0.0" +vr_wofs_2h_fxd_mh_oy_31 "0.0" +vr_wofs_2h_fxd_mh_oy_32 "0.0" +vr_wofs_2h_fxd_mh_oz_01 "0.0" +vr_wofs_2h_fxd_mh_oz_02 "0.0" +vr_wofs_2h_fxd_mh_oz_03 "0.0" +vr_wofs_2h_fxd_mh_oz_04 "0.0" +vr_wofs_2h_fxd_mh_oz_05 "0.0" +vr_wofs_2h_fxd_mh_oz_06 "0.0" +vr_wofs_2h_fxd_mh_oz_07 "0.0" +vr_wofs_2h_fxd_mh_oz_08 "0.0" +vr_wofs_2h_fxd_mh_oz_09 "0.0" +vr_wofs_2h_fxd_mh_oz_10 "0.0" +vr_wofs_2h_fxd_mh_oz_11 "0.0" +vr_wofs_2h_fxd_mh_oz_12 "0.0" +vr_wofs_2h_fxd_mh_oz_13 "0.0" +vr_wofs_2h_fxd_mh_oz_14 "0.0" +vr_wofs_2h_fxd_mh_oz_15 "0.0" +vr_wofs_2h_fxd_mh_oz_16 "0.0" +vr_wofs_2h_fxd_mh_oz_17 "0" +vr_wofs_2h_fxd_mh_oz_18 "0.0" +vr_wofs_2h_fxd_mh_oz_19 "0.0" +vr_wofs_2h_fxd_mh_oz_20 "0.0" +vr_wofs_2h_fxd_mh_oz_21 "0.0" +vr_wofs_2h_fxd_mh_oz_22 "0.0" +vr_wofs_2h_fxd_mh_oz_23 "0.0" +vr_wofs_2h_fxd_mh_oz_24 "0.0" +vr_wofs_2h_fxd_mh_oz_25 "0.0" +vr_wofs_2h_fxd_mh_oz_26 "0.0" +vr_wofs_2h_fxd_mh_oz_27 "0.0" +vr_wofs_2h_fxd_mh_oz_28 "0.0" +vr_wofs_2h_fxd_mh_oz_29 "0.0" +vr_wofs_2h_fxd_mh_oz_30 "0.0" +vr_wofs_2h_fxd_mh_oz_31 "0.0" +vr_wofs_2h_fxd_mh_oz_32 "0.0" +vr_wofs_2h_fxd_ox_01 "0.0" +vr_wofs_2h_fxd_ox_02 "-1.2" +vr_wofs_2h_fxd_ox_03 "-2.4" +vr_wofs_2h_fxd_ox_04 "1.8" +vr_wofs_2h_fxd_ox_05 "3.4" +vr_wofs_2h_fxd_ox_06 "4.2" +vr_wofs_2h_fxd_ox_07 "3" +vr_wofs_2h_fxd_ox_08 "0.0" +vr_wofs_2h_fxd_ox_09 "0.0" +vr_wofs_2h_fxd_ox_10 "2.4" +vr_wofs_2h_fxd_ox_11 "4.2" +vr_wofs_2h_fxd_ox_12 "0.0" +vr_wofs_2h_fxd_ox_13 "0.0" +vr_wofs_2h_fxd_ox_14 "0.0" +vr_wofs_2h_fxd_ox_15 "0.0" +vr_wofs_2h_fxd_ox_16 "0.0" +vr_wofs_2h_fxd_ox_17 "0.0" +vr_wofs_2h_fxd_ox_18 "0.0" +vr_wofs_2h_fxd_ox_19 "0.0" +vr_wofs_2h_fxd_ox_20 "0.0" +vr_wofs_2h_fxd_ox_21 "0.0" +vr_wofs_2h_fxd_ox_22 "0.0" +vr_wofs_2h_fxd_ox_23 "0.0" +vr_wofs_2h_fxd_ox_24 "0.0" +vr_wofs_2h_fxd_ox_25 "0.0" +vr_wofs_2h_fxd_ox_26 "0.0" +vr_wofs_2h_fxd_ox_27 "0.0" +vr_wofs_2h_fxd_ox_28 "0.0" +vr_wofs_2h_fxd_ox_29 "0.0" +vr_wofs_2h_fxd_ox_30 "0.0" +vr_wofs_2h_fxd_ox_31 "0.0" +vr_wofs_2h_fxd_ox_32 "0.0" +vr_wofs_2h_fxd_oy_01 "0.0" +vr_wofs_2h_fxd_oy_02 "-2.4" +vr_wofs_2h_fxd_oy_03 "0" +vr_wofs_2h_fxd_oy_04 "0.0" +vr_wofs_2h_fxd_oy_05 "-1.2" +vr_wofs_2h_fxd_oy_06 "1.2" +vr_wofs_2h_fxd_oy_07 "1" +vr_wofs_2h_fxd_oy_08 "0.4" +vr_wofs_2h_fxd_oy_09 "0.0" +vr_wofs_2h_fxd_oy_10 "-0.2" +vr_wofs_2h_fxd_oy_11 "1.2" +vr_wofs_2h_fxd_oy_12 "0.0" +vr_wofs_2h_fxd_oy_13 "0.0" +vr_wofs_2h_fxd_oy_14 "0.0" +vr_wofs_2h_fxd_oy_15 "0.0" +vr_wofs_2h_fxd_oy_16 "0.0" +vr_wofs_2h_fxd_oy_17 "0.0" +vr_wofs_2h_fxd_oy_18 "0.0" +vr_wofs_2h_fxd_oy_19 "0.0" +vr_wofs_2h_fxd_oy_20 "0.0" +vr_wofs_2h_fxd_oy_21 "0.0" +vr_wofs_2h_fxd_oy_22 "0.0" +vr_wofs_2h_fxd_oy_23 "0.0" +vr_wofs_2h_fxd_oy_24 "0.0" +vr_wofs_2h_fxd_oy_25 "0.0" +vr_wofs_2h_fxd_oy_26 "0.0" +vr_wofs_2h_fxd_oy_27 "0.0" +vr_wofs_2h_fxd_oy_28 "0.0" +vr_wofs_2h_fxd_oy_29 "0.0" +vr_wofs_2h_fxd_oy_30 "0.0" +vr_wofs_2h_fxd_oy_31 "0.0" +vr_wofs_2h_fxd_oy_32 "0.0" +vr_wofs_2h_fxd_oz_01 "0.0" +vr_wofs_2h_fxd_oz_02 "0.0" +vr_wofs_2h_fxd_oz_03 "-2" +vr_wofs_2h_fxd_oz_04 "0.2" +vr_wofs_2h_fxd_oz_05 "-0.8" +vr_wofs_2h_fxd_oz_06 "-2.8" +vr_wofs_2h_fxd_oz_07 "-1.6" +vr_wofs_2h_fxd_oz_08 "0.8" +vr_wofs_2h_fxd_oz_09 "0.0" +vr_wofs_2h_fxd_oz_10 "-4.6" +vr_wofs_2h_fxd_oz_11 "-2.8" +vr_wofs_2h_fxd_oz_12 "0.0" +vr_wofs_2h_fxd_oz_13 "0.0" +vr_wofs_2h_fxd_oz_14 "0.0" +vr_wofs_2h_fxd_oz_15 "0.0" +vr_wofs_2h_fxd_oz_16 "0.0" +vr_wofs_2h_fxd_oz_17 "0.0" +vr_wofs_2h_fxd_oz_18 "0.0" +vr_wofs_2h_fxd_oz_19 "0.0" +vr_wofs_2h_fxd_oz_20 "0.0" +vr_wofs_2h_fxd_oz_21 "0.0" +vr_wofs_2h_fxd_oz_22 "0.0" +vr_wofs_2h_fxd_oz_23 "0.0" +vr_wofs_2h_fxd_oz_24 "0.0" +vr_wofs_2h_fxd_oz_25 "0.0" +vr_wofs_2h_fxd_oz_26 "0.0" +vr_wofs_2h_fxd_oz_27 "0.0" +vr_wofs_2h_fxd_oz_28 "0.0" +vr_wofs_2h_fxd_oz_29 "0.0" +vr_wofs_2h_fxd_oz_30 "0.0" +vr_wofs_2h_fxd_oz_31 "0.0" +vr_wofs_2h_fxd_oz_32 "0.0" +vr_wofs_2h_hand_av_01 "0" +vr_wofs_2h_hand_av_02 "48" +vr_wofs_2h_hand_av_03 "29" +vr_wofs_2h_hand_av_04 "51" +vr_wofs_2h_hand_av_05 "94" +vr_wofs_2h_hand_av_06 "57" +vr_wofs_2h_hand_av_07 "3" +vr_wofs_2h_hand_av_08 "208" +vr_wofs_2h_hand_av_09 "3" +vr_wofs_2h_hand_av_10 "19" +vr_wofs_2h_hand_av_11 "57" +vr_wofs_2h_hand_av_12 "0.0" +vr_wofs_2h_hand_av_13 "0.0" +vr_wofs_2h_hand_av_14 "0.0" +vr_wofs_2h_hand_av_15 "0.0" +vr_wofs_2h_hand_av_16 "0.0" +vr_wofs_2h_hand_av_17 "0.0" +vr_wofs_2h_hand_av_18 "0.0" +vr_wofs_2h_hand_av_19 "0.0" +vr_wofs_2h_hand_av_20 "0.0" +vr_wofs_2h_hand_av_21 "0.0" +vr_wofs_2h_hand_av_22 "0.0" +vr_wofs_2h_hand_av_23 "0.0" +vr_wofs_2h_hand_av_24 "0.0" +vr_wofs_2h_hand_av_25 "0.0" +vr_wofs_2h_hand_av_26 "0.0" +vr_wofs_2h_hand_av_27 "0.0" +vr_wofs_2h_hand_av_28 "0.0" +vr_wofs_2h_hand_av_29 "0.0" +vr_wofs_2h_hand_av_30 "0.0" +vr_wofs_2h_hand_av_31 "0.0" +vr_wofs_2h_hand_av_32 "0.0" +vr_wofs_2h_mode_01 "2" +vr_wofs_2h_mode_02 "0" +vr_wofs_2h_mode_03 "0.0" +vr_wofs_2h_mode_04 "0.0" +vr_wofs_2h_mode_05 "0.0" +vr_wofs_2h_mode_06 "0.0" +vr_wofs_2h_mode_07 "0.0" +vr_wofs_2h_mode_08 "0.0" +vr_wofs_2h_mode_09 "2" +vr_wofs_2h_mode_10 "1" +vr_wofs_2h_mode_11 "0.0" +vr_wofs_2h_mode_12 "0.0" +vr_wofs_2h_mode_13 "0.0" +vr_wofs_2h_mode_14 "0.0" +vr_wofs_2h_mode_15 "0.0" +vr_wofs_2h_mode_16 "0.0" +vr_wofs_2h_mode_17 "2" +vr_wofs_2h_mode_18 "2" +vr_wofs_2h_mode_19 "0.0" +vr_wofs_2h_mode_20 "0.0" +vr_wofs_2h_mode_21 "0.0" +vr_wofs_2h_mode_22 "0.0" +vr_wofs_2h_mode_23 "0.0" +vr_wofs_2h_mode_24 "0.0" +vr_wofs_2h_mode_25 "0.0" +vr_wofs_2h_mode_26 "0.0" +vr_wofs_2h_mode_27 "0.0" +vr_wofs_2h_mode_28 "0.0" +vr_wofs_2h_mode_29 "0.0" +vr_wofs_2h_mode_30 "0.0" +vr_wofs_2h_mode_31 "0.0" +vr_wofs_2h_mode_32 "0.0" +vr_wofs_2h_pitch_01 "0.0" +vr_wofs_2h_pitch_02 "0" +vr_wofs_2h_pitch_03 "0.0" +vr_wofs_2h_pitch_04 "0.0" +vr_wofs_2h_pitch_05 "0.0" +vr_wofs_2h_pitch_06 "0.0" +vr_wofs_2h_pitch_07 "0" +vr_wofs_2h_pitch_08 "0.0" +vr_wofs_2h_pitch_09 "0.0" +vr_wofs_2h_pitch_10 "0" +vr_wofs_2h_pitch_11 "0.0" +vr_wofs_2h_pitch_12 "0.0" +vr_wofs_2h_pitch_13 "0.0" +vr_wofs_2h_pitch_14 "0.0" +vr_wofs_2h_pitch_15 "0.0" +vr_wofs_2h_pitch_16 "0.0" +vr_wofs_2h_pitch_17 "0.0" +vr_wofs_2h_pitch_18 "0.0" +vr_wofs_2h_pitch_19 "0.0" +vr_wofs_2h_pitch_20 "0.0" +vr_wofs_2h_pitch_21 "0.0" +vr_wofs_2h_pitch_22 "0.0" +vr_wofs_2h_pitch_23 "0.0" +vr_wofs_2h_pitch_24 "0.0" +vr_wofs_2h_pitch_25 "0.0" +vr_wofs_2h_pitch_26 "0.0" +vr_wofs_2h_pitch_27 "0.0" +vr_wofs_2h_pitch_28 "0.0" +vr_wofs_2h_pitch_29 "0.0" +vr_wofs_2h_pitch_30 "0.0" +vr_wofs_2h_pitch_31 "0.0" +vr_wofs_2h_pitch_32 "0.0" +vr_wofs_2h_roll_01 "0.0" +vr_wofs_2h_roll_02 "0.0" +vr_wofs_2h_roll_03 "0.0" +vr_wofs_2h_roll_04 "0.0" +vr_wofs_2h_roll_05 "0.0" +vr_wofs_2h_roll_06 "0.0" +vr_wofs_2h_roll_07 "0.0" +vr_wofs_2h_roll_08 "0.0" +vr_wofs_2h_roll_09 "0.0" +vr_wofs_2h_roll_10 "0.0" +vr_wofs_2h_roll_11 "0.0" +vr_wofs_2h_roll_12 "0.0" +vr_wofs_2h_roll_13 "0.0" +vr_wofs_2h_roll_14 "0.0" +vr_wofs_2h_roll_15 "0.0" +vr_wofs_2h_roll_16 "0.0" +vr_wofs_2h_roll_17 "0.0" +vr_wofs_2h_roll_18 "0.0" +vr_wofs_2h_roll_19 "0.0" +vr_wofs_2h_roll_20 "0.0" +vr_wofs_2h_roll_21 "0.0" +vr_wofs_2h_roll_22 "0.0" +vr_wofs_2h_roll_23 "0.0" +vr_wofs_2h_roll_24 "0.0" +vr_wofs_2h_roll_25 "0.0" +vr_wofs_2h_roll_26 "0.0" +vr_wofs_2h_roll_27 "0.0" +vr_wofs_2h_roll_28 "0.0" +vr_wofs_2h_roll_29 "0.0" +vr_wofs_2h_roll_30 "0.0" +vr_wofs_2h_roll_31 "0.0" +vr_wofs_2h_roll_32 "0.0" +vr_wofs_2h_x_01 "0.0" +vr_wofs_2h_x_02 "0" +vr_wofs_2h_x_03 "0.0" +vr_wofs_2h_x_04 "0" +vr_wofs_2h_x_05 "0.8" +vr_wofs_2h_x_06 "0.0" +vr_wofs_2h_x_07 "0.0" +vr_wofs_2h_x_08 "0" +vr_wofs_2h_x_09 "0.0" +vr_wofs_2h_x_10 "0.000001" +vr_wofs_2h_x_11 "0.0" +vr_wofs_2h_x_12 "0.0" +vr_wofs_2h_x_13 "0.0" +vr_wofs_2h_x_14 "0.0" +vr_wofs_2h_x_15 "0.0" +vr_wofs_2h_x_16 "0.0" +vr_wofs_2h_x_17 "0.0" +vr_wofs_2h_x_18 "0.0" +vr_wofs_2h_x_19 "0.0" +vr_wofs_2h_x_20 "0.0" +vr_wofs_2h_x_21 "0.0" +vr_wofs_2h_x_22 "0.0" +vr_wofs_2h_x_23 "0.0" +vr_wofs_2h_x_24 "0.0" +vr_wofs_2h_x_25 "0.0" +vr_wofs_2h_x_26 "0.0" +vr_wofs_2h_x_27 "0.0" +vr_wofs_2h_x_28 "0.0" +vr_wofs_2h_x_29 "0.0" +vr_wofs_2h_x_30 "0.0" +vr_wofs_2h_x_31 "0.0" +vr_wofs_2h_x_32 "0.0" +vr_wofs_2h_y_01 "0.0" +vr_wofs_2h_y_02 "0" +vr_wofs_2h_y_03 "0.0" +vr_wofs_2h_y_04 "0.0" +vr_wofs_2h_y_05 "1.8" +vr_wofs_2h_y_06 "0.0" +vr_wofs_2h_y_07 "0.0" +vr_wofs_2h_y_08 "0.0" +vr_wofs_2h_y_09 "0.0" +vr_wofs_2h_y_10 "-1.6" +vr_wofs_2h_y_11 "0.0" +vr_wofs_2h_y_12 "0.0" +vr_wofs_2h_y_13 "0.0" +vr_wofs_2h_y_14 "0.0" +vr_wofs_2h_y_15 "0.0" +vr_wofs_2h_y_16 "0.0" +vr_wofs_2h_y_17 "0.0" +vr_wofs_2h_y_18 "0.0" +vr_wofs_2h_y_19 "0.0" +vr_wofs_2h_y_20 "0.0" +vr_wofs_2h_y_21 "0.0" +vr_wofs_2h_y_22 "0.0" +vr_wofs_2h_y_23 "0.0" +vr_wofs_2h_y_24 "0.0" +vr_wofs_2h_y_25 "0.0" +vr_wofs_2h_y_26 "0.0" +vr_wofs_2h_y_27 "0.0" +vr_wofs_2h_y_28 "0.0" +vr_wofs_2h_y_29 "0.0" +vr_wofs_2h_y_30 "0.0" +vr_wofs_2h_y_31 "0.0" +vr_wofs_2h_y_32 "0.0" +vr_wofs_2h_yaw_01 "0.0" +vr_wofs_2h_yaw_02 "0.0" +vr_wofs_2h_yaw_03 "0.0" +vr_wofs_2h_yaw_04 "0.0" +vr_wofs_2h_yaw_05 "0.0" +vr_wofs_2h_yaw_06 "0.0" +vr_wofs_2h_yaw_07 "0" +vr_wofs_2h_yaw_08 "0.0" +vr_wofs_2h_yaw_09 "0.0" +vr_wofs_2h_yaw_10 "0" +vr_wofs_2h_yaw_11 "0.0" +vr_wofs_2h_yaw_12 "0.0" +vr_wofs_2h_yaw_13 "0.0" +vr_wofs_2h_yaw_14 "0.0" +vr_wofs_2h_yaw_15 "0.0" +vr_wofs_2h_yaw_16 "0.0" +vr_wofs_2h_yaw_17 "0.0" +vr_wofs_2h_yaw_18 "0.0" +vr_wofs_2h_yaw_19 "0.0" +vr_wofs_2h_yaw_20 "0.0" +vr_wofs_2h_yaw_21 "0.0" +vr_wofs_2h_yaw_22 "0.0" +vr_wofs_2h_yaw_23 "0.0" +vr_wofs_2h_yaw_24 "0.0" +vr_wofs_2h_yaw_25 "0.0" +vr_wofs_2h_yaw_26 "0.0" +vr_wofs_2h_yaw_27 "0.0" +vr_wofs_2h_yaw_28 "0.0" +vr_wofs_2h_yaw_29 "0.0" +vr_wofs_2h_yaw_30 "0.0" +vr_wofs_2h_yaw_31 "0.0" +vr_wofs_2h_yaw_32 "0.0" +vr_wofs_2h_z_01 "0.0" +vr_wofs_2h_z_02 "-1" +vr_wofs_2h_z_03 "0.0" +vr_wofs_2h_z_04 "0.0" +vr_wofs_2h_z_05 "-3.4" +vr_wofs_2h_z_06 "2" +vr_wofs_2h_z_07 "1.8" +vr_wofs_2h_z_08 "1" +vr_wofs_2h_z_09 "0.0" +vr_wofs_2h_z_10 "-1" +vr_wofs_2h_z_11 "2" +vr_wofs_2h_z_12 "0.0" +vr_wofs_2h_z_13 "0.0" +vr_wofs_2h_z_14 "0.0" +vr_wofs_2h_z_15 "0.0" +vr_wofs_2h_z_16 "0.0" +vr_wofs_2h_z_17 "0.0" +vr_wofs_2h_z_18 "0.0" +vr_wofs_2h_z_19 "0.0" +vr_wofs_2h_z_20 "0.0" +vr_wofs_2h_z_21 "0.0" +vr_wofs_2h_z_22 "0.0" +vr_wofs_2h_z_23 "0.0" +vr_wofs_2h_z_24 "0.0" +vr_wofs_2h_z_25 "0.0" +vr_wofs_2h_z_26 "0.0" +vr_wofs_2h_z_27 "0.0" +vr_wofs_2h_z_28 "0.0" +vr_wofs_2h_z_29 "0.0" +vr_wofs_2h_z_30 "0.0" +vr_wofs_2h_z_31 "0.0" +vr_wofs_2h_z_32 "0.0" +vr_wofs_ch_mode_z_01 "1" +vr_wofs_ch_mode_z_02 "0.0" +vr_wofs_ch_mode_z_03 "0.0" +vr_wofs_ch_mode_z_04 "0.0" +vr_wofs_ch_mode_z_05 "0.0" +vr_wofs_ch_mode_z_06 "0.0" +vr_wofs_ch_mode_z_07 "0.0" +vr_wofs_ch_mode_z_08 "0.0" +vr_wofs_ch_mode_z_09 "1" +vr_wofs_ch_mode_z_10 "0.0" +vr_wofs_ch_mode_z_11 "0.0" +vr_wofs_ch_mode_z_12 "0.0" +vr_wofs_ch_mode_z_13 "0.0" +vr_wofs_ch_mode_z_14 "0.0" +vr_wofs_ch_mode_z_15 "0.0" +vr_wofs_ch_mode_z_16 "0.0" +vr_wofs_ch_mode_z_17 "1" +vr_wofs_ch_mode_z_18 "0.0" +vr_wofs_ch_mode_z_19 "0.0" +vr_wofs_ch_mode_z_20 "0.0" +vr_wofs_ch_mode_z_21 "0.0" +vr_wofs_ch_mode_z_22 "0.0" +vr_wofs_ch_mode_z_23 "0.0" +vr_wofs_ch_mode_z_24 "0.0" +vr_wofs_ch_mode_z_25 "0.0" +vr_wofs_ch_mode_z_26 "0.0" +vr_wofs_ch_mode_z_27 "0.0" +vr_wofs_ch_mode_z_28 "0.0" +vr_wofs_ch_mode_z_29 "0.0" +vr_wofs_ch_mode_z_30 "0.0" +vr_wofs_ch_mode_z_31 "0.0" +vr_wofs_ch_mode_z_32 "0.0" +vr_wofs_gunoff_x_01 "0.0" +vr_wofs_gunoff_x_02 "0.0" +vr_wofs_gunoff_x_03 "0.0" +vr_wofs_gunoff_x_04 "0.0" +vr_wofs_gunoff_x_05 "0.0" +vr_wofs_gunoff_x_06 "0.0" +vr_wofs_gunoff_x_07 "0.0" +vr_wofs_gunoff_x_08 "0.0" +vr_wofs_gunoff_x_09 "0.0" +vr_wofs_gunoff_x_10 "0.0" +vr_wofs_gunoff_x_11 "0.0" +vr_wofs_gunoff_x_12 "0.0" +vr_wofs_gunoff_x_13 "0.0" +vr_wofs_gunoff_x_14 "0.0" +vr_wofs_gunoff_x_15 "0.0" +vr_wofs_gunoff_x_16 "0.0" +vr_wofs_gunoff_x_17 "0.0" +vr_wofs_gunoff_x_18 "0.0" +vr_wofs_gunoff_x_19 "0.0" +vr_wofs_gunoff_x_20 "0.0" +vr_wofs_gunoff_x_21 "0.0" +vr_wofs_gunoff_x_22 "0.0" +vr_wofs_gunoff_x_23 "0.0" +vr_wofs_gunoff_x_24 "0.0" +vr_wofs_gunoff_x_25 "0.0" +vr_wofs_gunoff_x_26 "0.0" +vr_wofs_gunoff_x_27 "0.0" +vr_wofs_gunoff_x_28 "0.0" +vr_wofs_gunoff_x_29 "0.0" +vr_wofs_gunoff_x_30 "0.0" +vr_wofs_gunoff_x_31 "0.0" +vr_wofs_gunoff_x_32 "0.0" +vr_wofs_gunoff_y_01 "0.0" +vr_wofs_gunoff_y_02 "0.0" +vr_wofs_gunoff_y_03 "0.0" +vr_wofs_gunoff_y_04 "0.0" +vr_wofs_gunoff_y_05 "0.0" +vr_wofs_gunoff_y_06 "0.0" +vr_wofs_gunoff_y_07 "0.0" +vr_wofs_gunoff_y_08 "0.0" +vr_wofs_gunoff_y_09 "0.0" +vr_wofs_gunoff_y_10 "0.0" +vr_wofs_gunoff_y_11 "0.0" +vr_wofs_gunoff_y_12 "0.0" +vr_wofs_gunoff_y_13 "0.0" +vr_wofs_gunoff_y_14 "0.0" +vr_wofs_gunoff_y_15 "0.0" +vr_wofs_gunoff_y_16 "0.0" +vr_wofs_gunoff_y_17 "0.0" +vr_wofs_gunoff_y_18 "0.0" +vr_wofs_gunoff_y_19 "0.0" +vr_wofs_gunoff_y_20 "0.0" +vr_wofs_gunoff_y_21 "0.0" +vr_wofs_gunoff_y_22 "0.0" +vr_wofs_gunoff_y_23 "0.0" +vr_wofs_gunoff_y_24 "0.0" +vr_wofs_gunoff_y_25 "0.0" +vr_wofs_gunoff_y_26 "0.0" +vr_wofs_gunoff_y_27 "0.0" +vr_wofs_gunoff_y_28 "0.0" +vr_wofs_gunoff_y_29 "0.0" +vr_wofs_gunoff_y_30 "0.0" +vr_wofs_gunoff_y_31 "0.0" +vr_wofs_gunoff_y_32 "0.0" +vr_wofs_gunoff_z_01 "0" +vr_wofs_gunoff_z_02 "0.0" +vr_wofs_gunoff_z_03 "0.0" +vr_wofs_gunoff_z_04 "0.0" +vr_wofs_gunoff_z_05 "0.0" +vr_wofs_gunoff_z_06 "0.0" +vr_wofs_gunoff_z_07 "0.0" +vr_wofs_gunoff_z_08 "0.0" +vr_wofs_gunoff_z_09 "0.0" +vr_wofs_gunoff_z_10 "0.0" +vr_wofs_gunoff_z_11 "0.0" +vr_wofs_gunoff_z_12 "0.0" +vr_wofs_gunoff_z_13 "0.0" +vr_wofs_gunoff_z_14 "0.0" +vr_wofs_gunoff_z_15 "0.0" +vr_wofs_gunoff_z_16 "0.0" +vr_wofs_gunoff_z_17 "0.0" +vr_wofs_gunoff_z_18 "0.0" +vr_wofs_gunoff_z_19 "0.0" +vr_wofs_gunoff_z_20 "0.0" +vr_wofs_gunoff_z_21 "0.0" +vr_wofs_gunoff_z_22 "0.0" +vr_wofs_gunoff_z_23 "0.0" +vr_wofs_gunoff_z_24 "0.0" +vr_wofs_gunoff_z_25 "0.0" +vr_wofs_gunoff_z_26 "0.0" +vr_wofs_gunoff_z_27 "0.0" +vr_wofs_gunoff_z_28 "0.0" +vr_wofs_gunoff_z_29 "0.0" +vr_wofs_gunoff_z_30 "0.0" +vr_wofs_gunoff_z_31 "0.0" +vr_wofs_gunoff_z_32 "0.0" +vr_wofs_hand_av_01 "3" +vr_wofs_hand_av_02 "165" +vr_wofs_hand_av_03 "54" +vr_wofs_hand_av_04 "5" +vr_wofs_hand_av_05 "28" +vr_wofs_hand_av_06 "33" +vr_wofs_hand_av_07 "12" +vr_wofs_hand_av_08 "57" +vr_wofs_hand_av_09 "0.0" +vr_wofs_hand_av_10 "4" +vr_wofs_hand_av_11 "33" +vr_wofs_hand_av_12 "0.0" +vr_wofs_hand_av_13 "0.0" +vr_wofs_hand_av_14 "0.0" +vr_wofs_hand_av_15 "0.0" +vr_wofs_hand_av_16 "0.0" +vr_wofs_hand_av_17 "0" +vr_wofs_hand_av_18 "68" +vr_wofs_hand_av_19 "0.0" +vr_wofs_hand_av_20 "0.0" +vr_wofs_hand_av_21 "0.0" +vr_wofs_hand_av_22 "0.0" +vr_wofs_hand_av_23 "0.0" +vr_wofs_hand_av_24 "0.0" +vr_wofs_hand_av_25 "0.0" +vr_wofs_hand_av_26 "0.0" +vr_wofs_hand_av_27 "0.0" +vr_wofs_hand_av_28 "0.0" +vr_wofs_hand_av_29 "0.0" +vr_wofs_hand_av_30 "0.0" +vr_wofs_hand_av_31 "0.0" +vr_wofs_hand_av_32 "0.0" +vr_wofs_hand_x_01 "1.1" +vr_wofs_hand_x_02 "1.899994" +vr_wofs_hand_x_03 "3.1" +vr_wofs_hand_x_04 "-0.3" +vr_wofs_hand_x_05 "-1.4" +vr_wofs_hand_x_06 "0.4" +vr_wofs_hand_x_07 "1.300005" +vr_wofs_hand_x_08 "2.2" +vr_wofs_hand_x_09 "1.6" +vr_wofs_hand_x_10 "-17.100044" +vr_wofs_hand_x_11 "0.4" +vr_wofs_hand_x_12 "0.0" +vr_wofs_hand_x_13 "0.0" +vr_wofs_hand_x_14 "0.0" +vr_wofs_hand_x_15 "0.0" +vr_wofs_hand_x_16 "0.0" +vr_wofs_hand_x_17 "1.6" +vr_wofs_hand_x_18 "0.8" +vr_wofs_hand_x_19 "0.0" +vr_wofs_hand_x_20 "0.0" +vr_wofs_hand_x_21 "0.0" +vr_wofs_hand_x_22 "0.0" +vr_wofs_hand_x_23 "0.0" +vr_wofs_hand_x_24 "0.0" +vr_wofs_hand_x_25 "0.0" +vr_wofs_hand_x_26 "0.0" +vr_wofs_hand_x_27 "0.0" +vr_wofs_hand_x_28 "0.0" +vr_wofs_hand_x_29 "0.0" +vr_wofs_hand_x_30 "0.0" +vr_wofs_hand_x_31 "0.0" +vr_wofs_hand_x_32 "0.0" +vr_wofs_hand_y_01 "-1.55" +vr_wofs_hand_y_02 "-3.1" +vr_wofs_hand_y_03 "-4.8" +vr_wofs_hand_y_04 "-8.299998" +vr_wofs_hand_y_05 "-6.7" +vr_wofs_hand_y_06 "-5.3" +vr_wofs_hand_y_07 "-9.900002" +vr_wofs_hand_y_08 "-7.199998" +vr_wofs_hand_y_09 "-5.9" +vr_wofs_hand_y_10 "-5.5" +vr_wofs_hand_y_11 "-5.3" +vr_wofs_hand_y_12 "0.0" +vr_wofs_hand_y_13 "0.0" +vr_wofs_hand_y_14 "0.0" +vr_wofs_hand_y_15 "0.0" +vr_wofs_hand_y_16 "0.0" +vr_wofs_hand_y_17 "-4.25" +vr_wofs_hand_y_18 "-6.5" +vr_wofs_hand_y_19 "0.0" +vr_wofs_hand_y_20 "0.0" +vr_wofs_hand_y_21 "0.0" +vr_wofs_hand_y_22 "0.0" +vr_wofs_hand_y_23 "0.0" +vr_wofs_hand_y_24 "0.0" +vr_wofs_hand_y_25 "0.0" +vr_wofs_hand_y_26 "0.0" +vr_wofs_hand_y_27 "0.0" +vr_wofs_hand_y_28 "0.0" +vr_wofs_hand_y_29 "0.0" +vr_wofs_hand_y_30 "0.0" +vr_wofs_hand_y_31 "0.0" +vr_wofs_hand_y_32 "0.0" +vr_wofs_hand_z_01 "-0.3" +vr_wofs_hand_z_02 "0.7" +vr_wofs_hand_z_03 "2.5" +vr_wofs_hand_z_04 "0.3" +vr_wofs_hand_z_05 "2.5" +vr_wofs_hand_z_06 "1.9" +vr_wofs_hand_z_07 "1" +vr_wofs_hand_z_08 "-1.65" +vr_wofs_hand_z_09 "5.2" +vr_wofs_hand_z_10 "10.3" +vr_wofs_hand_z_11 "1.9" +vr_wofs_hand_z_12 "0.0" +vr_wofs_hand_z_13 "0.0" +vr_wofs_hand_z_14 "0.0" +vr_wofs_hand_z_15 "0.0" +vr_wofs_hand_z_16 "0.0" +vr_wofs_hand_z_17 "2" +vr_wofs_hand_z_18 "1.4" +vr_wofs_hand_z_19 "0.0" +vr_wofs_hand_z_20 "0.0" +vr_wofs_hand_z_21 "0.0" +vr_wofs_hand_z_22 "0.0" +vr_wofs_hand_z_23 "0.0" +vr_wofs_hand_z_24 "0.0" +vr_wofs_hand_z_25 "0.0" +vr_wofs_hand_z_26 "0.0" +vr_wofs_hand_z_27 "0.0" +vr_wofs_hand_z_28 "0.0" +vr_wofs_hand_z_29 "0.0" +vr_wofs_hand_z_30 "0.0" +vr_wofs_hand_z_31 "0.0" +vr_wofs_hand_z_32 "0.0" +vr_wofs_hide_hand_01 "0.0" +vr_wofs_hide_hand_02 "0" +vr_wofs_hide_hand_03 "0.0" +vr_wofs_hide_hand_04 "0.0" +vr_wofs_hide_hand_05 "0.0" +vr_wofs_hide_hand_06 "0" +vr_wofs_hide_hand_07 "0.0" +vr_wofs_hide_hand_08 "0.0" +vr_wofs_hide_hand_09 "0.0" +vr_wofs_hide_hand_10 "0.0" +vr_wofs_hide_hand_11 "0.0" +vr_wofs_hide_hand_12 "0.0" +vr_wofs_hide_hand_13 "0.0" +vr_wofs_hide_hand_14 "0.0" +vr_wofs_hide_hand_15 "0.0" +vr_wofs_hide_hand_16 "0.0" +vr_wofs_hide_hand_17 "0" +vr_wofs_hide_hand_18 "0.0" +vr_wofs_hide_hand_19 "0.0" +vr_wofs_hide_hand_20 "0.0" +vr_wofs_hide_hand_21 "0.0" +vr_wofs_hide_hand_22 "0.0" +vr_wofs_hide_hand_23 "0.0" +vr_wofs_hide_hand_24 "0.0" +vr_wofs_hide_hand_25 "0.0" +vr_wofs_hide_hand_26 "0.0" +vr_wofs_hide_hand_27 "0.0" +vr_wofs_hide_hand_28 "0.0" +vr_wofs_hide_hand_29 "0.0" +vr_wofs_hide_hand_30 "0.0" +vr_wofs_hide_hand_31 "0.0" +vr_wofs_hide_hand_32 "0.0" +vr_wofs_id_01 "progs/v_axe.mdl" +vr_wofs_id_02 "progs/v_shot.mdl" +vr_wofs_id_03 "progs/v_shot2.mdl" +vr_wofs_id_04 "progs/v_nail.mdl" +vr_wofs_id_05 "progs/v_nail2.mdl" +vr_wofs_id_06 "progs/v_rock.mdl" +vr_wofs_id_07 "progs/v_rock2.mdl" +vr_wofs_id_08 "progs/v_light.mdl" +vr_wofs_id_09 "progs/v_hammer.mdl" +vr_wofs_id_10 "progs/v_laserg.mdl" +vr_wofs_id_11 "progs/v_prox.mdl" +vr_wofs_id_12 "progs/v_lava.mdl" +vr_wofs_id_13 "progs/v_lava2.mdl" +vr_wofs_id_14 "progs/v_multi.mdl" +vr_wofs_id_15 "progs/v_multi2.mdl" +vr_wofs_id_16 "progs/v_plasma.mdl" +vr_wofs_id_17 "progs/hand.mdl" +vr_wofs_id_18 "progs/v_grpple.mdl" +vr_wofs_id_19 "-1" +vr_wofs_id_20 "-1" +vr_wofs_id_21 "-1" +vr_wofs_id_22 "-1" +vr_wofs_id_23 "-1" +vr_wofs_id_24 "-1" +vr_wofs_id_25 "-1" +vr_wofs_id_26 "-1" +vr_wofs_id_27 "-1" +vr_wofs_id_28 "-1" +vr_wofs_id_29 "-1" +vr_wofs_id_30 "-1" +vr_wofs_id_31 "-1" +vr_wofs_id_32 "-1" +vr_wofs_length_01 "0.0" +vr_wofs_length_02 "0.0" +vr_wofs_length_03 "0.0" +vr_wofs_length_04 "0.0" +vr_wofs_length_05 "0.0" +vr_wofs_length_06 "0.0" +vr_wofs_length_07 "0.0" +vr_wofs_length_08 "0.0" +vr_wofs_length_09 "0.0" +vr_wofs_length_10 "0" +vr_wofs_length_11 "0.0" +vr_wofs_length_12 "0.0" +vr_wofs_length_13 "0.0" +vr_wofs_length_14 "0.0" +vr_wofs_length_15 "0.0" +vr_wofs_length_16 "0.0" +vr_wofs_length_17 "0.0" +vr_wofs_length_18 "0.0" +vr_wofs_length_19 "0.0" +vr_wofs_length_20 "0.0" +vr_wofs_length_21 "0.0" +vr_wofs_length_22 "0.0" +vr_wofs_length_23 "0.0" +vr_wofs_length_24 "0.0" +vr_wofs_length_25 "0.0" +vr_wofs_length_26 "0.0" +vr_wofs_length_27 "0.0" +vr_wofs_length_28 "0.0" +vr_wofs_length_29 "0.0" +vr_wofs_length_30 "0.0" +vr_wofs_length_31 "0.0" +vr_wofs_length_32 "0.0" +vr_wofs_muzzle_x_01 "12.999997" +vr_wofs_muzzle_x_02 "24.29999" +vr_wofs_muzzle_x_03 "11.299999" +vr_wofs_muzzle_x_04 "13.799999" +vr_wofs_muzzle_x_05 "24" +vr_wofs_muzzle_x_06 "-0.6" +vr_wofs_muzzle_x_07 "35.400002" +vr_wofs_muzzle_x_08 "25.400005" +vr_wofs_muzzle_x_09 "6.4" +vr_wofs_muzzle_x_10 "100" +vr_wofs_muzzle_x_11 "-0.6" +vr_wofs_muzzle_x_12 "0.0" +vr_wofs_muzzle_x_13 "0.0" +vr_wofs_muzzle_x_14 "0.0" +vr_wofs_muzzle_x_15 "0.0" +vr_wofs_muzzle_x_16 "0.0" +vr_wofs_muzzle_x_17 "-7.8" +vr_wofs_muzzle_x_18 "23.29999" +vr_wofs_muzzle_x_19 "0.0" +vr_wofs_muzzle_x_20 "0.0" +vr_wofs_muzzle_x_21 "0.0" +vr_wofs_muzzle_x_22 "0.0" +vr_wofs_muzzle_x_23 "0.0" +vr_wofs_muzzle_x_24 "0.0" +vr_wofs_muzzle_x_25 "0.0" +vr_wofs_muzzle_x_26 "0.0" +vr_wofs_muzzle_x_27 "0.0" +vr_wofs_muzzle_x_28 "0.0" +vr_wofs_muzzle_x_29 "0.0" +vr_wofs_muzzle_x_30 "0.0" +vr_wofs_muzzle_x_31 "0.0" +vr_wofs_muzzle_x_32 "0.0" +vr_wofs_muzzle_y_01 "3.4" +vr_wofs_muzzle_y_02 "3.7" +vr_wofs_muzzle_y_03 "3.4" +vr_wofs_muzzle_y_04 "6.4" +vr_wofs_muzzle_y_05 "12.699992" +vr_wofs_muzzle_y_06 "6.2" +vr_wofs_muzzle_y_07 "21.400005" +vr_wofs_muzzle_y_08 "17.49999" +vr_wofs_muzzle_y_09 "0.0" +vr_wofs_muzzle_y_10 "18.099993" +vr_wofs_muzzle_y_11 "6.2" +vr_wofs_muzzle_y_12 "0.0" +vr_wofs_muzzle_y_13 "0.0" +vr_wofs_muzzle_y_14 "0.0" +vr_wofs_muzzle_y_15 "0.0" +vr_wofs_muzzle_y_16 "0.0" +vr_wofs_muzzle_y_17 "6.8" +vr_wofs_muzzle_y_18 "16.000006" +vr_wofs_muzzle_y_19 "0.0" +vr_wofs_muzzle_y_20 "0.0" +vr_wofs_muzzle_y_21 "0.0" +vr_wofs_muzzle_y_22 "0.0" +vr_wofs_muzzle_y_23 "0.0" +vr_wofs_muzzle_y_24 "0.0" +vr_wofs_muzzle_y_25 "0.0" +vr_wofs_muzzle_y_26 "0.0" +vr_wofs_muzzle_y_27 "0.0" +vr_wofs_muzzle_y_28 "0.0" +vr_wofs_muzzle_y_29 "0.0" +vr_wofs_muzzle_y_30 "0.0" +vr_wofs_muzzle_y_31 "0.0" +vr_wofs_muzzle_y_32 "0.0" +vr_wofs_muzzle_z_01 "21.700006" +vr_wofs_muzzle_z_02 "-0.7" +vr_wofs_muzzle_z_03 "3.2" +vr_wofs_muzzle_z_04 "-2.1" +vr_wofs_muzzle_z_05 "-10.099995" +vr_wofs_muzzle_z_06 "-0.599996" +vr_wofs_muzzle_z_07 "-3.299994" +vr_wofs_muzzle_z_08 "8.999994" +vr_wofs_muzzle_z_09 "26" +vr_wofs_muzzle_z_10 "-55.599991" +vr_wofs_muzzle_z_11 "-0.600007" +vr_wofs_muzzle_z_12 "0.0" +vr_wofs_muzzle_z_13 "0.0" +vr_wofs_muzzle_z_14 "0.0" +vr_wofs_muzzle_z_15 "0.0" +vr_wofs_muzzle_z_16 "0.0" +vr_wofs_muzzle_z_17 "-4.999997" +vr_wofs_muzzle_z_18 "-0.6" +vr_wofs_muzzle_z_19 "0.0" +vr_wofs_muzzle_z_20 "0.0" +vr_wofs_muzzle_z_21 "0.0" +vr_wofs_muzzle_z_22 "0.0" +vr_wofs_muzzle_z_23 "0.0" +vr_wofs_muzzle_z_24 "0.0" +vr_wofs_muzzle_z_25 "0.0" +vr_wofs_muzzle_z_26 "0.0" +vr_wofs_muzzle_z_27 "0.0" +vr_wofs_muzzle_z_28 "0.0" +vr_wofs_muzzle_z_29 "0.0" +vr_wofs_muzzle_z_30 "0.0" +vr_wofs_muzzle_z_31 "0.0" +vr_wofs_muzzle_z_32 "0.0" +vr_wofs_offhand_x_01 "-0.25" +vr_wofs_offhand_x_02 "0" +vr_wofs_offhand_x_03 "0.0" +vr_wofs_offhand_x_04 "0.0" +vr_wofs_offhand_x_05 "0" +vr_wofs_offhand_x_06 "0" +vr_wofs_offhand_x_07 "0.0" +vr_wofs_offhand_x_08 "0" +vr_wofs_offhand_x_09 "0.0" +vr_wofs_offhand_x_10 "0.0" +vr_wofs_offhand_x_11 "0.0" +vr_wofs_offhand_x_12 "0.0" +vr_wofs_offhand_x_13 "0.0" +vr_wofs_offhand_x_14 "0.0" +vr_wofs_offhand_x_15 "0.0" +vr_wofs_offhand_x_16 "0.0" +vr_wofs_offhand_x_17 "0.1" +vr_wofs_offhand_x_18 "0.0" +vr_wofs_offhand_x_19 "0.0" +vr_wofs_offhand_x_20 "0.0" +vr_wofs_offhand_x_21 "0.0" +vr_wofs_offhand_x_22 "0.0" +vr_wofs_offhand_x_23 "0.0" +vr_wofs_offhand_x_24 "0.0" +vr_wofs_offhand_x_25 "0.0" +vr_wofs_offhand_x_26 "0.0" +vr_wofs_offhand_x_27 "0.0" +vr_wofs_offhand_x_28 "0.0" +vr_wofs_offhand_x_29 "0.0" +vr_wofs_offhand_x_30 "0.0" +vr_wofs_offhand_x_31 "0.0" +vr_wofs_offhand_x_32 "0.0" +vr_wofs_offhand_y_01 "0.15" +vr_wofs_offhand_y_02 "0.4" +vr_wofs_offhand_y_03 "0.5" +vr_wofs_offhand_y_04 "0.4" +vr_wofs_offhand_y_05 "0.3" +vr_wofs_offhand_y_06 "0.3" +vr_wofs_offhand_y_07 "0.2" +vr_wofs_offhand_y_08 "0.5" +vr_wofs_offhand_y_09 "0.4" +vr_wofs_offhand_y_10 "0.4" +vr_wofs_offhand_y_11 "0.3" +vr_wofs_offhand_y_12 "0.0" +vr_wofs_offhand_y_13 "0.0" +vr_wofs_offhand_y_14 "0.0" +vr_wofs_offhand_y_15 "0.0" +vr_wofs_offhand_y_16 "0.0" +vr_wofs_offhand_y_17 "0.8" +vr_wofs_offhand_y_18 "0.2" +vr_wofs_offhand_y_19 "0.0" +vr_wofs_offhand_y_20 "0.0" +vr_wofs_offhand_y_21 "0.0" +vr_wofs_offhand_y_22 "0.0" +vr_wofs_offhand_y_23 "0.0" +vr_wofs_offhand_y_24 "0.0" +vr_wofs_offhand_y_25 "0.0" +vr_wofs_offhand_y_26 "0.0" +vr_wofs_offhand_y_27 "0.0" +vr_wofs_offhand_y_28 "0.0" +vr_wofs_offhand_y_29 "0.0" +vr_wofs_offhand_y_30 "0.0" +vr_wofs_offhand_y_31 "0.0" +vr_wofs_offhand_y_32 "0.0" +vr_wofs_offhand_z_01 "0.0" +vr_wofs_offhand_z_02 "0" +vr_wofs_offhand_z_03 "0.0" +vr_wofs_offhand_z_04 "0.0" +vr_wofs_offhand_z_05 "0.0" +vr_wofs_offhand_z_06 "0" +vr_wofs_offhand_z_07 "0" +vr_wofs_offhand_z_08 "0" +vr_wofs_offhand_z_09 "0.0" +vr_wofs_offhand_z_10 "0" +vr_wofs_offhand_z_11 "0" +vr_wofs_offhand_z_12 "0.0" +vr_wofs_offhand_z_13 "0.0" +vr_wofs_offhand_z_14 "0.0" +vr_wofs_offhand_z_15 "0.0" +vr_wofs_offhand_z_16 "0.0" +vr_wofs_offhand_z_17 "0" +vr_wofs_offhand_z_18 "0.0" +vr_wofs_offhand_z_19 "0.0" +vr_wofs_offhand_z_20 "0.0" +vr_wofs_offhand_z_21 "0.0" +vr_wofs_offhand_z_22 "0.0" +vr_wofs_offhand_z_23 "0.0" +vr_wofs_offhand_z_24 "0.0" +vr_wofs_offhand_z_25 "0.0" +vr_wofs_offhand_z_26 "0.0" +vr_wofs_offhand_z_27 "0.0" +vr_wofs_offhand_z_28 "0.0" +vr_wofs_offhand_z_29 "0.0" +vr_wofs_offhand_z_30 "0.0" +vr_wofs_offhand_z_31 "0.0" +vr_wofs_offhand_z_32 "0.0" +vr_wofs_pitch_01 "-8" +vr_wofs_pitch_02 "-6" +vr_wofs_pitch_03 "-8" +vr_wofs_pitch_04 "-5" +vr_wofs_pitch_05 "-6.5" +vr_wofs_pitch_06 "-8.5" +vr_wofs_pitch_07 "-4.5" +vr_wofs_pitch_08 "-7" +vr_wofs_pitch_09 "-8" +vr_wofs_pitch_10 "-5.5" +vr_wofs_pitch_11 "-8.5" +vr_wofs_pitch_12 "0.0" +vr_wofs_pitch_13 "0.0" +vr_wofs_pitch_14 "0.0" +vr_wofs_pitch_15 "0.0" +vr_wofs_pitch_16 "0.0" +vr_wofs_pitch_17 "-8.500001" +vr_wofs_pitch_18 "-4.8" +vr_wofs_pitch_19 "0.0" +vr_wofs_pitch_20 "0.0" +vr_wofs_pitch_21 "0.0" +vr_wofs_pitch_22 "0.0" +vr_wofs_pitch_23 "0.0" +vr_wofs_pitch_24 "0.0" +vr_wofs_pitch_25 "0.0" +vr_wofs_pitch_26 "0.0" +vr_wofs_pitch_27 "0.0" +vr_wofs_pitch_28 "0.0" +vr_wofs_pitch_29 "0.0" +vr_wofs_pitch_30 "0.0" +vr_wofs_pitch_31 "0.0" +vr_wofs_pitch_32 "0.0" +vr_wofs_roll_01 "-2.4" +vr_wofs_roll_02 "0" +vr_wofs_roll_03 "0.0" +vr_wofs_roll_04 "0.0" +vr_wofs_roll_05 "0.0" +vr_wofs_roll_06 "0.0" +vr_wofs_roll_07 "0.0" +vr_wofs_roll_08 "0.0" +vr_wofs_roll_09 "0" +vr_wofs_roll_10 "0.0" +vr_wofs_roll_11 "0.0" +vr_wofs_roll_12 "0.0" +vr_wofs_roll_13 "0.0" +vr_wofs_roll_14 "0.0" +vr_wofs_roll_15 "0.0" +vr_wofs_roll_16 "0.0" +vr_wofs_roll_17 "-0.000002" +vr_wofs_roll_18 "0" +vr_wofs_roll_19 "0.0" +vr_wofs_roll_20 "0.0" +vr_wofs_roll_21 "0.0" +vr_wofs_roll_22 "0.0" +vr_wofs_roll_23 "0.0" +vr_wofs_roll_24 "0.0" +vr_wofs_roll_25 "0.0" +vr_wofs_roll_26 "0.0" +vr_wofs_roll_27 "0.0" +vr_wofs_roll_28 "0.0" +vr_wofs_roll_29 "0.0" +vr_wofs_roll_30 "0.0" +vr_wofs_roll_31 "0.0" +vr_wofs_roll_32 "0.0" +vr_wofs_scale_01 "0.34" +vr_wofs_scale_02 "0.44" +vr_wofs_scale_03 "0.48" +vr_wofs_scale_04 "0.48" +vr_wofs_scale_05 "0.38" +vr_wofs_scale_06 "0.38" +vr_wofs_scale_07 "0.34" +vr_wofs_scale_08 "0.35" +vr_wofs_scale_09 "0.34" +vr_wofs_scale_10 "0.34" +vr_wofs_scale_11 "0.38" +vr_wofs_scale_12 "0.5" +vr_wofs_scale_13 "0.5" +vr_wofs_scale_14 "0.5" +vr_wofs_scale_15 "0.5" +vr_wofs_scale_16 "0.5" +vr_wofs_scale_17 "0.34" +vr_wofs_scale_18 "0.33" +vr_wofs_scale_19 "0.5" +vr_wofs_scale_20 "0.5" +vr_wofs_scale_21 "0.5" +vr_wofs_scale_22 "0.5" +vr_wofs_scale_23 "0.5" +vr_wofs_scale_24 "0.5" +vr_wofs_scale_25 "0.5" +vr_wofs_scale_26 "0.5" +vr_wofs_scale_27 "0.5" +vr_wofs_scale_28 "0.5" +vr_wofs_scale_29 "0.5" +vr_wofs_scale_30 "0.5" +vr_wofs_scale_31 "0.5" +vr_wofs_scale_32 "0.5" +vr_wofs_w_2hdirmult_01 "1.0" +vr_wofs_w_2hdirmult_02 "1.0" +vr_wofs_w_2hdirmult_03 "1.0" +vr_wofs_w_2hdirmult_04 "1.0" +vr_wofs_w_2hdirmult_05 "1.0" +vr_wofs_w_2hdirmult_06 "1.0" +vr_wofs_w_2hdirmult_07 "1.0" +vr_wofs_w_2hdirmult_08 "1.0" +vr_wofs_w_2hdirmult_09 "1.0" +vr_wofs_w_2hdirmult_10 "1.0" +vr_wofs_w_2hdirmult_11 "1.0" +vr_wofs_w_2hdirmult_12 "1.0" +vr_wofs_w_2hdirmult_13 "1.0" +vr_wofs_w_2hdirmult_14 "1.0" +vr_wofs_w_2hdirmult_15 "1.0" +vr_wofs_w_2hdirmult_16 "1.0" +vr_wofs_w_2hdirmult_17 "1.0" +vr_wofs_w_2hdirmult_18 "1.0" +vr_wofs_w_2hdirmult_19 "1.0" +vr_wofs_w_2hdirmult_20 "1.0" +vr_wofs_w_2hdirmult_21 "1.0" +vr_wofs_w_2hdirmult_22 "1.0" +vr_wofs_w_2hdirmult_23 "1.0" +vr_wofs_w_2hdirmult_24 "1.0" +vr_wofs_w_2hdirmult_25 "1.0" +vr_wofs_w_2hdirmult_26 "1.0" +vr_wofs_w_2hdirmult_27 "1.0" +vr_wofs_w_2hdirmult_28 "1.0" +vr_wofs_w_2hdirmult_29 "1.0" +vr_wofs_w_2hdirmult_30 "1.0" +vr_wofs_w_2hdirmult_31 "1.0" +vr_wofs_w_2hdirmult_32 "1.0" +vr_wofs_w_2hposmult_01 "1.0" +vr_wofs_w_2hposmult_02 "1.0" +vr_wofs_w_2hposmult_03 "1.0" +vr_wofs_w_2hposmult_04 "1.0" +vr_wofs_w_2hposmult_05 "1.0" +vr_wofs_w_2hposmult_06 "1.0" +vr_wofs_w_2hposmult_07 "1.0" +vr_wofs_w_2hposmult_08 "1.0" +vr_wofs_w_2hposmult_09 "1.0" +vr_wofs_w_2hposmult_10 "1" +vr_wofs_w_2hposmult_11 "1.0" +vr_wofs_w_2hposmult_12 "1.0" +vr_wofs_w_2hposmult_13 "1.0" +vr_wofs_w_2hposmult_14 "1.0" +vr_wofs_w_2hposmult_15 "1.0" +vr_wofs_w_2hposmult_16 "1.0" +vr_wofs_w_2hposmult_17 "1.0" +vr_wofs_w_2hposmult_18 "1.0" +vr_wofs_w_2hposmult_19 "1.0" +vr_wofs_w_2hposmult_20 "1.0" +vr_wofs_w_2hposmult_21 "1.0" +vr_wofs_w_2hposmult_22 "1.0" +vr_wofs_w_2hposmult_23 "1.0" +vr_wofs_w_2hposmult_24 "1.0" +vr_wofs_w_2hposmult_25 "1.0" +vr_wofs_w_2hposmult_26 "1.0" +vr_wofs_w_2hposmult_27 "1.0" +vr_wofs_w_2hposmult_28 "1.0" +vr_wofs_w_2hposmult_29 "1.0" +vr_wofs_w_2hposmult_30 "1.0" +vr_wofs_w_2hposmult_31 "1.0" +vr_wofs_w_2hposmult_32 "1.0" +vr_wofs_w_dirmult_01 "1.0" +vr_wofs_w_dirmult_02 "1.0" +vr_wofs_w_dirmult_03 "1.0" +vr_wofs_w_dirmult_04 "1.0" +vr_wofs_w_dirmult_05 "0.73" +vr_wofs_w_dirmult_06 "0.95" +vr_wofs_w_dirmult_07 "1.0" +vr_wofs_w_dirmult_08 "1.0" +vr_wofs_w_dirmult_09 "1.0" +vr_wofs_w_dirmult_10 "0.4" +vr_wofs_w_dirmult_11 "0.95" +vr_wofs_w_dirmult_12 "1.0" +vr_wofs_w_dirmult_13 "1.0" +vr_wofs_w_dirmult_14 "1.0" +vr_wofs_w_dirmult_15 "1.0" +vr_wofs_w_dirmult_16 "1.0" +vr_wofs_w_dirmult_17 "1.0" +vr_wofs_w_dirmult_18 "1.0" +vr_wofs_w_dirmult_19 "1.0" +vr_wofs_w_dirmult_20 "1.0" +vr_wofs_w_dirmult_21 "1.0" +vr_wofs_w_dirmult_22 "1.0" +vr_wofs_w_dirmult_23 "1.0" +vr_wofs_w_dirmult_24 "1.0" +vr_wofs_w_dirmult_25 "1.0" +vr_wofs_w_dirmult_26 "1.0" +vr_wofs_w_dirmult_27 "1.0" +vr_wofs_w_dirmult_28 "1.0" +vr_wofs_w_dirmult_29 "1.0" +vr_wofs_w_dirmult_30 "1.0" +vr_wofs_w_dirmult_31 "1.0" +vr_wofs_w_dirmult_32 "1.0" +vr_wofs_w_htvelmult_01 "1" +vr_wofs_w_htvelmult_02 "1.0" +vr_wofs_w_htvelmult_03 "1.0" +vr_wofs_w_htvelmult_04 "1.0" +vr_wofs_w_htvelmult_05 "0.9" +vr_wofs_w_htvelmult_06 "0.95" +vr_wofs_w_htvelmult_07 "1.0" +vr_wofs_w_htvelmult_08 "1.0" +vr_wofs_w_htvelmult_09 "1.0" +vr_wofs_w_htvelmult_10 "1.0" +vr_wofs_w_htvelmult_11 "1.0" +vr_wofs_w_htvelmult_12 "1.0" +vr_wofs_w_htvelmult_13 "1.0" +vr_wofs_w_htvelmult_14 "1.0" +vr_wofs_w_htvelmult_15 "1.0" +vr_wofs_w_htvelmult_16 "1.0" +vr_wofs_w_htvelmult_17 "1.0" +vr_wofs_w_htvelmult_18 "1.0" +vr_wofs_w_htvelmult_19 "1.0" +vr_wofs_w_htvelmult_20 "1.0" +vr_wofs_w_htvelmult_21 "1.0" +vr_wofs_w_htvelmult_22 "1.0" +vr_wofs_w_htvelmult_23 "1.0" +vr_wofs_w_htvelmult_24 "1.0" +vr_wofs_w_htvelmult_25 "1.0" +vr_wofs_w_htvelmult_26 "1.0" +vr_wofs_w_htvelmult_27 "1.0" +vr_wofs_w_htvelmult_28 "1.0" +vr_wofs_w_htvelmult_29 "1.0" +vr_wofs_w_htvelmult_30 "1.0" +vr_wofs_w_htvelmult_31 "1.0" +vr_wofs_w_htvelmult_32 "1.0" +vr_wofs_w_hvelmult_01 "1.02" +vr_wofs_w_hvelmult_02 "1.0" +vr_wofs_w_hvelmult_03 "1.0" +vr_wofs_w_hvelmult_04 "1.0" +vr_wofs_w_hvelmult_05 "0.95" +vr_wofs_w_hvelmult_06 "0.95" +vr_wofs_w_hvelmult_07 "1.0" +vr_wofs_w_hvelmult_08 "1.0" +vr_wofs_w_hvelmult_09 "1.0" +vr_wofs_w_hvelmult_10 "1.0" +vr_wofs_w_hvelmult_11 "0.95" +vr_wofs_w_hvelmult_12 "1.0" +vr_wofs_w_hvelmult_13 "1.0" +vr_wofs_w_hvelmult_14 "1.0" +vr_wofs_w_hvelmult_15 "1.0" +vr_wofs_w_hvelmult_16 "1.0" +vr_wofs_w_hvelmult_17 "1.0" +vr_wofs_w_hvelmult_18 "1.0" +vr_wofs_w_hvelmult_19 "1.0" +vr_wofs_w_hvelmult_20 "1.0" +vr_wofs_w_hvelmult_21 "1.0" +vr_wofs_w_hvelmult_22 "1.0" +vr_wofs_w_hvelmult_23 "1.0" +vr_wofs_w_hvelmult_24 "1.0" +vr_wofs_w_hvelmult_25 "1.0" +vr_wofs_w_hvelmult_26 "1.0" +vr_wofs_w_hvelmult_27 "1.0" +vr_wofs_w_hvelmult_28 "1.0" +vr_wofs_w_hvelmult_29 "1.0" +vr_wofs_w_hvelmult_30 "1.0" +vr_wofs_w_hvelmult_31 "1.0" +vr_wofs_w_hvelmult_32 "1.0" +vr_wofs_w_posmult_01 "1.0" +vr_wofs_w_posmult_02 "1.0" +vr_wofs_w_posmult_03 "1.0" +vr_wofs_w_posmult_04 "1.0" +vr_wofs_w_posmult_05 "0.73" +vr_wofs_w_posmult_06 "0.95" +vr_wofs_w_posmult_07 "1.0" +vr_wofs_w_posmult_08 "1.0" +vr_wofs_w_posmult_09 "1.0" +vr_wofs_w_posmult_10 "0.95" +vr_wofs_w_posmult_11 "0.95" +vr_wofs_w_posmult_12 "1.0" +vr_wofs_w_posmult_13 "1.0" +vr_wofs_w_posmult_14 "1.0" +vr_wofs_w_posmult_15 "1.0" +vr_wofs_w_posmult_16 "1.0" +vr_wofs_w_posmult_17 "1.0" +vr_wofs_w_posmult_18 "1.0" +vr_wofs_w_posmult_19 "1.0" +vr_wofs_w_posmult_20 "1.0" +vr_wofs_w_posmult_21 "1.0" +vr_wofs_w_posmult_22 "1.0" +vr_wofs_w_posmult_23 "1.0" +vr_wofs_w_posmult_24 "1.0" +vr_wofs_w_posmult_25 "1.0" +vr_wofs_w_posmult_26 "1.0" +vr_wofs_w_posmult_27 "1.0" +vr_wofs_w_posmult_28 "1.0" +vr_wofs_w_posmult_29 "1.0" +vr_wofs_w_posmult_30 "1.0" +vr_wofs_w_posmult_31 "1.0" +vr_wofs_w_posmult_32 "1.0" +vr_wofs_weight_01 "0.6" +vr_wofs_weight_02 "0.65" +vr_wofs_weight_03 "0.7" +vr_wofs_weight_04 "0.65" +vr_wofs_weight_05 "0.76" +vr_wofs_weight_06 "0.82" +vr_wofs_weight_07 "0.9" +vr_wofs_weight_08 "0.8" +vr_wofs_weight_09 "0.78" +vr_wofs_weight_10 "0.96" +vr_wofs_weight_11 "0.82" +vr_wofs_weight_12 "0.0" +vr_wofs_weight_13 "0.0" +vr_wofs_weight_14 "0.0" +vr_wofs_weight_15 "0.0" +vr_wofs_weight_16 "0.0" +vr_wofs_weight_17 "0" +vr_wofs_weight_18 "0.4" +vr_wofs_weight_19 "0.0" +vr_wofs_weight_20 "0.0" +vr_wofs_weight_21 "0.0" +vr_wofs_weight_22 "0.0" +vr_wofs_weight_23 "0.0" +vr_wofs_weight_24 "0.0" +vr_wofs_weight_25 "0.0" +vr_wofs_weight_26 "0.0" +vr_wofs_weight_27 "0.0" +vr_wofs_weight_28 "0.0" +vr_wofs_weight_29 "0.0" +vr_wofs_weight_30 "0.0" +vr_wofs_weight_31 "0.0" +vr_wofs_weight_32 "0.0" +vr_wofs_x_01 "-0.1" +vr_wofs_x_02 "1.300001" +vr_wofs_x_03 "6.799997" +vr_wofs_x_04 "4.6" +vr_wofs_x_05 "2.0" +vr_wofs_x_06 "11.100022" +vr_wofs_x_07 "7.40001" +vr_wofs_x_08 "3" +vr_wofs_x_09 "1.6" +vr_wofs_x_10 "-0.4" +vr_wofs_x_11 "11.099998" +vr_wofs_x_12 "-5" +vr_wofs_x_13 "0" +vr_wofs_x_14 "10" +vr_wofs_x_15 "10" +vr_wofs_x_16 "3" +vr_wofs_x_17 "2.25" +vr_wofs_x_18 "-1.45" +vr_wofs_x_19 "1.5" +vr_wofs_x_20 "1.5" +vr_wofs_x_21 "1.5" +vr_wofs_x_22 "1.5" +vr_wofs_x_23 "1.5" +vr_wofs_x_24 "1.5" +vr_wofs_x_25 "1.5" +vr_wofs_x_26 "1.5" +vr_wofs_x_27 "1.5" +vr_wofs_x_28 "1.5" +vr_wofs_x_29 "1.5" +vr_wofs_x_30 "1.5" +vr_wofs_x_31 "1.5" +vr_wofs_x_32 "1.5" +vr_wofs_y_01 "1.1" +vr_wofs_y_02 "1.600002" +vr_wofs_y_03 "1.65" +vr_wofs_y_04 "3.1" +vr_wofs_y_05 "4.9" +vr_wofs_y_06 "2.4" +vr_wofs_y_07 "7.25" +vr_wofs_y_08 "6.15" +vr_wofs_y_09 "3.45" +vr_wofs_y_10 "6.1" +vr_wofs_y_11 "2.4" +vr_wofs_y_12 "3" +vr_wofs_y_13 "3" +vr_wofs_y_14 "1.5" +vr_wofs_y_15 "7" +vr_wofs_y_16 "4" +vr_wofs_y_17 "2.45" +vr_wofs_y_18 "5.25" +vr_wofs_y_19 "1" +vr_wofs_y_20 "1" +vr_wofs_y_21 "1" +vr_wofs_y_22 "1" +vr_wofs_y_23 "1" +vr_wofs_y_24 "1" +vr_wofs_y_25 "1" +vr_wofs_y_26 "1" +vr_wofs_y_27 "1" +vr_wofs_y_28 "1" +vr_wofs_y_29 "1" +vr_wofs_y_30 "1" +vr_wofs_y_31 "1" +vr_wofs_y_32 "1" +vr_wofs_yaw_01 "-2.7" +vr_wofs_yaw_02 "0" +vr_wofs_yaw_03 "0" +vr_wofs_yaw_04 "0.0" +vr_wofs_yaw_05 "0.0" +vr_wofs_yaw_06 "0.5" +vr_wofs_yaw_07 "0.5" +vr_wofs_yaw_08 "0" +vr_wofs_yaw_09 "-2.5" +vr_wofs_yaw_10 "0" +vr_wofs_yaw_11 "0.5" +vr_wofs_yaw_12 "0.0" +vr_wofs_yaw_13 "0.0" +vr_wofs_yaw_14 "0.0" +vr_wofs_yaw_15 "0.0" +vr_wofs_yaw_16 "0.0" +vr_wofs_yaw_17 "0" +vr_wofs_yaw_18 "0.0" +vr_wofs_yaw_19 "0.0" +vr_wofs_yaw_20 "0.0" +vr_wofs_yaw_21 "0.0" +vr_wofs_yaw_22 "0.0" +vr_wofs_yaw_23 "0.0" +vr_wofs_yaw_24 "0.0" +vr_wofs_yaw_25 "0.0" +vr_wofs_yaw_26 "0.0" +vr_wofs_yaw_27 "0.0" +vr_wofs_yaw_28 "0.0" +vr_wofs_yaw_29 "0.0" +vr_wofs_yaw_30 "0.0" +vr_wofs_yaw_31 "0.0" +vr_wofs_yaw_32 "0.0" +vr_wofs_z_01 "-0.6" +vr_wofs_z_02 "0.599979" +vr_wofs_z_03 "-1.300011" +vr_wofs_z_04 "1.199975" +vr_wofs_z_05 "2.75" +vr_wofs_z_06 "-1.000028" +vr_wofs_z_07 "0.499956" +vr_wofs_z_08 "-3.1" +vr_wofs_z_09 "-1.35" +vr_wofs_z_10 "13.199994" +vr_wofs_z_11 "-1" +vr_wofs_z_12 "15" +vr_wofs_z_13 "19" +vr_wofs_z_14 "13" +vr_wofs_z_15 "19" +vr_wofs_z_16 "13" +vr_wofs_z_17 "-1.1" +vr_wofs_z_18 "-0.45" +vr_wofs_z_19 "10" +vr_wofs_z_20 "10" +vr_wofs_z_21 "10" +vr_wofs_z_22 "10" +vr_wofs_z_23 "10" +vr_wofs_z_24 "10" +vr_wofs_z_25 "10" +vr_wofs_z_26 "10" +vr_wofs_z_27 "10" +vr_wofs_z_28 "10" +vr_wofs_z_29 "10" +vr_wofs_z_30 "10" +vr_wofs_z_31 "10" +vr_wofs_z_32 "10" +vr_world_scale "1.25" +vr_wpn_dir_weight "1" +vr_wpn_dir_weight_2h_help_mult "1.0" +vr_wpn_dir_weight_2h_help_offset "0.3" +vr_wpn_dir_weight_mult "1" +vr_wpn_dir_weight_offset "0.05" +vr_wpn_pos_weight "1" +vr_wpn_pos_weight_2h_help_mult "1.0" +vr_wpn_pos_weight_2h_help_offset "0.3" +vr_wpn_pos_weight_mult "1.0" +vr_wpn_pos_weight_offset "0.0" +vid_restart ++mlook diff --git a/old/old_r_part.cpp b/old/old_r_part.cpp new file mode 100644 index 00000000..5f490eb3 --- /dev/null +++ b/old/old_r_part.cpp @@ -0,0 +1,74 @@ +#else +void R_DrawParticles() +{ + if(!r_particles.value) + { + return; + } + + const auto up = vup * 1.5_qf; + const auto right = vright * 1.5_qf; + + using namespace quake::util; + + // TODO VR: (P2) this could be optimized a lot + // https://community.khronos.org/t/drawing-my-quads-faster/61312/2 + pMgr.forBuffers([&](gltexture_t* texture, const ImageData& imageData, + ParticleBuffer& pBuffer) { + (void)imageData; + + GL_Bind(texture); + glEnable(GL_BLEND); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glDepthMask(GL_FALSE); // johnfitz -- fix for particle z-buffer bug + + glBegin(GL_QUADS); + pBuffer.forActive([&](PHandle p) { + // johnfitz -- particle transparency and fade out + GLubyte* c = (GLubyte*)&d_8to24table[(int)p.color()]; + + GLubyte color[4]; + color[0] = c[0]; + color[1] = c[1]; + color[2] = c[2]; + color[3] = p.alpha() > 0 ? p.alpha() : 0; + + glColor4ubv(color); + + const auto xFwd = p.org() - r_origin; + + // TODO VR: (P2) `glm::rotate` is the bottleneck in debug mode (!) + const auto xUp = glm::rotate(up, qfloat(p.angle()), xFwd); + const auto xRight = glm::rotate(right, qfloat(p.angle()), xFwd); + + const auto halfScale = p.scale() / 2._qf; + const auto xLeft = -xRight; + const auto xDown = -xUp; + const auto xUpLeft = p.org() + halfScale * xUp + halfScale * xLeft; + const auto xUpRight = + p.org() + halfScale * xUp + halfScale * xRight; + const auto xDownLeft = + p.org() + halfScale * xDown + halfScale * xLeft; + const auto xDownRight = + p.org() + halfScale * xDown + halfScale * xRight; + + glTexCoord2f(0, 0); + glVertex3fv(toGlVec(xDownLeft)); + + glTexCoord2f(1, 0); + glVertex3fv(toGlVec(xUpLeft)); + + glTexCoord2f(1, 1); + glVertex3fv(toGlVec(xUpRight)); + + glTexCoord2f(0, 1); + glVertex3fv(toGlVec(xDownRight)); + }); + glEnd(); + + glDepthMask(GL_TRUE); // johnfitz -- fix for particle z-buffer bug + glDisable(GL_BLEND); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + glColor3f(1, 1, 1); + }); +} diff --git a/old/scratchpad.cpp b/old/scratchpad.cpp index ac32e4ea..881c98db 100644 --- a/old/scratchpad.cpp +++ b/old/scratchpad.cpp @@ -1207,3 +1207,85 @@ void SV_Physics_Toss(edict_t* ent) // check for in water SV_CheckWaterTransition(ent); } + + + Mod_ForAllKnownNames([](const char* name) { + const std::string_view s{name}; + + const auto endsWith = [&s](const std::string_view sv) { + return s.size() >= sv.size() && + s.compare(s.size() - sv.size(), std::string::npos, sv) == 0; + }; + + if(!endsWith(".bsp")) + { + return; + } + + const auto isAnyOf = [&s](const auto& range) { + return std::any_of(std::begin(range), std::end(range), + [&s](const auto& x) { return x == s; }); + }; + + const auto alreadySeen = + isAnyOf(mapsVanilla) || isAnyOf(mapsSoa) || isAnyOf(mapsDopa); + + if(!alreadySeen) + { + mapsExtra.emplace_back(s); + } + }); + + +// by Qmaster +Wrist flick:: +========= +Should be doable if you know the hand location with both time and distance check. Pseudocode: +float lasthandpos; //store hand position every flicktime tick +float flicktime = 0.200; // or reasonable time in secs for flick check..,should probably get from cvar +float flickthreshholddistance = 4; // again, should be using a cvar for testing ease and player customizability +float flickfinished; + +Then wherever you normally check hand position call this: +bool() FlickCheck = { +if (!grab button is pressed) return false; + +// typical check every time interval +if (flickfinished flickthreshholddistance) return true; +} +} +}; + + + + const auto handAnimationToFrame = [](const VrHandAnimation x) { + if(x == VrHandAnimation::Open) + { + return 9; + } + + if(x == VrHandAnimation::Pointing) + { + return 3; + } + + if(x == VrHandAnimation::Fist) + { + return 6; + } + + if(x == VrHandAnimation::AlmostPointing) + { + return 2; + } + + assert(x == VrHandAnimation::OkSign); + return 15; + }; + + + diff --git a/old/wip.glsl b/old/wip.glsl new file mode 100644 index 00000000..4e2f1ef6 --- /dev/null +++ b/old/wip.glsl @@ -0,0 +1,23 @@ +#version 430 core + +layout(location = 0) in vec3 pOrg; +layout(location = 1) in float pAngle; +layout(location = 2) in float pScale; +layout(location = 3) in vec4 pColor; +layout(location = 4) in int pAtlasIdx; + +out VS_OUT { + float opAngle; + float opScale; + vec4 opColor; + int opAtlasIdx; +} vs_out; + +void main() +{ + gl_Position = vec4(pOrg, 1.0); + vs_out.opAngle = pAngle; + vs_out.opScale = pScale; + vs_out.opColor = pColor; + vs_out.opAtlasIdx = pAtlasIdx; +} diff --git a/old/wip.gsls.cpp b/old/wip.gsls.cpp new file mode 100644 index 00000000..4e2f1ef6 --- /dev/null +++ b/old/wip.gsls.cpp @@ -0,0 +1,23 @@ +#version 430 core + +layout(location = 0) in vec3 pOrg; +layout(location = 1) in float pAngle; +layout(location = 2) in float pScale; +layout(location = 3) in vec4 pColor; +layout(location = 4) in int pAtlasIdx; + +out VS_OUT { + float opAngle; + float opScale; + vec4 opColor; + int opAtlasIdx; +} vs_out; + +void main() +{ + gl_Position = vec4(pOrg, 1.0); + vs_out.opAngle = pAngle; + vs_out.opScale = pScale; + vs_out.opColor = pColor; + vs_out.opAtlasIdx = pAtlasIdx; +} diff --git a/webpage/quakevr.html b/webpage/quakevr.html index 015aebfb..0695cafd 100644 --- a/webpage/quakevr.html +++ b/webpage/quakevr.html @@ -11253,16 +11253,14 @@

Fully Room-Scale

-

Many Settings

-

Laser crosshair? Holster thresholds? Play the game exactly how you - want to.

+

Multiplayer Support

+

Nostalgic fast-paced action over the internet or against bots.

-

Scourge Of Armagon

-

Full support for Mission Pack 1, including Mjolnir and the Laser - Cannon!

+

Mission Packs

+

Full support for Scourge of Armagon and Dissolution of Eternity!